summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcvs2git <rtems-devel@rtems.org>1998-10-29 16:42:52 +0000
committercvs2git <rtems-devel@rtems.org>1998-10-29 16:42:52 +0000
commit72556a94342bc02ff6b10f0e29019afebcb6b469 (patch)
treed884e1fc5fcb848605d961e8a82d7748795e91f4
parent2119f9d4b1c495084ca51f0cb9aec3d1f5620462 (diff)
This commit was manufactured by cvs2svn to create tag 'rtemsdoc-4-0-0-aux'.rtemsdoc-4-0-0-aux
Sprout from master 1998-10-29 16:42:51 UTC Joel Sherrill <joel.sherrill@OARcorp.com> 'making release docs' Cherrypick from master 1997-05-28 13:57:50 UTC Joel Sherrill <joel.sherrill@OARcorp.com> '4.0.0 release docs': doc/common/missing-arrow.gif doc/common/next-arrow.gif doc/common/prev-arrow.gif doc/common/timing.texi doc/import_ami_txt doc/new_chapters/base.texi doc/new_chapters/clock.texi doc/new_chapters/cond.texi doc/new_chapters/key.texi doc/new_chapters/mutex.texi doc/new_chapters/posix_test_plan.texi doc/new_chapters/sched.texi doc/new_chapters/signal.texi doc/new_chapters/thread.texi doc/posix_users/posix_test_plan.texi doc/rtems.html doc/supplements/hppa1_1/TIMES doc/supplements/hppa1_1/bsp.texi doc/supplements/hppa1_1/callconv.texi doc/supplements/hppa1_1/cpumodel.texi doc/supplements/hppa1_1/cputable.texi doc/supplements/hppa1_1/fatalerr.texi doc/supplements/hppa1_1/intr.t doc/supplements/hppa1_1/memmodel.texi doc/supplements/hppa1_1/timedata.t doc/supplements/i386/bsp.texi doc/supplements/i386/callconv.texi doc/supplements/i386/cpumodel.texi doc/supplements/i386/cputable.texi doc/supplements/i386/fatalerr.texi doc/supplements/i386/intr.t doc/supplements/i386/memmodel.texi doc/supplements/i386/timedata.t doc/supplements/i960/bsp.texi doc/supplements/i960/callconv.texi doc/supplements/i960/cpumodel.texi doc/supplements/i960/cputable.texi doc/supplements/i960/fatalerr.texi doc/supplements/i960/intr.t doc/supplements/i960/memmodel.texi doc/supplements/i960/timedata.t doc/supplements/m68k/timedata.t doc/supplements/sparc/SIS_TIMES doc/supplements/sparc/bsp.texi doc/supplements/sparc/callconv.texi doc/supplements/sparc/cpumodel.texi doc/supplements/sparc/cputable.texi doc/supplements/sparc/fatalerr.texi doc/supplements/sparc/intr.t doc/supplements/sparc/memmodel.texi doc/supplements/sparc/timedata.t doc/tools/bmenu/bmenu doc/tools/bmenu/chain.o doc/tools/bmenu/main.o Cherrypick from rtemsdoc-4-5-branch 1997-06-16 21:30:08 UTC Joel Sherrill <joel.sherrill@OARcorp.com> 'base PDL 2 TEXI': doc/common/treedef.tex doc/tools/pdl2texi/address.h doc/tools/pdl2texi/address.inl doc/tools/pdl2texi/chain.c doc/tools/pdl2texi/chain.h doc/tools/pdl2texi/chain.inl doc/tools/pdl2texi/isr.h doc/tools/pdl2texi/s.d doc/tools/pdl2texi/sample.d doc/tools/pdl2texi/system.h Delete: COPYING INSTALL LICENSE Makefile.in README README.configure SUPPORT VERSION aclocal.m4 aclocal/ar-s.m4 aclocal/canonical-target-name.m4 aclocal/canonicalize-tools.m4 aclocal/check-files-in.m4 aclocal/check-makefile.m4 aclocal/cygwin.m4 aclocal/exeext.m4 aclocal/gcc-pipe.m4 aclocal/gcc-specs.m4 aclocal/i386-gas-code16.m4 aclocal/mkdir.m4 aclocal/prog-cc.m4 aclocal/prog-cxx.m4 aclocal/sysv-ipc.m4 aclocal/tool-prefix.m4 c/ACKNOWLEDGEMENTS c/Makefile.in c/PROBLEMS c/README c/README.DOS c/REQUIRES c/TESTED c/UPDATE_HELP c/build-tools/Makefile.in c/build-tools/README c/build-tools/cklength.c c/build-tools/eolstrip.c c/build-tools/install-if-change.in c/build-tools/lock-directory.in c/build-tools/os/Makefile.in c/build-tools/os/msdos/Makefile.in c/build-tools/os/msdos/README c/build-tools/os/msdos/cklength.uue c/build-tools/os/msdos/fixtimer.c c/build-tools/os/msdos/fixtimer.uue c/build-tools/os/msdos/ifc.c c/build-tools/os/msdos/ifc_exe.uue c/build-tools/packhex.c c/build-tools/rcs-clean.in c/build-tools/scripts/Makefile.in c/build-tools/scripts/README c/build-tools/scripts/install-if-change.in c/build-tools/scripts/lock-directory.in c/build-tools/scripts/rcs-clean.in c/build-tools/scripts/search-id.sh c/build-tools/scripts/unlock-directory.in c/build-tools/search-id.sh c/build-tools/src/Makefile.in c/build-tools/src/cklength.c c/build-tools/src/config.h.in c/build-tools/src/eolstrip.c c/build-tools/src/packhex.c c/build-tools/src/unhex.c c/build-tools/unhex.c c/build-tools/unlock-directory.in c/src/Makefile.in c/src/README c/src/ada-tests/mptests/mp01/config.h c/src/ada-tests/mptests/mp01/mp01.adb c/src/ada-tests/mptests/mp01/mptest.adb c/src/ada-tests/mptests/mp01/mptest.ads c/src/ada-tests/mptests/mp01/node1/mp01.scn c/src/ada-tests/mptests/mp01/node1/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp01/node2/mp01.scn c/src/ada-tests/mptests/mp01/node2/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp02/mptest.adb c/src/ada-tests/mptests/mp02/mptest.ads c/src/ada-tests/mptests/mp02/node1/mp02.scn c/src/ada-tests/mptests/mp02/node1/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp02/node2/mp02.scn c/src/ada-tests/mptests/mp02/node2/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp03/mptest.adb c/src/ada-tests/mptests/mp03/mptest.ads c/src/ada-tests/mptests/mp03/node1/mp03.scn c/src/ada-tests/mptests/mp03/node1/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp03/node2/mp03.scn c/src/ada-tests/mptests/mp03/node2/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp04/mptest.adb c/src/ada-tests/mptests/mp04/mptest.ads c/src/ada-tests/mptests/mp04/node1/mp04.scn c/src/ada-tests/mptests/mp04/node1/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp04/node2/mp04.scn c/src/ada-tests/mptests/mp04/node2/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp05/mptest.adb c/src/ada-tests/mptests/mp05/mptest.ads c/src/ada-tests/mptests/mp05/node1/mp05.scn c/src/ada-tests/mptests/mp05/node1/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp05/node2/mp05.scn c/src/ada-tests/mptests/mp05/node2/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp06/mptest.adb c/src/ada-tests/mptests/mp06/mptest.ads c/src/ada-tests/mptests/mp06/node1/mp06.scn c/src/ada-tests/mptests/mp06/node1/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp06/node2/mp06.scn c/src/ada-tests/mptests/mp06/node2/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp07/mptest.adb c/src/ada-tests/mptests/mp07/mptest.ads c/src/ada-tests/mptests/mp07/node1/mp07.scn c/src/ada-tests/mptests/mp07/node1/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp07/node2/mp07.scn c/src/ada-tests/mptests/mp07/node2/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp08/mptest.adb c/src/ada-tests/mptests/mp08/mptest.ads c/src/ada-tests/mptests/mp08/node1/mp08.scn c/src/ada-tests/mptests/mp08/node1/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp08/node2/mp08.scn c/src/ada-tests/mptests/mp08/node2/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp09/mptest.adb c/src/ada-tests/mptests/mp09/mptest.ads c/src/ada-tests/mptests/mp09/node1/mp09.scn c/src/ada-tests/mptests/mp09/node1/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp09/node2/mp09.scn c/src/ada-tests/mptests/mp09/node2/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp10/mptest.adb c/src/ada-tests/mptests/mp10/mptest.ads c/src/ada-tests/mptests/mp10/node1/mp10.scn c/src/ada-tests/mptests/mp10/node1/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp10/node2/mp10.scn c/src/ada-tests/mptests/mp10/node2/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp11/mptest.adb c/src/ada-tests/mptests/mp11/mptest.ads c/src/ada-tests/mptests/mp11/node1/mp11.scn c/src/ada-tests/mptests/mp11/node1/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp11/node2/mp11.scn c/src/ada-tests/mptests/mp11/node2/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp12/mptest.adb c/src/ada-tests/mptests/mp12/mptest.ads c/src/ada-tests/mptests/mp12/node1/mp12.scn c/src/ada-tests/mptests/mp12/node1/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp12/node2/mp12.scn c/src/ada-tests/mptests/mp12/node2/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp13/mptest.adb c/src/ada-tests/mptests/mp13/mptest.ads c/src/ada-tests/mptests/mp13/node1/mp13.scn c/src/ada-tests/mptests/mp13/node1/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp13/node2/mp13.scn c/src/ada-tests/mptests/mp13/node2/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp14/mptest.adb c/src/ada-tests/mptests/mp14/mptest.ads c/src/ada-tests/mptests/mp14/node1/mp14.scn c/src/ada-tests/mptests/mp14/node1/mptest-per_node_configuration.adb c/src/ada-tests/mptests/mp14/node2/mp14.scn c/src/ada-tests/mptests/mp14/node2/mptest-per_node_configuration.adb c/src/ada-tests/samples/base_mp/mptest.adb c/src/ada-tests/samples/base_mp/mptest.ads c/src/ada-tests/samples/base_mp/node1/base_mp.scn c/src/ada-tests/samples/base_mp/node1/mptest-per_node_configuration.adb c/src/ada-tests/samples/base_mp/node2/base_mp.scn c/src/ada-tests/samples/base_mp/node2/mptest-per_node_configuration.adb c/src/ada-tests/samples/base_sp/base_sp.adb c/src/ada-tests/samples/base_sp/base_sp.scn c/src/ada-tests/samples/base_sp/config.h c/src/ada-tests/samples/base_sp/sptest.adb c/src/ada-tests/samples/base_sp/sptest.ads c/src/ada-tests/samples/hello/config.h c/src/ada-tests/samples/hello/hello.adb c/src/ada-tests/samples/hello/hello.scn c/src/ada-tests/samples/hello/sptest.adb c/src/ada-tests/samples/hello/sptest.ads c/src/ada-tests/samples/ticker/config.h c/src/ada-tests/samples/ticker/sptest.adb c/src/ada-tests/samples/ticker/sptest.ads c/src/ada-tests/samples/ticker/ticker.adb c/src/ada-tests/samples/ticker/ticker.scn c/src/ada-tests/sptests/sp01/config.h c/src/ada-tests/sptests/sp01/sp01.adb c/src/ada-tests/sptests/sp01/sp01.scn c/src/ada-tests/sptests/sp01/sptest.adb c/src/ada-tests/sptests/sp01/sptest.ads c/src/ada-tests/sptests/sp02/config.h c/src/ada-tests/sptests/sp02/sp02.adb c/src/ada-tests/sptests/sp02/sp02.scn c/src/ada-tests/sptests/sp02/sptest.adb c/src/ada-tests/sptests/sp02/sptest.ads c/src/ada-tests/sptests/sp03/config.h c/src/ada-tests/sptests/sp03/sp03.adb c/src/ada-tests/sptests/sp03/sp03.scn c/src/ada-tests/sptests/sp03/sptest.adb c/src/ada-tests/sptests/sp03/sptest.ads c/src/ada-tests/sptests/sp04/README c/src/ada-tests/sptests/sp04/config.h c/src/ada-tests/sptests/sp04/sp04.adb c/src/ada-tests/sptests/sp04/sp04.scn c/src/ada-tests/sptests/sp04/sptest.adb c/src/ada-tests/sptests/sp04/sptest.ads c/src/ada-tests/sptests/sp05/config.h c/src/ada-tests/sptests/sp05/sp05.adb c/src/ada-tests/sptests/sp05/sp05.scn c/src/ada-tests/sptests/sp05/sptest.adb c/src/ada-tests/sptests/sp05/sptest.ads c/src/ada-tests/sptests/sp06/config.h c/src/ada-tests/sptests/sp06/sp06.adb c/src/ada-tests/sptests/sp06/sp06.scn c/src/ada-tests/sptests/sp06/sptest.adb c/src/ada-tests/sptests/sp06/sptest.ads c/src/ada-tests/sptests/sp07/config.h c/src/ada-tests/sptests/sp07/sp07.adb c/src/ada-tests/sptests/sp07/sp07.scn c/src/ada-tests/sptests/sp07/sptest.adb c/src/ada-tests/sptests/sp07/sptest.ads c/src/ada-tests/sptests/sp08/config.h c/src/ada-tests/sptests/sp08/sp08.adb c/src/ada-tests/sptests/sp08/sp08.scn c/src/ada-tests/sptests/sp08/sptest.adb c/src/ada-tests/sptests/sp08/sptest.ads c/src/ada-tests/sptests/sp09/config.h c/src/ada-tests/sptests/sp09/sp09.adb c/src/ada-tests/sptests/sp09/sp09.scn c/src/ada-tests/sptests/sp09/sptest.adb c/src/ada-tests/sptests/sp09/sptest.ads c/src/ada-tests/sptests/sp11/config.h c/src/ada-tests/sptests/sp11/sp11.adb c/src/ada-tests/sptests/sp11/sp11.scn c/src/ada-tests/sptests/sp11/sptest.adb c/src/ada-tests/sptests/sp11/sptest.ads c/src/ada-tests/sptests/sp12/config.h c/src/ada-tests/sptests/sp12/sp12.adb c/src/ada-tests/sptests/sp12/sp12.scn c/src/ada-tests/sptests/sp12/sptest.adb c/src/ada-tests/sptests/sp12/sptest.ads c/src/ada-tests/sptests/sp13/config.h c/src/ada-tests/sptests/sp13/sp13.adb c/src/ada-tests/sptests/sp13/sp13.scn c/src/ada-tests/sptests/sp13/sptest.adb c/src/ada-tests/sptests/sp13/sptest.ads c/src/ada-tests/sptests/sp14/config.h c/src/ada-tests/sptests/sp14/sp14.adb c/src/ada-tests/sptests/sp14/sp14.scn c/src/ada-tests/sptests/sp14/sptest.adb c/src/ada-tests/sptests/sp14/sptest.ads c/src/ada-tests/sptests/sp15/config.h c/src/ada-tests/sptests/sp15/sp15.adb c/src/ada-tests/sptests/sp15/sp15.scn c/src/ada-tests/sptests/sp15/sptest.adb c/src/ada-tests/sptests/sp15/sptest.ads c/src/ada-tests/sptests/sp16/config.h c/src/ada-tests/sptests/sp16/sp16.adb c/src/ada-tests/sptests/sp16/sp16.scn c/src/ada-tests/sptests/sp16/sptest.adb c/src/ada-tests/sptests/sp16/sptest.ads c/src/ada-tests/sptests/sp17/config.h c/src/ada-tests/sptests/sp17/sp17.adb c/src/ada-tests/sptests/sp17/sp17.scn c/src/ada-tests/sptests/sp17/sptest.adb c/src/ada-tests/sptests/sp17/sptest.ads c/src/ada-tests/sptests/sp19/README c/src/ada-tests/sptests/sp19/config.h c/src/ada-tests/sptests/sp19/sp19.adb c/src/ada-tests/sptests/sp19/sp19.scn c/src/ada-tests/sptests/sp19/sptest.ads c/src/ada-tests/sptests/sp20/config.h c/src/ada-tests/sptests/sp20/sp20.adb c/src/ada-tests/sptests/sp20/sp20.scn c/src/ada-tests/sptests/sp20/sptest.adb c/src/ada-tests/sptests/sp20/sptest.ads c/src/ada-tests/sptests/sp21/config.h c/src/ada-tests/sptests/sp21/sp21.adb c/src/ada-tests/sptests/sp21/sp21.scn c/src/ada-tests/sptests/sp21/sptest.adb c/src/ada-tests/sptests/sp21/sptest.ads c/src/ada-tests/sptests/sp22/config.h c/src/ada-tests/sptests/sp22/sp22.adb c/src/ada-tests/sptests/sp22/sp22.scn c/src/ada-tests/sptests/sp22/sptest.adb c/src/ada-tests/sptests/sp22/sptest.ads c/src/ada-tests/sptests/sp23/config.h c/src/ada-tests/sptests/sp23/sp23.adb c/src/ada-tests/sptests/sp23/sp23.scn c/src/ada-tests/sptests/sp23/sptest.adb c/src/ada-tests/sptests/sp23/sptest.ads c/src/ada-tests/sptests/sp24/config.h c/src/ada-tests/sptests/sp24/sp24.adb c/src/ada-tests/sptests/sp24/sp24.scn c/src/ada-tests/sptests/sp24/sptest.adb c/src/ada-tests/sptests/sp24/sptest.ads c/src/ada-tests/sptests/sp25/config.h c/src/ada-tests/sptests/sp25/sp25.adb c/src/ada-tests/sptests/sp25/sp25.scn c/src/ada-tests/sptests/sp25/sptest.adb c/src/ada-tests/sptests/sp25/sptest.ads c/src/ada-tests/sptests/spsize/spsize.adb c/src/ada-tests/sptests/spsize/sptest.adb c/src/ada-tests/sptests/spsize/sptest.ads c/src/ada-tests/support/address_io.adb c/src/ada-tests/support/address_io.ads c/src/ada-tests/support/float_io.ads c/src/ada-tests/support/fp.inc c/src/ada-tests/support/init.c c/src/ada-tests/support/integer.inc c/src/ada-tests/support/rtems_calling_overhead.ads c/src/ada-tests/support/status_io.ads c/src/ada-tests/support/test_support.adb c/src/ada-tests/support/test_support.ads c/src/ada-tests/support/time_test_support.adb c/src/ada-tests/support/time_test_support.ads c/src/ada-tests/support/timer_driver.adb c/src/ada-tests/support/timer_driver.ads c/src/ada-tests/support/unsigned32_io.ads c/src/ada-tests/tmtests/tm01/config.h c/src/ada-tests/tmtests/tm01/tm01.adb c/src/ada-tests/tmtests/tm01/tmtest.adb c/src/ada-tests/tmtests/tm01/tmtest.ads c/src/ada-tests/tmtests/tm02/config.h c/src/ada-tests/tmtests/tm02/tm02.adb c/src/ada-tests/tmtests/tm02/tmtest.adb c/src/ada-tests/tmtests/tm02/tmtest.ads c/src/ada-tests/tmtests/tm03/config.h c/src/ada-tests/tmtests/tm03/tm03.adb c/src/ada-tests/tmtests/tm03/tmtest.adb c/src/ada-tests/tmtests/tm03/tmtest.ads c/src/ada-tests/tmtests/tm04/config.h c/src/ada-tests/tmtests/tm04/tm04.adb c/src/ada-tests/tmtests/tm04/tmtest.adb c/src/ada-tests/tmtests/tm04/tmtest.ads c/src/ada-tests/tmtests/tm05/config.h c/src/ada-tests/tmtests/tm05/tm05.adb c/src/ada-tests/tmtests/tm05/tmtest.adb c/src/ada-tests/tmtests/tm05/tmtest.ads c/src/ada-tests/tmtests/tm06/config.h c/src/ada-tests/tmtests/tm06/tm06.adb c/src/ada-tests/tmtests/tm06/tmtest.adb c/src/ada-tests/tmtests/tm06/tmtest.ads c/src/ada-tests/tmtests/tm07/config.h c/src/ada-tests/tmtests/tm07/tm07.adb c/src/ada-tests/tmtests/tm07/tmtest.adb c/src/ada-tests/tmtests/tm07/tmtest.ads c/src/ada-tests/tmtests/tm08/config.h c/src/ada-tests/tmtests/tm08/tm08.adb c/src/ada-tests/tmtests/tm08/tmtest.adb c/src/ada-tests/tmtests/tm08/tmtest.ads c/src/ada-tests/tmtests/tm09/config.h c/src/ada-tests/tmtests/tm09/tm09.adb c/src/ada-tests/tmtests/tm09/tmtest.adb c/src/ada-tests/tmtests/tm09/tmtest.ads c/src/ada-tests/tmtests/tm10/config.h c/src/ada-tests/tmtests/tm10/tm10.adb c/src/ada-tests/tmtests/tm10/tmtest.adb c/src/ada-tests/tmtests/tm10/tmtest.ads c/src/ada-tests/tmtests/tm11/config.h c/src/ada-tests/tmtests/tm11/tm11.adb c/src/ada-tests/tmtests/tm11/tmtest.adb c/src/ada-tests/tmtests/tm11/tmtest.ads c/src/ada-tests/tmtests/tm12/config.h c/src/ada-tests/tmtests/tm12/tm12.adb c/src/ada-tests/tmtests/tm12/tmtest.adb c/src/ada-tests/tmtests/tm12/tmtest.ads c/src/ada-tests/tmtests/tm13/config.h c/src/ada-tests/tmtests/tm13/tm13.adb c/src/ada-tests/tmtests/tm13/tmtest.adb c/src/ada-tests/tmtests/tm13/tmtest.ads c/src/ada-tests/tmtests/tm14/config.h c/src/ada-tests/tmtests/tm14/tm14.adb c/src/ada-tests/tmtests/tm14/tmtest.adb c/src/ada-tests/tmtests/tm14/tmtest.ads c/src/ada-tests/tmtests/tm15/config.h c/src/ada-tests/tmtests/tm15/tm15.adb c/src/ada-tests/tmtests/tm15/tmtest.adb c/src/ada-tests/tmtests/tm15/tmtest.ads c/src/ada-tests/tmtests/tm16/config.h c/src/ada-tests/tmtests/tm16/tm16.adb c/src/ada-tests/tmtests/tm16/tmtest.adb c/src/ada-tests/tmtests/tm16/tmtest.ads c/src/ada-tests/tmtests/tm17/config.h c/src/ada-tests/tmtests/tm17/tm17.adb c/src/ada-tests/tmtests/tm17/tmtest.adb c/src/ada-tests/tmtests/tm17/tmtest.ads c/src/ada-tests/tmtests/tm18/config.h c/src/ada-tests/tmtests/tm18/tm18.adb c/src/ada-tests/tmtests/tm18/tmtest.adb c/src/ada-tests/tmtests/tm18/tmtest.ads c/src/ada-tests/tmtests/tm19/config.h c/src/ada-tests/tmtests/tm19/tm19.adb c/src/ada-tests/tmtests/tm19/tmtest.adb c/src/ada-tests/tmtests/tm19/tmtest.ads c/src/ada-tests/tmtests/tm20/config.h c/src/ada-tests/tmtests/tm20/tm20.adb c/src/ada-tests/tmtests/tm20/tmtest.adb c/src/ada-tests/tmtests/tm20/tmtest.ads c/src/ada-tests/tmtests/tm21/config.h c/src/ada-tests/tmtests/tm21/tm21.adb c/src/ada-tests/tmtests/tm21/tmtest.adb c/src/ada-tests/tmtests/tm21/tmtest.ads c/src/ada-tests/tmtests/tm22/config.h c/src/ada-tests/tmtests/tm22/tm22.adb c/src/ada-tests/tmtests/tm22/tmtest.adb c/src/ada-tests/tmtests/tm22/tmtest.ads c/src/ada-tests/tmtests/tm23/config.h c/src/ada-tests/tmtests/tm23/tm23.adb c/src/ada-tests/tmtests/tm23/tmtest.adb c/src/ada-tests/tmtests/tm23/tmtest.ads c/src/ada-tests/tmtests/tm24/config.h c/src/ada-tests/tmtests/tm24/tm24.adb c/src/ada-tests/tmtests/tm24/tmtest.adb c/src/ada-tests/tmtests/tm24/tmtest.ads c/src/ada-tests/tmtests/tm25/config.h c/src/ada-tests/tmtests/tm25/tm25.adb c/src/ada-tests/tmtests/tm25/tmtest.adb c/src/ada-tests/tmtests/tm25/tmtest.ads c/src/ada-tests/tmtests/tm26/README c/src/ada-tests/tmtests/tm26/config.h c/src/ada-tests/tmtests/tm26/tm26.adb c/src/ada-tests/tmtests/tm26/tmtest.adp c/src/ada-tests/tmtests/tm26/tmtest.ads c/src/ada-tests/tmtests/tm27/README c/src/ada-tests/tmtests/tm27/config.h c/src/ada-tests/tmtests/tm27/tm27.adb c/src/ada-tests/tmtests/tm27/tmtest.adb c/src/ada-tests/tmtests/tm27/tmtest.ads c/src/ada-tests/tmtests/tm28/config.h c/src/ada-tests/tmtests/tm28/tm28.adb c/src/ada-tests/tmtests/tm28/tmtest.adb c/src/ada-tests/tmtests/tm28/tmtest.ads c/src/ada-tests/tmtests/tm29/config.h c/src/ada-tests/tmtests/tm29/tm29.adb c/src/ada-tests/tmtests/tm29/tmtest.adb c/src/ada-tests/tmtests/tm29/tmtest.ads c/src/ada-tests/tmtests/tmck/config.h c/src/ada-tests/tmtests/tmck/tmck.adb c/src/ada-tests/tmtests/tmck/tmtest.adb c/src/ada-tests/tmtests/tmck/tmtest.ads c/src/ada-tests/tmtests/tmoverhd/README c/src/ada-tests/tmtests/tmoverhd/config.h c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.adb c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.ads c/src/ada-tests/tmtests/tmoverhd/tmoverhd.adb c/src/ada-tests/tmtests/tmoverhd/tmtest.adb c/src/ada-tests/tmtests/tmoverhd/tmtest.ads c/src/ada/rtems.adb c/src/ada/rtems.ads c/src/exec/Makefile.in c/src/exec/libcsupport/include/chain.h c/src/exec/libcsupport/include/clockdrv.h c/src/exec/libcsupport/include/console.h c/src/exec/libcsupport/include/iosupp.h c/src/exec/libcsupport/include/motorola/mc68230.h c/src/exec/libcsupport/include/motorola/mc68681.h c/src/exec/libcsupport/include/ringbuf.h c/src/exec/libcsupport/include/rtems/assoc.h c/src/exec/libcsupport/include/rtems/error.h c/src/exec/libcsupport/include/rtems/libcsupport.h c/src/exec/libcsupport/include/rtems/libio.h c/src/exec/libcsupport/include/spurious.h c/src/exec/libcsupport/include/sys/filio.h c/src/exec/libcsupport/include/sys/ioctl.h c/src/exec/libcsupport/include/sys/sockio.h c/src/exec/libcsupport/include/sys/termios.h c/src/exec/libcsupport/include/sys/utsname.h c/src/exec/libcsupport/include/timerdrv.h c/src/exec/libcsupport/include/vmeintr.h c/src/exec/libcsupport/include/zilog/z8036.h c/src/exec/libcsupport/include/zilog/z8530.h c/src/exec/libcsupport/include/zilog/z8536.h c/src/exec/libcsupport/src/README c/src/exec/libcsupport/src/__brk.c c/src/exec/libcsupport/src/__gettod.c c/src/exec/libcsupport/src/__times.c c/src/exec/libcsupport/src/assoc.c c/src/exec/libcsupport/src/closedir.c c/src/exec/libcsupport/src/error.c c/src/exec/libcsupport/src/getdents.c c/src/exec/libcsupport/src/hosterr.c c/src/exec/libcsupport/src/libio.c c/src/exec/libcsupport/src/malloc.c c/src/exec/libcsupport/src/newlibc.c c/src/exec/libcsupport/src/no_libc.c c/src/exec/libcsupport/src/opendir.c c/src/exec/libcsupport/src/readdir.c c/src/exec/libcsupport/src/rewinddir.c c/src/exec/libcsupport/src/scandir.c c/src/exec/libcsupport/src/seekdir.c c/src/exec/libcsupport/src/tcdrain.c c/src/exec/libcsupport/src/telldir.c c/src/exec/libcsupport/src/termios.c c/src/exec/libcsupport/src/unixlibc.c c/src/exec/libcsupport/src/utsname.c c/src/exec/libnetworking/README c/src/exec/libnetworking/arpa/ftp.h c/src/exec/libnetworking/arpa/inet.h c/src/exec/libnetworking/arpa/nameser.h c/src/exec/libnetworking/arpa/nameser_compat.h c/src/exec/libnetworking/arpa/telnet.h c/src/exec/libnetworking/bpfilter.h c/src/exec/libnetworking/kern/kern_subr.c c/src/exec/libnetworking/kern/uipc_domain.c c/src/exec/libnetworking/kern/uipc_mbuf.c c/src/exec/libnetworking/kern/uipc_socket.c c/src/exec/libnetworking/kern/uipc_socket2.c c/src/exec/libnetworking/lib/README c/src/exec/libnetworking/lib/getprotoby.c c/src/exec/libnetworking/lib/syslog.c c/src/exec/libnetworking/lib/tftpDriver.c c/src/exec/libnetworking/libc/addr2ascii.3 c/src/exec/libnetworking/libc/addr2ascii.c c/src/exec/libnetworking/libc/ascii2addr.c c/src/exec/libnetworking/libc/base64.c c/src/exec/libnetworking/libc/byteorder.3 c/src/exec/libnetworking/libc/ether_addr.c c/src/exec/libnetworking/libc/ethers.3 c/src/exec/libnetworking/libc/gethostbydns.c c/src/exec/libnetworking/libc/gethostbyht.c c/src/exec/libnetworking/libc/gethostbyname.3 c/src/exec/libnetworking/libc/gethostbynis.c c/src/exec/libnetworking/libc/gethostnamadr.c c/src/exec/libnetworking/libc/gethostname.c c/src/exec/libnetworking/libc/getnetbydns.c c/src/exec/libnetworking/libc/getnetbyht.c c/src/exec/libnetworking/libc/getnetbynis.c c/src/exec/libnetworking/libc/getnetent.3 c/src/exec/libnetworking/libc/getnetnamadr.c c/src/exec/libnetworking/libc/getproto.c c/src/exec/libnetworking/libc/getprotoent.3 c/src/exec/libnetworking/libc/getprotoent.c c/src/exec/libnetworking/libc/getprotoname.c c/src/exec/libnetworking/libc/getservbyname.c c/src/exec/libnetworking/libc/getservbyport.c c/src/exec/libnetworking/libc/getservent.3 c/src/exec/libnetworking/libc/getservent.c c/src/exec/libnetworking/libc/herror.c c/src/exec/libnetworking/libc/inet.3 c/src/exec/libnetworking/libc/inet_addr.c c/src/exec/libnetworking/libc/inet_lnaof.c c/src/exec/libnetworking/libc/inet_makeaddr.c c/src/exec/libnetworking/libc/inet_net_ntop.c c/src/exec/libnetworking/libc/inet_net_pton.c c/src/exec/libnetworking/libc/inet_neta.c c/src/exec/libnetworking/libc/inet_netof.c c/src/exec/libnetworking/libc/inet_network.c c/src/exec/libnetworking/libc/inet_ntoa.c c/src/exec/libnetworking/libc/inet_ntop.c c/src/exec/libnetworking/libc/inet_pton.c c/src/exec/libnetworking/libc/iso_addr.3 c/src/exec/libnetworking/libc/iso_addr.c c/src/exec/libnetworking/libc/linkaddr.3 c/src/exec/libnetworking/libc/linkaddr.c c/src/exec/libnetworking/libc/map_v4v6.c c/src/exec/libnetworking/libc/ns.3 c/src/exec/libnetworking/libc/ns_addr.c c/src/exec/libnetworking/libc/ns_name.c c/src/exec/libnetworking/libc/ns_netint.c c/src/exec/libnetworking/libc/ns_ntoa.c c/src/exec/libnetworking/libc/ns_parse.c c/src/exec/libnetworking/libc/ns_print.c c/src/exec/libnetworking/libc/ns_ttl.c c/src/exec/libnetworking/libc/nsap_addr.c c/src/exec/libnetworking/libc/rcmd.3 c/src/exec/libnetworking/libc/rcmd.c c/src/exec/libnetworking/libc/recv.c c/src/exec/libnetworking/libc/res_comp.c c/src/exec/libnetworking/libc/res_config.h c/src/exec/libnetworking/libc/res_data.c c/src/exec/libnetworking/libc/res_debug.c c/src/exec/libnetworking/libc/res_init.c c/src/exec/libnetworking/libc/res_mkquery.c c/src/exec/libnetworking/libc/res_mkupdate.c c/src/exec/libnetworking/libc/res_query.c c/src/exec/libnetworking/libc/res_send.c c/src/exec/libnetworking/libc/res_stubs.c c/src/exec/libnetworking/libc/res_update.c c/src/exec/libnetworking/libc/resolver.3 c/src/exec/libnetworking/libc/send.c c/src/exec/libnetworking/libc/strsep.c c/src/exec/libnetworking/loop.h c/src/exec/libnetworking/machine/conf.h c/src/exec/libnetworking/machine/cpu.h c/src/exec/libnetworking/machine/cpufunc.h c/src/exec/libnetworking/machine/endian.h c/src/exec/libnetworking/machine/in_cksum.h c/src/exec/libnetworking/machine/limits.h c/src/exec/libnetworking/machine/param.h c/src/exec/libnetworking/machine/types.h c/src/exec/libnetworking/machine/vmparam.h c/src/exec/libnetworking/net/bpf.h c/src/exec/libnetworking/net/ethernet.h c/src/exec/libnetworking/net/if.c c/src/exec/libnetworking/net/if.h c/src/exec/libnetworking/net/if_arp.h c/src/exec/libnetworking/net/if_dl.h c/src/exec/libnetworking/net/if_ethersubr.c c/src/exec/libnetworking/net/if_llc.h c/src/exec/libnetworking/net/if_loop.c c/src/exec/libnetworking/net/if_types.h c/src/exec/libnetworking/net/netisr.h c/src/exec/libnetworking/net/radix.c c/src/exec/libnetworking/net/radix.h c/src/exec/libnetworking/net/raw_cb.c c/src/exec/libnetworking/net/raw_cb.h c/src/exec/libnetworking/net/raw_usrreq.c c/src/exec/libnetworking/net/route.c c/src/exec/libnetworking/net/route.h c/src/exec/libnetworking/net/rtsock.c c/src/exec/libnetworking/netdb.h c/src/exec/libnetworking/netinet/icmp_var.h c/src/exec/libnetworking/netinet/if_ether.c c/src/exec/libnetworking/netinet/if_ether.h c/src/exec/libnetworking/netinet/igmp.c c/src/exec/libnetworking/netinet/igmp.h c/src/exec/libnetworking/netinet/igmp_var.h c/src/exec/libnetworking/netinet/in.c c/src/exec/libnetworking/netinet/in.h c/src/exec/libnetworking/netinet/in_cksum.c c/src/exec/libnetworking/netinet/in_cksum_i386.c c/src/exec/libnetworking/netinet/in_cksum_m68k.c c/src/exec/libnetworking/netinet/in_pcb.c c/src/exec/libnetworking/netinet/in_pcb.h c/src/exec/libnetworking/netinet/in_proto.c c/src/exec/libnetworking/netinet/in_rmx.c c/src/exec/libnetworking/netinet/in_systm.h c/src/exec/libnetworking/netinet/in_var.h c/src/exec/libnetworking/netinet/ip.h c/src/exec/libnetworking/netinet/ip_divert.c c/src/exec/libnetworking/netinet/ip_fw.c c/src/exec/libnetworking/netinet/ip_fw.h c/src/exec/libnetworking/netinet/ip_icmp.c c/src/exec/libnetworking/netinet/ip_icmp.h c/src/exec/libnetworking/netinet/ip_input.c c/src/exec/libnetworking/netinet/ip_mroute.c c/src/exec/libnetworking/netinet/ip_mroute.h c/src/exec/libnetworking/netinet/ip_output.c c/src/exec/libnetworking/netinet/ip_var.h c/src/exec/libnetworking/netinet/raw_ip.c c/src/exec/libnetworking/netinet/tcp.h c/src/exec/libnetworking/netinet/tcp_debug.c c/src/exec/libnetworking/netinet/tcp_debug.h c/src/exec/libnetworking/netinet/tcp_fsm.h c/src/exec/libnetworking/netinet/tcp_input.c c/src/exec/libnetworking/netinet/tcp_output.c c/src/exec/libnetworking/netinet/tcp_seq.h c/src/exec/libnetworking/netinet/tcp_subr.c c/src/exec/libnetworking/netinet/tcp_timer.c c/src/exec/libnetworking/netinet/tcp_timer.h c/src/exec/libnetworking/netinet/tcp_usrreq.c c/src/exec/libnetworking/netinet/tcp_var.h c/src/exec/libnetworking/netinet/tcpip.h c/src/exec/libnetworking/netinet/udp.h c/src/exec/libnetworking/netinet/udp_usrreq.c c/src/exec/libnetworking/netinet/udp_var.h c/src/exec/libnetworking/nfs/bootp_subr.c c/src/exec/libnetworking/nfs/krpc.h c/src/exec/libnetworking/nfs/nfs.h c/src/exec/libnetworking/nfs/nfsdiskless.h c/src/exec/libnetworking/nfs/nfsproto.h c/src/exec/libnetworking/nfs/rpcv2.h c/src/exec/libnetworking/nfs/xdr_subs.h c/src/exec/libnetworking/opt_ipfw.h c/src/exec/libnetworking/opt_mrouting.h c/src/exec/libnetworking/opt_tcpdebug.h c/src/exec/libnetworking/poll.h c/src/exec/libnetworking/resolv.h c/src/exec/libnetworking/rtems/issetugid.c c/src/exec/libnetworking/rtems/rtems_bootp.c c/src/exec/libnetworking/rtems/rtems_bsdnet.h c/src/exec/libnetworking/rtems/rtems_bsdnet_internal.h c/src/exec/libnetworking/rtems/rtems_glue.c c/src/exec/libnetworking/rtems/rtems_showicmpstat.c c/src/exec/libnetworking/rtems/rtems_showifstat.c c/src/exec/libnetworking/rtems/rtems_showipstat.c c/src/exec/libnetworking/rtems/rtems_showmbuf.c c/src/exec/libnetworking/rtems/rtems_showroute.c c/src/exec/libnetworking/rtems/rtems_showtcpstat.c c/src/exec/libnetworking/rtems/rtems_showudpstat.c c/src/exec/libnetworking/rtems/rtems_syscall.c c/src/exec/libnetworking/rtems/sghostname.c c/src/exec/libnetworking/rtems/tftp.h c/src/exec/libnetworking/sys/buf.h c/src/exec/libnetworking/sys/callout.h c/src/exec/libnetworking/sys/conf.h c/src/exec/libnetworking/sys/domain.h c/src/exec/libnetworking/sys/kernel.h c/src/exec/libnetworking/sys/libkern.h c/src/exec/libnetworking/sys/malloc.h c/src/exec/libnetworking/sys/mbuf.h c/src/exec/libnetworking/sys/mount.h c/src/exec/libnetworking/sys/param.h c/src/exec/libnetworking/sys/proc.h c/src/exec/libnetworking/sys/protosw.h c/src/exec/libnetworking/sys/queue.h c/src/exec/libnetworking/sys/reboot.h c/src/exec/libnetworking/sys/resourcevar.h c/src/exec/libnetworking/sys/rtprio.h c/src/exec/libnetworking/sys/select.h c/src/exec/libnetworking/sys/signalvar.h c/src/exec/libnetworking/sys/socket.h c/src/exec/libnetworking/sys/socketvar.h c/src/exec/libnetworking/sys/sysctl.h c/src/exec/libnetworking/sys/syslimits.h c/src/exec/libnetworking/sys/syslog.h c/src/exec/libnetworking/sys/systm.h c/src/exec/libnetworking/sys/ttydefaults.h c/src/exec/libnetworking/sys/ucred.h c/src/exec/libnetworking/sys/uio.h c/src/exec/libnetworking/syslog.h c/src/exec/libnetworking/vm/vm.h c/src/exec/libnetworking/vm/vm_extern.h c/src/exec/libnetworking/vm/vm_kern.h c/src/exec/libnetworking/vm/vm_param.h c/src/exec/posix/Makefile.in c/src/exec/posix/base/Makefile.in c/src/exec/posix/base/aio.h c/src/exec/posix/base/devctl.h c/src/exec/posix/base/intr.h c/src/exec/posix/base/limits.h c/src/exec/posix/base/mqueue.h c/src/exec/posix/base/pthread.h c/src/exec/posix/base/sched.h c/src/exec/posix/base/semaphore.h c/src/exec/posix/base/unistd.h c/src/exec/posix/headers/Makefile.in c/src/exec/posix/headers/cancel.h c/src/exec/posix/headers/cond.h c/src/exec/posix/headers/condmp.h c/src/exec/posix/headers/config.h c/src/exec/posix/headers/intr.h c/src/exec/posix/headers/key.h c/src/exec/posix/headers/mqueue.h c/src/exec/posix/headers/mqueuemp.h c/src/exec/posix/headers/mutex.h c/src/exec/posix/headers/mutexmp.h c/src/exec/posix/headers/posixapi.h c/src/exec/posix/headers/priority.h c/src/exec/posix/headers/psignal.h c/src/exec/posix/headers/pthread.h c/src/exec/posix/headers/pthreadmp.h c/src/exec/posix/headers/semaphore.h c/src/exec/posix/headers/semaphoremp.h c/src/exec/posix/headers/seterr.h c/src/exec/posix/headers/threadsup.h c/src/exec/posix/headers/time.h c/src/exec/posix/include/aio.h c/src/exec/posix/include/devctl.h c/src/exec/posix/include/intr.h c/src/exec/posix/include/limits.h c/src/exec/posix/include/mqueue.h c/src/exec/posix/include/pthread.h c/src/exec/posix/include/rtems/posix/Makefile.in c/src/exec/posix/include/rtems/posix/cancel.h c/src/exec/posix/include/rtems/posix/cond.h c/src/exec/posix/include/rtems/posix/condmp.h c/src/exec/posix/include/rtems/posix/config.h c/src/exec/posix/include/rtems/posix/intr.h c/src/exec/posix/include/rtems/posix/key.h c/src/exec/posix/include/rtems/posix/mqueue.h c/src/exec/posix/include/rtems/posix/mqueuemp.h c/src/exec/posix/include/rtems/posix/mutex.h c/src/exec/posix/include/rtems/posix/mutexmp.h c/src/exec/posix/include/rtems/posix/posixapi.h c/src/exec/posix/include/rtems/posix/priority.h c/src/exec/posix/include/rtems/posix/psignal.h c/src/exec/posix/include/rtems/posix/pthread.h c/src/exec/posix/include/rtems/posix/pthreadmp.h c/src/exec/posix/include/rtems/posix/semaphore.h c/src/exec/posix/include/rtems/posix/semaphoremp.h c/src/exec/posix/include/rtems/posix/seterr.h c/src/exec/posix/include/rtems/posix/threadsup.h c/src/exec/posix/include/rtems/posix/time.h c/src/exec/posix/include/sched.h c/src/exec/posix/include/semaphore.h c/src/exec/posix/include/sys/Makefile.in c/src/exec/posix/include/sys/utsname.h c/src/exec/posix/include/unistd.h c/src/exec/posix/include/wrap/Makefile.in c/src/exec/posix/inline/Makefile.in c/src/exec/posix/inline/cond.inl c/src/exec/posix/inline/intr.inl c/src/exec/posix/inline/key.inl c/src/exec/posix/inline/mqueue.inl c/src/exec/posix/inline/mutex.inl c/src/exec/posix/inline/priority.inl c/src/exec/posix/inline/pthread.inl c/src/exec/posix/inline/rtems/posix/Makefile.in c/src/exec/posix/inline/rtems/posix/cond.inl c/src/exec/posix/inline/rtems/posix/intr.inl c/src/exec/posix/inline/rtems/posix/key.inl c/src/exec/posix/inline/rtems/posix/mqueue.inl c/src/exec/posix/inline/rtems/posix/mutex.inl c/src/exec/posix/inline/rtems/posix/priority.inl c/src/exec/posix/inline/rtems/posix/pthread.inl c/src/exec/posix/inline/rtems/posix/semaphore.inl c/src/exec/posix/inline/semaphore.inl c/src/exec/posix/macros/Makefile.in c/src/exec/posix/macros/rtems/posix/Makefile.in c/src/exec/posix/optman/Makefile.in c/src/exec/posix/src/Makefile.in c/src/exec/posix/src/adasupp.c c/src/exec/posix/src/aio.c c/src/exec/posix/src/cancel.c c/src/exec/posix/src/cond.c c/src/exec/posix/src/devctl.c c/src/exec/posix/src/execl.c c/src/exec/posix/src/execle.c c/src/exec/posix/src/execlp.c c/src/exec/posix/src/execv.c c/src/exec/posix/src/execve.c c/src/exec/posix/src/execvp.c c/src/exec/posix/src/fork.c c/src/exec/posix/src/getpid.c c/src/exec/posix/src/intr.c c/src/exec/posix/src/key.c c/src/exec/posix/src/mqueue.c c/src/exec/posix/src/mutex.c c/src/exec/posix/src/psignal.c c/src/exec/posix/src/pthread.c c/src/exec/posix/src/pthreadatfork.c c/src/exec/posix/src/ptimer.c c/src/exec/posix/src/sched.c c/src/exec/posix/src/semaphore.c c/src/exec/posix/src/time.c c/src/exec/posix/src/types.c c/src/exec/posix/src/unistd.c c/src/exec/posix/src/utsname.c c/src/exec/posix/src/wait.c c/src/exec/posix/src/waitpid.c c/src/exec/posix/sys/Makefile.in c/src/exec/posix/sys/utsname.h c/src/exec/rtems/Makefile.in c/src/exec/rtems/headers/Makefile.in c/src/exec/rtems/headers/asr.h c/src/exec/rtems/headers/attr.h c/src/exec/rtems/headers/clock.h c/src/exec/rtems/headers/config.h c/src/exec/rtems/headers/dpmem.h c/src/exec/rtems/headers/event.h c/src/exec/rtems/headers/eventmp.h c/src/exec/rtems/headers/eventset.h c/src/exec/rtems/headers/intr.h c/src/exec/rtems/headers/message.h c/src/exec/rtems/headers/modes.h c/src/exec/rtems/headers/mp.h c/src/exec/rtems/headers/msgmp.h c/src/exec/rtems/headers/options.h c/src/exec/rtems/headers/part.h c/src/exec/rtems/headers/partmp.h c/src/exec/rtems/headers/ratemon.h c/src/exec/rtems/headers/region.h c/src/exec/rtems/headers/regionmp.h c/src/exec/rtems/headers/rtems.h c/src/exec/rtems/headers/rtemsapi.h c/src/exec/rtems/headers/sem.h c/src/exec/rtems/headers/semmp.h c/src/exec/rtems/headers/signal.h c/src/exec/rtems/headers/signalmp.h c/src/exec/rtems/headers/status.h c/src/exec/rtems/headers/support.h c/src/exec/rtems/headers/taskmp.h c/src/exec/rtems/headers/tasks.h c/src/exec/rtems/headers/timer.h c/src/exec/rtems/headers/types.h c/src/exec/rtems/include/rtems.h c/src/exec/rtems/include/rtems/rtems/Makefile.in c/src/exec/rtems/include/rtems/rtems/asr.h c/src/exec/rtems/include/rtems/rtems/attr.h c/src/exec/rtems/include/rtems/rtems/clock.h c/src/exec/rtems/include/rtems/rtems/config.h c/src/exec/rtems/include/rtems/rtems/dpmem.h c/src/exec/rtems/include/rtems/rtems/event.h c/src/exec/rtems/include/rtems/rtems/eventmp.h c/src/exec/rtems/include/rtems/rtems/eventset.h c/src/exec/rtems/include/rtems/rtems/intr.h c/src/exec/rtems/include/rtems/rtems/message.h c/src/exec/rtems/include/rtems/rtems/modes.h c/src/exec/rtems/include/rtems/rtems/mp.h c/src/exec/rtems/include/rtems/rtems/msgmp.h c/src/exec/rtems/include/rtems/rtems/options.h c/src/exec/rtems/include/rtems/rtems/part.h c/src/exec/rtems/include/rtems/rtems/partmp.h c/src/exec/rtems/include/rtems/rtems/ratemon.h c/src/exec/rtems/include/rtems/rtems/region.h c/src/exec/rtems/include/rtems/rtems/regionmp.h c/src/exec/rtems/include/rtems/rtems/rtemsapi.h c/src/exec/rtems/include/rtems/rtems/sem.h c/src/exec/rtems/include/rtems/rtems/semmp.h c/src/exec/rtems/include/rtems/rtems/signal.h c/src/exec/rtems/include/rtems/rtems/signalmp.h c/src/exec/rtems/include/rtems/rtems/status.h c/src/exec/rtems/include/rtems/rtems/support.h c/src/exec/rtems/include/rtems/rtems/taskmp.h c/src/exec/rtems/include/rtems/rtems/tasks.h c/src/exec/rtems/include/rtems/rtems/timer.h c/src/exec/rtems/include/rtems/rtems/types.h c/src/exec/rtems/inline/Makefile.in c/src/exec/rtems/inline/asr.inl c/src/exec/rtems/inline/attr.inl c/src/exec/rtems/inline/dpmem.inl c/src/exec/rtems/inline/event.inl c/src/exec/rtems/inline/eventset.inl c/src/exec/rtems/inline/message.inl c/src/exec/rtems/inline/modes.inl c/src/exec/rtems/inline/options.inl c/src/exec/rtems/inline/part.inl c/src/exec/rtems/inline/ratemon.inl c/src/exec/rtems/inline/region.inl c/src/exec/rtems/inline/rtems/rtems/Makefile.in c/src/exec/rtems/inline/rtems/rtems/asr.inl c/src/exec/rtems/inline/rtems/rtems/attr.inl c/src/exec/rtems/inline/rtems/rtems/dpmem.inl c/src/exec/rtems/inline/rtems/rtems/event.inl c/src/exec/rtems/inline/rtems/rtems/eventset.inl c/src/exec/rtems/inline/rtems/rtems/message.inl c/src/exec/rtems/inline/rtems/rtems/modes.inl c/src/exec/rtems/inline/rtems/rtems/options.inl c/src/exec/rtems/inline/rtems/rtems/part.inl c/src/exec/rtems/inline/rtems/rtems/ratemon.inl c/src/exec/rtems/inline/rtems/rtems/region.inl c/src/exec/rtems/inline/rtems/rtems/sem.inl c/src/exec/rtems/inline/rtems/rtems/status.inl c/src/exec/rtems/inline/rtems/rtems/support.inl c/src/exec/rtems/inline/rtems/rtems/tasks.inl c/src/exec/rtems/inline/rtems/rtems/timer.inl c/src/exec/rtems/inline/sem.inl c/src/exec/rtems/inline/status.inl c/src/exec/rtems/inline/support.inl c/src/exec/rtems/inline/tasks.inl c/src/exec/rtems/inline/timer.inl c/src/exec/rtems/macros/Makefile.in c/src/exec/rtems/macros/asr.inl c/src/exec/rtems/macros/attr.inl c/src/exec/rtems/macros/dpmem.inl c/src/exec/rtems/macros/event.inl c/src/exec/rtems/macros/eventset.inl c/src/exec/rtems/macros/message.inl c/src/exec/rtems/macros/modes.inl c/src/exec/rtems/macros/options.inl c/src/exec/rtems/macros/part.inl c/src/exec/rtems/macros/ratemon.inl c/src/exec/rtems/macros/region.inl c/src/exec/rtems/macros/rtems/rtems/Makefile.in c/src/exec/rtems/macros/rtems/rtems/asr.inl c/src/exec/rtems/macros/rtems/rtems/attr.inl c/src/exec/rtems/macros/rtems/rtems/dpmem.inl c/src/exec/rtems/macros/rtems/rtems/event.inl c/src/exec/rtems/macros/rtems/rtems/eventset.inl c/src/exec/rtems/macros/rtems/rtems/message.inl c/src/exec/rtems/macros/rtems/rtems/modes.inl c/src/exec/rtems/macros/rtems/rtems/options.inl c/src/exec/rtems/macros/rtems/rtems/part.inl c/src/exec/rtems/macros/rtems/rtems/ratemon.inl c/src/exec/rtems/macros/rtems/rtems/region.inl c/src/exec/rtems/macros/rtems/rtems/sem.inl c/src/exec/rtems/macros/rtems/rtems/status.inl c/src/exec/rtems/macros/rtems/rtems/support.inl c/src/exec/rtems/macros/rtems/rtems/tasks.inl c/src/exec/rtems/macros/rtems/rtems/timer.inl c/src/exec/rtems/macros/sem.inl c/src/exec/rtems/macros/status.inl c/src/exec/rtems/macros/support.inl c/src/exec/rtems/macros/tasks.inl c/src/exec/rtems/macros/timer.inl c/src/exec/rtems/optman/Makefile.in c/src/exec/rtems/optman/no-dpmem.c c/src/exec/rtems/optman/no-event.c c/src/exec/rtems/optman/no-mp.c c/src/exec/rtems/optman/no-msg.c c/src/exec/rtems/optman/no-part.c c/src/exec/rtems/optman/no-region.c c/src/exec/rtems/optman/no-rtmon.c c/src/exec/rtems/optman/no-sem.c c/src/exec/rtems/optman/no-signal.c c/src/exec/rtems/optman/no-timer.c c/src/exec/rtems/src/Makefile.in c/src/exec/rtems/src/attr.c c/src/exec/rtems/src/clock.c c/src/exec/rtems/src/dpmem.c c/src/exec/rtems/src/event.c c/src/exec/rtems/src/eventmp.c c/src/exec/rtems/src/intr.c c/src/exec/rtems/src/intrbody.c c/src/exec/rtems/src/mp.c c/src/exec/rtems/src/msg.c c/src/exec/rtems/src/msgmp.c c/src/exec/rtems/src/part.c c/src/exec/rtems/src/partmp.c c/src/exec/rtems/src/ratemon.c c/src/exec/rtems/src/region.c c/src/exec/rtems/src/regionmp.c c/src/exec/rtems/src/rtclock.c c/src/exec/rtems/src/rtemstimer.c c/src/exec/rtems/src/sem.c c/src/exec/rtems/src/semmp.c c/src/exec/rtems/src/signal.c c/src/exec/rtems/src/signalmp.c c/src/exec/rtems/src/taskmp.c c/src/exec/rtems/src/tasks.c c/src/exec/rtems/src/timer.c c/src/exec/sapi/Makefile.in c/src/exec/sapi/headers/Makefile.in c/src/exec/sapi/headers/README c/src/exec/sapi/headers/confdefs.h c/src/exec/sapi/headers/config.h c/src/exec/sapi/headers/directives.h c/src/exec/sapi/headers/extension.h c/src/exec/sapi/headers/fatal.h c/src/exec/sapi/headers/init.h c/src/exec/sapi/headers/io.h c/src/exec/sapi/headers/mptables.h c/src/exec/sapi/headers/sptables.h c/src/exec/sapi/include/confdefs.h c/src/exec/sapi/include/rtems/Makefile.in c/src/exec/sapi/include/rtems/README c/src/exec/sapi/include/rtems/config.h c/src/exec/sapi/include/rtems/directives.h c/src/exec/sapi/include/rtems/extension.h c/src/exec/sapi/include/rtems/fatal.h c/src/exec/sapi/include/rtems/init.h c/src/exec/sapi/include/rtems/io.h c/src/exec/sapi/include/rtems/mptables.h c/src/exec/sapi/include/rtems/sptables.h c/src/exec/sapi/inline/Makefile.in c/src/exec/sapi/inline/extension.inl c/src/exec/sapi/inline/rtems/Makefile.in c/src/exec/sapi/inline/rtems/extension.inl c/src/exec/sapi/macros/Makefile.in c/src/exec/sapi/macros/extension.inl c/src/exec/sapi/macros/rtems/Makefile.in c/src/exec/sapi/macros/rtems/extension.inl c/src/exec/sapi/optman/Makefile.in c/src/exec/sapi/optman/no-ext.c c/src/exec/sapi/optman/no-io.c c/src/exec/sapi/src/Makefile.in c/src/exec/sapi/src/debug.c c/src/exec/sapi/src/exinit.c c/src/exec/sapi/src/extension.c c/src/exec/sapi/src/fatal.c c/src/exec/sapi/src/io.c c/src/exec/sapi/src/posixapi.c c/src/exec/sapi/src/rtemsapi.c c/src/exec/score/Makefile.in c/src/exec/score/cpu/Makefile.in c/src/exec/score/cpu/a29k/Makefile.in c/src/exec/score/cpu/a29k/a29k.h c/src/exec/score/cpu/a29k/a29ktypes.h c/src/exec/score/cpu/a29k/amd.ah c/src/exec/score/cpu/a29k/asm.h c/src/exec/score/cpu/a29k/cpu.c c/src/exec/score/cpu/a29k/cpu.h c/src/exec/score/cpu/a29k/cpu_asm.h c/src/exec/score/cpu/a29k/cpu_asm.s c/src/exec/score/cpu/a29k/pswmacro.ah c/src/exec/score/cpu/a29k/register.ah c/src/exec/score/cpu/a29k/rtems.c c/src/exec/score/cpu/a29k/sig.s c/src/exec/score/cpu/hppa1.1/Makefile.in c/src/exec/score/cpu/hppa1.1/cpu.c c/src/exec/score/cpu/hppa1.1/cpu.h c/src/exec/score/cpu/hppa1.1/cpu_asm.h c/src/exec/score/cpu/hppa1.1/cpu_asm.s c/src/exec/score/cpu/hppa1.1/hppa.h c/src/exec/score/cpu/hppa1.1/hppatypes.h c/src/exec/score/cpu/hppa1.1/rtems.s c/src/exec/score/cpu/i386/Makefile.in c/src/exec/score/cpu/i386/asm.h c/src/exec/score/cpu/i386/cpu.c c/src/exec/score/cpu/i386/cpu.h c/src/exec/score/cpu/i386/cpu_asm.s c/src/exec/score/cpu/i386/i386.h c/src/exec/score/cpu/i386/i386types.h c/src/exec/score/cpu/i386/rtems.s c/src/exec/score/cpu/i960/Makefile.in c/src/exec/score/cpu/i960/asm.h c/src/exec/score/cpu/i960/cpu.c c/src/exec/score/cpu/i960/cpu.h c/src/exec/score/cpu/i960/cpu_asm.s c/src/exec/score/cpu/i960/i960.h c/src/exec/score/cpu/i960/i960types.h c/src/exec/score/cpu/i960/rtems.s c/src/exec/score/cpu/m68k/Makefile.in c/src/exec/score/cpu/m68k/asm.h c/src/exec/score/cpu/m68k/cpu.c c/src/exec/score/cpu/m68k/cpu.h c/src/exec/score/cpu/m68k/cpu_asm.s c/src/exec/score/cpu/m68k/m68302.h c/src/exec/score/cpu/m68k/m68360.h c/src/exec/score/cpu/m68k/m68k.h c/src/exec/score/cpu/m68k/m68ktypes.h c/src/exec/score/cpu/m68k/memcpy.c c/src/exec/score/cpu/m68k/qsm.h c/src/exec/score/cpu/m68k/rtems.s c/src/exec/score/cpu/m68k/sim.h c/src/exec/score/cpu/mips/asm.h c/src/exec/score/cpu/mips/cpu.c c/src/exec/score/cpu/mips/cpu_asm.S c/src/exec/score/cpu/mips/cpu_asm.h c/src/exec/score/cpu/mips/idtcpu.h c/src/exec/score/cpu/mips/idtmon.h c/src/exec/score/cpu/mips/iregdef.h c/src/exec/score/cpu/mips/rtems.c c/src/exec/score/cpu/mips64orion/Makefile.in c/src/exec/score/cpu/mips64orion/asm.h c/src/exec/score/cpu/mips64orion/cpu.c c/src/exec/score/cpu/mips64orion/cpu.h c/src/exec/score/cpu/mips64orion/cpu_asm.S c/src/exec/score/cpu/mips64orion/cpu_asm.h c/src/exec/score/cpu/mips64orion/idtcpu.h c/src/exec/score/cpu/mips64orion/idtmon.h c/src/exec/score/cpu/mips64orion/iregdef.h c/src/exec/score/cpu/mips64orion/mips64orion.h c/src/exec/score/cpu/mips64orion/mipstypes.h c/src/exec/score/cpu/mips64orion/rtems.c c/src/exec/score/cpu/no_cpu/Makefile.in c/src/exec/score/cpu/no_cpu/asm.h c/src/exec/score/cpu/no_cpu/cpu.c c/src/exec/score/cpu/no_cpu/cpu.h c/src/exec/score/cpu/no_cpu/cpu_asm.c c/src/exec/score/cpu/no_cpu/cpu_asm.h c/src/exec/score/cpu/no_cpu/no_cpu.h c/src/exec/score/cpu/no_cpu/no_cputypes.h c/src/exec/score/cpu/no_cpu/rtems.c c/src/exec/score/cpu/powerpc/Makefile.in c/src/exec/score/cpu/powerpc/README c/src/exec/score/cpu/powerpc/TODO c/src/exec/score/cpu/powerpc/cpu.c c/src/exec/score/cpu/powerpc/cpu.h c/src/exec/score/cpu/powerpc/cpu_asm.s c/src/exec/score/cpu/powerpc/irq_stub.s c/src/exec/score/cpu/powerpc/ppc.h c/src/exec/score/cpu/powerpc/ppctypes.h c/src/exec/score/cpu/powerpc/rtems.s c/src/exec/score/cpu/sh/Makefile.in c/src/exec/score/cpu/sh/asm.h c/src/exec/score/cpu/sh/cpu.c c/src/exec/score/cpu/sh/cpu.h c/src/exec/score/cpu/sh/cpu_asm.c c/src/exec/score/cpu/sh/cpu_isps.c c/src/exec/score/cpu/sh/cpu_isps.h c/src/exec/score/cpu/sh/iosh7030.h c/src/exec/score/cpu/sh/ispsh7032.c c/src/exec/score/cpu/sh/rtems.c c/src/exec/score/cpu/sh/sh.h c/src/exec/score/cpu/sh/sh_io.h c/src/exec/score/cpu/sh/shtypes.h c/src/exec/score/cpu/sparc/Makefile.in c/src/exec/score/cpu/sparc/README c/src/exec/score/cpu/sparc/asm.h c/src/exec/score/cpu/sparc/cpu.c c/src/exec/score/cpu/sparc/cpu.h c/src/exec/score/cpu/sparc/cpu_asm.s c/src/exec/score/cpu/sparc/erc32.h c/src/exec/score/cpu/sparc/rtems.s c/src/exec/score/cpu/sparc/sparc.h c/src/exec/score/cpu/sparc/sparctypes.h c/src/exec/score/cpu/unix/Makefile.in c/src/exec/score/cpu/unix/cpu.c c/src/exec/score/cpu/unix/cpu.h c/src/exec/score/cpu/unix/unix.h c/src/exec/score/cpu/unix/unixtypes.h c/src/exec/score/headers/Makefile.in c/src/exec/score/headers/address.h c/src/exec/score/headers/apiext.h c/src/exec/score/headers/bitfield.h c/src/exec/score/headers/chain.h c/src/exec/score/headers/context.h c/src/exec/score/headers/copyrt.h c/src/exec/score/headers/coremsg.h c/src/exec/score/headers/coremutex.h c/src/exec/score/headers/coresem.h c/src/exec/score/headers/debug.h c/src/exec/score/headers/heap.h c/src/exec/score/headers/interr.h c/src/exec/score/headers/isr.h c/src/exec/score/headers/mpci.h c/src/exec/score/headers/mppkt.h c/src/exec/score/headers/object.h c/src/exec/score/headers/objectmp.h c/src/exec/score/headers/priority.h c/src/exec/score/headers/stack.h c/src/exec/score/headers/states.h c/src/exec/score/headers/sysstate.h c/src/exec/score/headers/system.h c/src/exec/score/headers/thread.h c/src/exec/score/headers/threadmp.h c/src/exec/score/headers/threadq.h c/src/exec/score/headers/tod.h c/src/exec/score/headers/tqdata.h c/src/exec/score/headers/userext.h c/src/exec/score/headers/watchdog.h c/src/exec/score/headers/wkspace.h c/src/exec/score/include/rtems/debug.h c/src/exec/score/include/rtems/score/Makefile.in c/src/exec/score/include/rtems/score/address.h c/src/exec/score/include/rtems/score/apiext.h c/src/exec/score/include/rtems/score/bitfield.h c/src/exec/score/include/rtems/score/chain.h c/src/exec/score/include/rtems/score/context.h c/src/exec/score/include/rtems/score/copyrt.h c/src/exec/score/include/rtems/score/coremsg.h c/src/exec/score/include/rtems/score/coremutex.h c/src/exec/score/include/rtems/score/coresem.h c/src/exec/score/include/rtems/score/heap.h c/src/exec/score/include/rtems/score/interr.h c/src/exec/score/include/rtems/score/isr.h c/src/exec/score/include/rtems/score/mpci.h c/src/exec/score/include/rtems/score/mppkt.h c/src/exec/score/include/rtems/score/object.h c/src/exec/score/include/rtems/score/objectmp.h c/src/exec/score/include/rtems/score/priority.h c/src/exec/score/include/rtems/score/stack.h c/src/exec/score/include/rtems/score/states.h c/src/exec/score/include/rtems/score/sysstate.h c/src/exec/score/include/rtems/score/thread.h c/src/exec/score/include/rtems/score/threadmp.h c/src/exec/score/include/rtems/score/threadq.h c/src/exec/score/include/rtems/score/tod.h c/src/exec/score/include/rtems/score/tqdata.h c/src/exec/score/include/rtems/score/userext.h c/src/exec/score/include/rtems/score/watchdog.h c/src/exec/score/include/rtems/score/wkspace.h c/src/exec/score/include/rtems/system.h c/src/exec/score/inline/Makefile.in c/src/exec/score/inline/address.inl c/src/exec/score/inline/chain.inl c/src/exec/score/inline/coremsg.inl c/src/exec/score/inline/coremutex.inl c/src/exec/score/inline/coresem.inl c/src/exec/score/inline/heap.inl c/src/exec/score/inline/isr.inl c/src/exec/score/inline/mppkt.inl c/src/exec/score/inline/object.inl c/src/exec/score/inline/objectmp.inl c/src/exec/score/inline/priority.inl c/src/exec/score/inline/rtems/score/Makefile.in c/src/exec/score/inline/rtems/score/address.inl c/src/exec/score/inline/rtems/score/chain.inl c/src/exec/score/inline/rtems/score/coremsg.inl c/src/exec/score/inline/rtems/score/coremutex.inl c/src/exec/score/inline/rtems/score/coresem.inl c/src/exec/score/inline/rtems/score/heap.inl c/src/exec/score/inline/rtems/score/isr.inl c/src/exec/score/inline/rtems/score/mppkt.inl c/src/exec/score/inline/rtems/score/object.inl c/src/exec/score/inline/rtems/score/objectmp.inl c/src/exec/score/inline/rtems/score/priority.inl c/src/exec/score/inline/rtems/score/stack.inl c/src/exec/score/inline/rtems/score/states.inl c/src/exec/score/inline/rtems/score/sysstate.inl c/src/exec/score/inline/rtems/score/thread.inl c/src/exec/score/inline/rtems/score/threadmp.inl c/src/exec/score/inline/rtems/score/tod.inl c/src/exec/score/inline/rtems/score/tqdata.inl c/src/exec/score/inline/rtems/score/userext.inl c/src/exec/score/inline/rtems/score/watchdog.inl c/src/exec/score/inline/rtems/score/wkspace.inl c/src/exec/score/inline/stack.inl c/src/exec/score/inline/states.inl c/src/exec/score/inline/sysstate.inl c/src/exec/score/inline/thread.inl c/src/exec/score/inline/threadmp.inl c/src/exec/score/inline/tod.inl c/src/exec/score/inline/tqdata.inl c/src/exec/score/inline/userext.inl c/src/exec/score/inline/watchdog.inl c/src/exec/score/inline/wkspace.inl c/src/exec/score/macros/Makefile.in c/src/exec/score/macros/README c/src/exec/score/macros/address.inl c/src/exec/score/macros/chain.inl c/src/exec/score/macros/coremsg.inl c/src/exec/score/macros/coremutex.inl c/src/exec/score/macros/coresem.inl c/src/exec/score/macros/heap.inl c/src/exec/score/macros/isr.inl c/src/exec/score/macros/mppkt.inl c/src/exec/score/macros/object.inl c/src/exec/score/macros/objectmp.inl c/src/exec/score/macros/priority.inl c/src/exec/score/macros/rtems/score/Makefile.in c/src/exec/score/macros/rtems/score/README c/src/exec/score/macros/rtems/score/address.inl c/src/exec/score/macros/rtems/score/chain.inl c/src/exec/score/macros/rtems/score/coremsg.inl c/src/exec/score/macros/rtems/score/coremutex.inl c/src/exec/score/macros/rtems/score/coresem.inl c/src/exec/score/macros/rtems/score/heap.inl c/src/exec/score/macros/rtems/score/isr.inl c/src/exec/score/macros/rtems/score/mppkt.inl c/src/exec/score/macros/rtems/score/object.inl c/src/exec/score/macros/rtems/score/objectmp.inl c/src/exec/score/macros/rtems/score/priority.inl c/src/exec/score/macros/rtems/score/stack.inl c/src/exec/score/macros/rtems/score/states.inl c/src/exec/score/macros/rtems/score/sysstate.inl c/src/exec/score/macros/rtems/score/thread.inl c/src/exec/score/macros/rtems/score/threadmp.inl c/src/exec/score/macros/rtems/score/tod.inl c/src/exec/score/macros/rtems/score/tqdata.inl c/src/exec/score/macros/rtems/score/userext.inl c/src/exec/score/macros/rtems/score/watchdog.inl c/src/exec/score/macros/rtems/score/wkspace.inl c/src/exec/score/macros/stack.inl c/src/exec/score/macros/states.inl c/src/exec/score/macros/sysstate.inl c/src/exec/score/macros/thread.inl c/src/exec/score/macros/threadmp.inl c/src/exec/score/macros/tod.inl c/src/exec/score/macros/tqdata.inl c/src/exec/score/macros/userext.inl c/src/exec/score/macros/watchdog.inl c/src/exec/score/macros/wkspace.inl c/src/exec/score/src/Makefile.in c/src/exec/score/src/apiext.c c/src/exec/score/src/chain.c c/src/exec/score/src/coremsg.c c/src/exec/score/src/coremutex.c c/src/exec/score/src/coresem.c c/src/exec/score/src/coretod.c c/src/exec/score/src/heap.c c/src/exec/score/src/interr.c c/src/exec/score/src/isr.c c/src/exec/score/src/mpci.c c/src/exec/score/src/object.c c/src/exec/score/src/objectmp.c c/src/exec/score/src/thread.c c/src/exec/score/src/threadmp.c c/src/exec/score/src/threadq.c c/src/exec/score/src/tod.c c/src/exec/score/src/userext.c c/src/exec/score/src/watchdog.c c/src/exec/score/src/wkspace.c c/src/exec/score/tools/Makefile.in c/src/exec/score/tools/generic/Makefile.in c/src/exec/score/tools/generic/size_rtems.in c/src/exec/score/tools/hppa1.1/Makefile.in c/src/exec/score/tools/hppa1.1/genoffsets.c c/src/exec/score/tools/sh/AUTHORS c/src/exec/score/tools/sh/COPYING c/src/exec/score/tools/sh/Makefile.in c/src/exec/score/tools/sh/TODO c/src/exec/score/tools/sh/sci.c c/src/exec/score/tools/sh/sci.h c/src/exec/score/tools/sh/shgen.c c/src/exec/score/tools/unix/Makefile.in c/src/exec/score/tools/unix/gensize.c c/src/exec/wrapup/Makefile.in c/src/exec/wrapup/posix/Makefile.in c/src/exec/wrapup/rtems/Makefile.in c/src/lib/Makefile.in c/src/lib/include/Makefile.in c/src/lib/include/chain.h c/src/lib/include/clockdrv.h c/src/lib/include/console.h c/src/lib/include/iosupp.h c/src/lib/include/motorola/mc68230.h c/src/lib/include/motorola/mc68681.h c/src/lib/include/ringbuf.h c/src/lib/include/rtems++/rtemsEvent.h c/src/lib/include/rtems++/rtemsInterrupt.h c/src/lib/include/rtems++/rtemsMessageQueue.h c/src/lib/include/rtems++/rtemsSemaphore.h c/src/lib/include/rtems++/rtemsStatusCode.h c/src/lib/include/rtems++/rtemsTask.h c/src/lib/include/rtems++/rtemsTaskMode.h c/src/lib/include/rtems++/rtemsTimer.h c/src/lib/include/rtems/assoc.h c/src/lib/include/rtems/error.h c/src/lib/include/rtems/libcsupport.h c/src/lib/include/rtems/libio.h c/src/lib/include/spurious.h c/src/lib/include/sys/filio.h c/src/lib/include/sys/ioctl.h c/src/lib/include/sys/sockio.h c/src/lib/include/sys/termios.h c/src/lib/include/sys/utsname.h c/src/lib/include/timerdrv.h c/src/lib/include/vmeintr.h c/src/lib/include/zilog/z8036.h c/src/lib/include/zilog/z8530.h c/src/lib/include/zilog/z8536.h c/src/lib/libbsp/Makefile.in c/src/lib/libbsp/README c/src/lib/libbsp/a29k/Makefile.in c/src/lib/libbsp/a29k/portsw/Makefile.in c/src/lib/libbsp/a29k/portsw/README c/src/lib/libbsp/a29k/portsw/console/Makefile.in c/src/lib/libbsp/a29k/portsw/console/concntl.h c/src/lib/libbsp/a29k/portsw/console/console.c c/src/lib/libbsp/a29k/portsw/console/serial.c c/src/lib/libbsp/a29k/portsw/console/serial.h c/src/lib/libbsp/a29k/portsw/include/Makefile.in c/src/lib/libbsp/a29k/portsw/include/bsp.h c/src/lib/libbsp/a29k/portsw/include/coverhd.h c/src/lib/libbsp/a29k/portsw/shmsupp/Makefile.in c/src/lib/libbsp/a29k/portsw/shmsupp/addrconv.c c/src/lib/libbsp/a29k/portsw/shmsupp/getcfg.c c/src/lib/libbsp/a29k/portsw/shmsupp/lock.c c/src/lib/libbsp/a29k/portsw/shmsupp/mpisr.c c/src/lib/libbsp/a29k/portsw/start/Makefile.in c/src/lib/libbsp/a29k/portsw/start/amd.ah c/src/lib/libbsp/a29k/portsw/start/pswmacro.ah c/src/lib/libbsp/a29k/portsw/start/register.ah c/src/lib/libbsp/a29k/portsw/startup/Makefile.in c/src/lib/libbsp/a29k/portsw/startup/bspclean.c c/src/lib/libbsp/a29k/portsw/startup/bspstart.c c/src/lib/libbsp/a29k/portsw/startup/iface.c c/src/lib/libbsp/a29k/portsw/startup/main.c c/src/lib/libbsp/a29k/portsw/startup/ramlink c/src/lib/libbsp/a29k/portsw/startup/romlink c/src/lib/libbsp/a29k/portsw/startup/setvec.c c/src/lib/libbsp/a29k/portsw/times c/src/lib/libbsp/a29k/portsw/wrapup/Makefile.in c/src/lib/libbsp/bare/Makefile.in c/src/lib/libbsp/bare/README c/src/lib/libbsp/bare/bsp_specs c/src/lib/libbsp/bare/build-tools c/src/lib/libbsp/bare/do-bare-bsp-build c/src/lib/libbsp/bare/include/Makefile.in c/src/lib/libbsp/bare/include/bsp.h c/src/lib/libbsp/bare/wrapup/Makefile.in c/src/lib/libbsp/hppa1.1/Makefile.in c/src/lib/libbsp/hppa1.1/pxfl/Makefile.in c/src/lib/libbsp/hppa1.1/pxfl/README c/src/lib/libbsp/hppa1.1/pxfl/floss-bsp.h c/src/lib/libbsp/hppa1.1/simhppa/Makefile.in c/src/lib/libbsp/hppa1.1/simhppa/bsp_specs c/src/lib/libbsp/hppa1.1/simhppa/include/Makefile.in c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h c/src/lib/libbsp/hppa1.1/simhppa/include/coverhd.h c/src/lib/libbsp/hppa1.1/simhppa/include/ttydrv.h c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/Makefile.in c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/README c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/addrconv.c c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/getcfg.c c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/intr.c c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/lock.c c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/mpisr.c c/src/lib/libbsp/hppa1.1/simhppa/start/Makefile.in c/src/lib/libbsp/hppa1.1/simhppa/start/start.s c/src/lib/libbsp/hppa1.1/simhppa/startup/Makefile.in c/src/lib/libbsp/hppa1.1/simhppa/startup/bspclean.c c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c c/src/lib/libbsp/hppa1.1/simhppa/startup/setvec.c c/src/lib/libbsp/hppa1.1/simhppa/times c/src/lib/libbsp/hppa1.1/simhppa/tools/Makefile.in c/src/lib/libbsp/hppa1.1/simhppa/tools/print_dump.c c/src/lib/libbsp/hppa1.1/simhppa/tty/Makefile.in c/src/lib/libbsp/hppa1.1/simhppa/tty/tty.c c/src/lib/libbsp/hppa1.1/simhppa/wrapup/Makefile.in c/src/lib/libbsp/i386/Makefile.in c/src/lib/libbsp/i386/force386/Makefile.in c/src/lib/libbsp/i386/force386/bsp_specs c/src/lib/libbsp/i386/force386/clock/Makefile.in c/src/lib/libbsp/i386/force386/clock/ckinit.c c/src/lib/libbsp/i386/force386/console/Makefile.in c/src/lib/libbsp/i386/force386/console/console.c c/src/lib/libbsp/i386/force386/include/Makefile.in c/src/lib/libbsp/i386/force386/include/bsp.h c/src/lib/libbsp/i386/force386/include/coverhd.h c/src/lib/libbsp/i386/force386/shmsupp/Makefile.in c/src/lib/libbsp/i386/force386/shmsupp/addrconv.c c/src/lib/libbsp/i386/force386/shmsupp/getcfg.c c/src/lib/libbsp/i386/force386/shmsupp/lock.c c/src/lib/libbsp/i386/force386/shmsupp/mpisr.c c/src/lib/libbsp/i386/force386/start/Makefile.in c/src/lib/libbsp/i386/force386/start/start.s c/src/lib/libbsp/i386/force386/startup/Makefile.in c/src/lib/libbsp/i386/force386/startup/bspstart.c c/src/lib/libbsp/i386/force386/startup/exit.c c/src/lib/libbsp/i386/force386/startup/ldsegs.s c/src/lib/libbsp/i386/force386/startup/linkcmds c/src/lib/libbsp/i386/force386/startup/setvec.c c/src/lib/libbsp/i386/force386/timer/Makefile.in c/src/lib/libbsp/i386/force386/timer/timer.c c/src/lib/libbsp/i386/force386/timer/timerisr.s c/src/lib/libbsp/i386/force386/times c/src/lib/libbsp/i386/force386/wrapup/Makefile.in c/src/lib/libbsp/i386/go32/Makefile.in c/src/lib/libbsp/i386/go32/README c/src/lib/libbsp/i386/go32/bsp_specs c/src/lib/libbsp/i386/go32/clock/Makefile.in c/src/lib/libbsp/i386/go32/clock/ckinit.c c/src/lib/libbsp/i386/go32/clock/rtc.c c/src/lib/libbsp/i386/go32/console/Makefile.in c/src/lib/libbsp/i386/go32/console/console.c c/src/lib/libbsp/i386/go32/console/inch.c c/src/lib/libbsp/i386/go32/console/outch.c c/src/lib/libbsp/i386/go32/include/Makefile.in c/src/lib/libbsp/i386/go32/include/bsp.h c/src/lib/libbsp/i386/go32/include/coverhd.h c/src/lib/libbsp/i386/go32/startup/Makefile.in c/src/lib/libbsp/i386/go32/startup/bspstart.c c/src/lib/libbsp/i386/go32/startup/exit.c c/src/lib/libbsp/i386/go32/startup/setvec.c c/src/lib/libbsp/i386/go32/timer/Makefile.in c/src/lib/libbsp/i386/go32/timer/timer.c c/src/lib/libbsp/i386/go32/timer/timerisr.s c/src/lib/libbsp/i386/go32/times_i486dx c/src/lib/libbsp/i386/go32/times_p5 c/src/lib/libbsp/i386/go32/wrapup/Makefile.in c/src/lib/libbsp/i386/i386ex/Makefile.in c/src/lib/libbsp/i386/i386ex/README c/src/lib/libbsp/i386/i386ex/bsp_specs c/src/lib/libbsp/i386/i386ex/clock/Makefile.in c/src/lib/libbsp/i386/i386ex/clock/ckinit.c c/src/lib/libbsp/i386/i386ex/console/Makefile.in c/src/lib/libbsp/i386/i386ex/console/console.c c/src/lib/libbsp/i386/i386ex/include/Makefile.in c/src/lib/libbsp/i386/i386ex/include/bsp.h c/src/lib/libbsp/i386/i386ex/include/coverhd.h c/src/lib/libbsp/i386/i386ex/start/80386ex.h c/src/lib/libbsp/i386/i386ex/start/80386ex.inc c/src/lib/libbsp/i386/i386ex/start/Makefile.in c/src/lib/libbsp/i386/i386ex/start/macros.inc c/src/lib/libbsp/i386/i386ex/start/start.s c/src/lib/libbsp/i386/i386ex/startup/Makefile.in c/src/lib/libbsp/i386/i386ex/startup/README c/src/lib/libbsp/i386/i386ex/startup/bspstart.c c/src/lib/libbsp/i386/i386ex/startup/linkcmds c/src/lib/libbsp/i386/i386ex/startup/setvec.c c/src/lib/libbsp/i386/i386ex/timer/Makefile.in c/src/lib/libbsp/i386/i386ex/timer/timer.c c/src/lib/libbsp/i386/i386ex/timer/timerisr.s c/src/lib/libbsp/i386/i386ex/wrapup/Makefile.in c/src/lib/libbsp/i386/pc386/HOWTO c/src/lib/libbsp/i386/pc386/Makefile.in c/src/lib/libbsp/i386/pc386/README c/src/lib/libbsp/i386/pc386/STATUS c/src/lib/libbsp/i386/pc386/bsp_specs c/src/lib/libbsp/i386/pc386/clock/Makefile.in c/src/lib/libbsp/i386/pc386/clock/ckinit.c c/src/lib/libbsp/i386/pc386/clock/rtc.c c/src/lib/libbsp/i386/pc386/console/Makefile.in c/src/lib/libbsp/i386/pc386/console/console.c c/src/lib/libbsp/i386/pc386/console/inch.c c/src/lib/libbsp/i386/pc386/console/outch.c c/src/lib/libbsp/i386/pc386/console/videoAsm.s c/src/lib/libbsp/i386/pc386/include/Makefile.in c/src/lib/libbsp/i386/pc386/include/bsp.h c/src/lib/libbsp/i386/pc386/include/coverhd.h c/src/lib/libbsp/i386/pc386/include/crt.h c/src/lib/libbsp/i386/pc386/include/wd80x3.h c/src/lib/libbsp/i386/pc386/network/Makefile.in c/src/lib/libbsp/i386/pc386/network/network.c c/src/lib/libbsp/i386/pc386/start/Makefile.in c/src/lib/libbsp/i386/pc386/start/start.s c/src/lib/libbsp/i386/pc386/start/start16.s c/src/lib/libbsp/i386/pc386/startup/Makefile.in c/src/lib/libbsp/i386/pc386/startup/bspstart.c c/src/lib/libbsp/i386/pc386/startup/exit.c c/src/lib/libbsp/i386/pc386/startup/ldsegs.s c/src/lib/libbsp/i386/pc386/startup/linkcmds c/src/lib/libbsp/i386/pc386/startup/sbrk.c c/src/lib/libbsp/i386/pc386/timer/Makefile.in c/src/lib/libbsp/i386/pc386/timer/timer.c c/src/lib/libbsp/i386/pc386/timer/timerisr.s c/src/lib/libbsp/i386/pc386/times_i486dx c/src/lib/libbsp/i386/pc386/times_p5 c/src/lib/libbsp/i386/pc386/tools/Makefile.in c/src/lib/libbsp/i386/pc386/tools/Spec.doc c/src/lib/libbsp/i386/pc386/tools/bin2boot.c c/src/lib/libbsp/i386/pc386/tools/binpatch.c c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in c/src/lib/libbsp/i386/shared/Makefile.in c/src/lib/libbsp/i386/shared/comm/GDB.HOWTO c/src/lib/libbsp/i386/shared/comm/Makefile.in c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c c/src/lib/libbsp/i386/shared/comm/i386-stub.c c/src/lib/libbsp/i386/shared/comm/uart.c c/src/lib/libbsp/i386/shared/comm/uart.h c/src/lib/libbsp/i386/shared/io/Makefile.in c/src/lib/libbsp/i386/shared/io/bspIo.h c/src/lib/libbsp/i386/shared/io/printk.c c/src/lib/libbsp/i386/shared/irq/Makefile.in c/src/lib/libbsp/i386/shared/irq/idt.c c/src/lib/libbsp/i386/shared/irq/irq.c c/src/lib/libbsp/i386/shared/irq/irq.h c/src/lib/libbsp/i386/shared/irq/irq_asm.h c/src/lib/libbsp/i386/shared/irq/irq_asm.s c/src/lib/libbsp/i386/shared/irq/irq_init.c c/src/lib/libbsp/i386/shared/pci/Makefile.in c/src/lib/libbsp/i386/shared/pci/pcibios.c c/src/lib/libbsp/i386/shared/pci/pcibios.h c/src/lib/libbsp/i960/Makefile.in c/src/lib/libbsp/i960/cvme961/Makefile.in c/src/lib/libbsp/i960/cvme961/bsp_specs c/src/lib/libbsp/i960/cvme961/clock/Makefile.in c/src/lib/libbsp/i960/cvme961/clock/ckinit.c c/src/lib/libbsp/i960/cvme961/console/Makefile.in c/src/lib/libbsp/i960/cvme961/console/console.c c/src/lib/libbsp/i960/cvme961/include/Makefile.in c/src/lib/libbsp/i960/cvme961/include/bsp.h c/src/lib/libbsp/i960/cvme961/include/coverhd.h c/src/lib/libbsp/i960/cvme961/shmsupp/Makefile.in c/src/lib/libbsp/i960/cvme961/shmsupp/addrconv.c c/src/lib/libbsp/i960/cvme961/shmsupp/getcfg.c c/src/lib/libbsp/i960/cvme961/shmsupp/lock.c c/src/lib/libbsp/i960/cvme961/shmsupp/mpisr.c c/src/lib/libbsp/i960/cvme961/start/Makefile.in c/src/lib/libbsp/i960/cvme961/startup/Makefile.in c/src/lib/libbsp/i960/cvme961/startup/bspclean.c c/src/lib/libbsp/i960/cvme961/startup/bspstart.c c/src/lib/libbsp/i960/cvme961/startup/exit.c c/src/lib/libbsp/i960/cvme961/startup/linkcmds c/src/lib/libbsp/i960/cvme961/startup/setvec.c c/src/lib/libbsp/i960/cvme961/timer/Makefile.in c/src/lib/libbsp/i960/cvme961/timer/timer.c c/src/lib/libbsp/i960/cvme961/timer/timerisr.s c/src/lib/libbsp/i960/cvme961/times c/src/lib/libbsp/i960/cvme961/wrapup/Makefile.in c/src/lib/libbsp/m68k/Makefile.in c/src/lib/libbsp/m68k/dmv152/Makefile.in c/src/lib/libbsp/m68k/dmv152/bsp_specs c/src/lib/libbsp/m68k/dmv152/clock/Makefile.in c/src/lib/libbsp/m68k/dmv152/clock/ckinit.c c/src/lib/libbsp/m68k/dmv152/console/Makefile.in c/src/lib/libbsp/m68k/dmv152/console/console.c c/src/lib/libbsp/m68k/dmv152/include/Makefile.in c/src/lib/libbsp/m68k/dmv152/include/bsp.h c/src/lib/libbsp/m68k/dmv152/include/coverhd.h c/src/lib/libbsp/m68k/dmv152/spurious/Makefile.in c/src/lib/libbsp/m68k/dmv152/spurious/spinit.c c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in c/src/lib/libbsp/m68k/dmv152/startup/bspclean.c c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c c/src/lib/libbsp/m68k/dmv152/startup/linkcmds c/src/lib/libbsp/m68k/dmv152/startup/vmeintr.c c/src/lib/libbsp/m68k/dmv152/timer/Makefile.in c/src/lib/libbsp/m68k/dmv152/timer/timer.c c/src/lib/libbsp/m68k/dmv152/timer/timerisr.s c/src/lib/libbsp/m68k/dmv152/times c/src/lib/libbsp/m68k/dmv152/wrapup/Makefile.in c/src/lib/libbsp/m68k/efi332/Makefile.in c/src/lib/libbsp/m68k/efi332/README c/src/lib/libbsp/m68k/efi332/bsp_specs c/src/lib/libbsp/m68k/efi332/clock/Makefile.in c/src/lib/libbsp/m68k/efi332/clock/ckinit.c c/src/lib/libbsp/m68k/efi332/console/Makefile.in c/src/lib/libbsp/m68k/efi332/console/console.c c/src/lib/libbsp/m68k/efi332/include/Makefile.in c/src/lib/libbsp/m68k/efi332/include/bsp.h c/src/lib/libbsp/m68k/efi332/include/coverhd.h c/src/lib/libbsp/m68k/efi332/include/efi332.h c/src/lib/libbsp/m68k/efi332/misc/dotests c/src/lib/libbsp/m68k/efi332/misc/gdbinit68 c/src/lib/libbsp/m68k/efi332/misc/interr.c c/src/lib/libbsp/m68k/efi332/spurious/Makefile.in c/src/lib/libbsp/m68k/efi332/spurious/spinit.c c/src/lib/libbsp/m68k/efi332/start/Makefile.in c/src/lib/libbsp/m68k/efi332/start/start.c c/src/lib/libbsp/m68k/efi332/start332/Makefile.in c/src/lib/libbsp/m68k/efi332/start332/start332.c c/src/lib/libbsp/m68k/efi332/startup/Makefile.in c/src/lib/libbsp/m68k/efi332/startup/bspclean.c c/src/lib/libbsp/m68k/efi332/startup/bspstart.c c/src/lib/libbsp/m68k/efi332/startup/except_vect_332_ROM.S c/src/lib/libbsp/m68k/efi332/startup/linkcmds c/src/lib/libbsp/m68k/efi332/startup/linkcmds_ROM c/src/lib/libbsp/m68k/efi332/timer/Makefile.in c/src/lib/libbsp/m68k/efi332/timer/timer.c c/src/lib/libbsp/m68k/efi332/times c/src/lib/libbsp/m68k/efi332/wrapup/Makefile.in c/src/lib/libbsp/m68k/efi68k/Makefile.in c/src/lib/libbsp/m68k/efi68k/README c/src/lib/libbsp/m68k/efi68k/bsp_specs c/src/lib/libbsp/m68k/efi68k/clock/Makefile.in c/src/lib/libbsp/m68k/efi68k/clock/ckinit.c c/src/lib/libbsp/m68k/efi68k/console/Makefile.in c/src/lib/libbsp/m68k/efi68k/console/console.c c/src/lib/libbsp/m68k/efi68k/include/16550.h c/src/lib/libbsp/m68k/efi68k/include/DP8570A.h c/src/lib/libbsp/m68k/efi68k/include/Makefile.in c/src/lib/libbsp/m68k/efi68k/include/bsp.h c/src/lib/libbsp/m68k/efi68k/include/coverhd.h c/src/lib/libbsp/m68k/efi68k/include/efi68k.h c/src/lib/libbsp/m68k/efi68k/spurious/Makefile.in c/src/lib/libbsp/m68k/efi68k/spurious/spinit.c c/src/lib/libbsp/m68k/efi68k/start/Makefile.in c/src/lib/libbsp/m68k/efi68k/start/start.c c/src/lib/libbsp/m68k/efi68k/start68k/Makefile.in c/src/lib/libbsp/m68k/efi68k/start68k/start68k.c c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in c/src/lib/libbsp/m68k/efi68k/startup/bspclean.c c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c c/src/lib/libbsp/m68k/efi68k/startup/efi68k_tcp.c c/src/lib/libbsp/m68k/efi68k/startup/efi68k_wd.c c/src/lib/libbsp/m68k/efi68k/startup/linkcmds c/src/lib/libbsp/m68k/efi68k/startup/m68k-stub.c c/src/lib/libbsp/m68k/efi68k/startup/setvec.c c/src/lib/libbsp/m68k/efi68k/timer/Makefile.in c/src/lib/libbsp/m68k/efi68k/timer/timer.c c/src/lib/libbsp/m68k/efi68k/times c/src/lib/libbsp/m68k/efi68k/wrapup/Makefile.in c/src/lib/libbsp/m68k/gen68302/Makefile.in c/src/lib/libbsp/m68k/gen68302/README c/src/lib/libbsp/m68k/gen68302/bsp_specs c/src/lib/libbsp/m68k/gen68302/clock/Makefile.in c/src/lib/libbsp/m68k/gen68302/clock/ckinit.c c/src/lib/libbsp/m68k/gen68302/console/Makefile.in c/src/lib/libbsp/m68k/gen68302/console/console.c c/src/lib/libbsp/m68k/gen68302/include/Makefile.in c/src/lib/libbsp/m68k/gen68302/include/bsp.h c/src/lib/libbsp/m68k/gen68302/include/coverhd.h c/src/lib/libbsp/m68k/gen68302/start/Makefile.in c/src/lib/libbsp/m68k/gen68302/start/start302.s c/src/lib/libbsp/m68k/gen68302/start302/Makefile.in c/src/lib/libbsp/m68k/gen68302/start302/start302.s c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in c/src/lib/libbsp/m68k/gen68302/startup/bspclean.c c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c c/src/lib/libbsp/m68k/gen68302/startup/linkcmds c/src/lib/libbsp/m68k/gen68302/timer/Makefile.in c/src/lib/libbsp/m68k/gen68302/timer/timer.c c/src/lib/libbsp/m68k/gen68302/timer/timerisr.s c/src/lib/libbsp/m68k/gen68302/times c/src/lib/libbsp/m68k/gen68302/wrapup/Makefile.in c/src/lib/libbsp/m68k/gen68340/Makefile.in c/src/lib/libbsp/m68k/gen68340/README c/src/lib/libbsp/m68k/gen68340/bsp_specs c/src/lib/libbsp/m68k/gen68340/clock/Makefile.in c/src/lib/libbsp/m68k/gen68340/clock/ckinit.c c/src/lib/libbsp/m68k/gen68340/console/Makefile.in c/src/lib/libbsp/m68k/gen68340/console/Modif_cpu_asm.s c/src/lib/libbsp/m68k/gen68340/console/console.c c/src/lib/libbsp/m68k/gen68340/console/m340uart.c c/src/lib/libbsp/m68k/gen68340/include/Makefile.in c/src/lib/libbsp/m68k/gen68340/include/bsp.h c/src/lib/libbsp/m68k/gen68340/include/coverhd.h c/src/lib/libbsp/m68k/gen68340/include/m340timer.h c/src/lib/libbsp/m68k/gen68340/include/m340uart.h c/src/lib/libbsp/m68k/gen68340/include/m68340.h c/src/lib/libbsp/m68k/gen68340/include/m68340.inc c/src/lib/libbsp/m68k/gen68340/include/m68349.inc c/src/lib/libbsp/m68k/gen68340/start/Makefile.in c/src/lib/libbsp/m68k/gen68340/start/start340.s c/src/lib/libbsp/m68k/gen68340/start/startfor340only.s c/src/lib/libbsp/m68k/gen68340/start340/Makefile.in c/src/lib/libbsp/m68k/gen68340/start340/start340.s c/src/lib/libbsp/m68k/gen68340/start340/startfor340only.s c/src/lib/libbsp/m68k/gen68340/startup/Makefile.in c/src/lib/libbsp/m68k/gen68340/startup/bspclean.c c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c c/src/lib/libbsp/m68k/gen68340/startup/dumpanic.c c/src/lib/libbsp/m68k/gen68340/startup/init68340.c c/src/lib/libbsp/m68k/gen68340/startup/linkcmds c/src/lib/libbsp/m68k/gen68340/timer/Makefile.in c/src/lib/libbsp/m68k/gen68340/timer/timer.c c/src/lib/libbsp/m68k/gen68340/wrapup/Makefile.in c/src/lib/libbsp/m68k/gen68360/Makefile.in c/src/lib/libbsp/m68k/gen68360/README c/src/lib/libbsp/m68k/gen68360/bsp_specs c/src/lib/libbsp/m68k/gen68360/clock/Makefile.in c/src/lib/libbsp/m68k/gen68360/clock/ckinit.c c/src/lib/libbsp/m68k/gen68360/console/Makefile.in c/src/lib/libbsp/m68k/gen68360/console/console.c c/src/lib/libbsp/m68k/gen68360/include/Makefile.in c/src/lib/libbsp/m68k/gen68360/include/bsp.h c/src/lib/libbsp/m68k/gen68360/include/coverhd.h c/src/lib/libbsp/m68k/gen68360/network/Makefile.in c/src/lib/libbsp/m68k/gen68360/network/network.c c/src/lib/libbsp/m68k/gen68360/start/Makefile.in c/src/lib/libbsp/m68k/gen68360/start/start360.s c/src/lib/libbsp/m68k/gen68360/start360/Makefile.in c/src/lib/libbsp/m68k/gen68360/start360/start360.s c/src/lib/libbsp/m68k/gen68360/startup/Makefile.in c/src/lib/libbsp/m68k/gen68360/startup/alloc360.c c/src/lib/libbsp/m68k/gen68360/startup/bspclean.c c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c c/src/lib/libbsp/m68k/gen68360/startup/init68360.c c/src/lib/libbsp/m68k/gen68360/startup/linkcmds c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom c/src/lib/libbsp/m68k/gen68360/timer/Makefile.in c/src/lib/libbsp/m68k/gen68360/timer/timer.c c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile.in c/src/lib/libbsp/m68k/idp/Makefile.in c/src/lib/libbsp/m68k/idp/README c/src/lib/libbsp/m68k/idp/bsp_specs c/src/lib/libbsp/m68k/idp/clock/Makefile.in c/src/lib/libbsp/m68k/idp/clock/ckinit.c c/src/lib/libbsp/m68k/idp/console/Makefile.in c/src/lib/libbsp/m68k/idp/console/console.c c/src/lib/libbsp/m68k/idp/console/duart.c c/src/lib/libbsp/m68k/idp/console/leds.c c/src/lib/libbsp/m68k/idp/console/mc68ec.c c/src/lib/libbsp/m68k/idp/include/Makefile.in c/src/lib/libbsp/m68k/idp/include/README c/src/lib/libbsp/m68k/idp/include/bsp.h c/src/lib/libbsp/m68k/idp/include/coverhd.h c/src/lib/libbsp/m68k/idp/include/leds.h c/src/lib/libbsp/m68k/idp/startup/Makefile.in c/src/lib/libbsp/m68k/idp/startup/bspstart.c c/src/lib/libbsp/m68k/idp/startup/linkcmds c/src/lib/libbsp/m68k/idp/timer/Makefile.in c/src/lib/libbsp/m68k/idp/timer/timer.c c/src/lib/libbsp/m68k/idp/timer/timerisr.s c/src/lib/libbsp/m68k/idp/times c/src/lib/libbsp/m68k/idp/wrapup/Makefile.in c/src/lib/libbsp/m68k/mvme136/Makefile.in c/src/lib/libbsp/m68k/mvme136/bsp_specs c/src/lib/libbsp/m68k/mvme136/clock/Makefile.in c/src/lib/libbsp/m68k/mvme136/clock/ckinit.c c/src/lib/libbsp/m68k/mvme136/console/Makefile.in c/src/lib/libbsp/m68k/mvme136/console/console.c c/src/lib/libbsp/m68k/mvme136/include/Makefile.in c/src/lib/libbsp/m68k/mvme136/include/bsp.h c/src/lib/libbsp/m68k/mvme136/include/coverhd.h c/src/lib/libbsp/m68k/mvme136/shmsupp/Makefile.in c/src/lib/libbsp/m68k/mvme136/shmsupp/addrconv.c c/src/lib/libbsp/m68k/mvme136/shmsupp/getcfg.c c/src/lib/libbsp/m68k/mvme136/shmsupp/lock.c c/src/lib/libbsp/m68k/mvme136/shmsupp/mpisr.c c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in c/src/lib/libbsp/m68k/mvme136/startup/bspclean.c c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c c/src/lib/libbsp/m68k/mvme136/startup/linkcmds c/src/lib/libbsp/m68k/mvme136/timer/Makefile.in c/src/lib/libbsp/m68k/mvme136/timer/timer.c c/src/lib/libbsp/m68k/mvme136/timer/timerisr.s c/src/lib/libbsp/m68k/mvme136/times c/src/lib/libbsp/m68k/mvme136/wrapup/Makefile.in c/src/lib/libbsp/m68k/mvme147/Makefile.in c/src/lib/libbsp/m68k/mvme147/README c/src/lib/libbsp/m68k/mvme147/bsp_specs c/src/lib/libbsp/m68k/mvme147/clock/Makefile.in c/src/lib/libbsp/m68k/mvme147/clock/ckinit.c c/src/lib/libbsp/m68k/mvme147/console/Makefile.in c/src/lib/libbsp/m68k/mvme147/console/console.c c/src/lib/libbsp/m68k/mvme147/include/Makefile.in c/src/lib/libbsp/m68k/mvme147/include/bsp.h c/src/lib/libbsp/m68k/mvme147/include/coverhd.h c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in c/src/lib/libbsp/m68k/mvme147/startup/bspclean.c c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c c/src/lib/libbsp/m68k/mvme147/startup/linkcmds c/src/lib/libbsp/m68k/mvme147/timer/Makefile.in c/src/lib/libbsp/m68k/mvme147/timer/timer.c c/src/lib/libbsp/m68k/mvme147/timer/timerisr.s c/src/lib/libbsp/m68k/mvme147/times c/src/lib/libbsp/m68k/mvme147/wrapup/Makefile.in c/src/lib/libbsp/m68k/mvme147s/Makefile.in c/src/lib/libbsp/m68k/mvme147s/README c/src/lib/libbsp/m68k/mvme147s/bsp_specs c/src/lib/libbsp/m68k/mvme147s/clock/Makefile.in c/src/lib/libbsp/m68k/mvme147s/console/Makefile.in c/src/lib/libbsp/m68k/mvme147s/include/Makefile.in c/src/lib/libbsp/m68k/mvme147s/include/bsp.h c/src/lib/libbsp/m68k/mvme147s/include/coverhd.h c/src/lib/libbsp/m68k/mvme147s/shmsupp/Makefile.in c/src/lib/libbsp/m68k/mvme147s/shmsupp/addrconv.c c/src/lib/libbsp/m68k/mvme147s/shmsupp/getcfg.c c/src/lib/libbsp/m68k/mvme147s/shmsupp/lock.c c/src/lib/libbsp/m68k/mvme147s/shmsupp/mpisr.c c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds c/src/lib/libbsp/m68k/mvme147s/timer/Makefile.in c/src/lib/libbsp/m68k/mvme147s/times c/src/lib/libbsp/m68k/mvme147s/wrapup/Makefile.in c/src/lib/libbsp/m68k/mvme162/Makefile.in c/src/lib/libbsp/m68k/mvme162/README c/src/lib/libbsp/m68k/mvme162/bsp_specs c/src/lib/libbsp/m68k/mvme162/clock/Makefile.in c/src/lib/libbsp/m68k/mvme162/clock/ckinit.c c/src/lib/libbsp/m68k/mvme162/console/Makefile.in c/src/lib/libbsp/m68k/mvme162/console/console.c c/src/lib/libbsp/m68k/mvme162/consolex/Makefile.in c/src/lib/libbsp/m68k/mvme162/consolex/README c/src/lib/libbsp/m68k/mvme162/consolex/cTest.c c/src/lib/libbsp/m68k/mvme162/consolex/consolex.c c/src/lib/libbsp/m68k/mvme162/consolex/consolex.h c/src/lib/libbsp/m68k/mvme162/include/Makefile.in c/src/lib/libbsp/m68k/mvme162/include/bsp.h c/src/lib/libbsp/m68k/mvme162/include/coverhd.h c/src/lib/libbsp/m68k/mvme162/include/page_table.h c/src/lib/libbsp/m68k/mvme162/include/tod.h c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c c/src/lib/libbsp/m68k/mvme162/startup/linkcmds c/src/lib/libbsp/m68k/mvme162/startup/page_table.c c/src/lib/libbsp/m68k/mvme162/timer/Makefile.in c/src/lib/libbsp/m68k/mvme162/timer/timer.c c/src/lib/libbsp/m68k/mvme162/timer/timerisr.s c/src/lib/libbsp/m68k/mvme162/times c/src/lib/libbsp/m68k/mvme162/tod/Makefile.in c/src/lib/libbsp/m68k/mvme162/tod/tod.c c/src/lib/libbsp/m68k/mvme162/tools/Makefile.in c/src/lib/libbsp/m68k/mvme162/tools/sload.c c/src/lib/libbsp/m68k/mvme162/wrapup/Makefile.in c/src/lib/libbsp/m68k/ods68302/Makefile.in c/src/lib/libbsp/m68k/ods68302/README c/src/lib/libbsp/m68k/ods68302/bsp_specs c/src/lib/libbsp/m68k/ods68302/clock/Makefile.in c/src/lib/libbsp/m68k/ods68302/clock/ckinit.c c/src/lib/libbsp/m68k/ods68302/console/Makefile.in c/src/lib/libbsp/m68k/ods68302/console/console.c c/src/lib/libbsp/m68k/ods68302/include/Makefile.in c/src/lib/libbsp/m68k/ods68302/include/bare.h c/src/lib/libbsp/m68k/ods68302/include/bsp.h c/src/lib/libbsp/m68k/ods68302/include/coverhd.h c/src/lib/libbsp/m68k/ods68302/include/crc.h c/src/lib/libbsp/m68k/ods68302/include/debugport.h c/src/lib/libbsp/m68k/ods68302/include/m68302scc.h c/src/lib/libbsp/m68k/ods68302/start/Makefile.in c/src/lib/libbsp/m68k/ods68302/start/cpuboot.c c/src/lib/libbsp/m68k/ods68302/start/debugreset.S c/src/lib/libbsp/m68k/ods68302/start/reset.S c/src/lib/libbsp/m68k/ods68302/start302/Makefile.in c/src/lib/libbsp/m68k/ods68302/start302/cpuboot.c c/src/lib/libbsp/m68k/ods68302/start302/debugreset.S c/src/lib/libbsp/m68k/ods68302/start302/reset.S c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in c/src/lib/libbsp/m68k/ods68302/startup/bspclean.c c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c c/src/lib/libbsp/m68k/ods68302/startup/crc.c c/src/lib/libbsp/m68k/ods68302/startup/debugger c/src/lib/libbsp/m68k/ods68302/startup/debugport.c c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c c/src/lib/libbsp/m68k/ods68302/startup/linkcmds c/src/lib/libbsp/m68k/ods68302/startup/m68302scc.c c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c c/src/lib/libbsp/m68k/ods68302/startup/rom c/src/lib/libbsp/m68k/ods68302/startup/trace.c c/src/lib/libbsp/m68k/ods68302/timer/Makefile.in c/src/lib/libbsp/m68k/ods68302/timer/timer.c c/src/lib/libbsp/m68k/ods68302/timer/timerisr.s c/src/lib/libbsp/m68k/ods68302/wrapup/Makefile.in c/src/lib/libbsp/m68k/shared/setvec.c c/src/lib/libbsp/mips/README c/src/lib/libbsp/mips/p4000/README c/src/lib/libbsp/mips/p4000/bsp_specs c/src/lib/libbsp/mips/p4000/console/console.c c/src/lib/libbsp/mips/p4000/console/led.S c/src/lib/libbsp/mips/p4000/include/bsp.h c/src/lib/libbsp/mips/p4000/include/coverhd.h c/src/lib/libbsp/mips/p4000/liblnk/lnklib.S c/src/lib/libbsp/mips/p4000/start/start.S c/src/lib/libbsp/mips/p4000/startup/bspclean.c c/src/lib/libbsp/mips/p4000/startup/bspstart.c c/src/lib/libbsp/mips/p4000/startup/ghlinkcmds c/src/lib/libbsp/mips/p4000/startup/idtmem.S c/src/lib/libbsp/mips/p4000/startup/idttlb.S c/src/lib/libbsp/mips/p4000/startup/inittlb.c c/src/lib/libbsp/mips/p4000/startup/linkcmds c/src/lib/libbsp/mips/p4000/startup/setvec.c c/src/lib/libbsp/mips/p4000/times c/src/lib/libbsp/mips64orion/Makefile.in c/src/lib/libbsp/mips64orion/README c/src/lib/libbsp/mips64orion/p4000/Makefile.in c/src/lib/libbsp/mips64orion/p4000/README c/src/lib/libbsp/mips64orion/p4000/bsp_specs c/src/lib/libbsp/mips64orion/p4000/console/Makefile.in c/src/lib/libbsp/mips64orion/p4000/console/console.c c/src/lib/libbsp/mips64orion/p4000/console/led.S c/src/lib/libbsp/mips64orion/p4000/include/Makefile.in c/src/lib/libbsp/mips64orion/p4000/include/bsp.h c/src/lib/libbsp/mips64orion/p4000/include/coverhd.h c/src/lib/libbsp/mips64orion/p4000/liblnk/Makefile.in c/src/lib/libbsp/mips64orion/p4000/liblnk/lnklib.S c/src/lib/libbsp/mips64orion/p4000/start/Makefile.in c/src/lib/libbsp/mips64orion/p4000/start/start.S c/src/lib/libbsp/mips64orion/p4000/startup/Makefile.in c/src/lib/libbsp/mips64orion/p4000/startup/bspclean.c c/src/lib/libbsp/mips64orion/p4000/startup/bspstart.c c/src/lib/libbsp/mips64orion/p4000/startup/ghlinkcmds c/src/lib/libbsp/mips64orion/p4000/startup/idtmem.S c/src/lib/libbsp/mips64orion/p4000/startup/idttlb.S c/src/lib/libbsp/mips64orion/p4000/startup/inittlb.c c/src/lib/libbsp/mips64orion/p4000/startup/linkcmds c/src/lib/libbsp/mips64orion/p4000/startup/setvec.c c/src/lib/libbsp/mips64orion/p4000/times c/src/lib/libbsp/mips64orion/p4000/wrapup/Makefile.in c/src/lib/libbsp/no_cpu/Makefile.in c/src/lib/libbsp/no_cpu/no_bsp/Makefile.in c/src/lib/libbsp/no_cpu/no_bsp/README c/src/lib/libbsp/no_cpu/no_bsp/clock/Makefile.in c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c c/src/lib/libbsp/no_cpu/no_bsp/console/Makefile.in c/src/lib/libbsp/no_cpu/no_bsp/console/console.c c/src/lib/libbsp/no_cpu/no_bsp/include/Makefile.in c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h c/src/lib/libbsp/no_cpu/no_bsp/include/coverhd.h c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/Makefile.in c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/addrconv.c c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/getcfg.c c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/lock.c c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/mpisr.c c/src/lib/libbsp/no_cpu/no_bsp/startup/Makefile.in c/src/lib/libbsp/no_cpu/no_bsp/startup/bspclean.c c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c c/src/lib/libbsp/no_cpu/no_bsp/startup/linkcmds c/src/lib/libbsp/no_cpu/no_bsp/startup/main.c c/src/lib/libbsp/no_cpu/no_bsp/startup/setvec.c c/src/lib/libbsp/no_cpu/no_bsp/timer/Makefile.in c/src/lib/libbsp/no_cpu/no_bsp/timer/timer.c c/src/lib/libbsp/no_cpu/no_bsp/timer/timerisr.c c/src/lib/libbsp/no_cpu/no_bsp/times c/src/lib/libbsp/no_cpu/no_bsp/wrapup/Makefile.in c/src/lib/libbsp/powerpc/Makefile.in c/src/lib/libbsp/powerpc/dmv177/Makefile.in c/src/lib/libbsp/powerpc/dmv177/QUIRKS c/src/lib/libbsp/powerpc/dmv177/README c/src/lib/libbsp/powerpc/dmv177/README.net c/src/lib/libbsp/powerpc/dmv177/STATUS c/src/lib/libbsp/powerpc/dmv177/bsp_specs c/src/lib/libbsp/powerpc/dmv177/cable.doc c/src/lib/libbsp/powerpc/dmv177/clock/Makefile.in c/src/lib/libbsp/powerpc/dmv177/clock/clock.c c/src/lib/libbsp/powerpc/dmv177/console/Makefile.in c/src/lib/libbsp/powerpc/dmv177/console/config.c c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c c/src/lib/libbsp/powerpc/dmv177/console/debugio.c c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in c/src/lib/libbsp/powerpc/dmv177/include/bsp.h c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h c/src/lib/libbsp/powerpc/dmv177/scv64/Makefile.in c/src/lib/libbsp/powerpc/dmv177/scv64/scv64.c c/src/lib/libbsp/powerpc/dmv177/sonic/Makefile.in c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.c c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.h c/src/lib/libbsp/powerpc/dmv177/start/Makefile.in c/src/lib/libbsp/powerpc/dmv177/start/start.s c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c c/src/lib/libbsp/powerpc/dmv177/timer/Makefile.in c/src/lib/libbsp/powerpc/dmv177/timer/timer.c c/src/lib/libbsp/powerpc/dmv177/times c/src/lib/libbsp/powerpc/dmv177/tod/Makefile.in c/src/lib/libbsp/powerpc/dmv177/tod/config.c c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in c/src/lib/libbsp/powerpc/helas403/Makefile.in c/src/lib/libbsp/powerpc/helas403/README c/src/lib/libbsp/powerpc/helas403/bsp_specs c/src/lib/libbsp/powerpc/helas403/bsp_specs.dl c/src/lib/libbsp/powerpc/helas403/dlentry/Makefile.in c/src/lib/libbsp/powerpc/helas403/dlentry/dlentry.s c/src/lib/libbsp/powerpc/helas403/flashentry/Makefile.in c/src/lib/libbsp/powerpc/helas403/flashentry/flashentry.s c/src/lib/libbsp/powerpc/helas403/include/Makefile.in c/src/lib/libbsp/powerpc/helas403/include/bsp.h c/src/lib/libbsp/powerpc/helas403/include/coverhd.h c/src/lib/libbsp/powerpc/helas403/startup/Makefile.in c/src/lib/libbsp/powerpc/helas403/startup/bspclean.c c/src/lib/libbsp/powerpc/helas403/startup/bspstart.c c/src/lib/libbsp/powerpc/helas403/startup/linkcmds c/src/lib/libbsp/powerpc/helas403/startup/linkcmds.dl c/src/lib/libbsp/powerpc/helas403/startup/setvec.c c/src/lib/libbsp/powerpc/helas403/times c/src/lib/libbsp/powerpc/helas403/wrapup/Makefile.in c/src/lib/libbsp/powerpc/papyrus/Makefile.in c/src/lib/libbsp/powerpc/papyrus/README c/src/lib/libbsp/powerpc/papyrus/bsp_specs c/src/lib/libbsp/powerpc/papyrus/dlentry/Makefile.in c/src/lib/libbsp/powerpc/papyrus/dlentry/dlentry.s c/src/lib/libbsp/powerpc/papyrus/flashentry/Makefile.in c/src/lib/libbsp/powerpc/papyrus/flashentry/flashentry.s c/src/lib/libbsp/powerpc/papyrus/include/Makefile.in c/src/lib/libbsp/powerpc/papyrus/include/bsp.h c/src/lib/libbsp/powerpc/papyrus/include/coverhd.h c/src/lib/libbsp/powerpc/papyrus/startup/Makefile.in c/src/lib/libbsp/powerpc/papyrus/startup/bspclean.c c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c c/src/lib/libbsp/powerpc/papyrus/startup/linkcmds c/src/lib/libbsp/powerpc/papyrus/startup/setvec.c c/src/lib/libbsp/powerpc/papyrus/times c/src/lib/libbsp/powerpc/papyrus/wrapup/Makefile.in c/src/lib/libbsp/powerpc/psim/Makefile.in c/src/lib/libbsp/powerpc/psim/README c/src/lib/libbsp/powerpc/psim/bsp_specs c/src/lib/libbsp/powerpc/psim/clock/Makefile.in c/src/lib/libbsp/powerpc/psim/clock/clock.c c/src/lib/libbsp/powerpc/psim/console/Makefile.in c/src/lib/libbsp/powerpc/psim/console/console.c c/src/lib/libbsp/powerpc/psim/console/consupp.s c/src/lib/libbsp/powerpc/psim/include/Makefile.in c/src/lib/libbsp/powerpc/psim/include/bsp.h c/src/lib/libbsp/powerpc/psim/include/coverhd.h c/src/lib/libbsp/powerpc/psim/shmsupp/Makefile.in c/src/lib/libbsp/powerpc/psim/shmsupp/README c/src/lib/libbsp/powerpc/psim/shmsupp/addrconv.c c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c c/src/lib/libbsp/powerpc/psim/shmsupp/mpisr.c c/src/lib/libbsp/powerpc/psim/start/Makefile.in c/src/lib/libbsp/powerpc/psim/start/startsim.s c/src/lib/libbsp/powerpc/psim/startsim/Makefile.in c/src/lib/libbsp/powerpc/psim/startsim/startsim.s c/src/lib/libbsp/powerpc/psim/startup/Makefile.in c/src/lib/libbsp/powerpc/psim/startup/bspclean.c c/src/lib/libbsp/powerpc/psim/startup/bspstart.c c/src/lib/libbsp/powerpc/psim/startup/device-tree c/src/lib/libbsp/powerpc/psim/startup/linkcmds c/src/lib/libbsp/powerpc/psim/startup/setvec.c c/src/lib/libbsp/powerpc/psim/timer/Makefile.in c/src/lib/libbsp/powerpc/psim/timer/timer.c c/src/lib/libbsp/powerpc/psim/tools/Makefile.in c/src/lib/libbsp/powerpc/psim/tools/psim c/src/lib/libbsp/powerpc/psim/tools/runtest c/src/lib/libbsp/powerpc/psim/vectors/Makefile.in c/src/lib/libbsp/powerpc/psim/vectors/README c/src/lib/libbsp/powerpc/psim/vectors/align_h.s c/src/lib/libbsp/powerpc/psim/vectors/vectors.s c/src/lib/libbsp/powerpc/psim/wrapup/Makefile.in c/src/lib/libbsp/sh/Makefile.in c/src/lib/libbsp/sh/gensh1/Makefile.in c/src/lib/libbsp/sh/gensh1/README c/src/lib/libbsp/sh/gensh1/bsp_specs c/src/lib/libbsp/sh/gensh1/include/Makefile.in c/src/lib/libbsp/sh/gensh1/include/bsp.h c/src/lib/libbsp/sh/gensh1/include/coverhd.h c/src/lib/libbsp/sh/gensh1/scitab/Makefile.in c/src/lib/libbsp/sh/gensh1/start/Makefile.in c/src/lib/libbsp/sh/gensh1/startup/Makefile.in c/src/lib/libbsp/sh/gensh1/startup/bspclean.c c/src/lib/libbsp/sh/gensh1/startup/bspstart.c c/src/lib/libbsp/sh/gensh1/startup/linkcmds c/src/lib/libbsp/sh/gensh1/times c/src/lib/libbsp/sh/gensh1/wrapup/Makefile.in c/src/lib/libbsp/sh/shared/setvec.c c/src/lib/libbsp/shared/bspclean.c c/src/lib/libbsp/shared/bsplibc.c c/src/lib/libbsp/shared/bsppost.c c/src/lib/libbsp/shared/console.c c/src/lib/libbsp/shared/main.c c/src/lib/libbsp/shared/sbrk.c c/src/lib/libbsp/shared/tod.c c/src/lib/libbsp/shared/tod.h c/src/lib/libbsp/shmdr/Makefile.in c/src/lib/libbsp/shmdr/README c/src/lib/libbsp/shmdr/addlq.c c/src/lib/libbsp/shmdr/cnvpkt.c c/src/lib/libbsp/shmdr/dump.c c/src/lib/libbsp/shmdr/fatal.c c/src/lib/libbsp/shmdr/getlq.c c/src/lib/libbsp/shmdr/getpkt.c c/src/lib/libbsp/shmdr/init.c c/src/lib/libbsp/shmdr/initlq.c c/src/lib/libbsp/shmdr/intr.c c/src/lib/libbsp/shmdr/mpci.h c/src/lib/libbsp/shmdr/mpisr.c c/src/lib/libbsp/shmdr/poll.c c/src/lib/libbsp/shmdr/receive.c c/src/lib/libbsp/shmdr/retpkt.c c/src/lib/libbsp/shmdr/send.c c/src/lib/libbsp/shmdr/setckvec.c c/src/lib/libbsp/shmdr/shm.h c/src/lib/libbsp/shmdr/shm_driver.h c/src/lib/libbsp/sparc/Makefile.in c/src/lib/libbsp/sparc/erc32/Makefile.in c/src/lib/libbsp/sparc/erc32/README c/src/lib/libbsp/sparc/erc32/bsp_specs c/src/lib/libbsp/sparc/erc32/clock/Makefile.in c/src/lib/libbsp/sparc/erc32/clock/ckinit.c c/src/lib/libbsp/sparc/erc32/console/Makefile.in c/src/lib/libbsp/sparc/erc32/console/console.c c/src/lib/libbsp/sparc/erc32/include/Makefile.in c/src/lib/libbsp/sparc/erc32/include/bsp.h c/src/lib/libbsp/sparc/erc32/include/coverhd.h c/src/lib/libbsp/sparc/erc32/start/Makefile.in c/src/lib/libbsp/sparc/erc32/start/startsis.s c/src/lib/libbsp/sparc/erc32/startsis/Makefile.in c/src/lib/libbsp/sparc/erc32/startsis/startsis.s c/src/lib/libbsp/sparc/erc32/startup/Makefile.in c/src/lib/libbsp/sparc/erc32/startup/bspclean.c c/src/lib/libbsp/sparc/erc32/startup/bspstart.c c/src/lib/libbsp/sparc/erc32/startup/linkcmds c/src/lib/libbsp/sparc/erc32/startup/setvec.c c/src/lib/libbsp/sparc/erc32/startup/spurious.c c/src/lib/libbsp/sparc/erc32/timer/Makefile.in c/src/lib/libbsp/sparc/erc32/timer/timer.c c/src/lib/libbsp/sparc/erc32/times c/src/lib/libbsp/sparc/erc32/tools/Makefile.in c/src/lib/libbsp/sparc/erc32/tools/runtest.in c/src/lib/libbsp/sparc/erc32/wrapup/Makefile.in c/src/lib/libbsp/unix/Makefile.in c/src/lib/libbsp/unix/posix/Makefile.in c/src/lib/libbsp/unix/posix/README c/src/lib/libbsp/unix/posix/bsp_specs c/src/lib/libbsp/unix/posix/clock/Makefile.in c/src/lib/libbsp/unix/posix/clock/clock.c c/src/lib/libbsp/unix/posix/console/Makefile.in c/src/lib/libbsp/unix/posix/console/console.c c/src/lib/libbsp/unix/posix/include/Makefile.in c/src/lib/libbsp/unix/posix/include/bsp.h c/src/lib/libbsp/unix/posix/include/coverhd.h c/src/lib/libbsp/unix/posix/shmsupp/Makefile.in c/src/lib/libbsp/unix/posix/shmsupp/README c/src/lib/libbsp/unix/posix/shmsupp/addrconv.c c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c c/src/lib/libbsp/unix/posix/shmsupp/intr.c c/src/lib/libbsp/unix/posix/shmsupp/lock.c c/src/lib/libbsp/unix/posix/shmsupp/mpisr.c c/src/lib/libbsp/unix/posix/startup/Makefile.in c/src/lib/libbsp/unix/posix/startup/bspclean.c c/src/lib/libbsp/unix/posix/startup/bspstart.c c/src/lib/libbsp/unix/posix/startup/exit.c c/src/lib/libbsp/unix/posix/startup/main.c c/src/lib/libbsp/unix/posix/startup/no-ctor.c c/src/lib/libbsp/unix/posix/startup/rtems-ctor.cc c/src/lib/libbsp/unix/posix/startup/setvec.c c/src/lib/libbsp/unix/posix/timer/Makefile.in c/src/lib/libbsp/unix/posix/timer/timer.c c/src/lib/libbsp/unix/posix/times c/src/lib/libbsp/unix/posix/tools/Makefile.in c/src/lib/libbsp/unix/posix/tools/looptest.in c/src/lib/libbsp/unix/posix/tools/runtest.in c/src/lib/libbsp/unix/posix/tools/semdump.in c/src/lib/libbsp/unix/posix/tools/shmdump.in c/src/lib/libbsp/unix/posix/wrapup/Makefile.in c/src/lib/libc/Makefile.in c/src/lib/libc/README c/src/lib/libc/__brk.c c/src/lib/libc/__gettod.c c/src/lib/libc/__times.c c/src/lib/libc/_execve.c c/src/lib/libc/assoc.c c/src/lib/libc/assoc.h c/src/lib/libc/cfiospeed.c c/src/lib/libc/closedir.c c/src/lib/libc/error.c c/src/lib/libc/error.h c/src/lib/libc/getdents.c c/src/lib/libc/hosterr.c c/src/lib/libc/internal.h c/src/lib/libc/libcsupport.h c/src/lib/libc/libio.c c/src/lib/libc/libio.h c/src/lib/libc/malloc.c c/src/lib/libc/newlibc.c c/src/lib/libc/newlibif.c c/src/lib/libc/newlibifr.c c/src/lib/libc/no_libc.c c/src/lib/libc/opendir.c c/src/lib/libc/readdir.c c/src/lib/libc/rewinddir.c c/src/lib/libc/scandir.c c/src/lib/libc/seekdir.c c/src/lib/libc/support.c c/src/lib/libc/syscalls.c c/src/lib/libc/tcattr.c c/src/lib/libc/tcdrain.c c/src/lib/libc/telldir.c c/src/lib/libc/termios.c c/src/lib/libc/unixlibc.c c/src/lib/libc/utsname.c c/src/lib/libchip/Makefile.in c/src/lib/libchip/rtc/Makefile.in c/src/lib/libchip/rtc/README.ds1643 c/src/lib/libchip/rtc/README.icm7170 c/src/lib/libchip/rtc/README.m48t08 c/src/lib/libchip/rtc/README.m48t18 c/src/lib/libchip/rtc/STATUS c/src/lib/libchip/rtc/icm7170.c c/src/lib/libchip/rtc/icm7170.h c/src/lib/libchip/rtc/icm7170_reg.c c/src/lib/libchip/rtc/icm7170_reg2.c c/src/lib/libchip/rtc/icm7170_reg4.c c/src/lib/libchip/rtc/icm7170_reg8.c c/src/lib/libchip/rtc/m48t08.c c/src/lib/libchip/rtc/m48t08.h c/src/lib/libchip/rtc/m48t08_reg.c c/src/lib/libchip/rtc/m48t08_reg2.c c/src/lib/libchip/rtc/m48t08_reg4.c c/src/lib/libchip/rtc/m48t08_reg8.c c/src/lib/libchip/rtc/rtc.h c/src/lib/libchip/rtc/rtcprobe.c c/src/lib/libchip/serial/Makefile.in c/src/lib/libchip/serial/README c/src/lib/libchip/serial/README.mc68681 c/src/lib/libchip/serial/README.ns16550 c/src/lib/libchip/serial/README.xr88681 c/src/lib/libchip/serial/README.z85c30 c/src/lib/libchip/serial/STATUS c/src/lib/libchip/serial/mc68681.c c/src/lib/libchip/serial/mc68681.h c/src/lib/libchip/serial/mc68681_baud.c c/src/lib/libchip/serial/mc68681_p.h c/src/lib/libchip/serial/mc68681_reg.c c/src/lib/libchip/serial/mc68681_reg2.c c/src/lib/libchip/serial/mc68681_reg4.c c/src/lib/libchip/serial/mc68681_reg8.c c/src/lib/libchip/serial/ns16550.c c/src/lib/libchip/serial/ns16550.h c/src/lib/libchip/serial/ns16550_p.h c/src/lib/libchip/serial/serial.h c/src/lib/libchip/serial/serprobe.c c/src/lib/libchip/serial/sersupp.h c/src/lib/libchip/serial/termios_baud2index.c c/src/lib/libchip/serial/termios_baud2num.c c/src/lib/libchip/serial/z85c30.c c/src/lib/libchip/serial/z85c30.h c/src/lib/libchip/serial/z85c30_p.h c/src/lib/libchip/serial/z85c30_reg.c c/src/lib/libcpu/Makefile.in c/src/lib/libcpu/README c/src/lib/libcpu/hppa1.1/Makefile.in c/src/lib/libcpu/hppa1.1/clock/Makefile.in c/src/lib/libcpu/hppa1.1/clock/clock.c c/src/lib/libcpu/hppa1.1/include/Makefile.in c/src/lib/libcpu/hppa1.1/milli/Makefile.in c/src/lib/libcpu/hppa1.1/milli/milli.s c/src/lib/libcpu/hppa1.1/runway/Makefile.in c/src/lib/libcpu/hppa1.1/runway/runway.h c/src/lib/libcpu/hppa1.1/semaphore/Makefile.in c/src/lib/libcpu/hppa1.1/semaphore/semaphore.c c/src/lib/libcpu/hppa1.1/semaphore/semaphore.h c/src/lib/libcpu/hppa1.1/timer/Makefile.in c/src/lib/libcpu/hppa1.1/timer/timer.c c/src/lib/libcpu/i386/Makefile.in c/src/lib/libcpu/i386/cpu.c c/src/lib/libcpu/i386/cpu.h c/src/lib/libcpu/i386/cpuModel.S c/src/lib/libcpu/i386/cpuModel.h c/src/lib/libcpu/i386/cpu_asm.S c/src/lib/libcpu/i386/displayCpu.c c/src/lib/libcpu/i386/idt.c c/src/lib/libcpu/i386/registers.h c/src/lib/libcpu/i386/wrapup/Makefile.in c/src/lib/libcpu/m68k/Makefile.in c/src/lib/libcpu/m68k/m68040/Makefile.in c/src/lib/libcpu/m68k/m68040/fpsp/Makefile.in c/src/lib/libcpu/m68k/m68040/fpsp/README c/src/lib/libcpu/m68k/m68040/fpsp/bindec.s c/src/lib/libcpu/m68k/m68040/fpsp/binstr.s c/src/lib/libcpu/m68k/m68040/fpsp/bugfix.s c/src/lib/libcpu/m68k/m68040/fpsp/decbin.s c/src/lib/libcpu/m68k/m68040/fpsp/do_func.s c/src/lib/libcpu/m68k/m68040/fpsp/fpsp.defs c/src/lib/libcpu/m68k/m68040/fpsp/gen_except.s c/src/lib/libcpu/m68k/m68040/fpsp/get_op.s c/src/lib/libcpu/m68k/m68040/fpsp/kernel_ex.s c/src/lib/libcpu/m68k/m68040/fpsp/res_func.s c/src/lib/libcpu/m68k/m68040/fpsp/round.s c/src/lib/libcpu/m68k/m68040/fpsp/rtems_fpsp.c c/src/lib/libcpu/m68k/m68040/fpsp/rtems_skel.s c/src/lib/libcpu/m68k/m68040/fpsp/sacos.s c/src/lib/libcpu/m68k/m68040/fpsp/sasin.s c/src/lib/libcpu/m68k/m68040/fpsp/satan.s c/src/lib/libcpu/m68k/m68040/fpsp/satanh.s c/src/lib/libcpu/m68k/m68040/fpsp/scale.s c/src/lib/libcpu/m68k/m68040/fpsp/scosh.s c/src/lib/libcpu/m68k/m68040/fpsp/setox.s c/src/lib/libcpu/m68k/m68040/fpsp/sgetem.s c/src/lib/libcpu/m68k/m68040/fpsp/sint.s c/src/lib/libcpu/m68k/m68040/fpsp/slog2.s c/src/lib/libcpu/m68k/m68040/fpsp/slogn.s c/src/lib/libcpu/m68k/m68040/fpsp/smovecr.s c/src/lib/libcpu/m68k/m68040/fpsp/srem_mod.s c/src/lib/libcpu/m68k/m68040/fpsp/ssin.s c/src/lib/libcpu/m68k/m68040/fpsp/ssinh.s c/src/lib/libcpu/m68k/m68040/fpsp/stan.s c/src/lib/libcpu/m68k/m68040/fpsp/stanh.s c/src/lib/libcpu/m68k/m68040/fpsp/sto_res.s c/src/lib/libcpu/m68k/m68040/fpsp/stwotox.s c/src/lib/libcpu/m68k/m68040/fpsp/tbldo.s c/src/lib/libcpu/m68k/m68040/fpsp/util.s c/src/lib/libcpu/m68k/m68040/fpsp/x_bsun.s c/src/lib/libcpu/m68k/m68040/fpsp/x_fline.s c/src/lib/libcpu/m68k/m68040/fpsp/x_operr.s c/src/lib/libcpu/m68k/m68040/fpsp/x_ovfl.s c/src/lib/libcpu/m68k/m68040/fpsp/x_snan.s c/src/lib/libcpu/m68k/m68040/fpsp/x_store.s c/src/lib/libcpu/m68k/m68040/fpsp/x_unfl.s c/src/lib/libcpu/m68k/m68040/fpsp/x_unimp.s c/src/lib/libcpu/m68k/m68040/fpsp/x_unsupp.s c/src/lib/libcpu/m68k/shared/misc/memcpy.c c/src/lib/libcpu/mips/clock/ckinit.c c/src/lib/libcpu/mips/clock/clock.S c/src/lib/libcpu/mips/clock/clock.h c/src/lib/libcpu/mips/timer/gettime.S c/src/lib/libcpu/mips/timer/timer.c c/src/lib/libcpu/mips64orion/Makefile.in c/src/lib/libcpu/mips64orion/clock/Makefile.in c/src/lib/libcpu/mips64orion/clock/ckinit.c c/src/lib/libcpu/mips64orion/clock/clock.S c/src/lib/libcpu/mips64orion/clock/clock.h c/src/lib/libcpu/mips64orion/include/Makefile.in c/src/lib/libcpu/mips64orion/timer/Makefile.in c/src/lib/libcpu/mips64orion/timer/gettime.S c/src/lib/libcpu/mips64orion/timer/timer.c c/src/lib/libcpu/powerpc/Makefile.in c/src/lib/libcpu/powerpc/README c/src/lib/libcpu/powerpc/ppc403/Makefile.in c/src/lib/libcpu/powerpc/ppc403/README c/src/lib/libcpu/powerpc/ppc403/clock/Makefile.in c/src/lib/libcpu/powerpc/ppc403/clock/clock.c c/src/lib/libcpu/powerpc/ppc403/console/Makefile.in c/src/lib/libcpu/powerpc/ppc403/console/console.c c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled c/src/lib/libcpu/powerpc/ppc403/ictrl/Makefile.in c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.h c/src/lib/libcpu/powerpc/ppc403/include/Makefile.in c/src/lib/libcpu/powerpc/ppc403/timer/Makefile.in c/src/lib/libcpu/powerpc/ppc403/timer/timer.c c/src/lib/libcpu/powerpc/ppc403/vectors/Makefile.in c/src/lib/libcpu/powerpc/ppc403/vectors/README c/src/lib/libcpu/powerpc/ppc403/vectors/align_h.s c/src/lib/libcpu/powerpc/ppc403/vectors/vectors.s c/src/lib/libcpu/sh/Makefile.in c/src/lib/libcpu/sh/sh7032/Makefile.in c/src/lib/libcpu/sh/sh7032/clock/Makefile.in c/src/lib/libcpu/sh/sh7032/clock/ckinit.c c/src/lib/libcpu/sh/sh7032/console/Makefile.in c/src/lib/libcpu/sh/sh7032/console/console.c c/src/lib/libcpu/sh/sh7032/include/Makefile.in c/src/lib/libcpu/sh/sh7032/include/ioqueue.h c/src/lib/libcpu/sh/sh7032/include/null.h c/src/lib/libcpu/sh/sh7032/include/sci.h c/src/lib/libcpu/sh/sh7032/include/sh7_pfc.h c/src/lib/libcpu/sh/sh7032/include/sh7_sci.h c/src/lib/libcpu/sh/sh7032/null/Makefile.in c/src/lib/libcpu/sh/sh7032/null/close.c c/src/lib/libcpu/sh/sh7032/null/cntrl.c c/src/lib/libcpu/sh/sh7032/null/init.c c/src/lib/libcpu/sh/sh7032/null/open.c c/src/lib/libcpu/sh/sh7032/null/read.c c/src/lib/libcpu/sh/sh7032/null/write.c c/src/lib/libcpu/sh/sh7032/score/cpu_asm.c c/src/lib/libcpu/sh/sh7032/score/ispsh7032.c c/src/lib/libcpu/sh/sh7032/timer/Makefile.in c/src/lib/libcpu/sh/sh7032/timer/timer.c c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c c/src/lib/libcpu/sparc/Makefile.in c/src/lib/libcpu/sparc/include/erc32.h c/src/lib/libcpu/sparc/reg_win/Makefile.in c/src/lib/libcpu/sparc/reg_win/window.s c/src/lib/libmisc/Makefile.in c/src/lib/libmisc/README c/src/lib/libmisc/assoc/Makefile.in c/src/lib/libmisc/assoc/assoc.c c/src/lib/libmisc/assoc/assoc.h c/src/lib/libmisc/cpuuse/Makefile.in c/src/lib/libmisc/cpuuse/README c/src/lib/libmisc/cpuuse/cpuuse.c c/src/lib/libmisc/cpuuse/cpuuse.h c/src/lib/libmisc/cpuuse/internal.h c/src/lib/libmisc/error/Makefile.in c/src/lib/libmisc/error/error.c c/src/lib/libmisc/error/error.h c/src/lib/libmisc/monitor/Makefile.in c/src/lib/libmisc/monitor/README c/src/lib/libmisc/monitor/mon-command.c c/src/lib/libmisc/monitor/mon-config.c c/src/lib/libmisc/monitor/mon-dname.c c/src/lib/libmisc/monitor/mon-driver.c c/src/lib/libmisc/monitor/mon-extension.c c/src/lib/libmisc/monitor/mon-itask.c c/src/lib/libmisc/monitor/mon-manager.c c/src/lib/libmisc/monitor/mon-monitor.c c/src/lib/libmisc/monitor/mon-mpci.c c/src/lib/libmisc/monitor/mon-object.c c/src/lib/libmisc/monitor/mon-prmisc.c c/src/lib/libmisc/monitor/mon-queue.c c/src/lib/libmisc/monitor/mon-server.c c/src/lib/libmisc/monitor/mon-symbols.c c/src/lib/libmisc/monitor/mon-task.c c/src/lib/libmisc/monitor/monitor.h c/src/lib/libmisc/monitor/symbols.h c/src/lib/libmisc/rtmonuse/Makefile.in c/src/lib/libmisc/rtmonuse/rtmonuse.c c/src/lib/libmisc/rtmonuse/rtmonuse.h c/src/lib/libmisc/stackchk/Makefile.in c/src/lib/libmisc/stackchk/README c/src/lib/libmisc/stackchk/check.c c/src/lib/libmisc/stackchk/internal.h c/src/lib/libmisc/stackchk/stackchk.h c/src/lib/libmisc/wrapup/Makefile.in c/src/lib/libnetworking/CHANGELOG c/src/lib/libnetworking/Makefile.in c/src/lib/libnetworking/README c/src/lib/libnetworking/arpa/ftp.h c/src/lib/libnetworking/arpa/inet.h c/src/lib/libnetworking/arpa/nameser.h c/src/lib/libnetworking/arpa/nameser_compat.h c/src/lib/libnetworking/arpa/telnet.h c/src/lib/libnetworking/bpfilter.h c/src/lib/libnetworking/include/Makefile.in c/src/lib/libnetworking/kern/Makefile.in c/src/lib/libnetworking/kern/kern_subr.c c/src/lib/libnetworking/kern/uipc_domain.c c/src/lib/libnetworking/kern/uipc_mbuf.c c/src/lib/libnetworking/kern/uipc_socket.c c/src/lib/libnetworking/kern/uipc_socket2.c c/src/lib/libnetworking/lib/Makefile.in c/src/lib/libnetworking/lib/README c/src/lib/libnetworking/lib/getprotoby.c c/src/lib/libnetworking/lib/syslog.c c/src/lib/libnetworking/lib/tftpDriver.c c/src/lib/libnetworking/libc/Makefile.in c/src/lib/libnetworking/libc/addr2ascii.3 c/src/lib/libnetworking/libc/addr2ascii.c c/src/lib/libnetworking/libc/ascii2addr.c c/src/lib/libnetworking/libc/base64.c c/src/lib/libnetworking/libc/byteorder.3 c/src/lib/libnetworking/libc/ether_addr.c c/src/lib/libnetworking/libc/ethers.3 c/src/lib/libnetworking/libc/gethostbydns.c c/src/lib/libnetworking/libc/gethostbyht.c c/src/lib/libnetworking/libc/gethostbyname.3 c/src/lib/libnetworking/libc/gethostbynis.c c/src/lib/libnetworking/libc/gethostnamadr.c c/src/lib/libnetworking/libc/gethostname.c c/src/lib/libnetworking/libc/getnetbydns.c c/src/lib/libnetworking/libc/getnetbyht.c c/src/lib/libnetworking/libc/getnetbynis.c c/src/lib/libnetworking/libc/getnetent.3 c/src/lib/libnetworking/libc/getnetnamadr.c c/src/lib/libnetworking/libc/getproto.c c/src/lib/libnetworking/libc/getprotoent.3 c/src/lib/libnetworking/libc/getprotoent.c c/src/lib/libnetworking/libc/getprotoname.c c/src/lib/libnetworking/libc/getservbyname.c c/src/lib/libnetworking/libc/getservbyport.c c/src/lib/libnetworking/libc/getservent.3 c/src/lib/libnetworking/libc/getservent.c c/src/lib/libnetworking/libc/herror.c c/src/lib/libnetworking/libc/inet.3 c/src/lib/libnetworking/libc/inet_addr.c c/src/lib/libnetworking/libc/inet_lnaof.c c/src/lib/libnetworking/libc/inet_makeaddr.c c/src/lib/libnetworking/libc/inet_net_ntop.c c/src/lib/libnetworking/libc/inet_net_pton.c c/src/lib/libnetworking/libc/inet_neta.c c/src/lib/libnetworking/libc/inet_netof.c c/src/lib/libnetworking/libc/inet_network.c c/src/lib/libnetworking/libc/inet_ntoa.c c/src/lib/libnetworking/libc/inet_ntop.c c/src/lib/libnetworking/libc/inet_pton.c c/src/lib/libnetworking/libc/iso_addr.3 c/src/lib/libnetworking/libc/iso_addr.c c/src/lib/libnetworking/libc/linkaddr.3 c/src/lib/libnetworking/libc/linkaddr.c c/src/lib/libnetworking/libc/map_v4v6.c c/src/lib/libnetworking/libc/ns.3 c/src/lib/libnetworking/libc/ns_addr.c c/src/lib/libnetworking/libc/ns_name.c c/src/lib/libnetworking/libc/ns_netint.c c/src/lib/libnetworking/libc/ns_ntoa.c c/src/lib/libnetworking/libc/ns_parse.c c/src/lib/libnetworking/libc/ns_print.c c/src/lib/libnetworking/libc/ns_ttl.c c/src/lib/libnetworking/libc/nsap_addr.c c/src/lib/libnetworking/libc/rcmd.3 c/src/lib/libnetworking/libc/rcmd.c c/src/lib/libnetworking/libc/recv.c c/src/lib/libnetworking/libc/res_comp.c c/src/lib/libnetworking/libc/res_config.h c/src/lib/libnetworking/libc/res_data.c c/src/lib/libnetworking/libc/res_debug.c c/src/lib/libnetworking/libc/res_init.c c/src/lib/libnetworking/libc/res_mkquery.c c/src/lib/libnetworking/libc/res_mkupdate.c c/src/lib/libnetworking/libc/res_query.c c/src/lib/libnetworking/libc/res_send.c c/src/lib/libnetworking/libc/res_stubs.c c/src/lib/libnetworking/libc/res_update.c c/src/lib/libnetworking/libc/resolver.3 c/src/lib/libnetworking/libc/send.c c/src/lib/libnetworking/libc/strsep.c c/src/lib/libnetworking/loop.h c/src/lib/libnetworking/machine/conf.h c/src/lib/libnetworking/machine/cpu.h c/src/lib/libnetworking/machine/cpufunc.h c/src/lib/libnetworking/machine/endian.h c/src/lib/libnetworking/machine/in_cksum.h c/src/lib/libnetworking/machine/limits.h c/src/lib/libnetworking/machine/param.h c/src/lib/libnetworking/machine/types.h c/src/lib/libnetworking/machine/vmparam.h c/src/lib/libnetworking/net/Makefile.in c/src/lib/libnetworking/net/bpf.h c/src/lib/libnetworking/net/ethernet.h c/src/lib/libnetworking/net/if.c c/src/lib/libnetworking/net/if.h c/src/lib/libnetworking/net/if_arp.h c/src/lib/libnetworking/net/if_dl.h c/src/lib/libnetworking/net/if_ethersubr.c c/src/lib/libnetworking/net/if_llc.h c/src/lib/libnetworking/net/if_loop.c c/src/lib/libnetworking/net/if_types.h c/src/lib/libnetworking/net/netisr.h c/src/lib/libnetworking/net/radix.c c/src/lib/libnetworking/net/radix.h c/src/lib/libnetworking/net/raw_cb.c c/src/lib/libnetworking/net/raw_cb.h c/src/lib/libnetworking/net/raw_usrreq.c c/src/lib/libnetworking/net/route.c c/src/lib/libnetworking/net/route.h c/src/lib/libnetworking/net/rtsock.c c/src/lib/libnetworking/netdb.h c/src/lib/libnetworking/netinet/Makefile.in c/src/lib/libnetworking/netinet/icmp_var.h c/src/lib/libnetworking/netinet/if_ether.c c/src/lib/libnetworking/netinet/if_ether.h c/src/lib/libnetworking/netinet/igmp.c c/src/lib/libnetworking/netinet/igmp.h c/src/lib/libnetworking/netinet/igmp_var.h c/src/lib/libnetworking/netinet/in.c c/src/lib/libnetworking/netinet/in.h c/src/lib/libnetworking/netinet/in_cksum.c c/src/lib/libnetworking/netinet/in_cksum_i386.c c/src/lib/libnetworking/netinet/in_cksum_m68k.c c/src/lib/libnetworking/netinet/in_pcb.c c/src/lib/libnetworking/netinet/in_pcb.h c/src/lib/libnetworking/netinet/in_proto.c c/src/lib/libnetworking/netinet/in_rmx.c c/src/lib/libnetworking/netinet/in_systm.h c/src/lib/libnetworking/netinet/in_var.h c/src/lib/libnetworking/netinet/ip.h c/src/lib/libnetworking/netinet/ip_divert.c c/src/lib/libnetworking/netinet/ip_fw.c c/src/lib/libnetworking/netinet/ip_fw.h c/src/lib/libnetworking/netinet/ip_icmp.c c/src/lib/libnetworking/netinet/ip_icmp.h c/src/lib/libnetworking/netinet/ip_input.c c/src/lib/libnetworking/netinet/ip_mroute.c c/src/lib/libnetworking/netinet/ip_mroute.h c/src/lib/libnetworking/netinet/ip_output.c c/src/lib/libnetworking/netinet/ip_var.h c/src/lib/libnetworking/netinet/raw_ip.c c/src/lib/libnetworking/netinet/tcp.h c/src/lib/libnetworking/netinet/tcp_debug.c c/src/lib/libnetworking/netinet/tcp_debug.h c/src/lib/libnetworking/netinet/tcp_fsm.h c/src/lib/libnetworking/netinet/tcp_input.c c/src/lib/libnetworking/netinet/tcp_output.c c/src/lib/libnetworking/netinet/tcp_seq.h c/src/lib/libnetworking/netinet/tcp_subr.c c/src/lib/libnetworking/netinet/tcp_timer.c c/src/lib/libnetworking/netinet/tcp_timer.h c/src/lib/libnetworking/netinet/tcp_usrreq.c c/src/lib/libnetworking/netinet/tcp_var.h c/src/lib/libnetworking/netinet/tcpip.h c/src/lib/libnetworking/netinet/udp.h c/src/lib/libnetworking/netinet/udp_usrreq.c c/src/lib/libnetworking/netinet/udp_var.h c/src/lib/libnetworking/nfs/Makefile.in c/src/lib/libnetworking/nfs/bootp_subr.c c/src/lib/libnetworking/nfs/krpc.h c/src/lib/libnetworking/nfs/nfs.h c/src/lib/libnetworking/nfs/nfsdiskless.h c/src/lib/libnetworking/nfs/nfsproto.h c/src/lib/libnetworking/nfs/rpcv2.h c/src/lib/libnetworking/nfs/xdr_subs.h c/src/lib/libnetworking/opt_ipfw.h c/src/lib/libnetworking/opt_mrouting.h c/src/lib/libnetworking/opt_tcpdebug.h c/src/lib/libnetworking/poll.h c/src/lib/libnetworking/resolv.h c/src/lib/libnetworking/rtems/Makefile.in c/src/lib/libnetworking/rtems/issetugid.c c/src/lib/libnetworking/rtems/rtems_bootp.c c/src/lib/libnetworking/rtems/rtems_bsdnet.h c/src/lib/libnetworking/rtems/rtems_bsdnet_internal.h c/src/lib/libnetworking/rtems/rtems_glue.c c/src/lib/libnetworking/rtems/rtems_showicmpstat.c c/src/lib/libnetworking/rtems/rtems_showifstat.c c/src/lib/libnetworking/rtems/rtems_showipstat.c c/src/lib/libnetworking/rtems/rtems_showmbuf.c c/src/lib/libnetworking/rtems/rtems_showroute.c c/src/lib/libnetworking/rtems/rtems_showtcpstat.c c/src/lib/libnetworking/rtems/rtems_showudpstat.c c/src/lib/libnetworking/rtems/rtems_syscall.c c/src/lib/libnetworking/rtems/sghostname.c c/src/lib/libnetworking/rtems/tftp.h c/src/lib/libnetworking/sys/buf.h c/src/lib/libnetworking/sys/callout.h c/src/lib/libnetworking/sys/cdefs.h c/src/lib/libnetworking/sys/conf.h c/src/lib/libnetworking/sys/domain.h c/src/lib/libnetworking/sys/filio.h c/src/lib/libnetworking/sys/ioccom.h c/src/lib/libnetworking/sys/ioctl.h c/src/lib/libnetworking/sys/kernel.h c/src/lib/libnetworking/sys/libkern.h c/src/lib/libnetworking/sys/malloc.h c/src/lib/libnetworking/sys/mbuf.h c/src/lib/libnetworking/sys/mount.h c/src/lib/libnetworking/sys/param.h c/src/lib/libnetworking/sys/proc.h c/src/lib/libnetworking/sys/protosw.h c/src/lib/libnetworking/sys/queue.h c/src/lib/libnetworking/sys/reboot.h c/src/lib/libnetworking/sys/resourcevar.h c/src/lib/libnetworking/sys/rtprio.h c/src/lib/libnetworking/sys/select.h c/src/lib/libnetworking/sys/signalvar.h c/src/lib/libnetworking/sys/socket.h c/src/lib/libnetworking/sys/socketvar.h c/src/lib/libnetworking/sys/sockio.h c/src/lib/libnetworking/sys/sysctl.h c/src/lib/libnetworking/sys/syslimits.h c/src/lib/libnetworking/sys/syslog.h c/src/lib/libnetworking/sys/systm.h c/src/lib/libnetworking/sys/ttycom.h c/src/lib/libnetworking/sys/ttydefaults.h c/src/lib/libnetworking/sys/ucred.h c/src/lib/libnetworking/sys/uio.h c/src/lib/libnetworking/syslog.h c/src/lib/libnetworking/vm/vm.h c/src/lib/libnetworking/vm/vm_extern.h c/src/lib/libnetworking/vm/vm_kern.h c/src/lib/libnetworking/vm/vm_param.h c/src/lib/libnetworking/wrapup/Makefile.in c/src/lib/librtems++/Makefile.in c/src/lib/librtems++/README c/src/lib/librtems++/rtemsEvent.cc c/src/lib/librtems++/rtemsInterrupt.cc c/src/lib/librtems++/rtemsMessageQueue.cc c/src/lib/librtems++/rtemsSemaphore.cc c/src/lib/librtems++/rtemsStatusCode.cc c/src/lib/librtems++/rtemsTask.cc c/src/lib/librtems++/rtemsTimer.cc c/src/lib/start/Makefile.in c/src/lib/start/README c/src/lib/start/a29k/Makefile.in c/src/lib/start/a29k/amd.ah c/src/lib/start/a29k/crt0.s c/src/lib/start/a29k/pswmacro.ah c/src/lib/start/a29k/register.ah c/src/lib/start/a29k/register.s c/src/lib/start/i960/Makefile.in c/src/lib/start/i960/start.s c/src/lib/start/m68k/Makefile.in c/src/lib/start/m68k/start.s c/src/lib/start/mips64orion/Makefile.in c/src/lib/start/mips64orion/idt_csu.S c/src/lib/start/sh/Makefile.in c/src/lib/start/sh/start.s c/src/lib/wrapup/Makefile.in c/src/libchip/rtc/Makefile.in c/src/libchip/rtc/README.ds1643 c/src/libchip/rtc/README.icm7170 c/src/libchip/rtc/README.m48t08 c/src/libchip/rtc/README.m48t18 c/src/libchip/rtc/STATUS c/src/libchip/rtc/icm7170.c c/src/libchip/rtc/icm7170.h c/src/libchip/rtc/icm7170_reg.c c/src/libchip/rtc/icm7170_reg2.c c/src/libchip/rtc/icm7170_reg4.c c/src/libchip/rtc/icm7170_reg8.c c/src/libchip/rtc/m48t08.c c/src/libchip/rtc/m48t08.h c/src/libchip/rtc/m48t08_reg.c c/src/libchip/rtc/m48t08_reg2.c c/src/libchip/rtc/m48t08_reg4.c c/src/libchip/rtc/m48t08_reg8.c c/src/libchip/rtc/rtc.h c/src/libchip/rtc/rtcprobe.c c/src/libchip/serial/Makefile.in c/src/libchip/serial/README c/src/libchip/serial/README.mc68681 c/src/libchip/serial/README.ns16550 c/src/libchip/serial/README.xr88681 c/src/libchip/serial/README.z85c30 c/src/libchip/serial/STATUS c/src/libchip/serial/mc68681.c c/src/libchip/serial/mc68681.h c/src/libchip/serial/mc68681_baud.c c/src/libchip/serial/mc68681_p.h c/src/libchip/serial/mc68681_reg.c c/src/libchip/serial/mc68681_reg2.c c/src/libchip/serial/mc68681_reg4.c c/src/libchip/serial/mc68681_reg8.c c/src/libchip/serial/ns16550.c c/src/libchip/serial/ns16550.h c/src/libchip/serial/ns16550_p.h c/src/libchip/serial/serial.h c/src/libchip/serial/serprobe.c c/src/libchip/serial/sersupp.h c/src/libchip/serial/termios_baud2index.c c/src/libchip/serial/termios_baud2num.c c/src/libchip/serial/z85c30.c c/src/libchip/serial/z85c30.h c/src/libchip/serial/z85c30_p.h c/src/libchip/serial/z85c30_reg.c 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 c/src/libmisc/README c/src/libmisc/assoc/Makefile.in c/src/libmisc/assoc/assoc.c c/src/libmisc/assoc/assoc.h c/src/libmisc/cpuuse/Makefile.in c/src/libmisc/cpuuse/README c/src/libmisc/cpuuse/cpuuse.c c/src/libmisc/cpuuse/cpuuse.h c/src/libmisc/cpuuse/internal.h c/src/libmisc/error/Makefile.in c/src/libmisc/error/error.c c/src/libmisc/error/error.h c/src/libmisc/monitor/Makefile.in c/src/libmisc/monitor/README c/src/libmisc/monitor/mon-command.c c/src/libmisc/monitor/mon-config.c c/src/libmisc/monitor/mon-dname.c c/src/libmisc/monitor/mon-driver.c c/src/libmisc/monitor/mon-extension.c c/src/libmisc/monitor/mon-itask.c c/src/libmisc/monitor/mon-manager.c c/src/libmisc/monitor/mon-monitor.c c/src/libmisc/monitor/mon-mpci.c c/src/libmisc/monitor/mon-object.c c/src/libmisc/monitor/mon-prmisc.c c/src/libmisc/monitor/mon-queue.c c/src/libmisc/monitor/mon-server.c c/src/libmisc/monitor/mon-symbols.c c/src/libmisc/monitor/mon-task.c c/src/libmisc/monitor/monitor.h c/src/libmisc/monitor/symbols.h c/src/libmisc/rtmonuse/Makefile.in c/src/libmisc/rtmonuse/rtmonuse.c c/src/libmisc/rtmonuse/rtmonuse.h c/src/libmisc/stackchk/Makefile.in c/src/libmisc/stackchk/README c/src/libmisc/stackchk/check.c c/src/libmisc/stackchk/internal.h c/src/libmisc/stackchk/stackchk.h c/src/libmisc/wrapup/Makefile.in c/src/libnetworking/CHANGELOG c/src/libnetworking/Makefile.in c/src/libnetworking/README c/src/libnetworking/arpa/ftp.h c/src/libnetworking/arpa/inet.h c/src/libnetworking/arpa/nameser.h c/src/libnetworking/arpa/nameser_compat.h c/src/libnetworking/arpa/telnet.h c/src/libnetworking/bpfilter.h c/src/libnetworking/include/Makefile.in c/src/libnetworking/kern/Makefile.in c/src/libnetworking/kern/kern_subr.c c/src/libnetworking/kern/uipc_domain.c c/src/libnetworking/kern/uipc_mbuf.c c/src/libnetworking/kern/uipc_socket.c c/src/libnetworking/kern/uipc_socket2.c c/src/libnetworking/lib/Makefile.in c/src/libnetworking/lib/README c/src/libnetworking/lib/getprotoby.c c/src/libnetworking/lib/syslog.c c/src/libnetworking/lib/tftpDriver.c c/src/libnetworking/libc/Makefile.in c/src/libnetworking/libc/addr2ascii.3 c/src/libnetworking/libc/addr2ascii.c c/src/libnetworking/libc/ascii2addr.c c/src/libnetworking/libc/base64.c c/src/libnetworking/libc/byteorder.3 c/src/libnetworking/libc/ether_addr.c c/src/libnetworking/libc/ethers.3 c/src/libnetworking/libc/gethostbydns.c c/src/libnetworking/libc/gethostbyht.c c/src/libnetworking/libc/gethostbyname.3 c/src/libnetworking/libc/gethostbynis.c c/src/libnetworking/libc/gethostnamadr.c c/src/libnetworking/libc/gethostname.c c/src/libnetworking/libc/getnetbydns.c c/src/libnetworking/libc/getnetbyht.c c/src/libnetworking/libc/getnetbynis.c c/src/libnetworking/libc/getnetent.3 c/src/libnetworking/libc/getnetnamadr.c c/src/libnetworking/libc/getproto.c c/src/libnetworking/libc/getprotoent.3 c/src/libnetworking/libc/getprotoent.c c/src/libnetworking/libc/getprotoname.c c/src/libnetworking/libc/getservbyname.c c/src/libnetworking/libc/getservbyport.c c/src/libnetworking/libc/getservent.3 c/src/libnetworking/libc/getservent.c c/src/libnetworking/libc/herror.c c/src/libnetworking/libc/inet.3 c/src/libnetworking/libc/inet_addr.c c/src/libnetworking/libc/inet_lnaof.c c/src/libnetworking/libc/inet_makeaddr.c c/src/libnetworking/libc/inet_net_ntop.c c/src/libnetworking/libc/inet_net_pton.c c/src/libnetworking/libc/inet_neta.c c/src/libnetworking/libc/inet_netof.c c/src/libnetworking/libc/inet_network.c c/src/libnetworking/libc/inet_ntoa.c c/src/libnetworking/libc/inet_ntop.c c/src/libnetworking/libc/inet_pton.c c/src/libnetworking/libc/iso_addr.3 c/src/libnetworking/libc/iso_addr.c c/src/libnetworking/libc/linkaddr.3 c/src/libnetworking/libc/linkaddr.c c/src/libnetworking/libc/map_v4v6.c c/src/libnetworking/libc/ns.3 c/src/libnetworking/libc/ns_addr.c c/src/libnetworking/libc/ns_name.c c/src/libnetworking/libc/ns_netint.c c/src/libnetworking/libc/ns_ntoa.c c/src/libnetworking/libc/ns_parse.c c/src/libnetworking/libc/ns_print.c c/src/libnetworking/libc/ns_ttl.c c/src/libnetworking/libc/nsap_addr.c c/src/libnetworking/libc/rcmd.3 c/src/libnetworking/libc/rcmd.c c/src/libnetworking/libc/recv.c c/src/libnetworking/libc/res_comp.c c/src/libnetworking/libc/res_config.h c/src/libnetworking/libc/res_data.c c/src/libnetworking/libc/res_debug.c c/src/libnetworking/libc/res_init.c c/src/libnetworking/libc/res_mkquery.c c/src/libnetworking/libc/res_mkupdate.c c/src/libnetworking/libc/res_query.c c/src/libnetworking/libc/res_send.c c/src/libnetworking/libc/res_stubs.c c/src/libnetworking/libc/res_update.c c/src/libnetworking/libc/resolver.3 c/src/libnetworking/libc/send.c c/src/libnetworking/libc/strsep.c c/src/libnetworking/loop.h c/src/libnetworking/machine/conf.h c/src/libnetworking/machine/cpu.h c/src/libnetworking/machine/cpufunc.h c/src/libnetworking/machine/endian.h c/src/libnetworking/machine/in_cksum.h c/src/libnetworking/machine/limits.h c/src/libnetworking/machine/param.h c/src/libnetworking/machine/types.h c/src/libnetworking/machine/vmparam.h c/src/libnetworking/net/Makefile.in c/src/libnetworking/net/bpf.h c/src/libnetworking/net/ethernet.h c/src/libnetworking/net/if.c c/src/libnetworking/net/if.h c/src/libnetworking/net/if_arp.h c/src/libnetworking/net/if_dl.h c/src/libnetworking/net/if_ethersubr.c c/src/libnetworking/net/if_llc.h c/src/libnetworking/net/if_loop.c c/src/libnetworking/net/if_types.h c/src/libnetworking/net/netisr.h c/src/libnetworking/net/radix.c c/src/libnetworking/net/radix.h c/src/libnetworking/net/raw_cb.c c/src/libnetworking/net/raw_cb.h c/src/libnetworking/net/raw_usrreq.c c/src/libnetworking/net/route.c c/src/libnetworking/net/route.h c/src/libnetworking/net/rtsock.c c/src/libnetworking/netdb.h c/src/libnetworking/netinet/Makefile.in c/src/libnetworking/netinet/icmp_var.h c/src/libnetworking/netinet/if_ether.c c/src/libnetworking/netinet/if_ether.h c/src/libnetworking/netinet/igmp.c c/src/libnetworking/netinet/igmp.h c/src/libnetworking/netinet/igmp_var.h c/src/libnetworking/netinet/in.c c/src/libnetworking/netinet/in.h c/src/libnetworking/netinet/in_cksum.c c/src/libnetworking/netinet/in_cksum_i386.c c/src/libnetworking/netinet/in_cksum_m68k.c c/src/libnetworking/netinet/in_pcb.c c/src/libnetworking/netinet/in_pcb.h c/src/libnetworking/netinet/in_proto.c c/src/libnetworking/netinet/in_rmx.c c/src/libnetworking/netinet/in_systm.h c/src/libnetworking/netinet/in_var.h c/src/libnetworking/netinet/ip.h c/src/libnetworking/netinet/ip_divert.c c/src/libnetworking/netinet/ip_fw.c c/src/libnetworking/netinet/ip_fw.h c/src/libnetworking/netinet/ip_icmp.c c/src/libnetworking/netinet/ip_icmp.h c/src/libnetworking/netinet/ip_input.c c/src/libnetworking/netinet/ip_mroute.c c/src/libnetworking/netinet/ip_mroute.h c/src/libnetworking/netinet/ip_output.c c/src/libnetworking/netinet/ip_var.h c/src/libnetworking/netinet/raw_ip.c c/src/libnetworking/netinet/tcp.h c/src/libnetworking/netinet/tcp_debug.c c/src/libnetworking/netinet/tcp_debug.h c/src/libnetworking/netinet/tcp_fsm.h c/src/libnetworking/netinet/tcp_input.c c/src/libnetworking/netinet/tcp_output.c c/src/libnetworking/netinet/tcp_seq.h c/src/libnetworking/netinet/tcp_subr.c c/src/libnetworking/netinet/tcp_timer.c c/src/libnetworking/netinet/tcp_timer.h c/src/libnetworking/netinet/tcp_usrreq.c c/src/libnetworking/netinet/tcp_var.h c/src/libnetworking/netinet/tcpip.h c/src/libnetworking/netinet/udp.h c/src/libnetworking/netinet/udp_usrreq.c c/src/libnetworking/netinet/udp_var.h c/src/libnetworking/nfs/Makefile.in c/src/libnetworking/nfs/bootp_subr.c c/src/libnetworking/nfs/krpc.h c/src/libnetworking/nfs/nfs.h c/src/libnetworking/nfs/nfsdiskless.h c/src/libnetworking/nfs/nfsproto.h c/src/libnetworking/nfs/rpcv2.h c/src/libnetworking/nfs/xdr_subs.h c/src/libnetworking/opt_ipfw.h c/src/libnetworking/opt_mrouting.h c/src/libnetworking/opt_tcpdebug.h c/src/libnetworking/poll.h c/src/libnetworking/resolv.h c/src/libnetworking/rtems/Makefile.in c/src/libnetworking/rtems/issetugid.c c/src/libnetworking/rtems/rtems_bootp.c c/src/libnetworking/rtems/rtems_bsdnet.h c/src/libnetworking/rtems/rtems_bsdnet_internal.h c/src/libnetworking/rtems/rtems_glue.c c/src/libnetworking/rtems/rtems_showicmpstat.c c/src/libnetworking/rtems/rtems_showifstat.c c/src/libnetworking/rtems/rtems_showipstat.c c/src/libnetworking/rtems/rtems_showmbuf.c c/src/libnetworking/rtems/rtems_showroute.c c/src/libnetworking/rtems/rtems_showtcpstat.c c/src/libnetworking/rtems/rtems_showudpstat.c c/src/libnetworking/rtems/rtems_syscall.c c/src/libnetworking/rtems/sghostname.c c/src/libnetworking/rtems/tftp.h c/src/libnetworking/sys/buf.h c/src/libnetworking/sys/callout.h c/src/libnetworking/sys/cdefs.h c/src/libnetworking/sys/conf.h c/src/libnetworking/sys/domain.h c/src/libnetworking/sys/filio.h c/src/libnetworking/sys/ioccom.h c/src/libnetworking/sys/ioctl.h c/src/libnetworking/sys/kernel.h c/src/libnetworking/sys/libkern.h c/src/libnetworking/sys/malloc.h c/src/libnetworking/sys/mbuf.h c/src/libnetworking/sys/mount.h c/src/libnetworking/sys/param.h c/src/libnetworking/sys/proc.h c/src/libnetworking/sys/protosw.h c/src/libnetworking/sys/queue.h c/src/libnetworking/sys/reboot.h c/src/libnetworking/sys/resourcevar.h c/src/libnetworking/sys/rtprio.h c/src/libnetworking/sys/select.h c/src/libnetworking/sys/signalvar.h c/src/libnetworking/sys/socket.h c/src/libnetworking/sys/socketvar.h c/src/libnetworking/sys/sockio.h c/src/libnetworking/sys/sysctl.h c/src/libnetworking/sys/syslimits.h c/src/libnetworking/sys/syslog.h c/src/libnetworking/sys/systm.h c/src/libnetworking/sys/ttycom.h c/src/libnetworking/sys/ttydefaults.h c/src/libnetworking/sys/ucred.h c/src/libnetworking/sys/uio.h c/src/libnetworking/syslog.h c/src/libnetworking/vm/vm.h c/src/libnetworking/vm/vm_extern.h c/src/libnetworking/vm/vm_kern.h c/src/libnetworking/vm/vm_param.h c/src/libnetworking/wrapup/Makefile.in c/src/librtems++/README c/src/librtems++/include/rtems++/rtemsEvent.h c/src/librtems++/include/rtems++/rtemsInterrupt.h c/src/librtems++/include/rtems++/rtemsMessageQueue.h c/src/librtems++/include/rtems++/rtemsSemaphore.h c/src/librtems++/include/rtems++/rtemsStatusCode.h c/src/librtems++/include/rtems++/rtemsTask.h c/src/librtems++/include/rtems++/rtemsTaskMode.h c/src/librtems++/include/rtems++/rtemsTimer.h c/src/librtems++/src/Makefile.in c/src/librtems++/src/rtemsEvent.cc c/src/librtems++/src/rtemsInterrupt.cc c/src/librtems++/src/rtemsMessageQueue.cc c/src/librtems++/src/rtemsSemaphore.cc c/src/librtems++/src/rtemsStatusCode.cc c/src/librtems++/src/rtemsTask.cc c/src/librtems++/src/rtemsTimer.cc c/src/make/README c/src/make/compilers/gcc-target-default.cfg c/src/make/directory.cfg c/src/make/host.cfg.in c/src/make/lib.cfg c/src/optman/rtems/no-dpmem.c c/src/optman/rtems/no-event.c c/src/optman/rtems/no-mp.c c/src/optman/rtems/no-msg.c c/src/optman/rtems/no-part.c c/src/optman/rtems/no-region.c c/src/optman/rtems/no-rtmon.c c/src/optman/rtems/no-sem.c c/src/optman/rtems/no-signal.c c/src/optman/rtems/no-timer.c c/src/optman/sapi/no-ext.c c/src/optman/sapi/no-io.c c/src/tests/Makefile.in c/src/tests/PROBLEMS c/src/tests/README c/src/tests/libtests/Makefile.in c/src/tests/libtests/README c/src/tests/libtests/cpuuse/Makefile.in c/src/tests/libtests/cpuuse/cpuuse.scn c/src/tests/libtests/cpuuse/init.c c/src/tests/libtests/cpuuse/system.h c/src/tests/libtests/cpuuse/task1.c c/src/tests/libtests/cpuuse/task2.c c/src/tests/libtests/cpuuse/task3.c c/src/tests/libtests/cpuuse/tswitch.c c/src/tests/libtests/malloctest/Makefile.in c/src/tests/libtests/malloctest/init.c c/src/tests/libtests/malloctest/system.h c/src/tests/libtests/malloctest/task1.c c/src/tests/libtests/monitor/Makefile.in c/src/tests/libtests/monitor/init.c c/src/tests/libtests/monitor/system.h c/src/tests/libtests/rtems++/Init.cc c/src/tests/libtests/rtems++/Makefile.in c/src/tests/libtests/rtems++/System.h c/src/tests/libtests/rtems++/Task1.cc c/src/tests/libtests/rtems++/Task2.cc c/src/tests/libtests/rtems++/Task3.cc c/src/tests/libtests/rtems++/rtems++.doc c/src/tests/libtests/rtems++/rtems++.scn c/src/tests/libtests/rtmonuse/Makefile.in c/src/tests/libtests/rtmonuse/getall.c c/src/tests/libtests/rtmonuse/init.c c/src/tests/libtests/rtmonuse/rtmonuse.scn c/src/tests/libtests/rtmonuse/system.h c/src/tests/libtests/rtmonuse/task1.c c/src/tests/libtests/stackchk/Makefile.in c/src/tests/libtests/stackchk/blow.c c/src/tests/libtests/stackchk/init.c c/src/tests/libtests/stackchk/stackchk.scn c/src/tests/libtests/stackchk/system.h c/src/tests/libtests/stackchk/task1.c c/src/tests/libtests/termios/Makefile.in c/src/tests/libtests/termios/README c/src/tests/libtests/termios/init.c c/src/tests/mptests/Makefile.in c/src/tests/mptests/README c/src/tests/mptests/mp01/Makefile.in c/src/tests/mptests/mp01/init.c c/src/tests/mptests/mp01/node1/Makefile.in c/src/tests/mptests/mp01/node1/mp01.doc c/src/tests/mptests/mp01/node1/mp01.scn c/src/tests/mptests/mp01/node2/Makefile.in c/src/tests/mptests/mp01/node2/mp01.doc c/src/tests/mptests/mp01/node2/mp01.scn c/src/tests/mptests/mp01/system.h c/src/tests/mptests/mp01/task1.c c/src/tests/mptests/mp02/Makefile.in c/src/tests/mptests/mp02/init.c c/src/tests/mptests/mp02/node1/Makefile.in c/src/tests/mptests/mp02/node1/mp02.doc c/src/tests/mptests/mp02/node1/mp02.scn c/src/tests/mptests/mp02/node2/Makefile.in c/src/tests/mptests/mp02/node2/mp02.doc c/src/tests/mptests/mp02/node2/mp02.scn c/src/tests/mptests/mp02/system.h c/src/tests/mptests/mp02/task1.c c/src/tests/mptests/mp03/Makefile.in c/src/tests/mptests/mp03/delay.c c/src/tests/mptests/mp03/init.c c/src/tests/mptests/mp03/node1/Makefile.in c/src/tests/mptests/mp03/node1/mp03.doc c/src/tests/mptests/mp03/node1/mp03.scn c/src/tests/mptests/mp03/node2/Makefile.in c/src/tests/mptests/mp03/node2/mp03.doc c/src/tests/mptests/mp03/node2/mp03.scn c/src/tests/mptests/mp03/system.h c/src/tests/mptests/mp03/task1.c c/src/tests/mptests/mp04/Makefile.in c/src/tests/mptests/mp04/init.c c/src/tests/mptests/mp04/node1/Makefile.in c/src/tests/mptests/mp04/node1/mp04.doc c/src/tests/mptests/mp04/node1/mp04.scn c/src/tests/mptests/mp04/node2/Makefile.in c/src/tests/mptests/mp04/node2/mp04.doc c/src/tests/mptests/mp04/node2/mp04.scn c/src/tests/mptests/mp04/system.h c/src/tests/mptests/mp04/task1.c c/src/tests/mptests/mp05/Makefile.in c/src/tests/mptests/mp05/asr.c c/src/tests/mptests/mp05/init.c c/src/tests/mptests/mp05/node1/Makefile.in c/src/tests/mptests/mp05/node1/mp05.doc c/src/tests/mptests/mp05/node1/mp05.scn c/src/tests/mptests/mp05/node2/Makefile.in c/src/tests/mptests/mp05/node2/mp05.doc c/src/tests/mptests/mp05/node2/mp05.scn c/src/tests/mptests/mp05/system.h c/src/tests/mptests/mp05/task1.c c/src/tests/mptests/mp06/Makefile.in c/src/tests/mptests/mp06/init.c c/src/tests/mptests/mp06/node1/Makefile.in c/src/tests/mptests/mp06/node1/mp06.doc c/src/tests/mptests/mp06/node1/mp06.scn c/src/tests/mptests/mp06/node2/Makefile.in c/src/tests/mptests/mp06/node2/mp06.doc c/src/tests/mptests/mp06/node2/mp06.scn c/src/tests/mptests/mp06/system.h c/src/tests/mptests/mp06/task1.c c/src/tests/mptests/mp07/Makefile.in c/src/tests/mptests/mp07/init.c c/src/tests/mptests/mp07/node1/Makefile.in c/src/tests/mptests/mp07/node1/mp07.doc c/src/tests/mptests/mp07/node1/mp07.scn c/src/tests/mptests/mp07/node2/Makefile.in c/src/tests/mptests/mp07/node2/mp07.doc c/src/tests/mptests/mp07/node2/mp07.scn c/src/tests/mptests/mp07/system.h c/src/tests/mptests/mp07/task1.c c/src/tests/mptests/mp08/Makefile.in c/src/tests/mptests/mp08/init.c c/src/tests/mptests/mp08/node1/Makefile.in c/src/tests/mptests/mp08/node1/mp08.doc c/src/tests/mptests/mp08/node1/mp08.scn c/src/tests/mptests/mp08/node2/Makefile.in c/src/tests/mptests/mp08/node2/mp08.doc c/src/tests/mptests/mp08/node2/mp08.scn c/src/tests/mptests/mp08/system.h c/src/tests/mptests/mp08/task1.c c/src/tests/mptests/mp09/Makefile.in c/src/tests/mptests/mp09/init.c c/src/tests/mptests/mp09/node1/Makefile.in c/src/tests/mptests/mp09/node1/mp09.doc c/src/tests/mptests/mp09/node1/mp09.scn c/src/tests/mptests/mp09/node2/Makefile.in c/src/tests/mptests/mp09/node2/mp09.doc c/src/tests/mptests/mp09/node2/mp09.scn c/src/tests/mptests/mp09/recvmsg.c c/src/tests/mptests/mp09/sendmsg.c c/src/tests/mptests/mp09/system.h c/src/tests/mptests/mp09/task1.c c/src/tests/mptests/mp10/Makefile.in c/src/tests/mptests/mp10/init.c c/src/tests/mptests/mp10/node1/Makefile.in c/src/tests/mptests/mp10/node1/mp10.doc c/src/tests/mptests/mp10/node1/mp10.scn c/src/tests/mptests/mp10/node2/Makefile.in c/src/tests/mptests/mp10/node2/mp10.doc c/src/tests/mptests/mp10/node2/mp10.scn c/src/tests/mptests/mp10/system.h c/src/tests/mptests/mp10/task1.c c/src/tests/mptests/mp10/task2.c c/src/tests/mptests/mp10/task3.c c/src/tests/mptests/mp11/Makefile.in c/src/tests/mptests/mp11/init.c c/src/tests/mptests/mp11/node1/Makefile.in c/src/tests/mptests/mp11/node1/mp11.doc c/src/tests/mptests/mp11/node1/mp11.scn c/src/tests/mptests/mp11/node2/Makefile.in c/src/tests/mptests/mp11/node2/mp11.doc c/src/tests/mptests/mp11/node2/mp11.scn c/src/tests/mptests/mp11/system.h c/src/tests/mptests/mp12/Makefile.in c/src/tests/mptests/mp12/init.c c/src/tests/mptests/mp12/node1/Makefile.in c/src/tests/mptests/mp12/node1/mp12.doc c/src/tests/mptests/mp12/node1/mp12.scn c/src/tests/mptests/mp12/node2/Makefile.in c/src/tests/mptests/mp12/node2/mp12.doc c/src/tests/mptests/mp12/node2/mp12.scn c/src/tests/mptests/mp12/system.h c/src/tests/mptests/mp13/Makefile.in c/src/tests/mptests/mp13/init.c c/src/tests/mptests/mp13/node1/Makefile.in c/src/tests/mptests/mp13/node1/mp13.doc c/src/tests/mptests/mp13/node1/mp13.scn c/src/tests/mptests/mp13/node2/Makefile.in c/src/tests/mptests/mp13/node2/mp13.doc c/src/tests/mptests/mp13/node2/mp13.scn c/src/tests/mptests/mp13/system.h c/src/tests/mptests/mp13/task1.c c/src/tests/mptests/mp13/task2.c c/src/tests/mptests/mp14/Makefile.in c/src/tests/mptests/mp14/delay.c c/src/tests/mptests/mp14/evtask1.c c/src/tests/mptests/mp14/evtmtask.c c/src/tests/mptests/mp14/exit.c c/src/tests/mptests/mp14/init.c c/src/tests/mptests/mp14/msgtask1.c c/src/tests/mptests/mp14/node1/Makefile.in c/src/tests/mptests/mp14/node1/mp14.doc c/src/tests/mptests/mp14/node1/mp14.scn c/src/tests/mptests/mp14/node2/Makefile.in c/src/tests/mptests/mp14/node2/mp14.doc c/src/tests/mptests/mp14/node2/mp14.scn c/src/tests/mptests/mp14/pttask1.c c/src/tests/mptests/mp14/smtask1.c c/src/tests/mptests/mp14/system.h c/src/tests/psxtests/Makefile.in c/src/tests/psxtests/include/pmacros.h c/src/tests/psxtests/psx01/Makefile.in c/src/tests/psxtests/psx01/init.c c/src/tests/psxtests/psx01/psx01.scn c/src/tests/psxtests/psx01/system.h c/src/tests/psxtests/psx01/task.c c/src/tests/psxtests/psx02/Makefile.in c/src/tests/psxtests/psx02/init.c c/src/tests/psxtests/psx02/psx02.scn c/src/tests/psxtests/psx02/system.h c/src/tests/psxtests/psx02/task.c c/src/tests/psxtests/psx03/Makefile.in c/src/tests/psxtests/psx03/init.c c/src/tests/psxtests/psx03/psx03.scn c/src/tests/psxtests/psx03/system.h c/src/tests/psxtests/psx03/task.c c/src/tests/psxtests/psx04/Makefile.in c/src/tests/psxtests/psx04/init.c c/src/tests/psxtests/psx04/psx04.scn c/src/tests/psxtests/psx04/system.h c/src/tests/psxtests/psx04/task1.c c/src/tests/psxtests/psx04/task2.c c/src/tests/psxtests/psx04/task3.c c/src/tests/psxtests/psx05/Makefile.in c/src/tests/psxtests/psx05/init.c c/src/tests/psxtests/psx05/psx05.scn c/src/tests/psxtests/psx05/system.h c/src/tests/psxtests/psx05/task.c c/src/tests/psxtests/psx05/task2.c c/src/tests/psxtests/psx05/task3.c c/src/tests/psxtests/psx06/Makefile.in c/src/tests/psxtests/psx06/init.c c/src/tests/psxtests/psx06/psx06.scn c/src/tests/psxtests/psx06/system.h c/src/tests/psxtests/psx06/task.c c/src/tests/psxtests/psx06/task2.c c/src/tests/psxtests/psx07/Makefile.in c/src/tests/psxtests/psx07/init.c c/src/tests/psxtests/psx07/psx07.scn c/src/tests/psxtests/psx07/system.h c/src/tests/psxtests/psx07/task.c c/src/tests/psxtests/psx08/Makefile.in c/src/tests/psxtests/psx08/init.c c/src/tests/psxtests/psx08/psx08.scn c/src/tests/psxtests/psx08/system.h c/src/tests/psxtests/psx08/task.c c/src/tests/psxtests/psx08/task2.c c/src/tests/psxtests/psx09/Makefile.in c/src/tests/psxtests/psx09/init.c c/src/tests/psxtests/psx09/psx09.scn c/src/tests/psxtests/psx09/system.h c/src/tests/psxtests/psx10/Makefile.in c/src/tests/psxtests/psx10/init.c c/src/tests/psxtests/psx10/psx10.scn c/src/tests/psxtests/psx10/system.h c/src/tests/psxtests/psx10/task.c c/src/tests/psxtests/psx10/task2.c c/src/tests/psxtests/psx10/task3.c c/src/tests/psxtests/psx11/Makefile.in c/src/tests/psxtests/psx11/init.c c/src/tests/psxtests/psx11/psx11.scn c/src/tests/psxtests/psx11/system.h c/src/tests/psxtests/psx11/task.c c/src/tests/psxtests/psx12/Makefile.in c/src/tests/psxtests/psx12/init.c c/src/tests/psxtests/psx12/psx12.scn c/src/tests/psxtests/psx12/system.h c/src/tests/psxtests/psx12/task.c c/src/tests/psxtests/psxhdrs/Makefile.in c/src/tests/psxtests/psxhdrs/clock01.c c/src/tests/psxtests/psxhdrs/clock02.c c/src/tests/psxtests/psxhdrs/clock03.c c/src/tests/psxtests/psxhdrs/clock04.c c/src/tests/psxtests/psxhdrs/clock05.c c/src/tests/psxtests/psxhdrs/clock06.c c/src/tests/psxtests/psxhdrs/cond01.c c/src/tests/psxtests/psxhdrs/cond02.c c/src/tests/psxtests/psxhdrs/cond03.c c/src/tests/psxtests/psxhdrs/cond04.c c/src/tests/psxtests/psxhdrs/cond05.c c/src/tests/psxtests/psxhdrs/cond06.c c/src/tests/psxtests/psxhdrs/cond07.c c/src/tests/psxtests/psxhdrs/cond08.c c/src/tests/psxtests/psxhdrs/cond09.c c/src/tests/psxtests/psxhdrs/cond10.c c/src/tests/psxtests/psxhdrs/key01.c c/src/tests/psxtests/psxhdrs/key02.c c/src/tests/psxtests/psxhdrs/key03.c c/src/tests/psxtests/psxhdrs/key04.c c/src/tests/psxtests/psxhdrs/mutex01.c c/src/tests/psxtests/psxhdrs/mutex02.c c/src/tests/psxtests/psxhdrs/mutex03.c c/src/tests/psxtests/psxhdrs/mutex04.c c/src/tests/psxtests/psxhdrs/mutex05.c c/src/tests/psxtests/psxhdrs/mutex06.c c/src/tests/psxtests/psxhdrs/mutex07.c c/src/tests/psxtests/psxhdrs/mutex08.c c/src/tests/psxtests/psxhdrs/mutex09.c c/src/tests/psxtests/psxhdrs/mutex10.c c/src/tests/psxtests/psxhdrs/mutex11.c c/src/tests/psxtests/psxhdrs/mutex12.c c/src/tests/psxtests/psxhdrs/mutex13.c c/src/tests/psxtests/psxhdrs/mutex14.c c/src/tests/psxtests/psxhdrs/mutex15.c c/src/tests/psxtests/psxhdrs/mutex16.c c/src/tests/psxtests/psxhdrs/proc01.c c/src/tests/psxtests/psxhdrs/proc02.c c/src/tests/psxtests/psxhdrs/proc03.c c/src/tests/psxtests/psxhdrs/proc04.c c/src/tests/psxtests/psxhdrs/proc05.c c/src/tests/psxtests/psxhdrs/proc06.c c/src/tests/psxtests/psxhdrs/proc07.c c/src/tests/psxtests/psxhdrs/proc08.c c/src/tests/psxtests/psxhdrs/proc09.c c/src/tests/psxtests/psxhdrs/proc10.c c/src/tests/psxtests/psxhdrs/proc11.c c/src/tests/psxtests/psxhdrs/proc12.c c/src/tests/psxtests/psxhdrs/proc13.c c/src/tests/psxtests/psxhdrs/proc14.c c/src/tests/psxtests/psxhdrs/pthread01.c c/src/tests/psxtests/psxhdrs/pthread02.c c/src/tests/psxtests/psxhdrs/pthread03.c c/src/tests/psxtests/psxhdrs/pthread04.c c/src/tests/psxtests/psxhdrs/pthread05.c c/src/tests/psxtests/psxhdrs/pthread06.c c/src/tests/psxtests/psxhdrs/pthread07.c c/src/tests/psxtests/psxhdrs/pthread08.c c/src/tests/psxtests/psxhdrs/pthread09.c c/src/tests/psxtests/psxhdrs/pthread10.c c/src/tests/psxtests/psxhdrs/pthread11.c c/src/tests/psxtests/psxhdrs/pthread12.c c/src/tests/psxtests/psxhdrs/pthread13.c c/src/tests/psxtests/psxhdrs/pthread14.c c/src/tests/psxtests/psxhdrs/pthread15.c c/src/tests/psxtests/psxhdrs/pthread16.c c/src/tests/psxtests/psxhdrs/pthread17.c c/src/tests/psxtests/psxhdrs/pthread18.c c/src/tests/psxtests/psxhdrs/pthread19.c c/src/tests/psxtests/psxhdrs/pthread20.c c/src/tests/psxtests/psxhdrs/pthread21.c c/src/tests/psxtests/psxhdrs/pthread22.c c/src/tests/psxtests/psxhdrs/pthread23.c c/src/tests/psxtests/psxhdrs/pthread24.c c/src/tests/psxtests/psxhdrs/pthread25.c c/src/tests/psxtests/psxhdrs/pthread26.c c/src/tests/psxtests/psxhdrs/pthread27.c c/src/tests/psxtests/psxhdrs/pthread28.c c/src/tests/psxtests/psxhdrs/pthread29.c c/src/tests/psxtests/psxhdrs/pthread30.c c/src/tests/psxtests/psxhdrs/pthread31.c c/src/tests/psxtests/psxhdrs/pthread32.c c/src/tests/psxtests/psxhdrs/pthread33.c c/src/tests/psxtests/psxhdrs/pthread34.c c/src/tests/psxtests/psxhdrs/pthread35.c c/src/tests/psxtests/psxhdrs/pthread36.c c/src/tests/psxtests/psxhdrs/sched01.c c/src/tests/psxtests/psxhdrs/sched02.c c/src/tests/psxtests/psxhdrs/sched03.c c/src/tests/psxtests/psxhdrs/sched04.c c/src/tests/psxtests/psxhdrs/sched05.c c/src/tests/psxtests/psxhdrs/sched06.c c/src/tests/psxtests/psxhdrs/sched07.c c/src/tests/psxtests/psxhdrs/sched08.c c/src/tests/psxtests/psxhdrs/signal01.c c/src/tests/psxtests/psxhdrs/signal02.c c/src/tests/psxtests/psxhdrs/signal03.c c/src/tests/psxtests/psxhdrs/signal04.c c/src/tests/psxtests/psxhdrs/signal05.c c/src/tests/psxtests/psxhdrs/signal06.c c/src/tests/psxtests/psxhdrs/signal07.c c/src/tests/psxtests/psxhdrs/signal08.c c/src/tests/psxtests/psxhdrs/signal09.c c/src/tests/psxtests/psxhdrs/signal10.c c/src/tests/psxtests/psxhdrs/signal11.c c/src/tests/psxtests/psxhdrs/signal12.c c/src/tests/psxtests/psxhdrs/signal13.c c/src/tests/psxtests/psxhdrs/signal14.c c/src/tests/psxtests/psxhdrs/signal15.c c/src/tests/psxtests/psxhdrs/signal16.c c/src/tests/psxtests/psxhdrs/signal17.c c/src/tests/psxtests/psxhdrs/signal18.c c/src/tests/psxtests/psxhdrs/signal19.c c/src/tests/psxtests/psxhdrs/signal20.c c/src/tests/psxtests/psxhdrs/signal21.c c/src/tests/psxtests/psxhdrs/signal22.c c/src/tests/psxtests/psxhdrs/time01.c c/src/tests/psxtests/psxhdrs/time02.c c/src/tests/psxtests/psxhdrs/time03.c c/src/tests/psxtests/psxhdrs/time04.c c/src/tests/psxtests/psxhdrs/time05.c c/src/tests/psxtests/psxhdrs/time06.c c/src/tests/psxtests/psxhdrs/time07.c c/src/tests/psxtests/psxhdrs/time08.c c/src/tests/psxtests/psxhdrs/time09.c c/src/tests/psxtests/psxhdrs/time10.c c/src/tests/psxtests/psxhdrs/time11.c c/src/tests/psxtests/psxhdrs/time12.c c/src/tests/psxtests/psxhdrs/time13.c c/src/tests/psxtests/psxhdrs/timer01.c c/src/tests/psxtests/psxhdrs/timer02.c c/src/tests/psxtests/psxhdrs/timer03.c c/src/tests/psxtests/psxhdrs/timer04.c c/src/tests/psxtests/psxhdrs/timer05.c c/src/tests/psxtests/psxhdrs/timer06.c c/src/tests/psxtests/support/Makefile.in c/src/tests/psxtests/support/include/Makefile.in c/src/tests/psxtests/support/include/pmacros.h c/src/tests/samples/Makefile.in c/src/tests/samples/README c/src/tests/samples/base_mp/Makefile.in c/src/tests/samples/base_mp/apptask.c c/src/tests/samples/base_mp/init.c c/src/tests/samples/base_mp/node1/Makefile.in c/src/tests/samples/base_mp/node1/base_mp.doc c/src/tests/samples/base_mp/node1/base_mp.scn c/src/tests/samples/base_mp/node2/Makefile.in c/src/tests/samples/base_mp/node2/base_mp.doc c/src/tests/samples/base_mp/node2/base_mp.scn c/src/tests/samples/base_mp/system.h c/src/tests/samples/base_sp/Makefile.in c/src/tests/samples/base_sp/apptask.c c/src/tests/samples/base_sp/base_sp.doc c/src/tests/samples/base_sp/base_sp.scn c/src/tests/samples/base_sp/init.c c/src/tests/samples/base_sp/system.h c/src/tests/samples/cdtest/Makefile.in c/src/tests/samples/cdtest/cdtest.scn c/src/tests/samples/cdtest/init.c c/src/tests/samples/cdtest/main.cc c/src/tests/samples/cdtest/system.h c/src/tests/samples/hello/Makefile.in c/src/tests/samples/hello/hello.doc c/src/tests/samples/hello/hello.scn c/src/tests/samples/hello/init.c c/src/tests/samples/hello/system.h c/src/tests/samples/paranoia/Makefile.in c/src/tests/samples/paranoia/init.c c/src/tests/samples/paranoia/paranoia.c c/src/tests/samples/paranoia/paranoia.doc c/src/tests/samples/paranoia/system.h c/src/tests/samples/ticker/Makefile.in c/src/tests/samples/ticker/init.c c/src/tests/samples/ticker/system.h c/src/tests/samples/ticker/tasks.c c/src/tests/samples/ticker/ticker.doc c/src/tests/samples/ticker/ticker.scn c/src/tests/sptests/Makefile.in c/src/tests/sptests/README c/src/tests/sptests/sp01/Makefile.in c/src/tests/sptests/sp01/init.c c/src/tests/sptests/sp01/sp01.doc c/src/tests/sptests/sp01/sp01.scn c/src/tests/sptests/sp01/system.h c/src/tests/sptests/sp01/task1.c c/src/tests/sptests/sp02/Makefile.in c/src/tests/sptests/sp02/init.c c/src/tests/sptests/sp02/preempt.c c/src/tests/sptests/sp02/sp02.doc c/src/tests/sptests/sp02/sp02.scn c/src/tests/sptests/sp02/system.h c/src/tests/sptests/sp02/task1.c c/src/tests/sptests/sp02/task2.c c/src/tests/sptests/sp02/task3.c c/src/tests/sptests/sp03/Makefile.in c/src/tests/sptests/sp03/init.c c/src/tests/sptests/sp03/sp03.doc c/src/tests/sptests/sp03/sp03.scn c/src/tests/sptests/sp03/system.h c/src/tests/sptests/sp03/task1.c c/src/tests/sptests/sp03/task2.c c/src/tests/sptests/sp04/Makefile.in c/src/tests/sptests/sp04/init.c c/src/tests/sptests/sp04/sp04.doc c/src/tests/sptests/sp04/sp04.scn c/src/tests/sptests/sp04/system.h c/src/tests/sptests/sp04/task1.c c/src/tests/sptests/sp04/task2.c c/src/tests/sptests/sp04/task3.c c/src/tests/sptests/sp04/tswitch.c c/src/tests/sptests/sp05/Makefile.in c/src/tests/sptests/sp05/init.c c/src/tests/sptests/sp05/sp05.doc c/src/tests/sptests/sp05/sp05.scn c/src/tests/sptests/sp05/system.h c/src/tests/sptests/sp05/task1.c c/src/tests/sptests/sp05/task2.c c/src/tests/sptests/sp05/task3.c c/src/tests/sptests/sp06/Makefile.in c/src/tests/sptests/sp06/init.c c/src/tests/sptests/sp06/sp06.doc c/src/tests/sptests/sp06/sp06.scn c/src/tests/sptests/sp06/system.h c/src/tests/sptests/sp06/task1.c c/src/tests/sptests/sp06/task2.c c/src/tests/sptests/sp06/task3.c c/src/tests/sptests/sp07/Makefile.in c/src/tests/sptests/sp07/init.c c/src/tests/sptests/sp07/sp07.doc c/src/tests/sptests/sp07/sp07.scn c/src/tests/sptests/sp07/system.h c/src/tests/sptests/sp07/task1.c c/src/tests/sptests/sp07/task2.c c/src/tests/sptests/sp07/task3.c c/src/tests/sptests/sp07/task4.c c/src/tests/sptests/sp07/taskexit.c c/src/tests/sptests/sp07/tcreate.c c/src/tests/sptests/sp07/tdelete.c c/src/tests/sptests/sp07/trestart.c c/src/tests/sptests/sp07/tstart.c c/src/tests/sptests/sp08/Makefile.in c/src/tests/sptests/sp08/init.c c/src/tests/sptests/sp08/sp08.doc c/src/tests/sptests/sp08/sp08.scn c/src/tests/sptests/sp08/system.h c/src/tests/sptests/sp08/task1.c c/src/tests/sptests/sp09/Makefile.in c/src/tests/sptests/sp09/delay.c c/src/tests/sptests/sp09/init.c c/src/tests/sptests/sp09/isr.c c/src/tests/sptests/sp09/screen01.c c/src/tests/sptests/sp09/screen02.c c/src/tests/sptests/sp09/screen03.c c/src/tests/sptests/sp09/screen04.c c/src/tests/sptests/sp09/screen05.c c/src/tests/sptests/sp09/screen06.c c/src/tests/sptests/sp09/screen07.c c/src/tests/sptests/sp09/screen08.c c/src/tests/sptests/sp09/screen09.c c/src/tests/sptests/sp09/screen10.c c/src/tests/sptests/sp09/screen11.c c/src/tests/sptests/sp09/screen12.c c/src/tests/sptests/sp09/screen13.c c/src/tests/sptests/sp09/screen14.c c/src/tests/sptests/sp09/sp09.doc c/src/tests/sptests/sp09/sp09.scn c/src/tests/sptests/sp09/system.h c/src/tests/sptests/sp09/task1.c c/src/tests/sptests/sp09/task2.c c/src/tests/sptests/sp09/task3.c c/src/tests/sptests/sp09/task4.c c/src/tests/sptests/sp11/Makefile.in c/src/tests/sptests/sp11/init.c c/src/tests/sptests/sp11/sp11.doc c/src/tests/sptests/sp11/sp11.scn c/src/tests/sptests/sp11/system.h c/src/tests/sptests/sp11/task1.c c/src/tests/sptests/sp11/task2.c c/src/tests/sptests/sp11/timer.c c/src/tests/sptests/sp12/Makefile.in c/src/tests/sptests/sp12/init.c c/src/tests/sptests/sp12/pridrv.c c/src/tests/sptests/sp12/pritask.c c/src/tests/sptests/sp12/sp12.doc c/src/tests/sptests/sp12/sp12.scn c/src/tests/sptests/sp12/system.h c/src/tests/sptests/sp12/task1.c c/src/tests/sptests/sp12/task2.c c/src/tests/sptests/sp12/task3.c c/src/tests/sptests/sp12/task4.c c/src/tests/sptests/sp12/task5.c c/src/tests/sptests/sp13/Makefile.in c/src/tests/sptests/sp13/fillbuff.c c/src/tests/sptests/sp13/init.c c/src/tests/sptests/sp13/putbuff.c c/src/tests/sptests/sp13/sp13.doc c/src/tests/sptests/sp13/sp13.scn c/src/tests/sptests/sp13/system.h c/src/tests/sptests/sp13/task1.c c/src/tests/sptests/sp13/task2.c c/src/tests/sptests/sp13/task3.c c/src/tests/sptests/sp14/Makefile.in c/src/tests/sptests/sp14/asr.c c/src/tests/sptests/sp14/init.c c/src/tests/sptests/sp14/sp14.doc c/src/tests/sptests/sp14/sp14.scn c/src/tests/sptests/sp14/system.h c/src/tests/sptests/sp14/task1.c c/src/tests/sptests/sp14/task2.c c/src/tests/sptests/sp15/Makefile.in c/src/tests/sptests/sp15/init.c c/src/tests/sptests/sp15/sp15.doc c/src/tests/sptests/sp15/sp15.scn c/src/tests/sptests/sp15/system.h c/src/tests/sptests/sp15/task1.c c/src/tests/sptests/sp16/Makefile.in c/src/tests/sptests/sp16/init.c c/src/tests/sptests/sp16/sp16.doc c/src/tests/sptests/sp16/sp16.scn c/src/tests/sptests/sp16/system.h c/src/tests/sptests/sp16/task1.c c/src/tests/sptests/sp16/task2.c c/src/tests/sptests/sp16/task3.c c/src/tests/sptests/sp16/task4.c c/src/tests/sptests/sp16/task5.c c/src/tests/sptests/sp17/Makefile.in c/src/tests/sptests/sp17/asr.c c/src/tests/sptests/sp17/init.c c/src/tests/sptests/sp17/sp17.doc c/src/tests/sptests/sp17/sp17.scn c/src/tests/sptests/sp17/system.h c/src/tests/sptests/sp17/task1.c c/src/tests/sptests/sp17/task2.c c/src/tests/sptests/sp19/Makefile.in c/src/tests/sptests/sp19/first.c c/src/tests/sptests/sp19/fptask.c c/src/tests/sptests/sp19/fptest.h c/src/tests/sptests/sp19/init.c c/src/tests/sptests/sp19/inttest.h c/src/tests/sptests/sp19/sp19.doc c/src/tests/sptests/sp19/sp19.scn c/src/tests/sptests/sp19/system.h c/src/tests/sptests/sp19/task1.c c/src/tests/sptests/sp20/Makefile.in c/src/tests/sptests/sp20/getall.c c/src/tests/sptests/sp20/init.c c/src/tests/sptests/sp20/sp20.doc c/src/tests/sptests/sp20/sp20.scn c/src/tests/sptests/sp20/system.h c/src/tests/sptests/sp20/task1.c c/src/tests/sptests/sp21/Makefile.in c/src/tests/sptests/sp21/init.c c/src/tests/sptests/sp21/sp21.doc c/src/tests/sptests/sp21/sp21.scn c/src/tests/sptests/sp21/system.h c/src/tests/sptests/sp21/task1.c c/src/tests/sptests/sp22/Makefile.in c/src/tests/sptests/sp22/delay.c c/src/tests/sptests/sp22/init.c c/src/tests/sptests/sp22/prtime.c c/src/tests/sptests/sp22/sp22.doc c/src/tests/sptests/sp22/sp22.scn c/src/tests/sptests/sp22/system.h c/src/tests/sptests/sp22/task1.c c/src/tests/sptests/sp23/Makefile.in c/src/tests/sptests/sp23/init.c c/src/tests/sptests/sp23/sp23.doc c/src/tests/sptests/sp23/sp23.scn c/src/tests/sptests/sp23/system.h c/src/tests/sptests/sp23/task1.c c/src/tests/sptests/sp24/Makefile.in c/src/tests/sptests/sp24/init.c c/src/tests/sptests/sp24/resume.c c/src/tests/sptests/sp24/sp24.doc c/src/tests/sptests/sp24/sp24.scn c/src/tests/sptests/sp24/system.h c/src/tests/sptests/sp24/task1.c c/src/tests/sptests/sp25/Makefile.in c/src/tests/sptests/sp25/init.c c/src/tests/sptests/sp25/sp25.doc c/src/tests/sptests/sp25/sp25.scn c/src/tests/sptests/sp25/system.h c/src/tests/sptests/sp25/task1.c c/src/tests/sptests/spfatal/Makefile.in c/src/tests/sptests/spfatal/fatal.c c/src/tests/sptests/spfatal/init.c c/src/tests/sptests/spfatal/puterr.c c/src/tests/sptests/spfatal/spfatal.doc c/src/tests/sptests/spfatal/spfatal.scn c/src/tests/sptests/spfatal/system.h c/src/tests/sptests/spfatal/task1.c c/src/tests/sptests/spsize/Makefile.in c/src/tests/sptests/spsize/getint.c c/src/tests/sptests/spsize/init.c c/src/tests/sptests/spsize/size.c c/src/tests/sptests/spsize/system.h c/src/tests/support/Makefile.in c/src/tests/support/include/Makefile.in c/src/tests/support/include/tmacros.h c/src/tests/support/stubdr/Makefile.in c/src/tests/support/stubdr/close.c c/src/tests/support/stubdr/cntrl.c c/src/tests/support/stubdr/init.c c/src/tests/support/stubdr/open.c c/src/tests/support/stubdr/read.c c/src/tests/support/stubdr/stubdrv.h c/src/tests/support/stubdr/write.c c/src/tests/support/wrapup/Makefile.in c/src/tests/tmtests/Makefile.in c/src/tests/tmtests/README c/src/tests/tmtests/include/Makefile.in c/src/tests/tmtests/include/timesys.h c/src/tests/tmtests/tm01/Makefile.in c/src/tests/tmtests/tm01/system.h c/src/tests/tmtests/tm01/task1.c c/src/tests/tmtests/tm01/tm01.doc c/src/tests/tmtests/tm02/Makefile.in c/src/tests/tmtests/tm02/system.h c/src/tests/tmtests/tm02/task1.c c/src/tests/tmtests/tm02/tm02.doc c/src/tests/tmtests/tm03/Makefile.in c/src/tests/tmtests/tm03/system.h c/src/tests/tmtests/tm03/task1.c c/src/tests/tmtests/tm03/tm03.doc c/src/tests/tmtests/tm04/Makefile.in c/src/tests/tmtests/tm04/system.h c/src/tests/tmtests/tm04/task1.c c/src/tests/tmtests/tm04/tm04.doc c/src/tests/tmtests/tm05/Makefile.in c/src/tests/tmtests/tm05/system.h c/src/tests/tmtests/tm05/task1.c c/src/tests/tmtests/tm05/tm05.doc c/src/tests/tmtests/tm06/Makefile.in c/src/tests/tmtests/tm06/system.h c/src/tests/tmtests/tm06/task1.c c/src/tests/tmtests/tm06/tm06.doc c/src/tests/tmtests/tm07/Makefile.in c/src/tests/tmtests/tm07/system.h c/src/tests/tmtests/tm07/task1.c c/src/tests/tmtests/tm07/tm07.doc c/src/tests/tmtests/tm08/Makefile.in c/src/tests/tmtests/tm08/system.h c/src/tests/tmtests/tm08/task1.c c/src/tests/tmtests/tm08/tm08.doc c/src/tests/tmtests/tm09/Makefile.in c/src/tests/tmtests/tm09/system.h c/src/tests/tmtests/tm09/task1.c c/src/tests/tmtests/tm09/tm09.doc c/src/tests/tmtests/tm10/Makefile.in c/src/tests/tmtests/tm10/system.h c/src/tests/tmtests/tm10/task1.c c/src/tests/tmtests/tm10/tm10.doc c/src/tests/tmtests/tm11/Makefile.in c/src/tests/tmtests/tm11/system.h c/src/tests/tmtests/tm11/task1.c c/src/tests/tmtests/tm11/tm11.doc c/src/tests/tmtests/tm12/Makefile.in c/src/tests/tmtests/tm12/system.h c/src/tests/tmtests/tm12/task1.c c/src/tests/tmtests/tm12/tm12.doc c/src/tests/tmtests/tm13/Makefile.in c/src/tests/tmtests/tm13/system.h c/src/tests/tmtests/tm13/task1.c c/src/tests/tmtests/tm13/tm13.doc c/src/tests/tmtests/tm14/Makefile.in c/src/tests/tmtests/tm14/system.h c/src/tests/tmtests/tm14/task1.c c/src/tests/tmtests/tm14/tm14.doc c/src/tests/tmtests/tm15/Makefile.in c/src/tests/tmtests/tm15/system.h c/src/tests/tmtests/tm15/task1.c c/src/tests/tmtests/tm15/tm15.doc c/src/tests/tmtests/tm16/Makefile.in c/src/tests/tmtests/tm16/system.h c/src/tests/tmtests/tm16/task1.c c/src/tests/tmtests/tm16/tm16.doc c/src/tests/tmtests/tm17/Makefile.in c/src/tests/tmtests/tm17/system.h c/src/tests/tmtests/tm17/task1.c c/src/tests/tmtests/tm17/tm17.doc c/src/tests/tmtests/tm18/Makefile.in c/src/tests/tmtests/tm18/system.h c/src/tests/tmtests/tm18/task1.c c/src/tests/tmtests/tm18/tm18.doc c/src/tests/tmtests/tm19/Makefile.in c/src/tests/tmtests/tm19/system.h c/src/tests/tmtests/tm19/task1.c c/src/tests/tmtests/tm19/tm19.doc c/src/tests/tmtests/tm20/Makefile.in c/src/tests/tmtests/tm20/system.h c/src/tests/tmtests/tm20/task1.c c/src/tests/tmtests/tm20/tm20.doc c/src/tests/tmtests/tm21/Makefile.in c/src/tests/tmtests/tm21/system.h c/src/tests/tmtests/tm21/task1.c c/src/tests/tmtests/tm21/tm21.doc c/src/tests/tmtests/tm22/Makefile.in c/src/tests/tmtests/tm22/system.h c/src/tests/tmtests/tm22/task1.c c/src/tests/tmtests/tm22/tm22.doc c/src/tests/tmtests/tm23/Makefile.in c/src/tests/tmtests/tm23/system.h c/src/tests/tmtests/tm23/task1.c c/src/tests/tmtests/tm23/tm23.doc c/src/tests/tmtests/tm24/Makefile.in c/src/tests/tmtests/tm24/system.h c/src/tests/tmtests/tm24/task1.c c/src/tests/tmtests/tm24/tm24.doc c/src/tests/tmtests/tm25/Makefile.in c/src/tests/tmtests/tm25/system.h c/src/tests/tmtests/tm25/task1.c c/src/tests/tmtests/tm25/tm25.doc c/src/tests/tmtests/tm26/Makefile.in c/src/tests/tmtests/tm26/fptest.h c/src/tests/tmtests/tm26/system.h c/src/tests/tmtests/tm26/task1.c c/src/tests/tmtests/tm26/tm26.doc c/src/tests/tmtests/tm27/Makefile.in c/src/tests/tmtests/tm27/system.h c/src/tests/tmtests/tm27/task1.c c/src/tests/tmtests/tm27/tm27.doc c/src/tests/tmtests/tm28/Makefile.in c/src/tests/tmtests/tm28/system.h c/src/tests/tmtests/tm28/task1.c c/src/tests/tmtests/tm28/tm28.doc c/src/tests/tmtests/tm29/Makefile.in c/src/tests/tmtests/tm29/system.h c/src/tests/tmtests/tm29/task1.c c/src/tests/tmtests/tm29/tm29.doc c/src/tests/tmtests/tmck/Makefile.in c/src/tests/tmtests/tmck/system.h c/src/tests/tmtests/tmck/task1.c c/src/tests/tmtests/tmck/tmck.doc c/src/tests/tmtests/tmoverhd/Makefile.in c/src/tests/tmtests/tmoverhd/dumrtems.h c/src/tests/tmtests/tmoverhd/empty.c c/src/tests/tmtests/tmoverhd/system.h c/src/tests/tmtests/tmoverhd/testtask.c c/src/tests/tmtests/tmoverhd/tmoverhd.doc c/src/tests/tools/Makefile.in c/src/tests/tools/generic/Makefile.in c/src/tests/tools/generic/difftest c/src/tests/tools/generic/sorttimes c/src/wrapup/Makefile.in c/update-tools/310_to_320_list c/update-tools/Makefile.in c/update-tools/README c/update-tools/update.in c/update-tools/word-replace.in config.guess config.sub configure configure.in cpukit/ada/rtems.adb cpukit/ada/rtems.ads cpukit/libcsupport/include/chain.h cpukit/libcsupport/include/clockdrv.h cpukit/libcsupport/include/console.h cpukit/libcsupport/include/iosupp.h cpukit/libcsupport/include/motorola/mc68230.h cpukit/libcsupport/include/motorola/mc68681.h cpukit/libcsupport/include/ringbuf.h cpukit/libcsupport/include/rtems/assoc.h cpukit/libcsupport/include/rtems/error.h cpukit/libcsupport/include/rtems/libcsupport.h cpukit/libcsupport/include/rtems/libio.h cpukit/libcsupport/include/spurious.h cpukit/libcsupport/include/sys/filio.h cpukit/libcsupport/include/sys/ioctl.h cpukit/libcsupport/include/sys/sockio.h cpukit/libcsupport/include/sys/termios.h cpukit/libcsupport/include/sys/utsname.h cpukit/libcsupport/include/timerdrv.h cpukit/libcsupport/include/vmeintr.h cpukit/libcsupport/include/zilog/z8036.h cpukit/libcsupport/include/zilog/z8530.h cpukit/libcsupport/include/zilog/z8536.h cpukit/libcsupport/src/README cpukit/libcsupport/src/__brk.c cpukit/libcsupport/src/__gettod.c cpukit/libcsupport/src/__times.c cpukit/libcsupport/src/assoc.c cpukit/libcsupport/src/closedir.c cpukit/libcsupport/src/error.c cpukit/libcsupport/src/getdents.c cpukit/libcsupport/src/hosterr.c cpukit/libcsupport/src/libio.c cpukit/libcsupport/src/malloc.c cpukit/libcsupport/src/newlibc.c cpukit/libcsupport/src/no_libc.c cpukit/libcsupport/src/opendir.c cpukit/libcsupport/src/readdir.c cpukit/libcsupport/src/rewinddir.c cpukit/libcsupport/src/scandir.c cpukit/libcsupport/src/seekdir.c cpukit/libcsupport/src/tcdrain.c cpukit/libcsupport/src/telldir.c cpukit/libcsupport/src/termios.c cpukit/libcsupport/src/unixlibc.c cpukit/libcsupport/src/utsname.c cpukit/libmisc/README cpukit/libmisc/cpuuse/README cpukit/libmisc/cpuuse/cpuuse.c cpukit/libmisc/cpuuse/cpuuse.h cpukit/libmisc/monitor/README cpukit/libmisc/monitor/mon-command.c cpukit/libmisc/monitor/mon-config.c cpukit/libmisc/monitor/mon-dname.c cpukit/libmisc/monitor/mon-driver.c cpukit/libmisc/monitor/mon-extension.c cpukit/libmisc/monitor/mon-itask.c cpukit/libmisc/monitor/mon-manager.c cpukit/libmisc/monitor/mon-monitor.c cpukit/libmisc/monitor/mon-mpci.c cpukit/libmisc/monitor/mon-object.c cpukit/libmisc/monitor/mon-prmisc.c cpukit/libmisc/monitor/mon-queue.c cpukit/libmisc/monitor/mon-server.c cpukit/libmisc/monitor/mon-symbols.c cpukit/libmisc/monitor/mon-task.c cpukit/libmisc/monitor/monitor.h cpukit/libmisc/monitor/symbols.h cpukit/libmisc/rtmonuse/rtmonuse.c cpukit/libmisc/rtmonuse/rtmonuse.h cpukit/libmisc/stackchk/README cpukit/libmisc/stackchk/check.c cpukit/libmisc/stackchk/internal.h cpukit/libmisc/stackchk/stackchk.h cpukit/libnetworking/README cpukit/libnetworking/arpa/ftp.h cpukit/libnetworking/arpa/inet.h cpukit/libnetworking/arpa/nameser.h cpukit/libnetworking/arpa/nameser_compat.h cpukit/libnetworking/arpa/telnet.h cpukit/libnetworking/bpfilter.h cpukit/libnetworking/kern/kern_subr.c cpukit/libnetworking/kern/uipc_domain.c cpukit/libnetworking/kern/uipc_mbuf.c cpukit/libnetworking/kern/uipc_socket.c cpukit/libnetworking/kern/uipc_socket2.c cpukit/libnetworking/lib/README cpukit/libnetworking/lib/getprotoby.c cpukit/libnetworking/lib/syslog.c cpukit/libnetworking/lib/tftpDriver.c cpukit/libnetworking/libc/addr2ascii.3 cpukit/libnetworking/libc/addr2ascii.c cpukit/libnetworking/libc/ascii2addr.c cpukit/libnetworking/libc/base64.c cpukit/libnetworking/libc/byteorder.3 cpukit/libnetworking/libc/ether_addr.c cpukit/libnetworking/libc/ethers.3 cpukit/libnetworking/libc/gethostbydns.c cpukit/libnetworking/libc/gethostbyht.c cpukit/libnetworking/libc/gethostbyname.3 cpukit/libnetworking/libc/gethostbynis.c cpukit/libnetworking/libc/gethostnamadr.c cpukit/libnetworking/libc/gethostname.c cpukit/libnetworking/libc/getnetbydns.c cpukit/libnetworking/libc/getnetbyht.c cpukit/libnetworking/libc/getnetbynis.c cpukit/libnetworking/libc/getnetent.3 cpukit/libnetworking/libc/getnetnamadr.c cpukit/libnetworking/libc/getproto.c cpukit/libnetworking/libc/getprotoent.3 cpukit/libnetworking/libc/getprotoent.c cpukit/libnetworking/libc/getprotoname.c cpukit/libnetworking/libc/getservbyname.c cpukit/libnetworking/libc/getservbyport.c cpukit/libnetworking/libc/getservent.3 cpukit/libnetworking/libc/getservent.c cpukit/libnetworking/libc/herror.c cpukit/libnetworking/libc/inet.3 cpukit/libnetworking/libc/inet_addr.c cpukit/libnetworking/libc/inet_lnaof.c cpukit/libnetworking/libc/inet_makeaddr.c cpukit/libnetworking/libc/inet_net_ntop.c cpukit/libnetworking/libc/inet_net_pton.c cpukit/libnetworking/libc/inet_neta.c cpukit/libnetworking/libc/inet_netof.c cpukit/libnetworking/libc/inet_network.c cpukit/libnetworking/libc/inet_ntoa.c cpukit/libnetworking/libc/inet_ntop.c cpukit/libnetworking/libc/inet_pton.c cpukit/libnetworking/libc/iso_addr.3 cpukit/libnetworking/libc/iso_addr.c cpukit/libnetworking/libc/linkaddr.3 cpukit/libnetworking/libc/linkaddr.c cpukit/libnetworking/libc/map_v4v6.c cpukit/libnetworking/libc/ns.3 cpukit/libnetworking/libc/ns_addr.c cpukit/libnetworking/libc/ns_name.c cpukit/libnetworking/libc/ns_netint.c cpukit/libnetworking/libc/ns_ntoa.c cpukit/libnetworking/libc/ns_parse.c cpukit/libnetworking/libc/ns_print.c cpukit/libnetworking/libc/ns_ttl.c cpukit/libnetworking/libc/nsap_addr.c cpukit/libnetworking/libc/rcmd.3 cpukit/libnetworking/libc/rcmd.c cpukit/libnetworking/libc/recv.c cpukit/libnetworking/libc/res_comp.c cpukit/libnetworking/libc/res_config.h cpukit/libnetworking/libc/res_data.c cpukit/libnetworking/libc/res_debug.c cpukit/libnetworking/libc/res_init.c cpukit/libnetworking/libc/res_mkquery.c cpukit/libnetworking/libc/res_mkupdate.c cpukit/libnetworking/libc/res_query.c cpukit/libnetworking/libc/res_send.c cpukit/libnetworking/libc/res_stubs.c cpukit/libnetworking/libc/res_update.c cpukit/libnetworking/libc/resolver.3 cpukit/libnetworking/libc/send.c cpukit/libnetworking/libc/strsep.c cpukit/libnetworking/loop.h cpukit/libnetworking/machine/conf.h cpukit/libnetworking/machine/cpu.h cpukit/libnetworking/machine/cpufunc.h cpukit/libnetworking/machine/endian.h cpukit/libnetworking/machine/in_cksum.h cpukit/libnetworking/machine/limits.h cpukit/libnetworking/machine/param.h cpukit/libnetworking/machine/types.h cpukit/libnetworking/machine/vmparam.h cpukit/libnetworking/net/bpf.h cpukit/libnetworking/net/ethernet.h cpukit/libnetworking/net/if.c cpukit/libnetworking/net/if.h cpukit/libnetworking/net/if_arp.h cpukit/libnetworking/net/if_dl.h cpukit/libnetworking/net/if_ethersubr.c cpukit/libnetworking/net/if_llc.h cpukit/libnetworking/net/if_loop.c cpukit/libnetworking/net/if_types.h cpukit/libnetworking/net/netisr.h cpukit/libnetworking/net/radix.c cpukit/libnetworking/net/radix.h cpukit/libnetworking/net/raw_cb.c cpukit/libnetworking/net/raw_cb.h cpukit/libnetworking/net/raw_usrreq.c cpukit/libnetworking/net/route.c cpukit/libnetworking/net/route.h cpukit/libnetworking/net/rtsock.c cpukit/libnetworking/netdb.h cpukit/libnetworking/netinet/icmp_var.h cpukit/libnetworking/netinet/if_ether.c cpukit/libnetworking/netinet/if_ether.h cpukit/libnetworking/netinet/igmp.c cpukit/libnetworking/netinet/igmp.h cpukit/libnetworking/netinet/igmp_var.h cpukit/libnetworking/netinet/in.c cpukit/libnetworking/netinet/in.h cpukit/libnetworking/netinet/in_cksum.c cpukit/libnetworking/netinet/in_cksum_i386.c cpukit/libnetworking/netinet/in_cksum_i386.h cpukit/libnetworking/netinet/in_cksum_m68k.c cpukit/libnetworking/netinet/in_cksum_m68k.h cpukit/libnetworking/netinet/in_pcb.c cpukit/libnetworking/netinet/in_pcb.h cpukit/libnetworking/netinet/in_proto.c cpukit/libnetworking/netinet/in_rmx.c cpukit/libnetworking/netinet/in_systm.h cpukit/libnetworking/netinet/in_var.h cpukit/libnetworking/netinet/ip.h cpukit/libnetworking/netinet/ip_divert.c cpukit/libnetworking/netinet/ip_fw.c cpukit/libnetworking/netinet/ip_fw.h cpukit/libnetworking/netinet/ip_icmp.c cpukit/libnetworking/netinet/ip_icmp.h cpukit/libnetworking/netinet/ip_input.c cpukit/libnetworking/netinet/ip_mroute.c cpukit/libnetworking/netinet/ip_mroute.h cpukit/libnetworking/netinet/ip_output.c cpukit/libnetworking/netinet/ip_var.h cpukit/libnetworking/netinet/raw_ip.c cpukit/libnetworking/netinet/tcp.h cpukit/libnetworking/netinet/tcp_debug.c cpukit/libnetworking/netinet/tcp_debug.h cpukit/libnetworking/netinet/tcp_fsm.h cpukit/libnetworking/netinet/tcp_input.c cpukit/libnetworking/netinet/tcp_output.c cpukit/libnetworking/netinet/tcp_seq.h cpukit/libnetworking/netinet/tcp_subr.c cpukit/libnetworking/netinet/tcp_timer.c cpukit/libnetworking/netinet/tcp_timer.h cpukit/libnetworking/netinet/tcp_usrreq.c cpukit/libnetworking/netinet/tcp_var.h cpukit/libnetworking/netinet/tcpip.h cpukit/libnetworking/netinet/udp.h cpukit/libnetworking/netinet/udp_usrreq.c cpukit/libnetworking/netinet/udp_var.h cpukit/libnetworking/nfs/bootp_subr.c cpukit/libnetworking/nfs/krpc.h cpukit/libnetworking/nfs/nfs.h cpukit/libnetworking/nfs/nfsdiskless.h cpukit/libnetworking/nfs/nfsproto.h cpukit/libnetworking/nfs/rpcv2.h cpukit/libnetworking/nfs/xdr_subs.h cpukit/libnetworking/opt_ipfw.h cpukit/libnetworking/opt_mrouting.h cpukit/libnetworking/opt_tcpdebug.h cpukit/libnetworking/poll.h cpukit/libnetworking/resolv.h cpukit/libnetworking/rtems/issetugid.c cpukit/libnetworking/rtems/rtems_bootp.c cpukit/libnetworking/rtems/rtems_bsdnet.h cpukit/libnetworking/rtems/rtems_bsdnet_internal.h cpukit/libnetworking/rtems/rtems_glue.c cpukit/libnetworking/rtems/rtems_showicmpstat.c cpukit/libnetworking/rtems/rtems_showifstat.c cpukit/libnetworking/rtems/rtems_showipstat.c cpukit/libnetworking/rtems/rtems_showmbuf.c cpukit/libnetworking/rtems/rtems_showroute.c cpukit/libnetworking/rtems/rtems_showtcpstat.c cpukit/libnetworking/rtems/rtems_showudpstat.c cpukit/libnetworking/rtems/rtems_syscall.c cpukit/libnetworking/rtems/sghostname.c cpukit/libnetworking/rtems/tftp.h cpukit/libnetworking/sys/buf.h cpukit/libnetworking/sys/callout.h cpukit/libnetworking/sys/conf.h cpukit/libnetworking/sys/domain.h cpukit/libnetworking/sys/kernel.h cpukit/libnetworking/sys/libkern.h cpukit/libnetworking/sys/malloc.h cpukit/libnetworking/sys/mbuf.h cpukit/libnetworking/sys/mount.h cpukit/libnetworking/sys/param.h cpukit/libnetworking/sys/proc.h cpukit/libnetworking/sys/protosw.h cpukit/libnetworking/sys/queue.h cpukit/libnetworking/sys/reboot.h cpukit/libnetworking/sys/resourcevar.h cpukit/libnetworking/sys/rtprio.h cpukit/libnetworking/sys/select.h cpukit/libnetworking/sys/signalvar.h cpukit/libnetworking/sys/socket.h cpukit/libnetworking/sys/socketvar.h cpukit/libnetworking/sys/sysctl.h cpukit/libnetworking/sys/syslimits.h cpukit/libnetworking/sys/syslog.h cpukit/libnetworking/sys/systm.h cpukit/libnetworking/sys/ttydefaults.h cpukit/libnetworking/sys/ucred.h cpukit/libnetworking/sys/uio.h cpukit/libnetworking/syslog.h cpukit/libnetworking/vm/vm.h cpukit/libnetworking/vm/vm_extern.h cpukit/libnetworking/vm/vm_kern.h cpukit/libnetworking/vm/vm_param.h cpukit/posix/include/aio.h cpukit/posix/include/devctl.h cpukit/posix/include/intr.h cpukit/posix/include/mqueue.h cpukit/posix/include/rtems/posix/cancel.h cpukit/posix/include/rtems/posix/cond.h cpukit/posix/include/rtems/posix/condmp.h cpukit/posix/include/rtems/posix/config.h cpukit/posix/include/rtems/posix/intr.h cpukit/posix/include/rtems/posix/key.h cpukit/posix/include/rtems/posix/mqueue.h cpukit/posix/include/rtems/posix/mqueuemp.h cpukit/posix/include/rtems/posix/mutex.h cpukit/posix/include/rtems/posix/mutexmp.h cpukit/posix/include/rtems/posix/posixapi.h cpukit/posix/include/rtems/posix/priority.h cpukit/posix/include/rtems/posix/psignal.h cpukit/posix/include/rtems/posix/pthread.h cpukit/posix/include/rtems/posix/pthreadmp.h cpukit/posix/include/rtems/posix/semaphore.h cpukit/posix/include/rtems/posix/semaphoremp.h cpukit/posix/include/rtems/posix/threadsup.h cpukit/posix/include/rtems/posix/time.h cpukit/posix/include/sched.h cpukit/posix/include/semaphore.h cpukit/posix/inline/rtems/posix/cond.inl cpukit/posix/inline/rtems/posix/intr.inl cpukit/posix/inline/rtems/posix/key.inl cpukit/posix/inline/rtems/posix/mqueue.inl cpukit/posix/inline/rtems/posix/mutex.inl cpukit/posix/inline/rtems/posix/priority.inl cpukit/posix/inline/rtems/posix/pthread.inl cpukit/posix/inline/rtems/posix/semaphore.inl cpukit/posix/src/adasupp.c cpukit/posix/src/aio.c cpukit/posix/src/cancel.c cpukit/posix/src/cond.c cpukit/posix/src/devctl.c cpukit/posix/src/execl.c cpukit/posix/src/execle.c cpukit/posix/src/execlp.c cpukit/posix/src/execv.c cpukit/posix/src/execve.c cpukit/posix/src/execvp.c cpukit/posix/src/fork.c cpukit/posix/src/getpid.c cpukit/posix/src/intr.c cpukit/posix/src/key.c cpukit/posix/src/mqueue.c cpukit/posix/src/mutex.c cpukit/posix/src/psignal.c cpukit/posix/src/pthread.c cpukit/posix/src/pthreadatfork.c cpukit/posix/src/ptimer.c cpukit/posix/src/sched.c cpukit/posix/src/semaphore.c cpukit/posix/src/time.c cpukit/posix/src/types.c cpukit/posix/src/wait.c cpukit/posix/src/waitpid.c cpukit/rtems/include/rtems.h cpukit/rtems/include/rtems/rtems/asr.h cpukit/rtems/include/rtems/rtems/attr.h cpukit/rtems/include/rtems/rtems/clock.h cpukit/rtems/include/rtems/rtems/config.h cpukit/rtems/include/rtems/rtems/dpmem.h cpukit/rtems/include/rtems/rtems/event.h cpukit/rtems/include/rtems/rtems/eventmp.h cpukit/rtems/include/rtems/rtems/eventset.h cpukit/rtems/include/rtems/rtems/intr.h cpukit/rtems/include/rtems/rtems/message.h cpukit/rtems/include/rtems/rtems/modes.h cpukit/rtems/include/rtems/rtems/mp.h cpukit/rtems/include/rtems/rtems/msgmp.h cpukit/rtems/include/rtems/rtems/options.h cpukit/rtems/include/rtems/rtems/part.h cpukit/rtems/include/rtems/rtems/partmp.h cpukit/rtems/include/rtems/rtems/ratemon.h cpukit/rtems/include/rtems/rtems/region.h cpukit/rtems/include/rtems/rtems/regionmp.h cpukit/rtems/include/rtems/rtems/rtemsapi.h cpukit/rtems/include/rtems/rtems/sem.h cpukit/rtems/include/rtems/rtems/semmp.h cpukit/rtems/include/rtems/rtems/signal.h cpukit/rtems/include/rtems/rtems/signalmp.h cpukit/rtems/include/rtems/rtems/status.h cpukit/rtems/include/rtems/rtems/support.h cpukit/rtems/include/rtems/rtems/taskmp.h cpukit/rtems/include/rtems/rtems/tasks.h cpukit/rtems/include/rtems/rtems/timer.h cpukit/rtems/include/rtems/rtems/types.h cpukit/rtems/inline/rtems/rtems/asr.inl cpukit/rtems/inline/rtems/rtems/attr.inl cpukit/rtems/inline/rtems/rtems/dpmem.inl cpukit/rtems/inline/rtems/rtems/event.inl cpukit/rtems/inline/rtems/rtems/eventset.inl cpukit/rtems/inline/rtems/rtems/message.inl cpukit/rtems/inline/rtems/rtems/modes.inl cpukit/rtems/inline/rtems/rtems/options.inl cpukit/rtems/inline/rtems/rtems/part.inl cpukit/rtems/inline/rtems/rtems/ratemon.inl cpukit/rtems/inline/rtems/rtems/region.inl cpukit/rtems/inline/rtems/rtems/sem.inl cpukit/rtems/inline/rtems/rtems/status.inl cpukit/rtems/inline/rtems/rtems/support.inl cpukit/rtems/inline/rtems/rtems/tasks.inl cpukit/rtems/inline/rtems/rtems/timer.inl cpukit/rtems/macros/rtems/rtems/asr.inl cpukit/rtems/macros/rtems/rtems/attr.inl cpukit/rtems/macros/rtems/rtems/dpmem.inl cpukit/rtems/macros/rtems/rtems/event.inl cpukit/rtems/macros/rtems/rtems/eventset.inl cpukit/rtems/macros/rtems/rtems/message.inl cpukit/rtems/macros/rtems/rtems/modes.inl cpukit/rtems/macros/rtems/rtems/options.inl cpukit/rtems/macros/rtems/rtems/part.inl cpukit/rtems/macros/rtems/rtems/ratemon.inl cpukit/rtems/macros/rtems/rtems/region.inl cpukit/rtems/macros/rtems/rtems/sem.inl cpukit/rtems/macros/rtems/rtems/status.inl cpukit/rtems/macros/rtems/rtems/support.inl cpukit/rtems/macros/rtems/rtems/tasks.inl cpukit/rtems/macros/rtems/rtems/timer.inl cpukit/rtems/src/attr.c cpukit/rtems/src/dpmem.c cpukit/rtems/src/event.c cpukit/rtems/src/eventmp.c cpukit/rtems/src/intr.c cpukit/rtems/src/intrbody.c cpukit/rtems/src/mp.c cpukit/rtems/src/msg.c cpukit/rtems/src/msgmp.c cpukit/rtems/src/part.c cpukit/rtems/src/partmp.c cpukit/rtems/src/ratemon.c cpukit/rtems/src/region.c cpukit/rtems/src/regionmp.c cpukit/rtems/src/rtclock.c cpukit/rtems/src/rtemstimer.c cpukit/rtems/src/sem.c cpukit/rtems/src/semmp.c cpukit/rtems/src/signal.c cpukit/rtems/src/signalmp.c cpukit/rtems/src/taskmp.c cpukit/rtems/src/tasks.c cpukit/sapi/include/confdefs.h cpukit/sapi/include/rtems/README cpukit/sapi/include/rtems/config.h cpukit/sapi/include/rtems/extension.h cpukit/sapi/include/rtems/fatal.h cpukit/sapi/include/rtems/init.h cpukit/sapi/include/rtems/io.h cpukit/sapi/include/rtems/mptables.h cpukit/sapi/inline/rtems/extension.inl cpukit/sapi/macros/rtems/extension.inl cpukit/sapi/src/debug.c cpukit/sapi/src/exinit.c cpukit/sapi/src/extension.c cpukit/sapi/src/fatal.c cpukit/sapi/src/io.c cpukit/sapi/src/posixapi.c cpukit/sapi/src/rtemsapi.c cpukit/score/cpu/a29k/amd.ah cpukit/score/cpu/a29k/asm.h cpukit/score/cpu/a29k/cpu.c cpukit/score/cpu/a29k/pswmacro.ah cpukit/score/cpu/a29k/register.ah cpukit/score/cpu/hppa1.1/cpu.c cpukit/score/cpu/i386/asm.h cpukit/score/cpu/i386/cpu.c cpukit/score/cpu/i386/rtems/asm.h cpukit/score/cpu/i960/asm.h cpukit/score/cpu/i960/cpu.c cpukit/score/cpu/m68k/asm.h cpukit/score/cpu/m68k/cpu.c cpukit/score/cpu/m68k/m68302.h cpukit/score/cpu/m68k/m68360.h cpukit/score/cpu/m68k/memcpy.c cpukit/score/cpu/m68k/qsm.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/m68k/sim.h cpukit/score/cpu/mips/asm.h cpukit/score/cpu/mips/cpu.c cpukit/score/cpu/mips/cpu_asm.S cpukit/score/cpu/mips/idtcpu.h cpukit/score/cpu/mips/iregdef.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/mips64orion/asm.h cpukit/score/cpu/mips64orion/cpu.c cpukit/score/cpu/mips64orion/cpu_asm.S cpukit/score/cpu/mips64orion/cpu_asm.h cpukit/score/cpu/mips64orion/idtcpu.h cpukit/score/cpu/mips64orion/idtmon.h cpukit/score/cpu/mips64orion/iregdef.h cpukit/score/cpu/no_cpu/asm.h cpukit/score/cpu/no_cpu/cpu.c cpukit/score/cpu/no_cpu/cpu_asm.c cpukit/score/cpu/no_cpu/rtems/asm.h cpukit/score/cpu/sh/asm.h cpukit/score/cpu/sh/cpu.c cpukit/score/cpu/sh/rtems/asm.h cpukit/score/cpu/sparc/README cpukit/score/cpu/sparc/asm.h cpukit/score/cpu/sparc/cpu.c cpukit/score/cpu/sparc/rtems/asm.h cpukit/score/cpu/unix/cpu.c cpukit/score/include/rtems/debug.h cpukit/score/include/rtems/score/address.h cpukit/score/include/rtems/score/apiext.h cpukit/score/include/rtems/score/bitfield.h cpukit/score/include/rtems/score/chain.h cpukit/score/include/rtems/score/context.h cpukit/score/include/rtems/score/copyrt.h cpukit/score/include/rtems/score/coremsg.h cpukit/score/include/rtems/score/coremutex.h cpukit/score/include/rtems/score/coresem.h cpukit/score/include/rtems/score/heap.h cpukit/score/include/rtems/score/interr.h cpukit/score/include/rtems/score/isr.h cpukit/score/include/rtems/score/mpci.h cpukit/score/include/rtems/score/mppkt.h cpukit/score/include/rtems/score/object.h cpukit/score/include/rtems/score/objectmp.h cpukit/score/include/rtems/score/priority.h cpukit/score/include/rtems/score/stack.h cpukit/score/include/rtems/score/states.h cpukit/score/include/rtems/score/sysstate.h cpukit/score/include/rtems/score/thread.h cpukit/score/include/rtems/score/threadmp.h cpukit/score/include/rtems/score/threadq.h cpukit/score/include/rtems/score/tod.h cpukit/score/include/rtems/score/tqdata.h cpukit/score/include/rtems/score/userext.h cpukit/score/include/rtems/score/watchdog.h cpukit/score/include/rtems/score/wkspace.h cpukit/score/include/rtems/system.h cpukit/score/inline/rtems/score/address.inl cpukit/score/inline/rtems/score/chain.inl cpukit/score/inline/rtems/score/coremsg.inl cpukit/score/inline/rtems/score/coremutex.inl cpukit/score/inline/rtems/score/coresem.inl cpukit/score/inline/rtems/score/heap.inl cpukit/score/inline/rtems/score/isr.inl cpukit/score/inline/rtems/score/mppkt.inl cpukit/score/inline/rtems/score/object.inl cpukit/score/inline/rtems/score/objectmp.inl cpukit/score/inline/rtems/score/priority.inl cpukit/score/inline/rtems/score/stack.inl cpukit/score/inline/rtems/score/states.inl cpukit/score/inline/rtems/score/sysstate.inl cpukit/score/inline/rtems/score/thread.inl cpukit/score/inline/rtems/score/threadmp.inl cpukit/score/inline/rtems/score/tod.inl cpukit/score/inline/rtems/score/tqdata.inl cpukit/score/inline/rtems/score/userext.inl cpukit/score/inline/rtems/score/watchdog.inl cpukit/score/inline/rtems/score/wkspace.inl cpukit/score/macros/README cpukit/score/macros/rtems/score/README cpukit/score/macros/rtems/score/address.inl cpukit/score/macros/rtems/score/chain.inl cpukit/score/macros/rtems/score/coremsg.inl cpukit/score/macros/rtems/score/coremutex.inl cpukit/score/macros/rtems/score/coresem.inl cpukit/score/macros/rtems/score/heap.inl cpukit/score/macros/rtems/score/isr.inl cpukit/score/macros/rtems/score/mppkt.inl cpukit/score/macros/rtems/score/object.inl cpukit/score/macros/rtems/score/objectmp.inl cpukit/score/macros/rtems/score/priority.inl cpukit/score/macros/rtems/score/stack.inl cpukit/score/macros/rtems/score/states.inl cpukit/score/macros/rtems/score/sysstate.inl cpukit/score/macros/rtems/score/thread.inl cpukit/score/macros/rtems/score/threadmp.inl cpukit/score/macros/rtems/score/tod.inl cpukit/score/macros/rtems/score/tqdata.inl cpukit/score/macros/rtems/score/userext.inl cpukit/score/macros/rtems/score/watchdog.inl cpukit/score/macros/rtems/score/wkspace.inl cpukit/score/src/apiext.c cpukit/score/src/chain.c cpukit/score/src/coremsg.c cpukit/score/src/coremutex.c cpukit/score/src/coresem.c cpukit/score/src/coretod.c cpukit/score/src/heap.c cpukit/score/src/interr.c cpukit/score/src/isr.c cpukit/score/src/mpci.c cpukit/score/src/object.c cpukit/score/src/objectmp.c cpukit/score/src/thread.c cpukit/score/src/threadmp.c cpukit/score/src/threadq.c cpukit/score/src/userext.c cpukit/score/src/watchdog.c cpukit/score/src/wkspace.c cpukit/zlib/doc/rfc1950.txt cpukit/zlib/doc/rfc1951.txt cpukit/zlib/doc/rfc1952.txt install-sh make/Makefile.in make/README make/Templates/Makefile.dir make/Templates/Makefile.inc.in make/Templates/Makefile.leaf make/Templates/Makefile.lib make/compilers/gcc-no_bsp.cfg make/compilers/gcc-portsw.cfg make/compilers/gcc-target-default.cfg make/compilers/gcc.cfg.in make/custom/FreeBSD-posix.cfg make/custom/HPUX9-posix.cfg make/custom/Linux-posix.cfg make/custom/Solaris-posix.cfg make/custom/bare.cfg make/custom/cvme961.cfg make/custom/default.cfg make/custom/dmv152.cfg make/custom/dmv177.cfg make/custom/efi332.cfg make/custom/efi68k.cfg make/custom/erc32.cfg make/custom/force386.cfg make/custom/gen68302.cfg make/custom/gen68340.cfg make/custom/gen68360.cfg make/custom/gen68360_040.cfg make/custom/gensh1.cfg make/custom/go32.cfg make/custom/go32_p5.cfg make/custom/helas403.cfg make/custom/i386ex.cfg make/custom/idp.cfg make/custom/mvme136.cfg make/custom/mvme147.cfg make/custom/mvme147s.cfg make/custom/mvme162.cfg make/custom/mvme162lx.cfg make/custom/no_bsp.cfg make/custom/ods68302.cfg make/custom/p4000.cfg make/custom/p4600.cfg make/custom/p4650.cfg make/custom/papyrus.cfg make/custom/pc386.cfg make/custom/portsw.cfg make/custom/posix.cfg make/custom/psim.cfg make/custom/simhppa.cfg make/directory.cfg make/host.cfg.in make/leaf.cfg make/lib.cfg make/main.cfg make/rtems.cfg make/target.cfg.in mkinstalldirs testsuites/PROBLEMS testsuites/README testsuites/libtests/README 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/malloctest/init.c testsuites/libtests/malloctest/system.h testsuites/libtests/malloctest/task1.c testsuites/libtests/monitor/init.c testsuites/libtests/monitor/system.h testsuites/libtests/rtems++/Init.cc 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/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/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/README testsuites/libtests/termios/init.c testsuites/mptests/README testsuites/mptests/mp01/init.c testsuites/mptests/mp01/node1/mp01.doc testsuites/mptests/mp01/node1/mp01.scn 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/init.c testsuites/mptests/mp02/node1/mp02.doc testsuites/mptests/mp02/node1/mp02.scn 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/delay.c testsuites/mptests/mp03/init.c testsuites/mptests/mp03/node1/mp03.doc testsuites/mptests/mp03/node1/mp03.scn 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/init.c testsuites/mptests/mp04/node1/mp04.doc testsuites/mptests/mp04/node1/mp04.scn 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/asr.c testsuites/mptests/mp05/init.c testsuites/mptests/mp05/node1/mp05.doc testsuites/mptests/mp05/node1/mp05.scn 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/init.c testsuites/mptests/mp06/node1/mp06.doc testsuites/mptests/mp06/node1/mp06.scn 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/init.c testsuites/mptests/mp07/node1/mp07.doc testsuites/mptests/mp07/node1/mp07.scn 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/init.c testsuites/mptests/mp08/node1/mp08.doc testsuites/mptests/mp08/node1/mp08.scn 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/init.c testsuites/mptests/mp09/node1/mp09.doc testsuites/mptests/mp09/node1/mp09.scn 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/init.c testsuites/mptests/mp10/node1/mp10.doc testsuites/mptests/mp10/node1/mp10.scn 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/init.c testsuites/mptests/mp11/node1/mp11.doc testsuites/mptests/mp11/node1/mp11.scn testsuites/mptests/mp11/node2/mp11.doc testsuites/mptests/mp11/node2/mp11.scn testsuites/mptests/mp11/system.h testsuites/mptests/mp12/init.c testsuites/mptests/mp12/node1/mp12.doc testsuites/mptests/mp12/node1/mp12.scn testsuites/mptests/mp12/node2/mp12.doc testsuites/mptests/mp12/node2/mp12.scn testsuites/mptests/mp12/system.h testsuites/mptests/mp13/init.c testsuites/mptests/mp13/node1/mp13.doc testsuites/mptests/mp13/node1/mp13.scn 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/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/mp14.doc testsuites/mptests/mp14/node1/mp14.scn 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/psxtests/include/pmacros.h testsuites/psxtests/psx01/init.c testsuites/psxtests/psx01/psx01.scn testsuites/psxtests/psx01/system.h testsuites/psxtests/psx01/task.c testsuites/psxtests/psx02/init.c testsuites/psxtests/psx02/psx02.scn testsuites/psxtests/psx02/system.h testsuites/psxtests/psx02/task.c testsuites/psxtests/psx03/init.c testsuites/psxtests/psx03/psx03.scn testsuites/psxtests/psx03/system.h testsuites/psxtests/psx03/task.c 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/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/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/init.c testsuites/psxtests/psx07/psx07.scn testsuites/psxtests/psx07/system.h testsuites/psxtests/psx07/task.c testsuites/psxtests/psx08/init.c testsuites/psxtests/psx08/psx08.scn testsuites/psxtests/psx08/system.h testsuites/psxtests/psx08/task2.c testsuites/psxtests/psx09/init.c testsuites/psxtests/psx09/psx09.scn testsuites/psxtests/psx09/system.h 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/init.c testsuites/psxtests/psx11/psx11.scn testsuites/psxtests/psx11/system.h testsuites/psxtests/psx11/task.c testsuites/psxtests/psx12/init.c testsuites/psxtests/psx12/psx12.scn testsuites/psxtests/psx12/system.h testsuites/psxtests/psx12/task.c 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/samples/README testsuites/samples/base_mp/apptask.c testsuites/samples/base_mp/init.c testsuites/samples/base_mp/node1/base_mp.doc testsuites/samples/base_mp/node1/base_mp.scn 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/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/cdtest.scn testsuites/samples/cdtest/init.c testsuites/samples/cdtest/main.cc testsuites/samples/cdtest/system.h testsuites/samples/hello/hello.doc testsuites/samples/hello/hello.scn testsuites/samples/hello/init.c testsuites/samples/hello/system.h testsuites/samples/paranoia/init.c testsuites/samples/paranoia/paranoia.c testsuites/samples/paranoia/paranoia.doc testsuites/samples/paranoia/system.h 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/sptests/README 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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/init.c testsuites/sptests/sp25/sp25.doc testsuites/sptests/sp25/sp25.scn testsuites/sptests/sp25/system.h testsuites/sptests/sp25/task1.c 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/getint.c testsuites/sptests/spsize/init.c testsuites/sptests/spsize/size.c testsuites/sptests/spsize/system.h testsuites/support/include/tmacros.h testsuites/tmtests/README testsuites/tmtests/include/timesys.h testsuites/tmtests/tm01/system.h testsuites/tmtests/tm01/task1.c testsuites/tmtests/tm01/tm01.doc testsuites/tmtests/tm02/system.h testsuites/tmtests/tm02/task1.c testsuites/tmtests/tm02/tm02.doc testsuites/tmtests/tm03/system.h testsuites/tmtests/tm03/task1.c testsuites/tmtests/tm03/tm03.doc testsuites/tmtests/tm04/system.h testsuites/tmtests/tm04/task1.c testsuites/tmtests/tm04/tm04.doc testsuites/tmtests/tm05/system.h testsuites/tmtests/tm05/task1.c testsuites/tmtests/tm05/tm05.doc testsuites/tmtests/tm06/system.h testsuites/tmtests/tm06/task1.c testsuites/tmtests/tm06/tm06.doc testsuites/tmtests/tm07/system.h testsuites/tmtests/tm07/task1.c testsuites/tmtests/tm07/tm07.doc testsuites/tmtests/tm08/system.h testsuites/tmtests/tm08/task1.c testsuites/tmtests/tm08/tm08.doc testsuites/tmtests/tm09/system.h testsuites/tmtests/tm09/task1.c testsuites/tmtests/tm09/tm09.doc testsuites/tmtests/tm10/system.h testsuites/tmtests/tm10/task1.c testsuites/tmtests/tm10/tm10.doc testsuites/tmtests/tm11/system.h testsuites/tmtests/tm11/task1.c testsuites/tmtests/tm11/tm11.doc testsuites/tmtests/tm12/system.h testsuites/tmtests/tm12/task1.c testsuites/tmtests/tm12/tm12.doc testsuites/tmtests/tm13/system.h testsuites/tmtests/tm13/task1.c testsuites/tmtests/tm13/tm13.doc testsuites/tmtests/tm14/system.h testsuites/tmtests/tm14/task1.c testsuites/tmtests/tm14/tm14.doc testsuites/tmtests/tm15/system.h testsuites/tmtests/tm15/task1.c testsuites/tmtests/tm15/tm15.doc testsuites/tmtests/tm16/system.h testsuites/tmtests/tm16/task1.c testsuites/tmtests/tm16/tm16.doc testsuites/tmtests/tm17/system.h testsuites/tmtests/tm17/task1.c testsuites/tmtests/tm17/tm17.doc testsuites/tmtests/tm18/system.h testsuites/tmtests/tm18/task1.c testsuites/tmtests/tm18/tm18.doc testsuites/tmtests/tm19/system.h testsuites/tmtests/tm19/task1.c testsuites/tmtests/tm19/tm19.doc testsuites/tmtests/tm20/system.h testsuites/tmtests/tm20/task1.c testsuites/tmtests/tm20/tm20.doc testsuites/tmtests/tm21/system.h testsuites/tmtests/tm21/task1.c testsuites/tmtests/tm21/tm21.doc testsuites/tmtests/tm22/system.h testsuites/tmtests/tm22/task1.c testsuites/tmtests/tm22/tm22.doc testsuites/tmtests/tm23/system.h testsuites/tmtests/tm23/task1.c testsuites/tmtests/tm23/tm23.doc testsuites/tmtests/tm24/system.h testsuites/tmtests/tm24/task1.c testsuites/tmtests/tm24/tm24.doc testsuites/tmtests/tm25/system.h testsuites/tmtests/tm25/task1.c testsuites/tmtests/tm25/tm25.doc testsuites/tmtests/tm26/fptest.h testsuites/tmtests/tm26/system.h testsuites/tmtests/tm26/task1.c testsuites/tmtests/tm26/tm26.doc testsuites/tmtests/tm27/system.h testsuites/tmtests/tm27/task1.c testsuites/tmtests/tm27/tm27.doc testsuites/tmtests/tm28/system.h testsuites/tmtests/tm28/task1.c testsuites/tmtests/tm28/tm28.doc testsuites/tmtests/tm29/system.h testsuites/tmtests/tm29/task1.c testsuites/tmtests/tm29/tm29.doc testsuites/tmtests/tmck/system.h testsuites/tmtests/tmck/task1.c testsuites/tmtests/tmck/tmck.doc 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 tools/build/Makefile.in tools/build/README tools/build/binpatch.c tools/build/cklength.c tools/build/eolstrip.c tools/build/install-if-change.in tools/build/lock-directory.in tools/build/os/Makefile.in tools/build/os/msdos/Makefile.in tools/build/os/msdos/README tools/build/os/msdos/cklength.uue tools/build/os/msdos/fixtimer.c tools/build/os/msdos/fixtimer.uue tools/build/os/msdos/ifc.c tools/build/os/msdos/ifc_exe.uue tools/build/packhex.c tools/build/rcs-clean.in tools/build/scripts/Makefile.in tools/build/scripts/README tools/build/scripts/install-if-change.in tools/build/scripts/lock-directory.in tools/build/scripts/rcs-clean.in tools/build/scripts/search-id.sh tools/build/scripts/unlock-directory.in tools/build/search-id.sh tools/build/src/Makefile.in tools/build/src/cklength.c tools/build/src/config.h.in tools/build/src/eolstrip.c tools/build/src/packhex.c tools/build/src/unhex.c tools/build/unhex.c tools/build/unlock-directory.in tools/cpu/Makefile.in tools/cpu/generic/Makefile.in tools/cpu/generic/size_rtems.in tools/cpu/hppa1.1/genoffsets.c tools/cpu/sh/AUTHORS tools/cpu/sh/COPYING tools/cpu/sh/Makefile.in tools/cpu/sh/TODO tools/cpu/sh/sci.c tools/cpu/sh/sci.h tools/cpu/sh/shgen.c tools/cpu/unix/Makefile.in tools/cpu/unix/gensize.c tools/update/310_to_320_list tools/update/Makefile.in tools/update/README tools/update/update.in tools/update/word-replace.in
-rw-r--r--COPYING343
-rw-r--r--INSTALL52
-rw-r--r--LICENSE23
-rw-r--r--Makefile.in76
-rw-r--r--README97
-rw-r--r--README.configure259
-rw-r--r--SUPPORT25
-rw-r--r--VERSION5
-rw-r--r--aclocal.m4615
-rw-r--r--aclocal/ar-s.m425
-rw-r--r--aclocal/canonical-target-name.m417
-rw-r--r--aclocal/canonicalize-tools.m497
-rw-r--r--aclocal/check-files-in.m424
-rw-r--r--aclocal/check-makefile.m412
-rw-r--r--aclocal/cygwin.m421
-rw-r--r--aclocal/exeext.m438
-rw-r--r--aclocal/gcc-pipe.m429
-rw-r--r--aclocal/gcc-specs.m422
-rw-r--r--aclocal/i386-gas-code16.m426
-rw-r--r--aclocal/mkdir.m441
-rw-r--r--aclocal/prog-cc.m465
-rw-r--r--aclocal/prog-cxx.m465
-rw-r--r--aclocal/sysv-ipc.m496
-rw-r--r--aclocal/tool-prefix.m420
-rw-r--r--c/ACKNOWLEDGEMENTS149
-rw-r--r--c/Makefile.in134
-rw-r--r--c/PROBLEMS73
-rw-r--r--c/README37
-rw-r--r--c/README.DOS72
-rw-r--r--c/REQUIRES13
-rw-r--r--c/TESTED74
-rw-r--r--c/UPDATE_HELP52
-rw-r--r--c/build-tools/Makefile.in14
-rw-r--r--c/build-tools/README24
-rw-r--r--c/build-tools/cklength.c377
-rw-r--r--c/build-tools/eolstrip.c366
-rw-r--r--c/build-tools/install-if-change.in142
-rw-r--r--c/build-tools/lock-directory.in43
-rw-r--r--c/build-tools/os/Makefile.in14
-rw-r--r--c/build-tools/os/msdos/Makefile.in39
-rw-r--r--c/build-tools/os/msdos/README12
-rw-r--r--c/build-tools/os/msdos/cklength.uue286
-rw-r--r--c/build-tools/os/msdos/fixtimer.c111
-rw-r--r--c/build-tools/os/msdos/fixtimer.uue162
-rw-r--r--c/build-tools/os/msdos/ifc.c331
-rw-r--r--c/build-tools/os/msdos/ifc_exe.uue163
-rw-r--r--c/build-tools/packhex.c565
-rw-r--r--c/build-tools/rcs-clean.in73
-rw-r--r--c/build-tools/scripts/Makefile.in36
-rw-r--r--c/build-tools/scripts/README24
-rw-r--r--c/build-tools/scripts/install-if-change.in142
-rw-r--r--c/build-tools/scripts/lock-directory.in43
-rw-r--r--c/build-tools/scripts/rcs-clean.in73
-rw-r--r--c/build-tools/scripts/search-id.sh15
-rw-r--r--c/build-tools/scripts/unlock-directory.in41
-rw-r--r--c/build-tools/search-id.sh15
-rw-r--r--c/build-tools/src/Makefile.in70
-rw-r--r--c/build-tools/src/cklength.c377
-rw-r--r--c/build-tools/src/config.h.in9
-rw-r--r--c/build-tools/src/eolstrip.c366
-rw-r--r--c/build-tools/src/packhex.c565
-rw-r--r--c/build-tools/src/unhex.c738
-rw-r--r--c/build-tools/unhex.c738
-rw-r--r--c/build-tools/unlock-directory.in41
-rw-r--r--c/src/Makefile.in16
-rw-r--r--c/src/README27
-rw-r--r--c/src/ada-tests/mptests/mp01/config.h33
-rw-r--r--c/src/ada-tests/mptests/mp01/mp01.adb57
-rw-r--r--c/src/ada-tests/mptests/mp01/mptest.adb235
-rw-r--r--c/src/ada-tests/mptests/mp01/mptest.ads164
-rw-r--r--c/src/ada-tests/mptests/mp01/node1/mp01.scn15
-rw-r--r--c/src/ada-tests/mptests/mp01/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp01/node2/mp01.scn15
-rw-r--r--c/src/ada-tests/mptests/mp01/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp02/mptest.adb213
-rw-r--r--c/src/ada-tests/mptests/mp02/mptest.ads164
-rw-r--r--c/src/ada-tests/mptests/mp02/node1/mp02.scn11
-rw-r--r--c/src/ada-tests/mptests/mp02/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp02/node2/mp02.scn11
-rw-r--r--c/src/ada-tests/mptests/mp02/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp03/mptest.adb277
-rw-r--r--c/src/ada-tests/mptests/mp03/mptest.ads214
-rw-r--r--c/src/ada-tests/mptests/mp03/node1/mp03.scn28
-rw-r--r--c/src/ada-tests/mptests/mp03/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp03/node2/mp03.scn28
-rw-r--r--c/src/ada-tests/mptests/mp03/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp04/mptest.adb169
-rw-r--r--c/src/ada-tests/mptests/mp04/mptest.ads178
-rw-r--r--c/src/ada-tests/mptests/mp04/node1/mp04.scn8
-rw-r--r--c/src/ada-tests/mptests/mp04/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp04/node2/mp04.scn8
-rw-r--r--c/src/ada-tests/mptests/mp04/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp05/mptest.adb252
-rw-r--r--c/src/ada-tests/mptests/mp05/mptest.ads243
-rw-r--r--c/src/ada-tests/mptests/mp05/node1/mp05.scn11
-rw-r--r--c/src/ada-tests/mptests/mp05/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp05/node2/mp05.scn10
-rw-r--r--c/src/ada-tests/mptests/mp05/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp06/mptest.adb257
-rw-r--r--c/src/ada-tests/mptests/mp06/mptest.ads250
-rw-r--r--c/src/ada-tests/mptests/mp06/node1/mp06.scn10
-rw-r--r--c/src/ada-tests/mptests/mp06/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp06/node2/mp06.scn11
-rw-r--r--c/src/ada-tests/mptests/mp06/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp07/mptest.adb210
-rw-r--r--c/src/ada-tests/mptests/mp07/mptest.ads210
-rw-r--r--c/src/ada-tests/mptests/mp07/node1/mp07.scn10
-rw-r--r--c/src/ada-tests/mptests/mp07/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp07/node2/mp07.scn9
-rw-r--r--c/src/ada-tests/mptests/mp07/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp08/mptest.adb207
-rw-r--r--c/src/ada-tests/mptests/mp08/mptest.ads192
-rw-r--r--c/src/ada-tests/mptests/mp08/node1/mp08.scn9
-rw-r--r--c/src/ada-tests/mptests/mp08/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp08/node2/mp08.scn10
-rw-r--r--c/src/ada-tests/mptests/mp08/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp09/mptest.adb381
-rw-r--r--c/src/ada-tests/mptests/mp09/mptest.ads254
-rw-r--r--c/src/ada-tests/mptests/mp09/node1/mp09.scn20
-rw-r--r--c/src/ada-tests/mptests/mp09/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp09/node2/mp09.scn26
-rw-r--r--c/src/ada-tests/mptests/mp09/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp10/mptest.adb301
-rw-r--r--c/src/ada-tests/mptests/mp10/mptest.ads224
-rw-r--r--c/src/ada-tests/mptests/mp10/node1/mp10.scn4
-rw-r--r--c/src/ada-tests/mptests/mp10/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp10/node2/mp10.scn18
-rw-r--r--c/src/ada-tests/mptests/mp10/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp11/mptest.adb138
-rw-r--r--c/src/ada-tests/mptests/mp11/mptest.ads184
-rw-r--r--c/src/ada-tests/mptests/mp11/node1/mp11.scn10
-rw-r--r--c/src/ada-tests/mptests/mp11/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp11/node2/mp11.scn2
-rw-r--r--c/src/ada-tests/mptests/mp11/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp12/mptest.adb152
-rw-r--r--c/src/ada-tests/mptests/mp12/mptest.ads182
-rw-r--r--c/src/ada-tests/mptests/mp12/node1/mp12.scn6
-rw-r--r--c/src/ada-tests/mptests/mp12/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp12/node2/mp12.scn9
-rw-r--r--c/src/ada-tests/mptests/mp12/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp13/mptest.adb328
-rw-r--r--c/src/ada-tests/mptests/mp13/mptest.ads206
-rw-r--r--c/src/ada-tests/mptests/mp13/node1/mp13.scn14
-rw-r--r--c/src/ada-tests/mptests/mp13/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp13/node2/mp13.scn16
-rw-r--r--c/src/ada-tests/mptests/mp13/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp14/mptest.adb764
-rw-r--r--c/src/ada-tests/mptests/mp14/mptest.ads347
-rw-r--r--c/src/ada-tests/mptests/mp14/node1/mp14.scn33
-rw-r--r--c/src/ada-tests/mptests/mp14/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/mptests/mp14/node2/mp14.scn28
-rw-r--r--c/src/ada-tests/mptests/mp14/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/samples/base_mp/mptest.adb108
-rw-r--r--c/src/ada-tests/samples/base_mp/mptest.ads166
-rw-r--r--c/src/ada-tests/samples/base_mp/node1/base_mp.scn5
-rw-r--r--c/src/ada-tests/samples/base_mp/node1/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/samples/base_mp/node2/base_mp.scn5
-rw-r--r--c/src/ada-tests/samples/base_mp/node2/mptest-per_node_configuration.adb43
-rw-r--r--c/src/ada-tests/samples/base_sp/base_sp.adb58
-rw-r--r--c/src/ada-tests/samples/base_sp/base_sp.scn4
-rw-r--r--c/src/ada-tests/samples/base_sp/config.h33
-rw-r--r--c/src/ada-tests/samples/base_sp/sptest.adb98
-rw-r--r--c/src/ada-tests/samples/base_sp/sptest.ads60
-rw-r--r--c/src/ada-tests/samples/hello/config.h32
-rw-r--r--c/src/ada-tests/samples/hello/hello.adb57
-rw-r--r--c/src/ada-tests/samples/hello/hello.scn3
-rw-r--r--c/src/ada-tests/samples/hello/sptest.adb52
-rw-r--r--c/src/ada-tests/samples/hello/sptest.ads48
-rw-r--r--c/src/ada-tests/samples/ticker/config.h33
-rw-r--r--c/src/ada-tests/samples/ticker/sptest.adb162
-rw-r--r--c/src/ada-tests/samples/ticker/sptest.ads60
-rw-r--r--c/src/ada-tests/samples/ticker/ticker.adb57
-rw-r--r--c/src/ada-tests/samples/ticker/ticker.scn16
-rw-r--r--c/src/ada-tests/sptests/sp01/config.h33
-rw-r--r--c/src/ada-tests/sptests/sp01/sp01.adb57
-rw-r--r--c/src/ada-tests/sptests/sp01/sp01.scn16
-rw-r--r--c/src/ada-tests/sptests/sp01/sptest.adb162
-rw-r--r--c/src/ada-tests/sptests/sp01/sptest.ads60
-rw-r--r--c/src/ada-tests/sptests/sp02/config.h33
-rw-r--r--c/src/ada-tests/sptests/sp02/sp02.adb57
-rw-r--r--c/src/ada-tests/sptests/sp02/sp02.scn15
-rw-r--r--c/src/ada-tests/sptests/sp02/sptest.adb331
-rw-r--r--c/src/ada-tests/sptests/sp02/sptest.ads99
-rw-r--r--c/src/ada-tests/sptests/sp03/config.h33
-rw-r--r--c/src/ada-tests/sptests/sp03/sp03.adb57
-rw-r--r--c/src/ada-tests/sptests/sp03/sp03.scn26
-rw-r--r--c/src/ada-tests/sptests/sp03/sptest.adb173
-rw-r--r--c/src/ada-tests/sptests/sp03/sptest.ads74
-rw-r--r--c/src/ada-tests/sptests/sp04/README13
-rw-r--r--c/src/ada-tests/sptests/sp04/config.h36
-rw-r--r--c/src/ada-tests/sptests/sp04/sp04.adb57
-rw-r--r--c/src/ada-tests/sptests/sp04/sp04.scn23
-rw-r--r--c/src/ada-tests/sptests/sp04/sptest.adb317
-rw-r--r--c/src/ada-tests/sptests/sp04/sptest.ads133
-rw-r--r--c/src/ada-tests/sptests/sp05/config.h35
-rw-r--r--c/src/ada-tests/sptests/sp05/sp05.adb57
-rw-r--r--c/src/ada-tests/sptests/sp05/sp05.scn48
-rw-r--r--c/src/ada-tests/sptests/sp05/sptest.adb229
-rw-r--r--c/src/ada-tests/sptests/sp05/sptest.ads84
-rw-r--r--c/src/ada-tests/sptests/sp06/config.h35
-rw-r--r--c/src/ada-tests/sptests/sp06/sp06.adb57
-rw-r--r--c/src/ada-tests/sptests/sp06/sp06.scn38
-rw-r--r--c/src/ada-tests/sptests/sp06/sptest.adb222
-rw-r--r--c/src/ada-tests/sptests/sp06/sptest.ads91
-rw-r--r--c/src/ada-tests/sptests/sp07/config.h36
-rw-r--r--c/src/ada-tests/sptests/sp07/sp07.adb57
-rw-r--r--c/src/ada-tests/sptests/sp07/sp07.scn32
-rw-r--r--c/src/ada-tests/sptests/sp07/sptest.adb496
-rw-r--r--c/src/ada-tests/sptests/sp07/sptest.ads186
-rw-r--r--c/src/ada-tests/sptests/sp08/config.h35
-rw-r--r--c/src/ada-tests/sptests/sp08/sp08.adb57
-rw-r--r--c/src/ada-tests/sptests/sp08/sp08.scn20
-rw-r--r--c/src/ada-tests/sptests/sp08/sptest.adb351
-rw-r--r--c/src/ada-tests/sptests/sp08/sptest.ads74
-rw-r--r--c/src/ada-tests/sptests/sp09/config.h42
-rw-r--r--c/src/ada-tests/sptests/sp09/sp09.adb57
-rw-r--r--c/src/ada-tests/sptests/sp09/sp09.scn250
-rw-r--r--c/src/ada-tests/sptests/sp09/sptest.adb3208
-rw-r--r--c/src/ada-tests/sptests/sp09/sptest.ads402
-rw-r--r--c/src/ada-tests/sptests/sp11/config.h36
-rw-r--r--c/src/ada-tests/sptests/sp11/sp11.adb57
-rw-r--r--c/src/ada-tests/sptests/sp11/sp11.scn74
-rw-r--r--c/src/ada-tests/sptests/sp11/sptest.adb900
-rw-r--r--c/src/ada-tests/sptests/sp11/sptest.ads178
-rw-r--r--c/src/ada-tests/sptests/sp12/config.h36
-rw-r--r--c/src/ada-tests/sptests/sp12/sp12.adb58
-rw-r--r--c/src/ada-tests/sptests/sp12/sp12.scn78
-rw-r--r--c/src/ada-tests/sptests/sp12/sptest.adb812
-rw-r--r--c/src/ada-tests/sptests/sp12/sptest.ads142
-rw-r--r--c/src/ada-tests/sptests/sp13/config.h36
-rw-r--r--c/src/ada-tests/sptests/sp13/sp13.adb57
-rw-r--r--c/src/ada-tests/sptests/sp13/sp13.scn66
-rw-r--r--c/src/ada-tests/sptests/sp13/sptest.adb723
-rw-r--r--c/src/ada-tests/sptests/sp13/sptest.ads132
-rw-r--r--c/src/ada-tests/sptests/sp14/config.h36
-rw-r--r--c/src/ada-tests/sptests/sp14/sp14.adb57
-rw-r--r--c/src/ada-tests/sptests/sp14/sp14.scn33
-rw-r--r--c/src/ada-tests/sptests/sp14/sptest.adb330
-rw-r--r--c/src/ada-tests/sptests/sp14/sptest.ads131
-rw-r--r--c/src/ada-tests/sptests/sp15/config.h36
-rw-r--r--c/src/ada-tests/sptests/sp15/sp15.adb57
-rw-r--r--c/src/ada-tests/sptests/sp15/sp15.scn16
-rw-r--r--c/src/ada-tests/sptests/sp15/sptest.adb284
-rw-r--r--c/src/ada-tests/sptests/sp15/sptest.ads118
-rw-r--r--c/src/ada-tests/sptests/sp16/config.h36
-rw-r--r--c/src/ada-tests/sptests/sp16/sp16.adb57
-rw-r--r--c/src/ada-tests/sptests/sp16/sp16.scn48
-rw-r--r--c/src/ada-tests/sptests/sp16/sptest.adb686
-rw-r--r--c/src/ada-tests/sptests/sp16/sptest.ads195
-rw-r--r--c/src/ada-tests/sptests/sp17/config.h36
-rw-r--r--c/src/ada-tests/sptests/sp17/sp17.adb57
-rw-r--r--c/src/ada-tests/sptests/sp17/sp17.scn8
-rw-r--r--c/src/ada-tests/sptests/sp17/sptest.adb173
-rw-r--r--c/src/ada-tests/sptests/sp17/sptest.ads93
-rw-r--r--c/src/ada-tests/sptests/sp19/README23
-rw-r--r--c/src/ada-tests/sptests/sp19/config.h33
-rw-r--r--c/src/ada-tests/sptests/sp19/sp19.adb57
-rw-r--r--c/src/ada-tests/sptests/sp19/sp19.scn56
-rw-r--r--c/src/ada-tests/sptests/sp19/sptest.ads102
-rw-r--r--c/src/ada-tests/sptests/sp20/config.h35
-rw-r--r--c/src/ada-tests/sptests/sp20/sp20.adb56
-rw-r--r--c/src/ada-tests/sptests/sp20/sp20.scn27
-rw-r--r--c/src/ada-tests/sptests/sp20/sptest.adb280
-rw-r--r--c/src/ada-tests/sptests/sp20/sptest.ads105
-rw-r--r--c/src/ada-tests/sptests/sp21/config.h34
-rw-r--r--c/src/ada-tests/sptests/sp21/sp21.adb57
-rw-r--r--c/src/ada-tests/sptests/sp21/sp21.scn19
-rw-r--r--c/src/ada-tests/sptests/sp21/sptest.adb270
-rw-r--r--c/src/ada-tests/sptests/sp21/sptest.ads69
-rw-r--r--c/src/ada-tests/sptests/sp22/config.h35
-rw-r--r--c/src/ada-tests/sptests/sp22/sp22.adb57
-rw-r--r--c/src/ada-tests/sptests/sp22/sp22.scn29
-rw-r--r--c/src/ada-tests/sptests/sp22/sptest.adb299
-rw-r--r--c/src/ada-tests/sptests/sp22/sptest.ads92
-rw-r--r--c/src/ada-tests/sptests/sp23/config.h35
-rw-r--r--c/src/ada-tests/sptests/sp23/sp23.adb57
-rw-r--r--c/src/ada-tests/sptests/sp23/sp23.scn9
-rw-r--r--c/src/ada-tests/sptests/sp23/sptest.adb179
-rw-r--r--c/src/ada-tests/sptests/sp23/sptest.ads118
-rw-r--r--c/src/ada-tests/sptests/sp24/config.h35
-rw-r--r--c/src/ada-tests/sptests/sp24/sp24.adb57
-rw-r--r--c/src/ada-tests/sptests/sp24/sp24.scn17
-rw-r--r--c/src/ada-tests/sptests/sp24/sptest.adb171
-rw-r--r--c/src/ada-tests/sptests/sp24/sptest.ads82
-rw-r--r--c/src/ada-tests/sptests/sp25/config.h35
-rw-r--r--c/src/ada-tests/sptests/sp25/sp25.adb57
-rw-r--r--c/src/ada-tests/sptests/sp25/sp25.scn29
-rw-r--r--c/src/ada-tests/sptests/sp25/sptest.adb367
-rw-r--r--c/src/ada-tests/sptests/sp25/sptest.ads103
-rw-r--r--c/src/ada-tests/sptests/spsize/spsize.adb57
-rw-r--r--c/src/ada-tests/sptests/spsize/sptest.adb199
-rw-r--r--c/src/ada-tests/sptests/spsize/sptest.ads56
-rw-r--r--c/src/ada-tests/support/address_io.adb47
-rw-r--r--c/src/ada-tests/support/address_io.ads35
-rw-r--r--c/src/ada-tests/support/float_io.ads27
-rw-r--r--c/src/ada-tests/support/fp.inc154
-rw-r--r--c/src/ada-tests/support/init.c39
-rw-r--r--c/src/ada-tests/support/integer.inc145
-rw-r--r--c/src/ada-tests/support/rtems_calling_overhead.ads105
-rw-r--r--c/src/ada-tests/support/status_io.ads28
-rw-r--r--c/src/ada-tests/support/test_support.adb236
-rw-r--r--c/src/ada-tests/support/test_support.ads173
-rw-r--r--c/src/ada-tests/support/time_test_support.adb77
-rw-r--r--c/src/ada-tests/support/time_test_support.ads54
-rw-r--r--c/src/ada-tests/support/timer_driver.adb45
-rw-r--r--c/src/ada-tests/support/timer_driver.ads81
-rw-r--r--c/src/ada-tests/support/unsigned32_io.ads28
-rw-r--r--c/src/ada-tests/tmtests/tm01/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm01/tm01.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm01/tmtest.adb276
-rw-r--r--c/src/ada-tests/tmtests/tm01/tmtest.ads68
-rw-r--r--c/src/ada-tests/tmtests/tm02/config.h38
-rw-r--r--c/src/ada-tests/tmtests/tm02/tm02.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm02/tmtest.adb209
-rw-r--r--c/src/ada-tests/tmtests/tm02/tmtest.ads103
-rw-r--r--c/src/ada-tests/tmtests/tm03/config.h38
-rw-r--r--c/src/ada-tests/tmtests/tm03/tm03.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm03/tmtest.adb194
-rw-r--r--c/src/ada-tests/tmtests/tm03/tmtest.ads95
-rw-r--r--c/src/ada-tests/tmtests/tm04/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm04/tm04.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm04/tmtest.adb501
-rw-r--r--c/src/ada-tests/tmtests/tm04/tmtest.ads161
-rw-r--r--c/src/ada-tests/tmtests/tm05/config.h38
-rw-r--r--c/src/ada-tests/tmtests/tm05/tm05.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm05/tmtest.adb174
-rw-r--r--c/src/ada-tests/tmtests/tm05/tmtest.ads113
-rw-r--r--c/src/ada-tests/tmtests/tm06/config.h38
-rw-r--r--c/src/ada-tests/tmtests/tm06/tm06.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm06/tmtest.adb210
-rw-r--r--c/src/ada-tests/tmtests/tm06/tmtest.ads104
-rw-r--r--c/src/ada-tests/tmtests/tm07/config.h38
-rw-r--r--c/src/ada-tests/tmtests/tm07/tm07.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm07/tmtest.adb179
-rw-r--r--c/src/ada-tests/tmtests/tm07/tmtest.ads111
-rw-r--r--c/src/ada-tests/tmtests/tm08/config.h38
-rw-r--r--c/src/ada-tests/tmtests/tm08/tm08.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm08/tmtest.adb341
-rw-r--r--c/src/ada-tests/tmtests/tm08/tmtest.ads99
-rw-r--r--c/src/ada-tests/tmtests/tm09/config.h36
-rw-r--r--c/src/ada-tests/tmtests/tm09/tm09.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm09/tmtest.adb302
-rw-r--r--c/src/ada-tests/tmtests/tm09/tmtest.ads100
-rw-r--r--c/src/ada-tests/tmtests/tm10/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm10/tm10.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm10/tmtest.adb225
-rw-r--r--c/src/ada-tests/tmtests/tm10/tmtest.ads117
-rw-r--r--c/src/ada-tests/tmtests/tm11/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm11/tm11.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm11/tmtest.adb219
-rw-r--r--c/src/ada-tests/tmtests/tm11/tmtest.ads114
-rw-r--r--c/src/ada-tests/tmtests/tm12/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm12/tm12.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm12/tmtest.adb212
-rw-r--r--c/src/ada-tests/tmtests/tm12/tmtest.ads105
-rw-r--r--c/src/ada-tests/tmtests/tm13/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm13/tm13.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm13/tmtest.adb217
-rw-r--r--c/src/ada-tests/tmtests/tm13/tmtest.ads114
-rw-r--r--c/src/ada-tests/tmtests/tm14/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm14/tm14.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm14/tmtest.adb216
-rw-r--r--c/src/ada-tests/tmtests/tm14/tmtest.ads105
-rw-r--r--c/src/ada-tests/tmtests/tm15/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm15/tm15.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm15/tmtest.adb276
-rw-r--r--c/src/ada-tests/tmtests/tm15/tmtest.ads109
-rw-r--r--c/src/ada-tests/tmtests/tm16/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm16/tm16.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm16/tmtest.adb197
-rw-r--r--c/src/ada-tests/tmtests/tm16/tmtest.ads111
-rw-r--r--c/src/ada-tests/tmtests/tm17/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm17/tm17.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm17/tmtest.adb160
-rw-r--r--c/src/ada-tests/tmtests/tm17/tmtest.ads109
-rw-r--r--c/src/ada-tests/tmtests/tm18/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm18/tm18.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm18/tmtest.adb154
-rw-r--r--c/src/ada-tests/tmtests/tm18/tmtest.ads97
-rw-r--r--c/src/ada-tests/tmtests/tm19/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm19/tm19.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm19/tmtest.adb287
-rw-r--r--c/src/ada-tests/tmtests/tm19/tmtest.ads144
-rw-r--r--c/src/ada-tests/tmtests/tm20/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm20/tm20.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm20/tmtest.adb588
-rw-r--r--c/src/ada-tests/tmtests/tm20/tmtest.ads151
-rw-r--r--c/src/ada-tests/tmtests/tm21/config.h43
-rw-r--r--c/src/ada-tests/tmtests/tm21/tm21.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm21/tmtest.adb302
-rw-r--r--c/src/ada-tests/tmtests/tm21/tmtest.ads122
-rw-r--r--c/src/ada-tests/tmtests/tm22/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm22/tm22.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm22/tmtest.adb256
-rw-r--r--c/src/ada-tests/tmtests/tm22/tmtest.ads119
-rw-r--r--c/src/ada-tests/tmtests/tm23/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm23/tm23.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm23/tmtest.adb399
-rw-r--r--c/src/ada-tests/tmtests/tm23/tmtest.ads130
-rw-r--r--c/src/ada-tests/tmtests/tm24/config.h36
-rw-r--r--c/src/ada-tests/tmtests/tm24/tm24.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm24/tmtest.adb165
-rw-r--r--c/src/ada-tests/tmtests/tm24/tmtest.ads99
-rw-r--r--c/src/ada-tests/tmtests/tm25/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm25/tm25.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm25/tmtest.adb157
-rw-r--r--c/src/ada-tests/tmtests/tm25/tmtest.ads80
-rw-r--r--c/src/ada-tests/tmtests/tm26/README6
-rw-r--r--c/src/ada-tests/tmtests/tm26/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm26/tm26.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm26/tmtest.adp650
-rw-r--r--c/src/ada-tests/tmtests/tm26/tmtest.ads189
-rw-r--r--c/src/ada-tests/tmtests/tm27/README8
-rw-r--r--c/src/ada-tests/tmtests/tm27/config.h36
-rw-r--r--c/src/ada-tests/tmtests/tm27/tm27.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm27/tmtest.adb268
-rw-r--r--c/src/ada-tests/tmtests/tm27/tmtest.ads131
-rw-r--r--c/src/ada-tests/tmtests/tm28/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm28/tm28.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm28/tmtest.adb176
-rw-r--r--c/src/ada-tests/tmtests/tm28/tmtest.ads106
-rw-r--r--c/src/ada-tests/tmtests/tm29/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tm29/tm29.adb57
-rw-r--r--c/src/ada-tests/tmtests/tm29/tmtest.adb234
-rw-r--r--c/src/ada-tests/tmtests/tm29/tmtest.ads96
-rw-r--r--c/src/ada-tests/tmtests/tmck/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tmck/tmck.adb57
-rw-r--r--c/src/ada-tests/tmtests/tmck/tmtest.adb220
-rw-r--r--c/src/ada-tests/tmtests/tmck/tmtest.ads97
-rw-r--r--c/src/ada-tests/tmtests/tmoverhd/README9
-rw-r--r--c/src/ada-tests/tmtests/tmoverhd/config.h37
-rw-r--r--c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.adb877
-rw-r--r--c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.ads521
-rw-r--r--c/src/ada-tests/tmtests/tmoverhd/tmoverhd.adb57
-rw-r--r--c/src/ada-tests/tmtests/tmoverhd/tmtest.adb1564
-rw-r--r--c/src/ada-tests/tmtests/tmoverhd/tmtest.ads155
-rw-r--r--c/src/ada/rtems.adb2035
-rw-r--r--c/src/ada/rtems.ads1430
-rw-r--r--c/src/exec/Makefile.in18
-rw-r--r--c/src/exec/libcsupport/include/chain.h362
-rw-r--r--c/src/exec/libcsupport/include/clockdrv.h51
-rw-r--r--c/src/exec/libcsupport/include/console.h73
-rw-r--r--c/src/exec/libcsupport/include/iosupp.h44
-rw-r--r--c/src/exec/libcsupport/include/motorola/mc68230.h71
-rw-r--r--c/src/exec/libcsupport/include/motorola/mc68681.h306
-rw-r--r--c/src/exec/libcsupport/include/ringbuf.h53
-rw-r--r--c/src/exec/libcsupport/include/rtems/assoc.h42
-rw-r--r--c/src/exec/libcsupport/include/rtems/error.h38
-rw-r--r--c/src/exec/libcsupport/include/rtems/libcsupport.h43
-rw-r--r--c/src/exec/libcsupport/include/rtems/libio.h166
-rw-r--r--c/src/exec/libcsupport/include/spurious.h38
-rw-r--r--c/src/exec/libcsupport/include/sys/filio.h56
-rw-r--r--c/src/exec/libcsupport/include/sys/ioctl.h77
-rw-r--r--c/src/exec/libcsupport/include/sys/sockio.h86
-rw-r--r--c/src/exec/libcsupport/include/sys/termios.h190
-rw-r--r--c/src/exec/libcsupport/include/sys/utsname.h49
-rw-r--r--c/src/exec/libcsupport/include/timerdrv.h40
-rw-r--r--c/src/exec/libcsupport/include/vmeintr.h58
-rw-r--r--c/src/exec/libcsupport/include/zilog/z8036.h109
-rw-r--r--c/src/exec/libcsupport/include/zilog/z8530.h99
-rw-r--r--c/src/exec/libcsupport/include/zilog/z8536.h112
-rw-r--r--c/src/exec/libcsupport/src/README37
-rw-r--r--c/src/exec/libcsupport/src/__brk.c44
-rw-r--r--c/src/exec/libcsupport/src/__gettod.c118
-rw-r--r--c/src/exec/libcsupport/src/__times.c74
-rw-r--r--c/src/exec/libcsupport/src/assoc.c260
-rw-r--r--c/src/exec/libcsupport/src/closedir.c20
-rw-r--r--c/src/exec/libcsupport/src/error.c209
-rw-r--r--c/src/exec/libcsupport/src/getdents.c14
-rw-r--r--c/src/exec/libcsupport/src/hosterr.c43
-rw-r--r--c/src/exec/libcsupport/src/libio.c524
-rw-r--r--c/src/exec/libcsupport/src/malloc.c424
-rw-r--r--c/src/exec/libcsupport/src/newlibc.c429
-rw-r--r--c/src/exec/libcsupport/src/no_libc.c55
-rw-r--r--c/src/exec/libcsupport/src/opendir.c17
-rw-r--r--c/src/exec/libcsupport/src/readdir.c14
-rw-r--r--c/src/exec/libcsupport/src/rewinddir.c20
-rw-r--r--c/src/exec/libcsupport/src/scandir.c23
-rw-r--r--c/src/exec/libcsupport/src/seekdir.c21
-rw-r--r--c/src/exec/libcsupport/src/tcdrain.c26
-rw-r--r--c/src/exec/libcsupport/src/telldir.c23
-rw-r--r--c/src/exec/libcsupport/src/termios.c935
-rw-r--r--c/src/exec/libcsupport/src/unixlibc.c23
-rw-r--r--c/src/exec/libcsupport/src/utsname.c57
-rw-r--r--c/src/exec/libnetworking/README18
-rw-r--r--c/src/exec/libnetworking/arpa/ftp.h111
-rw-r--r--c/src/exec/libnetworking/arpa/inet.h105
-rw-r--r--c/src/exec/libnetworking/arpa/nameser.h448
-rw-r--r--c/src/exec/libnetworking/arpa/nameser_compat.h194
-rw-r--r--c/src/exec/libnetworking/arpa/telnet.h342
-rw-r--r--c/src/exec/libnetworking/bpfilter.h6
-rw-r--r--c/src/exec/libnetworking/kern/kern_subr.c206
-rw-r--r--c/src/exec/libnetworking/kern/uipc_domain.c228
-rw-r--r--c/src/exec/libnetworking/kern/uipc_mbuf.c851
-rw-r--r--c/src/exec/libnetworking/kern/uipc_socket.c1100
-rw-r--r--c/src/exec/libnetworking/kern/uipc_socket2.c965
-rw-r--r--c/src/exec/libnetworking/lib/README5
-rw-r--r--c/src/exec/libnetworking/lib/getprotoby.c46
-rw-r--r--c/src/exec/libnetworking/lib/syslog.c189
-rw-r--r--c/src/exec/libnetworking/lib/tftpDriver.c609
-rw-r--r--c/src/exec/libnetworking/libc/addr2ascii.3217
-rw-r--r--c/src/exec/libnetworking/libc/addr2ascii.c94
-rw-r--r--c/src/exec/libnetworking/libc/ascii2addr.c74
-rw-r--r--c/src/exec/libnetworking/libc/base64.c318
-rw-r--r--c/src/exec/libnetworking/libc/byteorder.377
-rw-r--r--c/src/exec/libnetworking/libc/ether_addr.c226
-rw-r--r--c/src/exec/libnetworking/libc/ethers.3193
-rw-r--r--c/src/exec/libnetworking/libc/gethostbydns.c773
-rw-r--r--c/src/exec/libnetworking/libc/gethostbyht.c202
-rw-r--r--c/src/exec/libnetworking/libc/gethostbyname.3305
-rw-r--r--c/src/exec/libnetworking/libc/gethostbynis.c142
-rw-r--r--c/src/exec/libnetworking/libc/gethostnamadr.c224
-rw-r--r--c/src/exec/libnetworking/libc/gethostname.c26
-rw-r--r--c/src/exec/libnetworking/libc/getnetbydns.c313
-rw-r--r--c/src/exec/libnetworking/libc/getnetbyht.c173
-rw-r--r--c/src/exec/libnetworking/libc/getnetbynis.c177
-rw-r--r--c/src/exec/libnetworking/libc/getnetent.3159
-rw-r--r--c/src/exec/libnetworking/libc/getnetnamadr.c190
-rw-r--r--c/src/exec/libnetworking/libc/getproto.c57
-rw-r--r--c/src/exec/libnetworking/libc/getprotoent.3147
-rw-r--r--c/src/exec/libnetworking/libc/getprotoent.c121
-rw-r--r--c/src/exec/libnetworking/libc/getprotoname.c64
-rw-r--r--c/src/exec/libnetworking/libc/getservbyname.c81
-rw-r--r--c/src/exec/libnetworking/libc/getservbyport.c76
-rw-r--r--c/src/exec/libnetworking/libc/getservent.3156
-rw-r--r--c/src/exec/libnetworking/libc/getservent.c280
-rw-r--r--c/src/exec/libnetworking/libc/herror.c122
-rw-r--r--c/src/exec/libnetworking/libc/inet.3210
-rw-r--r--c/src/exec/libnetworking/libc/inet_addr.c180
-rw-r--r--c/src/exec/libnetworking/libc/inet_lnaof.c61
-rw-r--r--c/src/exec/libnetworking/libc/inet_makeaddr.c64
-rw-r--r--c/src/exec/libnetworking/libc/inet_net_ntop.c140
-rw-r--r--c/src/exec/libnetworking/libc/inet_net_pton.c207
-rw-r--r--c/src/exec/libnetworking/libc/inet_neta.c84
-rw-r--r--c/src/exec/libnetworking/libc/inet_netof.c60
-rw-r--r--c/src/exec/libnetworking/libc/inet_network.c92
-rw-r--r--c/src/exec/libnetworking/libc/inet_ntoa.c59
-rw-r--r--c/src/exec/libnetworking/libc/inet_ntop.c191
-rw-r--r--c/src/exec/libnetworking/libc/inet_pton.c214
-rw-r--r--c/src/exec/libnetworking/libc/iso_addr.3111
-rw-r--r--c/src/exec/libnetworking/libc/iso_addr.c119
-rw-r--r--c/src/exec/libnetworking/libc/linkaddr.3138
-rw-r--r--c/src/exec/libnetworking/libc/linkaddr.c160
-rw-r--r--c/src/exec/libnetworking/libc/map_v4v6.c128
-rw-r--r--c/src/exec/libnetworking/libc/ns.3131
-rw-r--r--c/src/exec/libnetworking/libc/ns_addr.c229
-rw-r--r--c/src/exec/libnetworking/libc/ns_name.c595
-rw-r--r--c/src/exec/libnetworking/libc/ns_netint.c56
-rw-r--r--c/src/exec/libnetworking/libc/ns_ntoa.c102
-rw-r--r--c/src/exec/libnetworking/libc/ns_parse.c192
-rw-r--r--c/src/exec/libnetworking/libc/ns_print.c745
-rw-r--r--c/src/exec/libnetworking/libc/ns_ttl.c153
-rw-r--r--c/src/exec/libnetworking/libc/nsap_addr.c105
-rw-r--r--c/src/exec/libnetworking/libc/rcmd.3204
-rw-r--r--c/src/exec/libnetworking/libc/rcmd.c520
-rw-r--r--c/src/exec/libnetworking/libc/recv.c52
-rw-r--r--c/src/exec/libnetworking/libc/res_comp.c258
-rw-r--r--c/src/exec/libnetworking/libc/res_config.h20
-rw-r--r--c/src/exec/libnetworking/libc/res_data.c83
-rw-r--r--c/src/exec/libnetworking/libc/res_debug.c966
-rw-r--r--c/src/exec/libnetworking/libc/res_init.c497
-rw-r--r--c/src/exec/libnetworking/libc/res_mkquery.c199
-rw-r--r--c/src/exec/libnetworking/libc/res_mkupdate.c415
-rw-r--r--c/src/exec/libnetworking/libc/res_query.c410
-rw-r--r--c/src/exec/libnetworking/libc/res_send.c929
-rw-r--r--c/src/exec/libnetworking/libc/res_stubs.c75
-rw-r--r--c/src/exec/libnetworking/libc/res_update.c518
-rw-r--r--c/src/exec/libnetworking/libc/resolver.3352
-rw-r--r--c/src/exec/libnetworking/libc/send.c52
-rw-r--r--c/src/exec/libnetworking/libc/strsep.c85
-rw-r--r--c/src/exec/libnetworking/loop.h5
-rw-r--r--c/src/exec/libnetworking/machine/conf.h6
-rw-r--r--c/src/exec/libnetworking/machine/cpu.h6
-rw-r--r--c/src/exec/libnetworking/machine/cpufunc.h5
-rw-r--r--c/src/exec/libnetworking/machine/endian.h64
-rw-r--r--c/src/exec/libnetworking/machine/in_cksum.h118
-rw-r--r--c/src/exec/libnetworking/machine/limits.h6
-rw-r--r--c/src/exec/libnetworking/machine/param.h92
-rw-r--r--c/src/exec/libnetworking/machine/types.h34
-rw-r--r--c/src/exec/libnetworking/machine/vmparam.h6
-rw-r--r--c/src/exec/libnetworking/net/bpf.h236
-rw-r--r--c/src/exec/libnetworking/net/ethernet.h63
-rw-r--r--c/src/exec/libnetworking/net/if.c783
-rw-r--r--c/src/exec/libnetworking/net/if.h467
-rw-r--r--c/src/exec/libnetworking/net/if_arp.h91
-rw-r--r--c/src/exec/libnetworking/net/if_dl.h86
-rw-r--r--c/src/exec/libnetworking/net/if_ethersubr.c988
-rw-r--r--c/src/exec/libnetworking/net/if_llc.h145
-rw-r--r--c/src/exec/libnetworking/net/if_loop.c301
-rw-r--r--c/src/exec/libnetworking/net/if_types.h101
-rw-r--r--c/src/exec/libnetworking/net/netisr.h90
-rw-r--r--c/src/exec/libnetworking/net/radix.c1028
-rw-r--r--c/src/exec/libnetworking/net/radix.h165
-rw-r--r--c/src/exec/libnetworking/net/raw_cb.c148
-rw-r--r--c/src/exec/libnetworking/net/raw_cb.h75
-rw-r--r--c/src/exec/libnetworking/net/raw_usrreq.c315
-rw-r--r--c/src/exec/libnetworking/net/route.c959
-rw-r--r--c/src/exec/libnetworking/net/route.h284
-rw-r--r--c/src/exec/libnetworking/net/rtsock.c829
-rw-r--r--c/src/exec/libnetworking/netdb.h182
-rw-r--r--c/src/exec/libnetworking/netinet/icmp_var.h78
-rw-r--r--c/src/exec/libnetworking/netinet/if_ether.c638
-rw-r--r--c/src/exec/libnetworking/netinet/if_ether.h209
-rw-r--r--c/src/exec/libnetworking/netinet/igmp.c479
-rw-r--r--c/src/exec/libnetworking/netinet/igmp.h96
-rw-r--r--c/src/exec/libnetworking/netinet/igmp_var.h111
-rw-r--r--c/src/exec/libnetworking/netinet/in.c728
-rw-r--r--c/src/exec/libnetworking/netinet/in.h433
-rw-r--r--c/src/exec/libnetworking/netinet/in_cksum.c166
-rw-r--r--c/src/exec/libnetworking/netinet/in_cksum_i386.c198
-rw-r--r--c/src/exec/libnetworking/netinet/in_cksum_m68k.c223
-rw-r--r--c/src/exec/libnetworking/netinet/in_pcb.c757
-rw-r--r--c/src/exec/libnetworking/netinet/in_pcb.h124
-rw-r--r--c/src/exec/libnetworking/netinet/in_proto.c203
-rw-r--r--c/src/exec/libnetworking/netinet/in_rmx.c384
-rw-r--r--c/src/exec/libnetworking/netinet/in_systm.h62
-rw-r--r--c/src/exec/libnetworking/netinet/in_var.h235
-rw-r--r--c/src/exec/libnetworking/netinet/ip.h190
-rw-r--r--c/src/exec/libnetworking/netinet/ip_divert.c382
-rw-r--r--c/src/exec/libnetworking/netinet/ip_fw.c1069
-rw-r--r--c/src/exec/libnetworking/netinet/ip_fw.h183
-rw-r--r--c/src/exec/libnetworking/netinet/ip_icmp.c710
-rw-r--r--c/src/exec/libnetworking/netinet/ip_icmp.h190
-rw-r--r--c/src/exec/libnetworking/netinet/ip_input.c1488
-rw-r--r--c/src/exec/libnetworking/netinet/ip_mroute.c2302
-rw-r--r--c/src/exec/libnetworking/netinet/ip_mroute.h262
-rw-r--r--c/src/exec/libnetworking/netinet/ip_output.c1307
-rw-r--r--c/src/exec/libnetworking/netinet/ip_var.h211
-rw-r--r--c/src/exec/libnetworking/netinet/raw_ip.c486
-rw-r--r--c/src/exec/libnetworking/netinet/tcp.h122
-rw-r--r--c/src/exec/libnetworking/netinet/tcp_debug.c172
-rw-r--r--c/src/exec/libnetworking/netinet/tcp_debug.h69
-rw-r--r--c/src/exec/libnetworking/netinet/tcp_fsm.h92
-rw-r--r--c/src/exec/libnetworking/netinet/tcp_input.c2149
-rw-r--r--c/src/exec/libnetworking/netinet/tcp_output.c755
-rw-r--r--c/src/exec/libnetworking/netinet/tcp_seq.h102
-rw-r--r--c/src/exec/libnetworking/netinet/tcp_subr.c634
-rw-r--r--c/src/exec/libnetworking/netinet/tcp_timer.c387
-rw-r--r--c/src/exec/libnetworking/netinet/tcp_timer.h138
-rw-r--r--c/src/exec/libnetworking/netinet/tcp_usrreq.c840
-rw-r--r--c/src/exec/libnetworking/netinet/tcp_var.h374
-rw-r--r--c/src/exec/libnetworking/netinet/tcpip.h75
-rw-r--r--c/src/exec/libnetworking/netinet/udp.h51
-rw-r--r--c/src/exec/libnetworking/netinet/udp_usrreq.c613
-rw-r--r--c/src/exec/libnetworking/netinet/udp_var.h103
-rw-r--r--c/src/exec/libnetworking/nfs/bootp_subr.c968
-rw-r--r--c/src/exec/libnetworking/nfs/krpc.h26
-rw-r--r--c/src/exec/libnetworking/nfs/nfs.h620
-rw-r--r--c/src/exec/libnetworking/nfs/nfsdiskless.h100
-rw-r--r--c/src/exec/libnetworking/nfs/nfsproto.h441
-rw-r--r--c/src/exec/libnetworking/nfs/rpcv2.h142
-rw-r--r--c/src/exec/libnetworking/nfs/xdr_subs.h90
-rw-r--r--c/src/exec/libnetworking/opt_ipfw.h6
-rw-r--r--c/src/exec/libnetworking/opt_mrouting.h6
-rw-r--r--c/src/exec/libnetworking/opt_tcpdebug.h6
-rw-r--r--c/src/exec/libnetworking/poll.h108
-rw-r--r--c/src/exec/libnetworking/resolv.h306
-rw-r--r--c/src/exec/libnetworking/rtems/issetugid.c11
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_bootp.c19
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_bsdnet.h112
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_bsdnet_internal.h178
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_glue.c905
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_showicmpstat.c60
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_showifstat.c110
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_showipstat.c59
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_showmbuf.c65
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_showroute.c237
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_showtcpstat.c102
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_showudpstat.c48
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_syscall.c761
-rw-r--r--c/src/exec/libnetworking/rtems/sghostname.c49
-rw-r--r--c/src/exec/libnetworking/rtems/tftp.h85
-rw-r--r--c/src/exec/libnetworking/sys/buf.h248
-rw-r--r--c/src/exec/libnetworking/sys/callout.h57
-rw-r--r--c/src/exec/libnetworking/sys/conf.h228
-rw-r--r--c/src/exec/libnetworking/sys/domain.h75
-rw-r--r--c/src/exec/libnetworking/sys/kernel.h251
-rw-r--r--c/src/exec/libnetworking/sys/libkern.h89
-rw-r--r--c/src/exec/libnetworking/sys/malloc.h355
-rw-r--r--c/src/exec/libnetworking/sys/mbuf.h439
-rw-r--r--c/src/exec/libnetworking/sys/mount.h531
-rw-r--r--c/src/exec/libnetworking/sys/param.h231
-rw-r--r--c/src/exec/libnetworking/sys/proc.h8
-rw-r--r--c/src/exec/libnetworking/sys/protosw.h300
-rw-r--r--c/src/exec/libnetworking/sys/queue.h446
-rw-r--r--c/src/exec/libnetworking/sys/reboot.h106
-rw-r--r--c/src/exec/libnetworking/sys/resourcevar.h5
-rw-r--r--c/src/exec/libnetworking/sys/rtprio.h70
-rw-r--r--c/src/exec/libnetworking/sys/select.h57
-rw-r--r--c/src/exec/libnetworking/sys/signalvar.h171
-rw-r--r--c/src/exec/libnetworking/sys/socket.h356
-rw-r--r--c/src/exec/libnetworking/sys/socketvar.h279
-rw-r--r--c/src/exec/libnetworking/sys/sysctl.h379
-rw-r--r--c/src/exec/libnetworking/sys/syslimits.h85
-rw-r--r--c/src/exec/libnetworking/sys/syslog.h194
-rw-r--r--c/src/exec/libnetworking/sys/systm.h198
-rw-r--r--c/src/exec/libnetworking/sys/ttydefaults.h97
-rw-r--r--c/src/exec/libnetworking/sys/ucred.h64
-rw-r--r--c/src/exec/libnetworking/sys/uio.h92
-rw-r--r--c/src/exec/libnetworking/syslog.h5
-rw-r--r--c/src/exec/libnetworking/vm/vm.h73
-rw-r--r--c/src/exec/libnetworking/vm/vm_extern.h103
-rw-r--r--c/src/exec/libnetworking/vm/vm_kern.h84
-rw-r--r--c/src/exec/libnetworking/vm/vm_param.h165
-rw-r--r--c/src/exec/posix/Makefile.in14
-rw-r--r--c/src/exec/posix/base/Makefile.in34
-rw-r--r--c/src/exec/posix/base/aio.h137
-rw-r--r--c/src/exec/posix/base/devctl.h30
-rw-r--r--c/src/exec/posix/base/intr.h72
-rw-r--r--c/src/exec/posix/base/limits.h164
-rw-r--r--c/src/exec/posix/base/mqueue.h145
-rw-r--r--c/src/exec/posix/base/pthread.h500
-rw-r--r--c/src/exec/posix/base/sched.h88
-rw-r--r--c/src/exec/posix/base/semaphore.h108
-rw-r--r--c/src/exec/posix/base/unistd.h89
-rw-r--r--c/src/exec/posix/headers/Makefile.in34
-rw-r--r--c/src/exec/posix/headers/cancel.h16
-rw-r--r--c/src/exec/posix/headers/cond.h130
-rw-r--r--c/src/exec/posix/headers/condmp.h162
-rw-r--r--c/src/exec/posix/headers/config.h59
-rw-r--r--c/src/exec/posix/headers/intr.h154
-rw-r--r--c/src/exec/posix/headers/key.h136
-rw-r--r--c/src/exec/posix/headers/mqueue.h186
-rw-r--r--c/src/exec/posix/headers/mqueuemp.h161
-rw-r--r--c/src/exec/posix/headers/mutex.h120
-rw-r--r--c/src/exec/posix/headers/mutexmp.h161
-rw-r--r--c/src/exec/posix/headers/posixapi.h34
-rw-r--r--c/src/exec/posix/headers/priority.h44
-rw-r--r--c/src/exec/posix/headers/psignal.h22
-rw-r--r--c/src/exec/posix/headers/pthread.h123
-rw-r--r--c/src/exec/posix/headers/pthreadmp.h161
-rw-r--r--c/src/exec/posix/headers/semaphore.h135
-rw-r--r--c/src/exec/posix/headers/semaphoremp.h161
-rw-r--r--c/src/exec/posix/headers/seterr.h20
-rw-r--r--c/src/exec/posix/headers/threadsup.h46
-rw-r--r--c/src/exec/posix/headers/time.h50
-rw-r--r--c/src/exec/posix/include/aio.h137
-rw-r--r--c/src/exec/posix/include/devctl.h30
-rw-r--r--c/src/exec/posix/include/intr.h72
-rw-r--r--c/src/exec/posix/include/limits.h164
-rw-r--r--c/src/exec/posix/include/mqueue.h145
-rw-r--r--c/src/exec/posix/include/pthread.h500
-rw-r--r--c/src/exec/posix/include/rtems/posix/Makefile.in34
-rw-r--r--c/src/exec/posix/include/rtems/posix/cancel.h16
-rw-r--r--c/src/exec/posix/include/rtems/posix/cond.h130
-rw-r--r--c/src/exec/posix/include/rtems/posix/condmp.h162
-rw-r--r--c/src/exec/posix/include/rtems/posix/config.h59
-rw-r--r--c/src/exec/posix/include/rtems/posix/intr.h154
-rw-r--r--c/src/exec/posix/include/rtems/posix/key.h136
-rw-r--r--c/src/exec/posix/include/rtems/posix/mqueue.h186
-rw-r--r--c/src/exec/posix/include/rtems/posix/mqueuemp.h161
-rw-r--r--c/src/exec/posix/include/rtems/posix/mutex.h120
-rw-r--r--c/src/exec/posix/include/rtems/posix/mutexmp.h161
-rw-r--r--c/src/exec/posix/include/rtems/posix/posixapi.h34
-rw-r--r--c/src/exec/posix/include/rtems/posix/priority.h44
-rw-r--r--c/src/exec/posix/include/rtems/posix/psignal.h22
-rw-r--r--c/src/exec/posix/include/rtems/posix/pthread.h123
-rw-r--r--c/src/exec/posix/include/rtems/posix/pthreadmp.h161
-rw-r--r--c/src/exec/posix/include/rtems/posix/semaphore.h135
-rw-r--r--c/src/exec/posix/include/rtems/posix/semaphoremp.h161
-rw-r--r--c/src/exec/posix/include/rtems/posix/seterr.h20
-rw-r--r--c/src/exec/posix/include/rtems/posix/threadsup.h46
-rw-r--r--c/src/exec/posix/include/rtems/posix/time.h50
-rw-r--r--c/src/exec/posix/include/sched.h88
-rw-r--r--c/src/exec/posix/include/semaphore.h108
-rw-r--r--c/src/exec/posix/include/sys/Makefile.in31
-rw-r--r--c/src/exec/posix/include/sys/utsname.h49
-rw-r--r--c/src/exec/posix/include/unistd.h89
-rw-r--r--c/src/exec/posix/include/wrap/Makefile.in34
-rw-r--r--c/src/exec/posix/inline/Makefile.in31
-rw-r--r--c/src/exec/posix/inline/cond.inl77
-rw-r--r--c/src/exec/posix/inline/intr.inl72
-rw-r--r--c/src/exec/posix/inline/key.inl70
-rw-r--r--c/src/exec/posix/inline/mqueue.inl83
-rw-r--r--c/src/exec/posix/inline/mutex.inl93
-rw-r--r--c/src/exec/posix/inline/priority.inl37
-rw-r--r--c/src/exec/posix/inline/pthread.inl70
-rw-r--r--c/src/exec/posix/inline/rtems/posix/Makefile.in31
-rw-r--r--c/src/exec/posix/inline/rtems/posix/cond.inl77
-rw-r--r--c/src/exec/posix/inline/rtems/posix/intr.inl72
-rw-r--r--c/src/exec/posix/inline/rtems/posix/key.inl70
-rw-r--r--c/src/exec/posix/inline/rtems/posix/mqueue.inl83
-rw-r--r--c/src/exec/posix/inline/rtems/posix/mutex.inl93
-rw-r--r--c/src/exec/posix/inline/rtems/posix/priority.inl37
-rw-r--r--c/src/exec/posix/inline/rtems/posix/pthread.inl70
-rw-r--r--c/src/exec/posix/inline/rtems/posix/semaphore.inl71
-rw-r--r--c/src/exec/posix/inline/semaphore.inl71
-rw-r--r--c/src/exec/posix/macros/Makefile.in32
-rw-r--r--c/src/exec/posix/macros/rtems/posix/Makefile.in32
-rw-r--r--c/src/exec/posix/optman/Makefile.in47
-rw-r--r--c/src/exec/posix/src/Makefile.in56
-rw-r--r--c/src/exec/posix/src/adasupp.c28
-rw-r--r--c/src/exec/posix/src/aio.c111
-rw-r--r--c/src/exec/posix/src/cancel.c228
-rw-r--r--c/src/exec/posix/src/cond.c502
-rw-r--r--c/src/exec/posix/src/devctl.c22
-rw-r--r--c/src/exec/posix/src/execl.c17
-rw-r--r--c/src/exec/posix/src/execle.c17
-rw-r--r--c/src/exec/posix/src/execlp.c17
-rw-r--r--c/src/exec/posix/src/execv.c17
-rw-r--r--c/src/exec/posix/src/execve.c18
-rw-r--r--c/src/exec/posix/src/execvp.c16
-rw-r--r--c/src/exec/posix/src/fork.c14
-rw-r--r--c/src/exec/posix/src/getpid.c22
-rw-r--r--c/src/exec/posix/src/intr.c340
-rw-r--r--c/src/exec/posix/src/key.c262
-rw-r--r--c/src/exec/posix/src/mqueue.c710
-rw-r--r--c/src/exec/posix/src/mutex.c688
-rw-r--r--c/src/exec/posix/src/psignal.c1343
-rw-r--r--c/src/exec/posix/src/pthread.c1313
-rw-r--r--c/src/exec/posix/src/pthreadatfork.c18
-rw-r--r--c/src/exec/posix/src/ptimer.c75
-rw-r--r--c/src/exec/posix/src/sched.c153
-rw-r--r--c/src/exec/posix/src/semaphore.c571
-rw-r--r--c/src/exec/posix/src/time.c396
-rw-r--r--c/src/exec/posix/src/types.c212
-rw-r--r--c/src/exec/posix/src/unistd.c41
-rw-r--r--c/src/exec/posix/src/utsname.c57
-rw-r--r--c/src/exec/posix/src/wait.c17
-rw-r--r--c/src/exec/posix/src/waitpid.c17
-rw-r--r--c/src/exec/posix/sys/Makefile.in31
-rw-r--r--c/src/exec/posix/sys/utsname.h49
-rw-r--r--c/src/exec/rtems/Makefile.in14
-rw-r--r--c/src/exec/rtems/headers/Makefile.in38
-rw-r--r--c/src/exec/rtems/headers/asr.h112
-rw-r--r--c/src/exec/rtems/headers/attr.h87
-rw-r--r--c/src/exec/rtems/headers/clock.h103
-rw-r--r--c/src/exec/rtems/headers/config.h54
-rw-r--r--c/src/exec/rtems/headers/dpmem.h157
-rw-r--r--c/src/exec/rtems/headers/event.h174
-rw-r--r--c/src/exec/rtems/headers/eventmp.h147
-rw-r--r--c/src/exec/rtems/headers/eventset.h89
-rw-r--r--c/src/exec/rtems/headers/intr.h160
-rw-r--r--c/src/exec/rtems/headers/message.h334
-rw-r--r--c/src/exec/rtems/headers/modes.h89
-rw-r--r--c/src/exec/rtems/headers/mp.h53
-rw-r--r--c/src/exec/rtems/headers/msgmp.h177
-rw-r--r--c/src/exec/rtems/headers/options.h53
-rw-r--r--c/src/exec/rtems/headers/part.h168
-rw-r--r--c/src/exec/rtems/headers/partmp.h161
-rw-r--r--c/src/exec/rtems/headers/ratemon.h213
-rw-r--r--c/src/exec/rtems/headers/region.h234
-rw-r--r--c/src/exec/rtems/headers/regionmp.h166
-rw-r--r--c/src/exec/rtems/headers/rtems.h121
-rw-r--r--c/src/exec/rtems/headers/rtemsapi.h34
-rw-r--r--c/src/exec/rtems/headers/sem.h248
-rw-r--r--c/src/exec/rtems/headers/semmp.h163
-rw-r--r--c/src/exec/rtems/headers/signal.h83
-rw-r--r--c/src/exec/rtems/headers/signalmp.h147
-rw-r--r--c/src/exec/rtems/headers/status.h84
-rw-r--r--c/src/exec/rtems/headers/support.h99
-rw-r--r--c/src/exec/rtems/headers/taskmp.h167
-rw-r--r--c/src/exec/rtems/headers/tasks.h421
-rw-r--r--c/src/exec/rtems/headers/timer.h207
-rw-r--r--c/src/exec/rtems/headers/types.h96
-rw-r--r--c/src/exec/rtems/include/rtems.h121
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/Makefile.in38
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/asr.h112
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/attr.h87
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/clock.h103
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/config.h54
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/dpmem.h157
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/event.h174
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/eventmp.h147
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/eventset.h89
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/intr.h160
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/message.h334
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/modes.h89
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/mp.h53
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/msgmp.h177
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/options.h53
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/part.h168
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/partmp.h161
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/ratemon.h213
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/region.h234
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/regionmp.h166
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/rtemsapi.h34
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/sem.h248
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/semmp.h163
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/signal.h83
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/signalmp.h147
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/status.h84
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/support.h99
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/taskmp.h167
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/tasks.h421
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/timer.h207
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/types.h96
-rw-r--r--c/src/exec/rtems/inline/Makefile.in31
-rw-r--r--c/src/exec/rtems/inline/asr.inl128
-rw-r--r--c/src/exec/rtems/inline/attr.inl176
-rw-r--r--c/src/exec/rtems/inline/dpmem.inl95
-rw-r--r--c/src/exec/rtems/inline/event.inl21
-rw-r--r--c/src/exec/rtems/inline/eventset.inl95
-rw-r--r--c/src/exec/rtems/inline/message.inl83
-rw-r--r--c/src/exec/rtems/inline/modes.inl152
-rw-r--r--c/src/exec/rtems/inline/options.inl55
-rw-r--r--c/src/exec/rtems/inline/part.inl199
-rw-r--r--c/src/exec/rtems/inline/ratemon.inl143
-rw-r--r--c/src/exec/rtems/inline/region.inl127
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/Makefile.in31
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/asr.inl128
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/attr.inl176
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/dpmem.inl95
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/event.inl21
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/eventset.inl95
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/message.inl83
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/modes.inl152
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/options.inl55
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/part.inl199
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/ratemon.inl143
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/region.inl127
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/sem.inl93
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/status.inl56
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/support.inl61
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/tasks.inl90
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/timer.inl142
-rw-r--r--c/src/exec/rtems/inline/sem.inl93
-rw-r--r--c/src/exec/rtems/inline/status.inl56
-rw-r--r--c/src/exec/rtems/inline/support.inl61
-rw-r--r--c/src/exec/rtems/inline/tasks.inl90
-rw-r--r--c/src/exec/rtems/inline/timer.inl142
-rw-r--r--c/src/exec/rtems/macros/Makefile.in31
-rw-r--r--c/src/exec/rtems/macros/asr.inl90
-rw-r--r--c/src/exec/rtems/macros/attr.inl100
-rw-r--r--c/src/exec/rtems/macros/dpmem.inl59
-rw-r--r--c/src/exec/rtems/macros/event.inl21
-rw-r--r--c/src/exec/rtems/macros/eventset.inl59
-rw-r--r--c/src/exec/rtems/macros/message.inl49
-rw-r--r--c/src/exec/rtems/macros/modes.inl92
-rw-r--r--c/src/exec/rtems/macros/options.inl39
-rw-r--r--c/src/exec/rtems/macros/part.inl117
-rw-r--r--c/src/exec/rtems/macros/ratemon.inl85
-rw-r--r--c/src/exec/rtems/macros/region.inl75
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/Makefile.in31
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/asr.inl90
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/attr.inl100
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/dpmem.inl59
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/event.inl21
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/eventset.inl59
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/message.inl49
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/modes.inl92
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/options.inl39
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/part.inl117
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/ratemon.inl85
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/region.inl75
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/sem.inl58
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/status.inl39
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/support.inl44
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/tasks.inl58
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/timer.inl85
-rw-r--r--c/src/exec/rtems/macros/sem.inl58
-rw-r--r--c/src/exec/rtems/macros/status.inl39
-rw-r--r--c/src/exec/rtems/macros/support.inl44
-rw-r--r--c/src/exec/rtems/macros/tasks.inl58
-rw-r--r--c/src/exec/rtems/macros/timer.inl85
-rw-r--r--c/src/exec/rtems/optman/Makefile.in50
-rw-r--r--c/src/exec/rtems/optman/no-dpmem.c98
-rw-r--r--c/src/exec/rtems/optman/no-event.c56
-rw-r--r--c/src/exec/rtems/optman/no-mp.c201
-rw-r--r--c/src/exec/rtems/optman/no-msg.c192
-rw-r--r--c/src/exec/rtems/optman/no-part.c97
-rw-r--r--c/src/exec/rtems/optman/no-region.c114
-rw-r--r--c/src/exec/rtems/optman/no-rtmon.c117
-rw-r--r--c/src/exec/rtems/optman/no-sem.c114
-rw-r--r--c/src/exec/rtems/optman/no-signal.c56
-rw-r--r--c/src/exec/rtems/optman/no-timer.c123
-rw-r--r--c/src/exec/rtems/src/Makefile.in41
-rw-r--r--c/src/exec/rtems/src/attr.c30
-rw-r--r--c/src/exec/rtems/src/clock.c151
-rw-r--r--c/src/exec/rtems/src/dpmem.c281
-rw-r--r--c/src/exec/rtems/src/event.c383
-rw-r--r--c/src/exec/rtems/src/eventmp.c190
-rw-r--r--c/src/exec/rtems/src/intr.c68
-rw-r--r--c/src/exec/rtems/src/intrbody.c71
-rw-r--r--c/src/exec/rtems/src/mp.c42
-rw-r--r--c/src/exec/rtems/src/msg.c764
-rw-r--r--c/src/exec/rtems/src/msgmp.c479
-rw-r--r--c/src/exec/rtems/src/part.c341
-rw-r--r--c/src/exec/rtems/src/partmp.c302
-rw-r--r--c/src/exec/rtems/src/ratemon.c461
-rw-r--r--c/src/exec/rtems/src/region.c486
-rw-r--r--c/src/exec/rtems/src/regionmp.c310
-rw-r--r--c/src/exec/rtems/src/rtclock.c151
-rw-r--r--c/src/exec/rtems/src/rtemstimer.c349
-rw-r--r--c/src/exec/rtems/src/sem.c571
-rw-r--r--c/src/exec/rtems/src/semmp.c308
-rw-r--r--c/src/exec/rtems/src/signal.c149
-rw-r--r--c/src/exec/rtems/src/signalmp.c189
-rw-r--r--c/src/exec/rtems/src/taskmp.c340
-rw-r--r--c/src/exec/rtems/src/tasks.c1130
-rw-r--r--c/src/exec/rtems/src/timer.c349
-rw-r--r--c/src/exec/sapi/Makefile.in14
-rw-r--r--c/src/exec/sapi/headers/Makefile.in43
-rw-r--r--c/src/exec/sapi/headers/README135
-rw-r--r--c/src/exec/sapi/headers/confdefs.h656
-rw-r--r--c/src/exec/sapi/headers/config.h104
-rw-r--r--c/src/exec/sapi/headers/directives.h120
-rw-r--r--c/src/exec/sapi/headers/extension.h138
-rw-r--r--c/src/exec/sapi/headers/fatal.h49
-rw-r--r--c/src/exec/sapi/headers/init.h110
-rw-r--r--c/src/exec/sapi/headers/io.h244
-rw-r--r--c/src/exec/sapi/headers/mptables.h29
-rw-r--r--c/src/exec/sapi/headers/sptables.h165
-rw-r--r--c/src/exec/sapi/include/confdefs.h656
-rw-r--r--c/src/exec/sapi/include/rtems/Makefile.in43
-rw-r--r--c/src/exec/sapi/include/rtems/README135
-rw-r--r--c/src/exec/sapi/include/rtems/config.h104
-rw-r--r--c/src/exec/sapi/include/rtems/directives.h120
-rw-r--r--c/src/exec/sapi/include/rtems/extension.h138
-rw-r--r--c/src/exec/sapi/include/rtems/fatal.h49
-rw-r--r--c/src/exec/sapi/include/rtems/init.h110
-rw-r--r--c/src/exec/sapi/include/rtems/io.h244
-rw-r--r--c/src/exec/sapi/include/rtems/mptables.h29
-rw-r--r--c/src/exec/sapi/include/rtems/sptables.h165
-rw-r--r--c/src/exec/sapi/inline/Makefile.in30
-rw-r--r--c/src/exec/sapi/inline/extension.inl91
-rw-r--r--c/src/exec/sapi/inline/rtems/Makefile.in30
-rw-r--r--c/src/exec/sapi/inline/rtems/extension.inl91
-rw-r--r--c/src/exec/sapi/macros/Makefile.in30
-rw-r--r--c/src/exec/sapi/macros/extension.inl58
-rw-r--r--c/src/exec/sapi/macros/rtems/Makefile.in30
-rw-r--r--c/src/exec/sapi/macros/rtems/extension.inl58
-rw-r--r--c/src/exec/sapi/optman/Makefile.in47
-rw-r--r--c/src/exec/sapi/optman/no-ext.c67
-rw-r--r--c/src/exec/sapi/optman/no-io.c144
-rw-r--r--c/src/exec/sapi/src/Makefile.in39
-rw-r--r--c/src/exec/sapi/src/debug.c62
-rw-r--r--c/src/exec/sapi/src/exinit.c298
-rw-r--r--c/src/exec/sapi/src/extension.c165
-rw-r--r--c/src/exec/sapi/src/fatal.c38
-rw-r--r--c/src/exec/sapi/src/io.c345
-rw-r--r--c/src/exec/sapi/src/posixapi.c96
-rw-r--r--c/src/exec/sapi/src/rtemsapi.c90
-rw-r--r--c/src/exec/score/Makefile.in14
-rw-r--r--c/src/exec/score/cpu/Makefile.in14
-rw-r--r--c/src/exec/score/cpu/a29k/Makefile.in83
-rw-r--r--c/src/exec/score/cpu/a29k/a29k.h59
-rw-r--r--c/src/exec/score/cpu/a29k/a29ktypes.h57
-rw-r--r--c/src/exec/score/cpu/a29k/amd.ah531
-rw-r--r--c/src/exec/score/cpu/a29k/asm.h103
-rw-r--r--c/src/exec/score/cpu/a29k/cpu.c263
-rw-r--r--c/src/exec/score/cpu/a29k/cpu.h983
-rw-r--r--c/src/exec/score/cpu/a29k/cpu_asm.h71
-rw-r--r--c/src/exec/score/cpu/a29k/cpu_asm.s491
-rw-r--r--c/src/exec/score/cpu/a29k/pswmacro.ah442
-rw-r--r--c/src/exec/score/cpu/a29k/register.ah214
-rw-r--r--c/src/exec/score/cpu/a29k/rtems.c48
-rw-r--r--c/src/exec/score/cpu/a29k/sig.s197
-rw-r--r--c/src/exec/score/cpu/hppa1.1/Makefile.in84
-rw-r--r--c/src/exec/score/cpu/hppa1.1/cpu.c184
-rw-r--r--c/src/exec/score/cpu/hppa1.1/cpu.h620
-rw-r--r--c/src/exec/score/cpu/hppa1.1/cpu_asm.h73
-rw-r--r--c/src/exec/score/cpu/hppa1.1/cpu_asm.s778
-rw-r--r--c/src/exec/score/cpu/hppa1.1/hppa.h716
-rw-r--r--c/src/exec/score/cpu/hppa1.1/hppatypes.h46
-rw-r--r--c/src/exec/score/cpu/hppa1.1/rtems.s53
-rw-r--r--c/src/exec/score/cpu/i386/Makefile.in81
-rw-r--r--c/src/exec/score/cpu/i386/asm.h151
-rw-r--r--c/src/exec/score/cpu/i386/cpu.c185
-rw-r--r--c/src/exec/score/cpu/i386/cpu.h485
-rw-r--r--c/src/exec/score/cpu/i386/cpu_asm.s281
-rw-r--r--c/src/exec/score/cpu/i386/i386.h191
-rw-r--r--c/src/exec/score/cpu/i386/i386types.h58
-rw-r--r--c/src/exec/score/cpu/i386/rtems.s31
-rw-r--r--c/src/exec/score/cpu/i960/Makefile.in80
-rw-r--r--c/src/exec/score/cpu/i960/asm.h110
-rw-r--r--c/src/exec/score/cpu/i960/cpu.c155
-rw-r--r--c/src/exec/score/cpu/i960/cpu.h468
-rw-r--r--c/src/exec/score/cpu/i960/cpu_asm.s199
-rw-r--r--c/src/exec/score/cpu/i960/i960.h268
-rw-r--r--c/src/exec/score/cpu/i960/i960types.h58
-rw-r--r--c/src/exec/score/cpu/i960/rtems.s25
-rw-r--r--c/src/exec/score/cpu/m68k/Makefile.in76
-rw-r--r--c/src/exec/score/cpu/m68k/asm.h144
-rw-r--r--c/src/exec/score/cpu/m68k/cpu.c204
-rw-r--r--c/src/exec/score/cpu/m68k/cpu.h647
-rw-r--r--c/src/exec/score/cpu/m68k/cpu_asm.s291
-rw-r--r--c/src/exec/score/cpu/m68k/m68302.h661
-rw-r--r--c/src/exec/score/cpu/m68k/m68360.h880
-rw-r--r--c/src/exec/score/cpu/m68k/m68k.h363
-rw-r--r--c/src/exec/score/cpu/m68k/m68ktypes.h58
-rw-r--r--c/src/exec/score/cpu/m68k/memcpy.c87
-rw-r--r--c/src/exec/score/cpu/m68k/qsm.h209
-rw-r--r--c/src/exec/score/cpu/m68k/rtems.s52
-rw-r--r--c/src/exec/score/cpu/m68k/sim.h342
-rw-r--r--c/src/exec/score/cpu/mips/asm.h102
-rw-r--r--c/src/exec/score/cpu/mips/cpu.c219
-rw-r--r--c/src/exec/score/cpu/mips/cpu_asm.S972
-rw-r--r--c/src/exec/score/cpu/mips/cpu_asm.h115
-rw-r--r--c/src/exec/score/cpu/mips/idtcpu.h440
-rw-r--r--c/src/exec/score/cpu/mips/idtmon.h171
-rw-r--r--c/src/exec/score/cpu/mips/iregdef.h325
-rw-r--r--c/src/exec/score/cpu/mips/rtems.c53
-rw-r--r--c/src/exec/score/cpu/mips64orion/Makefile.in82
-rw-r--r--c/src/exec/score/cpu/mips64orion/asm.h102
-rw-r--r--c/src/exec/score/cpu/mips64orion/cpu.c219
-rw-r--r--c/src/exec/score/cpu/mips64orion/cpu.h969
-rw-r--r--c/src/exec/score/cpu/mips64orion/cpu_asm.S972
-rw-r--r--c/src/exec/score/cpu/mips64orion/cpu_asm.h115
-rw-r--r--c/src/exec/score/cpu/mips64orion/idtcpu.h440
-rw-r--r--c/src/exec/score/cpu/mips64orion/idtmon.h171
-rw-r--r--c/src/exec/score/cpu/mips64orion/iregdef.h325
-rw-r--r--c/src/exec/score/cpu/mips64orion/mips64orion.h74
-rw-r--r--c/src/exec/score/cpu/mips64orion/mipstypes.h73
-rw-r--r--c/src/exec/score/cpu/mips64orion/rtems.c53
-rw-r--r--c/src/exec/score/cpu/no_cpu/Makefile.in84
-rw-r--r--c/src/exec/score/cpu/no_cpu/asm.h101
-rw-r--r--c/src/exec/score/cpu/no_cpu/cpu.c162
-rw-r--r--c/src/exec/score/cpu/no_cpu/cpu.h878
-rw-r--r--c/src/exec/score/cpu/no_cpu/cpu_asm.c165
-rw-r--r--c/src/exec/score/cpu/no_cpu/cpu_asm.h70
-rw-r--r--c/src/exec/score/cpu/no_cpu/no_cpu.h56
-rw-r--r--c/src/exec/score/cpu/no_cpu/no_cputypes.h57
-rw-r--r--c/src/exec/score/cpu/no_cpu/rtems.c45
-rw-r--r--c/src/exec/score/cpu/powerpc/Makefile.in86
-rw-r--r--c/src/exec/score/cpu/powerpc/README78
-rw-r--r--c/src/exec/score/cpu/powerpc/TODO8
-rw-r--r--c/src/exec/score/cpu/powerpc/cpu.c651
-rw-r--r--c/src/exec/score/cpu/powerpc/cpu.h1143
-rw-r--r--c/src/exec/score/cpu/powerpc/cpu_asm.s809
-rw-r--r--c/src/exec/score/cpu/powerpc/irq_stub.s268
-rw-r--r--c/src/exec/score/cpu/powerpc/ppc.h494
-rw-r--r--c/src/exec/score/cpu/powerpc/ppctypes.h74
-rw-r--r--c/src/exec/score/cpu/powerpc/rtems.s132
-rw-r--r--c/src/exec/score/cpu/sh/Makefile.in87
-rw-r--r--c/src/exec/score/cpu/sh/asm.h137
-rw-r--r--c/src/exec/score/cpu/sh/cpu.c232
-rw-r--r--c/src/exec/score/cpu/sh/cpu.h875
-rw-r--r--c/src/exec/score/cpu/sh/cpu_asm.c311
-rw-r--r--c/src/exec/score/cpu/sh/cpu_isps.c252
-rw-r--r--c/src/exec/score/cpu/sh/cpu_isps.h165
-rw-r--r--c/src/exec/score/cpu/sh/iosh7030.h223
-rw-r--r--c/src/exec/score/cpu/sh/ispsh7032.c252
-rw-r--r--c/src/exec/score/cpu/sh/rtems.c71
-rw-r--r--c/src/exec/score/cpu/sh/sh.h186
-rw-r--r--c/src/exec/score/cpu/sh/sh_io.h48
-rw-r--r--c/src/exec/score/cpu/sh/shtypes.h67
-rw-r--r--c/src/exec/score/cpu/sparc/Makefile.in75
-rw-r--r--c/src/exec/score/cpu/sparc/README110
-rw-r--r--c/src/exec/score/cpu/sparc/asm.h123
-rw-r--r--c/src/exec/score/cpu/sparc/cpu.c409
-rw-r--r--c/src/exec/score/cpu/sparc/cpu.h1015
-rw-r--r--c/src/exec/score/cpu/sparc/cpu_asm.s726
-rw-r--r--c/src/exec/score/cpu/sparc/erc32.h521
-rw-r--r--c/src/exec/score/cpu/sparc/rtems.s58
-rw-r--r--c/src/exec/score/cpu/sparc/sparc.h253
-rw-r--r--c/src/exec/score/cpu/sparc/sparctypes.h64
-rw-r--r--c/src/exec/score/cpu/unix/Makefile.in84
-rw-r--r--c/src/exec/score/cpu/unix/cpu.c1117
-rw-r--r--c/src/exec/score/cpu/unix/cpu.h1081
-rw-r--r--c/src/exec/score/cpu/unix/unix.h65
-rw-r--r--c/src/exec/score/cpu/unix/unixtypes.h72
-rw-r--r--c/src/exec/score/headers/Makefile.in44
-rw-r--r--c/src/exec/score/headers/address.h31
-rw-r--r--c/src/exec/score/headers/apiext.h102
-rw-r--r--c/src/exec/score/headers/bitfield.h98
-rw-r--r--c/src/exec/score/headers/chain.h168
-rw-r--r--c/src/exec/score/headers/context.h134
-rw-r--r--c/src/exec/score/headers/copyrt.h42
-rw-r--r--c/src/exec/score/headers/coremsg.h267
-rw-r--r--c/src/exec/score/headers/coremutex.h172
-rw-r--r--c/src/exec/score/headers/coresem.h156
-rw-r--r--c/src/exec/score/headers/debug.h98
-rw-r--r--c/src/exec/score/headers/heap.h226
-rw-r--r--c/src/exec/score/headers/interr.h95
-rw-r--r--c/src/exec/score/headers/isr.h231
-rw-r--r--c/src/exec/score/headers/mpci.h412
-rw-r--r--c/src/exec/score/headers/mppkt.h101
-rw-r--r--c/src/exec/score/headers/object.h397
-rw-r--r--c/src/exec/score/headers/objectmp.h152
-rw-r--r--c/src/exec/score/headers/priority.h97
-rw-r--r--c/src/exec/score/headers/stack.h50
-rw-r--r--c/src/exec/score/headers/states.h84
-rw-r--r--c/src/exec/score/headers/sysstate.h67
-rw-r--r--c/src/exec/score/headers/system.h153
-rw-r--r--c/src/exec/score/headers/thread.h622
-rw-r--r--c/src/exec/score/headers/threadmp.h89
-rw-r--r--c/src/exec/score/headers/threadq.h301
-rw-r--r--c/src/exec/score/headers/tod.h277
-rw-r--r--c/src/exec/score/headers/tqdata.h90
-rw-r--r--c/src/exec/score/headers/userext.h211
-rw-r--r--c/src/exec/score/headers/watchdog.h194
-rw-r--r--c/src/exec/score/headers/wkspace.h71
-rw-r--r--c/src/exec/score/include/rtems/debug.h98
-rw-r--r--c/src/exec/score/include/rtems/score/Makefile.in44
-rw-r--r--c/src/exec/score/include/rtems/score/address.h31
-rw-r--r--c/src/exec/score/include/rtems/score/apiext.h102
-rw-r--r--c/src/exec/score/include/rtems/score/bitfield.h98
-rw-r--r--c/src/exec/score/include/rtems/score/chain.h168
-rw-r--r--c/src/exec/score/include/rtems/score/context.h134
-rw-r--r--c/src/exec/score/include/rtems/score/copyrt.h42
-rw-r--r--c/src/exec/score/include/rtems/score/coremsg.h267
-rw-r--r--c/src/exec/score/include/rtems/score/coremutex.h172
-rw-r--r--c/src/exec/score/include/rtems/score/coresem.h156
-rw-r--r--c/src/exec/score/include/rtems/score/heap.h226
-rw-r--r--c/src/exec/score/include/rtems/score/interr.h95
-rw-r--r--c/src/exec/score/include/rtems/score/isr.h231
-rw-r--r--c/src/exec/score/include/rtems/score/mpci.h412
-rw-r--r--c/src/exec/score/include/rtems/score/mppkt.h101
-rw-r--r--c/src/exec/score/include/rtems/score/object.h397
-rw-r--r--c/src/exec/score/include/rtems/score/objectmp.h152
-rw-r--r--c/src/exec/score/include/rtems/score/priority.h97
-rw-r--r--c/src/exec/score/include/rtems/score/stack.h50
-rw-r--r--c/src/exec/score/include/rtems/score/states.h84
-rw-r--r--c/src/exec/score/include/rtems/score/sysstate.h67
-rw-r--r--c/src/exec/score/include/rtems/score/thread.h622
-rw-r--r--c/src/exec/score/include/rtems/score/threadmp.h89
-rw-r--r--c/src/exec/score/include/rtems/score/threadq.h301
-rw-r--r--c/src/exec/score/include/rtems/score/tod.h277
-rw-r--r--c/src/exec/score/include/rtems/score/tqdata.h90
-rw-r--r--c/src/exec/score/include/rtems/score/userext.h211
-rw-r--r--c/src/exec/score/include/rtems/score/watchdog.h194
-rw-r--r--c/src/exec/score/include/rtems/score/wkspace.h71
-rw-r--r--c/src/exec/score/include/rtems/system.h153
-rw-r--r--c/src/exec/score/inline/Makefile.in32
-rw-r--r--c/src/exec/score/inline/address.inl120
-rw-r--r--c/src/exec/score/inline/chain.inl390
-rw-r--r--c/src/exec/score/inline/coremsg.inl260
-rw-r--r--c/src/exec/score/inline/coremutex.inl124
-rw-r--r--c/src/exec/score/inline/coresem.inl54
-rw-r--r--c/src/exec/score/inline/heap.inl274
-rw-r--r--c/src/exec/score/inline/isr.inl73
-rw-r--r--c/src/exec/score/inline/mppkt.inl58
-rw-r--r--c/src/exec/score/inline/object.inl244
-rw-r--r--c/src/exec/score/inline/objectmp.inl73
-rw-r--r--c/src/exec/score/inline/priority.inl247
-rw-r--r--c/src/exec/score/inline/rtems/score/Makefile.in32
-rw-r--r--c/src/exec/score/inline/rtems/score/address.inl120
-rw-r--r--c/src/exec/score/inline/rtems/score/chain.inl390
-rw-r--r--c/src/exec/score/inline/rtems/score/coremsg.inl260
-rw-r--r--c/src/exec/score/inline/rtems/score/coremutex.inl124
-rw-r--r--c/src/exec/score/inline/rtems/score/coresem.inl54
-rw-r--r--c/src/exec/score/inline/rtems/score/heap.inl274
-rw-r--r--c/src/exec/score/inline/rtems/score/isr.inl73
-rw-r--r--c/src/exec/score/inline/rtems/score/mppkt.inl58
-rw-r--r--c/src/exec/score/inline/rtems/score/object.inl244
-rw-r--r--c/src/exec/score/inline/rtems/score/objectmp.inl73
-rw-r--r--c/src/exec/score/inline/rtems/score/priority.inl247
-rw-r--r--c/src/exec/score/inline/rtems/score/stack.inl81
-rw-r--r--c/src/exec/score/inline/rtems/score/states.inl384
-rw-r--r--c/src/exec/score/inline/rtems/score/sysstate.inl154
-rw-r--r--c/src/exec/score/inline/rtems/score/thread.inl404
-rw-r--r--c/src/exec/score/inline/rtems/score/threadmp.inl61
-rw-r--r--c/src/exec/score/inline/rtems/score/tod.inl67
-rw-r--r--c/src/exec/score/inline/rtems/score/tqdata.inl73
-rw-r--r--c/src/exec/score/inline/rtems/score/userext.inl132
-rw-r--r--c/src/exec/score/inline/rtems/score/watchdog.inl324
-rw-r--r--c/src/exec/score/inline/rtems/score/wkspace.inl57
-rw-r--r--c/src/exec/score/inline/stack.inl81
-rw-r--r--c/src/exec/score/inline/states.inl384
-rw-r--r--c/src/exec/score/inline/sysstate.inl154
-rw-r--r--c/src/exec/score/inline/thread.inl404
-rw-r--r--c/src/exec/score/inline/threadmp.inl61
-rw-r--r--c/src/exec/score/inline/tod.inl67
-rw-r--r--c/src/exec/score/inline/tqdata.inl73
-rw-r--r--c/src/exec/score/inline/userext.inl132
-rw-r--r--c/src/exec/score/inline/watchdog.inl324
-rw-r--r--c/src/exec/score/inline/wkspace.inl57
-rw-r--r--c/src/exec/score/macros/Makefile.in32
-rw-r--r--c/src/exec/score/macros/README18
-rw-r--r--c/src/exec/score/macros/address.inl68
-rw-r--r--c/src/exec/score/macros/chain.inl200
-rw-r--r--c/src/exec/score/macros/coremsg.inl143
-rw-r--r--c/src/exec/score/macros/coremutex.inl77
-rw-r--r--c/src/exec/score/macros/coresem.inl40
-rw-r--r--c/src/exec/score/macros/heap.inl150
-rw-r--r--c/src/exec/score/macros/isr.inl48
-rw-r--r--c/src/exec/score/macros/mppkt.inl41
-rw-r--r--c/src/exec/score/macros/object.inl148
-rw-r--r--c/src/exec/score/macros/objectmp.inl50
-rw-r--r--c/src/exec/score/macros/priority.inl170
-rw-r--r--c/src/exec/score/macros/rtems/score/Makefile.in32
-rw-r--r--c/src/exec/score/macros/rtems/score/README18
-rw-r--r--c/src/exec/score/macros/rtems/score/address.inl68
-rw-r--r--c/src/exec/score/macros/rtems/score/chain.inl200
-rw-r--r--c/src/exec/score/macros/rtems/score/coremsg.inl143
-rw-r--r--c/src/exec/score/macros/rtems/score/coremutex.inl77
-rw-r--r--c/src/exec/score/macros/rtems/score/coresem.inl40
-rw-r--r--c/src/exec/score/macros/rtems/score/heap.inl150
-rw-r--r--c/src/exec/score/macros/rtems/score/isr.inl48
-rw-r--r--c/src/exec/score/macros/rtems/score/mppkt.inl41
-rw-r--r--c/src/exec/score/macros/rtems/score/object.inl148
-rw-r--r--c/src/exec/score/macros/rtems/score/objectmp.inl50
-rw-r--r--c/src/exec/score/macros/rtems/score/priority.inl170
-rw-r--r--c/src/exec/score/macros/rtems/score/stack.inl50
-rw-r--r--c/src/exec/score/macros/rtems/score/states.inl210
-rw-r--r--c/src/exec/score/macros/rtems/score/sysstate.inl90
-rw-r--r--c/src/exec/score/macros/rtems/score/thread.inl217
-rw-r--r--c/src/exec/score/macros/rtems/score/threadmp.inl50
-rw-r--r--c/src/exec/score/macros/rtems/score/tod.inl49
-rw-r--r--c/src/exec/score/macros/rtems/score/tqdata.inl50
-rw-r--r--c/src/exec/score/macros/rtems/score/userext.inl126
-rw-r--r--c/src/exec/score/macros/rtems/score/watchdog.inl172
-rw-r--r--c/src/exec/score/macros/rtems/score/wkspace.inl39
-rw-r--r--c/src/exec/score/macros/stack.inl50
-rw-r--r--c/src/exec/score/macros/states.inl210
-rw-r--r--c/src/exec/score/macros/sysstate.inl90
-rw-r--r--c/src/exec/score/macros/thread.inl217
-rw-r--r--c/src/exec/score/macros/threadmp.inl50
-rw-r--r--c/src/exec/score/macros/tod.inl49
-rw-r--r--c/src/exec/score/macros/tqdata.inl50
-rw-r--r--c/src/exec/score/macros/userext.inl126
-rw-r--r--c/src/exec/score/macros/watchdog.inl172
-rw-r--r--c/src/exec/score/macros/wkspace.inl39
-rw-r--r--c/src/exec/score/src/Makefile.in42
-rw-r--r--c/src/exec/score/src/apiext.c105
-rw-r--r--c/src/exec/score/src/chain.c202
-rw-r--r--c/src/exec/score/src/coremsg.c432
-rw-r--r--c/src/exec/score/src/coremutex.c348
-rw-r--r--c/src/exec/score/src/coresem.c184
-rw-r--r--c/src/exec/score/src/coretod.c238
-rw-r--r--c/src/exec/score/src/heap.c538
-rw-r--r--c/src/exec/score/src/interr.c61
-rw-r--r--c/src/exec/score/src/isr.c60
-rw-r--r--c/src/exec/score/src/mpci.c525
-rw-r--r--c/src/exec/score/src/object.c516
-rw-r--r--c/src/exec/score/src/objectmp.c275
-rw-r--r--c/src/exec/score/src/thread.c1396
-rw-r--r--c/src/exec/score/src/threadmp.c164
-rw-r--r--c/src/exec/score/src/threadq.c967
-rw-r--r--c/src/exec/score/src/tod.c238
-rw-r--r--c/src/exec/score/src/userext.c204
-rw-r--r--c/src/exec/score/src/watchdog.c273
-rw-r--r--c/src/exec/score/src/wkspace.c88
-rw-r--r--c/src/exec/score/tools/Makefile.in14
-rw-r--r--c/src/exec/score/tools/generic/Makefile.in36
-rw-r--r--c/src/exec/score/tools/generic/size_rtems.in276
-rw-r--r--c/src/exec/score/tools/hppa1.1/Makefile.in64
-rw-r--r--c/src/exec/score/tools/hppa1.1/genoffsets.c348
-rw-r--r--c/src/exec/score/tools/sh/AUTHORS3
-rw-r--r--c/src/exec/score/tools/sh/COPYING19
-rw-r--r--c/src/exec/score/tools/sh/Makefile.in62
-rw-r--r--c/src/exec/score/tools/sh/TODO13
-rw-r--r--c/src/exec/score/tools/sh/sci.c157
-rw-r--r--c/src/exec/score/tools/sh/sci.h11
-rw-r--r--c/src/exec/score/tools/sh/shgen.c65
-rw-r--r--c/src/exec/score/tools/unix/Makefile.in58
-rw-r--r--c/src/exec/score/tools/unix/gensize.c116
-rw-r--r--c/src/exec/wrapup/Makefile.in18
-rw-r--r--c/src/exec/wrapup/posix/Makefile.in52
-rw-r--r--c/src/exec/wrapup/rtems/Makefile.in52
-rw-r--r--c/src/lib/Makefile.in29
-rw-r--r--c/src/lib/include/Makefile.in44
-rw-r--r--c/src/lib/include/chain.h362
-rw-r--r--c/src/lib/include/clockdrv.h51
-rw-r--r--c/src/lib/include/console.h73
-rw-r--r--c/src/lib/include/iosupp.h44
-rw-r--r--c/src/lib/include/motorola/mc68230.h71
-rw-r--r--c/src/lib/include/motorola/mc68681.h306
-rw-r--r--c/src/lib/include/ringbuf.h53
-rw-r--r--c/src/lib/include/rtems++/rtemsEvent.h127
-rw-r--r--c/src/lib/include/rtems++/rtemsInterrupt.h105
-rw-r--r--c/src/lib/include/rtems++/rtemsMessageQueue.h176
-rw-r--r--c/src/lib/include/rtems++/rtemsSemaphore.h145
-rw-r--r--c/src/lib/include/rtems++/rtemsStatusCode.h57
-rw-r--r--c/src/lib/include/rtems++/rtemsTask.h171
-rw-r--r--c/src/lib/include/rtems++/rtemsTaskMode.h210
-rw-r--r--c/src/lib/include/rtems++/rtemsTimer.h145
-rw-r--r--c/src/lib/include/rtems/assoc.h42
-rw-r--r--c/src/lib/include/rtems/error.h38
-rw-r--r--c/src/lib/include/rtems/libcsupport.h43
-rw-r--r--c/src/lib/include/rtems/libio.h166
-rw-r--r--c/src/lib/include/spurious.h38
-rw-r--r--c/src/lib/include/sys/filio.h56
-rw-r--r--c/src/lib/include/sys/ioctl.h77
-rw-r--r--c/src/lib/include/sys/sockio.h86
-rw-r--r--c/src/lib/include/sys/termios.h190
-rw-r--r--c/src/lib/include/sys/utsname.h49
-rw-r--r--c/src/lib/include/timerdrv.h40
-rw-r--r--c/src/lib/include/vmeintr.h58
-rw-r--r--c/src/lib/include/zilog/z8036.h109
-rw-r--r--c/src/lib/include/zilog/z8530.h99
-rw-r--r--c/src/lib/include/zilog/z8536.h112
-rw-r--r--c/src/lib/libbsp/Makefile.in31
-rw-r--r--c/src/lib/libbsp/README46
-rw-r--r--c/src/lib/libbsp/a29k/Makefile.in15
-rw-r--r--c/src/lib/libbsp/a29k/portsw/Makefile.in20
-rw-r--r--c/src/lib/libbsp/a29k/portsw/README71
-rw-r--r--c/src/lib/libbsp/a29k/portsw/console/Makefile.in59
-rw-r--r--c/src/lib/libbsp/a29k/portsw/console/concntl.h16
-rw-r--r--c/src/lib/libbsp/a29k/portsw/console/console.c301
-rw-r--r--c/src/lib/libbsp/a29k/portsw/console/serial.c217
-rw-r--r--c/src/lib/libbsp/a29k/portsw/console/serial.h8
-rw-r--r--c/src/lib/libbsp/a29k/portsw/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/a29k/portsw/include/bsp.h100
-rw-r--r--c/src/lib/libbsp/a29k/portsw/include/coverhd.h115
-rw-r--r--c/src/lib/libbsp/a29k/portsw/shmsupp/Makefile.in60
-rw-r--r--c/src/lib/libbsp/a29k/portsw/shmsupp/addrconv.c35
-rw-r--r--c/src/lib/libbsp/a29k/portsw/shmsupp/getcfg.c81
-rw-r--r--c/src/lib/libbsp/a29k/portsw/shmsupp/lock.c90
-rw-r--r--c/src/lib/libbsp/a29k/portsw/shmsupp/mpisr.c51
-rw-r--r--c/src/lib/libbsp/a29k/portsw/start/Makefile.in54
-rw-r--r--c/src/lib/libbsp/a29k/portsw/start/amd.ah517
-rw-r--r--c/src/lib/libbsp/a29k/portsw/start/pswmacro.ah442
-rw-r--r--c/src/lib/libbsp/a29k/portsw/start/register.ah214
-rw-r--r--c/src/lib/libbsp/a29k/portsw/startup/Makefile.in60
-rw-r--r--c/src/lib/libbsp/a29k/portsw/startup/bspclean.c30
-rw-r--r--c/src/lib/libbsp/a29k/portsw/startup/bspstart.c164
-rw-r--r--c/src/lib/libbsp/a29k/portsw/startup/iface.c96
-rw-r--r--c/src/lib/libbsp/a29k/portsw/startup/main.c39
-rw-r--r--c/src/lib/libbsp/a29k/portsw/startup/ramlink11
-rw-r--r--c/src/lib/libbsp/a29k/portsw/startup/romlink146
-rw-r--r--c/src/lib/libbsp/a29k/portsw/startup/setvec.c49
-rw-r--r--c/src/lib/libbsp/a29k/portsw/times195
-rw-r--r--c/src/lib/libbsp/a29k/portsw/wrapup/Makefile.in51
-rw-r--r--c/src/lib/libbsp/bare/Makefile.in20
-rw-r--r--c/src/lib/libbsp/bare/README117
-rw-r--r--c/src/lib/libbsp/bare/bsp_specs23
-rw-r--r--c/src/lib/libbsp/bare/build-tools71
-rw-r--r--c/src/lib/libbsp/bare/do-bare-bsp-build177
-rw-r--r--c/src/lib/libbsp/bare/include/Makefile.in34
-rw-r--r--c/src/lib/libbsp/bare/include/bsp.h92
-rw-r--r--c/src/lib/libbsp/bare/wrapup/Makefile.in49
-rw-r--r--c/src/lib/libbsp/hppa1.1/Makefile.in15
-rw-r--r--c/src/lib/libbsp/hppa1.1/pxfl/Makefile.in50
-rw-r--r--c/src/lib/libbsp/hppa1.1/pxfl/README8
-rw-r--r--c/src/lib/libbsp/hppa1.1/pxfl/floss-bsp.h11
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/Makefile.in17
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/bsp_specs22
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/include/Makefile.in41
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h114
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/include/coverhd.h104
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/include/ttydrv.h54
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/Makefile.in55
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/README9
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/addrconv.c30
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/getcfg.c89
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/intr.c51
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/lock.c75
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/mpisr.c27
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/start/Makefile.in54
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/start/start.s169
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/startup/Makefile.in53
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/startup/bspclean.c36
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c251
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/startup/setvec.c66
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/times7
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/tools/Makefile.in52
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/tools/print_dump.c338
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/tty/Makefile.in55
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/tty/tty.c247
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/wrapup/Makefile.in54
-rw-r--r--c/src/lib/libbsp/i386/Makefile.in15
-rw-r--r--c/src/lib/libbsp/i386/force386/Makefile.in16
-rw-r--r--c/src/lib/libbsp/i386/force386/bsp_specs23
-rw-r--r--c/src/lib/libbsp/i386/force386/clock/Makefile.in55
-rw-r--r--c/src/lib/libbsp/i386/force386/clock/ckinit.c135
-rw-r--r--c/src/lib/libbsp/i386/force386/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/i386/force386/console/console.c285
-rw-r--r--c/src/lib/libbsp/i386/force386/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/i386/force386/include/bsp.h173
-rw-r--r--c/src/lib/libbsp/i386/force386/include/coverhd.h104
-rw-r--r--c/src/lib/libbsp/i386/force386/shmsupp/Makefile.in55
-rw-r--r--c/src/lib/libbsp/i386/force386/shmsupp/addrconv.c32
-rw-r--r--c/src/lib/libbsp/i386/force386/shmsupp/getcfg.c73
-rw-r--r--c/src/lib/libbsp/i386/force386/shmsupp/lock.c83
-rw-r--r--c/src/lib/libbsp/i386/force386/shmsupp/mpisr.c31
-rw-r--r--c/src/lib/libbsp/i386/force386/start/Makefile.in57
-rw-r--r--c/src/lib/libbsp/i386/force386/start/start.s267
-rw-r--r--c/src/lib/libbsp/i386/force386/startup/Makefile.in59
-rw-r--r--c/src/lib/libbsp/i386/force386/startup/bspstart.c103
-rw-r--r--c/src/lib/libbsp/i386/force386/startup/exit.c29
-rw-r--r--c/src/lib/libbsp/i386/force386/startup/ldsegs.s86
-rw-r--r--c/src/lib/libbsp/i386/force386/startup/linkcmds71
-rw-r--r--c/src/lib/libbsp/i386/force386/startup/setvec.c59
-rw-r--r--c/src/lib/libbsp/i386/force386/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/i386/force386/timer/timer.c96
-rw-r--r--c/src/lib/libbsp/i386/force386/timer/timerisr.s34
-rw-r--r--c/src/lib/libbsp/i386/force386/times191
-rw-r--r--c/src/lib/libbsp/i386/force386/wrapup/Makefile.in49
-rw-r--r--c/src/lib/libbsp/i386/go32/Makefile.in16
-rw-r--r--c/src/lib/libbsp/i386/go32/README38
-rw-r--r--c/src/lib/libbsp/i386/go32/bsp_specs20
-rw-r--r--c/src/lib/libbsp/i386/go32/clock/Makefile.in55
-rw-r--r--c/src/lib/libbsp/i386/go32/clock/ckinit.c199
-rw-r--r--c/src/lib/libbsp/i386/go32/clock/rtc.c212
-rw-r--r--c/src/lib/libbsp/i386/go32/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/i386/go32/console/console.c256
-rw-r--r--c/src/lib/libbsp/i386/go32/console/inch.c162
-rw-r--r--c/src/lib/libbsp/i386/go32/console/outch.c151
-rw-r--r--c/src/lib/libbsp/i386/go32/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/i386/go32/include/bsp.h166
-rw-r--r--c/src/lib/libbsp/i386/go32/include/coverhd.h104
-rw-r--r--c/src/lib/libbsp/i386/go32/startup/Makefile.in55
-rw-r--r--c/src/lib/libbsp/i386/go32/startup/bspstart.c135
-rw-r--r--c/src/lib/libbsp/i386/go32/startup/exit.c30
-rw-r--r--c/src/lib/libbsp/i386/go32/startup/setvec.c46
-rw-r--r--c/src/lib/libbsp/i386/go32/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/i386/go32/timer/timer.c144
-rw-r--r--c/src/lib/libbsp/i386/go32/timer/timerisr.s41
-rw-r--r--c/src/lib/libbsp/i386/go32/times_i486dx191
-rw-r--r--c/src/lib/libbsp/i386/go32/times_p5196
-rw-r--r--c/src/lib/libbsp/i386/go32/wrapup/Makefile.in51
-rw-r--r--c/src/lib/libbsp/i386/i386ex/Makefile.in19
-rw-r--r--c/src/lib/libbsp/i386/i386ex/README27
-rw-r--r--c/src/lib/libbsp/i386/i386ex/bsp_specs23
-rw-r--r--c/src/lib/libbsp/i386/i386ex/clock/Makefile.in60
-rw-r--r--c/src/lib/libbsp/i386/i386ex/clock/ckinit.c172
-rw-r--r--c/src/lib/libbsp/i386/i386ex/console/Makefile.in63
-rw-r--r--c/src/lib/libbsp/i386/i386ex/console/console.c401
-rw-r--r--c/src/lib/libbsp/i386/i386ex/include/Makefile.in35
-rw-r--r--c/src/lib/libbsp/i386/i386ex/include/bsp.h143
-rw-r--r--c/src/lib/libbsp/i386/i386ex/include/coverhd.h104
-rw-r--r--c/src/lib/libbsp/i386/i386ex/start/80386ex.h254
-rw-r--r--c/src/lib/libbsp/i386/i386ex/start/80386ex.inc252
-rw-r--r--c/src/lib/libbsp/i386/i386ex/start/Makefile.in61
-rw-r--r--c/src/lib/libbsp/i386/i386ex/start/macros.inc115
-rw-r--r--c/src/lib/libbsp/i386/i386ex/start/start.s437
-rw-r--r--c/src/lib/libbsp/i386/i386ex/startup/Makefile.in69
-rw-r--r--c/src/lib/libbsp/i386/i386ex/startup/README17
-rw-r--r--c/src/lib/libbsp/i386/i386ex/startup/bspstart.c132
-rw-r--r--c/src/lib/libbsp/i386/i386ex/startup/linkcmds149
-rw-r--r--c/src/lib/libbsp/i386/i386ex/startup/setvec.c55
-rw-r--r--c/src/lib/libbsp/i386/i386ex/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/i386/i386ex/timer/timer.c149
-rw-r--r--c/src/lib/libbsp/i386/i386ex/timer/timerisr.s40
-rw-r--r--c/src/lib/libbsp/i386/i386ex/wrapup/Makefile.in51
-rw-r--r--c/src/lib/libbsp/i386/pc386/HOWTO308
-rw-r--r--c/src/lib/libbsp/i386/pc386/Makefile.in21
-rw-r--r--c/src/lib/libbsp/i386/pc386/README64
-rw-r--r--c/src/lib/libbsp/i386/pc386/STATUS25
-rw-r--r--c/src/lib/libbsp/i386/pc386/bsp_specs23
-rw-r--r--c/src/lib/libbsp/i386/pc386/clock/Makefile.in55
-rw-r--r--c/src/lib/libbsp/i386/pc386/clock/ckinit.c281
-rw-r--r--c/src/lib/libbsp/i386/pc386/clock/rtc.c226
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/Makefile.in59
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/console.c507
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/inch.c333
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/outch.c181
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/videoAsm.s51
-rw-r--r--c/src/lib/libbsp/i386/pc386/include/Makefile.in39
-rw-r--r--c/src/lib/libbsp/i386/pc386/include/bsp.h195
-rw-r--r--c/src/lib/libbsp/i386/pc386/include/coverhd.h104
-rw-r--r--c/src/lib/libbsp/i386/pc386/include/crt.h90
-rw-r--r--c/src/lib/libbsp/i386/pc386/include/wd80x3.h123
-rw-r--r--c/src/lib/libbsp/i386/pc386/network/Makefile.in55
-rw-r--r--c/src/lib/libbsp/i386/pc386/network/network.c657
-rw-r--r--c/src/lib/libbsp/i386/pc386/start/Makefile.in72
-rw-r--r--c/src/lib/libbsp/i386/pc386/start/start.s202
-rw-r--r--c/src/lib/libbsp/i386/pc386/start/start16.s183
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/Makefile.in59
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/bspstart.c209
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/exit.c61
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/ldsegs.s222
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/linkcmds87
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/sbrk.c52
-rw-r--r--c/src/lib/libbsp/i386/pc386/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/i386/pc386/timer/timer.c394
-rw-r--r--c/src/lib/libbsp/i386/pc386/timer/timerisr.s61
-rw-r--r--c/src/lib/libbsp/i386/pc386/times_i486dx191
-rw-r--r--c/src/lib/libbsp/i386/pc386/times_p5196
-rw-r--r--c/src/lib/libbsp/i386/pc386/tools/Makefile.in75
-rw-r--r--c/src/lib/libbsp/i386/pc386/tools/Spec.doc357
-rw-r--r--c/src/lib/libbsp/i386/pc386/tools/bin2boot.c414
-rw-r--r--c/src/lib/libbsp/i386/pc386/tools/binpatch.c168
-rw-r--r--c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in59
-rw-r--r--c/src/lib/libbsp/i386/shared/Makefile.in16
-rw-r--r--c/src/lib/libbsp/i386/shared/comm/GDB.HOWTO177
-rw-r--r--c/src/lib/libbsp/i386/shared/comm/Makefile.in33
-rw-r--r--c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c194
-rw-r--r--c/src/lib/libbsp/i386/shared/comm/i386-stub.c989
-rw-r--r--c/src/lib/libbsp/i386/shared/comm/uart.c935
-rw-r--r--c/src/lib/libbsp/i386/shared/comm/uart.h169
-rw-r--r--c/src/lib/libbsp/i386/shared/io/Makefile.in33
-rw-r--r--c/src/lib/libbsp/i386/shared/io/bspIo.h37
-rw-r--r--c/src/lib/libbsp/i386/shared/io/printk.c121
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/Makefile.in33
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/idt.c288
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq.c379
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq.h261
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq_asm.h30
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq_asm.s250
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq_init.c211
-rw-r--r--c/src/lib/libbsp/i386/shared/pci/Makefile.in32
-rw-r--r--c/src/lib/libbsp/i386/shared/pci/pcibios.c499
-rw-r--r--c/src/lib/libbsp/i386/shared/pci/pcibios.h46
-rw-r--r--c/src/lib/libbsp/i960/Makefile.in15
-rw-r--r--c/src/lib/libbsp/i960/cvme961/Makefile.in16
-rw-r--r--c/src/lib/libbsp/i960/cvme961/bsp_specs23
-rw-r--r--c/src/lib/libbsp/i960/cvme961/clock/Makefile.in54
-rw-r--r--c/src/lib/libbsp/i960/cvme961/clock/ckinit.c141
-rw-r--r--c/src/lib/libbsp/i960/cvme961/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/i960/cvme961/console/console.c211
-rw-r--r--c/src/lib/libbsp/i960/cvme961/include/Makefile.in38
-rw-r--r--c/src/lib/libbsp/i960/cvme961/include/bsp.h143
-rw-r--r--c/src/lib/libbsp/i960/cvme961/include/coverhd.h104
-rw-r--r--c/src/lib/libbsp/i960/cvme961/shmsupp/Makefile.in55
-rw-r--r--c/src/lib/libbsp/i960/cvme961/shmsupp/addrconv.c37
-rw-r--r--c/src/lib/libbsp/i960/cvme961/shmsupp/getcfg.c98
-rw-r--r--c/src/lib/libbsp/i960/cvme961/shmsupp/lock.c76
-rw-r--r--c/src/lib/libbsp/i960/cvme961/shmsupp/mpisr.c70
-rw-r--r--c/src/lib/libbsp/i960/cvme961/start/Makefile.in54
-rw-r--r--c/src/lib/libbsp/i960/cvme961/startup/Makefile.in56
-rw-r--r--c/src/lib/libbsp/i960/cvme961/startup/bspclean.c36
-rw-r--r--c/src/lib/libbsp/i960/cvme961/startup/bspstart.c116
-rw-r--r--c/src/lib/libbsp/i960/cvme961/startup/exit.c38
-rw-r--r--c/src/lib/libbsp/i960/cvme961/startup/linkcmds66
-rw-r--r--c/src/lib/libbsp/i960/cvme961/startup/setvec.c145
-rw-r--r--c/src/lib/libbsp/i960/cvme961/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/i960/cvme961/timer/timer.c107
-rw-r--r--c/src/lib/libbsp/i960/cvme961/timer/timerisr.s65
-rw-r--r--c/src/lib/libbsp/i960/cvme961/times191
-rw-r--r--c/src/lib/libbsp/i960/cvme961/wrapup/Makefile.in51
-rw-r--r--c/src/lib/libbsp/m68k/Makefile.in15
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/Makefile.in16
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/bsp_specs23
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/clock/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/clock/ckinit.c162
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/console/console.c248
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/include/bsp.h172
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/include/coverhd.h104
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/spurious/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/spurious/spinit.c48
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in53
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/startup/bspclean.c21
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c136
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/startup/linkcmds71
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/startup/vmeintr.c60
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/timer/timer.c105
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/timer/timerisr.s38
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/times195
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/wrapup/Makefile.in49
-rw-r--r--c/src/lib/libbsp/m68k/efi332/Makefile.in16
-rw-r--r--c/src/lib/libbsp/m68k/efi332/README36
-rw-r--r--c/src/lib/libbsp/m68k/efi332/bsp_specs23
-rw-r--r--c/src/lib/libbsp/m68k/efi332/clock/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/efi332/clock/ckinit.c137
-rw-r--r--c/src/lib/libbsp/m68k/efi332/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/efi332/console/console.c393
-rw-r--r--c/src/lib/libbsp/m68k/efi332/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/m68k/efi332/include/bsp.h158
-rw-r--r--c/src/lib/libbsp/m68k/efi332/include/coverhd.h106
-rw-r--r--c/src/lib/libbsp/m68k/efi332/include/efi332.h54
-rw-r--r--c/src/lib/libbsp/m68k/efi332/misc/dotests15
-rw-r--r--c/src/lib/libbsp/m68k/efi332/misc/gdbinit6816
-rw-r--r--c/src/lib/libbsp/m68k/efi332/misc/interr.c95
-rw-r--r--c/src/lib/libbsp/m68k/efi332/spurious/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/efi332/spurious/spinit.c88
-rw-r--r--c/src/lib/libbsp/m68k/efi332/start/Makefile.in49
-rw-r--r--c/src/lib/libbsp/m68k/efi332/start/start.c192
-rw-r--r--c/src/lib/libbsp/m68k/efi332/start332/Makefile.in49
-rw-r--r--c/src/lib/libbsp/m68k/efi332/start332/start332.c192
-rw-r--r--c/src/lib/libbsp/m68k/efi332/startup/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/efi332/startup/bspclean.c28
-rw-r--r--c/src/lib/libbsp/m68k/efi332/startup/bspstart.c105
-rw-r--r--c/src/lib/libbsp/m68k/efi332/startup/except_vect_332_ROM.S290
-rw-r--r--c/src/lib/libbsp/m68k/efi332/startup/linkcmds105
-rw-r--r--c/src/lib/libbsp/m68k/efi332/startup/linkcmds_ROM110
-rw-r--r--c/src/lib/libbsp/m68k/efi332/timer/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/efi332/timer/timer.c84
-rw-r--r--c/src/lib/libbsp/m68k/efi332/times193
-rw-r--r--c/src/lib/libbsp/m68k/efi332/wrapup/Makefile.in49
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/Makefile.in16
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/README41
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/bsp_specs23
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/clock/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/clock/ckinit.c157
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/console/console.c365
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/include/16550.h110
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/include/DP8570A.h275
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/include/Makefile.in34
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/include/bsp.h164
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/include/coverhd.h106
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/include/efi68k.h34
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/spurious/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/spurious/spinit.c85
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/start/Makefile.in49
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/start/start.c71
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/start68k/Makefile.in49
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/start68k/start68k.c71
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/startup/bspclean.c28
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c113
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/startup/efi68k_tcp.c238
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/startup/efi68k_wd.c45
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/startup/linkcmds113
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/startup/m68k-stub.c782
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/startup/setvec.c45
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/timer/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/timer/timer.c141
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/times193
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/wrapup/Makefile.in49
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/Makefile.in20
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/README154
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/bsp_specs23
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/clock/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/clock/ckinit.c162
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/console/console.c303
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/include/bsp.h119
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/include/coverhd.h115
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/start/Makefile.in57
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/start/start302.s267
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/start302/Makefile.in57
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/start302/start302.s267
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/startup/bspclean.c26
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c111
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/startup/linkcmds64
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/timer/timer.c130
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/timer/timerisr.s28
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/times193
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/wrapup/Makefile.in49
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/Makefile.in20
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/README86
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/bsp_specs23
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/clock/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/clock/ckinit.c185
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/console/Makefile.in59
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/console/Modif_cpu_asm.s184
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/console/console.c711
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/console/m340uart.c409
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/include/bsp.h123
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/include/coverhd.h76
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/include/m340timer.h82
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/include/m340uart.h159
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/include/m68340.h140
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/include/m68340.inc148
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/include/m68349.inc410
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/start/Makefile.in57
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/start/start340.s874
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/start/startfor340only.s499
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/start340/Makefile.in57
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/start340/start340.s874
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/start340/startfor340only.s499
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/startup/Makefile.in56
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/startup/bspclean.c27
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c118
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/startup/dumpanic.c193
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/startup/init68340.c39
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/startup/linkcmds155
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/timer/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/timer/timer.c289
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/wrapup/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/Makefile.in25
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/README301
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/bsp_specs23
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/clock/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/clock/ckinit.c171
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/console/console.c407
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/include/bsp.h145
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/include/coverhd.h76
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/network/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/network/network.c950
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/start/Makefile.in57
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/start/start360.s432
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/start360/Makefile.in57
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/start360/start360.s432
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/startup/Makefile.in56
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/startup/alloc360.c96
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/startup/bspclean.c27
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c113
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/startup/init68360.c524
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/startup/linkcmds120
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp125
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom124
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/timer/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/timer/timer.c95
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile.in58
-rw-r--r--c/src/lib/libbsp/m68k/idp/Makefile.in16
-rw-r--r--c/src/lib/libbsp/m68k/idp/README35
-rw-r--r--c/src/lib/libbsp/m68k/idp/bsp_specs23
-rw-r--r--c/src/lib/libbsp/m68k/idp/clock/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/idp/clock/ckinit.c199
-rw-r--r--c/src/lib/libbsp/m68k/idp/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/idp/console/console.c283
-rw-r--r--c/src/lib/libbsp/m68k/idp/console/duart.c270
-rw-r--r--c/src/lib/libbsp/m68k/idp/console/leds.c83
-rw-r--r--c/src/lib/libbsp/m68k/idp/console/mc68ec.c21
-rw-r--r--c/src/lib/libbsp/m68k/idp/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/m68k/idp/include/README13
-rw-r--r--c/src/lib/libbsp/m68k/idp/include/bsp.h93
-rw-r--r--c/src/lib/libbsp/m68k/idp/include/coverhd.h106
-rw-r--r--c/src/lib/libbsp/m68k/idp/include/leds.h27
-rw-r--r--c/src/lib/libbsp/m68k/idp/startup/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/idp/startup/bspstart.c136
-rw-r--r--c/src/lib/libbsp/m68k/idp/startup/linkcmds70
-rw-r--r--c/src/lib/libbsp/m68k/idp/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/m68k/idp/timer/timer.c120
-rw-r--r--c/src/lib/libbsp/m68k/idp/timer/timerisr.s38
-rw-r--r--c/src/lib/libbsp/m68k/idp/times193
-rw-r--r--c/src/lib/libbsp/m68k/idp/wrapup/Makefile.in49
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/Makefile.in16
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/bsp_specs23
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/clock/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/clock/ckinit.c173
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/console/console.c223
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/include/bsp.h156
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/include/coverhd.h104
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/shmsupp/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/shmsupp/addrconv.c32
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/shmsupp/getcfg.c85
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/shmsupp/lock.c75
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/shmsupp/mpisr.c42
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/startup/bspclean.c46
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c116
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/startup/linkcmds70
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/timer/timer.c107
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/timer/timerisr.s39
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/times191
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/wrapup/Makefile.in49
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/Makefile.in16
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/README86
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/bsp_specs23
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/clock/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/clock/ckinit.c142
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/console/console.c257
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/include/bsp.h183
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/include/coverhd.h104
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/startup/bspclean.c45
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c122
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/startup/linkcmds75
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/timer/timer.c84
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/timer/timerisr.s28
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/times194
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/wrapup/Makefile.in49
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/Makefile.in17
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/README92
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/bsp_specs23
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/clock/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/include/bsp.h247
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/include/coverhd.h104
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/shmsupp/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/shmsupp/addrconv.c36
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/shmsupp/getcfg.c87
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/shmsupp/lock.c75
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/shmsupp/mpisr.c46
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c181
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds75
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/times194
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/wrapup/Makefile.in49
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/Makefile.in28
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/README163
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/bsp_specs26
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/clock/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/clock/ckinit.c146
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/console/console.c255
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/consolex/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/consolex/README97
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/consolex/cTest.c75
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/consolex/consolex.c798
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/consolex/consolex.h94
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/include/Makefile.in34
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/include/bsp.h294
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/include/coverhd.h104
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/include/page_table.h45
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/include/tod.h42
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c61
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c138
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/startup/linkcmds73
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/startup/page_table.c202
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/timer/timer.c93
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/timer/timerisr.s47
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/times193
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/tod/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/tod/tod.c90
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/tools/Makefile.in53
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/tools/sload.c511
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/wrapup/Makefile.in55
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/Makefile.in20
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/README81
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/bsp_specs23
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/clock/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/clock/ckinit.c162
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/console/console.c220
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/include/Makefile.in36
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/include/bare.h246
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/include/bsp.h133
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/include/coverhd.h115
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/include/crc.h26
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/include/debugport.h42
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/include/m68302scc.h34
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/start/Makefile.in69
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/start/cpuboot.c133
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/start/debugreset.S107
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/start/reset.S881
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/start302/Makefile.in69
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/start302/cpuboot.c133
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/start302/debugreset.S107
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/start302/reset.S881
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in60
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/bspclean.c26
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c110
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c133
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/crc.c88
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/debugger54
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/debugport.c163
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c76
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/linkcmds60
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/m68302scc.c159
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c1086
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c33
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/rom56
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/trace.c175
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/timer/timer.c130
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/timer/timerisr.s28
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/wrapup/Makefile.in49
-rw-r--r--c/src/lib/libbsp/m68k/shared/setvec.c39
-rw-r--r--c/src/lib/libbsp/mips/README7
-rw-r--r--c/src/lib/libbsp/mips/p4000/README47
-rw-r--r--c/src/lib/libbsp/mips/p4000/bsp_specs23
-rw-r--r--c/src/lib/libbsp/mips/p4000/console/console.c275
-rw-r--r--c/src/lib/libbsp/mips/p4000/console/led.S23
-rw-r--r--c/src/lib/libbsp/mips/p4000/include/bsp.h118
-rw-r--r--c/src/lib/libbsp/mips/p4000/include/coverhd.h116
-rw-r--r--c/src/lib/libbsp/mips/p4000/liblnk/lnklib.S62
-rw-r--r--c/src/lib/libbsp/mips/p4000/start/start.S299
-rw-r--r--c/src/lib/libbsp/mips/p4000/startup/bspclean.c38
-rw-r--r--c/src/lib/libbsp/mips/p4000/startup/bspstart.c119
-rw-r--r--c/src/lib/libbsp/mips/p4000/startup/ghlinkcmds19
-rw-r--r--c/src/lib/libbsp/mips/p4000/startup/idtmem.S938
-rw-r--r--c/src/lib/libbsp/mips/p4000/startup/idttlb.S390
-rw-r--r--c/src/lib/libbsp/mips/p4000/startup/inittlb.c16
-rw-r--r--c/src/lib/libbsp/mips/p4000/startup/linkcmds72
-rw-r--r--c/src/lib/libbsp/mips/p4000/startup/setvec.c53
-rw-r--r--c/src/lib/libbsp/mips/p4000/times200
-rw-r--r--c/src/lib/libbsp/mips64orion/Makefile.in15
-rw-r--r--c/src/lib/libbsp/mips64orion/README7
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/Makefile.in20
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/README47
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/bsp_specs23
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/console/Makefile.in59
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/console/console.c275
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/console/led.S23
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/include/bsp.h118
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/include/coverhd.h116
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/liblnk/Makefile.in59
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/liblnk/lnklib.S62
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/start/Makefile.in54
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/start/start.S299
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/startup/Makefile.in62
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/startup/bspclean.c38
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/startup/bspstart.c119
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/startup/ghlinkcmds19
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/startup/idtmem.S938
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/startup/idttlb.S390
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/startup/inittlb.c16
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/startup/linkcmds72
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/startup/setvec.c53
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/times200
-rw-r--r--c/src/lib/libbsp/mips64orion/p4000/wrapup/Makefile.in53
-rw-r--r--c/src/lib/libbsp/no_cpu/Makefile.in15
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/Makefile.in20
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/README69
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/clock/Makefile.in59
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c191
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/console/Makefile.in59
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/console/console.c222
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h99
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/include/coverhd.h115
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/Makefile.in60
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/addrconv.c31
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/getcfg.c77
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/lock.c86
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/mpisr.c47
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/startup/Makefile.in61
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/startup/bspclean.c26
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c106
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/startup/linkcmds64
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/startup/main.c38
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/startup/setvec.c44
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/timer/Makefile.in61
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/timer/timer.c105
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/timer/timerisr.c37
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/times194
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/wrapup/Makefile.in49
-rw-r--r--c/src/lib/libbsp/powerpc/Makefile.in15
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/Makefile.in25
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/QUIRKS74
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/README49
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/README.net44
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/STATUS82
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/bsp_specs23
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/cable.doc97
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/clock/Makefile.in59
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/clock/clock.c246
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/console/config.c283
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c283
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/console/debugio.c114
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in36
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/include/bsp.h187
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h134
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h290
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/scv64/Makefile.in60
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/scv64/scv64.c171
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/sonic/Makefile.in60
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.c1599
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.h372
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/start/Makefile.in54
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/start/start.s117
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in57
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c19
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c134
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c239
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds183
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c58
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c84
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/timer/timer.c132
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/times191
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/tod/Makefile.in57
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/tod/config.c79
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c79
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in62
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/Makefile.in20
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/README106
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/bsp_specs23
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/bsp_specs.dl23
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/dlentry/Makefile.in59
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/dlentry/dlentry.s144
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/flashentry/Makefile.in59
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/flashentry/flashentry.s469
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/include/Makefile.in35
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/include/bsp.h122
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/include/coverhd.h135
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/startup/Makefile.in56
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/startup/bspclean.c44
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/startup/bspstart.c201
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/startup/linkcmds200
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/startup/linkcmds.dl142
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/startup/setvec.c58
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/times197
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/wrapup/Makefile.in56
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/Makefile.in20
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/README50
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/bsp_specs23
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/dlentry/Makefile.in59
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/dlentry/dlentry.s251
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/flashentry/Makefile.in59
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/flashentry/flashentry.s289
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/include/Makefile.in35
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/include/bsp.h124
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/include/coverhd.h135
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/startup/Makefile.in56
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/startup/bspclean.c44
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c134
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/startup/linkcmds129
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/startup/setvec.c58
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/times197
-rw-r--r--c/src/lib/libbsp/powerpc/papyrus/wrapup/Makefile.in57
-rw-r--r--c/src/lib/libbsp/powerpc/psim/Makefile.in26
-rw-r--r--c/src/lib/libbsp/powerpc/psim/README52
-rw-r--r--c/src/lib/libbsp/powerpc/psim/bsp_specs23
-rw-r--r--c/src/lib/libbsp/powerpc/psim/clock/Makefile.in60
-rw-r--r--c/src/lib/libbsp/powerpc/psim/clock/clock.c240
-rw-r--r--c/src/lib/libbsp/powerpc/psim/console/Makefile.in59
-rw-r--r--c/src/lib/libbsp/powerpc/psim/console/console.c205
-rw-r--r--c/src/lib/libbsp/powerpc/psim/console/consupp.s33
-rw-r--r--c/src/lib/libbsp/powerpc/psim/include/Makefile.in35
-rw-r--r--c/src/lib/libbsp/powerpc/psim/include/bsp.h156
-rw-r--r--c/src/lib/libbsp/powerpc/psim/include/coverhd.h135
-rw-r--r--c/src/lib/libbsp/powerpc/psim/shmsupp/Makefile.in55
-rw-r--r--c/src/lib/libbsp/powerpc/psim/shmsupp/README7
-rw-r--r--c/src/lib/libbsp/powerpc/psim/shmsupp/addrconv.c31
-rw-r--r--c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c65
-rw-r--r--c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c69
-rw-r--r--c/src/lib/libbsp/powerpc/psim/shmsupp/mpisr.c34
-rw-r--r--c/src/lib/libbsp/powerpc/psim/start/Makefile.in54
-rw-r--r--c/src/lib/libbsp/powerpc/psim/start/startsim.s106
-rw-r--r--c/src/lib/libbsp/powerpc/psim/startsim/Makefile.in54
-rw-r--r--c/src/lib/libbsp/powerpc/psim/startsim/startsim.s106
-rw-r--r--c/src/lib/libbsp/powerpc/psim/startup/Makefile.in58
-rw-r--r--c/src/lib/libbsp/powerpc/psim/startup/bspclean.c17
-rw-r--r--c/src/lib/libbsp/powerpc/psim/startup/bspstart.c268
-rw-r--r--c/src/lib/libbsp/powerpc/psim/startup/device-tree3
-rw-r--r--c/src/lib/libbsp/powerpc/psim/startup/linkcmds194
-rw-r--r--c/src/lib/libbsp/powerpc/psim/startup/setvec.c58
-rw-r--r--c/src/lib/libbsp/powerpc/psim/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/powerpc/psim/timer/timer.c86
-rw-r--r--c/src/lib/libbsp/powerpc/psim/tools/Makefile.in30
-rwxr-xr-xc/src/lib/libbsp/powerpc/psim/tools/psim52
-rwxr-xr-xc/src/lib/libbsp/powerpc/psim/tools/runtest286
-rw-r--r--c/src/lib/libbsp/powerpc/psim/vectors/Makefile.in59
-rw-r--r--c/src/lib/libbsp/powerpc/psim/vectors/README25
-rw-r--r--c/src/lib/libbsp/powerpc/psim/vectors/align_h.s434
-rw-r--r--c/src/lib/libbsp/powerpc/psim/vectors/vectors.s123
-rw-r--r--c/src/lib/libbsp/powerpc/psim/wrapup/Makefile.in59
-rw-r--r--c/src/lib/libbsp/sh/Makefile.in15
-rw-r--r--c/src/lib/libbsp/sh/gensh1/Makefile.in20
-rw-r--r--c/src/lib/libbsp/sh/gensh1/README50
-rw-r--r--c/src/lib/libbsp/sh/gensh1/bsp_specs22
-rw-r--r--c/src/lib/libbsp/sh/gensh1/include/Makefile.in36
-rw-r--r--c/src/lib/libbsp/sh/gensh1/include/bsp.h131
-rw-r--r--c/src/lib/libbsp/sh/gensh1/include/coverhd.h130
-rw-r--r--c/src/lib/libbsp/sh/gensh1/scitab/Makefile.in61
-rw-r--r--c/src/lib/libbsp/sh/gensh1/start/Makefile.in59
-rw-r--r--c/src/lib/libbsp/sh/gensh1/startup/Makefile.in59
-rw-r--r--c/src/lib/libbsp/sh/gensh1/startup/bspclean.c41
-rw-r--r--c/src/lib/libbsp/sh/gensh1/startup/bspstart.c134
-rw-r--r--c/src/lib/libbsp/sh/gensh1/startup/linkcmds203
-rw-r--r--c/src/lib/libbsp/sh/gensh1/times195
-rw-r--r--c/src/lib/libbsp/sh/gensh1/wrapup/Makefile.in62
-rw-r--r--c/src/lib/libbsp/sh/shared/setvec.c58
-rw-r--r--c/src/lib/libbsp/shared/bspclean.c17
-rw-r--r--c/src/lib/libbsp/shared/bsplibc.c39
-rw-r--r--c/src/lib/libbsp/shared/bsppost.c37
-rw-r--r--c/src/lib/libbsp/shared/console.c291
-rw-r--r--c/src/lib/libbsp/shared/main.c106
-rw-r--r--c/src/lib/libbsp/shared/sbrk.c32
-rw-r--r--c/src/lib/libbsp/shared/tod.c243
-rw-r--r--c/src/lib/libbsp/shared/tod.h63
-rw-r--r--c/src/lib/libbsp/shmdr/Makefile.in60
-rw-r--r--c/src/lib/libbsp/shmdr/README9
-rw-r--r--c/src/lib/libbsp/shmdr/addlq.c43
-rw-r--r--c/src/lib/libbsp/shmdr/cnvpkt.c42
-rw-r--r--c/src/lib/libbsp/shmdr/dump.c51
-rw-r--r--c/src/lib/libbsp/shmdr/fatal.c39
-rw-r--r--c/src/lib/libbsp/shmdr/getlq.c48
-rw-r--r--c/src/lib/libbsp/shmdr/getpkt.c36
-rw-r--r--c/src/lib/libbsp/shmdr/init.c254
-rw-r--r--c/src/lib/libbsp/shmdr/initlq.c35
-rw-r--r--c/src/lib/libbsp/shmdr/intr.c58
-rw-r--r--c/src/lib/libbsp/shmdr/mpci.h59
-rw-r--r--c/src/lib/libbsp/shmdr/mpisr.c23
-rw-r--r--c/src/lib/libbsp/shmdr/poll.c53
-rw-r--r--c/src/lib/libbsp/shmdr/receive.c44
-rw-r--r--c/src/lib/libbsp/shmdr/retpkt.c32
-rw-r--r--c/src/lib/libbsp/shmdr/send.c61
-rw-r--r--c/src/lib/libbsp/shmdr/setckvec.c34
-rw-r--r--c/src/lib/libbsp/shmdr/shm.h542
-rw-r--r--c/src/lib/libbsp/shmdr/shm_driver.h542
-rw-r--r--c/src/lib/libbsp/sparc/Makefile.in15
-rw-r--r--c/src/lib/libbsp/sparc/erc32/Makefile.in17
-rw-r--r--c/src/lib/libbsp/sparc/erc32/README80
-rw-r--r--c/src/lib/libbsp/sparc/erc32/bsp_specs23
-rw-r--r--c/src/lib/libbsp/sparc/erc32/clock/Makefile.in60
-rw-r--r--c/src/lib/libbsp/sparc/erc32/clock/ckinit.c262
-rw-r--r--c/src/lib/libbsp/sparc/erc32/console/Makefile.in59
-rw-r--r--c/src/lib/libbsp/sparc/erc32/console/console.c499
-rw-r--r--c/src/lib/libbsp/sparc/erc32/include/Makefile.in35
-rw-r--r--c/src/lib/libbsp/sparc/erc32/include/bsp.h173
-rw-r--r--c/src/lib/libbsp/sparc/erc32/include/coverhd.h111
-rw-r--r--c/src/lib/libbsp/sparc/erc32/start/Makefile.in54
-rw-r--r--c/src/lib/libbsp/sparc/erc32/start/startsis.s309
-rw-r--r--c/src/lib/libbsp/sparc/erc32/startsis/Makefile.in54
-rw-r--r--c/src/lib/libbsp/sparc/erc32/startsis/startsis.s309
-rw-r--r--c/src/lib/libbsp/sparc/erc32/startup/Makefile.in57
-rw-r--r--c/src/lib/libbsp/sparc/erc32/startup/bspclean.c37
-rw-r--r--c/src/lib/libbsp/sparc/erc32/startup/bspstart.c259
-rw-r--r--c/src/lib/libbsp/sparc/erc32/startup/linkcmds158
-rw-r--r--c/src/lib/libbsp/sparc/erc32/startup/setvec.c63
-rw-r--r--c/src/lib/libbsp/sparc/erc32/startup/spurious.c164
-rw-r--r--c/src/lib/libbsp/sparc/erc32/timer/Makefile.in59
-rw-r--r--c/src/lib/libbsp/sparc/erc32/timer/timer.c89
-rw-r--r--c/src/lib/libbsp/sparc/erc32/times193
-rw-r--r--c/src/lib/libbsp/sparc/erc32/tools/Makefile.in32
-rw-r--r--c/src/lib/libbsp/sparc/erc32/tools/runtest.in307
-rw-r--r--c/src/lib/libbsp/sparc/erc32/wrapup/Makefile.in54
-rw-r--r--c/src/lib/libbsp/unix/Makefile.in15
-rw-r--r--c/src/lib/libbsp/unix/posix/Makefile.in26
-rw-r--r--c/src/lib/libbsp/unix/posix/README18
-rw-r--r--c/src/lib/libbsp/unix/posix/bsp_specs8
-rw-r--r--c/src/lib/libbsp/unix/posix/clock/Makefile.in55
-rw-r--r--c/src/lib/libbsp/unix/posix/clock/clock.c112
-rw-r--r--c/src/lib/libbsp/unix/posix/console/Makefile.in54
-rw-r--r--c/src/lib/libbsp/unix/posix/console/console.c95
-rw-r--r--c/src/lib/libbsp/unix/posix/include/Makefile.in33
-rw-r--r--c/src/lib/libbsp/unix/posix/include/bsp.h100
-rw-r--r--c/src/lib/libbsp/unix/posix/include/coverhd.h111
-rw-r--r--c/src/lib/libbsp/unix/posix/shmsupp/Makefile.in55
-rw-r--r--c/src/lib/libbsp/unix/posix/shmsupp/README9
-rw-r--r--c/src/lib/libbsp/unix/posix/shmsupp/addrconv.c30
-rw-r--r--c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c75
-rw-r--r--c/src/lib/libbsp/unix/posix/shmsupp/intr.c34
-rw-r--r--c/src/lib/libbsp/unix/posix/shmsupp/lock.c72
-rw-r--r--c/src/lib/libbsp/unix/posix/shmsupp/mpisr.c32
-rw-r--r--c/src/lib/libbsp/unix/posix/startup/Makefile.in75
-rw-r--r--c/src/lib/libbsp/unix/posix/startup/bspclean.c41
-rw-r--r--c/src/lib/libbsp/unix/posix/startup/bspstart.c235
-rw-r--r--c/src/lib/libbsp/unix/posix/startup/exit.c27
-rw-r--r--c/src/lib/libbsp/unix/posix/startup/main.c54
-rw-r--r--c/src/lib/libbsp/unix/posix/startup/no-ctor.c16
-rw-r--r--c/src/lib/libbsp/unix/posix/startup/rtems-ctor.cc116
-rw-r--r--c/src/lib/libbsp/unix/posix/startup/setvec.c47
-rw-r--r--c/src/lib/libbsp/unix/posix/timer/Makefile.in55
-rw-r--r--c/src/lib/libbsp/unix/posix/timer/timer.c71
-rw-r--r--c/src/lib/libbsp/unix/posix/times10
-rw-r--r--c/src/lib/libbsp/unix/posix/tools/Makefile.in37
-rw-r--r--c/src/lib/libbsp/unix/posix/tools/looptest.in93
-rw-r--r--c/src/lib/libbsp/unix/posix/tools/runtest.in255
-rw-r--r--c/src/lib/libbsp/unix/posix/tools/semdump.in59
-rw-r--r--c/src/lib/libbsp/unix/posix/tools/shmdump.in134
-rw-r--r--c/src/lib/libbsp/unix/posix/wrapup/Makefile.in65
-rw-r--r--c/src/lib/libc/Makefile.in73
-rw-r--r--c/src/lib/libc/README37
-rw-r--r--c/src/lib/libc/__brk.c44
-rw-r--r--c/src/lib/libc/__gettod.c118
-rw-r--r--c/src/lib/libc/__times.c74
-rw-r--r--c/src/lib/libc/_execve.c31
-rw-r--r--c/src/lib/libc/assoc.c260
-rw-r--r--c/src/lib/libc/assoc.h42
-rw-r--r--c/src/lib/libc/cfiospeed.c54
-rw-r--r--c/src/lib/libc/closedir.c20
-rw-r--r--c/src/lib/libc/error.c209
-rw-r--r--c/src/lib/libc/error.h38
-rw-r--r--c/src/lib/libc/getdents.c14
-rw-r--r--c/src/lib/libc/hosterr.c43
-rw-r--r--c/src/lib/libc/internal.h41
-rw-r--r--c/src/lib/libc/libcsupport.h43
-rw-r--r--c/src/lib/libc/libio.c524
-rw-r--r--c/src/lib/libc/libio.h166
-rw-r--r--c/src/lib/libc/malloc.c424
-rw-r--r--c/src/lib/libc/newlibc.c429
-rw-r--r--c/src/lib/libc/newlibif.c93
-rw-r--r--c/src/lib/libc/newlibifr.c103
-rw-r--r--c/src/lib/libc/no_libc.c55
-rw-r--r--c/src/lib/libc/opendir.c17
-rw-r--r--c/src/lib/libc/readdir.c14
-rw-r--r--c/src/lib/libc/rewinddir.c20
-rw-r--r--c/src/lib/libc/scandir.c23
-rw-r--r--c/src/lib/libc/seekdir.c21
-rw-r--r--c/src/lib/libc/support.c52
-rw-r--r--c/src/lib/libc/syscalls.c99
-rw-r--r--c/src/lib/libc/tcattr.c40
-rw-r--r--c/src/lib/libc/tcdrain.c26
-rw-r--r--c/src/lib/libc/telldir.c23
-rw-r--r--c/src/lib/libc/termios.c935
-rw-r--r--c/src/lib/libc/unixlibc.c23
-rw-r--r--c/src/lib/libc/utsname.c57
-rw-r--r--c/src/lib/libchip/Makefile.in14
-rw-r--r--c/src/lib/libchip/rtc/Makefile.in60
-rw-r--r--c/src/lib/libchip/rtc/README.ds16437
-rw-r--r--c/src/lib/libchip/rtc/README.icm717052
-rw-r--r--c/src/lib/libchip/rtc/README.m48t0848
-rw-r--r--c/src/lib/libchip/rtc/README.m48t185
-rw-r--r--c/src/lib/libchip/rtc/STATUS37
-rw-r--r--c/src/lib/libchip/rtc/icm7170.c176
-rw-r--r--c/src/lib/libchip/rtc/icm7170.h100
-rw-r--r--c/src/lib/libchip/rtc/icm7170_reg.c61
-rw-r--r--c/src/lib/libchip/rtc/icm7170_reg2.c24
-rw-r--r--c/src/lib/libchip/rtc/icm7170_reg4.c24
-rw-r--r--c/src/lib/libchip/rtc/icm7170_reg8.c24
-rw-r--r--c/src/lib/libchip/rtc/m48t08.c165
-rw-r--r--c/src/lib/libchip/rtc/m48t08.h90
-rw-r--r--c/src/lib/libchip/rtc/m48t08_reg.c61
-rw-r--r--c/src/lib/libchip/rtc/m48t08_reg2.c24
-rw-r--r--c/src/lib/libchip/rtc/m48t08_reg4.c24
-rw-r--r--c/src/lib/libchip/rtc/m48t08_reg8.c24
-rw-r--r--c/src/lib/libchip/rtc/rtc.h81
-rw-r--r--c/src/lib/libchip/rtc/rtcprobe.c24
-rw-r--r--c/src/lib/libchip/serial/Makefile.in60
-rw-r--r--c/src/lib/libchip/serial/README17
-rw-r--r--c/src/lib/libchip/serial/README.mc6868187
-rw-r--r--c/src/lib/libchip/serial/README.ns165505
-rw-r--r--c/src/lib/libchip/serial/README.xr886816
-rw-r--r--c/src/lib/libchip/serial/README.z85c3078
-rw-r--r--c/src/lib/libchip/serial/STATUS58
-rw-r--r--c/src/lib/libchip/serial/mc68681.c756
-rw-r--r--c/src/lib/libchip/serial/mc68681.h123
-rw-r--r--c/src/lib/libchip/serial/mc68681_baud.c107
-rw-r--r--c/src/lib/libchip/serial/mc68681_p.h317
-rw-r--r--c/src/lib/libchip/serial/mc68681_reg.c61
-rw-r--r--c/src/lib/libchip/serial/mc68681_reg2.c24
-rw-r--r--c/src/lib/libchip/serial/mc68681_reg4.c24
-rw-r--r--c/src/lib/libchip/serial/mc68681_reg8.c24
-rw-r--r--c/src/lib/libchip/serial/ns16550.c660
-rw-r--r--c/src/lib/libchip/serial/ns16550.h42
-rw-r--r--c/src/lib/libchip/serial/ns16550_p.h238
-rw-r--r--c/src/lib/libchip/serial/serial.h152
-rw-r--r--c/src/lib/libchip/serial/serprobe.c20
-rw-r--r--c/src/lib/libchip/serial/sersupp.h22
-rw-r--r--c/src/lib/libchip/serial/termios_baud2index.c39
-rw-r--r--c/src/lib/libchip/serial/termios_baud2num.c39
-rw-r--r--c/src/lib/libchip/serial/z85c30.c889
-rw-r--r--c/src/lib/libchip/serial/z85c30.h78
-rw-r--r--c/src/lib/libchip/serial/z85c30_p.h410
-rw-r--r--c/src/lib/libchip/serial/z85c30_reg.c73
-rw-r--r--c/src/lib/libcpu/Makefile.in14
-rw-r--r--c/src/lib/libcpu/README14
-rw-r--r--c/src/lib/libcpu/hppa1.1/Makefile.in14
-rw-r--r--c/src/lib/libcpu/hppa1.1/clock/Makefile.in60
-rw-r--r--c/src/lib/libcpu/hppa1.1/clock/clock.c267
-rw-r--r--c/src/lib/libcpu/hppa1.1/include/Makefile.in21
-rw-r--r--c/src/lib/libcpu/hppa1.1/milli/Makefile.in60
-rw-r--r--c/src/lib/libcpu/hppa1.1/milli/milli.s2001
-rw-r--r--c/src/lib/libcpu/hppa1.1/runway/Makefile.in23
-rw-r--r--c/src/lib/libcpu/hppa1.1/runway/runway.h37
-rw-r--r--c/src/lib/libcpu/hppa1.1/semaphore/Makefile.in53
-rw-r--r--c/src/lib/libcpu/hppa1.1/semaphore/semaphore.c294
-rw-r--r--c/src/lib/libcpu/hppa1.1/semaphore/semaphore.h70
-rw-r--r--c/src/lib/libcpu/hppa1.1/timer/Makefile.in60
-rw-r--r--c/src/lib/libcpu/hppa1.1/timer/timer.c63
-rw-r--r--c/src/lib/libcpu/i386/Makefile.in65
-rw-r--r--c/src/lib/libcpu/i386/cpu.c288
-rw-r--r--c/src/lib/libcpu/i386/cpu.h368
-rw-r--r--c/src/lib/libcpu/i386/cpuModel.S255
-rw-r--r--c/src/lib/libcpu/i386/cpuModel.h32
-rw-r--r--c/src/lib/libcpu/i386/cpu_asm.S117
-rw-r--r--c/src/lib/libcpu/i386/displayCpu.c209
-rw-r--r--c/src/lib/libcpu/i386/idt.c288
-rw-r--r--c/src/lib/libcpu/i386/registers.h159
-rw-r--r--c/src/lib/libcpu/i386/wrapup/Makefile.in65
-rw-r--r--c/src/lib/libcpu/m68k/Makefile.in14
-rw-r--r--c/src/lib/libcpu/m68k/m68040/Makefile.in14
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/Makefile.in64
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/README44
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/bindec.s922
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/binstr.s141
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/bugfix.s497
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/decbin.s508
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/do_func.s561
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/fpsp.defs349
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/gen_except.s470
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/get_op.s678
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/kernel_ex.s496
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/res_func.s2042
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/round.s651
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/rtems_fpsp.c81
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/rtems_skel.s399
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/sacos.s117
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/sasin.s106
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/satan.s480
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/satanh.s106
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/scale.s373
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/scosh.s134
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/setox.s867
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/sgetem.s143
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/sint.s249
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/slog2.s190
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/slogn.s594
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/smovecr.s164
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/srem_mod.s424
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/ssin.s748
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/ssinh.s137
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/stan.s457
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/stanh.s187
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/sto_res.s100
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/stwotox.s429
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/tbldo.s556
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/util.s750
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/x_bsun.s49
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/x_fline.s106
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/x_operr.s358
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/x_ovfl.s188
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/x_snan.s279
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/x_store.s258
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/x_unfl.s271
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/x_unimp.s79
-rw-r--r--c/src/lib/libcpu/m68k/m68040/fpsp/x_unsupp.s85
-rw-r--r--c/src/lib/libcpu/m68k/shared/misc/memcpy.c87
-rw-r--r--c/src/lib/libcpu/mips/clock/ckinit.c249
-rw-r--r--c/src/lib/libcpu/mips/clock/clock.S45
-rw-r--r--c/src/lib/libcpu/mips/clock/clock.h25
-rw-r--r--c/src/lib/libcpu/mips/timer/gettime.S35
-rw-r--r--c/src/lib/libcpu/mips/timer/timer.c140
-rw-r--r--c/src/lib/libcpu/mips64orion/Makefile.in14
-rw-r--r--c/src/lib/libcpu/mips64orion/clock/Makefile.in59
-rw-r--r--c/src/lib/libcpu/mips64orion/clock/ckinit.c249
-rw-r--r--c/src/lib/libcpu/mips64orion/clock/clock.S45
-rw-r--r--c/src/lib/libcpu/mips64orion/clock/clock.h25
-rw-r--r--c/src/lib/libcpu/mips64orion/include/Makefile.in21
-rw-r--r--c/src/lib/libcpu/mips64orion/timer/Makefile.in61
-rw-r--r--c/src/lib/libcpu/mips64orion/timer/gettime.S35
-rw-r--r--c/src/lib/libcpu/mips64orion/timer/timer.c140
-rw-r--r--c/src/lib/libcpu/powerpc/Makefile.in14
-rw-r--r--c/src/lib/libcpu/powerpc/README13
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/Makefile.in14
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/README22
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/clock/Makefile.in60
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/clock/clock.c282
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/console/Makefile.in59
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/console/console.c553
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled393
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/ictrl/Makefile.in61
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c250
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.h84
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/include/Makefile.in21
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/timer/Makefile.in60
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/timer/timer.c98
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/vectors/Makefile.in59
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/vectors/README25
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/vectors/align_h.s434
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/vectors/vectors.s299
-rw-r--r--c/src/lib/libcpu/sh/Makefile.in14
-rw-r--r--c/src/lib/libcpu/sh/sh7032/Makefile.in14
-rw-r--r--c/src/lib/libcpu/sh/sh7032/clock/Makefile.in60
-rw-r--r--c/src/lib/libcpu/sh/sh7032/clock/ckinit.c291
-rw-r--r--c/src/lib/libcpu/sh/sh7032/console/Makefile.in60
-rw-r--r--c/src/lib/libcpu/sh/sh7032/console/console.c152
-rw-r--r--c/src/lib/libcpu/sh/sh7032/include/Makefile.in28
-rw-r--r--c/src/lib/libcpu/sh/sh7032/include/ioqueue.h77
-rw-r--r--c/src/lib/libcpu/sh/sh7032/include/null.h72
-rw-r--r--c/src/lib/libcpu/sh/sh7032/include/sci.h91
-rw-r--r--c/src/lib/libcpu/sh/sh7032/include/sh7_pfc.h118
-rw-r--r--c/src/lib/libcpu/sh/sh7032/include/sh7_sci.h82
-rw-r--r--c/src/lib/libcpu/sh/sh7032/null/Makefile.in59
-rw-r--r--c/src/lib/libcpu/sh/sh7032/null/close.c38
-rw-r--r--c/src/lib/libcpu/sh/sh7032/null/cntrl.c38
-rw-r--r--c/src/lib/libcpu/sh/sh7032/null/init.c53
-rw-r--r--c/src/lib/libcpu/sh/sh7032/null/open.c38
-rw-r--r--c/src/lib/libcpu/sh/sh7032/null/read.c38
-rw-r--r--c/src/lib/libcpu/sh/sh7032/null/write.c44
-rw-r--r--c/src/lib/libcpu/sh/sh7032/score/cpu_asm.c311
-rw-r--r--c/src/lib/libcpu/sh/sh7032/score/ispsh7032.c252
-rw-r--r--c/src/lib/libcpu/sh/sh7032/timer/Makefile.in60
-rw-r--r--c/src/lib/libcpu/sh/sh7032/timer/timer.c204
-rw-r--r--c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c311
-rw-r--r--c/src/lib/libcpu/sparc/Makefile.in14
-rw-r--r--c/src/lib/libcpu/sparc/include/erc32.h521
-rw-r--r--c/src/lib/libcpu/sparc/reg_win/Makefile.in60
-rw-r--r--c/src/lib/libcpu/sparc/reg_win/window.s257
-rw-r--r--c/src/lib/libmisc/Makefile.in14
-rw-r--r--c/src/lib/libmisc/README23
-rw-r--r--c/src/lib/libmisc/assoc/Makefile.in52
-rw-r--r--c/src/lib/libmisc/assoc/assoc.c260
-rw-r--r--c/src/lib/libmisc/assoc/assoc.h42
-rw-r--r--c/src/lib/libmisc/cpuuse/Makefile.in54
-rw-r--r--c/src/lib/libmisc/cpuuse/README41
-rw-r--r--c/src/lib/libmisc/cpuuse/cpuuse.c142
-rw-r--r--c/src/lib/libmisc/cpuuse/cpuuse.h41
-rw-r--r--c/src/lib/libmisc/cpuuse/internal.h96
-rw-r--r--c/src/lib/libmisc/error/Makefile.in52
-rw-r--r--c/src/lib/libmisc/error/error.c209
-rw-r--r--c/src/lib/libmisc/error/error.h38
-rw-r--r--c/src/lib/libmisc/monitor/Makefile.in58
-rw-r--r--c/src/lib/libmisc/monitor/README97
-rw-r--r--c/src/lib/libmisc/monitor/mon-command.c187
-rw-r--r--c/src/lib/libmisc/monitor/mon-config.c131
-rw-r--r--c/src/lib/libmisc/monitor/mon-dname.c112
-rw-r--r--c/src/lib/libmisc/monitor/mon-driver.c136
-rw-r--r--c/src/lib/libmisc/monitor/mon-extension.c98
-rw-r--r--c/src/lib/libmisc/monitor/mon-itask.c115
-rw-r--r--c/src/lib/libmisc/monitor/mon-manager.c48
-rw-r--r--c/src/lib/libmisc/monitor/mon-monitor.c518
-rw-r--r--c/src/lib/libmisc/monitor/mon-mpci.c159
-rw-r--r--c/src/lib/libmisc/monitor/mon-object.c374
-rw-r--r--c/src/lib/libmisc/monitor/mon-prmisc.c259
-rw-r--r--c/src/lib/libmisc/monitor/mon-queue.c64
-rw-r--r--c/src/lib/libmisc/monitor/mon-server.c303
-rw-r--r--c/src/lib/libmisc/monitor/mon-symbols.c487
-rw-r--r--c/src/lib/libmisc/monitor/mon-task.c93
-rw-r--r--c/src/lib/libmisc/monitor/monitor.h443
-rw-r--r--c/src/lib/libmisc/monitor/symbols.h62
-rw-r--r--c/src/lib/libmisc/rtmonuse/Makefile.in54
-rw-r--r--c/src/lib/libmisc/rtmonuse/rtmonuse.c178
-rw-r--r--c/src/lib/libmisc/rtmonuse/rtmonuse.h18
-rw-r--r--c/src/lib/libmisc/stackchk/Makefile.in53
-rw-r--r--c/src/lib/libmisc/stackchk/README56
-rw-r--r--c/src/lib/libmisc/stackchk/check.c535
-rw-r--r--c/src/lib/libmisc/stackchk/internal.h96
-rw-r--r--c/src/lib/libmisc/stackchk/stackchk.h83
-rw-r--r--c/src/lib/libmisc/wrapup/Makefile.in42
-rw-r--r--c/src/lib/libnetworking/CHANGELOG54
-rw-r--r--c/src/lib/libnetworking/Makefile.in14
-rw-r--r--c/src/lib/libnetworking/README18
-rw-r--r--c/src/lib/libnetworking/arpa/ftp.h111
-rw-r--r--c/src/lib/libnetworking/arpa/inet.h105
-rw-r--r--c/src/lib/libnetworking/arpa/nameser.h448
-rw-r--r--c/src/lib/libnetworking/arpa/nameser_compat.h194
-rw-r--r--c/src/lib/libnetworking/arpa/telnet.h342
-rw-r--r--c/src/lib/libnetworking/bpfilter.h6
-rw-r--r--c/src/lib/libnetworking/include/Makefile.in65
-rw-r--r--c/src/lib/libnetworking/kern/Makefile.in47
-rw-r--r--c/src/lib/libnetworking/kern/kern_subr.c206
-rw-r--r--c/src/lib/libnetworking/kern/uipc_domain.c228
-rw-r--r--c/src/lib/libnetworking/kern/uipc_mbuf.c851
-rw-r--r--c/src/lib/libnetworking/kern/uipc_socket.c1100
-rw-r--r--c/src/lib/libnetworking/kern/uipc_socket2.c965
-rw-r--r--c/src/lib/libnetworking/lib/Makefile.in46
-rw-r--r--c/src/lib/libnetworking/lib/README5
-rw-r--r--c/src/lib/libnetworking/lib/getprotoby.c46
-rw-r--r--c/src/lib/libnetworking/lib/syslog.c189
-rw-r--r--c/src/lib/libnetworking/lib/tftpDriver.c609
-rw-r--r--c/src/lib/libnetworking/libc/Makefile.in54
-rw-r--r--c/src/lib/libnetworking/libc/addr2ascii.3217
-rw-r--r--c/src/lib/libnetworking/libc/addr2ascii.c94
-rw-r--r--c/src/lib/libnetworking/libc/ascii2addr.c74
-rw-r--r--c/src/lib/libnetworking/libc/base64.c318
-rw-r--r--c/src/lib/libnetworking/libc/byteorder.377
-rw-r--r--c/src/lib/libnetworking/libc/ether_addr.c226
-rw-r--r--c/src/lib/libnetworking/libc/ethers.3193
-rw-r--r--c/src/lib/libnetworking/libc/gethostbydns.c773
-rw-r--r--c/src/lib/libnetworking/libc/gethostbyht.c202
-rw-r--r--c/src/lib/libnetworking/libc/gethostbyname.3305
-rw-r--r--c/src/lib/libnetworking/libc/gethostbynis.c142
-rw-r--r--c/src/lib/libnetworking/libc/gethostnamadr.c224
-rw-r--r--c/src/lib/libnetworking/libc/gethostname.c26
-rw-r--r--c/src/lib/libnetworking/libc/getnetbydns.c313
-rw-r--r--c/src/lib/libnetworking/libc/getnetbyht.c173
-rw-r--r--c/src/lib/libnetworking/libc/getnetbynis.c177
-rw-r--r--c/src/lib/libnetworking/libc/getnetent.3159
-rw-r--r--c/src/lib/libnetworking/libc/getnetnamadr.c190
-rw-r--r--c/src/lib/libnetworking/libc/getproto.c57
-rw-r--r--c/src/lib/libnetworking/libc/getprotoent.3147
-rw-r--r--c/src/lib/libnetworking/libc/getprotoent.c121
-rw-r--r--c/src/lib/libnetworking/libc/getprotoname.c64
-rw-r--r--c/src/lib/libnetworking/libc/getservbyname.c81
-rw-r--r--c/src/lib/libnetworking/libc/getservbyport.c76
-rw-r--r--c/src/lib/libnetworking/libc/getservent.3156
-rw-r--r--c/src/lib/libnetworking/libc/getservent.c280
-rw-r--r--c/src/lib/libnetworking/libc/herror.c122
-rw-r--r--c/src/lib/libnetworking/libc/inet.3210
-rw-r--r--c/src/lib/libnetworking/libc/inet_addr.c180
-rw-r--r--c/src/lib/libnetworking/libc/inet_lnaof.c61
-rw-r--r--c/src/lib/libnetworking/libc/inet_makeaddr.c64
-rw-r--r--c/src/lib/libnetworking/libc/inet_net_ntop.c140
-rw-r--r--c/src/lib/libnetworking/libc/inet_net_pton.c207
-rw-r--r--c/src/lib/libnetworking/libc/inet_neta.c84
-rw-r--r--c/src/lib/libnetworking/libc/inet_netof.c60
-rw-r--r--c/src/lib/libnetworking/libc/inet_network.c92
-rw-r--r--c/src/lib/libnetworking/libc/inet_ntoa.c59
-rw-r--r--c/src/lib/libnetworking/libc/inet_ntop.c191
-rw-r--r--c/src/lib/libnetworking/libc/inet_pton.c214
-rw-r--r--c/src/lib/libnetworking/libc/iso_addr.3111
-rw-r--r--c/src/lib/libnetworking/libc/iso_addr.c119
-rw-r--r--c/src/lib/libnetworking/libc/linkaddr.3138
-rw-r--r--c/src/lib/libnetworking/libc/linkaddr.c160
-rw-r--r--c/src/lib/libnetworking/libc/map_v4v6.c128
-rw-r--r--c/src/lib/libnetworking/libc/ns.3131
-rw-r--r--c/src/lib/libnetworking/libc/ns_addr.c229
-rw-r--r--c/src/lib/libnetworking/libc/ns_name.c595
-rw-r--r--c/src/lib/libnetworking/libc/ns_netint.c56
-rw-r--r--c/src/lib/libnetworking/libc/ns_ntoa.c102
-rw-r--r--c/src/lib/libnetworking/libc/ns_parse.c192
-rw-r--r--c/src/lib/libnetworking/libc/ns_print.c745
-rw-r--r--c/src/lib/libnetworking/libc/ns_ttl.c153
-rw-r--r--c/src/lib/libnetworking/libc/nsap_addr.c105
-rw-r--r--c/src/lib/libnetworking/libc/rcmd.3204
-rw-r--r--c/src/lib/libnetworking/libc/rcmd.c520
-rw-r--r--c/src/lib/libnetworking/libc/recv.c52
-rw-r--r--c/src/lib/libnetworking/libc/res_comp.c258
-rw-r--r--c/src/lib/libnetworking/libc/res_config.h20
-rw-r--r--c/src/lib/libnetworking/libc/res_data.c83
-rw-r--r--c/src/lib/libnetworking/libc/res_debug.c966
-rw-r--r--c/src/lib/libnetworking/libc/res_init.c497
-rw-r--r--c/src/lib/libnetworking/libc/res_mkquery.c199
-rw-r--r--c/src/lib/libnetworking/libc/res_mkupdate.c415
-rw-r--r--c/src/lib/libnetworking/libc/res_query.c410
-rw-r--r--c/src/lib/libnetworking/libc/res_send.c929
-rw-r--r--c/src/lib/libnetworking/libc/res_stubs.c75
-rw-r--r--c/src/lib/libnetworking/libc/res_update.c518
-rw-r--r--c/src/lib/libnetworking/libc/resolver.3352
-rw-r--r--c/src/lib/libnetworking/libc/send.c52
-rw-r--r--c/src/lib/libnetworking/libc/strsep.c85
-rw-r--r--c/src/lib/libnetworking/loop.h5
-rw-r--r--c/src/lib/libnetworking/machine/conf.h6
-rw-r--r--c/src/lib/libnetworking/machine/cpu.h6
-rw-r--r--c/src/lib/libnetworking/machine/cpufunc.h5
-rw-r--r--c/src/lib/libnetworking/machine/endian.h64
-rw-r--r--c/src/lib/libnetworking/machine/in_cksum.h118
-rw-r--r--c/src/lib/libnetworking/machine/limits.h6
-rw-r--r--c/src/lib/libnetworking/machine/param.h92
-rw-r--r--c/src/lib/libnetworking/machine/types.h34
-rw-r--r--c/src/lib/libnetworking/machine/vmparam.h6
-rw-r--r--c/src/lib/libnetworking/net/Makefile.in49
-rw-r--r--c/src/lib/libnetworking/net/bpf.h236
-rw-r--r--c/src/lib/libnetworking/net/ethernet.h63
-rw-r--r--c/src/lib/libnetworking/net/if.c783
-rw-r--r--c/src/lib/libnetworking/net/if.h467
-rw-r--r--c/src/lib/libnetworking/net/if_arp.h91
-rw-r--r--c/src/lib/libnetworking/net/if_dl.h86
-rw-r--r--c/src/lib/libnetworking/net/if_ethersubr.c988
-rw-r--r--c/src/lib/libnetworking/net/if_llc.h145
-rw-r--r--c/src/lib/libnetworking/net/if_loop.c301
-rw-r--r--c/src/lib/libnetworking/net/if_types.h101
-rw-r--r--c/src/lib/libnetworking/net/netisr.h90
-rw-r--r--c/src/lib/libnetworking/net/radix.c1028
-rw-r--r--c/src/lib/libnetworking/net/radix.h165
-rw-r--r--c/src/lib/libnetworking/net/raw_cb.c148
-rw-r--r--c/src/lib/libnetworking/net/raw_cb.h75
-rw-r--r--c/src/lib/libnetworking/net/raw_usrreq.c315
-rw-r--r--c/src/lib/libnetworking/net/route.c959
-rw-r--r--c/src/lib/libnetworking/net/route.h284
-rw-r--r--c/src/lib/libnetworking/net/rtsock.c829
-rw-r--r--c/src/lib/libnetworking/netdb.h182
-rw-r--r--c/src/lib/libnetworking/netinet/Makefile.in53
-rw-r--r--c/src/lib/libnetworking/netinet/icmp_var.h78
-rw-r--r--c/src/lib/libnetworking/netinet/if_ether.c638
-rw-r--r--c/src/lib/libnetworking/netinet/if_ether.h209
-rw-r--r--c/src/lib/libnetworking/netinet/igmp.c479
-rw-r--r--c/src/lib/libnetworking/netinet/igmp.h96
-rw-r--r--c/src/lib/libnetworking/netinet/igmp_var.h111
-rw-r--r--c/src/lib/libnetworking/netinet/in.c728
-rw-r--r--c/src/lib/libnetworking/netinet/in.h433
-rw-r--r--c/src/lib/libnetworking/netinet/in_cksum.c166
-rw-r--r--c/src/lib/libnetworking/netinet/in_cksum_i386.c198
-rw-r--r--c/src/lib/libnetworking/netinet/in_cksum_m68k.c223
-rw-r--r--c/src/lib/libnetworking/netinet/in_pcb.c757
-rw-r--r--c/src/lib/libnetworking/netinet/in_pcb.h124
-rw-r--r--c/src/lib/libnetworking/netinet/in_proto.c203
-rw-r--r--c/src/lib/libnetworking/netinet/in_rmx.c384
-rw-r--r--c/src/lib/libnetworking/netinet/in_systm.h62
-rw-r--r--c/src/lib/libnetworking/netinet/in_var.h235
-rw-r--r--c/src/lib/libnetworking/netinet/ip.h190
-rw-r--r--c/src/lib/libnetworking/netinet/ip_divert.c382
-rw-r--r--c/src/lib/libnetworking/netinet/ip_fw.c1069
-rw-r--r--c/src/lib/libnetworking/netinet/ip_fw.h183
-rw-r--r--c/src/lib/libnetworking/netinet/ip_icmp.c710
-rw-r--r--c/src/lib/libnetworking/netinet/ip_icmp.h190
-rw-r--r--c/src/lib/libnetworking/netinet/ip_input.c1488
-rw-r--r--c/src/lib/libnetworking/netinet/ip_mroute.c2302
-rw-r--r--c/src/lib/libnetworking/netinet/ip_mroute.h262
-rw-r--r--c/src/lib/libnetworking/netinet/ip_output.c1307
-rw-r--r--c/src/lib/libnetworking/netinet/ip_var.h211
-rw-r--r--c/src/lib/libnetworking/netinet/raw_ip.c486
-rw-r--r--c/src/lib/libnetworking/netinet/tcp.h122
-rw-r--r--c/src/lib/libnetworking/netinet/tcp_debug.c172
-rw-r--r--c/src/lib/libnetworking/netinet/tcp_debug.h69
-rw-r--r--c/src/lib/libnetworking/netinet/tcp_fsm.h92
-rw-r--r--c/src/lib/libnetworking/netinet/tcp_input.c2149
-rw-r--r--c/src/lib/libnetworking/netinet/tcp_output.c755
-rw-r--r--c/src/lib/libnetworking/netinet/tcp_seq.h102
-rw-r--r--c/src/lib/libnetworking/netinet/tcp_subr.c634
-rw-r--r--c/src/lib/libnetworking/netinet/tcp_timer.c387
-rw-r--r--c/src/lib/libnetworking/netinet/tcp_timer.h138
-rw-r--r--c/src/lib/libnetworking/netinet/tcp_usrreq.c840
-rw-r--r--c/src/lib/libnetworking/netinet/tcp_var.h374
-rw-r--r--c/src/lib/libnetworking/netinet/tcpip.h75
-rw-r--r--c/src/lib/libnetworking/netinet/udp.h51
-rw-r--r--c/src/lib/libnetworking/netinet/udp_usrreq.c613
-rw-r--r--c/src/lib/libnetworking/netinet/udp_var.h103
-rw-r--r--c/src/lib/libnetworking/nfs/Makefile.in47
-rw-r--r--c/src/lib/libnetworking/nfs/bootp_subr.c968
-rw-r--r--c/src/lib/libnetworking/nfs/krpc.h26
-rw-r--r--c/src/lib/libnetworking/nfs/nfs.h620
-rw-r--r--c/src/lib/libnetworking/nfs/nfsdiskless.h100
-rw-r--r--c/src/lib/libnetworking/nfs/nfsproto.h441
-rw-r--r--c/src/lib/libnetworking/nfs/rpcv2.h142
-rw-r--r--c/src/lib/libnetworking/nfs/xdr_subs.h90
-rw-r--r--c/src/lib/libnetworking/opt_ipfw.h6
-rw-r--r--c/src/lib/libnetworking/opt_mrouting.h6
-rw-r--r--c/src/lib/libnetworking/opt_tcpdebug.h6
-rw-r--r--c/src/lib/libnetworking/poll.h108
-rw-r--r--c/src/lib/libnetworking/resolv.h306
-rw-r--r--c/src/lib/libnetworking/rtems/Makefile.in51
-rw-r--r--c/src/lib/libnetworking/rtems/issetugid.c11
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_bootp.c19
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_bsdnet.h112
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_bsdnet_internal.h178
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_glue.c905
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_showicmpstat.c60
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_showifstat.c110
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_showipstat.c59
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_showmbuf.c65
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_showroute.c237
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_showtcpstat.c102
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_showudpstat.c48
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_syscall.c761
-rw-r--r--c/src/lib/libnetworking/rtems/sghostname.c49
-rw-r--r--c/src/lib/libnetworking/rtems/tftp.h85
-rw-r--r--c/src/lib/libnetworking/sys/buf.h248
-rw-r--r--c/src/lib/libnetworking/sys/callout.h57
-rw-r--r--c/src/lib/libnetworking/sys/cdefs.h177
-rw-r--r--c/src/lib/libnetworking/sys/conf.h228
-rw-r--r--c/src/lib/libnetworking/sys/domain.h75
-rw-r--r--c/src/lib/libnetworking/sys/filio.h56
-rw-r--r--c/src/lib/libnetworking/sys/ioccom.h75
-rw-r--r--c/src/lib/libnetworking/sys/ioctl.h77
-rw-r--r--c/src/lib/libnetworking/sys/kernel.h251
-rw-r--r--c/src/lib/libnetworking/sys/libkern.h89
-rw-r--r--c/src/lib/libnetworking/sys/malloc.h355
-rw-r--r--c/src/lib/libnetworking/sys/mbuf.h439
-rw-r--r--c/src/lib/libnetworking/sys/mount.h531
-rw-r--r--c/src/lib/libnetworking/sys/param.h231
-rw-r--r--c/src/lib/libnetworking/sys/proc.h8
-rw-r--r--c/src/lib/libnetworking/sys/protosw.h300
-rw-r--r--c/src/lib/libnetworking/sys/queue.h446
-rw-r--r--c/src/lib/libnetworking/sys/reboot.h106
-rw-r--r--c/src/lib/libnetworking/sys/resourcevar.h5
-rw-r--r--c/src/lib/libnetworking/sys/rtprio.h70
-rw-r--r--c/src/lib/libnetworking/sys/select.h57
-rw-r--r--c/src/lib/libnetworking/sys/signalvar.h171
-rw-r--r--c/src/lib/libnetworking/sys/socket.h356
-rw-r--r--c/src/lib/libnetworking/sys/socketvar.h279
-rw-r--r--c/src/lib/libnetworking/sys/sockio.h86
-rw-r--r--c/src/lib/libnetworking/sys/sysctl.h379
-rw-r--r--c/src/lib/libnetworking/sys/syslimits.h85
-rw-r--r--c/src/lib/libnetworking/sys/syslog.h194
-rw-r--r--c/src/lib/libnetworking/sys/systm.h198
-rw-r--r--c/src/lib/libnetworking/sys/ttycom.h141
-rw-r--r--c/src/lib/libnetworking/sys/ttydefaults.h97
-rw-r--r--c/src/lib/libnetworking/sys/ucred.h64
-rw-r--r--c/src/lib/libnetworking/sys/uio.h92
-rw-r--r--c/src/lib/libnetworking/syslog.h5
-rw-r--r--c/src/lib/libnetworking/vm/vm.h73
-rw-r--r--c/src/lib/libnetworking/vm/vm_extern.h103
-rw-r--r--c/src/lib/libnetworking/vm/vm_kern.h84
-rw-r--r--c/src/lib/libnetworking/vm/vm_param.h165
-rw-r--r--c/src/lib/libnetworking/wrapup/Makefile.in45
-rw-r--r--c/src/lib/librtems++/Makefile.in50
-rw-r--r--c/src/lib/librtems++/README266
-rw-r--r--c/src/lib/librtems++/rtemsEvent.cc75
-rw-r--r--c/src/lib/librtems++/rtemsInterrupt.cc115
-rw-r--r--c/src/lib/librtems++/rtemsMessageQueue.cc165
-rw-r--r--c/src/lib/librtems++/rtemsSemaphore.cc175
-rw-r--r--c/src/lib/librtems++/rtemsStatusCode.cc77
-rw-r--r--c/src/lib/librtems++/rtemsTask.cc288
-rw-r--r--c/src/lib/librtems++/rtemsTimer.cc101
-rw-r--r--c/src/lib/start/Makefile.in14
-rw-r--r--c/src/lib/start/README10
-rw-r--r--c/src/lib/start/a29k/Makefile.in54
-rw-r--r--c/src/lib/start/a29k/amd.ah517
-rw-r--r--c/src/lib/start/a29k/crt0.s288
-rw-r--r--c/src/lib/start/a29k/pswmacro.ah442
-rw-r--r--c/src/lib/start/a29k/register.ah214
-rw-r--r--c/src/lib/start/a29k/register.s393
-rw-r--r--c/src/lib/start/i960/Makefile.in54
-rw-r--r--c/src/lib/start/i960/start.s110
-rw-r--r--c/src/lib/start/m68k/Makefile.in54
-rw-r--r--c/src/lib/start/m68k/start.s153
-rw-r--r--c/src/lib/start/mips64orion/Makefile.in54
-rw-r--r--c/src/lib/start/mips64orion/idt_csu.S299
-rw-r--r--c/src/lib/start/sh/Makefile.in59
-rw-r--r--c/src/lib/start/sh/start.s94
-rw-r--r--c/src/lib/wrapup/Makefile.in73
-rw-r--r--c/src/libchip/rtc/Makefile.in60
-rw-r--r--c/src/libchip/rtc/README.ds16437
-rw-r--r--c/src/libchip/rtc/README.icm717052
-rw-r--r--c/src/libchip/rtc/README.m48t0848
-rw-r--r--c/src/libchip/rtc/README.m48t185
-rw-r--r--c/src/libchip/rtc/STATUS37
-rw-r--r--c/src/libchip/rtc/icm7170.c176
-rw-r--r--c/src/libchip/rtc/icm7170.h100
-rw-r--r--c/src/libchip/rtc/icm7170_reg.c61
-rw-r--r--c/src/libchip/rtc/icm7170_reg2.c24
-rw-r--r--c/src/libchip/rtc/icm7170_reg4.c24
-rw-r--r--c/src/libchip/rtc/icm7170_reg8.c24
-rw-r--r--c/src/libchip/rtc/m48t08.c165
-rw-r--r--c/src/libchip/rtc/m48t08.h90
-rw-r--r--c/src/libchip/rtc/m48t08_reg.c61
-rw-r--r--c/src/libchip/rtc/m48t08_reg2.c24
-rw-r--r--c/src/libchip/rtc/m48t08_reg4.c24
-rw-r--r--c/src/libchip/rtc/m48t08_reg8.c24
-rw-r--r--c/src/libchip/rtc/rtc.h81
-rw-r--r--c/src/libchip/rtc/rtcprobe.c24
-rw-r--r--c/src/libchip/serial/Makefile.in60
-rw-r--r--c/src/libchip/serial/README17
-rw-r--r--c/src/libchip/serial/README.mc6868187
-rw-r--r--c/src/libchip/serial/README.ns165505
-rw-r--r--c/src/libchip/serial/README.xr886816
-rw-r--r--c/src/libchip/serial/README.z85c3078
-rw-r--r--c/src/libchip/serial/STATUS58
-rw-r--r--c/src/libchip/serial/mc68681.c756
-rw-r--r--c/src/libchip/serial/mc68681.h123
-rw-r--r--c/src/libchip/serial/mc68681_baud.c107
-rw-r--r--c/src/libchip/serial/mc68681_p.h317
-rw-r--r--c/src/libchip/serial/mc68681_reg.c61
-rw-r--r--c/src/libchip/serial/mc68681_reg2.c24
-rw-r--r--c/src/libchip/serial/mc68681_reg4.c24
-rw-r--r--c/src/libchip/serial/mc68681_reg8.c24
-rw-r--r--c/src/libchip/serial/ns16550.c660
-rw-r--r--c/src/libchip/serial/ns16550.h42
-rw-r--r--c/src/libchip/serial/ns16550_p.h238
-rw-r--r--c/src/libchip/serial/serial.h152
-rw-r--r--c/src/libchip/serial/serprobe.c20
-rw-r--r--c/src/libchip/serial/sersupp.h22
-rw-r--r--c/src/libchip/serial/termios_baud2index.c39
-rw-r--r--c/src/libchip/serial/termios_baud2num.c39
-rw-r--r--c/src/libchip/serial/z85c30.c889
-rw-r--r--c/src/libchip/serial/z85c30.h78
-rw-r--r--c/src/libchip/serial/z85c30_p.h410
-rw-r--r--c/src/libchip/serial/z85c30_reg.c73
-rw-r--r--c/src/libchip/shmdr/README9
-rw-r--r--c/src/libchip/shmdr/addlq.c43
-rw-r--r--c/src/libchip/shmdr/cnvpkt.c42
-rw-r--r--c/src/libchip/shmdr/dump.c51
-rw-r--r--c/src/libchip/shmdr/fatal.c39
-rw-r--r--c/src/libchip/shmdr/getlq.c48
-rw-r--r--c/src/libchip/shmdr/getpkt.c36
-rw-r--r--c/src/libchip/shmdr/init.c254
-rw-r--r--c/src/libchip/shmdr/initlq.c35
-rw-r--r--c/src/libchip/shmdr/intr.c58
-rw-r--r--c/src/libchip/shmdr/mpci.h59
-rw-r--r--c/src/libchip/shmdr/mpisr.c23
-rw-r--r--c/src/libchip/shmdr/poll.c53
-rw-r--r--c/src/libchip/shmdr/receive.c44
-rw-r--r--c/src/libchip/shmdr/retpkt.c32
-rw-r--r--c/src/libchip/shmdr/send.c61
-rw-r--r--c/src/libchip/shmdr/setckvec.c34
-rw-r--r--c/src/libchip/shmdr/shm_driver.h542
-rw-r--r--c/src/libmisc/README23
-rw-r--r--c/src/libmisc/assoc/Makefile.in52
-rw-r--r--c/src/libmisc/assoc/assoc.c260
-rw-r--r--c/src/libmisc/assoc/assoc.h42
-rw-r--r--c/src/libmisc/cpuuse/Makefile.in54
-rw-r--r--c/src/libmisc/cpuuse/README41
-rw-r--r--c/src/libmisc/cpuuse/cpuuse.c142
-rw-r--r--c/src/libmisc/cpuuse/cpuuse.h41
-rw-r--r--c/src/libmisc/cpuuse/internal.h96
-rw-r--r--c/src/libmisc/error/Makefile.in52
-rw-r--r--c/src/libmisc/error/error.c209
-rw-r--r--c/src/libmisc/error/error.h38
-rw-r--r--c/src/libmisc/monitor/Makefile.in58
-rw-r--r--c/src/libmisc/monitor/README97
-rw-r--r--c/src/libmisc/monitor/mon-command.c187
-rw-r--r--c/src/libmisc/monitor/mon-config.c131
-rw-r--r--c/src/libmisc/monitor/mon-dname.c112
-rw-r--r--c/src/libmisc/monitor/mon-driver.c136
-rw-r--r--c/src/libmisc/monitor/mon-extension.c98
-rw-r--r--c/src/libmisc/monitor/mon-itask.c115
-rw-r--r--c/src/libmisc/monitor/mon-manager.c48
-rw-r--r--c/src/libmisc/monitor/mon-monitor.c518
-rw-r--r--c/src/libmisc/monitor/mon-mpci.c159
-rw-r--r--c/src/libmisc/monitor/mon-object.c374
-rw-r--r--c/src/libmisc/monitor/mon-prmisc.c259
-rw-r--r--c/src/libmisc/monitor/mon-queue.c64
-rw-r--r--c/src/libmisc/monitor/mon-server.c303
-rw-r--r--c/src/libmisc/monitor/mon-symbols.c487
-rw-r--r--c/src/libmisc/monitor/mon-task.c93
-rw-r--r--c/src/libmisc/monitor/monitor.h443
-rw-r--r--c/src/libmisc/monitor/symbols.h62
-rw-r--r--c/src/libmisc/rtmonuse/Makefile.in54
-rw-r--r--c/src/libmisc/rtmonuse/rtmonuse.c178
-rw-r--r--c/src/libmisc/rtmonuse/rtmonuse.h18
-rw-r--r--c/src/libmisc/stackchk/Makefile.in53
-rw-r--r--c/src/libmisc/stackchk/README56
-rw-r--r--c/src/libmisc/stackchk/check.c535
-rw-r--r--c/src/libmisc/stackchk/internal.h96
-rw-r--r--c/src/libmisc/stackchk/stackchk.h83
-rw-r--r--c/src/libmisc/wrapup/Makefile.in42
-rw-r--r--c/src/libnetworking/CHANGELOG54
-rw-r--r--c/src/libnetworking/Makefile.in14
-rw-r--r--c/src/libnetworking/README18
-rw-r--r--c/src/libnetworking/arpa/ftp.h111
-rw-r--r--c/src/libnetworking/arpa/inet.h105
-rw-r--r--c/src/libnetworking/arpa/nameser.h448
-rw-r--r--c/src/libnetworking/arpa/nameser_compat.h194
-rw-r--r--c/src/libnetworking/arpa/telnet.h342
-rw-r--r--c/src/libnetworking/bpfilter.h6
-rw-r--r--c/src/libnetworking/include/Makefile.in65
-rw-r--r--c/src/libnetworking/kern/Makefile.in47
-rw-r--r--c/src/libnetworking/kern/kern_subr.c206
-rw-r--r--c/src/libnetworking/kern/uipc_domain.c228
-rw-r--r--c/src/libnetworking/kern/uipc_mbuf.c851
-rw-r--r--c/src/libnetworking/kern/uipc_socket.c1100
-rw-r--r--c/src/libnetworking/kern/uipc_socket2.c965
-rw-r--r--c/src/libnetworking/lib/Makefile.in46
-rw-r--r--c/src/libnetworking/lib/README5
-rw-r--r--c/src/libnetworking/lib/getprotoby.c46
-rw-r--r--c/src/libnetworking/lib/syslog.c189
-rw-r--r--c/src/libnetworking/lib/tftpDriver.c609
-rw-r--r--c/src/libnetworking/libc/Makefile.in54
-rw-r--r--c/src/libnetworking/libc/addr2ascii.3217
-rw-r--r--c/src/libnetworking/libc/addr2ascii.c94
-rw-r--r--c/src/libnetworking/libc/ascii2addr.c74
-rw-r--r--c/src/libnetworking/libc/base64.c318
-rw-r--r--c/src/libnetworking/libc/byteorder.377
-rw-r--r--c/src/libnetworking/libc/ether_addr.c226
-rw-r--r--c/src/libnetworking/libc/ethers.3193
-rw-r--r--c/src/libnetworking/libc/gethostbydns.c773
-rw-r--r--c/src/libnetworking/libc/gethostbyht.c202
-rw-r--r--c/src/libnetworking/libc/gethostbyname.3305
-rw-r--r--c/src/libnetworking/libc/gethostbynis.c142
-rw-r--r--c/src/libnetworking/libc/gethostnamadr.c224
-rw-r--r--c/src/libnetworking/libc/gethostname.c26
-rw-r--r--c/src/libnetworking/libc/getnetbydns.c313
-rw-r--r--c/src/libnetworking/libc/getnetbyht.c173
-rw-r--r--c/src/libnetworking/libc/getnetbynis.c177
-rw-r--r--c/src/libnetworking/libc/getnetent.3159
-rw-r--r--c/src/libnetworking/libc/getnetnamadr.c190
-rw-r--r--c/src/libnetworking/libc/getproto.c57
-rw-r--r--c/src/libnetworking/libc/getprotoent.3147
-rw-r--r--c/src/libnetworking/libc/getprotoent.c121
-rw-r--r--c/src/libnetworking/libc/getprotoname.c64
-rw-r--r--c/src/libnetworking/libc/getservbyname.c81
-rw-r--r--c/src/libnetworking/libc/getservbyport.c76
-rw-r--r--c/src/libnetworking/libc/getservent.3156
-rw-r--r--c/src/libnetworking/libc/getservent.c280
-rw-r--r--c/src/libnetworking/libc/herror.c122
-rw-r--r--c/src/libnetworking/libc/inet.3210
-rw-r--r--c/src/libnetworking/libc/inet_addr.c180
-rw-r--r--c/src/libnetworking/libc/inet_lnaof.c61
-rw-r--r--c/src/libnetworking/libc/inet_makeaddr.c64
-rw-r--r--c/src/libnetworking/libc/inet_net_ntop.c140
-rw-r--r--c/src/libnetworking/libc/inet_net_pton.c207
-rw-r--r--c/src/libnetworking/libc/inet_neta.c84
-rw-r--r--c/src/libnetworking/libc/inet_netof.c60
-rw-r--r--c/src/libnetworking/libc/inet_network.c92
-rw-r--r--c/src/libnetworking/libc/inet_ntoa.c59
-rw-r--r--c/src/libnetworking/libc/inet_ntop.c191
-rw-r--r--c/src/libnetworking/libc/inet_pton.c214
-rw-r--r--c/src/libnetworking/libc/iso_addr.3111
-rw-r--r--c/src/libnetworking/libc/iso_addr.c119
-rw-r--r--c/src/libnetworking/libc/linkaddr.3138
-rw-r--r--c/src/libnetworking/libc/linkaddr.c160
-rw-r--r--c/src/libnetworking/libc/map_v4v6.c128
-rw-r--r--c/src/libnetworking/libc/ns.3131
-rw-r--r--c/src/libnetworking/libc/ns_addr.c229
-rw-r--r--c/src/libnetworking/libc/ns_name.c595
-rw-r--r--c/src/libnetworking/libc/ns_netint.c56
-rw-r--r--c/src/libnetworking/libc/ns_ntoa.c102
-rw-r--r--c/src/libnetworking/libc/ns_parse.c192
-rw-r--r--c/src/libnetworking/libc/ns_print.c745
-rw-r--r--c/src/libnetworking/libc/ns_ttl.c153
-rw-r--r--c/src/libnetworking/libc/nsap_addr.c105
-rw-r--r--c/src/libnetworking/libc/rcmd.3204
-rw-r--r--c/src/libnetworking/libc/rcmd.c520
-rw-r--r--c/src/libnetworking/libc/recv.c52
-rw-r--r--c/src/libnetworking/libc/res_comp.c258
-rw-r--r--c/src/libnetworking/libc/res_config.h20
-rw-r--r--c/src/libnetworking/libc/res_data.c83
-rw-r--r--c/src/libnetworking/libc/res_debug.c966
-rw-r--r--c/src/libnetworking/libc/res_init.c497
-rw-r--r--c/src/libnetworking/libc/res_mkquery.c199
-rw-r--r--c/src/libnetworking/libc/res_mkupdate.c415
-rw-r--r--c/src/libnetworking/libc/res_query.c410
-rw-r--r--c/src/libnetworking/libc/res_send.c929
-rw-r--r--c/src/libnetworking/libc/res_stubs.c75
-rw-r--r--c/src/libnetworking/libc/res_update.c518
-rw-r--r--c/src/libnetworking/libc/resolver.3352
-rw-r--r--c/src/libnetworking/libc/send.c52
-rw-r--r--c/src/libnetworking/libc/strsep.c85
-rw-r--r--c/src/libnetworking/loop.h5
-rw-r--r--c/src/libnetworking/machine/conf.h6
-rw-r--r--c/src/libnetworking/machine/cpu.h6
-rw-r--r--c/src/libnetworking/machine/cpufunc.h5
-rw-r--r--c/src/libnetworking/machine/endian.h64
-rw-r--r--c/src/libnetworking/machine/in_cksum.h118
-rw-r--r--c/src/libnetworking/machine/limits.h6
-rw-r--r--c/src/libnetworking/machine/param.h92
-rw-r--r--c/src/libnetworking/machine/types.h34
-rw-r--r--c/src/libnetworking/machine/vmparam.h6
-rw-r--r--c/src/libnetworking/net/Makefile.in49
-rw-r--r--c/src/libnetworking/net/bpf.h236
-rw-r--r--c/src/libnetworking/net/ethernet.h63
-rw-r--r--c/src/libnetworking/net/if.c783
-rw-r--r--c/src/libnetworking/net/if.h467
-rw-r--r--c/src/libnetworking/net/if_arp.h91
-rw-r--r--c/src/libnetworking/net/if_dl.h86
-rw-r--r--c/src/libnetworking/net/if_ethersubr.c988
-rw-r--r--c/src/libnetworking/net/if_llc.h145
-rw-r--r--c/src/libnetworking/net/if_loop.c301
-rw-r--r--c/src/libnetworking/net/if_types.h101
-rw-r--r--c/src/libnetworking/net/netisr.h90
-rw-r--r--c/src/libnetworking/net/radix.c1028
-rw-r--r--c/src/libnetworking/net/radix.h165
-rw-r--r--c/src/libnetworking/net/raw_cb.c148
-rw-r--r--c/src/libnetworking/net/raw_cb.h75
-rw-r--r--c/src/libnetworking/net/raw_usrreq.c315
-rw-r--r--c/src/libnetworking/net/route.c959
-rw-r--r--c/src/libnetworking/net/route.h284
-rw-r--r--c/src/libnetworking/net/rtsock.c829
-rw-r--r--c/src/libnetworking/netdb.h182
-rw-r--r--c/src/libnetworking/netinet/Makefile.in53
-rw-r--r--c/src/libnetworking/netinet/icmp_var.h78
-rw-r--r--c/src/libnetworking/netinet/if_ether.c638
-rw-r--r--c/src/libnetworking/netinet/if_ether.h209
-rw-r--r--c/src/libnetworking/netinet/igmp.c479
-rw-r--r--c/src/libnetworking/netinet/igmp.h96
-rw-r--r--c/src/libnetworking/netinet/igmp_var.h111
-rw-r--r--c/src/libnetworking/netinet/in.c728
-rw-r--r--c/src/libnetworking/netinet/in.h433
-rw-r--r--c/src/libnetworking/netinet/in_cksum.c166
-rw-r--r--c/src/libnetworking/netinet/in_cksum_i386.c198
-rw-r--r--c/src/libnetworking/netinet/in_cksum_m68k.c223
-rw-r--r--c/src/libnetworking/netinet/in_pcb.c757
-rw-r--r--c/src/libnetworking/netinet/in_pcb.h124
-rw-r--r--c/src/libnetworking/netinet/in_proto.c203
-rw-r--r--c/src/libnetworking/netinet/in_rmx.c384
-rw-r--r--c/src/libnetworking/netinet/in_systm.h62
-rw-r--r--c/src/libnetworking/netinet/in_var.h235
-rw-r--r--c/src/libnetworking/netinet/ip.h190
-rw-r--r--c/src/libnetworking/netinet/ip_divert.c382
-rw-r--r--c/src/libnetworking/netinet/ip_fw.c1069
-rw-r--r--c/src/libnetworking/netinet/ip_fw.h183
-rw-r--r--c/src/libnetworking/netinet/ip_icmp.c710
-rw-r--r--c/src/libnetworking/netinet/ip_icmp.h190
-rw-r--r--c/src/libnetworking/netinet/ip_input.c1488
-rw-r--r--c/src/libnetworking/netinet/ip_mroute.c2302
-rw-r--r--c/src/libnetworking/netinet/ip_mroute.h262
-rw-r--r--c/src/libnetworking/netinet/ip_output.c1307
-rw-r--r--c/src/libnetworking/netinet/ip_var.h211
-rw-r--r--c/src/libnetworking/netinet/raw_ip.c486
-rw-r--r--c/src/libnetworking/netinet/tcp.h122
-rw-r--r--c/src/libnetworking/netinet/tcp_debug.c172
-rw-r--r--c/src/libnetworking/netinet/tcp_debug.h69
-rw-r--r--c/src/libnetworking/netinet/tcp_fsm.h92
-rw-r--r--c/src/libnetworking/netinet/tcp_input.c2149
-rw-r--r--c/src/libnetworking/netinet/tcp_output.c755
-rw-r--r--c/src/libnetworking/netinet/tcp_seq.h102
-rw-r--r--c/src/libnetworking/netinet/tcp_subr.c634
-rw-r--r--c/src/libnetworking/netinet/tcp_timer.c387
-rw-r--r--c/src/libnetworking/netinet/tcp_timer.h138
-rw-r--r--c/src/libnetworking/netinet/tcp_usrreq.c840
-rw-r--r--c/src/libnetworking/netinet/tcp_var.h374
-rw-r--r--c/src/libnetworking/netinet/tcpip.h75
-rw-r--r--c/src/libnetworking/netinet/udp.h51
-rw-r--r--c/src/libnetworking/netinet/udp_usrreq.c613
-rw-r--r--c/src/libnetworking/netinet/udp_var.h103
-rw-r--r--c/src/libnetworking/nfs/Makefile.in47
-rw-r--r--c/src/libnetworking/nfs/bootp_subr.c968
-rw-r--r--c/src/libnetworking/nfs/krpc.h26
-rw-r--r--c/src/libnetworking/nfs/nfs.h620
-rw-r--r--c/src/libnetworking/nfs/nfsdiskless.h100
-rw-r--r--c/src/libnetworking/nfs/nfsproto.h441
-rw-r--r--c/src/libnetworking/nfs/rpcv2.h142
-rw-r--r--c/src/libnetworking/nfs/xdr_subs.h90
-rw-r--r--c/src/libnetworking/opt_ipfw.h6
-rw-r--r--c/src/libnetworking/opt_mrouting.h6
-rw-r--r--c/src/libnetworking/opt_tcpdebug.h6
-rw-r--r--c/src/libnetworking/poll.h108
-rw-r--r--c/src/libnetworking/resolv.h306
-rw-r--r--c/src/libnetworking/rtems/Makefile.in51
-rw-r--r--c/src/libnetworking/rtems/issetugid.c11
-rw-r--r--c/src/libnetworking/rtems/rtems_bootp.c19
-rw-r--r--c/src/libnetworking/rtems/rtems_bsdnet.h112
-rw-r--r--c/src/libnetworking/rtems/rtems_bsdnet_internal.h178
-rw-r--r--c/src/libnetworking/rtems/rtems_glue.c905
-rw-r--r--c/src/libnetworking/rtems/rtems_showicmpstat.c60
-rw-r--r--c/src/libnetworking/rtems/rtems_showifstat.c110
-rw-r--r--c/src/libnetworking/rtems/rtems_showipstat.c59
-rw-r--r--c/src/libnetworking/rtems/rtems_showmbuf.c65
-rw-r--r--c/src/libnetworking/rtems/rtems_showroute.c237
-rw-r--r--c/src/libnetworking/rtems/rtems_showtcpstat.c102
-rw-r--r--c/src/libnetworking/rtems/rtems_showudpstat.c48
-rw-r--r--c/src/libnetworking/rtems/rtems_syscall.c761
-rw-r--r--c/src/libnetworking/rtems/sghostname.c49
-rw-r--r--c/src/libnetworking/rtems/tftp.h85
-rw-r--r--c/src/libnetworking/sys/buf.h248
-rw-r--r--c/src/libnetworking/sys/callout.h57
-rw-r--r--c/src/libnetworking/sys/cdefs.h177
-rw-r--r--c/src/libnetworking/sys/conf.h228
-rw-r--r--c/src/libnetworking/sys/domain.h75
-rw-r--r--c/src/libnetworking/sys/filio.h56
-rw-r--r--c/src/libnetworking/sys/ioccom.h75
-rw-r--r--c/src/libnetworking/sys/ioctl.h77
-rw-r--r--c/src/libnetworking/sys/kernel.h251
-rw-r--r--c/src/libnetworking/sys/libkern.h89
-rw-r--r--c/src/libnetworking/sys/malloc.h355
-rw-r--r--c/src/libnetworking/sys/mbuf.h439
-rw-r--r--c/src/libnetworking/sys/mount.h531
-rw-r--r--c/src/libnetworking/sys/param.h231
-rw-r--r--c/src/libnetworking/sys/proc.h8
-rw-r--r--c/src/libnetworking/sys/protosw.h300
-rw-r--r--c/src/libnetworking/sys/queue.h446
-rw-r--r--c/src/libnetworking/sys/reboot.h106
-rw-r--r--c/src/libnetworking/sys/resourcevar.h5
-rw-r--r--c/src/libnetworking/sys/rtprio.h70
-rw-r--r--c/src/libnetworking/sys/select.h57
-rw-r--r--c/src/libnetworking/sys/signalvar.h171
-rw-r--r--c/src/libnetworking/sys/socket.h356
-rw-r--r--c/src/libnetworking/sys/socketvar.h279
-rw-r--r--c/src/libnetworking/sys/sockio.h86
-rw-r--r--c/src/libnetworking/sys/sysctl.h379
-rw-r--r--c/src/libnetworking/sys/syslimits.h85
-rw-r--r--c/src/libnetworking/sys/syslog.h194
-rw-r--r--c/src/libnetworking/sys/systm.h198
-rw-r--r--c/src/libnetworking/sys/ttycom.h141
-rw-r--r--c/src/libnetworking/sys/ttydefaults.h97
-rw-r--r--c/src/libnetworking/sys/ucred.h64
-rw-r--r--c/src/libnetworking/sys/uio.h92
-rw-r--r--c/src/libnetworking/syslog.h5
-rw-r--r--c/src/libnetworking/vm/vm.h73
-rw-r--r--c/src/libnetworking/vm/vm_extern.h103
-rw-r--r--c/src/libnetworking/vm/vm_kern.h84
-rw-r--r--c/src/libnetworking/vm/vm_param.h165
-rw-r--r--c/src/libnetworking/wrapup/Makefile.in45
-rw-r--r--c/src/librtems++/README266
-rw-r--r--c/src/librtems++/include/rtems++/rtemsEvent.h127
-rw-r--r--c/src/librtems++/include/rtems++/rtemsInterrupt.h105
-rw-r--r--c/src/librtems++/include/rtems++/rtemsMessageQueue.h176
-rw-r--r--c/src/librtems++/include/rtems++/rtemsSemaphore.h145
-rw-r--r--c/src/librtems++/include/rtems++/rtemsStatusCode.h57
-rw-r--r--c/src/librtems++/include/rtems++/rtemsTask.h171
-rw-r--r--c/src/librtems++/include/rtems++/rtemsTaskMode.h210
-rw-r--r--c/src/librtems++/include/rtems++/rtemsTimer.h145
-rw-r--r--c/src/librtems++/src/Makefile.in50
-rw-r--r--c/src/librtems++/src/rtemsEvent.cc75
-rw-r--r--c/src/librtems++/src/rtemsInterrupt.cc115
-rw-r--r--c/src/librtems++/src/rtemsMessageQueue.cc165
-rw-r--r--c/src/librtems++/src/rtemsSemaphore.cc175
-rw-r--r--c/src/librtems++/src/rtemsStatusCode.cc77
-rw-r--r--c/src/librtems++/src/rtemsTask.cc288
-rw-r--r--c/src/librtems++/src/rtemsTimer.cc101
-rw-r--r--c/src/make/README513
-rw-r--r--c/src/make/compilers/gcc-target-default.cfg330
-rw-r--r--c/src/make/directory.cfg57
-rw-r--r--c/src/make/host.cfg.in74
-rw-r--r--c/src/make/lib.cfg20
-rw-r--r--c/src/optman/rtems/no-dpmem.c98
-rw-r--r--c/src/optman/rtems/no-event.c56
-rw-r--r--c/src/optman/rtems/no-mp.c201
-rw-r--r--c/src/optman/rtems/no-msg.c192
-rw-r--r--c/src/optman/rtems/no-part.c97
-rw-r--r--c/src/optman/rtems/no-region.c114
-rw-r--r--c/src/optman/rtems/no-rtmon.c117
-rw-r--r--c/src/optman/rtems/no-sem.c114
-rw-r--r--c/src/optman/rtems/no-signal.c56
-rw-r--r--c/src/optman/rtems/no-timer.c123
-rw-r--r--c/src/optman/sapi/no-ext.c67
-rw-r--r--c/src/optman/sapi/no-io.c144
-rw-r--r--c/src/tests/Makefile.in29
-rw-r--r--c/src/tests/PROBLEMS42
-rw-r--r--c/src/tests/README44
-rw-r--r--c/src/tests/libtests/Makefile.in19
-rw-r--r--c/src/tests/libtests/README10
-rw-r--r--c/src/tests/libtests/cpuuse/Makefile.in61
-rw-r--r--c/src/tests/libtests/cpuuse/cpuuse.scn24
-rw-r--r--c/src/tests/libtests/cpuuse/init.c106
-rw-r--r--c/src/tests/libtests/cpuuse/system.h69
-rw-r--r--c/src/tests/libtests/cpuuse/task1.c103
-rw-r--r--c/src/tests/libtests/cpuuse/task2.c29
-rw-r--r--c/src/tests/libtests/cpuuse/task3.c29
-rw-r--r--c/src/tests/libtests/cpuuse/tswitch.c62
-rw-r--r--c/src/tests/libtests/malloctest/Makefile.in61
-rw-r--r--c/src/tests/libtests/malloctest/init.c114
-rw-r--r--c/src/tests/libtests/malloctest/system.h51
-rw-r--r--c/src/tests/libtests/malloctest/task1.c67
-rw-r--r--c/src/tests/libtests/monitor/Makefile.in61
-rw-r--r--c/src/tests/libtests/monitor/init.c74
-rw-r--r--c/src/tests/libtests/monitor/system.h58
-rw-r--r--c/src/tests/libtests/rtems++/Init.cc63
-rw-r--r--c/src/tests/libtests/rtems++/Makefile.in67
-rw-r--r--c/src/tests/libtests/rtems++/System.h137
-rw-r--r--c/src/tests/libtests/rtems++/Task1.cc682
-rw-r--r--c/src/tests/libtests/rtems++/Task2.cc81
-rw-r--r--c/src/tests/libtests/rtems++/Task3.cc81
-rw-r--r--c/src/tests/libtests/rtems++/rtems++.doc29
-rw-r--r--c/src/tests/libtests/rtems++/rtems++.scn161
-rw-r--r--c/src/tests/libtests/rtmonuse/Makefile.in61
-rw-r--r--c/src/tests/libtests/rtmonuse/getall.c43
-rw-r--r--c/src/tests/libtests/rtmonuse/init.c71
-rw-r--r--c/src/tests/libtests/rtmonuse/rtmonuse.scn27
-rw-r--r--c/src/tests/libtests/rtmonuse/system.h62
-rw-r--r--c/src/tests/libtests/rtmonuse/task1.c124
-rw-r--r--c/src/tests/libtests/stackchk/Makefile.in61
-rw-r--r--c/src/tests/libtests/stackchk/blow.c49
-rw-r--r--c/src/tests/libtests/stackchk/init.c86
-rw-r--r--c/src/tests/libtests/stackchk/stackchk.scn9
-rw-r--r--c/src/tests/libtests/stackchk/system.h53
-rw-r--r--c/src/tests/libtests/stackchk/task1.c44
-rw-r--r--c/src/tests/libtests/termios/Makefile.in63
-rw-r--r--c/src/tests/libtests/termios/README45
-rw-r--r--c/src/tests/libtests/termios/init.c143
-rw-r--r--c/src/tests/mptests/Makefile.in16
-rw-r--r--c/src/tests/mptests/README10
-rw-r--r--c/src/tests/mptests/mp01/Makefile.in14
-rw-r--r--c/src/tests/mptests/mp01/init.c96
-rw-r--r--c/src/tests/mptests/mp01/node1/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp01/node1/mp01.doc53
-rw-r--r--c/src/tests/mptests/mp01/node1/mp01.scn15
-rw-r--r--c/src/tests/mptests/mp01/node2/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp01/node2/mp01.doc13
-rw-r--r--c/src/tests/mptests/mp01/node2/mp01.scn15
-rw-r--r--c/src/tests/mptests/mp01/system.h46
-rw-r--r--c/src/tests/mptests/mp01/task1.c84
-rw-r--r--c/src/tests/mptests/mp02/Makefile.in14
-rw-r--r--c/src/tests/mptests/mp02/init.c60
-rw-r--r--c/src/tests/mptests/mp02/node1/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp02/node1/mp02.doc47
-rw-r--r--c/src/tests/mptests/mp02/node1/mp02.scn14
-rw-r--r--c/src/tests/mptests/mp02/node2/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp02/node2/mp02.doc13
-rw-r--r--c/src/tests/mptests/mp02/node2/mp02.scn14
-rw-r--r--c/src/tests/mptests/mp02/system.h45
-rw-r--r--c/src/tests/mptests/mp02/task1.c118
-rw-r--r--c/src/tests/mptests/mp03/Makefile.in14
-rw-r--r--c/src/tests/mptests/mp03/delay.c31
-rw-r--r--c/src/tests/mptests/mp03/init.c65
-rw-r--r--c/src/tests/mptests/mp03/node1/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp03/node1/mp03.doc45
-rw-r--r--c/src/tests/mptests/mp03/node1/mp03.scn24
-rw-r--r--c/src/tests/mptests/mp03/node2/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp03/node2/mp03.doc13
-rw-r--r--c/src/tests/mptests/mp03/node2/mp03.scn24
-rw-r--r--c/src/tests/mptests/mp03/system.h58
-rw-r--r--c/src/tests/mptests/mp03/task1.c155
-rw-r--r--c/src/tests/mptests/mp04/Makefile.in14
-rw-r--r--c/src/tests/mptests/mp04/init.c60
-rw-r--r--c/src/tests/mptests/mp04/node1/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp04/node1/mp04.doc41
-rw-r--r--c/src/tests/mptests/mp04/node1/mp04.scn8
-rw-r--r--c/src/tests/mptests/mp04/node2/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp04/node2/mp04.doc13
-rw-r--r--c/src/tests/mptests/mp04/node2/mp04.scn8
-rw-r--r--c/src/tests/mptests/mp04/system.h47
-rw-r--r--c/src/tests/mptests/mp04/task1.c83
-rw-r--r--c/src/tests/mptests/mp05/Makefile.in14
-rw-r--r--c/src/tests/mptests/mp05/asr.c37
-rw-r--r--c/src/tests/mptests/mp05/init.c65
-rw-r--r--c/src/tests/mptests/mp05/node1/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp05/node1/mp05.doc45
-rw-r--r--c/src/tests/mptests/mp05/node1/mp05.scn11
-rw-r--r--c/src/tests/mptests/mp05/node2/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp05/node2/mp05.doc13
-rw-r--r--c/src/tests/mptests/mp05/node2/mp05.scn10
-rw-r--r--c/src/tests/mptests/mp05/system.h63
-rw-r--r--c/src/tests/mptests/mp05/task1.c106
-rw-r--r--c/src/tests/mptests/mp06/Makefile.in14
-rw-r--r--c/src/tests/mptests/mp06/init.c65
-rw-r--r--c/src/tests/mptests/mp06/node1/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp06/node1/mp06.doc45
-rw-r--r--c/src/tests/mptests/mp06/node1/mp06.scn11
-rw-r--r--c/src/tests/mptests/mp06/node2/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp06/node2/mp06.doc13
-rw-r--r--c/src/tests/mptests/mp06/node2/mp06.scn12
-rw-r--r--c/src/tests/mptests/mp06/system.h52
-rw-r--r--c/src/tests/mptests/mp06/task1.c176
-rw-r--r--c/src/tests/mptests/mp07/Makefile.in14
-rw-r--r--c/src/tests/mptests/mp07/init.c65
-rw-r--r--c/src/tests/mptests/mp07/node1/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp07/node1/mp07.doc46
-rw-r--r--c/src/tests/mptests/mp07/node1/mp07.scn10
-rw-r--r--c/src/tests/mptests/mp07/node2/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp07/node2/mp07.doc13
-rw-r--r--c/src/tests/mptests/mp07/node2/mp07.scn9
-rw-r--r--c/src/tests/mptests/mp07/system.h52
-rw-r--r--c/src/tests/mptests/mp07/task1.c103
-rw-r--r--c/src/tests/mptests/mp08/Makefile.in14
-rw-r--r--c/src/tests/mptests/mp08/init.c74
-rw-r--r--c/src/tests/mptests/mp08/node1/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp08/node1/mp08.doc52
-rw-r--r--c/src/tests/mptests/mp08/node1/mp08.scn11
-rw-r--r--c/src/tests/mptests/mp08/node2/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp08/node2/mp08.doc13
-rw-r--r--c/src/tests/mptests/mp08/node2/mp08.scn12
-rw-r--r--c/src/tests/mptests/mp08/system.h51
-rw-r--r--c/src/tests/mptests/mp08/task1.c89
-rw-r--r--c/src/tests/mptests/mp09/Makefile.in14
-rw-r--r--c/src/tests/mptests/mp09/init.c74
-rw-r--r--c/src/tests/mptests/mp09/node1/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp09/node1/mp09.doc50
-rw-r--r--c/src/tests/mptests/mp09/node1/mp09.scn22
-rw-r--r--c/src/tests/mptests/mp09/node2/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp09/node2/mp09.doc13
-rw-r--r--c/src/tests/mptests/mp09/node2/mp09.scn27
-rw-r--r--c/src/tests/mptests/mp09/recvmsg.c47
-rw-r--r--c/src/tests/mptests/mp09/sendmsg.c60
-rw-r--r--c/src/tests/mptests/mp09/system.h60
-rw-r--r--c/src/tests/mptests/mp09/task1.c109
-rw-r--r--c/src/tests/mptests/mp10/Makefile.in14
-rw-r--r--c/src/tests/mptests/mp10/init.c143
-rw-r--r--c/src/tests/mptests/mp10/node1/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp10/node1/mp10.doc46
-rw-r--r--c/src/tests/mptests/mp10/node1/mp10.scn4
-rw-r--r--c/src/tests/mptests/mp10/node2/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp10/node2/mp10.doc13
-rw-r--r--c/src/tests/mptests/mp10/node2/mp10.scn19
-rw-r--r--c/src/tests/mptests/mp10/system.h64
-rw-r--r--c/src/tests/mptests/mp10/task1.c52
-rw-r--r--c/src/tests/mptests/mp10/task2.c47
-rw-r--r--c/src/tests/mptests/mp10/task3.c50
-rw-r--r--c/src/tests/mptests/mp11/Makefile.in14
-rw-r--r--c/src/tests/mptests/mp11/init.c105
-rw-r--r--c/src/tests/mptests/mp11/node1/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp11/node1/mp11.doc42
-rw-r--r--c/src/tests/mptests/mp11/node1/mp11.scn10
-rw-r--r--c/src/tests/mptests/mp11/node2/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp11/node2/mp11.doc13
-rw-r--r--c/src/tests/mptests/mp11/node2/mp11.scn2
-rw-r--r--c/src/tests/mptests/mp11/system.h56
-rw-r--r--c/src/tests/mptests/mp12/Makefile.in14
-rw-r--r--c/src/tests/mptests/mp12/init.c113
-rw-r--r--c/src/tests/mptests/mp12/node1/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp12/node1/mp12.doc52
-rw-r--r--c/src/tests/mptests/mp12/node1/mp12.scn6
-rw-r--r--c/src/tests/mptests/mp12/node2/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp12/node2/mp12.doc13
-rw-r--r--c/src/tests/mptests/mp12/node2/mp12.scn10
-rw-r--r--c/src/tests/mptests/mp12/system.h55
-rw-r--r--c/src/tests/mptests/mp13/Makefile.in14
-rw-r--r--c/src/tests/mptests/mp13/init.c115
-rw-r--r--c/src/tests/mptests/mp13/node1/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp13/node1/mp13.doc48
-rw-r--r--c/src/tests/mptests/mp13/node1/mp13.scn14
-rw-r--r--c/src/tests/mptests/mp13/node2/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp13/node2/mp13.doc13
-rw-r--r--c/src/tests/mptests/mp13/node2/mp13.scn16
-rw-r--r--c/src/tests/mptests/mp13/system.h60
-rw-r--r--c/src/tests/mptests/mp13/task1.c73
-rw-r--r--c/src/tests/mptests/mp13/task2.c106
-rw-r--r--c/src/tests/mptests/mp14/Makefile.in14
-rw-r--r--c/src/tests/mptests/mp14/delay.c34
-rw-r--r--c/src/tests/mptests/mp14/evtask1.c87
-rw-r--r--c/src/tests/mptests/mp14/evtmtask.c65
-rw-r--r--c/src/tests/mptests/mp14/exit.c40
-rw-r--r--c/src/tests/mptests/mp14/init.c191
-rw-r--r--c/src/tests/mptests/mp14/msgtask1.c107
-rw-r--r--c/src/tests/mptests/mp14/node1/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp14/node1/mp14.doc50
-rw-r--r--c/src/tests/mptests/mp14/node1/mp14.scn41
-rw-r--r--c/src/tests/mptests/mp14/node2/Makefile.in63
-rw-r--r--c/src/tests/mptests/mp14/node2/mp14.doc13
-rw-r--r--c/src/tests/mptests/mp14/node2/mp14.scn38
-rw-r--r--c/src/tests/mptests/mp14/pttask1.c71
-rw-r--r--c/src/tests/mptests/mp14/smtask1.c73
-rw-r--r--c/src/tests/mptests/mp14/system.h119
-rw-r--r--c/src/tests/psxtests/Makefile.in16
-rw-r--r--c/src/tests/psxtests/include/pmacros.h85
-rw-r--r--c/src/tests/psxtests/psx01/Makefile.in63
-rw-r--r--c/src/tests/psxtests/psx01/init.c225
-rw-r--r--c/src/tests/psxtests/psx01/psx01.scn46
-rw-r--r--c/src/tests/psxtests/psx01/system.h56
-rw-r--r--c/src/tests/psxtests/psx01/task.c94
-rw-r--r--c/src/tests/psxtests/psx02/Makefile.in63
-rw-r--r--c/src/tests/psxtests/psx02/init.c146
-rw-r--r--c/src/tests/psxtests/psx02/psx02.scn26
-rw-r--r--c/src/tests/psxtests/psx02/system.h52
-rw-r--r--c/src/tests/psxtests/psx02/task.c45
-rw-r--r--c/src/tests/psxtests/psx03/Makefile.in63
-rw-r--r--c/src/tests/psxtests/psx03/init.c176
-rw-r--r--c/src/tests/psxtests/psx03/psx03.scn17
-rw-r--r--c/src/tests/psxtests/psx03/system.h55
-rw-r--r--c/src/tests/psxtests/psx03/task.c65
-rw-r--r--c/src/tests/psxtests/psx04/Makefile.in63
-rw-r--r--c/src/tests/psxtests/psx04/init.c564
-rw-r--r--c/src/tests/psxtests/psx04/psx04.scn112
-rw-r--r--c/src/tests/psxtests/psx04/system.h63
-rw-r--r--c/src/tests/psxtests/psx04/task1.c44
-rw-r--r--c/src/tests/psxtests/psx04/task2.c42
-rw-r--r--c/src/tests/psxtests/psx04/task3.c119
-rw-r--r--c/src/tests/psxtests/psx05/Makefile.in63
-rw-r--r--c/src/tests/psxtests/psx05/init.c569
-rw-r--r--c/src/tests/psxtests/psx05/psx05.scn111
-rw-r--r--c/src/tests/psxtests/psx05/system.h67
-rw-r--r--c/src/tests/psxtests/psx05/task.c58
-rw-r--r--c/src/tests/psxtests/psx05/task2.c49
-rw-r--r--c/src/tests/psxtests/psx05/task3.c51
-rw-r--r--c/src/tests/psxtests/psx06/Makefile.in63
-rw-r--r--c/src/tests/psxtests/psx06/init.c121
-rw-r--r--c/src/tests/psxtests/psx06/psx06.scn21
-rw-r--r--c/src/tests/psxtests/psx06/system.h61
-rw-r--r--c/src/tests/psxtests/psx06/task.c51
-rw-r--r--c/src/tests/psxtests/psx06/task2.c52
-rw-r--r--c/src/tests/psxtests/psx07/Makefile.in63
-rw-r--r--c/src/tests/psxtests/psx07/init.c495
-rw-r--r--c/src/tests/psxtests/psx07/psx07.scn105
-rw-r--r--c/src/tests/psxtests/psx07/system.h51
-rw-r--r--c/src/tests/psxtests/psx07/task.c34
-rw-r--r--c/src/tests/psxtests/psx08/Makefile.in63
-rw-r--r--c/src/tests/psxtests/psx08/init.c82
-rw-r--r--c/src/tests/psxtests/psx08/psx08.scn18
-rw-r--r--c/src/tests/psxtests/psx08/system.h56
-rw-r--r--c/src/tests/psxtests/psx08/task.c56
-rw-r--r--c/src/tests/psxtests/psx08/task2.c52
-rw-r--r--c/src/tests/psxtests/psx09/Makefile.in63
-rw-r--r--c/src/tests/psxtests/psx09/init.c226
-rw-r--r--c/src/tests/psxtests/psx09/psx09.scn23
-rw-r--r--c/src/tests/psxtests/psx09/system.h58
-rw-r--r--c/src/tests/psxtests/psx10/Makefile.in63
-rw-r--r--c/src/tests/psxtests/psx10/init.c312
-rw-r--r--c/src/tests/psxtests/psx10/psx10.scn59
-rw-r--r--c/src/tests/psxtests/psx10/system.h69
-rw-r--r--c/src/tests/psxtests/psx10/task.c65
-rw-r--r--c/src/tests/psxtests/psx10/task2.c47
-rw-r--r--c/src/tests/psxtests/psx10/task3.c46
-rw-r--r--c/src/tests/psxtests/psx11/Makefile.in63
-rw-r--r--c/src/tests/psxtests/psx11/init.c108
-rw-r--r--c/src/tests/psxtests/psx11/psx11.scn18
-rw-r--r--c/src/tests/psxtests/psx11/system.h51
-rw-r--r--c/src/tests/psxtests/psx11/task.c92
-rw-r--r--c/src/tests/psxtests/psx12/Makefile.in63
-rw-r--r--c/src/tests/psxtests/psx12/init.c140
-rw-r--r--c/src/tests/psxtests/psx12/psx12.scn11
-rw-r--r--c/src/tests/psxtests/psx12/system.h54
-rw-r--r--c/src/tests/psxtests/psx12/task.c34
-rw-r--r--c/src/tests/psxtests/psxhdrs/Makefile.in67
-rw-r--r--c/src/tests/psxtests/psxhdrs/clock01.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/clock02.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/clock03.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/clock04.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/clock05.c35
-rw-r--r--c/src/tests/psxtests/psxhdrs/clock06.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/cond01.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/cond02.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/cond03.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/cond04.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/cond05.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/cond06.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/cond07.c30
-rw-r--r--c/src/tests/psxtests/psxhdrs/cond08.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/cond09.c35
-rw-r--r--c/src/tests/psxtests/psxhdrs/cond10.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/key01.c34
-rw-r--r--c/src/tests/psxtests/psxhdrs/key02.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/key03.c30
-rw-r--r--c/src/tests/psxtests/psxhdrs/key04.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex01.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex02.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex03.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex04.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex05.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex06.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex07.c36
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex08.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex09.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex10.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex11.c35
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex12.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex13.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex14.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex15.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/mutex16.c35
-rw-r--r--c/src/tests/psxtests/psxhdrs/proc01.c23
-rw-r--r--c/src/tests/psxtests/psxhdrs/proc02.c23
-rw-r--r--c/src/tests/psxtests/psxhdrs/proc03.c23
-rw-r--r--c/src/tests/psxtests/psxhdrs/proc04.c23
-rw-r--r--c/src/tests/psxtests/psxhdrs/proc05.c23
-rw-r--r--c/src/tests/psxtests/psxhdrs/proc06.c23
-rw-r--r--c/src/tests/psxtests/psxhdrs/proc07.c26
-rw-r--r--c/src/tests/psxtests/psxhdrs/proc08.c26
-rw-r--r--c/src/tests/psxtests/psxhdrs/proc09.c27
-rw-r--r--c/src/tests/psxtests/psxhdrs/proc10.c23
-rw-r--r--c/src/tests/psxtests/psxhdrs/proc11.c25
-rw-r--r--c/src/tests/psxtests/psxhdrs/proc12.c23
-rw-r--r--c/src/tests/psxtests/psxhdrs/proc13.c23
-rw-r--r--c/src/tests/psxtests/psxhdrs/proc14.c25
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread01.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread02.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread03.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread04.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread05.c36
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread06.c33
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread07.c38
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread08.c27
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread09.c27
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread10.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread11.c52
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread12.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread13.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread14.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread15.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread16.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread17.c36
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread18.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread19.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread20.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread21.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread22.c50
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread23.c30
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread24.c36
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread25.c34
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread26.c31
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread27.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread28.c33
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread29.c36
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread30.c36
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread31.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread32.c35
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread33.c25
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread34.c31
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread35.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/pthread36.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/sched01.c44
-rw-r--r--c/src/tests/psxtests/psxhdrs/sched02.c31
-rw-r--r--c/src/tests/psxtests/psxhdrs/sched03.c52
-rw-r--r--c/src/tests/psxtests/psxhdrs/sched04.c30
-rw-r--r--c/src/tests/psxtests/psxhdrs/sched05.c27
-rw-r--r--c/src/tests/psxtests/psxhdrs/sched06.c35
-rw-r--r--c/src/tests/psxtests/psxhdrs/sched07.c35
-rw-r--r--c/src/tests/psxtests/psxhdrs/sched08.c31
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal01.c27
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal02.c27
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal03.c24
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal04.c27
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal05.c24
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal06.c39
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal07.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal08.c34
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal09.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal10.c25
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal11.c26
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal12.c26
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal13.c32
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal14.c26
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal15.c26
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal16.c36
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal17.c27
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal18.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal19.c27
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal20.c26
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal21.c23
-rw-r--r--c/src/tests/psxtests/psxhdrs/signal22.c26
-rw-r--r--c/src/tests/psxtests/psxhdrs/time01.c23
-rw-r--r--c/src/tests/psxtests/psxhdrs/time02.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/time03.c34
-rw-r--r--c/src/tests/psxtests/psxhdrs/time04.c23
-rw-r--r--c/src/tests/psxtests/psxhdrs/time05.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/time06.c24
-rw-r--r--c/src/tests/psxtests/psxhdrs/time07.c24
-rw-r--r--c/src/tests/psxtests/psxhdrs/time08.c24
-rw-r--r--c/src/tests/psxtests/psxhdrs/time09.c24
-rw-r--r--c/src/tests/psxtests/psxhdrs/time10.c25
-rw-r--r--c/src/tests/psxtests/psxhdrs/time11.c25
-rw-r--r--c/src/tests/psxtests/psxhdrs/time12.c25
-rw-r--r--c/src/tests/psxtests/psxhdrs/time13.c25
-rw-r--r--c/src/tests/psxtests/psxhdrs/timer01.c37
-rw-r--r--c/src/tests/psxtests/psxhdrs/timer02.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/timer03.c39
-rw-r--r--c/src/tests/psxtests/psxhdrs/timer04.c29
-rw-r--r--c/src/tests/psxtests/psxhdrs/timer05.c28
-rw-r--r--c/src/tests/psxtests/psxhdrs/timer06.c31
-rw-r--r--c/src/tests/psxtests/support/Makefile.in17
-rw-r--r--c/src/tests/psxtests/support/include/Makefile.in26
-rw-r--r--c/src/tests/psxtests/support/include/pmacros.h85
-rw-r--r--c/src/tests/samples/Makefile.in32
-rw-r--r--c/src/tests/samples/README73
-rw-r--r--c/src/tests/samples/base_mp/Makefile.in14
-rw-r--r--c/src/tests/samples/base_mp/apptask.c37
-rw-r--r--c/src/tests/samples/base_mp/init.c46
-rw-r--r--c/src/tests/samples/base_mp/node1/Makefile.in62
-rw-r--r--c/src/tests/samples/base_mp/node1/base_mp.doc13
-rw-r--r--c/src/tests/samples/base_mp/node1/base_mp.scn5
-rw-r--r--c/src/tests/samples/base_mp/node2/Makefile.in62
-rw-r--r--c/src/tests/samples/base_mp/node2/base_mp.doc13
-rw-r--r--c/src/tests/samples/base_mp/node2/base_mp.scn5
-rw-r--r--c/src/tests/samples/base_mp/system.h48
-rw-r--r--c/src/tests/samples/base_sp/Makefile.in62
-rw-r--r--c/src/tests/samples/base_sp/apptask.c38
-rw-r--r--c/src/tests/samples/base_sp/base_sp.doc13
-rw-r--r--c/src/tests/samples/base_sp/base_sp.scn5
-rw-r--r--c/src/tests/samples/base_sp/init.c48
-rw-r--r--c/src/tests/samples/base_sp/system.h44
-rw-r--r--c/src/tests/samples/cdtest/Makefile.in67
-rw-r--r--c/src/tests/samples/cdtest/cdtest.scn31
-rw-r--r--c/src/tests/samples/cdtest/init.c26
-rw-r--r--c/src/tests/samples/cdtest/main.cc142
-rw-r--r--c/src/tests/samples/cdtest/system.h42
-rw-r--r--c/src/tests/samples/hello/Makefile.in63
-rw-r--r--c/src/tests/samples/hello/hello.doc13
-rw-r--r--c/src/tests/samples/hello/hello.scn3
-rw-r--r--c/src/tests/samples/hello/init.c36
-rw-r--r--c/src/tests/samples/hello/system.h37
-rw-r--r--c/src/tests/samples/paranoia/Makefile.in65
-rw-r--r--c/src/tests/samples/paranoia/init.c48
-rw-r--r--c/src/tests/samples/paranoia/paranoia.c2304
-rw-r--r--c/src/tests/samples/paranoia/paranoia.doc13
-rw-r--r--c/src/tests/samples/paranoia/system.h42
-rw-r--r--c/src/tests/samples/ticker/Makefile.in63
-rw-r--r--c/src/tests/samples/ticker/init.c61
-rw-r--r--c/src/tests/samples/ticker/system.h45
-rw-r--r--c/src/tests/samples/ticker/tasks.c44
-rw-r--r--c/src/tests/samples/ticker/ticker.doc13
-rw-r--r--c/src/tests/samples/ticker/ticker.scn16
-rw-r--r--c/src/tests/sptests/Makefile.in21
-rw-r--r--c/src/tests/sptests/README9
-rw-r--r--c/src/tests/sptests/sp01/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp01/init.c86
-rw-r--r--c/src/tests/sptests/sp01/sp01.doc43
-rw-r--r--c/src/tests/sptests/sp01/sp01.scn18
-rw-r--r--c/src/tests/sptests/sp01/system.h47
-rw-r--r--c/src/tests/sptests/sp01/task1.c50
-rw-r--r--c/src/tests/sptests/sp02/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp02/init.c152
-rw-r--r--c/src/tests/sptests/sp02/preempt.c32
-rw-r--r--c/src/tests/sptests/sp02/sp02.doc37
-rw-r--r--c/src/tests/sptests/sp02/sp02.scn15
-rw-r--r--c/src/tests/sptests/sp02/system.h60
-rw-r--r--c/src/tests/sptests/sp02/task1.c66
-rw-r--r--c/src/tests/sptests/sp02/task2.c34
-rw-r--r--c/src/tests/sptests/sp02/task3.c37
-rw-r--r--c/src/tests/sptests/sp03/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp03/init.c67
-rw-r--r--c/src/tests/sptests/sp03/sp03.doc24
-rw-r--r--c/src/tests/sptests/sp03/sp03.scn26
-rw-r--r--c/src/tests/sptests/sp03/system.h49
-rw-r--r--c/src/tests/sptests/sp03/task1.c59
-rw-r--r--c/src/tests/sptests/sp03/task2.c46
-rw-r--r--c/src/tests/sptests/sp04/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp04/init.c110
-rw-r--r--c/src/tests/sptests/sp04/sp04.doc38
-rw-r--r--c/src/tests/sptests/sp04/sp04.scn23
-rw-r--r--c/src/tests/sptests/sp04/system.h80
-rw-r--r--c/src/tests/sptests/sp04/task1.c118
-rw-r--r--c/src/tests/sptests/sp04/task2.c29
-rw-r--r--c/src/tests/sptests/sp04/task3.c29
-rw-r--r--c/src/tests/sptests/sp04/tswitch.c63
-rw-r--r--c/src/tests/sptests/sp05/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp05/init.c81
-rw-r--r--c/src/tests/sptests/sp05/sp05.doc26
-rw-r--r--c/src/tests/sptests/sp05/sp05.scn47
-rw-r--r--c/src/tests/sptests/sp05/system.h55
-rw-r--r--c/src/tests/sptests/sp05/task1.c78
-rw-r--r--c/src/tests/sptests/sp05/task2.c39
-rw-r--r--c/src/tests/sptests/sp05/task3.c39
-rw-r--r--c/src/tests/sptests/sp06/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp06/init.c87
-rw-r--r--c/src/tests/sptests/sp06/sp06.doc26
-rw-r--r--c/src/tests/sptests/sp06/sp06.scn40
-rw-r--r--c/src/tests/sptests/sp06/system.h58
-rw-r--r--c/src/tests/sptests/sp06/task1.c61
-rw-r--r--c/src/tests/sptests/sp06/task2.c40
-rw-r--r--c/src/tests/sptests/sp06/task3.c32
-rw-r--r--c/src/tests/sptests/sp07/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp07/init.c128
-rw-r--r--c/src/tests/sptests/sp07/sp07.doc37
-rw-r--r--c/src/tests/sptests/sp07/sp07.scn33
-rw-r--r--c/src/tests/sptests/sp07/system.h89
-rw-r--r--c/src/tests/sptests/sp07/task1.c85
-rw-r--r--c/src/tests/sptests/sp07/task2.c78
-rw-r--r--c/src/tests/sptests/sp07/task3.c34
-rw-r--r--c/src/tests/sptests/sp07/task4.c30
-rw-r--r--c/src/tests/sptests/sp07/taskexit.c33
-rw-r--r--c/src/tests/sptests/sp07/tcreate.c35
-rw-r--r--c/src/tests/sptests/sp07/tdelete.c37
-rw-r--r--c/src/tests/sptests/sp07/trestart.c34
-rw-r--r--c/src/tests/sptests/sp07/tstart.c34
-rw-r--r--c/src/tests/sptests/sp08/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp08/init.c53
-rw-r--r--c/src/tests/sptests/sp08/sp08.doc26
-rw-r--r--c/src/tests/sptests/sp08/sp08.scn22
-rw-r--r--c/src/tests/sptests/sp08/system.h52
-rw-r--r--c/src/tests/sptests/sp08/task1.c256
-rw-r--r--c/src/tests/sptests/sp09/Makefile.in66
-rw-r--r--c/src/tests/sptests/sp09/delay.c28
-rw-r--r--c/src/tests/sptests/sp09/init.c120
-rw-r--r--c/src/tests/sptests/sp09/isr.c27
-rw-r--r--c/src/tests/sptests/sp09/screen01.c168
-rw-r--r--c/src/tests/sptests/sp09/screen02.c192
-rw-r--r--c/src/tests/sptests/sp09/screen03.c217
-rw-r--r--c/src/tests/sptests/sp09/screen04.c85
-rw-r--r--c/src/tests/sptests/sp09/screen05.c164
-rw-r--r--c/src/tests/sptests/sp09/screen06.c125
-rw-r--r--c/src/tests/sptests/sp09/screen07.c200
-rw-r--r--c/src/tests/sptests/sp09/screen08.c128
-rw-r--r--c/src/tests/sptests/sp09/screen09.c152
-rw-r--r--c/src/tests/sptests/sp09/screen10.c164
-rw-r--r--c/src/tests/sptests/sp09/screen11.c250
-rw-r--r--c/src/tests/sptests/sp09/screen12.c337
-rw-r--r--c/src/tests/sptests/sp09/screen13.c114
-rw-r--r--c/src/tests/sptests/sp09/screen14.c154
-rw-r--r--c/src/tests/sptests/sp09/sp09.doc36
-rw-r--r--c/src/tests/sptests/sp09/sp09.scn251
-rw-r--r--c/src/tests/sptests/sp09/system.h143
-rw-r--r--c/src/tests/sptests/sp09/task1.c70
-rw-r--r--c/src/tests/sptests/sp09/task2.c48
-rw-r--r--c/src/tests/sptests/sp09/task3.c53
-rw-r--r--c/src/tests/sptests/sp09/task4.c50
-rw-r--r--c/src/tests/sptests/sp11/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp11/init.c92
-rw-r--r--c/src/tests/sptests/sp11/sp11.doc26
-rw-r--r--c/src/tests/sptests/sp11/sp11.scn74
-rw-r--r--c/src/tests/sptests/sp11/system.h92
-rw-r--r--c/src/tests/sptests/sp11/task1.c410
-rw-r--r--c/src/tests/sptests/sp11/task2.c126
-rw-r--r--c/src/tests/sptests/sp11/timer.c97
-rw-r--r--c/src/tests/sptests/sp12/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp12/init.c179
-rw-r--r--c/src/tests/sptests/sp12/pridrv.c131
-rw-r--r--c/src/tests/sptests/sp12/pritask.c91
-rw-r--r--c/src/tests/sptests/sp12/sp12.doc27
-rw-r--r--c/src/tests/sptests/sp12/sp12.scn78
-rw-r--r--c/src/tests/sptests/sp12/system.h84
-rw-r--r--c/src/tests/sptests/sp12/task1.c153
-rw-r--r--c/src/tests/sptests/sp12/task2.c65
-rw-r--r--c/src/tests/sptests/sp12/task3.c50
-rw-r--r--c/src/tests/sptests/sp12/task4.c37
-rw-r--r--c/src/tests/sptests/sp12/task5.c55
-rw-r--r--c/src/tests/sptests/sp13/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp13/fillbuff.c31
-rw-r--r--c/src/tests/sptests/sp13/init.c112
-rw-r--r--c/src/tests/sptests/sp13/putbuff.c29
-rw-r--r--c/src/tests/sptests/sp13/sp13.doc25
-rw-r--r--c/src/tests/sptests/sp13/sp13.scn76
-rw-r--r--c/src/tests/sptests/sp13/system.h70
-rw-r--r--c/src/tests/sptests/sp13/task1.c352
-rw-r--r--c/src/tests/sptests/sp13/task2.c139
-rw-r--r--c/src/tests/sptests/sp13/task3.c78
-rw-r--r--c/src/tests/sptests/sp14/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp14/asr.c47
-rw-r--r--c/src/tests/sptests/sp14/init.c72
-rw-r--r--c/src/tests/sptests/sp14/sp14.doc24
-rw-r--r--c/src/tests/sptests/sp14/sp14.scn33
-rw-r--r--c/src/tests/sptests/sp14/system.h80
-rw-r--r--c/src/tests/sptests/sp14/task1.c116
-rw-r--r--c/src/tests/sptests/sp14/task2.c48
-rw-r--r--c/src/tests/sptests/sp15/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp15/init.c78
-rw-r--r--c/src/tests/sptests/sp15/sp15.doc24
-rw-r--r--c/src/tests/sptests/sp15/sp15.scn16
-rw-r--r--c/src/tests/sptests/sp15/system.h62
-rw-r--r--c/src/tests/sptests/sp15/task1.c129
-rw-r--r--c/src/tests/sptests/sp16/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp16/init.c128
-rw-r--r--c/src/tests/sptests/sp16/sp16.doc24
-rw-r--r--c/src/tests/sptests/sp16/sp16.scn58
-rw-r--r--c/src/tests/sptests/sp16/system.h91
-rw-r--r--c/src/tests/sptests/sp16/task1.c282
-rw-r--r--c/src/tests/sptests/sp16/task2.c86
-rw-r--r--c/src/tests/sptests/sp16/task3.c57
-rw-r--r--c/src/tests/sptests/sp16/task4.c60
-rw-r--r--c/src/tests/sptests/sp16/task5.c73
-rw-r--r--c/src/tests/sptests/sp17/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp17/asr.c32
-rw-r--r--c/src/tests/sptests/sp17/init.c69
-rw-r--r--c/src/tests/sptests/sp17/sp17.doc35
-rw-r--r--c/src/tests/sptests/sp17/sp17.scn8
-rw-r--r--c/src/tests/sptests/sp17/system.h58
-rw-r--r--c/src/tests/sptests/sp17/task1.c48
-rw-r--r--c/src/tests/sptests/sp17/task2.c45
-rw-r--r--c/src/tests/sptests/sp19/Makefile.in64
-rw-r--r--c/src/tests/sptests/sp19/first.c66
-rw-r--r--c/src/tests/sptests/sp19/fptask.c98
-rw-r--r--c/src/tests/sptests/sp19/fptest.h172
-rw-r--r--c/src/tests/sptests/sp19/init.c150
-rw-r--r--c/src/tests/sptests/sp19/inttest.h149
-rw-r--r--c/src/tests/sptests/sp19/sp19.doc23
-rw-r--r--c/src/tests/sptests/sp19/sp19.scn50
-rw-r--r--c/src/tests/sptests/sp19/system.h59
-rw-r--r--c/src/tests/sptests/sp19/task1.c59
-rw-r--r--c/src/tests/sptests/sp20/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp20/getall.c43
-rw-r--r--c/src/tests/sptests/sp20/init.c68
-rw-r--r--c/src/tests/sptests/sp20/sp20.doc24
-rw-r--r--c/src/tests/sptests/sp20/sp20.scn27
-rw-r--r--c/src/tests/sptests/sp20/system.h63
-rw-r--r--c/src/tests/sptests/sp20/task1.c116
-rw-r--r--c/src/tests/sptests/sp21/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp21/init.c53
-rw-r--r--c/src/tests/sptests/sp21/sp21.doc28
-rw-r--r--c/src/tests/sptests/sp21/sp21.scn19
-rw-r--r--c/src/tests/sptests/sp21/system.h46
-rw-r--r--c/src/tests/sptests/sp21/task1.c105
-rw-r--r--c/src/tests/sptests/sp22/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp22/delay.c32
-rw-r--r--c/src/tests/sptests/sp22/init.c66
-rw-r--r--c/src/tests/sptests/sp22/prtime.c32
-rw-r--r--c/src/tests/sptests/sp22/sp22.doc20
-rw-r--r--c/src/tests/sptests/sp22/sp22.scn29
-rw-r--r--c/src/tests/sptests/sp22/system.h60
-rw-r--r--c/src/tests/sptests/sp22/task1.c164
-rw-r--r--c/src/tests/sptests/sp23/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp23/init.c69
-rw-r--r--c/src/tests/sptests/sp23/sp23.doc26
-rw-r--r--c/src/tests/sptests/sp23/sp23.scn9
-rw-r--r--c/src/tests/sptests/sp23/system.h59
-rw-r--r--c/src/tests/sptests/sp23/task1.c96
-rw-r--r--c/src/tests/sptests/sp24/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp24/init.c76
-rw-r--r--c/src/tests/sptests/sp24/resume.c34
-rw-r--r--c/src/tests/sptests/sp24/sp24.doc51
-rw-r--r--c/src/tests/sptests/sp24/sp24.scn16
-rw-r--r--c/src/tests/sptests/sp24/system.h57
-rw-r--r--c/src/tests/sptests/sp24/task1.c58
-rw-r--r--c/src/tests/sptests/sp25/Makefile.in63
-rw-r--r--c/src/tests/sptests/sp25/init.c66
-rw-r--r--c/src/tests/sptests/sp25/sp25.doc32
-rw-r--r--c/src/tests/sptests/sp25/sp25.scn29
-rw-r--r--c/src/tests/sptests/sp25/system.h57
-rw-r--r--c/src/tests/sptests/sp25/task1.c241
-rw-r--r--c/src/tests/sptests/spfatal/Makefile.in63
-rw-r--r--c/src/tests/sptests/spfatal/fatal.c136
-rw-r--r--c/src/tests/sptests/spfatal/init.c51
-rw-r--r--c/src/tests/sptests/spfatal/puterr.c68
-rw-r--r--c/src/tests/sptests/spfatal/spfatal.doc28
-rw-r--r--c/src/tests/sptests/spfatal/spfatal.scn8
-rw-r--r--c/src/tests/sptests/spfatal/system.h79
-rw-r--r--c/src/tests/sptests/spfatal/task1.c29
-rw-r--r--c/src/tests/sptests/spsize/Makefile.in54
-rw-r--r--c/src/tests/sptests/spsize/getint.c32
-rw-r--r--c/src/tests/sptests/spsize/init.c64
-rw-r--r--c/src/tests/sptests/spsize/size.c650
-rw-r--r--c/src/tests/sptests/spsize/system.h47
-rw-r--r--c/src/tests/support/Makefile.in14
-rw-r--r--c/src/tests/support/include/Makefile.in26
-rw-r--r--c/src/tests/support/include/tmacros.h140
-rw-r--r--c/src/tests/support/stubdr/Makefile.in58
-rw-r--r--c/src/tests/support/stubdr/close.c34
-rw-r--r--c/src/tests/support/stubdr/cntrl.c34
-rw-r--r--c/src/tests/support/stubdr/init.c37
-rw-r--r--c/src/tests/support/stubdr/open.c34
-rw-r--r--c/src/tests/support/stubdr/read.c34
-rw-r--r--c/src/tests/support/stubdr/stubdrv.h69
-rw-r--r--c/src/tests/support/stubdr/write.c34
-rw-r--r--c/src/tests/support/wrapup/Makefile.in47
-rw-r--r--c/src/tests/tmtests/Makefile.in20
-rw-r--r--c/src/tests/tmtests/README21
-rw-r--r--c/src/tests/tmtests/include/Makefile.in26
-rw-r--r--c/src/tests/tmtests/include/timesys.h58
-rw-r--r--c/src/tests/tmtests/tm01/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm01/system.h43
-rw-r--r--c/src/tests/tmtests/tm01/task1.c189
-rw-r--r--c/src/tests/tmtests/tm01/tm01.doc13
-rw-r--r--c/src/tests/tmtests/tm02/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm02/system.h44
-rw-r--r--c/src/tests/tmtests/tm02/task1.c158
-rw-r--r--c/src/tests/tmtests/tm02/tm02.doc13
-rw-r--r--c/src/tests/tmtests/tm03/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm03/system.h44
-rw-r--r--c/src/tests/tmtests/tm03/task1.c151
-rw-r--r--c/src/tests/tmtests/tm03/tm03.doc13
-rw-r--r--c/src/tests/tmtests/tm04/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm04/system.h43
-rw-r--r--c/src/tests/tmtests/tm04/task1.c388
-rw-r--r--c/src/tests/tmtests/tm04/tm04.doc13
-rw-r--r--c/src/tests/tmtests/tm05/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm05/system.h44
-rw-r--r--c/src/tests/tmtests/tm05/task1.c132
-rw-r--r--c/src/tests/tmtests/tm05/tm05.doc13
-rw-r--r--c/src/tests/tmtests/tm06/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm06/system.h44
-rw-r--r--c/src/tests/tmtests/tm06/task1.c162
-rw-r--r--c/src/tests/tmtests/tm06/tm06.doc13
-rw-r--r--c/src/tests/tmtests/tm07/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm07/system.h44
-rw-r--r--c/src/tests/tmtests/tm07/task1.c120
-rw-r--r--c/src/tests/tmtests/tm07/tm07.doc13
-rw-r--r--c/src/tests/tmtests/tm08/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm08/system.h44
-rw-r--r--c/src/tests/tmtests/tm08/task1.c255
-rw-r--r--c/src/tests/tmtests/tm08/tm08.doc13
-rw-r--r--c/src/tests/tmtests/tm09/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm09/system.h44
-rw-r--r--c/src/tests/tmtests/tm09/task1.c226
-rw-r--r--c/src/tests/tmtests/tm09/tm09.doc13
-rw-r--r--c/src/tests/tmtests/tm10/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm10/system.h43
-rw-r--r--c/src/tests/tmtests/tm10/task1.c165
-rw-r--r--c/src/tests/tmtests/tm10/tm10.doc13
-rw-r--r--c/src/tests/tmtests/tm11/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm11/system.h43
-rw-r--r--c/src/tests/tmtests/tm11/task1.c155
-rw-r--r--c/src/tests/tmtests/tm11/tm11.doc13
-rw-r--r--c/src/tests/tmtests/tm12/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm12/system.h43
-rw-r--r--c/src/tests/tmtests/tm12/task1.c146
-rw-r--r--c/src/tests/tmtests/tm12/tm12.doc13
-rw-r--r--c/src/tests/tmtests/tm13/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm13/system.h43
-rw-r--r--c/src/tests/tmtests/tm13/task1.c154
-rw-r--r--c/src/tests/tmtests/tm13/tm13.doc13
-rw-r--r--c/src/tests/tmtests/tm14/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm14/system.h43
-rw-r--r--c/src/tests/tmtests/tm14/task1.c146
-rw-r--r--c/src/tests/tmtests/tm14/tm14.doc13
-rw-r--r--c/src/tests/tmtests/tm15/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm15/system.h43
-rw-r--r--c/src/tests/tmtests/tm15/task1.c222
-rw-r--r--c/src/tests/tmtests/tm15/tm15.doc13
-rw-r--r--c/src/tests/tmtests/tm16/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm16/system.h43
-rw-r--r--c/src/tests/tmtests/tm16/task1.c148
-rw-r--r--c/src/tests/tmtests/tm16/tm16.doc13
-rw-r--r--c/src/tests/tmtests/tm17/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm17/system.h43
-rw-r--r--c/src/tests/tmtests/tm17/task1.c127
-rw-r--r--c/src/tests/tmtests/tm17/tm17.doc13
-rw-r--r--c/src/tests/tmtests/tm18/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm18/system.h43
-rw-r--r--c/src/tests/tmtests/tm18/task1.c112
-rw-r--r--c/src/tests/tmtests/tm18/tm18.doc13
-rw-r--r--c/src/tests/tmtests/tm19/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm19/system.h43
-rw-r--r--c/src/tests/tmtests/tm19/task1.c208
-rw-r--r--c/src/tests/tmtests/tm19/tm19.doc13
-rw-r--r--c/src/tests/tmtests/tm20/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm20/system.h44
-rw-r--r--c/src/tests/tmtests/tm20/task1.c466
-rw-r--r--c/src/tests/tmtests/tm20/tm20.doc13
-rw-r--r--c/src/tests/tmtests/tm21/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm21/system.h50
-rw-r--r--c/src/tests/tmtests/tm21/task1.c236
-rw-r--r--c/src/tests/tmtests/tm21/tm21.doc13
-rw-r--r--c/src/tests/tmtests/tm22/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm22/system.h43
-rw-r--r--c/src/tests/tmtests/tm22/task1.c200
-rw-r--r--c/src/tests/tmtests/tm22/tm22.doc13
-rw-r--r--c/src/tests/tmtests/tm23/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm23/system.h43
-rw-r--r--c/src/tests/tmtests/tm23/task1.c302
-rw-r--r--c/src/tests/tmtests/tm23/tm23.doc13
-rw-r--r--c/src/tests/tmtests/tm24/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm24/system.h42
-rw-r--r--c/src/tests/tmtests/tm24/task1.c124
-rw-r--r--c/src/tests/tmtests/tm24/tm24.doc13
-rw-r--r--c/src/tests/tmtests/tm25/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm25/system.h43
-rw-r--r--c/src/tests/tmtests/tm25/task1.c109
-rw-r--r--c/src/tests/tmtests/tm25/tm25.doc13
-rw-r--r--c/src/tests/tmtests/tm26/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm26/fptest.h165
-rw-r--r--c/src/tests/tmtests/tm26/system.h43
-rw-r--r--c/src/tests/tmtests/tm26/task1.c580
-rw-r--r--c/src/tests/tmtests/tm26/tm26.doc13
-rw-r--r--c/src/tests/tmtests/tm27/Makefile.in64
-rw-r--r--c/src/tests/tmtests/tm27/system.h42
-rw-r--r--c/src/tests/tmtests/tm27/task1.c272
-rw-r--r--c/src/tests/tmtests/tm27/tm27.doc13
-rw-r--r--c/src/tests/tmtests/tm28/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm28/system.h43
-rw-r--r--c/src/tests/tmtests/tm28/task1.c134
-rw-r--r--c/src/tests/tmtests/tm28/tm28.doc13
-rw-r--r--c/src/tests/tmtests/tm29/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tm29/system.h43
-rw-r--r--c/src/tests/tmtests/tm29/task1.c207
-rw-r--r--c/src/tests/tmtests/tm29/tm29.doc13
-rw-r--r--c/src/tests/tmtests/tmck/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tmck/system.h42
-rw-r--r--c/src/tests/tmtests/tmck/task1.c180
-rw-r--r--c/src/tests/tmtests/tmck/tmck.doc20
-rw-r--r--c/src/tests/tmtests/tmoverhd/Makefile.in61
-rw-r--r--c/src/tests/tmtests/tmoverhd/dumrtems.h255
-rw-r--r--c/src/tests/tmtests/tmoverhd/empty.c41
-rw-r--r--c/src/tests/tmtests/tmoverhd/system.h60
-rw-r--r--c/src/tests/tmtests/tmoverhd/testtask.c1279
-rw-r--r--c/src/tests/tmtests/tmoverhd/tmoverhd.doc13
-rw-r--r--c/src/tests/tools/Makefile.in14
-rw-r--r--c/src/tests/tools/generic/Makefile.in26
-rw-r--r--c/src/tests/tools/generic/difftest115
-rw-r--r--c/src/tests/tools/generic/sorttimes194
-rw-r--r--c/src/wrapup/Makefile.in73
-rw-r--r--c/update-tools/310_to_320_list545
-rw-r--r--c/update-tools/Makefile.in43
-rw-r--r--c/update-tools/README7
-rw-r--r--c/update-tools/update.in216
-rw-r--r--c/update-tools/word-replace.in89
-rwxr-xr-xconfig.guess695
-rwxr-xr-xconfig.sub1178
-rw-r--r--configure4149
-rw-r--r--configure.in532
-rw-r--r--cpukit/ada/rtems.adb2035
-rw-r--r--cpukit/ada/rtems.ads1430
-rw-r--r--cpukit/libcsupport/include/chain.h362
-rw-r--r--cpukit/libcsupport/include/clockdrv.h51
-rw-r--r--cpukit/libcsupport/include/console.h73
-rw-r--r--cpukit/libcsupport/include/iosupp.h44
-rw-r--r--cpukit/libcsupport/include/motorola/mc68230.h71
-rw-r--r--cpukit/libcsupport/include/motorola/mc68681.h306
-rw-r--r--cpukit/libcsupport/include/ringbuf.h53
-rw-r--r--cpukit/libcsupport/include/rtems/assoc.h42
-rw-r--r--cpukit/libcsupport/include/rtems/error.h38
-rw-r--r--cpukit/libcsupport/include/rtems/libcsupport.h43
-rw-r--r--cpukit/libcsupport/include/rtems/libio.h166
-rw-r--r--cpukit/libcsupport/include/spurious.h38
-rw-r--r--cpukit/libcsupport/include/sys/filio.h56
-rw-r--r--cpukit/libcsupport/include/sys/ioctl.h77
-rw-r--r--cpukit/libcsupport/include/sys/sockio.h86
-rw-r--r--cpukit/libcsupport/include/sys/termios.h190
-rw-r--r--cpukit/libcsupport/include/sys/utsname.h49
-rw-r--r--cpukit/libcsupport/include/timerdrv.h40
-rw-r--r--cpukit/libcsupport/include/vmeintr.h58
-rw-r--r--cpukit/libcsupport/include/zilog/z8036.h109
-rw-r--r--cpukit/libcsupport/include/zilog/z8530.h99
-rw-r--r--cpukit/libcsupport/include/zilog/z8536.h112
-rw-r--r--cpukit/libcsupport/src/README37
-rw-r--r--cpukit/libcsupport/src/__brk.c44
-rw-r--r--cpukit/libcsupport/src/__gettod.c118
-rw-r--r--cpukit/libcsupport/src/__times.c74
-rw-r--r--cpukit/libcsupport/src/assoc.c260
-rw-r--r--cpukit/libcsupport/src/closedir.c20
-rw-r--r--cpukit/libcsupport/src/error.c209
-rw-r--r--cpukit/libcsupport/src/getdents.c14
-rw-r--r--cpukit/libcsupport/src/hosterr.c43
-rw-r--r--cpukit/libcsupport/src/libio.c524
-rw-r--r--cpukit/libcsupport/src/malloc.c424
-rw-r--r--cpukit/libcsupport/src/newlibc.c429
-rw-r--r--cpukit/libcsupport/src/no_libc.c55
-rw-r--r--cpukit/libcsupport/src/opendir.c17
-rw-r--r--cpukit/libcsupport/src/readdir.c14
-rw-r--r--cpukit/libcsupport/src/rewinddir.c20
-rw-r--r--cpukit/libcsupport/src/scandir.c23
-rw-r--r--cpukit/libcsupport/src/seekdir.c21
-rw-r--r--cpukit/libcsupport/src/tcdrain.c26
-rw-r--r--cpukit/libcsupport/src/telldir.c23
-rw-r--r--cpukit/libcsupport/src/termios.c935
-rw-r--r--cpukit/libcsupport/src/unixlibc.c23
-rw-r--r--cpukit/libcsupport/src/utsname.c57
-rw-r--r--cpukit/libmisc/README23
-rw-r--r--cpukit/libmisc/cpuuse/README41
-rw-r--r--cpukit/libmisc/cpuuse/cpuuse.c142
-rw-r--r--cpukit/libmisc/cpuuse/cpuuse.h41
-rw-r--r--cpukit/libmisc/monitor/README97
-rw-r--r--cpukit/libmisc/monitor/mon-command.c187
-rw-r--r--cpukit/libmisc/monitor/mon-config.c131
-rw-r--r--cpukit/libmisc/monitor/mon-dname.c112
-rw-r--r--cpukit/libmisc/monitor/mon-driver.c136
-rw-r--r--cpukit/libmisc/monitor/mon-extension.c98
-rw-r--r--cpukit/libmisc/monitor/mon-itask.c115
-rw-r--r--cpukit/libmisc/monitor/mon-manager.c48
-rw-r--r--cpukit/libmisc/monitor/mon-monitor.c518
-rw-r--r--cpukit/libmisc/monitor/mon-mpci.c159
-rw-r--r--cpukit/libmisc/monitor/mon-object.c374
-rw-r--r--cpukit/libmisc/monitor/mon-prmisc.c259
-rw-r--r--cpukit/libmisc/monitor/mon-queue.c64
-rw-r--r--cpukit/libmisc/monitor/mon-server.c303
-rw-r--r--cpukit/libmisc/monitor/mon-symbols.c487
-rw-r--r--cpukit/libmisc/monitor/mon-task.c93
-rw-r--r--cpukit/libmisc/monitor/monitor.h443
-rw-r--r--cpukit/libmisc/monitor/symbols.h62
-rw-r--r--cpukit/libmisc/rtmonuse/rtmonuse.c178
-rw-r--r--cpukit/libmisc/rtmonuse/rtmonuse.h18
-rw-r--r--cpukit/libmisc/stackchk/README56
-rw-r--r--cpukit/libmisc/stackchk/check.c535
-rw-r--r--cpukit/libmisc/stackchk/internal.h96
-rw-r--r--cpukit/libmisc/stackchk/stackchk.h83
-rw-r--r--cpukit/libnetworking/README18
-rw-r--r--cpukit/libnetworking/arpa/ftp.h111
-rw-r--r--cpukit/libnetworking/arpa/inet.h105
-rw-r--r--cpukit/libnetworking/arpa/nameser.h448
-rw-r--r--cpukit/libnetworking/arpa/nameser_compat.h194
-rw-r--r--cpukit/libnetworking/arpa/telnet.h342
-rw-r--r--cpukit/libnetworking/bpfilter.h6
-rw-r--r--cpukit/libnetworking/kern/kern_subr.c206
-rw-r--r--cpukit/libnetworking/kern/uipc_domain.c228
-rw-r--r--cpukit/libnetworking/kern/uipc_mbuf.c851
-rw-r--r--cpukit/libnetworking/kern/uipc_socket.c1100
-rw-r--r--cpukit/libnetworking/kern/uipc_socket2.c965
-rw-r--r--cpukit/libnetworking/lib/README5
-rw-r--r--cpukit/libnetworking/lib/getprotoby.c46
-rw-r--r--cpukit/libnetworking/lib/syslog.c189
-rw-r--r--cpukit/libnetworking/lib/tftpDriver.c609
-rw-r--r--cpukit/libnetworking/libc/addr2ascii.3217
-rw-r--r--cpukit/libnetworking/libc/addr2ascii.c94
-rw-r--r--cpukit/libnetworking/libc/ascii2addr.c74
-rw-r--r--cpukit/libnetworking/libc/base64.c318
-rw-r--r--cpukit/libnetworking/libc/byteorder.377
-rw-r--r--cpukit/libnetworking/libc/ether_addr.c226
-rw-r--r--cpukit/libnetworking/libc/ethers.3193
-rw-r--r--cpukit/libnetworking/libc/gethostbydns.c773
-rw-r--r--cpukit/libnetworking/libc/gethostbyht.c202
-rw-r--r--cpukit/libnetworking/libc/gethostbyname.3305
-rw-r--r--cpukit/libnetworking/libc/gethostbynis.c142
-rw-r--r--cpukit/libnetworking/libc/gethostnamadr.c224
-rw-r--r--cpukit/libnetworking/libc/gethostname.c26
-rw-r--r--cpukit/libnetworking/libc/getnetbydns.c313
-rw-r--r--cpukit/libnetworking/libc/getnetbyht.c173
-rw-r--r--cpukit/libnetworking/libc/getnetbynis.c177
-rw-r--r--cpukit/libnetworking/libc/getnetent.3159
-rw-r--r--cpukit/libnetworking/libc/getnetnamadr.c190
-rw-r--r--cpukit/libnetworking/libc/getproto.c57
-rw-r--r--cpukit/libnetworking/libc/getprotoent.3147
-rw-r--r--cpukit/libnetworking/libc/getprotoent.c121
-rw-r--r--cpukit/libnetworking/libc/getprotoname.c64
-rw-r--r--cpukit/libnetworking/libc/getservbyname.c81
-rw-r--r--cpukit/libnetworking/libc/getservbyport.c76
-rw-r--r--cpukit/libnetworking/libc/getservent.3156
-rw-r--r--cpukit/libnetworking/libc/getservent.c280
-rw-r--r--cpukit/libnetworking/libc/herror.c122
-rw-r--r--cpukit/libnetworking/libc/inet.3210
-rw-r--r--cpukit/libnetworking/libc/inet_addr.c180
-rw-r--r--cpukit/libnetworking/libc/inet_lnaof.c61
-rw-r--r--cpukit/libnetworking/libc/inet_makeaddr.c64
-rw-r--r--cpukit/libnetworking/libc/inet_net_ntop.c140
-rw-r--r--cpukit/libnetworking/libc/inet_net_pton.c207
-rw-r--r--cpukit/libnetworking/libc/inet_neta.c84
-rw-r--r--cpukit/libnetworking/libc/inet_netof.c60
-rw-r--r--cpukit/libnetworking/libc/inet_network.c92
-rw-r--r--cpukit/libnetworking/libc/inet_ntoa.c59
-rw-r--r--cpukit/libnetworking/libc/inet_ntop.c191
-rw-r--r--cpukit/libnetworking/libc/inet_pton.c214
-rw-r--r--cpukit/libnetworking/libc/iso_addr.3111
-rw-r--r--cpukit/libnetworking/libc/iso_addr.c119
-rw-r--r--cpukit/libnetworking/libc/linkaddr.3138
-rw-r--r--cpukit/libnetworking/libc/linkaddr.c160
-rw-r--r--cpukit/libnetworking/libc/map_v4v6.c128
-rw-r--r--cpukit/libnetworking/libc/ns.3131
-rw-r--r--cpukit/libnetworking/libc/ns_addr.c229
-rw-r--r--cpukit/libnetworking/libc/ns_name.c595
-rw-r--r--cpukit/libnetworking/libc/ns_netint.c56
-rw-r--r--cpukit/libnetworking/libc/ns_ntoa.c102
-rw-r--r--cpukit/libnetworking/libc/ns_parse.c192
-rw-r--r--cpukit/libnetworking/libc/ns_print.c745
-rw-r--r--cpukit/libnetworking/libc/ns_ttl.c153
-rw-r--r--cpukit/libnetworking/libc/nsap_addr.c105
-rw-r--r--cpukit/libnetworking/libc/rcmd.3204
-rw-r--r--cpukit/libnetworking/libc/rcmd.c520
-rw-r--r--cpukit/libnetworking/libc/recv.c52
-rw-r--r--cpukit/libnetworking/libc/res_comp.c258
-rw-r--r--cpukit/libnetworking/libc/res_config.h20
-rw-r--r--cpukit/libnetworking/libc/res_data.c83
-rw-r--r--cpukit/libnetworking/libc/res_debug.c966
-rw-r--r--cpukit/libnetworking/libc/res_init.c497
-rw-r--r--cpukit/libnetworking/libc/res_mkquery.c199
-rw-r--r--cpukit/libnetworking/libc/res_mkupdate.c415
-rw-r--r--cpukit/libnetworking/libc/res_query.c410
-rw-r--r--cpukit/libnetworking/libc/res_send.c929
-rw-r--r--cpukit/libnetworking/libc/res_stubs.c75
-rw-r--r--cpukit/libnetworking/libc/res_update.c518
-rw-r--r--cpukit/libnetworking/libc/resolver.3352
-rw-r--r--cpukit/libnetworking/libc/send.c52
-rw-r--r--cpukit/libnetworking/libc/strsep.c85
-rw-r--r--cpukit/libnetworking/loop.h5
-rw-r--r--cpukit/libnetworking/machine/conf.h6
-rw-r--r--cpukit/libnetworking/machine/cpu.h6
-rw-r--r--cpukit/libnetworking/machine/cpufunc.h5
-rw-r--r--cpukit/libnetworking/machine/endian.h64
-rw-r--r--cpukit/libnetworking/machine/in_cksum.h118
-rw-r--r--cpukit/libnetworking/machine/limits.h6
-rw-r--r--cpukit/libnetworking/machine/param.h92
-rw-r--r--cpukit/libnetworking/machine/types.h34
-rw-r--r--cpukit/libnetworking/machine/vmparam.h6
-rw-r--r--cpukit/libnetworking/net/bpf.h236
-rw-r--r--cpukit/libnetworking/net/ethernet.h63
-rw-r--r--cpukit/libnetworking/net/if.c783
-rw-r--r--cpukit/libnetworking/net/if.h467
-rw-r--r--cpukit/libnetworking/net/if_arp.h91
-rw-r--r--cpukit/libnetworking/net/if_dl.h86
-rw-r--r--cpukit/libnetworking/net/if_ethersubr.c988
-rw-r--r--cpukit/libnetworking/net/if_llc.h145
-rw-r--r--cpukit/libnetworking/net/if_loop.c301
-rw-r--r--cpukit/libnetworking/net/if_types.h101
-rw-r--r--cpukit/libnetworking/net/netisr.h90
-rw-r--r--cpukit/libnetworking/net/radix.c1028
-rw-r--r--cpukit/libnetworking/net/radix.h165
-rw-r--r--cpukit/libnetworking/net/raw_cb.c148
-rw-r--r--cpukit/libnetworking/net/raw_cb.h75
-rw-r--r--cpukit/libnetworking/net/raw_usrreq.c315
-rw-r--r--cpukit/libnetworking/net/route.c959
-rw-r--r--cpukit/libnetworking/net/route.h284
-rw-r--r--cpukit/libnetworking/net/rtsock.c829
-rw-r--r--cpukit/libnetworking/netdb.h182
-rw-r--r--cpukit/libnetworking/netinet/icmp_var.h78
-rw-r--r--cpukit/libnetworking/netinet/if_ether.c638
-rw-r--r--cpukit/libnetworking/netinet/if_ether.h209
-rw-r--r--cpukit/libnetworking/netinet/igmp.c479
-rw-r--r--cpukit/libnetworking/netinet/igmp.h96
-rw-r--r--cpukit/libnetworking/netinet/igmp_var.h111
-rw-r--r--cpukit/libnetworking/netinet/in.c728
-rw-r--r--cpukit/libnetworking/netinet/in.h433
-rw-r--r--cpukit/libnetworking/netinet/in_cksum.c166
-rw-r--r--cpukit/libnetworking/netinet/in_cksum_i386.c198
-rw-r--r--cpukit/libnetworking/netinet/in_cksum_i386.h198
-rw-r--r--cpukit/libnetworking/netinet/in_cksum_m68k.c223
-rw-r--r--cpukit/libnetworking/netinet/in_cksum_m68k.h223
-rw-r--r--cpukit/libnetworking/netinet/in_pcb.c757
-rw-r--r--cpukit/libnetworking/netinet/in_pcb.h124
-rw-r--r--cpukit/libnetworking/netinet/in_proto.c203
-rw-r--r--cpukit/libnetworking/netinet/in_rmx.c384
-rw-r--r--cpukit/libnetworking/netinet/in_systm.h62
-rw-r--r--cpukit/libnetworking/netinet/in_var.h235
-rw-r--r--cpukit/libnetworking/netinet/ip.h190
-rw-r--r--cpukit/libnetworking/netinet/ip_divert.c382
-rw-r--r--cpukit/libnetworking/netinet/ip_fw.c1069
-rw-r--r--cpukit/libnetworking/netinet/ip_fw.h183
-rw-r--r--cpukit/libnetworking/netinet/ip_icmp.c710
-rw-r--r--cpukit/libnetworking/netinet/ip_icmp.h190
-rw-r--r--cpukit/libnetworking/netinet/ip_input.c1488
-rw-r--r--cpukit/libnetworking/netinet/ip_mroute.c2302
-rw-r--r--cpukit/libnetworking/netinet/ip_mroute.h262
-rw-r--r--cpukit/libnetworking/netinet/ip_output.c1307
-rw-r--r--cpukit/libnetworking/netinet/ip_var.h211
-rw-r--r--cpukit/libnetworking/netinet/raw_ip.c486
-rw-r--r--cpukit/libnetworking/netinet/tcp.h122
-rw-r--r--cpukit/libnetworking/netinet/tcp_debug.c172
-rw-r--r--cpukit/libnetworking/netinet/tcp_debug.h69
-rw-r--r--cpukit/libnetworking/netinet/tcp_fsm.h92
-rw-r--r--cpukit/libnetworking/netinet/tcp_input.c2149
-rw-r--r--cpukit/libnetworking/netinet/tcp_output.c755
-rw-r--r--cpukit/libnetworking/netinet/tcp_seq.h102
-rw-r--r--cpukit/libnetworking/netinet/tcp_subr.c634
-rw-r--r--cpukit/libnetworking/netinet/tcp_timer.c387
-rw-r--r--cpukit/libnetworking/netinet/tcp_timer.h138
-rw-r--r--cpukit/libnetworking/netinet/tcp_usrreq.c840
-rw-r--r--cpukit/libnetworking/netinet/tcp_var.h374
-rw-r--r--cpukit/libnetworking/netinet/tcpip.h75
-rw-r--r--cpukit/libnetworking/netinet/udp.h51
-rw-r--r--cpukit/libnetworking/netinet/udp_usrreq.c613
-rw-r--r--cpukit/libnetworking/netinet/udp_var.h103
-rw-r--r--cpukit/libnetworking/nfs/bootp_subr.c968
-rw-r--r--cpukit/libnetworking/nfs/krpc.h26
-rw-r--r--cpukit/libnetworking/nfs/nfs.h620
-rw-r--r--cpukit/libnetworking/nfs/nfsdiskless.h100
-rw-r--r--cpukit/libnetworking/nfs/nfsproto.h441
-rw-r--r--cpukit/libnetworking/nfs/rpcv2.h142
-rw-r--r--cpukit/libnetworking/nfs/xdr_subs.h90
-rw-r--r--cpukit/libnetworking/opt_ipfw.h6
-rw-r--r--cpukit/libnetworking/opt_mrouting.h6
-rw-r--r--cpukit/libnetworking/opt_tcpdebug.h6
-rw-r--r--cpukit/libnetworking/poll.h108
-rw-r--r--cpukit/libnetworking/resolv.h306
-rw-r--r--cpukit/libnetworking/rtems/issetugid.c11
-rw-r--r--cpukit/libnetworking/rtems/rtems_bootp.c19
-rw-r--r--cpukit/libnetworking/rtems/rtems_bsdnet.h112
-rw-r--r--cpukit/libnetworking/rtems/rtems_bsdnet_internal.h178
-rw-r--r--cpukit/libnetworking/rtems/rtems_glue.c905
-rw-r--r--cpukit/libnetworking/rtems/rtems_showicmpstat.c60
-rw-r--r--cpukit/libnetworking/rtems/rtems_showifstat.c110
-rw-r--r--cpukit/libnetworking/rtems/rtems_showipstat.c59
-rw-r--r--cpukit/libnetworking/rtems/rtems_showmbuf.c65
-rw-r--r--cpukit/libnetworking/rtems/rtems_showroute.c237
-rw-r--r--cpukit/libnetworking/rtems/rtems_showtcpstat.c102
-rw-r--r--cpukit/libnetworking/rtems/rtems_showudpstat.c48
-rw-r--r--cpukit/libnetworking/rtems/rtems_syscall.c761
-rw-r--r--cpukit/libnetworking/rtems/sghostname.c49
-rw-r--r--cpukit/libnetworking/rtems/tftp.h85
-rw-r--r--cpukit/libnetworking/sys/buf.h248
-rw-r--r--cpukit/libnetworking/sys/callout.h57
-rw-r--r--cpukit/libnetworking/sys/conf.h228
-rw-r--r--cpukit/libnetworking/sys/domain.h75
-rw-r--r--cpukit/libnetworking/sys/kernel.h251
-rw-r--r--cpukit/libnetworking/sys/libkern.h89
-rw-r--r--cpukit/libnetworking/sys/malloc.h355
-rw-r--r--cpukit/libnetworking/sys/mbuf.h439
-rw-r--r--cpukit/libnetworking/sys/mount.h531
-rw-r--r--cpukit/libnetworking/sys/param.h231
-rw-r--r--cpukit/libnetworking/sys/proc.h8
-rw-r--r--cpukit/libnetworking/sys/protosw.h300
-rw-r--r--cpukit/libnetworking/sys/queue.h446
-rw-r--r--cpukit/libnetworking/sys/reboot.h106
-rw-r--r--cpukit/libnetworking/sys/resourcevar.h5
-rw-r--r--cpukit/libnetworking/sys/rtprio.h70
-rw-r--r--cpukit/libnetworking/sys/select.h57
-rw-r--r--cpukit/libnetworking/sys/signalvar.h171
-rw-r--r--cpukit/libnetworking/sys/socket.h356
-rw-r--r--cpukit/libnetworking/sys/socketvar.h279
-rw-r--r--cpukit/libnetworking/sys/sysctl.h379
-rw-r--r--cpukit/libnetworking/sys/syslimits.h85
-rw-r--r--cpukit/libnetworking/sys/syslog.h194
-rw-r--r--cpukit/libnetworking/sys/systm.h198
-rw-r--r--cpukit/libnetworking/sys/ttydefaults.h97
-rw-r--r--cpukit/libnetworking/sys/ucred.h64
-rw-r--r--cpukit/libnetworking/sys/uio.h92
-rw-r--r--cpukit/libnetworking/syslog.h5
-rw-r--r--cpukit/libnetworking/vm/vm.h73
-rw-r--r--cpukit/libnetworking/vm/vm_extern.h103
-rw-r--r--cpukit/libnetworking/vm/vm_kern.h84
-rw-r--r--cpukit/libnetworking/vm/vm_param.h165
-rw-r--r--cpukit/posix/include/aio.h137
-rw-r--r--cpukit/posix/include/devctl.h30
-rw-r--r--cpukit/posix/include/intr.h72
-rw-r--r--cpukit/posix/include/mqueue.h145
-rw-r--r--cpukit/posix/include/rtems/posix/cancel.h16
-rw-r--r--cpukit/posix/include/rtems/posix/cond.h130
-rw-r--r--cpukit/posix/include/rtems/posix/condmp.h162
-rw-r--r--cpukit/posix/include/rtems/posix/config.h59
-rw-r--r--cpukit/posix/include/rtems/posix/intr.h154
-rw-r--r--cpukit/posix/include/rtems/posix/key.h136
-rw-r--r--cpukit/posix/include/rtems/posix/mqueue.h186
-rw-r--r--cpukit/posix/include/rtems/posix/mqueuemp.h161
-rw-r--r--cpukit/posix/include/rtems/posix/mutex.h120
-rw-r--r--cpukit/posix/include/rtems/posix/mutexmp.h161
-rw-r--r--cpukit/posix/include/rtems/posix/posixapi.h34
-rw-r--r--cpukit/posix/include/rtems/posix/priority.h44
-rw-r--r--cpukit/posix/include/rtems/posix/psignal.h22
-rw-r--r--cpukit/posix/include/rtems/posix/pthread.h123
-rw-r--r--cpukit/posix/include/rtems/posix/pthreadmp.h161
-rw-r--r--cpukit/posix/include/rtems/posix/semaphore.h135
-rw-r--r--cpukit/posix/include/rtems/posix/semaphoremp.h161
-rw-r--r--cpukit/posix/include/rtems/posix/threadsup.h46
-rw-r--r--cpukit/posix/include/rtems/posix/time.h50
-rw-r--r--cpukit/posix/include/sched.h88
-rw-r--r--cpukit/posix/include/semaphore.h108
-rw-r--r--cpukit/posix/inline/rtems/posix/cond.inl77
-rw-r--r--cpukit/posix/inline/rtems/posix/intr.inl72
-rw-r--r--cpukit/posix/inline/rtems/posix/key.inl70
-rw-r--r--cpukit/posix/inline/rtems/posix/mqueue.inl83
-rw-r--r--cpukit/posix/inline/rtems/posix/mutex.inl93
-rw-r--r--cpukit/posix/inline/rtems/posix/priority.inl37
-rw-r--r--cpukit/posix/inline/rtems/posix/pthread.inl70
-rw-r--r--cpukit/posix/inline/rtems/posix/semaphore.inl71
-rw-r--r--cpukit/posix/src/adasupp.c28
-rw-r--r--cpukit/posix/src/aio.c111
-rw-r--r--cpukit/posix/src/cancel.c228
-rw-r--r--cpukit/posix/src/cond.c502
-rw-r--r--cpukit/posix/src/devctl.c22
-rw-r--r--cpukit/posix/src/execl.c17
-rw-r--r--cpukit/posix/src/execle.c17
-rw-r--r--cpukit/posix/src/execlp.c17
-rw-r--r--cpukit/posix/src/execv.c17
-rw-r--r--cpukit/posix/src/execve.c18
-rw-r--r--cpukit/posix/src/execvp.c16
-rw-r--r--cpukit/posix/src/fork.c14
-rw-r--r--cpukit/posix/src/getpid.c22
-rw-r--r--cpukit/posix/src/intr.c340
-rw-r--r--cpukit/posix/src/key.c262
-rw-r--r--cpukit/posix/src/mqueue.c710
-rw-r--r--cpukit/posix/src/mutex.c688
-rw-r--r--cpukit/posix/src/psignal.c1343
-rw-r--r--cpukit/posix/src/pthread.c1313
-rw-r--r--cpukit/posix/src/pthreadatfork.c18
-rw-r--r--cpukit/posix/src/ptimer.c75
-rw-r--r--cpukit/posix/src/sched.c153
-rw-r--r--cpukit/posix/src/semaphore.c571
-rw-r--r--cpukit/posix/src/time.c396
-rw-r--r--cpukit/posix/src/types.c212
-rw-r--r--cpukit/posix/src/wait.c17
-rw-r--r--cpukit/posix/src/waitpid.c17
-rw-r--r--cpukit/rtems/include/rtems.h121
-rw-r--r--cpukit/rtems/include/rtems/rtems/asr.h112
-rw-r--r--cpukit/rtems/include/rtems/rtems/attr.h87
-rw-r--r--cpukit/rtems/include/rtems/rtems/clock.h103
-rw-r--r--cpukit/rtems/include/rtems/rtems/config.h54
-rw-r--r--cpukit/rtems/include/rtems/rtems/dpmem.h157
-rw-r--r--cpukit/rtems/include/rtems/rtems/event.h174
-rw-r--r--cpukit/rtems/include/rtems/rtems/eventmp.h147
-rw-r--r--cpukit/rtems/include/rtems/rtems/eventset.h89
-rw-r--r--cpukit/rtems/include/rtems/rtems/intr.h160
-rw-r--r--cpukit/rtems/include/rtems/rtems/message.h334
-rw-r--r--cpukit/rtems/include/rtems/rtems/modes.h89
-rw-r--r--cpukit/rtems/include/rtems/rtems/mp.h53
-rw-r--r--cpukit/rtems/include/rtems/rtems/msgmp.h177
-rw-r--r--cpukit/rtems/include/rtems/rtems/options.h53
-rw-r--r--cpukit/rtems/include/rtems/rtems/part.h168
-rw-r--r--cpukit/rtems/include/rtems/rtems/partmp.h161
-rw-r--r--cpukit/rtems/include/rtems/rtems/ratemon.h213
-rw-r--r--cpukit/rtems/include/rtems/rtems/region.h234
-rw-r--r--cpukit/rtems/include/rtems/rtems/regionmp.h166
-rw-r--r--cpukit/rtems/include/rtems/rtems/rtemsapi.h34
-rw-r--r--cpukit/rtems/include/rtems/rtems/sem.h248
-rw-r--r--cpukit/rtems/include/rtems/rtems/semmp.h163
-rw-r--r--cpukit/rtems/include/rtems/rtems/signal.h83
-rw-r--r--cpukit/rtems/include/rtems/rtems/signalmp.h147
-rw-r--r--cpukit/rtems/include/rtems/rtems/status.h84
-rw-r--r--cpukit/rtems/include/rtems/rtems/support.h99
-rw-r--r--cpukit/rtems/include/rtems/rtems/taskmp.h167
-rw-r--r--cpukit/rtems/include/rtems/rtems/tasks.h421
-rw-r--r--cpukit/rtems/include/rtems/rtems/timer.h207
-rw-r--r--cpukit/rtems/include/rtems/rtems/types.h96
-rw-r--r--cpukit/rtems/inline/rtems/rtems/asr.inl128
-rw-r--r--cpukit/rtems/inline/rtems/rtems/attr.inl176
-rw-r--r--cpukit/rtems/inline/rtems/rtems/dpmem.inl95
-rw-r--r--cpukit/rtems/inline/rtems/rtems/event.inl21
-rw-r--r--cpukit/rtems/inline/rtems/rtems/eventset.inl95
-rw-r--r--cpukit/rtems/inline/rtems/rtems/message.inl83
-rw-r--r--cpukit/rtems/inline/rtems/rtems/modes.inl152
-rw-r--r--cpukit/rtems/inline/rtems/rtems/options.inl55
-rw-r--r--cpukit/rtems/inline/rtems/rtems/part.inl199
-rw-r--r--cpukit/rtems/inline/rtems/rtems/ratemon.inl143
-rw-r--r--cpukit/rtems/inline/rtems/rtems/region.inl127
-rw-r--r--cpukit/rtems/inline/rtems/rtems/sem.inl93
-rw-r--r--cpukit/rtems/inline/rtems/rtems/status.inl56
-rw-r--r--cpukit/rtems/inline/rtems/rtems/support.inl61
-rw-r--r--cpukit/rtems/inline/rtems/rtems/tasks.inl90
-rw-r--r--cpukit/rtems/inline/rtems/rtems/timer.inl142
-rw-r--r--cpukit/rtems/macros/rtems/rtems/asr.inl90
-rw-r--r--cpukit/rtems/macros/rtems/rtems/attr.inl100
-rw-r--r--cpukit/rtems/macros/rtems/rtems/dpmem.inl59
-rw-r--r--cpukit/rtems/macros/rtems/rtems/event.inl21
-rw-r--r--cpukit/rtems/macros/rtems/rtems/eventset.inl59
-rw-r--r--cpukit/rtems/macros/rtems/rtems/message.inl49
-rw-r--r--cpukit/rtems/macros/rtems/rtems/modes.inl92
-rw-r--r--cpukit/rtems/macros/rtems/rtems/options.inl39
-rw-r--r--cpukit/rtems/macros/rtems/rtems/part.inl117
-rw-r--r--cpukit/rtems/macros/rtems/rtems/ratemon.inl85
-rw-r--r--cpukit/rtems/macros/rtems/rtems/region.inl75
-rw-r--r--cpukit/rtems/macros/rtems/rtems/sem.inl58
-rw-r--r--cpukit/rtems/macros/rtems/rtems/status.inl39
-rw-r--r--cpukit/rtems/macros/rtems/rtems/support.inl44
-rw-r--r--cpukit/rtems/macros/rtems/rtems/tasks.inl58
-rw-r--r--cpukit/rtems/macros/rtems/rtems/timer.inl85
-rw-r--r--cpukit/rtems/src/attr.c30
-rw-r--r--cpukit/rtems/src/dpmem.c281
-rw-r--r--cpukit/rtems/src/event.c383
-rw-r--r--cpukit/rtems/src/eventmp.c190
-rw-r--r--cpukit/rtems/src/intr.c68
-rw-r--r--cpukit/rtems/src/intrbody.c71
-rw-r--r--cpukit/rtems/src/mp.c42
-rw-r--r--cpukit/rtems/src/msg.c764
-rw-r--r--cpukit/rtems/src/msgmp.c479
-rw-r--r--cpukit/rtems/src/part.c341
-rw-r--r--cpukit/rtems/src/partmp.c302
-rw-r--r--cpukit/rtems/src/ratemon.c461
-rw-r--r--cpukit/rtems/src/region.c486
-rw-r--r--cpukit/rtems/src/regionmp.c310
-rw-r--r--cpukit/rtems/src/rtclock.c151
-rw-r--r--cpukit/rtems/src/rtemstimer.c349
-rw-r--r--cpukit/rtems/src/sem.c571
-rw-r--r--cpukit/rtems/src/semmp.c308
-rw-r--r--cpukit/rtems/src/signal.c149
-rw-r--r--cpukit/rtems/src/signalmp.c189
-rw-r--r--cpukit/rtems/src/taskmp.c340
-rw-r--r--cpukit/rtems/src/tasks.c1130
-rw-r--r--cpukit/sapi/include/confdefs.h656
-rw-r--r--cpukit/sapi/include/rtems/README135
-rw-r--r--cpukit/sapi/include/rtems/config.h104
-rw-r--r--cpukit/sapi/include/rtems/extension.h138
-rw-r--r--cpukit/sapi/include/rtems/fatal.h49
-rw-r--r--cpukit/sapi/include/rtems/init.h110
-rw-r--r--cpukit/sapi/include/rtems/io.h244
-rw-r--r--cpukit/sapi/include/rtems/mptables.h29
-rw-r--r--cpukit/sapi/inline/rtems/extension.inl91
-rw-r--r--cpukit/sapi/macros/rtems/extension.inl58
-rw-r--r--cpukit/sapi/src/debug.c62
-rw-r--r--cpukit/sapi/src/exinit.c298
-rw-r--r--cpukit/sapi/src/extension.c165
-rw-r--r--cpukit/sapi/src/fatal.c38
-rw-r--r--cpukit/sapi/src/io.c345
-rw-r--r--cpukit/sapi/src/posixapi.c96
-rw-r--r--cpukit/sapi/src/rtemsapi.c90
-rw-r--r--cpukit/score/cpu/a29k/amd.ah531
-rw-r--r--cpukit/score/cpu/a29k/asm.h103
-rw-r--r--cpukit/score/cpu/a29k/cpu.c263
-rw-r--r--cpukit/score/cpu/a29k/pswmacro.ah442
-rw-r--r--cpukit/score/cpu/a29k/register.ah214
-rw-r--r--cpukit/score/cpu/hppa1.1/cpu.c184
-rw-r--r--cpukit/score/cpu/i386/asm.h151
-rw-r--r--cpukit/score/cpu/i386/cpu.c185
-rw-r--r--cpukit/score/cpu/i386/rtems/asm.h151
-rw-r--r--cpukit/score/cpu/i960/asm.h110
-rw-r--r--cpukit/score/cpu/i960/cpu.c155
-rw-r--r--cpukit/score/cpu/m68k/asm.h144
-rw-r--r--cpukit/score/cpu/m68k/cpu.c204
-rw-r--r--cpukit/score/cpu/m68k/m68302.h661
-rw-r--r--cpukit/score/cpu/m68k/m68360.h880
-rw-r--r--cpukit/score/cpu/m68k/memcpy.c87
-rw-r--r--cpukit/score/cpu/m68k/qsm.h209
-rw-r--r--cpukit/score/cpu/m68k/rtems/asm.h144
-rw-r--r--cpukit/score/cpu/m68k/rtems/m68k/m68302.h661
-rw-r--r--cpukit/score/cpu/m68k/rtems/m68k/m68360.h880
-rw-r--r--cpukit/score/cpu/m68k/rtems/m68k/qsm.h209
-rw-r--r--cpukit/score/cpu/m68k/rtems/m68k/sim.h342
-rw-r--r--cpukit/score/cpu/m68k/sim.h342
-rw-r--r--cpukit/score/cpu/mips/asm.h102
-rw-r--r--cpukit/score/cpu/mips/cpu.c219
-rw-r--r--cpukit/score/cpu/mips/cpu_asm.S972
-rw-r--r--cpukit/score/cpu/mips/idtcpu.h440
-rw-r--r--cpukit/score/cpu/mips/iregdef.h325
-rw-r--r--cpukit/score/cpu/mips/rtems/asm.h102
-rw-r--r--cpukit/score/cpu/mips/rtems/mips/idtcpu.h440
-rw-r--r--cpukit/score/cpu/mips/rtems/mips/iregdef.h325
-rw-r--r--cpukit/score/cpu/mips64orion/asm.h102
-rw-r--r--cpukit/score/cpu/mips64orion/cpu.c219
-rw-r--r--cpukit/score/cpu/mips64orion/cpu_asm.S972
-rw-r--r--cpukit/score/cpu/mips64orion/cpu_asm.h115
-rw-r--r--cpukit/score/cpu/mips64orion/idtcpu.h440
-rw-r--r--cpukit/score/cpu/mips64orion/idtmon.h171
-rw-r--r--cpukit/score/cpu/mips64orion/iregdef.h325
-rw-r--r--cpukit/score/cpu/no_cpu/asm.h101
-rw-r--r--cpukit/score/cpu/no_cpu/cpu.c162
-rw-r--r--cpukit/score/cpu/no_cpu/cpu_asm.c165
-rw-r--r--cpukit/score/cpu/no_cpu/rtems/asm.h101
-rw-r--r--cpukit/score/cpu/sh/asm.h137
-rw-r--r--cpukit/score/cpu/sh/cpu.c232
-rw-r--r--cpukit/score/cpu/sh/rtems/asm.h137
-rw-r--r--cpukit/score/cpu/sparc/README110
-rw-r--r--cpukit/score/cpu/sparc/asm.h123
-rw-r--r--cpukit/score/cpu/sparc/cpu.c409
-rw-r--r--cpukit/score/cpu/sparc/rtems/asm.h123
-rw-r--r--cpukit/score/cpu/unix/cpu.c1117
-rw-r--r--cpukit/score/include/rtems/debug.h98
-rw-r--r--cpukit/score/include/rtems/score/address.h31
-rw-r--r--cpukit/score/include/rtems/score/apiext.h102
-rw-r--r--cpukit/score/include/rtems/score/bitfield.h98
-rw-r--r--cpukit/score/include/rtems/score/chain.h168
-rw-r--r--cpukit/score/include/rtems/score/context.h134
-rw-r--r--cpukit/score/include/rtems/score/copyrt.h42
-rw-r--r--cpukit/score/include/rtems/score/coremsg.h267
-rw-r--r--cpukit/score/include/rtems/score/coremutex.h172
-rw-r--r--cpukit/score/include/rtems/score/coresem.h156
-rw-r--r--cpukit/score/include/rtems/score/heap.h226
-rw-r--r--cpukit/score/include/rtems/score/interr.h95
-rw-r--r--cpukit/score/include/rtems/score/isr.h231
-rw-r--r--cpukit/score/include/rtems/score/mpci.h412
-rw-r--r--cpukit/score/include/rtems/score/mppkt.h101
-rw-r--r--cpukit/score/include/rtems/score/object.h397
-rw-r--r--cpukit/score/include/rtems/score/objectmp.h152
-rw-r--r--cpukit/score/include/rtems/score/priority.h97
-rw-r--r--cpukit/score/include/rtems/score/stack.h50
-rw-r--r--cpukit/score/include/rtems/score/states.h84
-rw-r--r--cpukit/score/include/rtems/score/sysstate.h67
-rw-r--r--cpukit/score/include/rtems/score/thread.h622
-rw-r--r--cpukit/score/include/rtems/score/threadmp.h89
-rw-r--r--cpukit/score/include/rtems/score/threadq.h301
-rw-r--r--cpukit/score/include/rtems/score/tod.h277
-rw-r--r--cpukit/score/include/rtems/score/tqdata.h90
-rw-r--r--cpukit/score/include/rtems/score/userext.h211
-rw-r--r--cpukit/score/include/rtems/score/watchdog.h194
-rw-r--r--cpukit/score/include/rtems/score/wkspace.h71
-rw-r--r--cpukit/score/include/rtems/system.h153
-rw-r--r--cpukit/score/inline/rtems/score/address.inl120
-rw-r--r--cpukit/score/inline/rtems/score/chain.inl390
-rw-r--r--cpukit/score/inline/rtems/score/coremsg.inl260
-rw-r--r--cpukit/score/inline/rtems/score/coremutex.inl124
-rw-r--r--cpukit/score/inline/rtems/score/coresem.inl54
-rw-r--r--cpukit/score/inline/rtems/score/heap.inl274
-rw-r--r--cpukit/score/inline/rtems/score/isr.inl73
-rw-r--r--cpukit/score/inline/rtems/score/mppkt.inl58
-rw-r--r--cpukit/score/inline/rtems/score/object.inl244
-rw-r--r--cpukit/score/inline/rtems/score/objectmp.inl73
-rw-r--r--cpukit/score/inline/rtems/score/priority.inl247
-rw-r--r--cpukit/score/inline/rtems/score/stack.inl81
-rw-r--r--cpukit/score/inline/rtems/score/states.inl384
-rw-r--r--cpukit/score/inline/rtems/score/sysstate.inl154
-rw-r--r--cpukit/score/inline/rtems/score/thread.inl404
-rw-r--r--cpukit/score/inline/rtems/score/threadmp.inl61
-rw-r--r--cpukit/score/inline/rtems/score/tod.inl67
-rw-r--r--cpukit/score/inline/rtems/score/tqdata.inl73
-rw-r--r--cpukit/score/inline/rtems/score/userext.inl132
-rw-r--r--cpukit/score/inline/rtems/score/watchdog.inl324
-rw-r--r--cpukit/score/inline/rtems/score/wkspace.inl57
-rw-r--r--cpukit/score/macros/README18
-rw-r--r--cpukit/score/macros/rtems/score/README18
-rw-r--r--cpukit/score/macros/rtems/score/address.inl68
-rw-r--r--cpukit/score/macros/rtems/score/chain.inl200
-rw-r--r--cpukit/score/macros/rtems/score/coremsg.inl143
-rw-r--r--cpukit/score/macros/rtems/score/coremutex.inl77
-rw-r--r--cpukit/score/macros/rtems/score/coresem.inl40
-rw-r--r--cpukit/score/macros/rtems/score/heap.inl150
-rw-r--r--cpukit/score/macros/rtems/score/isr.inl48
-rw-r--r--cpukit/score/macros/rtems/score/mppkt.inl41
-rw-r--r--cpukit/score/macros/rtems/score/object.inl148
-rw-r--r--cpukit/score/macros/rtems/score/objectmp.inl50
-rw-r--r--cpukit/score/macros/rtems/score/priority.inl170
-rw-r--r--cpukit/score/macros/rtems/score/stack.inl50
-rw-r--r--cpukit/score/macros/rtems/score/states.inl210
-rw-r--r--cpukit/score/macros/rtems/score/sysstate.inl90
-rw-r--r--cpukit/score/macros/rtems/score/thread.inl217
-rw-r--r--cpukit/score/macros/rtems/score/threadmp.inl50
-rw-r--r--cpukit/score/macros/rtems/score/tod.inl49
-rw-r--r--cpukit/score/macros/rtems/score/tqdata.inl50
-rw-r--r--cpukit/score/macros/rtems/score/userext.inl126
-rw-r--r--cpukit/score/macros/rtems/score/watchdog.inl172
-rw-r--r--cpukit/score/macros/rtems/score/wkspace.inl39
-rw-r--r--cpukit/score/src/apiext.c105
-rw-r--r--cpukit/score/src/chain.c202
-rw-r--r--cpukit/score/src/coremsg.c432
-rw-r--r--cpukit/score/src/coremutex.c348
-rw-r--r--cpukit/score/src/coresem.c184
-rw-r--r--cpukit/score/src/coretod.c238
-rw-r--r--cpukit/score/src/heap.c538
-rw-r--r--cpukit/score/src/interr.c61
-rw-r--r--cpukit/score/src/isr.c60
-rw-r--r--cpukit/score/src/mpci.c525
-rw-r--r--cpukit/score/src/object.c516
-rw-r--r--cpukit/score/src/objectmp.c275
-rw-r--r--cpukit/score/src/thread.c1396
-rw-r--r--cpukit/score/src/threadmp.c164
-rw-r--r--cpukit/score/src/threadq.c967
-rw-r--r--cpukit/score/src/userext.c204
-rw-r--r--cpukit/score/src/watchdog.c273
-rw-r--r--cpukit/score/src/wkspace.c88
-rw-r--r--cpukit/zlib/doc/rfc1950.txt619
-rw-r--r--cpukit/zlib/doc/rfc1951.txt955
-rw-r--r--cpukit/zlib/doc/rfc1952.txt675
-rw-r--r--doc/common/missing-arrow.gifbin0 -> 166 bytes
-rw-r--r--doc/common/next-arrow.gifbin0 -> 275 bytes
-rw-r--r--doc/common/prev-arrow.gifbin0 -> 279 bytes
-rw-r--r--doc/common/timing.texi457
-rw-r--r--doc/import_ami_txt81
-rw-r--r--doc/new_chapters/base.texi96
-rw-r--r--doc/new_chapters/clock.texi262
-rw-r--r--doc/new_chapters/cond.texi384
-rw-r--r--doc/new_chapters/key.texi177
-rw-r--r--doc/new_chapters/mutex.texi640
-rw-r--r--doc/new_chapters/posix_test_plan.texi123
-rw-r--r--doc/new_chapters/sched.texi226
-rw-r--r--doc/new_chapters/signal.texi689
-rw-r--r--doc/new_chapters/thread.texi1023
-rw-r--r--doc/posix_users/posix_test_plan.texi123
-rw-r--r--doc/rtems.html26
-rw-r--r--doc/supplements/hppa1_1/TIMES244
-rw-r--r--doc/supplements/hppa1_1/bsp.texi70
-rw-r--r--doc/supplements/hppa1_1/callconv.texi172
-rw-r--r--doc/supplements/hppa1_1/cpumodel.texi69
-rw-r--r--doc/supplements/hppa1_1/cputable.texi124
-rw-r--r--doc/supplements/hppa1_1/fatalerr.texi45
-rw-r--r--doc/supplements/hppa1_1/intr.t214
-rw-r--r--doc/supplements/hppa1_1/memmodel.texi80
-rw-r--r--doc/supplements/hppa1_1/timedata.t105
-rw-r--r--doc/supplements/i386/bsp.texi110
-rw-r--r--doc/supplements/i386/callconv.texi119
-rw-r--r--doc/supplements/i386/cpumodel.texi81
-rw-r--r--doc/supplements/i386/cputable.texi126
-rw-r--r--doc/supplements/i386/fatalerr.texi44
-rw-r--r--doc/supplements/i386/intr.t191
-rw-r--r--doc/supplements/i386/memmodel.texi85
-rw-r--r--doc/supplements/i386/timedata.t135
-rw-r--r--doc/supplements/i960/bsp.texi71
-rw-r--r--doc/supplements/i960/callconv.texi130
-rw-r--r--doc/supplements/i960/cpumodel.texi79
-rw-r--r--doc/supplements/i960/cputable.texi130
-rw-r--r--doc/supplements/i960/fatalerr.texi43
-rw-r--r--doc/supplements/i960/intr.t220
-rw-r--r--doc/supplements/i960/memmodel.texi53
-rw-r--r--doc/supplements/i960/timedata.t123
-rw-r--r--doc/supplements/m68k/timedata.t59
-rw-r--r--doc/supplements/sparc/SIS_TIMES244
-rw-r--r--doc/supplements/sparc/bsp.texi103
-rw-r--r--doc/supplements/sparc/callconv.texi445
-rw-r--r--doc/supplements/sparc/cpumodel.texi169
-rw-r--r--doc/supplements/sparc/cputable.texi109
-rw-r--r--doc/supplements/sparc/fatalerr.texi45
-rw-r--r--doc/supplements/sparc/intr.t226
-rw-r--r--doc/supplements/sparc/memmodel.texi117
-rw-r--r--doc/supplements/sparc/timedata.t156
-rw-r--r--doc/tools/bmenu/bmenubin0 -> 38028 bytes
-rw-r--r--doc/tools/bmenu/chain.obin0 -> 6752 bytes
-rw-r--r--doc/tools/bmenu/main.obin0 -> 28012 bytes
-rwxr-xr-xinstall-sh252
-rw-r--r--make/Makefile.in97
-rw-r--r--make/README513
-rw-r--r--make/Templates/Makefile.dir9
-rw-r--r--make/Templates/Makefile.inc.in48
-rw-r--r--make/Templates/Makefile.leaf77
-rw-r--r--make/Templates/Makefile.lib59
-rw-r--r--make/compilers/gcc-no_bsp.cfg293
-rw-r--r--make/compilers/gcc-portsw.cfg296
-rw-r--r--make/compilers/gcc-target-default.cfg330
-rw-r--r--make/compilers/gcc.cfg.in203
-rw-r--r--make/custom/FreeBSD-posix.cfg84
-rw-r--r--make/custom/HPUX9-posix.cfg82
-rw-r--r--make/custom/Linux-posix.cfg85
-rw-r--r--make/custom/Solaris-posix.cfg84
-rw-r--r--make/custom/bare.cfg55
-rw-r--r--make/custom/cvme961.cfg79
-rw-r--r--make/custom/default.cfg79
-rw-r--r--make/custom/dmv152.cfg84
-rw-r--r--make/custom/dmv177.cfg117
-rw-r--r--make/custom/efi332.cfg76
-rw-r--r--make/custom/efi68k.cfg75
-rw-r--r--make/custom/erc32.cfg100
-rw-r--r--make/custom/force386.cfg80
-rw-r--r--make/custom/gen68302.cfg71
-rw-r--r--make/custom/gen68340.cfg96
-rw-r--r--make/custom/gen68360.cfg95
-rw-r--r--make/custom/gen68360_040.cfg15
-rw-r--r--make/custom/gensh1.cfg86
-rw-r--r--make/custom/go32.cfg113
-rw-r--r--make/custom/go32_p5.cfg15
-rw-r--r--make/custom/helas403.cfg110
-rw-r--r--make/custom/i386ex.cfg82
-rw-r--r--make/custom/idp.cfg77
-rw-r--r--make/custom/mvme136.cfg78
-rw-r--r--make/custom/mvme147.cfg71
-rw-r--r--make/custom/mvme147s.cfg19
-rw-r--r--make/custom/mvme162.cfg109
-rw-r--r--make/custom/mvme162lx.cfg17
-rw-r--r--make/custom/no_bsp.cfg34
-rw-r--r--make/custom/ods68302.cfg116
-rw-r--r--make/custom/p4000.cfg77
-rw-r--r--make/custom/p4600.cfg95
-rw-r--r--make/custom/p4650.cfg93
-rw-r--r--make/custom/papyrus.cfg104
-rw-r--r--make/custom/pc386.cfg107
-rw-r--r--make/custom/portsw.cfg62
-rw-r--r--make/custom/posix.cfg37
-rw-r--r--make/custom/psim.cfg118
-rw-r--r--make/custom/simhppa.cfg137
-rw-r--r--make/directory.cfg57
-rw-r--r--make/host.cfg.in74
-rw-r--r--make/leaf.cfg183
-rw-r--r--make/lib.cfg20
-rw-r--r--make/main.cfg82
-rw-r--r--make/rtems.cfg10
-rw-r--r--make/target.cfg.in74
-rwxr-xr-xmkinstalldirs38
-rw-r--r--testsuites/PROBLEMS42
-rw-r--r--testsuites/README44
-rw-r--r--testsuites/libtests/README10
-rw-r--r--testsuites/libtests/cpuuse/cpuuse.scn24
-rw-r--r--testsuites/libtests/cpuuse/init.c106
-rw-r--r--testsuites/libtests/cpuuse/system.h69
-rw-r--r--testsuites/libtests/cpuuse/task1.c103
-rw-r--r--testsuites/libtests/cpuuse/task2.c29
-rw-r--r--testsuites/libtests/cpuuse/task3.c29
-rw-r--r--testsuites/libtests/cpuuse/tswitch.c62
-rw-r--r--testsuites/libtests/malloctest/init.c114
-rw-r--r--testsuites/libtests/malloctest/system.h51
-rw-r--r--testsuites/libtests/malloctest/task1.c67
-rw-r--r--testsuites/libtests/monitor/init.c74
-rw-r--r--testsuites/libtests/monitor/system.h58
-rw-r--r--testsuites/libtests/rtems++/Init.cc63
-rw-r--r--testsuites/libtests/rtems++/System.h137
-rw-r--r--testsuites/libtests/rtems++/Task1.cc682
-rw-r--r--testsuites/libtests/rtems++/Task2.cc81
-rw-r--r--testsuites/libtests/rtems++/Task3.cc81
-rw-r--r--testsuites/libtests/rtems++/rtems++.doc29
-rw-r--r--testsuites/libtests/rtems++/rtems++.scn161
-rw-r--r--testsuites/libtests/rtmonuse/getall.c43
-rw-r--r--testsuites/libtests/rtmonuse/init.c71
-rw-r--r--testsuites/libtests/rtmonuse/rtmonuse.scn27
-rw-r--r--testsuites/libtests/rtmonuse/system.h62
-rw-r--r--testsuites/libtests/rtmonuse/task1.c124
-rw-r--r--testsuites/libtests/stackchk/blow.c49
-rw-r--r--testsuites/libtests/stackchk/init.c86
-rw-r--r--testsuites/libtests/stackchk/stackchk.scn9
-rw-r--r--testsuites/libtests/stackchk/system.h53
-rw-r--r--testsuites/libtests/stackchk/task1.c44
-rw-r--r--testsuites/libtests/termios/README45
-rw-r--r--testsuites/libtests/termios/init.c143
-rw-r--r--testsuites/mptests/README10
-rw-r--r--testsuites/mptests/mp01/init.c96
-rw-r--r--testsuites/mptests/mp01/node1/mp01.doc53
-rw-r--r--testsuites/mptests/mp01/node1/mp01.scn15
-rw-r--r--testsuites/mptests/mp01/node2/mp01.doc13
-rw-r--r--testsuites/mptests/mp01/node2/mp01.scn15
-rw-r--r--testsuites/mptests/mp01/system.h46
-rw-r--r--testsuites/mptests/mp01/task1.c84
-rw-r--r--testsuites/mptests/mp02/init.c60
-rw-r--r--testsuites/mptests/mp02/node1/mp02.doc47
-rw-r--r--testsuites/mptests/mp02/node1/mp02.scn14
-rw-r--r--testsuites/mptests/mp02/node2/mp02.doc13
-rw-r--r--testsuites/mptests/mp02/node2/mp02.scn14
-rw-r--r--testsuites/mptests/mp02/system.h45
-rw-r--r--testsuites/mptests/mp02/task1.c118
-rw-r--r--testsuites/mptests/mp03/delay.c31
-rw-r--r--testsuites/mptests/mp03/init.c65
-rw-r--r--testsuites/mptests/mp03/node1/mp03.doc45
-rw-r--r--testsuites/mptests/mp03/node1/mp03.scn24
-rw-r--r--testsuites/mptests/mp03/node2/mp03.doc13
-rw-r--r--testsuites/mptests/mp03/node2/mp03.scn24
-rw-r--r--testsuites/mptests/mp03/system.h58
-rw-r--r--testsuites/mptests/mp03/task1.c155
-rw-r--r--testsuites/mptests/mp04/init.c60
-rw-r--r--testsuites/mptests/mp04/node1/mp04.doc41
-rw-r--r--testsuites/mptests/mp04/node1/mp04.scn8
-rw-r--r--testsuites/mptests/mp04/node2/mp04.doc13
-rw-r--r--testsuites/mptests/mp04/node2/mp04.scn8
-rw-r--r--testsuites/mptests/mp04/system.h47
-rw-r--r--testsuites/mptests/mp04/task1.c83
-rw-r--r--testsuites/mptests/mp05/asr.c37
-rw-r--r--testsuites/mptests/mp05/init.c65
-rw-r--r--testsuites/mptests/mp05/node1/mp05.doc45
-rw-r--r--testsuites/mptests/mp05/node1/mp05.scn11
-rw-r--r--testsuites/mptests/mp05/node2/mp05.doc13
-rw-r--r--testsuites/mptests/mp05/node2/mp05.scn10
-rw-r--r--testsuites/mptests/mp05/system.h63
-rw-r--r--testsuites/mptests/mp05/task1.c106
-rw-r--r--testsuites/mptests/mp06/init.c65
-rw-r--r--testsuites/mptests/mp06/node1/mp06.doc45
-rw-r--r--testsuites/mptests/mp06/node1/mp06.scn11
-rw-r--r--testsuites/mptests/mp06/node2/mp06.doc13
-rw-r--r--testsuites/mptests/mp06/node2/mp06.scn12
-rw-r--r--testsuites/mptests/mp06/system.h52
-rw-r--r--testsuites/mptests/mp06/task1.c176
-rw-r--r--testsuites/mptests/mp07/init.c65
-rw-r--r--testsuites/mptests/mp07/node1/mp07.doc46
-rw-r--r--testsuites/mptests/mp07/node1/mp07.scn10
-rw-r--r--testsuites/mptests/mp07/node2/mp07.doc13
-rw-r--r--testsuites/mptests/mp07/node2/mp07.scn9
-rw-r--r--testsuites/mptests/mp07/system.h52
-rw-r--r--testsuites/mptests/mp07/task1.c103
-rw-r--r--testsuites/mptests/mp08/init.c74
-rw-r--r--testsuites/mptests/mp08/node1/mp08.doc52
-rw-r--r--testsuites/mptests/mp08/node1/mp08.scn11
-rw-r--r--testsuites/mptests/mp08/node2/mp08.doc13
-rw-r--r--testsuites/mptests/mp08/node2/mp08.scn12
-rw-r--r--testsuites/mptests/mp08/system.h51
-rw-r--r--testsuites/mptests/mp08/task1.c89
-rw-r--r--testsuites/mptests/mp09/init.c74
-rw-r--r--testsuites/mptests/mp09/node1/mp09.doc50
-rw-r--r--testsuites/mptests/mp09/node1/mp09.scn22
-rw-r--r--testsuites/mptests/mp09/node2/mp09.doc13
-rw-r--r--testsuites/mptests/mp09/node2/mp09.scn27
-rw-r--r--testsuites/mptests/mp09/recvmsg.c47
-rw-r--r--testsuites/mptests/mp09/sendmsg.c60
-rw-r--r--testsuites/mptests/mp09/system.h60
-rw-r--r--testsuites/mptests/mp09/task1.c109
-rw-r--r--testsuites/mptests/mp10/init.c143
-rw-r--r--testsuites/mptests/mp10/node1/mp10.doc46
-rw-r--r--testsuites/mptests/mp10/node1/mp10.scn4
-rw-r--r--testsuites/mptests/mp10/node2/mp10.doc13
-rw-r--r--testsuites/mptests/mp10/node2/mp10.scn19
-rw-r--r--testsuites/mptests/mp10/system.h64
-rw-r--r--testsuites/mptests/mp10/task1.c52
-rw-r--r--testsuites/mptests/mp10/task2.c47
-rw-r--r--testsuites/mptests/mp10/task3.c50
-rw-r--r--testsuites/mptests/mp11/init.c105
-rw-r--r--testsuites/mptests/mp11/node1/mp11.doc42
-rw-r--r--testsuites/mptests/mp11/node1/mp11.scn10
-rw-r--r--testsuites/mptests/mp11/node2/mp11.doc13
-rw-r--r--testsuites/mptests/mp11/node2/mp11.scn2
-rw-r--r--testsuites/mptests/mp11/system.h56
-rw-r--r--testsuites/mptests/mp12/init.c113
-rw-r--r--testsuites/mptests/mp12/node1/mp12.doc52
-rw-r--r--testsuites/mptests/mp12/node1/mp12.scn6
-rw-r--r--testsuites/mptests/mp12/node2/mp12.doc13
-rw-r--r--testsuites/mptests/mp12/node2/mp12.scn10
-rw-r--r--testsuites/mptests/mp12/system.h55
-rw-r--r--testsuites/mptests/mp13/init.c115
-rw-r--r--testsuites/mptests/mp13/node1/mp13.doc48
-rw-r--r--testsuites/mptests/mp13/node1/mp13.scn14
-rw-r--r--testsuites/mptests/mp13/node2/mp13.doc13
-rw-r--r--testsuites/mptests/mp13/node2/mp13.scn16
-rw-r--r--testsuites/mptests/mp13/system.h60
-rw-r--r--testsuites/mptests/mp13/task1.c73
-rw-r--r--testsuites/mptests/mp13/task2.c106
-rw-r--r--testsuites/mptests/mp14/delay.c34
-rw-r--r--testsuites/mptests/mp14/evtask1.c87
-rw-r--r--testsuites/mptests/mp14/evtmtask.c65
-rw-r--r--testsuites/mptests/mp14/exit.c40
-rw-r--r--testsuites/mptests/mp14/init.c191
-rw-r--r--testsuites/mptests/mp14/msgtask1.c107
-rw-r--r--testsuites/mptests/mp14/node1/mp14.doc50
-rw-r--r--testsuites/mptests/mp14/node1/mp14.scn41
-rw-r--r--testsuites/mptests/mp14/node2/mp14.doc13
-rw-r--r--testsuites/mptests/mp14/node2/mp14.scn38
-rw-r--r--testsuites/mptests/mp14/pttask1.c71
-rw-r--r--testsuites/mptests/mp14/smtask1.c73
-rw-r--r--testsuites/mptests/mp14/system.h119
-rw-r--r--testsuites/psxtests/include/pmacros.h85
-rw-r--r--testsuites/psxtests/psx01/init.c225
-rw-r--r--testsuites/psxtests/psx01/psx01.scn46
-rw-r--r--testsuites/psxtests/psx01/system.h56
-rw-r--r--testsuites/psxtests/psx01/task.c94
-rw-r--r--testsuites/psxtests/psx02/init.c146
-rw-r--r--testsuites/psxtests/psx02/psx02.scn26
-rw-r--r--testsuites/psxtests/psx02/system.h52
-rw-r--r--testsuites/psxtests/psx02/task.c45
-rw-r--r--testsuites/psxtests/psx03/init.c176
-rw-r--r--testsuites/psxtests/psx03/psx03.scn17
-rw-r--r--testsuites/psxtests/psx03/system.h55
-rw-r--r--testsuites/psxtests/psx03/task.c65
-rw-r--r--testsuites/psxtests/psx04/init.c564
-rw-r--r--testsuites/psxtests/psx04/psx04.scn112
-rw-r--r--testsuites/psxtests/psx04/system.h63
-rw-r--r--testsuites/psxtests/psx04/task1.c44
-rw-r--r--testsuites/psxtests/psx04/task2.c42
-rw-r--r--testsuites/psxtests/psx04/task3.c119
-rw-r--r--testsuites/psxtests/psx05/init.c569
-rw-r--r--testsuites/psxtests/psx05/psx05.scn111
-rw-r--r--testsuites/psxtests/psx05/system.h67
-rw-r--r--testsuites/psxtests/psx05/task.c58
-rw-r--r--testsuites/psxtests/psx05/task2.c49
-rw-r--r--testsuites/psxtests/psx05/task3.c51
-rw-r--r--testsuites/psxtests/psx06/init.c121
-rw-r--r--testsuites/psxtests/psx06/psx06.scn21
-rw-r--r--testsuites/psxtests/psx06/system.h61
-rw-r--r--testsuites/psxtests/psx06/task.c51
-rw-r--r--testsuites/psxtests/psx06/task2.c52
-rw-r--r--testsuites/psxtests/psx07/init.c495
-rw-r--r--testsuites/psxtests/psx07/psx07.scn105
-rw-r--r--testsuites/psxtests/psx07/system.h51
-rw-r--r--testsuites/psxtests/psx07/task.c34
-rw-r--r--testsuites/psxtests/psx08/init.c82
-rw-r--r--testsuites/psxtests/psx08/psx08.scn18
-rw-r--r--testsuites/psxtests/psx08/system.h56
-rw-r--r--testsuites/psxtests/psx08/task2.c52
-rw-r--r--testsuites/psxtests/psx09/init.c226
-rw-r--r--testsuites/psxtests/psx09/psx09.scn23
-rw-r--r--testsuites/psxtests/psx09/system.h58
-rw-r--r--testsuites/psxtests/psx10/init.c312
-rw-r--r--testsuites/psxtests/psx10/psx10.scn59
-rw-r--r--testsuites/psxtests/psx10/system.h69
-rw-r--r--testsuites/psxtests/psx10/task.c65
-rw-r--r--testsuites/psxtests/psx10/task2.c47
-rw-r--r--testsuites/psxtests/psx10/task3.c46
-rw-r--r--testsuites/psxtests/psx11/init.c108
-rw-r--r--testsuites/psxtests/psx11/psx11.scn18
-rw-r--r--testsuites/psxtests/psx11/system.h51
-rw-r--r--testsuites/psxtests/psx11/task.c92
-rw-r--r--testsuites/psxtests/psx12/init.c140
-rw-r--r--testsuites/psxtests/psx12/psx12.scn11
-rw-r--r--testsuites/psxtests/psx12/system.h54
-rw-r--r--testsuites/psxtests/psx12/task.c34
-rw-r--r--testsuites/psxtests/psxhdrs/clock01.c29
-rw-r--r--testsuites/psxtests/psxhdrs/clock02.c29
-rw-r--r--testsuites/psxtests/psxhdrs/clock03.c29
-rw-r--r--testsuites/psxtests/psxhdrs/clock04.c29
-rw-r--r--testsuites/psxtests/psxhdrs/clock05.c35
-rw-r--r--testsuites/psxtests/psxhdrs/clock06.c32
-rw-r--r--testsuites/psxtests/psxhdrs/cond01.c28
-rw-r--r--testsuites/psxtests/psxhdrs/cond02.c28
-rw-r--r--testsuites/psxtests/psxhdrs/cond03.c29
-rw-r--r--testsuites/psxtests/psxhdrs/cond04.c28
-rw-r--r--testsuites/psxtests/psxhdrs/cond05.c28
-rw-r--r--testsuites/psxtests/psxhdrs/cond06.c29
-rw-r--r--testsuites/psxtests/psxhdrs/cond07.c30
-rw-r--r--testsuites/psxtests/psxhdrs/cond08.c32
-rw-r--r--testsuites/psxtests/psxhdrs/cond09.c35
-rw-r--r--testsuites/psxtests/psxhdrs/cond10.c28
-rw-r--r--testsuites/psxtests/psxhdrs/key01.c34
-rw-r--r--testsuites/psxtests/psxhdrs/key02.c32
-rw-r--r--testsuites/psxtests/psxhdrs/key03.c30
-rw-r--r--testsuites/psxtests/psxhdrs/key04.c28
-rw-r--r--testsuites/psxtests/psxhdrs/mutex01.c28
-rw-r--r--testsuites/psxtests/psxhdrs/mutex02.c28
-rw-r--r--testsuites/psxtests/psxhdrs/mutex03.c29
-rw-r--r--testsuites/psxtests/psxhdrs/mutex04.c28
-rw-r--r--testsuites/psxtests/psxhdrs/mutex05.c28
-rw-r--r--testsuites/psxtests/psxhdrs/mutex06.c28
-rw-r--r--testsuites/psxtests/psxhdrs/mutex07.c36
-rw-r--r--testsuites/psxtests/psxhdrs/mutex08.c32
-rw-r--r--testsuites/psxtests/psxhdrs/mutex09.c32
-rw-r--r--testsuites/psxtests/psxhdrs/mutex10.c32
-rw-r--r--testsuites/psxtests/psxhdrs/mutex11.c35
-rw-r--r--testsuites/psxtests/psxhdrs/mutex12.c28
-rw-r--r--testsuites/psxtests/psxhdrs/mutex13.c32
-rw-r--r--testsuites/psxtests/psxhdrs/mutex14.c32
-rw-r--r--testsuites/psxtests/psxhdrs/mutex15.c32
-rw-r--r--testsuites/psxtests/psxhdrs/mutex16.c35
-rw-r--r--testsuites/psxtests/psxhdrs/proc01.c23
-rw-r--r--testsuites/psxtests/psxhdrs/proc02.c23
-rw-r--r--testsuites/psxtests/psxhdrs/proc03.c23
-rw-r--r--testsuites/psxtests/psxhdrs/proc04.c23
-rw-r--r--testsuites/psxtests/psxhdrs/proc05.c23
-rw-r--r--testsuites/psxtests/psxhdrs/proc06.c23
-rw-r--r--testsuites/psxtests/psxhdrs/proc07.c26
-rw-r--r--testsuites/psxtests/psxhdrs/proc08.c26
-rw-r--r--testsuites/psxtests/psxhdrs/proc09.c27
-rw-r--r--testsuites/psxtests/psxhdrs/proc10.c23
-rw-r--r--testsuites/psxtests/psxhdrs/proc11.c25
-rw-r--r--testsuites/psxtests/psxhdrs/proc12.c23
-rw-r--r--testsuites/psxtests/psxhdrs/proc13.c23
-rw-r--r--testsuites/psxtests/psxhdrs/proc14.c25
-rw-r--r--testsuites/psxtests/psxhdrs/pthread01.c28
-rw-r--r--testsuites/psxtests/psxhdrs/pthread02.c28
-rw-r--r--testsuites/psxtests/psxhdrs/pthread03.c32
-rw-r--r--testsuites/psxtests/psxhdrs/pthread04.c29
-rw-r--r--testsuites/psxtests/psxhdrs/pthread05.c36
-rw-r--r--testsuites/psxtests/psxhdrs/pthread06.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread07.c38
-rw-r--r--testsuites/psxtests/psxhdrs/pthread08.c27
-rw-r--r--testsuites/psxtests/psxhdrs/pthread09.c27
-rw-r--r--testsuites/psxtests/psxhdrs/pthread10.c29
-rw-r--r--testsuites/psxtests/psxhdrs/pthread11.c52
-rw-r--r--testsuites/psxtests/psxhdrs/pthread12.c32
-rw-r--r--testsuites/psxtests/psxhdrs/pthread13.c32
-rw-r--r--testsuites/psxtests/psxhdrs/pthread14.c29
-rw-r--r--testsuites/psxtests/psxhdrs/pthread15.c32
-rw-r--r--testsuites/psxtests/psxhdrs/pthread16.c29
-rw-r--r--testsuites/psxtests/psxhdrs/pthread17.c36
-rw-r--r--testsuites/psxtests/psxhdrs/pthread18.c29
-rw-r--r--testsuites/psxtests/psxhdrs/pthread19.c29
-rw-r--r--testsuites/psxtests/psxhdrs/pthread20.c29
-rw-r--r--testsuites/psxtests/psxhdrs/pthread21.c29
-rw-r--r--testsuites/psxtests/psxhdrs/pthread22.c50
-rw-r--r--testsuites/psxtests/psxhdrs/pthread23.c30
-rw-r--r--testsuites/psxtests/psxhdrs/pthread24.c36
-rw-r--r--testsuites/psxtests/psxhdrs/pthread25.c34
-rw-r--r--testsuites/psxtests/psxhdrs/pthread26.c31
-rw-r--r--testsuites/psxtests/psxhdrs/pthread27.c32
-rw-r--r--testsuites/psxtests/psxhdrs/pthread28.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread29.c36
-rw-r--r--testsuites/psxtests/psxhdrs/pthread30.c36
-rw-r--r--testsuites/psxtests/psxhdrs/pthread31.c29
-rw-r--r--testsuites/psxtests/psxhdrs/pthread32.c35
-rw-r--r--testsuites/psxtests/psxhdrs/pthread33.c25
-rw-r--r--testsuites/psxtests/psxhdrs/pthread34.c31
-rw-r--r--testsuites/psxtests/psxhdrs/pthread35.c32
-rw-r--r--testsuites/psxtests/psxhdrs/pthread36.c29
-rw-r--r--testsuites/psxtests/psxhdrs/sched01.c44
-rw-r--r--testsuites/psxtests/psxhdrs/sched02.c31
-rw-r--r--testsuites/psxtests/psxhdrs/sched03.c52
-rw-r--r--testsuites/psxtests/psxhdrs/sched04.c30
-rw-r--r--testsuites/psxtests/psxhdrs/sched05.c27
-rw-r--r--testsuites/psxtests/psxhdrs/sched06.c35
-rw-r--r--testsuites/psxtests/psxhdrs/sched07.c35
-rw-r--r--testsuites/psxtests/psxhdrs/sched08.c31
-rw-r--r--testsuites/psxtests/psxhdrs/signal01.c27
-rw-r--r--testsuites/psxtests/psxhdrs/signal02.c27
-rw-r--r--testsuites/psxtests/psxhdrs/signal03.c24
-rw-r--r--testsuites/psxtests/psxhdrs/signal04.c27
-rw-r--r--testsuites/psxtests/psxhdrs/signal05.c24
-rw-r--r--testsuites/psxtests/psxhdrs/signal06.c39
-rw-r--r--testsuites/psxtests/psxhdrs/signal07.c32
-rw-r--r--testsuites/psxtests/psxhdrs/signal08.c34
-rw-r--r--testsuites/psxtests/psxhdrs/signal09.c29
-rw-r--r--testsuites/psxtests/psxhdrs/signal10.c25
-rw-r--r--testsuites/psxtests/psxhdrs/signal11.c26
-rw-r--r--testsuites/psxtests/psxhdrs/signal12.c26
-rw-r--r--testsuites/psxtests/psxhdrs/signal13.c32
-rw-r--r--testsuites/psxtests/psxhdrs/signal14.c26
-rw-r--r--testsuites/psxtests/psxhdrs/signal15.c26
-rw-r--r--testsuites/psxtests/psxhdrs/signal16.c36
-rw-r--r--testsuites/psxtests/psxhdrs/signal17.c27
-rw-r--r--testsuites/psxtests/psxhdrs/signal18.c28
-rw-r--r--testsuites/psxtests/psxhdrs/signal19.c27
-rw-r--r--testsuites/psxtests/psxhdrs/signal20.c26
-rw-r--r--testsuites/psxtests/psxhdrs/signal21.c23
-rw-r--r--testsuites/psxtests/psxhdrs/signal22.c26
-rw-r--r--testsuites/psxtests/psxhdrs/time01.c23
-rw-r--r--testsuites/psxtests/psxhdrs/time02.c28
-rw-r--r--testsuites/psxtests/psxhdrs/time03.c34
-rw-r--r--testsuites/psxtests/psxhdrs/time04.c23
-rw-r--r--testsuites/psxtests/psxhdrs/time05.c28
-rw-r--r--testsuites/psxtests/psxhdrs/time06.c24
-rw-r--r--testsuites/psxtests/psxhdrs/time07.c24
-rw-r--r--testsuites/psxtests/psxhdrs/time08.c24
-rw-r--r--testsuites/psxtests/psxhdrs/time09.c24
-rw-r--r--testsuites/psxtests/psxhdrs/time10.c25
-rw-r--r--testsuites/psxtests/psxhdrs/time11.c25
-rw-r--r--testsuites/psxtests/psxhdrs/time12.c25
-rw-r--r--testsuites/psxtests/psxhdrs/time13.c25
-rw-r--r--testsuites/psxtests/psxhdrs/timer01.c37
-rw-r--r--testsuites/psxtests/psxhdrs/timer02.c28
-rw-r--r--testsuites/psxtests/psxhdrs/timer03.c39
-rw-r--r--testsuites/psxtests/psxhdrs/timer04.c29
-rw-r--r--testsuites/psxtests/psxhdrs/timer05.c28
-rw-r--r--testsuites/psxtests/psxhdrs/timer06.c31
-rw-r--r--testsuites/samples/README73
-rw-r--r--testsuites/samples/base_mp/apptask.c37
-rw-r--r--testsuites/samples/base_mp/init.c46
-rw-r--r--testsuites/samples/base_mp/node1/base_mp.doc13
-rw-r--r--testsuites/samples/base_mp/node1/base_mp.scn5
-rw-r--r--testsuites/samples/base_mp/node2/base_mp.doc13
-rw-r--r--testsuites/samples/base_mp/node2/base_mp.scn5
-rw-r--r--testsuites/samples/base_mp/system.h48
-rw-r--r--testsuites/samples/base_sp/apptask.c38
-rw-r--r--testsuites/samples/base_sp/base_sp.doc13
-rw-r--r--testsuites/samples/base_sp/base_sp.scn5
-rw-r--r--testsuites/samples/base_sp/init.c48
-rw-r--r--testsuites/samples/base_sp/system.h44
-rw-r--r--testsuites/samples/cdtest/cdtest.scn31
-rw-r--r--testsuites/samples/cdtest/init.c26
-rw-r--r--testsuites/samples/cdtest/main.cc142
-rw-r--r--testsuites/samples/cdtest/system.h42
-rw-r--r--testsuites/samples/hello/hello.doc13
-rw-r--r--testsuites/samples/hello/hello.scn3
-rw-r--r--testsuites/samples/hello/init.c36
-rw-r--r--testsuites/samples/hello/system.h37
-rw-r--r--testsuites/samples/paranoia/init.c48
-rw-r--r--testsuites/samples/paranoia/paranoia.c2304
-rw-r--r--testsuites/samples/paranoia/paranoia.doc13
-rw-r--r--testsuites/samples/paranoia/system.h42
-rw-r--r--testsuites/samples/ticker/init.c61
-rw-r--r--testsuites/samples/ticker/system.h45
-rw-r--r--testsuites/samples/ticker/tasks.c44
-rw-r--r--testsuites/samples/ticker/ticker.doc13
-rw-r--r--testsuites/samples/ticker/ticker.scn16
-rw-r--r--testsuites/sptests/README9
-rw-r--r--testsuites/sptests/sp01/init.c86
-rw-r--r--testsuites/sptests/sp01/sp01.doc43
-rw-r--r--testsuites/sptests/sp01/sp01.scn18
-rw-r--r--testsuites/sptests/sp01/system.h47
-rw-r--r--testsuites/sptests/sp01/task1.c50
-rw-r--r--testsuites/sptests/sp02/init.c152
-rw-r--r--testsuites/sptests/sp02/preempt.c32
-rw-r--r--testsuites/sptests/sp02/sp02.doc37
-rw-r--r--testsuites/sptests/sp02/sp02.scn15
-rw-r--r--testsuites/sptests/sp02/system.h60
-rw-r--r--testsuites/sptests/sp02/task1.c66
-rw-r--r--testsuites/sptests/sp02/task2.c34
-rw-r--r--testsuites/sptests/sp02/task3.c37
-rw-r--r--testsuites/sptests/sp03/init.c67
-rw-r--r--testsuites/sptests/sp03/sp03.doc24
-rw-r--r--testsuites/sptests/sp03/sp03.scn26
-rw-r--r--testsuites/sptests/sp03/system.h49
-rw-r--r--testsuites/sptests/sp03/task1.c59
-rw-r--r--testsuites/sptests/sp03/task2.c46
-rw-r--r--testsuites/sptests/sp04/init.c110
-rw-r--r--testsuites/sptests/sp04/sp04.doc38
-rw-r--r--testsuites/sptests/sp04/sp04.scn23
-rw-r--r--testsuites/sptests/sp04/system.h80
-rw-r--r--testsuites/sptests/sp04/task1.c118
-rw-r--r--testsuites/sptests/sp04/task2.c29
-rw-r--r--testsuites/sptests/sp04/task3.c29
-rw-r--r--testsuites/sptests/sp04/tswitch.c63
-rw-r--r--testsuites/sptests/sp05/init.c81
-rw-r--r--testsuites/sptests/sp05/sp05.doc26
-rw-r--r--testsuites/sptests/sp05/sp05.scn47
-rw-r--r--testsuites/sptests/sp05/system.h55
-rw-r--r--testsuites/sptests/sp05/task1.c78
-rw-r--r--testsuites/sptests/sp05/task2.c39
-rw-r--r--testsuites/sptests/sp05/task3.c39
-rw-r--r--testsuites/sptests/sp06/init.c87
-rw-r--r--testsuites/sptests/sp06/sp06.doc26
-rw-r--r--testsuites/sptests/sp06/sp06.scn40
-rw-r--r--testsuites/sptests/sp06/system.h58
-rw-r--r--testsuites/sptests/sp06/task1.c61
-rw-r--r--testsuites/sptests/sp06/task2.c40
-rw-r--r--testsuites/sptests/sp06/task3.c32
-rw-r--r--testsuites/sptests/sp07/init.c128
-rw-r--r--testsuites/sptests/sp07/sp07.doc37
-rw-r--r--testsuites/sptests/sp07/sp07.scn33
-rw-r--r--testsuites/sptests/sp07/system.h89
-rw-r--r--testsuites/sptests/sp07/task1.c85
-rw-r--r--testsuites/sptests/sp07/task2.c78
-rw-r--r--testsuites/sptests/sp07/task3.c34
-rw-r--r--testsuites/sptests/sp07/task4.c30
-rw-r--r--testsuites/sptests/sp07/taskexit.c33
-rw-r--r--testsuites/sptests/sp07/tcreate.c35
-rw-r--r--testsuites/sptests/sp07/tdelete.c37
-rw-r--r--testsuites/sptests/sp07/trestart.c34
-rw-r--r--testsuites/sptests/sp07/tstart.c34
-rw-r--r--testsuites/sptests/sp08/init.c53
-rw-r--r--testsuites/sptests/sp08/sp08.doc26
-rw-r--r--testsuites/sptests/sp08/sp08.scn22
-rw-r--r--testsuites/sptests/sp08/system.h52
-rw-r--r--testsuites/sptests/sp08/task1.c256
-rw-r--r--testsuites/sptests/sp09/delay.c28
-rw-r--r--testsuites/sptests/sp09/init.c120
-rw-r--r--testsuites/sptests/sp09/isr.c27
-rw-r--r--testsuites/sptests/sp09/screen01.c168
-rw-r--r--testsuites/sptests/sp09/screen02.c192
-rw-r--r--testsuites/sptests/sp09/screen03.c217
-rw-r--r--testsuites/sptests/sp09/screen04.c85
-rw-r--r--testsuites/sptests/sp09/screen05.c164
-rw-r--r--testsuites/sptests/sp09/screen06.c125
-rw-r--r--testsuites/sptests/sp09/screen07.c200
-rw-r--r--testsuites/sptests/sp09/screen08.c128
-rw-r--r--testsuites/sptests/sp09/screen09.c152
-rw-r--r--testsuites/sptests/sp09/screen10.c164
-rw-r--r--testsuites/sptests/sp09/screen11.c250
-rw-r--r--testsuites/sptests/sp09/screen12.c337
-rw-r--r--testsuites/sptests/sp09/screen13.c114
-rw-r--r--testsuites/sptests/sp09/screen14.c154
-rw-r--r--testsuites/sptests/sp09/sp09.doc36
-rw-r--r--testsuites/sptests/sp09/sp09.scn251
-rw-r--r--testsuites/sptests/sp09/system.h143
-rw-r--r--testsuites/sptests/sp09/task1.c70
-rw-r--r--testsuites/sptests/sp09/task2.c48
-rw-r--r--testsuites/sptests/sp09/task3.c53
-rw-r--r--testsuites/sptests/sp09/task4.c50
-rw-r--r--testsuites/sptests/sp11/init.c92
-rw-r--r--testsuites/sptests/sp11/sp11.doc26
-rw-r--r--testsuites/sptests/sp11/sp11.scn74
-rw-r--r--testsuites/sptests/sp11/system.h92
-rw-r--r--testsuites/sptests/sp11/task1.c410
-rw-r--r--testsuites/sptests/sp11/task2.c126
-rw-r--r--testsuites/sptests/sp11/timer.c97
-rw-r--r--testsuites/sptests/sp12/init.c179
-rw-r--r--testsuites/sptests/sp12/pridrv.c131
-rw-r--r--testsuites/sptests/sp12/pritask.c91
-rw-r--r--testsuites/sptests/sp12/sp12.doc27
-rw-r--r--testsuites/sptests/sp12/sp12.scn78
-rw-r--r--testsuites/sptests/sp12/system.h84
-rw-r--r--testsuites/sptests/sp12/task1.c153
-rw-r--r--testsuites/sptests/sp12/task2.c65
-rw-r--r--testsuites/sptests/sp12/task3.c50
-rw-r--r--testsuites/sptests/sp12/task4.c37
-rw-r--r--testsuites/sptests/sp12/task5.c55
-rw-r--r--testsuites/sptests/sp13/fillbuff.c31
-rw-r--r--testsuites/sptests/sp13/init.c112
-rw-r--r--testsuites/sptests/sp13/putbuff.c29
-rw-r--r--testsuites/sptests/sp13/sp13.doc25
-rw-r--r--testsuites/sptests/sp13/sp13.scn76
-rw-r--r--testsuites/sptests/sp13/system.h70
-rw-r--r--testsuites/sptests/sp13/task1.c352
-rw-r--r--testsuites/sptests/sp13/task2.c139
-rw-r--r--testsuites/sptests/sp13/task3.c78
-rw-r--r--testsuites/sptests/sp14/asr.c47
-rw-r--r--testsuites/sptests/sp14/init.c72
-rw-r--r--testsuites/sptests/sp14/sp14.doc24
-rw-r--r--testsuites/sptests/sp14/sp14.scn33
-rw-r--r--testsuites/sptests/sp14/system.h80
-rw-r--r--testsuites/sptests/sp14/task1.c116
-rw-r--r--testsuites/sptests/sp14/task2.c48
-rw-r--r--testsuites/sptests/sp15/init.c78
-rw-r--r--testsuites/sptests/sp15/sp15.doc24
-rw-r--r--testsuites/sptests/sp15/sp15.scn16
-rw-r--r--testsuites/sptests/sp15/system.h62
-rw-r--r--testsuites/sptests/sp15/task1.c129
-rw-r--r--testsuites/sptests/sp16/init.c128
-rw-r--r--testsuites/sptests/sp16/sp16.doc24
-rw-r--r--testsuites/sptests/sp16/sp16.scn58
-rw-r--r--testsuites/sptests/sp16/system.h91
-rw-r--r--testsuites/sptests/sp16/task1.c282
-rw-r--r--testsuites/sptests/sp16/task2.c86
-rw-r--r--testsuites/sptests/sp16/task3.c57
-rw-r--r--testsuites/sptests/sp16/task4.c60
-rw-r--r--testsuites/sptests/sp16/task5.c73
-rw-r--r--testsuites/sptests/sp17/asr.c32
-rw-r--r--testsuites/sptests/sp17/init.c69
-rw-r--r--testsuites/sptests/sp17/sp17.doc35
-rw-r--r--testsuites/sptests/sp17/sp17.scn8
-rw-r--r--testsuites/sptests/sp17/system.h58
-rw-r--r--testsuites/sptests/sp17/task1.c48
-rw-r--r--testsuites/sptests/sp17/task2.c45
-rw-r--r--testsuites/sptests/sp19/first.c66
-rw-r--r--testsuites/sptests/sp19/fptask.c98
-rw-r--r--testsuites/sptests/sp19/fptest.h172
-rw-r--r--testsuites/sptests/sp19/init.c150
-rw-r--r--testsuites/sptests/sp19/inttest.h149
-rw-r--r--testsuites/sptests/sp19/sp19.doc23
-rw-r--r--testsuites/sptests/sp19/sp19.scn50
-rw-r--r--testsuites/sptests/sp19/system.h59
-rw-r--r--testsuites/sptests/sp19/task1.c59
-rw-r--r--testsuites/sptests/sp20/getall.c43
-rw-r--r--testsuites/sptests/sp20/init.c68
-rw-r--r--testsuites/sptests/sp20/sp20.doc24
-rw-r--r--testsuites/sptests/sp20/sp20.scn27
-rw-r--r--testsuites/sptests/sp20/system.h63
-rw-r--r--testsuites/sptests/sp20/task1.c116
-rw-r--r--testsuites/sptests/sp21/init.c53
-rw-r--r--testsuites/sptests/sp21/sp21.doc28
-rw-r--r--testsuites/sptests/sp21/sp21.scn19
-rw-r--r--testsuites/sptests/sp21/system.h46
-rw-r--r--testsuites/sptests/sp21/task1.c105
-rw-r--r--testsuites/sptests/sp22/delay.c32
-rw-r--r--testsuites/sptests/sp22/init.c66
-rw-r--r--testsuites/sptests/sp22/prtime.c32
-rw-r--r--testsuites/sptests/sp22/sp22.doc20
-rw-r--r--testsuites/sptests/sp22/sp22.scn29
-rw-r--r--testsuites/sptests/sp22/system.h60
-rw-r--r--testsuites/sptests/sp22/task1.c164
-rw-r--r--testsuites/sptests/sp23/init.c69
-rw-r--r--testsuites/sptests/sp23/sp23.doc26
-rw-r--r--testsuites/sptests/sp23/sp23.scn9
-rw-r--r--testsuites/sptests/sp23/system.h59
-rw-r--r--testsuites/sptests/sp23/task1.c96
-rw-r--r--testsuites/sptests/sp24/init.c76
-rw-r--r--testsuites/sptests/sp24/resume.c34
-rw-r--r--testsuites/sptests/sp24/sp24.doc51
-rw-r--r--testsuites/sptests/sp24/sp24.scn16
-rw-r--r--testsuites/sptests/sp24/system.h57
-rw-r--r--testsuites/sptests/sp24/task1.c58
-rw-r--r--testsuites/sptests/sp25/init.c66
-rw-r--r--testsuites/sptests/sp25/sp25.doc32
-rw-r--r--testsuites/sptests/sp25/sp25.scn29
-rw-r--r--testsuites/sptests/sp25/system.h57
-rw-r--r--testsuites/sptests/sp25/task1.c241
-rw-r--r--testsuites/sptests/spfatal/fatal.c136
-rw-r--r--testsuites/sptests/spfatal/init.c51
-rw-r--r--testsuites/sptests/spfatal/puterr.c68
-rw-r--r--testsuites/sptests/spfatal/spfatal.doc28
-rw-r--r--testsuites/sptests/spfatal/spfatal.scn8
-rw-r--r--testsuites/sptests/spfatal/system.h79
-rw-r--r--testsuites/sptests/spfatal/task1.c29
-rw-r--r--testsuites/sptests/spsize/getint.c32
-rw-r--r--testsuites/sptests/spsize/init.c64
-rw-r--r--testsuites/sptests/spsize/size.c650
-rw-r--r--testsuites/sptests/spsize/system.h47
-rw-r--r--testsuites/support/include/tmacros.h140
-rw-r--r--testsuites/tmtests/README21
-rw-r--r--testsuites/tmtests/include/timesys.h58
-rw-r--r--testsuites/tmtests/tm01/system.h43
-rw-r--r--testsuites/tmtests/tm01/task1.c189
-rw-r--r--testsuites/tmtests/tm01/tm01.doc13
-rw-r--r--testsuites/tmtests/tm02/system.h44
-rw-r--r--testsuites/tmtests/tm02/task1.c158
-rw-r--r--testsuites/tmtests/tm02/tm02.doc13
-rw-r--r--testsuites/tmtests/tm03/system.h44
-rw-r--r--testsuites/tmtests/tm03/task1.c151
-rw-r--r--testsuites/tmtests/tm03/tm03.doc13
-rw-r--r--testsuites/tmtests/tm04/system.h43
-rw-r--r--testsuites/tmtests/tm04/task1.c388
-rw-r--r--testsuites/tmtests/tm04/tm04.doc13
-rw-r--r--testsuites/tmtests/tm05/system.h44
-rw-r--r--testsuites/tmtests/tm05/task1.c132
-rw-r--r--testsuites/tmtests/tm05/tm05.doc13
-rw-r--r--testsuites/tmtests/tm06/system.h44
-rw-r--r--testsuites/tmtests/tm06/task1.c162
-rw-r--r--testsuites/tmtests/tm06/tm06.doc13
-rw-r--r--testsuites/tmtests/tm07/system.h44
-rw-r--r--testsuites/tmtests/tm07/task1.c120
-rw-r--r--testsuites/tmtests/tm07/tm07.doc13
-rw-r--r--testsuites/tmtests/tm08/system.h44
-rw-r--r--testsuites/tmtests/tm08/task1.c255
-rw-r--r--testsuites/tmtests/tm08/tm08.doc13
-rw-r--r--testsuites/tmtests/tm09/system.h44
-rw-r--r--testsuites/tmtests/tm09/task1.c226
-rw-r--r--testsuites/tmtests/tm09/tm09.doc13
-rw-r--r--testsuites/tmtests/tm10/system.h43
-rw-r--r--testsuites/tmtests/tm10/task1.c165
-rw-r--r--testsuites/tmtests/tm10/tm10.doc13
-rw-r--r--testsuites/tmtests/tm11/system.h43
-rw-r--r--testsuites/tmtests/tm11/task1.c155
-rw-r--r--testsuites/tmtests/tm11/tm11.doc13
-rw-r--r--testsuites/tmtests/tm12/system.h43
-rw-r--r--testsuites/tmtests/tm12/task1.c146
-rw-r--r--testsuites/tmtests/tm12/tm12.doc13
-rw-r--r--testsuites/tmtests/tm13/system.h43
-rw-r--r--testsuites/tmtests/tm13/task1.c154
-rw-r--r--testsuites/tmtests/tm13/tm13.doc13
-rw-r--r--testsuites/tmtests/tm14/system.h43
-rw-r--r--testsuites/tmtests/tm14/task1.c146
-rw-r--r--testsuites/tmtests/tm14/tm14.doc13
-rw-r--r--testsuites/tmtests/tm15/system.h43
-rw-r--r--testsuites/tmtests/tm15/task1.c222
-rw-r--r--testsuites/tmtests/tm15/tm15.doc13
-rw-r--r--testsuites/tmtests/tm16/system.h43
-rw-r--r--testsuites/tmtests/tm16/task1.c148
-rw-r--r--testsuites/tmtests/tm16/tm16.doc13
-rw-r--r--testsuites/tmtests/tm17/system.h43
-rw-r--r--testsuites/tmtests/tm17/task1.c127
-rw-r--r--testsuites/tmtests/tm17/tm17.doc13
-rw-r--r--testsuites/tmtests/tm18/system.h43
-rw-r--r--testsuites/tmtests/tm18/task1.c112
-rw-r--r--testsuites/tmtests/tm18/tm18.doc13
-rw-r--r--testsuites/tmtests/tm19/system.h43
-rw-r--r--testsuites/tmtests/tm19/task1.c208
-rw-r--r--testsuites/tmtests/tm19/tm19.doc13
-rw-r--r--testsuites/tmtests/tm20/system.h44
-rw-r--r--testsuites/tmtests/tm20/task1.c466
-rw-r--r--testsuites/tmtests/tm20/tm20.doc13
-rw-r--r--testsuites/tmtests/tm21/system.h50
-rw-r--r--testsuites/tmtests/tm21/task1.c236
-rw-r--r--testsuites/tmtests/tm21/tm21.doc13
-rw-r--r--testsuites/tmtests/tm22/system.h43
-rw-r--r--testsuites/tmtests/tm22/task1.c200
-rw-r--r--testsuites/tmtests/tm22/tm22.doc13
-rw-r--r--testsuites/tmtests/tm23/system.h43
-rw-r--r--testsuites/tmtests/tm23/task1.c302
-rw-r--r--testsuites/tmtests/tm23/tm23.doc13
-rw-r--r--testsuites/tmtests/tm24/system.h42
-rw-r--r--testsuites/tmtests/tm24/task1.c124
-rw-r--r--testsuites/tmtests/tm24/tm24.doc13
-rw-r--r--testsuites/tmtests/tm25/system.h43
-rw-r--r--testsuites/tmtests/tm25/task1.c109
-rw-r--r--testsuites/tmtests/tm25/tm25.doc13
-rw-r--r--testsuites/tmtests/tm26/fptest.h165
-rw-r--r--testsuites/tmtests/tm26/system.h43
-rw-r--r--testsuites/tmtests/tm26/task1.c580
-rw-r--r--testsuites/tmtests/tm26/tm26.doc13
-rw-r--r--testsuites/tmtests/tm27/system.h42
-rw-r--r--testsuites/tmtests/tm27/task1.c272
-rw-r--r--testsuites/tmtests/tm27/tm27.doc13
-rw-r--r--testsuites/tmtests/tm28/system.h43
-rw-r--r--testsuites/tmtests/tm28/task1.c134
-rw-r--r--testsuites/tmtests/tm28/tm28.doc13
-rw-r--r--testsuites/tmtests/tm29/system.h43
-rw-r--r--testsuites/tmtests/tm29/task1.c207
-rw-r--r--testsuites/tmtests/tm29/tm29.doc13
-rw-r--r--testsuites/tmtests/tmck/system.h42
-rw-r--r--testsuites/tmtests/tmck/task1.c180
-rw-r--r--testsuites/tmtests/tmck/tmck.doc20
-rw-r--r--testsuites/tmtests/tmoverhd/dumrtems.h255
-rw-r--r--testsuites/tmtests/tmoverhd/empty.c41
-rw-r--r--testsuites/tmtests/tmoverhd/system.h60
-rw-r--r--testsuites/tmtests/tmoverhd/testtask.c1279
-rw-r--r--testsuites/tmtests/tmoverhd/tmoverhd.doc13
-rw-r--r--tools/build/Makefile.in14
-rw-r--r--tools/build/README24
-rw-r--r--tools/build/binpatch.c168
-rw-r--r--tools/build/cklength.c377
-rw-r--r--tools/build/eolstrip.c366
-rw-r--r--tools/build/install-if-change.in142
-rw-r--r--tools/build/lock-directory.in43
-rw-r--r--tools/build/os/Makefile.in14
-rw-r--r--tools/build/os/msdos/Makefile.in39
-rw-r--r--tools/build/os/msdos/README12
-rw-r--r--tools/build/os/msdos/cklength.uue286
-rw-r--r--tools/build/os/msdos/fixtimer.c111
-rw-r--r--tools/build/os/msdos/fixtimer.uue162
-rw-r--r--tools/build/os/msdos/ifc.c331
-rw-r--r--tools/build/os/msdos/ifc_exe.uue163
-rw-r--r--tools/build/packhex.c565
-rw-r--r--tools/build/rcs-clean.in73
-rw-r--r--tools/build/scripts/Makefile.in36
-rw-r--r--tools/build/scripts/README24
-rw-r--r--tools/build/scripts/install-if-change.in142
-rw-r--r--tools/build/scripts/lock-directory.in43
-rw-r--r--tools/build/scripts/rcs-clean.in73
-rw-r--r--tools/build/scripts/search-id.sh15
-rw-r--r--tools/build/scripts/unlock-directory.in41
-rwxr-xr-xtools/build/search-id.sh15
-rw-r--r--tools/build/src/Makefile.in70
-rw-r--r--tools/build/src/cklength.c377
-rw-r--r--tools/build/src/config.h.in9
-rw-r--r--tools/build/src/eolstrip.c366
-rw-r--r--tools/build/src/packhex.c565
-rw-r--r--tools/build/src/unhex.c738
-rw-r--r--tools/build/unhex.c738
-rw-r--r--tools/build/unlock-directory.in41
-rw-r--r--tools/cpu/Makefile.in14
-rw-r--r--tools/cpu/generic/Makefile.in36
-rw-r--r--tools/cpu/generic/size_rtems.in276
-rw-r--r--tools/cpu/hppa1.1/genoffsets.c348
-rw-r--r--tools/cpu/sh/AUTHORS3
-rw-r--r--tools/cpu/sh/COPYING19
-rw-r--r--tools/cpu/sh/Makefile.in62
-rw-r--r--tools/cpu/sh/TODO13
-rw-r--r--tools/cpu/sh/sci.c157
-rw-r--r--tools/cpu/sh/sci.h11
-rw-r--r--tools/cpu/sh/shgen.c65
-rw-r--r--tools/cpu/unix/Makefile.in58
-rw-r--r--tools/cpu/unix/gensize.c116
-rw-r--r--tools/update/310_to_320_list545
-rw-r--r--tools/update/Makefile.in43
-rw-r--r--tools/update/README7
-rw-r--r--tools/update/update.in216
-rw-r--r--tools/update/word-replace.in89
5352 files changed, 8810 insertions, 783765 deletions
diff --git a/COPYING b/COPYING
deleted file mode 100644
index 01e8961d69..0000000000
--- a/COPYING
+++ /dev/null
@@ -1,343 +0,0 @@
-#
-# $Id$
-#
-
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-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 PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- Appendix: How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 939042cf44..0000000000
--- a/INSTALL
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-
-Building RTEMS
-==============
-See the file README.configure.
-
-
-UNCOMPRESSING .tgz FILES
-===========================
-Many of the files found in this directory and its subdirectories
-are gzip'ed, tar archive files. These files have the ".tgz"
-extension. They were compressed with gzip version 1.2.4.
-
-Use a command sequence similar to the following to uncompress each
-file:
-
- gzcat FILE.tgz | tar xvof -
-
-where FILE.tgz is the file to be installed. This procedure will
-extract the files in the archive into the current directory.
-All of the .tgz files associated with this release RTEMS will
-place their contents in a subdirectory rtems-<release> in the current
-directory.
-
-If you are unsure of what is in an RTEMS archive file, then use
-the following command sequence to get a listing of the contents:
-
- gzcat FILE.tgz | tar tvf -
-
-NOTES:
-
-(1) The "-o" option to tar is included on the tar command line
- so that the user extracting the tar archive will own the extracted
- files.
-
-(2) gzcat is sometimes installed as zcat. Be warned that on many
- (most) UNIX machines, zcat is associated with compress (.Z files).
-
-(3) If you do not have gzip 1.2.4, it is available from numerous sites
- including this one. Other sites include prep.ai.mit.edu and
- gatekeeper.dec.com.
-
-(4) The GNU archive files included in this distribution are packaged
- exactly like they are on official GNU ftp sites. When extracting
- GNU archives, they will not extract under a rtems-<version>
- directory. They will extract themselves under a directory which
- is the name and version of the tool in question. For example,
- gcc-2.5.8.tgz will extract its contents into the subdirectory
- gcc-2.5.8.
-
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 74871950fd..0000000000
--- a/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# $Id$
-#
- LICENSE INFORMATION
-
-RTEMS is free software; you can redistribute it and/or modify it under
-terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version. RTEMS 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. See the GNU
-General Public License for more details. You should have received
-a copy of the GNU General Public License along with RTEMS; see
-file COPYING. If not, write to the Free Software Foundation, 675
-Mass Ave, Cambridge, MA 02139, USA.
-
-As a special exception, including RTEMS header files in a file,
-instantiating RTEMS generics or templates, or linking other files
-with RTEMS objects to produce an executable application, does not
-by itself cause the resulting executable application to be covered
-by the GNU General Public License. This exception does not
-however invalidate any other reasons why the executable file might be
-covered by the GNU Public License.
diff --git a/Makefile.in b/Makefile.in
deleted file mode 100644
index 9046b7a6b8..0000000000
--- a/Makefile.in
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# top level directory for RTEMS build tree
-#
-# Modified by Jiri to implement autoconf and cygnus one-tree build
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
-includedir = @includedir@
-target = @target@
-manext = 1
-mandir = @mandir@/man$(manext)
-program_prefix = @program_prefix@
-
-export bindir
-
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-VPATH=@srcdir@
-
-ifeq ($(RTEMS_BSP),)
- RTEMS_BSP = @RTEMS_BSP_LIST@
-endif
-
-include $(RTEMS_ROOT)/make/main.cfg
-
-MTARGETS = pre_install_src all install $(TARGET_VARIANTS) $(TARGET_VARIANTS:%=%_all) \
- $(TARGET_VARIANTS:%=%_install) $(TARGET_VARIANTS:%=%_tests) \
- clean_wrapup distclean clean_dirs clean_tools tests clean depend
-
-EXIT_CMD = exit 1
-
-# Don't pass flags from previous make - especially NOT CFLAGS
-# NOTE: Previous versions overrode MAKEFLAGS, but this also disables
-# a lot of useful features
-# override MAKEFLAGS=
-
-$(MTARGETS):
- BASEDIR=`pwd`; \
- for bsp in $(RTEMS_BSP) xxx; \
- do if [ $$bsp != xxx ] ; then \
- cd $$BASEDIR; \
- cmd="cd c; $(MAKE) RTEMS_BSP=$$bsp $(FLAGS_TO_PASS) \
- $@" ; \
- eval $$cmd || $(EXIT_CMD); \
- fi; done;
-
-## Configuration stuff
-
-ACLOCAL = aclocal -I aclocal
-AUTOCONF = autoconf
-
-ACLOCAL_FILES := $(wildcard $(srcdir)/aclocal/*.m4)
-ACLOCAL_M4 = aclocal.m4
-
-$(ACLOCAL_M4): configure.in $(ACLOCAL_FILES)
- -cd $(RTEMS_ROOT) && $(ACLOCAL)
-
-Makefile: Makefile.in config.status
- CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-config.status: $(RTEMS_ROOT)/configure
- $(SHELL) ./config.status --recheck
-
-$(RTEMS_ROOT)/configure: $(RTEMS_ROOT)/configure.in $(ACLOCAL_M4)
- -cd $(RTEMS_ROOT) && $(AUTOCONF)
-
-.PRECIOUS: $(ACLOCAL_M4) configure Makefile config.status
-
diff --git a/README b/README
deleted file mode 100644
index d13a9e2443..0000000000
--- a/README
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# $Id$
-#
-
-Building RTEMS
-==============
-See the file README.configure.
-
-Directory Overview
-==================
-
-This is the top level of the RTEMS directory structure. The following
-is a description of the files and directories in this directory:
-
- INSTALL
- Rudimentary installation instructions. For more detailed
- information please see the Release Notes. The Postscript
- version of this manual can be found in the file
- c_or_ada/doc/relnotes.tgz.
-
- LICENSE
- Required legalese.
-
- README
- This file.
-
- c
- This directory contains the source code for the C
- implementation of RTEMS as well as the test suites, sample
- applications, Board Support Packages, Device Drivers, and
- support libraries.
-
- doc
- This directory contains the PDL for the RTEMS executive.
-
-Ada versus C
-============
-
-There are two implementations of RTEMS in this source tree --
-in Ada and in C. These two implementations are functionally
-and structurally equivalent. The C implementation follows
-the packaging conventions and hiearchical nature of the Ada
-implementation. In addition, a style has been followed which
-allows one to easily find the corresponding Ada and C
-implementations.
-
-File names in C and code placement was carefully designed to insure
-a close mapping to the Ada implementation. The following file name
-extensions are used:
-
- .adb - Ada body
- .ads - Ada specification
- .adp - Ada body requiring preprocessing
- .inc - include file for .adp files
-
- .c - C body (non-inlined routines)
- .inl - C body (inlined routines)
- .h - C specification
-
-In the executive source, XYZ.c and XYZ.inl correspond directly to a
-single XYZ.adb or XYZ.adp file. A .h file corresponds directly to
-the .ads file. There are only a handful of .inc files in the
-Ada source and these are used to insure that the desired simple
-inline textual expansion is performed. This avoids scoping and
-calling convention side-effects in carefully constructed tests
-which usually test context switch behavior.
-
-In addition, in Ada code and data name references are always fully
-qualified as PACKAGE.NAME. In C, this convention is followed
-by having the package name as part of the name itself and using a
-capital letter to indicate the presence of a "." level. So we have
-PACKAGE.NAME in Ada and _Package_Name in C. The leading "_" in C
-is used to avoid naming conflicts between RTEMS and user variables.
-By using these conventions, one can easily compare the C and Ada
-implementations.
-
-The most noticeable difference between the C and Ada83 code is
-the inability to easily obtain a "typed pointer" in Ada83.
-Using the "&" operator in C yields a pointer with a specific type.
-The 'Address attribute is the closest feature in Ada83. This
-returns a System.Address and this must be coerced via Unchecked_Conversion
-into an access type of the desired type. It is easy to view
-System.Address as similar to a "void *" in C, but this is not the case.
-A "void *" can be assigned to any other pointer type without an
-explicit conversion.
-
-The solution adopted to this problem was to provide two routines for
-each access type in the Ada implementation -- one to convert from
-System.Address to the access type and another to go the opposite
-direction. This results in code which accomplishes the same thing
-as the corresponding C but it is easier to get lost in the clutter
-of the apparent subprogram invocations than the "less bulky"
-C equivalent.
-
-A related difference is the types which are only in Ada which are used
-for pointers to arrays. These types do not exist and are not needed
-in the C implementation.
diff --git a/README.configure b/README.configure
deleted file mode 100644
index 40dd22847f..0000000000
--- a/README.configure
+++ /dev/null
@@ -1,259 +0,0 @@
-#
-# $Id$
-#
-
-1. Autoconf support
-===================
-
-This version of RTEMS is configured with GNU autoconf. RTEMS can be
-configured and built either standalone or together with the compiler
-tools in the Cygnus one-tree structure. Using autoconf also means
-that RTEMS now can be built in a separate build directory.
-
-2. Installation
-===============
-
-2.1 Standalone build
-
-To configure RTEMS for a specific target, run configure in the build
-directory. In addition to the standard configure options, the following
-RTEMS-specific option are supported:
-
- --disable-rtems-inlines
- --disable-posix
- --disable-tests
- --disable-networking
- --enable-cxx
- --enable-bare-cpu-model=<MODEL>
- --enable-bare-cpu-cflags=<FLAGS>
- --enable-gcc28 (also use enable-libcdir when disabled)
- --enable-gmake-print-directory
- --enable-libcdir=<DIRECTORY> (do not use if gcc 2.8 is enabled)
- --enable-rtemsbsp="bsp1 bsp2 ..."
-
-In addition, the following standard autoconf options are frequently
-used when configuring RTEMS installations:
-
- --prefix=INSTALL_DIRECTORY
- --program-prefix=
-
-By default, the RTEMS posix interface is built for targets that support
-it. It can be disabled with the --disable-posix option.
-
-By default, the RTEMS networking support is built for targets which
-support it. It can be specifically disabled for those targets
-with the --disable-networking option.
-
-By default, the RTEMS support of C++ is disabled. It can be enabled
-with the --enable-cxx option. If the rtems++ C++ library is installed
-it will also be build.
-
-By default, the RTEMS test suites are configured. The --disable-tests
-will not configure the RTEMS test suite. This is used only to speed-up
-configuration in case building the tests are not necessary.
-
-By default, RTEMS is built using arguments and build rules which are
-compatible with gcc 2.7.2.2. This requires that the user specify
-the location of the Standard C Library with the --enable-libcdir
-option. If using a gcc which supports the -specs option, then
-the --enable-gcc28 option may be used to enable this feature.
-You should use the --enable-gcc28 option when using either the
-egcs source tree, testgcc snapshots, or gcc 2.8.0 or newer.
-
-By default, all bsps for a target are built. The bare BSP is not built
-unless directlty specified. There are two ways of changing this:
-
- + use the --enable-rtemsbsp otion which will set the specified
- bsps as the default bsps, or
- + set the RTEMS_BSP variable during make (see below).
-
-The --enable-rtemsbsp= option configures RTEMS for a specific target
-architecture. The following targets are supported:
-
- (none) will build the host-based version on Linux,
- Solaris and HPUX.
-
- a29k-rtems only standalone, uses non-gnu compiler
- i386-rtems
- i386-go32-rtems see notes
- i960-rtems
- hppa1.1-rtems
- m68k-rtems
- mips64orion-rtems
- no_cpu-rtems
- powerpc-rtems
- sparc-rtems
- bare see notes
-
-The cross-compiler is set to $(target)-gcc by default. This can be
-overriden by:
-
- + using the --program-prefix option to configure to specify the
- string which will prepended to the tool names. Be sure to include
- a trailing "-". For example, to use a m68k-coff toolset, use the
- --program-prefix=m68k-coff- option.
-
-To build, run make in the build directory. To specify which bsps to build,
-add the RTEMS_BSP="bsp1 bsp2 .." to the make command. Specifying multiple
-BSPs to build only works from the top level build directory.
-
-Installation is done under $(prefix)/rtems.
-
-As an example, to build and install the mvme136 and dmv152 bsps for m68k do:
-
- (path_to_rtems_src)/configure --target=m68k-rtems
-
- make RTEMS_BSP="mvme136 dmv152"
-
- make install RTEMS_BSP="mvme136 dmv152"
-
-The sample tests are built by 'make all', do a 'make test' to build the full
-test suite.
-
-2.2 Build with Cygnus one-tree release
-
-To build and install RTEMS with the one-tree structure, just copy the rtems
-directory to the tree. The one-tree configure.in and Makefile.in has to be
-replaced with the RTEMS-aware versions. The build options are the same as
-for the standalone build.
-
-2.3 Target Dependent Notes
-
-i386-go32-rtems:
-
- 1. This is based on djgpp v1.xx. It needs to be updated to v2.xx.
- 2. This cannot be built one-tree style since RTEMS requires some
- files which must be obtained from the binary distribution of the
- djgpp library. DJGPP can be obtained from
- http://www.delorie.com/djgpp/dl/ofc.
- 3. You will need to manually install a number of files from the
- binary distribution of the DJGPP library doing something
- like the following:
-
- # unzip the djgpp distribution
- cd include
- cp dpmi.h INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2/include
- cp go32.h INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2/include
- cp dos.h INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2/include
- cp pc.h INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2/include
-
- cd ../lib
- cp crt* INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2
- cp libpc* INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2
-
- # Make sure about destination on the next lines. It keeps the newlib
- # libc.a and the binary djgpp libc.a from conflicting.
- cp libc.a INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2/libcgo32.a
- cp libc_p.a INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2/libcgo32_p.a
-
-bare:
-
- 1. See the README in the bare bsp source directory. This should
- contain all info you need.
- 2. The bare bsp source contains a script to show how to build it.
- 3. The configure flags must be used to get the bare bsp to work.
- The --enable-bare-cpu-model and --enable-bare-cpu-cflags are the
- only pieces of information. The module is usually a gcc module
- such as m68302 or mcpu32. The flags are passed directly to gcc.
- Use "" if more than one option is specified.
-
-3. To use the installed RTEMS library
-=====================================
-
-To use the installed RTEMS bsps to build applications, the application
-makefile has to include a bsp-specific makefile that will define the
-RTEMS variables necessary to find include files and libraries. The
-bsp-specific makefile is installed at
-
- $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-
-For the erc32 bsp installed at /usr/local/cross, the environment
-variable RTEMS_MAKEFILE_PATH would be set as follows to the
-following:
-
-/usr/local/cross/sparc-rtems/rtems/erc32/Makefile.inc
-
-4. Supported target bsps
-========================
-
-The following bsps are supported:
-
-host-based : posix (on linux, solaris and hpux)
-
-a29k : portsw
-i386 : force386 i386ex pc386
-i386-go32 : go32 go32_p5
-i960 : cvme961
-hppa1.1 : simhppa
-m68k : dmv152 efi332 efi68k gen68302 gen68340 gen68360
- gen68360_040 idp mvme136 mvme147 mvme147s mvme162 ods68302
-no_cpu : no_bsp
-mips64orion : p4600 p4650 (p4000 port with either R4600 or R4650)
-powerpc : papyrus psim helas403
-sh : gensh1
-sparc : erc32
-any : bare
-
-5. Makefile structure
-=====================
-
-The makefiles have been re-organised. Most gnu-based bsps now use three
-main makefiles:
- + custom/default.cfg,
- + custom/bsp.cfg and
- + ompilers/gcc-target-default.cfg.
-
-Default.cfg sets the deafult values of certain common build options.
-
-Bsp.cfg set bsp-specific build options and can also override the
-default settings.
-
-Gcc-target-default.cfg contains the common gcc definitions. Some targets
-(a29k, no_cpu, and posix) still use the old structure.
-
-6. Adding a bsp
-===============
-
-The top-level configure.in has to be modified if a new target is added
-or if a new bsp is to be built by default. The additions required is
-basically to add which makefiles are to be created by configure and
-to add the target to the selection statement. To re-generate
-configure, autoconf-2.12 is needed.
-
-7. Tested configurations
-========================
-
-All gnu-based bsps have been built on Linux.
-The native (posix) ports have been built and run only on Linux.
-
-The following configurations have NOT been tested:
-
- + Anything on Nextstep, HPUX and Irix.
- + The a29k port.
-
-8. Pre-requisites
-=================
-
-Gawk version 2 or higher.
-GNU make version 3.72 or higher.
-Bash.
-gcc version ???
-
-TODO
-====
-
-The install-if-change script requires bash. On solaris systems, this should
-be changed to ksh, since ksh is provided with solaris (bash not).
-
-A fairly rescent version of gawk is needed to build RTEMS. This should be
-changed so that a plain vanilla awk also works. [NOTE: This dependency
-should disappear when the "gcc 2.8 -specs" is finished.]
-
-'make install' should only install necessary files, not the full
-PROJECT_RELEASE directory as now.
-
-Posix port on solaris-2.5 fails due to undefined built-in functions
-(gcc-2.7.2, might be my installation).
-
-Improve support for 'make CFLAGS=xxx'.
-
diff --git a/SUPPORT b/SUPPORT
deleted file mode 100644
index 55ea218bcf..0000000000
--- a/SUPPORT
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# $Id$
-#
-
-RTEMS was developed by On-Line Applications Research Corporation (OAR)
-for the U.S. Army Missile Command. OAR offers support, customization,
-and training for RTEMS. Custom RTEMS development services includes
-porting RTEMS to new processors and the development of custom board
-support packages and device drivers. In addition, OAR is available
-to assist in the development of your real-time embedded application.
-
-For more information, email Mark Johannes at mark@OARcorp.com
-or contact OAR at:
-
-On-Line Applications Research Corporation
-4910-L Corporate Drive
-Huntsville AL 35805
-Voice: (205) 722-9985
-Fax: (205 722-0985
-
-In the past, RTEMS maintainance and enhancements were primarily funded
-by the development contracts sponsored by the U.S. Army. Now RTEMS
-is funded solely by RTEMS users. The future of RTEMS depends on
-its user base.
-
diff --git a/VERSION b/VERSION
deleted file mode 100644
index 6fb76ae59f..0000000000
--- a/VERSION
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# $Id$
-#
-
-RTEMS Version 4.0.0
diff --git a/aclocal.m4 b/aclocal.m4
deleted file mode 100644
index 17aa090fb1..0000000000
--- a/aclocal.m4
+++ /dev/null
@@ -1,615 +0,0 @@
-dnl aclocal.m4 generated automatically by aclocal 1.2
-
-dnl
-dnl $Id$
-dnl
-
-dnl macro to detect mkdir
-AC_DEFUN(RTEMS_PATH_MKDIR,
-[AC_PATH_PROG(MKDIR,mkdir)
-])
-
-dnl macro to check for mkdir -p
-AC_DEFUN(RTEMS_PROG_MKDIR_P,
-[
-AC_REQUIRE([RTEMS_PATH_MKDIR])
-AC_MSG_CHECKING([for working $MKDIR -p])
-AC_CACHE_VAL(rtems_cv_prog_mkdir_p,
-[rm -rf conftestdata
-if $MKDIR -p conftestdata 2>/dev/null ;then
-rtems_cv_prog_MKDIR_P="yes"
-else
-rtems_cv_prog_MKDIR_P="no"
-fi])dnl
-rm -rf conftestdata
-AC_MSG_RESULT($rtems_cv_prog_MKDIR_P)
-])
-
-dnl macro to check for mkdir -m 0755
-AC_DEFUN(RTEMS_PROG_MKDIR_M,
-[
-AC_REQUIRE([RTEMS_PATH_MKDIR])
-AC_MSG_CHECKING([for working $MKDIR -m 0755])
-AC_CACHE_VAL(rtems_cv_prog_MKDIR_P,
-[rm -rf conftestdata
-if $MKDIR -m 0775 conftestdata 2>/dev/null; then
-rtems_cv_prog_MKDIR_M="yes"
-else
-rtems_cv_prog_MKDIR_M="no"
-fi])dnl
-rm -rf conftestdata
-AC_MSG_RESULT($rtems_cv_prog_MKDIR_M)
-])
-
-
-dnl
-dnl $Id$
-dnl
-
-dnl canonicalize target name
-dnl NOTE: Most rtems targets do not fullfil autoconf's
-dnl target naming conventions "processor-vendor-os"
-dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
-dnl and we have to fix it for rtems ourselves
-
-AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU,
-[AC_MSG_CHECKING(rtems target cpu)
-changequote(<<, >>)dnl
-target_cpu=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'`
-changequote([, ])dnl
-AC_MSG_RESULT($target_cpu)
-])
-
-dnl
-dnl $Id$
-dnl
-dnl Set program_prefix
-dnl
-dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-dnl Extracted from configure
-
-AC_DEFUN(RTEMS_TOOL_PREFIX,
-[AC_REQUIRE([AC_CANONICAL_TARGET])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-
-if [[ "${program_prefix}" = "NONE" ]] ; then
- if [[ "${target}" = "${host}" ]] ; then
- program_prefix=
- else
- program_prefix=${target}-
- fi
-fi
-])
-
-dnl
-dnl $Id$
-dnl
-dnl Check for target gcc
-dnl
-dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-dnl Completely reworked
-
-AC_DEFUN(RTEMS_PROG_CC,
-[
-AC_BEFORE([$0], [AC_PROG_CPP])dnl
-AC_BEFORE([$0], [AC_PROG_CC])dnl
-AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
-
-dnl Only accept gcc and cc
-dnl NOTE: This might be too restrictive for native compilation
-AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
-test -z "$CC_FOR_TARGET" \
- && AC_MSG_ERROR([no acceptable cc found in \$PATH])
-
-dnl backup
-rtems_save_CC=$CC
-rtems_save_CFLAGS=$CFLAGS
-
-dnl temporarily set CC
-CC=$CC_FOR_TARGET
-
-AC_PROG_CC_WORKS
-AC_PROG_CC_GNU
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-dnl Check whether -g works, even if CFLAGS is set, in case the package
-dnl plays around with CFLAGS (such as to build both debugging and
-dnl normal versions of a library), tasteless as that idea is.
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- AC_PROG_CC_G
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- fi
-else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-
-rtems_cv_prog_gcc=$ac_cv_prog_gcc
-rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
-rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
-rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
-
-dnl restore initial values
-CC=$rtems_save_CC
-CFLAGS=$rtems_save_CFLAGS
-
-unset ac_cv_prog_gcc
-unset ac_cv_prog_cc_g
-unset ac_cv_prog_cc_works
-unset ac_cv_prog_cc_cross
-])
-
-dnl
-dnl $Id$
-dnl
-dnl Check whether the target compiler accepts -specs
-dnl
-dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de
-dnl
-
-AC_DEFUN(RTEMS_GCC_SPECS,
-[AC_REQUIRE([RTEMS_PROG_CC])
-AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs,
-[
-rtems_cv_gcc_specs=no
-if test "$rtems_cv_prog_gcc" = "yes"; then
- touch confspec
- echo 'void f(){}' >conftest.c
- if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
- rtems_cv_gcc_specs=yes
- fi
-fi
-rm -f confspec conftest*
-])])
-
-dnl
-dnl $Id$
-dnl
-dnl Check whether the target compiler accepts -pipe
-dnl
-dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de
-dnl
-
-AC_DEFUN(RTEMS_GCC_PIPE,
-[AC_REQUIRE([RTEMS_PROG_CC])
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe,
-[
-rtems_cv_gcc_pipe=no
-if test "$rtems_cv_prog_gcc" = "yes"; then
-case "$host_os" in
- cygwin32*)
- ;;
- *)
- echo 'void f(){}' >conftest.c
- if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
- rtems_cv_gcc_pipe=yes
- fi
- rm -f conftest*
- ;;
-esac
-fi
-])
-])
-
-dnl
-dnl $Id$
-dnl
-dnl Check for target g++
-dnl
-dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-dnl Completely reworked
-
-AC_DEFUN(RTEMS_PROG_CXX,
-[
-AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
-AC_BEFORE([$0], [AC_PROG_CXX])dnl
-AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
-
-dnl Only accept g++ and c++
-dnl NOTE: This might be too restrictive for native compilation
-AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++)
-test -z "$CXX_FOR_TARGET" \
- && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
-
-dnl backup
-rtems_save_CXX=$CXX
-rtems_save_CXXFLAGS=$CXXFLAGS
-
-dnl temporarily set CXX
-CXX=$CXX_FOR_TARGET
-
-AC_PROG_CXX_WORKS
-AC_PROG_CXX_GNU
-
-if test $ac_cv_prog_gxx = yes; then
- GXX=yes
-dnl Check whether -g works, even if CXXFLAGS is set, in case the package
-dnl plays around with CXXFLAGS (such as to build both debugging and
-dnl normal versions of a library), tasteless as that idea is.
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=
- AC_PROG_CXX_G
- if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS="$ac_save_CXXFLAGS"
- elif test $ac_cv_prog_cxx_g = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-O2"
- fi
-else
- GXX=
- test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
-fi
-
-rtems_cv_prog_gxx=$ac_cv_prog_gxx
-rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g
-rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works
-rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross
-
-CXX=$rtems_save_CXX
-CXXFLAGS=$rtems_save_CXXFLAGS
-
-dnl restore initial values
-unset ac_cv_prog_gxx
-unset ac_cv_prog_cc_g
-unset ac_cv_prog_cxx_works
-unset ac_cv_prog_cxx_cross
-])
-
-dnl
-dnl $Id$
-dnl
-dnl Set target tools
-dnl
-dnl 98/06/23 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-dnl fixing cache/environment variable handling
-dnl adding checks for cygwin/egcs '\\'-bug
-dnl adding checks for ranlib/ar -s problem
-dnl
-dnl 98/02/12 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-dnl
-
-AC_DEFUN(RTEMS_GCC_PRINT,
-[ case $host_os in
- *cygwin32*)
- dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/'
- dnl Should be removed once cygwin/egcs reports '/' only
- $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' `
- ;;
- *)
- $1=`$CC_FOR_TARGET --print-prog-name=$2`
- ;;
- esac
-])
-
-AC_DEFUN(RTEMS_PATH_TOOL,
-[
-AC_MSG_CHECKING([target's $2])
-AC_CACHE_VAL(ac_cv_path_$1,:)
-AC_MSG_RESULT([$ac_cv_path_$1])
-
-if test -n "$ac_cv_path_$1"; then
- dnl retrieve the value from the cache
- $1=$ac_cv_path_$1
-else
- dnl the cache was not set
- if test -z "[$]$1" ; then
- if test "$rtems_cv_prog_gcc" = "yes"; then
- # We are using gcc, ask it about its tool
- # NOTE: Necessary if gcc was configured to use the target's
- # native tools or uses prefixes for gnutools (e.g. gas instead of as)
- RTEMS_GCC_PRINT($1,$2)
- fi
- else
- # The user set an environment variable.
- # Check whether it is an absolute path, otherwise AC_PATH_PROG
- # will override the environment variable, which isn't what the user
- # intends
- AC_MSG_CHECKING([whether environment variable $1 is an absolute path])
- case "[$]$1" in
- /*) # valid
- AC_MSG_RESULT("yes")
- ;;
- *) # invalid for AC_PATH_PROG
- AC_MSG_RESULT("no")
- AC_MSG_ERROR([***]
- [Environment variable $1 should ether]
- [be unset (preferred) or contain an absolute path])
- ;;
- esac
- fi
-
- AC_PATH_PROG($1,"$program_prefix"$2,$3)
-fi
-])
-
-AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
-[AC_REQUIRE([RTEMS_PROG_CC])dnl
-
-dnl FIXME: What shall be done if these tools are not available?
- RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
- RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
- RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
- RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
-
-dnl special treatment of ranlib
- RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
- if test "$RANLIB_FOR_TARGET" = "no"; then
- # ranlib wasn't found; check if ar -s is available
- RTEMS_AR_FOR_TARGET_S
- if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
- dnl override RANLIB_FOR_TARGET's cache
- ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
- RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
- else
- AC_MSG_ERROR([***]
- [Can't figure out how to build a library index]
- [Nether ranlib nor ar -s seem to be available] )
- fi
- fi
-
-dnl NOTE: These may not be available if not using gnutools
- RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
- RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
- RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no)
-])
-
-dnl
-dnl $Id$
-dnl
-
-AC_DEFUN(RTEMS_AR_FOR_TARGET_S,
-[
-AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works,
-rtems_cv_AR_FOR_TARGET_S,
-[
-cat > conftest.$ac_ext <<EOF
-int foo( int b )
-{ return b; }
-EOF
-if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \
- && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \
- && test -s conftest.a ; \
-then
- rtems_cv_AR_FOR_TARGET_S="yes"
-else
- rtems_cv_AR_FOR_TARGET_S="no"
-fi
- rm -f conftest*
-])
-])
-
-
-dnl
-dnl $Id$
-dnl
-
-dnl check for i386 gas supporting 16 bit mode
-dnl - binutils 2.9.1.0.7 and higher
-
-AC_DEFUN(RTEMS_I386_GAS_CODE16,
- if test "${target_cpu}" = "i386"; then
- AC_CACHE_CHECK([for 16 bit mode assembler support],
- rtems_cv_prog_gas_code16,
- [cat > conftest.s << EOF
- .code16
- data32
- addr32
- lgdt 0
-EOF
- if AC_TRY_COMMAND($AS_FOR_TARGET -o conftest.o conftest.s); then
- rtems_cv_prog_gas_code16=yes
- else
- rtems_cv_prog_gas_code16=no
- fi])
- RTEMS_GAS_CODE16="$rtems_cv_prog_gas_code16"
- fi
-)
-
-
-dnl
-dnl $Id$
-dnl
-dnl Detect the Cygwin32 environment (unix under Win32)
-dnl
-dnl 98/06/16 David Fiddes (D.J.Fiddes@hw.ac.uk)
-dnl Hacked from automake-1.3
-
-# Check to see if we're running under Cygwin32, without using
-# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
-# Otherwise set it to "no".
-
-dnl RTEMS_CYGWIN32()
-AC_DEFUN(RTEMS_CYGWIN32,
-[AC_CACHE_CHECK(for Cygwin32 environment, rtems_cv_cygwin32,
-[AC_TRY_COMPILE(,[return __CYGWIN32__;],
-rtems_cv_cygwin32=yes, rtems_cv_cygwin32=no)
-rm -f conftest*])
-CYGWIN32=
-test "$rtems_cv_cygwin32" = yes && CYGWIN32=yes])
-
-
-dnl
-dnl $Id$
-dnl
-dnl Set the EXE extension
-dnl
-dnl 98/06/16 David Fiddes (D.J.Fiddes@hw.ac.uk)
-dnl Hacked from automake-1.3
-
-# Check to see if we're running under Win32, without using
-# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
-# Otherwise set it to "".
-
-dnl RTEMS_EXEEXT()
-dnl This knows we add .exe if we're building in the Cygwin32
-dnl environment. But if we're not, then it compiles a test program
-dnl to see if there is a suffix for executables.
-AC_DEFUN(RTEMS_EXEEXT,
-[AC_REQUIRE([RTEMS_CYGWIN32])
-AC_MSG_CHECKING([for executable suffix])
-AC_CACHE_VAL(rtems_cv_exeext,
-[if test "$CYGWIN32" = yes; then
-rtems_cv_exeext=.exe
-else
-cat > rtems_c_test.c << 'EOF'
-int main() {
-/* Nothing needed here */
-}
-EOF
-${CC-cc} -o rtems_c_test $CFLAGS $CPPFLAGS $LDFLAGS rtems_c_test.c $LIBS 1>&5
-rtems_cv_exeext=`echo rtems_c_test.* | grep -v rtems_c_test.c | sed -e s/rtems_c_test//`
-rm -f rtems_c_test*])
-test x"${rtems_cv_exeext}" = x && rtems_cv_exeext=no
-fi
-EXEEXT=""
-test x"${rtems_cv_exeext}" != xno && EXEEXT=${rtems_cv_exeext}
-AC_MSG_RESULT(${rtems_cv_exeext})
-AC_SUBST(EXEEXT)])
-
-
-dnl
-dnl $Id$
-dnl
-dnl Check for System V IPC calls used by Unix simulators
-dnl
-dnl 98/07/17 Dario Alcocer alcocer@netcom.com
-dnl Ralf Corsepius corsepiu@faw.uni-ulm.de
-dnl
-dnl Note: $host_os should probably *not* ever be used here to
-dnl determine if host supports System V IPC calls, since some
-dnl (e.g. FreeBSD 2.x) are configured by default to include only
-dnl a subset of the System V IPC calls. Therefore, to make sure
-dnl all of the required calls are found, test for each call explicitly.
-dnl
-dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally
-dnl modify any existing key sets. See the man pages for semget, shmget,
-dnl msgget, semctl, shmctl and msgctl for details.
-
-AC_DEFUN(RTEMS_SYSV_SEM,
-[AC_REQUIRE([RTEMS_PROG_CC])
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores,
-rtems_cv_sysv_sem,
-[
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-int main () {
-#if !defined(sun)
- union semun arg ;
-#else
- union semun {
- int val;
- struct semid_ds *buf;
- ushort *array;
- } arg;
-#endif
- int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
- if (id == -1)
- exit(1);
- arg.val = 0; /* avoid implicit type cast to union */
- if (semctl(id, 0, IPC_RMID, arg) == -1)
- exit(1);
- exit(0);
-}
-],
-rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :)
-])
-])
-
-AC_DEFUN(RTEMS_SYSV_SHM,
-[AC_REQUIRE([RTEMS_PROG_CC])
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory,
-rtems_cv_sysv_shm,
-[
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-int main () {
- int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
- if (id == -1)
- exit(1);
- if (shmctl(id, IPC_RMID, 0) == -1)
- exit(1);
- exit(0);
-}
-],
-rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :)
-])
-])
-
-AC_DEFUN(RTEMS_SYSV_MSG,
-[AC_REQUIRE([RTEMS_PROG_CC])
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages,
-rtems_cv_sysv_msg,
-[
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-int main () {
- int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
- if (id == -1)
- exit(1);
- if (msgctl(id, IPC_RMID, 0) == -1)
- exit(1);
- exit(0);
-}
-],
-rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :)
-])
-])
-
-dnl
-dnl $Id$
-dnl
-
-dnl RTEMS_CHECK_MAKEFILE(path)
-dnl Search for Makefile.in's within the directory starting
-dnl at path and append an entry for Makefile to global variable
-dnl "makefiles" (from configure.in) for each Makefile.in found
-dnl
-AC_DEFUN(RTEMS_CHECK_MAKEFILE,
-[RTEMS_CHECK_FILES_IN($1,Makefile,makefiles)
-])
-
-dnl
-dnl $Id$
-dnl
-
-dnl RTEMS_CHECK_FILES_IN(path,file,var)
-dnl path .. path relative to srcdir, where to start searching for files
-dnl file .. name of the files to search for
-dnl var .. shell variable to append files found
-
-AC_DEFUN(RTEMS_CHECK_FILES_IN,
-[
-AC_MSG_CHECKING(for $2.in in $1)
-if test -d $srcdir/$1; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find $1 -name "$2.in" -print | sed "s/$2\.in/%/" | sort | sed "s/%/$2/"`
- $3="$$3 $rtems_av_tmp";
- cd $rtems_av_save_dir;
- AC_MSG_RESULT(done)
-else
- AC_MSG_RESULT(no)
-fi
-])
-
-
diff --git a/aclocal/ar-s.m4 b/aclocal/ar-s.m4
deleted file mode 100644
index 2119c43a6d..0000000000
--- a/aclocal/ar-s.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-dnl
-dnl $Id$
-dnl
-
-AC_DEFUN(RTEMS_AR_FOR_TARGET_S,
-[
-AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works,
-rtems_cv_AR_FOR_TARGET_S,
-[
-cat > conftest.$ac_ext <<EOF
-int foo( int b )
-{ return b; }
-EOF
-if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \
- && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \
- && test -s conftest.a ; \
-then
- rtems_cv_AR_FOR_TARGET_S="yes"
-else
- rtems_cv_AR_FOR_TARGET_S="no"
-fi
- rm -f conftest*
-])
-])
-
diff --git a/aclocal/canonical-target-name.m4 b/aclocal/canonical-target-name.m4
deleted file mode 100644
index 7fbfa599c1..0000000000
--- a/aclocal/canonical-target-name.m4
+++ /dev/null
@@ -1,17 +0,0 @@
-dnl
-dnl $Id$
-dnl
-
-dnl canonicalize target name
-dnl NOTE: Most rtems targets do not fullfil autoconf's
-dnl target naming conventions "processor-vendor-os"
-dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
-dnl and we have to fix it for rtems ourselves
-
-AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU,
-[AC_MSG_CHECKING(rtems target cpu)
-changequote(<<, >>)dnl
-target_cpu=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'`
-changequote([, ])dnl
-AC_MSG_RESULT($target_cpu)
-])
diff --git a/aclocal/canonicalize-tools.m4 b/aclocal/canonicalize-tools.m4
deleted file mode 100644
index 4857c611fc..0000000000
--- a/aclocal/canonicalize-tools.m4
+++ /dev/null
@@ -1,97 +0,0 @@
-dnl
-dnl $Id$
-dnl
-dnl Set target tools
-dnl
-dnl 98/06/23 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-dnl fixing cache/environment variable handling
-dnl adding checks for cygwin/egcs '\\'-bug
-dnl adding checks for ranlib/ar -s problem
-dnl
-dnl 98/02/12 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-dnl
-
-AC_DEFUN(RTEMS_GCC_PRINT,
-[ case $host_os in
- *cygwin32*)
- dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/'
- dnl Should be removed once cygwin/egcs reports '/' only
- $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' `
- ;;
- *)
- $1=`$CC_FOR_TARGET --print-prog-name=$2`
- ;;
- esac
-])
-
-AC_DEFUN(RTEMS_PATH_TOOL,
-[
-AC_MSG_CHECKING([target's $2])
-AC_CACHE_VAL(ac_cv_path_$1,:)
-AC_MSG_RESULT([$ac_cv_path_$1])
-
-if test -n "$ac_cv_path_$1"; then
- dnl retrieve the value from the cache
- $1=$ac_cv_path_$1
-else
- dnl the cache was not set
- if test -z "[$]$1" ; then
- if test "$rtems_cv_prog_gcc" = "yes"; then
- # We are using gcc, ask it about its tool
- # NOTE: Necessary if gcc was configured to use the target's
- # native tools or uses prefixes for gnutools (e.g. gas instead of as)
- RTEMS_GCC_PRINT($1,$2)
- fi
- else
- # The user set an environment variable.
- # Check whether it is an absolute path, otherwise AC_PATH_PROG
- # will override the environment variable, which isn't what the user
- # intends
- AC_MSG_CHECKING([whether environment variable $1 is an absolute path])
- case "[$]$1" in
- /*) # valid
- AC_MSG_RESULT("yes")
- ;;
- *) # invalid for AC_PATH_PROG
- AC_MSG_RESULT("no")
- AC_MSG_ERROR([***]
- [Environment variable $1 should ether]
- [be unset (preferred) or contain an absolute path])
- ;;
- esac
- fi
-
- AC_PATH_PROG($1,"$program_prefix"$2,$3)
-fi
-])
-
-AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
-[AC_REQUIRE([RTEMS_PROG_CC])dnl
-
-dnl FIXME: What shall be done if these tools are not available?
- RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
- RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
- RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
- RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
-
-dnl special treatment of ranlib
- RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
- if test "$RANLIB_FOR_TARGET" = "no"; then
- # ranlib wasn't found; check if ar -s is available
- RTEMS_AR_FOR_TARGET_S
- if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
- dnl override RANLIB_FOR_TARGET's cache
- ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
- RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
- else
- AC_MSG_ERROR([***]
- [Can't figure out how to build a library index]
- [Nether ranlib nor ar -s seem to be available] )
- fi
- fi
-
-dnl NOTE: These may not be available if not using gnutools
- RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
- RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
- RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no)
-])
diff --git a/aclocal/check-files-in.m4 b/aclocal/check-files-in.m4
deleted file mode 100644
index f68729b715..0000000000
--- a/aclocal/check-files-in.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-dnl
-dnl $Id$
-dnl
-
-dnl RTEMS_CHECK_FILES_IN(path,file,var)
-dnl path .. path relative to srcdir, where to start searching for files
-dnl file .. name of the files to search for
-dnl var .. shell variable to append files found
-
-AC_DEFUN(RTEMS_CHECK_FILES_IN,
-[
-AC_MSG_CHECKING(for $2.in in $1)
-if test -d $srcdir/$1; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find $1 -name "$2.in" -print | sed "s/$2\.in/%/" | sort | sed "s/%/$2/"`
- $3="$$3 $rtems_av_tmp";
- cd $rtems_av_save_dir;
- AC_MSG_RESULT(done)
-else
- AC_MSG_RESULT(no)
-fi
-])
-
diff --git a/aclocal/check-makefile.m4 b/aclocal/check-makefile.m4
deleted file mode 100644
index 16b1c11118..0000000000
--- a/aclocal/check-makefile.m4
+++ /dev/null
@@ -1,12 +0,0 @@
-dnl
-dnl $Id$
-dnl
-
-dnl RTEMS_CHECK_MAKEFILE(path)
-dnl Search for Makefile.in's within the directory starting
-dnl at path and append an entry for Makefile to global variable
-dnl "makefiles" (from configure.in) for each Makefile.in found
-dnl
-AC_DEFUN(RTEMS_CHECK_MAKEFILE,
-[RTEMS_CHECK_FILES_IN($1,Makefile,makefiles)
-])
diff --git a/aclocal/cygwin.m4 b/aclocal/cygwin.m4
deleted file mode 100644
index 62b07ae4fd..0000000000
--- a/aclocal/cygwin.m4
+++ /dev/null
@@ -1,21 +0,0 @@
-dnl
-dnl $Id$
-dnl
-dnl Detect the Cygwin32 environment (unix under Win32)
-dnl
-dnl 98/06/16 David Fiddes (D.J.Fiddes@hw.ac.uk)
-dnl Hacked from automake-1.3
-
-# Check to see if we're running under Cygwin32, without using
-# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
-# Otherwise set it to "no".
-
-dnl RTEMS_CYGWIN32()
-AC_DEFUN(RTEMS_CYGWIN32,
-[AC_CACHE_CHECK(for Cygwin32 environment, rtems_cv_cygwin32,
-[AC_TRY_COMPILE(,[return __CYGWIN32__;],
-rtems_cv_cygwin32=yes, rtems_cv_cygwin32=no)
-rm -f conftest*])
-CYGWIN32=
-test "$rtems_cv_cygwin32" = yes && CYGWIN32=yes])
-
diff --git a/aclocal/exeext.m4 b/aclocal/exeext.m4
deleted file mode 100644
index 546351e66b..0000000000
--- a/aclocal/exeext.m4
+++ /dev/null
@@ -1,38 +0,0 @@
-dnl
-dnl $Id$
-dnl
-dnl Set the EXE extension
-dnl
-dnl 98/06/16 David Fiddes (D.J.Fiddes@hw.ac.uk)
-dnl Hacked from automake-1.3
-
-# Check to see if we're running under Win32, without using
-# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
-# Otherwise set it to "".
-
-dnl RTEMS_EXEEXT()
-dnl This knows we add .exe if we're building in the Cygwin32
-dnl environment. But if we're not, then it compiles a test program
-dnl to see if there is a suffix for executables.
-AC_DEFUN(RTEMS_EXEEXT,
-[AC_REQUIRE([RTEMS_CYGWIN32])
-AC_MSG_CHECKING([for executable suffix])
-AC_CACHE_VAL(rtems_cv_exeext,
-[if test "$CYGWIN32" = yes; then
-rtems_cv_exeext=.exe
-else
-cat > rtems_c_test.c << 'EOF'
-int main() {
-/* Nothing needed here */
-}
-EOF
-${CC-cc} -o rtems_c_test $CFLAGS $CPPFLAGS $LDFLAGS rtems_c_test.c $LIBS 1>&5
-rtems_cv_exeext=`echo rtems_c_test.* | grep -v rtems_c_test.c | sed -e s/rtems_c_test//`
-rm -f rtems_c_test*])
-test x"${rtems_cv_exeext}" = x && rtems_cv_exeext=no
-fi
-EXEEXT=""
-test x"${rtems_cv_exeext}" != xno && EXEEXT=${rtems_cv_exeext}
-AC_MSG_RESULT(${rtems_cv_exeext})
-AC_SUBST(EXEEXT)])
-
diff --git a/aclocal/gcc-pipe.m4 b/aclocal/gcc-pipe.m4
deleted file mode 100644
index 1e5b52be50..0000000000
--- a/aclocal/gcc-pipe.m4
+++ /dev/null
@@ -1,29 +0,0 @@
-dnl
-dnl $Id$
-dnl
-dnl Check whether the target compiler accepts -pipe
-dnl
-dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de
-dnl
-
-AC_DEFUN(RTEMS_GCC_PIPE,
-[AC_REQUIRE([RTEMS_PROG_CC])
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe,
-[
-rtems_cv_gcc_pipe=no
-if test "$rtems_cv_prog_gcc" = "yes"; then
-case "$host_os" in
- cygwin32*)
- ;;
- *)
- echo 'void f(){}' >conftest.c
- if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
- rtems_cv_gcc_pipe=yes
- fi
- rm -f conftest*
- ;;
-esac
-fi
-])
-])
diff --git a/aclocal/gcc-specs.m4 b/aclocal/gcc-specs.m4
deleted file mode 100644
index a422717d8a..0000000000
--- a/aclocal/gcc-specs.m4
+++ /dev/null
@@ -1,22 +0,0 @@
-dnl
-dnl $Id$
-dnl
-dnl Check whether the target compiler accepts -specs
-dnl
-dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de
-dnl
-
-AC_DEFUN(RTEMS_GCC_SPECS,
-[AC_REQUIRE([RTEMS_PROG_CC])
-AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs,
-[
-rtems_cv_gcc_specs=no
-if test "$rtems_cv_prog_gcc" = "yes"; then
- touch confspec
- echo 'void f(){}' >conftest.c
- if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
- rtems_cv_gcc_specs=yes
- fi
-fi
-rm -f confspec conftest*
-])])
diff --git a/aclocal/i386-gas-code16.m4 b/aclocal/i386-gas-code16.m4
deleted file mode 100644
index 507d18d80e..0000000000
--- a/aclocal/i386-gas-code16.m4
+++ /dev/null
@@ -1,26 +0,0 @@
-dnl
-dnl $Id$
-dnl
-
-dnl check for i386 gas supporting 16 bit mode
-dnl - binutils 2.9.1.0.7 and higher
-
-AC_DEFUN(RTEMS_I386_GAS_CODE16,
- if test "${target_cpu}" = "i386"; then
- AC_CACHE_CHECK([for 16 bit mode assembler support],
- rtems_cv_prog_gas_code16,
- [cat > conftest.s << EOF
- .code16
- data32
- addr32
- lgdt 0
-EOF
- if AC_TRY_COMMAND($AS_FOR_TARGET -o conftest.o conftest.s); then
- rtems_cv_prog_gas_code16=yes
- else
- rtems_cv_prog_gas_code16=no
- fi])
- RTEMS_GAS_CODE16="$rtems_cv_prog_gas_code16"
- fi
-)
-
diff --git a/aclocal/mkdir.m4 b/aclocal/mkdir.m4
deleted file mode 100644
index 6b3c2b7f8e..0000000000
--- a/aclocal/mkdir.m4
+++ /dev/null
@@ -1,41 +0,0 @@
-dnl
-dnl $Id$
-dnl
-
-dnl macro to detect mkdir
-AC_DEFUN(RTEMS_PATH_MKDIR,
-[AC_PATH_PROG(MKDIR,mkdir)
-])
-
-dnl macro to check for mkdir -p
-AC_DEFUN(RTEMS_PROG_MKDIR_P,
-[
-AC_REQUIRE([RTEMS_PATH_MKDIR])
-AC_MSG_CHECKING([for working $MKDIR -p])
-AC_CACHE_VAL(rtems_cv_prog_mkdir_p,
-[rm -rf conftestdata
-if $MKDIR -p conftestdata 2>/dev/null ;then
-rtems_cv_prog_MKDIR_P="yes"
-else
-rtems_cv_prog_MKDIR_P="no"
-fi])dnl
-rm -rf conftestdata
-AC_MSG_RESULT($rtems_cv_prog_MKDIR_P)
-])
-
-dnl macro to check for mkdir -m 0755
-AC_DEFUN(RTEMS_PROG_MKDIR_M,
-[
-AC_REQUIRE([RTEMS_PATH_MKDIR])
-AC_MSG_CHECKING([for working $MKDIR -m 0755])
-AC_CACHE_VAL(rtems_cv_prog_MKDIR_P,
-[rm -rf conftestdata
-if $MKDIR -m 0775 conftestdata 2>/dev/null; then
-rtems_cv_prog_MKDIR_M="yes"
-else
-rtems_cv_prog_MKDIR_M="no"
-fi])dnl
-rm -rf conftestdata
-AC_MSG_RESULT($rtems_cv_prog_MKDIR_M)
-])
-
diff --git a/aclocal/prog-cc.m4 b/aclocal/prog-cc.m4
deleted file mode 100644
index 864a3c3e07..0000000000
--- a/aclocal/prog-cc.m4
+++ /dev/null
@@ -1,65 +0,0 @@
-dnl
-dnl $Id$
-dnl
-dnl Check for target gcc
-dnl
-dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-dnl Completely reworked
-
-AC_DEFUN(RTEMS_PROG_CC,
-[
-AC_BEFORE([$0], [AC_PROG_CPP])dnl
-AC_BEFORE([$0], [AC_PROG_CC])dnl
-AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
-
-dnl Only accept gcc and cc
-dnl NOTE: This might be too restrictive for native compilation
-AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
-test -z "$CC_FOR_TARGET" \
- && AC_MSG_ERROR([no acceptable cc found in \$PATH])
-
-dnl backup
-rtems_save_CC=$CC
-rtems_save_CFLAGS=$CFLAGS
-
-dnl temporarily set CC
-CC=$CC_FOR_TARGET
-
-AC_PROG_CC_WORKS
-AC_PROG_CC_GNU
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-dnl Check whether -g works, even if CFLAGS is set, in case the package
-dnl plays around with CFLAGS (such as to build both debugging and
-dnl normal versions of a library), tasteless as that idea is.
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- AC_PROG_CC_G
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- fi
-else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-
-rtems_cv_prog_gcc=$ac_cv_prog_gcc
-rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
-rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
-rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
-
-dnl restore initial values
-CC=$rtems_save_CC
-CFLAGS=$rtems_save_CFLAGS
-
-unset ac_cv_prog_gcc
-unset ac_cv_prog_cc_g
-unset ac_cv_prog_cc_works
-unset ac_cv_prog_cc_cross
-])
diff --git a/aclocal/prog-cxx.m4 b/aclocal/prog-cxx.m4
deleted file mode 100644
index 5875692943..0000000000
--- a/aclocal/prog-cxx.m4
+++ /dev/null
@@ -1,65 +0,0 @@
-dnl
-dnl $Id$
-dnl
-dnl Check for target g++
-dnl
-dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-dnl Completely reworked
-
-AC_DEFUN(RTEMS_PROG_CXX,
-[
-AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
-AC_BEFORE([$0], [AC_PROG_CXX])dnl
-AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
-
-dnl Only accept g++ and c++
-dnl NOTE: This might be too restrictive for native compilation
-AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++)
-test -z "$CXX_FOR_TARGET" \
- && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
-
-dnl backup
-rtems_save_CXX=$CXX
-rtems_save_CXXFLAGS=$CXXFLAGS
-
-dnl temporarily set CXX
-CXX=$CXX_FOR_TARGET
-
-AC_PROG_CXX_WORKS
-AC_PROG_CXX_GNU
-
-if test $ac_cv_prog_gxx = yes; then
- GXX=yes
-dnl Check whether -g works, even if CXXFLAGS is set, in case the package
-dnl plays around with CXXFLAGS (such as to build both debugging and
-dnl normal versions of a library), tasteless as that idea is.
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=
- AC_PROG_CXX_G
- if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS="$ac_save_CXXFLAGS"
- elif test $ac_cv_prog_cxx_g = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-O2"
- fi
-else
- GXX=
- test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
-fi
-
-rtems_cv_prog_gxx=$ac_cv_prog_gxx
-rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g
-rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works
-rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross
-
-CXX=$rtems_save_CXX
-CXXFLAGS=$rtems_save_CXXFLAGS
-
-dnl restore initial values
-unset ac_cv_prog_gxx
-unset ac_cv_prog_cc_g
-unset ac_cv_prog_cxx_works
-unset ac_cv_prog_cxx_cross
-])
diff --git a/aclocal/sysv-ipc.m4 b/aclocal/sysv-ipc.m4
deleted file mode 100644
index 396dcffbb7..0000000000
--- a/aclocal/sysv-ipc.m4
+++ /dev/null
@@ -1,96 +0,0 @@
-dnl
-dnl $Id$
-dnl
-dnl Check for System V IPC calls used by Unix simulators
-dnl
-dnl 98/07/17 Dario Alcocer alcocer@netcom.com
-dnl Ralf Corsepius corsepiu@faw.uni-ulm.de
-dnl
-dnl Note: $host_os should probably *not* ever be used here to
-dnl determine if host supports System V IPC calls, since some
-dnl (e.g. FreeBSD 2.x) are configured by default to include only
-dnl a subset of the System V IPC calls. Therefore, to make sure
-dnl all of the required calls are found, test for each call explicitly.
-dnl
-dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally
-dnl modify any existing key sets. See the man pages for semget, shmget,
-dnl msgget, semctl, shmctl and msgctl for details.
-
-AC_DEFUN(RTEMS_SYSV_SEM,
-[AC_REQUIRE([RTEMS_PROG_CC])
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores,
-rtems_cv_sysv_sem,
-[
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-int main () {
-#if !defined(sun)
- union semun arg ;
-#else
- union semun {
- int val;
- struct semid_ds *buf;
- ushort *array;
- } arg;
-#endif
- int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
- if (id == -1)
- exit(1);
- arg.val = 0; /* avoid implicit type cast to union */
- if (semctl(id, 0, IPC_RMID, arg) == -1)
- exit(1);
- exit(0);
-}
-],
-rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :)
-])
-])
-
-AC_DEFUN(RTEMS_SYSV_SHM,
-[AC_REQUIRE([RTEMS_PROG_CC])
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory,
-rtems_cv_sysv_shm,
-[
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-int main () {
- int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
- if (id == -1)
- exit(1);
- if (shmctl(id, IPC_RMID, 0) == -1)
- exit(1);
- exit(0);
-}
-],
-rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :)
-])
-])
-
-AC_DEFUN(RTEMS_SYSV_MSG,
-[AC_REQUIRE([RTEMS_PROG_CC])
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages,
-rtems_cv_sysv_msg,
-[
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-int main () {
- int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
- if (id == -1)
- exit(1);
- if (msgctl(id, IPC_RMID, 0) == -1)
- exit(1);
- exit(0);
-}
-],
-rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :)
-])
-])
diff --git a/aclocal/tool-prefix.m4 b/aclocal/tool-prefix.m4
deleted file mode 100644
index d7fe6a9b38..0000000000
--- a/aclocal/tool-prefix.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-dnl
-dnl $Id$
-dnl
-dnl Set program_prefix
-dnl
-dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-dnl Extracted from configure
-
-AC_DEFUN(RTEMS_TOOL_PREFIX,
-[AC_REQUIRE([AC_CANONICAL_TARGET])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-
-if [[ "${program_prefix}" = "NONE" ]] ; then
- if [[ "${target}" = "${host}" ]] ; then
- program_prefix=
- else
- program_prefix=${target}-
- fi
-fi
-])
diff --git a/c/ACKNOWLEDGEMENTS b/c/ACKNOWLEDGEMENTS
deleted file mode 100644
index f179cf0f0a..0000000000
--- a/c/ACKNOWLEDGEMENTS
+++ /dev/null
@@ -1,149 +0,0 @@
-#
-# $Id$
-#
-
-RTEMS was developed by On-Line Applications Research (OAR) under
-contract to the U.S. Army Missile Command. Other than the
-contributions listed in this document, all code and documentation
-was developed by OAR for the Army.
-
-The RTEMS project would like to thank those who have made
-contributions to the project. Together we make RTEMS a
-much better product.
-
-The following persons/organizations have made contributions:
-
-+ Dr. Mikhail (Misha) Savitski (mikhail.savitski@styrex.se) of the EISCAT
- Scientific Association submitted the BSP and other miscellaneous support
- for the Motorola MVME162 (M68040LC CPU) VMEbus single board computer.
-
-+ Division Inc. of Chapel Hill, NC for sponsoring On-Line Applications
- Research to port RTEMS to the Hewlett-Packard PA-RISC architecture (V1.1)
- and the addition of HP-UX as a development host. Tony Bennett
- (tbennett@chapelhill.hp.com) was assisted in this effort by Joel Sherrill
- (joel@OARcorp.com). Tony also deserves a big pat on the back for
- contributing significantly to the overall organization of the development
- environment and directory structure. RTEMS is much easier to build
- because of Tony.
-
-+ Greg Allen of Division Inc. of Chapel Hill, NC for
- porting RTEMS to HP-UX. This port treats a UNIX computer as simply
- another RTEMS target processor. This port can be used to develop
- and test code which will ultimately run on the embedded platform.
-
-+ Doug McBride (mcbride@rodin.colorado.edu) of the Colorado Space Grant
- College at the University of Colorado at Boulder submitted the BSP
- for the Motorola IDP board (M68EC040 CPU) single board computer. The
- BSP leverages heavily off of the existing RTEMS BSP framework, the
- examples in the back of the IDP user's manual, and the libgloss example
- support for the IDP board from the newlib/libgloss distribution.
-
-+ David Glessner (dwg@glenqcy.glenayre.com) of Glenayre Electronics
- submitted the support for the Motorola MC68302 CPU. This included
- the "gen68302" BSP which uses the on-chip peripherals on the MC68302
- as well as the modifications to the m68k dependent executive code to
- support m68k family members based on the mc68000 core.
-
-+ Bryce Cogswell (cogswell@cs.uoregon.edu) submitted the support for MS-DOS
- as a development environment as well as djgpp/go32 as a target environment.
-
-+ Andy Bray (andy@chaos.org.uk) of I-CUBED Ltd. in Cambridge U.K.
- for porting RTEMS to the PowerPC. This effort included support for the
- IBM 403 as well as the Motorola 601, 603, and 604 variants. A special
- thanks to Dom Latter (dom@i-cubed.demon.co.uk) for being an RTEMS
- evangelist and promoting the use of RTEMS both at I-CUBED Ltd. as well
- as within the Internet community as a whole.
-
-+ John S. Gwynne (jsg@coulomb.eng.ohio-state.edu) of Ohio State University
- submitted the support for the Motorola MC68332 CPU as well as completing
- the support for CPUs based on the MC68000 core. This included the "efi68k"
- and "efi332" BSPs as well as completing the modifications to the m68k
- dependent executive code to support m68k family members based on the
- MC68000 core. "efi68k" and "efi332" are single board computers designed
- primarily for automotive electronic fuel injection (EFI) control, but can
- be considered general purpose controllers when used without the EFI
- companion board(s). See the README in each BSP for more information.
-
-+ The European Space Agency for sponsoring On-Line Applications Research
- to port RTEMS to the SPARC V7 architecture for use with their ERC32
- radiation-hardened CPU. Jiri Gaisler (jgais@wd.estec.esa.nl) deserves
- special thanks for championing this port within the ESA was well as
- for developing and supporting the SPARC Instruction Simulator used to
- develop and test this port.
-
-+ Eric Norum (eric@skatter.usask.ca) of the Saskatchewan Accelerator
- Laboratory submitted the support for the Motorola MC68360 CPU
- including the `gen68360' BSP.
-
-+ Dominique le Campion (Dominique.LECAMPION@enst-bretagne.fr), for
- Telecom Bretagne and T.N.I. (Brest, France) submitted the BSP for
- the Motorola MVME147 board (68030 CPU + 68881 FPU) and the MVME147s
- variant of this board.
-
-+ Craig Lebakken (lebakken@minn.net) and Derrick Ostertag
- (ostertag@transition.com) of Transition Networks of Eden Prairie, MN
- for porting RTEMS to the MIPS and AMD 29K architectures. This submission
- includes complete support for the R4650 as well as partial support
- for the R4600.
-
-+ Erik Ivanenko (ccms@utcc.utoronto.ca) of the University of Toronto
- for submitting the i386ex bsp.
-
-+ Jiri Gaisler (jgais@wd.estec.esa.nl) converted RTEMS to using GNU
- autoconf. This effort is greatly appreciated.
-
-+ Eric Norum (eric@skatter.usask.ca) of the Saskatchewan Accelerator
- Laboratory submitted a BSP for the m68360 when operating in companion
- mode with a m68040 and a port of the Motorola MC68040 Floating Point
- Support Package (FPSP) to RTEMS.
-
-+ Eric Norum (eric@skatter.usask.ca) of the Saskatchewan Accelerator
- Laboratory submitted a port of the KA9Q TCP/IP stack to RTEMS as
- well as a network device driver for the gen68360 BSP. To address
- performance issues and licensing concerns, Eric followed this up
- by replacing the KA9Q TCP/IP stack with a port of the FreeBSD stack.
-
-+ Chris Johns (cjohns@plessey.com.au) submitted the ods68302 BSP which
- offers easier configuration than its counterpart gen68302. Chris
- also submitted the RTEMS++ C++ class library and test code for
- that library.
-
-+ Katsutoshi Shibuya (shibuya@mxb.meshnet.or.jp) of BU-Denken Co., Ltd.
- (Sapporo, Japan) submitted the extended console driver for the
- MVME162LX BSP and the POSIX tcsetattr() and tcgetattr() routines.
- This device driver supports four serial ports, cooked IO, and
- provides a portable base for Zilog 8530 based console drivers.
-
-+ Eric Norum (eric@skatter.usask.ca) and Katsutoshi Shibuya
- (shibuya@mxb.meshnet.or.jp) jointly developed the termios support.
-
-+ Ralf Corsepius (corsepiu@faw.uni-ulm.de) of the Research Institute for
- Applied Knowledge Processing at the University of Ulm (FAW), Germany,
- for numerous enhancements to the RTEMS autoconf support as well as
- for the Hitachi SH port.
-
-+ Dario Alcocer <alcocer@connectnet.com> submitted a port of the
- RTEMS port to FreeBSD.
-
-+ David Fiddes <D.J.Fiddes@hw.ac.uk>, Rod Barman (rodb@ptgrey.com) and
- Stewart Kingdon (kingdon@ptgrey.com) submitted Motorola ColdFire
- support. This work was supported in part by Real World Interface, Inc.
-
-+ Geoffroy Montel (g_montel@yahoo.com), for CNET/DSM (Rennes, France),
- submitted the BSP for Motorola 68340/68349 based boards.
-
-+ Thomas Doerfler (td@imd.m.isar.de) of IMD in
- Puchheim,Germany submitted some improvements to the PPC403
- support and added the helas403 BSP.
-
-Finally, the RTEMS project would like to thank those who have contributed
-to the other free software efforts which RTEMS utilizes. The primary RTEMS
-development environment is from the Free Software Foundation (the GNU
-project). The "newlib" C library was put together by Cygnus and is
-a collaboration of the efforts of numerous individuals and organizations.
-
-We would like to see your name here. BSPs and ports are always welcome.
-Useful libraries which support RTEMS applications are also an important
-part of providing a strong foundation for the development of real-time
-embedded applications and are welcome as submission.
-
diff --git a/c/Makefile.in b/c/Makefile.in
deleted file mode 100644
index b1de42ce0f..0000000000
--- a/c/Makefile.in
+++ /dev/null
@@ -1,134 +0,0 @@
-#
-# $Id$
-#
-# top level directory for RTEMS build tree
-# This Makefile is *not* a good example of a directory Makefile.
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
-includedir = @includedir@
-target = @target@
-manext = 1
-mandir = @mandir@/man$(manext)
-program_prefix = @program_prefix@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=build-tools src
-
-# We only make the install point for the networking header files if needed.
-LIBNETWORKING_yes_V = lib/include/networking lib/include/networking/sys \
- lib/include/networking/machine lib/include/networking/rtems \
- lib/include/networking/vm lib/include/networking/net \
- lib/include/networking/netinet lib/include/networking/arpa \
- lib/include/networking/nfs
-LIBNETWORKING = $(LIBNETWORKING_$(HAS_NETWORKING)_V)
-
-# We only make the rtems++ install point if it is enabled.
-LIBRTEMSCPLUSPLUS_yes_V = lib/include/rtems++
-LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V)
-
-# directories to be created in install point
-CREATE_DIRS = \
- lib lib/include lib/include/sys lib/include/rtems \
- lib/include/rtems/score lib/include/rtems/rtems lib/include/rtems/posix \
- lib/include/libc lib/include/libc/sys \
- lib/include/motorola lib/include/zilog \
- lib/include/libchip \
- $(LIBNETWORKING) \
- $(LIBRTEMSCPLUSPLUS) \
- bin samples \
- tests tests/screens tests/screens/sptests \
- tests/screens/psxtests tests/screens/mptests \
- tests/screens/mptests/node1 tests/screens/mptests/node2 \
- build-tools update-tools
-
-# Make all/install must include 'env'
-# if something is added to TARGET_VARIANTS, then account for it here
-make_src_makefiles: Makefile.in Makefile
- -find . -name Makefile \
- -exec grep -l "^preinstall" {} \; > make_src_makefiles.tmp
- -grep tools make_src_makefiles.tmp > make_src_makefiles
- -grep -v tools make_src_makefiles.tmp >> make_src_makefiles
- -rm make_src_makefiles.tmp
-
-
-pre_install_src: env make_src_makefiles
- cd build-tools/scripts; $(MAKE)
- @echo "Order of preinstall directories"
- cat make_src_makefiles
- @echo
- CURRDIR=`pwd`; \
- for i in `cat make_src_makefiles` ; do \
- DIR=`dirname $$i`; \
- cd $$DIR; \
- $(MAKE) preinstall; \
- cd $$CURRDIR; \
- done
-all: pre_install_src env
-debug: pre_install_src env
-profile: pre_install_src env
-
-install: all install_files
-debug_install: env debug install_files
-profile_install: env profile install_files
-
-debug_all: debug
-profile_all: profile
-
-# top level clean/clobber will delete the install points
-clean_WRAPUP = $(MAKE) clean_wrapup
-clobber_WRAPUP = $(MAKE) clean_wrapup
-
-clean_wrapup: clean_tools clean_dirs clean_modules
-
-.PHONY: dirs clean_wrapup clean_dirs clean_tools clean_modules env install
-
-dirs:
- -$(MKDIR) ${CREATE_DIRS:%=$(PROJECT_ROOT)/$(RTEMS_BSP)/%}
- if test -d $(PROJECT_ROOT)/c/src/lib/libhwapi; then \
- (cd $(PROJECT_ROOT)/c/src/lib/libhwapi ; $(MAKE) mkdirs) \
- fi
-
-distclean: clobber
-
-clean_dirs:
- $(RM) -r $(PROJECT_RELEASE)
-
-clean_tools:
- cd build-tools; $(MAKE) clean
-
-$(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc: $(PROJECT_ROOT)/make/Templates/Makefile.inc
- echo "RTEMS_BSP = $(RTEMS_BSP)" > $@
- $(CAT) $< >> $@
-
-# NOTE: The wildcard on the install should pick up everything except
-# the tests directory. This significantly minimizes the install size.
-
-install_files: $(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc
- -$(MKDIR) $(prefix)/
- -$(MKDIR) $(prefix)/rtems
- -$(RM) -rf $(prefix)/rtems/$(RTEMS_BSP)
- cd ../; tar cf - $(RTEMS_BSP)/[bilsuM]* | \
- (cd $(prefix)/rtems; tar xpBf - )
- cd ../make; $(MAKE) RTEMS_BSP=$(RTEMS_BSP) install
-
-tests:
- cd src/tests; $(MAKE) all
-
-debug_tests: debug
- cd src/tests; $(MAKE) debug
-
-profile_tests: profile
- cd src/tests; $(MAKE) profile
-
-env: $(SRCS) dirs
diff --git a/c/PROBLEMS b/c/PROBLEMS
deleted file mode 100644
index 0b22675ac5..0000000000
--- a/c/PROBLEMS
+++ /dev/null
@@ -1,73 +0,0 @@
-#
-# $Id$
-#
-
-This is the list of outstanding problems in this release.
-
-+ AMD 29k port is based on a non-GNU toolset.
-
-+ The test spfatal is out of date and as a result will NOT execute
- correctly. The addition of POSIX and consequent ongoing initialization
- reorganization makes it pointless to fix this until the POSIX support
- is completely in place.
-
-+ The m68k family has become quite large and an understanding of the
- compatibility of the peripherals on the various members of the 683xx
- family would allow someone to designate some of the drivers submitted
- for the gen683xx BSPs as useful on other members.
-
-+ The only supported i960 family member is the CA. No support for the
- floating point support found in other family members is present.
- This also implies that RTEMS may "think" of something as generic
- across the i960 family when in fact it is specific to the CA.
- To make matters worse, the i960 target board owned by the RTEMS Project
- is now broken and as a result even the i960CA is a "compile only" port.
-
-+ Some of the BSPs still define RAM_START and RAM_END in the bsp.h file.
- It is better to define these in the linkcmds file. It is also nice
- to use the linkcmds file to place overlays for on-board hardware.
-
-+ Not all of the BSP console drivers have been converted to termios.
- Look at the m68k/gen68360, sparc/erc32, and powerpc/psim BSPs for
- examples.
-
-+ UNIX port notes:
-
- + sometimes a stray SIGALRM is reported as spfatal completes.
-
- + There are conflicts between the names of native library routines
- which MUST be used and those in the POSIX support. This must
- be addressed. The POSIX API cannot be used with this port as a
- result of this.
-
- + Someone suggested writing a mini-system call interface to
- include with RTEMS which would eliminate name conflicts. This
- would allow the RTEMS POSIX API to be tested in this configuration.
-
-+ Some of the tests may execute correctly and not produce the exact
- ordering of lines in the screen file. This appears to be a combination
- of a number of factors including buffering, processor speed, IO
- device overhead, and clock interrupt rate. The biggest problem is that
- some tests depend on polled IO with no unexpected context switches.
- These may not be resolvable while maintaining the spirit of the test.
-
-+ The clock device drivers should really avoid doing the division
- by 1000 in the clock tick ISR to convert microseconds into
- milliseconds. This only applies to clock drivers which generate
- an ISR each millisecond and only call rtems_clock_tick every
- so many ISRs.
-
-+ Cross-check configure --enable-* flags.
- + warn/refuse to configure when --enable-libcdir and
- --enable-gcc28 are given.
- + force --enable-libcdir when --disable-gcc28 is given
-
-+ make profile does not currently work for a variety of reasons. Few
- BSPs include profile versions of the libraries in their bsp_specs
- file. There is no mechanism to sample data for gperf to process.
- All of this will need to be addressed before "make profile" is truly
- useful.
-
-+ Bare BSP does not compile for all configurations yet. This is
- primarily due to libcpu support code assuming that the BSP has
- made something available which is not with a bare BSP.
diff --git a/c/README b/c/README
deleted file mode 100644
index e1ca9df591..0000000000
--- a/c/README
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# $Id$
-#
-
-This is the top level of the RTEMS directory structure. The following
-is a description of the files and directories in this directory:
-
- Makefile.in
- The top-level Make command file used to build the C implementation
- of RTEMS. [RTEMS assumes the use of GNU make.]
-
- README
- This file.
-
- REQUIRES
- A list of the other tools which are assumed to be installed
- before RTEMS is built.
-
- SUPPORT
- Information on third-party support for RTEMS.
-
- build-tools
- This directory contains the source for various utilities
- needed to build RTEMS.
-
- make
- Make command files "included" from those in the source distribution.
- [RTEMS assumes the use of GNU make.]
-
- patches
- This directory contains patches for this release of RTEMS.
-
- src
- This directory contains the source code for the C
- implementation of RTEMS as well as the test suites, sample
- applications, Board Support Packages, Device Drivers, and
- support libraries.
diff --git a/c/README.DOS b/c/README.DOS
deleted file mode 100644
index 5219479910..0000000000
--- a/c/README.DOS
+++ /dev/null
@@ -1,72 +0,0 @@
-#
-# $Id$
-#
-
-tools
------
-The RTEMS build procedure was designed with the capabilitiies of a
-typical UNIX computer in mind. Making this procedure work under MS-DOS
-is not that difficult but requires that MS-DOS versions of a number
-of UNIX utilities be acquired and installed. For time being, the
-best advice which can be offered is:
-
- "This is a nasty question, since when I first set up the DOS machine
- (long before I acquired RTEMS) I ftp'd a bunch of different tool
- sets (all from SimTel), and then picked individual tools from each
- set that worked best for me. The djgpp tools are probably a good
- starting point, especially to get a working sed. Next the gnu tools
- in SimTel/msdos/gnuish, and then others. Sorry I can't give you more
- specific names. The only real requirement for the tools is that
- they *must* accept redirection of command line arguments from a file
- using the '@' notation (i.e., "mkdir @/tmp/args" reads the argument
- list from file /tmp/args)."
-
-There is a special version (source and executable) of GNU make 3.71 for
-MS-DOS which minimizes the amount of memory used by recursive makes
-available on lancelot.gcs.redstone.army.mil in the file:
-
-/pub/msdos/gmake371.tgz
-
-Many of the RTEMS specific utilities used in the build and installation
-are UNIX shell scripts. On a UNIX host, these are normally interpreted
-by the Bourne Again Shell (BASH) or the Korn Shell (ksh). Most of these
-scripts can be successfully executed with the following shell from the
-MS-DOS archives from Simtel.
-
-SimTel/msdos/sysutil/ms_sh23b.zip
-
-Please be sure to use the 16-bit version. The Simtel archives are
-available from ftp.cdrom.com as well as a number of mirror sites.
-
-go32
-----
-go32 dumps the stack when a program seg-faults, and if this happens while
-on an alternate stack an infinite loop can ensue. Setting the environment
-variable GO32="core /tmp/core" will prevent more than 20 lines or
-so of stack information from being dumped after a crash, and the output
-will go to a file rather than the screen.
-
-The go32 debuggers get confused by the relocated stacks used by tasks,
-and tend to crash when variables are inspected.
-
-djgcc include files
--------------------
-In general, we use RTEMS include files because these contain the proper
-declarations for the libc, and in particular, the stdio functions.
-When calling go32-specific functions it is necessary to include some
-djgpp include files, as well. Unfortunately, there are some disagreements
-between RTEMS and djgpp as to how certain functions and types are
-declared. In these cases, the RTEMS source have been modified to
-special-case the differences.
-
-other
------
-* Pressing F12 will immediately abort the program.
-See lib/libbsp/i386/go32/console/inch.c.
-
-* lib/libbsp/i386/go32/timer uses the on-board timer chip by default,
-which has a resolution of about 1 microsecond. However, if executing
-on a Pentium processor you can use the on-chip 64-bit cycle counter,
-which counts at whatever clock rate your processor runs at. To enable
-this, set RTEMS_CPU_MODEL=pentium in make/custom/go32.cfg.
-
diff --git a/c/REQUIRES b/c/REQUIRES
deleted file mode 100644
index dd0085aa45..0000000000
--- a/c/REQUIRES
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-
-1. The installation procedure assumes that "gcc" is installed
- and is in your path for the installation of local tools.
-
-2. gcc 2.7.2 with crossgcc patches (ftp.cygnus.com:/pub/embedded/crossgcc)
-
-3. binutils 2.6 with crossgcc patches.
-
-4. newlib with RTEMS configurations.
-
diff --git a/c/TESTED b/c/TESTED
deleted file mode 100644
index b29b8cb87c..0000000000
--- a/c/TESTED
+++ /dev/null
@@ -1,74 +0,0 @@
-#
-# $Id$
-#
-
-This file is current for the 4.0.0 release.
-
-The RTEMS project uses Intel x86 based computers running the RedHat
-distribution of the Linux operating system internally for development.
-This release has been tested on the following Languages/CPUs/Targets using
-RedHat Linux 4.2 as the host environment:
-
- CPU CPU
- FAMILY MODEL TARGET SUITES
- ======== ========= ======================= ===============
- m68k m68000 efi68k (note 1)
- m68k m68020 Motorola MVME136 (note 1, 6)
- m68k m68030 Motorola MVME147 (note 1)
- m68k m68030 Motorola MVME147s (note 1)
- m68k m68lc040 Motorola MVME162 (note 1)
- m68k m68lc040 Motorola MVME162LX (note 1)
- m68k m68ec040 Motorola IDP (note 1)
- m68k m68020 DY-4 DMV152 (note 1)
- m68k m68302 generic 68302 (note 1)
- m68k m68302 ods 68302 (note 1)
- m68k m68332 efi332 (note 1)
- m68k m68360 generic 68360 (note 1, 6)
- m68k m68360 68360 in companion mode (note 1, 6)
- i386 i386_fp Force CPU-386 (note 1, 7)
- i386 i386ex generic i386ex (note 1, 6)
- i386 ix86 bare PC (pc386) (note 1, 6)
- i386 i486 DJGPP/PC-AT (note 7)
- i386 pentium DJGPP/PC-AT (note 7)
- i960 i960ca Cyclone CVME961 (note 4)
- hppa hppa7100 simhppa (note 1)
- mips idt4600 p4000 (note 1)
- mips idt4650 p4000 (note 1)
- powerpc ppc403 helas403 (note 1, 6)
- powerpc ppc403 Papyrus (note 1)
- powerpc ppc403 psim (note 5)
- sh sh7032 generic sh1 (note 1)
- sparc erc32 generic erc32 ALL TESTS (note 5)
- a29k a29k port sw (note 2)
- UNIX NA Solaris 2 (SPARC) (note 2)
- UNIX NA Solaris 2 (SPARC) (note 2)
- UNIX NA Linux (i386) ALL TESTS (inlines)
- UNIX NA Linux (i386) ALL TESTS (macros)
- UNIX NA HPUX (PA-RISC) (note 2)
- no_cpu NA no_bsp (note 3)
-
-NOTES:
-
-"NOT TESTED" indicates that this was not tested in the testing cycle
-immediately preceding the snapshot.
-
-(1) Target board is not owned by RTEMS Project. The target is known
- to compile and link with all appropriate tests successfully.
- If the target does not support multiprocessor configurations, then
- "ALL TESTS" does not include the multiprocessor tests.
-
-(2) RTEMS Project cannot internally compile or test this target.
- As of 4.0.0, the HP-UX is not recognized in the configure script
- The a29k does not use GNU tools and may suffer from bit rot.
-
-(3) Target is not intended to be executed. It is only an example.
-
-(4) The board owned by the RTEMS Project is broken. The BSP is known
- to compile and link with all appropriate tests successfully.
-
-(5) This BSP is tested on a CPU software simulator.
-
-(6) This BSP was tested by an RTEMS volunteer and reported to work.
-
-(7) The BSP is deprecated. For information on what would be
- required to update it contact rtems@OARcorp.com.
diff --git a/c/UPDATE_HELP b/c/UPDATE_HELP
deleted file mode 100644
index 520d99aafc..0000000000
--- a/c/UPDATE_HELP
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-
-Between RTEMS 3.1.0 and 3.2.0, every RTEMS defined symbol made visible
-was renamed. This document describes the change and the tools provided
-to assist you in updating your RTEMS 3.1.0 application.
-
-[NOTE: This change was not included in snapshots prior to 3.1.15.]
-
-DESCRIPTION OF NAME CHANGES:
-============================
-
-The primary change was the addition of the prefix "rtems_" or "RTEMS_" to
-EVERY user visible RTEMS provided constant and routine. The primary
-factor in the decision to make such a sweeping change was conflicts
-between the the RTEMS and POSIX API's.
-
-
-TO UPDATE YOUR APPLICATION:
-===========================
-
-The update script requires that Perl be installed on your computer.
-It has only been tested with Perl 5.x.
-
-After RTEMS has been built, in the directory "$r/<BSP>/update_tools", will
-be a set of tools to aid in making the application source changes necessary
-to address (hopefully) all of the name changes in the RTEMS API between
-releases 3.1.0 and 3.2.0.
-
-The update shell script is the only executable which is invoked by the
-user directly. The word-replace Perl script is invoked by the update
-shell script.
-
-WARNING: These tools modify the files IN PLACE!!! Backup your
- source before using these tools.
-
-To udpate your application, change directories to the top of your application
-source tree and execute the update script. It should be something similar
-to the following:
-
-cd MY_APP
-$r/<BSP>/update-tools/update
-
-The update script will ask if you have backed up your source code before
-beginning the update process. While operating on files, it will print
-the name of each file and a dot for each change made to the source file.
-
-NOTE: These scripts do not attempt to address changes in calling
- sequences. After the script has run, you will need to update
- calls to rtems_clock_get(), rtems_timer_fire_after(), and
- rtems_timer_fire_when() by hand.
diff --git a/c/build-tools/Makefile.in b/c/build-tools/Makefile.in
deleted file mode 100644
index ad819e8214..0000000000
--- a/c/build-tools/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=os scripts src
diff --git a/c/build-tools/README b/c/build-tools/README
deleted file mode 100644
index 0738a5830e..0000000000
--- a/c/build-tools/README
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# $Id$
-#
-
-Misc. support tools for RTEMS workspaces.
-More will be added later as they are converted from Teamware
-to CVS.
-
-install-if-change
- Smart install script that also can append suffixes as it
- installs (suffixes used for debug and profile variants).
- Requires bash or ksh.
-
-rcs-clean
- deletes all files from the current directory that can be
- re-created from RCS. Careful to not delete locked files.
- May be used by 'gmake clobber'
-
-lock-directory
-unlock-directory
- traverse a directory structure making it unwritable.
- Useful to keep people from accidentally overwriting
- "released" trees if they get confused about which
- module they have loaded.
diff --git a/c/build-tools/cklength.c b/c/build-tools/cklength.c
deleted file mode 100644
index 624bf25e70..0000000000
--- a/c/build-tools/cklength.c
+++ /dev/null
@@ -1,377 +0,0 @@
-/*
- * cklength - check the length of lines in a file
- *
- * This program check to see if the files passed to it on the command line
- * contain a line which exceeds the maximum allowable length. The default
- * maximum line length is 80.
- *
- * usage: cklength [ -v ] [ arg ... ] files...
- * -l length -- maximum line length
- * -v -- verbose
- *
- * $Id$
- */
-
-#define GETOPTARGS "l:nNv"
-
-char *USAGE = "\
-usage: cklength [ -v ] [ arg ... ] files... \n\
- -l length -- maximum line length\n\
- -n -- report line numbers for offending lines\n\
- -N -- report line numbers and length for offending lines\n\
- -v -- verbose\n\
-\n\
-Print the name of files which have at least 1 line which exceeds the\n\
-maximum line length. The default maximum line length is 80.\n\
-";
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <memory.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-
-#define BUFFER_SIZE 512
-
-#define SUCCESS 0
-#define FAILURE -1
-#define Failed(x) (((int) (x)) == FAILURE)
-#define TRUE 1
-#define FALSE 0
-#define STREQ(a,b) (strcmp(a,b) == 0)
-#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
-
-/*
- * Definitions for unsigned "ints"; especially for use in data structures
- * that will be shared among (potentially) different cpu's (we punt on
- * byte ordering problems tho)
- */
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned long u32;
-
-/*
- * vars controlled by command line options
- */
-
-int verbose = FALSE; /* be verbose */
-int report_line_numbers = FALSE; /* report line numbers of offenders */
-int report_line_length = FALSE; /* report line length of offenders */
-
-int line_length = 80; /* maximum allowable line length */
-
-extern char *optarg; /* getopt(3) control vars */
-extern int optind, opterr;
-
-char *progname; /* for error() */
-
-int process(char *arg);
-void error(int errn, ...);
-long getparm(char *s, long min, long max, char *msg);
-
-#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define ERR_FATAL (ERR_ERRNO / 2) /* fatal error ; no return */
-#define ERR_ABORT (ERR_ERRNO / 4) /* fatal error ; abort */
-#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
-
-#define stol(p) strtol(p, (char **) NULL, 0)
-int Open(), Read(), Write();
-
-int main(
- int argc,
- char **argv
-)
-{
- register int c;
- int showusage = FALSE; /* usage error? */
- int rc = 0;
-
- /*
- * figure out invocation leaf-name
- */
-
- if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
- progname = argv[0];
- else
- progname++;
-
- argv[0] = progname; /* for getopt err reporting */
-
- /*
- * Check options and arguments.
- */
-
- opterr = 0; /* we'll report all errors */
- while ((c = getopt(argc, argv, GETOPTARGS)) != EOF)
- switch (c)
- {
- case 'l': /* line length */
- line_length = atoi( optarg );
- if ( line_length < 0 || line_length > BUFFER_SIZE )
- error(ERR_FATAL, "(%d) is illegal line length\n",line_length);
- break;
-
- case 'n': /* toggle report_line_numbers */
- report_line_numbers = ! report_line_numbers;
- break;
-
- case 'N': /* toggle both reports */
- report_line_numbers = ! report_line_numbers;
- report_line_length = ! report_line_length;
- break;
-
- case 'v': /* toggle verbose */
- verbose = ! verbose;
- break;
-
- case '?':
- showusage = TRUE;
- }
-
- if (showusage)
- {
- (void) fprintf(stderr, "%s", USAGE);
- exit(1);
- }
-
- /*
- * traverse and process the arguments
- */
-
- for ( ; argv[optind]; optind++)
- if (Failed(process(argv[optind])))
- rc = FAILURE;
-
- return rc;
-}
-
-
-/*
- * process(arg)
- */
-
-int
-process(char *arg)
-{
- FILE *in;
- char *bptr;
- char buffer[ BUFFER_SIZE ];
- int line_number;
- int length;
- int count;
- int rc = SUCCESS; /* succeed by default */
-
- in = fopen( arg, "r" );
- if (!in)
- error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
-
- count = 0;
-
- for ( line_number=1 ; ; line_number++ ) {
- bptr = fgets( buffer, BUFFER_SIZE, in );
- if (!bptr)
- break;
-
- /*
- * Don't count the carriage return.
- */
-
- length = strlen( buffer ) - 1;
-
- if ( length <= line_length )
- continue;
-
- if ( count == 0 ) {
- fprintf( stderr, "%s\n", arg );
- if ( !report_line_numbers )
- break;
- }
-
- if ( verbose )
- fprintf( stderr, "TOO LONG:%d: %s\n", line_number, buffer );
-
- if ( report_line_numbers ) {
- if ( report_line_length )
- fprintf( stderr, "%d: %d\n" , line_number, length );
- else
- fprintf( stderr, "%d\n" , line_number );
- }
-
- count++;
-
- }
-
- fclose( in );
- return rc;
-}
-
-/*
- * error(errn, arglist)
- * report an error to stderr using printf(3) conventions.
- * Any output is preceded by '<progname>: '
- *
- * Uses ERR_FATAL bit to request exit(errn)
- * ERR_ABORT to request abort()
- * ERR_ERRNO to indicate use of errno instead of argument.
- *
- * If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
- * associated error message is appended to the output.
- */
-
-/*VARARGS*/
-
-void
-error(int error_flag, ...)
-{
- va_list arglist;
- register char *format;
- int local_errno;
-
- extern int errno;
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- local_errno = error_flag & ~ERR_MASK;
- if (error_flag & ERR_ERRNO) /* use errno? */
- local_errno = errno;
-
- va_start(arglist, error_flag);
- format = va_arg(arglist, char *);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, format, arglist);
- va_end(arglist);
-
- if (local_errno)
- (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
-
- (void) fflush(stderr);
-
- if (error_flag & (ERR_FATAL | ERR_ABORT))
- {
- if (error_flag & ERR_FATAL)
- {
- error(0, "fatal error, exiting");
- exit(local_errno ? local_errno : 1);
- }
- else
- {
- error(0, "fatal error, aborting");
- abort();
- }
- }
-}
-
-long
-getparm(char *s,
- long min,
- long max,
- char *msg)
-{
- long val;
-
- if ( ! strchr("0123456789-", *s))
- {
- error(ERR_FATAL, "'%s' is not a number", s);
- return min;
- }
-
- val = strtol(s, (char **) NULL, 0);
- if ((val < min) || (val > max))
- {
- if (min == max)
- error(ERR_FATAL, "%s can only be %ld", s, min);
- else
- error(ERR_FATAL, "%s must be between %ld and %ld", msg, min, max);
- }
-
- return val;
-}
-
-
-/*
- * Open()
- * Perform open(2), returning the file descriptor. Prints
- * error message if open fails.
- */
-
-int
-Open(char *file,
- int oflag,
- int mode)
-{
- int O_fd;
-
- if (Failed(O_fd = open(file, oflag, mode)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "open('%s', 0x%x, 0%o) failed", file, oflag, mode
- );
-
- return O_fd;
-}
-
-/*
- * Read()
- * Perform read(2); prints error message if fails.
- */
-
-int
-Read(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = read(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "read(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
-
-/*
- * Write()
- * Perform write(2); prints error message if fails.
- */
-
-int
-Write(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = write(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "write(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
diff --git a/c/build-tools/eolstrip.c b/c/build-tools/eolstrip.c
deleted file mode 100644
index c944ae6663..0000000000
--- a/c/build-tools/eolstrip.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * eolstrip - strip white space from end of lines
- *
- * This program strips the white space from the end of every line in the
- * specified program.
- *
- * usage: eolstrip [ -v ] [ arg ... ] files...
- * -v -- verbose
- *
- * $Id$
- */
-
-#define GETOPTARGS "vt"
-
-char *USAGE = "\
-usage: cklength [ -v ] [ arg ... ] files... \n\
- -v -- verbose\n\
- -t -- test only .. DO NOT OVERWRITE FILE!!!\n\
-\n\
-Strip the white space from the end of every line on the list of files.\n\
-";
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <memory.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-
-#define BUFFER_SIZE 2048
-#define MAX_PATH 2048
-
-#define SUCCESS 0
-#define FAILURE -1
-#define Failed(x) (((int) (x)) == FAILURE)
-#define TRUE 1
-#define FALSE 0
-#define STREQ(a,b) (strcmp(a,b) == 0)
-#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
-
-/*
- * Definitions for unsigned "ints"; especially for use in data structures
- * that will be shared among (potentially) different cpu's (we punt on
- * byte ordering problems tho)
- */
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned long u32;
-
-/*
- * vars controlled by command line options
- */
-
-int verbose = FALSE; /* be verbose */
-int test_only = FALSE; /* test only */
-
-extern char *optarg; /* getopt(3) control vars */
-extern int optind, opterr;
-
-char *progname; /* for error() */
-
-int process(char *arg);
-void error(int errn, ...);
-long getparm(char *s, long min, long max, char *msg);
-
-#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define ERR_FATAL (ERR_ERRNO / 2) /* fatal error ; no return */
-#define ERR_ABORT (ERR_ERRNO / 4) /* fatal error ; abort */
-#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
-
-#define stol(p) strtol(p, (char **) NULL, 0)
-int Open(), Read(), Write();
-
-int main(
- int argc,
- char **argv
-)
-{
- register int c;
- int showusage = FALSE; /* usage error? */
- int rc = 0;
-
- /*
- * figure out invocation leaf-name
- */
-
- if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
- progname = argv[0];
- else
- progname++;
-
- argv[0] = progname; /* for getopt err reporting */
-
- /*
- * Check options and arguments.
- */
-
- opterr = 0; /* we'll report all errors */
- while ((c = getopt(argc, argv, GETOPTARGS)) != EOF)
- switch (c)
- {
- case 't': /* toggle test only mode */
- test_only = ! test_only;
- break;
-
- case 'v': /* toggle verbose */
- verbose = ! verbose;
- break;
-
- case '?':
- showusage = TRUE;
- }
-
- if (showusage)
- {
- (void) fprintf(stderr, "%s", USAGE);
- exit(1);
- }
-
- /*
- * traverse and process the arguments
- */
-
- for ( ; argv[optind]; optind++)
- if (Failed(process(argv[optind])))
- rc = FAILURE;
-
- return rc;
-}
-
-
-/*
- * process(arg)
- */
-
-int
-process(char *arg)
-{
- FILE *in;
- FILE *out = (FILE *) 0;
- char outname[ MAX_PATH ];
- char *bptr;
- char buffer[ BUFFER_SIZE ];
- int length;
- int line_number;
- int rc = SUCCESS; /* succeed by default */
-
- in = fopen( arg, "r" );
- if (!in)
- error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
-
- if ( !test_only ) {
- sprintf( outname, "%s.eoltmp", arg );
-
- out = fopen( outname, "w" );
- if (!out)
- error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
- }
-
- if ( verbose )
- fprintf( stderr, "Processing %s\n", arg );
-
- for ( line_number=1 ; ; line_number++ ) {
- bptr = fgets( buffer, BUFFER_SIZE, in );
- if (!bptr)
- break;
-
- /*
- * Don't count the carriage return.
- */
-
- length = strlen( buffer ) - 1;
-
- if ( buffer[ length ] != '\n' )
- error(ERR_ERRNO|ERR_FATAL, "Line %d too long in %s\n", line_number, arg);
-
- while ( isspace( (int) buffer[ length ] ) )
- buffer[ length-- ] = '\0';
-
- if ( test_only ) {
- fprintf( stderr, "%s\n", arg );
- break;
- }
-
- fprintf( out, "%s\n", buffer );
- }
-
- fclose( in );
- if ( !test_only ) {
- fclose( out );
- rename( outname, arg );
- }
- return rc;
-}
-
-/*
- * error(errn, arglist)
- * report an error to stderr using printf(3) conventions.
- * Any output is preceded by '<progname>: '
- *
- * Uses ERR_FATAL bit to request exit(errn)
- * ERR_ABORT to request abort()
- * ERR_ERRNO to indicate use of errno instead of argument.
- *
- * If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
- * associated error message is appended to the output.
- */
-
-/*VARARGS*/
-
-void
-error(int error_flag, ...)
-{
- va_list arglist;
- register char *format;
- int local_errno;
-
- extern int errno;
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- local_errno = error_flag & ~ERR_MASK;
- if (error_flag & ERR_ERRNO) /* use errno? */
- local_errno = errno;
-
- va_start(arglist, error_flag);
- format = va_arg(arglist, char *);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, format, arglist);
- va_end(arglist);
-
- if (local_errno)
- (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
- else
- (void) fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (ERR_FATAL | ERR_ABORT))
- {
- if (error_flag & ERR_FATAL)
- {
- error(0, "fatal error, exiting");
- exit(local_errno ? local_errno : 1);
- }
- else
- {
- error(0, "fatal error, aborting");
- abort();
- }
- }
-}
-
-long
-getparm(char *s,
- long min,
- long max,
- char *msg)
-{
- long val;
-
- if ( ! strchr("0123456789-", *s))
- {
- error(ERR_FATAL, "'%s' is not a number", s);
- return min;
- }
-
- val = strtol(s, (char **) NULL, 0);
- if ((val < min) || (val > max))
- {
- if (min == max)
- error(ERR_FATAL, "%s can only be %ld", s, min);
- else
- error(ERR_FATAL, "%s must be between %ld and %ld", msg, min, max);
- }
-
- return val;
-}
-
-
-/*
- * Open()
- * Perform open(2), returning the file descriptor. Prints
- * error message if open fails.
- */
-
-int
-Open(char *file,
- int oflag,
- int mode)
-{
- int O_fd;
-
- if (Failed(O_fd = open(file, oflag, mode)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "open('%s', 0x%x, 0%o) failed", file, oflag, mode
- );
-
- return O_fd;
-}
-
-/*
- * Read()
- * Perform read(2); prints error message if fails.
- */
-
-int
-Read(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = read(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "read(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
-
-/*
- * Write()
- * Perform write(2); prints error message if fails.
- */
-
-int
-Write(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = write(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "write(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
diff --git a/c/build-tools/install-if-change.in b/c/build-tools/install-if-change.in
deleted file mode 100644
index b2f3cb04bb..0000000000
--- a/c/build-tools/install-if-change.in
+++ /dev/null
@@ -1,142 +0,0 @@
-#!@KSH@ -p
-#
-# Either bash or ksh will be ok for this; requires (( )) arithmetic
-# (-p above just says to not parse $ENV file; makes it faster for
-# those of us who set $ENV)
-#
-# install files if they have changed by running 'cmp', then 'install'
-# as necessary.
-#
-# Optionally, can append a suffix before last existing suffix (if any)
-#
-# NOTE
-# We avoid using typical install(1M) programs since they have
-# large variability across systems and we also need to support ou
-# -V option.
-# So we just copy and chmod by hand.
-#
-# $Id$
-#
-
-progname=`basename $0`
-#progname=${0##*/} # fast basename hack for ksh, bash
-
-USAGE=\
-"usage: $progname [ -vmV ] file [ file ... ] dest-directory-or-file
- -v -- verbose
- -V suffix -- suffix to append to targets (before any . suffix)
- eg: -V _g would change 'foo' to 'foo_g' and
- 'libfoo.a' to 'libfoo_g.a'
- -m mode -- mode for new file(s)"
-
-fatal() {
- if [ "$1" ]
- then
- echo $* >&2
- fi
- echo "$USAGE" 1>&2
- exit 1
-}
-
-#
-# process the options
-#
-
-verbose=""
-suffix=""
-mode=""
-
-while getopts vm:V: OPT
-do
- case "$OPT" in
- v)
- verbose="yes";;
- V)
- eval suffix=$OPTARG;;
- m)
- mode="$OPTARG";;
- *)
- fatal
- esac
-done
-
-shiftcount=`expr $OPTIND - 1`
-shift $shiftcount
-
-args=$*
-
-#
-# Separate source file(s) from dest directory or file
-#
-
-files=""
-dest=""
-for d in $args
-do
- files="$files $dest"
- dest=$d
-done
-
-if [ ! "$files" ] || [ ! "$dest" ]
-then
- fatal "missing files or invalid destination"
-fi
-
-#
-# Process the arguments
-#
-
-targets=""
-for f in $files
-do
- # leaf=`basename $f`
- leaf=${f##*/} # fast basename hack for ksh, bash
-
- target=$dest
- if [ -d $dest ]
- then
- # if we were given a suffix, then add it as appropriate
- if [ "$suffix" ]
- then
- case $f in
- *.*)
- # leaf=`echo $leaf |
- # /bin/sed "s/\([~\.]*\)\.\(.*\)$/\1$suffix.\2/"`
- # ksh,bash hack for above sed script
- leaf=${leaf%%.*}$suffix.${leaf#*.}
-
- [ "$verbose" = "yes" ] &&
- echo "$progname: $f will be installed as $leaf"
- ;;
- *)
- leaf=$leaf$suffix;;
- esac
- fi
- target=$target/$leaf
- fi
-
- [ ! -r $f ] && fatal "can not read $f"
-
- if cmp -s $f $target
- then
- [ "$verbose" = "yes" ] && echo "'$f' not newer than '$target'"
- else
- [ "$verbose" = "yes" ] && echo "rm -f $target"
- rm -f $target
- echo "cp -p $f $target"
- cp -p $f $target || exit 1
- targets="$targets $target" # keep list for chmod below
- fi
-done
-
-if [ "$mode" -a "$targets" ]
-then
- [ "$verbose" = "yes" ] && echo "chmod $mode $targets"
- chmod $mode $targets
-fi
-
-exit 0
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
diff --git a/c/build-tools/lock-directory.in b/c/build-tools/lock-directory.in
deleted file mode 100644
index 1c205cdec0..0000000000
--- a/c/build-tools/lock-directory.in
+++ /dev/null
@@ -1,43 +0,0 @@
-#!@KSH@
-#
-# $Id$
-#
-# Make a directory write protected
-# Used to write protect the install point after a build
-# to prevent inadvertant overwriting.
-#
-
-# is a particular command available on this machine?
-#
-cmd_avail()
-{
- set -- `type $1 2>&1`
- if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ]
- then
- return 1
- else
- return 0
- fi
-}
-
-lock_directory() {
- l_dir=$1/. # get any symlink out of the way using '.'
- if [ -d $l_dir ]
- then
- find $l_dir -type d -perm -0200 -print | $XARGS chmod -w
- fi
-}
-
-# Use gnu xargs if available; faster, more reliable in general
-XARGS=xargs
-cmd_avail gxargs && XARGS=gxargs
-
-for dir
-do
- lock_directory $dir
-done
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
-
diff --git a/c/build-tools/os/Makefile.in b/c/build-tools/os/Makefile.in
deleted file mode 100644
index d540e58fa0..0000000000
--- a/c/build-tools/os/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=$(wildcard $(RTEMS_HOST))
diff --git a/c/build-tools/os/msdos/Makefile.in b/c/build-tools/os/msdos/Makefile.in
deleted file mode 100644
index 23a840d33a..0000000000
--- a/c/build-tools/os/msdos/Makefile.in
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-DESTDIR=$(PROJECT_RELEASE)/build-tools
-
-INSTALLED=$(DESTDIR)/ifc.exe \
- $(DESTDIR)/cklength.exe \
- $(DESTDIR)/fixtimer.exe
-
-all: $(DESTDIR) $(PGMS) install
-
-$(DESTDIR):
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-install: $(INSTALLED)
-
-# Install the programs
-$(DESTDIR)/ifc.exe: ifc_exe.uue
- uudecode <ifc_exe.uue
- mv ifc.exe $(DESTDIR)/ifc.exe
-
-$(DESTDIR)/cklength.exe: cklength.uue
- uudecode <cklength.uue
- mv cklength.exe $(DESTDIR)/cklength.exe
-
-$(DESTDIR)/fixtimer.exe: fixtimer.uue
- uudecode <fixtimer.uue
- mv fixtimer.exe $(DESTDIR)/fixtimer.exe
-
diff --git a/c/build-tools/os/msdos/README b/c/build-tools/os/msdos/README
deleted file mode 100644
index af3b0dfb31..0000000000
--- a/c/build-tools/os/msdos/README
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# $Id$
-#
-
-ifc is an MS-DOS executable which is equivalent to the program
-install-if-change. It was compiled using Borland C 2.00.
-
-cklength is a precompiled version of the program cklength.c from
-the main source tree.
-
-fixtimer is a program to restore the clock if the program does not
-exit cleanly.
diff --git a/c/build-tools/os/msdos/cklength.uue b/c/build-tools/os/msdos/cklength.uue
deleted file mode 100644
index fd8052cd9a..0000000000
--- a/c/build-tools/os/msdos/cklength.uue
+++ /dev/null
@@ -1,286 +0,0 @@
-#
-# $Id$
-#
-begin 664 cklength
-M?T5,1@$" 0 " ( ! $,% #0 "T8 T "
-M!0 H !H %P 8 T $ - "@ H 4 P
-M -0 !$ ! ! ! 7
-M2P %TL % $ $ !=, (73 &\ %? < 0
-M @ %U A=0 (@ !P O=7-R+VQI8B]L9"YS
-M;RXQ $, !6 20 #P
-M #@ $4 /0 !P !# &@
-M A 30 #\ *0 $X !" D
-M $@ W $8 )@ "
-M ! %( 4P Z *@ 00
-M $H 'P $L !5 3P L .P %0 H
-M-@ #$ P 40
-M
-M
-M G
-M '0 C ; N
-M "( -0 E #D R - !X
-M "T ,P !$ *P
-M ^ "\ 3 % !'
-M 0#4 , $ $ Z # "
-M ! U0 P P 0BT , 0 $*W #
-M % !"S P !@ 0P4 , < $32
-M # ( !$^ P "0 1/L , H $3
-M] # + !% P # A=, , T
-M (74 # . "%]@ P #P ACP , !
-M (9" # 1 P $@ ,
-M !, # 4 P %0
-M , !8 # 7 P &
-M , !D ! (8. 2 " !$_0 $0 "P !8
-M 0P4 =!( < = (8U 2 (@ "&$0 $@
-M "< 1/L !$ H U (8O 2 / "&0@ $$0
-M$0 $4 AB8 !( !. (9# 01 1 5P "',@
-M$0#_\0 %P 1+ 2!( < !B $2> $@2 ' 9P !$8@
-M "H$@ !P &\ AD8 !0"$ !$ !T (73 1 /_Q B@ "
-M&*0 $@ ) A@( !( "7 (8% 2
-MG !$T@ $@ " *( ACT !!$ ! "J (9$ 01 1
-M M "&E@ )@$0 $0 , AB !( #' (8\ 01
-M 0 S0 "%U $0#_\0 -8 0[H !0!( < #> (9&
-M 4 1 1 Y "&E@ )@$0 $0 /$ AC@ !( #W (8
-M+ 2 _P "&" $@ 04 AD, !"$ !$ $-
-M (<N 01 1 !$P "&+ $@ 1H 1 H !8!( <
-M $@ (8_ 01 0 !,P "'+P $$0 $0 3H AC( !(
-M $_ (<P 01 1 !1@ "&&@ $@ 4P AS$
-M!!$ !$ %3 (8^ 01 0 !9P "&0@ $0#_\0 6X A?8
-M !$ __$ &( (87 2 !C@ "&1 $$0 $0 9<
-M 1,( /!( < &I $3\ 1 * !M@ !%TL $0#_\0
-M ;T 10 !!$ P '* $2, $@2 ' !SP "&(P $@
-M =8 0R( !( < 'H $3^ 1 + !]0 !#10 '4
-M$@ !P ?H AD !!$ ! (& (8= 2 "#0 !$^
-M $@ "0 A, AA0 !( 9V5T;W!T %]?1%1/4E],25-47U\
-M7W-T87)T ')E860 871O:0!?7T-43U)?3$E35%]? '-T<G1O; !P<F]G;F%M
-M90!V9G!R:6YT9@!?96YV:7)O;@!?96YD %=R:71E %)E860 9V5T<&%R;0!?
-M:6]B %]'3$]"04Q?3T9&4T547U1!0DQ%7P!A8F]R= !A=&5X:70 97AI= !?
-M:6YI= !V97)B;W-E %]S>7-?;F5R<@!S>7-?97)R;&ES= !F8VQO<V4 55-!
-M1T4 7T193D%-24, <')O8V5S<P!?7VEO8@!?<WES7V5R<FQI<W0 =W)I=&4
-M<W1R<F-H<@!?97AI= !E;G9I<F]N &5R<FYO '-T<F-H<@!E<G)O<@!R97!O
-M<G1?;&EN95]L96YG=&@ ;W!T:6YD &]P96X ;W!T87)G &9G971S &]P=&5R
-M<@!R97!O<G1?;&EN95]N=6UB97)S %]E9&%T80!?4%)/0T5$55)%7TQ)3DM!
-M1T5?5$%"3$5? &9O<&5N '-Y<U]N97)R %]?9&]?9VQO8F%L7V1T;W)S %]?
-M0U1/4E]%3D1?7P!?971E>'0 7VQI8E]V97)S:6]N $]P96X 9F9L=7-H %]?
-M9&]?9VQO8F%L7V-T;W)S %]?1%1/4E]%3D1?7P!M86EN &QI;F5?;&5N9W1H
-M '-T<FQE;@!?9FEN:0!F<')I;G1F &QI8F,N<V\N,0 AD, C$P
-M AS$ !#$P AS !!$P AR\ _$P AD8 U
-M$P " AD0 !($P AI8 P$P A@( K%0 A@4
-M L%0 A@@ Y%0 A@L X%0 A@X :%0
-M AA$ >%0 AA0 !5%0 AA< !'%0 AAH !"%0
-M AAT !3%0 AB Q%0 AB, !.%0 AB8 B
-M%0 ABD J%0 ABP \%0 AB\ @%0 AC(
-M ! %0 AC4 =%0 AC@ W%0 "\$" X .@0*(#H$2<
-M(Z @@) 0* 20$ !0 !"]@$ 1 !$D!(CX$ 0O(! 0 !P $
-M "0$ 0DA $94L( *4 J $E 1 "A< (:6$N$,U"+ $ "D! 0 !"
-MYP$ ! $+H 0 ('#X @! $0 1-0"(^R HK__$H #9(2(^S0 F $
-M@*(@ * F4$" E@)@!)(0( "2 F $T ) "X"B( 2O__]E *@ 9*2@ "
-M@ ,$0 1!$ $2B$B/LH2I@ M $ !&?P@ 0 *"$/_PRO__]T 0 $1$
-M $1 $+!D!(C"(''X B!Z G>._F*@0 !BB$" L! @ - &0 ! $+!DA @
-M+Q, (: HB $H !- B80@0@ $T 9 - "80B0 B !T")A"!$ (;0 B$(
-MT"9 !$ (? (B#$(0 AB< (8E "&%0 19 0 !22$ 90 !"KI02H:"
-MHC__ H ,X"B(&PB@ 1$0 AQ2 F HB!N@*(@/P* "J HB!. H '- $
-M(/@0O__P%0 10* !. HB!V H 'M $H/00O__J%0 14 0IO0 B# E!
-M"!$ (: HJ( "+__XM0B(0 3 !%$0@ $ (N2$F&H$+__W14 $70!"#X
-M@* ")!@/_\0O__7T"0@^("@ B08#__T"0@^- $X/R H (D& __Q"__\_0
-M).#\@* ")!@/_\0O__+T"2@]!"__\FB$" !@*1@ "* L1 "'%0 AA$
-M (:0$B$X$P 19(28<A $)VU *@\$ 0F60$" !DA "- "(+R1*B "T 9
-M"("B( "@ 1(0 A] "8+R1*B "0 #] &0 B HC__(H K 0/__0!""\
-MD (@ = D(+R1*B "T 9 "("B( 2O__SDA $(''X B!Z G>.]F) 0 !@3
-M !%0 !"6I(28="JD@ $H !Z80( 1& $P 19(28=A !%E! &* 0
-M( &H![WX)0 ABT (:0$ 4DA B $ 0DV4$ 5@*(@ * #4! 0 !"
-M2Y 0 !2B C__$0 AM "(0" I$ (!( *X"DX 2@ +$0 AA, $60%*$X
-MDA)A^$ 0C64$ 8T 6@^("B( "@ B$0 AM "(/2 HB H !Q, $60
-M%*$XDA)B )00 !! $(HE@>]^- %H/B HB H $A$ (;0 B#\@*(@ *
-M D3 !%D!2A.)(28AB4$ 00 !"&Y80 !$0@ (I@3@ 1, $60%*$XDA)B
-M($ 0A24$ 0I@3@ 1"__\B@!" !0 !"&Y 0 !6P$" @<?@"('H "=X[^0
-M\B>@2/0GH$SV)Z!0^">@5/HGH%@1 "&0 !"$I 2(2@1' LBX "!$0 "
-MC@ ( H !*('H$P1 "'\@(@N. 'H$@5 "&-0 AI 6H3@3 !%DA)B*$
-M0?/4 J$(D!:A.)(0 !! $(!E! $8"F8 "@ :$0 A@2 !*0$B$X$0
-MAM "(1" ID (-H #!$ (85 "&E!*B6)<N8 *0%J$X$P 19(28C! $'=
-MU + "A" X1 "&D!(A.!, $62$F(X0 !!UI00 !D0@ '$0 AI 2(3@3
-M !%0 !!T)(28E 1 "&0 !!W) 2(3@1# @(X " * !41" @(X " *
-M R IF H !1$ $41 !%$( Y(2(EB2$B)P?___M) 0( ! $&MD!
-M&9 0( 3 !%?___KI(28GA $'+ 0 (''X B!Z G>._F* 0 !@1 !%
-MD!(BD$ 0<;23 @*(@ !* F0$ 0$0@ !, $62$F*@?___G)00 ! 0
-M@ :L! &9(0( ! $&\E! @ + 0 B I@ 9!H !("F !H$@ 1 0 ("F
-M0!H2@ ($0@ !, $62$F*XE! $'___XF6$ :,( !Q, $62$F+0E!
-M&Y80 !E___^"F! &H''X B!Z G>._F* 0 !B0$ 0DA &4 0:*4$ :
-ML! "("F/_\2@ ($1@ !, $62$F+PE! $)80 !E___]PF! &H''X B!
-MZ G>._F* 0 !B0$ 0DA &4 09.4$ :L! "("F/_\2@ ($1@ !,
-M $62$F,0E! $)80 !E___]>F! &H''X B!Z G>._F* 0 !B0$ 0DA
-M&4 0824$ :L! "("F/_\2@ ($1@ !, $62$F,PE! $)80 !E___],
-MF! &H''X B!Z G>._F!$ $32 B/X@*)@ * F@$B/XT 0 )_" "@
-M!" $T 0 ("B( 2O__[ 0 (''X B!Z G>._F)WCOZ"!Z G>._F!$
-M $34 B/L@**__Q* V2$B/LT )@!("B( "@ )E! @ )8"8 22$" D@)@
-M!- "0 N HB $K___90"H &2DH H #!$ $01 !$HA(C[*$J8 +0! 1
-MG\( $ "@A#_\,K___= $ !$1 !$0 !!$) 2(PB!Q^ (@>@ (''X B!
-MZ G>._H(''X B!Z _____P #_____ ! '5S
-M86=E.B @8VML96YG=&@@(%L@+78@72!;(&%R9R N+BX@72!F:6QE<RXN+B *
-M(" @(" @(" @(" @+6P@;&5N9W1H(" @+2T@;6%X:6UU;2!L:6YE(&QE;F=T
-M: H@(" @(" @(" @(" M;B @(" @(" @(" M+2!R97!O<G0@;&EN92!N=6UB
-M97)S(&9O<B!O9F9E;F1I;F<@;&EN97,*(" @(" @(" @(" @+4X@(" @(" @
-M(" @+2T@<F5P;W)T(&QI;F4@;G5M8F5R<R!A;F0@;&5N9W1H(&9O<B!O9F9E
-M;F1I;F<@;&EN97,*(" @(" @(" @(" @+78@(" @(" @(" @+2T@=F5R8F]S
-M90H*4')I;G0@=&AE(&YA;64@;V8@9FEL97,@=VAI8V@@:&%V92!A="!L96%S
-M=" Q(&QI;F4@=VAI8V@@97AC965D<R!T:&4*;6%X:6UU;2!L:6YE(&QE;F=T
-M:"X@(%1H92!D969A=6QT(&UA>&EM=6T@;&EN92!L96YG=&@@:7,@.# N"@
-M &PZ;DYV *"5D*2!I<R!I;&QE9V%L(&QI;F4@;&5N9W1H"@ E<P
-M '( 56YA8FQE('1O(&]P96X@9FEL92 H)7,I"@ E
-M<PH %1/3R!,3TY'.B5D.B E<PH "5D.B E9 H )60*
-M E<SH@ " H)7,I"@ ("AU;FMN;W=N(&5R<FYO/25D*0H "@
-M !F871A;"!E<G)O<BP@97AI=&EN9P !E>&ET:6YG &9A=&%L(&5R
-M<F]R+"!A8F]R=&EN9P # Q,C,T-38W.#DM G)7,G(&ES(&YO="!A
-M(&YU;6)E<@ E<R!C86X@;VYL>2!B92 E;&0 E<R!M=7-T(&)E
-M(&)E='=E96X@)6QD(&%N9" E;&0 &]P96XH)R5S)RP@,'@E>"P@,"5O*2!F
-M86EL960 <F5A9"@E9"P@,'@E>"P@)60I(&9A:6QE9 !W<FET
-M92@E9"P@,'@E>"P@)60I(&9A:6QE9 (74 $ (; # !$T@
-M - $3X 0 0#H !0 !"+0 * ")0 8 0-4 "P
-M ! 5 , A?8 @ .0 4 !P !< 0LP
-M!P !"MP ( !. D ,
-M # P,+__\P$ #
-M \,+__\ $ # !(,+__[0$ # !4,+__Z@$ # !@,+__YP$
-M # !L,+__Y $ # !X,+__X0$ # "$,+__W@$ # "0,+__
-MVP$ # "<,+__V $ # "H,+__U0$ # "T,+__T@$ # #
-M,+__SP$ # #,,+__S $ # #8,+__R0$ # #D,+__Q@$ #
-M #P,+__PP$ # #\,+__P $ # $(,+__O0$ ! $4"
-M % $
-M 0 __$ $ U # ! ! .@ P @ 0-4
-M , , $(M # $ !"MP P !0
-M 0LP , 8 $,% # ' !$T@ P "
-M 1/@ , D $3[ # * !$_0 P
-M"P 10 , P (73 # - "%U
-M P #@ A?8 , \ (8\ # 0 "&0@
-M P $0 , !( # 3
-M P % , !4 # 6
-M P %P , !@ # 9
-M #P ! #_\0 !8 0 __$ B $
-M /_Q +0 !$U @ " $, 0R( < !2 (8\
-M ! 0 8 ! #_\0 &L 0T4 < !Z
-M $ /_Q A ! #_\0 (\ 1-$ ( < "E
-M $31 ' M "&00 0 $ ,( 0 __$
-M #) (8. 2 T !$_0 $0 "P -X 0P4 =!(
-M < #E (8U 2 Z@ "&$0 $@ .\ 1/L
-M !$ H #] (8O 2 !! "&0@ $$0 $0 0T AB8
-M !( $6 (9# 01 1 !'P "',@ $0#_\0 20
-M 1+ 2!( < $J $2> $@2 ' !+P !$8@ "H$@ !P
-M 3< AD8 !0"$ !$ $\ (73 1 /_Q !4@ "&*0 $@
-M 5@ A@( !( %? (8% 2 !9 !$T@
-M$@ " 6H ACT !!$ ! %R (9$ 01 1 !? "&E@
-M )@$0 $0 8@ AB !( &/ (8\ 01 0 !E0 "
-M%U $0#_\0 9X 0[H !0!( < &F (9& 4 1 1 !
-MK "&E@ )@$0 $0 ;D AC@ !( &_ (8+ 2
-M !QP "&" $@ <T AD, !"$ !$ '5 (<N 01
-M 1 !VP "&+ $@ >( 1 H !8!( < 'H (8_
-M 01 0 !^P "'+P $$0 $0 @( AC( !( (' (<
-MP 01 1 "#@ "&&@ $@ A0 AS$ !!$ !$ (;
-M (8^ 01 0 "+P "&0@ $0#_\0 C8 A?8 !$ __$
-M )0 (87 2 "5@ "&1 $$0 $0 E\ 1,( /!(
-M < )Q $3\ 1 * "?@ !%TL $0#_\0 H4 10
-M!!$ P *2 $2, $@2 ' "EP "&(P $@ IX 0R(
-M !( < *P $3^ 1 + "O0 !#10 '4$@ !P L(
-M AD !!$ ! +. (8= 2 "U0 !$^ $@ "0
-M ML AA0 !( 9V\S,B]C:VQE;F=T: !C<G1I+G, =F%L=65S+5AA
-M+F, 8W)T<W1U9F8N8P!?7V1O7V=L;V)A;%]C=&]R<U]A=7@ 9V-C,E]C;VUP
-M:6QE9"X 9F]R8V5?=&]?9&%T80!C:VQE;F=T:"YC &=C8S)?8V]M<&EL960N
-M &QI8F=C8S(N8P!C<G1S='5F9BYC %]?9&]?9VQO8F%L7V-T;W)S7V%U> !G
-M8V,R7V-O;7!I;&5D+@!F;W)C95]T;U]D871A &-R=&XN<P!G971O<'0 7U]$
-M5$]27TQ)4U1?7P!?<W1A<G0 <F5A9 !A=&]I %]?0U1/4E],25-47U\ <W1R
-M=&]L '!R;V=N86UE '9F<')I;G1F %]E;G9I<F]N %]E;F0 5W)I=&4 4F5A
-M9 !G971P87)M %]I;V( 7T=,3T)!3%]/1D93151?5$%"3$5? &%B;W)T &%T
-M97AI= !E>&ET %]I;FET '9E<F)O<V4 7W-Y<U]N97)R '-Y<U]E<G)L:7-T
-M &9C;&]S90!54T%'10!?1%E.04U)0P!P<F]C97-S %]?:6]B %]S>7-?97)R
-M;&ES= !W<FET90!S=')R8VAR %]E>&ET &5N=FER;VX 97)R;F\ <W1R8VAR
-M &5R<F]R ')E<&]R=%]L:6YE7VQE;F=T: !O<'1I;F0 ;W!E;@!O<'1A<F<
-M9F=E=', ;W!T97)R ')E<&]R=%]L:6YE7VYU;6)E<G, 7V5D871A %]04D]#
-M14154D5?3$E.2T%'15]404),15\ 9F]P96X <WES7VYE<G( 7U]D;U]G;&]B
-M86Q?9'1O<G, 7U]#5$]27T5.1%]? %]E=&5X= !?;&EB7W9E<G-I;VX 3W!E
-M;@!F9FQU<V@ 7U]D;U]G;&]B86Q?8W1O<G, 7U]$5$]27T5.1%]? &UA:6X
-M;&EN95]L96YG=&@ <W1R;&5N %]F:6YI &9P<FEN=&8 $ %
-MFP UD "]D # %$X ((X
-M $8\ ! *",I4W5N3U,@-2XS($=E;F5R:6,@4V5P=&5M
-M8F5R(#$Y.3, &%S.B!30S,N,"!E87)L>2!A8V-E<W,@,#$@4V5P(#$Y.3,*
-M $=#0SH@*$=.52D@,BXV+C, &%S.B!30S,N,"!E87)L>2!A8V-E<W,@,#$@
-M4V5P(#$Y.3,* $=#0SH@*$=.52D@,BXV+C, &%S.B!30S,N,"!E87)L>2!A
-M8V-E<W,@,#$@4V5P(#$Y.3,* $=#0SH@*$=.52D@,BXV+C, &%S.B!30S,N
-M,"!E87)L>2!A8V-E<W,@,#$@4V5P(#$Y.3,* $=#0SH@*$=.52D@,BXV+C,
-M;&0Z("A31U4I(%-U;D]3+T5,1B H3$LM,2XS*0 0 "D 8?
-M"V0 1,( (60 1,( +3P /(
-M 7H <( EX L(
-M SH !$H !5H !=(
-M !EH !LX !SX !
-MX8 !]( "#( ".8
-M "5( "<( "D8 "G8
-M "R( #&8 $GH %+(
-M & %.8 ) %0X -< %3H #0 %
-M6H #4 %9( #8 %;X #< %>8 #@
-M %A( #D %CX #H %FH $8 %IX
-M %T( &T %]( "X &"20 !\L 1,( "YI;G1E
-M<G +FAA<V@ +F1Y;G-Y;0 N9'EN<W1R "YR96QA+F)S<P N<F5L82YP;'0
-M+G1E>'0 +FEN:70 +F9I;FD +F-T;W)S "YD=&]R<P N<F]D871A "YG;W0
-M+F1Y;F%M:6, +G!L= N9&%T80 N8G-S "YS>6UT86( +G-T<G1A8@ N<W1A
-M8BYI;F1E> N8V]M;65N= N<W1A8@ N<VAS=')T86( +G-T86(N:6YD97AS
-M='( +G-T86)S='( '9A;'5E<RU882YC "\Q,#DS+V]N,3 Y,U]W<R]U<W(O
-M<W)C+VQI8B]L:6)C+P!P;W)T+V=E;B]V86QU97,M6&$N8P %AT(#L@5CTR
-M+C +VYE="]M;W)G86YA+W5S<C$O<G1E;7,M,RXU+C P+V,O8G5I;&0M=&]O
-M;',O<W)C "]U<W(O8V-S+VQI8B]V86QU97,M6&$N;P ;&EB9V-C,BYC "]U
-M<W(T+T=.050O9V-C+3(N-BXS+P N+VQI8F=C8S(N8P!G8V,R7V-O;7!I;&5D
-M+@!I;G0Z=#$]<C$[+3(Q-#<T.#,V-#@[,C$T-S0X,S8T-SL 8VAA<CIT,CUR
-M,CLP.S$R-SL ;&]N9R!I;G0Z=#,]<C$[+3(Q-#<T.#,V-#@[,C$T-S0X,S8T
-M-SL =6YS:6=N960@:6YT.G0T/7(Q.S [+3$[ &QO;F<@=6YS:6=N960@:6YT
-M.G0U/7(Q.S [+3$[ &QO;F<@;&]N9R!I;G0Z=#8]<C$[,#$P,# P,# P,# P
-M,# P,# P,# P,# [,#<W-S<W-S<W-S<W-S<W-S<W-S<W-SL ;&]N9R!L;VYG
-M('5N<VEG;F5D(&EN=#IT-SUR,3LP,# P,# P,# P,# P.S Q-S<W-S<W-S<W
-M-S<W-S<W-S<W-S<W.P!S:&]R="!I;G0Z=#@]<C$[+3,R-S8X.S,R-S8W.P!S
-M:&]R="!U;G-I9VYE9"!I;G0Z=#D]<C$[,#LV-34S-3L <VEG;F5D(&-H87(Z
-M=#$P/7(Q.RTQ,C@[,3(W.P!U;G-I9VYE9"!C:&%R.G0Q,3UR,3LP.S(U-3L
-M9FQO870Z=#$R/7(Q.S0[,#L 9&]U8FQE.G0Q,SUR,3LX.S [ &QO;F<@9&]U
-M8FQE.G0Q-#UR,3LX.S [ &-O;7!L97@@:6YT.G0Q-3US.')E86PZ,2PP+#,R
-M.VEM86<Z,2PS,BPS,CL[ &-O;7!L97@@9FQO870Z=#$V/7(Q-CLT.S [ &-O
-M;7!L97@@9&]U8FQE.G0Q-SUR,3<[.#LP.P!C;VUP;&5X(&QO;F<@9&]U8FQE
-M.G0Q.#UR,3@[.#LP.P!V;VED.G0Q.3TQ.0!A<F-H7W1Y<&4Z5#(P/65!4D-(
-M7S,R0DE4.C L05)#2%\V-$))5#HQ+#L <F5G7V-L87-S.E0R,3UE3D]?4D5'
-M4SHP+$=%3D5204Q?4D5'4SHQ+$907U)%1U,Z,BQ!3$Q?4D5'4SHS+$Q)35]2
-M14=?0TQ!4U-%4SHT+#L ;6%C:&EN95]M;V1E.E0R,CUE5D])1&UO9&4Z,"Q1
-M26UO9&4Z,2Q(26UO9&4Z,BQ04TEM;V1E.C,L4TEM;V1E.C0L4$1);6]D93HU
-M+$1);6]D93HV+%1);6]D93HW+$]);6]D93HX+%%&;6]D93HY+$A&;6]D93HQ
-M,"Q4449M;V1E.C$Q+%-&;6]D93HQ,BQ$1FUO9&4Z,3,L6$9M;V1E.C$T+%1&
-M;6]D93HQ-2Q30VUO9&4Z,38L1$-M;V1E.C$W+%A#;6]D93HQ."Q40VUO9&4Z
-M,3DL0U%);6]D93HR,"Q#2$EM;V1E.C(Q+$-326UO9&4Z,C(L0T1);6]D93HR
-M,RQ#5$EM;V1E.C(T+$-/26UO9&4Z,C4L0DQ+;6]D93HR-BQ#0VUO9&4Z,C<L
-M0T-8;6]D93HR."Q#0U].3T]6;6]D93HR.2Q#0UA?3D]/5FUO9&4Z,S L0T-&
-M4&UO9&4Z,S$L0T-&4$5M;V1E.C,R+$U!6%]-04-(24Y%7TU/1$4Z,S,L.P!M
-M;V1E7V-L87-S.E0R,SUE34]$15]204Y$3TTZ,"Q-3T1%7TE.5#HQ+$U/1$5?
-M1DQ/050Z,BQ-3T1%7U!!4E1)04Q?24Y4.C,L34]$15]#0SHT+$U/1$5?0T]-
-M4$Q%6%])3E0Z-2Q-3T1%7T-/35!,15A?1DQ/050Z-BQ-05A?34]$15]#3$%3
-M4SHW+#L <'1R9&EF9E]T.G0Q '-I>F5?=#IT- !W8VAA<E]T.G0S %51271Y
-M<&4Z=#$Q %-)='EP93IT,0!54TET>7!E.G0T $1)='EP93IT-@!51$ET>7!E
-M.G0W %-&='EP93IT,3( 1$9T>7!E.G0Q,P!W;W)D7W1Y<&4Z=#$ 1$ES=')U
-M8W0Z5#(T/7,X:&EG:#HQ+# L,S([;&]W.C$L,S(L,S([.P!$275N:6]N.G0R
-M-3UU.',Z,C0L,"PV-#ML;#HV+# L-C0[.P!F=6YC7W!T<CIT,C8]*C(W/68Q
-M.0!?7V1O7V=L;V)A;%]D=&]R<SI&,3D
-M $ ! @ ! -0 #4 $0
-M 0 ) !0 ( 0#H Z FP #
-M 0 $ #P L " $#5 U0 5@ ! !H $
-M $ !< # @ !"+0 BT ")0 0
-M ? ! ( 0K< *W %0 # $0 0 , *0
-M 0 " $+, "S #D P \ $ # #, !
-M!@ !#!0 P4 '- ! Y 0 8 1-(
-M 32 )@ 0 /P $ & $3X $^
-M , $ $4 ! !@ !$^P !/L "
-M ! !, 0 8 1/T 3] @
-M 0 4P $ " $4 % -+ (
-M %L ! P "%TP !=, ! ! 0
-M !@ !@ , A=0 74 (@ $ 0 ( :0
-M $ ' (7V %]@ $8 $ # &X !
-M P "&/ !CP % ! !T " , AD(
-M 9" \ @ >0 ( &0@
-M 90 $P "D $ $ ($ # !]8 "XP
-M 0 ") 0 B/ $@
-M 0 , E0 $ (H0 $; !
-M )X ! ".@ !^ ! P
-M "D P EF ,8 $ K@
-M , )EX "; ! +T #
-= ";Y &'P 0 !
-
-end
diff --git a/c/build-tools/os/msdos/fixtimer.c b/c/build-tools/os/msdos/fixtimer.c
deleted file mode 100644
index 3b71032550..0000000000
--- a/c/build-tools/os/msdos/fixtimer.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * $Id$
- */
-
-#include <stdio.h>
-#include <dos.h>
-
-#define IO_RTC 0x70 /* RTC */
-
-#define RTC_SEC 0x00 /* seconds */
-#define RTC_MIN 0x02 /* minutes */
-#define RTC_HRS 0x04 /* hours */
-#define RTC_WDAY 0x06 /* week day */
-#define RTC_DAY 0x07 /* day of month */
-#define RTC_MONTH 0x08 /* month of year */
-#define RTC_YEAR 0x09 /* month of year */
-#define RTC_STATUSA 0x0a /* status register A */
-#define RTCSA_TUP 0x80 /* time update, don't look now */
-
-#define RTC_STATUSB 0x0b /* status register B */
-
-#define RTC_DIAG 0x0e /* status register E - bios diagnostic */
-#define RTCDG_BITS "\020\010clock_battery\007ROM_cksum\006config_unit\005memory_size\004fixed_disk\003invalid_time"
-
-
-
-/* convert 2 digit BCD number */
-static int bcd( unsigned int i )
-{
- return ((i/16)*10 + (i%16));
-}
-
-static unsigned int rtcin( unsigned int what )
-{
- outportb( IO_RTC, what );
- return inportb( IO_RTC+1 );
-}
-
-
-void fix_date( void )
-{
- int s;
- struct date date;
- struct time time;
-
- /* initialize brain-dead battery powered clock */
- outportb( IO_RTC, RTC_STATUSA );
- outportb( IO_RTC+1, 0x26 );
- outportb( IO_RTC, RTC_STATUSB );
- outportb( IO_RTC+1, 2 );
-
- outportb( IO_RTC, RTC_DIAG );
- s = inportb( IO_RTC+1 );
- if (s) printf("RTC BIOS diagnostic error %b\n", s, RTCDG_BITS);
-
- /* check for presence of clock */
- s = rtcin(RTC_STATUSA);
- if ( s == 0xff || s == 0 ) {
- printf( "Real-time clock not found\n" );
- return;
- }
-
- /* ready for a read? */
- while ((s & RTCSA_TUP) == RTCSA_TUP)
- s = rtcin(RTC_STATUSA);
-
- date.da_year = bcd(rtcin(RTC_YEAR)) + 1900; /* year */
- if ( date.da_year < 1970) date.da_year += 100;
- date.da_year -= 1980;
- date.da_mon = bcd(rtcin(RTC_MONTH)); /* month */
- date.da_day = bcd(rtcin(RTC_DAY)); /* day */
-
- (void)bcd(rtcin(RTC_WDAY)); /* weekday */
-
- time.ti_hour = bcd(rtcin(RTC_HRS)); /* hour */
- time.ti_min = bcd(rtcin(RTC_MIN)); /* minutes */
- time.ti_sec = bcd(rtcin(RTC_SEC)); /* seconds */
- time.ti_hund = 0;
-
- setdate( & date );
- settime( & time );
-}
-
-
-
-
-void fix_timer( void )
-{
-#define PIT_PORT 0x40
-#define TIMER_CNTR0 (PIT_PORT + 0) /* timer 0 counter port */
-#define TIMER_MODE (PIT_PORT + 3) /* timer mode port */
-#define TIMER_SEL0 0x00 /* select counter 0 */
-#define TIMER_RATEGEN 0x04 /* mode 2, rate generator */
-#define TIMER_16BIT 0x30 /* r/w counter 16 bits, LSB first */
-
- /* set timer 0 to generate interrupts every period */
- outportb( TIMER_MODE, TIMER_SEL0|TIMER_RATEGEN|TIMER_16BIT );
- outportb( TIMER_CNTR0, 0 ); /* counter low */
- outportb( TIMER_CNTR0, 0 ); /* counter high */
-}
-
-int main(void)
-{
- /* Make timer count at correct pace */
- fix_timer();
-
- /* Fix the date */
- fix_date();
-
- return 0;
-}
diff --git a/c/build-tools/os/msdos/fixtimer.uue b/c/build-tools/os/msdos/fixtimer.uue
deleted file mode 100644
index bc4b10fc72..0000000000
--- a/c/build-tools/os/msdos/fixtimer.uue
+++ /dev/null
@@ -1,162 +0,0 @@
-#
-# $Id$
-#
-begin 664 fixtimer.exe
-M35IF 0X 0 @ T __^; 8 (@ $ ^R!R:@$
-M
-M
-M
-M
-M
-M
-M
-M
-M
-M
-M "Z3 $NB1;X ;0PS2&++@( BQXL ([:HY( C :0
-M (D>C ")+JP QP:6 /__Z#0!Q#Z* (O'B]BY_W\F@3TX-W49)HM5 H#Z/740
-M@.;?_P:6 (#^674$_P:6 /*NXV%#)C@%==: S8#WV8D.B@"Y 0#3XX/#"(/C
-M^(D>C@",VBOJBSY\ H'_ )S![\ HD^? *!Q^P$<B@#/GH"<B*Q!-/O1SOO
-M<AF#/GP" '0'@SYZ @!U#K\ $#OO=P>+_>L#Z2$!B]\#VHD>I ")'J@ H9
-M*]B.P+1*5\TA7]/G^H[2B^?[,\ NC@;X ;^F!+GL!"O/\ZH._Q:8!.BU NB=
-M [0 S1J)%I@ B0Z: /\6G 3_-H@ _S:& /\VA #H%P)0Z%H"+HX>^ 'H? .
-M_Q::!#/ B_"Y+P"0_ ($@-0 1N+X+3<-D'0*N1D D+HO .B+ (OLM$R*1@+-
-M(;D. )"Z2 #IAP >N US2&)'G0 C 9V +@$-<TAB1YX (P&>@"X!37-(8D>
-M? ",!GX N 8US2&)'H C :" +@ )8S*CMJZ6 '-(1_#'K@ )<46= #-(1\>
-MN 0EQ19X ,TA'QZX!27%%GP S2$?'K@&)<46@ #-(1_#QP:6 R\.T0+L"
-M ,TAP[D> )"Z5@ NCA[X >CI_[@# %#H*?\ %6+[(M&!+$$T^BZ"@#WXHM6
-M!('B#P #PNL 7<-5B^R*1@3F<.1QM #K %W#58OL@^P(5K *YG"P)N9QL OF
-M<+ "YG&P#N9PY'&T (OP"_9T#[BR 5!6N)0!4.B<"8/$!K@* %#HM?]9B_"!
-M_O\ = 0+]G4+N/P!4.A^"5GIJ0#K"K@* %#HE/]9B_"+QB6 #V '3LN D
-M4.B _UE0Z%__605L!XE&^(%^^+('?02#1OAD@6[XO >X" !0Z%W_65#H//]9
-MB$;[N < 4.A-_UE0Z"S_68A&^K@& %#H/?]94.@<_UFX! !0Z##_65#H#_]9
-MB$;]N ( 4.@@_UE0Z/_^68A&_#/ 4.@1_UE0Z/#^68A&_\9&_@"-1OA0Z'H1
-M68U&_%#HA1%97HOE7<.P-.9#L #F0+ YD##Z/#_Z.S^,\#K ,-5B^Q6BW8$
-M"_9\%(/^6'8#OE< B388 HJ$&@*8ENL-]]Z#_B-WZL<&& +__XO&HY0 N/__
-MZP!>7<(" ,-5B^SK"HL>?@+1X_^7I@2A?@+_#GX""\!UZ_\6= +_%G8"_Q9X
-M O]V!.AZ_5E=PP "Z/!JH#+HP>K /\C@:0 +Z #+D)JQ C,6'UI.+
-M-HH @\8"N0$ @#Z2 -R$8X&C "+_K%_,L#RKN-V@/%_@^P"N $ \,#P27^
-M_XO\*_AR8(OGC,".V(S0CL!12?.D,L"JCMV'\H?9B\.+T$/H&0!W!W) Z!(
-M=_D\('0(/ UT!#P)=>@RP.OD"\!T!T*J"L!U 4.&X#+ ^>,5K$DL(G0/!"(\
-M7'4'@#PB=0*L20OVP^E^_5D#RBZ.'JP#B1Z$ $,#VXOTB^PKZW+FB^6)+H8
-MXPZ)=@"#Q0(VK K X/IT\#/ B48 +O\FJ@.+#HH 4>A' 5F+^ O ="0>'@>.
-M'HP ,_;\\Z0?B_@&_S:. .@I 8/$ HO8!Z.( O =0/I$?TSP+G__XD_@\,"
-M\JXF. 5U](D'PU6+[(,^?@(@=06X 0#K%8M&!(L>?@+1XXF'I@3_!GX",\#K
-M %W#58OL5E>+?@2+10:CZ 0[QW4(QP;H! ZQ"+=02+'N@$B7<$H>@$B40&
-M7UY=PU6+[%97BWX$BT8&*06+-0/WBT8&0(D$B7P"H>8$.\=U!HDVY@3K"(O^
-M WX&B74"B\8%! #K %]>7<-5B^Q6BT8$,](E__^!X@ 4E#H] !968OP@_[_
-M=00SP.L8H>8$B40"BT8$0(D$B3;F!*'F! 4$ .L 7EW#58OL5HM&!#/2)?__
-M@>( %)0Z+< 65F+\(/^_W4$,\#K%8DVZ@2)-N8$BT8$0(D$B\8%! #K %Y=
-MPU6+[%97BWX$"_]U!#/ ZUJ+QP4+ "7X_XOX@S[J! !U!U?HH?]9ZT*+-N@$
-MB\8+P'0QBP2+UX/"*#O"<@E75N@-_UE9ZR2+!#O'<@Y6Z-'^6?\$B\8%! #K
-M$(MT!CLVZ 1USU?H(O]9ZP!?7EW#58OLBT8$B]2!Z@ !.\)S!Z.> #/ ZPO'
-M!I0 " "X___K %W#58OLBT8$BU8& P:> (/2 (O(@<$ 8/2 O2=0H[S',&
-MAP:> .L+QP:4 @ N/__ZP!=PU6+[/]V!.B?_UGK %W#58OLBT8$F5)0Z++_
-MB^7K %W#58OL@^P"5E>+7@2+-XO&B4;^BUX$]T<"0 !T!(O&ZQ^+7@2+?PKK
-M"XO?1X _"G4#_T;^B\9."\!U[HM&_NL 7UZ+Y5W" @!5B^Q6BW8$5NA3!%D+
-MP'0%N/__ZTR#?@H!=1"#/ !^"U;HE?^9*48&&58(@60"7_['! BT0(B40*
-M_W8*_W8(_W8&BD0$F%#HW *#Q B#^O]U"CW__W4%N/__ZP(SP.L 7EW#58OL
-M@^P$5HMV!%;H[ -9"\!T"+K__[C__^L_N $ 4#/ 4%"*1 284.B8 H/$"(E6
-M_HE&_(,\ 'X9BU;^BT;\4E!6Z!#_F8O8B\I86BO#&]'K!HM6_HM&_.L 7HOE
-M7<-5B^RX $2+7@3-(;@ '($T>+1T.L 7<-5B^Q65XM^"HMV!(M$#CO&=0R#
-M?@@"?P:!__]_=@:X___IJ@"#/NH# '4/N) ".\9U",<&Z@,! .L4@S[H P!U
-M#;B CO&=0;'!N@# 0"#/ !T#[@! % SP%!05NC&_H/$"/=$ @0 = ?_= CH
-M"PQ9@60"\__'1 8 (O&!04 B40(B40*@WX( G0_"_]V.\<&= +$"(-^!@!U
-M&%?H6?U9B48&"\!T!X%, @0 ZP6X___K&XM&!HE$"HE$"(E\!H-^" %U!8%,
-M @@ ,\#K %]>7<-65[\$ +Z NL0]T0" P!T!5;HG )93X/&$ O_=>Q?7L-5
-MB^R![(H 5E>+1@A /0( <P4SP.GV (M>!-'C]X? P" =!+_=@C_=@;_=@3H
-MXP"#Q ;IUP"+7@31XX&GP /__8M&!HF&?/^+1@B)AGC_C;9^_^MM_XYX_XN>
-M?/__AGS_B@>(AGO_/ IU!,8$#4:*AGO_B 1&C89^_XO6*]"!^H ?#Z-AG[_
-MB_XK^%>-AG[_4/]V!.A[ (/$!HF&=O\[QW0;@[YV_P!S!;C__^L-BT8(*X9X
-M_P.&=O\KQ^M/C;9^_X.^>/\ = /IB?^-AG[_B_XK^(O'"\!V+E>-AG[_4/]V
-M!.@M (/$!HF&=O\[QW07@[YV_P!S!;C__^L)BT8( X9V_RO'ZP6+1@CK %]>
-MB^5=PU6+[(M>!-'C]X? P (=!"X @!0,\!04/]V!.@H (OEM$"+7@2+3@B+
-M5@;-(7(/4(M>!-'C@8_ P 06.L&4.@%^>L 7<-5B^R+7@31XX&GP /__;1"
-MBD8*BUX$BTX(BU8&S2%R NL'4.C;^)GK %W#58OL@^PB5E<&BWX*'@>+7@B#
-M^R1W6(#[ G)3BT8,BTX."\E]$8!^!@!T"\8%+4?WV??8@]D C7;>XP^1*]+W
-M\Y'W\X@41N,)Z_$KTO?SB!1&"\!U]8U.WO?9 \[\3HH$+ IS! 0ZZP,"1@2J
-MXN^P *H'BT8*ZP!?7HOE7<(, %6+[(-^" IU!HM&!)GK!8M&!#/24E#_=@;_
-M=@BP 5"P85#H7/_K %W#58OL_W8&_W8$_W8(_W8*L !0L&%0Z$#_ZP!=PU6+
-M[/]V!O]V!/]V"/]V"H-^"@IU!;@! .L",\!0L&%0Z!G_ZP!=P[KL ^L#NO$#
-MN04 D+1 NP( S2&Y)P"0NO8#M$#-(>EM]E6+[%97BW8$BT0..\9T!;C__^MF
-M@SP ?"WW1 (( '4,BT0*B]:#P@4[PG46QP0 (M$"HO6@\(%.\)U!HM$"(E$
-M"C/ ZS2+? 8#/$<I/%>+1 B)1 I0BD0$F%#H$OV#Q 8[QW01]T0" )U"H%,
-M A N/__ZP0SP.L 7UY=PU6+[+AK#5"XD )0_W8$C48&4.A, NL 7<-5B^R+
-M7@;_#_]V!HI&!)A0Z 8 B^7K %W#58OL@^P"5HMV!HI&!(A&__\$?3:*1O__
-M1 J+7 J(1__W1 (( '0;@'[_"G0&@'[_#74/5N@9_UD+P'0&N/__Z>D BD;_
-MM #IX0#_#/=$ I =0?W1 (" '4+@4P"$ "X___IQ@"!3 ( 8-\!@!T)H,\
-M '015NC7_ED+P'0&N/__Z:< ZPJX__^+5 8KPHD$Z7W_Z94 @S[J P!U.;B0
-M CO&=3**1 284.@)^UD+P'4%@60"__VX )0]T0" )T!;@" .L",\!0,\!0
-M5NC]^H/$".F/_X!^_PIU'_=$ D =1BX 0!0N!X$4(I$!)A0Z.#\@\0&/0$
-M=1BX 0!0C48$4(I$!)A0Z,C\@\0&/0$ =!'W1 ( G4*@4P"$ "X___K!XI&
-M_[0 ZP!>B^5=PU6+[%:+=@2XD )05NC!_EE9ZP!>7<-5B^R#[ )65XMV!(M^
-M!D?W1 (( '0CZP+K $^+QPO =!56BUX(_T8(B@>84.B+_EE9/?__=>+I=0#W
-M1 ) '0W@WP& '0QBT0&.\=S*H,\ '0-5NBT_5D+P'0$,\#K4T]7_W8(BD0$
-MF%#H(?R#Q :)1OXK?O[K-^L"ZP!/B\<+P'0L_P1]%8M>"/]&"(H'_T0*BUP*
-MB$?_M #K#E:+7@C_1@C_-^CZ_5E9/?__=<N+Q^L 7UZ+Y5W"!@#_)IX$58OL
-MBU8$N00/NR<$_(K&TNC7JHK&(L77JHK"TNC7JHK"(L77JNL 7<(" %6+[('L
-ME@!65\=&J@ QD:M4.LX5[G__S+ \J[WT4E?PX@%1_Y.K7XB4U%2!HU&KBOX
-MC4:N4%?_=@C_5@K&1JU0 7ZJC7ZN!UI96\,&_(U^KHF^;/^+OFS_BW8&K K
-M=!$\)700B 5'_DZM?^_HN?_KZNEU!(FV>/^L/"5TYXF^;/\SR8F.=O^)CFK_
-MB(YU_\>&</___\>&<O___^L!K#+DB]"+V(#K((#[8'-'BI\W!(O#/1< =@/I
-M'02+V-'C+O^G& ]C#TL/I ]7#\D/TP\5$!\0+Q"*#V00/Q!#$$<0Z1";$3P1
-M7!'_$BP3+!,L$W8/@ _IX0. _0!W^(..:O\!ZYN _0!W[(..:O\"ZX^ _0!W
-MX("^=?\K= 2(EG7_Z7S_@Z9J_]^U!>ER_X..:O\@M07I:/^ _0!W1/>&:O\"
-M '4A@XYJ_PBU >E1_^F( XM^!(L%@T8$ H#] G,)B89P_[4#Z3?_@/T$=>&)
-MAG+__L7I*?^ _01ST[4$Z1__DBPPF(#] G<;M0*'AG#_"\!\TM'@B]#1X-'@
-M \(!AG#_Z?O^@/T$=:6'AG+_"\!\M-'@B]#1X-'@ \(!AG+_Z=W^@XYJ_Q"U
-M!>G3_H&.:O\ 8.F:O_OM07IP_Z#IFK_[X&.:O^ +4%Z;/^MPCK"K<*ZPNW
-M$+/I MK&AG7_ ,:&;_\ B)9N_XM^!(L%,]+K$;<*QH9O_P&(EF[_BWX$BP69
-M1T>)=@;WAFK_$ !T!(L51T>)?@2-OGO_"\!U,PO2=2^#OG+_ '4MB[YL_XN.
-M</_C&X/Y_W06BX9J_R4( '0$LC#K K(@BL+HMOWB^>GI_8..:O\$4E!7BL>8
-M4(J&;_]04^B0^18'BY9R_PO2?P/I% 'I(0&(EF[_B78&C;YZ_XM>!/\W0T.)
-M7@3WAFK_( !T#_\W0T.)7@06!^@7_; ZJA8'Z _]Q@4 QH9O_P"#IFK_^XV.
-M>O\K^8?/BY9R_SO1?P*+T>F^ (EV!HB6;O^+?@2+!8-&! (6!XV^>_\RY(D%
-MN0$ Z=@ B78&B)9N_XM^!/>&:O\@ '4,BSV#1@0"'@<+_^L*Q#V#1@0$C, +
-MQW4%'@>_( 3HVOP[CG+_=@2+CG+_Z9D B78&B)9N_XM^!(N.<O\+R7T#N08
-M5U&-GGO_4U*X 0 CAFK_4(N&:O^I@ !T"K@" ,=&_@0 ZQ>I %T"K@( ,=&
-M_@H ZPC'1OX( +@& %#H-_R+1OX!1@06!XV^>__WAFK_" !T$XN6</\+TGX+
-MZ%O\*]%^!(F6=O^*AG7_"L!T%": /2UT#H.N=O\!@Y9V_P!/)H@%Z#3\B_>+
-MOFS_BYYP_[@% ".&:O\]!0!U%HJF;O^ _&]U$(.^=O\ ?P;'AG;_ 0#K'Y"
-M_'AT!8#\6'44@XYJ_T!+2X.N=O\"?0;'AG;_ #CG;_]X9J_P( =0SK!K @
-MZ.'[2SO9?_;WAFK_0 !T#+ PZ,_[BH9N_^C(^XN6=O\+TGXG*\HKVB:*!#PM
-M= @\('0$/"MU!R:LZ*C[24N'RN,'L##HG?OB^8?*XQ$KV2:LB 5'_DZM?P/H
-MD/OB\0O;?@F+R[ @Z'O[XOGIKON)=@:+?@3WAFK_( !U"HL]@T8$ AX'ZP;$
-M/8-&! 2X4 J1JT#1JHFB07I??N+MGC_B[YL_[ EZ#S[K K =?B ?JU0?0/H
-M-OL'BT:JZP!?7HOE7<(( %6+[%97BW8$@S[H! !T'(L>Z 2+?P:+'N@$B7<&
-MB74$B7P&H>@$B40$ZPJ)-N@$B70$B70&7UY=PU6+[(/L E97BW8&BWX$BP0!
-M!:'F!#O&=0:)/N8$ZPV+! /&B4;^BU[^B7\"5NA-\5E?7HOE7<-6H>H$.P;F
-M!'42_S;J!.C:\EDSP*/F!*/J!.L[BQ[F!(MW O<$ 0!U(E;H&?%9.S;J!'4*
-M,\"CY@2CZ@3K!HM$ J/F!%;HH_)9ZPS_-N8$Z)GR68DVY@1>PU6+[(/L E97
-MBW8$_PR+! /&B4;^BWP"]P4! '44.S;J!'0.BP0!!8M>_HE_ HOWZP56Z +_
-M68M>_O<' 0!U"?]V_E;H*O]965]>B^5=PU6+[%:+=@0+]G4"ZQ>+Q@7\_XOP
-M.S;F!'4%Z#S_ZP56Z(__65Y=PU6+[%:T*XMV!(L,BU0"S2%>7<-5B^Q6M"V+
-M=@2+#(M4 LTA7EW# !4=7)B;RU#("T@0V]P>7)I9VAT("AC
-M*2 Q.3@X($)O<FQA;F0@26YT;"X 3G5L;"!P;VEN=&5R(&%S<VEG;FUE;G0-
-M"D1I=FED92!E<G)O<@T*06)N;W)M86P@<')O9W)A;2!T97)M:6YA=&EO;@T*
-M .P$[ 3L
-M!
-M
-M
-M
-M
-M 4E1#($))3U,@9&EA9VYO<W1I8R!E<G)O<B E
-M8@H $ AC;&]C:U]B871T97)Y!U)/35]C:W-U;09C;VYF:6=?=6YI= 5M96UO
-M<GE?<VEZ901F:7AE9%]D:7-K VEN=F%L:61?=&EM90!296%L+71I;64@8VQO
-M8VL@;F]T(&9O=6YD"@ $P("! 4&" @(%!4%$_\6!1$"____________
-M_____P4%_____________________P__(P+_#_____\3__\" @4/ O___Q/_
-M_________R/_____(_\3_P!Z WH#>@, 0 D" ( "
-M * @$ "0 @ @(" H ( $," P
-M + " !" @0 # @ #_ T ( _P
-M . " /\ #P @ #_ , _P
-M ! # /\ @ P #_ , ,
-M_P $ # /\ !0 P #_ 8 ,
-M _P ' # /\ " P #_
-MD , _P * # /\ "P P$@ B "( 2@ J#_
-M______________________________________\ <')I;G0@<V-A;F8@
-M.B!F;&]A=&EN9R!P;VEN="!F;W)M871S(&YO="!L:6YK960-"@ - "AN=6QL
-M*0 P,3(S-#4V-S@Y04)#1$5& !04 105%!04% ( % ,$% D%!04%!04%!044
-M%!04%!04%!04% \7#P@4%!0'%!84%!04%!04%!0-%!04%!04%!04%! *#P\/
-G" H4% 84$@L.%!01% P4% T4%!04%!04 -(!T@'9 50+60M9"UD+
-
-end
diff --git a/c/build-tools/os/msdos/ifc.c b/c/build-tools/os/msdos/ifc.c
deleted file mode 100644
index 091e2dd0ef..0000000000
--- a/c/build-tools/os/msdos/ifc.c
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * $Id$
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <process.h>
-
-#include <io.h>
-
-void * xmalloc( int size )
-{
- void * p = (void *)malloc( size );
- if ( !p ) {
- fprintf( stderr, "out of memory\n" );
- exit( 1 );
- }
- return p;
-}
-void * xrealloc( void * old, int size )
-{
- void * p = (void *)realloc( old, size );
- if ( !p ) {
- fprintf( stderr, "out of memory\n" );
- exit( 1 );
- }
- return p;
-}
-
-char ** argv_fix( int * argc, char ** argv )
-{
- char ** new = NULL;
- int max = 20;
- int cnt = 0;
- int j;
-
- for ( j = 1; argv[j]; ++j )
- if ( argv[j][0] == '@' && access(argv[j]+1,0)==0 )
- break;
- if ( argv[j] == NULL )
- return argv;
-
- new = (char **)xmalloc( max * sizeof *new );
- new[cnt++] = *argv++;
- for ( ; *argv; ++argv ) {
- if ( cnt >= max )
- new = (char **)realloc( new, (max*=2) * sizeof *new );
-
- if ( argv[0][0] != '@' || access(argv[0]+1,0) ) {
- new[cnt++] = *argv;
- } else {
- char line[ 1000 ];
- FILE * f = fopen( argv[0]+1, "r" );
- if ( !f ) {
- perror( argv[0]+1 );
- exit( 2 );
- }
- while ( fgets( line, sizeof line, f ) ) {
- int len = strlen( line );
- /* delete trailing newlines */
- while ( line[len-1] == '\n' || line[len-1] == '\r' )
- line[--len] = '\0';
- if ( cnt >= max )
- new = (char **)xrealloc( new, (max*=2) * sizeof *new );
- new[cnt] = (char *)xmalloc( len+1 );
- strcpy( new[cnt], line );
- ++cnt;
- }
- fclose( f );
- }
- }
- if ( cnt >= max )
- new = (char **)xrealloc( new, (max+1) * sizeof *new );
- new[cnt] = NULL;
- *argc = cnt;
- return new;
-}
-
-
-const char * USAGE =
-"usage: $progname [ -cNvmV ] file [ file ... ] dest-directory-or-file\n"
-" -v -- verbose\n"
-" -V suffix -- suffix to append to targets (before any . suffix)\n"
-" eg: -V _g would change 'foo' to 'foo_g' and\n"
-" 'libfoo.a' to 'libfoo_g.a'\n"
-" -m mode -- mode for new file(s)\n"
-" -c -- copy instead of move (always on)\n"
-" -N -- copy only if source is newer than target\n"
-;
-
-void fatal( char * msg )
-{
- if ( msg )
- fprintf( stderr, "%s\n", msg );
- fprintf( stderr, "%s", USAGE );
- exit( 1 );
-}
-
-char * basename( char * f )
-{
- char * b = strrchr( f, '/' );
- if ( b ) ++b;
- else b = f;
- return b;
-}
-
-#include <sys/stat.h>
-int is_dir( char * path )
-{
- struct stat buf;
- if ( stat( path, &buf ) )
- return 0;
- return buf.st_mode & S_IFDIR;
-}
-int is_file( char * path )
-{
- struct stat buf;
- if ( stat( path, &buf ) )
- return 0;
- return buf.st_mode & S_IFREG;
-}
-int newer( char * p1, char * p2 )
-{
- struct stat buf1;
- struct stat buf2;
- if ( stat( p1, &buf1 ) )
- return 0;
- if ( stat( p2, &buf2 ) )
- return 0;
- return buf1.st_mtime > buf2.st_mtime;
-}
-
-int filecopy( char * d, char * s, int preserve_time )
-{
-#if 0
- int status;
- char * argv[ 5 ];
- argv[0] = "cp";
- argv[1] = "-p";
- argv[2] = s;
- argv[3] = d;
- argv[4] = NULL;
- status = spawnvp( P_WAIT, argv[0], argv );
- if ( status )
- perror( "cp" );
- return status;
-#else
- FILE * fs;
- FILE * fd;
- char buffer[ 8192 ];
- int n;
- struct ftime When;
- struct stat Stat;
-
- fs = fopen( s, "rb" );
- if ( fs == NULL ) {
- perror( s );
- return 1;
- }
- fd = fopen( d, "wb" );
- if ( fd == NULL ) {
- perror( d );
- fclose( fs );
- return 2;
- }
-
- if ( preserve_time )
- if ( getftime( fileno(fs), &When ) ) {
- perror( s );
- preserve_time = 0;
- }
-
- do {
- n = fread( buffer, 1, sizeof buffer, fs );
- if ( n > 0 )
- if ( fwrite( buffer, 1, n, fd ) < 0 ) {
- perror( d );
- return 3;
- }
- } while ( n > 0 );
-
- fclose( fs );
-
- /* Fix time stamp */
- if ( preserve_time )
- if ( setftime( fileno(fd), &When ) ) {
- perror( s );
- preserve_time = 0;
- }
- fclose( fd );
-
- /* Fix access rights */
- if ( stat( s, &Stat ) )
- perror( s );
- else if ( chmod( d, Stat.st_mode ) )
- perror( d );
-
- return 0;
-#endif
-}
-
-
-
-
-
-int main( int argc, char * argv[] )
-{
- char * progname;
- int verbose = 0;
- int only_if_newer= 0;
- char * suffix = NULL;
- char * mode = NULL;
- char * dest;
- char ** pp;
-
- argv = argv_fix( &argc, argv );
-
- progname = basename( *argv++ );
-
- /* process the options */
- while ( argv[0] && argv[0][0] == '-' ) {
- switch ( argv[0][1] ) {
- case 'N':
- ++argv;
- only_if_newer = 1;
- break;
- case 'c':
- ++argv;
- /* We always copy, regardless */
- break;
- case 'v':
- ++argv;
- verbose = 1;
- break;
- case 'V':
- ++argv;
- suffix = *argv;
- ++argv;
- break;
- case 'm':
- ++argv;
- mode = *argv;
- ++argv;
- break;
- default:
- fatal( NULL );
- }
- }
-
- /* Separate source file(s) from dest directory or file */
-#if 0
- if ( !argv[0] || !argv[1] )
- fatal( "missing files or invalid destination" );
-#else
- /* We used to require at least one file; not any more */
- if ( !argv[0] )
- fatal( "missing files or invalid destination" );
- if ( !argv[1] )
- return 0;
-#endif
- for ( pp = argv; *pp; ++pp )
- continue;
- --pp;
- dest = *pp;
- *pp = NULL;
-
- /* Process the arguments */
- for (; *argv; ++argv ) {
- char * f = *argv;
- char * leaf = basename( f );
- char target[ 128 ];
-
- strcpy( target, dest );
-
- if ( is_dir( target ) ) {
- strcat( target, "/" );
- /* if we were given a suffix, then add it as appropriate */
- if ( suffix ) {
- char * dot = strchr( leaf, '.' );
- if ( dot ) {
- strncat( target, leaf, dot-leaf );
- strcat( target, suffix );
- strcat( target, dot );
- if ( verbose )
- printf( "%s: %s will be installed as %s",
- progname, f, strrchr(target,'/')+1 );
- } else {
- strcat( target, leaf );
- strcat( target, suffix );
- }
- } else {
- strcat( target, leaf );
- }
- }
-
- if ( access( f, 0 ) ) {
- char buf[200];
- sprintf( buf, "cannot read %s", f );
- fatal( buf );
- }
-
- if ( only_if_newer && is_file( target ) && !newer( f, target ) ) {
- if ( verbose )
- printf( "'%s' not newer than '%s'\n", f, target );
- continue;
- }
-
- if ( verbose )
- printf( "rm -f %s\n", target );
- if ( chmod( target, 0777 ) )
- if ( verbose )
- perror( target );
- if ( unlink( target ) )
- if ( verbose )
- perror( target );
- if ( verbose )
- printf( "cp -p %s %s\n", f, target );
- if ( filecopy( target, f, 1 ) )
- return 1;
- if ( mode ) {
- char buf[ 255 ];
- sprintf( buf, "chmod %s %s\n", mode, target );
- if ( verbose )
- printf( "%s\n", buf );
- system( buf );
- }
- }
-
- return 0;
-}
-
diff --git a/c/build-tools/os/msdos/ifc_exe.uue b/c/build-tools/os/msdos/ifc_exe.uue
deleted file mode 100644
index cd9f52b8f0..0000000000
--- a/c/build-tools/os/msdos/ifc_exe.uue
+++ /dev/null
@@ -1,163 +0,0 @@
-#
-# $Id$
-#
-
-begin 664 ifc.exe
-M(VEN8VQU9&4@/'-T9&EO+F@^#0HC:6YC;'5D92 \<W1R:6YG+F@^#0HC:6YC
-M;'5D92 \<')O8V5S<RYH/@T*#0HC:6YC;'5D92 \:6\N:#X-"@T*=F]I9" J
-M('AM86QL;V,H(&EN="!S:7IE("D-"GL-"B @("!V;VED("H@<" ]("AV;VED
-M("HI;6%L;&]C*"!S:7IE("D[#0H@(" @:68@*" A<" I("![#0H)9G!R:6YT
-M9B@@<W1D97)R+" B;W5T(&]F(&UE;6]R>5QN(B I.PT*"65X:70H(#$@*3L-
-M"B @("!]#0H@(" @<F5T=7)N(' [#0I]#0IV;VED("H@>')E86QL;V,H('9O
-M:60@*B!O;&0L(&EN="!S:7IE("D-"GL-"B @("!V;VED("H@<" ]("AV;VED
-M("HI<F5A;&QO8R@@;VQD+"!S:7IE("D[#0H@(" @:68@*" A<" I("![#0H)
-M9G!R:6YT9B@@<W1D97)R+" B;W5T(&]F(&UE;6]R>5QN(B I.PT*"65X:70H
-M(#$@*3L-"B @("!]#0H@(" @<F5T=7)N(' [#0I]#0H-"F-H87(@*BH@87)G
-M=E]F:7@H(&EN=" J(&%R9V,L(&-H87(@*BH@87)G=B I#0I[#0H@(" @8VAA
-M<B J*B!N97<@/2!.54Q,.PT*(" @(&EN=" @(" @;6%X(#T@,C [#0H@(" @
-M:6YT"2 @("!C;G0@/2 P.PT*(" @(&EN= D@(" @:CL-"@T*(" @(&9O<B H
-M(&H@/2 Q.R!A<F=V6VI=.R K*VH@*0T*"6EF("@@87)G=EMJ75LP72 ]/2 G
-M0"<@)B8@86-C97-S*&%R9W9;:ETK,2PP*3T]," I#0H)(" @(&)R96%K.PT*
-M(" @(&EF("@@87)G=EMJ72 ]/2!.54Q,("D-"@ER971U<FX@87)G=CL-"@T*
-M(" @(&YE=R ]("AC:&%R("HJ*7AM86QL;V,H(&UA>" J('-I>F5O9B J;F5W
-M("D[#0H@(" @;F5W6V-N="LK72 ]("IA<F=V*RL[#0H@(" @9F]R("@@.R J
-M87)G=CL@*RMA<F=V("D@('L-"@EI9B H(&-N=" ^/2!M87@@*0T*"2 @("!N
-M97<@/2 H8VAA<B J*BER96%L;&]C*"!N97<L("AM87@J/3(I("H@<VEZ96]F
-M("IN97<@*3L-"@D@(" @#0H):68@*"!A<F=V6S!=6S!=("$]("= )R!\?"!A
-M8V-E<W,H87)G=ELP72LQ+# I("D@('L-"@D@(" @;F5W6V-N="LK72 ]("IA
-M<F=V.PT*"7T@96QS92![#0H)(" @(&-H87(@;&EN95L@,3 P,"!=.PT*"2 @
-M("!&24Q%("H@9B ](&9O<&5N*"!A<F=V6S!=*S$L(")R(B I.PT*"2 @("!I
-M9B H("%F("D@('L-"@D)<&5R<F]R*"!A<F=V6S!=*S$@*3L-"@D)97AI="@@
-M,B I.PT*"2 @("!]#0H)(" @('=H:6QE("@@9F=E=',H(&QI;F4L('-I>F5O
-M9B!L:6YE+"!F("D@*2 @>PT*"0EI;G0@;&5N(#T@<W1R;&5N*"!L:6YE("D[
-M#0H)"2\J(&1E;&5T92!T<F%I;&EN9R!N97=L:6YE<R J+PT*"0EW:&EL92 H
-M(&QI;F5;;&5N+3%=(#T]("=<;B<@?'P@;&EN95ML96XM,5T@/3T@)UQR)R I
-M#0H)"2 @("!L:6YE6RTM;&5N72 ]("=<,"<[#0H)"6EF("@@8VYT(#X](&UA
-M>" I#0H)"2 @("!N97<@/2 H8VAA<B J*BEX<F5A;&QO8R@@;F5W+" H;6%X
-M*CTR*2 J('-I>F5O9B J;F5W("D[#0H)"6YE=UMC;G1=(#T@*&-H87(@*BEX
-M;6%L;&]C*"!L96XK,2 I.PT*"0ES=')C<'DH(&YE=UMC;G1=+"!L:6YE("D[
-M#0H)"2LK8VYT.PT*"2 @("!]#0H)(" @(&9C;&]S92@@9B I.PT*"7T)#0H@
-M(" @?0T*(" @(&EF("@@8VYT(#X](&UA>" I#0H);F5W(#T@*&-H87(@*BHI
-M>')E86QL;V,H(&YE=RP@*&UA>"LQ*2 J('-I>F5O9B J;F5W("D[#0H@(" @
-M;F5W6V-N=%T@/2!.54Q,.PT*(" @("IA<F=C(#T@8VYT.PT*(" @(')E='5R
-M;B!N97<[#0I]#0H-"@T*8V]N<W0@8VAA<B J(%5304=%(#T@#0HB=7-A9V4Z
-M("1P<F]G;F%M92!;("UC3G9M5B!=(&9I;&4@6R!F:6QE("XN+B!=(&1E<W0M
-M9&ER96-T;W)Y+6]R+69I;&5<;B(-"B(@(" @(" @("UV(" @(" @(" @("TM
-M('9E<F)O<V5<;B(-"B(@(" @(" @("U6('-U9F9I>" @("TM('-U9F9I>"!T
-M;R!A<'!E;F0@=&\@=&%R9V5T<R H8F5F;W)E(&%N>2 N('-U9F9I>"E<;B(-
-M"B(@(" @(" @(" @(" @(" @(" @(" @("!E9SH@+58@7V<@=V]U;&0@8VAA
-M;F=E("=F;V\G('1O("=F;V]?9R<@86YD7&XB#0HB(" @(" @(" @(" @(" @
-M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" G;&EB9F]O+F$G('1O
-M("=L:6)F;V]?9RYA)UQN(@T*(B @(" @(" @+6T@;6]D92 @(" @+2T@;6]D
-M92!F;W(@;F5W(&9I;&4H<RE<;B(-"B(@(" @(" @("UC(" @(" @(" @("TM
-M(&-O<'D@:6YS=&5A9"!O9B!M;W9E("AA;'=A>7,@;VXI7&XB#0HB(" @(" @
-M(" M3B @(" @(" @(" M+2!C;W!Y(&]N;'D@:68@<V]U<F-E(&ES(&YE=V5R
-M('1H86X@=&%R9V5T7&XB#0H[#0H-"G9O:60@9F%T86PH(&-H87(@*B!M<V<@
-M*0T*>PT*(" @(&EF("@@;7-G("D-"@EF<')I;G1F*"!S=&1E<G(L("(E<UQN
-M(BP@;7-G("D[#0H@(" @9G!R:6YT9B@@<W1D97)R+" B)7,B+"!54T%'12 I
-M.PT*(" @(&5X:70H(#$@*3L-"GT-"@T*8VAA<B J(&)A<V5N86UE*"!C:&%R
-M("H@9B I#0I[#0H@(" @8VAA<B J(&(@/2!S=')R8VAR*"!F+" G+R<@*3L-
-M"B @("!I9B H(&(@*0DK*V([#0H@(" @96QS90EB(#T@9CL-"B @("!R971U
-M<FX@8CL-"GT-"@T*(VEN8VQU9&4@/'-Y<R]S=&%T+F@^#0II;G0@:7-?9&ER
-M*"!C:&%R("H@<&%T:" I#0I[#0H@(" @<W1R=6-T('-T870@8G5F.PT*(" @
-M(&EF("@@<W1A="@@<&%T:"P@)F)U9B I("D-"@ER971U<FX@,#L-"B @("!R
-M971U<FX@8G5F+G-T7VUO9&4@)B!37TE&1$E2.PT*?0T*:6YT(&ES7V9I;&4H
-M(&-H87(@*B!P871H("D-"GL-"B @("!S=')U8W0@<W1A="!B=68[#0H@(" @
-M:68@*"!S=&%T*"!P871H+" F8G5F("D@*0T*"7)E='5R;B P.PT*(" @(')E
-M='5R;B!B=68N<W1?;6]D92 F(%-?249214<[#0I]#0II;G0@;F5W97(H(&-H
-M87(@*B!P,2P@8VAA<B J(' R("D-"GL-"B @("!S=')U8W0@<W1A="!B=68Q
-M.PT*(" @('-T<G5C="!S=&%T(&)U9C([#0H@(" @:68@*"!S=&%T*"!P,2P@
-M)F)U9C$@*2 I#0H)<F5T=7)N(# [#0H@(" @:68@*"!S=&%T*"!P,BP@)F)U
-M9C(@*2 I#0H)<F5T=7)N(# [#0H@(" @<F5T=7)N(&)U9C$N<W1?;71I;64@
-M/B!B=68R+G-T7VUT:6UE.PT*?0T*#0II;G0@9FEL96-O<'DH(&-H87(@*B!D
-M+"!C:&%R("H@<RP@:6YT('!R97-E<G9E7W1I;64@*0T*>PT*(VEF(# -"B @
-M("!I;G0)"7-T871U<SL-"B @("!C:&%R(" @(" @*B!A<F=V6R U(%T[#0H@
-M(" @87)G=ELP72 ](")C<"([#0H@(" @87)G=ELQ72 ]("(M<"([#0H@(" @
-M87)G=ELR72 ](',[#0H@(" @87)G=ELS72 ](&0[#0H@(" @87)G=ELT72 ]
-M($Y53$P[#0H@(" @<W1A='5S(#T@<W!A=VYV<"@@4%]704E4+"!A<F=V6S!=
-M+"!A<F=V("D[#0H@(" @:68@*"!S=&%T=7,@*0T*"7!E<G)O<B@@(F-P(B I
-M.PT*(" @(')E='5R;B!S=&%T=7,[#0HC96QS90T*(" @($9)3$4@(" @(" J
-M(&9S.PT*(" @($9)3$4@(" @(" J(&9D.PT*(" @(&-H87()8G5F9F5R6R X
-M,3DR(%T[#0H@(" @:6YT"0EN.PT*(" @('-T<G5C="!F=&EM90E7:&5N.PT*
-M(" @('-T<G5C="!S=&%T"0E3=&%T.PT*#0H@(" @9G,@/2!F;W!E;B@@<RP@
-M(G)B(B I.PT*(" @(&EF("@@9G,@/3T@3E5,3" I("![#0H)<&5R<F]R*"!S
-M("D[#0H)<F5T=7)N(#$[#0H@(" @?0T*(" @(&9D(#T@9F]P96XH(&0L(")W
-M8B(@*3L-"B @("!I9B H(&9D(#T]($Y53$P@*2 @>PT*"7!E<G)O<B@@9" I
-M.PT*"69C;&]S92@@9G,@*3L-"@ER971U<FX@,CL-"B @("!]#0H-"B @("!I
-M9B H('!R97-E<G9E7W1I;64@*0T*"6EF("@@9V5T9G1I;64H(&9I;&5N;RAF
-M<RDL("97:&5N("D@*2 @>PT*"2 @("!P97)R;W(H(',@*3L-"@D@(" @<')E
-M<V5R=F5?=&EM92 ](# [#0H)?0T*#0H@(" @9&\@>PT*"6X@/2!F<F5A9"@@
-M8G5F9F5R+" Q+"!S:7IE;V8@8G5F9F5R+"!F<R I.PT*"6EF("@@;B ^(# @
-M*0T*"2 @("!I9B H(&9W<FET92@@8G5F9F5R+" Q+"!N+"!F9" I(#P@," I
-M("![#0H)"7!E<G)O<B@@9" I.PT*"0ER971U<FX@,SL-"@D@(" @?0T*(" @
-M('T@=VAI;&4@*"!N(#X@," I.R @(" -"@T*(" @(&9C;&]S92@@9G,@*3L-
-M"@T*(" @("\J($9I>"!T:6UE('-T86UP("HO#0H@(" @:68@*"!P<F5S97)V
-M95]T:6UE("D-"@EI9B H('-E=&9T:6UE*"!F:6QE;F\H9F0I+" F5VAE;B I
-M("D@('L-"@D@(" @<&5R<F]R*"!S("D[#0H)(" @('!R97-E<G9E7W1I;64@
-M/2 P.PT*"7T-"B @("!F8VQO<V4H(&9D("D[#0H-"B @(" O*B!&:7@@86-C
-M97-S(')I9VAT<R J+PT*(" @(&EF("@@<W1A="@@<RP@)E-T870@*2 I#0H)
-M<&5R<F]R*"!S("D[#0H@(" @96QS92!I9B H(&-H;6]D*"!D+"!3=&%T+G-T
-M7VUO9&4@*2 I#0H)<&5R<F]R*"!D("D[#0H-"B @("!R971U<FX@,#L-"B-E
-M;F1I9@T*?0T*#0H-"@T*#0H-"FEN="!M86EN*"!I;G0@87)G8RP@8VAA<B J
-M(&%R9W9;72 I#0I[#0H@(" @8VAA<B J"7!R;V=N86UE.PT*(" @(&EN= D)
-M=F5R8F]S92 ](# [#0H@(" @:6YT"0EO;FQY7VEF7VYE=V5R/2 P.PT*(" @
-M(&-H87(@*@ES=69F:7@@(#T@3E5,3#L-"B @("!C:&%R("H);6]D90D]($Y5
-M3$P[#0H@(" @8VAA<B J( ED97-T.PT*(" @(&-H87(@*BH)<' [#0H-"B @
-M("!A<F=V(#T@87)G=E]F:7@H("9A<F=C+"!A<F=V("D[#0H-"B @("!P<F]G
-M;F%M92 ](&)A<V5N86UE*" J87)G=BLK("D[#0H-"B @(" O*B!P<F]C97-S
-M('1H92!O<'1I;VYS("HO#0H@(" @=VAI;&4@*"!A<F=V6S!=(" F)B @87)G
-M=ELP75LP72 ]/2 G+2<@*2 @>PT*"7-W:71C:" H(&%R9W9;,%U;,5T@*2 @
-M>PT*"2 @("!C87-E("=.)SH-"@D@(" @(" @("LK87)G=CL-"@D);VYL>5]I
-M9E]N97=E<B ](#$[#0H)"6)R96%K.PT*"2 @("!C87-E("=C)SH-"@D@(" @
-M(" @("LK87)G=CL-"@D)+RH@5V4@86QW87ES(&-O<'DL(')E9V%R9&QE<W,@
-M*B\-"@D)8G)E86L[#0H)(" @(&-A<V4@)W8G.@T*"0DK*V%R9W8[#0H)"79E
-M<F)O<V4@/2 Q.PT*"0EB<F5A:SL-"@D@(" @8V%S92 G5B<Z#0H)"2LK87)G
-M=CL-"@D)<W5F9FEX(#T@*F%R9W8[#0H)"2LK87)G=CL-"@D)8G)E86L[#0H)
-M(" @(&-A<V4@)VTG.@T*"0DK*V%R9W8[#0H)"6UO9&4@/2 J87)G=CL-"@D)
-M*RMA<F=V.PT*"0EB<F5A:SL-"@D@(" @9&5F875L=#H-"@D)9F%T86PH($Y5
-M3$P@*3L-"@E]#0H@(" @?0T*#0H@(" @+RH@4V5P87)A=&4@<V]U<F-E(&9I
-M;&4H<RD@9G)O;2!D97-T(&1I<F5C=&]R>2!O<B!F:6QE("HO#0HC:68@, T*
-M(" @(&EF("@@(6%R9W9;,%T@?'P@(6%R9W9;,5T@*0T*"69A=&%L*" B;6ES
-M<VEN9R!F:6QE<R!O<B!I;G9A;&ED(&1E<W1I;F%T:6]N(B I.PT*(V5L<V4-
-M"B @(" O*B!792!U<V5D('1O(')E<75I<F4@870@;&5A<W0@;VYE(&9I;&4[
-M(&YO="!A;GD@;6]R92 J+PT*(" @(&EF("@@(6%R9W9;,%T@*0T*"69A=&%L
-M*" B;6ES<VEN9R!F:6QE<R!O<B!I;G9A;&ED(&1E<W1I;F%T:6]N(B I.PT*
-M(" @(&EF("@@(6%R9W9;,5T@*0T*"7)E='5R;B P.PT*(V5N9&EF#0H@(" @
-M9F]R("@@<' @/2!A<F=V.R J<' [("LK<' @*0T*"6-O;G1I;G5E.PT*(" @
-M("TM<' [#0H@(" @9&5S=" ]("IP<#L-"B @(" J<' @/2!.54Q,.PT*#0H@
-M(" @+RH@4')O8V5S<R!T:&4@87)G=6UE;G1S("HO#0H@(" @9F]R("@[("IA
-M<F=V.R K*V%R9W8@*2 @>PT*"6-H87(@*B!F(#T@*F%R9W8[#0H)8VAA<B J
-M(&QE868@/2!B87-E;F%M92@@9B I.PT*"6-H87(@=&%R9V5T6R Q,C@@73L-
-M"@T*"7-T<F-P>2@@=&%R9V5T+"!D97-T("D[#0H-"@EI9B H(&ES7V1I<B@@
-M=&%R9V5T("D@*2 @>PT*"2 @("!S=')C870H('1A<F=E="P@(B\B("D[#0H)
-M(" @("\J(&EF('=E('=E<F4@9VEV96X@82!S=69F:7@L('1H96X@861D(&ET
-M(&%S(&%P<')O<')I871E("HO#0H)(" @(&EF("@@<W5F9FEX("D@('L-"@D)
-M8VAA<B J(&1O=" ]('-T<F-H<B@@;&5A9BP@)RXG("D[#0H)"6EF("@@9&]T
-M("D@('L-"@D)(" @('-T<FYC870H('1A<F=E="P@;&5A9BP@9&]T+6QE868@
-M*3L-"@D)(" @('-T<F-A="@@=&%R9V5T+"!S=69F:7@@*3L-"@D)(" @('-T
-M<F-A="@@=&%R9V5T+"!D;W0@*3L-"@D)(" @(&EF("@@=F5R8F]S92 I#0H)
-M"0EP<FEN=&8H("(E<SH@)7,@=VEL;"!B92!I;G-T86QL960@87,@)7,B+ T*
-M"0D)(" @(" @('!R;V=N86UE+"!F+"!S=')R8VAR*'1A<F=E="PG+R<I*S$@
-M*3L-"@D)?2!E;'-E('L-"@D)(" @('-T<F-A="@@=&%R9V5T+"!L96%F("D[
-M#0H)"2 @("!S=')C870H('1A<F=E="P@<W5F9FEX("D[#0H)"7T-"@D@(" @
-M?2!E;'-E('L-"@D)<W1R8V%T*"!T87)G970L(&QE868@*3L-"@D@(" @?0T*
-M"7T-"@T*"6EF("@@86-C97-S*"!F+" P("D@*2 @>PT*"2 @("!C:&%R(&)U
-M9ELR,#!=.PT*"2 @("!S<')I;G1F*"!B=68L(")C86YN;W0@<F5A9" E<R(L
-M(&8@*3L-"@D@(" @9F%T86PH(&)U9B I.PT*"7T-"@T*"6EF("@@;VYL>5]I
-M9E]N97=E<B F)B!I<U]F:6QE*"!T87)G970@*2 F)B A;F5W97(H(&8L('1A
-M<F=E=" I("D@('L-"@D@(" @:68@*"!V97)B;W-E("D-"@D)<')I;G1F*" B
-M)R5S)R!N;W0@;F5W97(@=&AA;B G)7,G7&XB+"!F+"!T87)G970@*3L-"@D@
-M(" @8V]N=&EN=64[#0H)?0T*#0H):68@*"!V97)B;W-E("D-"@D@(" @<')I
-M;G1F*" B<FT@+68@)7-<;B(L('1A<F=E=" I.PT*"6EF("@@8VAM;V0H('1A
-M<F=E="P@,#<W-R I("D-"@D@(" @:68@*"!V97)B;W-E("D-"@D)<&5R<F]R
-M*"!T87)G970@*3L-"@EI9B H('5N;&EN:R@@=&%R9V5T("D@*0T*"2 @("!I
-M9B H('9E<F)O<V4@*0T*"0EP97)R;W(H('1A<F=E=" I.PT*"6EF("@@=F5R
-M8F]S92 I#0H)(" @('!R:6YT9B@@(F-P("UP("5S("5S7&XB+"!F+"!T87)G
-M970@*3L-"@EI9B H(&9I;&5C;W!Y*"!T87)G970L(&8L(#$@*2 I#0H)(" @
-M(')E='5R;B Q.PT*"6EF("@@;6]D92 I("![#0H)(" @(&-H87(@8G5F6R R
-M-34@73L-"@D@(" @<W!R:6YT9B@@8G5F+" B8VAM;V0@)7,@)7-<;B(L(&UO
-M9&4L('1A<F=E=" I.PT*"2 @("!I9B H('9E<F)O<V4@*0T*"0EP<FEN=&8H
-M("(E<UQN(BP@8G5F("D[#0H)(" @('-Y<W1E;2@@8G5F("D[#0H)?0T*(" @
-:('T-"@T*(" @(')E='5R;B P.PT*?0T*#0IE
-
-end
diff --git a/c/build-tools/packhex.c b/c/build-tools/packhex.c
deleted file mode 100644
index 3b85a7c927..0000000000
--- a/c/build-tools/packhex.c
+++ /dev/null
@@ -1,565 +0,0 @@
-
-/***** P A C K H E X . C ************************************************
- *
- * Packhex is a hex-file compaction utility. It attempts to concatenate
- * hex records to produce more size-efficient packaging.
- *
- * Limitations: Input files must be correctly formatted. This utility
- * is not robust enough to detect hex-record formatting
- * errors.
- *
- * Published: May 1993 Embedded Systems Programming magazine
- * "Creating Faster Hex Files"
- *
- * URL: ESP magazine: http://www.embedded.com
- * Source Code: ftp://ftp.mfi.com/pub/espmag/1993/pakhex.zip
- *
- * Author: Mark Gringrich
- *
- * Compiler: Microsoft C 6.0
- * cl /F 1000 packhex.c
- *
- *
- * $Id$
- *
- **************************************************************************/
-
-
-/* #define SMALLER_RECORDS */
-#ifdef SMALLER_RECORDS
-#define MAX_LEN_S1_RECS 128
-#define MAX_LEN_S2_RECS 128
-#define MAX_LEN_S3_RECS 128
-#else
-#define MAX_LEN_S1_RECS 252
-#define MAX_LEN_S2_RECS 251
-#define MAX_LEN_S3_RECS 250
-#endif
-
-
-/*--------------------------------- includes ---------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-#if defined(__unix__) && !defined(EXIT_FAILURE)
-#define EXIT_FAILURE -1
-#define EXIT_SUCCESS 0
-#endif
-
-/*--------------------------------- defines ----------------------------------*/
-
-#define YES 1
-#define MAX_LINE_SIZE 600
-#define EOS '\0'
-
-
-/*---------------------------------- macros ----------------------------------*/
-
-/* Convert ASCII hexadecimal digit to value. */
-
-#define HEX_DIGIT( C ) ( ( ( ( C ) > '9' ) ? ( C ) + 25 : ( C ) ) & 0xF )
-
-
-/*--------------------------------- typedefs ---------------------------------*/
-
-typedef unsigned char Boolean;
-typedef unsigned char Uchar;
-typedef unsigned int Uint;
-typedef unsigned long Ulong;
-
-typedef struct /* Functions and constant returning Hex-record vital stats. */
-{
- Boolean ( *is_data_record )( char * );
- Ulong ( *get_address )( char * );
- Uint ( *get_data_count )( char * );
- const Uint max_data_count;
- char *( *get_data_start )( char * );
- void ( *put_data_record )( Uint, Ulong, char * );
-} Rec_vitals;
-
-
-/*--------------------------- function prototypes ----------------------------*/
-
-Rec_vitals * identify_first_data_record( char *, int );
-Ulong get_ndigit_hex( char *, int );
-
-
-/*----------------------------- Intel Hex format -----------------------------*/
-
-/*
- * Intel Hex data-record layout
- *
- * :aabbbbccd...dee
- *
- * : - header character
- * aa - record data byte count, a 2-digit hex value
- * bbbb - record address, a 4-digit hex value
- * cc - record type, a 2-digit hex value:
- * "00" is a data record
- * "01" is an end-of-data record
- * "02" is an extended-address record
- * "03" is a start record
- * d...d - data (always an even number of chars)
- * ee - record checksum, a 2-digit hex value
- * checksum = 2's complement
- * [ (sum of bytes: aabbbbccd...d) modulo 256 ]
- */
-
-
-Boolean is_intel_data_rec( char * rec_str )
-{
- return( ( rec_str[ 0 ] == ':' ) && ( rec_str[ 8 ] == '0' ) );
-}
-
-Uint get_intel_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 1, 2 ) );
-}
-
-Ulong get_intel_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 3, 4 ) );
-}
-
-char * get_intel_rec_data_start( char * rec_str )
-{
- return( rec_str + 9 );
-}
-
-void put_intel_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = count + ( address >> 8 & 0xff ) + ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- ":%02X%04lX00%s%02X\n", count, address, data_str, (~sum + 1) & 0xff
- );
-}
-
-
-Rec_vitals intel_hex =
-{
- is_intel_data_rec,
- get_intel_rec_address,
- get_intel_rec_data_count,
- 255, /* Maximum data bytes in a record. */
- get_intel_rec_data_start,
- put_intel_data_rec
-};
-
-
-/*------------------------- Motorola S1-record format ------------------------*/
-
-/*
- * Motorola S-record data-record layout
- *
- * Sabbc...cd...dee
- *
- * S - header character
- * a - record type, a 1-digit value:
- * "0" is a header record
- * "1" is a 2-byte-address data record
- * "2" is a 3-byte-address data record
- * "3" is a 4-byte-address data record
- * "7" is a 4-byte-address end-of-data record
- * "8" is a 3-byte-address end-of-data record
- * "9" is a 2-byte-address end-of-data record
- * bb - record length in bytes, a 2-digit hex value
- * (record length doesn't count the header/type
- * chars and checksum byte)
- * c...c - record address, a 4-, 6-, or 8-digit value,
- * depending on record type
- * d...d - data (always an even number of chars)
- * ee - record checksum, a 2-digit hex value
- * checksum = 1's complement
- * [ (sum of all bytes: bbc..cd...d) modulo 256 ]
- */
-
-#define S1_COUNT_OFFSET 3
-
-
-Boolean is_moto_s1_data_rec( char * rec_str )
-{
- return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '1' ) );
-}
-
-Uint get_moto_s1_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S1_COUNT_OFFSET );
-}
-
-Ulong get_moto_s1_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 4, 4 ) );
-}
-
-char * get_moto_s1_rec_data_start( char * rec_str )
-{
- return( rec_str + 8 );
-}
-
-void put_moto_s1_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = S1_COUNT_OFFSET + count +
- ( address >> 8 & 0xff ) + ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- "S1%02X%04lX%s%02X\n",
- count + S1_COUNT_OFFSET, address, data_str, ~sum & 0xff
- );
-}
-
-
-Rec_vitals motorola_s1_rec =
-{
- is_moto_s1_data_rec,
- get_moto_s1_rec_address,
- get_moto_s1_rec_data_count,
- MAX_LEN_S1_RECS, /* Maximum data bytes in a record. */
- get_moto_s1_rec_data_start,
- put_moto_s1_data_rec
-};
-
-
-/*------------------------- Motorola S2-record format ------------------------*/
-
-#define S2_COUNT_OFFSET 4
-
-Boolean is_moto_s2_data_rec( char * rec_str )
-{
- return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '2' ) );
-}
-
-Uint get_moto_s2_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S2_COUNT_OFFSET );
-}
-
-Ulong get_moto_s2_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 4, 6 ) );
-}
-
-char * get_moto_s2_rec_data_start( char * rec_str )
-{
- return( rec_str + 10 );
-}
-
-void put_moto_s2_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = S2_COUNT_OFFSET + count + ( address >> 16 & 0xff ) +
- ( address >> 8 & 0xff ) +
- ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- "S2%02X%06lX%s%02X\n",
- count + S2_COUNT_OFFSET, address, data_str, ~sum & 0xff
- );
-}
-
-
-Rec_vitals motorola_s2_rec =
-{
- is_moto_s2_data_rec,
- get_moto_s2_rec_address,
- get_moto_s2_rec_data_count,
- MAX_LEN_S2_RECS, /* Maximum data bytes in a record. */
- get_moto_s2_rec_data_start,
- put_moto_s2_data_rec
-};
-
-
-/*------------------------- Motorola S3-record format ------------------------*/
-
-#define S3_COUNT_OFFSET 5
-
-Boolean is_moto_s3_data_rec( char * rec_str )
-{
- return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '3' ) );
-}
-
-Uint get_moto_s3_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S3_COUNT_OFFSET );
-}
-
-Ulong get_moto_s3_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 4, 8 ) );
-}
-
-char * get_moto_s3_rec_data_start( char * rec_str )
-{
- return( rec_str + 12 );
-}
-
-void put_moto_s3_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = S3_COUNT_OFFSET + count + ( address >> 24 & 0xff ) +
- ( address >> 16 & 0xff ) +
- ( address >> 8 & 0xff ) +
- ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- "S3%02X%08lX%s%02X\n",
- count + S3_COUNT_OFFSET, address, data_str, ~sum & 0xff
- );
-}
-
-
-Rec_vitals motorola_s3_rec =
-{
- is_moto_s3_data_rec,
- get_moto_s3_rec_address,
- get_moto_s3_rec_data_count,
- MAX_LEN_S3_RECS, /* Maximum data bytes in a record. */
- get_moto_s3_rec_data_start,
- put_moto_s3_data_rec
-};
-
-
-/*-------------------- Put your favorite hex format here ---------------------*/
-
-/*
- * * * * The following is a template for an additional hex format: * * *
- *
- *
- * Boolean is_X_data_rec( char * rec_str ) {}
- *
- * Uint get_X_rec_data_count( char * rec_str ) {}
- *
- * Ulong get_X_rec_address( char * rec_str ) {}
- *
- * char * get_X_rec_data_start( char * rec_str ) {}
- *
- * void put_X_data_rec( Uint count, Ulong address, char * data_str ) {}
- *
- * Rec_vitals X_rec =
- * {
- * is_X_data_rec,
- * get_X_rec_address,
- * get_X_rec_data_count,
- * MAXIMUM DATA BYTES IN A RECORD,
- * get_X_rec_data_start,
- * put_X_data_rec
- * };
- *
- */
-
-/*----------------------------------------------------------------------------*/
-
-
-/*
- * Put address of additional Rec_vitals structures
- * in this array, before the NULL entry.
- */
-
-Rec_vitals *formats[] =
-{
- &intel_hex,
- &motorola_s1_rec,
- &motorola_s2_rec,
- &motorola_s3_rec,
- ( Rec_vitals * ) NULL
-};
-
-
-/**** main *****************************************************************
-*
-*
-* Expects: Nothing (no command-line parameters).
-*
-* Returns: Exit status (EXIT_SUCCESS or EXIT_FAILURE).
-*
-* Reads hex records on the standard input and attempts to
-* splice adjacent data fields together. Results appear on
-* the standard output.
-*
-*******************************************************************************/
-
-int main(
- int argc,
- char **argv
-)
-{
-
- char inbuff[ MAX_LINE_SIZE ], outbuff[ MAX_LINE_SIZE ];
- char *in_dptr, *out_dptr;
- int d_total, d_count, d_excess, n;
- int length;
- Ulong in_rec_addr, out_rec_addr = 0;
- Rec_vitals *rptr;
-
-
- /* Sift through file until first hex record is identified. */
-
- rptr = identify_first_data_record( inbuff, MAX_LINE_SIZE );
- if ( rptr == NULL )
- {
- fputs( "No hex records found.\n", stderr );
- exit( EXIT_FAILURE );
- }
-
-
- /* Attempt data-record splicing until end-of-file is reached. */
- d_total = 0;
- for (;;) {
- if ( rptr->is_data_record( inbuff ) == YES )
- { /* Input record is a data record. */
- d_count = rptr->get_data_count( inbuff );
- in_rec_addr = rptr->get_address( inbuff );
- in_dptr = rptr->get_data_start( inbuff );
-
- if ( d_total == 0 || in_rec_addr != out_rec_addr + d_total )
- { /* Begin a new output record. */
- if ( d_total != 0 )
- rptr->put_data_record( d_total, out_rec_addr, outbuff );
- out_dptr = outbuff;
- n = d_total = d_count;
- out_rec_addr = in_rec_addr;
- }
- else if
- ( ( d_excess = d_total + d_count - rptr->max_data_count ) > 0 )
- { /* Output a maximum-length record, then start a new record. */
- strncat( outbuff, in_dptr, 2 * ( d_count - d_excess ) );
- rptr->put_data_record(
- rptr->max_data_count, out_rec_addr, outbuff
- );
- in_dptr += 2 * ( d_count - d_excess );
- out_dptr = outbuff;
- n = d_total = d_excess;
- out_rec_addr += rptr->max_data_count;
- }
- else
- { /* Append input record's data field with accumulated data. */
- out_dptr = outbuff + ( 2 * d_total );
- d_total += n = d_count;
- }
- strncpy( out_dptr, in_dptr, 2 * n );
- out_dptr[ 2 * n ] = EOS;
- }
- else
- { /* Not a data record;
- * flush accumulated data then echo non-data record.
- */
- if ( d_total != 0 )
- {
- rptr->put_data_record( d_total, out_rec_addr, outbuff );
- d_total = 0;
- }
- puts( inbuff );
- }
-
- inbuff[ MAX_LINE_SIZE - 1 ] = '\0';
- if ( !fgets( inbuff, MAX_LINE_SIZE, stdin ) )
- break;
- if ( inbuff[ MAX_LINE_SIZE - 1 ] ) {
- fprintf( stderr, "Input line too long" );
- exit( 1 );
- }
- length = strlen(inbuff);
- inbuff[length - 1] = '\0';
-
- }
-
-
- return ( EXIT_SUCCESS );
-
-}
-
-
-/**** identify_first_data_record *******************************************
-*
-* Expects: Pointer to hex-record line buffer.
-*
-* Returns: Pointer to hex-record structure (NULL if no match found).
-*
-* Reads the standard input, line by line, searching for a valid
-* record header character. If a valid header is found, a pointer
-* to the hex-record's type structure is returned, otherwise NULL.
-*
-* The input-stream pointer is left pointing to the first valid hex record.
-*
-*******************************************************************************/
-
-Rec_vitals * identify_first_data_record( char * buff_ptr, int max_length )
-{
- Rec_vitals ** ptr;
- int length;
-
-
-
- for ( ;; ) {
-
- buff_ptr[ max_length - 1 ] = '\0';
- if ( !fgets( buff_ptr, max_length, stdin ) )
- break;
- if ( buff_ptr[ max_length - 1 ] ) {
- fprintf( stderr, "Input line too long" );
- exit( 1 );
- }
- length = strlen(buff_ptr);
- buff_ptr[length - 1] = '\0';
-
- for ( ptr = formats ; *ptr != ( Rec_vitals * ) NULL ; ptr++ )
- if ( ( *ptr )->is_data_record( buff_ptr ) == YES )
- return( *ptr ); /* Successful return. */
-
- puts( buff_ptr ); /* Echo non-hex-record line. */
- }
-
- return( ( Rec_vitals * ) NULL ); /* Unsuccessful return. */
-}
-
-
-/**** get_ndigit_hex *******************************************************
-*
-* Expects: Pointer to first ASCII hexadecimal digit, number of digits.
-*
-* Returns: Value of hexadecimal string as an unsigned long.
-*
-*******************************************************************************/
-
-Ulong get_ndigit_hex( char * cptr, int digits )
-{
- Ulong value;
-
- for ( value = 0 ; --digits >= 0 ; cptr++ )
- value = ( value * 16L ) + HEX_DIGIT( *cptr );
-
- return( value );
-}
diff --git a/c/build-tools/rcs-clean.in b/c/build-tools/rcs-clean.in
deleted file mode 100644
index 83fed05128..0000000000
--- a/c/build-tools/rcs-clean.in
+++ /dev/null
@@ -1,73 +0,0 @@
-#!@KSH@ -p
-#
-# $Id$
-#
-# Delete all files from the current directory that can be recreated
-# via RCS 'co' commonds
-# Used by 'make clobber'
-#
-
-progname=${0##*/} # fast basename hack for ksh, bash
-
-USAGE=\
-"usage: $progname [ -v ]"
-
-fatal() {
- if [ "$1" ]
- then
- echo $* >&2
- fi
- echo "$USAGE" 1>&2
- exit 1
-}
-
-#
-# process the options
-#
-
-verbose=""
-
-while getopts v OPT
-do
- case "$OPT" in
- v)
- verbose="yes";;
- *)
- fatal
- esac
-done
-
-let $((shiftcount = $OPTIND - 1))
-shift $shiftcount
-
-args=$*
-[ "$args" ] && fatal
-
-[ -d RCS/. ] || exit 0
-
-# there is probably a better way to do this
-
-rcs_files=`echo RCS/*,v | sed -e 's?RCS/??g' -e's/,v//g'`
-
-kills=""
-for f in $rcs_files
-do
- # build list of all files in RCS/*,v that are *not* locked
- if [ -f $f ] && [ ! -w $f ] && [ -f RCS/$f,v ]
- then
- locked=`rlog -L -R $f`
- [ "$locked" = "" ] && kills="$kills $f"
- fi
-done
-
-if [ "$kills" ]
-then
- [ "$verbose" ] && echo rm -f $kills
- rm -f $kills
-fi
-
-exit 0
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
diff --git a/c/build-tools/scripts/Makefile.in b/c/build-tools/scripts/Makefile.in
deleted file mode 100644
index 753bfafaa5..0000000000
--- a/c/build-tools/scripts/Makefile.in
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# $Id$
-#
-# RTEMS build tools
-# NOTE: of course we can't use any of these tools
-# in this Makefile. Most notably: install-if-change
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-include $(RTEMS_ROOT)/make/rtems.cfg
-
-DESTDIR=$(PROJECT_RELEASE)/build-tools
-
-BUILD_PGMS=install-if-change rcs-clean lock-directory unlock-directory
-PGMS = $(BUILD_PGMS) search-id.sh
-
-CLEAN_ADDITIONS += $(BUILD_PGMS)
-
-INSTALLED_PGMS=$(PGMS:%=$(DESTDIR)/%)
-
-all: $(DESTDIR) $(PGMS) install
-
-$(DESTDIR):
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-$(INSTALLED_PGMS): $(PGMS)
- @INSTALL@ $(INSTBINFLAGS) $^ $(DESTDIR)
-
-install: $(DESTDIR) $(INSTALLED_PGMS)
diff --git a/c/build-tools/scripts/README b/c/build-tools/scripts/README
deleted file mode 100644
index 0738a5830e..0000000000
--- a/c/build-tools/scripts/README
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# $Id$
-#
-
-Misc. support tools for RTEMS workspaces.
-More will be added later as they are converted from Teamware
-to CVS.
-
-install-if-change
- Smart install script that also can append suffixes as it
- installs (suffixes used for debug and profile variants).
- Requires bash or ksh.
-
-rcs-clean
- deletes all files from the current directory that can be
- re-created from RCS. Careful to not delete locked files.
- May be used by 'gmake clobber'
-
-lock-directory
-unlock-directory
- traverse a directory structure making it unwritable.
- Useful to keep people from accidentally overwriting
- "released" trees if they get confused about which
- module they have loaded.
diff --git a/c/build-tools/scripts/install-if-change.in b/c/build-tools/scripts/install-if-change.in
deleted file mode 100644
index b2f3cb04bb..0000000000
--- a/c/build-tools/scripts/install-if-change.in
+++ /dev/null
@@ -1,142 +0,0 @@
-#!@KSH@ -p
-#
-# Either bash or ksh will be ok for this; requires (( )) arithmetic
-# (-p above just says to not parse $ENV file; makes it faster for
-# those of us who set $ENV)
-#
-# install files if they have changed by running 'cmp', then 'install'
-# as necessary.
-#
-# Optionally, can append a suffix before last existing suffix (if any)
-#
-# NOTE
-# We avoid using typical install(1M) programs since they have
-# large variability across systems and we also need to support ou
-# -V option.
-# So we just copy and chmod by hand.
-#
-# $Id$
-#
-
-progname=`basename $0`
-#progname=${0##*/} # fast basename hack for ksh, bash
-
-USAGE=\
-"usage: $progname [ -vmV ] file [ file ... ] dest-directory-or-file
- -v -- verbose
- -V suffix -- suffix to append to targets (before any . suffix)
- eg: -V _g would change 'foo' to 'foo_g' and
- 'libfoo.a' to 'libfoo_g.a'
- -m mode -- mode for new file(s)"
-
-fatal() {
- if [ "$1" ]
- then
- echo $* >&2
- fi
- echo "$USAGE" 1>&2
- exit 1
-}
-
-#
-# process the options
-#
-
-verbose=""
-suffix=""
-mode=""
-
-while getopts vm:V: OPT
-do
- case "$OPT" in
- v)
- verbose="yes";;
- V)
- eval suffix=$OPTARG;;
- m)
- mode="$OPTARG";;
- *)
- fatal
- esac
-done
-
-shiftcount=`expr $OPTIND - 1`
-shift $shiftcount
-
-args=$*
-
-#
-# Separate source file(s) from dest directory or file
-#
-
-files=""
-dest=""
-for d in $args
-do
- files="$files $dest"
- dest=$d
-done
-
-if [ ! "$files" ] || [ ! "$dest" ]
-then
- fatal "missing files or invalid destination"
-fi
-
-#
-# Process the arguments
-#
-
-targets=""
-for f in $files
-do
- # leaf=`basename $f`
- leaf=${f##*/} # fast basename hack for ksh, bash
-
- target=$dest
- if [ -d $dest ]
- then
- # if we were given a suffix, then add it as appropriate
- if [ "$suffix" ]
- then
- case $f in
- *.*)
- # leaf=`echo $leaf |
- # /bin/sed "s/\([~\.]*\)\.\(.*\)$/\1$suffix.\2/"`
- # ksh,bash hack for above sed script
- leaf=${leaf%%.*}$suffix.${leaf#*.}
-
- [ "$verbose" = "yes" ] &&
- echo "$progname: $f will be installed as $leaf"
- ;;
- *)
- leaf=$leaf$suffix;;
- esac
- fi
- target=$target/$leaf
- fi
-
- [ ! -r $f ] && fatal "can not read $f"
-
- if cmp -s $f $target
- then
- [ "$verbose" = "yes" ] && echo "'$f' not newer than '$target'"
- else
- [ "$verbose" = "yes" ] && echo "rm -f $target"
- rm -f $target
- echo "cp -p $f $target"
- cp -p $f $target || exit 1
- targets="$targets $target" # keep list for chmod below
- fi
-done
-
-if [ "$mode" -a "$targets" ]
-then
- [ "$verbose" = "yes" ] && echo "chmod $mode $targets"
- chmod $mode $targets
-fi
-
-exit 0
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
diff --git a/c/build-tools/scripts/lock-directory.in b/c/build-tools/scripts/lock-directory.in
deleted file mode 100644
index 1c205cdec0..0000000000
--- a/c/build-tools/scripts/lock-directory.in
+++ /dev/null
@@ -1,43 +0,0 @@
-#!@KSH@
-#
-# $Id$
-#
-# Make a directory write protected
-# Used to write protect the install point after a build
-# to prevent inadvertant overwriting.
-#
-
-# is a particular command available on this machine?
-#
-cmd_avail()
-{
- set -- `type $1 2>&1`
- if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ]
- then
- return 1
- else
- return 0
- fi
-}
-
-lock_directory() {
- l_dir=$1/. # get any symlink out of the way using '.'
- if [ -d $l_dir ]
- then
- find $l_dir -type d -perm -0200 -print | $XARGS chmod -w
- fi
-}
-
-# Use gnu xargs if available; faster, more reliable in general
-XARGS=xargs
-cmd_avail gxargs && XARGS=gxargs
-
-for dir
-do
- lock_directory $dir
-done
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
-
diff --git a/c/build-tools/scripts/rcs-clean.in b/c/build-tools/scripts/rcs-clean.in
deleted file mode 100644
index 83fed05128..0000000000
--- a/c/build-tools/scripts/rcs-clean.in
+++ /dev/null
@@ -1,73 +0,0 @@
-#!@KSH@ -p
-#
-# $Id$
-#
-# Delete all files from the current directory that can be recreated
-# via RCS 'co' commonds
-# Used by 'make clobber'
-#
-
-progname=${0##*/} # fast basename hack for ksh, bash
-
-USAGE=\
-"usage: $progname [ -v ]"
-
-fatal() {
- if [ "$1" ]
- then
- echo $* >&2
- fi
- echo "$USAGE" 1>&2
- exit 1
-}
-
-#
-# process the options
-#
-
-verbose=""
-
-while getopts v OPT
-do
- case "$OPT" in
- v)
- verbose="yes";;
- *)
- fatal
- esac
-done
-
-let $((shiftcount = $OPTIND - 1))
-shift $shiftcount
-
-args=$*
-[ "$args" ] && fatal
-
-[ -d RCS/. ] || exit 0
-
-# there is probably a better way to do this
-
-rcs_files=`echo RCS/*,v | sed -e 's?RCS/??g' -e's/,v//g'`
-
-kills=""
-for f in $rcs_files
-do
- # build list of all files in RCS/*,v that are *not* locked
- if [ -f $f ] && [ ! -w $f ] && [ -f RCS/$f,v ]
- then
- locked=`rlog -L -R $f`
- [ "$locked" = "" ] && kills="$kills $f"
- fi
-done
-
-if [ "$kills" ]
-then
- [ "$verbose" ] && echo rm -f $kills
- rm -f $kills
-fi
-
-exit 0
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
diff --git a/c/build-tools/scripts/search-id.sh b/c/build-tools/scripts/search-id.sh
deleted file mode 100644
index a94d2d7cc9..0000000000
--- a/c/build-tools/scripts/search-id.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-# $Id$
-#
-
-find $1 -type f -a ! -name "*.scn" -a ! -name "bsp_specs" -a \
- -print > /tmp/$$.0
-find $1 -type f -a ! -name "*.scn" -a ! -name "bsp_specs" -a \
- -exec grep -l '$Id' {} \; > /tmp/$$.1
-
-diff /tmp/$$.0 /tmp/$$.1 > /tmp/$$.2
-
-grep "<" /tmp/$$.2 | sed 's/< //' >&1
-
-rm -f /tmp/$$*
diff --git a/c/build-tools/scripts/unlock-directory.in b/c/build-tools/scripts/unlock-directory.in
deleted file mode 100644
index c63ceff881..0000000000
--- a/c/build-tools/scripts/unlock-directory.in
+++ /dev/null
@@ -1,41 +0,0 @@
-#!@KSH@
-#
-# $Id$
-#
-# Unlock a directory processed by lock_directory
-#
-
-# is a particular command available on this machine?
-#
-cmd_avail()
-{
- set -- `type $1 2>&1`
- if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ]
- then
- return 1
- else
- return 0
- fi
-}
-
-unlock_directory() {
- ul_dir=$1/. # get any symlink out of the way using '.'
- if [ -d $ul_dir ]
- then
- find $ul_dir -type d ! -perm -0222 -print | $XARGS -t chmod +w
- fi
-}
-
-# Use gnu xargs if available; faster, more reliable in general
-XARGS=xargs
-cmd_avail gxargs && XARGS=gxargs
-
-for dir
-do
- unlock_directory $dir
-done
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
-
diff --git a/c/build-tools/search-id.sh b/c/build-tools/search-id.sh
deleted file mode 100644
index a94d2d7cc9..0000000000
--- a/c/build-tools/search-id.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-# $Id$
-#
-
-find $1 -type f -a ! -name "*.scn" -a ! -name "bsp_specs" -a \
- -print > /tmp/$$.0
-find $1 -type f -a ! -name "*.scn" -a ! -name "bsp_specs" -a \
- -exec grep -l '$Id' {} \; > /tmp/$$.1
-
-diff /tmp/$$.0 /tmp/$$.1 > /tmp/$$.2
-
-grep "<" /tmp/$$.2 | sed 's/< //' >&1
-
-rm -f /tmp/$$*
diff --git a/c/build-tools/src/Makefile.in b/c/build-tools/src/Makefile.in
deleted file mode 100644
index 52942d909f..0000000000
--- a/c/build-tools/src/Makefile.in
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
-includedir = @includedir@
-manext = 1
-mandir = @mandir@/man$(manext)
-
-# FIXME: $EXEEXT should be set in a central cfg-file used for native
-# compiling (e.g. gcc.cfg) instead of setting EXEEXE here.
-EXEEXT=@EXEEXT@
-
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# we use host compiler in this directory
-USE_HOST_COMPILER=yes
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=cklength eolstrip packhex unhex
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=$(ARCH)/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-# FIXME: building into $(ARCH) doesn't make sense for host programs
-PGMS=$(ARCH)/cklength$(EXEEXT) $(ARCH)/eolstrip$(EXEEXT) \
- $(ARCH)/packhex$(EXEEXT) $(ARCH)/unhex$(EXEEXT)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(HOST_ARCH)
-CLOBBER_ADDITIONS +=
-
-DESTDIR=${PROJECT_RELEASE}/build-tools
-
-$(DESTDIR):
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-all: $(ARCH) $(DESTDIR) $(SRCS) $(PGMS)
- @INSTALL@ $(INSTBINFLAGS) $(PGMS) $(DESTDIR)
diff --git a/c/build-tools/src/cklength.c b/c/build-tools/src/cklength.c
deleted file mode 100644
index 624bf25e70..0000000000
--- a/c/build-tools/src/cklength.c
+++ /dev/null
@@ -1,377 +0,0 @@
-/*
- * cklength - check the length of lines in a file
- *
- * This program check to see if the files passed to it on the command line
- * contain a line which exceeds the maximum allowable length. The default
- * maximum line length is 80.
- *
- * usage: cklength [ -v ] [ arg ... ] files...
- * -l length -- maximum line length
- * -v -- verbose
- *
- * $Id$
- */
-
-#define GETOPTARGS "l:nNv"
-
-char *USAGE = "\
-usage: cklength [ -v ] [ arg ... ] files... \n\
- -l length -- maximum line length\n\
- -n -- report line numbers for offending lines\n\
- -N -- report line numbers and length for offending lines\n\
- -v -- verbose\n\
-\n\
-Print the name of files which have at least 1 line which exceeds the\n\
-maximum line length. The default maximum line length is 80.\n\
-";
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <memory.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-
-#define BUFFER_SIZE 512
-
-#define SUCCESS 0
-#define FAILURE -1
-#define Failed(x) (((int) (x)) == FAILURE)
-#define TRUE 1
-#define FALSE 0
-#define STREQ(a,b) (strcmp(a,b) == 0)
-#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
-
-/*
- * Definitions for unsigned "ints"; especially for use in data structures
- * that will be shared among (potentially) different cpu's (we punt on
- * byte ordering problems tho)
- */
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned long u32;
-
-/*
- * vars controlled by command line options
- */
-
-int verbose = FALSE; /* be verbose */
-int report_line_numbers = FALSE; /* report line numbers of offenders */
-int report_line_length = FALSE; /* report line length of offenders */
-
-int line_length = 80; /* maximum allowable line length */
-
-extern char *optarg; /* getopt(3) control vars */
-extern int optind, opterr;
-
-char *progname; /* for error() */
-
-int process(char *arg);
-void error(int errn, ...);
-long getparm(char *s, long min, long max, char *msg);
-
-#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define ERR_FATAL (ERR_ERRNO / 2) /* fatal error ; no return */
-#define ERR_ABORT (ERR_ERRNO / 4) /* fatal error ; abort */
-#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
-
-#define stol(p) strtol(p, (char **) NULL, 0)
-int Open(), Read(), Write();
-
-int main(
- int argc,
- char **argv
-)
-{
- register int c;
- int showusage = FALSE; /* usage error? */
- int rc = 0;
-
- /*
- * figure out invocation leaf-name
- */
-
- if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
- progname = argv[0];
- else
- progname++;
-
- argv[0] = progname; /* for getopt err reporting */
-
- /*
- * Check options and arguments.
- */
-
- opterr = 0; /* we'll report all errors */
- while ((c = getopt(argc, argv, GETOPTARGS)) != EOF)
- switch (c)
- {
- case 'l': /* line length */
- line_length = atoi( optarg );
- if ( line_length < 0 || line_length > BUFFER_SIZE )
- error(ERR_FATAL, "(%d) is illegal line length\n",line_length);
- break;
-
- case 'n': /* toggle report_line_numbers */
- report_line_numbers = ! report_line_numbers;
- break;
-
- case 'N': /* toggle both reports */
- report_line_numbers = ! report_line_numbers;
- report_line_length = ! report_line_length;
- break;
-
- case 'v': /* toggle verbose */
- verbose = ! verbose;
- break;
-
- case '?':
- showusage = TRUE;
- }
-
- if (showusage)
- {
- (void) fprintf(stderr, "%s", USAGE);
- exit(1);
- }
-
- /*
- * traverse and process the arguments
- */
-
- for ( ; argv[optind]; optind++)
- if (Failed(process(argv[optind])))
- rc = FAILURE;
-
- return rc;
-}
-
-
-/*
- * process(arg)
- */
-
-int
-process(char *arg)
-{
- FILE *in;
- char *bptr;
- char buffer[ BUFFER_SIZE ];
- int line_number;
- int length;
- int count;
- int rc = SUCCESS; /* succeed by default */
-
- in = fopen( arg, "r" );
- if (!in)
- error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
-
- count = 0;
-
- for ( line_number=1 ; ; line_number++ ) {
- bptr = fgets( buffer, BUFFER_SIZE, in );
- if (!bptr)
- break;
-
- /*
- * Don't count the carriage return.
- */
-
- length = strlen( buffer ) - 1;
-
- if ( length <= line_length )
- continue;
-
- if ( count == 0 ) {
- fprintf( stderr, "%s\n", arg );
- if ( !report_line_numbers )
- break;
- }
-
- if ( verbose )
- fprintf( stderr, "TOO LONG:%d: %s\n", line_number, buffer );
-
- if ( report_line_numbers ) {
- if ( report_line_length )
- fprintf( stderr, "%d: %d\n" , line_number, length );
- else
- fprintf( stderr, "%d\n" , line_number );
- }
-
- count++;
-
- }
-
- fclose( in );
- return rc;
-}
-
-/*
- * error(errn, arglist)
- * report an error to stderr using printf(3) conventions.
- * Any output is preceded by '<progname>: '
- *
- * Uses ERR_FATAL bit to request exit(errn)
- * ERR_ABORT to request abort()
- * ERR_ERRNO to indicate use of errno instead of argument.
- *
- * If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
- * associated error message is appended to the output.
- */
-
-/*VARARGS*/
-
-void
-error(int error_flag, ...)
-{
- va_list arglist;
- register char *format;
- int local_errno;
-
- extern int errno;
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- local_errno = error_flag & ~ERR_MASK;
- if (error_flag & ERR_ERRNO) /* use errno? */
- local_errno = errno;
-
- va_start(arglist, error_flag);
- format = va_arg(arglist, char *);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, format, arglist);
- va_end(arglist);
-
- if (local_errno)
- (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
-
- (void) fflush(stderr);
-
- if (error_flag & (ERR_FATAL | ERR_ABORT))
- {
- if (error_flag & ERR_FATAL)
- {
- error(0, "fatal error, exiting");
- exit(local_errno ? local_errno : 1);
- }
- else
- {
- error(0, "fatal error, aborting");
- abort();
- }
- }
-}
-
-long
-getparm(char *s,
- long min,
- long max,
- char *msg)
-{
- long val;
-
- if ( ! strchr("0123456789-", *s))
- {
- error(ERR_FATAL, "'%s' is not a number", s);
- return min;
- }
-
- val = strtol(s, (char **) NULL, 0);
- if ((val < min) || (val > max))
- {
- if (min == max)
- error(ERR_FATAL, "%s can only be %ld", s, min);
- else
- error(ERR_FATAL, "%s must be between %ld and %ld", msg, min, max);
- }
-
- return val;
-}
-
-
-/*
- * Open()
- * Perform open(2), returning the file descriptor. Prints
- * error message if open fails.
- */
-
-int
-Open(char *file,
- int oflag,
- int mode)
-{
- int O_fd;
-
- if (Failed(O_fd = open(file, oflag, mode)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "open('%s', 0x%x, 0%o) failed", file, oflag, mode
- );
-
- return O_fd;
-}
-
-/*
- * Read()
- * Perform read(2); prints error message if fails.
- */
-
-int
-Read(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = read(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "read(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
-
-/*
- * Write()
- * Perform write(2); prints error message if fails.
- */
-
-int
-Write(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = write(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "write(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
diff --git a/c/build-tools/src/config.h.in b/c/build-tools/src/config.h.in
deleted file mode 100644
index cebd2bcad4..0000000000
--- a/c/build-tools/src/config.h.in
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * This file is editted automatically by autoconf.
- *
- * $Id$
- */
-
-/* Define if you have the strerror function. */
-#undef HAVE_STRERROR
-
diff --git a/c/build-tools/src/eolstrip.c b/c/build-tools/src/eolstrip.c
deleted file mode 100644
index c944ae6663..0000000000
--- a/c/build-tools/src/eolstrip.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * eolstrip - strip white space from end of lines
- *
- * This program strips the white space from the end of every line in the
- * specified program.
- *
- * usage: eolstrip [ -v ] [ arg ... ] files...
- * -v -- verbose
- *
- * $Id$
- */
-
-#define GETOPTARGS "vt"
-
-char *USAGE = "\
-usage: cklength [ -v ] [ arg ... ] files... \n\
- -v -- verbose\n\
- -t -- test only .. DO NOT OVERWRITE FILE!!!\n\
-\n\
-Strip the white space from the end of every line on the list of files.\n\
-";
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <memory.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-
-#define BUFFER_SIZE 2048
-#define MAX_PATH 2048
-
-#define SUCCESS 0
-#define FAILURE -1
-#define Failed(x) (((int) (x)) == FAILURE)
-#define TRUE 1
-#define FALSE 0
-#define STREQ(a,b) (strcmp(a,b) == 0)
-#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
-
-/*
- * Definitions for unsigned "ints"; especially for use in data structures
- * that will be shared among (potentially) different cpu's (we punt on
- * byte ordering problems tho)
- */
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned long u32;
-
-/*
- * vars controlled by command line options
- */
-
-int verbose = FALSE; /* be verbose */
-int test_only = FALSE; /* test only */
-
-extern char *optarg; /* getopt(3) control vars */
-extern int optind, opterr;
-
-char *progname; /* for error() */
-
-int process(char *arg);
-void error(int errn, ...);
-long getparm(char *s, long min, long max, char *msg);
-
-#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define ERR_FATAL (ERR_ERRNO / 2) /* fatal error ; no return */
-#define ERR_ABORT (ERR_ERRNO / 4) /* fatal error ; abort */
-#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
-
-#define stol(p) strtol(p, (char **) NULL, 0)
-int Open(), Read(), Write();
-
-int main(
- int argc,
- char **argv
-)
-{
- register int c;
- int showusage = FALSE; /* usage error? */
- int rc = 0;
-
- /*
- * figure out invocation leaf-name
- */
-
- if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
- progname = argv[0];
- else
- progname++;
-
- argv[0] = progname; /* for getopt err reporting */
-
- /*
- * Check options and arguments.
- */
-
- opterr = 0; /* we'll report all errors */
- while ((c = getopt(argc, argv, GETOPTARGS)) != EOF)
- switch (c)
- {
- case 't': /* toggle test only mode */
- test_only = ! test_only;
- break;
-
- case 'v': /* toggle verbose */
- verbose = ! verbose;
- break;
-
- case '?':
- showusage = TRUE;
- }
-
- if (showusage)
- {
- (void) fprintf(stderr, "%s", USAGE);
- exit(1);
- }
-
- /*
- * traverse and process the arguments
- */
-
- for ( ; argv[optind]; optind++)
- if (Failed(process(argv[optind])))
- rc = FAILURE;
-
- return rc;
-}
-
-
-/*
- * process(arg)
- */
-
-int
-process(char *arg)
-{
- FILE *in;
- FILE *out = (FILE *) 0;
- char outname[ MAX_PATH ];
- char *bptr;
- char buffer[ BUFFER_SIZE ];
- int length;
- int line_number;
- int rc = SUCCESS; /* succeed by default */
-
- in = fopen( arg, "r" );
- if (!in)
- error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
-
- if ( !test_only ) {
- sprintf( outname, "%s.eoltmp", arg );
-
- out = fopen( outname, "w" );
- if (!out)
- error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
- }
-
- if ( verbose )
- fprintf( stderr, "Processing %s\n", arg );
-
- for ( line_number=1 ; ; line_number++ ) {
- bptr = fgets( buffer, BUFFER_SIZE, in );
- if (!bptr)
- break;
-
- /*
- * Don't count the carriage return.
- */
-
- length = strlen( buffer ) - 1;
-
- if ( buffer[ length ] != '\n' )
- error(ERR_ERRNO|ERR_FATAL, "Line %d too long in %s\n", line_number, arg);
-
- while ( isspace( (int) buffer[ length ] ) )
- buffer[ length-- ] = '\0';
-
- if ( test_only ) {
- fprintf( stderr, "%s\n", arg );
- break;
- }
-
- fprintf( out, "%s\n", buffer );
- }
-
- fclose( in );
- if ( !test_only ) {
- fclose( out );
- rename( outname, arg );
- }
- return rc;
-}
-
-/*
- * error(errn, arglist)
- * report an error to stderr using printf(3) conventions.
- * Any output is preceded by '<progname>: '
- *
- * Uses ERR_FATAL bit to request exit(errn)
- * ERR_ABORT to request abort()
- * ERR_ERRNO to indicate use of errno instead of argument.
- *
- * If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
- * associated error message is appended to the output.
- */
-
-/*VARARGS*/
-
-void
-error(int error_flag, ...)
-{
- va_list arglist;
- register char *format;
- int local_errno;
-
- extern int errno;
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- local_errno = error_flag & ~ERR_MASK;
- if (error_flag & ERR_ERRNO) /* use errno? */
- local_errno = errno;
-
- va_start(arglist, error_flag);
- format = va_arg(arglist, char *);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, format, arglist);
- va_end(arglist);
-
- if (local_errno)
- (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
- else
- (void) fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (ERR_FATAL | ERR_ABORT))
- {
- if (error_flag & ERR_FATAL)
- {
- error(0, "fatal error, exiting");
- exit(local_errno ? local_errno : 1);
- }
- else
- {
- error(0, "fatal error, aborting");
- abort();
- }
- }
-}
-
-long
-getparm(char *s,
- long min,
- long max,
- char *msg)
-{
- long val;
-
- if ( ! strchr("0123456789-", *s))
- {
- error(ERR_FATAL, "'%s' is not a number", s);
- return min;
- }
-
- val = strtol(s, (char **) NULL, 0);
- if ((val < min) || (val > max))
- {
- if (min == max)
- error(ERR_FATAL, "%s can only be %ld", s, min);
- else
- error(ERR_FATAL, "%s must be between %ld and %ld", msg, min, max);
- }
-
- return val;
-}
-
-
-/*
- * Open()
- * Perform open(2), returning the file descriptor. Prints
- * error message if open fails.
- */
-
-int
-Open(char *file,
- int oflag,
- int mode)
-{
- int O_fd;
-
- if (Failed(O_fd = open(file, oflag, mode)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "open('%s', 0x%x, 0%o) failed", file, oflag, mode
- );
-
- return O_fd;
-}
-
-/*
- * Read()
- * Perform read(2); prints error message if fails.
- */
-
-int
-Read(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = read(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "read(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
-
-/*
- * Write()
- * Perform write(2); prints error message if fails.
- */
-
-int
-Write(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = write(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "write(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
diff --git a/c/build-tools/src/packhex.c b/c/build-tools/src/packhex.c
deleted file mode 100644
index 3b85a7c927..0000000000
--- a/c/build-tools/src/packhex.c
+++ /dev/null
@@ -1,565 +0,0 @@
-
-/***** P A C K H E X . C ************************************************
- *
- * Packhex is a hex-file compaction utility. It attempts to concatenate
- * hex records to produce more size-efficient packaging.
- *
- * Limitations: Input files must be correctly formatted. This utility
- * is not robust enough to detect hex-record formatting
- * errors.
- *
- * Published: May 1993 Embedded Systems Programming magazine
- * "Creating Faster Hex Files"
- *
- * URL: ESP magazine: http://www.embedded.com
- * Source Code: ftp://ftp.mfi.com/pub/espmag/1993/pakhex.zip
- *
- * Author: Mark Gringrich
- *
- * Compiler: Microsoft C 6.0
- * cl /F 1000 packhex.c
- *
- *
- * $Id$
- *
- **************************************************************************/
-
-
-/* #define SMALLER_RECORDS */
-#ifdef SMALLER_RECORDS
-#define MAX_LEN_S1_RECS 128
-#define MAX_LEN_S2_RECS 128
-#define MAX_LEN_S3_RECS 128
-#else
-#define MAX_LEN_S1_RECS 252
-#define MAX_LEN_S2_RECS 251
-#define MAX_LEN_S3_RECS 250
-#endif
-
-
-/*--------------------------------- includes ---------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-#if defined(__unix__) && !defined(EXIT_FAILURE)
-#define EXIT_FAILURE -1
-#define EXIT_SUCCESS 0
-#endif
-
-/*--------------------------------- defines ----------------------------------*/
-
-#define YES 1
-#define MAX_LINE_SIZE 600
-#define EOS '\0'
-
-
-/*---------------------------------- macros ----------------------------------*/
-
-/* Convert ASCII hexadecimal digit to value. */
-
-#define HEX_DIGIT( C ) ( ( ( ( C ) > '9' ) ? ( C ) + 25 : ( C ) ) & 0xF )
-
-
-/*--------------------------------- typedefs ---------------------------------*/
-
-typedef unsigned char Boolean;
-typedef unsigned char Uchar;
-typedef unsigned int Uint;
-typedef unsigned long Ulong;
-
-typedef struct /* Functions and constant returning Hex-record vital stats. */
-{
- Boolean ( *is_data_record )( char * );
- Ulong ( *get_address )( char * );
- Uint ( *get_data_count )( char * );
- const Uint max_data_count;
- char *( *get_data_start )( char * );
- void ( *put_data_record )( Uint, Ulong, char * );
-} Rec_vitals;
-
-
-/*--------------------------- function prototypes ----------------------------*/
-
-Rec_vitals * identify_first_data_record( char *, int );
-Ulong get_ndigit_hex( char *, int );
-
-
-/*----------------------------- Intel Hex format -----------------------------*/
-
-/*
- * Intel Hex data-record layout
- *
- * :aabbbbccd...dee
- *
- * : - header character
- * aa - record data byte count, a 2-digit hex value
- * bbbb - record address, a 4-digit hex value
- * cc - record type, a 2-digit hex value:
- * "00" is a data record
- * "01" is an end-of-data record
- * "02" is an extended-address record
- * "03" is a start record
- * d...d - data (always an even number of chars)
- * ee - record checksum, a 2-digit hex value
- * checksum = 2's complement
- * [ (sum of bytes: aabbbbccd...d) modulo 256 ]
- */
-
-
-Boolean is_intel_data_rec( char * rec_str )
-{
- return( ( rec_str[ 0 ] == ':' ) && ( rec_str[ 8 ] == '0' ) );
-}
-
-Uint get_intel_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 1, 2 ) );
-}
-
-Ulong get_intel_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 3, 4 ) );
-}
-
-char * get_intel_rec_data_start( char * rec_str )
-{
- return( rec_str + 9 );
-}
-
-void put_intel_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = count + ( address >> 8 & 0xff ) + ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- ":%02X%04lX00%s%02X\n", count, address, data_str, (~sum + 1) & 0xff
- );
-}
-
-
-Rec_vitals intel_hex =
-{
- is_intel_data_rec,
- get_intel_rec_address,
- get_intel_rec_data_count,
- 255, /* Maximum data bytes in a record. */
- get_intel_rec_data_start,
- put_intel_data_rec
-};
-
-
-/*------------------------- Motorola S1-record format ------------------------*/
-
-/*
- * Motorola S-record data-record layout
- *
- * Sabbc...cd...dee
- *
- * S - header character
- * a - record type, a 1-digit value:
- * "0" is a header record
- * "1" is a 2-byte-address data record
- * "2" is a 3-byte-address data record
- * "3" is a 4-byte-address data record
- * "7" is a 4-byte-address end-of-data record
- * "8" is a 3-byte-address end-of-data record
- * "9" is a 2-byte-address end-of-data record
- * bb - record length in bytes, a 2-digit hex value
- * (record length doesn't count the header/type
- * chars and checksum byte)
- * c...c - record address, a 4-, 6-, or 8-digit value,
- * depending on record type
- * d...d - data (always an even number of chars)
- * ee - record checksum, a 2-digit hex value
- * checksum = 1's complement
- * [ (sum of all bytes: bbc..cd...d) modulo 256 ]
- */
-
-#define S1_COUNT_OFFSET 3
-
-
-Boolean is_moto_s1_data_rec( char * rec_str )
-{
- return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '1' ) );
-}
-
-Uint get_moto_s1_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S1_COUNT_OFFSET );
-}
-
-Ulong get_moto_s1_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 4, 4 ) );
-}
-
-char * get_moto_s1_rec_data_start( char * rec_str )
-{
- return( rec_str + 8 );
-}
-
-void put_moto_s1_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = S1_COUNT_OFFSET + count +
- ( address >> 8 & 0xff ) + ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- "S1%02X%04lX%s%02X\n",
- count + S1_COUNT_OFFSET, address, data_str, ~sum & 0xff
- );
-}
-
-
-Rec_vitals motorola_s1_rec =
-{
- is_moto_s1_data_rec,
- get_moto_s1_rec_address,
- get_moto_s1_rec_data_count,
- MAX_LEN_S1_RECS, /* Maximum data bytes in a record. */
- get_moto_s1_rec_data_start,
- put_moto_s1_data_rec
-};
-
-
-/*------------------------- Motorola S2-record format ------------------------*/
-
-#define S2_COUNT_OFFSET 4
-
-Boolean is_moto_s2_data_rec( char * rec_str )
-{
- return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '2' ) );
-}
-
-Uint get_moto_s2_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S2_COUNT_OFFSET );
-}
-
-Ulong get_moto_s2_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 4, 6 ) );
-}
-
-char * get_moto_s2_rec_data_start( char * rec_str )
-{
- return( rec_str + 10 );
-}
-
-void put_moto_s2_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = S2_COUNT_OFFSET + count + ( address >> 16 & 0xff ) +
- ( address >> 8 & 0xff ) +
- ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- "S2%02X%06lX%s%02X\n",
- count + S2_COUNT_OFFSET, address, data_str, ~sum & 0xff
- );
-}
-
-
-Rec_vitals motorola_s2_rec =
-{
- is_moto_s2_data_rec,
- get_moto_s2_rec_address,
- get_moto_s2_rec_data_count,
- MAX_LEN_S2_RECS, /* Maximum data bytes in a record. */
- get_moto_s2_rec_data_start,
- put_moto_s2_data_rec
-};
-
-
-/*------------------------- Motorola S3-record format ------------------------*/
-
-#define S3_COUNT_OFFSET 5
-
-Boolean is_moto_s3_data_rec( char * rec_str )
-{
- return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '3' ) );
-}
-
-Uint get_moto_s3_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S3_COUNT_OFFSET );
-}
-
-Ulong get_moto_s3_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 4, 8 ) );
-}
-
-char * get_moto_s3_rec_data_start( char * rec_str )
-{
- return( rec_str + 12 );
-}
-
-void put_moto_s3_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = S3_COUNT_OFFSET + count + ( address >> 24 & 0xff ) +
- ( address >> 16 & 0xff ) +
- ( address >> 8 & 0xff ) +
- ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- "S3%02X%08lX%s%02X\n",
- count + S3_COUNT_OFFSET, address, data_str, ~sum & 0xff
- );
-}
-
-
-Rec_vitals motorola_s3_rec =
-{
- is_moto_s3_data_rec,
- get_moto_s3_rec_address,
- get_moto_s3_rec_data_count,
- MAX_LEN_S3_RECS, /* Maximum data bytes in a record. */
- get_moto_s3_rec_data_start,
- put_moto_s3_data_rec
-};
-
-
-/*-------------------- Put your favorite hex format here ---------------------*/
-
-/*
- * * * * The following is a template for an additional hex format: * * *
- *
- *
- * Boolean is_X_data_rec( char * rec_str ) {}
- *
- * Uint get_X_rec_data_count( char * rec_str ) {}
- *
- * Ulong get_X_rec_address( char * rec_str ) {}
- *
- * char * get_X_rec_data_start( char * rec_str ) {}
- *
- * void put_X_data_rec( Uint count, Ulong address, char * data_str ) {}
- *
- * Rec_vitals X_rec =
- * {
- * is_X_data_rec,
- * get_X_rec_address,
- * get_X_rec_data_count,
- * MAXIMUM DATA BYTES IN A RECORD,
- * get_X_rec_data_start,
- * put_X_data_rec
- * };
- *
- */
-
-/*----------------------------------------------------------------------------*/
-
-
-/*
- * Put address of additional Rec_vitals structures
- * in this array, before the NULL entry.
- */
-
-Rec_vitals *formats[] =
-{
- &intel_hex,
- &motorola_s1_rec,
- &motorola_s2_rec,
- &motorola_s3_rec,
- ( Rec_vitals * ) NULL
-};
-
-
-/**** main *****************************************************************
-*
-*
-* Expects: Nothing (no command-line parameters).
-*
-* Returns: Exit status (EXIT_SUCCESS or EXIT_FAILURE).
-*
-* Reads hex records on the standard input and attempts to
-* splice adjacent data fields together. Results appear on
-* the standard output.
-*
-*******************************************************************************/
-
-int main(
- int argc,
- char **argv
-)
-{
-
- char inbuff[ MAX_LINE_SIZE ], outbuff[ MAX_LINE_SIZE ];
- char *in_dptr, *out_dptr;
- int d_total, d_count, d_excess, n;
- int length;
- Ulong in_rec_addr, out_rec_addr = 0;
- Rec_vitals *rptr;
-
-
- /* Sift through file until first hex record is identified. */
-
- rptr = identify_first_data_record( inbuff, MAX_LINE_SIZE );
- if ( rptr == NULL )
- {
- fputs( "No hex records found.\n", stderr );
- exit( EXIT_FAILURE );
- }
-
-
- /* Attempt data-record splicing until end-of-file is reached. */
- d_total = 0;
- for (;;) {
- if ( rptr->is_data_record( inbuff ) == YES )
- { /* Input record is a data record. */
- d_count = rptr->get_data_count( inbuff );
- in_rec_addr = rptr->get_address( inbuff );
- in_dptr = rptr->get_data_start( inbuff );
-
- if ( d_total == 0 || in_rec_addr != out_rec_addr + d_total )
- { /* Begin a new output record. */
- if ( d_total != 0 )
- rptr->put_data_record( d_total, out_rec_addr, outbuff );
- out_dptr = outbuff;
- n = d_total = d_count;
- out_rec_addr = in_rec_addr;
- }
- else if
- ( ( d_excess = d_total + d_count - rptr->max_data_count ) > 0 )
- { /* Output a maximum-length record, then start a new record. */
- strncat( outbuff, in_dptr, 2 * ( d_count - d_excess ) );
- rptr->put_data_record(
- rptr->max_data_count, out_rec_addr, outbuff
- );
- in_dptr += 2 * ( d_count - d_excess );
- out_dptr = outbuff;
- n = d_total = d_excess;
- out_rec_addr += rptr->max_data_count;
- }
- else
- { /* Append input record's data field with accumulated data. */
- out_dptr = outbuff + ( 2 * d_total );
- d_total += n = d_count;
- }
- strncpy( out_dptr, in_dptr, 2 * n );
- out_dptr[ 2 * n ] = EOS;
- }
- else
- { /* Not a data record;
- * flush accumulated data then echo non-data record.
- */
- if ( d_total != 0 )
- {
- rptr->put_data_record( d_total, out_rec_addr, outbuff );
- d_total = 0;
- }
- puts( inbuff );
- }
-
- inbuff[ MAX_LINE_SIZE - 1 ] = '\0';
- if ( !fgets( inbuff, MAX_LINE_SIZE, stdin ) )
- break;
- if ( inbuff[ MAX_LINE_SIZE - 1 ] ) {
- fprintf( stderr, "Input line too long" );
- exit( 1 );
- }
- length = strlen(inbuff);
- inbuff[length - 1] = '\0';
-
- }
-
-
- return ( EXIT_SUCCESS );
-
-}
-
-
-/**** identify_first_data_record *******************************************
-*
-* Expects: Pointer to hex-record line buffer.
-*
-* Returns: Pointer to hex-record structure (NULL if no match found).
-*
-* Reads the standard input, line by line, searching for a valid
-* record header character. If a valid header is found, a pointer
-* to the hex-record's type structure is returned, otherwise NULL.
-*
-* The input-stream pointer is left pointing to the first valid hex record.
-*
-*******************************************************************************/
-
-Rec_vitals * identify_first_data_record( char * buff_ptr, int max_length )
-{
- Rec_vitals ** ptr;
- int length;
-
-
-
- for ( ;; ) {
-
- buff_ptr[ max_length - 1 ] = '\0';
- if ( !fgets( buff_ptr, max_length, stdin ) )
- break;
- if ( buff_ptr[ max_length - 1 ] ) {
- fprintf( stderr, "Input line too long" );
- exit( 1 );
- }
- length = strlen(buff_ptr);
- buff_ptr[length - 1] = '\0';
-
- for ( ptr = formats ; *ptr != ( Rec_vitals * ) NULL ; ptr++ )
- if ( ( *ptr )->is_data_record( buff_ptr ) == YES )
- return( *ptr ); /* Successful return. */
-
- puts( buff_ptr ); /* Echo non-hex-record line. */
- }
-
- return( ( Rec_vitals * ) NULL ); /* Unsuccessful return. */
-}
-
-
-/**** get_ndigit_hex *******************************************************
-*
-* Expects: Pointer to first ASCII hexadecimal digit, number of digits.
-*
-* Returns: Value of hexadecimal string as an unsigned long.
-*
-*******************************************************************************/
-
-Ulong get_ndigit_hex( char * cptr, int digits )
-{
- Ulong value;
-
- for ( value = 0 ; --digits >= 0 ; cptr++ )
- value = ( value * 16L ) + HEX_DIGIT( *cptr );
-
- return( value );
-}
diff --git a/c/build-tools/src/unhex.c b/c/build-tools/src/unhex.c
deleted file mode 100644
index 6a75a13ae7..0000000000
--- a/c/build-tools/src/unhex.c
+++ /dev/null
@@ -1,738 +0,0 @@
-/*
- * unhex
- * convert a hex file to binary equivalent. If more than one file name
- * is given, then the output will be logically concatenated together.
- * stdin and stdout are defaults. Verbose will enable checksum output.
- *
- * Supported input formats are Intel hex, Motorola S records, and TI 'B'
- * records.
- *
- * Intel hex input format is
- * Byte
- * 1 Colon :
- * 2..3 Record length, eg: "20"
- * 4..7 load address nibbles
- * 8..9 record type: "00" (data) or "02" base addr
- * 10..x data bytes in ascii-hex
- * x+1..x+2 cksum (2's compl of (len+addr+data))
- * x+3 \n -- newline
- *
- * $Id$
- */
-
-char *USAGE = "\
-usage: unhex [-va] [ -o file ] [ file [file ... ] ]\n\
- -v -- verbose\n\
- -a base -- 1st byte of output corresponds to this address\n\
- -l -- linear, just writes data out\n\
- -o file -- output file; must not be input file\n\
- -F k_bits -- \"holes\" in input will be filled with 0xFF's\n\
- up to \"k_bits\" * 1024 bits\n\
-";
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-
-#define OK 0
-#define FAILURE (-1)
-#define Failed(x) ((x) == FAILURE)
-#define TRUE 1
-#define FALSE 0
-typedef char bool;
-#define STREQ(a,b) (strcmp(a,b) == 0)
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned long u32;
-
-/*
- * Pick out designated bytes
- */
-
-#define B0(x) ((x) & 0xff)
-#define B1(x) B0((x) >> 8)
-#define B2(x) B0((x) >> 16)
-#define B3(x) B0((x) >> 24)
-
-typedef struct buffer_rec {
- u32 dl_destaddr;
- u32 dl_jumpaddr;
- int dl_count;
- u8 dl_buf[512];
-} buffer_rec;
-
-/*
- * vars controlled by command line options
- */
-
-bool verbose = FALSE; /* be verbose */
-bool linear = FALSE; /* just write out linear data */
-char *outfilename = "-"; /* default output is stdout */
-u32 base = 0L; /* base address */
-u32 FFfill = 0L; /* how far to fill w 0xFF's */
-
-extern char *optarg; /* getopt(3) control vars */
-extern int optind;
-
-char *progname; /* for error() */
-
-void error(int errn, ...);
-#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define ERR_FATAL (ERR_ERRNO / 2) /* error is fatal; no return */
-#define ERR_ABORT (ERR_ERRNO / 4) /* error is fatal; abort */
-#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
-
-#ifdef HAVE_STRTOUL
-#define stol(p) strtoul(p, (char **) NULL, 0)
-#else
-#define stol(p) strtol(p, (char **) NULL, 0)
-#endif
-
-int unhex(FILE *ifp, char *inm, FILE *ofp, char *onm);
-int convert_Intel_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
-int convert_S_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
-int convert_TI_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
-void write_record(buffer_rec *tb, FILE *fp);
-int getnibble(char **p);
-int getbyte(char **p);
-long getNbytes(char **p, int n);
-void badformat(char *s, char *fname, char *msg);
-
-#define get1bytes(p) ((int) getbyte(p))
-#define get2bytes(p) ((int) getNbytes(p, 2))
-#define get3bytes(p) getNbytes(p, 3)
-#define get4bytes(p) getNbytes(p, 4)
-
-char *BADADDR = "Invalid record address";
-char *BADLEN = "Invalid record length";
-char *BADBASE = "Bad base or starting address";
-char *BADFMT = "Unrecognized record type";
-char *BADDATA = "Invalid data byte";
-char *BADCSUM = "Invalid checksum";
-char *MISCSUM = "Checksum mismatch";
-char *BADTYPE = "Unrecognized record type";
-char *MISTYPE = "Incompatible record types";
-
-int main(
- int argc,
- char **argv
-)
-{
- register int c;
- bool showusage = FALSE; /* usage error? */
- int rc = 0;
- FILE *outfp, *infp;
-
- /*
- * figure out invocation leaf-name
- */
-
- if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
- progname = argv[0];
- else
- progname++;
-
- argv[0] = progname; /* for getopt err reporting */
-
- /*
- * Check options and arguments.
- */
-
- progname = argv[0];
- while ((c = getopt(argc, argv, "F:a:o:vl")) != EOF)
- switch (c)
- {
- case 'a': /* base address */
- base = stol(optarg);
- break;
-
- case 'l': /* linear output */
- linear = TRUE;
- break;
-
- case 'v': /* toggle verbose */
- verbose = ! verbose;
- break;
-
- case 'o': /* output file */
- outfilename = optarg;
- break;
-
- case 'F': /* 0xFF fill amount (bytes) */
- FFfill = stol(optarg) * 1024L / 8L;
- break;
-
- case '?':
- showusage = TRUE;
- }
-
- if (showusage)
- {
- (void) fprintf(stderr, "%s", USAGE);
- exit(1);
- }
-
- if (linear && (base != 0))
- {
- error(0, "-l and -a may not be specified in combination");
- exit(1);
- }
-
- if (STREQ(outfilename, "-"))
- {
- outfp = stdout;
- outfilename = "stdout";
- }
- else
- if ((outfp = fopen(outfilename, "w")) == (FILE *) NULL)
- {
- error(-1, "couldn't open '%s' for output", outfilename);
- exit(1);
- }
-
- /*
- * Now process the input files (or stdin, if none specified)
- */
-
- if (argv[optind] == (char *) NULL) /* just stdin */
- exit(unhex(stdin, "stdin", outfp, outfilename));
- else
- for (; (optarg = argv[optind]); optind++)
- {
- if (STREQ(optarg, "-"))
- rc += unhex(stdin, "stdin", outfp, outfilename);
- else
- {
- if ((infp = fopen(optarg, "r")) == (FILE *) NULL)
- {
- error(-1, "couldn't open '%s' for input", optarg);
- exit(1);
- }
- rc += unhex(infp, optarg, outfp, outfilename);
- }
- }
-
- return(rc);
-}
-
-u16 filesum;
-
-int
-unhex(FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- int c;
-
- filesum = 0;
-
- /*
- * Make sure holes will be filled with 0xFF's if requested. We
- * do this the easy way by just filling the file with FF's before
- * getting started. To do it more optimally would be quite a bit
- * more difficult since the user can skip around as much as he/she
- * likes in the input hex file addressing.
- *
- * We'll clean this up later (after this program has run) with
- * 'stripffs'
- */
-
- if (FFfill)
- {
- (void) fseek(ofp, 0, 0);
- for (c = FFfill; c > 0; c--)
- (void) fputc(0xFF, ofp);
- }
-
- /*
- * Read the first char from file and determine record types
- */
-
- if ((c = getc(ifp)) != EOF)
- {
- ungetc(c, ifp);
- switch(c)
- {
- case 'S':
- convert_S_records(ifp, inm, ofp, onm);
- break;
-
- case ':':
- convert_Intel_records(ifp, inm, ofp, onm);
- break;
-
- case '9':
- case 'B':
- convert_TI_records(ifp, inm, ofp, onm);
- break;
-
- default:
- {
- char tmp[2];
- tmp[0] = c; tmp[1] = 0;
- badformat(tmp, inm, BADFMT);
- }
- }
- }
-
- if (verbose)
- fprintf(stderr, "'%s' checksum is 0x%04x\n", inm, filesum);
-
- return 0;
-}
-
-int
-convert_Intel_records(
- FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- char buff[512];
- char *p;
- u8 cksum;
- int incksum;
- int c;
- int rectype; /* record type */
- int len; /* data length of current line */
- u32 addr;
- u32 base_address = 0;
- bool endrecord = FALSE;
- buffer_rec tb;
-
- while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
- {
- p = &buff[0];
-
- if (p[strlen(p)-1] == '\n') /* get rid of newline */
- p[strlen(p)-1] = '\0';
-
- if (p[strlen(p)-1] == '\r') /* get rid of any CR */
- p[strlen(p)-1] = '\0';
-
- tb.dl_count = 0;
-
- if (*p != ':')
- badformat(p, inm, BADFMT);
- p++;
-
- if ((len = getbyte(&p)) == -1) /* record len */
- badformat(buff, inm, BADLEN);
-
- if ((addr = get2bytes(&p)) == -1L) /* record addr */
- badformat(buff, inm, BADADDR);
-
- rectype = getbyte(&p);
-
- cksum = len + B0(addr) + B1(addr) + rectype;
-
- switch (rectype)
- {
- case 0x00: /* normal data record */
- tb.dl_destaddr = base_address + addr;
- while (len--)
- {
- if ((c = getbyte(&p)) == -1)
- badformat(buff, inm, BADDATA);
- cksum += c;
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- }
- break;
-
- case 0x01: /* execution start address */
- base_address = addr;
- endrecord = TRUE;
- break;
-
- case 0x02: /* new base */
- if ((base_address = get2bytes(&p)) == -1L)
- badformat(buff, inm, BADBASE);
- cksum += B0(base_address) + B1(base_address);
- base_address <<= 4;
- break;
-
- case 0x03: /* seg/off execution start address */
- {
- u32 seg, off;
-
- seg = get2bytes(&p);
- off = get2bytes(&p);
- if ((seg == -1L) || (off == -1L))
- badformat(buff, inm, BADADDR);
-
- cksum += B0(seg) + B1(seg) + B0(off) + B1(off);
-
- tb.dl_jumpaddr = (seg << 4) + off;
- break;
- }
-
- default:
- error(0, "unknown Intel-hex record type: 0x%02x", rectype);
- badformat(buff, inm, BADTYPE);
- }
-
- /*
- * Verify checksums are correct in file.
- */
-
- cksum = (-cksum) & 0xff;
- if ((incksum = getbyte(&p)) == -1)
- badformat(buff, inm, BADCSUM);
- if (((u8) incksum) != cksum)
- badformat(buff, inm, MISCSUM);
-
- if (tb.dl_count)
- write_record(&tb, ofp);
- }
- return 0;
-}
-
-int
-convert_S_records(
- FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- char buff[512];
- char *p;
- u8 cksum;
- int incksum;
- int c;
- int len; /* data length of current line */
- int rectype; /* record type */
- u32 addr;
- bool endrecord = FALSE;
- buffer_rec tb;
-
- while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
- {
- p = &buff[0];
-
- if (p[strlen(p)-1] == '\n') /* get rid of newline */
- p[strlen(p)-1] = '\0';
-
- if (p[strlen(p)-1] == '\r') /* get rid of any CR */
- p[strlen(p)-1] = '\0';
-
- tb.dl_count = 0;
-
- if (*p != 'S')
- badformat(p, inm, BADFMT);
- p++;
-
- if ((rectype = getnibble(&p)) == -1) /* record type */
- badformat(buff, inm, BADTYPE);
-
- if ((len = getbyte(&p)) == -1) /* record len */
- badformat(buff, inm, BADLEN);
- cksum = len;
-
- switch (rectype)
- {
- case 0x00: /* comment field, ignored */
- goto write_it;
-
- case 0x01: /* data record, 16 bit addr */
- if ((addr = get2bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- len -= 3;
- goto doit;
-
- case 0x02: /* ... 24 bit addr */
- if ((addr = get3bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- len -= 4;
- goto doit;
-
- case 0x03: /* ... 32 bit addr */
- if ((addr = get4bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- len -= 5;
- doit:
- cksum += B0(addr) + B1(addr) + B2(addr) + B3(addr);
-
- tb.dl_destaddr = addr;
- while (len--)
- {
- if ((c = getbyte(&p)) == -1)
- badformat(buff, inm, BADDATA);
- cksum += c;
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- }
- break;
-
- case 0x07: /* 32 bit end record */
- if ((addr = get4bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- goto end_rec;
-
- case 0x08: /* 24 bit end record */
- if ((addr = get3bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- goto end_rec;
-
- case 0x09: /* 16 bit end record */
- if ((addr = get2bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
-
-end_rec:
- cksum += B0(addr) + B1(addr) + B2(addr) + B3(addr);
- tb.dl_jumpaddr = addr;
- break;
-
- default:
- error(0, "unknown Motorola-S record type: 0x%02x", rectype);
- badformat(buff, inm, BADTYPE);
- break;
- }
-
- /*
- * Verify checksums are correct in file.
- */
-
- cksum = (~cksum) & 0xff;
- if ((incksum = getbyte(&p)) == -1)
- badformat(buff, inm, BADCSUM);
- if (((u8) incksum) != cksum)
- badformat(buff, inm, MISCSUM);
-
-write_it:
- if (tb.dl_count)
- write_record(&tb, ofp);
- }
- return 0;
-}
-
-int
-convert_TI_records(
- FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- char buff[512];
- char *p;
- int c;
- bool endrecord = FALSE;
- bool eol;
- buffer_rec tb;
-
- while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
- {
- if (p[strlen(p)-1] == '\n') /* get rid of newline */
- p[strlen(p)-1] = '\0';
-
- if (p[strlen(p)-1] == '\r') /* get rid of any CR */
- p[strlen(p)-1] = '\0';
-
- tb.dl_count = 0;
-
- p = &buff[0];
- eol = FALSE;
- while ( ! eol && ! endrecord)
- {
- switch (*p++)
- {
- case '9':
- if (tb.dl_count)
- write_record(&tb, ofp);
- tb.dl_destaddr = get2bytes(&p);
- break;
-
- case 'B':
- c = getbyte(&p);
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- c = getbyte(&p);
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- break;
-
- case 'F':
- eol = TRUE;
- break;
-
- case ':':
- endrecord = TRUE;
- break;
-
- default:
- badformat(p, inm, BADFMT);
- }
- }
- if (tb.dl_count)
- write_record(&tb, ofp);
- }
- return 0;
-}
-
-void
-write_record(buffer_rec *tb,
- FILE *fp)
-{
- if ( ! linear)
- {
- if (tb->dl_destaddr < base)
- error(ERR_FATAL, "record at address 0x%x precedes base of 0x%x",
- tb->dl_destaddr, base);
- (void) fseek(fp, tb->dl_destaddr - base, 0);
- }
-
- (void) fwrite(tb->dl_buf, tb->dl_count, 1, fp);
- tb->dl_destaddr += tb->dl_count;
- tb->dl_count = 0;
-}
-
-int
-getnibble(char **p)
-{
- register int val;
-
- **p = toupper(**p);
- switch (**p)
- {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- val = **p - '0';
- break;
-
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- val = 10 + (**p - 'A');
- break;
-
- default:
- return(-1);
- }
- *p += 1;
-
- return(val & 0x0f);
-}
-
-int
-getbyte(char **p)
-{
- int n0, n1;
-
- if ((n0 = getnibble(p)) == -1)
- return(-1);
- if ((n1 = getnibble(p)) == -1)
- return(-1);
-
- return(((n0 << 4) + n1) & 0xff);
-}
-
-long
-getNbytes(char **p,
- int n)
-{
- int t;
- u32 val = 0;
-
- while (n--)
- {
- if ((t = getbyte(p)) == -1)
- return(-1L);
- val <<= 8;
- val += t;
- }
-
- return(val);
-}
-
-void
-badformat(char *s,
- char *fname,
- char *msg)
-{
- if (s[strlen(s)-1] == '\n') /* get rid of newline */
- s[strlen(s)-1] = '\0';
- error(0, "line '%s'::\n\tfrom file '%s'; %s", s, fname, msg);
- exit(1);
-}
-
-/*
- * error(errn, arglist)
- * report an error to stderr using printf(3) conventions.
- * Any output is preceded by '<progname>: '
- *
- * Uses ERR_EXIT bit to request exit(errn)
- * ERR_ABORT to request abort()
- * ERR_ERRNO to indicate use of errno instead of argument.
- *
- * If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
- * associated error message is appended to the output.
- */
-
-/*VARARGS*/
-
-void
-error(int error_flag, ...)
-{
- va_list arglist;
- register char *format;
- int local_errno;
-
- extern int errno;
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- local_errno = error_flag & ~ERR_MASK;
- if (error_flag & ERR_ERRNO) /* use errno? */
- local_errno = errno;
-
- va_start(arglist, error_flag);
- format = va_arg(arglist, char *);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, format, arglist);
- va_end(arglist);
-
- if (local_errno)
- (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
- else
- (void) fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (ERR_FATAL | ERR_ABORT))
- {
- if (error_flag & ERR_FATAL)
- {
- error(0, "fatal error, exiting");
- exit(local_errno ? local_errno : 1);
- }
- else
- {
- error(0, "fatal error, aborting");
- abort();
- }
- }
-}
-
diff --git a/c/build-tools/unhex.c b/c/build-tools/unhex.c
deleted file mode 100644
index 6a75a13ae7..0000000000
--- a/c/build-tools/unhex.c
+++ /dev/null
@@ -1,738 +0,0 @@
-/*
- * unhex
- * convert a hex file to binary equivalent. If more than one file name
- * is given, then the output will be logically concatenated together.
- * stdin and stdout are defaults. Verbose will enable checksum output.
- *
- * Supported input formats are Intel hex, Motorola S records, and TI 'B'
- * records.
- *
- * Intel hex input format is
- * Byte
- * 1 Colon :
- * 2..3 Record length, eg: "20"
- * 4..7 load address nibbles
- * 8..9 record type: "00" (data) or "02" base addr
- * 10..x data bytes in ascii-hex
- * x+1..x+2 cksum (2's compl of (len+addr+data))
- * x+3 \n -- newline
- *
- * $Id$
- */
-
-char *USAGE = "\
-usage: unhex [-va] [ -o file ] [ file [file ... ] ]\n\
- -v -- verbose\n\
- -a base -- 1st byte of output corresponds to this address\n\
- -l -- linear, just writes data out\n\
- -o file -- output file; must not be input file\n\
- -F k_bits -- \"holes\" in input will be filled with 0xFF's\n\
- up to \"k_bits\" * 1024 bits\n\
-";
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-
-#define OK 0
-#define FAILURE (-1)
-#define Failed(x) ((x) == FAILURE)
-#define TRUE 1
-#define FALSE 0
-typedef char bool;
-#define STREQ(a,b) (strcmp(a,b) == 0)
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned long u32;
-
-/*
- * Pick out designated bytes
- */
-
-#define B0(x) ((x) & 0xff)
-#define B1(x) B0((x) >> 8)
-#define B2(x) B0((x) >> 16)
-#define B3(x) B0((x) >> 24)
-
-typedef struct buffer_rec {
- u32 dl_destaddr;
- u32 dl_jumpaddr;
- int dl_count;
- u8 dl_buf[512];
-} buffer_rec;
-
-/*
- * vars controlled by command line options
- */
-
-bool verbose = FALSE; /* be verbose */
-bool linear = FALSE; /* just write out linear data */
-char *outfilename = "-"; /* default output is stdout */
-u32 base = 0L; /* base address */
-u32 FFfill = 0L; /* how far to fill w 0xFF's */
-
-extern char *optarg; /* getopt(3) control vars */
-extern int optind;
-
-char *progname; /* for error() */
-
-void error(int errn, ...);
-#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define ERR_FATAL (ERR_ERRNO / 2) /* error is fatal; no return */
-#define ERR_ABORT (ERR_ERRNO / 4) /* error is fatal; abort */
-#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
-
-#ifdef HAVE_STRTOUL
-#define stol(p) strtoul(p, (char **) NULL, 0)
-#else
-#define stol(p) strtol(p, (char **) NULL, 0)
-#endif
-
-int unhex(FILE *ifp, char *inm, FILE *ofp, char *onm);
-int convert_Intel_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
-int convert_S_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
-int convert_TI_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
-void write_record(buffer_rec *tb, FILE *fp);
-int getnibble(char **p);
-int getbyte(char **p);
-long getNbytes(char **p, int n);
-void badformat(char *s, char *fname, char *msg);
-
-#define get1bytes(p) ((int) getbyte(p))
-#define get2bytes(p) ((int) getNbytes(p, 2))
-#define get3bytes(p) getNbytes(p, 3)
-#define get4bytes(p) getNbytes(p, 4)
-
-char *BADADDR = "Invalid record address";
-char *BADLEN = "Invalid record length";
-char *BADBASE = "Bad base or starting address";
-char *BADFMT = "Unrecognized record type";
-char *BADDATA = "Invalid data byte";
-char *BADCSUM = "Invalid checksum";
-char *MISCSUM = "Checksum mismatch";
-char *BADTYPE = "Unrecognized record type";
-char *MISTYPE = "Incompatible record types";
-
-int main(
- int argc,
- char **argv
-)
-{
- register int c;
- bool showusage = FALSE; /* usage error? */
- int rc = 0;
- FILE *outfp, *infp;
-
- /*
- * figure out invocation leaf-name
- */
-
- if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
- progname = argv[0];
- else
- progname++;
-
- argv[0] = progname; /* for getopt err reporting */
-
- /*
- * Check options and arguments.
- */
-
- progname = argv[0];
- while ((c = getopt(argc, argv, "F:a:o:vl")) != EOF)
- switch (c)
- {
- case 'a': /* base address */
- base = stol(optarg);
- break;
-
- case 'l': /* linear output */
- linear = TRUE;
- break;
-
- case 'v': /* toggle verbose */
- verbose = ! verbose;
- break;
-
- case 'o': /* output file */
- outfilename = optarg;
- break;
-
- case 'F': /* 0xFF fill amount (bytes) */
- FFfill = stol(optarg) * 1024L / 8L;
- break;
-
- case '?':
- showusage = TRUE;
- }
-
- if (showusage)
- {
- (void) fprintf(stderr, "%s", USAGE);
- exit(1);
- }
-
- if (linear && (base != 0))
- {
- error(0, "-l and -a may not be specified in combination");
- exit(1);
- }
-
- if (STREQ(outfilename, "-"))
- {
- outfp = stdout;
- outfilename = "stdout";
- }
- else
- if ((outfp = fopen(outfilename, "w")) == (FILE *) NULL)
- {
- error(-1, "couldn't open '%s' for output", outfilename);
- exit(1);
- }
-
- /*
- * Now process the input files (or stdin, if none specified)
- */
-
- if (argv[optind] == (char *) NULL) /* just stdin */
- exit(unhex(stdin, "stdin", outfp, outfilename));
- else
- for (; (optarg = argv[optind]); optind++)
- {
- if (STREQ(optarg, "-"))
- rc += unhex(stdin, "stdin", outfp, outfilename);
- else
- {
- if ((infp = fopen(optarg, "r")) == (FILE *) NULL)
- {
- error(-1, "couldn't open '%s' for input", optarg);
- exit(1);
- }
- rc += unhex(infp, optarg, outfp, outfilename);
- }
- }
-
- return(rc);
-}
-
-u16 filesum;
-
-int
-unhex(FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- int c;
-
- filesum = 0;
-
- /*
- * Make sure holes will be filled with 0xFF's if requested. We
- * do this the easy way by just filling the file with FF's before
- * getting started. To do it more optimally would be quite a bit
- * more difficult since the user can skip around as much as he/she
- * likes in the input hex file addressing.
- *
- * We'll clean this up later (after this program has run) with
- * 'stripffs'
- */
-
- if (FFfill)
- {
- (void) fseek(ofp, 0, 0);
- for (c = FFfill; c > 0; c--)
- (void) fputc(0xFF, ofp);
- }
-
- /*
- * Read the first char from file and determine record types
- */
-
- if ((c = getc(ifp)) != EOF)
- {
- ungetc(c, ifp);
- switch(c)
- {
- case 'S':
- convert_S_records(ifp, inm, ofp, onm);
- break;
-
- case ':':
- convert_Intel_records(ifp, inm, ofp, onm);
- break;
-
- case '9':
- case 'B':
- convert_TI_records(ifp, inm, ofp, onm);
- break;
-
- default:
- {
- char tmp[2];
- tmp[0] = c; tmp[1] = 0;
- badformat(tmp, inm, BADFMT);
- }
- }
- }
-
- if (verbose)
- fprintf(stderr, "'%s' checksum is 0x%04x\n", inm, filesum);
-
- return 0;
-}
-
-int
-convert_Intel_records(
- FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- char buff[512];
- char *p;
- u8 cksum;
- int incksum;
- int c;
- int rectype; /* record type */
- int len; /* data length of current line */
- u32 addr;
- u32 base_address = 0;
- bool endrecord = FALSE;
- buffer_rec tb;
-
- while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
- {
- p = &buff[0];
-
- if (p[strlen(p)-1] == '\n') /* get rid of newline */
- p[strlen(p)-1] = '\0';
-
- if (p[strlen(p)-1] == '\r') /* get rid of any CR */
- p[strlen(p)-1] = '\0';
-
- tb.dl_count = 0;
-
- if (*p != ':')
- badformat(p, inm, BADFMT);
- p++;
-
- if ((len = getbyte(&p)) == -1) /* record len */
- badformat(buff, inm, BADLEN);
-
- if ((addr = get2bytes(&p)) == -1L) /* record addr */
- badformat(buff, inm, BADADDR);
-
- rectype = getbyte(&p);
-
- cksum = len + B0(addr) + B1(addr) + rectype;
-
- switch (rectype)
- {
- case 0x00: /* normal data record */
- tb.dl_destaddr = base_address + addr;
- while (len--)
- {
- if ((c = getbyte(&p)) == -1)
- badformat(buff, inm, BADDATA);
- cksum += c;
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- }
- break;
-
- case 0x01: /* execution start address */
- base_address = addr;
- endrecord = TRUE;
- break;
-
- case 0x02: /* new base */
- if ((base_address = get2bytes(&p)) == -1L)
- badformat(buff, inm, BADBASE);
- cksum += B0(base_address) + B1(base_address);
- base_address <<= 4;
- break;
-
- case 0x03: /* seg/off execution start address */
- {
- u32 seg, off;
-
- seg = get2bytes(&p);
- off = get2bytes(&p);
- if ((seg == -1L) || (off == -1L))
- badformat(buff, inm, BADADDR);
-
- cksum += B0(seg) + B1(seg) + B0(off) + B1(off);
-
- tb.dl_jumpaddr = (seg << 4) + off;
- break;
- }
-
- default:
- error(0, "unknown Intel-hex record type: 0x%02x", rectype);
- badformat(buff, inm, BADTYPE);
- }
-
- /*
- * Verify checksums are correct in file.
- */
-
- cksum = (-cksum) & 0xff;
- if ((incksum = getbyte(&p)) == -1)
- badformat(buff, inm, BADCSUM);
- if (((u8) incksum) != cksum)
- badformat(buff, inm, MISCSUM);
-
- if (tb.dl_count)
- write_record(&tb, ofp);
- }
- return 0;
-}
-
-int
-convert_S_records(
- FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- char buff[512];
- char *p;
- u8 cksum;
- int incksum;
- int c;
- int len; /* data length of current line */
- int rectype; /* record type */
- u32 addr;
- bool endrecord = FALSE;
- buffer_rec tb;
-
- while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
- {
- p = &buff[0];
-
- if (p[strlen(p)-1] == '\n') /* get rid of newline */
- p[strlen(p)-1] = '\0';
-
- if (p[strlen(p)-1] == '\r') /* get rid of any CR */
- p[strlen(p)-1] = '\0';
-
- tb.dl_count = 0;
-
- if (*p != 'S')
- badformat(p, inm, BADFMT);
- p++;
-
- if ((rectype = getnibble(&p)) == -1) /* record type */
- badformat(buff, inm, BADTYPE);
-
- if ((len = getbyte(&p)) == -1) /* record len */
- badformat(buff, inm, BADLEN);
- cksum = len;
-
- switch (rectype)
- {
- case 0x00: /* comment field, ignored */
- goto write_it;
-
- case 0x01: /* data record, 16 bit addr */
- if ((addr = get2bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- len -= 3;
- goto doit;
-
- case 0x02: /* ... 24 bit addr */
- if ((addr = get3bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- len -= 4;
- goto doit;
-
- case 0x03: /* ... 32 bit addr */
- if ((addr = get4bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- len -= 5;
- doit:
- cksum += B0(addr) + B1(addr) + B2(addr) + B3(addr);
-
- tb.dl_destaddr = addr;
- while (len--)
- {
- if ((c = getbyte(&p)) == -1)
- badformat(buff, inm, BADDATA);
- cksum += c;
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- }
- break;
-
- case 0x07: /* 32 bit end record */
- if ((addr = get4bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- goto end_rec;
-
- case 0x08: /* 24 bit end record */
- if ((addr = get3bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- goto end_rec;
-
- case 0x09: /* 16 bit end record */
- if ((addr = get2bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
-
-end_rec:
- cksum += B0(addr) + B1(addr) + B2(addr) + B3(addr);
- tb.dl_jumpaddr = addr;
- break;
-
- default:
- error(0, "unknown Motorola-S record type: 0x%02x", rectype);
- badformat(buff, inm, BADTYPE);
- break;
- }
-
- /*
- * Verify checksums are correct in file.
- */
-
- cksum = (~cksum) & 0xff;
- if ((incksum = getbyte(&p)) == -1)
- badformat(buff, inm, BADCSUM);
- if (((u8) incksum) != cksum)
- badformat(buff, inm, MISCSUM);
-
-write_it:
- if (tb.dl_count)
- write_record(&tb, ofp);
- }
- return 0;
-}
-
-int
-convert_TI_records(
- FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- char buff[512];
- char *p;
- int c;
- bool endrecord = FALSE;
- bool eol;
- buffer_rec tb;
-
- while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
- {
- if (p[strlen(p)-1] == '\n') /* get rid of newline */
- p[strlen(p)-1] = '\0';
-
- if (p[strlen(p)-1] == '\r') /* get rid of any CR */
- p[strlen(p)-1] = '\0';
-
- tb.dl_count = 0;
-
- p = &buff[0];
- eol = FALSE;
- while ( ! eol && ! endrecord)
- {
- switch (*p++)
- {
- case '9':
- if (tb.dl_count)
- write_record(&tb, ofp);
- tb.dl_destaddr = get2bytes(&p);
- break;
-
- case 'B':
- c = getbyte(&p);
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- c = getbyte(&p);
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- break;
-
- case 'F':
- eol = TRUE;
- break;
-
- case ':':
- endrecord = TRUE;
- break;
-
- default:
- badformat(p, inm, BADFMT);
- }
- }
- if (tb.dl_count)
- write_record(&tb, ofp);
- }
- return 0;
-}
-
-void
-write_record(buffer_rec *tb,
- FILE *fp)
-{
- if ( ! linear)
- {
- if (tb->dl_destaddr < base)
- error(ERR_FATAL, "record at address 0x%x precedes base of 0x%x",
- tb->dl_destaddr, base);
- (void) fseek(fp, tb->dl_destaddr - base, 0);
- }
-
- (void) fwrite(tb->dl_buf, tb->dl_count, 1, fp);
- tb->dl_destaddr += tb->dl_count;
- tb->dl_count = 0;
-}
-
-int
-getnibble(char **p)
-{
- register int val;
-
- **p = toupper(**p);
- switch (**p)
- {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- val = **p - '0';
- break;
-
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- val = 10 + (**p - 'A');
- break;
-
- default:
- return(-1);
- }
- *p += 1;
-
- return(val & 0x0f);
-}
-
-int
-getbyte(char **p)
-{
- int n0, n1;
-
- if ((n0 = getnibble(p)) == -1)
- return(-1);
- if ((n1 = getnibble(p)) == -1)
- return(-1);
-
- return(((n0 << 4) + n1) & 0xff);
-}
-
-long
-getNbytes(char **p,
- int n)
-{
- int t;
- u32 val = 0;
-
- while (n--)
- {
- if ((t = getbyte(p)) == -1)
- return(-1L);
- val <<= 8;
- val += t;
- }
-
- return(val);
-}
-
-void
-badformat(char *s,
- char *fname,
- char *msg)
-{
- if (s[strlen(s)-1] == '\n') /* get rid of newline */
- s[strlen(s)-1] = '\0';
- error(0, "line '%s'::\n\tfrom file '%s'; %s", s, fname, msg);
- exit(1);
-}
-
-/*
- * error(errn, arglist)
- * report an error to stderr using printf(3) conventions.
- * Any output is preceded by '<progname>: '
- *
- * Uses ERR_EXIT bit to request exit(errn)
- * ERR_ABORT to request abort()
- * ERR_ERRNO to indicate use of errno instead of argument.
- *
- * If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
- * associated error message is appended to the output.
- */
-
-/*VARARGS*/
-
-void
-error(int error_flag, ...)
-{
- va_list arglist;
- register char *format;
- int local_errno;
-
- extern int errno;
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- local_errno = error_flag & ~ERR_MASK;
- if (error_flag & ERR_ERRNO) /* use errno? */
- local_errno = errno;
-
- va_start(arglist, error_flag);
- format = va_arg(arglist, char *);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, format, arglist);
- va_end(arglist);
-
- if (local_errno)
- (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
- else
- (void) fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (ERR_FATAL | ERR_ABORT))
- {
- if (error_flag & ERR_FATAL)
- {
- error(0, "fatal error, exiting");
- exit(local_errno ? local_errno : 1);
- }
- else
- {
- error(0, "fatal error, aborting");
- abort();
- }
- }
-}
-
diff --git a/c/build-tools/unlock-directory.in b/c/build-tools/unlock-directory.in
deleted file mode 100644
index c63ceff881..0000000000
--- a/c/build-tools/unlock-directory.in
+++ /dev/null
@@ -1,41 +0,0 @@
-#!@KSH@
-#
-# $Id$
-#
-# Unlock a directory processed by lock_directory
-#
-
-# is a particular command available on this machine?
-#
-cmd_avail()
-{
- set -- `type $1 2>&1`
- if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ]
- then
- return 1
- else
- return 0
- fi
-}
-
-unlock_directory() {
- ul_dir=$1/. # get any symlink out of the way using '.'
- if [ -d $ul_dir ]
- then
- find $ul_dir -type d ! -perm -0222 -print | $XARGS -t chmod +w
- fi
-}
-
-# Use gnu xargs if available; faster, more reliable in general
-XARGS=xargs
-cmd_avail gxargs && XARGS=gxargs
-
-for dir
-do
- unlock_directory $dir
-done
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
-
diff --git a/c/src/Makefile.in b/c/src/Makefile.in
deleted file mode 100644
index caaf179f90..0000000000
--- a/c/src/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=exec lib tests/tools tests/support tests/samples
-
-
diff --git a/c/src/README b/c/src/README
deleted file mode 100644
index 3e242504dc..0000000000
--- a/c/src/README
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# $Id$
-#
-
-This is the top level directory of the C RTEMS environment. The
-following is a description of the contents of each file and
-subdirectory directly in this directory:
-
- tests
-
- This directory contains the RTEMS Test Suites. Currently
- this includes the following suites:
-
- + Single Processor Test Suite
- + Multiprocessor Test Suite
- + Timing Test Suite
- + Sample Application Suite
-
- lib
-
- This directory contains src for RTEMS libraries:
- libc, board support (including drivers) and libcpu.
-
- exec
-
- This directory contains the source code for the RTEMS executive.
-
diff --git a/c/src/ada-tests/mptests/mp01/config.h b/c/src/ada-tests/mptests/mp01/config.h
deleted file mode 100644
index 513e94359d..0000000000
--- a/c/src/ada-tests/mptests/mp01/config.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/mptests/mp01/mp01.adb b/c/src/ada-tests/mptests/mp01/mp01.adb
deleted file mode 100644
index 0b1e0a0eba..0000000000
--- a/c/src/ada-tests/mptests/mp01/mp01.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test MP01 of the Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with MPTEST;
-with TEST_SUPPORT;
-
-procedure MP01 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.GLOBAL,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- MPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end MP01;
-
diff --git a/c/src/ada-tests/mptests/mp01/mptest.adb b/c/src/ada-tests/mptests/mp01/mptest.adb
deleted file mode 100644
index 3f3fbe6c30..0000000000
--- a/c/src/ada-tests/mptests/mp01/mptest.adb
+++ /dev/null
@@ -1,235 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 1 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- C : RTEMS.CHARACTER;
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** TEST 1 -- NODE " );
- UNSIGNED32_IO.PUT(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- WIDTH => 1
- );
- TEXT_IO.PUT_LINE( " ***" );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE /= 1 then
- C := 'S';
- else
- C := 'M';
- end if;
-
- MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( C, 'A', '1', ' ' );
- MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( C, 'A', '2', ' ' );
- MPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( C, 'A', '3', ' ' );
-
- TIME := ( 1988, 12, 31, 9, 0, 0, 0 );
-
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" );
-
- TEXT_IO.PUT_LINE( "Creating task 1 (Global)" );
-
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.GLOBAL,
- MPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- TEXT_IO.PUT_LINE( "Creating task 2 (Global)" );
-
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( 2 ),
- 1,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.GLOBAL,
- MPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- TEXT_IO.PUT_LINE( "Creating task 3 (Local)" );
-
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( 3 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- MPTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" );
-
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 1 ),
- MPTEST.TEST_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 2 ),
- MPTEST.TEST_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 3 ),
- MPTEST.TEST_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_TASK
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TIME : RTEMS.TIME_OF_DAY;
- TID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- TEST_SUPPORT.PUT_NAME(
- MPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ),
- FALSE
- );
-
- TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- RTEMS.TASK_WAKE_AFTER(
- TEST_SUPPORT.TASK_NUMBER( TID ) * 5 *
- TEST_SUPPORT.TICKS_PER_SECOND,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- TEST_SUPPORT.PUT_NAME(
- MPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ),
- FALSE
- );
-
- TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- if TEST_SUPPORT.TASK_NUMBER( TID ) = 1 then -- TASK 1
-
- TEST_SUPPORT.PUT_NAME(
- MPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ),
- FALSE
- );
-
- TEXT_IO.PUT_LINE( " - deleting self" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- else if TEST_SUPPORT.TASK_NUMBER( TID ) = 2 then -- TASK 2
-
- TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 2 ), FALSE );
- TEXT_IO.PUT( " - waiting to be deleted by " );
- TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 3 ), TRUE );
-
- loop
- TEST_SUPPORT.DO_NOTHING; -- can't be optimized away
- end loop;
-
- else -- TASK 3
-
- TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 3 ), FALSE );
- TEXT_IO.PUT( " - getting TID of " );
- TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 2 ), TRUE );
-
- RTEMS.TASK_IDENT(
- MPTEST.TASK_NAME( 2 ),
- RTEMS.SEARCH_ALL_NODES,
- TID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA2" );
-
- TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 3 ), FALSE );
- TEXT_IO.PUT( " - deleting " );
- TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 2 ), TRUE );
-
- RTEMS.TASK_DELETE( TID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" );
-
- end if;
- end if;
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 1 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TEST_TASK;
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp01/mptest.ads b/c/src/ada-tests/mptests/mp01/mptest.ads
deleted file mode 100644
index 42bf917bb1..0000000000
--- a/c/src/ada-tests/mptests/mp01/mptest.ads
+++ /dev/null
@@ -1,164 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 1 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This is the body of the RTEMS tasks which constitute this test.
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.GLOBAL, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.NO_PREEMPT, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 33, -- maximum # global objects
- 33 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 0, -- maximum # timers
- 0, -- maximum # semaphores
- 0, -- maximum # message queues
- 0, -- maximum # messages
- 0, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 50 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp01/node1/mp01.scn b/c/src/ada-tests/mptests/mp01/node1/mp01.scn
deleted file mode 100644
index d7495bfa0d..0000000000
--- a/c/src/ada-tests/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 - clock_get - 9: 0: 0 12/31/1988
-MA2 - clock_get - 9: 0: 0 12/31/1988
-MA3 - clock_get - 9: 0: 0 12/31/1988
-MA1 - clock_get - 9: 0: 5 12/31/1988
-MA1 - deleting self
-MA2 - clock_get - 9: 0:10 12/31/1988
-MA2 - waiting to be deleted by MA3
-MA3 - clock_get - 9: 0:15 12/31/1988
-MA3 - getting TID of MA2
-MA3 - deleting MA2
-*** END OF TEST 1 ***
diff --git a/c/src/ada-tests/mptests/mp01/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp01/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/mptests/mp01/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp01/node2/mp01.scn b/c/src/ada-tests/mptests/mp01/node2/mp01.scn
deleted file mode 100644
index 98047240f3..0000000000
--- a/c/src/ada-tests/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 - clock_get - 9: 0: 0 12/31/1988
-SA2 - clock_get - 9: 0: 0 12/31/1988
-SA3 - clock_get - 9: 0: 0 12/31/1988
-SA1 - clock_get - 9: 0: 5 12/31/1988
-SA1 - deleting self
-SA2 - clock_get - 9: 0:10 12/31/1988
-SA2 - waiting to be deleted by SA3
-SA3 - clock_get - 9: 0:15 12/31/1988
-SA3 - getting TID of SA2
-SA3 - deleting SA2
-*** END OF TEST 1 ***
diff --git a/c/src/ada-tests/mptests/mp01/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp01/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/mptests/mp01/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp02/mptest.adb b/c/src/ada-tests/mptests/mp02/mptest.adb
deleted file mode 100644
index 44b6d564ad..0000000000
--- a/c/src/ada-tests/mptests/mp02/mptest.adb
+++ /dev/null
@@ -1,213 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 2 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** TEST 2 -- NODE " );
- UNSIGNED32_IO.PUT(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- WIDTH => 1
- );
- TEXT_IO.PUT_LINE( " ***" );
-
- MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' );
- MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' );
-
- TEXT_IO.PUT_LINE( "Creating test task (Global)" );
-
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( MPTEST.MULTIPROCESSING_CONFIGURATION.NODE ),
- 1,
- 2048,
- RTEMS.NO_PREEMPT,
- RTEMS.GLOBAL,
- MPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 1 ),
- MPTEST.TEST_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_TASK
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TID : RTEMS.ID;
- TEST_TID : RTEMS.ID;
- REMOTE_TID : RTEMS.ID;
- REMOTE_NODE : RTEMS.UNSIGNED32;
- NOTE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
- REMOTE_NODE := 2;
- else
- REMOTE_NODE := 1;
- end if;
-
- TEXT_IO.PUT_LINE( "Getting TID of remote task (all nodes)" );
-
- loop
-
- RTEMS.TASK_IDENT(
- MPTEST.TASK_NAME( REMOTE_NODE ),
- RTEMS.SEARCH_ALL_NODES,
- REMOTE_TID,
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- end loop;
-
- --
- -- We just got this ID above so looping is not necessary.
- --
-
- TEXT_IO.PUT_LINE( "Getting TID of remote task (1 node)" );
- RTEMS.TASK_IDENT(
- MPTEST.TASK_NAME( REMOTE_NODE ),
- REMOTE_NODE,
- TEST_TID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT" );
-
- if TEST_TID /= REMOTE_TID then
- TEXT_IO.PUT_LINE( "task_ident tid's do not match!!" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
- end if;
-
- RTEMS.TASK_DELETE( REMOTE_TID, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.ILLEGAL_ON_REMOTE_OBJECT,
- "task_delete of remote task"
- );
- TEXT_IO.PUT_LINE(
- "task_delete of remote task returned the correct error"
- );
-
- RTEMS.TASK_START( REMOTE_TID, MPTEST.TEST_TASK'ACCESS, 0, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.ILLEGAL_ON_REMOTE_OBJECT,
- "task_start of remote task"
- );
- TEXT_IO.PUT_LINE(
- "task_start of remote task returned the correct error"
- );
-
- RTEMS.TASK_RESTART( REMOTE_TID, 0, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.ILLEGAL_ON_REMOTE_OBJECT,
- "task_restart of remote task"
- );
- TEXT_IO.PUT_LINE(
- "task_restart of remote task returned the correct error"
- );
-
-
- TEXT_IO.PUT( "Setting notepad " );
- UNSIGNED32_IO.PUT( RTEMS.GET_NODE( TID ), WIDTH=>1 );
- TEXT_IO.PUT( " of the remote task to " );
- UNSIGNED32_IO.PUT( RTEMS.GET_NODE( TID ), WIDTH=>1 );
- TEXT_IO.NEW_LINE;
- RTEMS.TASK_SET_NOTE(
- REMOTE_TID,
- RTEMS.GET_NODE( TID ),
- RTEMS.GET_NODE( TID ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_NOTE" );
-
- TEXT_IO.PUT_LINE( "Getting a notepad of the remote task" );
- RTEMS.TASK_GET_NOTE(
- REMOTE_TID,
- RTEMS.GET_NODE( TID ),
- NOTE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_GET_NOTE" );
-
- if NOTE = RTEMS.GET_NODE( TID ) then
- TEXT_IO.PUT_LINE( "Remote notepad set and read correctly" );
- else
- TEXT_IO.PUT(
- "FAILURE!!! Remote notepad was not set and read correctly ("
- );
- UNSIGNED32_IO.PUT( NOTE );
- TEXT_IO.PUT( ", " );
- UNSIGNED32_IO.PUT( RTEMS.GET_NODE( TID ) );
- TEXT_IO.PUT_LINE( ")" );
-
- end if;
-
- RTEMS.TASK_DELETE( REMOTE_TID, STATUS );
- TEXT_IO.PUT_LINE( "*** END OF TEST 2 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TEST_TASK;
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp02/mptest.ads b/c/src/ada-tests/mptests/mp02/mptest.ads
deleted file mode 100644
index 82e7aacbb3..0000000000
--- a/c/src/ada-tests/mptests/mp02/mptest.ads
+++ /dev/null
@@ -1,164 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 2 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This is the body of the RTEMS tasks which constitute this test.
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.DEFAULT_ATTRIBUTES, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.NO_PREEMPT, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 32, -- maximum # global objects
- 32 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 0, -- maximum # timers
- 0, -- maximum # semaphores
- 0, -- maximum # message queues
- 0, -- maximum # messages
- 0, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 50 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp02/node1/mp02.scn b/c/src/ada-tests/mptests/mp02/node1/mp02.scn
deleted file mode 100644
index 91b57321f7..0000000000
--- a/c/src/ada-tests/mptests/mp02/node1/mp02.scn
+++ /dev/null
@@ -1,11 +0,0 @@
-*** TEST 2 -- NODE 1 ***
-Creating test task (Global)
-Getting TID of remote task (all nodes)
-Getting TID of remote task (1 node)
-task_delete of remote task returned the correct error
-task_start of remote task returned the correct error
-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/c/src/ada-tests/mptests/mp02/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp02/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/mptests/mp02/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp02/node2/mp02.scn b/c/src/ada-tests/mptests/mp02/node2/mp02.scn
deleted file mode 100644
index 14239a546d..0000000000
--- a/c/src/ada-tests/mptests/mp02/node2/mp02.scn
+++ /dev/null
@@ -1,11 +0,0 @@
-*** TEST 2 -- NODE 2 ***
-Creating test task (Global)
-Getting TID of remote task (all nodes)
-Getting TID of remote task (1 node)
-task_delete of remote task returned the correct error
-task_start of remote task returned the correct error
-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/c/src/ada-tests/mptests/mp02/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp02/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/mptests/mp02/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp03/mptest.adb b/c/src/ada-tests/mptests/mp03/mptest.adb
deleted file mode 100644
index ea662c3422..0000000000
--- a/c/src/ada-tests/mptests/mp03/mptest.adb
+++ /dev/null
@@ -1,277 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 3 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** TEST 3 -- NODE " );
- UNSIGNED32_IO.PUT(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- WIDTH => 1
- );
- TEXT_IO.PUT_LINE( " ***" );
-
- MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' );
- MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' );
-
- TEXT_IO.PUT_LINE( "Creating Test_task (Global)" );
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( MPTEST.MULTIPROCESSING_CONFIGURATION.NODE ),
- 1,
- 2048,
- RTEMS.NO_PREEMPT,
- RTEMS.GLOBAL,
- MPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Test_task (Global)" );
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 1 ),
- MPTEST.TEST_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' );
-
- RTEMS.TIMER_CREATE(
- MPTEST.TIMER_NAME( 1 ),
- MPTEST.TIMER_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" );
-
- TEXT_IO.PUT_LINE( "Deleting initialization task" );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- DELAYED_SEND_EVENT
---
-
- procedure DELAYED_SEND_EVENT (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.EVENT_SEND( MPTEST.TASK_ID( 1 ), RTEMS.EVENT_16, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" );
-
- end DELAYED_SEND_EVENT;
-
---PAGE
---
--- TEST_TASK
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );
-
- TEXT_IO.PUT_LINE( "Getting TID of remote task" );
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
- MPTEST.REMOTE_NODE := 2;
- else
- MPTEST.REMOTE_NODE := 1;
- end if;
-
- TEXT_IO.PUT( "Remote task's name is : " );
- TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE );
-
- loop
-
- RTEMS.TASK_IDENT(
- MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.REMOTE_TID,
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- end loop;
-
- RTEMS.TIMER_FIRE_AFTER(
- MPTEST.TIMER_ID( 1 ),
- 10 * TEST_SUPPORT.TICKS_PER_SECOND,
- MPTEST.DELAYED_SEND_EVENT'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" );
-
- MPTEST.TEST_TASK_SUPPORT( 1 );
-
- RTEMS.TIMER_FIRE_AFTER(
- MPTEST.TIMER_ID( 1 ),
- 11 * TEST_SUPPORT.TICKS_PER_SECOND,
- MPTEST.DELAYED_SEND_EVENT'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 2 then
-
- RTEMS.TASK_WAKE_AFTER(
- 2 * TEST_SUPPORT.TICKS_PER_SECOND,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- end if;
-
- MPTEST.TEST_TASK_SUPPORT( 2 );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 3 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TEST_TASK;
-
---PAGE
---
--- TEST_TASK_SUPPORT
---
-
-
- procedure TEST_TASK_SUPPORT (
- NODE : in RTEMS.UNSIGNED32
- ) is
- EVENTS : RTEMS.EVENT_SET;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = NODE then
-
- loop
-
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_16,
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- EVENTS,
- STATUS
- );
-
- exit when RTEMS.ARE_STATUSES_EQUAL( RTEMS.SUCCESSFUL, STATUS );
-
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.UNSATISFIED,
- "EVENT_RECEIVE"
- );
-
- RTEMS.TASK_WAKE_AFTER(
- 2 * TEST_SUPPORT.TICKS_PER_SECOND,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( NODE ), FALSE );
- TEXT_IO.PUT_LINE( " - Suspending remote task" );
- RTEMS.TASK_SUSPEND( MPTEST.REMOTE_TID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" );
-
- RTEMS.TASK_WAKE_AFTER(
- 2 * TEST_SUPPORT.TICKS_PER_SECOND,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( NODE ), FALSE );
- TEXT_IO.PUT_LINE( " - Resuming remote task" );
-
- RTEMS.TASK_RESUME( MPTEST.REMOTE_TID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" );
-
- end loop;
-
- else
-
- loop
-
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_16,
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- EVENTS,
- STATUS
- );
-
- exit when RTEMS.ARE_STATUSES_EQUAL( RTEMS.SUCCESSFUL, STATUS );
-
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.UNSATISFIED,
- "EVENT_RECEIVE"
- );
-
- TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( REMOTE_NODE ), FALSE );
- TEXT_IO.PUT_LINE( " - have I been suspended???" );
- RTEMS.TASK_WAKE_AFTER(
- TEST_SUPPORT.TICKS_PER_SECOND / 2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- end loop;
-
- end if;
-
- end TEST_TASK_SUPPORT;
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp03/mptest.ads b/c/src/ada-tests/mptests/mp03/mptest.ads
deleted file mode 100644
index 5542682111..0000000000
--- a/c/src/ada-tests/mptests/mp03/mptest.ads
+++ /dev/null
@@ -1,214 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 3 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS timers created
--- by this test.
---
-
- TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- This variable contains the ID of the remote task with which this
--- test interacts.
---
-
- REMOTE_TID : RTEMS.ID;
-
---
--- This variable contains the node on which the remote task with which
--- this test interacts resides.
---
-
- REMOTE_NODE : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- DELAYED_SEND_EVENT
---
--- DESCRIPTION:
---
--- This subprogram is a timer service routine which sends an
--- event set to a waiting task.
---
-
- procedure DELAYED_SEND_EVENT (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This is the body of the RTEMS tasks which constitute this test.
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK_SUPPORT
---
--- DESCRIPTION:
---
--- This subprogram performs the bulk of the test. Based on the NODE
--- specified, this subprogram loops suspending/resuming a remote task
--- or waiting for itself to be suspended/resumed.
---
-
- procedure TEST_TASK_SUPPORT (
- NODE : in RTEMS.UNSIGNED32
- );
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.DEFAULT_ATTRIBUTES, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.NO_PREEMPT, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 32, -- maximum # global objects
- 32 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 1, -- maximum # timers
- 0, -- maximum # semaphores
- 0, -- maximum # message queues
- 0, -- maximum # messages
- 0, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 50 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp03/node1/mp03.scn b/c/src/ada-tests/mptests/mp03/node1/mp03.scn
deleted file mode 100644
index d749db49e2..0000000000
--- a/c/src/ada-tests/mptests/mp03/node1/mp03.scn
+++ /dev/null
@@ -1,28 +0,0 @@
-*** TEST 3 -- NODE 1 ***
-Creating Test_task (Global)
-Starting Test_task (Global)
-Deleting initialization task
-Getting TID of remote task
-Remote task's name is : 222
-111 - Suspending remote task
-111 - Resuming remote task
-111 - Suspending remote task
-111 - Resuming remote task
-111 - Suspending remote task
-111 - Resuming remote task
-222 - have I been suspended???
-222 - have I been suspended???
-222 - have I been suspended???
-222 - have I been suspended???
-222 - have I been suspended???
-222 - have I been suspended???
-222 - have I been suspended???
-222 - have I been suspended???
-222 - have I been suspended???
-222 - have I been suspended???
-222 - have I been suspended???
-222 - have I been suspended???
-222 - have I been suspended???
-222 - have I been suspended???
-*** END OF TEST 3 ***
-
diff --git a/c/src/ada-tests/mptests/mp03/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp03/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/mptests/mp03/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp03/node2/mp03.scn b/c/src/ada-tests/mptests/mp03/node2/mp03.scn
deleted file mode 100644
index 56298f5b8d..0000000000
--- a/c/src/ada-tests/mptests/mp03/node2/mp03.scn
+++ /dev/null
@@ -1,28 +0,0 @@
-*** TEST 3 -- NODE 2 ***
-Creating Test_task (Global)
-Starting Test_task (Global)
-Deleting initialization task
-Getting TID of remote task
-Remote task's name is : 111
-111 - have I been suspended???
-111 - have I been suspended???
-111 - have I been suspended???
-111 - have I been suspended???
-111 - have I been suspended???
-111 - have I been suspended???
-111 - have I been suspended???
-111 - have I been suspended???
-111 - have I been suspended???
-111 - have I been suspended???
-111 - have I been suspended???
-111 - have I been suspended???
-111 - have I been suspended???
-111 - have I been suspended???
-222 - Suspending remote task
-222 - Resuming remote task
-222 - Suspending remote task
-222 - Resuming remote task
-222 - Suspending remote task
-222 - Resuming remote task
-*** END OF TEST 3 ***
-
diff --git a/c/src/ada-tests/mptests/mp03/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp03/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/mptests/mp03/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp04/mptest.adb b/c/src/ada-tests/mptests/mp04/mptest.adb
deleted file mode 100644
index c44f521eaa..0000000000
--- a/c/src/ada-tests/mptests/mp04/mptest.adb
+++ /dev/null
@@ -1,169 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 4 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** TEST 4 -- NODE " );
- UNSIGNED32_IO.PUT(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- WIDTH => 1
- );
- TEXT_IO.PUT_LINE( " ***" );
-
- MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' );
- MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' );
-
- TEXT_IO.PUT_LINE( "Creating Test_task (Global)" );
-
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( MPTEST.MULTIPROCESSING_CONFIGURATION.NODE ),
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.GLOBAL,
- MPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Test_task (Global)" );
-
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 1 ),
- MPTEST.TEST_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- TEXT_IO.PUT_LINE( "Deleting initialization task" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_TASK
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TID : RTEMS.ID;
- PREVIOUS_PRIORITY : RTEMS.TASK_PRIORITY;
- PREVIOUS_PRIORITY_1 : RTEMS.TASK_PRIORITY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );
-
- TEXT_IO.PUT_LINE( "Getting TID of remote task" );
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
- MPTEST.REMOTE_NODE := 2;
- else
- MPTEST.REMOTE_NODE := 1;
- end if;
-
- TEXT_IO.PUT( "Remote task's name is : " );
- TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE );
-
- loop
-
- RTEMS.TASK_IDENT(
- MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.REMOTE_TID,
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- end loop;
-
- RTEMS.TASK_SET_PRIORITY(
- MPTEST.REMOTE_TID,
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- PREVIOUS_PRIORITY,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
-
- if PREVIOUS_PRIORITY /= MPTEST.REMOTE_NODE then
-
- TEXT_IO.PUT( "Remote priority (0x" );
- UNSIGNED32_IO.PUT( PREVIOUS_PRIORITY, BASE => 16 );
- TEXT_IO.PUT( "does not match remote node (0x" );
- UNSIGNED32_IO.PUT( MPTEST.REMOTE_NODE, BASE => 16 );
- TEXT_IO.PUT_LINE( ")!!!" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 16#F00000# );
-
- end if;
-
- loop
-
- RTEMS.TASK_SET_PRIORITY(
- RTEMS.SELF,
- RTEMS.CURRENT_PRIORITY,
- PREVIOUS_PRIORITY_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
-
- exit when PREVIOUS_PRIORITY_1 = MPTEST.REMOTE_NODE;
-
- end loop;
-
-
- TEXT_IO.PUT_LINE( "Local task priority has been set" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 4 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TEST_TASK;
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp04/mptest.ads b/c/src/ada-tests/mptests/mp04/mptest.ads
deleted file mode 100644
index 2541ff5a93..0000000000
--- a/c/src/ada-tests/mptests/mp04/mptest.ads
+++ /dev/null
@@ -1,178 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 4 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- This variable contains the ID of the remote task with which this
--- test interacts.
---
-
- REMOTE_TID : RTEMS.ID;
-
---
--- This variable contains the node on which the remote task with which
--- this test interacts resides.
---
-
- REMOTE_NODE : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This is the body of the RTEMS tasks which constitute this test.
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.DEFAULT_ATTRIBUTES, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.NO_PREEMPT, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 32, -- maximum # global objects
- 32 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 1, -- maximum # timers
- 0, -- maximum # semaphores
- 0, -- maximum # message queues
- 0, -- maximum # messages
- 0, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 50 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp04/node1/mp04.scn b/c/src/ada-tests/mptests/mp04/node1/mp04.scn
deleted file mode 100644
index e9518f3ac2..0000000000
--- a/c/src/ada-tests/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/c/src/ada-tests/mptests/mp04/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp04/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/mptests/mp04/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp04/node2/mp04.scn b/c/src/ada-tests/mptests/mp04/node2/mp04.scn
deleted file mode 100644
index 8ccfcfef79..0000000000
--- a/c/src/ada-tests/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/c/src/ada-tests/mptests/mp04/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp04/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/mptests/mp04/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp05/mptest.adb b/c/src/ada-tests/mptests/mp05/mptest.adb
deleted file mode 100644
index 2bab2ddbb7..0000000000
--- a/c/src/ada-tests/mptests/mp05/mptest.adb
+++ /dev/null
@@ -1,252 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 5 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** TEST 5 -- NODE " );
- UNSIGNED32_IO.PUT(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- WIDTH => 1
- );
- TEXT_IO.PUT_LINE( " ***" );
-
- MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' );
- MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' );
-
- TEXT_IO.PUT_LINE( "Creating Test_task (Global)" );
-
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( MPTEST.MULTIPROCESSING_CONFIGURATION.NODE ),
- 1,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.GLOBAL,
- MPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Test_task (Global)" );
-
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 1 ),
- MPTEST.TEST_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' );
- MPTEST.TIMER_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'M', '2', ' ' );
-
- RTEMS.TIMER_CREATE(
- MPTEST.TIMER_NAME( MPTEST.MULTIPROCESSING_CONFIGURATION.NODE ),
- MPTEST.TIMER_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" );
-
- TEXT_IO.PUT_LINE( "Deleting initialization task" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- PROCESS_ASR
---
-
- procedure PROCESS_ASR (
- SIGNAL : in RTEMS.SIGNAL_SET
- )
- is
- begin
-
- if SIGNAL /= MPTEST.EXPECTED_SIGNAL then
-
- TEXT_IO.PUT( "ERROR: I was expecting signal 0x" );
- UNSIGNED32_IO.PUT( EXPECTED_SIGNAL, BASE => 16 );
- TEXT_IO.PUT( " got 0x" );
- UNSIGNED32_IO.PUT( SIGNAL, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- RTEMS.FATAL_ERROR_OCCURRED( 16#000F_0000# );
-
- end if;
-
- MPTEST.SIGNAL_CAUGHT := TRUE;
-
- end PROCESS_ASR;
-
---PAGE
---
--- STOP_TEST_TSR
---
-
- procedure STOP_TEST_TSR (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- ) is
- begin
-
- MPTEST.STOP_TEST := TRUE;
-
- end STOP_TEST_TSR;
-
---PAGE
---
--- TEST_TASK
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- MPTEST.STOP_TEST := FALSE;
-
- MPTEST.SIGNAL_CAUGHT := FALSE;
- MPTEST.SIGNAL_COUNT := 0;
-
- TEXT_IO.PUT_LINE( "signal_catch: initializing signal catcher" );
- RTEMS.SIGNAL_CATCH(
- MPTEST.PROCESS_ASR'ACCESS,
- RTEMS.NO_ASR + RTEMS.NO_PREEMPT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
- MPTEST.REMOTE_NODE := 2;
- MPTEST.REMOTE_SIGNAL := RTEMS.SIGNAL_18;
- MPTEST.EXPECTED_SIGNAL := RTEMS.SIGNAL_17;
- else
- MPTEST.REMOTE_NODE := 1;
- MPTEST.REMOTE_SIGNAL := RTEMS.SIGNAL_17;
- MPTEST.EXPECTED_SIGNAL := RTEMS.SIGNAL_18;
- end if;
-
- TEXT_IO.PUT( "Remote task's name is : " );
- TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE );
-
- TEXT_IO.PUT_LINE( "Getting TID of remote task" );
- loop
-
- RTEMS.TASK_IDENT(
- MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.REMOTE_TID,
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- end loop;
-
- RTEMS.TIMER_FIRE_AFTER(
- MPTEST.TIMER_ID( 1 ),
- 3 * TEST_SUPPORT.TICKS_PER_SECOND,
- MPTEST.STOP_TEST_TSR'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- TEXT_IO.PUT_LINE( "Sending signal to remote task" );
- loop
- RTEMS.SIGNAL_SEND(
- MPTEST.REMOTE_TID,
- MPTEST.REMOTE_SIGNAL,
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- exit when not RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.NOT_DEFINED );
-
- end loop;
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" );
-
- end if;
-
- loop
-
- exit when MPTEST.STOP_TEST = TRUE;
-
- if MPTEST.SIGNAL_CAUGHT = TRUE then
-
- MPTEST.SIGNAL_CAUGHT := FALSE;
- MPTEST.SIGNAL_COUNT := MPTEST.SIGNAL_COUNT + 1;
-
- if MPTEST.SIGNAL_COUNT >= MPTEST.SIGNALS_PER_DOT then
-
- MPTEST.SIGNAL_COUNT := 0;
-
- TEST_SUPPORT.PUT_DOT( "." );
-
- end if;
-
- RTEMS.SIGNAL_SEND(
- MPTEST.REMOTE_TID,
- MPTEST.REMOTE_SIGNAL,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" );
-
- end if;
-
- end loop;
-
- TEXT_IO.NEW_LINE;
- TEXT_IO.PUT_LINE( "*** END OF TEST 5 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TEST_TASK;
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp05/mptest.ads b/c/src/ada-tests/mptests/mp05/mptest.ads
deleted file mode 100644
index 9f95ede392..0000000000
--- a/c/src/ada-tests/mptests/mp05/mptest.ads
+++ /dev/null
@@ -1,243 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 5 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS timers created
--- by this test.
---
-
- TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- This variable is set when the test should stop executing.
---
- STOP_TEST : RTEMS.BOOLEAN;
-
---
--- This variable contains the ID of the remote task with which this
--- test interacts.
---
-
- REMOTE_TID : RTEMS.ID;
-
---
--- This variable contains the node on which the remote task with which
--- this test interacts resides.
---
-
- REMOTE_NODE : RTEMS.UNSIGNED32;
-
---
--- This is the signal set which is sent to the task on the other node.
---
-
- REMOTE_SIGNAL : RTEMS.SIGNAL_SET;
-
---
--- This is the signal set the task on this node expects to receive
--- from the other node.
---
-
- EXPECTED_SIGNAL : RTEMS.SIGNAL_SET;
-
---
--- These keep track of if a signal set has been caught and how many
--- signal sets have been caught cumulative.
---
-
- SIGNAL_CAUGHT : RTEMS.BOOLEAN;
- SIGNAL_COUNT : RTEMS.UNSIGNED32;
-
---
--- The number of signals to process per dot printed out.
---
-
- SIGNALS_PER_DOT : constant RTEMS.UNSIGNED32 := 15;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- PROCESS_ASR
---
--- DESCRIPTION:
---
--- This subprogram is an ASR for TEST_TASK.
---
-
- procedure PROCESS_ASR (
- SIGNAL : in RTEMS.SIGNAL_SET
- );
-
---
--- STOP_TEST_TSR
---
--- DESCRIPTION:
---
--- This subprogram is a TSR which sets the "stop test" flag.
---
-
- procedure STOP_TEST_TSR (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This is the body of the RTEMS tasks which constitute this test.
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.DEFAULT_ATTRIBUTES, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.NO_PREEMPT, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 32, -- maximum # global objects
- 32 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 1, -- maximum # timers
- 2, -- maximum # semaphores
- 0, -- maximum # message queues
- 0, -- maximum # messages
- 0, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 50 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp05/node1/mp05.scn b/c/src/ada-tests/mptests/mp05/node1/mp05.scn
deleted file mode 100644
index 6f0ea4b639..0000000000
--- a/c/src/ada-tests/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
-signal_catch: initializing signal catcher
-Remote task's name is : 222
-Getting TID of remote task
-Sending signal to remote task
-....................................................
-....................................................
-*** END OF TEST 5 ***
diff --git a/c/src/ada-tests/mptests/mp05/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp05/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/mptests/mp05/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp05/node2/mp05.scn b/c/src/ada-tests/mptests/mp05/node2/mp05.scn
deleted file mode 100644
index 1fb18c132b..0000000000
--- a/c/src/ada-tests/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
-signal_catch: initializing signal catcher
-Remote task's name is : 111
-Getting TID of remote task
-....................................................
-....................................................
-*** END OF TEST 5 ***
diff --git a/c/src/ada-tests/mptests/mp05/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp05/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/mptests/mp05/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp06/mptest.adb b/c/src/ada-tests/mptests/mp06/mptest.adb
deleted file mode 100644
index 56a0841e20..0000000000
--- a/c/src/ada-tests/mptests/mp06/mptest.adb
+++ /dev/null
@@ -1,257 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 6 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** TEST 6 -- NODE " );
- UNSIGNED32_IO.PUT(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- WIDTH => 1
- );
- TEXT_IO.PUT_LINE( " ***" );
-
- MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' );
- MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' );
-
- TEXT_IO.PUT_LINE( "Creating Test_task (Global)" );
-
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( MPTEST.MULTIPROCESSING_CONFIGURATION.NODE ),
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.GLOBAL,
- MPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Test_task (Global)" );
-
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 1 ),
- MPTEST.TEST_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' );
- MPTEST.TIMER_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'M', '2', ' ' );
-
- RTEMS.TIMER_CREATE(
- MPTEST.TIMER_NAME( MPTEST.MULTIPROCESSING_CONFIGURATION.NODE ),
- MPTEST.TIMER_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" );
-
- TEXT_IO.PUT_LINE( "Deleting initialization task" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- STOP_TEST_TSR
---
-
- procedure STOP_TEST_TSR (
- IGNORED1 : in RTEMS.ID;
- IGNORED2 : in RTEMS.ADDRESS
- ) is
- begin
-
- MPTEST.STOP_TEST := TRUE;
-
- end STOP_TEST_TSR;
-
---PAGE
---
--- TEST_TASK
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- COUNT : RTEMS.UNSIGNED32;
- EVENT_OUT : RTEMS.EVENT_SET;
- EVENT_FOR_THIS_ITERATION : RTEMS.EVENT_SET;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- MPTEST.STOP_TEST := FALSE;
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
- MPTEST.REMOTE_NODE := 2;
- else
- MPTEST.REMOTE_NODE := 1;
- end if;
-
- TEXT_IO.PUT( "Remote task's name is : " );
- TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE );
-
- TEXT_IO.PUT_LINE( "Getting TID of remote task" );
-
- loop
-
- RTEMS.TASK_IDENT(
- MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.REMOTE_TID,
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- end loop;
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
- TEXT_IO.PUT_LINE( "Sending events to remote task" );
- else
- TEXT_IO.PUT_LINE( "Receiving events from remote task" );
- end if;
-
- RTEMS.TIMER_FIRE_AFTER(
- MPTEST.TIMER_ID( 1 ),
- 5 * TEST_SUPPORT.TICKS_PER_SECOND,
- MPTEST.STOP_TEST_TSR'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" );
-
- COUNT := 0;
-
- loop
-
- exit when MPTEST.STOP_TEST = TRUE;
-
- EVENT_FOR_THIS_ITERATION :=
- MPTEST.EVENT_SET_TABLE(
- INTEGER( COUNT ) mod MPTEST.EVENT_SET_TABLE'LAST + 1
- );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- RTEMS.EVENT_SEND(
- MPTEST.REMOTE_TID,
- EVENT_FOR_THIS_ITERATION,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" );
-
- else
-
- RTEMS.EVENT_RECEIVE(
- EVENT_FOR_THIS_ITERATION,
- RTEMS.DEFAULT_OPTIONS,
- 1 * TEST_SUPPORT.TICKS_PER_SECOND,
- EVENT_OUT,
- STATUS
- );
-
- if RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.TIMEOUT ) then
- TEXT_IO.NEW_LINE( 1 );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 2 then
- TEXT_IO.PUT_LINE(
- "Correct behavior if the other node exitted."
- );
- else
- TEXT_IO.PUT_LINE(
- "ERROR... node 1 died"
- );
- end if;
-
- exit;
-
- else
-
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" );
-
- end if;
-
- end if;
-
- if (COUNT mod MPTEST.MAXIMUM_DOTS) = 0 then
-
- TEST_SUPPORT.PUT_DOT( "." );
-
- end if;
-
- COUNT := COUNT + 1;
-
- end loop;
-
- TEXT_IO.NEW_LINE;
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 2 then
-
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_16,
- RTEMS.DEFAULT_OPTIONS,
- 1 * TEST_SUPPORT.TICKS_PER_SECOND,
- EVENT_OUT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- RTEMS.TIMEOUT,
- STATUS,
- "EVENT_RECEIVE"
- );
-
- TEXT_IO.NEW_LINE;
- TEXT_IO.PUT_LINE( "event_receive - correctly returned TIMEOUT" );
-
- end if;
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 6 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TEST_TASK;
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp06/mptest.ads b/c/src/ada-tests/mptests/mp06/mptest.ads
deleted file mode 100644
index f7fb4f599d..0000000000
--- a/c/src/ada-tests/mptests/mp06/mptest.ads
+++ /dev/null
@@ -1,250 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 6 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS timers created
--- by this test.
---
-
- TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- This variable is set when the test should stop executing.
---
- STOP_TEST : RTEMS.BOOLEAN;
-
---
--- This variable contains the ID of the remote task with which this
--- test interacts.
---
-
- REMOTE_TID : RTEMS.ID;
-
---
--- This variable contains the node on which the remote task with which
--- this test interacts resides.
---
-
- REMOTE_NODE : RTEMS.UNSIGNED32;
-
---
--- The number of signals to process per dot printed out.
---
-
- MAXIMUM_DOTS : constant RTEMS.UNSIGNED32 := 25;
-
---
--- The following is a table of the event sets which consist of
--- a single event. This test cycles through all of these
--- events.
---
-
- EVENT_SET_TABLE : constant array ( 0 .. 30 ) of RTEMS.EVENT_SET := (
- RTEMS.EVENT_0,
- RTEMS.EVENT_1,
- RTEMS.EVENT_2,
- RTEMS.EVENT_3,
- RTEMS.EVENT_4,
- RTEMS.EVENT_5,
- RTEMS.EVENT_6,
- RTEMS.EVENT_7,
- RTEMS.EVENT_8,
- RTEMS.EVENT_9,
- RTEMS.EVENT_10,
- RTEMS.EVENT_11,
- RTEMS.EVENT_12,
- RTEMS.EVENT_13,
- RTEMS.EVENT_14,
- RTEMS.EVENT_15,
- RTEMS.EVENT_16,
- RTEMS.EVENT_17,
- RTEMS.EVENT_18,
- RTEMS.EVENT_19,
- RTEMS.EVENT_20,
- RTEMS.EVENT_21,
- RTEMS.EVENT_22,
- RTEMS.EVENT_23,
- RTEMS.EVENT_24,
- RTEMS.EVENT_25,
- RTEMS.EVENT_26,
- RTEMS.EVENT_27,
- RTEMS.EVENT_28,
- RTEMS.EVENT_29,
- RTEMS.EVENT_30
- );
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- STOP_TEST_TSR
---
--- DESCRIPTION:
---
--- This subprogram is a TSR which sets the "stop test" flag.
---
-
- procedure STOP_TEST_TSR (
- IGNORED1 : in RTEMS.ID;
- IGNORED2 : in RTEMS.ADDRESS
- );
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This is the body of the RTEMS tasks which constitute this test.
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.DEFAULT_ATTRIBUTES, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.NO_PREEMPT, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 32, -- maximum # global objects
- 32 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 1, -- maximum # timers
- 2, -- maximum # semaphores
- 0, -- maximum # message queues
- 0, -- maximum # messages
- 0, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 50 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp06/node1/mp06.scn b/c/src/ada-tests/mptests/mp06/node1/mp06.scn
deleted file mode 100644
index 71da651eca..0000000000
--- a/c/src/ada-tests/mptests/mp06/node1/mp06.scn
+++ /dev/null
@@ -1,10 +0,0 @@
-*** TEST 6 -- NODE 1 ***
-Creating Test_task (Global)
-Starting Test_task (Global)
-Deleting initialization task
-Remote task's name is : 222
-Getting TID of remote task
-Sending events to remote task
-....................................................
-....................................................
-*** END OF TEST 6 ***
diff --git a/c/src/ada-tests/mptests/mp06/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp06/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/mptests/mp06/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp06/node2/mp06.scn b/c/src/ada-tests/mptests/mp06/node2/mp06.scn
deleted file mode 100644
index da449041b4..0000000000
--- a/c/src/ada-tests/mptests/mp06/node2/mp06.scn
+++ /dev/null
@@ -1,11 +0,0 @@
-*** TEST 6 -- NODE 2 ***
-Creating Test_task (Global)
-Starting Test_task (Global)
-Deleting initialization task
-Remote task's name is : 111
-Getting TID of remote task
-Receiving events from remote task
-....................................................
-....................................................
-event_receive - correctly returned TIMEOUT
-*** END OF TEST 6 ***
diff --git a/c/src/ada-tests/mptests/mp06/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp06/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/mptests/mp06/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp07/mptest.adb b/c/src/ada-tests/mptests/mp07/mptest.adb
deleted file mode 100644
index 2f86bb310c..0000000000
--- a/c/src/ada-tests/mptests/mp07/mptest.adb
+++ /dev/null
@@ -1,210 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 7 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** TEST 7 -- NODE " );
- UNSIGNED32_IO.PUT(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- WIDTH => 1
- );
- TEXT_IO.PUT_LINE( " ***" );
-
- MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' );
- MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' );
-
- TEXT_IO.PUT_LINE( "Creating Test_task (Global)" );
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( MPTEST.MULTIPROCESSING_CONFIGURATION.NODE ),
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.GLOBAL,
- MPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Test_task (Global)" );
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 1 ),
- MPTEST.TEST_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' );
-
- RTEMS.TIMER_CREATE(
- MPTEST.TIMER_NAME( 1 ),
- MPTEST.TIMER_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" );
-
- TEXT_IO.PUT_LINE( "Deleting initialization task" );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- STOP_TEST_TSR
---
-
- procedure STOP_TEST_TSR (
- IGNORED1 : in RTEMS.ID;
- IGNORED2 : in RTEMS.ADDRESS
- ) is
- begin
-
- MPTEST.STOP_TEST := TRUE;
-
- end STOP_TEST_TSR;
-
---PAGE
---
--- TEST_TASK
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- COUNT : RTEMS.UNSIGNED32;
- EVENT_OUT : RTEMS.EVENT_SET;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- MPTEST.STOP_TEST := FALSE;
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
- MPTEST.REMOTE_NODE := 2;
- else
- MPTEST.REMOTE_NODE := 1;
- end if;
-
- TEXT_IO.PUT( "Remote task's name is : " );
- TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE );
-
- TEXT_IO.PUT_LINE( "Getting TID of remote task" );
- loop
- RTEMS.TASK_IDENT(
- MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.REMOTE_TID,
- STATUS
- );
-
- exit when RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.SUCCESSFUL );
-
- end loop;
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- TEXT_IO.PUT_LINE( "Sending first event to remote task" );
- RTEMS.EVENT_SEND(
- MPTEST.REMOTE_TID,
- RTEMS.EVENT_16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" );
-
- end if;
-
- RTEMS.TIMER_FIRE_AFTER(
- MPTEST.TIMER_ID( 1 ),
- 5 * TEST_SUPPORT.TICKS_PER_SECOND,
- MPTEST.STOP_TEST_TSR'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" );
-
- loop
-
- exit when MPTEST.STOP_TEST = TRUE;
-
- for COUNT in 1 .. MPTEST.PER_DOT
- loop
-
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_16,
- RTEMS.DEFAULT_OPTIONS,
- TEST_SUPPORT.TICKS_PER_SECOND,
- EVENT_OUT,
- STATUS
- );
- if RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.TIMEOUT ) then
- TEXT_IO.NEW_LINE;
- TEXT_IO.PUT_LINE(
- "TA1 - TIMEOUT .. probably OK if the other node exits"
- );
- exit;
- else
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" );
- end if;
-
- RTEMS.EVENT_SEND(
- MPTEST.REMOTE_TID,
- RTEMS.EVENT_16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" );
-
- end loop;
-
- TEST_SUPPORT.PUT_DOT( "." );
-
- end loop;
-
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 7 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TEST_TASK;
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp07/mptest.ads b/c/src/ada-tests/mptests/mp07/mptest.ads
deleted file mode 100644
index 6640261d88..0000000000
--- a/c/src/ada-tests/mptests/mp07/mptest.ads
+++ /dev/null
@@ -1,210 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 7 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS timers created
--- by this test.
---
-
- TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- This variable is set when the test should stop executing.
---
- STOP_TEST : RTEMS.BOOLEAN;
-
---
--- This variable contains the ID of the remote task with which this
--- test interacts.
---
-
- REMOTE_TID : RTEMS.ID;
-
---
--- This variable contains the node on which the remote task with which
--- this test interacts resides.
---
-
- REMOTE_NODE : RTEMS.UNSIGNED32;
-
---
--- The number of events to process per dot printed out.
---
-
- PER_DOT : constant RTEMS.UNSIGNED32 := 100;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- STOP_TEST_TSR
---
--- DESCRIPTION:
---
--- This subprogram is a TSR which sets the "stop test" flag.
---
-
- procedure STOP_TEST_TSR (
- IGNORED1 : in RTEMS.ID;
- IGNORED2 : in RTEMS.ADDRESS
- );
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This is the body of the RTEMS tasks which constitute this test.
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.DEFAULT_ATTRIBUTES, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.NO_PREEMPT, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 32, -- maximum # global objects
- 32 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 1, -- maximum # timers
- 2, -- maximum # semaphores
- 0, -- maximum # message queues
- 0, -- maximum # messages
- 0, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 50 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp07/node1/mp07.scn b/c/src/ada-tests/mptests/mp07/node1/mp07.scn
deleted file mode 100644
index 71e0956329..0000000000
--- a/c/src/ada-tests/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/c/src/ada-tests/mptests/mp07/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp07/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/mptests/mp07/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp07/node2/mp07.scn b/c/src/ada-tests/mptests/mp07/node2/mp07.scn
deleted file mode 100644
index c31011e85c..0000000000
--- a/c/src/ada-tests/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/c/src/ada-tests/mptests/mp07/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp07/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/mptests/mp07/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp08/mptest.adb b/c/src/ada-tests/mptests/mp08/mptest.adb
deleted file mode 100644
index e07fa1dc4c..0000000000
--- a/c/src/ada-tests/mptests/mp08/mptest.adb
+++ /dev/null
@@ -1,207 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 8 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** TEST 8 -- NODE " );
- UNSIGNED32_IO.PUT(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- WIDTH => 1
- );
- TEXT_IO.PUT_LINE( " ***" );
-
- MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' );
- MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' );
-
- MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- TEXT_IO.PUT_LINE( "Creating Semaphore(Global)" );
-
- RTEMS.SEMAPHORE_CREATE(
- MPTEST.SEMAPHORE_NAME( 1 ),
- 1,
- RTEMS.GLOBAL,
- MPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" );
-
- end if;
-
- TEXT_IO.PUT_LINE( "Creating Test_task (Global)" );
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( MPTEST.MULTIPROCESSING_CONFIGURATION.NODE ),
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.GLOBAL,
- MPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Test_task (Global)" );
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 1 ),
- MPTEST.TEST_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- TEXT_IO.PUT_LINE( "Deleting initialization task" );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_TASK
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- DOTS : RTEMS.UNSIGNED32;
- COUNT : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "Getting SMID of semaphore" );
- loop
-
- RTEMS.SEMAPHORE_IDENT(
- MPTEST.SEMAPHORE_NAME( 1 ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- end loop;
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 2 then
-
- RTEMS.SEMAPHORE_DELETE(
- MPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.ILLEGAL_ON_REMOTE_OBJECT,
- "SEMAPHORE_DELETE"
- );
-
- TEXT_IO.PUT_LINE(
- "semaphore_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT"
- );
-
- end if;
-
- COUNT := 0;
-
- loop
-
- TEST_SUPPORT.PUT_DOT( "p" );
-
- RTEMS.SEMAPHORE_OBTAIN(
- MPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
-
- if not RTEMS.IS_STATUS_SUCCESSFUL( STATUS ) then
-
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.OBJECT_WAS_DELETED,
- "SEMAPHORE_OBTAIN"
- );
-
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "Global semaphore deleted" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 8 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end if;
-
- COUNT := COUNT + 1;
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 and then
- COUNT >= 1000 then
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "Deleting global semaphore" );
-
- RTEMS.SEMAPHORE_DELETE( MPTEST.SEMAPHORE_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 8 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end if;
-
- TEST_SUPPORT.PUT_DOT( "v" );
-
- RTEMS.SEMAPHORE_RELEASE( MPTEST.SEMAPHORE_ID( 1 ), STATUS );
-
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" );
-
- end loop;
-
- end TEST_TASK;
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp08/mptest.ads b/c/src/ada-tests/mptests/mp08/mptest.ads
deleted file mode 100644
index 8467cbe217..0000000000
--- a/c/src/ada-tests/mptests/mp08/mptest.ads
+++ /dev/null
@@ -1,192 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 8 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS semaphores created
--- by this test.
---
-
- SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- This variable contains the ID of the remote task with which this
--- test interacts.
---
-
- REMOTE_TID : RTEMS.ID;
-
---
--- This variable contains the node on which the remote task with which
--- this test interacts resides.
---
-
- REMOTE_NODE : RTEMS.UNSIGNED32;
-
---
--- The number of events to process per dot printed out.
---
-
- PER_DOT : constant RTEMS.UNSIGNED32 := 100;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This is the body of the RTEMS tasks which constitute this test.
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.DEFAULT_ATTRIBUTES, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.NO_PREEMPT, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 32, -- maximum # global objects
- 32 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 1, -- maximum # timers
- 1, -- maximum # semaphores
- 0, -- maximum # message queues
- 0, -- maximum # messages
- 0, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 50 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp08/node1/mp08.scn b/c/src/ada-tests/mptests/mp08/node1/mp08.scn
deleted file mode 100644
index ba9f089e96..0000000000
--- a/c/src/ada-tests/mptests/mp08/node1/mp08.scn
+++ /dev/null
@@ -1,9 +0,0 @@
-*** TEST 8 -- NODE 1 ***
-Creating Test_task (Global)
-Starting Test_task (Global)
-Deleting initialization task
-Getting SMID of semaphore
-pvpvpvpvpvp.......
-(continued) pvp
-Deleting global semaphore
-*** END OF TEST 8 ***
diff --git a/c/src/ada-tests/mptests/mp08/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp08/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/mptests/mp08/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp08/node2/mp08.scn b/c/src/ada-tests/mptests/mp08/node2/mp08.scn
deleted file mode 100644
index 8ac712ae93..0000000000
--- a/c/src/ada-tests/mptests/mp08/node2/mp08.scn
+++ /dev/null
@@ -1,10 +0,0 @@
-*** TEST 8 -- NODE 2 ***
-Creating Test_task (Global)
-Starting Test_task (Global)
-Deleting initialization task
-Getting SMID of semaphore
-semaphore_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT
-pvpvpvpvpvp.......
-(continued) pvp
-Global semaphore deleted
-*** END OF TEST 8 ***
diff --git a/c/src/ada-tests/mptests/mp08/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp08/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/mptests/mp08/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp09/mptest.adb b/c/src/ada-tests/mptests/mp09/mptest.adb
deleted file mode 100644
index f8f0f594d0..0000000000
--- a/c/src/ada-tests/mptests/mp09/mptest.adb
+++ /dev/null
@@ -1,381 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 9 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** TEST 9 -- NODE " );
- UNSIGNED32_IO.PUT(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- WIDTH => 1
- );
- TEXT_IO.PUT_LINE( " ***" );
-
- MPTEST.RECEIVE_BUFFER :=
- RTEMS.TO_BUFFER_POINTER( MPTEST.RECEIVE_BUFFER_AREA'ADDRESS );
-
- MPTEST.BUFFER_1 :=
- RTEMS.TO_BUFFER_POINTER( MPTEST.BUFFER_AREA_1'ADDRESS );
-
- MPTEST.BUFFER_2 :=
- RTEMS.TO_BUFFER_POINTER( MPTEST.BUFFER_AREA_2'ADDRESS );
-
- MPTEST.BUFFER_3 :=
- RTEMS.TO_BUFFER_POINTER( MPTEST.BUFFER_AREA_3'ADDRESS );
-
- MPTEST.BUFFER_4 :=
- RTEMS.TO_BUFFER_POINTER( MPTEST.BUFFER_AREA_4'ADDRESS );
-
- MPTEST.FILL_BUFFER( "123456789012345 ", MPTEST.BUFFER_AREA_1 );
- MPTEST.FILL_BUFFER( "abcdefghijklmno ", MPTEST.BUFFER_AREA_2 );
- MPTEST.FILL_BUFFER( "ABCDEFGHIJKLMNO ", MPTEST.BUFFER_AREA_3 );
- MPTEST.FILL_BUFFER( "PQRSTUVWXYZ(){} ", MPTEST.BUFFER_AREA_4 );
-
- MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' );
- MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' );
-
- MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- TEXT_IO.PUT_LINE( "Creating Message Queue (Global)" );
- RTEMS.MESSAGE_QUEUE_CREATE(
- MPTEST.QUEUE_NAME( 1 ),
- 3,
- RTEMS.GLOBAL + RTEMS.LIMIT,
- MPTEST.QUEUE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" );
-
- end if;
-
- TEXT_IO.PUT_LINE( "Creating Test_task (local)" );
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( MPTEST.MULTIPROCESSING_CONFIGURATION.NODE ),
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.DEFAULT_ATTRIBUTES,
- MPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Test_task (local)" );
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 1 ),
- MPTEST.TEST_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- TEXT_IO.PUT_LINE( "Deleting initialization task" );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- SEND_MESSAGES
---
-
- procedure SEND_MESSAGES is
- BROADCAST_COUNT : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT( "message_queue_send : " );
- MPTEST.PUT_BUFFER( MPTEST.BUFFER_AREA_1 );
- TEXT_IO.NEW_LINE;
-
- RTEMS.MESSAGE_QUEUE_SEND(
- MPTEST.QUEUE_ID( 1 ),
- MPTEST.BUFFER_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- TEXT_IO.PUT_LINE( "Delaying for a second" );
- RTEMS.TASK_WAKE_AFTER(
- 1 * TEST_SUPPORT.TICKS_PER_SECOND,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT( "message_queue_urgent : " );
- MPTEST.PUT_BUFFER( MPTEST.BUFFER_AREA_2 );
- TEXT_IO.NEW_LINE;
-
- RTEMS.MESSAGE_QUEUE_URGENT(
- MPTEST.QUEUE_ID( 1 ),
- MPTEST.BUFFER_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" );
-
- TEXT_IO.PUT_LINE( "Delaying for a second" );
- RTEMS.TASK_WAKE_AFTER(
- 1 * TEST_SUPPORT.TICKS_PER_SECOND,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT( "message_queue_broadcast : " );
- MPTEST.PUT_BUFFER( MPTEST.BUFFER_AREA_3 );
- TEXT_IO.NEW_LINE;
-
- RTEMS.MESSAGE_QUEUE_BROADCAST(
- MPTEST.QUEUE_ID( 1 ),
- MPTEST.BUFFER_3,
- BROADCAST_COUNT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_BROADCAST" );
-
- TEXT_IO.PUT_LINE( "Delaying for a second" );
- RTEMS.TASK_WAKE_AFTER(
- 1 * TEST_SUPPORT.TICKS_PER_SECOND,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- end SEND_MESSAGES;
-
---PAGE
---
--- RECEIVE_MESSAGES
---
-
- procedure RECEIVE_MESSAGES is
- INDEX : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- for INDEX in 1 .. 3
- loop
-
- TEXT_IO.PUT_LINE( "Receiving message ..." );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- MPTEST.QUEUE_ID( 1 ),
- MPTEST.RECEIVE_BUFFER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
-
- TEXT_IO.PUT( "Received : " );
- MPTEST.PUT_BUFFER( MPTEST.RECEIVE_BUFFER_AREA );
- TEXT_IO.NEW_LINE;
-
- end loop;
-
- TEXT_IO.PUT_LINE( "Receiver delaying for a second" );
-
- RTEMS.TASK_WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- end RECEIVE_MESSAGES;
-
---PAGE
---
--- FILL_BUFFER
---
-
---
--- Depends on tricks to make the copy work.
---
-
- procedure FILL_BUFFER (
- SOURCE : in STRING;
- BUFFER : out RTEMS.BUFFER
- ) is
- SOURCE_BUFFER : RTEMS.BUFFER_POINTER;
- begin
-
- SOURCE_BUFFER := RTEMS.TO_BUFFER_POINTER(
- SOURCE( SOURCE'FIRST )'ADDRESS
- );
-
- BUFFER.FIELD1 := SOURCE_BUFFER.FIELD1;
- BUFFER.FIELD2 := SOURCE_BUFFER.FIELD2;
- BUFFER.FIELD3 := SOURCE_BUFFER.FIELD3;
- BUFFER.FIELD4 := SOURCE_BUFFER.FIELD4;
-
- end FILL_BUFFER;
-
---PAGE
---
--- PUT_BUFFER
---
-
---
--- Depends on tricks to make the output work.
---
-
- procedure PUT_BUFFER (
- BUFFER : in RTEMS.BUFFER
- ) is
- begin
-
- TEST_SUPPORT.PUT_NAME( BUFFER.FIELD1, FALSE );
- TEST_SUPPORT.PUT_NAME( BUFFER.FIELD2, FALSE );
- TEST_SUPPORT.PUT_NAME( BUFFER.FIELD3, FALSE );
- TEST_SUPPORT.PUT_NAME( BUFFER.FIELD4, FALSE );
-
- end PUT_BUFFER;
-
---PAGE
---
--- TEST_TASK
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- COUNT : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "Getting QID of message queue" );
-
- loop
-
- RTEMS.MESSAGE_QUEUE_IDENT(
- MPTEST.QUEUE_NAME( 1 ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.QUEUE_ID( 1 ),
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- end loop;
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 2 then
-
- RTEMS.MESSAGE_QUEUE_DELETE( MPTEST.QUEUE_ID( 1 ), STATUS );
-
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.ILLEGAL_ON_REMOTE_OBJECT,
- "MESSAGE_QUEUE_DELETE"
- );
-
- TEXT_IO.PUT_LINE(
- "message_queue_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT"
- );
-
- MPTEST.SEND_MESSAGES;
-
- MPTEST.RECEIVE_MESSAGES;
-
- TEXT_IO.PUT_LINE( "Flushing remote empty queue" );
- RTEMS.MESSAGE_QUEUE_FLUSH( MPTEST.QUEUE_ID( 1 ), COUNT, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" );
- UNSIGNED32_IO.PUT( COUNT, WIDTH => 1 );
- TEXT_IO.PUT_LINE(
- " messages were flushed from remote empty queue"
- );
-
- TEXT_IO.PUT_LINE(
- "Send messages to be flushed from remote queue"
- );
- RTEMS.MESSAGE_QUEUE_SEND(
- MPTEST.QUEUE_ID( 1 ),
- MPTEST.BUFFER_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- TEXT_IO.PUT_LINE( "Flushing remote queue" );
- RTEMS.MESSAGE_QUEUE_FLUSH( MPTEST.QUEUE_ID( 1 ), COUNT, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" );
- UNSIGNED32_IO.PUT( COUNT, WIDTH => 1 );
- TEXT_IO.PUT_LINE(
- " messages were flushed from the remote queue"
- );
-
- TEXT_IO.PUT_LINE( "Waiting for message queue to be deleted" );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- MPTEST.QUEUE_ID( 1 ),
- MPTEST.RECEIVE_BUFFER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.OBJECT_WAS_DELETED,
- "MESSAGE_QUEUE_FLUSH"
- );
-
- else
-
- MPTEST.RECEIVE_MESSAGES;
-
- MPTEST.SEND_MESSAGES;
-
- RTEMS.TASK_WAKE_AFTER(
- 5 * TEST_SUPPORT.TICKS_PER_SECOND,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- RTEMS.MESSAGE_QUEUE_DELETE( MPTEST.QUEUE_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" );
-
- end if;
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 9 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TEST_TASK;
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp09/mptest.ads b/c/src/ada-tests/mptests/mp09/mptest.ads
deleted file mode 100644
index b981b4664c..0000000000
--- a/c/src/ada-tests/mptests/mp09/mptest.ads
+++ /dev/null
@@ -1,254 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 9 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS message
--- queues created by this test.
---
-
- QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- The following are message buffers used to contain the test messages
--- and pointers to those buffers.
---
-
- RECEIVE_BUFFER_AREA : RTEMS.BUFFER;
- BUFFER_AREA_1 : RTEMS.BUFFER;
- BUFFER_AREA_2 : RTEMS.BUFFER;
- BUFFER_AREA_3 : RTEMS.BUFFER;
- BUFFER_AREA_4 : RTEMS.BUFFER;
-
- RECEIVE_BUFFER : RTEMS.BUFFER_POINTER;
- BUFFER_1 : RTEMS.BUFFER_POINTER;
- BUFFER_2 : RTEMS.BUFFER_POINTER;
- BUFFER_3 : RTEMS.BUFFER_POINTER;
- BUFFER_4 : RTEMS.BUFFER_POINTER;
-
---
--- This variable contains the ID of the remote task with which this
--- test interacts.
---
-
- REMOTE_TID : RTEMS.ID;
-
---
--- This variable contains the node on which the remote task with which
--- this test interacts resides.
---
-
- REMOTE_NODE : RTEMS.UNSIGNED32;
-
---
--- The number of events to process per dot printed out.
---
-
- PER_DOT : constant RTEMS.UNSIGNED32 := 100;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- SEND_MESSAGES
---
--- This subprogram prints and sends a sequence of three test messages.
--- One of the messages is sent, one is urgent, and one is broadcast.
--- A one second pause is between each the sending of each message.
---
-
- procedure SEND_MESSAGES;
-
---
--- RECEIVE_MESSAGES
---
--- This subprogram receives and prints a sequence of three test messages.
---
-
- procedure RECEIVE_MESSAGES;
-
---
--- FILL_BUFFER
---
--- DESCRIPTION:
---
--- This subprogram takes the SOURCE input string and places
--- up to the first sixteen characters of that string into
--- the message BUFFER.
---
-
- procedure FILL_BUFFER (
- SOURCE : in STRING;
- BUFFER : out RTEMS.BUFFER
- );
-
---
--- PUT_BUFFER
---
--- DESCRIPTION:
---
--- This subprogram prints the specified message BUFFER.
---
-
- procedure PUT_BUFFER (
- BUFFER : in RTEMS.BUFFER
- );
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This is the body of the RTEMS tasks which constitute this test.
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.DEFAULT_ATTRIBUTES, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.NO_PREEMPT, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 32, -- maximum # global objects
- 32 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 0, -- maximum # timers
- 0, -- maximum # semaphores
- 1, -- maximum # message queues
- 1, -- maximum # messages
- 0, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 50 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp09/node1/mp09.scn b/c/src/ada-tests/mptests/mp09/node1/mp09.scn
deleted file mode 100644
index 167d6e18a5..0000000000
--- a/c/src/ada-tests/mptests/mp09/node1/mp09.scn
+++ /dev/null
@@ -1,20 +0,0 @@
-*** TEST 9 -- NODE 1 ***
-Creating Message Queue (Global)
-Creating Test_task (local)
-Starting Test_task (local)
-Deleting initialization task
-Getting QID of message queue
-Receiving message ...
-Received : 123456789012345
-Receiving message ...
-Received : abcdefghijklmno
-Receiving message ...
-Received : ABCDEFGHIJKLMNO
-Receiver delaying for a second
-message_queue_send : 123456789012345
-Delaying for a second
-message_queue_urgent : abcdefghijklmno
-Delaying for a second
-message_queue_broadcast : ABCDEFGHIJKLMNO
-Delaying for a second
-*** END OF TEST 9 ***
diff --git a/c/src/ada-tests/mptests/mp09/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp09/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/mptests/mp09/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp09/node2/mp09.scn b/c/src/ada-tests/mptests/mp09/node2/mp09.scn
deleted file mode 100644
index 4cd8a7bff7..0000000000
--- a/c/src/ada-tests/mptests/mp09/node2/mp09.scn
+++ /dev/null
@@ -1,26 +0,0 @@
-*** TEST 9 -- NODE 2 ***
-Creating Test_task (local)
-Starting Test_task (local)
-Deleting initialization task
-Getting QID of message queue
-message_queue_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT
-message_queue_send : 123456789012345
-Delaying for a second
-message_queue_urgent : abcdefghijklmno
-Delaying for a second
-message_queue_broadcast : ABCDEFGHIJKLMNO
-Delaying for a second
-Receiving message ...
-Received : 123456789012345
-Receiving message ...
-Received : abcdefghijklmno
-Receiving message ...
-Received : ABCDEFGHIJKLMNO
-Receiver delaying for a second
-Flushing remote empty queue
-0 messages were flushed from remote empty queue
-Send messages to be flushed from remote queue
-Flushing remote queue
-1 messages were flushed from the remote queue
-Waiting for message queue to be deleted
-*** END OF TEST 9 ***
diff --git a/c/src/ada-tests/mptests/mp09/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp09/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/mptests/mp09/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp10/mptest.adb b/c/src/ada-tests/mptests/mp10/mptest.adb
deleted file mode 100644
index 011d1f83e7..0000000000
--- a/c/src/ada-tests/mptests/mp10/mptest.adb
+++ /dev/null
@@ -1,301 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 10 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** TEST 10 -- NODE " );
- UNSIGNED32_IO.PUT(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- WIDTH => 1
- );
- TEXT_IO.PUT_LINE( " ***" );
-
-
- MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- MPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'S', 'A', '3', ' ' );
-
- MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' );
-
- MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- TEXT_IO.PUT_LINE( "Creating Message Queue (Global)" );
- RTEMS.MESSAGE_QUEUE_CREATE(
- MPTEST.QUEUE_NAME( 1 ),
- 3,
- RTEMS.GLOBAL + RTEMS.LIMIT,
- MPTEST.QUEUE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" );
-
- TEXT_IO.PUT_LINE( "Creating Semaphore (Global)" );
- RTEMS.SEMAPHORE_CREATE(
- MPTEST.SEMAPHORE_NAME( 1 ),
- 0,
- RTEMS.GLOBAL + RTEMS.PRIORITY,
- MPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" );
-
- RTEMS.TASK_WAKE_AFTER( 10 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- else
-
- TEXT_IO.PUT_LINE( "Creating Test_task 1 (local)" );
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.DEFAULT_ATTRIBUTES,
- MPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Test_task 1 (local)" );
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 1 ),
- MPTEST.TEST_TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- TEXT_IO.PUT_LINE( "Creating Test_task 2 (local)" );
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( 2 ),
- 1,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.DEFAULT_ATTRIBUTES,
- MPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Test_task 2 (local)" );
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 2 ),
- MPTEST.TEST_TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- TEXT_IO.PUT_LINE( "Creating Test_task 3 (local)" );
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( 3 ),
- 1,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.DEFAULT_ATTRIBUTES,
- MPTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Test_task 3 (local)" );
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 3 ),
- MPTEST.TEST_TASK_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- TEXT_IO.PUT_LINE( "Sleeping for 1 second ..." );
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "Deleting Test_task 2" );
- RTEMS.TASK_DELETE( MPTEST.TASK_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF 2" );
-
- TEXT_IO.PUT_LINE( "Deleting Test_task 1" );
- RTEMS.TASK_DELETE( MPTEST.TASK_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF 1" );
-
- TEXT_IO.PUT_LINE( "Restarting Test_task 3" );
- RTEMS.TASK_RESTART( MPTEST.TASK_ID( 3 ), 1, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF 3" );
-
- end if;
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 10 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end INIT;
-
---PAGE
---
--- TEST_TASK_1
---
-
- procedure TEST_TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- COUNT : RTEMS.UNSIGNED32;
- RECEIVE_BUFFER_AREA : RTEMS.BUFFER;
- RECEIVE_BUFFER : RTEMS.BUFFER_POINTER;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RECEIVE_BUFFER :=
- RTEMS.TO_BUFFER_POINTER( RECEIVE_BUFFER_AREA'ADDRESS );
-
- TEXT_IO.PUT_LINE( "Getting QID of message queue" );
-
- loop
-
- RTEMS.MESSAGE_QUEUE_IDENT(
- MPTEST.QUEUE_NAME( 1 ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.QUEUE_ID( 1 ),
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- end loop;
-
- TEXT_IO.PUT_LINE( "Attempting to receive message ..." );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- MPTEST.QUEUE_ID( 1 ),
- RECEIVE_BUFFER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
-
- end TEST_TASK_1;
-
---PAGE
---
--- TEST_TASK_2
---
-
- procedure TEST_TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "Getting SMID of semaphore" );
-
- loop
-
- RTEMS.SEMAPHORE_IDENT(
- MPTEST.SEMAPHORE_NAME( 1 ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- end loop;
-
- TEXT_IO.PUT_LINE( "Attempting to acquire semaphore ..." );
- RTEMS.SEMAPHORE_OBTAIN(
- MPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
-
- end TEST_TASK_2;
-
---PAGE
---
--- TEST_TASK_3
---
-
- procedure TEST_TASK_3 (
- RESTART : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- if RESTART = 1 then
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" );
-
- end if;
-
- TEXT_IO.PUT_LINE( "Getting SMID of semaphore" );
-
- loop
-
- RTEMS.SEMAPHORE_IDENT(
- MPTEST.SEMAPHORE_NAME( 1 ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- end loop;
-
- TEXT_IO.PUT_LINE( "Attempting to acquire semaphore ..." );
- RTEMS.SEMAPHORE_OBTAIN(
- MPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
-
- end TEST_TASK_3;
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp10/mptest.ads b/c/src/ada-tests/mptests/mp10/mptest.ads
deleted file mode 100644
index a574adf43f..0000000000
--- a/c/src/ada-tests/mptests/mp10/mptest.ads
+++ /dev/null
@@ -1,224 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 10 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS message
--- queues created by this test.
---
-
- QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS semaphore
--- created by this test.
---
-
- SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- This variable contains the ID of the remote task with which this
--- test interacts.
---
-
- REMOTE_TID : RTEMS.ID;
-
---
--- This variable contains the node on which the remote task with which
--- this test interacts resides.
---
-
- REMOTE_NODE : RTEMS.UNSIGNED32;
-
---
--- The number of events to process per dot printed out.
---
-
- PER_DOT : constant RTEMS.UNSIGNED32 := 100;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK_1
---
--- DESCRIPTION:
---
--- This is the body of one of the RTEMS tasks which constitute this test.
---
-
- procedure TEST_TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK_2
---
--- DESCRIPTION:
---
--- This is the body of one of the RTEMS tasks which constitute this test.
---
-
- procedure TEST_TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK_3
---
--- DESCRIPTION:
---
--- This is the body of one of the RTEMS tasks which constitute this test.
---
-
- procedure TEST_TASK_3 (
- RESTART : in RTEMS.TASK_ARGUMENT
- );
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.DEFAULT_ATTRIBUTES, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.NO_PREEMPT, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 32, -- maximum # global objects
- 32 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 0, -- maximum # timers
- 1, -- maximum # semaphores
- 1, -- maximum # message queues
- 0, -- maximum # messages
- 0, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 50 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp10/node1/mp10.scn b/c/src/ada-tests/mptests/mp10/node1/mp10.scn
deleted file mode 100644
index deeafc0a9a..0000000000
--- a/c/src/ada-tests/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/c/src/ada-tests/mptests/mp10/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp10/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/mptests/mp10/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp10/node2/mp10.scn b/c/src/ada-tests/mptests/mp10/node2/mp10.scn
deleted file mode 100644
index c0337fdacf..0000000000
--- a/c/src/ada-tests/mptests/mp10/node2/mp10.scn
+++ /dev/null
@@ -1,18 +0,0 @@
-*** TEST 10 -- NODE 2 ***
-Creating Test_task 1 (local)
-Starting Test_task 1 (local)
-Creating Test_task 2 (local)
-Starting Test_task 2 (local)
-Creating Test_task 3 (local)
-Starting Test_task 3 (local)
-Sleeping for 1 second ...
-Getting QID of message queue
-Attempting to receive message ...
-Getting SMID of semaphore
-Attempting to acquire semaphore ...
-Getting SMID of semaphore
-Attempting to acquire semaphore ...
-Deleting Test_task 2
-Deleting Test_task 1
-Restarting Test_task 3
-*** END OF TEST 10 ***
diff --git a/c/src/ada-tests/mptests/mp10/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp10/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/mptests/mp10/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp11/mptest.adb b/c/src/ada-tests/mptests/mp11/mptest.adb
deleted file mode 100644
index c94ca43eaa..0000000000
--- a/c/src/ada-tests/mptests/mp11/mptest.adb
+++ /dev/null
@@ -1,138 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 11 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** TEST 11 -- NODE " );
- UNSIGNED32_IO.PUT(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- WIDTH => 1
- );
- TEXT_IO.PUT_LINE( " ***" );
-
- MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' );
- MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' );
-
- MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' );
-
- MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' );
-
- MPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'A', 'R', ' ' );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- TEXT_IO.PUT_LINE( "Attempting to create Test_task (Global)" );
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.GLOBAL,
- MPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "TASK_CREATE"
- );
- TEXT_IO.PUT_LINE( "task_create correctly returned TOO_MANY" );
-
- TEXT_IO.PUT_LINE( "Attempting to create Message Queue (Global)" );
- RTEMS.MESSAGE_QUEUE_CREATE(
- MPTEST.QUEUE_NAME( 1 ),
- 3,
- RTEMS.GLOBAL + RTEMS.LIMIT,
- MPTEST.QUEUE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "MESSAGE_QUEUE_CREATE"
- );
- TEXT_IO.PUT_LINE(
- "message_queue_create correctly returned TOO_MANY"
- );
-
- TEXT_IO.PUT_LINE( "Creating Semaphore (Global)" );
- RTEMS.SEMAPHORE_CREATE(
- MPTEST.SEMAPHORE_NAME( 1 ),
- 1,
- RTEMS.GLOBAL,
- MPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "SEMAPHORE_CREATE"
- );
- TEXT_IO.PUT_LINE( "semaphore_create correctly returned TOO_MANY" );
-
- TEXT_IO.PUT_LINE( "Creating Partition (Global)" );
- RTEMS.PARTITION_CREATE(
- MPTEST.PARTITION_NAME( 1 ),
- MPTEST.PARTITION_AREA( 0 )'ADDRESS,
- 128,
- 64,
- RTEMS.GLOBAL,
- MPTEST.PARTITION_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "PARTITION_CREATE"
- );
- TEXT_IO.PUT_LINE( "partition_create correctly returned TOO_MANY" );
-
- end if;
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 11 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end INIT;
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp11/mptest.ads b/c/src/ada-tests/mptests/mp11/mptest.ads
deleted file mode 100644
index 6d54d45084..0000000000
--- a/c/src/ada-tests/mptests/mp11/mptest.ads
+++ /dev/null
@@ -1,184 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 11 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS message
--- queues created by this test.
---
-
- QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS semaphore
--- created by this test.
---
-
- SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS partition
--- created by this test.
---
-
- PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- This is the area used for the partition.
---
-
- PARTITION_AREA :
- array ( RTEMS.UNSIGNED32 range 0 .. 1023 ) of RTEMS.UNSIGNED8;
- for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.DEFAULT_ATTRIBUTES, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.NO_PREEMPT, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 0, -- maximum # global objects
- 0 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 0, -- maximum # timers
- 1, -- maximum # semaphores
- 1, -- maximum # message queues
- 0, -- maximum # messages
- 1, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 50 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp11/node1/mp11.scn b/c/src/ada-tests/mptests/mp11/node1/mp11.scn
deleted file mode 100644
index 013426bf91..0000000000
--- a/c/src/ada-tests/mptests/mp11/node1/mp11.scn
+++ /dev/null
@@ -1,10 +0,0 @@
-*** TEST 11 -- NODE 1 ***
-Attempting to create Test_task (Global)
-task_create correctly returned TOO_MANY
-Attempting to create Message Queue (Global)
-message_queue_create correctly returned TOO_MANY
-Creating Semaphore (Global)
-semaphore_create correctly returned TOO_MANY
-Creating Partition (Global)
-partition_create correctly returned TOO_MANY
-*** END OF TEST 11 ***
diff --git a/c/src/ada-tests/mptests/mp11/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp11/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/mptests/mp11/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp11/node2/mp11.scn b/c/src/ada-tests/mptests/mp11/node2/mp11.scn
deleted file mode 100644
index 49bd8a3219..0000000000
--- a/c/src/ada-tests/mptests/mp11/node2/mp11.scn
+++ /dev/null
@@ -1,2 +0,0 @@
-*** TEST 11 -- NODE 2 ***
-*** END OF TEST 11 ***
diff --git a/c/src/ada-tests/mptests/mp11/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp11/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/mptests/mp11/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp12/mptest.adb b/c/src/ada-tests/mptests/mp12/mptest.adb
deleted file mode 100644
index e99006ec72..0000000000
--- a/c/src/ada-tests/mptests/mp12/mptest.adb
+++ /dev/null
@@ -1,152 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 12 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER_ADDRESS : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** TEST 12 -- NODE " );
- UNSIGNED32_IO.PUT(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- WIDTH => 1
- );
- TEXT_IO.PUT_LINE( " ***" );
-
- MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' );
- MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' );
-
- MPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'A', 'R', ' ' );
-
- TEXT_IO.PUT_LINE( "Got to the initialization task" );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 2 then
-
- RTEMS.TASK_WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "Getting ID of remote Partition (Global)" );
-
- loop
-
- RTEMS.PARTITION_IDENT(
- MPTEST.PARTITION_NAME( 1 ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.PARTITION_ID( 1 ),
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- end loop;
-
- TEXT_IO.PUT_LINE(
- "Attempting to delete remote Partition (Global)"
- );
-
- RTEMS.PARTITION_DELETE( MPTEST.PARTITION_ID( 1 ), STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.ILLEGAL_ON_REMOTE_OBJECT,
- "PARTITION_DELETE"
- );
-
- TEXT_IO.PUT_LINE(
- "partition_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT!!"
- );
-
- TEXT_IO.PUT_LINE( "Obtaining a buffer from the global partition" );
-
- RTEMS.PARTITION_GET_BUFFER(
- MPTEST.PARTITION_ID( 1 ),
- BUFFER_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" );
- TEXT_IO.PUT( "Address returned was : " );
- UNSIGNED32_IO.PUT(
- RTEMS.SUBTRACT( BUFFER_ADDRESS, RTEMS.NULL_ADDRESS ),
- WIDTH => 8,
- BASE => 16
- );
- TEXT_IO.NEW_LINE;
-
- RTEMS.PARTITION_RETURN_BUFFER(
- MPTEST.PARTITION_ID( 1 ),
- BUFFER_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" );
-
- RTEMS.TASK_WAKE_AFTER( 2 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- else
-
- TEXT_IO.PUT_LINE( "Creating Partition (Global)" );
- RTEMS.PARTITION_CREATE(
- MPTEST.PARTITION_NAME( 1 ),
- MPTEST.PARTITION_AREA( 0 )'ADDRESS,
- 128,
- 64,
- RTEMS.GLOBAL,
- MPTEST.PARTITION_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE" );
-
- TEXT_IO.PUT_LINE( "Sleeping for three seconds" );
- RTEMS.TASK_WAKE_AFTER( 3 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "Deleting Partition (Global)" );
- RTEMS.PARTITION_DELETE( MPTEST.PARTITION_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_DELETE" );
-
- end if;
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 12 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end INIT;
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp12/mptest.ads b/c/src/ada-tests/mptests/mp12/mptest.ads
deleted file mode 100644
index bc6b0d8827..0000000000
--- a/c/src/ada-tests/mptests/mp12/mptest.ads
+++ /dev/null
@@ -1,182 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 12 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS semaphore
--- created by this test.
---
-
- PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- This variable contains the ID of the remote task with which this
--- test interacts.
---
-
- REMOTE_TID : RTEMS.ID;
-
---
--- This variable contains the node on which the remote task with which
--- this test interacts resides.
---
-
- REMOTE_NODE : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- This is the area used for the partition.
---
-
- PARTITION_AREA :
- array ( RTEMS.UNSIGNED32 range 0 .. 1023 ) of RTEMS.UNSIGNED8;
- for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.DEFAULT_ATTRIBUTES, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.NO_PREEMPT, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 32, -- maximum # global objects
- 32 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 0, -- maximum # timers
- 0, -- maximum # semaphores
- 0, -- maximum # message queues
- 0, -- maximum # messages
- 1, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 50 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp12/node1/mp12.scn b/c/src/ada-tests/mptests/mp12/node1/mp12.scn
deleted file mode 100644
index 40646722eb..0000000000
--- a/c/src/ada-tests/mptests/mp12/node1/mp12.scn
+++ /dev/null
@@ -1,6 +0,0 @@
-*** TEST 12 -- NODE 1 ***
-Got to the initialization task
-Creating Partition (Global)
-Sleeping for three seconds
-Deleting Partition (Global)
-*** END OF TEST 12 ***
diff --git a/c/src/ada-tests/mptests/mp12/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp12/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/mptests/mp12/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp12/node2/mp12.scn b/c/src/ada-tests/mptests/mp12/node2/mp12.scn
deleted file mode 100644
index 2189ae9959..0000000000
--- a/c/src/ada-tests/mptests/mp12/node2/mp12.scn
+++ /dev/null
@@ -1,9 +0,0 @@
-*** TEST 12 -- NODE 2 ***
-Got to the initialization task
-Getting ID of remote Partition (Global)
-Attempting to delete remote Partition (Global)
-partition_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT!!
-Obtaining a buffer from the global partition
-Address returned was : 0x200f0000
-NOTE: Address printed will probably differ!!!
-*** END OF TEST 12 ***
diff --git a/c/src/ada-tests/mptests/mp12/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp12/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/mptests/mp12/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp13/mptest.adb b/c/src/ada-tests/mptests/mp13/mptest.adb
deleted file mode 100644
index 33aebf6cd8..0000000000
--- a/c/src/ada-tests/mptests/mp13/mptest.adb
+++ /dev/null
@@ -1,328 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 13 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** TEST 13 -- NODE " );
- UNSIGNED32_IO.PUT(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- WIDTH => 1
- );
- TEXT_IO.PUT_LINE( " ***" );
-
- MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' );
- MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' );
-
- MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' );
-
- MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- TEXT_IO.PUT_LINE( "Creating Message Queue (Global)" );
- RTEMS.MESSAGE_QUEUE_CREATE(
- MPTEST.QUEUE_NAME( 1 ),
- 3,
- RTEMS.GLOBAL + RTEMS.LIMIT,
- MPTEST.QUEUE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" );
-
- TEXT_IO.PUT_LINE( "Creating Semaphore (Global)" );
- RTEMS.SEMAPHORE_CREATE(
- MPTEST.SEMAPHORE_NAME( 1 ),
- 1,
- RTEMS.GLOBAL + RTEMS.PRIORITY,
- MPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" );
-
- RTEMS.SEMAPHORE_OBTAIN(
- MPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
-
- end if;
-
- TEXT_IO.PUT_LINE( "Creating Test_task 1 (local)" );
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.DEFAULT_ATTRIBUTES,
- MPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Test_task 1 (local)" );
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 1 ),
- MPTEST.TEST_TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- TEXT_IO.PUT_LINE( "Creating Test_task 2 (local)" );
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( 2 ),
- 1,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.DEFAULT_ATTRIBUTES,
- MPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Test_task 2 (local)" );
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 2 ),
- MPTEST.TEST_TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- RTEMS.TASK_WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 13 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end if;
-
- TEXT_IO.PUT_LINE( "Deleting initialization task" );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_TASK_1
---
-
- procedure TEST_TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- COUNT : RTEMS.UNSIGNED32;
- RECEIVE_BUFFER_AREA : RTEMS.BUFFER;
- RECEIVE_BUFFER : RTEMS.BUFFER_POINTER;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RECEIVE_BUFFER :=
- RTEMS.TO_BUFFER_POINTER( RECEIVE_BUFFER_AREA'ADDRESS );
-
- TEXT_IO.PUT_LINE( "Getting QID of message queue" );
-
- loop
-
- RTEMS.MESSAGE_QUEUE_IDENT(
- MPTEST.QUEUE_NAME( 1 ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.QUEUE_ID( 1 ),
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- end loop;
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- TEXT_IO.PUT_LINE( "Receiving message ..." );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- MPTEST.QUEUE_ID( 1 ),
- RECEIVE_BUFFER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEXT_IO.PUT_LINE( "How did I get back from here???" );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
-
- end if;
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "Receiving message ..." );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- MPTEST.QUEUE_ID( 1 ),
- RECEIVE_BUFFER,
- RTEMS.DEFAULT_OPTIONS,
- 2 * TEST_SUPPORT.TICKS_PER_SECOND,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TIMEOUT,
- "MESSAGE_QUEUE_RECEIVE"
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TIMEOUT,
- "MESSAGE_QUEUE_OBTAIN"
- );
-
- TEXT_IO.PUT_LINE(
- "message_queue_receive correctly returned TIMEOUT"
- );
-
- TEXT_IO.PUT_LINE( "Deleting self" );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end TEST_TASK_1;
-
---PAGE
---
--- TEST_TASK_2
---
-
- procedure TEST_TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "Getting SMID of semaphore" );
-
- loop
-
- RTEMS.SEMAPHORE_IDENT(
- MPTEST.SEMAPHORE_NAME( 1 ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- end loop;
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "Releasing semaphore ..." );
- RTEMS.SEMAPHORE_RELEASE( MPTEST.SEMAPHORE_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" );
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND / 2, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "Getting semaphore ..." );
- RTEMS.SEMAPHORE_OBTAIN(
- MPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
-
- TEXT_IO.PUT_LINE( "Getting semaphore ..." );
- RTEMS.SEMAPHORE_OBTAIN(
- MPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEXT_IO.PUT_LINE( "How did I get back from here???" );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
-
- end if;
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND / 2, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "Getting semaphore ..." );
- RTEMS.SEMAPHORE_OBTAIN(
- MPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
-
- TEXT_IO.PUT_LINE( "Releasing semaphore ..." );
- RTEMS.SEMAPHORE_RELEASE( MPTEST.SEMAPHORE_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" );
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "Getting semaphore ..." );
- RTEMS.SEMAPHORE_OBTAIN(
- MPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_OPTIONS,
- 2 * TEST_SUPPORT.TICKS_PER_SECOND,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TIMEOUT,
- "SEMAPHORE_OBTAIN"
- );
- TEXT_IO.PUT_LINE( "semaphore_obtain correctly returned TIMEOUT" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 13 ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TEST_TASK_2;
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp13/mptest.ads b/c/src/ada-tests/mptests/mp13/mptest.ads
deleted file mode 100644
index 1575c5adeb..0000000000
--- a/c/src/ada-tests/mptests/mp13/mptest.ads
+++ /dev/null
@@ -1,206 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 13 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS message
--- queues created by this test.
---
-
- QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS semaphore
--- created by this test.
---
-
- SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- This variable contains the ID of the remote task with which this
--- test interacts.
---
-
- REMOTE_TID : RTEMS.ID;
-
---
--- This variable contains the node on which the remote task with which
--- this test interacts resides.
---
-
- REMOTE_NODE : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK_1
---
--- DESCRIPTION:
---
--- This is the body of one of the RTEMS tasks which constitute this test.
---
-
- procedure TEST_TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK_2
---
--- DESCRIPTION:
---
--- This is the body of one of the RTEMS tasks which constitute this test.
---
-
- procedure TEST_TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.DEFAULT_ATTRIBUTES, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.NO_PREEMPT, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 32, -- maximum # global objects
- 32 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 0, -- maximum # timers
- 1, -- maximum # semaphores
- 1, -- maximum # message queues
- 0, -- maximum # messages
- 0, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 50 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp13/node1/mp13.scn b/c/src/ada-tests/mptests/mp13/node1/mp13.scn
deleted file mode 100644
index d3bd11f65e..0000000000
--- a/c/src/ada-tests/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/c/src/ada-tests/mptests/mp13/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp13/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/mptests/mp13/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp13/node2/mp13.scn b/c/src/ada-tests/mptests/mp13/node2/mp13.scn
deleted file mode 100644
index 3254046292..0000000000
--- a/c/src/ada-tests/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 ...
-Releasing semaphore ...
-Receiving message ...
-Getting semaphore ...
-message_queue_receive correctly returned TIMEOUT
-Deleting self
-semaphore_obtain correctly returned TIMEOUT
-*** END OF TEST 13 ***
diff --git a/c/src/ada-tests/mptests/mp13/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp13/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/mptests/mp13/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp14/mptest.adb b/c/src/ada-tests/mptests/mp14/mptest.adb
deleted file mode 100644
index e43aec8ae5..0000000000
--- a/c/src/ada-tests/mptests/mp14/mptest.adb
+++ /dev/null
@@ -1,764 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 14 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with BSP;
-with BSP_MPCI;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- STOP_TEST_TSR
---
-
- procedure STOP_TEST_TSR (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- ) is
- begin
-
- MPTEST.STOP_TEST := TRUE;
-
- end STOP_TEST_TSR;
-
---PAGE
---
--- EXIT_TEST
---
-
- procedure EXIT_TEST is
- OLD_MODE : RTEMS.MODE;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_MODE( RTEMS.NO_PREEMPT, RTEMS.PREEMPT_MASK, OLD_MODE, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
-
- BSP_MPCI.PRINT_STATISTICS;
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end EXIT_TEST;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- PREVIOUS_PRIORITY : RTEMS.TASK_PRIORITY;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** TEST 14 -- NODE " );
- UNSIGNED32_IO.PUT(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE,
- WIDTH => 1
- );
- TEXT_IO.PUT_LINE( " ***" );
-
- MPTEST.STOP_TIMER_NAME := RTEMS.BUILD_NAME( 'S', 'T', 'O', 'P' );
-
- MPTEST.STOP_TEST := FALSE;
-
- RTEMS.TIMER_CREATE(
- MPTEST.STOP_TIMER_NAME,
- MPTEST.STOP_TIMER_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" );
-
- RTEMS.TIMER_FIRE_AFTER(
- MPTEST.STOP_TIMER_ID,
- BSP.MAXIMUM_LONG_TEST_DURATION * TEST_SUPPORT.TICKS_PER_SECOND,
- MPTEST.STOP_TEST_TSR'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" );
-
- MPTEST.EVENT_TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' );
- MPTEST.EVENT_TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' );
-
- MPTEST.QUEUE_TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'T', '1', ' ' );
- MPTEST.QUEUE_TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'M', 'T', '2', ' ' );
-
- MPTEST.PARTITION_TASK_NAME( 1 ) :=
- RTEMS.BUILD_NAME( 'P', 'T', '1', ' ' );
- MPTEST.PARTITION_TASK_NAME( 2 ) :=
- RTEMS.BUILD_NAME( 'P', 'T', '2', ' ' );
-
- MPTEST.SEMAPHORE_TASK_NAME( 1 ) :=
- RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' );
- MPTEST.SEMAPHORE_TASK_NAME( 2 ) :=
- RTEMS.BUILD_NAME( 'S', 'M', '2', ' ' );
-
- MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' );
-
- MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' );
-
- MPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'A', 'R', ' ' );
-
- MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', 'R', ' ' );
-
- for INDEX in MPTEST.BUFFERS'FIRST .. MPTEST.BUFFERS'LAST
- loop
-
- MPTEST.BUFFERS( INDEX ) :=
- RTEMS.TO_BUFFER_POINTER( MPTEST.BUFFER_AREAS( INDEX )'ADDRESS );
-
- end loop;
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- TEXT_IO.PUT_LINE( "Creating Semaphore (Global)" );
- RTEMS.SEMAPHORE_CREATE(
- MPTEST.SEMAPHORE_NAME( 1 ),
- 1,
- RTEMS.GLOBAL,
- MPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" );
-
- TEXT_IO.PUT_LINE( "Creating Message Queue (Global)" );
- RTEMS.MESSAGE_QUEUE_CREATE(
- MPTEST.QUEUE_NAME( 1 ),
- 1,
- RTEMS.GLOBAL,
- MPTEST.QUEUE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" );
-
- TEXT_IO.PUT_LINE( "Creating Partition (Global)" );
- RTEMS.PARTITION_CREATE(
- MPTEST.PARTITION_NAME( 1 ),
- MPTEST.PARTITION_AREA( 0 )'ADDRESS,
- 16#8000#,
- 16#3000#,
- RTEMS.GLOBAL,
- MPTEST.PARTITION_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE" );
-
- end if;
-
- TEXT_IO.PUT_LINE( "Creating Event task (Global)" );
- RTEMS.TASK_CREATE(
- MPTEST.EVENT_TASK_NAME(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE
- ),
- 2,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.GLOBAL,
- MPTEST.EVENT_TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Event task (Global)" );
- RTEMS.TASK_START(
- MPTEST.EVENT_TASK_ID( 1 ),
- MPTEST.TEST_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- TEXT_IO.PUT_LINE( "Creating Semaphore task (Global)" );
- RTEMS.TASK_CREATE(
- MPTEST.SEMAPHORE_TASK_NAME(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE
- ),
- 2,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.GLOBAL,
- MPTEST.SEMAPHORE_TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Semaphore task (Global)" );
- RTEMS.TASK_START(
- MPTEST.SEMAPHORE_TASK_ID( 1 ),
- MPTEST.SEMAPHORE_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- TEXT_IO.PUT_LINE( "Creating Message Queue task (Global)" );
- RTEMS.TASK_CREATE(
- MPTEST.QUEUE_TASK_NAME(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE
- ),
- 2,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.GLOBAL,
- MPTEST.QUEUE_TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Message Queue task (Global)" );
- RTEMS.TASK_START(
- MPTEST.QUEUE_TASK_ID( 1 ),
- MPTEST.MESSAGE_QUEUE_TASK'ACCESS,
- 1, -- index of buffer
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- TEXT_IO.PUT_LINE( "Creating Partition task (Global)" );
- RTEMS.TASK_CREATE(
- MPTEST.PARTITION_TASK_NAME(
- MPTEST.MULTIPROCESSING_CONFIGURATION.NODE
- ),
- 2,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.GLOBAL,
- MPTEST.PARTITION_TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- TEXT_IO.PUT_LINE( "Starting Partition task (Global)" );
- RTEMS.TASK_START(
- MPTEST.PARTITION_TASK_ID( 1 ),
- MPTEST.PARTITION_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- RTEMS.TASK_SET_PRIORITY( RTEMS.SELF, 2, PREVIOUS_PRIORITY, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
-
- MPTEST.DELAYED_EVENTS_TASK( 1 );
-
- end INIT;
-
---
--- DELAYED_SEND_EVENT
---
--- DESCRIPTION:
---
--- This subprogram is a timer service routine which sends an
--- event set to a waiting task.
---
-
- procedure DELAYED_SEND_EVENT (
- TIMER_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.EVENT_SEND(
- MPTEST.TASK_ID( RTEMS.GET_INDEX( TIMER_ID ) ),
- RTEMS.EVENT_16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" );
-
- end DELAYED_SEND_EVENT;
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This is one of the test tasks.
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- REMOTE_NODE : RTEMS.UNSIGNED32;
- REMOTE_TID : RTEMS.ID;
- COUNT : RTEMS.UNSIGNED32;
- EVENT_OUT : RTEMS.EVENT_SET;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
- REMOTE_NODE := 2;
- else
- REMOTE_NODE := 1;
- end if;
-
- TEXT_IO.PUT_LINE( "About to go to sleep!" );
- RTEMS.TASK_WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
- TEXT_IO.PUT_LINE( "Waking up!" );
-
- TEXT_IO.PUT( "Remote task's name is : " );
- TEST_SUPPORT.PUT_NAME( MPTEST.EVENT_TASK_NAME( REMOTE_NODE ), TRUE );
-
- TEXT_IO.PUT_LINE( "Getting TID of remote task" );
-
- loop
-
- RTEMS.TASK_IDENT(
- MPTEST.EVENT_TASK_NAME( REMOTE_NODE ),
- RTEMS.SEARCH_ALL_NODES,
- REMOTE_TID,
- STATUS
- );
-
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- TEXT_IO.PUT_LINE( "task_ident" );
-
- end loop;
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
- TEXT_IO.PUT_LINE( "Sending events to remote task" );
-
- loop
- exit when MPTEST.STOP_TEST = TRUE;
-
- for COUNT in 1 .. MPTEST.EVENT_TASK_DOT_COUNT
- loop
- RTEMS.EVENT_SEND(
- REMOTE_TID,
- RTEMS.EVENT_16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" );
-
- exit when MPTEST.STOP_TEST = TRUE;
-
- end loop;
-
- TEST_SUPPORT.PUT_DOT( "e" );
-
- end loop;
-
- end if;
-
- TEXT_IO.PUT_LINE( "Receiving events from remote task" );
-
- loop
- exit when MPTEST.STOP_TEST = TRUE;
-
- for COUNT in 1 .. MPTEST.EVENT_TASK_DOT_COUNT
- loop
- exit when MPTEST.STOP_TEST = TRUE;
-
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_16,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- EVENT_OUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" );
-
- end loop;
-
- TEST_SUPPORT.PUT_DOT( "e" );
-
- end loop;
-
- MPTEST.EXIT_TEST;
-
- end TEST_TASK;
-
---
--- DELAYED_EVENTS_TASK
---
--- DESCRIPTION:
---
--- This is one of the test tasks.
---
-
- procedure DELAYED_EVENTS_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- COUNT : RTEMS.UNSIGNED32;
- PREVIOUS_MODE : RTEMS.MODE;
- EVENTS_OUT : RTEMS.EVENT_SET;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_MODE(
- RTEMS.PREEMPT + RTEMS.TIMESLICE,
- RTEMS.PREEMPT_MASK + RTEMS.TIMESLICE_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
-
- RTEMS.TIMER_CREATE(
- MPTEST.TIMER_NAME( 1 ),
- MPTEST.TIMER_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" );
-
- RTEMS.TASK_IDENT(
- RTEMS.SELF,
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.TASK_ID( RTEMS.GET_INDEX( MPTEST.TIMER_ID( 1 ) ) ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENTS" );
-
- loop
-
- for COUNT in 1 .. MPTEST.DELAYED_EVENT_DOT_COUNT
- loop
- RTEMS.TIMER_FIRE_AFTER(
- MPTEST.TIMER_ID( 1 ),
- 1,
- MPTEST.DELAYED_SEND_EVENT'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" );
-
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_16,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- EVENTS_OUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" );
-
- end loop;
-
- TEST_SUPPORT.PUT_DOT( "." );
-
- end loop;
-
- MPTEST.EXIT_TEST;
-
- end DELAYED_EVENTS_TASK;
-
---
--- MESSAGE_QUEUE_TASK
---
--- DESCRIPTION:
---
--- This is one of the test tasks.
---
-
- procedure MESSAGE_QUEUE_TASK (
- INDEX : in RTEMS.TASK_ARGUMENT
- ) is
- COUNT : RTEMS.UNSIGNED32;
- YIELD_COUNT : RTEMS.UNSIGNED32;
- OVERFLOW_COUNT : RTEMS.UNSIGNED32_POINTER;
- BUFFER_COUNT : RTEMS.UNSIGNED32_POINTER;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- MPTEST.BUFFERS( INDEX ).FIELD1 := 0;
- MPTEST.BUFFERS( INDEX ).FIELD2 := 0;
- MPTEST.BUFFERS( INDEX ).FIELD3 := 0;
- MPTEST.BUFFERS( INDEX ).FIELD4 := 0;
-
- TEXT_IO.PUT_LINE( "Getting ID of message queue" );
-
- loop
-
- RTEMS.MESSAGE_QUEUE_IDENT(
- MPTEST.QUEUE_NAME( 1 ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.QUEUE_ID( 1 ),
- STATUS
- );
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- TEXT_IO.PUT_LINE( "message_queue_ident FAILED!!" );
-
- end loop;
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- RTEMS.MESSAGE_QUEUE_SEND(
- MPTEST.QUEUE_ID( 1 ),
- MPTEST.BUFFERS( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- OVERFLOW_COUNT := RTEMS.TO_UNSIGNED32_POINTER(
- MPTEST.BUFFERS( INDEX ).FIELD1'ADDRESS
- );
-
- BUFFER_COUNT := RTEMS.TO_UNSIGNED32_POINTER(
- MPTEST.BUFFERS( INDEX ).FIELD2'ADDRESS
- );
-
- else
-
- OVERFLOW_COUNT := RTEMS.TO_UNSIGNED32_POINTER(
- MPTEST.BUFFERS( INDEX ).FIELD3'ADDRESS
- );
-
- BUFFER_COUNT := RTEMS.TO_UNSIGNED32_POINTER(
- MPTEST.BUFFERS( INDEX ).FIELD4'ADDRESS
- );
-
- end if;
-
- loop
-
- exit when MPTEST.STOP_TEST = TRUE;
-
- YIELD_COUNT := 100;
-
- for COUNT in 1 .. MPTEST.MESSAGE_DOT_COUNT
- loop
-
- exit when MPTEST.STOP_TEST = TRUE;
-
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- MPTEST.QUEUE_ID( 1 ),
- MPTEST.BUFFERS( INDEX ),
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "MESSAGE_QUEUE_RECEIVE"
- );
-
- if BUFFER_COUNT.ALL = RTEMS.UNSIGNED32'LAST then
- BUFFER_COUNT.ALL := 0;
- OVERFLOW_COUNT.ALL := OVERFLOW_COUNT.ALL + 1;
- else
- BUFFER_COUNT.ALL := BUFFER_COUNT.ALL + 1;
- end if;
-
- RTEMS.MESSAGE_QUEUE_SEND(
- MPTEST.QUEUE_ID( 1 ),
- MPTEST.BUFFERS( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- if MPTEST.STOP_TEST = FALSE then
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- YIELD_COUNT := YIELD_COUNT - 1;
-
- if YIELD_COUNT = 0 then
-
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "YIELD" );
-
- YIELD_COUNT := 100;
-
- end if;
-
- end if;
-
- end if;
-
- end loop;
-
- TEST_SUPPORT.PUT_DOT( "m" );
-
- end loop;
-
- MPTEST.EXIT_TEST;
-
- end MESSAGE_QUEUE_TASK;
-
---
--- PARTITION_TASK
---
--- DESCRIPTION:
---
--- This is one of the test tasks.
---
-
- procedure PARTITION_TASK (
- IGNORED : in RTEMS.TASK_ARGUMENT
- ) is
- COUNT : RTEMS.UNSIGNED32;
- BUFFER : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "Getting ID of partition" );
-
- loop
-
- RTEMS.PARTITION_IDENT(
- MPTEST.PARTITION_NAME( 1 ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.PARTITION_ID( 1 ),
- STATUS
- );
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- TEXT_IO.PUT_LINE( "partition_ident FAILED!!" );
-
- end loop;
-
- loop
-
- exit when MPTEST.STOP_TEST = TRUE;
-
- for COUNT in 1 .. MPTEST.PARTITION_DOT_COUNT
- loop
-
- exit when MPTEST.STOP_TEST = TRUE;
-
- RTEMS.PARTITION_GET_BUFFER(
- MPTEST.PARTITION_ID( 1 ),
- BUFFER,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" );
-
- RTEMS.PARTITION_RETURN_BUFFER(
- MPTEST.PARTITION_ID( 1 ),
- BUFFER,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "PARTITION_RETURN_BUFFER"
- );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "YIELD" );
-
- end if;
-
- end loop;
-
- TEST_SUPPORT.PUT_DOT( "p" );
-
- end loop;
-
- MPTEST.EXIT_TEST;
-
- end PARTITION_TASK;
-
---
--- SEMAPHORE_TASK
---
--- DESCRIPTION:
---
--- This is one of the test tasks.
---
-
- procedure SEMAPHORE_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- COUNT : RTEMS.UNSIGNED32;
- YIELD_COUNT : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "Getting ID of semaphore" );
-
- loop
-
- RTEMS.SEMAPHORE_IDENT(
- MPTEST.SEMAPHORE_NAME( 1 ),
- RTEMS.SEARCH_ALL_NODES,
- MPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
- exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS );
-
- TEXT_IO.PUT_LINE( "semaphore_ident FAILED!!" );
-
- end loop;
-
- loop
-
- YIELD_COUNT := 100;
-
- exit when MPTEST.STOP_TEST = TRUE;
-
- for COUNT in 1 .. MPTEST.SEMAPHORE_DOT_COUNT
- loop
-
- exit when MPTEST.STOP_TEST = TRUE;
-
- RTEMS.SEMAPHORE_OBTAIN(
- MPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
-
- RTEMS.SEMAPHORE_RELEASE( MPTEST.SEMAPHORE_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" );
-
- if MPTEST.MULTIPROCESSING_CONFIGURATION.NODE = 1 then
-
- YIELD_COUNT := YIELD_COUNT - 1;
-
- if YIELD_COUNT = 0 then
-
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "YIELD" );
-
- YIELD_COUNT := 100;
-
- end if;
-
- end if;
-
- end loop;
-
- TEST_SUPPORT.PUT_DOT( "s" );
-
- end loop;
-
- MPTEST.EXIT_TEST;
-
- end SEMAPHORE_TASK;
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp14/mptest.ads b/c/src/ada-tests/mptests/mp14/mptest.ads
deleted file mode 100644
index 83786f5fe0..0000000000
--- a/c/src/ada-tests/mptests/mp14/mptest.ads
+++ /dev/null
@@ -1,347 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 14 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test for passing event sets.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME;
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test for passing event sets.
---
-
- EVENT_TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID;
- EVENT_TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test for manipulating semaphores.
---
-
- SEMAPHORE_TASK_ID :
- array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID;
- SEMAPHORE_TASK_NAME :
- array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test for passing messages.
---
-
- QUEUE_TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID;
- QUEUE_TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test for manipulating the global partitions.
---
-
- PARTITION_TASK_ID :
- array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID;
- PARTITION_TASK_NAME :
- array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS partitions
--- created by this test.
---
-
- PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID;
- PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS semaphores
--- created by this test.
---
-
- SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID;
- SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS message_queues
--- created by this test.
---
-
- QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID;
- QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME;
-
---
---
--- These arrays contain the IDs and NAMEs of all RTEMS timers
--- created by this test.
---
-
- TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID;
- TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME;
-
---
--- The following are message buffers used to contain the test messages
--- and pointers to those buffers.
---
-
- BUFFER_AREAS : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.BUFFER;
- BUFFERS :
- array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.BUFFER_POINTER;
-
---
--- This is the area used for the partition.
---
-
- PARTITION_AREA :
- array ( RTEMS.UNSIGNED32 range 0 .. 16#7FFF# ) of RTEMS.UNSIGNED8;
- for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
---
--- The following constants control the flow of "dot" indicators
--- from the various test componenents.
---
-
- EVENT_TASK_DOT_COUNT : constant RTEMS.UNSIGNED32 := 100;
- EVENT_SEND_DOT_COUNT : constant RTEMS.UNSIGNED32 := 100;
- DELAYED_EVENT_DOT_COUNT : constant RTEMS.UNSIGNED32 := 1000;
- MESSAGE_DOT_COUNT : constant RTEMS.UNSIGNED32 := 200;
- PARTITION_DOT_COUNT : constant RTEMS.UNSIGNED32 := 200;
- SEMAPHORE_DOT_COUNT : constant RTEMS.UNSIGNED32 := 200;
-
---
--- These contain the IDs and NAMEs of the RTEMS timers used
--- by this test to stop.
---
-
- STOP_TIMER_ID : RTEMS.ID;
- STOP_TIMER_NAME : RTEMS.NAME;
-
---
--- This variable is set when the test should stop executing.
---
-
- STOP_TEST : RTEMS.BOOLEAN;
-
---
--- EXIT_TEST
---
--- DESCRIPTION:
---
--- This subprogram is invoked to stop this test.
---
-
- procedure EXIT_TEST;
-
---
--- DELAYED_SEND_EVENT
---
--- DESCRIPTION:
---
--- This subprogram is a timer service routine which sends an
--- event set to a waiting task.
---
-
- procedure DELAYED_SEND_EVENT (
- TIMER_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This is one of the test tasks.
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- DELAYED_EVENTS_TASK
---
--- DESCRIPTION:
---
--- This is one of the test tasks.
---
-
- procedure DELAYED_EVENTS_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- MESSAGE_QUEUE_TASK
---
--- DESCRIPTION:
---
--- This is one of the test tasks.
---
-
- procedure MESSAGE_QUEUE_TASK (
- INDEX : in RTEMS.TASK_ARGUMENT
- );
-
---
--- PARTITION_TASK
---
--- DESCRIPTION:
---
--- This is one of the test tasks.
---
-
- procedure PARTITION_TASK (
- IGNORED : in RTEMS.TASK_ARGUMENT
- );
-
---
--- SEMAPHORE_TASK
---
--- DESCRIPTION:
---
--- This is one of the test tasks.
---
-
- procedure SEMAPHORE_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.DEFAULT_ATTRIBUTES, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.TIMESLICE, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 32, -- maximum # global objects
- 32 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 12, -- maximum # timers
- 1, -- maximum # semaphores
- 1, -- maximum # message queues
- 1, -- maximum # messages
- 1, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 1 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/mptests/mp14/node1/mp14.scn b/c/src/ada-tests/mptests/mp14/node1/mp14.scn
deleted file mode 100644
index d1b6feefe9..0000000000
--- a/c/src/ada-tests/mptests/mp14/node1/mp14.scn
+++ /dev/null
@@ -1,33 +0,0 @@
-*** TEST 14 -- NODE 1 ***
-Creating Semaphore (Global)
-Creating Message Queue (Global)
-Creating Partition (Global)
-Creating Event task (Global)
-Starting Event task (Global)
-Creating Semaphore task (Global)
-About to go to sleep!
-Starting Semaphore task (Global)
-Creating Message Queue task (Global)
-Getting SMID of semaphore
-Starting Message Queue task (Global)
-Creating Partition task (Global)
-Getting ID of msg queue
-Starting Partition task (Global)
-Getting ID of partition
-Waking up!
-Remote task's name is : 222
-Getting TID of remote task
-Sending events to remote task
-<stream of following characters>
-. - indicates 100 iterations of
-tm_evafter of 1 tick and event_receive.
-e - indicates that 100
-events have been sent to the remote task.
-m - indicates 100 iterations of
-message_queue_send and message_queue_receive.
-p - indicates 100 iterations of
-partition_get_buffer and partition_return_buffer.
-s - indicates 100 iterations of
-semaphore_obtain and semaphore_release.
-NOTE: The characters in the stream could begin to appear whenever any
-task is started.
diff --git a/c/src/ada-tests/mptests/mp14/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp14/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/mptests/mp14/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/mptests/mp14/node2/mp14.scn b/c/src/ada-tests/mptests/mp14/node2/mp14.scn
deleted file mode 100644
index a245b11faa..0000000000
--- a/c/src/ada-tests/mptests/mp14/node2/mp14.scn
+++ /dev/null
@@ -1,28 +0,0 @@
-*** TEST 14 -- NODE 2 ***
-Creating Event task (Global)
-Starting Event task (Global)
-Creating Semaphore task (Global)
-About to go to sleep!
-Starting Semaphore task (Global)
-Creating Message Queue task (Global)
-Getting SMID of semaphore
-Starting Message Queue task (Global)
-Creating Partition task (Global)
-Getting ID of msg queue
-Starting Partition task (Global)
-Getting ID of partition
-Waking up!
-Remote task's name is : 111
-Getting TID of remote task
-Receiving events from remote task
-<stream of following characters>
-. - indicates 100 iterations of
-tm_evafter of 1 tick and event_receive.
-e - indicates that 100
-events have been sent to the remote task.
-m - indicates 100 iterations of
-message_queue_send and message_queue_receive.
-p - indicates 100 iterations of
-partition_get_buffer and partition_return_buffer.
-s - indicates 100 iterations of
-semaphore_obtain and semaphore_release.
diff --git a/c/src/ada-tests/mptests/mp14/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/mptests/mp14/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/mptests/mp14/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/samples/base_mp/mptest.adb b/c/src/ada-tests/samples/base_mp/mptest.adb
deleted file mode 100644
index 61990654b4..0000000000
--- a/c/src/ada-tests/samples/base_mp/mptest.adb
+++ /dev/null
@@ -1,108 +0,0 @@
---
--- MPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation for Test 1 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body MPTEST is
-
- package body PER_NODE_CONFIGURATION is separate;
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- C : RTEMS.CHARACTER;
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT( "*** SAMPLE MULTIPROCESSOR APPLICATION ***" );
- TEXT_IO.PUT( "Creating and starting an application task" );
-
-
- MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
-
- RTEMS.TASK_CREATE(
- MPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.INTERRUPT_LEVEL( 0 ),
- RTEMS.DEFAULT_ATTRIBUTES,
- MPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_START(
- MPTEST.TASK_ID( 1 ),
- MPTEST.APPLICATION_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- APPLICATION_TASK
---
-
- procedure APPLICATION_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TIME : RTEMS.TIME_OF_DAY;
- TID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );
-
- TEXT_IO.PUT( "This task was invoked with node argument (" );
- UNSIGNED32_IO.PUT( ARGUMENT );
- TEXT_IO.PUT_LINE( ")" );
-
- TEXT_IO.PUT( "This task has the id of 0x" );
- UNSIGNED32_IO.PUT( TID, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "*** END OF SAMPLE MULTIPROCESSOR APPLICATION ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end APPLICATION_TASK;
-
-end MPTEST;
diff --git a/c/src/ada-tests/samples/base_mp/mptest.ads b/c/src/ada-tests/samples/base_mp/mptest.ads
deleted file mode 100644
index 7b76581a62..0000000000
--- a/c/src/ada-tests/samples/base_mp/mptest.ads
+++ /dev/null
@@ -1,166 +0,0 @@
---
--- MPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 1 of the RTEMS
--- Multiprocessor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 BSP_MPCI;
-with RTEMS;
-
-package MPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- APPLICATION_TASK
---
--- DESCRIPTION:
---
--- This routine is as an example of an application task which
--- prints a message including its RTEMS task id. This task
--- then invokes exit to return to the monitor.
---
-
- procedure APPLICATION_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- This is the Driver Address Table for this test.
---
-
- DEVICE_DRIVERS : aliased RTEMS.DRIVER_ADDRESS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- CLOCK_DRIVER.INITIALIZE'ACCESS, -- Initialization
- RTEMS.NO_DRIVER_ENTRY, -- Open
- RTEMS.NO_DRIVER_ENTRY, -- Close
- RTEMS.NO_DRIVER_ENTRY, -- Read
- RTEMS.NO_DRIVER_ENTRY, -- Write
- RTEMS.NO_DRIVER_ENTRY -- Control
- )
- );
-
---
--- This is the Initialization Tasks Table for this test.
---
-
- INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
- (1=>
- (
- RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ), -- task name
- 2048, -- stack size
- 1, -- priority
- RTEMS.GLOBAL, -- attributes
- MPTEST.INIT'ACCESS, -- entry point
- RTEMS.NO_PREEMPT, -- initial mode
- 0 -- argument list
- )
- );
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- BEGIN SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
- --
- -- MPTEST.PER_NODE_CONFIGURATION / SPECIFICATION
- --
- -- DESCRIPTION:
- --
- -- This package is the specification for the subpackage
- -- which will define the per node configuration parameters.
- --
-
- package PER_NODE_CONFIGURATION is
-
- --
- -- LOCAL_NODE_NUMBER
- --
- -- DESCRIPTION:
- --
- -- This function returns the node number for this node.
- --
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32;
-
- pragma INLINE ( LOCAL_NODE_NUMBER );
-
- end PER_NODE_CONFIGURATION;
-
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- END SUBPACKAGE --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-
---
--- This is the Multiprocessor Configuration Table for this test.
---
-
- MULTIPROCESSING_CONFIGURATION : aliased RTEMS.MULTIPROCESSING_TABLE := (
- MPTEST.PER_NODE_CONFIGURATION.LOCAL_NODE_NUMBER,
- 2, -- maximum # nodes in system
- 33, -- maximum # global objects
- 33 -- maximum # proxies
- );
-
---
--- This is the Configuration Table for this test.
---
-
- CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
- RTEMS.NULL_ADDRESS, -- will be replaced by BSP
- 64 * 1024, -- executive RAM size
- 10, -- maximum # tasks
- 0, -- maximum # timers
- 0, -- maximum # semaphores
- 0, -- maximum # message queues
- 0, -- maximum # messages
- 0, -- maximum # partitions
- 0, -- maximum # regions
- 0, -- maximum # dp memory areas
- 0, -- maximum # periods
- 0, -- maximum # user extensions
- RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
- 50 -- # ticks in a timeslice
- );
-
-end MPTEST;
diff --git a/c/src/ada-tests/samples/base_mp/node1/base_mp.scn b/c/src/ada-tests/samples/base_mp/node1/base_mp.scn
deleted file mode 100644
index a2d2f359be..0000000000
--- a/c/src/ada-tests/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/c/src/ada-tests/samples/base_mp/node1/mptest-per_node_configuration.adb b/c/src/ada-tests/samples/base_mp/node1/mptest-per_node_configuration.adb
deleted file mode 100644
index 7df5087537..0000000000
--- a/c/src/ada-tests/samples/base_mp/node1/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 1;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/samples/base_mp/node2/base_mp.scn b/c/src/ada-tests/samples/base_mp/node2/base_mp.scn
deleted file mode 100644
index 95bc96a808..0000000000
--- a/c/src/ada-tests/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/c/src/ada-tests/samples/base_mp/node2/mptest-per_node_configuration.adb b/c/src/ada-tests/samples/base_mp/node2/mptest-per_node_configuration.adb
deleted file mode 100644
index e127cc5573..0000000000
--- a/c/src/ada-tests/samples/base_mp/node2/mptest-per_node_configuration.adb
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- MPTEST.PER_NODE_CONFIGURATION / BODY
---
--- DESCRIPTION:
---
--- This package is the specification for the subpackage
--- which will define the per node configuration parameters.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-separate ( MPTEST )
-
-package body PER_NODE_CONFIGURATION is
-
---PAGE
---
--- LOCAL_NODE_NUMBER
---
-
- function LOCAL_NODE_NUMBER
- return RTEMS.UNSIGNED32 is
- begin
-
- return 2;
-
- end LOCAL_NODE_NUMBER;
-
-end PER_NODE_CONFIGURATION;
diff --git a/c/src/ada-tests/samples/base_sp/base_sp.adb b/c/src/ada-tests/samples/base_sp/base_sp.adb
deleted file mode 100644
index 0800b3da48..0000000000
--- a/c/src/ada-tests/samples/base_sp/base_sp.adb
+++ /dev/null
@@ -1,58 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Base Single Process Example of the
--- Sample Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure Base_SP is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end Base_SP;
-
diff --git a/c/src/ada-tests/samples/base_sp/base_sp.scn b/c/src/ada-tests/samples/base_sp/base_sp.scn
deleted file mode 100644
index 90794be60c..0000000000
--- a/c/src/ada-tests/samples/base_sp/base_sp.scn
+++ /dev/null
@@ -1,4 +0,0 @@
-*** SAMPLE SINGLE PROCESSOR APPLICATION ***
-Creating and starting an application task
-Application task was invoked with argument (0) and has id of 0x10002
-*** END OF SAMPLE SINGLE PROCESSOR APPLICATION ***
diff --git a/c/src/ada-tests/samples/base_sp/config.h b/c/src/ada-tests/samples/base_sp/config.h
deleted file mode 100644
index bfb614cd4e..0000000000
--- a/c/src/ada-tests/samples/base_sp/config.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/samples/base_sp/sptest.adb b/c/src/ada-tests/samples/base_sp/sptest.adb
deleted file mode 100644
index 5ae17e18da..0000000000
--- a/c/src/ada-tests/samples/base_sp/sptest.adb
+++ /dev/null
@@ -1,98 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 1 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** SAMPLE SINGLE PROCESSOR APPLICATION ***" );
- TEXT_IO.PUT_LINE( "Creating and starting an application task" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.INTERRUPT_LEVEL( 0 ),
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.APPLICATION_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- APPLICATION_TASK
---
-
- procedure APPLICATION_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
-
- TEXT_IO.PUT( "Application task was invoked with argument (" );
- UNSIGNED32_IO.PUT( ARGUMENT );
- TEXT_IO.PUT( ") and has id of 0x" );
- UNSIGNED32_IO.PUT( TID, BASE => 16 );
-
- TEXT_IO.PUT_LINE( "*** END OF SAMPLE SINGLE PROCESSOR APPLICATION ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end APPLICATION_TASK;
-
-end SPTEST;
diff --git a/c/src/ada-tests/samples/base_sp/sptest.ads b/c/src/ada-tests/samples/base_sp/sptest.ads
deleted file mode 100644
index 62ed876e9f..0000000000
--- a/c/src/ada-tests/samples/base_sp/sptest.ads
+++ /dev/null
@@ -1,60 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 1 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- APPLICATION_TASK
---
--- DESCRIPTION:
---
--- This is the body of the RTEMS task which constitutes this test.
---
-
- procedure APPLICATION_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/samples/hello/config.h b/c/src/ada-tests/samples/hello/config.h
deleted file mode 100644
index 32dae5a93d..0000000000
--- a/c/src/ada-tests/samples/hello/config.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/samples/hello/hello.adb b/c/src/ada-tests/samples/hello/hello.adb
deleted file mode 100644
index d2fa9d1155..0000000000
--- a/c/src/ada-tests/samples/hello/hello.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test Hello of the Sample Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure Hello is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end Hello;
-
diff --git a/c/src/ada-tests/samples/hello/hello.scn b/c/src/ada-tests/samples/hello/hello.scn
deleted file mode 100644
index d9e92d81d5..0000000000
--- a/c/src/ada-tests/samples/hello/hello.scn
+++ /dev/null
@@ -1,3 +0,0 @@
-*** HELLO WORLD TEST ***
-Hello World
-*** END OF HELLO WORLD TEST ***
diff --git a/c/src/ada-tests/samples/hello/sptest.adb b/c/src/ada-tests/samples/hello/sptest.adb
deleted file mode 100644
index db2add4365..0000000000
--- a/c/src/ada-tests/samples/hello/sptest.adb
+++ /dev/null
@@ -1,52 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 1 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** HELLO WORLD TEST ***" );
- TEXT_IO.PUT_LINE( "Hello World" );
- TEXT_IO.PUT_LINE( "*** END OF HELLO WORLD TEST ***" );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end INIT;
-
-end SPTEST;
diff --git a/c/src/ada-tests/samples/hello/sptest.ads b/c/src/ada-tests/samples/hello/sptest.ads
deleted file mode 100644
index e632f1a499..0000000000
--- a/c/src/ada-tests/samples/hello/sptest.ads
+++ /dev/null
@@ -1,48 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for the Hello World Test of the RTEMS
--- Sample Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/samples/ticker/config.h b/c/src/ada-tests/samples/ticker/config.h
deleted file mode 100644
index bfb614cd4e..0000000000
--- a/c/src/ada-tests/samples/ticker/config.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/samples/ticker/sptest.adb b/c/src/ada-tests/samples/ticker/sptest.adb
deleted file mode 100644
index c755f3783d..0000000000
--- a/c/src/ada-tests/samples/ticker/sptest.adb
+++ /dev/null
@@ -1,162 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 1 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 1 ***" );
-
- TIME := ( 1988, 12, 31, 9, 0, 0, 0 );
-
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 3 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1_THROUGH_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_1_THROUGH_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 3 ),
- SPTEST.TASK_1_THROUGH_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1_THROUGH_3
---
-
- procedure TASK_1_THROUGH_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TID : RTEMS.ID;
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );
-
- loop
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- if TIME.SECOND >= 35 then
- TEXT_IO.PUT_LINE( "*** END OF CLOCK TICK TEST ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
- end if;
-
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ),
- FALSE
- );
-
- TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- RTEMS.TASK_WAKE_AFTER(
- TEST_SUPPORT.TASK_NUMBER( TID ) * 5 *
- TEST_SUPPORT.TICKS_PER_SECOND,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- end loop;
-
- end TASK_1_THROUGH_3;
-
-end SPTEST;
diff --git a/c/src/ada-tests/samples/ticker/sptest.ads b/c/src/ada-tests/samples/ticker/sptest.ads
deleted file mode 100644
index e03ccd0e64..0000000000
--- a/c/src/ada-tests/samples/ticker/sptest.ads
+++ /dev/null
@@ -1,60 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 1 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1_THROUGH_3
---
--- DESCRIPTION:
---
--- This is the body of the RTEMS tasks which constitute this test.
---
-
- procedure TASK_1_THROUGH_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/samples/ticker/ticker.adb b/c/src/ada-tests/samples/ticker/ticker.adb
deleted file mode 100644
index dff51ce83b..0000000000
--- a/c/src/ada-tests/samples/ticker/ticker.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test Ticker of the Sample Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure Ticker is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end Ticker;
-
diff --git a/c/src/ada-tests/samples/ticker/ticker.scn b/c/src/ada-tests/samples/ticker/ticker.scn
deleted file mode 100644
index b95fee033f..0000000000
--- a/c/src/ada-tests/samples/ticker/ticker.scn
+++ /dev/null
@@ -1,16 +0,0 @@
-*** CLOCK TICK TEST ***
-TA1 - clock_get - 9: 0: 0 12/31/1988
-TA2 - clock_get - 9: 0: 0 12/31/1988
-TA3 - clock_get - 9: 0: 0 12/31/1988
-TA1 - clock_get - 9: 0: 5 12/31/1988
-TA2 - clock_get - 9: 0:10 12/31/1988
-TA1 - clock_get - 9: 0:10 12/31/1988
-TA1 - clock_get - 9: 0:15 12/31/1988
-TA3 - clock_get - 9: 0:15 12/31/1988
-TA2 - clock_get - 9: 0:20 12/31/1988
-TA1 - clock_get - 9: 0:20 12/31/1988
-TA1 - clock_get - 9: 0:25 12/31/1988
-TA2 - clock_get - 9: 0:30 12/31/1988
-TA1 - clock_get - 9: 0:30 12/31/1988
-TA3 - clock_get - 9: 0:30 12/31/1988
-*** END OF CLOCK TICK TEST ***
diff --git a/c/src/ada-tests/sptests/sp01/config.h b/c/src/ada-tests/sptests/sp01/config.h
deleted file mode 100644
index bfb614cd4e..0000000000
--- a/c/src/ada-tests/sptests/sp01/config.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp01/sp01.adb b/c/src/ada-tests/sptests/sp01/sp01.adb
deleted file mode 100644
index c1264df6f3..0000000000
--- a/c/src/ada-tests/sptests/sp01/sp01.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP01 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP01 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP01;
-
diff --git a/c/src/ada-tests/sptests/sp01/sp01.scn b/c/src/ada-tests/sptests/sp01/sp01.scn
deleted file mode 100644
index dac3add1f2..0000000000
--- a/c/src/ada-tests/sptests/sp01/sp01.scn
+++ /dev/null
@@ -1,16 +0,0 @@
-*** TEST 1 ***
-TA1 - clock_get - 9: 0: 0 12/31/1988
-TA2 - clock_get - 9: 0: 0 12/31/1988
-TA3 - clock_get - 9: 0: 0 12/31/1988
-TA1 - clock_get - 9: 0: 5 12/31/1988
-TA2 - clock_get - 9: 0:10 12/31/1988
-TA1 - clock_get - 9: 0:10 12/31/1988
-TA3 - clock_get - 9: 0:15 12/31/1988
-TA1 - clock_get - 9: 0:15 12/31/1988
-TA2 - clock_get - 9: 0:20 12/31/1988
-TA1 - clock_get - 9: 0:20 12/31/1988
-TA1 - clock_get - 9: 0:25 12/31/1988
-TA3 - clock_get - 9: 0:30 12/31/1988
-TA1 - clock_get - 9: 0:30 12/31/1988
-TA2 - clock_get - 9: 0:30 12/31/1988
-*** END OF TEST 1 ***
diff --git a/c/src/ada-tests/sptests/sp01/sptest.adb b/c/src/ada-tests/sptests/sp01/sptest.adb
deleted file mode 100644
index e74a80c0cf..0000000000
--- a/c/src/ada-tests/sptests/sp01/sptest.adb
+++ /dev/null
@@ -1,162 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 1 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 1 ***" );
-
- TIME := ( 1988, 12, 31, 9, 0, 0, 0 );
-
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.INTERRUPT_LEVEL( 31 ),
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 3 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1_THROUGH_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_1_THROUGH_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 3 ),
- SPTEST.TASK_1_THROUGH_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1_THROUGH_3
---
-
- procedure TASK_1_THROUGH_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TID : RTEMS.ID;
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );
-
- loop
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- if TIME.SECOND >= 35 then
- TEXT_IO.PUT_LINE( "*** END OF TEST 1 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
- end if;
-
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ),
- FALSE
- );
-
- TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- RTEMS.TASK_WAKE_AFTER(
- TEST_SUPPORT.TASK_NUMBER( TID ) * 5 *
- TEST_SUPPORT.TICKS_PER_SECOND,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- end loop;
-
- end TASK_1_THROUGH_3;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp01/sptest.ads b/c/src/ada-tests/sptests/sp01/sptest.ads
deleted file mode 100644
index e03ccd0e64..0000000000
--- a/c/src/ada-tests/sptests/sp01/sptest.ads
+++ /dev/null
@@ -1,60 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 1 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1_THROUGH_3
---
--- DESCRIPTION:
---
--- This is the body of the RTEMS tasks which constitute this test.
---
-
- procedure TASK_1_THROUGH_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp02/config.h b/c/src/ada-tests/sptests/sp02/config.h
deleted file mode 100644
index bfb614cd4e..0000000000
--- a/c/src/ada-tests/sptests/sp02/config.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp02/sp02.adb b/c/src/ada-tests/sptests/sp02/sp02.adb
deleted file mode 100644
index e7c9631161..0000000000
--- a/c/src/ada-tests/sptests/sp02/sp02.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP02 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP02 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP02;
-
diff --git a/c/src/ada-tests/sptests/sp02/sp02.scn b/c/src/ada-tests/sptests/sp02/sp02.scn
deleted file mode 100644
index 9db0bc4100..0000000000
--- a/c/src/ada-tests/sptests/sp02/sp02.scn
+++ /dev/null
@@ -1,15 +0,0 @@
-*** TEST 2 ***
-INIT - task_wake_after - yielding processor
-PREEMPT - task_delete - deleting self
-INIT - suspending TA2 while middle task on a ready chain
-TA1 - task_wake_after - sleep 1 second
-TA2 - task_wake_after - sleep 1 minute
-TA3 - task_wake_after - sleep 5 seconds
-TA1 - task_ident - tid of TA2 (16#10007#)
-TA1 - task_ident - tid of TA3 (16#10008#)
-TA1 - task_set_priority - set TA3's priority to 2
-TA1 - task_suspend - suspend TA2
-TA1 - task_delete - delete TA2
-TA1 - task_wake_after - sleep for 5 seconds
-TA3 - task_delete - delete self
-*** END OF TEST 2 ***
diff --git a/c/src/ada-tests/sptests/sp02/sptest.adb b/c/src/ada-tests/sptests/sp02/sptest.adb
deleted file mode 100644
index dd2b9172ac..0000000000
--- a/c/src/ada-tests/sptests/sp02/sptest.adb
+++ /dev/null
@@ -1,331 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 2 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 2 ***" );
-
- SPTEST.PREEMPT_TASK_NAME := RTEMS.BUILD_NAME( 'P', 'R', 'M', 'T' );
-
- RTEMS.TASK_CREATE(
- SPTEST.PREEMPT_TASK_NAME,
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.PREEMPT_TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF PREEMPT" );
-
- RTEMS.TASK_START(
- SPTEST.PREEMPT_TASK_ID,
- SPTEST.PREEMPT_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF PREEMPT" );
-
- TEXT_IO.PUT_LINE( "INIT - task_wake_after - yielding processor" );
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 3,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 3,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 3 ),
- 3,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 3 ),
- SPTEST.TASK_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" );
-
- TEXT_IO.PUT_LINE(
- "INIT - suspending TA2 while middle task on a ready chain"
- );
-
- RTEMS.TASK_SUSPEND( SPTEST.TASK_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" );
-
- RTEMS.TASK_DELETE( SPTEST.TASK_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA1" );
-
- RTEMS.TASK_DELETE( SPTEST.TASK_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" );
-
- RTEMS.TASK_DELETE( SPTEST.TASK_ID( 3 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 3,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 3 ),
- 3,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 3 ),
- SPTEST.TASK_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- PREEMPT_TASK
---
-
- procedure PREEMPT_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "PREEMPT - task_delete - deleting self" );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF PREEMPT" );
-
- end PREEMPT_TASK;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TID2 : RTEMS.ID;
- TID3 : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- PREVIOUS_PRIORITY : RTEMS.TASK_PRIORITY;
- begin
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 1 second" );
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- RTEMS.TASK_IDENT(
- SPTEST.TASK_NAME( 2 ),
- RTEMS.SEARCH_ALL_NODES,
- TID2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA2" );
-
- TEXT_IO.PUT( "TA1 - task_ident - tid of TA2 (" );
- UNSIGNED32_IO.PUT( TID2, WIDTH => 8, BASE => 10#16# );
- TEXT_IO.PUT_LINE( ")" );
-
- RTEMS.TASK_IDENT(
- SPTEST.TASK_NAME( 3 ),
- RTEMS.SEARCH_ALL_NODES,
- TID3,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA3" );
-
- TEXT_IO.PUT( "TA1 - task_ident - tid of TA3 (" );
- UNSIGNED32_IO.PUT( TID3, WIDTH => 8, BASE => 10#16# );
- TEXT_IO.PUT_LINE( ")" );
-
- RTEMS.TASK_SET_PRIORITY( TID3, 2, PREVIOUS_PRIORITY, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - task_set_priority - set TA3's priority to 2"
- );
-
- TEXT_IO.PUT_LINE( "TA1 - task_suspend - suspend TA2" );
- RTEMS.TASK_SUSPEND( TID2, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA2" );
- RTEMS.TASK_DELETE( TID2, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep for 5 seconds" );
- RTEMS.TASK_WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 2 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "TA2 - task_wake_after - sleep 1 minute" );
- RTEMS.TASK_WAKE_AFTER( 60 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER IN TA2" );
-
- end TASK_2;
-
---PAGE
---
--- TASK_3
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "TA3 - task_wake_after - sleep 5 seconds" );
- RTEMS.TASK_WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER IN TA3" );
-
- TEXT_IO.PUT_LINE( "TA3 - task_delete - delete self" );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" );
-
- end TASK_3;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp02/sptest.ads b/c/src/ada-tests/sptests/sp02/sptest.ads
deleted file mode 100644
index 2d5141f540..0000000000
--- a/c/src/ada-tests/sptests/sp02/sptest.ads
+++ /dev/null
@@ -1,99 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 2 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
- PREEMPT_TASK_ID : RTEMS.ID;
- PREEMPT_TASK_NAME : RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- PREEMPT_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task tests the basic preemption capability.
---
-
- procedure PREEMPT_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests some of the capabilities of the Task Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task tests some of the capabilities of the Task Manager.
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_3
---
--- DESCRIPTION:
---
--- This RTEMS task tests some of the capabilities of the Task Manager.
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp03/config.h b/c/src/ada-tests/sptests/sp03/config.h
deleted file mode 100644
index bfb614cd4e..0000000000
--- a/c/src/ada-tests/sptests/sp03/config.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp03/sp03.adb b/c/src/ada-tests/sptests/sp03/sp03.adb
deleted file mode 100644
index 5455671942..0000000000
--- a/c/src/ada-tests/sptests/sp03/sp03.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP03 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP03 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP03;
-
diff --git a/c/src/ada-tests/sptests/sp03/sp03.scn b/c/src/ada-tests/sptests/sp03/sp03.scn
deleted file mode 100644
index a13d9ae2e6..0000000000
--- a/c/src/ada-tests/sptests/sp03/sp03.scn
+++ /dev/null
@@ -1,26 +0,0 @@
-*** TEST 3 ***
-TA1 sets clock: 9:15: 0 12/31/1988
-TA1 going to sleep: 9:15: 0 12/31/1988
-TA2 9:15: 1 12/31/1988
-TA2 9:15: 2 12/31/1988
-TA2 9:15: 3 12/31/1988
-TA2 9:15: 4 12/31/1988
-TA1 awakened: 9:15: 5 12/31/1988
-TA1 going to sleep: 9:15: 5 12/31/1988
-TA2 9:15: 5 12/31/1988
-TA2 9:15: 6 12/31/1988
-TA2 9:15: 7 12/31/1988
-TA2 9:15: 8 12/31/1988
-TA2 9:15: 9 12/31/1988
-TA1 awakened: 9:15:10 12/31/1988
-TA1 going to sleep: 9:15:10 12/31/1988
-TA2 9:15:10 12/31/1988
-TA2 9:15:11 12/31/1988
-TA2 9:15:12 12/31/1988
-TA2 9:15:13 12/31/1988
-TA2 9:15:14 12/31/1988
-TA1 awakened: 9:15:15 12/31/1988
-TA1 going to sleep: 9:15:15 12/31/1988
-TA2 9:15:15 12/31/1988
-TA2 9:15:16 12/31/1988
-*** END OF TEST 3 ***
diff --git a/c/src/ada-tests/sptests/sp03/sptest.adb b/c/src/ada-tests/sptests/sp03/sptest.adb
deleted file mode 100644
index 789740f0c3..0000000000
--- a/c/src/ada-tests/sptests/sp03/sptest.adb
+++ /dev/null
@@ -1,173 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 3 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 3 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TIME := ( 1988, 12, 31, 9, 15, 0, 0 );
-
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" );
-
- TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( 1 ), FALSE );
- TEST_SUPPORT.PRINT_TIME( "sets clock: ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- loop
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( 1 ), FALSE );
- TEST_SUPPORT.PRINT_TIME( "going to sleep: ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- TIME.SECOND := TIME.SECOND + 5;
- TIME.MINUTE := TIME.MINUTE + (TIME.SECOND / 60 );
- TIME.SECOND := TIME.SECOND mod 60;
- TIME.HOUR := TIME.HOUR + (TIME.MINUTE / 60 );
- TIME.MINUTE := TIME.MINUTE mod 60;
- TIME.HOUR := TIME.HOUR mod 24;
-
- RTEMS.TASK_WAKE_WHEN( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_WHEN" );
-
- TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( 1 ), FALSE );
- TEST_SUPPORT.PRINT_TIME( "awakened: ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- end loop;
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- loop
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- if TIME.SECOND >= 17 then
- TEXT_IO.PUT_LINE( "*** END OF TEST 3 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
- end if;
-
- TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( 2 ), FALSE );
- TEST_SUPPORT.PRINT_TIME( " ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- end loop;
-
- end TASK_2;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp03/sptest.ads b/c/src/ada-tests/sptests/sp03/sptest.ads
deleted file mode 100644
index fda2add5e2..0000000000
--- a/c/src/ada-tests/sptests/sp03/sptest.ads
+++ /dev/null
@@ -1,74 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 3 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests the TASK_WAKE_WHEN directive of
--- the Task Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests the TASK_WAKE_AFTER directive of
--- the Task Manager.
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp04/README b/c/src/ada-tests/sptests/sp04/README
deleted file mode 100644
index 6928aaea49..0000000000
--- a/c/src/ada-tests/sptests/sp04/README
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-
-This test is broken as it is currently implemented. It is illegal for
-a task to do Ada IO during a extension since the Ada run-time uses
-locks to safeguard data structures. Dispatching is disabled and the
-call to Text_IO in the Switch extension will lock the system up.
-
-The proper solution is to have the Switch extension lock task and
-time when it a switch occurs and have a single task print this
-information as necessary.
-
diff --git a/c/src/ada-tests/sptests/sp04/config.h b/c/src/ada-tests/sptests/sp04/config.h
deleted file mode 100644
index 8a9352ccc9..0000000000
--- a/c/src/ada-tests/sptests/sp04/config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp04/sp04.adb b/c/src/ada-tests/sptests/sp04/sp04.adb
deleted file mode 100644
index 511ccb36a5..0000000000
--- a/c/src/ada-tests/sptests/sp04/sp04.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP04 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP04 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP04;
-
diff --git a/c/src/ada-tests/sptests/sp04/sp04.scn b/c/src/ada-tests/sptests/sp04/sp04.scn
deleted file mode 100644
index dc075e2b94..0000000000
--- a/c/src/ada-tests/sptests/sp04/sp04.scn
+++ /dev/null
@@ -1,23 +0,0 @@
-*** TEST 4 ***
-TA1 - 9:15: 0 12/31/1988
-TA1 - task_suspend - on Task 2
-TA1 - task_suspend - on Task 3
-TA1 - killing time
-TA1 - task_resume - on Task 2
-TA1 - task_resume - on Task 3
-TA2 - 9:15: 4 12/31/1988
-TA3 - 9:15: 5 12/31/1988
-TA1 - 9:15: 6 12/31/1988
-TA2 - 9:15: 7 12/31/1988
-TA3 - 9:15: 8 12/31/1988
-TA1 - 9:15: 9 12/31/1988
-TA1 - task_mode - change mode to NO PREEMPT
-TA1 - 9:15:10 12/31/1988
-TA1 - 9:15:11 12/31/1988
-TA1 - 9:15:12 12/31/1988
-TA1 - 9:15:13 12/31/1988
-TA1 - 9:15:14 12/31/1988
-TA1 - 9:15:15 12/31/1988
-TA1 - task_mode - change mode to PREEMPT
-TA2 - 9:15:16 12/31/1988
-*** END OF TEST 4 ***
diff --git a/c/src/ada-tests/sptests/sp04/sptest.adb b/c/src/ada-tests/sptests/sp04/sptest.adb
deleted file mode 100644
index 8056f9225e..0000000000
--- a/c/src/ada-tests/sptests/sp04/sptest.adb
+++ /dev/null
@@ -1,317 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 4 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 4 ***" );
-
- TIME := ( 1988, 12, 31, 9, 15, 0, 0 );
-
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" );
-
- SPTEST.EXTENSION_NAME( 1 ) := RTEMS.BUILD_NAME( 'E', 'X', 'T', ' ' );
-
- RTEMS.EXTENSION_CREATE(
- SPTEST.EXTENSION_NAME( 1 ),
- SPTEST.EXTENSIONS'ACCESS,
- EXTENSION_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EXTENSION_CREATE" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
-
- SPTEST.RUN_COUNT( 1 ) := 0;
- SPTEST.RUN_COUNT( 2 ) := 0;
- SPTEST.RUN_COUNT( 3 ) := 0;
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 1,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 3 ),
- 1,
- 2048,
- RTEMS.TIMESLICE,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 3 ),
- SPTEST.TASK_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- SECONDS : RTEMS.UNSIGNED32;
- OLD_SECONDS : RTEMS.UNSIGNED32;
- STARTED_DELAY : RTEMS.UNSIGNED32;
- PREVIOUS_MODE : RTEMS.MODE;
- TIME : RTEMS.TIME_OF_DAY;
- START_TIME : RTEMS.INTERVAL;
- END_TIME : RTEMS.INTERVAL;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "TA1 - task_suspend - on Task 2" );
- RTEMS.TASK_SUSPEND( TASK_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_suspend - on Task 3" );
- RTEMS.TASK_SUSPEND( TASK_ID( 3 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA3" );
-
- TEXT_IO.PUT_LINE( "TA1 - killing time" );
-
- RTEMS.CLOCK_GET(
- RTEMS.CLOCK_GET_SECONDS_SINCE_EPOCH,
- START_TIME'ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- loop
- RTEMS.CLOCK_GET(
- RTEMS.CLOCK_GET_SECONDS_SINCE_EPOCH,
- END_TIME'ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- exit when END_TIME > (START_TIME + 2);
- end loop;
-
- TEXT_IO.PUT_LINE( "TA1 - task_resume - on Task 2" );
- RTEMS.TASK_RESUME( TASK_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA2" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_resume - on Task 3" );
- RTEMS.TASK_RESUME( TASK_ID( 3 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA3" );
-
- loop
-
- if SPTEST.RUN_COUNT( 1 ) = 3 then
-
- TEXT_IO.PUT_LINE(
- "TA1 - task_mode - change mode to NO PREEMPT"
- );
- RTEMS.TASK_MODE(
- RTEMS.NO_PREEMPT,
- RTEMS.PREEMPT_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- OLD_SECONDS := TIME.SECOND;
-
- SECONDS := 0;
- loop
-
- exit when SECONDS >= 6;
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- if TIME.SECOND /= OLD_SECONDS then
- OLD_SECONDS := TIME.SECOND;
- SECONDS := SECONDS + 1;
- TEST_SUPPORT.PRINT_TIME( "TA1 - ", TIME, "" );
- TEXT_IO.NEW_LINE;
- end if;
-
- end loop;
-
- TEXT_IO.PUT_LINE(
- "TA1 - task_mode - change mode to PREEMPT"
- );
-
- RTEMS.TASK_MODE(
- RTEMS.PREEMPT,
- RTEMS.PREEMPT_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
-
-<<LOOP_LABEL>>
- goto LOOP_LABEL;
-
- end if;
-
- end loop;
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- begin
-
-<<LOOP_LABEL>>
- goto LOOP_LABEL;
-
- end TASK_2;
-
---PAGE
---
--- TASK_3
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- begin
-
-<<LOOP_LABEL>>
- goto LOOP_LABEL;
-
- end TASK_3;
-
---PAGE
---
--- TASK_SWITCH
---
-
- procedure TASK_SWITCH (
- UNUSED : in RTEMS.TCB_POINTER;
- HEIR : in RTEMS.TCB_POINTER
- ) is
- INDEX : RTEMS.UNSIGNED32;
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- function TCB_To_ID (
- TCB : RTEMS.TCB_POINTER
- ) return RTEMS.ID;
- pragma Import (C, TCB_To_ID, "tcb_to_id" );
-
- begin
-
- --INDEX := TEST_SUPPORT.TASK_NUMBER( HEIR.OBJECT.ID );
- INDEX := TCB_To_ID( HEIR );
-
- case INDEX is
- when 1 | 2 | 3 =>
- SPTEST.RUN_COUNT( INDEX ) := SPTEST.RUN_COUNT( INDEX ) + 1;
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( INDEX ), FALSE );
- TEST_SUPPORT.PRINT_TIME( "- ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- if TIME.SECOND >= 16 then
- TEXT_IO.PUT_LINE( "*** END OF TEST 4 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
- end if;
-
- when others =>
- NULL;
- end case;
-
- end TASK_SWITCH;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp04/sptest.ads b/c/src/ada-tests/sptests/sp04/sptest.ads
deleted file mode 100644
index ce3237bedd..0000000000
--- a/c/src/ada-tests/sptests/sp04/sptest.ads
+++ /dev/null
@@ -1,133 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 4 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS extensions created
--- by this test.
---
-
- EXTENSION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- EXTENSION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- This array contains the number of times each of the test tasks has
--- been context switched TO.
---
-
- RUN_COUNT : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests some of the capabilities of the Task Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task is used as a background task to suspend, resume,
--- and context switch to.
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_3
---
--- DESCRIPTION:
---
--- This RTEMS task is used as a background task to suspend, resume,
--- and context switch to.
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_SWITCH
---
--- DESCRIPTION:
---
--- This subprogram is the TASK_SWITCH extension for this test.
--- It is invoked at each context switch and counts the number
--- of times each application task has been context switched to.
---
-
- procedure TASK_SWITCH (
- UNUSED : in RTEMS.TCB_POINTER;
- HEIR : in RTEMS.TCB_POINTER
- );
-
---
--- This is the User Extension Table for this test.
---
-
- EXTENSIONS : aliased RTEMS.EXTENSIONS_TABLE :=
- (
- NULL, -- Task create
- NULL, -- Task start
- NULL, -- Task restart
- NULL, -- Task delete
- SPTEST.TASK_SWITCH'ACCESS, -- Task switch
- NULL, -- Task post switch
- NULL, -- Task begin
- NULL, -- Task exitted
- NULL -- Fatal error
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp05/config.h b/c/src/ada-tests/sptests/sp05/config.h
deleted file mode 100644
index 7fc8c7580e..0000000000
--- a/c/src/ada-tests/sptests/sp05/config.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp05/sp05.adb b/c/src/ada-tests/sptests/sp05/sp05.adb
deleted file mode 100644
index bd6407a0c7..0000000000
--- a/c/src/ada-tests/sptests/sp05/sp05.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP05 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP05 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP05;
-
diff --git a/c/src/ada-tests/sptests/sp05/sp05.scn b/c/src/ada-tests/sptests/sp05/sp05.scn
deleted file mode 100644
index 59c30a0b97..0000000000
--- a/c/src/ada-tests/sptests/sp05/sp05.scn
+++ /dev/null
@@ -1,48 +0,0 @@
-*** TEST 5 ***
-TA1 - task_wake_after - sleep 5 seconds
-TA2 - task_suspend - suspend self
-TA3 - task_suspend - suspend self
-TA1 - task_suspend - suspend TA3
-TA1 - task_resume - resume TA2
-TA1 - task_wake_after - sleep 5 seconds
-TA2 - task_wake_after - sleep 1 second
-TA2 - task_wake_after - sleep 1 second
-TA2 - task_wake_after - sleep 1 second
-TA2 - task_wake_after - sleep 1 second
-TA2 - task_wake_after - sleep 1 second
-TA1 - task_suspend - suspend TA2
-TA1 - task_resume - resume TA3
-TA1 - task_wake_after - sleep 5 seconds
-TA3 - task_wake_after - sleep 1 second
-TA3 - task_wake_after - sleep 1 second
-TA3 - task_wake_after - sleep 1 second
-TA3 - task_wake_after - sleep 1 second
-TA3 - task_wake_after - sleep 1 second
-TA1 - task_suspend - suspend TA3
-TA1 - task_resume - resume TA2
-TA1 - task_wake_after - sleep 5 seconds
-TA2 - task_wake_after - sleep 1 second
-TA2 - task_wake_after - sleep 1 second
-TA2 - task_wake_after - sleep 1 second
-TA2 - task_wake_after - sleep 1 second
-TA2 - task_wake_after - sleep 1 second
-TA1 - task_suspend - suspend TA2
-TA1 - task_resume - resume TA3
-TA1 - task_wake_after - sleep 5 seconds
-TA3 - task_wake_after - sleep 1 second
-TA3 - task_wake_after - sleep 1 second
-TA3 - task_wake_after - sleep 1 second
-TA3 - task_wake_after - sleep 1 second
-TA3 - task_wake_after - sleep 1 second
-TA1 - task_suspend - suspend TA3
-TA1 - task_resume - resume TA2
-TA1 - task_wake_after - sleep 5 seconds
-TA2 - task_wake_after - sleep 1 second
-TA2 - task_wake_after - sleep 1 second
-TA2 - task_wake_after - sleep 1 second
-TA2 - task_wake_after - sleep 1 second
-TA2 - task_wake_after - sleep 1 second
-TA1 - task_suspend - suspend TA2
-TA1 - task_resume - resume TA3
-*** END OF TEST 5 ***
-
diff --git a/c/src/ada-tests/sptests/sp05/sptest.adb b/c/src/ada-tests/sptests/sp05/sptest.adb
deleted file mode 100644
index 22d64fa54f..0000000000
--- a/c/src/ada-tests/sptests/sp05/sptest.adb
+++ /dev/null
@@ -1,229 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 5 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 5 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 3 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 3 ),
- SPTEST.TASK_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TID2 : RTEMS.ID;
- TID3 : RTEMS.ID;
- PASS : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_IDENT(
- SPTEST.TASK_NAME( 2 ),
- 1,
- TID2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA2" );
-
- RTEMS.TASK_IDENT(
- SPTEST.TASK_NAME( 3 ),
- 1,
- TID3,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA3" );
-
- for PASS in 1 .. 3
- loop
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" );
- RTEMS.TASK_WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER OF TA1" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_suspend - suspend TA3" );
- RTEMS.TASK_SUSPEND( TID3, STATUS );
- if PASS = 1 then
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.ALREADY_SUSPENDED,
- "TASK_SUSPEND OF TA3"
- );
- else
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA3" );
- end if;
-
- TEXT_IO.PUT_LINE( "TA1 - task_resume - resume TA2" );
- RTEMS.TASK_RESUME( TID2, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA2" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" );
- RTEMS.TASK_WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_suspend - suspend TA2" );
- RTEMS.TASK_SUSPEND( TID2, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_resume - resume TA3" );
- RTEMS.TASK_RESUME( TID3, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA3" );
-
- end loop;
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 5 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "TA2 - task_suspend - suspend self" );
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" );
-
- loop
- TEXT_IO.PUT_LINE( "TA2 - task_wake_after - sleep 1 second" );
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER OF TA2" );
- end loop;
-
- end TASK_2;
-
---PAGE
---
--- TASK_3
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "TA3 - task_suspend - suspend self" );
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA3" );
-
- loop
- TEXT_IO.PUT_LINE( "TA3 - task_wake_after - sleep 1 second" );
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER OF TA3" );
- end loop;
-
- end TASK_3;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp05/sptest.ads b/c/src/ada-tests/sptests/sp05/sptest.ads
deleted file mode 100644
index 74b2e956bc..0000000000
--- a/c/src/ada-tests/sptests/sp05/sptest.ads
+++ /dev/null
@@ -1,84 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 5 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests some of the capabilities of the Task Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task tests some of the capabilities of the Task Manager.
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_3
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Message Queue Manager.
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp06/config.h b/c/src/ada-tests/sptests/sp06/config.h
deleted file mode 100644
index 7fc8c7580e..0000000000
--- a/c/src/ada-tests/sptests/sp06/config.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp06/sp06.adb b/c/src/ada-tests/sptests/sp06/sp06.adb
deleted file mode 100644
index 8cd49904d7..0000000000
--- a/c/src/ada-tests/sptests/sp06/sp06.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP06 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP06 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP06;
-
diff --git a/c/src/ada-tests/sptests/sp06/sp06.scn b/c/src/ada-tests/sptests/sp06/sp06.scn
deleted file mode 100644
index 8dc6c6afae..0000000000
--- a/c/src/ada-tests/sptests/sp06/sp06.scn
+++ /dev/null
@@ -1,38 +0,0 @@
-*** TEST 6 ***
-TA1 - is beginning to run
-TA1 - restarting TA3
-TA2 - is beginning to run
-TA2 - task_wake_after - sleep 1/2 second
-TA2 - task_wake_after - sleep 1/2 second
-TA1 - task_restart - restarting TA2
-TA2 - is beginning to run
-TA2 - task_wake_after - sleep 1/2 second
-TA2 - task_wake_after - sleep 1/2 second
-TA1 - task_restart - restarting self
-TA2 - task_wake_after - sleep 1/2 second
-TA1 - is beginning to run
-TA2 - task_wake_after - sleep 1/2 second
-TA1 - task_restart - restarting TA2
-TA2 - is beginning to run
-TA2 - task_wake_after - sleep 1/2 second
-TA2 - task_wake_after - sleep 1/2 second
-TA1 - task_restart - restarting self
-TA2 - task_wake_after - sleep 1/2 second
-TA1 - is beginning to run
-TA2 - task_wake_after - sleep 1/2 second
-TA1 - task_restart - restarting TA2
-TA2 - is beginning to run
-TA2 - task_wake_after - sleep 1/2 second
-TA2 - task_wake_after - sleep 1/2 second
-TA1 - task_restart - restarting self
-TA2 - task_wake_after - sleep 1/2 second
-TA1 - is beginning to run
-TA2 - task_wake_after - sleep 1/2 second
-TA1 - task_restart - restarting TA2
-TA2 - is beginning to run
-TA2 - task_wake_after - sleep 1/2 second
-TA2 - task_wake_after - sleep 1/2 second
-TA1 - task_restart - restarting self
-TA2 - task_wake_after - sleep 1/2 second
-TA1 - is beginning to run
-*** END OF TEST 6 ***
diff --git a/c/src/ada-tests/sptests/sp06/sptest.adb b/c/src/ada-tests/sptests/sp06/sptest.adb
deleted file mode 100644
index db068639c0..0000000000
--- a/c/src/ada-tests/sptests/sp06/sptest.adb
+++ /dev/null
@@ -1,222 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 6 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- PREVIOUS_PRIORITY : RTEMS.TASK_PRIORITY;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 6 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
-
- SPTEST.ARGUMENT := 0;
- SPTEST.RESTART_ARGUMENT := 1;
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 3 ),
- 10,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_2'ACCESS,
- SPTEST.ARGUMENT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 3 ),
- SPTEST.TASK_3'ACCESS,
- SPTEST.ARGUMENT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" );
-
- RTEMS.TASK_SET_PRIORITY(
- SPTEST.TASK_ID( 3 ),
- 5,
- PREVIOUS_PRIORITY,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY OF TA3" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- PASS : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "TA1 - is beginning to run" );
-
- PASS := ARGUMENT + 1;
-
- if PASS = 5 then
- TEXT_IO.PUT_LINE( "*** END OF TEST 6 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
- end if;
-
- if PASS = 1 then
- TEXT_IO.PUT_LINE( "TA1 - restarting TA3" );
- RTEMS.TASK_RESTART(
- SPTEST.TASK_ID( 3 ),
- SPTEST.RESTART_ARGUMENT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF TA3" );
-
- RTEMS.TASK_WAKE_AFTER( 2 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- end if;
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_restart - restarting TA2" );
- RTEMS.TASK_RESTART(
- SPTEST.TASK_ID( 2 ),
- SPTEST.RESTART_ARGUMENT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF TA2" );
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_restart - restarting self" );
- RTEMS.TASK_RESTART( SPTEST.TASK_ID( 1 ), PASS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF SELF" );
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "TA2 - is beginning to run" );
-
- if ARGUMENT = SPTEST.ARGUMENT then
- RTEMS.TASK_WAKE_AFTER( 2 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
- end if;
-
- loop
-
- TEXT_IO.PUT_LINE( "TA2 - task_wake_after - sleep 1/2 second" );
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND / 2, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- end loop;
-
- end TASK_2;
-
---PAGE
---
--- TASK_3
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end TASK_3;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp06/sptest.ads b/c/src/ada-tests/sptests/sp06/sptest.ads
deleted file mode 100644
index 53d4825ec4..0000000000
--- a/c/src/ada-tests/sptests/sp06/sptest.ads
+++ /dev/null
@@ -1,91 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 6 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- The following are used as arguments to the various RTEMS tasks
--- in this test to indicate when a restart should be performed.
-
- ARGUMENT : RTEMS.UNSIGNED32;
- RESTART_ARGUMENT : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests some of the capabilities of the Task Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task tests some of the capabilities of the Task Manager.
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_3
---
--- DESCRIPTION:
---
--- This RTEMS task tests some of the capabilities of the Task Manager.
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp07/config.h b/c/src/ada-tests/sptests/sp07/config.h
deleted file mode 100644
index 8a9352ccc9..0000000000
--- a/c/src/ada-tests/sptests/sp07/config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp07/sp07.adb b/c/src/ada-tests/sptests/sp07/sp07.adb
deleted file mode 100644
index e86ec72e6d..0000000000
--- a/c/src/ada-tests/sptests/sp07/sp07.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP07 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP07 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP07;
-
diff --git a/c/src/ada-tests/sptests/sp07/sp07.scn b/c/src/ada-tests/sptests/sp07/sp07.scn
deleted file mode 100644
index 3f171037a7..0000000000
--- a/c/src/ada-tests/sptests/sp07/sp07.scn
+++ /dev/null
@@ -1,32 +0,0 @@
-*** TEST 7 ***
-TASKS_CREATE - TA1 - created.
-TASKS_CREATE - TA2 - created.
-TASKS_CREATE - TA3 - created.
-TASKS_CREATE - TA4 - created.
-TASKS_START - TA1 - started.
-TASKS_START - TA2 - started.
-TASKS_START - TA3 - started.
-TASKS_START - TA4 - started.
-TASKS_RESTART - TA3 - restarted.
-INIT - task_set_note - set TA1's NOTEPAD_8 to TA1's initial priority: 4
-INIT - task_set_note - set TA2's NOTEPAD_8 to TA2's initial priority: 4
-<pause>
-TA1 - task_set_priority - get initial priority of self: 4
-TA1 - task_get_note - get NOTEPAD_8 - current priority: 4
-TA1 - task_set_note - set TA2's NOTEPAD_8: 3
-TA1 - task_set_priority - set TA2's priority: 3
-TA2 - task_get_note - get NOTEPAD_8 - current priority: 3
-TA2 - task_set_note - set TA1's NOTEPAD_8: 2
-TA2 - task_set_priority - set TA1's priority: 2
-TA1 - task_get_note - get NOTEPAD_8 - current priority: 2
-TA1 - task_set_note - set TA2's NOTEPAD_8: 1
-TA1 - task_set_priority - set TA2's priority: 1
-TA2 - task_get_note - get NOTEPAD_8 - current priority: 1
-TA2 - task_suspend - suspend TA1
-TA2 - task_set_priority - set priority of TA1 ( blocked )
-TASKS_DELETE - TA2 deleting TA1
-TASKS_DELETE - TA2 deleting TA3
-TASKS_DELETE - TA2 deleting TA2
-TA4 - exitting task
-TASK_EXITTED - user extension invoked correctly
-*** END OF TEST 7 ***
diff --git a/c/src/ada-tests/sptests/sp07/sptest.adb b/c/src/ada-tests/sptests/sp07/sptest.adb
deleted file mode 100644
index 0c46cf1a62..0000000000
--- a/c/src/ada-tests/sptests/sp07/sptest.adb
+++ /dev/null
@@ -1,496 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 7 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body SPTEST is
-
---PAGE
---
--- TCB_To_ID
---
-
- function TCB_To_ID (
- TCB : RTEMS.TCB_POINTER
- ) return RTEMS.ID;
- pragma Import (C, TCB_To_ID, "tcb_to_id" );
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 7 ***" );
-
- SPTEST.EXTENSION_NAME( 1 ) := RTEMS.BUILD_NAME( 'E', 'X', 'T', ' ' );
-
- RTEMS.EXTENSION_CREATE(
- SPTEST.EXTENSION_NAME( 1 ),
- SPTEST.EXTENSIONS'ACCESS,
- EXTENSION_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EXTENSION_CREATE" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
- SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 4,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 4,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 3 ),
- 250,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 4 ),
- 254,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 4 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 3 ),
- SPTEST.TASK_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 4 ),
- SPTEST.TASK_4'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" );
-
- RTEMS.TASK_RESTART( SPTEST.TASK_ID( 3 ), 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF TA3" );
-
- RTEMS.TASK_SET_NOTE( SPTEST.TASK_ID( 1 ), 8, 4, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_NOTE OF TA1" );
- TEXT_IO.PUT( "INIT - task_set_note - set TA1's NOTEPAD_8" );
- TEXT_IO.PUT_LINE( " to TA1's initial priority: 4" );
-
- RTEMS.TASK_SET_NOTE( SPTEST.TASK_ID( 2 ), 8, 4, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_NOTE OF TA2" );
- TEXT_IO.PUT( "INIT - task_set_note - set TA2's NOTEPAD_8" );
- TEXT_IO.PUT_LINE( " to TA2's initial priority: 4" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- THE_PRIORITY : RTEMS.TASK_PRIORITY;
- PREVIOUS_PRIORITY : RTEMS.TASK_PRIORITY;
- begin
-
- TEST_SUPPORT.PAUSE;
-
- RTEMS.TASK_SET_PRIORITY(
- RTEMS.SELF,
- RTEMS.CURRENT_PRIORITY,
- THE_PRIORITY,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
- TEXT_IO.PUT( "TA1 - task_set_priority - ");
- TEXT_IO.PUT( "get initial priority of self: ");
- UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2 );
- TEXT_IO.NEW_LINE;
-
- loop
-
- RTEMS.TASK_GET_NOTE( RTEMS.SELF, 8, THE_PRIORITY, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_GET_NOTE" );
- TEXT_IO.PUT( "TA1 - task_get_note - ");
- TEXT_IO.PUT( "get NOTEPAD_8 - current priority: " );
- UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2 );
- TEXT_IO.NEW_LINE;
-
- THE_PRIORITY := THE_PRIORITY - 1;
-
- if THE_PRIORITY = 0 then
- TEXT_IO.PUT_LINE( "TA1 - task_suspend - suspend TA2" );
- RTEMS.TASK_SUSPEND( SPTEST.TASK_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" );
-
- TEXT_IO.PUT( "TA1 - task_set_priority - ");
- TEXT_IO.PUT_LINE( "set priority of TA2 ( blocked )");
- RTEMS.TASK_SET_PRIORITY(
- SPTEST.TASK_ID( 2 ),
- 5,
- PREVIOUS_PRIORITY,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
-
- RTEMS.TASK_DELETE( SPTEST.TASK_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end if;
-
- TEXT_IO.PUT( "TA1 - task_set_note - set TA2's NOTEPAD_8: " );
- UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2 );
- TEXT_IO.NEW_LINE;
- RTEMS.TASK_SET_NOTE(
- SPTEST.TASK_ID( 2 ),
- 8,
- THE_PRIORITY,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_NOTE" );
-
- TEXT_IO.PUT("TA1 - task_set_priority - set TA2's priority: ");
- UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2 );
- TEXT_IO.NEW_LINE;
- RTEMS.TASK_SET_PRIORITY(
- SPTEST.TASK_ID( 2 ),
- THE_PRIORITY,
- PREVIOUS_PRIORITY,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
-
- end loop;
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- THE_PRIORITY : RTEMS.TASK_PRIORITY;
- PREVIOUS_PRIORITY : RTEMS.TASK_PRIORITY;
- begin
-
- loop
-
- RTEMS.TASK_GET_NOTE( RTEMS.SELF, 8, THE_PRIORITY, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_GET_NOTE" );
- TEXT_IO.PUT( "TA2 - task_get_note - ");
- TEXT_IO.PUT( "get NOTEPAD_8 - current priority: " );
- UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2 );
- TEXT_IO.NEW_LINE;
-
- THE_PRIORITY := THE_PRIORITY - 1;
-
- if THE_PRIORITY = 0 then
- TEXT_IO.PUT_LINE( "TA2 - task_suspend - suspend TA1" );
- RTEMS.TASK_SUSPEND( SPTEST.TASK_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" );
-
- TEXT_IO.PUT( "TA2 - task_set_priority - ");
- TEXT_IO.PUT_LINE( "set priority of TA1 ( blocked )");
- RTEMS.TASK_SET_PRIORITY(
- SPTEST.TASK_ID( 1 ),
- 5,
- PREVIOUS_PRIORITY,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
-
- RTEMS.TASK_DELETE(
- SPTEST.TASK_ID( 1 ),
- STATUS
- ); -- TA1 is blocked
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA1" );
-
- RTEMS.TASK_DELETE(
- SPTEST.TASK_ID( 3 ),
- STATUS
- ); -- TA3 is ready
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- else
-
- TEXT_IO.PUT( "TA2 - task_set_note - set TA1's NOTEPAD_8: " );
- UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2 );
- TEXT_IO.NEW_LINE;
- RTEMS.TASK_SET_NOTE(
- SPTEST.TASK_ID( 1 ),
- 8,
- THE_PRIORITY,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_NOTE" );
-
- TEXT_IO.PUT( "TA2 - task_set_priority - ");
- TEXT_IO.PUT( "set TA1's priority: ");
- UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2);
- TEXT_IO.NEW_LINE;
- RTEMS.TASK_SET_PRIORITY(
- SPTEST.TASK_ID( 1 ),
- THE_PRIORITY,
- PREVIOUS_PRIORITY,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
-
- end if;
-
- end loop;
-
- end TASK_2;
-
---PAGE
---
--- TASK_3
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- loop
-
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- end loop;
-
- end TASK_3;
-
---PAGE
---
--- TASK_4
---
-
- procedure TASK_4 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- begin
-
- TEXT_IO.PUT_LINE( "TA4 - exitting task" );
-
- end TASK_4;
-
---PAGE
---
--- TASK_EXIT_EXTENSION
---
-
- procedure TASK_EXIT_EXTENSION (
- RUNNING_TASK : in RTEMS.TCB_POINTER
- ) is
- begin
-
- if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RUNNING_TASK ) ) > 0 then
- TEXT_IO.PUT_LINE( "TASK_EXITTED - user extension invoked correctly" );
- end if;
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 7 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_EXIT_EXTENSION;
-
---PAGE
---
--- TASK_CREATE_EXTENSION
---
-
- procedure TASK_CREATE_EXTENSION (
- UNUSED : in RTEMS.TCB_POINTER;
- CREATED_TASK : in RTEMS.TCB_POINTER
- ) is
- begin
-
- if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( CREATED_TASK ) ) > 0 then
- TEXT_IO.PUT( "TASKS_CREATE - " );
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME(
- TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( CREATED_TASK ) )
- ),
- FALSE
- );
- TEXT_IO.PUT_LINE( "- created." );
- end if;
-
- end TASK_CREATE_EXTENSION;
-
---PAGE
---
--- TASK_DELETE_EXTENSION
---
-
- procedure TASK_DELETE_EXTENSION (
- RUNNING_TASK : in RTEMS.TCB_POINTER;
- DELETED_TASK : in RTEMS.TCB_POINTER
- ) is
- begin
-
- if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RUNNING_TASK ) ) > 0 then
- TEXT_IO.PUT( "TASKS_DELETE - " );
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME(
- TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RUNNING_TASK ) )
- ),
- FALSE
- );
- end if;
-
- if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( DELETED_TASK ) ) > 0 then
- TEXT_IO.PUT( "deleting " );
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME(
- TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( DELETED_TASK ) )
- ),
- TRUE
- );
- end if;
-
- end TASK_DELETE_EXTENSION;
-
---PAGE
---
--- TASK_RESTART_EXTENSION
---
-
- procedure TASK_RESTART_EXTENSION (
- UNUSED : in RTEMS.TCB_POINTER;
- RESTARTED_TASK : in RTEMS.TCB_POINTER
- ) is
- begin
-
- if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RESTARTED_TASK ) ) > 0 then
- TEXT_IO.PUT( "TASKS_RESTART - " );
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME(
- TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RESTARTED_TASK ) )
- ),
- FALSE
- );
- TEXT_IO.PUT_LINE( " - restarted." );
- end if;
-
- end TASK_RESTART_EXTENSION;
-
---PAGE
---
--- TASK_START_EXTENSION
---
-
- procedure TASK_START_EXTENSION (
- UNUSED : in RTEMS.TCB_POINTER;
- STARTED_TASK : in RTEMS.TCB_POINTER
- ) is
- begin
-
- if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( STARTED_TASK ) ) > 0 then
- TEXT_IO.PUT( "TASKS_START - " );
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME(
- TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( STARTED_TASK ) )
- ),
- FALSE
- );
- TEXT_IO.PUT_LINE( " - started." );
- end if;
-
- end TASK_START_EXTENSION;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp07/sptest.ads b/c/src/ada-tests/sptests/sp07/sptest.ads
deleted file mode 100644
index 2fcfec1888..0000000000
--- a/c/src/ada-tests/sptests/sp07/sptest.ads
+++ /dev/null
@@ -1,186 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 7 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS extensions created
--- by this test.
---
-
- EXTENSION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- EXTENSION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests some of the capabilities of the Task Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task tests some of the capabilities of the Task Manager.
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_3
---
--- DESCRIPTION:
---
--- This RTEMS task tests some of the capabilities of the Task Manager.
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_4
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Message Queue Manager.
---
-
- procedure TASK_4 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_CREATE_EXTENSION
---
--- DESCRIPTION:
---
--- This subprogram is the TASK_CREATE extension for this test.
---
-
- procedure TASK_CREATE_EXTENSION (
- UNUSED : in RTEMS.TCB_POINTER;
- CREATED_TASK : in RTEMS.TCB_POINTER
- );
-
---
--- TASK_DELETE_EXTENSION
---
--- DESCRIPTION:
---
--- This subprogram is the TASK_DELETE extension for this test.
---
-
- procedure TASK_DELETE_EXTENSION (
- RUNNING_TASK : in RTEMS.TCB_POINTER;
- DELETED_TASK : in RTEMS.TCB_POINTER
- );
-
---
--- TASK_RESTART_EXTENSION
---
--- DESCRIPTION:
---
--- This subprogram is the TASK_RESTART extension for this test.
---
-
- procedure TASK_RESTART_EXTENSION (
- UNUSED : in RTEMS.TCB_POINTER;
- RESTARTED_TASK : in RTEMS.TCB_POINTER
- );
-
---
--- TASK_START_EXTENSION
---
--- DESCRIPTION:
---
--- This subprogram is the TASK_START extension for this test.
---
-
- procedure TASK_START_EXTENSION (
- UNUSED : in RTEMS.TCB_POINTER;
- STARTED_TASK : in RTEMS.TCB_POINTER
- );
-
---
--- TASK_EXIT_EXTENSION
---
--- DESCRIPTION:
---
--- This subprogram is the TASK_EXIT extension for this test.
--- It is invoked when a RTEMS task exits from its entry point.
---
-
- procedure TASK_EXIT_EXTENSION (
- RUNNING_TASK : in RTEMS.TCB_POINTER
- );
-
---
--- This is the User Extension Table for this test.
---
-
- EXTENSIONS : aliased RTEMS.EXTENSIONS_TABLE :=
- (
- SPTEST.TASK_CREATE_EXTENSION'ACCESS, -- Task create
- SPTEST.TASK_START_EXTENSION'ACCESS, -- Task start
- SPTEST.TASK_RESTART_EXTENSION'ACCESS, -- Task restart
- SPTEST.TASK_DELETE_EXTENSION'ACCESS, -- Task delete
- NULL, -- Task switch
- NULL, -- Task post switch
- NULL, -- Task begin
- SPTEST.TASK_EXIT_EXTENSION'ACCESS, -- Task exitted
- NULL -- Fatal error
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp08/config.h b/c/src/ada-tests/sptests/sp08/config.h
deleted file mode 100644
index 7fc8c7580e..0000000000
--- a/c/src/ada-tests/sptests/sp08/config.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp08/sp08.adb b/c/src/ada-tests/sptests/sp08/sp08.adb
deleted file mode 100644
index 2f1a587979..0000000000
--- a/c/src/ada-tests/sptests/sp08/sp08.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP08 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP08 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP08;
-
diff --git a/c/src/ada-tests/sptests/sp08/sp08.scn b/c/src/ada-tests/sptests/sp08/sp08.scn
deleted file mode 100644
index bc829b849a..0000000000
--- a/c/src/ada-tests/sptests/sp08/sp08.scn
+++ /dev/null
@@ -1,20 +0,0 @@
-*** TEST 8 ***
-TA1 - task_mode - ASR - previous mode: 16#0#
-TA1 - task_mode - NO_ASR - previous mode: 16#0#
-TA1 - task_mode - NO_ASR - previous mode: 16#400#
-TA1 - task_mode - ASR - previous mode: 16#400#
-TA1 - task_mode - NO_TIMESLICE - previous mode: 16#0#
-TA1 - task_mode - TIMESLICE - previous mode: 16#0#
-TA1 - task_mode - TIMESLICE - previous mode: 16#200#
-TA1 - task_mode - NO_TIMESLICE - previous mode: 16#200#
-TA1 - task_mode - PREEMPT - previous mode: 16#0#
-TA1 - task_mode - NO_PREEMPT - previous mode: 16#0#
-TA1 - task_mode - NO_PREEMPT - previous mode: 16#100#
-TA1 - task_mode - PREEMPT - previous mode: 16#100#
-TA1 - task_mode - INTERRUPT_LEVEL( 3 ) - previous mode: 16#0#
-TA1 - task_mode - INTERRUPT_LEVEL( 5 ) - previous mode: 16#3#
-TA1 - task_mode - set all modes - previous mode: 16#5#
-TA1 - task_mode - set all modes - previous mode: 16#703#
-TA1 - task_mode - clear all modes - previous mode: 16#703#
-TA1 - task_mode - get current mode - previous mode: 16#0#
-*** END OF TEST 8 ***
diff --git a/c/src/ada-tests/sptests/sp08/sptest.adb b/c/src/ada-tests/sptests/sp08/sptest.adb
deleted file mode 100644
index 725849df43..0000000000
--- a/c/src/ada-tests/sptests/sp08/sptest.adb
+++ /dev/null
@@ -1,351 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 8 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 8 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- PUT_MODE
---
-
- procedure PUT_MODE(
- COMMENT : in STRING;
- OUTPUT_MODE : in RTEMS.MODE
- ) is
- begin
-
- TEXT_IO.PUT( COMMENT );
- UNSIGNED32_IO.PUT( OUTPUT_MODE, BASE => 16, WIDTH => 8 );
- TEXT_IO.NEW_LINE;
-
- end PUT_MODE;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- PREVIOUS_MODE : RTEMS.MODE;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
--- BEGINNING OF ASR
-
- RTEMS.TASK_MODE(
- RTEMS.ASR,
- RTEMS.ASR_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - ASR - previous mode: ",
- PREVIOUS_MODE
- );
-
- RTEMS.TASK_MODE(
- RTEMS.NO_ASR,
- RTEMS.ASR_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - NO_ASR - previous mode: ",
- PREVIOUS_MODE
- );
-
- RTEMS.TASK_MODE(
- RTEMS.NO_ASR,
- RTEMS.ASR_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - NO_ASR - previous mode: ",
- PREVIOUS_MODE
- );
-
- RTEMS.TASK_MODE(
- RTEMS.ASR,
- RTEMS.ASR_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - ASR - previous mode: ",
- PREVIOUS_MODE
- );
-
--- END OF ASR
-
--- BEGINNING OF TIMESLICE
-
- RTEMS.TASK_MODE(
- RTEMS.NO_TIMESLICE,
- RTEMS.TIMESLICE_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - NO_TIMESLICE - previous mode: ",
- PREVIOUS_MODE
- );
-
- RTEMS.TASK_MODE(
- RTEMS.TIMESLICE,
- RTEMS.TIMESLICE_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - TIMESLICE - previous mode: ",
- PREVIOUS_MODE
- );
-
- RTEMS.TASK_MODE(
- RTEMS.TIMESLICE,
- RTEMS.TIMESLICE_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - TIMESLICE - previous mode: ",
- PREVIOUS_MODE
- );
-
- RTEMS.TASK_MODE(
- RTEMS.NO_TIMESLICE,
- RTEMS.TIMESLICE_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - NO_TIMESLICE - previous mode: ",
- PREVIOUS_MODE
- );
-
--- END OF TIMESLICE
-
--- BEGINNING OF PREEMPT
-
- RTEMS.TASK_MODE(
- RTEMS.PREEMPT,
- RTEMS.PREEMPT_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - PREEMPT - previous mode: ",
- PREVIOUS_MODE
- );
-
- RTEMS.TASK_MODE(
- RTEMS.NO_PREEMPT,
- RTEMS.PREEMPT_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - NO_PREEMPT - previous mode: ",
- PREVIOUS_MODE
- );
-
- RTEMS.TASK_MODE(
- RTEMS.NO_PREEMPT,
- RTEMS.PREEMPT_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - NO_PREEMPT - previous mode: ",
- PREVIOUS_MODE
- );
-
- RTEMS.TASK_MODE(
- RTEMS.PREEMPT,
- RTEMS.PREEMPT_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - PREEMPT - previous mode: ",
- PREVIOUS_MODE
- );
-
--- END OF PREEMPT
-
--- BEGINNING OF INTERRUPT LEVEL
-
- RTEMS.TASK_MODE(
- RTEMS.INTERRUPT_LEVEL( 3 ),
- RTEMS.INTERRUPT_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - INTERRUPT_LEVEL( 3 ) - previous mode: ",
- PREVIOUS_MODE
- );
-
- RTEMS.TASK_MODE(
- RTEMS.INTERRUPT_LEVEL( 5 ),
- RTEMS.INTERRUPT_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - INTERRUPT_LEVEL( 5 ) - previous mode: ",
- PREVIOUS_MODE
- );
-
--- END OF INTERRUPT LEVEL
-
--- BEGINNING OF COMBINATIONS
-
- RTEMS.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,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - set all modes - previous mode: ",
- PREVIOUS_MODE
- );
-
- 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,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - set all modes - previous mode: ",
- PREVIOUS_MODE
- );
-
- 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,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - clear all modes - previous mode: ",
- PREVIOUS_MODE
- );
-
--- END OF COMBINATIONS
-
--- BEGINNING OF CURRENT MODE
-
- RTEMS.TASK_MODE(
- RTEMS.CURRENT_MODE,
- RTEMS.CURRENT_MODE,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
- SPTEST.PUT_MODE(
- "TA1 - task_mode - get current mode - previous mode: ",
- PREVIOUS_MODE
- );
-
--- END OF CURRENT MODE
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 8 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
- end TASK_1;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp08/sptest.ads b/c/src/ada-tests/sptests/sp08/sptest.ads
deleted file mode 100644
index c9f0327172..0000000000
--- a/c/src/ada-tests/sptests/sp08/sptest.ads
+++ /dev/null
@@ -1,74 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 8 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- PUT_MODE
---
--- DESCRIPTION:
---
--- This subprogram prints the COMMENT and the OUTPUT_MODE followed
--- by a carriage return.
---
-
- procedure PUT_MODE(
- COMMENT : in STRING;
- OUTPUT_MODE : in RTEMS.MODE
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests the TASK_MODE directive of the Task Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp09/config.h b/c/src/ada-tests/sptests/sp09/config.h
deleted file mode 100644
index adf05616b7..0000000000
--- a/c/src/ada-tests/sptests/sp09/config.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-#define CONFIGURE_MAXIMUM_SEMAPHORES 2
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#define CONFIGURE_MAXIMUM_PARTITIONS 1
-#define CONFIGURE_MAXIMUM_REGIONS 1
-#define CONFIGURE_MAXIMUM_PERIODS 1
-#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp09/sp09.adb b/c/src/ada-tests/sptests/sp09/sp09.adb
deleted file mode 100644
index 669b52c1ef..0000000000
--- a/c/src/ada-tests/sptests/sp09/sp09.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP09 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP09 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP09;
-
diff --git a/c/src/ada-tests/sptests/sp09/sp09.scn b/c/src/ada-tests/sptests/sp09/sp09.scn
deleted file mode 100644
index a82582e51f..0000000000
--- a/c/src/ada-tests/sptests/sp09/sp09.scn
+++ /dev/null
@@ -1,250 +0,0 @@
-*** TEST 9 ***
-INIT - task_create - INVALID_SIZE -- NOT CHECKED
-INIT - task_create - INVALID_PRIORITY
-INIT - task_restart - INCORRECT_STATE
-TA1 - task_delete - INVALID_ID
-TA1 - task_get_note - INVALID_NUMBER -- constraint error
-TA1 - task_get_note - INVALID_ID
-TA1 - task_ident - current task SUCCESSFUL
-TA1 - task_ident - global INVALID_NAME
-TA1 - task_ident - local INVALID_NAME
-TA1 - task_ident - INVALID_NODE
-TA1 - task_restart - INVALID_ID
-TA1 - task_resume - INVALID_ID
-TA1 - task_resume - INCORRECT_STATE
-TA1 - task_set_priority - INVALID_PRIORITY -- constraint error
-TA1 - task_set_priority - INVALID_ID
-TA1 - task_set_note - INVALID_NUMBER -- constraint error
-TA1 - task_set_note - INVALID_ID
-TA1 - task_start - INVALID_ID
-TA1 - task_start - INCORRECT_STATE
-TA1 - task_suspend - INVALID_ID
-<pause - screen 2>
-TA1 - clock_get - NOT_DEFINED
-TA1 - task_wake_when - NOT_DEFINED
-TA1 - timer_fire_when - NOT_DEFINED
-TA1 - clock_set - 8:30:45 2/ 5/1987 - INVALID_CLOCK
-TA1 - clock_set - 8:30:45 15/ 5/1988 - INVALID_CLOCK
-TA1 - clock_set - 8:30:45 2/32/1988 - INVALID_CLOCK
-TA1 - clock_set - 25:30:45 2/ 5/1988 - INVALID_CLOCK
-TA1 - clock_set - 8:61:45 2/ 5/1988 - INVALID_CLOCK
-TA1 - clock_set - 8:30:61 2/ 5/1988 - INVALID_CLOCK
-TA1 - clock_set - 8:30:45 2/ 5/1988 - INVALID_CLOCK
-TA1 - clock_set - 8:30:45 2/ 5/1988 - SUCCESSFUL
-TA1 - task_wake_when - TICK INVALID - sleep about 3 seconds
-TA1 - task_wake_when - TICK INVALID - woke up SUCCESSFUL
-TA1 - task_wake_when - 8:30:48 2/ 5/1961 - INVALID_CLOCK
-TA1 - task_wake_when - 25:30:48 2/ 5/1988 - INVALID_CLOCK
-TA1 - current time - 8:30:48 2/ 5/1988
-TA1 - task_wake_when - 8:30:48 1/ 5/1988 - INVALID_CLOCK
-<pause - screen 3>
-TA1 - task_create - INVALID_NAME
-TA1 - task_create - stack size - UNSATISFIED
-TA1 - task_create - TA2 created - SUCCESSFUL
-TA1 - task_suspend - suspend TA2 - SUCCESSFUL
-TA1 - task_suspend - suspend TA2 - ALREADY_SUSPENDED
-TA1 - task_resume - TA2 resumed - SUCCESSFUL
-TA1 - task_create - TA3 created - SUCCESSFUL
-TA1 - task_create - 4 created - SUCCESSFUL
-TA1 - task_create - 5 created - SUCCESSFUL
-TA1 - task_create - 6 created - SUCCESSFUL
-TA1 - task_create - 7 created - SUCCESSFUL
-TA1 - task_create - 8 created - SUCCESSFUL
-TA1 - task_create - 9 created - SUCCESSFUL
-TA1 - task_create - 10 created - SUCCESSFUL
-TA1 - task_create - 11 - TOO_MANY
-TA1 - task_create - MP_NOT_CONFIGURED
-<pause - screen 4>
-TA1 - event_receive - UNSATISFIED ( all conditions )
-TA1 - event_receive - UNSATISFIED ( any conditions )
-TA1 - event_receive - timeout in 3 seconds
-TA1 - event_receive - woke with TIMEOUT
-TA1 - event_send - INVALID_ID
-TA1 - task_wake_after - sleep 1 second - SUCCESSFUL
-TA1 - clock_set - 8:30:45 2/ 5/1988 - SUCCESSFUL
-<pause - screen 5>
-TA1 - semaphore_create - INVALID_NAME
-TA1 - semaphore_create - 1 - SUCCESSFUL
-TA1 - semaphore_create - 2 - SUCCESSFUL
-TA1 - semaphore_create - 3 - TOO_MANY
-TA1 - semaphore_create - NOT_DEFINED
-TA1 - semaphore_create - NOT_DEFINED
-TA1 - semaphore_create - INVALID_NUMBER
-TA1 - semaphore_create - MP_NOT_CONFIGURED
-TA1 - semaphore_delete - unknown INVALID_ID
-TA1 - semaphore_delete - local INVALID_ID
-TA1 - semaphore_ident - global INVALID_NAME
-TA1 - semaphore_ident - local INVALID_NAME
-<pause - screen 6>
-TA1 - semaphore_obtain - INVALID_ID
-TA1 - semaphore_obtain - got sem 1 - SUCCESSFUL
-TA1 - semaphore_obtain - UNSATISFIED
-TA1 - semaphore_obtain - timeout in 3 seconds
-TA1 - semaphore_obtain - woke with TIMEOUT
-TA1 - semaphore_release - NOT_OWNER_OF_RESOURCE
-TA1 - semaphore_release - INVALID_ID
-TA1 - task_start - start TA2 - SUCCESSFUL
-TA1 - task_wake_after - yield processor - SUCCESSFUL
-TA2 - semaphore_obtain - sem 1 - WAIT FOREVER
-TA1 - semaphore_delete - delete sem 1 - SUCCESSFUL
-TA1 - semaphore_obtain - binary semaphore
-TA1 - semaphore_delete - delete sem 2 - RESOURCE_IN_USE
-TA1 - task_wake_after - yield processor - SUCCESSFUL
-TA2 - semaphore_obtain - woke up with OBJECT_WAS_DELETED
-TA2 - task_delete - delete self - SUCCESSFUL
-TA1 - task_delete TA2 - already deleted INVALID_ID
-<pause - screen 7>
-TA1 - message_queue_broadcast - INVALID_ID
-TA1 - message_queue_create - Q 1 - INVALID_NAME
-TA1 - message_queue_create - Q 1 - MP_NOT_CONFIGURED
-TA1 - message_queue_create - Q 1 - 2 DEEP - SUCCESSFUL
-TA1 - message_queue_create - Q 2 - TOO_MANY
-TA1 - message_queue_delete - unknown INVALID_ID
-TA1 - message_queue_delete - local INVALID_ID
-TA1 - message_queue_ident - INVALID_NAME
-TA1 - message_queue_flush - INVALID_ID
-TA1 - message_queue_receive - INVALID_ID
-TA1 - message_queue_receive - Q 1 - UNSATISFIED
-TA1 - message_queue_receive - Q 1 - timeout in 3 seconds
-TA1 - message_queue_receive - Q 1 - woke up with TIMEOUT
-TA1 - message_queue_send - INVALID_ID
-TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL
-TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL
-TA1 - message_queue_send - BUFFER 3 TO Q 1 - TOO_MANY
-<pause - screen 8>
-TA1 - message_queue_delete - Q 1 - SUCCESSFUL
-TA1 - message_queue_create - Q 1 - 2 DEEP - SUCCESSFUL
-TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL
-TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL
-TA1 - message_queue_send - BUFFER 3 TO Q 1 - TOO_MANY
-TA1 - message_queue_delete - Q 1 - SUCCESSFUL
-TA1 - message_queue_create - Q 1 - 3 DEEP - SUCCESSFUL
-TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL
-TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL
-TA1 - message_queue_send - BUFFER 3 TO Q 1 - SUCCESSFUL
-TA1 - message_queue_send - BUFFER 4 TO Q 1 - TOO_MANY
-TA1 - message_queue_delete - Q 1 - SUCCESSFUL
-TA1 - message_queue_create - Q 1 - 3 DEEP - SUCCESSFUL
-TA1 - task_start - start TA3 - SUCCESSFUL
-TA1 - task_wake_after - yield processor - SUCCESSFUL
-TA3 - message_queue_receive - Q 1 - WAIT FOREVER
-TA1 - message_queue_delete - delete Q 1 - SUCCESSFUL
-TA1 - task_wake_after - yield processor - SUCCESSFUL
-TA3 - message_queue_receive - woke up with OBJECT_WAS_DELETED
-TA3 - task_delete - delete self - SUCCESSFUL
-<pause - screen 9>
-TA1 - interrupt_catch - INVALID_NUMBER -- constraint error
-TA1 - interrupt_catch - INVALID_ADDRESS
-TA1 - signal_send - INVALID_ID
-TA1 - signal_send - NOT_DEFINED
-TA1 - port_create - INVALID_NAME
-TA1 - port_create - INVALID_ADDRESS
-TA1 - port_create - TOO_MANY
-TA1 - port_delete - INVALID_ID
-TA1 - port_ident - INVALID_NAME
-TA1 - port_internal_to_external - INVALID_ID
-TA1 - port_external_to_internal - INVALID_ID
-<pause - screen 10>
-TA1 - rate_monotonic_create - INVALID_NAME
-TA1 - rate_monotonic_create - SUCCESSFUL
-TA1 - rate_monotonic_create - TOO_MANY
-TA1 - rate_monotonic_ident - INVALID_NAME
-TA1 - rate_monotonic_period - unknown INVALID_ID
-TA1 - rate_monotonic_period - local INVALID_ID
-TA1 - rate_monotonic_period( STATUS ) - NOT_DEFINED
-TA1 - rate_monotonic_period - 100 ticks - SUCCESSFUL
-TA1 - rate_monotonic_period( STATUS ) - SUCCESSFUL
-TA1 - rate_monotonic_period( STATUS ) - TIMEOUT
-TA1 - rate_monotonic_cancel - unknown INVALID_ID
-TA1 - rate_monotonic_cancel - local INVALID_ID
-TA1 - rate_monotonic_cancel - SUCCESSFUL
-TA1 - rate_monotonic_period - 5 ticks - TIMEOUT
-TA1 - task_wake_after - yielding to TA4
-TA4 - rate_monotonic_cancel - NOT_OWNER_OF_RESOURCE
-TA4 - rate_monotonic_period - NOT_OWNER_OF_RESOURCE
-TA4 - task_delete - delete self - SUCCESSFUL
-TA1 - rate_monotonic_delete - unknown INVALID_ID
-TA1 - rate_monotonic_delete - local INVALID_ID
-TA1 - rate_monotonic_delete - SUCCESSFUL
-<pause - screen 11>
-TA1 - partition_create - INVALID_NAME
-TA1 - partition_create - length - INVALID_SIZE
-TA1 - partition_create - buffer size - INVALID_SIZE
-TA1 - partition_create - length < buffer size - INVALID_SIZE
-TA1 - partition_create - MP_NOT_CONFIGURED
-TA1 - partition_create - INVALID_ADDRESS
-TA1 - partition_create - INVALID_SIZE
-TA1 - partition_delete - unknown INVALID_ID
-TA1 - partition_delete - local INVALID_ID
-TA1 - partition_get_buffer - INVALID_ID
-TA1 - partition_ident - INVALID_NAME
-TA1 - partition_return_buffer - INVALID_ID
-TA1 - partition_create - SUCCESSFUL
-TA1 - partition_create - TOO_MANY
-TA1 - partition_get_buffer - SUCCESSFUL
-TA1 - partition_get_buffer - SUCCESSFUL
-TA1 - partition_get_buffer - UNSATISFIED
-TA1 - partition_delete - RESOURCE_IN_USE
-TA1 - partition_return_buffer - INVALID_ADDRESS - out of range
-TA1 - partition_return_buffer - INVALID_ADDRESS - not on boundary
-<pause - screen 12>
-TA1 - region_create - INVALID_NAME
-TA1 - region_create - INVALID_ADDRESS
-TA1 - region_create - INVALID_SIZE
-TA1 - region_create - SUCCESSFUL
-TA1 - region_create - TOO_MANY
-TA1 - region_delete - unknown INVALID_ID
-TA1 - region_delete - local INVALID_ID
-TA1 - region_ident - INVALID_NAME
-TA1 - region_get_segment - INVALID_ID
-TA1 - region_get_segment - INVALID_SIZE
-TA1 - region_get_segment - SUCCESSFUL
-TA1 - region_get_segment - UNSATISFIED
-TA1 - region_get_segment - timeout in 3 seconds
-TA1 - region_get_segment - woke up with TIMEOUT
-TA1 - region_delete - RESOURCE_IN_USE
-TA1 - region_return_segment - INVALID_ID
-TA1 - region_return_segment - INVALID_ADDRESS
-TA1 - debug_disable - DEBUG_REGION
-TA1 - region_return_segment - INVALID_ADDRESS
-TA1 - region_return_segment - INVALID_ADDRESS
-TA1 - debug_enable - DEBUG_REGION
-TA1 - region_extend - INVALID_ID
-TA1 - region_extend - within heap - INVALID_ADDRESS
-TA1 - region_extend - non-contiguous lower - NOT_IMPLEMENTED
-TA1 - region_extend - contiguous lower - NOT_IMPLEMENTED
-TA1 - region_extend - non-contiguous higher - NOT_IMPLEMENTED
-<pause - screen 13>
-TA1 - io_close - INVALID_NUMBER
-TA1 - io_control - INVALID_NUMBER
-TA1 - io_initialize - INVALID_NUMBER
-TA1 - io_open - INVALID_NUMBER
-TA1 - io_read - INVALID_NUMBER
-TA1 - io_write - INVALID_NUMBER
-TA1 - clock_set - 23:59:59 12/31/2000 - SUCCESSFUL
-TA1 - clock_get - 0: 0: 0 1/ 1/2001 - SUCCESSFUL
-TA1 - clock_set - 23:59:59 12/31/1999 - SUCCESSFUL
-TA1 - clock_get - 0: 0: 0 1/ 1/2000 - SUCCESSFUL
-TA1 - clock_set - 23:59:59 12/31/2100 - SUCCESSFUL
-TA1 - clock_get - 0: 0: 0 1/ 1/2101 - SUCCESSFUL
-TA1 - clock_set - 23:59:59 12/31/2099 - SUCCESSFUL
-TA1 - clock_get - 0: 0: 0 1/ 1/2100 - SUCCESSFUL
-TA1 - clock_set - 23:59:59 12/31/1991 - SUCCESSFUL
-TA1 - clock_get - 0: 0: 0 1/ 1/1992 - SUCCESSFUL
-<pause - screen 14>
-TA1 - timer_create - INVALID_NAME
-TA1 - timer_create - 1 - SUCCESSFUL
-TA1 - timer_create - 2 - TOO_MANY
-TA1 - timer_delete - local INVALID_ID
-TA1 - timer_delete - global INVALID_ID
-TA1 - timer_ident - INVALID_NAME
-TA1 - timer_cancel - INVALID_ID
-TA1 - timer_reset - INVALID_ID
-TA1 - timer_reset - NOT_DEFINED
-TA1 - timer_fire_after - INVALID_ID
-TA1 - timer_fire_when - INVALID_ID
-TA1 - timer_fire_after - INVALID_NUMBER
-TA1 - timer_fire_when - 8:30:45 2/ 5/1987 - INVALID_CLOCK
-TA1 - clock_get - 0: 0: 0 1/ 1/1992
-TA1 - timer_fire_when - 8:30:45 2/ 5/1990 - before INVALID_CLOCK
-*** END OF TEST 9 ***
diff --git a/c/src/ada-tests/sptests/sp09/sptest.adb b/c/src/ada-tests/sptests/sp09/sptest.adb
deleted file mode 100644
index 960b610f77..0000000000
--- a/c/src/ada-tests/sptests/sp09/sptest.adb
+++ /dev/null
@@ -1,3208 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 9 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 9 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
- SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' );
- SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' );
- SPTEST.TASK_NAME( 6 ) := RTEMS.BUILD_NAME( 'T', 'A', '6', ' ' );
- SPTEST.TASK_NAME( 7 ) := RTEMS.BUILD_NAME( 'T', 'A', '7', ' ' );
- SPTEST.TASK_NAME( 8 ) := RTEMS.BUILD_NAME( 'T', 'A', '8', ' ' );
- SPTEST.TASK_NAME( 9 ) := RTEMS.BUILD_NAME( 'T', 'A', '9', ' ' );
- SPTEST.TASK_NAME( 10 ) := RTEMS.BUILD_NAME( 'T', 'A', 'A', ' ' );
-
- SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' );
-
- SPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' );
- SPTEST.SEMAPHORE_NAME( 2 ) := RTEMS.BUILD_NAME( 'S', 'M', '2', ' ' );
- SPTEST.SEMAPHORE_NAME( 3 ) := RTEMS.BUILD_NAME( 'S', 'M', '3', ' ' );
-
- SPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' );
- SPTEST.QUEUE_NAME( 2 ) := RTEMS.BUILD_NAME( 'M', 'Q', '2', ' ' );
-
- SPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'T', '1', ' ' );
-
- SPTEST.REGION_NAME( 1 ) := RTEMS.BUILD_NAME( 'R', 'N', '1', ' ' );
-
- SPTEST.PORT_NAME( 1 ) := RTEMS.BUILD_NAME( 'D', 'P', '1', ' ' );
-
- SPTEST.PERIOD_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' );
-
--- RTEMS.TASK_CREATE(
--- SPTEST.TASK_NAME( 1 ),
--- 4,
--- 10,
--- RTEMS.DEFAULT_MODES,
--- RTEMS.DEFAULT_ATTRIBUTES,
--- SPTEST.TASK_ID( 1 ),
--- STATUS
--- );
--- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
--- STATUS,
--- RTEMS.INVALID_SIZE,
--- "TASK_CREATE WITH ILLEGAL STACK SIZE"
--- );
- TEXT_IO.PUT_LINE( "INIT - task_create - INVALID_SIZE -- NOT CHECKED" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 0,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_PRIORITY,
- "TASK_CREATE WITH ILLEGAL PRIORITY"
- );
- TEXT_IO.PUT_LINE( "INIT - task_create - INVALID_PRIORITY" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_RESTART(
- SPTEST.TASK_ID( 1 ),
- 0,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INCORRECT_STATE,
- "TASK_RESTART OF DORMANT TASK"
- );
- TEXT_IO.PUT_LINE( "INIT - task_restart - INCORRECT_STATE" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- DELAYED_SUBPROGRAM
---
-
- procedure DELAYED_SUBPROGRAM (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- ) is
- begin
-
- NULL;
-
- end DELAYED_SUBPROGRAM;
-
---PAGE
---
--- SERVICE_ROUTINE
---
-
- procedure SERVICE_ROUTINE (
- IGNORED : in RTEMS.VECTOR_NUMBER
- ) is
- begin
-
- NULL;
-
- end SERVICE_ROUTINE;
-
---PAGE
---
--- SCREEN_1
---
-
- procedure SCREEN_1
- is
- NOTEPAD_VALUE : RTEMS.UNSIGNED32;
- SELF_ID : RTEMS.ID;
- PREVIOUS_PRIORITY : RTEMS.TASK_PRIORITY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_DELETE( 100, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TASK_DELETE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_delete - INVALID_ID" );
-
--- RTEMS.TASK_GET_NOTE( RTEMS.SELF,
--- RTEMS.NOTEPAD_INDEX'LAST + 10,
--- NOTEPAD_VALUE,
--- STATUS
--- );
--- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
--- STATUS,
--- RTEMS.INVALID_NUMBER,
--- "TASK_GET_NOTE WITH ILLEGAL NOTEPAD"
--- );
--- TEXT_IO.PUT_LINE( "TA1 - task_get_note - INVALID_NUMBER" );
- TEXT_IO.PUT_LINE(
- "TA1 - task_get_note - INVALID_NUMBER -- constraint error"
- );
-
- RTEMS.TASK_GET_NOTE(
- 100,
- RTEMS.NOTEPAD_INDEX'LAST,
- NOTEPAD_VALUE,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TASK_GET_NOTE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_get_note - INVALID_ID" );
-
- RTEMS.TASK_IDENT(
- RTEMS.SELF,
- RTEMS.SEARCH_ALL_NODES,
- SELF_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );
- if SELF_ID /= SPTEST.TASK_ID( 1 ) then
- TEXT_IO.PUT_LINE( "ERROR - task_ident - incorrect ID returned!" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
- end if;
- TEXT_IO.PUT_LINE(
- "TA1 - task_ident - current task SUCCESSFUL"
- );
-
- RTEMS.TASK_IDENT(
- 100,
- RTEMS.SEARCH_ALL_NODES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "TASK_IDENT WITH ILLEGAL NAME (local)"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_ident - global INVALID_NAME" );
-
- RTEMS.TASK_IDENT( 100, 1, SPTEST.JUNK_ID, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "TASK_IDENT WITH ILLEGAL NAME (global)"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_ident - local INVALID_NAME" );
-
- RTEMS.TASK_IDENT( 100, 2, SPTEST.JUNK_ID, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NODE,
- "TASK_IDENT WITH ILLEGAL NODE"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_ident - INVALID_NODE" );
-
- RTEMS.TASK_RESTART( 100, 0, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TASK_RESTART WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_restart - INVALID_ID" );
-
- RTEMS.TASK_RESUME( 100, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TASK_RESUME WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_resume - INVALID_ID" );
-
- RTEMS.TASK_RESUME( RTEMS.SELF, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INCORRECT_STATE,
- "TASK_RESUME OF READY TASK"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_resume - INCORRECT_STATE" );
-
--- RTEMS.TASK_SET_PRIORITY( RTEMS.SELF, 512, PREVIOUS_PRIORITY, STATUS );
--- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
--- STATUS,
--- RTEMS.INVALID_PRIORITY,
--- "TASK_SET_PRIORITY WITH ILLEGAL PRIORITY"
--- );
--- TEXT_IO.PUT_LINE(
--- "TA1 - task_set_priority - INVALID_PRIORITY"
--- );
- TEXT_IO.PUT_LINE(
- "TA1 - task_set_priority - INVALID_PRIORITY -- constraint error"
- );
-
- RTEMS.TASK_SET_PRIORITY( 100, 8, PREVIOUS_PRIORITY, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TASK_SET_PRIORITY WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_set_priority - INVALID_ID" );
-
--- RTEMS.TASK_SET_NOTE( RTEMS.SELF,
--- RTEMS.NOTEPAD_INDEX'LAST + 10,
--- NOTEPAD_VALUE,
--- STATUS
--- );
--- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
--- STATUS,
--- RTEMS.INVALID_NUMBER,
--- "TASK_SET_NOTE WITH ILLEGAL NOTEPAD"
--- );
--- TEXT_IO.PUT_LINE( "TA1 - task_set_note - INVALID_NUMBER" );
- TEXT_IO.PUT_LINE(
- "TA1 - task_set_note - INVALID_NUMBER -- constraint error"
- );
-
- RTEMS.TASK_SET_NOTE(
- 100,
- RTEMS.NOTEPAD_INDEX'LAST,
- NOTEPAD_VALUE,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TASK_SET_NOTE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_set_note - INVALID_ID" );
-
- RTEMS.TASK_START( 100, SPTEST.TASK_1'ACCESS, 0, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TASK_START WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_start - INVALID_ID" );
-
- RTEMS.TASK_START( RTEMS.SELF, SPTEST.TASK_1'ACCESS, 0, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INCORRECT_STATE,
- "TASK_START OF READY TASK"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_start - INCORRECT_STATE" );
-
- RTEMS.TASK_SUSPEND( 100, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TASK_SUSPEND WITH INVALID ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_suspend - INVALID_ID" );
-
- end SCREEN_1;
-
---PAGE
---
--- SCREEN_2
---
-
- procedure SCREEN_2
- is
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
--- errors before clock is set
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
-
- if RTEMS.IS_STATUS_SUCCESSFUL( STATUS ) then
- TEXT_IO.PUT_LINE(
- "TA1 - clock_get - NOT_DEFINED -- DID THE BSP SET THE TIME OF DAY?"
- );
- else
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.NOT_DEFINED,
- "CLOCK_GET BEFORE CLOCK IS SET"
- );
- TEXT_IO.PUT_LINE( "TA1 - clock_get - NOT_DEFINED" );
- end if;
-
- RTEMS.TASK_WAKE_WHEN( TIME, STATUS );
- if RTEMS.IS_STATUS_SUCCESSFUL( STATUS ) then
- TEXT_IO.PUT( "TA1 - task_wake_when - NOT_DEFINED -- " );
- TEXT_IO.PUT_LINE( "DID THE BSP SET THE TIME OF DAY?" );
- else
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.NOT_DEFINED,
- "TASK_WAKE_WHEN BEFORE CLOCK IS SET"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_wake_when - NOT_DEFINED" );
- end if;
-
- RTEMS.TIMER_FIRE_WHEN(
- 0,
- TIME,
- SPTEST.DELAYED_SUBPROGRAM'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
-
- if RTEMS.IS_STATUS_SUCCESSFUL( STATUS ) then
- TEXT_IO.PUT( "TA1 - task_fire_when - NOT_DEFINED -- " );
- TEXT_IO.PUT_LINE( "DID THE BSP SET THE TIME OF DAY?" );
- else
-
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.NOT_DEFINED,
- "TIMER_FIRE_WHEN BEFORE CLOCK IS SET"
- );
- TEXT_IO.PUT_LINE( "TA1 - timer_fire_when - NOT_DEFINED" );
-
- end if;
-
--- invalid time of day field
-
- TIME := ( 1987, 2, 5, 8, 30, 45, 0 );
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_CLOCK,
- "CLOCK_SET WITH INVALID YEAR"
- );
- TEXT_IO.PUT_LINE( " - INVALID_CLOCK" );
-
- TIME := ( 1988, 15, 5, 8, 30, 45, 0 );
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_CLOCK,
- "CLOCK_SET WITH INVALID MONTH"
- );
- TEXT_IO.PUT_LINE( " - INVALID_CLOCK" );
-
- TIME := ( 1988, 2, 32, 8, 30, 45, 0 );
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_CLOCK,
- "CLOCK_SET WITH INVALID DAY"
- );
- TEXT_IO.PUT_LINE( " - INVALID_CLOCK" );
-
- TIME := ( 1988, 2, 5, 25, 30, 45, 0 );
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_CLOCK,
- "CLOCK_SET WITH INVALID HOUR"
- );
- TEXT_IO.PUT_LINE( " - INVALID_CLOCK" );
-
- TIME := ( 1988, 2, 5, 8, 61, 45, 0 );
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_CLOCK,
- "CLOCK_SET WITH INVALID MINUTE"
- );
- TEXT_IO.PUT_LINE( " - INVALID_CLOCK" );
-
- TIME := ( 1988, 2, 5, 8, 30, 61, 0 );
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_CLOCK,
- "CLOCK_SET WITH INVALID SECOND"
- );
- TEXT_IO.PUT_LINE( " - INVALID_CLOCK" );
-
- TIME := ( 1988, 2, 5, 8, 30, 45, TEST_SUPPORT.TICKS_PER_SECOND + 1 );
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_CLOCK,
- "CLOCK_SET WITH INVALID TICKS PER SECOND"
- );
- TEXT_IO.PUT_LINE( " - INVALID_CLOCK" );
-
- TIME := ( 1988, 2, 5, 8, 30, 45, 0 );
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" );
- TEXT_IO.PUT_LINE( " - SUCCESSFUL" );
-
--- task_wake_when
-
- TIME := ( 1988, 2, 5, 8, 30, 48, TEST_SUPPORT.TICKS_PER_SECOND + 1 );
- TEXT_IO.PUT( "TA1 - task_wake_when - TICK INVALID - " );
- TEXT_IO.PUT_LINE( "sleep about 3 seconds" );
- RTEMS.TASK_WAKE_WHEN( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "TASK_WAKE_WHEN WITH INVALID TICKS PER SECOND"
- );
- TEXT_IO.PUT( "TA1 - task_wake_when - TICK INVALID - " );
- TEXT_IO.PUT_LINE( "woke up SUCCESSFUL" );
-
- TIME := ( 1961, 2, 5, 8, 30, 48, 0 );
- TEST_SUPPORT.PRINT_TIME( "TA1 - task_wake_when - ", TIME, "" );
- RTEMS.TASK_WAKE_WHEN( TIME, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_CLOCK,
- "TASK_WAKE_WHEN WITH INVALID YEAR"
- );
- TEXT_IO.PUT_LINE( " - INVALID_CLOCK" );
-
- TIME := ( 1988, 2, 5, 25, 30, 48, 0 );
- TEST_SUPPORT.PRINT_TIME( "TA1 - task_wake_when - ", TIME, "" );
- RTEMS.TASK_WAKE_WHEN( TIME, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_CLOCK,
- "TASK_WAKE_WHEN WITH INVALID HOUR"
- );
- TEXT_IO.PUT_LINE( " - INVALID_CLOCK" );
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET SUCCESSFUL" );
- TEST_SUPPORT.PRINT_TIME( "TA1 - current time - ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- TIME.MONTH := 1;
- TEST_SUPPORT.PRINT_TIME( "TA1 - task_wake_when - ", TIME, "" );
- RTEMS.TASK_WAKE_WHEN( TIME, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_CLOCK,
- "TASK_WAKE_WHEN BEFORE CURRENT TIME"
- );
- TEXT_IO.PUT_LINE( " - INVALID_CLOCK" );
-
- end SCREEN_2;
-
---PAGE
---
--- SCREEN_3
---
-
- procedure SCREEN_3
- is
- TASK_NAME : RTEMS.NAME;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TASK_NAME := 1;
-
- RTEMS.TASK_CREATE(
- 0,
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "TASK_CREATE WITH ILLEGAL NAME"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - task_create - INVALID_NAME"
- );
-
- RTEMS.TASK_CREATE(
- TASK_NAME,
- 1,
- RTEMS.CONFIGURATION.WORK_SPACE_SIZE,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.UNSATISFIED,
- "TASK_CREATE WITH A STACK SIZE LARGER THAN THE WORKSPACE"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - task_create - stack size - UNSATISFIED"
- );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
- TEXT_IO.PUT_LINE(
- "TA1 - task_create - TA2 created - SUCCESSFUL"
- );
-
- RTEMS.TASK_SUSPEND( SPTEST.TASK_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" );
- TEXT_IO.PUT_LINE(
- "TA1 - task_suspend - suspend TA2 - SUCCESSFUL"
- );
-
- RTEMS.TASK_SUSPEND( SPTEST.TASK_ID( 2 ), STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.ALREADY_SUSPENDED,
- "TASK_SUSPEND ON SUSPENDED TA2"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - task_suspend - suspend TA2 - ALREADY_SUSPENDED"
- );
-
- RTEMS.TASK_RESUME( SPTEST.TASK_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA2" );
- TEXT_IO.PUT_LINE(
- "TA1 - task_resume - TA2 resumed - SUCCESSFUL"
- );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 3 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" );
- TEXT_IO.PUT_LINE(
- "TA1 - task_create - TA3 created - SUCCESSFUL"
- );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 4 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 4 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" );
- TEXT_IO.PUT_LINE(
- "TA1 - task_create - 4 created - SUCCESSFUL"
- );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 5 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 5 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA5" );
- TEXT_IO.PUT_LINE(
- "TA1 - task_create - 5 created - SUCCESSFUL"
- );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 6 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 6 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA6" );
- TEXT_IO.PUT_LINE(
- "TA1 - task_create - 6 created - SUCCESSFUL"
- );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 7 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 7 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA7" );
- TEXT_IO.PUT_LINE(
- "TA1 - task_create - 7 created - SUCCESSFUL"
- );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 8 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 8 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA8" );
- TEXT_IO.PUT_LINE(
- "TA1 - task_create - 8 created - SUCCESSFUL"
- );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 9 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 9 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA9" );
- TEXT_IO.PUT_LINE(
- "TA1 - task_create - 9 created - SUCCESSFUL"
- );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 10 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 10 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA10" );
- TEXT_IO.PUT_LINE(
- "TA1 - task_create - 10 created - SUCCESSFUL"
- );
-
- RTEMS.TASK_CREATE(
- TASK_NAME,
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "TASK_CREATE FOR TOO MANY TASKS"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_create - 11 - TOO_MANY" );
-
- RTEMS.TASK_CREATE(
- TASK_NAME,
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.GLOBAL,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.MP_NOT_CONFIGURED,
- "TASK_CREATE OF GLOBAL TASK IN SINGLE CPU SYSTEM"
- );
- TEXT_IO.PUT_LINE( "TA1 - task_create - MP_NOT_CONFIGURED" );
-
- end SCREEN_3;
-
---PAGE
---
--- SCREEN_4
---
-
- procedure SCREEN_4
- is
- EVENT_OUT : RTEMS.EVENT_SET;
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_16,
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- EVENT_OUT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.UNSATISFIED,
- "EVENT_RECEIVE UNSATISFIED (ALL)"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - event_receive - UNSATISFIED ( all conditions )"
- );
-
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_16,
- RTEMS.NO_WAIT + RTEMS.EVENT_ANY,
- RTEMS.NO_TIMEOUT,
- EVENT_OUT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.UNSATISFIED,
- "EVENT_RECEIVE UNSATISFIED (ANY)"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - event_receive - UNSATISFIED ( any conditions )"
- );
-
- TEXT_IO.PUT_LINE( "TA1 - event_receive - timeout in 3 seconds" );
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_16,
- RTEMS.DEFAULT_OPTIONS,
- 3 * TEST_SUPPORT.TICKS_PER_SECOND,
- EVENT_OUT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TIMEOUT,
- "EVENT_RECEIVE AFTER 3 SECOND TIMEOUT"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - event_receive - woke with TIMEOUT"
- );
-
- RTEMS.EVENT_SEND(
- 100,
- RTEMS.EVENT_16,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "EVENT_SEND WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - INVALID_ID"
- );
-
- TEXT_IO.PUT_LINE(
- "TA1 - task_wake_after - sleep 1 second - SUCCESSFUL"
- );
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (1 SECOND)" );
-
- TIME := ( 1988, 2, 5, 8, 30, 45, 0 );
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" );
- TEXT_IO.PUT_LINE( " - SUCCESSFUL" );
-
- end SCREEN_4;
-
---PAGE
---
--- SCREEN_5
---
-
- procedure SCREEN_5
- is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.SEMAPHORE_CREATE(
- 0,
- 1,
- RTEMS.DEFAULT_ATTRIBUTES,
- RTEMS.NO_PRIORITY,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "SEMAPHORE_CREATE WITH ILLEGAL NAME"
- );
- TEXT_IO.PUT_LINE( "TA1 - semaphore_create - INVALID_NAME" );
-
- RTEMS.SEMAPHORE_CREATE(
- SPTEST.SEMAPHORE_NAME( 1 ),
- 1,
- RTEMS.DEFAULT_ATTRIBUTES,
- RTEMS.NO_PRIORITY,
- SPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "SEMAPHORE_CREATE SUCCESSFUL"
- );
- TEXT_IO.PUT_LINE( "TA1 - semaphore_create - 1 - SUCCESSFUL" );
-
- RTEMS.SEMAPHORE_CREATE(
- SPTEST.SEMAPHORE_NAME( 2 ),
- 1,
- RTEMS.BINARY_SEMAPHORE,
- RTEMS.NO_PRIORITY,
- SPTEST.SEMAPHORE_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "SEMAPHORE_CREATE SUCCESSFUL"
- );
- TEXT_IO.PUT_LINE( "TA1 - semaphore_create - 2 - SUCCESSFUL" );
-
- loop
- RTEMS.SEMAPHORE_CREATE(
- SPTEST.SEMAPHORE_NAME( 3 ),
- 1,
- RTEMS.DEFAULT_ATTRIBUTES,
- RTEMS.NO_PRIORITY,
- SPTEST.JUNK_ID,
- STATUS
- );
-
- exit when not RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.SUCCESSFUL );
- end loop;
-
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "SEMAPHORE_CREATE OF TOO MANY"
- );
- TEXT_IO.PUT_LINE( "TA1 - semaphore_create - 3 - TOO_MANY" );
-
- RTEMS.SEMAPHORE_CREATE(
- SPTEST.SEMAPHORE_NAME( 1 ),
- 1,
- RTEMS.INHERIT_PRIORITY + RTEMS.BINARY_SEMAPHORE + RTEMS.FIFO,
- RTEMS.NO_PRIORITY,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.NOT_DEFINED,
- "SEMAPHORE_CREATE OF FIFO INHERIT PRIORITY"
- );
- TEXT_IO.PUT_LINE("TA1 - semaphore_create - NOT_DEFINED");
-
- RTEMS.SEMAPHORE_CREATE(
- SPTEST.SEMAPHORE_NAME( 1 ),
- 1,
- RTEMS.INHERIT_PRIORITY + RTEMS.COUNTING_SEMAPHORE + RTEMS.PRIORITY,
- RTEMS.NO_PRIORITY,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.NOT_DEFINED,
- "SEMAPHORE_CREATE OF COUNTING_SEMAPHORE INHERIT PRIORITY"
- );
- TEXT_IO.PUT_LINE("TA1 - semaphore_create - NOT_DEFINED");
-
- RTEMS.SEMAPHORE_CREATE(
- SPTEST.SEMAPHORE_NAME( 1 ),
- 2,
- RTEMS.BINARY_SEMAPHORE,
- RTEMS.NO_PRIORITY,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NUMBER,
- "SEMAPHORE_CREATE OF BINARY_SEMAPHORE with COUNT > 1"
- );
- TEXT_IO.PUT_LINE("TA1 - semaphore_create - INVALID_NUMBER");
-
- RTEMS.SEMAPHORE_CREATE(
- SPTEST.SEMAPHORE_NAME( 3 ),
- 1,
- RTEMS.GLOBAL,
- RTEMS.NO_PRIORITY,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.MP_NOT_CONFIGURED,
- "SEMAPHORE_CREATE OF MP_NOT_CONFIGURED"
- );
- TEXT_IO.PUT_LINE("TA1 - semaphore_create - MP_NOT_CONFIGURED");
-
- RTEMS.SEMAPHORE_DELETE( 100, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "SEMAPHORE_DELETE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - semaphore_delete - unknown INVALID_ID"
- );
-
- RTEMS.SEMAPHORE_DELETE( 16#10100#, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "SEMAPHORE_DELETE WITH LOCAL ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - semaphore_delete - local INVALID_ID"
- );
-
- RTEMS.SEMAPHORE_IDENT(
- 100,
- RTEMS.SEARCH_ALL_NODES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "SEMAPHORE_IDENT WITH ILLEGAL NAME (local)"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - semaphore_ident - global INVALID_NAME"
- );
-
- RTEMS.SEMAPHORE_IDENT( 100, 1, SPTEST.JUNK_ID, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "SEMAPHORE_IDENT WITH ILLEGAL NAME (global)"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - semaphore_ident - local INVALID_NAME"
- );
-
- end SCREEN_5;
-
---PAGE
---
--- SCREEN_6
---
-
- procedure SCREEN_6
- is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.SEMAPHORE_OBTAIN(
- 100,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "SEMAPHORE_OBTAIN WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - INVALID_ID" );
-
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED(STATUS, "SEMAPHORE_OBTAIN SUCCESSFUL");
- TEXT_IO.PUT_LINE(
- "TA1 - semaphore_obtain - got sem 1 - SUCCESSFUL"
- );
-
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.UNSATISFIED,
- "SEMAPHORE_OBTAIN NOT AVAILABLE"
- );
- TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - UNSATISFIED" );
-
- TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - timeout in 3 seconds" );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_OPTIONS,
- 3 * TEST_SUPPORT.TICKS_PER_SECOND,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TIMEOUT,
- "SEMAPHORE_OBTAIN NOT AVAILABLE"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - semaphore_obtain - woke with TIMEOUT"
- );
-
- RTEMS.SEMAPHORE_RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.NOT_OWNER_OF_RESOURCE,
- "SEMAPHORE_RELEASE AND NOT OWNER"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - semaphore_release - NOT_OWNER_OF_RESOURCE"
- );
-
- RTEMS.SEMAPHORE_RELEASE( 100, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "SEMAPHORE_RELEASE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - semaphore_release - INVALID_ID" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - task_start - start TA2 - SUCCESSFUL"
- );
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - task_wake_after - yield processor - SUCCESSFUL"
- );
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - semaphore_delete - delete sem 1 - SUCCESSFUL"
- );
- RTEMS.SEMAPHORE_DELETE( SPTEST.SEMAPHORE_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM1" );
-
- TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - binary semaphore" );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 2 ),
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - semaphore_delete - delete sem 2 - RESOURCE_IN_USE"
- );
- RTEMS.SEMAPHORE_DELETE( SPTEST.SEMAPHORE_ID( 2 ), STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.RESOURCE_IN_USE,
- "SEMAPHORE_DELETE OF SM2"
- );
-
- TEXT_IO.PUT_LINE(
- "TA1 - task_wake_after - yield processor - SUCCESSFUL"
- );
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" );
-
- RTEMS.TASK_DELETE( SPTEST.TASK_ID( 2 ), STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TASK_DELETE AFTER THE TASK HAS BEEN DELETED"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - task_delete TA2 - already deleted INVALID_ID"
- );
-
- end SCREEN_6;
-
---PAGE
---
--- SCREEN_7
---
-
- procedure SCREEN_7
- is
- BUFFER : SPTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- COUNT : RTEMS.UNSIGNED32;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- RTEMS.MESSAGE_QUEUE_BROADCAST(
- 100,
- BUFFER_POINTER,
- 16,
- COUNT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "MESSAGE_QUEUE_BROADCAST WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_broadcast - INVALID_ID"
- );
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- 0,
- 3,
- 16,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "MESSAGE_QUEUE_CREATE WITH ILLEGAL NAME"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_create - Q 1 - INVALID_NAME"
- );
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- SPTEST.QUEUE_NAME( 1 ),
- 1,
- 16,
- RTEMS.GLOBAL,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.MP_NOT_CONFIGURED,
- "MESSAGE_QUEUE_CREATE OF MP NOT CONFIGURED"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_create - Q 1 - MP_NOT_CONFIGURED");
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- SPTEST.QUEUE_NAME( 1 ),
- 2,
- 16,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.QUEUE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "MESSAGE_QUEUE_CREATE SUCCESSFUL"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_create - Q 1 - 2 DEEP - SUCCESSFUL"
- );
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- SPTEST.QUEUE_NAME( 2 ),
- 1,
- 16,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "MESSAGE_QUEUE_CREATE OF TOO MANY"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_create - Q 2 - TOO_MANY"
- );
-
- RTEMS.MESSAGE_QUEUE_DELETE( 100, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "MESSAGE_QUEUE_DELETE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_delete - unknown INVALID_ID"
- );
-
- RTEMS.MESSAGE_QUEUE_DELETE( 16#10100#, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "MESSAGE_QUEUE_DELETE WITH LOCAL ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_delete - local INVALID_ID"
- );
-
- RTEMS.MESSAGE_QUEUE_IDENT(
- 100,
- RTEMS.SEARCH_ALL_NODES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "MESSAGE_QUEUE_IDENT WITH ILLEGAL NAME"
- );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_ident - INVALID_NAME" );
-
- RTEMS.MESSAGE_QUEUE_FLUSH( 100, COUNT, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "MESSAGE_QUEUE_FLUSH WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_flush - INVALID_ID" );
-
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- 100,
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "MESSAGE_QUEUE_RECEIVE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_receive - INVALID_ID" );
-
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.UNSATISFIED,
- "MESSAGE_QUEUE_RECEIVE UNSATISFIED"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_receive - Q 1 - UNSATISFIED"
- );
-
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_receive - Q 1 - timeout in 3 seconds"
- );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- 3 * TEST_SUPPORT.TICKS_PER_SECOND,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TIMEOUT,
- "MESSAGE_QUEUE_RECEIVE 3 SECOND TIMEOUT"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_receive - Q 1 - woke up with TIMEOUT"
- );
-
- RTEMS.MESSAGE_QUEUE_SEND( 100, BUFFER_POINTER, 16, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "MESSAGE_QUEUE_SEND WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_send - INVALID_ID" );
-
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL"
- );
-
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL"
- );
-
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "MESSAGE_QUEUE_SEND TOO MANY TO LIMITED QUEUE"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_send - BUFFER 3 TO Q 1 - TOO_MANY"
- );
-
- end SCREEN_7;
-
---PAGE
---
--- SCREEN_8
---
-
- procedure SCREEN_8
- is
- BUFFER : SPTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- RTEMS.MESSAGE_QUEUE_DELETE( SPTEST.QUEUE_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "MESSAGE_QUEUE_DELETE SUCCESSFUL"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_delete - Q 1 - SUCCESSFUL"
- );
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- SPTEST.QUEUE_NAME( 1 ),
- 2,
- 16,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.QUEUE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "MESSAGE_QUEUE_CREATE SUCCESSFUL"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_create - Q 1 - 2 DEEP - SUCCESSFUL"
- );
-
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL"
- );
-
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL"
- );
-
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "MESSAGE_QUEUE_SEND TOO MANY TO LIMITED QUEUE"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_send - BUFFER 3 TO Q 1 - TOO_MANY"
- );
-
- RTEMS.MESSAGE_QUEUE_DELETE( SPTEST.QUEUE_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "MESSAGE_QUEUE_DELETE SUCCESSFUL"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_delete - Q 1 - SUCCESSFUL"
- );
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- SPTEST.QUEUE_NAME( 1 ),
- 3,
- 16,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.QUEUE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "MESSAGE_QUEUE_CREATE SUCCESSFUL"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_create - Q 1 - 3 DEEP - SUCCESSFUL"
- );
-
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL"
- );
-
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL"
- );
-
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_send - BUFFER 3 TO Q 1 - SUCCESSFUL"
- );
-
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "MESSAGE_QUEUE_SEND TOO MANY TO LIMITED QUEUE"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_send - BUFFER 4 TO Q 1 - TOO_MANY"
- );
-
- RTEMS.MESSAGE_QUEUE_DELETE( SPTEST.QUEUE_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "MESSAGE_QUEUE_DELETE SUCCESSFUL"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_delete - Q 1 - SUCCESSFUL"
- );
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- SPTEST.QUEUE_NAME( 1 ),
- 2,
- 16,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.QUEUE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "MESSAGE_QUEUE_CREATE SUCCESSFUL"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_create - Q 1 - 3 DEEP - SUCCESSFUL"
- );
-
- TEXT_IO.PUT_LINE(
- "TA1 - task_start - start TA3 - SUCCESSFUL"
- );
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 3 ),
- SPTEST.TASK_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - task_wake_after - yield processor - SUCCESSFUL"
- );
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" );
-
- RTEMS.MESSAGE_QUEUE_DELETE( SPTEST.QUEUE_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "MESSAGE_QUEUE_DELETE SUCCESSFUL"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_delete - delete Q 1 - SUCCESSFUL"
- );
-
- TEXT_IO.PUT_LINE(
- "TA1 - task_wake_after - yield processor - SUCCESSFUL"
- );
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" );
-
- end SCREEN_8;
-
---PAGE
---
--- SCREEN_9
---
-
- procedure SCREEN_9
- is
- CONVERTED : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- OLD_SERVICE_ROUTINE : RTEMS.ADDRESS;
- begin
-
--- RTEMS.INTERRUPT_CATCH(
--- SPTEST.SERVICE_ROUTINE'ACCESS,
--- 500,
--- OLD_SERVICE_ROUTINE,
--- STATUS
--- );
--- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
--- STATUS,
--- RTEMS.INVALID_NUMBER,
--- "INTERRUPT_CATCH WITH INVALID VECTOR"
--- );
--- TEXT_IO.PUT_LINE( "TA1 - interrupt_catch - INVALID_NUMBER" );
- TEXT_IO.PUT_LINE(
- "TA1 - interrupt_catch - INVALID_NUMBER -- constraint error"
- );
-
- RTEMS.INTERRUPT_CATCH(
- RTEMS.NULL_ADDRESS,
- 3,
- OLD_SERVICE_ROUTINE,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ADDRESS,
- "INTERRUPT_CATCH WITH INVALID HANDLER"
- );
- TEXT_IO.PUT_LINE( "TA1 - interrupt_catch - INVALID_ADDRESS" );
-
- RTEMS.SIGNAL_SEND( 100, RTEMS.SIGNAL_1, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "SIGNAL_SEND WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - signal_send - INVALID_ID" );
-
- RTEMS.SIGNAL_SEND( RTEMS.SELF, RTEMS.SIGNAL_16, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.NOT_DEFINED,
- "SIGNAL_SEND WITH NO HANDLER"
- );
- TEXT_IO.PUT_LINE( "TA1 - signal_send - NOT_DEFINED" );
-
- RTEMS.PORT_CREATE(
- 0,
- SPTEST.INTERNAL_PORT_AREA'ADDRESS,
- SPTEST.EXTERNAL_PORT_AREA'ADDRESS,
- SPTEST.INTERNAL_PORT_AREA'LENGTH,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "PORT_CREATE WITH ILLEGAL NAME"
- );
- TEXT_IO.PUT_LINE( "TA1 - port_create - INVALID_NAME" );
-
- RTEMS.PORT_CREATE(
- SPTEST.PORT_NAME( 1 ),
- SPTEST.INTERNAL_PORT_AREA( 1 )'ADDRESS,
- SPTEST.EXTERNAL_PORT_AREA'ADDRESS,
- SPTEST.INTERNAL_PORT_AREA'LENGTH,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ADDRESS,
- "PORT_CREATE WITH ILLEGAL ADDRESS"
- );
- TEXT_IO.PUT_LINE( "TA1 - port_create - INVALID_ADDRESS" );
-
- RTEMS.PORT_CREATE(
- SPTEST.PORT_NAME( 1 ),
- SPTEST.INTERNAL_PORT_AREA'ADDRESS,
- SPTEST.EXTERNAL_PORT_AREA'ADDRESS,
- SPTEST.INTERNAL_PORT_AREA'LENGTH,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "PORT_CREATE OF TOO MANY"
- );
- TEXT_IO.PUT_LINE( "TA1 - port_create - TOO_MANY" );
-
- RTEMS.PORT_DELETE( 0, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "PORT_DELETE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - port_delete - INVALID_ID" );
-
- RTEMS.PORT_IDENT( 0, SPTEST.JUNK_ID, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "PORT_IDENT WITH ILLEGAL NAME"
- );
- TEXT_IO.PUT_LINE( "TA1 - port_ident - INVALID_NAME" );
-
- RTEMS.PORT_INTERNAL_TO_EXTERNAL(
- 100,
- SPTEST.INTERNAL_PORT_AREA'ADDRESS,
- CONVERTED,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "PORT_INTERNAL_TO_EXTERNAL WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - port_internal_to_external - INVALID_ID"
- );
-
- RTEMS.PORT_EXTERNAL_TO_INTERNAL(
- 100,
- SPTEST.EXTERNAL_PORT_AREA'ADDRESS,
- CONVERTED,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "PORT_EXTERNAL_TO_INTERNAL WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - port_external_to_internal - INVALID_ID"
- );
-
- end SCREEN_9;
-
---PAGE
---
--- SCREEN_10
---
-
- procedure SCREEN_10
- is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.RATE_MONOTONIC_CREATE( 0, SPTEST.JUNK_ID, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "RATE_MONOTONIC_CREATE WITH ILLEGAL NAME"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - rate_monotonic_create - INVALID_NAME"
- );
-
- RTEMS.RATE_MONOTONIC_CREATE(
- SPTEST.PERIOD_NAME( 1 ),
- SPTEST.PERIOD_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CREATE" );
- TEXT_IO.PUT_LINE(
- "TA1 - rate_monotonic_create - SUCCESSFUL"
- );
-
- RTEMS.RATE_MONOTONIC_CREATE(
- SPTEST.PERIOD_NAME( 1 ),
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "RATE_MONOTONIC_CREATE FOR TOO MANY"
- );
- TEXT_IO.PUT_LINE( "TA1 - rate_monotonic_create - TOO_MANY" );
-
- RTEMS.RATE_MONOTONIC_IDENT( 0, SPTEST.JUNK_ID, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "RATE_MONOTONIC_IDENT WITH ILLEGAL NAME"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - rate_monotonic_ident - INVALID_NAME"
- );
-
- RTEMS.RATE_MONOTONIC_PERIOD( 100, 5, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "RATE_MONOTONIC_PERIOD WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - rate_monotonic_period - unknown INVALID_ID"
- );
-
- RTEMS.RATE_MONOTONIC_PERIOD( 16#10100#, 5, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "RATE_MONOTONIC_PERIOD WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - rate_monotonic_period - local INVALID_ID"
- );
-
- RTEMS.RATE_MONOTONIC_PERIOD(
- SPTEST.PERIOD_ID( 1 ),
- RTEMS.PERIOD_STATUS,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.NOT_DEFINED,
- "RATE_MONOTONIC_PERIOD STATUS NOT DEFINED"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - rate_monotonic_period( STATUS ) - NOT_DEFINED"
- );
-
- RTEMS.RATE_MONOTONIC_PERIOD( SPTEST.PERIOD_ID( 1 ), 100, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "RATE_MONOTONIC_PERIOD 100 TICKS"
- );
- TEXT_IO.PUT( "TA1 - rate_monotonic_period - 100 ticks - " );
- TEXT_IO.PUT_LINE( "SUCCESSFUL" );
-
- RTEMS.RATE_MONOTONIC_PERIOD(
- SPTEST.PERIOD_ID( 1 ),
- RTEMS.PERIOD_STATUS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "RATE_MONOTONIC_PERIOD STATUS"
- );
- TEXT_IO.PUT( "TA1 - rate_monotonic_period( STATUS ) - " );
- TEXT_IO.PUT_LINE( "SUCCESSFUL" );
-
- loop
-
- RTEMS.RATE_MONOTONIC_PERIOD(
- SPTEST.PERIOD_ID( 1 ),
- RTEMS.PERIOD_STATUS,
- STATUS
- );
-
- exit when RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.TIMEOUT );
-
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "RATE_MONOTONIC_PERIOD STATUS WAITING FOR TIMEOUT"
- );
-
- end loop;
- TEXT_IO.PUT( "TA1 - rate_monotonic_period( STATUS ) - " );
- TEXT_IO.PUT_LINE( "TIMEOUT" );
-
- RTEMS.RATE_MONOTONIC_CANCEL( 100, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "RATE_MONOTONIC_CANCEL WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - rate_monotonic_cancel - unknown INVALID_ID"
- );
-
- RTEMS.RATE_MONOTONIC_CANCEL( 16#10100#, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "RATE_MONOTONIC_CANCEL WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - rate_monotonic_cancel - local INVALID_ID"
- );
-
- RTEMS.RATE_MONOTONIC_CANCEL( SPTEST.PERIOD_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CANCEL" );
- TEXT_IO.PUT_LINE( "TA1 - rate_monotonic_cancel - SUCCESSFUL" );
-
- RTEMS.RATE_MONOTONIC_PERIOD( SPTEST.PERIOD_ID( 1 ), 5, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "RATE_MONOTONIC_PERIOD RESTART"
- );
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- RTEMS.RATE_MONOTONIC_PERIOD( SPTEST.PERIOD_ID( 1 ), 5, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TIMEOUT,
- "RATE_MONOTONIC_PERIOD TIMED OUT"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - rate_monotonic_period - 5 ticks - TIMEOUT"
- );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 4 ),
- SPTEST.TASK_4'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yielding to TA4" );
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" );
-
- RTEMS.RATE_MONOTONIC_DELETE( 100, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "RATE_MONOTONIC_DELETE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - rate_monotonic_delete - unknown INVALID_ID"
- );
-
- RTEMS.RATE_MONOTONIC_DELETE( 16#10100#, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "RATE_MONOTONIC_DELETE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - rate_monotonic_delete - local INVALID_ID"
- );
-
- RTEMS.RATE_MONOTONIC_DELETE( SPTEST.PERIOD_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_DELETE" );
- TEXT_IO.PUT_LINE(
- "TA1 - rate_monotonic_delete - SUCCESSFUL"
- );
-
- end SCREEN_10;
-
---PAGE
---
--- SCREEN_11
---
-
- procedure SCREEN_11
- is
- BUFFER_ADDRESS_1 : RTEMS.ADDRESS;
- BUFFER_ADDRESS_2 : RTEMS.ADDRESS;
- BUFFER_ADDRESS_3 : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.PARTITION_CREATE(
- 0,
- SPTEST.PARTITION_GOOD_AREA'ADDRESS,
- 128,
- 40,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "PARTITION_CREATE WITH ILLEGAL NAME"
- );
- TEXT_IO.PUT_LINE( "TA1 - partition_create - INVALID_NAME" );
-
- RTEMS.PARTITION_CREATE(
- SPTEST.PARTITION_NAME( 1 ),
- SPTEST.PARTITION_GOOD_AREA'ADDRESS,
- 0,
- 80,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_SIZE,
- "PARTITION_CREATE WITH ILLEGAL LENGTH"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - partition_create - length - INVALID_SIZE"
- );
-
- RTEMS.PARTITION_CREATE(
- SPTEST.PARTITION_NAME( 1 ),
- SPTEST.PARTITION_GOOD_AREA'ADDRESS,
- 128,
- 0,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_SIZE,
- "PARTITION_CREATE WITH ILLEGAL BUFFER_SIZE"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - partition_create - buffer size - INVALID_SIZE"
- );
-
- RTEMS.PARTITION_CREATE(
- SPTEST.PARTITION_NAME( 1 ),
- SPTEST.PARTITION_GOOD_AREA'ADDRESS,
- 128,
- 256,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_SIZE,
- "PARTITION_CREATE WITH BUFFER_SIZE > LENGTH"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - partition_create - length < buffer size - INVALID_SIZE"
- );
-
- RTEMS.PARTITION_CREATE(
- SPTEST.PARTITION_NAME( 1 ),
- SPTEST.PARTITION_GOOD_AREA'ADDRESS,
- 128,
- 64,
- RTEMS.GLOBAL,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.MP_NOT_CONFIGURED,
- "PARTITION_CREATE OF GLOBAL"
- );
- TEXT_IO.PUT_LINE("TA1 - partition_create - MP_NOT_CONFIGURED");
-
- RTEMS.PARTITION_CREATE(
- SPTEST.PARTITION_NAME( 1 ),
- SPTEST.PARTITION_BAD_AREA'ADDRESS,
- 128,
- 64,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ADDRESS,
- "PARTITION_CREATE WITH BAD ADDRESS"
- );
- TEXT_IO.PUT_LINE( "TA1 - partition_create - INVALID_ADDRESS" );
-
- RTEMS.PARTITION_CREATE(
- SPTEST.PARTITION_NAME( 1 ),
- SPTEST.PARTITION_GOOD_AREA'ADDRESS,
- 128,
- 34,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_SIZE,
- "PARTITION_CREATE WITH UNALIGNED BUFFER_SIZE"
- );
- TEXT_IO.PUT_LINE( "TA1 - partition_create - INVALID_SIZE" );
-
- RTEMS.PARTITION_DELETE( 100, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "PARTITION_DELETE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - partition_delete - unknown INVALID_ID"
- );
-
- RTEMS.PARTITION_DELETE( 16#10100#, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "PARTITION_DELETE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - partition_delete - local INVALID_ID"
- );
-
- RTEMS.PARTITION_GET_BUFFER( 100, BUFFER_ADDRESS_1, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "PARTITION_GET_BUFFER WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - partition_get_buffer - INVALID_ID" );
-
- RTEMS.PARTITION_IDENT(
- 0,
- RTEMS.SEARCH_ALL_NODES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "PARTITION_IDENT WITH ILLEGAL NAME"
- );
- TEXT_IO.PUT_LINE( "TA1 - partition_ident - INVALID_NAME" );
-
- RTEMS.PARTITION_RETURN_BUFFER( 100, BUFFER_ADDRESS_1, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "PARTITION_RETURN WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - partition_return_buffer - INVALID_ID"
- );
-
- RTEMS.PARTITION_CREATE(
- SPTEST.PARTITION_NAME( 1 ),
- SPTEST.PARTITION_GOOD_AREA'ADDRESS,
- 128,
- 64,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.PARTITION_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE" );
- TEXT_IO.PUT_LINE( "TA1 - partition_create - SUCCESSFUL" );
-
- RTEMS.PARTITION_CREATE(
- SPTEST.PARTITION_NAME( 1 ),
- SPTEST.PARTITION_GOOD_AREA'ADDRESS,
- 128,
- 64,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "PARTITION_CREATE OF TOO MANY"
- );
- TEXT_IO.PUT_LINE( "TA1 - partition_create - TOO_MANY" );
-
- RTEMS.PARTITION_GET_BUFFER(
- SPTEST.PARTITION_ID( 1 ),
- BUFFER_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" );
- TEXT_IO.PUT_LINE( "TA1 - partition_get_buffer - SUCCESSFUL" );
-
- RTEMS.PARTITION_GET_BUFFER(
- SPTEST.PARTITION_ID( 1 ),
- BUFFER_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" );
- TEXT_IO.PUT_LINE( "TA1 - partition_get_buffer - SUCCESSFUL" );
-
- RTEMS.PARTITION_GET_BUFFER(
- SPTEST.PARTITION_ID( 1 ),
- BUFFER_ADDRESS_3,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.UNSATISFIED,
- "PARTITION_GET_BUFFER UNSATISFIED"
- );
- TEXT_IO.PUT_LINE( "TA1 - partition_get_buffer - UNSATISFIED" );
-
- RTEMS.PARTITION_DELETE(
- SPTEST.PARTITION_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.RESOURCE_IN_USE,
- "PARTITION_DELETE WITH BUFFERS IN USE"
- );
- TEXT_IO.PUT_LINE( "TA1 - partition_delete - RESOURCE_IN_USE" );
-
- RTEMS.PARTITION_RETURN_BUFFER(
- SPTEST.PARTITION_ID( 1 ),
- SPTEST.REGION_GOOD_AREA( 0 )'ADDRESS, -- NOTE: REGION
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ADDRESS,
- "PARTITION_RETURN WITH BUFFER ADDRESS OUT OF PARTITION"
- );
- TEXT_IO.PUT( "TA1 - partition_return_buffer - " );
- TEXT_IO.PUT_LINE( "INVALID_ADDRESS - out of range" );
-
- RTEMS.PARTITION_RETURN_BUFFER(
- SPTEST.PARTITION_ID( 1 ),
- SPTEST.PARTITION_GOOD_AREA( 7 )'ADDRESS,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ADDRESS,
- "PARTITION_RETURN WITH BUFFER ADDRESS NOT ON BOUNDARY"
- );
- TEXT_IO.PUT( "TA1 - partition_return_buffer - " );
- TEXT_IO.PUT_LINE( "INVALID_ADDRESS - not on boundary" );
-
-
- end SCREEN_11;
-
---PAGE
---
--- SCREEN_12
---
-
- procedure SCREEN_12
- is
- SEGMENT_ADDRESS_1 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_2 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_3 : RTEMS.ADDRESS;
- OFFSET : RTEMS.UNSIGNED32;
- GOOD_FRONT_FLAG : RTEMS.UNSIGNED32;
- GOOD_BACK_FLAG : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.REGION_CREATE(
- 0,
- SPTEST.REGION_GOOD_AREA'ADDRESS,
- 16#40#,
- 32,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "REGION_CREATE WITH ILLEGAL NAME"
- );
- TEXT_IO.PUT_LINE( "TA1 - region_create - INVALID_NAME" );
-
- RTEMS.REGION_CREATE(
- SPTEST.REGION_NAME( 1 ),
- SPTEST.REGION_BAD_AREA'ADDRESS,
- 16#40#,
- 32,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ADDRESS,
- "REGION_CREATE WITH ILLEGAL ADDRESS"
- );
- TEXT_IO.PUT_LINE( "TA1 - region_create - INVALID_ADDRESS" );
-
- RTEMS.REGION_CREATE(
- SPTEST.REGION_NAME( 1 ),
- SPTEST.REGION_GOOD_AREA'ADDRESS,
- 16#40#,
- 34,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_SIZE,
- "REGION_CREATE WITH ILLEGAL SIZE"
- );
- TEXT_IO.PUT_LINE( "TA1 - region_create - INVALID_SIZE" );
-
- RTEMS.REGION_CREATE(
- SPTEST.REGION_NAME( 1 ),
- SPTEST.REGION_GOOD_AREA( SPTEST.REGION_START_OFFSET )'ADDRESS,
- SPTEST.REGION_LENGTH,
- 16#40#,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.REGION_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE" );
- TEXT_IO.PUT_LINE( "TA1 - region_create - SUCCESSFUL" );
-
- RTEMS.REGION_CREATE(
- SPTEST.REGION_NAME( 1 ),
- SPTEST.REGION_GOOD_AREA'ADDRESS,
- SPTEST.REGION_LENGTH,
- 16#40#,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "REGION_CREATE FOR TOO MANY"
- );
- TEXT_IO.PUT_LINE( "TA1 - region_create - TOO_MANY" );
-
- RTEMS.REGION_DELETE( 100, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "REGION_DELETE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - region_delete - unknown INVALID_ID" );
-
- RTEMS.REGION_DELETE( 16#10100#, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "REGION_DELETE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - region_delete - local INVALID_ID" );
-
- RTEMS.REGION_IDENT( 0, SPTEST.JUNK_ID, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "REGION_IDENT WITH ILLEGAL NAME"
- );
- TEXT_IO.PUT_LINE( "TA1 - region_ident - INVALID_NAME" );
-
- RTEMS.REGION_GET_SEGMENT(
- 100,
- 16#40#,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "REGION_GET_SEGMENT WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - region_get_segment - INVALID_ID" );
-
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- (SPTEST.REGION_GOOD_AREA'SIZE / 8) * 2,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_SIZE,
- "REGION_GET_SEGMENT WITH ILLEGAL SIZE"
- );
- TEXT_IO.PUT_LINE( "TA1 - region_get_segment - INVALID_SIZE" );
-
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 384,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT_LINE( "TA1 - region_get_segment - SUCCESSFUL" );
-
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SPTEST.REGION_LENGTH / 2,
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.UNSATISFIED,
- "REGION_GET_SEGMENT UNSATISFIED"
- );
- TEXT_IO.PUT_LINE( "TA1 - region_get_segment - UNSATISFIED" );
-
- TEXT_IO.PUT_LINE( "TA1 - region_get_segment - timeout in 3 seconds" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 128,
- RTEMS.DEFAULT_OPTIONS,
- 3 * TEST_SUPPORT.TICKS_PER_SECOND,
- SEGMENT_ADDRESS_3,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TIMEOUT,
- "REGION_GET_SEGMENT TIMEOUT"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - region_get_segment - woke up with TIMEOUT"
- );
-
- RTEMS.REGION_DELETE( SPTEST.REGION_ID( 1 ), STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.RESOURCE_IN_USE,
- "REGION_DELETE WITH BUFFERS IN USE"
- );
- TEXT_IO.PUT_LINE( "TA1 - region_delete - RESOURCE_IN_USE" );
-
- RTEMS.REGION_RETURN_SEGMENT(
- 100,
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "REGION_RETURN_SEGMENT WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - region_return_segment - INVALID_ID" );
-
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SPTEST.REGION_GOOD_AREA'ADDRESS,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ADDRESS,
- "REGION_RETURN_SEGMENT WITH ILLEGAL SEGMENT"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - region_return_segment - INVALID_ADDRESS"
- );
-
- -- internal heap errors, subject to change if heap code changes
-
- TEXT_IO.PUT_LINE( "TA1 - debug_disable - DEBUG_REGION" );
- RTEMS.DEBUG_DISABLE( RTEMS.DEBUG_REGION );
-
- OFFSET := 0;
- GOOD_BACK_FLAG := 0;
- GOOD_FRONT_FLAG := 0;
-
- TEXT_IO.PUT_LINE(
- "TA1 - region_return_segment - INVALID_ADDRESS - SKIPPED"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - region_return_segment - INVALID_ADDRESS - SKIPPED"
- );
-
-
--- OFFSET := RTEMS.SUBTRACT(
--- SEGMENT_ADDRESS_1,
--- SPTEST.REGION_GOOD_AREA'ADDRESS
--- ) / 4;
---
---
--- -- bad FRONT_FLAG error
---
--- GOOD_FRONT_FLAG := SPTEST.REGION_GOOD_AREA( OFFSET - 1 );
--- SPTEST.REGION_GOOD_AREA( OFFSET - 1 ) := GOOD_FRONT_FLAG + 2;
---
--- RTEMS.REGION_RETURN_SEGMENT(
--- SPTEST.REGION_ID( 1 ),
--- SEGMENT_ADDRESS_1,
--- STATUS
--- );
--- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
--- STATUS,
--- RTEMS.INVALID_ADDRESS,
--- "REGION_RETURN_SEGMENT WITH BACK_FLAG /= FRONT_FLAG"
--- );
--- TEXT_IO.PUT_LINE(
--- "TA1 - region_return_segment - INVALID_ADDRESS"
--- );
---
--- SPTEST.REGION_GOOD_AREA( OFFSET - 1 ) := GOOD_FRONT_FLAG;
---
--- -- bad BACK_FLAG error
---
--- GOOD_BACK_FLAG := SPTEST.REGION_GOOD_AREA( OFFSET - 2 );
--- SPTEST.REGION_GOOD_AREA( OFFSET - 2 ) := 1024;
---
--- RTEMS.REGION_RETURN_SEGMENT(
--- SPTEST.REGION_ID( 1 ),
--- SEGMENT_ADDRESS_1,
--- STATUS
--- );
--- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
--- STATUS,
--- RTEMS.INVALID_ADDRESS,
--- "REGION_RETURN_SEGMENT WITH BACK_FLAG /= FRONT_FLAG"
--- );
--- TEXT_IO.PUT_LINE(
--- "TA1 - region_return_segment - INVALID_ADDRESS"
--- );
---
--- SPTEST.REGION_GOOD_AREA( OFFSET - 2 ) := GOOD_BACK_FLAG;
-
- TEXT_IO.PUT_LINE( "TA1 - debug_enable - DEBUG_REGION" );
- RTEMS.DEBUG_ENABLE( RTEMS.DEBUG_REGION );
-
- RTEMS.REGION_EXTEND(
- 100,
- SPTEST.REGION_GOOD_AREA'ADDRESS,
- 128,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "REGION_EXTEND WITH INVALID_ID"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - region_extend - INVALID_ID"
- );
-
- RTEMS.REGION_EXTEND(
- SPTEST.REGION_ID( 1 ),
- SPTEST.REGION_GOOD_AREA( SPTEST.REGION_START_OFFSET + 16 )'ADDRESS,
- 128,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ADDRESS,
- "REGION_EXTEND WITH INVALID_ADDRESS"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - region_extend - within heap - INVALID_ADDRESS"
- );
-
- RTEMS.REGION_EXTEND(
- SPTEST.REGION_ID( 1 ),
- SPTEST.REGION_BAD_AREA'ADDRESS,
- 128,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.NOT_IMPLEMENTED,
- "REGION_EXTEND WITH NOT_IMPLEMENTED"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - region_extend - non-contiguous lower - NOT_IMPLEMENTED"
- );
-
- RTEMS.REGION_EXTEND(
- SPTEST.REGION_ID( 1 ),
- SPTEST.REGION_GOOD_AREA(
- SPTEST.REGION_START_OFFSET - SPTEST.REGION_LENGTH )'ADDRESS,
- 128,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.NOT_IMPLEMENTED,
- "REGION_EXTEND WITH NOT_IMPLEMENTED"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - region_extend - contiguous lower - NOT_IMPLEMENTED"
- );
-
- RTEMS.REGION_EXTEND(
- SPTEST.REGION_ID( 1 ),
- SPTEST.REGION_GOOD_AREA(
- SPTEST.REGION_START_OFFSET + SPTEST.REGION_LENGTH + 16 )'ADDRESS,
- 128,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.NOT_IMPLEMENTED,
- "REGION_EXTEND WITH NOT_IMPLEMENTED"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - region_extend - non-contiguous higher - NOT_IMPLEMENTED"
- );
-
- end SCREEN_12;
-
---PAGE
---
--- SCREEN_13
---
-
- procedure SCREEN_13
- is
- RESULT : RTEMS.UNSIGNED32;
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.IO_CLOSE(
- RTEMS.DEVICE_MAJOR_NUMBER'LAST,
- 0,
- RTEMS.NULL_ADDRESS,
- RESULT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NUMBER,
- "IO_CLOSE WITH BAD MAJOR NUMBER"
- );
- TEXT_IO.PUT_LINE("TA1 - io_close - INVALID_NUMBER");
-
- RTEMS.IO_CONTROL(
- RTEMS.DEVICE_MAJOR_NUMBER'LAST,
- 0,
- RTEMS.NULL_ADDRESS,
- RESULT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NUMBER,
- "IO_CONTROL WITH BAD MAJOR NUMBER"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - io_control - INVALID_NUMBER"
- );
-
- RTEMS.IO_INITIALIZE(
- RTEMS.DEVICE_MAJOR_NUMBER'LAST,
- 0,
- RTEMS.NULL_ADDRESS,
- RESULT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NUMBER,
- "IO_INITIALIZE WITH BAD MAJOR NUMBER"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - io_initialize - INVALID_NUMBER"
- );
-
- RTEMS.IO_OPEN(
- RTEMS.DEVICE_MAJOR_NUMBER'LAST,
- 0,
- RTEMS.NULL_ADDRESS,
- RESULT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NUMBER,
- "IO_OPEN WITH BAD MAJOR NUMBER"
- );
- TEXT_IO.PUT_LINE( "TA1 - io_open - INVALID_NUMBER" );
-
- RTEMS.IO_READ(
- RTEMS.DEVICE_MAJOR_NUMBER'LAST,
- 0,
- RTEMS.NULL_ADDRESS,
- RESULT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NUMBER,
- "IO_READ WITH BAD MAJOR NUMBER"
- );
- TEXT_IO.PUT_LINE( "TA1 - io_read - INVALID_NUMBER" );
-
- RTEMS.IO_WRITE(
- RTEMS.DEVICE_MAJOR_NUMBER'LAST,
- 0,
- RTEMS.NULL_ADDRESS,
- RESULT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NUMBER,
- "IO_WRITE WITH BAD MAJOR NUMBER"
- );
- TEXT_IO.PUT_LINE( "TA1 - io_write - INVALID_NUMBER" );
-
- TIME := ( 2000, 12, 31, 23, 59, 59, 0 );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" );
- TEST_SUPPORT.PRINT_TIME(
- "TA1 - clock_set - ",
- TIME,
- " - SUCCESSFUL"
- );
- TEXT_IO.NEW_LINE;
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET SUCCESSFUL" );
- TEST_SUPPORT.PRINT_TIME(
- "TA1 - clock_get - ",
- TIME,
- " - SUCCESSFUL"
- );
- TEXT_IO.NEW_LINE;
-
- TIME := ( 1999, 12, 31, 23, 59, 59, 0 );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" );
- TEST_SUPPORT.PRINT_TIME(
- "TA1 - clock_set - ",
- TIME,
- " - SUCCESSFUL"
- );
- TEXT_IO.NEW_LINE;
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET SUCCESSFUL" );
- TEST_SUPPORT.PRINT_TIME(
- "TA1 - clock_get - ",
- TIME,
- " - SUCCESSFUL"
- );
- TEXT_IO.NEW_LINE;
-
- TIME := ( 2100, 12, 31, 23, 59, 59, 0 );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" );
- TEST_SUPPORT.PRINT_TIME(
- "TA1 - clock_set - ",
- TIME,
- " - SUCCESSFUL"
- );
- TEXT_IO.NEW_LINE;
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET SUCCESSFUL" );
- TEST_SUPPORT.PRINT_TIME(
- "TA1 - clock_get - ",
- TIME,
- " - SUCCESSFUL"
- );
- TEXT_IO.NEW_LINE;
-
- TIME := ( 2099, 12, 31, 23, 59, 59, 0 );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" );
- TEST_SUPPORT.PRINT_TIME(
- "TA1 - clock_set - ",
- TIME,
- " - SUCCESSFUL"
- );
- TEXT_IO.NEW_LINE;
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET SUCCESSFUL" );
- TEST_SUPPORT.PRINT_TIME(
- "TA1 - clock_get - ",
- TIME,
- " - SUCCESSFUL"
- );
- TEXT_IO.NEW_LINE;
-
- TIME := ( 1991, 12, 31, 23, 59, 59, 0 );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" );
- TEST_SUPPORT.PRINT_TIME(
- "TA1 - clock_set - ",
- TIME,
- " - SUCCESSFUL"
- );
- TEXT_IO.NEW_LINE;
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET SUCCESSFUL" );
- TEST_SUPPORT.PRINT_TIME(
- "TA1 - clock_get - ",
- TIME,
- " - SUCCESSFUL"
- );
- TEXT_IO.NEW_LINE;
-
- end SCREEN_13;
-
---PAGE
---
--- SCREEN_14
---
-
- procedure SCREEN_14
- is
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TIMER_CREATE( 0, SPTEST.JUNK_ID, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "TIMER_CREATE WITH ILLEGAL NAME"
- );
- TEXT_IO.PUT_LINE( "TA1 - timer_create - INVALID_NAME" );
-
- RTEMS.TIMER_CREATE(
- SPTEST.TIMER_NAME( 1 ),
- SPTEST.TIMER_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" );
- TEXT_IO.PUT_LINE( "TA1 - timer_create - 1 - SUCCESSFUL" );
-
- RTEMS.TIMER_CREATE(
- SPTEST.TIMER_NAME( 1 ),
- SPTEST.JUNK_ID,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.TOO_MANY,
- "TIMER_CREATE FOR TOO MANY"
- );
- TEXT_IO.PUT_LINE( "TA1 - timer_create - 2 - TOO_MANY" );
-
- RTEMS.TIMER_DELETE( 100, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TIMER_DELETE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - timer_delete - local INVALID_ID" );
-
- RTEMS.TIMER_DELETE( 16#10100#, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TIMER_DELETE WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - timer_delete - global INVALID_ID" );
-
- RTEMS.TIMER_IDENT( 0, SPTEST.JUNK_ID, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NAME,
- "TIMER_IDENT WITH ILLEGAL NAME"
- );
- TEXT_IO.PUT_LINE( "TA1 - timer_ident - INVALID_NAME" );
-
- RTEMS.TIMER_CANCEL( 16#10100#, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TIMER_CANCEL WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - timer_cancel - INVALID_ID" );
-
- RTEMS.TIMER_RESET( 16#10100#, STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TIMER_RESET WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - timer_reset - INVALID_ID" );
-
- RTEMS.TIMER_RESET( SPTEST.TIMER_ID( 1 ), STATUS );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.NOT_DEFINED,
- "TIMER_RESET BEFORE INITIATED"
- );
- TEXT_IO.PUT_LINE( "TA1 - timer_reset - NOT_DEFINED" );
-
- RTEMS.TIMER_FIRE_AFTER(
- 16#10100#,
- 5 * TEST_SUPPORT.TICKS_PER_SECOND,
- SPTEST.DELAYED_SUBPROGRAM'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TIMER_FIRE_AFTER WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - timer_fire_after - INVALID_ID" );
-
- TIME := ( 1994, 12, 31, 1, 0, 0, 0 );
- RTEMS.TIMER_FIRE_WHEN(
- 16#10100#,
- TIME,
- SPTEST.DELAYED_SUBPROGRAM'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_ID,
- "TIMER_FIRE_WHEN WITH ILLEGAL ID"
- );
- TEXT_IO.PUT_LINE( "TA1 - timer_fire_when - INVALID_ID" );
-
- RTEMS.TIMER_FIRE_AFTER(
- SPTEST.TIMER_ID( 1 ),
- 0,
- SPTEST.DELAYED_SUBPROGRAM'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NUMBER,
- "TIMER_FIRE_AFTER WITH 0 TICKS"
- );
- TEXT_IO.PUT_LINE( "TA1 - timer_fire_after - INVALID_NUMBER" );
-
- TIME := ( 1987, 2, 5, 8, 30, 45, 0 );
- RTEMS.TIMER_FIRE_WHEN(
- SPTEST.TIMER_ID( 1 ),
- TIME,
- SPTEST.DELAYED_SUBPROGRAM'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_CLOCK,
- "TIMER_FIRE_WHEN WITH ILLEGAL TIME"
- );
- TEST_SUPPORT.PRINT_TIME(
- "TA1 - timer_fire_when - ",
- TIME,
- " - INVALID_CLOCK"
- );
- TEXT_IO.NEW_LINE;
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET SUCCESSFUL" );
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get - ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- TIME := ( 1990, 2, 5, 8, 30, 45, 0 );
- RTEMS.TIMER_FIRE_WHEN(
- SPTEST.TIMER_ID( 1 ),
- TIME,
- SPTEST.DELAYED_SUBPROGRAM'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_CLOCK,
- "TIMER_FIRE_WHEN BEFORE CURRENT TIME"
- );
- TEST_SUPPORT.PRINT_TIME(
- "TA1 - timer_fire_when - ",
- TIME,
- " - before INVALID_CLOCK"
- );
- TEXT_IO.NEW_LINE;
-
- end SCREEN_14;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- SPTEST.SCREEN_1;
- TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 2 );
-
- SPTEST.SCREEN_2;
- TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 3 );
-
- SPTEST.SCREEN_3;
- TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 4 );
-
- SPTEST.SCREEN_4;
- TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 5 );
-
- SPTEST.SCREEN_5;
- TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 6 );
-
- SPTEST.SCREEN_6;
- TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 7 );
-
- SPTEST.SCREEN_7;
- TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 8 );
-
- SPTEST.SCREEN_8;
- TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 9 );
-
- SPTEST.SCREEN_9;
- TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 10 );
-
- SPTEST.SCREEN_10;
- TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 11 );
-
- SPTEST.SCREEN_11;
- TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 12 );
-
- SPTEST.SCREEN_12;
- TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 13 );
-
- SPTEST.SCREEN_13;
- TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 14 );
-
- SPTEST.SCREEN_14;
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 9 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "TA2 - semaphore_obtain - sem 1 - WAIT FOREVER" );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.OBJECT_WAS_DELETED,
- "SEMAPHORE_OBTAIN WAITING TO BE DELETED"
- );
- TEXT_IO.PUT_LINE(
- "TA2 - semaphore_obtain - woke up with OBJECT_WAS_DELETED"
- );
-
- TEXT_IO.PUT_LINE(
- "TA2 - task_delete - delete self - SUCCESSFUL"
- );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" );
-
- end TASK_2;
-
---PAGE
---
--- TASK_3
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : SPTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- TEXT_IO.PUT_LINE(
- "TA3 - message_queue_receive - Q 1 - WAIT FOREVER"
- );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.OBJECT_WAS_DELETED,
- "MESSAGE_QUEUE_RECEIVE WAITING TO BE DELETED"
- );
- TEXT_IO.PUT( "TA3 - message_queue_receive - woke up " );
- TEXT_IO.PUT_LINE( "with OBJECT_WAS_DELETED" );
-
- TEXT_IO.PUT_LINE(
- "TA3 - task_delete - delete self - SUCCESSFUL"
- );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" );
-
- end TASK_3;
-
---PAGE
---
--- TASK_4
---
-
- procedure TASK_4 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.RATE_MONOTONIC_CANCEL(
- SPTEST.PERIOD_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.NOT_OWNER_OF_RESOURCE,
- "RATE_MONOTONIC_CANCEL NOT THE OWNER"
- );
- TEXT_IO.PUT_LINE(
- "TA4 - rate_monotonic_cancel - NOT_OWNER_OF_RESOURCE"
- );
-
- RTEMS.RATE_MONOTONIC_PERIOD(
- SPTEST.PERIOD_ID( 1 ),
- 5,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.NOT_OWNER_OF_RESOURCE,
- "RATE_MONOTONIC_PERIOD NOT THE OWNER"
- );
- TEXT_IO.PUT_LINE(
- "TA4 - rate_monotonic_period - NOT_OWNER_OF_RESOURCE"
- );
-
- TEXT_IO.PUT_LINE(
- "TA4 - task_delete - delete self - SUCCESSFUL"
- );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA4" );
-
-
- end TASK_4;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp09/sptest.ads b/c/src/ada-tests/sptests/sp09/sptest.ads
deleted file mode 100644
index 526b30be67..0000000000
--- a/c/src/ada-tests/sptests/sp09/sptest.ads
+++ /dev/null
@@ -1,402 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 9 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SYSTEM;
-with System.Storage_Elements;
-
-package SPTEST is
-
---
--- Buffer Record similar to that used by RTEMS 3.2.1. Using this
--- avoids changes to the test.
---
-
- type BUFFER is
- record
- FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
- FIELD2 : RTEMS.UNSIGNED32;
- FIELD3 : RTEMS.UNSIGNED32;
- FIELD4 : RTEMS.UNSIGNED32;
- end record;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 11 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 11 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS timers created
--- by this test.
---
-
- TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID;
- TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS semaphores created
--- by this test.
---
-
- SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS message queues
--- created by this test.
---
-
- QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS partitions created
--- by this test.
---
-
- PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID;
- PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS regions created
--- by this test.
---
-
- REGION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID;
- REGION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS ports created
--- by this test.
---
-
- PORT_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID;
- PORT_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS periods created
--- by this test.
---
-
- PERIOD_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID;
- PERIOD_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME;
-
---
--- This variable is used as the output ID on directives which return
--- an ID but are invoked in a manner which returns a non-SUCCESSFUL
--- status code.
---
-
- JUNK_ID : RTEMS.ID;
-
---
--- The following area defines a memory area to be used as the
--- internal address space of the port.
---
-
- INTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
- System.Storage_Elements.To_Address(16#00001000#);
-
- INTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for INTERNAL_PORT_AREA use at INTERNAL_PORT_AREA_ADDRESS;
-
---
--- The following area defines a memory area to be used as the
--- external address space of the port.
---
-
- EXTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
- System.Storage_Elements.To_Address(16#00002000#);
-
- EXTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for EXTERNAL_PORT_AREA use at EXTERNAL_PORT_AREA_ADDRESS;
-
---
--- The following area defines a memory area to be used as the
--- memory space for a partition.
---
-
- PARTITION_GOOD_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for PARTITION_GOOD_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
---
--- The following area defines a memory area to be used as the
--- memory space for a partition which starts at an invalid address.
---
-
- PARTITION_BAD_AREA_ADDRESS : constant System.Address :=
- System.Storage_Elements.To_Address(16#00000006#);
-
- PARTITION_BAD_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for PARTITION_BAD_AREA use at PARTITION_BAD_AREA_ADDRESS;
-
---
--- The following area defines a memory area to be used as the
--- memory space for a region and constants used to define the regions
--- starting area and length.
---
-
- REGION_GOOD_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 4095 )
- of RTEMS.UNSIGNED32;
- for REGION_GOOD_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
- REGION_START_OFFSET : constant RTEMS.UNSIGNED32 := 1024;
- REGION_LENGTH : constant RTEMS.UNSIGNED32 := 512;
-
---
--- The following area defines a memory area to be used as the
--- memory space for a region which starts at an invalid address.
---
-
- REGION_BAD_AREA_ADDRESS : constant System.Address :=
- System.Storage_Elements.To_Address(16#00000006#);
-
- REGION_BAD_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for REGION_BAD_AREA use at REGION_BAD_AREA_ADDRESS;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- DELAYED_SUBPROGRAM
---
--- DESCRIPTION:
---
--- This subprogram is scheduled as a timer service routine.
--- It performs no actions if it fires.
---
-
- procedure DELAYED_SUBPROGRAM (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests numerous error conditions.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task tests numerous error conditions.
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_3
---
--- DESCRIPTION:
---
--- This RTEMS task tests numerous error conditions.
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_4
---
--- DESCRIPTION:
---
--- This RTEMS task tests numerous error conditions.
---
-
- procedure TASK_4 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- SERVICE_ROUTINE
---
--- DESCRIPTION:
---
--- This subprogram serves as a dummy ISR which is installed at an
--- illegal vector number.
---
-
- procedure SERVICE_ROUTINE (
- IGNORED : in RTEMS.VECTOR_NUMBER
- );
-
---
--- SCREEN_1
---
--- DESCRIPTION:
---
--- This subprogram processes the a single output screen of this test.
---
-
- procedure SCREEN_1;
-
---
--- SCREEN_2
---
--- DESCRIPTION:
---
--- This subprogram processes the a single output screen of this test.
---
-
- procedure SCREEN_2;
-
---
--- SCREEN_3
---
--- DESCRIPTION:
---
--- This subprogram processes the a single output screen of this test.
---
-
- procedure SCREEN_3;
-
---
--- SCREEN_4
---
--- DESCRIPTION:
---
--- This subprogram processes the a single output screen of this test.
---
-
- procedure SCREEN_4;
-
---
--- SCREEN_5
---
--- DESCRIPTION:
---
--- This subprogram processes the a single output screen of this test.
---
-
- procedure SCREEN_5;
-
---
--- SCREEN_6
---
--- DESCRIPTION:
---
--- This subprogram processes the a single output screen of this test.
---
-
- procedure SCREEN_6;
-
---
--- SCREEN_7
---
--- DESCRIPTION:
---
--- This subprogram processes the a single output screen of this test.
---
-
- procedure SCREEN_7;
-
---
--- SCREEN_8
---
--- DESCRIPTION:
---
--- This subprogram processes the a single output screen of this test.
---
-
- procedure SCREEN_8;
-
---
--- SCREEN_9
---
--- DESCRIPTION:
---
--- This subprogram processes the a single output screen of this test.
---
-
- procedure SCREEN_9;
-
---
--- SCREEN_10
---
--- DESCRIPTION:
---
--- This subprogram processes the a single output screen of this test.
---
-
- procedure SCREEN_10;
-
---
--- SCREEN_11
---
--- DESCRIPTION:
---
--- This subprogram processes the a single output screen of this test.
---
-
- procedure SCREEN_11;
-
---
--- SCREEN_12
---
--- DESCRIPTION:
---
--- This subprogram processes the a single output screen of this test.
---
-
- procedure SCREEN_12;
-
---
--- SCREEN_13
---
--- DESCRIPTION:
---
--- This subprogram processes the a single output screen of this test.
---
-
- procedure SCREEN_13;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp11/config.h b/c/src/ada-tests/sptests/sp11/config.h
deleted file mode 100644
index 89529d5b9f..0000000000
--- a/c/src/ada-tests/sptests/sp11/config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 6
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp11/sp11.adb b/c/src/ada-tests/sptests/sp11/sp11.adb
deleted file mode 100644
index 1720830ded..0000000000
--- a/c/src/ada-tests/sptests/sp11/sp11.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP11 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP11 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP11;
-
diff --git a/c/src/ada-tests/sptests/sp11/sp11.scn b/c/src/ada-tests/sptests/sp11/sp11.scn
deleted file mode 100644
index a23db839bc..0000000000
--- a/c/src/ada-tests/sptests/sp11/sp11.scn
+++ /dev/null
@@ -1,74 +0,0 @@
-*** TEST 11 ***
-TA1 - event_send - send EVENT_16 to TA2
-TA1 - event_receive - waiting forever on EVENT_14 and EVENT_15
-TA2 - event_receive - waiting forever on EVENT_16
-TA2 - EVENT_16 received - eventout => 16#10000#
-TA2 - event_send - send EVENT_14 and EVENT_15 to TA1
-TA2 - event_receive - waiting forever on EVENT_17 or EVENT_18 - EVENT_ANY
-TA1 - EVENT_14 and EVENT_15 received - eventout => 16#C000#
-TA1 - event_send - send EVENT_18 to TA2
-TA1 - event_receive - waiting with 10 second timeout on EVENT_14
-TA2 - EVENT_17 or EVENT_18 received - eventout => 16#40000#
-TA2 - event_send - send EVENT_14 to TA1
-TA2 - clock_set - 8:15: 0 2/12/1988
-TA2 - event_send - sending EVENT_10 to self after 5 seconds
-TA2 - event_receive - waiting forever on EVENT_10
-TA1 - EVENT_14 received - eventout => 16#4000#
-TA1 - event_send - send EVENT_19 to TA2
-TA1 - clock_get - 8:15: 0 2/12/1988
-<pause>
-TA1 - event_send - send EVENT_18 to self after 5 seconds
-TA1 - event_receive - waiting forever on EVENT_18
-TA2 - EVENT_10 received - eventout => 16#400#
-TA2 - clock_get - 8:15: 5 02/12/1988
-TA2 - event_receive - PENDING_EVENTS
-TA2 - eventout => 16#80000#
-TA2 - event_receive - EVENT_19 - NO_WAIT
-TA2 - EVENT_19 received - eventout => 16#80000#
-TA2 - task_delete - deletes self
-TA1 - EVENT_18 received - eventout => 16#40000#
-TA1 - clock_get - 8:15: 5 2/12/1988
-TA1 - event_send - send EVENT_3 to self
-TA1 - event_receive - EVENT_3 or EVENT_22 - NO_WAIT and EVENT_ANY
-TA1 - EVENT_3 received - eventout => 16#8#
-TA1 - event_send - send EVENT_4 to self
-TA1 - event_receive - waiting forever on EVENT_4 or EVENT_5 - EVENT_ANY
-TA1 - EVENT_4 received - eventout => 16#10#
-<pause>
-TA1 - event_send - send EVENT_18 to self after 5 seconds
-TA1 - timer_cancel - cancelling timer for event EVENT_18
-TA1 - event_send - send EVENT_8 to self after 60 seconds
-TA1 - event_send - send EVENT_9 to self after 60 seconds
-TA1 - event_send - send EVENT_10 to self after 60 seconds
-TA1 - timer_cancel - cancelling timer for event EVENT_8
-TA1 - clock_set - 8:15: 0 2/12/1988
-TA1 - event_send - send EVENT_1 every second
-TA1 - EVENT_1 received - eventout => 16#2# - at 8:15: 1 2/12/1988
-TA1 - EVENT_1 received - eventout => 16#2# - at 8:15: 2 2/12/1988
-TA1 - EVENT_1 received - eventout => 16#2# - at 8:15: 3 2/12/1988
-TA1 - timer_cancel - cancelling timer for event EVENT_1
-<pause>
-TA1 - event_send - send EVENT_11 to self in 1 day
-TA1 - event_send - send EVENT_11 to self in 1 day
-TA1 - event_send - send EVENT_11 to self in 2 days
-TA1 - timer_cancel - cancelling EVENT_11 to self in 1 day
-TA1 - timer_cancel - cancelling EVENT_11 to self in 2 days
-TA1 - event_send - resending EVENT_11 to self in 2 days
-TA1 - clock_set - 8:15: 3 2/15/1988
-TA1 - event_receive - waiting forever on EVENT_11
-TA1 - EVENT_11 received - eventout => 16#800#
-<pause>
-TA1 - event_send/event_receive combination
-TA1 - clock_set - 8:15: 0 2/12/1988
-TA1 - event_receive all outstanding events
-TA1 - event_send - send EVENT_10 to self in 1 day
-TA1 - event_send - send EVENT_11 to self in 2 days
-TA1 - clock_set - 7:15: 0 2/12/1988
-TA1 - set time backwards
-TA1 - no events received
-TA1 - clock_set - 7:15: 0 2/14/1988
-TA1 - set time forwards (leave a timer)
-TA1 - EVENT_10 received
-TA1 - event_send - send EVENT_11 to self in 100 ticks
-TA1 - event_send - send EVENT_11 to self in 200 ticks
-*** END OF TEST 11 ***
diff --git a/c/src/ada-tests/sptests/sp11/sptest.adb b/c/src/ada-tests/sptests/sp11/sptest.adb
deleted file mode 100644
index 8ec174abe2..0000000000
--- a/c/src/ada-tests/sptests/sp11/sptest.adb
+++ /dev/null
@@ -1,900 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 11 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 11 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' );
- SPTEST.TIMER_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'M', '2', ' ' );
- SPTEST.TIMER_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'M', '3', ' ' );
- SPTEST.TIMER_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'M', '4', ' ' );
- SPTEST.TIMER_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'M', '5', ' ' );
- SPTEST.TIMER_NAME( 6 ) := RTEMS.BUILD_NAME( 'T', 'M', '6', ' ' );
-
- RTEMS.TIMER_CREATE(
- SPTEST.TIMER_NAME( 1 ),
- SPTEST.TIMER_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM1" );
-
- RTEMS.TIMER_CREATE(
- SPTEST.TIMER_NAME( 2 ),
- SPTEST.TIMER_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM2" );
-
- RTEMS.TIMER_CREATE(
- SPTEST.TIMER_NAME( 3 ),
- SPTEST.TIMER_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM3" );
-
- RTEMS.TIMER_CREATE(
- SPTEST.TIMER_NAME( 4 ),
- SPTEST.TIMER_ID( 4 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM4" );
-
- RTEMS.TIMER_CREATE(
- SPTEST.TIMER_NAME( 5 ),
- SPTEST.TIMER_ID( 5 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM5" );
-
- RTEMS.TIMER_CREATE(
- SPTEST.TIMER_NAME( 6 ),
- SPTEST.TIMER_ID( 6 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM6" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- EVENTOUT : RTEMS.EVENT_SET;
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- INDEX : RTEMS.UNSIGNED32;
- begin
-
- TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_16 to TA2" );
- RTEMS.EVENT_SEND( SPTEST.TASK_ID( 2 ), RTEMS.EVENT_16, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 16" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - event_receive - waiting forever on EVENT_14 and EVENT_15"
- );
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_14 + RTEMS.EVENT_15,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 14 and 15" );
- TEXT_IO.PUT( "TA1 - EVENT_14 and EVENT_15 received - eventout => ");
- UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_18 to TA2" );
- RTEMS.EVENT_SEND( SPTEST.TASK_ID( 2 ), RTEMS.EVENT_18, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 18" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - event_receive - waiting with 10 second timeout on EVENT_14"
- );
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_14,
- RTEMS.DEFAULT_OPTIONS,
- 10 * TEST_SUPPORT.TICKS_PER_SECOND,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 14" );
- TEXT_IO.PUT( "TA1 - EVENT_14 received - eventout => ");
- UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_19 to TA2" );
- RTEMS.EVENT_SEND( SPTEST.TASK_ID( 2 ), RTEMS.EVENT_19, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 19" );
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_GET" );
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get - ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- TEST_SUPPORT.PAUSE;
-
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - send EVENT_18 to self after 5 seconds"
- );
- RTEMS.TIMER_FIRE_AFTER(
- SPTEST.TIMER_ID( 1 ),
- 5 * TEST_SUPPORT.TICKS_PER_SECOND,
- SPTEST.TA1_SEND_18_TO_SELF_5_SECONDS'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 5 seconds" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - event_receive - waiting forever on EVENT_18"
- );
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_18,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 18" );
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_GET" );
-
- TEXT_IO.PUT( "TA1 - EVENT_18 received - eventout => ");
- UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 );
- TEXT_IO.NEW_LINE;
-
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get - ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_3 to self" );
- RTEMS.EVENT_SEND( RTEMS.SELF, RTEMS.EVENT_3, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 3" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - event_receive - EVENT_3 or EVENT_22 - NO_WAIT and EVENT_ANY"
- );
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_3 + RTEMS.EVENT_22,
- RTEMS.NO_WAIT + RTEMS.EVENT_ANY,
- RTEMS.NO_TIMEOUT,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 3 and 22" );
- TEXT_IO.PUT( "TA1 - EVENT_3 received - eventout => ");
- UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_4 to self" );
- RTEMS.EVENT_SEND( RTEMS.SELF, RTEMS.EVENT_4, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 4" );
-
- TEXT_IO.PUT_LINE(
-"TA1 - event_receive - waiting forever on EVENT_4 or EVENT_5 - EVENT_ANY"
- );
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_4 + RTEMS.EVENT_5,
- RTEMS.EVENT_ANY,
- RTEMS.NO_TIMEOUT,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 4 and 5" );
- TEXT_IO.PUT( "TA1 - EVENT_4 received - eventout => ");
- UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 );
- TEXT_IO.NEW_LINE;
-
- TEST_SUPPORT.PAUSE;
-
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - send EVENT_18 to self after 5 seconds"
- );
- RTEMS.TIMER_FIRE_AFTER(
- SPTEST.TIMER_ID( 1 ),
- 5 * TEST_SUPPORT.TICKS_PER_SECOND,
- SPTEST.TA1_SEND_18_TO_SELF_5_SECONDS'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 5 seconds" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - timer_cancel - cancelling timer for event EVENT_18"
- );
- RTEMS.TIMER_CANCEL( SPTEST.TIMER_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - send EVENT_8 to self after 60 seconds"
- );
- RTEMS.TIMER_FIRE_AFTER(
- SPTEST.TIMER_ID( 1 ),
- 60 * TEST_SUPPORT.TICKS_PER_SECOND,
- SPTEST.TA1_SEND_8_TO_SELF_60_SECONDS'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 60 secs" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - send EVENT_9 to self after 60 seconds"
- );
- RTEMS.TIMER_FIRE_AFTER(
- SPTEST.TIMER_ID( 2 ),
- 60 * TEST_SUPPORT.TICKS_PER_SECOND,
- SPTEST.TA1_SEND_9_TO_SELF_60_SECONDS'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 60 secs" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - send EVENT_10 to self after 60 seconds"
- );
- RTEMS.TIMER_FIRE_AFTER(
- SPTEST.TIMER_ID( 3 ),
- 60 * TEST_SUPPORT.TICKS_PER_SECOND,
- SPTEST.TA1_SEND_10_TO_SELF'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 60 secs" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - timer_cancel - cancelling timer for event EVENT_8"
- );
- RTEMS.TIMER_CANCEL( SPTEST.TIMER_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" );
-
- TIME := ( 1988, 2, 12, 8, 15, 0, 0 );
-
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" );
- TEXT_IO.NEW_LINE;
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - send EVENT_1 every second"
- );
- RTEMS.TIMER_FIRE_AFTER(
- SPTEST.TIMER_ID( 1 ),
- TEST_SUPPORT.TICKS_PER_SECOND,
- SPTEST.TA1_SEND_1_TO_SELF_EVERY_SECOND'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 1 SECOND" );
-
- INDEX := 0;
-
- loop
-
- exit when INDEX = 3;
-
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_1,
- RTEMS.EVENT_ANY,
- RTEMS.NO_TIMEOUT,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 1" );
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_GET" );
-
- TEXT_IO.PUT( "TA1 - EVENT_1 received - eventout => ");
- UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 );
- TEST_SUPPORT.PRINT_TIME( " - at ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- if INDEX < 2 then
- RTEMS.TIMER_RESET( SPTEST.TIMER_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 TIMER RESET" );
- end if;
-
- INDEX := INDEX + 1;
- end loop;
-
- TEXT_IO.PUT_LINE(
- "TA1 - timer_cancel - cancelling timer for event EVENT_1"
- );
- RTEMS.TIMER_CANCEL( SPTEST.TIMER_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" );
-
- TEST_SUPPORT.PAUSE;
-
- TIME.DAY := 13;
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - send EVENT_11 to self in 1 day"
- );
- RTEMS.TIMER_FIRE_WHEN(
- SPTEST.TIMER_ID( 1 ),
- TIME,
- SPTEST.TA1_SEND_11_TO_SELF'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 1 day" );
-
- TIME.HOUR := 7;
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - send EVENT_11 to self in 1 day"
- );
- RTEMS.TIMER_FIRE_WHEN(
- SPTEST.TIMER_ID( 2 ),
- TIME,
- SPTEST.TA1_SEND_11_TO_SELF'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 1 day" );
- TIME.HOUR := 8;
-
- TIME.DAY := 14;
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - send EVENT_11 to self in 2 days"
- );
- RTEMS.TIMER_FIRE_WHEN(
- SPTEST.TIMER_ID( 3 ),
- TIME,
- SPTEST.TA1_SEND_11_TO_SELF'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 2 days" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - timer_cancel - cancelling EVENT_11 to self in 1 day"
- );
- RTEMS.TIMER_CANCEL( SPTEST.TIMER_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - timer_cancel - cancelling EVENT_11 to self in 2 days"
- );
- RTEMS.TIMER_CANCEL( SPTEST.TIMER_ID( 3 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - resending EVENT_11 to self in 2 days"
- );
- RTEMS.TIMER_FIRE_WHEN(
- SPTEST.TIMER_ID( 3 ),
- TIME,
- SPTEST.TA1_SEND_11_TO_SELF'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 2 days" );
-
- TIME.DAY := 15;
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" );
- TEXT_IO.NEW_LINE;
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" );
- TEXT_IO.PUT_LINE(
- "TA1 - event_receive - waiting forever on EVENT_11"
- );
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_11,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 11" );
- TEXT_IO.PUT( "TA1 - EVENT_11 received - eventout => ");
- UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 );
- TEXT_IO.NEW_LINE;
-
- TEST_SUPPORT.PAUSE;
-
--- The following code tests the case of deleting a timer ???
-
- TEXT_IO.PUT_LINE( "TA1 - event_send/event_receive combination" );
- RTEMS.TIMER_FIRE_AFTER(
- SPTEST.TIMER_ID( 1 ),
- 10,
- SPTEST.TA1_SEND_11_TO_SELF'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 10 ticks" );
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_11,
- RTEMS.DEFAULT_OPTIONS,
- 11,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" );
-
- TIME := ( 1988, 2, 12, 8, 15, 0, 0 );
-
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" );
- TEXT_IO.NEW_LINE;
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" );
-
- TIME.DAY := 13;
- TEXT_IO.PUT_LINE(
- "TA1 - event_receive all outstanding events"
- );
- RTEMS.EVENT_RECEIVE(
- RTEMS.ALL_EVENTS,
- RTEMS.NO_WAIT + RTEMS.EVENT_ANY,
- RTEMS.NO_TIMEOUT,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.UNSATISFIED,
- "EVENT_RECEIVE all events"
- );
-
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - send EVENT_10 to self in 1 day"
- );
- RTEMS.TIMER_FIRE_WHEN(
- SPTEST.TIMER_ID( 1 ),
- TIME,
- SPTEST.TA1_SEND_10_TO_SELF'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 1 day" );
-
- TIME.DAY := 14;
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - send EVENT_11 to self in 2 days"
- );
- RTEMS.TIMER_FIRE_WHEN(
- SPTEST.TIMER_ID( 2 ),
- TIME,
- SPTEST.TA1_SEND_11_TO_SELF'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 2 days" );
-
- TIME := ( 1988, 2, 12, 7, 15, 0, 0 );
-
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" );
- TEXT_IO.NEW_LINE;
- TEXT_IO.PUT_LINE( "TA1 - set time backwards" );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" );
-
- RTEMS.EVENT_RECEIVE(
- RTEMS.ALL_EVENTS,
- RTEMS.NO_WAIT + RTEMS.EVENT_ANY,
- RTEMS.NO_TIMEOUT,
- EVENTOUT,
- STATUS
- );
- if EVENTOUT >= RTEMS.EVENT_0 then
- TEXT_IO.PUT( "ERROR - " );
- UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 );
- TEXT_IO.PUT_LINE( " events received" );
- else
- TEXT_IO.PUT_LINE( "TA1 - no events received" );
- end if;
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.UNSATISFIED,
- "EVENT_RECEIVE all events"
- );
-
- TIME := ( 1988, 2, 14, 7, 15, 0, 0 );
-
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" );
- TEXT_IO.NEW_LINE;
- TEXT_IO.PUT_LINE( "TA1 - set time forwards (leave a timer)" );
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" );
-
- RTEMS.EVENT_RECEIVE(
- RTEMS.ALL_EVENTS,
- RTEMS.NO_WAIT + RTEMS.EVENT_ANY,
- RTEMS.NO_TIMEOUT,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE all events" );
- if EVENTOUT = RTEMS.EVENT_10 then
- TEXT_IO.PUT_LINE( "TA1 - EVENT_10 received" );
- else
- TEXT_IO.PUT( "ERROR - " );
- UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 );
- TEXT_IO.PUT_LINE( " events received" );
- end if;
-
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - send EVENT_11 to self in 100 ticks"
- );
- RTEMS.TIMER_FIRE_AFTER(
- SPTEST.TIMER_ID( 1 ),
- 100,
- SPTEST.TA1_SEND_11_TO_SELF'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 100 ticks" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - event_send - send EVENT_11 to self in 200 ticks"
- );
- RTEMS.TIMER_FIRE_AFTER(
- SPTEST.TIMER_ID( 2 ),
- 100,
- SPTEST.TA1_SEND_11_TO_SELF'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 200 ticks" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 11 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- EVENTOUT : RTEMS.EVENT_SET;
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE(
- "TA2 - event_receive - waiting forever on EVENT_16"
- );
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_16,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 16" );
- TEXT_IO.PUT( "TA2 - EVENT_16 received - eventout => ");
- UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE(
- "TA2 - event_send - send EVENT_14 and EVENT_15 to TA1"
- );
- RTEMS.EVENT_SEND(
- SPTEST.TASK_ID( 1 ),
- RTEMS.EVENT_14 + RTEMS.EVENT_15,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 14 and 15" );
-
- TEXT_IO.PUT_LINE(
- "TA2 - event_receive - waiting forever on EVENT_17 or EVENT_18 - EVENT_ANY"
- );
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_17 + RTEMS.EVENT_18,
- RTEMS.EVENT_ANY,
- RTEMS.NO_TIMEOUT,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 17 and 18" );
- TEXT_IO.PUT( "TA2 - EVENT_17 or EVENT_18 received - eventout => ");
- UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE(
- "TA2 - event_send - send EVENT_14 to TA1"
- );
- RTEMS.EVENT_SEND(
- SPTEST.TASK_ID( 1 ),
- RTEMS.EVENT_14,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 14" );
-
- TIME := ( 1988, 2, 12, 8, 15, 0, 0 );
-
- TEST_SUPPORT.PRINT_TIME( "TA2 - clock_set - ", TIME, "" );
- TEXT_IO.NEW_LINE;
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA2 CLOCK_SET" );
-
- TIME.SECOND := TIME.SECOND + 5;
- TEXT_IO.PUT_LINE(
- "TA2 - event_send - sending EVENT_10 to self after 5 seconds"
- );
- RTEMS.TIMER_FIRE_WHEN(
- SPTEST.TIMER_ID( 5 ),
- TIME,
- SPTEST.TA2_SEND_10_TO_SELF'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 5 SECONDS" );
-
- TEXT_IO.PUT_LINE(
- "TA2 - event_receive - waiting forever on EVENT_10"
- );
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_10,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 10" );
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_GET" );
-
- TEXT_IO.PUT( "TA2 - EVENT_10 received - eventout => ");
- UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 );
- TEXT_IO.NEW_LINE;
-
- TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get - ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA2 - event_receive - PENDING_EVENTS" );
- RTEMS.EVENT_RECEIVE(
- RTEMS.PENDING_EVENTS,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 10" );
- TEXT_IO.PUT( "TA2 - eventout => ");
- UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE(
- "TA2 - event_receive - EVENT_19 - NO_WAIT"
- );
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_19,
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- EVENTOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 10" );
- TEXT_IO.PUT( "TA2 - EVENT_19 received - eventout => ");
- UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA2 - task_delete - deletes self" );
- RTEMS.TASK_DELETE( SPTEST.TASK_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE of TA2" );
-
- end TASK_2;
-
---PAGE
---
--- TA1_SEND_18_TO_SELF_5_SECONDS
---
-
- procedure TA1_SEND_18_TO_SELF_5_SECONDS (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- )
- is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.EVENT_SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_18, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 18" );
-
- end TA1_SEND_18_TO_SELF_5_SECONDS;
-
---PAGE
---
--- TA1_SEND_8_TO_SELF_60_SECONDS
---
-
- procedure TA1_SEND_8_TO_SELF_60_SECONDS (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- )
- is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.EVENT_SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_8, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 8" );
-
- end TA1_SEND_8_TO_SELF_60_SECONDS;
-
---PAGE
---
--- TA1_SEND_9_TO_SELF_60_SECONDS
---
-
- procedure TA1_SEND_9_TO_SELF_60_SECONDS (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- )
- is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.EVENT_SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_9, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 9" );
-
- end TA1_SEND_9_TO_SELF_60_SECONDS;
-
---PAGE
---
--- TA1_SEND_10_TO_SELF
---
-
- procedure TA1_SEND_10_TO_SELF (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- )
- is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.EVENT_SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_10, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 10" );
-
- end TA1_SEND_10_TO_SELF;
-
---PAGE
---
--- TA1_SEND_1_TO_SELF_EVERY_SECOND
---
-
- procedure TA1_SEND_1_TO_SELF_EVERY_SECOND (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- )
- is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.EVENT_SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_1, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 1" );
-
- end TA1_SEND_1_TO_SELF_EVERY_SECOND;
-
---PAGE
---
--- TA1_SEND_11_TO_SELF
---
-
- procedure TA1_SEND_11_TO_SELF (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- )
- is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.EVENT_SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_11, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 11" );
-
- end TA1_SEND_11_TO_SELF;
-
---PAGE
---
--- TA2_SEND_10_TO_SELF
---
-
- procedure TA2_SEND_10_TO_SELF (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- )
- is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.EVENT_SEND( SPTEST.TASK_ID( 2 ), RTEMS.EVENT_10, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 10" );
-
- end TA2_SEND_10_TO_SELF;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp11/sptest.ads b/c/src/ada-tests/sptests/sp11/sptest.ads
deleted file mode 100644
index c5527218f0..0000000000
--- a/c/src/ada-tests/sptests/sp11/sptest.ads
+++ /dev/null
@@ -1,178 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 11 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS timers created
--- by this test.
---
-
- TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 6 ) of RTEMS.ID;
- TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 6 ) of RTEMS.NAME;
-
---
--- TA1_SEND_18_TO_SELF_5_SECONDS
---
--- DESCRIPTION:
---
--- This subprogram is scheduled to be fired by a timer after 5 seconds
--- and to send EVENT_18 to TASK_1.
---
-
- procedure TA1_SEND_18_TO_SELF_5_SECONDS (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- TA1_SEND_8_TO_SELF_60_SECONDS
---
--- DESCRIPTION:
---
--- This subprogram is scheduled to be fired by a timer after 60 seconds
--- and to send EVENT_8 to TASK_1.
---
-
- procedure TA1_SEND_8_TO_SELF_60_SECONDS (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- TA1_SEND_9_TO_SELF_5_SECONDS
---
--- DESCRIPTION:
---
--- This subprogram is scheduled to be fired by a timer after 60 seconds
--- and to send EVENT_9 to TASK_1.
---
-
- procedure TA1_SEND_9_TO_SELF_60_SECONDS (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- TA1_SEND_10_TO_SELF
---
--- DESCRIPTION:
---
--- This subprogram is scheduled to be fired by a timer after 60 seconds
--- and to send EVENT_10 to TASK_1.
---
-
- procedure TA1_SEND_10_TO_SELF (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- TA1_SEND_1_TO_SELF_EVERY_SECOND
---
--- DESCRIPTION:
---
--- This subprogram is scheduled to be fired by a timer every second
--- and to send EVENT_1 to TASK_1 until the timer is cancelled.
---
-
- procedure TA1_SEND_1_TO_SELF_EVERY_SECOND (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- TA1_SEND_11_TO_SELF
---
--- DESCRIPTION:
---
--- This subprogram is scheduled to be fired by a timer at a
--- specific time of day and to send EVENT_11 to TASK_1.
---
-
- procedure TA1_SEND_11_TO_SELF (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- TA2_SEND_10_TO_SELF
---
--- DESCRIPTION:
---
--- This subprogram is scheduled to be fired by a timer after 5 seconds
--- and to send EVENT_10 to TASK_2.
---
-
- procedure TA2_SEND_10_TO_SELF (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Event and Timer Managers.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Event and Timer Managers.
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp12/config.h b/c/src/ada-tests/sptests/sp12/config.h
deleted file mode 100644
index 7feac09c9b..0000000000
--- a/c/src/ada-tests/sptests/sp12/config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_SEMAPHORES 10
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp12/sp12.adb b/c/src/ada-tests/sptests/sp12/sp12.adb
deleted file mode 100644
index a2edd48d5d..0000000000
--- a/c/src/ada-tests/sptests/sp12/sp12.adb
+++ /dev/null
@@ -1,58 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP12 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 Interfaces; use Interfaces;
-with RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP12 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE * 2,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP12;
-
diff --git a/c/src/ada-tests/sptests/sp12/sp12.scn b/c/src/ada-tests/sptests/sp12/sp12.scn
deleted file mode 100644
index eb0c71f372..0000000000
--- a/c/src/ada-tests/sptests/sp12/sp12.scn
+++ /dev/null
@@ -1,78 +0,0 @@
-*** TEST 12 ***
-INIT - Forward priority queue test
-PRI1 - semaphore_obtain - wait forever on SM2
-PRI2 - semaphore_obtain - wait forever on SM2
-PRI3 - semaphore_obtain - wait forever on SM2
-PRI4 - semaphore_obtain - wait forever on SM2
-PRI5 - semaphore_obtain - wait forever on SM2
-INIT - Backward priority queue test
-PRI5 - semaphore_obtain - wait forever on SM2
-PRI4 - semaphore_obtain - wait forever on SM2
-PRI3 - semaphore_obtain - wait forever on SM2
-PRI2 - semaphore_obtain - wait forever on SM2
-PRI1 - semaphore_obtain - wait forever on SM2
-<pause>
-INIT - Binary Semaphore and Priority Inheritance Test
-INIT - semaphore_create - allocated binary semaphore
-INIT - semaphore_release - allocated binary semaphore
-INIT - semaphore_delete - allocated binary semaphore
-PRI5 - semaphore_obtain - wait forever on SM2
-PRI5 - task_suspend - until all priority tasks blocked
-PDRV - priority of PRI5 is 67
-PRI4 - semaphore_obtain - wait forever on SM2
-PDRV - change priority of PRI5 from 67 to 68
-PDRV - priority of PRI5 is 67
-PRI3 - semaphore_obtain - wait forever on SM2
-PDRV - priority of PRI5 is 67
-PRI2 - semaphore_obtain - wait forever on SM2
-PDRV - priority of PRI5 is 66
-PRI1 - semaphore_obtain - wait forever on SM2
-PDRV - priority of PRI5 is 65
-PDRV - task_resume - PRI5
-PRI5 - task_delete - all tasks waiting on SM2
-PRI5 - semaphore_obtain - nested
-PRI5 - semaphore_release - nested
-PRI5 - semaphore_release - restore priority
-PRI5 - priority of PRI5 is 68
-<pause>
-TA1 - semaphore_ident - smid => 16#10001#
-TA1 - semaphore_obtain - wait forever on SM2
-TA1 - got SM2
-TA1 - semaphore_obtain - wait forever on SM3
-TA1 - got SM3
-TA1 - semaphore_obtain - get SM1 - NO_WAIT
-TA1 - got SM1
-TA1 - task_wake_after - sleep 5 seconds
-TA2 - semaphore_obtain - wait forever on SM1
-TA3 - semaphore_obtain - wait forever on SM2
-<pause>
-TA1 - semaphore_release - release SM1
-TA1 - semaphore_obtain - waiting for SM1 with 10 second timeout
-TA2 - got SM1
-TA2 - semaphore_release - release SM1
-TA2 - task_set_priority - make self highest priority task
-TA2 - semaphore_obtain - wait forever on SM2
-TA1 - got SM1
-TA1 - semaphore_release - release SM2
-TA2 - got SM2
-TA2 - semaphore_release - release SM2
-TA2 - task_delete - delete self
-TA1 - task_wake_after - sleep 5 seconds
-TA3 - got SM2
-TA3 - semaphore_release - release SM2
-TA3 - semaphore_obtain - wait forever on SM3
-<pause>
-TA1 - task_delete - delete TA3
-TA1 - task_wake_after - sleep 5 seconds
-TA4 - semaphore_obtain - wait forever on SM1
-TA5 - semaphore_obtain - wait forever on SM1
-TA1 - task_delete - delete TA4
-TA1 - semaphore_release - release SM1
-TA1 - task_wake_after - sleep 5 seconds
-TA5 - got SM1
-TA5 - semaphore_obtain - wait forever on SM1
-TA1 - semaphore_delete - delete SM1
-TA1 - semaphore_delete - delete SM3
-TA1 - task_delete - delete self
-TA5 - SM1 deleted by TA1
-*** END OF TEST 12 ***
diff --git a/c/src/ada-tests/sptests/sp12/sptest.adb b/c/src/ada-tests/sptests/sp12/sptest.adb
deleted file mode 100644
index e302dacc76..0000000000
--- a/c/src/ada-tests/sptests/sp12/sptest.adb
+++ /dev/null
@@ -1,812 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 12 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 12 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
- SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' );
- SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' );
-
- SPTEST.PRIORITY_TASK_NAME( 1 ) :=
- RTEMS.BUILD_NAME( 'P', 'R', 'I', '1' );
- SPTEST.PRIORITY_TASK_NAME( 2 ) :=
- RTEMS.BUILD_NAME( 'P', 'R', 'I', '2' );
- SPTEST.PRIORITY_TASK_NAME( 3 ) :=
- RTEMS.BUILD_NAME( 'P', 'R', 'I', '3' );
- SPTEST.PRIORITY_TASK_NAME( 4 ) :=
- RTEMS.BUILD_NAME( 'P', 'R', 'I', '4' );
- SPTEST.PRIORITY_TASK_NAME( 5 ) :=
- RTEMS.BUILD_NAME( 'P', 'R', 'I', '5' );
-
- SPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' );
- SPTEST.SEMAPHORE_NAME( 2 ) := RTEMS.BUILD_NAME( 'S', 'M', '2', ' ' );
- SPTEST.SEMAPHORE_NAME( 3 ) := RTEMS.BUILD_NAME( 'S', 'M', '3', ' ' );
-
- RTEMS.SEMAPHORE_CREATE(
- SPTEST.SEMAPHORE_NAME( 1 ),
- 1,
- RTEMS.DEFAULT_ATTRIBUTES,
- RTEMS.NO_PRIORITY,
- SPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" );
-
- RTEMS.SEMAPHORE_CREATE(
- SPTEST.SEMAPHORE_NAME( 2 ),
- 0,
- RTEMS.PRIORITY,
- RTEMS.NO_PRIORITY,
- SPTEST.SEMAPHORE_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM2" );
-
- RTEMS.SEMAPHORE_CREATE(
- SPTEST.SEMAPHORE_NAME( 3 ),
- 1,
- RTEMS.DEFAULT_ATTRIBUTES,
- RTEMS.NO_PRIORITY,
- SPTEST.SEMAPHORE_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM3" );
-
- TEXT_IO.PUT_LINE( "INIT - Forward priority queue test" );
- SPTEST.PRIORITY_TEST_DRIVER( 0 );
-
- TEXT_IO.PUT_LINE( "INIT - Backward priority queue test" );
- SPTEST.PRIORITY_TEST_DRIVER( 32 );
-
-TEST_SUPPORT.PAUSE;
-
- TEXT_IO.PUT_LINE(
- "INIT - Binary Semaphore and Priority Inheritance Test"
- );
-
- RTEMS.SEMAPHORE_DELETE( SPTEST.SEMAPHORE_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM2" );
-
- TEXT_IO.PUT_LINE(
- "INIT - semaphore_create - allocated binary semaphore"
- );
- RTEMS.SEMAPHORE_CREATE(
- SPTEST.SEMAPHORE_NAME( 2 ),
- 0,
- RTEMS.BINARY_SEMAPHORE + RTEMS.PRIORITY + RTEMS.INHERIT_PRIORITY,
- RTEMS.NO_PRIORITY,
- SPTEST.SEMAPHORE_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM2" );
-
- TEXT_IO.PUT_LINE(
- "INIT - semaphore_release - allocated binary semaphore"
- );
- RTEMS.SEMAPHORE_RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE OF SM2" );
-
- TEXT_IO.PUT_LINE(
- "INIT - semaphore_delete - allocated binary semaphore"
- );
- RTEMS.SEMAPHORE_DELETE( SPTEST.SEMAPHORE_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM2" );
-
- RTEMS.SEMAPHORE_CREATE(
- SPTEST.SEMAPHORE_NAME( 2 ),
- 1,
- RTEMS.BINARY_SEMAPHORE + RTEMS.PRIORITY + RTEMS.INHERIT_PRIORITY,
- RTEMS.NO_PRIORITY,
- SPTEST.SEMAPHORE_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM2" );
-
- SPTEST.PRIORITY_TEST_DRIVER( 64 );
-
-TEST_SUPPORT.PAUSE;
-
- RTEMS.SEMAPHORE_DELETE( SPTEST.SEMAPHORE_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM2" );
-
- RTEMS.SEMAPHORE_CREATE(
- SPTEST.SEMAPHORE_NAME( 2 ),
- 0,
- RTEMS.PRIORITY,
- RTEMS.NO_PRIORITY,
- SPTEST.SEMAPHORE_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM2" );
-
- RTEMS.SEMAPHORE_RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE OF SM2" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 3 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 3 ),
- SPTEST.TASK_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- PRIORITY_TEST_DRIVER
---
-
- procedure PRIORITY_TEST_DRIVER (
- PRIORITY_BASE : in RTEMS.UNSIGNED32
- ) is
- PREVIOUS_PRIORITY : RTEMS.TASK_PRIORITY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- for INDEX in 1 .. 5
- loop
-
- case INDEX is
- when 1 | 2 | 3 =>
- SPTEST.TASK_PRIORITY( INDEX ) :=
- PRIORITY_BASE + RTEMS.TASK_PRIORITY( INDEX );
- when others =>
- SPTEST.TASK_PRIORITY( INDEX ) := PRIORITY_BASE + 3;
- end case;
-
- RTEMS.TASK_CREATE(
- SPTEST.PRIORITY_TASK_NAME( INDEX ),
- SPTEST.TASK_PRIORITY( INDEX ),
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.PRIORITY_TASK_ID( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- end loop;
-
- if PRIORITY_BASE = 0 then
-
- for INDEX in 1 .. 5
- loop
-
- RTEMS.TASK_START(
- SPTEST.PRIORITY_TASK_ID( INDEX ),
- SPTEST.PRIORITY_TASK'ACCESS,
- RTEMS.TASK_ARGUMENT( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- else
-
- for INDEX in reverse 1 .. 5
- loop
-
- RTEMS.TASK_START(
- SPTEST.PRIORITY_TASK_ID( INDEX ),
- SPTEST.PRIORITY_TASK'ACCESS,
- RTEMS.TASK_ARGUMENT( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER LOOP" );
-
- if PRIORITY_BASE = 64 then
- if INDEX = 4 then
- RTEMS.TASK_SET_PRIORITY(
- SPTEST.PRIORITY_TASK_ID( 5 ),
- PRIORITY_BASE + 4,
- PREVIOUS_PRIORITY,
- STATUS
- );
- TEXT_IO.PUT( "PDRV - change priority of PRI5 from " );
- UNSIGNED32_IO.PUT( PREVIOUS_PRIORITY );
- TEXT_IO.PUT( " to " );
- UNSIGNED32_IO.PUT( PRIORITY_BASE + 4 );
- TEXT_IO.NEW_LINE;
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "PDRV TASK_SET_PRIORITY"
- );
- end if;
-
- RTEMS.TASK_SET_PRIORITY(
- SPTEST.PRIORITY_TASK_ID( 5 ),
- RTEMS.CURRENT_PRIORITY,
- PREVIOUS_PRIORITY,
- STATUS
- );
- TEXT_IO.PUT( "PDRV - priority of PRI5 is " );
- UNSIGNED32_IO.PUT( PREVIOUS_PRIORITY );
- TEXT_IO.NEW_LINE;
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "PDRV TASK_SET_PRIORITY"
- );
- end if;
-
- end loop;
-
- end if;
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER AFTER LOOP" );
-
- if PRIORITY_BASE = 0 then
- for INDEX in 1 .. 5
- loop
-
- RTEMS.SEMAPHORE_RELEASE(
- SPTEST.SEMAPHORE_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "SEMAPHORE_RELEASE LOOP"
- );
-
- end loop;
- end if;
-
- if PRIORITY_BASE = 64 then
-
- TEXT_IO.PUT_LINE( "PDRV - task_resume - PRI5" );
- RTEMS.TASK_RESUME( SPTEST.PRIORITY_TASK_ID( 5 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" );
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "TASK_WAKE_AFTER SO PRI5 can run"
- );
-
- RTEMS.TASK_DELETE( SPTEST.PRIORITY_TASK_ID( 5 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF PRI5" );
- else
-
- for INDEX in 1 .. 5
- loop
-
- RTEMS.TASK_DELETE(
- SPTEST.PRIORITY_TASK_ID( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE LOOP" );
-
- end loop;
- end if;
-
-
- end PRIORITY_TEST_DRIVER;
-
---PAGE
---
--- PRIORITY_TASK
---
-
- procedure PRIORITY_TASK (
- ITS_INDEX : in RTEMS.TASK_ARGUMENT
- ) is
- TIMEOUT : RTEMS.INTERVAL;
- ITS_PRIORITY : RTEMS.TASK_PRIORITY;
- CURRENT_PRIORITY : RTEMS.TASK_PRIORITY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- ITS_PRIORITY := SPTEST.TASK_PRIORITY( INTEGER( ITS_INDEX ) );
-
- if ITS_PRIORITY < 3 then
- TIMEOUT := 5 * TEST_SUPPORT.TICKS_PER_SECOND;
- else
- TIMEOUT := RTEMS.NO_TIMEOUT;
- end if;
-
- TEST_SUPPORT.PUT_NAME( PRIORITY_TASK_NAME( INTEGER(ITS_INDEX) ), FALSE );
- TEXT_IO.PUT_LINE( " - semaphore_obtain - wait forever on SM2" );
-
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 2 ),
- RTEMS.DEFAULT_OPTIONS,
- TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN OF SM2" );
-
- if ITS_PRIORITY < 64 then
- TEXT_IO.PUT( "PRI" );
- UNSIGNED32_IO.PUT( ITS_INDEX );
- TEXT_IO.PUT( " - WHY AM I HERE? (priority = " );
- UNSIGNED32_IO.PUT( ITS_PRIORITY );
- TEXT_IO.PUT_LINE( " )" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
- end if;
-
- if ITS_INDEX = 5 then
- TEXT_IO.PUT_LINE(
- "PRI5 - task_suspend - until all priority tasks blocked"
- );
- end if;
-
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" );
-
- TEXT_IO.PUT_LINE( "PRI5 - task_delete - all tasks waiting on SM2" );
- for INDEX in 1 .. 4
- loop
-
- RTEMS.TASK_DELETE( SPTEST.PRIORITY_TASK_ID( INDEX ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE LOOP" );
-
- end loop;
-
- TEXT_IO.PUT_LINE( "PRI5 - semaphore_obtain - nested" );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 2 ),
- RTEMS.DEFAULT_OPTIONS,
- TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN NESTED" );
-
- TEXT_IO.PUT_LINE( "PRI5 - semaphore_release - nested" );
- RTEMS.SEMAPHORE_RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE NESTED" );
-
- TEXT_IO.PUT_LINE( "PRI5 - semaphore_release - restore priority" );
- RTEMS.SEMAPHORE_RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" );
-
- RTEMS.TASK_SET_PRIORITY(
- SPTEST.PRIORITY_TASK_ID( 5 ),
- RTEMS.CURRENT_PRIORITY,
- CURRENT_PRIORITY,
- STATUS
- );
- TEXT_IO.PUT( "PRI5 - priority of PRI5 is " );
- UNSIGNED32_IO.PUT( CURRENT_PRIORITY );
- TEXT_IO.NEW_LINE;
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "PRI5 TASK_SET_PRIORITY CURRENT"
- );
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
-
- end PRIORITY_TASK;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- SMID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.SEMAPHORE_IDENT(
- SPTEST.SEMAPHORE_NAME( 1 ),
- RTEMS.SEARCH_ALL_NODES,
- SMID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_IDENT OF SM1" );
- TEXT_IO.PUT( "TA1 - semaphore_ident - smid => " );
- UNSIGNED32_IO.PUT( SMID, WIDTH => 8, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - wait forever on SM2" );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 2 ),
- RTEMS.DEFAULT_MODES,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM2" );
-
- TEXT_IO.PUT_LINE( "TA1 - got SM2" );
-
- TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - wait forever on SM3" );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 3 ),
- RTEMS.DEFAULT_MODES,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM3" );
-
- TEXT_IO.PUT_LINE( "TA1 - got SM3" );
-
- TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - get SM1 - NO_WAIT" );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM1" );
-
- TEXT_IO.PUT_LINE( "TA1 - got SM1" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" );
- RTEMS.TASK_WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
-TEST_SUPPORT.PAUSE;
-
- TEXT_IO.PUT_LINE( "TA1 - semaphore_release - release SM1" );
- RTEMS.SEMAPHORE_RELEASE( SPTEST.SEMAPHORE_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM1" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - semaphore_obtain - waiting for SM1 with 10 second timeout"
- );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_MODES,
- 10 * TEST_SUPPORT.TICKS_PER_SECOND,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM3" );
-
- TEXT_IO.PUT_LINE( "TA1 - got SM1" );
-
- TEXT_IO.PUT_LINE( "TA1 - semaphore_release - release SM2" );
- RTEMS.SEMAPHORE_RELEASE(
- SPTEST.SEMAPHORE_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM2" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" );
- RTEMS.TASK_WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
-TEST_SUPPORT.PAUSE;
-
- TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA3" );
- RTEMS.TASK_DELETE( SPTEST.TASK_ID( 3 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 4 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 4 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 5 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 5 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA5" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 4 ),
- SPTEST.TASK_4'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 5 ),
- SPTEST.TASK_5'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA5" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" );
- RTEMS.TASK_WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA4" );
- RTEMS.TASK_DELETE( SPTEST.TASK_ID( 4 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA4" );
-
- TEXT_IO.PUT_LINE( "TA1 - semaphore_release - release SM1" );
- RTEMS.SEMAPHORE_RELEASE(
- SPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM1" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" );
- RTEMS.TASK_WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "TA1 - semaphore_delete - delete SM1" );
- RTEMS.SEMAPHORE_DELETE( SPTEST.SEMAPHORE_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM1" );
-
- TEXT_IO.PUT_LINE( "TA1 - semaphore_delete - delete SM3" );
- RTEMS.SEMAPHORE_DELETE( SPTEST.SEMAPHORE_ID( 3 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM3" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_delete - delete self" );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA1" );
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- PREVIOUS_PRIORITY : RTEMS.TASK_PRIORITY;
- begin
-
- TEXT_IO.PUT_LINE( "TA2 - semaphore_obtain - wait forever on SM1" );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_MODES,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM1" );
-
- TEXT_IO.PUT_LINE( "TA2 - got SM1" );
-
- TEXT_IO.PUT_LINE( "TA2 - semaphore_release - release SM1" );
- RTEMS.SEMAPHORE_RELEASE(
- SPTEST.SEMAPHORE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM1" );
-
- TEXT_IO.PUT_LINE(
- "TA2 - task_set_priority - make self highest priority task"
- );
- RTEMS.TASK_SET_PRIORITY(
- RTEMS.SELF,
- 3,
- PREVIOUS_PRIORITY,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY ON TA2" );
-
- TEXT_IO.PUT_LINE( "TA2 - semaphore_obtain - wait forever on SM2" );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 2 ),
- RTEMS.DEFAULT_MODES,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM2" );
-
- TEXT_IO.PUT_LINE( "TA2 - got SM2" );
-
- TEXT_IO.PUT_LINE( "TA2 - semaphore_release - release SM2" );
- RTEMS.SEMAPHORE_RELEASE(
- SPTEST.SEMAPHORE_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM2" );
-
- TEXT_IO.PUT_LINE( "TA2 - task_delete - delete self" );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" );
-
- end TASK_2;
-
---PAGE
---
--- TASK_3
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "TA3 - semaphore_obtain - wait forever on SM2" );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 2 ),
- RTEMS.DEFAULT_MODES,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM2" );
- TEXT_IO.PUT_LINE( "TA3 - got SM2" );
-
- TEXT_IO.PUT_LINE( "TA3 - semaphore_release - release SM2" );
- RTEMS.SEMAPHORE_RELEASE(
- SPTEST.SEMAPHORE_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM2" );
-
- TEXT_IO.PUT_LINE( "TA3 - semaphore_obtain - wait forever on SM3" );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 3 ),
- RTEMS.DEFAULT_MODES,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM3" );
-
- end TASK_3;
-
---PAGE
---
--- TASK_4
---
-
- procedure TASK_4 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "TA4 - semaphore_obtain - wait forever on SM1" );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_MODES,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM1" );
-
- end TASK_4;
-
---PAGE
---
--- TASK_5
---
-
- procedure TASK_5 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "TA5 - semaphore_obtain - wait forever on SM1" );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_MODES,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM1" );
-
- TEXT_IO.PUT_LINE( "TA5 - got SM1" );
-
- TEXT_IO.PUT_LINE( "TA5 - semaphore_obtain - wait forever on SM1" );
- RTEMS.SEMAPHORE_OBTAIN(
- SPTEST.SEMAPHORE_ID( 1 ),
- RTEMS.DEFAULT_MODES,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.OBJECT_WAS_DELETED,
- "SEMAPHORE_OBTAIN ON SM1"
- );
- TEXT_IO.PUT_LINE( "TA5 - SM1 deleted by TA1" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 12 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_5;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp12/sptest.ads b/c/src/ada-tests/sptests/sp12/sptest.ads
deleted file mode 100644
index 8d75953069..0000000000
--- a/c/src/ada-tests/sptests/sp12/sptest.ads
+++ /dev/null
@@ -1,142 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 12 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 5 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 5 ) of RTEMS.NAME;
-
- PRIORITY_TASK_ID : array ( 1 .. 5 ) of RTEMS.ID;
- PRIORITY_TASK_NAME : array ( 1 .. 5 ) of RTEMS.NAME;
- TASK_PRIORITY : array ( 1 .. 5 ) of RTEMS.TASK_PRIORITY;
-
- SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- PRIORITY_TEST_DRIVER
---
--- DESCRIPTION:
---
--- This subprogram creates and starts RTEMS tasks of different priority
--- so that those tasks may exercise the priority blocking algorithm.
---
-
- procedure PRIORITY_TEST_DRIVER (
- PRIORITY_BASE : in RTEMS.UNSIGNED32
- );
-
---
--- PRIORITY_TASK
---
--- DESCRIPTION:
---
--- Copies of this RTEMS are executed at different priorities and each
--- instantiation blocks on a semaphore with priority blocking. This
--- is done to exercise the priority blocking algorithms.
---
-
- procedure PRIORITY_TASK (
- ITS_INDEX : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Semaphore Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Semaphore Manager.
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_3
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Semaphore Manager.
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_4
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Semaphore Manager.
---
-
- procedure TASK_4 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_5
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Semaphore Manager.
---
-
- procedure TASK_5 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp13/config.h b/c/src/ada-tests/sptests/sp13/config.h
deleted file mode 100644
index 7a1e3fa026..0000000000
--- a/c/src/ada-tests/sptests/sp13/config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 10
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp13/sp13.adb b/c/src/ada-tests/sptests/sp13/sp13.adb
deleted file mode 100644
index 3d19379ccd..0000000000
--- a/c/src/ada-tests/sptests/sp13/sp13.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP13 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP13 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP13;
-
diff --git a/c/src/ada-tests/sptests/sp13/sp13.scn b/c/src/ada-tests/sptests/sp13/sp13.scn
deleted file mode 100644
index ced19af55b..0000000000
--- a/c/src/ada-tests/sptests/sp13/sp13.scn
+++ /dev/null
@@ -1,66 +0,0 @@
-*** TEST 13 ***
-TA1 - message_queue_ident - qid => 16#10001#
-TA1 - message_queue_send - BUFFER 1 TO Q 1
-TA1 - message_queue_send - BUFFER 2 TO Q 1
-TA1 - task_wake_after - sleep 5 seconds
-TA2 - message_queue_receive - receive from queue 1 - NO_WAIT
-TA2 - buffer received: BUFFER 1 TO Q 1
-TA2 - message_queue_receive - receive from queue 1 - WAIT FOREVER
-TA2 - buffer received: BUFFER 2 TO Q 1
-TA2 - message_queue_receive - receive from queue 1 - WAIT FOREVER
-TA3 - message_queue_receive - receive from queue 2 - WAIT FOREVER
-TA1 - message_queue_send - BUFFER 3 TO Q 1
-TA1 - task_wake_after - sleep 5 seconds
-TA2 - buffer received: BUFFER 3 TO Q 1
-TA2 - task_set_priority - make self highest priority task
-TA2 - message_queue_receive - receive from queue 2 - WAIT FOREVER
-<pause>
-TA1 - message_queue_send - BUFFER 1 TO Q 2
-TA2 - buffer received: BUFFER 1 TO Q 2
-TA2 - message_queue_send - BUFFER 2 TO Q 2
-TA2 - message_queue_receive - receive from queue 1 - 10 second timeout
-TA1 - message_queue_receive - receive from queue 1 - 10 second timeout
-TA3 - buffer received: BUFFER 2 TO Q 2
-TA3 - message_queue_broadcast - BUFFER 3 TO Q 1
-TA2 - buffer received: BUFFER 3 TO Q 1
-TA2 - message_queue_receive - receive from queue 3 - WAIT FOREVER
-TA3 - number of tasks awakened = 2
-TA3 - message_queue_receive - receive from queue 3 - WAIT FOREVER
-TA1 - buffer received: BUFFER 3 TO Q 1
-TA1 - task_delete - delete TA2
-TA1 - message_queue_send - BUFFER 1 TO Q 3
-TA1 - task_wake_after - sleep 5 seconds
-TA3 - buffer received: BUFFER 1 TO Q 3
-TA3 - task_delete - delete self
-<pause>
-TA1 - message_queue_send - BUFFER 2 TO Q 3
-TA1 - message_queue_send - BUFFER 3 TO Q 3
-TA1 - message_queue_send - BUFFER 4 TO Q 3
-TA1 - message_queue_urgent - BUFFER 5 TO Q 3
-TA1 - message_queue_receive - receive from queue 3 - WAIT FOREVER
-TA1 - buffer received: BUFFER 5 TO Q 3
-TA1 - message_queue_receive - receive from queue 3 - WAIT FOREVER
-TA1 - buffer received: BUFFER 2 TO Q 3
-TA1 - message_queue_receive - receive from queue 3 - WAIT FOREVER
-TA1 - buffer received: BUFFER 3 TO Q 3
-TA1 - message_queue_receive - receive from queue 3 - WAIT FOREVER
-TA1 - buffer received: BUFFER 4 TO Q 3
-TA1 - message_queue_urgent - BUFFER 3 TO Q 2
-TA1 - message_queue_receive - receive from queue 2 - WAIT FOREVER
-TA1 - buffer received: BUFFER 3 TO Q 2
-<pause>
-TA1 - message_queue_delete - delete queue 1
-TA1 - message_queue_urgent - BUFFER 3 TO Q 2
-TA1 - message_queue_delete - delete queue 2
-TA1 - message_queue_flush - empty Q 3
-TA1 - 0 messages were flushed from Q 3
-TA1 - message_queue_send - BUFFER 1 TO Q 3
-TA1 - message_queue_send - BUFFER 2 TO Q 3
-TA1 - message_queue_send - BUFFER 3 TO Q 3
-TA1 - message_queue_flush - Q 3
-TA1 - 3 messages were flushed from Q 3
-TA1 - message_queue_send - until all message buffers consumed
-TA1 - message_queue_send - all message buffers consumed
-TA1 - message_queue_flush - Q 3
-TA1 - 100 messages were flushed from Q 3
-*** END OF TEST 13 ***
diff --git a/c/src/ada-tests/sptests/sp13/sptest.adb b/c/src/ada-tests/sptests/sp13/sptest.adb
deleted file mode 100644
index 9190f77e83..0000000000
--- a/c/src/ada-tests/sptests/sp13/sptest.adb
+++ /dev/null
@@ -1,723 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 13 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 13 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 3 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 3 ),
- SPTEST.TASK_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" );
-
- SPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'Q', '1', ' ', ' ' );
- SPTEST.QUEUE_NAME( 2 ) := RTEMS.BUILD_NAME( 'Q', '2', ' ', ' ' );
- SPTEST.QUEUE_NAME( 3 ) := RTEMS.BUILD_NAME( 'Q', '3', ' ', ' ' );
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- SPTEST.QUEUE_NAME( 1 ),
- 100,
- 16,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.QUEUE_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "QUEUE_CREATE OF Q1" );
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- SPTEST.QUEUE_NAME( 2 ),
- 10,
- 16,
- RTEMS.PRIORITY,
- SPTEST.QUEUE_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "QUEUE_CREATE OF Q2" );
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- SPTEST.QUEUE_NAME( 3 ),
- 100,
- 16,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.QUEUE_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "QUEUE_CREATE OF Q3" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- FILL_BUFFER
---
-
---
--- Depends on tricks to make the copy work.
---
-
- procedure FILL_BUFFER (
- SOURCE : in STRING;
- BUFFER : out SPTEST.BUFFER
- ) is
- begin
-
- BUFFER.FIELD1 := RTEMS.BUILD_NAME(
- SOURCE( SOURCE'FIRST ),
- SOURCE( SOURCE'FIRST + 1 ),
- SOURCE( SOURCE'FIRST + 2 ),
- SOURCE( SOURCE'FIRST + 3 )
- );
-
- BUFFER.FIELD2 := RTEMS.BUILD_NAME(
- SOURCE( SOURCE'FIRST + 4 ),
- SOURCE( SOURCE'FIRST + 5 ),
- SOURCE( SOURCE'FIRST + 6 ),
- SOURCE( SOURCE'FIRST + 7 )
- );
-
- BUFFER.FIELD3 := RTEMS.BUILD_NAME(
- SOURCE( SOURCE'FIRST + 8 ),
- SOURCE( SOURCE'FIRST + 9 ),
- SOURCE( SOURCE'FIRST + 10 ),
- SOURCE( SOURCE'FIRST + 11 )
- );
-
- BUFFER.FIELD4 := RTEMS.BUILD_NAME(
- SOURCE( SOURCE'FIRST + 12 ),
- SOURCE( SOURCE'FIRST + 13 ),
- SOURCE( SOURCE'FIRST + 14 ),
- SOURCE( SOURCE'FIRST + 15 )
- );
-
- end FILL_BUFFER;
-
---PAGE
---
--- PUT_BUFFER
---
-
---
--- Depends on tricks to make the output work.
---
-
- procedure PUT_BUFFER (
- BUFFER : in SPTEST.BUFFER
- ) is
- begin
-
- TEST_SUPPORT.PUT_NAME( BUFFER.FIELD1, FALSE );
- TEST_SUPPORT.PUT_NAME( BUFFER.FIELD2, FALSE );
- TEST_SUPPORT.PUT_NAME( BUFFER.FIELD3, FALSE );
- TEST_SUPPORT.PUT_NAME( BUFFER.FIELD4, FALSE );
-
- end PUT_BUFFER;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- QID : RTEMS.ID;
- BUFFER : SPTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- TIMES : RTEMS.UNSIGNED32;
- COUNT : RTEMS.UNSIGNED32;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- RTEMS.MESSAGE_QUEUE_IDENT(
- SPTEST.QUEUE_NAME( 1 ),
- RTEMS.SEARCH_ALL_NODES,
- QID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_IDENT" );
- TEXT_IO.PUT( "TA1 - message_queue_ident - qid => " );
- UNSIGNED32_IO.PUT( QID, WIDTH => 8, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- SPTEST.FILL_BUFFER( "BUFFER 1 TO Q 1 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 1 TO Q 1" );
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- SPTEST.FILL_BUFFER( "BUFFER 2 TO Q 1 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 2 TO Q 1" );
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" );
- RTEMS.TASK_WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 1 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 3 TO Q 1" );
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" );
- RTEMS.TASK_WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
-TEST_SUPPORT.PAUSE;
-
- SPTEST.FILL_BUFFER( "BUFFER 1 TO Q 2 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 1 TO Q 2" );
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 2 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- TEXT_IO.PUT(
- "TA1 - message_queue_receive - receive from queue 1 - "
- );
- TEXT_IO.PUT_LINE( "10 second timeout" );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- 10 * TEST_SUPPORT.TICKS_PER_SECOND,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
- TEXT_IO.PUT( "TA1 - buffer received: " );
- SPTEST.PUT_BUFFER( BUFFER );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA2" );
- RTEMS.TASK_DELETE( SPTEST.TASK_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" );
-
- SPTEST.FILL_BUFFER( "BUFFER 1 TO Q 3 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 1 TO Q 3" );
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 3 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" );
- RTEMS.TASK_WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
-TEST_SUPPORT.PAUSE;
-
- SPTEST.FILL_BUFFER( "BUFFER 2 TO Q 3 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 2 TO Q 3" );
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 3 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 3 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 3 TO Q 3" );
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 3 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- SPTEST.FILL_BUFFER( "BUFFER 4 TO Q 3 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 4 TO Q 3" );
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 3 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- SPTEST.FILL_BUFFER( "BUFFER 5 TO Q 3 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_urgent - BUFFER 5 TO Q 3" );
- RTEMS.MESSAGE_QUEUE_URGENT(
- SPTEST.QUEUE_ID( 3 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" );
-
- for TIMES in 1 .. 4
- loop
- TEXT_IO.PUT(
- "TA1 - message_queue_receive - receive from queue 3 - "
- );
- TEXT_IO.PUT_LINE( "WAIT FOREVER" );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- SPTEST.QUEUE_ID( 3 ),
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
- TEXT_IO.PUT( "TA1 - buffer received: " );
- SPTEST.PUT_BUFFER( BUFFER );
- TEXT_IO.NEW_LINE;
- end loop;
-
- SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 2 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_urgent - BUFFER 3 TO Q 2" );
- RTEMS.MESSAGE_QUEUE_URGENT(
- SPTEST.QUEUE_ID( 2 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" );
-
- TEXT_IO.PUT(
- "TA1 - message_queue_receive - receive from queue 2 - "
- );
- TEXT_IO.PUT_LINE( "WAIT FOREVER" );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- SPTEST.QUEUE_ID( 2 ),
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
- TEXT_IO.PUT( "TA1 - buffer received: " );
- SPTEST.PUT_BUFFER( BUFFER );
- TEXT_IO.NEW_LINE;
-
-TEST_SUPPORT.PAUSE;
-
- TEXT_IO.PUT_LINE( "TA1 - message_queue_delete - delete queue 1" );
- RTEMS.MESSAGE_QUEUE_DELETE( SPTEST.QUEUE_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" );
-
- SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 2 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_urgent - BUFFER 3 TO Q 2" );
- RTEMS.MESSAGE_QUEUE_URGENT(
- SPTEST.QUEUE_ID( 2 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" );
-
- TEXT_IO.PUT_LINE( "TA1 - message_queue_delete - delete queue 2" );
- RTEMS.MESSAGE_QUEUE_DELETE( SPTEST.QUEUE_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" );
-
- TEXT_IO.PUT_LINE( "TA1 - message_queue_flush - empty Q 3" );
- RTEMS.MESSAGE_QUEUE_FLUSH( SPTEST.QUEUE_ID( 3 ), COUNT, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" );
- TEXT_IO.PUT( "TA1 - " );
- UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 );
- TEXT_IO.PUT_LINE( " messages were flushed from Q 3" );
-
- SPTEST.FILL_BUFFER( "BUFFER 1 TO Q 3 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 1 TO Q 3" );
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 3 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- SPTEST.FILL_BUFFER( "BUFFER 2 TO Q 3 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 2 TO Q 3" );
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 3 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 3 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 3 TO Q 3" );
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 3 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- TEXT_IO.PUT_LINE( "TA1 - message_queue_flush - Q 3" );
- RTEMS.MESSAGE_QUEUE_FLUSH( SPTEST.QUEUE_ID( 3 ), COUNT, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" );
- TEXT_IO.PUT( "TA1 - " );
- UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 );
- TEXT_IO.PUT_LINE( " messages were flushed from Q 3" );
-
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_send - until all message buffers consumed"
- );
- loop
-
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 3 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
-
- exit when RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.TOO_MANY );
-
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- end loop;
-
- TEXT_IO.PUT_LINE(
- "TA1 - message_queue_send - all message buffers consumed"
- );
-
- TEXT_IO.PUT_LINE( "TA1 - message_queue_flush - Q 3" );
- RTEMS.MESSAGE_QUEUE_FLUSH( SPTEST.QUEUE_ID( 3 ), COUNT, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" );
- TEXT_IO.PUT( "TA1 - " );
- UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 );
- TEXT_IO.PUT_LINE( " messages were flushed from Q 3" );
-
- TEXT_IO.PUT( "TA1 - ERROR - " );
- UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 );
- TEXT_IO.PUT_LINE( " messages flushed" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 13 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : SPTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- PREVIOUS_PRIORITY : RTEMS.TASK_PRIORITY;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- TEXT_IO.PUT_LINE(
- "TA2 - message_queue_receive - receive from queue 1 - NO_WAIT"
- );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
- TEXT_IO.PUT( "TA2 - buffer received: " );
- SPTEST.PUT_BUFFER( BUFFER );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE(
- "TA2 - message_queue_receive - receive from queue 1 - WAIT FOREVER"
- );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
- TEXT_IO.PUT( "TA2 - buffer received: " );
- SPTEST.PUT_BUFFER( BUFFER );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE(
- "TA2 - message_queue_receive - receive from queue 1 - WAIT FOREVER"
- );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
- TEXT_IO.PUT( "TA2 - buffer received: " );
- SPTEST.PUT_BUFFER( BUFFER );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE(
- "TA2 - task_set_priority - make self highest priority task"
- );
- RTEMS.TASK_SET_PRIORITY(
- RTEMS.SELF,
- 3,
- PREVIOUS_PRIORITY,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
-
- TEXT_IO.PUT_LINE(
- "TA2 - message_queue_receive - receive from queue 2 - WAIT FOREVER"
- );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- SPTEST.QUEUE_ID( 2 ),
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
- TEXT_IO.PUT( "TA2 - buffer received: " );
- SPTEST.PUT_BUFFER( BUFFER );
- TEXT_IO.NEW_LINE;
-
- SPTEST.FILL_BUFFER( "BUFFER 2 TO Q 2 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA2 - message_queue_send - BUFFER 2 TO Q 2" );
- RTEMS.MESSAGE_QUEUE_SEND(
- SPTEST.QUEUE_ID( 2 ),
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
-
- TEXT_IO.PUT_LINE(
- "TA2 - message_queue_receive - receive from queue 1 - 10 second timeout"
- );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- 10 * TEST_SUPPORT.TICKS_PER_SECOND,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
- TEXT_IO.PUT( "TA2 - buffer received: " );
- SPTEST.PUT_BUFFER( BUFFER );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE(
- "TA2 - message_queue_receive - receive from queue 3 - WAIT FOREVER"
- );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- SPTEST.QUEUE_ID( 3 ),
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
- TEXT_IO.PUT( "TA2 - buffer received: " );
- SPTEST.PUT_BUFFER( BUFFER );
- TEXT_IO.NEW_LINE;
-
- end TASK_2;
-
---PAGE
---
--- TASK_3
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : SPTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- COUNT : RTEMS.UNSIGNED32;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- TEXT_IO.PUT_LINE(
- "TA3 - message_queue_receive - receive from queue 2 - WAIT FOREVER"
- );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- SPTEST.QUEUE_ID( 2 ),
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
- TEXT_IO.PUT( "TA3 - buffer received: " );
- SPTEST.PUT_BUFFER( BUFFER );
- TEXT_IO.NEW_LINE;
-
- SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 1 ", BUFFER );
- TEXT_IO.PUT_LINE( "TA3 - message_queue_broadcast - BUFFER 3 TO Q 1" );
- RTEMS.MESSAGE_QUEUE_BROADCAST(
- SPTEST.QUEUE_ID( 1 ),
- BUFFER_POINTER,
- 16,
- COUNT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_BROADCAST" );
- TEXT_IO.PUT( "TA3 - number of tasks awakened = " );
- UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE(
- "TA3 - message_queue_receive - receive from queue 3 - WAIT FOREVER"
- );
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- SPTEST.QUEUE_ID( 3 ),
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" );
- TEXT_IO.PUT( "TA3 - buffer received: " );
- SPTEST.PUT_BUFFER( BUFFER );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA3 - task_delete - delete self" );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end TASK_3;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp13/sptest.ads b/c/src/ada-tests/sptests/sp13/sptest.ads
deleted file mode 100644
index cf53004c3d..0000000000
--- a/c/src/ada-tests/sptests/sp13/sptest.ads
+++ /dev/null
@@ -1,132 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 13 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- Buffer Record similar to that used by RTEMS 3.2.1. Using this
--- avoids changes to the test.
---
-
- type BUFFER is
- record
- FIELD1 : RTEMS.NAME; -- TEMPORARY UNTIL VARIABLE LENGTH
- FIELD2 : RTEMS.NAME;
- FIELD3 : RTEMS.NAME;
- FIELD4 : RTEMS.NAME;
- end record;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS message
--- queues created by this test.
---
-
- QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- FILL_BUFFER
---
--- DESCRIPTION:
---
--- This subprogram takes the SOURCE input string and places
--- up to the first sixteen characters of that string into
--- the message BUFFER.
---
-
- procedure FILL_BUFFER (
- SOURCE : in STRING;
- BUFFER : out SPTEST.BUFFER
- );
-
---
--- PUT_BUFFER
---
--- DESCRIPTION:
---
--- This subprogram prints the specified message BUFFER.
---
-
- procedure PUT_BUFFER (
- BUFFER : in SPTEST.BUFFER
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Message Queue Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Message Queue Manager.
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_3
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Message Queue Manager.
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp14/config.h b/c/src/ada-tests/sptests/sp14/config.h
deleted file mode 100644
index ed43b85e09..0000000000
--- a/c/src/ada-tests/sptests/sp14/config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp14/sp14.adb b/c/src/ada-tests/sptests/sp14/sp14.adb
deleted file mode 100644
index 5f6d0819c0..0000000000
--- a/c/src/ada-tests/sptests/sp14/sp14.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP14 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP14 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP14;
-
diff --git a/c/src/ada-tests/sptests/sp14/sp14.scn b/c/src/ada-tests/sptests/sp14/sp14.scn
deleted file mode 100644
index 5f2cfd70c7..0000000000
--- a/c/src/ada-tests/sptests/sp14/sp14.scn
+++ /dev/null
@@ -1,33 +0,0 @@
-*** TEST 14 ***
-TA1 - signal_catch - INTERRUPT_LEVEL( 3 )
-TA1 - signal_send - SIGNAL_16 to self
-ASR - ENTRY - signal => 16#10000#
-ASR - EXIT - signal => 16#10000#
-TA1 - signal_send - SIGNAL_0 to self
-ASR - ENTRY - signal => 16#1#
-ASR - task_wake_after - yield processor
-TA2 - signal_send - SIGNAL_17 to TA1
-TA2 - task_wake_after - yield processor
-ASR - ENTRY - signal => 16#20000#
-ASR - EXIT - signal => 16#20000#
-ASR - EXIT - signal => 16#1#
-TA1 - signal_catch - NO_ASR
-<pause>
-TA1 - signal_send - SIGNAL_1 to self
-ASR - ENTRY - signal => 16#2#
-ASR - task_wake_after - yield processor
-TA2 - signal_send - SIGNAL_18 and SIGNAL_19 to TA1
-TA2 - task_wake_after - yield processor
-ASR - EXIT - signal => 16#2#
-ASR - ENTRY - signal => 16#C0000#
-ASR - EXIT - signal => 16#C0000#
-TA1 - task_mode - disable ASRs
-TA1 - sending signal to SELF from timer
-TA1 - waiting for signal to arrive
-TA1 - timer routine got the correct arguments
-TA1 - task_mode - enable ASRs
-ASR - ENTRY - signal => 16#8#
-ASR - EXIT - signal => 16#8#
-TA1 - signal_catch - ASR ADDRESS of NULL
-TA1 - task_delete - delete self
-*** END OF TEST 14 ***
diff --git a/c/src/ada-tests/sptests/sp14/sptest.adb b/c/src/ada-tests/sptests/sp14/sptest.adb
deleted file mode 100644
index d52d0dff15..0000000000
--- a/c/src/ada-tests/sptests/sp14/sptest.adb
+++ /dev/null
@@ -1,330 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 14 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 ADDRESS_IO;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-with INTERFACES; use INTERFACES;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 14 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE * 2,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE * 2,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' );
-
- RTEMS.TIMER_CREATE(
- SPTEST.TIMER_NAME( 1 ),
- SPTEST.TIMER_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM1" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- SIGNAL_3_TO_TASK_1
---
-
- procedure SIGNAL_3_TO_TASK_1 (
- ID : in RTEMS.ID;
- POINTER : in RTEMS.ADDRESS
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.SIGNAL_SEND( SPTEST.TASK_ID( 1 ), RTEMS.SIGNAL_3, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND of 3" );
-
- SPTEST.TIMER_GOT_THIS_ID := ID;
- SPTEST.TIMER_GOT_THIS_POINTER := POINTER;
-
- SPTEST.SIGNAL_SENT := TRUE;
-
- end SIGNAL_3_TO_TASK_1;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- PREVIOUS_MODE : RTEMS.MODE;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "TA1 - signal_catch - INTERRUPT_LEVEL( 3 )" );
- RTEMS.SIGNAL_CATCH(
- SPTEST.PROCESS_ASR'ACCESS,
- RTEMS.INTERRUPT_LEVEL( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH INTERRUPT(3)" );
-
- TEXT_IO.PUT_LINE( "TA1 - signal_send - SIGNAL_16 to self" );
- RTEMS.SIGNAL_SEND( RTEMS.SELF, RTEMS.SIGNAL_16, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "SIGNAL_SEND - SIGNAL_16 to SELF"
- );
-
- TEXT_IO.PUT_LINE( "TA1 - signal_send - SIGNAL_0 to self" );
- RTEMS.SIGNAL_SEND( RTEMS.SELF, RTEMS.SIGNAL_0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "SIGNAL_SEND - SIGNAL_0 to SELF"
- );
-
- TEXT_IO.PUT_LINE( "TA1 - signal_catch - NO_ASR" );
- RTEMS.SIGNAL_CATCH(SPTEST.PROCESS_ASR'ACCESS, RTEMS.NO_ASR, STATUS);
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH - NO_ASR" );
-
- TEST_SUPPORT.PAUSE;
-
- TEXT_IO.PUT_LINE( "TA1 - signal_send - SIGNAL_1 to self" );
- RTEMS.SIGNAL_SEND( RTEMS.SELF, RTEMS.SIGNAL_1, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "SIGNAL_SEND - SIGNAL_1 to SELF"
- );
-
- TEXT_IO.PUT_LINE( "TA1 - task_mode - disable ASRs" );
- RTEMS.TASK_MODE(
- RTEMS.NO_ASR,
- RTEMS.ASR_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
-
- SPTEST.TIMER_GOT_THIS_ID := 0;
- SPTEST.TIMER_GOT_THIS_POINTER := RTEMS.NULL_ADDRESS;
-
- TEXT_IO.PUT_LINE( "TA1 - sending signal to SELF from timer" );
- RTEMS.TIMER_FIRE_AFTER(
- SPTEST.TIMER_ID( 1 ),
- TEST_SUPPORT.TICKS_PER_SECOND / 2,
- SPTEST.SIGNAL_3_TO_TASK_1'ACCESS,
- SPTEST.TASK_1'ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" );
-
- TEXT_IO.PUT_LINE( "TA1 - waiting for signal to arrive" );
-
- SPTEST.SIGNAL_SENT := FALSE;
- SPTEST.ASR_FIRED := FALSE;
-
- loop
- exit when SPTEST.SIGNAL_SENT = TRUE;
- end loop;
-
- if SPTEST.TIMER_GOT_THIS_ID = SPTEST.TIMER_ID( 1 ) and then
- RTEMS.ARE_EQUAL(SPTEST.TIMER_GOT_THIS_POINTER,
- SPTEST.TASK_1'ADDRESS) then
-
- TEXT_IO.PUT_LINE( "TA1 - timer routine got the correct arguments" );
-
- else
-
- TEXT_IO.PUT( "TA1 - timer got (" );
- UNSIGNED32_IO.PUT( SPTEST.TIMER_GOT_THIS_ID );
- TEXT_IO.PUT( "," );
- ADDRESS_IO.PUT( SPTEST.TIMER_GOT_THIS_POINTER );
- TEXT_IO.PUT( ") instead of (" );
- UNSIGNED32_IO.PUT( SPTEST.TIMER_ID( 1 ) );
- TEXT_IO.PUT( "," );
- ADDRESS_IO.PUT( SPTEST.TASK_1'ADDRESS );
- TEXT_IO.PUT_LINE( ")!!!!" );
-
- end if;
-
- TEXT_IO.PUT_LINE( "TA1 - task_mode - enable ASRs" );
- RTEMS.TASK_MODE(
- RTEMS.ASR,
- RTEMS.ASR_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
-
- TEXT_IO.PUT_LINE( "TA1 - signal_catch - ASR ADDRESS of NULL" );
- RTEMS.SIGNAL_CATCH( NULL, RTEMS.DEFAULT_MODES, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "SIGNAL_CATCH - NULL ADDRESS"
- );
-
- TEXT_IO.PUT_LINE( "TA1 - task_delete - delete self" );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "TA2 - signal_send - SIGNAL_17 to TA1" );
- RTEMS.SIGNAL_SEND( SPTEST.TASK_ID( 1 ), RTEMS.SIGNAL_17, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "SIGNAL_SEND - SIGNAL_17 to TA1"
- );
-
- TEXT_IO.PUT_LINE( "TA2 - task_wake_after - yield processor" );
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER YIELD" );
-
- TEXT_IO.PUT_LINE(
- "TA2 - signal_send - SIGNAL_18 and SIGNAL_19 to TA1"
- );
- RTEMS.SIGNAL_SEND(
- SPTEST.TASK_ID( 1 ),
- RTEMS.SIGNAL_18 + RTEMS.SIGNAL_19,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "SIGNAL_SEND - SIGNAL_18 and SIGNAL_19 to TA1"
- );
-
- TEXT_IO.PUT_LINE( "TA2 - task_wake_after - yield processor" );
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER YIELD" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 14 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_2;
-
---PAGE
---
--- PROCESS_ASR
---
-
- procedure PROCESS_ASR (
- THE_SIGNAL_SET : in RTEMS.SIGNAL_SET
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT( "ASR - ENTRY - signal => " );
- UNSIGNED32_IO.PUT( THE_SIGNAL_SET, BASE => 16, WIDTH => 8 );
- TEXT_IO.NEW_LINE;
-
- if THE_SIGNAL_SET = RTEMS.SIGNAL_16 or else
- THE_SIGNAL_SET = RTEMS.SIGNAL_17 or else
- THE_SIGNAL_SET = RTEMS.SIGNAL_18 + RTEMS.SIGNAL_19 then
- NULL;
-
- elsif THE_SIGNAL_SET = RTEMS.SIGNAL_0 or else
- THE_SIGNAL_SET = RTEMS.SIGNAL_1 then
- TEXT_IO.PUT_LINE( "ASR - task_wake_after - yield processor" );
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "TASK_WAKE_AFTER YIELD"
- );
-
- elsif THE_SIGNAL_SET = RTEMS.SIGNAL_3 then
-
- SPTEST.ASR_FIRED := TRUE;
-
- end if;
-
- TEXT_IO.PUT( "ASR - EXIT - signal => " );
- UNSIGNED32_IO.PUT( THE_SIGNAL_SET, BASE => 16, WIDTH => 8 );
- TEXT_IO.NEW_LINE;
-
- end PROCESS_ASR;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp14/sptest.ads b/c/src/ada-tests/sptests/sp14/sptest.ads
deleted file mode 100644
index d44d9d1b9b..0000000000
--- a/c/src/ada-tests/sptests/sp14/sptest.ads
+++ /dev/null
@@ -1,131 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 14 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS timers created
--- by this test.
---
-
- TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- SIGNAL_SENT is set to TRUE to indicate that a signal set has
--- been sent from an ISR to the executing task.
---
-
- SIGNAL_SENT : BOOLEAN;
- pragma volatile( SIGNAL_SENT );
-
---
--- These hold the arguments passed to the timer service routine.
---
-
- TIMER_GOT_THIS_ID : RTEMS.ID;
- pragma volatile( TIMER_GOT_THIS_ID );
-
- TIMER_GOT_THIS_POINTER : RTEMS.ADDRESS;
- pragma volatile( TIMER_GOT_THIS_POINTER );
-
---
--- ASR_FIRED is set to TRUE to indicate that the ASR has executed
--- and was passed the correct signal set.
---
-
- ASR_FIRED : BOOLEAN;
- pragma volatile( ASR_FIRED );
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- SIGNAL_3_TO_TASK_1
---
--- DESCRIPTION:
---
--- This subprogram sends signal 3 to TASK_1.
---
-
- procedure SIGNAL_3_TO_TASK_1 (
- ID : in RTEMS.ID;
- POINTER : in RTEMS.ADDRESS
- );
-
---
--- PROCESS_ASR
---
--- DESCRIPTION:
---
--- This subprogram is an ASR for TASK_1.
---
-
- procedure PROCESS_ASR (
- THE_SIGNAL_SET : in RTEMS.SIGNAL_SET
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Signal Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Signal Manager.
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp15/config.h b/c/src/ada-tests/sptests/sp15/config.h
deleted file mode 100644
index 8325035a0e..0000000000
--- a/c/src/ada-tests/sptests/sp15/config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_PARTITIONS 2
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp15/sp15.adb b/c/src/ada-tests/sptests/sp15/sp15.adb
deleted file mode 100644
index a848d60d0b..0000000000
--- a/c/src/ada-tests/sptests/sp15/sp15.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP15 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP15 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP15;
-
diff --git a/c/src/ada-tests/sptests/sp15/sp15.scn b/c/src/ada-tests/sptests/sp15/sp15.scn
deleted file mode 100644
index a0aa0e8149..0000000000
--- a/c/src/ada-tests/sptests/sp15/sp15.scn
+++ /dev/null
@@ -1,16 +0,0 @@
-*** TEST 15 ***
-INIT - partition_create - partition 1
-INIT - partition_create - partition 2
-TA1 - partition_ident - partition 1 id = 16#10001#
-TA1 - partition_ident - partition 2 id = 16#10002#
-TA1 - partition_get_buffer - get buffer 1 from partition 1 - 16#0#
-TA1 - partition_get_buffer - get buffer 2 from partition 1 - 16#200#
-TA1 - partition_get_buffer - get buffer 1 from partition 2 - 16#0#
-TA1 - partition_get_buffer - get buffer 2 from partition 2 - 16#80#
-TA1 - partition_return_buffer - return buffer 1 to partition 1 - 16#0#
-TA1 - partition_return_buffer - return buffer 2 to partition 1 - 16#200#
-TA1 - partition_return_buffer - return buffer 1 to partition 2 - 16#0#
-TA1 - partition_return_buffer - return buffer 2 to partition 2 - 16#80#
-TA1 - partition_delete - delete partition 1
-TA1 - partition_delete - delete partition 2
-*** END OF TEST 15 ***
diff --git a/c/src/ada-tests/sptests/sp15/sptest.adb b/c/src/ada-tests/sptests/sp15/sptest.adb
deleted file mode 100644
index b4835c5210..0000000000
--- a/c/src/ada-tests/sptests/sp15/sptest.adb
+++ /dev/null
@@ -1,284 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 15 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 15 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
-
- SPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'T', '1', ' ' );
- SPTEST.PARTITION_NAME( 2 ) := RTEMS.BUILD_NAME( 'P', 'T', '2', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 4,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- TEXT_IO.PUT_LINE( "INIT - partition_create - partition 1" );
- RTEMS.PARTITION_CREATE(
- SPTEST.PARTITION_NAME( 1 ),
- AREA_1'ADDRESS,
- 4096,
- 512,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.PARTITION_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE OF PT1" );
-
- TEXT_IO.PUT_LINE( "INIT - partition_create - partition 2" );
- RTEMS.PARTITION_CREATE(
- SPTEST.PARTITION_NAME( 2 ),
- AREA_2'ADDRESS,
- 274,
- 128,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.PARTITION_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE OF PT2" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- PUT_ADDRESS_FROM_AREA_1
---
-
- procedure PUT_ADDRESS_FROM_AREA_1 (
- TO_BE_PRINTED : in RTEMS.ADDRESS
- ) is
-
- begin
-
- UNSIGNED32_IO.PUT(
- RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_1'ADDRESS ),
- WIDTH => 8,
- BASE => 16
- );
-
- end PUT_ADDRESS_FROM_AREA_1;
-
---PAGE
---
--- PUT_ADDRESS_FROM_AREA_2
---
-
- procedure PUT_ADDRESS_FROM_AREA_2 (
- TO_BE_PRINTED : in RTEMS.ADDRESS
- ) is
- begin
-
- UNSIGNED32_IO.PUT(
- RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_2'ADDRESS ),
- WIDTH => 8,
- BASE => 16
- );
-
- end PUT_ADDRESS_FROM_AREA_2;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- PTID_1 : RTEMS.ID;
- PTID_2 : RTEMS.ID;
- BUFFER_ADDRESS_1 : RTEMS.ADDRESS;
- BUFFER_ADDRESS_2 : RTEMS.ADDRESS;
- BUFFER_ADDRESS_3 : RTEMS.ADDRESS;
- BUFFER_ADDRESS_4 : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT( "TA1 - partition_ident - partition 1 id = " );
- RTEMS.PARTITION_IDENT(
- SPTEST.PARTITION_NAME( 1 ),
- RTEMS.SEARCH_ALL_NODES,
- PTID_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_IDENT OF PT1" );
- UNSIGNED32_IO.PUT( PTID_1, WIDTH => 8, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA1 - partition_ident - partition 2 id = " );
- RTEMS.PARTITION_IDENT(
- SPTEST.PARTITION_NAME( 2 ),
- RTEMS.SEARCH_ALL_NODES,
- PTID_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_IDENT OF PT2" );
- UNSIGNED32_IO.PUT( PTID_2, WIDTH => 8, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT(
- "TA1 - partition_get_buffer - get buffer 1 from partition 1 - "
- );
- RTEMS.PARTITION_GET_BUFFER(
- SPTEST.PARTITION_ID( 1 ),
- BUFFER_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( BUFFER_ADDRESS_1 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT(
- "TA1 - partition_get_buffer - get buffer 2 from partition 1 - "
- );
- RTEMS.PARTITION_GET_BUFFER(
- SPTEST.PARTITION_ID( 1 ),
- BUFFER_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( BUFFER_ADDRESS_2 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT(
- "TA1 - partition_get_buffer - get buffer 1 from partition 2 - "
- );
- RTEMS.PARTITION_GET_BUFFER(
- SPTEST.PARTITION_ID( 2 ),
- BUFFER_ADDRESS_3,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" );
- SPTEST.PUT_ADDRESS_FROM_AREA_2( BUFFER_ADDRESS_3 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT(
- "TA1 - partition_get_buffer - get buffer 2 from partition 2 - "
- );
- RTEMS.PARTITION_GET_BUFFER(
- SPTEST.PARTITION_ID( 2 ),
- BUFFER_ADDRESS_4,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" );
- SPTEST.PUT_ADDRESS_FROM_AREA_2( BUFFER_ADDRESS_4 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT(
- "TA1 - partition_return_buffer - return buffer 1 to partition 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( BUFFER_ADDRESS_1 );
- TEXT_IO.NEW_LINE;
- RTEMS.PARTITION_RETURN_BUFFER(
- SPTEST.PARTITION_ID( 1 ),
- BUFFER_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" );
-
- TEXT_IO.PUT(
- "TA1 - partition_return_buffer - return buffer 2 to partition 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( BUFFER_ADDRESS_2 );
- TEXT_IO.NEW_LINE;
- RTEMS.PARTITION_RETURN_BUFFER(
- SPTEST.PARTITION_ID( 1 ),
- BUFFER_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" );
-
- TEXT_IO.PUT(
- "TA1 - partition_return_buffer - return buffer 1 to partition 2 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_2( BUFFER_ADDRESS_3 );
- TEXT_IO.NEW_LINE;
- RTEMS.PARTITION_RETURN_BUFFER(
- SPTEST.PARTITION_ID( 2 ),
- BUFFER_ADDRESS_3,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" );
-
- TEXT_IO.PUT(
- "TA1 - partition_return_buffer - return buffer 2 to partition 2 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_2( BUFFER_ADDRESS_4 );
- TEXT_IO.NEW_LINE;
- RTEMS.PARTITION_RETURN_BUFFER(
- SPTEST.PARTITION_ID( 2 ),
- BUFFER_ADDRESS_4,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" );
-
- TEXT_IO.PUT_LINE( "TA1 - partition_delete - delete partition 1" );
- RTEMS.PARTITION_DELETE( SPTEST.PARTITION_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_DELETE OF SELF" );
-
- TEXT_IO.PUT_LINE( "TA1 - partition_delete - delete partition 2" );
- RTEMS.PARTITION_DELETE( SPTEST.PARTITION_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_DELETE OF SELF" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 15 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp15/sptest.ads b/c/src/ada-tests/sptests/sp15/sptest.ads
deleted file mode 100644
index ea22067451..0000000000
--- a/c/src/ada-tests/sptests/sp15/sptest.ads
+++ /dev/null
@@ -1,118 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 15 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS partitions created
--- by this test.
---
-
- PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays define the memory areas used for the partitions in
--- this test.
---
-
- AREA_1 : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) of RTEMS.UNSIGNED8;
- for AREA_1'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
- AREA_2 : array ( RTEMS.UNSIGNED32 range 0 .. 273 ) of RTEMS.UNSIGNED8;
- for AREA_2'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- PUT_ADDRESS_FROM_AREA_1
---
--- DESCRIPTION:
---
--- This subpgram prints the offset of the address TO_BE_PRINTED
--- from the first byte of AREA_1.
---
--- NOTE:
---
--- This subprogram is used because the actual address of AREA_1
--- varies based upon the size of the executable, the target board,
--- and the target processor.
---
-
- procedure PUT_ADDRESS_FROM_AREA_1 (
- TO_BE_PRINTED : in RTEMS.ADDRESS
- );
-
---
--- PUT_ADDRESS_FROM_AREA_2
---
--- DESCRIPTION:
---
--- This subprogram prints the offset of the address TO_BE_PRINTED
--- from the first byte of AREA_2.
---
--- NOTE:
---
--- This subprogram is used because the actual address of AREA_1
--- varies based upon the size of the executable, the target board,
--- and the target processor.
---
-
- procedure PUT_ADDRESS_FROM_AREA_2 (
- TO_BE_PRINTED : in RTEMS.ADDRESS
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Partition Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp16/config.h b/c/src/ada-tests/sptests/sp16/config.h
deleted file mode 100644
index af594bd808..0000000000
--- a/c/src/ada-tests/sptests/sp16/config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_REGIONS 4
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp16/sp16.adb b/c/src/ada-tests/sptests/sp16/sp16.adb
deleted file mode 100644
index cbdc6008ac..0000000000
--- a/c/src/ada-tests/sptests/sp16/sp16.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP16 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP16 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP16;
-
diff --git a/c/src/ada-tests/sptests/sp16/sp16.scn b/c/src/ada-tests/sptests/sp16/sp16.scn
deleted file mode 100644
index 4706729d3d..0000000000
--- a/c/src/ada-tests/sptests/sp16/sp16.scn
+++ /dev/null
@@ -1,48 +0,0 @@
-*** TEST 16 ***
-TA1 - region_ident - rnid => 16#10001#
-TA1 - region_get_segment - wait on 100 byte segment from region 2
-TA1 - got segment from region 2 - 16#F78#
-TA1 - region_get_segment - wait on 3K segment from region 3
-TA1 - got segment from region 3 - 16#3F8#
-TA1 - region_get_segment - get 3080 byte segment from region 1 - NO_WAIT
-TA1 - got segment from region 1 - 16#378#
-TA1 - task_wake_after - yield processor
-TA2 - region_get_segment - wait on 2K segment from region 1
-TA3 - region_get_segment - wait on 3968 byte segment from region 2
-<pause>
-TA1 - region_return_segment - return segment to region 1 - 16#378#
-TA1 - region_get_segment - wait 10 seconds for 3K segment from region 1
-TA2 - got segment from region 1 - 16#7F8#
-TA2 - region_return_segment - return segment to region 1 - 16#7F8#
-TA2 - task_set_priority - make self highest priority task
-TA2 - region_get_segment - wait on 3968 byte segment from region 2
-TA1 - got segment from region 1 - 16#3F8#
-TA1 - region_return_segment - return segment to region 2 - 16#F78#
-TA2 - got segment from region 2 - 16#8#
-TA2 - region_return_segment - return segment to region 2 - 16#8#
-TA2 - task_delete - delete self
-TA1 - task_wake_after - yield processor
-TA3 - got segment from region 2 - 16#8#
-TA3 - region_get_segment - wait on 2K segment from region 3
-TA1 - task_delete - delete TA3
-<pause>
-TA1 - task_wake_after - yield processor
-TA4 - region_get_segment - wait on 1.5K segment from region 1
-TA5 - region_get_segment - wait on 1.5K segment from region 1
-TA1 - region_return_segment - return segment to region 1 - 16#3F8#
-TA1 - task_wake_after - yield processor
-TA4 - got and returned 16#9F8#
-TA5 - got and returned 16#3F0#
-TA1 - region_get_segment - wait 10 seconds for 3K segment from region 1
-TA1 - got segment from region 1 - 16#3F8#
-TA1 - task_wake_after - sleep 1 second
-TA4 - region_get_segment - wait on 3K segment from region 1
-TA5 - region_get_segment - wait on 3K segment from region 1
-TA1 - task_delete - delete TA4
-TA1 - region_return_segment - return segment to region 1 - 16#3F8#
-TA1 - task_wake_after - yield processor
-TA5 - got segment from region 1 - 16#3F8#
-TA5 - region_return_segment - return segment to region 1 - 16#3F8#
-TA5 - task_delete - delete self
-TA1 - region_delete - delete region 1
-*** END OF TEST 16 ***
diff --git a/c/src/ada-tests/sptests/sp16/sptest.adb b/c/src/ada-tests/sptests/sp16/sptest.adb
deleted file mode 100644
index cfec98d82c..0000000000
--- a/c/src/ada-tests/sptests/sp16/sptest.adb
+++ /dev/null
@@ -1,686 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 16 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 16 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
- SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' );
- SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- SPTEST.BASE_PRIORITY,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- SPTEST.BASE_PRIORITY,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 3 ),
- SPTEST.BASE_PRIORITY,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 3 ),
- SPTEST.TASK_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" );
-
- SPTEST.REGION_NAME( 1 ) := RTEMS.BUILD_NAME( 'R', 'N', '1', ' ' );
- SPTEST.REGION_NAME( 2 ) := RTEMS.BUILD_NAME( 'R', 'N', '1', ' ' );
- SPTEST.REGION_NAME( 3 ) := RTEMS.BUILD_NAME( 'R', 'N', '1', ' ' );
-
- RTEMS.REGION_CREATE(
- SPTEST.REGION_NAME( 1 ),
- SPTEST.AREA_1'ADDRESS,
- 4096,
- 128,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.REGION_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN1" );
-
- RTEMS.REGION_CREATE(
- SPTEST.REGION_NAME( 2 ),
- SPTEST.AREA_2'ADDRESS,
- 4096,
- 128,
- RTEMS.PRIORITY,
- SPTEST.REGION_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN2" );
-
- RTEMS.REGION_CREATE(
- SPTEST.REGION_NAME( 3 ),
- SPTEST.AREA_3'ADDRESS,
- 4096,
- 128,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.REGION_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN3" );
-
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- PUT_ADDRESS_FROM_AREA_1
---
-
- procedure PUT_ADDRESS_FROM_AREA_1 (
- TO_BE_PRINTED : in RTEMS.ADDRESS
- ) is
-
- begin
-
- UNSIGNED32_IO.PUT(
- RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_1'ADDRESS ),
- WIDTH => 8,
- BASE => 16
- );
-
- end PUT_ADDRESS_FROM_AREA_1;
-
---PAGE
---
--- PUT_ADDRESS_FROM_AREA_2
---
-
- procedure PUT_ADDRESS_FROM_AREA_2 (
- TO_BE_PRINTED : in RTEMS.ADDRESS
- ) is
- begin
-
- UNSIGNED32_IO.PUT(
- RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_2'ADDRESS ),
- WIDTH => 8,
- BASE => 16
- );
-
- end PUT_ADDRESS_FROM_AREA_2;
-
---PAGE
---
--- PUT_ADDRESS_FROM_AREA_3
---
-
- procedure PUT_ADDRESS_FROM_AREA_3 (
- TO_BE_PRINTED : in RTEMS.ADDRESS
- ) is
- begin
-
- UNSIGNED32_IO.PUT(
- RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_3'ADDRESS ),
- WIDTH => 8,
- BASE => 16
- );
-
- end PUT_ADDRESS_FROM_AREA_3;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- RNID : RTEMS.ID;
- SEGMENT_ADDRESS_1 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_2 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_3 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_4 : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.REGION_IDENT( SPTEST.REGION_NAME( 1 ), RNID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_IDENT OF RN1" );
- TEXT_IO.PUT( "TA1 - region_ident - rnid => " );
- UNSIGNED32_IO.PUT( RNID, WIDTH => 8, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
- TEXT_IO.PUT_LINE( "100 byte segment from region 2" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 2 ),
- 100,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA1 - got segment from region 2 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_1 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
- TEXT_IO.PUT_LINE( "3K segment from region 3" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 3 ),
- 3072,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA1 - got segment from region 3 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_3( SEGMENT_ADDRESS_2 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA1 - region_get_segment - get 3080 byte segment " );
- TEXT_IO.PUT_LINE( "from region 1 - NO_WAIT" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 3080,
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_3,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_3 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" );
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
-TEST_SUPPORT.PAUSE;
-
- TEXT_IO.PUT(
- "TA1 - region_return_segment - return segment to region 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_3 );
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_3,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA1 - region_get_segment - wait 10 seconds for 3K " );
- TEXT_IO.PUT_LINE( "segment from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 3072,
- RTEMS.DEFAULT_OPTIONS,
- 10 * TEST_SUPPORT.TICKS_PER_SECOND,
- SEGMENT_ADDRESS_4,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT(
- "TA1 - region_return_segment - return segment to region 2 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_1 );
- TEXT_IO.NEW_LINE;
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 2 ),
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" );
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA3" );
- RTEMS.TASK_DELETE( SPTEST.TASK_ID( 3 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" );
-
-TEST_SUPPORT.PAUSE;
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 4 ),
- SPTEST.BASE_PRIORITY,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 4 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 5 ),
- SPTEST.BASE_PRIORITY,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 5 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA5" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 4 ),
- SPTEST.TASK_4'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 5 ),
- SPTEST.TASK_5'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA5" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" );
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT(
- "TA1 - region_return_segment - return segment to region 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 );
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_4,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" );
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT( "TA1 - region_get_segment - wait 10 seconds for 3K " );
- TEXT_IO.PUT_LINE( "segment from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 3072,
- RTEMS.DEFAULT_OPTIONS,
- 10 * TEST_SUPPORT.TICKS_PER_SECOND,
- SEGMENT_ADDRESS_4,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 1 second" );
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA4" );
- RTEMS.TASK_DELETE( SPTEST.TASK_ID( 4 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA4" );
-
- TEXT_IO.PUT(
- "TA1 - region_return_segment - return segment to region 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 );
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_4,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" );
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT_LINE( "TA1 - region_delete - delete region 1" );
- RTEMS.REGION_DELETE( SPTEST.REGION_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_DELETE OF RN1" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 16 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- PREVIOUS_PRIORITY : RTEMS.TASK_PRIORITY;
- SEGMENT_ADDRESS_1 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_2 : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT( "TA2 - region_get_segment - wait on 2K segment " );
- TEXT_IO.PUT_LINE( "from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 2048,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA2 - got segment from region 1 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT(
- "TA2 - region_return_segment - return segment to region 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 );
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA2 - task_set_priority - make self " );
- TEXT_IO.PUT_LINE( "highest priority task" );
- RTEMS.TASK_SET_PRIORITY(
- RTEMS.SELF,
- SPTEST.BASE_PRIORITY - 1,
- PREVIOUS_PRIORITY,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
-
- TEXT_IO.PUT(
- "TA2 - region_get_segment - wait on 3968 byte segment "
- );
- TEXT_IO.PUT_LINE( "from region 2" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 2 ),
- 3968,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA2 - got segment from region 2 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_2 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT(
- "TA2 - region_return_segment - return segment to region 2 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_2 );
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 2 ),
- SEGMENT_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA2 - task_delete - delete self" );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" );
-
- end TASK_2;
-
---PAGE
---
--- TASK_3
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- SEGMENT_ADDRESS_1 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_2 : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT( "TA3 - region_get_segment - wait on 3968 byte segment " );
- TEXT_IO.PUT_LINE( "from region 2" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 2 ),
- 3968,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA3 - got segment from region 2 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_1 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA3 - region_get_segment - wait on 2K segment " );
- TEXT_IO.PUT_LINE( "from region 3" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 3 ),
- 2048,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
-
- end TASK_3;
-
---PAGE
---
--- TASK_4
---
-
- procedure TASK_4 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- SEGMENT_ADDRESS_1 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_2 : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT( "TA4 - region_get_segment - wait on 1.5K segment " );
- TEXT_IO.PUT_LINE( "from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 1536,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
-
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.PUT( "TA4 - got and returned " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 );
- TEXT_IO.NEW_LINE;
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT( "TA4 - region_get_segment - wait on 3K segment " );
- TEXT_IO.PUT_LINE( "from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 3072,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
-
- end TASK_4;
-
---PAGE
---
--- TASK_5
---
-
- procedure TASK_5 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- SEGMENT_ADDRESS_1 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_2 : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT( "TA5 - region_get_segment - wait on 1.5K segment " );
- TEXT_IO.PUT_LINE( "from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 1536,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
-
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.PUT( "TA5 - got and returned " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 );
- TEXT_IO.NEW_LINE;
-
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TEXT_IO.PUT( "TA5 - region_get_segment - wait on 3K segment " );
- TEXT_IO.PUT_LINE( "from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 3072,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA5 - got segment from region 1 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_2 );
- TEXT_IO.NEW_LINE;
-
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.PUT(
- "TA5 - region_return_segment - return segment to region 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_2 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA5 - task_delete - delete self" );
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA5" );
-
- end TASK_5;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp16/sptest.ads b/c/src/ada-tests/sptests/sp16/sptest.ads
deleted file mode 100644
index a9a8df0881..0000000000
--- a/c/src/ada-tests/sptests/sp16/sptest.ads
+++ /dev/null
@@ -1,195 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 16 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 5 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 5 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS regions created
--- by this test.
---
-
- REGION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- REGION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- The following constant defines the priority of most of the
--- RTEMS tasks in this test. This allows one of the tasks to
--- easily set itself to a higher priority than the rest.
---
-
- BASE_PRIORITY : constant RTEMS.TASK_PRIORITY := 140;
-
---
--- These arrays define the memory areas used for the regions in
--- this test.
---
-
- AREA_1 : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) of RTEMS.UNSIGNED8;
- for AREA_1'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
- AREA_2 : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) of RTEMS.UNSIGNED8;
- for AREA_2'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
- AREA_3 : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) of RTEMS.UNSIGNED8;
- for AREA_3'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- PUT_ADDRESS_FROM_AREA_1
---
--- DESCRIPTION:
---
--- This subprogram prints the offset of the address TO_BE_PRINTED
--- from the first byte of AREA_1.
---
--- NOTE:
---
--- This subprogram is used because the actual address of AREA_1
--- varies based upon the size of the executable, the target board,
--- and the target processor.
---
-
- procedure PUT_ADDRESS_FROM_AREA_1 (
- TO_BE_PRINTED : in RTEMS.ADDRESS
- );
-
---
--- PUT_ADDRESS_FROM_AREA_2
---
--- DESCRIPTION:
---
--- This subprogram prints the offset of the address TO_BE_PRINTED
--- from the first byte of AREA_2.
---
--- NOTE:
---
--- This subprogram is used because the actual address of AREA_2
--- varies based upon the size of the executable, the target board,
--- and the target processor.
---
-
- procedure PUT_ADDRESS_FROM_AREA_2 (
- TO_BE_PRINTED : in RTEMS.ADDRESS
- );
-
---
--- PUT_ADDRESS_FROM_AREA_3
---
--- DESCRIPTION:
---
--- This subprogram prints the offset of the address TO_BE_PRINTED
--- from the first byte of AREA_3.
---
--- NOTE:
---
--- This subprogram is used because the actual address of AREA_3
--- varies based upon the size of the executable, the target board,
--- and the target processor.
---
-
- procedure PUT_ADDRESS_FROM_AREA_3 (
- TO_BE_PRINTED : in RTEMS.ADDRESS
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Region Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Region Manager.
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_3
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Region Manager.
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_4
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Region Manager.
---
-
- procedure TASK_4 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_5
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Region Manager.
---
-
- procedure TASK_5 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp17/config.h b/c/src/ada-tests/sptests/sp17/config.h
deleted file mode 100644
index 1e70e8d7b2..0000000000
--- a/c/src/ada-tests/sptests/sp17/config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(25)
-#define CONFIGURE_TICKS_PER_TIMESLICE 1000
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp17/sp17.adb b/c/src/ada-tests/sptests/sp17/sp17.adb
deleted file mode 100644
index 1a0a317af7..0000000000
--- a/c/src/ada-tests/sptests/sp17/sp17.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP17 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP17 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP17;
-
diff --git a/c/src/ada-tests/sptests/sp17/sp17.scn b/c/src/ada-tests/sptests/sp17/sp17.scn
deleted file mode 100644
index 887284d877..0000000000
--- a/c/src/ada-tests/sptests/sp17/sp17.scn
+++ /dev/null
@@ -1,8 +0,0 @@
-*** TEST 17 ***
-TA2 - Suspending self
-TA1 - signal_catch: initializing signal catcher
-TA1 - Sending signal to self
-TA2 - signal_return preempted correctly
-TA1 - TA2 correctly preempted me
-TA1 - Got Back!!!
-*** END OF TEST 17 ***
diff --git a/c/src/ada-tests/sptests/sp17/sptest.adb b/c/src/ada-tests/sptests/sp17/sptest.adb
deleted file mode 100644
index b1bbc26b3d..0000000000
--- a/c/src/ada-tests/sptests/sp17/sptest.adb
+++ /dev/null
@@ -1,173 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 17 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 17 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
-
- SPTEST.TASK_2_PREEMPTED := FALSE;
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 2,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 2 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 2 ),
- SPTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- PROCESS_ASR
---
-
- procedure PROCESS_ASR (
- SIGNALS : in RTEMS.SIGNAL_SET
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_RESUME( SPTEST.TASK_ID( 2 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "ASR - TASK_RESUME OF TA2" );
-
- end PROCESS_ASR;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "TA1 - signal_catch: initializing signal catcher" );
- RTEMS.SIGNAL_CATCH(
- SPTEST.PROCESS_ASR'ACCESS,
- RTEMS.NO_ASR + RTEMS.NO_PREEMPT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" );
-
- TEXT_IO.PUT_LINE( "TA1 - Sending signal to self" );
- RTEMS.SIGNAL_SEND(
- SPTEST.TASK_ID( 1 ),
- RTEMS.SIGNAL_16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" );
-
- if SPTEST.TASK_2_PREEMPTED = TRUE then
- TEXT_IO.PUT_LINE( "TA1 - TA2 correctly preempted me" );
- end if;
-
- TEXT_IO.PUT_LINE( "TA1 - Got Back!!!" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 17 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- SPTEST.TASK_2_PREEMPTED := FALSE;
-
- TEXT_IO.PUT_LINE( "TA2 - Suspending self" );
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" );
-
- TEXT_IO.PUT_LINE( "TA2 - signal_return preempted correctly" );
-
- SPTEST.TASK_2_PREEMPTED := TRUE;
-
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" );
-
- end TASK_2;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp17/sptest.ads b/c/src/ada-tests/sptests/sp17/sptest.ads
deleted file mode 100644
index e6dc2040d5..0000000000
--- a/c/src/ada-tests/sptests/sp17/sptest.ads
+++ /dev/null
@@ -1,93 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 17 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- The following is set to TRUE by TASK_2 when it preempts TASK_1.
---
-
- TASK_2_PREEMPTED : STANDARD.BOOLEAN;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- PROCESS_ASR
---
--- DESCRIPTION:
---
--- This subprogram is the ASR for TASK_1.
---
-
- procedure PROCESS_ASR (
- SIGNALS : in RTEMS.SIGNAL_SET
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests that when the transfer from the task
--- to the ASR (and vice-versa) is performed, that the new mode
--- is taken into account. If this occurs, then TASK_2 will be
--- able to preempt upon completion of the ASR of TASK_1.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task is designed to preempt TASK_1.
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp19/README b/c/src/ada-tests/sptests/sp19/README
deleted file mode 100644
index 07d60c5bc4..0000000000
--- a/c/src/ada-tests/sptests/sp19/README
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# $Id$
-#
-
-This is a "problem" test in Ada versus the C equivalent. In C,
-we used macros to :
-
- + declare a LOT of local integer and floating point variables
- + load them with values
- + check them at certain times
- + to avoid floating point operations on CPUs w/o hardware support
-
-The macros are not equivalent to subprograms doing the same thing.
-We are trying to insure that the register set is fully utilized and
-checking that it survives context switches. If the routines are
-subprograms, then calling conventions and scoping rules apply. Thus
-the variables do not exist throughout the entire life of the task
-as in the C test.
-
-It seems to point out that although the conditional compilation
-and macro capabilities of C are often abused, they do provide
-capabilities which are difficult if not impossible to mimic entirely
-with subprograms.
diff --git a/c/src/ada-tests/sptests/sp19/config.h b/c/src/ada-tests/sptests/sp19/config.h
deleted file mode 100644
index bfb614cd4e..0000000000
--- a/c/src/ada-tests/sptests/sp19/config.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp19/sp19.adb b/c/src/ada-tests/sptests/sp19/sp19.adb
deleted file mode 100644
index 61a5107332..0000000000
--- a/c/src/ada-tests/sptests/sp19/sp19.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP19 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP19 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.FLOATING_POINT,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP19;
-
diff --git a/c/src/ada-tests/sptests/sp19/sp19.scn b/c/src/ada-tests/sptests/sp19/sp19.scn
deleted file mode 100644
index 8b7feadb37..0000000000
--- a/c/src/ada-tests/sptests/sp19/sp19.scn
+++ /dev/null
@@ -1,56 +0,0 @@
-*** TEST 19 ***
-FP1 - integer base = ( 16#6000#)
-FP1 - float base = ( 6.00060E+03)
-FP1 - integer base = ( 16#6000#)
-FP1 - float base = ( 6.00060E+03)
-TA1 - integer base = ( 16#1000#)
-TA1 - clock_get - 9: 0: 0 12/31/1988
-TA2 - integer base = ( 16#2000#)
-TA2 - clock_get - 9: 0: 0 12/31/1988
-TA3 - integer base = ( 16#3000#)
-TA3 - clock_get - 9: 0: 0 12/31/1988
-TA4 - integer base = ( 16#4000#)
-TA4 - float base = ( 4.00040E+03)
-TA4 - clock_get - 9: 0: 0 12/31/1988
-TA5 - integer base = ( 16#5000#)
-TA5 - float base = ( 5.00050E+03)
-TA5 - clock_get - 9: 0: 0 12/31/1988
-TA4 - clock_get - 9: 0: 1 12/31/1988
-TA5 - clock_get - 9: 0: 1 12/31/1988
-TA4 - clock_get - 9: 0: 2 12/31/1988
-TA5 - clock_get - 9: 0: 2 12/31/1988
-TA4 - clock_get - 9: 0: 3 12/31/1988
-TA5 - clock_get - 9: 0: 3 12/31/1988
-TA4 - clock_get - 9: 0: 4 12/31/1988
-TA5 - clock_get - 9: 0: 4 12/31/1988
-TA1 - clock_get - 9: 0: 5 12/31/1988
-TA4 - clock_get - 9: 0: 5 12/31/1988
-TA5 - clock_get - 9: 0: 5 12/31/1988
-TA4 - clock_get - 9: 0: 6 12/31/1988
-TA5 - clock_get - 9: 0: 6 12/31/1988
-TA4 - clock_get - 9: 0: 7 12/31/1988
-TA5 - clock_get - 9: 0: 7 12/31/1988
-TA4 - clock_get - 9: 0: 8 12/31/1988
-TA5 - clock_get - 9: 0: 8 12/31/1988
-TA4 - clock_get - 9: 0: 9 12/31/1988
-TA5 - clock_get - 9: 0: 9 12/31/1988
-TA2 - clock_get - 9: 0:10 12/31/1988
-TA1 - clock_get - 9: 0:10 12/31/1988
-TA4 - clock_get - 9: 0:10 12/31/1988
-TA5 - clock_get - 9: 0:10 12/31/1988
-TA4 - clock_get - 9: 0:11 12/31/1988
-TA5 - clock_get - 9: 0:11 12/31/1988
-TA4 - clock_get - 9: 0:12 12/31/1988
-TA5 - clock_get - 9: 0:12 12/31/1988
-TA4 - clock_get - 9: 0:13 12/31/1988
-TA5 - clock_get - 9: 0:13 12/31/1988
-TA4 - clock_get - 9: 0:14 12/31/1988
-TA5 - clock_get - 9: 0:14 12/31/1988
-TA1 - clock_get - 9: 0:15 12/31/1988
-TA3 - clock_get - 9: 0:15 12/31/1988
-TA5 - clock_get - 9: 0:15 12/31/1988
-TA4 - clock_get - 9: 0:15 12/31/1988
-TA4 - task_delete - self
-TA5 - task_delete - TA3
-*** END OF TEST 19 ***
-
diff --git a/c/src/ada-tests/sptests/sp19/sptest.ads b/c/src/ada-tests/sptests/sp19/sptest.ads
deleted file mode 100644
index 92d65ffc3d..0000000000
--- a/c/src/ada-tests/sptests/sp19/sptest.ads
+++ /dev/null
@@ -1,102 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 19 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 6 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 6 ) of RTEMS.NAME;
-
---
--- This array contains the floating point factors used by the
--- floating point tasks in this test.
---
-
- FP_FACTORS : array ( RTEMS.UNSIGNED32 range 0 .. 9 ) of FLOAT;
-
---
--- This array contains the integer factors used by the
--- integer tasks in this test.
---
-
- INTEGER_FACTORS : array ( RTEMS.UNSIGNED32 range 0 .. 9 ) of
- RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- FIRST_FP_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task tests the restart and deletion of floating point tasks.
---
-
- procedure FIRST_FP_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- FP_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task tests the basic capabilities of a floating point
--- task.
---
-
- procedure FP_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task provides a non-floating point task to test
--- that an application can utilize a mixture of floating point
--- and non-floating point tasks.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp20/config.h b/c/src/ada-tests/sptests/sp20/config.h
deleted file mode 100644
index d8e351ae1f..0000000000
--- a/c/src/ada-tests/sptests/sp20/config.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_PERIODS 10
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp20/sp20.adb b/c/src/ada-tests/sptests/sp20/sp20.adb
deleted file mode 100644
index 0bb685dc1d..0000000000
--- a/c/src/ada-tests/sptests/sp20/sp20.adb
+++ /dev/null
@@ -1,56 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP20 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP20 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 10,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP20;
-
diff --git a/c/src/ada-tests/sptests/sp20/sp20.scn b/c/src/ada-tests/sptests/sp20/sp20.scn
deleted file mode 100644
index ec21e4bdf2..0000000000
--- a/c/src/ada-tests/sptests/sp20/sp20.scn
+++ /dev/null
@@ -1,27 +0,0 @@
-*** TEST 20 ***
-TA1 - rate_monotonic_create id = 16#10001#
-TA1 - rate_monotonic_ident id = 16#10001#
-TA1 - (16#10001#) period 2
-TA2 - rate_monotonic_create id = 16#10002#
-TA2 - rate_monotonic_ident id = 16#10002#
-TA2 - (16#10002#) period 2
-TA3 - rate_monotonic_create id = 16#10003#
-TA3 - rate_monotonic_ident id = 16#10003#
-TA3 - (16#10003#) period 2
-TA4 - rate_monotonic_create id = 16#10004#
-TA4 - rate_monotonic_ident id = 16#10004#
-TA4 - (16#10004#) period 2
-TA5 - rate_monotonic_create id = 16#10005#
-TA5 - rate_monotonic_ident id = 16#10005#
-TA5 - (16#10005#) 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/c/src/ada-tests/sptests/sp20/sptest.adb b/c/src/ada-tests/sptests/sp20/sptest.adb
deleted file mode 100644
index c12bef23c0..0000000000
--- a/c/src/ada-tests/sptests/sp20/sptest.adb
+++ /dev/null
@@ -1,280 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 20 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 20 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
- SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' );
- SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' );
-
- for INDEX in 1 .. 5
- loop
-
- SPTEST.COUNT( INDEX ) := 0;
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( INDEX ),
- SPTEST.PRIORITIES( INDEX ),
- 4096,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- end loop;
-
- for INDEX in 1 .. 5
- loop
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( INDEX ),
- SPTEST.TASK_1_THROUGH_5'ACCESS,
- RTEMS.TASK_ARGUMENT( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1_THROUGH_5
---
-
- procedure TASK_1_THROUGH_5 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- RMID : RTEMS.ID;
- TEST_RMID : RTEMS.ID;
- INDEX : RTEMS.UNSIGNED32;
- PASS : RTEMS.UNSIGNED32;
- FAILED : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.RATE_MONOTONIC_CREATE( ARGUMENT, RMID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CREATE" );
- TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( INTEGER( ARGUMENT ) ), FALSE );
- TEXT_IO.PUT( "- rate_monotonic_create id = " );
- UNSIGNED32_IO.PUT( RMID, WIDTH => 8, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- RTEMS.RATE_MONOTONIC_IDENT( ARGUMENT, TEST_RMID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_IDENT" );
- TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( INTEGER( ARGUMENT ) ), FALSE );
- TEXT_IO.PUT( "- rate_monotonic_ident id = " );
- UNSIGNED32_IO.PUT( RMID, WIDTH => 8, BASE => 16 );
- TEXT_IO.NEW_LINE;
- if TEST_RMID /= RMID then
- TEXT_IO.PUT_LINE( "RMID's DO NOT MATCH!!!" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
- end if;
-
- TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( INTEGER( ARGUMENT ) ), FALSE );
- TEXT_IO.PUT( " - (" );
- UNSIGNED32_IO.PUT( RMID, WIDTH => 1, BASE => 16 );
- TEXT_IO.PUT( ") period " );
- UNSIGNED32_IO.PUT(
- SPTEST.PERIODS( INTEGER( ARGUMENT ) ),
- WIDTH => 1,
- BASE => 10
- );
- TEXT_IO.NEW_LINE;
-
- RTEMS.TASK_WAKE_AFTER( 2, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- case ARGUMENT is
- when 1 .. 4 =>
- loop
- RTEMS.RATE_MONOTONIC_PERIOD(
- RMID,
- SPTEST.PERIODS( INTEGER( ARGUMENT ) ),
- STATUS
- );
-
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "RATE_MONOTONIC_PERIOD"
- );
-
- SPTEST.COUNT( INTEGER( ARGUMENT ) ) :=
- SPTEST.COUNT( INTEGER( ARGUMENT ) ) + 1;
-
- end loop;
-
- when 5 =>
-
- PASS := 0;
- FAILED := 0;
-
- RTEMS.RATE_MONOTONIC_PERIOD(
- RMID,
- SPTEST.PERIODS( INTEGER( ARGUMENT ) ),
- STATUS
- );
-
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "RATE_MONOTONIC_PERIOD 1 OF TA5"
- );
-
- SPTEST.GET_ALL_COUNTERS;
-
- loop
-
- RTEMS.RATE_MONOTONIC_PERIOD(
- RMID,
- SPTEST.PERIODS( INTEGER( ARGUMENT ) ),
- STATUS
- );
-
- TEST_SUPPORT.DIRECTIVE_FAILED(
- STATUS,
- "RATE_MONOTONIC_PERIOD 2 OF TA5"
- );
-
- SPTEST.GET_ALL_COUNTERS;
-
- for INDEX in 1 .. 4
- loop
-
- if SPTEST.TEMPORARY_COUNT( INDEX ) /=
- SPTEST.ITERATIONS( INDEX ) then
-
- TEXT_IO.PUT( "FAIL -- " );
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME( INDEX ),
- FALSE
- );
- TEXT_IO.PUT( "ACTUAL=" );
- UNSIGNED32_IO.PUT(
- SPTEST.TEMPORARY_COUNT( INDEX ),
- WIDTH => 3,
- BASE => 10
- );
- TEXT_IO.PUT( " EXPECTED=" );
- UNSIGNED32_IO.PUT(
- SPTEST.ITERATIONS( INDEX ),
- WIDTH => 3,
- BASE => 10
- );
- TEXT_IO.NEW_LINE;
-
- FAILED := FAILED + 1;
-
- end if;
-
- end loop;
-
- if FAILED = 5 then
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
- end if;
-
- PASS := PASS + 1;
- TEXT_IO.PUT( "TA5 - PERIODS CHECK OK (" );
- UNSIGNED32_IO.PUT( PASS, WIDTH => 1, BASE => 10 );
- TEXT_IO.PUT_LINE( ")" );
-
- if PASS = 10 then
- TEXT_IO.PUT_LINE( "*** END OF TEST 20 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
- end if;
-
- end loop;
-
- when others =>
- NULL;
-
- end case;
-
- end TASK_1_THROUGH_5;
-
---PAGE
---
--- GET_ALL_COUNTERS
---
-
- procedure GET_ALL_COUNTERS
- is
- PREVIOUS_MODE : RTEMS.MODE;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_MODE(
- RTEMS.NO_PREEMPT,
- RTEMS.PREEMPT_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE TO NO_PREEMPT" );
-
- SPTEST.TEMPORARY_COUNT := SPTEST.COUNT;
-
- for INDEX in 1 .. 5
- loop
-
- SPTEST.COUNT( INDEX ) := 0;
-
- end loop;
-
- RTEMS.TASK_MODE(
- RTEMS.PREEMPT,
- RTEMS.PREEMPT_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE TO PREEMPT" );
-
- end GET_ALL_COUNTERS;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp20/sptest.ads b/c/src/ada-tests/sptests/sp20/sptest.ads
deleted file mode 100644
index bfc62ad772..0000000000
--- a/c/src/ada-tests/sptests/sp20/sptest.ads
+++ /dev/null
@@ -1,105 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 20 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( 1 .. 5 ) of RTEMS.ID;
- TASK_NAME : array ( 1 .. 5 ) of RTEMS.NAME;
-
---
--- These arrays contain the parameters which define the execution
--- characteristics and periods of each instantiation of the
--- copies of the RTEMS task TASKS_1_THROUGH_5.
---
-
- PERIODS : constant array ( 1 .. 5 )
- of RTEMS.UNSIGNED32 := ( 2, 2, 2, 2, 100 );
-
- ITERATIONS : constant array ( 1 .. 5 )
- of RTEMS.UNSIGNED32 := ( 50, 50, 50, 50, 1 );
-
- PRIORITIES : constant array ( 1 .. 5 )
- of RTEMS.UNSIGNED32 := ( 1, 1, 3, 4, 5 );
-
---
--- The following type defines the array used to manage the
--- execution counts of each task's period.
---
-
- type COUNT_ARRAY is array ( 1 .. 5 ) of RTEMS.UNSIGNED32;
-
---
--- These arrays contains the number of periods successfully completed
--- by each of the tasks. At each of its periods, the fifth task
--- will copy the contents of the COUNT array to TEMPORARY_COUNT,
--- and clear the COUNT array. The copy is performed to insure
--- that no periods fire while it is verifying the correctness
--- of the test's execution.
---
-
- COUNT : SPTEST.COUNT_ARRAY;
- TEMPORARY_COUNT : SPTEST.COUNT_ARRAY;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1_THROUGH_5
---
--- DESCRIPTION:
---
--- These RTEMS tasks test the Rate Monotonic Manager.
---
-
- procedure TASK_1_THROUGH_5 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- GET_ALL_COUNTERS
---
--- DESCRIPTION:
---
--- This subprogram atomically copies the contents of COUNTER to
--- TEMPORARY_COUNTER.
---
-
- procedure GET_ALL_COUNTERS;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp21/config.h b/c/src/ada-tests/sptests/sp21/config.h
deleted file mode 100644
index 94ca99691d..0000000000
--- a/c/src/ada-tests/sptests/sp21/config.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-#define CONFIGURE_TEST_NEEDS_STUB_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp21/sp21.adb b/c/src/ada-tests/sptests/sp21/sp21.adb
deleted file mode 100644
index 6084211195..0000000000
--- a/c/src/ada-tests/sptests/sp21/sp21.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP21 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP21 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP21;
-
diff --git a/c/src/ada-tests/sptests/sp21/sp21.scn b/c/src/ada-tests/sptests/sp21/sp21.scn
deleted file mode 100644
index 86dd4922b4..0000000000
--- a/c/src/ada-tests/sptests/sp21/sp21.scn
+++ /dev/null
@@ -1,19 +0,0 @@
-*** TEST 21 ***
------ TESTING THE NULL DRIVER CHECKS -----
-TA1 - io_initialize - NULL DRIVER SUCCESSFUL
-TA1 - io_open - NULL DRIVER SUCCESSFUL
-TA1 - io_close - NULL DRIVER SUCCESSFUL
-TA1 - io_read - NULL DRIVER SUCCESSFUL
-TA1 - io_write - NULL DRIVER SUCCESSFUL
-TA1 - io_control - NULL DRIVER SUCCESSFUL
------ TESTING THE I/O MANAGER DIRECTIVES -----
-TA1 - io_initialize - STUB DRIVER SUCCESSFUL
-TA1 - io_open - STUB DRIVER SUCCESSFUL
-TA1 - io_close - STUB DRIVER SUCCESSFUL
-TA1 - io_read - STUB DRIVER SUCCESSFUL
-TA1 - io_write - STUB DRIVER SUCCESSFUL
-TA1 - io_control - STUB DRIVER SUCCESSFUL
------ RETURNING INVALID MAJOR NUMBER -----
-TA1 - io_initialize - INVALID_NUMBER
-TA1 - io_open - INVALID_NUMBER
-*** END OF TEST 21 ***
diff --git a/c/src/ada-tests/sptests/sp21/sptest.adb b/c/src/ada-tests/sptests/sp21/sptest.adb
deleted file mode 100644
index 8ec76a7cf0..0000000000
--- a/c/src/ada-tests/sptests/sp21/sptest.adb
+++ /dev/null
@@ -1,270 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 21 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 21 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- RETURN_VALUE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "----- TESTING THE NULL DRIVER CHECKS -----" );
-
- RTEMS.IO_INITIALIZE(
- SPTEST.NO_DRIVER_MAJOR,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_INITIALIZE" );
- TEXT_IO.PUT_LINE(
- "TA1 - io_initialize - NULL DRIVER SUCCESSFUL"
- );
-
- RTEMS.IO_OPEN(
- SPTEST.NO_DRIVER_MAJOR,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_OPEN" );
- TEXT_IO.PUT_LINE(
- "TA1 - io_open - NULL DRIVER SUCCESSFUL"
- );
-
- RTEMS.IO_CLOSE(
- SPTEST.NO_DRIVER_MAJOR,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_CLOSE" );
- TEXT_IO.PUT_LINE(
- "TA1 - io_close - NULL DRIVER SUCCESSFUL"
- );
-
- RTEMS.IO_READ(
- SPTEST.NO_DRIVER_MAJOR,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_READ" );
- TEXT_IO.PUT_LINE(
- "TA1 - io_read - NULL DRIVER SUCCESSFUL"
- );
-
- RTEMS.IO_WRITE(
- SPTEST.NO_DRIVER_MAJOR,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_WRITE" );
- TEXT_IO.PUT_LINE(
- "TA1 - io_write - NULL DRIVER SUCCESSFUL"
- );
-
- RTEMS.IO_CONTROL(
- SPTEST.NO_DRIVER_MAJOR,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_CONTROL" );
- TEXT_IO.PUT_LINE(
- "TA1 - io_control - NULL DRIVER SUCCESSFUL"
- );
-
- TEXT_IO.PUT_LINE( "----- TESTING THE I/O MANAGER DIRECTIVES -----" );
-
- RTEMS.IO_INITIALIZE(
- SPTEST.STUB_DRIVER_MAJOR,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_INITIALIZE" );
- TEXT_IO.PUT_LINE(
- "TA1 - io_initialize - STUB DRIVER SUCCESSFUL"
- );
-
- RTEMS.IO_OPEN(
- SPTEST.STUB_DRIVER_MAJOR,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_OPEN" );
- TEXT_IO.PUT_LINE(
- "TA1 - io_open - STUB DRIVER SUCCESSFUL"
- );
-
- RTEMS.IO_CLOSE(
- SPTEST.STUB_DRIVER_MAJOR,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_CLOSE" );
- TEXT_IO.PUT_LINE(
- "TA1 - io_close - STUB DRIVER SUCCESSFUL"
- );
-
- RTEMS.IO_READ(
- SPTEST.STUB_DRIVER_MAJOR,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_READ" );
- TEXT_IO.PUT_LINE(
- "TA1 - io_read - STUB DRIVER SUCCESSFUL"
- );
-
- RTEMS.IO_WRITE(
- SPTEST.STUB_DRIVER_MAJOR,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_WRITE" );
- TEXT_IO.PUT_LINE(
- "TA1 - io_write - STUB DRIVER SUCCESSFUL"
- );
-
- RTEMS.IO_CONTROL(
- SPTEST.STUB_DRIVER_MAJOR,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_CONTROL" );
- TEXT_IO.PUT_LINE(
- "TA1 - io_control - STUB DRIVER SUCCESSFUL"
- );
-
- TEXT_IO.PUT_LINE( "----- RETURNING INVALID MAJOR NUMBER -----" );
-
- RTEMS.IO_INITIALIZE(
- SPTEST.INVALID_DRIVER_MAJOR,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NUMBER,
- "IO_INITIALIZE"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - io_initialize - INVALID_NUMBER"
- );
-
- RTEMS.IO_OPEN(
- SPTEST.INVALID_DRIVER_MAJOR,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
- STATUS,
- RTEMS.INVALID_NUMBER,
- "IO_OPEN"
- );
- TEXT_IO.PUT_LINE(
- "TA1 - io_open - INVALID_NUMBER"
- );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 21 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp21/sptest.ads b/c/src/ada-tests/sptests/sp21/sptest.ads
deleted file mode 100644
index 04a8ad9c4f..0000000000
--- a/c/src/ada-tests/sptests/sp21/sptest.ads
+++ /dev/null
@@ -1,69 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 21 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- The following constants define the device major numbers
--- utilized by this test.
---
-
- NO_DRIVER_MAJOR : constant RTEMS.DEVICE_MAJOR_NUMBER := 3;
- INVALID_DRIVER_MAJOR : constant RTEMS.DEVICE_MAJOR_NUMBER := 5;
- STUB_DRIVER_MAJOR : constant RTEMS.DEVICE_MAJOR_NUMBER := 2;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Input Output Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp22/config.h b/c/src/ada-tests/sptests/sp22/config.h
deleted file mode 100644
index 09a09692a8..0000000000
--- a/c/src/ada-tests/sptests/sp22/config.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 2
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp22/sp22.adb b/c/src/ada-tests/sptests/sp22/sp22.adb
deleted file mode 100644
index 06cb14a01f..0000000000
--- a/c/src/ada-tests/sptests/sp22/sp22.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP22 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP22 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP22;
-
diff --git a/c/src/ada-tests/sptests/sp22/sp22.scn b/c/src/ada-tests/sptests/sp22/sp22.scn
deleted file mode 100644
index 8422e73141..0000000000
--- a/c/src/ada-tests/sptests/sp22/sp22.scn
+++ /dev/null
@@ -1,29 +0,0 @@
-*** TEST 22 ***
-INIT - timer_create - creating timer 1
-INIT - timer 1 has id (16#10001#)
-TA1 - timer_ident - identing timer 1
-TA1 - timer 1 has id (16#10001#)
-TA1 - clock_get - 9: 0: 0 12/31/1988
-TA1 - timer_after - timer 1 in 3 seconds
-TA1 - task_suspend( SELF )
-TA1 - clock_get - 9: 0: 3 12/31/1988
-TA1 - timer_after - timer 1 in 3 seconds
-TA1 - task_wake_after - 1 second
-TA1 - clock_get - 9: 0: 4 12/31/1988
-TA1 - timer_reset - timer 1
-TA1 - task_suspend( SELF )
-TA1 - clock_get - 9: 0: 7 12/31/1988
-<pause>
-TA1 - timer_after - timer 1 in 3 seconds
-TA1 - timer_cancel - timer 1
-TA1 - clock_get - 9: 0: 7 12/31/1988
-TA1 - timer_when - timer 1 in 3 seconds
-TA1 - task_suspend( SELF )
-TA1 - clock_get - 9: 0:10 12/31/1988
-TA1 - timer_when - timer 1 in 3 seconds
-TA1 - task_wake_after - 1 second
-TA1 - clock_get - 9: 0:11 12/31/1988
-TA1 - timer_cancel - timer 1
-TA1 - task_wake_after - YIELD (only task at priority)
-TA1 - timer_delete - timer 1
-*** END OF TEST 22 ***
diff --git a/c/src/ada-tests/sptests/sp22/sptest.adb b/c/src/ada-tests/sptests/sp22/sptest.adb
deleted file mode 100644
index 830dbf9693..0000000000
--- a/c/src/ada-tests/sptests/sp22/sptest.adb
+++ /dev/null
@@ -1,299 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 22 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 22 ***" );
-
- TIME := ( 1988, 12, 31, 9, 0, 0, 0 );
-
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- TEXT_IO.PUT_LINE( "INIT - timer_create - creating timer 1" );
- RTEMS.TIMER_CREATE(
- SPTEST.TIMER_NAME( 1 ),
- SPTEST.TIMER_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM1" );
- TEXT_IO.PUT( "INIT - timer 1 has id (" );
- UNSIGNED32_IO.PUT( SPTEST.TIMER_ID( 1 ), WIDTH => 8, BASE => 16 );
- TEXT_IO.PUT_LINE( ")" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- DELAYED_RESUME
---
-
- procedure DELAYED_RESUME (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_RESUME( SPTEST.TASK_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF SELF" );
-
- end DELAYED_RESUME;
-
---PAGE
---
--- PRINT_TIME
---
-
- procedure PRINT_TIME
- is
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME( 1 ),
- FALSE
- );
-
- TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- end PRINT_TIME;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TMID : RTEMS.ID;
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
--- GET ID
-
- TEXT_IO.PUT_LINE( "TA1 - timer_ident - identing timer 1" );
- RTEMS.TIMER_IDENT( SPTEST.TIMER_NAME( 1 ), TMID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_IDENT OF TM1" );
- TEXT_IO.PUT( "TA1 - timer 1 has id (" );
- UNSIGNED32_IO.PUT( SPTEST.TIMER_ID( 1 ), WIDTH => 8, BASE => 16 );
- TEXT_IO.PUT_LINE( ")" );
-
--- AFTER WHICH IS ALLOWED TO FIRE
-
- SPTEST.PRINT_TIME;
-
- TEXT_IO.PUT_LINE( "TA1 - timer_after - timer 1 in 3 seconds" );
- RTEMS.TIMER_FIRE_AFTER(
- TMID,
- 3 * TEST_SUPPORT.TICKS_PER_SECOND,
- SPTEST.DELAYED_RESUME'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_suspend( SELF )" );
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" );
-
- SPTEST.PRINT_TIME;
-
--- AFTER WHICH IS RESET AND ALLOWED TO FIRE
-
- TEXT_IO.PUT_LINE( "TA1 - timer_after - timer 1 in 3 seconds" );
- RTEMS.TIMER_FIRE_AFTER(
- TMID,
- 3 * TEST_SUPPORT.TICKS_PER_SECOND,
- SPTEST.DELAYED_RESUME'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - 1 second" );
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- SPTEST.PRINT_TIME;
-
- TEXT_IO.PUT_LINE( "TA1 - timer_reset - timer 1" );
- RTEMS.TIMER_RESET( TMID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_RESET" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_suspend( SELF )" );
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" );
-
- SPTEST.PRINT_TIME;
-
-TEST_SUPPORT.PAUSE;
-
---
--- Reset the time since we do not know how long the user waited
--- before pressing <cr> at the pause. This insures that the
--- actual output matches the screen.
---
-
- TIME := ( 1988, 12, 31, 9, 0, 7, 0 );
-
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" );
-
--- after which is canceled
-
- TEXT_IO.PUT_LINE( "TA1 - timer_after - timer 1 in 3 seconds" );
- RTEMS.TIMER_FIRE_AFTER(
- TMID,
- 3 * TEST_SUPPORT.TICKS_PER_SECOND,
- SPTEST.DELAYED_RESUME'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" );
-
- TEXT_IO.PUT_LINE( "TA1 - timer_cancel - timer 1" );
- RTEMS.TIMER_CANCEL( TMID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" );
-
--- when which is allowed to fire
-
- SPTEST.PRINT_TIME;
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- TIME.SECOND := TIME.SECOND + 3;
-
- TEXT_IO.PUT_LINE( "TA1 - timer_when - timer 1 in 3 seconds" );
- RTEMS.TIMER_FIRE_WHEN(
- TMID,
- TIME,
- SPTEST.DELAYED_RESUME'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_suspend( SELF )" );
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" );
-
- SPTEST.PRINT_TIME;
-
--- when which is canceled
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- TIME.SECOND := TIME.SECOND + 3;
-
- TEXT_IO.PUT_LINE( "TA1 - timer_when - timer 1 in 3 seconds" );
- RTEMS.TIMER_FIRE_WHEN(
- TMID,
- TIME,
- SPTEST.DELAYED_RESUME'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN" );
-
- TEXT_IO.PUT_LINE( "TA1 - task_wake_after - 1 second" );
- RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- SPTEST.PRINT_TIME;
-
- TEXT_IO.PUT_LINE( "TA1 - timer_cancel - timer 1" );
- RTEMS.TIMER_CANCEL( TMID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" );
-
--- delete
-
- TEXT_IO.PUT_LINE(
- "TA1 - task_wake_after - YIELD (only task at priority)"
- );
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER YIELD" );
-
- TEXT_IO.PUT_LINE( "TA1 - timer_delete - timer 1" );
- RTEMS.TIMER_DELETE( TMID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_DELETE" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 22 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp22/sptest.ads b/c/src/ada-tests/sptests/sp22/sptest.ads
deleted file mode 100644
index 9401ce1cc0..0000000000
--- a/c/src/ada-tests/sptests/sp22/sptest.ads
+++ /dev/null
@@ -1,92 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 22 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS timers created
--- by this test.
---
-
- TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID;
- TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- DELAYED_RESUME
---
--- DESCRIPTION:
---
--- This subprogram is scheduled to be fired as a timer service
--- routine. When fired this subprogram resumes TASK_1.
---
-
- procedure DELAYED_RESUME (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- PRINT_TIME
---
--- DESCRIPTION:
---
--- This subprogram prints the name of TASK_1 and the current TIME of day.
---
-
- procedure PRINT_TIME;
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Timer Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp23/config.h b/c/src/ada-tests/sptests/sp23/config.h
deleted file mode 100644
index 5e60e5c235..0000000000
--- a/c/src/ada-tests/sptests/sp23/config.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_PORTS 1
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp23/sp23.adb b/c/src/ada-tests/sptests/sp23/sp23.adb
deleted file mode 100644
index ff3d5c0c4c..0000000000
--- a/c/src/ada-tests/sptests/sp23/sp23.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP23 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP23 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP23;
-
diff --git a/c/src/ada-tests/sptests/sp23/sp23.scn b/c/src/ada-tests/sptests/sp23/sp23.scn
deleted file mode 100644
index 1a3af24ac7..0000000000
--- a/c/src/ada-tests/sptests/sp23/sp23.scn
+++ /dev/null
@@ -1,9 +0,0 @@
-*** TEST 23 ***
-INIT - port_create - DP1 - internal = 16#1000# external = 16#2000#
-TA1 - port_ident - 16#10001#
-TA1 - port_external_to_internal - external: 16#200E# => internal: 16#100E#
-TA1 - port_internal_to_external - internal: 16#100E# => external: 16#200E#
-TA1 - port_external_to_internal - external: 16#300E# => internal: 16#300E#
-TA1 - port_internal_to_external - internal: 16#50E# => external: 16#50E#
-TA1 - port_delete - DP1
-*** END OF TEST 23 ***
diff --git a/c/src/ada-tests/sptests/sp23/sptest.adb b/c/src/ada-tests/sptests/sp23/sptest.adb
deleted file mode 100644
index 0ff783a197..0000000000
--- a/c/src/ada-tests/sptests/sp23/sptest.adb
+++ /dev/null
@@ -1,179 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 23 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 ADDRESS_IO;
-with INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INTERNAL_AREA : RTEMS.ADDRESS;
- EXTERNAL_AREA : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 23 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- SPTEST.PORT_NAME( 1 ) := RTEMS.BUILD_NAME( 'D', 'P', '1', ' ' );
-
- INTERNAL_AREA := SPTEST.INTERNAL_PORT_AREA( 0 )'ADDRESS;
- EXTERNAL_AREA := SPTEST.EXTERNAL_PORT_AREA( 0 )'ADDRESS;
- RTEMS.PORT_CREATE(
- SPTEST.PORT_NAME( 1 ),
- INTERNAL_AREA,
- EXTERNAL_AREA,
- SPTEST.INTERNAL_PORT_AREA'LENGTH,
- SPTEST.PORT_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_CREATE OF DP1" );
- TEXT_IO.PUT( "INIT - port_create - DP1 - internal = " );
- ADDRESS_IO.PUT( INTERNAL_AREA, WIDTH => 8, BASE => 16 );
- TEXT_IO.PUT( " external = " );
- ADDRESS_IO.PUT( EXTERNAL_AREA, WIDTH => 8, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- DPID : RTEMS.ID;
- TO_BE_CONVERTED : RTEMS.ADDRESS;
- CONVERTED : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.PORT_IDENT( SPTEST.PORT_NAME( 1 ), DPID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_IDENT" );
- TEXT_IO.PUT( "TA1 - port_ident - " );
- UNSIGNED32_IO.PUT( DPID, WIDTH => 8, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- TO_BE_CONVERTED := SPTEST.EXTERNAL_PORT_AREA( 16#E# )'ADDRESS;
- RTEMS.PORT_EXTERNAL_TO_INTERNAL(
- SPTEST.PORT_ID( 1 ),
- TO_BE_CONVERTED,
- CONVERTED,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_EXTERNAL_TO_INTERNAL" );
- TEXT_IO.PUT( "TA1 - port_external_to_internal - external: " );
- ADDRESS_IO.PUT( TO_BE_CONVERTED, WIDTH => 8, BASE => 16 );
- TEXT_IO.PUT( " => internal: " );
- ADDRESS_IO.PUT( CONVERTED, WIDTH => 8, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- TO_BE_CONVERTED := SPTEST.INTERNAL_PORT_AREA( 16#E# )'ADDRESS;
- RTEMS.PORT_INTERNAL_TO_EXTERNAL(
- SPTEST.PORT_ID( 1 ),
- TO_BE_CONVERTED,
- CONVERTED,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_INTERNAL_TO_EXTERNAL" );
- TEXT_IO.PUT( "TA1 - port_internal_to_external - internal: " );
- ADDRESS_IO.PUT( TO_BE_CONVERTED, WIDTH => 8, BASE => 16 );
- TEXT_IO.PUT( " => external: " );
- ADDRESS_IO.PUT( CONVERTED, WIDTH => 8, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- TO_BE_CONVERTED := SPTEST.ABOVE_PORT_AREA( 16#E# )'ADDRESS;
- RTEMS.PORT_EXTERNAL_TO_INTERNAL(
- SPTEST.PORT_ID( 1 ),
- TO_BE_CONVERTED,
- CONVERTED,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_EXTERNAL_TO_INTERNAL" );
- TEXT_IO.PUT( "TA1 - port_external_to_internal - external: " );
- ADDRESS_IO.PUT( TO_BE_CONVERTED, WIDTH => 8, BASE => 16 );
- TEXT_IO.PUT( " => internal: " );
- ADDRESS_IO.PUT( CONVERTED, WIDTH => 8, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- TO_BE_CONVERTED := SPTEST.BELOW_PORT_AREA( 16#E# )'ADDRESS;
- RTEMS.PORT_INTERNAL_TO_EXTERNAL(
- SPTEST.PORT_ID( 1 ),
- TO_BE_CONVERTED,
- CONVERTED,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_INTERNAL_TO_EXTERNAL" );
- TEXT_IO.PUT( "TA1 - port_internal_to_external - internal: " );
- ADDRESS_IO.PUT( TO_BE_CONVERTED, WIDTH => 8, BASE => 16 );
- TEXT_IO.PUT( " => external: " );
- ADDRESS_IO.PUT( CONVERTED, WIDTH => 8, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "TA1 - port_delete - DP1" );
- RTEMS.PORT_DELETE( SPTEST.PORT_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_DELETE" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 23 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp23/sptest.ads b/c/src/ada-tests/sptests/sp23/sptest.ads
deleted file mode 100644
index 9c72b05568..0000000000
--- a/c/src/ada-tests/sptests/sp23/sptest.ads
+++ /dev/null
@@ -1,118 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 23 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SYSTEM;
-with System.Storage_Elements;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS ports created
--- by this test.
---
-
- PORT_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID;
- PORT_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME;
-
---
--- The following area defines a memory area to be used as the
--- internal address space of the port.
---
-
- INTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
- System.Storage_Elements.To_Address(16#00001000#);
-
- INTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for INTERNAL_PORT_AREA use at INTERNAL_PORT_AREA_ADDRESS;
-
---
--- The following area defines a memory area to be used as the
--- external address space of the port.
---
-
- EXTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
- System.Storage_Elements.To_Address(16#00002000#);
-
- EXTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for EXTERNAL_PORT_AREA use at EXTERNAL_PORT_AREA_ADDRESS;
-
---
--- The following area defines a memory area to be used for
--- addresses which are below the address space of the port.
---
-
- BELOW_PORT_AREA_ADDRESS : constant System.Address :=
- System.Storage_Elements.To_Address(16#00000500#);
-
- BELOW_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for BELOW_PORT_AREA use at BELOW_PORT_AREA_ADDRESS;
-
---
--- The following area defines a memory area to be used for
--- addresses which are above the address space of the port.
---
-
- ABOVE_PORT_AREA_ADDRESS : constant System.Address :=
- System.Storage_Elements.To_Address(16#00003000#);
-
- ABOVE_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for ABOVE_PORT_AREA use at ABOVE_PORT_AREA_ADDRESS;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Dual Ported Memory Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp24/config.h b/c/src/ada-tests/sptests/sp24/config.h
deleted file mode 100644
index ae1c63c601..0000000000
--- a/c/src/ada-tests/sptests/sp24/config.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 3
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp24/sp24.adb b/c/src/ada-tests/sptests/sp24/sp24.adb
deleted file mode 100644
index d060a5308e..0000000000
--- a/c/src/ada-tests/sptests/sp24/sp24.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP24 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP24 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP24;
-
diff --git a/c/src/ada-tests/sptests/sp24/sp24.scn b/c/src/ada-tests/sptests/sp24/sp24.scn
deleted file mode 100644
index 374ef9540b..0000000000
--- a/c/src/ada-tests/sptests/sp24/sp24.scn
+++ /dev/null
@@ -1,17 +0,0 @@
-*** TEST 24 ***
-TA1 - clock_get - 9: 0: 0 12/31/1988
-TA2 - clock_get - 9: 0: 0 12/31/1988
-TA3 - clock_get - 9: 0: 0 12/31/1988
-TA1 - clock_get - 9: 0: 5 12/31/1988
-TA2 - clock_get - 9: 0:10 12/31/1988
-TA1 - clock_get - 9: 0:10 12/31/1988
-TA3 - clock_get - 9: 0:15 12/31/1988
-TA1 - clock_get - 9: 0:15 12/31/1988
-TA2 - clock_get - 9: 0:20 12/31/1988
-TA1 - clock_get - 9: 0:20 12/31/1988
-TA1 - clock_get - 9: 0:25 12/31/1988
-TA3 - clock_get - 9: 0:30 12/31/1988
-TA1 - clock_get - 9: 0:30 12/31/1988
-TA2 - clock_get - 9: 0:30 12/31/1988
-*** END OF TEST 24 ***
-
diff --git a/c/src/ada-tests/sptests/sp24/sptest.adb b/c/src/ada-tests/sptests/sp24/sptest.adb
deleted file mode 100644
index b94a27eadb..0000000000
--- a/c/src/ada-tests/sptests/sp24/sptest.adb
+++ /dev/null
@@ -1,171 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 24 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TIME : RTEMS.TIME_OF_DAY;
- INDEX : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 24 ***" );
-
- TIME := ( 1988, 12, 31, 9, 0, 0, 0 );
-
- RTEMS.CLOCK_SET( TIME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
-
- SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' );
- SPTEST.TIMER_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'M', '2', ' ' );
- SPTEST.TIMER_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'M', '3', ' ' );
-
- for INDEX in 1 .. 3
- loop
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( INDEX ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- RTEMS.TIMER_CREATE(
- SPTEST.TIMER_NAME( INDEX ),
- SPTEST.TIMER_ID( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE LOOP" );
-
- end loop;
-
- for INDEX in 1 .. 3
- loop
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( INDEX ),
- SPTEST.TASK_1_THROUGH_3'ACCESS,
- RTEMS.TASK_ARGUMENT( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- RESUME_TASK
---
-
- procedure RESUME_TASK (
- TIMER_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- ) is
- TASK_TO_RESUME : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TASK_TO_RESUME := SPTEST.TASK_ID(INTEGER( RTEMS.GET_INDEX( TIMER_ID ) ));
- RTEMS.TASK_RESUME( TASK_TO_RESUME, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" );
-
- end RESUME_TASK;
-
---PAGE
---
--- TASK_1_THROUGH_3
---
-
- procedure TASK_1_THROUGH_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TID : RTEMS.ID;
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );
-
- loop
-
- RTEMS.TIMER_FIRE_AFTER(
- SPTEST.TIMER_ID( INTEGER( ARGUMENT ) ),
- TEST_SUPPORT.TASK_NUMBER( TID ) * 5 *
- TEST_SUPPORT.TICKS_PER_SECOND,
- SPTEST.RESUME_TASK'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" );
-
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
-
- if TIME.SECOND >= 35 then
- TEXT_IO.PUT_LINE( "*** END OF TEST 24 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
- end if;
-
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME( INTEGER( TEST_SUPPORT.TASK_NUMBER( TID ) ) ),
- FALSE
- );
-
- TEST_SUPPORT.PRINT_TIME( " - clock_get - ", TIME, "" );
- TEXT_IO.NEW_LINE;
-
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" );
-
- end loop;
-
- end TASK_1_THROUGH_3;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp24/sptest.ads b/c/src/ada-tests/sptests/sp24/sptest.ads
deleted file mode 100644
index f664be5bd8..0000000000
--- a/c/src/ada-tests/sptests/sp24/sptest.ads
+++ /dev/null
@@ -1,82 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 24 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( 1 .. 3 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS timers created
--- by this test.
---
-
- TIMER_ID : array ( 1 .. 3 ) of RTEMS.ID;
- TIMER_NAME : array ( 1 .. 3 ) of RTEMS.NAME;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- RESUME_TASK
---
--- DESCRIPTION:
---
--- This subprogram is scheduled as a timer service routine. When
--- it fires it resumes the task which is mapped to this timer.
---
-
- procedure RESUME_TASK (
- TIMER_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- TASK_1_THROUGH_3
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Timer Manager.
---
-
- procedure TASK_1_THROUGH_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp25/config.h b/c/src/ada-tests/sptests/sp25/config.h
deleted file mode 100644
index 5d162bd899..0000000000
--- a/c/src/ada-tests/sptests/sp25/config.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_REGIONS 1
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp25/sp25.adb b/c/src/ada-tests/sptests/sp25/sp25.adb
deleted file mode 100644
index 58e45b339d..0000000000
--- a/c/src/ada-tests/sptests/sp25/sp25.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SP25 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SP25 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SP25;
-
diff --git a/c/src/ada-tests/sptests/sp25/sp25.scn b/c/src/ada-tests/sptests/sp25/sp25.scn
deleted file mode 100644
index 0b0fbcf102..0000000000
--- a/c/src/ada-tests/sptests/sp25/sp25.scn
+++ /dev/null
@@ -1,29 +0,0 @@
-*** TEST 25 ***
-TA1 - region_ident - rnid => 16#10001#
-TA1 - region_get_segment - wait on 64 byte segment from region 1
-TA1 - got segment from region 1 - 16#F9B8#
-TA1 - region_get_segment - wait on 128 byte segment from region 1
-TA1 - got segment from region 1 - 16#F930#
-TA1 - region_get_segment - wait on 256 byte segment from region 1
-TA1 - got segment from region 1 - 16#F828#
-TA1 - region_get_segment - wait on 512 byte segment from region 1
-TA1 - got segment from region 1 - 16#F620#
-TA1 - region_get_segment - wait on 1024 byte segment from region 1
-TA1 - got segment from region 1 - 16#F218#
-TA1 - region_get_segment - wait on 2048 byte segment from region 1
-TA1 - got segment from region 1 - 16#EA10#
-TA1 - region_get_segment - wait on 4096 byte segment from region 1
-TA1 - got segment from region 1 - 16#DA08#
-TA1 - region_get_segment - wait on 8192 byte segment from region 1
-TA1 - got segment from region 1 - 16#BA00#
-<pause>
-TA1 - region_return_segment - return segment to region 1 - 16#F828#
-TA1 - region_return_segment - return segment to region 1 - 16#F620#
-TA1 - region_return_segment - return segment to region 1 - 16#F9B8#
-TA1 - region_return_segment - return segment to region 1 - 16#F930#
-TA1 - region_return_segment - return segment to region 1 - 16#DA08#
-TA1 - region_return_segment - return segment to region 1 - 16#EA10#
-TA1 - region_return_segment - return segment to region 1 - 16#BA00#
-TA1 - region_return_segment - return segment to region 1 - 16#F218#
-TA1 - region_delete - walks heap if debug enabled
-*** END OF TEST 25 ***
diff --git a/c/src/ada-tests/sptests/sp25/sptest.adb b/c/src/ada-tests/sptests/sp25/sptest.adb
deleted file mode 100644
index a9aace5212..0000000000
--- a/c/src/ada-tests/sptests/sp25/sptest.adb
+++ /dev/null
@@ -1,367 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 25 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body SPTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST 25 ***" );
-
- SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
-
- RTEMS.TASK_CREATE(
- SPTEST.TASK_NAME( 1 ),
- SPTEST.BASE_PRIORITY,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_START(
- SPTEST.TASK_ID( 1 ),
- SPTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- SPTEST.REGION_NAME( 1 ) := RTEMS.BUILD_NAME( 'R', 'N', '1', ' ' );
-
- RTEMS.REGION_CREATE(
- SPTEST.REGION_NAME( 1 ),
- SPTEST.AREA_1'ADDRESS,
- 64000,
- 32,
- RTEMS.DEFAULT_ATTRIBUTES,
- SPTEST.REGION_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN1" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- PUT_ADDRESS_FROM_AREA_1
---
-
- procedure PUT_ADDRESS_FROM_AREA_1 (
- TO_BE_PRINTED : in RTEMS.ADDRESS
- ) is
-
- begin
-
- UNSIGNED32_IO.PUT(
- RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_1'ADDRESS ),
- WIDTH => 8,
- BASE => 16
- );
-
- end PUT_ADDRESS_FROM_AREA_1;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- RNID : RTEMS.ID;
- SEGMENT_ADDRESS_1 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_2 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_3 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_4 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_5 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_6 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_7 : RTEMS.ADDRESS;
- SEGMENT_ADDRESS_8 : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.REGION_IDENT( SPTEST.REGION_NAME( 1 ), RNID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_IDENT OF RN1" );
- TEXT_IO.PUT( "TA1 - region_ident - rnid => " );
- UNSIGNED32_IO.PUT( RNID, WIDTH => 8, BASE => 16 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
- TEXT_IO.PUT_LINE( "64 byte segment from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 64,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
- TEXT_IO.PUT_LINE( "128 byte segment from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 128,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_2 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
- TEXT_IO.PUT_LINE( "256 byte segment from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 256,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_3,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_3 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
- TEXT_IO.PUT_LINE( "512 byte segment from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 512,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_4,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
- TEXT_IO.PUT_LINE( "1024 byte segment from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 1024,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_5,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_5 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
- TEXT_IO.PUT_LINE( "2048 byte segment from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 2048,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_6,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_6 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
- TEXT_IO.PUT_LINE( "4096 byte segment from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 4096,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_7,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_7 );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "TA1 - region_get_segment - wait on " );
- TEXT_IO.PUT_LINE( "8192 byte segment from region 1" );
- RTEMS.REGION_GET_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- 8192,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- SEGMENT_ADDRESS_8,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
- TEXT_IO.PUT( "TA1 - got segment from region 1 - " );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_8 );
- TEXT_IO.NEW_LINE;
-
-TEST_SUPPORT.PAUSE;
-
- TEXT_IO.PUT(
- "TA1 - region_return_segment - return segment to region 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_3 );
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_3,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.NEW_LINE;
- SEGMENT_ADDRESS_3 := RTEMS.NULL_ADDRESS;
-
- TEXT_IO.PUT(
- "TA1 - region_return_segment - return segment to region 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 );
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_4,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.NEW_LINE;
- SEGMENT_ADDRESS_4 := RTEMS.NULL_ADDRESS;
-
- TEXT_IO.PUT(
- "TA1 - region_return_segment - return segment to region 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 );
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.NEW_LINE;
- SEGMENT_ADDRESS_1 := RTEMS.NULL_ADDRESS;
-
- TEXT_IO.PUT(
- "TA1 - region_return_segment - return segment to region 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_2 );
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.NEW_LINE;
- SEGMENT_ADDRESS_2 := RTEMS.NULL_ADDRESS;
-
- TEXT_IO.PUT(
- "TA1 - region_return_segment - return segment to region 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_7 );
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_7,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.NEW_LINE;
- SEGMENT_ADDRESS_7 := RTEMS.NULL_ADDRESS;
-
- TEXT_IO.PUT(
- "TA1 - region_return_segment - return segment to region 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_6 );
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_6,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.NEW_LINE;
- SEGMENT_ADDRESS_6 := RTEMS.NULL_ADDRESS;
-
- TEXT_IO.PUT(
- "TA1 - region_return_segment - return segment to region 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_8 );
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_8,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.NEW_LINE;
- SEGMENT_ADDRESS_8 := RTEMS.NULL_ADDRESS;
-
- TEXT_IO.PUT(
- "TA1 - region_return_segment - return segment to region 1 - "
- );
- SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_5 );
- RTEMS.REGION_RETURN_SEGMENT(
- SPTEST.REGION_ID( 1 ),
- SEGMENT_ADDRESS_5,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
- TEXT_IO.NEW_LINE;
- SEGMENT_ADDRESS_5 := RTEMS.NULL_ADDRESS;
-
- TEXT_IO.PUT_LINE(
- "TA1 - region_delete - walks heap if debug enabled"
- );
- RTEMS.REGION_DELETE( SPTEST.REGION_ID( 1 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_DELETE OF RN1" );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST 25 ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/sp25/sptest.ads b/c/src/ada-tests/sptests/sp25/sptest.ads
deleted file mode 100644
index 516421526f..0000000000
--- a/c/src/ada-tests/sptests/sp25/sptest.ads
+++ /dev/null
@@ -1,103 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 25 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS regions created
--- by this test.
---
-
- REGION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
- REGION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME;
-
---
--- The following constant defines the priority of most of the
--- RTEMS tasks in this test. This allows one of the tasks to
--- easily set itself to a higher priority than the rest.
---
-
- BASE_PRIORITY : constant RTEMS.TASK_PRIORITY := 140;
-
---
--- These arrays define the memory areas used for the regions in
--- this test.
---
-
- AREA_1 : array ( RTEMS.UNSIGNED32 range 0 .. 64000 ) of RTEMS.UNSIGNED8;
- for AREA_1'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- PUT_ADDRESS_FROM_AREA_1
---
--- DESCRIPTION:
---
--- This subprogram prints the offset of the address TO_BE_PRINTED
--- from the first byte of AREA_1.
---
--- NOTE:
---
--- This subprogram is used because the actual address of AREA_1
--- varies based upon the size of the executable, the target board,
--- and the target processor.
---
-
- procedure PUT_ADDRESS_FROM_AREA_1 (
- TO_BE_PRINTED : in RTEMS.ADDRESS
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task tests the Region Manager.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/spsize/spsize.adb b/c/src/ada-tests/sptests/spsize/spsize.adb
deleted file mode 100644
index e6da47f2ba..0000000000
--- a/c/src/ada-tests/sptests/spsize/spsize.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test SPsize of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SPTEST;
-with TEST_SUPPORT;
-
-procedure SPsize is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- SPTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end SPsize;
-
diff --git a/c/src/ada-tests/sptests/spsize/sptest.adb b/c/src/ada-tests/sptests/spsize/sptest.adb
deleted file mode 100644
index 1080728f8f..0000000000
--- a/c/src/ada-tests/sptests/spsize/sptest.adb
+++ /dev/null
@@ -1,199 +0,0 @@
---
--- SPTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 1 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_TEST_SUPPORT;
-with TEST_SUPPORT;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body SPTEST is
-
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TEST SIZE ***" );
-
- SPTEST.PUT_SIZE(
- "Tasks",
- TRUE,
- "maximum_tasks",
- RTEMS_TEST_SUPPORT.PER_TASK
- );
-
- SPTEST.PUT_SIZE(
- "Timers",
- TRUE,
- "maximum_timers",
- RTEMS_TEST_SUPPORT.PER_TIMER
- );
-
- SPTEST.PUT_SIZE(
- "Semaphores",
- TRUE,
- "maximum_semaphores",
- RTEMS_TEST_SUPPORT.PER_SEMAPHORE
- );
-
- SPTEST.PUT_SIZE(
- "Message Queues",
- TRUE,
- "maximum_message_queues",
- RTEMS_TEST_SUPPORT.PER_MESSAGE_QUEUE
- );
-
- SPTEST.PUT_SIZE(
- "Messages",
- TRUE,
- "maximum_messages",
- RTEMS_TEST_SUPPORT.PER_MESSAGE
- );
-
- SPTEST.PUT_SIZE(
- "Regions",
- TRUE,
- "maximum_regions",
- RTEMS_TEST_SUPPORT.PER_REGION
- );
-
- SPTEST.PUT_SIZE(
- "Partitions",
- TRUE,
- "maximum_paritions",
- RTEMS_TEST_SUPPORT.PER_PARTITION
- );
-
- SPTEST.PUT_SIZE(
- "Ports",
- TRUE,
- "maximum_ports",
- RTEMS_TEST_SUPPORT.PER_PORT
- );
-
- SPTEST.PUT_SIZE(
- "Periods",
- TRUE,
- "maximum_periods",
- RTEMS_TEST_SUPPORT.PER_PERIOD
- );
-
- SPTEST.PUT_SIZE(
- "Extensions",
- TRUE,
- "maximum_extensions",
- RTEMS_TEST_SUPPORT.PER_EXTENSION
- );
-
- SPTEST.PUT_SIZE(
- "Device Drivers",
- TRUE,
- "number_of_device_drivers",
- RTEMS_TEST_SUPPORT.PER_DRIVER
- );
-
- SPTEST.PUT_SIZE(
- "System Requirements",
- FALSE,
- REQUIREMENT => RTEMS_TEST_SUPPORT.SYSTEM_REQUIREMENTS
- );
-
- SPTEST.PUT_SIZE(
- "Floating Point Tasks",
- TRUE,
- "FP attributes",
- RTEMS_TEST_SUPPORT.PER_FP_TASK
- );
-
- TEXT_IO.PUT_LINE( "User's Tasks' Stacks - " );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT_LINE( "Interrupt Stacks - " );
- TEXT_IO.NEW_LINE;
-
- SPTEST.PUT_SIZE(
- "Global object tables",
- TRUE,
- "maximum_nodes",
- RTEMS_TEST_SUPPORT.PER_NODE
- );
-
- SPTEST.PUT_SIZE(
- "Global objects",
- TRUE,
- "maximum_global_objects",
- RTEMS_TEST_SUPPORT.PER_GLOBAL_OBJECT
- );
-
- SPTEST.PUT_SIZE(
- "Proxies",
- TRUE,
- "maximum_proxies",
- RTEMS_TEST_SUPPORT.PER_PROXY
- );
-
- TEXT_IO.PUT_LINE( "*** END OF TEST SIZE ***" );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end INIT;
-
---PAGE
---
--- PUT_SIZE
---
-
- procedure PUT_SIZE (
- DESCRIPTION : in STRING;
- HAS_FIELD_NAME : in BOOLEAN;
- FIELD_NAME : in STRING := "";
- REQUIREMENT : in RTEMS.UNSIGNED32 := 0
- ) is
- SPACES : constant STRING := " ";
- begin
-
- -- 21 is length of longest description (task's stacks)
-
- TEXT_IO.PUT( DESCRIPTION );
- TEXT_IO.PUT( SPACES( 1 .. 21 - DESCRIPTION'LENGTH ) );
- TEXT_IO.PUT( " - " );
- if HAS_FIELD_NAME = TRUE then
- TEXT_IO.PUT( FIELD_NAME );
- TEXT_IO.PUT( " * " );
- end if;
- UNSIGNED32_IO.PUT( REQUIREMENT );
- TEXT_IO.NEW_LINE;
-
- end PUT_SIZE;
-
-
-end SPTEST;
diff --git a/c/src/ada-tests/sptests/spsize/sptest.ads b/c/src/ada-tests/sptests/spsize/sptest.ads
deleted file mode 100644
index 312c7e9ead..0000000000
--- a/c/src/ada-tests/sptests/spsize/sptest.ads
+++ /dev/null
@@ -1,56 +0,0 @@
---
--- SPTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 1 of the RTEMS
--- Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package SPTEST is
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- PUT_SIZE
---
--- DESCRIPTION:
---
--- This procedure outputs the size information about the specified
--- object in a standard format.
---
-
- procedure PUT_SIZE (
- DESCRIPTION : in STRING;
- HAS_FIELD_NAME : in BOOLEAN;
- FIELD_NAME : in STRING := "";
- REQUIREMENT : in RTEMS.UNSIGNED32 := 0
- );
-
-end SPTEST;
diff --git a/c/src/ada-tests/support/address_io.adb b/c/src/ada-tests/support/address_io.adb
deleted file mode 100644
index 9e87ef3ed9..0000000000
--- a/c/src/ada-tests/support/address_io.adb
+++ /dev/null
@@ -1,47 +0,0 @@
---
--- Address_IO / Specification
---
--- DESCRIPTION:
---
--- This package instantiates the IO routines necessary to
--- perform IO on data of the type System.Address.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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;
-with Text_IO;
-
-package body Address_IO is
-
- procedure Put (
- Item : in System.Address;
- Width : in Natural := 8;
- Base : in Natural := 16
- ) is
- package Integer_IO is new TEXT_IO.Integer_IO( Integer );
- begin
-
- Integer_IO.Put(
- Integer( System.Storage_Elements.To_Integer( Item ) ),
- Width,
- Base
- );
-
- end Put;
-
-end Address_IO;
-
diff --git a/c/src/ada-tests/support/address_io.ads b/c/src/ada-tests/support/address_io.ads
deleted file mode 100644
index 3f832b70e0..0000000000
--- a/c/src/ada-tests/support/address_io.ads
+++ /dev/null
@@ -1,35 +0,0 @@
---
--- ADDRESS_IO / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package instantiates the IO routines necessary to
--- perform IO on data of the type System.Address.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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;
-
-package Address_IO is
-
- procedure Put (
- Item : in System.Address;
- Width : in Natural := 8;
- Base : in Natural := 16
- );
-
-end Address_IO;
-
diff --git a/c/src/ada-tests/support/float_io.ads b/c/src/ada-tests/support/float_io.ads
deleted file mode 100644
index 532dc6c447..0000000000
--- a/c/src/ada-tests/support/float_io.ads
+++ /dev/null
@@ -1,27 +0,0 @@
---
--- Float_IO / Specification
---
--- Description:
---
--- This package instantiates the IO routines necessary to
--- perform IO on data of the type Float.
---
--- Dependencies:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 Text_IO;
-
-package Float_IO is new Text_IO.Float_IO( Float );
-
diff --git a/c/src/ada-tests/support/fp.inc b/c/src/ada-tests/support/fp.inc
deleted file mode 100644
index 4fde6b16c1..0000000000
--- a/c/src/ada-tests/support/fp.inc
+++ /dev/null
@@ -1,154 +0,0 @@
---
--- fp.inc
---
--- Macros to produce a large number of LOCAL floating point variables. This
--- preprocessing is necessary to insure that the variables are
--- scoped properly and to avoid duplicating hundreds of lines
--- of code.
---
---
--- DEFICIENCIES:
---
--- 1. This currently does not address whether or not the CPU
--- actually has hardware floating point. It just does the work.
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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$
-
---
--- private definitions for macro use
---
-
--- macro usage EPSILON()
-define(`EPSILON',`0.0005')
-
--- macro usage FP_CHECK_ONE( value, base, factor )
-define(`FP_CHECK_ONE',`
- if ( $1 - ( $2 + $3 ) ) > EPSILON or else ( $1 - ( $2 + $3 ) ) < - EPSILON then
- UNSIGNED32_IO.PUT( TASK_INDEX );
- TEXT_IO.PUT( ": $1 wrong -- (" );
- FLOAT_IO.PUT( $1 );
- TEXT_IO.PUT( " not " );
- FLOAT_IO.PUT( $2 + $3 );
- TEXT_IO.PUT_LINE( ")" );
- end if
-'
-)
-
--- macro usage FP_DECLARE
-define(`FP_DECLARE', `
- FP01 : FLOAT := 1.0;
- FP02 : FLOAT := 2.0;
- FP03 : FLOAT := 3.0;
- FP04 : FLOAT := 4.0;
- FP05 : FLOAT := 5.0;
- FP06 : FLOAT := 6.0;
- FP07 : FLOAT := 7.0;
- FP08 : FLOAT := 8.0;
- FP09 : FLOAT := 9.0;
- FP10 : FLOAT := 10.0;
- FP11 : FLOAT := 11.0;
- FP12 : FLOAT := 12.0;
- FP13 : FLOAT := 13.0;
- FP14 : FLOAT := 14.0;
- FP15 : FLOAT := 15.0;
- FP16 : FLOAT := 16.0;
- FP17 : FLOAT := 17.0;
- FP18 : FLOAT := 18.0;
- FP19 : FLOAT := 19.0;
- FP20 : FLOAT := 20.0;
- FP21 : FLOAT := 21.0;
- FP22 : FLOAT := 22.0;
- FP23 : FLOAT := 23.0;
- FP24 : FLOAT := 24.0;
- FP25 : FLOAT := 25.0;
- FP26 : FLOAT := 26.0;
- FP27 : FLOAT := 27.0;
- FP28 : FLOAT := 28.0;
- FP29 : FLOAT := 29.0;
- FP30 : FLOAT := 30.0;
- FP31 : FLOAT := 31.0;
- FP32 : FLOAT := 32.0
-'
-)
-
-
--- macro usage FP_LOAD( factor )
-define(`FP_LOAD',`
- FP01 := FP01 + $1;
- FP02 := FP02 + $1;
- FP03 := FP03 + $1;
- FP04 := FP04 + $1;
- FP05 := FP05 + $1;
- FP06 := FP06 + $1;
- FP07 := FP07 + $1;
- FP08 := FP08 + $1;
- FP09 := FP09 + $1;
- FP10 := FP10 + $1;
- FP11 := FP11 + $1;
- FP12 := FP12 + $1;
- FP13 := FP13 + $1;
- FP14 := FP14 + $1;
- FP15 := FP15 + $1;
- FP16 := FP16 + $1;
- FP17 := FP17 + $1;
- FP18 := FP18 + $1;
- FP19 := FP19 + $1;
- FP20 := FP20 + $1;
- FP21 := FP21 + $1;
- FP22 := FP22 + $1;
- FP23 := FP23 + $1;
- FP24 := FP24 + $1;
- FP25 := FP25 + $1;
- FP26 := FP26 + $1;
- FP27 := FP27 + $1;
- FP28 := FP28 + $1;
- FP29 := FP29 + $1;
- FP30 := FP30 + $1;
- FP31 := FP31 + $1;
- FP32 := FP32 + $1
-')
-
--- macro usage FP_CHECK( factor )
-define(`FP_CHECK',`
- FP_CHECK_ONE( FP01, 1.0, $1 );
- FP_CHECK_ONE( FP02, 2.0, $1 );
- FP_CHECK_ONE( FP03, 3.0, $1 );
- FP_CHECK_ONE( FP04, 4.0, $1 );
- FP_CHECK_ONE( FP05, 5.0, $1 );
- FP_CHECK_ONE( FP06, 6.0, $1 );
- FP_CHECK_ONE( FP07, 7.0, $1 );
- FP_CHECK_ONE( FP08, 8.0, $1 );
- FP_CHECK_ONE( FP09, 9.0, $1 );
- FP_CHECK_ONE( FP10, 10.0, $1 );
- FP_CHECK_ONE( FP11, 11.0, $1 );
- FP_CHECK_ONE( FP12, 12.0, $1 );
- FP_CHECK_ONE( FP13, 13.0, $1 );
- FP_CHECK_ONE( FP14, 14.0, $1 );
- FP_CHECK_ONE( FP15, 15.0, $1 );
- FP_CHECK_ONE( FP16, 16.0, $1 );
- FP_CHECK_ONE( FP17, 17.0, $1 );
- FP_CHECK_ONE( FP18, 18.0, $1 );
- FP_CHECK_ONE( FP19, 19.0, $1 );
- FP_CHECK_ONE( FP20, 20.0, $1 );
- FP_CHECK_ONE( FP21, 21.0, $1 );
- FP_CHECK_ONE( FP22, 22.0, $1 );
- FP_CHECK_ONE( FP23, 23.0, $1 );
- FP_CHECK_ONE( FP24, 24.0, $1 );
- FP_CHECK_ONE( FP25, 25.0, $1 );
- FP_CHECK_ONE( FP26, 26.0, $1 );
- FP_CHECK_ONE( FP27, 27.0, $1 );
- FP_CHECK_ONE( FP28, 28.0, $1 );
- FP_CHECK_ONE( FP29, 29.0, $1 );
- FP_CHECK_ONE( FP30, 30.0, $1 );
- FP_CHECK_ONE( FP31, 31.0, $1 );
- FP_CHECK_ONE( FP32, 32.0, $1 )
-'
-)
diff --git a/c/src/ada-tests/support/init.c b/c/src/ada-tests/support/init.c
deleted file mode 100644
index de686055de..0000000000
--- a/c/src/ada-tests/support/init.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * This material may be reproduced by or for the U.S. Government pursuant
- * to the copyright license under the clause at DFARS 252.227-7013. This
- * notice must appear in all copies of this file and its derivatives.
- *
- * $Id$
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <bsp.h>
-
-void *POSIX_Init(
- void *argument
-)
-{
- extern int gnat_main ( int argc, char **argv, char **envp );
-
- (void) gnat_main ( 0, 0, 0 );
-
- exit( 0 );
-}
-
-/*
- * Only for sp04
- */
-
-rtems_id tcb_to_id(
- Thread_Control *tcb
-)
-{
- return tcb->Object.id;
-}
-
-#define CONFIGURE_INIT
-#include "config.h"
diff --git a/c/src/ada-tests/support/integer.inc b/c/src/ada-tests/support/integer.inc
deleted file mode 100644
index b7be26e8b6..0000000000
--- a/c/src/ada-tests/support/integer.inc
+++ /dev/null
@@ -1,145 +0,0 @@
---
--- integer.inc
---
--- Macros to produce a large number of LOCAL integer variables. This
--- preprocessing is necessary to insure that the variables are
--- scoped properly and to avoid duplicating hundreds of lines
--- of code.
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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$
-
---
--- private definitions for macro use
---
-
--- macro usage INTEGER_CHECK_ONE( value, base, factor )
-define(`INTEGER_CHECK_ONE',`
- if $1 /= ($2 + $3) then
- UNSIGNED32_IO.PUT( TASK_INDEX );
- TEXT_IO.PUT( ": $1 wrong -- (" );
- UNSIGNED32_IO.PUT( $1, BASE => 16);
- TEXT_IO.PUT( " not " );
- UNSIGNED32_IO.PUT( $2, BASE => 16 );
- TEXT_IO.PUT_LINE( ")" );
- end if
-'
-)
-
--- macro usage INTEGER_DECLARE
-define(`INTEGER_DECLARE', `
- INT01 : RTEMS.UNSIGNED32 := 1;
- INT02 : RTEMS.UNSIGNED32 := 2;
- INT03 : RTEMS.UNSIGNED32 := 3;
- INT04 : RTEMS.UNSIGNED32 := 4;
- INT05 : RTEMS.UNSIGNED32 := 5;
- INT06 : RTEMS.UNSIGNED32 := 6;
- INT07 : RTEMS.UNSIGNED32 := 7;
- INT08 : RTEMS.UNSIGNED32 := 8;
- INT09 : RTEMS.UNSIGNED32 := 9;
- INT10 : RTEMS.UNSIGNED32 := 10;
- INT11 : RTEMS.UNSIGNED32 := 11;
- INT12 : RTEMS.UNSIGNED32 := 12;
- INT13 : RTEMS.UNSIGNED32 := 13;
- INT14 : RTEMS.UNSIGNED32 := 14;
- INT15 : RTEMS.UNSIGNED32 := 15;
- INT16 : RTEMS.UNSIGNED32 := 16;
- INT17 : RTEMS.UNSIGNED32 := 17;
- INT18 : RTEMS.UNSIGNED32 := 18;
- INT19 : RTEMS.UNSIGNED32 := 19;
- INT20 : RTEMS.UNSIGNED32 := 20;
- INT21 : RTEMS.UNSIGNED32 := 21;
- INT22 : RTEMS.UNSIGNED32 := 22;
- INT23 : RTEMS.UNSIGNED32 := 23;
- INT24 : RTEMS.UNSIGNED32 := 24;
- INT25 : RTEMS.UNSIGNED32 := 25;
- INT26 : RTEMS.UNSIGNED32 := 26;
- INT27 : RTEMS.UNSIGNED32 := 27;
- INT28 : RTEMS.UNSIGNED32 := 28;
- INT29 : RTEMS.UNSIGNED32 := 29;
- INT30 : RTEMS.UNSIGNED32 := 30;
- INT31 : RTEMS.UNSIGNED32 := 31;
- INT32 : RTEMS.UNSIGNED32 := 32
-'
-)
-
-
--- macro usage INTEGER_LOAD( factor )
-define(`INTEGER_LOAD',`
- INT01 := INT01 + $1;
- INT02 := INT02 + $1;
- INT03 := INT03 + $1;
- INT04 := INT04 + $1;
- INT05 := INT05 + $1;
- INT06 := INT06 + $1;
- INT07 := INT07 + $1;
- INT08 := INT08 + $1;
- INT09 := INT09 + $1;
- INT10 := INT10 + $1;
- INT11 := INT11 + $1;
- INT12 := INT12 + $1;
- INT13 := INT13 + $1;
- INT14 := INT14 + $1;
- INT15 := INT15 + $1;
- INT16 := INT16 + $1;
- INT17 := INT17 + $1;
- INT18 := INT18 + $1;
- INT19 := INT19 + $1;
- INT20 := INT20 + $1;
- INT21 := INT21 + $1;
- INT22 := INT22 + $1;
- INT23 := INT23 + $1;
- INT24 := INT24 + $1;
- INT25 := INT25 + $1;
- INT26 := INT26 + $1;
- INT27 := INT27 + $1;
- INT28 := INT28 + $1;
- INT29 := INT29 + $1;
- INT30 := INT30 + $1;
- INT31 := INT31 + $1;
- INT32 := INT32 + $1
-')
-
--- macro usage INTEGER_CHECK( factor )
-define(`INTEGER_CHECK',`
- INTEGER_CHECK_ONE( INT01, 1, $1 );
- INTEGER_CHECK_ONE( INT02, 2, $1 );
- INTEGER_CHECK_ONE( INT03, 3, $1 );
- INTEGER_CHECK_ONE( INT04, 4, $1 );
- INTEGER_CHECK_ONE( INT05, 5, $1 );
- INTEGER_CHECK_ONE( INT06, 6, $1 );
- INTEGER_CHECK_ONE( INT07, 7, $1 );
- INTEGER_CHECK_ONE( INT08, 8, $1 );
- INTEGER_CHECK_ONE( INT09, 9, $1 );
- INTEGER_CHECK_ONE( INT10, 10, $1 );
- INTEGER_CHECK_ONE( INT11, 11, $1 );
- INTEGER_CHECK_ONE( INT12, 12, $1 );
- INTEGER_CHECK_ONE( INT13, 13, $1 );
- INTEGER_CHECK_ONE( INT14, 14, $1 );
- INTEGER_CHECK_ONE( INT15, 15, $1 );
- INTEGER_CHECK_ONE( INT16, 16, $1 );
- INTEGER_CHECK_ONE( INT17, 17, $1 );
- INTEGER_CHECK_ONE( INT18, 18, $1 );
- INTEGER_CHECK_ONE( INT19, 19, $1 );
- INTEGER_CHECK_ONE( INT20, 20, $1 );
- INTEGER_CHECK_ONE( INT21, 21, $1 );
- INTEGER_CHECK_ONE( INT22, 22, $1 );
- INTEGER_CHECK_ONE( INT23, 23, $1 );
- INTEGER_CHECK_ONE( INT24, 24, $1 );
- INTEGER_CHECK_ONE( INT25, 25, $1 );
- INTEGER_CHECK_ONE( INT26, 26, $1 );
- INTEGER_CHECK_ONE( INT27, 27, $1 );
- INTEGER_CHECK_ONE( INT28, 28, $1 );
- INTEGER_CHECK_ONE( INT29, 29, $1 );
- INTEGER_CHECK_ONE( INT30, 30, $1 );
- INTEGER_CHECK_ONE( INT31, 31, $1 );
- INTEGER_CHECK_ONE( INT32, 32, $1 )
-'
-)
diff --git a/c/src/ada-tests/support/rtems_calling_overhead.ads b/c/src/ada-tests/support/rtems_calling_overhead.ads
deleted file mode 100644
index 31bea79ef0..0000000000
--- a/c/src/ada-tests/support/rtems_calling_overhead.ads
+++ /dev/null
@@ -1,105 +0,0 @@
---
--- RTEMS_CALLING_OVERHEAD / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package contains the invocation overhead for each
--- of the RTEMS directives on the MC68020 Timing Platform.
--- This time is then subtracted from the execution time
--- of each directive as measured by the Timing Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package RTEMS_CALLING_OVERHEAD is
-
- INITIALIZE_EXECUTIVE : constant RTEMS.UNSIGNED32 := 0;
- SHUTDOWN_EXECUTIVE : constant RTEMS.UNSIGNED32 := 0;
- TASK_CREATE : constant RTEMS.UNSIGNED32 := 0;
- TASK_IDENT : constant RTEMS.UNSIGNED32 := 0;
- TASK_START : constant RTEMS.UNSIGNED32 := 0;
- TASK_RESTART : constant RTEMS.UNSIGNED32 := 0;
- TASK_DELETE : constant RTEMS.UNSIGNED32 := 0;
- TASK_SUSPEND : constant RTEMS.UNSIGNED32 := 0;
- TASK_RESUME : constant RTEMS.UNSIGNED32 := 0;
- TASK_SET_PRIORITY : constant RTEMS.UNSIGNED32 := 0;
- TASK_MODE : constant RTEMS.UNSIGNED32 := 0;
- TASK_GET_NOTE : constant RTEMS.UNSIGNED32 := 0;
- TASK_SET_NOTE : constant RTEMS.UNSIGNED32 := 0;
- TASK_WAKE_WHEN : constant RTEMS.UNSIGNED32 := 0;
- TASK_WAKE_AFTER : constant RTEMS.UNSIGNED32 := 0;
- INTERRUPT_CATCH : constant RTEMS.UNSIGNED32 := 0;
- CLOCK_GET : constant RTEMS.UNSIGNED32 := 0;
- CLOCK_SET : constant RTEMS.UNSIGNED32 := 0;
- CLOCK_TICK : constant RTEMS.UNSIGNED32 := 0;
-
- TIMER_CREATE : constant RTEMS.UNSIGNED32 := 0;
- TIMER_DELETE : constant RTEMS.UNSIGNED32 := 0;
- TIMER_IDENT : constant RTEMS.UNSIGNED32 := 0;
- TIMER_FIRE_AFTER : constant RTEMS.UNSIGNED32 := 0;
- TIMER_FIRE_WHEN : constant RTEMS.UNSIGNED32 := 0;
- TIMER_RESET : constant RTEMS.UNSIGNED32 := 0;
- TIMER_CANCEL : constant RTEMS.UNSIGNED32 := 0;
- SEMAPHORE_CREATE : constant RTEMS.UNSIGNED32 := 0;
- SEMAPHORE_DELETE : constant RTEMS.UNSIGNED32 := 0;
- SEMAPHORE_IDENT : constant RTEMS.UNSIGNED32 := 0;
- SEMAPHORE_OBTAIN : constant RTEMS.UNSIGNED32 := 0;
- SEMAPHORE_RELEASE : constant RTEMS.UNSIGNED32 := 0;
- MESSAGE_QUEUE_CREATE : constant RTEMS.UNSIGNED32 := 0;
- MESSAGE_QUEUE_IDENT : constant RTEMS.UNSIGNED32 := 0;
- MESSAGE_QUEUE_DELETE : constant RTEMS.UNSIGNED32 := 0;
- MESSAGE_QUEUE_SEND : constant RTEMS.UNSIGNED32 := 0;
- MESSAGE_QUEUE_URGENT : constant RTEMS.UNSIGNED32 := 0;
- MESSAGE_QUEUE_BROADCAST : constant RTEMS.UNSIGNED32 := 0;
- MESSAGE_QUEUE_RECEIVE : constant RTEMS.UNSIGNED32 := 0;
- MESSAGE_QUEUE_FLUSH : constant RTEMS.UNSIGNED32 := 0;
-
- EVENT_SEND : constant RTEMS.UNSIGNED32 := 0;
- EVENT_RECEIVE : constant RTEMS.UNSIGNED32 := 0;
- SIGNAL_CATCH : constant RTEMS.UNSIGNED32 := 0;
- SIGNAL_SEND : constant RTEMS.UNSIGNED32 := 0;
- PARTITION_CREATE : constant RTEMS.UNSIGNED32 := 0;
- PARTITION_IDENT : constant RTEMS.UNSIGNED32 := 0;
- PARTITION_DELETE : constant RTEMS.UNSIGNED32 := 0;
- PARTITION_GET_BUFFER : constant RTEMS.UNSIGNED32 := 0;
- PARTITION_RETURN_BUFFER : constant RTEMS.UNSIGNED32 := 0;
- REGION_CREATE : constant RTEMS.UNSIGNED32 := 0;
- REGION_IDENT : constant RTEMS.UNSIGNED32 := 0;
- REGION_DELETE : constant RTEMS.UNSIGNED32 := 0;
- REGION_GET_SEGMENT : constant RTEMS.UNSIGNED32 := 0;
- REGION_RETURN_SEGMENT : constant RTEMS.UNSIGNED32 := 0;
- PORT_CREATE : constant RTEMS.UNSIGNED32 := 0;
- PORT_IDENT : constant RTEMS.UNSIGNED32 := 0;
- PORT_DELETE : constant RTEMS.UNSIGNED32 := 0;
- PORT_EXTERNAL_TO_INTERNAL : constant RTEMS.UNSIGNED32 := 0;
- PORT_INTERNAL_TO_EXTERNAL : constant RTEMS.UNSIGNED32 := 0;
-
- IO_INITIALIZE : constant RTEMS.UNSIGNED32 := 0;
- IO_OPEN : constant RTEMS.UNSIGNED32 := 0;
- IO_CLOSE : constant RTEMS.UNSIGNED32 := 0;
- IO_READ : constant RTEMS.UNSIGNED32 := 0;
- IO_WRITE : constant RTEMS.UNSIGNED32 := 0;
- IO_CONTROL : constant RTEMS.UNSIGNED32 := 0;
- FATAL_ERROR_OCCURRED : constant RTEMS.UNSIGNED32 := 0;
- RATE_MONOTONIC_CREATE : constant RTEMS.UNSIGNED32 := 0;
- RATE_MONOTONIC_IDENT : constant RTEMS.UNSIGNED32 := 0;
- RATE_MONOTONIC_DELETE : constant RTEMS.UNSIGNED32 := 0;
- RATE_MONOTONIC_CANCEL : constant RTEMS.UNSIGNED32 := 0;
- RATE_MONOTONIC_PERIOD : constant RTEMS.UNSIGNED32 := 0;
- MULTIPROCESSING_ANNOUNCE : constant RTEMS.UNSIGNED32 := 0;
-
-end RTEMS_CALLING_OVERHEAD;
diff --git a/c/src/ada-tests/support/status_io.ads b/c/src/ada-tests/support/status_io.ads
deleted file mode 100644
index af56ff1a6a..0000000000
--- a/c/src/ada-tests/support/status_io.ads
+++ /dev/null
@@ -1,28 +0,0 @@
---
--- Status_IO / Specification
---
--- DESCRIPTION:
---
--- This package instantiates the IO routines necessary to
--- perform IO on data of the type Status.CODES.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with Text_IO;
-
-package Status_IO is new Text_IO.Enumeration_IO( RTEMS.Status_Codes );
-
diff --git a/c/src/ada-tests/support/test_support.adb b/c/src/ada-tests/support/test_support.adb
deleted file mode 100644
index 379f0dfdae..0000000000
--- a/c/src/ada-tests/support/test_support.adb
+++ /dev/null
@@ -1,236 +0,0 @@
---
--- Test_Support / Specification
---
--- DESCRIPTION:
---
--- This package provides routines which aid the Test Suites
--- and simplify their design and operation.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 Interfaces; use Interfaces;
-with RTEMS;
-with Unsigned32_IO;
-with Status_IO;
-with Text_IO;
-
-package body Test_Support is
-
---PAGE
---
--- Fatal_Directive_Status
---
-
- procedure Fatal_Directive_Status (
- Status : in RTEMS.Status_Codes;
- Desired : in RTEMS.Status_Codes;
- Message : in String
- ) is
- begin
-
- if not RTEMS.Are_Statuses_Equal( Status, Desired ) then
-
- Text_IO.Put( Message );
- Text_IO.Put( " FAILED -- expected " );
- Status_IO.Put( Desired );
- Text_IO.Put( " got " );
- Status_IO.Put( Status );
- Text_IO.New_Line;
-
- RTEMS.Fatal_Error_Occurred( RTEMS.Status_Codes'Pos( Status ) );
-
- end if;
-
- end Fatal_Directive_Status;
-
---PAGE
---
--- Directive_Failed
---
-
- procedure Directive_Failed (
- Status : in RTEMS.Status_Codes;
- Message : in String
- ) is
- begin
-
- Test_Support.Fatal_Directive_Status(
- Status,
- RTEMS.Successful,
- Message
- );
-
- end Directive_Failed;
-
---PAGE
---
--- Print_Time
---
-
- procedure Print_Time (
- Prefix : in String;
- Time_Buffer : in RTEMS.Time_Of_Day;
- Suffix : in String
- ) is
- begin
-
- Text_IO.Put( Prefix );
- Unsigned32_IO.Put( Time_Buffer.Hour, Width=>2 );
- Text_IO.Put( ":" );
- Unsigned32_IO.Put( Time_Buffer.Minute, Width=>2 );
- Text_IO.Put( ":" );
- Unsigned32_IO.Put( Time_Buffer.Second, Width=>2 );
- Text_IO.Put( " " );
- Unsigned32_IO.Put( Time_Buffer.Month, Width=>2 );
- Text_IO.Put( "/" );
- Unsigned32_IO.Put( Time_Buffer.Day, Width=>2 );
- Text_IO.Put( "/" );
- Unsigned32_IO.Put( Time_Buffer.Year, Width=>2 );
- Text_IO.Put( Suffix );
-
- end Print_Time;
-
---PAGE
---
--- Put_Dot
---
-
- procedure Put_Dot (
- Buffer : in String
- ) is
- begin
- Text_IO.Put( Buffer );
- Text_IO.FLUSH;
- end Put_Dot;
-
---PAGE
---
--- Pause
---
-
- procedure Pause is
- Ignored_String : String( 1 .. 80 );
- Ignored_Last : Natural;
-
- begin
-
- --
- -- Really should be a "put" followed by a "flush."
- --
- Text_IO.Put_Line( "<pause> " );
- -- Text_IO.Get_Line( Ignored_String, Ignored_Last );
-
- -- exception
-
- -- when Text_IO.End_Error =>
- -- -- ignore this error. It happens when redirecting input from /dev/null
- -- return;
-
- end Pause;
-
---PAGE
---
--- Pause_And_Screen_Number
---
-
- procedure Pause_And_Screen_Number (
- SCREEN : in RTEMS.Unsigned32
- ) is
- Ignored_String : String( 1 .. 80 );
- Ignored_Last : Natural;
- begin
-
- --
- -- Really should be a "put" followed by a "flush."
- --
- Text_IO.Put( "<pause - screen " );
- Unsigned32_IO.Put( SCREEN, Width=>2 );
- Text_IO.Put_Line( "> " );
- -- Text_IO.Get_Line( Ignored_String, Ignored_Last );
-
- -- exception
-
- -- when Text_IO.End_Error =>
- -- -- ignore this error. It happens when redirecting input from /dev/null
- -- return;
-
- end Pause_And_Screen_Number;
-
---PAGE
---
--- Put_Name
---
-
- procedure Put_Name (
- Name : in RTEMS.Name;
- New_Line : in Boolean
- ) is
- C1 : Character;
- C2 : Character;
- C3 : Character;
- C4 : Character;
- begin
-
- RTEMS.Name_To_Characters( Name, C1, C2, C3, C4 );
-
- Text_IO.Put( C1 );
- Text_IO.Put( C2 );
- Text_IO.Put( C3 );
- Text_IO.Put( C4 );
-
- if New_Line = True then
- Text_IO.New_Line;
- end if;
-
- end Put_Name;
-
---PAGE
---
--- Task_Number
---
-
- function Task_Number (
- TID : in RTEMS.ID
- ) return RTEMS.Unsigned32 is
- begin
-
- return RTEMS.Get_Index( TID ) - 1 -
- RTEMS.Configuration.RTEMS_API_Configuration.Number_Of_Initialization_Tasks;
-
- end Task_Number;
-
---PAGE
---
--- Do_Nothing
---
-
- procedure Do_Nothing is
- begin
- NULL;
- end Do_Nothing;
-
-
---PAGE
---
--- Milliseconds_Per_Tick
---
-
- function Milliseconds_Per_Tick
- return RTEMS.Unsigned32 is
- begin
- return RTEMS.Configuration.Microseconds_Per_Tick / 1000;
- end Milliseconds_Per_Tick;
-end Test_Support;
diff --git a/c/src/ada-tests/support/test_support.ads b/c/src/ada-tests/support/test_support.ads
deleted file mode 100644
index 4a40da4322..0000000000
--- a/c/src/ada-tests/support/test_support.ads
+++ /dev/null
@@ -1,173 +0,0 @@
---
--- Test_Support / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package provides routines which aid the Test Suites
--- and simplify their design and operation.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 Interfaces; use Interfaces;
-with RTEMS;
-with Text_IO;
-
-package Test_Support is
-
---
--- Fatal_Directive_Status
---
--- DESCRIPTION:
---
--- This subprogram checks if Status is equal to Desired. If so, it
--- returns immediately. Otherwise, it prints the Message along with
--- the Status and Desired status and invokes the Fatal_Error_Occurred
--- directive.
---
-
- procedure Fatal_Directive_Status (
- Status : in RTEMS.Status_Codes;
- Desired : in RTEMS.Status_Codes;
- Message : in STRING
- );
- pragma Inline ( Fatal_Directive_Status );
-
--- Directive_Failed
---
--- DESCRIPTION:
---
--- This subprogram checks if Status is equal to Successful. If so, it
--- returns immediately. Otherwise, it prints the Message along with
--- the Status and Desired status and invokes the Fatal_Error_Occurred
---
-
- procedure Directive_Failed (
- Status : in RTEMS.Status_Codes;
- Message : in STRING
- );
- pragma Inline ( Directive_Failed );
-
---
--- Print_Time
---
--- DESCRIPTION:
---
--- This subprogram prints the Prefix string, following by the
--- time of day in Time_Buffer, followed by the Suffix.
---
-
- procedure Print_Time (
- Prefix : in STRING;
- Time_Buffer : in RTEMS.Time_Of_Day;
- Suffix : in STRING
- );
- pragma Inline ( Print_Time );
-
---
--- Put_Dot
---
--- DESCRIPTION:
---
--- This subprogram prints a single character without a carriage return.
---
-
- procedure Put_Dot (
- Buffer : in STRING
- );
- pragma Inline ( Put_Dot );
-
---
--- Pause
---
--- DESCRIPTION:
---
--- This subprogram is used to pause screen output in the Test Suites
--- until the user presses carriage return.
---
-
- procedure Pause;
-
---
--- Pause_And_Screen_Number
---
--- DESCRIPTION:
---
--- This subprogram is used to pause screen output and print the current
--- number in the Test Suites until the user presses carriage return.
---
-
- procedure Pause_And_Screen_Number (
- SCREEN : in RTEMS.Unsigned32
- );
-
---
--- Put_Name
---
--- DESCRIPTION:
---
--- This subprogram prints the RTEMS object Name. If New_Line is TRUE,
--- then a carriage return is printed after the Name.
---
-
- procedure Put_Name (
- Name : in RTEMS.Name;
- New_Line : in Boolean
- );
-
---
--- Task_Number
---
--- DESCRIPTION:
---
--- This function returns the task index which the test should use
--- for TID.
---
-
- function Task_Number (
- TID : in RTEMS.ID
- ) return RTEMS.Unsigned32;
- pragma Inline ( Task_Number );
-
---
--- Do_Nothing
---
--- DESCRIPTION:
---
--- This procedure is called when a test wishes to use a delay
--- loop and insure that the compiler does not optimize it away.
---
-
- procedure Do_Nothing;
-
---
--- Ticks_Per_Second is the number of RTEMS clock ticks which
--- occur each second.
---
-
- Ticks_Per_Second : RTEMS.Interval;
- pragma Import (C, Ticks_Per_Second, "_TOD_Ticks_per_second");
-
---
--- Milliseconds_Per_Tick is the number of milliseconds which
--- occur between each RTEMS clock tick.
---
-
- function Milliseconds_Per_Tick
- return RTEMS.Unsigned32;
-
-private
-
-end Test_Support;
diff --git a/c/src/ada-tests/support/time_test_support.adb b/c/src/ada-tests/support/time_test_support.adb
deleted file mode 100644
index 5eba15fa58..0000000000
--- a/c/src/ada-tests/support/time_test_support.adb
+++ /dev/null
@@ -1,77 +0,0 @@
---
--- TIME_TEST_SUPPORT / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package provides routines which aid the individual tests in
--- the Timing Test Suite and simplify their design and operation.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with TEXT_IO;
-with UNSIGNED32_IO;
-
-package body TIME_TEST_SUPPORT is
-
---PAGE
---
--- PUT_TIME
---
-
- procedure PUT_TIME (
- MESSAGE : in STRING;
- TOTAL_TIME : in RTEMS.UNSIGNED32;
- ITERATIONS : in RTEMS.UNSIGNED32;
- LOOP_OVERHEAD : in RTEMS.UNSIGNED32;
- CALLING_OVERHEAD : in RTEMS.UNSIGNED32
- ) is
- PER_ITERATION : RTEMS.UNSIGNED32;
- begin
-
- PER_ITERATION := (TOTAL_TIME - LOOP_OVERHEAD) / ITERATIONS;
- PER_ITERATION := PER_ITERATION - CALLING_OVERHEAD;
-
- if PER_ITERATION = 0 then
-
- TEXT_IO.PUT( "TOTAL_TIME " );
- UNSIGNED32_IO.PUT( TOTAL_TIME );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "ITERATIONS " );
- UNSIGNED32_IO.PUT( ITERATIONS );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "LOOP_OVERHEAD " );
- UNSIGNED32_IO.PUT( LOOP_OVERHEAD );
- TEXT_IO.NEW_LINE;
-
- TEXT_IO.PUT( "CALLING_OVERHEAD " );
- UNSIGNED32_IO.PUT( CALLING_OVERHEAD );
- TEXT_IO.NEW_LINE;
-
- end if;
-
- TEXT_IO.PUT( MESSAGE );
- TEXT_IO.PUT( " " );
- UNSIGNED32_IO.PUT( PER_ITERATION );
- TEXT_IO.NEW_LINE;
- TEXT_IO.FLUSH;
-
- end PUT_TIME;
-
-end TIME_TEST_SUPPORT;
diff --git a/c/src/ada-tests/support/time_test_support.ads b/c/src/ada-tests/support/time_test_support.ads
deleted file mode 100644
index 6dbacaf69d..0000000000
--- a/c/src/ada-tests/support/time_test_support.ads
+++ /dev/null
@@ -1,54 +0,0 @@
---
--- TIME_TEST_SUPPORT / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package provides routines which aid the individual tests in
--- the Timing Test Suite and simplify their design and operation.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package TIME_TEST_SUPPORT is
-
---
--- The following constants define the number of times a directive
--- will be performed in the Timing Suite.
---
-
- OPERATION_COUNT : constant RTEMS.UNSIGNED32 := 100;
- ITERATION_COUNT : constant RTEMS.UNSIGNED32 := 100;
-
---
--- PUT_TIME
---
--- DESCRIPTION:
---
--- This subprogram prints the MESSAGE followed by the length of
--- time which each individual operation took. All times are
--- in microseconds.
---
-
- procedure PUT_TIME (
- MESSAGE : in STRING;
- TOTAL_TIME : in RTEMS.UNSIGNED32;
- ITERATIONS : in RTEMS.UNSIGNED32;
- LOOP_OVERHEAD : in RTEMS.UNSIGNED32;
- CALLING_OVERHEAD : in RTEMS.UNSIGNED32
- );
-
-end TIME_TEST_SUPPORT;
diff --git a/c/src/ada-tests/support/timer_driver.adb b/c/src/ada-tests/support/timer_driver.adb
deleted file mode 100644
index caa2374759..0000000000
--- a/c/src/ada-tests/support/timer_driver.adb
+++ /dev/null
@@ -1,45 +0,0 @@
---
--- Timer_Driver / Body
---
--- Description:
---
--- This package is the body for the Timer Driver.
---
--- Dependencies:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package body Timer_Driver is
-
---PAGE
---
--- Set_Find_Average_Overhead
---
---
-
- procedure Set_Find_Average_Overhead (
- Find_Flag : in Standard.Boolean
- ) is
- procedure Set_Find_Average_Overhead_base (
- Find_Flag : in RTEMS.Boolean
- );
- pragma Import (C, Set_Find_Average_Overhead_base,
- "Set_find_average_overhead");
- begin
- Set_Find_Average_Overhead_base (RTEMS.From_Ada_Boolean (Find_Flag));
- end Set_Find_Average_Overhead;
-
-end Timer_Driver;
diff --git a/c/src/ada-tests/support/timer_driver.ads b/c/src/ada-tests/support/timer_driver.ads
deleted file mode 100644
index bd7c4891b7..0000000000
--- a/c/src/ada-tests/support/timer_driver.ads
+++ /dev/null
@@ -1,81 +0,0 @@
---
--- Timer_Driver / Specification
---
--- Description:
---
--- This package is the specification for the Timer Driver.
---
--- Dependencies:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package Timer_Driver is
-
---
--- Initialize
---
--- Description:
---
--- This subprogram initializes the hardware timer to start it.
---
-
- procedure Initialize;
- pragma Import (C, Initialize, "Timer_initialize");
-
---
--- Read_Timer
---
--- Description:
---
--- This subprogram stops the timer, calculates the length of time
--- in microseconds since the timer was started, and returns that
--- value.
---
-
- function Read_Timer
- return RTEMS.Unsigned32;
- pragma Import (C, Read_Timer, "Read_timer");
-
---
--- Empty_Function
---
--- Description:
---
--- This subprogram is an empty subprogram. It is used to
--- insure that a loop will be included in the final executable
--- so that loop overhead can be subtracted from the directive
--- times reported.
---
-
- procedure Empty_Function;
- pragma Import (C, Empty_Function, "Empty_function");
-
---
--- Set_Find_Average_Overhead
---
--- Description:
---
--- This subprogram sets the Find_Average_Overhead flag to the
--- the value passed.
---
-
- procedure Set_Find_Average_Overhead (
- Find_Flag : in Standard.Boolean
- );
-
-private
-
-end Timer_Driver;
diff --git a/c/src/ada-tests/support/unsigned32_io.ads b/c/src/ada-tests/support/unsigned32_io.ads
deleted file mode 100644
index 4e207461c4..0000000000
--- a/c/src/ada-tests/support/unsigned32_io.ads
+++ /dev/null
@@ -1,28 +0,0 @@
---
--- Unsigned32_IO / Specification
---
--- DESCRIPTION:
---
--- This package instantiates the IO routines necessary to
--- perform IO on data of the type RTEMS.Unsigned32.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with Text_IO;
-
-package Unsigned32_IO is new Text_IO.Modular_IO( RTEMS.Unsigned32 );
-
diff --git a/c/src/ada-tests/tmtests/tm01/config.h b/c/src/ada-tests/tmtests/tm01/config.h
deleted file mode 100644
index be54f54955..0000000000
--- a/c/src/ada-tests/tmtests/tm01/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 2
-#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm01/tm01.adb b/c/src/ada-tests/tmtests/tm01/tm01.adb
deleted file mode 100644
index 34671d1495..0000000000
--- a/c/src/ada-tests/tmtests/tm01/tm01.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM01 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM01 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM01;
-
diff --git a/c/src/ada-tests/tmtests/tm01/tmtest.adb b/c/src/ada-tests/tmtests/tm01/tmtest.adb
deleted file mode 100644
index ba9ab5dee1..0000000000
--- a/c/src/ada-tests/tmtests/tm01/tmtest.adb
+++ /dev/null
@@ -1,276 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 1 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 1 ***" );
-
- TMTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
- TMTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
- TMTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
-
- RTEMS.TASK_CREATE(
- TMTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( 1 ),
- TMTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- 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.UNSIGNED32;
- NAME : RTEMS.NAME;
- SMID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- NAME := RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' );
-
- SEMAPHORE_OBTAIN_TIME := 0;
- SEMAPHORE_RELEASE_TIME := 0;
- SEMAPHORE_OBTAIN_NO_WAIT_TIME := 0;
- SEMAPHORE_OBTAIN_LOOP_TIME := 0;
- SEMAPHORE_RELEASE_LOOP_TIME := 0;
-
--- Time one invocation of SEMAPHORE_CREATE
-
- TIMER_DRIVER.INITIALIZE;
-
- RTEMS.SEMAPHORE_CREATE(
- NAME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- RTEMS.DEFAULT_ATTRIBUTES,
- RTEMS.NO_PRIORITY,
- SMID,
- STATUS
- );
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SEMAPHORE_CREATE",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.SEMAPHORE_CREATE
- );
-
--- Time one invocation of SEMAPHORE_DELETE
-
- TIMER_DRIVER.INITIALIZE;
-
- RTEMS.SEMAPHORE_DELETE( SMID, STATUS );
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SEMAPHORE_DELETE",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.SEMAPHORE_DELETE
- );
-
--- Create semaphore for repeated operations.
-
- RTEMS.SEMAPHORE_CREATE(
- NAME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- RTEMS.DEFAULT_ATTRIBUTES,
- RTEMS.NO_PRIORITY,
- SMID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" );
-
--- Perform repeated SEMAPHORE OBTAIN's and RELEASE's
-
- for ITERATIONS in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- SEMAPHORE_OBTAIN_LOOP_TIME := SEMAPHORE_OBTAIN_LOOP_TIME +
- TMTEST.END_TIME;
- SEMAPHORE_RELEASE_LOOP_TIME := SEMAPHORE_RELEASE_LOOP_TIME +
- TMTEST.END_TIME;
-
- -- Semaphore_obtain (available loop)
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.SEMAPHORE_OBTAIN(
- SMID,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
-
- end loop;
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- SEMAPHORE_OBTAIN_TIME := SEMAPHORE_OBTAIN_TIME + TMTEST.END_TIME;
-
- -- Semaphore_release
-
- TIMER_DRIVER.INITIALIZE;
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.SEMAPHORE_RELEASE( SMID, STATUS );
-
- end loop;
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- SEMAPHORE_RELEASE_TIME := SEMAPHORE_RELEASE_TIME +
- TMTEST.END_TIME;
-
- -- Semaphore_p (NO_WAIT)
-
- TIMER_DRIVER.INITIALIZE;
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.SEMAPHORE_OBTAIN(
- SMID,
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
-
- end loop;
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- SEMAPHORE_OBTAIN_NO_WAIT_TIME :=
- SEMAPHORE_OBTAIN_NO_WAIT_TIME + TMTEST.END_TIME;
-
- -- Semaphore_v
-
- TIMER_DRIVER.INITIALIZE;
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.SEMAPHORE_RELEASE( SMID, STATUS );
-
- end loop;
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- SEMAPHORE_RELEASE_TIME := SEMAPHORE_RELEASE_TIME +
- TMTEST.END_TIME;
-
- end loop;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SEMAPHORE_OBTAIN (semaphore available)",
- SEMAPHORE_OBTAIN_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT *
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- SEMAPHORE_OBTAIN_LOOP_TIME,
- RTEMS_CALLING_OVERHEAD.SEMAPHORE_OBTAIN
- );
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SEMAPHORE_OBTAIN (NO_WAIT)",
- SEMAPHORE_OBTAIN_NO_WAIT_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT *
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- SEMAPHORE_OBTAIN_LOOP_TIME,
- RTEMS_CALLING_OVERHEAD.SEMAPHORE_OBTAIN
- );
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SEMAPHORE_RELEASE (no task waiting)",
- SEMAPHORE_RELEASE_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT *
- TIME_TEST_SUPPORT.OPERATION_COUNT * 2,
- SEMAPHORE_RELEASE_LOOP_TIME * 2,
- RTEMS_CALLING_OVERHEAD.SEMAPHORE_RELEASE
- );
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm01/tmtest.ads b/c/src/ada-tests/tmtests/tm01/tmtest.ads
deleted file mode 100644
index 3c8b449675..0000000000
--- a/c/src/ada-tests/tmtests/tm01/tmtest.ads
+++ /dev/null
@@ -1,68 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 1 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task performs the all of the timing operations in this test.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm02/config.h b/c/src/ada-tests/tmtests/tm02/config.h
deleted file mode 100644
index 588ff58466..0000000000
--- a/c/src/ada-tests/tmtests/tm02/config.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_TIMERS 110
-#define CONFIGURE_MAXIMUM_SEMAPHORES 101
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm02/tm02.adb b/c/src/ada-tests/tmtests/tm02/tm02.adb
deleted file mode 100644
index ee13a6ddf7..0000000000
--- a/c/src/ada-tests/tmtests/tm02/tm02.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM02 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM02 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM02;
-
diff --git a/c/src/ada-tests/tmtests/tm02/tmtest.adb b/c/src/ada-tests/tmtests/tm02/tmtest.adb
deleted file mode 100644
index 606661c956..0000000000
--- a/c/src/ada-tests/tmtests/tm02/tmtest.adb
+++ /dev/null
@@ -1,209 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 2 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 2 ***" );
-
- TMTEST.TEST_INIT;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT is
- PRIORITY : RTEMS.TASK_PRIORITY;
- INDEX : RTEMS.UNSIGNED32;
- HIGH_ID : RTEMS.ID;
- LOW_ID : RTEMS.ID;
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- PRIORITY := 5;
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ),
- PRIORITY,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- HIGH_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF HIGH TASK" );
-
- PRIORITY := PRIORITY + 1;
-
- RTEMS.TASK_START(
- HIGH_ID,
- TMTEST.HIGH_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF HIGH TASK" );
-
- for INDEX in 2 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'M', 'I', 'D', ' ' ),
- PRIORITY,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE MIDDLE" );
-
- PRIORITY := PRIORITY + 1;
-
- RTEMS.TASK_START(
- TASK_ID,
- TMTEST.MIDDLE_TASKS'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START MIDDLE" );
-
- end loop;
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ),
- PRIORITY,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- LOW_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF LOW TASK" );
-
- RTEMS.TASK_START( LOW_ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF LOW TASK" );
-
- RTEMS.SEMAPHORE_CREATE(
- RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ),
- 0,
- RTEMS.DEFAULT_ATTRIBUTES,
- RTEMS.NO_PRIORITY,
- TMTEST.SEMAPHORE_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" );
-
- end TEST_INIT;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.SEMAPHORE_OBTAIN(
- TMTEST.SEMAPHORE_ID,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
-
- end HIGH_TASK;
-
---PAGE
---
--- MIDDLE_TASKS
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.SEMAPHORE_OBTAIN(
- TMTEST.SEMAPHORE_ID,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
-
- end MIDDLE_TASKS;
-
---PAGE
---
--- LOW_TASK
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "SEMAPHORE_OBTAIN (blocking)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.SEMAPHORE_OBTAIN
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end LOW_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm02/tmtest.ads b/c/src/ada-tests/tmtests/tm02/tmtest.ads
deleted file mode 100644
index 49e5df7c16..0000000000
--- a/c/src/ada-tests/tmtests/tm02/tmtest.ads
+++ /dev/null
@@ -1,103 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 2 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- The following is the ID of the semaphore used for timing operations.
---
-
- SEMAPHORE_ID : RTEMS.ID;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization.
---
-
- procedure TEST_INIT;
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task starts the timer and performs a blocking
--- SEMAPHORE_OBTAIN.
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- MIDDLE_TASKS
---
--- DESCRIPTION:
---
--- These RTEMS task start the timer and performs a blocking
--- SEMAPHORE_OBTAIN.
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- LOW_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task stops the timer and reports the execution time for
--- a blocking SEMAPHORE_OBTAIN.
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm03/config.h b/c/src/ada-tests/tmtests/tm03/config.h
deleted file mode 100644
index 588ff58466..0000000000
--- a/c/src/ada-tests/tmtests/tm03/config.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_TIMERS 110
-#define CONFIGURE_MAXIMUM_SEMAPHORES 101
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm03/tm03.adb b/c/src/ada-tests/tmtests/tm03/tm03.adb
deleted file mode 100644
index 13787b3d97..0000000000
--- a/c/src/ada-tests/tmtests/tm03/tm03.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM03 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM03 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM03;
-
diff --git a/c/src/ada-tests/tmtests/tm03/tmtest.adb b/c/src/ada-tests/tmtests/tm03/tmtest.adb
deleted file mode 100644
index 192248bbcc..0000000000
--- a/c/src/ada-tests/tmtests/tm03/tmtest.adb
+++ /dev/null
@@ -1,194 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 3 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 3 ***" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ),
- 252,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TEST_INIT" );
-
- RTEMS.TASK_START( TASK_ID, TMTEST.TEST_INIT'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TEST_INIT" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- PRIORITY : RTEMS.TASK_PRIORITY;
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- PRIORITY := 250;
-
- RTEMS.SEMAPHORE_CREATE(
- RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ),
- 0,
- RTEMS.DEFAULT_ATTRIBUTES,
- RTEMS.NO_PRIORITY,
- TMTEST.SEMAPHORE_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" );
-
- for INDEX in 2 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'M', 'I', 'D', ' ' ),
- PRIORITY,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE MIDDLE" );
-
- PRIORITY := PRIORITY - 1;
-
- RTEMS.TASK_START( TASK_ID, TMTEST.MIDDLE_TASKS'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START MIDDLE" );
-
- end loop;
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ),
- PRIORITY,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF HIGH TASK" );
-
- RTEMS.TASK_START( TASK_ID, TMTEST.HIGH_TASK'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF HIGH TASK" );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.SEMAPHORE_RELEASE( TMTEST.SEMAPHORE_ID, STATUS );
-
- end TEST_INIT;
-
---PAGE
---
--- MIDDLE_TASKS
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- PRIORITY : RTEMS.TASK_PRIORITY;
- ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.SEMAPHORE_OBTAIN(
- TMTEST.SEMAPHORE_ID,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
-
- RTEMS.SEMAPHORE_RELEASE( TMTEST.SEMAPHORE_ID, STATUS );
-
- end MIDDLE_TASKS;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- PRIORITY : RTEMS.TASK_PRIORITY;
- ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.SEMAPHORE_OBTAIN(
- TMTEST.SEMAPHORE_ID,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SEMAPHORE_RELEASE (preemptive)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.SEMAPHORE_RELEASE
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end HIGH_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm03/tmtest.ads b/c/src/ada-tests/tmtests/tm03/tmtest.ads
deleted file mode 100644
index 0090300559..0000000000
--- a/c/src/ada-tests/tmtests/tm03/tmtest.ads
+++ /dev/null
@@ -1,95 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 3 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- The following is the ID of the semaphore used for timing operations.
---
-
- SEMAPHORE_ID : RTEMS.ID;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization. After completion
--- of test initialization, the timer is started and a preemptive
--- SEMAPHORE_RELEASE is performed.
---
-
- procedure TEST_INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- MIDDLE_TASKS
---
--- DESCRIPTION:
---
--- This RTEMS task performs a blocking SEMAPHORE_OBTAIN. Once
--- is obtains the semaphore unit and executes again, it performs
--- a preemptive SEMAPHORE_RELEASE.
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task stops the timer and reports the execution
--- timer for a preemptive SEMAPHORE_RELEASE.
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm04/config.h b/c/src/ada-tests/tmtests/tm04/config.h
deleted file mode 100644
index e58f7c9923..0000000000
--- a/c/src/ada-tests/tmtests/tm04/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm04/tm04.adb b/c/src/ada-tests/tmtests/tm04/tm04.adb
deleted file mode 100644
index 2207f55dc1..0000000000
--- a/c/src/ada-tests/tmtests/tm04/tm04.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM04 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM04 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM04;
-
diff --git a/c/src/ada-tests/tmtests/tm04/tmtest.adb b/c/src/ada-tests/tmtests/tm04/tmtest.adb
deleted file mode 100644
index bef30afc6f..0000000000
--- a/c/src/ada-tests/tmtests/tm04/tmtest.adb
+++ /dev/null
@@ -1,501 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 4 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 4 ***" );
-
- TMTEST.TEST_INIT;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT
- is
- INDEX : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.TASK_COUNT := TIME_TEST_SUPPORT.OPERATION_COUNT;
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- 10,
- 1024,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( INDEX ),
- TMTEST.LOW_TASKS'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- RTEMS.SEMAPHORE_CREATE(
- RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ),
- 0,
- RTEMS.DEFAULT_ATTRIBUTES,
- RTEMS.NO_PRIORITY,
- TMTEST.SEMAPHORE_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" );
-
- end TEST_INIT;
-
---PAGE
---
--- HIGHEST_TASK
---
-
- procedure HIGHEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- OLD_PRIORITY : RTEMS.TASK_PRIORITY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- if ARGUMENT = 1 then
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_RESTART (blocked, preempt)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.TASK_RESTART
- );
-
- RTEMS.TASK_SET_PRIORITY( RTEMS.SELF, 254, OLD_PRIORITY, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
-
- elsif ARGUMENT = 2 then
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_RESTART (ready, preempt)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.TASK_RESTART
- );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" );
-
- else
-
- RTEMS.SEMAPHORE_OBTAIN(
- TMTEST.SEMAPHORE_ID,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
-
- end if;
-
- end HIGHEST_TASK;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- OLD_PRIORITY : RTEMS.TASK_PRIORITY;
- INDEX : RTEMS.UNSIGNED32;
- OVERHEAD : RTEMS.UNSIGNED32;
- NAME : RTEMS.NAME;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.TASK_RESTART( TMTEST.HIGHEST_ID, 1, STATUS );
- -- preempted by Higher_task
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.TASK_RESTART( TMTEST.HIGHEST_ID, 2, STATUS );
- -- preempted by Higher_task
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.SEMAPHORE_RELEASE( TMTEST.SEMAPHORE_ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SEMAPHORE_RELEASE (readying)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.SEMAPHORE_RELEASE
- );
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_DELETE( TMTEST.TASK_ID( INDEX ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" );
- end loop;
-
- NAME := RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_CREATE(
- NAME,
- 10,
- 1024,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( INDEX ),
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_CREATE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_CREATE
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_START(
- TMTEST.TASK_ID( INDEX ),
- TMTEST.LOW_TASKS'ACCESS,
- 0,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_START",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_START
- );
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_DELETE( TMTEST.TASK_ID( INDEX ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE LOOP" );
- end loop;
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_CREATE(
- NAME,
- 250,
- 1024,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
- RTEMS.TASK_START(
- TMTEST.TASK_ID( INDEX ),
- TMTEST.RESTART_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
- RTEMS.TASK_SUSPEND( TMTEST.TASK_ID( INDEX ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND LOOP" );
- end loop;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_RESTART( TMTEST.TASK_ID( INDEX ), 0, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_RESTART (suspended)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_RESTART
- );
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_SUSPEND( TMTEST.TASK_ID( INDEX ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND LOOP" );
- end loop;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_DELETE( TMTEST.TASK_ID( INDEX ), STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_DELETE (suspended)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_DELETE
- );
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_CREATE(
- NAME,
- 250,
- 1024,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
- RTEMS.TASK_START(
- TMTEST.TASK_ID( INDEX ),
- TMTEST.RESTART_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
- end loop;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_RESTART( TMTEST.TASK_ID( INDEX ), 1, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_RESTART (ready)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_RESTART
- );
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_SET_PRIORITY(
- TMTEST.TASK_ID( INDEX ),
- 5,
- OLD_PRIORITY,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY LOOP" );
- end loop;
-
- -- yield processor -- tasks block
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_RESTART( TMTEST.TASK_ID( INDEX ), 1, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_RESTART (blocked, no preempt)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_RESTART
- );
-
- -- yield processor -- tasks block
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_DELETE( TMTEST.TASK_ID( INDEX ), STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_DELETE (blocked)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_DELETE
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end HIGH_TASK;
-
---PAGE
---
--- LOW_TASKS
---
-
- procedure LOW_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.TASK_COUNT := TMTEST.TASK_COUNT - 1;
-
- if TMTEST.TASK_COUNT = 0 then
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'H', 'I', ' ', ' ' ),
- 5,
- 2048,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HI" );
-
- RTEMS.TASK_START(
- ID,
- TMTEST.HIGH_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HI" );
-
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ),
- 3,
- 2048,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.HIGHEST_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HIGH" );
-
- RTEMS.TASK_START(
- TMTEST.HIGHEST_ID,
- TMTEST.HIGHEST_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HIGH" );
-
-
- end if;
-
- RTEMS.SEMAPHORE_OBTAIN(
- TMTEST.SEMAPHORE_ID,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
-
- end LOW_TASKS;
-
---PAGE
---
--- RESTART_TASK
---
-
- procedure RESTART_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- PRIORITY : RTEMS.TASK_PRIORITY;
- ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- if ARGUMENT = 1 then
- RTEMS.SEMAPHORE_OBTAIN(
- TMTEST.SEMAPHORE_ID,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- STATUS
- );
- end if;
-
- end RESTART_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm04/tmtest.ads b/c/src/ada-tests/tmtests/tm04/tmtest.ads
deleted file mode 100644
index b4b29555df..0000000000
--- a/c/src/ada-tests/tmtests/tm04/tmtest.ads
+++ /dev/null
@@ -1,161 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 4 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIME_TEST_SUPPORT;
-with TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- This array contains the IDs of all RTEMS tasks created by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32
- range 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
-
---
--- This variable contains the id of the highest priority task
--- in the system.
---
-
- HIGHEST_ID : RTEMS.ID;
-
---
--- The following is the ID of the semaphore used for timing operations.
---
-
- SEMAPHORE_ID : RTEMS.ID;
-
---
--- The following is used to perform the same operation
--- on a group of tasks.
---
-
- TASK_COUNT : RTEMS.UNSIGNED32;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization.
---
-
- procedure TEST_INIT;
-
---
--- HIGHEST_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is created by one of the LOW_TASKS. The
--- first time it executes, it performs a blocking SEMAPHORE_OBTAIN
--- which transfers control of the processor to HIGH_TASK.
--- The first time HIGHEST_TASK is restarted, it stops the
--- timer and reports the execution time for a TASK_RESTART
--- for a blocked task which preempts the caller. The second
--- time HIGHEST_TASK is restarted, it stops the timer and reports
--- the execution time for a TASK_RESTART for a ready task which
--- has its original priority restored and preempts the caller.
---
-
- procedure HIGHEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is created by one of the LOW_TASKS. This
--- task restarts HIGHEST_TASK twice. HIGHEST_TASK is blocked the
--- first time and preempts this task when restarted. HIGHEST_TASK
--- is ready the second time but has lowered its priority. When
--- restarted for the second time, HIGHEST_TASK will have its
--- original priority restored and preempt this task.
--- Once control of the processor is returned to this task after
--- HIGHEST_TASK deletes itself, the following execution times
--- are measured and reported.
---
--- + readying SEMAPHORE_RELEASE
--- + TASK_CREATE
--- + TASK_START
--- + TASK_RESTART of a suspended task
--- + TASK_DELETE of a suspended task
--- + TASK_RESTART of a ready task
--- + TASK_RESTART of a blocked task which does not cause a preempt
--- + TASK_DELETE of a blocked task
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- LOW_TASKS
---
--- DESCRIPTION:
---
--- The last of these RTEMS tasks to execute creates HIGH_TASK
--- and HIGHEST_TASK. All of these tasks perform a blocking
--- SEMAPHORE_OBTAIN.
---
-
- procedure LOW_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- RESTART_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task
---
-
- procedure RESTART_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm05/config.h b/c/src/ada-tests/tmtests/tm05/config.h
deleted file mode 100644
index 588ff58466..0000000000
--- a/c/src/ada-tests/tmtests/tm05/config.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_TIMERS 110
-#define CONFIGURE_MAXIMUM_SEMAPHORES 101
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm05/tm05.adb b/c/src/ada-tests/tmtests/tm05/tm05.adb
deleted file mode 100644
index 535717a052..0000000000
--- a/c/src/ada-tests/tmtests/tm05/tm05.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM05 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM05 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM05;
-
diff --git a/c/src/ada-tests/tmtests/tm05/tmtest.adb b/c/src/ada-tests/tmtests/tm05/tmtest.adb
deleted file mode 100644
index 438988615a..0000000000
--- a/c/src/ada-tests/tmtests/tm05/tmtest.adb
+++ /dev/null
@@ -1,174 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 5 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 5 ***" );
-
- TMTEST.TEST_INIT;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT
- is
- INDEX : RTEMS.UNSIGNED32;
- TASK_ENTRY : RTEMS.TASK_ENTRY;
- PRIORITY : RTEMS.TASK_PRIORITY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- PRIORITY := 250;
-
- for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- PRIORITY,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- PRIORITY := PRIORITY - 1;
-
- if INDEX = 0 then
- TASK_ENTRY := TMTEST.LOW_TASK'ACCESS;
- elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then
- TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
- else
- TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
- end if;
-
- RTEMS.TASK_START( TMTEST.TASK_ID( INDEX ), TASK_ENTRY, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- end TEST_INIT;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_RESUME causing preempt",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TASK_RESUME
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end HIGH_TASK;
-
---PAGE
---
--- MIDDLE_TASKS
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
-
- TMTEST.TASK_INDEX := TMTEST.TASK_INDEX + 1;
- RTEMS.TASK_RESUME( TMTEST.TASK_ID( TMTEST.TASK_INDEX ), STATUS );
-
- end MIDDLE_TASKS;
-
---PAGE
---
--- LOW_TASK
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_SUSPEND self",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TASK_SUSPEND
- );
-
- TMTEST.TASK_INDEX := 1;
- TIMER_DRIVER.INITIALIZE;
- RTEMS.TASK_RESUME( TMTEST.TASK_ID( TMTEST.TASK_INDEX ), STATUS );
-
- end LOW_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm05/tmtest.ads b/c/src/ada-tests/tmtests/tm05/tmtest.ads
deleted file mode 100644
index 2bb9b28c8d..0000000000
--- a/c/src/ada-tests/tmtests/tm05/tmtest.ads
+++ /dev/null
@@ -1,113 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 5 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIME_TEST_SUPPORT;
-with TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- This array contains the IDs of all RTEMS tasks created by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32
- range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
-
- TASK_INDEX : RTEMS.UNSIGNED32;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization.
---
-
- procedure TEST_INIT;
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is the highest priority task in the system.
--- It starts the timer and performs a TASK_SUSPEND on SELF.
--- When this task executes again, it stops the timer and
--- reports the execution time for a preemptive TASK_RESUME.
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- MIDDLE_TASKS
---
--- DESCRIPTION:
---
--- These RTEMS tasks perform a TASK_SUSPEND on SELF. When each
--- task executes again, it performs preemptive TASK_RESUME on
--- a higher priority task.
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- LOW_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is the lowest priority task in the system.
--- When this task executes, it stops the timer and reports the
--- execution time for a blocking TASK_SUSPEND. After this,
--- it starts the timer and performs a TASK_RESUME on a
--- higher priority task.
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm06/config.h b/c/src/ada-tests/tmtests/tm06/config.h
deleted file mode 100644
index 588ff58466..0000000000
--- a/c/src/ada-tests/tmtests/tm06/config.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_TIMERS 110
-#define CONFIGURE_MAXIMUM_SEMAPHORES 101
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm06/tm06.adb b/c/src/ada-tests/tmtests/tm06/tm06.adb
deleted file mode 100644
index c3f0e3ea1b..0000000000
--- a/c/src/ada-tests/tmtests/tm06/tm06.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM06 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM06 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM06;
-
diff --git a/c/src/ada-tests/tmtests/tm06/tmtest.adb b/c/src/ada-tests/tmtests/tm06/tmtest.adb
deleted file mode 100644
index e8d471cd87..0000000000
--- a/c/src/ada-tests/tmtests/tm06/tmtest.adb
+++ /dev/null
@@ -1,210 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 6 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 6 ***" );
-
- TMTEST.TEST_INIT;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT
- is
- INDEX : RTEMS.UNSIGNED32;
- ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.TASK_RESTARTED := TIME_TEST_SUPPORT.OPERATION_COUNT;
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- 128,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- RTEMS.TASK_START( ID, TMTEST.TASK_1'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- end TEST_INIT;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- OVERHEAD : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- if TMTEST.TASK_RESTARTED = TIME_TEST_SUPPORT.OPERATION_COUNT then
- TIMER_DRIVER.INITIALIZE;
- end if;
-
- TMTEST.TASK_RESTARTED := TMTEST.TASK_RESTARTED - 1;
-
- if TMTEST.TASK_RESTARTED /= 0 then
- RTEMS.TASK_RESTART( RTEMS.SELF, 0, STATUS );
- end if;
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_RESTART self",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TASK_RESTART
- );
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- 254,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( INDEX ),
- TMTEST.NULL_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_SUSPEND( TMTEST.TASK_ID( INDEX ), STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_SUSPEND no preempt",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_SUSPEND
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_RESUME( TMTEST.TASK_ID( INDEX ), STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_RESUME no preempt",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_RESUME
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_DELETE( TMTEST.TASK_ID( INDEX ), STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_DELETE others",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_DELETE
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
---PAGE
---
--- NULL_TASK
---
-
- procedure NULL_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- begin
-
- NULL;
-
- end NULL_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm06/tmtest.ads b/c/src/ada-tests/tmtests/tm06/tmtest.ads
deleted file mode 100644
index bbeed402cf..0000000000
--- a/c/src/ada-tests/tmtests/tm06/tmtest.ads
+++ /dev/null
@@ -1,104 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 6 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIME_TEST_SUPPORT;
-with TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- This array contains the IDs of all RTEMS tasks created by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32
- range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
-
---
--- This variable is used to determine which restart of TASK_1 will start
--- timer and which will stop the timer and report the execution time.
---
-
- TASK_RESTARTED : RTEMS.UNSIGNED32;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization.
---
-
- procedure TEST_INIT;
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task is responsible for measuring and reporting the
--- following directive execution times:
---
--- + TASK_RESTART of SELF
--- + TASK_SUSPEND of another task with no context switch
--- + TASK_RESUME with no preemption
--- + TASK_DELETE of another task
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- NULL_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task has no operations. It is used to have
--- tasks to perform directives upon.
---
-
- procedure NULL_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm07/config.h b/c/src/ada-tests/tmtests/tm07/config.h
deleted file mode 100644
index 588ff58466..0000000000
--- a/c/src/ada-tests/tmtests/tm07/config.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_TIMERS 110
-#define CONFIGURE_MAXIMUM_SEMAPHORES 101
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm07/tm07.adb b/c/src/ada-tests/tmtests/tm07/tm07.adb
deleted file mode 100644
index dc39b07f1e..0000000000
--- a/c/src/ada-tests/tmtests/tm07/tm07.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM07 of the Single Processor Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM07 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM07;
-
diff --git a/c/src/ada-tests/tmtests/tm07/tmtest.adb b/c/src/ada-tests/tmtests/tm07/tmtest.adb
deleted file mode 100644
index 12a2402626..0000000000
--- a/c/src/ada-tests/tmtests/tm07/tmtest.adb
+++ /dev/null
@@ -1,179 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 7 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 7 ***" );
-
- TMTEST.TEST_INIT;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT
- is
- INDEX : RTEMS.UNSIGNED32;
- TASK_ENTRY : RTEMS.TASK_ENTRY;
- PRIORITY : RTEMS.TASK_PRIORITY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- PRIORITY := 250;
-
- for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- PRIORITY,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- PRIORITY := PRIORITY - 1;
-
- if INDEX = 0 then
- TASK_ENTRY := TMTEST.LOW_TASK'ACCESS;
- elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then
- TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
- else
- TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
- end if;
-
- RTEMS.TASK_START( TMTEST.TASK_ID( INDEX ), TASK_ENTRY, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- end TEST_INIT;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- OLD_PRIORITY : RTEMS.TASK_PRIORITY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- if ARGUMENT > 0 then
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_RESTART suspended/preempt",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TASK_RESTART
- );
- else
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
- end if;
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end HIGH_TASK;
-
---PAGE
---
--- MIDDLE_TASKS
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.TASK_INDEX := TMTEST.TASK_INDEX + 1;
-
- if ARGUMENT > 0 then
- RTEMS.TASK_RESTART(
- TMTEST.TASK_ID( TMTEST.TASK_INDEX ),
- 16#7FFFFFFF#,
- STATUS
- );
- else
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
- end if;
-
-
- end MIDDLE_TASKS;
-
---PAGE
---
--- LOW_TASK
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.TASK_INDEX := 1;
- TIMER_DRIVER.INITIALIZE;
-
- RTEMS.TASK_RESTART(
- TMTEST.TASK_ID( TMTEST.TASK_INDEX ),
- 16#7FFFFFFF#,
- STATUS
- );
-
- end LOW_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm07/tmtest.ads b/c/src/ada-tests/tmtests/tm07/tmtest.ads
deleted file mode 100644
index 1e97840005..0000000000
--- a/c/src/ada-tests/tmtests/tm07/tmtest.ads
+++ /dev/null
@@ -1,111 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 7 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with TIME_TEST_SUPPORT;
-with RTEMS;
-
-package TMTEST is
-
---
--- This array contains the IDs of all RTEMS tasks created by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32
- range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
-
- TASK_INDEX : RTEMS.UNSIGNED32;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization.
---
-
- procedure TEST_INIT;
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is the highest priority task in the system.
--- The first time it executes it suspends itself. When restarted
--- it stops the timer and reports the time for a TASK_RESTART
--- of a suspended task which results in a preemption.
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- MIDDLE_TASKS
---
--- DESCRIPTION:
---
--- These RTEMS tasks suspend themselves the first time they execute.
--- When restarted they perform a TASK_RESTART of a suspended
--- higher priority task which results in a preemption.
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- LOW_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is the lowest priority task in the system.
--- When it executes it starts the timer and restarts a higher
--- priority task which immediately preempts this task.
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm08/config.h b/c/src/ada-tests/tmtests/tm08/config.h
deleted file mode 100644
index 588ff58466..0000000000
--- a/c/src/ada-tests/tmtests/tm08/config.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_TIMERS 110
-#define CONFIGURE_MAXIMUM_SEMAPHORES 101
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm08/tm08.adb b/c/src/ada-tests/tmtests/tm08/tm08.adb
deleted file mode 100644
index 03b6a77bb8..0000000000
--- a/c/src/ada-tests/tmtests/tm08/tm08.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM08 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM08 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM08;
-
diff --git a/c/src/ada-tests/tmtests/tm08/tmtest.adb b/c/src/ada-tests/tmtests/tm08/tmtest.adb
deleted file mode 100644
index 971c7be472..0000000000
--- a/c/src/ada-tests/tmtests/tm08/tmtest.adb
+++ /dev/null
@@ -1,341 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 8 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 8 ***" );
-
- TMTEST.TEST_INIT;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT
- is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_CREATE(
- 1,
- 128,
- 1024,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- RTEMS.TASK_START( TASK_ID, TMTEST.TEST_TASK'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- RTEMS.TASK_CREATE(
- 1,
- 254,
- 1024,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- RTEMS.TASK_START( TASK_ID, TMTEST.TEST_TASK1'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- end TEST_INIT;
-
---PAGE
---
--- TEST_TASK
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- OVERHEAD : RTEMS.UNSIGNED32;
- OLD_PRIORITY : RTEMS.TASK_PRIORITY;
- OLD_MODE : RTEMS.MODE;
- OLD_NOTE : RTEMS.NOTEPAD_INDEX;
- TIME : RTEMS.TIME_OF_DAY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_SET_PRIORITY(
- TMTEST.TASK_ID,
- RTEMS.CURRENT_PRIORITY,
- OLD_PRIORITY,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_SET_PRIORITY current priority",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_SET_PRIORITY
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_SET_PRIORITY(
- TMTEST.TASK_ID,
- 253,
- OLD_PRIORITY,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_SET_PRIORITY no preempt",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_SET_PRIORITY
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_MODE(
- RTEMS.CURRENT_MODE,
- RTEMS.CURRENT_MODE,
- OLD_MODE,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_MODE (current)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_MODE
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_MODE(
- RTEMS.INTERRUPT_LEVEL( 1 ),
- RTEMS.INTERRUPT_MASK,
- OLD_MODE,
- STATUS
- );
- RTEMS.TASK_MODE(
- RTEMS.INTERRUPT_LEVEL( 0 ),
- RTEMS.INTERRUPT_MASK,
- OLD_MODE,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_MODE (no reschedule)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT * 2,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_MODE
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.TASK_MODE(
- RTEMS.NO_ASR,
- RTEMS.ASR_MASK,
- OLD_MODE,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_MODE (reschedule)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.TASK_MODE
- );
-
- RTEMS.TASK_MODE(
- RTEMS.NO_PREEMPT,
- RTEMS.PREEMPT_MASK,
- OLD_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
-
- RTEMS.TASK_SET_PRIORITY(
- TMTEST.TASK_ID,
- 1,
- OLD_PRIORITY,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.TASK_MODE( -- preempted by TEST_TASK1
- RTEMS.PREEMPT,
- RTEMS.PREEMPT_MASK,
- OLD_MODE,
- STATUS
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_SET_NOTE(
- TMTEST.TASK_ID,
- 8,
- 10,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_SET_NOTE ",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_SET_NOTE
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_GET_NOTE(
- TMTEST.TASK_ID,
- 8,
- OLD_NOTE,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_GET_NOTE ",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_GET_NOTE
- );
-
- TIME := (1988, 1, 1, 0, 0, 0, 0 );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.CLOCK_SET(
- TIME,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "CLOCK_SET",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.CLOCK_SET
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "CLOCK_GET",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.CLOCK_GET
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TEST_TASK;
-
---PAGE
---
--- TEST_TASK1
---
-
- procedure TEST_TASK1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_MODE (preemptive) ",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.TASK_MODE
- );
-
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
-
- end TEST_TASK1;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm08/tmtest.ads b/c/src/ada-tests/tmtests/tm08/tmtest.ads
deleted file mode 100644
index 0eccb2a452..0000000000
--- a/c/src/ada-tests/tmtests/tm08/tmtest.ads
+++ /dev/null
@@ -1,99 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 8 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
- TASK_ID : RTEMS.ID;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization.
---
-
- procedure TEST_INIT;
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is responsible for measuring and reporting the
--- following directive execution times:
---
--- + TASK_SET_PRIORITY to obtain the current priority
--- + TASK_SET_PRIORITY which does not require a context switch
--- + TASK_MODE to obtain the current mode
--- + TASK_MODE which does not require a reschedule
--- + TASK_MODE which does require a reschedule
--- + TASK_MODE which causes a preemption *** TEST_TASK1 executes
--- + TASK_SET_NOTE
--- + TASK_GET_NOTE
--- + CLOCK_SET
--- + CLOCK_GET
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK2
---
--- DESCRIPTION:
---
--- This RTEMS task is responsible for measuring and reporting the
--- following directive execution times:
---
--- + TASK_MODE which results in a preemption
---
-
- procedure TEST_TASK1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm09/config.h b/c/src/ada-tests/tmtests/tm09/config.h
deleted file mode 100644
index b0a10b776c..0000000000
--- a/c/src/ada-tests/tmtests/tm09/config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm09/tm09.adb b/c/src/ada-tests/tmtests/tm09/tm09.adb
deleted file mode 100644
index add60e1e84..0000000000
--- a/c/src/ada-tests/tmtests/tm09/tm09.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM09 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM09 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM09;
-
diff --git a/c/src/ada-tests/tmtests/tm09/tmtest.adb b/c/src/ada-tests/tmtests/tm09/tmtest.adb
deleted file mode 100644
index 0dd7d9d798..0000000000
--- a/c/src/ada-tests/tmtests/tm09/tmtest.adb
+++ /dev/null
@@ -1,302 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 9 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 9 ***" );
-
- RTEMS.TASK_CREATE(
- 1,
- 128,
- 4096,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- RTEMS.TASK_START( TASK_ID, TMTEST.TEST_TASK'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_TASK
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.MESSAGE_QUEUE_CREATE(
- 1,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 16,
- RTEMS.DEFAULT_OPTIONS,
- TMTEST.QUEUE_ID,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_CREATE",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_CREATE
- );
-
- TMTEST.QUEUE_TEST;
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.MESSAGE_QUEUE_DELETE(
- TMTEST.QUEUE_ID,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_DELETE",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_DELETE
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TEST_TASK;
-
---PAGE
---
--- QUEUE_TEST
---
-
- procedure QUEUE_TEST
- is
- SEND_LOOP_TIME : RTEMS.UNSIGNED32;
- URGENT_LOOP_TIME : RTEMS.UNSIGNED32;
- RECEIVE_LOOP_TIME : RTEMS.UNSIGNED32;
- SEND_TIME : RTEMS.UNSIGNED32;
- URGENT_TIME : RTEMS.UNSIGNED32;
- RECEIVE_TIME : RTEMS.UNSIGNED32;
- EMPTY_FLUSH_TIME : RTEMS.UNSIGNED32;
- FLUSH_TIME : RTEMS.UNSIGNED32;
- FLUSH_COUNT : RTEMS.UNSIGNED32;
- EMPTY_FLUSH_COUNT : RTEMS.UNSIGNED32;
- INDEX : RTEMS.UNSIGNED32;
- ITERATIONS : RTEMS.UNSIGNED32;
- LOOP_COUNT : RTEMS.UNSIGNED32;
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- SEND_LOOP_TIME := 0;
- URGENT_LOOP_TIME := 0;
- RECEIVE_LOOP_TIME := 0;
- SEND_TIME := 0;
- URGENT_TIME := 0;
- RECEIVE_TIME := 0;
- EMPTY_FLUSH_TIME := 0;
- FLUSH_TIME := 0;
- FLUSH_COUNT := 0;
- EMPTY_FLUSH_COUNT := 0;
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- for ITERATIONS in 1 .. TIME_TEST_SUPPORT.ITERATION_COUNT
- loop
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- SEND_LOOP_TIME := SEND_LOOP_TIME + TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- URGENT_LOOP_TIME := URGENT_LOOP_TIME + TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- RECEIVE_LOOP_TIME := RECEIVE_LOOP_TIME + TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.MESSAGE_QUEUE_SEND(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- 16,
- STATUS
- );
- end loop;
- SEND_TIME := SEND_TIME + TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- end loop;
- RECEIVE_TIME := RECEIVE_TIME + TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.MESSAGE_QUEUE_URGENT(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- 16,
- STATUS
- );
- end loop;
- URGENT_TIME := URGENT_TIME + TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- end loop;
- RECEIVE_TIME := RECEIVE_TIME + TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.MESSAGE_QUEUE_FLUSH(
- TMTEST.QUEUE_ID,
- EMPTY_FLUSH_COUNT,
- STATUS
- );
- EMPTY_FLUSH_TIME := EMPTY_FLUSH_TIME + TIMER_DRIVER.READ_TIMER;
-
- -- send one message to flush
- RTEMS.MESSAGE_QUEUE_SEND(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TIMER_DRIVER.INITIALIZE;
- RTEMS.MESSAGE_QUEUE_FLUSH(
- TMTEST.QUEUE_ID,
- FLUSH_COUNT,
- STATUS
- );
- FLUSH_TIME := FLUSH_TIME + TIMER_DRIVER.READ_TIMER;
-
- end loop;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_SEND (no tasks waiting)",
- SEND_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT *
- TIME_TEST_SUPPORT.ITERATION_COUNT,
- SEND_LOOP_TIME,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_SEND
- );
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_URGENT (no tasks waiting)",
- URGENT_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT *
- TIME_TEST_SUPPORT.ITERATION_COUNT,
- URGENT_LOOP_TIME,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_URGENT
- );
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_RECEIVE (messages available)",
- RECEIVE_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT *
- TIME_TEST_SUPPORT.ITERATION_COUNT * 2,
- RECEIVE_LOOP_TIME * 2,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_RECEIVE
- );
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_FLUSH (empty queue)",
- EMPTY_FLUSH_TIME,
- TIME_TEST_SUPPORT.ITERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_FLUSH
- );
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_FLUSH (messages flushed)",
- FLUSH_TIME,
- TIME_TEST_SUPPORT.ITERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_FLUSH
- );
-
- end QUEUE_TEST;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm09/tmtest.ads b/c/src/ada-tests/tmtests/tm09/tmtest.ads
deleted file mode 100644
index d1a4f3eac1..0000000000
--- a/c/src/ada-tests/tmtests/tm09/tmtest.ads
+++ /dev/null
@@ -1,100 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 9 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- Buffer Record similar to that used by RTEMS 3.2.1. Using this
--- avoids changes to the test.
---
-
- type BUFFER is
- record
- FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
- FIELD2 : RTEMS.UNSIGNED32;
- FIELD3 : RTEMS.UNSIGNED32;
- FIELD4 : RTEMS.UNSIGNED32;
- end record;
-
---
--- The following is the ID of the message queue used for timing operations.
---
-
- QUEUE_ID : RTEMS.ID;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is responsible for measuring and reporting the
--- following directive execution times:
---
--- + MESSAGE_QUEUE_CREATE
--- + MESSAGE_QUEUE_DELETE
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- QUEUE_TEST
---
--- DESCRIPTION:
---
--- This subprogram is responsible for measuring and reporting the
--- following directive execution times:
---
--- + MESSAGE_QUEUE_SEND with no tasks waiting
--- + MESSAGE_QUEUE_URGENT with no tasks waiting
--- + MESSAGE_QUEUE_RECEIVE with messages available
--- + MESSAGE_QUEUE_FLUSH with an empty message queue
--- + MESSAGE_QUEUE_FLUSH with messages flushed
---
-
- procedure QUEUE_TEST;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm10/config.h b/c/src/ada-tests/tmtests/tm10/config.h
deleted file mode 100644
index a3748d64ce..0000000000
--- a/c/src/ada-tests/tmtests/tm10/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 110
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm10/tm10.adb b/c/src/ada-tests/tmtests/tm10/tm10.adb
deleted file mode 100644
index 79f725dc0b..0000000000
--- a/c/src/ada-tests/tmtests/tm10/tm10.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM10 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM10 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM10;
-
diff --git a/c/src/ada-tests/tmtests/tm10/tmtest.adb b/c/src/ada-tests/tmtests/tm10/tmtest.adb
deleted file mode 100644
index 99e776f311..0000000000
--- a/c/src/ada-tests/tmtests/tm10/tmtest.adb
+++ /dev/null
@@ -1,225 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 10 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 10 ***" );
-
- TMTEST.TEST_INIT;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT
- is
- INDEX : RTEMS.UNSIGNED32;
- TASK_ENTRY : RTEMS.TASK_ENTRY;
- PRIORITY : RTEMS.TASK_PRIORITY;
- OVERHEAD : RTEMS.UNSIGNED32;
- TASK_ID : RTEMS.ID;
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- PRIORITY := 5;
-
- for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- PRIORITY,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- PRIORITY := PRIORITY + 1;
-
- if INDEX = 0 then
- TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
- elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then
- TASK_ENTRY := TMTEST.LOW_TASK'ACCESS;
- else
- TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
- end if;
-
- RTEMS.TASK_START( TASK_ID, TASK_ENTRY, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- 1,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 16,
- RTEMS.DEFAULT_OPTIONS,
- TMTEST.QUEUE_ID,
- STATUS
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_RECEIVE (NO_WAIT)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_RECEIVE
- );
-
- end TEST_INIT;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- TIMER_DRIVER.INITIALIZE;
-
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
-
- end HIGH_TASK;
-
---PAGE
---
--- MIDDLE_TASKS
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
-
- end MIDDLE_TASKS;
-
---PAGE
---
--- LOW_TASK
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_RECEIVE (blocking)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_RECEIVE
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end LOW_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm10/tmtest.ads b/c/src/ada-tests/tmtests/tm10/tmtest.ads
deleted file mode 100644
index 9268fa8bac..0000000000
--- a/c/src/ada-tests/tmtests/tm10/tmtest.ads
+++ /dev/null
@@ -1,117 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 10 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- Buffer Record similar to that used by RTEMS 3.2.1. Using this
--- avoids changes to the test.
---
-
- type BUFFER is
- record
- FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
- FIELD2 : RTEMS.UNSIGNED32;
- FIELD3 : RTEMS.UNSIGNED32;
- FIELD4 : RTEMS.UNSIGNED32;
- end record;
-
---
--- The following is the ID of the message queue used for timing operations.
---
-
- QUEUE_ID : RTEMS.ID;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization. After initialization
--- has been completed, the NO_WAIT case for MESSAGE_QUEUE_RECEIVE
--- is timed and reported.
---
-
- procedure TEST_INIT;
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is the highest priority task in the system.
--- It starts the timer and performs a blocking MESSAGE_QUEUE_RECEIVE.
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- MIDDLE_TASKS
---
--- DESCRIPTION:
---
--- These RTEMS tasks perform a blocking MESSAGE_QUEUE_RECEIVE.
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- LOW_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task stops the timer and reports the execution time
--- of a blocking MESSAGE_QUEUE_RECEIVE.
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm11/config.h b/c/src/ada-tests/tmtests/tm11/config.h
deleted file mode 100644
index b82372ca0f..0000000000
--- a/c/src/ada-tests/tmtests/tm11/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm11/tm11.adb b/c/src/ada-tests/tmtests/tm11/tm11.adb
deleted file mode 100644
index d88dae9fa4..0000000000
--- a/c/src/ada-tests/tmtests/tm11/tm11.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM11 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM11 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM11;
-
diff --git a/c/src/ada-tests/tmtests/tm11/tmtest.adb b/c/src/ada-tests/tmtests/tm11/tmtest.adb
deleted file mode 100644
index 5cba54d365..0000000000
--- a/c/src/ada-tests/tmtests/tm11/tmtest.adb
+++ /dev/null
@@ -1,219 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 11 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 11 ***" );
-
- RTEMS.TASK_CREATE(
- 1,
- 251,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- RTEMS.TASK_START(
- TASK_ID,
- TMTEST.TEST_INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- TASK_ENTRY : RTEMS.TASK_ENTRY;
- PRIORITY : RTEMS.TASK_PRIORITY;
- TASK_ID : RTEMS.ID;
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
--- As each task is started, it preempts this task and performs a blocking
--- MESSAGE_QUEUE_RECEIVE. Upon completion of this loop all created tasks
--- are blocked.
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ),
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 16,
- RTEMS.DEFAULT_OPTIONS,
- TMTEST.QUEUE_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" );
-
- PRIORITY := 250;
-
- for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- PRIORITY,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- PRIORITY := PRIORITY - 1;
-
- if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then
- TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
- else
- TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
- end if;
-
- RTEMS.TASK_START( TASK_ID, TASK_ENTRY, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.MESSAGE_QUEUE_SEND(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- 16,
- STATUS
- );
-
- end TEST_INIT;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_SEND (preemptive)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_SEND
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end HIGH_TASK;
-
---PAGE
---
--- MIDDLE_TASKS
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
-
- RTEMS.MESSAGE_QUEUE_SEND(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- 16,
- STATUS
- );
-
- end MIDDLE_TASKS;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm11/tmtest.ads b/c/src/ada-tests/tmtests/tm11/tmtest.ads
deleted file mode 100644
index 82b9ba2fbe..0000000000
--- a/c/src/ada-tests/tmtests/tm11/tmtest.ads
+++ /dev/null
@@ -1,114 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 11 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- Buffer Record similar to that used by RTEMS 3.2.1. Using this
--- avoids changes to the test.
---
-
- type BUFFER is
- record
- FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
- FIELD2 : RTEMS.UNSIGNED32;
- FIELD3 : RTEMS.UNSIGNED32;
- FIELD4 : RTEMS.UNSIGNED32;
- end record;
-
---
--- The following is the ID of the message queue used for timing operations.
---
-
- QUEUE_ID : RTEMS.ID;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization. As each application
--- task is created and started, it will preempt this task and
--- perform a blocking MESSAGE_QUEUE_RECEIVE. Once all of the
--- initialization is completed, the timer is started and the first
--- preemptive MESSAGE_QUEUE_SEND is executed.
---
-
- procedure TEST_INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is the highest priority task in the system.
--- It performs a blocking blocking MESSAGE_QUEUE_RECEIVE. It is
--- the last test task created and started. Thus it is the last
--- task to be enqueued waiting for a message and the last task
--- to receive the message. Once it receives the message, it
--- stops the timer and reports the execution time for a
--- preemptive MESSAGE_QUEUE_SEND.
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- MIDDLE_TASKS
---
--- DESCRIPTION:
---
--- As each of these RTEMS tasks is created and started, it preempts
--- the initialization task and perform a blocking MESSAGE_QUEUE_RECEIVE.
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm12/config.h b/c/src/ada-tests/tmtests/tm12/config.h
deleted file mode 100644
index b82372ca0f..0000000000
--- a/c/src/ada-tests/tmtests/tm12/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm12/tm12.adb b/c/src/ada-tests/tmtests/tm12/tm12.adb
deleted file mode 100644
index aa19b74a5c..0000000000
--- a/c/src/ada-tests/tmtests/tm12/tm12.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM12 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM12 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM12;
-
diff --git a/c/src/ada-tests/tmtests/tm12/tmtest.adb b/c/src/ada-tests/tmtests/tm12/tmtest.adb
deleted file mode 100644
index eb25d84829..0000000000
--- a/c/src/ada-tests/tmtests/tm12/tmtest.adb
+++ /dev/null
@@ -1,212 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 12 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 12 ***" );
-
- RTEMS.TASK_CREATE(
- 1,
- 251,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- RTEMS.TASK_START(
- TASK_ID,
- TMTEST.TEST_INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- TASK_ENTRY : RTEMS.TASK_ENTRY;
- PRIORITY : RTEMS.TASK_PRIORITY;
- TASK_ID : RTEMS.ID;
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ),
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 16,
- RTEMS.DEFAULT_OPTIONS,
- TMTEST.QUEUE_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" );
-
- PRIORITY := 250;
-
- for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- PRIORITY,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- PRIORITY := PRIORITY - 1;
-
- if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then
- TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
- else
- TASK_ENTRY := TMTEST.LOW_TASKS'ACCESS;
- end if;
-
- RTEMS.TASK_START( TASK_ID, TASK_ENTRY, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- end TEST_INIT;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- INDEX : RTEMS.UNSIGNED32;
- OVERHEAD : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.MESSAGE_QUEUE_SEND(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- 16,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); --XXX
-
- end loop;
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_SEND (readying)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_SEND
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end HIGH_TASK;
-
---PAGE
---
--- LOW_TASK
---
-
- procedure LOW_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); --XXX
-
- end LOW_TASKS;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm12/tmtest.ads b/c/src/ada-tests/tmtests/tm12/tmtest.ads
deleted file mode 100644
index b18df42719..0000000000
--- a/c/src/ada-tests/tmtests/tm12/tmtest.ads
+++ /dev/null
@@ -1,105 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 12 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- Buffer Record similar to that used by RTEMS 3.2.1. Using this
--- avoids changes to the test.
---
-
- type BUFFER is
- record
- FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
- FIELD2 : RTEMS.UNSIGNED32;
- FIELD3 : RTEMS.UNSIGNED32;
- FIELD4 : RTEMS.UNSIGNED32;
- end record;
-
---
--- The following is the ID of the message queue used for timing operations.
---
-
- QUEUE_ID : RTEMS.ID;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization.
---
-
- procedure TEST_INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is the lowest priority task in the system. It
--- only executes after all of the LOW_TASKS have blocked. It then
--- times a readying MESSAGE_QUEUE_SEND.
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- LOW_TASKS
---
--- DESCRIPTION:
---
--- These RTEMS tasks perform a blocking MESSAGE_QUEUE_RECEIVE.
---
-
- procedure LOW_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm13/config.h b/c/src/ada-tests/tmtests/tm13/config.h
deleted file mode 100644
index b82372ca0f..0000000000
--- a/c/src/ada-tests/tmtests/tm13/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm13/tm13.adb b/c/src/ada-tests/tmtests/tm13/tm13.adb
deleted file mode 100644
index 79f3aabf2b..0000000000
--- a/c/src/ada-tests/tmtests/tm13/tm13.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM13 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM13 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM13;
-
diff --git a/c/src/ada-tests/tmtests/tm13/tmtest.adb b/c/src/ada-tests/tmtests/tm13/tmtest.adb
deleted file mode 100644
index 2a657d9515..0000000000
--- a/c/src/ada-tests/tmtests/tm13/tmtest.adb
+++ /dev/null
@@ -1,217 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 13 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 13 ***" );
-
- RTEMS.TASK_CREATE(
- 1,
- 251,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- RTEMS.TASK_START(
- TASK_ID,
- TMTEST.TEST_INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- TASK_ENTRY : RTEMS.TASK_ENTRY;
- PRIORITY : RTEMS.TASK_PRIORITY;
- TASK_ID : RTEMS.ID;
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
--- As each task is started, it preempts this task and performs a blocking
--- MESSAGE_QUEUE_RECEIVE. Upon completion of this loop all created tasks
--- are blocked.
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ),
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 16,
- RTEMS.DEFAULT_OPTIONS,
- TMTEST.QUEUE_ID,
- STATUS
- );
-
- PRIORITY := 250;
-
- for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- PRIORITY,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- PRIORITY := PRIORITY - 1;
-
- if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then
- TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
- else
- TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
- end if;
-
- RTEMS.TASK_START( TASK_ID, TASK_ENTRY, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.MESSAGE_QUEUE_URGENT(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- 16,
- STATUS
- );
-
- end TEST_INIT;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_URGENT (preemptive)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_URGENT
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end HIGH_TASK;
-
---PAGE
---
--- MIDDLE_TASKS
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
-
- RTEMS.MESSAGE_QUEUE_URGENT(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- 16,
- STATUS
- );
-
- end MIDDLE_TASKS;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm13/tmtest.ads b/c/src/ada-tests/tmtests/tm13/tmtest.ads
deleted file mode 100644
index 2ecf4a3a96..0000000000
--- a/c/src/ada-tests/tmtests/tm13/tmtest.ads
+++ /dev/null
@@ -1,114 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 13 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- Buffer Record similar to that used by RTEMS 3.2.1. Using this
--- avoids changes to the test.
---
-
- type BUFFER is
- record
- FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
- FIELD2 : RTEMS.UNSIGNED32;
- FIELD3 : RTEMS.UNSIGNED32;
- FIELD4 : RTEMS.UNSIGNED32;
- end record;
-
---
--- The following is the ID of the message queue used for timing operations.
---
-
- QUEUE_ID : RTEMS.ID;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization. As each application
--- task is created and started, it will preempt this task and
--- perform a blocking MESSAGE_QUEUE_RECEIVE. Once all of the
--- initialization is completed, the timer is started and the first
--- preemptive MESSAGE_QUEUE_URGENT is executed.
---
-
- procedure TEST_INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is the highest priority task in the system.
--- It performs a blocking blocking MESSAGE_QUEUE_RECEIVE. It is
--- the last test task created and started. Thus it is the last
--- task to be enqueued waiting for a message and the last task
--- to receive the message. Once it receives the message, it
--- stops the timer and reports the execution time for a
--- preemptive MESSAGE_QUEUE_URGENT.
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- MIDDLE_TASKS
---
--- DESCRIPTION:
---
--- As each of these RTEMS tasks is created and started, it preempts
--- the initialization task and perform a blocking MESSAGE_QUEUE_RECEIVE.
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm14/config.h b/c/src/ada-tests/tmtests/tm14/config.h
deleted file mode 100644
index b82372ca0f..0000000000
--- a/c/src/ada-tests/tmtests/tm14/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm14/tm14.adb b/c/src/ada-tests/tmtests/tm14/tm14.adb
deleted file mode 100644
index c155fcd29d..0000000000
--- a/c/src/ada-tests/tmtests/tm14/tm14.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM14 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM14 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM14;
-
diff --git a/c/src/ada-tests/tmtests/tm14/tmtest.adb b/c/src/ada-tests/tmtests/tm14/tmtest.adb
deleted file mode 100644
index 69eeb368eb..0000000000
--- a/c/src/ada-tests/tmtests/tm14/tmtest.adb
+++ /dev/null
@@ -1,216 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 14 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 14 ***" );
-
- RTEMS.TASK_CREATE(
- 1,
- 251,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- RTEMS.TASK_START(
- TASK_ID,
- TMTEST.TEST_INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- TASK_ENTRY : RTEMS.TASK_ENTRY;
- PRIORITY : RTEMS.TASK_PRIORITY;
- TASK_ID : RTEMS.ID;
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ),
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 16,
- RTEMS.DEFAULT_OPTIONS,
- TMTEST.QUEUE_ID,
- STATUS
- );
-
- PRIORITY := 250;
-
- for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- PRIORITY,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- PRIORITY := PRIORITY - 1;
-
- if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then
- TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
- else
- TASK_ENTRY := TMTEST.LOW_TASKS'ACCESS;
- end if;
-
- RTEMS.TASK_START( TASK_ID, TASK_ENTRY, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.MESSAGE_QUEUE_URGENT(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- 16,
- STATUS
- );
-
- end TEST_INIT;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- OVERHEAD : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.MESSAGE_QUEUE_URGENT(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- 16,
- STATUS
- );
-
- end loop;
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_URGENT (readying)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_URGENT
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end HIGH_TASK;
-
---PAGE
---
--- LOW_TASKS
---
-
- procedure LOW_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- TMTEST.QUEUE_ID,
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
-
- end LOW_TASKS;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm14/tmtest.ads b/c/src/ada-tests/tmtests/tm14/tmtest.ads
deleted file mode 100644
index e08a167fcb..0000000000
--- a/c/src/ada-tests/tmtests/tm14/tmtest.ads
+++ /dev/null
@@ -1,105 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 14 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- Buffer Record similar to that used by RTEMS 3.2.1. Using this
--- avoids changes to the test.
---
-
- type BUFFER is
- record
- FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
- FIELD2 : RTEMS.UNSIGNED32;
- FIELD3 : RTEMS.UNSIGNED32;
- FIELD4 : RTEMS.UNSIGNED32;
- end record;
-
---
--- The following is the ID of the message queue used for timing operations.
---
-
- QUEUE_ID : RTEMS.ID;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization.
---
-
- procedure TEST_INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is the lowest priority task in the system. It
--- only executes after all of the LOW_TASKS have blocked. It then
--- times a readying MESSAGE_QUEUE_SEND.
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- LOW_TASKS
---
--- DESCRIPTION:
---
--- These RTEMS tasks perform a blocking MESSAGE_QUEUE_RECEIVE.
---
-
- procedure LOW_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm15/config.h b/c/src/ada-tests/tmtests/tm15/config.h
deleted file mode 100644
index b82372ca0f..0000000000
--- a/c/src/ada-tests/tmtests/tm15/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm15/tm15.adb b/c/src/ada-tests/tmtests/tm15/tm15.adb
deleted file mode 100644
index ede6d05307..0000000000
--- a/c/src/ada-tests/tmtests/tm15/tm15.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM15 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM15 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM15;
-
diff --git a/c/src/ada-tests/tmtests/tm15/tmtest.adb b/c/src/ada-tests/tmtests/tm15/tmtest.adb
deleted file mode 100644
index c1ed0dc9c2..0000000000
--- a/c/src/ada-tests/tmtests/tm15/tmtest.adb
+++ /dev/null
@@ -1,276 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 15 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 15 ***" );
-
- TMTEST.TEST_INIT;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT
- is
- ID : RTEMS.ID;
- INDEX : RTEMS.UNSIGNED32;
- OVERHEAD : RTEMS.UNSIGNED32;
- EVENT_OUT : RTEMS.EVENT_SET;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.TIME_SET := FALSE;
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ),
- 10,
- 1024,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOW" );
-
- RTEMS.TASK_START( ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOW" );
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ),
- 5,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( INDEX ),
- TMTEST.HIGH_TASKS'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.EVENT_RECEIVE(
- RTEMS.PENDING_EVENTS,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- EVENT_OUT,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "EVENT_RECEIVE (current)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.EVENT_RECEIVE(
- RTEMS.ALL_EVENTS,
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- EVENT_OUT,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "EVENT_RECEIVE (NO_WAIT)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE
- );
-
- end TEST_INIT;
-
---PAGE
---
--- LOW_TASK
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- ID : RTEMS.ID;
- INDEX : RTEMS.UNSIGNED32;
- EVENT_OUT : RTEMS.EVENT_SET;
- OVERHEAD : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "EVENT_RECEIVE (blocking)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.EVENT_SEND( RTEMS.SELF, RTEMS.EVENT_16, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "EVENT_SEND (returns to caller)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.EVENT_SEND
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_16,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- EVENT_OUT,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "EVENT_RECEIVE (available)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.EVENT_SEND(
- TMTEST.TASK_ID( INDEX ),
- RTEMS.EVENT_16,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "EVENT_SEND (readying)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.EVENT_SEND
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end LOW_TASK;
-
---PAGE
---
--- HIGH_TASKS
---
-
- procedure HIGH_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- EVENT_OUT : RTEMS.EVENT_SET;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- if TMTEST.TIME_SET = FALSE then
- TMTEST.TIME_SET := TRUE;
- TIMER_DRIVER.INITIALIZE;
- end if;
-
- RTEMS.EVENT_RECEIVE(
- 16#7FFFFFFF#,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- EVENT_OUT,
- STATUS
- );
-
- end HIGH_TASKS;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm15/tmtest.ads b/c/src/ada-tests/tmtests/tm15/tmtest.ads
deleted file mode 100644
index 9ccc3d6558..0000000000
--- a/c/src/ada-tests/tmtests/tm15/tmtest.ads
+++ /dev/null
@@ -1,109 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 15 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIME_TEST_SUPPORT;
-with TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- This array contains the IDs of all RTEMS tasks created by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 ..
- TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
-
---
--- This variable is set to TRUE if the timer has been initialized
--- and is currently timing an operation.
---
-
- TIME_SET : Standard.BOOLEAN;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization. Once initialization
--- has been completed, the following operations are timed and reported:
---
--- + event_receive of currently PENDING_EVENTS
--- + event_receive NO_WAIT case
---
-
- procedure TEST_INIT;
-
---
--- LOW_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task stops the timer and reports the execution time
--- of a blocking EVENT_RECEIVE. After this the following
--- operations are timed and the execution time is reported:
---
--- + EVENT_SEND which does not ready a task
--- + EVENT_RECEIVE with the event condition available
--- + EVENT_SEND which readies a task
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- HIGH_TASKS
---
--- DESCRIPTION:
---
--- These RTEMS tasks executive a blocking EVENT_RECEIVE after
--- initialization is complete. The first of these tasks to
--- execute starts the timer.
---
-
- procedure HIGH_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm16/config.h b/c/src/ada-tests/tmtests/tm16/config.h
deleted file mode 100644
index b82372ca0f..0000000000
--- a/c/src/ada-tests/tmtests/tm16/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm16/tm16.adb b/c/src/ada-tests/tmtests/tm16/tm16.adb
deleted file mode 100644
index 91acf3fe15..0000000000
--- a/c/src/ada-tests/tmtests/tm16/tm16.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM16 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM16 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM16;
-
diff --git a/c/src/ada-tests/tmtests/tm16/tmtest.adb b/c/src/ada-tests/tmtests/tm16/tmtest.adb
deleted file mode 100644
index 57dcdd482d..0000000000
--- a/c/src/ada-tests/tmtests/tm16/tmtest.adb
+++ /dev/null
@@ -1,197 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 16 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 16 ***" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'E', 'S', 'T' ),
- 251,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TEST INIT" );
-
- RTEMS.TASK_START(
- ID,
- TMTEST.TEST_INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TEST INIT" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- PRIORITY : RTEMS.TASK_PRIORITY;
- INDEX : RTEMS.UNSIGNED32;
- TASK_ENTRY : RTEMS.TASK_ENTRY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- PRIORITY := 250;
-
- for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'M', 'I', 'D', ' ' ),
- PRIORITY,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then
- TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
- else
- TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
- end if;
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( INDEX ),
- TASK_ENTRY,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- PRIORITY := PRIORITY - 1;
-
- end loop;
-
- TMTEST.TASK_COUNT := 0;
-
- TIMER_DRIVER.INITIALIZE; -- starts the timer
-
- RTEMS.EVENT_SEND( -- preempts task
- TMTEST.TASK_ID( TMTEST.TASK_COUNT ),
- RTEMS.EVENT_16,
- STATUS
- );
-
- end TEST_INIT;
-
---PAGE
---
--- MIDDLE_TASKS
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- EVENT_OUT : RTEMS.EVENT_SET;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.EVENT_RECEIVE( -- task blocks
- RTEMS.EVENT_16,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- EVENT_OUT,
- STATUS
- );
-
- TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1;
-
- RTEMS.EVENT_SEND( -- preempts task
- TMTEST.TASK_ID( TMTEST.TASK_COUNT ),
- RTEMS.EVENT_16,
- STATUS
- );
-
- end MIDDLE_TASKS;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- EVENT_OUT : RTEMS.EVENT_SET;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.EVENT_RECEIVE( -- task blocks
- RTEMS.EVENT_16,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- EVENT_OUT,
- STATUS
- );
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "EVENT_SEND (preemptive)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.EVENT_SEND
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end HIGH_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm16/tmtest.ads b/c/src/ada-tests/tmtests/tm16/tmtest.ads
deleted file mode 100644
index 44b7feabd2..0000000000
--- a/c/src/ada-tests/tmtests/tm16/tmtest.ads
+++ /dev/null
@@ -1,111 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 16 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TIME_TEST_SUPPORT;
-with TIMER_DRIVER;
-
-package TMTEST is
-
---
--- This array contains the IDs of all RTEMS tasks created by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32
- range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
-
---
--- This variable is used to index through the TASK_ID array
--- so that events can be send to the next task.
---
-
- TASK_COUNT : RTEMS.UNSIGNED32;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization. Once initialization
--- has been completed, this task sets the TASK_COUNT to 0 and
--- starts the timer before performing a preemptive EVENT_SEND.
---
-
- procedure TEST_INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is highest priority task in the system.
--- Its first action is to perform a blocking EVENT_RECEIVE.
--- It is the last task to have its event set sent to it. Thus it
--- is the last task to be awakened by a preemptive EVENT_SEND.
--- After it preempts the last MIDDLE_TASKS, it stops the timer
--- and reports the execution time of preemptive EVENT_SEND.
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- MIDDLE_TASKS
---
--- DESCRIPTION:
---
--- These RTEMS tasks perform a blocking EVENT_RECEIVE. When
--- readied, each task will increment the TASK_COUNT and
--- perform a preemptive EVENT_SEND. TASK_COUNT is used to
--- index the TASK_ID array in such a way that incrementing
--- TASK_COUNT makes it index the ID of the next task to
--- send events to.
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm17/config.h b/c/src/ada-tests/tmtests/tm17/config.h
deleted file mode 100644
index b82372ca0f..0000000000
--- a/c/src/ada-tests/tmtests/tm17/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm17/tm17.adb b/c/src/ada-tests/tmtests/tm17/tm17.adb
deleted file mode 100644
index 263352447b..0000000000
--- a/c/src/ada-tests/tmtests/tm17/tm17.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM17 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM17 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM17;
-
diff --git a/c/src/ada-tests/tmtests/tm17/tmtest.adb b/c/src/ada-tests/tmtests/tm17/tmtest.adb
deleted file mode 100644
index 1b36ab0cbf..0000000000
--- a/c/src/ada-tests/tmtests/tm17/tmtest.adb
+++ /dev/null
@@ -1,160 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 17 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TASK_ENTRY : RTEMS.TASK_ENTRY;
- INDEX : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 17 ***" );
-
- TMTEST.TASK_PRIORITY := 254;
-
- for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- TMTEST.TASK_PRIORITY,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then
- TASK_ENTRY := TMTEST.LAST_TASK'ACCESS;
- elsif INDEX = 0 then
- TASK_ENTRY := TMTEST.FIRST_TASK'ACCESS;
- else
- TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
- end if;
-
- RTEMS.TASK_START( TMTEST.TASK_ID( INDEX ), TASK_ENTRY, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- TMTEST.TASK_COUNT := 1;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- FIRST_TASK
---
-
- procedure FIRST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- PREVIOUS_PRIORITY : RTEMS.TASK_PRIORITY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TIMER_DRIVER.INITIALIZE;
-
- TMTEST.TASK_PRIORITY := TMTEST.TASK_PRIORITY - 1;
- TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1;
-
- RTEMS.TASK_SET_PRIORITY(
- TMTEST.TASK_ID( TMTEST.TASK_COUNT ),
- TMTEST.TASK_PRIORITY,
- PREVIOUS_PRIORITY,
- STATUS
- );
-
- end FIRST_TASK;
-
---PAGE
---
--- MIDDLE_TASKS
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- PREVIOUS_PRIORITY : RTEMS.TASK_PRIORITY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.TASK_PRIORITY := TMTEST.TASK_PRIORITY - 1;
- TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1;
-
- RTEMS.TASK_SET_PRIORITY(
- TMTEST.TASK_ID( TMTEST.TASK_COUNT ),
- TMTEST.TASK_PRIORITY,
- PREVIOUS_PRIORITY,
- STATUS
- );
-
- end MIDDLE_TASKS;
-
---PAGE
---
--- LAST_TASK
---
-
- procedure LAST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_SET_PRIORITY (preemptive)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TASK_SET_PRIORITY
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end LAST_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm17/tmtest.ads b/c/src/ada-tests/tmtests/tm17/tmtest.ads
deleted file mode 100644
index e63a76fc62..0000000000
--- a/c/src/ada-tests/tmtests/tm17/tmtest.ads
+++ /dev/null
@@ -1,109 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 17 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TIME_TEST_SUPPORT;
-with TIMER_DRIVER;
-
-package TMTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32
- range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32
- range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.NAME;
-
---
--- These variables are used to index the TASK_ID array and change
--- the priority of each successive task such that the TASK_SET_PRIORITY
--- results in a preemption.
---
-
- TASK_COUNT : RTEMS.UNSIGNED32;
- TASK_PRIORITY : RTEMS.TASK_PRIORITY;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- FIRST_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is the first task to execute in the system. It
--- starts the timer and updates the TASK_COUNT and TASK_PRIORITY
--- variables so that a preemptive TASK_SET_PRIORITY can be performed.
---
-
- procedure FIRST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- MIDDLE_TASK
---
--- DESCRIPTION:
---
--- These RTEMS tasks update the TASK_COUNT and TASK_PRIORITY variables
--- so that a preemptive TASK_SET_PRIORITY can be performed.
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- LAST_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is the last task to execute in the system. It
--- stops the timer and reports the execution time of a preemptive
--- TASK_SET_PRIORITY.
---
-
- procedure LAST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm18/config.h b/c/src/ada-tests/tmtests/tm18/config.h
deleted file mode 100644
index b82372ca0f..0000000000
--- a/c/src/ada-tests/tmtests/tm18/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm18/tm18.adb b/c/src/ada-tests/tmtests/tm18/tm18.adb
deleted file mode 100644
index 207c78261e..0000000000
--- a/c/src/ada-tests/tmtests/tm18/tm18.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM18 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM18 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM18;
-
diff --git a/c/src/ada-tests/tmtests/tm18/tmtest.adb b/c/src/ada-tests/tmtests/tm18/tmtest.adb
deleted file mode 100644
index 2603ed0c77..0000000000
--- a/c/src/ada-tests/tmtests/tm18/tmtest.adb
+++ /dev/null
@@ -1,154 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 18 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 18 ***" );
-
- TMTEST.TEST_INIT;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_INIT
---
-
- procedure TEST_INIT
- is
- ID : RTEMS.ID;
- TASK_ENTRY : RTEMS.TASK_ENTRY;
- INDEX : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- 128,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
-
- if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then
- TASK_ENTRY := TMTEST.LAST_TASK'ACCESS;
- elsif INDEX = 0 then
- TASK_ENTRY := TMTEST.FIRST_TASK'ACCESS;
- else
- TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
- end if;
-
- RTEMS.TASK_START( ID, TASK_ENTRY, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- end TEST_INIT;
-
---PAGE
---
--- FIRST_TASK
---
-
- procedure FIRST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TIMER_DRIVER.INITIALIZE;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
-
- end FIRST_TASK;
-
---PAGE
---
--- MIDDLE_TASKS
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
-
- end MIDDLE_TASKS;
-
---PAGE
---
--- LAST_TASK
---
-
- procedure LAST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_DELETE (self)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TASK_DELETE
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end LAST_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm18/tmtest.ads b/c/src/ada-tests/tmtests/tm18/tmtest.ads
deleted file mode 100644
index 4fe81c9fcb..0000000000
--- a/c/src/ada-tests/tmtests/tm18/tmtest.ads
+++ /dev/null
@@ -1,97 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 18 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TIME_TEST_SUPPORT;
-with TIMER_DRIVER;
-
-package TMTEST is
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_INIT
---
--- DESCRIPTION:
---
--- This subprogram performs test initialization.
---
-
- procedure TEST_INIT;
-
---
--- FIRST_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is the first task to execute. It starts the
--- timer and performs a TASK_DELETE on itself.
---
-
- procedure FIRST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- MIDDLE_TASK
---
--- DESCRIPTION:
---
--- These RTEMS tasks perform a TASK_DELETE on themselves.
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- LAST_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is the last task to execute. It stops the
--- timer and reports the execution time of a TASK_DELETE SELF.
---
-
- procedure LAST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm19/config.h b/c/src/ada-tests/tmtests/tm19/config.h
deleted file mode 100644
index b82372ca0f..0000000000
--- a/c/src/ada-tests/tmtests/tm19/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm19/tm19.adb b/c/src/ada-tests/tmtests/tm19/tm19.adb
deleted file mode 100644
index 6e62411a10..0000000000
--- a/c/src/ada-tests/tmtests/tm19/tm19.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM19 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM19 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM19;
-
diff --git a/c/src/ada-tests/tmtests/tm19/tmtest.adb b/c/src/ada-tests/tmtests/tm19/tmtest.adb
deleted file mode 100644
index 1beb25e26b..0000000000
--- a/c/src/ada-tests/tmtests/tm19/tmtest.adb
+++ /dev/null
@@ -1,287 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 19 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 19 ***" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- 128,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK1" );
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( 1 ),
- TMTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK1" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- 127,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK2" );
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( 2 ),
- TMTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK2" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- 126,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( 3 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK3" );
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( 3 ),
- TMTEST.TASK_3'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK3" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- PROCESS_ASR_FOR_PASS_1
---
-
- procedure PROCESS_ASR_FOR_PASS_1 (
- SIGNALS : in RTEMS.SIGNAL_SET
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SIGNAL_SEND (self)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.SIGNAL_SEND
- );
-
- TEXT_IO.PUT_LINE( "SIGNAL_ENTER (preemptive) na" );
-
- TIMER_DRIVER.INITIALIZE;
-
- end PROCESS_ASR_FOR_PASS_1;
-
---PAGE
---
--- PROCESS_ASR_FOR_PASS_2
---
-
- procedure PROCESS_ASR_FOR_PASS_2 (
- SIGNALS : in RTEMS.SIGNAL_SET
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.PUT_LINE( "SIGNAL_ENTER (preemptive) na" );
-
- RTEMS.TASK_RESUME( TMTEST.TASK_ID( 3 ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" );
-
- TIMER_DRIVER.INITIALIZE;
-
- end PROCESS_ASR_FOR_PASS_2;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.SIGNAL_CATCH(
- TMTEST.PROCESS_ASR_FOR_PASS_1'ACCESS,
- RTEMS.DEFAULT_MODES,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SIGNAL_CATCH",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.SIGNAL_CATCH
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.SIGNAL_SEND( TMTEST.TASK_ID( 2 ), RTEMS.SIGNAL_1, STATUS );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SIGNAL_SEND (non-preemptive)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.SIGNAL_SEND
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.SIGNAL_SEND( RTEMS.SELF, RTEMS.SIGNAL_1, STATUS );
-
- -- end time is done in ASR
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SIGNAL_RETURN (non-preemptive)",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- RTEMS.SIGNAL_CATCH(
- TMTEST.PROCESS_ASR_FOR_PASS_2'ACCESS,
- RTEMS.NO_PREEMPT,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.SIGNAL_SEND( RTEMS.SELF, RTEMS.SIGNAL_1, STATUS );
-
- end TASK_1;
-
---PAGE
---
--- PROCESS_ASR_FOR_TASK_2
---
-
- procedure PROCESS_ASR_FOR_TASK_2 (
- SIGNALS : in RTEMS.SIGNAL_SET
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- NULL;
-
- end PROCESS_ASR_FOR_TASK_2;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.SIGNAL_CATCH(
- TMTEST.PROCESS_ASR_FOR_TASK_2'ACCESS,
- RTEMS.DEFAULT_MODES,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" );
-
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
-
- end TASK_2;
-
---PAGE
---
--- TASK_3
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SIGNAL_RETURN (preemptive)",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_3;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm19/tmtest.ads b/c/src/ada-tests/tmtests/tm19/tmtest.ads
deleted file mode 100644
index 2ac34a75fb..0000000000
--- a/c/src/ada-tests/tmtests/tm19/tmtest.ads
+++ /dev/null
@@ -1,144 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 19 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TIME_TEST_SUPPORT;
-with TIMER_DRIVER;
-
-package TMTEST is
-
---
--- This array contains the IDs of all RTEMS tasks created by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- PROCESS_ASR_FOR_PASS_1
---
--- DESCRIPTION:
---
--- This subprogram is the ASR used to measure and report the
--- execution time of a SIGNAL_SEND to SELF. Before it exits
--- it starts the timer so that the execution time required to
--- exit from an ASR back to the same task can be measured.
---
-
- procedure PROCESS_ASR_FOR_PASS_1 (
- SIGNALS : in RTEMS.SIGNAL_SET
- );
-
---
--- PROCESS_ASR_FOR_PASS_2
---
--- DESCRIPTION:
---
--- This subprogram is the ASR which sets up for a preemptive
--- return from an ASR. Before it exits it starts the timer
--- so that the execution time required to exit from an ASR
--- and transfer control to the another task can be measured.
---
-
- procedure PROCESS_ASR_FOR_PASS_2 (
- SIGNALS : in RTEMS.SIGNAL_SET
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task is responsible for measuring and reporting
--- the following execution times:
---
--- + SIGNAL_CATCH
--- + non-preemptive SIGNAL_SEND
--- + non-preemptive return from an ASR
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- PROCESS_ASR_FOR_TASK_2
---
--- DESCRIPTION:
---
--- This subprogram is the ASR for TASK_2. It performs no actions.
---
-
- procedure PROCESS_ASR_FOR_TASK_2 (
- SIGNALS : in RTEMS.SIGNAL_SET
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task is used as the recipient of a SIGNAL_SEND.
--- After establishing an ASR, it suspends itself to insure
--- that it does not execute again.
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_3
---
--- DESCRIPTION:
---
--- This RTEMS task is used as the recipient of a preemptive
--- SIGNAL_SEND. This task suspends itself and is resumed by
--- an ASR for TASK_1. Once the task executes, it stops the
--- timer and reports the execution time for a preemptive
--- return from an ASR.
---
-
- procedure TASK_3 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm20/config.h b/c/src/ada-tests/tmtests/tm20/config.h
deleted file mode 100644
index 83d86e9b8c..0000000000
--- a/c/src/ada-tests/tmtests/tm20/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_PARTITIONS 1
-#define CONFIGURE_MAXIMUM_REGIONS 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm20/tm20.adb b/c/src/ada-tests/tmtests/tm20/tm20.adb
deleted file mode 100644
index 4462a79bb9..0000000000
--- a/c/src/ada-tests/tmtests/tm20/tm20.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM20 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM20 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM20;
-
diff --git a/c/src/ada-tests/tmtests/tm20/tmtest.adb b/c/src/ada-tests/tmtests/tm20/tmtest.adb
deleted file mode 100644
index 6b17059e35..0000000000
--- a/c/src/ada-tests/tmtests/tm20/tmtest.adb
+++ /dev/null
@@ -1,588 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 20 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 20 ***" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', '1' ),
- 128,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK1" );
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( 1 ),
- TMTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK1" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', '2' ),
- 129,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK2" );
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( 2 ),
- TMTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK2" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER_COUNT : RTEMS.UNSIGNED32;
- INDEX : RTEMS.UNSIGNED32;
- PREVIOUS_MODE : RTEMS.MODE;
- PREVIOUS_PRIORITY : RTEMS.TASK_PRIORITY;
- RETURN_VALUE : RTEMS.UNSIGNED32;
- OVERHEAD : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.PARTITION_NAME := RTEMS.BUILD_NAME( 'P', 'A', 'R', 'T' );
-
- TIMER_DRIVER.INITIALIZE;
-
- RTEMS.PARTITION_CREATE(
- TMTEST.PARTITION_NAME,
- TMTEST.PARTITION_AREA'ADDRESS,
- 2048,
- 128,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.PARTITION_ID,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PARTITION_CREATE",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.PARTITION_CREATE
- );
-
- TMTEST.REGION_NAME := RTEMS.BUILD_NAME( 'R', 'E', 'G', 'N' );
-
- TIMER_DRIVER.INITIALIZE;
-
- RTEMS.REGION_CREATE(
- TMTEST.REGION_NAME,
- TMTEST.REGION_AREA'ADDRESS,
- 2048,
- 16,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.REGION_ID,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "REGION_CREATE",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.REGION_CREATE
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.PARTITION_GET_BUFFER(
- TMTEST.PARTITION_ID,
- TMTEST.BUFFER_ADDRESS_1,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PARTITION_GET_BUFFER (available)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.PARTITION_GET_BUFFER
- );
-
- BUFFER_COUNT := 0;
- loop
-
- RTEMS.PARTITION_GET_BUFFER(
- TMTEST.PARTITION_ID,
- TMTEST.BUFFER_ADDRESSES( BUFFER_COUNT ),
- STATUS
- );
-
- exit when RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.UNSATISFIED );
-
- BUFFER_COUNT := BUFFER_COUNT + 1;
-
- end loop;
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.PARTITION_GET_BUFFER(
- TMTEST.PARTITION_ID,
- TMTEST.BUFFER_ADDRESS_2,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PARTITION_GET_BUFFER (not available)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.PARTITION_GET_BUFFER
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.PARTITION_RETURN_BUFFER(
- TMTEST.PARTITION_ID,
- TMTEST.BUFFER_ADDRESS_1,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PARTITION_RETURN_BUFFER",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.PARTITION_RETURN_BUFFER
- );
-
- for INDEX in 0 .. BUFFER_COUNT - 1
- loop
-
- RTEMS.PARTITION_RETURN_BUFFER(
- TMTEST.PARTITION_ID,
- TMTEST.BUFFER_ADDRESSES( INDEX ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" );
-
- end loop;
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.PARTITION_DELETE( TMTEST.PARTITION_ID, STATUS );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PARTITION_DELETE",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.PARTITION_DELETE
- );
-
- RTEMS.REGION_GET_SEGMENT(
- TMTEST.REGION_ID,
- 400,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- TMTEST.BUFFER_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.REGION_GET_SEGMENT(
- TMTEST.REGION_ID,
- 400,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- TMTEST.BUFFER_ADDRESS_3,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "REGION_GET_SEGMENT (available)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.REGION_GET_SEGMENT
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.REGION_GET_SEGMENT(
- TMTEST.REGION_ID,
- 1998,
- RTEMS.NO_WAIT,
- RTEMS.NO_TIMEOUT,
- TMTEST.BUFFER_ADDRESS_4,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "REGION_GET_SEGMENT (NO_WAIT)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.REGION_GET_SEGMENT
- );
-
- RTEMS.REGION_RETURN_SEGMENT(
- TMTEST.REGION_ID,
- TMTEST.BUFFER_ADDRESS_3,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.REGION_RETURN_SEGMENT(
- TMTEST.REGION_ID,
- TMTEST.BUFFER_ADDRESS_2,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "REGION_RETURN_SEGMENT (no tasks waiting)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.REGION_RETURN_SEGMENT
- );
-
- RTEMS.REGION_GET_SEGMENT(
- TMTEST.REGION_ID,
- 400,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- TMTEST.BUFFER_ADDRESS_1,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.REGION_GET_SEGMENT(
- TMTEST.REGION_ID,
- 1998,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- TMTEST.BUFFER_ADDRESS_2,
- STATUS
- );
-
- -- execute TASK_2
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "REGION_RETURN_SEGMENT (preempt)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.REGION_RETURN_SEGMENT
- );
-
- RTEMS.REGION_RETURN_SEGMENT(
- TMTEST.REGION_ID,
- TMTEST.BUFFER_ADDRESS_2,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" );
-
- RTEMS.TASK_MODE(
- RTEMS.NO_PREEMPT,
- RTEMS.PREEMPT_MASK,
- PREVIOUS_MODE,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" );
-
- RTEMS.TASK_SET_PRIORITY( RTEMS.SELF, 254, PREVIOUS_PRIORITY, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" );
-
- RTEMS.REGION_GET_SEGMENT(
- TMTEST.REGION_ID,
- 400,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- TMTEST.BUFFER_ADDRESS_1,
- STATUS
- );
-
- RTEMS.REGION_GET_SEGMENT(
- TMTEST.REGION_ID,
- 1998,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.NO_TIMEOUT,
- TMTEST.BUFFER_ADDRESS_2,
- STATUS
- );
-
- -- execute TASK_2
-
- RTEMS.REGION_RETURN_SEGMENT(
- TMTEST.REGION_ID,
- TMTEST.BUFFER_ADDRESS_2,
- STATUS
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.REGION_DELETE( TMTEST.REGION_ID, STATUS );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "REGION_DELETE",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.REGION_DELETE
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.IO_INITIALIZE(
- 1,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "IO_INITIALIZE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.IO_INITIALIZE
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.IO_OPEN(
- 1,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "IO_OPEN",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.IO_OPEN
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.IO_CLOSE(
- 1,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "IO_CLOSE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.IO_CLOSE
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.IO_READ(
- 1,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "IO_READ",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.IO_READ
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.IO_WRITE(
- 1,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "IO_WRITE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.IO_WRITE
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.IO_CONTROL(
- 1,
- 0,
- RTEMS.NULL_ADDRESS,
- RETURN_VALUE,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "IO_CONTROL",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.IO_CONTROL
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "REGION_GET_SEGMENT (blocking)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.REGION_GET_SEGMENT
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.REGION_RETURN_SEGMENT(
- TMTEST.REGION_ID,
- TMTEST.BUFFER_ADDRESS_1,
- STATUS
- );
-
- -- preempt back to TASK_1
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.REGION_RETURN_SEGMENT(
- TMTEST.REGION_ID,
- TMTEST.BUFFER_ADDRESS_1,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "REGION_RETURN_SEGMENT (ready -- return)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.REGION_RETURN_SEGMENT
- );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end TASK_2;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm20/tmtest.ads b/c/src/ada-tests/tmtests/tm20/tmtest.ads
deleted file mode 100644
index cf1dfeaaa1..0000000000
--- a/c/src/ada-tests/tmtests/tm20/tmtest.ads
+++ /dev/null
@@ -1,151 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 20 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIME_TEST_SUPPORT;
-with TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- These following are the ID and NAME of the RTEMS partition created
--- by this test.
---
-
- PARTITION_ID : RTEMS.ID;
- PARTITION_NAME : RTEMS.NAME;
-
---
--- These following are the ID and NAME of the RTEMS region created
--- by this test.
---
-
- REGION_ID : RTEMS.ID;
- REGION_NAME : RTEMS.NAME;
-
---
--- The following area defines a memory area to be used as the
--- memory space for a partition.
---
-
- PARTITION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 )
- of RTEMS.UNSIGNED8;
- for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
---
--- The following area defines a memory area to be used as the
--- memory space for a region.
---
-
- REGION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 )
- of RTEMS.UNSIGNED8;
-
- for REGION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
---
--- The following are the buffers allocated from the region.
---
-
- BUFFER_ADDRESS_1 : RTEMS.ADDRESS;
- BUFFER_ADDRESS_2 : RTEMS.ADDRESS;
- BUFFER_ADDRESS_3 : RTEMS.ADDRESS;
- BUFFER_ADDRESS_4 : RTEMS.ADDRESS;
-
- BUFFER_ADDRESSES : array ( RTEMS.UNSIGNED32
- range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ADDRESS;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task is responsible for measuring and reporting
--- the following execution times:
---
--- + PARTITION_CREATE
--- + REGION_CREATE
--- + PARTITION_GET_BUFFER with a buffer available
--- + PARTITION_GET_BUFFER with no buffers available
--- + PARTITION_RETURN_BUFFER
--- + PARTITION_DELETE
--- + REGION_GET_SEGMENT with a segment available
--- + REGION_GET_SEGMENT with the NO_WAIT option
--- + REGION_RETURN_SEGMENT with no tasks waiting for memory
--- + REGION_RETURN_SEGMENT preemptive
--- + REGION_DELETE
--- + IO_INITIALIZE
--- + IO_OPEN
--- + IO_CLOSE
--- + IO_READ
--- + IO_WRITE
--- + IO_CONTROL
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task is responsible for measuring and reporting
--- the following execution times:
---
--- + blocking REGION_GET_SEGMENT
--- + REGION_RETURN_SEGMENT which readies a task
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm21/config.h b/c/src/ada-tests/tmtests/tm21/config.h
deleted file mode 100644
index 43d589d0f0..0000000000
--- a/c/src/ada-tests/tmtests/tm21/config.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 102
-#define CONFIGURE_MAXIMUM_TIMERS 100
-#define CONFIGURE_MAXIMUM_SEMAPHORES 100
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 100
-#define CONFIGURE_MAXIMUM_PARTITIONS 100
-#define CONFIGURE_MAXIMUM_REGIONS 100
-#define CONFIGURE_MAXIMUM_PORTS 100
-#define CONFIGURE_MAXIMUM_PERIODS 100
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm21/tm21.adb b/c/src/ada-tests/tmtests/tm21/tm21.adb
deleted file mode 100644
index 05958d5ad5..0000000000
--- a/c/src/ada-tests/tmtests/tm21/tm21.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM21 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM21 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM21;
-
diff --git a/c/src/ada-tests/tmtests/tm21/tmtest.adb b/c/src/ada-tests/tmtests/tm21/tmtest.adb
deleted file mode 100644
index 51ea93cc8b..0000000000
--- a/c/src/ada-tests/tmtests/tm21/tmtest.adb
+++ /dev/null
@@ -1,302 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 21 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 21 ***" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- 250,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE TASK_1" );
-
- RTEMS.TASK_START( ID, TMTEST.TASK_1'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START TASK1" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- ID : RTEMS.ID;
- OVERHEAD : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- INDEX,
- 254,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- INDEX,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 16,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" );
-
- RTEMS.SEMAPHORE_CREATE(
- INDEX,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- RTEMS.DEFAULT_ATTRIBUTES,
- RTEMS.NO_PRIORITY,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" );
-
- RTEMS.REGION_CREATE(
- INDEX,
- TMTEST.REGION_AREA'ADDRESS,
- 2048,
- 16,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE" );
-
- RTEMS.PARTITION_CREATE(
- INDEX,
- TMTEST.PARTITION_AREA'ADDRESS,
- 2048,
- 128,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE" );
-
- RTEMS.PORT_CREATE(
- INDEX,
- TMTEST.INTERNAL_PORT_AREA'ADDRESS,
- TMTEST.EXTERNAL_PORT_AREA'ADDRESS,
- 16#FF#,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_CREATE" );
-
- RTEMS.TIMER_CREATE( INDEX, ID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" );
-
- RTEMS.RATE_MONOTONIC_CREATE( INDEX, ID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CREATE" );
-
- end loop;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_IDENT( INDEX, RTEMS.SEARCH_ALL_NODES, ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_IDENT
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.MESSAGE_QUEUE_IDENT(
- INDEX,
- RTEMS.SEARCH_ALL_NODES,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_IDENT
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.SEMAPHORE_IDENT(
- INDEX,
- RTEMS.SEARCH_ALL_NODES,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SEMAPHORE_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.SEMAPHORE_IDENT
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.PARTITION_IDENT(
- INDEX,
- RTEMS.SEARCH_ALL_NODES,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PARTITION_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.PARTITION_IDENT
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.REGION_IDENT( INDEX, ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "REGION_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.REGION_IDENT
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.PORT_IDENT( INDEX, ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PORT_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.PORT_IDENT
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TIMER_IDENT( INDEX, ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TIMER_IDENT
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.RATE_MONOTONIC_IDENT( INDEX, ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "RATE_MONOTONIC_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_IDENT
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm21/tmtest.ads b/c/src/ada-tests/tmtests/tm21/tmtest.ads
deleted file mode 100644
index 36d687256f..0000000000
--- a/c/src/ada-tests/tmtests/tm21/tmtest.ads
+++ /dev/null
@@ -1,122 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 21 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SYSTEM;
-with TIMER_DRIVER;
-with System.Storage_Elements;
-
-package TMTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- The following area defines a memory area to be used as the
--- internal address space of the port.
---
-
- INTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
- System.Storage_Elements.To_Address(16#00001000#);
-
- INTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for INTERNAL_PORT_AREA use at INTERNAL_PORT_AREA_ADDRESS;
-
---
--- The following area defines a memory area to be used as the
--- external address space of the port.
---
-
- EXTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
- System.Storage_Elements.To_Address(16#00002000#);
-
- EXTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for EXTERNAL_PORT_AREA use at EXTERNAL_PORT_AREA_ADDRESS;
-
---
--- The following area defines a memory area to be used as the
--- memory space for a partition.
---
-
- PARTITION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 )
- of RTEMS.UNSIGNED8;
- for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
---
--- These following are the ID and NAME of the RTEMS region created
--- by this test.
---
-
- REGION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 )
- of RTEMS.UNSIGNED8;
- for REGION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task is responsible for measuring and reporting the
--- following directive execution times:
---
--- + TASK_IDENT
--- + MESSAGE_QUEUE_IDENT
--- + SEMAPHORE_IDENT
--- + PARTITION_IDENT
--- + REGION_IDENT
--- + PORT_IDENT
--- + TIMER_IDENT
--- + RATE_MONOTONIC_IDENT
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm22/config.h b/c/src/ada-tests/tmtests/tm22/config.h
deleted file mode 100644
index a9d518d83e..0000000000
--- a/c/src/ada-tests/tmtests/tm22/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 103
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm22/tm22.adb b/c/src/ada-tests/tmtests/tm22/tm22.adb
deleted file mode 100644
index 037168ddcf..0000000000
--- a/c/src/ada-tests/tmtests/tm22/tm22.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM22 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM22 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM22;
-
diff --git a/c/src/ada-tests/tmtests/tm22/tmtest.adb b/c/src/ada-tests/tmtests/tm22/tmtest.adb
deleted file mode 100644
index d1a2c3cf29..0000000000
--- a/c/src/ada-tests/tmtests/tm22/tmtest.adb
+++ /dev/null
@@ -1,256 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 22 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 22 ***" );
-
- RTEMS.MESSAGE_QUEUE_CREATE(
- RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ),
- 100,
- 16,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.MESSAGE_QUEUE_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ),
- 10,
- 2048,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOW" );
-
- RTEMS.TASK_START( ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOW" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'P', 'R', 'M', 'T' ),
- 11,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE PREEMPT" );
-
- RTEMS.TASK_START( ID, TMTEST.PREEMPT_TASK'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START PREEMPT" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- COUNT : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.MESSAGE_QUEUE_BROADCAST(
- TMTEST.MESSAGE_QUEUE_ID,
- BUFFER_POINTER,
- 16,
- COUNT,
- STATUS
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_BROADCAST (readying)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_BROADCAST
- );
-
- RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" );
-
- end HIGH_TASK;
-
---PAGE
---
--- LOW_TASK
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- ID : RTEMS.ID;
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- INDEX : RTEMS.UNSIGNED32;
- OVERHEAD : RTEMS.UNSIGNED32;
- COUNT : RTEMS.UNSIGNED32;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ),
- 5,
- 2048,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HIGH" );
-
- RTEMS.TASK_START( ID, TMTEST.HIGH_TASK'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HIGH" );
-
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- TMTEST.MESSAGE_QUEUE_ID,
- BUFFER_POINTER,
- RTEMS.DEFAULT_MODES,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.MESSAGE_QUEUE_BROADCAST(
- TMTEST.MESSAGE_QUEUE_ID,
- BUFFER_POINTER,
- 16,
- COUNT,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_BROADCAST (no waiting tasks)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_BROADCAST
- );
-
- RTEMS.MESSAGE_QUEUE_RECEIVE(
- TMTEST.MESSAGE_QUEUE_ID,
- BUFFER_POINTER,
- RTEMS.DEFAULT_MODES,
- RTEMS.NO_TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
-
- -- should go to PREEMPT_TASK here
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_BROADCAST (preempt)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_BROADCAST
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end LOW_TASK;
-
---PAGE
---
--- LOW_TASK
---
-
- procedure PREEMPT_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- COUNT : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.MESSAGE_QUEUE_BROADCAST(
- TMTEST.MESSAGE_QUEUE_ID,
- BUFFER_POINTER,
- 16,
- COUNT,
- STATUS
- );
-
- -- should be preempted by LOW_TASK
-
- end PREEMPT_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm22/tmtest.ads b/c/src/ada-tests/tmtests/tm22/tmtest.ads
deleted file mode 100644
index 43270fcf65..0000000000
--- a/c/src/ada-tests/tmtests/tm22/tmtest.ads
+++ /dev/null
@@ -1,119 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 22 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- Buffer Record similar to that used by RTEMS 3.2.1. Using this
--- avoids changes to the test.
---
-
- type BUFFER is
- record
- FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
- FIELD2 : RTEMS.UNSIGNED32;
- FIELD3 : RTEMS.UNSIGNED32;
- FIELD4 : RTEMS.UNSIGNED32;
- end record;
-
---
--- The following is the ID of the message queue used for timing operations.
---
-
- MESSAGE_QUEUE_ID : RTEMS.ID;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is created by LOW_TASK and executes after
--- LOW_TASK has performed a blocking MESSAGE_QUEUE_RECEIVE.
--- This task then executes and performs a readying
--- MESSAGE_QUEUE_BROADCAST and reports its execution time.
--- Finally, the task suspends itself so LOW_TASK can continue
--- execution.
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- LOW_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task performs a blocking MESSAGE_QUEUE_RECEIVE
--- so that when HIGH_TASK performs a MESSAGE_QUEUE_BROADCAST,
--- there will be a task to be readied. Following this, the
--- execution time for a MESSAGE_QUEUE_BROADCAST to a message
--- queue with no waiting tasks is measured and reported.
--- Then this task performs another blocking MESSAGE_QUEUE_RECEIVE
--- so that when PREEMPT_TASK performs a MESSAGE_QUEUE_BROADCAST,
--- PREEMPT_TASK will be preempted by this task. After control
--- of the processor is transferred back to this task by the
--- preemption, the timer is stopped and the execution time of
--- a preemptive MESSAGE_QUEUE_BROADCAST is reported.
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- PREEMPT_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task starts the timer and performs a preemptive
--- MESSAGE_QUEUE_BROADCAST.
---
-
- procedure PREEMPT_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm23/config.h b/c/src/ada-tests/tmtests/tm23/config.h
deleted file mode 100644
index 5e53478121..0000000000
--- a/c/src/ada-tests/tmtests/tm23/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_TIMERS 110
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm23/tm23.adb b/c/src/ada-tests/tmtests/tm23/tm23.adb
deleted file mode 100644
index b6855a86e1..0000000000
--- a/c/src/ada-tests/tmtests/tm23/tm23.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM23 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM23 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM23;
-
diff --git a/c/src/ada-tests/tmtests/tm23/tmtest.adb b/c/src/ada-tests/tmtests/tm23/tmtest.adb
deleted file mode 100644
index bb9dabe3be..0000000000
--- a/c/src/ada-tests/tmtests/tm23/tmtest.adb
+++ /dev/null
@@ -1,399 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 23 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- OVERHEAD : RTEMS.UNSIGNED32;
- TASK_PRIORITY : RTEMS.TASK_PRIORITY;
- INDEX : RTEMS.UNSIGNED32;
- ID : RTEMS.ID;
- TASK_ENTRY : RTEMS.TASK_ENTRY;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 23 ***" );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- TASK_PRIORITY := 5;
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- TASK_PRIORITY,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- if INDEX = 1 then
- TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS;
- elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then
- TASK_ENTRY := TMTEST.LOW_TASK'ACCESS;
- else
- TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS;
- end if;
-
- RTEMS.TASK_START( ID, TASK_ENTRY, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- TASK_PRIORITY := TASK_PRIORITY + 1;
-
- end loop;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- NULL_DELAY
---
-
- procedure NULL_DELAY (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- ) is
- begin
-
- NULL;
-
- end NULL_DELAY;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.TASK_PRIORITY;
- OVERHEAD : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TIMER_CREATE(
- INDEX,
- TMTEST.TIMER_ID( INDEX ),
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_CREATE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TIMER_CREATE
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TIMER_FIRE_AFTER(
- TMTEST.TIMER_ID( INDEX ),
- 500,
- TMTEST.NULL_DELAY'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_FIRE_AFTER (inactive)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TIMER_FIRE_AFTER
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TIMER_FIRE_AFTER(
- TMTEST.TIMER_ID( INDEX ),
- 500,
- TMTEST.NULL_DELAY'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_FIRE_AFTER (active)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TIMER_FIRE_AFTER
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TIMER_CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_CANCEL (active)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TIMER_CANCEL
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TIMER_CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_CANCEL (inactive)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TIMER_CANCEL
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TIMER_RESET( TMTEST.TIMER_ID( INDEX ), STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_RESET (inactive)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TIMER_RESET
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TIMER_RESET( TMTEST.TIMER_ID( INDEX ), STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_RESET (active)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TIMER_RESET
- );
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TIMER_CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS );
- end loop;
-
- TMTEST.TIME_OF_DAY := ( 1988, 12, 31, 9, 0, 0, 0 );
-
- RTEMS.CLOCK_SET( TMTEST.TIME_OF_DAY, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" );
-
- TMTEST.TIME_OF_DAY.YEAR := 1989;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TIMER_FIRE_WHEN(
- TMTEST.TIMER_ID( INDEX ),
- TMTEST.TIME_OF_DAY,
- TMTEST.NULL_DELAY'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_FIRE_WHEN (inactive)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TIMER_FIRE_WHEN
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TIMER_FIRE_WHEN(
- TMTEST.TIMER_ID( INDEX ),
- TMTEST.TIME_OF_DAY,
- TMTEST.NULL_DELAY'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_FIRE_WHEN (active)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TIMER_FIRE_WHEN
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TIMER_DELETE( TMTEST.TIMER_ID( INDEX ), STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_DELETE (active)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TIMER_DELETE
- );
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TIMER_CREATE( INDEX, TMTEST.TIMER_ID( INDEX ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" );
-
- RTEMS.TIMER_FIRE_AFTER(
- TMTEST.TIMER_ID( INDEX ),
- 500,
- TMTEST.NULL_DELAY'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" );
-
- RTEMS.TIMER_CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" );
-
- end loop;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TIMER_DELETE( TMTEST.TIMER_ID( INDEX ), STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_DELETE (inactive)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TIMER_DELETE
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.TASK_WAKE_WHEN( TMTEST.TIME_OF_DAY, STATUS );
-
- end HIGH_TASK;
-
---PAGE
---
--- MIDDLE_TASKS
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.TASK_WAKE_WHEN( TMTEST.TIME_OF_DAY, STATUS );
-
- end MIDDLE_TASKS;
-
---PAGE
---
--- LOW_TASK
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_WAKE_WHEN",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.TASK_WAKE_WHEN
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end LOW_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm23/tmtest.ads b/c/src/ada-tests/tmtests/tm23/tmtest.ads
deleted file mode 100644
index 9f713ae073..0000000000
--- a/c/src/ada-tests/tmtests/tm23/tmtest.ads
+++ /dev/null
@@ -1,130 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 23 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with TIME_TEST_SUPPORT;
-with RTEMS;
-
-package TMTEST is
-
---
--- This array contains the IDs of all RTEMS timers created by this test.
---
-
- TIMER_ID : array ( RTEMS.UNSIGNED32
- range 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
-
---
--- This data item contains a time of day used by all of the
--- "WHEN" directives timed in this test.
---
-
- TIME_OF_DAY : RTEMS.TIME_OF_DAY;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- NULL_DELAY
---
--- DESCRIPTION:
---
--- This subprogram is a timer service routine. It performs
--- no actions.
---
-
- procedure NULL_DELAY (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is responsible for measuring and reporting
--- the following directive execution times:
---
--- + TIMER_CREATE
--- + TIMER_FIRE_AFTER with an inactive timer
--- + TIMER_FIRE_AFTER with an active timer
--- + TIMER_CANCEL of an active timer
--- + TIMER_CANCEL of an inactive timer
--- + TIMER_RESET of an active timer
--- + TIMER_RESET of an inactive timer
--- + TIMER_FIRE_WHEN of an inactive timer
--- + TIMER_FIRE_WHEN of an active timer
--- + TIMER_DELETE of an active timer
--- + TIMER_DELETE of an inactive timer
---
--- After measuring and reporting the above times, this task starts
--- the timer and executes the TASK_WAKE_WHEN directive.
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- MIDDLE_TASKS
---
--- DESCRIPTION:
---
--- These RTEMS tasks executes the TASK_WAKE_WHEN directive.
---
-
- procedure MIDDLE_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- MIDDLE_TASKS
---
--- DESCRIPTION:
---
--- This RTEMS task stops the timer and reports the execution time for
--- the TASK_WAKE_WHEN directive.
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm24/config.h b/c/src/ada-tests/tmtests/tm24/config.h
deleted file mode 100644
index 7e7793cf15..0000000000
--- a/c/src/ada-tests/tmtests/tm24/config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm24/tm24.adb b/c/src/ada-tests/tmtests/tm24/tm24.adb
deleted file mode 100644
index 03873ba82c..0000000000
--- a/c/src/ada-tests/tmtests/tm24/tm24.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM24 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM24 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM24;
-
diff --git a/c/src/ada-tests/tmtests/tm24/tmtest.adb b/c/src/ada-tests/tmtests/tm24/tmtest.adb
deleted file mode 100644
index e8af0ca6ea..0000000000
--- a/c/src/ada-tests/tmtests/tm24/tmtest.adb
+++ /dev/null
@@ -1,165 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 24 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- ID : RTEMS.ID;
- INDEX : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 24 ***" );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- TMTEST.OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ),
- 10,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HIGH" );
-
- RTEMS.TASK_START( ID, TMTEST.HIGH_TASK'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HIGH" );
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'R', 'E', 'S', 'T' ),
- 128,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- RTEMS.TASK_START( ID, TMTEST.TASKS'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_WAKE_AFTER (no context switch)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- TMTEST.OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_WAKE_AFTER
- );
-
- TMTEST.TASK_COUNT := 0;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end HIGH_TASK;
-
---PAGE
---
--- TASKS
---
-
- procedure TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1;
-
- if TMTEST.TASK_COUNT = 1 then
-
- TIMER_DRIVER.INITIALIZE;
-
- elsif TMTEST.TASK_COUNT = TIME_TEST_SUPPORT.OPERATION_COUNT then
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_WAKE_AFTER (context switch)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- TMTEST.OVERHEAD,
- RTEMS_CALLING_OVERHEAD.TASK_WAKE_AFTER
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end if;
-
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
-
- end TASKS;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm24/tmtest.ads b/c/src/ada-tests/tmtests/tm24/tmtest.ads
deleted file mode 100644
index df90eddb91..0000000000
--- a/c/src/ada-tests/tmtests/tm24/tmtest.ads
+++ /dev/null
@@ -1,99 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 24 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- This variable is used to determine which task should
--- start the timer and which task should stop the timer
--- and report the execution time.
---
-
- TASK_COUNT : RTEMS.UNSIGNED32;
-
---
--- This variable contains the execution time required of the
--- loop used to execute the directive.
---
-
- OVERHEAD : RTEMS.UNSIGNED32;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is responsible for measuring and reporting the
--- execution time for an invocation of TASK_WAKE_AFTER which
--- attempts to yield but does not result in a context switch.
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASKS
---
--- DESCRIPTION:
---
--- These RTEMS tasks are responsible for measuring and reporting the
--- execution time for an invocation of TASK_WAKE_AFTER which
--- attempts to yield but does result in a context switch.
---
-
- procedure TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm25/config.h b/c/src/ada-tests/tmtests/tm25/config.h
deleted file mode 100644
index e58f7c9923..0000000000
--- a/c/src/ada-tests/tmtests/tm25/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm25/tm25.adb b/c/src/ada-tests/tmtests/tm25/tm25.adb
deleted file mode 100644
index c3099ab193..0000000000
--- a/c/src/ada-tests/tmtests/tm25/tm25.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM25 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM25 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM25;
-
diff --git a/c/src/ada-tests/tmtests/tm25/tmtest.adb b/c/src/ada-tests/tmtests/tm25/tmtest.adb
deleted file mode 100644
index 080129028e..0000000000
--- a/c/src/ada-tests/tmtests/tm25/tmtest.adb
+++ /dev/null
@@ -1,157 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 25 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 25 ***" );
-
- RTEMS.SEMAPHORE_CREATE(
- RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ),
- 0,
- RTEMS.DEFAULT_ATTRIBUTES,
- RTEMS.NO_PRIORITY,
- TMTEST.SEMAPHORE_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ),
- 254,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOW" );
-
- RTEMS.TASK_START(
- TASK_ID,
- TMTEST.LOW_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOW" );
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ),
- 128,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- RTEMS.TASK_START(
- TASK_ID,
- TMTEST.HIGH_TASKS'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- HIGH_TASKS
---
-
- procedure HIGH_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.SEMAPHORE_OBTAIN(
- TMTEST.SEMAPHORE_ID,
- RTEMS.DEFAULT_OPTIONS,
- RTEMS.INTERVAL'LAST,
- STATUS
- );
-
- end HIGH_TASKS;
-
---PAGE
---
--- LOW_TASK
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.CLOCK_TICK( STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "CLOCK_TICK",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- RTEMS_CALLING_OVERHEAD.CLOCK_TICK
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end LOW_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm25/tmtest.ads b/c/src/ada-tests/tmtests/tm25/tmtest.ads
deleted file mode 100644
index 069e7e17ee..0000000000
--- a/c/src/ada-tests/tmtests/tm25/tmtest.ads
+++ /dev/null
@@ -1,80 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 25 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- The following is the ID of the semaphore used for timing operations.
---
-
- SEMAPHORE_ID : RTEMS.ID;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- HIGH_TASKS
---
--- DESCRIPTION:
---
--- These RTEMS tasks perform a blocking SEMAPHORE_OBTAIN which
--- has an optional timeout.
---
-
- procedure HIGH_TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- LOW_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is responsible for measuring and reporting
--- the execution time for the CLOCK_TICK directive.
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm26/README b/c/src/ada-tests/tmtests/tm26/README
deleted file mode 100644
index c54eb82024..0000000000
--- a/c/src/ada-tests/tmtests/tm26/README
+++ /dev/null
@@ -1,6 +0,0 @@
-#
-# $Id$
-#
-
-This test requires interfacing to internal RTEMS routines and
-is probably not worth the effort to convert.
diff --git a/c/src/ada-tests/tmtests/tm26/config.h b/c/src/ada-tests/tmtests/tm26/config.h
deleted file mode 100644
index e58f7c9923..0000000000
--- a/c/src/ada-tests/tmtests/tm26/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm26/tm26.adb b/c/src/ada-tests/tmtests/tm26/tm26.adb
deleted file mode 100644
index 8d4db0a3ed..0000000000
--- a/c/src/ada-tests/tmtests/tm26/tm26.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM26 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM26 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM26;
-
diff --git a/c/src/ada-tests/tmtests/tm26/tmtest.adp b/c/src/ada-tests/tmtests/tm26/tmtest.adp
deleted file mode 100644
index ddf0c39f7a..0000000000
--- a/c/src/ada-tests/tmtests/tm26/tmtest.adp
+++ /dev/null
@@ -1,650 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 26 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS_CALLING_OVERHEAD;
-with RTEMS;
-with RTEMS_TEST_SUPPORT;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-include(../../support/fp.inc)
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 26 ***" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'F', 'P', '1', ' ' ),
- 201,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.FLOATING_POINT,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF FP1" );
-
- RTEMS.TASK_START(
- TASK_ID,
- TMTEST.FLOATING_POINT_TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF FP1" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'F', 'P', '2', ' ' ),
- 202,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.FLOATING_POINT,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF FP2" );
-
- RTEMS.TASK_START(
- TASK_ID,
- TMTEST.FLOATING_POINT_TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF FP2" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ),
- 200,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF LOW" );
-
- RTEMS.TASK_START(
- TASK_ID,
- TMTEST.LOW_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF LOW" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'M', 'I', 'D', ' ' ),
- 128,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF MIDDLE" );
-
- RTEMS.TASK_START(
- TASK_ID,
- TMTEST.MIDDLE_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF MIDDLE" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ),
- 5,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF HIGH" );
-
- RTEMS.TASK_START(
- TASK_ID,
- TMTEST.HIGH_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF HIGH" );
-
- RTEMS.SEMAPHORE_CREATE(
- RTEMS.BUILD_NAME( 'S', 'E', 'M', '1' ),
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.SEMAPHORE_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" );
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'N', 'U', 'L', 'L' ),
- 254,
- 512,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TASK_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- RTEMS.TASK_START(
- TASK_ID,
- TMTEST.NULL_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- NULL_TASK
---
-
- procedure NULL_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- begin
-
- NULL;
-
- end NULL_TASK;
-
---PAGE
---
--- HIGH_TASK
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- begin
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS_TEST_SUPPORT.THREAD_ENABLE_DISPATCH;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "THREAD_ENABLE_DISPATCH",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS_TEST_SUPPORT.THREAD_SET_STATE(
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING,
- RTEMS.SUSPENDED
- );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "THREAD_SET_STATE",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- -- FORCE CONTEXT SWITCH
-
- RTEMS_TEST_SUPPORT.CONTEXT_SWITCH_NECESSARY := TRUE;
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS_TEST_SUPPORT.THREAD_DISPATCH; -- dispatches MIDDLE_TASK
-
- end HIGH_TASK;
-
---PAGE
---
--- MIDDLE_TASK
---
-
- procedure MIDDLE_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "THREAD_DISPATCH (NO FP)",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- RTEMS_TEST_SUPPORT.THREAD_SET_STATE(
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING,
- RTEMS.SUSPENDED
- );
-
- TMTEST.MIDDLE_TCB := RTEMS_TEST_SUPPORT.THREAD_EXECUTING;
-
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING :=
- RTEMS_TEST_SUPPORT.THREAD_TO_CONTROL_POINTER(
- RTEMS_TEST_SUPPORT.CHAIN_NODE_POINTER_TO_ADDRESS(
- RTEMS_TEST_SUPPORT.THREAD_READY_CHAIN( 200 ).FIRST
- )
- );
-
- -- do NOT force context switch
-
- RTEMS_TEST_SUPPORT.CONTEXT_SWITCH_NECESSARY := FALSE;
-
- RTEMS_TEST_SUPPORT.THREAD_DISABLE_DISPATCH;
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS_TEST_SUPPORT.CONTEXT_SWITCH(
- RTEMS_TEST_SUPPORT.CONTEXT_TO_CONTROL_POINTER(
- TMTEST.MIDDLE_TCB.REGISTERS'ADDRESS
- ),
- RTEMS_TEST_SUPPORT.CONTEXT_TO_CONTROL_POINTER(
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING.REGISTERS'ADDRESS
- )
- );
-
- end MIDDLE_TASK;
-
---PAGE
---
--- LOW_TASK
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- EXECUTING : RTEMS.TCB_POINTER;
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "CONTEXT_SWITCH (NO FP)",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- EXECUTING := RTEMS_TEST_SUPPORT.THREAD_EXECUTING;
-
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING :=
- RTEMS_TEST_SUPPORT.THREAD_TO_CONTROL_POINTER(
- RTEMS_TEST_SUPPORT.CHAIN_NODE_POINTER_TO_ADDRESS(
- RTEMS_TEST_SUPPORT.THREAD_READY_CHAIN( 201 ).FIRST
- )
- );
-
- -- do NOT force context switch
-
- RTEMS_TEST_SUPPORT.CONTEXT_SWITCH_NECESSARY := FALSE;
-
- RTEMS_TEST_SUPPORT.THREAD_DISABLE_DISPATCH;
-
- TIMER_DRIVER.INITIALIZE;
-
- RTEMS_TEST_SUPPORT.CONTEXT_RESTORE_FP(
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING.FP_CONTEXT'ADDRESS
- );
- RTEMS_TEST_SUPPORT.CONTEXT_SWITCH(
- RTEMS_TEST_SUPPORT.CONTEXT_TO_CONTROL_POINTER(
- EXECUTING.REGISTERS'ADDRESS
- ),
- RTEMS_TEST_SUPPORT.CONTEXT_TO_CONTROL_POINTER(
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING.REGISTERS'ADDRESS
- )
- );
-
- end LOW_TASK;
-
---PAGE
---
--- FLOATING_POINT_TASK_1
---
-
- procedure FLOATING_POINT_TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- EXECUTING : RTEMS.TCB_POINTER;
- FP_DECLARE;
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "CONTEXT_SWITCH (restore 1st FP)",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- EXECUTING := RTEMS_TEST_SUPPORT.THREAD_EXECUTING;
-
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING :=
- RTEMS_TEST_SUPPORT.THREAD_TO_CONTROL_POINTER(
- RTEMS_TEST_SUPPORT.CHAIN_NODE_POINTER_TO_ADDRESS(
- RTEMS_TEST_SUPPORT.THREAD_READY_CHAIN( 202 ).FIRST
- )
- );
-
- -- do NOT force context switch
-
- RTEMS_TEST_SUPPORT.CONTEXT_SWITCH_NECESSARY := FALSE;
-
- RTEMS_TEST_SUPPORT.THREAD_DISABLE_DISPATCH;
-
- TIMER_DRIVER.INITIALIZE;
-
- RTEMS_TEST_SUPPORT.CONTEXT_SAVE_FP( EXECUTING.FP_CONTEXT'ADDRESS );
- RTEMS_TEST_SUPPORT.CONTEXT_RESTORE_FP(
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING.FP_CONTEXT'ADDRESS
- );
- RTEMS_TEST_SUPPORT.CONTEXT_SWITCH(
- RTEMS_TEST_SUPPORT.CONTEXT_TO_CONTROL_POINTER(
- EXECUTING.REGISTERS'ADDRESS
- ),
- RTEMS_TEST_SUPPORT.CONTEXT_TO_CONTROL_POINTER(
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING.REGISTERS'ADDRESS
- )
- );
-
- -- switch to FLOATING_POINT_TASK_2
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "CONTEXT_SWITCH (used->init FP)",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- FP_LOAD( 1.0 );
-
- EXECUTING := RTEMS_TEST_SUPPORT.THREAD_EXECUTING;
-
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING :=
- RTEMS_TEST_SUPPORT.THREAD_TO_CONTROL_POINTER(
- RTEMS_TEST_SUPPORT.CHAIN_NODE_POINTER_TO_ADDRESS(
- RTEMS_TEST_SUPPORT.THREAD_READY_CHAIN( 202 ).FIRST
- )
- );
-
- -- do NOT force context switch
-
- RTEMS_TEST_SUPPORT.CONTEXT_SWITCH_NECESSARY := FALSE;
-
- RTEMS_TEST_SUPPORT.THREAD_DISABLE_DISPATCH;
-
- TIMER_DRIVER.INITIALIZE;
-
- RTEMS_TEST_SUPPORT.CONTEXT_SAVE_FP( EXECUTING.FP_CONTEXT'ADDRESS );
- RTEMS_TEST_SUPPORT.CONTEXT_RESTORE_FP(
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING.FP_CONTEXT'ADDRESS
- );
- RTEMS_TEST_SUPPORT.CONTEXT_SWITCH(
- RTEMS_TEST_SUPPORT.CONTEXT_TO_CONTROL_POINTER(
- EXECUTING.REGISTERS'ADDRESS
- ),
- RTEMS_TEST_SUPPORT.CONTEXT_TO_CONTROL_POINTER(
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING.REGISTERS'ADDRESS
- )
- );
-
- -- switch to FLOATING_POINT_TASK_2
-
- end FLOATING_POINT_TASK_1;
-
---PAGE
---
--- FLOATING_POINT_TASK_2
---
-
- procedure FLOATING_POINT_TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- EXECUTING : RTEMS.TCB_POINTER;
- FP_DECLARE;
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "CONTEXT_SWITCH (init->init FP)",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- EXECUTING := RTEMS_TEST_SUPPORT.THREAD_EXECUTING;
-
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING :=
- RTEMS_TEST_SUPPORT.THREAD_TO_CONTROL_POINTER(
- RTEMS_TEST_SUPPORT.CHAIN_NODE_POINTER_TO_ADDRESS(
- RTEMS_TEST_SUPPORT.THREAD_READY_CHAIN( 201 ).FIRST
- )
- );
-
- FP_LOAD( 1.0 );
-
- -- do NOT force context switch
-
- RTEMS_TEST_SUPPORT.CONTEXT_SWITCH_NECESSARY := FALSE;
-
- RTEMS_TEST_SUPPORT.THREAD_DISABLE_DISPATCH;
-
- TIMER_DRIVER.INITIALIZE;
-
- RTEMS_TEST_SUPPORT.CONTEXT_SAVE_FP( EXECUTING.FP_CONTEXT'ADDRESS );
- RTEMS_TEST_SUPPORT.CONTEXT_RESTORE_FP(
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING.FP_CONTEXT'ADDRESS
- );
- RTEMS_TEST_SUPPORT.CONTEXT_SWITCH(
- RTEMS_TEST_SUPPORT.CONTEXT_TO_CONTROL_POINTER(
- EXECUTING.REGISTERS'ADDRESS
- ),
- RTEMS_TEST_SUPPORT.CONTEXT_TO_CONTROL_POINTER(
- RTEMS_TEST_SUPPORT.THREAD_EXECUTING.REGISTERS'ADDRESS
- )
- );
-
- -- switch to FLOATING_POINT_TASK_1
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "CONTEXT_SWITCH (used->used FP)",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- TMTEST.COMPLETE_TEST;
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end FLOATING_POINT_TASK_2;
-
---PAGE
---
--- COMPLETE_TEST
---
-
- procedure COMPLETE_TEST
- is
- INDEX : RTEMS.UNSIGNED32;
- OVERHEAD : RTEMS.UNSIGNED32;
- TASK_ID : RTEMS.ID;
- LOCATION : RTEMS_TEST_SUPPORT.OBJECTS_LOCATIONS;
- THE_SEMAPHORE : RTEMS.TCB_POINTER;
- THE_THREAD : RTEMS.TCB_POINTER;
- begin
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS_TEST_SUPPORT.THREAD_RESUME( TMTEST.MIDDLE_TCB );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "THREAD_RESUME",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- RTEMS_TEST_SUPPORT.THREAD_SET_STATE(
- TMTEST.MIDDLE_TCB,
- RTEMS.WAITING_FOR_MESSAGE
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS_TEST_SUPPORT.THREAD_UNBLOCK( TMTEST.MIDDLE_TCB );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "THREAD_UNBLOCK",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- RTEMS_TEST_SUPPORT.THREAD_SET_STATE(
- TMTEST.MIDDLE_TCB,
- RTEMS.WAITING_FOR_MESSAGE
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS_TEST_SUPPORT.THREAD_READY( TMTEST.MIDDLE_TCB );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "THREAD_READY",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS_TEST_SUPPORT.THREAD_GET(
- TASK_ID,
- LOCATION,
- THE_THREAD
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "THREAD_GET",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- 0
- );
-
--- TIMER_DRIVER.INITIALIZE;
--- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
--- loop
--- RTEMS_TEST_SUPPORT.SEMAPHORE_GET(
--- TMTEST.SEMAPHORE_ID,
--- LOCATION,
--- THE_SEMAPHORE
--- );
--- end loop;
--- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
--- TIME_TEST_SUPPORT.PUT_TIME(
--- "SEMAPHORE_GET",
--- TMTEST.END_TIME,
--- TIME_TEST_SUPPORT.OPERATION_COUNT,
--- 0,
--- 0
--- );
- TEXT_IO.PUT_LINE( "SEMAPHORE_GET NOT IN ADA" );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS_TEST_SUPPORT.THREAD_GET(
- 16#3#,
- LOCATION,
- THE_THREAD
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "THREAD_GET (invalid id)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- 0,
- 0
- );
-
- end COMPLETE_TEST;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm26/tmtest.ads b/c/src/ada-tests/tmtests/tm26/tmtest.ads
deleted file mode 100644
index 3f56e24010..0000000000
--- a/c/src/ada-tests/tmtests/tm26/tmtest.ads
+++ /dev/null
@@ -1,189 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 26 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- This points to the RTEMS task control block for the MIDDLE_TASK.
---
-
- MIDDLE_TCB : RTEMS.TCB_POINTER;
-
---
--- The following is the ID of the semaphore used for timing operations.
---
-
- SEMAPHORE_ID : RTEMS.ID;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- NULL_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task has a NULL body and is only included to
--- allow TASK_START to be invoked without impacting another
--- task.
---
-
- procedure NULL_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- HIGH_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is the highest priority test task and
--- thus executes first. It is responsible for measuring
--- and reporting the following times:
---
--- + THREAD_DISABLE_DISPATCH
--- + THREAD_ENABLE_DISPATCH
--- + THREAD_SET_STATE
---
--- After measuring and reporting the above times, this task
--- starts the timer and forces dispatch to the MIDDLE_TASK.
---
-
- procedure HIGH_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- MIDDLE_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task stops the timer and reports the execution
--- time for THREAD_DISPATCH without any floating point context
--- save and restore involved. Following this, it starts the
--- timer and forces a CONTEXT_SWITCH to the LOW_TASK.
---
-
- procedure MIDDLE_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- LOW_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task stops the timer and reports the execution
--- time for a raw CONTEXT_SWITCH without any floating point context
--- save and restore involved. Following this, it starts the
--- timer and performs a CONTEXT_RESTORE_FP for the FLOATING_POINT_TASK_1
--- and a CONTEXT_SWITCH to FLOATING_POINT_TASK_1.
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- FLOATING_POINT_TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task stops the timer and reports the execution
--- time for a CONTEXT_SWITCH which restores the first floating
--- point context. Following this, it starts the
--- timer and performs a CONTEXT_SAVE_FP and CONTEXT_RESTORE_FP
--- and a CONTEXT_SWITCH to FLOATING_POINT_TASK_2. Once
--- control is returned to this task FLOATING_POINT_TASK_2, the
--- timer is stopped and the execution time for CONTEXT_SWITCH
--- from a used to an initialized floating point context is reported.
--- Following this, it starts the timer and performs a
--- CONTEXT_SAVE_FP and CONTEXT_RESTORE_FP and a CONTEXT_SWITCH
--- to FLOATING_POINT_TASK_2.
---
-
- procedure FLOATING_POINT_TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- FLOATING_POINT_TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task stops the timer and reports the execution
--- time for a CONTEXT_SWITCH which switches from one freshly
--- initialized floating point context to another freshly
--- initialized floating point context. Following this, it
--- "dirties" its floating point context and starts the
--- timer. After this it performs a CONTEXT_SAVE_FP and
--- CONTEXT_RESTORE_FP and a CONTEXT_SWITCH to FLOATING_POINT_TASK_1.
--- Once control is returned to this task FLOATING_POINT_TASK_2, the
--- timer is stopped and the execution time for CONTEXT_SWITCH
--- from one used floating point context to another used floating
--- point context is reported. After this, this task invokes
--- the COMPLETE_TEST subprogram to measure and report
--- the remaining execution times measured by this test.
---
-
- procedure FLOATING_POINT_TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- COMPLETE_TEST
---
--- DESCRIPTION:
---
--- This subprogram is responsible for measuring and reporting the
--- following execution times:
---
--- + THREAD_RESUME
--- + THREAD_UNBLOCK
--- + THREAD_READY
--- + THREAD_GET with a valid id
--- + THREAD_GET with an invalid id
---
-
- procedure COMPLETE_TEST;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm27/README b/c/src/ada-tests/tmtests/tm27/README
deleted file mode 100644
index 7fa8ba0b23..0000000000
--- a/c/src/ada-tests/tmtests/tm27/README
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# $Id$
-#
-
-This test requires interfacing to BSP provided macros which aid in
-installing an ISR. It may or may not be worth the effort to convert.
-Primarily this would require a C file which provided real bodies
-to invoke for these macros.
diff --git a/c/src/ada-tests/tmtests/tm27/config.h b/c/src/ada-tests/tmtests/tm27/config.h
deleted file mode 100644
index 7e7793cf15..0000000000
--- a/c/src/ada-tests/tmtests/tm27/config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm27/tm27.adb b/c/src/ada-tests/tmtests/tm27/tm27.adb
deleted file mode 100644
index 7a8e1ca9f3..0000000000
--- a/c/src/ada-tests/tmtests/tm27/tm27.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM27 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM27 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM27;
-
diff --git a/c/src/ada-tests/tmtests/tm27/tmtest.adb b/c/src/ada-tests/tmtests/tm27/tmtest.adb
deleted file mode 100644
index 12761659be..0000000000
--- a/c/src/ada-tests/tmtests/tm27/tmtest.adb
+++ /dev/null
@@ -1,268 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 27 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERRUPT_TIME_TEST_SUPPORT;
-with INTERFACES; use INTERFACES;
-with RTEMS_CALLING_OVERHEAD;
-with RTEMS;
-with RTEMS_TEST_SUPPORT;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 27 ***" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ),
- 254,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE TASK_1" );
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( 1 ),
- TMTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START TASK_1" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ),
- 254,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( 2 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE TASK_2" );
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( 2 ),
- TMTEST.TASK_2'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START TASK_2" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- begin
-
- RTEMS_TEST_SUPPORT.THREAD_DISPATCH_DISABLE_LEVEL := 1;
-
- TMTEST.INTERRUPT_NEST := 1;
-
- INTERRUPT_TIME_TEST_SUPPORT.INSTALL_HANDLER(
- TMTEST.ISR_HANDLER'ADDRESS
- );
-
- TIMER_DRIVER.INITIALIZE;
- INTERRUPT_TIME_TEST_SUPPORT.CAUSE_INTERRUPT;
- -- goes to ISR_HANDLER
-
- TMTEST.INTERRUPT_RETURN_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "INTERRUPT_ENTER (nested interrupt)",
- TMTEST.INTERRUPT_ENTER_NESTED_TIME,
- 1,
- 0,
- 0
- );
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "INTERRUPT_RETURN (nested interrupt)",
- TMTEST.INTERRUPT_RETURN_NESTED_TIME,
- 1,
- 0,
- 0
- );
-
- TMTEST.INTERRUPT_NEST := 0;
-
- RTEMS_TEST_SUPPORT.THREAD_DISPATCH_DISABLE_LEVEL := 0;
-
- TIMER_DRIVER.INITIALIZE;
- INTERRUPT_TIME_TEST_SUPPORT.CAUSE_INTERRUPT;
- -- goes to ISR_HANDLER
-
- TMTEST.INTERRUPT_RETURN_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "INTERRUPT_ENTER (no preempt)",
- TMTEST.INTERRUPT_ENTER_TIME,
- 1,
- 0,
- 0
- );
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "INTERRUPT_RETURN (no preempt)",
- TMTEST.INTERRUPT_RETURN_TIME,
- 1,
- 0,
- 0
- );
-
- RTEMS_TEST_SUPPORT.THREAD_DISPATCH_DISABLE_LEVEL := 0;
-
- RTEMS_TEST_SUPPORT.THREAD_HEIR :=
- RTEMS_TEST_SUPPORT.THREAD_TO_CONTROL_POINTER(
- RTEMS_TEST_SUPPORT.CHAIN_NODE_POINTER_TO_ADDRESS(
- RTEMS_TEST_SUPPORT.THREAD_READY_CHAIN( 254 ).LAST
- )
- );
-
- RTEMS_TEST_SUPPORT.CONTEXT_SWITCH_NECESSARY := TRUE;
-
- TIMER_DRIVER.INITIALIZE;
- INTERRUPT_TIME_TEST_SUPPORT.CAUSE_INTERRUPT;
- -- goes to ISR_HANDLER
-
- end TASK_1;
-
---PAGE
---
--- TASK_2
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- begin
-
- TMTEST.INTERRUPT_RETURN_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "INTERRUPT_ENTER (preempt)",
- TMTEST.INTERRUPT_ENTER_TIME,
- 1,
- 0,
- 0
- );
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "INTERRUPT_RETURN (preempt)",
- TMTEST.INTERRUPT_RETURN_TIME,
- 1,
- 0,
- 0
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_2;
-
---PAGE
---
--- ISR_HANDLER
---
-
---
--- The ISR_HANDLER and ISR_HANDLER_INNER subprograms are structured
--- so that there will be as little entry overhead as possible included
--- in the interrupt entry time.
---
-
- procedure ISR_HANDLER (
- VECTOR : in RTEMS.VECTOR_NUMBER
- ) is
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TMTEST.ISR_HANDLER_INNER;
-
- end ISR_HANDLER;
-
---
--- ISR_HANDLER_INNER
---
-
- procedure ISR_HANDLER_INNER
- is
- begin
-
- -- enable tracing here is necessary
-
- INTERRUPT_TIME_TEST_SUPPORT.CLEAR_INTERRUPT;
-
- case TMTEST.INTERRUPT_NEST is
- when 0 =>
- TMTEST.INTERRUPT_ENTER_TIME := TMTEST.END_TIME;
-
- when 1 =>
- TMTEST.INTERRUPT_ENTER_TIME := TMTEST.END_TIME;
- TMTEST.INTERRUPT_NEST := 2;
- TIMER_DRIVER.INITIALIZE;
- INTERRUPT_TIME_TEST_SUPPORT.CAUSE_INTERRUPT;
- -- goes to a nested copy of ISR_HANDLER
-
- TMTEST.INTERRUPT_RETURN_NESTED_TIME := TIMER_DRIVER.READ_TIMER;
-
- when 2 =>
- TMTEST.INTERRUPT_ENTER_NESTED_TIME := TMTEST.END_TIME;
-
- when others =>
- NULL;
-
- end case;
-
- -- Start the timer so interrupt return times can be measured
-
- TIMER_DRIVER.INITIALIZE;
-
- end ISR_HANDLER_INNER;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm27/tmtest.ads b/c/src/ada-tests/tmtests/tm27/tmtest.ads
deleted file mode 100644
index ef7848c822..0000000000
--- a/c/src/ada-tests/tmtests/tm27/tmtest.ads
+++ /dev/null
@@ -1,131 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 27 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- This array contains the IDs of all RTEMS tasks created by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- The following variable indicates which interrupt case is
--- currently being timed.
---
-
- INTERRUPT_NEST : RTEMS.UNSIGNED32;
-
---
--- The following variables are set to the appropriate execution
--- times by the ISR. This is done so the times will be available
--- to be printed by a task.
---
-
- INTERRUPT_ENTER_TIME : RTEMS.UNSIGNED32;
- INTERRUPT_RETURN_TIME : RTEMS.UNSIGNED32;
-
- INTERRUPT_ENTER_NESTED_TIME : RTEMS.UNSIGNED32;
- INTERRUPT_RETURN_NESTED_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task reports the following execution times:
---
--- + interrupt entry overhead for a nested interrupt
--- + interrupt exit overhead for a nested interrupt
--- + interrupt entry overhead when no preemption occurs
--- + interrupt exit overhead when no preemption occurs
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_2
---
--- DESCRIPTION:
---
--- This RTEMS task reports the following execution times:
---
--- + interrupt entry overhead when preemption occurs
--- + interrupt exit overhead when preemption occurs
---
-
- procedure TASK_2 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- ISR_HANDLER
---
--- DESCRIPTION:
---
--- This subprogram is the test ISR. It simply stops the
--- timer and save the execution time for ISR_HANDLER_INNER.
--- This is done to minimize the subroutine linkage overhead
--- for this routine.
---
-
- procedure ISR_HANDLER (
- VECTOR : in RTEMS.VECTOR_NUMBER
- );
-
---
--- ISR_HANDLER_INNER
---
--- DESCRIPTION:
---
--- This subprogram is responsible for storing the execution
--- time for the case currently being timed.
---
-
- procedure ISR_HANDLER_INNER;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm28/config.h b/c/src/ada-tests/tmtests/tm28/config.h
deleted file mode 100644
index 0c238dfbaf..0000000000
--- a/c/src/ada-tests/tmtests/tm28/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 2
-#define CONFIGURE_MAXIMUM_PORTS 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm28/tm28.adb b/c/src/ada-tests/tmtests/tm28/tm28.adb
deleted file mode 100644
index e76d166e7a..0000000000
--- a/c/src/ada-tests/tmtests/tm28/tm28.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM28 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM28 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM28;
-
diff --git a/c/src/ada-tests/tmtests/tm28/tmtest.adb b/c/src/ada-tests/tmtests/tm28/tmtest.adb
deleted file mode 100644
index 7505635c06..0000000000
--- a/c/src/ada-tests/tmtests/tm28/tmtest.adb
+++ /dev/null
@@ -1,176 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 28 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- TASK_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 28 ***" );
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'E', 'S', 'T' ),
- 128,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" );
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( 1 ),
- TMTEST.TEST_TASK'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TEST_TASK
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- NAME : RTEMS.NAME;
- OVERHEAD : RTEMS.UNSIGNED32;
- CONVERTED : RTEMS.ADDRESS;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- NAME := RTEMS.BUILD_NAME( 'P', 'O', 'R', 'T' );
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.PORT_CREATE(
- NAME,
- TMTEST.INTERNAL_PORT_AREA'ADDRESS,
- TMTEST.EXTERNAL_PORT_AREA'ADDRESS,
- 16#FF#,
- TMTEST.PORT_ID( INDEX ),
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PORT_CREATE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.PORT_CREATE
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.PORT_EXTERNAL_TO_INTERNAL(
- TMTEST.PORT_ID( 1 ),
- TMTEST.EXTERNAL_PORT_AREA( 16#F# )'ADDRESS,
- CONVERTED,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PORT_EXTERNAL_TO_INTERNAL",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.PORT_EXTERNAL_TO_INTERNAL
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.PORT_INTERNAL_TO_EXTERNAL(
- TMTEST.PORT_ID( 1 ),
- TMTEST.INTERNAL_PORT_AREA( 16#F# )'ADDRESS,
- CONVERTED,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PORT_INTERNAL_TO_EXTERNAL",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.PORT_INTERNAL_TO_EXTERNAL
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- RTEMS.PORT_DELETE( TMTEST.PORT_ID( INDEX ), STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PORT_DELETE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.PORT_DELETE
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TEST_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm28/tmtest.ads b/c/src/ada-tests/tmtests/tm28/tmtest.ads
deleted file mode 100644
index 5bf220d453..0000000000
--- a/c/src/ada-tests/tmtests/tm28/tmtest.ads
+++ /dev/null
@@ -1,106 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 28 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIME_TEST_SUPPORT;
-with TIMER_DRIVER;
-with RTEMS;
-with System.Storage_Elements;
-
-package TMTEST is
-
---
--- This array contains the IDs of all RTEMS tasks created by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
-
---
--- This array contains the IDs of all RTEMS ports created by this test.
---
-
- PORT_ID : array ( RTEMS.UNSIGNED32
- range 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
-
---
--- The following area defines a memory area to be used as the
--- internal address space of the port.
---
-
- INTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
- System.Storage_Elements.To_Address(16#00001000#);
-
- INTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for INTERNAL_PORT_AREA use at INTERNAL_PORT_AREA_ADDRESS;
-
---
--- The following area defines a memory area to be used as the
--- external address space of the port.
---
-
- EXTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
- System.Storage_Elements.To_Address(16#00002000#);
-
- EXTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for EXTERNAL_PORT_AREA use at EXTERNAL_PORT_AREA_ADDRESS;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task is responsible for measuring and reporting the
--- following directive execution times:
---
--- + PORT_CREATE
--- + PORT_EXTERNAL_TO_INTERNAL
--- + PORT_INTERNAL_TO_EXTERNAL
--- + PORT_DELETE
---
-
- procedure TEST_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm29/config.h b/c/src/ada-tests/tmtests/tm29/config.h
deleted file mode 100644
index d22b4a61cb..0000000000
--- a/c/src/ada-tests/tmtests/tm29/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_MAXIMUM_PERIODS 111
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tm29/tm29.adb b/c/src/ada-tests/tmtests/tm29/tm29.adb
deleted file mode 100644
index 7834403d2b..0000000000
--- a/c/src/ada-tests/tmtests/tm29/tm29.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TM29 of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TM29 is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TM29;
-
diff --git a/c/src/ada-tests/tmtests/tm29/tmtest.adb b/c/src/ada-tests/tmtests/tm29/tmtest.adb
deleted file mode 100644
index e1f1af77dd..0000000000
--- a/c/src/ada-tests/tmtests/tm29/tmtest.adb
+++ /dev/null
@@ -1,234 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Test 29 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 INTERFACES; use INTERFACES;
-with RTEMS;
-with RTEMS_CALLING_OVERHEAD;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST 29 ***" );
-
- TMTEST.PERIOD_NAME := RTEMS.BUILD_NAME( 'P', 'R', 'D', ' ' );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.RATE_MONOTONIC_CREATE( TMTEST.PERIOD_NAME, ID, STATUS );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "RATE_MONOTONIC_CREATE",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_CREATE
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.RATE_MONOTONIC_PERIOD( ID, 10, STATUS );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "RATE_MONOTONIC_PERIOD (initial)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_PERIOD
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.RATE_MONOTONIC_PERIOD( ID, RTEMS.PERIOD_STATUS, STATUS );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "RATE_MONOTONIC_PERIOD (STATUS)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_PERIOD
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.RATE_MONOTONIC_CANCEL( ID, STATUS );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "RATE_MONOTONIC_CANCEL",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_CANCEL
- );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.RATE_MONOTONIC_DELETE( ID, STATUS );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "RATE_MONOTONIC_DELETE (cancelled)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_DELETE
- );
-
- RTEMS.RATE_MONOTONIC_CREATE( TMTEST.PERIOD_NAME, ID, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CREATE" );
-
- RTEMS.RATE_MONOTONIC_PERIOD( ID, 10, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" );
-
- TIMER_DRIVER.INITIALIZE;
- RTEMS.RATE_MONOTONIC_DELETE( ID, STATUS );
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "RATE_MONOTONIC_DELETE (active)",
- TMTEST.END_TIME,
- 1,
- 0,
- RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_DELETE
- );
-
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'T', 'E', 'S', 'T' ),
- 128,
- 1024,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- RTEMS.TASK_START( ID, TMTEST.TASKS'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- end loop;
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ),
- 200,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" );
-
- RTEMS.TASK_START( ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" );
-
- TMTEST.TASK_COUNT := 0;
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASKS
---
-
- procedure TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- ID : RTEMS.NAME;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- RTEMS.RATE_MONOTONIC_CREATE( TMTEST.PERIOD_NAME, ID, STATUS );
- RTEMS.RATE_MONOTONIC_PERIOD( ID, 10, STATUS );
-
- -- Give up the processor to allow all tasks to actually
- -- create and start their period timer before the benchmark
- -- timer driver is initialized.
-
- RTEMS.TASK_WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS );
-
- TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1;
-
- if TMTEST.TASK_COUNT = 1 then
- TIMER_DRIVER.INITIALIZE;
- end if;
-
- RTEMS.RATE_MONOTONIC_PERIOD( ID, 100, STATUS );
-
- end TASKS;
-
---PAGE
---
--- LOW_TASK
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- OVERHEAD : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- OVERHEAD := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "RATE_MONOTONIC_PERIOD (blocking)",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_PERIOD
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end LOW_TASK;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tm29/tmtest.ads b/c/src/ada-tests/tmtests/tm29/tmtest.ads
deleted file mode 100644
index e60ded1e11..0000000000
--- a/c/src/ada-tests/tmtests/tm29/tmtest.ads
+++ /dev/null
@@ -1,96 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Test 29 of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- The following is the name used for all periods created by this test.
---
-
- PERIOD_NAME : RTEMS.NAME;
-
---
--- The following is used to allow all tasks to create and start
--- their period timers before the timer is started for timing
--- the blocking case of RATE_MONOTONIC_PERIOD.
---
-
- TASK_COUNT : RTEMS.UNSIGNED32;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application. It also measures and
--- reports the following directive execution times:
---
--- + RATE_MONOTONIC_CREATE
--- + RATE_MONOTONIC_PERIOD the initial time
--- + RATE_MONOTONIC_PERIOD for a period's status
--- + RATE_MONOTONIC_CANCEL
--- + RATE_MONOTONIC_DELETE of a cancelled period
--- + RATE_MONOTONIC_DELETE of an active period
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- The first of these RTEMS tasks starts the timer. All of these
--- tasks execute a blocking RATE_MONOTONIC_PERIOD.
---
-
- procedure TASKS (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TEST_TASK
---
--- DESCRIPTION:
---
--- This RTEMS task stops the timer and reports the execution
--- time for a blocking RATE_MONOTONIC_PERIOD.
---
-
- procedure LOW_TASK (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tmck/config.h b/c/src/ada-tests/tmtests/tmck/config.h
deleted file mode 100644
index be54f54955..0000000000
--- a/c/src/ada-tests/tmtests/tmck/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 2
-#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tmck/tmck.adb b/c/src/ada-tests/tmtests/tmck/tmck.adb
deleted file mode 100644
index 4f05735bca..0000000000
--- a/c/src/ada-tests/tmtests/tmck/tmck.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TMCK of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TMCK is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TMCK;
-
diff --git a/c/src/ada-tests/tmtests/tmck/tmtest.adb b/c/src/ada-tests/tmtests/tmck/tmtest.adb
deleted file mode 100644
index 254a462bcc..0000000000
--- a/c/src/ada-tests/tmtests/tmck/tmtest.adb
+++ /dev/null
@@ -1,220 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Timer Check Test of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST CHECK ***" );
-
- TIMER_DRIVER.SET_FIND_AVERAGE_OVERHEAD( TRUE );
-
- TMTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
-
- RTEMS.TASK_CREATE(
- TMTEST.TASK_NAME( 1 ),
- 1,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( 1 ),
- TMTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TASK_1
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- INDEX : RTEMS.UNSIGNED32;
- begin
-
- TMTEST.CHECK_READ_TIMER;
-
-TEST_SUPPORT.PAUSE;
-
- TIMER_DRIVER.INITIALIZE;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "NULL timer stopped at",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 0 .. 1000
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "LOOP (1000) timer stopped at",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 0 .. 10000
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "LOOP (10000) timer stopped at",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 0 .. 50000
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "LOOP (50000) timer stopped at",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 0 .. 100000
- loop
- TIMER_DRIVER.EMPTY_FUNCTION;
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
- TIME_TEST_SUPPORT.PUT_TIME(
- "LOOP (100000) timer stopped at",
- TMTEST.END_TIME,
- 1,
- 0,
- 0
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
---PAGE
---
--- CHECK_READ_TIMER
---
-
- procedure CHECK_READ_TIMER
- is
- INDEX : RTEMS.UNSIGNED32;
- TIME : RTEMS.UNSIGNED32;
- begin
-
- for INDEX in TMTEST.DISTRIBUTION'FIRST .. TMTEST.DISTRIBUTION'LAST
- loop
- TMTEST.DISTRIBUTION( INDEX ) := 0;
- end loop;
-
- for INDEX in 1 .. TMTEST.OPERATION_COUNT
- loop
-
- loop
- TIMER_DRIVER.INITIALIZE;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- exit when
- TMTEST.END_TIME <= RTEMS.UNSIGNED32( TMTEST.DISTRIBUTION'LAST );
-
- TEXT_IO.PUT( "TOO LONG (" );
- UNSIGNED32_IO.PUT( TMTEST.END_TIME );
- TEXT_IO.PUT_LINE( ")!!!" );
- end loop;
-
- TMTEST.DISTRIBUTION( TMTEST.END_TIME ) :=
- TMTEST.DISTRIBUTION( TMTEST.END_TIME ) + 1;
-
- end loop;
-
- TEXT_IO.PUT_LINE(
- "Units may not be in microseconds for this test!!!"
- );
-
- TIME := 0;
-
- for INDEX in TMTEST.DISTRIBUTION'FIRST .. TMTEST.DISTRIBUTION'LAST
- loop
- if TMTEST.DISTRIBUTION( INDEX ) /= 0 then
- TIME := TIME + (TMTEST.DISTRIBUTION( INDEX ) * INDEX);
- UNSIGNED32_IO.PUT( INDEX );
- TEXT_IO.PUT( " " );
- UNSIGNED32_IO.PUT( TMTEST.DISTRIBUTION( INDEX ) );
- TEXT_IO.NEW_LINE;
- end if;
- end loop;
-
- TEXT_IO.PUT( "Total time = " );
- UNSIGNED32_IO.PUT( TIME );
- TEXT_IO.NEW_LINE;
-
- end CHECK_READ_TIMER;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tmck/tmtest.ads b/c/src/ada-tests/tmtests/tmck/tmtest.ads
deleted file mode 100644
index 8f82d786a2..0000000000
--- a/c/src/ada-tests/tmtests/tmck/tmtest.ads
+++ /dev/null
@@ -1,97 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Timer Check Test of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 TIMER_DRIVER;
-with RTEMS;
-
-package TMTEST is
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- The following defines the number of iterations of each timed
--- operation to perform.
---
-
- OPERATION_COUNT : constant RTEMS.UNSIGNED32 := 100000;
-
---
--- The following array is used to determine how many times
--- each time between 0 and 1000 microseconds was returned
--- when simply starting and stopping the timer.
-
- DISTRIBUTION : array ( RTEMS.UNSIGNED32 range 0 .. 10000 ) of RTEMS.UNSIGNED32;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task invokes CHECK_READ_TIMER before demonstrating
--- that increasing the order of magnitude of the number of loop
--- iterations performed has a corresponding impact on the time
--- reported by the timer driver.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- CHECK_READ_TIMER
---
--- DESCRIPTION:
---
--- This subprogram is used to determine the overhead associated
--- with starting and stopping the timer. It is also useful
--- for determining if unexpected times will be reported.
---
-
- procedure CHECK_READ_TIMER;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tmoverhd/README b/c/src/ada-tests/tmtests/tmoverhd/README
deleted file mode 100644
index d5624c4270..0000000000
--- a/c/src/ada-tests/tmtests/tmoverhd/README
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# $Id$
-#
-
-This test is of marginal usefulness in testing the bindings. It
-shows how much overhead is required to call the Ada binding
-routine but does not give any indication of how much overhead the
-binding itself adds. This information can be inferred by subtracting
-the C times from Ada times on the same target processor.
diff --git a/c/src/ada-tests/tmtests/tmoverhd/config.h b/c/src/ada-tests/tmtests/tmoverhd/config.h
deleted file mode 100644
index be54f54955..0000000000
--- a/c/src/ada-tests/tmtests/tmoverhd/config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* config.h
- *
- * This include file defines the Configuration Table for this test.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 2
-#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.adb b/c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.adb
deleted file mode 100644
index e6a3519e99..0000000000
--- a/c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.adb
+++ /dev/null
@@ -1,877 +0,0 @@
---
--- DUMMY_RTEMS / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package contains implementation of stub routines
--- which are used to time the invocation overhead incurred
--- with an Ada application program invokes each RTEMS directive.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package body DUMMY_RTEMS is
-
--- Initialization Manager
-
- procedure INITIALIZE_EXECUTIVE (
- CONFIGURATION_TABLE : in RTEMS.CONFIGURATION_TABLE_POINTER;
- CPU_TABLE : in RTEMS.CPU_TABLE_POINTER
- ) is
- begin
-
- NULL;
-
- end INITIALIZE_EXECUTIVE;
-
- procedure SHUTDOWN_EXECUTIVE (
- RESULT : in RTEMS.UNSIGNED32
- ) is
- begin
-
- NULL;
-
- 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
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TASK_CREATE;
-
- procedure TASK_IDENT (
- NAME : in RTEMS.NAME;
- NODE : in RTEMS.UNSIGNED32;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TASK_IDENT;
-
- procedure TASK_START (
- ID : in RTEMS.ID;
- ENTRY_POINT : in RTEMS.TASK_ENTRY;
- ARGUMENT : in RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TASK_START;
-
- procedure TASK_RESTART (
- ID : in RTEMS.ID;
- ARGUMENT : in RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TASK_RESTART;
-
- procedure TASK_DELETE (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TASK_DELETE;
-
- procedure TASK_SUSPEND (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TASK_SUSPEND;
-
- procedure TASK_RESUME (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- 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
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TASK_SET_PRIORITY;
-
- procedure TASK_MODE (
- MODE_SET : in RTEMS.MODE;
- MASK : in RTEMS.MODE;
- PREVIOUS_MODE_SET : out RTEMS.MODE;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- 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
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- 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
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TASK_SET_NOTE;
-
- procedure TASK_WAKE_WHEN (
- TIME_BUFFER : in RTEMS.TIME_OF_DAY;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TASK_WAKE_WHEN;
-
- procedure TASK_WAKE_AFTER (
- TICKS : in RTEMS.INTERVAL;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TASK_WAKE_AFTER;
-
--- Interrupt Manager
-
- procedure INTERRUPT_CATCH (
- NEW_ISR_HANDLER : in RTEMS.ADDRESS;
- VECTOR : in RTEMS.VECTOR_NUMBER;
- OLD_ISR_HANDLER : out RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end INTERRUPT_CATCH;
-
--- Clock Manager
-
- procedure CLOCK_GET (
- OPTION : in RTEMS.CLOCK_GET_OPTIONS;
- TIME_BUFFER : in RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end CLOCK_GET;
-
- procedure CLOCK_SET (
- TIME_BUFFER : in RTEMS.TIME_OF_DAY;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end CLOCK_SET;
-
- procedure CLOCK_TICK (
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end CLOCK_TICK;
-
--- Timer Manager
-
- procedure TIMER_CREATE (
- NAME : in RTEMS.NAME;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TIMER_CREATE;
-
- procedure TIMER_DELETE (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TIMER_DELETE;
-
- procedure TIMER_IDENT (
- NAME : in RTEMS.NAME;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TIMER_IDENT;
-
- procedure TIMER_FIRE_AFTER (
- ID : in RTEMS.ID;
- TICKS : in RTEMS.INTERVAL;
- ROUTINE : in RTEMS.TIMER_SERVICE_ROUTINE;
- USER_DATA : in RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TIMER_FIRE_AFTER;
-
- procedure TIMER_FIRE_WHEN (
- ID : in RTEMS.ID;
- WALL_TIME : in RTEMS.TIME_OF_DAY;
- ROUTINE : in RTEMS.TIMER_SERVICE_ROUTINE;
- USER_DATA : in RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TIMER_FIRE_WHEN;
-
- procedure TIMER_RESET (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TIMER_RESET;
-
- procedure TIMER_CANCEL (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end TIMER_CANCEL;
-
--- Semaphore Manager
-
- procedure SEMAPHORE_CREATE (
- NAME : in RTEMS.NAME;
- COUNT : in RTEMS.UNSIGNED32;
- ATTRIBUTE_SET : in RTEMS.ATTRIBUTE;
- PRIORITY_CEILING : in RTEMS.TASK_PRIORITY;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end SEMAPHORE_CREATE;
-
- procedure SEMAPHORE_DELETE (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end SEMAPHORE_DELETE;
-
- procedure SEMAPHORE_IDENT (
- NAME : in RTEMS.NAME;
- NODE : in RTEMS.UNSIGNED32;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end SEMAPHORE_IDENT;
-
- procedure SEMAPHORE_OBTAIN (
- ID : in RTEMS.ID;
- OPTION_SET : in RTEMS.OPTION;
- TIMEOUT : in RTEMS.INTERVAL;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end SEMAPHORE_OBTAIN;
-
- procedure SEMAPHORE_RELEASE (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end SEMAPHORE_RELEASE;
-
--- Message Queue Manager
-
- procedure MESSAGE_QUEUE_CREATE (
- Name : in RTEMS.Name;
- Count : in RTEMS.Unsigned32;
- Max_Message_Size : in RTEMS.Unsigned32;
- Attribute_Set : in RTEMS.Attribute;
- ID : out RTEMS.ID;
- Result : out RTEMS.Status_Codes
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end MESSAGE_QUEUE_CREATE;
-
- procedure MESSAGE_QUEUE_IDENT (
- NAME : in RTEMS.NAME;
- NODE : in RTEMS.UNSIGNED32;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end MESSAGE_QUEUE_IDENT;
-
- procedure MESSAGE_QUEUE_DELETE (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end MESSAGE_QUEUE_DELETE;
-
- procedure MESSAGE_QUEUE_SEND (
- ID : in RTEMS.ID;
- BUFFER : in RTEMS.ADDRESS;
- Size : in RTEMS.Unsigned32;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end MESSAGE_QUEUE_SEND;
-
- procedure MESSAGE_QUEUE_URGENT (
- ID : in RTEMS.ID;
- BUFFER : in RTEMS.ADDRESS;
- Size : in RTEMS.Unsigned32;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end MESSAGE_QUEUE_URGENT;
-
- procedure MESSAGE_QUEUE_BROADCAST (
- ID : in RTEMS.ID;
- BUFFER : in RTEMS.ADDRESS;
- Size : in RTEMS.Unsigned32;
- COUNT : out RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end MESSAGE_QUEUE_BROADCAST;
-
- procedure MESSAGE_QUEUE_RECEIVE (
- ID : in RTEMS.ID;
- BUFFER : in RTEMS.ADDRESS;
- OPTION_SET : in RTEMS.OPTION;
- TIMEOUT : in RTEMS.INTERVAL;
- Size : out RTEMS.Unsigned32;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end MESSAGE_QUEUE_RECEIVE;
-
- procedure MESSAGE_QUEUE_FLUSH (
- ID : in RTEMS.ID;
- COUNT : out RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end MESSAGE_QUEUE_FLUSH;
-
--- Event Manager
-
- procedure EVENT_SEND (
- ID : in RTEMS.ID;
- EVENT_IN : in RTEMS.EVENT_SET;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end EVENT_SEND;
-
- procedure EVENT_RECEIVE (
- EVENT_IN : in RTEMS.EVENT_SET;
- OPTION_SET : in RTEMS.OPTION;
- TICKS : in RTEMS.INTERVAL;
- EVENT_OUT : out RTEMS.EVENT_SET;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end EVENT_RECEIVE;
-
--- Signal Manager
-
- procedure SIGNAL_CATCH (
- ASR_HANDLER : in RTEMS.ASR_HANDLER;
- MODE_SET : in RTEMS.MODE;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end SIGNAL_CATCH;
-
- procedure SIGNAL_SEND (
- ID : in RTEMS.ID;
- SIGNAL_SET : in RTEMS.SIGNAL_SET;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end SIGNAL_SEND;
-
--- Partition Manager
-
- procedure PARTITION_CREATE (
- NAME : in RTEMS.NAME;
- STARTING_ADDRESS : in RTEMS.ADDRESS;
- LENGTH : in RTEMS.UNSIGNED32;
- BUFFER_SIZE : in RTEMS.UNSIGNED32;
- ATTRIBUTE_SET : in RTEMS.ATTRIBUTE;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end PARTITION_CREATE;
-
- procedure PARTITION_IDENT (
- NAME : in RTEMS.NAME;
- NODE : in RTEMS.UNSIGNED32;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end PARTITION_IDENT;
-
- procedure PARTITION_DELETE (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end PARTITION_DELETE;
-
- procedure PARTITION_GET_BUFFER (
- ID : in RTEMS.ID;
- BUFFER : out RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end PARTITION_GET_BUFFER;
-
- procedure PARTITION_RETURN_BUFFER (
- ID : in RTEMS.ID;
- BUFFER : in RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end PARTITION_RETURN_BUFFER;
-
--- Region Manager
-
- procedure REGION_CREATE (
- NAME : in RTEMS.NAME;
- STARTING_ADDRESS : in RTEMS.ADDRESS;
- LENGTH : in RTEMS.UNSIGNED32;
- PAGE_SIZE : in RTEMS.UNSIGNED32;
- ATTRIBUTE_SET : in RTEMS.ATTRIBUTE;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end REGION_CREATE;
-
- procedure REGION_IDENT (
- NAME : in RTEMS.NAME;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end REGION_IDENT;
-
- procedure REGION_DELETE (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end REGION_DELETE;
-
- procedure REGION_GET_SEGMENT (
- ID : in RTEMS.ID;
- SIZE : in RTEMS.UNSIGNED32;
- OPTION_SET : in RTEMS.OPTION;
- TIMEOUT : in RTEMS.INTERVAL;
- SEGMENT : out RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end REGION_GET_SEGMENT;
-
- procedure REGION_RETURN_SEGMENT (
- ID : in RTEMS.ID;
- SEGMENT : in RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end REGION_RETURN_SEGMENT;
-
--- Dual Ported Memory Manager
-
- procedure PORT_CREATE (
- NAME : in RTEMS.NAME;
- INTERNAL_START : in RTEMS.ADDRESS;
- EXTERNAL_START : in RTEMS.ADDRESS;
- LENGTH : in RTEMS.UNSIGNED32;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end PORT_CREATE;
-
- procedure PORT_IDENT (
- NAME : in RTEMS.NAME;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end PORT_IDENT;
-
- procedure PORT_DELETE (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end PORT_DELETE;
-
- procedure PORT_EXTERNAL_TO_INTERNAL (
- ID : in RTEMS.ID;
- EXTERNAL : in RTEMS.ADDRESS;
- INTERNAL : out RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end PORT_EXTERNAL_TO_INTERNAL;
-
- procedure PORT_INTERNAL_TO_EXTERNAL (
- ID : in RTEMS.ID;
- INTERNAL : in RTEMS.ADDRESS;
- EXTERNAL : out RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- 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;
- RETURN_VALUE : out RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end IO_INITIALIZE;
-
- procedure IO_OPEN (
- MAJOR : in RTEMS.DEVICE_MAJOR_NUMBER;
- MINOR : in RTEMS.DEVICE_MINOR_NUMBER;
- ARGUMENT : in RTEMS.ADDRESS;
- RETURN_VALUE : out RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end IO_OPEN;
-
- procedure IO_CLOSE (
- MAJOR : in RTEMS.DEVICE_MAJOR_NUMBER;
- MINOR : in RTEMS.DEVICE_MINOR_NUMBER;
- ARGUMENT : in RTEMS.ADDRESS;
- RETURN_VALUE : out RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end IO_CLOSE;
-
- procedure IO_READ (
- MAJOR : in RTEMS.DEVICE_MAJOR_NUMBER;
- MINOR : in RTEMS.DEVICE_MINOR_NUMBER;
- ARGUMENT : in RTEMS.ADDRESS;
- RETURN_VALUE : out RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end IO_READ;
-
- procedure IO_WRITE (
- MAJOR : in RTEMS.DEVICE_MAJOR_NUMBER;
- MINOR : in RTEMS.DEVICE_MINOR_NUMBER;
- ARGUMENT : in RTEMS.ADDRESS;
- RETURN_VALUE : out RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end IO_WRITE;
-
- procedure IO_CONTROL (
- MAJOR : in RTEMS.DEVICE_MAJOR_NUMBER;
- MINOR : in RTEMS.DEVICE_MINOR_NUMBER;
- ARGUMENT : in RTEMS.ADDRESS;
- RETURN_VALUE : out RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end IO_CONTROL;
-
--- Fatal Error Manager
-
- procedure FATAL_ERROR_OCCURRED (
- THE_ERROR : in RTEMS.UNSIGNED32
- ) is
- begin
-
- NULL;
-
- end FATAL_ERROR_OCCURRED;
-
--- Rate Monotonic Manager
-
- procedure RATE_MONOTONIC_CREATE (
- NAME : in RTEMS.NAME;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end RATE_MONOTONIC_CREATE;
-
- procedure RATE_MONOTONIC_IDENT (
- NAME : in RTEMS.NAME;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end RATE_MONOTONIC_IDENT;
-
- procedure RATE_MONOTONIC_DELETE (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end RATE_MONOTONIC_DELETE;
-
- procedure RATE_MONOTONIC_CANCEL (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end RATE_MONOTONIC_CANCEL;
-
- procedure RATE_MONOTONIC_PERIOD (
- ID : in RTEMS.ID;
- LENGTH : in RTEMS.INTERVAL;
- RESULT : out RTEMS.STATUS_CODES
- ) is
- begin
-
- RESULT := RTEMS.SUCCESSFUL;
-
- end RATE_MONOTONIC_PERIOD;
-
--- Multiprocessing Manager
-
- procedure MULTIPROCESSING_ANNOUNCE
- is
- begin
-
- NULL;
-
- end MULTIPROCESSING_ANNOUNCE;
-
-end DUMMY_RTEMS;
diff --git a/c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.ads b/c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.ads
deleted file mode 100644
index ccad73c0ef..0000000000
--- a/c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.ads
+++ /dev/null
@@ -1,521 +0,0 @@
---
--- DUMMY_RTEMS / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package contains specifications for stub routines
--- which are used to time the invocation overhead incurred
--- with an Ada application program invokes each RTEMS directive.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-
-package DUMMY_RTEMS is
-
--- Initialization Manager
-
- procedure INITIALIZE_EXECUTIVE (
- CONFIGURATION_TABLE : in RTEMS.CONFIGURATION_TABLE_POINTER;
- CPU_TABLE : in RTEMS.CPU_TABLE_POINTER
- );
-
- 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 RTEMS.UNSIGNED32;
- INITIAL_MODES : in RTEMS.MODE;
- ATTRIBUTE_SET : in RTEMS.ATTRIBUTE;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure TASK_IDENT (
- NAME : in RTEMS.NAME;
- NODE : in RTEMS.UNSIGNED32;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure TASK_START (
- ID : in RTEMS.ID;
- ENTRY_POINT : in RTEMS.TASK_ENTRY;
- ARGUMENT : in RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure TASK_RESTART (
- ID : in RTEMS.ID;
- ARGUMENT : in RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure TASK_DELETE (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure TASK_SUSPEND (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure TASK_RESUME (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure TASK_SET_PRIORITY (
- ID : in RTEMS.ID;
- NEW_PRIORITY : in RTEMS.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
- );
-
--- 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
- );
-
--- Timer Manager
-
- procedure TIMER_CREATE (
- NAME : in RTEMS.NAME;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure TIMER_DELETE (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure TIMER_IDENT (
- NAME : in RTEMS.NAME;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure TIMER_FIRE_AFTER (
- ID : in RTEMS.ID;
- TICKS : in RTEMS.INTERVAL;
- ROUTINE : in RTEMS.TIMER_SERVICE_ROUTINE;
- USER_DATA : in RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure TIMER_FIRE_WHEN (
- ID : in RTEMS.ID;
- WALL_TIME : in RTEMS.TIME_OF_DAY;
- ROUTINE : in RTEMS.TIMER_SERVICE_ROUTINE;
- USER_DATA : in RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure TIMER_RESET (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure TIMER_CANCEL (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
--- Semaphore Manager
-
- procedure SEMAPHORE_CREATE (
- NAME : in RTEMS.NAME;
- COUNT : in RTEMS.UNSIGNED32;
- ATTRIBUTE_SET : in RTEMS.ATTRIBUTE;
- PRIORITY_CEILING : in RTEMS.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_GET_SEGMENT (
- ID : in RTEMS.ID;
- SIZE : in RTEMS.UNSIGNED32;
- OPTION_SET : in RTEMS.OPTION;
- TIMEOUT : in RTEMS.INTERVAL;
- SEGMENT : out RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure REGION_RETURN_SEGMENT (
- ID : in RTEMS.ID;
- SEGMENT : in RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- );
-
--- Dual Ported Memory Manager
-
- procedure PORT_CREATE (
- NAME : in RTEMS.NAME;
- INTERNAL_START : in RTEMS.ADDRESS;
- EXTERNAL_START : in RTEMS.ADDRESS;
- LENGTH : in RTEMS.UNSIGNED32;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure PORT_IDENT (
- NAME : in RTEMS.NAME;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure PORT_DELETE (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure PORT_EXTERNAL_TO_INTERNAL (
- ID : in RTEMS.ID;
- EXTERNAL : in RTEMS.ADDRESS;
- INTERNAL : out RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure PORT_INTERNAL_TO_EXTERNAL (
- ID : in RTEMS.ID;
- INTERNAL : in RTEMS.ADDRESS;
- EXTERNAL : out RTEMS.ADDRESS;
- RESULT : out RTEMS.STATUS_CODES
- );
-
--- Input/Output Manager
-
- procedure IO_INITIALIZE (
- MAJOR : in RTEMS.DEVICE_MAJOR_NUMBER;
- MINOR : in RTEMS.DEVICE_MINOR_NUMBER;
- ARGUMENT : in RTEMS.ADDRESS;
- RETURN_VALUE : out RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure IO_OPEN (
- MAJOR : in RTEMS.DEVICE_MAJOR_NUMBER;
- MINOR : in RTEMS.DEVICE_MINOR_NUMBER;
- ARGUMENT : in RTEMS.ADDRESS;
- RETURN_VALUE : out RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure IO_CLOSE (
- MAJOR : in RTEMS.DEVICE_MAJOR_NUMBER;
- MINOR : in RTEMS.DEVICE_MINOR_NUMBER;
- ARGUMENT : in RTEMS.ADDRESS;
- RETURN_VALUE : out RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure IO_READ (
- MAJOR : in RTEMS.DEVICE_MAJOR_NUMBER;
- MINOR : in RTEMS.DEVICE_MINOR_NUMBER;
- ARGUMENT : in RTEMS.ADDRESS;
- RETURN_VALUE : out RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure IO_WRITE (
- MAJOR : in RTEMS.DEVICE_MAJOR_NUMBER;
- MINOR : in RTEMS.DEVICE_MINOR_NUMBER;
- ARGUMENT : in RTEMS.ADDRESS;
- RETURN_VALUE : out RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure IO_CONTROL (
- MAJOR : in RTEMS.DEVICE_MAJOR_NUMBER;
- MINOR : in RTEMS.DEVICE_MINOR_NUMBER;
- ARGUMENT : in RTEMS.ADDRESS;
- RETURN_VALUE : out RTEMS.UNSIGNED32;
- RESULT : out RTEMS.STATUS_CODES
- );
-
--- Fatal Error Manager
-
- procedure FATAL_ERROR_OCCURRED (
- THE_ERROR : in RTEMS.UNSIGNED32
- );
-
--- Rate Monotonic Manager
-
- procedure RATE_MONOTONIC_CREATE (
- NAME : in RTEMS.NAME;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure RATE_MONOTONIC_IDENT (
- NAME : in RTEMS.NAME;
- ID : out RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure RATE_MONOTONIC_DELETE (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure RATE_MONOTONIC_CANCEL (
- ID : in RTEMS.ID;
- RESULT : out RTEMS.STATUS_CODES
- );
-
- procedure RATE_MONOTONIC_PERIOD (
- ID : in RTEMS.ID;
- LENGTH : in RTEMS.INTERVAL;
- RESULT : out RTEMS.STATUS_CODES
- );
-
--- Multiprocessing Manager
-
- procedure MULTIPROCESSING_ANNOUNCE;
-
-end DUMMY_RTEMS;
diff --git a/c/src/ada-tests/tmtests/tmoverhd/tmoverhd.adb b/c/src/ada-tests/tmtests/tmoverhd/tmoverhd.adb
deleted file mode 100644
index 50066a949c..0000000000
--- a/c/src/ada-tests/tmtests/tmoverhd/tmoverhd.adb
+++ /dev/null
@@ -1,57 +0,0 @@
---
--- MAIN / BODY
---
--- DESCRIPTION:
---
--- This is the entry point for Test TMOVERHD of the Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with TMTEST;
-with TEST_SUPPORT;
-
-procedure TMOVERHD is
- INIT_ID : RTEMS.ID;
- STATUS : RTEMS.STATUS_CODES;
-begin
-
- RTEMS.TASK_CREATE(
- RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
- 1,
- RTEMS.MINIMUM_STACK_SIZE,
- RTEMS.NO_PREEMPT,
- RTEMS.DEFAULT_ATTRIBUTES,
- INIT_ID,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
-
-
- RTEMS.TASK_START(
- INIT_ID,
- TMTEST.INIT'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
-
- loop
- delay 120.0;
- end loop;
-
-end TMOVERHD;
-
diff --git a/c/src/ada-tests/tmtests/tmoverhd/tmtest.adb b/c/src/ada-tests/tmtests/tmoverhd/tmtest.adb
deleted file mode 100644
index 2faf4bb226..0000000000
--- a/c/src/ada-tests/tmtests/tmoverhd/tmtest.adb
+++ /dev/null
@@ -1,1564 +0,0 @@
---
--- TMTEST / BODY
---
--- DESCRIPTION:
---
--- This package is the implementation of Calling Overhead Test of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 DUMMY_RTEMS;
-with INTERFACES; use INTERFACES;
-with RTEMS;
-with TEST_SUPPORT;
-with TEXT_IO;
-with TIME_TEST_SUPPORT;
-with UNSIGNED32_IO;
-
-package body TMTEST is
-
---PAGE
---
--- INIT
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- TEXT_IO.NEW_LINE( 2 );
- TEXT_IO.PUT_LINE( "*** TIME TEST OVERHEAD ***" );
-
- TIMER_DRIVER.SET_FIND_AVERAGE_OVERHEAD( TRUE );
-
- TMTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
-
- RTEMS.TASK_CREATE(
- TMTEST.TASK_NAME( 1 ),
- 254,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- TMTEST.TASK_ID( 1 ),
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
-
- RTEMS.TASK_START(
- TMTEST.TASK_ID( 1 ),
- TMTEST.TASK_1'ACCESS,
- 0,
- STATUS
- );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
-
- RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
-
- end INIT;
-
---PAGE
---
--- TIMER_HANDLER
---
-
- procedure TIMER_HANDLER (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- ) is
- begin
-
- NULL;
-
- end TIMER_HANDLER;
-
---PAGE
---
--- ISR_HANDLER
---
-
- procedure ISR_HANDLER (
- VECTOR : in RTEMS.VECTOR_NUMBER
- ) is
- begin
-
- NULL;
-
- end ISR_HANDLER;
-
---PAGE
---
--- ASR_HANDLER
---
-
- procedure ASR_HANDLER (
- SIGNALS : in RTEMS.SIGNAL_SET
- ) is
- begin
-
- NULL;
-
- end ASR_HANDLER;
-
---PAGE
---
--- TASK_1
---
-
- CPU_TABLE : aliased RTEMS.CPU_TABLE;
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- ) is
- NAME : RTEMS.NAME;
- INDEX : RTEMS.UNSIGNED32;
- OVERHEAD : RTEMS.UNSIGNED32;
- ID : RTEMS.ID;
- IN_PRIORITY : RTEMS.TASK_PRIORITY;
- OUT_PRIORITY : RTEMS.TASK_PRIORITY;
- IN_MODE : RTEMS.MODE;
- MASK : RTEMS.MODE;
- OUT_MODE : RTEMS.MODE;
- NOTE : RTEMS.UNSIGNED32;
- TIME : RTEMS.TIME_OF_DAY;
- TIMEOUT : RTEMS.INTERVAL;
- SIGNALS : RTEMS.SIGNAL_SET;
- ADDRESS_1 : RTEMS.ADDRESS;
- EVENTS : RTEMS.SIGNAL_SET;
- BUFFER : TMTEST.BUFFER;
- BUFFER_POINTER : RTEMS.ADDRESS;
- MESSAGE_SIZE : RTEMS.UNSIGNED32;
- COUNT : RTEMS.UNSIGNED32;
- MAJOR : RTEMS.DEVICE_MAJOR_NUMBER;
- MINOR : RTEMS.DEVICE_MINOR_NUMBER;
- IO_RESULT : RTEMS.UNSIGNED32;
- ERROR : RTEMS.UNSIGNED32;
- STATUS : RTEMS.STATUS_CODES;
- begin
-
- NAME := RTEMS.BUILD_NAME( 'N', 'A', 'M', 'E' );
-
- BUFFER_POINTER := BUFFER'ADDRESS;
-
--- INITIALIZE_EXECUTIVE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.INITIALIZE_EXECUTIVE(
- RTEMS.CONFIGURATION,
- CPU_TABLE'ACCESS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "INITIALIZE_EXECUTIVE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- SHUTDOWN_EXECUTIVE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.SHUTDOWN_EXECUTIVE( ERROR );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SHUTDOWN_EXECUTIVE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TASK_CREATE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TASK_CREATE(
- NAME,
- IN_PRIORITY,
- 2048,
- RTEMS.DEFAULT_MODES,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_CREATE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TASK_IDENT
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TASK_IDENT(
- NAME,
- RTEMS.SEARCH_ALL_NODES,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TASK_START
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TASK_START( ID, TMTEST.TASK_1'ACCESS, 0, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_START",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TASK_RESTART
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TASK_RESTART( ID, 0, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_RESTART",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TASK_DELETE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TASK_DELETE( ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_DELETE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TASK_SUSPEND
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TASK_SUSPEND( ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_SUSPEND",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TASK_RESUME
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TASK_RESUME( ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_RESUME",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TASK_SET_PRIORITY
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TASK_SET_PRIORITY(
- ID,
- IN_PRIORITY,
- OUT_PRIORITY,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_SET_PRIORITY",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TASK_MODE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TASK_MODE(
- IN_MODE,
- MASK,
- OUT_MODE,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_MODE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TASK_GET_NOTE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TASK_GET_NOTE( ID, 1, NOTE, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_GET_NOTE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TASK_SET_NOTE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TASK_SET_NOTE( ID, 1, NOTE, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_SET_NOTE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TASK_WAKE_WHEN
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TASK_WAKE_WHEN( TIME, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_WAKE_WHEN",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TASK_WAKE_AFTER
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TASK_WAKE_AFTER( TIMEOUT, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TASK_WAKE_AFTER",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- INTERRUPT_CATCH
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.INTERRUPT_CATCH(
- TMTEST.ISR_HANDLER'ADDRESS,
- RTEMS.VECTOR_NUMBER'FIRST,
- ADDRESS_1,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "INTERRUPT_CATCH",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- CLOCK_GET
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "CLOCK_GET",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- CLOCK_SET
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.CLOCK_SET( TIME, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "CLOCK_SET",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- CLOCK_TICK
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.CLOCK_TICK( STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "CLOCK_TICK",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
-TEST_SUPPORT.PAUSE;
-
--- TIMER_CREATE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TIMER_CREATE( NAME, ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_CREATE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TIMER_DELETE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TIMER_DELETE( ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_DELETE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TIMER_IDENT
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TIMER_IDENT(
- NAME,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TIMER_FIRE_AFTER
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TIMER_FIRE_AFTER(
- ID,
- TIMEOUT,
- TMTEST.TIMER_HANDLER'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_FIRE_AFTER",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TIMER_FIRE_WHEN
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TIMER_FIRE_WHEN(
- ID,
- TIME,
- TMTEST.TIMER_HANDLER'ACCESS,
- RTEMS.NULL_ADDRESS,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_FIRE_WHEN",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TIMER_RESET
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TIMER_RESET( ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_RESET",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- TIMER_CANCEL
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.TIMER_CANCEL( ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "TIMER_CANCEL",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- SEMAPHORE_CREATE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.SEMAPHORE_CREATE(
- NAME,
- 128,
- RTEMS.DEFAULT_ATTRIBUTES,
- RTEMS.NO_PRIORITY,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SEMAPHORE_CREATE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- SEMAPHORE_DELETE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.SEMAPHORE_DELETE( ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SEMAPHORE_DELETE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- SEMAPHORE_IDENT
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.SEMAPHORE_IDENT(
- NAME,
- RTEMS.SEARCH_ALL_NODES,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SEMAPHORE_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- SEMAPHORE_OBTAIN
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.SEMAPHORE_OBTAIN(
- ID,
- RTEMS.DEFAULT_OPTIONS,
- TIMEOUT,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SEMAPHORE_OBTAIN",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- SEMAPHORE_RELEASE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.SEMAPHORE_RELEASE( ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SEMAPHORE_RELEASE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- MESSAGE_QUEUE_CREATE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.MESSAGE_QUEUE_CREATE(
- NAME,
- 128,
- 16,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_CREATE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- MESSAGE_QUEUE_IDENT
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.MESSAGE_QUEUE_IDENT(
- NAME,
- RTEMS.SEARCH_ALL_NODES,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- MESSAGE_QUEUE_DELETE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.MESSAGE_QUEUE_DELETE( ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_DELETE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- MESSAGE_QUEUE_SEND
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.MESSAGE_QUEUE_SEND( ID, BUFFER_POINTER, 16, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_SEND",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- MESSAGE_QUEUE_URGENT
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.MESSAGE_QUEUE_URGENT( ID, BUFFER_POINTER, 16, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_URGENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- MESSAGE_QUEUE_BROADCAST
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.MESSAGE_QUEUE_BROADCAST(
- ID,
- BUFFER_POINTER,
- 16,
- COUNT,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_BROADCAST",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- MESSAGE_QUEUE_RECEIVE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.MESSAGE_QUEUE_RECEIVE(
- ID,
- BUFFER_POINTER,
- RTEMS.DEFAULT_OPTIONS,
- TIMEOUT,
- MESSAGE_SIZE,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_RECEIVE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- MESSAGE_QUEUE_FLUSH
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.MESSAGE_QUEUE_FLUSH( ID, COUNT, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MESSAGE_QUEUE_FLUSH",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
-TEST_SUPPORT.PAUSE;
-
--- EVENT_SEND
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.EVENT_SEND( ID, EVENTS, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "EVENT_SEND",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- EVENT_RECEIVE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.EVENT_RECEIVE(
- RTEMS.EVENT_16,
- EVENTS,
- RTEMS.DEFAULT_OPTIONS,
- TIMEOUT,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "EVENT_RECEIVE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- SIGNAL_CATCH
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.SIGNAL_CATCH(
- TMTEST.ASR_HANDLER'ACCESS,
- RTEMS.DEFAULT_MODES,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SIGNAL_CATCH",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- SIGNAL_SEND
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.SIGNAL_SEND( ID, SIGNALS, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "SIGNAL_SEND",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- PARTITION_CREATE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.PARTITION_CREATE(
- NAME,
- TMTEST.MEMORY_AREA'ADDRESS,
- 2048,
- 128,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PARTITION_CREATE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- PARTITION_IDENT
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.PARTITION_IDENT(
- NAME,
- RTEMS.SEARCH_ALL_NODES,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PARTITION_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- PARTITION_DELETE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.PARTITION_DELETE( ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PARTITION_DELETE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- PARTITION_GET_BUFFER
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.PARTITION_GET_BUFFER( ID, ADDRESS_1, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PARTITION_GET_BUFFER",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- PARTITION_RETURN_BUFFER
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.PARTITION_RETURN_BUFFER( ID, ADDRESS_1, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PARTITION_RETURN_BUFFER",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- REGION_CREATE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.REGION_CREATE(
- NAME,
- TMTEST.MEMORY_AREA'ADDRESS,
- 2048,
- 128,
- RTEMS.DEFAULT_ATTRIBUTES,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "REGION_CREATE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- REGION_IDENT
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.REGION_IDENT(
- NAME,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "REGION_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- REGION_DELETE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.REGION_DELETE( ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "REGION_DELETE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- REGION_GET_SEGMENT
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.REGION_GET_SEGMENT(
- ID,
- 243,
- RTEMS.DEFAULT_OPTIONS,
- TIMEOUT,
- ADDRESS_1,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "REGION_GET_SEGMENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- REGION_RETURN_SEGMENT
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.REGION_RETURN_SEGMENT( ID, ADDRESS_1, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "REGION_RETURN_SEGMENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- PORT_CREATE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.PORT_CREATE(
- NAME,
- TMTEST.INTERNAL_PORT_AREA'ADDRESS,
- TMTEST.EXTERNAL_PORT_AREA'ADDRESS,
- TMTEST.INTERNAL_PORT_AREA'LENGTH,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PORT_CREATE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- PORT_IDENT
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.PORT_IDENT( NAME, ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PORT_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- PORT_DELETE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.PORT_DELETE( ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PORT_DELETE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- PORT_EXTERNAL_TO_INTERNAL
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.PORT_EXTERNAL_TO_INTERNAL(
- ID,
- TMTEST.EXTERNAL_PORT_AREA( 7 )'ADDRESS,
- ADDRESS_1,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PORT_EXTERNAL_TO_INTERNAL",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- PORT_INTERNAL_TO_EXTERNAL
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.PORT_INTERNAL_TO_EXTERNAL(
- ID,
- TMTEST.INTERNAL_PORT_AREA( 7 )'ADDRESS,
- ADDRESS_1,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "PORT_INTERNAL_TO_EXTERNAL",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
-TEST_SUPPORT.PAUSE;
-
--- IO_INITIALIZE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.IO_INITIALIZE(
- MAJOR,
- MINOR,
- ADDRESS_1,
- IO_RESULT,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "IO_INITIALIZE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- IO_OPEN
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.IO_OPEN(
- MAJOR,
- MINOR,
- ADDRESS_1,
- IO_RESULT,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "IO_OPEN",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- IO_CLOSE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.IO_CLOSE(
- MAJOR,
- MINOR,
- ADDRESS_1,
- IO_RESULT,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "IO_CLOSE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- IO_READ
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.IO_READ(
- MAJOR,
- MINOR,
- ADDRESS_1,
- IO_RESULT,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "IO_READ",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- IO_WRITE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.IO_WRITE(
- MAJOR,
- MINOR,
- ADDRESS_1,
- IO_RESULT,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "IO_WRITE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- IO_CONTROL
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.IO_CONTROL(
- MAJOR,
- MINOR,
- ADDRESS_1,
- IO_RESULT,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "IO_CONTROL",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- FATAL_ERROR_OCCURRED
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.FATAL_ERROR_OCCURRED( ERROR );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "FATAL_ERROR_OCCURRED",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- RATE_MONOTONIC_CREATE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.RATE_MONOTONIC_CREATE( NAME, ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "RATE_MONOTONIC_CREATE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- RATE_MONOTONIC_IDENT
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.RATE_MONOTONIC_IDENT(
- NAME,
- ID,
- STATUS
- );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "RATE_MONOTONIC_IDENT",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- RATE_MONOTONIC_DELETE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.RATE_MONOTONIC_DELETE( ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "RATE_MONOTONIC_DELETE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- RATE_MONOTONIC_CANCEL
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.RATE_MONOTONIC_CANCEL( ID, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "RATE_MONOTONIC_CANCEL",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- RATE_MONOTONIC_PERIOD
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.RATE_MONOTONIC_PERIOD( ID, TIMEOUT, STATUS );
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "RATE_MONOTONIC_PERIOD",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
--- MULTIPROCESSING_ANNOUNCE
-
- TIMER_DRIVER.INITIALIZE;
- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
- loop
- DUMMY_RTEMS.MULTIPROCESSING_ANNOUNCE;
- end loop;
- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
-
- TIME_TEST_SUPPORT.PUT_TIME(
- "MULTIPROCESSING_ANNOUNCE",
- TMTEST.END_TIME,
- TIME_TEST_SUPPORT.OPERATION_COUNT,
- OVERHEAD,
- 0
- );
-
- RTEMS.SHUTDOWN_EXECUTIVE( 0 );
-
- end TASK_1;
-
-end TMTEST;
diff --git a/c/src/ada-tests/tmtests/tmoverhd/tmtest.ads b/c/src/ada-tests/tmtests/tmoverhd/tmtest.ads
deleted file mode 100644
index 52b4da559d..0000000000
--- a/c/src/ada-tests/tmtests/tmoverhd/tmtest.ads
+++ /dev/null
@@ -1,155 +0,0 @@
---
--- TMTEST / SPECIFICATION
---
--- DESCRIPTION:
---
--- This package is the specification for Calling Overhead Test of the RTEMS
--- Timing Test Suite.
---
--- DEPENDENCIES:
---
---
---
--- COPYRIGHT (c) 1989-1997.
--- On-Line Applications Research Corporation (OAR).
--- Copyright assigned to U.S. Government, 1994.
---
--- 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 RTEMS;
-with SYSTEM;
-with TIMER_DRIVER;
-with System.Storage_Elements;
-
-package TMTEST is
-
---
--- Buffer Record similar to that used by RTEMS 3.2.1. Using this
--- avoids changes to the test.
---
-
- type BUFFER is
- record
- FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH
- FIELD2 : RTEMS.UNSIGNED32;
- FIELD3 : RTEMS.UNSIGNED32;
- FIELD4 : RTEMS.UNSIGNED32;
- end record;
-
---
--- These arrays contain the IDs and NAMEs of all RTEMS tasks created
--- by this test.
---
-
- TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
- TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
-
---
--- The following variable is set to the execution time returned
--- by the timer.
---
-
- END_TIME : RTEMS.UNSIGNED32;
-
---
--- The following area defines a memory area to be used as the
--- internal address space of the port.
---
-
- INTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
- System.Storage_Elements.To_Address(16#00001000#);
-
- INTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for INTERNAL_PORT_AREA use at INTERNAL_PORT_AREA_ADDRESS;
-
---
--- The following area defines a memory area to be used as the
--- external address space of the port.
---
-
- EXTERNAL_PORT_AREA_ADDRESS : constant System.Address :=
- System.Storage_Elements.To_Address(16#00002000#);
-
- EXTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 )
- of RTEMS.UNSIGNED8;
- for EXTERNAL_PORT_AREA use at EXTERNAL_PORT_AREA_ADDRESS;
-
-
---
--- The following area defines a memory area to be used as the
--- memory space for a partition and later for a region.
---
-
- MEMORY_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 ) of RTEMS.UNSIGNED8;
- for MEMORY_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
-
---
--- INIT
---
--- DESCRIPTION:
---
--- This RTEMS task initializes the application.
---
-
- procedure INIT (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
---
--- TIMER_HANDLER
---
--- DESCRIPTION:
---
--- This subprogram is a timer service routine.
---
-
- procedure TIMER_HANDLER (
- IGNORED_ID : in RTEMS.ID;
- IGNORED_ADDRESS : in RTEMS.ADDRESS
- );
-
---
--- ISR_HANDLER
---
--- DESCRIPTION:
---
--- This subprogram is an interrupt service routine.
---
-
- procedure ISR_HANDLER (
- VECTOR : in RTEMS.VECTOR_NUMBER
- );
-
---
--- ASR_HANDLER
---
--- DESCRIPTION:
---
--- This subprogram is an asynchronous signal routine.
---
-
- procedure ASR_HANDLER (
- SIGNALS : in RTEMS.SIGNAL_SET
- );
-
---
--- TASK_1
---
--- DESCRIPTION:
---
--- This RTEMS task is responsible for measuring and
--- reporting the calling overhead for all RTEMS
--- directives.
---
-
- procedure TASK_1 (
- ARGUMENT : in RTEMS.TASK_ARGUMENT
- );
-
-end TMTEST;
diff --git a/c/src/ada/rtems.adb b/c/src/ada/rtems.adb
deleted file mode 100644
index 9bd7432be1..0000000000
--- a/c/src/ada/rtems.adb
+++ /dev/null
@@ -1,2035 +0,0 @@
---
--- RTEMS / Body
--- 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 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;
-
- -- XXX
- function Interrupt_Disable
- return RTEMS.ISR_Level is
- begin
- return 0;
- end Interrupt_Disable;
-
- procedure Interrupt_Enable (
- Level : in RTEMS.ISR_Level
- ) is
- begin
- Null;
- end Interrupt_Enable;
-
- procedure Interrupt_Flash (
- Level : in RTEMS.ISR_Level
- ) is
- begin
- Null;
- end Interrupt_Flash;
-
- function Interrupt_Is_In_Progress
- return RTEMS.Boolean is
- begin
- return RTEMS.From_Ada_Boolean (Standard.True);
- end 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
- ) 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_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 (
- ID : RTEMS.ID;
- Wall_Time : in RTEMS.Time_Of_Day;
- Routine : RTEMS.Timer_Service_Routine;
- User_Data : RTEMS.Address
- ) return RTEMS.Status_Codes;
- pragma Import (C, Timer_Fire_When, "rtems_timer_fire_when");
- begin
-
- Result := Timer_Fire_When (
- ID,
- Wall_Time,
- Routine,
- User_Data
- );
-
- end Timer_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;
-
- --
- -- 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;
- Return_Value : out RTEMS.Unsigned32;
- Result : out RTEMS.Status_Codes
- ) is
- function IO_Initialize_Base (
- Major : RTEMS.Device_Major_Number;
- Minor : RTEMS.Device_Minor_Number;
- Argument : RTEMS.Address;
- Return_Value : access RTEMS.Unsigned32
- ) return RTEMS.Status_Codes;
- pragma Import (C, IO_Initialize_Base, "rtems_io_initialize");
- Return_Value_Base : aliased RTEMS.Unsigned32 := Return_Value;
- begin
-
- Result := IO_Initialize_Base (
- Major,
- Minor,
- Argument,
- Return_Value_Base'Unchecked_Access
- );
-
- Return_Value := Return_Value_Base;
-
- 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 : out RTEMS.Driver_Name_t;
- 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;
-
- --
- -- Multiprocessing Manager
- --
-
- procedure Multiprocessing_Announce is
- procedure Multiprocessing_Announce_Base;
- pragma Import (C, Multiprocessing_Announce_Base,
- "rtems_multiprocessing_announce");
- begin
-
- Multiprocessing_Announce_Base;
-
- end Multiprocessing_Announce;
-
-
- --
- -- 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 508f24046f..0000000000
--- a/c/src/ada/rtems.ads
+++ /dev/null
@@ -1,1430 +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
-
- 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;
-
- type Unsigned32_Pointer is access all RTEMS.Unsigned32;
- type Unsigned16_Pointer is access all RTEMS.Unsigned16;
- type Unsigned8_Pointer is access all RTEMS.Unsigned8;
-
- 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;
-
- --
- -- 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;
- 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;
- 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;
-
- procedure Interrupt_Enable (
- Level : in RTEMS.ISR_Level
- );
-
- procedure Interrupt_Flash (
- Level : in RTEMS.ISR_Level
- );
-
- function Interrupt_Is_In_Progress
- return RTEMS.Boolean;
-
- --
- -- 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_Fire_When (
- ID : in RTEMS.ID;
- Wall_Time : in RTEMS.Time_Of_Day;
- Routine : in RTEMS.Timer_Service_Routine;
- User_Data : in RTEMS.Address;
- Result : out RTEMS.Status_Codes
- );
-
- procedure Timer_Reset (
- ID : in RTEMS.ID;
- Result : out RTEMS.Status_Codes
- );
-
- procedure Timer_Cancel (
- ID : in RTEMS.ID;
- Result : out RTEMS.Status_Codes
- );
-
- --
- -- Semaphore Manager
- --
-
- procedure Semaphore_Create (
- Name : in RTEMS.Name;
- Count : in RTEMS.Unsigned32;
- Attribute_Set : in RTEMS.Attribute;
- Priority_Ceiling : in RTEMS.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;
- Return_Value : out RTEMS.Unsigned32;
- 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 : out RTEMS.Driver_Name_t;
- 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
- );
-
- --
- -- Multiprocessing Manager
- --
-
- procedure Multiprocessing_Announce;
-
-
- --
- -- 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");
-
-
-private
-end RTEMS;
diff --git a/c/src/exec/Makefile.in b/c/src/exec/Makefile.in
deleted file mode 100644
index 9622e6de78..0000000000
--- a/c/src/exec/Makefile.in
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-POSIX_DIRS_yes_V=posix
-POSIX_DIRS = $(POSIX_DIRS_$(RTEMS_HAS_POSIX_API)_V)
-
-SUB_DIRS=score rtems $(POSIX_DIRS) sapi wrapup
-
diff --git a/c/src/exec/libcsupport/include/chain.h b/c/src/exec/libcsupport/include/chain.h
deleted file mode 100644
index 98cf2b1a86..0000000000
--- a/c/src/exec/libcsupport/include/chain.h
+++ /dev/null
@@ -1,362 +0,0 @@
-/* chain.h
- *
- * This include file contains all the constants and structures associated
- * with doubly linked chains. This file actually just provides an
- * interface to the chain object in rtems.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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.
- *
- * $ld:
- */
-
-#ifndef __CHAIN_h
-#define __CHAIN_h
-
-#include <rtems.h>
-
-/*
- * Chain_Initialize
- *
- * This routine initializes the_chain structure to manage the
- * contiguous array of number_nodes nodes which starts at
- * starting_address. Each node is of node_size bytes.
- *
- * Chain_Control *the_chain, * IN *
- * void *starting_address, * IN *
- * rtems_unsigned32 number_nodes, * IN *
- * rtems_unsigned32 node_size * IN *
- */
-
-#define Chain_Initialize( the_chain, starting_address, \
- number_nodes, node_size ) \
- _Chain_Initialize( the_chain, starting_address, \
- number_nodes, node_size ) \
-
-
-/*
- * Chain_Initialize_empty
- *
- * This routine initializes the specified chain to contain zero nodes.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Initialize_empty( the_chain ) \
- _Chain_Initialize_empty( the_chain )
-
-
-/*
- * Chain_Are_nodes_equal
- *
- * This function returns TRUE if LEFT and RIGHT are equal,
- * and FALSE otherwise.
- *
- * Chain_Node *left, * IN *
- * Chain_Node *right * IN *
- */
-
-#define Chain_Are_nodes_equal( left, right ) \
- _Chain_Are_nodes_equal( left, right )
-
-
-/*
- * Chain_Extract_unprotected
- *
- * This routine extracts the_node from the chain on which it resides.
- * It does NOT disable interrupts to insure the atomicity of the
- * extract operation.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Extract_unprotected( the_node ) \
- _Chain_Extract_unprotected( the_node )
-
-
-/*
- * Chain_Extract
- *
- * This routine extracts the_node from the chain on which it resides.
- * It disables interrupts to insure the atomicity of the
- * extract operation.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Extract( the_node ) \
- _Chain_Extract( the_node )
-
-
-/*
- * Chain_Get_unprotected
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. If the_chain is empty, then NULL is returned.
- * It does NOT disable interrupts to insure the atomicity of the
- * get operation.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Get_unprotected( the_chain ) \
- _Chain_Get_unprotected( the_chain )
-
-
-/*
- * Chain_Get
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. If the_chain is empty, then NULL is returned.
- * It disables interrupts to insure the atomicity of the
- * get operation.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Get( the_chain ) \
- _Chain_Get( the_chain )
-
-
-/*
- * Chain_Get_first_unprotected
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. It does NOT disable interrupts to insure
- * the atomicity of the get operation.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Get_first_unprotected( the_chain ) \
- _Chain_Get_first_unprotected( the_chain )
-
-
-/*
- * Chain_Insert_unprotected
- *
- * This routine inserts the_node on a chain immediately following
- * after_node. It does NOT disable interrupts to insure the atomicity
- * of the extract operation.
- *
- * Chain_Node *after_node, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Insert_unprotected( after_node, the_node ) \
- _Chain_Insert_unprotected( after_node, the_node )
-
-
-/*
- * Chain_Insert
- *
- * This routine inserts the_node on a chain immediately following
- * after_node. It disables interrupts to insure the atomicity
- * of the extract operation.
- *
- * Chain_Node *after_node, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Insert( after_node, the_node ) \
- _Chain_Insert( after_node, the_node )
-
-
-/*
- * Chain_Append_unprotected
- *
- * This routine appends the_node onto the end of the_chain.
- * It does NOT disable interrupts to insure the atomicity of the
- * append operation.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Append_unprotected( the_chain, the_node ) \
- _Chain_Append_unprotected( the_chain, the_node )
-
-
-/*
- * Chain_Append
- *
- * This routine appends the_node onto the end of the_chain.
- * It disables interrupts to insure the atomicity of the
- * append operation.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Append( the_chain, the_node ) \
- _Chain_Append( the_chain, the_node )
-
-
-/*
- * Chain_Prepend_unprotected
- *
- * This routine prepends the_node onto the front of the_chain.
- * It does NOT disable interrupts to insure the atomicity of the
- * prepend operation.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Prepend_unprotected( the_chain, the_node ) \
- _Chain_Prepend_unprotected( the_chain, the_node )
-
-
-/*
- * Chain_Prepend
- *
- * This routine prepends the_node onto the front of the_chain.
- * It disables interrupts to insure the atomicity of the
- * prepend operation.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Prepend( the_chain, the_node ) \
- _Chain_Prepend( the_chain, the_node )
-
-
-/*
- * Chain_Head
- *
- * This function returns a pointer to the first node on the chain.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Head( the_chain ) \
- _Chain_Head( the_chain )
-
-
-/*
- * Chain_Tail
- *
- * This function returns a pointer to the last node on the chain.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Tail( the_chain ) \
- _Chain_Tail( the_chain )
-
-
-/*
- * Chain_Is_head
- *
- * This function returns TRUE if the_node is the head of the_chain and
- * FALSE otherwise.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_head( the_chain, the_node ) \
- _Chain_Is_head( the_chain, the_node )
-
-
-/*
- * Chain_Is_tail
- *
- * This function returns TRUE if the_node is the tail of the_chain and
- * FALSE otherwise.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_tail( the_chain, the_node ) \
- _Chain_Is_tail( the_chain, the_node )
-
-
-/*
- * Chain_Is_first
- *
- * This function returns TRUE if the_node is the first node on a chain and
- * FALSE otherwise.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_first( the_node ) \
- _Chain_Is_first( the_node )
-
-
-/*
- * Chain_Is_last
- *
- * This function returns TRUE if the_node is the last node on a chain and
- * FALSE otherwise.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_last( the_node ) \
- _Chain_Is_last( the_node )
-
-
-/*
- * Chain_Is_empty
- *
- * This function returns TRUE if there are no nodes on the_chain and
- * FALSE otherwise.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Is_empty( the_chain ) \
- _Chain_Is_empty( the_chain )
-
-
-/*
- * Chain_Has_only_one_node
- *
- * This function returns TRUE if there is only one node on the_chain and
- * FALSE otherwise.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Has_only_one_node( the_chain ) \
- _Chain_Has_only_one_node( the_chain )
-
-
-/*
- * Chain_Is_null
- *
- * This function returns TRUE if the_chain is NULL and FALSE otherwise.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Is_null( the_chain ) \
- _Chain_Is_null( the_chain )
-
-
-/*
- * Chain_Is_null_node
- *
- * This function returns TRUE if the_node is NULL and FALSE otherwise.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_null_node( the_node ) \
- _Chain_Is_null_node( the_node )
-
-
-#undef __RTEMS_APPLICATION__
-#include <rtems/score/chain.inl>
-#define __RTEMS_APPLICATION__
-#endif
-/* end of include file */
diff --git a/c/src/exec/libcsupport/include/clockdrv.h b/c/src/exec/libcsupport/include/clockdrv.h
deleted file mode 100644
index 74c9d5e9f7..0000000000
--- a/c/src/exec/libcsupport/include/clockdrv.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* clock.h
- *
- * This file describes the Clock Driver for all boards.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __CLOCK_DRIVER_h
-#define __CLOCK_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* variables */
-
-extern volatile rtems_unsigned32 Clock_driver_ticks;
-extern rtems_device_major_number rtems_clock_major;
-extern rtems_device_minor_number rtems_clock_minor;
-
-/* default clock driver entry */
-
-#define CLOCK_DRIVER_TABLE_ENTRY \
- { Clock_initialize, NULL, NULL, NULL, NULL, Clock_control }
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/libcsupport/include/console.h b/c/src/exec/libcsupport/include/console.h
deleted file mode 100644
index 2f5173d757..0000000000
--- a/c/src/exec/libcsupport/include/console.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* console.h
- *
- * This file describes the Console Device Driver for all boards.
- * This driver provides support for the standard C Library.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _CONSOLE_DRIVER_h
-#define _CONSOLE_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CONSOLE_DRIVER_TABLE_ENTRY \
- { console_initialize, console_open, console_close, \
- console_read, console_write, console_control }
-
-void console_reserve_resources(
- rtems_configuration_table *configuration
-);
-
-rtems_device_driver console_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_open(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_close(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_read(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_write(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_control(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/libcsupport/include/iosupp.h b/c/src/exec/libcsupport/include/iosupp.h
deleted file mode 100644
index 97175e0a7b..0000000000
--- a/c/src/exec/libcsupport/include/iosupp.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* iosupp.h
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __IOSUPP_h
-#define __IOSUPP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* character constants */
-
-#define BS 0x08 /* backspace */
-#define LF 0x0a /* line feed */
-#define CR 0x0d /* carriage return */
-#define XON 0x11 /* control-Q */
-#define XOFF 0x13 /* control-S */
-
-/* structures */
-
-#ifdef IOSUPP_INIT
-#define IOSUPP_EXTERN
-#else
-#undef IOSUPP_EXTERN
-#define IOSUPP_EXTERN extern
-#endif
-
-/* functions */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/exec/libcsupport/include/motorola/mc68230.h b/c/src/exec/libcsupport/include/motorola/mc68230.h
deleted file mode 100644
index bde00c4cdd..0000000000
--- a/c/src/exec/libcsupport/include/motorola/mc68230.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * mc68230.h -- Low level support code for the Motorola 68230 Parallel
- * Interface/Timer (PIT)
- *
- * Modified by Doug McBride, Colorado Space Grant College
- *
- * Format taken partly from RTEMS code and mostly from Motorola IDP user's
- * manual. RTEMS copyright information below.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MC68230_H__
-#define __MC68230_H__
-
-/* Some Motorola IDP User manual defines: */
-#define PIT_ADDR 0x00c01003 /* base address of the PIT */
-#define REGOFF 0x04 /* Difference between addresses */
-#define VECT 64
-#define H1VECT 0x00
-#define H2VECT 0x01
-#define H3VECT 0x02
-#define H4VECT 0x03
-
-/*
- * mc68230 register offsets
- */
-#define PGCR 0x00
-#define PSRR 1*REGOFF
-#define PADDR 2*REGOFF
-#define PBDDR 3*REGOFF
-#define PCDDR 4*REGOFF
-#define PIVR 5*REGOFF
-#define PACR 6*REGOFF
-#define PBCR 7*REGOFF
-#define PADR 8*REGOFF
-#define PBDR 9*REGOFF
-#define PAAR 10*REGOFF
-#define PBAR 11*REGOFF
-#define PCDR 12*REGOFF
-#define PITSR 13*REGOFF
-#define TCR 16*REGOFF
-#define TIVR 17*REGOFF
-#define CPRH 19*REGOFF
-#define CPRM 20*REGOFF
-#define CPRL 21*REGOFF
-#define CNTRH 23*REGOFF
-#define CNTRM 24*REGOFF
-#define CNTRL 25*REGOFF
-#define TSR 26*REGOFF
-
-/* Some RTEMS style defines: */
-#ifndef VOL8
-#define VOL8( ptr ) ((volatile rtems_unsigned8 *)(ptr))
-#endif
-
-#define MC68230_WRITE( reg, data ) \
- *(VOL8(PIT_ADDR+reg)) = (data)
-
-#define MC68230_READ( reg, data ) \
- (data) = *(VOL8(PIT_ADDR+reg))
-
-#endif
diff --git a/c/src/exec/libcsupport/include/motorola/mc68681.h b/c/src/exec/libcsupport/include/motorola/mc68681.h
deleted file mode 100644
index 7602097fd8..0000000000
--- a/c/src/exec/libcsupport/include/motorola/mc68681.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * mc68681-duart.h -- Low level support code for the Motorola mc68681
- * DUART.
- *
- * Originally written by rob@cygnus.com (Rob Savoye) for the libgloss
- * IDP support.
- *
- * $Id$
- */
-
-#ifndef __MC68681_H__
-#define __MC68681_H__
-
-/*
- * In the dark ages when this controller was designed, it was actually
- * possible to access data on unaligned byte boundaries with no penalty.
- * Now we find this chip in configurations in which the registers are
- * at 16-bit, 32-bit, and 64-bit boundaries at the whim of the board
- * designer. If the registers are not at byte addresses, then
- * set this multiplier before including this file to correct the offsets.
- */
-
-#ifndef MC68681_OFFSET_MULTIPLIER
-#define MC68681_OFFSET_MULTIPLIER 1
-#endif
-
-#define __MC68681_REG(_R) ((_R) * MC68681_OFFSET_MULTIPLIER)
-
-/*
- * mc68681 register offsets Read/Write Addresses
- */
-#define MC68681_MODE_REG_1A __MC68681_REG(0) /* MR1A-MR Prior to Read */
-#define MC68681_MODE_REG_2A __MC68681_REG(0) /* MR2A-MR After Read */
-
-#define MC68681_COUNT_MODE_CURRENT_MSB __MC68681_REG(6) /* CTU */
-#define MC68681_COUNTER_TIMER_UPPER_REG __MC68681_REG(6) /* CTU */
-#define MC68681_COUNT_MODE_CURRENT_LSB __MC68681_REG(7) /* CTL */
-#define MC68681_COUNTER_TIMER_LOWER_REG __MC68681_REG(7) /* CTL */
-#define MC68681_INTERRUPT_VECTOR_REG __MC68681_REG(12) /* IVR */
-
-#define MC68681_MODE_REG_1B __MC68681_REG(8) /* MR1B-MR Prior to Read */
-#define MC68681_MODE_REG_2B __MC68681_REG(8) /* MR2BA-MR After Read */
-
-/*
- * mc68681 register offsets Read Only Addresses
- */
-#define MC68681_STATUS_REG_A __MC68681_REG(1) /* SRA */
-#define MC68681_MASK_ISR_REG __MC68681_REG(2) /* MISR */
-#define MC68681_RECEIVE_BUFFER_A __MC68681_REG(3) /* RHRA */
-#define MC68681_INPUT_PORT_CHANGE_REG __MC68681_REG(4) /* IPCR */
-#define MC68681_INTERRUPT_STATUS_REG __MC68681_REG(5) /* ISR */
-#define MC68681_STATUS_REG_B __MC68681_REG(9) /* SRB */
-#define MC68681_RECEIVE_BUFFER_B __MC68681_REG(11) /* RHRB */
-#define MC68681_INPUT_PORT __MC68681_REG(13) /* IP */
-#define MC68681_START_COUNT_CMD __MC68681_REG(14) /* SCC */
-#define MC68681_STOP_COUNT_CMD __MC68681_REG(15) /* STC */
-
-/*
- * mc68681 register offsets Write Only Addresses
- */
-#define MC68681_CLOCK_SELECT_REG_A __MC68681_REG(1) /* CSRA */
-#define MC68681_COMMAND_REG_A __MC68681_REG(2) /* CRA */
-#define MC68681_TRANSMIT_BUFFER_A __MC68681_REG(3) /* THRA */
-#define MC68681_AUX_CTRL_REG __MC68681_REG(4) /* ACR */
-#define MC68681_INTERRUPT_MASK_REG __MC68681_REG(5) /* IMR */
-#define MC68681_CLOCK_SELECT_REG_B __MC68681_REG(9) /* CSRB */
-#define MC68681_COMMAND_REG_B __MC68681_REG(10) /* CRB */
-#define MC68681_TRANSMIT_BUFFER_B __MC68681_REG(11) /* THRB */
-#define MC68681_OUTPUT_PORT_CONFIG_REG __MC68681_REG(13) /* OPCR */
-#define MC68681_OUTPUT_PORT_SET_REG __MC68681_REG(14) /* SOPBC */
-#define MC68681_OUTPUT_PORT_RESET_BITS __MC68681_REG(15) /* COPBC */
-
-
-#ifndef MC6681_VOL
-#define MC6681_VOL( ptr ) ((volatile unsigned char *)(ptr))
-#endif
-
-#define MC68681_WRITE( _base, _reg, _data ) \
- *((volatile unsigned char *)_base+_reg) = (_data)
-
-#define MC68681_READ( _base, _reg ) \
- *(((volatile unsigned char *)_base+_reg))
-
-
-
-#define MC68681_CLEAR 0x00
-
-#define MC68681_PORT_A 0
-#define MC68681_PORT_B 1
-
-/*
- * DUART Command Register Definitions:
- *
- * MC68681_COMMAND_REG_A,MC68681_COMMAND_REG_B
- */
-#define MC68681_MODE_REG_ENABLE_RX 0x01
-#define MC68681_MODE_REG_DISABLE_RX 0x02
-#define MC68681_MODE_REG_ENABLE_TX 0x04
-#define MC68681_MODE_REG_DISABLE_TX 0x08
-#define MC68681_MODE_REG_RESET_MR_PTR 0x10
-#define MC68681_MODE_REG_RESET_RX 0x20
-#define MC68681_MODE_REG_RESET_TX 0x30
-#define MC68681_MODE_REG_RESET_ERROR 0x40
-#define MC68681_MODE_REG_RESET_BREAK 0x50
-#define MC68681_MODE_REG_START_BREAK 0x60
-#define MC68681_MODE_REG_STOP_BREAK 0x70
-#define MC68681_MODE_REG_SET_RX_BRG 0x80
-#define MC68681_MODE_REG_CLEAR_RX_BRG 0x90
-#define MC68681_MODE_REG_SET_TX_BRG 0xa0
-#define MC68681_MODE_REG_CLEAR_TX_BRG 0xb0
-#define MC68681_MODE_REG_SET_STANDBY 0xc0
-#define MC68681_MODE_REG_SET_ACTIVE 0xd0
-
-/*
- * Mode Register Definitions
- *
- * MC68681_MODE_REG_1A
- * MC68681_MODE_REG_1B
- */
-#define MC68681_5BIT_CHARS 0x00
-#define MC68681_6BIT_CHARS 0x01
-#define MC68681_7BIT_CHARS 0x02
-#define MC68681_8BIT_CHARS 0x03
-
-#define MC68681_ODD_PARITY 0x00
-#define MC68681_EVEN_PARITY 0x04
-
-#define MC68681_WITH_PARITY 0x00
-#define MC68681_FORCE_PARITY 0x08
-#define MC68681_NO_PARITY 0x10
-#define MC68681_MULTI_DROP 0x18
-
-#define MC68681_ERR_MODE_CHAR 0x00
-#define MC68681_ERR_MODE_BLOCK 0x20
-
-#define MC68681_RX_INTR_RX_READY 0x00
-#define MC68681_RX_INTR_FFULL 0x40
-
-#define MC68681_NO_RX_RTS_CTL 0x00
-#define MC68681_RX_RTS_CTRL 0x80
-
-
-/*
- * Mode Register Definitions
- *
- * MC68681_MODE_REG_2A
- * MC68681_MODE_REG_2B
- */
-#define MC68681_STOP_BIT_LENGTH__563 0x00
-#define MC68681_STOP_BIT_LENGTH__625 0x01
-#define MC68681_STOP_BIT_LENGTH__688 0x02
-#define MC68681_STOP_BIT_LENGTH__75 0x03
-#define MC68681_STOP_BIT_LENGTH__813 0x04
-#define MC68681_STOP_BIT_LENGTH__875 0x05
-#define MC68681_STOP_BIT_LENGTH__938 0x06
-#define MC68681_STOP_BIT_LENGTH_1 0x07
-#define MC68681_STOP_BIT_LENGTH_1_563 0x08
-#define MC68681_STOP_BIT_LENGTH_1_625 0x09
-#define MC68681_STOP_BIT_LENGTH_1_688 0x0a
-#define MC68681_STOP_BIT_LENGTH_1_75 0x0b
-#define MC68681_STOP_BIT_LENGTH_1_813 0x0c
-#define MC68681_STOP_BIT_LENGTH_1_875 0x0d
-#define MC68681_STOP_BIT_LENGTH_1_938 0x0e
-#define MC68681_STOP_BIT_LENGTH_2 0x0f
-
-#define MC68681_CTS_ENABLE_TX 0x10
-#define MC68681_TX_RTS_CTRL 0x20
-
-#define MC68681_CHANNEL_MODE_NORMAL 0x00
-#define MC68681_CHANNEL_MODE_ECHO 0x40
-#define MC68681_CHANNEL_MODE_LOCAL_LOOP 0x80
-#define MC68681_CHANNEL_MODE_REMOTE_LOOP 0xc0
-
-/*
- * Status Register Definitions
- *
- * MC68681_STATUS_REG_A, MC68681_STATUS_REG_B
- */
-#define MC68681_RX_READY 0x01
-#define MC68681_FFULL 0x02
-#define MC68681_TX_READY 0x04
-#define MC68681_TX_EMPTY 0x08
-#define MC68681_OVERRUN_ERROR 0x10
-#define MC68681_PARITY_ERROR 0x20
-#define MC68681_FRAMING_ERROR 0x40
-#define MC68681_RECEIVED_BREAK 0x80
-
-
-/*
- * Interupt Status Register Definitions.
- *
- * MC68681_INTERRUPT_STATUS_REG
- */
-
-
-/*
- * Interupt Mask Register Definitions
- *
- * MC68681_INTERRUPT_MASK_REG
- */
-#define MC68681_IR_TX_READY_A 0x01
-#define MC68681_IR_RX_READY_A 0x02
-#define MC68681_IR_BREAK_A 0x04
-#define MC68681_IR_COUNTER_READY 0x08
-#define MC68681_IR_TX_READY_B 0x10
-#define MC68681_IR_RX_READY_B 0x20
-#define MC68681_IR_BREAK_B 0x40
-#define MC68681_IR_INPUT_PORT_CHANGE 0x80
-
-/*
- * Status Register Definitions.
- *
- * MC68681_STATUS_REG_A,MC68681_STATUS_REG_B
- */
-#define MC68681_STATUS_RXRDY 0x01
-#define MC68681_STATUS_FFULL 0x02
-#define MC68681_STATUS_TXRDY 0x04
-#define MC68681_STATUS_TXEMT 0x08
-#define MC68681_STATUS_OVERRUN_ERROR 0x10
-#define MC68681_STATUS_PARITY_ERROR 0x20
-#define MC68681_STATUS_FRAMING_ERROR 0x40
-#define MC68681_STATUS_RECEIVED_BREAK 0x80
-
-/*
- * Definitions for the Interrupt Vector Register:
- *
- * MC68681_INTERRUPT_VECTOR_REG
- */
-#define MC68681_INTERRUPT_VECTOR_INIT 0x0f
-
-/*
- * Definitions for the Auxiliary Control Register
- *
- * MC68681_AUX_CTRL_REG
- */
-#define MC68681_AUX_BRG_SET1 0x00
-#define MC68681_AUX_BRG_SET2 0x80
-
-
-/*
- * The following Baud rates assume the X1 clock pin is driven with a
- * 3.6864 MHz signal. If a different frequency is used the DUART channel
- * is running at the follwoing baud rate:
- * ((Table Baud Rate)*frequency)/3.6864 MHz
- */
-
-/*
- * Definitions for the Clock Select Register:
- *
- * MC68681_CLOCK_SELECT_REG_A,MC68681_CLOCK_SELECT_REG_A
- *
- * Note: ACR[7] is the MSB of the Auxiliary Control register
- * X is the extend bit.
- * CRA - 0x08 Set Rx BRG Select Extend Bit (X=1)
- * CRA - 0x09 Clear Rx BRG Select Extend Bit (X=0)
- * CRB - 0x0a Set Tx BRG Select Extend Bit (X=1)
- * CRB - 0x0b Clear Tx BRG Select Extend Bit (x=1)
- */
-#define MC68681_BAUD_RATE_MASK_50 0x00 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_75 0x00 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_110 0x01
-#define MC68681_BAUD_RATE_MASK_134_5 0x02
-#define MC68681_BAUD_RATE_MASK_150 0x03 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_200 0x03 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_300 0x04 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_600 0x05 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_1050 0x07 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_1200 0x06 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_1800 0x0a /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_2400 0x08 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_3600 0x04 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_4800 0x09
-#define MC68681_BAUD_RATE_MASK_7200 0x0a /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_9600 0xbb
-
-#define MC68681_BAUD_RATE_MASK_14_4K 0x05 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_19_2K 0xcc /* ACR[7]=1,X=0 */
- /* ARC[7]=0,X=1 */
-#define MC68681_BAUD_RATE_MASK_28_8K 0x06 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_38_4K 0xcc /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_57_6K 0x07 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_115_5K 0x08
-#define MC68681_BAUD_RATE_MASK_TIMER 0xdd
-#define MC68681_BAUD_RATE_MASK_TIMER_16X 0xee
-#define MC68681_BAUD_RATE_MASK_TIMER_1X 0xff
-
-#endif
-
-
-
diff --git a/c/src/exec/libcsupport/include/ringbuf.h b/c/src/exec/libcsupport/include/ringbuf.h
deleted file mode 100644
index 8c80aaf9c8..0000000000
--- a/c/src/exec/libcsupport/include/ringbuf.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * ringbuf.h
- *
- * This file provides simple ring buffer functionality.
- *
- * $Id$
- */
-
-#ifndef __RINGBUF_H__
-#define __RINGBUF_H__
-
-#ifndef RINGBUF_QUEUE_LENGTH
-#define RINGBUF_QUEUE_LENGTH 128
-#endif
-
-typedef struct {
- char buffer[RINGBUF_QUEUE_LENGTH];
- volatile int head;
- volatile int tail;
-} Ring_buffer_t;
-
-#define Ring_buffer_Initialize( _buffer ) \
- do { \
- (_buffer)->head = (_buffer)->tail = 0; \
- } while ( 0 )
-
-#define Ring_buffer_Is_empty( _buffer ) \
- ( (_buffer)->head == (_buffer)->tail )
-
-#define Ring_buffer_Is_full( _buffer ) \
- ( (_buffer)->head == ((_buffer)->tail + 1) % RINGBUF_QUEUE_LENGTH )
-
-#define Ring_buffer_Add_character( _buffer, _ch ) \
- do { \
- rtems_unsigned32 isrlevel; \
- \
- rtems_interrupt_disable( isrlevel ); \
- (_buffer)->tail = ((_buffer)->tail+1) % RINGBUF_QUEUE_LENGTH; \
- (_buffer)->buffer[ (_buffer)->tail ] = (_ch); \
- rtems_interrupt_enable( isrlevel ); \
- } while ( 0 )
-
-#define Ring_buffer_Remove_character( _buffer, _ch ) \
- do { \
- rtems_unsigned32 isrlevel; \
- \
- rtems_interrupt_disable( isrlevel ); \
- (_buffer)->head = ((_buffer)->head+1) % RINGBUF_QUEUE_LENGTH; \
- (_ch) = (_buffer)->buffer[ (_buffer)->head ]; \
- rtems_interrupt_enable( isrlevel ); \
- } while ( 0 )
-
-#endif
diff --git a/c/src/exec/libcsupport/include/rtems/assoc.h b/c/src/exec/libcsupport/include/rtems/assoc.h
deleted file mode 100644
index 1982d654ac..0000000000
--- a/c/src/exec/libcsupport/include/rtems/assoc.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Rtems associativity routines. Mainly used to convert a value from
- * one space to another (eg: our errno's to host errno's and v.v)
- *
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_ASSOC_H
-#define _INCLUDE_ASSOC_H
-
-typedef struct {
- const char *name;
- unsigned32 local_value;
- unsigned32 remote_value;
-} rtems_assoc_t;
-
-/*
- * Flag/marker for optional default value in each table
- */
-
-#define RTEMS_ASSOC_DEFAULT_NAME "(default)"
-
-const rtems_assoc_t *rtems_assoc_ptr_by_name(const rtems_assoc_t *, const char *);
-const rtems_assoc_t *rtems_assoc_ptr_by_value(const rtems_assoc_t *, unsigned32);
-const rtems_assoc_t *rtems_assoc_ptr_by_remote(const rtems_assoc_t *, unsigned32);
-
-unsigned32 rtems_assoc_remote_by_local(const rtems_assoc_t *, unsigned32);
-unsigned32 rtems_assoc_local_by_remote(const rtems_assoc_t *, unsigned32);
-unsigned32 rtems_assoc_remote_by_name(const rtems_assoc_t *, const char *);
-unsigned32 rtems_assoc_local_by_name(const rtems_assoc_t *, const char *);
-const char *rtems_assoc_name_by_local(const rtems_assoc_t *, unsigned32);
-const char *rtems_assoc_name_by_remote(const rtems_assoc_t *, unsigned32);
-
-unsigned32 rtems_assoc_remote_by_local_bitfield(const rtems_assoc_t *, unsigned32);
-char *rtems_assoc_name_by_local_bitfield(const rtems_assoc_t *, unsigned32, char *);
-char *rtems_assoc_name_by_remote_bitfield(const rtems_assoc_t *, unsigned32, char *);
-unsigned32 rtems_assoc_local_by_remote_bitfield(const rtems_assoc_t *, unsigned32);
-
-
-#endif /* ! _INCLUDE_ASSOC_H */
diff --git a/c/src/exec/libcsupport/include/rtems/error.h b/c/src/exec/libcsupport/include/rtems/error.h
deleted file mode 100644
index a0698afb5d..0000000000
--- a/c/src/exec/libcsupport/include/rtems/error.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Defines and externs for rtems error reporting
- *
- * $Id$
- */
-
-#ifndef __RTEMS_ERROR_h
-#define __RTEMS_ERROR_h
-
-/*
- * rtems_error() and rtems_panic() support
- */
-
-#define RTEMS_ERROR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define RTEMS_ERROR_PANIC (RTEMS_ERROR_ERRNO / 2) /* err fatal; no return */
-#define RTEMS_ERROR_ABORT (RTEMS_ERROR_ERRNO / 4) /* err is fatal; panic */
-
-#define RTEMS_ERROR_MASK (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | \
- RTEMS_ERROR_PANIC) /* all */
-
-const char *rtems_status_text(rtems_status_code);
-int rtems_error(int error_code, const char *printf_format, ...);
-#ifdef __GNUC__
-void rtems_panic(const char *printf_format, ...);
-/*
- * We should be able to use this attribute but gcc complains that
- * rtems_panic does in fact return. :(
- *
- * __attribute__ ((__noreturn__));
- */
-#else
-void rtems_panic(const char *printf_format, ...);
-#endif
-
-extern int rtems_panic_in_progress;
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/libcsupport/include/rtems/libcsupport.h b/c/src/exec/libcsupport/include/rtems/libcsupport.h
deleted file mode 100644
index d007784526..0000000000
--- a/c/src/exec/libcsupport/include/rtems/libcsupport.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* libcsupport.h
- *
- * This include file contains the information regarding the
- * RTEMS specific support for the standard C library.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __LIBC_SUPPORT_h
-#define __LIBC_SUPPORT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <sys/types.h>
-
-void RTEMS_Malloc_Initialize(
- void *start,
- size_t length,
- size_t sbrk_amount
-);
-
-extern void malloc_dump(void);
-extern void malloc_walk(size_t source, size_t printf_enabled);
-extern void libc_init(int reentrant);
-extern int host_errno(void);
-extern void fix_syscall_errno(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/libcsupport/include/rtems/libio.h b/c/src/exec/libcsupport/include/rtems/libio.h
deleted file mode 100644
index dcdda85aec..0000000000
--- a/c/src/exec/libcsupport/include/rtems/libio.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * General purpose communication channel for RTEMS to allow UNIX/POSIX
- * system call behavior on top of RTEMS IO devices.
- *
- * TODO
- * stat(2)
- * unlink(2)
- * rename(2)
- *
- * $Id$
- */
-
-#ifndef _RTEMS_LIBIO_H
-#define _RTEMS_LIBIO_H
-
-#include <sys/stat.h>
-
-typedef unsigned32 rtems_libio_offset_t;
-
-/*
- * An open file data structure, indexed by 'fd'
- * TODO:
- * should really have a separate per/file data structure that this
- * points to (eg: size, offset, driver, pathname should be in that)
- */
-
-typedef struct {
- rtems_driver_name_t *driver;
- rtems_libio_offset_t size; /* size of file */
- rtems_libio_offset_t offset; /* current offset into the file */
- unsigned32 flags;
- char *pathname; /* opened pathname */
- Objects_Id sem;
- unsigned32 data0; /* private to "driver" */
- void *data1; /* ... */
-} rtems_libio_t;
-
-
-/*
- * param block for read/write
- * Note: it must include 'offset' instead of using iop's offset since
- * we can have multiple outstanding i/o's on a device.
- */
-
-typedef struct {
- rtems_libio_t *iop;
- rtems_libio_offset_t offset;
- unsigned8 *buffer;
- unsigned32 count;
- unsigned32 flags;
- unsigned32 bytes_moved;
-} rtems_libio_rw_args_t;
-
-/*
- * param block for open/close
- */
-
-typedef struct {
- rtems_libio_t *iop;
- unsigned32 flags;
- unsigned32 mode;
-} rtems_libio_open_close_args_t;
-
-/*
- * param block for ioctl
- */
-
-typedef struct {
- rtems_libio_t *iop;
- unsigned32 command;
- void *buffer;
- unsigned32 ioctl_return;
-} rtems_libio_ioctl_args_t;
-
-
-/*
- * Values for 'flag'
- */
-
-#define LIBIO_FLAGS_NO_DELAY 0x0001 /* return immediately if no data */
-#define LIBIO_FLAGS_READ 0x0002 /* reading */
-#define LIBIO_FLAGS_WRITE 0x0004 /* writing */
-#define LIBIO_FLAGS_LINE_BUFFERED 0x0008 /* line buffered io (^h, ^u, etc) */
-#define LIBIO_FLAGS_OPEN 0x0100 /* device is open */
-#define LIBIO_FLAGS_APPEND 0x0200 /* all writes append */
-#define LIBIO_FLAGS_CREATE 0x0400 /* create file */
-
-#define LIBIO_FLAGS_READ_WRITE (LIBIO_FLAGS_READ | LIBIO_FLAGS_WRITE)
-
-void rtems_libio_init(void);
-
-int __rtems_open(const char *pathname, unsigned32 flag, unsigned32 mode);
-int __rtems_close(int fd);
-int __rtems_read(int fd, void *buffer, unsigned32 count);
-int __rtems_write(int fd, const void *buffer, unsigned32 count);
-int __rtems_ioctl(int fd, unsigned32 command, void *buffer);
-int __rtems_lseek(int fd, rtems_libio_offset_t offset, int whence);
-int __rtems_fstat(int _fd, struct stat* _sbuf);
-
-/*
- * External I/O handlers
- */
-typedef struct {
- int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode);
- int (*close)(int fd);
- int (*read)(int fd, void *buffer, unsigned32 count);
- int (*write)(int fd, const void *buffer, unsigned32 count);
- int (*ioctl)(int fd, unsigned32 command, void *buffer);
- int (*lseek)(int fd, rtems_libio_offset_t offset, int whence);
-} rtems_libio_handler_t;
-
-void rtems_register_libio_handler(int handler_flag,
- const rtems_libio_handler_t *handler);
-
-#define RTEMS_FILE_DESCRIPTOR_TYPE_FILE 0x0000
-#define RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET 0x1000
-#define rtems_make_file_descriptor(fd,flags) ((fd)|(flags))
-#define rtems_file_descriptor_base(fd) ((fd) & 0x0FFF)
-#define rtems_file_descriptor_type(fd) ((fd) & 0xF000)
-#define rtems_file_descriptor_type_index(fd) ((((fd) & 0xF000) >> 12) - 1)
-
-/*
- * IOCTL values
- */
-
-#define RTEMS_IO_GET_ATTRIBUTES 1
-#define RTEMS_IO_SET_ATTRIBUTES 2
-#define RTEMS_IO_TCDRAIN 3
-
-/*
- * Callbacks from TERMIOS routines to device-dependent code
- */
-#include <termios.h>
-typedef struct rtems_termios_callbacks {
- int (*firstOpen)(int major, int minor, void *arg);
- int (*lastClose)(int major, int minor, void *arg);
- int (*pollRead)(int minor);
- int (*write)(int minor, const char *buf, int len);
- int (*setAttributes)(int minor, const struct termios *t);
- int (*stopRemoteTx)(int minor);
- int (*startRemoteTx)(int minor);
- int outputUsesInterrupts;
-} rtems_termios_callbacks;
-
-/*
- * Device-independent TERMIOS routines
- */
-void rtems_termios_initialize (void);
-rtems_status_code rtems_termios_open (
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg,
- const rtems_termios_callbacks *callbacks
- );
-rtems_status_code rtems_termios_close (void *arg);
-rtems_status_code rtems_termios_read (void *arg);
-rtems_status_code rtems_termios_write (void *arg);
-rtems_status_code rtems_termios_ioctl (void *arg);
-int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len);
-int rtems_termios_dequeue_characters (void *ttyp, int len);
-void rtems_termios_reserve_resources(
- rtems_configuration_table *configuration,
- rtems_unsigned32 number_of_devices
-);
-
-#endif /* _RTEMS_LIBIO_H */
diff --git a/c/src/exec/libcsupport/include/spurious.h b/c/src/exec/libcsupport/include/spurious.h
deleted file mode 100644
index 36fcaba904..0000000000
--- a/c/src/exec/libcsupport/include/spurious.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* spurious.h
- *
- * This file describes the Spurious Interrupt Driver for all boards.
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution 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 __SPURIOUS_h
-#define __SPURIOUS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define SPURIOUS_DRIVER_TABLE_ENTRY \
- { Spurious_Initialize, NULL, NULL, NULL, NULL, NULL }
-
-rtems_device_driver Spurious_Initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *,
- rtems_id,
- rtems_unsigned32 *
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/libcsupport/include/sys/filio.h b/c/src/exec/libcsupport/include/sys/filio.h
deleted file mode 100644
index b82a649c0f..0000000000
--- a/c/src/exec/libcsupport/include/sys/filio.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)filio.h 8.1 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_FILIO_H_
-#define _SYS_FILIO_H_
-
-#include <sys/ioccom.h>
-
-/* Generic file-descriptor ioctl's. */
-#define FIOCLEX _IO('f', 1) /* set close on exec on fd */
-#define FIONCLEX _IO('f', 2) /* remove close on exec */
-#define FIONREAD _IOR('f', 127, int) /* get # bytes to read */
-#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */
-#define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */
-#define FIOSETOWN _IOW('f', 124, int) /* set owner */
-#define FIOGETOWN _IOR('f', 123, int) /* get owner */
-
-#endif /* !_SYS_FILIO_H_ */
diff --git a/c/src/exec/libcsupport/include/sys/ioctl.h b/c/src/exec/libcsupport/include/sys/ioctl.h
deleted file mode 100644
index e3a69a5a7f..0000000000
--- a/c/src/exec/libcsupport/include/sys/ioctl.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)ioctl.h 8.6 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_IOCTL_H_
-#define _SYS_IOCTL_H_
-
-#include <sys/ttycom.h>
-
-/*
- * Pun for SunOS prior to 3.2. SunOS 3.2 and later support TIOCGWINSZ
- * and TIOCSWINSZ (yes, even 3.2-3.5, the fact that it wasn't documented
- * notwithstanding).
- */
-struct ttysize {
- unsigned short ts_lines;
- unsigned short ts_cols;
- unsigned short ts_xxx;
- unsigned short ts_yyy;
-};
-#define TIOCGSIZE TIOCGWINSZ
-#define TIOCSSIZE TIOCSWINSZ
-
-#include <sys/ioccom.h>
-
-#include <sys/filio.h>
-#include <sys/sockio.h>
-
-#endif /* !_SYS_IOCTL_H_ */
-
-/*
- * Keep outside _SYS_IOCTL_H_
- * Compatibility with old terminal driver
- *
- * Source level -> #define USE_OLD_TTY
- * Kernel level -> options COMPAT_43 or COMPAT_SUNOS
- */
-#if defined(USE_OLD_TTY) || defined(COMPAT_43) || defined(COMPAT_SUNOS)
-#include <sys/ioctl_compat.h>
-#endif
diff --git a/c/src/exec/libcsupport/include/sys/sockio.h b/c/src/exec/libcsupport/include/sys/sockio.h
deleted file mode 100644
index 020061170f..0000000000
--- a/c/src/exec/libcsupport/include/sys/sockio.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * 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.
- *
- * @(#)sockio.h 8.1 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_SOCKIO_H_
-#define _SYS_SOCKIO_H_
-
-#include <sys/ioccom.h>
-
-/* Socket ioctl's. */
-#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */
-#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */
-#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */
-#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */
-#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */
-#define SIOCSPGRP _IOW('s', 8, int) /* set process group */
-#define SIOCGPGRP _IOR('s', 9, int) /* get process group */
-
-#define SIOCADDRT _IOW('r', 10, struct ortentry) /* add route */
-#define SIOCDELRT _IOW('r', 11, struct ortentry) /* delete route */
-#define SIOCGETVIFCNT _IOWR('r', 15, struct sioc_vif_req)/* get vif pkt cnt */
-#define SIOCGETSGCNT _IOWR('r', 16, struct sioc_sg_req) /* get s,g pkt cnt */
-
-#define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */
-#define OSIOCGIFADDR _IOWR('i', 13, struct ifreq) /* get ifnet address */
-#define SIOCGIFADDR _IOWR('i', 33, struct ifreq) /* get ifnet address */
-#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */
-#define OSIOCGIFDSTADDR _IOWR('i', 15, struct ifreq) /* get p-p address */
-#define SIOCGIFDSTADDR _IOWR('i', 34, struct ifreq) /* get p-p address */
-#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */
-#define SIOCGIFFLAGS _IOWR('i', 17, struct ifreq) /* get ifnet flags */
-#define OSIOCGIFBRDADDR _IOWR('i', 18, struct ifreq) /* get broadcast addr */
-#define SIOCGIFBRDADDR _IOWR('i', 35, struct ifreq) /* get broadcast addr */
-#define SIOCSIFBRDADDR _IOW('i', 19, struct ifreq) /* set broadcast addr */
-#define OSIOCGIFCONF _IOWR('i', 20, struct ifconf) /* get ifnet list */
-#define SIOCGIFCONF _IOWR('i', 36, struct ifconf) /* get ifnet list */
-#define OSIOCGIFNETMASK _IOWR('i', 21, struct ifreq) /* get net addr mask */
-#define SIOCGIFNETMASK _IOWR('i', 37, struct ifreq) /* get net addr mask */
-#define SIOCSIFNETMASK _IOW('i', 22, struct ifreq) /* set net addr mask */
-#define SIOCGIFMETRIC _IOWR('i', 23, struct ifreq) /* get IF metric */
-#define SIOCSIFMETRIC _IOW('i', 24, struct ifreq) /* set IF metric */
-#define SIOCDIFADDR _IOW('i', 25, struct ifreq) /* delete IF addr */
-#define SIOCAIFADDR _IOW('i', 26, struct ifaliasreq)/* add/chg IF alias */
-
-#define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */
-#define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */
-#define SIOCGIFMTU _IOWR('i', 51, struct ifreq) /* get IF mtu */
-#define SIOCSIFMTU _IOW('i', 52, struct ifreq) /* set IF mtu */
-#define SIOCGIFPHYS _IOWR('i', 53, struct ifreq) /* get IF wire */
-#define SIOCSIFPHYS _IOW('i', 54, struct ifreq) /* set IF wire */
-#define SIOCSIFMEDIA _IOWR('i', 55, struct ifreq) /* set net media */
-#define SIOCGIFMEDIA _IOWR('i', 56, struct ifmediareq) /* get net media */
-
-#endif /* !_SYS_SOCKIO_H_ */
diff --git a/c/src/exec/libcsupport/include/sys/termios.h b/c/src/exec/libcsupport/include/sys/termios.h
deleted file mode 100644
index 71a2492724..0000000000
--- a/c/src/exec/libcsupport/include/sys/termios.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * POSIX termios implementation for RTEMS console device driver.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 TERMIOS_H
-#define TERMIOS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef unsigned char cc_t;
-typedef unsigned int speed_t;
-typedef unsigned int tcflag_t;
-
-#define NCCS 19
-struct termios {
- tcflag_t c_iflag; /* input mode flags */
- tcflag_t c_oflag; /* output mode flags */
- tcflag_t c_cflag; /* control mode flags */
- tcflag_t c_lflag; /* local mode flags */
- cc_t c_line; /* line discipline */
- cc_t c_cc[NCCS]; /* control characters */
-};
-
-/* c_cc characters */
-#define VINTR 0
-#define VQUIT 1
-#define VERASE 2
-#define VKILL 3
-#define VEOF 4
-#define VTIME 5
-#define VMIN 6
-#define VSWTC 7
-#define VSTART 8
-#define VSTOP 9
-#define VSUSP 10
-#define VEOL 11
-#define VREPRINT 12
-#define VDISCARD 13
-#define VWERASE 14
-#define VLNEXT 15
-#define VEOL2 16
-
-/* c_iflag bits */
-#define IGNBRK 0000001
-#define BRKINT 0000002
-#define IGNPAR 0000004
-#define PARMRK 0000010
-#define INPCK 0000020
-#define ISTRIP 0000040
-#define INLCR 0000100
-#define IGNCR 0000200
-#define ICRNL 0000400
-#define IUCLC 0001000
-#define IXON 0002000
-#define IXANY 0004000
-#define IXOFF 0010000
-#define IMAXBEL 0020000
-
-/* c_oflag bits */
-#define OPOST 0000001
-#define OLCUC 0000002
-#define ONLCR 0000004
-#define OCRNL 0000010
-#define ONOCR 0000020
-#define ONLRET 0000040
-#define OFILL 0000100
-#define OFDEL 0000200
-#define NLDLY 0000400
-#define NL0 0000000
-#define NL1 0000400
-#define CRDLY 0003000
-#define CR0 0000000
-#define CR1 0001000
-#define CR2 0002000
-#define CR3 0003000
-#define TABDLY 0014000
-#define TAB0 0000000
-#define TAB1 0004000
-#define TAB2 0010000
-#define TAB3 0014000
-#define XTABS 0014000
-#define BSDLY 0020000
-#define BS0 0000000
-#define BS1 0020000
-#define VTDLY 0040000
-#define VT0 0000000
-#define VT1 0040000
-#define FFDLY 0100000
-#define FF0 0000000
-#define FF1 0100000
-
-/* c_cflag bit meaning */
-#define CBAUD 0010017
-#define B0 0000000 /* hang up */
-#define B50 0000001
-#define B75 0000002
-#define B110 0000003
-#define B134 0000004
-#define B150 0000005
-#define B200 0000006
-#define B300 0000007
-#define B600 0000010
-#define B1200 0000011
-#define B1800 0000012
-#define B2400 0000013
-#define B4800 0000014
-#define B9600 0000015
-#define B19200 0000016
-#define B38400 0000017
-#define EXTA B19200
-#define EXTB B38400
-#define CSIZE 0000060
-#define CS5 0000000
-#define CS6 0000020
-#define CS7 0000040
-#define CS8 0000060
-#define CSTOPB 0000100
-#define CREAD 0000200
-#define PARENB 0000400
-#define PARODD 0001000
-#define HUPCL 0002000
-#define CLOCAL 0004000
-#define CBAUDEX 0010000
-#define B57600 0010001
-#define B115200 0010002
-#define B230400 0010003
-#define B460800 0010004
-#define CIBAUD 002003600000 /* input baud rate (not used) */
-#define CRTSCTS 020000000000 /* flow control */
-
-#define RTEMS_TERMIOS_NUMBER_BAUD_RATES 20
-
-/* c_lflag bits */
-#define ISIG 0000001
-#define ICANON 0000002
-#define XCASE 0000004
-#define ECHO 0000010
-#define ECHOE 0000020
-#define ECHOK 0000040
-#define ECHONL 0000100
-#define NOFLSH 0000200
-#define TOSTOP 0000400
-#define ECHOCTL 0001000
-#define ECHOPRT 0002000
-#define ECHOKE 0004000
-#define FLUSHO 0010000
-#define PENDIN 0040000
-#define IEXTEN 0100000
-
-/* tcflow() and TCXONC use these */
-#define TCOOFF 0
-#define TCOON 1
-#define TCIOFF 2
-#define TCION 3
-
-/* tcflush() and TCFLSH use these */
-#define TCIFLUSH 0
-#define TCOFLUSH 1
-#define TCIOFLUSH 2
-
-/* tcsetattr uses these */
-#define TCSANOW 0
-#define TCSADRAIN 1
-#define TCSAFLUSH 2
-
-int tcgetattr(int, struct termios *);
-int tcsetattr(int, int, struct termios *);
-int tcdrain(int);
-speed_t cfgetospeed(const struct termios *tp);
-int cfsetospeed(struct termios *tp, speed_t speed);
-speed_t cfgetispeed(const struct termios *tp);
-int cfsetispeed(struct termios *tp, speed_t speed);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* TERMIOS_H */
diff --git a/c/src/exec/libcsupport/include/sys/utsname.h b/c/src/exec/libcsupport/include/sys/utsname.h
deleted file mode 100644
index ca15230d40..0000000000
--- a/c/src/exec/libcsupport/include/sys/utsname.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* sys/utsname.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_SYS_UTSNAME_h
-#define __POSIX_SYS_UTSNAME_h
-
-#include <sys/times.h>
-#include <sys/types.h>
-
-/*
- * 4.4.1 Get System Name (Table 4-1), P1003.1b-1993, p. 90
- *
- * NOTE: The lengths of the strings in this structure are
- * just long enough to reliably contain the RTEMS information.
- * For example, the fields are not long enough to support
- * Internet hostnames.
- */
-
-struct utsname {
- char sysname[ 32 ]; /* Name of this implementation of the operating system */
- char nodename[ 32 ]; /* Name of this node within an implementation */
- /* specified communication network */
- char release[ 32 ]; /* Current release level of this implementation */
- char version[ 32 ]; /* Current version level of this release */
- char machine[ 32 ]; /* Name of the hardware type on which the system */
- /* is running */
-};
-
-/*
- * 4.4.1 Get System Name, P1003.1b-1993, p. 90
- */
-
-int uname(
- struct utsname *name
-);
-
-/*
- * 4.5.2 Get Process Times, P1003.1b-1993, p. 92
- */
-
-clock_t times(
- struct tms *buffer
-);
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/libcsupport/include/timerdrv.h b/c/src/exec/libcsupport/include/timerdrv.h
deleted file mode 100644
index ed1ce2b9a2..0000000000
--- a/c/src/exec/libcsupport/include/timerdrv.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* timerdrv.h
- *
- * This file describes the Timer Driver for all boards.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIMER_DRIVER_h
-#define __TIMER_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* functions */
-
-void Timer_initialize( void );
-
-rtems_unsigned32 Read_timer( void );
-
-rtems_status_code Empty_function( void );
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/libcsupport/include/vmeintr.h b/c/src/exec/libcsupport/include/vmeintr.h
deleted file mode 100644
index 6593ba12a5..0000000000
--- a/c/src/exec/libcsupport/include/vmeintr.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * vmeintr.h
- *
- * This file is the specification for the VMEbus interface library
- * which should be provided by all BSPs for VMEbus Single Board
- * Computers but currently only a few do so.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __VME_INTERRUPT_h
-#define __VME_INTERRUPT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This defines the mask which is used to determine which
- * interrupt levels are affected by a call to this package.
- * The LSB corresponds to VME interrupt 0 and the MSB
- * to VME interrupt 7.
- *
- */
-
-typedef rtems_unsigned8 VME_interrupt_Mask;
-
-/*
- * VME_interrupt_Disable
- *
- */
-
-void VME_interrupt_Disable (
- VME_interrupt_Mask mask /* IN */
-);
-
-/*
- * VME_interrupt_Disable
- *
- */
-
-void VME_interrupt_Enable (
- VME_interrupt_Mask mask /* IN */
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* end of include file */
diff --git a/c/src/exec/libcsupport/include/zilog/z8036.h b/c/src/exec/libcsupport/include/zilog/z8036.h
deleted file mode 100644
index 1c53c8afac..0000000000
--- a/c/src/exec/libcsupport/include/zilog/z8036.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* z8036.h
- *
- * This include file defines information related to a Zilog Z8036
- * Counter/Timer/IO Chip. It is a memory mapped part.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: This file shares as much as possible with the include
- * file for the Z8536 via z8x36.h.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __Z8036_h
-#define __Z8036_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* macros */
-
-#define Z8036( ptr ) ((volatile struct z8036_map *)(ptr))
-
-#define Z8x36_STATE0 ( z8036 ) \
- { /*char *garbage = *(Z8036(z8036))->???; */ }
-
-
-#define Z8x36_WRITE( z8036, reg, data ) \
- (Z8036(z8036))->reg = (data)
-
-
-#define Z8x36_READ( z8036, reg, data ) \
- (Z8036(z8036))->reg = (data)
-
-/* structures */
-
-struct z8036_map {
-/* MAIN CONTROL REGISTERS (0x00-0x07) */
- rtems_unsigned8 MASTER_INTR; /* Master Interrupt Ctl Reg */
- rtems_unsigned8 MASTER_CFG; /* Master Configuration Ctl Reg */
- rtems_unsigned8 PORTA_VECTOR; /* Port A - Interrupt Vector */
- rtems_unsigned8 PORTB_VECTOR; /* Port B - Interrupt Vector */
- rtems_unsigned8 CNT_TMR_VECTOR; /* Counter/Timer Interrupt Vector */
- rtems_unsigned8 PORTC_DATA_POLARITY; /* Port C - Data Path Polarity */
- rtems_unsigned8 PORTC_DIRECTION; /* Port C - Data Direction */
- rtems_unsigned8 PORTC_SPECIAL_IO_CTL; /* Port C - Special IO Control */
-/* MOST OFTEN ACCESSED REGISTERS (0x08 - 0x0f) */
- rtems_unsigned8 PORTA_CMD_STATUS; /* Port A - Command Status Reg */
- rtems_unsigned8 PORTB_CMD_STATUS; /* Port B - Command Status Reg */
- rtems_unsigned8 CT1_CMD_STATUS; /* Ctr/Timer 1 - Command Status Reg */
- rtems_unsigned8 CT2_CMD_STATUS; /* Ctr/Timer 2 - Command Status Reg */
- rtems_unsigned8 CT3_CMD_STATUS; /* Ctr/Timer 3 - Command Status Reg */
- rtems_unsigned8 PORTA_DATA; /* Port A - Data */
- rtems_unsigned8 PORTB_DATA; /* Port B - Data */
- rtems_unsigned8 PORTC_DATA; /* Port C - Data */
-/* COUNTER/TIMER RELATED REGISTERS (0x10-0x1f) */
- rtems_unsigned8 CT1_CUR_CNT_MSB; /* Ctr/Timer 1 - Current Count (MSB) */
- rtems_unsigned8 CT1_CUR_CNT_LSB; /* Ctr/Timer 1 - Current Count (LSB) */
- rtems_unsigned8 CT2_CUR_CNT_MSB; /* Ctr/Timer 2 - Current Count (MSB) */
- rtems_unsigned8 CT2_CUR_CNT_LSB; /* Ctr/Timer 2 - Current Count (LSB) */
- rtems_unsigned8 CT3_CUR_CNT_MSB; /* Ctr/Timer 3 - Current Count (MSB) */
- rtems_unsigned8 CT3_CUR_CNT_LSB; /* Ctr/Timer 3 - Current Count (LSB) */
- rtems_unsigned8 CT1_TIME_CONST_MSB; /* Ctr/Timer 1 - Time Constant (MSB) */
- rtems_unsigned8 CT1_TIME_CONST_LSB; /* Ctr/Timer 1 - Time Constant (LSB) */
- rtems_unsigned8 CT2_TIME_CONST_MSB; /* Ctr/Timer 2 - Time Constant (MSB) */
- rtems_unsigned8 CT2_TIME_CONST_LSB; /* Ctr/Timer 2 - Time Constant (LSB) */
- rtems_unsigned8 CT3_TIME_CONST_MSB; /* Ctr/Timer 3 - Time Constant (MSB) */
- rtems_unsigned8 CT3_TIME_CONST_LSB; /* Ctr/Timer 3 - Time Constant (LSB) */
- rtems_unsigned8 CT1_MODE_SPEC; /* Ctr/Timer 1 - Mode Specification */
- rtems_unsigned8 CT2_MODE_SPEC; /* Ctr/Timer 2 - Mode Specification */
- rtems_unsigned8 CT3_MODE_SPEC; /* Ctr/Timer 3 - Mode Specification */
- rtems_unsigned8 CURRENT_VECTOR; /* Current Vector */
-/* PORT A SPECIFICATION REGISTERS (0x20 -0x27) */
- rtems_unsigned8 PORTA_MODE; /* Port A - Mode Specification */
- rtems_unsigned8 PORTA_HANDSHAKE; /* Port A - Handshake Specification */
- rtems_unsigned8 PORTA_DATA_POLARITY; /* Port A - Data Path Polarity */
- rtems_unsigned8 PORTA_DIRECTION; /* Port A - Data Direction */
- rtems_unsigned8 PORTA_SPECIAL_IO_CTL; /* Port A - Special IO Control */
- rtems_unsigned8 PORTA_PATT_POLARITY; /* Port A - Pattern Polarity */
- rtems_unsigned8 PORTA_PATT_TRANS; /* Port A - Pattern Transition */
- rtems_unsigned8 PORTA_PATT_MASK; /* Port A - Pattern Mask */
-/* PORT B SPECIFICATION REGISTERS (0x28-0x2f) */
- rtems_unsigned8 PORTB_MODE; /* Port B - Mode Specification */
- rtems_unsigned8 PORTB_HANDSHAKE; /* Port B - Handshake Specification */
- rtems_unsigned8 PORTB_DATA_POLARITY; /* Port B - Data Path Polarity */
- rtems_unsigned8 PORTB_DIRECTION; /* Port B - Data Direction */
- rtems_unsigned8 PORTB_SPECIAL_IO_CTL; /* Port B - Special IO Control */
- rtems_unsigned8 PORTB_PATT_POLARITY; /* Port B - Pattern Polarity */
- rtems_unsigned8 PORTB_PATT_TRANS; /* Port B - Pattern Transition */
- rtems_unsigned8 PORTB_PATT_MASK; /* Port B - Pattern Mask */
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/c/src/exec/libcsupport/include/zilog/z8530.h b/c/src/exec/libcsupport/include/zilog/z8530.h
deleted file mode 100644
index 60a3e3b771..0000000000
--- a/c/src/exec/libcsupport/include/zilog/z8530.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* z8530.h
- *
- * This include file defines information related to a Zilog Z8530
- * SCC Chip. It is a IO mapped part.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __Z8530_h
-#define __Z8530_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* macros */
-
-#define VOL8( ptr ) ((volatile rtems_unsigned8 *)(ptr))
-
-#define Z8x30_STATE0 ( z8530 ) \
- { char *garbage; \
- (garbage) = *(VOL8(z8530)) \
- }
-
-#define Z8x30_WRITE_CONTROL( z8530, reg, data ) \
- *(VOL8(z8530)) = (reg); \
- *(VOL8(z8530)) = (data)
-
-#define Z8x30_READ_CONTROL( z8530, reg, data ) \
- *(VOL8(z8530)) = (reg); \
- (data) = *(VOL8(z8530))
-
-#define Z8x30_WRITE_DATA( z8530, data ) \
- *(VOL8(z8530)) = (data);
-
-#define Z8x30_READ_DATA( z8530, data ) \
- (data) = *(VOL8(z8530));
-
-
-/* RR_0 Bit Definitions */
-
-#define RR_0_TX_BUFFER_EMPTY 0x04
-#define RR_0_RX_DATA_AVAILABLE 0x01
-
-/* read registers */
-
-#define RR_0 0x00
-#define RR_1 0x01
-#define RR_2 0x02
-#define RR_3 0x03
-#define RR_4 0x04
-#define RR_5 0x05
-#define RR_6 0x06
-#define RR_7 0x07
-#define RR_8 0x08
-#define RR_9 0x09
-#define RR_10 0x0A
-#define RR_11 0x0B
-#define RR_12 0x0C
-#define RR_13 0x0D
-#define RR_14 0x0E
-#define RR_15 0x0F
-
-/* write registers */
-
-#define WR_0 0x00
-#define WR_1 0x01
-#define WR_2 0x02
-#define WR_3 0x03
-#define WR_4 0x04
-#define WR_5 0x05
-#define WR_6 0x06
-#define WR_7 0x07
-#define WR_8 0x08
-#define WR_9 0x09
-#define WR_10 0x0A
-#define WR_11 0x0B
-#define WR_12 0x0C
-#define WR_13 0x0D
-#define WR_14 0x0E
-#define WR_15 0x0F
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/exec/libcsupport/include/zilog/z8536.h b/c/src/exec/libcsupport/include/zilog/z8536.h
deleted file mode 100644
index 0f0b5641e7..0000000000
--- a/c/src/exec/libcsupport/include/zilog/z8536.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* z8536.h
- *
- * This include file defines information related to a Zilog Z8536
- * Counter/Timer/IO Chip. It is a IO mapped part.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: This file shares as much as possible with the include
- * file for the Z8036 via z8x36.h.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __Z8536_h
-#define __Z8536_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* macros */
-
-#define VOL8( ptr ) ((volatile rtems_unsigned8 *)(ptr))
-
-#define Z8x36_STATE0 ( z8536 ) \
- { char *garbage; \
- (garbage) = *(VOL8(z8536+0xC)) \
- }
-
-#define Z8x36_WRITE( z8536, reg, data ) \
- *(VOL8(z8536+0xC)) = (reg); \
- *(VOL8(z8536+0xC)) = (data)
-
-#define Z8x36_READ( z8536, reg, data ) \
- *(VOL8(z8536+0xC)) = (reg); \
- (data) = *(VOL8(z8536+0xC))
-
-/* structures */
-
-/* MAIN CONTROL REGISTERS (0x00-0x07) */
-#define MASTER_INTR 0x00 /* Master Interrupt Ctl Reg */
-#define MASTER_CFG 0x01 /* Master Configuration Ctl Reg */
-#define PORTA_VECTOR 0x02 /* Port A - Interrupt Vector */
-#define PORTB_VECTOR 0x03 /* Port B - Interrupt Vector */
-#define CNT_TMR_VECTOR 0x04 /* Counter/Timer Interrupt Vector */
-#define PORTC_DATA_POLARITY 0x05 /* Port C - Data Path Polarity */
-#define PORTC_DIRECTION 0x06 /* Port C - Data Direction */
-#define PORTC_SPECIAL_IO_CTL 0x07 /* Port C - Special IO Control */
-
-/* MOST OFTEN ACCESSED REGISTERS (0x08 - 0x0f) */
-#define PORTA_CMD_STATUS 0x08 /* Port A - Command Status Reg */
-#define PORTB_CMD_STATUS 0x09 /* Port B - Command Status Reg */
-#define CT1_CMD_STATUS 0x0a /* Ctr/Timer 1 - Command Status Reg */
-#define CT2_CMD_STATUS 0x0b /* Ctr/Timer 2 - Command Status Reg */
-#define CT3_CMD_STATUS 0x0c /* Ctr/Timer 3 - Command Status Reg */
-#define PORTA_DATA 0x0d /* Port A - Data */
-#define PORTB_DATA 0x0e /* Port B - Data */
-#define PORTC_DATA 0x0f /* Port C - Data */
-
-/* COUNTER/TIMER RELATED REGISTERS (0x10-0x1f) */
-#define CT1_CUR_CNT_MSB 0x10 /* Ctr/Timer 1 - Current Count (MSB) */
-#define CT1_CUR_CNT_LSB 0x11 /* Ctr/Timer 1 - Current Count (LSB) */
-#define CT2_CUR_CNT_MSB 0x12 /* Ctr/Timer 2 - Current Count (MSB) */
-#define CT2_CUR_CNT_LSB 0x13 /* Ctr/Timer 2 - Current Count (LSB) */
-#define CT3_CUR_CNT_MSB 0x14 /* Ctr/Timer 3 - Current Count (MSB) */
-#define CT3_CUR_CNT_LSB 0x15 /* Ctr/Timer 3 - Current Count (LSB) */
-#define CT1_TIME_CONST_MSB 0x16 /* Ctr/Timer 1 - Time Constant (MSB) */
-#define CT1_TIME_CONST_LSB 0x17 /* Ctr/Timer 1 - Time Constant (LSB) */
-#define CT2_TIME_CONST_MSB 0x18 /* Ctr/Timer 2 - Time Constant (MSB) */
-#define CT2_TIME_CONST_LSB 0x19 /* Ctr/Timer 2 - Time Constant (LSB) */
-#define CT3_TIME_CONST_MSB 0x1a /* Ctr/Timer 3 - Time Constant (MSB) */
-#define CT3_TIME_CONST_LSB 0x1b /* Ctr/Timer 3 - Time Constant (LSB) */
-#define CT1_MODE_SPEC 0x1c /* Ctr/Timer 1 - Mode Specification */
-#define CT2_MODE_SPEC 0x1d /* Ctr/Timer 2 - Mode Specification */
-#define CT3_MODE_SPEC 0x1e /* Ctr/Timer 3 - Mode Specification */
-#define CURRENT_VECTOR 0x1f /* Current Vector */
-
-/* PORT A SPECIFICATION REGISTERS (0x20 -0x27) */
-#define PORTA_MODE 0x20 /* Port A - Mode Specification */
-#define PORTA_HANDSHAKE 0x21 /* Port A - Handshake Specification */
-#define PORTA_DATA_POLARITY 0x22 /* Port A - Data Path Polarity */
-#define PORTA_DIRECTION 0x23 /* Port A - Data Direction */
-#define PORTA_SPECIAL_IO_CTL 0x24 /* Port A - Special IO Control */
-#define PORTA_PATT_POLARITY 0x25 /* Port A - Pattern Polarity */
-#define PORTA_PATT_TRANS 0x26 /* Port A - Pattern Transition */
-#define PORTA_PATT_MASK 0x27 /* Port A - Pattern Mask */
-
-/* PORT B SPECIFICATION REGISTERS (0x28-0x2f) */
-#define PORTB_MODE 0x28 /* Port B - Mode Specification */
-#define PORTB_HANDSHAKE 0x29 /* Port B - Handshake Specification */
-#define PORTB_DATA_POLARITY 0x2a /* Port B - Data Path Polarity */
-#define PORTB_DIRECTION 0x2b /* Port B - Data Direction */
-#define PORTB_SPECIAL_IO_CTL 0x2c /* Port B - Special IO Control */
-#define PORTB_PATT_POLARITY 0x2d /* Port B - Pattern Polarity */
-#define PORTB_PATT_TRANS 0x2e /* Port B - Pattern Transition */
-#define PORTB_PATT_MASK 0x2f /* Port B - Pattern Mask */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/exec/libcsupport/src/README b/c/src/exec/libcsupport/src/README
deleted file mode 100644
index ee7a90501e..0000000000
--- a/c/src/exec/libcsupport/src/README
+++ /dev/null
@@ -1,37 +0,0 @@
---
--- $Id$
---
-
-Overview of newlib support (newlib is from CYGNUS)
- Each task can have its own libc state including:
- open stdio files
- strtok
- multi precision arithmetic state
- etc.
-
- This is implemented by a reentrancy data structure for each task.
-
- When a task is "started" (in RTEMS sense) the reentrancy structure
- is allocated. Its address is stored in notepad[NOTEPAD_LAST].
-
- When task is switched to, the value of global variable _impure_ptr
- is changed to the value of the new tasks reentrancy structure.
-
- When a task is deleted
- atexit() processing (for that task) happens
- task's stdio buffers are flushed
-
- When exit(3) is called
- calling task's atexit processing done
- global libc state atexit processing done
- (this will include any atexit routines installed by drivers)
- executive is shutdown
- causes a context switch back to bsp land
-
-
-NOTE:
- libc extension are installed by bsp_libc_init()
- iff we are using clock interrupts.
- This hack is necessary to allow the tmtests to avoid
- timing the extensions.
-
diff --git a/c/src/exec/libcsupport/src/__brk.c b/c/src/exec/libcsupport/src/__brk.c
deleted file mode 100644
index 4dab22c729..0000000000
--- a/c/src/exec/libcsupport/src/__brk.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#if !defined(RTEMS_UNIX)
-
-/*
- * RTEMS "Broken" __brk/__sbrk Implementation
- *
- * NOTE: sbrk is BSP provided.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#include <signal.h>
-#include <errno.h>
-#include <sys/types.h>
-#ifdef RTEMS_NEWLIB
-#include <reent.h>
-#endif
-#include <unistd.h>
-
-/* we use RTEMS for memory management. We don't need sbrk */
-
-void * __sbrk(int incr)
-{
- errno = EINVAL;
- return (void *)0;
-}
-
-int __brk( const void *endds )
-{
- errno = EINVAL;
- return -1;
-}
-
-#endif
diff --git a/c/src/exec/libcsupport/src/__gettod.c b/c/src/exec/libcsupport/src/__gettod.c
deleted file mode 100644
index dc83c47ce4..0000000000
--- a/c/src/exec/libcsupport/src/__gettod.c
+++ /dev/null
@@ -1,118 +0,0 @@
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-
-#include <rtems.h>
-
-#if !defined(RTEMS_UNIX)
-/*
- * RTEMS gettimeofday Implementation
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#ifdef RTEMS_NEWLIB
-#include <sys/reent.h>
-#endif
-
-#include <sys/time.h>
-#include <time.h>
-
-#include <errno.h>
-#include <assert.h>
-
-/*
- * Seconds from January 1, 1970 to January 1, 1988. Used to account for
- * differences between POSIX API and RTEMS core.
- */
-
-#define POSIX_TIME_SECONDS_1970_THROUGH_1988 \
- (((1987 - 1970 + 1) * TOD_SECONDS_PER_NON_LEAP_YEAR) + \
- (4 * TOD_SECONDS_PER_DAY))
-
-/*
- * NOTE: The solaris gettimeofday does not have a second parameter.
- */
-
-int gettimeofday(
- struct timeval *tp,
- struct timezone *tzp
-)
-{
- rtems_interrupt_level level;
- rtems_unsigned32 seconds;
- rtems_unsigned32 microseconds;
-
- if ( !tp ) {
- errno = EFAULT;
- return -1;
- }
-
- /*
- * POSIX does not seem to allow for not having a TOD so we just
- * grab the time of day.
- *
- * NOTE: XXX this routine should really be in the executive proper.
- */
-
- rtems_interrupt_disable(level);
- seconds = _TOD_Seconds_since_epoch;
- microseconds = _TOD_Current.ticks;
- rtems_interrupt_enable(level);
-
- tp->tv_sec = seconds + POSIX_TIME_SECONDS_1970_THROUGH_1988;
- tp->tv_usec = microseconds * _TOD_Microseconds_per_tick;
-
- /*
- * newlib does not have timezone and daylight savings time
- * yet. When it does this needs to be fixed.
- */
-
-#if 0
- if ( tzp ) {
- tzp->tz_minuteswest = 0; /* at UTC */
- tzp->tz_dsttime = 0; /* no daylight savings */
- tzp->minuteswest = timezone / 60; /* from seconds to minutes */
- tzp->dsttime = daylight;
- }
-#endif
- return 0;
-}
-
-#if defined(RTEMS_NEWLIB)
-
-/*
- * "Reentrant" version
- */
-
-int _gettimeofday_r(
- struct _reent *ignored_reentrancy_stuff,
- struct timeval *tp,
- struct timezone *tzp
-)
-{
- return gettimeofday( tp, tzp );
-}
-
-/*
- * "System call" version
- */
-
-int _gettimeofday(
- struct timeval *tp,
- struct timezone *tzp
-)
-{
- return gettimeofday( tp, tzp );
-}
-
-#endif /* defined(RTEMS_NEWLIB) */
-
-#endif
diff --git a/c/src/exec/libcsupport/src/__times.c b/c/src/exec/libcsupport/src/__times.c
deleted file mode 100644
index 635bf8e062..0000000000
--- a/c/src/exec/libcsupport/src/__times.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * RTEMS _times Implementation
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#include <sys/times.h>
-#include <time.h>
-#include <sys/time.h>
-#include <errno.h>
-#include <assert.h>
-
-clock_t _times(
- struct tms *ptms
-)
-{
- rtems_status_code status;
- rtems_interval ticks_since_boot;
-
- if ( !ptms ) {
- errno = EFAULT;
- return -1;
- }
-
- /* "POSIX" does not seem to allow for not having a TOD */
- status = rtems_clock_get(
- RTEMS_CLOCK_GET_TICKS_SINCE_BOOT,
- &ticks_since_boot
- );
- if ( status != RTEMS_SUCCESSFUL ) {
- assert( 0 );
- return -1;
- }
-
- /*
- * RTEMS has no notion of system versus user time and does
- * not (as of 3.2.0) keep track of CPU usage on a per task basis.
- */
-
- ptms->tms_utime = ticks_since_boot;
- ptms->tms_stime = 0;
- ptms->tms_cutime = 0;
- ptms->tms_cstime = 0;
-
- return 0;
-}
-
-clock_t times(
- struct tms *ptms
-)
-{
- return _times( ptms );
-}
-
-#if defined(RTEMS_NEWLIB)
-clock_t _times_r(
- struct _reent *ptr,
- struct tms *ptms
-)
-{
- return _times(ptms);
-}
-#endif
diff --git a/c/src/exec/libcsupport/src/assoc.c b/c/src/exec/libcsupport/src/assoc.c
deleted file mode 100644
index 74387a8c5b..0000000000
--- a/c/src/exec/libcsupport/src/assoc.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * assoc.c
- * rtems assoc routines
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include "assoc.h"
-
-#include <stdio.h> /* sprintf */
-#include <string.h> /* strcat, strcmp */
-
-#define STREQ(a,b) (strcmp((a), (b)) == 0)
-#define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME))
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (strcmp(ap->name, name) == 0)
- return ap;
-
- return default_ap;
-}
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (ap->local_value == local_value)
- return ap;
-
- return default_ap;
-}
-
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (ap->remote_value == remote_value)
- return ap;
-
- return default_ap;
-}
-
-
-/*
- * Get values
- */
-
-unsigned32
-rtems_assoc_remote_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_local(ap, local_value);
- if (nap)
- return nap->remote_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_local_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_remote(ap, remote_value);
- if (nap)
- return nap->local_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_remote_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_name(ap, name);
- if (nap)
- return nap->remote_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_local_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_name(ap, name);
- if (nap)
- return nap->local_value;
-
- return 0;
-}
-
-/*
- * what to return if a value is not found
- * this is not reentrant, but it really shouldn't be invoked anyway
- */
-
-const char *
-rtems_assoc_name_bad(
- unsigned32 bad_value
-)
-{
-#ifdef RTEMS_DEBUG
- static char bad_buffer[32];
-
- sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
-#else
- static char bad_buffer[32] = "<assoc.c: BAD NAME>";
-#endif
- return bad_buffer;
-}
-
-
-const char *
-rtems_assoc_name_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_local(ap, local_value);
- if (nap)
- return nap->name;
-
- return rtems_assoc_name_bad(local_value);
-}
-
-const char *
-rtems_assoc_name_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_remote(ap, remote_value);
- if (nap)
- return nap->name;
-
- return rtems_assoc_name_bad(remote_value);
-}
-
-/*
- * Bitfield functions assume just 1 bit set in each of remote and local
- * entries; they do not check for this.
- */
-
-unsigned32 rtems_assoc_remote_by_local_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- unsigned32 b;
- unsigned32 remote_value = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & local_value)
- remote_value |= rtems_assoc_remote_by_local(ap, b);
-
- return remote_value;
-}
-
-
-unsigned32 rtems_assoc_local_by_remote_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- unsigned32 b;
- unsigned32 local_value = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & remote_value)
- local_value |= rtems_assoc_local_by_remote(ap, b);
-
- return local_value;
-}
-
-char *
-rtems_assoc_name_by_remote_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 value,
- char *buffer
- )
-{
- unsigned32 b;
-
- *buffer = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (*buffer)
- strcat(buffer, " ");
- strcat(buffer, rtems_assoc_name_by_remote(ap, b));
- }
-
- return buffer;
-}
-
-char *
-rtems_assoc_name_by_local_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 value,
- char *buffer
- )
-{
- unsigned32 b;
-
- *buffer = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (*buffer)
- strcat(buffer, " ");
- strcat(buffer, rtems_assoc_name_by_local(ap, b));
- }
-
- return buffer;
-}
diff --git a/c/src/exec/libcsupport/src/closedir.c b/c/src/exec/libcsupport/src/closedir.c
deleted file mode 100644
index 5edb3499e6..0000000000
--- a/c/src/exec/libcsupport/src/closedir.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * closedir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-
-#include <sys/types.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-
-int closedir(
- register DIR *dirp
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/libcsupport/src/error.c b/c/src/exec/libcsupport/src/error.c
deleted file mode 100644
index dd32fb8b66..0000000000
--- a/c/src/exec/libcsupport/src/error.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * report errors and panics to RTEMS' stderr.
- * Currently just used by RTEMS monitor.
- *
- * $Id$
- */
-
-
-/*
- * These routines provide general purpose error reporting.
- * rtems_error reports an error to stderr and allows use of
- * printf style formatting. A newline is appended to all messages.
- *
- * error_flag can be specified as any of the following:
- *
- * RTEMS_ERROR_ERRNO -- include errno text in output
- * RTEMS_ERROR_PANIC -- halts local system after output
- * RTEMS_ERROR_ABORT -- abort after output
- *
- * It can also include a rtems_status value which can be OR'd
- * with the above flags. *
- *
- * EXAMPLE
- * #include <rtems.h>
- * #include <rtems/error.h>
- * rtems_error(0, "stray interrupt %d", intr);
- *
- * EXAMPLE
- * if ((status = rtems_task_create(...)) != RTEMS_SUCCCESSFUL)
- * {
- * rtems_error(status | RTEMS_ERROR_ABORT,
- * "could not create task");
- * }
- *
- * EXAMPLE
- * if ((fd = open(pathname, O_RDNLY)) < 0)
- * {
- * rtems_error(RTEMS_ERROR_ERRNO, "open of '%s' failed", pathname);
- * goto failed;
- * }
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-
-#include "error.h"
-#include <rtems/assoc.h>
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h> /* _exit() */
-
-/* bug in hpux <errno.h>: no prototypes unless you are C++ */
-#ifdef hpux9
-char *strerror(int);
-#endif
-
-extern char *rtems_progname;
-int rtems_panic_in_progress;
-
-rtems_assoc_t rtems_status_assoc[] = {
- { "successful completion", RTEMS_SUCCESSFUL, },
- { "returned from a thread", RTEMS_TASK_EXITTED, },
- { "multiprocessing not configured", RTEMS_MP_NOT_CONFIGURED, },
- { "invalid object name", RTEMS_INVALID_NAME, },
- { "invalid object id", RTEMS_INVALID_ID, },
- { "too many", RTEMS_TOO_MANY, },
- { "timed out waiting", RTEMS_TIMEOUT, },
- { "object deleted while waiting", RTEMS_OBJECT_WAS_DELETED, },
- { "specified size was invalid", RTEMS_INVALID_SIZE, },
- { "address specified is invalid", RTEMS_INVALID_ADDRESS, },
- { "number was invalid", RTEMS_INVALID_NUMBER, },
- { "item has not been initialized", RTEMS_NOT_DEFINED, },
- { "resources still outstanding", RTEMS_RESOURCE_IN_USE, },
- { "request not satisfied", RTEMS_UNSATISFIED, },
- { "thread is in wrong state", RTEMS_INCORRECT_STATE, },
- { "thread already in state", RTEMS_ALREADY_SUSPENDED, },
- { "illegal on calling thread", RTEMS_ILLEGAL_ON_SELF, },
- { "illegal for remote object", RTEMS_ILLEGAL_ON_REMOTE_OBJECT, },
- { "called from wrong environment", RTEMS_CALLED_FROM_ISR, },
- { "invalid thread priority", RTEMS_INVALID_PRIORITY, },
- { "invalid date/time", RTEMS_INVALID_CLOCK, },
- { "invalid node id", RTEMS_INVALID_NODE, },
- { "directive not configured", RTEMS_NOT_CONFIGURED, },
- { "not owner of resource", RTEMS_NOT_OWNER_OF_RESOURCE , },
- { "directive not implemented", RTEMS_NOT_IMPLEMENTED, },
- { "RTEMS inconsistency detected", RTEMS_INTERNAL_ERROR, },
- { "could not get enough memory", RTEMS_NO_MEMORY, },
- { "internal multiprocessing only", THREAD_STATUS_PROXY_BLOCKING, },
- { 0, 0, 0 },
-};
-
-
-const char *
-rtems_status_text(
- rtems_status_code status
-)
-{
- return rtems_assoc_name_by_local(rtems_status_assoc, status);
-}
-
-
-static int rtems_verror(
- unsigned32 error_flag,
- const char *printf_format,
- va_list arglist
-)
-{
- int local_errno = 0;
- int chars_written = 0;
- rtems_status_code status;
-
- if (error_flag & RTEMS_ERROR_PANIC)
- {
- if (rtems_panic_in_progress++)
- _Thread_Disable_dispatch(); /* disable task switches */
-
- /* don't aggravate things */
- if (rtems_panic_in_progress > 2)
- return 0;
- }
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- status = error_flag & ~RTEMS_ERROR_MASK;
- if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
- local_errno = errno;
-
- if (_System_state_Is_multiprocessing)
- fprintf(stderr, "[%d] ", _Configuration_MP_table->node);
-
- if (rtems_progname && *rtems_progname)
- chars_written += fprintf(stderr, "%s: ", rtems_progname);
- chars_written += vfprintf(stderr, printf_format, arglist);
-
- if (status)
- chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status));
-
- if (local_errno)
- {
- if ((local_errno > 0) && *strerror(local_errno))
- chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
- else
- chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
- }
-
- chars_written += fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (RTEMS_ERROR_PANIC | RTEMS_ERROR_ABORT))
- {
- if (error_flag & RTEMS_ERROR_PANIC)
- {
- rtems_error(0, "fatal error, exiting");
- _exit(local_errno);
- }
- else
- {
- rtems_error(0, "fatal error, aborting");
- abort();
- }
- }
- return chars_written;
-}
-
-
-/*
- * Report an error.
- * error_flag is as above; printf_format is a normal
- * printf(3) format string, with its concommitant arguments.
- *
- * Returns the number of characters written.
- */
-
-int rtems_error(
- int error_flag,
- const char *printf_format,
- ...
- )
-{
- va_list arglist;
- int chars_written;
-
- va_start(arglist, printf_format);
- chars_written = rtems_verror(error_flag, printf_format, arglist);
- va_end(arglist);
-
- return chars_written;
-}
-
-/*
- * rtems_panic is shorthand for rtems_error(RTEMS_ERROR_PANIC, ...)
- */
-
-void rtems_panic(
- const char *printf_format,
- ...
- )
-{
- va_list arglist;
-
- va_start(arglist, printf_format);
- (void) rtems_verror(RTEMS_ERROR_PANIC, printf_format, arglist);
- va_end(arglist);
-}
diff --git a/c/src/exec/libcsupport/src/getdents.c b/c/src/exec/libcsupport/src/getdents.c
deleted file mode 100644
index 9b16d82409..0000000000
--- a/c/src/exec/libcsupport/src/getdents.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Just enough to make newlib return an error.
- *
- * $Id$
- */
-
-int getdents(
- int fd,
- void *buf,
- int len
-)
-{
- return -1;
-}
diff --git a/c/src/exec/libcsupport/src/hosterr.c b/c/src/exec/libcsupport/src/hosterr.c
deleted file mode 100644
index a55e4a7e84..0000000000
--- a/c/src/exec/libcsupport/src/hosterr.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Routines to access a host errno
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <errno.h>
-
-int host_errno(void);
-
-/*
- * copy host errno, if any to thread aware errno, if any
- */
-
-void fix_syscall_errno(void)
-{
- errno = host_errno();
-}
-
-/*
- * Get the host system errno, if any
- * When using newlib (or possibly other libc's) on top of UNIX
- * the errno returned by system calls may be unavailable due
- * to trickery of making errno thread aware.
- * This provides a kludge of getting at it.
- */
-
-#undef errno
-extern int errno;
-int host_errno(void)
-{
- return errno;
-}
-
diff --git a/c/src/exec/libcsupport/src/libio.c b/c/src/exec/libcsupport/src/libio.c
deleted file mode 100644
index 12682c1190..0000000000
--- a/c/src/exec/libcsupport/src/libio.c
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
- * Provide UNIX/POSIX-like io system calls for RTEMS using the
- * RTEMS IO manager
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/assoc.h> /* assoc.h not included by rtems.h */
-
-#include <stdio.h> /* O_RDONLY, et.al. */
-#include <fcntl.h> /* O_RDONLY, et.al. */
-#include <assert.h>
-
-#if ! defined(O_NDELAY)
-# if defined(solaris2)
-# define O_NDELAY O_NONBLOCK
-# elif defined(RTEMS_NEWLIB)
-# define O_NDELAY _FNBIO
-# endif
-#endif
-
-
-#include <errno.h>
-#include <string.h> /* strcmp */
-#include <unistd.h>
-#include <stdlib.h> /* calloc() */
-
-#include "libio.h" /* libio.h not pulled in by rtems */
-
-/*
- * Semaphore to protect the io table
- */
-
-Objects_Id rtems_libio_semaphore;
-
-#define RTEMS_LIBIO_SEM rtems_build_name('L', 'B', 'I', 'O')
-#define RTEMS_LIBIO_IOP_SEM(n) rtems_build_name('L', 'B', 'I', n)
-
-extern unsigned32 rtems_libio_number_iops;
-rtems_libio_t *rtems_libio_iops;
-rtems_libio_t *rtems_libio_last_iop;
-
-#define rtems_libio_iop(fd) ((((unsigned32)(fd)) < rtems_libio_number_iops) ? \
- &rtems_libio_iops[fd] : 0)
-
-#define rtems_libio_check_fd(fd) \
- do { \
- if ((unsigned32) (fd) >= rtems_libio_number_iops) \
- { \
- errno = EBADF; \
- return -1; \
- } \
- } while (0)
-
-#define rtems_libio_check_buffer(buffer) \
- do { \
- if ((buffer) == 0) \
- { \
- errno = EINVAL; \
- return -1; \
- } \
- } while (0)
-
-#define rtems_libio_check_count(count) \
- do { \
- if ((count) == 0) \
- { \
- return 0; \
- } \
- } while (0)
-
-#define rtems_libio_check_permissions(iop, flag) \
- do { \
- if (((iop)->flags & (flag)) == 0) \
- { \
- errno = EINVAL; \
- return -1; \
- } \
- } while (0)
-
-/*
- * External I/O handlers
- *
- * Space for all possible handlers is preallocated
- * to speed up dispatch to external handlers.
- */
-
-static rtems_libio_handler_t handlers[15];
-
-void
-rtems_register_libio_handler(
- int handler_flag,
- const rtems_libio_handler_t *handler
-)
-{
- int handler_index = rtems_file_descriptor_type_index(handler_flag);
-
- if ((handler_index < 0) || (handler_index >= 15))
- rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER );
- handlers[handler_index] = *handler;
-}
-
-/*
- * Called by bsp startup code to init the libio area.
- */
-
-void
-rtems_libio_init(void)
-{
- rtems_status_code rc;
-
- if (rtems_libio_number_iops > 0)
- {
- rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops,
- sizeof(rtems_libio_t));
- if (rtems_libio_iops == NULL)
- rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
-
- rtems_libio_last_iop = rtems_libio_iops + (rtems_libio_number_iops - 1);
- }
-
- rc = rtems_semaphore_create(
- RTEMS_LIBIO_SEM,
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &rtems_libio_semaphore
- );
- if (rc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(rc);
-}
-
-/*
- * Convert RTEMS status to a UNIX errno
- */
-
-rtems_assoc_t errno_assoc[] = {
- { "OK", RTEMS_SUCCESSFUL, 0 },
- { "BUSY", RTEMS_RESOURCE_IN_USE, EBUSY },
- { "INVALID NAME", RTEMS_INVALID_NAME, EINVAL },
- { "NOT IMPLEMENTED", RTEMS_NOT_IMPLEMENTED, ENOSYS },
- { "TIMEOUT", RTEMS_TIMEOUT, ETIMEDOUT },
- { "NO MEMORY", RTEMS_NO_MEMORY, ENOMEM },
- { "NO DEVICE", RTEMS_UNSATISFIED, ENODEV },
- { "INVALID NUMBER", RTEMS_INVALID_NUMBER, EBADF},
- { "NOT RESOURCE OWNER", RTEMS_NOT_OWNER_OF_RESOURCE, EPERM},
- { "IO ERROR", RTEMS_IO_ERROR, EIO},
- { 0, 0, 0 },
-};
-
-static unsigned32
-rtems_libio_errno(rtems_status_code code)
-{
- int rc;
-
- if ((rc = rtems_assoc_remote_by_local(errno_assoc, (unsigned32) code)))
- {
- errno = rc;
- return -1;
- }
- return -1;
-}
-
-/*
- * Convert UNIX fnctl(2) flags to ones that RTEMS drivers understand
- */
-
-rtems_assoc_t access_modes_assoc[] = {
- { "READ", LIBIO_FLAGS_READ, O_RDONLY },
- { "WRITE", LIBIO_FLAGS_WRITE, O_WRONLY },
- { "READ/WRITE", LIBIO_FLAGS_READ_WRITE, O_RDWR },
- { 0, 0, 0 },
-};
-
-rtems_assoc_t status_flags_assoc[] = {
- { "NO DELAY", LIBIO_FLAGS_NO_DELAY, O_NDELAY },
- { "APPEND", LIBIO_FLAGS_APPEND, O_APPEND },
- { "CREATE", LIBIO_FLAGS_CREATE, O_CREAT },
- { 0, 0, 0 },
-};
-
-static unsigned32
-rtems_libio_fcntl_flags(unsigned32 fcntl_flags)
-{
- unsigned32 flags = 0;
- unsigned32 access_modes;
-
- /*
- * Access mode is a small integer
- */
-
- access_modes = fcntl_flags & O_ACCMODE;
- fcntl_flags &= ~O_ACCMODE;
- flags = rtems_assoc_local_by_remote(access_modes_assoc, access_modes);
-
- /*
- * Everything else is single bits
- */
-
- flags |= rtems_assoc_local_by_remote_bitfield(status_flags_assoc, fcntl_flags);
- return flags;
-}
-
-
-static rtems_libio_t *
-rtems_libio_allocate(void)
-{
- rtems_libio_t *iop;
- rtems_status_code rc;
-
- rtems_semaphore_obtain(rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-
- for (iop = rtems_libio_iops; iop <= rtems_libio_last_iop; iop++)
- if ((iop->flags & LIBIO_FLAGS_OPEN) == 0)
- {
- /*
- * Got one; create a semaphore for it
- */
-
- rc = rtems_semaphore_create(
- RTEMS_LIBIO_IOP_SEM(iop - rtems_libio_iops),
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &iop->sem
- );
- if (rc != RTEMS_SUCCESSFUL)
- goto failed;
-
- iop->flags = LIBIO_FLAGS_OPEN;
- goto done;
- }
-
-failed:
- iop = 0;
-
-done:
- rtems_semaphore_release(rtems_libio_semaphore);
- return iop;
-}
-
-static void
-rtems_libio_free(rtems_libio_t *iop)
-{
- rtems_semaphore_obtain(rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-
- if (iop->sem)
- rtems_semaphore_delete(iop->sem);
- (void) memset(iop, 0, sizeof(*iop));
-
- rtems_semaphore_release(rtems_libio_semaphore);
-}
-
-int
-__rtems_open(
- const char *pathname,
- unsigned32 flag,
- unsigned32 mode)
-{
- rtems_status_code rc;
- rtems_libio_t *iop = 0;
- rtems_driver_name_t *np;
- rtems_libio_open_close_args_t args;
-
- /*
- * Additional external I/O handlers would be supported by
- * adding code to pick apart the pathname appropriately.
- * The networking code does not require changes here since
- * network file descriptors are obtained using socket(), not
- * open().
- */
-
- if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL)
- goto done;
-
- iop = rtems_libio_allocate();
- if (iop == 0)
- {
- rc = RTEMS_TOO_MANY;
- goto done;
- }
-
- iop->driver = np;
- iop->pathname = (char *) pathname;
- iop->flags |= rtems_libio_fcntl_flags(flag);
-
- args.iop = iop;
- args.flags = iop->flags;
- args.mode = mode;
-
- rc = rtems_io_open(np->major, np->minor, (void *) &args);
-
-done:
-
- if (rc != RTEMS_SUCCESSFUL)
- {
- if (iop)
- rtems_libio_free(iop);
- return rtems_libio_errno(rc);
- }
-
- return iop - rtems_libio_iops;
-}
-
-int
-__rtems_close(
- int fd
- )
-{
- rtems_status_code rc;
- rtems_driver_name_t *np;
- rtems_libio_t *iop;
- rtems_libio_open_close_args_t args;
- int status;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].close;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- status = (*fp)(fd);
- return status;
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
-
- np = iop->driver;
-
- args.iop = iop;
- args.flags = 0;
- args.mode = 0;
-
- rc = rtems_io_close(np->major, np->minor, (void *) &args);
-
- rtems_libio_free(iop);
-
- if (rc != RTEMS_SUCCESSFUL)
- return rtems_libio_errno(rc);
- return 0;
-}
-
-int
-__rtems_read(
- int fd,
- void * buffer,
- unsigned32 count
- )
-{
- rtems_status_code rc;
- rtems_driver_name_t *np;
- rtems_libio_t *iop;
- rtems_libio_rw_args_t args;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd, void *buffer, unsigned32 count);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].read;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- return (*fp)(fd, buffer, count);
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
- rtems_libio_check_buffer(buffer);
- rtems_libio_check_count(count);
- rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ);
-
- np = iop->driver;
-
- args.iop = iop;
- args.offset = iop->offset;
- args.buffer = buffer;
- args.count = count;
- args.flags = iop->flags;
- args.bytes_moved = 0;
-
- rc = rtems_io_read(np->major, np->minor, (void *) &args);
-
- iop->offset += args.bytes_moved;
-
- if (rc != RTEMS_SUCCESSFUL)
- return rtems_libio_errno(rc);
-
- return args.bytes_moved;
-}
-
-int
-__rtems_write(
- int fd,
- const void *buffer,
- unsigned32 count
- )
-{
- rtems_status_code rc;
- rtems_driver_name_t *np;
- rtems_libio_t *iop;
- rtems_libio_rw_args_t args;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd, const void *buffer, unsigned32 count);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].write;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- return (*fp)(fd, buffer, count);
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
- rtems_libio_check_buffer(buffer);
- rtems_libio_check_count(count);
- rtems_libio_check_permissions(iop, LIBIO_FLAGS_WRITE);
-
- np = iop->driver;
-
- args.iop = iop;
- args.offset = iop->offset;
- args.buffer = (void *) buffer;
- args.count = count;
- args.flags = iop->flags;
- args.bytes_moved = 0;
-
- rc = rtems_io_write(np->major, np->minor, (void *) &args);
-
- iop->offset += args.bytes_moved;
-
- if (rc != RTEMS_SUCCESSFUL)
- return rtems_libio_errno(rc);
-
- return args.bytes_moved;
-}
-
-int
-__rtems_ioctl(
- int fd,
- unsigned32 command,
- void * buffer)
-{
- rtems_status_code rc;
- rtems_driver_name_t *np;
- rtems_libio_t *iop;
- rtems_libio_ioctl_args_t args;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd, unsigned32 command, void *buffer);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].ioctl;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- return (*fp)(fd, command, buffer);
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
-
- np = iop->driver;
-
- args.iop = iop;
- args.command = command;
- args.buffer = buffer;
-
- rc = rtems_io_control(np->major, np->minor, (void *) &args);
-
- if (rc != RTEMS_SUCCESSFUL)
- return rtems_libio_errno(rc);
-
- return args.ioctl_return;
-}
-
-/*
- * internal only??
- */
-
-
-int
-__rtems_lseek(
- int fd,
- rtems_libio_offset_t offset,
- int whence
- )
-{
- rtems_libio_t *iop;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd, rtems_libio_offset_t offset, int whence);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].lseek;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- return (*fp)(fd, offset, whence);
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
-
- switch (whence)
- {
- case SEEK_SET:
- iop->offset = offset;
- break;
-
- case SEEK_CUR:
- iop->offset += offset;
- break;
-
- case SEEK_END:
- iop->offset = iop->size - offset;
- break;
-
- default:
- errno = EINVAL;
- return -1;
- }
- return 0;
-}
diff --git a/c/src/exec/libcsupport/src/malloc.c b/c/src/exec/libcsupport/src/malloc.c
deleted file mode 100644
index fac38585a7..0000000000
--- a/c/src/exec/libcsupport/src/malloc.c
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * RTEMS Malloc Family Implementation
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include "libcsupport.h"
-#ifdef RTEMS_NEWLIB
-#include <sys/reent.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <assert.h>
-#include <errno.h>
-#include <string.h>
-
-/* for sbrk prototype in linux */
-#if defined(__linux__)
-#define __USE_MISC
-#endif
-#include <unistd.h> /* sbrk(2) */
-
-rtems_id RTEMS_Malloc_Heap;
-size_t RTEMS_Malloc_Sbrk_amount;
-
-extern rtems_cpu_table Cpu_table;
-#ifdef RTEMS_DEBUG
-#define MALLOC_STATS
-#define MALLOC_DIRTY
-#endif
-
-#ifdef MALLOC_STATS
-#define MSBUMP(f,n) rtems_malloc_stats.f += (n)
-
-struct {
- unsigned32 space_available; /* current size of malloc area */
- unsigned32 malloc_calls; /* # calls to malloc */
- unsigned32 free_calls;
- unsigned32 realloc_calls;
- unsigned32 calloc_calls;
- unsigned32 max_depth; /* most ever malloc'd at 1 time */
- unsigned64 lifetime_allocated;
- unsigned64 lifetime_freed;
-} rtems_malloc_stats;
-
-#else /* No rtems_malloc_stats */
-#define MSBUMP(f,n)
-#endif
-
-void RTEMS_Malloc_Initialize(
- void *start,
- size_t length,
- size_t sbrk_amount
-)
-{
- rtems_status_code status;
- void *starting_address;
- rtems_unsigned32 old_address;
- rtems_unsigned32 u32_address;
-
- /*
- * If the starting address is 0 then we are to attempt to
- * get length worth of memory using sbrk. Make sure we
- * align the address that we get back.
- */
-
- starting_address = start;
- RTEMS_Malloc_Sbrk_amount = sbrk_amount;
-
- if (!starting_address) {
- u32_address = (unsigned int)sbrk(length);
-
- if (u32_address == (rtems_unsigned32) -1) {
- rtems_fatal_error_occurred( RTEMS_NO_MEMORY );
- /* DOES NOT RETURN!!! */
- }
-
- if (u32_address & (CPU_ALIGNMENT-1)) {
- old_address = u32_address;
- u32_address = (u32_address + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- /*
- * adjust the length by whatever we aligned by
- */
-
- length -= u32_address - old_address;
- }
-
- starting_address = (void *)u32_address;
- }
-
- /*
- * If the BSP is not clearing out the workspace, then it is most likely
- * not clearing out the initial memory for the heap. There is no
- * standard supporting zeroing out the heap memory. But much code
- * with UNIX history seems to assume that memory malloc'ed during
- * initialization (before any free's) is zero'ed. This is true most
- * of the time under UNIX because zero'ing memory when it is first
- * given to a process eliminates the chance of a process seeing data
- * left over from another process. This would be a security violation.
- */
-
- if ( Cpu_table.do_zero_of_workspace )
- memset( starting_address, 0, length );
-
- /*
- * Unfortunately we cannot use assert if this fails because if this
- * has failed we do not have a heap and if we do not have a heap
- * STDIO cannot work because there will be no buffers.
- */
-
- status = rtems_region_create(
- rtems_build_name( 'H', 'E', 'A', 'P' ),
- starting_address,
- length,
- CPU_ALIGNMENT,
- RTEMS_DEFAULT_ATTRIBUTES,
- &RTEMS_Malloc_Heap
- );
- if ( status != RTEMS_SUCCESSFUL )
- rtems_fatal_error_occurred( status );
-
-#ifdef MALLOC_STATS
- /* zero all the stats */
- (void) memset(&rtems_malloc_stats, 0, sizeof(rtems_malloc_stats));
-#endif
-
- MSBUMP(space_available, length);
-}
-
-#ifdef RTEMS_NEWLIB
-void *malloc(
- size_t size
-)
-{
- void *return_this;
- void *starting_address;
- rtems_unsigned32 the_size;
- rtems_unsigned32 sbrk_amount;
- rtems_status_code status;
-
- MSBUMP(malloc_calls, 1);
-
- if ( !size )
- return (void *) 0;
-
- /*
- * Try to give a segment in the current region if there is not
- * enough space then try to grow the region using rtems_region_extend().
- * If this fails then return a NULL pointer.
- */
-
- status = rtems_region_get_segment(
- RTEMS_Malloc_Heap,
- size,
- RTEMS_NO_WAIT,
- RTEMS_NO_TIMEOUT,
- &return_this
- );
-
- if ( status != RTEMS_SUCCESSFUL ) {
- /*
- * Round to the "requested sbrk amount" so hopefully we won't have
- * to grow again for a while. This effectively does sbrk() calls
- * in "page" amounts.
- */
-
- sbrk_amount = RTEMS_Malloc_Sbrk_amount;
-
- if ( sbrk_amount == 0 )
- return (void *) 0;
-
- the_size = ((size + sbrk_amount) / sbrk_amount * sbrk_amount);
-
- if (((rtems_unsigned32)starting_address = (void *)sbrk(the_size))
- == (rtems_unsigned32) -1)
- return (void *) 0;
-
- status = rtems_region_extend(
- RTEMS_Malloc_Heap,
- starting_address,
- the_size
- );
- if ( status != RTEMS_SUCCESSFUL ) {
- sbrk(-the_size);
- errno = ENOMEM;
- return (void *) 0;
- }
-
- MSBUMP(space_available, the_size);
-
- status = rtems_region_get_segment(
- RTEMS_Malloc_Heap,
- size,
- RTEMS_NO_WAIT,
- RTEMS_NO_TIMEOUT,
- &return_this
- );
- if ( status != RTEMS_SUCCESSFUL ) {
- errno = ENOMEM;
- return (void *) 0;
- }
- }
-
-#ifdef MALLOC_STATS
- if (return_this)
- {
- unsigned32 actual_size;
- unsigned32 current_depth;
- status = rtems_region_get_segment_size(RTEMS_Malloc_Heap, return_this, &actual_size);
- MSBUMP(lifetime_allocated, actual_size);
- current_depth = rtems_malloc_stats.lifetime_allocated - rtems_malloc_stats.lifetime_freed;
- if (current_depth > rtems_malloc_stats.max_depth)
- rtems_malloc_stats.max_depth = current_depth;
- }
-#endif
-
-#ifdef MALLOC_DIRTY
- (void) memset(return_this, 0xCF, size);
-#endif
-
- return return_this;
-}
-
-void *calloc(
- size_t nelem,
- size_t elsize
-)
-{
- register char *cptr;
- int length;
-
- MSBUMP(calloc_calls, 1);
-
- length = nelem * elsize;
- cptr = malloc( length );
- if ( cptr )
- memset( cptr, '\0', length );
-
- MSBUMP(malloc_calls, -1); /* subtract off the malloc */
-
- return cptr;
-}
-
-void *realloc(
- void *ptr,
- size_t size
-)
-{
- rtems_unsigned32 old_size;
- rtems_status_code status;
- char *new_area;
-
- MSBUMP(realloc_calls, 1);
-
- if ( !ptr )
- return malloc( size );
-
- if ( !size ) {
- free( ptr );
- return (void *) 0;
- }
-
- new_area = malloc( size );
-
- MSBUMP(malloc_calls, -1); /* subtract off the malloc */
-
- if ( !new_area ) {
- free( ptr );
- return (void *) 0;
- }
-
- status = rtems_region_get_segment_size( RTEMS_Malloc_Heap, ptr, &old_size );
- if ( status != RTEMS_SUCCESSFUL ) {
- errno = EINVAL;
- return (void *) 0;
- }
-
- memcpy( new_area, ptr, (size < old_size) ? size : old_size );
- free( ptr );
-
- return new_area;
-
-}
-
-void free(
- void *ptr
-)
-{
- rtems_status_code status;
-
- MSBUMP(free_calls, 1);
-
- if ( !ptr )
- return;
-
-#ifdef MALLOC_STATS
- {
- unsigned32 size;
- status = rtems_region_get_segment_size( RTEMS_Malloc_Heap, ptr, &size );
- if ( status == RTEMS_SUCCESSFUL ) {
- MSBUMP(lifetime_freed, size);
- }
- }
-#endif
-
- status = rtems_region_return_segment( RTEMS_Malloc_Heap, ptr );
- if ( status != RTEMS_SUCCESSFUL ) {
- errno = EINVAL;
- assert( 0 );
- }
-}
-/* end if RTEMS_NEWLIB */
-#endif
-
-#ifdef MALLOC_STATS
-/*
- * Dump the malloc statistics
- * May be called via atexit() (installable by our bsp) or
- * at any time by user
- */
-
-void malloc_dump(void)
-{
- unsigned32 allocated = rtems_malloc_stats.lifetime_allocated - rtems_malloc_stats.lifetime_freed;
-
- printf("Malloc stats\n");
- printf(" avail:%uk allocated:%uk (%d%%) max:%uk (%d%%) lifetime:%Luk freed:%Luk\n",
- (unsigned int) rtems_malloc_stats.space_available / 1024,
- (unsigned int) allocated / 1024,
- /* avoid float! */
- (allocated * 100) / rtems_malloc_stats.space_available,
- (unsigned int) rtems_malloc_stats.max_depth / 1024,
- (rtems_malloc_stats.max_depth * 100) / rtems_malloc_stats.space_available,
- (unsigned64) rtems_malloc_stats.lifetime_allocated / 1024,
- (unsigned64) rtems_malloc_stats.lifetime_freed / 1024);
- printf(" Call counts: malloc:%d free:%d realloc:%d calloc:%d\n",
- rtems_malloc_stats.malloc_calls,
- rtems_malloc_stats.free_calls,
- rtems_malloc_stats.realloc_calls,
- rtems_malloc_stats.calloc_calls);
-}
-
-
-void malloc_walk(size_t source, size_t printf_enabled)
-{
- register Region_Control *the_region;
- Objects_Locations location;
-
- the_region = _Region_Get( RTEMS_Malloc_Heap, &location );
- if ( location == OBJECTS_LOCAL )
- {
- _Heap_Walk( &the_region->Memory, source, printf_enabled );
- _Thread_Enable_dispatch();
- }
-}
-
-#else
-
-void malloc_dump(void)
-{
- return;
-}
-
-void malloc_walk(size_t source, size_t printf_enabled)
-{
- return;
-}
-
-#endif
-
-/*
- * "Reentrant" versions of the above routines implemented above.
- */
-
-#ifdef RTEMS_NEWLIB
-void *_malloc_r(
- struct _reent *ignored,
- size_t size
-)
-{
- return malloc( size );
-}
-
-void *_calloc_r(
- struct _reent *ignored,
- size_t nelem,
- size_t elsize
-)
-{
- return calloc( nelem, elsize );
-}
-
-void *_realloc_r(
- struct _reent *ignored,
- void *ptr,
- size_t size
-)
-{
- return realloc( ptr, size );
-}
-
-void _free_r(
- struct _reent *ignored,
- void *ptr
-)
-{
- free( ptr );
-}
-#endif
-
diff --git a/c/src/exec/libcsupport/src/newlibc.c b/c/src/exec/libcsupport/src/newlibc.c
deleted file mode 100644
index a6acc1c8d7..0000000000
--- a/c/src/exec/libcsupport/src/newlibc.c
+++ /dev/null
@@ -1,429 +0,0 @@
-
-/*
- * COPYRIGHT (c) 1994 by Division Incorporated
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Description:
- * Implementation of hooks for the CYGNUS newlib libc
- * These hooks set things up so that:
- * '_REENT' is switched at task switch time.
- *
- *
- * TODO:
- *
- * NOTE:
- *
- * $Id$
- *
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-
-#if defined(RTEMS_NEWLIB)
-#include <libcsupport.h>
-#include <stdlib.h> /* for free() */
-#include <string.h> /* for memset() */
-
-#include <sys/reent.h> /* for extern of _REENT (aka _impure_ptr) */
-#include <errno.h>
-
-/*
- * NOTE:
- * There is some problem with doing this on the hpux version
- * of the UNIX simulator (symptom is printf core dumps), so
- * we just don't for now.
- * Not sure if this is a problem with hpux, newlib, or something else.
- */
-
-#if defined(RTEMS_UNIX) && !defined(hpux)
-#define NEED_SETVBUF
-#endif
-
-#ifdef NEED_SETVBUF
-#include <stdio.h>
-#endif
-
-#include "internal.h"
-
-#define LIBC_NOTEPAD RTEMS_NOTEPAD_LAST
-
-
-int libc_reentrant; /* do we think we are reentrant? */
-struct _reent libc_global_reent = _REENT_INIT(libc_global_reent);
-
-/*
- * CYGNUS newlib routine that does atexit() processing and flushes
- * stdio streams
- * undocumented
- */
-
-extern void _wrapup_reent(struct _reent *);
-extern void _reclaim_reent(struct _reent *);
-
-#include <stdio.h>
-
-void
-libc_wrapup(void)
-{
- /*
- * In case RTEMS is already down, don't do this. It could be
- * dangerous.
- */
-
- if (!_System_state_Is_up(_System_state_Get()))
- return;
-
- _wrapup_reent(0);
- if (_REENT != &libc_global_reent)
- {
- _wrapup_reent(&libc_global_reent);
-#if 0
- /* don't reclaim this one, just in case we do printfs */
- /* on our way out to ROM */
- _reclaim_reent(&libc_global_reent);
-#endif
- _REENT = &libc_global_reent;
- }
-
- /*
- * Try to drain output buffers.
- *
- * Should this be changed to do *all* file streams?
- * _fwalk (_REENT, fclose);
- */
- fclose (stdin);
- fclose (stdout);
- fclose (stderr);
-}
-
-
-rtems_boolean
-libc_create_hook(rtems_tcb *current_task,
- rtems_tcb *creating_task)
-{
- MY_task_set_note(creating_task, LIBC_NOTEPAD, 0);
- return TRUE;
-}
-
-/*
- * Called for all user TASKS (system tasks are MPCI Receive Server and IDLE)
- */
-
-rtems_extension
-libc_start_hook(rtems_tcb *current_task,
- rtems_tcb *starting_task)
-{
- struct _reent *ptr;
-
- /* NOTE: our malloc is reentrant without a reent ptr since
- * it is based on region manager
- */
-
- ptr = (struct _reent *) calloc(1, sizeof(struct _reent));
-
- if (!ptr)
- rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
-
-#ifdef __GNUC__
- /* GCC extension: structure constants */
- *ptr = (struct _reent) _REENT_INIT((*ptr));
-#else
- /*
- * Warning: THIS IS VERY DEPENDENT ON NEWLIB!!! WRITTEN FOR 1.7.0
- */
- ptr->_errno=0;
- ptr->_stdin=&ptr->__sf[0];
- ptr->_stdout=&ptr->__sf[1];
- ptr->_stderr=&ptr->__sf[2];
- ptr->_scanpoint=0;
- ptr->_asctime[0]=0;
- ptr->_next=1;
- ptr->__sdidinit=0;
-#endif
-
- MY_task_set_note(starting_task, LIBC_NOTEPAD, (rtems_unsigned32) ptr);
-}
-
-/*
- * Called for all user TASKS (system tasks are MPCI Receive Server and IDLE)
- */
-
-#ifdef NEED_SETVBUF
-rtems_extension
-libc_begin_hook(rtems_tcb *current_task)
-{
- setvbuf( stdout, NULL, _IOLBF, BUFSIZ );
-}
-#endif
-
-rtems_extension
-libc_switch_hook(rtems_tcb *current_task,
- rtems_tcb *heir_task)
-{
- rtems_unsigned32 impure_value;
-
- /* XXX We can't use rtems_task_set_note() here since SYSI task has a
- * tid of 0, which is treated specially (optimized, actually)
- * by rtems_task_set_note
- *
- * NOTE: The above comment is no longer true and we need to use
- * the extension data areas added about the same time.
- */
-
- /*
- * Don't touch the outgoing task if it has been deleted.
- */
-
- if ( !_States_Is_transient( current_task->current_state ) ) {
- impure_value = (rtems_unsigned32) _REENT;
- MY_task_set_note(current_task, LIBC_NOTEPAD, impure_value);
- }
-
- _REENT = (struct _reent *) MY_task_get_note(heir_task, LIBC_NOTEPAD);
-
-}
-
-/*
- * Function: libc_delete_hook
- * Created: 94/12/10
- *
- * Description:
- * Called when a task is deleted.
- * Must restore the new lib reentrancy state for the new current
- * task.
- *
- * Parameters:
- *
- *
- * Returns:
- *
- *
- * Side Effects:
- *
- * Notes:
- *
- *
- * Deficiencies/ToDo:
- *
- *
- */
-rtems_extension
-libc_delete_hook(rtems_tcb *current_task,
- rtems_tcb *deleted_task)
-{
- struct _reent *ptr;
-
- /*
- * The reentrancy structure was allocated by newlib using malloc()
- */
-
- if (current_task == deleted_task)
- {
- ptr = _REENT;
- }
- else
- {
- ptr = (struct _reent *) MY_task_get_note(deleted_task, LIBC_NOTEPAD);
- }
-
- /* if (ptr) */
- if (ptr && ptr != &libc_global_reent)
- {
- _wrapup_reent(ptr);
- _reclaim_reent(ptr);
- free(ptr);
- }
-
- MY_task_set_note(deleted_task, LIBC_NOTEPAD, 0);
-
- /*
- * Require the switch back to another task to install its own
- */
-
- if (current_task == deleted_task)
- {
- _REENT = 0;
- }
-}
-
-/*
- * Function: libc_init
- * Created: 94/12/10
- *
- * Description:
- * Init libc for CYGNUS newlib
- * Set up _REENT to use our global libc_global_reent.
- * (newlib provides a global of its own, but we prefer our
- * own name for it)
- *
- * If reentrancy is desired (which it should be), then
- * we install the task extension hooks to maintain the
- * newlib reentrancy global variable _REENT on task
- * create, delete, switch, exit, etc.
- *
- * Parameters:
- * reentrant non-zero if reentrant library desired.
- *
- * Returns:
- *
- * Side Effects:
- * installs libc extensions if reentrant.
- *
- * Notes:
- *
- *
- * Deficiencies/ToDo:
- *
- */
-
-void
-libc_init(int reentrant)
-{
- rtems_extensions_table libc_extension;
- rtems_id extension_id;
- rtems_status_code rc;
-
- _REENT = &libc_global_reent;
-
- if (reentrant)
- {
- memset(&libc_extension, 0, sizeof(libc_extension));
-
- libc_extension.thread_create = libc_create_hook;
- libc_extension.thread_start = libc_start_hook;
-#ifdef NEED_SETVBUF
- libc_extension.thread_begin = libc_begin_hook;
-#endif
- libc_extension.thread_switch = libc_switch_hook;
- libc_extension.thread_delete = libc_delete_hook;
-
- rc = rtems_extension_create(rtems_build_name('L', 'I', 'B', 'C'),
- &libc_extension, &extension_id);
- if (rc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(rc);
-
- libc_reentrant = reentrant;
- }
-}
-
-#if 0
-/*
- * Routines required by the gnat runtime.
- */
-
-int get_errno()
-{
- return errno;
-}
-#endif
-
-/*
- * Function: _exit
- * Created: 94/12/10
- *
- * Description:
- * Called from exit() after it does atexit() processing and stdio fflush's
- *
- * called from bottom of exit() to really delete the task.
- * If we are using reentrant libc, then let the delete extension
- * do all the work, otherwise if a shutdown is in progress,
- * then just do it.
- *
- * Parameters:
- * exit status
- *
- * Returns:
- * does not return
- *
- * Side Effects:
- *
- * Notes:
- *
- *
- * Deficiencies/ToDo:
- *
- *
- */
-
-#include <stdio.h>
-
-/* #if !defined(RTEMS_UNIX) && !defined(__GO32__) && !defined(_AM29K) */
-#if !defined(RTEMS_UNIX) && !defined(_AM29K)
-void _exit(int status)
-{
- libc_wrapup(); /* Why? XXX */
- rtems_shutdown_executive(status);
-}
-#else
-
-void exit(int status)
-{
- libc_wrapup();
- rtems_shutdown_executive(status);
-}
-#endif
-
-
-/*
- * These are directly supported (and completely correct) in the posix api.
- */
-
-pid_t __getpid(void)
-{
- return getpid();
-}
-
-/* #if !defined(RTEMS_POSIX_API) || defined(__GO32__) */
-#if !defined(RTEMS_POSIX_API)
-pid_t getpid(void)
-{
- return (0);
-}
-#endif
-
-/* #if !defined(RTEMS_POSIX_API) || defined(__GO32__) */
-#if !defined(RTEMS_POSIX_API)
-int kill( pid_t pid, int sig )
-{
- return 0;
-}
-#endif
-
-int __kill( pid_t pid, int sig )
-{
- return 0;
-}
-
-#if !defined(RTEMS_POSIX_API)
-unsigned int sleep(
- unsigned int seconds
-)
-{
- rtems_status_code status;
- rtems_interval ticks_per_second;
- rtems_interval ticks;
-
- status = rtems_clock_get(
- RTEMS_CLOCK_GET_TICKS_PER_SECOND,
- &ticks_per_second
- );
-
- ticks = seconds * ticks_per_second;
-
- status = rtems_task_wake_after( ticks );
-
- /*
- * Returns the "unslept" amount of time. In RTEMS signals are not
- * interruptable, so tasks really sleep all of the requested time.
- */
-
- return 0;
-}
-#endif
-
-
-#endif
diff --git a/c/src/exec/libcsupport/src/no_libc.c b/c/src/exec/libcsupport/src/no_libc.c
deleted file mode 100644
index 5a58ba761c..0000000000
--- a/c/src/exec/libcsupport/src/no_libc.c
+++ /dev/null
@@ -1,55 +0,0 @@
-
-/* no_libc.h
- *
- * This file contains stubs for the reentrancy hooks when
- * an unknown C library is used.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#if !defined(RTEMS_NEWLIB) && !defined(RTEMS_UNIX)
-
-#include "libcsupport.h"
-#include "internal.h"
-
-#include <stdlib.h> /* for free() */
-
-void
-libc_init(int reentrant)
-{
-}
-
-void libc_suspend_main(void)
-{
-}
-
-
-void libc_global_exit(rtems_unsigned32 code)
-{
-}
-
-void _exit(int status)
-{
-}
-
-#else
-
-/* remove ANSI errors.
- * A program must contain at least one external-declaration
- * (X3.159-1989 p.82,L3).
- */
-void no_libc_dummy_function( void )
-{
-}
-
-#endif
diff --git a/c/src/exec/libcsupport/src/opendir.c b/c/src/exec/libcsupport/src/opendir.c
deleted file mode 100644
index e303eb28e5..0000000000
--- a/c/src/exec/libcsupport/src/opendir.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * opendir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <dirent.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-DIR *opendir(
- const char *name
-)
-{
- return NULL;
-}
diff --git a/c/src/exec/libcsupport/src/readdir.c b/c/src/exec/libcsupport/src/readdir.c
deleted file mode 100644
index d592a62b99..0000000000
--- a/c/src/exec/libcsupport/src/readdir.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * readdir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <dirent.h>
-
-struct dirent *readdir(
- register DIR *dirp
-)
-{
- return NULL;
-}
diff --git a/c/src/exec/libcsupport/src/rewinddir.c b/c/src/exec/libcsupport/src/rewinddir.c
deleted file mode 100644
index c85e6fd4d0..0000000000
--- a/c/src/exec/libcsupport/src/rewinddir.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * rewinddir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <assert.h>
-#include <dirent.h>
-#include <stdio.h>
-#include <errno.h>
-#include <unistd.h>
-
-void rewinddir(
- DIR *dirp
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/libcsupport/src/scandir.c b/c/src/exec/libcsupport/src/scandir.c
deleted file mode 100644
index 380415dd97..0000000000
--- a/c/src/exec/libcsupport/src/scandir.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * scandir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-int scandir(
- const char *dirname,
- struct dirent ***namelist,
- int (*select)(struct dirent *),
- int (*dcomp)(const void *, const void *)
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/libcsupport/src/seekdir.c b/c/src/exec/libcsupport/src/seekdir.c
deleted file mode 100644
index e591adbb9f..0000000000
--- a/c/src/exec/libcsupport/src/seekdir.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * seekdir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <sys/param.h>
-#include <assert.h>
-#include <dirent.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
-
-void seekdir(
- DIR *dirp,
- long loc
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/libcsupport/src/tcdrain.c b/c/src/exec/libcsupport/src/tcdrain.c
deleted file mode 100644
index 585871cc90..0000000000
--- a/c/src/exec/libcsupport/src/tcdrain.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file contains the RTEMS implementation of the POSIX API
- * routines tcdrain.
- *
- * $Id$
- *
- */
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-
-#include "internal.h"
-#include "libio.h"
-
-int
-tcdrain(int fd)
-{
- return __rtems_ioctl(fd,RTEMS_IO_TCDRAIN,0);
-}
-
-#endif
diff --git a/c/src/exec/libcsupport/src/telldir.c b/c/src/exec/libcsupport/src/telldir.c
deleted file mode 100644
index eee8d925ec..0000000000
--- a/c/src/exec/libcsupport/src/telldir.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * telldir() - XXX
- *
- * $Id$
- */
-
-#include <sys/param.h>
-#include <assert.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <rtems.h>
-#include "libio.h"
-
-long telldir(
- DIR *dirp
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/libcsupport/src/termios.c b/c/src/exec/libcsupport/src/termios.c
deleted file mode 100644
index c2a43c7707..0000000000
--- a/c/src/exec/libcsupport/src/termios.c
+++ /dev/null
@@ -1,935 +0,0 @@
-/*
- * TERMIOS serial line support
- *
- * Author:
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * The license and distribution terms 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.h>
-#include <rtems/libio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <termios.h>
-#include <unistd.h>
-
-/*
- * FreeBSD does not support a full POSIX termios so we have to help it out
- */
-
-
-#if defined(__FreeBSD__)
-#define XTABS 0
-#define ONLRET 0
-#define ONOCR 0
-#define TABDLY 0
-#define OLCUC 0
-#define ILCUC 0
-#define OCRNL 0
-#define IUCLC 0
-#endif
-
-/*
- * The size of the cooked buffer
- */
-#define CBUFSIZE 256
-
-/*
- * The sizes of the raw message buffers.
- * On most architectures it is quite a bit more
- * efficient if these are powers of two.
- */
-#define RAW_INPUT_BUFFER_SIZE 128
-#define RAW_OUTPUT_BUFFER_SIZE 64
-
-/*
- * Variables associated with each termios instance.
- * One structure for each hardware I/O device.
- */
-struct rtems_termios_tty {
- /*
- * Linked-list of active TERMIOS devices
- */
- struct rtems_termios_tty *forw;
- struct rtems_termios_tty *back;
-
- /*
- * How many times has this device been opened
- */
- int refcount;
-
- /*
- * This device
- */
- rtems_device_major_number major;
- rtems_device_major_number minor;
-
- /*
- * Mutual-exclusion semaphores
- */
- rtems_id isem;
- rtems_id osem;
-
- /*
- * The canonical (cooked) character buffer
- */
- char cbuf[CBUFSIZE];
- int ccount;
- int cindex;
-
- /*
- * Keep track of cursor (printhead) position
- */
- int column;
- int read_start_column;
-
- /*
- * The ioctl settings
- */
- struct termios termios;
- rtems_interval vtimeTicks;
-
- /*
- * Raw input character buffer
- */
- volatile char rawInBuf[RAW_INPUT_BUFFER_SIZE];
- volatile unsigned int rawInBufHead;
- volatile unsigned int rawInBufTail;
- rtems_id rawInBufSemaphore;
- rtems_unsigned32 rawInBufSemaphoreOptions;
- rtems_interval rawInBufSemaphoreTimeout;
- rtems_interval rawInBufSemaphoreFirstTimeout;
- unsigned int rawInBufDropped; /* Statistics */
-
- /*
- * Raw output character buffer
- */
- volatile char rawOutBuf[RAW_OUTPUT_BUFFER_SIZE];
- volatile unsigned int rawOutBufHead;
- volatile unsigned int rawOutBufTail;
- rtems_id rawOutBufSemaphore;
- enum {rob_idle, rob_busy, rob_wait } rawOutBufState;
-
- /*
- * Callbacks to device-specific routines
- */
- rtems_termios_callbacks device;
-};
-
-static struct rtems_termios_tty *ttyHead, *ttyTail;
-static rtems_id ttyMutex;
-
-/*
- * Reserve enough resources to open every physical device once.
- */
-
-static int first_time; /* assumed to be zeroed by BSS initialization */
-
-void
-rtems_termios_reserve_resources (
- rtems_configuration_table *configuration,
- rtems_unsigned32 number_of_devices
- )
-{
- rtems_api_configuration_table *rtems_config;
-
- if (!configuration)
- rtems_fatal_error_occurred (0xFFF0F001);
- rtems_config = configuration->RTEMS_api_configuration;
- if (!rtems_config)
- rtems_fatal_error_occurred (0xFFF0F002);
- if (!first_time)
- rtems_config->maximum_semaphores += 1;
- first_time = 1;
- rtems_config->maximum_semaphores += (4 * number_of_devices);
-}
-
-void
-rtems_termios_initialize (void)
-{
- rtems_status_code sc;
-
- /*
- * Create the mutex semaphore for the tty list
- */
- if (!ttyMutex) {
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'm', 'i'),
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &ttyMutex);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- }
-}
-
-/*
- * Open a termios device
- */
-rtems_status_code
-rtems_termios_open (
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg,
- const rtems_termios_callbacks *callbacks
- )
-{
- rtems_status_code sc;
- rtems_libio_open_close_args_t *args = arg;
- struct rtems_termios_tty *tty;
-
- /*
- * See if the device has already been opened
- */
- sc = rtems_semaphore_obtain (ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- for (tty = ttyHead ; tty != NULL ; tty = tty->forw) {
- if ((tty->major == major) && (tty->minor == minor))
- break;
- }
- if (tty == NULL) {
- static char c = 'a';
-
- /*
- * Create a new device
- */
- tty = calloc (1, sizeof (struct rtems_termios_tty));
- if (tty == NULL) {
- rtems_semaphore_release (ttyMutex);
- return RTEMS_NO_MEMORY;
- }
- tty->forw = ttyHead;
- ttyHead = tty;
- if (ttyTail == NULL)
- ttyTail = tty;
-
- tty->minor = minor;
- tty->major = major;
-
- /*
- * Set up mutex semaphores
- */
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'i', c),
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &tty->isem);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'o', c),
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &tty->osem);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'x', c),
- 0,
- RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &tty->rawOutBufSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- tty->rawOutBufState = rob_idle;
-
- /*
- * Set callbacks
- */
- tty->device = *callbacks;
- if (!tty->device.pollRead) {
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'r', c),
- 0,
- RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &tty->rawInBufSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- }
-
- /*
- * Set default parameters
- */
- tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
- tty->termios.c_oflag = OPOST | ONLCR | XTABS;
- tty->termios.c_cflag = B9600 | CS8 | CREAD;
- tty->termios.c_lflag = ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
- tty->termios.c_cc[VINTR] = '\003';
- tty->termios.c_cc[VQUIT] = '\034';
- tty->termios.c_cc[VERASE] = '\177';
- tty->termios.c_cc[VKILL] = '\025';
- tty->termios.c_cc[VEOF] = '\004';
- tty->termios.c_cc[VEOL] = '\000';
- tty->termios.c_cc[VEOL2] = '\000';
- tty->termios.c_cc[VSTART] = '\021';
- tty->termios.c_cc[VSTOP] = '\023';
- tty->termios.c_cc[VSUSP] = '\032';
- tty->termios.c_cc[VREPRINT] = '\022';
- tty->termios.c_cc[VDISCARD] = '\017';
- tty->termios.c_cc[VWERASE] = '\027';
- tty->termios.c_cc[VLNEXT] = '\026';
-
- /*
- * Bump name characer
- */
- if (c++ == 'z')
- c = 'a';
- }
- args->iop->data1 = tty;
- if (!tty->refcount++ && tty->device.firstOpen)
- (*tty->device.firstOpen)(major, minor, arg);
- rtems_semaphore_release (ttyMutex);
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Drain output queue
- */
-static void
-drainOutput (struct rtems_termios_tty *tty)
-{
- rtems_interrupt_level level;
- rtems_status_code sc;
-
- if (tty->device.outputUsesInterrupts) {
- rtems_interrupt_disable (level);
- while (tty->rawOutBufTail != tty->rawOutBufHead) {
- tty->rawOutBufState = rob_wait;
- rtems_interrupt_enable (level);
- sc = rtems_semaphore_obtain (tty->rawOutBufSemaphore,
- RTEMS_WAIT,
- RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- rtems_interrupt_disable (level);
- }
- rtems_interrupt_enable (level);
- }
-}
-
-rtems_status_code
-rtems_termios_close (void *arg)
-{
- rtems_libio_open_close_args_t *args = arg;
- struct rtems_termios_tty *tty = args->iop->data1;
- rtems_status_code sc;
-
- sc = rtems_semaphore_obtain (ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- if (--tty->refcount == 0) {
- drainOutput (tty);
- if (tty->device.lastClose)
- (*tty->device.lastClose)(tty->major, tty->minor, arg);
- if (tty->forw == NULL)
- ttyTail = tty->back;
- else
- tty->forw->back = tty->back;
- if (tty->back == NULL)
- ttyHead = tty->forw;
- else
- tty->back->forw = tty->forw;
- rtems_semaphore_delete (tty->isem);
- rtems_semaphore_delete (tty->osem);
- rtems_semaphore_delete (tty->rawOutBufSemaphore);
- if (!tty->device.pollRead)
- rtems_semaphore_delete (tty->rawInBufSemaphore);
- free (tty);
- }
- rtems_semaphore_release (ttyMutex);
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_status_code
-rtems_termios_ioctl (void *arg)
-{
- rtems_libio_ioctl_args_t *args = arg;
- struct rtems_termios_tty *tty = args->iop->data1;
- rtems_status_code sc;
-
- args->ioctl_return = 0;
- sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL) {
- args->ioctl_return = sc;
- return sc;
- }
- switch (args->command) {
- default:
- sc = RTEMS_INVALID_NUMBER;
- break;
-
- case RTEMS_IO_GET_ATTRIBUTES:
- *(struct termios *)args->buffer = tty->termios;
- break;
-
- case RTEMS_IO_SET_ATTRIBUTES:
- tty->termios = *(struct termios *)args->buffer;
- if (tty->termios.c_lflag & ICANON) {
- tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
- tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
- tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
- }
- else {
- rtems_interval ticksPerSecond;
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond);
- tty->vtimeTicks = tty->termios.c_cc[VTIME] * ticksPerSecond / 10;
- if (tty->termios.c_cc[VTIME]) {
- tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
- tty->rawInBufSemaphoreTimeout = tty->vtimeTicks;
- if (tty->termios.c_cc[VMIN])
- tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
- else
- tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
- }
- else {
- if (tty->termios.c_cc[VMIN]) {
- tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
- tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
- tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
- }
- else {
- tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
- }
- }
- }
- if (tty->device.setAttributes)
- (*tty->device.setAttributes)(tty->minor, &tty->termios);
- break;
-
- case RTEMS_IO_TCDRAIN:
- drainOutput (tty);
- break;
- }
- rtems_semaphore_release (tty->osem);
- args->ioctl_return = sc;
- return sc;
-}
-
-/*
- * Send characters to device-specific code
- */
-static void
-osend (const char *buf, int len, struct rtems_termios_tty *tty)
-{
- unsigned int newHead;
- rtems_interrupt_level level;
- rtems_status_code sc;
-
- if (!tty->device.outputUsesInterrupts) {
- (*tty->device.write)(tty->minor, buf, len);
- return;
- }
- newHead = tty->rawOutBufHead;
- while (len) {
- /*
- * Performance improvement could be made here.
- * Copy multiple bytes to raw buffer:
- * if (len > 1) && (space to buffer end, or tail > 1)
- * ncopy = MIN (len, space to buffer end or tail)
- * memcpy (raw buffer, buf, ncopy)
- * buf += ncopy
- * len -= ncopy
- *
- * To minimize latency, the memcpy should be done
- * with interrupts enabled.
- */
- newHead = (newHead + 1) % RAW_OUTPUT_BUFFER_SIZE;
- rtems_interrupt_disable (level);
- while (newHead == tty->rawOutBufTail) {
- tty->rawOutBufState = rob_wait;
- rtems_interrupt_enable (level);
- sc = rtems_semaphore_obtain (tty->rawOutBufSemaphore,
- RTEMS_WAIT,
- RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- rtems_interrupt_disable (level);
- }
- tty->rawOutBuf[tty->rawOutBufHead] = *buf++;
- tty->rawOutBufHead = newHead;
- if (tty->rawOutBufState == rob_idle) {
- (*tty->device.write)(tty->minor,
- (char *)&tty->rawOutBuf[tty->rawOutBufTail], 1);
- tty->rawOutBufState = rob_busy;
- }
- rtems_interrupt_enable (level);
- len--;
- }
-}
-
-/*
- * Handle output processing
- */
-static void
-oproc (unsigned char c, struct rtems_termios_tty *tty)
-{
- int i;
-
- if (tty->termios.c_oflag & OPOST) {
- switch (c) {
- case '\n':
- if (tty->termios.c_oflag & ONLRET)
- tty->column = 0;
- if (tty->termios.c_oflag & ONLCR) {
- osend ("\r", 1, tty);
- tty->column = 0;
- }
- break;
-
- case '\r':
- if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0))
- return;
- if (tty->termios.c_oflag & OCRNL) {
- c = '\n';
- if (tty->termios.c_oflag & ONLRET)
- tty->column = 0;
- break;
- }
- tty->column = 0;
- break;
-
- case '\t':
- i = 8 - (tty->column & 7);
- if ((tty->termios.c_oflag & TABDLY) == XTABS) {
- tty->column += i;
- osend ( " ", i, tty);
- return;
- }
- tty->column += i;
- break;
-
- case '\b':
- if (tty->column > 0)
- tty->column--;
- break;
-
- default:
- if (tty->termios.c_oflag & OLCUC)
- c = toupper(c);
- if (!iscntrl(c))
- tty->column++;
- break;
- }
- }
- osend (&c, 1, tty);
-}
-
-rtems_status_code
-rtems_termios_write (void *arg)
-{
- rtems_libio_rw_args_t *args = arg;
- struct rtems_termios_tty *tty = args->iop->data1;
- rtems_status_code sc;
-
- sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- if (tty->termios.c_oflag & OPOST) {
- unsigned32 count = args->count;
- unsigned8 *buffer = args->buffer;
- while (count--)
- oproc (*buffer++, tty);
- args->bytes_moved = args->count;
- }
- else {
- osend (args->buffer, args->count, tty);
- args->bytes_moved = args->count;
- }
- rtems_semaphore_release (tty->osem);
- return sc;
-}
-
-/*
- * Echo a typed character
- */
-static void
-echo (unsigned char c, struct rtems_termios_tty *tty)
-{
- if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) {
- char echobuf[2];
-
- echobuf[0] = '^';
- echobuf[1] = c ^ 0x40;
- osend (echobuf, 2, tty);
- tty->column += 2;
- }
- else {
- oproc (c, tty);
- }
-}
-
-/*
- * Erase a character or line
- * FIXME: Needs support for WERASE and ECHOPRT.
- * FIXME: Some of the tests should check for IEXTEN, too.
- */
-static void
-erase (struct rtems_termios_tty *tty, int lineFlag)
-{
- if (tty->ccount == 0)
- return;
- if (lineFlag) {
- if (!(tty->termios.c_lflag & ECHO)) {
- tty->ccount = 0;
- return;
- }
- if (!(tty->termios.c_lflag & ECHOE)) {
- tty->ccount = 0;
- echo (tty->termios.c_cc[VKILL], tty);
- if (tty->termios.c_lflag & ECHOK)
- echo ('\n', tty);
- return;
- }
- }
- while (tty->ccount) {
- unsigned char c = tty->cbuf[--tty->ccount];
-
- if (tty->termios.c_lflag & ECHO) {
- if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
- echo (tty->termios.c_cc[VERASE], tty);
- }
- else if (c == '\t') {
- int col = tty->read_start_column;
- int i = 0;
-
- /*
- * Find the character before the tab
- */
- while (i != tty->ccount) {
- c = tty->cbuf[i++];
- if (c == '\t') {
- col = (col | 7) + 1;
- }
- else if (iscntrl (c)) {
- if (tty->termios.c_lflag & ECHOCTL)
- col += 2;
- }
- else {
- col++;
- }
- }
-
- /*
- * Back up over the tab
- */
- while (tty->column > col) {
- osend ("\b", 1, tty);
- tty->column--;
- }
- }
- else {
- if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) {
- osend ("\b \b", 3, tty);
- if (tty->column)
- tty->column--;
- }
- if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) {
- osend ("\b \b", 3, tty);
- if (tty->column)
- tty->column--;
- }
- }
- }
- if (!lineFlag)
- break;
- }
-}
-
-/*
- * Process a single input character
- */
-static int
-iproc (unsigned char c, struct rtems_termios_tty *tty)
-{
- if (tty->termios.c_iflag & ISTRIP)
- c &= 0x7f;
- if (tty->termios.c_iflag & IUCLC)
- c = tolower (c);
- if (c == '\r') {
- if (tty->termios.c_iflag & IGNCR)
- return 0;
- if (tty->termios.c_iflag & ICRNL)
- c = '\n';
- }
- else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
- c = '\r';
- }
- if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
- if (c == tty->termios.c_cc[VERASE]) {
- erase (tty, 0);
- return 0;
- }
- else if (c == tty->termios.c_cc[VKILL]) {
- erase (tty, 1);
- return 0;
- }
- else if (c == tty->termios.c_cc[VEOF]) {
- return 1;
- }
- else if (c == '\n') {
- if (tty->termios.c_lflag & (ECHO | ECHONL))
- echo (c, tty);
- tty->cbuf[tty->ccount++] = c;
- return 1;
- }
- else if ((c == tty->termios.c_cc[VEOL])
- || (c == tty->termios.c_cc[VEOL2])) {
- if (tty->termios.c_lflag & ECHO)
- echo (c, tty);
- tty->cbuf[tty->ccount++] = c;
- return 1;
- }
- }
-
- /*
- * FIXME: Should do IMAXBEL handling somehow
- */
- if (tty->ccount < (CBUFSIZE-1)) {
- if (tty->termios.c_lflag & ECHO)
- echo (c, tty);
- tty->cbuf[tty->ccount++] = c;
- }
- return 0;
-}
-
-/*
- * Process input character, with semaphore.
- */
-static int
-siproc (unsigned char c, struct rtems_termios_tty *tty)
-{
- int i;
-
- /*
- * Obtain output semaphore if character will be echoed
- */
- if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) {
- rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- i = iproc (c, tty);
- rtems_semaphore_release (tty->osem);
- }
- else {
- i = iproc (c, tty);
- }
- return i;
-}
-
-/*
- * Fill the input buffer by polling the device
- */
-static rtems_status_code
-fillBufferPoll (struct rtems_termios_tty *tty)
-{
- int n;
-
- if (tty->termios.c_lflag & ICANON) {
- for (;;) {
- n = (*tty->device.pollRead)(tty->minor);
- if (n < 0) {
- rtems_task_wake_after (1);
- }
- else {
- if (siproc (n, tty))
- break;
- }
- }
- }
- else {
- rtems_interval then, now;
- if (!tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then);
- for (;;) {
- n = (*tty->device.pollRead)(tty->minor);
- if (n < 0) {
- if (tty->termios.c_cc[VMIN]) {
- if (tty->termios.c_cc[VTIME] && tty->ccount) {
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- if ((now - then) > tty->vtimeTicks) {
- break;
- }
- }
- }
- else {
- if (!tty->termios.c_cc[VTIME])
- break;
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- if ((now - then) > tty->vtimeTicks) {
- break;
- }
- }
- rtems_task_wake_after (1);
- }
- else {
- siproc (n, tty);
- if (tty->ccount >= tty->termios.c_cc[VMIN])
- break;
- if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then);
- }
- }
- }
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Fill the input buffer from the raw input queue
- */
-static rtems_status_code
-fillBufferQueue (struct rtems_termios_tty *tty)
-{
- rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout;
- rtems_status_code sc;
-
- for (;;) {
- /*
- * Process characters read from raw queue
- */
- while (tty->rawInBufHead != tty->rawInBufTail) {
- unsigned char c;
- unsigned int newHead;
-
- newHead = (tty->rawInBufHead + 1) % RAW_INPUT_BUFFER_SIZE;
- c = tty->rawInBuf[newHead];
- tty->rawInBufHead = newHead;
- if (tty->termios.c_lflag & ICANON) {
- if (siproc (c, tty))
- return RTEMS_SUCCESSFUL;
- }
- else {
- siproc (c, tty);
- if (tty->ccount >= tty->termios.c_cc[VMIN])
- return RTEMS_SUCCESSFUL;
- }
- timeout = tty->rawInBufSemaphoreTimeout;
- }
-
- /*
- * Wait for characters
- */
- sc = rtems_semaphore_obtain (tty->rawInBufSemaphore,
- tty->rawInBufSemaphoreOptions,
- timeout);
- if (sc != RTEMS_SUCCESSFUL)
- break;
- }
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_status_code
-rtems_termios_read (void *arg)
-{
- rtems_libio_rw_args_t *args = arg;
- struct rtems_termios_tty *tty = args->iop->data1;
- unsigned32 count = args->count;
- unsigned8 *buffer = args->buffer;
- rtems_status_code sc;
-
- sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- if (tty->cindex == tty->ccount) {
- tty->cindex = tty->ccount = 0;
- tty->read_start_column = tty->column;
- if (tty->device.pollRead)
- sc = fillBufferPoll (tty);
- else
- sc = fillBufferQueue (tty);
- if (sc != RTEMS_SUCCESSFUL)
- tty->cindex = tty->ccount = 0;
- }
- while (count && (tty->cindex < tty->ccount)) {
- *buffer++ = tty->cbuf[tty->cindex++];
- count--;
- }
- args->bytes_moved = args->count - count;
- rtems_semaphore_release (tty->isem);
- return sc;
-}
-
-/*
- * Place characters on raw queue.
- * NOTE: This routine runs in the context of the
- * device receive interrupt handler.
- * Returns the number of characters dropped because of overlow.
- */
-int
-rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len)
-{
- struct rtems_termios_tty *tty = ttyp;
- unsigned int newTail;
-
- while (len) {
- newTail = (tty->rawInBufTail + 1) % RAW_INPUT_BUFFER_SIZE;
- if (newTail == tty->rawInBufHead) {
- tty->rawInBufDropped += len;
- break;
- }
- tty->rawInBuf[newTail] = *buf++;
- len--;
- tty->rawInBufTail = newTail;
- }
- rtems_semaphore_release (tty->rawInBufSemaphore);
- return len;
-}
-
-/*
- * Characters have been transmitted
- * NOTE: This routine runs in the context of the
- * device transmit interrupt handler.
- * The second argument is the number of characters transmitted so far.
- * This value will always be 1 for devices which generate an interrupt
- * for each transmitted character.
- * It returns number of characters left to transmit
- */
-int
-rtems_termios_dequeue_characters (void *ttyp, int len)
-{
- struct rtems_termios_tty *tty = ttyp;
- unsigned int newTail;
- int nToSend;
-
- if (tty->rawOutBufState == rob_wait)
- rtems_semaphore_release (tty->rawOutBufSemaphore);
- if ( tty->rawOutBufHead == tty->rawOutBufTail )
- return 0;
- newTail = (tty->rawOutBufTail + len) % RAW_OUTPUT_BUFFER_SIZE;
- if (newTail == tty->rawOutBufHead) {
- /*
- * Buffer empty
- */
- tty->rawOutBufState = rob_idle;
- nToSend = 0;
- }
- else {
- /*
- * Buffer not empty, start tranmitter
- */
- if (newTail > tty->rawOutBufHead)
- nToSend = RAW_OUTPUT_BUFFER_SIZE - newTail;
- else
- nToSend = tty->rawOutBufHead - newTail;
- (*tty->device.write)(tty->minor, (char *)&tty->rawOutBuf[newTail], nToSend);
- tty->rawOutBufState = rob_busy;
- }
- tty->rawOutBufTail = newTail;
-
- return nToSend;
-}
-
-
diff --git a/c/src/exec/libcsupport/src/unixlibc.c b/c/src/exec/libcsupport/src/unixlibc.c
deleted file mode 100644
index 3e757e313d..0000000000
--- a/c/src/exec/libcsupport/src/unixlibc.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-
-#if defined(RTEMS_UNIXLIB)
-
-void libc_init(int reentrant)
-{
-}
-
-#else
-
-/* remove ANSI errors.
- * A program must contain at least one external-declaration
- * (X3.159-1989 p.82,L3).
- */
-void unixlibc_dummy_function( void )
-{
-}
-
-#endif
diff --git a/c/src/exec/libcsupport/src/utsname.c b/c/src/exec/libcsupport/src/utsname.c
deleted file mode 100644
index 7fba3d610f..0000000000
--- a/c/src/exec/libcsupport/src/utsname.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * $Id$
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <sys/utsname.h>
-
-#include <rtems/system.h>
-#include <rtems/score/system.h>
-#include <rtems/score/object.h>
-
-/*PAGE
- *
- * 4.4.1 Get System Name, P1003.1b-1993, p. 90
- */
-
-int uname(
- struct utsname *name
-)
-{
- /* XXX: Here is what Solaris returns...
- sysname = SunOS
- nodename = node_name
- release = 5.3
- version = Generic_101318-12
- machine = sun4m
- */
-
- strcpy( name->sysname, "RTEMS" );
-
- sprintf( name->nodename, "Node %d\n", _Objects_Local_node );
-
- /* XXX release string is in BAD format for this routine!!! */
- strcpy( name->release, "3.2.0" );
-
- /* XXX does this have any meaning for RTEMS */
-
- strcpy( name->release, "" );
-
- sprintf( name->machine, "%s/%s", CPU_NAME, CPU_MODEL_NAME );
-
- return 0;
-}
-
-/*PAGE
- *
- * 4.5.2 Get Process Times, P1003.1b-1993, p. 92
- */
-
-clock_t times(
- struct tms *buffer
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
diff --git a/c/src/exec/libnetworking/README b/c/src/exec/libnetworking/README
deleted file mode 100644
index d0c22ec688..0000000000
--- a/c/src/exec/libnetworking/README
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# $Id$
-#
-
-This is a snapshot of my attempt to fit the FreeBSD networking code into
-RTEMS. Things seem to be working!
-
-Things that need to be done:
- 1) More documentation!
- 2) Figure out what's still not working :-)
- 3) Rationalize the include files. Right now I have a special
- hack in the Makefile to ensure that I pick up the FreeBSD versions
- of the include files that are duplicated between RTEMS
- and FreeBSD.
- The network device driver source should move to the BSP source tree.
- 4) Have a look at all the FIXME comments.
- 5) Go through and make sure that all the source files are
- free of undesired copyright restrictions.
diff --git a/c/src/exec/libnetworking/arpa/ftp.h b/c/src/exec/libnetworking/arpa/ftp.h
deleted file mode 100644
index 584d290bc9..0000000000
--- a/c/src/exec/libnetworking/arpa/ftp.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 1983, 1989, 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.
- *
- * @(#)ftp.h 8.1 (Berkeley) 6/2/93
- *
- * $Id$
- */
-
-#ifndef _ARPA_FTP_H_
-#define _ARPA_FTP_H_
-
-/* Definitions for FTP; see RFC-765. */
-
-/*
- * 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 */
-
-/*
- * Type codes
- */
-#define TYPE_A 1 /* ASCII */
-#define TYPE_E 2 /* EBCDIC */
-#define TYPE_I 3 /* image */
-#define TYPE_L 4 /* local byte size */
-
-#ifdef FTP_NAMES
-char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
-#endif
-
-/*
- * Form codes
- */
-#define FORM_N 1 /* non-print */
-#define FORM_T 2 /* telnet format effectors */
-#define FORM_C 3 /* carriage control (ASA) */
-#ifdef FTP_NAMES
-char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
-#endif
-
-/*
- * Structure codes
- */
-#define STRU_F 1 /* file (no record structure) */
-#define STRU_R 2 /* record structure */
-#define STRU_P 3 /* page structure */
-#ifdef FTP_NAMES
-char *strunames[] = {"0", "File", "Record", "Page" };
-#endif
-
-/*
- * Mode types
- */
-#define MODE_S 1 /* stream */
-#define MODE_B 2 /* block */
-#define MODE_C 3 /* compressed */
-#ifdef FTP_NAMES
-char *modenames[] = {"0", "Stream", "Block", "Compressed" };
-#endif
-
-/*
- * Record Tokens
- */
-#define REC_ESC '\377' /* Record-mode Escape */
-#define REC_EOR '\001' /* Record-mode End-of-Record */
-#define REC_EOF '\002' /* Record-mode End-of-File */
-
-/*
- * Block Header
- */
-#define BLK_EOR 0x80 /* Block is End-of-Record */
-#define BLK_EOF 0x40 /* Block is End-of-File */
-#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
-#define BLK_RESTART 0x10 /* Block is Restart Marker */
-
-#define BLK_BYTECOUNT 2 /* Bytes in this block */
-
-#endif /* !_FTP_H_ */
diff --git a/c/src/exec/libnetworking/arpa/inet.h b/c/src/exec/libnetworking/arpa/inet.h
deleted file mode 100644
index ad5332e7ab..0000000000
--- a/c/src/exec/libnetworking/arpa/inet.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * @(#)inet.h 8.1 (Berkeley) 6/2/93
- * From: Id: inet.h,v 8.5 1997/01/29 08:48:09 vixie Exp $
- * $Id$
- */
-
-#ifndef _ARPA_INET_H_
-#define _ARPA_INET_H_
-
-/* External definitions for functions in inet(3), addr2ascii(3) */
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-struct in_addr;
-
-#if 0 /* RTEMS -- Why rename these? */
-/* XXX all new diversions!! argh!! */
-#define inet_addr __inet_addr
-#define inet_aton __inet_aton
-#define inet_lnaof __inet_lnaof
-#define inet_makeaddr __inet_makeaddr
-#define inet_neta __inet_neta
-#define inet_netof __inet_netof
-#define inet_network __inet_network
-#define inet_net_ntop __inet_net_ntop
-#define inet_net_pton __inet_net_pton
-#define inet_ntoa __inet_ntoa
-#define inet_pton __inet_pton
-#define inet_ntop __inet_ntop
-#define inet_nsap_addr __inet_nsap_addr
-#define inet_nsap_ntoa __inet_nsap_ntoa
-#endif
-
-__BEGIN_DECLS
-int ascii2addr __P((int, const char *, void *));
-char *addr2ascii __P((int, const void *, int, char *));
-unsigned long inet_addr __P((const char *));
-int inet_aton __P((const char *, struct in_addr *));
-unsigned long inet_lnaof __P((struct in_addr));
-struct in_addr inet_makeaddr __P((u_long , u_long));
-char * inet_neta __P((u_long, char *, size_t));
-unsigned long inet_netof __P((struct in_addr));
-unsigned long inet_network __P((const char *));
-char *inet_net_ntop __P((int, const void *, int, char *, size_t));
-int inet_net_pton __P((int, const char *, void *, size_t));
-char *inet_ntoa __P((struct in_addr));
-int inet_pton __P((int, const char *, void *));
-const char *inet_ntop __P((int, const void *, char *, size_t));
-u_int inet_nsap_addr __P((const char *, u_char *, int));
-char *inet_nsap_ntoa __P((int, const u_char *, char *));
-__END_DECLS
-
-#endif /* !_INET_H_ */
diff --git a/c/src/exec/libnetworking/arpa/nameser.h b/c/src/exec/libnetworking/arpa/nameser.h
deleted file mode 100644
index 634dece37b..0000000000
--- a/c/src/exec/libnetworking/arpa/nameser.h
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
- * Copyright (c) 1983, 1989, 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.
- */
-
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * From: Id: nameser.h,v 8.16 1998/02/06 00:35:58 halley Exp
- * $Id$
- */
-
-#ifndef _ARPA_NAMESER_H_
-#define _ARPA_NAMESER_H_
-
-#define BIND_4_COMPAT
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-/*
- * revision information. this is the release date in YYYYMMDD format.
- * it can change every day so the right thing to do with it is use it
- * in preprocessor commands such as "#if (__NAMESER > 19931104)". do not
- * compare for equality; rather, use it to determine whether your libnameser.a
- * is new enough to contain a certain feature.
- */
-
-/* XXXRTH I made this bigger than __BIND in 4.9.5 T6B */
-#define __NAMESER 19961001 /* New interface version stamp. */
-
-/*
- * Define constants based on RFC 883, RFC 1034, RFC 1035
- */
-#define NS_PACKETSZ 512 /* maximum packet size */
-#define NS_MAXDNAME 1025 /* maximum domain name */
-#define NS_MAXCDNAME 255 /* maximum compressed domain name */
-#define NS_MAXLABEL 63 /* maximum length of domain label */
-#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
-#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
-#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
-#define NS_INT32SZ 4 /* #/bytes of data in a u_int32_t */
-#define NS_INT16SZ 2 /* #/bytes of data in a u_int16_t */
-#define NS_INT8SZ 1 /* #/bytes of data in a u_int8_t */
-#define NS_INADDRSZ 4 /* IPv4 T_A */
-#define NS_IN6ADDRSZ 16 /* IPv6 T_AAAA */
-#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
-#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
-
-/*
- * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()
- * in synch with it.
- */
-typedef enum __ns_sect {
- ns_s_qd = 0, /* Query: Question. */
- ns_s_zn = 0, /* Update: Zone. */
- ns_s_an = 1, /* Query: Answer. */
- ns_s_pr = 1, /* Update: Prerequisites. */
- ns_s_ns = 2, /* Query: Name servers. */
- ns_s_ud = 2, /* Update: Update. */
- ns_s_ar = 3, /* Query|Update: Additional records. */
- ns_s_max = 4
-} ns_sect;
-
-/*
- * This is a message handle. It is caller allocated and has no dynamic data.
- * This structure is intended to be opaque to all but ns_parse.c, thus the
- * leading _'s on the member names. Use the accessor functions, not the _'s.
- */
-typedef struct __ns_msg {
- const u_char *_msg, *_eom;
- u_int16_t _id, _flags, _counts[ns_s_max];
- const u_char *_sections[ns_s_max];
- ns_sect _sect;
- int _rrnum;
- const u_char *_ptr;
-} ns_msg;
-
-/* Private data structure - do not use from outside library. */
-struct _ns_flagdata { int mask, shift; };
-extern struct _ns_flagdata _ns_flagdata[];
-
-/* Accessor macros - this is part of the public interface. */
-#define ns_msg_getflag(handle, flag) ( \
- ((handle)._flags & _ns_flagdata[flag].mask) \
- >> _ns_flagdata[flag].shift \
- )
-#define ns_msg_id(handle) ((handle)._id + 0)
-#define ns_msg_base(handle) ((handle)._msg + 0)
-#define ns_msg_end(handle) ((handle)._eom + 0)
-#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
-#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
-
-/*
- * This is a parsed record. It is caller allocated and has no dynamic data.
- */
-typedef struct __ns_rr {
- char name[NS_MAXDNAME]; /* XXX need to malloc */
- u_int16_t type;
- u_int16_t class;
- u_int32_t ttl;
- u_int16_t rdlength;
- const u_char *rdata;
-} ns_rr;
-
-/* Accessor macros - this is part of the public interface. */
-#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
-#define ns_rr_type(rr) ((rr).type + 0)
-#define ns_rr_class(rr) ((rr).class + 0)
-#define ns_rr_ttl(rr) ((rr).ttl + 0)
-#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
-#define ns_rr_rdata(rr) ((rr).rdata + 0)
-
-/*
- * These don't have to be in the same order as in the packet flags word,
- * and they can even overlap in some cases, but they will need to be kept
- * in synch with ns_parse.c:ns_flagdata[].
- */
-typedef enum __ns_flag {
- ns_f_qr, /* Question/Response. */
- ns_f_opcode, /* Operation code. */
- ns_f_aa, /* Authoritative Answer. */
- ns_f_tc, /* Truncation occurred. */
- ns_f_rd, /* Recursion Desired. */
- ns_f_ra, /* Recursion Available. */
- ns_f_z, /* MBZ. */
- ns_f_ad, /* Authentic Data (DNSSEC). */
- ns_f_cd, /* Checking Disabled (DNSSEC). */
- ns_f_rcode, /* Response code. */
- ns_f_max
-} ns_flag;
-
-/*
- * Currently defined opcodes.
- */
-typedef enum __ns_opcode {
- ns_o_query = 0, /* Standard query. */
- ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
- ns_o_status = 2, /* Name server status query (unsupported). */
- /* Opcode 3 is undefined/reserved. */
- ns_o_notify = 4, /* Zone change notification. */
- ns_o_update = 5, /* Zone update message. */
- ns_o_max = 6
-} ns_opcode;
-
-/*
- * Currently defined response codes.
- */
-typedef enum __ns_rcode {
- ns_r_noerror = 0, /* No error occurred. */
- ns_r_formerr = 1, /* Format error. */
- ns_r_servfail = 2, /* Server failure. */
- ns_r_nxdomain = 3, /* Name error. */
- ns_r_notimpl = 4, /* Unimplemented. */
- ns_r_refused = 5, /* Operation refused. */
- /* these are for BIND_UPDATE */
- ns_r_yxdomain = 6, /* Name exists */
- ns_r_yxrrset = 7, /* RRset exists */
- ns_r_nxrrset = 8, /* RRset does not exist */
- ns_r_notauth = 9, /* Not authoritative for zone */
- ns_r_notzone = 10, /* Zone of record different from zone section */
- ns_r_max = 11
-} ns_rcode;
-
-/* BIND_UPDATE */
-typedef enum __ns_update_operation {
- ns_uop_delete = 0,
- ns_uop_add = 1,
- ns_uop_max = 2
-} ns_update_operation;
-
-/*
- * This RR-like structure is particular to UPDATE.
- */
-struct ns_updrec {
- struct ns_updrec *r_prev; /* prev record */
- struct ns_updrec *r_next; /* next record */
- u_int8_t r_section; /* ZONE/PREREQUISITE/UPDATE */
- char * r_dname; /* owner of the RR */
- u_int16_t r_class; /* class number */
- u_int16_t r_type; /* type number */
- u_int32_t r_ttl; /* time to live */
- u_char * r_data; /* rdata fields as text string */
- u_int16_t r_size; /* size of r_data field */
- int r_opcode; /* type of operation */
- /* following fields for private use by the resolver/server routines */
- struct ns_updrec *r_grpnext; /* next record when grouped */
- struct databuf *r_dp; /* databuf to process */
- struct databuf *r_deldp; /* databuf's deleted/overwritten */
- u_int16_t r_zone; /* zone number on server */
-};
-typedef struct ns_updrec ns_updrec;
-
-/*
- * Currently defined type values for resources and queries.
- */
-typedef enum __ns_type {
- ns_t_a = 1, /* Host address. */
- ns_t_ns = 2, /* Authoritative server. */
- ns_t_md = 3, /* Mail destination. */
- ns_t_mf = 4, /* Mail forwarder. */
- ns_t_cname = 5, /* Canonical name. */
- ns_t_soa = 6, /* Start of authority zone. */
- ns_t_mb = 7, /* Mailbox domain name. */
- ns_t_mg = 8, /* Mail group member. */
- ns_t_mr = 9, /* Mail rename name. */
- ns_t_null = 10, /* Null resource record. */
- ns_t_wks = 11, /* Well known service. */
- ns_t_ptr = 12, /* Domain name pointer. */
- ns_t_hinfo = 13, /* Host information. */
- ns_t_minfo = 14, /* Mailbox information. */
- ns_t_mx = 15, /* Mail routing information. */
- ns_t_txt = 16, /* Text strings. */
- ns_t_rp = 17, /* Responsible person. */
- ns_t_afsdb = 18, /* AFS cell database. */
- ns_t_x25 = 19, /* X_25 calling address. */
- ns_t_isdn = 20, /* ISDN calling address. */
- ns_t_rt = 21, /* Router. */
- ns_t_nsap = 22, /* NSAP address. */
- ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
- ns_t_sig = 24, /* Security signature. */
- ns_t_key = 25, /* Security key. */
- ns_t_px = 26, /* X.400 mail mapping. */
- ns_t_gpos = 27, /* Geographical position (withdrawn). */
- ns_t_aaaa = 28, /* Ip6 Address. */
- ns_t_loc = 29, /* Location Information. */
- ns_t_nxt = 30, /* Next domain (security). */
- ns_t_eid = 31, /* Endpoint identifier. */
- ns_t_nimloc = 32, /* Nimrod Locator. */
- ns_t_srv = 33, /* Server Selection. */
- ns_t_atma = 34, /* ATM Address */
- ns_t_naptr = 35, /* Naming Authority PoinTeR */
- /* Query type values which do not appear in resource records. */
- ns_t_ixfr = 251, /* Incremental zone transfer. */
- ns_t_axfr = 252, /* Transfer zone of authority. */
- ns_t_mailb = 253, /* Transfer mailbox records. */
- ns_t_maila = 254, /* Transfer mail agent records. */
- ns_t_any = 255, /* Wildcard match. */
- ns_t_max = 65536
-} ns_type;
-
-/*
- * Values for class field
- */
-typedef enum __ns_class {
- ns_c_in = 1, /* Internet. */
- /* Class 2 unallocated/unsupported. */
- ns_c_chaos = 3, /* MIT Chaos-net. */
- ns_c_hs = 4, /* MIT Hesiod. */
- /* Query class values which do not appear in resource records */
- ns_c_none = 254, /* for prereq. sections in update requests */
- ns_c_any = 255, /* Wildcard match. */
- ns_c_max = 65536
-} ns_class;
-
-/*
- * Flags field of the KEY RR rdata
- */
-#define NS_KEY_TYPEMASK 0xC000 /* Mask for "type" bits */
-#define NS_KEY_TYPE_AUTH_CONF 0x0000 /* Key usable for both */
-#define NS_KEY_TYPE_CONF_ONLY 0x8000 /* Key usable for confidentiality */
-#define NS_KEY_TYPE_AUTH_ONLY 0x4000 /* Key usable for authentication */
-#define NS_KEY_TYPE_NO_KEY 0xC000 /* No key usable for either; no key */
-/* The type bits can also be interpreted independently, as single bits: */
-#define NS_KEY_NO_AUTH 0x8000 /* Key unusable for authentication */
-#define NS_KEY_NO_CONF 0x4000 /* Key unusable for confidentiality */
-#define NS_KEY_EXPERIMENTAL 0x2000 /* Security is *mandatory* if bit=0 */
-#define NS_KEY_RESERVED3 0x1000 /* reserved - must be zero */
-#define NS_KEY_RESERVED4 0x0800 /* reserved - must be zero */
-#define NS_KEY_USERACCOUNT 0x0400 /* key is assoc. with a user acct */
-#define NS_KEY_ENTITY 0x0200 /* key is assoc. with entity eg host */
-#define NS_KEY_ZONEKEY 0x0100 /* key is zone key */
-#define NS_KEY_IPSEC 0x0080 /* key is for IPSEC (host or user)*/
-#define NS_KEY_EMAIL 0x0040 /* key is for email (MIME security) */
-#define NS_KEY_RESERVED10 0x0020 /* reserved - must be zero */
-#define NS_KEY_RESERVED11 0x0010 /* reserved - must be zero */
-#define NS_KEY_SIGNATORYMASK 0x000F /* key can sign RR's of same name */
-
-#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED3 | \
- NS_KEY_RESERVED4 | \
- NS_KEY_RESERVED10 | \
- NS_KEY_RESERVED11 )
-
-/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
-#define NS_ALG_MD5RSA 1 /* MD5 with RSA */
-#define NS_ALG_EXPIRE_ONLY 253 /* No alg, no security */
-#define NS_ALG_PRIVATE_OID 254 /* Key begins with OID giving alg */
-
-/* Signatures */
-#define NS_MD5RSA_MIN_BITS 512 /* Size of a mod or exp in bits */
-#define NS_MD5RSA_MAX_BITS 2552
- /* Total of binary mod and exp */
-#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
- /* Max length of text sig block */
-#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
-
-/* Offsets into SIG record rdata to find various values */
-#define NS_SIG_TYPE 0 /* Type flags */
-#define NS_SIG_ALG 2 /* Algorithm */
-#define NS_SIG_LABELS 3 /* How many labels in name */
-#define NS_SIG_OTTL 4 /* Original TTL */
-#define NS_SIG_EXPIR 8 /* Expiration time */
-#define NS_SIG_SIGNED 12 /* Signature time */
-#define NS_SIG_FOOT 16 /* Key footprint */
-#define NS_SIG_SIGNER 18 /* Domain name of who signed it */
-
-/* How RR types are represented as bit-flags in NXT records */
-#define NS_NXT_BITS 8
-#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
-
-
-/*
- * Inline versions of get/put short/long. Pointer is advanced.
- */
-#define NS_GET16(s, cp) { \
- register u_char *t_cp = (u_char *)(cp); \
- (s) = ((u_int16_t)t_cp[0] << 8) \
- | ((u_int16_t)t_cp[1]) \
- ; \
- (cp) += NS_INT16SZ; \
-}
-
-#define NS_GET32(l, cp) { \
- register u_char *t_cp = (u_char *)(cp); \
- (l) = ((u_int32_t)t_cp[0] << 24) \
- | ((u_int32_t)t_cp[1] << 16) \
- | ((u_int32_t)t_cp[2] << 8) \
- | ((u_int32_t)t_cp[3]) \
- ; \
- (cp) += NS_INT32SZ; \
-}
-
-#define NS_PUT16(s, cp) { \
- register u_int16_t t_s = (u_int16_t)(s); \
- register u_char *t_cp = (u_char *)(cp); \
- *t_cp++ = t_s >> 8; \
- *t_cp = t_s; \
- (cp) += NS_INT16SZ; \
-}
-
-#define NS_PUT32(l, cp) { \
- register u_int32_t t_l = (u_int32_t)(l); \
- register u_char *t_cp = (u_char *)(cp); \
- *t_cp++ = t_l >> 24; \
- *t_cp++ = t_l >> 16; \
- *t_cp++ = t_l >> 8; \
- *t_cp = t_l; \
- (cp) += NS_INT32SZ; \
-}
-
-/*
- * ANSI C identifier hiding.
- */
-#define ns_get16 __ns_get16
-#define ns_get32 __ns_get32
-#define ns_put16 __ns_put16
-#define ns_put32 __ns_put32
-#define ns_initparse __ns_initparse
-#define ns_parserr __ns_parserr
-#define ns_sprintrr __ns_sprintrr
-#define ns_sprintrrf __ns_sprintrrf
-#define ns_format_ttl __ns_format_ttl
-#define ns_parse_ttl __ns_parse_ttl
-#define ns_name_ntop __ns_name_ntop
-#define ns_name_pton __ns_name_pton
-#define ns_name_unpack __ns_name_unpack
-#define ns_name_pack __ns_name_pack
-#define ns_name_compress __ns_name_compress
-#define ns_name_uncompress __ns_name_uncompress
-
-__BEGIN_DECLS
-u_int ns_get16 __P((const u_char *));
-u_long ns_get32 __P((const u_char *));
-void ns_put16 __P((u_int, u_char *));
-void ns_put32 __P((u_long, u_char *));
-int ns_initparse __P((const u_char *, int, ns_msg *));
-int ns_parserr __P((ns_msg *, ns_sect, int, ns_rr *));
-int ns_sprintrr __P((const ns_msg *, const ns_rr *,
- const char *, const char *, char *, size_t));
-int ns_sprintrrf __P((const u_char *, size_t, const char *,
- ns_class, ns_type, u_long, const u_char *,
- size_t, const char *, const char *,
- char *, size_t));
-int ns_format_ttl __P((u_long, char *, size_t));
-int ns_parse_ttl __P((const char *, u_long *));
-int ns_name_ntop __P((const u_char *, char *, size_t));
-int ns_name_pton __P((const char *, u_char *, size_t));
-int ns_name_unpack __P((const u_char *, const u_char *,
- const u_char *, u_char *, size_t));
-int ns_name_pack __P((const u_char *, u_char *, int,
- const u_char **, const u_char **));
-int ns_name_uncompress __P((const u_char *, const u_char *,
- const u_char *, char *, size_t));
-int ns_name_compress __P((const char *, u_char *, size_t,
- const u_char **, const u_char **));
-int ns_name_skip __P((const u_char **, const u_char *));
-__END_DECLS
-
-#ifdef BIND_4_COMPAT
-#include <arpa/nameser_compat.h>
-#endif
-
-#endif /* !_ARPA_NAMESER_H_ */
diff --git a/c/src/exec/libnetworking/arpa/nameser_compat.h b/c/src/exec/libnetworking/arpa/nameser_compat.h
deleted file mode 100644
index 2ab5b47386..0000000000
--- a/c/src/exec/libnetworking/arpa/nameser_compat.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/* Copyright (c) 1983, 1989
- * 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.
- */
-
-/*
- * from nameser.h 8.1 (Berkeley) 6/2/93
- * From: Id: nameser_compat.h,v 8.9 1998/03/20 23:25:10 halley Exp
- * $Id$
- */
-
-#ifndef _ARPA_NAMESER_COMPAT_
-#define _ARPA_NAMESER_COMPAT_
-
-#define __BIND 19950621 /* (DEAD) interface version stamp. */
-
-#include <machine/endian.h>
-
-#if !defined(BYTE_ORDER) || \
- (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
- BYTE_ORDER != PDP_ENDIAN)
- /* you must determine what the correct bit order is for
- * your compiler - the next line is an intentional error
- * which will force your compiles to bomb until you fix
- * the above macros.
- */
- error "Undefined or invalid BYTE_ORDER";
-#endif
-
-/*
- * Structure for query header. The order of the fields is machine- and
- * compiler-dependent, depending on the byte/bit order and the layout
- * of bit fields. We use bit fields only in int variables, as this
- * is all ANSI requires. This requires a somewhat confusing rearrangement.
- */
-
-typedef struct {
- unsigned id :16; /* query identification number */
-#if BYTE_ORDER == BIG_ENDIAN
- /* fields in third byte */
- unsigned qr: 1; /* response flag */
- unsigned opcode: 4; /* purpose of message */
- unsigned aa: 1; /* authoritive answer */
- unsigned tc: 1; /* truncated message */
- unsigned rd: 1; /* recursion desired */
- /* fields in fourth byte */
- unsigned ra: 1; /* recursion available */
- unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
- unsigned ad: 1; /* authentic data from named */
- unsigned cd: 1; /* checking disabled by resolver */
- unsigned rcode :4; /* response code */
-#endif
-#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
- /* fields in third byte */
- unsigned rd :1; /* recursion desired */
- unsigned tc :1; /* truncated message */
- unsigned aa :1; /* authoritive answer */
- unsigned opcode :4; /* purpose of message */
- unsigned qr :1; /* response flag */
- /* fields in fourth byte */
- unsigned rcode :4; /* response code */
- unsigned cd: 1; /* checking disabled by resolver */
- unsigned ad: 1; /* authentic data from named */
- unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
- unsigned ra :1; /* recursion available */
-#endif
- /* remaining bytes */
- unsigned qdcount :16; /* number of question entries */
- unsigned ancount :16; /* number of answer entries */
- unsigned nscount :16; /* number of authority entries */
- unsigned arcount :16; /* number of resource entries */
-} HEADER;
-
-#define PACKETSZ NS_PACKETSZ
-#define MAXDNAME NS_MAXDNAME
-#define MAXCDNAME NS_MAXCDNAME
-#define MAXLABEL NS_MAXLABEL
-#define HFIXEDSZ NS_HFIXEDSZ
-#define QFIXEDSZ NS_QFIXEDSZ
-#define RRFIXEDSZ NS_RRFIXEDSZ
-#define INT32SZ NS_INT32SZ
-#define INT16SZ NS_INT16SZ
-#define INADDRSZ NS_INADDRSZ
-#define IN6ADDRSZ NS_IN6ADDRSZ
-#define INDIR_MASK NS_CMPRSFLGS
-#define NAMESERVER_PORT NS_DEFAULTPORT
-
-#define S_ZONE ns_s_zn
-#define S_PREREQ ns_s_pr
-#define S_UPDATE ns_s_ud
-#define S_ADDT ns_s_ar
-
-#define QUERY ns_o_query
-#define IQUERY ns_o_iquery
-#define STATUS ns_o_status
-#define NS_NOTIFY_OP ns_o_notify
-#define NS_UPDATE_OP ns_o_update
-
-#define NOERROR ns_r_noerror
-#define FORMERR ns_r_formerr
-#define SERVFAIL ns_r_servfail
-#define NXDOMAIN ns_r_nxdomain
-#define NOTIMP ns_r_notimpl
-#define REFUSED ns_r_refused
-#define YXDOMAIN ns_r_yxdomain
-#define YXRRSET ns_r_yxrrset
-#define NXRRSET ns_r_nxrrset
-#define NOTAUTH ns_r_notauth
-#define NOTZONE ns_r_notzone
-
-#define DELETE ns_uop_delete
-#define ADD ns_uop_add
-
-#define T_A ns_t_a
-#define T_NS ns_t_ns
-#define T_MD ns_t_md
-#define T_MF ns_t_mf
-#define T_CNAME ns_t_cname
-#define T_SOA ns_t_soa
-#define T_MB ns_t_mb
-#define T_MG ns_t_mg
-#define T_MR ns_t_mr
-#define T_NULL ns_t_null
-#define T_WKS ns_t_wks
-#define T_PTR ns_t_ptr
-#define T_HINFO ns_t_hinfo
-#define T_MINFO ns_t_minfo
-#define T_MX ns_t_mx
-#define T_TXT ns_t_txt
-#define T_RP ns_t_rp
-#define T_AFSDB ns_t_afsdb
-#define T_X25 ns_t_x25
-#define T_ISDN ns_t_isdn
-#define T_RT ns_t_rt
-#define T_NSAP ns_t_nsap
-#define T_NSAP_PTR ns_t_nsap_ptr
-#define T_SIG ns_t_sig
-#define T_KEY ns_t_key
-#define T_PX ns_t_px
-#define T_GPOS ns_t_gpos
-#define T_AAAA ns_t_aaaa
-#define T_LOC ns_t_loc
-#define T_NXT ns_t_nxt
-#define T_EID ns_t_eid
-#define T_NIMLOC ns_t_nimloc
-#define T_SRV ns_t_srv
-#define T_ATMA ns_t_atma
-#define T_NAPTR ns_t_naptr
-#define T_IXFR ns_t_ixfr
-#define T_AXFR ns_t_axfr
-#define T_MAILB ns_t_mailb
-#define T_MAILA ns_t_maila
-#define T_ANY ns_t_any
-
-#define C_IN ns_c_in
-#define C_CHAOS ns_c_chaos
-#define C_HS ns_c_hs
-/* BIND_UPDATE */
-#define C_NONE ns_c_none
-#define C_ANY ns_c_any
-
-#define GETSHORT NS_GET16
-#define GETLONG NS_GET32
-#define PUTSHORT NS_PUT16
-#define PUTLONG NS_PUT32
-
-#endif /* _ARPA_NAMESER_COMPAT_ */
diff --git a/c/src/exec/libnetworking/arpa/telnet.h b/c/src/exec/libnetworking/arpa/telnet.h
deleted file mode 100644
index 09b85692da..0000000000
--- a/c/src/exec/libnetworking/arpa/telnet.h
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * @(#)telnet.h 8.2 (Berkeley) 12/15/93
- *
- * $Id$
- */
-
-#ifndef _ARPA_TELNET_H_
-#define _ARPA_TELNET_H_
-
-/*
- * Definitions for the TELNET protocol.
- */
-#define IAC 255 /* interpret as command: */
-#define DONT 254 /* you are not to use option */
-#define DO 253 /* please, you use option */
-#define WONT 252 /* I won't use option */
-#define WILL 251 /* I will use option */
-#define SB 250 /* interpret as subnegotiation */
-#define GA 249 /* you may reverse the line */
-#define EL 248 /* erase the current line */
-#define EC 247 /* erase the current character */
-#define AYT 246 /* are you there */
-#define AO 245 /* abort output--but let prog finish */
-#define IP 244 /* interrupt process--permanently */
-#define BREAK 243 /* break */
-#define DM 242 /* data mark--for connect. cleaning */
-#define NOP 241 /* nop */
-#define SE 240 /* end sub negotiation */
-#define EOR 239 /* end of record (transparent mode) */
-#define ABORT 238 /* Abort process */
-#define SUSP 237 /* Suspend process */
-#define xEOF 236 /* End of file: EOF is already used... */
-
-#define SYNCH 242 /* for telfunc calls */
-
-#ifdef TELCMDS
-char *telcmds[] = {
- "EOF", "SUSP", "ABORT", "EOR",
- "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
- "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC",
- 0
-};
-#else
-extern char *telcmds[];
-#endif
-
-#define TELCMD_FIRST xEOF
-#define TELCMD_LAST IAC
-#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
- (unsigned int)(x) >= TELCMD_FIRST)
-#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
-
-/* telnet options */
-#define TELOPT_BINARY 0 /* 8-bit data path */
-#define TELOPT_ECHO 1 /* echo */
-#define TELOPT_RCP 2 /* prepare to reconnect */
-#define TELOPT_SGA 3 /* suppress go ahead */
-#define TELOPT_NAMS 4 /* approximate message size */
-#define TELOPT_STATUS 5 /* give status */
-#define TELOPT_TM 6 /* timing mark */
-#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
-#define TELOPT_NAOL 8 /* negotiate about output line width */
-#define TELOPT_NAOP 9 /* negotiate about output page size */
-#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
-#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
-#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
-#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
-#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
-#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
-#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
-#define TELOPT_XASCII 17 /* extended ascic character set */
-#define TELOPT_LOGOUT 18 /* force logout */
-#define TELOPT_BM 19 /* byte macro */
-#define TELOPT_DET 20 /* data entry terminal */
-#define TELOPT_SUPDUP 21 /* supdup protocol */
-#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
-#define TELOPT_SNDLOC 23 /* send location */
-#define TELOPT_TTYPE 24 /* terminal type */
-#define TELOPT_EOR 25 /* end or record */
-#define TELOPT_TUID 26 /* TACACS user identification */
-#define TELOPT_OUTMRK 27 /* output marking */
-#define TELOPT_TTYLOC 28 /* terminal location number */
-#define TELOPT_3270REGIME 29 /* 3270 regime */
-#define TELOPT_X3PAD 30 /* X.3 PAD */
-#define TELOPT_NAWS 31 /* window size */
-#define TELOPT_TSPEED 32 /* terminal speed */
-#define TELOPT_LFLOW 33 /* remote flow control */
-#define TELOPT_LINEMODE 34 /* Linemode option */
-#define TELOPT_XDISPLOC 35 /* X Display Location */
-#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */
-#define TELOPT_AUTHENTICATION 37/* Authenticate */
-#define TELOPT_ENCRYPT 38 /* Encryption option */
-#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */
-#define TELOPT_EXOPL 255 /* extended-options-list */
-
-
-#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
-#ifdef TELOPTS
-char *telopts[NTELOPTS+1] = {
- "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
- "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
- "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
- "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
- "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
- "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
- "TACACS UID", "OUTPUT MARKING", "TTYLOC",
- "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
- "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
- "ENCRYPT", "NEW-ENVIRON",
- 0
-};
-#define TELOPT_FIRST TELOPT_BINARY
-#define TELOPT_LAST TELOPT_NEW_ENVIRON
-#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
-#define TELOPT(x) telopts[(x)-TELOPT_FIRST]
-#endif
-
-/* sub-option qualifiers */
-#define TELQUAL_IS 0 /* option is... */
-#define TELQUAL_SEND 1 /* send option */
-#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */
-#define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */
-#define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */
-
-#define LFLOW_OFF 0 /* Disable remote flow control */
-#define LFLOW_ON 1 /* Enable remote flow control */
-#define LFLOW_RESTART_ANY 2 /* Restart output on any char */
-#define LFLOW_RESTART_XON 3 /* Restart output only on XON */
-
-/*
- * LINEMODE suboptions
- */
-
-#define LM_MODE 1
-#define LM_FORWARDMASK 2
-#define LM_SLC 3
-
-#define MODE_EDIT 0x01
-#define MODE_TRAPSIG 0x02
-#define MODE_ACK 0x04
-#define MODE_SOFT_TAB 0x08
-#define MODE_LIT_ECHO 0x10
-
-#define MODE_MASK 0x1f
-
-/* Not part of protocol, but needed to simplify things... */
-#define MODE_FLOW 0x0100
-#define MODE_ECHO 0x0200
-#define MODE_INBIN 0x0400
-#define MODE_OUTBIN 0x0800
-#define MODE_FORCE 0x1000
-
-#define SLC_SYNCH 1
-#define SLC_BRK 2
-#define SLC_IP 3
-#define SLC_AO 4
-#define SLC_AYT 5
-#define SLC_EOR 6
-#define SLC_ABORT 7
-#define SLC_EOF 8
-#define SLC_SUSP 9
-#define SLC_EC 10
-#define SLC_EL 11
-#define SLC_EW 12
-#define SLC_RP 13
-#define SLC_LNEXT 14
-#define SLC_XON 15
-#define SLC_XOFF 16
-#define SLC_FORW1 17
-#define SLC_FORW2 18
-#define SLC_MCL 19
-#define SLC_MCR 20
-#define SLC_MCWL 21
-#define SLC_MCWR 22
-#define SLC_MCBOL 23
-#define SLC_MCEOL 24
-#define SLC_INSRT 25
-#define SLC_OVER 26
-#define SLC_ECR 27
-#define SLC_EWR 28
-#define SLC_EBOL 29
-#define SLC_EEOL 30
-
-#define NSLC 30
-
-/*
- * For backwards compatability, we define SLC_NAMES to be the
- * list of names if SLC_NAMES is not defined.
- */
-#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
- "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
- "LNEXT", "XON", "XOFF", "FORW1", "FORW2", \
- "MCL", "MCR", "MCWL", "MCWR", "MCBOL", \
- "MCEOL", "INSRT", "OVER", "ECR", "EWR", \
- "EBOL", "EEOL", \
- 0
-
-#ifdef SLC_NAMES
-char *slc_names[] = {
- SLC_NAMELIST
-};
-#else
-extern char *slc_names[];
-#define SLC_NAMES SLC_NAMELIST
-#endif
-
-#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
-#define SLC_NAME(x) slc_names[x]
-
-#define SLC_NOSUPPORT 0
-#define SLC_CANTCHANGE 1
-#define SLC_VARIABLE 2
-#define SLC_DEFAULT 3
-#define SLC_LEVELBITS 0x03
-
-#define SLC_FUNC 0
-#define SLC_FLAGS 1
-#define SLC_VALUE 2
-
-#define SLC_ACK 0x80
-#define SLC_FLUSHIN 0x40
-#define SLC_FLUSHOUT 0x20
-
-#define OLD_ENV_VAR 1
-#define OLD_ENV_VALUE 0
-#define NEW_ENV_VAR 0
-#define NEW_ENV_VALUE 1
-#define ENV_ESC 2
-#define ENV_USERVAR 3
-
-/*
- * AUTHENTICATION suboptions
- */
-
-/*
- * Who is authenticating who ...
- */
-#define AUTH_WHO_CLIENT 0 /* Client authenticating server */
-#define AUTH_WHO_SERVER 1 /* Server authenticating client */
-#define AUTH_WHO_MASK 1
-
-/*
- * amount of authentication done
- */
-#define AUTH_HOW_ONE_WAY 0
-#define AUTH_HOW_MUTUAL 2
-#define AUTH_HOW_MASK 2
-
-#define AUTHTYPE_NULL 0
-#define AUTHTYPE_KERBEROS_V4 1
-#define AUTHTYPE_KERBEROS_V5 2
-#define AUTHTYPE_SPX 3
-#define AUTHTYPE_MINK 4
-#define AUTHTYPE_CNT 5
-
-#define AUTHTYPE_TEST 99
-
-#ifdef AUTH_NAMES
-char *authtype_names[] = {
- "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK",
- 0
-};
-#else
-extern char *authtype_names[];
-#endif
-
-#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
-#define AUTHTYPE_NAME(x) authtype_names[x]
-
-/*
- * ENCRYPTion suboptions
- */
-#define ENCRYPT_IS 0 /* I pick encryption type ... */
-#define ENCRYPT_SUPPORT 1 /* I support encryption types ... */
-#define ENCRYPT_REPLY 2 /* Initial setup response */
-#define ENCRYPT_START 3 /* Am starting to send encrypted */
-#define ENCRYPT_END 4 /* Am ending encrypted */
-#define ENCRYPT_REQSTART 5 /* Request you start encrypting */
-#define ENCRYPT_REQEND 6 /* Request you end encrypting */
-#define ENCRYPT_ENC_KEYID 7
-#define ENCRYPT_DEC_KEYID 8
-#define ENCRYPT_CNT 9
-
-#define ENCTYPE_ANY 0
-#define ENCTYPE_DES_CFB64 1
-#define ENCTYPE_DES_OFB64 2
-#define ENCTYPE_CNT 3
-
-#ifdef ENCRYPT_NAMES
-char *encrypt_names[] = {
- "IS", "SUPPORT", "REPLY", "START", "END",
- "REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
- 0
-};
-char *enctype_names[] = {
- "ANY", "DES_CFB64", "DES_OFB64",
- 0
-};
-#else
-extern char *encrypt_names[];
-extern char *enctype_names[];
-#endif
-
-
-#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
-#define ENCRYPT_NAME(x) encrypt_names[x]
-
-#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
-#define ENCTYPE_NAME(x) enctype_names[x]
-
-#endif /* !_TELNET_H_ */
diff --git a/c/src/exec/libnetworking/bpfilter.h b/c/src/exec/libnetworking/bpfilter.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/exec/libnetworking/bpfilter.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/exec/libnetworking/kern/kern_subr.c b/c/src/exec/libnetworking/kern/kern_subr.c
deleted file mode 100644
index 71e51fc442..0000000000
--- a/c/src/exec/libnetworking/kern/kern_subr.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/malloc.h>
-#include <sys/queue.h>
-
-int
-uiomove(cp, n, uio)
- register caddr_t cp;
- register int n;
- register struct uio *uio;
-{
- register struct iovec *iov;
- u_int cnt;
- int error;
-
-#ifdef DIAGNOSTIC
- if (uio->uio_rw != UIO_READ && uio->uio_rw != UIO_WRITE)
- panic("uiomove: mode");
-#endif
- while (n > 0 && uio->uio_resid) {
- iov = uio->uio_iov;
- cnt = iov->iov_len;
- if (cnt == 0) {
- uio->uio_iov++;
- uio->uio_iovcnt--;
- continue;
- }
- if (cnt > n)
- cnt = n;
-
- switch (uio->uio_segflg) {
-
- case UIO_USERSPACE:
- case UIO_USERISPACE:
- if (uio->uio_rw == UIO_READ)
- error = copyout(cp, iov->iov_base, cnt);
- else
- error = copyin(iov->iov_base, cp, cnt);
- if (error)
- return (error);
- break;
-
- case UIO_SYSSPACE:
- if (uio->uio_rw == UIO_READ)
- bcopy((caddr_t)cp, iov->iov_base, cnt);
- else
- bcopy(iov->iov_base, (caddr_t)cp, cnt);
- break;
- case UIO_NOCOPY:
- break;
- }
- iov->iov_base += cnt;
- iov->iov_len -= cnt;
- uio->uio_resid -= cnt;
- uio->uio_offset += cnt;
- cp += cnt;
- n -= cnt;
- }
- return (0);
-}
-
-#ifdef vax /* unused except by ct.c, other oddities XXX */
-/*
- * Get next character written in by user from uio.
- */
-int
-uwritec(uio)
- struct uio *uio;
-{
- register struct iovec *iov;
- register int c;
-
- if (uio->uio_resid <= 0)
- return (-1);
-again:
- if (uio->uio_iovcnt <= 0)
- panic("uwritec");
- iov = uio->uio_iov;
- if (iov->iov_len == 0) {
- uio->uio_iov++;
- if (--uio->uio_iovcnt == 0)
- return (-1);
- goto again;
- }
- switch (uio->uio_segflg) {
-
- case UIO_USERSPACE:
- c = fubyte(iov->iov_base);
- break;
-
- case UIO_SYSSPACE:
- c = *(u_char *) iov->iov_base;
- break;
-
- case UIO_USERISPACE:
- c = fuibyte(iov->iov_base);
- break;
- }
- if (c < 0)
- return (-1);
- iov->iov_base++;
- iov->iov_len--;
- uio->uio_resid--;
- uio->uio_offset++;
- return (c);
-}
-#endif /* vax */
-
-/*
- * General routine to allocate a hash table.
- */
-void *
-hashinit(elements, type, hashmask)
- int elements, type;
- u_long *hashmask;
-{
- long hashsize;
- LIST_HEAD(generic, generic) *hashtbl;
- int i;
-
- if (elements <= 0)
- panic("hashinit: bad elements");
- for (hashsize = 1; hashsize <= elements; hashsize <<= 1)
- continue;
- hashsize >>= 1;
- hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, M_WAITOK);
- for (i = 0; i < hashsize; i++)
- LIST_INIT(&hashtbl[i]);
- *hashmask = hashsize - 1;
- return (hashtbl);
-}
-
-#define NPRIMES 27
-static int primes[] = { 1, 13, 31, 61, 127, 251, 509, 761, 1021, 1531, 2039,
- 2557, 3067, 3583, 4093, 4603, 5119, 5623, 6143, 6653,
- 7159, 7673, 8191, 12281, 16381, 24571, 32749 };
-
-/*
- * General routine to allocate a prime number sized hash table.
- */
-void *
-phashinit(elements, type, nentries)
- int elements, type;
- u_long *nentries;
-{
- long hashsize;
- LIST_HEAD(generic, generic) *hashtbl;
- int i;
-
- if (elements <= 0)
- panic("phashinit: bad elements");
- for (i = 1, hashsize = primes[1]; hashsize <= elements;) {
- i++;
- if (i == NPRIMES)
- break;
- hashsize = primes[i];
- }
- hashsize = primes[i - 1];
- hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, M_WAITOK);
- for (i = 0; i < hashsize; i++)
- LIST_INIT(&hashtbl[i]);
- *nentries = hashsize;
- return (hashtbl);
-}
diff --git a/c/src/exec/libnetworking/kern/uipc_domain.c b/c/src/exec/libnetworking/kern/uipc_domain.c
deleted file mode 100644
index 910007395c..0000000000
--- a/c/src/exec/libnetworking/kern/uipc_domain.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/domain.h>
-#include <sys/mbuf.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-
-/*
- * System initialization
- *
- * Note: domain initialization wants to take place on a per domain basis
- * as a result of traversing a linker set. Most likely, each domain
- * want to call a registration function rather than being handled here
- * in domaininit(). Probably this will look like:
- *
- * SYSINIT(unique, SI_SUB_PROTO_DOMAI, SI_ORDER_ANY, domain_add, xxx)
- *
- * Where 'xxx' is replaced by the address of a parameter struct to be
- * passed to the doamin_add() function.
- */
-
-#if !defined(__rtems__)
-static int x_save_spl; /* used by kludge*/
-static void kludge_splimp __P((void *));
-static void kludge_splx __P((void *));
- void domaininit __P((void *));
-SYSINIT(splimp, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, kludge_splimp, &x_save_spl)
-SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL)
-SYSINIT(splx, SI_SUB_PROTO_END, SI_ORDER_FIRST, kludge_splx, &x_save_spl)
-#endif
-
-static void pffasttimo __P((void *));
-static void pfslowtimo __P((void *));
-
-struct domain *domains;
-
-#define ADDDOMAIN(x) { \
- __CONCAT(x,domain.dom_next) = domains; \
- domains = &__CONCAT(x,domain); \
-}
-
-extern struct linker_set domain_set;
-
-/* ARGSUSED*/
-void
-domaininit(dummy)
- void *dummy;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
-/* - not in our sources
-#ifdef ISDN
- ADDDOMAIN(isdn);
-#endif
-*/
-
- for (dp = domains; dp; dp = dp->dom_next) {
- if (dp->dom_init)
- (*dp->dom_init)();
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++){
-#ifdef PRU_OLDSTYLE
- /* See comments in uipc_socket2.c. */
- if (pr->pr_usrreqs == 0 && pr->pr_ousrreq)
- pr->pr_usrreqs = &pru_oldstyle;
-#endif
- if (pr->pr_init)
- (*pr->pr_init)();
- }
- }
-
- if (max_linkhdr < 16) /* XXX */
- max_linkhdr = 16;
- max_hdr = max_linkhdr + max_protohdr;
- max_datalen = MHLEN - max_hdr;
- timeout(pffasttimo, (void *)0, 1);
- timeout(pfslowtimo, (void *)0, 1);
-}
-
-
-/*
- * The following two operations are kludge code. Most likely, they should
- * be done as a "domainpreinit()" for the first function and then rolled
- * in as the last act of "domaininit()" for the second.
- *
- * In point of fact, it is questionable why other initialization prior
- * to this does not also take place at splimp by default.
- */
-static void
-kludge_splimp(udata)
- void *udata;
-{
- int *savesplp = udata;
-
- *savesplp = splimp();
-}
-
-static void
-kludge_splx(udata)
- void *udata;
-{
- int *savesplp = udata;
-
- splx( *savesplp);
-}
-
-
-
-struct protosw *
-pffindtype(int family, int type)
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- if (dp->dom_family == family)
- goto found;
- return (0);
-found:
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_type && pr->pr_type == type)
- return (pr);
- return (0);
-}
-
-struct protosw *
-pffindproto(int family, int protocol, int type)
-{
- register struct domain *dp;
- register struct protosw *pr;
- struct protosw *maybe = 0;
-
- if (family == 0)
- return (0);
- for (dp = domains; dp; dp = dp->dom_next)
- if (dp->dom_family == family)
- goto found;
- return (0);
-found:
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) {
- if ((pr->pr_protocol == protocol) && (pr->pr_type == type))
- return (pr);
-
- if (type == SOCK_RAW && pr->pr_type == SOCK_RAW &&
- pr->pr_protocol == 0 && maybe == (struct protosw *)0)
- maybe = pr;
- }
- return (maybe);
-}
-
-void
-pfctlinput(cmd, sa)
- int cmd;
- struct sockaddr *sa;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_ctlinput)
- (*pr->pr_ctlinput)(cmd, sa, (void *)0);
-}
-
-static void
-pfslowtimo(arg)
- void *arg;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_slowtimo)
- (*pr->pr_slowtimo)();
- timeout(pfslowtimo, (void *)0, hz/2);
-}
-
-static void
-pffasttimo(arg)
- void *arg;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_fasttimo)
- (*pr->pr_fasttimo)();
- timeout(pffasttimo, (void *)0, hz/5);
-}
diff --git a/c/src/exec/libnetworking/kern/uipc_mbuf.c b/c/src/exec/libnetworking/kern/uipc_mbuf.c
deleted file mode 100644
index f682be94a7..0000000000
--- a/c/src/exec/libnetworking/kern/uipc_mbuf.c
+++ /dev/null
@@ -1,851 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1991, 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.
- *
- * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/malloc.h>
-#define MBTYPES
-#include <sys/mbuf.h>
-#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/vm_kern.h>
-#include <vm/vm_extern.h>
-
-static void mbinit __P((void *));
-SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbinit, NULL)
-
-struct mbuf *mbutl;
-char *mclrefcnt;
-struct mbstat mbstat;
-struct mbuf *mmbfree;
-union mcluster *mclfree;
-int max_linkhdr;
-int max_protohdr;
-int max_hdr;
-int max_datalen;
-
-static void m_reclaim __P((void));
-
-/* "number of clusters of pages" */
-#define NCL_INIT 1
-
-#define NMB_INIT 16
-
-/* ARGSUSED*/
-static void
-mbinit(dummy)
- void *dummy;
-{
- int s;
-
- mmbfree = NULL; mclfree = NULL;
- s = splimp();
- if (m_mballoc(NMB_INIT, M_DONTWAIT) == 0)
- goto bad;
- if (m_clalloc(NCL_INIT, M_DONTWAIT) == 0)
- goto bad;
- splx(s);
- return;
-bad:
- panic("mbinit");
-}
-
-/*
- * Allocate at least nmb mbufs and place on mbuf free list.
- * Must be called at splimp.
- */
-/* ARGSUSED */
-int
-m_mballoc(nmb, nowait)
- register int nmb;
- int nowait;
-{
- register caddr_t p;
- register int i;
- int nbytes;
-
- /* Once we run out of map space, it will be impossible to get
- * any more (nothing is ever freed back to the map) (XXX which
- * is dumb). (however you are not dead as m_reclaim might
- * still be able to free a substantial amount of space).
- */
- if (mb_map_full)
- return (0);
-
- nbytes = round_page(nmb * MSIZE);
- p = (caddr_t)kmem_malloc(mb_map, nbytes, nowait ? M_NOWAIT : M_WAITOK);
- /*
- * Either the map is now full, or this is nowait and there
- * are no pages left.
- */
- if (p == NULL)
- return (0);
-
- nmb = nbytes / MSIZE;
- for (i = 0; i < nmb; i++) {
- ((struct mbuf *)p)->m_next = mmbfree;
- mmbfree = (struct mbuf *)p;
- p += MSIZE;
- }
- mbstat.m_mbufs += nmb;
- return (1);
-}
-
-/*
- * Allocate some number of mbuf clusters
- * and place on cluster free list.
- * Must be called at splimp.
- */
-/* ARGSUSED */
-int
-m_clalloc(ncl, nowait)
- register int ncl;
- int nowait;
-{
- register caddr_t p;
- register int i;
-
- /*
- * Once we run out of map space, it will be impossible
- * to get any more (nothing is ever freed back to the
- * map).
- */
- if (mb_map_full)
- return (0);
-
- p = (caddr_t)kmem_malloc(mb_map, ncl*MCLBYTES,
- nowait ? M_NOWAIT : M_WAITOK);
- /*
- * Either the map is now full, or this is nowait and there
- * are no pages left.
- */
- if (p == NULL)
- return (0);
-
- for (i = 0; i < ncl; i++) {
- ((union mcluster *)p)->mcl_next = mclfree;
- mclfree = (union mcluster *)p;
- p += MCLBYTES;
- mbstat.m_clfree++;
- }
- mbstat.m_clusters += ncl;
- return (1);
-}
-
-/*
- * When MGET failes, ask protocols to free space when short of memory,
- * then re-attempt to allocate an mbuf.
- */
-struct mbuf *
-m_retry(i, t)
- int i, t;
-{
- register struct mbuf *m;
-
- m_reclaim();
-#define m_retry(i, t) (struct mbuf *)0
- MGET(m, i, t);
-#undef m_retry
- if (m != NULL)
- mbstat.m_wait++;
- else
- mbstat.m_drops++;
- return (m);
-}
-
-/*
- * As above; retry an MGETHDR.
- */
-struct mbuf *
-m_retryhdr(i, t)
- int i, t;
-{
- register struct mbuf *m;
-
- m_reclaim();
-#define m_retryhdr(i, t) (struct mbuf *)0
- MGETHDR(m, i, t);
-#undef m_retryhdr
- if (m != NULL)
- mbstat.m_wait++;
- else
- mbstat.m_drops++;
- return (m);
-}
-
-static void
-m_reclaim()
-{
- register struct domain *dp;
- register struct protosw *pr;
- int s = splimp();
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_drain)
- (*pr->pr_drain)();
- splx(s);
- mbstat.m_drain++;
-}
-
-/*
- * Space allocation routines.
- * These are also available as macros
- * for critical paths.
- */
-struct mbuf *
-m_get(nowait, type)
- int nowait, type;
-{
- register struct mbuf *m;
-
- MGET(m, nowait, type);
- return (m);
-}
-
-struct mbuf *
-m_gethdr(nowait, type)
- int nowait, type;
-{
- register struct mbuf *m;
-
- MGETHDR(m, nowait, type);
- return (m);
-}
-
-struct mbuf *
-m_getclr(nowait, type)
- int nowait, type;
-{
- register struct mbuf *m;
-
- MGET(m, nowait, type);
- if (m == 0)
- return (0);
- bzero(mtod(m, caddr_t), MLEN);
- return (m);
-}
-
-struct mbuf *
-m_free(m)
- struct mbuf *m;
-{
- register struct mbuf *n;
-
- MFREE(m, n);
- return (n);
-}
-
-void
-m_freem(m)
- register struct mbuf *m;
-{
- register struct mbuf *n;
-
- if (m == NULL)
- return;
- do {
- MFREE(m, n);
- m = n;
- } while (m);
-}
-
-/*
- * Mbuffer utility routines.
- */
-
-/*
- * Lesser-used path for M_PREPEND:
- * allocate new mbuf to prepend to chain,
- * copy junk along.
- */
-struct mbuf *
-m_prepend(m, len, how)
- register struct mbuf *m;
- int len, how;
-{
- struct mbuf *mn;
-
- MGET(mn, how, m->m_type);
- if (mn == (struct mbuf *)NULL) {
- m_freem(m);
- return ((struct mbuf *)NULL);
- }
- if (m->m_flags & M_PKTHDR) {
- M_COPY_PKTHDR(mn, m);
- m->m_flags &= ~M_PKTHDR;
- }
- mn->m_next = m;
- m = mn;
- if (len < MHLEN)
- MH_ALIGN(m, len);
- m->m_len = len;
- return (m);
-}
-
-/*
- * Make a copy of an mbuf chain starting "off0" bytes from the beginning,
- * continuing for "len" bytes. If len is M_COPYALL, copy to end of mbuf.
- * The wait parameter is a choice of M_WAIT/M_DONTWAIT from caller.
- */
-static int MCFail;
-
-struct mbuf *
-m_copym(m, off0, len, wait)
- register struct mbuf *m;
- int off0, wait;
- register int len;
-{
- register struct mbuf *n, **np;
- register int off = off0;
- struct mbuf *top;
- int copyhdr = 0;
-
- if (off < 0 || len < 0)
- panic("m_copym");
- if (off == 0 && m->m_flags & M_PKTHDR)
- copyhdr = 1;
- while (off > 0) {
- if (m == 0)
- panic("m_copym");
- if (off < m->m_len)
- break;
- off -= m->m_len;
- m = m->m_next;
- }
- np = &top;
- top = 0;
- while (len > 0) {
- if (m == 0) {
- if (len != M_COPYALL)
- panic("m_copym");
- break;
- }
- MGET(n, wait, m->m_type);
- *np = n;
- if (n == 0)
- goto nospace;
- if (copyhdr) {
- M_COPY_PKTHDR(n, m);
- if (len == M_COPYALL)
- n->m_pkthdr.len -= off0;
- else
- n->m_pkthdr.len = len;
- copyhdr = 0;
- }
- n->m_len = min(len, m->m_len - off);
- if (m->m_flags & M_EXT) {
- n->m_data = m->m_data + off;
- if(!m->m_ext.ext_ref)
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- else
- (*(m->m_ext.ext_ref))(m->m_ext.ext_buf,
- m->m_ext.ext_size);
- n->m_ext = m->m_ext;
- n->m_flags |= M_EXT;
- } else
- bcopy(mtod(m, caddr_t)+off, mtod(n, caddr_t),
- (unsigned)n->m_len);
- if (len != M_COPYALL)
- len -= n->m_len;
- off = 0;
- m = m->m_next;
- np = &n->m_next;
- }
- if (top == 0)
- MCFail++;
- return (top);
-nospace:
- m_freem(top);
- MCFail++;
- return (0);
-}
-
-/*
- * Copy an entire packet, including header (which must be present).
- * An optimization of the common case `m_copym(m, 0, M_COPYALL, how)'.
- */
-struct mbuf *
-m_copypacket(m, how)
- struct mbuf *m;
- int how;
-{
- struct mbuf *top, *n, *o;
-
- MGET(n, how, m->m_type);
- top = n;
- if (!n)
- goto nospace;
-
- M_COPY_PKTHDR(n, m);
- n->m_len = m->m_len;
- if (m->m_flags & M_EXT) {
- n->m_data = m->m_data;
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- n->m_ext = m->m_ext;
- n->m_flags |= M_EXT;
- } else {
- bcopy(mtod(m, char *), mtod(n, char *), n->m_len);
- }
-
- m = m->m_next;
- while (m) {
- MGET(o, how, m->m_type);
- if (!o)
- goto nospace;
-
- n->m_next = o;
- n = n->m_next;
-
- n->m_len = m->m_len;
- if (m->m_flags & M_EXT) {
- n->m_data = m->m_data;
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- n->m_ext = m->m_ext;
- n->m_flags |= M_EXT;
- } else {
- bcopy(mtod(m, char *), mtod(n, char *), n->m_len);
- }
-
- m = m->m_next;
- }
- return top;
-nospace:
- m_freem(top);
- MCFail++;
- return 0;
-}
-
-/*
- * Copy data from an mbuf chain starting "off" bytes from the beginning,
- * continuing for "len" bytes, into the indicated buffer.
- */
-void
-m_copydata(m, off, len, cp)
- register struct mbuf *m;
- register int off;
- register int len;
- caddr_t cp;
-{
- register unsigned count;
-
- if (off < 0 || len < 0)
- panic("m_copydata");
- while (off > 0) {
- if (m == 0)
- panic("m_copydata");
- if (off < m->m_len)
- break;
- off -= m->m_len;
- m = m->m_next;
- }
- while (len > 0) {
- if (m == 0)
- panic("m_copydata");
- count = min(m->m_len - off, len);
- bcopy(mtod(m, caddr_t) + off, cp, count);
- len -= count;
- cp += count;
- off = 0;
- m = m->m_next;
- }
-}
-
-/*
- * Concatenate mbuf chain n to m.
- * Both chains must be of the same type (e.g. MT_DATA).
- * Any m_pkthdr is not updated.
- */
-void
-m_cat(m, n)
- register struct mbuf *m, *n;
-{
- while (m->m_next)
- m = m->m_next;
- while (n) {
- if (m->m_flags & M_EXT ||
- m->m_data + m->m_len + n->m_len >= &m->m_dat[MLEN]) {
- /* just join the two chains */
- m->m_next = n;
- return;
- }
- /* splat the data from one into the other */
- bcopy(mtod(n, caddr_t), mtod(m, caddr_t) + m->m_len,
- (u_int)n->m_len);
- m->m_len += n->m_len;
- n = m_free(n);
- }
-}
-
-void
-m_adj(mp, req_len)
- struct mbuf *mp;
- int req_len;
-{
- register int len = req_len;
- register struct mbuf *m;
- register int count;
-
- if ((m = mp) == NULL)
- return;
- if (len >= 0) {
- /*
- * Trim from head.
- */
- while (m != NULL && len > 0) {
- if (m->m_len <= len) {
- len -= m->m_len;
- m->m_len = 0;
- m = m->m_next;
- } else {
- m->m_len -= len;
- m->m_data += len;
- len = 0;
- }
- }
- m = mp;
- if (mp->m_flags & M_PKTHDR)
- m->m_pkthdr.len -= (req_len - len);
- } else {
- /*
- * Trim from tail. Scan the mbuf chain,
- * calculating its length and finding the last mbuf.
- * If the adjustment only affects this mbuf, then just
- * adjust and return. Otherwise, rescan and truncate
- * after the remaining size.
- */
- len = -len;
- count = 0;
- for (;;) {
- count += m->m_len;
- if (m->m_next == (struct mbuf *)0)
- break;
- m = m->m_next;
- }
- if (m->m_len >= len) {
- m->m_len -= len;
- if (mp->m_flags & M_PKTHDR)
- mp->m_pkthdr.len -= len;
- return;
- }
- count -= len;
- if (count < 0)
- count = 0;
- /*
- * Correct length for chain is "count".
- * Find the mbuf with last data, adjust its length,
- * and toss data from remaining mbufs on chain.
- */
- m = mp;
- if (m->m_flags & M_PKTHDR)
- m->m_pkthdr.len = count;
- for (; m; m = m->m_next) {
- if (m->m_len >= count) {
- m->m_len = count;
- break;
- }
- count -= m->m_len;
- }
- while (m->m_next)
- (m = m->m_next) ->m_len = 0;
- }
-}
-
-/*
- * Rearange an mbuf chain so that len bytes are contiguous
- * and in the data area of an mbuf (so that mtod and dtom
- * will work for a structure of size len). Returns the resulting
- * mbuf chain on success, frees it and returns null on failure.
- * If there is room, it will add up to max_protohdr-len extra bytes to the
- * contiguous region in an attempt to avoid being called next time.
- */
-static int MPFail;
-
-struct mbuf *
-m_pullup(n, len)
- register struct mbuf *n;
- int len;
-{
- register struct mbuf *m;
- register int count;
- int space;
-
- /*
- * If first mbuf has no cluster, and has room for len bytes
- * without shifting current data, pullup into it,
- * otherwise allocate a new mbuf to prepend to the chain.
- */
- if ((n->m_flags & M_EXT) == 0 &&
- n->m_data + len < &n->m_dat[MLEN] && n->m_next) {
- if (n->m_len >= len)
- return (n);
- m = n;
- n = n->m_next;
- len -= m->m_len;
- } else {
- if (len > MHLEN)
- goto bad;
- MGET(m, M_DONTWAIT, n->m_type);
- if (m == 0)
- goto bad;
- m->m_len = 0;
- if (n->m_flags & M_PKTHDR) {
- M_COPY_PKTHDR(m, n);
- n->m_flags &= ~M_PKTHDR;
- }
- }
- space = &m->m_dat[MLEN] - (m->m_data + m->m_len);
- do {
- count = min(min(max(len, max_protohdr), space), n->m_len);
- bcopy(mtod(n, caddr_t), mtod(m, caddr_t) + m->m_len,
- (unsigned)count);
- len -= count;
- m->m_len += count;
- n->m_len -= count;
- space -= count;
- if (n->m_len)
- n->m_data += count;
- else
- n = m_free(n);
- } while (len > 0 && n);
- if (len > 0) {
- (void) m_free(m);
- goto bad;
- }
- m->m_next = n;
- return (m);
-bad:
- m_freem(n);
- MPFail++;
- return (0);
-}
-
-/*
- * Partition an mbuf chain in two pieces, returning the tail --
- * all but the first len0 bytes. In case of failure, it returns NULL and
- * attempts to restore the chain to its original state.
- */
-struct mbuf *
-m_split(m0, len0, wait)
- register struct mbuf *m0;
- int len0, wait;
-{
- register struct mbuf *m, *n;
- unsigned len = len0, remain;
-
- for (m = m0; m && len > m->m_len; m = m->m_next)
- len -= m->m_len;
- if (m == 0)
- return (0);
- remain = m->m_len - len;
- if (m0->m_flags & M_PKTHDR) {
- MGETHDR(n, wait, m0->m_type);
- if (n == 0)
- return (0);
- n->m_pkthdr.rcvif = m0->m_pkthdr.rcvif;
- n->m_pkthdr.len = m0->m_pkthdr.len - len0;
- m0->m_pkthdr.len = len0;
- if (m->m_flags & M_EXT)
- goto extpacket;
- if (remain > MHLEN) {
- /* m can't be the lead packet */
- MH_ALIGN(n, 0);
- n->m_next = m_split(m, len, wait);
- if (n->m_next == 0) {
- (void) m_free(n);
- return (0);
- } else
- return (n);
- } else
- MH_ALIGN(n, remain);
- } else if (remain == 0) {
- n = m->m_next;
- m->m_next = 0;
- return (n);
- } else {
- MGET(n, wait, m->m_type);
- if (n == 0)
- return (0);
- M_ALIGN(n, remain);
- }
-extpacket:
- if (m->m_flags & M_EXT) {
- n->m_flags |= M_EXT;
- n->m_ext = m->m_ext;
- if(!m->m_ext.ext_ref)
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- else
- (*(m->m_ext.ext_ref))(m->m_ext.ext_buf,
- m->m_ext.ext_size);
- m->m_ext.ext_size = 0; /* For Accounting XXXXXX danger */
- n->m_data = m->m_data + len;
- } else {
- bcopy(mtod(m, caddr_t) + len, mtod(n, caddr_t), remain);
- }
- n->m_len = remain;
- m->m_len = len;
- n->m_next = m->m_next;
- m->m_next = 0;
- return (n);
-}
-/*
- * Routine to copy from device local memory into mbufs.
- */
-struct mbuf *
-m_devget(buf, totlen, off0, ifp, copy)
- char *buf;
- int totlen, off0;
- struct ifnet *ifp;
- void (*copy) __P((char *from, caddr_t to, u_int len));
-{
- register struct mbuf *m;
- struct mbuf *top = 0, **mp = &top;
- register int off = off0, len;
- register char *cp;
- char *epkt;
-
- cp = buf;
- epkt = cp + totlen;
- if (off) {
- cp += off + 2 * sizeof(u_short);
- totlen -= 2 * sizeof(u_short);
- }
- MGETHDR(m, M_DONTWAIT, MT_DATA);
- if (m == 0)
- return (0);
- m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = totlen;
- m->m_len = MHLEN;
-
- while (totlen > 0) {
- if (top) {
- MGET(m, M_DONTWAIT, MT_DATA);
- if (m == 0) {
- m_freem(top);
- return (0);
- }
- m->m_len = MLEN;
- }
- len = min(totlen, epkt - cp);
- if (len >= MINCLSIZE) {
- MCLGET(m, M_DONTWAIT);
- if (m->m_flags & M_EXT)
- m->m_len = len = min(len, MCLBYTES);
- else
- len = m->m_len;
- } else {
- /*
- * Place initial small packet/header at end of mbuf.
- */
- if (len < m->m_len) {
- if (top == 0 && len + max_linkhdr <= m->m_len)
- m->m_data += max_linkhdr;
- m->m_len = len;
- } else
- len = m->m_len;
- }
- if (copy)
- copy(cp, mtod(m, caddr_t), (unsigned)len);
- else
- bcopy(cp, mtod(m, caddr_t), (unsigned)len);
- cp += len;
- *mp = m;
- mp = &m->m_next;
- totlen -= len;
- if (cp == epkt)
- cp = buf;
- }
- return (top);
-}
-
-/*
- * Copy data from a buffer back into the indicated mbuf chain,
- * starting "off" bytes from the beginning, extending the mbuf
- * chain if necessary.
- */
-void
-m_copyback(m0, off, len, cp)
- struct mbuf *m0;
- register int off;
- register int len;
- caddr_t cp;
-{
- register int mlen;
- register struct mbuf *m = m0, *n;
- int totlen = 0;
-
- if (m0 == 0)
- return;
- while (off > (mlen = m->m_len)) {
- off -= mlen;
- totlen += mlen;
- if (m->m_next == 0) {
- n = m_getclr(M_DONTWAIT, m->m_type);
- if (n == 0)
- goto out;
- n->m_len = min(MLEN, len + off);
- m->m_next = n;
- }
- m = m->m_next;
- }
- while (len > 0) {
- mlen = min (m->m_len - off, len);
- bcopy(cp, off + mtod(m, caddr_t), (unsigned)mlen);
- cp += mlen;
- len -= mlen;
- mlen += off;
- off = 0;
- totlen += mlen;
- if (len == 0)
- break;
- if (m->m_next == 0) {
- n = m_get(M_DONTWAIT, m->m_type);
- if (n == 0)
- break;
- n->m_len = min(MLEN, len);
- m->m_next = n;
- }
- m = m->m_next;
- }
-out: if (((m = m0)->m_flags & M_PKTHDR) && (m->m_pkthdr.len < totlen))
- m->m_pkthdr.len = totlen;
-}
diff --git a/c/src/exec/libnetworking/kern/uipc_socket.c b/c/src/exec/libnetworking/kern/uipc_socket.c
deleted file mode 100644
index 895d1c7d45..0000000000
--- a/c/src/exec/libnetworking/kern/uipc_socket.c
+++ /dev/null
@@ -1,1100 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 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.
- *
- * @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/file.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/domain.h>
-#include <sys/kernel.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/resourcevar.h>
-#include <sys/signalvar.h>
-#include <sys/sysctl.h>
-
-static int somaxconn = SOMAXCONN;
-SYSCTL_INT(_kern, KERN_SOMAXCONN, somaxconn, CTLFLAG_RW, &somaxconn, 0, "");
-
-/*
- * Socket operation routines.
- * These routines are called by the routines in
- * sys_socket.c or from a system process, and
- * implement the semantics of socket operations by
- * switching out to the protocol specific routines.
- */
-/*ARGSUSED*/
-int
-socreate(dom, aso, type, proto, p)
- int dom;
- struct socket **aso;
- register int type;
- int proto;
- struct proc *p;
-{
- register struct protosw *prp;
- register struct socket *so;
- register int error;
-
- if (proto)
- prp = pffindproto(dom, proto, type);
- else
- prp = pffindtype(dom, type);
- if (prp == 0 || prp->pr_usrreqs == 0)
- return (EPROTONOSUPPORT);
- if (prp->pr_type != type)
- return (EPROTOTYPE);
- MALLOC(so, struct socket *, sizeof(*so), M_SOCKET, M_WAIT);
- bzero((caddr_t)so, sizeof(*so));
- TAILQ_INIT(&so->so_incomp);
- TAILQ_INIT(&so->so_comp);
- so->so_type = type;
- so->so_state = SS_PRIV;
- so->so_uid = 0;
- so->so_proto = prp;
- error = (*prp->pr_usrreqs->pru_attach)(so, proto);
- if (error) {
- so->so_state |= SS_NOFDREF;
- sofree(so);
- return (error);
- }
- *aso = so;
- return (0);
-}
-
-int
-sobind(so, nam)
- struct socket *so;
- struct mbuf *nam;
-{
- int s = splnet();
- int error;
-
- error = (*so->so_proto->pr_usrreqs->pru_bind)(so, nam);
- splx(s);
- return (error);
-}
-
-int
-solisten(so, backlog)
- register struct socket *so;
- int backlog;
-{
- int s = splnet(), error;
-
- error = (*so->so_proto->pr_usrreqs->pru_listen)(so);
- if (error) {
- splx(s);
- return (error);
- }
- if (so->so_comp.tqh_first == NULL)
- so->so_options |= SO_ACCEPTCONN;
- if (backlog < 0 || backlog > somaxconn)
- backlog = somaxconn;
- so->so_qlimit = backlog;
- splx(s);
- return (0);
-}
-
-void
-sofree(so)
- register struct socket *so;
-{
- struct socket *head = so->so_head;
-
- if (so->so_pcb || (so->so_state & SS_NOFDREF) == 0)
- return;
- if (head != NULL) {
- if (so->so_state & SS_INCOMP) {
- TAILQ_REMOVE(&head->so_incomp, so, so_list);
- head->so_incqlen--;
- } else if (so->so_state & SS_COMP) {
- TAILQ_REMOVE(&head->so_comp, so, so_list);
- } else {
- panic("sofree: not queued");
- }
- head->so_qlen--;
- so->so_state &= ~(SS_INCOMP|SS_COMP);
- so->so_head = NULL;
- }
- sbrelease(&so->so_snd);
- sorflush(so);
- FREE(so, M_SOCKET);
-}
-
-/*
- * Close a socket on last file table reference removal.
- * Initiate disconnect if connected.
- * Free socket when disconnect complete.
- */
-int
-soclose(so)
- register struct socket *so;
-{
- int s = splnet(); /* conservative */
- int error = 0;
-
- if (so->so_options & SO_ACCEPTCONN) {
- struct socket *sp, *sonext;
-
- for (sp = so->so_incomp.tqh_first; sp != NULL; sp = sonext) {
- sonext = sp->so_list.tqe_next;
- (void) soabort(sp);
- }
- for (sp = so->so_comp.tqh_first; sp != NULL; sp = sonext) {
- sonext = sp->so_list.tqe_next;
- (void) soabort(sp);
- }
- }
- if (so->so_pcb == 0)
- goto discard;
- if (so->so_state & SS_ISCONNECTED) {
- if ((so->so_state & SS_ISDISCONNECTING) == 0) {
- error = sodisconnect(so);
- if (error)
- goto drop;
- }
- if (so->so_options & SO_LINGER) {
- if ((so->so_state & SS_ISDISCONNECTING) &&
- (so->so_state & SS_NBIO))
- goto drop;
- while (so->so_state & SS_ISCONNECTED) {
- soconnsleep (so);
- }
- }
- }
-drop:
- if (so->so_pcb) {
- int error2 = (*so->so_proto->pr_usrreqs->pru_detach)(so);
- if (error == 0)
- error = error2;
- }
-discard:
- if (so->so_state & SS_NOFDREF)
- panic("soclose: NOFDREF");
- so->so_state |= SS_NOFDREF;
- sofree(so);
- splx(s);
- return (error);
-}
-
-/*
- * Must be called at splnet...
- */
-int
-soabort(so)
- struct socket *so;
-{
-
- return (*so->so_proto->pr_usrreqs->pru_abort)(so);
-}
-
-int
-soaccept(so, nam)
- register struct socket *so;
- struct mbuf *nam;
-{
- int s = splnet();
- int error;
-
- if ((so->so_state & SS_NOFDREF) == 0)
- panic("soaccept: !NOFDREF");
- so->so_state &= ~SS_NOFDREF;
- error = (*so->so_proto->pr_usrreqs->pru_accept)(so, nam);
- splx(s);
- return (error);
-}
-
-int
-soconnect(so, nam)
- register struct socket *so;
- struct mbuf *nam;
-{
- int s;
- int error;
-
- if (so->so_options & SO_ACCEPTCONN)
- return (EOPNOTSUPP);
- s = splnet();
- /*
- * If protocol is connection-based, can only connect once.
- * Otherwise, if connected, try to disconnect first.
- * This allows user to disconnect by connecting to, e.g.,
- * a null address.
- */
- if (so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING) &&
- ((so->so_proto->pr_flags & PR_CONNREQUIRED) ||
- (error = sodisconnect(so))))
- error = EISCONN;
- else
- error = (*so->so_proto->pr_usrreqs->pru_connect)(so, nam);
- splx(s);
- return (error);
-}
-
-int
-soconnect2(so1, so2)
- register struct socket *so1;
- struct socket *so2;
-{
- int s = splnet();
- int error;
-
- error = (*so1->so_proto->pr_usrreqs->pru_connect2)(so1, so2);
- splx(s);
- return (error);
-}
-
-int
-sodisconnect(so)
- register struct socket *so;
-{
- int s = splnet();
- int error;
-
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- error = ENOTCONN;
- goto bad;
- }
- if (so->so_state & SS_ISDISCONNECTING) {
- error = EALREADY;
- goto bad;
- }
- error = (*so->so_proto->pr_usrreqs->pru_disconnect)(so);
-bad:
- splx(s);
- return (error);
-}
-
-#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? M_NOWAIT : M_WAITOK)
-/*
- * Send on a socket.
- * If send must go all at once and message is larger than
- * send buffering, then hard error.
- * Lock against other senders.
- * If must go all at once and not enough room now, then
- * inform user that this would block and do nothing.
- * Otherwise, if nonblocking, send as much as possible.
- * The data to be sent is described by "uio" if nonzero,
- * otherwise by the mbuf chain "top" (which must be null
- * if uio is not). Data provided in mbuf chain must be small
- * enough to send all at once.
- *
- * Returns nonzero on error, timeout or signal; callers
- * must check for short counts if EINTR/ERESTART are returned.
- * Data and control buffers are freed on return.
- */
-int
-sosend(so, addr, uio, top, control, flags)
- register struct socket *so;
- struct mbuf *addr;
- struct uio *uio;
- struct mbuf *top;
- struct mbuf *control;
- int flags;
-{
- struct mbuf **mp;
- register struct mbuf *m;
- register long space, len, resid;
- int clen = 0, error, s, dontroute, mlen;
- int atomic = sosendallatonce(so) || top;
-
- if (uio)
- resid = uio->uio_resid;
- else
- resid = top->m_pkthdr.len;
- /*
- * In theory resid should be unsigned.
- * However, space must be signed, as it might be less than 0
- * if we over-committed, and we must use a signed comparison
- * of space and resid. On the other hand, a negative resid
- * causes us to loop sending 0-length segments to the protocol.
- *
- * Also check to make sure that MSG_EOR isn't used on SOCK_STREAM
- * type sockets since that's an error.
- */
- if ((resid < 0) || (so->so_type == SOCK_STREAM && (flags & MSG_EOR))) {
- error = EINVAL;
- goto out;
- }
-
- dontroute =
- (flags & MSG_DONTROUTE) && (so->so_options & SO_DONTROUTE) == 0 &&
- (so->so_proto->pr_flags & PR_ATOMIC);
- if (control)
- clen = control->m_len;
-#define snderr(errno) { error = errno; splx(s); goto release; }
-
-restart:
- error = sblock(&so->so_snd, SBLOCKWAIT(flags));
- if (error)
- goto out;
- do {
- s = splnet();
- if (so->so_state & SS_CANTSENDMORE)
- snderr(EPIPE);
- if (so->so_error) {
- error = so->so_error;
- so->so_error = 0;
- splx(s);
- goto release;
- }
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- /*
- * `sendto' and `sendmsg' is allowed on a connection-
- * based socket if it supports implied connect.
- * Return ENOTCONN if not connected and no address is
- * supplied.
- */
- if ((so->so_proto->pr_flags & PR_CONNREQUIRED) &&
- (so->so_proto->pr_flags & PR_IMPLOPCL) == 0) {
- if ((so->so_state & SS_ISCONFIRMING) == 0 &&
- !(resid == 0 && clen != 0))
- snderr(ENOTCONN);
- } else if (addr == 0)
- snderr(so->so_proto->pr_flags & PR_CONNREQUIRED ?
- ENOTCONN : EDESTADDRREQ);
- }
- space = sbspace(&so->so_snd);
- if (flags & MSG_OOB)
- space += 1024;
- if ((atomic && resid > so->so_snd.sb_hiwat) ||
- clen > so->so_snd.sb_hiwat)
- snderr(EMSGSIZE);
- if (space < resid + clen && uio &&
- (atomic || space < so->so_snd.sb_lowat || space < clen)) {
- if (so->so_state & SS_NBIO)
- snderr(EWOULDBLOCK);
- sbunlock(&so->so_snd);
- error = sbwait(&so->so_snd);
- splx(s);
- if (error)
- goto out;
- goto restart;
- }
- splx(s);
- mp = &top;
- space -= clen;
- do {
- if (uio == NULL) {
- /*
- * Data is prepackaged in "top".
- */
- resid = 0;
- if (flags & MSG_EOR)
- top->m_flags |= M_EOR;
- } else do {
- if (top == 0) {
- MGETHDR(m, M_WAIT, MT_DATA);
- mlen = MHLEN;
- m->m_pkthdr.len = 0;
- m->m_pkthdr.rcvif = (struct ifnet *)0;
- } else {
- MGET(m, M_WAIT, MT_DATA);
- mlen = MLEN;
- }
- if (resid >= MINCLSIZE) {
- MCLGET(m, M_WAIT);
- if ((m->m_flags & M_EXT) == 0)
- goto nopages;
- mlen = MCLBYTES;
- len = min(min(mlen, resid), space);
- } else {
-nopages:
- len = min(min(mlen, resid), space);
- /*
- * For datagram protocols, leave room
- * for protocol headers in first mbuf.
- */
- if (atomic && top == 0 && len < mlen)
- MH_ALIGN(m, len);
- }
- space -= len;
- error = uiomove(mtod(m, caddr_t), (int)len, uio);
- resid = uio->uio_resid;
- m->m_len = len;
- *mp = m;
- top->m_pkthdr.len += len;
- if (error)
- goto release;
- mp = &m->m_next;
- if (resid <= 0) {
- if (flags & MSG_EOR)
- top->m_flags |= M_EOR;
- break;
- }
- } while (space > 0 && atomic);
- if (dontroute)
- so->so_options |= SO_DONTROUTE;
- s = splnet(); /* XXX */
- error = (*so->so_proto->pr_usrreqs->pru_send)(so,
- (flags & MSG_OOB) ? PRUS_OOB :
- /*
- * If the user set MSG_EOF, the protocol
- * understands this flag and nothing left to
- * send then use PRU_SEND_EOF instead of PRU_SEND.
- */
- ((flags & MSG_EOF) &&
- (so->so_proto->pr_flags & PR_IMPLOPCL) &&
- (resid <= 0)) ?
- PRUS_EOF : 0,
- top, addr, control);
- splx(s);
- if (dontroute)
- so->so_options &= ~SO_DONTROUTE;
- clen = 0;
- control = 0;
- top = 0;
- mp = &top;
- if (error)
- goto release;
- } while (resid && space > 0);
- } while (resid);
-
-release:
- sbunlock(&so->so_snd);
-out:
- if (top)
- m_freem(top);
- if (control)
- m_freem(control);
- return (error);
-}
-
-/*
- * Implement receive operations on a socket.
- * We depend on the way that records are added to the sockbuf
- * by sbappend*. In particular, each record (mbufs linked through m_next)
- * must begin with an address if the protocol so specifies,
- * followed by an optional mbuf or mbufs containing ancillary data,
- * and then zero or more mbufs of data.
- * In order to avoid blocking network interrupts for the entire time here,
- * we splx() while doing the actual copy to user space.
- * Although the sockbuf is locked, new data may still be appended,
- * and thus we must maintain consistency of the sockbuf during that time.
- *
- * The caller may receive the data as a single mbuf chain by supplying
- * an mbuf **mp0 for use in returning the chain. The uio is then used
- * only for the count in uio_resid.
- */
-int
-soreceive(so, paddr, uio, mp0, controlp, flagsp)
- register struct socket *so;
- struct mbuf **paddr;
- struct uio *uio;
- struct mbuf **mp0;
- struct mbuf **controlp;
- int *flagsp;
-{
- register struct mbuf *m, **mp;
- register int flags, len, error, s, offset;
- struct protosw *pr = so->so_proto;
- struct mbuf *nextrecord;
- int moff, type = 0;
- int orig_resid = uio->uio_resid;
-
- mp = mp0;
- if (paddr)
- *paddr = 0;
- if (controlp)
- *controlp = 0;
- if (flagsp)
- flags = *flagsp &~ MSG_EOR;
- else
- flags = 0;
- if (flags & MSG_OOB) {
- m = m_get(M_WAIT, MT_DATA);
- error = (*pr->pr_usrreqs->pru_rcvoob)(so, m, flags & MSG_PEEK);
- if (error)
- goto bad;
- do {
- error = uiomove(mtod(m, caddr_t),
- (int) min(uio->uio_resid, m->m_len), uio);
- m = m_free(m);
- } while (uio->uio_resid && error == 0 && m);
-bad:
- if (m)
- m_freem(m);
- return (error);
- }
- if (mp)
- *mp = (struct mbuf *)0;
- if (so->so_state & SS_ISCONFIRMING && uio->uio_resid)
- (*pr->pr_usrreqs->pru_rcvd)(so, 0);
-
-restart:
- error = sblock(&so->so_rcv, SBLOCKWAIT(flags));
- if (error)
- return (error);
- s = splnet();
-
- m = so->so_rcv.sb_mb;
- /*
- * If we have less data than requested, block awaiting more
- * (subject to any timeout) if:
- * 1. the current count is less than the low water mark, or
- * 2. MSG_WAITALL is set, and it is possible to do the entire
- * receive operation at once if we block (resid <= hiwat).
- * 3. MSG_DONTWAIT is not set
- * If MSG_WAITALL is set but resid is larger than the receive buffer,
- * we have to do the receive in sections, and thus risk returning
- * a short count if a timeout or signal occurs after we start.
- */
- if (m == 0 || (((flags & MSG_DONTWAIT) == 0 &&
- so->so_rcv.sb_cc < uio->uio_resid) &&
- (so->so_rcv.sb_cc < so->so_rcv.sb_lowat ||
- ((flags & MSG_WAITALL) && uio->uio_resid <= so->so_rcv.sb_hiwat)) &&
- m->m_nextpkt == 0 && (pr->pr_flags & PR_ATOMIC) == 0)) {
-#ifdef DIAGNOSTIC
- if (m == 0 && so->so_rcv.sb_cc)
- panic("receive 1");
-#endif
- if (so->so_error) {
- if (m)
- goto dontblock;
- error = so->so_error;
- if ((flags & MSG_PEEK) == 0)
- so->so_error = 0;
- goto release;
- }
- if (so->so_state & SS_CANTRCVMORE) {
- if (m)
- goto dontblock;
- else
- goto release;
- }
- for (; m; m = m->m_next)
- if (m->m_type == MT_OOBDATA || (m->m_flags & M_EOR)) {
- m = so->so_rcv.sb_mb;
- goto dontblock;
- }
- if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 &&
- (so->so_proto->pr_flags & PR_CONNREQUIRED)) {
- error = ENOTCONN;
- goto release;
- }
- if (uio->uio_resid == 0)
- goto release;
- if ((so->so_state & SS_NBIO) || (flags & MSG_DONTWAIT)) {
- error = EWOULDBLOCK;
- goto release;
- }
- sbunlock(&so->so_rcv);
- error = sbwait(&so->so_rcv);
- splx(s);
- if (error)
- return (error);
- goto restart;
- }
-dontblock:
- nextrecord = m->m_nextpkt;
- if (pr->pr_flags & PR_ADDR) {
-#ifdef DIAGNOSTIC
- if (m->m_type != MT_SONAME)
- panic("receive 1a");
-#endif
- orig_resid = 0;
- if (flags & MSG_PEEK) {
- if (paddr)
- *paddr = m_copy(m, 0, m->m_len);
- m = m->m_next;
- } else {
- sbfree(&so->so_rcv, m);
- if (paddr) {
- *paddr = m;
- so->so_rcv.sb_mb = m->m_next;
- m->m_next = 0;
- m = so->so_rcv.sb_mb;
- } else {
- MFREE(m, so->so_rcv.sb_mb);
- m = so->so_rcv.sb_mb;
- }
- }
- }
- while (m && m->m_type == MT_CONTROL && error == 0) {
- if (flags & MSG_PEEK) {
- if (controlp)
- *controlp = m_copy(m, 0, m->m_len);
- m = m->m_next;
- } else {
- sbfree(&so->so_rcv, m);
- if (controlp) {
- if (pr->pr_domain->dom_externalize &&
- mtod(m, struct cmsghdr *)->cmsg_type ==
- SCM_RIGHTS)
- error = (*pr->pr_domain->dom_externalize)(m);
- *controlp = m;
- so->so_rcv.sb_mb = m->m_next;
- m->m_next = 0;
- m = so->so_rcv.sb_mb;
- } else {
- MFREE(m, so->so_rcv.sb_mb);
- m = so->so_rcv.sb_mb;
- }
- }
- if (controlp) {
- orig_resid = 0;
- controlp = &(*controlp)->m_next;
- }
- }
- if (m) {
- if ((flags & MSG_PEEK) == 0)
- m->m_nextpkt = nextrecord;
- type = m->m_type;
- if (type == MT_OOBDATA)
- flags |= MSG_OOB;
- }
- moff = 0;
- offset = 0;
- while (m && uio->uio_resid > 0 && error == 0) {
- if (m->m_type == MT_OOBDATA) {
- if (type != MT_OOBDATA)
- break;
- } else if (type == MT_OOBDATA)
- break;
-#ifdef DIAGNOSTIC
- else if (m->m_type != MT_DATA && m->m_type != MT_HEADER)
- panic("receive 3");
-#endif
- so->so_state &= ~SS_RCVATMARK;
- len = uio->uio_resid;
- if (so->so_oobmark && len > so->so_oobmark - offset)
- len = so->so_oobmark - offset;
- if (len > m->m_len - moff)
- len = m->m_len - moff;
- /*
- * If mp is set, just pass back the mbufs.
- * Otherwise copy them out via the uio, then free.
- * Sockbuf must be consistent here (points to current mbuf,
- * it points to next record) when we drop priority;
- * we must note any additions to the sockbuf when we
- * block interrupts again.
- */
- if (mp == 0) {
- splx(s);
- error = uiomove(mtod(m, caddr_t) + moff, (int)len, uio);
- s = splnet();
- if (error)
- goto release;
- } else
- uio->uio_resid -= len;
- if (len == m->m_len - moff) {
- if (m->m_flags & M_EOR)
- flags |= MSG_EOR;
- if (flags & MSG_PEEK) {
- m = m->m_next;
- moff = 0;
- } else {
- nextrecord = m->m_nextpkt;
- sbfree(&so->so_rcv, m);
- if (mp) {
- *mp = m;
- mp = &m->m_next;
- so->so_rcv.sb_mb = m = m->m_next;
- *mp = (struct mbuf *)0;
- } else {
- MFREE(m, so->so_rcv.sb_mb);
- m = so->so_rcv.sb_mb;
- }
- if (m)
- m->m_nextpkt = nextrecord;
- }
- } else {
- if (flags & MSG_PEEK)
- moff += len;
- else {
- if (mp)
- *mp = m_copym(m, 0, len, M_WAIT);
- m->m_data += len;
- m->m_len -= len;
- so->so_rcv.sb_cc -= len;
- }
- }
- if (so->so_oobmark) {
- if ((flags & MSG_PEEK) == 0) {
- so->so_oobmark -= len;
- if (so->so_oobmark == 0) {
- so->so_state |= SS_RCVATMARK;
- break;
- }
- } else {
- offset += len;
- if (offset == so->so_oobmark)
- break;
- }
- }
- if (flags & MSG_EOR)
- break;
- /*
- * If the MSG_WAITALL flag is set (for non-atomic socket),
- * we must not quit until "uio->uio_resid == 0" or an error
- * termination. If a signal/timeout occurs, return
- * with a short count but without error.
- * Keep sockbuf locked against other readers.
- */
- while (flags & MSG_WAITALL && m == 0 && uio->uio_resid > 0 &&
- !sosendallatonce(so) && !nextrecord) {
- if (so->so_error || so->so_state & SS_CANTRCVMORE)
- break;
- error = sbwait(&so->so_rcv);
- if (error) {
- sbunlock(&so->so_rcv);
- splx(s);
- return (0);
- }
- m = so->so_rcv.sb_mb;
- if (m)
- nextrecord = m->m_nextpkt;
- }
- }
-
- if (m && pr->pr_flags & PR_ATOMIC) {
- flags |= MSG_TRUNC;
- if ((flags & MSG_PEEK) == 0)
- (void) sbdroprecord(&so->so_rcv);
- }
- if ((flags & MSG_PEEK) == 0) {
- if (m == 0)
- so->so_rcv.sb_mb = nextrecord;
- if (pr->pr_flags & PR_WANTRCVD && so->so_pcb)
- (*pr->pr_usrreqs->pru_rcvd)(so, flags);
- }
- if (orig_resid == uio->uio_resid && orig_resid &&
- (flags & MSG_EOR) == 0 && (so->so_state & SS_CANTRCVMORE) == 0) {
- sbunlock(&so->so_rcv);
- splx(s);
- goto restart;
- }
-
- if (flagsp)
- *flagsp |= flags;
-release:
- sbunlock(&so->so_rcv);
- splx(s);
- return (error);
-}
-
-int
-soshutdown(so, how)
- register struct socket *so;
- register int how;
-{
- register struct protosw *pr = so->so_proto;
-
- how++;
- if (how & FREAD)
- sorflush(so);
- if (how & FWRITE)
- return ((*pr->pr_usrreqs->pru_shutdown)(so));
- return (0);
-}
-
-void
-sorflush(so)
- register struct socket *so;
-{
- register struct sockbuf *sb = &so->so_rcv;
- register struct protosw *pr = so->so_proto;
- register int s;
- struct sockbuf asb;
-
- sb->sb_flags |= SB_NOINTR;
- (void) sblock(sb, M_WAITOK);
- s = splimp();
- socantrcvmore(so);
- sbunlock(sb);
- asb = *sb;
- bzero((caddr_t)sb, sizeof (*sb));
- splx(s);
- if (pr->pr_flags & PR_RIGHTS && pr->pr_domain->dom_dispose)
- (*pr->pr_domain->dom_dispose)(asb.sb_mb);
- sbrelease(&asb);
-}
-
-int
-sosetopt(so, level, optname, m0)
- register struct socket *so;
- int level, optname;
- struct mbuf *m0;
-{
- int error = 0;
- register struct mbuf *m = m0;
-
- if (level != SOL_SOCKET) {
- if (so->so_proto && so->so_proto->pr_ctloutput)
- return ((*so->so_proto->pr_ctloutput)
- (PRCO_SETOPT, so, level, optname, &m0));
- error = ENOPROTOOPT;
- } else {
- switch (optname) {
-
- case SO_LINGER:
- if (m == NULL || m->m_len != sizeof (struct linger)) {
- error = EINVAL;
- goto bad;
- }
- so->so_linger = mtod(m, struct linger *)->l_linger;
- /* fall thru... */
-
- case SO_DEBUG:
- case SO_KEEPALIVE:
- case SO_DONTROUTE:
- case SO_USELOOPBACK:
- case SO_BROADCAST:
- case SO_REUSEADDR:
- case SO_REUSEPORT:
- case SO_OOBINLINE:
- case SO_TIMESTAMP:
- if (m == NULL || m->m_len < sizeof (int)) {
- error = EINVAL;
- goto bad;
- }
- if (*mtod(m, int *))
- so->so_options |= optname;
- else
- so->so_options &= ~optname;
- break;
-
- case SO_SNDBUF:
- case SO_RCVBUF:
- case SO_SNDLOWAT:
- case SO_RCVLOWAT:
- {
- int optval;
-
- if (m == NULL || m->m_len < sizeof (int)) {
- error = EINVAL;
- goto bad;
- }
-
- /*
- * Values < 1 make no sense for any of these
- * options, so disallow them.
- */
- optval = *mtod(m, int *);
- if (optval < 1) {
- error = EINVAL;
- goto bad;
- }
-
- switch (optname) {
-
- case SO_SNDBUF:
- case SO_RCVBUF:
- if (sbreserve(optname == SO_SNDBUF ?
- &so->so_snd : &so->so_rcv,
- (u_long) optval) == 0) {
- error = ENOBUFS;
- goto bad;
- }
- break;
-
- /*
- * Make sure the low-water is never greater than
- * the high-water.
- */
- case SO_SNDLOWAT:
- so->so_snd.sb_lowat =
- (optval > so->so_snd.sb_hiwat) ?
- so->so_snd.sb_hiwat : optval;
- break;
- case SO_RCVLOWAT:
- so->so_rcv.sb_lowat =
- (optval > so->so_rcv.sb_hiwat) ?
- so->so_rcv.sb_hiwat : optval;
- break;
- }
- break;
- }
-
- case SO_SNDTIMEO:
- case SO_RCVTIMEO:
- {
- struct timeval *tv;
- short val;
-
- if (m == NULL || m->m_len < sizeof (*tv)) {
- error = EINVAL;
- goto bad;
- }
- tv = mtod(m, struct timeval *);
- if (tv->tv_sec > SHRT_MAX / hz - hz) {
- error = EDOM;
- goto bad;
- }
- val = tv->tv_sec * hz + tv->tv_usec / tick;
-
- switch (optname) {
-
- case SO_SNDTIMEO:
- so->so_snd.sb_timeo = val;
- break;
- case SO_RCVTIMEO:
- so->so_rcv.sb_timeo = val;
- break;
- }
- break;
- }
-
- case SO_PRIVSTATE:
- /* we don't care what the parameter is... */
- so->so_state &= ~SS_PRIV;
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- if (error == 0 && so->so_proto && so->so_proto->pr_ctloutput) {
- (void) ((*so->so_proto->pr_ctloutput)
- (PRCO_SETOPT, so, level, optname, &m0));
- m = NULL; /* freed by protocol */
- }
- }
-bad:
- if (m)
- (void) m_free(m);
- return (error);
-}
-
-int
-sogetopt(so, level, optname, mp)
- register struct socket *so;
- int level, optname;
- struct mbuf **mp;
-{
- register struct mbuf *m;
-
- if (level != SOL_SOCKET) {
- if (so->so_proto && so->so_proto->pr_ctloutput) {
- return ((*so->so_proto->pr_ctloutput)
- (PRCO_GETOPT, so, level, optname, mp));
- } else
- return (ENOPROTOOPT);
- } else {
- m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof (int);
-
- switch (optname) {
-
- case SO_LINGER:
- m->m_len = sizeof (struct linger);
- mtod(m, struct linger *)->l_onoff =
- so->so_options & SO_LINGER;
- mtod(m, struct linger *)->l_linger = so->so_linger;
- break;
-
- case SO_USELOOPBACK:
- case SO_DONTROUTE:
- case SO_DEBUG:
- case SO_KEEPALIVE:
- case SO_REUSEADDR:
- case SO_REUSEPORT:
- case SO_BROADCAST:
- case SO_OOBINLINE:
- case SO_TIMESTAMP:
- *mtod(m, int *) = so->so_options & optname;
- break;
-
- case SO_PRIVSTATE:
- *mtod(m, int *) = so->so_state & SS_PRIV;
- break;
-
- case SO_TYPE:
- *mtod(m, int *) = so->so_type;
- break;
-
- case SO_ERROR:
- *mtod(m, int *) = so->so_error;
- so->so_error = 0;
- break;
-
- case SO_SNDBUF:
- *mtod(m, int *) = so->so_snd.sb_hiwat;
- break;
-
- case SO_RCVBUF:
- *mtod(m, int *) = so->so_rcv.sb_hiwat;
- break;
-
- case SO_SNDLOWAT:
- *mtod(m, int *) = so->so_snd.sb_lowat;
- break;
-
- case SO_RCVLOWAT:
- *mtod(m, int *) = so->so_rcv.sb_lowat;
- break;
-
- case SO_SNDTIMEO:
- case SO_RCVTIMEO:
- {
- int val = (optname == SO_SNDTIMEO ?
- so->so_snd.sb_timeo : so->so_rcv.sb_timeo);
-
- m->m_len = sizeof(struct timeval);
- mtod(m, struct timeval *)->tv_sec = val / hz;
- mtod(m, struct timeval *)->tv_usec =
- (val % hz) * tick;
- break;
- }
-
- default:
- (void)m_free(m);
- return (ENOPROTOOPT);
- }
- *mp = m;
- return (0);
- }
-}
-
-void
-sohasoutofband(so)
- register struct socket *so;
-{
-#if 0 /* FIXME: For now we just ignore out of band data */
- struct proc *p;
-
- if (so->so_pgid < 0)
- gsignal(-so->so_pgid, SIGURG);
- else if (so->so_pgid > 0 && (p = pfind(so->so_pgid)) != 0)
- psignal(p, SIGURG);
- selwakeup(&so->so_rcv.sb_sel);
-#endif
-}
diff --git a/c/src/exec/libnetworking/kern/uipc_socket2.c b/c/src/exec/libnetworking/kern/uipc_socket2.c
deleted file mode 100644
index 0539d2c5f3..0000000000
--- a/c/src/exec/libnetworking/kern/uipc_socket2.c
+++ /dev/null
@@ -1,965 +0,0 @@
-/*
- * This file has undergone several changes to reflect the
- * differences between the RTEMS and FreeBSD kernels.
- */
-
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 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.
- *
- * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
-#include <sys/file.h>
-#include <sys/buf.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/signalvar.h>
-#include <sys/sysctl.h>
-
-/*
- * Primitive routines for operating on sockets and socket buffers
- */
-
-u_long sb_max = SB_MAX; /* XXX should be static */
-SYSCTL_INT(_kern, KERN_MAXSOCKBUF, maxsockbuf, CTLFLAG_RW, &sb_max, 0, "")
-
-static u_long sb_efficiency = 8; /* parameter for sbreserve() */
-SYSCTL_INT(_kern, OID_AUTO, sockbuf_waste_factor, CTLFLAG_RW, &sb_efficiency,
- 0, "");
-
-/*
- * Procedures to manipulate state flags of socket
- * and do appropriate wakeups. Normal sequence from the
- * active (originating) side is that soisconnecting() is
- * called during processing of connect() call,
- * resulting in an eventual call to soisconnected() if/when the
- * connection is established. When the connection is torn down
- * soisdisconnecting() is called during processing of disconnect() call,
- * and soisdisconnected() is called when the connection to the peer
- * is totally severed. The semantics of these routines are such that
- * connectionless protocols can call soisconnected() and soisdisconnected()
- * only, bypassing the in-progress calls when setting up a ``connection''
- * takes no time.
- *
- * From the passive side, a socket is created with
- * two queues of sockets: so_q0 for connections in progress
- * and so_q for connections already made and awaiting user acceptance.
- * As a protocol is preparing incoming connections, it creates a socket
- * structure queued on so_q0 by calling sonewconn(). When the connection
- * is established, soisconnected() is called, and transfers the
- * socket structure to so_q, making it available to accept().
- *
- * If a socket is closed with sockets on either
- * so_q0 or so_q, these sockets are dropped.
- *
- * If higher level protocols are implemented in
- * the kernel, the wakeups done here will sometimes
- * cause software-interrupt process scheduling.
- */
-
-void
-soisconnecting(so)
- register struct socket *so;
-{
-
- so->so_state &= ~(SS_ISCONNECTED|SS_ISDISCONNECTING);
- so->so_state |= SS_ISCONNECTING;
-}
-
-void
-soisconnected(so)
- register struct socket *so;
-{
- register struct socket *head = so->so_head;
-
- so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING);
- so->so_state |= SS_ISCONNECTED;
- if (head && (so->so_state & SS_INCOMP)) {
- TAILQ_REMOVE(&head->so_incomp, so, so_list);
- head->so_incqlen--;
- so->so_state &= ~SS_INCOMP;
- TAILQ_INSERT_TAIL(&head->so_comp, so, so_list);
- so->so_state |= SS_COMP;
- sorwakeup(head);
- soconnwakeup(head);
- } else {
- soconnwakeup(so);
- sorwakeup(so);
- sowwakeup(so);
- }
-}
-
-void
-soisdisconnecting(so)
- register struct socket *so;
-{
-
- so->so_state &= ~SS_ISCONNECTING;
- so->so_state |= (SS_ISDISCONNECTING|SS_CANTRCVMORE|SS_CANTSENDMORE);
- soconnwakeup(so);
- sowwakeup(so);
- sorwakeup(so);
-}
-
-void
-soisdisconnected(so)
- register struct socket *so;
-{
-
- so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
- so->so_state |= (SS_CANTRCVMORE|SS_CANTSENDMORE);
- soconnwakeup(so);
- sowwakeup(so);
- sorwakeup(so);
-}
-
-/*
- * Return a random connection that hasn't been serviced yet and
- * is eligible for discard. There is a one in qlen chance that
- * we will return a null, saying that there are no dropable
- * requests. In this case, the protocol specific code should drop
- * the new request. This insures fairness.
- *
- * This may be used in conjunction with protocol specific queue
- * congestion routines.
- */
-struct socket *
-sodropablereq(head)
- register struct socket *head;
-{
- register struct socket *so;
- unsigned int i, j, qlen, m;
-
- static int rnd;
- static long old_mono_secs;
- static unsigned int cur_cnt, old_cnt;
-
- if ((i = (m = rtems_bsdnet_seconds_since_boot()) - old_mono_secs) != 0) {
- old_mono_secs = m;
- old_cnt = cur_cnt / i;
- cur_cnt = 0;
- }
-
- so = TAILQ_FIRST(&head->so_incomp);
- if (!so)
- return (so);
-
- qlen = head->so_incqlen;
- if (++cur_cnt > qlen || old_cnt > qlen) {
- rnd = (314159 * rnd + 66329) & 0xffff;
- j = ((qlen + 1) * rnd) >> 16;
-
- while (j-- && so)
- so = TAILQ_NEXT(so, so_list);
- }
-
- return (so);
-}
-
-/*
- * When an attempt at a new connection is noted on a socket
- * which accepts connections, sonewconn is called. If the
- * connection is possible (subject to space constraints, etc.)
- * then we allocate a new structure, propoerly linked into the
- * data structure of the original socket, and return this.
- * Connstatus may be 0, or SO_ISCONFIRMING, or SO_ISCONNECTED.
- *
- * Currently, sonewconn() is defined as sonewconn1() in socketvar.h
- * to catch calls that are missing the (new) second parameter.
- */
-struct socket *
-sonewconn1(head, connstatus)
- register struct socket *head;
- int connstatus;
-{
- register struct socket *so;
-
- if (head->so_qlen > 3 * head->so_qlimit / 2)
- return ((struct socket *)0);
- MALLOC(so, struct socket *, sizeof(*so), M_SOCKET, M_DONTWAIT);
- if (so == NULL)
- return ((struct socket *)0);
- bzero((caddr_t)so, sizeof(*so));
- so->so_head = head;
- so->so_type = head->so_type;
- so->so_options = head->so_options &~ SO_ACCEPTCONN;
- so->so_linger = head->so_linger;
- so->so_state = head->so_state | SS_NOFDREF;
- so->so_proto = head->so_proto;
- so->so_timeo = head->so_timeo;
- so->so_pgid = head->so_pgid;
- so->so_uid = head->so_uid;
- (void) soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat);
- if (connstatus) {
- TAILQ_INSERT_TAIL(&head->so_comp, so, so_list);
- so->so_state |= SS_COMP;
- } else {
- TAILQ_INSERT_TAIL(&head->so_incomp, so, so_list);
- so->so_state |= SS_INCOMP;
- head->so_incqlen++;
- }
- head->so_qlen++;
- if ((*so->so_proto->pr_usrreqs->pru_attach)(so, 0)) {
- if (so->so_state & SS_COMP) {
- TAILQ_REMOVE(&head->so_comp, so, so_list);
- } else {
- TAILQ_REMOVE(&head->so_incomp, so, so_list);
- head->so_incqlen--;
- }
- head->so_qlen--;
- (void) free((caddr_t)so, M_SOCKET);
- return ((struct socket *)0);
- }
- if (connstatus) {
- sorwakeup(head);
- soconnwakeup(head);
- so->so_state |= connstatus;
- }
- return (so);
-}
-
-/*
- * Socantsendmore indicates that no more data will be sent on the
- * socket; it would normally be applied to a socket when the user
- * informs the system that no more data is to be sent, by the protocol
- * code (in case PRU_SHUTDOWN). Socantrcvmore indicates that no more data
- * will be received, and will normally be applied to the socket by a
- * protocol when it detects that the peer will send no more data.
- * Data queued for reading in the socket may yet be read.
- */
-
-void
-socantsendmore(so)
- struct socket *so;
-{
-
- so->so_state |= SS_CANTSENDMORE;
- sowwakeup(so);
-}
-
-void
-socantrcvmore(so)
- struct socket *so;
-{
-
- so->so_state |= SS_CANTRCVMORE;
- sorwakeup(so);
-}
-
-/*
- * Socket buffer (struct sockbuf) utility routines.
- *
- * Each socket contains two socket buffers: one for sending data and
- * one for receiving data. Each buffer contains a queue of mbufs,
- * information about the number of mbufs and amount of data in the
- * queue, and other fields allowing select() statements and notification
- * on data availability to be implemented.
- *
- * Data stored in a socket buffer is maintained as a list of records.
- * Each record is a list of mbufs chained together with the m_next
- * field. Records are chained together with the m_nextpkt field. The upper
- * level routine soreceive() expects the following conventions to be
- * observed when placing information in the receive buffer:
- *
- * 1. If the protocol requires each message be preceded by the sender's
- * name, then a record containing that name must be present before
- * any associated data (mbuf's must be of type MT_SONAME).
- * 2. If the protocol supports the exchange of ``access rights'' (really
- * just additional data associated with the message), and there are
- * ``rights'' to be received, then a record containing this data
- * should be present (mbuf's must be of type MT_RIGHTS).
- * 3. If a name or rights record exists, then it must be followed by
- * a data record, perhaps of zero length.
- *
- * Before using a new socket structure it is first necessary to reserve
- * buffer space to the socket, by calling sbreserve(). This should commit
- * some of the available buffer space in the system buffer pool for the
- * socket (currently, it does nothing but enforce limits). The space
- * should be released by calling sbrelease() when the socket is destroyed.
- */
-
-int
-soreserve(so, sndcc, rcvcc)
- register struct socket *so;
- u_long sndcc, rcvcc;
-{
-
- if (sbreserve(&so->so_snd, sndcc) == 0)
- goto bad;
- if (sbreserve(&so->so_rcv, rcvcc) == 0)
- goto bad2;
- if (so->so_rcv.sb_lowat == 0)
- so->so_rcv.sb_lowat = 1;
- if (so->so_snd.sb_lowat == 0)
- so->so_snd.sb_lowat = MCLBYTES;
- if (so->so_snd.sb_lowat > so->so_snd.sb_hiwat)
- so->so_snd.sb_lowat = so->so_snd.sb_hiwat;
- return (0);
-bad2:
- sbrelease(&so->so_snd);
-bad:
- return (ENOBUFS);
-}
-
-/*
- * Allot mbufs to a sockbuf.
- * Attempt to scale mbmax so that mbcnt doesn't become limiting
- * if buffering efficiency is near the normal case.
- */
-int
-sbreserve(sb, cc)
- struct sockbuf *sb;
- u_long cc;
-{
-
- if (cc > sb_max * MCLBYTES / (MSIZE + MCLBYTES))
- return (0);
- sb->sb_hiwat = cc;
- sb->sb_mbmax = min(cc * sb_efficiency, sb_max);
- if (sb->sb_lowat > sb->sb_hiwat)
- sb->sb_lowat = sb->sb_hiwat;
- return (1);
-}
-
-/*
- * Free mbufs held by a socket, and reserved mbuf space.
- */
-void
-sbrelease(sb)
- struct sockbuf *sb;
-{
-
- sbflush(sb);
- sb->sb_hiwat = sb->sb_mbmax = 0;
-}
-
-/*
- * Routines to add and remove
- * data from an mbuf queue.
- *
- * The routines sbappend() or sbappendrecord() are normally called to
- * append new mbufs to a socket buffer, after checking that adequate
- * space is available, comparing the function sbspace() with the amount
- * of data to be added. sbappendrecord() differs from sbappend() in
- * that data supplied is treated as the beginning of a new record.
- * To place a sender's address, optional access rights, and data in a
- * socket receive buffer, sbappendaddr() should be used. To place
- * access rights and data in a socket receive buffer, sbappendrights()
- * should be used. In either case, the new data begins a new record.
- * Note that unlike sbappend() and sbappendrecord(), these routines check
- * for the caller that there will be enough space to store the data.
- * Each fails if there is not enough space, or if it cannot find mbufs
- * to store additional information in.
- *
- * Reliable protocols may use the socket send buffer to hold data
- * awaiting acknowledgement. Data is normally copied from a socket
- * send buffer in a protocol with m_copy for output to a peer,
- * and then removing the data from the socket buffer with sbdrop()
- * or sbdroprecord() when the data is acknowledged by the peer.
- */
-
-/*
- * Append mbuf chain m to the last record in the
- * socket buffer sb. The additional space associated
- * the mbuf chain is recorded in sb. Empty mbufs are
- * discarded and mbufs are compacted where possible.
- */
-void
-sbappend(sb, m)
- struct sockbuf *sb;
- struct mbuf *m;
-{
- register struct mbuf *n;
-
- if (m == 0)
- return;
- n = sb->sb_mb;
- if (n) {
- while (n->m_nextpkt)
- n = n->m_nextpkt;
- do {
- if (n->m_flags & M_EOR) {
- sbappendrecord(sb, m); /* XXXXXX!!!! */
- return;
- }
- } while (n->m_next && (n = n->m_next));
- }
- sbcompress(sb, m, n);
-}
-
-#ifdef SOCKBUF_DEBUG
-void
-sbcheck(sb)
- register struct sockbuf *sb;
-{
- register struct mbuf *m;
- register int len = 0, mbcnt = 0;
-
- for (m = sb->sb_mb; m; m = m->m_next) {
- len += m->m_len;
- mbcnt += MSIZE;
- if (m->m_flags & M_EXT) /*XXX*/ /* pretty sure this is bogus */
- mbcnt += m->m_ext.ext_size;
- if (m->m_nextpkt)
- panic("sbcheck nextpkt");
- }
- if (len != sb->sb_cc || mbcnt != sb->sb_mbcnt) {
- printf("cc %d != %d || mbcnt %d != %d\n", len, sb->sb_cc,
- mbcnt, sb->sb_mbcnt);
- panic("sbcheck");
- }
-}
-#endif
-
-/*
- * As above, except the mbuf chain
- * begins a new record.
- */
-void
-sbappendrecord(sb, m0)
- register struct sockbuf *sb;
- register struct mbuf *m0;
-{
- register struct mbuf *m;
-
- if (m0 == 0)
- return;
- m = sb->sb_mb;
- if (m)
- while (m->m_nextpkt)
- m = m->m_nextpkt;
- /*
- * Put the first mbuf on the queue.
- * Note this permits zero length records.
- */
- sballoc(sb, m0);
- if (m)
- m->m_nextpkt = m0;
- else
- sb->sb_mb = m0;
- m = m0->m_next;
- m0->m_next = 0;
- if (m && (m0->m_flags & M_EOR)) {
- m0->m_flags &= ~M_EOR;
- m->m_flags |= M_EOR;
- }
- sbcompress(sb, m, m0);
-}
-
-/*
- * As above except that OOB data
- * is inserted at the beginning of the sockbuf,
- * but after any other OOB data.
- */
-void
-sbinsertoob(sb, m0)
- register struct sockbuf *sb;
- register struct mbuf *m0;
-{
- register struct mbuf *m;
- register struct mbuf **mp;
-
- if (m0 == 0)
- return;
- for (mp = &sb->sb_mb; *mp ; mp = &((*mp)->m_nextpkt)) {
- m = *mp;
- again:
- switch (m->m_type) {
-
- case MT_OOBDATA:
- continue; /* WANT next train */
-
- case MT_CONTROL:
- m = m->m_next;
- if (m)
- goto again; /* inspect THIS train further */
- }
- break;
- }
- /*
- * Put the first mbuf on the queue.
- * Note this permits zero length records.
- */
- sballoc(sb, m0);
- m0->m_nextpkt = *mp;
- *mp = m0;
- m = m0->m_next;
- m0->m_next = 0;
- if (m && (m0->m_flags & M_EOR)) {
- m0->m_flags &= ~M_EOR;
- m->m_flags |= M_EOR;
- }
- sbcompress(sb, m, m0);
-}
-
-/*
- * Append address and data, and optionally, control (ancillary) data
- * to the receive queue of a socket. If present,
- * m0 must include a packet header with total length.
- * Returns 0 if no space in sockbuf or insufficient mbufs.
- */
-int
-sbappendaddr(sb, asa, m0, control)
- register struct sockbuf *sb;
- struct sockaddr *asa;
- struct mbuf *m0, *control;
-{
- register struct mbuf *m, *n;
- int space = asa->sa_len;
-
-if (m0 && (m0->m_flags & M_PKTHDR) == 0)
-panic("sbappendaddr");
- if (m0)
- space += m0->m_pkthdr.len;
- for (n = control; n; n = n->m_next) {
- space += n->m_len;
- if (n->m_next == 0) /* keep pointer to last control buf */
- break;
- }
- if (space > sbspace(sb))
- return (0);
- if (asa->sa_len > MLEN)
- return (0);
- MGET(m, M_DONTWAIT, MT_SONAME);
- if (m == 0)
- return (0);
- m->m_len = asa->sa_len;
- bcopy((caddr_t)asa, mtod(m, caddr_t), asa->sa_len);
- if (n)
- n->m_next = m0; /* concatenate data to control */
- else
- control = m0;
- m->m_next = control;
- for (n = m; n; n = n->m_next)
- sballoc(sb, n);
- n = sb->sb_mb;
- if (n) {
- while (n->m_nextpkt)
- n = n->m_nextpkt;
- n->m_nextpkt = m;
- } else
- sb->sb_mb = m;
- return (1);
-}
-
-int
-sbappendcontrol(sb, m0, control)
- struct sockbuf *sb;
- struct mbuf *control, *m0;
-{
- register struct mbuf *m, *n;
- int space = 0;
-
- if (control == 0)
- panic("sbappendcontrol");
- for (m = control; ; m = m->m_next) {
- space += m->m_len;
- if (m->m_next == 0)
- break;
- }
- n = m; /* save pointer to last control buffer */
- for (m = m0; m; m = m->m_next)
- space += m->m_len;
- if (space > sbspace(sb))
- return (0);
- n->m_next = m0; /* concatenate data to control */
- for (m = control; m; m = m->m_next)
- sballoc(sb, m);
- n = sb->sb_mb;
- if (n) {
- while (n->m_nextpkt)
- n = n->m_nextpkt;
- n->m_nextpkt = control;
- } else
- sb->sb_mb = control;
- return (1);
-}
-
-/*
- * Compress mbuf chain m into the socket
- * buffer sb following mbuf n. If n
- * is null, the buffer is presumed empty.
- */
-void
-sbcompress(sb, m, n)
- register struct sockbuf *sb;
- register struct mbuf *m, *n;
-{
- register int eor = 0;
- register struct mbuf *o;
-
- while (m) {
- eor |= m->m_flags & M_EOR;
- if (m->m_len == 0 &&
- (eor == 0 ||
- (((o = m->m_next) || (o = n)) &&
- o->m_type == m->m_type))) {
- m = m_free(m);
- continue;
- }
- if (n && (n->m_flags & (M_EXT | M_EOR)) == 0 &&
- (n->m_data + n->m_len + m->m_len) < &n->m_dat[MLEN] &&
- n->m_type == m->m_type) {
- bcopy(mtod(m, caddr_t), mtod(n, caddr_t) + n->m_len,
- (unsigned)m->m_len);
- n->m_len += m->m_len;
- sb->sb_cc += m->m_len;
- m = m_free(m);
- continue;
- }
- if (n)
- n->m_next = m;
- else
- sb->sb_mb = m;
- sballoc(sb, m);
- n = m;
- m->m_flags &= ~M_EOR;
- m = m->m_next;
- n->m_next = 0;
- }
- if (eor) {
- if (n)
- n->m_flags |= eor;
- else
- printf("semi-panic: sbcompress\n");
- }
-}
-
-/*
- * Free all mbufs in a sockbuf.
- * Check that all resources are reclaimed.
- */
-void
-sbflush(sb)
- register struct sockbuf *sb;
-{
-
- if (sb->sb_flags & SB_LOCK)
- panic("sbflush");
- while (sb->sb_mbcnt)
- sbdrop(sb, (int)sb->sb_cc);
- if (sb->sb_cc || sb->sb_mb)
- panic("sbflush 2");
-}
-
-/*
- * Drop data from (the front of) a sockbuf.
- */
-void
-sbdrop(sb, len)
- register struct sockbuf *sb;
- register int len;
-{
- register struct mbuf *m, *mn;
- struct mbuf *next;
-
- next = (m = sb->sb_mb) ? m->m_nextpkt : 0;
- while (len > 0) {
- if (m == 0) {
- if (next == 0)
- panic("sbdrop");
- m = next;
- next = m->m_nextpkt;
- continue;
- }
- if (m->m_len > len) {
- m->m_len -= len;
- m->m_data += len;
- sb->sb_cc -= len;
- break;
- }
- len -= m->m_len;
- sbfree(sb, m);
- MFREE(m, mn);
- m = mn;
- }
- while (m && m->m_len == 0) {
- sbfree(sb, m);
- MFREE(m, mn);
- m = mn;
- }
- if (m) {
- sb->sb_mb = m;
- m->m_nextpkt = next;
- } else
- sb->sb_mb = next;
-}
-
-/*
- * Drop a record off the front of a sockbuf
- * and move the next record to the front.
- */
-void
-sbdroprecord(sb)
- register struct sockbuf *sb;
-{
- register struct mbuf *m, *mn;
-
- m = sb->sb_mb;
- if (m) {
- sb->sb_mb = m->m_nextpkt;
- do {
- sbfree(sb, m);
- MFREE(m, mn);
- m = mn;
- } while (m);
- }
-}
-
-/*
- * Create a "control" mbuf containing the specified data
- * with the specified type for presentation on a socket buffer.
- */
-struct mbuf *
-sbcreatecontrol(p, size, type, level)
- caddr_t p;
- register int size;
- int type, level;
-{
- register struct cmsghdr *cp;
- struct mbuf *m;
-
- if ((m = m_get(M_DONTWAIT, MT_CONTROL)) == NULL)
- return ((struct mbuf *) NULL);
- cp = mtod(m, struct cmsghdr *);
- /* XXX check size? */
- (void)memcpy(CMSG_DATA(cp), p, size);
- size += sizeof(*cp);
- m->m_len = size;
- cp->cmsg_len = size;
- cp->cmsg_level = level;
- cp->cmsg_type = type;
- return (m);
-}
-
-#ifdef PRU_OLDSTYLE
-/*
- * The following routines mediate between the old-style `pr_usrreq'
- * protocol implementations and the new-style `struct pr_usrreqs'
- * calling convention.
- */
-
-/* syntactic sugar */
-#define nomb (struct mbuf *)0
-
-static int
-old_abort(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_ABORT, nomb, nomb, nomb);
-}
-
-static int
-old_accept(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_ACCEPT, nomb, nam, nomb);
-}
-
-static int
-old_attach(struct socket *so, int proto)
-{
- return so->so_proto->pr_ousrreq(so, PRU_ATTACH, nomb,
- (struct mbuf *)proto, /* XXX */
- nomb);
-}
-
-static int
-old_bind(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_BIND, nomb, nam, nomb);
-}
-
-static int
-old_connect(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_CONNECT, nomb, nam, nomb);
-}
-
-static int
-old_connect2(struct socket *so1, struct socket *so2)
-{
- return so1->so_proto->pr_ousrreq(so1, PRU_CONNECT2, nomb,
- (struct mbuf *)so2, nomb);
-}
-
-static int
-old_control(struct socket *so, int cmd, caddr_t data, struct ifnet *ifp)
-{
- return so->so_proto->pr_ousrreq(so, PRU_CONTROL, (struct mbuf *)cmd,
- (struct mbuf *)data,
- (struct mbuf *)ifp);
-}
-
-static int
-old_detach(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_DETACH, nomb, nomb, nomb);
-}
-
-static int
-old_disconnect(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_DISCONNECT, nomb, nomb, nomb);
-}
-
-static int
-old_listen(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_LISTEN, nomb, nomb, nomb);
-}
-
-static int
-old_peeraddr(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_PEERADDR, nomb, nam, nomb);
-}
-
-static int
-old_rcvd(struct socket *so, int flags)
-{
- return so->so_proto->pr_ousrreq(so, PRU_RCVD, nomb,
- (struct mbuf *)flags, /* XXX */
- nomb);
-}
-
-static int
-old_rcvoob(struct socket *so, struct mbuf *m, int flags)
-{
- return so->so_proto->pr_ousrreq(so, PRU_RCVOOB, m,
- (struct mbuf *)flags, /* XXX */
- nomb);
-}
-
-static int
-old_send(struct socket *so, int flags, struct mbuf *m, struct mbuf *addr,
- struct mbuf *control)
-{
- int req;
-
- if (flags & PRUS_OOB) {
- req = PRU_SENDOOB;
- } else if(flags & PRUS_EOF) {
- req = PRU_SEND_EOF;
- } else {
- req = PRU_SEND;
- }
- return so->so_proto->pr_ousrreq(so, req, m, addr, control);
-}
-
-static int
-old_sense(struct socket *so, struct stat *sb)
-{
- return so->so_proto->pr_ousrreq(so, PRU_SENSE, (struct mbuf *)sb,
- nomb, nomb);
-}
-
-static int
-old_shutdown(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_SHUTDOWN, nomb, nomb, nomb);
-}
-
-static int
-old_sockaddr(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_SOCKADDR, nomb, nam, nomb);
-}
-
-struct pr_usrreqs pru_oldstyle = {
- old_abort, old_accept, old_attach, old_bind, old_connect,
- old_connect2, old_control, old_detach, old_disconnect,
- old_listen, old_peeraddr, old_rcvd, old_rcvoob, old_send,
- old_sense, old_shutdown, old_sockaddr
-};
-
-#endif /* PRU_OLDSTYLE */
-
-/*
- * Some routines that return EOPNOTSUPP for entry points that are not
- * supported by a protocol. Fill in as needed.
- */
-int
-pru_accept_notsupp(struct socket *so, struct mbuf *nam)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_connect2_notsupp(struct socket *so1, struct socket *so2)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_control_notsupp(struct socket *so, int cmd, caddr_t data,
- struct ifnet *ifp)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_listen_notsupp(struct socket *so)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_rcvd_notsupp(struct socket *so, int flags)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_rcvoob_notsupp(struct socket *so, struct mbuf *m, int flags)
-{
- return EOPNOTSUPP;
-}
-
-/*
- * This isn't really a ``null'' operation, but it's the default one
- * and doesn't do anything destructive.
- */
-int
-pru_sense_null(struct socket *so, struct stat *sb)
-{
- sb->st_blksize = so->so_snd.sb_hiwat;
- return 0;
-}
-
diff --git a/c/src/exec/libnetworking/lib/README b/c/src/exec/libnetworking/lib/README
deleted file mode 100644
index 998bd5e708..0000000000
--- a/c/src/exec/libnetworking/lib/README
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# $Id$
-#
-
-Sources from application-level (as opposed to kernel-level) libraries.
diff --git a/c/src/exec/libnetworking/lib/getprotoby.c b/c/src/exec/libnetworking/lib/getprotoby.c
deleted file mode 100644
index fc8de6e402..0000000000
--- a/c/src/exec/libnetworking/lib/getprotoby.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * $Id$
- */
-
-#include <netdb.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-static const struct protoent prototab[] = {
- { "ip", NULL, IPPROTO_IP },
- { "icmp", NULL, IPPROTO_ICMP },
- { "tcp", NULL, IPPROTO_TCP },
- { "udp", NULL, IPPROTO_UDP },
- };
-
-/*
- * Dummy version of BSD getprotobyname()
- */
-struct protoent *
-getprotobyname (const char *name)
-{
- int i;
-
- for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
- if (strcmp (name, prototab[i].p_name) == 0)
- return (struct protoent *) &prototab[i];
- }
- return NULL;
-}
-
-/*
- * Dummy version of BSD getprotobynumber()
- */
-struct protoent *
-getprotobynumber (int proto)
-{
- int i;
-
- for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
- if (proto == prototab[i].p_proto)
- return (struct protoent *) &prototab[i];
- }
- return NULL;
-}
diff --git a/c/src/exec/libnetworking/lib/syslog.c b/c/src/exec/libnetworking/lib/syslog.c
deleted file mode 100644
index 0bb15bc78e..0000000000
--- a/c/src/exec/libnetworking/lib/syslog.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * RTEMS version of syslog and associated routines
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <syslog.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include <unistd.h>
-
-static int LogStatus = LOG_CONS;
-static const char *LogTag = "syslog";
-static int LogFacility = LOG_USER;
-static int LogMask = 0xff;
-
-static int LogFd = -1;
-static rtems_id LogSemaphore;
-extern struct in_addr rtems_bsdnet_log_host_address;
-
-#define SYSLOG_PORT 514
-
-void
-syslog (int pri, const char *fmt, ...)
-{
- va_list ap;
-
- va_start (ap, fmt);
- vsyslog (pri, fmt, ap);
- va_end (ap);
-}
-
-/*
- * FIXME: Should cbuf be static? It could be if we put the mutex
- * around the entire body of this routine. Then we wouldn't
- * have to worry about blowing stacks with a local variable
- * that large. Could make cbuf bigger, too.
- */
-void
-vsyslog (int pri, const char *fmt, va_list ap)
-{
- int cnt;
- char *cp;
- char *msgp, cbuf[200];
- int sent;
-
- if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) {
- syslog (LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID,
- "syslog: unknown facility/priority: %#x", pri);
- pri &= LOG_PRIMASK|LOG_FACMASK;
- }
-
- if (!LOG_MASK(LOG_PRI(pri)) & LogMask)
- return;
-
- if ((pri & LOG_FACMASK) == 0)
- pri |= LogFacility;
-
- cnt = sprintf (cbuf, "<%d>", pri);
- cp = msgp = cbuf + cnt;
- if (LogTag) {
- const char *lp = LogTag;
- while ((*cp = *lp++) != '\0')
- cp++;
- }
- if (LogStatus & LOG_PID) {
- rtems_id tid;
- rtems_task_ident (RTEMS_SELF, 0, &tid);
- cnt = sprintf (cp, "[%#lx]", (unsigned long)tid);
- cp += cnt;
- }
- if (LogTag) {
- *cp++ = ':';
- *cp++ = ' ';
- }
- cnt = vsprintf (cp, fmt, ap);
- cnt += cp - cbuf;
- if (cbuf[cnt-1] == '\n')
- cbuf[--cnt] = '\0';
-
- if (LogStatus & LOG_PERROR)
- printf ("%s\n", cbuf);
-
- /*
- * Grab the mutex
- */
- sent = 0;
- if ((rtems_bsdnet_log_host_address.s_addr != INADDR_ANY)
- && (LogFd >= 0)
- && (rtems_semaphore_obtain (LogSemaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT) == RTEMS_SUCCESSFUL)) {
- /*
- * Set the destination address/port
- */
- struct sockaddr_in farAddress;
- farAddress.sin_family = AF_INET;
- farAddress.sin_port = htons (SYSLOG_PORT);
- farAddress.sin_addr = rtems_bsdnet_log_host_address;
- memset (farAddress.sin_zero, '\0', sizeof farAddress.sin_zero);
-
- /*
- * Send the message
- */
- if (sendto (LogFd, cbuf, cnt, 0, (struct sockaddr *)&farAddress, sizeof farAddress) >= 0)
- sent = 1;
- rtems_semaphore_release (LogSemaphore);
- }
- if (!sent && (LogStatus & LOG_CONS) && !(LogStatus & LOG_PERROR))
- printf ("%s\n", msgp);
-}
-
-void
-openlog (const char *ident, int logstat, int logfac)
-{
- rtems_status_code sc;
- struct sockaddr_in myAddress;
-
- if (ident != NULL)
- LogTag = ident;
- LogStatus = logstat;
- if (logfac != 0 && (logfac & ~LOG_FACMASK) == 0)
- LogFacility = logfac;
-
- /*
- * Create the socket
- */
- if ((LogFd = socket (AF_INET, SOCK_DGRAM, 0)) < 0) {
- printf ("Can't create syslog socket: %d\n", errno);
- return;
- }
-
- /*
- * Bind socket to name
- */
- myAddress.sin_family = AF_INET;
- myAddress.sin_addr.s_addr = INADDR_ANY;
- myAddress.sin_port = 0;
- memset (myAddress.sin_zero, '\0', sizeof myAddress.sin_zero);
- if (bind (LogFd, (struct sockaddr *)&myAddress, sizeof (myAddress)) < 0) {
- close (LogFd);
- LogFd = -1;
- printf ("Can't bind syslog socket: %d\n", errno);
- return;
- }
-
- /*
- * Create the mutex
- */
- sc = rtems_semaphore_create (rtems_build_name('s', 'L', 'o', 'g'),
- 1,
- RTEMS_PRIORITY |
- RTEMS_BINARY_SEMAPHORE |
- RTEMS_INHERIT_PRIORITY |
- RTEMS_NO_PRIORITY_CEILING |
- RTEMS_LOCAL,
- 0,
- &LogSemaphore);
- if (sc != RTEMS_SUCCESSFUL) {
- printf ("Can't create syslog seamphore: %d\n", sc);
- close (LogFd);
- LogFd = -1;
- }
-}
-
-void
-closelog(void)
-{
- if (LogFd >= 0) {
- close (LogFd);
- LogFd = -1;
- rtems_semaphore_delete (LogSemaphore);
- }
-}
-
-int
-setlogmask (int pmask)
-{
- int omask;
-
- omask = LogMask;
- if (pmask != 0)
- LogMask = pmask;
- return (omask);
-}
diff --git a/c/src/exec/libnetworking/lib/tftpDriver.c b/c/src/exec/libnetworking/lib/tftpDriver.c
deleted file mode 100644
index cf75623580..0000000000
--- a/c/src/exec/libnetworking/lib/tftpDriver.c
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
- * Trivial File Transfer Protocol (RFC 1350)
- *
- * Transfer file to/from remote host
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-#include <stdio.h>
-#include <errno.h>
-#include <malloc.h>
-#include <string.h>
-#include <unistd.h>
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/rtems_bsdnet.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Range of UDP ports to try
- */
-#define UDP_PORT_BASE 3180
-
-/*
- * Pathname prefix
- */
-#define TFTP_PATHNAME_PREFIX "/TFTP/"
-
-/*
- * Default limits
- */
-#define PACKET_REPLY_MILLISECONDS 6000
-#define OPEN_RETRY_LIMIT 10
-#define IO_RETRY_LIMIT 10
-
-/*
- * TFTP opcodes
- */
-#define TFTP_OPCODE_RRQ 1
-#define TFTP_OPCODE_WRQ 2
-#define TFTP_OPCODE_DATA 3
-#define TFTP_OPCODE_ACK 4
-#define TFTP_OPCODE_ERROR 5
-
-/*
- * Largest data transfer
- */
-#define TFTP_BUFSIZE 512
-
-/*
- * Packets transferred between machines
- */
-union tftpPacket {
- /*
- * RRQ/WRQ packet
- */
- struct tftpRWRQ {
- rtems_unsigned16 opcode;
- char filename_mode[TFTP_BUFSIZE];
- } tftpRWRQ;
-
- /*
- * DATA packet
- */
- struct tftpDATA {
- rtems_unsigned16 opcode;
- rtems_unsigned16 blocknum;
- rtems_unsigned8 data[TFTP_BUFSIZE];
- } tftpDATA;
-
- /*
- * ACK packet
- */
- struct tftpACK {
- rtems_unsigned16 opcode;
- rtems_unsigned16 blocknum;
- } tftpACK;
-
- /*
- * ERROR packet
- */
- struct tftpERROR {
- rtems_unsigned16 opcode;
- rtems_unsigned16 errorCode;
- char errorMessage[TFTP_BUFSIZE];
- } tftpERROR;
-};
-
-/*
- * State of each TFTP stream
- */
-struct tftpStream {
- /*
- * Buffer for storing most recently-received packet
- */
- union tftpPacket pkbuf;
-
- /*
- * Last block number received
- */
- rtems_unsigned16 blocknum;
-
- /*
- * Data transfer socket
- */
- int socket;
- struct sockaddr_in myAddress;
- struct sockaddr_in farAddress;
-
- /*
- * Indices into buffer
- */
- int nleft;
- int nused;
-
- /*
- * Flags
- */
- int firstReply;
- int eof;
-};
-
-/*
- * Number of streams open at the same time
- */
-static rtems_id tftp_mutex;
-static int nStreams;
-static struct tftpStream ** volatile tftpStreams;
-
-/*
- * Initialize the TFTP driver
- */
-rtems_device_driver rtems_tftp_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_status_code sc;
-
- sc = rtems_semaphore_create (rtems_build_name('T', 'F', 'T', 'P'),
- 1,
- RTEMS_FIFO |
- RTEMS_BINARY_SEMAPHORE |
- RTEMS_NO_INHERIT_PRIORITY |
- RTEMS_NO_PRIORITY_CEILING |
- RTEMS_LOCAL,
- 0,
- &tftp_mutex);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- rtems_io_register_name (TFTP_PATHNAME_PREFIX, major, minor);
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Set error message
- * This RTEMS/UNIX error mapping needs to be fixed!
- */
-static void
-tftpSetErrno (struct tftpStream *tp)
-{
- unsigned int tftpError;
- static const int errorMap[] = {
- 0,
- ENOENT,
- EPERM,
- ENOSPC,
- EINVAL,
- ENXIO,
- EEXIST,
- ESRCH,
- 0,
- };
-
- tftpError = ntohs (tp->pkbuf.tftpERROR.errorCode);
- if (tftpError < (sizeof errorMap / sizeof errorMap[0]))
- errno = errorMap[tftpError];
- else
- errno = 1000 + tftpError;
-}
-
-/*
- * Send a message to make the other end shut up
- */
-static void
-sendStifle (struct tftpStream *tp, struct sockaddr_in *to)
-{
- int len;
-
- /*
- * Create the error packet (Unknown transfer ID).
- */
- tp->pkbuf.tftpERROR.opcode = htons (TFTP_OPCODE_ERROR);
- tp->pkbuf.tftpERROR.errorCode = htons (5);
- len = sizeof tp->pkbuf.tftpERROR.opcode +
- sizeof tp->pkbuf.tftpERROR.errorCode + 1;
- len += sprintf (tp->pkbuf.tftpERROR.errorMessage, "GO AWAY");
-
- /*
- * Send it
- */
- sendto (tp->socket, (char *)&tp->pkbuf, len, 0,
- (struct sockaddr *)to, sizeof *to);
-}
-
-/*
- * Wait for a data packet
- */
-static int
-getPacket (struct tftpStream *tp)
-{
- int len;
- struct timeval tv;
-
- tv.tv_sec = 6;
- tv.tv_usec = 0;
- setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
- for (;;) {
- union {
- struct sockaddr s;
- struct sockaddr_in i;
- } from;
- int fromlen = sizeof from;
- len = recvfrom (tp->socket, (char *)&tp->pkbuf,
- sizeof tp->pkbuf, 0,
- &from.s, &fromlen);
- if (len < 0)
- break;
- if (from.i.sin_addr.s_addr == tp->farAddress.sin_addr.s_addr) {
- if (tp->firstReply) {
- tp->firstReply = 0;
- tp->farAddress.sin_port = from.i.sin_port;
- }
- if (tp->farAddress.sin_port == from.i.sin_port)
- break;
- }
-
- /*
- * Packet is from someone with whom we are
- * not interested. Tell them to go away.
- */
- sendStifle (tp, &from.i);
- }
- tv.tv_sec = 0;
- setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
- return len;
-}
-
-/*
- * Send an acknowledgement
- */
-static int
-sendAck (struct tftpStream *tp)
-{
- /*
- * Create the acknowledgement
- */
- tp->pkbuf.tftpACK.opcode = htons (TFTP_OPCODE_ACK);
- tp->pkbuf.tftpACK.blocknum = htons (tp->blocknum);
-
- /*
- * Send it
- */
- if (sendto (tp->socket, (char *)&tp->pkbuf, sizeof tp->pkbuf.tftpACK, 0,
- (struct sockaddr *)&tp->farAddress,
- sizeof tp->farAddress) < 0)
- return errno;
- return 0;
-}
-
-/*
- * Release a stream and clear the pointer to it
- */
-static void
-releaseStream (int s)
-{
- rtems_semaphore_obtain (tftp_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- free (tftpStreams[s]);
- tftpStreams[s] = NULL;
- rtems_semaphore_release (tftp_mutex);
-}
-
-/*
- * Open a TFTP stream
- */
-rtems_device_driver rtems_tftp_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_open_close_args_t *ap = pargp;
- struct tftpStream *tp;
- int retryCount;
- rtems_unsigned32 farAddress;
- int s;
- int len;
- char *cp1, *cp2;
- char *remoteFilename;
- rtems_interval now;
- rtems_status_code sc;
-
- /*
- * Read-only for now
- */
- if (ap->flags & LIBIO_FLAGS_WRITE)
- return RTEMS_NOT_IMPLEMENTED;
-
- /*
- * Pick apart the name into a host:pathname pair
- */
- if (strlen (ap->iop->pathname) <= strlen (TFTP_PATHNAME_PREFIX))
- return RTEMS_INVALID_NAME;
- cp2 = ap->iop->pathname + strlen (TFTP_PATHNAME_PREFIX);
- if (*cp2 == '/') {
- farAddress = rtems_bsdnet_bootp_server_address.s_addr;
- }
- else {
- char *hostname;
-
- cp1 = cp2;
- while (*cp2 != '/') {
- if (*cp2 == '\0')
- return RTEMS_INVALID_NAME;
- cp2++;
- }
- len = cp2 - cp1;
- hostname = malloc (len + 1);
- if (hostname == NULL)
- return RTEMS_NO_MEMORY;
- strncpy (hostname, cp1, len);
- hostname[len] = '\0';
- farAddress = inet_addr (hostname);
- free (hostname);
- }
- if ((farAddress == 0) || (farAddress == ~0))
- return RTEMS_INVALID_NAME;
- if (*++cp2 == '\0')
- return RTEMS_INVALID_NAME;
- remoteFilename = cp2;
- if (strlen (remoteFilename) > (TFTP_BUFSIZE - 10))
- return RTEMS_INVALID_NAME;
-
- /*
- * Find a free stream
- */
- sc = rtems_semaphore_obtain (tftp_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- for (s = 0 ; s < nStreams ; s++) {
- if (tftpStreams[s] == NULL)
- break;
- }
- if (s == nStreams) {
- /*
- * Reallocate stream pointers
- * Guard against the case where realloc() returns NULL.
- */
- struct tftpStream **np;
-
- np = realloc (tftpStreams, ++nStreams * sizeof *tftpStreams);
- if (np == NULL) {
- rtems_semaphore_release (tftp_mutex);
- return RTEMS_NO_MEMORY;
- }
- tftpStreams = np;
- }
- tp = tftpStreams[s] = malloc (sizeof (struct tftpStream));
- rtems_semaphore_release (tftp_mutex);
- if (tp == NULL)
- return RTEMS_NO_MEMORY;
- ap->iop->data0 = s;
- ap->iop->data1 = tp;
-
- /*
- * Create the socket
- */
- if ((tp->socket = socket (AF_INET, SOCK_DGRAM, 0)) < 0) {
- releaseStream (s);
- return RTEMS_TOO_MANY;
- }
-
- /*
- * Bind the socket to a local address
- */
- retryCount = 0;
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- for (;;) {
- int try = (now + retryCount) % 10;
-
- tp->myAddress.sin_family = AF_INET;
- tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try + minor);
- tp->myAddress.sin_addr.s_addr = htonl (INADDR_ANY);
- if (bind (tp->socket, (struct sockaddr *)&tp->myAddress, sizeof tp->myAddress) >= 0)
- break;
- if (++retryCount == 10) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_RESOURCE_IN_USE;
- }
- }
-
- /*
- * Set the UDP destination to the TFTP server
- * port on the remote machine.
- */
- tp->farAddress.sin_family = AF_INET;
- tp->farAddress.sin_addr.s_addr = farAddress;
- tp->farAddress.sin_port = htons (69);
-
- /*
- * Start the transfer
- */
- tp->firstReply = 1;
- for (;;) {
- /*
- * Create the request
- */
- tp->pkbuf.tftpRWRQ.opcode = htons (TFTP_OPCODE_RRQ);
- cp1 = tp->pkbuf.tftpRWRQ.filename_mode;
- cp2 = remoteFilename;
- while ((*cp1++ = *cp2++) != '\0')
- continue;
- cp2 = "octet";
- while ((*cp1++ = *cp2++) != '\0')
- continue;
- len = cp1 - (char *)&tp->pkbuf.tftpRWRQ;
-
- /*
- * Send the request
- */
- if (sendto (tp->socket, (char *)&tp->pkbuf, len, 0,
- (struct sockaddr *)&tp->farAddress,
- sizeof tp->farAddress) < 0) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_UNSATISFIED;
- }
-
- /*
- * Get reply
- */
- len = getPacket (tp);
- if (len >= (int) sizeof tp->pkbuf.tftpACK) {
- int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
- if ((opcode == TFTP_OPCODE_DATA)
- && (ntohs (tp->pkbuf.tftpDATA.blocknum) == 1)) {
- tp->nused = 0;
- tp->blocknum = 1;
- tp->nleft = len - 2 * sizeof (rtems_unsigned16);
- tp->eof = (tp->nleft < TFTP_BUFSIZE);
- if (sendAck (tp) != 0) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_UNSATISFIED;
- }
- break;
- }
- if (opcode == TFTP_OPCODE_ERROR) {
- tftpSetErrno (tp);
- close (tp->socket);
- releaseStream (ap->iop->data0);
- return RTEMS_INTERNAL_ERROR;
- }
- }
-
- /*
- * Keep trying
- */
- if (++retryCount >= OPEN_RETRY_LIMIT) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_UNSATISFIED;
- }
- }
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Read from a TFTP stream
- */
-rtems_device_driver rtems_tftp_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_rw_args_t *ap = pargp;
- char *bp;
- struct tftpStream *tp;
- int retryCount;
- int nwant;
-
- tp = ap->iop->data1;
-
- /*
- * Read till user request is satisfied or EOF is reached
- */
- bp = ap->buffer;
- nwant = ap->count;
- while (nwant) {
- if (tp->nleft) {
- int count;
- if (nwant < tp->nleft)
- count = nwant;
- else
- count = tp->nleft;
- memcpy (bp, &tp->pkbuf.tftpDATA.data[tp->nused], count);
- tp->nused += count;
- tp->nleft -= count;
- bp += count;
- nwant -= count;
- if (nwant == 0)
- break;
- }
- if (tp->eof)
- break;
-
- /*
- * Wait for the next packet
- */
- retryCount = 0;
- for (;;) {
- int len = getPacket (tp);
- if (len >= (int)sizeof tp->pkbuf.tftpACK) {
- int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
- rtems_unsigned16 nextBlock = tp->blocknum + 1;
- if ((opcode == TFTP_OPCODE_DATA)
- && (ntohs (tp->pkbuf.tftpDATA.blocknum) == nextBlock)) {
- tp->nused = 0;
- tp->nleft = len - 2 * sizeof (rtems_unsigned16);
- tp->eof = (tp->nleft < TFTP_BUFSIZE);
- tp->blocknum++;
- if (sendAck (tp) != 0)
- return RTEMS_IO_ERROR;
- break;
- }
- if (opcode == TFTP_OPCODE_ERROR) {
- tftpSetErrno (tp);
- return RTEMS_INTERNAL_ERROR;
- }
- }
-
- /*
- * Keep trying?
- */
- if (++retryCount == IO_RETRY_LIMIT)
- return RTEMS_IO_ERROR;
- if (sendAck (tp) != 0)
- return RTEMS_IO_ERROR;
- }
- }
- ap->bytes_moved = ap->count - nwant;
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close a TFTP stream
- */
-rtems_device_driver rtems_tftp_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_open_close_args_t *ap = pargp;
- struct tftpStream *tp = ap->iop->data1;;
-
- if (!tp->eof && !tp->firstReply) {
- /*
- * Tell the other end to stop
- */
- rtems_interval ticksPerSecond;
- sendStifle (tp, &tp->farAddress);
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond);
- rtems_task_wake_after (1 + ticksPerSecond / 10);
- }
- close (tp->socket);
- releaseStream (ap->iop->data0);
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver rtems_tftp_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_device_driver rtems_tftp_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/exec/libnetworking/libc/addr2ascii.3 b/c/src/exec/libnetworking/libc/addr2ascii.3
deleted file mode 100644
index 10c839ea74..0000000000
--- a/c/src/exec/libnetworking/libc/addr2ascii.3
+++ /dev/null
@@ -1,217 +0,0 @@
-.\"
-.\" Copyright 1996 Massachusetts Institute of Technology
-.\"
-.\" Permission to use, copy, modify, and distribute this software and
-.\" its documentation for any purpose and without fee is hereby
-.\" granted, provided that both the above copyright notice and this
-.\" permission notice appear in all copies, that both the above
-.\" copyright notice and this permission notice appear in all
-.\" supporting documentation, and that the name of M.I.T. not be used
-.\" in advertising or publicity pertaining to distribution of the
-.\" software without specific, written prior permission. M.I.T. makes
-.\" no representations about the suitability of this software for any
-.\" purpose. It is provided "as is" without express or implied
-.\" warranty.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
-.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
-.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
-.\" SHALL M.I.T. 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.
-.\"
-.\" $ANA: addr2ascii.3,v 1.1 1996/06/13 18:41:46 wollman Exp $
-.\" $Id$
-.\"
-.Dd June 13, 1996
-.Dt ADDR2ASCII 3
-.Os
-.Sh NAME
-.Nm addr2ascii ,
-.Nm ascii2addr
-.Nd Generic address formatting routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netinet/in.h>
-.Fd #include <arpa/inet.h>
-.Ft "char *"
-.Fn addr2ascii "int af" "const void *addrp" "int len" "char *buf"
-.Ft int
-.Fn ascii2addr "int af" "const char *ascii" "void *result"
-.Sh DESCRIPTION
-The routines
-.Fn addr2ascii
-and
-.Fn ascii2addr
-are used to convert network addresses between binary form and a
-printable form appropriate to the address family. Both functions take
-an
-.Fa af
-argument, specifying the address family to be used in the conversion
-process.
-(Currently, only the
-.Dv AF_INET
-and
-.Dv AF_LINK
-address families are supported.)
-.Pp
-The
-.Fn addr2ascii
-function
-is used to convert binary, network-format addresses into printable
-form. In addition to
-.Fa af ,
-there are three other arguments. The
-.Fa addrp
-argument is a pointer to the network address to be converted.
-The
-.Fa len
-argument is the length of the address. The
-.Fa buf
-argument is an optional pointer to a caller-allocated buffer to hold
-the result; if a null pointer is passed,
-.Fn addr2ascii
-uses a statically-allocated buffer.
-.Pp
-The
-.Fn ascii2addr
-function performs the inverse operation to
-.Fn addr2ascii .
-In addition to
-.Fa af ,
-it takes two parameters,
-.Fa ascii
-and
-.Fa result .
-The
-.Fa ascii
-parameter is a pointer to the string which is to be converted into
-binary. The
-.Fa result
-parameter is a pointer to an appropriate network address structure for
-the specified family.
-.Pp
-The following gives the appropriate structure to use for binary
-addresses in the specified family:
-.Pp
-.Bl -tag -width AF_INETxxxx -compact
-.It Dv AF_INET
-.Li struct in_addr
-.Pq in Aq Pa netinet/in.h
-.It Dv AF_LINK
-.Li struct sockaddr_dl
-.Pq in Aq Pa net/if_dl.h
-.\" .It Dv AF_INET6
-.\" .Li struct in6_addr
-.\" .Pq in Aq Pa netinet6/in6.h
-.El
-.Sh RETURN VALUES
-The
-.Fn addr2ascii
-function returns the address of the buffer it was passed, or a static
-buffer if the a null pointer was passed; on failure, it returns a null
-pointer.
-The
-.Fn ascii2addr
-function returns the length of the binary address in bytes, or -1 on
-failure.
-.Sh EXAMPLES
-The
-.Xr inet 3
-functions
-.Fn inet_ntoa
-and
-.Fn inet_aton
-could be implemented thusly:
-.Bd -literal -offset indent
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-char *
-inet_ntoa(struct in_addr addr)
-{
- return addr2ascii(AF_INET, &addr, sizeof addr, 0);
-}
-
-int
-inet_aton(const char *ascii, struct in_addr *addr)
-{
- return (ascii2addr(AF_INET, ascii, addr)
- == sizeof(*addr));
-}
-.Ed
-.Pp
-In actuality, this cannot be done because
-.Fn addr2ascii
-and
-.Fn ascii2addr
-are implemented in terms of the
-.Xr inet 3
-functions, rather than the other way around.
-.Sh ERRORS
-When a failure is returned,
-.Li errno
-is set to one of the following values:
-.Bl -tag -width [EPROTONOSUPPORT]
-.It Bq Er ENAMETOOLONG
-The
-.Fn addr2ascii
-routine was passed a
-.Fa len
-parameter which was inappropriate for the address family given by
-.Fa af .
-.It Bq Er EPROTONOSUPPORT
-Either routine was passed an
-.Fa af
-parameter other than
-.Dv AF_INET
-or
-.Dv AF_LINK .
-.It Bq Er EINVAL
-The string passed to
-.Fn ascii2addr
-was improperly formatted for address family
-.Fa af .
-.El
-.Sh SEE ALSO
-.Xr inet 3 ,
-.Xr linkaddr 3 ,
-.Xr inet 4
-.Sh HISTORY
-An interface close to this one was originally suggested by Craig
-Partridge. This particular interface originally appeared in the
-.Tn INRIA
-.Tn IPv6
-implementation.
-.Sh AUTHORS
-Code and documentation by
-.An Garrett A. Wollman ,
-MIT Laboratory for Computer Science.
-.Sh BUGS
-The original implementations supported IPv6. This support should
-eventually be resurrected. The
-.Tn NRL
-implementation also included support for the
-.Dv AF_ISO
-and
-.Dv AF_NS
-address families.
-.Pp
-The genericity of this interface is somewhat questionable. A truly
-generic interface would provide a means for determining the length of
-the buffer to be used so that it could be dynamically allocated, and
-would always require a
-.Dq Li "struct sockaddr"
-to hold the binary address. Unfortunately, this is incompatible with existing
-practice. This limitation means that a routine for printing network
-addresses from arbitrary address families must still have internal
-knowledge of the maximum buffer length needed and the appropriate part
-of the address to use as the binary address.
diff --git a/c/src/exec/libnetworking/libc/addr2ascii.c b/c/src/exec/libnetworking/libc/addr2ascii.c
deleted file mode 100644
index dc651743b6..0000000000
--- a/c/src/exec/libnetworking/libc/addr2ascii.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 1996 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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.
- *
- * $ANA: addr2ascii.c,v 1.1 1996/06/13 18:41:46 wollman Exp $
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <errno.h>
-#include <string.h>
-
-#include <net/if_dl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*-
- * Convert a network address from binary to printable numeric format.
- * This API is copied from INRIA's IPv6 implementation, but it is a
- * bit bogus in two ways:
- *
- * 1) There is no value in passing both an address family and
- * an address length; either one should imply the other,
- * or we should be passing sockaddrs instead.
- * 2) There should by contrast be /added/ a length for the buffer
- * that we pass in, so that programmers are spared the need to
- * manually calculate (read: ``guess'') the maximum length.
- *
- * Flash: the API is also the same in the NRL implementation, and seems to
- * be some sort of standard, so we appear to be stuck with both the bad
- * naming and the poor choice of arguments.
- */
-char *
-addr2ascii(af, addrp, len, buf)
- int af;
- const void *addrp;
- int len; /* should be size_t XXX */
- char *buf; /* XXX should pass length of buffer */
-{
- static char staticbuf[64]; /* 64 for AF_LINK > 16 for AF_INET */
-
- if (!buf)
- buf = staticbuf;
-
- switch(af) {
- case AF_INET:
- if (len != sizeof(struct in_addr)) {
- errno = ENAMETOOLONG;
- return 0;
- }
- strcpy(buf, inet_ntoa(*(const struct in_addr *)addrp));
- break;
-
- case AF_LINK:
- if (len != sizeof(struct sockaddr_dl)) {
- errno = ENAMETOOLONG;
- return 0;
- }
- strcpy(buf, link_ntoa((const struct sockaddr_dl *)addrp));
- break;
-
- default:
- errno = EPROTONOSUPPORT;
- return 0;
- }
- return buf;
-}
diff --git a/c/src/exec/libnetworking/libc/ascii2addr.c b/c/src/exec/libnetworking/libc/ascii2addr.c
deleted file mode 100644
index e140244737..0000000000
--- a/c/src/exec/libnetworking/libc/ascii2addr.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 1996 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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.
- *
- * $ANA: ascii2addr.c,v 1.2 1996/06/13 18:46:02 wollman Exp $
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <errno.h>
-#include <string.h>
-
-#include <net/if_dl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-int
-ascii2addr(af, ascii, result)
- int af;
- const char *ascii;
- void *result;
-{
- struct in_addr *ina;
- char strbuf[4*sizeof("123")]; /* long enough for V4 only */
-
- switch(af) {
- case AF_INET:
- ina = result;
- strbuf[0] = '\0';
- strncat(strbuf, ascii, (sizeof strbuf)-1);
- if (inet_aton(strbuf, ina))
- return sizeof(struct in_addr);
- errno = EINVAL;
- break;
-
- case AF_LINK:
- link_addr(ascii, result);
- /* oops... no way to detect failure */
- return sizeof(struct sockaddr_dl);
-
- default:
- errno = EPROTONOSUPPORT;
- break;
- }
-
- return -1;
-}
diff --git a/c/src/exec/libnetworking/libc/base64.c b/c/src/exec/libnetworking/libc/base64.c
deleted file mode 100644
index 3017ccc01c..0000000000
--- a/c/src/exec/libnetworking/libc/base64.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1995 by International Business Machines, Inc.
- *
- * International Business Machines, Inc. (hereinafter called IBM) grants
- * permission under its copyrights to use, copy, modify, and distribute this
- * Software with or without fee, provided that the above copyright notice and
- * all paragraphs of this notice appear in all copies, and that the name of IBM
- * not be used in connection with the marketing of any product incorporating
- * the Software or modifications thereof, without specific, written prior
- * permission.
- *
- * To the extent it has a right to do so, IBM grants an immunity from suit
- * under its patents, if any, for the use, sale or manufacture of products to
- * the extent that such products are used for performing Domain Name System
- * dynamic updates in TCP/IP networks by means of the Software. No immunity is
- * granted for any product per se or for any other function of any product.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define Assert(Cond) if (!(Cond)) abort()
-
-static const char Base64[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-static const char Pad64 = '=';
-
-/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
- The following encoding technique is taken from RFC 1521 by Borenstein
- and Freed. It is reproduced here in a slightly edited form for
- convenience.
-
- A 65-character subset of US-ASCII is used, enabling 6 bits to be
- represented per printable character. (The extra 65th character, "=",
- is used to signify a special processing function.)
-
- The encoding process represents 24-bit groups of input bits as output
- strings of 4 encoded characters. Proceeding from left to right, a
- 24-bit input group is formed by concatenating 3 8-bit input groups.
- These 24 bits are then treated as 4 concatenated 6-bit groups, each
- of which is translated into a single digit in the base64 alphabet.
-
- Each 6-bit group is used as an index into an array of 64 printable
- characters. The character referenced by the index is placed in the
- output string.
-
- Table 1: The Base64 Alphabet
-
- Value Encoding Value Encoding Value Encoding Value Encoding
- 0 A 17 R 34 i 51 z
- 1 B 18 S 35 j 52 0
- 2 C 19 T 36 k 53 1
- 3 D 20 U 37 l 54 2
- 4 E 21 V 38 m 55 3
- 5 F 22 W 39 n 56 4
- 6 G 23 X 40 o 57 5
- 7 H 24 Y 41 p 58 6
- 8 I 25 Z 42 q 59 7
- 9 J 26 a 43 r 60 8
- 10 K 27 b 44 s 61 9
- 11 L 28 c 45 t 62 +
- 12 M 29 d 46 u 63 /
- 13 N 30 e 47 v
- 14 O 31 f 48 w (pad) =
- 15 P 32 g 49 x
- 16 Q 33 h 50 y
-
- Special processing is performed if fewer than 24 bits are available
- at the end of the data being encoded. A full encoding quantum is
- always completed at the end of a quantity. When fewer than 24 input
- bits are available in an input group, zero bits are added (on the
- right) to form an integral number of 6-bit groups. Padding at the
- end of the data is performed using the '=' character.
-
- Since all base64 input is an integral number of octets, only the
- -------------------------------------------------
- following cases can arise:
-
- (1) the final quantum of encoding input is an integral
- multiple of 24 bits; here, the final unit of encoded
- output will be an integral multiple of 4 characters
- with no "=" padding,
- (2) the final quantum of encoding input is exactly 8 bits;
- here, the final unit of encoded output will be two
- characters followed by two "=" padding characters, or
- (3) the final quantum of encoding input is exactly 16 bits;
- here, the final unit of encoded output will be three
- characters followed by one "=" padding character.
- */
-
-int
-b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) {
- size_t datalength = 0;
- u_char input[3];
- u_char output[4];
- size_t i;
-
- while (2 < srclength) {
- input[0] = *src++;
- input[1] = *src++;
- input[2] = *src++;
- srclength -= 3;
-
- output[0] = input[0] >> 2;
- output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
- output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
- output[3] = input[2] & 0x3f;
- Assert(output[0] < 64);
- Assert(output[1] < 64);
- Assert(output[2] < 64);
- Assert(output[3] < 64);
-
- if (datalength + 4 > targsize)
- return (-1);
- target[datalength++] = Base64[output[0]];
- target[datalength++] = Base64[output[1]];
- target[datalength++] = Base64[output[2]];
- target[datalength++] = Base64[output[3]];
- }
-
- /* Now we worry about padding. */
- if (0 != srclength) {
- /* Get what's left. */
- input[0] = input[1] = input[2] = '\0';
- for (i = 0; i < srclength; i++)
- input[i] = *src++;
-
- output[0] = input[0] >> 2;
- output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
- output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
- Assert(output[0] < 64);
- Assert(output[1] < 64);
- Assert(output[2] < 64);
-
- if (datalength + 4 > targsize)
- return (-1);
- target[datalength++] = Base64[output[0]];
- target[datalength++] = Base64[output[1]];
- if (srclength == 1)
- target[datalength++] = Pad64;
- else
- target[datalength++] = Base64[output[2]];
- target[datalength++] = Pad64;
- }
- if (datalength >= targsize)
- return (-1);
- target[datalength] = '\0'; /* Returned value doesn't count \0. */
- return (datalength);
-}
-
-/* skips all whitespace anywhere.
- converts characters, four at a time, starting at (or after)
- src from base - 64 numbers into three 8 bit bytes in the target area.
- it returns the number of data bytes stored at the target, or -1 on error.
- */
-
-int
-b64_pton(src, target, targsize)
- char const *src;
- u_char *target;
- size_t targsize;
-{
- int tarindex, state, ch;
- char *pos;
-
- state = 0;
- tarindex = 0;
-
- while ((ch = *src++) != '\0') {
- if (isspace(ch)) /* Skip whitespace anywhere. */
- continue;
-
- if (ch == Pad64)
- break;
-
- pos = strchr(Base64, ch);
- if (pos == 0) /* A non-base64 character. */
- return (-1);
-
- switch (state) {
- case 0:
- if (target) {
- if ((size_t)tarindex >= targsize)
- return (-1);
- target[tarindex] = (pos - Base64) << 2;
- }
- state = 1;
- break;
- case 1:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize)
- return (-1);
- target[tarindex] |= (pos - Base64) >> 4;
- target[tarindex+1] = ((pos - Base64) & 0x0f)
- << 4 ;
- }
- tarindex++;
- state = 2;
- break;
- case 2:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize)
- return (-1);
- target[tarindex] |= (pos - Base64) >> 2;
- target[tarindex+1] = ((pos - Base64) & 0x03)
- << 6;
- }
- tarindex++;
- state = 3;
- break;
- case 3:
- if (target) {
- if ((size_t)tarindex >= targsize)
- return (-1);
- target[tarindex] |= (pos - Base64);
- }
- tarindex++;
- state = 0;
- break;
- default:
- abort();
- }
- }
-
- /*
- * We are done decoding Base-64 chars. Let's see if we ended
- * on a byte boundary, and/or with erroneous trailing characters.
- */
-
- if (ch == Pad64) { /* We got a pad char. */
- ch = *src++; /* Skip it, get next. */
- switch (state) {
- case 0: /* Invalid = in first position */
- case 1: /* Invalid = in second position */
- return (-1);
-
- case 2: /* Valid, means one byte of info */
- /* Skip any number of spaces. */
- for ((void)NULL; ch != '\0'; ch = *src++)
- if (!isspace(ch))
- break;
- /* Make sure there is another trailing = sign. */
- if (ch != Pad64)
- return (-1);
- ch = *src++; /* Skip the = */
- /* Fall through to "single trailing =" case. */
- /* FALLTHROUGH */
-
- case 3: /* Valid, means two bytes of info */
- /*
- * We know this char is an =. Is there anything but
- * whitespace after it?
- */
- for ((void)NULL; ch != '\0'; ch = *src++)
- if (!isspace(ch))
- return (-1);
-
- /*
- * Now make sure for cases 2 and 3 that the "extra"
- * bits that slopped past the last full byte were
- * zeros. If we don't check them, they become a
- * subliminal channel.
- */
- if (target && target[tarindex] != 0)
- return (-1);
- }
- } else {
- /*
- * We ended by seeing the end of the string. Make sure we
- * have no partial bytes lying around.
- */
- if (state != 0)
- return (-1);
- }
-
- return (tarindex);
-}
diff --git a/c/src/exec/libnetworking/libc/byteorder.3 b/c/src/exec/libnetworking/libc/byteorder.3
deleted file mode 100644
index 81bf604867..0000000000
--- a/c/src/exec/libnetworking/libc/byteorder.3
+++ /dev/null
@@ -1,77 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" @(#)byteorder.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt BYTEORDER 3
-.Os BSD 4.2
-.Sh NAME
-.Nm htonl ,
-.Nm htons ,
-.Nm ntohl ,
-.Nm ntohs
-.Nd convert values between host and network byte order
-.Sh SYNOPSIS
-.Fd #include <sys/param.h>
-.Ft u_long
-.Fn htonl "u_long hostlong"
-.Ft u_short
-.Fn htons "u_short hostshort"
-.Ft u_long
-.Fn ntohl "u_long netlong"
-.Ft u_short
-.Fn ntohs "u_short netshort"
-.Sh DESCRIPTION
-These routines convert 16 and 32 bit quantities between network
-byte order and host byte order.
-On machines which have a byte order which is the same as the network
-order, routines are defined as null macros.
-.Pp
-These routines are most often used in conjunction with Internet
-addresses and ports as returned by
-.Xr gethostbyname 3
-and
-.Xr getservent 3 .
-.Sh SEE ALSO
-.Xr gethostbyname 3 ,
-.Xr getservent 3
-.Sh HISTORY
-The
-.Nm byteorder
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-On the
-.Tn VAX
-bytes are handled backwards from most everyone else in
-the world. This is not expected to be fixed in the near future.
diff --git a/c/src/exec/libnetworking/libc/ether_addr.c b/c/src/exec/libnetworking/libc/ether_addr.c
deleted file mode 100644
index 9b7a9abf44..0000000000
--- a/c/src/exec/libnetworking/libc/ether_addr.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 1995
- * Bill Paul <wpaul@ctr.columbia.edu>. 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 Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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.
- *
- * ethernet address conversion and lookup routines
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Center for Telecommunications Research
- * Columbia University, New York City
- *
- * $Id$
- */
-
-
-#include <stdio.h>
-#include <paths.h>
-#include <sys/types.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <net/ethernet.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-#ifndef _PATH_ETHERS
-#define _PATH_ETHERS "/etc/ethers"
-#endif
-
-/*
- * Parse a string of text containing an ethernet address and hostname
- * and separate it into its component parts.
- */
-int ether_line(l, e, hostname)
- char *l;
- struct ether_addr *e;
- char *hostname;
-{
- int i, o[6];
-
- i = sscanf(l, "%x:%x:%x:%x:%x:%x %s", &o[0], &o[1], &o[2],
- &o[3], &o[4], &o[5],
- hostname);
- if (i != 7)
- return (i);
-
- for (i=0; i<6; i++)
- e->octet[i] = o[i];
- return (0);
-}
-
-/*
- * Convert an ASCII representation of an ethernet address to
- * binary form.
- */
-struct ether_addr *ether_aton(a)
- char *a;
-{
- int i;
- static struct ether_addr o;
- unsigned int o0, o1, o2, o3, o4, o5;
-
- i = sscanf(a, "%x:%x:%x:%x:%x:%x", &o0, &o1, &o2, &o3, &o4, &o5);
-
- if (i != 6)
- return (NULL);
-
- o.octet[0]=o0;
- o.octet[1]=o1;
- o.octet[2]=o2;
- o.octet[3]=o3;
- o.octet[4]=o4;
- o.octet[5]=o5;
-
- return ((struct ether_addr *)&o);
-}
-
-/*
- * Convert a binary representation of an ethernet address to
- * an ASCII string.
- */
-char *ether_ntoa(n)
- struct ether_addr *n;
-{
- int i;
- static char a[18];
-
- i = sprintf(a,"%x:%x:%x:%x:%x:%x",n->octet[0],n->octet[1],n->octet[2],
- n->octet[3],n->octet[4],n->octet[5]);
- if (i < 11)
- return (NULL);
- return ((char *)&a);
-}
-
-/*
- * Map an ethernet address to a hostname. Use either /etc/ethers or
- * NIS/YP.
- */
-
-int ether_ntohost(hostname, e)
- char *hostname;
- struct ether_addr *e;
-{
- FILE *fp;
- char buf[BUFSIZ + 2];
- struct ether_addr local_ether;
- char local_host[MAXHOSTNAMELEN];
-#ifdef YP
- char *result;
- int resultlen;
- char *ether_a;
- char *yp_domain;
-#endif
- if ((fp = fopen(_PATH_ETHERS, "r")) == NULL)
- return (1);
-
- while (fgets(buf,BUFSIZ,fp)) {
- if (buf[0] == '#')
- continue;
-#ifdef YP
- if (buf[0] == '+') {
- if (yp_get_default_domain(&yp_domain))
- continue;
- ether_a = ether_ntoa(e);
- if (yp_match(yp_domain, "ethers.byaddr", ether_a,
- strlen(ether_a), &result, &resultlen)) {
- continue;
- }
- strncpy(buf, result, resultlen);
- buf[resultlen] = '\0';
- free(result);
- }
-#endif
- if (!ether_line(buf, &local_ether, local_host)) {
- if (!bcmp((char *)&local_ether.octet[0],
- (char *)&e->octet[0], 6)) {
- /* We have a match */
- strcpy(hostname, local_host);
- fclose(fp);
- return(0);
- }
- }
- }
- fclose(fp);
- return (1);
-}
-
-/*
- * Map a hostname to an ethernet address using /etc/ethers or
- * NIS/YP.
- */
-int ether_hostton(hostname, e)
- char *hostname;
- struct ether_addr *e;
-{
- FILE *fp;
- char buf[BUFSIZ + 2];
- struct ether_addr local_ether;
- char local_host[MAXHOSTNAMELEN];
-#ifdef YP
- char *result;
- int resultlen;
- char *yp_domain;
-#endif
- if ((fp = fopen(_PATH_ETHERS, "r")) == NULL)
- return (1);
-
- while (fgets(buf,BUFSIZ,fp)) {
- if (buf[0] == '#')
- continue;
-#ifdef YP
- if (buf[0] == '+') {
- if (yp_get_default_domain(&yp_domain))
- continue;
- if (yp_match(yp_domain, "ethers.byname", hostname,
- strlen(hostname), &result, &resultlen)) {
- continue;
- }
- strncpy(buf, result, resultlen);
- buf[resultlen] = '\0';
- free(result);
- }
-#endif
- if (!ether_line(buf, &local_ether, local_host)) {
- if (!strcmp(hostname, local_host)) {
- /* We have a match */
- bcopy((char *)&local_ether.octet[0],
- (char *)&e->octet[0], 6);
- fclose(fp);
- return(0);
- }
- }
- }
- fclose(fp);
- return (1);
-}
diff --git a/c/src/exec/libnetworking/libc/ethers.3 b/c/src/exec/libnetworking/libc/ethers.3
deleted file mode 100644
index afea48320a..0000000000
--- a/c/src/exec/libnetworking/libc/ethers.3
+++ /dev/null
@@ -1,193 +0,0 @@
-.\" Copyright (c) 1995
-.\" Bill Paul <wpaul@ctr.columbia.edu>. 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 Bill Paul.
-.\" 4. Neither the name of the author nor the names of any co-contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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.
-.\"
-.\" $Id$
-.\"
-.Dd April 12, 1995
-.Dt ETHERS 3
-.Os FreeBSD 2.1
-.Sh NAME
-.Nm ethers ,
-.Nm ether_line ,
-.Nm ether_aton ,
-.Nm ether_ntoa ,
-.Nm ether_ntohost ,
-.Nm ether_hostton
-.Nd Ethernet address conversion and lookup routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/socket.h>
-.Fd #include <net/ethernet.h>
-.Ft int
-.Fn ether_line "char *l" "struct ether_addr *e" "char *hostname"
-.Ft struct ether_addr *
-.Fn ether_aton "char *a"
-.Ft char *
-.Fn ether_ntoa "struct ether_addr *n"
-.Ft int
-.Fn ether_ntohost "char *hostname" "struct ether_addr *e"
-.Ft int
-.Fn ether_hostton "char *hostname" "struct ether_addr *e"
-.Sh DESCRIPTION
-These functions operate on ethernet addresses using an
-.Ar ether_addr
-structure, which is defined in the header file
-.Aq Pa netinet/if_ether.h :
-.Bd -literal -offset indent
-/*
- * The number of bytes in an ethernet (MAC) address.
- */
-#define ETHER_ADDR_LEN 6
-
-/*
- * Structure of a 48-bit Ethernet address.
- */
-struct ether_addr {
- u_char octet[ETHER_ADDR_LEN];
-};
-.Ed
-.Pp
-The function
-.Fn ether_line
-scans
-.Ar l ,
-an
-.Tn ASCII
-string in
-.Xr ethers 5
-format and sets
-.Ar e
-to the ethernet address specified in the string and
-.Ar h
-to the hostname. This function is used to parse lines from
-.Pa /etc/ethers
-into their component parts.
-.Pp
-The
-.Fn ether_aton
-function converts an
-.Tn ASCII
-representation of an ethernet address into an
-.Ar ether_addr
-structure. Likewise,
-.Fn ether_ntoa
-converts an ethernet address specified as an
-.Ar ether_addr
-structure into an
-.Tn ASCII
-string.
-.Pp
-The
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions map ethernet addresses to their corresponding hostnames
-as specified in the
-.Pa /etc/ethers
-database.
-.Fn ether_ntohost
-converts from ethernet address to hostname, and
-.Fn ether_hostton
-converts from hostname to ethernet address.
-.Sh RETURN VALUES
-.Fn ether_line
-returns zero on success and non-zero if it was unable to parse
-any part of the supplied line
-.Ar l .
-It returns the extracted ethernet address in the supplied
-.Ar ether_addr
-structure
-.Ar e
-and the hostname in the supplied string
-.Ar h .
-.Pp
-On success,
-.Fn ether_ntoa
-returns a pointer to a string containing an
-.Tn ASCII
-representation of an ethernet address. If it is unable to convert
-the supplied
-.Ar ether_addr
-structure, it returns a
-.Dv NULL
-pointer. Likewise,
-.Fn ether_aton
-returns a pointer to an
-.Ar ether_addr
-structure on success and a
-.Dv NULL
-pointer on failure.
-.Pp
-The
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions both return zero on success or non-zero if they were
-unable to find a match in the
-.Pa /etc/ethers
-database.
-.Sh NOTES
-The user must insure that the hostname strings passed to the
-the
-.Fn ether_line ,
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions are large enough to contain the returned hostnames.
-.Sh NIS INTERACTION
-If the
-.Pa /etc/ethers
-contains a line with a single + in it, the
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions will attempt to consult the NIS
-.Pa ethers.byname
-and
-.Pa ethers.byaddr
-maps in addition to the data in the
-.Pa /etc/ethers
-file.
-.Sh SEE ALSO
-.Xr yp 4 ,
-.Xr ethers 5
-.Sh BUGS
-.Pp
-The
-.Fn ether_aton
-and
-.Fn ether_ntoa
-functions returns values that are stored in static memory areas
-which may be overwritten the next time they are called.
-.Sh HISTORY
-This particular implementation of the
-.Nm ethers
-library functions were written for and first appeared in
-.Fx 2.1 .
diff --git a/c/src/exec/libnetworking/libc/gethostbydns.c b/c/src/exec/libnetworking/libc/gethostbydns.c
deleted file mode 100644
index 3d80ffde7a..0000000000
--- a/c/src/exec/libnetworking/libc/gethostbydns.c
+++ /dev/null
@@ -1,773 +0,0 @@
-/*
- * ++Copyright++ 1985, 1988, 1993
- * -
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char fromrcsid[] = "From: Id: gethnamaddr.c,v 8.23 1998/04/07 04:59:46 vixie Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <ctype.h>
-#include <errno.h>
-#include <syslog.h>
-
-#include "res_config.h"
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-#define MAXALIASES 35
-#define MAXADDRS 35
-
-static const char AskedForGot[] =
- "gethostby*.gethostanswer: asked for \"%s\", got \"%s\"";
-
-static char *h_addr_ptrs[MAXADDRS + 1];
-
-static struct hostent host;
-static char *host_aliases[MAXALIASES];
-static char hostbuf[8*1024];
-static u_char host_addr[16]; /* IPv4 or IPv6 */
-
-#ifdef RESOLVSORT
-static void addrsort __P((char **, int));
-#endif
-
-#if PACKETSZ > 1024
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 1024
-#endif
-
-typedef union {
- HEADER hdr;
- u_char buf[MAXPACKET];
-} querybuf;
-
-typedef union {
- int32_t al;
- char ac;
-} align;
-
-extern int h_errno;
-int _dns_ttl_;
-
-#ifdef DEBUG
-static void
-dprintf(msg, num)
- char *msg;
- int num;
-{
- if (_res.options & RES_DEBUG) {
- int save = errno;
-
- printf(msg, num);
- errno = save;
- }
-}
-#else
-# define dprintf(msg, num) /*nada*/
-#endif
-
-#define BOUNDED_INCR(x) \
- do { \
- cp += x; \
- if (cp > eom) { \
- h_errno = NO_RECOVERY; \
- return (NULL); \
- } \
- } while (0)
-
-#define BOUNDS_CHECK(ptr, count) \
- do { \
- if ((ptr) + (count) > eom) { \
- h_errno = NO_RECOVERY; \
- return (NULL); \
- } \
- } while (0)
-
-static struct hostent *
-gethostanswer(answer, anslen, qname, qtype)
- const querybuf *answer;
- int anslen;
- const char *qname;
- int qtype;
-{
- register const HEADER *hp;
- register const u_char *cp;
- register int n;
- const u_char *eom, *erdata;
- char *bp, **ap, **hap;
- int type, class, buflen, ancount, qdcount;
- int haveanswer, had_error;
- int toobig = 0;
- char tbuf[MAXDNAME];
- const char *tname;
- int (*name_ok) __P((const char *));
-
- tname = qname;
- host.h_name = NULL;
- eom = answer->buf + anslen;
- switch (qtype) {
- case T_A:
- case T_AAAA:
- name_ok = res_hnok;
- break;
- case T_PTR:
- name_ok = res_dnok;
- break;
- default:
- h_errno = NO_RECOVERY;
- return (NULL); /* XXX should be abort(); */
- }
- /*
- * find first satisfactory answer
- */
- hp = &answer->hdr;
- ancount = ntohs(hp->ancount);
- qdcount = ntohs(hp->qdcount);
- bp = hostbuf;
- buflen = sizeof hostbuf;
- cp = answer->buf;
- BOUNDED_INCR(HFIXEDSZ);
- if (qdcount != 1) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !(*name_ok)(bp)) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- BOUNDED_INCR(n + QFIXEDSZ);
- if (qtype == T_A || qtype == T_AAAA) {
- /* res_send() has already verified that the query name is the
- * same as the one we sent; this just gets the expanded name
- * (i.e., with the succeeding search-domain tacked on).
- */
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- host.h_name = bp;
- bp += n;
- buflen -= n;
- /* The qname can be abbreviated, but h_name is now absolute. */
- qname = host.h_name;
- }
- ap = host_aliases;
- *ap = NULL;
- host.h_aliases = host_aliases;
- hap = h_addr_ptrs;
- *hap = NULL;
- host.h_addr_list = h_addr_ptrs;
- haveanswer = 0;
- had_error = 0;
- _dns_ttl_ = -1;
- while (ancount-- > 0 && cp < eom && !had_error) {
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !(*name_ok)(bp)) {
- had_error++;
- continue;
- }
- cp += n; /* name */
- BOUNDS_CHECK(cp, 3 * INT16SZ + INT32SZ);
- type = _getshort(cp);
- cp += INT16SZ; /* type */
- class = _getshort(cp);
- cp += INT16SZ; /* class */
- if (qtype == T_A && type == T_A)
- _dns_ttl_ = _getlong(cp);
- cp += INT32SZ; /* TTL */
- n = _getshort(cp);
- cp += INT16SZ; /* len */
- BOUNDS_CHECK(cp, n);
- erdata = cp + n;
- if (class != C_IN) {
- /* XXX - debug? syslog? */
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- if ((qtype == T_A || qtype == T_AAAA) && type == T_CNAME) {
- if (ap >= &host_aliases[MAXALIASES-1])
- continue;
- n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf);
- if ((n < 0) || !(*name_ok)(tbuf)) {
- had_error++;
- continue;
- }
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- /* Store alias. */
- *ap++ = bp;
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- had_error++;
- continue;
- }
- bp += n;
- buflen -= n;
- /* Get canonical name. */
- n = strlen(tbuf) + 1; /* for the \0 */
- if (n > buflen || n >= MAXHOSTNAMELEN) {
- had_error++;
- continue;
- }
- strcpy(bp, tbuf);
- host.h_name = bp;
- bp += n;
- buflen -= n;
- continue;
- }
- if (qtype == T_PTR && type == T_CNAME) {
- n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf);
- if (n < 0 || !res_dnok(tbuf)) {
- had_error++;
- continue;
- }
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- /* Get canonical name. */
- n = strlen(tbuf) + 1; /* for the \0 */
- if (n > buflen || n >= MAXHOSTNAMELEN) {
- had_error++;
- continue;
- }
- strcpy(bp, tbuf);
- tname = bp;
- bp += n;
- buflen -= n;
- continue;
- }
- if (type != qtype) {
- syslog(LOG_NOTICE|LOG_AUTH,
- "gethostby*.gethostanswer: asked for \"%s %s %s\", got type \"%s\"",
- qname, p_class(C_IN), p_type(qtype),
- p_type(type));
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- switch (type) {
- case T_PTR:
- if (strcasecmp(tname, bp) != 0) {
- syslog(LOG_NOTICE|LOG_AUTH,
- AskedForGot, qname, bp);
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !res_hnok(bp)) {
- had_error++;
- break;
- }
-#if MULTI_PTRS_ARE_ALIASES
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- if (!haveanswer)
- host.h_name = bp;
- else if (ap < &host_aliases[MAXALIASES-1])
- *ap++ = bp;
- else
- n = -1;
- if (n != -1) {
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- had_error++;
- break;
- }
- bp += n;
- buflen -= n;
- }
- break;
-#else
- host.h_name = bp;
- if (_res.options & RES_USE_INET6) {
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- had_error++;
- break;
- }
- bp += n;
- buflen -= n;
- _map_v4v6_hostent(&host, &bp, &buflen);
- }
- h_errno = NETDB_SUCCESS;
- return (&host);
-#endif
- case T_A:
- case T_AAAA:
- if (strcasecmp(host.h_name, bp) != 0) {
- syslog(LOG_NOTICE|LOG_AUTH,
- AskedForGot, host.h_name, bp);
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- if (n != host.h_length) {
- cp += n;
- continue;
- }
- if (!haveanswer) {
- register int nn;
-
- host.h_name = bp;
- nn = strlen(bp) + 1; /* for the \0 */
- bp += nn;
- buflen -= nn;
- }
-
- bp += sizeof(align) - ((u_long)bp % sizeof(align));
-
- if (bp + n >= &hostbuf[sizeof hostbuf]) {
- dprintf("size (%d) too big\n", n);
- had_error++;
- continue;
- }
- if (hap >= &h_addr_ptrs[MAXADDRS-1]) {
- if (!toobig++)
- dprintf("Too many addresses (%d)\n",
- MAXADDRS);
- cp += n;
- continue;
- }
- bcopy(cp, *hap++ = bp, n);
- bp += n;
- buflen -= n;
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- break;
- default:
- dprintf("Impossible condition (type=%d)\n", type);
- h_errno = NO_RECOVERY;
- return (NULL);
- /* BIND has abort() here, too risky on bad data */
- }
- if (!had_error)
- haveanswer++;
- }
- if (haveanswer) {
- *ap = NULL;
- *hap = NULL;
-# if defined(RESOLVSORT)
- /*
- * Note: we sort even if host can take only one address
- * in its return structures - should give it the "best"
- * address in that case, not some random one
- */
- if (_res.nsort && haveanswer > 1 && qtype == T_A)
- addrsort(h_addr_ptrs, haveanswer);
-# endif /*RESOLVSORT*/
- if (!host.h_name) {
- n = strlen(qname) + 1; /* for the \0 */
- if (n > buflen || n >= MAXHOSTNAMELEN)
- goto no_recovery;
- strcpy(bp, qname);
- host.h_name = bp;
- bp += n;
- buflen -= n;
- }
- if (_res.options & RES_USE_INET6)
- _map_v4v6_hostent(&host, &bp, &buflen);
- h_errno = NETDB_SUCCESS;
- return (&host);
- }
- no_recovery:
- h_errno = NO_RECOVERY;
- return (NULL);
-}
-
-struct hostent *
-__dns_getanswer(answer, anslen, qname, qtype)
- const char *answer;
- int anslen;
- const char *qname;
- int qtype;
-{
- switch(qtype) {
- case T_AAAA:
- host.h_addrtype = AF_INET6;
- host.h_length = IN6ADDRSZ;
- break;
- case T_A:
- default:
- host.h_addrtype = AF_INET;
- host.h_length = INADDRSZ;
- break;
- }
-
- return(gethostanswer((const querybuf *)answer, anslen, qname, qtype));
-}
-
-struct hostent *
-_gethostbydnsname(name, af)
- const char *name;
- int af;
-{
- querybuf buf;
- register const char *cp;
- char *bp;
- int n, size, type, len;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
-
- switch (af) {
- case AF_INET:
- size = INADDRSZ;
- type = T_A;
- break;
- case AF_INET6:
- size = IN6ADDRSZ;
- type = T_AAAA;
- break;
- default:
- h_errno = NETDB_INTERNAL;
- errno = EAFNOSUPPORT;
- return (NULL);
- }
-
- host.h_addrtype = af;
- host.h_length = size;
-
- /*
- * if there aren't any dots, it could be a user-level alias.
- * this is also done in res_query() since we are not the only
- * function that looks up host names.
- */
- if (!strchr(name, '.') && (cp = __hostalias(name)))
- name = cp;
-
- /*
- * disallow names consisting only of digits/dots, unless
- * they end in a dot.
- */
- if (isdigit((int)name[0]))
- for (cp = name;; ++cp) {
- if (!*cp) {
- if (*--cp == '.')
- break;
- /*
- * All-numeric, no dot at the end.
- * Fake up a hostent as if we'd actually
- * done a lookup.
- */
- if (inet_pton(af, name, host_addr) <= 0) {
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- strncpy(hostbuf, name, MAXDNAME);
- hostbuf[MAXDNAME] = '\0';
- bp = hostbuf + MAXDNAME;
- len = sizeof hostbuf - MAXDNAME;
- host.h_name = hostbuf;
- host.h_aliases = host_aliases;
- host_aliases[0] = NULL;
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- host.h_addr_list = h_addr_ptrs;
- if (_res.options & RES_USE_INET6)
- _map_v4v6_hostent(&host, &bp, &len);
- h_errno = NETDB_SUCCESS;
- return (&host);
- }
- if (!isdigit((int)*cp) && *cp != '.')
- break;
- }
- if ((isxdigit((int)name[0]) && strchr(name, ':') != NULL) ||
- name[0] == ':')
- for (cp = name;; ++cp) {
- if (!*cp) {
- if (*--cp == '.')
- break;
- /*
- * All-IPv6-legal, no dot at the end.
- * Fake up a hostent as if we'd actually
- * done a lookup.
- */
- if (inet_pton(af, name, host_addr) <= 0) {
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- strncpy(hostbuf, name, MAXDNAME);
- hostbuf[MAXDNAME] = '\0';
- bp = hostbuf + MAXDNAME;
- len = sizeof hostbuf - MAXDNAME;
- host.h_name = hostbuf;
- host.h_aliases = host_aliases;
- host_aliases[0] = NULL;
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- host.h_addr_list = h_addr_ptrs;
- h_errno = NETDB_SUCCESS;
- return (&host);
- }
- if (!isxdigit((int)*cp) && *cp != ':' && *cp != '.')
- break;
- }
-
- if ((n = res_search(name, C_IN, type, buf.buf, sizeof(buf))) < 0) {
- dprintf("res_search failed (%d)\n", n);
- return (NULL);
- }
- return (gethostanswer(&buf, n, name, type));
-}
-
-struct hostent *
-_gethostbydnsaddr(addr, len, af)
- const char *addr; /* XXX should have been def'd as u_char! */
- int len, af;
-{
- const u_char *uaddr = (const u_char *)addr;
- static const u_char mapped[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0xff,0xff };
- static const u_char tunnelled[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 };
- int n, size;
- querybuf buf;
- register struct hostent *hp;
- char qbuf[MAXDNAME+1], *qp;
-#ifdef SUNSECURITY
- register struct hostent *rhp;
- char **haddr;
- u_long old_options;
- char hname2[MAXDNAME+1];
-#endif /*SUNSECURITY*/
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- if (af == AF_INET6 && len == IN6ADDRSZ &&
- (!bcmp(uaddr, mapped, sizeof mapped) ||
- !bcmp(uaddr, tunnelled, sizeof tunnelled))) {
- /* Unmap. */
- addr += sizeof mapped;
- uaddr += sizeof mapped;
- af = AF_INET;
- len = INADDRSZ;
- }
- switch (af) {
- case AF_INET:
- size = INADDRSZ;
- break;
- case AF_INET6:
- size = IN6ADDRSZ;
- break;
- default:
- errno = EAFNOSUPPORT;
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- if (size != len) {
- errno = EINVAL;
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- switch (af) {
- case AF_INET:
- (void) sprintf(qbuf, "%u.%u.%u.%u.in-addr.arpa",
- (uaddr[3] & 0xff),
- (uaddr[2] & 0xff),
- (uaddr[1] & 0xff),
- (uaddr[0] & 0xff));
- break;
- case AF_INET6:
- qp = qbuf;
- for (n = IN6ADDRSZ - 1; n >= 0; n--) {
- qp += SPRINTF((qp, "%x.%x.",
- uaddr[n] & 0xf,
- (uaddr[n] >> 4) & 0xf));
- }
- strcpy(qp, "ip6.int");
- break;
- default:
- abort();
- }
- n = res_query(qbuf, C_IN, T_PTR, (u_char *)buf.buf, sizeof buf.buf);
- if (n < 0) {
- dprintf("res_query failed (%d)\n", n);
- return (NULL);
- }
- if (!(hp = gethostanswer(&buf, n, qbuf, T_PTR)))
- return (NULL); /* h_errno was set by gethostanswer() */
-#ifdef SUNSECURITY
- if (af == AF_INET) {
- /*
- * turn off search as the name should be absolute,
- * 'localhost' should be matched by defnames
- */
- strncpy(hname2, hp->h_name, MAXDNAME);
- hname2[MAXDNAME] = '\0';
- old_options = _res.options;
- _res.options &= ~RES_DNSRCH;
- _res.options |= RES_DEFNAMES;
- if (!(rhp = gethostbyname(hname2))) {
- syslog(LOG_NOTICE|LOG_AUTH,
- "gethostbyaddr: No A record for %s (verifying [%s])",
- hname2, inet_ntoa(*((struct in_addr *)addr)));
- _res.options = old_options;
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- _res.options = old_options;
- for (haddr = rhp->h_addr_list; *haddr; haddr++)
- if (!memcmp(*haddr, addr, INADDRSZ))
- break;
- if (!*haddr) {
- syslog(LOG_NOTICE|LOG_AUTH,
- "gethostbyaddr: A record of %s != PTR record [%s]",
- hname2, inet_ntoa(*((struct in_addr *)addr)));
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- }
-#endif /*SUNSECURITY*/
- hp->h_addrtype = af;
- hp->h_length = len;
- bcopy(addr, host_addr, len);
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- if (af == AF_INET && (_res.options & RES_USE_INET6)) {
- _map_v4v6_address((char*)host_addr, (char*)host_addr);
- hp->h_addrtype = AF_INET6;
- hp->h_length = IN6ADDRSZ;
- }
- h_errno = NETDB_SUCCESS;
- return (hp);
-}
-
-#ifdef RESOLVSORT
-static void
-addrsort(ap, num)
- char **ap;
- int num;
-{
- int i, j;
- char **p;
- short aval[MAXADDRS];
- int needsort = 0;
-
- p = ap;
- for (i = 0; i < num; i++, p++) {
- for (j = 0 ; (unsigned)j < _res.nsort; j++)
- if (_res.sort_list[j].addr.s_addr ==
- (((struct in_addr *)(*p))->s_addr & _res.sort_list[j].mask))
- break;
- aval[i] = j;
- if (needsort == 0 && i > 0 && j < aval[i-1])
- needsort = i;
- }
- if (!needsort)
- return;
-
- while (needsort < num) {
- for (j = needsort - 1; j >= 0; j--) {
- if (aval[j] > aval[j+1]) {
- char *hp;
-
- i = aval[j];
- aval[j] = aval[j+1];
- aval[j+1] = i;
-
- hp = ap[j];
- ap[j] = ap[j+1];
- ap[j+1] = hp;
-
- } else
- break;
- }
- needsort++;
- }
-}
-#endif
-void
-_sethostdnsent(stayopen)
- int stayopen;
-{
- if ((_res.options & RES_INIT) == 0 && res_init() == -1)
- return;
- if (stayopen)
- _res.options |= RES_STAYOPEN | RES_USEVC;
-}
-
-void
-_endhostdnsent()
-{
- _res.options &= ~(RES_STAYOPEN | RES_USEVC);
- res_close();
-}
diff --git a/c/src/exec/libnetworking/libc/gethostbyht.c b/c/src/exec/libnetworking/libc/gethostbyht.c
deleted file mode 100644
index 29f2805367..0000000000
--- a/c/src/exec/libnetworking/libc/gethostbyht.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*-
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <arpa/nameser.h> /* XXX */
-#include <resolv.h> /* XXX */
-
-#define MAXALIASES 35
-
-static struct hostent host;
-static char *host_aliases[MAXALIASES];
-static char hostbuf[BUFSIZ+1];
-static FILE *hostf = NULL;
-static u_char host_addr[16]; /* IPv4 or IPv6 */
-static char *h_addr_ptrs[2];
-static int stayopen = 0;
-
-void
-_sethosthtent(f)
- int f;
-{
- if (!hostf)
- hostf = fopen(_PATH_HOSTS, "r" );
- else
- rewind(hostf);
- stayopen = f;
-}
-
-void
-_endhosthtent()
-{
- if (hostf && !stayopen) {
- (void) fclose(hostf);
- hostf = NULL;
- }
-}
-
-struct hostent *
-gethostent()
-{
- char *p;
- register char *cp, **q;
- int af, len;
-
- if (!hostf && !(hostf = fopen(_PATH_HOSTS, "r" ))) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- again:
- if (!(p = fgets(hostbuf, sizeof hostbuf, hostf))) {
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- if (*p == '#')
- goto again;
- if (!(cp = strpbrk(p, "#\n")))
- goto again;
- *cp = '\0';
- if (!(cp = strpbrk(p, " \t")))
- goto again;
- *cp++ = '\0';
- if (inet_pton(AF_INET6, p, host_addr) > 0) {
- af = AF_INET6;
- len = IN6ADDRSZ;
- } else if (inet_pton(AF_INET, p, host_addr) > 0) {
- if (_res.options & RES_USE_INET6) {
- _map_v4v6_address((char*)host_addr, (char*)host_addr);
- af = AF_INET6;
- len = IN6ADDRSZ;
- } else {
- af = AF_INET;
- len = INADDRSZ;
- }
- } else {
- goto again;
- }
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- host.h_addr_list = h_addr_ptrs;
- host.h_length = len;
- host.h_addrtype = af;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- host.h_name = cp;
- q = host.h_aliases = host_aliases;
- if ((cp = strpbrk(cp, " \t")) != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &host_aliases[MAXALIASES - 1])
- *q++ = cp;
- if ((cp = strpbrk(cp, " \t")) != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- h_errno = NETDB_SUCCESS;
- return (&host);
-}
-
-struct hostent *
-_gethostbyhtname(name, af)
- const char *name;
- int af;
-{
- register struct hostent *p;
- register char **cp;
-
- sethostent(0);
- while ((p = gethostent()) != NULL) {
- if (p->h_addrtype != af)
- continue;
- if (strcasecmp(p->h_name, name) == 0)
- break;
- for (cp = p->h_aliases; *cp != 0; cp++)
- if (strcasecmp(*cp, name) == 0)
- goto found;
- }
-found:
- endhostent();
- return (p);
-}
-
-struct hostent *
-_gethostbyhtaddr(addr, len, af)
- const char *addr;
- int len, af;
-{
- register struct hostent *p;
-
- sethostent(0);
- while ((p = gethostent()) != NULL)
- if (p->h_addrtype == af && !bcmp(p->h_addr, addr, len))
- break;
- endhostent();
- return (p);
-}
diff --git a/c/src/exec/libnetworking/libc/gethostbyname.3 b/c/src/exec/libnetworking/libc/gethostbyname.3
deleted file mode 100644
index e21dc79f1d..0000000000
--- a/c/src/exec/libnetworking/libc/gethostbyname.3
+++ /dev/null
@@ -1,305 +0,0 @@
-.\" Copyright (c) 1983, 1987, 1991, 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.
-.\"
-.\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95
-.\" $Id$
-.\"
-.Dd May 25, 1995
-.Dt GETHOSTBYNAME 3
-.Os BSD 4.2
-.Sh NAME
-.Nm gethostbyname ,
-.Nm gethostbyname2 ,
-.Nm gethostbyaddr ,
-.Nm gethostent ,
-.Nm sethostent ,
-.Nm endhostent ,
-.Nm herror ,
-.Nm hstrerror
-.Nd get network host entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Vt extern int h_errno;
-.Ft struct hostent *
-.Fn gethostbyname "const char *name"
-.Ft struct hostent *
-.Fn gethostbyname2 "const char *name" "int af"
-.Ft struct hostent *
-.Fn gethostbyaddr "const char *addr" "int len" "int type"
-.Ft struct hostent *
-.Fn gethostent void
-.Ft void
-.Fn sethostent "int stayopen"
-.Ft void
-.Fn endhostent void
-.Ft void
-.Fn herror "const char *string"
-.Ft const char *
-.Fn hstrerror "int err"
-.Sh DESCRIPTION
-The
-.Fn gethostbyname ,
-.Fn gethostbyname2
-and
-.Fn gethostbyaddr
-functions
-each return a pointer to an object with the
-following structure describing an internet host
-referenced by name or by address, respectively.
-This structure contains either the information obtained from the name server,
-.Xr named 8 ,
-or broken-out fields from a line in
-.Pa /etc/hosts .
-If the local name server is not running these routines do a lookup in
-.Pa /etc/hosts .
-.Bd -literal
-struct hostent {
- char *h_name; /* official name of host */
- char **h_aliases; /* alias list */
- int h_addrtype; /* host address type */
- int h_length; /* length of address */
- char **h_addr_list; /* list of addresses from name server */
-};
-#define h_addr h_addr_list[0] /* address, for backward compatibility */
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width h_addr_list
-.It Fa h_name
-Official name of the host.
-.It Fa h_aliases
-A NULL-terminated array of alternate names for the host.
-.It Fa h_addrtype
-The type of address being returned; usually
-.Dv AF_INET .
-.It Fa h_length
-The length, in bytes, of the address.
-.It Fa h_addr_list
-A NULL-terminated array of network addresses for the host.
-Host addresses are returned in network byte order.
-.It Fa h_addr
-The first address in
-.Fa h_addr_list ;
-this is for backward compatibility.
-.El
-.Pp
-When using the nameserver,
-.Fn gethostbyname
-and
-.Fn gethostbyname
-will search for the named host in the current domain and its parents
-unless the name ends in a dot.
-If the name contains no dot, and if the environment variable
-.Dq Ev HOSTALIASES
-contains the name of an alias file, the alias file will first be searched
-for an alias matching the input name.
-See
-.Xr hostname 7
-for the domain search procedure and the alias file format.
-.Pp
-The
-.Fn gethostbyname2
-function is an evolution of
-.Fn gethostbyname
-which is intended to allow lookups in address families other than
-.Dv AF_INET ,
-for example
-.Dv AF_INET6 .
-Currently the
-.Fa af
-argument must be specified as
-.Dv AF_INET
-else the function will return
-.Dv NULL
-after having set
-.Va h_errno
-to
-.Dv NETDB_INTERNAL
-.Pp
-The
-.Fn sethostent
-function
-may be used to request the use of a connected
-.Tn TCP
-socket for queries.
-If the
-.Fa stayopen
-flag is non-zero,
-this sets the option to send all queries to the name server using
-.Tn TCP
-and to retain the connection after each call to
-.Fn gethostbyname ,
-.Fn gethostbyname2
-or
-.Fn gethostbyaddr .
-Otherwise, queries are performed using
-.Tn UDP
-datagrams.
-.Pp
-The
-.Fn endhostent
-function
-closes the
-.Tn TCP
-connection.
-.Pp
-The
-.Fn herror
-function writes a message to the diagnostic output consisting of the
-string parameter
-.Fa s ,
-the constant string ": ", and a message corresponding to the value of
-.Va h_errno .
-.Pp
-The
-.Fn hstrerror
-function returns a string which is the message text corresponding to the
-value of the
-.Fa err
-parameter.
-.Sh FILES
-.Bl -tag -width /etc/resolv.conf -compact
-.It Pa /etc/hosts
-.It Pa /etc/host.conf
-.It Pa /etc/resolv.conf
-.El
-.Sh DIAGNOSTICS
-Error return status from
-.Fn gethostbyname ,
-.Fn gethostbyname2
-and
-.Fn gethostbyaddr
-is indicated by return of a null pointer.
-The external integer
-.Va h_errno
-may then be checked to see whether this is a temporary failure
-or an invalid or unknown host.
-The routine
-.Fn herror
-can be used to print an error message describing the failure.
-If its argument
-.Fa string
-is
-.Pf non Dv -NULL ,
-it is printed, followed by a colon and a space.
-The error message is printed with a trailing newline.
-.Pp
-The variable
-.Va h_errno
-can have the following values:
-.Bl -tag -width HOST_NOT_FOUND
-.It Dv HOST_NOT_FOUND
-No such host is known.
-.It Dv TRY_AGAIN
-This is usually a temporary error
-and means that the local server did not receive
-a response from an authoritative server.
-A retry at some later time may succeed.
-.It Dv NO_RECOVERY
-Some unexpected server failure was encountered.
-This is a non-recoverable error.
-.It Dv NO_DATA
-The requested name is valid but does not have an IP address;
-this is not a temporary error.
-This means that the name is known to the name server but there is no address
-associated with this name.
-Another type of request to the name server using this domain name
-will result in an answer;
-for example, a mail-forwarder may be registered for this domain.
-.El
-.Sh SEE ALSO
-.Xr resolver 3 ,
-.Xr hosts 5 ,
-.Xr hostname 7 ,
-.Xr named 8
-.Sh CAVEAT
-The
-.Fn gethostent
-function
-is defined, and
-.Fn sethostent
-and
-.Fn endhostent
-are redefined,
-when
-.Xr libc 3
-is built to use only the routines to lookup in
-.Pa /etc/hosts
-and not the name server.
-.Pp
-The
-.Fn gethostent
-function
-reads the next line of
-.Pa /etc/hosts ,
-opening the file if necessary.
-.Pp
-The
-.Fn sethostent
-function
-opens and/or rewinds the file
-.Pa /etc/hosts .
-If the
-.Fa stayopen
-argument is non-zero,
-the file will not be closed after each call to
-.Fn gethostbyname ,
-.Fn gethostbyname2
-or
-.Fn gethostbyaddr .
-.Pp
-The
-.Fn endhostent
-function
-closes the file.
-.Sh HISTORY
-The
-.Fn herror
-function appeared in
-.Bx 4.3 .
-The
-.Fn endhostent ,
-.Fn gethostbyaddr ,
-.Fn gethostbyname ,
-.Fn gethostent ,
-and
-.Fn sethostent
-functions appeared in
-.Bx 4.2 .
-The
-.Fn gethostbyname2
-function first appeared in bind-4.9.4.
-.Sh BUGS
-These functions use static data storage;
-if the data is needed for future use, it should be
-copied before any subsequent calls overwrite it.
-Only the Internet
-address format is currently understood.
diff --git a/c/src/exec/libnetworking/libc/gethostbynis.c b/c/src/exec/libnetworking/libc/gethostbynis.c
deleted file mode 100644
index 45dbe5a85d..0000000000
--- a/c/src/exec/libnetworking/libc/gethostbynis.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id$";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-#define MAXALIASES 35
-#define MAXADDRS 35
-
-#ifdef YP
-static char *host_aliases[MAXALIASES];
-static char hostaddr[MAXADDRS];
-static char *host_addrs[2];
-#endif /* YP */
-
-static struct hostent *
-_gethostbynis(name, map, af)
- const char *name;
- char *map;
- int af;
-{
-#ifdef YP
- register char *cp, **q;
- char *result;
- int resultlen;
- static struct hostent h;
- static char *domain = (char *)NULL;
- static char ypbuf[YPMAXRECORD + 2];
-
- switch(af) {
- case AF_INET:
- break;
- default:
- case AF_INET6:
- errno = EAFNOSUPPORT;
- return NULL;
- }
-
- if (domain == (char *)NULL)
- if (yp_get_default_domain (&domain))
- return ((struct hostent *)NULL);
-
- if (yp_match(domain, map, name, strlen(name), &result, &resultlen))
- return ((struct hostent *)NULL);
-
- /* avoid potential memory leak */
- bcopy((char *)result, (char *)&ypbuf, resultlen);
- ypbuf[resultlen] = '\0';
- free(result);
- result = (char *)&ypbuf;
-
- if ((cp = index(result, '\n')))
- *cp = '\0';
-
- cp = strpbrk(result, " \t");
- *cp++ = '\0';
- h.h_addr_list = host_addrs;
- h.h_addr = hostaddr;
- *((u_long *)h.h_addr) = inet_addr(result);
- h.h_length = sizeof(u_long);
- h.h_addrtype = AF_INET;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- h.h_name = cp;
- q = h.h_aliases = host_aliases;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &host_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&h);
-#else
- return (NULL);
-#endif /* YP */
-}
-
-struct hostent *
-_gethostbynisname(name, af)
- const char *name;
- int af;
-{
- return _gethostbynis(name, "hosts.byname", af);
-}
-
-struct hostent *
-_gethostbynisaddr(addr, len, af)
- const char *addr;
- int len;
- int af;
-{
- return _gethostbynis(inet_ntoa(*(struct in_addr *)addr),"hosts.byaddr", af);
-}
diff --git a/c/src/exec/libnetworking/libc/gethostnamadr.c b/c/src/exec/libnetworking/libc/gethostnamadr.c
deleted file mode 100644
index 92f7a21014..0000000000
--- a/c/src/exec/libnetworking/libc/gethostnamadr.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id$";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <arpa/nameser.h> /* XXX hack for _res */
-#include <resolv.h> /* XXX hack for _res */
-
-#define _PATH_HOSTCONF "/etc/host.conf"
-
-enum service_type {
- SERVICE_NONE = 0,
- SERVICE_BIND,
- SERVICE_HOSTS,
- SERVICE_NIS };
-#define SERVICE_MAX SERVICE_NIS
-
-static struct {
- const char *name;
- enum service_type type;
-} service_names[] = {
- { "hosts", SERVICE_HOSTS },
- { "/etc/hosts", SERVICE_HOSTS },
- { "hosttable", SERVICE_HOSTS },
- { "htable", SERVICE_HOSTS },
- { "bind", SERVICE_BIND },
- { "dns", SERVICE_BIND },
- { "domain", SERVICE_BIND },
- { "yp", SERVICE_NIS },
- { "yellowpages", SERVICE_NIS },
- { "nis", SERVICE_NIS },
- { 0, SERVICE_NONE }
-};
-
-static enum service_type service_order[SERVICE_MAX + 1];
-static int service_done = 0;
-
-static enum service_type
-get_service_name(const char *name) {
- int i;
- for(i = 0; service_names[i].type != SERVICE_NONE; i++) {
- if(!strcasecmp(name, service_names[i].name)) {
- return service_names[i].type;
- }
- }
- return SERVICE_NONE;
-}
-
-static void
-init_services()
-{
- char *cp, *p, buf[BUFSIZ];
- register int cc = 0;
- FILE *fd;
-
- if ((fd = (FILE *)fopen(_PATH_HOSTCONF, "r")) == NULL) {
- /* make some assumptions */
- service_order[0] = SERVICE_BIND;
- service_order[1] = SERVICE_HOSTS;
- service_order[2] = SERVICE_NONE;
- } else {
- while (fgets(buf, BUFSIZ, fd) != NULL && cc < SERVICE_MAX) {
- if(buf[0] == '#')
- continue;
-
- p = buf;
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- if (cp == NULL)
- continue;
- do {
- if (isalpha((int)cp[0])) {
- service_order[cc] = get_service_name(cp);
- if(service_order[cc] != SERVICE_NONE)
- cc++;
- }
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- } while(cp != NULL && cc < SERVICE_MAX);
- }
- service_order[cc] = SERVICE_NONE;
- fclose(fd);
- }
- service_done = 1;
-}
-
-struct hostent *
-gethostbyname(const char *name)
-{
- struct hostent *hp;
-
- if (_res.options & RES_USE_INET6) { /* XXX */
- hp = gethostbyname2(name, AF_INET6); /* XXX */
- if (hp) /* XXX */
- return (hp); /* XXX */
- } /* XXX */
- return (gethostbyname2(name, AF_INET));
-}
-
-struct hostent *
-gethostbyname2(const char *name, int type)
-{
- struct hostent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return NULL;
- case SERVICE_HOSTS:
- hp = _gethostbyhtname(name, type);
- break;
- case SERVICE_BIND:
- hp = _gethostbydnsname(name, type);
- break;
- case SERVICE_NIS:
- hp = _gethostbynisname(name, type);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-struct hostent *
-gethostbyaddr(const char *addr, int len, int type)
-{
- struct hostent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return 0;
- case SERVICE_HOSTS:
- hp = _gethostbyhtaddr(addr, len, type);
- break;
- case SERVICE_BIND:
- hp = _gethostbydnsaddr(addr, len, type);
- break;
- case SERVICE_NIS:
- hp = _gethostbynisaddr(addr, len, type);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-#ifdef _THREAD_SAFE
-struct hostent_data;
-
-/*
- * Temporary function (not thread safe)
- */
-int gethostbyaddr_r(const char *addr, int len, int type,
- struct hostent *result, struct hostent_data *buffer)
-{
- struct hostent *hp;
- int ret;
- if ((hp = gethostbyaddr(addr, len, type)) == NULL) {
- ret = -1;
- } else {
- memcpy(result, hp, sizeof(struct hostent));
- ret = 0;
- }
- return(ret);
-}
-#endif
-
-void
-sethostent(stayopen)
- int stayopen;
-{
- _sethosthtent(stayopen);
- _sethostdnsent(stayopen);
-}
-
-void
-endhostent()
-{
- _endhosthtent();
- _endhostdnsent();
-}
diff --git a/c/src/exec/libnetworking/libc/gethostname.c b/c/src/exec/libnetworking/libc/gethostname.c
deleted file mode 100644
index 81dc2267c2..0000000000
--- a/c/src/exec/libnetworking/libc/gethostname.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * $Id$
- */
-
-#include "config.h"
-
-/*
- * Solaris doesn't include the gethostname call by default.
- */
-#include <sys/utsname.h>
-#include <sys/systeminfo.h>
-
-#include <netdb.h>
-
-/*
- * PUBLIC: #ifndef HAVE_GETHOSTNAME
- * PUBLIC: int gethostname __P((char *, int));
- * PUBLIC: #endif
- */
-int
-gethostname(host, len)
- char *host;
- int len;
-{
- return (sysinfo(SI_HOSTNAME, host, len) == -1 ? -1 : 0);
-}
diff --git a/c/src/exec/libnetworking/libc/getnetbydns.c b/c/src/exec/libnetworking/libc/getnetbydns.c
deleted file mode 100644
index 8f8c576332..0000000000
--- a/c/src/exec/libnetworking/libc/getnetbydns.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/*-
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-/* Portions Copyright (c) 1993 Carlos Leandro and Rui Salgueiro
- * Dep. Matematica Universidade de Coimbra, Portugal, Europe
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <stdio.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <syslog.h>
-
-#include "res_config.h"
-
-extern int h_errno;
-
-#define BYADDR 0
-#define BYNAME 1
-#define MAXALIASES 35
-
-#if PACKETSZ > 1024
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 1024
-#endif
-
-typedef union {
- HEADER hdr;
- u_char buf[MAXPACKET];
-} querybuf;
-
-typedef union {
- long al;
- char ac;
-} align;
-
-static struct netent *
-getnetanswer(answer, anslen, net_i)
- querybuf *answer;
- int anslen;
- int net_i;
-{
-
- register HEADER *hp;
- register u_char *cp;
- register int n;
- u_char *eom;
- int type, class, buflen, ancount, qdcount, haveanswer, i, nchar;
- char aux1[MAXHOSTNAMELEN], aux2[MAXHOSTNAMELEN], ans[MAXHOSTNAMELEN];
- char *in, *st, *pauxt, *bp, **ap;
- char *paux1 = &aux1[0], *paux2 = &aux2[0], flag = 0;
-static struct netent net_entry;
-static char *net_aliases[MAXALIASES], netbuf[PACKETSZ];
-
- /*
- * find first satisfactory answer
- *
- * answer --> +------------+ ( MESSAGE )
- * | Header |
- * +------------+
- * | Question | the question for the name server
- * +------------+
- * | Answer | RRs answering the question
- * +------------+
- * | Authority | RRs pointing toward an authority
- * | Additional | RRs holding additional information
- * +------------+
- */
- eom = answer->buf + anslen;
- hp = &answer->hdr;
- ancount = ntohs(hp->ancount); /* #/records in the answer section */
- qdcount = ntohs(hp->qdcount); /* #/entries in the question section */
- bp = netbuf;
- buflen = sizeof(netbuf);
- cp = answer->buf + HFIXEDSZ;
- if (!qdcount) {
- if (hp->aa)
- h_errno = HOST_NOT_FOUND;
- else
- h_errno = TRY_AGAIN;
- return (NULL);
- }
- while (qdcount-- > 0)
- cp += __dn_skipname(cp, eom) + QFIXEDSZ;
- ap = net_aliases;
- *ap = NULL;
- net_entry.n_aliases = net_aliases;
- haveanswer = 0;
- while (--ancount >= 0 && cp < eom) {
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !res_dnok(bp))
- break;
- cp += n;
- ans[0] = '\0';
- (void)strncpy(&ans[0], bp, sizeof(ans) - 1);
- ans[sizeof(ans) - 1] = '\0';
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- cp += INT32SZ; /* TTL */
- GETSHORT(n, cp);
- if (class == C_IN && type == T_PTR) {
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !res_hnok(bp)) {
- cp += n;
- return (NULL);
- }
- cp += n;
- *ap++ = bp;
- bp += strlen(bp) + 1;
- net_entry.n_addrtype =
- (class == C_IN) ? AF_INET : AF_UNSPEC;
- haveanswer++;
- }
- }
- if (haveanswer) {
- *ap = NULL;
- switch (net_i) {
- case BYADDR:
- net_entry.n_name = *net_entry.n_aliases;
- net_entry.n_net = 0L;
- break;
- case BYNAME:
- in = *net_entry.n_aliases;
- net_entry.n_name = &ans[0];
- aux2[0] = '\0';
- for (i = 0; i < 4; i++) {
- for (st = in, nchar = 0;
- *st != '.';
- st++, nchar++)
- ;
- if (nchar != 1 || *in != '0' || flag) {
- flag = 1;
- (void)strncpy(paux1,
- (i==0) ? in : in-1,
- (i==0) ?nchar : nchar+1);
- paux1[(i==0) ? nchar : nchar+1] = '\0';
- pauxt = paux2;
- paux2 = strcat(paux1, paux2);
- paux1 = pauxt;
- }
- in = ++st;
- }
- net_entry.n_net = inet_network(paux2);
- break;
- }
- net_entry.n_aliases++;
- return (&net_entry);
- }
- h_errno = TRY_AGAIN;
- return (NULL);
-}
-
-struct netent *
-_getnetbydnsaddr(net, net_type)
- register unsigned long net;
- register int net_type;
-{
- unsigned int netbr[4];
- int nn, anslen;
- querybuf buf;
- char qbuf[MAXDNAME];
- unsigned long net2;
- struct netent *net_entry;
-
- if (net_type != AF_INET)
- return (NULL);
-
- for (nn = 4, net2 = net; net2; net2 >>= 8)
- netbr[--nn] = net2 & 0xff;
- switch (nn) {
- case 3: /* Class A */
- sprintf(qbuf, "0.0.0.%u.in-addr.arpa", netbr[3]);
- break;
- case 2: /* Class B */
- sprintf(qbuf, "0.0.%u.%u.in-addr.arpa", netbr[3], netbr[2]);
- break;
- case 1: /* Class C */
- sprintf(qbuf, "0.%u.%u.%u.in-addr.arpa", netbr[3], netbr[2],
- netbr[1]);
- break;
- case 0: /* Class D - E */
- sprintf(qbuf, "%u.%u.%u.%u.in-addr.arpa", netbr[3], netbr[2],
- netbr[1], netbr[0]);
- break;
- }
- anslen = res_query(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof(buf));
- if (anslen < 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf("res_query failed\n");
-#endif
- return (NULL);
- }
- net_entry = getnetanswer(&buf, anslen, BYADDR);
- if (net_entry) {
- unsigned u_net = net; /* maybe net should be unsigned ? */
-
- /* Strip trailing zeros */
- while ((u_net & 0xff) == 0 && u_net != 0)
- u_net >>= 8;
- net_entry->n_net = u_net;
- return (net_entry);
- }
- return (NULL);
-}
-
-struct netent *
-_getnetbydnsname(net)
- register const char *net;
-{
- int anslen;
- querybuf buf;
- char qbuf[MAXDNAME];
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- strncpy(qbuf, net, sizeof(qbuf) - 1);
- qbuf[sizeof(qbuf) - 1] = '\0';
- anslen = res_search(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof(buf));
- if (anslen < 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf("res_query failed\n");
-#endif
- return (NULL);
- }
- return getnetanswer(&buf, anslen, BYNAME);
-}
-
-void
-_setnetdnsent(stayopen)
- int stayopen;
-{
- if (stayopen)
- _res.options |= RES_STAYOPEN | RES_USEVC;
-}
-
-void
-_endnetdnsent()
-{
- _res.options &= ~(RES_STAYOPEN | RES_USEVC);
- res_close();
-}
diff --git a/c/src/exec/libnetworking/libc/getnetbyht.c b/c/src/exec/libnetworking/libc/getnetbyht.c
deleted file mode 100644
index f7b7b1091d..0000000000
--- a/c/src/exec/libnetworking/libc/getnetbyht.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- */
-
-/* Portions Copyright (c) 1993 Carlos Leandro and Rui Salgueiro
- * Dep. Matematica Universidade de Coimbra, Portugal, Europe
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * from getnetent.c 1.1 (Coimbra) 93/06/02
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getnetent.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: getnetent.c,v 8.4 1997/06/01 20:34:37 vixie Exp";
-static chat rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <string.h>
-
-#define MAXALIASES 35
-
-static FILE *netf;
-static char line[BUFSIZ+1];
-static struct netent net;
-static char *net_aliases[MAXALIASES];
-static int _net_stayopen;
-
-void
-_setnethtent(f)
- int f;
-{
-
- if (netf == NULL)
- netf = fopen(_PATH_NETWORKS, "r" );
- else
- rewind(netf);
- _net_stayopen |= f;
-}
-
-void
-_endnethtent()
-{
-
- if (netf) {
- fclose(netf);
- netf = NULL;
- }
- _net_stayopen = 0;
-}
-
-struct netent *
-getnetent()
-{
- char *p;
- register char *cp, **q;
-
- if (netf == NULL && (netf = fopen(_PATH_NETWORKS, "r" )) == NULL)
- return (NULL);
-again:
- p = fgets(line, sizeof line, netf);
- if (p == NULL)
- return (NULL);
- if (*p == '#')
- goto again;
- cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
- net.n_name = p;
- cp = strpbrk(p, " \t");
- if (cp == NULL)
- goto again;
- *cp++ = '\0';
- while (*cp == ' ' || *cp == '\t')
- cp++;
- p = strpbrk(cp, " \t");
- if (p != NULL)
- *p++ = '\0';
- net.n_net = inet_network(cp);
- net.n_addrtype = AF_INET;
- q = net.n_aliases = net_aliases;
- if (p != NULL)
- cp = p;
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &net_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&net);
-}
-
-struct netent *
-_getnetbyhtname(name)
- register const char *name;
-{
- register struct netent *p;
- register char **cp;
-
- setnetent(_net_stayopen);
- while ( (p = getnetent()) ) {
- if (strcasecmp(p->n_name, name) == 0)
- break;
- for (cp = p->n_aliases; *cp != 0; cp++)
- if (strcasecmp(*cp, name) == 0)
- goto found;
- }
-found:
- if (!_net_stayopen)
- endnetent();
- return (p);
-}
-
-struct netent *
-_getnetbyhtaddr(net, type)
- register unsigned long net;
- register int type;
-{
- register struct netent *p;
-
- setnetent(_net_stayopen);
- while ( (p = getnetent()) )
- if (p->n_addrtype == type && p->n_net == net)
- break;
- if (!_net_stayopen)
- endnetent();
- return (p);
-}
diff --git a/c/src/exec/libnetworking/libc/getnetbynis.c b/c/src/exec/libnetworking/libc/getnetbynis.c
deleted file mode 100644
index 0549016ba2..0000000000
--- a/c/src/exec/libnetworking/libc/getnetbynis.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id$";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <arpa/nameser.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-#define MAXALIASES 35
-#define MAXADDRS 35
-
-#ifdef YP
-static char *host_aliases[MAXALIASES];
-#endif /* YP */
-
-static struct netent *
-_getnetbynis(name, map, af)
- const char *name;
- char *map;
- int af;
-{
-#ifdef YP
- register char *cp, **q;
- static char *result;
- int resultlen;
- static struct netent h;
- static char *domain = (char *)NULL;
- static char ypbuf[YPMAXRECORD + 2];
-
- switch(af) {
- case AF_INET:
- break;
- default:
- case AF_INET6:
- errno = EAFNOSUPPORT;
- return NULL;
- }
-
- if (domain == (char *)NULL)
- if (yp_get_default_domain (&domain))
- return (NULL);
-
- if (yp_match(domain, map, name, strlen(name), &result, &resultlen))
- return (NULL);
-
- bcopy((char *)result, (char *)&ypbuf, resultlen);
- ypbuf[resultlen] = '\0';
- free(result);
- result = (char *)&ypbuf;
-
- if ((cp = index(result, '\n')))
- *cp = '\0';
-
- cp = strpbrk(result, " \t");
- *cp++ = '\0';
- h.n_name = result;
-
- while (*cp == ' ' || *cp == '\t')
- cp++;
-
- h.n_net = inet_network(cp);
- h.n_addrtype = AF_INET;
-
- q = h.n_aliases = host_aliases;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &host_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&h);
-#else
- return (NULL);
-#endif
-}
-
-struct netent *
-_getnetbynisname(name)
- const char *name;
-{
- return _getnetbynis(name, "networks.byname", AF_INET);
-}
-
-struct netent *
-_getnetbynisaddr(addr, af)
- unsigned long addr;
- int af;
-{
- char *str, *cp;
- unsigned long net2;
- int nn;
- unsigned int netbr[4];
- char buf[MAXDNAME];
-
- if (af != AF_INET) {
- errno = EAFNOSUPPORT;
- return (NULL);
- }
-
- for (nn = 4, net2 = addr; net2; net2 >>= 8) {
- netbr[--nn] = net2 & 0xff;
- }
-
- switch (nn) {
- case 3: /* Class A */
- sprintf(buf, "%u", netbr[3]);
- break;
- case 2: /* Class B */
- sprintf(buf, "%u.%u", netbr[2], netbr[3]);
- break;
- case 1: /* Class C */
- sprintf(buf, "%u.%u.%u", netbr[1], netbr[2], netbr[3]);
- break;
- case 0: /* Class D - E */
- sprintf(buf, "%u.%u.%u.%u", netbr[0], netbr[1],
- netbr[2], netbr[3]);
- break;
- }
-
- str = (char *)&buf;
- cp = str + (strlen(str) - 2);
-
- while(!strcmp(cp, ".0")) {
- *cp = '\0';
- cp = str + (strlen(str) - 2);
- }
-
- return _getnetbynis(str, "networks.byaddr", af);
-}
diff --git a/c/src/exec/libnetworking/libc/getnetent.3 b/c/src/exec/libnetworking/libc/getnetent.3
deleted file mode 100644
index aec93b5876..0000000000
--- a/c/src/exec/libnetworking/libc/getnetent.3
+++ /dev/null
@@ -1,159 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" @(#)getnetent.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt GETNETENT 3
-.Os BSD 4.2
-.Sh NAME
-.Nm getnetent ,
-.Nm getnetbyaddr ,
-.Nm getnetbyname ,
-.Nm setnetent ,
-.Nm endnetent
-.Nd get network entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Ft struct netent *
-.Fn getnetent void
-.Ft struct netent *
-.Fn getnetbyname "const char *name"
-.Ft struct netent *
-.Fn getnetbyaddr "unsigned long net" "int type"
-.Ft void
-.Fn setnetent "int stayopen"
-.Ft void
-.Fn endnetent void
-.Sh DESCRIPTION
-The
-.Fn getnetent ,
-.Fn getnetbyname ,
-and
-.Fn getnetbyaddr
-functions
-each return a pointer to an object with the
-following structure
-containing the broken-out
-fields of a line in the network data base,
-.Pa /etc/networks .
-.Bd -literal -offset indent
-struct netent {
- char *n_name; /* official name of net */
- char **n_aliases; /* alias list */
- int n_addrtype; /* net number type */
- unsigned long n_net; /* net number */
-};
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width n_addrtype
-.It Fa n_name
-The official name of the network.
-.It Fa n_aliases
-A zero terminated list of alternate names for the network.
-.It Fa n_addrtype
-The type of the network number returned; currently only AF_INET.
-.It Fa n_net
-The network number. Network numbers are returned in machine byte
-order.
-.El
-.Pp
-The
-.Fn getnetent
-function
-reads the next line of the file, opening the file if necessary.
-.Pp
-The
-.Fn setnetent
-function
-opens and rewinds the file. If the
-.Fa stayopen
-flag is non-zero,
-the net data base will not be closed after each call to
-.Fn getnetbyname
-or
-.Fn getnetbyaddr .
-.Pp
-The
-.Fn endnetent
-function
-closes the file.
-.Pp
-The
-.Fn getnetbyname
-function
-and
-.Fn getnetbyaddr
-sequentially search from the beginning
-of the file until a matching
-net name or
-net address and type is found,
-or until
-.Dv EOF
-is encountered. The
-.Fa type
-must be
-.Dv AF_INET .
-Network numbers are supplied in host order.
-.Sh FILES
-.Bl -tag -width /etc/networks -compact
-.It Pa /etc/networks
-.El
-.Sh DIAGNOSTICS
-Null pointer
-(0) returned on
-.Dv EOF
-or error.
-.Sh SEE ALSO
-.Xr networks 5
-.Pp
-.%T RFC 1101
-.Sh HISTORY
-The
-.Fn getnetent ,
-.Fn getnetbyaddr ,
-.Fn getnetbyname ,
-.Fn setnetent ,
-and
-.Fn endnetent
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-The data space used by
-these functions is static; if future use requires the data, it should be
-copied before any subsequent calls to these functions overwrite it.
-Only Internet network
-numbers are currently understood.
-Expecting network numbers to fit
-in no more than 32 bits is probably
-naive.
diff --git a/c/src/exec/libnetworking/libc/getnetnamadr.c b/c/src/exec/libnetworking/libc/getnetnamadr.c
deleted file mode 100644
index 4d6597f98c..0000000000
--- a/c/src/exec/libnetworking/libc/getnetnamadr.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-
-#ifndef _PATH_NETCONF
-#define _PATH_NETCONF "/etc/host.conf"
-#endif
-
-enum service_type {
- SERVICE_NONE = 0,
- SERVICE_BIND,
- SERVICE_TABLE,
- SERVICE_NIS };
-#define SERVICE_MAX SERVICE_NIS
-
-static struct {
- const char *name;
- enum service_type type;
-} service_names[] = {
- { "hosts", SERVICE_TABLE },
- { "/etc/hosts", SERVICE_TABLE },
- { "hosttable", SERVICE_TABLE },
- { "htable", SERVICE_TABLE },
- { "bind", SERVICE_BIND },
- { "dns", SERVICE_BIND },
- { "domain", SERVICE_BIND },
- { "yp", SERVICE_NIS },
- { "yellowpages", SERVICE_NIS },
- { "nis", SERVICE_NIS },
- { 0, SERVICE_NONE }
-};
-
-static enum service_type service_order[SERVICE_MAX + 1];
-static int service_done = 0;
-
-static enum service_type
-get_service_name(const char *name) {
- int i;
- for(i = 0; service_names[i].type != SERVICE_NONE; i++) {
- if(!strcasecmp(name, service_names[i].name)) {
- return service_names[i].type;
- }
- }
- return SERVICE_NONE;
-}
-
-static void
-init_services()
-{
- char *cp, *p, buf[BUFSIZ];
- register int cc = 0;
- FILE *fd;
-
- if ((fd = (FILE *)fopen(_PATH_NETCONF, "r")) == NULL) {
- /* make some assumptions */
- service_order[0] = SERVICE_TABLE;
- service_order[1] = SERVICE_NONE;
- } else {
- while (fgets(buf, BUFSIZ, fd) != NULL && cc < SERVICE_MAX) {
- if(buf[0] == '#')
- continue;
-
- p = buf;
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- if (cp == NULL)
- continue;
- do {
- if (isalpha(cp[0])) {
- service_order[cc] = get_service_name(cp);
- if(service_order[cc] != SERVICE_NONE)
- cc++;
- }
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- } while(cp != NULL && cc < SERVICE_MAX);
- }
- service_order[cc] = SERVICE_NONE;
- fclose(fd);
- }
- service_done = 1;
-}
-
-struct netent *
-getnetbyname(const char *name)
-{
- struct netent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return NULL;
- case SERVICE_TABLE:
- hp = _getnetbyhtname(name);
- break;
- case SERVICE_BIND:
- hp = _getnetbydnsname(name);
- break;
- case SERVICE_NIS:
- hp = _getnetbynisname(name);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-struct netent *
-getnetbyaddr(addr, af)
- u_long addr;
- int af;
-{
- struct netent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return 0;
- case SERVICE_TABLE:
- hp = _getnetbyhtaddr(addr, af);
- break;
- case SERVICE_BIND:
- hp = _getnetbydnsaddr(addr, af);
- break;
- case SERVICE_NIS:
- hp = _getnetbynisaddr(addr, af);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-void
-setnetent(stayopen)
- int stayopen;
-{
- _setnethtent(stayopen);
- _setnetdnsent(stayopen);
-}
-
-void
-endnetent()
-{
- _endnethtent();
- _endnetdnsent();
-}
diff --git a/c/src/exec/libnetworking/libc/getproto.c b/c/src/exec/libnetworking/libc/getproto.c
deleted file mode 100644
index c2a653f4b4..0000000000
--- a/c/src/exec/libnetworking/libc/getproto.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getproto.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-
-extern int _proto_stayopen;
-
-struct protoent *
-getprotobynumber(proto)
- register int proto;
-{
- register struct protoent *p;
-
- setprotoent(_proto_stayopen);
- while ( (p = getprotoent()) )
- if (p->p_proto == proto)
- break;
- if (!_proto_stayopen)
- endprotoent();
- return (p);
-}
diff --git a/c/src/exec/libnetworking/libc/getprotoent.3 b/c/src/exec/libnetworking/libc/getprotoent.3
deleted file mode 100644
index 784461d7e3..0000000000
--- a/c/src/exec/libnetworking/libc/getprotoent.3
+++ /dev/null
@@ -1,147 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" @(#)getprotoent.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt GETPROTOENT 3
-.Os BSD 4.2
-.Sh NAME
-.Nm getprotoent ,
-.Nm getprotobynumber ,
-.Nm getprotobyname ,
-.Nm setprotoent ,
-.Nm endprotoent
-.Nd get protocol entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Ft struct protoent *
-.Fn getprotoent void
-.Ft struct protoent *
-.Fn getprotobyname "const char *name"
-.Ft struct protoent *
-.Fn getprotobynumber "int proto"
-.Ft void
-.Fn setprotoent "int stayopen"
-.Ft void
-.Fn endprotoent void
-.Sh DESCRIPTION
-The
-.Fn getprotoent ,
-.Fn getprotobyname ,
-and
-.Fn getprotobynumber
-functions
-each return a pointer to an object with the
-following structure
-containing the broken-out
-fields of a line in the network protocol data base,
-.Pa /etc/protocols .
-.Bd -literal -offset indent
-.Pp
-struct protoent {
- char *p_name; /* official name of protocol */
- char **p_aliases; /* alias list */
- int p_proto; /* protocol number */
-};
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width p_aliases
-.It Fa p_name
-The official name of the protocol.
-.It Fa p_aliases
-A zero terminated list of alternate names for the protocol.
-.It Fa p_proto
-The protocol number.
-.El
-.Pp
-The
-.Fn getprotoent
-function
-reads the next line of the file, opening the file if necessary.
-.Pp
-The
-.Fn setprotoent
-function
-opens and rewinds the file. If the
-.Fa stayopen
-flag is non-zero,
-the net data base will not be closed after each call to
-.Fn getprotobyname
-or
-.Fn getprotobynumber .
-.Pp
-The
-.Fn endprotoent
-function
-closes the file.
-.Pp
-The
-.Fn getprotobyname
-function
-and
-.Fn getprotobynumber
-sequentially search from the beginning
-of the file until a matching
-protocol name or
-protocol number is found,
-or until
-.Dv EOF
-is encountered.
-.Sh RETURN VALUES
-Null pointer
-(0) returned on
-.Dv EOF
-or error.
-.Sh FILES
-.Bl -tag -width /etc/protocols -compact
-.It Pa /etc/protocols
-.El
-.Sh SEE ALSO
-.Xr protocols 5
-.Sh HISTORY
-The
-.Fn getprotoent ,
-.Fn getprotobynumber ,
-.Fn getprotobyname ,
-.Fn setprotoent ,
-and
-.Fn endprotoent
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-These functions use a static data space;
-if the data is needed for future use, it should be
-copied before any subsequent calls overwrite it.
-Only the Internet
-protocols are currently understood.
diff --git a/c/src/exec/libnetworking/libc/getprotoent.c b/c/src/exec/libnetworking/libc/getprotoent.c
deleted file mode 100644
index 0b9cefec68..0000000000
--- a/c/src/exec/libnetworking/libc/getprotoent.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getprotoent.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define MAXALIASES 35
-
-static FILE *protof = NULL;
-static char line[BUFSIZ+1];
-static struct protoent proto;
-static char *proto_aliases[MAXALIASES];
-int _proto_stayopen;
-
-void
-setprotoent(f)
- int f;
-{
- if (protof == NULL)
- protof = fopen(_PATH_PROTOCOLS, "r" );
- else
- rewind(protof);
- _proto_stayopen |= f;
-}
-
-void
-endprotoent()
-{
- if (protof) {
- fclose(protof);
- protof = NULL;
- }
- _proto_stayopen = 0;
-}
-
-struct protoent *
-getprotoent()
-{
- char *p;
- register char *cp, **q;
-
- if (protof == NULL && (protof = fopen(_PATH_PROTOCOLS, "r" )) == NULL)
- return (NULL);
-again:
- if ((p = fgets(line, BUFSIZ, protof)) == NULL)
- return (NULL);
- if (*p == '#')
- goto again;
- cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
- proto.p_name = p;
- cp = strpbrk(p, " \t");
- if (cp == NULL)
- goto again;
- *cp++ = '\0';
- while (*cp == ' ' || *cp == '\t')
- cp++;
- p = strpbrk(cp, " \t");
- if (p != NULL)
- *p++ = '\0';
- proto.p_proto = atoi(cp);
- q = proto.p_aliases = proto_aliases;
- if (p != NULL) {
- cp = p;
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &proto_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- }
- *q = NULL;
- return (&proto);
-}
diff --git a/c/src/exec/libnetworking/libc/getprotoname.c b/c/src/exec/libnetworking/libc/getprotoname.c
deleted file mode 100644
index 46880eb005..0000000000
--- a/c/src/exec/libnetworking/libc/getprotoname.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getprotoname.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-#include <string.h>
-
-extern int _proto_stayopen;
-
-struct protoent *
-getprotobyname(name)
- register const char *name;
-{
- register struct protoent *p;
- register char **cp;
-
- setprotoent(_proto_stayopen);
- while ( (p = getprotoent()) ) {
- if (strcmp(p->p_name, name) == 0)
- break;
- for (cp = p->p_aliases; *cp != 0; cp++)
- if (strcmp(*cp, name) == 0)
- goto found;
- }
-found:
- if (!_proto_stayopen)
- endprotoent();
- return (p);
-}
diff --git a/c/src/exec/libnetworking/libc/getservbyname.c b/c/src/exec/libnetworking/libc/getservbyname.c
deleted file mode 100644
index 19936907d3..0000000000
--- a/c/src/exec/libnetworking/libc/getservbyname.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getservbyname.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-#include <string.h>
-
-extern int _serv_stayopen;
-
-struct servent *
-getservbyname(name, proto)
- const char *name, *proto;
-{
- register struct servent *p;
- register char **cp;
-
-#ifdef YP
- extern char *___getservbyname_yp;
- extern char *___getservbyproto_yp;
-
- ___getservbyname_yp = (char *)name;
- ___getservbyproto_yp = (char *)proto;
-#endif
-
- setservent(_serv_stayopen);
- while ( (p = getservent()) ) {
- if (strcmp(name, p->s_name) == 0)
- goto gotname;
- for (cp = p->s_aliases; *cp; cp++)
- if (strcmp(name, *cp) == 0)
- goto gotname;
- continue;
-gotname:
- if (proto == 0 || strcmp(p->s_proto, proto) == 0)
- break;
- }
- if (!_serv_stayopen)
- endservent();
-
-#ifdef YP
- ___getservbyname_yp = NULL;
- ___getservbyproto_yp = NULL;
-#endif
-
- return (p);
-}
diff --git a/c/src/exec/libnetworking/libc/getservbyport.c b/c/src/exec/libnetworking/libc/getservbyport.c
deleted file mode 100644
index c8433954e1..0000000000
--- a/c/src/exec/libnetworking/libc/getservbyport.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getservbyport.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-#include <string.h>
-
-extern int _serv_stayopen;
-
-struct servent *
-getservbyport(port, proto)
- int port;
- const char *proto;
-{
- register struct servent *p;
-
-#ifdef YP
- extern int ___getservbyport_yp;
- extern char *___getservbyproto_yp;
-
- ___getservbyport_yp = port;
- ___getservbyproto_yp = (char *)proto;
-#endif
-
- setservent(_serv_stayopen);
- while ( (p = getservent()) ) {
- if (p->s_port != port)
- continue;
- if (proto == 0 || strcmp(p->s_proto, proto) == 0)
- break;
- }
- if (!_serv_stayopen)
- endservent();
-
-#ifdef YP
- ___getservbyport_yp = 0;
- ___getservbyproto_yp = NULL;
-#endif
-
- return (p);
-}
diff --git a/c/src/exec/libnetworking/libc/getservent.3 b/c/src/exec/libnetworking/libc/getservent.3
deleted file mode 100644
index 79c18a3beb..0000000000
--- a/c/src/exec/libnetworking/libc/getservent.3
+++ /dev/null
@@ -1,156 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" From: @(#)getservent.3 8.3 (Berkeley) 1/12/94
-.\" $Id$
-.\"
-.Dd July 9, 1995
-.Dt GETSERVENT 3
-.Os BSD 4.2
-.Sh NAME
-.Nm getservent ,
-.Nm getservbyport ,
-.Nm getservbyname ,
-.Nm setservent ,
-.Nm endservent
-.Nd get service entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Ft struct servent *
-.Fn getservent
-.Ft struct servent *
-.Fn getservbyname "const char *name" "const char *proto"
-.Ft struct servent *
-.Fn getservbyport "int port" "const char *proto"
-.Ft void
-.Fn setservent "int stayopen"
-.Ft void
-.Fn endservent void
-.Sh DESCRIPTION
-The
-.Fn getservent ,
-.Fn getservbyname ,
-and
-.Fn getservbyport
-functions
-each return a pointer to an object with the
-following structure
-containing the broken-out
-fields of a line in the network services data base,
-.Pa /etc/services .
-.Bd -literal -offset indent
-struct servent {
- char *s_name; /* official name of service */
- char **s_aliases; /* alias list */
- int s_port; /* port service resides at */
- char *s_proto; /* protocol to use */
-};
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width s_aliases
-.It Fa s_name
-The official name of the service.
-.It Fa s_aliases
-A zero terminated list of alternate names for the service.
-.It Fa s_port
-The port number at which the service resides.
-Port numbers are returned in network byte order.
-.It Fa s_proto
-The name of the protocol to use when contacting the
-service.
-.El
-.Pp
-The
-.Fn getservent
-function
-reads the next line of the file, opening the file if necessary.
-.Pp
-The
-.Fn setservent
-function
-opens and rewinds the file. If the
-.Fa stayopen
-flag is non-zero,
-the net data base will not be closed after each call to
-.Fn getservbyname
-or
-.Fn getservbyport .
-.Pp
-The
-.Fn endservent
-function
-closes the file.
-.Pp
-The
-.Fn getservbyname
-and
-.Fn getservbyport
-functions
-sequentially search from the beginning
-of the file until a matching
-protocol name or
-port number is found,
-or until
-.Dv EOF
-is encountered.
-If a protocol name is also supplied (non-
-.Dv NULL ) ,
-searches must also match the protocol.
-.ne 1i
-.Sh FILES
-.Bl -tag -width /etc/services -compact
-.It Pa /etc/services
-.El
-.Sh DIAGNOSTICS
-Null pointer
-(0) returned on
-.Dv EOF
-or error.
-.Sh SEE ALSO
-.Xr getprotoent 3 ,
-.Xr services 5
-.Sh HISTORY
-The
-.Fn getservent ,
-.Fn getservbyport ,
-.Fn getservbyname ,
-.Fn setservent ,
-and
-.Fn endservent
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-These functions use static data storage;
-if the data is needed for future use, it should be
-copied before any subsequent calls overwrite it.
-Expecting port numbers to fit in a 32 bit
-quantity is probably naive.
diff --git a/c/src/exec/libnetworking/libc/getservent.c b/c/src/exec/libnetworking/libc/getservent.c
deleted file mode 100644
index 08a05c0975..0000000000
--- a/c/src/exec/libnetworking/libc/getservent.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-static int serv_stepping_yp = 0;
-extern int _yp_check __P(( char ** ));
-#endif
-
-
-#define MAXALIASES 35
-
-static FILE *servf = NULL;
-static char line[BUFSIZ+1];
-static struct servent serv;
-static char *serv_aliases[MAXALIASES];
-int _serv_stayopen;
-
-#ifdef YP
-char *___getservbyname_yp = NULL;
-char *___getservbyproto_yp = NULL;
-int ___getservbyport_yp = 0;
-static char *yp_domain = NULL;
-
-static int
-_getservbyport_yp(line)
- char *line;
-{
- char *result;
- int resultlen;
- char buf[YPMAXRECORD + 2];
- int rv;
-
- snprintf(buf, sizeof(buf), "%d/%s", ntohs(___getservbyport_yp),
- ___getservbyproto_yp);
-
- ___getservbyport_yp = 0;
- ___getservbyproto_yp = NULL;
-
- if(!yp_domain) {
- if(yp_get_default_domain(&yp_domain))
- return (0);
- }
-
- /*
- * We have to be a little flexible here. Ideally you're supposed
- * to have both a services.byname and a services.byport map, but
- * some systems have only services.byname. FreeBSD cheats a little
- * by putting the services.byport information in the same map as
- * services.byname so that either case will work. We allow for both
- * possibilities here: if there is no services.byport map, we try
- * services.byname instead.
- */
- if ((rv = yp_match(yp_domain, "services.byport", buf, strlen(buf),
- &result, &resultlen))) {
- if (rv == YPERR_MAP) {
- if (yp_match(yp_domain, "services.byname", buf,
- strlen(buf), &result, &resultlen))
- return(0);
- } else
- return(0);
- }
-
- /* getservent() expects lines terminated with \n -- make it happy */
- snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
-
- free(result);
- return(1);
-}
-
-static int
-_getservbyname_yp(line)
- char *line;
-{
- char *result;
- int resultlen;
- char buf[YPMAXRECORD + 2];
-
- if(!yp_domain) {
- if(yp_get_default_domain(&yp_domain))
- return (0);
- }
-
- snprintf(buf, sizeof(buf), "%s/%s", ___getservbyname_yp,
- ___getservbyproto_yp);
-
- ___getservbyname_yp = 0;
- ___getservbyproto_yp = NULL;
-
- if (yp_match(yp_domain, "services.byname", buf, strlen(buf),
- &result, &resultlen)) {
- return(0);
- }
-
- /* getservent() expects lines terminated with \n -- make it happy */
- snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
-
- free(result);
- return(1);
-}
-
-static int
-_getservent_yp(line)
- char *line;
-{
- static char *key = NULL;
- static int keylen;
- char *lastkey, *result;
- int resultlen;
- int rv;
-
- if(!yp_domain) {
- if(yp_get_default_domain(&yp_domain))
- return (0);
- }
-
- if (!serv_stepping_yp) {
- if (key)
- free(key);
- if ((rv = yp_first(yp_domain, "services.byname", &key, &keylen,
- &result, &resultlen))) {
- serv_stepping_yp = 0;
- return(0);
- }
- serv_stepping_yp = 1;
- } else {
- lastkey = key;
- rv = yp_next(yp_domain, "services.byname", key, keylen, &key,
- &keylen, &result, &resultlen);
- free(lastkey);
- if (rv) {
- serv_stepping_yp = 0;
- return (0);
- }
- }
-
- /* getservent() expects lines terminated with \n -- make it happy */
- snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
-
- free(result);
-
- return(1);
-}
-#endif
-
-void
-setservent(f)
- int f;
-{
- if (servf == NULL)
- servf = fopen(_PATH_SERVICES, "r" );
- else
- rewind(servf);
- _serv_stayopen |= f;
-}
-
-void
-endservent()
-{
- if (servf) {
- fclose(servf);
- servf = NULL;
- }
- _serv_stayopen = 0;
-}
-
-struct servent *
-getservent()
-{
- char *p;
- register char *cp, **q;
-
-#ifdef YP
- if (serv_stepping_yp && _getservent_yp(line)) {
- p = (char *)&line;
- goto unpack;
- }
-tryagain:
-#endif
- if (servf == NULL && (servf = fopen(_PATH_SERVICES, "r" )) == NULL)
- return (NULL);
-again:
- if ((p = fgets(line, BUFSIZ, servf)) == NULL)
- return (NULL);
-#ifdef YP
- if (*p == '+' && _yp_check(NULL)) {
- if (___getservbyname_yp != NULL) {
- if (!_getservbyname_yp(line))
- goto tryagain;
- }
- else if (___getservbyport_yp != 0) {
- if (!_getservbyport_yp(line))
- goto tryagain;
- }
- else if (!_getservent_yp(line))
- goto tryagain;
- }
-unpack:
-#endif
- if (*p == '#')
- goto again;
- cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
- serv.s_name = p;
- p = strpbrk(p, " \t");
- if (p == NULL)
- goto again;
- *p++ = '\0';
- while (*p == ' ' || *p == '\t')
- p++;
- cp = strpbrk(p, ",/");
- if (cp == NULL)
- goto again;
- *cp++ = '\0';
- serv.s_port = htons((u_short)atoi(p));
- serv.s_proto = cp;
- q = serv.s_aliases = serv_aliases;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &serv_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&serv);
-}
diff --git a/c/src/exec/libnetworking/libc/herror.c b/c/src/exec/libnetworking/libc/herror.c
deleted file mode 100644
index ba1dae934d..0000000000
--- a/c/src/exec/libnetworking/libc/herror.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 1987, 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.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <netdb.h>
-#include <string.h>
-#include <unistd.h>
-
-const char *h_errlist[] = {
- "Resolver Error 0 (no error)",
- "Unknown host", /* 1 HOST_NOT_FOUND */
- "Host name lookup failure", /* 2 TRY_AGAIN */
- "Unknown server error", /* 3 NO_RECOVERY */
- "No address associated with name", /* 4 NO_ADDRESS */
-};
-int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] };
-
-int h_errno;
-
-/*
- * herror --
- * print the error indicated by the h_errno value.
- */
-void
-herror(s)
- const char *s;
-{
-#if 0
- struct iovec iov[4];
- register struct iovec *v = iov;
-
- if (s && *s) {
- v->iov_base = (char *)s;
- v->iov_len = strlen(s);
- v++;
- v->iov_base = ": ";
- v->iov_len = 2;
- v++;
- }
- v->iov_base = (char *)hstrerror(h_errno);
- v->iov_len = strlen(v->iov_base);
- v++;
- v->iov_base = "\n";
- v->iov_len = 1;
- writev(STDERR_FILENO, iov, (v - iov) + 1);
-#else
- /*
- * RTEMS: no writev yet
- */
- if (s && *s) {
- write (2, s, strlen (s));
- write (2, ": ", 2);
- }
- s = (char *)hstrerror(h_errno);
- write (2, s, strlen (s));
- write (2, "\n", 1);
-#endif
-}
-
-const char *
-hstrerror(err)
- int err;
-{
- if (err < 0)
- return ("Resolver internal error");
- else if (err < h_nerr)
- return (h_errlist[err]);
- return ("Unknown resolver error");
-}
diff --git a/c/src/exec/libnetworking/libc/inet.3 b/c/src/exec/libnetworking/libc/inet.3
deleted file mode 100644
index 1052f538f2..0000000000
--- a/c/src/exec/libnetworking/libc/inet.3
+++ /dev/null
@@ -1,210 +0,0 @@
-.\" Copyright (c) 1983, 1990, 1991, 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.
-.\"
-.\" From: @(#)inet.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 17, 1996
-.Dt INET 3
-.Os BSD 4.2
-.Sh NAME
-.Nm inet_aton ,
-.Nm inet_addr ,
-.Nm inet_network ,
-.Nm inet_ntoa ,
-.Nm inet_makeaddr ,
-.Nm inet_lnaof ,
-.Nm inet_netof
-.Nd Internet address manipulation routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/socket.h>
-.Fd #include <netinet/in.h>
-.Fd #include <arpa/inet.h>
-.Ft int
-.Fn inet_aton "const char *cp" "struct in_addr *pin"
-.Ft unsigned long
-.Fn inet_addr "const char *cp"
-.Ft unsigned long
-.Fn inet_network "const char *cp"
-.Ft char *
-.Fn inet_ntoa "struct in_addr in"
-.Ft struct in_addr
-.Fn inet_makeaddr "unsigned long net" "unsigned long lna"
-.Ft unsigned long
-.Fn inet_lnaof "struct in_addr in"
-.Ft unsigned long
-.Fn inet_netof "struct in_addr in"
-.Sh DESCRIPTION
-The routines
-.Fn inet_aton ,
-.Fn inet_addr
-and
-.Fn inet_network
-interpret character strings representing
-numbers expressed in the Internet standard
-.Ql \&.
-notation.
-The
-.Fn inet_aton
-routine interprets the specified character string as an Internet address,
-placing the address into the structure provided.
-It returns 1 if the string was successfully interpreted,
-or 0 if the string is invalid.
-The
-.Fn inet_addr
-and
-.Fn inet_network
-functions return numbers suitable for use
-as Internet addresses and Internet network
-numbers, respectively.
-The routine
-.Fn inet_ntoa
-takes an Internet address and returns an
-.Tn ASCII
-string representing the address in
-.Ql \&.
-notation. The routine
-.Fn inet_makeaddr
-takes an Internet network number and a local
-network address and constructs an Internet address
-from it. The routines
-.Fn inet_netof
-and
-.Fn inet_lnaof
-break apart Internet host addresses, returning
-the network number and local network address part,
-respectively.
-.Pp
-All Internet addresses are returned in network
-order (bytes ordered from left to right).
-All network numbers and local address parts are
-returned as machine format integer values.
-.Sh INTERNET ADDRESSES
-Values specified using the
-.Ql \&.
-notation take one
-of the following forms:
-.Bd -literal -offset indent
-a.b.c.d
-a.b.c
-a.b
-a
-.Ed
-.Pp
-When four parts are specified, each is interpreted
-as a byte of data and assigned, from left to right,
-to the four bytes of an Internet address. Note
-that when an Internet address is viewed as a 32-bit
-integer quantity on the
-.Tn VAX
-the bytes referred to
-above appear as
-.Dq Li d.c.b.a .
-That is,
-.Tn VAX
-bytes are
-ordered from right to left.
-.Pp
-When a three part address is specified, the last
-part is interpreted as a 16-bit quantity and placed
-in the right-most two bytes of the network address.
-This makes the three part address format convenient
-for specifying Class B network addresses as
-.Dq Li 128.net.host .
-.Pp
-When a two part address is supplied, the last part
-is interpreted as a 24-bit quantity and placed in
-the right most three bytes of the network address.
-This makes the two part address format convenient
-for specifying Class A network addresses as
-.Dq Li net.host .
-.Pp
-When only one part is given, the value is stored
-directly in the network address without any byte
-rearrangement.
-.Pp
-All numbers supplied as
-.Dq parts
-in a
-.Ql \&.
-notation
-may be decimal, octal, or hexadecimal, as specified
-in the C language (i.e., a leading 0x or 0X implies
-hexadecimal; otherwise, a leading 0 implies octal;
-otherwise, the number is interpreted as decimal).
-.Pp
-The
-.Fn inet_aton
-and
-.Fn inet_ntoa
-functions are semi-deprecated in favor of the
-.Xr addr2ascii 3
-family. However, since those functions are not yet widely implemented,
-portable programs cannot rely on their presence and will continue
-to use the
-.Xr inet 3
-functions for some time.
-.Sh DIAGNOSTICS
-The constant
-.Dv INADDR_NONE
-is returned by
-.Fn inet_addr
-and
-.Fn inet_network
-for malformed requests.
-.Sh SEE ALSO
-.Xr addr2ascii 3 ,
-.Xr gethostbyname 3 ,
-.Xr getnetent 3 ,
-.Xr hosts 5 ,
-.Xr networks 5
-.Sh HISTORY
-These
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-The value
-.Dv INADDR_NONE
-(0xffffffff) is a valid broadcast address, but
-.Fn inet_addr
-cannot return that value without indicating failure.
-The newer
-.Fn inet_aton
-function does not share this problem.
-The problem of host byte ordering versus network byte ordering is
-confusing.
-The string returned by
-.Fn inet_ntoa
-resides in a static memory area.
-.Pp
-Inet_addr should return a
-.Fa struct in_addr .
diff --git a/c/src/exec/libnetworking/libc/inet_addr.c b/c/src/exec/libnetworking/libc/inet_addr.c
deleted file mode 100644
index 225ccc1269..0000000000
--- a/c/src/exec/libnetworking/libc/inet_addr.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * ++Copyright++ 1983, 1990, 1993
- * -
- * Copyright (c) 1983, 1990, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <ctype.h>
-
-/*
- * Ascii internet address interpretation routine.
- * The value returned is in network order.
- */
-u_long
-inet_addr(cp)
- register const char *cp;
-{
- struct in_addr val;
-
- if (inet_aton(cp, &val))
- return (val.s_addr);
- return (INADDR_NONE);
-}
-
-/*
- * Check whether "cp" is a valid ascii representation
- * of an Internet address and convert to a binary address.
- * Returns 1 if the address is valid, 0 if not.
- * This replaces inet_addr, the return value from which
- * cannot distinguish between failure and a local broadcast address.
- */
-int
-inet_aton(cp, addr)
- register const char *cp;
- struct in_addr *addr;
-{
- register u_long val;
- register int base, n;
- register char c;
- u_int parts[4];
- register u_int *pp = parts;
-
- c = *cp;
- for (;;) {
- /*
- * Collect number up to ``.''.
- * Values are specified as for C:
- * 0x=hex, 0=octal, isdigit=decimal.
- */
- if (!isdigit((int)c))
- return (0);
- val = 0; base = 10;
- if (c == '0') {
- c = *++cp;
- if (c == 'x' || c == 'X')
- base = 16, c = *++cp;
- else
- base = 8;
- }
- for (;;) {
- if (isascii((int)c) && isdigit((int)c)) {
- val = (val * base) + (c - '0');
- c = *++cp;
- } else if (base == 16 && isascii((int)c) && isxdigit((int)c)) {
- val = (val << 4) |
- (c + 10 - (islower((int)c) ? 'a' : 'A'));
- c = *++cp;
- } else
- break;
- }
- if (c == '.') {
- /*
- * Internet format:
- * a.b.c.d
- * a.b.c (with c treated as 16 bits)
- * a.b (with b treated as 24 bits)
- */
- if (pp >= parts + 3)
- return (0);
- *pp++ = val;
- c = *++cp;
- } else
- break;
- }
- /*
- * Check for trailing characters.
- */
- if (c != '\0' && (!isascii((int)c) || !isspace((int)c)))
- return (0);
- /*
- * Concoct the address according to
- * the number of parts specified.
- */
- n = pp - parts + 1;
- switch (n) {
-
- case 0:
- return (0); /* initial nondigit */
-
- case 1: /* a -- 32 bits */
- break;
-
- case 2: /* a.b -- 8.24 bits */
- if (val > 0xffffff)
- return (0);
- val |= parts[0] << 24;
- break;
-
- case 3: /* a.b.c -- 8.8.16 bits */
- if (val > 0xffff)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16);
- break;
-
- case 4: /* a.b.c.d -- 8.8.8.8 bits */
- if (val > 0xff)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
- break;
- }
- if (addr)
- addr->s_addr = htonl(val);
- return (1);
-}
diff --git a/c/src/exec/libnetworking/libc/inet_lnaof.c b/c/src/exec/libnetworking/libc/inet_lnaof.c
deleted file mode 100644
index 6ec6a9aef1..0000000000
--- a/c/src/exec/libnetworking/libc/inet_lnaof.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_lnaof.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Return the local network address portion of an
- * internet address; handles class a/b/c network
- * number formats.
- */
-u_long
-inet_lnaof(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return ((i)&IN_CLASSA_HOST);
- else if (IN_CLASSB(i))
- return ((i)&IN_CLASSB_HOST);
- else
- return ((i)&IN_CLASSC_HOST);
-}
diff --git a/c/src/exec/libnetworking/libc/inet_makeaddr.c b/c/src/exec/libnetworking/libc/inet_makeaddr.c
deleted file mode 100644
index ce84170ed9..0000000000
--- a/c/src/exec/libnetworking/libc/inet_makeaddr.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_makeaddr.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Formulate an Internet address from network + host. Used in
- * building addresses stored in the ifnet structure.
- */
-struct in_addr
-inet_makeaddr(net, host)
- u_long net, host;
-{
- u_long addr;
-
- if (net < 128)
- addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
- else if (net < 65536)
- addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
- else if (net < 16777216L)
- addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
- else
- addr = net | host;
- addr = htonl(addr);
- return (*(struct in_addr *)&addr);
-}
diff --git a/c/src/exec/libnetworking/libc/inet_net_ntop.c b/c/src/exec/libnetworking/libc/inet_net_ntop.c
deleted file mode 100644
index 4c7893d417..0000000000
--- a/c/src/exec/libnetworking/libc/inet_net_ntop.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char orig_rcsid[] = "From Id: inet_net_ntop.c,v 8.2 1996/08/08 06:54:44 vixie Exp";
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-static char * inet_net_ntop_ipv4 __P((const u_char *src, int bits,
- char *dst, size_t size));
-
-/*
- * char *
- * inet_net_ntop(af, src, bits, dst, size)
- * convert network number from network to presentation format.
- * generates CIDR style result always.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * author:
- * Paul Vixie (ISC), July 1996
- */
-char *
-inet_net_ntop(af, src, bits, dst, size)
- int af;
- const void *src;
- int bits;
- char *dst;
- size_t size;
-{
- switch (af) {
- case AF_INET:
- return (inet_net_ntop_ipv4(src, bits, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (NULL);
- }
-}
-
-/*
- * static char *
- * inet_net_ntop_ipv4(src, bits, dst, size)
- * convert IPv4 network number from network to presentation format.
- * generates CIDR style result always.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * note:
- * network byte order assumed. this means 192.5.5.240/28 has
- * 0x11110000 in its fourth octet.
- * author:
- * Paul Vixie (ISC), July 1996
- */
-static char *
-inet_net_ntop_ipv4(src, bits, dst, size)
- const u_char *src;
- int bits;
- char *dst;
- size_t size;
-{
- char *odst = dst;
- char *t;
- u_int m;
- int b;
-
- if (bits < 0 || bits > 32) {
- errno = EINVAL;
- return (NULL);
- }
- if (bits == 0) {
- if (size < sizeof "0")
- goto emsgsize;
- *dst++ = '0';
- *dst = '\0';
- }
-
- /* Format whole octets. */
- for (b = bits / 8; b > 0; b--) {
- if (size < sizeof "255.")
- goto emsgsize;
- t = dst;
- dst += SPRINTF((dst, "%u", *src++));
- if (b > 1) {
- *dst++ = '.';
- *dst = '\0';
- }
- size -= (size_t)(dst - t);
- }
-
- /* Format partial octet. */
- b = bits % 8;
- if (b > 0) {
- if (size < sizeof ".255")
- goto emsgsize;
- t = dst;
- if (dst != odst)
- *dst++ = '.';
- m = ((1 << b) - 1) << (8 - b);
- dst += SPRINTF((dst, "%u", *src & m));
- size -= (size_t)(dst - t);
- }
-
- /* Format CIDR /width. */
- if (size < sizeof "/32")
- goto emsgsize;
- dst += SPRINTF((dst, "/%u", bits));
- return (odst);
-
- emsgsize:
- errno = EMSGSIZE;
- return (NULL);
-}
diff --git a/c/src/exec/libnetworking/libc/inet_net_pton.c b/c/src/exec/libnetworking/libc/inet_net_pton.c
deleted file mode 100644
index 8915c2a5be..0000000000
--- a/c/src/exec/libnetworking/libc/inet_net_pton.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char orig_rcsid[] = "From Id: inet_net_pton.c,v 1.8 1996/11/21 10:28:12 vixie Exp $";
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-static int inet_net_pton_ipv4 __P((const char *src, u_char *dst,
- size_t size));
-
-/*
- * static int
- * inet_net_pton(af, src, dst, size)
- * convert network number from presentation to network format.
- * accepts hex octets, hex strings, decimal octets, and /CIDR.
- * "size" is in bytes and describes "dst".
- * return:
- * number of bits, either imputed classfully or specified with /CIDR,
- * or -1 if some failure occurred (check errno). ENOENT means it was
- * not a valid network specification.
- * author:
- * Paul Vixie (ISC), June 1996
- */
-int
-inet_net_pton(af, src, dst, size)
- int af;
- const char *src;
- void *dst;
- size_t size;
-{
- switch (af) {
- case AF_INET:
- return (inet_net_pton_ipv4(src, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (-1);
- }
-}
-
-/*
- * static int
- * inet_net_pton_ipv4(src, dst, size)
- * convert IPv4 network number from presentation to network format.
- * accepts hex octets, hex strings, decimal octets, and /CIDR.
- * "size" is in bytes and describes "dst".
- * return:
- * number of bits, either imputed classfully or specified with /CIDR,
- * or -1 if some failure occurred (check errno). ENOENT means it was
- * not an IPv4 network specification.
- * note:
- * network byte order assumed. this means 192.5.5.240/28 has
- * 0x11110000 in its fourth octet.
- * author:
- * Paul Vixie (ISC), June 1996
- */
-static int
-inet_net_pton_ipv4(src, dst, size)
- const char *src;
- u_char *dst;
- size_t size;
-{
- static const char
- xdigits[] = "0123456789abcdef",
- digits[] = "0123456789";
- int n, ch, tmp, dirty, bits;
- const u_char *odst = dst;
-
- ch = *src++;
- if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
- && isascii(src[1]) && isxdigit(src[1])) {
- /* Hexadecimal: Eat nybble string. */
- if (size <= 0)
- goto emsgsize;
- *dst = 0, dirty = 0;
- src++; /* skip x or X. */
- while ((ch = *src++) != '\0' &&
- isascii(ch) && isxdigit(ch)) {
- if (isupper(ch))
- ch = tolower(ch);
- n = strchr(xdigits, ch) - xdigits;
- assert(n >= 0 && n <= 15);
- *dst |= n;
- if (!dirty++)
- *dst <<= 4;
- else if (size-- > 0)
- *++dst = 0, dirty = 0;
- else
- goto emsgsize;
- }
- if (dirty)
- size--;
- } else if (isascii(ch) && isdigit(ch)) {
- /* Decimal: eat dotted digit string. */
- for (;;) {
- tmp = 0;
- do {
- n = strchr(digits, ch) - digits;
- assert(n >= 0 && n <= 9);
- tmp *= 10;
- tmp += n;
- if (tmp > 255)
- goto enoent;
- } while ((ch = *src++) != '\0' &&
- isascii(ch) && isdigit(ch));
- if (size-- <= 0)
- goto emsgsize;
- *dst++ = (u_char) tmp;
- if (ch == '\0' || ch == '/')
- break;
- if (ch != '.')
- goto enoent;
- ch = *src++;
- if (!isascii(ch) || !isdigit(ch))
- goto enoent;
- }
- } else
- goto enoent;
-
- bits = -1;
- if (ch == '/' && isascii(src[0]) && isdigit(src[0]) && dst > odst) {
- /* CIDR width specifier. Nothing can follow it. */
- ch = *src++; /* Skip over the /. */
- bits = 0;
- do {
- n = strchr(digits, ch) - digits;
- assert(n >= 0 && n <= 9);
- bits *= 10;
- bits += n;
- } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
- if (ch != '\0')
- goto enoent;
- if (bits > 32)
- goto emsgsize;
- }
-
- /* Firey death and destruction unless we prefetched EOS. */
- if (ch != '\0')
- goto enoent;
-
- /* If nothing was written to the destination, we found no address. */
- if (dst == odst)
- goto enoent;
- /* If no CIDR spec was given, infer width from net class. */
- if (bits == -1) {
- if (*odst >= 240) /* Class E */
- bits = 32;
- else if (*odst >= 224) /* Class D */
- bits = 4;
- else if (*odst >= 192) /* Class C */
- bits = 24;
- else if (*odst >= 128) /* Class B */
- bits = 16;
- else /* Class A */
- bits = 8;
- /* If imputed mask is narrower than specified octets, widen. */
- if (bits >= 8 && bits < ((dst - odst) * 8))
- bits = (dst - odst) * 8;
- }
- /* Extend network to cover the actual mask. */
- while (bits > ((dst - odst) * 8)) {
- if (size-- <= 0)
- goto emsgsize;
- *dst++ = '\0';
- }
- return (bits);
-
- enoent:
- errno = ENOENT;
- return (-1);
-
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
diff --git a/c/src/exec/libnetworking/libc/inet_neta.c b/c/src/exec/libnetworking/libc/inet_neta.c
deleted file mode 100644
index 59b156f7f6..0000000000
--- a/c/src/exec/libnetworking/libc/inet_neta.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char orig_rcsid[] = "From Id: inet_neta.c,v 8.2 1996/08/08 06:54:44 vixie Exp";
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-/*
- * char *
- * inet_neta(src, dst, size)
- * format a u_long network number into presentation format.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * note:
- * format of ``src'' is as for inet_network().
- * author:
- * Paul Vixie (ISC), July 1996
- */
-char *
-inet_neta(src, dst, size)
- u_long src;
- char *dst;
- size_t size;
-{
- char *odst = dst;
- char *tp;
-
- while (src & 0xffffffff) {
- u_char b = (src & 0xff000000) >> 24;
-
- src <<= 8;
- if (b) {
- if (size < sizeof "255.")
- goto emsgsize;
- tp = dst;
- dst += SPRINTF((dst, "%u", b));
- if (src != 0L) {
- *dst++ = '.';
- *dst = '\0';
- }
- size -= (size_t)(dst - tp);
- }
- }
- if (dst == odst) {
- if (size < sizeof "0.0.0.0")
- goto emsgsize;
- strcpy(dst, "0.0.0.0");
- }
- return (odst);
-
- emsgsize:
- errno = EMSGSIZE;
- return (NULL);
-}
diff --git a/c/src/exec/libnetworking/libc/inet_netof.c b/c/src/exec/libnetworking/libc/inet_netof.c
deleted file mode 100644
index 179731efc3..0000000000
--- a/c/src/exec/libnetworking/libc/inet_netof.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_netof.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Return the network number from an internet
- * address; handles class a/b/c network #'s.
- */
-u_long
-inet_netof(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
- else if (IN_CLASSB(i))
- return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT);
- else
- return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
-}
diff --git a/c/src/exec/libnetworking/libc/inet_network.c b/c/src/exec/libnetworking/libc/inet_network.c
deleted file mode 100644
index ac0073bf0a..0000000000
--- a/c/src/exec/libnetworking/libc/inet_network.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_network.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <ctype.h>
-
-/*
- * Internet network address interpretation routine.
- * The library routines call this routine to interpret
- * network numbers.
- */
-u_long
-inet_network(cp)
- register const char *cp;
-{
- register u_long val, base, n, i;
- register char c;
- u_long parts[4], *pp = parts;
-
-again:
- val = 0; base = 10;
- if (*cp == '0')
- base = 8, cp++;
- if (*cp == 'x' || *cp == 'X')
- base = 16, cp++;
- while ((c = *cp) != 0) {
- if (isdigit(c)) {
- val = (val * base) + (c - '0');
- cp++;
- continue;
- }
- if (base == 16 && isxdigit(c)) {
- val = (val << 4) + (c + 10 - (islower(c) ? 'a' : 'A'));
- cp++;
- continue;
- }
- break;
- }
- if (*cp == '.') {
- if (pp >= parts + 3)
- return (INADDR_NONE);
- *pp++ = val, cp++;
- goto again;
- }
- if (*cp && !isspace(*cp))
- return (INADDR_NONE);
- *pp++ = val;
- n = pp - parts;
- for (val = 0, i = 0; i < n; i++) {
- val <<= 8;
- val |= parts[i] & 0xff;
- }
- return (val);
-}
diff --git a/c/src/exec/libnetworking/libc/inet_ntoa.c b/c/src/exec/libnetworking/libc/inet_ntoa.c
deleted file mode 100644
index 44b686f0b3..0000000000
--- a/c/src/exec/libnetworking/libc/inet_ntoa.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_ntoa.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <stdio.h>
-
-/*
- * Convert network-format internet address
- * to base 256 d.d.d.d representation.
- */
-char *
-inet_ntoa(in)
- struct in_addr in;
-{
- static char ret[18];
-
- strcpy(ret, "[inet_ntoa error]");
- (void) inet_ntop(AF_INET, &in, ret, sizeof ret);
- return (ret);
-}
diff --git a/c/src/exec/libnetworking/libc/inet_ntop.c b/c/src/exec/libnetworking/libc/inet_ntop.c
deleted file mode 100644
index 76a538755a..0000000000
--- a/c/src/exec/libnetworking/libc/inet_ntop.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/* Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-/*
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static const char *inet_ntop4 __P((const u_char *src, char *dst, size_t size));
-static const char *inet_ntop6 __P((const u_char *src, char *dst, size_t size));
-
-/* char *
- * inet_ntop(af, src, dst, size)
- * convert a network format address to presentation format.
- * return:
- * pointer to presentation format address (`dst'), or NULL (see errno).
- * author:
- * Paul Vixie, 1996.
- */
-const char *
-inet_ntop(af, src, dst, size)
- int af;
- const void *src;
- char *dst;
- size_t size;
-{
- switch (af) {
- case AF_INET:
- return (inet_ntop4(src, dst, size));
- case AF_INET6:
- return (inet_ntop6(src, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (NULL);
- }
- /* NOTREACHED */
-}
-
-/* const char *
- * inet_ntop4(src, dst, size)
- * format an IPv4 address, more or less like inet_ntoa()
- * return:
- * `dst' (as a const)
- * notes:
- * (1) uses no statics
- * (2) takes a u_char* not an in_addr as input
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop4(src, dst, size)
- const u_char *src;
- char *dst;
- size_t size;
-{
- static const char fmt[] = "%u.%u.%u.%u";
- char tmp[sizeof "255.255.255.255"];
-
- if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
- errno = ENOSPC;
- return (NULL);
- }
- strcpy(dst, tmp);
- return (dst);
-}
-
-/* const char *
- * inet_ntop6(src, dst, size)
- * convert IPv6 binary address into presentation (printable) format
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop6(src, dst, size)
- const u_char *src;
- char *dst;
- size_t size;
-{
- /*
- * Note that int32_t and int16_t need only be "at least" large enough
- * to contain a value of the specified size. On some systems, like
- * Crays, there is no such thing as an integer variable with 16 bits.
- * Keep this in mind if you think this function should have been coded
- * to use pointer overlays. All the world's not a VAX.
- */
- char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
- struct { int base, len; } best, cur;
- u_int words[NS_IN6ADDRSZ / NS_INT16SZ];
- int i;
-
- /*
- * Preprocess:
- * Copy the input (bytewise) array into a wordwise array.
- * Find the longest run of 0x00's in src[] for :: shorthanding.
- */
- memset(words, '\0', sizeof words);
- for (i = 0; i < NS_IN6ADDRSZ; i++)
- words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
- best.base = -1;
- cur.base = -1;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
- if (words[i] == 0) {
- if (cur.base == -1)
- cur.base = i, cur.len = 1;
- else
- cur.len++;
- } else {
- if (cur.base != -1) {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- cur.base = -1;
- }
- }
- }
- if (cur.base != -1) {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- }
- if (best.base != -1 && best.len < 2)
- best.base = -1;
-
- /*
- * Format the result.
- */
- tp = tmp;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
- /* Are we inside the best run of 0x00's? */
- if (best.base != -1 && i >= best.base &&
- i < (best.base + best.len)) {
- if (i == best.base)
- *tp++ = ':';
- continue;
- }
- /* Are we following an initial run of 0x00s or any real hex? */
- if (i != 0)
- *tp++ = ':';
- /* Is this address an encapsulated IPv4? */
- if (i == 6 && best.base == 0 &&
- (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
- if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
- return (NULL);
- tp += strlen(tp);
- break;
- }
- tp += SPRINTF((tp, "%x", words[i]));
- }
- /* Was it a trailing run of 0x00's? */
- if (best.base != -1 && (best.base + best.len) ==
- (NS_IN6ADDRSZ / NS_INT16SZ))
- *tp++ = ':';
- *tp++ = '\0';
-
- /*
- * Check for overflow, copy, and we're done.
- */
- if ((size_t)(tp - tmp) > size) {
- errno = ENOSPC;
- return (NULL);
- }
- strcpy(dst, tmp);
- return (dst);
-}
diff --git a/c/src/exec/libnetworking/libc/inet_pton.c b/c/src/exec/libnetworking/libc/inet_pton.c
deleted file mode 100644
index 8d21111cfa..0000000000
--- a/c/src/exec/libnetworking/libc/inet_pton.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/* Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <string.h>
-#include <errno.h>
-
-/*
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static int inet_pton4 __P((const char *src, u_char *dst));
-static int inet_pton6 __P((const char *src, u_char *dst));
-
-/* int
- * inet_pton(af, src, dst)
- * convert from presentation format (which usually means ASCII printable)
- * to network format (which is usually some kind of binary format).
- * return:
- * 1 if the address was valid for the specified address family
- * 0 if the address wasn't valid (`dst' is untouched in this case)
- * -1 if some other error occurred (`dst' is untouched in this case, too)
- * author:
- * Paul Vixie, 1996.
- */
-int
-inet_pton(af, src, dst)
- int af;
- const char *src;
- void *dst;
-{
- switch (af) {
- case AF_INET:
- return (inet_pton4(src, dst));
- case AF_INET6:
- return (inet_pton6(src, dst));
- default:
- errno = EAFNOSUPPORT;
- return (-1);
- }
- /* NOTREACHED */
-}
-
-/* int
- * inet_pton4(src, dst)
- * like inet_aton() but without all the hexadecimal and shorthand.
- * return:
- * 1 if `src' is a valid dotted quad, else 0.
- * notice:
- * does not touch `dst' unless it's returning 1.
- * author:
- * Paul Vixie, 1996.
- */
-static int
-inet_pton4(src, dst)
- const char *src;
- u_char *dst;
-{
- static const char digits[] = "0123456789";
- int saw_digit, octets, ch;
- u_char tmp[NS_INADDRSZ], *tp;
-
- saw_digit = 0;
- octets = 0;
- *(tp = tmp) = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr(digits, ch)) != NULL) {
- u_int new = *tp * 10 + (pch - digits);
-
- if (new > 255)
- return (0);
- *tp = new;
- if (! saw_digit) {
- if (++octets > 4)
- return (0);
- saw_digit = 1;
- }
- } else if (ch == '.' && saw_digit) {
- if (octets == 4)
- return (0);
- *++tp = 0;
- saw_digit = 0;
- } else
- return (0);
- }
- if (octets < 4)
- return (0);
-
- memcpy(dst, tmp, NS_INADDRSZ);
- return (1);
-}
-
-/* int
- * inet_pton6(src, dst)
- * convert presentation level address to network order binary form.
- * return:
- * 1 if `src' is a valid [RFC1884 2.2] address, else 0.
- * notice:
- * (1) does not touch `dst' unless it's returning 1.
- * (2) :: in a full address is silently ignored.
- * credit:
- * inspired by Mark Andrews.
- * author:
- * Paul Vixie, 1996.
- */
-static int
-inet_pton6(src, dst)
- const char *src;
- u_char *dst;
-{
- static const char xdigits_l[] = "0123456789abcdef",
- xdigits_u[] = "0123456789ABCDEF";
- u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
- const char *xdigits, *curtok;
- int ch, saw_xdigit;
- u_int val;
-
- memset((tp = tmp), '\0', NS_IN6ADDRSZ);
- endp = tp + NS_IN6ADDRSZ;
- colonp = NULL;
- /* Leading :: requires some special handling. */
- if (*src == ':')
- if (*++src != ':')
- return (0);
- curtok = src;
- saw_xdigit = 0;
- val = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
- pch = strchr((xdigits = xdigits_u), ch);
- if (pch != NULL) {
- val <<= 4;
- val |= (pch - xdigits);
- if (val > 0xffff)
- return (0);
- saw_xdigit = 1;
- continue;
- }
- if (ch == ':') {
- curtok = src;
- if (!saw_xdigit) {
- if (colonp)
- return (0);
- colonp = tp;
- continue;
- }
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- saw_xdigit = 0;
- val = 0;
- continue;
- }
- if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
- inet_pton4(curtok, tp) > 0) {
- tp += NS_INADDRSZ;
- saw_xdigit = 0;
- break; /* '\0' was seen by inet_pton4(). */
- }
- return (0);
- }
- if (saw_xdigit) {
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- }
- if (colonp != NULL) {
- /*
- * Since some memmove()'s erroneously fail to handle
- * overlapping regions, we'll do the shift by hand.
- */
- const int n = tp - colonp;
- int i;
-
- for (i = 1; i <= n; i++) {
- endp[- i] = colonp[n - i];
- colonp[n - i] = 0;
- }
- tp = endp;
- }
- if (tp != endp)
- return (0);
- memcpy(dst, tmp, NS_IN6ADDRSZ);
- return (1);
-}
diff --git a/c/src/exec/libnetworking/libc/iso_addr.3 b/c/src/exec/libnetworking/libc/iso_addr.3
deleted file mode 100644
index 0c9973bef4..0000000000
--- a/c/src/exec/libnetworking/libc/iso_addr.3
+++ /dev/null
@@ -1,111 +0,0 @@
-.\" Copyright (c) 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.
-.\"
-.\" @(#)iso_addr.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt ISO_ADDR 3
-.Os
-.Sh NAME
-.Nm iso_addr ,
-.Nm iso_ntoa
-.Nd "elementary network address conversion routines for Open System Interconnection
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netiso/iso.h>
-.Ft struct iso_addr *
-.Fn iso_addr "char *cp"
-.Ft char *
-.Fn iso_ntoa "struct iso_addr *isoa"
-.Sh DESCRIPTION
-The routine
-.Fn iso_addr
-interprets character strings representing
-.Tn OSI
-addresses, returning binary information suitable
-for use in system calls.
-The routine
-.Fn iso_ntoa
-takes
-.Tn OSI
-addresses and returns
-.Tn ASCII
-strings representing NSAPs (network service
-access points) in a
-notation inverse to that accepted by
-.Fn iso_addr .
-.Pp
-Unfortunately, no universal standard exists for representing
-.Tn OSI
-network addresses.
-.Pp
-The format employed by
-.Fn iso_addr
-is a sequence of hexadecimal
-.Dq digits
-(optionally separated by periods),
-of the form:
-.Bd -filled -offset indent
-<hex digits>.<hex digits>.<hex digits>
-.Ed
-.Pp
-Each pair of hexadecimal digits represents a byte
-with the leading digit indicating the higher-ordered bits.
-A period following an even number of bytes has no
-effect (but may be used to increase legibility).
-A period following an odd number of bytes has the
-effect of causing the byte of address being translated
-to have its higher order bits filled with zeros.
-.Sh RETURN VALUES
-.Fn iso_ntoa
-always returns a null terminated string.
-.Fn iso_addr
-always returns a pointer to a struct iso_addr.
-(See
-.Sx BUGS . )
-.Sh SEE ALSO
-.Xr iso 4
-.Sh HISTORY
-The
-.Fn iso_addr
-and
-.Fn iso_ntoa
-functions appeared in
-.Bx 4.3 Reno .
-.Sh BUGS
-The returned values
-reside in a static memory area.
-.Pp
-The function
-.Fn iso_addr
-should diagnose improperly formed input, and there should be an unambiguous
-way to recognize this.
diff --git a/c/src/exec/libnetworking/libc/iso_addr.c b/c/src/exec/libnetworking/libc/iso_addr.c
deleted file mode 100644
index eb14e8a72b..0000000000
--- a/c/src/exec/libnetworking/libc/iso_addr.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 1989, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)iso_addr.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <netiso/iso.h>
-#include <string.h>
-
-/* States*/
-#define VIRGIN 0
-#define GOTONE 1
-#define GOTTWO 2
-/* Inputs */
-#define DIGIT (4*0)
-#define END (4*1)
-#define DELIM (4*2)
-
-struct iso_addr *
-iso_addr(addr)
- register const char *addr;
-{
- static struct iso_addr out_addr;
- register char *cp = out_addr.isoa_genaddr;
- char *cplim = cp + sizeof(out_addr.isoa_genaddr);
- register int byte = 0, state = VIRGIN, new;
-
- bzero((char *)&out_addr, sizeof(out_addr));
- do {
- if ((*addr >= '0') && (*addr <= '9')) {
- new = *addr - '0';
- } else if ((*addr >= 'a') && (*addr <= 'f')) {
- new = *addr - 'a' + 10;
- } else if ((*addr >= 'A') && (*addr <= 'F')) {
- new = *addr - 'A' + 10;
- } else if (*addr == 0)
- state |= END;
- else
- state |= DELIM;
- addr++;
- switch (state /* | INPUT */) {
- case GOTTWO | DIGIT:
- *cp++ = byte; /*FALLTHROUGH*/
- case VIRGIN | DIGIT:
- state = GOTONE; byte = new; continue;
- case GOTONE | DIGIT:
- state = GOTTWO; byte = new + (byte << 4); continue;
- default: /* | DELIM */
- state = VIRGIN; *cp++ = byte; byte = 0; continue;
- case GOTONE | END:
- case GOTTWO | END:
- *cp++ = byte; /* FALLTHROUGH */
- case VIRGIN | END:
- break;
- }
- break;
- } while (cp < cplim);
- out_addr.isoa_len = cp - out_addr.isoa_genaddr;
- return (&out_addr);
-}
-
-static char hexlist[] = "0123456789abcdef";
-
-char *
-iso_ntoa(isoa)
- const struct iso_addr *isoa;
-{
- static char tmpbuf[sizeof(isoa->isoa_genaddr)*3];
- const u_char *binary;
- char *cp;
- int i;
-
- binary = isoa->isoa_genaddr;
- cp = tmpbuf;
-
- for (i = 0; i < isoa->isoa_len; i++) {
- *cp++ = hexlist[*binary >> 4];
- *cp++ = hexlist[*binary++ & 0xf];
-
- if ((((i % 2) == 0) && ((i + 1) < isoa->isoa_len)))
- *cp++ = '.';
- }
- *cp = '\0';
- return tmpbuf;
-}
diff --git a/c/src/exec/libnetworking/libc/linkaddr.3 b/c/src/exec/libnetworking/libc/linkaddr.3
deleted file mode 100644
index 6999add0e8..0000000000
--- a/c/src/exec/libnetworking/libc/linkaddr.3
+++ /dev/null
@@ -1,138 +0,0 @@
-.\" Copyright (c) 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" This code is derived from software contributed to Berkeley by
-.\" Donn Seeley at BSDI.
-.\"
-.\" 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.
-.\"
-.\" From: @(#)linkaddr.3 8.1 (Berkeley) 7/28/93
-.\" $Id$
-.\"
-.Dd June 17, 1996
-.Dt LINK_ADDR 3
-.Os BSD 4.4
-.Sh NAME
-.Nm link_addr ,
-.Nm link_ntoa
-.Nd elementary address specification routines for link level access
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/socket.h>
-.Fd #include <net/if_dl.h>
-.Ft void
-.Fn link_addr "const char *addr" "struct sockaddr_dl *sdl"
-.Ft char *
-.Fn link_ntoa "const struct sockaddr_dl *sdl"
-.Sh DESCRIPTION
-The routine
-.Fn link_addr
-interprets character strings representing
-link-level addresses, returning binary information suitable
-for use in system calls.
-The routine
-.Fn link_ntoa
-takes
-a link-level
-address and returns an
-.Tn ASCII
-string representing some of the information present,
-including the link level address itself, and the interface name
-or number, if present.
-This facility is experimental and is
-still subject to change.
-.Pp
-For
-.Fn link_addr ,
-the string
-.Fa addr
-may contain
-an optional network interface identifier of the form
-.Dq "name unit-number" ,
-suitable for the first argument to
-.Xr ifconfig 8 ,
-followed in all cases by a colon and
-an interface address in the form of
-groups of hexadecimal digits
-separated by periods.
-Each group represents a byte of address;
-address bytes are filled left to right from
-low order bytes through high order bytes.
-.Pp
-.\" A regular expression may make this format clearer:
-.\" .Bd -literal -offset indent
-.\" ([a-z]+[0-9]+:)?[0-9a-f]+(\e.[0-9a-f]+)*
-.\" .Ed
-.\" .Pp
-Thus
-.Li le0:8.0.9.13.d.30
-represents an ethernet address
-to be transmitted on the first Lance ethernet interface.
-.Pp
-The direct use of these functions is deprecated in favor of the
-.Xr addr2ascii 3
-interface; however, portable programs cannot rely on the latter as it is
-not yet widely implemented.
-.Sh RETURN VALUES
-.Fn link_ntoa
-always returns a null terminated string.
-.Fn link_addr
-has no return value.
-(See
-.Sx BUGS . )
-.Sh SEE ALSO
-.Xr addr2ascii 3
-.\" .Xr iso 4
-.Sh HISTORY
-The
-.Fn link_addr
-and
-.Fn link_ntoa
-functions appeared in
-.Bx 4.3 Reno .
-.Sh BUGS
-The returned values for link_ntoa
-reside in a static memory area.
-.Pp
-The function
-.Fn link_addr
-should diagnose improperly formed input, and there should be an unambiguous
-way to recognize this.
-.Pp
-If the
-.Va sdl_len
-field of the link socket address
-.Fa sdl
-is 0,
-.Fn link_ntoa
-will not insert a colon before the interface address bytes.
-If this translated address is given to
-.Fn link_addr
-without inserting an initial colon,
-the latter will not interpret it correctly.
diff --git a/c/src/exec/libnetworking/libc/linkaddr.c b/c/src/exec/libnetworking/libc/linkaddr.c
deleted file mode 100644
index 28c16cff05..0000000000
--- a/c/src/exec/libnetworking/libc/linkaddr.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*-
- * Copyright (c) 1990, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)linkaddr.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <net/if_dl.h>
-#include <string.h>
-
-/* States*/
-#define NAMING 0
-#define GOTONE 1
-#define GOTTWO 2
-#define RESET 3
-/* Inputs */
-#define DIGIT (4*0)
-#define END (4*1)
-#define DELIM (4*2)
-#define LETTER (4*3)
-
-void
-link_addr(addr, sdl)
- register const char *addr;
- register struct sockaddr_dl *sdl;
-{
- register char *cp = sdl->sdl_data;
- char *cplim = sdl->sdl_len + (char *)sdl;
- register int byte = 0, state = NAMING, new;
-
- bzero((char *)&sdl->sdl_family, sdl->sdl_len - 1);
- sdl->sdl_family = AF_LINK;
- do {
- state &= ~LETTER;
- if ((*addr >= '0') && (*addr <= '9')) {
- new = *addr - '0';
- } else if ((*addr >= 'a') && (*addr <= 'f')) {
- new = *addr - 'a' + 10;
- } else if ((*addr >= 'A') && (*addr <= 'F')) {
- new = *addr - 'A' + 10;
- } else if (*addr == 0) {
- state |= END;
- } else if (state == NAMING &&
- (((*addr >= 'A') && (*addr <= 'Z')) ||
- ((*addr >= 'a') && (*addr <= 'z'))))
- state |= LETTER;
- else
- state |= DELIM;
- addr++;
- switch (state /* | INPUT */) {
- case NAMING | DIGIT:
- case NAMING | LETTER:
- *cp++ = addr[-1];
- continue;
- case NAMING | DELIM:
- state = RESET;
- sdl->sdl_nlen = cp - sdl->sdl_data;
- continue;
- case GOTTWO | DIGIT:
- *cp++ = byte;
- /* FALLTHROUGH */
- case RESET | DIGIT:
- state = GOTONE;
- byte = new;
- continue;
- case GOTONE | DIGIT:
- state = GOTTWO;
- byte = new + (byte << 4);
- continue;
- default: /* | DELIM */
- state = RESET;
- *cp++ = byte;
- byte = 0;
- continue;
- case GOTONE | END:
- case GOTTWO | END:
- *cp++ = byte;
- /* FALLTHROUGH */
- case RESET | END:
- break;
- }
- break;
- } while (cp < cplim);
- sdl->sdl_alen = cp - LLADDR(sdl);
- new = cp - (char *)sdl;
- if (new > sizeof(*sdl))
- sdl->sdl_len = new;
- return;
-}
-
-static char hexlist[] = "0123456789abcdef";
-
-char *
-link_ntoa(sdl)
- register const struct sockaddr_dl *sdl;
-{
- static char obuf[64];
- register char *out = obuf;
- register int i;
- register u_char *in = (u_char *)LLADDR(sdl);
- u_char *inlim = in + sdl->sdl_alen;
- int firsttime = 1;
-
- if (sdl->sdl_nlen) {
- bcopy(sdl->sdl_data, obuf, sdl->sdl_nlen);
- out += sdl->sdl_nlen;
- if (sdl->sdl_alen)
- *out++ = ':';
- }
- while (in < inlim) {
- if (firsttime)
- firsttime = 0;
- else
- *out++ = '.';
- i = *in++;
- if (i > 0xf) {
- out[1] = hexlist[i & 0xf];
- i >>= 4;
- out[0] = hexlist[i];
- out += 2;
- } else
- *out++ = hexlist[i];
- }
- *out = 0;
- return (obuf);
-}
diff --git a/c/src/exec/libnetworking/libc/map_v4v6.c b/c/src/exec/libnetworking/libc/map_v4v6.c
deleted file mode 100644
index 0f8658e117..0000000000
--- a/c/src/exec/libnetworking/libc/map_v4v6.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * ++Copyright++ 1985, 1988, 1993
- * -
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <ctype.h>
-#include <errno.h>
-#include <syslog.h>
-
-typedef union {
- int32_t al;
- char ac;
-} align;
-
-void
-_map_v4v6_address(src, dst)
- const char *src;
- char *dst;
-{
- u_char *p = (u_char *)dst;
- char tmp[INADDRSZ];
- int i;
-
- /* Stash a temporary copy so our caller can update in place. */
- bcopy(src, tmp, INADDRSZ);
- /* Mark this ipv6 addr as a mapped ipv4. */
- for (i = 0; i < 10; i++)
- *p++ = 0x00;
- *p++ = 0xff;
- *p++ = 0xff;
- /* Retrieve the saved copy and we're done. */
- bcopy(tmp, (void*)p, INADDRSZ);
-}
-
-void
-_map_v4v6_hostent(hp, bpp, lenp)
- struct hostent *hp;
- char **bpp;
- int *lenp;
-{
- char **ap;
-
- if (hp->h_addrtype != AF_INET || hp->h_length != INADDRSZ)
- return;
- hp->h_addrtype = AF_INET6;
- hp->h_length = IN6ADDRSZ;
- for (ap = hp->h_addr_list; *ap; ap++) {
- int i = sizeof(align) - ((u_long)*bpp % sizeof(align));
-
- if (*lenp < (i + IN6ADDRSZ)) {
- /* Out of memory. Truncate address list here. XXX */
- *ap = NULL;
- return;
- }
- *bpp += i;
- *lenp -= i;
- _map_v4v6_address(*ap, *bpp);
- *ap = *bpp;
- *bpp += IN6ADDRSZ;
- *lenp -= IN6ADDRSZ;
- }
-}
diff --git a/c/src/exec/libnetworking/libc/ns.3 b/c/src/exec/libnetworking/libc/ns.3
deleted file mode 100644
index e621ad2d90..0000000000
--- a/c/src/exec/libnetworking/libc/ns.3
+++ /dev/null
@@ -1,131 +0,0 @@
-.\" Copyright (c) 1986, 1991, 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.
-.\"
-.\" @(#)ns.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt NS 3
-.Os BSD 4.3
-.Sh NAME
-.Nm ns_addr ,
-.Nm ns_ntoa
-.Nd Xerox
-.Tn NS Ns (tm)
-address conversion routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netns/ns.h>
-.Ft struct ns_addr
-.Fn ns_addr "char *cp"
-.Ft char *
-.Fn ns_ntoa "struct ns_addr ns"
-.Sh DESCRIPTION
-The routine
-.Fn ns_addr
-interprets character strings representing
-.Tn XNS
-addresses, returning binary information suitable
-for use in system calls.
-The routine
-.Fn ns_ntoa
-takes
-.Tn XNS
-addresses and returns
-.Tn ASCII
-strings representing the address in a
-notation in common use in the Xerox Development Environment:
-.Bd -filled -offset indent
-<network number>.<host number>.<port number>
-.Ed
-.Pp
-Trailing zero fields are suppressed, and each number is printed in hexadecimal,
-in a format suitable for input to
-.Fn ns_addr .
-Any fields lacking super-decimal digits will have a
-trailing
-.Ql H
-appended.
-.Pp
-Unfortunately, no universal standard exists for representing
-.Tn XNS
-addresses.
-An effort has been made to insure that
-.Fn ns_addr
-be compatible with most formats in common use.
-It will first separate an address into 1 to 3 fields using a single delimiter
-chosen from
-period
-.Ql \&. ,
-colon
-.Ql \&:
-or pound-sign
-.Ql \&# .
-Each field is then examined for byte separators (colon or period).
-If there are byte separators, each subfield separated is taken to be
-a small hexadecimal number, and the entirety is taken as a network-byte-ordered
-quantity to be zero extended in the high-network-order bytes.
-Next, the field is inspected for hyphens, in which case
-the field is assumed to be a number in decimal notation
-with hyphens separating the millenia.
-Next, the field is assumed to be a number:
-It is interpreted
-as hexadecimal if there is a leading
-.Ql 0x
-(as in C),
-a trailing
-.Ql H
-(as in Mesa), or there are any super-decimal digits present.
-It is interpreted as octal is there is a leading
-.Ql 0
-and there are no super-octal digits.
-Otherwise, it is converted as a decimal number.
-.Sh RETURN VALUES
-None. (See
-.Sx BUGS . )
-.Sh SEE ALSO
-.Xr hosts 5 ,
-.Xr networks 5
-.Sh HISTORY
-The
-.Fn ns_addr
-and
-.Fn ns_toa
-functions appeared in
-.Bx 4.3 .
-.Sh BUGS
-The string returned by
-.Fn ns_ntoa
-resides in a static memory area.
-The function
-.Fn ns_addr
-should diagnose improperly formed input, and there should be an unambiguous
-way to recognize this.
diff --git a/c/src/exec/libnetworking/libc/ns_addr.c b/c/src/exec/libnetworking/libc/ns_addr.c
deleted file mode 100644
index 18fabe91f1..0000000000
--- a/c/src/exec/libnetworking/libc/ns_addr.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright (c) 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * J.Q. Johnson.
- *
- * 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ns_addr.c 8.1 (Berkeley) 6/7/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netns/ns.h>
-#include <stdio.h>
-#include <string.h>
-
-static struct ns_addr addr, zero_addr;
-
-static void Field(), cvtbase();
-
-struct ns_addr
-ns_addr(name)
- const char *name;
-{
- char separator;
- char *hostname, *socketname, *cp;
- char buf[50];
-
- (void)strncpy(buf, name, sizeof(buf) - 1);
- buf[sizeof(buf) - 1] = '\0';
-
- /*
- * First, figure out what he intends as a field separtor.
- * Despite the way this routine is written, the prefered
- * form 2-272.AA001234H.01777, i.e. XDE standard.
- * Great efforts are made to insure backward compatability.
- */
- if ((hostname = strchr(buf, '#')) != NULL)
- separator = '#';
- else {
- hostname = strchr(buf, '.');
- if ((cp = strchr(buf, ':')) &&
- ((hostname && cp < hostname) || (hostname == 0))) {
- hostname = cp;
- separator = ':';
- } else
- separator = '.';
- }
- if (hostname)
- *hostname++ = 0;
-
- addr = zero_addr;
- Field(buf, addr.x_net.c_net, 4);
- if (hostname == 0)
- return (addr); /* No separator means net only */
-
- socketname = strchr(hostname, separator);
- if (socketname) {
- *socketname++ = 0;
- Field(socketname, (u_char *)&addr.x_port, 2);
- }
-
- Field(hostname, addr.x_host.c_host, 6);
-
- return (addr);
-}
-
-static void
-Field(buf, out, len)
- char *buf;
- u_char *out;
- int len;
-{
- register char *bp = buf;
- int i, ibase, base16 = 0, base10 = 0, clen = 0;
- int hb[6], *hp;
- char *fmt;
-
- /*
- * first try 2-273#2-852-151-014#socket
- */
- if ((*buf != '-') &&
- (1 < (i = sscanf(buf, "%d-%d-%d-%d-%d",
- &hb[0], &hb[1], &hb[2], &hb[3], &hb[4])))) {
- cvtbase(1000L, 256, hb, i, out, len);
- return;
- }
- /*
- * try form 8E1#0.0.AA.0.5E.E6#socket
- */
- if (1 < (i = sscanf(buf,"%x.%x.%x.%x.%x.%x",
- &hb[0], &hb[1], &hb[2], &hb[3], &hb[4], &hb[5]))) {
- cvtbase(256L, 256, hb, i, out, len);
- return;
- }
- /*
- * try form 8E1#0:0:AA:0:5E:E6#socket
- */
- if (1 < (i = sscanf(buf,"%x:%x:%x:%x:%x:%x",
- &hb[0], &hb[1], &hb[2], &hb[3], &hb[4], &hb[5]))) {
- cvtbase(256L, 256, hb, i, out, len);
- return;
- }
- /*
- * This is REALLY stretching it but there was a
- * comma notation separting shorts -- definitely non standard
- */
- if (1 < (i = sscanf(buf,"%x,%x,%x",
- &hb[0], &hb[1], &hb[2]))) {
- hb[0] = htons(hb[0]); hb[1] = htons(hb[1]);
- hb[2] = htons(hb[2]);
- cvtbase(65536L, 256, hb, i, out, len);
- return;
- }
-
- /* Need to decide if base 10, 16 or 8 */
- while (*bp) switch (*bp++) {
-
- case '0': case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '-':
- break;
-
- case '8': case '9':
- base10 = 1;
- break;
-
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- base16 = 1;
- break;
-
- case 'x': case 'X':
- *--bp = '0';
- base16 = 1;
- break;
-
- case 'h': case 'H':
- base16 = 1;
- /* fall into */
-
- default:
- *--bp = 0; /* Ends Loop */
- }
- if (base16) {
- fmt = "%3x";
- ibase = 4096;
- } else if (base10 == 0 && *buf == '0') {
- fmt = "%3o";
- ibase = 512;
- } else {
- fmt = "%3d";
- ibase = 1000;
- }
-
- for (bp = buf; *bp++; ) clen++;
- if (clen == 0) clen++;
- if (clen > 18) clen = 18;
- i = ((clen - 1) / 3) + 1;
- bp = clen + buf - 3;
- hp = hb + i - 1;
-
- while (hp > hb) {
- (void)sscanf(bp, fmt, hp);
- bp[0] = 0;
- hp--;
- bp -= 3;
- }
- (void)sscanf(buf, fmt, hp);
- cvtbase((long)ibase, 256, hb, i, out, len);
-}
-
-static void
-cvtbase(oldbase,newbase,input,inlen,result,reslen)
- long oldbase;
- int newbase;
- int input[];
- int inlen;
- unsigned char result[];
- int reslen;
-{
- int d, e;
- long sum;
-
- e = 1;
- while (e > 0 && reslen > 0) {
- d = 0; e = 0; sum = 0;
- /* long division: input=input/newbase */
- while (d < inlen) {
- sum = sum*oldbase + (long) input[d];
- e += (sum > 0);
- input[d++] = sum / newbase;
- sum %= newbase;
- }
- result[--reslen] = sum; /* accumulate remainder */
- }
- for (d=0; d < reslen; d++)
- result[d] = 0;
-}
diff --git a/c/src/exec/libnetworking/libc/ns_name.c b/c/src/exec/libnetworking/libc/ns_name.c
deleted file mode 100644
index af10d2f062..0000000000
--- a/c/src/exec/libnetworking/libc/ns_name.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-
-#include <errno.h>
-#include <resolv.h>
-#include <string.h>
-
-/* Data. */
-
-static char digits[] = "0123456789";
-
-/* Forward. */
-
-static int special(int);
-static int printable(int);
-static int dn_find(const u_char *, const u_char *,
- const u_char * const *,
- const u_char * const *);
-
-/* Public. */
-
-/*
- * ns_name_ntop(src, dst, dstsiz)
- * Convert an encoded domain name to printable ascii as per RFC1035.
- * return:
- * Number of bytes written to buffer, or -1 (with errno set)
- * notes:
- * The root is returned as "."
- * All other domains are returned in non absolute form
- */
-int
-ns_name_ntop(const u_char *src, char *dst, size_t dstsiz) {
- const u_char *cp;
- char *dn, *eom;
- u_char c;
- u_int n;
-
- cp = src;
- dn = dst;
- eom = dst + dstsiz;
-
- while ((n = *cp++) != 0) {
- if ((n & NS_CMPRSFLGS) != 0) {
- /* Some kind of compression pointer. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (dn != dst) {
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '.';
- }
- if (dn + n >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- for ((void)NULL; n > 0; n--) {
- c = *cp++;
- if (special(c)) {
- if (dn + 1 >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '\\';
- *dn++ = (char)c;
- } else if (!printable(c)) {
- if (dn + 3 >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '\\';
- *dn++ = digits[c / 100];
- *dn++ = digits[(c % 100) / 10];
- *dn++ = digits[c % 10];
- } else {
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = (char)c;
- }
- }
- }
- if (dn == dst) {
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '.';
- }
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '\0';
- return (dn - dst);
-}
-
-/*
- * ns_name_pton(src, dst, dstsiz)
- * Convert a ascii string into an encoded domain name as per RFC1035.
- * return:
- * -1 if it fails
- * 1 if string was fully qualified
- * 0 is string was not fully qualified
- * notes:
- * Enforces label and domain length limits.
- */
-
-int
-ns_name_pton(const char *src, u_char *dst, size_t dstsiz) {
- u_char *label, *bp, *eom;
- int c, n, escaped;
- char *cp;
-
- escaped = 0;
- bp = dst;
- eom = dst + dstsiz;
- label = bp++;
-
- while ((c = *src++) != 0) {
- if (escaped) {
- if ((cp = strchr(digits, c)) != NULL) {
- n = (cp - digits) * 100;
- if ((c = *src++) == 0 ||
- (cp = strchr(digits, c)) == NULL) {
- errno = EMSGSIZE;
- return (-1);
- }
- n += (cp - digits) * 10;
- if ((c = *src++) == 0 ||
- (cp = strchr(digits, c)) == NULL) {
- errno = EMSGSIZE;
- return (-1);
- }
- n += (cp - digits);
- if (n > 255) {
- errno = EMSGSIZE;
- return (-1);
- }
- c = n;
- }
- escaped = 0;
- } else if (c == '\\') {
- escaped = 1;
- continue;
- } else if (c == '.') {
- c = (bp - label - 1);
- if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (label >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *label = c;
- /* Fully qualified ? */
- if (*src == '\0') {
- if (c != 0) {
- if (bp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *bp++ = '\0';
- }
- if ((bp - dst) > MAXCDNAME) {
- errno = EMSGSIZE;
- return (-1);
- }
- return (1);
- }
- if (c == 0) {
- errno = EMSGSIZE;
- return (-1);
- }
- label = bp++;
- continue;
- }
- if (bp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *bp++ = (u_char)c;
- }
- c = (bp - label - 1);
- if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (label >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *label = c;
- if (c != 0) {
- if (bp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *bp++ = 0;
- }
- if ((bp - dst) > MAXCDNAME) { /* src too big */
- errno = EMSGSIZE;
- return (-1);
- }
- return (0);
-}
-
-/*
- * ns_name_unpack(msg, eom, src, dst, dstsiz)
- * Unpack a domain name from a message, source may be compressed.
- * return:
- * -1 if it fails, or consumed octets if it succeeds.
- */
-int
-ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
- u_char *dst, size_t dstsiz)
-{
- const u_char *srcp, *dstlim;
- u_char *dstp;
- int n, len, checked;
-
- len = -1;
- checked = 0;
- dstp = dst;
- srcp = src;
- dstlim = dst + dstsiz;
- if (srcp < msg || srcp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- /* Fetch next label in domain name. */
- while ((n = *srcp++) != 0) {
- /* Check for indirection. */
- switch (n & NS_CMPRSFLGS) {
- case 0:
- /* Limit checks. */
- if (dstp + n + 1 >= dstlim || srcp + n >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- checked += n + 1;
- *dstp++ = n;
- memcpy(dstp, srcp, n);
- dstp += n;
- srcp += n;
- break;
-
- case NS_CMPRSFLGS:
- if (srcp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- if (len < 0)
- len = srcp - src + 1;
- srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff));
- if (srcp < msg || srcp >= eom) { /* Out of range. */
- errno = EMSGSIZE;
- return (-1);
- }
- checked += 2;
- /*
- * Check for loops in the compressed name;
- * if we've looked at the whole message,
- * there must be a loop.
- */
- if (checked >= eom - msg) {
- errno = EMSGSIZE;
- return (-1);
- }
- break;
-
- default:
- errno = EMSGSIZE;
- return (-1); /* flag error */
- }
- }
- *dstp = '\0';
- if (len < 0)
- len = srcp - src;
- return (len);
-}
-
-/*
- * ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr)
- * Pack domain name 'domain' into 'comp_dn'.
- * return:
- * Size of the compressed name, or -1.
- * notes:
- * 'dnptrs' is an array of pointers to previous compressed names.
- * dnptrs[0] is a pointer to the beginning of the message. The array
- * ends with NULL.
- * 'lastdnptr' is a pointer to the end of the array pointed to
- * by 'dnptrs'.
- * Side effects:
- * The list of pointers in dnptrs is updated for labels inserted into
- * the message as we compress the name. If 'dnptr' is NULL, we don't
- * try to compress names. If 'lastdnptr' is NULL, we don't update the
- * list.
- */
-int
-ns_name_pack(const u_char *src, u_char *dst, int dstsiz,
- const u_char **dnptrs, const u_char **lastdnptr)
-{
- u_char *dstp;
- const u_char **cpp, **lpp, *eob, *msg;
- const u_char *srcp;
- int n, l;
-
- srcp = src;
- dstp = dst;
- eob = dstp + dstsiz;
- lpp = cpp = NULL;
- if (dnptrs != NULL) {
- if ((msg = *dnptrs++) != NULL) {
- for (cpp = dnptrs; *cpp != NULL; cpp++)
- (void)NULL;
- lpp = cpp; /* end of list to search */
- }
- } else
- msg = NULL;
-
- /* make sure the domain we are about to add is legal */
- l = 0;
- do {
- n = *srcp;
- if ((n & NS_CMPRSFLGS) != 0) {
- errno = EMSGSIZE;
- return (-1);
- }
- l += n + 1;
- if (l > MAXCDNAME) {
- errno = EMSGSIZE;
- return (-1);
- }
- srcp += n + 1;
- } while (n != 0);
-
- srcp = src;
- do {
- /* Look to see if we can use pointers. */
- n = *srcp;
- if (n != 0 && msg != NULL) {
- l = dn_find(srcp, msg, (const u_char * const *)dnptrs,
- (const u_char * const *)lpp);
- if (l >= 0) {
- if (dstp + 1 >= eob) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dstp++ = (l >> 8) | NS_CMPRSFLGS;
- *dstp++ = l % 256;
- return (dstp - dst);
- }
- /* Not found, save it. */
- if (lastdnptr != NULL && cpp < lastdnptr - 1 &&
- (dstp - msg) < 0x4000) {
- *cpp++ = dstp;
- *cpp = NULL;
- }
- }
- /* copy label to buffer */
- if (n & NS_CMPRSFLGS) { /* Should not happen. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (dstp + 1 + n >= eob) {
- errno = EMSGSIZE;
- return (-1);
- }
- memcpy(dstp, srcp, n + 1);
- srcp += n + 1;
- dstp += n + 1;
- } while (n != 0);
-
- if (dstp > eob) {
- if (msg != NULL)
- *lpp = NULL;
- errno = EMSGSIZE;
- return (-1);
- }
- return (dstp - dst);
-}
-
-/*
- * ns_name_uncompress(msg, eom, src, dst, dstsiz)
- * Expand compressed domain name to presentation format.
- * return:
- * Number of bytes read out of `src', or -1 (with errno set).
- * note:
- * Root domain returns as "." not "".
- */
-int
-ns_name_uncompress(const u_char *msg, const u_char *eom, const u_char *src,
- char *dst, size_t dstsiz)
-{
- u_char tmp[NS_MAXCDNAME];
- int n;
-
- if ((n = ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1)
- return (-1);
- if (ns_name_ntop(tmp, dst, dstsiz) == -1)
- return (-1);
- return (n);
-}
-
-/*
- * ns_name_compress(src, dst, dstsiz, dnptrs, lastdnptr)
- * Compress a domain name into wire format, using compression pointers.
- * return:
- * Number of bytes consumed in `dst' or -1 (with errno set).
- * notes:
- * 'dnptrs' is an array of pointers to previous compressed names.
- * dnptrs[0] is a pointer to the beginning of the message.
- * The list ends with NULL. 'lastdnptr' is a pointer to the end of the
- * array pointed to by 'dnptrs'. Side effect is to update the list of
- * pointers for labels inserted into the message as we compress the name.
- * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr'
- * is NULL, we don't update the list.
- */
-int
-ns_name_compress(const char *src, u_char *dst, size_t dstsiz,
- const u_char **dnptrs, const u_char **lastdnptr)
-{
- u_char tmp[NS_MAXCDNAME];
-
- if (ns_name_pton(src, tmp, sizeof tmp) == -1)
- return (-1);
- return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr));
-}
-
-/*
- * ns_name_skip(ptrptr, eom)
- * Advance *ptrptr to skip over the compressed name it points at.
- * return:
- * 0 on success, -1 (with errno set) on failure.
- */
-int
-ns_name_skip(const u_char **ptrptr, const u_char *eom) {
- const u_char *cp;
- u_int n;
-
- cp = *ptrptr;
- while (cp < eom && (n = *cp++) != 0) {
- /* Check for indirection. */
- switch (n & NS_CMPRSFLGS) {
- case 0: /* normal case, n == len */
- cp += n;
- continue;
- case NS_CMPRSFLGS: /* indirection */
- cp++;
- break;
- default: /* illegal type */
- errno = EMSGSIZE;
- return (-1);
- }
- break;
- }
- if (cp > eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *ptrptr = cp;
- return (0);
-}
-
-/* Private. */
-
-/*
- * special(ch)
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * is this characted special ("in need of quoting") ?
- * return:
- * boolean.
- */
-static int
-special(int ch) {
- switch (ch) {
- case 0x22: /* '"' */
- case 0x2E: /* '.' */
- case 0x3B: /* ';' */
- case 0x5C: /* '\\' */
- /* Special modifiers in zone files. */
- case 0x40: /* '@' */
- case 0x24: /* '$' */
- return (1);
- default:
- return (0);
- }
-}
-
-/*
- * printable(ch)
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * is this character visible and not a space when printed ?
- * return:
- * boolean.
- */
-static int
-printable(int ch) {
- return (ch > 0x20 && ch < 0x7f);
-}
-
-/*
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * convert this character to lower case if it's upper case.
- */
-static int
-mklower(int ch) {
- if (ch >= 0x41 && ch <= 0x5A)
- return (ch + 0x20);
- return (ch);
-}
-
-/*
- * dn_find(domain, msg, dnptrs, lastdnptr)
- * Search for the counted-label name in an array of compressed names.
- * return:
- * offset from msg if found, or -1.
- * notes:
- * dnptrs is the pointer to the first name on the list,
- * not the pointer to the start of the message.
- */
-static int
-dn_find(const u_char *domain, const u_char *msg,
- const u_char * const *dnptrs,
- const u_char * const *lastdnptr)
-{
- const u_char *dn, *cp, *sp;
- const u_char * const *cpp;
- u_int n;
-
- for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
- dn = domain;
- sp = cp = *cpp;
- while ((n = *cp++) != 0) {
- /*
- * check for indirection
- */
- switch (n & NS_CMPRSFLGS) {
- case 0: /* normal case, n == len */
- if (n != *dn++)
- goto next;
- for ((void)NULL; n > 0; n--)
- if (mklower(*dn++) != mklower(*cp++))
- goto next;
- /* Is next root for both ? */
- if (*dn == '\0' && *cp == '\0')
- return (sp - msg);
- if (*dn)
- continue;
- goto next;
-
- case NS_CMPRSFLGS: /* indirection */
- cp = msg + (((n & 0x3f) << 8) | *cp);
- break;
-
- default: /* illegal type */
- errno = EMSGSIZE;
- return (-1);
- }
- }
- next: ;
- }
- errno = ENOENT;
- return (-1);
-}
diff --git a/c/src/exec/libnetworking/libc/ns_netint.c b/c/src/exec/libnetworking/libc/ns_netint.c
deleted file mode 100644
index 3c09da8f8c..0000000000
--- a/c/src/exec/libnetworking/libc/ns_netint.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/* Import. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-
-u_int
-ns_get16(const u_char *src) {
- u_int dst;
-
- NS_GET16(dst, src);
- return (dst);
-}
-
-u_long
-ns_get32(const u_char *src) {
- u_long dst;
-
- NS_GET32(dst, src);
- return (dst);
-}
-
-void
-ns_put16(u_int src, u_char *dst) {
- NS_PUT16(src, dst);
-}
-
-void
-ns_put32(u_long src, u_char *dst) {
- NS_PUT32(src, dst);
-}
diff --git a/c/src/exec/libnetworking/libc/ns_ntoa.c b/c/src/exec/libnetworking/libc/ns_ntoa.c
deleted file mode 100644
index 9d0be2e1dc..0000000000
--- a/c/src/exec/libnetworking/libc/ns_ntoa.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 1986, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ns_ntoa.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netns/ns.h>
-#include <stdio.h>
-
-char *
-ns_ntoa(addr)
- struct ns_addr addr;
-{
- static char obuf[40];
- union { union ns_net net_e; u_long long_e; } net;
- u_short port = htons(addr.x_port);
- register char *cp;
- char *cp2;
- register u_char *up = addr.x_host.c_host;
- u_char *uplim = up + 6;
- static char *spectHex();
-
- net.net_e = addr.x_net;
- sprintf(obuf, "%lx", (u_long)ntohl(net.long_e));
- cp = spectHex(obuf);
- cp2 = cp + 1;
- while (*up==0 && up < uplim) up++;
- if (up == uplim) {
- if (port) {
- sprintf(cp, ".0");
- cp += 2;
- }
- } else {
- sprintf(cp, ".%x", *up++);
- while (up < uplim) {
- while (*cp) cp++;
- sprintf(cp, "%02x", *up++);
- }
- cp = spectHex(cp2);
- }
- if (port) {
- sprintf(cp, ".%x", port);
- spectHex(cp + 1);
- }
- return (obuf);
-}
-
-static char *
-spectHex(p0)
- char *p0;
-{
- int ok = 0;
- int nonzero = 0;
- register char *p = p0;
- for (; *p; p++) switch (*p) {
-
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- *p += ('A' - 'a');
- /* fall into . . . */
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- ok = 1;
- case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
- nonzero = 1;
- }
- if (nonzero && !ok) { *p++ = 'H'; *p = 0; }
- return (p);
-}
diff --git a/c/src/exec/libnetworking/libc/ns_parse.c b/c/src/exec/libnetworking/libc/ns_parse.c
deleted file mode 100644
index cc1f070156..0000000000
--- a/c/src/exec/libnetworking/libc/ns_parse.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-
-#include <errno.h>
-#include <resolv.h>
-#include <string.h>
-
-/* These need to be in the same order as the nres.h:ns_flag enum. */
-struct _ns_flagdata _ns_flagdata[16] = {
- { 0x8000, 15 }, /* qr. */
- { 0x7800, 11 }, /* opcode. */
- { 0x0400, 10 }, /* aa. */
- { 0x0200, 9 }, /* tc. */
- { 0x0100, 8 }, /* rd. */
- { 0x0080, 7 }, /* ra. */
- { 0x0040, 6 }, /* z. */
- { 0x0020, 5 }, /* ad. */
- { 0x0010, 4 }, /* cd. */
- { 0x000f, 0 }, /* rcode. */
- { 0x0000, 0 }, /* expansion (1/6). */
- { 0x0000, 0 }, /* expansion (2/6). */
- { 0x0000, 0 }, /* expansion (3/6). */
- { 0x0000, 0 }, /* expansion (4/6). */
- { 0x0000, 0 }, /* expansion (5/6). */
- { 0x0000, 0 }, /* expansion (6/6). */
-};
-
-static int
-skiprr(const u_char *ptr, const u_char *eom, ns_sect section, int count) {
- const u_char *optr = ptr;
-
- for ((void)NULL; count > 0; count--) {
- int b, rdlength;
-
- b = dn_skipname(ptr, eom);
- if (b < 0)
- goto emsgsize;
- ptr += b/*Name*/ + NS_INT16SZ/*Type*/ + NS_INT16SZ/*Class*/;
- if (section != ns_s_qd) {
- if (ptr + NS_INT32SZ > eom)
- goto emsgsize;
- ptr += NS_INT32SZ/*TTL*/;
- if (ptr + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(rdlength, ptr);
- ptr += rdlength/*RData*/;
- }
- }
- if (ptr > eom)
- goto emsgsize;
- return (ptr - optr);
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
-
-int
-ns_initparse(const u_char *msg, int msglen, ns_msg *handle) {
- const u_char *eom = msg + msglen;
- int i;
-
- memset(handle, 0x5e, sizeof *handle);
- handle->_msg = msg;
- handle->_eom = eom;
- if (msg + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(handle->_id, msg);
- if (msg + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(handle->_flags, msg);
- for (i = 0; i < ns_s_max; i++) {
- if (msg + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(handle->_counts[i], msg);
- }
- for (i = 0; i < ns_s_max; i++)
- if (handle->_counts[i] == 0)
- handle->_sections[i] = NULL;
- else {
- int b = skiprr(msg, eom, (ns_sect)i,
- handle->_counts[i]);
-
- if (b < 0)
- return (-1);
- handle->_sections[i] = msg;
- msg += b;
- }
- if (msg != eom)
- goto emsgsize;
- handle->_sect = ns_s_max;
- handle->_rrnum = -1;
- handle->_ptr = NULL;
- return (0);
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
-
-int
-ns_parserr(ns_msg *handle, ns_sect section, int rrnum, ns_rr *rr) {
- int b;
-
- /* Make section right. */
- if (section < 0 || section >= ns_s_max)
- goto enodev;
- if ((int)section != (int)handle->_sect) {
- handle->_sect = section;
- handle->_rrnum = 0;
- handle->_ptr = handle->_sections[(int)section];
- }
-
- /* Make rrnum right. */
- if (rrnum == -1)
- rrnum = handle->_rrnum;
- if (rrnum < 0 || rrnum >= handle->_counts[(int)section])
- goto enodev;
- if (rrnum < handle->_rrnum) {
- handle->_rrnum = 0;
- handle->_ptr = handle->_sections[(int)section];
- }
-
- b = skiprr(handle->_msg, handle->_eom, section,
- rrnum - handle->_rrnum);
- if (b < 0)
- return (-1);
- handle->_ptr += b;
- handle->_rrnum = rrnum;
-
- /* Do the parse. */
- b = dn_expand(handle->_msg, handle->_eom,
- handle->_ptr, rr->name, NS_MAXDNAME);
- if (b < 0)
- return (-1);
- handle->_ptr += b;
- if (handle->_ptr + NS_INT16SZ > handle->_eom)
- goto emsgsize;
- NS_GET16(rr->type, handle->_ptr);
- if (handle->_ptr + NS_INT16SZ > handle->_eom)
- goto emsgsize;
- NS_GET16(rr->class, handle->_ptr);
- if (section == ns_s_qd) {
- rr->ttl = 0;
- rr->rdlength = 0;
- rr->rdata = NULL;
- } else {
- if (handle->_ptr + NS_INT32SZ > handle->_eom)
- goto emsgsize;
- NS_GET32(rr->ttl, handle->_ptr);
- if (handle->_ptr + NS_INT16SZ > handle->_eom)
- goto emsgsize;
- NS_GET16(rr->rdlength, handle->_ptr);
- if (handle->_ptr + rr->rdlength > handle->_eom)
- goto emsgsize;
- rr->rdata = handle->_ptr;
- handle->_ptr += rr->rdlength;
- }
- handle->_rrnum++;
-
- /* All done. */
- return (0);
- enodev:
- errno = ENODEV;
- return (-1);
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
diff --git a/c/src/exec/libnetworking/libc/ns_print.c b/c/src/exec/libnetworking/libc/ns_print.c
deleted file mode 100644
index f7d7d16c64..0000000000
--- a/c/src/exec/libnetworking/libc/ns_print.c
+++ /dev/null
@@ -1,745 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/* Import. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <assert.h>
-#include <errno.h>
-#include <resolv.h>
-#include <string.h>
-#include <ctype.h>
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-/* Forward. */
-
-static size_t prune_origin(const char *name, const char *origin);
-static int charstr(const u_char *rdata, const u_char *edata,
- char **buf, size_t *buflen);
-static int addname(const u_char *msg, size_t msglen,
- const u_char **p, const char *origin,
- char **buf, size_t *buflen);
-static void addlen(size_t len, char **buf, size_t *buflen);
-static int addstr(const char *src, size_t len,
- char **buf, size_t *buflen);
-static int addtab(size_t len, size_t target, int spaced,
- char **buf, size_t *buflen);
-
-/* Macros. */
-
-#define T(x) \
- do { \
- if ((x) < 0) \
- return (-1); \
- } while (0)
-
-/* Public. */
-
-/*
- * int
- * ns_sprintrr(handle, rr, name_ctx, origin, buf, buflen)
- * Convert an RR to presentation format.
- * return:
- * Number of characters written to buf, or -1 (check errno).
- */
-int
-ns_sprintrr(const ns_msg *handle, const ns_rr *rr,
- const char *name_ctx, const char *origin,
- char *buf, size_t buflen)
-{
- int n;
-
- n = ns_sprintrrf(ns_msg_base(*handle), ns_msg_size(*handle),
- ns_rr_name(*rr), ns_rr_class(*rr), ns_rr_type(*rr),
- ns_rr_ttl(*rr), ns_rr_rdata(*rr), ns_rr_rdlen(*rr),
- name_ctx, origin, buf, buflen);
- return (n);
-}
-
-/*
- * int
- * ns_sprintrrf(msg, msglen, name, class, type, ttl, rdata, rdlen,
- * name_ctx, origin, buf, buflen)
- * Convert the fields of an RR into presentation format.
- * return:
- * Number of characters written to buf, or -1 (check errno).
- */
-int
-ns_sprintrrf(const u_char *msg, size_t msglen,
- const char *name, ns_class class, ns_type type,
- u_long ttl, const u_char *rdata, size_t rdlen,
- const char *name_ctx, const char *origin,
- char *buf, size_t buflen)
-{
- const char *obuf = buf;
- const u_char *edata = rdata + rdlen;
- int spaced = 0;
-
- const char *comment;
- char tmp[100];
- int len, x;
-
- /*
- * Owner.
- */
- if (name_ctx != NULL && strcasecmp(name_ctx, name) == 0) {
- T(addstr("\t\t\t", 3, &buf, &buflen));
- } else {
- len = prune_origin(name, origin);
- if (len == 0) {
- T(addstr("@\t\t\t", 4, &buf, &buflen));
- } else {
- T(addstr(name, len, &buf, &buflen));
- /* Origin not used and no trailing dot? */
- if ((!origin || !origin[0] || name[len] == '\0') &&
- name[len - 1] != '.') {
- T(addstr(".", 1, &buf, &buflen));
- len++;
- }
- T(spaced = addtab(len, 24, spaced, &buf, &buflen));
- }
- }
-
- /*
- * TTL, Class, Type.
- */
- T(x = ns_format_ttl(ttl, buf, buflen));
- addlen(x, &buf, &buflen);
- len = SPRINTF((tmp, " %s %s", p_class(class), p_type(type)));
- T(addstr(tmp, len, &buf, &buflen));
- T(spaced = addtab(x + len, 16, spaced, &buf, &buflen));
-
- /*
- * RData.
- */
- switch (type) {
- case ns_t_a:
- if (rdlen != NS_INADDRSZ)
- goto formerr;
- (void) inet_ntop(AF_INET, rdata, buf, buflen);
- addlen(strlen(buf), &buf, &buflen);
- break;
-
- case ns_t_cname:
- case ns_t_mb:
- case ns_t_mg:
- case ns_t_mr:
- case ns_t_ns:
- case ns_t_ptr:
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- break;
-
- case ns_t_hinfo:
- case ns_t_isdn:
- /* First word. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Second word. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- break;
-
- case ns_t_soa: {
- u_long t;
-
- /* Server name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Administrator name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" (\n", 3, &buf, &buflen));
- spaced = 0;
-
- if ((edata - rdata) != 5*NS_INT32SZ)
- goto formerr;
-
- /* Serial number. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- len = SPRINTF((tmp, "%lu", t));
- T(addstr(tmp, len, &buf, &buflen));
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; serial\n", 9, &buf, &buflen));
- spaced = 0;
-
- /* Refresh interval. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; refresh\n", 10, &buf, &buflen));
- spaced = 0;
-
- /* Retry interval. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; retry\n", 8, &buf, &buflen));
- spaced = 0;
-
- /* Expiry. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; expiry\n", 9, &buf, &buflen));
- spaced = 0;
-
- /* Minimum TTL. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(addstr(" )", 2, &buf, &buflen));
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; minimum\n", 10, &buf, &buflen));
-
- break;
- }
-
- case ns_t_mx:
- case ns_t_afsdb:
- case ns_t_rt: {
- u_int t;
-
- if (rdlen < NS_INT16SZ)
- goto formerr;
-
- /* Priority. */
- t = ns_get16(rdata);
- rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", t));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Target. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- break;
- }
-
- case ns_t_px: {
- u_int t;
-
- if (rdlen < NS_INT16SZ)
- goto formerr;
-
- /* Priority. */
- t = ns_get16(rdata);
- rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", t));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Name1. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Name2. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- break;
- }
-
- case ns_t_x25:
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- break;
-
- case ns_t_txt:
- while (rdata < edata) {
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- if (rdata < edata)
- T(addstr(" ", 1, &buf, &buflen));
- }
- break;
-
- case ns_t_nsap: {
- char t[255*3];
-
- (void) inet_nsap_ntoa(rdlen, rdata, t);
- T(addstr(t, strlen(t), &buf, &buflen));
- break;
- }
-
- case ns_t_aaaa:
- if (rdlen != NS_IN6ADDRSZ)
- goto formerr;
- (void) inet_ntop(AF_INET6, rdata, buf, buflen);
- addlen(strlen(buf), &buf, &buflen);
- break;
-
- case ns_t_loc: {
- char t[255];
-
- /* XXX protocol format checking? */
- (void) loc_ntoa(rdata, t);
- T(addstr(t, strlen(t), &buf, &buflen));
- break;
- }
-
- case ns_t_naptr: {
- u_int order, preference;
- char t[50];
-
- if (rdlen < 2*NS_INT16SZ)
- goto formerr;
-
- /* Order, Precedence. */
- order = ns_get16(rdata); rdata += NS_INT16SZ;
- preference = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((t, "%u %u ", order, preference));
- T(addstr(t, len, &buf, &buflen));
-
- /* Flags. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Service. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Regexp. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len < 0)
- return (-1);
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Server. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- break;
- }
-
- case ns_t_srv: {
- u_int priority, weight, port;
- char t[50];
-
- if (rdlen < NS_INT16SZ*3)
- goto formerr;
-
- /* Priority, Weight, Port. */
- priority = ns_get16(rdata); rdata += NS_INT16SZ;
- weight = ns_get16(rdata); rdata += NS_INT16SZ;
- port = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((t, "%u %u %u ", priority, weight, port));
- T(addstr(t, len, &buf, &buflen));
-
- /* Server. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- break;
- }
-
- case ns_t_minfo:
- case ns_t_rp:
- /* Name1. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Name2. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- break;
-
- case ns_t_wks: {
- int n, lcnt;
-
- if (rdlen < NS_INT32SZ + 1)
- goto formerr;
-
- /* Address. */
- (void) inet_ntop(AF_INET, rdata, buf, buflen);
- addlen(strlen(buf), &buf, &buflen);
- rdata += NS_INADDRSZ;
-
- /* Protocol. */
- len = SPRINTF((tmp, " %u ( ", *rdata));
- T(addstr(tmp, len, &buf, &buflen));
- rdata += NS_INT8SZ;
-
- /* Bit map. */
- n = 0;
- lcnt = 0;
- while (rdata < edata) {
- u_int c = *rdata++;
- do {
- if (c & 0200) {
- if (lcnt == 0) {
- T(addstr("\n\t\t\t\t", 5,
- &buf, &buflen));
- lcnt = 10;
- spaced = 0;
- }
- len = SPRINTF((tmp, "%d ", n));
- T(addstr(tmp, len, &buf, &buflen));
- lcnt--;
- }
- c <<= 1;
- } while (++n & 07);
- }
- T(addstr(")", 1, &buf, &buflen));
-
- break;
- }
-
- case ns_t_key: {
- char base64_key[NS_MD5RSA_MAX_BASE64];
- u_int keyflags, protocol, algorithm;
- const char *leader;
- int n;
-
- if (rdlen < NS_INT16SZ + NS_INT8SZ + NS_INT8SZ)
- goto formerr;
-
- /* Key flags, Protocol, Algorithm. */
- keyflags = ns_get16(rdata); rdata += NS_INT16SZ;
- protocol = *rdata++;
- algorithm = *rdata++;
- len = SPRINTF((tmp, "0x%04x %u %u",
- keyflags, protocol, algorithm));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Public key data. */
- len = b64_ntop(rdata, edata - rdata,
- base64_key, sizeof base64_key);
- if (len < 0)
- goto formerr;
- if (len > 15) {
- T(addstr(" (", 2, &buf, &buflen));
- leader = "\n\t\t";
- spaced = 0;
- } else
- leader = " ";
- for (n = 0; n < len; n += 48) {
- T(addstr(leader, strlen(leader), &buf, &buflen));
- T(addstr(base64_key + n, MIN(len - n, 48),
- &buf, &buflen));
- }
- if (len > 15)
- T(addstr(" )", 2, &buf, &buflen));
-
- break;
- }
-
- case ns_t_sig: {
- char base64_key[NS_MD5RSA_MAX_BASE64];
- u_int type, algorithm, labels, footprint;
- const char *leader;
- u_long t;
- int n;
-
- if (rdlen < 22)
- goto formerr;
-
- /* Type covered, Algorithm, Label count, Original TTL. */
- type = ns_get16(rdata); rdata += NS_INT16SZ;
- algorithm = *rdata++;
- labels = *rdata++;
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, " %s %d %lu ",
- p_type(type), algorithm, t));
- T(addstr(tmp, len, &buf, &buflen));
- if (labels != (u_int)dn_count_labels(name))
- goto formerr;
-
- /* Signature expiry. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s ", p_secstodate(t)));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Time signed. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s ", p_secstodate(t)));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Signature Footprint. */
- footprint = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", footprint));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Signer's name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- /* Signature. */
- len = b64_ntop(rdata, edata - rdata,
- base64_key, sizeof base64_key);
- if (len > 15) {
- T(addstr(" (", 2, &buf, &buflen));
- leader = "\n\t\t";
- spaced = 0;
- } else
- leader = " ";
- if (len < 0)
- goto formerr;
- for (n = 0; n < len; n += 48) {
- T(addstr(leader, strlen(leader), &buf, &buflen));
- T(addstr(base64_key + n, MIN(len - n, 48),
- &buf, &buflen));
- }
- if (len > 15)
- T(addstr(" )", 2, &buf, &buflen));
-
- break;
- }
-
- case ns_t_nxt: {
- int n, c;
-
- /* Next domain name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- /* Type bit map. */
- n = edata - rdata;
- for (c = 0; c < n*8; c++)
- if (NS_NXT_BIT_ISSET(c, rdata)) {
- len = SPRINTF((tmp, " %s", p_type(c)));
- T(addstr(tmp, len, &buf, &buflen));
- }
- break;
- }
-
- default:
- comment = "unknown RR type";
- goto hexify;
- }
- return (buf - obuf);
- formerr:
- comment = "RR format error";
- hexify: {
- int n, m;
- char *p;
-
- len = SPRINTF((tmp, "\\#(\t\t; %s", comment));
- T(addstr(tmp, len, &buf, &buflen));
- while (rdata < edata) {
- p = tmp;
- p += SPRINTF((p, "\n\t"));
- spaced = 0;
- n = MIN(16, edata - rdata);
- for (m = 0; m < n; m++)
- p += SPRINTF((p, "%02x ", rdata[m]));
- T(addstr(tmp, p - tmp, &buf, &buflen));
- if (n < 16) {
- T(addstr(")", 1, &buf, &buflen));
- T(addtab(p - tmp + 1, 48, spaced, &buf, &buflen));
- }
- p = tmp;
- p += SPRINTF((p, "; "));
- for (m = 0; m < n; m++)
- *p++ = (isascii(rdata[m]) && isprint(rdata[m]))
- ? rdata[m]
- : '.';
- T(addstr(tmp, p - tmp, &buf, &buflen));
- rdata += n;
- }
- return (buf - obuf);
- }
-}
-
-/* Private. */
-
-/*
- * size_t
- * prune_origin(name, origin)
- * Find out if the name is at or under the current origin.
- * return:
- * Number of characters in name before start of origin,
- * or length of name if origin does not match.
- * notes:
- * This function should share code with samedomain().
- */
-static size_t
-prune_origin(const char *name, const char *origin) {
- const char *oname = name;
-
- while (*name != '\0') {
- if (origin != NULL && strcasecmp(name, origin) == 0)
- return (name - oname - (name > oname));
- while (*name != '\0') {
- if (*name == '\\') {
- name++;
- /* XXX need to handle \nnn form. */
- if (*name == '\0')
- break;
- } else if (*name == '.') {
- name++;
- break;
- }
- name++;
- }
- }
- return (name - oname);
-}
-
-/*
- * int
- * charstr(rdata, edata, buf, buflen)
- * Format a <character-string> into the presentation buffer.
- * return:
- * Number of rdata octets consumed
- * 0 for protocol format error
- * -1 for output buffer error
- * side effects:
- * buffer is advanced on success.
- */
-static int
-charstr(const u_char *rdata, const u_char *edata, char **buf, size_t *buflen) {
- const u_char *odata = rdata;
- size_t save_buflen = *buflen;
- char *save_buf = *buf;
-
- if (addstr("\"", 1, buf, buflen) < 0)
- goto enospc;
- if (rdata < edata) {
- int n = *rdata;
-
- if (rdata + 1 + n <= edata) {
- rdata++;
- while (n-- > 0) {
- if (strchr("\n\"\\", *rdata) != NULL)
- if (addstr("\\", 1, buf, buflen) < 0)
- goto enospc;
- if (addstr((const char *)rdata, 1,
- buf, buflen) < 0)
- goto enospc;
- rdata++;
- }
- }
- }
- if (addstr("\"", 1, buf, buflen) < 0)
- goto enospc;
- return (rdata - odata);
- enospc:
- errno = ENOSPC;
- *buf = save_buf;
- *buflen = save_buflen;
- return (-1);
-}
-
-static int
-addname(const u_char *msg, size_t msglen,
- const u_char **pp, const char *origin,
- char **buf, size_t *buflen)
-{
- size_t newlen, save_buflen = *buflen;
- char *save_buf = *buf;
- int n;
-
- n = dn_expand(msg, msg + msglen, *pp, *buf, *buflen);
- if (n < 0)
- goto enospc; /* Guess. */
- newlen = prune_origin(*buf, origin);
- if ((origin == NULL || origin[0] == '\0' || (*buf)[newlen] == '\0') &&
- (newlen == 0 || (*buf)[newlen - 1] != '.')) {
- /* No trailing dot. */
- if (newlen + 2 > *buflen)
- goto enospc; /* No room for ".\0". */
- (*buf)[newlen++] = '.';
- (*buf)[newlen] = '\0';
- }
- if (newlen == 0) {
- /* Use "@" instead of name. */
- if (newlen + 2 > *buflen)
- goto enospc; /* No room for "@\0". */
- (*buf)[newlen++] = '@';
- (*buf)[newlen] = '\0';
- }
- *pp += n;
- addlen(newlen, buf, buflen);
- **buf = '\0';
- return (newlen);
- enospc:
- errno = ENOSPC;
- *buf = save_buf;
- *buflen = save_buflen;
- return (-1);
-}
-
-static void
-addlen(size_t len, char **buf, size_t *buflen) {
- assert(len <= *buflen);
- *buf += len;
- *buflen -= len;
-}
-
-static int
-addstr(const char *src, size_t len, char **buf, size_t *buflen) {
- if (len > *buflen) {
- errno = ENOSPC;
- return (-1);
- }
- memcpy(*buf, src, len);
- addlen(len, buf, buflen);
- **buf = '\0';
- return (0);
-}
-
-static int
-addtab(size_t len, size_t target, int spaced, char **buf, size_t *buflen) {
- size_t save_buflen = *buflen;
- char *save_buf = *buf;
- int t;
-
- if (spaced || len >= target - 1) {
- T(addstr(" ", 2, buf, buflen));
- spaced = 1;
- } else {
- for (t = (target - len - 1) / 8; t >= 0; t--)
- if (addstr("\t", 1, buf, buflen) < 0) {
- *buflen = save_buflen;
- *buf = save_buf;
- return (-1);
- }
- spaced = 0;
- }
- return (spaced);
-}
diff --git a/c/src/exec/libnetworking/libc/ns_ttl.c b/c/src/exec/libnetworking/libc/ns_ttl.c
deleted file mode 100644
index 75093c1dbc..0000000000
--- a/c/src/exec/libnetworking/libc/ns_ttl.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/* Import. */
-
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-/* Forward. */
-
-static int fmt1(int t, char s, char **buf, size_t *buflen);
-
-/* Macros. */
-
-#define T(x) if ((x) < 0) return (-1); else (void)NULL
-
-/* Public. */
-
-int
-ns_format_ttl(u_long src, char *dst, size_t dstlen) {
- char *odst = dst;
- int secs, mins, hours, days, weeks, x;
- char *p;
-
- secs = src % 60; src /= 60;
- mins = src % 60; src /= 60;
- hours = src % 24; src /= 24;
- days = src % 7; src /= 7;
- weeks = src; src = 0;
-
- x = 0;
- if (weeks) {
- T(fmt1(weeks, 'W', &dst, &dstlen));
- x++;
- }
- if (days) {
- T(fmt1(days, 'D', &dst, &dstlen));
- x++;
- }
- if (hours) {
- T(fmt1(hours, 'H', &dst, &dstlen));
- x++;
- }
- if (mins) {
- T(fmt1(mins, 'M', &dst, &dstlen));
- x++;
- }
- if (secs || !(weeks || days || hours || mins)) {
- T(fmt1(secs, 'S', &dst, &dstlen));
- x++;
- }
-
- if (x > 1) {
- int ch;
-
- for (p = odst; (ch = *p) != '\0'; p++)
- if (isascii(ch) && isupper(ch))
- *p = tolower(ch);
- }
-
- return (dst - odst);
-}
-
-int
-ns_parse_ttl(const char *src, u_long *dst) {
- u_long ttl, tmp;
- int ch, digits, dirty;
-
- ttl = 0;
- tmp = 0;
- digits = 0;
- dirty = 0;
- while ((ch = *src++) != '\0') {
- if (!isascii(ch) || !isprint(ch))
- goto einval;
- if (isdigit(ch)) {
- tmp *= 10;
- tmp += (ch - '0');
- digits++;
- continue;
- }
- if (digits == 0)
- goto einval;
- if (islower(ch))
- ch = toupper(ch);
- switch (ch) {
- case 'W': tmp *= 7;
- case 'D': tmp *= 24;
- case 'H': tmp *= 60;
- case 'M': tmp *= 60;
- case 'S': break;
- default: goto einval;
- }
- ttl += tmp;
- tmp = 0;
- digits = 0;
- dirty = 1;
- }
- if (digits > 0) {
- if (dirty)
- goto einval;
- else
- ttl += tmp;
- }
- *dst = ttl;
- return (0);
-
- einval:
- errno = EINVAL;
- return (-1);
-}
-
-/* Private. */
-
-static int
-fmt1(int t, char s, char **buf, size_t *buflen) {
- char tmp[50];
- size_t len;
-
- len = SPRINTF((tmp, "%d%c", t, s));
- if (len + 1 > *buflen)
- return (-1);
- strcpy(*buf, tmp);
- *buf += len;
- *buflen -= len;
- return (0);
-}
diff --git a/c/src/exec/libnetworking/libc/nsap_addr.c b/c/src/exec/libnetworking/libc/nsap_addr.c
deleted file mode 100644
index a7af57a266..0000000000
--- a/c/src/exec/libnetworking/libc/nsap_addr.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-
-static char
-xtob(c)
- register int c;
-{
- return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
-}
-
-u_int
-inet_nsap_addr(ascii, binary, maxlen)
- const char *ascii;
- u_char *binary;
- int maxlen;
-{
- u_char c, nib;
- u_int len = 0;
-
- while ((c = *ascii++) != '\0' && len < (u_int)maxlen) {
- if (c == '.' || c == '+' || c == '/')
- continue;
- if (!isascii(c))
- return (0);
- if (islower(c))
- c = toupper(c);
- if (isxdigit(c)) {
- nib = xtob(c);
- c = *ascii++;
- if (c != '\0') {
- c = toupper(c);
- if (isxdigit(c)) {
- *binary++ = (nib << 4) | xtob(c);
- len++;
- } else
- return (0);
- }
- else
- return (0);
- }
- else
- return (0);
- }
- return (len);
-}
-
-char *
-inet_nsap_ntoa(binlen, binary, ascii)
- int binlen;
- register const u_char *binary;
- register char *ascii;
-{
- register int nib;
- int i;
- static char tmpbuf[255*3];
- char *start;
-
- if (ascii)
- start = ascii;
- else {
- ascii = tmpbuf;
- start = tmpbuf;
- }
-
- if (binlen > 255)
- binlen = 255;
-
- for (i = 0; i < binlen; i++) {
- nib = *binary >> 4;
- *ascii++ = nib + (nib < 10 ? '0' : '7');
- nib = *binary++ & 0x0f;
- *ascii++ = nib + (nib < 10 ? '0' : '7');
- if (((i % 2) == 0 && (i + 1) < binlen))
- *ascii++ = '.';
- }
- *ascii = '\0';
- return (start);
-}
diff --git a/c/src/exec/libnetworking/libc/rcmd.3 b/c/src/exec/libnetworking/libc/rcmd.3
deleted file mode 100644
index e25057fa4e..0000000000
--- a/c/src/exec/libnetworking/libc/rcmd.3
+++ /dev/null
@@ -1,204 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" From: @(#)rcmd.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd February 15, 1996
-.Dt RCMD 3
-.Os BSD 4.2
-.Sh NAME
-.Nm rcmd ,
-.Nm rresvport ,
-.Nm iruserok ,
-.Nm ruserok
-.Nd routines for returning a stream to a remote command
-.Sh SYNOPSIS
-.Fd #include <unistd.h>
-.Ft int
-.Fn rcmd "char **ahost" "int inport" "const char *locuser" "const char *remuser" "const char *cmd" "int *fd2p"
-.Ft int
-.Fn rresvport "int *port"
-.Ft int
-.Fn iruserok "u_long raddr" "int superuser" "const char *ruser" "const char *luser"
-.Ft int
-.Fn ruserok "const char *rhost" "int superuser" "const char *ruser" "const char *luser"
-.Sh DESCRIPTION
-The
-.Fn rcmd
-function
-is used by the super-user to execute a command on
-a remote machine using an authentication scheme based
-on reserved port numbers.
-The
-.Fn rresvport
-function
-returns a descriptor to a socket
-with an address in the privileged port space.
-The
-.Fn ruserok
-function
-is used by servers
-to authenticate clients requesting service with
-.Fn rcmd .
-All three functions are present in the same file and are used
-by the
-.Xr rshd 8
-server (among others).
-.Pp
-The
-.Fn rcmd
-function
-looks up the host
-.Fa *ahost
-using
-.Xr gethostbyname 3 ,
-returning \-1 if the host does not exist.
-Otherwise
-.Fa *ahost
-is set to the standard name of the host
-and a connection is established to a server
-residing at the well-known Internet port
-.Fa inport .
-.Pp
-If the connection succeeds,
-a socket in the Internet domain of type
-.Dv SOCK_STREAM
-is returned to the caller, and given to the remote
-command as
-.Em stdin
-and
-.Em stdout .
-If
-.Fa fd2p
-is non-zero, then an auxiliary channel to a control
-process will be set up, and a descriptor for it will be placed
-in
-.Fa *fd2p .
-The control process will return diagnostic
-output from the command (unit 2) on this channel, and will also
-accept bytes on this channel as being
-.Tn UNIX
-signal numbers, to be
-forwarded to the process group of the command.
-If
-.Fa fd2p
-is 0, then the
-.Em stderr
-(unit 2 of the remote
-command) will be made the same as the
-.Em stdout
-and no
-provision is made for sending arbitrary signals to the remote process,
-although you may be able to get its attention by using out-of-band data.
-.Pp
-The protocol is described in detail in
-.Xr rshd 8 .
-.Pp
-The
-.Fn rresvport
-function is used to obtain a socket with a privileged
-address bound to it. This socket is suitable for use
-by
-.Fn rcmd
-and several other functions. Privileged Internet ports are those
-in the range 0 to 1023. Only the super-user
-is allowed to bind an address of this sort to a socket.
-.Pp
-The
-.Fn iruserok
-and
-.Fn ruserok
-functions take a remote host's IP address or name, as returned by the
-.Xr gethostbyname 3
-routines, two user names and a flag indicating whether the local user's
-name is that of the super-user.
-Then, if the user is
-.Em NOT
-the super-user, it checks the
-.Pa /etc/hosts.equiv
-file.
-If that lookup is not done, or is unsuccessful, the
-.Pa .rhosts
-in the local user's home directory is checked to see if the request for
-service is allowed.
-.Pp
-If this file does not exist, is not a regular file, is owned by anyone
-other than the user or the super-user, or is writable by anyone other
-than the owner, the check automatically fails.
-Zero is returned if the machine name is listed in the
-.Dq Pa hosts.equiv
-file, or the host and remote user name are found in the
-.Dq Pa .rhosts
-file; otherwise
-.Fn iruserok
-and
-.Fn ruserok
-return \-1.
-If the local domain (as obtained from
-.Xr gethostname 3 )
-is the same as the remote domain, only the machine name need be specified.
-.Pp
-The
-.Fn iruserok
-function is strongly preferred for security reasons.
-It requires trusting the local DNS at most, while the
-.Fn ruserok
-function requires trusting the entire DNS, which can be spoofed.
-.Sh DIAGNOSTICS
-The
-.Fn rcmd
-function
-returns a valid socket descriptor on success.
-It returns \-1 on error and prints a diagnostic message on the standard error.
-.Pp
-The
-.Fn rresvport
-function
-returns a valid, bound socket descriptor on success.
-It returns \-1 on error with the global value
-.Va errno
-set according to the reason for failure.
-The error code
-.Dv EAGAIN
-is overloaded to mean ``All network ports in use.''
-.Sh SEE ALSO
-.Xr rlogin 1 ,
-.Xr rsh 1 ,
-.Xr intro 2 ,
-.Xr rexec 3 ,
-.Xr rexecd 8 ,
-.Xr rlogind 8 ,
-.Xr rshd 8
-.Sh HISTORY
-These
-functions appeared in
-.Bx 4.2 .
diff --git a/c/src/exec/libnetworking/libc/rcmd.c b/c/src/exec/libnetworking/libc/rcmd.c
deleted file mode 100644
index 32e4953e9b..0000000000
--- a/c/src/exec/libnetworking/libc/rcmd.c
+++ /dev/null
@@ -1,520 +0,0 @@
-/*
- * Copyright (c) 1983, 1993, 1994
- * 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <signal.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <unistd.h>
-#include <pwd.h>
-#include <errno.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-extern int innetgr __P(( const char *, const char *, const char *, const char * ));
-
-#define max(a, b) ((a > b) ? a : b)
-
-int __ivaliduser __P((FILE *, u_long, const char *, const char *));
-static int __icheckhost __P((u_long, char *));
-
-int
-rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
- char **ahost;
- u_short rport;
- const char *locuser, *remuser, *cmd;
- int *fd2p;
-{
- struct hostent *hp;
- struct sockaddr_in sin, from;
- fd_set reads;
- long oldmask;
- pid_t pid;
- int s, lport, timo;
- char c;
-
- pid = getpid();
- hp = gethostbyname(*ahost);
- if (hp == NULL) {
- herror(*ahost);
- return (-1);
- }
- *ahost = hp->h_name;
- oldmask = sigblock(sigmask(SIGURG));
- for (timo = 1, lport = IPPORT_RESERVED - 1;;) {
- s = rresvport(&lport);
- if (s < 0) {
- if (errno == EAGAIN)
- (void)fprintf(stderr,
- "rcmd: socket: All ports in use\n");
- else
- (void)fprintf(stderr, "rcmd: socket: %s\n",
- strerror(errno));
- sigsetmask(oldmask);
- return (-1);
- }
- fcntl(s, F_SETOWN, pid);
- bzero(&sin, sizeof sin);
- sin.sin_len = sizeof(struct sockaddr_in);
- sin.sin_family = hp->h_addrtype;
- sin.sin_port = rport;
- bcopy(hp->h_addr_list[0], &sin.sin_addr, MIN(hp->h_length, sizeof sin.sin_addr));
- if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
- break;
- (void)close(s);
- if (errno == EADDRINUSE) {
- lport--;
- continue;
- }
- if (errno == ECONNREFUSED && timo <= 16) {
- (void)sleep(timo);
- timo *= 2;
- continue;
- }
- if (hp->h_addr_list[1] != NULL) {
- int oerrno = errno;
-
- (void)fprintf(stderr, "connect to address %s: ",
- inet_ntoa(sin.sin_addr));
- errno = oerrno;
- perror(0);
- hp->h_addr_list++;
- bcopy(hp->h_addr_list[0], &sin.sin_addr, MIN(hp->h_length, sizeof sin.sin_addr));
- (void)fprintf(stderr, "Trying %s...\n",
- inet_ntoa(sin.sin_addr));
- continue;
- }
- (void)fprintf(stderr, "%s: %s\n", hp->h_name, strerror(errno));
- sigsetmask(oldmask);
- return (-1);
- }
- lport--;
- if (fd2p == 0) {
- write(s, "", 1);
- lport = 0;
- } else {
- char num[8];
- int s2 = rresvport(&lport), s3;
- int len = sizeof(from);
- int nfds;
-
- if (s2 < 0)
- goto bad;
- listen(s2, 1);
- (void)snprintf(num, sizeof(num), "%d", lport);
- if (write(s, num, strlen(num)+1) != strlen(num)+1) {
- (void)fprintf(stderr,
- "rcmd: write (setting up stderr): %s\n",
- strerror(errno));
- (void)close(s2);
- goto bad;
- }
- nfds = max(s, s2)+1;
- if(nfds > FD_SETSIZE) {
- fprintf(stderr, "rcmd: too many files\n");
- (void)close(s2);
- goto bad;
- }
-again:
- FD_ZERO(&reads);
- FD_SET(s, &reads);
- FD_SET(s2, &reads);
- errno = 0;
- if (select(nfds, &reads, 0, 0, 0) < 1 || !FD_ISSET(s2, &reads)){
- if (errno != 0)
- (void)fprintf(stderr,
- "rcmd: select (setting up stderr): %s\n",
- strerror(errno));
- else
- (void)fprintf(stderr,
- "select: protocol failure in circuit setup\n");
- (void)close(s2);
- goto bad;
- }
- s3 = accept(s2, (struct sockaddr *)&from, &len);
- /*
- * XXX careful for ftp bounce attacks. If discovered, shut them
- * down and check for the real auxiliary channel to connect.
- */
- if (from.sin_family == AF_INET && from.sin_port == htons(20)) {
- close(s3);
- goto again;
- }
- (void)close(s2);
- if (s3 < 0) {
- (void)fprintf(stderr,
- "rcmd: accept: %s\n", strerror(errno));
- lport = 0;
- goto bad;
- }
- *fd2p = s3;
- from.sin_port = ntohs((u_short)from.sin_port);
- if (from.sin_family != AF_INET ||
- from.sin_port >= IPPORT_RESERVED ||
- from.sin_port < IPPORT_RESERVED / 2) {
- (void)fprintf(stderr,
- "socket: protocol failure in circuit setup.\n");
- goto bad2;
- }
- }
- (void)write(s, locuser, strlen(locuser)+1);
- (void)write(s, remuser, strlen(remuser)+1);
- (void)write(s, cmd, strlen(cmd)+1);
- if (read(s, &c, 1) != 1) {
- (void)fprintf(stderr,
- "rcmd: %s: %s\n", *ahost, strerror(errno));
- goto bad2;
- }
- if (c != 0) {
- while (read(s, &c, 1) == 1) {
- (void)write(STDERR_FILENO, &c, 1);
- if (c == '\n')
- break;
- }
- goto bad2;
- }
- sigsetmask(oldmask);
- return (s);
-bad2:
- if (lport)
- (void)close(*fd2p);
-bad:
- (void)close(s);
- sigsetmask(oldmask);
- return (-1);
-}
-
-int
-rresvport(alport)
- int *alport;
-{
- struct sockaddr_in sin;
- int s;
-
- bzero(&sin, sizeof sin);
- sin.sin_len = sizeof(struct sockaddr_in);
- sin.sin_family = AF_INET;
- sin.sin_addr.s_addr = INADDR_ANY;
- s = socket(AF_INET, SOCK_STREAM, 0);
- if (s < 0)
- return (-1);
-#if 0 /* compat_exact_traditional_rresvport_semantics */
- sin.sin_port = htons((u_short)*alport);
- if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
- return (s);
- if (errno != EADDRINUSE) {
- (void)close(s);
- return (-1);
- }
-#endif
- sin.sin_port = 0;
- if (bindresvport(s, &sin) == -1) {
- (void)close(s);
- return (-1);
- }
- *alport = (int)ntohs(sin.sin_port);
- return (s);
-}
-
-int __check_rhosts_file = 1;
-char *__rcmd_errstr;
-
-int
-ruserok(rhost, superuser, ruser, luser)
- const char *rhost, *ruser, *luser;
- int superuser;
-{
- struct hostent *hp;
- u_long addr;
- char **ap;
-
- if ((hp = gethostbyname(rhost)) == NULL)
- return (-1);
- for (ap = hp->h_addr_list; *ap; ++ap) {
- bcopy(*ap, &addr, sizeof(addr));
- if (iruserok(addr, superuser, ruser, luser) == 0)
- return (0);
- }
- return (-1);
-}
-
-/*
- * New .rhosts strategy: We are passed an ip address. We spin through
- * hosts.equiv and .rhosts looking for a match. When the .rhosts only
- * has ip addresses, we don't have to trust a nameserver. When it
- * contains hostnames, we spin through the list of addresses the nameserver
- * gives us and look for a match.
- *
- * Returns 0 if ok, -1 if not ok.
- */
-int
-iruserok(raddr, superuser, ruser, luser)
- u_long raddr;
- int superuser;
- const char *ruser, *luser;
-{
- register char *cp;
- struct stat sbuf;
- struct passwd *pwd;
- FILE *hostf;
- uid_t uid;
- int first;
- char pbuf[MAXPATHLEN];
-
- first = 1;
- hostf = superuser ? NULL : fopen(_PATH_HEQUIV, "r");
-again:
- if (hostf) {
- if (__ivaliduser(hostf, raddr, luser, ruser) == 0) {
- (void)fclose(hostf);
- return (0);
- }
- (void)fclose(hostf);
- }
- if (first == 1 && (__check_rhosts_file || superuser)) {
- first = 0;
- if ((pwd = getpwnam(luser)) == NULL)
- return (-1);
- (void)strcpy(pbuf, pwd->pw_dir);
- (void)strcat(pbuf, "/.rhosts");
-
- /*
- * Change effective uid while opening .rhosts. If root and
- * reading an NFS mounted file system, can't read files that
- * are protected read/write owner only.
- */
- uid = geteuid();
- (void)seteuid(pwd->pw_uid);
- hostf = fopen(pbuf, "r");
- (void)seteuid(uid);
-
- if (hostf == NULL)
- return (-1);
- /*
- * If not a regular file, or is owned by someone other than
- * user or root or if writeable by anyone but the owner, quit.
- */
- cp = NULL;
- if (lstat(pbuf, &sbuf) < 0)
- cp = ".rhosts lstat failed";
- else if (!S_ISREG(sbuf.st_mode))
- cp = ".rhosts not regular file";
- else if (fstat(fileno(hostf), &sbuf) < 0)
- cp = ".rhosts fstat failed";
- else if (sbuf.st_uid && sbuf.st_uid != pwd->pw_uid)
- cp = "bad .rhosts owner";
- else if (sbuf.st_mode & (S_IWGRP|S_IWOTH))
- cp = ".rhosts writeable by other than owner";
- /* If there were any problems, quit. */
- if (cp) {
- __rcmd_errstr = cp;
- (void)fclose(hostf);
- return (-1);
- }
- goto again;
- }
- return (-1);
-}
-
-/*
- * XXX
- * Don't make static, used by lpd(8).
- *
- * Returns 0 if ok, -1 if not ok.
- */
-int
-__ivaliduser(hostf, raddr, luser, ruser)
- FILE *hostf;
- u_long raddr;
- const char *luser, *ruser;
-{
- register char *user, *p;
- int ch;
- char buf[MAXHOSTNAMELEN + 128]; /* host + login */
- char hname[MAXHOSTNAMELEN];
- struct hostent *hp;
- /* Presumed guilty until proven innocent. */
- int userok = 0, hostok = 0;
-#ifdef YP
- char *ypdomain;
-
- if (yp_get_default_domain(&ypdomain))
- ypdomain = NULL;
-#else
-#define ypdomain NULL
-#endif
- /* We need to get the damn hostname back for netgroup matching. */
- if ((hp = gethostbyaddr((char *)&raddr, sizeof(u_long),
- AF_INET)) == NULL)
- return (-1);
- strncpy(hname, hp->h_name, sizeof(hname));
- hname[sizeof(hname) - 1] = '\0';
-
- while (fgets(buf, sizeof(buf), hostf)) {
- p = buf;
- /* Skip lines that are too long. */
- if (strchr(p, '\n') == NULL) {
- while ((ch = getc(hostf)) != '\n' && ch != EOF);
- continue;
- }
- if (*p == '\n' || *p == '#') {
- /* comment... */
- continue;
- }
- while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') {
- *p = isupper(*p) ? tolower(*p) : *p;
- p++;
- }
- if (*p == ' ' || *p == '\t') {
- *p++ = '\0';
- while (*p == ' ' || *p == '\t')
- p++;
- user = p;
- while (*p != '\n' && *p != ' ' &&
- *p != '\t' && *p != '\0')
- p++;
- } else
- user = p;
- *p = '\0';
- /*
- * Do +/- and +@/-@ checking. This looks really nasty,
- * but it matches SunOS's behavior so far as I can tell.
- */
- switch(buf[0]) {
- case '+':
- if (!buf[1]) { /* '+' matches all hosts */
- hostok = 1;
- break;
- }
- if (buf[1] == '@') /* match a host by netgroup */
- hostok = innetgr((char *)&buf[2],
- (char *)&hname, NULL, ypdomain);
- else /* match a host by addr */
- hostok = __icheckhost(raddr,(char *)&buf[1]);
- break;
- case '-': /* reject '-' hosts and all their users */
- if (buf[1] == '@') {
- if (innetgr((char *)&buf[2],
- (char *)&hname, NULL, ypdomain))
- return(-1);
- } else {
- if (__icheckhost(raddr,(char *)&buf[1]))
- return(-1);
- }
- break;
- default: /* if no '+' or '-', do a simple match */
- hostok = __icheckhost(raddr, buf);
- break;
- }
- switch(*user) {
- case '+':
- if (!*(user+1)) { /* '+' matches all users */
- userok = 1;
- break;
- }
- if (*(user+1) == '@') /* match a user by netgroup */
- userok = innetgr(user+2, NULL, ruser, ypdomain);
- else /* match a user by direct specification */
- userok = !(strcmp(ruser, user+1));
- break;
- case '-': /* if we matched a hostname, */
- if (hostok) { /* check for user field rejections */
- if (!*(user+1))
- return(-1);
- if (*(user+1) == '@') {
- if (innetgr(user+2, NULL,
- ruser, ypdomain))
- return(-1);
- } else {
- if (!strcmp(ruser, user+1))
- return(-1);
- }
- }
- break;
- default: /* no rejections: try to match the user */
- if (hostok)
- userok = !(strcmp(ruser,*user ? user : luser));
- break;
- }
- if (hostok && userok)
- return(0);
- }
- return (-1);
-}
-
-/*
- * Returns "true" if match, 0 if no match.
- */
-static int
-__icheckhost(raddr, lhost)
- u_long raddr;
- register char *lhost;
-{
- register struct hostent *hp;
- register u_long laddr;
- register char **pp;
-
- /* Try for raw ip address first. */
- if (isdigit(*lhost) && (long)(laddr = inet_addr(lhost)) != -1)
- return (raddr == laddr);
-
- /* Better be a hostname. */
- if ((hp = gethostbyname(lhost)) == NULL)
- return (0);
-
- /* Spin through ip addresses. */
- for (pp = hp->h_addr_list; *pp; ++pp)
- if (!bcmp(&raddr, *pp, sizeof(u_long)))
- return (1);
-
- /* No match. */
- return (0);
-}
diff --git a/c/src/exec/libnetworking/libc/recv.c b/c/src/exec/libnetworking/libc/recv.c
deleted file mode 100644
index a842244caf..0000000000
--- a/c/src/exec/libnetworking/libc/recv.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)recv.c 8.2 (Berkeley) 2/21/94";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <stddef.h>
-
-ssize_t
-recv(s, buf, len, flags)
- int s, flags;
- size_t len;
- void *buf;
-{
- return (recvfrom(s, buf, len, flags, NULL, 0));
-}
diff --git a/c/src/exec/libnetworking/libc/res_comp.c b/c/src/exec/libnetworking/libc/res_comp.c
deleted file mode 100644
index 93043276f2..0000000000
--- a/c/src/exec/libnetworking/libc/res_comp.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright (c) 1985, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: res_comp.c,v 8.11 1997/05/21 19:31:04 halley Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#define BIND_4_COMPAT
-
-/*
- * Expand compressed domain name 'comp_dn' to full domain name.
- * 'msg' is a pointer to the begining of the message,
- * 'eomorig' points to the first location after the message,
- * 'exp_dn' is a pointer to a buffer of size 'length' for the result.
- * Return size of compressed name or -1 if there was an error.
- */
-int
-dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
- char *dst, int dstsiz)
-{
- int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);
-
- if (n > 0 && dst[0] == '.')
- dst[0] = '\0';
- return (n);
-}
-
-/*
- * Pack domain name 'exp_dn' in presentation form into 'comp_dn'.
- * Return the size of the compressed name or -1.
- * 'length' is the size of the array pointed to by 'comp_dn'.
- */
-int
-dn_comp(const char *src, u_char *dst, int dstsiz,
- u_char **dnptrs, u_char **lastdnptr)
-{
- return (ns_name_compress(src, dst, (size_t)dstsiz,
- (const u_char **)dnptrs,
- (const u_char **)lastdnptr));
-}
-
-/*
- * Skip over a compressed domain name. Return the size or -1.
- */
-int
-dn_skipname(const u_char *ptr, const u_char *eom) {
- const u_char *saveptr = ptr;
-
- if (ns_name_skip(&ptr, eom) == -1)
- return (-1);
- return (ptr - saveptr);
-}
-
-/*
- * Verify that a domain name uses an acceptable character set.
- */
-
-/*
- * Note the conspicuous absence of ctype macros in these definitions. On
- * non-ASCII hosts, we can't depend on string literals or ctype macros to
- * tell us anything about network-format data. The rest of the BIND system
- * is not careful about this, but for some reason, we're doing it right here.
- */
-#define PERIOD 0x2e
-#define hyphenchar(c) ((c) == 0x2d)
-#define bslashchar(c) ((c) == 0x5c)
-#define periodchar(c) ((c) == PERIOD)
-#define asterchar(c) ((c) == 0x2a)
-#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \
- || ((c) >= 0x61 && (c) <= 0x7a))
-#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
-
-#define borderchar(c) (alphachar(c) || digitchar(c))
-#define middlechar(c) (borderchar(c) || hyphenchar(c))
-#define domainchar(c) ((c) > 0x20 && (c) < 0x7f)
-
-int
-res_hnok(dn)
- const char *dn;
-{
- int ppch = '\0', pch = PERIOD, ch = *dn++;
-
- while (ch != '\0') {
- int nch = *dn++;
-
- if (periodchar(ch)) {
- (void)NULL;
- } else if (periodchar(pch)) {
- if (!borderchar(ch))
- return (0);
- } else if (periodchar(nch) || nch == '\0') {
- if (!borderchar(ch))
- return (0);
- } else {
- if (!middlechar(ch))
- return (0);
- }
- ppch = pch, pch = ch, ch = nch;
- }
- return (1);
-}
-
-/*
- * hostname-like (A, MX, WKS) owners can have "*" as their first label
- * but must otherwise be as a host name.
- */
-int
-res_ownok(dn)
- const char *dn;
-{
- if (asterchar(dn[0])) {
- if (periodchar(dn[1]))
- return (res_hnok(dn+2));
- if (dn[1] == '\0')
- return (1);
- }
- return (res_hnok(dn));
-}
-
-/*
- * SOA RNAMEs and RP RNAMEs can have any printable character in their first
- * label, but the rest of the name has to look like a host name.
- */
-int
-res_mailok(dn)
- const char *dn;
-{
- int ch, escaped = 0;
-
- /* "." is a valid missing representation */
- if (*dn == '\0')
- return (1);
-
- /* otherwise <label>.<hostname> */
- while ((ch = *dn++) != '\0') {
- if (!domainchar(ch))
- return (0);
- if (!escaped && periodchar(ch))
- break;
- if (escaped)
- escaped = 0;
- else if (bslashchar(ch))
- escaped = 1;
- }
- if (periodchar(ch))
- return (res_hnok(dn));
- return (0);
-}
-
-/*
- * This function is quite liberal, since RFC 1034's character sets are only
- * recommendations.
- */
-int
-res_dnok(dn)
- const char *dn;
-{
- int ch;
-
- while ((ch = *dn++) != '\0')
- if (!domainchar(ch))
- return (0);
- return (1);
-}
-
-#ifdef BIND_4_COMPAT
-/*
- * This module must export the following externally-visible symbols:
- * ___putlong
- * ___putshort
- * __getlong
- * __getshort
- * Note that one _ comes from C and the others come from us.
- */
-void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); }
-void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); }
-u_int32_t _getlong(const u_char *src) { return (ns_get32(src)); }
-u_int16_t _getshort(const u_char *src) { return (ns_get16(src)); }
-#endif /*BIND_4_COMPAT*/
diff --git a/c/src/exec/libnetworking/libc/res_config.h b/c/src/exec/libnetworking/libc/res_config.h
deleted file mode 100644
index 57ec414226..0000000000
--- a/c/src/exec/libnetworking/libc/res_config.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * $Id$
- */
-
-#define DEBUG 1 /* enable debugging code (needed for dig) */
-#define RESOLVSORT /* allow sorting of addresses in gethostbyname */
-#define RFC1535 /* comply with RFC1535 (STRONGLY reccomended by vixie)*/
-#undef USELOOPBACK /* res_init() bind to localhost */
-#undef SUNSECURITY /* verify gethostbyaddr() calls - WE DONT NEED IT */
-#define MULTI_PTRS_ARE_ALIASES 1 /* fold multiple PTR records into aliases */
-#define CHECK_SRVR_ADDR 1 /* confirm that the server requested sent the reply */
-#define BIND_UPDATE 1 /* update support */
-
-#if defined(__rtems__)
-u_int16_t _getshort(const u_char *src);
-u_int32_t _getlong(const u_char *src);
-int gethostname (char *name, int namelen);
-int sethostname (char *name, int namelen);
-int issetugid (void);
-#endif
diff --git a/c/src/exec/libnetworking/libc/res_data.c b/c/src/exec/libnetworking/libc/res_data.c
deleted file mode 100644
index fb7d2c66eb..0000000000
--- a/c/src/exec/libnetworking/libc/res_data.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 1995,1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "res_config.h"
-
-const char *_res_opcodes[] = {
- "QUERY",
- "IQUERY",
- "CQUERYM",
- "CQUERYU", /* experimental */
- "NOTIFY", /* experimental */
- "UPDATE",
- "6",
- "7",
- "8",
- "9",
- "10",
- "11",
- "12",
- "13",
- "ZONEINIT",
- "ZONEREF",
-};
-
-const char *_res_resultcodes[] = {
- "NOERROR",
- "FORMERR",
- "SERVFAIL",
- "NXDOMAIN",
- "NOTIMP",
- "REFUSED",
- "YXDOMAIN",
- "YXRRSET",
- "NXRRSET",
- "NOTAUTH",
- "ZONEERR",
- "11",
- "12",
- "13",
- "14",
- "NOCHANGE",
-};
-
-#ifdef BIND_UPDATE
-const char *_res_sectioncodes[] = {
- "ZONE",
- "PREREQUISITES",
- "UPDATE",
- "ADDITIONAL",
-};
-#endif
diff --git a/c/src/exec/libnetworking/libc/res_debug.c b/c/src/exec/libnetworking/libc/res_debug.c
deleted file mode 100644
index b747b6e6d2..0000000000
--- a/c/src/exec/libnetworking/libc/res_debug.c
+++ /dev/null
@@ -1,966 +0,0 @@
-/*
- * Copyright (c) 1985
- * 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1995 by International Business Machines, Inc.
- *
- * International Business Machines, Inc. (hereinafter called IBM) grants
- * permission under its copyrights to use, copy, modify, and distribute this
- * Software with or without fee, provided that the above copyright notice and
- * all paragraphs of this notice appear in all copies, and that the name of IBM
- * not be used in connection with the marketing of any product incorporating
- * the Software or modifications thereof, without specific, written prior
- * permission.
- *
- * To the extent it has a right to do so, IBM grants an immunity from suit
- * under its patents, if any, for the use, sale or manufacture of products to
- * the extent that such products are used for performing Domain Name System
- * dynamic updates in TCP/IP networks by means of the Software. No immunity is
- * granted for any product per se or for any other function of any product.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <math.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#define SPRINTF(x) sprintf x
-
-extern const char *_res_opcodes[];
-extern const char *_res_resultcodes[];
-extern const char *_res_sectioncodes[];
-
-/*
- * Print the current options.
- */
-void
-fp_resstat(struct __res_state *statp, FILE *file) {
- u_long mask;
-
- fprintf(file, ";; res options:");
- if (!statp)
- statp = &_res;
- for (mask = 1; mask != 0; mask <<= 1)
- if (statp->options & mask)
- fprintf(file, " %s", p_option(mask));
- putc('\n', file);
-}
-
-static void
-do_section(ns_msg *handle, ns_sect section, int pflag, FILE *file) {
- int n, sflag, rrnum;
- char buf[2048]; /* XXX need to malloc */
- ns_opcode opcode;
- ns_rr rr;
-
- /*
- * Print answer records.
- */
- sflag = (_res.pfcode & pflag);
- if (_res.pfcode && !sflag)
- return;
-
- opcode = ns_msg_getflag(*handle, ns_f_opcode);
- rrnum = 0;
- for (;;) {
- if (ns_parserr(handle, section, rrnum, &rr)) {
- if (errno != ENODEV)
- fprintf(file, ";; ns_parserr: %s\n",
- strerror(errno));
- else if (rrnum > 0 && sflag != 0 &&
- (_res.pfcode & RES_PRF_HEAD1))
- putc('\n', file);
- return;
- }
- if (rrnum == 0 && sflag != 0 && (_res.pfcode & RES_PRF_HEAD1))
- fprintf(file, ";; %s SECTION:\n",
- p_section(section, opcode));
- if (section == ns_s_qd)
- fprintf(file, ";;\t%s, type = %s, class = %s\n",
- ns_rr_name(rr),
- p_type(ns_rr_type(rr)),
- p_class(ns_rr_class(rr)));
- else {
- n = ns_sprintrr(handle, &rr, NULL, NULL,
- buf, sizeof buf);
- if (n < 0) {
- fprintf(file, ";; ns_sprintrr: %s\n",
- strerror(errno));
- return;
- }
- fputs(buf, file);
- fputc('\n', file);
- }
- rrnum++;
- }
-}
-
-void
-p_query(const u_char *msg) {
- fp_query(msg, stdout);
-}
-
-void
-fp_query(const u_char *msg, FILE *file) {
- fp_nquery(msg, PACKETSZ, file);
-}
-
-/*
- * Print the contents of a query.
- * This is intended to be primarily a debugging routine.
- */
-void
-fp_nquery(const u_char *msg, int len, FILE *file) {
- ns_msg handle;
- int qdcount, ancount, nscount, arcount;
- u_int opcode, rcode, id;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1)
- return;
-
- if (ns_initparse(msg, len, &handle) < 0) {
- fprintf(file, ";; ns_initparse: %s\n", strerror(errno));
- return;
- }
- opcode = ns_msg_getflag(handle, ns_f_opcode);
- rcode = ns_msg_getflag(handle, ns_f_rcode);
- id = ns_msg_id(handle);
- qdcount = ns_msg_count(handle, ns_s_qd);
- ancount = ns_msg_count(handle, ns_s_an);
- nscount = ns_msg_count(handle, ns_s_ns);
- arcount = ns_msg_count(handle, ns_s_ar);
-
- /*
- * Print header fields.
- */
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEADX) || rcode)
- fprintf(file,
- ";; ->>HEADER<<- opcode: %s, status: %s, id: %d\n",
- _res_opcodes[opcode], _res_resultcodes[rcode], id);
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEADX))
- putc(';', file);
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEAD2)) {
- fprintf(file, "; flags:");
- if (ns_msg_getflag(handle, ns_f_qr))
- fprintf(file, " qr");
- if (ns_msg_getflag(handle, ns_f_aa))
- fprintf(file, " aa");
- if (ns_msg_getflag(handle, ns_f_tc))
- fprintf(file, " tc");
- if (ns_msg_getflag(handle, ns_f_rd))
- fprintf(file, " rd");
- if (ns_msg_getflag(handle, ns_f_ra))
- fprintf(file, " ra");
- if (ns_msg_getflag(handle, ns_f_z))
- fprintf(file, " ??");
- if (ns_msg_getflag(handle, ns_f_ad))
- fprintf(file, " ad");
- if (ns_msg_getflag(handle, ns_f_cd))
- fprintf(file, " cd");
- }
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEAD1)) {
- fprintf(file, "; %s: %d",
- p_section(ns_s_qd, opcode), qdcount);
- fprintf(file, ", %s: %d",
- p_section(ns_s_an, opcode), ancount);
- fprintf(file, ", %s: %d",
- p_section(ns_s_ns, opcode), nscount);
- fprintf(file, ", %s: %d",
- p_section(ns_s_ar, opcode), arcount);
- }
- if ((!_res.pfcode) || (_res.pfcode &
- (RES_PRF_HEADX | RES_PRF_HEAD2 | RES_PRF_HEAD1))) {
- putc('\n',file);
- }
- /*
- * Print the various sections.
- */
- do_section(&handle, ns_s_qd, RES_PRF_QUES, file);
- do_section(&handle, ns_s_an, RES_PRF_ANS, file);
- do_section(&handle, ns_s_ns, RES_PRF_AUTH, file);
- do_section(&handle, ns_s_ar, RES_PRF_ADD, file);
- if (qdcount == 0 && ancount == 0 &&
- nscount == 0 && arcount == 0)
- putc('\n', file);
-}
-
-const u_char *
-p_cdnname(const u_char *cp, const u_char *msg, int len, FILE *file) {
- char name[MAXDNAME];
- int n;
-
- if ((n = dn_expand(msg, msg + len, cp, name, sizeof name)) < 0)
- return (NULL);
- if (name[0] == '\0')
- putc('.', file);
- else
- fputs(name, file);
- return (cp + n);
-}
-
-const u_char *
-p_cdname(const u_char *cp, const u_char *msg, FILE *file) {
- return (p_cdnname(cp, msg, PACKETSZ, file));
-}
-
-/* Return a fully-qualified domain name from a compressed name (with
- length supplied). */
-
-const u_char *
-p_fqnname(cp, msg, msglen, name, namelen)
- const u_char *cp, *msg;
- int msglen;
- char *name;
- int namelen;
-{
- int n, newlen;
-
- if ((n = dn_expand(msg, cp + msglen, cp, name, namelen)) < 0)
- return (NULL);
- newlen = strlen(name);
- if (newlen == 0 || name[newlen - 1] != '.') {
- if (newlen + 1 >= namelen) /* Lack space for final dot */
- return (NULL);
- else
- strcpy(name + newlen, ".");
- }
- return (cp + n);
-}
-
-/* XXX: the rest of these functions need to become length-limited, too. */
-
-const u_char *
-p_fqname(const u_char *cp, const u_char *msg, FILE *file) {
- char name[MAXDNAME];
- const u_char *n;
-
- n = p_fqnname(cp, msg, MAXCDNAME, name, sizeof name);
- if (n == NULL)
- return (NULL);
- fputs(name, file);
- return (n);
-}
-
-/*
- * Names of RR classes and qclasses. Classes and qclasses are the same, except
- * that C_ANY is a qclass but not a class. (You can ask for records of class
- * C_ANY, but you can't have any records of that class in the database.)
- */
-const struct res_sym __p_class_syms[] = {
- {C_IN, "IN"},
- {C_CHAOS, "CHAOS"},
- {C_HS, "HS"},
- {C_HS, "HESIOD"},
- {C_ANY, "ANY"},
- {C_NONE, "NONE"},
- {C_IN, (char *)0}
-};
-
-/*
- * Names of message sections.
- */
-const struct res_sym __p_default_section_syms[] = {
- {ns_s_qd, "QUERY"},
- {ns_s_an, "ANSWER"},
- {ns_s_ns, "AUTHORITY"},
- {ns_s_ar, "ADDITIONAL"},
- {0, (char *)0}
-};
-
-const struct res_sym __p_update_section_syms[] = {
- {S_ZONE, "ZONE"},
- {S_PREREQ, "PREREQUISITE"},
- {S_UPDATE, "UPDATE"},
- {S_ADDT, "ADDITIONAL"},
- {0, (char *)0}
-};
-
-/*
- * Names of RR types and qtypes. Types and qtypes are the same, except
- * that T_ANY is a qtype but not a type. (You can ask for records of type
- * T_ANY, but you can't have any records of that type in the database.)
- */
-const struct res_sym __p_type_syms[] = {
- {T_A, "A", "address"},
- {T_NS, "NS", "name server"},
- {T_MD, "MD", "mail destination (deprecated)"},
- {T_MF, "MF", "mail forwarder (deprecated)"},
- {T_CNAME, "CNAME", "canonical name"},
- {T_SOA, "SOA", "start of authority"},
- {T_MB, "MB", "mailbox"},
- {T_MG, "MG", "mail group member"},
- {T_MR, "MR", "mail rename"},
- {T_NULL, "NULL", "null"},
- {T_WKS, "WKS", "well-known service (deprecated)"},
- {T_PTR, "PTR", "domain name pointer"},
- {T_HINFO, "HINFO", "host information"},
- {T_MINFO, "MINFO", "mailbox information"},
- {T_MX, "MX", "mail exchanger"},
- {T_TXT, "TXT", "text"},
- {T_RP, "RP", "responsible person"},
- {T_AFSDB, "AFSDB", "DCE or AFS server"},
- {T_X25, "X25", "X25 address"},
- {T_ISDN, "ISDN", "ISDN address"},
- {T_RT, "RT", "router"},
- {T_NSAP, "NSAP", "nsap address"},
- {T_NSAP_PTR, "NSAP_PTR", "domain name pointer"},
- {T_SIG, "SIG", "signature"},
- {T_KEY, "KEY", "key"},
- {T_PX, "PX", "mapping information"},
- {T_GPOS, "GPOS", "geographical position (withdrawn)"},
- {T_AAAA, "AAAA", "IPv6 address"},
- {T_LOC, "LOC", "location"},
- {T_NXT, "NXT", "next valid name (unimplemented)"},
- {T_EID, "EID", "endpoint identifier (unimplemented)"},
- {T_NIMLOC, "NIMLOC", "NIMROD locator (unimplemented)"},
- {T_SRV, "SRV", "server selection"},
- {T_ATMA, "ATMA", "ATM address (unimplemented)"},
- {T_IXFR, "IXFR", "incremental zone transfer"},
- {T_AXFR, "AXFR", "zone transfer"},
- {T_MAILB, "MAILB", "mailbox-related data (deprecated)"},
- {T_MAILA, "MAILA", "mail agent (deprecated)"},
- {T_NAPTR, "NAPTR", "URN Naming Authority"},
- {T_ANY, "ANY", "\"any\""},
- {0, NULL, NULL}
-};
-
-int
-sym_ston(const struct res_sym *syms, const char *name, int *success) {
- for ((void)NULL; syms->name != 0; syms++) {
- if (strcasecmp (name, syms->name) == 0) {
- if (success)
- *success = 1;
- return (syms->number);
- }
- }
- if (success)
- *success = 0;
- return (syms->number); /* The default value. */
-}
-
-const char *
-sym_ntos(const struct res_sym *syms, int number, int *success) {
- static char unname[20];
-
- for ((void)NULL; syms->name != 0; syms++) {
- if (number == syms->number) {
- if (success)
- *success = 1;
- return (syms->name);
- }
- }
-
- sprintf(unname, "%d", number);
- if (success)
- *success = 0;
- return (unname);
-}
-
-const char *
-sym_ntop(const struct res_sym *syms, int number, int *success) {
- static char unname[20];
-
- for ((void)NULL; syms->name != 0; syms++) {
- if (number == syms->number) {
- if (success)
- *success = 1;
- return (syms->humanname);
- }
- }
- sprintf(unname, "%d", number);
- if (success)
- *success = 0;
- return (unname);
-}
-
-/*
- * Return a string for the type.
- */
-const char *
-p_type(int type) {
- return (sym_ntos(__p_type_syms, type, (int *)0));
-}
-
-/*
- * Return a string for the type.
- */
-const char *
-p_section(int section, int opcode) {
- const struct res_sym *symbols;
-
- switch (opcode) {
- case ns_o_update:
- symbols = __p_update_section_syms;
- break;
- default:
- symbols = __p_default_section_syms;
- break;
- }
- return (sym_ntos(symbols, section, (int *)0));
-}
-
-/*
- * Return a mnemonic for class.
- */
-const char *
-p_class(int class) {
- return (sym_ntos(__p_class_syms, class, (int *)0));
-}
-
-/*
- * Return a mnemonic for an option
- */
-const char *
-p_option(u_long option) {
- static char nbuf[40];
-
- switch (option) {
- case RES_INIT: return "init";
- case RES_DEBUG: return "debug";
- case RES_AAONLY: return "aaonly(unimpl)";
- case RES_USEVC: return "usevc";
- case RES_PRIMARY: return "primry(unimpl)";
- case RES_IGNTC: return "igntc";
- case RES_RECURSE: return "recurs";
- case RES_DEFNAMES: return "defnam";
- case RES_STAYOPEN: return "styopn";
- case RES_DNSRCH: return "dnsrch";
- case RES_INSECURE1: return "insecure1";
- case RES_INSECURE2: return "insecure2";
- default: sprintf(nbuf, "?0x%lx?", (u_long)option);
- return (nbuf);
- }
-}
-
-/*
- * Return a mnemonic for a time to live.
- */
-const char *
-p_time(u_int32_t value) {
- static char nbuf[40];
-
- if (ns_format_ttl(value, nbuf, sizeof nbuf) < 0)
- sprintf(nbuf, "%u", value);
- return (nbuf);
-}
-
-
-/*
- * routines to convert between on-the-wire RR format and zone file format.
- * Does not contain conversion to/from decimal degrees; divide or multiply
- * by 60*60*1000 for that.
- */
-
-static unsigned int poweroften[10] = {1, 10, 100, 1000, 10000, 100000,
- 1000000,10000000,100000000,1000000000};
-
-/* takes an XeY precision/size value, returns a string representation. */
-static const char *
-precsize_ntoa(prec)
- u_int8_t prec;
-{
- static char retbuf[sizeof "90000000.00"];
- unsigned long val;
- int mantissa, exponent;
-
- mantissa = (int)((prec >> 4) & 0x0f) % 10;
- exponent = (int)((prec >> 0) & 0x0f) % 10;
-
- val = mantissa * poweroften[exponent];
-
- (void) sprintf(retbuf, "%ld.%.2ld", val/100, val%100);
- return (retbuf);
-}
-
-/* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */
-static u_int8_t
-precsize_aton(strptr)
- char **strptr;
-{
- unsigned int mval = 0, cmval = 0;
- u_int8_t retval = 0;
- char *cp;
- int exponent;
- int mantissa;
-
- cp = *strptr;
-
- while (isdigit((int)*cp))
- mval = mval * 10 + (*cp++ - '0');
-
- if (*cp == '.') { /* centimeters */
- cp++;
- if (isdigit((int)*cp)) {
- cmval = (*cp++ - '0') * 10;
- if (isdigit((int)*cp)) {
- cmval += (*cp++ - '0');
- }
- }
- }
- cmval = (mval * 100) + cmval;
-
- for (exponent = 0; exponent < 9; exponent++)
- if (cmval < poweroften[exponent+1])
- break;
-
- mantissa = cmval / poweroften[exponent];
- if (mantissa > 9)
- mantissa = 9;
-
- retval = (mantissa << 4) | exponent;
-
- *strptr = cp;
-
- return (retval);
-}
-
-/* converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer. */
-static u_int32_t
-latlon2ul(latlonstrptr,which)
- char **latlonstrptr;
- int *which;
-{
- char *cp;
- u_int32_t retval;
- int deg = 0, min = 0, secs = 0, secsfrac = 0;
-
- cp = *latlonstrptr;
-
- while (isdigit((int)*cp))
- deg = deg * 10 + (*cp++ - '0');
-
- while (isspace((int)*cp))
- cp++;
-
- if (!(isdigit((int)*cp)))
- goto fndhemi;
-
- while (isdigit((int)*cp))
- min = min * 10 + (*cp++ - '0');
-
- while (isspace((int)*cp))
- cp++;
-
- if (!(isdigit((int)*cp)))
- goto fndhemi;
-
- while (isdigit((int)*cp))
- secs = secs * 10 + (*cp++ - '0');
-
- if (*cp == '.') { /* decimal seconds */
- cp++;
- if (isdigit((int)*cp)) {
- secsfrac = (*cp++ - '0') * 100;
- if (isdigit((int)*cp)) {
- secsfrac += (*cp++ - '0') * 10;
- if (isdigit((int)*cp)) {
- secsfrac += (*cp++ - '0');
- }
- }
- }
- }
-
- while (!isspace((int)*cp)) /* if any trailing garbage */
- cp++;
-
- while (isspace((int)*cp))
- cp++;
-
- fndhemi:
- switch (*cp) {
- case 'N': case 'n':
- case 'E': case 'e':
- retval = ((unsigned)1<<31)
- + (((((deg * 60) + min) * 60) + secs) * 1000)
- + secsfrac;
- break;
- case 'S': case 's':
- case 'W': case 'w':
- retval = ((unsigned)1<<31)
- - (((((deg * 60) + min) * 60) + secs) * 1000)
- - secsfrac;
- break;
- default:
- retval = 0; /* invalid value -- indicates error */
- break;
- }
-
- switch (*cp) {
- case 'N': case 'n':
- case 'S': case 's':
- *which = 1; /* latitude */
- break;
- case 'E': case 'e':
- case 'W': case 'w':
- *which = 2; /* longitude */
- break;
- default:
- *which = 0; /* error */
- break;
- }
-
- cp++; /* skip the hemisphere */
-
- while (!isspace((int)*cp)) /* if any trailing garbage */
- cp++;
-
- while (isspace((int)*cp)) /* move to next field */
- cp++;
-
- *latlonstrptr = cp;
-
- return (retval);
-}
-
-/* converts a zone file representation in a string to an RDATA on-the-wire
- * representation. */
-int
-loc_aton(ascii, binary)
- const char *ascii;
- u_char *binary;
-{
- const char *cp, *maxcp;
- u_char *bcp;
-
- u_int32_t latit = 0, longit = 0, alt = 0;
- u_int32_t lltemp1 = 0, lltemp2 = 0;
- int altmeters = 0, altfrac = 0, altsign = 1;
- u_int8_t hp = 0x16; /* default = 1e6 cm = 10000.00m = 10km */
- u_int8_t vp = 0x13; /* default = 1e3 cm = 10.00m */
- u_int8_t siz = 0x12; /* default = 1e2 cm = 1.00m */
- int which1 = 0, which2 = 0;
-
- cp = ascii;
- maxcp = cp + strlen(ascii);
-
- lltemp1 = latlon2ul(&cp, &which1);
-
- lltemp2 = latlon2ul(&cp, &which2);
-
- switch (which1 + which2) {
- case 3: /* 1 + 2, the only valid combination */
- if ((which1 == 1) && (which2 == 2)) { /* normal case */
- latit = lltemp1;
- longit = lltemp2;
- } else if ((which1 == 2) && (which2 == 1)) { /* reversed */
- longit = lltemp1;
- latit = lltemp2;
- } else { /* some kind of brokenness */
- return (0);
- }
- break;
- default: /* we didn't get one of each */
- return (0);
- }
-
- /* altitude */
- if (*cp == '-') {
- altsign = -1;
- cp++;
- }
-
- if (*cp == '+')
- cp++;
-
- while (isdigit((int)*cp))
- altmeters = altmeters * 10 + (*cp++ - '0');
-
- if (*cp == '.') { /* decimal meters */
- cp++;
- if (isdigit((int)*cp)) {
- altfrac = (*cp++ - '0') * 10;
- if (isdigit((int)*cp)) {
- altfrac += (*cp++ - '0');
- }
- }
- }
-
- alt = (10000000 + (altsign * (altmeters * 100 + altfrac)));
-
- while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
- cp++;
-
- while (isspace((int)*cp) && (cp < maxcp))
- cp++;
-
- if (cp >= maxcp)
- goto defaults;
-
- siz = precsize_aton(&cp);
-
- while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
- cp++;
-
- while (isspace((int)*cp) && (cp < maxcp))
- cp++;
-
- if (cp >= maxcp)
- goto defaults;
-
- hp = precsize_aton(&cp);
-
- while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
- cp++;
-
- while (isspace((int)*cp) && (cp < maxcp))
- cp++;
-
- if (cp >= maxcp)
- goto defaults;
-
- vp = precsize_aton(&cp);
-
- defaults:
-
- bcp = binary;
- *bcp++ = (u_int8_t) 0; /* version byte */
- *bcp++ = siz;
- *bcp++ = hp;
- *bcp++ = vp;
- PUTLONG(latit,bcp);
- PUTLONG(longit,bcp);
- PUTLONG(alt,bcp);
-
- return (16); /* size of RR in octets */
-}
-
-/* takes an on-the-wire LOC RR and formats it in a human readable format. */
-const char *
-loc_ntoa(binary, ascii)
- const u_char *binary;
- char *ascii;
-{
- static char *error = "?";
- const u_char *cp = binary;
-
- int latdeg, latmin, latsec, latsecfrac;
- int longdeg, longmin, longsec, longsecfrac;
- char northsouth, eastwest;
- int altmeters, altfrac, altsign;
-
- const u_int32_t referencealt = 100000 * 100;
-
- int32_t latval, longval, altval;
- u_int32_t templ;
- u_int8_t sizeval, hpval, vpval, versionval;
-
- char *sizestr, *hpstr, *vpstr;
-
- versionval = *cp++;
-
- if (versionval) {
- (void) sprintf(ascii, "; error: unknown LOC RR version");
- return (ascii);
- }
-
- sizeval = *cp++;
-
- hpval = *cp++;
- vpval = *cp++;
-
- GETLONG(templ, cp);
- latval = (templ - ((unsigned)1<<31));
-
- GETLONG(templ, cp);
- longval = (templ - ((unsigned)1<<31));
-
- GETLONG(templ, cp);
- if (templ < referencealt) { /* below WGS 84 spheroid */
- altval = referencealt - templ;
- altsign = -1;
- } else {
- altval = templ - referencealt;
- altsign = 1;
- }
-
- if (latval < 0) {
- northsouth = 'S';
- latval = -latval;
- } else
- northsouth = 'N';
-
- latsecfrac = latval % 1000;
- latval = latval / 1000;
- latsec = latval % 60;
- latval = latval / 60;
- latmin = latval % 60;
- latval = latval / 60;
- latdeg = latval;
-
- if (longval < 0) {
- eastwest = 'W';
- longval = -longval;
- } else
- eastwest = 'E';
-
- longsecfrac = longval % 1000;
- longval = longval / 1000;
- longsec = longval % 60;
- longval = longval / 60;
- longmin = longval % 60;
- longval = longval / 60;
- longdeg = longval;
-
- altfrac = altval % 100;
- altmeters = (altval / 100) * altsign;
-
- if ((sizestr = strdup(precsize_ntoa(sizeval))) == NULL)
- sizestr = error;
- if ((hpstr = strdup(precsize_ntoa(hpval))) == NULL)
- hpstr = error;
- if ((vpstr = strdup(precsize_ntoa(vpval))) == NULL)
- vpstr = error;
-
- sprintf(ascii,
- "%d %.2d %.2d.%.3d %c %d %.2d %.2d.%.3d %c %d.%.2dm %sm %sm %sm",
- latdeg, latmin, latsec, latsecfrac, northsouth,
- longdeg, longmin, longsec, longsecfrac, eastwest,
- altmeters, altfrac, sizestr, hpstr, vpstr);
-
- if (sizestr != error)
- free(sizestr);
- if (hpstr != error)
- free(hpstr);
- if (vpstr != error)
- free(vpstr);
-
- return (ascii);
-}
-
-
-/* Return the number of DNS hierarchy levels in the name. */
-int
-dn_count_labels(const char *name) {
- int i, len, count;
-
- len = strlen(name);
- for (i = 0, count = 0; i < len; i++) {
- /* XXX need to check for \. or use named's nlabels(). */
- if (name[i] == '.')
- count++;
- }
-
- /* don't count initial wildcard */
- if (name[0] == '*')
- if (count)
- count--;
-
- /* don't count the null label for root. */
- /* if terminating '.' not found, must adjust */
- /* count to include last label */
- if (len > 0 && name[len-1] != '.')
- count++;
- return (count);
-}
-
-
-/*
- * Make dates expressed in seconds-since-Jan-1-1970 easy to read.
- * SIG records are required to be printed like this, by the Secure DNS RFC.
- */
-char *
-p_secstodate (u_long secs) {
- static char output[15]; /* YYYYMMDDHHMMSS and null */
- time_t clock = secs;
- struct tm *time;
-
- time = gmtime(&clock);
- time->tm_year += 1900;
- time->tm_mon += 1;
- sprintf(output, "%04d%02d%02d%02d%02d%02d",
- time->tm_year, time->tm_mon, time->tm_mday,
- time->tm_hour, time->tm_min, time->tm_sec);
- return (output);
-}
diff --git a/c/src/exec/libnetworking/libc/res_init.c b/c/src/exec/libnetworking/libc/res_init.c
deleted file mode 100644
index 9371e9fa82..0000000000
--- a/c/src/exec/libnetworking/libc/res_init.c
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
- * Copyright (c) 1985, 1989, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
-static char orig_rcsid[] = "From: Id: res_init.c,v 8.7 1996/11/18 09:10:04 vixie Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "res_config.h"
-
-static void res_setoptions __P((char *, char *));
-
-#ifdef RESOLVSORT
-static const char sort_mask[] = "/&";
-#define ISSORTMASK(ch) (strchr(sort_mask, ch) != NULL)
-static u_int32_t net_mask __P((struct in_addr));
-#endif
-
-#if !defined(isascii) /* XXX - could be a function */
-# define isascii(c) (!(c & 0200))
-#endif
-
-/*
- * Resolver state default settings.
- */
-
-struct __res_state _res
-# if defined(__BIND_RES_TEXT)
- = { RES_TIMEOUT, } /* Motorola, et al. */
-# endif
- ;
-
-
-/*
- * Set up default settings. If the configuration file exist, the values
- * there will have precedence. Otherwise, the server address is set to
- * INADDR_ANY and the default domain name comes from the gethostname().
- *
- * An interrim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1
- * rather than INADDR_ANY ("0.0.0.0") as the default name server address
- * since it was noted that INADDR_ANY actually meant ``the first interface
- * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface,
- * it had to be "up" in order for you to reach your own name server. It
- * was later decided that since the recommended practice is to always
- * install local static routes through 127.0.0.1 for all your network
- * interfaces, that we could solve this problem without a code change.
- *
- * The configuration file should always be used, since it is the only way
- * to specify a default domain. If you are running a server on your local
- * machine, you should say "nameserver 0.0.0.0" or "nameserver 127.0.0.1"
- * in the configuration file.
- *
- * Return 0 if completes successfully, -1 on error
- */
-int
-res_init()
-{
- register FILE *fp;
- register char *cp, **pp;
- register int n;
- char buf[MAXDNAME];
- int nserv = 0; /* number of nameserver records read from file */
- int haveenv = 0;
- int havesearch = 0;
-#ifdef RESOLVSORT
- int nsort = 0;
- char *net;
-#endif
-#ifndef RFC1535
- int dots;
-#endif
-
- /*
- * These three fields used to be statically initialized. This made
- * it hard to use this code in a shared library. It is necessary,
- * now that we're doing dynamic initialization here, that we preserve
- * the old semantics: if an application modifies one of these three
- * fields of _res before res_init() is called, res_init() will not
- * alter them. Of course, if an application is setting them to
- * _zero_ before calling res_init(), hoping to override what used
- * to be the static default, we can't detect it and unexpected results
- * will follow. Zero for any of these fields would make no sense,
- * so one can safely assume that the applications were already getting
- * unexpected results.
- *
- * _res.options is tricky since some apps were known to diddle the bits
- * before res_init() was first called. We can't replicate that semantic
- * with dynamic initialization (they may have turned bits off that are
- * set in RES_DEFAULT). Our solution is to declare such applications
- * "broken". They could fool us by setting RES_INIT but none do (yet).
- */
- if (!_res.retrans)
- _res.retrans = RES_TIMEOUT;
- if (!_res.retry)
- _res.retry = 4;
- if (!(_res.options & RES_INIT))
- _res.options = RES_DEFAULT;
-
- /*
- * This one used to initialize implicitly to zero, so unless the app
- * has set it to something in particular, we can randomize it now.
- */
- if (!_res.id)
- _res.id = res_randomid();
-
-#ifdef USELOOPBACK
- _res.nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
-#else
- _res.nsaddr.sin_addr.s_addr = INADDR_ANY;
-#endif
- _res.nsaddr.sin_family = AF_INET;
- _res.nsaddr.sin_port = htons(NAMESERVER_PORT);
- _res.nscount = 1;
- _res.ndots = 1;
- _res.pfcode = 0;
-
- /*
- * RTEMS -- Set up name servers
- */
- {
-#include <rtems/rtems_bsdnet_internal.h>
- int n = 0;
- while ((n < rtems_bsdnet_nameserver_count) && (nserv < MAXNS)) {
- _res.nsaddr_list[nserv].sin_addr = rtems_bsdnet_nameserver[n];
- _res.nsaddr_list[nserv].sin_family = AF_INET;
- _res.nsaddr_list[nserv].sin_port = htons(NAMESERVER_PORT);
- nserv++;
- n++;
- }
- if (rtems_bsdnet_domain_name)
- (void)strncpy(_res.defdname, rtems_bsdnet_domain_name, sizeof(_res.defdname) - 1);
- }
-
- /* Allow user to override the local domain definition */
- if ((cp = getenv("LOCALDOMAIN")) != NULL) {
- (void)strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
- haveenv++;
-
- /*
- * Set search list to be blank-separated strings
- * from rest of env value. Permits users of LOCALDOMAIN
- * to still have a search list, and anyone to set the
- * one that they want to use as an individual (even more
- * important now that the rfc1535 stuff restricts searches)
- */
- cp = _res.defdname;
- pp = _res.dnsrch;
- *pp++ = cp;
- for (n = 0; *cp && pp < _res.dnsrch + MAXDNSRCH; cp++) {
- if (*cp == '\n') /* silly backwards compat */
- break;
- else if (*cp == ' ' || *cp == '\t') {
- *cp = 0;
- n = 1;
- } else if (n) {
- *pp++ = cp;
- n = 0;
- havesearch = 1;
- }
- }
- /* null terminate last domain if there are excess */
- while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n')
- cp++;
- *cp = '\0';
- *pp++ = 0;
- }
-
-#define MATCH(line, name) \
- (!strncmp(line, name, sizeof(name) - 1) && \
- (line[sizeof(name) - 1] == ' ' || \
- line[sizeof(name) - 1] == '\t'))
-
- if ((fp = fopen(_PATH_RESCONF, "r")) != NULL) {
- /* read the config file */
- while (fgets(buf, sizeof(buf), fp) != NULL) {
- /* skip comments */
- if (*buf == ';' || *buf == '#')
- continue;
- /* read default domain name */
- if (MATCH(buf, "domain")) {
- if (haveenv) /* skip if have from environ */
- continue;
- cp = buf + sizeof("domain") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp == '\0') || (*cp == '\n'))
- continue;
- strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
- if ((cp = strpbrk(_res.defdname, " \t\n")) != NULL)
- *cp = '\0';
- havesearch = 0;
- continue;
- }
- /* set search list */
- if (MATCH(buf, "search")) {
- if (haveenv) /* skip if have from environ */
- continue;
- cp = buf + sizeof("search") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp == '\0') || (*cp == '\n'))
- continue;
- strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
- if ((cp = strchr(_res.defdname, '\n')) != NULL)
- *cp = '\0';
- /*
- * Set search list to be blank-separated strings
- * on rest of line.
- */
- cp = _res.defdname;
- pp = _res.dnsrch;
- *pp++ = cp;
- for (n = 0; *cp && pp < _res.dnsrch + MAXDNSRCH; cp++) {
- if (*cp == ' ' || *cp == '\t') {
- *cp = 0;
- n = 1;
- } else if (n) {
- *pp++ = cp;
- n = 0;
- }
- }
- /* null terminate last domain if there are excess */
- while (*cp != '\0' && *cp != ' ' && *cp != '\t')
- cp++;
- *cp = '\0';
- *pp++ = 0;
- havesearch = 1;
- continue;
- }
- /* read nameservers to query */
- if (MATCH(buf, "nameserver") && nserv < MAXNS) {
- struct in_addr a;
-
- cp = buf + sizeof("nameserver") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp != '\0') && (*cp != '\n') && inet_aton(cp, &a)) {
- _res.nsaddr_list[nserv].sin_addr = a;
- _res.nsaddr_list[nserv].sin_family = AF_INET;
- _res.nsaddr_list[nserv].sin_port =
- htons(NAMESERVER_PORT);
- nserv++;
- }
- continue;
- }
-#ifdef RESOLVSORT
- if (MATCH(buf, "sortlist")) {
- struct in_addr a;
-
- cp = buf + sizeof("sortlist") - 1;
- while (nsort < MAXRESOLVSORT) {
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if (*cp == '\0' || *cp == '\n' || *cp == ';')
- break;
- net = cp;
- while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&
- isascii((int)*cp) && !isspace((int)*cp))
- cp++;
- n = *cp;
- *cp = 0;
- if (inet_aton(net, &a)) {
- _res.sort_list[nsort].addr = a;
- if (ISSORTMASK(n)) {
- *cp++ = n;
- net = cp;
- while (*cp && *cp != ';' &&
- isascii((int)*cp) && !isspace((int)*cp))
- cp++;
- n = *cp;
- *cp = 0;
- if (inet_aton(net, &a)) {
- _res.sort_list[nsort].mask = a.s_addr;
- } else {
- _res.sort_list[nsort].mask =
- net_mask(_res.sort_list[nsort].addr);
- }
- } else {
- _res.sort_list[nsort].mask =
- net_mask(_res.sort_list[nsort].addr);
- }
- nsort++;
- }
- *cp = n;
- }
- continue;
- }
-#endif
- if (MATCH(buf, "options")) {
- res_setoptions(buf + sizeof("options") - 1, "conf");
- continue;
- }
- }
- if (nserv > 1)
- _res.nscount = nserv;
-#ifdef RESOLVSORT
- _res.nsort = nsort;
-#endif
- (void) fclose(fp);
- }
- if (_res.defdname[0] == 0 &&
- gethostname(buf, sizeof(_res.defdname) - 1) == 0 &&
- (cp = strchr(buf, '.')) != NULL)
- strcpy(_res.defdname, cp + 1);
-
- /* find components of local domain that might be searched */
- if (havesearch == 0) {
- pp = _res.dnsrch;
- *pp++ = _res.defdname;
- *pp = NULL;
-
-#ifndef RFC1535
- dots = 0;
- for (cp = _res.defdname; *cp; cp++)
- dots += (*cp == '.');
-
- cp = _res.defdname;
- while (pp < _res.dnsrch + MAXDFLSRCH) {
- if (dots < LOCALDOMAINPARTS)
- break;
- cp = strchr(cp, '.') + 1; /* we know there is one */
- *pp++ = cp;
- dots--;
- }
- *pp = NULL;
-#ifdef DEBUG
- if (_res.options & RES_DEBUG) {
- printf(";; res_init()... default dnsrch list:\n");
- for (pp = _res.dnsrch; *pp; pp++)
- printf(";;\t%s\n", *pp);
- printf(";;\t..END..\n");
- }
-#endif
-#endif /* !RFC1535 */
- }
-
- if ((cp = getenv("RES_OPTIONS")) != NULL)
- res_setoptions(cp, "env");
- _res.options |= RES_INIT;
- return (0);
-}
-
-static void
-res_setoptions(options, source)
- char *options, *source;
-{
- char *cp = options;
- int i;
-
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_setoptions(\"%s\", \"%s\")...\n",
- options, source);
-#endif
- while (*cp) {
- /* skip leading and inner runs of spaces */
- while (*cp == ' ' || *cp == '\t')
- cp++;
- /* search for and process individual options */
- if (!strncmp(cp, "ndots:", sizeof("ndots:") - 1)) {
- i = atoi(cp + sizeof("ndots:") - 1);
- if (i <= RES_MAXNDOTS)
- _res.ndots = i;
- else
- _res.ndots = RES_MAXNDOTS;
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";;\tndots=%d\n", _res.ndots);
-#endif
- } else if (!strncmp(cp, "debug", sizeof("debug") - 1)) {
-#ifdef DEBUG
- if (!(_res.options & RES_DEBUG)) {
- printf(";; res_setoptions(\"%s\", \"%s\")..\n",
- options, source);
- _res.options |= RES_DEBUG;
- }
- printf(";;\tdebug\n");
-#endif
- } else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) {
- _res.options |= RES_USE_INET6;
- } else if (!strncmp(cp, "no_tld_query", sizeof("no_tld_query") - 1)) {
- _res.options |= RES_NOTLDQUERY;
- } else {
- /* XXX - print a warning here? */
- }
- /* skip to next run of spaces */
- while (*cp && *cp != ' ' && *cp != '\t')
- cp++;
- }
-}
-
-#ifdef RESOLVSORT
-/* XXX - should really support CIDR which means explicit masks always. */
-static u_int32_t
-net_mask(in) /* XXX - should really use system's version of this */
- struct in_addr in;
-{
- register u_int32_t i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return (htonl(IN_CLASSA_NET));
- else if (IN_CLASSB(i))
- return (htonl(IN_CLASSB_NET));
- return (htonl(IN_CLASSC_NET));
-}
-#endif
-
-u_int
-res_randomid()
-{
- struct timeval now;
-
- gettimeofday(&now, NULL);
- return (0xffff & (now.tv_sec ^ now.tv_usec ^ getpid()));
-}
diff --git a/c/src/exec/libnetworking/libc/res_mkquery.c b/c/src/exec/libnetworking/libc/res_mkquery.c
deleted file mode 100644
index d3fabfa5ab..0000000000
--- a/c/src/exec/libnetworking/libc/res_mkquery.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 1985, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: res_mkquery.c,v 8.9 1997/04/24 22:22:36 vixie Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "res_config.h"
-
-/*
- * Form all types of queries.
- * Returns the size of the result or -1.
- */
-int
-res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
- int op; /* opcode of query */
- const char *dname; /* domain name */
- int class, type; /* class and type of query */
- const u_char *data; /* resource record data */
- int datalen; /* length of data */
- const u_char *newrr_in; /* new rr for modify or append */
- u_char *buf; /* buffer to put query */
- int buflen; /* size of buffer */
-{
- register HEADER *hp;
- register u_char *cp;
- register int n;
- u_char *dnptrs[20], **dpp, **lastdnptr;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_mkquery(%d, %s, %d, %d)\n",
- op, dname, class, type);
-#endif
- /*
- * Initialize header fields.
- */
- if ((buf == NULL) || (buflen < HFIXEDSZ))
- return (-1);
- memset(buf, 0, HFIXEDSZ);
- hp = (HEADER *) buf;
- hp->id = htons(++_res.id);
- hp->opcode = op;
- hp->rd = (_res.options & RES_RECURSE) != 0;
- hp->rcode = NOERROR;
- cp = buf + HFIXEDSZ;
- buflen -= HFIXEDSZ;
- dpp = dnptrs;
- *dpp++ = buf;
- *dpp++ = NULL;
- lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
- /*
- * perform opcode specific processing
- */
- switch (op) {
- case QUERY: /*FALLTHROUGH*/
- case NS_NOTIFY_OP:
- if ((buflen -= QFIXEDSZ) < 0)
- return (-1);
- if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
- return (-1);
- cp += n;
- buflen -= n;
- __putshort(type, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- hp->qdcount = htons(1);
- if (op == QUERY || data == NULL)
- break;
- /*
- * Make an additional record for completion domain.
- */
- buflen -= RRFIXEDSZ;
- n = dn_comp((char *)data, cp, buflen, dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- buflen -= n;
- __putshort(T_NULL, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- __putlong(0, cp);
- cp += INT32SZ;
- __putshort(0, cp);
- cp += INT16SZ;
- hp->arcount = htons(1);
- break;
-
- case IQUERY:
- /*
- * Initialize answer section
- */
- if (buflen < 1 + RRFIXEDSZ + datalen)
- return (-1);
- *cp++ = '\0'; /* no domain name */
- __putshort(type, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- __putlong(0, cp);
- cp += INT32SZ;
- __putshort(datalen, cp);
- cp += INT16SZ;
- if (datalen) {
- memcpy(cp, data, datalen);
- cp += datalen;
- }
- hp->ancount = htons(1);
- break;
-
- default:
- return (-1);
- }
- return (cp - buf);
-}
diff --git a/c/src/exec/libnetworking/libc/res_mkupdate.c b/c/src/exec/libnetworking/libc/res_mkupdate.c
deleted file mode 100644
index 56362f650b..0000000000
--- a/c/src/exec/libnetworking/libc/res_mkupdate.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Based on the Dynamic DNS reference implementation by Viraj Bais
- * <viraj_bais@ccm.fm.intel.com>
- */
-
-#if !defined(__rtems__)
-#if !defined(lint) && !defined(SABER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-#include <sys/param.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <limits.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <ctype.h>
-
-#include "res_config.h"
-
-static int getnum_str(u_char **, u_char *);
-static int getword_str(char *, int, u_char **, u_char *);
-
-#define ShrinkBuffer(x) if ((buflen -= x) < 0) return (-2);
-
-/*
- * Form update packets.
- * Returns the size of the resulting packet if no error
- * On error,
- * returns -1 if error in reading a word/number in rdata
- * portion for update packets
- * -2 if length of buffer passed is insufficient
- * -3 if zone section is not the first section in
- * the linked list, or section order has a problem
- * -4 on a number overflow
- * -5 unknown operation or no records
- */
-int
-res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
- ns_updrec *rrecp_start = rrecp_in;
- HEADER *hp;
- u_char *cp, *sp1, *sp2, *startp, *endp;
- int n, i, soanum, multiline;
- ns_updrec *rrecp;
- struct in_addr ina;
- char buf2[MAXDNAME];
- int section, numrrs = 0, counts[ns_s_max];
- u_int16_t rtype, rclass;
- u_int32_t n1, rttl;
- u_char *dnptrs[20], **dpp, **lastdnptr;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-
- /*
- * Initialize header fields.
- */
- if ((buf == NULL) || (buflen < HFIXEDSZ))
- return (-1);
- memset(buf, 0, HFIXEDSZ);
- hp = (HEADER *) buf;
- hp->id = htons(++_res.id);
- hp->opcode = ns_o_update;
- hp->rcode = NOERROR;
- sp1 = buf + 2*INT16SZ; /* save pointer to zocount */
- cp = buf + HFIXEDSZ;
- buflen -= HFIXEDSZ;
- dpp = dnptrs;
- *dpp++ = buf;
- *dpp++ = NULL;
- lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
-
- if (rrecp_start == NULL)
- return (-5);
- else if (rrecp_start->r_section != S_ZONE)
- return (-3);
-
- memset(counts, 0, sizeof counts);
- for (rrecp = rrecp_start; rrecp; rrecp = rrecp->r_grpnext) {
- numrrs++;
- section = rrecp->r_section;
- if (section < 0 || section >= ns_s_max)
- return (-1);
- counts[section]++;
- for (i = section + 1; i < ns_s_max; i++)
- if (counts[i])
- return (-3);
- rtype = rrecp->r_type;
- rclass = rrecp->r_class;
- rttl = rrecp->r_ttl;
- /* overload class and type */
- if (section == S_PREREQ) {
- rttl = 0;
- switch (rrecp->r_opcode) {
- case YXDOMAIN:
- rclass = C_ANY;
- rtype = T_ANY;
- rrecp->r_size = 0;
- break;
- case NXDOMAIN:
- rclass = C_NONE;
- rtype = T_ANY;
- rrecp->r_size = 0;
- break;
- case NXRRSET:
- rclass = C_NONE;
- rrecp->r_size = 0;
- break;
- case YXRRSET:
- if (rrecp->r_size == 0)
- rclass = C_ANY;
- break;
- default:
- fprintf(stderr,
- "res_mkupdate: incorrect opcode: %d\n",
- rrecp->r_opcode);
- fflush(stderr);
- return (-1);
- }
- } else if (section == S_UPDATE) {
- switch (rrecp->r_opcode) {
- case DELETE:
- rclass = rrecp->r_size == 0 ? C_ANY : C_NONE;
- break;
- case ADD:
- break;
- default:
- fprintf(stderr,
- "res_mkupdate: incorrect opcode: %d\n",
- rrecp->r_opcode);
- fflush(stderr);
- return (-1);
- }
- }
-
- /*
- * XXX appending default domain to owner name is omitted,
- * fqdn must be provided
- */
- if ((n = dn_comp(rrecp->r_dname, cp, buflen, dnptrs,
- lastdnptr)) < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n + 2*INT16SZ);
- PUTSHORT(rtype, cp);
- PUTSHORT(rclass, cp);
- if (section == S_ZONE) {
- if (numrrs != 1 || rrecp->r_type != T_SOA)
- return (-3);
- continue;
- }
- ShrinkBuffer(INT32SZ + INT16SZ);
- PUTLONG(rttl, cp);
- sp2 = cp; /* save pointer to length byte */
- cp += INT16SZ;
- if (rrecp->r_size == 0) {
- if (section == S_UPDATE && rclass != C_ANY)
- return (-1);
- else {
- PUTSHORT(0, sp2);
- continue;
- }
- }
- startp = rrecp->r_data;
- endp = startp + rrecp->r_size - 1;
- /* XXX this should be done centrally. */
- switch (rrecp->r_type) {
- case T_A:
- if (!getword_str(buf2, sizeof buf2, &startp, endp))
- return (-1);
- if (!inet_aton(buf2, &ina))
- return (-1);
- n1 = ntohl(ina.s_addr);
- ShrinkBuffer(INT32SZ);
- PUTLONG(n1, cp);
- break;
- case T_CNAME:
- case T_MB:
- case T_MG:
- case T_MR:
- case T_NS:
- case T_PTR:
- if (!getword_str(buf2, sizeof buf2, &startp, endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen, dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- break;
- case T_MINFO:
- case T_SOA:
- case T_RP:
- for (i = 0; i < 2; i++) {
- if (!getword_str(buf2, sizeof buf2, &startp,
- endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen,
- dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- }
- if (rrecp->r_type == T_SOA) {
- ShrinkBuffer(5 * INT32SZ);
- while (isspace(*startp) || !*startp)
- startp++;
- if (*startp == '(') {
- multiline = 1;
- startp++;
- } else
- multiline = 0;
- /* serial, refresh, retry, expire, minimum */
- for (i = 0; i < 5; i++) {
- soanum = getnum_str(&startp, endp);
- if (soanum < 0)
- return (-1);
- PUTLONG(soanum, cp);
- }
- if (multiline) {
- while (isspace(*startp) || !*startp)
- startp++;
- if (*startp != ')')
- return (-1);
- }
- }
- break;
- case T_MX:
- case T_AFSDB:
- case T_RT:
- n = getnum_str(&startp, endp);
- if (n < 0)
- return (-1);
- PUTSHORT(n, cp);
- ShrinkBuffer(INT16SZ);
- if (!getword_str(buf2, sizeof buf2, &startp, endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen, dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- break;
- case T_PX:
- n = getnum_str(&startp, endp);
- if (n < 0)
- return (-1);
- PUTSHORT(n, cp);
- ShrinkBuffer(INT16SZ);
- for (i = 0; i < 2; i++) {
- if (!getword_str(buf2, sizeof buf2, &startp,
- endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen, dnptrs,
- lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- }
- break;
- case T_WKS:
- case T_HINFO:
- case T_TXT:
- case T_X25:
- case T_ISDN:
- case T_NSAP:
- case T_LOC:
- /* XXX - more fine tuning needed here */
- ShrinkBuffer(rrecp->r_size);
- memcpy(cp, rrecp->r_data, rrecp->r_size);
- cp += rrecp->r_size;
- break;
- default:
- return (-1);
- } /*switch*/
- n = (u_int16_t)((cp - sp2) - INT16SZ);
- PUTSHORT(n, sp2);
- } /*for*/
-
- hp->qdcount = htons(counts[0]);
- hp->ancount = htons(counts[1]);
- hp->nscount = htons(counts[2]);
- hp->arcount = htons(counts[3]);
- return (cp - buf);
-}
-
-/*
- * Get a whitespace delimited word from a string (not file)
- * into buf. modify the start pointer to point after the
- * word in the string.
- */
-static int
-getword_str(char *buf, int size, u_char **startpp, u_char *endp) {
- char *cp;
- int c;
-
- for (cp = buf; *startpp <= endp; ) {
- c = **startpp;
- if (isspace(c) || c == '\0') {
- if (cp != buf) /* trailing whitespace */
- break;
- else { /* leading whitespace */
- (*startpp)++;
- continue;
- }
- }
- (*startpp)++;
- if (cp >= buf+size-1)
- break;
- *cp++ = (u_char)c;
- }
- *cp = '\0';
- return (cp != buf);
-}
-
-/*
- * Get a whitespace delimited number from a string (not file) into buf
- * update the start pointer to point after the number in the string.
- */
-static int
-getnum_str(u_char **startpp, u_char *endp) {
- int c, n;
- int seendigit = 0;
- int m = 0;
-
- for (n = 0; *startpp <= endp; ) {
- c = **startpp;
- if (isspace(c) || c == '\0') {
- if (seendigit) /* trailing whitespace */
- break;
- else { /* leading whitespace */
- (*startpp)++;
- continue;
- }
- }
- if (c == ';') {
- while ((*startpp <= endp) &&
- ((c = **startpp) != '\n'))
- (*startpp)++;
- if (seendigit)
- break;
- continue;
- }
- if (!isdigit(c)) {
- if (c == ')' && seendigit) {
- (*startpp)--;
- break;
- }
- return (-1);
- }
- (*startpp)++;
- n = n * 10 + (c - '0');
- seendigit = 1;
- }
- return (n + m);
-}
-
-/*
- * Allocate a resource record buffer & save rr info.
- */
-ns_updrec *
-res_mkupdrec(int section, const char *dname,
- u_int class, u_int type, u_long ttl) {
- ns_updrec *rrecp = (ns_updrec *)calloc(1, sizeof(ns_updrec));
-
- if (!rrecp || !(rrecp->r_dname = strdup(dname)))
- return (NULL);
- rrecp->r_class = class;
- rrecp->r_type = type;
- rrecp->r_ttl = ttl;
- rrecp->r_section = section;
- return (rrecp);
-}
-
-/*
- * Free a resource record buffer created by res_mkupdrec.
- */
-void
-res_freeupdrec(ns_updrec *rrecp) {
- /* Note: freeing r_dp is the caller's responsibility. */
- if (rrecp->r_dname != NULL)
- free(rrecp->r_dname);
- free(rrecp);
-}
diff --git a/c/src/exec/libnetworking/libc/res_query.c b/c/src/exec/libnetworking/libc/res_query.c
deleted file mode 100644
index 784fa433bc..0000000000
--- a/c/src/exec/libnetworking/libc/res_query.c
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid = "From: Id: res_query.c,v 8.14 1997/06/09 17:47:05 halley Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <errno.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "res_config.h"
-
-#if PACKETSZ > 1024
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 1024
-#endif
-
-/*
- * Formulate a normal query, send, and await answer.
- * Returned answer is placed in supplied buffer "answer".
- * Perform preliminary check of answer, returning success only
- * if no error is indicated and the answer count is nonzero.
- * Return the size of the response on success, -1 on error.
- * Error number is left in h_errno.
- *
- * Caller must parse answer and determine whether it answers the question.
- */
-int
-res_query(name, class, type, answer, anslen)
- const char *name; /* domain name */
- int class, type; /* class and type of query */
- u_char *answer; /* buffer to put answer */
- int anslen; /* size of answer buffer */
-{
- u_char buf[MAXPACKET];
- HEADER *hp = (HEADER *) answer;
- int n;
-
- hp->rcode = NOERROR; /* default */
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_query(%s, %d, %d)\n", name, class, type);
-#endif
-
- n = res_mkquery(QUERY, name, class, type, NULL, 0, NULL,
- buf, sizeof(buf));
- if (n <= 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_query: mkquery failed\n");
-#endif
- h_errno = NO_RECOVERY;
- return (n);
- }
- n = res_send(buf, n, answer, anslen);
- if (n < 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_query: send error\n");
-#endif
- h_errno = TRY_AGAIN;
- return (n);
- }
-
- if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; rcode = %d, ancount=%d\n", hp->rcode,
- ntohs(hp->ancount));
-#endif
- switch (hp->rcode) {
- case NXDOMAIN:
- h_errno = HOST_NOT_FOUND;
- break;
- case SERVFAIL:
- h_errno = TRY_AGAIN;
- break;
- case NOERROR:
- h_errno = NO_DATA;
- break;
- case FORMERR:
- case NOTIMP:
- case REFUSED:
- default:
- h_errno = NO_RECOVERY;
- break;
- }
- return (-1);
- }
- return (n);
-}
-
-/*
- * Formulate a normal query, send, and retrieve answer in supplied buffer.
- * Return the size of the response on success, -1 on error.
- * If enabled, implement search rules until answer or unrecoverable failure
- * is detected. Error code, if any, is left in h_errno.
- */
-int
-res_search(name, class, type, answer, anslen)
- const char *name; /* domain name */
- int class, type; /* class and type of query */
- u_char *answer; /* buffer to put answer */
- int anslen; /* size of answer */
-{
- const char *cp, * const *domain;
- HEADER *hp = (HEADER *) answer;
- u_int dots;
- int trailing_dot, ret, saved_herrno;
- int got_nodata = 0, got_servfail = 0, tried_as_is = 0;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
- errno = 0;
- h_errno = HOST_NOT_FOUND; /* default, if we never query */
- dots = 0;
- for (cp = name; *cp; cp++)
- dots += (*cp == '.');
- trailing_dot = 0;
- if (cp > name && *--cp == '.')
- trailing_dot++;
-
- /* If there aren't any dots, it could be a user-level alias */
- if (!dots && (cp = hostalias(name)) != NULL)
- return (res_query(cp, class, type, answer, anslen));
-
- /*
- * If there are dots in the name already, let's just give it a try
- * 'as is'. The threshold can be set with the "ndots" option.
- */
- saved_herrno = -1;
- if (dots >= _res.ndots) {
- ret = res_querydomain(name, NULL, class, type, answer, anslen);
- if (ret > 0)
- return (ret);
- saved_herrno = h_errno;
- tried_as_is++;
- }
-
- /*
- * We do at least one level of search if
- * - there is no dot and RES_DEFNAME is set, or
- * - there is at least one dot, there is no trailing dot,
- * and RES_DNSRCH is set.
- */
- if ((!dots && (_res.options & RES_DEFNAMES)) ||
- (dots && !trailing_dot && (_res.options & RES_DNSRCH))) {
- int done = 0;
-
- for (domain = (const char * const *)_res.dnsrch;
- *domain && !done;
- domain++) {
-
- ret = res_querydomain(name, *domain, class, type,
- answer, anslen);
- if (ret > 0)
- return (ret);
-
- /*
- * If no server present, give up.
- * If name isn't found in this domain,
- * keep trying higher domains in the search list
- * (if that's enabled).
- * On a NO_DATA error, keep trying, otherwise
- * a wildcard entry of another type could keep us
- * from finding this entry higher in the domain.
- * If we get some other error (negative answer or
- * server failure), then stop searching up,
- * but try the input name below in case it's
- * fully-qualified.
- */
- if (errno == ECONNREFUSED) {
- h_errno = TRY_AGAIN;
- return (-1);
- }
-
- switch (h_errno) {
- case NO_DATA:
- got_nodata++;
- /* FALLTHROUGH */
- case HOST_NOT_FOUND:
- /* keep trying */
- break;
- case TRY_AGAIN:
- if (hp->rcode == SERVFAIL) {
- /* try next search element, if any */
- got_servfail++;
- break;
- }
- /* FALLTHROUGH */
- default:
- /* anything else implies that we're done */
- done++;
- }
-
- /* if we got here for some reason other than DNSRCH,
- * we only wanted one iteration of the loop, so stop.
- */
- if (!(_res.options & RES_DNSRCH))
- done++;
- }
- }
-
- /*
- * If we have not already tried the name "as is", do that now.
- * note that we do this regardless of how many dots were in the
- * name or whether it ends with a dot unless NOTLDQUERY is set.
- */
- if (!tried_as_is && (dots || !(_res.options & RES_NOTLDQUERY))) {
- ret = res_querydomain(name, NULL, class, type, answer, anslen);
- if (ret > 0)
- return (ret);
- }
-
- /* if we got here, we didn't satisfy the search.
- * if we did an initial full query, return that query's h_errno
- * (note that we wouldn't be here if that query had succeeded).
- * else if we ever got a nodata, send that back as the reason.
- * else send back meaningless h_errno, that being the one from
- * the last DNSRCH we did.
- */
- if (saved_herrno != -1)
- h_errno = saved_herrno;
- else if (got_nodata)
- h_errno = NO_DATA;
- else if (got_servfail)
- h_errno = TRY_AGAIN;
- return (-1);
-}
-
-/*
- * Perform a call on res_query on the concatenation of name and domain,
- * removing a trailing dot from name if domain is NULL.
- */
-int
-res_querydomain(name, domain, class, type, answer, anslen)
- const char *name, *domain;
- int class, type; /* class and type of query */
- u_char *answer; /* buffer to put answer */
- int anslen; /* size of answer */
-{
- char nbuf[MAXDNAME];
- const char *longname = nbuf;
- int n, d;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_querydomain(%s, %s, %d, %d)\n",
- name, domain?domain:"<Nil>", class, type);
-#endif
- if (domain == NULL) {
- /*
- * Check for trailing '.';
- * copy without '.' if present.
- */
- n = strlen(name);
- if (n >= MAXDNAME) {
- h_errno = NO_RECOVERY;
- return (-1);
- }
- n--;
- if (n >= 0 && name[n] == '.') {
- strncpy(nbuf, name, n);
- nbuf[n] = '\0';
- } else
- longname = name;
- } else {
- n = strlen(name);
- d = strlen(domain);
- if (n + d + 1 >= MAXDNAME) {
- h_errno = NO_RECOVERY;
- return (-1);
- }
- sprintf(nbuf, "%s.%s", name, domain);
- }
- return (res_query(longname, class, type, answer, anslen));
-}
-
-const char *
-hostalias(name)
- const char *name;
-{
- register char *cp1, *cp2;
- FILE *fp;
- char *file;
- char buf[BUFSIZ];
- static char abuf[MAXDNAME];
-
- if (_res.options & RES_NOALIASES)
- return (NULL);
- if (issetugid())
- return (NULL);
- file = getenv("HOSTALIASES");
- if (file == NULL || (fp = fopen(file, "r")) == NULL)
- return (NULL);
- setbuf(fp, NULL);
- buf[sizeof(buf) - 1] = '\0';
- while (fgets(buf, sizeof(buf), fp)) {
- for (cp1 = buf; *cp1 && !isspace((int)*cp1); ++cp1)
- ;
- if (!*cp1)
- break;
- *cp1 = '\0';
- if (!strcasecmp(buf, name)) {
- while (isspace((int)*++cp1))
- ;
- if (!*cp1)
- break;
- for (cp2 = cp1 + 1; *cp2 && !isspace((int)*cp2); ++cp2)
- ;
- abuf[sizeof(abuf) - 1] = *cp2 = '\0';
- strncpy(abuf, cp1, sizeof(abuf) - 1);
- fclose(fp);
- return (abuf);
- }
- }
- fclose(fp);
- return (NULL);
-}
diff --git a/c/src/exec/libnetworking/libc/res_send.c b/c/src/exec/libnetworking/libc/res_send.c
deleted file mode 100644
index 08cb78490f..0000000000
--- a/c/src/exec/libnetworking/libc/res_send.c
+++ /dev/null
@@ -1,929 +0,0 @@
-/*
- * Copyright (c) 1985, 1989, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: res_send.c,v 8.20 1998/04/06 23:27:51 halley Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Send query to name server and wait for reply.
- */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <poll.h>
-
-#include "res_config.h"
-
-#if !defined(__rtems__)
-#ifdef NOPOLL /* libc_r doesn't wrap poll yet() */
-static int use_poll = 0;
-#else
-static int use_poll = 1; /* adapt to poll() syscall availability */
- /* 0 = not present, 1 = try it, 2 = exists */
-#endif
-#endif
-
-static int s = -1; /* socket used for communications */
-static int connected = 0; /* is the socket connected */
-static int vc = 0; /* is the socket a virtual circuit? */
-static res_send_qhook Qhook = NULL;
-static res_send_rhook Rhook = NULL;
-
-
-#define CAN_RECONNECT 1
-
-#ifndef DEBUG
-# define Dprint(cond, args) /*empty*/
-# define DprintQ(cond, args, query, size) /*empty*/
-# define Aerror(file, string, error, address) /*empty*/
-# define Perror(file, string, error) /*empty*/
-#else
-# define Dprint(cond, args) if (cond) {fprintf args;} else {}
-# define DprintQ(cond, args, query, size) if (cond) {\
- fprintf args;\
- __fp_nquery(query, size, stdout);\
- } else {}
- static void
- Aerror(file, string, error, address)
- FILE *file;
- char *string;
- int error;
- struct sockaddr_in address;
- {
- int save = errno;
-
- if (_res.options & RES_DEBUG) {
- fprintf(file, "res_send: %s ([%s].%u): %s\n",
- string,
- inet_ntoa(address.sin_addr),
- ntohs(address.sin_port),
- strerror(error));
- }
- errno = save;
- }
- static void
- Perror(file, string, error)
- FILE *file;
- char *string;
- int error;
- {
- int save = errno;
-
- if (_res.options & RES_DEBUG) {
- fprintf(file, "res_send: %s: %s\n",
- string, strerror(error));
- }
- errno = save;
- }
-#endif
-
-void
-res_send_setqhook(hook)
- res_send_qhook hook;
-{
-
- Qhook = hook;
-}
-
-void
-res_send_setrhook(hook)
- res_send_rhook hook;
-{
-
- Rhook = hook;
-}
-
-/* int
- * res_isourserver(ina)
- * looks up "ina" in _res.ns_addr_list[]
- * returns:
- * 0 : not found
- * >0 : found
- * author:
- * paul vixie, 29may94
- */
-int
-res_isourserver(inp)
- const struct sockaddr_in *inp;
-{
- struct sockaddr_in ina;
- int ns, ret;
-
- ina = *inp;
- ret = 0;
- for (ns = 0; ns < _res.nscount; ns++) {
- const struct sockaddr_in *srv = &_res.nsaddr_list[ns];
-
- if (srv->sin_family == ina.sin_family &&
- srv->sin_port == ina.sin_port &&
- (srv->sin_addr.s_addr == INADDR_ANY ||
- srv->sin_addr.s_addr == ina.sin_addr.s_addr)) {
- ret++;
- break;
- }
- }
- return (ret);
-}
-
-/* int
- * res_nameinquery(name, type, class, buf, eom)
- * look for (name,type,class) in the query section of packet (buf,eom)
- * requires:
- * buf + HFIXEDSZ <= eom
- * returns:
- * -1 : format error
- * 0 : not found
- * >0 : found
- * author:
- * paul vixie, 29may94
- */
-int
-res_nameinquery(name, type, class, buf, eom)
- const char *name;
- int type, class;
- const u_char *buf, *eom;
-{
- const u_char *cp = buf + HFIXEDSZ;
- int qdcount = ntohs(((HEADER*)buf)->qdcount);
-
- while (qdcount-- > 0) {
- char tname[MAXDNAME+1];
- int n, ttype, tclass;
-
- n = dn_expand(buf, eom, cp, tname, sizeof tname);
- if (n < 0)
- return (-1);
- cp += n;
- if (cp + 2 * INT16SZ > eom)
- return (-1);
- ttype = ns_get16(cp); cp += INT16SZ;
- tclass = ns_get16(cp); cp += INT16SZ;
- if (ttype == type &&
- tclass == class &&
- strcasecmp(tname, name) == 0)
- return (1);
- }
- return (0);
-}
-
-/* int
- * res_queriesmatch(buf1, eom1, buf2, eom2)
- * is there a 1:1 mapping of (name,type,class)
- * in (buf1,eom1) and (buf2,eom2)?
- * returns:
- * -1 : format error
- * 0 : not a 1:1 mapping
- * >0 : is a 1:1 mapping
- * author:
- * paul vixie, 29may94
- */
-int
-res_queriesmatch(buf1, eom1, buf2, eom2)
- const u_char *buf1, *eom1;
- const u_char *buf2, *eom2;
-{
- const u_char *cp = buf1 + HFIXEDSZ;
- int qdcount = ntohs(((HEADER*)buf1)->qdcount);
-
- if (buf1 + HFIXEDSZ > eom1 || buf2 + HFIXEDSZ > eom2)
- return (-1);
-
- /*
- * Only header section present in replies to
- * dynamic update packets.
- */
- if ( (((HEADER *)buf1)->opcode == ns_o_update) &&
- (((HEADER *)buf2)->opcode == ns_o_update) )
- return (1);
-
- if (qdcount != ntohs(((HEADER*)buf2)->qdcount))
- return (0);
- while (qdcount-- > 0) {
- char tname[MAXDNAME+1];
- int n, ttype, tclass;
-
- n = dn_expand(buf1, eom1, cp, tname, sizeof tname);
- if (n < 0)
- return (-1);
- cp += n;
- if (cp + 2 * INT16SZ > eom1)
- return (-1);
- ttype = ns_get16(cp); cp += INT16SZ;
- tclass = ns_get16(cp); cp += INT16SZ;
- if (!res_nameinquery(tname, ttype, tclass, buf2, eom2))
- return (0);
- }
- return (1);
-}
-
-int
-res_send(buf, buflen, ans, anssiz)
- const u_char *buf;
- int buflen;
- u_char *ans;
- int anssiz;
-{
- HEADER *hp = (HEADER *) buf;
- HEADER *anhp = (HEADER *) ans;
- int gotsomewhere, connreset, terrno, try, v_circuit, resplen, ns, n;
- u_int badns; /* XXX NSMAX can't exceed #/bits in this variable */
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- /* errno should have been set by res_init() in this case. */
- return (-1);
- }
- if (anssiz < HFIXEDSZ) {
- errno = EINVAL;
- return (-1);
- }
- DprintQ((_res.options & RES_DEBUG) || (_res.pfcode & RES_PRF_QUERY),
- (stdout, ";; res_send()\n"), buf, buflen);
- v_circuit = (_res.options & RES_USEVC) || buflen > PACKETSZ;
- gotsomewhere = 0;
- connreset = 0;
- terrno = ETIMEDOUT;
- badns = 0;
-
- /*
- * Send request, RETRY times, or until successful
- */
- for (try = 0; try < _res.retry; try++) {
- for (ns = 0; ns < _res.nscount; ns++) {
- struct sockaddr_in *nsap = &_res.nsaddr_list[ns];
- same_ns:
- if (badns & (1 << ns)) {
- res_close();
- goto next_ns;
- }
-
- if (Qhook) {
- int done = 0, loops = 0;
-
- do {
- res_sendhookact act;
-
- act = (*Qhook)(&nsap, &buf, &buflen,
- ans, anssiz, &resplen);
- switch (act) {
- case res_goahead:
- done = 1;
- break;
- case res_nextns:
- res_close();
- goto next_ns;
- case res_done:
- return (resplen);
- case res_modified:
- /* give the hook another try */
- if (++loops < 42) /*doug adams*/
- break;
- /*FALLTHROUGH*/
- case res_error:
- /*FALLTHROUGH*/
- default:
- return (-1);
- }
- } while (!done);
- }
-
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; Querying server (# %d) address = %s\n",
- ns + 1, inet_ntoa(nsap->sin_addr)));
-
- if (v_circuit) {
- int truncated;
-#if !defined(__rtems__)
- struct iovec iov[2];
-#endif
- u_short len;
- u_char *cp;
-
- /*
- * Use virtual circuit;
- * at most one attempt per server.
- */
- try = _res.retry;
- truncated = 0;
- if (s < 0 || !vc || hp->opcode == ns_o_update) {
- if (s >= 0)
- res_close();
-
- s = socket(PF_INET, SOCK_STREAM, 0);
- if (s < 0) {
- terrno = errno;
- Perror(stderr, "socket(vc)", errno);
- return (-1);
- }
- errno = 0;
- if (connect(s, (struct sockaddr *)nsap,
- sizeof *nsap) < 0) {
- terrno = errno;
- Aerror(stderr, "connect/vc",
- errno, *nsap);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- vc = 1;
- }
- /*
- * Send length & message
- */
- putshort((u_short)buflen, (u_char*)&len);
-#if !defined(__rtems__)
- iov[0].iov_base = (caddr_t)&len;
- iov[0].iov_len = INT16SZ;
- iov[1].iov_base = (caddr_t)buf;
- iov[1].iov_len = buflen;
- if (writev(s, iov, 2) != (INT16SZ + buflen)) {
-#else
- /*
- * RTEMS doesn't have writev (yet)
- */
- if ((write (s, &len, INT16SZ) != INT16SZ)
- || (write (s, buf, buflen) != buflen)) {
-#endif
- terrno = errno;
- Perror(stderr, "write failed", errno);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- /*
- * Receive length & response
- */
-read_len:
- cp = ans;
- len = INT16SZ;
- while ((n = read(s, (char *)cp, (int)len)) > 0) {
- cp += n;
- if ((len -= n) <= 0)
- break;
- }
- if (n <= 0) {
- terrno = errno;
- Perror(stderr, "read failed", errno);
- res_close();
- /*
- * A long running process might get its TCP
- * connection reset if the remote server was
- * restarted. Requery the server instead of
- * trying a new one. When there is only one
- * server, this means that a query might work
- * instead of failing. We only allow one reset
- * per query to prevent looping.
- */
- if (terrno == ECONNRESET && !connreset) {
- connreset = 1;
- res_close();
- goto same_ns;
- }
- res_close();
- goto next_ns;
- }
- resplen = ns_get16(ans);
- if (resplen > anssiz) {
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; response truncated\n")
- );
- truncated = 1;
- len = anssiz;
- } else
- len = resplen;
- if (len < HFIXEDSZ) {
- /*
- * Undersized message.
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; undersized: %d\n", len));
- terrno = EMSGSIZE;
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- cp = ans;
- while (len != 0 &&
- (n = read(s, (char *)cp, (int)len)) > 0) {
- cp += n;
- len -= n;
- }
- if (n <= 0) {
- terrno = errno;
- Perror(stderr, "read(vc)", errno);
- res_close();
- goto next_ns;
- }
- if (truncated) {
- /*
- * Flush rest of answer
- * so connection stays in synch.
- */
- anhp->tc = 1;
- len = resplen - anssiz;
- while (len != 0) {
- char junk[PACKETSZ];
-
- n = (len > sizeof(junk)
- ? sizeof(junk)
- : len);
- if ((n = read(s, junk, n)) > 0)
- len -= n;
- else
- break;
- }
- }
- /*
- * The calling applicating has bailed out of
- * a previous call and failed to arrange to have
- * the circuit closed or the server has got
- * itself confused. Anyway drop the packet and
- * wait for the correct one.
- */
- if (hp->id != anhp->id) {
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; old answer (unexpected):\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto read_len;
- }
- } else {
- /*
- * Use datagrams.
- */
-#ifndef NOPOLL
- struct pollfd pfd;
- int msec;
-#endif
- struct timeval timeout;
-#ifndef NOSELECT
- fd_set dsmask, *dsmaskp;
- int dsmasklen;
-#endif
- struct sockaddr_in from;
- int fromlen;
-
- if ((s < 0) || vc) {
- if (vc)
- res_close();
- s = socket(PF_INET, SOCK_DGRAM, 0);
- if (s < 0) {
-#ifndef CAN_RECONNECT
- bad_dg_sock:
-#endif
- terrno = errno;
- Perror(stderr, "socket(dg)", errno);
- return (-1);
- }
- connected = 0;
- }
-#ifndef CANNOT_CONNECT_DGRAM
- /*
- * On a 4.3BSD+ machine (client and server,
- * actually), sending to a nameserver datagram
- * port with no nameserver will cause an
- * ICMP port unreachable message to be returned.
- * If our datagram socket is "connected" to the
- * server, we get an ECONNREFUSED error on the next
- * socket operation, and select returns if the
- * error message is received. We can thus detect
- * the absence of a nameserver without timing out.
- * If we have sent queries to at least two servers,
- * however, we don't want to remain connected,
- * as we wish to receive answers from the first
- * server to respond.
- */
- if (_res.nscount == 1 || (try == 0 && ns == 0)) {
- /*
- * Connect only if we are sure we won't
- * receive a response from another server.
- */
- if (!connected) {
- if (connect(s, (struct sockaddr *)nsap,
- sizeof *nsap
- ) < 0) {
- Aerror(stderr,
- "connect(dg)",
- errno, *nsap);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- connected = 1;
- }
- if (send(s, (char*)buf, buflen, 0) != buflen) {
- Perror(stderr, "send", errno);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- } else {
- /*
- * Disconnect if we want to listen
- * for responses from more than one server.
- */
- if (connected) {
-#ifdef CAN_RECONNECT
- struct sockaddr_in no_addr;
-
- no_addr.sin_family = AF_INET;
- no_addr.sin_addr.s_addr = INADDR_ANY;
- no_addr.sin_port = 0;
- (void) connect(s,
- (struct sockaddr *)
- &no_addr,
- sizeof no_addr);
-#else
- int s1 = socket(PF_INET, SOCK_DGRAM,0);
- if (s1 < 0)
- goto bad_dg_sock;
- (void) dup2(s1, s);
- (void) close(s1);
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; new DG socket\n"))
-#endif /* CAN_RECONNECT */
- connected = 0;
- errno = 0;
- }
-#endif /* !CANNOT_CONNECT_DGRAM */
- if (sendto(s, (char*)buf, buflen, 0,
- (struct sockaddr *)nsap,
- sizeof *nsap)
- != buflen) {
- Aerror(stderr, "sendto", errno, *nsap);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
-#ifndef CANNOT_CONNECT_DGRAM
- }
-#endif /* !CANNOT_CONNECT_DGRAM */
-
- /*
- * Wait for reply
- */
-#ifndef NOPOLL
- othersyscall:
- if (use_poll) {
- msec = (_res.retrans << try) * 1000;
- if (try > 0)
- msec /= _res.nscount;
- if (msec <= 0)
- msec = 1000;
- } else {
-#endif
- timeout.tv_sec = (_res.retrans << try);
- if (try > 0)
- timeout.tv_sec /= _res.nscount;
- if ((long) timeout.tv_sec <= 0)
- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
-#ifndef NOPOLL
- }
-#endif
- wait:
- if (s < 0) {
- Perror(stderr, "s out-of-bounds", EMFILE);
- res_close();
- goto next_ns;
- }
-#ifndef NOPOLL
- if (use_poll) {
- struct sigaction sa, osa;
- int sigsys_installed = 0;
-
- pfd.fd = s;
- pfd.events = POLLIN;
- if (use_poll == 1) {
- bzero(&sa, sizeof(sa));
- sa.sa_handler = SIG_IGN;
- if (sigaction(SIGSYS, &sa, &osa) >= 0)
- sigsys_installed = 1;
- }
- n = poll(&pfd, 1, msec);
- if (sigsys_installed == 1) {
- int oerrno = errno;
- sigaction(SIGSYS, &osa, NULL);
- errno = oerrno;
- }
- /* XXX why does nosys() return EINVAL? */
- if (n < 0 && (errno == ENOSYS ||
- errno == EINVAL)) {
- use_poll = 0;
- goto othersyscall;
- } else if (use_poll == 1)
- use_poll = 2;
- if (n < 0) {
- if (errno == EINTR)
- goto wait;
- Perror(stderr, "poll", errno);
- res_close();
- goto next_ns;
- }
- } else {
-#endif
-#ifndef NOSELECT
- dsmasklen = howmany(s + 1, NFDBITS) *
- sizeof(fd_mask);
- if (dsmasklen > sizeof(fd_set)) {
- dsmaskp = (fd_set *)malloc(dsmasklen);
- if (dsmaskp == NULL) {
- res_close();
- goto next_ns;
- }
- } else
- dsmaskp = &dsmask;
- /* only zero what we need */
- bzero((char *)dsmaskp, dsmasklen);
- FD_SET(s, dsmaskp);
- n = select(s + 1, dsmaskp, (fd_set *)NULL,
- (fd_set *)NULL, &timeout);
- if (dsmaskp != &dsmask)
- free(dsmaskp);
- if (n < 0) {
- if (errno == EINTR)
- goto wait;
- Perror(stderr, "select", errno);
- res_close();
- goto next_ns;
- }
-#endif
-#ifndef NOPOLL
- }
-#endif
-
-#ifdef NOSELECT
- setsockopt (s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof timeout);
-#else
- if (n == 0) {
- /*
- * timeout
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; timeout\n"));
- gotsomewhere = 1;
- res_close();
- goto next_ns;
- }
-#endif
- errno = 0;
- fromlen = sizeof(struct sockaddr_in);
- resplen = recvfrom(s, (char*)ans, anssiz, 0,
- (struct sockaddr *)&from, &fromlen);
- if (resplen <= 0) {
-#ifdef NOSELECT
- if (errno == ETIMEDOUT) {
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; timeout\n"));
- gotsomewhere = 1;
- res_close();
- goto next_ns;
- }
-#endif
- Perror(stderr, "recvfrom", errno);
- res_close();
- goto next_ns;
- }
- gotsomewhere = 1;
- if (resplen < HFIXEDSZ) {
- /*
- * Undersized message.
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; undersized: %d\n",
- resplen));
- terrno = EMSGSIZE;
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- if (hp->id != anhp->id) {
- /*
- * response from old query, ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; old answer:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto wait;
- }
-#ifdef CHECK_SRVR_ADDR
- if (!(_res.options & RES_INSECURE1) &&
- !res_isourserver(&from)) {
- /*
- * response from wrong server? ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; not our server:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto wait;
- }
-#endif
- if (!(_res.options & RES_INSECURE2) &&
- !res_queriesmatch(buf, buf + buflen,
- ans, ans + anssiz)) {
- /*
- * response contains wrong query? ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; wrong query name:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto wait;
- }
- if (anhp->rcode == SERVFAIL ||
- anhp->rcode == NOTIMP ||
- anhp->rcode == REFUSED) {
- DprintQ(_res.options & RES_DEBUG,
- (stdout, "server rejected query:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- badns |= (1 << ns);
- res_close();
- /* don't retry if called from dig */
- if (!_res.pfcode)
- goto next_ns;
- }
- if (!(_res.options & RES_IGNTC) && anhp->tc) {
- /*
- * get rest of answer;
- * use TCP with same server.
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; truncated answer\n"));
- v_circuit = 1;
- res_close();
- goto same_ns;
- }
- } /*if vc/dg*/
- Dprint((_res.options & RES_DEBUG) ||
- ((_res.pfcode & RES_PRF_REPLY) &&
- (_res.pfcode & RES_PRF_HEAD1)),
- (stdout, ";; got answer:\n"));
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, "%s", ""),
- ans, (resplen>anssiz)?anssiz:resplen);
- /*
- * If using virtual circuits, we assume that the first server
- * is preferred over the rest (i.e. it is on the local
- * machine) and only keep that one open.
- * If we have temporarily opened a virtual circuit,
- * or if we haven't been asked to keep a socket open,
- * close the socket.
- */
- if ((v_circuit && (!(_res.options & RES_USEVC) || ns != 0)) ||
- !(_res.options & RES_STAYOPEN)) {
- res_close();
- }
- if (Rhook) {
- int done = 0, loops = 0;
-
- do {
- res_sendhookact act;
-
- act = (*Rhook)(nsap, buf, buflen,
- ans, anssiz, &resplen);
- switch (act) {
- case res_goahead:
- case res_done:
- done = 1;
- break;
- case res_nextns:
- res_close();
- goto next_ns;
- case res_modified:
- /* give the hook another try */
- if (++loops < 42) /*doug adams*/
- break;
- /*FALLTHROUGH*/
- case res_error:
- /*FALLTHROUGH*/
- default:
- return (-1);
- }
- } while (!done);
-
- }
- return (resplen);
- next_ns: ;
- } /*foreach ns*/
- } /*foreach retry*/
- res_close();
- if (!v_circuit) {
- if (!gotsomewhere)
- errno = ECONNREFUSED; /* no nameservers found */
- else
- errno = ETIMEDOUT; /* no answer obtained */
- } else
- errno = terrno;
- return (-1);
-}
-
-/*
- * This routine is for closing the socket if a virtual circuit is used and
- * the program wants to close it. This provides support for endhostent()
- * which expects to close the socket.
- *
- * This routine is not expected to be user visible.
- */
-void
-res_close()
-{
- if (s >= 0) {
- (void) close(s);
- s = -1;
- connected = 0;
- vc = 0;
- }
-}
diff --git a/c/src/exec/libnetworking/libc/res_stubs.c b/c/src/exec/libnetworking/libc/res_stubs.c
deleted file mode 100644
index 92cf0fac54..0000000000
--- a/c/src/exec/libnetworking/libc/res_stubs.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 1996 Peter Wemm <peter@freebsd.org>.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- * $Id$
- */
-
-/*
- * This file is for FreeBSD-3.0 that has a bind-4.9.5-P1 derived
- * resolver in the libc. It provides aliases for functions that
- * have moved since 4.9.4-P1.
- *
- * I'll save everybody the trouble and say it now: *THIS IS A HACK*!
- *
- * Yes, many of these are private functions to the resolver, but some are
- * needed as there is no other way to provide the functionality and they've
- * turned up all over the place. :-(
- */
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-__weak_reference(__inet_addr, inet_addr);
-__weak_reference(__inet_aton, inet_aton);
-__weak_reference(__inet_lnaof, inet_lnaof);
-__weak_reference(__inet_makeaddr, inet_makeaddr);
-__weak_reference(__inet_neta, inet_neta);
-__weak_reference(__inet_netof, inet_netof);
-__weak_reference(__inet_network, inet_network);
-__weak_reference(__inet_net_ntop, inet_net_ntop);
-__weak_reference(__inet_net_pton, inet_net_pton);
-__weak_reference(__inet_ntoa, inet_ntoa);
-__weak_reference(__inet_pton, inet_pton);
-__weak_reference(__inet_ntop, inet_ntop);
-__weak_reference(__inet_nsap_addr, inet_nsap_addr);
-__weak_reference(__inet_nsap_ntoa, inet_nsap_ntoa);
-
-__weak_reference(__sym_ston, sym_ston);
-__weak_reference(__sym_ntos, sym_ntos);
-__weak_reference(__sym_ntop, sym_ntop);
-__weak_reference(__fp_resstat, fp_resstat);
-__weak_reference(__p_query, p_query);
-__weak_reference(__p_fqnname, p_fqnname);
-__weak_reference(__p_secstodate, p_secstodate);
-__weak_reference(__dn_count_labels, dn_count_labels);
-__weak_reference(__dn_comp, dn_comp);
-__weak_reference(__res_close, _res_close);
-__weak_reference(__dn_expand, dn_expand);
-__weak_reference(__res_init, res_init);
-__weak_reference(__res_query, res_query);
-__weak_reference(__res_search, res_search);
-__weak_reference(__res_querydomain, res_querydomain);
-__weak_reference(__res_mkquery, res_mkquery);
-__weak_reference(__res_send, res_send);
diff --git a/c/src/exec/libnetworking/libc/res_update.c b/c/src/exec/libnetworking/libc/res_update.c
deleted file mode 100644
index ef591e0674..0000000000
--- a/c/src/exec/libnetworking/libc/res_update.c
+++ /dev/null
@@ -1,518 +0,0 @@
-#if !defined(__rtems__)
-#if !defined(lint) && !defined(SABER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Based on the Dynamic DNS reference implementation by Viraj Bais
- * <viraj_bais@ccm.fm.intel.com>
- */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <errno.h>
-#include <limits.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/*
- * Separate a linked list of records into groups so that all records
- * in a group will belong to a single zone on the nameserver.
- * Create a dynamic update packet for each zone and send it to the
- * nameservers for that zone, and await answer.
- * Abort if error occurs in updating any zone.
- * Return the number of zones updated on success, < 0 on error.
- *
- * On error, caller must deal with the unsynchronized zones
- * eg. an A record might have been successfully added to the forward
- * zone but the corresponding PTR record would be missing if error
- * was encountered while updating the reverse zone.
- */
-
-#define NSMAX 16
-
-struct ns1 {
- char nsname[MAXDNAME];
- struct in_addr nsaddr1;
-};
-
-struct zonegrp {
- char z_origin[MAXDNAME];
- int16_t z_class;
- char z_soardata[MAXDNAME + 5 * INT32SZ];
- struct ns1 z_ns[NSMAX];
- int z_nscount;
- ns_updrec * z_rr;
- struct zonegrp *z_next;
-};
-
-
-int
-res_update(ns_updrec *rrecp_in) {
- ns_updrec *rrecp, *tmprrecp;
- u_char buf[PACKETSZ], answer[PACKETSZ], packet[2*PACKETSZ];
- char name[MAXDNAME], zname[MAXDNAME], primary[MAXDNAME],
- mailaddr[MAXDNAME];
- u_char soardata[2*MAXCDNAME+5*INT32SZ];
- char *dname, *svdname, *cp1, *target;
- u_char *cp, *eom;
- HEADER *hp = (HEADER *) answer;
- struct zonegrp *zptr = NULL, *tmpzptr, *prevzptr, *zgrp_start = NULL;
- int i, j, k = 0, n, ancount, nscount, arcount, rcode, rdatasize,
- newgroup, done, myzone, seen_before, numzones = 0;
- u_int16_t dlen, class, qclass, type, qtype;
- u_int32_t ttl;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-
- for (rrecp = rrecp_in; rrecp; rrecp = rrecp->r_next) {
- dname = rrecp->r_dname;
- n = strlen(dname);
- if (dname[n-1] == '.')
- dname[n-1] = '\0';
- qtype = T_SOA;
- qclass = rrecp->r_class;
- done = 0;
- seen_before = 0;
-
- while (!done && dname) {
- if (qtype == T_SOA) {
- for (tmpzptr = zgrp_start;
- tmpzptr && !seen_before;
- tmpzptr = tmpzptr->z_next) {
- if (strcasecmp(dname,
- tmpzptr->z_origin) == 0 &&
- tmpzptr->z_class == qclass)
- seen_before++;
- for (tmprrecp = tmpzptr->z_rr;
- tmprrecp && !seen_before;
- tmprrecp = tmprrecp->r_grpnext)
- if (strcasecmp(dname, tmprrecp->r_dname) == 0
- && tmprrecp->r_class == qclass) {
- seen_before++;
- break;
- }
- if (seen_before) {
- /*
- * Append to the end of
- * current group.
- */
- for (tmprrecp = tmpzptr->z_rr;
- tmprrecp->r_grpnext;
- tmprrecp = tmprrecp->r_grpnext)
- (void)NULL;
- tmprrecp->r_grpnext = rrecp;
- rrecp->r_grpnext = NULL;
- done = 1;
- break;
- }
- }
- } else if (qtype == T_A) {
- for (tmpzptr = zgrp_start;
- tmpzptr && !done;
- tmpzptr = tmpzptr->z_next)
- for (i = 0; i < tmpzptr->z_nscount; i++)
- if (tmpzptr->z_class == qclass &&
- strcasecmp(tmpzptr->z_ns[i].nsname,
- dname) == 0 &&
- tmpzptr->z_ns[i].nsaddr1.s_addr != 0) {
- zptr->z_ns[k].nsaddr1.s_addr =
- tmpzptr->z_ns[i].nsaddr1.s_addr;
- done = 1;
- break;
- }
- }
- if (done)
- break;
- n = res_mkquery(QUERY, dname, qclass, qtype, NULL,
- 0, NULL, buf, sizeof buf);
- if (n <= 0) {
- fprintf(stderr, "res_update: mkquery failed\n");
- return (n);
- }
- n = res_send(buf, n, answer, sizeof answer);
- if (n < 0) {
- fprintf(stderr, "res_update: send error for %s\n",
- rrecp->r_dname);
- return (n);
- }
- if (n < HFIXEDSZ)
- return (-1);
- ancount = ntohs(hp->ancount);
- nscount = ntohs(hp->nscount);
- arcount = ntohs(hp->arcount);
- rcode = hp->rcode;
- cp = answer + HFIXEDSZ;
- eom = answer + n;
- /* skip the question section */
- n = dn_skipname(cp, eom);
- if (n < 0 || cp + n + 2 * INT16SZ > eom)
- return (-1);
- cp += n + 2 * INT16SZ;
-
- if (qtype == T_SOA) {
- if (ancount == 0 && nscount == 0 && arcount == 0) {
- /*
- * if (rcode == NOERROR) then the dname exists but
- * has no soa record associated with it.
- * if (rcode == NXDOMAIN) then the dname does not
- * exist and the server is replying out of NCACHE.
- * in either case, proceed with the next try
- */
- dname = strchr(dname, '.');
- if (dname != NULL)
- dname++;
- continue;
- } else if ((rcode == NOERROR || rcode == NXDOMAIN) &&
- ancount == 0 &&
- nscount == 1 && arcount == 0) {
- /*
- * name/data does not exist, soa record supplied in the
- * authority section
- */
- /* authority section must contain the soa record */
- if ((n = dn_expand(answer, eom, cp, zname,
- sizeof zname)) < 0)
- return (n);
- cp += n;
- if (cp + 2 * INT16SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- if (type != T_SOA || class != qclass) {
- fprintf(stderr, "unknown answer\n");
- return (-1);
- }
- myzone = 0;
- svdname = dname;
- while (dname)
- if (strcasecmp(dname, zname) == 0) {
- myzone = 1;
- break;
- } else if ((dname = strchr(dname, '.')) != NULL)
- dname++;
- if (!myzone) {
- dname = strchr(svdname, '.');
- if (dname != NULL)
- dname++;
- continue;
- }
- nscount = 0;
- /* fallthrough */
- } else if (rcode == NOERROR && ancount == 1) {
- /*
- * found the zone name
- * new servers will supply NS records for the zone
- * in authority section and A records for those
- * nameservers in the additional section
- * older servers have to be explicitly queried for
- * NS records for the zone
- */
- /* answer section must contain the soa record */
- if ((n = dn_expand(answer, eom, cp, zname,
- sizeof zname)) < 0)
- return (n);
- else
- cp += n;
- if (cp + 2 * INT16SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- if (type == T_CNAME) {
- dname = strchr(dname, '.');
- if (dname != NULL)
- dname++;
- continue;
- }
- if (strcasecmp(dname, zname) != 0 ||
- type != T_SOA ||
- class != rrecp->r_class) {
- fprintf(stderr, "unknown answer\n");
- return (-1);
- }
- /* FALLTHROUGH */
- } else {
- fprintf(stderr,
- "unknown response: ans=%d, auth=%d, add=%d, rcode=%d\n",
- ancount, nscount, arcount, hp->rcode);
- return (-1);
- }
- if (cp + INT32SZ + INT16SZ > eom)
- return (-1);
- /* continue processing the soa record */
- GETLONG(ttl, cp);
- GETSHORT(dlen, cp);
- if (cp + dlen > eom)
- return (-1);
- newgroup = 1;
- zptr = zgrp_start;
- prevzptr = NULL;
- while (zptr) {
- if (strcasecmp(zname, zptr->z_origin) == 0 &&
- type == T_SOA && class == qclass) {
- newgroup = 0;
- break;
- }
- prevzptr = zptr;
- zptr = zptr->z_next;
- }
- if (!newgroup) {
- for (tmprrecp = zptr->z_rr;
- tmprrecp->r_grpnext;
- tmprrecp = tmprrecp->r_grpnext)
- ;
- tmprrecp->r_grpnext = rrecp;
- rrecp->r_grpnext = NULL;
- done = 1;
- cp += dlen;
- break;
- } else {
- if ((n = dn_expand(answer, eom, cp, primary,
- sizeof primary)) < 0)
- return (n);
- cp += n;
- /*
- * We don't have to bounds check here because the
- * next use of 'cp' is in dn_expand().
- */
- cp1 = (char *)soardata;
- strcpy(cp1, primary);
- cp1 += strlen(cp1) + 1;
- if ((n = dn_expand(answer, eom, cp, mailaddr,
- sizeof mailaddr)) < 0)
- return (n);
- cp += n;
- strcpy(cp1, mailaddr);
- cp1 += strlen(cp1) + 1;
- if (cp + 5*INT32SZ > eom)
- return (-1);
- memcpy(cp1, cp, 5*INT32SZ);
- cp += 5*INT32SZ;
- cp1 += 5*INT32SZ;
- rdatasize = (u_char *)cp1 - soardata;
- zptr = calloc(1, sizeof(struct zonegrp));
- if (zptr == NULL)
- return (-1);
- if (zgrp_start == NULL)
- zgrp_start = zptr;
- else
- prevzptr->z_next = zptr;
- zptr->z_rr = rrecp;
- rrecp->r_grpnext = NULL;
- strcpy(zptr->z_origin, zname);
- zptr->z_class = class;
- memcpy(zptr->z_soardata, soardata, rdatasize);
- /* fallthrough to process NS and A records */
- }
- } else if (qtype == T_NS) {
- if (rcode == NOERROR && ancount > 0) {
- strcpy(zname, dname);
- for (zptr = zgrp_start; zptr; zptr = zptr->z_next) {
- if (strcasecmp(zname, zptr->z_origin) == 0)
- break;
- }
- if (zptr == NULL)
- /* should not happen */
- return (-1);
- if (nscount > 0) {
- /*
- * answer and authority sections contain
- * the same information, skip answer section
- */
- for (j = 0; j < ancount; j++) {
- n = dn_skipname(cp, eom);
- if (n < 0)
- return (-1);
- n += 2*INT16SZ + INT32SZ;
- if (cp + n + INT16SZ > eom)
- return (-1);
- cp += n;
- GETSHORT(dlen, cp);
- cp += dlen;
- }
- } else
- nscount = ancount;
- /* fallthrough to process NS and A records */
- } else {
- fprintf(stderr, "cannot determine nameservers for %s:\
-ans=%d, auth=%d, add=%d, rcode=%d\n",
- dname, ancount, nscount, arcount, hp->rcode);
- return (-1);
- }
- } else if (qtype == T_A) {
- if (rcode == NOERROR && ancount > 0) {
- arcount = ancount;
- ancount = nscount = 0;
- /* fallthrough to process A records */
- } else {
- fprintf(stderr, "cannot determine address for %s:\
-ans=%d, auth=%d, add=%d, rcode=%d\n",
- dname, ancount, nscount, arcount, hp->rcode);
- return (-1);
- }
- }
- /* process NS records for the zone */
- j = 0;
- for (i = 0; i < nscount; i++) {
- if ((n = dn_expand(answer, eom, cp, name,
- sizeof name)) < 0)
- return (n);
- cp += n;
- if (cp + 3 * INT16SZ + INT32SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- GETLONG(ttl, cp);
- GETSHORT(dlen, cp);
- if (cp + dlen > eom)
- return (-1);
- if (strcasecmp(name, zname) == 0 &&
- type == T_NS && class == qclass) {
- if ((n = dn_expand(answer, eom, cp,
- name, sizeof name)) < 0)
- return (n);
- target = zptr->z_ns[j++].nsname;
- strcpy(target, name);
- }
- cp += dlen;
- }
- if (zptr->z_nscount == 0)
- zptr->z_nscount = j;
- /* get addresses for the nameservers */
- for (i = 0; i < arcount; i++) {
- if ((n = dn_expand(answer, eom, cp, name,
- sizeof name)) < 0)
- return (n);
- cp += n;
- if (cp + 3 * INT16SZ + INT32SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- GETLONG(ttl, cp);
- GETSHORT(dlen, cp);
- if (cp + dlen > eom)
- return (-1);
- if (type == T_A && dlen == INT32SZ && class == qclass) {
- for (j = 0; j < zptr->z_nscount; j++)
- if (strcasecmp(name, zptr->z_ns[j].nsname) == 0) {
- memcpy(&zptr->z_ns[j].nsaddr1.s_addr, cp,
- INT32SZ);
- break;
- }
- }
- cp += dlen;
- }
- if (zptr->z_nscount == 0) {
- dname = zname;
- qtype = T_NS;
- continue;
- }
- done = 1;
- for (k = 0; k < zptr->z_nscount; k++)
- if (zptr->z_ns[k].nsaddr1.s_addr == 0) {
- done = 0;
- dname = zptr->z_ns[k].nsname;
- qtype = T_A;
- }
-
- } /* while */
- }
-
- _res.options |= RES_DEBUG;
- for (zptr = zgrp_start; zptr; zptr = zptr->z_next) {
-
- /* append zone section */
- rrecp = res_mkupdrec(ns_s_zn, zptr->z_origin,
- zptr->z_class, ns_t_soa, 0);
- if (rrecp == NULL) {
- fprintf(stderr, "saverrec error\n");
- fflush(stderr);
- return (-1);
- }
- rrecp->r_grpnext = zptr->z_rr;
- zptr->z_rr = rrecp;
-
- n = res_mkupdate(zptr->z_rr, packet, sizeof packet);
- if (n < 0) {
- fprintf(stderr, "res_mkupdate error\n");
- fflush(stderr);
- return (-1);
- } else
- fprintf(stdout, "res_mkupdate: packet size = %d\n", n);
-
- /*
- * Override the list of NS records from res_init() with
- * the authoritative nameservers for the zone being updated.
- * Sort primary to be the first in the list of nameservers.
- */
- for (i = 0; i < zptr->z_nscount; i++) {
- if (strcasecmp(zptr->z_ns[i].nsname,
- zptr->z_soardata) == 0) {
- struct in_addr tmpaddr;
-
- if (i != 0) {
- strcpy(zptr->z_ns[i].nsname,
- zptr->z_ns[0].nsname);
- strcpy(zptr->z_ns[0].nsname,
- zptr->z_soardata);
- tmpaddr = zptr->z_ns[i].nsaddr1;
- zptr->z_ns[i].nsaddr1 =
- zptr->z_ns[0].nsaddr1;
- zptr->z_ns[0].nsaddr1 = tmpaddr;
- }
- break;
- }
- }
- for (i = 0; i < MAXNS; i++) {
- _res.nsaddr_list[i].sin_addr = zptr->z_ns[i].nsaddr1;
- _res.nsaddr_list[i].sin_family = AF_INET;
- _res.nsaddr_list[i].sin_port = htons(NAMESERVER_PORT);
- }
- _res.nscount = (zptr->z_nscount < MAXNS) ?
- zptr->z_nscount : MAXNS;
- n = res_send(packet, n, answer, sizeof(answer));
- if (n < 0) {
- fprintf(stderr, "res_send: send error, n=%d\n", n);
- break;
- } else
- numzones++;
- }
-
- /* free malloc'ed memory */
- while(zgrp_start) {
- zptr = zgrp_start;
- zgrp_start = zgrp_start->z_next;
- res_freeupdrec(zptr->z_rr); /* Zone section we allocated. */
- free((char *)zptr);
- }
-
- return (numzones);
-}
diff --git a/c/src/exec/libnetworking/libc/resolver.3 b/c/src/exec/libnetworking/libc/resolver.3
deleted file mode 100644
index 8c6f18334f..0000000000
--- a/c/src/exec/libnetworking/libc/resolver.3
+++ /dev/null
@@ -1,352 +0,0 @@
-.\" Copyright (c) 1985, 1991, 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.
-.\"
-.\" @(#)resolver.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt RESOLVER 3
-.Os BSD 4.3
-.Sh NAME
-.Nm res_query ,
-.Nm res_search ,
-.Nm res_mkquery ,
-.Nm res_send ,
-.Nm res_init ,
-.Nm dn_comp ,
-.Nm dn_expand
-.Nd resolver routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netinet/in.h>
-.Fd #include <arpa/nameser.h>
-.Fd #include <resolv.h>
-.Ft int
-.Fo res_query
-.Fa "const char *dname"
-.Fa "int class"
-.Fa "int type"
-.Fa "u_char *answer"
-.Fa "int anslen"
-.Fc
-.Ft int
-.Fo res_search
-.Fa "const char *dname"
-.Fa "int class"
-.Fa "int type"
-.Fa "u_char *answer"
-.Fa "int anslen"
-.Fc
-.Ft int
-.Fo res_mkquery
-.Fa "int op"
-.Fa "const char *dname"
-.Fa "int class"
-.Fa "int type"
-.Fa "const u_char *data"
-.Fa "int datalen"
-.Fa "const u_char *newrr_in"
-.Fa "u_char *buf"
-.Fa "int buflen"
-.Fc
-.Ft int
-.Fo res_send
-.Fa "const u_char *msg"
-.Fa "int msglen"
-.Fa "u_char *answer"
-.Fa "int anslen"
-.Fc
-.Ft int
-.Fn res_init
-.Fo dn_comp
-.Fa "const char *exp_dn"
-.Fa "u_char *comp_dn"
-.Fa "int length"
-.Fa "u_char **dnptrs"
-.Fa "u_char **lastdnptr"
-.Fc
-.Ft int
-.Fo dn_expand
-.Fa "const u_char *msg"
-.Fa "const u_char *eomorig"
-.Fa "const u_char *comp_dn"
-.Fa "char *exp_dn"
-.Fa "int length"
-.Fc
-.Sh DESCRIPTION
-These routines are used for making, sending and interpreting
-query and reply messages with Internet domain name servers.
-.Pp
-Global configuration and state information that is used by the
-resolver routines is kept in the structure
-.Em _res .
-Most of the values have reasonable defaults and can be ignored.
-Options
-stored in
-.Em _res.options
-are defined in
-.Pa resolv.h
-and are as follows.
-Options are stored as a simple bit mask containing the bitwise ``or''
-of the options enabled.
-.Bl -tag -width RES_DEFNAMES
-.It Dv RES_INIT
-True if the initial name server address and default domain name are
-initialized (i.e.,
-.Fn res_init
-has been called).
-.It Dv RES_DEBUG
-Print debugging messages.
-.It Dv RES_AAONLY
-Accept authoritative answers only.
-With this option,
-.Fn res_send
-should continue until it finds an authoritative answer or finds an error.
-Currently this is not implemented.
-.It Dv RES_USEVC
-Use
-.Tn TCP
-connections for queries instead of
-.Tn UDP
-datagrams.
-.It Dv RES_STAYOPEN
-Used with
-.Dv RES_USEVC
-to keep the
-.Tn TCP
-connection open between
-queries.
-This is useful only in programs that regularly do many queries.
-.Tn UDP
-should be the normal mode used.
-.It Dv RES_IGNTC
-Unused currently (ignore truncation errors, i.e., don't retry with
-.Tn TCP ) .
-.It Dv RES_RECURSE
-Set the recursion-desired bit in queries.
-This is the default.
-.Pf ( Fn res_send
-does not do iterative queries and expects the name server
-to handle recursion.)
-.It Dv RES_DEFNAMES
-If set,
-.Fn res_search
-will append the default domain name to single-component names
-(those that do not contain a dot).
-This option is enabled by default.
-.It Dv RES_DNSRCH
-If this option is set,
-.Fn res_search
-will search for host names in the current domain and in parent domains; see
-.Xr hostname 7 .
-This is used by the standard host lookup routine
-.Xr gethostbyname 3 .
-This option is enabled by default.
-.It Dv RES_NOALIASES
-This option turns off the user level aliasing feature controlled by the
-.Dq Ev HOSTALIASES
-environment variable. Network daemons should set this option.
-.El
-.Pp
-The
-.Fn res_init
-routine
-reads the configuration file (if any; see
-.Xr resolver 5 )
-to get the default domain name,
-search list and
-the Internet address of the local name server(s).
-If no server is configured, the host running
-the resolver is tried.
-The current domain name is defined by the hostname
-if not specified in the configuration file;
-it can be overridden by the environment variable
-.Ev LOCALDOMAIN .
-This environment variable may contain several blank-separated
-tokens if you wish to override the
-.Em "search list"
-on a per-process basis. This is similar to the
-.Em search
-command in the configuration file.
-Another environment variable (
-.Dq Ev RES_OPTIONS
-can be set to
-override certain internal resolver options which are otherwise
-set by changing fields in the
-.Em _res
-structure or are inherited from the configuration file's
-.Em options
-command. The syntax of the
-.Dq Ev RES_OPTIONS
-environment variable is explained in
-.Xr resolver 5 .
-Initialization normally occurs on the first call
-to one of the following routines.
-.Pp
-The
-.Fn res_query
-function provides an interface to the server query mechanism.
-It constructs a query, sends it to the local server,
-awaits a response, and makes preliminary checks on the reply.
-The query requests information of the specified
-.Fa type
-and
-.Fa class
-for the specified fully-qualified domain name
-.Fa dname .
-The reply message is left in the
-.Fa answer
-buffer with length
-.Fa anslen
-supplied by the caller.
-.Pp
-The
-.Fn res_search
-routine makes a query and awaits a response like
-.Fn res_query ,
-but in addition, it implements the default and search rules
-controlled by the
-.Dv RES_DEFNAMES
-and
-.Dv RES_DNSRCH
-options.
-It returns the first successful reply.
-.Pp
-The remaining routines are lower-level routines used by
-.Fn res_query .
-The
-.Fn res_mkquery
-function
-constructs a standard query message and places it in
-.Fa buf .
-It returns the size of the query, or \-1 if the query is
-larger than
-.Fa buflen .
-The query type
-.Fa op
-is usually
-.Dv QUERY ,
-but can be any of the query types defined in
-.Aq Pa arpa/nameser.h .
-The domain name for the query is given by
-.Fa dname .
-.Fa Newrr
-is currently unused but is intended for making update messages.
-.Pp
-The
-.Fn res_send
-routine
-sends a pre-formatted query and returns an answer.
-It will call
-.Fn res_init
-if
-.Dv RES_INIT
-is not set, send the query to the local name server, and
-handle timeouts and retries.
-The length of the reply message is returned, or
-\-1 if there were errors.
-.Pp
-The
-.Fn dn_comp
-function
-compresses the domain name
-.Fa exp_dn
-and stores it in
-.Fa comp_dn .
-The size of the compressed name is returned or \-1 if there were errors.
-The size of the array pointed to by
-.Fa comp_dn
-is given by
-.Fa length .
-The compression uses
-an array of pointers
-.Fa dnptrs
-to previously-compressed names in the current message.
-The first pointer points to
-to the beginning of the message and the list ends with
-.Dv NULL .
-The limit to the array is specified by
-.Fa lastdnptr .
-A side effect of
-.Fn dn_comp
-is to update the list of pointers for
-labels inserted into the message
-as the name is compressed.
-If
-.Em dnptr
-is
-.Dv NULL, names are not compressed.
-If
-.Fa lastdnptr
-is
-.Dv NULL ,
-the list of labels is not updated.
-.Pp
-The
-.Fn dn_expand
-entry
-expands the compressed domain name
-.Fa comp_dn
-to a full domain name
-The compressed name is contained in a query or reply message;
-.Fa msg
-is a pointer to the beginning of the message.
-The uncompressed name is placed in the buffer indicated by
-.Fa exp_dn
-which is of size
-.Fa length .
-The size of compressed name is returned or \-1 if there was an error.
-.Sh FILES
-.Bl -tag -width Pa
-/etc/resolv.conf
-The configuration file
-see
-.Xr resolver 5 .
-.El
-.Sh SEE ALSO
-.Xr gethostbyname 3 ,
-.Xr resolver 5 ,
-.Xr hostname 7 ,
-.Xr named 8
-.Pp
-.%T RFC1032 ,
-.%T RFC1033 ,
-.%T RFC1034 ,
-.%T RFC1035 ,
-.%T RFC974
-.Rs
-.%T "Name Server Operations Guide for BIND"
-.Re
-.Sh HISTORY
-The
-.Nm
-function appeared in
-.Bx 4.3 .
diff --git a/c/src/exec/libnetworking/libc/send.c b/c/src/exec/libnetworking/libc/send.c
deleted file mode 100644
index ad14bd3cd2..0000000000
--- a/c/src/exec/libnetworking/libc/send.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)send.c 8.2 (Berkeley) 2/21/94";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <stddef.h>
-
-ssize_t
-send(s, msg, len, flags)
- int s, flags;
- size_t len;
- const void *msg;
-{
- return (sendto(s, msg, len, flags, NULL, 0));
-}
diff --git a/c/src/exec/libnetworking/libc/strsep.c b/c/src/exec/libnetworking/libc/strsep.c
deleted file mode 100644
index 182319493d..0000000000
--- a/c/src/exec/libnetworking/libc/strsep.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * Copyright (c) 1990, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <string.h>
-#include <stdio.h>
-
-/*
- * Get next token from string *stringp, where tokens are possibly-empty
- * strings separated by characters from delim.
- *
- * Writes NULs into the string at *stringp to end tokens.
- * delim need not remain constant from call to call.
- * On return, *stringp points past the last NUL written (if there might
- * be further tokens), or is NULL (if there are definitely no more tokens).
- *
- * If *stringp is NULL, strsep returns NULL.
- *
- * PUBLIC: #ifndef HAVE_STRSEP
- * PUBLIC: char *strsep __P((char **, const char *));
- * PUBLIC: #endif
- */
-char *
-strsep(stringp, delim)
- register char **stringp;
- register const char *delim;
-{
- register char *s;
- register const char *spanp;
- register int c, sc;
- char *tok;
-
- if ((s = *stringp) == NULL)
- return (NULL);
- for (tok = s;;) {
- c = *s++;
- spanp = delim;
- do {
- if ((sc = *spanp++) == c) {
- if (c == 0)
- s = NULL;
- else
- s[-1] = 0;
- *stringp = s;
- return (tok);
- }
- } while (sc != 0);
- }
- /* NOTREACHED */
-}
diff --git a/c/src/exec/libnetworking/loop.h b/c/src/exec/libnetworking/loop.h
deleted file mode 100644
index 34e0b828e4..0000000000
--- a/c/src/exec/libnetworking/loop.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-#define NLOOP 1
diff --git a/c/src/exec/libnetworking/machine/conf.h b/c/src/exec/libnetworking/machine/conf.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/exec/libnetworking/machine/conf.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/exec/libnetworking/machine/cpu.h b/c/src/exec/libnetworking/machine/cpu.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/exec/libnetworking/machine/cpu.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/exec/libnetworking/machine/cpufunc.h b/c/src/exec/libnetworking/machine/cpufunc.h
deleted file mode 100644
index 2b4c47e48f..0000000000
--- a/c/src/exec/libnetworking/machine/cpufunc.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
diff --git a/c/src/exec/libnetworking/machine/endian.h b/c/src/exec/libnetworking/machine/endian.h
deleted file mode 100644
index 6b17da58d3..0000000000
--- a/c/src/exec/libnetworking/machine/endian.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef _MACHINE_ENDIAN_H_
-#define _MACHINE_ENDIAN_H_
-
-#include <rtems/score/cpu.h>
-
-/*
- * BSD-style endian declaration
- */
-#define BIG_ENDIAN 4321
-#define LITTLE_ENDIAN 1234
-
-#if CPU_BIG_ENDIAN
-# define BYTE_ORDER BIG_ENDIAN
-#elif CPU_LITTLE_ENDIAN
-# define BYTE_ORDER LITTLE_ENDIAN
-#else
-# error "Can't decide which end is which!"
-#endif
-
-#if ( CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES == FALSE )
-
-#if ( CPU_BIG_ENDIAN == TRUE )
-
-/*
- * Very simply on big endian CPUs
- */
-
-#define ntohl(_x) (_x)
-#define ntohs(_x) (_x)
-#define htonl(_x) (_x)
-#define htons(_x) (_x)
-
-#define NTOHS(x)
-#define HTONS(x)
-#define NTOHL(x)
-#define HTONL(x)
-
-#elif ( CPU_LITTLE_ENDIAN == TRUE )
-
-/*
- * A little more complicated on little endian CPUs
- */
-
-#define ntohl(_x) ((long) CPU_swap_u32((unsigned32)_x))
-#define ntohs(_x) ((short) CPU_swap_u16((unsigned16)_x))
-#define htonl(_x) ((long) CPU_swap_u32((unsigned32)_x))
-#define htons(_x) ((short) CPU_swap_u16((unsigned16)_x))
-
-#define NTOHS(x) (x) = ntohs(x)
-#define HTONS(x) (x) = htons(x)
-#define NTOHL(x) (x) = ntohl(x)
-#define HTONL(x) (x) = htonl(x)
-
-#else
-#error "Unknown endian-ness for this cpu"
-#endif
-
-#endif /* CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES */
-
-#endif /* _MACHINE_ENDIAN_H_ */
diff --git a/c/src/exec/libnetworking/machine/in_cksum.h b/c/src/exec/libnetworking/machine/in_cksum.h
deleted file mode 100644
index 15509b3888..0000000000
--- a/c/src/exec/libnetworking/machine/in_cksum.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * Copyright (c) 1990 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.
- *
- * from tahoe: in_cksum.c 1.2 86/01/05
- * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
- * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
- * $Id$
- */
-
-#ifndef _MACHINE_IN_CKSUM_H_
-#define _MACHINE_IN_CKSUM_H_ 1
-
-#include <sys/cdefs.h>
-
-/*
- * It it useful to have an Internet checksum routine which is inlineable
- * and optimized specifically for the task of computing IP header checksums
- * in the normal case (where there are no options and the header length is
- * therefore always exactly five 32-bit words.
- */
-#if (defined(__GNUC__) && defined(__i386__))
-static __inline u_int
-in_cksum_hdr(const struct ip *ip)
-{
- register u_int sum = 0;
-
-#define ADD(n) __asm("addl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (ip))
-#define ADDC(n) __asm("adcl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (ip))
-#define MOP __asm("adcl $0, %0" : "=r" (sum) : "0" (sum))
-
- ADD(0);
- ADDC(4);
- ADDC(8);
- ADDC(12);
- ADDC(16);
- MOP;
- sum = (sum & 0xffff) + (sum >> 16);
- if (sum > 0xffff)
- sum -= 0xffff;
-
- return ~sum & 0xffff;
-}
-
-static __inline void
-in_cksum_update(struct ip *ip)
-{
- int __tmpsum;
- __tmpsum = (int)ntohs(ip->ip_sum) + 256;
- ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
-}
-
-#elif (defined(__GNUC__) && (defined(__mc68000__) || defined(__m68k__)))
-
-static __inline__ u_int
-in_cksum_hdr(const struct ip *ip)
-{
- register u_int *ap = (u_int *)ip;
- register u_int sum = *ap++;
- register u_int tmp;
-
- __asm__("addl %2@+,%0\n\t"
- "movel %2@+,%1\n\t"
- "addxl %1,%0\n\t"
- "movel %2@+,%1\n\t"
- "addxl %1,%0\n\t"
- "movel %2@,%1\n\t"
- "addxl %1,%0\n\t"
- "moveq #0,%1\n\t"
- "addxl %1,%0\n" :
- "=d" (sum), "=d" (tmp), "=a" (ap) :
- "0" (sum), "2" (ap));
- sum = (sum & 0xffff) + (sum >> 16);
- if (sum > 0xffff)
- sum -= 0xffff;
- return ~sum & 0xffff;
-}
-
-#else
-u_int in_cksum_hdr __P((const struct ip *));
-#define in_cksum_update(ip) \
- do { \
- int __tmpsum; \
- __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
- ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
- } while(0)
-
-#endif
-
-#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/c/src/exec/libnetworking/machine/limits.h b/c/src/exec/libnetworking/machine/limits.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/exec/libnetworking/machine/limits.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/exec/libnetworking/machine/param.h b/c/src/exec/libnetworking/machine/param.h
deleted file mode 100644
index 4168f1f6cf..0000000000
--- a/c/src/exec/libnetworking/machine/param.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef _MACHINE_PARAM_H_
-#define _MACHINE_PARAM_H_
-
-/*
- * These aren't really machine-dependent for RTEMS.....
- */
-
-/*
-#define MACHINE "i386"
-#define MID_MACHINE MID_I386
-*/
-
-/*
- * Round p (pointer or byte index) up to a correctly-aligned value
- * for all data types (int, long, ...). The result is unsigned int
- * and must be cast to any desired pointer type.
- */
-#define ALIGNBYTES (sizeof(int) - 1)
-#define ALIGN(p) (((unsigned)(p) + ALIGNBYTES) & ~ALIGNBYTES)
-
-#define PAGE_SHIFT 12 /* LOG2(PAGE_SIZE) */
-#define PAGE_SIZE (1<<PAGE_SHIFT) /* bytes/page */
-#define PAGE_MASK (PAGE_SIZE-1)
-#define NPTEPG (PAGE_SIZE/(sizeof (pt_entry_t)))
-
-#define NPDEPG (PAGE_SIZE/(sizeof (pd_entry_t)))
-#define PDRSHIFT 22 /* LOG2(NBPDR) */
-#define NBPDR (1<<PDRSHIFT) /* bytes/page dir */
-
-#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
-#define DEV_BSIZE (1<<DEV_BSHIFT)
-
-#define BLKDEV_IOSIZE 2048
-#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
-
-#define UPAGES 2 /* pages of u-area */
-
-/*
- * Constants related to network buffer management.
- * MCLBYTES must be no larger than CLBYTES (the software page size), and,
- * on machines that exchange pages of input or output buffers with mbuf
- * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
- * of the hardware page size.
- */
-#ifndef MSIZE
-#define MSIZE 128 /* size of an mbuf */
-#endif /* MSIZE */
-
-#ifndef MCLSHIFT
-#define MCLSHIFT 11 /* convert bytes to m_buf clusters */
-#endif /* MCLSHIFT */
-#define MCLBYTES (1 << MCLSHIFT) /* size of an m_buf cluster */
-#define MCLOFSET (MCLBYTES - 1) /* offset within an m_buf cluster */
-
-/*
- * Some macros for units conversion
- */
-
-/* clicks to bytes */
-#define ctob(x) ((x)<<PAGE_SHIFT)
-
-/* bytes to clicks */
-#define btoc(x) (((unsigned)(x)+PAGE_MASK)>>PAGE_SHIFT)
-
-/*
- * btodb() is messy and perhaps slow because `bytes' may be an off_t. We
- * want to shift an unsigned type to avoid sign extension and we don't
- * want to widen `bytes' unnecessarily. Assume that the result fits in
- * a daddr_t.
- */
-#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
- (sizeof (bytes) > sizeof(long) \
- ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \
- : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT))
-
-#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
- ((off_t)(db) << DEV_BSHIFT)
-
-/*
- * Mach derived conversion macros
- */
-#define trunc_page(x) ((unsigned)(x) & ~PAGE_MASK)
-#define round_page(x) ((((unsigned)(x)) + PAGE_MASK) & ~PAGE_MASK)
-
-#define atop(x) ((unsigned)(x) >> PAGE_SHIFT)
-#define ptoa(x) ((unsigned)(x) << PAGE_SHIFT)
-
-#endif /* !_MACHINE_PARAM_H_ */
diff --git a/c/src/exec/libnetworking/machine/types.h b/c/src/exec/libnetworking/machine/types.h
deleted file mode 100644
index 730a6dec1d..0000000000
--- a/c/src/exec/libnetworking/machine/types.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file will have to be incorparated into the RTEMS source
- * tree (probably in the existing <machine/types.h> so that these
- * contents are included when an application source file includes
- * <sys/types.h>.
- *
- * $Id$
- */
-
-#ifndef _MACHINE_TYPES_H_
-#define _MACHINE_TYPES_H_
-
-#include <rtems.h>
-#include <machine/endian.h>
-
-typedef rtems_signed64 int64_t;
-typedef rtems_signed32 int32_t;
-typedef rtems_signed16 int16_t;
-typedef rtems_signed8 int8_t;
-
-typedef rtems_unsigned64 u_int64_t;
-typedef rtems_unsigned32 u_int32_t;
-typedef rtems_unsigned16 u_int16_t;
-typedef rtems_unsigned8 u_int8_t;
-
-#define _CLOCK_T_ unsigned long
-#define _TIME_T_ long
-
-#ifdef _COMPILING_BSD_KERNEL_
-#include <rtems/rtems_bsdnet_internal.h>
-#include <rtems/rtems_bsdnet.h>
-#endif
-
-#endif /* _MACHINE_TYPES_H_ */
diff --git a/c/src/exec/libnetworking/machine/vmparam.h b/c/src/exec/libnetworking/machine/vmparam.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/exec/libnetworking/machine/vmparam.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/exec/libnetworking/net/bpf.h b/c/src/exec/libnetworking/net/bpf.h
deleted file mode 100644
index 7847d72470..0000000000
--- a/c/src/exec/libnetworking/net/bpf.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 1990, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from the Stanford/CMU enet packet filter,
- * (net/enet.c) distributed as part of 4.3BSD, and code contributed
- * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
- * Berkeley Laboratory.
- *
- * 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.
- *
- * @(#)bpf.h 8.1 (Berkeley) 6/10/93
- * @(#)bpf.h 1.34 (LBL) 6/16/96
- *
- * $Id$
- */
-
-#ifndef _NET_BPF_H_
-#define _NET_BPF_H_
-
-/* BSD style release date */
-#define BPF_RELEASE 199606
-
-typedef int32_t bpf_int32;
-typedef u_int32_t bpf_u_int32;
-
-/*
- * Alignment macros. BPF_WORDALIGN rounds up to the next
- * even multiple of BPF_ALIGNMENT.
- */
-#define BPF_ALIGNMENT sizeof(bpf_int32)
-#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))
-
-#define BPF_MAXINSNS 512
-#define BPF_MAXBUFSIZE 0x8000
-#define BPF_MINBUFSIZE 32
-
-/*
- * Structure for BIOCSETF.
- */
-struct bpf_program {
- u_int bf_len;
- struct bpf_insn *bf_insns;
-};
-
-/*
- * Struct returned by BIOCGSTATS.
- */
-struct bpf_stat {
- u_int bs_recv; /* number of packets received */
- u_int bs_drop; /* number of packets dropped */
-};
-
-/*
- * Struct return by BIOCVERSION. This represents the version number of
- * the filter language described by the instruction encodings below.
- * bpf understands a program iff kernel_major == filter_major &&
- * kernel_minor >= filter_minor, that is, if the value returned by the
- * running kernel has the same major number and a minor number equal
- * equal to or less than the filter being downloaded. Otherwise, the
- * results are undefined, meaning an error may be returned or packets
- * may be accepted haphazardly.
- * It has nothing to do with the source code version.
- */
-struct bpf_version {
- u_short bv_major;
- u_short bv_minor;
-};
-/* Current version number of filter architecture. */
-#define BPF_MAJOR_VERSION 1
-#define BPF_MINOR_VERSION 1
-
-#define BIOCGBLEN _IOR('B',102, u_int)
-#define BIOCSBLEN _IOWR('B',102, u_int)
-#define BIOCSETF _IOW('B',103, struct bpf_program)
-#define BIOCFLUSH _IO('B',104)
-#define BIOCPROMISC _IO('B',105)
-#define BIOCGDLT _IOR('B',106, u_int)
-#define BIOCGETIF _IOR('B',107, struct ifreq)
-#define BIOCSETIF _IOW('B',108, struct ifreq)
-#define BIOCSRTIMEOUT _IOW('B',109, struct timeval)
-#define BIOCGRTIMEOUT _IOR('B',110, struct timeval)
-#define BIOCGSTATS _IOR('B',111, struct bpf_stat)
-#define BIOCIMMEDIATE _IOW('B',112, u_int)
-#define BIOCVERSION _IOR('B',113, struct bpf_version)
-#define BIOCGRSIG _IOR('B',114, u_int)
-#define BIOCSRSIG _IOW('B',115, u_int)
-
-/*
- * Structure prepended to each packet.
- */
-struct bpf_hdr {
- struct timeval bh_tstamp; /* time stamp */
- bpf_u_int32 bh_caplen; /* length of captured portion */
- bpf_u_int32 bh_datalen; /* original length of packet */
- u_short bh_hdrlen; /* length of bpf header (this struct
- plus alignment padding) */
-};
-/*
- * Because the structure above is not a multiple of 4 bytes, some compilers
- * will insist on inserting padding; hence, sizeof(struct bpf_hdr) won't work.
- * Only the kernel needs to know about it; applications use bh_hdrlen.
- */
-#ifdef KERNEL
-#define SIZEOF_BPF_HDR 18
-#endif
-
-/*
- * Data-link level type codes.
- */
-#define DLT_NULL 0 /* no link-layer encapsulation */
-#define DLT_EN10MB 1 /* Ethernet (10Mb) */
-#define DLT_EN3MB 2 /* Experimental Ethernet (3Mb) */
-#define DLT_AX25 3 /* Amateur Radio AX.25 */
-#define DLT_PRONET 4 /* Proteon ProNET Token Ring */
-#define DLT_CHAOS 5 /* Chaos */
-#define DLT_IEEE802 6 /* IEEE 802 Networks */
-#define DLT_ARCNET 7 /* ARCNET */
-#define DLT_SLIP 8 /* Serial Line IP */
-#define DLT_PPP 9 /* Point-to-point Protocol */
-#define DLT_FDDI 10 /* FDDI */
-#define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */
-
-/*
- * The instruction encodings.
- */
-/* instruction classes */
-#define BPF_CLASS(code) ((code) & 0x07)
-#define BPF_LD 0x00
-#define BPF_LDX 0x01
-#define BPF_ST 0x02
-#define BPF_STX 0x03
-#define BPF_ALU 0x04
-#define BPF_JMP 0x05
-#define BPF_RET 0x06
-#define BPF_MISC 0x07
-
-/* ld/ldx fields */
-#define BPF_SIZE(code) ((code) & 0x18)
-#define BPF_W 0x00
-#define BPF_H 0x08
-#define BPF_B 0x10
-#define BPF_MODE(code) ((code) & 0xe0)
-#define BPF_IMM 0x00
-#define BPF_ABS 0x20
-#define BPF_IND 0x40
-#define BPF_MEM 0x60
-#define BPF_LEN 0x80
-#define BPF_MSH 0xa0
-
-/* alu/jmp fields */
-#define BPF_OP(code) ((code) & 0xf0)
-#define BPF_ADD 0x00
-#define BPF_SUB 0x10
-#define BPF_MUL 0x20
-#define BPF_DIV 0x30
-#define BPF_OR 0x40
-#define BPF_AND 0x50
-#define BPF_LSH 0x60
-#define BPF_RSH 0x70
-#define BPF_NEG 0x80
-#define BPF_JA 0x00
-#define BPF_JEQ 0x10
-#define BPF_JGT 0x20
-#define BPF_JGE 0x30
-#define BPF_JSET 0x40
-#define BPF_SRC(code) ((code) & 0x08)
-#define BPF_K 0x00
-#define BPF_X 0x08
-
-/* ret - BPF_K and BPF_X also apply */
-#define BPF_RVAL(code) ((code) & 0x18)
-#define BPF_A 0x10
-
-/* misc */
-#define BPF_MISCOP(code) ((code) & 0xf8)
-#define BPF_TAX 0x00
-#define BPF_TXA 0x80
-
-/*
- * The instruction data structure.
- */
-struct bpf_insn {
- u_short code;
- u_char jt;
- u_char jf;
- bpf_u_int32 k;
-};
-
-/*
- * Macros for insn array initializers.
- */
-#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }
-#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }
-
-#ifdef KERNEL
-int bpf_validate __P((struct bpf_insn *, int));
-void bpf_tap __P((struct ifnet *, u_char *, u_int));
-void bpf_mtap __P((struct ifnet *, struct mbuf *));
-void bpfattach __P((struct ifnet *, u_int, u_int));
-void bpfilterattach __P((int));
-u_int bpf_filter __P((struct bpf_insn *, u_char *, u_int, u_int));
-#endif
-
-/*
- * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
- */
-#define BPF_MEMWORDS 16
-
-#endif
diff --git a/c/src/exec/libnetworking/net/ethernet.h b/c/src/exec/libnetworking/net/ethernet.h
deleted file mode 100644
index c6c07189ec..0000000000
--- a/c/src/exec/libnetworking/net/ethernet.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Fundamental constants relating to ethernet.
- *
- * $Id$
- *
- */
-
-#ifndef _NET_ETHERNET_H_
-#define _NET_ETHERNET_H_
-
-/*
- * The number of bytes in an ethernet (MAC) address.
- */
-#define ETHER_ADDR_LEN 6
-
-/*
- * The number of bytes in the type field.
- */
-#define ETHER_TYPE_LEN 2
-
-/*
- * The number of bytes in the trailing CRC field.
- */
-#define ETHER_CRC_LEN 4
-
-/*
- * The length of the combined header.
- */
-#define ETHER_HDR_LEN (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
-
-/*
- * The minimum packet length.
- */
-#define ETHER_MIN_LEN 64
-
-/*
- * The maximum packet length.
- */
-#define ETHER_MAX_LEN 1518
-
-/*
- * A macro to validate a length with
- */
-#define ETHER_IS_VALID_LEN(foo) \
- ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
-
-/*
- * Structure of a 10Mb/s Ethernet header.
- */
-struct ether_header {
- u_char ether_dhost[ETHER_ADDR_LEN];
- u_char ether_shost[ETHER_ADDR_LEN];
- u_short ether_type;
-};
-
-/*
- * Structure of a 48-bit Ethernet address.
- */
-struct ether_addr {
- u_char octet[ETHER_ADDR_LEN];
-};
-
-#endif
diff --git a/c/src/exec/libnetworking/net/if.c b/c/src/exec/libnetworking/net/if.c
deleted file mode 100644
index af6f003de3..0000000000
--- a/c/src/exec/libnetworking/net/if.c
+++ /dev/null
@@ -1,783 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)if.c 8.3 (Berkeley) 1/4/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/mbuf.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/kernel.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/if_types.h>
-#include <net/radix.h>
-
-/*
- * System initialization
- */
-
-static int ifconf __P((int, caddr_t));
- void ifinit __P((void *));
-static void if_qflush __P((struct ifqueue *));
-static void if_slowtimo __P((void *));
-static void link_rtrequest __P((int, struct rtentry *, struct sockaddr *));
-
-SYSINIT(interfaces, SI_SUB_PROTO_IF, SI_ORDER_FIRST, ifinit, NULL)
-
-
-int ifqmaxlen = IFQ_MAXLEN;
-struct ifnet *ifnet;
-
-/*
- * Network interface utility routines.
- *
- * Routines with ifa_ifwith* names take sockaddr *'s as
- * parameters.
- *
- * This routine assumes that it will be called at splimp() or higher.
- */
-/* ARGSUSED*/
-void
-ifinit(dummy)
- void *dummy;
-{
- register struct ifnet *ifp;
-
- for (ifp = ifnet; ifp; ifp = ifp->if_next)
- if (ifp->if_snd.ifq_maxlen == 0)
- ifp->if_snd.ifq_maxlen = ifqmaxlen;
- if_slowtimo(0);
-}
-
-int if_index = 0;
-struct ifaddr **ifnet_addrs;
-
-
-/*
- * Attach an interface to the
- * list of "active" interfaces.
- */
-void
-if_attach(ifp)
- struct ifnet *ifp;
-{
- unsigned socksize, ifasize;
- int namelen, masklen;
- char workbuf[64];
- register struct ifnet **p = &ifnet;
- register struct sockaddr_dl *sdl;
- register struct ifaddr *ifa;
- static int if_indexlim = 8;
-
-
- while (*p)
- p = &((*p)->if_next);
- *p = ifp;
- ifp->if_index = ++if_index;
- microtime(&ifp->if_lastchange);
- if (ifnet_addrs == 0 || if_index >= if_indexlim) {
- unsigned n = (if_indexlim <<= 1) * sizeof(ifa);
- struct ifaddr **q = (struct ifaddr **)
- malloc(n, M_IFADDR, M_WAITOK);
- bzero((caddr_t)q, n);
- if (ifnet_addrs) {
- bcopy((caddr_t)ifnet_addrs, (caddr_t)q, n/2);
- free((caddr_t)ifnet_addrs, M_IFADDR);
- }
- ifnet_addrs = q;
- }
- /*
- * create a Link Level name for this device
- */
- namelen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit);
-#define _offsetof(t, m) ((int)((caddr_t)&((t *)0)->m))
- masklen = _offsetof(struct sockaddr_dl, sdl_data[0]) + namelen;
- socksize = masklen + ifp->if_addrlen;
-#define ROUNDUP(a) (1 + (((a) - 1) | (sizeof(long) - 1)))
- socksize = ROUNDUP(socksize);
- if (socksize < sizeof(*sdl))
- socksize = sizeof(*sdl);
- ifasize = sizeof(*ifa) + 2 * socksize;
- ifa = (struct ifaddr *)malloc(ifasize, M_IFADDR, M_WAITOK);
- if (ifa) {
- bzero((caddr_t)ifa, ifasize);
- sdl = (struct sockaddr_dl *)(ifa + 1);
- sdl->sdl_len = socksize;
- sdl->sdl_family = AF_LINK;
- bcopy(workbuf, sdl->sdl_data, namelen);
- sdl->sdl_nlen = namelen;
- sdl->sdl_index = ifp->if_index;
- sdl->sdl_type = ifp->if_type;
- ifnet_addrs[if_index - 1] = ifa;
- ifa->ifa_ifp = ifp;
- ifa->ifa_next = ifp->if_addrlist;
- ifa->ifa_rtrequest = link_rtrequest;
- ifp->if_addrlist = ifa;
- ifa->ifa_addr = (struct sockaddr *)sdl;
-
- sdl = (struct sockaddr_dl *)(socksize + (caddr_t)sdl);
- ifa->ifa_netmask = (struct sockaddr *)sdl;
- sdl->sdl_len = masklen;
- while (namelen != 0)
- sdl->sdl_data[--namelen] = 0xff;
- }
-}
-/*
- * Locate an interface based on a complete address.
- */
-/*ARGSUSED*/
-struct ifaddr *
-ifa_ifwithaddr(addr)
- register struct sockaddr *addr;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
-
-#define equal(a1, a2) \
- (bcmp((caddr_t)(a1), (caddr_t)(a2), ((struct sockaddr *)(a1))->sa_len) == 0)
- for (ifp = ifnet; ifp; ifp = ifp->if_next)
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr->sa_family != addr->sa_family)
- continue;
- if (equal(addr, ifa->ifa_addr))
- return (ifa);
- if ((ifp->if_flags & IFF_BROADCAST) && ifa->ifa_broadaddr &&
- equal(ifa->ifa_broadaddr, addr))
- return (ifa);
- }
- return ((struct ifaddr *)0);
-}
-/*
- * Locate the point to point interface with a given destination address.
- */
-/*ARGSUSED*/
-struct ifaddr *
-ifa_ifwithdstaddr(addr)
- register struct sockaddr *addr;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
-
- for (ifp = ifnet; ifp; ifp = ifp->if_next)
- if (ifp->if_flags & IFF_POINTOPOINT)
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr->sa_family != addr->sa_family)
- continue;
- if (ifa->ifa_dstaddr && equal(addr, ifa->ifa_dstaddr))
- return (ifa);
- }
- return ((struct ifaddr *)0);
-}
-
-/*
- * Find an interface on a specific network. If many, choice
- * is most specific found.
- */
-struct ifaddr *
-ifa_ifwithnet(addr)
- struct sockaddr *addr;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
- struct ifaddr *ifa_maybe = (struct ifaddr *) 0;
- u_int af = addr->sa_family;
- char *addr_data = addr->sa_data, *cplim;
-
- if (af == AF_LINK) {
- register struct sockaddr_dl *sdl = (struct sockaddr_dl *)addr;
- if (sdl->sdl_index && sdl->sdl_index <= if_index)
- return (ifnet_addrs[sdl->sdl_index - 1]);
- }
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- register char *cp, *cp2, *cp3;
-
- if (ifa->ifa_addr->sa_family != af)
- next: continue;
- if (ifp->if_flags & IFF_POINTOPOINT) {
- if (ifa->ifa_dstaddr != 0
- && equal(addr, ifa->ifa_dstaddr))
- return (ifa);
- } else {
- /*
- * if we have a special address handler,
- * then use it instead of the generic one.
- */
- if (ifa->ifa_claim_addr) {
- if ((*ifa->ifa_claim_addr)(ifa, addr)) {
- return (ifa);
- } else {
- continue;
- }
- }
-
- /*
- * Scan all the bits in the ifa's address.
- * If a bit dissagrees with what we are
- * looking for, mask it with the netmask
- * to see if it really matters.
- * (A byte at a time)
- */
- if (ifa->ifa_netmask == 0)
- continue;
- cp = addr_data;
- cp2 = ifa->ifa_addr->sa_data;
- cp3 = ifa->ifa_netmask->sa_data;
- cplim = ifa->ifa_netmask->sa_len + (char *)ifa->ifa_netmask;
- while (cp3 < cplim)
- if ((*cp++ ^ *cp2++) & *cp3++)
- goto next;
- if (ifa_maybe == 0 ||
- rn_refines((caddr_t)ifa->ifa_netmask,
- (caddr_t)ifa_maybe->ifa_netmask))
- ifa_maybe = ifa;
- }
- }
- }
- return (ifa_maybe);
-}
-
-/*
- * Find an interface address specific to an interface best matching
- * a given address.
- */
-struct ifaddr *
-ifaof_ifpforaddr(addr, ifp)
- struct sockaddr *addr;
- register struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
- register char *cp, *cp2, *cp3;
- register char *cplim;
- struct ifaddr *ifa_maybe = 0;
- u_int af = addr->sa_family;
-
- if (af >= AF_MAX)
- return (0);
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr->sa_family != af)
- continue;
- if (ifa_maybe == 0)
- ifa_maybe = ifa;
- if (ifa->ifa_netmask == 0) {
- if (equal(addr, ifa->ifa_addr) ||
- (ifa->ifa_dstaddr && equal(addr, ifa->ifa_dstaddr)))
- return (ifa);
- continue;
- }
- if (ifp->if_flags & IFF_POINTOPOINT) {
- if (equal(addr, ifa->ifa_dstaddr))
- return (ifa);
- } else {
- cp = addr->sa_data;
- cp2 = ifa->ifa_addr->sa_data;
- cp3 = ifa->ifa_netmask->sa_data;
- cplim = ifa->ifa_netmask->sa_len + (char *)ifa->ifa_netmask;
- for (; cp3 < cplim; cp3++)
- if ((*cp++ ^ *cp2++) & *cp3)
- break;
- if (cp3 == cplim)
- return (ifa);
- }
- }
- return (ifa_maybe);
-}
-
-#include <net/route.h>
-
-/*
- * Default action when installing a route with a Link Level gateway.
- * Lookup an appropriate real ifa to point to.
- * This should be moved to /sys/net/link.c eventually.
- */
-static void
-link_rtrequest(cmd, rt, sa)
- int cmd;
- register struct rtentry *rt;
- struct sockaddr *sa;
-{
- register struct ifaddr *ifa;
- struct sockaddr *dst;
- struct ifnet *ifp;
-
- if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == 0) ||
- ((ifp = ifa->ifa_ifp) == 0) || ((dst = rt_key(rt)) == 0))
- return;
- ifa = ifaof_ifpforaddr(dst, ifp);
- if (ifa) {
- IFAFREE(rt->rt_ifa);
- rt->rt_ifa = ifa;
- ifa->ifa_refcnt++;
- if (ifa->ifa_rtrequest && ifa->ifa_rtrequest != link_rtrequest)
- ifa->ifa_rtrequest(cmd, rt, sa);
- }
-}
-
-/*
- * Mark an interface down and notify protocols of
- * the transition.
- * NOTE: must be called at splnet or eqivalent.
- */
-void
-if_down(ifp)
- register struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
-
- ifp->if_flags &= ~IFF_UP;
- microtime(&ifp->if_lastchange);
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
- if_qflush(&ifp->if_snd);
- rt_ifmsg(ifp);
-}
-
-/*
- * Mark an interface up and notify protocols of
- * the transition.
- * NOTE: must be called at splnet or eqivalent.
- */
-void
-if_up(ifp)
- register struct ifnet *ifp;
-{
-
- ifp->if_flags |= IFF_UP;
- microtime(&ifp->if_lastchange);
-#ifdef notyet
- register struct ifaddr *ifa;
- /* this has no effect on IP, and will kill all iso connections XXX */
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- pfctlinput(PRC_IFUP, ifa->ifa_addr);
-#endif
- rt_ifmsg(ifp);
-}
-
-/*
- * Flush an interface queue.
- */
-static void
-if_qflush(ifq)
- register struct ifqueue *ifq;
-{
- register struct mbuf *m, *n;
-
- n = ifq->ifq_head;
- while ((m = n) != 0) {
- n = m->m_act;
- m_freem(m);
- }
- ifq->ifq_head = 0;
- ifq->ifq_tail = 0;
- ifq->ifq_len = 0;
-}
-
-/*
- * Handle interface watchdog timer routines. Called
- * from softclock, we decrement timers (if set) and
- * call the appropriate interface routine on expiration.
- */
-static void
-if_slowtimo(arg)
- void *arg;
-{
- register struct ifnet *ifp;
- int s = splimp();
-
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- if (ifp->if_timer == 0 || --ifp->if_timer)
- continue;
- if (ifp->if_watchdog)
- (*ifp->if_watchdog)(ifp);
- }
- splx(s);
- timeout(if_slowtimo, (void *)0, hz / IFNET_SLOWHZ);
-}
-
-/*
- * Map interface name to
- * interface structure pointer.
- */
-struct ifnet *
-ifunit(name)
- register char *name;
-{
- register char *cp;
- register struct ifnet *ifp;
- int unit;
- unsigned len;
- char *ep, c;
-
- for (cp = name; cp < name + IFNAMSIZ && *cp; cp++)
- if (*cp >= '0' && *cp <= '9')
- break;
- if (*cp == '\0' || cp == name + IFNAMSIZ)
- return ((struct ifnet *)0);
- /*
- * Save first char of unit, and pointer to it,
- * so we can put a null there to avoid matching
- * initial substrings of interface names.
- */
- len = cp - name + 1;
- c = *cp;
- ep = cp;
- for (unit = 0; *cp >= '0' && *cp <= '9'; )
- unit = unit * 10 + *cp++ - '0';
- if (*cp != '\0')
- return 0; /* no trailing garbage allowed */
- *ep = 0;
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- if (bcmp(ifp->if_name, name, len))
- continue;
- if (unit == ifp->if_unit)
- break;
- }
- *ep = c;
- return (ifp);
-}
-
-/*
- * Interface ioctls.
- */
-int
-ifioctl(so, cmd, data, p)
- struct socket *so;
- int cmd;
- caddr_t data;
- struct proc *p;
-{
- register struct ifnet *ifp;
- register struct ifreq *ifr;
- int error;
-
- switch (cmd) {
-
- case SIOCGIFCONF:
- case OSIOCGIFCONF:
- return (ifconf(cmd, data));
- }
- ifr = (struct ifreq *)data;
- ifp = ifunit(ifr->ifr_name);
- if (ifp == 0)
- return (ENXIO);
- switch (cmd) {
-
- case SIOCGIFFLAGS:
- ifr->ifr_flags = ifp->if_flags;
- break;
-
- case SIOCGIFMETRIC:
- ifr->ifr_metric = ifp->if_metric;
- break;
-
- case SIOCGIFMTU:
- ifr->ifr_mtu = ifp->if_mtu;
- break;
-
- case SIOCGIFPHYS:
- ifr->ifr_phys = ifp->if_physical;
- break;
-
- case SIOCSIFFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_flags & IFF_UP && (ifr->ifr_flags & IFF_UP) == 0) {
- int s = splimp();
- if_down(ifp);
- splx(s);
- }
- if (ifr->ifr_flags & IFF_UP && (ifp->if_flags & IFF_UP) == 0) {
- int s = splimp();
- if_up(ifp);
- splx(s);
- }
- ifp->if_flags = (ifp->if_flags & IFF_CANTCHANGE) |
- (ifr->ifr_flags &~ IFF_CANTCHANGE);
- if (ifp->if_ioctl)
- (void) (*ifp->if_ioctl)(ifp, cmd, data);
- microtime(&ifp->if_lastchange);
- break;
-
- case SIOCSIFMETRIC:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- ifp->if_metric = ifr->ifr_metric;
- microtime(&ifp->if_lastchange);
- break;
-
- case SIOCSIFPHYS:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return error;
- if (!ifp->if_ioctl)
- return EOPNOTSUPP;
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0)
- microtime(&ifp->if_lastchange);
- return(error);
-
- case SIOCSIFMTU:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_ioctl == NULL)
- return (EOPNOTSUPP);
- /*
- * 72 was chosen below because it is the size of a TCP/IP
- * header (40) + the minimum mss (32).
- */
- if (ifr->ifr_mtu < 72 || ifr->ifr_mtu > 65535)
- return (EINVAL);
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0)
- microtime(&ifp->if_lastchange);
- return(error);
-
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_ioctl == NULL)
- return (EOPNOTSUPP);
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0 )
- microtime(&ifp->if_lastchange);
- return(error);
-
- case SIOCSIFMEDIA:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_ioctl == 0)
- return (EOPNOTSUPP);
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0)
- microtime(&ifp->if_lastchange);
- return error;
-
- case SIOCGIFMEDIA:
- if (ifp->if_ioctl == 0)
- return (EOPNOTSUPP);
- return ((*ifp->if_ioctl)(ifp, cmd, data));
-
- default:
- if (so->so_proto == 0)
- return (EOPNOTSUPP);
-#ifndef COMPAT_43
- return ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
- data,
- ifp));
-#else
- {
- int ocmd = cmd;
-
- switch (cmd) {
-
- case SIOCSIFDSTADDR:
- case SIOCSIFADDR:
- case SIOCSIFBRDADDR:
- case SIOCSIFNETMASK:
-#if BYTE_ORDER != BIG_ENDIAN
- if (ifr->ifr_addr.sa_family == 0 &&
- ifr->ifr_addr.sa_len < 16) {
- ifr->ifr_addr.sa_family = ifr->ifr_addr.sa_len;
- ifr->ifr_addr.sa_len = 16;
- }
-#else
- if (ifr->ifr_addr.sa_len == 0)
- ifr->ifr_addr.sa_len = 16;
-#endif
- break;
-
- case OSIOCGIFADDR:
- cmd = SIOCGIFADDR;
- break;
-
- case OSIOCGIFDSTADDR:
- cmd = SIOCGIFDSTADDR;
- break;
-
- case OSIOCGIFBRDADDR:
- cmd = SIOCGIFBRDADDR;
- break;
-
- case OSIOCGIFNETMASK:
- cmd = SIOCGIFNETMASK;
- }
- error = ((*so->so_proto->pr_usrreqs->pru_control)(so,
- cmd,
- data,
- ifp));
- switch (ocmd) {
-
- case OSIOCGIFADDR:
- case OSIOCGIFDSTADDR:
- case OSIOCGIFBRDADDR:
- case OSIOCGIFNETMASK:
- *(u_short *)&ifr->ifr_addr = ifr->ifr_addr.sa_family;
- }
- return (error);
-
- }
-#endif
- }
- return (0);
-}
-
-/*
- * Set/clear promiscuous mode on interface ifp based on the truth value
- * of pswitch. The calls are reference counted so that only the first
- * "on" request actually has an effect, as does the final "off" request.
- * Results are undefined if the "off" and "on" requests are not matched.
- */
-int
-ifpromisc(ifp, pswitch)
- struct ifnet *ifp;
- int pswitch;
-{
- struct ifreq ifr;
-
- if (pswitch) {
- /*
- * If the device is not configured up, we cannot put it in
- * promiscuous mode.
- */
- if ((ifp->if_flags & IFF_UP) == 0)
- return (ENETDOWN);
- if (ifp->if_pcount++ != 0)
- return (0);
- ifp->if_flags |= IFF_PROMISC;
- log(LOG_INFO, "%s%d: promiscuous mode enabled\n",
- ifp->if_name, ifp->if_unit);
- } else {
- if (--ifp->if_pcount > 0)
- return (0);
- ifp->if_flags &= ~IFF_PROMISC;
- }
- ifr.ifr_flags = ifp->if_flags;
- return ((*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr));
-}
-
-/*
- * Return interface configuration
- * of system. List may be used
- * in later ioctl's (above) to get
- * other information.
- */
-/*ARGSUSED*/
-static int
-ifconf(cmd, data)
- int cmd;
- caddr_t data;
-{
- register struct ifconf *ifc = (struct ifconf *)data;
- register struct ifnet *ifp = ifnet;
- register struct ifaddr *ifa;
- struct ifreq ifr, *ifrp;
- int space = ifc->ifc_len, error = 0;
-
- ifrp = ifc->ifc_req;
- for (; space > sizeof (ifr) && ifp; ifp = ifp->if_next) {
- char workbuf[64];
- int ifnlen;
-
- ifnlen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit);
- if(ifnlen + 1 > sizeof ifr.ifr_name) {
- error = ENAMETOOLONG;
- } else {
- strcpy(ifr.ifr_name, workbuf);
- }
-
- if ((ifa = ifp->if_addrlist) == 0) {
- bzero((caddr_t)&ifr.ifr_addr, sizeof(ifr.ifr_addr));
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr));
- if (error)
- break;
- space -= sizeof (ifr), ifrp++;
- } else
- for ( ; space > sizeof (ifr) && ifa; ifa = ifa->ifa_next) {
- register struct sockaddr *sa = ifa->ifa_addr;
-#ifdef COMPAT_43
- if (cmd == OSIOCGIFCONF) {
- struct osockaddr *osa =
- (struct osockaddr *)&ifr.ifr_addr;
- ifr.ifr_addr = *sa;
- osa->sa_family = sa->sa_family;
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr));
- ifrp++;
- } else
-#endif
- if (sa->sa_len <= sizeof(*sa)) {
- ifr.ifr_addr = *sa;
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr));
- ifrp++;
- } else {
- space -= sa->sa_len - sizeof(*sa);
- if (space < sizeof (ifr))
- break;
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr.ifr_name));
- if (error == 0)
- error = copyout((caddr_t)sa,
- (caddr_t)&ifrp->ifr_addr, sa->sa_len);
- ifrp = (struct ifreq *)
- (sa->sa_len + (caddr_t)&ifrp->ifr_addr);
- }
- if (error)
- break;
- space -= sizeof (ifr);
- }
- }
- ifc->ifc_len -= space;
- return (error);
-}
-
-SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers");
-SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management");
diff --git a/c/src/exec/libnetworking/net/if.h b/c/src/exec/libnetworking/net/if.h
deleted file mode 100644
index acddd4f095..0000000000
--- a/c/src/exec/libnetworking/net/if.h
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 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.
- *
- * @(#)if.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_H_
-#define _NET_IF_H_
-
-/*
- * Structures defining a network interface, providing a packet
- * transport mechanism (ala level 0 of the PUP protocols).
- *
- * Each interface accepts output datagrams of a specified maximum
- * length, and provides higher level routines with input datagrams
- * received from its medium.
- *
- * Output occurs when the routine if_output is called, with three parameters:
- * (*ifp->if_output)(ifp, m, dst, rt)
- * Here m is the mbuf chain to be sent and dst is the destination address.
- * The output routine encapsulates the supplied datagram if necessary,
- * and then transmits it on its medium.
- *
- * On input, each interface unwraps the data received by it, and either
- * places it on the input queue of a internetwork datagram routine
- * and posts the associated software interrupt, or passes the datagram to a raw
- * packet input routine.
- *
- * Routines exist for locating interfaces by their addresses
- * or for locating a interface on a certain network, as well as more general
- * routing and gateway routines maintaining information used to locate
- * interfaces. These routines live in the files if.c and route.c
- */
-
-#ifndef _TIME_ /* XXX fast fix for SNMP, going away soon */
-#include <sys/time.h>
-#endif
-
-#ifdef __STDC__
-/*
- * Forward structure declarations for function prototypes [sic].
- */
-struct mbuf;
-struct proc;
-struct rtentry;
-struct socket;
-struct ether_header;
-#endif
-
-/*
- * Structure describing information about an interface
- * which may be of interest to management entities.
- */
-struct if_data {
- /* generic interface information */
- u_char ifi_type; /* ethernet, tokenring, etc */
- u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */
- u_char ifi_addrlen; /* media address length */
- u_char ifi_hdrlen; /* media header length */
- u_char ifi_recvquota; /* polling quota for receive intrs */
- u_char ifi_xmitquota; /* polling quota for xmit intrs */
- u_long ifi_mtu; /* maximum transmission unit */
- u_long ifi_metric; /* routing metric (external only) */
- u_long ifi_baudrate; /* linespeed */
- /* volatile statistics */
- u_long ifi_ipackets; /* packets received on interface */
- u_long ifi_ierrors; /* input errors on interface */
- u_long ifi_opackets; /* packets sent on interface */
- u_long ifi_oerrors; /* output errors on interface */
- u_long ifi_collisions; /* collisions on csma interfaces */
- u_long ifi_ibytes; /* total number of octets received */
- u_long ifi_obytes; /* total number of octets sent */
- u_long ifi_imcasts; /* packets received via multicast */
- u_long ifi_omcasts; /* packets sent via multicast */
- u_long ifi_iqdrops; /* dropped on input, this interface */
- u_long ifi_noproto; /* destined for unsupported protocol */
- u_long ifi_recvtiming; /* usec spent receiving when timing */
- u_long ifi_xmittiming; /* usec spent xmitting when timing */
- struct timeval ifi_lastchange; /* time of last administrative change */
-};
-
-/*
- * Structure defining a queue for a network interface.
- */
-struct ifqueue {
- struct mbuf *ifq_head;
- struct mbuf *ifq_tail;
- int ifq_len;
- int ifq_maxlen;
- int ifq_drops;
-};
-
-/*
- * Structure defining a network interface.
- *
- * (Would like to call this struct ``if'', but C isn't PL/1.)
- */
-struct ifnet {
- void *if_softc; /* pointer to driver state */
- char *if_name; /* name, e.g. ``en'' or ``lo'' */
- struct ifnet *if_next; /* all struct ifnets are chained */
- struct ifaddr *if_addrlist; /* linked list of addresses per if */
- int if_pcount; /* number of promiscuous listeners */
- struct bpf_if *if_bpf; /* packet filter structure */
- u_short if_index; /* numeric abbreviation for this if */
- short if_unit; /* sub-unit for lower level driver */
- short if_timer; /* time 'til if_watchdog called */
- short if_flags; /* up/down, broadcast, etc. */
- int if_ipending; /* interrupts pending */
- void *if_linkmib; /* link-type-specific MIB data */
- size_t if_linkmiblen; /* length of above data */
- struct if_data if_data;
-/* procedure handles */
- int (*if_output) /* output routine (enqueue) */
- __P((struct ifnet *, struct mbuf *, struct sockaddr *,
- struct rtentry *));
- void (*if_start) /* initiate output routine */
- __P((struct ifnet *));
- int (*if_done) /* output complete routine */
- __P((struct ifnet *)); /* (XXX not used; fake prototype) */
- int (*if_ioctl) /* ioctl routine */
- __P((struct ifnet *, int, caddr_t));
- void (*if_watchdog) /* timer routine */
- __P((struct ifnet *));
- int (*if_poll_recv) /* polled receive routine */
- __P((struct ifnet *, int *));
- int (*if_poll_xmit) /* polled transmit routine */
- __P((struct ifnet *, int *));
- void (*if_poll_intren) /* polled interrupt reenable routine */
- __P((struct ifnet *));
- void (*if_poll_slowinput) /* input routine for slow devices */
- __P((struct ifnet *, struct mbuf *));
- void (*if_init) /* Init routine */
- __P((void *));
- struct ifqueue if_snd; /* output queue */
- struct ifqueue *if_poll_slowq; /* input queue for slow devices */
-};
-typedef void if_init_f_t __P((void *));
-
-#define if_mtu if_data.ifi_mtu
-#define if_type if_data.ifi_type
-#define if_physical if_data.ifi_physical
-#define if_addrlen if_data.ifi_addrlen
-#define if_hdrlen if_data.ifi_hdrlen
-#define if_metric if_data.ifi_metric
-#define if_baudrate if_data.ifi_baudrate
-#define if_ipackets if_data.ifi_ipackets
-#define if_ierrors if_data.ifi_ierrors
-#define if_opackets if_data.ifi_opackets
-#define if_oerrors if_data.ifi_oerrors
-#define if_collisions if_data.ifi_collisions
-#define if_ibytes if_data.ifi_ibytes
-#define if_obytes if_data.ifi_obytes
-#define if_imcasts if_data.ifi_imcasts
-#define if_omcasts if_data.ifi_omcasts
-#define if_iqdrops if_data.ifi_iqdrops
-#define if_noproto if_data.ifi_noproto
-#define if_lastchange if_data.ifi_lastchange
-#define if_recvquota if_data.ifi_recvquota
-#define if_xmitquota if_data.ifi_xmitquota
-#define if_rawoutput(if, m, sa) if_output(if, m, sa, (struct rtentry *)0)
-
-#define IFF_UP 0x1 /* interface is up */
-#define IFF_BROADCAST 0x2 /* broadcast address valid */
-#define IFF_DEBUG 0x4 /* turn on debugging */
-#define IFF_LOOPBACK 0x8 /* is a loopback net */
-#define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */
-/*#define IFF_NOTRAILERS 0x20 * obsolete: avoid use of trailers */
-#define IFF_RUNNING 0x40 /* resources allocated */
-#define IFF_NOARP 0x80 /* no address resolution protocol */
-#define IFF_PROMISC 0x100 /* receive all packets */
-#define IFF_ALLMULTI 0x200 /* receive all multicast packets */
-#define IFF_OACTIVE 0x400 /* transmission in progress */
-#define IFF_SIMPLEX 0x800 /* can't hear own transmissions */
-#define IFF_LINK0 0x1000 /* per link layer defined bit */
-#define IFF_LINK1 0x2000 /* per link layer defined bit */
-#define IFF_LINK2 0x4000 /* per link layer defined bit */
-#define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */
-#define IFF_MULTICAST 0x8000 /* supports multicast */
-
-/* flags set internally only: */
-#define IFF_CANTCHANGE \
- (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\
- IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI)
-
-
-/*
- * These really don't belong here, but there's no other obviously appropriate
- * location.
- */
-#define IFP_AUI 0
-#define IFP_10BASE2 1
-#define IFP_10BASET 2
-/* etc. */
-
-/*
- * Bit values in if_ipending
- */
-#define IFI_RECV 1 /* I want to receive */
-#define IFI_XMIT 2 /* I want to transmit */
-
-/*
- * Output queues (ifp->if_snd) and slow device input queues (*ifp->if_slowq)
- * are queues of messages stored on ifqueue structures
- * (defined above). Entries are added to and deleted from these structures
- * by these macros, which should be called with ipl raised to splimp().
- */
-#define IF_QFULL(ifq) ((ifq)->ifq_len >= (ifq)->ifq_maxlen)
-#define IF_DROP(ifq) ((ifq)->ifq_drops++)
-#define IF_ENQUEUE(ifq, m) { \
- (m)->m_nextpkt = 0; \
- if ((ifq)->ifq_tail == 0) \
- (ifq)->ifq_head = m; \
- else \
- (ifq)->ifq_tail->m_nextpkt = m; \
- (ifq)->ifq_tail = m; \
- (ifq)->ifq_len++; \
-}
-#define IF_PREPEND(ifq, m) { \
- (m)->m_nextpkt = (ifq)->ifq_head; \
- if ((ifq)->ifq_tail == 0) \
- (ifq)->ifq_tail = (m); \
- (ifq)->ifq_head = (m); \
- (ifq)->ifq_len++; \
-}
-#define IF_DEQUEUE(ifq, m) { \
- (m) = (ifq)->ifq_head; \
- if (m) { \
- if (((ifq)->ifq_head = (m)->m_nextpkt) == 0) \
- (ifq)->ifq_tail = 0; \
- (m)->m_nextpkt = 0; \
- (ifq)->ifq_len--; \
- } \
-}
-
-#ifdef KERNEL
-#define IF_ENQ_DROP(ifq, m) if_enq_drop(ifq, m)
-
-#if defined(__GNUC__) && defined(MT_HEADER)
-static inline int
-if_queue_drop(struct ifqueue *ifq, struct mbuf *m)
-{
- IF_DROP(ifq);
- return 0;
-}
-
-static inline int
-if_enq_drop(struct ifqueue *ifq, struct mbuf *m)
-{
- if (IF_QFULL(ifq) &&
- !if_queue_drop(ifq, m))
- return 0;
- IF_ENQUEUE(ifq, m);
- return 1;
-}
-#else
-
-#ifdef MT_HEADER
-int if_enq_drop __P((struct ifqueue *, struct mbuf *));
-#endif
-
-#endif
-#endif /* KERNEL */
-
-#define IFQ_MAXLEN 50
-#define IFNET_SLOWHZ 1 /* granularity is 1 second */
-
-/*
- * The ifaddr structure contains information about one address
- * of an interface. They are maintained by the different address families,
- * are allocated and attached when an address is set, and are linked
- * together so all addresses for an interface can be located.
- */
-struct ifaddr {
- struct sockaddr *ifa_addr; /* address of interface */
- struct sockaddr *ifa_dstaddr; /* other end of p-to-p link */
-#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */
- struct sockaddr *ifa_netmask; /* used to determine subnet */
- struct ifnet *ifa_ifp; /* back-pointer to interface */
- struct ifaddr *ifa_next; /* next address for interface */
- void (*ifa_rtrequest) /* check or clean routes (+ or -)'d */
- __P((int, struct rtentry *, struct sockaddr *));
- u_short ifa_flags; /* mostly rt_flags for cloning */
- short ifa_refcnt; /* references to this structure */
- int ifa_metric; /* cost of going out this interface */
-#ifdef notdef
- struct rtentry *ifa_rt; /* XXXX for ROUTETOIF ????? */
-#endif
- int (*ifa_claim_addr) /* check if an addr goes to this if */
- __P((struct ifaddr *, struct sockaddr *));
-
-};
-#define IFA_ROUTE RTF_UP /* route installed */
-
-/*
- * Message format for use in obtaining information about interfaces
- * from getkerninfo and the routing socket
- */
-struct if_msghdr {
- u_short ifm_msglen; /* to skip over non-understood messages */
- u_char ifm_version; /* future binary compatability */
- u_char ifm_type; /* message type */
- int ifm_addrs; /* like rtm_addrs */
- int ifm_flags; /* value of if_flags */
- u_short ifm_index; /* index for associated ifp */
- struct if_data ifm_data;/* statistics and other data about if */
-};
-
-/*
- * Message format for use in obtaining information about interface addresses
- * from getkerninfo and the routing socket
- */
-struct ifa_msghdr {
- u_short ifam_msglen; /* to skip over non-understood messages */
- u_char ifam_version; /* future binary compatability */
- u_char ifam_type; /* message type */
- int ifam_addrs; /* like rtm_addrs */
- int ifam_flags; /* value of ifa_flags */
- u_short ifam_index; /* index for associated ifp */
- int ifam_metric; /* value of ifa_metric */
-};
-
-/*
- * Interface request structure used for socket
- * ioctl's. All interface ioctl's must have parameter
- * definitions which begin with ifr_name. The
- * remainder may be interface specific.
- */
-struct ifreq {
-#define IFNAMSIZ 16
- char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- union {
- struct sockaddr ifru_addr;
- struct sockaddr ifru_dstaddr;
- struct sockaddr ifru_broadaddr;
- short ifru_flags;
- int ifru_metric;
- int ifru_mtu;
- int ifru_phys;
- int ifru_media;
- caddr_t ifru_data;
- } ifr_ifru;
-#define ifr_addr ifr_ifru.ifru_addr /* address */
-#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
-#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
-#define ifr_flags ifr_ifru.ifru_flags /* flags */
-#define ifr_metric ifr_ifru.ifru_metric /* metric */
-#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
-#define ifr_phys ifr_ifru.ifru_phys /* physical wire */
-#define ifr_media ifr_ifru.ifru_media /* physical media */
-#define ifr_data ifr_ifru.ifru_data /* for use by interface */
-};
-
-struct ifaliasreq {
- char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- struct sockaddr ifra_addr;
- struct sockaddr ifra_broadaddr;
- struct sockaddr ifra_mask;
-};
-
-struct ifmediareq {
- char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- int ifm_current; /* current media options */
- int ifm_mask; /* don't care mask */
- int ifm_status; /* media status */
- int ifm_active; /* active options */
- int ifm_count; /* # entries in ifm_ulist array */
- int *ifm_ulist; /* media words */
-};
-/*
- * Structure used in SIOCGIFCONF request.
- * Used to retrieve interface configuration
- * for machine (useful for programs which
- * must know all networks accessible).
- */
-struct ifconf {
- int ifc_len; /* size of associated buffer */
- union {
- caddr_t ifcu_buf;
- struct ifreq *ifcu_req;
- } ifc_ifcu;
-#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
-#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
-};
-
-#include <net/if_arp.h>
-
-#ifdef KERNEL
-#define IFAFREE(ifa) \
- if ((ifa)->ifa_refcnt <= 0) \
- ifafree(ifa); \
- else \
- (ifa)->ifa_refcnt--;
-
-extern struct ifnet *ifnet;
-extern int ifqmaxlen;
-extern struct ifnet loif[];
-extern int if_index;
-extern struct ifaddr **ifnet_addrs;
-
-void ether_ifattach __P((struct ifnet *));
-void ether_input __P((struct ifnet *, struct ether_header *, struct mbuf *));
-int ether_output __P((struct ifnet *,
- struct mbuf *, struct sockaddr *, struct rtentry *));
-int ether_ioctl __P((struct ifnet *, int , caddr_t ));
-
-void if_attach __P((struct ifnet *));
-void if_down __P((struct ifnet *));
-void if_up __P((struct ifnet *));
-#ifdef vax
-void ifubareset __P((int));
-#endif
-/*void ifinit __P((void));*/ /* declared in systm.h for main() */
-int ifioctl __P((struct socket *, int, caddr_t, struct proc *));
-int ifpromisc __P((struct ifnet *, int));
-struct ifnet *ifunit __P((char *));
-
-int if_poll_recv_slow __P((struct ifnet *ifp, int *quotap));
-void if_poll_xmit_slow __P((struct ifnet *ifp, int *quotap));
-void if_poll_throttle __P((void));
-void if_poll_unthrottle __P((void *));
-void if_poll_init __P((void));
-void if_poll __P((void));
-
-struct ifaddr *ifa_ifwithaddr __P((struct sockaddr *));
-struct ifaddr *ifa_ifwithdstaddr __P((struct sockaddr *));
-struct ifaddr *ifa_ifwithnet __P((struct sockaddr *));
-struct ifaddr *ifa_ifwithroute __P((int, struct sockaddr *,
- struct sockaddr *));
-struct ifaddr *ifaof_ifpforaddr __P((struct sockaddr *, struct ifnet *));
-void ifafree __P((struct ifaddr *));
-
-int looutput __P((struct ifnet *,
- struct mbuf *, struct sockaddr *, struct rtentry *));
-#endif /* KERNEL */
-
-#endif /* !_NET_IF_H_ */
diff --git a/c/src/exec/libnetworking/net/if_arp.h b/c/src/exec/libnetworking/net/if_arp.h
deleted file mode 100644
index dd726bf856..0000000000
--- a/c/src/exec/libnetworking/net/if_arp.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 1986, 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.
- *
- * @(#)if_arp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_ARP_H_
-#define _NET_IF_ARP_H_
-
-/*
- * Address Resolution Protocol.
- *
- * See RFC 826 for protocol description. ARP packets are variable
- * in size; the arphdr structure defines the fixed-length portion.
- * Protocol type values are the same as those for 10 Mb/s Ethernet.
- * It is followed by the variable-sized fields ar_sha, arp_spa,
- * arp_tha and arp_tpa in that order, according to the lengths
- * specified. Field names used correspond to RFC 826.
- */
-struct arphdr {
- u_short ar_hrd; /* format of hardware address */
-#define ARPHRD_ETHER 1 /* ethernet hardware format */
-#define ARPHRD_FRELAY 15 /* frame relay hardware format */
- u_short ar_pro; /* format of protocol address */
- u_char ar_hln; /* length of hardware address */
- u_char ar_pln; /* length of protocol address */
- u_short ar_op; /* one of: */
-#define ARPOP_REQUEST 1 /* request to resolve address */
-#define ARPOP_REPLY 2 /* response to previous request */
-#define ARPOP_REVREQUEST 3 /* request protocol address given hardware */
-#define ARPOP_REVREPLY 4 /* response giving protocol address */
-#define ARPOP_INVREQUEST 8 /* request to identify peer */
-#define ARPOP_INVREPLY 9 /* response identifying peer */
-/*
- * The remaining fields are variable in size,
- * according to the sizes above.
- */
-#ifdef COMMENT_ONLY
- u_char ar_sha[]; /* sender hardware address */
- u_char ar_spa[]; /* sender protocol address */
- u_char ar_tha[]; /* target hardware address */
- u_char ar_tpa[]; /* target protocol address */
-#endif
-};
-
-/*
- * ARP ioctl request
- */
-struct arpreq {
- struct sockaddr arp_pa; /* protocol address */
- struct sockaddr arp_ha; /* hardware address */
- int arp_flags; /* flags */
-};
-/* arp_flags and at_flags field values */
-#define ATF_INUSE 0x01 /* entry in use */
-#define ATF_COM 0x02 /* completed entry (enaddr valid) */
-#define ATF_PERM 0x04 /* permanent entry */
-#define ATF_PUBL 0x08 /* publish entry (respond for other host) */
-#define ATF_USETRAILERS 0x10 /* has requested trailers */
-
-#endif /* !_NET_IF_ARP_H_ */
diff --git a/c/src/exec/libnetworking/net/if_dl.h b/c/src/exec/libnetworking/net/if_dl.h
deleted file mode 100644
index 053ae3e92f..0000000000
--- a/c/src/exec/libnetworking/net/if_dl.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 1990, 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.
- *
- * @(#)if_dl.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_DL_H_
-#define _NET_IF_DL_H_
-
-/*
- * A Link-Level Sockaddr may specify the interface in one of two
- * ways: either by means of a system-provided index number (computed
- * anew and possibly differently on every reboot), or by a human-readable
- * string such as "il0" (for managerial convenience).
- *
- * Census taking actions, such as something akin to SIOCGCONF would return
- * both the index and the human name.
- *
- * High volume transactions (such as giving a link-level ``from'' address
- * in a recvfrom or recvmsg call) may be likely only to provide the indexed
- * form, (which requires fewer copy operations and less space).
- *
- * The form and interpretation of the link-level address is purely a matter
- * of convention between the device driver and its consumers; however, it is
- * expected that all drivers for an interface of a given if_type will agree.
- */
-
-/*
- * Structure of a Link-Level sockaddr:
- */
-struct sockaddr_dl {
- u_char sdl_len; /* Total length of sockaddr */
- u_char sdl_family; /* AF_DLI */
- u_short sdl_index; /* if != 0, system given index for interface */
- u_char sdl_type; /* interface type */
- u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */
- u_char sdl_alen; /* link level address length */
- u_char sdl_slen; /* link layer selector length */
- char sdl_data[12]; /* minimum work area, can be larger;
- contains both if name and ll address */
-};
-
-#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-void link_addr __P((const char *, struct sockaddr_dl *));
-char *link_ntoa __P((const struct sockaddr_dl *));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif
diff --git a/c/src/exec/libnetworking/net/if_ethersubr.c b/c/src/exec/libnetworking/net/if_ethersubr.c
deleted file mode 100644
index 4d1675ca3c..0000000000
--- a/c/src/exec/libnetworking/net/if_ethersubr.c
+++ /dev/null
@@ -1,988 +0,0 @@
-/*
- * Copyright (c) 1982, 1989, 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.
- *
- * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/netisr.h>
-#include <net/route.h>
-#include <net/if_llc.h>
-#include <net/if_dl.h>
-#include <net/if_types.h>
-#include <net/ethernet.h>
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#endif
-#include <netinet/if_ether.h>
-
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
-#ifdef NS
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-ushort ns_nettype;
-int ether_outputdebug = 0;
-int ether_inputdebug = 0;
-#endif
-
-#ifdef ISO
-#include <netiso/argo_debug.h>
-#include <netiso/iso.h>
-#include <netiso/iso_var.h>
-#include <netiso/iso_snpac.h>
-#endif
-
-/*#ifdef LLC
-#include <netccitt/dll.h>
-#include <netccitt/llc_var.h>
-#endif*/
-
-#if defined(LLC) && defined(CCITT)
-extern struct ifqueue pkintrq;
-#endif
-
-#ifdef NETATALK
-#include <netatalk/at.h>
-#include <netatalk/at_var.h>
-#include <netatalk/at_extern.h>
-
-#define llc_snap_org_code llc_un.type_snap.org_code
-#define llc_snap_ether_type llc_un.type_snap.ether_type
-
-extern u_char at_org_code[ 3 ];
-extern u_char aarp_org_code[ 3 ];
-#endif NETATALK
-
-u_char etherbroadcastaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-#define senderr(e) { error = (e); goto bad;}
-
-/*
- * Ethernet output routine.
- * Encapsulate a packet of type family for the local net.
- * Use trailer local net encapsulation if enough data in first
- * packet leaves a multiple of 512 bytes of data in remainder.
- * Assumes that ifp is actually pointer to arpcom structure.
- */
-int
-ether_output(ifp, m0, dst, rt0)
- register struct ifnet *ifp;
- struct mbuf *m0;
- struct sockaddr *dst;
- struct rtentry *rt0;
-{
- short type;
- int s, error = 0;
-#ifdef NS
- u_char *cp
- register struct ifqueue *inq;
- register struct mbuf *m2;
-#endif
- u_char edst[6];
- register struct mbuf *m = m0;
- register struct rtentry *rt;
- struct mbuf *mcopy = (struct mbuf *)0;
- register struct ether_header *eh;
- int off, len = m->m_pkthdr.len;
- struct arpcom *ac = (struct arpcom *)ifp;
-#ifdef NETATALK
- struct at_ifaddr *aa;
-#endif NETATALK
-
- if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
- senderr(ENETDOWN);
- rt = rt0;
- if (rt) {
- if ((rt->rt_flags & RTF_UP) == 0) {
- rt0 = rt = rtalloc1(dst, 1, 0UL);
- if (rt0)
- rt->rt_refcnt--;
- else
- senderr(EHOSTUNREACH);
- }
- if (rt->rt_flags & RTF_GATEWAY) {
- if (rt->rt_gwroute == 0)
- goto lookup;
- if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) {
- rtfree(rt); rt = rt0;
- lookup: rt->rt_gwroute = rtalloc1(rt->rt_gateway, 1,
- 0UL);
- if ((rt = rt->rt_gwroute) == 0)
- senderr(EHOSTUNREACH);
- }
- }
- if (rt->rt_flags & RTF_REJECT)
- if (rt->rt_rmx.rmx_expire == 0 ||
- rtems_bsdnet_seconds_since_boot() < rt->rt_rmx.rmx_expire)
- senderr(rt == rt0 ? EHOSTDOWN : EHOSTUNREACH);
- }
- switch (dst->sa_family) {
-
-#ifdef INET
- case AF_INET:
- if (!arpresolve(ac, rt, m, dst, edst, rt0))
- return (0); /* if not yet resolved */
- /* If broadcasting on a simplex interface, loopback a copy */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- off = m->m_pkthdr.len - m->m_len;
- type = htons(ETHERTYPE_IP);
- break;
-#endif
-#ifdef IPX
- case AF_IPX:
- {
- struct ifaddr *ia;
-
- type = htons(ETHERTYPE_IPX);
- bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host),
- (caddr_t)edst, sizeof (edst));
- for (ia = ifp->if_addrlist; ia != NULL; ia = ia->ifa_next)
- if(ia->ifa_addr->sa_family == AF_IPX &&
- !bcmp((caddr_t)edst,
- (caddr_t)&((struct ipx_ifaddr *)ia)->ia_addr.sipx_addr.x_host,
- sizeof(edst)))
- return (looutput(ifp, m, dst, rt));
- /* If broadcasting on a simplex interface, loopback a copy */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- break;
- }
-#endif
-#ifdef NETATALK
- case AF_APPLETALK:
- {
- struct sockaddr_at *sat = (struct sockaddr_at *)dst;
-
- /*
- * super hack..
- * Most of this loopback code should move into the appletalk
- * code, but it's here for now.. remember to move it! [JRE]
- * This may not get the same interface we started with
- * fix asap. XXX
- */
- aa = at_ifawithnet( sat );
- if (aa == NULL) {
- goto bad;
- }
- if( aa->aa_ifa.ifa_ifp != ifp ) {
- (*aa->aa_ifa.ifa_ifp->if_output)(aa->aa_ifa.ifa_ifp,
- m,dst,rt);
- }
- if (((sat->sat_addr.s_net == ATADDR_ANYNET)
- && (sat->sat_addr.s_node == ATADDR_ANYNODE))
- || ((sat->sat_addr.s_net == aa->aa_addr.sat_addr.s_net )
- && (sat->sat_addr.s_node == aa->aa_addr.sat_addr.s_node))) {
- (void) looutput(ifp, m, dst, rt);
- return(0);
- }
-
- if (!aarpresolve(ac, m, (struct sockaddr_at *)dst, edst)) {
-#ifdef NETATALKDEBUG
- extern char *prsockaddr(struct sockaddr *);
- printf("aarpresolv: failed for %s\n", prsockaddr(dst));
-#endif NETATALKDEBUG
- return (0);
- }
-
- /*
- * If broadcasting on a simplex interface, loopback a copy
- */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- }
- /*
- * In the phase 2 case, we need to prepend an mbuf for the llc header.
- * Since we must preserve the value of m, which is passed to us by
- * value, we m_copy() the first mbuf, and use it for our llc header.
- */
- if ( aa->aa_flags & AFA_PHASE2 ) {
- struct llc llc;
-
- M_PREPEND(m, sizeof(struct llc), M_WAIT);
- len += sizeof(struct llc);
- llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP;
- llc.llc_control = LLC_UI;
- bcopy(at_org_code, llc.llc_snap_org_code, sizeof(at_org_code));
- llc.llc_snap_ether_type = htons( ETHERTYPE_AT );
- bcopy(&llc, mtod(m, caddr_t), sizeof(struct llc));
- type = htons(m->m_pkthdr.len);
- } else {
- type = htons(ETHERTYPE_AT);
- }
- break;
-#endif NETATALK
-#ifdef NS
- case AF_NS:
- switch(ns_nettype){
- default:
- case 0x8137: /* Novell Ethernet_II Ethernet TYPE II */
- type = 0x8137;
- break;
- case 0x0: /* Novell 802.3 */
- type = htons( m->m_pkthdr.len);
- break;
- case 0xe0e0: /* Novell 802.2 and Token-Ring */
- M_PREPEND(m, 3, M_WAIT);
- type = htons( m->m_pkthdr.len);
- cp = mtod(m, u_char *);
- *cp++ = 0xE0;
- *cp++ = 0xE0;
- *cp++ = 0x03;
- break;
- }
- bcopy((caddr_t)&(((struct sockaddr_ns *)dst)->sns_addr.x_host),
- (caddr_t)edst, sizeof (edst));
- if (!bcmp((caddr_t)edst, (caddr_t)&ns_thishost, sizeof(edst))){
- m->m_pkthdr.rcvif = ifp;
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- s = splimp();
- if (IF_QFULL(inq)) {
- IF_DROP(inq);
- m_freem(m);
- } else
- IF_ENQUEUE(inq, m);
- splx(s);
- return (error);
- }
- if (!bcmp((caddr_t)edst, (caddr_t)&ns_broadhost, sizeof(edst))){
- m2 = m_copy(m, 0, (int)M_COPYALL);
- m2->m_pkthdr.rcvif = ifp;
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- s = splimp();
- if (IF_QFULL(inq)) {
- IF_DROP(inq);
- m_freem(m2);
- } else
- IF_ENQUEUE(inq, m2);
- splx(s);
- }
- /* If broadcasting on a simplex interface, loopback a copy */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX)){
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- }
- break;
-#endif /* NS */
-#ifdef ISO
- case AF_ISO: {
- int snpalen;
- struct llc *l;
- register struct sockaddr_dl *sdl;
-
- if (rt && (sdl = (struct sockaddr_dl *)rt->rt_gateway) &&
- sdl->sdl_family == AF_LINK && sdl->sdl_alen > 0) {
- bcopy(LLADDR(sdl), (caddr_t)edst, sizeof(edst));
- } else if (error =
- iso_snparesolve(ifp, (struct sockaddr_iso *)dst,
- (char *)edst, &snpalen))
- goto bad; /* Not Resolved */
- /* If broadcasting on a simplex interface, loopback a copy */
- if (*edst & 1)
- m->m_flags |= (M_BCAST|M_MCAST);
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX) &&
- (mcopy = m_copy(m, 0, (int)M_COPYALL))) {
- M_PREPEND(mcopy, sizeof (*eh), M_DONTWAIT);
- if (mcopy) {
- eh = mtod(mcopy, struct ether_header *);
- bcopy((caddr_t)edst,
- (caddr_t)eh->ether_dhost, sizeof (edst));
- bcopy((caddr_t)ac->ac_enaddr,
- (caddr_t)eh->ether_shost, sizeof (edst));
- }
- }
- M_PREPEND(m, 3, M_DONTWAIT);
- if (m == NULL)
- return (0);
- type = htons(m->m_pkthdr.len);
- l = mtod(m, struct llc *);
- l->llc_dsap = l->llc_ssap = LLC_ISO_LSAP;
- l->llc_control = LLC_UI;
- len += 3;
- IFDEBUG(D_ETHER)
- int i;
- printf("unoutput: sending pkt to: ");
- for (i=0; i<6; i++)
- printf("%x ", edst[i] & 0xff);
- printf("\n");
- ENDDEBUG
- } break;
-#endif /* ISO */
-#ifdef LLC
-/* case AF_NSAP: */
- case AF_CCITT: {
- register struct sockaddr_dl *sdl =
- (struct sockaddr_dl *) rt -> rt_gateway;
-
- if (sdl && sdl->sdl_family == AF_LINK
- && sdl->sdl_alen > 0) {
- bcopy(LLADDR(sdl), (char *)edst,
- sizeof(edst));
- } else goto bad; /* Not a link interface ? Funny ... */
- if ((ifp->if_flags & IFF_SIMPLEX) && (*edst & 1) &&
- (mcopy = m_copy(m, 0, (int)M_COPYALL))) {
- M_PREPEND(mcopy, sizeof (*eh), M_DONTWAIT);
- if (mcopy) {
- eh = mtod(mcopy, struct ether_header *);
- bcopy((caddr_t)edst,
- (caddr_t)eh->ether_dhost, sizeof (edst));
- bcopy((caddr_t)ac->ac_enaddr,
- (caddr_t)eh->ether_shost, sizeof (edst));
- }
- }
- type = htons(m->m_pkthdr.len);
-#ifdef LLC_DEBUG
- {
- int i;
- register struct llc *l = mtod(m, struct llc *);
-
- printf("ether_output: sending LLC2 pkt to: ");
- for (i=0; i<6; i++)
- printf("%x ", edst[i] & 0xff);
- printf(" len 0x%x dsap 0x%x ssap 0x%x control 0x%x\n",
- type & 0xff, l->llc_dsap & 0xff, l->llc_ssap &0xff,
- l->llc_control & 0xff);
-
- }
-#endif /* LLC_DEBUG */
- } break;
-#endif /* LLC */
-
- case AF_UNSPEC:
- eh = (struct ether_header *)dst->sa_data;
- (void)memcpy(edst, eh->ether_dhost, sizeof (edst));
- type = eh->ether_type;
- break;
-
- default:
- printf("%s%d: can't handle af%d\n", ifp->if_name, ifp->if_unit,
- dst->sa_family);
- senderr(EAFNOSUPPORT);
- }
-
-
- if (mcopy)
- (void) looutput(ifp, mcopy, dst, rt);
- /*
- * Add local net header. If no space in first mbuf,
- * allocate another.
- */
- M_PREPEND(m, sizeof (struct ether_header), M_DONTWAIT);
- if (m == 0)
- senderr(ENOBUFS);
- eh = mtod(m, struct ether_header *);
- (void)memcpy(&eh->ether_type, &type,
- sizeof(eh->ether_type));
- (void)memcpy(eh->ether_dhost, edst, sizeof (edst));
- (void)memcpy(eh->ether_shost, ac->ac_enaddr,
- sizeof(eh->ether_shost));
- s = splimp();
- /*
- * Queue message on interface, and start output if interface
- * not yet active.
- */
- if (IF_QFULL(&ifp->if_snd)) {
- IF_DROP(&ifp->if_snd);
- splx(s);
- senderr(ENOBUFS);
- }
- IF_ENQUEUE(&ifp->if_snd, m);
- if ((ifp->if_flags & IFF_OACTIVE) == 0)
- (*ifp->if_start)(ifp);
- splx(s);
- ifp->if_obytes += len + sizeof (struct ether_header);
- if (m->m_flags & M_MCAST)
- ifp->if_omcasts++;
- return (error);
-
-bad:
- if (m)
- m_freem(m);
- return (error);
-}
-
-/*
- * Process a received Ethernet packet;
- * the packet is in the mbuf chain m without
- * the ether header, which is provided separately.
- */
-void
-ether_input(ifp, eh, m)
- struct ifnet *ifp;
- register struct ether_header *eh;
- struct mbuf *m;
-{
- register struct ifqueue *inq;
- u_short ether_type;
-#ifdef NS
- u_short *checksum;
-#endif
- int s;
-#if defined (ISO) || defined (LLC) || defined(NETATALK)
- register struct llc *l;
-#endif
-
- if ((ifp->if_flags & IFF_UP) == 0) {
- m_freem(m);
- return;
- }
- ifp->if_ibytes += m->m_pkthdr.len + sizeof (*eh);
- if (bcmp((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
- sizeof(etherbroadcastaddr)) == 0)
- m->m_flags |= M_BCAST;
- else if (eh->ether_dhost[0] & 1)
- m->m_flags |= M_MCAST;
- if (m->m_flags & (M_BCAST|M_MCAST))
- ifp->if_imcasts++;
-
- ether_type = ntohs(eh->ether_type);
-
- switch (ether_type) {
-#ifdef INET
- case ETHERTYPE_IP:
- schednetisr(NETISR_IP);
- inq = &ipintrq;
- break;
-
- case ETHERTYPE_ARP:
- schednetisr(NETISR_ARP);
- inq = &arpintrq;
- break;
-#endif
-#ifdef IPX
- case ETHERTYPE_IPX:
- schednetisr(NETISR_IPX);
- inq = &ipxintrq;
- break;
-#endif
-#ifdef NS
- case 0x8137: /* Novell Ethernet_II Ethernet TYPE II */
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- break;
-
-#endif /* NS */
-#ifdef NETATALK
- case ETHERTYPE_AT:
- schednetisr(NETISR_ATALK);
- inq = &atintrq1;
- break;
- case ETHERTYPE_AARP:
- /* probably this should be done with a NETISR as well */
- aarpinput((struct arpcom *)ifp, m); /* XXX */
- return;
-#endif NETATALK
- default:
-#ifdef NS
- checksum = mtod(m, ushort *);
- /* Novell 802.3 */
- if ((ether_type <= ETHERMTU) &&
- ((*checksum == 0xffff) || (*checksum == 0xE0E0))){
- if(*checksum == 0xE0E0) {
- m->m_pkthdr.len -= 3;
- m->m_len -= 3;
- m->m_data += 3;
- }
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- break;
- }
-#endif /* NS */
-#if defined (ISO) || defined (LLC) || defined(NETATALK)
- if (ether_type > ETHERMTU)
- goto dropanyway;
- l = mtod(m, struct llc *);
- switch (l->llc_dsap) {
-#ifdef NETATALK
- case LLC_SNAP_LSAP:
- switch (l->llc_control) {
- case LLC_UI:
- if (l->llc_ssap != LLC_SNAP_LSAP)
- goto dropanyway;
-
- if (Bcmp(&(l->llc_snap_org_code)[0], at_org_code,
- sizeof(at_org_code)) == 0 &&
- ntohs(l->llc_snap_ether_type) == ETHERTYPE_AT) {
- inq = &atintrq2;
- m_adj( m, sizeof( struct llc ));
- schednetisr(NETISR_ATALK);
- break;
- }
-
- if (Bcmp(&(l->llc_snap_org_code)[0], aarp_org_code,
- sizeof(aarp_org_code)) == 0 &&
- ntohs(l->llc_snap_ether_type) == ETHERTYPE_AARP) {
- m_adj( m, sizeof( struct llc ));
- aarpinput((struct arpcom *)ifp, m); /* XXX */
- return;
- }
-
- default:
- goto dropanyway;
- }
- break;
-#endif NETATALK
-#ifdef ISO
- case LLC_ISO_LSAP:
- switch (l->llc_control) {
- case LLC_UI:
- /* LLC_UI_P forbidden in class 1 service */
- if ((l->llc_dsap == LLC_ISO_LSAP) &&
- (l->llc_ssap == LLC_ISO_LSAP)) {
- /* LSAP for ISO */
- if (m->m_pkthdr.len > ether_type)
- m_adj(m, ether_type - m->m_pkthdr.len);
- m->m_data += 3; /* XXX */
- m->m_len -= 3; /* XXX */
- m->m_pkthdr.len -= 3; /* XXX */
- M_PREPEND(m, sizeof *eh, M_DONTWAIT);
- if (m == 0)
- return;
- *mtod(m, struct ether_header *) = *eh;
- IFDEBUG(D_ETHER)
- printf("clnp packet");
- ENDDEBUG
- schednetisr(NETISR_ISO);
- inq = &clnlintrq;
- break;
- }
- goto dropanyway;
-
- case LLC_XID:
- case LLC_XID_P:
- if(m->m_len < 6)
- goto dropanyway;
- l->llc_window = 0;
- l->llc_fid = 9;
- l->llc_class = 1;
- l->llc_dsap = l->llc_ssap = 0;
- /* Fall through to */
- case LLC_TEST:
- case LLC_TEST_P:
- {
- struct sockaddr sa;
- register struct ether_header *eh2;
- int i;
- u_char c = l->llc_dsap;
-
- l->llc_dsap = l->llc_ssap;
- l->llc_ssap = c;
- if (m->m_flags & (M_BCAST | M_MCAST))
- bcopy((caddr_t)ac->ac_enaddr,
- (caddr_t)eh->ether_dhost, 6);
- sa.sa_family = AF_UNSPEC;
- sa.sa_len = sizeof(sa);
- eh2 = (struct ether_header *)sa.sa_data;
- for (i = 0; i < 6; i++) {
- eh2->ether_shost[i] = c = eh->ether_dhost[i];
- eh2->ether_dhost[i] =
- eh->ether_dhost[i] = eh->ether_shost[i];
- eh->ether_shost[i] = c;
- }
- ifp->if_output(ifp, m, &sa, NULL);
- return;
- }
- default:
- m_freem(m);
- return;
- }
- break;
-#endif /* ISO */
-#ifdef LLC
- case LLC_X25_LSAP:
- {
- if (m->m_pkthdr.len > ether_type)
- m_adj(m, ether_type - m->m_pkthdr.len);
- M_PREPEND(m, sizeof(struct sdl_hdr) , M_DONTWAIT);
- if (m == 0)
- return;
- if ( !sdl_sethdrif(ifp, eh->ether_shost, LLC_X25_LSAP,
- eh->ether_dhost, LLC_X25_LSAP, 6,
- mtod(m, struct sdl_hdr *)))
- panic("ETHER cons addr failure");
- mtod(m, struct sdl_hdr *)->sdlhdr_len = ether_type;
-#ifdef LLC_DEBUG
- printf("llc packet\n");
-#endif /* LLC_DEBUG */
- schednetisr(NETISR_CCITT);
- inq = &llcintrq;
- break;
- }
-#endif /* LLC */
- dropanyway:
- default:
- m_freem(m);
- return;
- }
-#else /* ISO || LLC || NETATALK */
- m_freem(m);
- return;
-#endif /* ISO || LLC || NETATALK */
- }
-
- s = splimp();
- if (IF_QFULL(inq)) {
- IF_DROP(inq);
- m_freem(m);
- } else
- IF_ENQUEUE(inq, m);
- splx(s);
-}
-
-/*
- * Perform common duties while attaching to interface list
- */
-void
-ether_ifattach(ifp)
- register struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
- register struct sockaddr_dl *sdl;
-
- ifp->if_type = IFT_ETHER;
- ifp->if_addrlen = 6;
- ifp->if_hdrlen = 14;
- ifp->if_mtu = ETHERMTU;
- if (ifp->if_baudrate == 0)
- ifp->if_baudrate = 10000000;
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- if ((sdl = (struct sockaddr_dl *)ifa->ifa_addr) &&
- sdl->sdl_family == AF_LINK) {
- sdl->sdl_type = IFT_ETHER;
- sdl->sdl_alen = ifp->if_addrlen;
- bcopy((caddr_t)((struct arpcom *)ifp)->ac_enaddr,
- LLADDR(sdl), ifp->if_addrlen);
- break;
- }
-}
-
-static u_char ether_ipmulticast_min[6] =
- { 0x01, 0x00, 0x5e, 0x00, 0x00, 0x00 };
-static u_char ether_ipmulticast_max[6] =
- { 0x01, 0x00, 0x5e, 0x7f, 0xff, 0xff };
-/*
- * Add an Ethernet multicast address or range of addresses to the list for a
- * given interface.
- */
-int
-ether_addmulti(ifr, ac)
- struct ifreq *ifr;
- register struct arpcom *ac;
-{
- register struct ether_multi *enm;
- struct sockaddr_in *sin;
- u_char addrlo[6];
- u_char addrhi[6];
- int set_allmulti = 0;
- int s = splimp();
-
- switch (ifr->ifr_addr.sa_family) {
-
- case AF_UNSPEC:
- bcopy(ifr->ifr_addr.sa_data, addrlo, 6);
- bcopy(addrlo, addrhi, 6);
- break;
-
-#ifdef INET
- case AF_INET:
- sin = (struct sockaddr_in *)&(ifr->ifr_addr);
- if (sin->sin_addr.s_addr == INADDR_ANY) {
- /*
- * An IP address of INADDR_ANY means listen to all
- * of the Ethernet multicast addresses used for IP.
- * (This is for the sake of IP multicast routers.)
- */
- bcopy(ether_ipmulticast_min, addrlo, 6);
- bcopy(ether_ipmulticast_max, addrhi, 6);
- set_allmulti = 1;
- }
- else {
- ETHER_MAP_IP_MULTICAST(&sin->sin_addr, addrlo);
- bcopy(addrlo, addrhi, 6);
- }
- break;
-#endif
-
- default:
- splx(s);
- return (EAFNOSUPPORT);
- }
-
- /*
- * Verify that we have valid Ethernet multicast addresses.
- */
- if ((addrlo[0] & 0x01) != 1 || (addrhi[0] & 0x01) != 1) {
- splx(s);
- return (EINVAL);
- }
- /*
- * See if the address range is already in the list.
- */
- ETHER_LOOKUP_MULTI(addrlo, addrhi, ac, enm);
- if (enm != NULL) {
- /*
- * Found it; just increment the reference count.
- */
- ++enm->enm_refcount;
- splx(s);
- return (0);
- }
- /*
- * New address or range; malloc a new multicast record
- * and link it into the interface's multicast list.
- */
- enm = (struct ether_multi *)malloc(sizeof(*enm), M_IFMADDR, M_NOWAIT);
- if (enm == NULL) {
- splx(s);
- return (ENOBUFS);
- }
- bcopy(addrlo, enm->enm_addrlo, 6);
- bcopy(addrhi, enm->enm_addrhi, 6);
- enm->enm_ac = ac;
- enm->enm_refcount = 1;
- enm->enm_next = ac->ac_multiaddrs;
- ac->ac_multiaddrs = enm;
- ac->ac_multicnt++;
- splx(s);
- if (set_allmulti)
- ac->ac_if.if_flags |= IFF_ALLMULTI;
-
- /*
- * Return ENETRESET to inform the driver that the list has changed
- * and its reception filter should be adjusted accordingly.
- */
- return (ENETRESET);
-}
-
-/*
- * Delete a multicast address record.
- */
-int
-ether_delmulti(ifr, ac)
- struct ifreq *ifr;
- register struct arpcom *ac;
-{
- register struct ether_multi *enm;
- register struct ether_multi **p;
- struct sockaddr_in *sin;
- u_char addrlo[6];
- u_char addrhi[6];
- int unset_allmulti = 0;
- int s = splimp();
-
- switch (ifr->ifr_addr.sa_family) {
-
- case AF_UNSPEC:
- bcopy(ifr->ifr_addr.sa_data, addrlo, 6);
- bcopy(addrlo, addrhi, 6);
- break;
-
-#ifdef INET
- case AF_INET:
- sin = (struct sockaddr_in *)&(ifr->ifr_addr);
- if (sin->sin_addr.s_addr == INADDR_ANY) {
- /*
- * An IP address of INADDR_ANY means stop listening
- * to the range of Ethernet multicast addresses used
- * for IP.
- */
- bcopy(ether_ipmulticast_min, addrlo, 6);
- bcopy(ether_ipmulticast_max, addrhi, 6);
- unset_allmulti = 1;
- }
- else {
- ETHER_MAP_IP_MULTICAST(&sin->sin_addr, addrlo);
- bcopy(addrlo, addrhi, 6);
- }
- break;
-#endif
-
- default:
- splx(s);
- return (EAFNOSUPPORT);
- }
-
- /*
- * Look up the address in our list.
- */
- ETHER_LOOKUP_MULTI(addrlo, addrhi, ac, enm);
- if (enm == NULL) {
- splx(s);
- return (ENXIO);
- }
- if (--enm->enm_refcount != 0) {
- /*
- * Still some claims to this record.
- */
- splx(s);
- return (0);
- }
- /*
- * No remaining claims to this record; unlink and free it.
- */
- for (p = &enm->enm_ac->ac_multiaddrs;
- *p != enm;
- p = &(*p)->enm_next)
- continue;
- *p = (*p)->enm_next;
- free(enm, M_IFMADDR);
- ac->ac_multicnt--;
- splx(s);
- if (unset_allmulti)
- ac->ac_if.if_flags &= ~IFF_ALLMULTI;
-
- /*
- * Return ENETRESET to inform the driver that the list has changed
- * and its reception filter should be adjusted accordingly.
- */
- return (ENETRESET);
-}
-
-SYSCTL_NODE(_net_link, IFT_ETHER, ether, CTLFLAG_RW, 0, "Ethernet");
-
-int
-ether_ioctl(struct ifnet *ifp, int command, caddr_t data)
-{
- struct ifaddr *ifa = (struct ifaddr *) data;
- struct ifreq *ifr = (struct ifreq *) data;
- int error = 0;
-
- switch (command) {
- case SIOCSIFADDR:
- ifp->if_flags |= IFF_UP;
-
- switch (ifa->ifa_addr->sa_family) {
-#ifdef INET
- case AF_INET:
- ifp->if_init(ifp->if_softc); /* before arpwhohas */
- arp_ifinit((struct arpcom *)ifp, ifa);
- break;
-#endif
-#ifdef IPX
- /*
- * XXX - This code is probably wrong
- */
- case AF_IPX:
- {
- register struct ipx_addr *ina = &(IA_SIPX(ifa)->sipx_addr);
- struct arpcom *ac = (struct arpcom *) (ifp->if_softc);
-
- if (ipx_nullhost(*ina))
- ina->x_host =
- *(union ipx_host *)
- ac->ac_enaddr;
- else {
- bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) ac->ac_enaddr,
- sizeof(ac->ac_enaddr));
- }
-
- /*
- * Set new address
- */
- ifp->if_init(ifp->if_softc);
- break;
- }
-#endif
-#ifdef NS
- /*
- * XXX - This code is probably wrong
- */
- case AF_NS:
- {
- register struct ns_addr *ina = &(IA_SNS(ifa)->sns_addr);
- struct arpcom *ac = (struct arpcom *) (ifp->if_softc);
-
- if (ns_nullhost(*ina))
- ina->x_host =
- *(union ns_host *) (ac->ac_enaddr);
- else {
- bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) ac->ac_enaddr,
- sizeof(ac->ac_enaddr));
- }
-
- /*
- * Set new address
- */
- ifp->if_init(ifp->if_softc);
- break;
- }
-#endif
- default:
- ifp->if_init(ifp->if_softc);
- break;
- }
- break;
-
- case SIOCGIFADDR:
- {
- struct sockaddr *sa;
-
- sa = (struct sockaddr *) & ifr->ifr_data;
- bcopy(((struct arpcom *)ifp->if_softc)->ac_enaddr,
- (caddr_t) sa->sa_data, ETHER_ADDR_LEN);
- }
- break;
-
- case SIOCSIFMTU:
- /*
- * Set the interface MTU.
- */
- if (ifr->ifr_mtu > ETHERMTU) {
- error = EINVAL;
- } else {
- ifp->if_mtu = ifr->ifr_mtu;
- }
- break;
- }
- return (error);
-}
diff --git a/c/src/exec/libnetworking/net/if_llc.h b/c/src/exec/libnetworking/net/if_llc.h
deleted file mode 100644
index 3cdf652167..0000000000
--- a/c/src/exec/libnetworking/net/if_llc.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * @(#)if_llc.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_LLC_H_
-#define _NET_IF_LLC_H_
-
-/*
- * IEEE 802.2 Link Level Control headers, for use in conjunction with
- * 802.{3,4,5} media access control methods.
- *
- * Headers here do not use bit fields due to shortcomings in many
- * compilers.
- */
-
-struct llc {
- u_char llc_dsap;
- u_char llc_ssap;
- union {
- struct {
- u_char control;
- u_char format_id;
- u_char class;
- u_char window_x2;
- } type_u;
- struct {
- u_char num_snd_x2;
- u_char num_rcv_x2;
- } type_i;
- struct {
- u_char control;
- u_char num_rcv_x2;
- } type_s;
- struct {
- u_char control;
- struct frmrinfo {
- u_char rej_pdu_0;
- u_char rej_pdu_1;
- u_char frmr_control;
- u_char frmr_control_ext;
- u_char frmr_cause;
- } frmrinfo;
- } type_frmr;
- struct {
- u_char control;
- u_char org_code[3];
- u_short ether_type;
- } type_snap;
- struct {
- u_char control;
- u_char control_ext;
- } type_raw;
- } llc_un;
-};
-#define llc_control llc_un.type_u.control
-#define llc_control_ext llc_un.type_raw.control_ext
-#define llc_fid llc_un.type_u.format_id
-#define llc_class llc_un.type_u.class
-#define llc_window llc_un.type_u.window_x2
-#define llc_frmrinfo llc_un.type_frmr.frmrinfo
-#define llc_frmr_pdu0 llc_un.type_frmr.frmrinfo.rej_pdu0
-#define llc_frmr_pdu1 llc_un.type_frmr.frmrinfo.rej_pdu1
-#define llc_frmr_control llc_un.type_frmr.frmrinfo.frmr_control
-#define llc_frmr_control_ext llc_un.type_frmr.frmrinfo.frmr_control_ext
-#define llc_frmr_cause llc_un.type_frmr.frmrinfo.frmr_control_ext
-
-/*
- * Don't use sizeof(struct llc_un) for LLC header sizes
- */
-#define LLC_ISFRAMELEN 4
-#define LLC_UFRAMELEN 3
-#define LLC_FRMRLEN 7
-
-/*
- * Unnumbered LLC format commands
- */
-#define LLC_UI 0x3
-#define LLC_UI_P 0x13
-#define LLC_DISC 0x43
-#define LLC_DISC_P 0x53
-#define LLC_UA 0x63
-#define LLC_UA_P 0x73
-#define LLC_TEST 0xe3
-#define LLC_TEST_P 0xf3
-#define LLC_FRMR 0x87
-#define LLC_FRMR_P 0x97
-#define LLC_DM 0x0f
-#define LLC_DM_P 0x1f
-#define LLC_XID 0xaf
-#define LLC_XID_P 0xbf
-#define LLC_SABME 0x6f
-#define LLC_SABME_P 0x7f
-
-/*
- * Supervisory LLC commands
- */
-#define LLC_RR 0x01
-#define LLC_RNR 0x05
-#define LLC_REJ 0x09
-
-/*
- * Info format - dummy only
- */
-#define LLC_INFO 0x00
-
-/*
- * ISO PDTR 10178 contains among others
- */
-#define LLC_X25_LSAP 0x7e
-#define LLC_SNAP_LSAP 0xaa
-#define LLC_ISO_LSAP 0xfe
-
-#endif
diff --git a/c/src/exec/libnetworking/net/if_loop.c b/c/src/exec/libnetworking/net/if_loop.c
deleted file mode 100644
index 3823c28744..0000000000
--- a/c/src/exec/libnetworking/net/if_loop.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)if_loop.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-/*
- * Loopback interface driver for protocol testing and timing.
- */
-#include "loop.h"
-#if NLOOP > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-
-#include <net/if.h>
-#include <net/if_types.h>
-#include <net/netisr.h>
-#include <net/route.h>
-#include <net/bpf.h>
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#endif
-
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
-#ifdef NS
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-#endif
-
-#ifdef ISO
-#include <netiso/iso.h>
-#include <netiso/iso_var.h>
-#endif
-
-#ifdef NETATALK
-#include <netinet/if_ether.h>
-#include <netatalk/at.h>
-#include <netatalk/at_var.h>
-#endif NETATALK
-
-#include "bpfilter.h"
-
-static int loioctl __P((struct ifnet *, int, caddr_t));
-static void lortrequest __P((int, struct rtentry *, struct sockaddr *));
-
- void rtems_bsdnet_loopattach __P((void *));
-PSEUDO_SET(loopattach, if_loop);
-
-#ifdef TINY_LOMTU
-#define LOMTU (1024+512)
-#else
-#define LOMTU 16384
-#endif
-
-struct ifnet loif[NLOOP];
-
-/* ARGSUSED */
-void
-rtems_bsdnet_loopattach(dummy)
- void *dummy;
-{
- register struct ifnet *ifp;
- register int i = 0;
-
- for (ifp = loif; i < NLOOP; ifp++) {
- ifp->if_name = "lo";
- ifp->if_next = NULL;
- ifp->if_unit = i++;
- ifp->if_mtu = LOMTU;
- ifp->if_flags = IFF_LOOPBACK | IFF_MULTICAST;
- ifp->if_ioctl = loioctl;
- ifp->if_output = looutput;
- ifp->if_type = IFT_LOOP;
- ifp->if_hdrlen = 0;
- ifp->if_addrlen = 0;
- if_attach(ifp);
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_NULL, sizeof(u_int));
-#endif
- }
-}
-
-int
-looutput(ifp, m, dst, rt)
- struct ifnet *ifp;
- register struct mbuf *m;
- struct sockaddr *dst;
- register struct rtentry *rt;
-{
- int s, isr;
- register struct ifqueue *ifq = 0;
-
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("looutput no HDR");
-#if NBPFILTER > 0
- /* BPF write needs to be handled specially */
- if (dst->sa_family == AF_UNSPEC) {
- dst->sa_family = *(mtod(m, int *));
- m->m_len -= sizeof(int);
- m->m_pkthdr.len -= sizeof(int);
- m->m_data += sizeof(int);
- }
-
- if (ifp->if_bpf) {
- /*
- * We need to prepend the address family as
- * a four byte field. Cons up a dummy header
- * to pacify bpf. This is safe because bpf
- * will only read from the mbuf (i.e., it won't
- * try to free it or keep a pointer a to it).
- */
- struct mbuf m0;
- u_int af = dst->sa_family;
-
- m0.m_next = m;
- m0.m_len = 4;
- m0.m_data = (char *)&af;
-
- bpf_mtap(ifp, &m0);
- }
-#endif
- m->m_pkthdr.rcvif = ifp;
-
- if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
- m_freem(m);
- return (rt->rt_flags & RTF_BLACKHOLE ? 0 :
- rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
- }
- ifp->if_opackets++;
- ifp->if_obytes += m->m_pkthdr.len;
- switch (dst->sa_family) {
-
-#ifdef INET
- case AF_INET:
- ifq = &ipintrq;
- isr = NETISR_IP;
- break;
-#endif
-#ifdef IPX
- case AF_IPX:
- ifq = &ipxintrq;
- isr = NETISR_IPX;
- break;
-#endif
-#ifdef NS
- case AF_NS:
- ifq = &nsintrq;
- isr = NETISR_NS;
- break;
-#endif
-#ifdef ISO
- case AF_ISO:
- ifq = &clnlintrq;
- isr = NETISR_ISO;
- break;
-#endif
-#ifdef NETATALK
- case AF_APPLETALK:
- ifq = &atintrq2;
- isr = NETISR_ATALK;
- break;
-#endif NETATALK
- default:
- printf("lo%d: can't handle af%d\n", ifp->if_unit,
- dst->sa_family);
- m_freem(m);
- return (EAFNOSUPPORT);
- }
- s = splimp();
- if (IF_QFULL(ifq)) {
- IF_DROP(ifq);
- m_freem(m);
- splx(s);
- return (ENOBUFS);
- }
- IF_ENQUEUE(ifq, m);
- schednetisr(isr);
- ifp->if_ipackets++;
- ifp->if_ibytes += m->m_pkthdr.len;
- splx(s);
- return (0);
-}
-
-/* ARGSUSED */
-static void
-lortrequest(cmd, rt, sa)
- int cmd;
- struct rtentry *rt;
- struct sockaddr *sa;
-{
- if (rt) {
- rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; /* for ISO */
- /*
- * For optimal performance, the send and receive buffers
- * should be at least twice the MTU plus a little more for
- * overhead.
- */
- rt->rt_rmx.rmx_recvpipe =
- rt->rt_rmx.rmx_sendpipe = 3 * LOMTU;
- }
-}
-
-/*
- * Process an ioctl request.
- */
-/* ARGSUSED */
-static int
-loioctl(ifp, cmd, data)
- register struct ifnet *ifp;
- int cmd;
- caddr_t data;
-{
- register struct ifaddr *ifa;
- register struct ifreq *ifr = (struct ifreq *)data;
- register int error = 0;
-
- switch (cmd) {
-
- case SIOCSIFADDR:
- ifp->if_flags |= IFF_UP | IFF_RUNNING;
- ifa = (struct ifaddr *)data;
- ifa->ifa_rtrequest = lortrequest;
- /*
- * Everything else is done at a higher level.
- */
- break;
-
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- if (ifr == 0) {
- error = EAFNOSUPPORT; /* XXX */
- break;
- }
- switch (ifr->ifr_addr.sa_family) {
-
-#ifdef INET
- case AF_INET:
- break;
-#endif
-
- default:
- error = EAFNOSUPPORT;
- break;
- }
- break;
-
- case SIOCSIFMTU:
- ifp->if_mtu = ifr->ifr_mtu;
- break;
-
- default:
- error = EINVAL;
- }
- return (error);
-}
-#endif /* NLOOP > 0 */
diff --git a/c/src/exec/libnetworking/net/if_types.h b/c/src/exec/libnetworking/net/if_types.h
deleted file mode 100644
index 833ba471c3..0000000000
--- a/c/src/exec/libnetworking/net/if_types.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 1989, 1993, 1994
- * 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.
- *
- * @(#)if_types.h 8.2 (Berkeley) 4/20/94
- * $Id$
- */
-
-#ifndef _NET_IF_TYPES_H_
-#define _NET_IF_TYPES_H_
-
-/*
- * Interface types for benefit of parsing media address headers.
- * This list is derived from the SNMP list of ifTypes, currently
- * documented in RFC1573.
- */
-
-#define IFT_OTHER 0x1 /* none of the following */
-#define IFT_1822 0x2 /* old-style arpanet imp */
-#define IFT_HDH1822 0x3 /* HDH arpanet imp */
-#define IFT_X25DDN 0x4 /* x25 to imp */
-#define IFT_X25 0x5 /* PDN X25 interface (RFC877) */
-#define IFT_ETHER 0x6 /* Ethernet CSMACD */
-#define IFT_ISO88023 0x7 /* CMSA CD */
-#define IFT_ISO88024 0x8 /* Token Bus */
-#define IFT_ISO88025 0x9 /* Token Ring */
-#define IFT_ISO88026 0xa /* MAN */
-#define IFT_STARLAN 0xb
-#define IFT_P10 0xc /* Proteon 10MBit ring */
-#define IFT_P80 0xd /* Proteon 80MBit ring */
-#define IFT_HY 0xe /* Hyperchannel */
-#define IFT_FDDI 0xf
-#define IFT_LAPB 0x10
-#define IFT_SDLC 0x11
-#define IFT_T1 0x12
-#define IFT_CEPT 0x13 /* E1 - european T1 */
-#define IFT_ISDNBASIC 0x14
-#define IFT_ISDNPRIMARY 0x15
-#define IFT_PTPSERIAL 0x16 /* Proprietary PTP serial */
-#define IFT_PPP 0x17 /* RFC 1331 */
-#define IFT_LOOP 0x18 /* loopback */
-#define IFT_EON 0x19 /* ISO over IP */
-#define IFT_XETHER 0x1a /* obsolete 3MB experimental ethernet */
-#define IFT_NSIP 0x1b /* XNS over IP */
-#define IFT_SLIP 0x1c /* IP over generic TTY */
-#define IFT_ULTRA 0x1d /* Ultra Technologies */
-#define IFT_DS3 0x1e /* Generic T3 */
-#define IFT_SIP 0x1f /* SMDS */
-#define IFT_FRELAY 0x20 /* Frame Relay DTE only */
-#define IFT_RS232 0x21
-#define IFT_PARA 0x22 /* parallel-port */
-#define IFT_ARCNET 0x23
-#define IFT_ARCNETPLUS 0x24
-#define IFT_ATM 0x25 /* ATM cells */
-#define IFT_MIOX25 0x26
-#define IFT_SONET 0x27 /* SONET or SDH */
-#define IFT_X25PLE 0x28
-#define IFT_ISO88022LLC 0x29
-#define IFT_LOCALTALK 0x2a
-#define IFT_SMDSDXI 0x2b
-#define IFT_FRELAYDCE 0x2c /* Frame Relay DCE */
-#define IFT_V35 0x2d
-#define IFT_HSSI 0x2e
-#define IFT_HIPPI 0x2f
-#define IFT_MODEM 0x30 /* Generic Modem */
-#define IFT_AAL5 0x31 /* AAL5 over ATM */
-#define IFT_SONETPATH 0x32
-#define IFT_SONETVT 0x33
-#define IFT_SMDSICIP 0x34 /* SMDS InterCarrier Interface */
-#define IFT_PROPVIRTUAL 0x35 /* Proprietary Virtual/internal */
-#define IFT_PROPMUX 0x36 /* Proprietary Multiplexing */
-
-#endif
diff --git a/c/src/exec/libnetworking/net/netisr.h b/c/src/exec/libnetworking/net/netisr.h
deleted file mode 100644
index 73269a4442..0000000000
--- a/c/src/exec/libnetworking/net/netisr.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 1989, 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.
- *
- * @(#)netisr.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_NETISR_H_
-#define _NET_NETISR_H_
-
-/*
- * The networking code runs off software interrupts.
- *
- * You can switch into the network by doing splnet() and return by splx().
- * The software interrupt level for the network is higher than the software
- * level for the clock (so you can enter the network in routines called
- * at timeout time).
- */
-#if defined(vax) || defined(tahoe)
-#define setsoftnet() mtpr(SIRR, 12)
-#endif
-
-/*
- * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status
- * word which is used to de-multiplex a single software
- * interrupt used for scheduling the network code to calls
- * on the lowest level routine of each protocol.
- */
-#define NETISR_RAW 0 /* same as AF_UNSPEC */
-#define NETISR_IP 2 /* same as AF_INET */
-#define NETISR_IMP 3 /* same as AF_IMPLINK */
-#define NETISR_NS 6 /* same as AF_NS */
-#define NETISR_ISO 7 /* same as AF_ISO */
-#define NETISR_CCITT 10 /* same as AF_CCITT */
-#define NETISR_ATALK 16 /* same as AF_APPLETALK */
-#define NETISR_ARP 18 /* same as AF_LINK */
-#define NETISR_IPX 23 /* same as AF_IPX */
-#define NETISR_ISDN 26 /* same as AF_E164 */
-#define NETISR_PPP 27 /* PPP soft interrupt */
-
-#define schednetisr(anisr) rtems_bsdnet_schednetisr(anisr)
-
-#ifndef LOCORE
-#ifdef KERNEL
-extern volatile unsigned int netisr; /* scheduling bits for network */
-
-typedef void netisr_t(void);
-
-struct netisrtab {
- int nit_num;
- netisr_t *nit_isr;
-};
-
-#define NETISR_SET(num, isr)
-
-int register_netisr __P((int, netisr_t *));
-
-#endif
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/net/radix.c b/c/src/exec/libnetworking/net/radix.c
deleted file mode 100644
index bc1b7ee1d1..0000000000
--- a/c/src/exec/libnetworking/net/radix.c
+++ /dev/null
@@ -1,1028 +0,0 @@
-/*
- * Copyright (c) 1988, 1989, 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.
- *
- * @(#)radix.c 8.4 (Berkeley) 11/2/94
- * $Id$
- */
-
-/*
- * Routines to build and maintain radix trees for routing lookups.
- */
-#ifndef _RADIX_H_
-#include <sys/param.h>
-#ifdef KERNEL
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#define M_DONTWAIT M_NOWAIT
-#include <sys/domain.h>
-#else
-#include <stdlib.h>
-#endif
-#include <sys/syslog.h>
-#include <net/radix.h>
-#endif
-
-static struct radix_node *
- rn_lookup __P((void *v_arg, void *m_arg,
- struct radix_node_head *head));
-static int rn_walktree_from __P((struct radix_node_head *h, void *a,
- void *m, walktree_f_t *f, void *w));
-static int rn_walktree __P((struct radix_node_head *, walktree_f_t *, void *));
-static struct radix_node
- *rn_delete __P((void *, void *, struct radix_node_head *)),
- *rn_insert __P((void *, struct radix_node_head *, int *,
- struct radix_node [2])),
- *rn_newpair __P((void *, int, struct radix_node[2])),
- *rn_search __P((void *, struct radix_node *)),
- *rn_search_m __P((void *, struct radix_node *, void *));
-
-static int max_keylen;
-static struct radix_mask *rn_mkfreelist;
-static struct radix_node_head *mask_rnhead;
-static char *addmask_key;
-static char normal_chars[] = {0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, -1};
-static char *rn_zeros, *rn_ones;
-
-#define rn_masktop (mask_rnhead->rnh_treetop)
-#undef Bcmp
-#define Bcmp(a, b, l) (l == 0 ? 0 : bcmp((caddr_t)(a), (caddr_t)(b), (u_long)l))
-
-static int rn_lexobetter __P((void *m_arg, void *n_arg));
-static struct radix_mask *
- rn_new_radix_mask __P((struct radix_node *tt,
- struct radix_mask *next));
-static int rn_satsifies_leaf __P((char *trial, struct radix_node *leaf,
- int skip));
-
-/*
- * The data structure for the keys is a radix tree with one way
- * branching removed. The index rn_b at an internal node n represents a bit
- * position to be tested. The tree is arranged so that all descendants
- * of a node n have keys whose bits all agree up to position rn_b - 1.
- * (We say the index of n is rn_b.)
- *
- * There is at least one descendant which has a one bit at position rn_b,
- * and at least one with a zero there.
- *
- * A route is determined by a pair of key and mask. We require that the
- * bit-wise logical and of the key and mask to be the key.
- * We define the index of a route to associated with the mask to be
- * the first bit number in the mask where 0 occurs (with bit number 0
- * representing the highest order bit).
- *
- * We say a mask is normal if every bit is 0, past the index of the mask.
- * If a node n has a descendant (k, m) with index(m) == index(n) == rn_b,
- * and m is a normal mask, then the route applies to every descendant of n.
- * If the index(m) < rn_b, this implies the trailing last few bits of k
- * before bit b are all 0, (and hence consequently true of every descendant
- * of n), so the route applies to all descendants of the node as well.
- *
- * Similar logic shows that a non-normal mask m such that
- * index(m) <= index(n) could potentially apply to many children of n.
- * Thus, for each non-host route, we attach its mask to a list at an internal
- * node as high in the tree as we can go.
- *
- * The present version of the code makes use of normal routes in short-
- * circuiting an explict mask and compare operation when testing whether
- * a key satisfies a normal route, and also in remembering the unique leaf
- * that governs a subtree.
- */
-
-static struct radix_node *
-rn_search(v_arg, head)
- void *v_arg;
- struct radix_node *head;
-{
- register struct radix_node *x;
- register caddr_t v;
-
- for (x = head, v = v_arg; x->rn_b >= 0;) {
- if (x->rn_bmask & v[x->rn_off])
- x = x->rn_r;
- else
- x = x->rn_l;
- }
- return (x);
-};
-
-static struct radix_node *
-rn_search_m(v_arg, head, m_arg)
- struct radix_node *head;
- void *v_arg, *m_arg;
-{
- register struct radix_node *x;
- register caddr_t v = v_arg, m = m_arg;
-
- for (x = head; x->rn_b >= 0;) {
- if ((x->rn_bmask & m[x->rn_off]) &&
- (x->rn_bmask & v[x->rn_off]))
- x = x->rn_r;
- else
- x = x->rn_l;
- }
- return x;
-};
-
-int
-rn_refines(m_arg, n_arg)
- void *m_arg, *n_arg;
-{
- register caddr_t m = m_arg, n = n_arg;
- register caddr_t lim, lim2 = lim = n + *(u_char *)n;
- int longer = (*(u_char *)n++) - (int)(*(u_char *)m++);
- int masks_are_equal = 1;
-
- if (longer > 0)
- lim -= longer;
- while (n < lim) {
- if (*n & ~(*m))
- return 0;
- if (*n++ != *m++)
- masks_are_equal = 0;
- }
- while (n < lim2)
- if (*n++)
- return 0;
- if (masks_are_equal && (longer < 0))
- for (lim2 = m - longer; m < lim2; )
- if (*m++)
- return 1;
- return (!masks_are_equal);
-}
-
-struct radix_node *
-rn_lookup(v_arg, m_arg, head)
- void *v_arg, *m_arg;
- struct radix_node_head *head;
-{
- register struct radix_node *x;
- caddr_t netmask = 0;
-
- if (m_arg) {
- if ((x = rn_addmask(m_arg, 1, head->rnh_treetop->rn_off)) == 0)
- return (0);
- netmask = x->rn_key;
- }
- x = rn_match(v_arg, head);
- if (x && netmask) {
- while (x && x->rn_mask != netmask)
- x = x->rn_dupedkey;
- }
- return x;
-}
-
-static int
-rn_satsifies_leaf(trial, leaf, skip)
- char *trial;
- register struct radix_node *leaf;
- int skip;
-{
- register char *cp = trial, *cp2 = leaf->rn_key, *cp3 = leaf->rn_mask;
- char *cplim;
- int length = min(*(u_char *)cp, *(u_char *)cp2);
-
- if (cp3 == 0)
- cp3 = rn_ones;
- else
- length = min(length, *(u_char *)cp3);
- cplim = cp + length; cp3 += skip; cp2 += skip;
- for (cp += skip; cp < cplim; cp++, cp2++, cp3++)
- if ((*cp ^ *cp2) & *cp3)
- return 0;
- return 1;
-}
-
-struct radix_node *
-rn_match(v_arg, head)
- void *v_arg;
- struct radix_node_head *head;
-{
- caddr_t v = v_arg;
- register struct radix_node *t = head->rnh_treetop, *x;
- register caddr_t cp = v, cp2;
- caddr_t cplim;
- struct radix_node *saved_t, *top = t;
- int off = t->rn_off, vlen = *(u_char *)cp, matched_off;
- register int test, b, rn_b;
-
- /*
- * Open code rn_search(v, top) to avoid overhead of extra
- * subroutine call.
- */
- for (; t->rn_b >= 0; ) {
- if (t->rn_bmask & cp[t->rn_off])
- t = t->rn_r;
- else
- t = t->rn_l;
- }
- /*
- * See if we match exactly as a host destination
- * or at least learn how many bits match, for normal mask finesse.
- *
- * It doesn't hurt us to limit how many bytes to check
- * to the length of the mask, since if it matches we had a genuine
- * match and the leaf we have is the most specific one anyway;
- * if it didn't match with a shorter length it would fail
- * with a long one. This wins big for class B&C netmasks which
- * are probably the most common case...
- */
- if (t->rn_mask)
- vlen = *(u_char *)t->rn_mask;
- cp += off; cp2 = t->rn_key + off; cplim = v + vlen;
- for (; cp < cplim; cp++, cp2++)
- if (*cp != *cp2)
- goto on1;
- /*
- * This extra grot is in case we are explicitly asked
- * to look up the default. Ugh!
- */
- if ((t->rn_flags & RNF_ROOT) && t->rn_dupedkey)
- t = t->rn_dupedkey;
- return t;
-on1:
- test = (*cp ^ *cp2) & 0xff; /* find first bit that differs */
- for (b = 7; (test >>= 1) > 0;)
- b--;
- matched_off = cp - v;
- b += matched_off << 3;
- rn_b = -1 - b;
- /*
- * If there is a host route in a duped-key chain, it will be first.
- */
- if ((saved_t = t)->rn_mask == 0)
- t = t->rn_dupedkey;
- for (; t; t = t->rn_dupedkey)
- /*
- * Even if we don't match exactly as a host,
- * we may match if the leaf we wound up at is
- * a route to a net.
- */
- if (t->rn_flags & RNF_NORMAL) {
- if (rn_b <= t->rn_b)
- return t;
- } else if (rn_satsifies_leaf(v, t, matched_off))
- return t;
- t = saved_t;
- /* start searching up the tree */
- do {
- register struct radix_mask *m;
- t = t->rn_p;
- m = t->rn_mklist;
- if (m) {
- /*
- * If non-contiguous masks ever become important
- * we can restore the masking and open coding of
- * the search and satisfaction test and put the
- * calculation of "off" back before the "do".
- */
- do {
- if (m->rm_flags & RNF_NORMAL) {
- if (rn_b <= m->rm_b)
- return (m->rm_leaf);
- } else {
- off = min(t->rn_off, matched_off);
- x = rn_search_m(v, t, m->rm_mask);
- while (x && x->rn_mask != m->rm_mask)
- x = x->rn_dupedkey;
- if (x && rn_satsifies_leaf(v, x, off))
- return x;
- }
- m = m->rm_mklist;
- } while (m);
- }
- } while (t != top);
- return 0;
-};
-
-#ifdef RN_DEBUG
-int rn_nodenum;
-struct radix_node *rn_clist;
-int rn_saveinfo;
-int rn_debug = 1;
-#endif
-
-static struct radix_node *
-rn_newpair(v, b, nodes)
- void *v;
- int b;
- struct radix_node nodes[2];
-{
- register struct radix_node *tt = nodes, *t = tt + 1;
- t->rn_b = b; t->rn_bmask = 0x80 >> (b & 7);
- t->rn_l = tt; t->rn_off = b >> 3;
- tt->rn_b = -1; tt->rn_key = (caddr_t)v; tt->rn_p = t;
- tt->rn_flags = t->rn_flags = RNF_ACTIVE;
-#ifdef RN_DEBUG
- tt->rn_info = rn_nodenum++; t->rn_info = rn_nodenum++;
- tt->rn_twin = t; tt->rn_ybro = rn_clist; rn_clist = tt;
-#endif
- return t;
-}
-
-static struct radix_node *
-rn_insert(v_arg, head, dupentry, nodes)
- void *v_arg;
- struct radix_node_head *head;
- int *dupentry;
- struct radix_node nodes[2];
-{
- caddr_t v = v_arg;
- struct radix_node *top = head->rnh_treetop;
- int head_off = top->rn_off, vlen = (int)*((u_char *)v);
- register struct radix_node *t = rn_search(v_arg, top);
- register caddr_t cp = v + head_off;
- register int b;
- struct radix_node *tt;
- /*
- * Find first bit at which v and t->rn_key differ
- */
- {
- register caddr_t cp2 = t->rn_key + head_off;
- register int cmp_res;
- caddr_t cplim = v + vlen;
-
- while (cp < cplim)
- if (*cp2++ != *cp++)
- goto on1;
- *dupentry = 1;
- return t;
-on1:
- *dupentry = 0;
- cmp_res = (cp[-1] ^ cp2[-1]) & 0xff;
- for (b = (cp - v) << 3; cmp_res; b--)
- cmp_res >>= 1;
- }
- {
- register struct radix_node *p, *x = top;
- cp = v;
- do {
- p = x;
- if (cp[x->rn_off] & x->rn_bmask)
- x = x->rn_r;
- else x = x->rn_l;
- } while (b > (unsigned) x->rn_b); /* x->rn_b < b && x->rn_b >= 0 */
-#ifdef RN_DEBUG
- if (rn_debug)
- log(LOG_DEBUG, "rn_insert: Going In:\n"), traverse(p);
-#endif
- t = rn_newpair(v_arg, b, nodes); tt = t->rn_l;
- if ((cp[p->rn_off] & p->rn_bmask) == 0)
- p->rn_l = t;
- else
- p->rn_r = t;
- x->rn_p = t; t->rn_p = p; /* frees x, p as temp vars below */
- if ((cp[t->rn_off] & t->rn_bmask) == 0) {
- t->rn_r = x;
- } else {
- t->rn_r = tt; t->rn_l = x;
- }
-#ifdef RN_DEBUG
- if (rn_debug)
- log(LOG_DEBUG, "rn_insert: Coming Out:\n"), traverse(p);
-#endif
- }
- return (tt);
-}
-
-struct radix_node *
-rn_addmask(n_arg, search, skip)
- int search, skip;
- void *n_arg;
-{
- caddr_t netmask = (caddr_t)n_arg;
- register struct radix_node *x;
- register caddr_t cp, cplim;
- register int b = 0, mlen, j;
- int maskduplicated, m0, isnormal;
- struct radix_node *saved_x;
- static int last_zeroed = 0;
-
- if ((mlen = *(u_char *)netmask) > max_keylen)
- mlen = max_keylen;
- if (skip == 0)
- skip = 1;
- if (mlen <= skip)
- return (mask_rnhead->rnh_nodes);
- if (skip > 1)
- Bcopy(rn_ones + 1, addmask_key + 1, skip - 1);
- if ((m0 = mlen) > skip)
- Bcopy(netmask + skip, addmask_key + skip, mlen - skip);
- /*
- * Trim trailing zeroes.
- */
- for (cp = addmask_key + mlen; (cp > addmask_key) && cp[-1] == 0;)
- cp--;
- mlen = cp - addmask_key;
- if (mlen <= skip) {
- if (m0 >= last_zeroed)
- last_zeroed = mlen;
- return (mask_rnhead->rnh_nodes);
- }
- if (m0 < last_zeroed)
- Bzero(addmask_key + m0, last_zeroed - m0);
- *addmask_key = last_zeroed = mlen;
- x = rn_search(addmask_key, rn_masktop);
- if (Bcmp(addmask_key, x->rn_key, mlen) != 0)
- x = 0;
- if (x || search)
- return (x);
- R_Malloc(x, struct radix_node *, max_keylen + 2 * sizeof (*x));
- if ((saved_x = x) == 0)
- return (0);
- Bzero(x, max_keylen + 2 * sizeof (*x));
- netmask = cp = (caddr_t)(x + 2);
- Bcopy(addmask_key, cp, mlen);
- x = rn_insert(cp, mask_rnhead, &maskduplicated, x);
- if (maskduplicated) {
- log(LOG_ERR, "rn_addmask: mask impossibly already in tree");
- Free(saved_x);
- return (x);
- }
- /*
- * Calculate index of mask, and check for normalcy.
- */
- cplim = netmask + mlen; isnormal = 1;
- for (cp = netmask + skip; (cp < cplim) && *(u_char *)cp == 0xff;)
- cp++;
- if (cp != cplim) {
- for (j = 0x80; (j & *cp) != 0; j >>= 1)
- b++;
- if (*cp != normal_chars[b] || cp != (cplim - 1))
- isnormal = 0;
- }
- b += (cp - netmask) << 3;
- x->rn_b = -1 - b;
- if (isnormal)
- x->rn_flags |= RNF_NORMAL;
- return (x);
-}
-
-static int /* XXX: arbitrary ordering for non-contiguous masks */
-rn_lexobetter(m_arg, n_arg)
- void *m_arg, *n_arg;
-{
- register u_char *mp = m_arg, *np = n_arg, *lim;
-
- if (*mp > *np)
- return 1; /* not really, but need to check longer one first */
- if (*mp == *np)
- for (lim = mp + *mp; mp < lim;)
- if (*mp++ > *np++)
- return 1;
- return 0;
-}
-
-static struct radix_mask *
-rn_new_radix_mask(tt, next)
- register struct radix_node *tt;
- register struct radix_mask *next;
-{
- register struct radix_mask *m;
-
- MKGet(m);
- if (m == 0) {
- log(LOG_ERR, "Mask for route not entered\n");
- return (0);
- }
- Bzero(m, sizeof *m);
- m->rm_b = tt->rn_b;
- m->rm_flags = tt->rn_flags;
- if (tt->rn_flags & RNF_NORMAL)
- m->rm_leaf = tt;
- else
- m->rm_mask = tt->rn_mask;
- m->rm_mklist = next;
- tt->rn_mklist = m;
- return m;
-}
-
-struct radix_node *
-rn_addroute(v_arg, n_arg, head, treenodes)
- void *v_arg, *n_arg;
- struct radix_node_head *head;
- struct radix_node treenodes[2];
-{
- caddr_t v = (caddr_t)v_arg, netmask = (caddr_t)n_arg;
- register struct radix_node *t, *x = 0, *tt;
- struct radix_node *saved_tt, *top = head->rnh_treetop;
- short b = 0, b_leaf = 0;
- int keyduplicated;
- caddr_t mmask;
- struct radix_mask *m, **mp;
-
- /*
- * In dealing with non-contiguous masks, there may be
- * many different routes which have the same mask.
- * We will find it useful to have a unique pointer to
- * the mask to speed avoiding duplicate references at
- * nodes and possibly save time in calculating indices.
- */
- if (netmask) {
- if ((x = rn_addmask(netmask, 0, top->rn_off)) == 0)
- return (0);
- b_leaf = x->rn_b;
- b = -1 - x->rn_b;
- netmask = x->rn_key;
- }
- /*
- * Deal with duplicated keys: attach node to previous instance
- */
- saved_tt = tt = rn_insert(v, head, &keyduplicated, treenodes);
- if (keyduplicated) {
- for (t = tt; tt; t = tt, tt = tt->rn_dupedkey) {
- if (tt->rn_mask == netmask)
- return (0);
- if (netmask == 0 ||
- (tt->rn_mask &&
- ((b_leaf < tt->rn_b) || /* index(netmask) > node */
- rn_refines(netmask, tt->rn_mask) ||
- rn_lexobetter(netmask, tt->rn_mask))))
- break;
- }
- /*
- * If the mask is not duplicated, we wouldn't
- * find it among possible duplicate key entries
- * anyway, so the above test doesn't hurt.
- *
- * We sort the masks for a duplicated key the same way as
- * in a masklist -- most specific to least specific.
- * This may require the unfortunate nuisance of relocating
- * the head of the list.
- */
- if (tt == saved_tt) {
- struct radix_node *xx = x;
- /* link in at head of list */
- (tt = treenodes)->rn_dupedkey = t;
- tt->rn_flags = t->rn_flags;
- tt->rn_p = x = t->rn_p;
- t->rn_p = tt; /* parent */
- if (x->rn_l == t) x->rn_l = tt; else x->rn_r = tt;
- saved_tt = tt; x = xx;
- } else {
- (tt = treenodes)->rn_dupedkey = t->rn_dupedkey;
- t->rn_dupedkey = tt;
- tt->rn_p = t; /* parent */
- if (tt->rn_dupedkey) /* parent */
- tt->rn_dupedkey->rn_p = tt; /* parent */
- }
-#ifdef RN_DEBUG
- t=tt+1; tt->rn_info = rn_nodenum++; t->rn_info = rn_nodenum++;
- tt->rn_twin = t; tt->rn_ybro = rn_clist; rn_clist = tt;
-#endif
- tt->rn_key = (caddr_t) v;
- tt->rn_b = -1;
- tt->rn_flags = RNF_ACTIVE;
- }
- /*
- * Put mask in tree.
- */
- if (netmask) {
- tt->rn_mask = netmask;
- tt->rn_b = x->rn_b;
- tt->rn_flags |= x->rn_flags & RNF_NORMAL;
- }
- t = saved_tt->rn_p;
- if (keyduplicated)
- goto on2;
- b_leaf = -1 - t->rn_b;
- if (t->rn_r == saved_tt) x = t->rn_l; else x = t->rn_r;
- /* Promote general routes from below */
- if (x->rn_b < 0) {
- for (mp = &t->rn_mklist; x; x = x->rn_dupedkey)
- if (x->rn_mask && (x->rn_b >= b_leaf) && x->rn_mklist == 0) {
- *mp = m = rn_new_radix_mask(x, 0);
- if (m)
- mp = &m->rm_mklist;
- }
- } else if (x->rn_mklist) {
- /*
- * Skip over masks whose index is > that of new node
- */
- for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist)
- if (m->rm_b >= b_leaf)
- break;
- t->rn_mklist = m; *mp = 0;
- }
-on2:
- /* Add new route to highest possible ancestor's list */
- if ((netmask == 0) || (b > t->rn_b ))
- return tt; /* can't lift at all */
- b_leaf = tt->rn_b;
- do {
- x = t;
- t = t->rn_p;
- } while (b <= t->rn_b && x != top);
- /*
- * Search through routes associated with node to
- * insert new route according to index.
- * Need same criteria as when sorting dupedkeys to avoid
- * double loop on deletion.
- */
- for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist) {
- if (m->rm_b < b_leaf)
- continue;
- if (m->rm_b > b_leaf)
- break;
- if (m->rm_flags & RNF_NORMAL) {
- mmask = m->rm_leaf->rn_mask;
- if (tt->rn_flags & RNF_NORMAL) {
- log(LOG_ERR,
- "Non-unique normal route, mask not entered");
- return tt;
- }
- } else
- mmask = m->rm_mask;
- if (mmask == netmask) {
- m->rm_refs++;
- tt->rn_mklist = m;
- return tt;
- }
- if (rn_refines(netmask, mmask) || rn_lexobetter(netmask, mmask))
- break;
- }
- *mp = rn_new_radix_mask(tt, *mp);
- return tt;
-}
-
-static struct radix_node *
-rn_delete(v_arg, netmask_arg, head)
- void *v_arg, *netmask_arg;
- struct radix_node_head *head;
-{
- register struct radix_node *t, *p, *x, *tt;
- struct radix_mask *m, *saved_m, **mp;
- struct radix_node *dupedkey, *saved_tt, *top;
- caddr_t v, netmask;
- int b, head_off, vlen;
-
- v = v_arg;
- netmask = netmask_arg;
- x = head->rnh_treetop;
- tt = rn_search(v, x);
- head_off = x->rn_off;
- vlen = *(u_char *)v;
- saved_tt = tt;
- top = x;
- if (tt == 0 ||
- Bcmp(v + head_off, tt->rn_key + head_off, vlen - head_off))
- return (0);
- /*
- * Delete our route from mask lists.
- */
- if (netmask) {
- if ((x = rn_addmask(netmask, 1, head_off)) == 0)
- return (0);
- netmask = x->rn_key;
- while (tt->rn_mask != netmask)
- if ((tt = tt->rn_dupedkey) == 0)
- return (0);
- }
- if (tt->rn_mask == 0 || (saved_m = m = tt->rn_mklist) == 0)
- goto on1;
- if (tt->rn_flags & RNF_NORMAL) {
- if (m->rm_leaf != tt || m->rm_refs > 0) {
- log(LOG_ERR, "rn_delete: inconsistent annotation\n");
- return 0; /* dangling ref could cause disaster */
- }
- } else {
- if (m->rm_mask != tt->rn_mask) {
- log(LOG_ERR, "rn_delete: inconsistent annotation\n");
- goto on1;
- }
- if (--m->rm_refs >= 0)
- goto on1;
- }
- b = -1 - tt->rn_b;
- t = saved_tt->rn_p;
- if (b > t->rn_b)
- goto on1; /* Wasn't lifted at all */
- do {
- x = t;
- t = t->rn_p;
- } while (b <= t->rn_b && x != top);
- for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist)
- if (m == saved_m) {
- *mp = m->rm_mklist;
- MKFree(m);
- break;
- }
- if (m == 0) {
- log(LOG_ERR, "rn_delete: couldn't find our annotation\n");
- if (tt->rn_flags & RNF_NORMAL)
- return (0); /* Dangling ref to us */
- }
-on1:
- /*
- * Eliminate us from tree
- */
- if (tt->rn_flags & RNF_ROOT)
- return (0);
-#ifdef RN_DEBUG
- /* Get us out of the creation list */
- for (t = rn_clist; t && t->rn_ybro != tt; t = t->rn_ybro) {}
- if (t) t->rn_ybro = tt->rn_ybro;
-#endif
- t = tt->rn_p;
- dupedkey = saved_tt->rn_dupedkey;
- if (dupedkey) {
- /*
- * at this point, tt is the deletion target and saved_tt
- * is the head of the dupekey chain
- */
- if (tt == saved_tt) {
- /* remove from head of chain */
- x = dupedkey; x->rn_p = t;
- if (t->rn_l == tt) t->rn_l = x; else t->rn_r = x;
- } else {
- /* find node in front of tt on the chain */
- for (x = p = saved_tt; p && p->rn_dupedkey != tt;)
- p = p->rn_dupedkey;
- if (p) {
- p->rn_dupedkey = tt->rn_dupedkey;
- if (tt->rn_dupedkey) /* parent */
- tt->rn_dupedkey->rn_p = p; /* parent */
- } else log(LOG_ERR, "rn_delete: couldn't find us\n");
- }
- t = tt + 1;
- if (t->rn_flags & RNF_ACTIVE) {
-#ifndef RN_DEBUG
- *++x = *t; p = t->rn_p;
-#else
- b = t->rn_info; *++x = *t; t->rn_info = b; p = t->rn_p;
-#endif
- if (p->rn_l == t) p->rn_l = x; else p->rn_r = x;
- x->rn_l->rn_p = x; x->rn_r->rn_p = x;
- }
- goto out;
- }
- if (t->rn_l == tt) x = t->rn_r; else x = t->rn_l;
- p = t->rn_p;
- if (p->rn_r == t) p->rn_r = x; else p->rn_l = x;
- x->rn_p = p;
- /*
- * Demote routes attached to us.
- */
- if (t->rn_mklist) {
- if (x->rn_b >= 0) {
- for (mp = &x->rn_mklist; (m = *mp);)
- mp = &m->rm_mklist;
- *mp = t->rn_mklist;
- } else {
- /* If there are any key,mask pairs in a sibling
- duped-key chain, some subset will appear sorted
- in the same order attached to our mklist */
- for (m = t->rn_mklist; m && x; x = x->rn_dupedkey)
- if (m == x->rn_mklist) {
- struct radix_mask *mm = m->rm_mklist;
- x->rn_mklist = 0;
- if (--(m->rm_refs) < 0)
- MKFree(m);
- m = mm;
- }
- if (m)
- log(LOG_ERR, "%s %p at %x\n",
- "rn_delete: Orphaned Mask", m, x);
- }
- }
- /*
- * We may be holding an active internal node in the tree.
- */
- x = tt + 1;
- if (t != x) {
-#ifndef RN_DEBUG
- *t = *x;
-#else
- b = t->rn_info; *t = *x; t->rn_info = b;
-#endif
- t->rn_l->rn_p = t; t->rn_r->rn_p = t;
- p = x->rn_p;
- if (p->rn_l == x) p->rn_l = t; else p->rn_r = t;
- }
-out:
- tt->rn_flags &= ~RNF_ACTIVE;
- tt[1].rn_flags &= ~RNF_ACTIVE;
- return (tt);
-}
-
-/*
- * This is the same as rn_walktree() except for the parameters and the
- * exit.
- */
-static int
-rn_walktree_from(h, a, m, f, w)
- struct radix_node_head *h;
- void *a, *m;
- walktree_f_t *f;
- void *w;
-{
- int error;
- struct radix_node *base, *next;
- u_char *xa = (u_char *)a;
- u_char *xm = (u_char *)m;
- register struct radix_node *rn, *last = 0 /* shut up gcc */;
- int stopping = 0;
- int lastb;
-
- /*
- * rn_search_m is sort-of-open-coded here.
- */
- /* printf("about to search\n"); */
- for (rn = h->rnh_treetop; rn->rn_b >= 0; ) {
- last = rn;
- /* printf("rn_b %d, rn_bmask %x, xm[rn_off] %x\n",
- rn->rn_b, rn->rn_bmask, xm[rn->rn_off]); */
- if (!(rn->rn_bmask & xm[rn->rn_off])) {
- break;
- }
- if (rn->rn_bmask & xa[rn->rn_off]) {
- rn = rn->rn_r;
- } else {
- rn = rn->rn_l;
- }
- }
- /* printf("done searching\n"); */
-
- /*
- * Two cases: either we stepped off the end of our mask,
- * in which case last == rn, or we reached a leaf, in which
- * case we want to start from the last node we looked at.
- * Either way, last is the node we want to start from.
- */
- rn = last;
- lastb = rn->rn_b;
-
- /* printf("rn %p, lastb %d\n", rn, lastb);*/
-
- /*
- * This gets complicated because we may delete the node
- * while applying the function f to it, so we need to calculate
- * the successor node in advance.
- */
- while (rn->rn_b >= 0)
- rn = rn->rn_l;
-
- while (!stopping) {
- /* printf("node %p (%d)\n", rn, rn->rn_b); */
- base = rn;
- /* If at right child go back up, otherwise, go right */
- while (rn->rn_p->rn_r == rn && !(rn->rn_flags & RNF_ROOT)) {
- rn = rn->rn_p;
-
- /* if went up beyond last, stop */
- if (rn->rn_b < lastb) {
- stopping = 1;
- /* printf("up too far\n"); */
- }
- }
-
- /* Find the next *leaf* since next node might vanish, too */
- for (rn = rn->rn_p->rn_r; rn->rn_b >= 0;)
- rn = rn->rn_l;
- next = rn;
- /* Process leaves */
- while ((rn = base) != 0) {
- base = rn->rn_dupedkey;
- /* printf("leaf %p\n", rn); */
- if (!(rn->rn_flags & RNF_ROOT)
- && (error = (*f)(rn, w)))
- return (error);
- }
- rn = next;
-
- if (rn->rn_flags & RNF_ROOT) {
- /* printf("root, stopping"); */
- stopping = 1;
- }
-
- }
- return 0;
-}
-
-static int
-rn_walktree(h, f, w)
- struct radix_node_head *h;
- walktree_f_t *f;
- void *w;
-{
- int error;
- struct radix_node *base, *next;
- register struct radix_node *rn = h->rnh_treetop;
- /*
- * This gets complicated because we may delete the node
- * while applying the function f to it, so we need to calculate
- * the successor node in advance.
- */
- /* First time through node, go left */
- while (rn->rn_b >= 0)
- rn = rn->rn_l;
- for (;;) {
- base = rn;
- /* If at right child go back up, otherwise, go right */
- while (rn->rn_p->rn_r == rn && (rn->rn_flags & RNF_ROOT) == 0)
- rn = rn->rn_p;
- /* Find the next *leaf* since next node might vanish, too */
- for (rn = rn->rn_p->rn_r; rn->rn_b >= 0;)
- rn = rn->rn_l;
- next = rn;
- /* Process leaves */
- while ((rn = base)) {
- base = rn->rn_dupedkey;
- if (!(rn->rn_flags & RNF_ROOT) && (error = (*f)(rn, w)))
- return (error);
- }
- rn = next;
- if (rn->rn_flags & RNF_ROOT)
- return (0);
- }
- /* NOTREACHED */
-}
-
-int
-rn_inithead(head, off)
- void **head;
- int off;
-{
- register struct radix_node_head *rnh;
- register struct radix_node *t, *tt, *ttt;
- if (*head)
- return (1);
- R_Malloc(rnh, struct radix_node_head *, sizeof (*rnh));
- if (rnh == 0)
- return (0);
- Bzero(rnh, sizeof (*rnh));
- *head = rnh;
- t = rn_newpair(rn_zeros, off, rnh->rnh_nodes);
- ttt = rnh->rnh_nodes + 2;
- t->rn_r = ttt;
- t->rn_p = t;
- tt = t->rn_l;
- tt->rn_flags = t->rn_flags = RNF_ROOT | RNF_ACTIVE;
- tt->rn_b = -1 - off;
- *ttt = *tt;
- ttt->rn_key = rn_ones;
- rnh->rnh_addaddr = rn_addroute;
- rnh->rnh_deladdr = rn_delete;
- rnh->rnh_matchaddr = rn_match;
- rnh->rnh_lookup = rn_lookup;
- rnh->rnh_walktree = rn_walktree;
- rnh->rnh_walktree_from = rn_walktree_from;
- rnh->rnh_treetop = t;
- return (1);
-}
-
-void
-rn_init()
-{
- char *cp, *cplim;
-#ifdef KERNEL
- struct domain *dom;
-
- for (dom = domains; dom; dom = dom->dom_next)
- if (dom->dom_maxrtkey > max_keylen)
- max_keylen = dom->dom_maxrtkey;
-#endif
- if (max_keylen == 0) {
- log(LOG_ERR,
- "rn_init: radix functions require max_keylen be set\n");
- return;
- }
- R_Malloc(rn_zeros, char *, 3 * max_keylen);
- if (rn_zeros == NULL)
- panic("rn_init");
- Bzero(rn_zeros, 3 * max_keylen);
- rn_ones = cp = rn_zeros + max_keylen;
- addmask_key = cplim = rn_ones + max_keylen;
- while (cp < cplim)
- *cp++ = -1;
- if (rn_inithead((void **)&mask_rnhead, 0) == 0)
- panic("rn_init 2");
-}
diff --git a/c/src/exec/libnetworking/net/radix.h b/c/src/exec/libnetworking/net/radix.h
deleted file mode 100644
index 6ef9aafbac..0000000000
--- a/c/src/exec/libnetworking/net/radix.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 1988, 1989, 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.
- *
- * @(#)radix.h 8.2 (Berkeley) 10/31/94
- * $Id$
- */
-
-#ifndef _RADIX_H_
-#define _RADIX_H_
-
-/*
- * Radix search tree node layout.
- */
-
-struct radix_node {
- struct radix_mask *rn_mklist; /* list of masks contained in subtree */
- struct radix_node *rn_p; /* parent */
- short rn_b; /* bit offset; -1-index(netmask) */
- char rn_bmask; /* node: mask for bit test*/
- u_char rn_flags; /* enumerated next */
-#define RNF_NORMAL 1 /* leaf contains normal route */
-#define RNF_ROOT 2 /* leaf is root leaf for tree */
-#define RNF_ACTIVE 4 /* This node is alive (for rtfree) */
- union {
- struct { /* leaf only data: */
- caddr_t rn_Key; /* object of search */
- caddr_t rn_Mask; /* netmask, if present */
- struct radix_node *rn_Dupedkey;
- } rn_leaf;
- struct { /* node only data: */
- int rn_Off; /* where to start compare */
- struct radix_node *rn_L;/* progeny */
- struct radix_node *rn_R;/* progeny */
- } rn_node;
- } rn_u;
-#ifdef RN_DEBUG
- int rn_info;
- struct radix_node *rn_twin;
- struct radix_node *rn_ybro;
-#endif
-};
-
-#define rn_dupedkey rn_u.rn_leaf.rn_Dupedkey
-#define rn_key rn_u.rn_leaf.rn_Key
-#define rn_mask rn_u.rn_leaf.rn_Mask
-#define rn_off rn_u.rn_node.rn_Off
-#define rn_l rn_u.rn_node.rn_L
-#define rn_r rn_u.rn_node.rn_R
-
-/*
- * Annotations to tree concerning potential routes applying to subtrees.
- */
-
-extern struct radix_mask {
- short rm_b; /* bit offset; -1-index(netmask) */
- char rm_unused; /* cf. rn_bmask */
- u_char rm_flags; /* cf. rn_flags */
- struct radix_mask *rm_mklist; /* more masks to try */
- union {
- caddr_t rmu_mask; /* the mask */
- struct radix_node *rmu_leaf; /* for normal routes */
- } rm_rmu;
- int rm_refs; /* # of references to this struct */
-} *rn_mkfreelist;
-
-#define rm_mask rm_rmu.rmu_mask
-#define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */
-
-#define MKGet(m) {\
- if (rn_mkfreelist) {\
- m = rn_mkfreelist; \
- rn_mkfreelist = (m)->rm_mklist; \
- } else \
- R_Malloc(m, struct radix_mask *, sizeof (*(m))); }\
-
-#define MKFree(m) { (m)->rm_mklist = rn_mkfreelist; rn_mkfreelist = (m);}
-
-typedef int walktree_f_t __P((struct radix_node *, void *));
-
-struct radix_node_head {
- struct radix_node *rnh_treetop;
- int rnh_addrsize; /* permit, but not require fixed keys */
- int rnh_pktsize; /* permit, but not require fixed keys */
- struct radix_node *(*rnh_addaddr) /* add based on sockaddr */
- __P((void *v, void *mask,
- struct radix_node_head *head, struct radix_node nodes[]));
- struct radix_node *(*rnh_addpkt) /* add based on packet hdr */
- __P((void *v, void *mask,
- struct radix_node_head *head, struct radix_node nodes[]));
- struct radix_node *(*rnh_deladdr) /* remove based on sockaddr */
- __P((void *v, void *mask, struct radix_node_head *head));
- struct radix_node *(*rnh_delpkt) /* remove based on packet hdr */
- __P((void *v, void *mask, struct radix_node_head *head));
- struct radix_node *(*rnh_matchaddr) /* locate based on sockaddr */
- __P((void *v, struct radix_node_head *head));
- struct radix_node *(*rnh_lookup) /* locate based on sockaddr */
- __P((void *v, void *mask, struct radix_node_head *head));
- struct radix_node *(*rnh_matchpkt) /* locate based on packet hdr */
- __P((void *v, struct radix_node_head *head));
- int (*rnh_walktree) /* traverse tree */
- __P((struct radix_node_head *head, walktree_f_t *f, void *w));
- int (*rnh_walktree_from) /* traverse tree below a */
- __P((struct radix_node_head *head, void *a, void *m,
- walktree_f_t *f, void *w));
- void (*rnh_close) /* do something when the last ref drops */
- __P((struct radix_node *rn, struct radix_node_head *head));
- struct radix_node rnh_nodes[3]; /* empty tree for common case */
-};
-
-#ifndef KERNEL
-#define Bcmp(a, b, n) bcmp(((char *)(a)), ((char *)(b)), (n))
-#define Bcopy(a, b, n) bcopy(((char *)(a)), ((char *)(b)), (unsigned)(n))
-#define Bzero(p, n) bzero((char *)(p), (int)(n));
-#define R_Malloc(p, t, n) (p = (t) malloc((unsigned int)(n)))
-#define Free(p) free((char *)p);
-#else
-#define Bcmp(a, b, n) bcmp(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n))
-#define Bcopy(a, b, n) bcopy(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n))
-#define Bzero(p, n) bzero((caddr_t)(p), (unsigned)(n));
-#define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_DONTWAIT))
-#define Free(p) free((caddr_t)p, M_RTABLE);
-#endif /*KERNEL*/
-
-extern struct radix_node_head *mask_rnhead;
-
-void rn_init __P((void));
-int rn_inithead __P((void **, int));
-int rn_refines __P((void *, void *));
-struct radix_node
- *rn_addmask __P((void *, int, int)),
- *rn_addroute __P((void *, void *, struct radix_node_head *,
- struct radix_node [2])),
- *rn_match __P((void *, struct radix_node_head *));
-
-
-#endif /* _RADIX_H_ */
diff --git a/c/src/exec/libnetworking/net/raw_cb.c b/c/src/exec/libnetworking/net/raw_cb.c
deleted file mode 100644
index 0676931cdc..0000000000
--- a/c/src/exec/libnetworking/net/raw_cb.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)raw_cb.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/raw_cb.h>
-#include <netinet/in.h>
-
-/*
- * Routines to manage the raw protocol control blocks.
- *
- * TODO:
- * hash lookups by protocol family/protocol + address family
- * take care of unique address problems per AF?
- * redo address binding to allow wildcards
- */
-
-struct rawcb rawcb;
-static u_long raw_sendspace = RAWSNDQ;
-static u_long raw_recvspace = RAWRCVQ;
-
-/*
- * Allocate a control block and a nominal amount
- * of buffer space for the socket.
- */
-int
-raw_attach(so, proto)
- register struct socket *so;
- int proto;
-{
- register struct rawcb *rp = sotorawcb(so);
- int error;
-
- /*
- * It is assumed that raw_attach is called
- * after space has been allocated for the
- * rawcb.
- */
- if (rp == 0)
- return (ENOBUFS);
- error = soreserve(so, raw_sendspace, raw_recvspace);
- if (error)
- return (error);
- rp->rcb_socket = so;
- rp->rcb_proto.sp_family = so->so_proto->pr_domain->dom_family;
- rp->rcb_proto.sp_protocol = proto;
- insque(rp, &rawcb);
- return (0);
-}
-
-/*
- * Detach the raw connection block and discard
- * socket resources.
- */
-void
-raw_detach(rp)
- register struct rawcb *rp;
-{
- struct socket *so = rp->rcb_socket;
-
- so->so_pcb = 0;
- sofree(so);
- remque(rp);
-#ifdef notdef
- if (rp->rcb_laddr)
- m_freem(dtom(rp->rcb_laddr));
- rp->rcb_laddr = 0;
-#endif
- free((caddr_t)(rp), M_PCB);
-}
-
-/*
- * Disconnect and possibly release resources.
- */
-void
-raw_disconnect(rp)
- struct rawcb *rp;
-{
-
-#ifdef notdef
- if (rp->rcb_faddr)
- m_freem(dtom(rp->rcb_faddr));
- rp->rcb_faddr = 0;
-#endif
- if (rp->rcb_socket->so_state & SS_NOFDREF)
- raw_detach(rp);
-}
-
-#ifdef notdef
-int
-raw_bind(so, nam)
- register struct socket *so;
- struct mbuf *nam;
-{
- struct sockaddr *addr = mtod(nam, struct sockaddr *);
- register struct rawcb *rp;
-
- if (ifnet == 0)
- return (EADDRNOTAVAIL);
- rp = sotorawcb(so);
- nam = m_copym(nam, 0, M_COPYALL, M_WAITOK);
- rp->rcb_laddr = mtod(nam, struct sockaddr *);
- return (0);
-}
-#endif
diff --git a/c/src/exec/libnetworking/net/raw_cb.h b/c/src/exec/libnetworking/net/raw_cb.h
deleted file mode 100644
index c1ed5e5e0a..0000000000
--- a/c/src/exec/libnetworking/net/raw_cb.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)raw_cb.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_RAW_CB_H_
-#define _NET_RAW_CB_H_
-
-/*
- * Raw protocol interface control block. Used
- * to tie a socket to the generic raw interface.
- */
-struct rawcb {
- struct rawcb *rcb_next; /* doubly linked list */
- struct rawcb *rcb_prev;
- struct socket *rcb_socket; /* back pointer to socket */
- struct sockaddr *rcb_faddr; /* destination address */
- struct sockaddr *rcb_laddr; /* socket's address */
- struct sockproto rcb_proto; /* protocol family, protocol */
-};
-
-#define sotorawcb(so) ((struct rawcb *)(so)->so_pcb)
-
-/*
- * Nominal space allocated to a raw socket.
- */
-#define RAWSNDQ 8192
-#define RAWRCVQ 8192
-
-#ifdef KERNEL
-extern struct rawcb rawcb; /* head of list */
-
-int raw_attach __P((struct socket *, int));
-void raw_ctlinput __P((int, struct sockaddr *, void *));
-void raw_detach __P((struct rawcb *));
-void raw_disconnect __P((struct rawcb *));
-void raw_init __P((void));
-void raw_input __P((struct mbuf *,
- struct sockproto *, struct sockaddr *, struct sockaddr *));
-int raw_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/net/raw_usrreq.c b/c/src/exec/libnetworking/net/raw_usrreq.c
deleted file mode 100644
index fb4faf4d6d..0000000000
--- a/c/src/exec/libnetworking/net/raw_usrreq.c
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)raw_usrreq.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/netisr.h>
-#include <net/raw_cb.h>
-
-/*
- * Initialize raw connection block q.
- */
-void
-raw_init()
-{
-
- rawcb.rcb_next = rawcb.rcb_prev = &rawcb;
-}
-
-
-/*
- * Raw protocol input routine. Find the socket
- * associated with the packet(s) and move them over. If
- * nothing exists for this packet, drop it.
- */
-/*
- * Raw protocol interface.
- */
-void
-raw_input(m0, proto, src, dst)
- struct mbuf *m0;
- register struct sockproto *proto;
- struct sockaddr *src, *dst;
-{
- register struct rawcb *rp;
- register struct mbuf *m = m0;
- register int sockets = 0;
- struct socket *last;
-
- last = 0;
- for (rp = rawcb.rcb_next; rp != &rawcb; rp = rp->rcb_next) {
- if (rp->rcb_proto.sp_family != proto->sp_family)
- continue;
- if (rp->rcb_proto.sp_protocol &&
- rp->rcb_proto.sp_protocol != proto->sp_protocol)
- continue;
- /*
- * We assume the lower level routines have
- * placed the address in a canonical format
- * suitable for a structure comparison.
- *
- * Note that if the lengths are not the same
- * the comparison will fail at the first byte.
- */
-#define equal(a1, a2) \
- (bcmp((caddr_t)(a1), (caddr_t)(a2), a1->sa_len) == 0)
- if (rp->rcb_laddr && !equal(rp->rcb_laddr, dst))
- continue;
- if (rp->rcb_faddr && !equal(rp->rcb_faddr, src))
- continue;
- if (last) {
- struct mbuf *n;
- n = m_copy(m, 0, (int)M_COPYALL);
- if (n) {
- if (sbappendaddr(&last->so_rcv, src,
- n, (struct mbuf *)0) == 0)
- /* should notify about lost packet */
- m_freem(n);
- else {
- sorwakeup(last);
- sockets++;
- }
- }
- }
- last = rp->rcb_socket;
- }
- if (last) {
- if (sbappendaddr(&last->so_rcv, src,
- m, (struct mbuf *)0) == 0)
- m_freem(m);
- else {
- sorwakeup(last);
- sockets++;
- }
- } else
- m_freem(m);
-}
-
-/*ARGSUSED*/
-void
-raw_ctlinput(cmd, arg, dummy)
- int cmd;
- struct sockaddr *arg;
- void *dummy;
-{
-
- if (cmd < 0 || cmd > PRC_NCMDS)
- return;
- /* INCOMPLETE */
-}
-
-/*ARGSUSED*/
-int
-raw_usrreq(so, req, m, nam, control)
- struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register struct rawcb *rp = sotorawcb(so);
- register int error = 0;
- int len;
-
- if (req == PRU_CONTROL)
- return (EOPNOTSUPP);
- if (control && control->m_len) {
- error = EOPNOTSUPP;
- goto release;
- }
- if (rp == 0) {
- error = EINVAL;
- goto release;
- }
- switch (req) {
-
- /*
- * Allocate a raw control block and fill in the
- * necessary info to allow packets to be routed to
- * the appropriate raw interface routine.
- */
- case PRU_ATTACH:
- if ((so->so_state & SS_PRIV) == 0) {
- error = EACCES;
- break;
- }
- error = raw_attach(so, (int)nam);
- break;
-
- /*
- * Destroy state just before socket deallocation.
- * Flush data or not depending on the options.
- */
- case PRU_DETACH:
- if (rp == 0) {
- error = ENOTCONN;
- break;
- }
- raw_detach(rp);
- break;
-
- /*
- * If a socket isn't bound to a single address,
- * the raw input routine will hand it anything
- * within that protocol family (assuming there's
- * nothing else around it should go to).
- */
- case PRU_CONNECT:
- error = EINVAL;
-#if 0
- if (rp->rcb_faddr) {
- error = EISCONN;
- break;
- }
- nam = m_copym(nam, 0, M_COPYALL, M_WAIT);
- rp->rcb_faddr = mtod(nam, struct sockaddr *);
- soisconnected(so);
-#endif
- break;
-
- case PRU_BIND:
- error = EINVAL;
-#if 0
- if (rp->rcb_laddr) {
- error = EINVAL; /* XXX */
- break;
- }
- error = raw_bind(so, nam);
-#endif
- break;
-
- case PRU_CONNECT2:
- error = EOPNOTSUPP;
- goto release;
-
- case PRU_DISCONNECT:
- if (rp->rcb_faddr == 0) {
- error = ENOTCONN;
- break;
- }
- raw_disconnect(rp);
- soisdisconnected(so);
- break;
-
- /*
- * Mark the connection as being incapable of further input.
- */
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- /*
- * Ship a packet out. The appropriate raw output
- * routine handles any massaging necessary.
- */
- case PRU_SEND:
- if (nam) {
- if (rp->rcb_faddr) {
- error = EISCONN;
- break;
- }
- rp->rcb_faddr = mtod(nam, struct sockaddr *);
- } else if (rp->rcb_faddr == 0) {
- error = ENOTCONN;
- break;
- }
- error = (*so->so_proto->pr_output)(m, so);
- m = NULL;
- if (nam)
- rp->rcb_faddr = 0;
- break;
-
- case PRU_ABORT:
- raw_disconnect(rp);
- sofree(so);
- soisdisconnected(so);
- break;
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- /*
- * Not supported.
- */
- case PRU_RCVOOB:
- case PRU_RCVD:
- return(EOPNOTSUPP);
-
- case PRU_LISTEN:
- case PRU_ACCEPT:
- case PRU_SENDOOB:
- error = EOPNOTSUPP;
- break;
-
- case PRU_SOCKADDR:
- if (rp->rcb_laddr == 0) {
- error = EINVAL;
- break;
- }
- len = rp->rcb_laddr->sa_len;
- bcopy((caddr_t)rp->rcb_laddr, mtod(nam, caddr_t), (unsigned)len);
- nam->m_len = len;
- break;
-
- case PRU_PEERADDR:
- if (rp->rcb_faddr == 0) {
- error = ENOTCONN;
- break;
- }
- len = rp->rcb_faddr->sa_len;
- bcopy((caddr_t)rp->rcb_faddr, mtod(nam, caddr_t), (unsigned)len);
- nam->m_len = len;
- break;
-
- default:
- panic("raw_usrreq");
- }
-release:
- if (m != NULL)
- m_freem(m);
- return (error);
-}
diff --git a/c/src/exec/libnetworking/net/route.c b/c/src/exec/libnetworking/net/route.c
deleted file mode 100644
index 683ddafee9..0000000000
--- a/c/src/exec/libnetworking/net/route.c
+++ /dev/null
@@ -1,959 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 1991, 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.
- *
- * @(#)route.c 8.2 (Berkeley) 11/15/93
- * $Id$
- */
-
-#include "opt_mrouting.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/ioctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/raw_cb.h>
-
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_mroute.h>
-
-#define SA(p) ((struct sockaddr *)(p))
-
-struct route_cb route_cb;
-static struct rtstat rtstat;
-struct radix_node_head *rt_tables[AF_MAX+1];
-
-static int rttrash; /* routes not in table but not freed */
-
-static void rt_maskedcopy __P((struct sockaddr *,
- struct sockaddr *, struct sockaddr *));
-static void rtable_init __P((void **));
-
-static void
-rtable_init(table)
- void **table;
-{
- struct domain *dom;
- for (dom = domains; dom; dom = dom->dom_next)
- if (dom->dom_rtattach)
- dom->dom_rtattach(&table[dom->dom_family],
- dom->dom_rtoffset);
-}
-
-void
-route_init()
-{
- rn_init(); /* initialize all zeroes, all ones, mask table */
- rtable_init((void **)rt_tables);
-}
-
-/*
- * Packet routing routines.
- */
-void
-rtalloc(ro)
- register struct route *ro;
-{
- if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP))
- return; /* XXX */
- ro->ro_rt = rtalloc1(&ro->ro_dst, 1, 0UL);
-}
-
-void
-rtalloc_ign(ro, ignore)
- register struct route *ro;
- u_long ignore;
-{
- if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP))
- return; /* XXX */
- ro->ro_rt = rtalloc1(&ro->ro_dst, 1, ignore);
-}
-
-/*
- * Look up the route that matches the address given
- * Or, at least try.. Create a cloned route if needed.
- */
-struct rtentry *
-rtalloc1(dst, report, ignflags)
- register struct sockaddr *dst;
- int report;
- u_long ignflags;
-{
- register struct radix_node_head *rnh = rt_tables[dst->sa_family];
- register struct rtentry *rt;
- register struct radix_node *rn;
- struct rtentry *newrt = 0;
- struct rt_addrinfo info;
- u_long nflags;
- int s = splnet(), err = 0, msgtype = RTM_MISS;
-
- /*
- * Look up the address in the table for that Address Family
- */
- if (rnh && (rn = rnh->rnh_matchaddr((caddr_t)dst, rnh)) &&
- ((rn->rn_flags & RNF_ROOT) == 0)) {
- /*
- * If we find it and it's not the root node, then
- * get a refernce on the rtentry associated.
- */
- newrt = rt = (struct rtentry *)rn;
- nflags = rt->rt_flags & ~ignflags;
- if (report && (nflags & (RTF_CLONING | RTF_PRCLONING))) {
- /*
- * We are apparently adding (report = 0 in delete).
- * If it requires that it be cloned, do so.
- * (This implies it wasn't a HOST route.)
- */
- err = rtrequest(RTM_RESOLVE, dst, SA(0),
- SA(0), 0, &newrt);
- if (err) {
- /*
- * If the cloning didn't succeed, maybe
- * what we have will do. Return that.
- */
- newrt = rt;
- rt->rt_refcnt++;
- goto miss;
- }
- if ((rt = newrt) && (rt->rt_flags & RTF_XRESOLVE)) {
- /*
- * If the new route specifies it be
- * externally resolved, then go do that.
- */
- msgtype = RTM_RESOLVE;
- goto miss;
- }
- } else
- rt->rt_refcnt++;
- } else {
- /*
- * Either we hit the root or couldn't find any match,
- * Which basically means
- * "caint get there frm here"
- */
- rtstat.rts_unreach++;
- miss: if (report) {
- /*
- * If required, report the failure to the supervising
- * Authorities.
- * For a delete, this is not an error. (report == 0)
- */
- bzero((caddr_t)&info, sizeof(info));
- info.rti_info[RTAX_DST] = dst;
- rt_missmsg(msgtype, &info, 0, err);
- }
- }
- splx(s);
- return (newrt);
-}
-
-void
-rtfree(rt)
- register struct rtentry *rt;
-{
- register struct radix_node_head *rnh =
- rt_tables[rt_key(rt)->sa_family];
- register struct ifaddr *ifa;
-
- if (rt == 0 || rnh == 0)
- panic("rtfree");
- rt->rt_refcnt--;
- if(rnh->rnh_close && rt->rt_refcnt == 0) {
- rnh->rnh_close((struct radix_node *)rt, rnh);
- }
- if (rt->rt_refcnt <= 0 && (rt->rt_flags & RTF_UP) == 0) {
- if (rt->rt_nodes->rn_flags & (RNF_ACTIVE | RNF_ROOT))
- panic ("rtfree 2");
- rttrash--;
- if (rt->rt_refcnt < 0) {
- printf("rtfree: %p not freed (neg refs)\n", rt);
- return;
- }
- ifa = rt->rt_ifa;
- IFAFREE(ifa);
- if (rt->rt_parent) {
- RTFREE(rt->rt_parent);
- }
- Free(rt_key(rt));
- Free(rt);
- }
-}
-
-void
-ifafree(ifa)
- register struct ifaddr *ifa;
-{
- if (ifa == NULL)
- panic("ifafree");
- if (ifa->ifa_refcnt == 0)
- free(ifa, M_IFADDR);
- else
- ifa->ifa_refcnt--;
-}
-
-/*
- * Force a routing table entry to the specified
- * destination to go through the given gateway.
- * Normally called as a result of a routing redirect
- * message from the network layer.
- *
- * N.B.: must be called at splnet
- *
- */
-void
-rtredirect(dst, gateway, netmask, flags, src, rtp)
- struct sockaddr *dst, *gateway, *netmask, *src;
- int flags;
- struct rtentry **rtp;
-{
- register struct rtentry *rt;
- int error = 0;
- short *stat = 0;
- struct rt_addrinfo info;
- struct ifaddr *ifa;
-
- /* verify the gateway is directly reachable */
- if ((ifa = ifa_ifwithnet(gateway)) == 0) {
- error = ENETUNREACH;
- goto out;
- }
- rt = rtalloc1(dst, 0, 0UL);
- /*
- * If the redirect isn't from our current router for this dst,
- * it's either old or wrong. If it redirects us to ourselves,
- * we have a routing loop, perhaps as a result of an interface
- * going down recently.
- */
-#define equal(a1, a2) (bcmp((caddr_t)(a1), (caddr_t)(a2), (a1)->sa_len) == 0)
- if (!(flags & RTF_DONE) && rt &&
- (!equal(src, rt->rt_gateway) || rt->rt_ifa != ifa))
- error = EINVAL;
- else if (ifa_ifwithaddr(gateway))
- error = EHOSTUNREACH;
- if (error)
- goto done;
- /*
- * Create a new entry if we just got back a wildcard entry
- * or the the lookup failed. This is necessary for hosts
- * which use routing redirects generated by smart gateways
- * to dynamically build the routing tables.
- */
- if ((rt == 0) || (rt_mask(rt) && rt_mask(rt)->sa_len < 2))
- goto create;
- /*
- * Don't listen to the redirect if it's
- * for a route to an interface.
- */
- if (rt->rt_flags & RTF_GATEWAY) {
- if (((rt->rt_flags & RTF_HOST) == 0) && (flags & RTF_HOST)) {
- /*
- * Changing from route to net => route to host.
- * Create new route, rather than smashing route to net.
- */
- create:
- flags |= RTF_GATEWAY | RTF_DYNAMIC;
- error = rtrequest((int)RTM_ADD, dst, gateway,
- netmask, flags,
- (struct rtentry **)0);
- stat = &rtstat.rts_dynamic;
- } else {
- /*
- * Smash the current notion of the gateway to
- * this destination. Should check about netmask!!!
- */
- rt->rt_flags |= RTF_MODIFIED;
- flags |= RTF_MODIFIED;
- stat = &rtstat.rts_newgateway;
- rt_setgate(rt, rt_key(rt), gateway);
- }
- } else
- error = EHOSTUNREACH;
-done:
- if (rt) {
- if (rtp && !error)
- *rtp = rt;
- else
- rtfree(rt);
- }
-out:
- if (error)
- rtstat.rts_badredirect++;
- else if (stat != NULL)
- (*stat)++;
- bzero((caddr_t)&info, sizeof(info));
- info.rti_info[RTAX_DST] = dst;
- info.rti_info[RTAX_GATEWAY] = gateway;
- info.rti_info[RTAX_NETMASK] = netmask;
- info.rti_info[RTAX_AUTHOR] = src;
- rt_missmsg(RTM_REDIRECT, &info, flags, error);
-}
-
-/*
-* Routing table ioctl interface.
-*/
-int
-rtioctl(req, data, p)
- int req;
- caddr_t data;
- struct proc *p;
-{
-#ifdef INET
- /* Multicast goop, grrr... */
-#ifdef MROUTING
- return mrt_ioctl(req, data);
-#else
- return mrt_ioctl(req, data, p);
-#endif
-#else /* INET */
- return ENXIO;
-#endif /* INET */
-}
-
-struct ifaddr *
-ifa_ifwithroute(flags, dst, gateway)
- int flags;
- struct sockaddr *dst, *gateway;
-{
- register struct ifaddr *ifa;
- if ((flags & RTF_GATEWAY) == 0) {
- /*
- * If we are adding a route to an interface,
- * and the interface is a pt to pt link
- * we should search for the destination
- * as our clue to the interface. Otherwise
- * we can use the local address.
- */
- ifa = 0;
- if (flags & RTF_HOST) {
- ifa = ifa_ifwithdstaddr(dst);
- }
- if (ifa == 0)
- ifa = ifa_ifwithaddr(gateway);
- } else {
- /*
- * If we are adding a route to a remote net
- * or host, the gateway may still be on the
- * other end of a pt to pt link.
- */
- ifa = ifa_ifwithdstaddr(gateway);
- }
- if (ifa == 0)
- ifa = ifa_ifwithnet(gateway);
- if (ifa == 0) {
- struct rtentry *rt = rtalloc1(dst, 0, 0UL);
- if (rt == 0)
- return (0);
- rt->rt_refcnt--;
- if ((ifa = rt->rt_ifa) == 0)
- return (0);
- }
- if (ifa->ifa_addr->sa_family != dst->sa_family) {
- struct ifaddr *oifa = ifa;
- ifa = ifaof_ifpforaddr(dst, ifa->ifa_ifp);
- if (ifa == 0)
- ifa = oifa;
- }
- return (ifa);
-}
-
-#define ROUNDUP(a) (a>0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
-
-static int rt_fixdelete(struct radix_node *, void *);
-static int rt_fixchange(struct radix_node *, void *);
-
-struct rtfc_arg {
- struct rtentry *rt0;
- struct radix_node_head *rnh;
-};
-
-/*
- * Do appropriate manipulations of a routing tree given
- * all the bits of info needed
- */
-int
-rtrequest(req, dst, gateway, netmask, flags, ret_nrt)
- int req, flags;
- struct sockaddr *dst, *gateway, *netmask;
- struct rtentry **ret_nrt;
-{
- int s = splnet(); int error = 0;
- register struct rtentry *rt;
- register struct radix_node *rn;
- register struct radix_node_head *rnh;
- struct ifaddr *ifa;
- struct sockaddr *ndst;
-#define senderr(x) { error = x ; goto bad; }
-
- /*
- * Find the correct routing tree to use for this Address Family
- */
- if ((rnh = rt_tables[dst->sa_family]) == 0)
- senderr(ESRCH);
- /*
- * If we are adding a host route then we don't want to put
- * a netmask in the tree
- */
- if (flags & RTF_HOST)
- netmask = 0;
- switch (req) {
- case RTM_DELETE:
- /*
- * Remove the item from the tree and return it.
- * Complain if it is not there and do no more processing.
- */
- if ((rn = rnh->rnh_deladdr(dst, netmask, rnh)) == 0)
- senderr(ESRCH);
- if (rn->rn_flags & (RNF_ACTIVE | RNF_ROOT))
- panic ("rtrequest delete");
- rt = (struct rtentry *)rn;
-
- /*
- * Now search what's left of the subtree for any cloned
- * routes which might have been formed from this node.
- */
- if ((rt->rt_flags & RTF_PRCLONING) && netmask) {
- rnh->rnh_walktree_from(rnh, dst, netmask,
- rt_fixdelete, rt);
- }
-
- /*
- * Remove any external references we may have.
- * This might result in another rtentry being freed if
- * we held it's last reference.
- */
- if (rt->rt_gwroute) {
- rt = rt->rt_gwroute;
- RTFREE(rt);
- (rt = (struct rtentry *)rn)->rt_gwroute = 0;
- }
-
- /*
- * NB: RTF_UP must be set during the search above,
- * because we might delete the last ref, causing
- * rt to get freed prematurely.
- */
- rt->rt_flags &= ~RTF_UP;
-
- /*
- * If there is llinfo or similar associated with the
- * route, give the interface a chance to deal with it..
- */
- if ((ifa = rt->rt_ifa) && ifa->ifa_rtrequest)
- ifa->ifa_rtrequest(RTM_DELETE, rt, SA(0));
- rttrash++;
- /*
- * If the caller wants it, then it can have it, but it's up to it
- * to free the rtentry as we won't be doing it.
- */
- if (ret_nrt)
- *ret_nrt = rt;
- else if (rt->rt_refcnt <= 0) {
- rt->rt_refcnt++; /* make a 1->0 transition */
- rtfree(rt);
- }
- break;
-
- case RTM_RESOLVE:
- if (ret_nrt == 0 || (rt = *ret_nrt) == 0)
- senderr(EINVAL);
- ifa = rt->rt_ifa;
- flags = rt->rt_flags &
- ~(RTF_CLONING | RTF_PRCLONING | RTF_STATIC);
- flags |= RTF_WASCLONED;
- gateway = rt->rt_gateway;
- if ((netmask = rt->rt_genmask) == 0)
- flags |= RTF_HOST;
- goto makeroute;
-
- case RTM_ADD:
- if ((flags & RTF_GATEWAY) && !gateway)
- panic("rtrequest: GATEWAY but no gateway");
-
- if ((ifa = ifa_ifwithroute(flags, dst, gateway)) == 0)
- senderr(ENETUNREACH);
-
- makeroute:
- R_Malloc(rt, struct rtentry *, sizeof(*rt));
- if (rt == 0)
- senderr(ENOBUFS);
- Bzero(rt, sizeof(*rt));
- rt->rt_flags = RTF_UP | flags;
- if ((error = rt_setgate(rt, dst, gateway))) {
- Free(rt);
- senderr(error);
- }
- ndst = rt_key(rt);
- if (netmask) {
- rt_maskedcopy(dst, ndst, netmask);
- } else
- Bcopy(dst, ndst, dst->sa_len);
-
- /*
- * This moved from below so that rnh->rnh_addaddr() can
- * examine the ifa and ifp if it so desires.
- */
- ifa->ifa_refcnt++;
- rt->rt_ifa = ifa;
- rt->rt_ifp = ifa->ifa_ifp;
-
- rn = rnh->rnh_addaddr((caddr_t)ndst, (caddr_t)netmask,
- rnh, rt->rt_nodes);
- if (rn == 0) {
- struct rtentry *rt2;
- /*
- * Uh-oh, we already have one of these in the tree.
- * We do a special hack: if the route that's already
- * there was generated by the protocol-cloning
- * mechanism, then we just blow it away and retry
- * the insertion of the new one.
- */
- rt2 = rtalloc1(dst, 0, RTF_PRCLONING);
- if (rt2 && rt2->rt_parent) {
- rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt2),
- rt2->rt_gateway,
- rt_mask(rt2), rt2->rt_flags, 0);
- RTFREE(rt2);
- rn = rnh->rnh_addaddr((caddr_t)ndst,
- (caddr_t)netmask,
- rnh, rt->rt_nodes);
- } else if (rt2) {
- RTFREE(rt2);
- }
- }
-
- if (rn == 0) {
- if (rt->rt_gwroute)
- rtfree(rt->rt_gwroute);
- if (rt->rt_ifa) {
- IFAFREE(rt->rt_ifa);
- }
- Free(rt_key(rt));
- Free(rt);
- senderr(EEXIST);
- }
- rt->rt_parent = 0;
-
- if (req == RTM_RESOLVE) {
- rt->rt_rmx = (*ret_nrt)->rt_rmx; /* copy metrics */
- if ((*ret_nrt)->rt_flags & RTF_PRCLONING) {
- rt->rt_parent = (*ret_nrt);
- (*ret_nrt)->rt_refcnt++;
- }
- }
- if (ifa->ifa_rtrequest)
- ifa->ifa_rtrequest(req, rt, SA(ret_nrt ? *ret_nrt : 0));
- /*
- * We repeat the same procedure from rt_setgate() here because
- * it doesn't fire when we call it there because the node
- * hasn't been added to the tree yet.
- */
- if (!(rt->rt_flags & RTF_HOST) && rt_mask(rt) != 0) {
- struct rtfc_arg arg;
- arg.rnh = rnh;
- arg.rt0 = rt;
- rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt),
- rt_fixchange, &arg);
- }
-
- if (ret_nrt) {
- *ret_nrt = rt;
- rt->rt_refcnt++;
- }
- break;
- }
-bad:
- splx(s);
- return (error);
-}
-
-/*
- * Called from rtrequest(RTM_DELETE, ...) to fix up the route's ``family''
- * (i.e., the routes related to it by the operation of cloning). This
- * routine is iterated over all potential former-child-routes by way of
- * rnh->rnh_walktree_from() above, and those that actually are children of
- * the late parent (passed in as VP here) are themselves deleted.
- */
-static int
-rt_fixdelete(struct radix_node *rn, void *vp)
-{
- struct rtentry *rt = (struct rtentry *)rn;
- struct rtentry *rt0 = vp;
-
- if (rt->rt_parent == rt0 && !(rt->rt_flags & RTF_PINNED)) {
- return rtrequest(RTM_DELETE, rt_key(rt),
- (struct sockaddr *)0, rt_mask(rt),
- rt->rt_flags, (struct rtentry **)0);
- }
- return 0;
-}
-
-/*
- * This routine is called from rt_setgate() to do the analogous thing for
- * adds and changes. There is the added complication in this case of a
- * middle insert; i.e., insertion of a new network route between an older
- * network route and (cloned) host routes. For this reason, a simple check
- * of rt->rt_parent is insufficient; each candidate route must be tested
- * against the (mask, value) of the new route (passed as before in vp)
- * to see if the new route matches it. Unfortunately, this has the obnoxious
- * property of also triggering for insertion /above/ a pre-existing network
- * route and clones. Sigh. This may be fixed some day.
- *
- * XXX - it may be possible to do fixdelete() for changes and reserve this
- * routine just for adds. I'm not sure why I thought it was necessary to do
- * changes this way.
- */
-#ifdef DEBUG
-int rtfcdebug = 0;
-#endif
-
-static int
-rt_fixchange(struct radix_node *rn, void *vp)
-{
- struct rtentry *rt = (struct rtentry *)rn;
- struct rtfc_arg *ap = vp;
- struct rtentry *rt0 = ap->rt0;
- struct radix_node_head *rnh = ap->rnh;
- u_char *xk1, *xm1, *xk2;
- int i, len;
-
-#ifdef DEBUG
- if (rtfcdebug)
- printf("rt_fixchange: rt %p, rt0 %p\n", rt, rt0);
-#endif
-
- if (!rt->rt_parent || (rt->rt_flags & RTF_PINNED)) {
-#ifdef DEBUG
- if(rtfcdebug) printf("no parent or pinned\n");
-#endif
- return 0;
- }
-
- if (rt->rt_parent == rt0) {
-#ifdef DEBUG
- if(rtfcdebug) printf("parent match\n");
-#endif
- return rtrequest(RTM_DELETE, rt_key(rt),
- (struct sockaddr *)0, rt_mask(rt),
- rt->rt_flags, (struct rtentry **)0);
- }
-
- /*
- * There probably is a function somewhere which does this...
- * if not, there should be.
- */
- len = imin(((struct sockaddr *)rt_key(rt0))->sa_len,
- ((struct sockaddr *)rt_key(rt))->sa_len);
-
- xk1 = (u_char *)rt_key(rt0);
- xm1 = (u_char *)rt_mask(rt0);
- xk2 = (u_char *)rt_key(rt);
-
- for (i = rnh->rnh_treetop->rn_off; i < len; i++) {
- if ((xk2[i] & xm1[i]) != xk1[i]) {
-#ifdef DEBUG
- if(rtfcdebug) printf("no match\n");
-#endif
- return 0;
- }
- }
-
- /*
- * OK, this node is a clone, and matches the node currently being
- * changed/added under the node's mask. So, get rid of it.
- */
-#ifdef DEBUG
- if(rtfcdebug) printf("deleting\n");
-#endif
- return rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *)0,
- rt_mask(rt), rt->rt_flags, (struct rtentry **)0);
-}
-
-int
-rt_setgate(rt0, dst, gate)
- struct rtentry *rt0;
- struct sockaddr *dst, *gate;
-{
- caddr_t new, old;
- int dlen = ROUNDUP(dst->sa_len), glen = ROUNDUP(gate->sa_len);
- register struct rtentry *rt = rt0;
- struct radix_node_head *rnh = rt_tables[dst->sa_family];
-
- /*
- * A host route with the destination equal to the gateway
- * will interfere with keeping LLINFO in the routing
- * table, so disallow it.
- */
- if (((rt0->rt_flags & (RTF_HOST|RTF_GATEWAY|RTF_LLINFO)) ==
- (RTF_HOST|RTF_GATEWAY)) &&
- (dst->sa_len == gate->sa_len) &&
- (bcmp(dst, gate, dst->sa_len) == 0)) {
- /*
- * The route might already exist if this is an RTM_CHANGE
- * or a routing redirect, so try to delete it.
- */
- if (rt_key(rt0))
- rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt0),
- rt0->rt_gateway, rt_mask(rt0), rt0->rt_flags, 0);
- return EADDRNOTAVAIL;
- }
-
- if (rt->rt_gateway == 0 || glen > ROUNDUP(rt->rt_gateway->sa_len)) {
- old = (caddr_t)rt_key(rt);
- R_Malloc(new, caddr_t, dlen + glen);
- if (new == 0)
- return ENOBUFS;
- rt->rt_nodes->rn_key = new;
- } else {
- new = rt->rt_nodes->rn_key;
- old = 0;
- }
- Bcopy(gate, (rt->rt_gateway = (struct sockaddr *)(new + dlen)), glen);
- if (old) {
- Bcopy(dst, new, dlen);
- Free(old);
- }
- if (rt->rt_gwroute) {
- rt = rt->rt_gwroute; RTFREE(rt);
- rt = rt0; rt->rt_gwroute = 0;
- }
- /*
- * Cloning loop avoidance:
- * In the presence of protocol-cloning and bad configuration,
- * it is possible to get stuck in bottomless mutual recursion
- * (rtrequest rt_setgate rtalloc1). We avoid this by not allowing
- * protocol-cloning to operate for gateways (which is probably the
- * correct choice anyway), and avoid the resulting reference loops
- * by disallowing any route to run through itself as a gateway.
- * This is obviuosly mandatory when we get rt->rt_output().
- */
- if (rt->rt_flags & RTF_GATEWAY) {
- rt->rt_gwroute = rtalloc1(gate, 1, RTF_PRCLONING);
- if (rt->rt_gwroute == rt) {
- RTFREE(rt->rt_gwroute);
- rt->rt_gwroute = 0;
- return EDQUOT; /* failure */
- }
- }
-
- /*
- * This isn't going to do anything useful for host routes, so
- * don't bother. Also make sure we have a reasonable mask
- * (we don't yet have one during adds).
- */
- if (!(rt->rt_flags & RTF_HOST) && rt_mask(rt) != 0) {
- struct rtfc_arg arg;
- arg.rnh = rnh;
- arg.rt0 = rt;
- rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt),
- rt_fixchange, &arg);
- }
-
- return 0;
-}
-
-static void
-rt_maskedcopy(src, dst, netmask)
- struct sockaddr *src, *dst, *netmask;
-{
- register u_char *cp1 = (u_char *)src;
- register u_char *cp2 = (u_char *)dst;
- register u_char *cp3 = (u_char *)netmask;
- u_char *cplim = cp2 + *cp3;
- u_char *cplim2 = cp2 + *cp1;
-
- *cp2++ = *cp1++; *cp2++ = *cp1++; /* copies sa_len & sa_family */
- cp3 += 2;
- if (cplim > cplim2)
- cplim = cplim2;
- while (cp2 < cplim)
- *cp2++ = *cp1++ & *cp3++;
- if (cp2 < cplim2)
- bzero((caddr_t)cp2, (unsigned)(cplim2 - cp2));
-}
-
-/*
- * Set up a routing table entry, normally
- * for an interface.
- */
-int
-rtinit(ifa, cmd, flags)
- register struct ifaddr *ifa;
- int cmd, flags;
-{
- register struct rtentry *rt;
- register struct sockaddr *dst;
- register struct sockaddr *deldst;
- struct mbuf *m = 0;
- struct rtentry *nrt = 0;
- int error;
-
- dst = flags & RTF_HOST ? ifa->ifa_dstaddr : ifa->ifa_addr;
- /*
- * If it's a delete, check that if it exists, it's on the correct
- * interface or we might scrub a route to another ifa which would
- * be confusing at best and possibly worse.
- */
- if (cmd == RTM_DELETE) {
- /*
- * It's a delete, so it should already exist..
- * If it's a net, mask off the host bits
- * (Assuming we have a mask)
- */
- if ((flags & RTF_HOST) == 0 && ifa->ifa_netmask) {
- m = m_get(M_WAIT, MT_SONAME);
- deldst = mtod(m, struct sockaddr *);
- rt_maskedcopy(dst, deldst, ifa->ifa_netmask);
- dst = deldst;
- }
- /*
- * Get an rtentry that is in the routing tree and
- * contains the correct info. (if this fails we can't get there).
- * We set "report" to FALSE so that if it doesn't exist,
- * it doesn't report an error or clone a route, etc. etc.
- */
- rt = rtalloc1(dst, 0, 0UL);
- if (rt) {
- /*
- * Ok so we found the rtentry. it has an extra reference
- * for us at this stage. we won't need that so
- * lop that off now.
- */
- rt->rt_refcnt--;
- if (rt->rt_ifa != ifa) {
- /*
- * If the interface in the rtentry doesn't match
- * the interface we are using, then we don't
- * want to delete it, so return an error.
- * This seems to be the only point of
- * this whole RTM_DELETE clause.
- */
- if (m)
- (void) m_free(m);
- return (flags & RTF_HOST ? EHOSTUNREACH
- : ENETUNREACH);
- }
- }
- /* XXX */
-#if 0
- else {
- /*
- * One would think that as we are deleting, and we know
- * it doesn't exist, we could just return at this point
- * with an "ELSE" clause, but apparently not..
- */
- return (flags & RTF_HOST ? EHOSTUNREACH
- : ENETUNREACH);
- }
-#endif
- }
- /*
- * Do the actual request
- */
- error = rtrequest(cmd, dst, ifa->ifa_addr, ifa->ifa_netmask,
- flags | ifa->ifa_flags, &nrt);
- if (m)
- (void) m_free(m);
- /*
- * If we are deleting, and we found an entry, then
- * it's been removed from the tree.. now throw it away.
- */
- if (cmd == RTM_DELETE && error == 0 && (rt = nrt)) {
- /*
- * notify any listenning routing agents of the change
- */
- rt_newaddrmsg(cmd, ifa, error, nrt);
- if (rt->rt_refcnt <= 0) {
- rt->rt_refcnt++; /* need a 1->0 transition to free */
- rtfree(rt);
- }
- }
-
- /*
- * We are adding, and we have a returned routing entry.
- * We need to sanity check the result.
- */
- if (cmd == RTM_ADD && error == 0 && (rt = nrt)) {
- /*
- * We just wanted to add it.. we don't actually need a reference
- */
- rt->rt_refcnt--;
- /*
- * If it came back with an unexpected interface, then it must
- * have already existed or something. (XXX)
- */
- if (rt->rt_ifa != ifa) {
- printf("rtinit: wrong ifa (%p) was (%p)\n", ifa,
- rt->rt_ifa);
- /*
- * Ask that the route we got back be removed
- * from the routing tables as we are trying
- * to supersede it.
- */
- if (rt->rt_ifa->ifa_rtrequest)
- rt->rt_ifa->ifa_rtrequest(RTM_DELETE, rt, SA(0));
- /*
- * Remove the referenve to the it's ifaddr.
- */
- IFAFREE(rt->rt_ifa);
- /*
- * And substitute in references to the ifaddr
- * we are adding.
- */
- rt->rt_ifa = ifa;
- rt->rt_ifp = ifa->ifa_ifp;
- ifa->ifa_refcnt++;
- /*
- * Now add it to the routing table
- * XXX could we have just left it?
- * as it might have been in the right place..
- */
- if (ifa->ifa_rtrequest)
- ifa->ifa_rtrequest(RTM_ADD, rt, SA(0));
- }
- /*
- * notify any listenning routing agents of the change
- */
- rt_newaddrmsg(cmd, ifa, error, nrt);
- }
- return (error);
-}
diff --git a/c/src/exec/libnetworking/net/route.h b/c/src/exec/libnetworking/net/route.h
deleted file mode 100644
index 69d76909fc..0000000000
--- a/c/src/exec/libnetworking/net/route.h
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)route.h 8.3 (Berkeley) 4/19/94
- * $Id$
- */
-
-#ifndef _NET_ROUTE_H_
-#define _NET_ROUTE_H_
-
-/*
- * Kernel resident routing tables.
- *
- * The routing tables are initialized when interface addresses
- * are set by making entries for all directly connected interfaces.
- */
-
-/*
- * A route consists of a destination address and a reference
- * to a routing entry. These are often held by protocols
- * in their control blocks, e.g. inpcb.
- */
-struct route {
- struct rtentry *ro_rt;
- struct sockaddr ro_dst;
-};
-
-/*
- * These numbers are used by reliable protocols for determining
- * retransmission behavior and are included in the routing structure.
- */
-struct rt_metrics {
- u_long rmx_locks; /* Kernel must leave these values alone */
- u_long rmx_mtu; /* MTU for this path */
- u_long rmx_hopcount; /* max hops expected */
- u_long rmx_expire; /* lifetime for route, e.g. redirect */
- u_long rmx_recvpipe; /* inbound delay-bandwidth product */
- u_long rmx_sendpipe; /* outbound delay-bandwidth product */
- u_long rmx_ssthresh; /* outbound gateway buffer limit */
- u_long rmx_rtt; /* estimated round trip time */
- u_long rmx_rttvar; /* estimated rtt variance */
- u_long rmx_pksent; /* packets sent using this route */
- u_long rmx_filler[4]; /* will be used for T/TCP later */
-};
-
-/*
- * rmx_rtt and rmx_rttvar are stored as microseconds;
- * RTTTOPRHZ(rtt) converts to a value suitable for use
- * by a protocol slowtimo counter.
- */
-#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */
-#define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ))
-
-/*
- * XXX kernel function pointer `rt_output' is visible to applications.
- */
-struct mbuf;
-
-/*
- * We distinguish between routes to hosts and routes to networks,
- * preferring the former if available. For each route we infer
- * the interface to use from the gateway address supplied when
- * the route was entered. Routes that forward packets through
- * gateways are marked so that the output routines know to address the
- * gateway rather than the ultimate destination.
- */
-#ifndef RNF_NORMAL
-#include <net/radix.h>
-#endif
-struct rtentry {
- struct radix_node rt_nodes[2]; /* tree glue, and other values */
-#define rt_key(r) ((struct sockaddr *)((r)->rt_nodes->rn_key))
-#define rt_mask(r) ((struct sockaddr *)((r)->rt_nodes->rn_mask))
- struct sockaddr *rt_gateway; /* value */
- short rt_filler; /* was short flags field */
- short rt_refcnt; /* # held references */
- u_long rt_flags; /* up/down?, host/net */
- struct ifnet *rt_ifp; /* the answer: interface to use */
- struct ifaddr *rt_ifa; /* the answer: interface to use */
- struct sockaddr *rt_genmask; /* for generation of cloned routes */
- caddr_t rt_llinfo; /* pointer to link level info cache */
- struct rt_metrics rt_rmx; /* metrics used by rx'ing protocols */
- struct rtentry *rt_gwroute; /* implied entry for gatewayed routes */
- int (*rt_output) __P((struct ifnet *, struct mbuf *,
- struct sockaddr *, struct rtentry *));
- /* output routine for this (rt,if) */
- struct rtentry *rt_parent; /* cloning parent of this route */
- void *rt_filler2; /* more filler */
-};
-
-/*
- * Following structure necessary for 4.3 compatibility;
- * We should eventually move it to a compat file.
- */
-struct ortentry {
- u_long rt_hash; /* to speed lookups */
- struct sockaddr rt_dst; /* key */
- struct sockaddr rt_gateway; /* value */
- short rt_flags; /* up/down?, host/net */
- short rt_refcnt; /* # held references */
- u_long rt_use; /* raw # packets forwarded */
- struct ifnet *rt_ifp; /* the answer: interface to use */
-};
-
-#define rt_use rt_rmx.rmx_pksent
-
-#define RTF_UP 0x1 /* route usable */
-#define RTF_GATEWAY 0x2 /* destination is a gateway */
-#define RTF_HOST 0x4 /* host entry (net otherwise) */
-#define RTF_REJECT 0x8 /* host or net unreachable */
-#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */
-#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */
-#define RTF_DONE 0x40 /* message confirmed */
-/* 0x80 unused */
-#define RTF_CLONING 0x100 /* generate new routes on use */
-#define RTF_XRESOLVE 0x200 /* external daemon resolves name */
-#define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP) */
-#define RTF_STATIC 0x800 /* manually added */
-#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */
-#define RTF_PROTO2 0x4000 /* protocol specific routing flag */
-#define RTF_PROTO1 0x8000 /* protocol specific routing flag */
-
-#define RTF_PRCLONING 0x10000 /* protocol requires cloning */
-#define RTF_WASCLONED 0x20000 /* route generated through cloning */
-#define RTF_PROTO3 0x40000 /* protocol specific routing flag */
-/* 0x80000 unused */
-#define RTF_PINNED 0x100000 /* future use */
-#define RTF_LOCAL 0x200000 /* route represents a local address */
-#define RTF_BROADCAST 0x400000 /* route represents a bcast address */
-#define RTF_MULTICAST 0x800000 /* route represents a mcast address */
- /* 0x1000000 and up unassigned */
-
-/*
- * Routing statistics.
- */
-struct rtstat {
- short rts_badredirect; /* bogus redirect calls */
- short rts_dynamic; /* routes created by redirects */
- short rts_newgateway; /* routes modified by redirects */
- short rts_unreach; /* lookups which failed */
- short rts_wildcard; /* lookups satisfied by a wildcard */
-};
-/*
- * Structures for routing messages.
- */
-struct rt_msghdr {
- u_short rtm_msglen; /* to skip over non-understood messages */
- u_char rtm_version; /* future binary compatibility */
- u_char rtm_type; /* message type */
- u_short rtm_index; /* index for associated ifp */
- int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
- int rtm_addrs; /* bitmask identifying sockaddrs in msg */
- pid_t rtm_pid; /* identify sender */
- int rtm_seq; /* for sender to identify action */
- int rtm_errno; /* why failed */
- int rtm_use; /* from rtentry */
- u_long rtm_inits; /* which metrics we are initializing */
- struct rt_metrics rtm_rmx; /* metrics themselves */
-};
-
-#define RTM_VERSION 5 /* Up the ante and ignore older versions */
-
-#define RTM_ADD 0x1 /* Add Route */
-#define RTM_DELETE 0x2 /* Delete Route */
-#define RTM_CHANGE 0x3 /* Change Metrics or flags */
-#define RTM_GET 0x4 /* Report Metrics */
-#define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */
-#define RTM_REDIRECT 0x6 /* Told to use different route */
-#define RTM_MISS 0x7 /* Lookup failed on this address */
-#define RTM_LOCK 0x8 /* fix specified metrics */
-#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */
-#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */
-#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */
-#define RTM_NEWADDR 0xc /* address being added to iface */
-#define RTM_DELADDR 0xd /* address being removed from iface */
-#define RTM_IFINFO 0xe /* iface going up/down etc. */
-
-#define RTV_MTU 0x1 /* init or lock _mtu */
-#define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */
-#define RTV_EXPIRE 0x4 /* init or lock _hopcount */
-#define RTV_RPIPE 0x8 /* init or lock _recvpipe */
-#define RTV_SPIPE 0x10 /* init or lock _sendpipe */
-#define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */
-#define RTV_RTT 0x40 /* init or lock _rtt */
-#define RTV_RTTVAR 0x80 /* init or lock _rttvar */
-
-/*
- * Bitmask values for rtm_addr.
- */
-#define RTA_DST 0x1 /* destination sockaddr present */
-#define RTA_GATEWAY 0x2 /* gateway sockaddr present */
-#define RTA_NETMASK 0x4 /* netmask sockaddr present */
-#define RTA_GENMASK 0x8 /* cloning mask sockaddr present */
-#define RTA_IFP 0x10 /* interface name sockaddr present */
-#define RTA_IFA 0x20 /* interface addr sockaddr present */
-#define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */
-#define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */
-
-/*
- * Index offsets for sockaddr array for alternate internal encoding.
- */
-#define RTAX_DST 0 /* destination sockaddr present */
-#define RTAX_GATEWAY 1 /* gateway sockaddr present */
-#define RTAX_NETMASK 2 /* netmask sockaddr present */
-#define RTAX_GENMASK 3 /* cloning mask sockaddr present */
-#define RTAX_IFP 4 /* interface name sockaddr present */
-#define RTAX_IFA 5 /* interface addr sockaddr present */
-#define RTAX_AUTHOR 6 /* sockaddr for author of redirect */
-#define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */
-#define RTAX_MAX 8 /* size of array to allocate */
-
-struct rt_addrinfo {
- int rti_addrs;
- struct sockaddr *rti_info[RTAX_MAX];
-};
-
-struct route_cb {
- int ip_count;
- int ipx_count;
- int ns_count;
- int iso_count;
- int any_count;
-};
-
-#ifdef KERNEL
-#define RTFREE(rt) \
- if ((rt)->rt_refcnt <= 1) \
- rtfree(rt); \
- else \
- (rt)->rt_refcnt--;
-
-extern struct route_cb route_cb;
-extern struct rtstat rtstat;
-extern struct radix_node_head *rt_tables[AF_MAX+1];
-
-void route_init __P((void));
-void rt_ifmsg __P((struct ifnet *));
-void rt_missmsg __P((int, struct rt_addrinfo *, int, int));
-void rt_newaddrmsg __P((int, struct ifaddr *, int, struct rtentry *));
-int rt_setgate __P((struct rtentry *,
- struct sockaddr *, struct sockaddr *));
-void rtalloc __P((struct route *));
-void rtalloc_ign __P((struct route *, unsigned long));
-struct rtentry *
- rtalloc1 __P((struct sockaddr *, int, unsigned long));
-void rtfree __P((struct rtentry *));
-int rtinit __P((struct ifaddr *, int, int));
-int rtioctl __P((int, caddr_t, struct proc *));
-void rtredirect __P((struct sockaddr *, struct sockaddr *,
- struct sockaddr *, int, struct sockaddr *, struct rtentry **));
-int rtrequest __P((int, struct sockaddr *,
- struct sockaddr *, struct sockaddr *, int, struct rtentry **));
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/net/rtsock.c b/c/src/exec/libnetworking/net/rtsock.c
deleted file mode 100644
index 57e777906a..0000000000
--- a/c/src/exec/libnetworking/net/rtsock.c
+++ /dev/null
@@ -1,829 +0,0 @@
-/*
- * Copyright (c) 1988, 1991, 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.
- *
- * @(#)rtsock.c 8.5 (Berkeley) 11/2/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/raw_cb.h>
-
-static struct sockaddr route_dst = { 2, PF_ROUTE, };
-static struct sockaddr route_src = { 2, PF_ROUTE, };
-static struct sockaddr sa_zero = { sizeof(sa_zero), AF_INET, };
-static struct sockproto route_proto = { PF_ROUTE, };
-
-struct walkarg {
- int w_tmemsize;
- int w_op, w_arg;
- caddr_t w_tmem;
- struct sysctl_req *w_req;
-};
-
-static struct mbuf *
- rt_msg1 __P((int, struct rt_addrinfo *));
-static int rt_msg2 __P((int,
- struct rt_addrinfo *, caddr_t, struct walkarg *));
-static int rt_xaddrs __P((caddr_t, caddr_t, struct rt_addrinfo *));
-static int sysctl_dumpentry __P((struct radix_node *rn, void *vw));
-static int sysctl_iflist __P((int af, struct walkarg *w));
-static int route_output __P((struct mbuf *, struct socket *));
-static int route_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-static void rt_setmetrics __P((u_long, struct rt_metrics *, struct rt_metrics *));
-
-/* Sleazy use of local variables throughout file, warning!!!! */
-#define dst info.rti_info[RTAX_DST]
-#define gate info.rti_info[RTAX_GATEWAY]
-#define netmask info.rti_info[RTAX_NETMASK]
-#define genmask info.rti_info[RTAX_GENMASK]
-#define ifpaddr info.rti_info[RTAX_IFP]
-#define ifaaddr info.rti_info[RTAX_IFA]
-#define brdaddr info.rti_info[RTAX_BRD]
-
-/*ARGSUSED*/
-static int
-route_usrreq(so, req, m, nam, control)
- register struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register int error = 0;
- register struct rawcb *rp = sotorawcb(so);
- int s;
-
- if (req == PRU_ATTACH) {
- MALLOC(rp, struct rawcb *, sizeof(*rp), M_PCB, M_WAITOK);
- so->so_pcb = (caddr_t)rp;
- if (so->so_pcb)
- bzero(so->so_pcb, sizeof(*rp));
- }
- if (req == PRU_DETACH && rp) {
- int af = rp->rcb_proto.sp_protocol;
- if (af == AF_INET)
- route_cb.ip_count--;
- else if (af == AF_IPX)
- route_cb.ipx_count--;
- else if (af == AF_NS)
- route_cb.ns_count--;
- else if (af == AF_ISO)
- route_cb.iso_count--;
- route_cb.any_count--;
- }
- s = splnet();
- error = raw_usrreq(so, req, m, nam, control);
- rp = sotorawcb(so);
- if (req == PRU_ATTACH && rp) {
- int af = rp->rcb_proto.sp_protocol;
- if (error) {
- free((caddr_t)rp, M_PCB);
- splx(s);
- return (error);
- }
- if (af == AF_INET)
- route_cb.ip_count++;
- else if (af == AF_IPX)
- route_cb.ipx_count++;
- else if (af == AF_NS)
- route_cb.ns_count++;
- else if (af == AF_ISO)
- route_cb.iso_count++;
- rp->rcb_faddr = &route_src;
- route_cb.any_count++;
- soisconnected(so);
- so->so_options |= SO_USELOOPBACK;
- }
- splx(s);
- return (error);
-}
-
-/*ARGSUSED*/
-static int
-route_output(m, so)
- register struct mbuf *m;
- struct socket *so;
-{
- register struct rt_msghdr *rtm = 0;
- register struct rtentry *rt = 0;
- struct rtentry *saved_nrt = 0;
- struct radix_node_head *rnh;
- struct rt_addrinfo info;
- int len, error = 0;
- struct ifnet *ifp = 0;
- struct ifaddr *ifa = 0;
-
-#define senderr(e) { error = e; goto flush;}
- if (m == 0 || ((m->m_len < sizeof(long)) &&
- (m = m_pullup(m, sizeof(long))) == 0))
- return (ENOBUFS);
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("route_output");
- len = m->m_pkthdr.len;
- if (len < sizeof(*rtm) ||
- len != mtod(m, struct rt_msghdr *)->rtm_msglen) {
- dst = 0;
- senderr(EINVAL);
- }
- R_Malloc(rtm, struct rt_msghdr *, len);
- if (rtm == 0) {
- dst = 0;
- senderr(ENOBUFS);
- }
- m_copydata(m, 0, len, (caddr_t)rtm);
- if (rtm->rtm_version != RTM_VERSION) {
- dst = 0;
- senderr(EPROTONOSUPPORT);
- }
- info.rti_addrs = rtm->rtm_addrs;
- if (rt_xaddrs((caddr_t)(rtm + 1), len + (caddr_t)rtm, &info)) {
- dst = 0;
- senderr(EINVAL);
- }
- if (dst == 0 || (dst->sa_family >= AF_MAX)
- || (gate != 0 && (gate->sa_family >= AF_MAX)))
- senderr(EINVAL);
- if (genmask) {
- struct radix_node *t;
- t = rn_addmask((caddr_t)genmask, 0, 1);
- if (t && Bcmp(genmask, t->rn_key, *(u_char *)genmask) == 0)
- genmask = (struct sockaddr *)(t->rn_key);
- else
- senderr(ENOBUFS);
- }
- switch (rtm->rtm_type) {
-
- case RTM_ADD:
- if (gate == 0)
- senderr(EINVAL);
- error = rtrequest(RTM_ADD, dst, gate, netmask,
- rtm->rtm_flags, &saved_nrt);
- if (error == 0 && saved_nrt) {
- rt_setmetrics(rtm->rtm_inits,
- &rtm->rtm_rmx, &saved_nrt->rt_rmx);
- saved_nrt->rt_rmx.rmx_locks &= ~(rtm->rtm_inits);
- saved_nrt->rt_rmx.rmx_locks |=
- (rtm->rtm_inits & rtm->rtm_rmx.rmx_locks);
- saved_nrt->rt_refcnt--;
- saved_nrt->rt_genmask = genmask;
- }
- break;
-
- case RTM_DELETE:
- error = rtrequest(RTM_DELETE, dst, gate, netmask,
- rtm->rtm_flags, &saved_nrt);
- if (error == 0) {
- if ((rt = saved_nrt))
- rt->rt_refcnt++;
- goto report;
- }
- break;
-
- case RTM_GET:
- case RTM_CHANGE:
- case RTM_LOCK:
- if ((rnh = rt_tables[dst->sa_family]) == 0) {
- senderr(EAFNOSUPPORT);
- } else if ((rt = (struct rtentry *)
- rnh->rnh_lookup(dst, netmask, rnh)))
- rt->rt_refcnt++;
- else
- senderr(ESRCH);
- switch(rtm->rtm_type) {
-
- case RTM_GET:
- report:
- dst = rt_key(rt);
- gate = rt->rt_gateway;
- netmask = rt_mask(rt);
- genmask = rt->rt_genmask;
- if (rtm->rtm_addrs & (RTA_IFP | RTA_IFA)) {
- ifp = rt->rt_ifp;
- if (ifp) {
- ifpaddr = ifp->if_addrlist->ifa_addr;
- ifaaddr = rt->rt_ifa->ifa_addr;
- rtm->rtm_index = ifp->if_index;
- } else {
- ifpaddr = 0;
- ifaaddr = 0;
- }
- }
- len = rt_msg2(rtm->rtm_type, &info, (caddr_t)0,
- (struct walkarg *)0);
- if (len > rtm->rtm_msglen) {
- struct rt_msghdr *new_rtm;
- R_Malloc(new_rtm, struct rt_msghdr *, len);
- if (new_rtm == 0)
- senderr(ENOBUFS);
- Bcopy(rtm, new_rtm, rtm->rtm_msglen);
- Free(rtm); rtm = new_rtm;
- }
- (void)rt_msg2(rtm->rtm_type, &info, (caddr_t)rtm,
- (struct walkarg *)0);
- rtm->rtm_flags = rt->rt_flags;
- rtm->rtm_rmx = rt->rt_rmx;
- rtm->rtm_addrs = info.rti_addrs;
- break;
-
- case RTM_CHANGE:
- if (gate && (error = rt_setgate(rt, rt_key(rt), gate)))
- senderr(error);
-
- /*
- * If they tried to change things but didn't specify
- * the required gateway, then just use the old one.
- * This can happen if the user tries to change the
- * flags on the default route without changing the
- * default gateway. Changing flags still doesn't work.
- */
- if ((rt->rt_flags & RTF_GATEWAY) && !gate)
- gate = rt->rt_gateway;
-
- /* new gateway could require new ifaddr, ifp;
- flags may also be different; ifp may be specified
- by ll sockaddr when protocol address is ambiguous */
- if (ifpaddr && (ifa = ifa_ifwithnet(ifpaddr)) &&
- (ifp = ifa->ifa_ifp) && (ifaaddr || gate))
- ifa = ifaof_ifpforaddr(ifaaddr ? ifaaddr : gate,
- ifp);
- else if ((ifaaddr && (ifa = ifa_ifwithaddr(ifaaddr))) ||
- (gate && (ifa = ifa_ifwithroute(rt->rt_flags,
- rt_key(rt), gate))))
- ifp = ifa->ifa_ifp;
- if (ifa) {
- register struct ifaddr *oifa = rt->rt_ifa;
- if (oifa != ifa) {
- if (oifa && oifa->ifa_rtrequest)
- oifa->ifa_rtrequest(RTM_DELETE,
- rt, gate);
- IFAFREE(rt->rt_ifa);
- rt->rt_ifa = ifa;
- ifa->ifa_refcnt++;
- rt->rt_ifp = ifp;
- }
- }
- rt_setmetrics(rtm->rtm_inits, &rtm->rtm_rmx,
- &rt->rt_rmx);
- if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest)
- rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, gate);
- if (genmask)
- rt->rt_genmask = genmask;
- /*
- * Fall into
- */
- case RTM_LOCK:
- rt->rt_rmx.rmx_locks &= ~(rtm->rtm_inits);
- rt->rt_rmx.rmx_locks |=
- (rtm->rtm_inits & rtm->rtm_rmx.rmx_locks);
- break;
- }
- break;
-
- default:
- senderr(EOPNOTSUPP);
- }
-
-flush:
- if (rtm) {
- if (error)
- rtm->rtm_errno = error;
- else
- rtm->rtm_flags |= RTF_DONE;
- }
- if (rt)
- rtfree(rt);
- {
- register struct rawcb *rp = 0;
- /*
- * Check to see if we don't want our own messages.
- */
- if ((so->so_options & SO_USELOOPBACK) == 0) {
- if (route_cb.any_count <= 1) {
- if (rtm)
- Free(rtm);
- m_freem(m);
- return (error);
- }
- /* There is another listener, so construct message */
- rp = sotorawcb(so);
- }
- if (rtm) {
- m_copyback(m, 0, rtm->rtm_msglen, (caddr_t)rtm);
- Free(rtm);
- }
- if (rp)
- rp->rcb_proto.sp_family = 0; /* Avoid us */
- if (dst)
- route_proto.sp_protocol = dst->sa_family;
- raw_input(m, &route_proto, &route_src, &route_dst);
- if (rp)
- rp->rcb_proto.sp_family = PF_ROUTE;
- }
- return (error);
-}
-
-static void
-rt_setmetrics(which, in, out)
- u_long which;
- register struct rt_metrics *in, *out;
-{
-#define metric(f, e) if (which & (f)) out->e = in->e;
- metric(RTV_RPIPE, rmx_recvpipe);
- metric(RTV_SPIPE, rmx_sendpipe);
- metric(RTV_SSTHRESH, rmx_ssthresh);
- metric(RTV_RTT, rmx_rtt);
- metric(RTV_RTTVAR, rmx_rttvar);
- metric(RTV_HOPCOUNT, rmx_hopcount);
- metric(RTV_MTU, rmx_mtu);
- metric(RTV_EXPIRE, rmx_expire);
-#undef metric
-}
-
-#define ROUNDUP(a) \
- ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
-#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
-
-
-/*
- * Extract the addresses of the passed sockaddrs.
- * Do a little sanity checking so as to avoid bad memory references.
- * This data is derived straight from userland.
- */
-static int
-rt_xaddrs(cp, cplim, rtinfo)
- register caddr_t cp, cplim;
- register struct rt_addrinfo *rtinfo;
-{
- register struct sockaddr *sa;
- register int i;
-
- bzero(rtinfo->rti_info, sizeof(rtinfo->rti_info));
- for (i = 0; (i < RTAX_MAX) && (cp < cplim); i++) {
- if ((rtinfo->rti_addrs & (1 << i)) == 0)
- continue;
- sa = (struct sockaddr *)cp;
- /*
- * It won't fit.
- */
- if ( (cp + sa->sa_len) > cplim ) {
- return (EINVAL);
- }
-
- /*
- * there are no more.. quit now
- * If there are more bits, they are in error.
- * I've seen this. route(1) can evidently generate these.
- * This causes kernel to core dump.
- * for compatibility, If we see this, point to a safe address.
- */
- if (sa->sa_len == 0) {
- rtinfo->rti_info[i] = &sa_zero;
- return (0); /* should be EINVAL but for compat */
- }
-
- /* accept it */
- rtinfo->rti_info[i] = sa;
- ADVANCE(cp, sa);
- }
- return (0);
-}
-
-static struct mbuf *
-rt_msg1(type, rtinfo)
- int type;
- register struct rt_addrinfo *rtinfo;
-{
- register struct rt_msghdr *rtm;
- register struct mbuf *m;
- register int i;
- register struct sockaddr *sa;
- int len, dlen;
-
- m = m_gethdr(M_DONTWAIT, MT_DATA);
- if (m == 0)
- return (m);
- switch (type) {
-
- case RTM_DELADDR:
- case RTM_NEWADDR:
- len = sizeof(struct ifa_msghdr);
- break;
-
- case RTM_IFINFO:
- len = sizeof(struct if_msghdr);
- break;
-
- default:
- len = sizeof(struct rt_msghdr);
- }
- if (len > MHLEN)
- panic("rt_msg1");
- m->m_pkthdr.len = m->m_len = len;
- m->m_pkthdr.rcvif = 0;
- rtm = mtod(m, struct rt_msghdr *);
- bzero((caddr_t)rtm, len);
- for (i = 0; i < RTAX_MAX; i++) {
- if ((sa = rtinfo->rti_info[i]) == NULL)
- continue;
- rtinfo->rti_addrs |= (1 << i);
- dlen = ROUNDUP(sa->sa_len);
- m_copyback(m, len, dlen, (caddr_t)sa);
- len += dlen;
- }
- if (m->m_pkthdr.len != len) {
- m_freem(m);
- return (NULL);
- }
- rtm->rtm_msglen = len;
- rtm->rtm_version = RTM_VERSION;
- rtm->rtm_type = type;
- return (m);
-}
-
-static int
-rt_msg2(type, rtinfo, cp, w)
- int type;
- register struct rt_addrinfo *rtinfo;
- caddr_t cp;
- struct walkarg *w;
-{
- register int i;
- int len, dlen, second_time = 0;
- caddr_t cp0;
-
- rtinfo->rti_addrs = 0;
-again:
- switch (type) {
-
- case RTM_DELADDR:
- case RTM_NEWADDR:
- len = sizeof(struct ifa_msghdr);
- break;
-
- case RTM_IFINFO:
- len = sizeof(struct if_msghdr);
- break;
-
- default:
- len = sizeof(struct rt_msghdr);
- }
- cp0 = cp;
- if (cp0)
- cp += len;
- for (i = 0; i < RTAX_MAX; i++) {
- register struct sockaddr *sa;
-
- if ((sa = rtinfo->rti_info[i]) == 0)
- continue;
- rtinfo->rti_addrs |= (1 << i);
- dlen = ROUNDUP(sa->sa_len);
- if (cp) {
- bcopy((caddr_t)sa, cp, (unsigned)dlen);
- cp += dlen;
- }
- len += dlen;
- }
- if (cp == 0 && w != NULL && !second_time) {
- register struct walkarg *rw = w;
-
- if (rw->w_req) {
- if (rw->w_tmemsize < len) {
- if (rw->w_tmem)
- free(rw->w_tmem, M_RTABLE);
- rw->w_tmem = (caddr_t)
- malloc(len, M_RTABLE, M_NOWAIT);
- if (rw->w_tmem)
- rw->w_tmemsize = len;
- }
- if (rw->w_tmem) {
- cp = rw->w_tmem;
- second_time = 1;
- goto again;
- }
- }
- }
- if (cp) {
- register struct rt_msghdr *rtm = (struct rt_msghdr *)cp0;
-
- rtm->rtm_version = RTM_VERSION;
- rtm->rtm_type = type;
- rtm->rtm_msglen = len;
- }
- return (len);
-}
-
-/*
- * This routine is called to generate a message from the routing
- * socket indicating that a redirect has occured, a routing lookup
- * has failed, or that a protocol has detected timeouts to a particular
- * destination.
- */
-void
-rt_missmsg(type, rtinfo, flags, error)
- int type, flags, error;
- register struct rt_addrinfo *rtinfo;
-{
- register struct rt_msghdr *rtm;
- register struct mbuf *m;
- struct sockaddr *sa = rtinfo->rti_info[RTAX_DST];
-
- if (route_cb.any_count == 0)
- return;
- m = rt_msg1(type, rtinfo);
- if (m == 0)
- return;
- rtm = mtod(m, struct rt_msghdr *);
- rtm->rtm_flags = RTF_DONE | flags;
- rtm->rtm_errno = error;
- rtm->rtm_addrs = rtinfo->rti_addrs;
- route_proto.sp_protocol = sa ? sa->sa_family : 0;
- raw_input(m, &route_proto, &route_src, &route_dst);
-}
-
-/*
- * This routine is called to generate a message from the routing
- * socket indicating that the status of a network interface has changed.
- */
-void
-rt_ifmsg(ifp)
- register struct ifnet *ifp;
-{
- register struct if_msghdr *ifm;
- struct mbuf *m;
- struct rt_addrinfo info;
-
- if (route_cb.any_count == 0)
- return;
- bzero((caddr_t)&info, sizeof(info));
- m = rt_msg1(RTM_IFINFO, &info);
- if (m == 0)
- return;
- ifm = mtod(m, struct if_msghdr *);
- ifm->ifm_index = ifp->if_index;
- ifm->ifm_flags = (u_short)ifp->if_flags;
- ifm->ifm_data = ifp->if_data;
- ifm->ifm_addrs = 0;
- route_proto.sp_protocol = 0;
- raw_input(m, &route_proto, &route_src, &route_dst);
-}
-
-/*
- * This is called to generate messages from the routing socket
- * indicating a network interface has had addresses associated with it.
- * if we ever reverse the logic and replace messages TO the routing
- * socket indicate a request to configure interfaces, then it will
- * be unnecessary as the routing socket will automatically generate
- * copies of it.
- */
-void
-rt_newaddrmsg(cmd, ifa, error, rt)
- int cmd, error;
- register struct ifaddr *ifa;
- register struct rtentry *rt;
-{
- struct rt_addrinfo info;
- struct sockaddr *sa = 0;
- int pass;
- struct mbuf *m = 0;
- struct ifnet *ifp = ifa->ifa_ifp;
-
- if (route_cb.any_count == 0)
- return;
- for (pass = 1; pass < 3; pass++) {
- bzero((caddr_t)&info, sizeof(info));
- if ((cmd == RTM_ADD && pass == 1) ||
- (cmd == RTM_DELETE && pass == 2)) {
- register struct ifa_msghdr *ifam;
- int ncmd = cmd == RTM_ADD ? RTM_NEWADDR : RTM_DELADDR;
-
- ifaaddr = sa = ifa->ifa_addr;
- ifpaddr = ifp->if_addrlist->ifa_addr;
- netmask = ifa->ifa_netmask;
- brdaddr = ifa->ifa_dstaddr;
- if ((m = rt_msg1(ncmd, &info)) == NULL)
- continue;
- ifam = mtod(m, struct ifa_msghdr *);
- ifam->ifam_index = ifp->if_index;
- ifam->ifam_metric = ifa->ifa_metric;
- ifam->ifam_flags = ifa->ifa_flags;
- ifam->ifam_addrs = info.rti_addrs;
- }
- if ((cmd == RTM_ADD && pass == 2) ||
- (cmd == RTM_DELETE && pass == 1)) {
- register struct rt_msghdr *rtm;
-
- if (rt == 0)
- continue;
- netmask = rt_mask(rt);
- dst = sa = rt_key(rt);
- gate = rt->rt_gateway;
- if ((m = rt_msg1(cmd, &info)) == NULL)
- continue;
- rtm = mtod(m, struct rt_msghdr *);
- rtm->rtm_index = ifp->if_index;
- rtm->rtm_flags |= rt->rt_flags;
- rtm->rtm_errno = error;
- rtm->rtm_addrs = info.rti_addrs;
- }
- route_proto.sp_protocol = sa ? sa->sa_family : 0;
- raw_input(m, &route_proto, &route_src, &route_dst);
- }
-}
-
-
-/*
- * This is used in dumping the kernel table via sysctl().
- */
-int
-sysctl_dumpentry(rn, vw)
- struct radix_node *rn;
- void *vw;
-{
- register struct walkarg *w = vw;
- register struct rtentry *rt = (struct rtentry *)rn;
- int error = 0, size;
- struct rt_addrinfo info;
-
- if (w->w_op == NET_RT_FLAGS && !(rt->rt_flags & w->w_arg))
- return 0;
- bzero((caddr_t)&info, sizeof(info));
- dst = rt_key(rt);
- gate = rt->rt_gateway;
- netmask = rt_mask(rt);
- genmask = rt->rt_genmask;
- size = rt_msg2(RTM_GET, &info, 0, w);
- if (w->w_req && w->w_tmem) {
- register struct rt_msghdr *rtm = (struct rt_msghdr *)w->w_tmem;
-
- rtm->rtm_flags = rt->rt_flags;
- rtm->rtm_use = rt->rt_use;
- rtm->rtm_rmx = rt->rt_rmx;
- rtm->rtm_index = rt->rt_ifp->if_index;
- rtm->rtm_errno = rtm->rtm_pid = rtm->rtm_seq = 0;
- rtm->rtm_addrs = info.rti_addrs;
- error = 0;
- return (error);
- }
- return (error);
-}
-
-int
-sysctl_iflist(af, w)
- int af;
- register struct walkarg *w;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
- struct rt_addrinfo info;
- int len, error = 0;
-
- bzero((caddr_t)&info, sizeof(info));
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- if (w->w_arg && w->w_arg != ifp->if_index)
- continue;
- ifa = ifp->if_addrlist;
- ifpaddr = ifa->ifa_addr;
- len = rt_msg2(RTM_IFINFO, &info, (caddr_t)0, w);
- ifpaddr = 0;
- if (w->w_req && w->w_tmem) {
- register struct if_msghdr *ifm;
-
- ifm = (struct if_msghdr *)w->w_tmem;
- ifm->ifm_index = ifp->if_index;
- ifm->ifm_flags = (u_short)ifp->if_flags;
- ifm->ifm_data = ifp->if_data;
- ifm->ifm_addrs = info.rti_addrs;
- error =0;
- if (error)
- return (error);
- }
- while ((ifa = ifa->ifa_next) != 0) {
- if (af && af != ifa->ifa_addr->sa_family)
- continue;
- ifaaddr = ifa->ifa_addr;
- netmask = ifa->ifa_netmask;
- brdaddr = ifa->ifa_dstaddr;
- len = rt_msg2(RTM_NEWADDR, &info, 0, w);
- if (w->w_req && w->w_tmem) {
- register struct ifa_msghdr *ifam;
-
- ifam = (struct ifa_msghdr *)w->w_tmem;
- ifam->ifam_index = ifa->ifa_ifp->if_index;
- ifam->ifam_flags = ifa->ifa_flags;
- ifam->ifam_metric = ifa->ifa_metric;
- ifam->ifam_addrs = info.rti_addrs;
- error = 0;
- if (error)
- return (error);
- }
- }
- ifaaddr = netmask = brdaddr = 0;
- }
- return (0);
-}
-
-static int
-sysctl_rtsock SYSCTL_HANDLER_ARGS
-{
- int *name = (int *)arg1;
- u_int namelen = arg2;
- register struct radix_node_head *rnh;
- int i, s, error = EINVAL;
- u_char af;
- struct walkarg w;
-
- name ++;
- namelen--;
- if (req->newptr)
- return (EPERM);
- if (namelen != 3)
- return (EINVAL);
- af = name[0];
- Bzero(&w, sizeof(w));
- w.w_op = name[1];
- w.w_arg = name[2];
- w.w_req = req;
-
- s = splnet();
- switch (w.w_op) {
-
- case NET_RT_DUMP:
- case NET_RT_FLAGS:
- for (i = 1; i <= AF_MAX; i++)
- if ((rnh = rt_tables[i]) && (af == 0 || af == i) &&
- (error = rnh->rnh_walktree(rnh,
- sysctl_dumpentry, &w)))
- break;
- break;
-
- case NET_RT_IFLIST:
- error = sysctl_iflist(af, &w);
- }
- splx(s);
- if (w.w_tmem)
- free(w.w_tmem, M_RTABLE);
- return (error);
-}
-
-SYSCTL_NODE(_net, PF_ROUTE, routetable, CTLFLAG_RD, sysctl_rtsock,"");
-
-/*
- * Definitions of protocols supported in the ROUTE domain.
- */
-
-extern struct domain routedomain; /* or at least forward */
-
-static struct protosw routesw[] = {
-{ SOCK_RAW, &routedomain, 0, PR_ATOMIC|PR_ADDR,
- 0, route_output, raw_ctlinput, 0,
- route_usrreq,
- raw_init
-}
-};
-
-struct domain routedomain =
- { PF_ROUTE, "route", route_init, 0, 0,
- routesw, &routesw[sizeof(routesw)/sizeof(routesw[0])] };
-
-DOMAIN_SET(route);
diff --git a/c/src/exec/libnetworking/netdb.h b/c/src/exec/libnetworking/netdb.h
deleted file mode 100644
index ec274f851f..0000000000
--- a/c/src/exec/libnetworking/netdb.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*-
- * Copyright (c) 1980, 1983, 1988, 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.
- *
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-/*
- * @(#)netdb.h 8.1 (Berkeley) 6/2/93
- * From: Id: netdb.h,v 8.9 1996/11/19 08:39:29 vixie Exp $
- * $Id$
- */
-
-#ifndef _NETDB_H_
-#define _NETDB_H_
-
-#include <sys/cdefs.h>
-
-#ifndef _PATH_HEQUIV
-# define _PATH_HEQUIV "/etc/hosts.equiv"
-#endif
-#define _PATH_HOSTS "/etc/hosts"
-#define _PATH_NETWORKS "/etc/networks"
-#define _PATH_PROTOCOLS "/etc/protocols"
-#define _PATH_SERVICES "/etc/services"
-
-extern int h_errno;
-
-/*
- * Structures returned by network data base library. All addresses are
- * supplied in host order, and returned in network order (suitable for
- * use in system calls).
- */
-struct hostent {
- char *h_name; /* official name of host */
- char **h_aliases; /* alias list */
- int h_addrtype; /* host address type */
- int h_length; /* length of address */
- char **h_addr_list; /* list of addresses from name server */
-#define h_addr h_addr_list[0] /* address, for backward compatibility */
-};
-
-/*
- * Assumption here is that a network number
- * fits in an unsigned long -- probably a poor one.
- */
-struct netent {
- char *n_name; /* official name of net */
- char **n_aliases; /* alias list */
- int n_addrtype; /* net address type */
- unsigned long n_net; /* network # */
-};
-
-struct servent {
- char *s_name; /* official service name */
- char **s_aliases; /* alias list */
- int s_port; /* port # */
- char *s_proto; /* protocol to use */
-};
-
-struct protoent {
- char *p_name; /* official protocol name */
- char **p_aliases; /* alias list */
- int p_proto; /* protocol # */
-};
-
-/*
- * Error return codes from gethostbyname() and gethostbyaddr()
- * (left in extern int h_errno).
- */
-
-#define NETDB_INTERNAL -1 /* see errno */
-#define NETDB_SUCCESS 0 /* no problem */
-#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
-#define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */
-#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
-#define NO_DATA 4 /* Valid name, no data record of requested type */
-#define NO_ADDRESS NO_DATA /* no address, look for MX record */
-
-__BEGIN_DECLS
-void endhostent __P((void));
-void endnetent __P((void));
-void endprotoent __P((void));
-void endservent __P((void));
-struct hostent *gethostbyaddr __P((const char *, int, int));
-struct hostent *gethostbyname __P((const char *));
-struct hostent *gethostbyname2 __P((const char *, int));
-struct hostent *gethostent __P((void));
-struct netent *getnetbyaddr __P((unsigned long, int));
-struct netent *getnetbyname __P((const char *));
-struct netent *getnetent __P((void));
-struct protoent *getprotobyname __P((const char *));
-struct protoent *getprotobynumber __P((int));
-struct protoent *getprotoent __P((void));
-struct servent *getservbyname __P((const char *, const char *));
-struct servent *getservbyport __P((int, const char *));
-struct servent *getservent __P((void));
-void herror __P((const char *));
-__const char *hstrerror __P((int));
-void sethostent __P((int));
-/* void sethostfile __P((const char *)); */
-void setnetent __P((int));
-void setprotoent __P((int));
-void setservent __P((int));
-
-/*
- * PRIVATE functions specific to the FreeBSD implementation
- */
-
-/* DO NOT USE THESE, THEY ARE SUBJECT TO CHANGE AND ARE NOT PORTABLE!!! */
-void _sethosthtent __P((int));
-void _endhosthtent __P((void));
-void _sethostdnsent __P((int));
-void _endhostdnsent __P((void));
-void _setnethtent __P((int));
-void _endnethtent __P((void));
-void _setnetdnsent __P((int));
-void _endnetdnsent __P((void));
-struct hostent * _gethostbyhtname __P((const char *, int));
-struct hostent * _gethostbydnsname __P((const char *, int));
-struct hostent * _gethostbynisname __P((const char *, int));
-struct hostent * _gethostbyhtaddr __P((const char *, int, int));
-struct hostent * _gethostbydnsaddr __P((const char *, int, int));
-struct hostent * _gethostbynisaddr __P((const char *, int, int));
-struct netent * _getnetbyhtname __P((const char *));
-struct netent * _getnetbydnsname __P((const char *));
-struct netent * _getnetbynisname __P((const char *));
-struct netent * _getnetbyhtaddr __P((unsigned long, int));
-struct netent * _getnetbydnsaddr __P((unsigned long, int));
-struct netent * _getnetbynisaddr __P((unsigned long, int));
-void _map_v4v6_address __P((const char *src, char *dst));
-void _map_v4v6_hostent __P((struct hostent *hp, char **bp, int *len));
-__END_DECLS
-
-#endif /* !_NETDB_H_ */
diff --git a/c/src/exec/libnetworking/netinet/icmp_var.h b/c/src/exec/libnetworking/netinet/icmp_var.h
deleted file mode 100644
index 7657f31acf..0000000000
--- a/c/src/exec/libnetworking/netinet/icmp_var.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)icmp_var.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_ICMP_VAR_H_
-#define _NETINET_ICMP_VAR_H_
-
-/*
- * Variables related to this implementation
- * of the internet control message protocol.
- */
-struct icmpstat {
-/* statistics related to icmp packets generated */
- u_long icps_error; /* # of calls to icmp_error */
- u_long icps_oldshort; /* no error 'cuz old ip too short */
- u_long icps_oldicmp; /* no error 'cuz old was icmp */
- u_long icps_outhist[ICMP_MAXTYPE + 1];
-/* statistics related to input messages processed */
- u_long icps_badcode; /* icmp_code out of range */
- u_long icps_tooshort; /* packet < ICMP_MINLEN */
- u_long icps_checksum; /* bad checksum */
- u_long icps_badlen; /* calculated bound mismatch */
- u_long icps_reflect; /* number of responses */
- u_long icps_inhist[ICMP_MAXTYPE + 1];
- u_long icps_bmcastecho; /* b/mcast echo requests dropped */
- u_long icps_bmcasttstamp; /* b/mcast tstamp requests dropped */
-};
-
-/*
- * Names for ICMP sysctl objects
- */
-#define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */
-#define ICMPCTL_STATS 2 /* statistics (read-only) */
-#define ICMPCTL_MAXID 3
-
-#define ICMPCTL_NAMES { \
- { 0, 0 }, \
- { "maskrepl", CTLTYPE_INT }, \
- { "stats", CTLTYPE_STRUCT }, \
-}
-
-#ifdef KERNEL
-extern struct icmpstat icmpstat;
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/netinet/if_ether.c b/c/src/exec/libnetworking/netinet/if_ether.c
deleted file mode 100644
index 985ce6e7d9..0000000000
--- a/c/src/exec/libnetworking/netinet/if_ether.c
+++ /dev/null
@@ -1,638 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)if_ether.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-/*
- * Ethernet address resolution protocol.
- * TODO:
- * add "inuse/lock" bit (or ref. count) along with valid bit
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/socket.h>
-#include <sys/syslog.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/route.h>
-#include <net/netisr.h>
-
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/if_ether.h>
-
-#define SIN(s) ((struct sockaddr_in *)s)
-#define SDL(s) ((struct sockaddr_dl *)s)
-
-SYSCTL_NODE(_net_link_ether, PF_INET, inet, CTLFLAG_RW, 0, "");
-
-/* timer values */
-static int arpt_prune = (5*60*1); /* walk list every 5 minutes */
-static int arpt_keep = (20*60); /* once resolved, good for 20 more minutes */
-static int arpt_down = 20; /* once declared down, don't send for 20 sec */
-
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, prune_intvl, CTLFLAG_RW,
- &arpt_prune, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_RW,
- &arpt_keep, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, host_down_time, CTLFLAG_RW,
- &arpt_down, 0, "");
-
-#define rt_expire rt_rmx.rmx_expire
-
-struct llinfo_arp {
- LIST_ENTRY(llinfo_arp) la_le;
- struct rtentry *la_rt;
- struct mbuf *la_hold; /* last packet until resolved/timeout */
- long la_asked; /* last time we QUERIED for this addr */
-#define la_timer la_rt->rt_rmx.rmx_expire /* deletion time in seconds */
-};
-
-static LIST_HEAD(, llinfo_arp) llinfo_arp;
-
-struct ifqueue arpintrq = {0, 0, 0, 50};
-static int arp_inuse, arp_allocated;
-
-static int arp_maxtries = 5;
-static int useloopback = 1; /* use loopback interface for local traffic */
-static int arp_proxyall = 0;
-
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, maxtries, CTLFLAG_RW,
- &arp_maxtries, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, useloopback, CTLFLAG_RW,
- &useloopback, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, proxyall, CTLFLAG_RW,
- &arp_proxyall, 0, "");
-
-static void arp_rtrequest __P((int, struct rtentry *, struct sockaddr *));
-static void arprequest __P((struct arpcom *, u_long *, u_long *, u_char *));
-void arpintr __P((void));
-static void arptfree __P((struct llinfo_arp *));
-static void arptimer __P((void *));
-static struct llinfo_arp
- *arplookup __P((u_long, int, int));
-static void in_arpinput __P((struct mbuf *));
-
-/*
- * Timeout routine. Age arp_tab entries periodically.
- */
-/* ARGSUSED */
-static void
-arptimer(ignored_arg)
- void *ignored_arg;
-{
- int s = splnet();
- register struct llinfo_arp *la = llinfo_arp.lh_first;
- struct llinfo_arp *ola;
-
- timeout(arptimer, (caddr_t)0, arpt_prune * hz);
- while ((ola = la) != 0) {
- register struct rtentry *rt = la->la_rt;
- la = la->la_le.le_next;
- if (rt->rt_expire && rt->rt_expire <= rtems_bsdnet_seconds_since_boot())
- arptfree(ola); /* timer has expired, clear */
- }
- splx(s);
-}
-
-/*
- * Parallel to llc_rtrequest.
- */
-static void
-arp_rtrequest(req, rt, sa)
- int req;
- register struct rtentry *rt;
- struct sockaddr *sa;
-{
- register struct sockaddr *gate = rt->rt_gateway;
- register struct llinfo_arp *la = (struct llinfo_arp *)rt->rt_llinfo;
- static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK};
- static int arpinit_done;
-
- if (!arpinit_done) {
- arpinit_done = 1;
- LIST_INIT(&llinfo_arp);
- timeout(arptimer, (caddr_t)0, hz);
- }
- if (rt->rt_flags & RTF_GATEWAY)
- return;
- switch (req) {
-
- case RTM_ADD:
- /*
- * XXX: If this is a manually added route to interface
- * such as older version of routed or gated might provide,
- * restore cloning bit.
- */
- if ((rt->rt_flags & RTF_HOST) == 0 &&
- SIN(rt_mask(rt))->sin_addr.s_addr != 0xffffffff)
- rt->rt_flags |= RTF_CLONING;
- if (rt->rt_flags & RTF_CLONING) {
- /*
- * Case 1: This route should come from a route to iface.
- */
- rt_setgate(rt, rt_key(rt),
- (struct sockaddr *)&null_sdl);
- gate = rt->rt_gateway;
- SDL(gate)->sdl_type = rt->rt_ifp->if_type;
- SDL(gate)->sdl_index = rt->rt_ifp->if_index;
- rt->rt_expire = rtems_bsdnet_seconds_since_boot();
- break;
- }
- /* Announce a new entry if requested. */
- if (rt->rt_flags & RTF_ANNOUNCE)
- arprequest((struct arpcom *)rt->rt_ifp,
- &SIN(rt_key(rt))->sin_addr.s_addr,
- &SIN(rt_key(rt))->sin_addr.s_addr,
- (u_char *)LLADDR(SDL(gate)));
- /*FALLTHROUGH*/
- case RTM_RESOLVE:
- if (gate->sa_family != AF_LINK ||
- gate->sa_len < sizeof(null_sdl)) {
- log(LOG_DEBUG, "arp_rtrequest: bad gateway value\n");
- break;
- }
- SDL(gate)->sdl_type = rt->rt_ifp->if_type;
- SDL(gate)->sdl_index = rt->rt_ifp->if_index;
- if (la != 0)
- break; /* This happens on a route change */
- /*
- * Case 2: This route may come from cloning, or a manual route
- * add with a LL address.
- */
- R_Malloc(la, struct llinfo_arp *, sizeof(*la));
- rt->rt_llinfo = (caddr_t)la;
- if (la == 0) {
- log(LOG_DEBUG, "arp_rtrequest: malloc failed\n");
- break;
- }
- arp_inuse++, arp_allocated++;
- Bzero(la, sizeof(*la));
- la->la_rt = rt;
- rt->rt_flags |= RTF_LLINFO;
- LIST_INSERT_HEAD(&llinfo_arp, la, la_le);
-
- /*
- * This keeps the multicast addresses from showing up
- * in `arp -a' listings as unresolved. It's not actually
- * functional. Then the same for broadcast.
- */
- if (IN_MULTICAST(ntohl(SIN(rt_key(rt))->sin_addr.s_addr))) {
- ETHER_MAP_IP_MULTICAST(&SIN(rt_key(rt))->sin_addr,
- LLADDR(SDL(gate)));
- SDL(gate)->sdl_alen = 6;
- rt->rt_expire = 0;
- }
- if (in_broadcast(SIN(rt_key(rt))->sin_addr, rt->rt_ifp)) {
- memcpy(LLADDR(SDL(gate)), etherbroadcastaddr, 6);
- SDL(gate)->sdl_alen = 6;
- rt->rt_expire = 0;
- }
-
- if (SIN(rt_key(rt))->sin_addr.s_addr ==
- (IA_SIN(rt->rt_ifa))->sin_addr.s_addr) {
- /*
- * This test used to be
- * if (loif.if_flags & IFF_UP)
- * It allowed local traffic to be forced
- * through the hardware by configuring the loopback down.
- * However, it causes problems during network configuration
- * for boards that can't receive packets they send.
- * It is now necessary to clear "useloopback" and remove
- * the route to force traffic out to the hardware.
- */
- rt->rt_expire = 0;
- Bcopy(((struct arpcom *)rt->rt_ifp)->ac_enaddr,
- LLADDR(SDL(gate)), SDL(gate)->sdl_alen = 6);
- if (useloopback)
- rt->rt_ifp = loif;
-
- }
- break;
-
- case RTM_DELETE:
- if (la == 0)
- break;
- arp_inuse--;
- LIST_REMOVE(la, la_le);
- rt->rt_llinfo = 0;
- rt->rt_flags &= ~RTF_LLINFO;
- if (la->la_hold)
- m_freem(la->la_hold);
- Free((caddr_t)la);
- }
-}
-
-/*
- * Broadcast an ARP request. Caller specifies:
- * - arp header source ip address
- * - arp header target ip address
- * - arp header source ethernet address
- */
-static void
-arprequest(ac, sip, tip, enaddr)
- register struct arpcom *ac;
- register u_long *sip, *tip;
- register u_char *enaddr;
-{
- register struct mbuf *m;
- register struct ether_header *eh;
- register struct ether_arp *ea;
- struct sockaddr sa;
-
- if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL)
- return;
- m->m_len = sizeof(*ea);
- m->m_pkthdr.len = sizeof(*ea);
- MH_ALIGN(m, sizeof(*ea));
- ea = mtod(m, struct ether_arp *);
- eh = (struct ether_header *)sa.sa_data;
- bzero((caddr_t)ea, sizeof (*ea));
- (void)memcpy(eh->ether_dhost, etherbroadcastaddr, sizeof(eh->ether_dhost));
- eh->ether_type = htons(ETHERTYPE_ARP); /* if_output will not swap */
- ea->arp_hrd = htons(ARPHRD_ETHER);
- ea->arp_pro = htons(ETHERTYPE_IP);
- ea->arp_hln = sizeof(ea->arp_sha); /* hardware address length */
- ea->arp_pln = sizeof(ea->arp_spa); /* protocol address length */
- ea->arp_op = htons(ARPOP_REQUEST);
- (void)memcpy(ea->arp_sha, enaddr, sizeof(ea->arp_sha));
- (void)memcpy(ea->arp_spa, sip, sizeof(ea->arp_spa));
- (void)memcpy(ea->arp_tpa, tip, sizeof(ea->arp_tpa));
- sa.sa_family = AF_UNSPEC;
- sa.sa_len = sizeof(sa);
- (*ac->ac_if.if_output)(&ac->ac_if, m, &sa, (struct rtentry *)0);
-}
-
-/*
- * Resolve an IP address into an ethernet address. If success,
- * desten is filled in. If there is no entry in arptab,
- * set one up and broadcast a request for the IP address.
- * Hold onto this mbuf and resend it once the address
- * is finally resolved. A return value of 1 indicates
- * that desten has been filled in and the packet should be sent
- * normally; a 0 return indicates that the packet has been
- * taken over here, either now or for later transmission.
- */
-int
-arpresolve(ac, rt, m, dst, desten, rt0)
- register struct arpcom *ac;
- register struct rtentry *rt;
- struct mbuf *m;
- register struct sockaddr *dst;
- register u_char *desten;
- struct rtentry *rt0;
-{
- register struct llinfo_arp *la;
- struct sockaddr_dl *sdl;
-
- if (m->m_flags & M_BCAST) { /* broadcast */
- (void)memcpy(desten, etherbroadcastaddr, sizeof(etherbroadcastaddr));
- return (1);
- }
- if (m->m_flags & M_MCAST) { /* multicast */
- ETHER_MAP_IP_MULTICAST(&SIN(dst)->sin_addr, desten);
- return(1);
- }
- if (rt)
- la = (struct llinfo_arp *)rt->rt_llinfo;
- else {
- la = arplookup(SIN(dst)->sin_addr.s_addr, 1, 0);
- if (la)
- rt = la->la_rt;
- }
- if (la == 0 || rt == 0) {
- log(LOG_DEBUG, "arpresolve: can't allocate llinfo for %s\n",
- inet_ntoa(SIN(dst)->sin_addr));
- m_freem(m);
- return (0);
- }
- sdl = SDL(rt->rt_gateway);
- /*
- * Check the address family and length is valid, the address
- * is resolved; otherwise, try to resolve.
- */
- if ((rt->rt_expire == 0 || rt->rt_expire > rtems_bsdnet_seconds_since_boot()) &&
- sdl->sdl_family == AF_LINK && sdl->sdl_alen != 0) {
- bcopy(LLADDR(sdl), desten, sdl->sdl_alen);
- return 1;
- }
- /*
- * There is an arptab entry, but no ethernet address
- * response yet. Replace the held mbuf with this
- * latest one.
- */
- if (la->la_hold)
- m_freem(la->la_hold);
- la->la_hold = m;
- if (rt->rt_expire) {
- rt->rt_flags &= ~RTF_REJECT;
- if (la->la_asked == 0 || rt->rt_expire != rtems_bsdnet_seconds_since_boot()) {
- rt->rt_expire = rtems_bsdnet_seconds_since_boot();
- if (la->la_asked++ < arp_maxtries)
- arprequest(ac,
- &(SIN(rt->rt_ifa->ifa_addr)->sin_addr.s_addr),
- &(SIN(dst)->sin_addr.s_addr),
- ac->ac_enaddr);
- else {
- rt->rt_flags |= RTF_REJECT;
- rt->rt_expire += arpt_down;
- la->la_asked = 0;
- }
-
- }
- }
- return (0);
-}
-
-/*
- * Common length and type checks are done here,
- * then the protocol-specific routine is called.
- */
-void
-arpintr(void)
-{
- register struct mbuf *m;
- register struct arphdr *ar;
- int s;
-
- while (arpintrq.ifq_head) {
- s = splimp();
- IF_DEQUEUE(&arpintrq, m);
- splx(s);
- if (m == 0 || (m->m_flags & M_PKTHDR) == 0)
- panic("arpintr");
- if (m->m_len >= sizeof(struct arphdr) &&
- (ar = mtod(m, struct arphdr *)) &&
- ntohs(ar->ar_hrd) == ARPHRD_ETHER &&
- m->m_len >=
- sizeof(struct arphdr) + 2 * ar->ar_hln + 2 * ar->ar_pln)
-
- switch (ntohs(ar->ar_pro)) {
-
- case ETHERTYPE_IP:
- in_arpinput(m);
- continue;
- }
- m_freem(m);
- }
-}
-
-NETISR_SET(NETISR_ARP, arpintr);
-
-/*
- * ARP for Internet protocols on 10 Mb/s Ethernet.
- * Algorithm is that given in RFC 826.
- * In addition, a sanity check is performed on the sender
- * protocol address, to catch impersonators.
- * We no longer handle negotiations for use of trailer protocol:
- * Formerly, ARP replied for protocol type ETHERTYPE_TRAIL sent
- * along with IP replies if we wanted trailers sent to us,
- * and also sent them in response to IP replies.
- * This allowed either end to announce the desire to receive
- * trailer packets.
- * We no longer reply to requests for ETHERTYPE_TRAIL protocol either,
- * but formerly didn't normally send requests.
- */
-static void
-in_arpinput(m)
- struct mbuf *m;
-{
- register struct ether_arp *ea;
- register struct arpcom *ac = (struct arpcom *)m->m_pkthdr.rcvif;
- struct ether_header *eh;
- register struct llinfo_arp *la = 0;
- register struct rtentry *rt;
- struct in_ifaddr *ia, *maybe_ia = 0;
- struct sockaddr_dl *sdl;
- struct sockaddr sa;
- struct in_addr isaddr, itaddr, myaddr;
- int op;
-
- ea = mtod(m, struct ether_arp *);
- op = ntohs(ea->arp_op);
- (void)memcpy(&isaddr, ea->arp_spa, sizeof (isaddr));
- (void)memcpy(&itaddr, ea->arp_tpa, sizeof (itaddr));
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if (ia->ia_ifp == &ac->ac_if) {
- maybe_ia = ia;
- if ((itaddr.s_addr == ia->ia_addr.sin_addr.s_addr) ||
- (isaddr.s_addr == ia->ia_addr.sin_addr.s_addr))
- break;
- }
- if (maybe_ia == 0) {
- m_freem(m);
- return;
- }
- myaddr = ia ? ia->ia_addr.sin_addr : maybe_ia->ia_addr.sin_addr;
- if (!bcmp((caddr_t)ea->arp_sha, (caddr_t)ac->ac_enaddr,
- sizeof (ea->arp_sha))) {
- m_freem(m); /* it's from me, ignore it. */
- return;
- }
- if (!bcmp((caddr_t)ea->arp_sha, (caddr_t)etherbroadcastaddr,
- sizeof (ea->arp_sha))) {
- log(LOG_ERR,
- "arp: ether address is broadcast for IP address %s!\n",
- inet_ntoa(isaddr));
- m_freem(m);
- return;
- }
- if (isaddr.s_addr == myaddr.s_addr) {
- log(LOG_ERR,
- "arp: %6D is using my IP address %s!\n",
- ea->arp_sha, ":", inet_ntoa(isaddr));
- itaddr = myaddr;
- goto reply;
- }
- la = arplookup(isaddr.s_addr, itaddr.s_addr == myaddr.s_addr, 0);
- if (la && (rt = la->la_rt) && (sdl = SDL(rt->rt_gateway))) {
- if (sdl->sdl_alen &&
- bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen))
- log(LOG_INFO, "arp: %s moved from %6D to %6D\n",
- inet_ntoa(isaddr), (u_char *)LLADDR(sdl), ":",
- ea->arp_sha, ":");
- (void)memcpy(LLADDR(sdl), ea->arp_sha, sizeof(ea->arp_sha));
- sdl->sdl_alen = sizeof(ea->arp_sha);
- if (rt->rt_expire)
- rt->rt_expire = rtems_bsdnet_seconds_since_boot() + arpt_keep;
- rt->rt_flags &= ~RTF_REJECT;
- la->la_asked = 0;
- if (la->la_hold) {
- (*ac->ac_if.if_output)(&ac->ac_if, la->la_hold,
- rt_key(rt), rt);
- la->la_hold = 0;
- }
- }
-reply:
- if (op != ARPOP_REQUEST) {
- m_freem(m);
- return;
- }
- if (itaddr.s_addr == myaddr.s_addr) {
- /* I am the target */
- (void)memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha));
- (void)memcpy(ea->arp_sha, ac->ac_enaddr, sizeof(ea->arp_sha));
- } else {
- la = arplookup(itaddr.s_addr, 0, SIN_PROXY);
- if (la == NULL) {
- struct sockaddr_in sin;
-
- if (!arp_proxyall) {
- m_freem(m);
- return;
- }
-
- bzero(&sin, sizeof sin);
- sin.sin_family = AF_INET;
- sin.sin_len = sizeof sin;
- sin.sin_addr = itaddr;
-
- rt = rtalloc1((struct sockaddr *)&sin, 0, 0UL);
- if (!rt) {
- m_freem(m);
- return;
- }
- /*
- * Don't send proxies for nodes on the same interface
- * as this one came out of, or we'll get into a fight
- * over who claims what Ether address.
- */
- if (rt->rt_ifp == &ac->ac_if) {
- rtfree(rt);
- m_freem(m);
- return;
- }
- (void)memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha));
- (void)memcpy(ea->arp_sha, ac->ac_enaddr, sizeof(ea->arp_sha));
- rtfree(rt);
-#ifdef DEBUG_PROXY
- printf("arp: proxying for %s\n",
- inet_ntoa(itaddr));
-#endif
- } else {
- rt = la->la_rt;
- (void)memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha));
- sdl = SDL(rt->rt_gateway);
- (void)memcpy(ea->arp_sha, LLADDR(sdl), sizeof(ea->arp_sha));
- }
- }
-
- (void)memcpy(ea->arp_tpa, ea->arp_spa, sizeof(ea->arp_spa));
- (void)memcpy(ea->arp_spa, &itaddr, sizeof(ea->arp_spa));
- ea->arp_op = htons(ARPOP_REPLY);
- ea->arp_pro = htons(ETHERTYPE_IP); /* let's be sure! */
- eh = (struct ether_header *)sa.sa_data;
- (void)memcpy(eh->ether_dhost, ea->arp_tha, sizeof(eh->ether_dhost));
- eh->ether_type = htons(ETHERTYPE_ARP);
- sa.sa_family = AF_UNSPEC;
- sa.sa_len = sizeof(sa);
- (*ac->ac_if.if_output)(&ac->ac_if, m, &sa, (struct rtentry *)0);
- return;
-}
-
-/*
- * Free an arp entry.
- */
-static void
-arptfree(la)
- register struct llinfo_arp *la;
-{
- register struct rtentry *rt = la->la_rt;
- register struct sockaddr_dl *sdl;
- if (rt == 0)
- panic("arptfree");
- if (rt->rt_refcnt > 0 && (sdl = SDL(rt->rt_gateway)) &&
- sdl->sdl_family == AF_LINK) {
- sdl->sdl_alen = 0;
- la->la_asked = 0;
- rt->rt_flags &= ~RTF_REJECT;
- return;
- }
- rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *)0, rt_mask(rt),
- 0, (struct rtentry **)0);
-}
-/*
- * Lookup or enter a new address in arptab.
- */
-static struct llinfo_arp *
-arplookup(addr, create, proxy)
- u_long addr;
- int create, proxy;
-{
- register struct rtentry *rt;
- static struct sockaddr_inarp sin = {sizeof(sin), AF_INET };
- const char *why = 0;
-
- sin.sin_addr.s_addr = addr;
- sin.sin_other = proxy ? SIN_PROXY : 0;
- rt = rtalloc1((struct sockaddr *)&sin, create, 0UL);
- if (rt == 0)
- return (0);
- rt->rt_refcnt--;
-
- if (rt->rt_flags & RTF_GATEWAY)
- why = "host is not on local network";
- else if ((rt->rt_flags & RTF_LLINFO) == 0)
- why = "could not allocate llinfo";
- else if (rt->rt_gateway->sa_family != AF_LINK)
- why = "gateway route is not ours";
-
- if (why && create) {
- log(LOG_DEBUG, "arplookup %s failed: %s\n",
- inet_ntoa(sin.sin_addr), why);
- return 0;
- } else if (why) {
- return 0;
- }
- return ((struct llinfo_arp *)rt->rt_llinfo);
-}
-
-void
-arp_ifinit(ac, ifa)
- struct arpcom *ac;
- struct ifaddr *ifa;
-{
- if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) != INADDR_ANY)
- arprequest(ac, &(IA_SIN(ifa)->sin_addr.s_addr),
- &(IA_SIN(ifa)->sin_addr.s_addr), ac->ac_enaddr);
- ifa->ifa_rtrequest = arp_rtrequest;
- ifa->ifa_flags |= RTF_CLONING;
-}
diff --git a/c/src/exec/libnetworking/netinet/if_ether.h b/c/src/exec/libnetworking/netinet/if_ether.h
deleted file mode 100644
index 22c8e97187..0000000000
--- a/c/src/exec/libnetworking/netinet/if_ether.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)if_ether.h 8.3 (Berkeley) 5/2/95
- * $Id$
- */
-
-#ifndef _NETINET_IF_ETHER_H_
-#define _NETINET_IF_ETHER_H_
-
-#include <net/ethernet.h>
-
-#define ETHERTYPE_PUP 0x0200 /* PUP protocol */
-#define ETHERTYPE_IP 0x0800 /* IP protocol */
-#define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */
-#define ETHERTYPE_REVARP 0x8035 /* reverse Addr. resolution protocol */
-
-/*
- * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
- * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
- * by an ETHER type (as given above) and then the (variable-length) header.
- */
-#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
-#define ETHERTYPE_NTRAILER 16
-
-#define ETHERMTU (ETHER_MAX_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-#define ETHERMIN (ETHER_MIN_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-
-#ifdef KERNEL
-/*
- * Macro to map an IP multicast address to an Ethernet multicast address.
- * The high-order 25 bits of the Ethernet address are statically assigned,
- * and the low-order 23 bits are taken from the low end of the IP address.
- */
-#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
- /* struct in_addr *ipaddr; */ \
- /* u_char enaddr[ETHER_ADDR_LEN]; */ \
-{ \
- (enaddr)[0] = 0x01; \
- (enaddr)[1] = 0x00; \
- (enaddr)[2] = 0x5e; \
- (enaddr)[3] = ((u_char *)ipaddr)[1] & 0x7f; \
- (enaddr)[4] = ((u_char *)ipaddr)[2]; \
- (enaddr)[5] = ((u_char *)ipaddr)[3]; \
-}
-#endif
-
-/*
- * Ethernet Address Resolution Protocol.
- *
- * See RFC 826 for protocol description. Structure below is adapted
- * to resolving internet addresses. Field names used correspond to
- * RFC 826.
- */
-struct ether_arp {
- struct arphdr ea_hdr; /* fixed-size header */
- u_char arp_sha[ETHER_ADDR_LEN]; /* sender hardware address */
- u_char arp_spa[4]; /* sender protocol address */
- u_char arp_tha[ETHER_ADDR_LEN]; /* target hardware address */
- u_char arp_tpa[4]; /* target protocol address */
-};
-#define arp_hrd ea_hdr.ar_hrd
-#define arp_pro ea_hdr.ar_pro
-#define arp_hln ea_hdr.ar_hln
-#define arp_pln ea_hdr.ar_pln
-#define arp_op ea_hdr.ar_op
-
-
-/*
- * Structure shared between the ethernet driver modules and
- * the address resolution code. For example, each ec_softc or il_softc
- * begins with this structure.
- */
-struct arpcom {
- /*
- * The ifnet struct _must_ be at the head of this structure.
- */
- struct ifnet ac_if; /* network-visible interface */
- u_char ac_enaddr[ETHER_ADDR_LEN]; /* ethernet hardware address */
- struct ether_multi *ac_multiaddrs; /* list of ether multicast addrs */
- int ac_multicnt; /* length of ac_multiaddrs list */
-};
-
-struct sockaddr_inarp {
- u_char sin_len;
- u_char sin_family;
- u_short sin_port;
- struct in_addr sin_addr;
- struct in_addr sin_srcaddr;
- u_short sin_tos;
- u_short sin_other;
-#define SIN_PROXY 1
-};
-/*
- * IP and ethernet specific routing flags
- */
-#define RTF_USETRAILERS RTF_PROTO1 /* use trailers */
-#define RTF_ANNOUNCE RTF_PROTO2 /* announce new arp entry */
-
-#ifdef KERNEL
-extern u_char etherbroadcastaddr[ETHER_ADDR_LEN];
-extern u_char ether_ipmulticast_min[ETHER_ADDR_LEN];
-extern u_char ether_ipmulticast_max[ETHER_ADDR_LEN];
-extern struct ifqueue arpintrq;
-
-int arpresolve __P((struct arpcom *, struct rtentry *, struct mbuf *,
- struct sockaddr *, u_char *, struct rtentry *));
-void arp_ifinit __P((struct arpcom *, struct ifaddr *));
-int ether_addmulti __P((struct ifreq *, struct arpcom *));
-int ether_delmulti __P((struct ifreq *, struct arpcom *));
-
-/*
- * Ethernet multicast address structure. There is one of these for each
- * multicast address or range of multicast addresses that we are supposed
- * to listen to on a particular interface. They are kept in a linked list,
- * rooted in the interface's arpcom structure. (This really has nothing to
- * do with ARP, or with the Internet address family, but this appears to be
- * the minimally-disrupting place to put it.)
- */
-struct ether_multi {
- u_char enm_addrlo[ETHER_ADDR_LEN]; /* low or only address of range */
- u_char enm_addrhi[ETHER_ADDR_LEN]; /* high or only address of range */
- struct arpcom *enm_ac; /* back pointer to arpcom */
- u_int enm_refcount; /* no. claims to this addr/range */
- struct ether_multi *enm_next; /* ptr to next ether_multi */
-};
-
-/*
- * Structure used by macros below to remember position when stepping through
- * all of the ether_multi records.
- */
-struct ether_multistep {
- struct ether_multi *e_enm;
-};
-
-/*
- * Macro for looking up the ether_multi record for a given range of Ethernet
- * multicast addresses connected to a given arpcom structure. If no matching
- * record is found, "enm" returns NULL.
- */
-#define ETHER_LOOKUP_MULTI(addrlo, addrhi, ac, enm) \
- /* u_char addrlo[ETHER_ADDR_LEN]; */ \
- /* u_char addrhi[ETHER_ADDR_LEN]; */ \
- /* struct arpcom *ac; */ \
- /* struct ether_multi *enm; */ \
-{ \
- for ((enm) = (ac)->ac_multiaddrs; \
- (enm) != NULL && \
- (bcmp((enm)->enm_addrlo, (addrlo), ETHER_ADDR_LEN) != 0 || \
- bcmp((enm)->enm_addrhi, (addrhi), ETHER_ADDR_LEN) != 0); \
- (enm) = (enm)->enm_next); \
-}
-
-/*
- * Macro to step through all of the ether_multi records, one at a time.
- * The current position is remembered in "step", which the caller must
- * provide. ETHER_FIRST_MULTI(), below, must be called to initialize "step"
- * and get the first record. Both macros return a NULL "enm" when there
- * are no remaining records.
- */
-#define ETHER_NEXT_MULTI(step, enm) \
- /* struct ether_multistep step; */ \
- /* struct ether_multi *enm; */ \
-{ \
- if (((enm) = (step).e_enm) != NULL) \
- (step).e_enm = (enm)->enm_next; \
-}
-
-#define ETHER_FIRST_MULTI(step, ac, enm) \
- /* struct ether_multistep step; */ \
- /* struct arpcom *ac; */ \
- /* struct ether_multi *enm; */ \
-{ \
- (step).e_enm = (ac)->ac_multiaddrs; \
- ETHER_NEXT_MULTI((step), (enm)); \
-}
-
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/netinet/igmp.c b/c/src/exec/libnetworking/netinet/igmp.c
deleted file mode 100644
index 2af8b7038e..0000000000
--- a/c/src/exec/libnetworking/netinet/igmp.c
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * Copyright (c) 1988 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)igmp.c 8.1 (Berkeley) 7/19/93
- * $Id$
- */
-
-/*
- * Internet Group Management Protocol (IGMP) routines.
- *
- * Written by Steve Deering, Stanford, May 1988.
- * Modified by Rosen Sharma, Stanford, Aug 1994.
- * Modified by Bill Fenner, Xerox PARC, Feb 1995.
- * Modified to fully comply to IGMPv2 by Bill Fenner, Oct 1995.
- *
- * MULTICAST Revision: 3.5.1.4
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/igmp.h>
-#include <netinet/igmp_var.h>
-
-static struct router_info *
- find_rti __P((struct ifnet *ifp));
-
-static struct igmpstat igmpstat;
-
-SYSCTL_STRUCT(_net_inet_igmp, IGMPCTL_STATS, stats, CTLFLAG_RD,
- &igmpstat, igmpstat, "");
-
-static int igmp_timers_are_running;
-static u_long igmp_all_hosts_group;
-static u_long igmp_all_rtrs_group;
-static struct mbuf *router_alert;
-static struct router_info *Head;
-
-static void igmp_sendpkt(struct in_multi *, int, unsigned long);
-
-void
-igmp_init()
-{
- struct ipoption *ra;
-
- /*
- * To avoid byte-swapping the same value over and over again.
- */
- igmp_all_hosts_group = htonl(INADDR_ALLHOSTS_GROUP);
- igmp_all_rtrs_group = htonl(INADDR_ALLRTRS_GROUP);
-
- igmp_timers_are_running = 0;
-
- /*
- * Construct a Router Alert option to use in outgoing packets
- */
- MGET(router_alert, M_DONTWAIT, MT_DATA);
- ra = mtod(router_alert, struct ipoption *);
- ra->ipopt_dst.s_addr = 0;
- ra->ipopt_list[0] = IPOPT_RA; /* Router Alert Option */
- ra->ipopt_list[1] = 0x04; /* 4 bytes long */
- ra->ipopt_list[2] = 0x00;
- ra->ipopt_list[3] = 0x00;
- router_alert->m_len = sizeof(ra->ipopt_dst) + ra->ipopt_list[1];
-
- Head = (struct router_info *) 0;
-}
-
-static struct router_info *
-find_rti(ifp)
- struct ifnet *ifp;
-{
- register struct router_info *rti = Head;
-
-#ifdef IGMP_DEBUG
- printf("[igmp.c, _find_rti] --> entering \n");
-#endif
- while (rti) {
- if (rti->rti_ifp == ifp) {
-#ifdef IGMP_DEBUG
- printf("[igmp.c, _find_rti] --> found old entry \n");
-#endif
- return rti;
- }
- rti = rti->rti_next;
- }
- MALLOC(rti, struct router_info *, sizeof *rti, M_MRTABLE, M_NOWAIT);
- rti->rti_ifp = ifp;
- rti->rti_type = IGMP_V2_ROUTER;
- rti->rti_time = 0;
- rti->rti_next = Head;
- Head = rti;
-#ifdef IGMP_DEBUG
- printf("[igmp.c, _find_rti] --> created an entry \n");
-#endif
- return rti;
-}
-
-void
-igmp_input(m, iphlen)
- register struct mbuf *m;
- register int iphlen;
-{
- register struct igmp *igmp;
- register struct ip *ip;
- register int igmplen;
- register struct ifnet *ifp = m->m_pkthdr.rcvif;
- register int minlen;
- register struct in_multi *inm;
- register struct in_ifaddr *ia;
- struct in_multistep step;
- struct router_info *rti;
-
- int timer; /** timer value in the igmp query header **/
-
- ++igmpstat.igps_rcv_total;
-
- ip = mtod(m, struct ip *);
- igmplen = ip->ip_len;
-
- /*
- * Validate lengths
- */
- if (igmplen < IGMP_MINLEN) {
- ++igmpstat.igps_rcv_tooshort;
- m_freem(m);
- return;
- }
- minlen = iphlen + IGMP_MINLEN;
- if ((m->m_flags & M_EXT || m->m_len < minlen) &&
- (m = m_pullup(m, minlen)) == 0) {
- ++igmpstat.igps_rcv_tooshort;
- return;
- }
-
- /*
- * Validate checksum
- */
- m->m_data += iphlen;
- m->m_len -= iphlen;
- igmp = mtod(m, struct igmp *);
- if (in_cksum(m, igmplen)) {
- ++igmpstat.igps_rcv_badsum;
- m_freem(m);
- return;
- }
- m->m_data -= iphlen;
- m->m_len += iphlen;
-
- ip = mtod(m, struct ip *);
- timer = igmp->igmp_code * PR_FASTHZ / IGMP_TIMER_SCALE;
- rti = find_rti(ifp);
-
- /*
- * In the IGMPv2 specification, there are 3 states and a flag.
- *
- * In Non-Member state, we simply don't have a membership record.
- * In Delaying Member state, our timer is running (inm->inm_timer)
- * In Idle Member state, our timer is not running (inm->inm_timer==0)
- *
- * The flag is inm->inm_state, it is set to IGMP_OTHERMEMBER if
- * we have heard a report from another member, or IGMP_IREPORTEDLAST
- * if I sent the last report.
- */
- switch (igmp->igmp_type) {
-
- case IGMP_MEMBERSHIP_QUERY:
- ++igmpstat.igps_rcv_queries;
-
- if (ifp->if_flags & IFF_LOOPBACK)
- break;
-
- if (igmp->igmp_code == 0) {
- /*
- * Old router. Remember that the querier on this
- * interface is old, and set the timer to the
- * value in RFC 1112.
- */
-
- rti->rti_type = IGMP_V1_ROUTER;
- rti->rti_time = 0;
-
- timer = IGMP_MAX_HOST_REPORT_DELAY * PR_FASTHZ;
-
- if (ip->ip_dst.s_addr != igmp_all_hosts_group ||
- igmp->igmp_group.s_addr != 0) {
- ++igmpstat.igps_rcv_badqueries;
- m_freem(m);
- return;
- }
- } else {
- /*
- * New router. Simply do the new validity check.
- */
-
- if (igmp->igmp_group.s_addr != 0 &&
- !IN_MULTICAST(ntohl(igmp->igmp_group.s_addr))) {
- ++igmpstat.igps_rcv_badqueries;
- m_freem(m);
- return;
- }
- }
-
- /*
- * - Start the timers in all of our membership records
- * that the query applies to for the interface on
- * which the query arrived excl. those that belong
- * to the "all-hosts" group (224.0.0.1).
- * - Restart any timer that is already running but has
- * a value longer than the requested timeout.
- * - Use the value specified in the query message as
- * the maximum timeout.
- */
- IN_FIRST_MULTI(step, inm);
- while (inm != NULL) {
- if (inm->inm_ifp == ifp &&
- inm->inm_addr.s_addr != igmp_all_hosts_group &&
- (igmp->igmp_group.s_addr == 0 ||
- igmp->igmp_group.s_addr == inm->inm_addr.s_addr)) {
- if (inm->inm_timer == 0 ||
- inm->inm_timer > timer) {
- inm->inm_timer =
- IGMP_RANDOM_DELAY(timer);
- igmp_timers_are_running = 1;
- }
- }
- IN_NEXT_MULTI(step, inm);
- }
-
- break;
-
- case IGMP_V1_MEMBERSHIP_REPORT:
- case IGMP_V2_MEMBERSHIP_REPORT:
- /*
- * For fast leave to work, we have to know that we are the
- * last person to send a report for this group. Reports
- * can potentially get looped back if we are a multicast
- * router, so discard reports sourced by me.
- */
- IFP_TO_IA(ifp, ia);
- if (ia && ip->ip_src.s_addr == IA_SIN(ia)->sin_addr.s_addr)
- break;
-
- ++igmpstat.igps_rcv_reports;
-
- if (ifp->if_flags & IFF_LOOPBACK)
- break;
-
- if (!IN_MULTICAST(ntohl(igmp->igmp_group.s_addr))) {
- ++igmpstat.igps_rcv_badreports;
- m_freem(m);
- return;
- }
-
- /*
- * KLUDGE: if the IP source address of the report has an
- * unspecified (i.e., zero) subnet number, as is allowed for
- * a booting host, replace it with the correct subnet number
- * so that a process-level multicast routing demon can
- * determine which subnet it arrived from. This is necessary
- * to compensate for the lack of any way for a process to
- * determine the arrival interface of an incoming packet.
- */
- if ((ntohl(ip->ip_src.s_addr) & IN_CLASSA_NET) == 0)
- if (ia) ip->ip_src.s_addr = htonl(ia->ia_subnet);
-
- /*
- * If we belong to the group being reported, stop
- * our timer for that group.
- */
- IN_LOOKUP_MULTI(igmp->igmp_group, ifp, inm);
-
- if (inm != NULL) {
- inm->inm_timer = 0;
- ++igmpstat.igps_rcv_ourreports;
-
- inm->inm_state = IGMP_OTHERMEMBER;
- }
-
- break;
- }
-
- /*
- * Pass all valid IGMP packets up to any process(es) listening
- * on a raw IGMP socket.
- */
- rip_input(m, iphlen);
-}
-
-void
-igmp_joingroup(inm)
- struct in_multi *inm;
-{
- int s = splnet();
-
- if (inm->inm_addr.s_addr == igmp_all_hosts_group
- || inm->inm_ifp->if_flags & IFF_LOOPBACK) {
- inm->inm_timer = 0;
- inm->inm_state = IGMP_OTHERMEMBER;
- } else {
- inm->inm_rti = find_rti(inm->inm_ifp);
- igmp_sendpkt(inm, inm->inm_rti->rti_type, 0);
- inm->inm_timer = IGMP_RANDOM_DELAY(
- IGMP_MAX_HOST_REPORT_DELAY*PR_FASTHZ);
- inm->inm_state = IGMP_IREPORTEDLAST;
- igmp_timers_are_running = 1;
- }
- splx(s);
-}
-
-void
-igmp_leavegroup(inm)
- struct in_multi *inm;
-{
- if (inm->inm_state == IGMP_IREPORTEDLAST &&
- inm->inm_addr.s_addr != igmp_all_hosts_group &&
- !(inm->inm_ifp->if_flags & IFF_LOOPBACK) &&
- inm->inm_rti->rti_type != IGMP_V1_ROUTER)
- igmp_sendpkt(inm, IGMP_V2_LEAVE_GROUP, igmp_all_rtrs_group);
-}
-
-void
-igmp_fasttimo()
-{
- register struct in_multi *inm;
- struct in_multistep step;
- int s;
-
- /*
- * Quick check to see if any work needs to be done, in order
- * to minimize the overhead of fasttimo processing.
- */
-
- if (!igmp_timers_are_running)
- return;
-
- s = splnet();
- igmp_timers_are_running = 0;
- IN_FIRST_MULTI(step, inm);
- while (inm != NULL) {
- if (inm->inm_timer == 0) {
- /* do nothing */
- } else if (--inm->inm_timer == 0) {
- igmp_sendpkt(inm, inm->inm_rti->rti_type, 0);
- inm->inm_state = IGMP_IREPORTEDLAST;
- } else {
- igmp_timers_are_running = 1;
- }
- IN_NEXT_MULTI(step, inm);
- }
- splx(s);
-}
-
-void
-igmp_slowtimo()
-{
- int s = splnet();
- register struct router_info *rti = Head;
-
-#ifdef IGMP_DEBUG
- printf("[igmp.c,_slowtimo] -- > entering \n");
-#endif
- while (rti) {
- if (rti->rti_type == IGMP_V1_ROUTER) {
- rti->rti_time++;
- if (rti->rti_time >= IGMP_AGE_THRESHOLD) {
- rti->rti_type = IGMP_V2_ROUTER;
- }
- }
- rti = rti->rti_next;
- }
-#ifdef IGMP_DEBUG
- printf("[igmp.c,_slowtimo] -- > exiting \n");
-#endif
- splx(s);
-}
-
-static struct route igmprt;
-
-static void
-igmp_sendpkt(inm, type, addr)
- struct in_multi *inm;
- int type;
- unsigned long addr;
-{
- struct mbuf *m;
- struct igmp *igmp;
- struct ip *ip;
- struct ip_moptions imo;
-
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- return;
-
- m->m_pkthdr.rcvif = loif;
- m->m_pkthdr.len = sizeof(struct ip) + IGMP_MINLEN;
- MH_ALIGN(m, IGMP_MINLEN + sizeof(struct ip));
- m->m_data += sizeof(struct ip);
- m->m_len = IGMP_MINLEN;
- igmp = mtod(m, struct igmp *);
- igmp->igmp_type = type;
- igmp->igmp_code = 0;
- igmp->igmp_group = inm->inm_addr;
- igmp->igmp_cksum = 0;
- igmp->igmp_cksum = in_cksum(m, IGMP_MINLEN);
-
- m->m_data -= sizeof(struct ip);
- m->m_len += sizeof(struct ip);
- ip = mtod(m, struct ip *);
- ip->ip_tos = 0;
- ip->ip_len = sizeof(struct ip) + IGMP_MINLEN;
- ip->ip_off = 0;
- ip->ip_p = IPPROTO_IGMP;
- ip->ip_src.s_addr = INADDR_ANY;
- ip->ip_dst.s_addr = addr ? addr : igmp->igmp_group.s_addr;
-
- imo.imo_multicast_ifp = inm->inm_ifp;
- imo.imo_multicast_ttl = 1;
- imo.imo_multicast_vif = -1;
- /*
- * Request loopback of the report if we are acting as a multicast
- * router, so that the process-level routing demon can hear it.
- */
- imo.imo_multicast_loop = (ip_mrouter != NULL);
-
- /*
- * XXX
- * Do we have to worry about reentrancy here? Don't think so.
- */
- ip_output(m, router_alert, &igmprt, 0, &imo);
-
- ++igmpstat.igps_snd_reports;
-}
diff --git a/c/src/exec/libnetworking/netinet/igmp.h b/c/src/exec/libnetworking/netinet/igmp.h
deleted file mode 100644
index 01d6d09179..0000000000
--- a/c/src/exec/libnetworking/netinet/igmp.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 1988 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)igmp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IGMP_H_
-#define _NETINET_IGMP_H_
-
-/*
- * Internet Group Management Protocol (IGMP) definitions.
- *
- * Written by Steve Deering, Stanford, May 1988.
- *
- * MULTICAST Revision: 3.5.1.2
- */
-
-/*
- * IGMP packet format.
- */
-struct igmp {
- u_char igmp_type; /* version & type of IGMP message */
- u_char igmp_code; /* subtype for routing msgs */
- u_short igmp_cksum; /* IP-style checksum */
- struct in_addr igmp_group; /* group address being reported */
-}; /* (zero for queries) */
-
-#define IGMP_MINLEN 8
-
-/*
- * Message types, including version number.
- */
-#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */
-#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */
-#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */
-#define IGMP_V2_LEAVE_GROUP 0x17 /* Leave-group message */
-
-#define IGMP_DVMRP 0x13 /* DVMRP routing message */
-#define IGMP_PIM 0x14 /* PIM routing message */
-
-#define IGMP_MTRACE_RESP 0x1e /* traceroute resp.(to sender)*/
-#define IGMP_MTRACE 0x1f /* mcast traceroute messages */
-
-#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
- /* query (in seconds) according */
- /* to RFC1112 */
-
-
-#define IGMP_TIMER_SCALE 10 /* denotes that the igmp code field */
- /* specifies time in 10th of seconds*/
-
-/*
- * The following four defininitions are for backwards compatibility.
- * They should be removed as soon as all applications are updated to
- * use the new constant names.
- */
-#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
-#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
-#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
-#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
-
-#endif /* _NETINET_IGMP_H_ */
diff --git a/c/src/exec/libnetworking/netinet/igmp_var.h b/c/src/exec/libnetworking/netinet/igmp_var.h
deleted file mode 100644
index f408bf2bc1..0000000000
--- a/c/src/exec/libnetworking/netinet/igmp_var.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 1988 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)igmp_var.h 8.1 (Berkeley) 7/19/93
- * $Id$
- */
-
-#ifndef _NETINET_IGMP_VAR_H_
-#define _NETINET_IGMP_VAR_H_
-
-/*
- * Internet Group Management Protocol (IGMP),
- * implementation-specific definitions.
- *
- * Written by Steve Deering, Stanford, May 1988.
- *
- * MULTICAST Revision: 3.5.1.3
- */
-
-struct igmpstat {
- u_int igps_rcv_total; /* total IGMP messages received */
- u_int igps_rcv_tooshort; /* received with too few bytes */
- u_int igps_rcv_badsum; /* received with bad checksum */
- u_int igps_rcv_queries; /* received membership queries */
- u_int igps_rcv_badqueries; /* received invalid queries */
- u_int igps_rcv_reports; /* received membership reports */
- u_int igps_rcv_badreports; /* received invalid reports */
- u_int igps_rcv_ourreports; /* received reports for our groups */
- u_int igps_snd_reports; /* sent membership reports */
-};
-
-#ifdef KERNEL
-extern struct igmpstat igmpstat;
-
-#define IGMP_RANDOM_DELAY(X) (random() % (X) + 1)
-
-/*
- * States for IGMPv2's leave processing
- */
-#define IGMP_OTHERMEMBER 0
-#define IGMP_IREPORTEDLAST 1
-
-/*
- * We must remember what version the subnet's querier is.
- * We conveniently use the IGMP message type for the proper
- * membership report to keep this state.
- */
-#define IGMP_V1_ROUTER IGMP_V1_MEMBERSHIP_REPORT
-#define IGMP_V2_ROUTER IGMP_V2_MEMBERSHIP_REPORT
-
-/*
- * Revert to new router if we haven't heard from an old router in
- * this amount of time.
- */
-#define IGMP_AGE_THRESHOLD 540
-
-void igmp_init __P((void));
-void igmp_input __P((struct mbuf *, int));
-void igmp_joingroup __P((struct in_multi *));
-void igmp_leavegroup __P((struct in_multi *));
-void igmp_fasttimo __P((void));
-void igmp_slowtimo __P((void));
-#endif
-
-/*
- * Names for IGMP sysctl objects
- */
-#define IGMPCTL_STATS 1 /* statistics (read-only) */
-#define IGMPCTL_MAXID 2
-
-#define IGMPCTL_NAMES { \
- { 0, 0 }, \
- { "stats", CTLTYPE_STRUCT }, \
-}
-
-#endif
-
-
diff --git a/c/src/exec/libnetworking/netinet/in.c b/c/src/exec/libnetworking/netinet/in.c
deleted file mode 100644
index 701406f207..0000000000
--- a/c/src/exec/libnetworking/netinet/in.c
+++ /dev/null
@@ -1,728 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1991, 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.c 8.4 (Berkeley) 1/9/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/malloc.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/if_ether.h>
-
-#include <netinet/igmp_var.h>
-
-/*
- * This structure is used to keep track of in_multi chains which belong to
- * deleted interface addresses.
- */
-static LIST_HEAD(, multi_kludge) in_mk; /* XXX BSS initialization */
-
-struct multi_kludge {
- LIST_ENTRY(multi_kludge) mk_entry;
- struct ifnet *mk_ifp;
- struct in_multihead mk_head;
-};
-
-static void in_socktrim __P((struct sockaddr_in *));
-static int in_ifinit __P((struct ifnet *,
- struct in_ifaddr *, struct sockaddr_in *, int));
-static void in_ifscrub __P((struct ifnet *, struct in_ifaddr *));
-
-static int subnetsarelocal = 0;
-SYSCTL_INT(_net_inet_ip, OID_AUTO, subnets_are_local, CTLFLAG_RW,
- &subnetsarelocal, 0, "");
-/*
- * Return 1 if an internet address is for a ``local'' host
- * (one to which we have a connection). If subnetsarelocal
- * is true, this includes other subnets of the local net.
- * Otherwise, it includes only the directly-connected (sub)nets.
- */
-int
-in_localaddr(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
- register struct in_ifaddr *ia;
-
- if (subnetsarelocal) {
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if ((i & ia->ia_netmask) == ia->ia_net)
- return (1);
- } else {
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if ((i & ia->ia_subnetmask) == ia->ia_subnet)
- return (1);
- }
- return (0);
-}
-
-/*
- * Determine whether an IP address is in a reserved set of addresses
- * that may not be forwarded, or whether datagrams to that destination
- * may be forwarded.
- */
-int
-in_canforward(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
- register u_long net;
-
- if (IN_EXPERIMENTAL(i) || IN_MULTICAST(i))
- return (0);
- if (IN_CLASSA(i)) {
- net = i & IN_CLASSA_NET;
- if (net == 0 || net == (IN_LOOPBACKNET << IN_CLASSA_NSHIFT))
- return (0);
- }
- return (1);
-}
-
-/*
- * Trim a mask in a sockaddr
- */
-static void
-in_socktrim(ap)
-struct sockaddr_in *ap;
-{
- register char *cplim = (char *) &ap->sin_addr;
- register char *cp = (char *) (&ap->sin_addr + 1);
-
- ap->sin_len = 0;
- while (--cp >= cplim)
- if (*cp) {
- (ap)->sin_len = cp - (char *) (ap) + 1;
- break;
- }
-}
-
-static int in_interfaces; /* number of external internet interfaces */
-
-/*
- * Generic internet control operations (ioctl's).
- * Ifp is 0 if not an interface-specific ioctl.
- */
-/* ARGSUSED */
-int
-in_control(so, cmd, data, ifp)
- struct socket *so;
- u_long cmd;
- caddr_t data;
- register struct ifnet *ifp;
-{
- register struct ifreq *ifr = (struct ifreq *)data;
- register struct in_ifaddr *ia = 0, *iap;
- register struct ifaddr *ifa;
- struct in_ifaddr *oia;
- struct in_aliasreq *ifra = (struct in_aliasreq *)data;
- struct sockaddr_in oldaddr;
- int error, hostIsNew, maskIsNew, s;
- u_long i;
- struct multi_kludge *mk;
-
- /*
- * Find address for this interface, if it exists.
- *
- * If an alias address was specified, find that one instead of
- * the first one on the interface.
- */
- if (ifp)
- for (iap = in_ifaddr; iap; iap = iap->ia_next)
- if (iap->ia_ifp == ifp) {
- if (((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr.s_addr ==
- iap->ia_addr.sin_addr.s_addr) {
- ia = iap;
- break;
- } else if (ia == NULL) {
- ia = iap;
- if (ifr->ifr_addr.sa_family != AF_INET)
- break;
- }
- }
-
- switch (cmd) {
-
- case SIOCAIFADDR:
- case SIOCDIFADDR:
- if (ifra->ifra_addr.sin_family == AF_INET) {
- for (oia = ia; ia; ia = ia->ia_next) {
- if (ia->ia_ifp == ifp &&
- ia->ia_addr.sin_addr.s_addr ==
- ifra->ifra_addr.sin_addr.s_addr)
- break;
- }
- if ((ifp->if_flags & IFF_POINTOPOINT)
- && (cmd == SIOCAIFADDR)
- && (ifra->ifra_dstaddr.sin_addr.s_addr
- == INADDR_ANY)) {
- return EDESTADDRREQ;
- }
- }
- if (cmd == SIOCDIFADDR && ia == 0)
- return (EADDRNOTAVAIL);
- /* FALLTHROUGH */
- case SIOCSIFADDR:
- case SIOCSIFNETMASK:
- case SIOCSIFDSTADDR:
- if ((so->so_state & SS_PRIV) == 0)
- return (EPERM);
-
- if (ifp == 0)
- panic("in_control");
- if (ia == (struct in_ifaddr *)0) {
- oia = (struct in_ifaddr *)
- malloc(sizeof *oia, M_IFADDR, M_WAITOK);
- if (oia == (struct in_ifaddr *)NULL)
- return (ENOBUFS);
- bzero((caddr_t)oia, sizeof *oia);
- ia = in_ifaddr;
- /*
- * Protect from ipintr() traversing address list
- * while we're modifying it.
- */
- s = splnet();
-
- if (ia) {
- for ( ; ia->ia_next; ia = ia->ia_next)
- continue;
- ia->ia_next = oia;
- } else
- in_ifaddr = oia;
- ia = oia;
- ifa = ifp->if_addrlist;
- if (ifa) {
- for ( ; ifa->ifa_next; ifa = ifa->ifa_next)
- continue;
- ifa->ifa_next = (struct ifaddr *) ia;
- } else
- ifp->if_addrlist = (struct ifaddr *) ia;
- ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr;
- ia->ia_ifa.ifa_dstaddr
- = (struct sockaddr *)&ia->ia_dstaddr;
- ia->ia_ifa.ifa_netmask
- = (struct sockaddr *)&ia->ia_sockmask;
- ia->ia_sockmask.sin_len = 8;
- if (ifp->if_flags & IFF_BROADCAST) {
- ia->ia_broadaddr.sin_len = sizeof(ia->ia_addr);
- ia->ia_broadaddr.sin_family = AF_INET;
- }
- ia->ia_ifp = ifp;
- if (!(ifp->if_flags & IFF_LOOPBACK))
- in_interfaces++;
- splx(s);
- }
- break;
-
- case SIOCSIFBRDADDR:
- if ((so->so_state & SS_PRIV) == 0)
- return (EPERM);
- /* FALLTHROUGH */
-
- case SIOCGIFADDR:
- case SIOCGIFNETMASK:
- case SIOCGIFDSTADDR:
- case SIOCGIFBRDADDR:
- if (ia == (struct in_ifaddr *)0)
- return (EADDRNOTAVAIL);
- break;
- }
- switch (cmd) {
-
- case SIOCGIFADDR:
- *((struct sockaddr_in *)&ifr->ifr_addr) = ia->ia_addr;
- break;
-
- case SIOCGIFBRDADDR:
- if ((ifp->if_flags & IFF_BROADCAST) == 0)
- return (EINVAL);
- *((struct sockaddr_in *)&ifr->ifr_dstaddr) = ia->ia_broadaddr;
- break;
-
- case SIOCGIFDSTADDR:
- if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
- return (EINVAL);
- *((struct sockaddr_in *)&ifr->ifr_dstaddr) = ia->ia_dstaddr;
- break;
-
- case SIOCGIFNETMASK:
- *((struct sockaddr_in *)&ifr->ifr_addr) = ia->ia_sockmask;
- break;
-
- case SIOCSIFDSTADDR:
- if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
- return (EINVAL);
- oldaddr = ia->ia_dstaddr;
- ia->ia_dstaddr = *(struct sockaddr_in *)&ifr->ifr_dstaddr;
- if (ifp->if_ioctl && (error = (*ifp->if_ioctl)
- (ifp, SIOCSIFDSTADDR, (caddr_t)ia))) {
- ia->ia_dstaddr = oldaddr;
- return (error);
- }
- if (ia->ia_flags & IFA_ROUTE) {
- ia->ia_ifa.ifa_dstaddr = (struct sockaddr *)&oldaddr;
- rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST);
- ia->ia_ifa.ifa_dstaddr =
- (struct sockaddr *)&ia->ia_dstaddr;
- rtinit(&(ia->ia_ifa), (int)RTM_ADD, RTF_HOST|RTF_UP);
- }
- break;
-
- case SIOCSIFBRDADDR:
- if ((ifp->if_flags & IFF_BROADCAST) == 0)
- return (EINVAL);
- ia->ia_broadaddr = *(struct sockaddr_in *)&ifr->ifr_broadaddr;
- break;
-
- case SIOCSIFADDR:
- return (in_ifinit(ifp, ia,
- (struct sockaddr_in *) &ifr->ifr_addr, 1));
-
- case SIOCSIFNETMASK:
- i = ifra->ifra_addr.sin_addr.s_addr;
- ia->ia_subnetmask = ntohl(ia->ia_sockmask.sin_addr.s_addr = i);
- break;
-
- case SIOCAIFADDR:
- maskIsNew = 0;
- hostIsNew = 1;
- error = 0;
- if (ia->ia_addr.sin_family == AF_INET) {
- if (ifra->ifra_addr.sin_len == 0) {
- ifra->ifra_addr = ia->ia_addr;
- hostIsNew = 0;
- } else if (ifra->ifra_addr.sin_addr.s_addr ==
- ia->ia_addr.sin_addr.s_addr)
- hostIsNew = 0;
- }
- if (ifra->ifra_mask.sin_len) {
- in_ifscrub(ifp, ia);
- ia->ia_sockmask = ifra->ifra_mask;
- ia->ia_subnetmask =
- ntohl(ia->ia_sockmask.sin_addr.s_addr);
- maskIsNew = 1;
- }
- if ((ifp->if_flags & IFF_POINTOPOINT) &&
- (ifra->ifra_dstaddr.sin_family == AF_INET)) {
- in_ifscrub(ifp, ia);
- ia->ia_dstaddr = ifra->ifra_dstaddr;
- maskIsNew = 1; /* We lie; but the effect's the same */
- }
- if (ifra->ifra_addr.sin_family == AF_INET &&
- (hostIsNew || maskIsNew))
- error = in_ifinit(ifp, ia, &ifra->ifra_addr, 0);
- if ((ifp->if_flags & IFF_BROADCAST) &&
- (ifra->ifra_broadaddr.sin_family == AF_INET))
- ia->ia_broadaddr = ifra->ifra_broadaddr;
- return (error);
-
- case SIOCDIFADDR:
- mk = malloc(sizeof *mk, M_IPMADDR, M_WAITOK);
- if (!mk)
- return ENOBUFS;
-
- in_ifscrub(ifp, ia);
- /*
- * Protect from ipintr() traversing address list
- * while we're modifying it.
- */
- s = splnet();
-
- if ((ifa = ifp->if_addrlist) == (struct ifaddr *)ia)
- ifp->if_addrlist = ifa->ifa_next;
- else {
- while (ifa->ifa_next &&
- (ifa->ifa_next != (struct ifaddr *)ia))
- ifa = ifa->ifa_next;
- if (ifa->ifa_next)
- ifa->ifa_next = ((struct ifaddr *)ia)->ifa_next;
- else
- printf("Couldn't unlink inifaddr from ifp\n");
- }
- oia = ia;
- if (oia == (ia = in_ifaddr))
- in_ifaddr = ia->ia_next;
- else {
- while (ia->ia_next && (ia->ia_next != oia))
- ia = ia->ia_next;
- if (ia->ia_next)
- ia->ia_next = oia->ia_next;
- else
- printf("Didn't unlink inifadr from list\n");
- }
-
- if (!oia->ia_multiaddrs.lh_first) {
- IFAFREE(&oia->ia_ifa);
- FREE(mk, M_IPMADDR);
- splx(s);
- break;
- }
-
- /*
- * Multicast address kludge:
- * If there were any multicast addresses attached to this
- * interface address, either move them to another address
- * on this interface, or save them until such time as this
- * interface is reconfigured for IP.
- */
- IFP_TO_IA(oia->ia_ifp, ia);
- if (ia) { /* there is another address */
- struct in_multi *inm;
- for(inm = oia->ia_multiaddrs.lh_first; inm;
- inm = inm->inm_entry.le_next) {
- IFAFREE(&inm->inm_ia->ia_ifa);
- ia->ia_ifa.ifa_refcnt++;
- inm->inm_ia = ia;
- LIST_INSERT_HEAD(&ia->ia_multiaddrs, inm,
- inm_entry);
- }
- FREE(mk, M_IPMADDR);
- } else { /* last address on this if deleted, save */
- struct in_multi *inm;
-
- LIST_INIT(&mk->mk_head);
- mk->mk_ifp = ifp;
-
- for(inm = oia->ia_multiaddrs.lh_first; inm;
- inm = inm->inm_entry.le_next) {
- LIST_INSERT_HEAD(&mk->mk_head, inm, inm_entry);
- }
-
- if (mk->mk_head.lh_first) {
- LIST_INSERT_HEAD(&in_mk, mk, mk_entry);
- } else {
- FREE(mk, M_IPMADDR);
- }
- }
-
- IFAFREE((&oia->ia_ifa));
- splx(s);
- break;
-
- default:
- if (ifp == 0 || ifp->if_ioctl == 0)
- return (EOPNOTSUPP);
- return ((*ifp->if_ioctl)(ifp, cmd, data));
- }
- return (0);
-}
-
-/*
- * Delete any existing route for an interface.
- */
-static void
-in_ifscrub(ifp, ia)
- register struct ifnet *ifp;
- register struct in_ifaddr *ia;
-{
-
- if ((ia->ia_flags & IFA_ROUTE) == 0)
- return;
- if (ifp->if_flags & (IFF_LOOPBACK|IFF_POINTOPOINT))
- rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST);
- else
- rtinit(&(ia->ia_ifa), (int)RTM_DELETE, 0);
- ia->ia_flags &= ~IFA_ROUTE;
-}
-
-/*
- * Initialize an interface's internet address
- * and routing table entry.
- */
-static int
-in_ifinit(ifp, ia, sin, scrub)
- register struct ifnet *ifp;
- register struct in_ifaddr *ia;
- struct sockaddr_in *sin;
- int scrub;
-{
- register u_long i = ntohl(sin->sin_addr.s_addr);
- struct sockaddr_in oldaddr;
- int s = splimp(), flags = RTF_UP, error;
- struct multi_kludge *mk;
-
- oldaddr = ia->ia_addr;
- ia->ia_addr = *sin;
- /*
- * Give the interface a chance to initialize
- * if this is its first address,
- * and to validate the address if necessary.
- */
- if (ifp->if_ioctl &&
- (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia))) {
- splx(s);
- ia->ia_addr = oldaddr;
- return (error);
- }
- splx(s);
- if (scrub) {
- ia->ia_ifa.ifa_addr = (struct sockaddr *)&oldaddr;
- in_ifscrub(ifp, ia);
- ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr;
- }
- if (IN_CLASSA(i))
- ia->ia_netmask = IN_CLASSA_NET;
- else if (IN_CLASSB(i))
- ia->ia_netmask = IN_CLASSB_NET;
- else
- ia->ia_netmask = IN_CLASSC_NET;
- /*
- * The subnet mask usually includes at least the standard network part,
- * but may may be smaller in the case of supernetting.
- * If it is set, we believe it.
- */
- if (ia->ia_subnetmask == 0) {
- ia->ia_subnetmask = ia->ia_netmask;
- ia->ia_sockmask.sin_addr.s_addr = htonl(ia->ia_subnetmask);
- } else
- ia->ia_netmask &= ia->ia_subnetmask;
- ia->ia_net = i & ia->ia_netmask;
- ia->ia_subnet = i & ia->ia_subnetmask;
- in_socktrim(&ia->ia_sockmask);
- /*
- * Add route for the network.
- */
- ia->ia_ifa.ifa_metric = ifp->if_metric;
- if (ifp->if_flags & IFF_BROADCAST) {
- ia->ia_broadaddr.sin_addr.s_addr =
- htonl(ia->ia_subnet | ~ia->ia_subnetmask);
- ia->ia_netbroadcast.s_addr =
- htonl(ia->ia_net | ~ ia->ia_netmask);
- } else if (ifp->if_flags & IFF_LOOPBACK) {
- ia->ia_ifa.ifa_dstaddr = ia->ia_ifa.ifa_addr;
- flags |= RTF_HOST;
- } else if (ifp->if_flags & IFF_POINTOPOINT) {
- if (ia->ia_dstaddr.sin_family != AF_INET)
- return (0);
- flags |= RTF_HOST;
- }
- if ((error = rtinit(&(ia->ia_ifa), (int)RTM_ADD, flags)) == 0)
- ia->ia_flags |= IFA_ROUTE;
-
- LIST_INIT(&ia->ia_multiaddrs);
- /*
- * If the interface supports multicast, join the "all hosts"
- * multicast group on that interface.
- */
- if (ifp->if_flags & IFF_MULTICAST) {
- struct in_addr addr;
-
- /*
- * Continuation of multicast address hack:
- * If there was a multicast group list previously saved
- * for this interface, then we re-attach it to the first
- * address configured on the i/f.
- */
- for(mk = in_mk.lh_first; mk; mk = mk->mk_entry.le_next) {
- if(mk->mk_ifp == ifp) {
- struct in_multi *inm;
-
- for(inm = mk->mk_head.lh_first; inm;
- inm = inm->inm_entry.le_next) {
- IFAFREE(&inm->inm_ia->ia_ifa);
- ia->ia_ifa.ifa_refcnt++;
- inm->inm_ia = ia;
- LIST_INSERT_HEAD(&ia->ia_multiaddrs,
- inm, inm_entry);
- }
- LIST_REMOVE(mk, mk_entry);
- free(mk, M_IPMADDR);
- break;
- }
- }
-
- addr.s_addr = htonl(INADDR_ALLHOSTS_GROUP);
- in_addmulti(&addr, ifp);
- }
- return (error);
-}
-
-
-/*
- * Return 1 if the address might be a local broadcast address.
- */
-int
-in_broadcast(in, ifp)
- struct in_addr in;
- struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
- u_long t;
-
- if (in.s_addr == INADDR_BROADCAST ||
- in.s_addr == INADDR_ANY)
- return 1;
- if ((ifp->if_flags & IFF_BROADCAST) == 0)
- return 0;
- t = ntohl(in.s_addr);
- /*
- * Look through the list of addresses for a match
- * with a broadcast address.
- */
-#define ia ((struct in_ifaddr *)ifa)
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- if (ifa->ifa_addr->sa_family == AF_INET &&
- (in.s_addr == ia->ia_broadaddr.sin_addr.s_addr ||
- in.s_addr == ia->ia_netbroadcast.s_addr ||
- /*
- * Check for old-style (host 0) broadcast.
- */
- t == ia->ia_subnet || t == ia->ia_net) &&
- /*
- * Check for an all one subnetmask. These
- * only exist when an interface gets a secondary
- * address.
- */
- ia->ia_subnetmask != (u_long)0xffffffff)
- return 1;
- return (0);
-#undef ia
-}
-/*
- * Add an address to the list of IP multicast addresses for a given interface.
- */
-struct in_multi *
-in_addmulti(ap, ifp)
- register struct in_addr *ap;
- register struct ifnet *ifp;
-{
- register struct in_multi *inm;
- struct ifreq ifr;
- struct in_ifaddr *ia;
- int s = splnet();
-
- /*
- * See if address already in list.
- */
- IN_LOOKUP_MULTI(*ap, ifp, inm);
- if (inm != NULL) {
- /*
- * Found it; just increment the reference count.
- */
- ++inm->inm_refcount;
- }
- else {
- /*
- * New address; allocate a new multicast record
- * and link it into the interface's multicast list.
- */
- inm = (struct in_multi *)malloc(sizeof(*inm),
- M_IPMADDR, M_NOWAIT);
- if (inm == NULL) {
- splx(s);
- return (NULL);
- }
- inm->inm_addr = *ap;
- inm->inm_ifp = ifp;
- inm->inm_refcount = 1;
- IFP_TO_IA(ifp, ia);
- if (ia == NULL) {
- free(inm, M_IPMADDR);
- splx(s);
- return (NULL);
- }
- inm->inm_ia = ia;
- ia->ia_ifa.ifa_refcnt++; /* gain a reference */
- LIST_INSERT_HEAD(&ia->ia_multiaddrs, inm, inm_entry);
-
- /*
- * Ask the network driver to update its multicast reception
- * filter appropriately for the new address.
- */
- ((struct sockaddr_in *)&ifr.ifr_addr)->sin_family = AF_INET;
- ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr = *ap;
- if ((ifp->if_ioctl == NULL) ||
- (*ifp->if_ioctl)(ifp, SIOCADDMULTI,(caddr_t)&ifr) != 0) {
- LIST_REMOVE(inm, inm_entry);
- IFAFREE(&ia->ia_ifa); /* release reference */
- free(inm, M_IPMADDR);
- splx(s);
- return (NULL);
- }
- /*
- * Let IGMP know that we have joined a new IP multicast group.
- */
- igmp_joingroup(inm);
- }
- splx(s);
- return (inm);
-}
-
-/*
- * Delete a multicast address record.
- */
-void
-in_delmulti(inm)
- register struct in_multi *inm;
-{
- struct ifreq ifr;
- int s = splnet();
-
- if (--inm->inm_refcount == 0) {
- /*
- * No remaining claims to this record; let IGMP know that
- * we are leaving the multicast group.
- */
- igmp_leavegroup(inm);
- /*
- * Unlink from list.
- */
- LIST_REMOVE(inm, inm_entry);
- IFAFREE(&inm->inm_ia->ia_ifa); /* release reference */
-
- /*
- * Notify the network driver to update its multicast reception
- * filter.
- */
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr =
- inm->inm_addr;
- (*inm->inm_ifp->if_ioctl)(inm->inm_ifp, SIOCDELMULTI,
- (caddr_t)&ifr);
- free(inm, M_IPMADDR);
- }
- splx(s);
-}
diff --git a/c/src/exec/libnetworking/netinet/in.h b/c/src/exec/libnetworking/netinet/in.h
deleted file mode 100644
index ba3cbb21cc..0000000000
--- a/c/src/exec/libnetworking/netinet/in.h
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1990, 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.h 8.3 (Berkeley) 1/3/94
- * $Id$
- */
-
-#ifndef _NETINET_IN_H_
-#define _NETINET_IN_H_
-
-/*
- * Constants and structures defined by the internet system,
- * Per RFC 790, September 1981, and numerous additions.
- */
-
-/*
- * Protocols (RFC 1700)
- */
-#define IPPROTO_IP 0 /* dummy for IP */
-#define IPPROTO_ICMP 1 /* control message protocol */
-#define IPPROTO_IGMP 2 /* group mgmt protocol */
-#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
-#define IPPROTO_IPIP 4 /* IP encapsulation in IP */
-#define IPPROTO_TCP 6 /* tcp */
-#define IPPROTO_ST 7 /* Stream protocol II */
-#define IPPROTO_EGP 8 /* exterior gateway protocol */
-#define IPPROTO_PIGP 9 /* private interior gateway */
-#define IPPROTO_RCCMON 10 /* BBN RCC Monitoring */
-#define IPPROTO_NVPII 11 /* network voice protocol*/
-#define IPPROTO_PUP 12 /* pup */
-#define IPPROTO_ARGUS 13 /* Argus */
-#define IPPROTO_EMCON 14 /* EMCON */
-#define IPPROTO_XNET 15 /* Cross Net Debugger */
-#define IPPROTO_CHAOS 16 /* Chaos*/
-#define IPPROTO_UDP 17 /* user datagram protocol */
-#define IPPROTO_MUX 18 /* Multiplexing */
-#define IPPROTO_MEAS 19 /* DCN Measurement Subsystems */
-#define IPPROTO_HMP 20 /* Host Monitoring */
-#define IPPROTO_PRM 21 /* Packet Radio Measurement */
-#define IPPROTO_IDP 22 /* xns idp */
-#define IPPROTO_TRUNK1 23 /* Trunk-1 */
-#define IPPROTO_TRUNK2 24 /* Trunk-2 */
-#define IPPROTO_LEAF1 25 /* Leaf-1 */
-#define IPPROTO_LEAF2 26 /* Leaf-2 */
-#define IPPROTO_RDP 27 /* Reliable Data */
-#define IPPROTO_IRTP 28 /* Reliable Transaction */
-#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */
-#define IPPROTO_BLT 30 /* Bulk Data Transfer */
-#define IPPROTO_NSP 31 /* Network Services */
-#define IPPROTO_INP 32 /* Merit Internodal */
-#define IPPROTO_SEP 33 /* Sequential Exchange */
-#define IPPROTO_3PC 34 /* Third Party Connect */
-#define IPPROTO_IDPR 35 /* InterDomain Policy Routing */
-#define IPPROTO_XTP 36 /* XTP */
-#define IPPROTO_DDP 37 /* Datagram Delivery */
-#define IPPROTO_CMTP 38 /* Control Message Transport */
-#define IPPROTO_TPXX 39 /* TP++ Transport */
-#define IPPROTO_IL 40 /* IL transport protocol */
-#define IPPROTO_SIP 41 /* Simple Internet Protocol */
-#define IPPROTO_SDRP 42 /* Source Demand Routing */
-#define IPPROTO_SIPSR 43 /* SIP Source Route */
-#define IPPROTO_SIPFRAG 44 /* SIP Fragment */
-#define IPPROTO_IDRP 45 /* InterDomain Routing*/
-#define IPPROTO_RSVP 46 /* resource reservation */
-#define IPPROTO_GRE 47 /* General Routing Encap. */
-#define IPPROTO_MHRP 48 /* Mobile Host Routing */
-#define IPPROTO_BHA 49 /* BHA */
-#define IPPROTO_ESP 50 /* SIPP Encap Sec. Payload */
-#define IPPROTO_AH 51 /* SIPP Auth Header */
-#define IPPROTO_INLSP 52 /* Integ. Net Layer Security */
-#define IPPROTO_SWIPE 53 /* IP with encryption */
-#define IPPROTO_NHRP 54 /* Next Hop Resolution */
-/* 55-60: Unassigned */
-#define IPPROTO_AHIP 61 /* any host internal protocol */
-#define IPPROTO_CFTP 62 /* CFTP */
-#define IPPROTO_HELLO 63 /* "hello" routing protocol */
-#define IPPROTO_SATEXPAK 64 /* SATNET/Backroom EXPAK */
-#define IPPROTO_KRYPTOLAN 65 /* Kryptolan */
-#define IPPROTO_RVD 66 /* Remote Virtual Disk */
-#define IPPROTO_IPPC 67 /* Pluribus Packet Core */
-#define IPPROTO_ADFS 68 /* Any distributed FS */
-#define IPPROTO_SATMON 69 /* Satnet Monitoring */
-#define IPPROTO_VISA 70 /* VISA Protocol */
-#define IPPROTO_IPCV 71 /* Packet Core Utility */
-#define IPPROTO_CPNX 72 /* Comp. Prot. Net. Executive */
-#define IPPROTO_CPHB 73 /* Comp. Prot. HeartBeat */
-#define IPPROTO_WSN 74 /* Wang Span Network */
-#define IPPROTO_PVP 75 /* Packet Video Protocol */
-#define IPPROTO_BRSATMON 76 /* BackRoom SATNET Monitoring */
-#define IPPROTO_ND 77 /* Sun net disk proto (temp.) */
-#define IPPROTO_WBMON 78 /* WIDEBAND Monitoring */
-#define IPPROTO_WBEXPAK 79 /* WIDEBAND EXPAK */
-#define IPPROTO_EON 80 /* ISO cnlp */
-#define IPPROTO_VMTP 81 /* VMTP */
-#define IPPROTO_SVMTP 82 /* Secure VMTP */
-#define IPPROTO_VINES 83 /* Banyon VINES */
-#define IPPROTO_TTP 84 /* TTP */
-#define IPPROTO_IGP 85 /* NSFNET-IGP */
-#define IPPROTO_DGP 86 /* dissimilar gateway prot. */
-#define IPPROTO_TCF 87 /* TCF */
-#define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */
-#define IPPROTO_OSPFIGP 89 /* OSPFIGP */
-#define IPPROTO_SRPC 90 /* Strite RPC protocol */
-#define IPPROTO_LARP 91 /* Locus Address Resoloution */
-#define IPPROTO_MTP 92 /* Multicast Transport */
-#define IPPROTO_AX25 93 /* AX.25 Frames */
-#define IPPROTO_IPEIP 94 /* IP encapsulated in IP */
-#define IPPROTO_MICP 95 /* Mobile Int.ing control */
-#define IPPROTO_SCCSP 96 /* Semaphore Comm. security */
-#define IPPROTO_ETHERIP 97 /* Ethernet IP encapsulation */
-#define IPPROTO_ENCAP 98 /* encapsulation header */
-#define IPPROTO_APES 99 /* any private encr. scheme */
-#define IPPROTO_GMTP 100 /* GMTP*/
-/* 101-254: Unassigned */
-/* 255: Reserved */
-/* BSD Private, local use, namespace incursion */
-#define IPPROTO_DIVERT 254 /* divert pseudo-protocol */
-#define IPPROTO_RAW 255 /* raw IP packet */
-#define IPPROTO_MAX 256
-
-
-/*
- * Local port number conventions:
- *
- * When a user does a bind(2) or connect(2) with a port number of zero,
- * a non-conflicting local port address is chosen.
- * The default range is IPPORT_RESERVED through
- * IPPORT_USERRESERVED, although that is settable by sysctl.
- *
- * A user may set the IPPROTO_IP option IP_PORTRANGE to change this
- * default assignment range.
- *
- * The value IP_PORTRANGE_DEFAULT causes the default behavior.
- *
- * The value IP_PORTRANGE_HIGH changes the range of candidate port numbers
- * into the "high" range. These are reserved for client outbound connections
- * which do not want to be filtered by any firewalls.
- *
- * The value IP_PORTRANGE_LOW changes the range to the "low" are
- * that is (by convention) restricted to privileged processes. This
- * convention is based on "vouchsafe" principles only. It is only secure
- * if you trust the remote host to restrict these ports.
- *
- * The default range of ports and the high range can be changed by
- * sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto)
- *
- * Changing those values has bad security implications if you are
- * using a a stateless firewall that is allowing packets outside of that
- * range in order to allow transparent outgoing connections.
- *
- * Such a firewall configuration will generally depend on the use of these
- * default values. If you change them, you may find your Security
- * Administrator looking for you with a heavy object.
- */
-
-/*
- * Ports < IPPORT_RESERVED are reserved for
- * privileged processes (e.g. root). (IP_PORTRANGE_LOW)
- * Ports > IPPORT_USERRESERVED are reserved
- * for servers, not necessarily privileged. (IP_PORTRANGE_DEFAULT)
- */
-#define IPPORT_RESERVED 1024
-#define IPPORT_USERRESERVED 5000
-
-/*
- * Default local port range to use by setting IP_PORTRANGE_HIGH
- */
-#define IPPORT_HIFIRSTAUTO 40000
-#define IPPORT_HILASTAUTO 44999
-
-/*
- * Scanning for a free reserved port return a value below IPPORT_RESERVED,
- * but higher than IPPORT_RESERVEDSTART. Traditionally the start value was
- * 512, but that conflicts with some well-known-services that firewalls may
- * have a fit if we use.
- */
-#define IPPORT_RESERVEDSTART 600
-
-/*
- * Internet address (a structure for historical reasons)
- */
-struct in_addr {
- u_long s_addr;
-};
-
-/*
- * Definitions of bits in internet address integers.
- * On subnets, the decomposition of addresses to host and net parts
- * is done according to subnet mask, not the masks here.
- */
-#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0)
-#define IN_CLASSA_NET 0xff000000
-#define IN_CLASSA_NSHIFT 24
-#define IN_CLASSA_HOST 0x00ffffff
-#define IN_CLASSA_MAX 128
-
-#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000)
-#define IN_CLASSB_NET 0xffff0000
-#define IN_CLASSB_NSHIFT 16
-#define IN_CLASSB_HOST 0x0000ffff
-#define IN_CLASSB_MAX 65536
-
-#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000)
-#define IN_CLASSC_NET 0xffffff00
-#define IN_CLASSC_NSHIFT 8
-#define IN_CLASSC_HOST 0x000000ff
-
-#define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000)
-#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */
-#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */
-#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */
-#define IN_MULTICAST(i) IN_CLASSD(i)
-
-#define IN_EXPERIMENTAL(i) (((long)(i) & 0xf0000000) == 0xf0000000)
-#define IN_BADCLASS(i) (((long)(i) & 0xf0000000) == 0xf0000000)
-
-#define INADDR_ANY (u_long)0x00000000
-#define INADDR_BROADCAST (u_long)0xffffffff /* must be masked */
-#ifndef KERNEL
-#define INADDR_NONE 0xffffffff /* -1 return */
-#endif
-
-#define INADDR_UNSPEC_GROUP (u_long)0xe0000000 /* 224.0.0.0 */
-#define INADDR_ALLHOSTS_GROUP (u_long)0xe0000001 /* 224.0.0.1 */
-#define INADDR_ALLRTRS_GROUP (u_long)0xe0000002 /* 224.0.0.2 */
-#define INADDR_MAX_LOCAL_GROUP (u_long)0xe00000ff /* 224.0.0.255 */
-
-#define IN_LOOPBACKNET 127 /* official! */
-
-/*
- * Socket address, internet style.
- */
-struct sockaddr_in {
- u_char sin_len;
- u_char sin_family;
- u_short sin_port;
- struct in_addr sin_addr;
- char sin_zero[8];
-};
-
-/*
- * Structure used to describe IP options.
- * Used to store options internally, to pass them to a process,
- * or to restore options retrieved earlier.
- * The ip_dst is used for the first-hop gateway when using a source route
- * (this gets put into the header proper).
- */
-struct ip_opts {
- struct in_addr ip_dst; /* first hop, 0 w/o src rt */
- char ip_opts[40]; /* actually variable in size */
-};
-
-/*
- * Options for use with [gs]etsockopt at the IP level.
- * First word of comment is data type; bool is stored in int.
- */
-#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */
-#define IP_HDRINCL 2 /* int; header is included with data */
-#define IP_TOS 3 /* int; IP type of service and preced. */
-#define IP_TTL 4 /* int; IP time to live */
-#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */
-#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */
-#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */
-#define IP_RETOPTS 8 /* ip_opts; set/get IP options */
-#define IP_MULTICAST_IF 9 /* u_char; set/get IP multicast i/f */
-#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
-#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */
-#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */
-#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */
-#define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */
-#define IP_RSVP_ON 15 /* enable RSVP in kernel */
-#define IP_RSVP_OFF 16 /* disable RSVP in kernel */
-#define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */
-#define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */
-#define IP_PORTRANGE 19 /* int; range to choose for unspec port */
-#define IP_RECVIF 20 /* bool; receive reception if w/dgram */
-
-#define IP_FW_ADD 50 /* add a firewall rule to chain */
-#define IP_FW_DEL 51 /* delete a firewall rule from chain */
-#define IP_FW_FLUSH 52 /* flush firewall rule chain */
-#define IP_FW_ZERO 53 /* clear single/all firewall counter(s) */
-#define IP_FW_GET 54 /* get entire firewall rule chain */
-#define IP_NAT 55 /* set/get NAT opts */
-
-/*
- * Defaults and limits for options
- */
-#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
-#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
-#define IP_MAX_MEMBERSHIPS 20 /* per socket */
-
-/*
- * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
- */
-struct ip_mreq {
- struct in_addr imr_multiaddr; /* IP multicast address of group */
- struct in_addr imr_interface; /* local IP address of interface */
-};
-
-/*
- * Argument for IP_PORTRANGE:
- * - which range to search when port is unspecified at bind() or connect()
- */
-#define IP_PORTRANGE_DEFAULT 0 /* default range */
-#define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
-#define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
-
-/*
- * Definitions for inet sysctl operations.
- *
- * Third level is protocol number.
- * Fourth level is desired variable within that protocol.
- */
-#define IPPROTO_MAXID (IPPROTO_IDP + 1) /* don't list to IPPROTO_MAX */
-
-#define CTL_IPPROTO_NAMES { \
- { "ip", CTLTYPE_NODE }, \
- { "icmp", CTLTYPE_NODE }, \
- { "igmp", CTLTYPE_NODE }, \
- { "ggp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "tcp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { "egp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "pup", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "udp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "idp", CTLTYPE_NODE }, \
-}
-
-/*
- * Names for IP sysctl objects
- */
-#define IPCTL_FORWARDING 1 /* act as router */
-#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */
-#define IPCTL_DEFTTL 3 /* default TTL */
-#ifdef notyet
-#define IPCTL_DEFMTU 4 /* default MTU */
-#endif
-#define IPCTL_RTEXPIRE 5 /* cloned route expiration time */
-#define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */
-#define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */
-#define IPCTL_SOURCEROUTE 8 /* may perform source routes */
-#define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */
-#define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */
-#define IPCTL_INTRQDROPS 11 /* number of netisr q drops */
-#define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */
-#define IPCTL_MAXID 13
-
-#define IPCTL_NAMES { \
- { 0, 0 }, \
- { "forwarding", CTLTYPE_INT }, \
- { "redirect", CTLTYPE_INT }, \
- { "ttl", CTLTYPE_INT }, \
- { "mtu", CTLTYPE_INT }, \
- { "rtexpire", CTLTYPE_INT }, \
- { "rtminexpire", CTLTYPE_INT }, \
- { "rtmaxcache", CTLTYPE_INT }, \
- { "sourceroute", CTLTYPE_INT }, \
- { "directed-broadcast", CTLTYPE_INT }, \
- { "intr-queue-maxlen", CTLTYPE_INT }, \
- { "intr-queue-drops", CTLTYPE_INT }, \
- { "accept_sourceroute", CTLTYPE_INT }, \
-}
-
-
-#ifdef KERNEL
-struct ifnet; struct mbuf; /* forward declarations for Standard C */
-
-int in_broadcast __P((struct in_addr, struct ifnet *));
-int in_canforward __P((struct in_addr));
-int in_cksum __P((struct mbuf *, int));
-int in_localaddr __P((struct in_addr));
-char *inet_ntoa __P((struct in_addr)); /* in libkern */
-
-/* Firewall hooks */
-struct ip;
-typedef int ip_fw_chk_t __P((struct ip**, int, struct ifnet*, int, struct mbuf**));
-typedef int ip_fw_ctl_t __P((int, struct mbuf**));
-extern ip_fw_chk_t *ip_fw_chk_ptr;
-extern ip_fw_ctl_t *ip_fw_ctl_ptr;
-
-/* IP NAT hooks */
-typedef int ip_nat_t __P((struct ip**, struct mbuf**, struct ifnet*, int));
-typedef int ip_nat_ctl_t __P((int, struct mbuf**));
-extern ip_nat_t *ip_nat_ptr;
-extern ip_nat_ctl_t *ip_nat_ctl_ptr;
-#define IP_NAT_IN 0x00000001
-#define IP_NAT_OUT 0x00000002
-
-#endif /* KERNEL */
-
-#endif
diff --git a/c/src/exec/libnetworking/netinet/in_cksum.c b/c/src/exec/libnetworking/netinet/in_cksum.c
deleted file mode 100644
index 9cffad3221..0000000000
--- a/c/src/exec/libnetworking/netinet/in_cksum.c
+++ /dev/null
@@ -1,166 +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 <sys/param.h>
-#include <sys/mbuf.h>
-
-/*
- * Try to use a CPU specific version, then punt to the portable C one.
- */
-
-#if (defined(__GNUC__) && (defined(__mc68000__) || defined(__m68k__)))
-
-#include "in_cksum_m68k.c"
-
-#elif (defined(__GNUC__) && defined(__i386__))
-
-#include "in_cksum_i386.c"
-
-#else
-
-/*
- * Checksum routine for Internet Protocol family headers (Portable Version).
- *
- * This routine is very heavily used in the network
- * code and should be modified for each CPU to be as fast as possible.
- */
-
-#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
-#define REDUCE \
- {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);}
-
-int
-in_cksum(m, len)
- register struct mbuf *m;
- register int len;
-{
- register u_short *w;
- register int sum = 0;
- register int mlen = 0;
- int byte_swapped = 0;
-
- union {
- char c[2];
- u_short s;
- } s_util;
- union {
- u_short s[2];
- long l;
- } l_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 even boundary.
- */
- if ((1 & (int) w) && (mlen > 0)) {
- REDUCE;
- sum <<= 8;
- s_util.c[0] = *(u_char *)w;
- w = (u_short *)((char *)w + 1);
- mlen--;
- byte_swapped = 1;
- }
- /*
- * Unroll the loop to make overhead from
- * branches &c small.
- */
- while ((mlen -= 32) >= 0) {
- sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
- sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7];
- sum += w[8]; sum += w[9]; sum += w[10]; sum += w[11];
- sum += w[12]; sum += w[13]; sum += w[14]; sum += w[15];
- w += 16;
- }
- mlen += 32;
- while ((mlen -= 8) >= 0) {
- sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
- w += 4;
- }
- mlen += 8;
- if (mlen == 0 && byte_swapped == 0)
- continue;
- REDUCE;
- 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)
- printf("cksum: out of data\n");
- 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);
-}
-#endif
diff --git a/c/src/exec/libnetworking/netinet/in_cksum_i386.c b/c/src/exec/libnetworking/netinet/in_cksum_i386.c
deleted file mode 100644
index 2057ab3fd6..0000000000
--- a/c/src/exec/libnetworking/netinet/in_cksum_i386.c
+++ /dev/null
@@ -1,198 +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$
- */
-
-#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("addl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (w))
-#define ADDC(n) asm("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("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)
- printf("cksum: out of data\n");
- 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/c/src/exec/libnetworking/netinet/in_cksum_m68k.c b/c/src/exec/libnetworking/netinet/in_cksum_m68k.c
deleted file mode 100644
index 58199c3adf..0000000000
--- a/c/src/exec/libnetworking/netinet/in_cksum_m68k.c
+++ /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 <sys/param.h>
-#include <sys/mbuf.h>
-
-#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/c/src/exec/libnetworking/netinet/in_pcb.c b/c/src/exec/libnetworking/netinet/in_pcb.c
deleted file mode 100644
index 116f70eebf..0000000000
--- a/c/src/exec/libnetworking/netinet/in_pcb.c
+++ /dev/null
@@ -1,757 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1991, 1993, 1995
- * 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_pcb.c 8.4 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/proc.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-
-struct in_addr zeroin_addr;
-
-static void in_pcbinshash __P((struct inpcb *));
-static void in_rtchange __P((struct inpcb *, int));
-
-/*
- * These configure the range of local port addresses assigned to
- * "unspecified" outgoing connections/packets/whatever.
- */
-static int ipport_lowfirstauto = IPPORT_RESERVED - 1; /* 1023 */
-static int ipport_lowlastauto = IPPORT_RESERVEDSTART; /* 600 */
-static int ipport_firstauto = IPPORT_RESERVED; /* 1024 */
-static int ipport_lastauto = IPPORT_USERRESERVED; /* 5000 */
-static int ipport_hifirstauto = IPPORT_HIFIRSTAUTO; /* 40000 */
-static int ipport_hilastauto = IPPORT_HILASTAUTO; /* 44999 */
-
-#define RANGECHK(var, min, max) \
- if ((var) < (min)) { (var) = (min); } \
- else if ((var) > (max)) { (var) = (max); }
-
-#if 0
-static int
-sysctl_net_ipport_check SYSCTL_HANDLER_ARGS
-{
- int error = sysctl_handle_int(oidp,
- oidp->oid_arg1, oidp->oid_arg2, req);
- if (!error) {
- RANGECHK(ipport_lowfirstauto, 1, IPPORT_RESERVED - 1);
- RANGECHK(ipport_lowlastauto, 1, IPPORT_RESERVED - 1);
- RANGECHK(ipport_firstauto, IPPORT_RESERVED, USHRT_MAX);
- RANGECHK(ipport_lastauto, IPPORT_RESERVED, USHRT_MAX);
- RANGECHK(ipport_hifirstauto, IPPORT_RESERVED, USHRT_MAX);
- RANGECHK(ipport_hilastauto, IPPORT_RESERVED, USHRT_MAX);
- }
- return error;
-}
-#endif
-
-#undef RANGECHK
-
-SYSCTL_NODE(_net_inet_ip, IPPROTO_IP, portrange, CTLFLAG_RW, 0, "IP Ports");
-
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, lowfirst, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_lowfirstauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, lowlast, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_lowlastauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, first, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_firstauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, last, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_lastauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, hifirst, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_hifirstauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, hilast, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_hilastauto, 0, &sysctl_net_ipport_check, "I", "");
-
-int
-in_pcballoc(so, pcbinfo)
- struct socket *so;
- struct inpcbinfo *pcbinfo;
-{
- register struct inpcb *inp;
- int s;
-
- MALLOC(inp, struct inpcb *, sizeof(*inp), M_PCB, M_NOWAIT);
- if (inp == NULL)
- return (ENOBUFS);
- bzero((caddr_t)inp, sizeof(*inp));
- inp->inp_pcbinfo = pcbinfo;
- inp->inp_socket = so;
- s = splnet();
- LIST_INSERT_HEAD(pcbinfo->listhead, inp, inp_list);
- in_pcbinshash(inp);
- splx(s);
- so->so_pcb = (caddr_t)inp;
- return (0);
-}
-
-int
-in_pcbbind(inp, nam)
- register struct inpcb *inp;
- struct mbuf *nam;
-{
- register struct socket *so = inp->inp_socket;
- unsigned short *lastport;
- struct sockaddr_in *sin;
- u_short lport = 0;
- int wild = 0, reuseport = (so->so_options & SO_REUSEPORT);
- int error;
-
- if (in_ifaddr == 0)
- return (EADDRNOTAVAIL);
- if (inp->inp_lport || inp->inp_laddr.s_addr != INADDR_ANY)
- return (EINVAL);
- if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0 &&
- ((so->so_proto->pr_flags & PR_CONNREQUIRED) == 0 ||
- (so->so_options & SO_ACCEPTCONN) == 0))
- wild = 1;
- if (nam) {
- sin = mtod(nam, struct sockaddr_in *);
- if (nam->m_len != sizeof (*sin))
- return (EINVAL);
-#ifdef notdef
- /*
- * We should check the family, but old programs
- * incorrectly fail to initialize it.
- */
- if (sin->sin_family != AF_INET)
- return (EAFNOSUPPORT);
-#endif
- lport = sin->sin_port;
- if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) {
- /*
- * Treat SO_REUSEADDR as SO_REUSEPORT for multicast;
- * allow complete duplication of binding if
- * SO_REUSEPORT is set, or if SO_REUSEADDR is set
- * and a multicast address is bound on both
- * new and duplicated sockets.
- */
- if (so->so_options & SO_REUSEADDR)
- reuseport = SO_REUSEADDR|SO_REUSEPORT;
- } else if (sin->sin_addr.s_addr != INADDR_ANY) {
- sin->sin_port = 0; /* yech... */
- if (ifa_ifwithaddr((struct sockaddr *)sin) == 0)
- return (EADDRNOTAVAIL);
- }
- if (lport) {
- struct inpcb *t;
-
- /* GROSS */
- if (ntohs(lport) < IPPORT_RESERVED &&
- (error = suser(p->p_ucred, &p->p_acflag)))
- return (EACCES);
- if (so->so_uid) {
- t = in_pcblookup(inp->inp_pcbinfo, zeroin_addr,
- 0, sin->sin_addr, lport,
- INPLOOKUP_WILDCARD);
- if (t && (so->so_uid != t->inp_socket->so_uid))
- return (EADDRINUSE);
- }
- t = in_pcblookup(inp->inp_pcbinfo, zeroin_addr, 0,
- sin->sin_addr, lport, wild);
- if (t && (reuseport & t->inp_socket->so_options) == 0)
- return (EADDRINUSE);
- }
- inp->inp_laddr = sin->sin_addr;
- }
- if (lport == 0) {
- ushort first, last;
- int count;
-
- inp->inp_flags |= INP_ANONPORT;
-
- if (inp->inp_flags & INP_HIGHPORT) {
- first = ipport_hifirstauto; /* sysctl */
- last = ipport_hilastauto;
- lastport = &inp->inp_pcbinfo->lasthi;
- } else if (inp->inp_flags & INP_LOWPORT) {
- if ((error = suser(p->p_ucred, &p->p_acflag)))
- return (EACCES);
- first = ipport_lowfirstauto; /* 1023 */
- last = ipport_lowlastauto; /* 600 */
- lastport = &inp->inp_pcbinfo->lastlow;
- } else {
- first = ipport_firstauto; /* sysctl */
- last = ipport_lastauto;
- lastport = &inp->inp_pcbinfo->lastport;
- }
- /*
- * Simple check to ensure all ports are not used up causing
- * a deadlock here.
- *
- * We split the two cases (up and down) so that the direction
- * is not being tested on each round of the loop.
- */
- if (first > last) {
- /*
- * counting down
- */
- count = first - last;
-
- do {
- if (count-- <= 0) /* completely used? */
- return (EADDRNOTAVAIL);
- --*lastport;
- if (*lastport > first || *lastport < last)
- *lastport = first;
- lport = htons(*lastport);
- } while (in_pcblookup(inp->inp_pcbinfo,
- zeroin_addr, 0, inp->inp_laddr, lport, wild));
- } else {
- /*
- * counting up
- */
- count = last - first;
-
- do {
- if (count-- <= 0) /* completely used? */
- return (EADDRNOTAVAIL);
- ++*lastport;
- if (*lastport < first || *lastport > last)
- *lastport = first;
- lport = htons(*lastport);
- } while (in_pcblookup(inp->inp_pcbinfo,
- zeroin_addr, 0, inp->inp_laddr, lport, wild));
- }
- }
- inp->inp_lport = lport;
- in_pcbrehash(inp);
- return (0);
-}
-
-/*
- * Transform old in_pcbconnect() into an inner subroutine for new
- * in_pcbconnect(): Do some validity-checking on the remote
- * address (in mbuf 'nam') and then determine local host address
- * (i.e., which interface) to use to access that remote host.
- *
- * This preserves definition of in_pcbconnect(), while supporting a
- * slightly different version for T/TCP. (This is more than
- * a bit of a kludge, but cleaning up the internal interfaces would
- * have forced minor changes in every protocol).
- */
-
-int
-in_pcbladdr(inp, nam, plocal_sin)
- register struct inpcb *inp;
- struct mbuf *nam;
- struct sockaddr_in **plocal_sin;
-{
- struct in_ifaddr *ia;
- register struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *);
-
- if (nam->m_len != sizeof (*sin))
- return (EINVAL);
- if (sin->sin_family != AF_INET)
- return (EAFNOSUPPORT);
- if (sin->sin_port == 0)
- return (EADDRNOTAVAIL);
- if (in_ifaddr) {
- /*
- * If the destination address is INADDR_ANY,
- * use the primary local address.
- * If the supplied address is INADDR_BROADCAST,
- * and the primary interface supports broadcast,
- * choose the broadcast address for that interface.
- */
-#define satosin(sa) ((struct sockaddr_in *)(sa))
-#define sintosa(sin) ((struct sockaddr *)(sin))
-#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
- if (sin->sin_addr.s_addr == INADDR_ANY)
- sin->sin_addr = IA_SIN(in_ifaddr)->sin_addr;
- else if (sin->sin_addr.s_addr == (u_long)INADDR_BROADCAST &&
- (in_ifaddr->ia_ifp->if_flags & IFF_BROADCAST))
- sin->sin_addr = satosin(&in_ifaddr->ia_broadaddr)->sin_addr;
- }
- if (inp->inp_laddr.s_addr == INADDR_ANY) {
- register struct route *ro;
-
- ia = (struct in_ifaddr *)0;
- /*
- * If route is known or can be allocated now,
- * our src addr is taken from the i/f, else punt.
- */
- ro = &inp->inp_route;
- if (ro->ro_rt &&
- (satosin(&ro->ro_dst)->sin_addr.s_addr !=
- sin->sin_addr.s_addr ||
- inp->inp_socket->so_options & SO_DONTROUTE)) {
- RTFREE(ro->ro_rt);
- ro->ro_rt = (struct rtentry *)0;
- }
- if ((inp->inp_socket->so_options & SO_DONTROUTE) == 0 && /*XXX*/
- (ro->ro_rt == (struct rtentry *)0 ||
- ro->ro_rt->rt_ifp == (struct ifnet *)0)) {
- /* No route yet, so try to acquire one */
- ro->ro_dst.sa_family = AF_INET;
- ro->ro_dst.sa_len = sizeof(struct sockaddr_in);
- ((struct sockaddr_in *) &ro->ro_dst)->sin_addr =
- sin->sin_addr;
- rtalloc(ro);
- }
- /*
- * If we found a route, use the address
- * corresponding to the outgoing interface
- * unless it is the loopback (in case a route
- * to our address on another net goes to loopback).
- */
- if (ro->ro_rt && !(ro->ro_rt->rt_ifp->if_flags & IFF_LOOPBACK))
- ia = ifatoia(ro->ro_rt->rt_ifa);
- if (ia == 0) {
- u_short fport = sin->sin_port;
-
- sin->sin_port = 0;
- ia = ifatoia(ifa_ifwithdstaddr(sintosa(sin)));
- if (ia == 0)
- ia = ifatoia(ifa_ifwithnet(sintosa(sin)));
- sin->sin_port = fport;
- if (ia == 0)
- ia = in_ifaddr;
- if (ia == 0)
- return (EADDRNOTAVAIL);
- }
- /*
- * If the destination address is multicast and an outgoing
- * interface has been set as a multicast option, use the
- * address of that interface as our source address.
- */
- if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr)) &&
- inp->inp_moptions != NULL) {
- struct ip_moptions *imo;
- struct ifnet *ifp;
-
- imo = inp->inp_moptions;
- if (imo->imo_multicast_ifp != NULL) {
- ifp = imo->imo_multicast_ifp;
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if (ia->ia_ifp == ifp)
- break;
- if (ia == 0)
- return (EADDRNOTAVAIL);
- }
- }
- /*
- * Don't do pcblookup call here; return interface in plocal_sin
- * and exit to caller, that will do the lookup.
- */
- *plocal_sin = &ia->ia_addr;
-
- }
- return(0);
-}
-
-/*
- * Outer subroutine:
- * Connect from a socket to a specified address.
- * Both address and port must be specified in argument sin.
- * If don't have a local address for this socket yet,
- * then pick one.
- */
-int
-in_pcbconnect(inp, nam)
- register struct inpcb *inp;
- struct mbuf *nam;
-{
- struct sockaddr_in *ifaddr;
- register struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *);
- int error;
-
- /*
- * Call inner routine, to assign local interface address.
- */
- if ((error = in_pcbladdr(inp, nam, &ifaddr)))
- return(error);
-
- if (in_pcblookuphash(inp->inp_pcbinfo, sin->sin_addr, sin->sin_port,
- inp->inp_laddr.s_addr ? inp->inp_laddr : ifaddr->sin_addr,
- inp->inp_lport, 0) != NULL)
- return (EADDRINUSE);
- if (inp->inp_laddr.s_addr == INADDR_ANY) {
- if (inp->inp_lport == 0)
- (void)in_pcbbind(inp, (struct mbuf *)0);
- inp->inp_laddr = ifaddr->sin_addr;
- }
- inp->inp_faddr = sin->sin_addr;
- inp->inp_fport = sin->sin_port;
- in_pcbrehash(inp);
- return (0);
-}
-
-void
-in_pcbdisconnect(inp)
- struct inpcb *inp;
-{
-
- inp->inp_faddr.s_addr = INADDR_ANY;
- inp->inp_fport = 0;
- in_pcbrehash(inp);
- if (inp->inp_socket->so_state & SS_NOFDREF)
- in_pcbdetach(inp);
-}
-
-void
-in_pcbdetach(inp)
- struct inpcb *inp;
-{
- struct socket *so = inp->inp_socket;
- int s;
-
- so->so_pcb = 0;
- sofree(so);
- if (inp->inp_options)
- (void)m_free(inp->inp_options);
- if (inp->inp_route.ro_rt)
- rtfree(inp->inp_route.ro_rt);
- ip_freemoptions(inp->inp_moptions);
- s = splnet();
- LIST_REMOVE(inp, inp_hash);
- LIST_REMOVE(inp, inp_list);
- splx(s);
- FREE(inp, M_PCB);
-}
-
-void
-in_setsockaddr(inp, nam)
- register struct inpcb *inp;
- struct mbuf *nam;
-{
- register struct sockaddr_in *sin;
-
- nam->m_len = sizeof (*sin);
- sin = mtod(nam, struct sockaddr_in *);
- bzero((caddr_t)sin, sizeof (*sin));
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_port = inp->inp_lport;
- sin->sin_addr = inp->inp_laddr;
-}
-
-void
-in_setpeeraddr(inp, nam)
- struct inpcb *inp;
- struct mbuf *nam;
-{
- register struct sockaddr_in *sin;
-
- nam->m_len = sizeof (*sin);
- sin = mtod(nam, struct sockaddr_in *);
- bzero((caddr_t)sin, sizeof (*sin));
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_port = inp->inp_fport;
- sin->sin_addr = inp->inp_faddr;
-}
-
-/*
- * Pass some notification to all connections of a protocol
- * associated with address dst. The local address and/or port numbers
- * may be specified to limit the search. The "usual action" will be
- * taken, depending on the ctlinput cmd. The caller must filter any
- * cmds that are uninteresting (e.g., no error in the map).
- * Call the protocol specific routine (if any) to report
- * any errors for each matching socket.
- *
- * Must be called at splnet.
- */
-void
-in_pcbnotify(head, dst, fport_arg, laddr, lport_arg, cmd, notify)
- struct inpcbhead *head;
- struct sockaddr *dst;
- u_int fport_arg, lport_arg;
- struct in_addr laddr;
- int cmd;
- void (*notify) __P((struct inpcb *, int));
-{
- register struct inpcb *inp, *oinp;
- struct in_addr faddr;
- u_short fport = fport_arg, lport = lport_arg;
- int errnum, s;
-
- if ((unsigned)cmd > PRC_NCMDS || dst->sa_family != AF_INET)
- return;
- faddr = ((struct sockaddr_in *)dst)->sin_addr;
- if (faddr.s_addr == INADDR_ANY)
- return;
-
- /*
- * Redirects go to all references to the destination,
- * and use in_rtchange to invalidate the route cache.
- * Dead host indications: notify all references to the destination.
- * Otherwise, if we have knowledge of the local port and address,
- * deliver only to that socket.
- */
- if (PRC_IS_REDIRECT(cmd) || cmd == PRC_HOSTDEAD) {
- fport = 0;
- lport = 0;
- laddr.s_addr = 0;
- if (cmd != PRC_HOSTDEAD)
- notify = in_rtchange;
- }
- errnum = inetctlerrmap[cmd];
- s = splnet();
- for (inp = head->lh_first; inp != NULL;) {
- if (inp->inp_faddr.s_addr != faddr.s_addr ||
- inp->inp_socket == 0 ||
- (lport && inp->inp_lport != lport) ||
- (laddr.s_addr && inp->inp_laddr.s_addr != laddr.s_addr) ||
- (fport && inp->inp_fport != fport)) {
- inp = inp->inp_list.le_next;
- continue;
- }
- oinp = inp;
- inp = inp->inp_list.le_next;
- if (notify)
- (*notify)(oinp, errnum);
- }
- splx(s);
-}
-
-/*
- * Check for alternatives when higher level complains
- * about service problems. For now, invalidate cached
- * routing information. If the route was created dynamically
- * (by a redirect), time to try a default gateway again.
- */
-void
-in_losing(inp)
- struct inpcb *inp;
-{
- register struct rtentry *rt;
- struct rt_addrinfo info;
-
- if ((rt = inp->inp_route.ro_rt)) {
- inp->inp_route.ro_rt = 0;
- bzero((caddr_t)&info, sizeof(info));
- info.rti_info[RTAX_DST] =
- (struct sockaddr *)&inp->inp_route.ro_dst;
- info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
- info.rti_info[RTAX_NETMASK] = rt_mask(rt);
- rt_missmsg(RTM_LOSING, &info, rt->rt_flags, 0);
- if (rt->rt_flags & RTF_DYNAMIC)
- (void) rtrequest(RTM_DELETE, rt_key(rt),
- rt->rt_gateway, rt_mask(rt), rt->rt_flags,
- (struct rtentry **)0);
- else
- /*
- * A new route can be allocated
- * the next time output is attempted.
- */
- rtfree(rt);
- }
-}
-
-/*
- * After a routing change, flush old routing
- * and allocate a (hopefully) better one.
- */
-static void
-in_rtchange(inp, errnum)
- register struct inpcb *inp;
- int errnum;
-{
- if (inp->inp_route.ro_rt) {
- rtfree(inp->inp_route.ro_rt);
- inp->inp_route.ro_rt = 0;
- /*
- * A new route can be allocated the next time
- * output is attempted.
- */
- }
-}
-
-struct inpcb *
-in_pcblookup(pcbinfo, faddr, fport_arg, laddr, lport_arg, wild_okay)
- struct inpcbinfo *pcbinfo;
- struct in_addr faddr, laddr;
- u_int fport_arg, lport_arg;
- int wild_okay;
-{
- register struct inpcb *inp, *match = NULL;
- int matchwild = 3, wildcard;
- u_short fport = fport_arg, lport = lport_arg;
- int s;
-
- s = splnet();
-
- for (inp = pcbinfo->listhead->lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_lport != lport)
- continue;
- wildcard = 0;
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- if (faddr.s_addr == INADDR_ANY)
- wildcard++;
- else if (inp->inp_faddr.s_addr != faddr.s_addr ||
- inp->inp_fport != fport)
- continue;
- } else {
- if (faddr.s_addr != INADDR_ANY)
- wildcard++;
- }
- if (inp->inp_laddr.s_addr != INADDR_ANY) {
- if (laddr.s_addr == INADDR_ANY)
- wildcard++;
- else if (inp->inp_laddr.s_addr != laddr.s_addr)
- continue;
- } else {
- if (laddr.s_addr != INADDR_ANY)
- wildcard++;
- }
- if (wildcard && wild_okay == 0)
- continue;
- if (wildcard < matchwild) {
- match = inp;
- matchwild = wildcard;
- if (matchwild == 0) {
- break;
- }
- }
- }
- splx(s);
- return (match);
-}
-
-/*
- * Lookup PCB in hash list.
- */
-struct inpcb *
-in_pcblookuphash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard)
- struct inpcbinfo *pcbinfo;
- struct in_addr faddr, laddr;
- u_int fport_arg, lport_arg;
- int wildcard;
-{
- struct inpcbhead *head;
- register struct inpcb *inp;
- u_short fport = fport_arg, lport = lport_arg;
- int s;
-
- s = splnet();
- /*
- * First look for an exact match.
- */
- head = &pcbinfo->hashbase[INP_PCBHASH(faddr.s_addr, lport, fport, pcbinfo->hashmask)];
- for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
- if (inp->inp_faddr.s_addr == faddr.s_addr &&
- inp->inp_laddr.s_addr == laddr.s_addr &&
- inp->inp_fport == fport &&
- inp->inp_lport == lport)
- goto found;
- }
- if (wildcard) {
- struct inpcb *local_wild = NULL;
-
- head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbinfo->hashmask)];
- for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
- if (inp->inp_faddr.s_addr == INADDR_ANY &&
- inp->inp_fport == 0 && inp->inp_lport == lport) {
- if (inp->inp_laddr.s_addr == laddr.s_addr)
- goto found;
- else if (inp->inp_laddr.s_addr == INADDR_ANY)
- local_wild = inp;
- }
- }
- if (local_wild != NULL) {
- inp = local_wild;
- goto found;
- }
- }
- splx(s);
- return (NULL);
-
-found:
- /*
- * Move PCB to head of this hash chain so that it can be
- * found more quickly in the future.
- * XXX - this is a pessimization on machines with few
- * concurrent connections.
- */
- if (inp != head->lh_first) {
- LIST_REMOVE(inp, inp_hash);
- LIST_INSERT_HEAD(head, inp, inp_hash);
- }
- splx(s);
- return (inp);
-}
-
-/*
- * Insert PCB into hash chain. Must be called at splnet.
- */
-static void
-in_pcbinshash(inp)
- struct inpcb *inp;
-{
- struct inpcbhead *head;
-
- head = &inp->inp_pcbinfo->hashbase[INP_PCBHASH(inp->inp_faddr.s_addr,
- inp->inp_lport, inp->inp_fport, inp->inp_pcbinfo->hashmask)];
-
- LIST_INSERT_HEAD(head, inp, inp_hash);
-}
-
-void
-in_pcbrehash(inp)
- struct inpcb *inp;
-{
- struct inpcbhead *head;
- int s;
-
- s = splnet();
- LIST_REMOVE(inp, inp_hash);
-
- head = &inp->inp_pcbinfo->hashbase[INP_PCBHASH(inp->inp_faddr.s_addr,
- inp->inp_lport, inp->inp_fport, inp->inp_pcbinfo->hashmask)];
-
- LIST_INSERT_HEAD(head, inp, inp_hash);
- splx(s);
-}
diff --git a/c/src/exec/libnetworking/netinet/in_pcb.h b/c/src/exec/libnetworking/netinet/in_pcb.h
deleted file mode 100644
index 9390cfda6c..0000000000
--- a/c/src/exec/libnetworking/netinet/in_pcb.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1990, 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_pcb.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IN_PCB_H_
-#define _NETINET_IN_PCB_H_
-
-#include <sys/queue.h>
-
-/*
- * Common structure pcb for internet protocol implementation.
- * Here are stored pointers to local and foreign host table
- * entries, local and foreign socket numbers, and pointers
- * up (to a socket structure) and down (to a protocol-specific)
- * control block.
- */
-LIST_HEAD(inpcbhead, inpcb);
-
-struct inpcb {
- LIST_ENTRY(inpcb) inp_list; /* list for all PCBs of this proto */
- LIST_ENTRY(inpcb) inp_hash; /* hash list */
- struct inpcbinfo *inp_pcbinfo; /* PCB list info */
- struct in_addr inp_faddr; /* foreign host table entry */
- struct in_addr inp_laddr; /* local host table entry */
- u_short inp_fport; /* foreign port */
- u_short inp_lport; /* local port */
- caddr_t inp_ppcb; /* pointer to per-protocol pcb */
- struct socket *inp_socket; /* back pointer to socket */
- struct mbuf *inp_options; /* IP options */
- struct route inp_route; /* placeholder for routing entry */
- int inp_flags; /* generic IP/datagram flags */
- u_char inp_ip_tos; /* type of service proto */
- u_char inp_ip_ttl; /* time to live proto */
- u_char inp_ip_p; /* protocol proto */
- u_char pad[1]; /* alignment */
- struct ip_moptions *inp_moptions; /* IP multicast options */
-#if 0 /* Someday, perhaps... */
- struct ip inp_ip; /* header prototype; should have more */
-#endif
-};
-
-struct inpcbinfo {
- struct inpcbhead *listhead;
- struct inpcbhead *hashbase;
- unsigned long hashmask;
- unsigned short lastport;
- unsigned short lastlow;
- unsigned short lasthi;
-};
-
-#define INP_PCBHASH(faddr, lport, fport, mask) \
- (((faddr) ^ ((faddr) >> 16) ^ (lport) ^ (fport)) & (mask))
-
-/* flags in inp_flags: */
-#define INP_RECVOPTS 0x01 /* receive incoming IP options */
-#define INP_RECVRETOPTS 0x02 /* receive IP options for reply */
-#define INP_RECVDSTADDR 0x04 /* receive IP dst address */
-#define INP_HDRINCL 0x08 /* user supplies entire IP header */
-#define INP_HIGHPORT 0x10 /* user wants "high" port binding */
-#define INP_LOWPORT 0x20 /* user wants "low" port binding */
-#define INP_ANONPORT 0x40 /* port chosen for user */
-#define INP_RECVIF 0x80 /* receive incoming interface */
-#define INP_CONTROLOPTS (INP_RECVOPTS|INP_RECVRETOPTS|INP_RECVDSTADDR|\
- INP_RECVIF)
-
-#define INPLOOKUP_WILDCARD 1
-
-#define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb)
-
-#ifdef KERNEL
-void in_losing __P((struct inpcb *));
-int in_pcballoc __P((struct socket *, struct inpcbinfo *));
-int in_pcbbind __P((struct inpcb *, struct mbuf *));
-int in_pcbconnect __P((struct inpcb *, struct mbuf *));
-void in_pcbdetach __P((struct inpcb *));
-void in_pcbdisconnect __P((struct inpcb *));
-int in_pcbladdr __P((struct inpcb *, struct mbuf *,
- struct sockaddr_in **));
-struct inpcb *
- in_pcblookup __P((struct inpcbinfo *,
- struct in_addr, u_int, struct in_addr, u_int, int));
-struct inpcb *
- in_pcblookuphash __P((struct inpcbinfo *,
- struct in_addr, u_int, struct in_addr, u_int, int));
-void in_pcbnotify __P((struct inpcbhead *, struct sockaddr *,
- u_int, struct in_addr, u_int, int, void (*)(struct inpcb *, int)));
-void in_pcbrehash __P((struct inpcb *));
-void in_setpeeraddr __P((struct inpcb *, struct mbuf *));
-void in_setsockaddr __P((struct inpcb *, struct mbuf *));
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/netinet/in_proto.c b/c/src/exec/libnetworking/netinet/in_proto.c
deleted file mode 100644
index 3fa845955e..0000000000
--- a/c/src/exec/libnetworking/netinet/in_proto.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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_proto.c 8.2 (Berkeley) 2/9/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/radix.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/in_pcb.h>
-#include <netinet/igmp_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-/*
- * TCP/IP protocol family: IP, ICMP, UDP, TCP.
- */
-
-#ifdef IPXIP
-#include <netipx/ipx.h>
-#include <netipx/ipx_ip.h>
-#endif
-
-#ifdef NSIP
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-#endif
-
-#ifdef TPIP
-void tpip_input(), tpip_ctlinput(), tp_init(), tp_slowtimo(), tp_drain();
-int tp_ctloutput(), tp_usrreq();
-#endif
-
-#ifdef EON
-void eoninput(), eonctlinput(), eonprotoinit();
-#endif /* EON */
-
-extern struct domain inetdomain;
-
-struct protosw inetsw[] = {
-{ 0, &inetdomain, 0, 0,
- 0, 0, 0, 0,
- 0,
- ip_init, 0, ip_slowtimo, ip_drain
-},
-{ SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR,
- udp_input, 0, udp_ctlinput, ip_ctloutput,
- udp_usrreq,
- udp_init
-},
-{ SOCK_STREAM, &inetdomain, IPPROTO_TCP,
- PR_CONNREQUIRED|PR_IMPLOPCL|PR_WANTRCVD,
- tcp_input, 0, tcp_ctlinput, tcp_ctloutput,
- 0,
- tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain,
- &tcp_usrreqs
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR,
- rip_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR,
- icmp_input, 0, 0, rip_ctloutput,
- rip_usrreq
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_IGMP, PR_ATOMIC|PR_ADDR,
- igmp_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- igmp_init, igmp_fasttimo, igmp_slowtimo
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_RSVP, PR_ATOMIC|PR_ADDR,
- rsvp_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_IPIP, PR_ATOMIC|PR_ADDR,
- ipip_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-#ifdef IPDIVERT
-{ SOCK_RAW, &inetdomain, IPPROTO_DIVERT, PR_ATOMIC|PR_ADDR,
- div_input, 0, 0, ip_ctloutput,
- div_usrreq,
- div_init, 0, 0, 0,
-},
-#endif
-#ifdef TPIP
-{ SOCK_SEQPACKET,&inetdomain, IPPROTO_TP, PR_CONNREQUIRED|PR_WANTRCVD,
- tpip_input, 0, tpip_ctlinput, tp_ctloutput,
- tp_usrreq,
- tp_init, 0, tp_slowtimo, tp_drain,
-},
-#endif
-/* EON (ISO CLNL over IP) */
-#ifdef EON
-{ SOCK_RAW, &inetdomain, IPPROTO_EON, 0,
- eoninput, 0, eonctlinput, 0,
- 0,
- eonprotoinit, 0, 0, 0,
-},
-#endif
-#ifdef IPXIP
-{ SOCK_RAW, &inetdomain, IPPROTO_IDP, PR_ATOMIC|PR_ADDR,
- ipxip_input, 0, ipxip_ctlinput, 0,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-#endif
-#ifdef NSIP
-{ SOCK_RAW, &inetdomain, IPPROTO_IDP, PR_ATOMIC|PR_ADDR,
- idpip_input, 0, nsip_ctlinput, 0,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-#endif
- /* raw wildcard */
-{ SOCK_RAW, &inetdomain, 0, PR_ATOMIC|PR_ADDR,
- rip_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- rip_init, 0, 0, 0,
-},
-};
-
-extern int in_inithead(void **, int);
-
-struct domain inetdomain =
- { AF_INET, "internet", 0, 0, 0,
- inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])], 0,
- in_inithead, 32, sizeof(struct sockaddr_in)
- };
-
-DOMAIN_SET(inet);
-
-SYSCTL_NODE(_net, PF_INET, inet, CTLFLAG_RW, 0,
- "Internet Family");
-
-SYSCTL_NODE(_net_inet, IPPROTO_IP, ip, CTLFLAG_RW, 0, "IP");
-SYSCTL_NODE(_net_inet, IPPROTO_ICMP, icmp, CTLFLAG_RW, 0, "ICMP");
-SYSCTL_NODE(_net_inet, IPPROTO_UDP, udp, CTLFLAG_RW, 0, "UDP");
-SYSCTL_NODE(_net_inet, IPPROTO_TCP, tcp, CTLFLAG_RW, 0, "TCP");
-SYSCTL_NODE(_net_inet, IPPROTO_IGMP, igmp, CTLFLAG_RW, 0, "IGMP");
-#ifdef IPDIVERT
-SYSCTL_NODE(_net_inet, IPPROTO_DIVERT, div, CTLFLAG_RW, 0, "DIVERT");
-#endif
-
diff --git a/c/src/exec/libnetworking/netinet/in_rmx.c b/c/src/exec/libnetworking/netinet/in_rmx.c
deleted file mode 100644
index ba1793b3b4..0000000000
--- a/c/src/exec/libnetworking/netinet/in_rmx.c
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
- * Copyright 1994, 1995 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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.
- *
- * $Id$
- */
-
-/*
- * This code does two things necessary for the enhanced TCP metrics to
- * function in a useful manner:
- * 1) It marks all non-host routes as `cloning', thus ensuring that
- * every actual reference to such a route actually gets turned
- * into a reference to a host route to the specific destination
- * requested.
- * 2) When such routes lose all their references, it arranges for them
- * to be deleted in some random collection of circumstances, so that
- * a large quantity of stale routing data is not kept in kernel memory
- * indefinitely. See in_rtqtimo() below for the exact mechanism.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/queue.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/mbuf.h>
-#include <sys/syslog.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-
-#include <netinet/tcp.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-
-extern int in_inithead __P((void **head, int off));
-
-#define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */
-
-/*
- * Do what we need to do when inserting a route.
- */
-static struct radix_node *
-in_addroute(void *v_arg, void *n_arg, struct radix_node_head *head,
- struct radix_node *treenodes)
-{
- struct rtentry *rt = (struct rtentry *)treenodes;
- struct sockaddr_in *sin = (struct sockaddr_in *)rt_key(rt);
- struct radix_node *ret;
-
- /*
- * For IP, all unicast non-host routes are automatically cloning.
- */
- if(IN_MULTICAST(ntohl(sin->sin_addr.s_addr)))
- rt->rt_flags |= RTF_MULTICAST;
-
- if(!(rt->rt_flags & (RTF_HOST | RTF_CLONING | RTF_MULTICAST))) {
- rt->rt_flags |= RTF_PRCLONING;
- }
-
- /*
- * A little bit of help for both IP output and input:
- * For host routes, we make sure that RTF_BROADCAST
- * is set for anything that looks like a broadcast address.
- * This way, we can avoid an expensive call to in_broadcast()
- * in ip_output() most of the time (because the route passed
- * to ip_output() is almost always a host route).
- *
- * We also do the same for local addresses, with the thought
- * that this might one day be used to speed up ip_input().
- *
- * We also mark routes to multicast addresses as such, because
- * it's easy to do and might be useful (but this is much more
- * dubious since it's so easy to inspect the address). (This
- * is done above.)
- */
- if (rt->rt_flags & RTF_HOST) {
- if (in_broadcast(sin->sin_addr, rt->rt_ifp)) {
- rt->rt_flags |= RTF_BROADCAST;
- } else {
-#define satosin(sa) ((struct sockaddr_in *)sa)
- if (satosin(rt->rt_ifa->ifa_addr)->sin_addr.s_addr
- == sin->sin_addr.s_addr)
- rt->rt_flags |= RTF_LOCAL;
-#undef satosin
- }
- }
-
- /*
- * We also specify a send and receive pipe size for every
- * route added, to help TCP a bit. TCP doesn't actually
- * want a true pipe size, which would be prohibitive in memory
- * costs and is hard to compute anyway; it simply uses these
- * values to size its buffers. So, we fill them in with the
- * same values that TCP would have used anyway, and allow the
- * installing program or the link layer to override these values
- * as it sees fit. This will hopefully allow TCP more
- * opportunities to save its ssthresh value.
- */
- if (!rt->rt_rmx.rmx_sendpipe && !(rt->rt_rmx.rmx_locks & RTV_SPIPE))
- rt->rt_rmx.rmx_sendpipe = tcp_sendspace;
-
- if (!rt->rt_rmx.rmx_recvpipe && !(rt->rt_rmx.rmx_locks & RTV_RPIPE))
- rt->rt_rmx.rmx_recvpipe = tcp_recvspace;
-
- if (!rt->rt_rmx.rmx_mtu && !(rt->rt_rmx.rmx_locks & RTV_MTU)
- && rt->rt_ifp)
- rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu;
-
- ret = rn_addroute(v_arg, n_arg, head, treenodes);
- if (ret == NULL && rt->rt_flags & RTF_HOST) {
- struct rtentry *rt2;
- /*
- * We are trying to add a host route, but can't.
- * Find out if it is because of an
- * ARP entry and delete it if so.
- */
- rt2 = rtalloc1((struct sockaddr *)sin, 0,
- RTF_CLONING | RTF_PRCLONING);
- if (rt2) {
- if (rt2->rt_flags & RTF_LLINFO &&
- rt2->rt_flags & RTF_HOST &&
- rt2->rt_gateway &&
- rt2->rt_gateway->sa_family == AF_LINK) {
- rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt2),
- rt2->rt_gateway,
- rt_mask(rt2), rt2->rt_flags, 0);
- ret = rn_addroute(v_arg, n_arg, head,
- treenodes);
- }
- RTFREE(rt2);
- }
- }
- return ret;
-}
-
-/*
- * This code is the inverse of in_clsroute: on first reference, if we
- * were managing the route, stop doing so and set the expiration timer
- * back off again.
- */
-static struct radix_node *
-in_matroute(void *v_arg, struct radix_node_head *head)
-{
- struct radix_node *rn = rn_match(v_arg, head);
- struct rtentry *rt = (struct rtentry *)rn;
-
- if(rt && rt->rt_refcnt == 0) { /* this is first reference */
- if(rt->rt_flags & RTPRF_OURS) {
- rt->rt_flags &= ~RTPRF_OURS;
- rt->rt_rmx.rmx_expire = 0;
- }
- }
- return rn;
-}
-
-static int rtq_reallyold = 60*60;
- /* one hour is ``really old'' */
-SYSCTL_INT(_net_inet_ip, IPCTL_RTEXPIRE, rtexpire,
- CTLFLAG_RW, &rtq_reallyold , 0, "");
-
-static int rtq_minreallyold = 10;
- /* never automatically crank down to less */
-SYSCTL_INT(_net_inet_ip, IPCTL_RTMINEXPIRE, rtminexpire,
- CTLFLAG_RW, &rtq_minreallyold , 0, "");
-
-static int rtq_toomany = 128;
- /* 128 cached routes is ``too many'' */
-SYSCTL_INT(_net_inet_ip, IPCTL_RTMAXCACHE, rtmaxcache,
- CTLFLAG_RW, &rtq_toomany , 0, "");
-
-
-/*
- * On last reference drop, mark the route as belong to us so that it can be
- * timed out.
- */
-static void
-in_clsroute(struct radix_node *rn, struct radix_node_head *head)
-{
- struct rtentry *rt = (struct rtentry *)rn;
-
- if(!(rt->rt_flags & RTF_UP))
- return; /* prophylactic measures */
-
- if((rt->rt_flags & (RTF_LLINFO | RTF_HOST)) != RTF_HOST)
- return;
-
- if((rt->rt_flags & (RTF_WASCLONED | RTPRF_OURS))
- != RTF_WASCLONED)
- return;
-
- /*
- * As requested by David Greenman:
- * If rtq_reallyold is 0, just delete the route without
- * waiting for a timeout cycle to kill it.
- */
- if(rtq_reallyold != 0) {
- rt->rt_flags |= RTPRF_OURS;
- rt->rt_rmx.rmx_expire = rtems_bsdnet_seconds_since_boot() + rtq_reallyold;
- } else {
- rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt),
- rt->rt_gateway, rt_mask(rt),
- rt->rt_flags, 0);
- }
-}
-
-struct rtqk_arg {
- struct radix_node_head *rnh;
- int draining;
- int killed;
- int found;
- int updating;
- time_t nextstop;
-};
-
-/*
- * Get rid of old routes. When draining, this deletes everything, even when
- * the timeout is not expired yet. When updating, this makes sure that
- * nothing has a timeout longer than the current value of rtq_reallyold.
- */
-static int
-in_rtqkill(struct radix_node *rn, void *rock)
-{
- struct rtqk_arg *ap = rock;
- struct rtentry *rt = (struct rtentry *)rn;
- int err;
-
- if(rt->rt_flags & RTPRF_OURS) {
- ap->found++;
-
- if(ap->draining || rt->rt_rmx.rmx_expire <= rtems_bsdnet_seconds_since_boot()) {
- if(rt->rt_refcnt > 0)
- panic("rtqkill route really not free");
-
- err = rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt),
- rt->rt_gateway, rt_mask(rt),
- rt->rt_flags, 0);
- if(err) {
- log(LOG_WARNING, "in_rtqkill: error %d\n", err);
- } else {
- ap->killed++;
- }
- } else {
- if(ap->updating
- && (rt->rt_rmx.rmx_expire - rtems_bsdnet_seconds_since_boot()
- > rtq_reallyold)) {
- rt->rt_rmx.rmx_expire = rtems_bsdnet_seconds_since_boot()
- + rtq_reallyold;
- }
- ap->nextstop = lmin(ap->nextstop,
- rt->rt_rmx.rmx_expire);
- }
- }
-
- return 0;
-}
-
-#define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */
-static int rtq_timeout = RTQ_TIMEOUT;
-
-static void
-in_rtqtimo(void *rock)
-{
- struct radix_node_head *rnh = rock;
- struct rtqk_arg arg;
- struct timeval atv;
- static time_t last_adjusted_timeout = 0;
- int s;
-
- arg.found = arg.killed = 0;
- arg.rnh = rnh;
- arg.nextstop = rtems_bsdnet_seconds_since_boot() + rtq_timeout;
- arg.draining = arg.updating = 0;
- s = splnet();
- rnh->rnh_walktree(rnh, in_rtqkill, &arg);
- splx(s);
-
- /*
- * Attempt to be somewhat dynamic about this:
- * If there are ``too many'' routes sitting around taking up space,
- * then crank down the timeout, and see if we can't make some more
- * go away. However, we make sure that we will never adjust more
- * than once in rtq_timeout seconds, to keep from cranking down too
- * hard.
- */
- if((arg.found - arg.killed > rtq_toomany)
- && (rtems_bsdnet_seconds_since_boot() - last_adjusted_timeout >= rtq_timeout)
- && rtq_reallyold > rtq_minreallyold) {
- rtq_reallyold = 2*rtq_reallyold / 3;
- if(rtq_reallyold < rtq_minreallyold) {
- rtq_reallyold = rtq_minreallyold;
- }
-
- last_adjusted_timeout = rtems_bsdnet_seconds_since_boot();
-#ifdef DIAGNOSTIC
- log(LOG_DEBUG, "in_rtqtimo: adjusted rtq_reallyold to %d\n",
- rtq_reallyold);
-#endif
- arg.found = arg.killed = 0;
- arg.updating = 1;
- s = splnet();
- rnh->rnh_walktree(rnh, in_rtqkill, &arg);
- splx(s);
- }
-
- atv.tv_usec = 0;
- atv.tv_sec = arg.nextstop;
- timeout(in_rtqtimo, rock, hzto(&atv));
-}
-
-void
-in_rtqdrain(void)
-{
- struct radix_node_head *rnh = rt_tables[AF_INET];
- struct rtqk_arg arg;
- int s;
- arg.found = arg.killed = 0;
- arg.rnh = rnh;
- arg.nextstop = 0;
- arg.draining = 1;
- arg.updating = 0;
- s = splnet();
- rnh->rnh_walktree(rnh, in_rtqkill, &arg);
- splx(s);
-}
-
-/*
- * Initialize our routing tree.
- */
-int
-in_inithead(void **head, int off)
-{
- struct radix_node_head *rnh;
-
- if(!rn_inithead(head, off))
- return 0;
-
- if(head != (void **)&rt_tables[AF_INET]) /* BOGUS! */
- return 1; /* only do this for the real routing table */
-
- rnh = *head;
- rnh->rnh_addaddr = in_addroute;
- rnh->rnh_matchaddr = in_matroute;
- rnh->rnh_close = in_clsroute;
- in_rtqtimo(rnh); /* kick off timeout first time */
- return 1;
-}
-
diff --git a/c/src/exec/libnetworking/netinet/in_systm.h b/c/src/exec/libnetworking/netinet/in_systm.h
deleted file mode 100644
index d72e9b4665..0000000000
--- a/c/src/exec/libnetworking/netinet/in_systm.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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_systm.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IN_SYSTM_H_
-#define _NETINET_IN_SYSTM_H_
-
-/*
- * Miscellaneous internetwork
- * definitions for kernel.
- */
-
-/*
- * Network types.
- *
- * Internally the system keeps counters in the headers with the bytes
- * swapped so that VAX instructions will work on them. It reverses
- * the bytes before transmission at each protocol level. The n_ types
- * represent the types with the bytes in ``high-ender'' order.
- */
-typedef u_short n_short; /* short as received from the net */
-typedef u_long n_long; /* long as received from the net */
-
-typedef u_long n_time; /* ms since 00:00 GMT, byte rev */
-
-#ifdef KERNEL
-n_time iptime __P((void));
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/netinet/in_var.h b/c/src/exec/libnetworking/netinet/in_var.h
deleted file mode 100644
index e7a54d5e85..0000000000
--- a/c/src/exec/libnetworking/netinet/in_var.h
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 1985, 1986, 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_var.h 8.2 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _NETINET_IN_VAR_H_
-#define _NETINET_IN_VAR_H_
-
-#include <sys/queue.h>
-
-/*
- * Interface address, Internet version. One of these structures
- * is allocated for each interface with an Internet address.
- * The ifaddr structure contains the protocol-independent part
- * of the structure and is assumed to be first.
- */
-struct in_ifaddr {
- struct ifaddr ia_ifa; /* protocol-independent info */
-#define ia_ifp ia_ifa.ifa_ifp
-#define ia_flags ia_ifa.ifa_flags
- /* ia_{,sub}net{,mask} in host order */
- u_long ia_net; /* network number of interface */
- u_long ia_netmask; /* mask of net part */
- u_long ia_subnet; /* subnet number, including net */
- u_long ia_subnetmask; /* mask of subnet part */
- struct in_addr ia_netbroadcast; /* to recognize net broadcasts */
- struct in_ifaddr *ia_next; /* next in list of internet addresses */
- struct sockaddr_in ia_addr; /* reserve space for interface name */
- struct sockaddr_in ia_dstaddr; /* reserve space for broadcast addr */
-#define ia_broadaddr ia_dstaddr
- struct sockaddr_in ia_sockmask; /* reserve space for general netmask */
- LIST_HEAD(in_multihead, in_multi) ia_multiaddrs;
- /* list of multicast addresses */
-};
-
-struct in_aliasreq {
- char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- struct sockaddr_in ifra_addr;
- struct sockaddr_in ifra_broadaddr;
-#define ifra_dstaddr ifra_broadaddr
- struct sockaddr_in ifra_mask;
-};
-/*
- * Given a pointer to an in_ifaddr (ifaddr),
- * return a pointer to the addr as a sockaddr_in.
- */
-#define IA_SIN(ia) (&(((struct in_ifaddr *)(ia))->ia_addr))
-#define IA_DSTSIN(ia) (&(((struct in_ifaddr *)(ia))->ia_dstaddr))
-
-#define IN_LNAOF(in, ifa) \
- ((ntohl((in).s_addr) & ~((struct in_ifaddr *)(ifa)->ia_subnetmask))
-
-
-#ifdef KERNEL
-extern struct in_ifaddr *in_ifaddr;
-extern struct ifqueue ipintrq; /* ip packet input queue */
-extern struct in_addr zeroin_addr;
-extern u_char inetctlerrmap[];
-extern int rtq_reallyold; /* XXX */
-extern int rtq_minreallyold; /* XXX */
-extern int rtq_toomany; /* XXX */
-
-/*
- * Macro for finding the interface (ifnet structure) corresponding to one
- * of our IP addresses.
- */
-#define INADDR_TO_IFP(addr, ifp) \
- /* struct in_addr addr; */ \
- /* struct ifnet *ifp; */ \
-{ \
- register struct in_ifaddr *ia; \
-\
- for (ia = in_ifaddr; \
- ia != NULL && ((ia->ia_ifp->if_flags & IFF_POINTOPOINT)? \
- IA_DSTSIN(ia):IA_SIN(ia))->sin_addr.s_addr != (addr).s_addr; \
- ia = ia->ia_next) \
- continue; \
- if (ia == NULL) \
- for (ia = in_ifaddr; \
- ia != NULL; \
- ia = ia->ia_next) \
- if (ia->ia_ifp->if_flags & IFF_POINTOPOINT && \
- IA_SIN(ia)->sin_addr.s_addr == (addr).s_addr) \
- break; \
- (ifp) = (ia == NULL) ? NULL : ia->ia_ifp; \
-}
-
-/*
- * Macro for finding the internet address structure (in_ifaddr) corresponding
- * to a given interface (ifnet structure).
- */
-#define IFP_TO_IA(ifp, ia) \
- /* struct ifnet *ifp; */ \
- /* struct in_ifaddr *ia; */ \
-{ \
- for ((ia) = in_ifaddr; \
- (ia) != NULL && (ia)->ia_ifp != (ifp); \
- (ia) = (ia)->ia_next) \
- continue; \
-}
-#endif
-
-/*
- * This information should be part of the ifnet structure but we don't wish
- * to change that - as it might break a number of things
- */
-
-struct router_info {
- struct ifnet *rti_ifp;
- int rti_type; /* type of router which is querier on this interface */
- int rti_time; /* # of slow timeouts since last old query */
- struct router_info *rti_next;
-};
-
-/*
- * Internet multicast address structure. There is one of these for each IP
- * multicast group to which this host belongs on a given network interface.
- * They are kept in a linked list, rooted in the interface's in_ifaddr
- * structure.
- */
-struct in_multi {
- LIST_ENTRY(in_multi) inm_entry; /* list glue */
- struct in_addr inm_addr; /* IP multicast address */
- struct ifnet *inm_ifp; /* back pointer to ifnet */
- struct in_ifaddr *inm_ia; /* back pointer to in_ifaddr */
- u_int inm_refcount; /* no. membership claims by sockets */
- u_int inm_timer; /* IGMP membership report timer */
- u_int inm_state; /* state of the membership */
- struct router_info *inm_rti; /* router info*/
-};
-
-#ifdef KERNEL
-/*
- * Structure used by macros below to remember position when stepping through
- * all of the in_multi records.
- */
-struct in_multistep {
- struct in_ifaddr *i_ia;
- struct in_multi *i_inm;
-};
-
-/*
- * Macro for looking up the in_multi record for a given IP multicast address
- * on a given interface. If no matching record is found, "inm" returns NULL.
- */
-#define IN_LOOKUP_MULTI(addr, ifp, inm) \
- /* struct in_addr addr; */ \
- /* struct ifnet *ifp; */ \
- /* struct in_multi *inm; */ \
-{ \
- register struct in_ifaddr *ia; \
-\
- IFP_TO_IA((ifp), ia); \
- if (ia == NULL) \
- (inm) = NULL; \
- else \
- for ((inm) = ia->ia_multiaddrs.lh_first; \
- (inm) != NULL && (inm)->inm_addr.s_addr != (addr).s_addr; \
- (inm) = inm->inm_entry.le_next) \
- continue; \
-}
-
-/*
- * Macro to step through all of the in_multi records, one at a time.
- * The current position is remembered in "step", which the caller must
- * provide. IN_FIRST_MULTI(), below, must be called to initialize "step"
- * and get the first record. Both macros return a NULL "inm" when there
- * are no remaining records.
- */
-#define IN_NEXT_MULTI(step, inm) \
- /* struct in_multistep step; */ \
- /* struct in_multi *inm; */ \
-{ \
- if (((inm) = (step).i_inm) != NULL) \
- (step).i_inm = (inm)->inm_entry.le_next; \
- else \
- while ((step).i_ia != NULL) { \
- (inm) = (step).i_ia->ia_multiaddrs.lh_first; \
- (step).i_ia = (step).i_ia->ia_next; \
- if ((inm) != NULL) { \
- (step).i_inm = (inm)->inm_entry.le_next; \
- break; \
- } \
- } \
-}
-
-#define IN_FIRST_MULTI(step, inm) \
- /* struct in_multistep step; */ \
- /* struct in_multi *inm; */ \
-{ \
- (step).i_ia = in_ifaddr; \
- (step).i_inm = NULL; \
- IN_NEXT_MULTI((step), (inm)); \
-}
-
-struct in_multi *in_addmulti __P((struct in_addr *, struct ifnet *));
-void in_delmulti __P((struct in_multi *));
-int in_control __P((struct socket *, u_long, caddr_t, struct ifnet *));
-void in_rtqdrain __P((void));
-void ip_input __P((struct mbuf *));
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_IN_VAR_H_ */
diff --git a/c/src/exec/libnetworking/netinet/ip.h b/c/src/exec/libnetworking/netinet/ip.h
deleted file mode 100644
index e7f824ca6f..0000000000
--- a/c/src/exec/libnetworking/netinet/ip.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)ip.h 8.2 (Berkeley) 6/1/94
- * $Id$
- */
-
-#ifndef _NETINET_IP_H_
-#define _NETINET_IP_H_
-
-/*
- * Definitions for internet protocol version 4.
- * Per RFC 791, September 1981.
- */
-#define IPVERSION 4
-
-/*
- * Structure of an internet header, naked of options.
- *
- * We declare ip_len and ip_off to be short, rather than u_short
- * pragmatically since otherwise unsigned comparisons can result
- * against negative integers quite easily, and fail in subtle ways.
- */
-struct ip {
-#ifdef _IP_VHL
- u_char ip_vhl; /* version << 4 | header length >> 2 */
-#else
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char ip_hl:4, /* header length */
- ip_v:4; /* version */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char ip_v:4, /* version */
- ip_hl:4; /* header length */
-#endif
-#endif /* not _IP_VHL */
- u_char ip_tos; /* type of service */
- u_short ip_len; /* total length */
- u_short ip_id; /* identification */
- u_short ip_off; /* fragment offset field */
-#define IP_RF 0x8000 /* reserved fragment flag */
-#define IP_DF 0x4000 /* dont fragment flag */
-#define IP_MF 0x2000 /* more fragments flag */
-#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
- u_char ip_ttl; /* time to live */
- u_char ip_p; /* protocol */
- u_short ip_sum; /* checksum */
- struct in_addr ip_src,ip_dst; /* source and dest address */
-};
-
-#ifdef _IP_VHL
-#define IP_MAKE_VHL(v, hl) ((v) << 4 | (hl))
-#define IP_VHL_HL(vhl) ((vhl) & 0x0f)
-#define IP_VHL_V(vhl) ((vhl) >> 4)
-#define IP_VHL_BORING 0x45
-#endif
-
-#define IP_MAXPACKET 65535 /* maximum packet size */
-
-/*
- * Definitions for IP type of service (ip_tos)
- */
-#define IPTOS_LOWDELAY 0x10
-#define IPTOS_THROUGHPUT 0x08
-#define IPTOS_RELIABILITY 0x04
-#define IPTOS_MINCOST 0x02
-
-/*
- * Definitions for IP precedence (also in ip_tos) (hopefully unused)
- */
-#define IPTOS_PREC_NETCONTROL 0xe0
-#define IPTOS_PREC_INTERNETCONTROL 0xc0
-#define IPTOS_PREC_CRITIC_ECP 0xa0
-#define IPTOS_PREC_FLASHOVERRIDE 0x80
-#define IPTOS_PREC_FLASH 0x60
-#define IPTOS_PREC_IMMEDIATE 0x40
-#define IPTOS_PREC_PRIORITY 0x20
-#define IPTOS_PREC_ROUTINE 0x00
-
-/*
- * Definitions for options.
- */
-#define IPOPT_COPIED(o) ((o)&0x80)
-#define IPOPT_CLASS(o) ((o)&0x60)
-#define IPOPT_NUMBER(o) ((o)&0x1f)
-
-#define IPOPT_CONTROL 0x00
-#define IPOPT_RESERVED1 0x20
-#define IPOPT_DEBMEAS 0x40
-#define IPOPT_RESERVED2 0x60
-
-#define IPOPT_EOL 0 /* end of option list */
-#define IPOPT_NOP 1 /* no operation */
-
-#define IPOPT_RR 7 /* record packet route */
-#define IPOPT_TS 68 /* timestamp */
-#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
-#define IPOPT_LSRR 131 /* loose source route */
-#define IPOPT_SATID 136 /* satnet id */
-#define IPOPT_SSRR 137 /* strict source route */
-#define IPOPT_RA 148 /* router alert */
-
-/*
- * Offsets to fields in options other than EOL and NOP.
- */
-#define IPOPT_OPTVAL 0 /* option ID */
-#define IPOPT_OLEN 1 /* option length */
-#define IPOPT_OFFSET 2 /* offset within option */
-#define IPOPT_MINOFF 4 /* min value of above */
-
-/*
- * Time stamp option structure.
- */
-struct ip_timestamp {
- u_char ipt_code; /* IPOPT_TS */
- u_char ipt_len; /* size of structure (variable) */
- u_char ipt_ptr; /* index of current entry */
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char ipt_flg:4, /* flags, see below */
- ipt_oflw:4; /* overflow counter */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char ipt_oflw:4, /* overflow counter */
- ipt_flg:4; /* flags, see below */
-#endif
- union ipt_timestamp {
- n_long ipt_time[1];
- struct ipt_ta {
- struct in_addr ipt_addr;
- n_long ipt_time;
- } ipt_ta[1];
- } ipt_timestamp;
-};
-
-#include <machine/in_cksum.h>
-
-/* flag bits for ipt_flg */
-#define IPOPT_TS_TSONLY 0 /* timestamps only */
-#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
-#define IPOPT_TS_PRESPEC 3 /* specified modules only */
-
-/* bits for security (not byte swapped) */
-#define IPOPT_SECUR_UNCLASS 0x0000
-#define IPOPT_SECUR_CONFID 0xf135
-#define IPOPT_SECUR_EFTO 0x789a
-#define IPOPT_SECUR_MMMM 0xbc4d
-#define IPOPT_SECUR_RESTR 0xaf13
-#define IPOPT_SECUR_SECRET 0xd788
-#define IPOPT_SECUR_TOPSECRET 0x6bc5
-
-/*
- * Internet implementation parameters.
- */
-#define MAXTTL 255 /* maximum time to live (seconds) */
-#define IPDEFTTL 64 /* default ttl, from RFC 1340 */
-#define IPFRAGTTL 60 /* time to live for frags, slowhz */
-#define IPTTLDEC 1 /* subtracted when forwarding */
-
-#define IP_MSS 576 /* default maximum segment size */
-
-#endif
diff --git a/c/src/exec/libnetworking/netinet/ip_divert.c b/c/src/exec/libnetworking/netinet/ip_divert.c
deleted file mode 100644
index 2955e811ad..0000000000
--- a/c/src/exec/libnetworking/netinet/ip_divert.c
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/systm.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-
-/*
- * Divert sockets
- */
-
-/*
- * Allocate enough space to hold a full IP packet
- */
-#define DIVSNDQ (65536 + 100)
-#define DIVRCVQ (65536 + 100)
-
-/* Global variables */
-
-/*
- * ip_input() and ip_output() set this secret value before calling us to
- * let us know which divert port to divert a packet to; this is done so
- * we can use the existing prototype for struct protosw's pr_input().
- * This is stored in host order.
- */
-u_short ip_divert_port;
-
-/*
- * We set this value to a non-zero port number when we want the call to
- * ip_fw_chk() in ip_input() or ip_output() to ignore ``divert <port>''
- * chain entries. This is stored in host order.
- */
-u_short ip_divert_ignore;
-
-/* Internal variables */
-
-static struct inpcbhead divcb;
-static struct inpcbinfo divcbinfo;
-
-static u_long div_sendspace = DIVSNDQ; /* XXX sysctl ? */
-static u_long div_recvspace = DIVRCVQ; /* XXX sysctl ? */
-
-/* Optimization: have this preinitialized */
-static struct sockaddr_in divsrc = { sizeof(divsrc), AF_INET };
-
-/* Internal functions */
-
-static int div_output(struct socket *so,
- struct mbuf *m, struct mbuf *addr, struct mbuf *control);
-
-/*
- * Initialize divert connection block queue.
- */
-void
-div_init(void)
-{
- LIST_INIT(&divcb);
- divcbinfo.listhead = &divcb;
- /*
- * XXX We don't use the hash list for divert IP, but it's easier
- * to allocate a one entry hash list than it is to check all
- * over the place for hashbase == NULL.
- */
- divcbinfo.hashbase = hashinit(1, M_PCB, &divcbinfo.hashmask);
-}
-
-/*
- * Setup generic address and protocol structures
- * for div_input routine, then pass them along with
- * mbuf chain. ip->ip_len is assumed to have had
- * the header length (hlen) subtracted out already.
- * We tell whether the packet was incoming or outgoing
- * by seeing if hlen == 0, which is a hack.
- */
-void
-div_input(struct mbuf *m, int hlen)
-{
- struct ip *ip;
- struct inpcb *inp;
- struct socket *sa;
-
- /* Sanity check */
- if (ip_divert_port == 0)
- panic("div_input: port is 0");
-
- /* Assure header */
- if (m->m_len < sizeof(struct ip) &&
- (m = m_pullup(m, sizeof(struct ip))) == 0) {
- return;
- }
- ip = mtod(m, struct ip *);
-
- /* Record divert port */
- divsrc.sin_port = htons(ip_divert_port);
-
- /* Restore packet header fields */
- ip->ip_len += hlen;
- HTONS(ip->ip_len);
- HTONS(ip->ip_off);
-
- /* Record receive interface address, if any */
- divsrc.sin_addr.s_addr = 0;
- if (hlen) {
- struct ifaddr *ifa;
-
-#ifdef DIAGNOSTIC
- /* Sanity check */
- if (!(m->m_flags & M_PKTHDR))
- panic("div_input: no pkt hdr");
-#endif
-
- /* More fields affected by ip_input() */
- HTONS(ip->ip_id);
-
- /* Find IP address for recieve interface */
- for (ifa = m->m_pkthdr.rcvif->if_addrlist;
- ifa != NULL; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr == NULL)
- continue;
- if (ifa->ifa_addr->sa_family != AF_INET)
- continue;
- divsrc.sin_addr =
- ((struct sockaddr_in *) ifa->ifa_addr)->sin_addr;
- break;
- }
- }
-
- /* Put packet on socket queue, if any */
- sa = NULL;
- for (inp = divcb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_lport == htons(ip_divert_port))
- sa = inp->inp_socket;
- }
- if (sa) {
- if (sbappendaddr(&sa->so_rcv, (struct sockaddr *)&divsrc,
- m, (struct mbuf *)0) == 0)
- m_freem(m);
- else
- sorwakeup(sa);
- } else {
- m_freem(m);
- ipstat.ips_noproto++;
- ipstat.ips_delivered--;
- }
-}
-
-/*
- * Deliver packet back into the IP processing machinery.
- *
- * If no address specified, or address is 0.0.0.0, send to ip_output();
- * otherwise, send to ip_input() and mark as having been received on
- * the interface with that address.
- *
- * If no address specified, or dest port is 0, allow packet to divert
- * back to this socket; otherwise, don't.
- */
-static int
-div_output(so, m, addr, control)
- struct socket *so;
- register struct mbuf *m;
- struct mbuf *addr, *control;
-{
- register struct inpcb *const inp = sotoinpcb(so);
- register struct ip *const ip = mtod(m, struct ip *);
- struct sockaddr_in *sin = NULL;
- int error = 0;
-
- if (control)
- m_freem(control); /* XXX */
- if (addr)
- sin = mtod(addr, struct sockaddr_in *);
-
- /* Loopback avoidance option */
- ip_divert_ignore = ntohs(inp->inp_lport);
-
- /* Reinject packet into the system as incoming or outgoing */
- if (!sin || sin->sin_addr.s_addr == 0) {
- /* Don't allow both user specified and setsockopt options,
- and don't allow packet length sizes that will crash */
- if (((ip->ip_hl != (sizeof (*ip) >> 2)) && inp->inp_options) ||
- ((u_short)ntohs(ip->ip_len) > m->m_pkthdr.len)) {
- error = EINVAL;
- goto cantsend;
- }
-
- /* Convert fields to host order for ip_output() */
- NTOHS(ip->ip_len);
- NTOHS(ip->ip_off);
-
- /* Send packet to output processing */
- ipstat.ips_rawout++; /* XXX */
- error = ip_output(m, inp->inp_options, &inp->inp_route,
- (so->so_options & SO_DONTROUTE) |
- IP_ALLOWBROADCAST | IP_RAWOUTPUT, inp->inp_moptions);
- } else {
- struct ifaddr *ifa;
-
- /* Find receive interface with the given IP address */
- sin->sin_port = 0;
- if ((ifa = ifa_ifwithaddr((struct sockaddr *) sin)) == 0) {
- error = EADDRNOTAVAIL;
- goto cantsend;
- }
- m->m_pkthdr.rcvif = ifa->ifa_ifp;
-
- /* Send packet to input processing */
- ip_input(m);
- }
-
- /* Reset for next time (and other packets) */
- ip_divert_ignore = 0;
- return error;
-
-cantsend:
- ip_divert_ignore = 0;
- m_freem(m);
- return error;
-}
-
-/*ARGSUSED*/
-int
-div_usrreq(so, req, m, nam, control)
- register struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register int error = 0;
- register struct inpcb *inp = sotoinpcb(so);
- int s;
-
- if (inp == NULL && req != PRU_ATTACH) {
- error = EINVAL;
- goto release;
- }
- switch (req) {
-
- case PRU_ATTACH:
- if (inp)
- panic("div_attach");
- if ((so->so_state & SS_PRIV) == 0) {
- error = EACCES;
- break;
- }
- s = splnet();
- error = in_pcballoc(so, &divcbinfo);
- splx(s);
- if (error)
- break;
- error = soreserve(so, div_sendspace, div_recvspace);
- if (error)
- break;
- inp = (struct inpcb *)so->so_pcb;
- inp->inp_ip_p = (int)nam; /* XXX */
- inp->inp_flags |= INP_HDRINCL;
- /* The socket is always "connected" because
- we always know "where" to send the packet */
- so->so_state |= SS_ISCONNECTED;
- break;
-
- case PRU_DISCONNECT:
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- error = ENOTCONN;
- break;
- }
- /* FALLTHROUGH */
- case PRU_ABORT:
- soisdisconnected(so);
- /* FALLTHROUGH */
- case PRU_DETACH:
- if (inp == 0)
- panic("div_detach");
- in_pcbdetach(inp);
- break;
-
- case PRU_BIND:
- s = splnet();
- error = in_pcbbind(inp, nam);
- splx(s);
- break;
-
- /*
- * Mark the connection as being incapable of further input.
- */
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- case PRU_SEND:
- /* Packet must have a header (but that's about it) */
- if (m->m_len < sizeof (struct ip) ||
- (m = m_pullup(m, sizeof (struct ip))) == 0) {
- ipstat.ips_toosmall++;
- error = EINVAL;
- break;
- }
-
- /* Send packet */
- error = div_output(so, m, nam, control);
- m = NULL;
- break;
-
- case PRU_SOCKADDR:
- in_setsockaddr(inp, nam);
- break;
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- /*
- * Not supported.
- */
- case PRU_CONNECT:
- case PRU_CONNECT2:
- case PRU_CONTROL:
- case PRU_RCVOOB:
- case PRU_RCVD:
- case PRU_LISTEN:
- case PRU_ACCEPT:
- case PRU_SENDOOB:
- case PRU_PEERADDR:
- error = EOPNOTSUPP;
- break;
-
- default:
- panic("div_usrreq");
- }
-release:
- if (m)
- m_freem(m);
- return (error);
-}
diff --git a/c/src/exec/libnetworking/netinet/ip_fw.c b/c/src/exec/libnetworking/netinet/ip_fw.c
deleted file mode 100644
index aeb09b0bbe..0000000000
--- a/c/src/exec/libnetworking/netinet/ip_fw.c
+++ /dev/null
@@ -1,1069 +0,0 @@
-/*
- * Copyright (c) 1996 Alex Nash
- * Copyright (c) 1993 Daniel Boulet
- * Copyright (c) 1994 Ugen J.S.Antsilevich
- *
- * Redistribution and use in source forms, with and without modification,
- * are permitted provided that this entire comment appears intact.
- *
- * Redistribution in binary form may occur without any restrictions.
- * Obviously, it would be nice if you gave credit where credit is due
- * but requiring it would be too onerous.
- *
- * This software is provided ``AS IS'' without any warranties of any kind.
- *
- * $Id$
- */
-
-/*
- * Implement IP packet firewall
- */
-
-#ifndef IPFIREWALL_MODULE
-#include "opt_ipfw.h"
-#endif
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/queue.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/sysctl.h>
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_fw.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#include <netinet/udp.h>
-
-static int fw_debug = 1;
-#ifdef IPFIREWALL_VERBOSE
-static int fw_verbose = 1;
-#else
-static int fw_verbose = 0;
-#endif
-#ifdef IPFIREWALL_VERBOSE_LIMIT
-static int fw_verbose_limit = IPFIREWALL_VERBOSE_LIMIT;
-#else
-static int fw_verbose_limit = 0;
-#endif
-
-LIST_HEAD (ip_fw_head, ip_fw_chain) ip_fw_chain;
-
-#ifdef SYSCTL_NODE
-SYSCTL_NODE(_net_inet_ip, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, debug, CTLFLAG_RW, &fw_debug, 0, "");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose, CTLFLAG_RW, &fw_verbose, 0, "");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose_limit, CTLFLAG_RW, &fw_verbose_limit, 0, "");
-#endif
-
-#define dprintf(a) if (!fw_debug); else printf a
-
-#define print_ip(a) printf("%ld.%ld.%ld.%ld",(ntohl(a.s_addr)>>24)&0xFF,\
- (ntohl(a.s_addr)>>16)&0xFF,\
- (ntohl(a.s_addr)>>8)&0xFF,\
- (ntohl(a.s_addr))&0xFF);
-
-#define dprint_ip(a) if (!fw_debug); else print_ip(a)
-
-static int add_entry __P((struct ip_fw_head *chainptr, struct ip_fw *frwl));
-static int del_entry __P((struct ip_fw_head *chainptr, u_short number));
-static int zero_entry __P((struct mbuf *m));
-static struct ip_fw *check_ipfw_struct __P((struct ip_fw *m));
-static struct ip_fw *check_ipfw_mbuf __P((struct mbuf *fw));
-static int ipopts_match __P((struct ip *ip, struct ip_fw *f));
-static int port_match __P((u_short *portptr, int nports, u_short port,
- int range_flag));
-static int tcpflg_match __P((struct tcphdr *tcp, struct ip_fw *f));
-static int icmptype_match __P((struct icmp * icmp, struct ip_fw * f));
-static void ipfw_report __P((struct ip_fw *f, struct ip *ip,
- struct ifnet *rif, struct ifnet *oif));
-
-#ifdef IPFIREWALL_MODULE
-static ip_fw_chk_t *old_chk_ptr;
-static ip_fw_ctl_t *old_ctl_ptr;
-#endif
-
-static int ip_fw_chk __P((struct ip **pip, int hlen,
- struct ifnet *oif, int ignport, struct mbuf **m));
-static int ip_fw_ctl __P((int stage, struct mbuf **mm));
-
-static char err_prefix[] = "ip_fw_ctl:";
-
-/*
- * Returns 1 if the port is matched by the vector, 0 otherwise
- */
-static inline int
-port_match(u_short *portptr, int nports, u_short port, int range_flag)
-{
- if (!nports)
- return 1;
- if (range_flag) {
- if (portptr[0] <= port && port <= portptr[1]) {
- return 1;
- }
- nports -= 2;
- portptr += 2;
- }
- while (nports-- > 0) {
- if (*portptr++ == port) {
- return 1;
- }
- }
- return 0;
-}
-
-static int
-tcpflg_match(struct tcphdr *tcp, struct ip_fw *f)
-{
- u_char flg_set, flg_clr;
-
- if ((f->fw_tcpf & IP_FW_TCPF_ESTAB) &&
- (tcp->th_flags & (IP_FW_TCPF_RST | IP_FW_TCPF_ACK)))
- return 1;
-
- flg_set = tcp->th_flags & f->fw_tcpf;
- flg_clr = tcp->th_flags & f->fw_tcpnf;
-
- if (flg_set != f->fw_tcpf)
- return 0;
- if (flg_clr)
- return 0;
-
- return 1;
-}
-
-static int
-icmptype_match(struct icmp *icmp, struct ip_fw *f)
-{
- int type;
-
- if (!(f->fw_flg & IP_FW_F_ICMPBIT))
- return(1);
-
- type = icmp->icmp_type;
-
- /* check for matching type in the bitmap */
- if (type < IP_FW_ICMPTYPES_DIM * sizeof(unsigned) * 8 &&
- (f->fw_icmptypes[type / (sizeof(unsigned) * 8)] &
- (1U << (type % (8 * sizeof(unsigned))))))
- return(1);
-
- return(0); /* no match */
-}
-
-static int
-ipopts_match(struct ip *ip, struct ip_fw *f)
-{
- register u_char *cp;
- int opt, optlen, cnt;
- u_char opts, nopts, nopts_sve;
-
- cp = (u_char *)(ip + 1);
- cnt = (ip->ip_hl << 2) - sizeof (struct ip);
- opts = f->fw_ipopt;
- nopts = nopts_sve = f->fw_ipnopt;
-
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[IPOPT_OLEN];
- if (optlen <= 0 || optlen > cnt) {
- return 0; /*XXX*/
- }
- }
- switch (opt) {
-
- default:
- break;
-
- case IPOPT_LSRR:
- opts &= ~IP_FW_IPOPT_LSRR;
- nopts &= ~IP_FW_IPOPT_LSRR;
- break;
-
- case IPOPT_SSRR:
- opts &= ~IP_FW_IPOPT_SSRR;
- nopts &= ~IP_FW_IPOPT_SSRR;
- break;
-
- case IPOPT_RR:
- opts &= ~IP_FW_IPOPT_RR;
- nopts &= ~IP_FW_IPOPT_RR;
- break;
- case IPOPT_TS:
- opts &= ~IP_FW_IPOPT_TS;
- nopts &= ~IP_FW_IPOPT_TS;
- break;
- }
- if (opts == nopts)
- break;
- }
- if (opts == 0 && nopts == nopts_sve)
- return 1;
- else
- return 0;
-}
-
-static inline int
-iface_match(struct ifnet *ifp, union ip_fw_if *ifu, int byname)
-{
- /* Check by name or by IP address */
- if (byname) {
- /* Check unit number (-1 is wildcard) */
- if (ifu->fu_via_if.unit != -1
- && ifp->if_unit != ifu->fu_via_if.unit)
- return(0);
- /* Check name */
- if (strncmp(ifp->if_name, ifu->fu_via_if.name, FW_IFNLEN))
- return(0);
- return(1);
- } else if (ifu->fu_via_ip.s_addr != 0) { /* Zero == wildcard */
- struct ifaddr *ia;
-
- for (ia = ifp->if_addrlist; ia; ia = ia->ifa_next) {
- if (ia->ifa_addr == NULL)
- continue;
- if (ia->ifa_addr->sa_family != AF_INET)
- continue;
- if (ifu->fu_via_ip.s_addr != ((struct sockaddr_in *)
- (ia->ifa_addr))->sin_addr.s_addr)
- continue;
- return(1);
- }
- return(0);
- }
- return(1);
-}
-
-static void
-ipfw_report(struct ip_fw *f, struct ip *ip,
- struct ifnet *rif, struct ifnet *oif)
-{
- static int counter;
- struct tcphdr *const tcp = (struct tcphdr *) ((u_long *) ip+ ip->ip_hl);
- struct udphdr *const udp = (struct udphdr *) ((u_long *) ip+ ip->ip_hl);
- struct icmp *const icmp = (struct icmp *) ((u_long *) ip + ip->ip_hl);
- int count;
-
- count = f ? f->fw_pcnt : ++counter;
- if (fw_verbose_limit != 0 && count > fw_verbose_limit)
- return;
-
- /* Print command name */
- printf("ipfw: %d ", f ? f->fw_number : -1);
- if (!f)
- printf("Refuse");
- else
- switch (f->fw_flg & IP_FW_F_COMMAND) {
- case IP_FW_F_DENY:
- printf("Deny");
- break;
- case IP_FW_F_REJECT:
- if (f->fw_reject_code == IP_FW_REJECT_RST)
- printf("Reset");
- else
- printf("Unreach");
- break;
- case IP_FW_F_ACCEPT:
- printf("Accept");
- break;
- case IP_FW_F_COUNT:
- printf("Count");
- break;
- case IP_FW_F_DIVERT:
- printf("Divert %d", f->fw_divert_port);
- break;
- case IP_FW_F_TEE:
- printf("Tee %d", f->fw_divert_port);
- break;
- case IP_FW_F_SKIPTO:
- printf("SkipTo %d", f->fw_skipto_rule);
- break;
- default:
- printf("UNKNOWN");
- break;
- }
- printf(" ");
-
- switch (ip->ip_p) {
- case IPPROTO_TCP:
- printf("TCP ");
- print_ip(ip->ip_src);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d ", ntohs(tcp->th_sport));
- else
- printf(" ");
- print_ip(ip->ip_dst);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d", ntohs(tcp->th_dport));
- break;
- case IPPROTO_UDP:
- printf("UDP ");
- print_ip(ip->ip_src);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d ", ntohs(udp->uh_sport));
- else
- printf(" ");
- print_ip(ip->ip_dst);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d", ntohs(udp->uh_dport));
- break;
- case IPPROTO_ICMP:
- printf("ICMP:%u.%u ", icmp->icmp_type, icmp->icmp_code);
- print_ip(ip->ip_src);
- printf(" ");
- print_ip(ip->ip_dst);
- break;
- default:
- printf("P:%d ", ip->ip_p);
- print_ip(ip->ip_src);
- printf(" ");
- print_ip(ip->ip_dst);
- break;
- }
- if (oif)
- printf(" out via %s%d", oif->if_name, oif->if_unit);
- else if (rif)
- printf(" in via %s%d", rif->if_name, rif->if_unit);
- if ((ip->ip_off & IP_OFFMASK))
- printf(" Fragment = %d",ip->ip_off & IP_OFFMASK);
- printf("\n");
- if (fw_verbose_limit != 0 && count == fw_verbose_limit)
- printf("ipfw: limit reached on rule #%d\n",
- f ? f->fw_number : -1);
-}
-
-/*
- * Parameters:
- *
- * ip Pointer to packet header (struct ip *)
- * hlen Packet header length
- * oif Outgoing interface, or NULL if packet is incoming
- * ignport Ignore all divert/tee rules to this port (if non-zero)
- * *m The packet; we set to NULL when/if we nuke it.
- *
- * Return value:
- *
- * 0 The packet is to be accepted and routed normally OR
- * the packet was denied/rejected and has been dropped;
- * in the latter case, *m is equal to NULL upon return.
- * port Divert the packet to port.
- */
-
-static int
-ip_fw_chk(struct ip **pip, int hlen,
- struct ifnet *oif, int ignport, struct mbuf **m)
-{
- struct ip_fw_chain *chain;
- struct ip_fw *rule = NULL;
- struct ip *ip = *pip;
- struct ifnet *const rif = (*m)->m_pkthdr.rcvif;
- u_short offset = (ip->ip_off & IP_OFFMASK);
- u_short src_port, dst_port;
-
- /*
- * Go down the chain, looking for enlightment
- */
- for (chain=ip_fw_chain.lh_first; chain; chain = chain->chain.le_next) {
- register struct ip_fw *const f = chain->rule;
-
- /* Check direction inbound */
- if (!oif && !(f->fw_flg & IP_FW_F_IN))
- continue;
-
- /* Check direction outbound */
- if (oif && !(f->fw_flg & IP_FW_F_OUT))
- continue;
-
- /* Fragments */
- if ((f->fw_flg & IP_FW_F_FRAG) && !(ip->ip_off & IP_OFFMASK))
- continue;
-
- /* If src-addr doesn't match, not this rule. */
- if (((f->fw_flg & IP_FW_F_INVSRC) != 0) ^ ((ip->ip_src.s_addr
- & f->fw_smsk.s_addr) != f->fw_src.s_addr))
- continue;
-
- /* If dest-addr doesn't match, not this rule. */
- if (((f->fw_flg & IP_FW_F_INVDST) != 0) ^ ((ip->ip_dst.s_addr
- & f->fw_dmsk.s_addr) != f->fw_dst.s_addr))
- continue;
-
- /* Interface check */
- if ((f->fw_flg & IF_FW_F_VIAHACK) == IF_FW_F_VIAHACK) {
- struct ifnet *const iface = oif ? oif : rif;
-
- /* Backwards compatibility hack for "via" */
- if (!iface || !iface_match(iface,
- &f->fw_in_if, f->fw_flg & IP_FW_F_OIFNAME))
- continue;
- } else {
- /* Check receive interface */
- if ((f->fw_flg & IP_FW_F_IIFACE)
- && (!rif || !iface_match(rif,
- &f->fw_in_if, f->fw_flg & IP_FW_F_IIFNAME)))
- continue;
- /* Check outgoing interface */
- if ((f->fw_flg & IP_FW_F_OIFACE)
- && (!oif || !iface_match(oif,
- &f->fw_out_if, f->fw_flg & IP_FW_F_OIFNAME)))
- continue;
- }
-
- /* Check IP options */
- if (f->fw_ipopt != f->fw_ipnopt && !ipopts_match(ip, f))
- continue;
-
- /* Check protocol; if wildcard, match */
- if (f->fw_prot == IPPROTO_IP)
- goto got_match;
-
- /* If different, don't match */
- if (ip->ip_p != f->fw_prot)
- continue;
-
-#define PULLUP_TO(len) do { \
- if ((*m)->m_len < (len) \
- && (*m = m_pullup(*m, (len))) == 0) { \
- goto bogusfrag; \
- } \
- *pip = ip = mtod(*m, struct ip *); \
- offset = (ip->ip_off & IP_OFFMASK); \
- } while (0)
-
- /* Protocol specific checks */
- switch (ip->ip_p) {
- case IPPROTO_TCP:
- {
- struct tcphdr *tcp;
-
- if (offset == 1) /* cf. RFC 1858 */
- goto bogusfrag;
- if (offset != 0) {
- /*
- * TCP flags and ports aren't available in this
- * packet -- if this rule specified either one,
- * we consider the rule a non-match.
- */
- if (f->fw_nports != 0 ||
- f->fw_tcpf != f->fw_tcpnf)
- continue;
-
- break;
- }
- PULLUP_TO(hlen + 14);
- tcp = (struct tcphdr *) ((u_long *)ip + ip->ip_hl);
- if (f->fw_tcpf != f->fw_tcpnf && !tcpflg_match(tcp, f))
- continue;
- src_port = ntohs(tcp->th_sport);
- dst_port = ntohs(tcp->th_dport);
- goto check_ports;
- }
-
- case IPPROTO_UDP:
- {
- struct udphdr *udp;
-
- if (offset != 0) {
- /*
- * Port specification is unavailable -- if this
- * rule specifies a port, we consider the rule
- * a non-match.
- */
- if (f->fw_nports != 0)
- continue;
-
- break;
- }
- PULLUP_TO(hlen + 4);
- udp = (struct udphdr *) ((u_long *)ip + ip->ip_hl);
- src_port = ntohs(udp->uh_sport);
- dst_port = ntohs(udp->uh_dport);
-check_ports:
- if (!port_match(&f->fw_pts[0],
- IP_FW_GETNSRCP(f), src_port,
- f->fw_flg & IP_FW_F_SRNG))
- continue;
- if (!port_match(&f->fw_pts[IP_FW_GETNSRCP(f)],
- IP_FW_GETNDSTP(f), dst_port,
- f->fw_flg & IP_FW_F_DRNG))
- continue;
- break;
- }
-
- case IPPROTO_ICMP:
- {
- struct icmp *icmp;
-
- if (offset != 0) /* Type isn't valid */
- break;
- PULLUP_TO(hlen + 2);
- icmp = (struct icmp *) ((u_long *)ip + ip->ip_hl);
- if (!icmptype_match(icmp, f))
- continue;
- break;
- }
-#undef PULLUP_TO
-
-bogusfrag:
- if (fw_verbose)
- ipfw_report(NULL, ip, rif, oif);
- goto dropit;
- }
-
-got_match:
- /* Ignore divert/tee rule if socket port is "ignport" */
- switch (f->fw_flg & IP_FW_F_COMMAND) {
- case IP_FW_F_DIVERT:
- case IP_FW_F_TEE:
- if (f->fw_divert_port == ignport)
- continue; /* ignore this rule */
- break;
- }
-
- /* Update statistics */
- f->fw_pcnt += 1;
- f->fw_bcnt += ip->ip_len;
- f->timestamp = rtems_bsdnet_seconds_since_boot();
-
- /* Log to console if desired */
- if ((f->fw_flg & IP_FW_F_PRN) && fw_verbose)
- ipfw_report(f, ip, rif, oif);
-
- /* Take appropriate action */
- switch (f->fw_flg & IP_FW_F_COMMAND) {
- case IP_FW_F_ACCEPT:
- return(0);
- case IP_FW_F_COUNT:
- continue;
- case IP_FW_F_DIVERT:
- return(f->fw_divert_port);
- case IP_FW_F_TEE:
- /*
- * XXX someday tee packet here, but beware that you
- * can't use m_copym() or m_copypacket() because
- * the divert input routine modifies the mbuf
- * (and these routines only increment reference
- * counts in the case of mbuf clusters), so need
- * to write custom routine.
- */
- continue;
- case IP_FW_F_SKIPTO:
-#ifdef DIAGNOSTIC
- while (chain->chain.le_next
- && chain->chain.le_next->rule->fw_number
- < f->fw_skipto_rule)
-#else
- while (chain->chain.le_next->rule->fw_number
- < f->fw_skipto_rule)
-#endif
- chain = chain->chain.le_next;
- continue;
- }
-
- /* Deny/reject this packet using this rule */
- rule = f;
- break;
- }
-
-#ifdef DIAGNOSTIC
- /* Rule 65535 should always be there and should always match */
- if (!chain)
- panic("ip_fw: chain");
-#endif
-
- /*
- * At this point, we're going to drop the packet.
- * Send a reject notice if all of the following are true:
- *
- * - The packet matched a reject rule
- * - The packet is not an ICMP packet
- * - The packet is not a multicast or broadcast packet
- */
- if ((rule->fw_flg & IP_FW_F_COMMAND) == IP_FW_F_REJECT
- && ip->ip_p != IPPROTO_ICMP
- && !((*m)->m_flags & (M_BCAST|M_MCAST))
- && !IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- switch (rule->fw_reject_code) {
- case IP_FW_REJECT_RST:
- {
- struct tcphdr *const tcp =
- (struct tcphdr *) ((u_long *)ip + ip->ip_hl);
- struct tcpiphdr ti, *const tip = (struct tcpiphdr *) ip;
-
- if (offset != 0 || (tcp->th_flags & TH_RST))
- break;
- ti.ti_i = *((struct ipovly *) ip);
- ti.ti_t = *tcp;
- bcopy(&ti, ip, sizeof(ti));
- NTOHL(tip->ti_seq);
- NTOHL(tip->ti_ack);
- tip->ti_len = ip->ip_len - hlen - (tip->ti_off << 2);
- if (tcp->th_flags & TH_ACK) {
- tcp_respond(NULL, tip, *m,
- (tcp_seq)0, ntohl(tcp->th_ack), TH_RST);
- } else {
- if (tcp->th_flags & TH_SYN)
- tip->ti_len++;
- tcp_respond(NULL, tip, *m, tip->ti_seq
- + tip->ti_len, (tcp_seq)0, TH_RST|TH_ACK);
- }
- *m = NULL;
- break;
- }
- default: /* Send an ICMP unreachable using code */
- icmp_error(*m, ICMP_UNREACH,
- rule->fw_reject_code, 0L, 0);
- *m = NULL;
- break;
- }
- }
-
-dropit:
- /*
- * Finally, drop the packet.
- */
- if (*m) {
- m_freem(*m);
- *m = NULL;
- }
- return(0);
-}
-
-static int
-add_entry(struct ip_fw_head *chainptr, struct ip_fw *frwl)
-{
- struct ip_fw *ftmp = 0;
- struct ip_fw_chain *fwc = 0, *fcp, *fcpl = 0;
- u_short nbr = 0;
- int s;
-
- fwc = malloc(sizeof *fwc, M_IPFW, M_DONTWAIT);
- ftmp = malloc(sizeof *ftmp, M_IPFW, M_DONTWAIT);
- if (!fwc || !ftmp) {
- dprintf(("%s malloc said no\n", err_prefix));
- if (fwc) free(fwc, M_IPFW);
- if (ftmp) free(ftmp, M_IPFW);
- return (ENOSPC);
- }
-
- bcopy(frwl, ftmp, sizeof(struct ip_fw));
- ftmp->fw_in_if.fu_via_if.name[FW_IFNLEN - 1] = '\0';
- ftmp->fw_pcnt = 0L;
- ftmp->fw_bcnt = 0L;
- fwc->rule = ftmp;
-
- s = splnet();
-
- if (!chainptr->lh_first) {
- LIST_INSERT_HEAD(chainptr, fwc, chain);
- splx(s);
- return(0);
- } else if (ftmp->fw_number == (u_short)-1) {
- if (fwc) free(fwc, M_IPFW);
- if (ftmp) free(ftmp, M_IPFW);
- splx(s);
- dprintf(("%s bad rule number\n", err_prefix));
- return (EINVAL);
- }
-
- /* If entry number is 0, find highest numbered rule and add 100 */
- if (ftmp->fw_number == 0) {
- for (fcp = chainptr->lh_first; fcp; fcp = fcp->chain.le_next) {
- if (fcp->rule->fw_number != (u_short)-1)
- nbr = fcp->rule->fw_number;
- else
- break;
- }
- if (nbr < (u_short)-1 - 100)
- nbr += 100;
- ftmp->fw_number = nbr;
- }
-
- /* Got a valid number; now insert it, keeping the list ordered */
- for (fcp = chainptr->lh_first; fcp; fcp = fcp->chain.le_next) {
- if (fcp->rule->fw_number > ftmp->fw_number) {
- if (fcpl) {
- LIST_INSERT_AFTER(fcpl, fwc, chain);
- } else {
- LIST_INSERT_HEAD(chainptr, fwc, chain);
- }
- break;
- } else {
- fcpl = fcp;
- }
- }
-
- splx(s);
- return (0);
-}
-
-static int
-del_entry(struct ip_fw_head *chainptr, u_short number)
-{
- struct ip_fw_chain *fcp;
- int s;
-
- s = splnet();
-
- fcp = chainptr->lh_first;
- if (number != (u_short)-1) {
- for (; fcp; fcp = fcp->chain.le_next) {
- if (fcp->rule->fw_number == number) {
- LIST_REMOVE(fcp, chain);
- splx(s);
- free(fcp->rule, M_IPFW);
- free(fcp, M_IPFW);
- return 0;
- }
- }
- }
-
- splx(s);
- return (EINVAL);
-}
-
-static int
-zero_entry(struct mbuf *m)
-{
- struct ip_fw *frwl;
- struct ip_fw_chain *fcp;
- int s;
-
- if (m) {
- if (m->m_len != sizeof(struct ip_fw))
- return(EINVAL);
- frwl = mtod(m, struct ip_fw *);
- }
- else
- frwl = NULL;
-
- /*
- * It's possible to insert multiple chain entries with the
- * same number, so we don't stop after finding the first
- * match if zeroing a specific entry.
- */
- s = splnet();
- for (fcp = ip_fw_chain.lh_first; fcp; fcp = fcp->chain.le_next)
- if (!frwl || frwl->fw_number == fcp->rule->fw_number) {
- fcp->rule->fw_bcnt = fcp->rule->fw_pcnt = 0;
- fcp->rule->timestamp = 0;
- }
- splx(s);
-
- if (fw_verbose) {
- if (frwl)
- printf("ipfw: Entry %d cleared.\n", frwl->fw_number);
- else
- printf("ipfw: Accounting cleared.\n");
- }
-
- return(0);
-}
-
-static struct ip_fw *
-check_ipfw_mbuf(struct mbuf *m)
-{
- /* Check length */
- if (m->m_len != sizeof(struct ip_fw)) {
- dprintf(("%s len=%d, want %d\n", err_prefix, m->m_len,
- (int)sizeof(struct ip_fw)));
- return (NULL);
- }
- return(check_ipfw_struct(mtod(m, struct ip_fw *)));
-}
-
-static struct ip_fw *
-check_ipfw_struct(struct ip_fw *frwl)
-{
- /* Check for invalid flag bits */
- if ((frwl->fw_flg & ~IP_FW_F_MASK) != 0) {
- dprintf(("%s undefined flag bits set (flags=%x)\n",
- err_prefix, frwl->fw_flg));
- return (NULL);
- }
- /* Must apply to incoming or outgoing (or both) */
- if (!(frwl->fw_flg & (IP_FW_F_IN | IP_FW_F_OUT))) {
- dprintf(("%s neither in nor out\n", err_prefix));
- return (NULL);
- }
- /* Empty interface name is no good */
- if (((frwl->fw_flg & IP_FW_F_IIFNAME)
- && !*frwl->fw_in_if.fu_via_if.name)
- || ((frwl->fw_flg & IP_FW_F_OIFNAME)
- && !*frwl->fw_out_if.fu_via_if.name)) {
- dprintf(("%s empty interface name\n", err_prefix));
- return (NULL);
- }
- /* Sanity check interface matching */
- if ((frwl->fw_flg & IF_FW_F_VIAHACK) == IF_FW_F_VIAHACK) {
- ; /* allow "via" backwards compatibility */
- } else if ((frwl->fw_flg & IP_FW_F_IN)
- && (frwl->fw_flg & IP_FW_F_OIFACE)) {
- dprintf(("%s outgoing interface check on incoming\n",
- err_prefix));
- return (NULL);
- }
- /* Sanity check port ranges */
- if ((frwl->fw_flg & IP_FW_F_SRNG) && IP_FW_GETNSRCP(frwl) < 2) {
- dprintf(("%s src range set but n_src_p=%d\n",
- err_prefix, IP_FW_GETNSRCP(frwl)));
- return (NULL);
- }
- if ((frwl->fw_flg & IP_FW_F_DRNG) && IP_FW_GETNDSTP(frwl) < 2) {
- dprintf(("%s dst range set but n_dst_p=%d\n",
- err_prefix, IP_FW_GETNDSTP(frwl)));
- return (NULL);
- }
- if (IP_FW_GETNSRCP(frwl) + IP_FW_GETNDSTP(frwl) > IP_FW_MAX_PORTS) {
- dprintf(("%s too many ports (%d+%d)\n",
- err_prefix, IP_FW_GETNSRCP(frwl), IP_FW_GETNDSTP(frwl)));
- return (NULL);
- }
- /*
- * Protocols other than TCP/UDP don't use port range
- */
- if ((frwl->fw_prot != IPPROTO_TCP) &&
- (frwl->fw_prot != IPPROTO_UDP) &&
- (IP_FW_GETNSRCP(frwl) || IP_FW_GETNDSTP(frwl))) {
- dprintf(("%s port(s) specified for non TCP/UDP rule\n",
- err_prefix));
- return(NULL);
- }
-
- /*
- * Rather than modify the entry to make such entries work,
- * we reject this rule and require user level utilities
- * to enforce whatever policy they deem appropriate.
- */
- if ((frwl->fw_src.s_addr & (~frwl->fw_smsk.s_addr)) ||
- (frwl->fw_dst.s_addr & (~frwl->fw_dmsk.s_addr))) {
- dprintf(("%s rule never matches\n", err_prefix));
- return(NULL);
- }
-
- if ((frwl->fw_flg & IP_FW_F_FRAG) &&
- (frwl->fw_prot == IPPROTO_UDP || frwl->fw_prot == IPPROTO_TCP)) {
- if (frwl->fw_nports) {
- dprintf(("%s cannot mix 'frag' and ports\n", err_prefix));
- return(NULL);
- }
- if (frwl->fw_prot == IPPROTO_TCP &&
- frwl->fw_tcpf != frwl->fw_tcpnf) {
- dprintf(("%s cannot mix 'frag' with TCP flags\n", err_prefix));
- return(NULL);
- }
- }
-
- /* Check command specific stuff */
- switch (frwl->fw_flg & IP_FW_F_COMMAND)
- {
- case IP_FW_F_REJECT:
- if (frwl->fw_reject_code >= 0x100
- && !(frwl->fw_prot == IPPROTO_TCP
- && frwl->fw_reject_code == IP_FW_REJECT_RST)) {
- dprintf(("%s unknown reject code\n", err_prefix));
- return(NULL);
- }
- break;
- case IP_FW_F_DIVERT: /* Diverting to port zero is invalid */
- case IP_FW_F_TEE:
- if (frwl->fw_divert_port == 0) {
- dprintf(("%s can't divert to port 0\n", err_prefix));
- return (NULL);
- }
- break;
- case IP_FW_F_DENY:
- case IP_FW_F_ACCEPT:
- case IP_FW_F_COUNT:
- case IP_FW_F_SKIPTO:
- break;
- default:
- dprintf(("%s invalid command\n", err_prefix));
- return(NULL);
- }
-
- return frwl;
-}
-
-static int
-ip_fw_ctl(int stage, struct mbuf **mm)
-{
- int error;
- struct mbuf *m;
-
- if (stage == IP_FW_GET) {
- struct ip_fw_chain *fcp = ip_fw_chain.lh_first;
- *mm = m = m_get(M_WAIT, MT_SOOPTS);
- for (; fcp; fcp = fcp->chain.le_next) {
- memcpy(m->m_data, fcp->rule, sizeof *(fcp->rule));
- m->m_len = sizeof *(fcp->rule);
- m->m_next = m_get(M_WAIT, MT_SOOPTS);
- m = m->m_next;
- m->m_len = 0;
- }
- return (0);
- }
- m = *mm;
- /* only allow get calls if secure mode > 2 */
- if (securelevel > 2) {
- if (m) (void)m_free(m);
- return(EPERM);
- }
- if (stage == IP_FW_FLUSH) {
- while (ip_fw_chain.lh_first != NULL &&
- ip_fw_chain.lh_first->rule->fw_number != (u_short)-1) {
- struct ip_fw_chain *fcp = ip_fw_chain.lh_first;
- int s = splnet();
- LIST_REMOVE(ip_fw_chain.lh_first, chain);
- splx(s);
- free(fcp->rule, M_IPFW);
- free(fcp, M_IPFW);
- }
- if (m) (void)m_free(m);
- return (0);
- }
- if (stage == IP_FW_ZERO) {
- error = zero_entry(m);
- if (m) (void)m_free(m);
- return (error);
- }
- if (m == NULL) {
- printf("%s NULL mbuf ptr\n", err_prefix);
- return (EINVAL);
- }
-
- if (stage == IP_FW_ADD) {
- struct ip_fw *frwl = check_ipfw_mbuf(m);
-
- if (!frwl)
- error = EINVAL;
- else
- error = add_entry(&ip_fw_chain, frwl);
- if (m) (void)m_free(m);
- return error;
- }
- if (stage == IP_FW_DEL) {
- if (m->m_len != sizeof(struct ip_fw)) {
- dprintf(("%s len=%d, want %d\n", err_prefix, m->m_len,
- (int)sizeof(struct ip_fw)));
- error = EINVAL;
- } else if (mtod(m, struct ip_fw *)->fw_number == (u_short)-1) {
- dprintf(("%s can't delete rule 65535\n", err_prefix));
- error = EINVAL;
- } else
- error = del_entry(&ip_fw_chain,
- mtod(m, struct ip_fw *)->fw_number);
- if (m) (void)m_free(m);
- return error;
- }
-
- dprintf(("%s unknown request %d\n", err_prefix, stage));
- if (m) (void)m_free(m);
- return (EINVAL);
-}
-
-void
-ip_fw_init(void)
-{
- struct ip_fw default_rule;
-
- ip_fw_chk_ptr = ip_fw_chk;
- ip_fw_ctl_ptr = ip_fw_ctl;
- LIST_INIT(&ip_fw_chain);
-
- bzero(&default_rule, sizeof default_rule);
- default_rule.fw_prot = IPPROTO_IP;
- default_rule.fw_number = (u_short)-1;
-#ifdef IPFIREWALL_DEFAULT_TO_ACCEPT
- default_rule.fw_flg |= IP_FW_F_ACCEPT;
-#else
- default_rule.fw_flg |= IP_FW_F_DENY;
-#endif
- default_rule.fw_flg |= IP_FW_F_IN | IP_FW_F_OUT;
- if (check_ipfw_struct(&default_rule) == NULL ||
- add_entry(&ip_fw_chain, &default_rule))
- panic(__FUNCTION__);
-
- printf("IP packet filtering initialized, "
-#ifdef IPDIVERT
- "divert enabled, ");
-#else
- "divert disabled, ");
-#endif
-#ifdef IPFIREWALL_DEFAULT_TO_ACCEPT
- printf("default to accept, ");
-#endif
-#ifndef IPFIREWALL_VERBOSE
- printf("logging disabled\n");
-#else
- if (fw_verbose_limit == 0)
- printf("unlimited logging\n");
- else
- printf("logging limited to %d packets/entry\n",
- fw_verbose_limit);
-#endif
-}
-
-#ifdef IPFIREWALL_MODULE
-
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-MOD_MISC(ipfw);
-
-static int
-ipfw_load(struct lkm_table *lkmtp, int cmd)
-{
- int s=splnet();
-
- old_chk_ptr = ip_fw_chk_ptr;
- old_ctl_ptr = ip_fw_ctl_ptr;
-
- ip_fw_init();
- splx(s);
- return 0;
-}
-
-static int
-ipfw_unload(struct lkm_table *lkmtp, int cmd)
-{
- int s=splnet();
-
- ip_fw_chk_ptr = old_chk_ptr;
- ip_fw_ctl_ptr = old_ctl_ptr;
-
- while (ip_fw_chain.lh_first != NULL) {
- struct ip_fw_chain *fcp = ip_fw_chain.lh_first;
- LIST_REMOVE(ip_fw_chain.lh_first, chain);
- free(fcp->rule, M_IPFW);
- free(fcp, M_IPFW);
- }
-
- splx(s);
- printf("IP firewall unloaded\n");
- return 0;
-}
-
-int
-ipfw_mod(struct lkm_table *lkmtp, int cmd, int ver)
-{
- DISPATCH(lkmtp, cmd, ver, ipfw_load, ipfw_unload, lkm_nullcmd);
-}
-#endif
diff --git a/c/src/exec/libnetworking/netinet/ip_fw.h b/c/src/exec/libnetworking/netinet/ip_fw.h
deleted file mode 100644
index cab7f4ac93..0000000000
--- a/c/src/exec/libnetworking/netinet/ip_fw.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 1993 Daniel Boulet
- * Copyright (c) 1994 Ugen J.S.Antsilevich
- *
- * Redistribution and use in source forms, with and without modification,
- * are permitted provided that this entire comment appears intact.
- *
- * Redistribution in binary form may occur without any restrictions.
- * Obviously, it would be nice if you gave credit where credit is due
- * but requiring it would be too onerous.
- *
- * This software is provided ``AS IS'' without any warranties of any kind.
- *
- * $Id$
- */
-
-#ifndef _IP_FW_H
-#define _IP_FW_H
-
-#include <net/if.h>
-
-/*
- * This union structure identifies an interface, either explicitly
- * by name or implicitly by IP address. The flags IP_FW_F_IIFNAME
- * and IP_FW_F_OIFNAME say how to interpret this structure. An
- * interface unit number of -1 matches any unit number, while an
- * IP address of 0.0.0.0 indicates matches any interface.
- *
- * The receive and transmit interfaces are only compared against the
- * the packet if the corresponding bit (IP_FW_F_IIFACE or IP_FW_F_OIFACE)
- * is set. Note some packets lack a receive or transmit interface
- * (in which case the missing "interface" never matches).
- */
-
-union ip_fw_if {
- struct in_addr fu_via_ip; /* Specified by IP address */
- struct { /* Specified by interface name */
-#define FW_IFNLEN IFNAMSIZ
- char name[FW_IFNLEN];
- short unit; /* -1 means match any unit */
- } fu_via_if;
-};
-
-/*
- * Format of an IP firewall descriptor
- *
- * fw_src, fw_dst, fw_smsk, fw_dmsk are always stored in network byte order.
- * fw_flg and fw_n*p are stored in host byte order (of course).
- * Port numbers are stored in HOST byte order.
- * Warning: setsockopt() will fail if sizeof(struct ip_fw) > MLEN (108)
- */
-
-struct ip_fw {
- u_long fw_pcnt,fw_bcnt; /* Packet and byte counters */
- struct in_addr fw_src, fw_dst; /* Source and destination IP addr */
- struct in_addr fw_smsk, fw_dmsk; /* Mask for src and dest IP addr */
- u_short fw_number; /* Rule number */
- u_short fw_flg; /* Flags word */
-#define IP_FW_MAX_PORTS 10 /* A reasonable maximum */
- u_short fw_pts[IP_FW_MAX_PORTS]; /* Array of port numbers to match */
- u_char fw_ipopt,fw_ipnopt; /* IP options set/unset */
- u_char fw_tcpf,fw_tcpnf; /* TCP flags set/unset */
-#define IP_FW_ICMPTYPES_DIM (32 / (sizeof(unsigned) * 8))
- unsigned fw_icmptypes[IP_FW_ICMPTYPES_DIM]; /* ICMP types bitmap */
- long timestamp; /* timestamp (tv_sec) of last match */
- union ip_fw_if fw_in_if, fw_out_if; /* Incoming and outgoing interfaces */
- union {
- u_short fu_divert_port; /* Divert/tee port (options IPDIVERT) */
- u_short fu_skipto_rule; /* SKIPTO command rule number */
- u_short fu_reject_code; /* REJECT response code */
- } fw_un;
- u_char fw_prot; /* IP protocol */
- u_char fw_nports; /* N'of src ports and # of dst ports */
- /* in ports array (dst ports follow */
- /* src ports; max of 10 ports in all; */
- /* count of 0 means match all ports) */
-};
-
-#define IP_FW_GETNSRCP(rule) ((rule)->fw_nports & 0x0f)
-#define IP_FW_SETNSRCP(rule, n) do { \
- (rule)->fw_nports &= ~0x0f; \
- (rule)->fw_nports |= (n); \
- } while (0)
-#define IP_FW_GETNDSTP(rule) ((rule)->fw_nports >> 4)
-#define IP_FW_SETNDSTP(rule, n) do { \
- (rule)->fw_nports &= ~0xf0; \
- (rule)->fw_nports |= (n) << 4;\
- } while (0)
-
-#define fw_divert_port fw_un.fu_divert_port
-#define fw_skipto_rule fw_un.fu_skipto_rule
-#define fw_reject_code fw_un.fu_reject_code
-
-struct ip_fw_chain {
- LIST_ENTRY(ip_fw_chain) chain;
- struct ip_fw *rule;
-};
-
-/*
- * Values for "flags" field .
- */
-#define IP_FW_F_IN 0x0001 /* Check inbound packets */
-#define IP_FW_F_OUT 0x0002 /* Check outbound packets */
-#define IP_FW_F_IIFACE 0x0004 /* Apply inbound interface test */
-#define IP_FW_F_OIFACE 0x0008 /* Apply outbound interface test */
-
-#define IP_FW_F_COMMAND 0x0070 /* Mask for type of chain entry: */
-#define IP_FW_F_DENY 0x0000 /* This is a deny rule */
-#define IP_FW_F_REJECT 0x0010 /* Deny and send a response packet */
-#define IP_FW_F_ACCEPT 0x0020 /* This is an accept rule */
-#define IP_FW_F_COUNT 0x0030 /* This is a count rule */
-#define IP_FW_F_DIVERT 0x0040 /* This is a divert rule */
-#define IP_FW_F_TEE 0x0050 /* This is a tee rule */
-#define IP_FW_F_SKIPTO 0x0060 /* This is a skipto rule */
-
-#define IP_FW_F_PRN 0x0080 /* Print if this rule matches */
-
-#define IP_FW_F_SRNG 0x0100 /* The first two src ports are a min *
- * and max range (stored in host byte *
- * order). */
-
-#define IP_FW_F_DRNG 0x0200 /* The first two dst ports are a min *
- * and max range (stored in host byte *
- * order). */
-
-#define IP_FW_F_IIFNAME 0x0400 /* In interface by name/unit (not IP) */
-#define IP_FW_F_OIFNAME 0x0800 /* Out interface by name/unit (not IP) */
-
-#define IP_FW_F_INVSRC 0x1000 /* Invert sense of src check */
-#define IP_FW_F_INVDST 0x2000 /* Invert sense of dst check */
-
-#define IP_FW_F_FRAG 0x4000 /* Fragment */
-
-#define IP_FW_F_ICMPBIT 0x8000 /* ICMP type bitmap is valid */
-
-#define IP_FW_F_MASK 0xFFFF /* All possible flag bits mask */
-
-/*
- * For backwards compatibility with rules specifying "via iface" but
- * not restricted to only "in" or "out" packets, we define this combination
- * of bits to represent this configuration.
- */
-
-#define IF_FW_F_VIAHACK (IP_FW_F_IN|IP_FW_F_OUT|IP_FW_F_IIFACE|IP_FW_F_OIFACE)
-
-/*
- * Definitions for REJECT response codes.
- * Values less than 256 correspond to ICMP unreachable codes.
- */
-#define IP_FW_REJECT_RST 0x0100 /* TCP packets: send RST */
-
-/*
- * Definitions for IP option names.
- */
-#define IP_FW_IPOPT_LSRR 0x01
-#define IP_FW_IPOPT_SSRR 0x02
-#define IP_FW_IPOPT_RR 0x04
-#define IP_FW_IPOPT_TS 0x08
-
-/*
- * Definitions for TCP flags.
- */
-#define IP_FW_TCPF_FIN TH_FIN
-#define IP_FW_TCPF_SYN TH_SYN
-#define IP_FW_TCPF_RST TH_RST
-#define IP_FW_TCPF_PSH TH_PUSH
-#define IP_FW_TCPF_ACK TH_ACK
-#define IP_FW_TCPF_URG TH_URG
-#define IP_FW_TCPF_ESTAB 0x40
-
-/*
- * Main firewall chains definitions and global var's definitions.
- */
-#ifdef KERNEL
-
-/*
- * Function definitions.
- */
-void ip_fw_init(void);
-
-#endif /* KERNEL */
-
-#endif /* _IP_FW_H */
diff --git a/c/src/exec/libnetworking/netinet/ip_icmp.c b/c/src/exec/libnetworking/netinet/ip_icmp.c
deleted file mode 100644
index a18dacca99..0000000000
--- a/c/src/exec/libnetworking/netinet/ip_icmp.c
+++ /dev/null
@@ -1,710 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#define _IP_VHL
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_var.h>
-#include <netinet/icmp_var.h>
-
-/*
- * ICMP routines: error generation, receive packet processing, and
- * routines to turnaround packets back to the originator, and
- * host table maintenance routines.
- */
-
- struct icmpstat icmpstat;
-SYSCTL_STRUCT(_net_inet_icmp, ICMPCTL_STATS, stats, CTLFLAG_RD,
- &icmpstat, icmpstat, "");
-
-static int icmpmaskrepl = 0;
-SYSCTL_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_RW,
- &icmpmaskrepl, 0, "");
-
-static int icmpbmcastecho = 1;
-SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, &icmpbmcastecho,
- 0, "");
-
-#ifdef ICMPPRINTFS
-int icmpprintfs = 0;
-#endif
-
-static void icmp_reflect __P((struct mbuf *));
-static void icmp_send __P((struct mbuf *, struct mbuf *));
-static int ip_next_mtu __P((int, int));
-
-extern struct protosw inetsw[];
-
-/*
- * Generate an error packet of type error
- * in response to bad packet ip.
- */
-void
-icmp_error(n, type, code, dest, destifp)
- struct mbuf *n;
- int type, code;
- n_long dest;
- struct ifnet *destifp;
-{
- register struct ip *oip = mtod(n, struct ip *), *nip;
- register unsigned oiplen = IP_VHL_HL(oip->ip_vhl) << 2;
- register struct icmp *icp;
- register struct mbuf *m;
- unsigned icmplen;
-
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("icmp_error(%p, %x, %d)\n", oip, type, code);
-#endif
- if (type != ICMP_REDIRECT)
- icmpstat.icps_error++;
- /*
- * Don't send error if not the first fragment of message.
- * Don't error if the old packet protocol was ICMP
- * error message, only known informational types.
- */
- if (oip->ip_off &~ (IP_MF|IP_DF))
- goto freeit;
- if (oip->ip_p == IPPROTO_ICMP && type != ICMP_REDIRECT &&
- n->m_len >= oiplen + ICMP_MINLEN &&
- !ICMP_INFOTYPE(((struct icmp *)((caddr_t)oip + oiplen))->icmp_type)) {
- icmpstat.icps_oldicmp++;
- goto freeit;
- }
- /* Don't send error in response to a multicast or broadcast packet */
- if (n->m_flags & (M_BCAST|M_MCAST))
- goto freeit;
- /*
- * First, formulate icmp message
- */
- m = m_gethdr(M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- goto freeit;
- icmplen = oiplen + min(8, oip->ip_len);
- m->m_len = icmplen + ICMP_MINLEN;
- MH_ALIGN(m, m->m_len);
- icp = mtod(m, struct icmp *);
- if ((u_int)type > ICMP_MAXTYPE)
- panic("icmp_error");
- icmpstat.icps_outhist[type]++;
- icp->icmp_type = type;
- if (type == ICMP_REDIRECT)
- icp->icmp_gwaddr.s_addr = dest;
- else {
- icp->icmp_void = 0;
- /*
- * The following assignments assume an overlay with the
- * zeroed icmp_void field.
- */
- if (type == ICMP_PARAMPROB) {
- icp->icmp_pptr = code;
- code = 0;
- } else if (type == ICMP_UNREACH &&
- code == ICMP_UNREACH_NEEDFRAG && destifp) {
- icp->icmp_nextmtu = htons(destifp->if_mtu);
- }
- }
-
- icp->icmp_code = code;
- bcopy((caddr_t)oip, (caddr_t)&icp->icmp_ip, icmplen);
- nip = &icp->icmp_ip;
- nip->ip_len = htons((u_short)(nip->ip_len + oiplen));
-
- /*
- * Now, copy old ip header (without options)
- * in front of icmp message.
- */
- if (m->m_data - sizeof(struct ip) < m->m_pktdat)
- panic("icmp len");
- m->m_data -= sizeof(struct ip);
- m->m_len += sizeof(struct ip);
- m->m_pkthdr.len = m->m_len;
- m->m_pkthdr.rcvif = n->m_pkthdr.rcvif;
- nip = mtod(m, struct ip *);
- bcopy((caddr_t)oip, (caddr_t)nip, sizeof(struct ip));
- nip->ip_len = m->m_len;
- nip->ip_vhl = IP_VHL_BORING;
- nip->ip_p = IPPROTO_ICMP;
- nip->ip_tos = 0;
- icmp_reflect(m);
-
-freeit:
- m_freem(n);
-}
-
-static struct sockaddr_in icmpsrc = { sizeof (struct sockaddr_in), AF_INET };
-static struct sockaddr_in icmpdst = { sizeof (struct sockaddr_in), AF_INET };
-static struct sockaddr_in icmpgw = { sizeof (struct sockaddr_in), AF_INET };
-
-/*
- * Process a received ICMP message.
- */
-void
-icmp_input(m, hlen)
- register struct mbuf *m;
- int hlen;
-{
- register struct icmp *icp;
- register struct ip *ip = mtod(m, struct ip *);
- int icmplen = ip->ip_len;
- register int i;
- struct in_ifaddr *ia;
- void (*ctlfunc) __P((int, struct sockaddr *, void *));
- int code;
-
- /*
- * Locate icmp structure in mbuf, and check
- * that not corrupted and of at least minimum length.
- */
-#ifdef ICMPPRINTFS
- if (icmpprintfs) {
- char buf[4 * sizeof "123"];
- strcpy(buf, inet_ntoa(ip->ip_src));
- printf("icmp_input from %s to %s, len %d\n",
- buf, inet_ntoa(ip->ip_dst), icmplen);
- }
-#endif
- if (icmplen < ICMP_MINLEN) {
- icmpstat.icps_tooshort++;
- goto freeit;
- }
- i = hlen + min(icmplen, ICMP_ADVLENMIN);
- if (m->m_len < i && (m = m_pullup(m, i)) == 0) {
- icmpstat.icps_tooshort++;
- return;
- }
- ip = mtod(m, struct ip *);
- m->m_len -= hlen;
- m->m_data += hlen;
- icp = mtod(m, struct icmp *);
- if (in_cksum(m, icmplen)) {
- icmpstat.icps_checksum++;
- goto freeit;
- }
- m->m_len += hlen;
- m->m_data -= hlen;
-
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("icmp_input, type %d code %d\n", icp->icmp_type,
- icp->icmp_code);
-#endif
-
- /*
- * Message type specific processing.
- */
- if (icp->icmp_type > ICMP_MAXTYPE)
- goto raw;
- icmpstat.icps_inhist[icp->icmp_type]++;
- code = icp->icmp_code;
- switch (icp->icmp_type) {
-
- case ICMP_UNREACH:
- switch (code) {
- case ICMP_UNREACH_NET:
- case ICMP_UNREACH_HOST:
- case ICMP_UNREACH_PROTOCOL:
- case ICMP_UNREACH_PORT:
- case ICMP_UNREACH_SRCFAIL:
- code += PRC_UNREACH_NET;
- break;
-
- case ICMP_UNREACH_NEEDFRAG:
- code = PRC_MSGSIZE;
- break;
-
- case ICMP_UNREACH_NET_UNKNOWN:
- case ICMP_UNREACH_NET_PROHIB:
- case ICMP_UNREACH_TOSNET:
- code = PRC_UNREACH_NET;
- break;
-
- case ICMP_UNREACH_HOST_UNKNOWN:
- case ICMP_UNREACH_ISOLATED:
- case ICMP_UNREACH_HOST_PROHIB:
- case ICMP_UNREACH_TOSHOST:
- code = PRC_UNREACH_HOST;
- break;
-
- case ICMP_UNREACH_FILTER_PROHIB:
- case ICMP_UNREACH_HOST_PRECEDENCE:
- case ICMP_UNREACH_PRECEDENCE_CUTOFF:
- code = PRC_UNREACH_PORT;
- break;
-
- default:
- goto badcode;
- }
- goto deliver;
-
- case ICMP_TIMXCEED:
- if (code > 1)
- goto badcode;
- code += PRC_TIMXCEED_INTRANS;
- goto deliver;
-
- case ICMP_PARAMPROB:
- if (code > 1)
- goto badcode;
- code = PRC_PARAMPROB;
- goto deliver;
-
- case ICMP_SOURCEQUENCH:
- if (code)
- goto badcode;
- code = PRC_QUENCH;
- deliver:
- /*
- * Problem with datagram; advise higher level routines.
- */
- if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
- IP_VHL_HL(icp->icmp_ip.ip_vhl) < (sizeof(struct ip) >> 2)) {
- icmpstat.icps_badlen++;
- goto freeit;
- }
- NTOHS(icp->icmp_ip.ip_len);
- /* Discard ICMP's in response to multicast packets */
- if (IN_MULTICAST(ntohl(icp->icmp_ip.ip_dst.s_addr)))
- goto badcode;
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("deliver to protocol %d\n", icp->icmp_ip.ip_p);
-#endif
- icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
-#if 1
- /*
- * MTU discovery:
- * If we got a needfrag and there is a host route to the
- * original destination, and the MTU is not locked, then
- * set the MTU in the route to the suggested new value
- * (if given) and then notify as usual. The ULPs will
- * notice that the MTU has changed and adapt accordingly.
- * If no new MTU was suggested, then we guess a new one
- * less than the current value. If the new MTU is
- * unreasonably small (arbitrarily set at 296), then
- * we reset the MTU to the interface value and enable the
- * lock bit, indicating that we are no longer doing MTU
- * discovery.
- */
- if (code == PRC_MSGSIZE) {
- struct rtentry *rt;
- int mtu;
-
- rt = rtalloc1((struct sockaddr *)&icmpsrc, 0,
- RTF_CLONING | RTF_PRCLONING);
- if (rt && (rt->rt_flags & RTF_HOST)
- && !(rt->rt_rmx.rmx_locks & RTV_MTU)) {
- mtu = ntohs(icp->icmp_nextmtu);
- if (!mtu)
- mtu = ip_next_mtu(rt->rt_rmx.rmx_mtu,
- 1);
-#ifdef DEBUG_MTUDISC
- printf("MTU for %s reduced to %d\n",
- inet_ntoa(icmpsrc.sin_addr), mtu);
-#endif
- if (mtu < 296) {
- /* rt->rt_rmx.rmx_mtu =
- rt->rt_ifp->if_mtu; */
- rt->rt_rmx.rmx_locks |= RTV_MTU;
- } else if (rt->rt_rmx.rmx_mtu > mtu) {
- rt->rt_rmx.rmx_mtu = mtu;
- }
- }
- if (rt)
- RTFREE(rt);
- }
-
-#endif
- ctlfunc = inetsw[ip_protox[icp->icmp_ip.ip_p]].pr_ctlinput;
- if (ctlfunc)
- (*ctlfunc)(code, (struct sockaddr *)&icmpsrc,
- (void *)&icp->icmp_ip);
- break;
-
- badcode:
- icmpstat.icps_badcode++;
- break;
-
- case ICMP_ECHO:
- if (!icmpbmcastecho
- && (m->m_flags & (M_MCAST | M_BCAST)) != 0
- && IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- icmpstat.icps_bmcastecho++;
- break;
- }
- icp->icmp_type = ICMP_ECHOREPLY;
- goto reflect;
-
- case ICMP_TSTAMP:
- if (!icmpbmcastecho
- && (m->m_flags & (M_MCAST | M_BCAST)) != 0
- && IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- icmpstat.icps_bmcasttstamp++;
- break;
- }
- if (icmplen < ICMP_TSLEN) {
- icmpstat.icps_badlen++;
- break;
- }
- icp->icmp_type = ICMP_TSTAMPREPLY;
- icp->icmp_rtime = iptime();
- icp->icmp_ttime = icp->icmp_rtime; /* bogus, do later! */
- goto reflect;
-
- case ICMP_MASKREQ:
-#define satosin(sa) ((struct sockaddr_in *)(sa))
- if (icmpmaskrepl == 0)
- break;
- /*
- * We are not able to respond with all ones broadcast
- * unless we receive it over a point-to-point interface.
- */
- if (icmplen < ICMP_MASKLEN)
- break;
- switch (ip->ip_dst.s_addr) {
-
- case INADDR_BROADCAST:
- case INADDR_ANY:
- icmpdst.sin_addr = ip->ip_src;
- break;
-
- default:
- icmpdst.sin_addr = ip->ip_dst;
- }
- ia = (struct in_ifaddr *)ifaof_ifpforaddr(
- (struct sockaddr *)&icmpdst, m->m_pkthdr.rcvif);
- if (ia == 0)
- break;
- if (ia->ia_ifp == 0)
- break;
- icp->icmp_type = ICMP_MASKREPLY;
- icp->icmp_mask = ia->ia_sockmask.sin_addr.s_addr;
- if (ip->ip_src.s_addr == 0) {
- if (ia->ia_ifp->if_flags & IFF_BROADCAST)
- ip->ip_src = satosin(&ia->ia_broadaddr)->sin_addr;
- else if (ia->ia_ifp->if_flags & IFF_POINTOPOINT)
- ip->ip_src = satosin(&ia->ia_dstaddr)->sin_addr;
- }
-reflect:
- ip->ip_len += hlen; /* since ip_input deducts this */
- icmpstat.icps_reflect++;
- icmpstat.icps_outhist[icp->icmp_type]++;
- icmp_reflect(m);
- return;
-
- case ICMP_REDIRECT:
- if (code > 3)
- goto badcode;
- if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
- IP_VHL_HL(icp->icmp_ip.ip_vhl) < (sizeof(struct ip) >> 2)) {
- icmpstat.icps_badlen++;
- break;
- }
- /*
- * Short circuit routing redirects to force
- * immediate change in the kernel's routing
- * tables. The message is also handed to anyone
- * listening on a raw socket (e.g. the routing
- * daemon for use in updating its tables).
- */
- icmpgw.sin_addr = ip->ip_src;
- icmpdst.sin_addr = icp->icmp_gwaddr;
-#ifdef ICMPPRINTFS
- if (icmpprintfs) {
- char buf[4 * sizeof "123"];
- strcpy(buf, inet_ntoa(icp->icmp_ip.ip_dst));
-
- printf("redirect dst %s to %s\n",
- buf, inet_ntoa(icp->icmp_gwaddr));
- }
-#endif
- icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
- rtredirect((struct sockaddr *)&icmpsrc,
- (struct sockaddr *)&icmpdst,
- (struct sockaddr *)0, RTF_GATEWAY | RTF_HOST,
- (struct sockaddr *)&icmpgw, (struct rtentry **)0);
- pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&icmpsrc);
- break;
-
- /*
- * No kernel processing for the following;
- * just fall through to send to raw listener.
- */
- case ICMP_ECHOREPLY:
- case ICMP_ROUTERADVERT:
- case ICMP_ROUTERSOLICIT:
- case ICMP_TSTAMPREPLY:
- case ICMP_IREQREPLY:
- case ICMP_MASKREPLY:
- default:
- break;
- }
-
-raw:
- rip_input(m, hlen);
- return;
-
-freeit:
- m_freem(m);
-}
-
-/*
- * Reflect the ip packet back to the source
- */
-static void
-icmp_reflect(m)
- struct mbuf *m;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register struct in_ifaddr *ia;
- struct in_addr t;
- struct mbuf *opts = 0;
- int optlen = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof(struct ip);
-
- if (!in_canforward(ip->ip_src) &&
- ((ntohl(ip->ip_src.s_addr) & IN_CLASSA_NET) !=
- (IN_LOOPBACKNET << IN_CLASSA_NSHIFT))) {
- m_freem(m); /* Bad return address */
- goto done; /* Ip_output() will check for broadcast */
- }
- t = ip->ip_dst;
- ip->ip_dst = ip->ip_src;
- /*
- * If the incoming packet was addressed directly to us,
- * use dst as the src for the reply. Otherwise (broadcast
- * or anonymous), use the address which corresponds
- * to the incoming interface.
- */
- for (ia = in_ifaddr; ia; ia = ia->ia_next) {
- if (t.s_addr == IA_SIN(ia)->sin_addr.s_addr)
- break;
- if (ia->ia_ifp && (ia->ia_ifp->if_flags & IFF_BROADCAST) &&
- t.s_addr == satosin(&ia->ia_broadaddr)->sin_addr.s_addr)
- break;
- }
- icmpdst.sin_addr = t;
- if ((ia == (struct in_ifaddr *)0) && m->m_pkthdr.rcvif)
- ia = (struct in_ifaddr *)ifaof_ifpforaddr(
- (struct sockaddr *)&icmpdst, m->m_pkthdr.rcvif);
- /*
- * The following happens if the packet was not addressed to us,
- * and was received on an interface with no IP address.
- */
- if (ia == (struct in_ifaddr *)0)
- ia = in_ifaddr;
- t = IA_SIN(ia)->sin_addr;
- ip->ip_src = t;
- ip->ip_ttl = MAXTTL;
-
- if (optlen > 0) {
- register u_char *cp;
- int opt, cnt;
- u_int len;
-
- /*
- * Retrieve any source routing from the incoming packet;
- * add on any record-route or timestamp options.
- */
- cp = (u_char *) (ip + 1);
- if ((opts = ip_srcroute()) == 0 &&
- (opts = m_gethdr(M_DONTWAIT, MT_HEADER))) {
- opts->m_len = sizeof(struct in_addr);
- mtod(opts, struct in_addr *)->s_addr = 0;
- }
- if (opts) {
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("icmp_reflect optlen %d rt %d => ",
- optlen, opts->m_len);
-#endif
- for (cnt = optlen; cnt > 0; cnt -= len, cp += len) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- len = 1;
- else {
- len = cp[IPOPT_OLEN];
- if (len <= 0 || len > cnt)
- break;
- }
- /*
- * Should check for overflow, but it "can't happen"
- */
- if (opt == IPOPT_RR || opt == IPOPT_TS ||
- opt == IPOPT_SECURITY) {
- bcopy((caddr_t)cp,
- mtod(opts, caddr_t) + opts->m_len, len);
- opts->m_len += len;
- }
- }
- /* Terminate & pad, if necessary */
- cnt = opts->m_len % 4;
- if (cnt) {
- for (; cnt < 4; cnt++) {
- *(mtod(opts, caddr_t) + opts->m_len) =
- IPOPT_EOL;
- opts->m_len++;
- }
- }
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("%d\n", opts->m_len);
-#endif
- }
- /*
- * Now strip out original options by copying rest of first
- * mbuf's data back, and adjust the IP length.
- */
- ip->ip_len -= optlen;
- ip->ip_vhl = IP_VHL_BORING;
- m->m_len -= optlen;
- if (m->m_flags & M_PKTHDR)
- m->m_pkthdr.len -= optlen;
- optlen += sizeof(struct ip);
- bcopy((caddr_t)ip + optlen, (caddr_t)(ip + 1),
- (unsigned)(m->m_len - sizeof(struct ip)));
- }
- m->m_flags &= ~(M_BCAST|M_MCAST);
- icmp_send(m, opts);
-done:
- if (opts)
- (void)m_free(opts);
-}
-
-/*
- * Send an icmp packet back to the ip level,
- * after supplying a checksum.
- */
-static void
-icmp_send(m, opts)
- register struct mbuf *m;
- struct mbuf *opts;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register int hlen;
- register struct icmp *icp;
- struct route ro;
-
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
- m->m_data += hlen;
- m->m_len -= hlen;
- icp = mtod(m, struct icmp *);
- icp->icmp_cksum = 0;
- icp->icmp_cksum = in_cksum(m, ip->ip_len - hlen);
- m->m_data -= hlen;
- m->m_len += hlen;
-#ifdef ICMPPRINTFS
- if (icmpprintfs) {
- char buf[4 * sizeof "123"];
- strcpy(buf, inet_ntoa(ip->ip_dst));
- printf("icmp_send dst %s src %s\n",
- buf, inet_ntoa(ip->ip_src));
- }
-#endif
- bzero(&ro, sizeof ro);
- (void) ip_output(m, opts, &ro, 0, NULL);
- if (ro.ro_rt)
- RTFREE(ro.ro_rt);
-}
-
-n_time
-iptime()
-{
- struct timeval atv;
- u_long t;
-
- microtime(&atv);
- t = (atv.tv_sec % (24*60*60)) * 1000 + atv.tv_usec / 1000;
- return (htonl(t));
-}
-
-#if 1
-/*
- * Return the next larger or smaller MTU plateau (table from RFC 1191)
- * given current value MTU. If DIR is less than zero, a larger plateau
- * is returned; otherwise, a smaller value is returned.
- */
-static int
-ip_next_mtu(mtu, dir)
- int mtu;
- int dir;
-{
- static int mtutab[] = {
- 65535, 32000, 17914, 8166, 4352, 2002, 1492, 1006, 508, 296,
- 68, 0
- };
- int i;
-
- for (i = 0; i < (sizeof mtutab) / (sizeof mtutab[0]); i++) {
- if (mtu >= mtutab[i])
- break;
- }
-
- if (dir < 0) {
- if (i == 0) {
- return 0;
- } else {
- return mtutab[i - 1];
- }
- } else {
- if (mtutab[i] == 0) {
- return 0;
- } else if(mtu > mtutab[i]) {
- return mtutab[i];
- } else {
- return mtutab[i + 1];
- }
- }
-}
-#endif
diff --git a/c/src/exec/libnetworking/netinet/ip_icmp.h b/c/src/exec/libnetworking/netinet/ip_icmp.h
deleted file mode 100644
index 9d07a682de..0000000000
--- a/c/src/exec/libnetworking/netinet/ip_icmp.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IP_ICMP_H_
-#define _NETINET_IP_ICMP_H_
-
-/*
- * Interface Control Message Protocol Definitions.
- * Per RFC 792, September 1981.
- */
-
-/*
- * Internal of an ICMP Router Advertisement
- */
-struct icmp_ra_addr {
- u_int32_t ira_addr;
- u_int32_t ira_preference;
-};
-
-/*
- * Structure of an icmp header.
- */
-struct icmp {
- u_char icmp_type; /* type of message, see below */
- u_char icmp_code; /* type sub code */
- u_short icmp_cksum; /* ones complement cksum of struct */
- union {
- u_char ih_pptr; /* ICMP_PARAMPROB */
- struct in_addr ih_gwaddr; /* ICMP_REDIRECT */
- struct ih_idseq {
- n_short icd_id;
- n_short icd_seq;
- } ih_idseq;
- int ih_void;
-
- /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
- struct ih_pmtu {
- n_short ipm_void;
- n_short ipm_nextmtu;
- } ih_pmtu;
-
- struct ih_rtradv {
- u_char irt_num_addrs;
- u_char irt_wpa;
- u_int16_t irt_lifetime;
- } ih_rtradv;
- } icmp_hun;
-#define icmp_pptr icmp_hun.ih_pptr
-#define icmp_gwaddr icmp_hun.ih_gwaddr
-#define icmp_id icmp_hun.ih_idseq.icd_id
-#define icmp_seq icmp_hun.ih_idseq.icd_seq
-#define icmp_void icmp_hun.ih_void
-#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
-#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
-#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
-#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
-#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
- union {
- struct id_ts {
- n_time its_otime;
- n_time its_rtime;
- n_time its_ttime;
- } id_ts;
- struct id_ip {
- struct ip idi_ip;
- /* options and then 64 bits of data */
- } id_ip;
- struct icmp_ra_addr id_radv;
- u_long id_mask;
- char id_data[1];
- } icmp_dun;
-#define icmp_otime icmp_dun.id_ts.its_otime
-#define icmp_rtime icmp_dun.id_ts.its_rtime
-#define icmp_ttime icmp_dun.id_ts.its_ttime
-#define icmp_ip icmp_dun.id_ip.idi_ip
-#define icmp_radv icmp_dun.id_radv
-#define icmp_mask icmp_dun.id_mask
-#define icmp_data icmp_dun.id_data
-};
-
-/*
- * Lower bounds on packet lengths for various types.
- * For the error advice packets must first insure that the
- * packet is large enough to contain the returned ip header.
- * Only then can we do the check to see if 64 bits of packet
- * data have been returned, since we need to check the returned
- * ip header length.
- */
-#define ICMP_MINLEN 8 /* abs minimum */
-#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */
-#define ICMP_MASKLEN 12 /* address mask */
-#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
-#ifndef _IP_VHL
-#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
- /* N.B.: must separately check that ip_hl >= 5 */
-#else
-#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
- /* N.B.: must separately check that header length >= 5 */
-#endif
-
-/*
- * Definition of type and code field values.
- */
-#define ICMP_ECHOREPLY 0 /* echo reply */
-#define ICMP_UNREACH 3 /* dest unreachable, codes: */
-#define ICMP_UNREACH_NET 0 /* bad net */
-#define ICMP_UNREACH_HOST 1 /* bad host */
-#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
-#define ICMP_UNREACH_PORT 3 /* bad port */
-#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
-#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
-#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
-#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
-#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
-#define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */
-#define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */
-#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
-#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
-#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
-#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
-#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
-#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
-#define ICMP_REDIRECT 5 /* shorter route, codes: */
-#define ICMP_REDIRECT_NET 0 /* for network */
-#define ICMP_REDIRECT_HOST 1 /* for host */
-#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
-#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
-#define ICMP_ECHO 8 /* echo service */
-#define ICMP_ROUTERADVERT 9 /* router advertisement */
-#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
-#define ICMP_TIMXCEED 11 /* time exceeded, code: */
-#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
-#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
-#define ICMP_PARAMPROB 12 /* ip header bad */
-#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
-#define ICMP_TSTAMP 13 /* timestamp request */
-#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
-#define ICMP_IREQ 15 /* information request */
-#define ICMP_IREQREPLY 16 /* information reply */
-#define ICMP_MASKREQ 17 /* address mask request */
-#define ICMP_MASKREPLY 18 /* address mask reply */
-
-#define ICMP_MAXTYPE 18
-
-#define ICMP_INFOTYPE(type) \
- ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
- (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
- (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
- (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
- (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
-
-#ifdef KERNEL
-void icmp_error __P((struct mbuf *, int, int, n_long, struct ifnet *));
-void icmp_input __P((struct mbuf *, int));
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/netinet/ip_input.c b/c/src/exec/libnetworking/netinet/ip_input.c
deleted file mode 100644
index 4cc141933f..0000000000
--- a/c/src/exec/libnetworking/netinet/ip_input.c
+++ /dev/null
@@ -1,1488 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)ip_input.c 8.2 (Berkeley) 1/4/94
- * $Id$
- * $ANA: ip_input.c,v 1.5 1996/09/18 14:34:59 wollman Exp $
- */
-
-#define _IP_VHL
-
-#include "opt_ipfw.h"
-
-#include <stddef.h>
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/route.h>
-#include <net/netisr.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <machine/in_cksum.h>
-
-#include <sys/socketvar.h>
-
-#ifdef IPFIREWALL
-#include <netinet/ip_fw.h>
-#endif
-
-int rsvp_on = 0;
-static int ip_rsvp_on;
-struct socket *ip_rsvpd;
-
-static int ipforwarding = 0;
-SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_RW,
- &ipforwarding, 0, "");
-
-static int ipsendredirects = 1; /* XXX */
-SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_RW,
- &ipsendredirects, 0, "");
-
-int ip_defttl = IPDEFTTL;
-SYSCTL_INT(_net_inet_ip, IPCTL_DEFTTL, ttl, CTLFLAG_RW,
- &ip_defttl, 0, "");
-
-static int ip_dosourceroute = 0;
-SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW,
- &ip_dosourceroute, 0, "");
-
-static int ip_acceptsourceroute = 0;
-SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute,
- CTLFLAG_RW, &ip_acceptsourceroute, 0, "");
-#ifdef DIAGNOSTIC
-static int ipprintfs = 0;
-#endif
-
-extern struct domain inetdomain;
-extern struct protosw inetsw[];
-u_char ip_protox[IPPROTO_MAX];
-static int ipqmaxlen = IFQ_MAXLEN;
-struct in_ifaddr *in_ifaddr; /* first inet address */
-struct ifqueue ipintrq;
-SYSCTL_INT(_net_inet_ip, IPCTL_INTRQMAXLEN, intr_queue_maxlen, CTLFLAG_RD,
- &ipintrq.ifq_maxlen, 0, "");
-SYSCTL_INT(_net_inet_ip, IPCTL_INTRQDROPS, intr_queue_drops, CTLFLAG_RD,
- &ipintrq.ifq_drops, 0, "");
-
-struct ipstat ipstat;
-
-/* Packet reassembly stuff */
-#define IPREASS_NHASH_LOG2 6
-#define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2)
-#define IPREASS_HMASK (IPREASS_NHASH - 1)
-#define IPREASS_HASH(x,y) \
- (((((x) & 0xF) | ((((x) >> 8) & 0xF) << 4)) ^ (y)) & IPREASS_HMASK)
-
-static struct ipq ipq[IPREASS_NHASH];
-static int nipq = 0; /* total # of reass queues */
-static int maxnipq;
-
-#ifdef IPCTL_DEFMTU
-SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW,
- &ip_mtu, 0, "");
-#endif
-
-#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1
-#undef COMPAT_IPFW
-#define COMPAT_IPFW 1
-#else
-#undef COMPAT_IPFW
-#endif
-
-#ifdef COMPAT_IPFW
-/* Firewall hooks */
-ip_fw_chk_t *ip_fw_chk_ptr;
-ip_fw_ctl_t *ip_fw_ctl_ptr;
-
-/* IP Network Address Translation (NAT) hooks */
-ip_nat_t *ip_nat_ptr;
-ip_nat_ctl_t *ip_nat_ctl_ptr;
-#endif
-
-/*
- * We need to save the IP options in case a protocol wants to respond
- * to an incoming packet over the same route if the packet got here
- * using IP source routing. This allows connection establishment and
- * maintenance when the remote end is on a network that is not known
- * to us.
- */
-static int ip_nhops = 0;
-static struct ip_srcrt {
- struct in_addr dst; /* final destination */
- char nop; /* one NOP to align */
- char srcopt[IPOPT_OFFSET + 1]; /* OPTVAL, OLEN and OFFSET */
- struct in_addr route[MAX_IPOPTLEN/sizeof(struct in_addr)];
-} ip_srcrt;
-
-#ifdef IPDIVERT
-/*
- * Shared variable between ip_input() and ip_reass() to communicate
- * about which packets, once assembled from fragments, get diverted,
- * and to which port.
- */
-static u_short frag_divert_port;
-#endif
-
-static void save_rte __P((u_char *, struct in_addr));
-static void ip_deq __P((struct ipasfrag *));
-static int ip_dooptions __P((struct mbuf *));
-static void ip_enq __P((struct ipasfrag *, struct ipasfrag *));
-static void ip_forward __P((struct mbuf *, int));
-static void ip_freef __P((struct ipq *));
-static struct ip *
- ip_reass __P((struct ipasfrag *, struct ipq *, struct ipq *));
-static struct in_ifaddr *
- ip_rtaddr __P((struct in_addr));
-void ipintr __P((void));
-/*
- * IP initialization: fill in IP protocol switch table.
- * All protocols not implemented in kernel go to raw IP protocol handler.
- */
-void
-ip_init()
-{
- register struct protosw *pr;
- register int i;
-
- pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW);
- if (pr == 0)
- panic("ip_init");
- for (i = 0; i < IPPROTO_MAX; i++)
- ip_protox[i] = pr - inetsw;
- for (pr = inetdomain.dom_protosw;
- pr < inetdomain.dom_protoswNPROTOSW; pr++)
- if (pr->pr_domain->dom_family == PF_INET &&
- pr->pr_protocol && pr->pr_protocol != IPPROTO_RAW)
- ip_protox[pr->pr_protocol] = pr - inetsw;
-
- for (i = 0; i < IPREASS_NHASH; i++)
- ipq[i].next = ipq[i].prev = &ipq[i];
-
- maxnipq = nmbclusters/4;
-
- ip_id = rtems_bsdnet_seconds_since_boot() & 0xffff;
- ipintrq.ifq_maxlen = ipqmaxlen;
-#ifdef IPFIREWALL
- ip_fw_init();
-#endif
-#ifdef IPNAT
- ip_nat_init();
-#endif
-
-}
-
-static struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET };
-static struct route ipforward_rt;
-
-/*
- * Ip input routine. Checksum and byte swap header. If fragmented
- * try to reassemble. Process options. Pass to next level.
- */
-void
-ip_input(struct mbuf *m)
-{
- struct ip *ip;
- struct ipq *fp;
- struct in_ifaddr *ia;
- int i, hlen;
- u_short sum;
-
-#ifdef DIAGNOSTIC
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("ip_input no HDR");
-#endif
- /*
- * If no IP addresses have been set yet but the interfaces
- * are receiving, can't do anything with incoming packets yet.
- */
- if (in_ifaddr == NULL)
- goto bad;
- ipstat.ips_total++;
-
- if (m->m_pkthdr.len < sizeof(struct ip))
- goto tooshort;
-
-#ifdef DIAGNOSTIC
- if (m->m_len < sizeof(struct ip))
- panic("ipintr mbuf too short");
-#endif
-
- if (m->m_len < sizeof (struct ip) &&
- (m = m_pullup(m, sizeof (struct ip))) == 0) {
- ipstat.ips_toosmall++;
- return;
- }
- ip = mtod(m, struct ip *);
-
- if (IP_VHL_V(ip->ip_vhl) != IPVERSION) {
- ipstat.ips_badvers++;
- goto bad;
- }
-
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
- if (hlen < sizeof(struct ip)) { /* minimum header length */
- ipstat.ips_badhlen++;
- goto bad;
- }
- if (hlen > m->m_len) {
- if ((m = m_pullup(m, hlen)) == 0) {
- ipstat.ips_badhlen++;
- return;
- }
- ip = mtod(m, struct ip *);
- }
- if (hlen == sizeof(struct ip)) {
- sum = in_cksum_hdr(ip);
- } else {
- sum = in_cksum(m, hlen);
- }
- if (sum) {
- ipstat.ips_badsum++;
- goto bad;
- }
-
- /*
- * Convert fields to host representation.
- */
- NTOHS(ip->ip_len);
- if (ip->ip_len < hlen) {
- ipstat.ips_badlen++;
- goto bad;
- }
- NTOHS(ip->ip_id);
- NTOHS(ip->ip_off);
-
- /*
- * Check that the amount of data in the buffers
- * is as at least much as the IP header would have us expect.
- * Trim mbufs if longer than we expect.
- * Drop packet if shorter than we expect.
- */
- if (m->m_pkthdr.len < ip->ip_len) {
-tooshort:
- ipstat.ips_tooshort++;
- goto bad;
- }
- if (m->m_pkthdr.len > ip->ip_len) {
- if (m->m_len == m->m_pkthdr.len) {
- m->m_len = ip->ip_len;
- m->m_pkthdr.len = ip->ip_len;
- } else
- m_adj(m, ip->ip_len - m->m_pkthdr.len);
- }
- /*
- * IpHack's section.
- * Right now when no processing on packet has done
- * and it is still fresh out of network we do our black
- * deals with it.
- * - Firewall: deny/allow/divert
- * - Xlate: translate packet's addr/port (NAT).
- * - Wrap: fake packet's addr/port <unimpl.>
- * - Encapsulate: put it in another IP and send out. <unimp.>
- */
-
-#ifdef COMPAT_IPFW
- if (ip_fw_chk_ptr) {
-#ifdef IPDIVERT
- u_short port;
-
- port = (*ip_fw_chk_ptr)(&ip, hlen, NULL, ip_divert_ignore, &m);
- ip_divert_ignore = 0;
- if (port) { /* Divert packet */
- frag_divert_port = port;
- goto ours;
- }
-#else
- /* If ipfw says divert, we have to just drop packet */
- if ((*ip_fw_chk_ptr)(&ip, hlen, NULL, 0, &m)) {
- m_freem(m);
- m = NULL;
- }
-#endif
- if (!m)
- return;
- }
-
- if (ip_nat_ptr && !(*ip_nat_ptr)(&ip, &m, m->m_pkthdr.rcvif, IP_NAT_IN))
- return;
-#endif
-
- /*
- * Process options and, if not destined for us,
- * ship it on. ip_dooptions returns 1 when an
- * error was detected (causing an icmp message
- * to be sent and the original packet to be freed).
- */
- ip_nhops = 0; /* for source routed packets */
- if (hlen > sizeof (struct ip) && ip_dooptions(m))
- return;
-
- /* greedy RSVP, snatches any PATH packet of the RSVP protocol and no
- * matter if it is destined to another node, or whether it is
- * a multicast one, RSVP wants it! and prevents it from being forwarded
- * anywhere else. Also checks if the rsvp daemon is running before
- * grabbing the packet.
- */
- if (rsvp_on && ip->ip_p==IPPROTO_RSVP)
- goto ours;
-
- /*
- * Check our list of addresses, to see if the packet is for us.
- */
- for (ia = in_ifaddr; ia; ia = ia->ia_next) {
-#define satosin(sa) ((struct sockaddr_in *)(sa))
-
- if (IA_SIN(ia)->sin_addr.s_addr == ip->ip_dst.s_addr)
- goto ours;
-#ifdef BOOTP_COMPAT
- if (IA_SIN(ia)->sin_addr.s_addr == INADDR_ANY)
- goto ours;
-#endif
- if (ia->ia_ifp && ia->ia_ifp->if_flags & IFF_BROADCAST) {
- if (satosin(&ia->ia_broadaddr)->sin_addr.s_addr ==
- ip->ip_dst.s_addr)
- goto ours;
- if (ip->ip_dst.s_addr == ia->ia_netbroadcast.s_addr)
- goto ours;
- }
- }
- if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- struct in_multi *inm;
- if (ip_mrouter) {
- /*
- * If we are acting as a multicast router, all
- * incoming multicast packets are passed to the
- * kernel-level multicast forwarding function.
- * The packet is returned (relatively) intact; if
- * ip_mforward() returns a non-zero value, the packet
- * must be discarded, else it may be accepted below.
- *
- * (The IP ident field is put in the same byte order
- * as expected when ip_mforward() is called from
- * ip_output().)
- */
- ip->ip_id = htons(ip->ip_id);
- if (ip_mforward(ip, m->m_pkthdr.rcvif, m, 0) != 0) {
- ipstat.ips_cantforward++;
- m_freem(m);
- return;
- }
- ip->ip_id = ntohs(ip->ip_id);
-
- /*
- * The process-level routing demon needs to receive
- * all multicast IGMP packets, whether or not this
- * host belongs to their destination groups.
- */
- if (ip->ip_p == IPPROTO_IGMP)
- goto ours;
- ipstat.ips_forward++;
- }
- /*
- * See if we belong to the destination multicast group on the
- * arrival interface.
- */
- IN_LOOKUP_MULTI(ip->ip_dst, m->m_pkthdr.rcvif, inm);
- if (inm == NULL) {
- ipstat.ips_cantforward++;
- m_freem(m);
- return;
- }
- goto ours;
- }
- if (ip->ip_dst.s_addr == (u_long)INADDR_BROADCAST)
- goto ours;
- if (ip->ip_dst.s_addr == INADDR_ANY)
- goto ours;
-
- /*
- * Not for us; forward if possible and desirable.
- */
- if (ipforwarding == 0) {
- ipstat.ips_cantforward++;
- m_freem(m);
- } else
- ip_forward(m, 0);
- return;
-
-ours:
-
- /*
- * If offset or IP_MF are set, must reassemble.
- * Otherwise, nothing need be done.
- * (We could look in the reassembly queue to see
- * if the packet was previously fragmented,
- * but it's not worth the time; just let them time out.)
- */
- if (ip->ip_off &~ (IP_DF | IP_RF)) {
- if (m->m_flags & M_EXT) { /* XXX */
- if ((m = m_pullup(m, sizeof (struct ip))) == 0) {
- ipstat.ips_toosmall++;
-#ifdef IPDIVERT
- frag_divert_port = 0;
-#endif
- return;
- }
- ip = mtod(m, struct ip *);
- }
- sum = IPREASS_HASH(ip->ip_src.s_addr, ip->ip_id);
- /*
- * Look for queue of fragments
- * of this datagram.
- */
- for (fp = ipq[sum].next; fp != &ipq[sum]; fp = fp->next)
- if (ip->ip_id == fp->ipq_id &&
- ip->ip_src.s_addr == fp->ipq_src.s_addr &&
- ip->ip_dst.s_addr == fp->ipq_dst.s_addr &&
- ip->ip_p == fp->ipq_p)
- goto found;
-
- fp = 0;
-
- /* check if there's a place for the new queue */
- if (nipq > maxnipq) {
- /*
- * drop something from the tail of the current queue
- * before proceeding further
- */
- if (ipq[sum].prev == &ipq[sum]) { /* gak */
- for (i = 0; i < IPREASS_NHASH; i++) {
- if (ipq[i].prev != &ipq[i]) {
- ip_freef(ipq[i].prev);
- break;
- }
- }
- } else
- ip_freef(ipq[sum].prev);
- }
-found:
- /*
- * Adjust ip_len to not reflect header,
- * set ip_mff if more fragments are expected,
- * convert offset of this to bytes.
- */
- ip->ip_len -= hlen;
- ((struct ipasfrag *)ip)->ipf_mff &= ~1;
- if (ip->ip_off & IP_MF)
- ((struct ipasfrag *)ip)->ipf_mff |= 1;
- ip->ip_off <<= 3;
-
- /*
- * If datagram marked as having more fragments
- * or if this is not the first fragment,
- * attempt reassembly; if it succeeds, proceed.
- */
- if (((struct ipasfrag *)ip)->ipf_mff & 1 || ip->ip_off) {
- ipstat.ips_fragments++;
- ip = ip_reass((struct ipasfrag *)ip, fp, &ipq[sum]);
- if (ip == 0)
- return;
- ipstat.ips_reassembled++;
- m = dtom(ip);
-#ifdef IPDIVERT
- if (frag_divert_port) {
- ip->ip_len += hlen;
- HTONS(ip->ip_len);
- HTONS(ip->ip_off);
- HTONS(ip->ip_id);
- ip->ip_sum = 0;
- ip->ip_sum = in_cksum_hdr(ip);
- NTOHS(ip->ip_id);
- NTOHS(ip->ip_off);
- NTOHS(ip->ip_len);
- ip->ip_len -= hlen;
- }
-#endif
- } else
- if (fp)
- ip_freef(fp);
- } else
- ip->ip_len -= hlen;
-
-#ifdef IPDIVERT
- /*
- * Divert reassembled packets to the divert protocol if required
- */
- if (frag_divert_port) {
- ipstat.ips_delivered++;
- ip_divert_port = frag_divert_port;
- frag_divert_port = 0;
- (*inetsw[ip_protox[IPPROTO_DIVERT]].pr_input)(m, hlen);
- return;
- }
-
- /* Don't let packets divert themselves */
- if (ip->ip_p == IPPROTO_DIVERT) {
- ipstat.ips_noproto++;
- goto bad;
- }
-#endif
-
- /*
- * Switch out to protocol's input routine.
- */
- ipstat.ips_delivered++;
- (*inetsw[ip_protox[ip->ip_p]].pr_input)(m, hlen);
- return;
-bad:
- m_freem(m);
-}
-
-/*
- * IP software interrupt routine - to go away sometime soon
- */
-void
-ipintr(void)
-{
- int s;
- struct mbuf *m;
-
- while(1) {
- s = splimp();
- IF_DEQUEUE(&ipintrq, m);
- splx(s);
- if (m == 0)
- return;
- ip_input(m);
- }
-}
-
-NETISR_SET(NETISR_IP, ipintr);
-
-/*
- * Take incoming datagram fragment and try to
- * reassemble it into whole datagram. If a chain for
- * reassembly of this datagram already exists, then it
- * is given as fp; otherwise have to make a chain.
- */
-static struct ip *
-ip_reass(ip, fp, where)
- register struct ipasfrag *ip;
- register struct ipq *fp;
- struct ipq *where;
-{
- register struct mbuf *m = dtom(ip);
- register struct ipasfrag *q;
- struct mbuf *t;
- int hlen = ip->ip_hl << 2;
- int i, next;
-
- /*
- * Presence of header sizes in mbufs
- * would confuse code below.
- */
- m->m_data += hlen;
- m->m_len -= hlen;
-
- /*
- * If first fragment to arrive, create a reassembly queue.
- */
- if (fp == 0) {
- if ((t = m_get(M_DONTWAIT, MT_FTABLE)) == NULL)
- goto dropfrag;
- fp = mtod(t, struct ipq *);
- insque(fp, where);
- nipq++;
- fp->ipq_ttl = IPFRAGTTL;
- fp->ipq_p = ip->ip_p;
- fp->ipq_id = ip->ip_id;
- fp->ipq_next = fp->ipq_prev = (struct ipasfrag *)fp;
- fp->ipq_src = ((struct ip *)ip)->ip_src;
- fp->ipq_dst = ((struct ip *)ip)->ip_dst;
-#ifdef IPDIVERT
- fp->ipq_divert = 0;
-#endif
- q = (struct ipasfrag *)fp;
- goto insert;
- }
-
- /*
- * Find a segment which begins after this one does.
- */
- for (q = fp->ipq_next; q != (struct ipasfrag *)fp; q = q->ipf_next)
- if (q->ip_off > ip->ip_off)
- break;
-
- /*
- * If there is a preceding segment, it may provide some of
- * our data already. If so, drop the data from the incoming
- * segment. If it provides all of our data, drop us.
- */
- if (q->ipf_prev != (struct ipasfrag *)fp) {
- i = q->ipf_prev->ip_off + q->ipf_prev->ip_len - ip->ip_off;
- if (i > 0) {
- if (i >= ip->ip_len)
- goto dropfrag;
- m_adj(dtom(ip), i);
- ip->ip_off += i;
- ip->ip_len -= i;
- }
- }
-
- /*
- * While we overlap succeeding segments trim them or,
- * if they are completely covered, dequeue them.
- */
- while (q != (struct ipasfrag *)fp && ip->ip_off + ip->ip_len > q->ip_off) {
- struct mbuf *m0;
-
- i = (ip->ip_off + ip->ip_len) - q->ip_off;
- if (i < q->ip_len) {
- q->ip_len -= i;
- q->ip_off += i;
- m_adj(dtom(q), i);
- break;
- }
- m0 = dtom(q);
- q = q->ipf_next;
- ip_deq(q->ipf_prev);
- m_freem(m0);
- }
-
-insert:
-
-#ifdef IPDIVERT
- /*
- * Any fragment diverting causes the whole packet to divert
- */
- if (frag_divert_port != 0)
- fp->ipq_divert = frag_divert_port;
- frag_divert_port = 0;
-#endif
-
- /*
- * Stick new segment in its place;
- * check for complete reassembly.
- */
- ip_enq(ip, q->ipf_prev);
- next = 0;
- for (q = fp->ipq_next; q != (struct ipasfrag *)fp; q = q->ipf_next) {
- if (q->ip_off != next)
- return (0);
- next += q->ip_len;
- }
- if (q->ipf_prev->ipf_mff & 1)
- return (0);
-
- /*
- * Reassembly is complete. Make sure the packet is a sane size.
- */
- if (next + (IP_VHL_HL(((struct ip *)fp->ipq_next)->ip_vhl) << 2)
- > IP_MAXPACKET) {
- ipstat.ips_toolong++;
- ip_freef(fp);
- return (0);
- }
-
- /*
- * Concatenate fragments.
- */
- q = fp->ipq_next;
- m = dtom(q);
- t = m->m_next;
- m->m_next = 0;
- m_cat(m, t);
- q = q->ipf_next;
- while (q != (struct ipasfrag *)fp) {
- t = dtom(q);
- q = q->ipf_next;
- m_cat(m, t);
- }
-
-#ifdef IPDIVERT
- /*
- * Record divert port for packet, if any
- */
- frag_divert_port = fp->ipq_divert;
-#endif
-
- /*
- * Create header for new ip packet by
- * modifying header of first packet;
- * dequeue and discard fragment reassembly header.
- * Make header visible.
- */
- ip = fp->ipq_next;
- ip->ip_len = next;
- ip->ipf_mff &= ~1;
- ((struct ip *)ip)->ip_src = fp->ipq_src;
- ((struct ip *)ip)->ip_dst = fp->ipq_dst;
- remque(fp);
- nipq--;
- (void) m_free(dtom(fp));
- m = dtom(ip);
- m->m_len += (ip->ip_hl << 2);
- m->m_data -= (ip->ip_hl << 2);
- /* some debugging cruft by sklower, below, will go away soon */
- if (m->m_flags & M_PKTHDR) { /* XXX this should be done elsewhere */
- register int plen = 0;
- for (t = m; m; m = m->m_next)
- plen += m->m_len;
- t->m_pkthdr.len = plen;
- }
- return ((struct ip *)ip);
-
-dropfrag:
- ipstat.ips_fragdropped++;
- m_freem(m);
- return (0);
-}
-
-/*
- * Free a fragment reassembly header and all
- * associated datagrams.
- */
-static void
-ip_freef(fp)
- struct ipq *fp;
-{
- register struct ipasfrag *q, *p;
-
- for (q = fp->ipq_next; q != (struct ipasfrag *)fp; q = p) {
- p = q->ipf_next;
- ip_deq(q);
- m_freem(dtom(q));
- }
- remque(fp);
- (void) m_free(dtom(fp));
- nipq--;
-}
-
-/*
- * Put an ip fragment on a reassembly chain.
- * Like insque, but pointers in middle of structure.
- */
-static void
-ip_enq(p, prev)
- register struct ipasfrag *p, *prev;
-{
-
- p->ipf_prev = prev;
- p->ipf_next = prev->ipf_next;
- prev->ipf_next->ipf_prev = p;
- prev->ipf_next = p;
-}
-
-/*
- * To ip_enq as remque is to insque.
- */
-static void
-ip_deq(p)
- register struct ipasfrag *p;
-{
-
- p->ipf_prev->ipf_next = p->ipf_next;
- p->ipf_next->ipf_prev = p->ipf_prev;
-}
-
-/*
- * IP timer processing;
- * if a timer expires on a reassembly
- * queue, discard it.
- */
-void
-ip_slowtimo()
-{
- register struct ipq *fp;
- int s = splnet();
- int i;
-
- for (i = 0; i < IPREASS_NHASH; i++) {
- fp = ipq[i].next;
- if (fp == 0)
- continue;
- while (fp != &ipq[i]) {
- --fp->ipq_ttl;
- fp = fp->next;
- if (fp->prev->ipq_ttl == 0) {
- ipstat.ips_fragtimeout++;
- ip_freef(fp->prev);
- }
- }
- }
- splx(s);
-}
-
-/*
- * Drain off all datagram fragments.
- */
-void
-ip_drain()
-{
- int i;
-
- for (i = 0; i < IPREASS_NHASH; i++) {
- while (ipq[i].next != &ipq[i]) {
- ipstat.ips_fragdropped++;
- ip_freef(ipq[i].next);
- }
- }
- in_rtqdrain();
-}
-
-/*
- * Do option processing on a datagram,
- * possibly discarding it if bad options are encountered,
- * or forwarding it if source-routed.
- * Returns 1 if packet has been forwarded/freed,
- * 0 if the packet should be processed further.
- */
-static int
-ip_dooptions(m)
- struct mbuf *m;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register u_char *cp;
- register struct ip_timestamp *ipt;
- register struct in_ifaddr *ia;
- int opt, optlen, cnt, off, code, type = ICMP_PARAMPROB, forward = 0;
- struct in_addr *sin, dst;
- n_time ntime;
-
- dst = ip->ip_dst;
- cp = (u_char *)(ip + 1);
- cnt = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof (struct ip);
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[IPOPT_OLEN];
- if (optlen <= 0 || optlen > cnt) {
- code = &cp[IPOPT_OLEN] - (u_char *)ip;
- goto bad;
- }
- }
- switch (opt) {
-
- default:
- break;
-
- /*
- * Source routing with record.
- * Find interface with current destination address.
- * If none on this machine then drop if strictly routed,
- * or do nothing if loosely routed.
- * Record interface address and bring up next address
- * component. If strictly routed make sure next
- * address is on directly accessible net.
- */
- case IPOPT_LSRR:
- case IPOPT_SSRR:
- if ((off = cp[IPOPT_OFFSET]) < IPOPT_MINOFF) {
- code = &cp[IPOPT_OFFSET] - (u_char *)ip;
- goto bad;
- }
- ipaddr.sin_addr = ip->ip_dst;
- ia = (struct in_ifaddr *)
- ifa_ifwithaddr((struct sockaddr *)&ipaddr);
- if (ia == 0) {
- if (opt == IPOPT_SSRR) {
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_SRCFAIL;
- goto bad;
- }
- if (!ip_dosourceroute)
- goto nosourcerouting;
- /*
- * Loose routing, and not at next destination
- * yet; nothing to do except forward.
- */
- break;
- }
- off--; /* 0 origin */
- if (off > optlen - sizeof(struct in_addr)) {
- /*
- * End of source route. Should be for us.
- */
- if (!ip_acceptsourceroute)
- goto nosourcerouting;
- save_rte(cp, ip->ip_src);
- break;
- }
-
- if (!ip_dosourceroute) {
- char buf[4*sizeof "123"];
-
-nosourcerouting:
- strcpy(buf, inet_ntoa(ip->ip_dst));
- log(LOG_WARNING,
- "attempted source route from %s to %s\n",
- inet_ntoa(ip->ip_src), buf);
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_SRCFAIL;
- goto bad;
- }
-
- /*
- * locate outgoing interface
- */
- (void)memcpy(&ipaddr.sin_addr, cp + off,
- sizeof(ipaddr.sin_addr));
-
- if (opt == IPOPT_SSRR) {
-#define INA struct in_ifaddr *
-#define SA struct sockaddr *
- if ((ia = (INA)ifa_ifwithdstaddr((SA)&ipaddr)) == 0)
- ia = (INA)ifa_ifwithnet((SA)&ipaddr);
- } else
- ia = ip_rtaddr(ipaddr.sin_addr);
- if (ia == 0) {
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_SRCFAIL;
- goto bad;
- }
- ip->ip_dst = ipaddr.sin_addr;
- (void)memcpy(cp + off, &(IA_SIN(ia)->sin_addr),
- sizeof(struct in_addr));
- cp[IPOPT_OFFSET] += sizeof(struct in_addr);
- /*
- * Let ip_intr's mcast routing check handle mcast pkts
- */
- forward = !IN_MULTICAST(ntohl(ip->ip_dst.s_addr));
- break;
-
- case IPOPT_RR:
- if ((off = cp[IPOPT_OFFSET]) < IPOPT_MINOFF) {
- code = &cp[IPOPT_OFFSET] - (u_char *)ip;
- goto bad;
- }
- /*
- * If no space remains, ignore.
- */
- off--; /* 0 origin */
- if (off > optlen - sizeof(struct in_addr))
- break;
- (void)memcpy(&ipaddr.sin_addr, &ip->ip_dst,
- sizeof(ipaddr.sin_addr));
- /*
- * locate outgoing interface; if we're the destination,
- * use the incoming interface (should be same).
- */
- if ((ia = (INA)ifa_ifwithaddr((SA)&ipaddr)) == 0 &&
- (ia = ip_rtaddr(ipaddr.sin_addr)) == 0) {
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_HOST;
- goto bad;
- }
- (void)memcpy(cp + off, &(IA_SIN(ia)->sin_addr),
- sizeof(struct in_addr));
- cp[IPOPT_OFFSET] += sizeof(struct in_addr);
- break;
-
- case IPOPT_TS:
- code = cp - (u_char *)ip;
- ipt = (struct ip_timestamp *)cp;
- if (ipt->ipt_len < 5)
- goto bad;
- if (ipt->ipt_ptr > ipt->ipt_len - sizeof (long)) {
- if (++ipt->ipt_oflw == 0)
- goto bad;
- break;
- }
- sin = (struct in_addr *)(cp + ipt->ipt_ptr - 1);
- switch (ipt->ipt_flg) {
-
- case IPOPT_TS_TSONLY:
- break;
-
- case IPOPT_TS_TSANDADDR:
- if (ipt->ipt_ptr + sizeof(n_time) +
- sizeof(struct in_addr) > ipt->ipt_len)
- goto bad;
- ipaddr.sin_addr = dst;
- ia = (INA)ifaof_ifpforaddr((SA)&ipaddr,
- m->m_pkthdr.rcvif);
- if (ia == 0)
- continue;
- (void)memcpy(sin, &IA_SIN(ia)->sin_addr,
- sizeof(struct in_addr));
- ipt->ipt_ptr += sizeof(struct in_addr);
- break;
-
- case IPOPT_TS_PRESPEC:
- if (ipt->ipt_ptr + sizeof(n_time) +
- sizeof(struct in_addr) > ipt->ipt_len)
- goto bad;
- (void)memcpy(&ipaddr.sin_addr, sin,
- sizeof(struct in_addr));
- if (ifa_ifwithaddr((SA)&ipaddr) == 0)
- continue;
- ipt->ipt_ptr += sizeof(struct in_addr);
- break;
-
- default:
- goto bad;
- }
- ntime = iptime();
- (void)memcpy(cp + ipt->ipt_ptr - 1, &ntime,
- sizeof(n_time));
- ipt->ipt_ptr += sizeof(n_time);
- }
- }
- if (forward && ipforwarding) {
- ip_forward(m, 1);
- return (1);
- }
- return (0);
-bad:
- ip->ip_len -= IP_VHL_HL(ip->ip_vhl) << 2; /* XXX icmp_error adds in hdr length */
- icmp_error(m, type, code, 0, 0);
- ipstat.ips_badoptions++;
- return (1);
-}
-
-/*
- * Given address of next destination (final or next hop),
- * return internet address info of interface to be used to get there.
- */
-static struct in_ifaddr *
-ip_rtaddr(dst)
- struct in_addr dst;
-{
- register struct sockaddr_in *sin;
-
- sin = (struct sockaddr_in *) &ipforward_rt.ro_dst;
-
- if (ipforward_rt.ro_rt == 0 || dst.s_addr != sin->sin_addr.s_addr) {
- if (ipforward_rt.ro_rt) {
- RTFREE(ipforward_rt.ro_rt);
- ipforward_rt.ro_rt = 0;
- }
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_addr = dst;
-
- rtalloc_ign(&ipforward_rt, RTF_PRCLONING);
- }
- if (ipforward_rt.ro_rt == 0)
- return ((struct in_ifaddr *)0);
- return ((struct in_ifaddr *) ipforward_rt.ro_rt->rt_ifa);
-}
-
-/*
- * Save incoming source route for use in replies,
- * to be picked up later by ip_srcroute if the receiver is interested.
- */
-void
-save_rte(option, dst)
- u_char *option;
- struct in_addr dst;
-{
- unsigned olen;
-
- olen = option[IPOPT_OLEN];
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("save_rte: olen %d\n", olen);
-#endif
- if (olen > sizeof(ip_srcrt) - (1 + sizeof(dst)))
- return;
- bcopy(option, ip_srcrt.srcopt, olen);
- ip_nhops = (olen - IPOPT_OFFSET - 1) / sizeof(struct in_addr);
- ip_srcrt.dst = dst;
-}
-
-/*
- * Retrieve incoming source route for use in replies,
- * in the same form used by setsockopt.
- * The first hop is placed before the options, will be removed later.
- */
-struct mbuf *
-ip_srcroute()
-{
- register struct in_addr *p, *q;
- register struct mbuf *m;
-
- if (ip_nhops == 0)
- return ((struct mbuf *)0);
- m = m_get(M_DONTWAIT, MT_SOOPTS);
- if (m == 0)
- return ((struct mbuf *)0);
-
-#define OPTSIZ (sizeof(ip_srcrt.nop) + sizeof(ip_srcrt.srcopt))
-
- /* length is (nhops+1)*sizeof(addr) + sizeof(nop + srcrt header) */
- m->m_len = ip_nhops * sizeof(struct in_addr) + sizeof(struct in_addr) +
- OPTSIZ;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("ip_srcroute: nhops %d mlen %d", ip_nhops, m->m_len);
-#endif
-
- /*
- * First save first hop for return route
- */
- p = &ip_srcrt.route[ip_nhops - 1];
- *(mtod(m, struct in_addr *)) = *p--;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf(" hops %lx", ntohl(mtod(m, struct in_addr *)->s_addr));
-#endif
-
- /*
- * Copy option fields and padding (nop) to mbuf.
- */
- ip_srcrt.nop = IPOPT_NOP;
- ip_srcrt.srcopt[IPOPT_OFFSET] = IPOPT_MINOFF;
- (void)memcpy(mtod(m, caddr_t) + sizeof(struct in_addr),
- &ip_srcrt.nop, OPTSIZ);
- q = (struct in_addr *)(mtod(m, caddr_t) +
- sizeof(struct in_addr) + OPTSIZ);
-#undef OPTSIZ
- /*
- * Record return path as an IP source route,
- * reversing the path (pointers are now aligned).
- */
- while (p >= ip_srcrt.route) {
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf(" %lx", ntohl(q->s_addr));
-#endif
- *q++ = *p--;
- }
- /*
- * Last hop goes to final destination.
- */
- *q = ip_srcrt.dst;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf(" %lx\n", ntohl(q->s_addr));
-#endif
- return (m);
-}
-
-/*
- * Strip out IP options, at higher
- * level protocol in the kernel.
- * Second argument is buffer to which options
- * will be moved, and return value is their length.
- * XXX should be deleted; last arg currently ignored.
- */
-void
-ip_stripoptions(m, mopt)
- register struct mbuf *m;
- struct mbuf *mopt;
-{
- register int i;
- struct ip *ip = mtod(m, struct ip *);
- register caddr_t opts;
- int olen;
-
- olen = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof (struct ip);
- opts = (caddr_t)(ip + 1);
- i = m->m_len - (sizeof (struct ip) + olen);
- bcopy(opts + olen, opts, (unsigned)i);
- m->m_len -= olen;
- if (m->m_flags & M_PKTHDR)
- m->m_pkthdr.len -= olen;
- ip->ip_vhl = IP_MAKE_VHL(IPVERSION, sizeof(struct ip) >> 2);
-}
-
-u_char inetctlerrmap[PRC_NCMDS] = {
- 0, 0, 0, 0,
- 0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH,
- EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED,
- EMSGSIZE, EHOSTUNREACH, 0, 0,
- 0, 0, 0, 0,
- ENOPROTOOPT
-};
-
-/*
- * Forward a packet. If some error occurs return the sender
- * an icmp packet. Note we can't always generate a meaningful
- * icmp message because icmp doesn't have a large enough repertoire
- * of codes and types.
- *
- * If not forwarding, just drop the packet. This could be confusing
- * if ipforwarding was zero but some routing protocol was advancing
- * us as a gateway to somewhere. However, we must let the routing
- * protocol deal with that.
- *
- * The srcrt parameter indicates whether the packet is being forwarded
- * via a source route.
- */
-static void
-ip_forward(m, srcrt)
- struct mbuf *m;
- int srcrt;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register struct sockaddr_in *sin;
- register struct rtentry *rt;
- int error, type = 0, code = 0;
- struct mbuf *mcopy;
- n_long dest;
- struct ifnet *destifp;
-
- dest = 0;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("forward: src %lx dst %lx ttl %x\n",
- ip->ip_src.s_addr, ip->ip_dst.s_addr, ip->ip_ttl);
-#endif
-
-
- if (m->m_flags & M_BCAST || in_canforward(ip->ip_dst) == 0) {
- ipstat.ips_cantforward++;
- m_freem(m);
- return;
- }
- HTONS(ip->ip_id);
- if (ip->ip_ttl <= IPTTLDEC) {
- icmp_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, dest, 0);
- return;
- }
- ip->ip_ttl -= IPTTLDEC;
-
- sin = (struct sockaddr_in *)&ipforward_rt.ro_dst;
- if ((rt = ipforward_rt.ro_rt) == 0 ||
- ip->ip_dst.s_addr != sin->sin_addr.s_addr) {
- if (ipforward_rt.ro_rt) {
- RTFREE(ipforward_rt.ro_rt);
- ipforward_rt.ro_rt = 0;
- }
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_addr = ip->ip_dst;
-
- rtalloc_ign(&ipforward_rt, RTF_PRCLONING);
- if (ipforward_rt.ro_rt == 0) {
- icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, dest, 0);
- return;
- }
- rt = ipforward_rt.ro_rt;
- }
-
- /*
- * Save at most 64 bytes of the packet in case
- * we need to generate an ICMP message to the src.
- */
- mcopy = m_copy(m, 0, imin((int)ip->ip_len, 64));
-
- /*
- * If forwarding packet using same interface that it came in on,
- * perhaps should send a redirect to sender to shortcut a hop.
- * Only send redirect if source is sending directly to us,
- * and if packet was not source routed (or has any options).
- * Also, don't send redirect if forwarding using a default route
- * or a route modified by a redirect.
- */
-#define satosin(sa) ((struct sockaddr_in *)(sa))
- if (rt->rt_ifp == m->m_pkthdr.rcvif &&
- (rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0 &&
- satosin(rt_key(rt))->sin_addr.s_addr != 0 &&
- ipsendredirects && !srcrt) {
-#define RTA(rt) ((struct in_ifaddr *)(rt->rt_ifa))
- u_long src = ntohl(ip->ip_src.s_addr);
-
- if (RTA(rt) &&
- (src & RTA(rt)->ia_subnetmask) == RTA(rt)->ia_subnet) {
- if (rt->rt_flags & RTF_GATEWAY)
- dest = satosin(rt->rt_gateway)->sin_addr.s_addr;
- else
- dest = ip->ip_dst.s_addr;
- /* Router requirements says to only send host redirects */
- type = ICMP_REDIRECT;
- code = ICMP_REDIRECT_HOST;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("redirect (%d) to %lx\n", code, (u_long)dest);
-#endif
- }
- }
-
- error = ip_output(m, (struct mbuf *)0, &ipforward_rt,
- IP_FORWARDING, 0);
- if (error)
- ipstat.ips_cantforward++;
- else {
- ipstat.ips_forward++;
- if (type)
- ipstat.ips_redirectsent++;
- else {
- if (mcopy)
- m_freem(mcopy);
- return;
- }
- }
- if (mcopy == NULL)
- return;
- destifp = NULL;
-
- switch (error) {
-
- case 0: /* forwarded, but need redirect */
- /* type, code set above */
- break;
-
- case ENETUNREACH: /* shouldn't happen, checked above */
- case EHOSTUNREACH:
- case ENETDOWN:
- case EHOSTDOWN:
- default:
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_HOST;
- break;
-
- case EMSGSIZE:
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_NEEDFRAG;
- if (ipforward_rt.ro_rt)
- destifp = ipforward_rt.ro_rt->rt_ifp;
- ipstat.ips_cantfrag++;
- break;
-
- case ENOBUFS:
- type = ICMP_SOURCEQUENCH;
- code = 0;
- break;
- }
- icmp_error(mcopy, type, code, dest, destifp);
-}
-
-void
-ip_savecontrol(inp, mp, ip, m)
- register struct inpcb *inp;
- register struct mbuf **mp;
- register struct ip *ip;
- register struct mbuf *m;
-{
- if (inp->inp_socket->so_options & SO_TIMESTAMP) {
- struct timeval tv;
-
- microtime(&tv);
- *mp = sbcreatecontrol((caddr_t) &tv, sizeof(tv),
- SCM_TIMESTAMP, SOL_SOCKET);
- if (*mp)
- mp = &(*mp)->m_next;
- }
- if (inp->inp_flags & INP_RECVDSTADDR) {
- *mp = sbcreatecontrol((caddr_t) &ip->ip_dst,
- sizeof(struct in_addr), IP_RECVDSTADDR, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
-#ifdef notyet
- /* XXX
- * Moving these out of udp_input() made them even more broken
- * than they already were.
- */
- /* options were tossed already */
- if (inp->inp_flags & INP_RECVOPTS) {
- *mp = sbcreatecontrol((caddr_t) opts_deleted_above,
- sizeof(struct in_addr), IP_RECVOPTS, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
- /* ip_srcroute doesn't do what we want here, need to fix */
- if (inp->inp_flags & INP_RECVRETOPTS) {
- *mp = sbcreatecontrol((caddr_t) ip_srcroute(),
- sizeof(struct in_addr), IP_RECVRETOPTS, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
-#endif
- if (inp->inp_flags & INP_RECVIF) {
- struct sockaddr_dl sdl;
-
- sdl.sdl_len = offsetof(struct sockaddr_dl, sdl_data[0]);
- sdl.sdl_family = AF_LINK;
- sdl.sdl_index = m->m_pkthdr.rcvif ?
- m->m_pkthdr.rcvif->if_index : 0;
- sdl.sdl_nlen = sdl.sdl_alen = sdl.sdl_slen = 0;
- *mp = sbcreatecontrol((caddr_t) &sdl, sdl.sdl_len,
- IP_RECVIF, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
-}
-
-int
-ip_rsvp_init(struct socket *so)
-{
- if (so->so_type != SOCK_RAW ||
- so->so_proto->pr_protocol != IPPROTO_RSVP)
- return EOPNOTSUPP;
-
- if (ip_rsvpd != NULL)
- return EADDRINUSE;
-
- ip_rsvpd = so;
- /*
- * This may seem silly, but we need to be sure we don't over-increment
- * the RSVP counter, in case something slips up.
- */
- if (!ip_rsvp_on) {
- ip_rsvp_on = 1;
- rsvp_on++;
- }
-
- return 0;
-}
-
-int
-ip_rsvp_done(void)
-{
- ip_rsvpd = NULL;
- /*
- * This may seem silly, but we need to be sure we don't over-decrement
- * the RSVP counter, in case something slips up.
- */
- if (ip_rsvp_on) {
- ip_rsvp_on = 0;
- rsvp_on--;
- }
- return 0;
-}
diff --git a/c/src/exec/libnetworking/netinet/ip_mroute.c b/c/src/exec/libnetworking/netinet/ip_mroute.c
deleted file mode 100644
index 662d695dfe..0000000000
--- a/c/src/exec/libnetworking/netinet/ip_mroute.c
+++ /dev/null
@@ -1,2302 +0,0 @@
-/*
- * IP multicast forwarding procedures
- *
- * Written by David Waitzman, BBN Labs, August 1988.
- * Modified by Steve Deering, Stanford, February 1989.
- * Modified by Mark J. Steiglitz, Stanford, May, 1991
- * Modified by Van Jacobson, LBL, January 1993
- * Modified by Ajit Thyagarajan, PARC, August 1993
- * Modified by Bill Fenner, PARC, April 1995
- *
- * MROUTING Revision: 3.5
- * $Id$
- */
-
-#include "opt_mrouting.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
-#include <sys/ioctl.h>
-#include <sys/syslog.h>
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/igmp.h>
-#include <netinet/igmp_var.h>
-#include <netinet/ip_mroute.h>
-#include <netinet/udp.h>
-
-#ifndef NTOHL
-#if BYTE_ORDER != BIG_ENDIAN
-#define NTOHL(d) ((d) = ntohl((d)))
-#define NTOHS(d) ((d) = ntohs((u_short)(d)))
-#define HTONL(d) ((d) = htonl((d)))
-#define HTONS(d) ((d) = htons((u_short)(d)))
-#else
-#define NTOHL(d)
-#define NTOHS(d)
-#define HTONL(d)
-#define HTONS(d)
-#endif
-#endif
-
-#ifndef MROUTING
-extern u_long _ip_mcast_src __P((int vifi));
-extern int _ip_mforward __P((struct ip *ip, struct ifnet *ifp,
- struct mbuf *m, struct ip_moptions *imo));
-extern int _ip_mrouter_done __P((void));
-extern int _ip_mrouter_get __P((int cmd, struct socket *so,
- struct mbuf **m));
-extern int _ip_mrouter_set __P((int cmd, struct socket *so,
- struct mbuf *m));
-extern int _mrt_ioctl __P((int req, caddr_t data, struct proc *p));
-
-/*
- * Dummy routines and globals used when multicast routing is not compiled in.
- */
-
-struct socket *ip_mrouter = NULL;
-/* static u_int ip_mrtproto = 0; */
-/* static struct mrtstat mrtstat; */
-u_int rsvpdebug = 0;
-
-int
-_ip_mrouter_set(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf *m;
-{
- return(EOPNOTSUPP);
-}
-
-int (*ip_mrouter_set)(int, struct socket *, struct mbuf *) = _ip_mrouter_set;
-
-
-int
-_ip_mrouter_get(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf **m;
-{
- return(EOPNOTSUPP);
-}
-
-int (*ip_mrouter_get)(int, struct socket *, struct mbuf **) = _ip_mrouter_get;
-
-int
-_ip_mrouter_done()
-{
- return(0);
-}
-
-int (*ip_mrouter_done)(void) = _ip_mrouter_done;
-
-int
-_ip_mforward(ip, ifp, m, imo)
- struct ip *ip;
- struct ifnet *ifp;
- struct mbuf *m;
- struct ip_moptions *imo;
-{
- return(0);
-}
-
-int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *,
- struct ip_moptions *) = _ip_mforward;
-
-int
-_mrt_ioctl(int req, caddr_t data, struct proc *p)
-{
- return EOPNOTSUPP;
-}
-
-int (*mrt_ioctl)(int, caddr_t, struct proc *) = _mrt_ioctl;
-
-void
-rsvp_input(m, iphlen) /* XXX must fixup manually */
- struct mbuf *m;
- int iphlen;
-{
- /* Can still get packets with rsvp_on = 0 if there is a local member
- * of the group to which the RSVP packet is addressed. But in this
- * case we want to throw the packet away.
- */
- if (!rsvp_on) {
- m_freem(m);
- return;
- }
-
- if (ip_rsvpd != NULL) {
- if (rsvpdebug)
- printf("rsvp_input: Sending packet up old-style socket\n");
- rip_input(m, iphlen);
- return;
- }
- /* Drop the packet */
- m_freem(m);
-}
-
-void ipip_input(struct mbuf *m, int iphlen) { /* XXX must fixup manually */
- rip_input(m, iphlen);
-}
-
-int (*legal_vif_num)(int) = 0;
-
-/*
- * This should never be called, since IP_MULTICAST_VIF should fail, but
- * just in case it does get called, the code a little lower in ip_output
- * will assign the packet a local address.
- */
-u_long
-_ip_mcast_src(int vifi) { return INADDR_ANY; }
-u_long (*ip_mcast_src)(int) = _ip_mcast_src;
-
-int
-ip_rsvp_vif_init(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- return(EINVAL);
-}
-
-int
-ip_rsvp_vif_done(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- return(EINVAL);
-}
-
-void
-ip_rsvp_force_done(so)
- struct socket *so;
-{
- return;
-}
-
-#else /* MROUTING */
-
-#define M_HASCL(m) ((m)->m_flags & M_EXT)
-
-#define INSIZ sizeof(struct in_addr)
-#define same(a1, a2) \
- (bcmp((caddr_t)(a1), (caddr_t)(a2), INSIZ) == 0)
-
-#define MT_MRTABLE MT_RTABLE /* since nothing else uses it */
-
-/*
- * Globals. All but ip_mrouter and ip_mrtproto could be static,
- * except for netstat or debugging purposes.
- */
-#ifndef MROUTE_LKM
-struct socket *ip_mrouter = NULL;
-struct mrtstat mrtstat;
-
-int ip_mrtproto = IGMP_DVMRP; /* for netstat only */
-#else /* MROUTE_LKM */
-extern void X_ipip_input __P((struct mbuf *m, int iphlen));
-extern struct mrtstat mrtstat;
-static int ip_mrtproto;
-#endif
-
-#define NO_RTE_FOUND 0x1
-#define RTE_FOUND 0x2
-
-static struct mbuf *mfctable[MFCTBLSIZ];
-static u_char nexpire[MFCTBLSIZ];
-static struct vif viftable[MAXVIFS];
-static u_int mrtdebug = 0; /* debug level */
-#define DEBUG_MFC 0x02
-#define DEBUG_FORWARD 0x04
-#define DEBUG_EXPIRE 0x08
-#define DEBUG_XMIT 0x10
-static u_int tbfdebug = 0; /* tbf debug level */
-static u_int rsvpdebug = 0; /* rsvp debug level */
-
-#define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */
-#define UPCALL_EXPIRE 6 /* number of timeouts */
-
-/*
- * Define the token bucket filter structures
- * tbftable -> each vif has one of these for storing info
- */
-
-static struct tbf tbftable[MAXVIFS];
-#define TBF_REPROCESS (hz / 100) /* 100x / second */
-
-/*
- * 'Interfaces' associated with decapsulator (so we can tell
- * packets that went through it from ones that get reflected
- * by a broken gateway). These interfaces are never linked into
- * the system ifnet list & no routes point to them. I.e., packets
- * can't be sent this way. They only exist as a placeholder for
- * multicast source verification.
- */
-static struct ifnet multicast_decap_if[MAXVIFS];
-
-#define ENCAP_TTL 64
-#define ENCAP_PROTO IPPROTO_IPIP /* 4 */
-
-/* prototype IP hdr for encapsulated packets */
-static struct ip multicast_encap_iphdr = {
-#if BYTE_ORDER == LITTLE_ENDIAN
- sizeof(struct ip) >> 2, IPVERSION,
-#else
- IPVERSION, sizeof(struct ip) >> 2,
-#endif
- 0, /* tos */
- sizeof(struct ip), /* total length */
- 0, /* id */
- 0, /* frag offset */
- ENCAP_TTL, ENCAP_PROTO,
- 0, /* checksum */
-};
-
-/*
- * Private variables.
- */
-static vifi_t numvifs = 0;
-static int have_encap_tunnel = 0;
-
-/*
- * one-back cache used by ipip_input to locate a tunnel's vif
- * given a datagram's src ip address.
- */
-static u_long last_encap_src;
-static struct vif *last_encap_vif;
-
-static u_long X_ip_mcast_src __P((int vifi));
-static int X_ip_mforward __P((struct ip *ip, struct ifnet *ifp, struct mbuf *m, struct ip_moptions *imo));
-static int X_ip_mrouter_done __P((void));
-static int X_ip_mrouter_get __P((int cmd, struct socket *so, struct mbuf **m));
-static int X_ip_mrouter_set __P((int cmd, struct socket *so, struct mbuf *m));
-static int X_legal_vif_num __P((int vif));
-static int X_mrt_ioctl __P((int cmd, caddr_t data));
-
-static int get_sg_cnt(struct sioc_sg_req *);
-static int get_vif_cnt(struct sioc_vif_req *);
-static int ip_mrouter_init(struct socket *, struct mbuf *);
-static int add_vif(struct vifctl *);
-static int del_vif(vifi_t *);
-static int add_mfc(struct mfcctl *);
-static int del_mfc(struct mfcctl *);
-static int socket_send(struct socket *, struct mbuf *, struct sockaddr_in *);
-static int get_version(struct mbuf *);
-static int get_assert(struct mbuf *);
-static int set_assert(int *);
-static void expire_upcalls(void *);
-static int ip_mdq(struct mbuf *, struct ifnet *, struct mfc *,
- vifi_t);
-static void phyint_send(struct ip *, struct vif *, struct mbuf *);
-static void encap_send(struct ip *, struct vif *, struct mbuf *);
-static void tbf_control(struct vif *, struct mbuf *, struct ip *, u_long);
-static void tbf_queue(struct vif *, struct mbuf *);
-static void tbf_process_q(struct vif *);
-static void tbf_reprocess_q(void *);
-static int tbf_dq_sel(struct vif *, struct ip *);
-static void tbf_send_packet(struct vif *, struct mbuf *);
-static void tbf_update_tokens(struct vif *);
-static int priority(struct vif *, struct ip *);
-void multiencap_decap(struct mbuf *);
-
-/*
- * whether or not special PIM assert processing is enabled.
- */
-static int pim_assert;
-/*
- * Rate limit for assert notification messages, in usec
- */
-#define ASSERT_MSG_TIME 3000000
-
-/*
- * Hash function for a source, group entry
- */
-#define MFCHASH(a, g) MFCHASHMOD(((a) >> 20) ^ ((a) >> 10) ^ (a) ^ \
- ((g) >> 20) ^ ((g) >> 10) ^ (g))
-
-/*
- * Find a route for a given origin IP address and Multicast group address
- * Type of service parameter to be added in the future!!!
- */
-
-#define MFCFIND(o, g, rt) { \
- register struct mbuf *_mb_rt = mfctable[MFCHASH(o,g)]; \
- register struct mfc *_rt = NULL; \
- rt = NULL; \
- ++mrtstat.mrts_mfc_lookups; \
- while (_mb_rt) { \
- _rt = mtod(_mb_rt, struct mfc *); \
- if ((_rt->mfc_origin.s_addr == o) && \
- (_rt->mfc_mcastgrp.s_addr == g) && \
- (_mb_rt->m_act == NULL)) { \
- rt = _rt; \
- break; \
- } \
- _mb_rt = _mb_rt->m_next; \
- } \
- if (rt == NULL) { \
- ++mrtstat.mrts_mfc_misses; \
- } \
-}
-
-
-/*
- * Macros to compute elapsed time efficiently
- * Borrowed from Van Jacobson's scheduling code
- */
-#define TV_DELTA(a, b, delta) { \
- register int xxs; \
- \
- delta = (a).tv_usec - (b).tv_usec; \
- if ((xxs = (a).tv_sec - (b).tv_sec)) { \
- switch (xxs) { \
- case 2: \
- delta += 1000000; \
- /* fall through */ \
- case 1: \
- delta += 1000000; \
- break; \
- default: \
- delta += (1000000 * xxs); \
- } \
- } \
-}
-
-#define TV_LT(a, b) (((a).tv_usec < (b).tv_usec && \
- (a).tv_sec <= (b).tv_sec) || (a).tv_sec < (b).tv_sec)
-
-#ifdef UPCALL_TIMING
-u_long upcall_data[51];
-static void collate(struct timeval *);
-#endif /* UPCALL_TIMING */
-
-
-/*
- * Handle MRT setsockopt commands to modify the multicast routing tables.
- */
-static int
-X_ip_mrouter_set(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf *m;
-{
- if (cmd != MRT_INIT && so != ip_mrouter) return EACCES;
-
- switch (cmd) {
- case MRT_INIT: return ip_mrouter_init(so, m);
- case MRT_DONE: return ip_mrouter_done();
- case MRT_ADD_VIF: return add_vif (mtod(m, struct vifctl *));
- case MRT_DEL_VIF: return del_vif (mtod(m, vifi_t *));
- case MRT_ADD_MFC: return add_mfc (mtod(m, struct mfcctl *));
- case MRT_DEL_MFC: return del_mfc (mtod(m, struct mfcctl *));
- case MRT_ASSERT: return set_assert(mtod(m, int *));
- default: return EOPNOTSUPP;
- }
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mrouter_set)(int, struct socket *, struct mbuf *) = X_ip_mrouter_set;
-#endif
-
-/*
- * Handle MRT getsockopt commands
- */
-static int
-X_ip_mrouter_get(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf **m;
-{
- struct mbuf *mb;
-
- if (so != ip_mrouter) return EACCES;
-
- *m = mb = m_get(M_WAIT, MT_SOOPTS);
-
- switch (cmd) {
- case MRT_VERSION: return get_version(mb);
- case MRT_ASSERT: return get_assert(mb);
- default: return EOPNOTSUPP;
- }
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mrouter_get)(int, struct socket *, struct mbuf **) = X_ip_mrouter_get;
-#endif
-
-/*
- * Handle ioctl commands to obtain information from the cache
- */
-static int
-X_mrt_ioctl(cmd, data)
- int cmd;
- caddr_t data;
-{
- int error = 0;
-
- switch (cmd) {
- case (SIOCGETVIFCNT):
- return (get_vif_cnt((struct sioc_vif_req *)data));
- break;
- case (SIOCGETSGCNT):
- return (get_sg_cnt((struct sioc_sg_req *)data));
- break;
- default:
- return (EINVAL);
- break;
- }
- return error;
-}
-
-#ifndef MROUTE_LKM
-int (*mrt_ioctl)(int, caddr_t) = X_mrt_ioctl;
-#endif
-
-/*
- * returns the packet, byte, rpf-failure count for the source group provided
- */
-static int
-get_sg_cnt(req)
- register struct sioc_sg_req *req;
-{
- register struct mfc *rt;
- int s;
-
- s = splnet();
- MFCFIND(req->src.s_addr, req->grp.s_addr, rt);
- splx(s);
- if (rt != NULL) {
- req->pktcnt = rt->mfc_pkt_cnt;
- req->bytecnt = rt->mfc_byte_cnt;
- req->wrong_if = rt->mfc_wrong_if;
- } else
- req->pktcnt = req->bytecnt = req->wrong_if = 0xffffffff;
-
- return 0;
-}
-
-/*
- * returns the input and output packet and byte counts on the vif provided
- */
-static int
-get_vif_cnt(req)
- register struct sioc_vif_req *req;
-{
- register vifi_t vifi = req->vifi;
-
- if (vifi >= numvifs) return EINVAL;
-
- req->icount = viftable[vifi].v_pkt_in;
- req->ocount = viftable[vifi].v_pkt_out;
- req->ibytes = viftable[vifi].v_bytes_in;
- req->obytes = viftable[vifi].v_bytes_out;
-
- return 0;
-}
-
-/*
- * Enable multicast routing
- */
-static int
-ip_mrouter_init(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- int *v;
-
- if (mrtdebug)
- log(LOG_DEBUG,"ip_mrouter_init: so_type = %d, pr_protocol = %d\n",
- so->so_type, so->so_proto->pr_protocol);
-
- if (so->so_type != SOCK_RAW ||
- so->so_proto->pr_protocol != IPPROTO_IGMP) return EOPNOTSUPP;
-
- if (!m || (m->m_len != sizeof(int *)))
- return ENOPROTOOPT;
-
- v = mtod(m, int *);
- if (*v != 1)
- return ENOPROTOOPT;
-
- if (ip_mrouter != NULL) return EADDRINUSE;
-
- ip_mrouter = so;
-
- bzero((caddr_t)mfctable, sizeof(mfctable));
- bzero((caddr_t)nexpire, sizeof(nexpire));
-
- pim_assert = 0;
-
- timeout(expire_upcalls, (caddr_t)NULL, EXPIRE_TIMEOUT);
-
- if (mrtdebug)
- log(LOG_DEBUG, "ip_mrouter_init\n");
-
- return 0;
-}
-
-/*
- * Disable multicast routing
- */
-static int
-X_ip_mrouter_done()
-{
- vifi_t vifi;
- int i;
- struct ifnet *ifp;
- struct ifreq ifr;
- struct mbuf *mb_rt;
- struct mbuf *m;
- struct rtdetq *rte;
- int s;
-
- s = splnet();
-
- /*
- * For each phyint in use, disable promiscuous reception of all IP
- * multicasts.
- */
- for (vifi = 0; vifi < numvifs; vifi++) {
- if (viftable[vifi].v_lcl_addr.s_addr != 0 &&
- !(viftable[vifi].v_flags & VIFF_TUNNEL)) {
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr.s_addr
- = INADDR_ANY;
- ifp = viftable[vifi].v_ifp;
- (*ifp->if_ioctl)(ifp, SIOCDELMULTI, (caddr_t)&ifr);
- }
- }
- bzero((caddr_t)tbftable, sizeof(tbftable));
- bzero((caddr_t)viftable, sizeof(viftable));
- numvifs = 0;
- pim_assert = 0;
-
- untimeout(expire_upcalls, (caddr_t)NULL);
-
- /*
- * Free all multicast forwarding cache entries.
- */
- for (i = 0; i < MFCTBLSIZ; i++) {
- mb_rt = mfctable[i];
- while (mb_rt) {
- if (mb_rt->m_act != NULL) {
- while (mb_rt->m_act) {
- m = mb_rt->m_act;
- mb_rt->m_act = m->m_act;
- rte = mtod(m, struct rtdetq *);
- m_freem(rte->m);
- m_free(m);
- }
- }
- mb_rt = m_free(mb_rt);
- }
- }
-
- bzero((caddr_t)mfctable, sizeof(mfctable));
-
- /*
- * Reset de-encapsulation cache
- */
- last_encap_src = 0;
- last_encap_vif = NULL;
- have_encap_tunnel = 0;
-
- ip_mrouter = NULL;
-
- splx(s);
-
- if (mrtdebug)
- log(LOG_DEBUG, "ip_mrouter_done\n");
-
- return 0;
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mrouter_done)(void) = X_ip_mrouter_done;
-#endif
-
-static int
-get_version(mb)
- struct mbuf *mb;
-{
- int *v;
-
- v = mtod(mb, int *);
-
- *v = 0x0305; /* XXX !!!! */
- mb->m_len = sizeof(int);
-
- return 0;
-}
-
-/*
- * Set PIM assert processing global
- */
-static int
-set_assert(i)
- int *i;
-{
- if ((*i != 1) && (*i != 0))
- return EINVAL;
-
- pim_assert = *i;
-
- return 0;
-}
-
-/*
- * Get PIM assert processing global
- */
-static int
-get_assert(m)
- struct mbuf *m;
-{
- int *i;
-
- i = mtod(m, int *);
-
- *i = pim_assert;
-
- return 0;
-}
-
-/*
- * Add a vif to the vif table
- */
-static int
-add_vif(vifcp)
- register struct vifctl *vifcp;
-{
- register struct vif *vifp = viftable + vifcp->vifc_vifi;
- static struct sockaddr_in sin = {sizeof sin, AF_INET};
- struct ifaddr *ifa;
- struct ifnet *ifp;
- struct ifreq ifr;
- int error, s;
- struct tbf *v_tbf = tbftable + vifcp->vifc_vifi;
-
- if (vifcp->vifc_vifi >= MAXVIFS) return EINVAL;
- if (vifp->v_lcl_addr.s_addr != 0) return EADDRINUSE;
-
- /* Find the interface with an address in AF_INET family */
- sin.sin_addr = vifcp->vifc_lcl_addr;
- ifa = ifa_ifwithaddr((struct sockaddr *)&sin);
- if (ifa == 0) return EADDRNOTAVAIL;
- ifp = ifa->ifa_ifp;
-
- if (vifcp->vifc_flags & VIFF_TUNNEL) {
- if ((vifcp->vifc_flags & VIFF_SRCRT) == 0) {
- /*
- * An encapsulating tunnel is wanted. Tell ipip_input() to
- * start paying attention to encapsulated packets.
- */
- if (have_encap_tunnel == 0) {
- have_encap_tunnel = 1;
- for (s = 0; s < MAXVIFS; ++s) {
- multicast_decap_if[s].if_name = "mdecap";
- multicast_decap_if[s].if_unit = s;
- }
- }
- /*
- * Set interface to fake encapsulator interface
- */
- ifp = &multicast_decap_if[vifcp->vifc_vifi];
- /*
- * Prepare cached route entry
- */
- bzero(&vifp->v_route, sizeof(vifp->v_route));
- } else {
- log(LOG_ERR, "source routed tunnels not supported\n");
- return EOPNOTSUPP;
- }
- } else {
- /* Make sure the interface supports multicast */
- if ((ifp->if_flags & IFF_MULTICAST) == 0)
- return EOPNOTSUPP;
-
- /* Enable promiscuous reception of all IP multicasts from the if */
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr.s_addr = INADDR_ANY;
- s = splnet();
- error = (*ifp->if_ioctl)(ifp, SIOCADDMULTI, (caddr_t)&ifr);
- splx(s);
- if (error)
- return error;
- }
-
- s = splnet();
- /* define parameters for the tbf structure */
- vifp->v_tbf = v_tbf;
- GET_TIME(vifp->v_tbf->tbf_last_pkt_t);
- vifp->v_tbf->tbf_n_tok = 0;
- vifp->v_tbf->tbf_q_len = 0;
- vifp->v_tbf->tbf_max_q_len = MAXQSIZE;
- vifp->v_tbf->tbf_q = vifp->v_tbf->tbf_t = NULL;
-
- vifp->v_flags = vifcp->vifc_flags;
- vifp->v_threshold = vifcp->vifc_threshold;
- vifp->v_lcl_addr = vifcp->vifc_lcl_addr;
- vifp->v_rmt_addr = vifcp->vifc_rmt_addr;
- vifp->v_ifp = ifp;
- /* scaling up here allows division by 1024 in critical code */
- vifp->v_rate_limit= vifcp->vifc_rate_limit * 1024 / 1000;
- vifp->v_rsvp_on = 0;
- vifp->v_rsvpd = NULL;
- /* initialize per vif pkt counters */
- vifp->v_pkt_in = 0;
- vifp->v_pkt_out = 0;
- vifp->v_bytes_in = 0;
- vifp->v_bytes_out = 0;
- splx(s);
-
- /* Adjust numvifs up if the vifi is higher than numvifs */
- if (numvifs <= vifcp->vifc_vifi) numvifs = vifcp->vifc_vifi + 1;
-
- if (mrtdebug)
- log(LOG_DEBUG, "add_vif #%d, lcladdr %x, %s %x, thresh %x, rate %d\n",
- vifcp->vifc_vifi,
- ntohl(vifcp->vifc_lcl_addr.s_addr),
- (vifcp->vifc_flags & VIFF_TUNNEL) ? "rmtaddr" : "mask",
- ntohl(vifcp->vifc_rmt_addr.s_addr),
- vifcp->vifc_threshold,
- vifcp->vifc_rate_limit);
-
- return 0;
-}
-
-/*
- * Delete a vif from the vif table
- */
-static int
-del_vif(vifip)
- vifi_t *vifip;
-{
- register struct vif *vifp = viftable + *vifip;
- register vifi_t vifi;
- register struct mbuf *m;
- struct ifnet *ifp;
- struct ifreq ifr;
- int s;
-
- if (*vifip >= numvifs) return EINVAL;
- if (vifp->v_lcl_addr.s_addr == 0) return EADDRNOTAVAIL;
-
- s = splnet();
-
- if (!(vifp->v_flags & VIFF_TUNNEL)) {
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr.s_addr = INADDR_ANY;
- ifp = vifp->v_ifp;
- (*ifp->if_ioctl)(ifp, SIOCDELMULTI, (caddr_t)&ifr);
- }
-
- if (vifp == last_encap_vif) {
- last_encap_vif = 0;
- last_encap_src = 0;
- }
-
- /*
- * Free packets queued at the interface
- */
- while (vifp->v_tbf->tbf_q) {
- m = vifp->v_tbf->tbf_q;
- vifp->v_tbf->tbf_q = m->m_act;
- m_freem(m);
- }
-
- bzero((caddr_t)vifp->v_tbf, sizeof(*(vifp->v_tbf)));
- bzero((caddr_t)vifp, sizeof (*vifp));
-
- /* Adjust numvifs down */
- for (vifi = numvifs; vifi > 0; vifi--)
- if (viftable[vifi-1].v_lcl_addr.s_addr != 0) break;
- numvifs = vifi;
-
- splx(s);
-
- if (mrtdebug)
- log(LOG_DEBUG, "del_vif %d, numvifs %d\n", *vifip, numvifs);
-
- return 0;
-}
-
-/*
- * Add an mfc entry
- */
-static int
-add_mfc(mfccp)
- struct mfcctl *mfccp;
-{
- struct mfc *rt;
- register struct mbuf *mb_rt;
- u_long hash;
- struct mbuf *mb_ntry;
- struct rtdetq *rte;
- register u_short nstl;
- int s;
- int i;
-
- MFCFIND(mfccp->mfcc_origin.s_addr, mfccp->mfcc_mcastgrp.s_addr, rt);
-
- /* If an entry already exists, just update the fields */
- if (rt) {
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"add_mfc update o %x g %x p %x\n",
- ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent);
-
- s = splnet();
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- splx(s);
- return 0;
- }
-
- /*
- * Find the entry for which the upcall was made and update
- */
- s = splnet();
- hash = MFCHASH(mfccp->mfcc_origin.s_addr, mfccp->mfcc_mcastgrp.s_addr);
- for (mb_rt = mfctable[hash], nstl = 0; mb_rt; mb_rt = mb_rt->m_next) {
-
- rt = mtod(mb_rt, struct mfc *);
- if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
- (rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr) &&
- (mb_rt->m_act != NULL)) {
-
- if (nstl++)
- log(LOG_ERR, "add_mfc %s o %x g %x p %x dbx %x\n",
- "multiple kernel entries",
- ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent, mb_rt->m_act);
-
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"add_mfc o %x g %x p %x dbg %x\n",
- ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent, mb_rt->m_act);
-
- rt->mfc_origin = mfccp->mfcc_origin;
- rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- /* initialize pkt counters per src-grp */
- rt->mfc_pkt_cnt = 0;
- rt->mfc_byte_cnt = 0;
- rt->mfc_wrong_if = 0;
- rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
-
- rt->mfc_expire = 0; /* Don't clean this guy up */
- nexpire[hash]--;
-
- /* free packets Qed at the end of this entry */
- while (mb_rt->m_act) {
- mb_ntry = mb_rt->m_act;
- rte = mtod(mb_ntry, struct rtdetq *);
-/* #ifdef RSVP_ISI */
- ip_mdq(rte->m, rte->ifp, rt, -1);
-/* #endif */
- mb_rt->m_act = mb_ntry->m_act;
- m_freem(rte->m);
-#ifdef UPCALL_TIMING
- collate(&(rte->t));
-#endif /* UPCALL_TIMING */
- m_free(mb_ntry);
- }
- }
- }
-
- /*
- * It is possible that an entry is being inserted without an upcall
- */
- if (nstl == 0) {
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"add_mfc no upcall h %d o %x g %x p %x\n",
- hash, ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent);
-
- for (mb_rt = mfctable[hash]; mb_rt; mb_rt = mb_rt->m_next) {
-
- rt = mtod(mb_rt, struct mfc *);
- if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
- (rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr)) {
-
- rt->mfc_origin = mfccp->mfcc_origin;
- rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- /* initialize pkt counters per src-grp */
- rt->mfc_pkt_cnt = 0;
- rt->mfc_byte_cnt = 0;
- rt->mfc_wrong_if = 0;
- rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
- if (rt->mfc_expire)
- nexpire[hash]--;
- rt->mfc_expire = 0;
- }
- }
- if (mb_rt == NULL) {
- /* no upcall, so make a new entry */
- MGET(mb_rt, M_DONTWAIT, MT_MRTABLE);
- if (mb_rt == NULL) {
- splx(s);
- return ENOBUFS;
- }
-
- rt = mtod(mb_rt, struct mfc *);
-
- /* insert new entry at head of hash chain */
- rt->mfc_origin = mfccp->mfcc_origin;
- rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- /* initialize pkt counters per src-grp */
- rt->mfc_pkt_cnt = 0;
- rt->mfc_byte_cnt = 0;
- rt->mfc_wrong_if = 0;
- rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
- rt->mfc_expire = 0;
-
- /* link into table */
- mb_rt->m_next = mfctable[hash];
- mfctable[hash] = mb_rt;
- mb_rt->m_act = NULL;
- }
- }
- splx(s);
- return 0;
-}
-
-#ifdef UPCALL_TIMING
-/*
- * collect delay statistics on the upcalls
- */
-static void collate(t)
-register struct timeval *t;
-{
- register u_long d;
- register struct timeval tp;
- register u_long delta;
-
- GET_TIME(tp);
-
- if (TV_LT(*t, tp))
- {
- TV_DELTA(tp, *t, delta);
-
- d = delta >> 10;
- if (d > 50)
- d = 50;
-
- ++upcall_data[d];
- }
-}
-#endif /* UPCALL_TIMING */
-
-/*
- * Delete an mfc entry
- */
-static int
-del_mfc(mfccp)
- struct mfcctl *mfccp;
-{
- struct in_addr origin;
- struct in_addr mcastgrp;
- struct mfc *rt;
- struct mbuf *mb_rt;
- struct mbuf **nptr;
- u_long hash;
- int s;
-
- origin = mfccp->mfcc_origin;
- mcastgrp = mfccp->mfcc_mcastgrp;
- hash = MFCHASH(origin.s_addr, mcastgrp.s_addr);
-
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"del_mfc orig %x mcastgrp %x\n",
- ntohl(origin.s_addr), ntohl(mcastgrp.s_addr));
-
- s = splnet();
-
- nptr = &mfctable[hash];
- while ((mb_rt = *nptr) != NULL) {
- rt = mtod(mb_rt, struct mfc *);
- if (origin.s_addr == rt->mfc_origin.s_addr &&
- mcastgrp.s_addr == rt->mfc_mcastgrp.s_addr &&
- mb_rt->m_act == NULL)
- break;
-
- nptr = &mb_rt->m_next;
- }
- if (mb_rt == NULL) {
- splx(s);
- return EADDRNOTAVAIL;
- }
-
- MFREE(mb_rt, *nptr);
-
- splx(s);
-
- return 0;
-}
-
-/*
- * Send a message to mrouted on the multicast routing socket
- */
-static int
-socket_send(s, mm, src)
- struct socket *s;
- struct mbuf *mm;
- struct sockaddr_in *src;
-{
- if (s) {
- if (sbappendaddr(&s->so_rcv,
- (struct sockaddr *)src,
- mm, (struct mbuf *)0) != 0) {
- sorwakeup(s);
- return 0;
- }
- }
- m_freem(mm);
- return -1;
-}
-
-/*
- * IP multicast forwarding function. This function assumes that the packet
- * pointed to by "ip" has arrived on (or is about to be sent to) the interface
- * pointed to by "ifp", and the packet is to be relayed to other networks
- * that have members of the packet's destination IP multicast group.
- *
- * The packet is returned unscathed to the caller, unless it is
- * erroneous, in which case a non-zero return value tells the caller to
- * discard it.
- */
-
-#define IP_HDR_LEN 20 /* # bytes of fixed IP header (excluding options) */
-#define TUNNEL_LEN 12 /* # bytes of IP option for tunnel encapsulation */
-
-static int
-X_ip_mforward(ip, ifp, m, imo)
- register struct ip *ip;
- struct ifnet *ifp;
- struct mbuf *m;
- struct ip_moptions *imo;
-{
- register struct mfc *rt;
- register u_char *ipoptions;
- static struct sockaddr_in k_igmpsrc = { sizeof k_igmpsrc, AF_INET };
- static int srctun = 0;
- register struct mbuf *mm;
- int s;
- vifi_t vifi;
- struct vif *vifp;
-
- if (mrtdebug & DEBUG_FORWARD)
- log(LOG_DEBUG, "ip_mforward: src %x, dst %x, ifp %x\n",
- ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr), ifp);
-
- if (ip->ip_hl < (IP_HDR_LEN + TUNNEL_LEN) >> 2 ||
- (ipoptions = (u_char *)(ip + 1))[1] != IPOPT_LSRR ) {
- /*
- * Packet arrived via a physical interface or
- * an encapsulated tunnel.
- */
- } else {
- /*
- * Packet arrived through a source-route tunnel.
- * Source-route tunnels are no longer supported.
- */
- if ((srctun++ % 1000) == 0)
- log(LOG_ERR, "ip_mforward: received source-routed packet from %x\n",
- ntohl(ip->ip_src.s_addr));
-
- return 1;
- }
-
- if ((imo) && ((vifi = imo->imo_multicast_vif) < numvifs)) {
- if (ip->ip_ttl < 255)
- ip->ip_ttl++; /* compensate for -1 in *_send routines */
- if (rsvpdebug && ip->ip_p == IPPROTO_RSVP) {
- vifp = viftable + vifi;
- printf("Sending IPPROTO_RSVP from %lx to %lx on vif %d (%s%s%d)\n",
- ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr), vifi,
- (vifp->v_flags & VIFF_TUNNEL) ? "tunnel on " : "",
- vifp->v_ifp->if_name, vifp->v_ifp->if_unit);
- }
- return (ip_mdq(m, ifp, NULL, vifi));
- }
- if (rsvpdebug && ip->ip_p == IPPROTO_RSVP) {
- printf("Warning: IPPROTO_RSVP from %lx to %lx without vif option\n",
- ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr));
- if(!imo)
- printf("In fact, no options were specified at all\n");
- }
-
- /*
- * Don't forward a packet with time-to-live of zero or one,
- * or a packet destined to a local-only group.
- */
- if (ip->ip_ttl <= 1 ||
- ntohl(ip->ip_dst.s_addr) <= INADDR_MAX_LOCAL_GROUP)
- return 0;
-
- /*
- * Determine forwarding vifs from the forwarding cache table
- */
- s = splnet();
- MFCFIND(ip->ip_src.s_addr, ip->ip_dst.s_addr, rt);
-
- /* Entry exists, so forward if necessary */
- if (rt != NULL) {
- splx(s);
- return (ip_mdq(m, ifp, rt, -1));
- } else {
- /*
- * If we don't have a route for packet's origin,
- * Make a copy of the packet &
- * send message to routing daemon
- */
-
- register struct mbuf *mb_rt;
- register struct mbuf *mb_ntry;
- register struct mbuf *mb0;
- register struct rtdetq *rte;
- register struct mbuf *rte_m;
- register u_long hash;
- register int npkts;
- int hlen = ip->ip_hl << 2;
-#ifdef UPCALL_TIMING
- struct timeval tp;
-
- GET_TIME(tp);
-#endif
-
- mrtstat.mrts_no_route++;
- if (mrtdebug & (DEBUG_FORWARD | DEBUG_MFC))
- log(LOG_DEBUG, "ip_mforward: no rte s %x g %x\n",
- ntohl(ip->ip_src.s_addr),
- ntohl(ip->ip_dst.s_addr));
-
- /*
- * Allocate mbufs early so that we don't do extra work if we are
- * just going to fail anyway. Make sure to pullup the header so
- * that other people can't step on it.
- */
- MGET(mb_ntry, M_DONTWAIT, MT_DATA);
- if (mb_ntry == NULL) {
- splx(s);
- return ENOBUFS;
- }
- mb0 = m_copy(m, 0, M_COPYALL);
- if (mb0 && (M_HASCL(mb0) || mb0->m_len < hlen))
- mb0 = m_pullup(mb0, hlen);
- if (mb0 == NULL) {
- m_free(mb_ntry);
- splx(s);
- return ENOBUFS;
- }
-
- /* is there an upcall waiting for this packet? */
- hash = MFCHASH(ip->ip_src.s_addr, ip->ip_dst.s_addr);
- for (mb_rt = mfctable[hash]; mb_rt; mb_rt = mb_rt->m_next) {
- rt = mtod(mb_rt, struct mfc *);
- if ((ip->ip_src.s_addr == rt->mfc_origin.s_addr) &&
- (ip->ip_dst.s_addr == rt->mfc_mcastgrp.s_addr) &&
- (mb_rt->m_act != NULL))
- break;
- }
-
- if (mb_rt == NULL) {
- int i;
- struct igmpmsg *im;
-
- /* no upcall, so make a new entry */
- MGET(mb_rt, M_DONTWAIT, MT_MRTABLE);
- if (mb_rt == NULL) {
- m_free(mb_ntry);
- m_freem(mb0);
- splx(s);
- return ENOBUFS;
- }
- /* Make a copy of the header to send to the user level process */
- mm = m_copy(mb0, 0, hlen);
- if (mm == NULL) {
- m_free(mb_ntry);
- m_freem(mb0);
- m_free(mb_rt);
- splx(s);
- return ENOBUFS;
- }
-
- /*
- * Send message to routing daemon to install
- * a route into the kernel table
- */
- k_igmpsrc.sin_addr = ip->ip_src;
-
- im = mtod(mm, struct igmpmsg *);
- im->im_msgtype = IGMPMSG_NOCACHE;
- im->im_mbz = 0;
-
- mrtstat.mrts_upcalls++;
-
- if (socket_send(ip_mrouter, mm, &k_igmpsrc) < 0) {
- log(LOG_WARNING, "ip_mforward: ip_mrouter socket queue full\n");
- ++mrtstat.mrts_upq_sockfull;
- m_free(mb_ntry);
- m_freem(mb0);
- m_free(mb_rt);
- splx(s);
- return ENOBUFS;
- }
-
- rt = mtod(mb_rt, struct mfc *);
-
- /* insert new entry at head of hash chain */
- rt->mfc_origin.s_addr = ip->ip_src.s_addr;
- rt->mfc_mcastgrp.s_addr = ip->ip_dst.s_addr;
- rt->mfc_expire = UPCALL_EXPIRE;
- nexpire[hash]++;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = 0;
- rt->mfc_parent = -1;
-
- /* link into table */
- mb_rt->m_next = mfctable[hash];
- mfctable[hash] = mb_rt;
- mb_rt->m_act = NULL;
-
- rte_m = mb_rt;
- } else {
- /* determine if q has overflowed */
- for (rte_m = mb_rt, npkts = 0; rte_m->m_act; rte_m = rte_m->m_act)
- npkts++;
-
- if (npkts > MAX_UPQ) {
- mrtstat.mrts_upq_ovflw++;
- m_free(mb_ntry);
- m_freem(mb0);
- splx(s);
- return 0;
- }
- }
-
- mb_ntry->m_act = NULL;
- rte = mtod(mb_ntry, struct rtdetq *);
-
- rte->m = mb0;
- rte->ifp = ifp;
-#ifdef UPCALL_TIMING
- rte->t = tp;
-#endif
-
- /* Add this entry to the end of the queue */
- rte_m->m_act = mb_ntry;
-
- splx(s);
-
- return 0;
- }
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *,
- struct ip_moptions *) = X_ip_mforward;
-#endif
-
-/*
- * Clean up the cache entry if upcall is not serviced
- */
-static void
-expire_upcalls(void *unused)
-{
- struct mbuf *mb_rt, *m, **nptr;
- struct rtdetq *rte;
- struct mfc *mfc;
- int i;
- int s;
-
- s = splnet();
- for (i = 0; i < MFCTBLSIZ; i++) {
- if (nexpire[i] == 0)
- continue;
- nptr = &mfctable[i];
- for (mb_rt = *nptr; mb_rt != NULL; mb_rt = *nptr) {
- mfc = mtod(mb_rt, struct mfc *);
-
- /*
- * Skip real cache entries
- * Make sure it wasn't marked to not expire (shouldn't happen)
- * If it expires now
- */
- if (mb_rt->m_act != NULL &&
- mfc->mfc_expire != 0 &&
- --mfc->mfc_expire == 0) {
- if (mrtdebug & DEBUG_EXPIRE)
- log(LOG_DEBUG, "expire_upcalls: expiring (%x %x)\n",
- ntohl(mfc->mfc_origin.s_addr),
- ntohl(mfc->mfc_mcastgrp.s_addr));
- /*
- * drop all the packets
- * free the mbuf with the pkt, if, timing info
- */
- while (mb_rt->m_act) {
- m = mb_rt->m_act;
- mb_rt->m_act = m->m_act;
-
- rte = mtod(m, struct rtdetq *);
- m_freem(rte->m);
- m_free(m);
- }
- ++mrtstat.mrts_cache_cleanups;
- nexpire[i]--;
-
- MFREE(mb_rt, *nptr);
- } else {
- nptr = &mb_rt->m_next;
- }
- }
- }
- splx(s);
- timeout(expire_upcalls, (caddr_t)NULL, EXPIRE_TIMEOUT);
-}
-
-/*
- * Packet forwarding routine once entry in the cache is made
- */
-static int
-ip_mdq(m, ifp, rt, xmt_vif)
- register struct mbuf *m;
- register struct ifnet *ifp;
- register struct mfc *rt;
- register vifi_t xmt_vif;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register vifi_t vifi;
- register struct vif *vifp;
- register int plen = ntohs(ip->ip_len);
-
-/*
- * Macro to send packet on vif. Since RSVP packets don't get counted on
- * input, they shouldn't get counted on output, so statistics keeping is
- * seperate.
- */
-#define MC_SEND(ip,vifp,m) { \
- if ((vifp)->v_flags & VIFF_TUNNEL) \
- encap_send((ip), (vifp), (m)); \
- else \
- phyint_send((ip), (vifp), (m)); \
-}
-
- /*
- * If xmt_vif is not -1, send on only the requested vif.
- *
- * (since vifi_t is u_short, -1 becomes MAXUSHORT, which > numvifs.)
- */
- if (xmt_vif < numvifs) {
- MC_SEND(ip, viftable + xmt_vif, m);
- return 1;
- }
-
- /*
- * Don't forward if it didn't arrive from the parent vif for its origin.
- */
- vifi = rt->mfc_parent;
- if ((vifi >= numvifs) || (viftable[vifi].v_ifp != ifp)) {
- /* came in the wrong interface */
- if (mrtdebug & DEBUG_FORWARD)
- log(LOG_DEBUG, "wrong if: ifp %x vifi %d vififp %x\n",
- ifp, vifi, viftable[vifi].v_ifp);
- ++mrtstat.mrts_wrong_if;
- ++rt->mfc_wrong_if;
- /*
- * If we are doing PIM assert processing, and we are forwarding
- * packets on this interface, and it is a broadcast medium
- * interface (and not a tunnel), send a message to the routing daemon.
- */
- if (pim_assert && rt->mfc_ttls[vifi] &&
- (ifp->if_flags & IFF_BROADCAST) &&
- !(viftable[vifi].v_flags & VIFF_TUNNEL)) {
- struct sockaddr_in k_igmpsrc;
- struct mbuf *mm;
- struct igmpmsg *im;
- int hlen = ip->ip_hl << 2;
- struct timeval now;
- register u_long delta;
-
- GET_TIME(now);
-
- TV_DELTA(rt->mfc_last_assert, now, delta);
-
- if (delta > ASSERT_MSG_TIME) {
- mm = m_copy(m, 0, hlen);
- if (mm && (M_HASCL(mm) || mm->m_len < hlen))
- mm = m_pullup(mm, hlen);
- if (mm == NULL) {
- return ENOBUFS;
- }
-
- rt->mfc_last_assert = now;
-
- im = mtod(mm, struct igmpmsg *);
- im->im_msgtype = IGMPMSG_WRONGVIF;
- im->im_mbz = 0;
- im->im_vif = vifi;
-
- k_igmpsrc.sin_addr = im->im_src;
-
- socket_send(ip_mrouter, mm, &k_igmpsrc);
- }
- }
- return 0;
- }
-
- /* If I sourced this packet, it counts as output, else it was input. */
- if (ip->ip_src.s_addr == viftable[vifi].v_lcl_addr.s_addr) {
- viftable[vifi].v_pkt_out++;
- viftable[vifi].v_bytes_out += plen;
- } else {
- viftable[vifi].v_pkt_in++;
- viftable[vifi].v_bytes_in += plen;
- }
- rt->mfc_pkt_cnt++;
- rt->mfc_byte_cnt += plen;
-
- /*
- * For each vif, decide if a copy of the packet should be forwarded.
- * Forward if:
- * - the ttl exceeds the vif's threshold
- * - there are group members downstream on interface
- */
- for (vifp = viftable, vifi = 0; vifi < numvifs; vifp++, vifi++)
- if ((rt->mfc_ttls[vifi] > 0) &&
- (ip->ip_ttl > rt->mfc_ttls[vifi])) {
- vifp->v_pkt_out++;
- vifp->v_bytes_out += plen;
- MC_SEND(ip, vifp, m);
- }
-
- return 0;
-}
-
-/*
- * check if a vif number is legal/ok. This is used by ip_output, to export
- * numvifs there,
- */
-static int
-X_legal_vif_num(vif)
- int vif;
-{
- if (vif >= 0 && vif < numvifs)
- return(1);
- else
- return(0);
-}
-
-#ifndef MROUTE_LKM
-int (*legal_vif_num)(int) = X_legal_vif_num;
-#endif
-
-/*
- * Return the local address used by this vif
- */
-static u_long
-X_ip_mcast_src(vifi)
- int vifi;
-{
- if (vifi >= 0 && vifi < numvifs)
- return viftable[vifi].v_lcl_addr.s_addr;
- else
- return INADDR_ANY;
-}
-
-#ifndef MROUTE_LKM
-u_long (*ip_mcast_src)(int) = X_ip_mcast_src;
-#endif
-
-static void
-phyint_send(ip, vifp, m)
- struct ip *ip;
- struct vif *vifp;
- struct mbuf *m;
-{
- register struct mbuf *mb_copy;
- register int hlen = ip->ip_hl << 2;
-
- /*
- * Make a new reference to the packet; make sure that
- * the IP header is actually copied, not just referenced,
- * so that ip_output() only scribbles on the copy.
- */
- mb_copy = m_copy(m, 0, M_COPYALL);
- if (mb_copy && (M_HASCL(mb_copy) || mb_copy->m_len < hlen))
- mb_copy = m_pullup(mb_copy, hlen);
- if (mb_copy == NULL)
- return;
-
- if (vifp->v_rate_limit <= 0)
- tbf_send_packet(vifp, mb_copy);
- else
- tbf_control(vifp, mb_copy, mtod(mb_copy, struct ip *), ip->ip_len);
-}
-
-static void
-encap_send(ip, vifp, m)
- register struct ip *ip;
- register struct vif *vifp;
- register struct mbuf *m;
-{
- register struct mbuf *mb_copy;
- register struct ip *ip_copy;
- register int i, len = ip->ip_len;
-
- /*
- * copy the old packet & pullup it's IP header into the
- * new mbuf so we can modify it. Try to fill the new
- * mbuf since if we don't the ethernet driver will.
- */
- MGETHDR(mb_copy, M_DONTWAIT, MT_HEADER);
- if (mb_copy == NULL)
- return;
- mb_copy->m_data += max_linkhdr;
- mb_copy->m_len = sizeof(multicast_encap_iphdr);
-
- if ((mb_copy->m_next = m_copy(m, 0, M_COPYALL)) == NULL) {
- m_freem(mb_copy);
- return;
- }
- i = MHLEN - M_LEADINGSPACE(mb_copy);
- if (i > len)
- i = len;
- mb_copy = m_pullup(mb_copy, i);
- if (mb_copy == NULL)
- return;
- mb_copy->m_pkthdr.len = len + sizeof(multicast_encap_iphdr);
-
- /*
- * fill in the encapsulating IP header.
- */
- ip_copy = mtod(mb_copy, struct ip *);
- *ip_copy = multicast_encap_iphdr;
- ip_copy->ip_id = htons(ip_id++);
- ip_copy->ip_len += len;
- ip_copy->ip_src = vifp->v_lcl_addr;
- ip_copy->ip_dst = vifp->v_rmt_addr;
-
- /*
- * turn the encapsulated IP header back into a valid one.
- */
- ip = (struct ip *)((caddr_t)ip_copy + sizeof(multicast_encap_iphdr));
- --ip->ip_ttl;
- HTONS(ip->ip_len);
- HTONS(ip->ip_off);
- ip->ip_sum = 0;
- mb_copy->m_data += sizeof(multicast_encap_iphdr);
- ip->ip_sum = in_cksum(mb_copy, ip->ip_hl << 2);
- mb_copy->m_data -= sizeof(multicast_encap_iphdr);
-
- if (vifp->v_rate_limit <= 0)
- tbf_send_packet(vifp, mb_copy);
- else
- tbf_control(vifp, mb_copy, ip, ip_copy->ip_len);
-}
-
-/*
- * De-encapsulate a packet and feed it back through ip input (this
- * routine is called whenever IP gets a packet with proto type
- * ENCAP_PROTO and a local destination address).
- */
-void
-#ifdef MROUTE_LKM
-X_ipip_input(m, iphlen)
-#else
-ipip_input(m, iphlen)
-#endif
- register struct mbuf *m;
- int iphlen;
-{
- struct ifnet *ifp = m->m_pkthdr.rcvif;
- register struct ip *ip = mtod(m, struct ip *);
- register int hlen = ip->ip_hl << 2;
- register int s;
- register struct ifqueue *ifq;
- register struct vif *vifp;
-
- if (!have_encap_tunnel) {
- rip_input(m, iphlen);
- return;
- }
- /*
- * dump the packet if it's not to a multicast destination or if
- * we don't have an encapsulating tunnel with the source.
- * Note: This code assumes that the remote site IP address
- * uniquely identifies the tunnel (i.e., that this site has
- * at most one tunnel with the remote site).
- */
- if (! IN_MULTICAST(ntohl(((struct ip *)((char *)ip + hlen))->ip_dst.s_addr))) {
- ++mrtstat.mrts_bad_tunnel;
- m_freem(m);
- return;
- }
- if (ip->ip_src.s_addr != last_encap_src) {
- register struct vif *vife;
-
- vifp = viftable;
- vife = vifp + numvifs;
- last_encap_src = ip->ip_src.s_addr;
- last_encap_vif = 0;
- for ( ; vifp < vife; ++vifp)
- if (vifp->v_rmt_addr.s_addr == ip->ip_src.s_addr) {
- if ((vifp->v_flags & (VIFF_TUNNEL|VIFF_SRCRT))
- == VIFF_TUNNEL)
- last_encap_vif = vifp;
- break;
- }
- }
- if ((vifp = last_encap_vif) == 0) {
- last_encap_src = 0;
- mrtstat.mrts_cant_tunnel++; /*XXX*/
- m_freem(m);
- if (mrtdebug)
- log(LOG_DEBUG, "ip_mforward: no tunnel with %x\n",
- ntohl(ip->ip_src.s_addr));
- return;
- }
- ifp = vifp->v_ifp;
-
- if (hlen > IP_HDR_LEN)
- ip_stripoptions(m, (struct mbuf *) 0);
- m->m_data += IP_HDR_LEN;
- m->m_len -= IP_HDR_LEN;
- m->m_pkthdr.len -= IP_HDR_LEN;
- m->m_pkthdr.rcvif = ifp;
-
- ifq = &ipintrq;
- s = splimp();
- if (IF_QFULL(ifq)) {
- IF_DROP(ifq);
- m_freem(m);
- } else {
- IF_ENQUEUE(ifq, m);
- /*
- * normally we would need a "schednetisr(NETISR_IP)"
- * here but we were called by ip_input and it is going
- * to loop back & try to dequeue the packet we just
- * queued as soon as we return so we avoid the
- * unnecessary software interrrupt.
- */
- }
- splx(s);
-}
-
-/*
- * Token bucket filter module
- */
-
-static void
-tbf_control(vifp, m, ip, p_len)
- register struct vif *vifp;
- register struct mbuf *m;
- register struct ip *ip;
- register u_long p_len;
-{
- register struct tbf *t = vifp->v_tbf;
-
- if (p_len > MAX_BKT_SIZE) {
- /* drop if packet is too large */
- mrtstat.mrts_pkt2large++;
- m_freem(m);
- return;
- }
-
- tbf_update_tokens(vifp);
-
- /* if there are enough tokens,
- * and the queue is empty,
- * send this packet out
- */
-
- if (t->tbf_q_len == 0) {
- /* queue empty, send packet if enough tokens */
- if (p_len <= t->tbf_n_tok) {
- t->tbf_n_tok -= p_len;
- tbf_send_packet(vifp, m);
- } else {
- /* queue packet and timeout till later */
- tbf_queue(vifp, m);
- timeout(tbf_reprocess_q, (caddr_t)vifp, TBF_REPROCESS);
- }
- } else if (t->tbf_q_len < t->tbf_max_q_len) {
- /* finite queue length, so queue pkts and process queue */
- tbf_queue(vifp, m);
- tbf_process_q(vifp);
- } else {
- /* queue length too much, try to dq and queue and process */
- if (!tbf_dq_sel(vifp, ip)) {
- mrtstat.mrts_q_overflow++;
- m_freem(m);
- return;
- } else {
- tbf_queue(vifp, m);
- tbf_process_q(vifp);
- }
- }
- return;
-}
-
-/*
- * adds a packet to the queue at the interface
- */
-static void
-tbf_queue(vifp, m)
- register struct vif *vifp;
- register struct mbuf *m;
-{
- register int s = splnet();
- register struct tbf *t = vifp->v_tbf;
-
- if (t->tbf_t == NULL) {
- /* Queue was empty */
- t->tbf_q = m;
- } else {
- /* Insert at tail */
- t->tbf_t->m_act = m;
- }
-
- /* Set new tail pointer */
- t->tbf_t = m;
-
-#ifdef DIAGNOSTIC
- /* Make sure we didn't get fed a bogus mbuf */
- if (m->m_act)
- panic("tbf_queue: m_act");
-#endif
- m->m_act = NULL;
-
- t->tbf_q_len++;
-
- splx(s);
-}
-
-
-/*
- * processes the queue at the interface
- */
-static void
-tbf_process_q(vifp)
- register struct vif *vifp;
-{
- register struct mbuf *m;
- register int len;
- register int s = splnet();
- register struct tbf *t = vifp->v_tbf;
-
- /* loop through the queue at the interface and send as many packets
- * as possible
- */
- while (t->tbf_q_len > 0) {
- m = t->tbf_q;
-
- len = mtod(m, struct ip *)->ip_len;
-
- /* determine if the packet can be sent */
- if (len <= t->tbf_n_tok) {
- /* if so,
- * reduce no of tokens, dequeue the packet,
- * send the packet.
- */
- t->tbf_n_tok -= len;
-
- t->tbf_q = m->m_act;
- if (--t->tbf_q_len == 0)
- t->tbf_t = NULL;
-
- m->m_act = NULL;
- tbf_send_packet(vifp, m);
-
- } else break;
- }
- splx(s);
-}
-
-static void
-tbf_reprocess_q(xvifp)
- void *xvifp;
-{
- register struct vif *vifp = xvifp;
- if (ip_mrouter == NULL)
- return;
-
- tbf_update_tokens(vifp);
-
- tbf_process_q(vifp);
-
- if (vifp->v_tbf->tbf_q_len)
- timeout(tbf_reprocess_q, (caddr_t)vifp, TBF_REPROCESS);
-}
-
-/* function that will selectively discard a member of the queue
- * based on the precedence value and the priority
- */
-static int
-tbf_dq_sel(vifp, ip)
- register struct vif *vifp;
- register struct ip *ip;
-{
- register int s = splnet();
- register u_int p;
- register struct mbuf *m, *last;
- register struct mbuf **np;
- register struct tbf *t = vifp->v_tbf;
-
- p = priority(vifp, ip);
-
- np = &t->tbf_q;
- last = NULL;
- while ((m = *np) != NULL) {
- if (p > priority(vifp, mtod(m, struct ip *))) {
- *np = m->m_act;
- /* If we're removing the last packet, fix the tail pointer */
- if (m == t->tbf_t)
- t->tbf_t = last;
- m_freem(m);
- /* it's impossible for the queue to be empty, but
- * we check anyway. */
- if (--t->tbf_q_len == 0)
- t->tbf_t = NULL;
- splx(s);
- mrtstat.mrts_drop_sel++;
- return(1);
- }
- np = &m->m_act;
- last = m;
- }
- splx(s);
- return(0);
-}
-
-static void
-tbf_send_packet(vifp, m)
- register struct vif *vifp;
- register struct mbuf *m;
-{
- struct ip_moptions imo;
- int error;
- static struct route ro;
- int s = splnet();
-
- if (vifp->v_flags & VIFF_TUNNEL) {
- /* If tunnel options */
- ip_output(m, (struct mbuf *)0, &vifp->v_route,
- IP_FORWARDING, (struct ip_moptions *)0);
- } else {
- imo.imo_multicast_ifp = vifp->v_ifp;
- imo.imo_multicast_ttl = mtod(m, struct ip *)->ip_ttl - 1;
- imo.imo_multicast_loop = 1;
- imo.imo_multicast_vif = -1;
-
- /*
- * Re-entrancy should not be a problem here, because
- * the packets that we send out and are looped back at us
- * should get rejected because they appear to come from
- * the loopback interface, thus preventing looping.
- */
- error = ip_output(m, (struct mbuf *)0, &ro,
- IP_FORWARDING, &imo);
-
- if (mrtdebug & DEBUG_XMIT)
- log(LOG_DEBUG, "phyint_send on vif %d err %d\n",
- vifp - viftable, error);
- }
- splx(s);
-}
-
-/* determine the current time and then
- * the elapsed time (between the last time and time now)
- * in milliseconds & update the no. of tokens in the bucket
- */
-static void
-tbf_update_tokens(vifp)
- register struct vif *vifp;
-{
- struct timeval tp;
- register u_long tm;
- register int s = splnet();
- register struct tbf *t = vifp->v_tbf;
-
- GET_TIME(tp);
-
- TV_DELTA(tp, t->tbf_last_pkt_t, tm);
-
- /*
- * This formula is actually
- * "time in seconds" * "bytes/second".
- *
- * (tm / 1000000) * (v_rate_limit * 1000 * (1000/1024) / 8)
- *
- * The (1000/1024) was introduced in add_vif to optimize
- * this divide into a shift.
- */
- t->tbf_n_tok += tm * vifp->v_rate_limit / 1024 / 8;
- t->tbf_last_pkt_t = tp;
-
- if (t->tbf_n_tok > MAX_BKT_SIZE)
- t->tbf_n_tok = MAX_BKT_SIZE;
-
- splx(s);
-}
-
-static int
-priority(vifp, ip)
- register struct vif *vifp;
- register struct ip *ip;
-{
- register int prio;
-
- /* temporary hack; may add general packet classifier some day */
-
- /*
- * The UDP port space is divided up into four priority ranges:
- * [0, 16384) : unclassified - lowest priority
- * [16384, 32768) : audio - highest priority
- * [32768, 49152) : whiteboard - medium priority
- * [49152, 65536) : video - low priority
- */
- if (ip->ip_p == IPPROTO_UDP) {
- struct udphdr *udp = (struct udphdr *)(((char *)ip) + (ip->ip_hl << 2));
- switch (ntohs(udp->uh_dport) & 0xc000) {
- case 0x4000:
- prio = 70;
- break;
- case 0x8000:
- prio = 60;
- break;
- case 0xc000:
- prio = 55;
- break;
- default:
- prio = 50;
- break;
- }
- if (tbfdebug > 1)
- log(LOG_DEBUG, "port %x prio%d\n", ntohs(udp->uh_dport), prio);
- } else {
- prio = 50;
- }
- return prio;
-}
-
-/*
- * End of token bucket filter modifications
- */
-
-int
-ip_rsvp_vif_init(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- int i;
- register int s;
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_init: so_type = %d, pr_protocol = %d\n",
- so->so_type, so->so_proto->pr_protocol);
-
- if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP)
- return EOPNOTSUPP;
-
- /* Check mbuf. */
- if (m == NULL || m->m_len != sizeof(int)) {
- return EINVAL;
- }
- i = *(mtod(m, int *));
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_init: vif = %d rsvp_on = %d\n",i,rsvp_on);
-
- s = splnet();
-
- /* Check vif. */
- if (!legal_vif_num(i)) {
- splx(s);
- return EADDRNOTAVAIL;
- }
-
- /* Check if socket is available. */
- if (viftable[i].v_rsvpd != NULL) {
- splx(s);
- return EADDRINUSE;
- }
-
- viftable[i].v_rsvpd = so;
- /* This may seem silly, but we need to be sure we don't over-increment
- * the RSVP counter, in case something slips up.
- */
- if (!viftable[i].v_rsvp_on) {
- viftable[i].v_rsvp_on = 1;
- rsvp_on++;
- }
-
- splx(s);
- return 0;
-}
-
-int
-ip_rsvp_vif_done(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- int i;
- register int s;
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_done: so_type = %d, pr_protocol = %d\n",
- so->so_type, so->so_proto->pr_protocol);
-
- if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP)
- return EOPNOTSUPP;
-
- /* Check mbuf. */
- if (m == NULL || m->m_len != sizeof(int)) {
- return EINVAL;
- }
- i = *(mtod(m, int *));
-
- s = splnet();
-
- /* Check vif. */
- if (!legal_vif_num(i)) {
- splx(s);
- return EADDRNOTAVAIL;
- }
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_done: v_rsvpd = %p so = %p\n",
- viftable[i].v_rsvpd, so);
-
- viftable[i].v_rsvpd = NULL;
- /* This may seem silly, but we need to be sure we don't over-decrement
- * the RSVP counter, in case something slips up.
- */
- if (viftable[i].v_rsvp_on) {
- viftable[i].v_rsvp_on = 0;
- rsvp_on--;
- }
-
- splx(s);
- return 0;
-}
-
-void
-ip_rsvp_force_done(so)
- struct socket *so;
-{
- int vifi;
- register int s;
-
- /* Don't bother if it is not the right type of socket. */
- if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP)
- return;
-
- s = splnet();
-
- /* The socket may be attached to more than one vif...this
- * is perfectly legal.
- */
- for (vifi = 0; vifi < numvifs; vifi++) {
- if (viftable[vifi].v_rsvpd == so) {
- viftable[vifi].v_rsvpd = NULL;
- /* This may seem silly, but we need to be sure we don't
- * over-decrement the RSVP counter, in case something slips up.
- */
- if (viftable[vifi].v_rsvp_on) {
- viftable[vifi].v_rsvp_on = 0;
- rsvp_on--;
- }
- }
- }
-
- splx(s);
- return;
-}
-
-void
-rsvp_input(m, iphlen)
- struct mbuf *m;
- int iphlen;
-{
- int vifi;
- register struct ip *ip = mtod(m, struct ip *);
- static struct sockaddr_in rsvp_src = { sizeof rsvp_src, AF_INET };
- register int s;
- struct ifnet *ifp;
-
- if (rsvpdebug)
- printf("rsvp_input: rsvp_on %d\n",rsvp_on);
-
- /* Can still get packets with rsvp_on = 0 if there is a local member
- * of the group to which the RSVP packet is addressed. But in this
- * case we want to throw the packet away.
- */
- if (!rsvp_on) {
- m_freem(m);
- return;
- }
-
- /* If the old-style non-vif-associated socket is set, then use
- * it and ignore the new ones.
- */
- if (ip_rsvpd != NULL) {
- if (rsvpdebug)
- printf("rsvp_input: Sending packet up old-style socket\n");
- rip_input(m, iphlen);
- return;
- }
-
- s = splnet();
-
- if (rsvpdebug)
- printf("rsvp_input: check vifs\n");
-
-#ifdef DIAGNOSTIC
- if (!(m->m_flags & M_PKTHDR))
- panic("rsvp_input no hdr");
-#endif
-
- ifp = m->m_pkthdr.rcvif;
- /* Find which vif the packet arrived on. */
- for (vifi = 0; vifi < numvifs; vifi++) {
- if (viftable[vifi].v_ifp == ifp)
- break;
- }
-
- if (vifi == numvifs) {
- /* Can't find vif packet arrived on. Drop packet. */
- if (rsvpdebug)
- printf("rsvp_input: Can't find vif for packet...dropping it.\n");
- m_freem(m);
- splx(s);
- return;
- }
-
- if (rsvpdebug)
- printf("rsvp_input: check socket\n");
-
- if (viftable[vifi].v_rsvpd == NULL) {
- /* drop packet, since there is no specific socket for this
- * interface */
- if (rsvpdebug)
- printf("rsvp_input: No socket defined for vif %d\n",vifi);
- m_freem(m);
- splx(s);
- return;
- }
- rsvp_src.sin_addr = ip->ip_src;
-
- if (rsvpdebug && m)
- printf("rsvp_input: m->m_len = %d, sbspace() = %ld\n",
- m->m_len,sbspace(&(viftable[vifi].v_rsvpd->so_rcv)));
-
- if (socket_send(viftable[vifi].v_rsvpd, m, &rsvp_src) < 0)
- if (rsvpdebug)
- printf("rsvp_input: Failed to append to socket\n");
- else
- if (rsvpdebug)
- printf("rsvp_input: send packet up\n");
-
- splx(s);
-}
-
-#ifdef MROUTE_LKM
-#include <sys/conf.h>
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-MOD_MISC("ip_mroute_mod")
-
-static int
-ip_mroute_mod_handle(struct lkm_table *lkmtp, int cmd)
-{
- int i;
- struct lkm_misc *args = lkmtp->private.lkm_misc;
- int err = 0;
-
- switch(cmd) {
- static int (*old_ip_mrouter_cmd)();
- static int (*old_ip_mrouter_done)();
- static int (*old_ip_mforward)();
- static int (*old_mrt_ioctl)();
- static void (*old_proto4_input)();
- static int (*old_legal_vif_num)();
- extern struct protosw inetsw[];
-
- case LKM_E_LOAD:
- if(lkmexists(lkmtp) || ip_mrtproto)
- return(EEXIST);
- old_ip_mrouter_cmd = ip_mrouter_cmd;
- ip_mrouter_cmd = X_ip_mrouter_cmd;
- old_ip_mrouter_done = ip_mrouter_done;
- ip_mrouter_done = X_ip_mrouter_done;
- old_ip_mforward = ip_mforward;
- ip_mforward = X_ip_mforward;
- old_mrt_ioctl = mrt_ioctl;
- mrt_ioctl = X_mrt_ioctl;
- old_proto4_input = inetsw[ip_protox[ENCAP_PROTO]].pr_input;
- inetsw[ip_protox[ENCAP_PROTO]].pr_input = X_ipip_input;
- old_legal_vif_num = legal_vif_num;
- legal_vif_num = X_legal_vif_num;
- ip_mrtproto = IGMP_DVMRP;
-
- printf("\nIP multicast routing loaded\n");
- break;
-
- case LKM_E_UNLOAD:
- if (ip_mrouter)
- return EINVAL;
-
- ip_mrouter_cmd = old_ip_mrouter_cmd;
- ip_mrouter_done = old_ip_mrouter_done;
- ip_mforward = old_ip_mforward;
- mrt_ioctl = old_mrt_ioctl;
- inetsw[ip_protox[ENCAP_PROTO]].pr_input = old_proto4_input;
- legal_vif_num = old_legal_vif_num;
- ip_mrtproto = 0;
- break;
-
- default:
- err = EINVAL;
- break;
- }
-
- return(err);
-}
-
-int
-ip_mroute_mod(struct lkm_table *lkmtp, int cmd, int ver) {
- DISPATCH(lkmtp, cmd, ver, ip_mroute_mod_handle, ip_mroute_mod_handle,
- nosys);
-}
-
-#endif /* MROUTE_LKM */
-#endif /* MROUTING */
diff --git a/c/src/exec/libnetworking/netinet/ip_mroute.h b/c/src/exec/libnetworking/netinet/ip_mroute.h
deleted file mode 100644
index 5ddd6799d2..0000000000
--- a/c/src/exec/libnetworking/netinet/ip_mroute.h
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright (c) 1989 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)ip_mroute.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IP_MROUTE_H_
-#define _NETINET_IP_MROUTE_H_
-
-/*
- * Definitions for IP multicast forwarding.
- *
- * Written by David Waitzman, BBN Labs, August 1988.
- * Modified by Steve Deering, Stanford, February 1989.
- * Modified by Ajit Thyagarajan, PARC, August 1993.
- * Modified by Ajit Thyagarajan, PARC, August 1994.
- *
- * MROUTING Revision: 3.3.1.3
- */
-
-
-/*
- * Multicast Routing set/getsockopt commands.
- */
-#define MRT_INIT 100 /* initialize forwarder */
-#define MRT_DONE 101 /* shut down forwarder */
-#define MRT_ADD_VIF 102 /* create virtual interface */
-#define MRT_DEL_VIF 103 /* delete virtual interface */
-#define MRT_ADD_MFC 104 /* insert forwarding cache entry */
-#define MRT_DEL_MFC 105 /* delete forwarding cache entry */
-#define MRT_VERSION 106 /* get kernel version number */
-#define MRT_ASSERT 107 /* enable PIM assert processing */
-
-
-#define GET_TIME(t) microtime(&t)
-
-/*
- * Types and macros for handling bitmaps with one bit per virtual interface.
- */
-#define MAXVIFS 32
-typedef u_long vifbitmap_t;
-typedef u_short vifi_t; /* type of a vif index */
-#define ALL_VIFS (vifi_t)-1
-
-#define VIFM_SET(n, m) ((m) |= (1 << (n)))
-#define VIFM_CLR(n, m) ((m) &= ~(1 << (n)))
-#define VIFM_ISSET(n, m) ((m) & (1 << (n)))
-#define VIFM_CLRALL(m) ((m) = 0x00000000)
-#define VIFM_COPY(mfrom, mto) ((mto) = (mfrom))
-#define VIFM_SAME(m1, m2) ((m1) == (m2))
-
-
-/*
- * Argument structure for MRT_ADD_VIF.
- * (MRT_DEL_VIF takes a single vifi_t argument.)
- */
-struct vifctl {
- vifi_t vifc_vifi; /* the index of the vif to be added */
- u_char vifc_flags; /* VIFF_ flags defined below */
- u_char vifc_threshold; /* min ttl required to forward on vif */
- u_int vifc_rate_limit; /* max rate */
- struct in_addr vifc_lcl_addr; /* local interface address */
- struct in_addr vifc_rmt_addr; /* remote address (tunnels only) */
-};
-
-#define VIFF_TUNNEL 0x1 /* vif represents a tunnel end-point */
-#define VIFF_SRCRT 0x2 /* tunnel uses IP source routing */
-
-/*
- * Argument structure for MRT_ADD_MFC and MRT_DEL_MFC
- * (mfcc_tos to be added at a future point)
- */
-struct mfcctl {
- struct in_addr mfcc_origin; /* ip origin of mcasts */
- struct in_addr mfcc_mcastgrp; /* multicast group associated*/
- vifi_t mfcc_parent; /* incoming vif */
- u_char mfcc_ttls[MAXVIFS]; /* forwarding ttls on vifs */
-};
-
-/*
- * The kernel's multicast routing statistics.
- */
-struct mrtstat {
- u_long mrts_mfc_lookups; /* # forw. cache hash table hits */
- u_long mrts_mfc_misses; /* # forw. cache hash table misses */
- u_long mrts_upcalls; /* # calls to mrouted */
- u_long mrts_no_route; /* no route for packet's origin */
- u_long mrts_bad_tunnel; /* malformed tunnel options */
- u_long mrts_cant_tunnel; /* no room for tunnel options */
- u_long mrts_wrong_if; /* arrived on wrong interface */
- u_long mrts_upq_ovflw; /* upcall Q overflow */
- u_long mrts_cache_cleanups; /* # entries with no upcalls */
- u_long mrts_drop_sel; /* pkts dropped selectively */
- u_long mrts_q_overflow; /* pkts dropped - Q overflow */
- u_long mrts_pkt2large; /* pkts dropped - size > BKT SIZE */
- u_long mrts_upq_sockfull; /* upcalls dropped - socket full */
-};
-
-/*
- * Argument structure used by mrouted to get src-grp pkt counts
- */
-struct sioc_sg_req {
- struct in_addr src;
- struct in_addr grp;
- u_long pktcnt;
- u_long bytecnt;
- u_long wrong_if;
-};
-
-/*
- * Argument structure used by mrouted to get vif pkt counts
- */
-struct sioc_vif_req {
- vifi_t vifi; /* vif number */
- u_long icount; /* Input packet count on vif */
- u_long ocount; /* Output packet count on vif */
- u_long ibytes; /* Input byte count on vif */
- u_long obytes; /* Output byte count on vif */
-};
-
-
-/*
- * The kernel's virtual-interface structure.
- */
-struct vif {
- u_char v_flags; /* VIFF_ flags defined above */
- u_char v_threshold; /* min ttl required to forward on vif*/
- u_int v_rate_limit; /* max rate */
- struct tbf *v_tbf; /* token bucket structure at intf. */
- struct in_addr v_lcl_addr; /* local interface address */
- struct in_addr v_rmt_addr; /* remote address (tunnels only) */
- struct ifnet *v_ifp; /* pointer to interface */
- u_long v_pkt_in; /* # pkts in on interface */
- u_long v_pkt_out; /* # pkts out on interface */
- u_long v_bytes_in; /* # bytes in on interface */
- u_long v_bytes_out; /* # bytes out on interface */
- struct route v_route; /* cached route if this is a tunnel */
- u_int v_rsvp_on; /* RSVP listening on this vif */
- struct socket *v_rsvpd; /* RSVP daemon socket */
-};
-
-/*
- * The kernel's multicast forwarding cache entry structure
- * (A field for the type of service (mfc_tos) is to be added
- * at a future point)
- */
-struct mfc {
- struct in_addr mfc_origin; /* IP origin of mcasts */
- struct in_addr mfc_mcastgrp; /* multicast group associated*/
- vifi_t mfc_parent; /* incoming vif */
- u_char mfc_ttls[MAXVIFS]; /* forwarding ttls on vifs */
- u_long mfc_pkt_cnt; /* pkt count for src-grp */
- u_long mfc_byte_cnt; /* byte count for src-grp */
- u_long mfc_wrong_if; /* wrong if for src-grp */
- int mfc_expire; /* time to clean entry up */
- struct timeval mfc_last_assert; /* last time I sent an assert*/
-};
-
-/*
- * Struct used to communicate from kernel to multicast router
- * note the convenient similarity to an IP packet
- */
-struct igmpmsg {
- u_long unused1;
- u_long unused2;
- u_char im_msgtype; /* what type of message */
-#define IGMPMSG_NOCACHE 1
-#define IGMPMSG_WRONGVIF 2
- u_char im_mbz; /* must be zero */
- u_char im_vif; /* vif rec'd on */
- u_char unused3;
- struct in_addr im_src, im_dst;
-};
-
-/*
- * Argument structure used for pkt info. while upcall is made
- */
-struct rtdetq {
- struct mbuf *m; /* A copy of the packet */
- struct ifnet *ifp; /* Interface pkt came in on */
- vifi_t xmt_vif; /* Saved copy of imo_multicast_vif */
-#ifdef UPCALL_TIMING
- struct timeval t; /* Timestamp */
-#endif /* UPCALL_TIMING */
-};
-
-#define MFCTBLSIZ 256
-#if (MFCTBLSIZ & (MFCTBLSIZ - 1)) == 0 /* from sys:route.h */
-#define MFCHASHMOD(h) ((h) & (MFCTBLSIZ - 1))
-#else
-#define MFCHASHMOD(h) ((h) % MFCTBLSIZ)
-#endif
-
-#define MAX_UPQ 4 /* max. no of pkts in upcall Q */
-
-/*
- * Token Bucket filter code
- */
-#define MAX_BKT_SIZE 10000 /* 10K bytes size */
-#define MAXQSIZE 10 /* max # of pkts in queue */
-
-/*
- * the token bucket filter at each vif
- */
-struct tbf
-{
- struct timeval tbf_last_pkt_t; /* arr. time of last pkt */
- u_long tbf_n_tok; /* no of tokens in bucket */
- u_long tbf_q_len; /* length of queue at this vif */
- u_long tbf_max_q_len; /* max. queue length */
- struct mbuf *tbf_q; /* Packet queue */
- struct mbuf *tbf_t; /* tail-insertion pointer */
-};
-
-#ifdef KERNEL
-
-extern int (*ip_mrouter_set) __P((int, struct socket *, struct mbuf *));
-extern int (*ip_mrouter_get) __P((int, struct socket *, struct mbuf **));
-extern int (*ip_mrouter_done) __P((void));
-#ifdef MROUTING
-extern int (*mrt_ioctl) __P((int, caddr_t));
-#else
-extern int (*mrt_ioctl) __P((int, caddr_t, struct proc *));
-#endif
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_IP_MROUTE_H_ */
diff --git a/c/src/exec/libnetworking/netinet/ip_output.c b/c/src/exec/libnetworking/netinet/ip_output.c
deleted file mode 100644
index 810f6c7479..0000000000
--- a/c/src/exec/libnetworking/netinet/ip_output.c
+++ /dev/null
@@ -1,1307 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 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.
- *
- * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
- * $Id$
- */
-
-#define _IP_VHL
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/errno.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-
-#ifdef vax
-#include <machine/mtpr.h>
-#endif
-#include <machine/in_cksum.h>
-
-#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1
-#undef COMPAT_IPFW
-#define COMPAT_IPFW 1
-#else
-#undef COMPAT_IPFW
-#endif
-
-u_short ip_id;
-
-static struct mbuf *ip_insertoptions __P((struct mbuf *, struct mbuf *, int *));
-static void ip_mloopback
- __P((struct ifnet *, struct mbuf *, struct sockaddr_in *, int));
-static int ip_getmoptions
- __P((int, struct ip_moptions *, struct mbuf **));
-static int ip_optcopy __P((struct ip *, struct ip *));
-static int ip_pcbopts __P((struct mbuf **, struct mbuf *));
-static int ip_setmoptions
- __P((int, struct ip_moptions **, struct mbuf *));
-
-extern struct protosw inetsw[];
-
-/*
- * IP output. The packet in mbuf chain m contains a skeletal IP
- * header (with len, off, ttl, proto, tos, src, dst).
- * The mbuf chain containing the packet will be freed.
- * The mbuf opt, if present, will not be freed.
- */
-int
-ip_output(m0, opt, ro, flags, imo)
- struct mbuf *m0;
- struct mbuf *opt;
- struct route *ro;
- int flags;
- struct ip_moptions *imo;
-{
- struct ip *ip, *mhip;
- struct ifnet *ifp;
- struct mbuf *m = m0;
- int hlen = sizeof (struct ip);
- int len, off, error = 0;
- struct sockaddr_in *dst;
- struct in_ifaddr *ia;
- int isbroadcast;
-
-#ifdef DIAGNOSTIC
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("ip_output no HDR");
- if (!ro)
- panic("ip_output no route, proto = %d",
- mtod(m, struct ip *)->ip_p);
-#endif
- if (opt) {
- m = ip_insertoptions(m, opt, &len);
- hlen = len;
- }
- ip = mtod(m, struct ip *);
- /*
- * Fill in IP header.
- */
- if ((flags & (IP_FORWARDING|IP_RAWOUTPUT)) == 0) {
- ip->ip_vhl = IP_MAKE_VHL(IPVERSION, hlen >> 2);
- ip->ip_off &= IP_DF;
- ip->ip_id = htons(ip_id++);
- ipstat.ips_localout++;
- } else {
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
- }
-
- dst = (struct sockaddr_in *)&ro->ro_dst;
- /*
- * If there is a cached route,
- * check that it is to the same destination
- * and is still up. If not, free it and try again.
- */
- if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 ||
- dst->sin_addr.s_addr != ip->ip_dst.s_addr)) {
- RTFREE(ro->ro_rt);
- ro->ro_rt = (struct rtentry *)0;
- }
- if (ro->ro_rt == 0) {
- dst->sin_family = AF_INET;
- dst->sin_len = sizeof(*dst);
- dst->sin_addr = ip->ip_dst;
- }
- /*
- * If routing to interface only,
- * short circuit routing lookup.
- */
-#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
-#define sintosa(sin) ((struct sockaddr *)(sin))
- if (flags & IP_ROUTETOIF) {
- if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == 0 &&
- (ia = ifatoia(ifa_ifwithnet(sintosa(dst)))) == 0) {
- ipstat.ips_noroute++;
- error = ENETUNREACH;
- goto bad;
- }
- ifp = ia->ia_ifp;
- ip->ip_ttl = 1;
- isbroadcast = in_broadcast(dst->sin_addr, ifp);
- } else {
- /*
- * If this is the case, we probably don't want to allocate
- * a protocol-cloned route since we didn't get one from the
- * ULP. This lets TCP do its thing, while not burdening
- * forwarding or ICMP with the overhead of cloning a route.
- * Of course, we still want to do any cloning requested by
- * the link layer, as this is probably required in all cases
- * for correct operation (as it is for ARP).
- */
- if (ro->ro_rt == 0)
- rtalloc_ign(ro, RTF_PRCLONING);
- if (ro->ro_rt == 0) {
- ipstat.ips_noroute++;
- error = EHOSTUNREACH;
- goto bad;
- }
- ia = ifatoia(ro->ro_rt->rt_ifa);
- ifp = ro->ro_rt->rt_ifp;
- ro->ro_rt->rt_use++;
- if (ro->ro_rt->rt_flags & RTF_GATEWAY)
- dst = (struct sockaddr_in *)ro->ro_rt->rt_gateway;
- if (ro->ro_rt->rt_flags & RTF_HOST)
- isbroadcast = (ro->ro_rt->rt_flags & RTF_BROADCAST);
- else
- isbroadcast = in_broadcast(dst->sin_addr, ifp);
- }
- if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- struct in_multi *inm;
-
- m->m_flags |= M_MCAST;
- /*
- * IP destination address is multicast. Make sure "dst"
- * still points to the address in "ro". (It may have been
- * changed to point to a gateway address, above.)
- */
- dst = (struct sockaddr_in *)&ro->ro_dst;
- /*
- * See if the caller provided any multicast options
- */
- if (imo != NULL) {
- ip->ip_ttl = imo->imo_multicast_ttl;
- if (imo->imo_multicast_ifp != NULL)
- ifp = imo->imo_multicast_ifp;
- if (imo->imo_multicast_vif != -1)
- ip->ip_src.s_addr =
- ip_mcast_src(imo->imo_multicast_vif);
- } else
- ip->ip_ttl = IP_DEFAULT_MULTICAST_TTL;
- /*
- * Confirm that the outgoing interface supports multicast.
- */
- if ((imo == NULL) || (imo->imo_multicast_vif == -1)) {
- if ((ifp->if_flags & IFF_MULTICAST) == 0) {
- ipstat.ips_noroute++;
- error = ENETUNREACH;
- goto bad;
- }
- }
- /*
- * If source address not specified yet, use address
- * of outgoing interface.
- */
- if (ip->ip_src.s_addr == INADDR_ANY) {
- register struct in_ifaddr *ia;
-
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if (ia->ia_ifp == ifp) {
- ip->ip_src = IA_SIN(ia)->sin_addr;
- break;
- }
- }
-
- IN_LOOKUP_MULTI(ip->ip_dst, ifp, inm);
- if (inm != NULL &&
- (imo == NULL || imo->imo_multicast_loop)) {
- /*
- * If we belong to the destination multicast group
- * on the outgoing interface, and the caller did not
- * forbid loopback, loop back a copy.
- */
- ip_mloopback(ifp, m, dst, hlen);
- }
- else {
- /*
- * If we are acting as a multicast router, perform
- * multicast forwarding as if the packet had just
- * arrived on the interface to which we are about
- * to send. The multicast forwarding function
- * recursively calls this function, using the
- * IP_FORWARDING flag to prevent infinite recursion.
- *
- * Multicasts that are looped back by ip_mloopback(),
- * above, will be forwarded by the ip_input() routine,
- * if necessary.
- */
- if (ip_mrouter && (flags & IP_FORWARDING) == 0) {
- /*
- * Check if rsvp daemon is running. If not, don't
- * set ip_moptions. This ensures that the packet
- * is multicast and not just sent down one link
- * as prescribed by rsvpd.
- */
- if (!rsvp_on)
- imo = NULL;
- if (ip_mforward(ip, ifp, m, imo) != 0) {
- m_freem(m);
- goto done;
- }
- }
- }
-
- /*
- * Multicasts with a time-to-live of zero may be looped-
- * back, above, but must not be transmitted on a network.
- * Also, multicasts addressed to the loopback interface
- * are not sent -- the above call to ip_mloopback() will
- * loop back a copy if this host actually belongs to the
- * destination group on the loopback interface.
- */
- if (ip->ip_ttl == 0 || ifp->if_flags & IFF_LOOPBACK) {
- m_freem(m);
- goto done;
- }
-
- goto sendit;
- }
-#ifndef notdef
- /*
- * If source address not specified yet, use address
- * of outgoing interface.
- */
- if (ip->ip_src.s_addr == INADDR_ANY)
- ip->ip_src = IA_SIN(ia)->sin_addr;
-#endif
- /*
- * Verify that we have any chance at all of being able to queue
- * the packet or packet fragments
- */
- if ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >=
- ifp->if_snd.ifq_maxlen) {
- error = ENOBUFS;
- goto bad;
- }
-
- /*
- * Look for broadcast address and
- * and verify user is allowed to send
- * such a packet.
- */
- if (isbroadcast) {
- if ((ifp->if_flags & IFF_BROADCAST) == 0) {
- error = EADDRNOTAVAIL;
- goto bad;
- }
- if ((flags & IP_ALLOWBROADCAST) == 0) {
- error = EACCES;
- goto bad;
- }
- /* don't allow broadcast messages to be fragmented */
- if ((u_short)ip->ip_len > ifp->if_mtu) {
- error = EMSGSIZE;
- goto bad;
- }
- m->m_flags |= M_BCAST;
- } else {
- m->m_flags &= ~M_BCAST;
- }
-
-sendit:
- /*
- * IpHack's section.
- * - Xlate: translate packet's addr/port (NAT).
- * - Firewall: deny/allow/etc.
- * - Wrap: fake packet's addr/port <unimpl.>
- * - Encapsulate: put it in another IP and send out. <unimp.>
- */
-
-#ifdef COMPAT_IPFW
- if (ip_nat_ptr && !(*ip_nat_ptr)(&ip, &m, ifp, IP_NAT_OUT)) {
- error = EACCES;
- goto done;
- }
-
- /*
- * Check with the firewall...
- */
- if (ip_fw_chk_ptr) {
-#ifdef IPDIVERT
- ip_divert_port = (*ip_fw_chk_ptr)(&ip,
- hlen, ifp, ip_divert_ignore, &m);
- ip_divert_ignore = 0;
- if (ip_divert_port) { /* Divert packet */
- (*inetsw[ip_protox[IPPROTO_DIVERT]].pr_input)(m, 0);
- goto done;
- }
-#else
- /* If ipfw says divert, we have to just drop packet */
- if ((*ip_fw_chk_ptr)(&ip, hlen, ifp, 0, &m)) {
- m_freem(m);
- goto done;
- }
-#endif
- if (!m) {
- error = EACCES;
- goto done;
- }
- }
-#endif /* COMPAT_IPFW */
-
- /*
- * If small enough for interface, can just send directly.
- */
- if ((u_short)ip->ip_len <= ifp->if_mtu) {
- ip->ip_len = htons((u_short)ip->ip_len);
- ip->ip_off = htons((u_short)ip->ip_off);
- ip->ip_sum = 0;
- if (ip->ip_vhl == IP_VHL_BORING) {
- ip->ip_sum = in_cksum_hdr(ip);
- } else {
- ip->ip_sum = in_cksum(m, hlen);
- }
- error = (*ifp->if_output)(ifp, m,
- (struct sockaddr *)dst, ro->ro_rt);
- goto done;
- }
- /*
- * Too large for interface; fragment if possible.
- * Must be able to put at least 8 bytes per fragment.
- */
- if (ip->ip_off & IP_DF) {
- error = EMSGSIZE;
- /*
- * This case can happen if the user changed the MTU
- * of an interface after enabling IP on it. Because
- * most netifs don't keep track of routes pointing to
- * them, there is no way for one to update all its
- * routes when the MTU is changed.
- */
- if ((ro->ro_rt->rt_flags & (RTF_UP | RTF_HOST))
- && !(ro->ro_rt->rt_rmx.rmx_locks & RTV_MTU)
- && (ro->ro_rt->rt_rmx.rmx_mtu > ifp->if_mtu)) {
- ro->ro_rt->rt_rmx.rmx_mtu = ifp->if_mtu;
- }
- ipstat.ips_cantfrag++;
- goto bad;
- }
- len = (ifp->if_mtu - hlen) &~ 7;
- if (len < 8) {
- error = EMSGSIZE;
- goto bad;
- }
-
- {
- int mhlen, firstlen = len;
- struct mbuf **mnext = &m->m_nextpkt;
-
- /*
- * Loop through length of segment after first fragment,
- * make new header and copy data of each part and link onto chain.
- */
- m0 = m;
- mhlen = sizeof (struct ip);
- for (off = hlen + len; off < (u_short)ip->ip_len; off += len) {
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == 0) {
- error = ENOBUFS;
- ipstat.ips_odropped++;
- goto sendorfree;
- }
- m->m_data += max_linkhdr;
- mhip = mtod(m, struct ip *);
- *mhip = *ip;
- if (hlen > sizeof (struct ip)) {
- mhlen = ip_optcopy(ip, mhip) + sizeof (struct ip);
- mhip->ip_vhl = IP_MAKE_VHL(IPVERSION, mhlen >> 2);
- }
- m->m_len = mhlen;
- mhip->ip_off = ((off - hlen) >> 3) + (ip->ip_off & ~IP_MF);
- if (ip->ip_off & IP_MF)
- mhip->ip_off |= IP_MF;
- if (off + len >= (u_short)ip->ip_len)
- len = (u_short)ip->ip_len - off;
- else
- mhip->ip_off |= IP_MF;
- mhip->ip_len = htons((u_short)(len + mhlen));
- m->m_next = m_copy(m0, off, len);
- if (m->m_next == 0) {
- (void) m_free(m);
- error = ENOBUFS; /* ??? */
- ipstat.ips_odropped++;
- goto sendorfree;
- }
- m->m_pkthdr.len = mhlen + len;
- m->m_pkthdr.rcvif = (struct ifnet *)0;
- mhip->ip_off = htons((u_short)mhip->ip_off);
- mhip->ip_sum = 0;
- if (mhip->ip_vhl == IP_VHL_BORING) {
- mhip->ip_sum = in_cksum_hdr(mhip);
- } else {
- mhip->ip_sum = in_cksum(m, mhlen);
- }
- *mnext = m;
- mnext = &m->m_nextpkt;
- ipstat.ips_ofragments++;
- }
- /*
- * Update first fragment by trimming what's been copied out
- * and updating header, then send each fragment (in order).
- */
- m = m0;
- m_adj(m, hlen + firstlen - (u_short)ip->ip_len);
- m->m_pkthdr.len = hlen + firstlen;
- ip->ip_len = htons((u_short)m->m_pkthdr.len);
- ip->ip_off = htons((u_short)(ip->ip_off | IP_MF));
- ip->ip_sum = 0;
- if (ip->ip_vhl == IP_VHL_BORING) {
- ip->ip_sum = in_cksum_hdr(ip);
- } else {
- ip->ip_sum = in_cksum(m, hlen);
- }
-sendorfree:
- for (m = m0; m; m = m0) {
- m0 = m->m_nextpkt;
- m->m_nextpkt = 0;
- if (error == 0)
- error = (*ifp->if_output)(ifp, m,
- (struct sockaddr *)dst, ro->ro_rt);
- else
- m_freem(m);
- }
-
- if (error == 0)
- ipstat.ips_fragmented++;
- }
-done:
- return (error);
-bad:
- m_freem(m0);
- goto done;
-}
-
-/*
- * Insert IP options into preformed packet.
- * Adjust IP destination as required for IP source routing,
- * as indicated by a non-zero in_addr at the start of the options.
- *
- * XXX This routine assumes that the packet has no options in place.
- */
-static struct mbuf *
-ip_insertoptions(m, opt, phlen)
- register struct mbuf *m;
- struct mbuf *opt;
- int *phlen;
-{
- register struct ipoption *p = mtod(opt, struct ipoption *);
- struct mbuf *n;
- register struct ip *ip = mtod(m, struct ip *);
- unsigned optlen;
-
- optlen = opt->m_len - sizeof(p->ipopt_dst);
- if (optlen + (u_short)ip->ip_len > IP_MAXPACKET)
- return (m); /* XXX should fail */
- if (p->ipopt_dst.s_addr)
- ip->ip_dst = p->ipopt_dst;
- if (m->m_flags & M_EXT || m->m_data - optlen < m->m_pktdat) {
- MGETHDR(n, M_DONTWAIT, MT_HEADER);
- if (n == 0)
- return (m);
- n->m_pkthdr.len = m->m_pkthdr.len + optlen;
- m->m_len -= sizeof(struct ip);
- m->m_data += sizeof(struct ip);
- n->m_next = m;
- m = n;
- m->m_len = optlen + sizeof(struct ip);
- m->m_data += max_linkhdr;
- (void)memcpy(mtod(m, void *), ip, sizeof(struct ip));
- } else {
- m->m_data -= optlen;
- m->m_len += optlen;
- m->m_pkthdr.len += optlen;
- ovbcopy((caddr_t)ip, mtod(m, caddr_t), sizeof(struct ip));
- }
- ip = mtod(m, struct ip *);
- bcopy(p->ipopt_list, ip + 1, optlen);
- *phlen = sizeof(struct ip) + optlen;
- ip->ip_vhl = IP_MAKE_VHL(IPVERSION, *phlen >> 2);
- ip->ip_len += optlen;
- return (m);
-}
-
-/*
- * Copy options from ip to jp,
- * omitting those not copied during fragmentation.
- */
-static int
-ip_optcopy(ip, jp)
- struct ip *ip, *jp;
-{
- register u_char *cp, *dp;
- int opt, optlen, cnt;
-
- cp = (u_char *)(ip + 1);
- dp = (u_char *)(jp + 1);
- cnt = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof (struct ip);
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[0];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP) {
- /* Preserve for IP mcast tunnel's LSRR alignment. */
- *dp++ = IPOPT_NOP;
- optlen = 1;
- continue;
- } else
- optlen = cp[IPOPT_OLEN];
- /* bogus lengths should have been caught by ip_dooptions */
- if (optlen > cnt)
- optlen = cnt;
- if (IPOPT_COPIED(opt)) {
- bcopy(cp, dp, optlen);
- dp += optlen;
- }
- }
- for (optlen = dp - (u_char *)(jp+1); optlen & 0x3; optlen++)
- *dp++ = IPOPT_EOL;
- return (optlen);
-}
-
-/*
- * IP socket option processing.
- */
-int
-ip_ctloutput(op, so, level, optname, mp)
- int op;
- struct socket *so;
- int level, optname;
- struct mbuf **mp;
-{
- register struct inpcb *inp = sotoinpcb(so);
- register struct mbuf *m = *mp;
- register int optval = 0;
- int error = 0;
-
- if (level != IPPROTO_IP) {
- error = EINVAL;
- if (op == PRCO_SETOPT && *mp)
- (void) m_free(*mp);
- } else switch (op) {
-
- case PRCO_SETOPT:
- switch (optname) {
- case IP_OPTIONS:
-#ifdef notyet
- case IP_RETOPTS:
- return (ip_pcbopts(optname, &inp->inp_options, m));
-#else
- return (ip_pcbopts(&inp->inp_options, m));
-#endif
-
- case IP_TOS:
- case IP_TTL:
- case IP_RECVOPTS:
- case IP_RECVRETOPTS:
- case IP_RECVDSTADDR:
- case IP_RECVIF:
- if (m == 0 || m->m_len != sizeof(int))
- error = EINVAL;
- else {
- optval = *mtod(m, int *);
- switch (optname) {
-
- case IP_TOS:
- inp->inp_ip_tos = optval;
- break;
-
- case IP_TTL:
- inp->inp_ip_ttl = optval;
- break;
-#define OPTSET(bit) \
- if (optval) \
- inp->inp_flags |= bit; \
- else \
- inp->inp_flags &= ~bit;
-
- case IP_RECVOPTS:
- OPTSET(INP_RECVOPTS);
- break;
-
- case IP_RECVRETOPTS:
- OPTSET(INP_RECVRETOPTS);
- break;
-
- case IP_RECVDSTADDR:
- OPTSET(INP_RECVDSTADDR);
- break;
-
- case IP_RECVIF:
- OPTSET(INP_RECVIF);
- break;
- }
- }
- break;
-#undef OPTSET
-
- case IP_MULTICAST_IF:
- case IP_MULTICAST_VIF:
- case IP_MULTICAST_TTL:
- case IP_MULTICAST_LOOP:
- case IP_ADD_MEMBERSHIP:
- case IP_DROP_MEMBERSHIP:
- error = ip_setmoptions(optname, &inp->inp_moptions, m);
- break;
-
- case IP_PORTRANGE:
- if (m == 0 || m->m_len != sizeof(int))
- error = EINVAL;
- else {
- optval = *mtod(m, int *);
-
- switch (optval) {
-
- case IP_PORTRANGE_DEFAULT:
- inp->inp_flags &= ~(INP_LOWPORT);
- inp->inp_flags &= ~(INP_HIGHPORT);
- break;
-
- case IP_PORTRANGE_HIGH:
- inp->inp_flags &= ~(INP_LOWPORT);
- inp->inp_flags |= INP_HIGHPORT;
- break;
-
- case IP_PORTRANGE_LOW:
- inp->inp_flags &= ~(INP_HIGHPORT);
- inp->inp_flags |= INP_LOWPORT;
- break;
-
- default:
- error = EINVAL;
- break;
- }
- }
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- if (m)
- (void)m_free(m);
- break;
-
- case PRCO_GETOPT:
- switch (optname) {
- case IP_OPTIONS:
- case IP_RETOPTS:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- if (inp->inp_options) {
- m->m_len = inp->inp_options->m_len;
- bcopy(mtod(inp->inp_options, void *),
- mtod(m, void *), m->m_len);
- } else
- m->m_len = 0;
- break;
-
- case IP_TOS:
- case IP_TTL:
- case IP_RECVOPTS:
- case IP_RECVRETOPTS:
- case IP_RECVDSTADDR:
- case IP_RECVIF:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof(int);
- switch (optname) {
-
- case IP_TOS:
- optval = inp->inp_ip_tos;
- break;
-
- case IP_TTL:
- optval = inp->inp_ip_ttl;
- break;
-
-#define OPTBIT(bit) (inp->inp_flags & bit ? 1 : 0)
-
- case IP_RECVOPTS:
- optval = OPTBIT(INP_RECVOPTS);
- break;
-
- case IP_RECVRETOPTS:
- optval = OPTBIT(INP_RECVRETOPTS);
- break;
-
- case IP_RECVDSTADDR:
- optval = OPTBIT(INP_RECVDSTADDR);
- break;
-
- case IP_RECVIF:
- optval = OPTBIT(INP_RECVIF);
- break;
- }
- *mtod(m, int *) = optval;
- break;
-
- case IP_MULTICAST_IF:
- case IP_MULTICAST_VIF:
- case IP_MULTICAST_TTL:
- case IP_MULTICAST_LOOP:
- case IP_ADD_MEMBERSHIP:
- case IP_DROP_MEMBERSHIP:
- error = ip_getmoptions(optname, inp->inp_moptions, mp);
- break;
-
- case IP_PORTRANGE:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof(int);
-
- if (inp->inp_flags & INP_HIGHPORT)
- optval = IP_PORTRANGE_HIGH;
- else if (inp->inp_flags & INP_LOWPORT)
- optval = IP_PORTRANGE_LOW;
- else
- optval = 0;
-
- *mtod(m, int *) = optval;
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- break;
- }
- return (error);
-}
-
-/*
- * Set up IP options in pcb for insertion in output packets.
- * Store in mbuf with pointer in pcbopt, adding pseudo-option
- * with destination address if source routed.
- */
-static int
-#ifdef notyet
-ip_pcbopts(optname, pcbopt, m)
- int optname;
-#else
-ip_pcbopts(pcbopt, m)
-#endif
- struct mbuf **pcbopt;
- register struct mbuf *m;
-{
- register int cnt, optlen;
- register u_char *cp;
- u_char opt;
-
- /* turn off any old options */
- if (*pcbopt)
- (void)m_free(*pcbopt);
- *pcbopt = 0;
- if (m == (struct mbuf *)0 || m->m_len == 0) {
- /*
- * Only turning off any previous options.
- */
- if (m)
- (void)m_free(m);
- return (0);
- }
-
-#ifndef vax
- if (m->m_len % sizeof(long))
- goto bad;
-#endif
- /*
- * IP first-hop destination address will be stored before
- * actual options; move other options back
- * and clear it when none present.
- */
- if (m->m_data + m->m_len + sizeof(struct in_addr) >= &m->m_dat[MLEN])
- goto bad;
- cnt = m->m_len;
- m->m_len += sizeof(struct in_addr);
- cp = mtod(m, u_char *) + sizeof(struct in_addr);
- ovbcopy(mtod(m, caddr_t), (caddr_t)cp, (unsigned)cnt);
- bzero(mtod(m, caddr_t), sizeof(struct in_addr));
-
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[IPOPT_OLEN];
- if (optlen <= IPOPT_OLEN || optlen > cnt)
- goto bad;
- }
- switch (opt) {
-
- default:
- break;
-
- case IPOPT_LSRR:
- case IPOPT_SSRR:
- /*
- * user process specifies route as:
- * ->A->B->C->D
- * D must be our final destination (but we can't
- * check that since we may not have connected yet).
- * A is first hop destination, which doesn't appear in
- * actual IP option, but is stored before the options.
- */
- if (optlen < IPOPT_MINOFF - 1 + sizeof(struct in_addr))
- goto bad;
- m->m_len -= sizeof(struct in_addr);
- cnt -= sizeof(struct in_addr);
- optlen -= sizeof(struct in_addr);
- cp[IPOPT_OLEN] = optlen;
- /*
- * Move first hop before start of options.
- */
- bcopy((caddr_t)&cp[IPOPT_OFFSET+1], mtod(m, caddr_t),
- sizeof(struct in_addr));
- /*
- * Then copy rest of options back
- * to close up the deleted entry.
- */
- ovbcopy((caddr_t)(&cp[IPOPT_OFFSET+1] +
- sizeof(struct in_addr)),
- (caddr_t)&cp[IPOPT_OFFSET+1],
- (unsigned)cnt + sizeof(struct in_addr));
- break;
- }
- }
- if (m->m_len > MAX_IPOPTLEN + sizeof(struct in_addr))
- goto bad;
- *pcbopt = m;
- return (0);
-
-bad:
- (void)m_free(m);
- return (EINVAL);
-}
-
-/*
- * Set the IP multicast options in response to user setsockopt().
- */
-static int
-ip_setmoptions(optname, imop, m)
- int optname;
- struct ip_moptions **imop;
- struct mbuf *m;
-{
- register int error = 0;
- u_char loop;
- register int i;
- struct in_addr addr;
- register struct ip_mreq *mreq;
- register struct ifnet *ifp;
- register struct ip_moptions *imo = *imop;
- struct route ro;
- register struct sockaddr_in *dst;
- int s;
-
- if (imo == NULL) {
- /*
- * No multicast option buffer attached to the pcb;
- * allocate one and initialize to default values.
- */
- imo = (struct ip_moptions*)malloc(sizeof(*imo), M_IPMOPTS,
- M_WAITOK);
-
- if (imo == NULL)
- return (ENOBUFS);
- *imop = imo;
- imo->imo_multicast_ifp = NULL;
- imo->imo_multicast_vif = -1;
- imo->imo_multicast_ttl = IP_DEFAULT_MULTICAST_TTL;
- imo->imo_multicast_loop = IP_DEFAULT_MULTICAST_LOOP;
- imo->imo_num_memberships = 0;
- }
-
- switch (optname) {
- /* store an index number for the vif you wanna use in the send */
- case IP_MULTICAST_VIF:
- if (!legal_vif_num) {
- error = EOPNOTSUPP;
- break;
- }
- if (m == NULL || m->m_len != sizeof(int)) {
- error = EINVAL;
- break;
- }
- i = *(mtod(m, int *));
- if (!legal_vif_num(i) && (i != -1)) {
- error = EINVAL;
- break;
- }
- imo->imo_multicast_vif = i;
- break;
-
- case IP_MULTICAST_IF:
- /*
- * Select the interface for outgoing multicast packets.
- */
- if (m == NULL || m->m_len != sizeof(struct in_addr)) {
- error = EINVAL;
- break;
- }
- addr = *(mtod(m, struct in_addr *));
- /*
- * INADDR_ANY is used to remove a previous selection.
- * When no interface is selected, a default one is
- * chosen every time a multicast packet is sent.
- */
- if (addr.s_addr == INADDR_ANY) {
- imo->imo_multicast_ifp = NULL;
- break;
- }
- /*
- * The selected interface is identified by its local
- * IP address. Find the interface and confirm that
- * it supports multicasting.
- */
- s = splimp();
- INADDR_TO_IFP(addr, ifp);
- if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) {
- splx(s);
- error = EADDRNOTAVAIL;
- break;
- }
- imo->imo_multicast_ifp = ifp;
- splx(s);
- break;
-
- case IP_MULTICAST_TTL:
- /*
- * Set the IP time-to-live for outgoing multicast packets.
- */
- if (m == NULL || m->m_len != 1) {
- error = EINVAL;
- break;
- }
- imo->imo_multicast_ttl = *(mtod(m, u_char *));
- break;
-
- case IP_MULTICAST_LOOP:
- /*
- * Set the loopback flag for outgoing multicast packets.
- * Must be zero or one.
- */
- if (m == NULL || m->m_len != 1 ||
- (loop = *(mtod(m, u_char *))) > 1) {
- error = EINVAL;
- break;
- }
- imo->imo_multicast_loop = loop;
- break;
-
- case IP_ADD_MEMBERSHIP:
- /*
- * Add a multicast group membership.
- * Group must be a valid IP multicast address.
- */
- if (m == NULL || m->m_len != sizeof(struct ip_mreq)) {
- error = EINVAL;
- break;
- }
- mreq = mtod(m, struct ip_mreq *);
- if (!IN_MULTICAST(ntohl(mreq->imr_multiaddr.s_addr))) {
- error = EINVAL;
- break;
- }
- s = splimp();
- /*
- * If no interface address was provided, use the interface of
- * the route to the given multicast address.
- */
- if (mreq->imr_interface.s_addr == INADDR_ANY) {
- bzero((caddr_t)&ro, sizeof(ro));
- dst = (struct sockaddr_in *)&ro.ro_dst;
- dst->sin_len = sizeof(*dst);
- dst->sin_family = AF_INET;
- dst->sin_addr = mreq->imr_multiaddr;
- rtalloc(&ro);
- if (ro.ro_rt == NULL) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- ifp = ro.ro_rt->rt_ifp;
- rtfree(ro.ro_rt);
- }
- else {
- INADDR_TO_IFP(mreq->imr_interface, ifp);
- }
-
- /*
- * See if we found an interface, and confirm that it
- * supports multicast.
- */
- if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- /*
- * See if the membership already exists or if all the
- * membership slots are full.
- */
- for (i = 0; i < imo->imo_num_memberships; ++i) {
- if (imo->imo_membership[i]->inm_ifp == ifp &&
- imo->imo_membership[i]->inm_addr.s_addr
- == mreq->imr_multiaddr.s_addr)
- break;
- }
- if (i < imo->imo_num_memberships) {
- error = EADDRINUSE;
- splx(s);
- break;
- }
- if (i == IP_MAX_MEMBERSHIPS) {
- error = ETOOMANYREFS;
- splx(s);
- break;
- }
- /*
- * Everything looks good; add a new record to the multicast
- * address list for the given interface.
- */
- if ((imo->imo_membership[i] =
- in_addmulti(&mreq->imr_multiaddr, ifp)) == NULL) {
- error = ENOBUFS;
- splx(s);
- break;
- }
- ++imo->imo_num_memberships;
- splx(s);
- break;
-
- case IP_DROP_MEMBERSHIP:
- /*
- * Drop a multicast group membership.
- * Group must be a valid IP multicast address.
- */
- if (m == NULL || m->m_len != sizeof(struct ip_mreq)) {
- error = EINVAL;
- break;
- }
- mreq = mtod(m, struct ip_mreq *);
- if (!IN_MULTICAST(ntohl(mreq->imr_multiaddr.s_addr))) {
- error = EINVAL;
- break;
- }
-
- s = splimp();
- /*
- * If an interface address was specified, get a pointer
- * to its ifnet structure.
- */
- if (mreq->imr_interface.s_addr == INADDR_ANY)
- ifp = NULL;
- else {
- INADDR_TO_IFP(mreq->imr_interface, ifp);
- if (ifp == NULL) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- }
- /*
- * Find the membership in the membership array.
- */
- for (i = 0; i < imo->imo_num_memberships; ++i) {
- if ((ifp == NULL ||
- imo->imo_membership[i]->inm_ifp == ifp) &&
- imo->imo_membership[i]->inm_addr.s_addr ==
- mreq->imr_multiaddr.s_addr)
- break;
- }
- if (i == imo->imo_num_memberships) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- /*
- * Give up the multicast address record to which the
- * membership points.
- */
- in_delmulti(imo->imo_membership[i]);
- /*
- * Remove the gap in the membership array.
- */
- for (++i; i < imo->imo_num_memberships; ++i)
- imo->imo_membership[i-1] = imo->imo_membership[i];
- --imo->imo_num_memberships;
- splx(s);
- break;
-
- default:
- error = EOPNOTSUPP;
- break;
- }
-
- /*
- * If all options have default values, no need to keep the mbuf.
- */
- if (imo->imo_multicast_ifp == NULL &&
- imo->imo_multicast_vif == -1 &&
- imo->imo_multicast_ttl == IP_DEFAULT_MULTICAST_TTL &&
- imo->imo_multicast_loop == IP_DEFAULT_MULTICAST_LOOP &&
- imo->imo_num_memberships == 0) {
- free(*imop, M_IPMOPTS);
- *imop = NULL;
- }
-
- return (error);
-}
-
-/*
- * Return the IP multicast options in response to user getsockopt().
- */
-static int
-ip_getmoptions(optname, imo, mp)
- int optname;
- register struct ip_moptions *imo;
- register struct mbuf **mp;
-{
- u_char *ttl;
- u_char *loop;
- struct in_addr *addr;
- struct in_ifaddr *ia;
-
- *mp = m_get(M_WAIT, MT_SOOPTS);
-
- switch (optname) {
-
- case IP_MULTICAST_VIF:
- if (imo != NULL)
- *(mtod(*mp, int *)) = imo->imo_multicast_vif;
- else
- *(mtod(*mp, int *)) = -1;
- (*mp)->m_len = sizeof(int);
- return(0);
-
- case IP_MULTICAST_IF:
- addr = mtod(*mp, struct in_addr *);
- (*mp)->m_len = sizeof(struct in_addr);
- if (imo == NULL || imo->imo_multicast_ifp == NULL)
- addr->s_addr = INADDR_ANY;
- else {
- IFP_TO_IA(imo->imo_multicast_ifp, ia);
- addr->s_addr = (ia == NULL) ? INADDR_ANY
- : IA_SIN(ia)->sin_addr.s_addr;
- }
- return (0);
-
- case IP_MULTICAST_TTL:
- ttl = mtod(*mp, u_char *);
- (*mp)->m_len = 1;
- *ttl = (imo == NULL) ? IP_DEFAULT_MULTICAST_TTL
- : imo->imo_multicast_ttl;
- return (0);
-
- case IP_MULTICAST_LOOP:
- loop = mtod(*mp, u_char *);
- (*mp)->m_len = 1;
- *loop = (imo == NULL) ? IP_DEFAULT_MULTICAST_LOOP
- : imo->imo_multicast_loop;
- return (0);
-
- default:
- return (EOPNOTSUPP);
- }
-}
-
-/*
- * Discard the IP multicast options.
- */
-void
-ip_freemoptions(imo)
- register struct ip_moptions *imo;
-{
- register int i;
-
- if (imo != NULL) {
- for (i = 0; i < imo->imo_num_memberships; ++i)
- in_delmulti(imo->imo_membership[i]);
- free(imo, M_IPMOPTS);
- }
-}
-
-/*
- * Routine called from ip_output() to loop back a copy of an IP multicast
- * packet to the input queue of a specified interface. Note that this
- * calls the output routine of the loopback "driver", but with an interface
- * pointer that might NOT be a loopback interface -- evil, but easier than
- * replicating that code here.
- */
-static void
-ip_mloopback(ifp, m, dst, hlen)
- struct ifnet *ifp;
- register struct mbuf *m;
- register struct sockaddr_in *dst;
- int hlen;
-{
- register struct ip *ip;
- struct mbuf *copym;
-
- copym = m_copy(m, 0, M_COPYALL);
- if (copym != NULL && (copym->m_flags & M_EXT || copym->m_len < hlen))
- copym = m_pullup(copym, hlen);
- if (copym != NULL) {
- /*
- * We don't bother to fragment if the IP length is greater
- * than the interface's MTU. Can this possibly matter?
- */
- ip = mtod(copym, struct ip *);
- ip->ip_len = htons((u_short)ip->ip_len);
- ip->ip_off = htons((u_short)ip->ip_off);
- ip->ip_sum = 0;
- if (ip->ip_vhl == IP_VHL_BORING) {
- ip->ip_sum = in_cksum_hdr(ip);
- } else {
- ip->ip_sum = in_cksum(copym, hlen);
- }
- /*
- * NB:
- * It's not clear whether there are any lingering
- * reentrancy problems in other areas which might
- * be exposed by using ip_input directly (in
- * particular, everything which modifies the packet
- * in-place). Yet another option is using the
- * protosw directly to deliver the looped back
- * packet. For the moment, we'll err on the side
- * of safety by continuing to abuse looutput().
- */
-#ifdef notdef
- copym->m_pkthdr.rcvif = ifp;
- ip_input(copym)
-#else
- (void) looutput(ifp, copym, (struct sockaddr *)dst, NULL);
-#endif
- }
-}
diff --git a/c/src/exec/libnetworking/netinet/ip_var.h b/c/src/exec/libnetworking/netinet/ip_var.h
deleted file mode 100644
index cc7908e9a3..0000000000
--- a/c/src/exec/libnetworking/netinet/ip_var.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)ip_var.h 8.2 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _NETINET_IP_VAR_H_
-#define _NETINET_IP_VAR_H_
-
-/*
- * Overlay for ip header used by other protocols (tcp, udp).
- */
-struct ipovly {
- caddr_t ih_next, ih_prev; /* for protocol sequence q's */
- u_char ih_x1; /* (unused) */
- u_char ih_pr; /* protocol */
- u_short ih_len; /* protocol length */
- struct in_addr ih_src; /* source internet address */
- struct in_addr ih_dst; /* destination internet address */
-};
-
-/*
- * Ip reassembly queue structure. Each fragment
- * being reassembled is attached to one of these structures.
- * They are timed out after ipq_ttl drops to 0, and may also
- * be reclaimed if memory becomes tight.
- */
-struct ipq {
- struct ipq *next,*prev; /* to other reass headers */
- u_char ipq_ttl; /* time for reass q to live */
- u_char ipq_p; /* protocol of this fragment */
- u_short ipq_id; /* sequence id for reassembly */
- struct ipasfrag *ipq_next,*ipq_prev;
- /* to ip headers of fragments */
- struct in_addr ipq_src,ipq_dst;
-#ifdef IPDIVERT
- u_short ipq_divert; /* divert protocol port */
-#endif
-};
-
-/*
- * Ip header, when holding a fragment.
- *
- * Note: ipf_next must be at same offset as ipq_next above
- */
-struct ipasfrag {
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char ip_hl:4,
- ip_v:4;
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char ip_v:4,
- ip_hl:4;
-#endif
- u_char ipf_mff; /* XXX overlays ip_tos: use low bit
- * to avoid destroying tos;
- * copied from (ip_off&IP_MF) */
- u_short ip_len;
- u_short ip_id;
- u_short ip_off;
- u_char ip_ttl;
- u_char ip_p;
- u_short ip_sum;
- struct ipasfrag *ipf_next; /* next fragment */
- struct ipasfrag *ipf_prev; /* previous fragment */
-};
-
-/*
- * Structure stored in mbuf in inpcb.ip_options
- * and passed to ip_output when ip options are in use.
- * The actual length of the options (including ipopt_dst)
- * is in m_len.
- */
-#define MAX_IPOPTLEN 40
-
-struct ipoption {
- struct in_addr ipopt_dst; /* first-hop dst if source routed */
- char ipopt_list[MAX_IPOPTLEN]; /* options proper */
-};
-
-/*
- * Structure attached to inpcb.ip_moptions and
- * passed to ip_output when IP multicast options are in use.
- */
-struct ip_moptions {
- struct ifnet *imo_multicast_ifp; /* ifp for outgoing multicasts */
- u_char imo_multicast_ttl; /* TTL for outgoing multicasts */
- u_char imo_multicast_loop; /* 1 => hear sends if a member */
- u_short imo_num_memberships; /* no. memberships this socket */
- struct in_multi *imo_membership[IP_MAX_MEMBERSHIPS];
- u_long imo_multicast_vif; /* vif num outgoing multicasts */
-};
-
-struct ipstat {
- u_long ips_total; /* total packets received */
- u_long ips_badsum; /* checksum bad */
- u_long ips_tooshort; /* packet too short */
- u_long ips_toosmall; /* not enough data */
- u_long ips_badhlen; /* ip header length < data size */
- u_long ips_badlen; /* ip length < ip header length */
- u_long ips_fragments; /* fragments received */
- u_long ips_fragdropped; /* frags dropped (dups, out of space) */
- u_long ips_fragtimeout; /* fragments timed out */
- u_long ips_forward; /* packets forwarded */
- u_long ips_cantforward; /* packets rcvd for unreachable dest */
- u_long ips_redirectsent; /* packets forwarded on same net */
- u_long ips_noproto; /* unknown or unsupported protocol */
- u_long ips_delivered; /* datagrams delivered to upper level*/
- u_long ips_localout; /* total ip packets generated here */
- u_long ips_odropped; /* lost packets due to nobufs, etc. */
- u_long ips_reassembled; /* total packets reassembled ok */
- u_long ips_fragmented; /* datagrams successfully fragmented */
- u_long ips_ofragments; /* output fragments created */
- u_long ips_cantfrag; /* don't fragment flag was set, etc. */
- u_long ips_badoptions; /* error in option processing */
- u_long ips_noroute; /* packets discarded due to no route */
- u_long ips_badvers; /* ip version != 4 */
- u_long ips_rawout; /* total raw ip packets generated */
- u_long ips_toolong; /* ip length > max ip packet size */
-};
-
-#ifdef KERNEL
-/* flags passed to ip_output as last parameter */
-#define IP_FORWARDING 0x1 /* most of ip header exists */
-#define IP_RAWOUTPUT 0x2 /* raw ip header exists */
-#define IP_ROUTETOIF SO_DONTROUTE /* bypass routing tables */
-#define IP_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets */
-
-struct inpcb;
-struct route;
-
-extern struct ipstat ipstat;
-extern u_short ip_id; /* ip packet ctr, for ids */
-extern int ip_defttl; /* default IP ttl */
-extern u_char ip_protox[];
-extern struct socket *ip_rsvpd; /* reservation protocol daemon */
-extern struct socket *ip_mrouter; /* multicast routing daemon */
-extern int (*legal_vif_num) __P((int));
-extern u_long (*ip_mcast_src) __P((int));
-extern int rsvp_on;
-
-int ip_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
-void ip_drain __P((void));
-void ip_freemoptions __P((struct ip_moptions *));
-void ip_init __P((void));
-extern int (*ip_mforward) __P((struct ip *, struct ifnet *, struct mbuf *,
- struct ip_moptions *));
-int ip_output __P((struct mbuf *,
- struct mbuf *, struct route *, int, struct ip_moptions *));
-void ip_savecontrol __P((struct inpcb *, struct mbuf **, struct ip *,
- struct mbuf *));
-void ip_slowtimo __P((void));
-struct mbuf *
- ip_srcroute __P((void));
-void ip_stripoptions __P((struct mbuf *, struct mbuf *));
-int rip_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
-void rip_init __P((void));
-void rip_input __P((struct mbuf *, int));
-int rip_output __P((struct mbuf *, struct socket *, u_long));
-int rip_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-void ipip_input __P((struct mbuf *, int));
-void rsvp_input __P((struct mbuf *, int));
-int ip_rsvp_init __P((struct socket *));
-int ip_rsvp_done __P((void));
-int ip_rsvp_vif_init __P((struct socket *, struct mbuf *));
-int ip_rsvp_vif_done __P((struct socket *, struct mbuf *));
-void ip_rsvp_force_done __P((struct socket *));
-
-#ifdef IPDIVERT
-void div_init __P((void));
-void div_input __P((struct mbuf *, int));
-int div_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-extern u_short ip_divert_port;
-extern u_short ip_divert_ignore;
-#endif /* IPDIVERT */
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_IP_VAR_H_ */
diff --git a/c/src/exec/libnetworking/netinet/raw_ip.c b/c/src/exec/libnetworking/netinet/raw_ip.c
deleted file mode 100644
index 44d58f1844..0000000000
--- a/c/src/exec/libnetworking/netinet/raw_ip.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/systm.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#define _IP_VHL
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_mroute.h>
-
-#include <netinet/ip_fw.h>
-
-#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1
-#undef COMPAT_IPFW
-#define COMPAT_IPFW 1
-#else
-#undef COMPAT_IPFW
-#endif
-
-static struct inpcbhead ripcb;
-static struct inpcbinfo ripcbinfo;
-
-/*
- * Nominal space allocated to a raw ip socket.
- */
-#define RIPSNDQ 8192
-#define RIPRCVQ 8192
-
-/*
- * Raw interface to IP protocol.
- */
-
-/*
- * Initialize raw connection block q.
- */
-void
-rip_init()
-{
- LIST_INIT(&ripcb);
- ripcbinfo.listhead = &ripcb;
- /*
- * XXX We don't use the hash list for raw IP, but it's easier
- * to allocate a one entry hash list than it is to check all
- * over the place for hashbase == NULL.
- */
- ripcbinfo.hashbase = hashinit(1, M_PCB, &ripcbinfo.hashmask);
-}
-
-static struct sockaddr_in ripsrc = { sizeof(ripsrc), AF_INET };
-/*
- * Setup generic address and protocol structures
- * for raw_input routine, then pass them along with
- * mbuf chain.
- */
-void
-rip_input(m, iphlen)
- struct mbuf *m;
- int iphlen;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register struct inpcb *inp;
- struct inpcb *last = 0;
- struct mbuf *opts = 0;
-
- ripsrc.sin_addr = ip->ip_src;
- for (inp = ripcb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_ip_p && inp->inp_ip_p != ip->ip_p)
- continue;
- if (inp->inp_laddr.s_addr &&
- inp->inp_laddr.s_addr != ip->ip_dst.s_addr)
- continue;
- if (inp->inp_faddr.s_addr &&
- inp->inp_faddr.s_addr != ip->ip_src.s_addr)
- continue;
- if (last) {
- struct mbuf *n = m_copy(m, 0, (int)M_COPYALL);
- if (n) {
- if (last->inp_flags & INP_CONTROLOPTS ||
- last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, n);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&ripsrc, n,
- opts) == 0) {
- /* should notify about lost packet */
- m_freem(n);
- if (opts)
- m_freem(opts);
- } else
- sorwakeup(last->inp_socket);
- opts = 0;
- }
- }
- last = inp;
- }
- if (last) {
- if (last->inp_flags & INP_CONTROLOPTS ||
- last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, m);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&ripsrc, m, opts) == 0) {
- m_freem(m);
- if (opts)
- m_freem(opts);
- } else
- sorwakeup(last->inp_socket);
- } else {
- m_freem(m);
- ipstat.ips_noproto++;
- ipstat.ips_delivered--;
- }
-}
-
-/*
- * Generate IP header and pass packet to ip_output.
- * Tack on options user may have setup with control call.
- */
-int
-rip_output(m, so, dst)
- register struct mbuf *m;
- struct socket *so;
- u_long dst;
-{
- register struct ip *ip;
- register struct inpcb *inp = sotoinpcb(so);
- int flags = (so->so_options & SO_DONTROUTE) | IP_ALLOWBROADCAST;
-
- /*
- * If the user handed us a complete IP packet, use it.
- * Otherwise, allocate an mbuf for a header and fill it in.
- */
- if ((inp->inp_flags & INP_HDRINCL) == 0) {
- if (m->m_pkthdr.len + sizeof(struct ip) > IP_MAXPACKET) {
- m_freem(m);
- return(EMSGSIZE);
- }
- M_PREPEND(m, sizeof(struct ip), M_WAIT);
- ip = mtod(m, struct ip *);
- ip->ip_tos = 0;
- ip->ip_off = 0;
- ip->ip_p = inp->inp_ip_p;
- ip->ip_len = m->m_pkthdr.len;
- ip->ip_src = inp->inp_laddr;
- ip->ip_dst.s_addr = dst;
- ip->ip_ttl = MAXTTL;
- } else {
- if (m->m_pkthdr.len > IP_MAXPACKET) {
- m_freem(m);
- return(EMSGSIZE);
- }
- ip = mtod(m, struct ip *);
- /* don't allow both user specified and setsockopt options,
- and don't allow packet length sizes that will crash */
- if (((IP_VHL_HL(ip->ip_vhl) != (sizeof (*ip) >> 2))
- && inp->inp_options)
- || (ip->ip_len > m->m_pkthdr.len)
- || (ip->ip_len < (IP_VHL_HL(ip->ip_vhl) << 2))) {
- m_freem(m);
- return EINVAL;
- }
- if (ip->ip_id == 0)
- ip->ip_id = htons(ip_id++);
- /* XXX prevent ip_output from overwriting header fields */
- flags |= IP_RAWOUTPUT;
- ipstat.ips_rawout++;
- }
- return (ip_output(m, inp->inp_options, &inp->inp_route, flags,
- inp->inp_moptions));
-}
-
-/*
- * Raw IP socket option processing.
- */
-int
-rip_ctloutput(op, so, level, optname, m)
- int op;
- struct socket *so;
- int level, optname;
- struct mbuf **m;
-{
- register struct inpcb *inp = sotoinpcb(so);
- register int error;
-
- if (level != IPPROTO_IP) {
- if (op == PRCO_SETOPT && *m)
- (void)m_free(*m);
- return (EINVAL);
- }
-
- switch (optname) {
-
- case IP_HDRINCL:
- error = 0;
- if (op == PRCO_SETOPT) {
- if (m == 0 || *m == 0 || (*m)->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(*m, int *))
- inp->inp_flags |= INP_HDRINCL;
- else
- inp->inp_flags &= ~INP_HDRINCL;
- if (*m)
- (void)m_free(*m);
- } else {
- *m = m_get(M_WAIT, MT_SOOPTS);
- (*m)->m_len = sizeof (int);
- *mtod(*m, int *) = inp->inp_flags & INP_HDRINCL;
- }
- return (error);
-
-#ifdef COMPAT_IPFW
- case IP_FW_GET:
- if (ip_fw_ctl_ptr == NULL || op == PRCO_SETOPT) {
- if (*m) (void)m_free(*m);
- return(EINVAL);
- }
- return (*ip_fw_ctl_ptr)(optname, m);
-
- case IP_FW_ADD:
- case IP_FW_DEL:
- case IP_FW_FLUSH:
- case IP_FW_ZERO:
- if (ip_fw_ctl_ptr == NULL || op != PRCO_SETOPT) {
- if (*m) (void)m_free(*m);
- return(EINVAL);
- }
- return (*ip_fw_ctl_ptr)(optname, m);
-
- case IP_NAT:
- if (ip_nat_ctl_ptr == NULL) {
- if (*m) (void)m_free(*m);
- return(EINVAL);
- }
- return (*ip_nat_ctl_ptr)(op, m);
-
-#endif
- case IP_RSVP_ON:
- return ip_rsvp_init(so);
- break;
-
- case IP_RSVP_OFF:
- return ip_rsvp_done();
- break;
-
- case IP_RSVP_VIF_ON:
- return ip_rsvp_vif_init(so, *m);
-
- case IP_RSVP_VIF_OFF:
- return ip_rsvp_vif_done(so, *m);
-
- case MRT_INIT:
- case MRT_DONE:
- case MRT_ADD_VIF:
- case MRT_DEL_VIF:
- case MRT_ADD_MFC:
- case MRT_DEL_MFC:
- case MRT_VERSION:
- case MRT_ASSERT:
- if (op == PRCO_SETOPT) {
- error = ip_mrouter_set(optname, so, *m);
- if (*m)
- (void)m_free(*m);
- } else if (op == PRCO_GETOPT) {
- error = ip_mrouter_get(optname, so, m);
- } else
- error = EINVAL;
- return (error);
- }
- return (ip_ctloutput(op, so, level, optname, m));
-}
-
-static u_long rip_sendspace = RIPSNDQ; /* XXX sysctl ? */
-static u_long rip_recvspace = RIPRCVQ; /* XXX sysctl ? */
-
-/*ARGSUSED*/
-int
-rip_usrreq(so, req, m, nam, control)
- register struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register int error = 0;
- register struct inpcb *inp = sotoinpcb(so);
- int s;
-
- if (req == PRU_CONTROL)
- return (in_control(so, (u_long)m, (caddr_t)nam,
- (struct ifnet *)control));
-
- switch (req) {
-
- case PRU_ATTACH:
- if (inp)
- panic("rip_attach");
- if ((so->so_state & SS_PRIV) == 0) {
- error = EACCES;
- break;
- }
- s = splnet();
- error = in_pcballoc(so, &ripcbinfo);
- splx(s);
- if (error)
- break;
- error = soreserve(so, rip_sendspace, rip_recvspace);
- if (error)
- break;
- inp = (struct inpcb *)so->so_pcb;
- inp->inp_ip_p = (int)nam;
- break;
-
- case PRU_DISCONNECT:
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- error = ENOTCONN;
- break;
- }
- /* FALLTHROUGH */
- case PRU_ABORT:
- soisdisconnected(so);
- /* FALLTHROUGH */
- case PRU_DETACH:
- if (inp == 0)
- panic("rip_detach");
- if (so == ip_mrouter)
- ip_mrouter_done();
- ip_rsvp_force_done(so);
- if (so == ip_rsvpd)
- ip_rsvp_done();
- in_pcbdetach(inp);
- break;
-
- case PRU_BIND:
- {
- struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *);
-
- if (nam->m_len != sizeof(*addr)) {
- error = EINVAL;
- break;
- }
- if ((ifnet == 0) ||
- ((addr->sin_family != AF_INET) &&
- (addr->sin_family != AF_IMPLINK)) ||
- (addr->sin_addr.s_addr &&
- ifa_ifwithaddr((struct sockaddr *)addr) == 0)) {
- error = EADDRNOTAVAIL;
- break;
- }
- inp->inp_laddr = addr->sin_addr;
- break;
- }
- case PRU_CONNECT:
- {
- struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *);
-
- if (nam->m_len != sizeof(*addr)) {
- error = EINVAL;
- break;
- }
- if (ifnet == 0) {
- error = EADDRNOTAVAIL;
- break;
- }
- if ((addr->sin_family != AF_INET) &&
- (addr->sin_family != AF_IMPLINK)) {
- error = EAFNOSUPPORT;
- break;
- }
- inp->inp_faddr = addr->sin_addr;
- soisconnected(so);
- break;
- }
-
- case PRU_CONNECT2:
- error = EOPNOTSUPP;
- break;
-
- /*
- * Mark the connection as being incapable of further input.
- */
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- /*
- * Ship a packet out. The appropriate raw output
- * routine handles any massaging necessary.
- */
- case PRU_SEND:
- {
- register u_long dst;
-
- if (so->so_state & SS_ISCONNECTED) {
- if (nam) {
- error = EISCONN;
- break;
- }
- dst = inp->inp_faddr.s_addr;
- } else {
- if (nam == NULL) {
- error = ENOTCONN;
- break;
- }
- dst = mtod(nam, struct sockaddr_in *)->sin_addr.s_addr;
- }
- error = rip_output(m, so, dst);
- m = NULL;
- break;
- }
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- /*
- * Not supported.
- */
- case PRU_RCVOOB:
- case PRU_RCVD:
- case PRU_LISTEN:
- case PRU_ACCEPT:
- case PRU_SENDOOB:
- error = EOPNOTSUPP;
- break;
-
- case PRU_SOCKADDR:
- in_setsockaddr(inp, nam);
- break;
-
- case PRU_PEERADDR:
- in_setpeeraddr(inp, nam);
- break;
-
- default:
- panic("rip_usrreq");
- }
- if (m != NULL)
- m_freem(m);
- return (error);
-}
diff --git a/c/src/exec/libnetworking/netinet/tcp.h b/c/src/exec/libnetworking/netinet/tcp.h
deleted file mode 100644
index 3585917aa3..0000000000
--- a/c/src/exec/libnetworking/netinet/tcp.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_H_
-#define _NETINET_TCP_H_
-
-typedef u_long tcp_seq;
-typedef u_long tcp_cc; /* connection count per rfc1644 */
-
-/*
- * TCP header.
- * Per RFC 793, September, 1981.
- */
-struct tcphdr {
- u_short th_sport; /* source port */
- u_short th_dport; /* destination port */
- tcp_seq th_seq; /* sequence number */
- tcp_seq th_ack; /* acknowledgement number */
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char th_x2:4, /* (unused) */
- th_off:4; /* data offset */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char th_off:4, /* data offset */
- th_x2:4; /* (unused) */
-#endif
- u_char th_flags;
-#define TH_FIN 0x01
-#define TH_SYN 0x02
-#define TH_RST 0x04
-#define TH_PUSH 0x08
-#define TH_ACK 0x10
-#define TH_URG 0x20
-#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG)
-
- u_short th_win; /* window */
- u_short th_sum; /* checksum */
- u_short th_urp; /* urgent pointer */
-};
-
-#define TCPOPT_EOL 0
-#define TCPOPT_NOP 1
-#define TCPOPT_MAXSEG 2
-#define TCPOLEN_MAXSEG 4
-#define TCPOPT_WINDOW 3
-#define TCPOLEN_WINDOW 3
-#define TCPOPT_SACK_PERMITTED 4 /* Experimental */
-#define TCPOLEN_SACK_PERMITTED 2
-#define TCPOPT_SACK 5 /* Experimental */
-#define TCPOPT_TIMESTAMP 8
-#define TCPOLEN_TIMESTAMP 10
-#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
-#define TCPOPT_TSTAMP_HDR \
- (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
-
-#define TCPOPT_CC 11 /* CC options: RFC-1644 */
-#define TCPOPT_CCNEW 12
-#define TCPOPT_CCECHO 13
-#define TCPOLEN_CC 6
-#define TCPOLEN_CC_APPA (TCPOLEN_CC+2)
-#define TCPOPT_CC_HDR(ccopt) \
- (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC)
-
-/*
- * Default maximum segment size for TCP.
- * With an IP MSS of 576, this is 536,
- * but 512 is probably more convenient.
- * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
- */
-#define TCP_MSS 512
-
-#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
-#define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */
-
-#define TCP_MAX_WINSHIFT 14 /* maximum window shift */
-
-#define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */
-#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr))
- /* max space left for options */
-
-/*
- * User-settable options (used with setsockopt).
- */
-#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
-#define TCP_MAXSEG 0x02 /* set maximum segment size */
-#define TCP_NOPUSH 0x04 /* don't push last block of write */
-#define TCP_NOOPT 0x08 /* don't use TCP options */
-
-#endif
diff --git a/c/src/exec/libnetworking/netinet/tcp_debug.c b/c/src/exec/libnetworking/netinet/tcp_debug.c
deleted file mode 100644
index 864a01cb1a..0000000000
--- a/c/src/exec/libnetworking/netinet/tcp_debug.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_debug.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#ifdef TCPDEBUG
-/* load symbolic names */
-#define PRUREQUESTS
-#define TCPSTATES
-#define TCPTIMERS
-#define TANAMES
-#endif
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <net/route.h>
-#include <net/if.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#include <netinet/tcp_debug.h>
-
-#ifdef TCPDEBUG
-static int tcpconsdebug = 0;
-#endif
-
-static struct tcp_debug tcp_debug[TCP_NDEBUG];
-static int tcp_debx;
-
-/*
- * Tcp debug routines
- */
-void
-tcp_trace(act, ostate, tp, ti, req)
- short act, ostate;
- struct tcpcb *tp;
- struct tcpiphdr *ti;
- int req;
-{
-#ifdef TCPDEBUG
- tcp_seq seq, ack;
- int len, flags;
-#endif
- struct tcp_debug *td = &tcp_debug[tcp_debx++];
-
- if (tcp_debx == TCP_NDEBUG)
- tcp_debx = 0;
- td->td_time = iptime();
- td->td_act = act;
- td->td_ostate = ostate;
- td->td_tcb = (caddr_t)tp;
- if (tp)
- td->td_cb = *tp;
- else
- bzero((caddr_t)&td->td_cb, sizeof (*tp));
- if (ti)
- td->td_ti = *ti;
- else
- bzero((caddr_t)&td->td_ti, sizeof (*ti));
- td->td_req = req;
-#ifdef TCPDEBUG
- if (tcpconsdebug == 0)
- return;
- if (tp)
- printf("%p %s:", tp, tcpstates[ostate]);
- else
- printf("???????? ");
- printf("%s ", tanames[act]);
- switch (act) {
-
- case TA_INPUT:
- case TA_OUTPUT:
- case TA_DROP:
- if (ti == 0)
- break;
- seq = ti->ti_seq;
- ack = ti->ti_ack;
- len = ti->ti_len;
- if (act == TA_OUTPUT) {
- seq = ntohl(seq);
- ack = ntohl(ack);
- len = ntohs((u_short)len);
- }
- if (act == TA_OUTPUT)
- len -= sizeof (struct tcphdr);
- if (len)
- printf("[%x..%x)", seq, seq+len);
- else
- printf("%x", seq);
- printf("@%x, urp=%x", ack, ti->ti_urp);
- flags = ti->ti_flags;
- if (flags) {
- char *cp = "<";
-#define pf(f) { \
- if (ti->ti_flags & TH_##f) { \
- printf("%s%s", cp, #f); \
- cp = ","; \
- } \
-}
- pf(SYN); pf(ACK); pf(FIN); pf(RST); pf(PUSH); pf(URG);
- printf(">");
- }
- break;
-
- case TA_USER:
- printf("%s", prurequests[req&0xff]);
- if ((req & 0xff) == PRU_SLOWTIMO)
- printf("<%s>", tcptimers[req>>8]);
- break;
- }
- if (tp)
- printf(" -> %s", tcpstates[tp->t_state]);
- /* print out internal state of tp !?! */
- printf("\n");
- if (tp == 0)
- return;
- printf("\trcv_(nxt,wnd,up) (%x,%x,%x) snd_(una,nxt,max) (%x,%x,%x)\n",
- tp->rcv_nxt, tp->rcv_wnd, tp->rcv_up, tp->snd_una, tp->snd_nxt,
- tp->snd_max);
- printf("\tsnd_(wl1,wl2,wnd) (%x,%x,%x)\n",
- tp->snd_wl1, tp->snd_wl2, tp->snd_wnd);
-#endif /* TCPDEBUG */
-}
diff --git a/c/src/exec/libnetworking/netinet/tcp_debug.h b/c/src/exec/libnetworking/netinet/tcp_debug.h
deleted file mode 100644
index a33743b077..0000000000
--- a/c/src/exec/libnetworking/netinet/tcp_debug.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_debug.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_DEBUG_H_
-#define _NETINET_TCP_DEBUG_H_
-
-struct tcp_debug {
- n_time td_time;
- short td_act;
- short td_ostate;
- caddr_t td_tcb;
- struct tcpiphdr td_ti;
- short td_req;
- struct tcpcb td_cb;
-};
-
-#define TA_INPUT 0
-#define TA_OUTPUT 1
-#define TA_USER 2
-#define TA_RESPOND 3
-#define TA_DROP 4
-
-#ifdef TANAMES
-static char *tanames[] =
- { "input", "output", "user", "respond", "drop" };
-#endif
-
-#define TCP_NDEBUG 100
-
-#ifndef KERNEL
-/* XXX common variables for broken applications. */
-struct tcp_debug tcp_debug[TCP_NDEBUG];
-int tcp_debx;
-#endif
-
-#endif /* !_NETINET_TCP_DEBUG_H_ */
diff --git a/c/src/exec/libnetworking/netinet/tcp_fsm.h b/c/src/exec/libnetworking/netinet/tcp_fsm.h
deleted file mode 100644
index 3f2c12f54f..0000000000
--- a/c/src/exec/libnetworking/netinet/tcp_fsm.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_fsm.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_FSM_H_
-#define _NETINET_TCP_FSM_H_
-
-/*
- * TCP FSM state definitions.
- * Per RFC793, September, 1981.
- */
-
-#define TCP_NSTATES 11
-
-#define TCPS_CLOSED 0 /* closed */
-#define TCPS_LISTEN 1 /* listening for connection */
-#define TCPS_SYN_SENT 2 /* active, have sent syn */
-#define TCPS_SYN_RECEIVED 3 /* have send and received syn */
-/* states < TCPS_ESTABLISHED are those where connections not established */
-#define TCPS_ESTABLISHED 4 /* established */
-#define TCPS_CLOSE_WAIT 5 /* rcvd fin, waiting for close */
-/* states > TCPS_CLOSE_WAIT are those where user has closed */
-#define TCPS_FIN_WAIT_1 6 /* have closed, sent fin */
-#define TCPS_CLOSING 7 /* closed xchd FIN; await FIN ACK */
-#define TCPS_LAST_ACK 8 /* had fin and close; await FIN ACK */
-/* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */
-#define TCPS_FIN_WAIT_2 9 /* have closed, fin is acked */
-#define TCPS_TIME_WAIT 10 /* in 2*msl quiet wait after close */
-
-#define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED)
-#define TCPS_HAVEESTABLISHED(s) ((s) >= TCPS_ESTABLISHED)
-#define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT)
-
-#ifdef TCPOUTFLAGS
-/*
- * Flags used when sending segments in tcp_output.
- * Basic flags (TH_RST,TH_ACK,TH_SYN,TH_FIN) are totally
- * determined by state, with the proviso that TH_FIN is sent only
- * if all data queued for output is included in the segment.
- */
-static u_char tcp_outflags[TCP_NSTATES] = {
- TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK,
- TH_ACK, TH_ACK,
- TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK,
-};
-#endif
-
-#ifdef KPROF
-int tcp_acounts[TCP_NSTATES][PRU_NREQ];
-#endif
-
-#ifdef TCPSTATES
-char *tcpstates[] = {
- "CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD",
- "ESTABLISHED", "CLOSE_WAIT", "FIN_WAIT_1", "CLOSING",
- "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT",
-};
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/netinet/tcp_input.c b/c/src/exec/libnetworking/netinet/tcp_input.c
deleted file mode 100644
index bc55a79ae2..0000000000
--- a/c/src/exec/libnetworking/netinet/tcp_input.c
+++ /dev/null
@@ -1,2149 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995
- * 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.
- *
- * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#ifndef TUBA_INCLUDE
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-
-#include <machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-static struct tcpiphdr tcp_saveti;
-#endif
-
-static int tcprexmtthresh = 3;
-tcp_seq tcp_iss;
-tcp_cc tcp_ccgen;
-
-struct tcpstat tcpstat;
-SYSCTL_STRUCT(_net_inet_tcp, TCPCTL_STATS, stats,
- CTLFLAG_RD, &tcpstat , tcpstat, "");
-
-static int log_in_vain = 0;
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_in_vain, CTLFLAG_RW,
- &log_in_vain, 0, "");
-
-u_long tcp_now;
-struct inpcbhead tcb;
-struct inpcbinfo tcbinfo;
-
-static void tcp_dooptions __P((struct tcpcb *,
- u_char *, int, struct tcpiphdr *, struct tcpopt *));
-static void tcp_pulloutofband __P((struct socket *,
- struct tcpiphdr *, struct mbuf *));
-static int tcp_reass __P((struct tcpcb *, struct tcpiphdr *, struct mbuf *));
-static void tcp_xmit_timer __P((struct tcpcb *, int));
-
-#endif /* TUBA_INCLUDE */
-
-/*
- * Insert segment ti into reassembly queue of tcp with
- * control block tp. Return TH_FIN if reassembly now includes
- * a segment with FIN. The macro form does the common case inline
- * (segment is the next to be received on an established connection,
- * and the queue is empty), avoiding linkage into and removal
- * from the queue and repetition of various conversions.
- * Set DELACK for segments received in order, but ack immediately
- * when segments are out of order (so fast retransmit can work).
- */
-#ifdef TCP_ACK_HACK
-#define TCP_REASS(tp, ti, m, so, flags) { \
- if ((ti)->ti_seq == (tp)->rcv_nxt && \
- (tp)->seg_next == (struct tcpiphdr *)(tp) && \
- (tp)->t_state == TCPS_ESTABLISHED) { \
- if (ti->ti_flags & TH_PUSH) \
- tp->t_flags |= TF_ACKNOW; \
- else \
- tp->t_flags |= TF_DELACK; \
- (tp)->rcv_nxt += (ti)->ti_len; \
- flags = (ti)->ti_flags & TH_FIN; \
- tcpstat.tcps_rcvpack++;\
- tcpstat.tcps_rcvbyte += (ti)->ti_len;\
- sbappend(&(so)->so_rcv, (m)); \
- sorwakeup(so); \
- } else { \
- (flags) = tcp_reass((tp), (ti), (m)); \
- tp->t_flags |= TF_ACKNOW; \
- } \
-}
-#else
-#define TCP_REASS(tp, ti, m, so, flags) { \
- if ((ti)->ti_seq == (tp)->rcv_nxt && \
- (tp)->seg_next == (struct tcpiphdr *)(tp) && \
- (tp)->t_state == TCPS_ESTABLISHED) { \
- tp->t_flags |= TF_DELACK; \
- (tp)->rcv_nxt += (ti)->ti_len; \
- flags = (ti)->ti_flags & TH_FIN; \
- tcpstat.tcps_rcvpack++;\
- tcpstat.tcps_rcvbyte += (ti)->ti_len;\
- sbappend(&(so)->so_rcv, (m)); \
- sorwakeup(so); \
- } else { \
- (flags) = tcp_reass((tp), (ti), (m)); \
- tp->t_flags |= TF_ACKNOW; \
- } \
-}
-#endif
-#ifndef TUBA_INCLUDE
-
-static int
-tcp_reass(tp, ti, m)
- register struct tcpcb *tp;
- register struct tcpiphdr *ti;
- struct mbuf *m;
-{
- register struct tcpiphdr *q;
- struct socket *so = tp->t_inpcb->inp_socket;
- int flags;
-
- /*
- * Call with ti==0 after become established to
- * force pre-ESTABLISHED data up to user socket.
- */
- if (ti == 0)
- goto present;
-
- /*
- * Find a segment which begins after this one does.
- */
- for (q = tp->seg_next; q != (struct tcpiphdr *)tp;
- q = (struct tcpiphdr *)q->ti_next)
- if (SEQ_GT(q->ti_seq, ti->ti_seq))
- break;
-
- /*
- * If there is a preceding segment, it may provide some of
- * our data already. If so, drop the data from the incoming
- * segment. If it provides all of our data, drop us.
- */
- if ((struct tcpiphdr *)q->ti_prev != (struct tcpiphdr *)tp) {
- register int i;
- q = (struct tcpiphdr *)q->ti_prev;
- /* conversion to int (in i) handles seq wraparound */
- i = q->ti_seq + q->ti_len - ti->ti_seq;
- if (i > 0) {
- if (i >= ti->ti_len) {
- tcpstat.tcps_rcvduppack++;
- tcpstat.tcps_rcvdupbyte += ti->ti_len;
- m_freem(m);
- /*
- * Try to present any queued data
- * at the left window edge to the user.
- * This is needed after the 3-WHS
- * completes.
- */
- goto present; /* ??? */
- }
- m_adj(m, i);
- ti->ti_len -= i;
- ti->ti_seq += i;
- }
- q = (struct tcpiphdr *)(q->ti_next);
- }
- tcpstat.tcps_rcvoopack++;
- tcpstat.tcps_rcvoobyte += ti->ti_len;
- REASS_MBUF(ti) = m; /* XXX */
-
- /*
- * While we overlap succeeding segments trim them or,
- * if they are completely covered, dequeue them.
- */
- while (q != (struct tcpiphdr *)tp) {
- register int i = (ti->ti_seq + ti->ti_len) - q->ti_seq;
- if (i <= 0)
- break;
- if (i < q->ti_len) {
- q->ti_seq += i;
- q->ti_len -= i;
- m_adj(REASS_MBUF(q), i);
- break;
- }
- q = (struct tcpiphdr *)q->ti_next;
- m = REASS_MBUF((struct tcpiphdr *)q->ti_prev);
- remque(q->ti_prev);
- m_freem(m);
- }
-
- /*
- * Stick new segment in its place.
- */
- insque(ti, q->ti_prev);
-
-present:
- /*
- * Present data to user, advancing rcv_nxt through
- * completed sequence space.
- */
- if (!TCPS_HAVEESTABLISHED(tp->t_state))
- return (0);
- ti = tp->seg_next;
- if (ti == (struct tcpiphdr *)tp || ti->ti_seq != tp->rcv_nxt)
- return (0);
- do {
- tp->rcv_nxt += ti->ti_len;
- flags = ti->ti_flags & TH_FIN;
- remque(ti);
- m = REASS_MBUF(ti);
- ti = (struct tcpiphdr *)ti->ti_next;
- if (so->so_state & SS_CANTRCVMORE)
- m_freem(m);
- else
- sbappend(&so->so_rcv, m);
- } while (ti != (struct tcpiphdr *)tp && ti->ti_seq == tp->rcv_nxt);
- sorwakeup(so);
- return (flags);
-}
-
-/*
- * TCP input routine, follows pages 65-76 of the
- * protocol specification dated September, 1981 very closely.
- */
-void
-tcp_input(m, iphlen)
- register struct mbuf *m;
- int iphlen;
-{
- register struct tcpiphdr *ti;
- register struct inpcb *inp;
- u_char *optp = NULL;
- int optlen = 0;
- int len, tlen, off;
- register struct tcpcb *tp = 0;
- register int tiflags;
- struct socket *so = 0;
- int todrop, acked, ourfinisacked, needoutput = 0;
- struct in_addr laddr;
- int dropsocket = 0;
- int iss = 0;
- u_long tiwin;
- struct tcpopt to; /* options in this segment */
- struct rmxp_tao *taop; /* pointer to our TAO cache entry */
- struct rmxp_tao tao_noncached; /* in case there's no cached entry */
-#ifdef TCPDEBUG
- short ostate = 0;
-#endif
-
- bzero((char *)&to, sizeof(to));
-
- tcpstat.tcps_rcvtotal++;
- /*
- * Get IP and TCP header together in first mbuf.
- * Note: IP leaves IP header in first mbuf.
- */
- ti = mtod(m, struct tcpiphdr *);
- if (iphlen > sizeof (struct ip))
- ip_stripoptions(m, (struct mbuf *)0);
- if (m->m_len < sizeof (struct tcpiphdr)) {
- if ((m = m_pullup(m, sizeof (struct tcpiphdr))) == 0) {
- tcpstat.tcps_rcvshort++;
- return;
- }
- ti = mtod(m, struct tcpiphdr *);
- }
-
- /*
- * Checksum extended TCP header and data.
- */
- tlen = ((struct ip *)ti)->ip_len;
- len = sizeof (struct ip) + tlen;
- ti->ti_next = ti->ti_prev = 0;
- ti->ti_x1 = 0;
- ti->ti_len = (u_short)tlen;
- HTONS(ti->ti_len);
- ti->ti_sum = in_cksum(m, len);
- if (ti->ti_sum) {
- tcpstat.tcps_rcvbadsum++;
- goto drop;
- }
-#endif /* TUBA_INCLUDE */
-
- /*
- * Check that TCP offset makes sense,
- * pull out TCP options and adjust length. XXX
- */
- off = ti->ti_off << 2;
- if (off < sizeof (struct tcphdr) || off > tlen) {
- tcpstat.tcps_rcvbadoff++;
- goto drop;
- }
- tlen -= off;
- ti->ti_len = tlen;
- if (off > sizeof (struct tcphdr)) {
- if (m->m_len < sizeof(struct ip) + off) {
- if ((m = m_pullup(m, sizeof (struct ip) + off)) == 0) {
- tcpstat.tcps_rcvshort++;
- return;
- }
- ti = mtod(m, struct tcpiphdr *);
- }
- optlen = off - sizeof (struct tcphdr);
- optp = mtod(m, u_char *) + sizeof (struct tcpiphdr);
- }
- tiflags = ti->ti_flags;
-
- /*
- * Convert TCP protocol specific fields to host format.
- */
- NTOHL(ti->ti_seq);
- NTOHL(ti->ti_ack);
- NTOHS(ti->ti_win);
- NTOHS(ti->ti_urp);
-
- /*
- * Drop TCP, IP headers and TCP options.
- */
- m->m_data += sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
- m->m_len -= sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
-
- /*
- * Locate pcb for segment.
- */
-findpcb:
- inp = in_pcblookuphash(&tcbinfo, ti->ti_src, ti->ti_sport,
- ti->ti_dst, ti->ti_dport, 1);
-
- /*
- * If the state is CLOSED (i.e., TCB does not exist) then
- * all data in the incoming segment is discarded.
- * If the TCB exists but is in CLOSED state, it is embryonic,
- * but should either do a listen or a connect soon.
- */
- if (inp == NULL) {
- if (log_in_vain && tiflags & TH_SYN) {
- char buf[4*sizeof "123"];
-
- strcpy(buf, inet_ntoa(ti->ti_dst));
- log(LOG_INFO, "Connection attempt to TCP %s:%d"
- " from %s:%d\n",
- buf, ntohs(ti->ti_dport),
- inet_ntoa(ti->ti_src), ntohs(ti->ti_sport));
- }
- goto dropwithreset;
- }
- tp = intotcpcb(inp);
- if (tp == 0)
- goto dropwithreset;
- if (tp->t_state == TCPS_CLOSED)
- goto drop;
-
- /* Unscale the window into a 32-bit value. */
- if ((tiflags & TH_SYN) == 0)
- tiwin = ti->ti_win << tp->snd_scale;
- else
- tiwin = ti->ti_win;
-
- so = inp->inp_socket;
- if (so->so_options & (SO_DEBUG|SO_ACCEPTCONN)) {
-#ifdef TCPDEBUG
- if (so->so_options & SO_DEBUG) {
- ostate = tp->t_state;
- tcp_saveti = *ti;
- }
-#endif
- if (so->so_options & SO_ACCEPTCONN) {
- register struct tcpcb *tp0 = tp;
- struct socket *so2;
- if ((tiflags & (TH_RST|TH_ACK|TH_SYN)) != TH_SYN) {
- /*
- * Note: dropwithreset makes sure we don't
- * send a RST in response to a RST.
- */
- if (tiflags & TH_ACK) {
- tcpstat.tcps_badsyn++;
- goto dropwithreset;
- }
- goto drop;
- }
- so2 = sonewconn(so, 0);
- if (so2 == 0) {
- tcpstat.tcps_listendrop++;
- so2 = sodropablereq(so);
- if (so2) {
- tcp_drop(sototcpcb(so2), ETIMEDOUT);
- so2 = sonewconn(so, 0);
- }
- if (!so2)
- goto drop;
- }
- so = so2;
- /*
- * This is ugly, but ....
- *
- * Mark socket as temporary until we're
- * committed to keeping it. The code at
- * ``drop'' and ``dropwithreset'' check the
- * flag dropsocket to see if the temporary
- * socket created here should be discarded.
- * We mark the socket as discardable until
- * we're committed to it below in TCPS_LISTEN.
- */
- dropsocket++;
- inp = (struct inpcb *)so->so_pcb;
- inp->inp_laddr = ti->ti_dst;
- inp->inp_lport = ti->ti_dport;
- in_pcbrehash(inp);
-#if BSD>=43
- inp->inp_options = ip_srcroute();
-#endif
- tp = intotcpcb(inp);
- tp->t_state = TCPS_LISTEN;
- tp->t_flags |= tp0->t_flags & (TF_NOPUSH|TF_NOOPT);
-
- /* Compute proper scaling value from buffer space */
- while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
- TCP_MAXWIN << tp->request_r_scale < so->so_rcv.sb_hiwat)
- tp->request_r_scale++;
- }
- }
-
- /*
- * Segment received on connection.
- * Reset idle time and keep-alive timer.
- */
- tp->t_idle = 0;
- if (TCPS_HAVEESTABLISHED(tp->t_state))
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
-
- /*
- * Process options if not in LISTEN state,
- * else do it below (after getting remote address).
- */
- if (tp->t_state != TCPS_LISTEN)
- tcp_dooptions(tp, optp, optlen, ti, &to);
-
- /*
- * Header prediction: check for the two common cases
- * of a uni-directional data xfer. If the packet has
- * no control flags, is in-sequence, the window didn't
- * change and we're not retransmitting, it's a
- * candidate. If the length is zero and the ack moved
- * forward, we're the sender side of the xfer. Just
- * free the data acked & wake any higher level process
- * that was blocked waiting for space. If the length
- * is non-zero and the ack didn't move, we're the
- * receiver side. If we're getting packets in-order
- * (the reassembly queue is empty), add the data to
- * the socket buffer and note that we need a delayed ack.
- * Make sure that the hidden state-flags are also off.
- * Since we check for TCPS_ESTABLISHED above, it can only
- * be TH_NEEDSYN.
- */
- if (tp->t_state == TCPS_ESTABLISHED &&
- (tiflags & (TH_SYN|TH_FIN|TH_RST|TH_URG|TH_ACK)) == TH_ACK &&
- ((tp->t_flags & (TF_NEEDSYN|TF_NEEDFIN)) == 0) &&
- ((to.to_flag & TOF_TS) == 0 ||
- TSTMP_GEQ(to.to_tsval, tp->ts_recent)) &&
- /*
- * Using the CC option is compulsory if once started:
- * the segment is OK if no T/TCP was negotiated or
- * if the segment has a CC option equal to CCrecv
- */
- ((tp->t_flags & (TF_REQ_CC|TF_RCVD_CC)) != (TF_REQ_CC|TF_RCVD_CC) ||
- ((to.to_flag & TOF_CC) != 0 && to.to_cc == tp->cc_recv)) &&
- ti->ti_seq == tp->rcv_nxt &&
- tiwin && tiwin == tp->snd_wnd &&
- tp->snd_nxt == tp->snd_max) {
-
- /*
- * If last ACK falls within this segment's sequence numbers,
- * record the timestamp.
- * NOTE that the test is modified according to the latest
- * proposal of the tcplw@cray.com list (Braden 1993/04/26).
- */
- if ((to.to_flag & TOF_TS) != 0 &&
- SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) {
- tp->ts_recent_age = tcp_now;
- tp->ts_recent = to.to_tsval;
- }
-
- if (ti->ti_len == 0) {
- if (SEQ_GT(ti->ti_ack, tp->snd_una) &&
- SEQ_LEQ(ti->ti_ack, tp->snd_max) &&
- tp->snd_cwnd >= tp->snd_wnd &&
- tp->t_dupacks < tcprexmtthresh) {
- /*
- * this is a pure ack for outstanding data.
- */
- ++tcpstat.tcps_predack;
- if ((to.to_flag & TOF_TS) != 0)
- tcp_xmit_timer(tp,
- tcp_now - to.to_tsecr + 1);
- else if (tp->t_rtt &&
- SEQ_GT(ti->ti_ack, tp->t_rtseq))
- tcp_xmit_timer(tp, tp->t_rtt);
- acked = ti->ti_ack - tp->snd_una;
- tcpstat.tcps_rcvackpack++;
- tcpstat.tcps_rcvackbyte += acked;
- sbdrop(&so->so_snd, acked);
- tp->snd_una = ti->ti_ack;
- m_freem(m);
-
- /*
- * If all outstanding data are acked, stop
- * retransmit timer, otherwise restart timer
- * using current (possibly backed-off) value.
- * If process is waiting for space,
- * wakeup/selwakeup/signal. If data
- * are ready to send, let tcp_output
- * decide between more output or persist.
- */
- if (tp->snd_una == tp->snd_max)
- tp->t_timer[TCPT_REXMT] = 0;
- else if (tp->t_timer[TCPT_PERSIST] == 0)
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
-
- if (so->so_snd.sb_flags & SB_NOTIFY)
- sowwakeup(so);
- if (so->so_snd.sb_cc)
- (void) tcp_output(tp);
- return;
- }
- } else if (ti->ti_ack == tp->snd_una &&
- tp->seg_next == (struct tcpiphdr *)tp &&
- ti->ti_len <= sbspace(&so->so_rcv)) {
- /*
- * this is a pure, in-sequence data packet
- * with nothing on the reassembly queue and
- * we have enough buffer space to take it.
- */
- ++tcpstat.tcps_preddat;
- tp->rcv_nxt += ti->ti_len;
- tcpstat.tcps_rcvpack++;
- tcpstat.tcps_rcvbyte += ti->ti_len;
- /*
- * Add data to socket buffer.
- */
- sbappend(&so->so_rcv, m);
- sorwakeup(so);
-#ifdef TCP_ACK_HACK
- /*
- * If this is a short packet, then ACK now - with Nagel
- * congestion avoidance sender won't send more until
- * he gets an ACK.
- */
- if (tiflags & TH_PUSH) {
- tp->t_flags |= TF_ACKNOW;
- tcp_output(tp);
- } else {
- tp->t_flags |= TF_DELACK;
- }
-#else
- tp->t_flags |= TF_DELACK;
-#endif
- return;
- }
- }
-
- /*
- * Calculate amount of space in receive window,
- * and then do TCP input processing.
- * Receive window is amount of space in rcv queue,
- * but not less than advertised window.
- */
- { int win;
-
- win = sbspace(&so->so_rcv);
- if (win < 0)
- win = 0;
- tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt));
- }
-
- switch (tp->t_state) {
-
- /*
- * If the state is LISTEN then ignore segment if it contains an RST.
- * If the segment contains an ACK then it is bad and send a RST.
- * If it does not contain a SYN then it is not interesting; drop it.
- * If it is from this socket, drop it, it must be forged.
- * Don't bother responding if the destination was a broadcast.
- * Otherwise initialize tp->rcv_nxt, and tp->irs, select an initial
- * tp->iss, and send a segment:
- * <SEQ=ISS><ACK=RCV_NXT><CTL=SYN,ACK>
- * Also initialize tp->snd_nxt to tp->iss+1 and tp->snd_una to tp->iss.
- * Fill in remote peer address fields if not previously specified.
- * Enter SYN_RECEIVED state, and process any other fields of this
- * segment in this state.
- */
- case TCPS_LISTEN: {
- struct mbuf *am;
- register struct sockaddr_in *sin;
-
- if (tiflags & TH_RST)
- goto drop;
- if (tiflags & TH_ACK)
- goto dropwithreset;
- if ((tiflags & TH_SYN) == 0)
- goto drop;
- if ((ti->ti_dport == ti->ti_sport) &&
- (ti->ti_dst.s_addr == ti->ti_src.s_addr))
- goto drop;
- /*
- * RFC1122 4.2.3.10, p. 104: discard bcast/mcast SYN
- * in_broadcast() should never return true on a received
- * packet with M_BCAST not set.
- */
- if (m->m_flags & (M_BCAST|M_MCAST) ||
- IN_MULTICAST(ntohl(ti->ti_dst.s_addr)))
- goto drop;
- am = m_get(M_DONTWAIT, MT_SONAME); /* XXX */
- if (am == NULL)
- goto drop;
- am->m_len = sizeof (struct sockaddr_in);
- sin = mtod(am, struct sockaddr_in *);
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_addr = ti->ti_src;
- sin->sin_port = ti->ti_sport;
- bzero((caddr_t)sin->sin_zero, sizeof(sin->sin_zero));
- laddr = inp->inp_laddr;
- if (inp->inp_laddr.s_addr == INADDR_ANY)
- inp->inp_laddr = ti->ti_dst;
- if (in_pcbconnect(inp, am)) {
- inp->inp_laddr = laddr;
- (void) m_free(am);
- goto drop;
- }
- (void) m_free(am);
- tp->t_template = tcp_template(tp);
- if (tp->t_template == 0) {
- tp = tcp_drop(tp, ENOBUFS);
- dropsocket = 0; /* socket is already gone */
- goto drop;
- }
- if ((taop = tcp_gettaocache(inp)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
- tcp_dooptions(tp, optp, optlen, ti, &to);
- if (iss)
- tp->iss = iss;
- else
- tp->iss = tcp_iss;
- tcp_iss += TCP_ISSINCR/4;
- tp->irs = ti->ti_seq;
- tcp_sendseqinit(tp);
- tcp_rcvseqinit(tp);
- /*
- * Initialization of the tcpcb for transaction;
- * set SND.WND = SEG.WND,
- * initialize CCsend and CCrecv.
- */
- tp->snd_wnd = tiwin; /* initial send-window */
- tp->cc_send = CC_INC(tcp_ccgen);
- tp->cc_recv = to.to_cc;
- /*
- * Perform TAO test on incoming CC (SEG.CC) option, if any.
- * - compare SEG.CC against cached CC from the same host,
- * if any.
- * - if SEG.CC > chached value, SYN must be new and is accepted
- * immediately: save new CC in the cache, mark the socket
- * connected, enter ESTABLISHED state, turn on flag to
- * send a SYN in the next segment.
- * A virtual advertised window is set in rcv_adv to
- * initialize SWS prevention. Then enter normal segment
- * processing: drop SYN, process data and FIN.
- * - otherwise do a normal 3-way handshake.
- */
- if ((to.to_flag & TOF_CC) != 0) {
- if (taop->tao_cc != 0 && CC_GT(to.to_cc, taop->tao_cc)) {
- taop->tao_cc = to.to_cc;
- tp->t_state = TCPS_ESTABLISHED;
-
- /*
- * If there is a FIN, or if there is data and the
- * connection is local, then delay SYN,ACK(SYN) in
- * the hope of piggy-backing it on a response
- * segment. Otherwise must send ACK now in case
- * the other side is slow starting.
- */
- if ((tiflags & TH_FIN) || (ti->ti_len != 0 &&
- in_localaddr(inp->inp_faddr)))
- tp->t_flags |= (TF_DELACK | TF_NEEDSYN);
- else
- tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN);
-
- /*
- * Limit the `virtual advertised window' to TCP_MAXWIN
- * here. Even if we requested window scaling, it will
- * become effective only later when our SYN is acked.
- */
- tp->rcv_adv += min(tp->rcv_wnd, TCP_MAXWIN);
- tcpstat.tcps_connects++;
- soisconnected(so);
- tp->t_timer[TCPT_KEEP] = tcp_keepinit;
- dropsocket = 0; /* committed to socket */
- tcpstat.tcps_accepts++;
- goto trimthenstep6;
- }
- /* else do standard 3-way handshake */
- } else {
- /*
- * No CC option, but maybe CC.NEW:
- * invalidate cached value.
- */
- taop->tao_cc = 0;
- }
- /*
- * TAO test failed or there was no CC option,
- * do a standard 3-way handshake.
- */
- tp->t_flags |= TF_ACKNOW;
- tp->t_state = TCPS_SYN_RECEIVED;
- tp->t_timer[TCPT_KEEP] = tcp_keepinit;
- dropsocket = 0; /* committed to socket */
- tcpstat.tcps_accepts++;
- goto trimthenstep6;
- }
-
- /*
- * If the state is SYN_RECEIVED:
- * if seg contains SYN/ACK, send a RST.
- * if seg contains an ACK, but not for our SYN/ACK, send a RST.
- */
- case TCPS_SYN_RECEIVED:
- if (tiflags & TH_ACK) {
- if (tiflags & TH_SYN) {
- tcpstat.tcps_badsyn++;
- goto dropwithreset;
- }
- if (SEQ_LEQ(ti->ti_ack, tp->snd_una) ||
- SEQ_GT(ti->ti_ack, tp->snd_max))
- goto dropwithreset;
- }
- break;
-
- /*
- * If the state is SYN_SENT:
- * if seg contains an ACK, but not for our SYN, drop the input.
- * if seg contains a RST, then drop the connection.
- * if seg does not contain SYN, then drop it.
- * Otherwise this is an acceptable SYN segment
- * initialize tp->rcv_nxt and tp->irs
- * if seg contains ack then advance tp->snd_una
- * if SYN has been acked change to ESTABLISHED else SYN_RCVD state
- * arrange for segment to be acked (eventually)
- * continue processing rest of data/controls, beginning with URG
- */
- case TCPS_SYN_SENT:
- if ((taop = tcp_gettaocache(inp)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
-
- if ((tiflags & TH_ACK) &&
- (SEQ_LEQ(ti->ti_ack, tp->iss) ||
- SEQ_GT(ti->ti_ack, tp->snd_max))) {
- /*
- * If we have a cached CCsent for the remote host,
- * hence we haven't just crashed and restarted,
- * do not send a RST. This may be a retransmission
- * from the other side after our earlier ACK was lost.
- * Our new SYN, when it arrives, will serve as the
- * needed ACK.
- */
- if (taop->tao_ccsent != 0)
- goto drop;
- else
- goto dropwithreset;
- }
- if (tiflags & TH_RST) {
- if (tiflags & TH_ACK)
- tp = tcp_drop(tp, ECONNREFUSED);
- goto drop;
- }
- if ((tiflags & TH_SYN) == 0)
- goto drop;
- tp->snd_wnd = ti->ti_win; /* initial send window */
- tp->cc_recv = to.to_cc; /* foreign CC */
-
- tp->irs = ti->ti_seq;
- tcp_rcvseqinit(tp);
- if (tiflags & TH_ACK) {
- /*
- * Our SYN was acked. If segment contains CC.ECHO
- * option, check it to make sure this segment really
- * matches our SYN. If not, just drop it as old
- * duplicate, but send an RST if we're still playing
- * by the old rules. If no CC.ECHO option, make sure
- * we don't get fooled into using T/TCP.
- */
- if (to.to_flag & TOF_CCECHO) {
- if (tp->cc_send != to.to_ccecho)
- if (taop->tao_ccsent != 0)
- goto drop;
- else
- goto dropwithreset;
- } else
- tp->t_flags &= ~TF_RCVD_CC;
- tcpstat.tcps_connects++;
- soisconnected(so);
- /* Do window scaling on this connection? */
- if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
- (TF_RCVD_SCALE|TF_REQ_SCALE)) {
- tp->snd_scale = tp->requested_s_scale;
- tp->rcv_scale = tp->request_r_scale;
- }
- /* Segment is acceptable, update cache if undefined. */
- if (taop->tao_ccsent == 0)
- taop->tao_ccsent = to.to_ccecho;
-
- tp->rcv_adv += tp->rcv_wnd;
- tp->snd_una++; /* SYN is acked */
- /*
- * If there's data, delay ACK; if there's also a FIN
- * ACKNOW will be turned on later.
- */
- if (ti->ti_len != 0)
- tp->t_flags |= TF_DELACK;
- else
- tp->t_flags |= TF_ACKNOW;
- /*
- * Received <SYN,ACK> in SYN_SENT[*] state.
- * Transitions:
- * SYN_SENT --> ESTABLISHED
- * SYN_SENT* --> FIN_WAIT_1
- */
- if (tp->t_flags & TF_NEEDFIN) {
- tp->t_state = TCPS_FIN_WAIT_1;
- tp->t_flags &= ~TF_NEEDFIN;
- tiflags &= ~TH_SYN;
- } else {
- tp->t_state = TCPS_ESTABLISHED;
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- }
- } else {
- /*
- * Received initial SYN in SYN-SENT[*] state => simul-
- * taneous open. If segment contains CC option and there is
- * a cached CC, apply TAO test; if it succeeds, connection is
- * half-synchronized. Otherwise, do 3-way handshake:
- * SYN-SENT -> SYN-RECEIVED
- * SYN-SENT* -> SYN-RECEIVED*
- * If there was no CC option, clear cached CC value.
- */
- tp->t_flags |= TF_ACKNOW;
- tp->t_timer[TCPT_REXMT] = 0;
- if (to.to_flag & TOF_CC) {
- if (taop->tao_cc != 0 &&
- CC_GT(to.to_cc, taop->tao_cc)) {
- /*
- * update cache and make transition:
- * SYN-SENT -> ESTABLISHED*
- * SYN-SENT* -> FIN-WAIT-1*
- */
- taop->tao_cc = to.to_cc;
- if (tp->t_flags & TF_NEEDFIN) {
- tp->t_state = TCPS_FIN_WAIT_1;
- tp->t_flags &= ~TF_NEEDFIN;
- } else {
- tp->t_state = TCPS_ESTABLISHED;
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- }
- tp->t_flags |= TF_NEEDSYN;
- } else
- tp->t_state = TCPS_SYN_RECEIVED;
- } else {
- /* CC.NEW or no option => invalidate cache */
- taop->tao_cc = 0;
- tp->t_state = TCPS_SYN_RECEIVED;
- }
- }
-
-trimthenstep6:
- /*
- * Advance ti->ti_seq to correspond to first data byte.
- * If data, trim to stay within window,
- * dropping FIN if necessary.
- */
- ti->ti_seq++;
- if (ti->ti_len > tp->rcv_wnd) {
- todrop = ti->ti_len - tp->rcv_wnd;
- m_adj(m, -todrop);
- ti->ti_len = tp->rcv_wnd;
- tiflags &= ~TH_FIN;
- tcpstat.tcps_rcvpackafterwin++;
- tcpstat.tcps_rcvbyteafterwin += todrop;
- }
- tp->snd_wl1 = ti->ti_seq - 1;
- tp->rcv_up = ti->ti_seq;
- /*
- * Client side of transaction: already sent SYN and data.
- * If the remote host used T/TCP to validate the SYN,
- * our data will be ACK'd; if so, enter normal data segment
- * processing in the middle of step 5, ack processing.
- * Otherwise, goto step 6.
- */
- if (tiflags & TH_ACK)
- goto process_ACK;
- goto step6;
- /*
- * If the state is LAST_ACK or CLOSING or TIME_WAIT:
- * if segment contains a SYN and CC [not CC.NEW] option:
- * if state == TIME_WAIT and connection duration > MSL,
- * drop packet and send RST;
- *
- * if SEG.CC > CCrecv then is new SYN, and can implicitly
- * ack the FIN (and data) in retransmission queue.
- * Complete close and delete TCPCB. Then reprocess
- * segment, hoping to find new TCPCB in LISTEN state;
- *
- * else must be old SYN; drop it.
- * else do normal processing.
- */
- case TCPS_LAST_ACK:
- case TCPS_CLOSING:
- case TCPS_TIME_WAIT:
- if ((tiflags & TH_SYN) &&
- (to.to_flag & TOF_CC) && tp->cc_recv != 0) {
- if (tp->t_state == TCPS_TIME_WAIT &&
- tp->t_duration > TCPTV_MSL)
- goto dropwithreset;
- if (CC_GT(to.to_cc, tp->cc_recv)) {
- tp = tcp_close(tp);
- goto findpcb;
- }
- else
- goto drop;
- }
- break; /* continue normal processing */
- }
-
- /*
- * States other than LISTEN or SYN_SENT.
- * First check timestamp, if present.
- * Then check the connection count, if present.
- * Then check that at least some bytes of segment are within
- * receive window. If segment begins before rcv_nxt,
- * drop leading data (and SYN); if nothing left, just ack.
- *
- * RFC 1323 PAWS: If we have a timestamp reply on this segment
- * and it's less than ts_recent, drop it.
- */
- if ((to.to_flag & TOF_TS) != 0 && (tiflags & TH_RST) == 0 &&
- tp->ts_recent && TSTMP_LT(to.to_tsval, tp->ts_recent)) {
-
- /* Check to see if ts_recent is over 24 days old. */
- if ((int)(tcp_now - tp->ts_recent_age) > TCP_PAWS_IDLE) {
- /*
- * Invalidate ts_recent. If this segment updates
- * ts_recent, the age will be reset later and ts_recent
- * will get a valid value. If it does not, setting
- * ts_recent to zero will at least satisfy the
- * requirement that zero be placed in the timestamp
- * echo reply when ts_recent isn't valid. The
- * age isn't reset until we get a valid ts_recent
- * because we don't want out-of-order segments to be
- * dropped when ts_recent is old.
- */
- tp->ts_recent = 0;
- } else {
- tcpstat.tcps_rcvduppack++;
- tcpstat.tcps_rcvdupbyte += ti->ti_len;
- tcpstat.tcps_pawsdrop++;
- goto dropafterack;
- }
- }
-
- /*
- * T/TCP mechanism
- * If T/TCP was negotiated and the segment doesn't have CC,
- * or if it's CC is wrong then drop the segment.
- * RST segments do not have to comply with this.
- */
- if ((tp->t_flags & (TF_REQ_CC|TF_RCVD_CC)) == (TF_REQ_CC|TF_RCVD_CC) &&
- ((to.to_flag & TOF_CC) == 0 || tp->cc_recv != to.to_cc) &&
- (tiflags & TH_RST) == 0)
- goto dropafterack;
-
- todrop = tp->rcv_nxt - ti->ti_seq;
- if (todrop > 0) {
- if (tiflags & TH_SYN) {
- tiflags &= ~TH_SYN;
- ti->ti_seq++;
- if (ti->ti_urp > 1)
- ti->ti_urp--;
- else
- tiflags &= ~TH_URG;
- todrop--;
- }
- /*
- * Following if statement from Stevens, vol. 2, p. 960.
- */
- if (todrop > ti->ti_len
- || (todrop == ti->ti_len && (tiflags & TH_FIN) == 0)) {
- /*
- * Any valid FIN must be to the left of the window.
- * At this point the FIN must be a duplicate or out
- * of sequence; drop it.
- */
- tiflags &= ~TH_FIN;
-
- /*
- * Send an ACK to resynchronize and drop any data.
- * But keep on processing for RST or ACK.
- */
- tp->t_flags |= TF_ACKNOW;
- todrop = ti->ti_len;
- tcpstat.tcps_rcvduppack++;
- tcpstat.tcps_rcvdupbyte += todrop;
- } else {
- tcpstat.tcps_rcvpartduppack++;
- tcpstat.tcps_rcvpartdupbyte += todrop;
- }
- m_adj(m, todrop);
- ti->ti_seq += todrop;
- ti->ti_len -= todrop;
- if (ti->ti_urp > todrop)
- ti->ti_urp -= todrop;
- else {
- tiflags &= ~TH_URG;
- ti->ti_urp = 0;
- }
- }
-
- /*
- * If new data are received on a connection after the
- * user processes are gone, then RST the other end.
- */
- if ((so->so_state & SS_NOFDREF) &&
- tp->t_state > TCPS_CLOSE_WAIT && ti->ti_len) {
- tp = tcp_close(tp);
- tcpstat.tcps_rcvafterclose++;
- goto dropwithreset;
- }
-
- /*
- * If segment ends after window, drop trailing data
- * (and PUSH and FIN); if nothing left, just ACK.
- */
- todrop = (ti->ti_seq+ti->ti_len) - (tp->rcv_nxt+tp->rcv_wnd);
- if (todrop > 0) {
- tcpstat.tcps_rcvpackafterwin++;
- if (todrop >= ti->ti_len) {
- tcpstat.tcps_rcvbyteafterwin += ti->ti_len;
- /*
- * If a new connection request is received
- * while in TIME_WAIT, drop the old connection
- * and start over if the sequence numbers
- * are above the previous ones.
- */
- if (tiflags & TH_SYN &&
- tp->t_state == TCPS_TIME_WAIT &&
- SEQ_GT(ti->ti_seq, tp->rcv_nxt)) {
- iss = tp->rcv_nxt + TCP_ISSINCR;
- tp = tcp_close(tp);
- goto findpcb;
- }
- /*
- * If window is closed can only take segments at
- * window edge, and have to drop data and PUSH from
- * incoming segments. Continue processing, but
- * remember to ack. Otherwise, drop segment
- * and ack.
- */
- if (tp->rcv_wnd == 0 && ti->ti_seq == tp->rcv_nxt) {
- tp->t_flags |= TF_ACKNOW;
- tcpstat.tcps_rcvwinprobe++;
- } else
- goto dropafterack;
- } else
- tcpstat.tcps_rcvbyteafterwin += todrop;
- m_adj(m, -todrop);
- ti->ti_len -= todrop;
- tiflags &= ~(TH_PUSH|TH_FIN);
- }
-
- /*
- * If last ACK falls within this segment's sequence numbers,
- * record its timestamp.
- * NOTE that the test is modified according to the latest
- * proposal of the tcplw@cray.com list (Braden 1993/04/26).
- */
- if ((to.to_flag & TOF_TS) != 0 &&
- SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) {
- tp->ts_recent_age = tcp_now;
- tp->ts_recent = to.to_tsval;
- }
-
- /*
- * If the RST bit is set examine the state:
- * SYN_RECEIVED STATE:
- * If passive open, return to LISTEN state.
- * If active open, inform user that connection was refused.
- * ESTABLISHED, FIN_WAIT_1, FIN_WAIT2, CLOSE_WAIT STATES:
- * Inform user that connection was reset, and close tcb.
- * CLOSING, LAST_ACK, TIME_WAIT STATES
- * Close the tcb.
- */
- if (tiflags&TH_RST) switch (tp->t_state) {
-
- case TCPS_SYN_RECEIVED:
- so->so_error = ECONNREFUSED;
- goto close;
-
- case TCPS_ESTABLISHED:
- case TCPS_FIN_WAIT_1:
- case TCPS_FIN_WAIT_2:
- case TCPS_CLOSE_WAIT:
- so->so_error = ECONNRESET;
- close:
- tp->t_state = TCPS_CLOSED;
- tcpstat.tcps_drops++;
- tp = tcp_close(tp);
- goto drop;
-
- case TCPS_CLOSING:
- case TCPS_LAST_ACK:
- case TCPS_TIME_WAIT:
- tp = tcp_close(tp);
- goto drop;
- }
-
- /*
- * If a SYN is in the window, then this is an
- * error and we send an RST and drop the connection.
- */
- if (tiflags & TH_SYN) {
- tp = tcp_drop(tp, ECONNRESET);
- goto dropwithreset;
- }
-
- /*
- * If the ACK bit is off: if in SYN-RECEIVED state or SENDSYN
- * flag is on (half-synchronized state), then queue data for
- * later processing; else drop segment and return.
- */
- if ((tiflags & TH_ACK) == 0) {
- if (tp->t_state == TCPS_SYN_RECEIVED ||
- (tp->t_flags & TF_NEEDSYN))
- goto step6;
- else
- goto drop;
- }
-
- /*
- * Ack processing.
- */
- switch (tp->t_state) {
-
- /*
- * In SYN_RECEIVED state, the ack ACKs our SYN, so enter
- * ESTABLISHED state and continue processing.
- * The ACK was checked above.
- */
- case TCPS_SYN_RECEIVED:
-
- tcpstat.tcps_connects++;
- soisconnected(so);
- /* Do window scaling? */
- if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
- (TF_RCVD_SCALE|TF_REQ_SCALE)) {
- tp->snd_scale = tp->requested_s_scale;
- tp->rcv_scale = tp->request_r_scale;
- }
- /*
- * Upon successful completion of 3-way handshake,
- * update cache.CC if it was undefined, pass any queued
- * data to the user, and advance state appropriately.
- */
- if ((taop = tcp_gettaocache(inp)) != NULL &&
- taop->tao_cc == 0)
- taop->tao_cc = tp->cc_recv;
-
- /*
- * Make transitions:
- * SYN-RECEIVED -> ESTABLISHED
- * SYN-RECEIVED* -> FIN-WAIT-1
- */
- if (tp->t_flags & TF_NEEDFIN) {
- tp->t_state = TCPS_FIN_WAIT_1;
- tp->t_flags &= ~TF_NEEDFIN;
- } else {
- tp->t_state = TCPS_ESTABLISHED;
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- }
- /*
- * If segment contains data or ACK, will call tcp_reass()
- * later; if not, do so now to pass queued data to user.
- */
- if (ti->ti_len == 0 && (tiflags & TH_FIN) == 0)
- (void) tcp_reass(tp, (struct tcpiphdr *)0,
- (struct mbuf *)0);
- tp->snd_wl1 = ti->ti_seq - 1;
- /* fall into ... */
-
- /*
- * In ESTABLISHED state: drop duplicate ACKs; ACK out of range
- * ACKs. If the ack is in the range
- * tp->snd_una < ti->ti_ack <= tp->snd_max
- * then advance tp->snd_una to ti->ti_ack and drop
- * data from the retransmission queue. If this ACK reflects
- * more up to date window information we update our window information.
- */
- case TCPS_ESTABLISHED:
- case TCPS_FIN_WAIT_1:
- case TCPS_FIN_WAIT_2:
- case TCPS_CLOSE_WAIT:
- case TCPS_CLOSING:
- case TCPS_LAST_ACK:
- case TCPS_TIME_WAIT:
-
- if (SEQ_LEQ(ti->ti_ack, tp->snd_una)) {
- if (ti->ti_len == 0 && tiwin == tp->snd_wnd) {
- tcpstat.tcps_rcvdupack++;
- /*
- * If we have outstanding data (other than
- * a window probe), this is a completely
- * duplicate ack (ie, window info didn't
- * change), the ack is the biggest we've
- * seen and we've seen exactly our rexmt
- * threshhold of them, assume a packet
- * has been dropped and retransmit it.
- * Kludge snd_nxt & the congestion
- * window so we send only this one
- * packet.
- *
- * We know we're losing at the current
- * window size so do congestion avoidance
- * (set ssthresh to half the current window
- * and pull our congestion window back to
- * the new ssthresh).
- *
- * Dup acks mean that packets have left the
- * network (they're now cached at the receiver)
- * so bump cwnd by the amount in the receiver
- * to keep a constant cwnd packets in the
- * network.
- */
- if (tp->t_timer[TCPT_REXMT] == 0 ||
- ti->ti_ack != tp->snd_una)
- tp->t_dupacks = 0;
- else if (++tp->t_dupacks == tcprexmtthresh) {
- tcp_seq onxt = tp->snd_nxt;
- u_int win =
- min(tp->snd_wnd, tp->snd_cwnd) / 2 /
- tp->t_maxseg;
-
- if (win < 2)
- win = 2;
- tp->snd_ssthresh = win * tp->t_maxseg;
- tp->t_timer[TCPT_REXMT] = 0;
- tp->t_rtt = 0;
- tp->snd_nxt = ti->ti_ack;
- tp->snd_cwnd = tp->t_maxseg;
- (void) tcp_output(tp);
- tp->snd_cwnd = tp->snd_ssthresh +
- tp->t_maxseg * tp->t_dupacks;
- if (SEQ_GT(onxt, tp->snd_nxt))
- tp->snd_nxt = onxt;
- goto drop;
- } else if (tp->t_dupacks > tcprexmtthresh) {
- tp->snd_cwnd += tp->t_maxseg;
- (void) tcp_output(tp);
- goto drop;
- }
- } else
- tp->t_dupacks = 0;
- break;
- }
- /*
- * If the congestion window was inflated to account
- * for the other side's cached packets, retract it.
- */
- if (tp->t_dupacks >= tcprexmtthresh &&
- tp->snd_cwnd > tp->snd_ssthresh)
- tp->snd_cwnd = tp->snd_ssthresh;
- tp->t_dupacks = 0;
- if (SEQ_GT(ti->ti_ack, tp->snd_max)) {
- tcpstat.tcps_rcvacktoomuch++;
- goto dropafterack;
- }
- /*
- * If we reach this point, ACK is not a duplicate,
- * i.e., it ACKs something we sent.
- */
- if (tp->t_flags & TF_NEEDSYN) {
- /*
- * T/TCP: Connection was half-synchronized, and our
- * SYN has been ACK'd (so connection is now fully
- * synchronized). Go to non-starred state,
- * increment snd_una for ACK of SYN, and check if
- * we can do window scaling.
- */
- tp->t_flags &= ~TF_NEEDSYN;
- tp->snd_una++;
- /* Do window scaling? */
- if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
- (TF_RCVD_SCALE|TF_REQ_SCALE)) {
- tp->snd_scale = tp->requested_s_scale;
- tp->rcv_scale = tp->request_r_scale;
- }
- }
-
-process_ACK:
- acked = ti->ti_ack - tp->snd_una;
- tcpstat.tcps_rcvackpack++;
- tcpstat.tcps_rcvackbyte += acked;
-
- /*
- * If we have a timestamp reply, update smoothed
- * round trip time. If no timestamp is present but
- * transmit timer is running and timed sequence
- * number was acked, update smoothed round trip time.
- * Since we now have an rtt measurement, cancel the
- * timer backoff (cf., Phil Karn's retransmit alg.).
- * Recompute the initial retransmit timer.
- */
- if (to.to_flag & TOF_TS)
- tcp_xmit_timer(tp, tcp_now - to.to_tsecr + 1);
- else if (tp->t_rtt && SEQ_GT(ti->ti_ack, tp->t_rtseq))
- tcp_xmit_timer(tp,tp->t_rtt);
-
- /*
- * If all outstanding data is acked, stop retransmit
- * timer and remember to restart (more output or persist).
- * If there is more data to be acked, restart retransmit
- * timer, using current (possibly backed-off) value.
- */
- if (ti->ti_ack == tp->snd_max) {
- tp->t_timer[TCPT_REXMT] = 0;
- needoutput = 1;
- } else if (tp->t_timer[TCPT_PERSIST] == 0)
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
-
- /*
- * If no data (only SYN) was ACK'd,
- * skip rest of ACK processing.
- */
- if (acked == 0)
- goto step6;
-
- /*
- * When new data is acked, open the congestion window.
- * If the window gives us less than ssthresh packets
- * in flight, open exponentially (maxseg per packet).
- * Otherwise open linearly: maxseg per window
- * (maxseg^2 / cwnd per packet).
- */
- {
- register u_int cw = tp->snd_cwnd;
- register u_int incr = tp->t_maxseg;
-
- if (cw > tp->snd_ssthresh)
- incr = incr * incr / cw;
- tp->snd_cwnd = min(cw + incr, TCP_MAXWIN<<tp->snd_scale);
- }
- if (acked > so->so_snd.sb_cc) {
- tp->snd_wnd -= so->so_snd.sb_cc;
- sbdrop(&so->so_snd, (int)so->so_snd.sb_cc);
- ourfinisacked = 1;
- } else {
- sbdrop(&so->so_snd, acked);
- tp->snd_wnd -= acked;
- ourfinisacked = 0;
- }
- if (so->so_snd.sb_flags & SB_NOTIFY)
- sowwakeup(so);
- tp->snd_una = ti->ti_ack;
- if (SEQ_LT(tp->snd_nxt, tp->snd_una))
- tp->snd_nxt = tp->snd_una;
-
- switch (tp->t_state) {
-
- /*
- * In FIN_WAIT_1 STATE in addition to the processing
- * for the ESTABLISHED state if our FIN is now acknowledged
- * then enter FIN_WAIT_2.
- */
- case TCPS_FIN_WAIT_1:
- if (ourfinisacked) {
- /*
- * If we can't receive any more
- * data, then closing user can proceed.
- * Starting the timer is contrary to the
- * specification, but if we don't get a FIN
- * we'll hang forever.
- */
- if (so->so_state & SS_CANTRCVMORE) {
- soisdisconnected(so);
- tp->t_timer[TCPT_2MSL] = tcp_maxidle;
- }
- tp->t_state = TCPS_FIN_WAIT_2;
- }
- break;
-
- /*
- * In CLOSING STATE in addition to the processing for
- * the ESTABLISHED state if the ACK acknowledges our FIN
- * then enter the TIME-WAIT state, otherwise ignore
- * the segment.
- */
- case TCPS_CLOSING:
- if (ourfinisacked) {
- tp->t_state = TCPS_TIME_WAIT;
- tcp_canceltimers(tp);
- /* Shorten TIME_WAIT [RFC-1644, p.28] */
- if (tp->cc_recv != 0 &&
- tp->t_duration < TCPTV_MSL)
- tp->t_timer[TCPT_2MSL] =
- tp->t_rxtcur * TCPTV_TWTRUNC;
- else
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- soisdisconnected(so);
- }
- break;
-
- /*
- * In LAST_ACK, we may still be waiting for data to drain
- * and/or to be acked, as well as for the ack of our FIN.
- * If our FIN is now acknowledged, delete the TCB,
- * enter the closed state and return.
- */
- case TCPS_LAST_ACK:
- if (ourfinisacked) {
- tp = tcp_close(tp);
- goto drop;
- }
- break;
-
- /*
- * In TIME_WAIT state the only thing that should arrive
- * is a retransmission of the remote FIN. Acknowledge
- * it and restart the finack timer.
- */
- case TCPS_TIME_WAIT:
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- goto dropafterack;
- }
- }
-
-step6:
- /*
- * Update window information.
- * Don't look at window if no ACK: TAC's send garbage on first SYN.
- */
- if ((tiflags & TH_ACK) &&
- (SEQ_LT(tp->snd_wl1, ti->ti_seq) ||
- (tp->snd_wl1 == ti->ti_seq && (SEQ_LT(tp->snd_wl2, ti->ti_ack) ||
- (tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd))))) {
- /* keep track of pure window updates */
- if (ti->ti_len == 0 &&
- tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd)
- tcpstat.tcps_rcvwinupd++;
- tp->snd_wnd = tiwin;
- tp->snd_wl1 = ti->ti_seq;
- tp->snd_wl2 = ti->ti_ack;
- if (tp->snd_wnd > tp->max_sndwnd)
- tp->max_sndwnd = tp->snd_wnd;
- needoutput = 1;
- }
-
- /*
- * Process segments with URG.
- */
- if ((tiflags & TH_URG) && ti->ti_urp &&
- TCPS_HAVERCVDFIN(tp->t_state) == 0) {
- /*
- * This is a kludge, but if we receive and accept
- * random urgent pointers, we'll crash in
- * soreceive. It's hard to imagine someone
- * actually wanting to send this much urgent data.
- */
- if (ti->ti_urp + so->so_rcv.sb_cc > sb_max) {
- ti->ti_urp = 0; /* XXX */
- tiflags &= ~TH_URG; /* XXX */
- goto dodata; /* XXX */
- }
- /*
- * If this segment advances the known urgent pointer,
- * then mark the data stream. This should not happen
- * in CLOSE_WAIT, CLOSING, LAST_ACK or TIME_WAIT STATES since
- * a FIN has been received from the remote side.
- * In these states we ignore the URG.
- *
- * According to RFC961 (Assigned Protocols),
- * the urgent pointer points to the last octet
- * of urgent data. We continue, however,
- * to consider it to indicate the first octet
- * of data past the urgent section as the original
- * spec states (in one of two places).
- */
- if (SEQ_GT(ti->ti_seq+ti->ti_urp, tp->rcv_up)) {
- tp->rcv_up = ti->ti_seq + ti->ti_urp;
- so->so_oobmark = so->so_rcv.sb_cc +
- (tp->rcv_up - tp->rcv_nxt) - 1;
- if (so->so_oobmark == 0)
- so->so_state |= SS_RCVATMARK;
- sohasoutofband(so);
- tp->t_oobflags &= ~(TCPOOB_HAVEDATA | TCPOOB_HADDATA);
- }
- /*
- * Remove out of band data so doesn't get presented to user.
- * This can happen independent of advancing the URG pointer,
- * but if two URG's are pending at once, some out-of-band
- * data may creep in... ick.
- */
- if (ti->ti_urp <= (u_long)ti->ti_len
-#ifdef SO_OOBINLINE
- && (so->so_options & SO_OOBINLINE) == 0
-#endif
- )
- tcp_pulloutofband(so, ti, m);
- } else
- /*
- * If no out of band data is expected,
- * pull receive urgent pointer along
- * with the receive window.
- */
- if (SEQ_GT(tp->rcv_nxt, tp->rcv_up))
- tp->rcv_up = tp->rcv_nxt;
-dodata: /* XXX */
-
- /*
- * Process the segment text, merging it into the TCP sequencing queue,
- * and arranging for acknowledgment of receipt if necessary.
- * This process logically involves adjusting tp->rcv_wnd as data
- * is presented to the user (this happens in tcp_usrreq.c,
- * case PRU_RCVD). If a FIN has already been received on this
- * connection then we just ignore the text.
- */
- if ((ti->ti_len || (tiflags&TH_FIN)) &&
- TCPS_HAVERCVDFIN(tp->t_state) == 0) {
- TCP_REASS(tp, ti, m, so, tiflags);
- /*
- * Note the amount of data that peer has sent into
- * our window, in order to estimate the sender's
- * buffer size.
- */
- len = so->so_rcv.sb_hiwat - (tp->rcv_adv - tp->rcv_nxt);
- } else {
- m_freem(m);
- tiflags &= ~TH_FIN;
- }
-
- /*
- * If FIN is received ACK the FIN and let the user know
- * that the connection is closing.
- */
- if (tiflags & TH_FIN) {
- if (TCPS_HAVERCVDFIN(tp->t_state) == 0) {
- socantrcvmore(so);
- /*
- * If connection is half-synchronized
- * (ie NEEDSYN flag on) then delay ACK,
- * so it may be piggybacked when SYN is sent.
- * Otherwise, since we received a FIN then no
- * more input can be expected, send ACK now.
- */
- if (tp->t_flags & TF_NEEDSYN)
- tp->t_flags |= TF_DELACK;
- else
- tp->t_flags |= TF_ACKNOW;
- tp->rcv_nxt++;
- }
- switch (tp->t_state) {
-
- /*
- * In SYN_RECEIVED and ESTABLISHED STATES
- * enter the CLOSE_WAIT state.
- */
- case TCPS_SYN_RECEIVED:
- case TCPS_ESTABLISHED:
- tp->t_state = TCPS_CLOSE_WAIT;
- break;
-
- /*
- * If still in FIN_WAIT_1 STATE FIN has not been acked so
- * enter the CLOSING state.
- */
- case TCPS_FIN_WAIT_1:
- tp->t_state = TCPS_CLOSING;
- break;
-
- /*
- * In FIN_WAIT_2 state enter the TIME_WAIT state,
- * starting the time-wait timer, turning off the other
- * standard timers.
- */
- case TCPS_FIN_WAIT_2:
- tp->t_state = TCPS_TIME_WAIT;
- tcp_canceltimers(tp);
- /* Shorten TIME_WAIT [RFC-1644, p.28] */
- if (tp->cc_recv != 0 &&
- tp->t_duration < TCPTV_MSL) {
- tp->t_timer[TCPT_2MSL] =
- tp->t_rxtcur * TCPTV_TWTRUNC;
- /* For transaction client, force ACK now. */
- tp->t_flags |= TF_ACKNOW;
- }
- else
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- soisdisconnected(so);
- break;
-
- /*
- * In TIME_WAIT state restart the 2 MSL time_wait timer.
- */
- case TCPS_TIME_WAIT:
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- break;
- }
- }
-#ifdef TCPDEBUG
- if (so->so_options & SO_DEBUG)
- tcp_trace(TA_INPUT, ostate, tp, &tcp_saveti, 0);
-#endif
-
- /*
- * Return any desired output.
- */
- if (needoutput || (tp->t_flags & TF_ACKNOW))
- (void) tcp_output(tp);
- return;
-
-dropafterack:
- /*
- * Generate an ACK dropping incoming segment if it occupies
- * sequence space, where the ACK reflects our state.
- */
- if (tiflags & TH_RST)
- goto drop;
-#ifdef TCPDEBUG
- if (so->so_options & SO_DEBUG)
- tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0);
-#endif
- m_freem(m);
- tp->t_flags |= TF_ACKNOW;
- (void) tcp_output(tp);
- return;
-
-dropwithreset:
- /*
- * Generate a RST, dropping incoming segment.
- * Make ACK acceptable to originator of segment.
- * Don't bother to respond if destination was broadcast/multicast.
- */
- if ((tiflags & TH_RST) || m->m_flags & (M_BCAST|M_MCAST) ||
- IN_MULTICAST(ntohl(ti->ti_dst.s_addr)))
- goto drop;
-#ifdef TCPDEBUG
- if (tp == 0 || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
- tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0);
-#endif
- if (tiflags & TH_ACK)
- tcp_respond(tp, ti, m, (tcp_seq)0, ti->ti_ack, TH_RST);
- else {
- if (tiflags & TH_SYN)
- ti->ti_len++;
- tcp_respond(tp, ti, m, ti->ti_seq+ti->ti_len, (tcp_seq)0,
- TH_RST|TH_ACK);
- }
- /* destroy temporarily created socket */
- if (dropsocket)
- (void) soabort(so);
- return;
-
-drop:
- /*
- * Drop space held by incoming segment and return.
- */
-#ifdef TCPDEBUG
- if (tp == 0 || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
- tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0);
-#endif
- m_freem(m);
- /* destroy temporarily created socket */
- if (dropsocket)
- (void) soabort(so);
- return;
-#ifndef TUBA_INCLUDE
-}
-
-static void
-tcp_dooptions(tp, cp, cnt, ti, to)
- struct tcpcb *tp;
- u_char *cp;
- int cnt;
- struct tcpiphdr *ti;
- struct tcpopt *to;
-{
- u_short mss = 0;
- int opt, optlen;
-
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[0];
- if (opt == TCPOPT_EOL)
- break;
- if (opt == TCPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[1];
- if (optlen <= 0)
- break;
- }
- switch (opt) {
-
- default:
- continue;
-
- case TCPOPT_MAXSEG:
- if (optlen != TCPOLEN_MAXSEG)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- bcopy((char *) cp + 2, (char *) &mss, sizeof(mss));
- NTOHS(mss);
- break;
-
- case TCPOPT_WINDOW:
- if (optlen != TCPOLEN_WINDOW)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- tp->t_flags |= TF_RCVD_SCALE;
- tp->requested_s_scale = min(cp[2], TCP_MAX_WINSHIFT);
- break;
-
- case TCPOPT_TIMESTAMP:
- if (optlen != TCPOLEN_TIMESTAMP)
- continue;
- to->to_flag |= TOF_TS;
- bcopy((char *)cp + 2,
- (char *)&to->to_tsval, sizeof(to->to_tsval));
- NTOHL(to->to_tsval);
- bcopy((char *)cp + 6,
- (char *)&to->to_tsecr, sizeof(to->to_tsecr));
- NTOHL(to->to_tsecr);
-
- /*
- * A timestamp received in a SYN makes
- * it ok to send timestamp requests and replies.
- */
- if (ti->ti_flags & TH_SYN) {
- tp->t_flags |= TF_RCVD_TSTMP;
- tp->ts_recent = to->to_tsval;
- tp->ts_recent_age = tcp_now;
- }
- break;
- case TCPOPT_CC:
- if (optlen != TCPOLEN_CC)
- continue;
- to->to_flag |= TOF_CC;
- bcopy((char *)cp + 2,
- (char *)&to->to_cc, sizeof(to->to_cc));
- NTOHL(to->to_cc);
- /*
- * A CC or CC.new option received in a SYN makes
- * it ok to send CC in subsequent segments.
- */
- if (ti->ti_flags & TH_SYN)
- tp->t_flags |= TF_RCVD_CC;
- break;
- case TCPOPT_CCNEW:
- if (optlen != TCPOLEN_CC)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- to->to_flag |= TOF_CCNEW;
- bcopy((char *)cp + 2,
- (char *)&to->to_cc, sizeof(to->to_cc));
- NTOHL(to->to_cc);
- /*
- * A CC or CC.new option received in a SYN makes
- * it ok to send CC in subsequent segments.
- */
- tp->t_flags |= TF_RCVD_CC;
- break;
- case TCPOPT_CCECHO:
- if (optlen != TCPOLEN_CC)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- to->to_flag |= TOF_CCECHO;
- bcopy((char *)cp + 2,
- (char *)&to->to_ccecho, sizeof(to->to_ccecho));
- NTOHL(to->to_ccecho);
- break;
- }
- }
- if (ti->ti_flags & TH_SYN)
- tcp_mss(tp, mss); /* sets t_maxseg */
-}
-
-/*
- * Pull out of band byte out of a segment so
- * it doesn't appear in the user's data queue.
- * It is still reflected in the segment length for
- * sequencing purposes.
- */
-static void
-tcp_pulloutofband(so, ti, m)
- struct socket *so;
- struct tcpiphdr *ti;
- register struct mbuf *m;
-{
- int cnt = ti->ti_urp - 1;
-
- while (cnt >= 0) {
- if (m->m_len > cnt) {
- char *cp = mtod(m, caddr_t) + cnt;
- struct tcpcb *tp = sototcpcb(so);
-
- tp->t_iobc = *cp;
- tp->t_oobflags |= TCPOOB_HAVEDATA;
- bcopy(cp+1, cp, (unsigned)(m->m_len - cnt - 1));
- m->m_len--;
- return;
- }
- cnt -= m->m_len;
- m = m->m_next;
- if (m == 0)
- break;
- }
- panic("tcp_pulloutofband");
-}
-
-/*
- * Collect new round-trip time estimate
- * and update averages and current timeout.
- */
-static void
-tcp_xmit_timer(tp, rtt)
- register struct tcpcb *tp;
- short rtt;
-{
- register int delta;
-
- tcpstat.tcps_rttupdated++;
- tp->t_rttupdated++;
- if (tp->t_srtt != 0) {
- /*
- * srtt is stored as fixed point with 5 bits after the
- * binary point (i.e., scaled by 8). The following magic
- * is equivalent to the smoothing algorithm in rfc793 with
- * an alpha of .875 (srtt = rtt/8 + srtt*7/8 in fixed
- * point). Adjust rtt to origin 0.
- */
- delta = ((rtt - 1) << TCP_DELTA_SHIFT)
- - (tp->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT));
-
- if ((tp->t_srtt += delta) <= 0)
- tp->t_srtt = 1;
-
- /*
- * We accumulate a smoothed rtt variance (actually, a
- * smoothed mean difference), then set the retransmit
- * timer to smoothed rtt + 4 times the smoothed variance.
- * rttvar is stored as fixed point with 4 bits after the
- * binary point (scaled by 16). The following is
- * equivalent to rfc793 smoothing with an alpha of .75
- * (rttvar = rttvar*3/4 + |delta| / 4). This replaces
- * rfc793's wired-in beta.
- */
- if (delta < 0)
- delta = -delta;
- delta -= tp->t_rttvar >> (TCP_RTTVAR_SHIFT - TCP_DELTA_SHIFT);
- if ((tp->t_rttvar += delta) <= 0)
- tp->t_rttvar = 1;
- } else {
- /*
- * No rtt measurement yet - use the unsmoothed rtt.
- * Set the variance to half the rtt (so our first
- * retransmit happens at 3*rtt).
- */
- tp->t_srtt = rtt << TCP_RTT_SHIFT;
- tp->t_rttvar = rtt << (TCP_RTTVAR_SHIFT - 1);
- }
- tp->t_rtt = 0;
- tp->t_rxtshift = 0;
-
- /*
- * the retransmit should happen at rtt + 4 * rttvar.
- * Because of the way we do the smoothing, srtt and rttvar
- * will each average +1/2 tick of bias. When we compute
- * the retransmit timer, we want 1/2 tick of rounding and
- * 1 extra tick because of +-1/2 tick uncertainty in the
- * firing of the timer. The bias will give us exactly the
- * 1.5 tick we need. But, because the bias is
- * statistical, we have to test that we don't drop below
- * the minimum feasible timer (which is 2 ticks).
- */
- TCPT_RANGESET(tp->t_rxtcur, TCP_REXMTVAL(tp),
- max(tp->t_rttmin, rtt + 2), TCPTV_REXMTMAX);
-
- /*
- * We received an ack for a packet that wasn't retransmitted;
- * it is probably safe to discard any error indications we've
- * received recently. This isn't quite right, but close enough
- * for now (a route might have failed after we sent a segment,
- * and the return path might not be symmetrical).
- */
- tp->t_softerror = 0;
-}
-
-/*
- * Determine a reasonable value for maxseg size.
- * If the route is known, check route for mtu.
- * If none, use an mss that can be handled on the outgoing
- * interface without forcing IP to fragment; if bigger than
- * an mbuf cluster (MCLBYTES), round down to nearest multiple of MCLBYTES
- * to utilize large mbufs. If no route is found, route has no mtu,
- * or the destination isn't local, use a default, hopefully conservative
- * size (usually 512 or the default IP max size, but no more than the mtu
- * of the interface), as we can't discover anything about intervening
- * gateways or networks. We also initialize the congestion/slow start
- * window to be a single segment if the destination isn't local.
- * While looking at the routing entry, we also initialize other path-dependent
- * parameters from pre-set or cached values in the routing entry.
- *
- * Also take into account the space needed for options that we
- * send regularly. Make maxseg shorter by that amount to assure
- * that we can send maxseg amount of data even when the options
- * are present. Store the upper limit of the length of options plus
- * data in maxopd.
- *
- * NOTE that this routine is only called when we process an incoming
- * segment, for outgoing segments only tcp_mssopt is called.
- *
- * In case of T/TCP, we call this routine during implicit connection
- * setup as well (offer = -1), to initialize maxseg from the cached
- * MSS of our peer.
- */
-void
-tcp_mss(tp, offer)
- struct tcpcb *tp;
- int offer;
-{
- register struct rtentry *rt;
- struct ifnet *ifp;
- register int rtt, mss;
- u_long bufsize;
- struct inpcb *inp;
- struct socket *so;
- struct rmxp_tao *taop;
- int origoffer = offer;
-
- inp = tp->t_inpcb;
- if ((rt = tcp_rtlookup(inp)) == NULL) {
- tp->t_maxopd = tp->t_maxseg = tcp_mssdflt;
- return;
- }
- ifp = rt->rt_ifp;
- so = inp->inp_socket;
-
- taop = rmx_taop(rt->rt_rmx);
- /*
- * Offer == -1 means that we didn't receive SYN yet,
- * use cached value in that case;
- */
- if (offer == -1)
- offer = taop->tao_mssopt;
- /*
- * Offer == 0 means that there was no MSS on the SYN segment,
- * in this case we use tcp_mssdflt.
- */
- if (offer == 0)
- offer = tcp_mssdflt;
- else
- /*
- * Sanity check: make sure that maxopd will be large
- * enough to allow some data on segments even is the
- * all the option space is used (40bytes). Otherwise
- * funny things may happen in tcp_output.
- */
- offer = max(offer, 64);
- taop->tao_mssopt = offer;
-
- /*
- * While we're here, check if there's an initial rtt
- * or rttvar. Convert from the route-table units
- * to scaled multiples of the slow timeout timer.
- */
- if (tp->t_srtt == 0 && (rtt = rt->rt_rmx.rmx_rtt)) {
- /*
- * XXX the lock bit for RTT indicates that the value
- * is also a minimum value; this is subject to time.
- */
- if (rt->rt_rmx.rmx_locks & RTV_RTT)
- tp->t_rttmin = rtt / (RTM_RTTUNIT / PR_SLOWHZ);
- tp->t_srtt = rtt / (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTT_SCALE));
- tcpstat.tcps_usedrtt++;
- if (rt->rt_rmx.rmx_rttvar) {
- tp->t_rttvar = rt->rt_rmx.rmx_rttvar /
- (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTTVAR_SCALE));
- tcpstat.tcps_usedrttvar++;
- } else {
- /* default variation is +- 1 rtt */
- tp->t_rttvar =
- tp->t_srtt * TCP_RTTVAR_SCALE / TCP_RTT_SCALE;
- }
- TCPT_RANGESET(tp->t_rxtcur,
- ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1,
- tp->t_rttmin, TCPTV_REXMTMAX);
- }
- /*
- * if there's an mtu associated with the route, use it
- */
- if (rt->rt_rmx.rmx_mtu)
- mss = rt->rt_rmx.rmx_mtu - sizeof(struct tcpiphdr);
- else
- {
- mss = ifp->if_mtu - sizeof(struct tcpiphdr);
- if (!in_localaddr(inp->inp_faddr))
- mss = min(mss, tcp_mssdflt);
- }
- mss = min(mss, offer);
- /*
- * maxopd stores the maximum length of data AND options
- * in a segment; maxseg is the amount of data in a normal
- * segment. We need to store this value (maxopd) apart
- * from maxseg, because now every segment carries options
- * and thus we normally have somewhat less data in segments.
- */
- tp->t_maxopd = mss;
-
- /*
- * In case of T/TCP, origoffer==-1 indicates, that no segments
- * were received yet. In this case we just guess, otherwise
- * we do the same as before T/TCP.
- */
- if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP &&
- (origoffer == -1 ||
- (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP))
- mss -= TCPOLEN_TSTAMP_APPA;
- if ((tp->t_flags & (TF_REQ_CC|TF_NOOPT)) == TF_REQ_CC &&
- (origoffer == -1 ||
- (tp->t_flags & TF_RCVD_CC) == TF_RCVD_CC))
- mss -= TCPOLEN_CC_APPA;
-
-#if (MCLBYTES & (MCLBYTES - 1)) == 0
- if (mss > MCLBYTES)
- mss &= ~(MCLBYTES-1);
-#else
- if (mss > MCLBYTES)
- mss = mss / MCLBYTES * MCLBYTES;
-#endif
- /*
- * If there's a pipesize, change the socket buffer
- * to that size. Make the socket buffers an integral
- * number of mss units; if the mss is larger than
- * the socket buffer, decrease the mss.
- */
-#ifdef RTV_SPIPE
- if ((bufsize = rt->rt_rmx.rmx_sendpipe) == 0)
-#endif
- bufsize = so->so_snd.sb_hiwat;
- if (bufsize < mss)
- mss = bufsize;
- else {
- bufsize = roundup(bufsize, mss);
- if (bufsize > sb_max)
- bufsize = sb_max;
- (void)sbreserve(&so->so_snd, bufsize);
- }
- tp->t_maxseg = mss;
-
-#ifdef RTV_RPIPE
- if ((bufsize = rt->rt_rmx.rmx_recvpipe) == 0)
-#endif
- bufsize = so->so_rcv.sb_hiwat;
- if (bufsize > mss) {
- bufsize = roundup(bufsize, mss);
- if (bufsize > sb_max)
- bufsize = sb_max;
- (void)sbreserve(&so->so_rcv, bufsize);
- }
- /*
- * Don't force slow-start on local network.
- */
- if (!in_localaddr(inp->inp_faddr))
- tp->snd_cwnd = mss;
-
- if (rt->rt_rmx.rmx_ssthresh) {
- /*
- * There's some sort of gateway or interface
- * buffer limit on the path. Use this to set
- * the slow start threshhold, but set the
- * threshold to no less than 2*mss.
- */
- tp->snd_ssthresh = max(2 * mss, rt->rt_rmx.rmx_ssthresh);
- tcpstat.tcps_usedssthresh++;
- }
-}
-
-/*
- * Determine the MSS option to send on an outgoing SYN.
- */
-int
-tcp_mssopt(tp)
- struct tcpcb *tp;
-{
- struct rtentry *rt;
-
- rt = tcp_rtlookup(tp->t_inpcb);
- if (rt == NULL)
- return tcp_mssdflt;
-
- return rt->rt_ifp->if_mtu - sizeof(struct tcpiphdr);
-}
-#endif /* TUBA_INCLUDE */
diff --git a/c/src/exec/libnetworking/netinet/tcp_output.c b/c/src/exec/libnetworking/netinet/tcp_output.c
deleted file mode 100644
index cbb5218dce..0000000000
--- a/c/src/exec/libnetworking/netinet/tcp_output.c
+++ /dev/null
@@ -1,755 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#define TCPOUTFLAGS
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-#ifdef notyet
-extern struct mbuf *m_copypack();
-#endif
-
-
-/*
- * Tcp output routine: figure out what should be sent and send it.
- */
-int
-tcp_output(tp)
- register struct tcpcb *tp;
-{
- register struct socket *so = tp->t_inpcb->inp_socket;
- register long len, win;
- int off, flags, error;
- register struct mbuf *m;
- register struct tcpiphdr *ti;
- u_char opt[TCP_MAXOLEN];
- unsigned optlen, hdrlen;
- int idle, sendalot;
- struct rmxp_tao *taop;
- struct rmxp_tao tao_noncached;
-
- /*
- * Determine length of data that should be transmitted,
- * and flags that will be used.
- * If there is some data or critical controls (SYN, RST)
- * to send, then transmit; otherwise, investigate further.
- */
- idle = (tp->snd_max == tp->snd_una);
- if (idle && tp->t_idle >= tp->t_rxtcur)
- /*
- * We have been idle for "a while" and no acks are
- * expected to clock out any data we send --
- * slow start to get ack "clock" running again.
- */
- tp->snd_cwnd = tp->t_maxseg;
-again:
- sendalot = 0;
- off = tp->snd_nxt - tp->snd_una;
- win = min(tp->snd_wnd, tp->snd_cwnd);
-
- flags = tcp_outflags[tp->t_state];
- /*
- * Get standard flags, and add SYN or FIN if requested by 'hidden'
- * state flags.
- */
- if (tp->t_flags & TF_NEEDFIN)
- flags |= TH_FIN;
- if (tp->t_flags & TF_NEEDSYN)
- flags |= TH_SYN;
-
- /*
- * If in persist timeout with window of 0, send 1 byte.
- * Otherwise, if window is small but nonzero
- * and timer expired, we will send what we can
- * and go to transmit state.
- */
- if (tp->t_force) {
- if (win == 0) {
- /*
- * If we still have some data to send, then
- * clear the FIN bit. Usually this would
- * happen below when it realizes that we
- * aren't sending all the data. However,
- * if we have exactly 1 byte of unset data,
- * then it won't clear the FIN bit below,
- * and if we are in persist state, we wind
- * up sending the packet without recording
- * that we sent the FIN bit.
- *
- * We can't just blindly clear the FIN bit,
- * because if we don't have any more data
- * to send then the probe will be the FIN
- * itself.
- */
- if (off < so->so_snd.sb_cc)
- flags &= ~TH_FIN;
- win = 1;
- } else {
- tp->t_timer[TCPT_PERSIST] = 0;
- tp->t_rxtshift = 0;
- }
- }
-
- len = min(so->so_snd.sb_cc, win) - off;
-
- if ((taop = tcp_gettaocache(tp->t_inpcb)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
-
- /*
- * Lop off SYN bit if it has already been sent. However, if this
- * is SYN-SENT state and if segment contains data and if we don't
- * know that foreign host supports TAO, suppress sending segment.
- */
- if ((flags & TH_SYN) && SEQ_GT(tp->snd_nxt, tp->snd_una)) {
- flags &= ~TH_SYN;
- off--, len++;
- if (len > 0 && tp->t_state == TCPS_SYN_SENT &&
- taop->tao_ccsent == 0)
- return 0;
- }
-
- /*
- * Be careful not to send data and/or FIN on SYN segments
- * in cases when no CC option will be sent.
- * This measure is needed to prevent interoperability problems
- * with not fully conformant TCP implementations.
- */
- if ((flags & TH_SYN) &&
- ((tp->t_flags & TF_NOOPT) || !(tp->t_flags & TF_REQ_CC) ||
- ((flags & TH_ACK) && !(tp->t_flags & TF_RCVD_CC)))) {
- len = 0;
- flags &= ~TH_FIN;
- }
-
- if (len < 0) {
- /*
- * If FIN has been sent but not acked,
- * but we haven't been called to retransmit,
- * len will be -1. Otherwise, window shrank
- * after we sent into it. If window shrank to 0,
- * cancel pending retransmit, pull snd_nxt back
- * to (closed) window, and set the persist timer
- * if it isn't already going. If the window didn't
- * close completely, just wait for an ACK.
- */
- len = 0;
- if (win == 0) {
- tp->t_timer[TCPT_REXMT] = 0;
- tp->t_rxtshift = 0;
- tp->snd_nxt = tp->snd_una;
- if (tp->t_timer[TCPT_PERSIST] == 0)
- tcp_setpersist(tp);
- }
- }
- if (len > tp->t_maxseg) {
- len = tp->t_maxseg;
- sendalot = 1;
- }
- if (SEQ_LT(tp->snd_nxt + len, tp->snd_una + so->so_snd.sb_cc))
- flags &= ~TH_FIN;
-
- win = sbspace(&so->so_rcv);
-
- /*
- * Sender silly window avoidance. If connection is idle
- * and can send all data, a maximum segment,
- * at least a maximum default-size segment do it,
- * or are forced, do it; otherwise don't bother.
- * If peer's buffer is tiny, then send
- * when window is at least half open.
- * If retransmitting (possibly after persist timer forced us
- * to send into a small window), then must resend.
- */
- if (len) {
- if (len == tp->t_maxseg)
- goto send;
- if ((idle || tp->t_flags & TF_NODELAY) &&
- (tp->t_flags & TF_NOPUSH) == 0 &&
- len + off >= so->so_snd.sb_cc)
- goto send;
- if (tp->t_force)
- goto send;
- if (len >= tp->max_sndwnd / 2 && tp->max_sndwnd > 0)
- goto send;
- if (SEQ_LT(tp->snd_nxt, tp->snd_max))
- goto send;
- }
-
- /*
- * Compare available window to amount of window
- * known to peer (as advertised window less
- * next expected input). If the difference is at least two
- * max size segments, or at least 50% of the maximum possible
- * window, then want to send a window update to peer.
- */
- if (win > 0) {
- /*
- * "adv" is the amount we can increase the window,
- * taking into account that we are limited by
- * TCP_MAXWIN << tp->rcv_scale.
- */
- long adv = min(win, (long)TCP_MAXWIN << tp->rcv_scale) -
- (tp->rcv_adv - tp->rcv_nxt);
-
- if (adv >= (long) (2 * tp->t_maxseg))
- goto send;
- if (2 * adv >= (long) so->so_rcv.sb_hiwat)
- goto send;
- }
-
- /*
- * Send if we owe peer an ACK.
- */
- if (tp->t_flags & TF_ACKNOW)
- goto send;
- if ((flags & TH_RST) ||
- ((flags & TH_SYN) && (tp->t_flags & TF_NEEDSYN) == 0))
- goto send;
- if (SEQ_GT(tp->snd_up, tp->snd_una))
- goto send;
- /*
- * If our state indicates that FIN should be sent
- * and we have not yet done so, or we're retransmitting the FIN,
- * then we need to send.
- */
- if (flags & TH_FIN &&
- ((tp->t_flags & TF_SENTFIN) == 0 || tp->snd_nxt == tp->snd_una))
- goto send;
-
- /*
- * TCP window updates are not reliable, rather a polling protocol
- * using ``persist'' packets is used to insure receipt of window
- * updates. The three ``states'' for the output side are:
- * idle not doing retransmits or persists
- * persisting to move a small or zero window
- * (re)transmitting and thereby not persisting
- *
- * tp->t_timer[TCPT_PERSIST]
- * is set when we are in persist state.
- * tp->t_force
- * is set when we are called to send a persist packet.
- * tp->t_timer[TCPT_REXMT]
- * is set when we are retransmitting
- * The output side is idle when both timers are zero.
- *
- * If send window is too small, there is data to transmit, and no
- * retransmit or persist is pending, then go to persist state.
- * If nothing happens soon, send when timer expires:
- * if window is nonzero, transmit what we can,
- * otherwise force out a byte.
- */
- if (so->so_snd.sb_cc && tp->t_timer[TCPT_REXMT] == 0 &&
- tp->t_timer[TCPT_PERSIST] == 0) {
- tp->t_rxtshift = 0;
- tcp_setpersist(tp);
- }
-
- /*
- * No reason to send a segment, just return.
- */
- return (0);
-
-send:
- /*
- * Before ESTABLISHED, force sending of initial options
- * unless TCP set not to do any options.
- * NOTE: we assume that the IP/TCP header plus TCP options
- * always fit in a single mbuf, leaving room for a maximum
- * link header, i.e.
- * max_linkhdr + sizeof (struct tcpiphdr) + optlen <= MHLEN
- */
- optlen = 0;
- hdrlen = sizeof (struct tcpiphdr);
- if (flags & TH_SYN) {
- tp->snd_nxt = tp->iss;
- if ((tp->t_flags & TF_NOOPT) == 0) {
- u_short mss;
-
- opt[0] = TCPOPT_MAXSEG;
- opt[1] = TCPOLEN_MAXSEG;
- mss = htons((u_short) tcp_mssopt(tp));
- (void)memcpy(opt + 2, &mss, sizeof(mss));
- optlen = TCPOLEN_MAXSEG;
-
- if ((tp->t_flags & TF_REQ_SCALE) &&
- ((flags & TH_ACK) == 0 ||
- (tp->t_flags & TF_RCVD_SCALE))) {
- *((u_long *) (opt + optlen)) = htonl(
- TCPOPT_NOP << 24 |
- TCPOPT_WINDOW << 16 |
- TCPOLEN_WINDOW << 8 |
- tp->request_r_scale);
- optlen += 4;
- }
- }
- }
-
- /*
- * Send a timestamp and echo-reply if this is a SYN and our side
- * wants to use timestamps (TF_REQ_TSTMP is set) or both our side
- * and our peer have sent timestamps in our SYN's.
- */
- if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP &&
- (flags & TH_RST) == 0 &&
- ((flags & TH_ACK) == 0 ||
- (tp->t_flags & TF_RCVD_TSTMP))) {
- u_long *lp = (u_long *)(opt + optlen);
-
- /* Form timestamp option as shown in appendix A of RFC 1323. */
- *lp++ = htonl(TCPOPT_TSTAMP_HDR);
- *lp++ = htonl(tcp_now);
- *lp = htonl(tp->ts_recent);
- optlen += TCPOLEN_TSTAMP_APPA;
- }
-
- /*
- * Send `CC-family' options if our side wants to use them (TF_REQ_CC),
- * options are allowed (!TF_NOOPT) and it's not a RST.
- */
- if ((tp->t_flags & (TF_REQ_CC|TF_NOOPT)) == TF_REQ_CC &&
- (flags & TH_RST) == 0) {
- switch (flags & (TH_SYN|TH_ACK)) {
- /*
- * This is a normal ACK, send CC if we received CC before
- * from our peer.
- */
- case TH_ACK:
- if (!(tp->t_flags & TF_RCVD_CC))
- break;
- /*FALLTHROUGH*/
-
- /*
- * We can only get here in T/TCP's SYN_SENT* state, when
- * we're a sending a non-SYN segment without waiting for
- * the ACK of our SYN. A check above assures that we only
- * do this if our peer understands T/TCP.
- */
- case 0:
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_CC;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] = htonl(tp->cc_send);
-
- optlen += 4;
- break;
-
- /*
- * This is our initial SYN, check whether we have to use
- * CC or CC.new.
- */
- case TH_SYN:
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = tp->t_flags & TF_SENDCCNEW ?
- TCPOPT_CCNEW : TCPOPT_CC;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] = htonl(tp->cc_send);
- optlen += 4;
- break;
-
- /*
- * This is a SYN,ACK; send CC and CC.echo if we received
- * CC from our peer.
- */
- case (TH_SYN|TH_ACK):
- if (tp->t_flags & TF_RCVD_CC) {
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_CC;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] =
- htonl(tp->cc_send);
- optlen += 4;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_CCECHO;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] =
- htonl(tp->cc_recv);
- optlen += 4;
- }
- break;
- }
- }
-
- hdrlen += optlen;
-
- /*
- * Adjust data length if insertion of options will
- * bump the packet length beyond the t_maxopd length.
- * Clear the FIN bit because we cut off the tail of
- * the segment.
- */
- if (len + optlen > tp->t_maxopd) {
- /*
- * If there is still more to send, don't close the connection.
- */
- flags &= ~TH_FIN;
- len = tp->t_maxopd - optlen;
- sendalot = 1;
- }
-
-/*#ifdef DIAGNOSTIC*/
- if (max_linkhdr + hdrlen > MHLEN)
- panic("tcphdr too big");
-/*#endif*/
-
- /*
- * Grab a header mbuf, attaching a copy of data to
- * be transmitted, and initialize the header from
- * the template for sends on this connection.
- */
- if (len) {
- if (tp->t_force && len == 1)
- tcpstat.tcps_sndprobe++;
- else if (SEQ_LT(tp->snd_nxt, tp->snd_max)) {
- tcpstat.tcps_sndrexmitpack++;
- tcpstat.tcps_sndrexmitbyte += len;
- } else {
- tcpstat.tcps_sndpack++;
- tcpstat.tcps_sndbyte += len;
- }
-#ifdef notyet
- if ((m = m_copypack(so->so_snd.sb_mb, off,
- (int)len, max_linkhdr + hdrlen)) == 0) {
- error = ENOBUFS;
- goto out;
- }
- /*
- * m_copypack left space for our hdr; use it.
- */
- m->m_len += hdrlen;
- m->m_data -= hdrlen;
-#else
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- }
- m->m_data += max_linkhdr;
- m->m_len = hdrlen;
- if (len <= MHLEN - hdrlen - max_linkhdr) {
- m_copydata(so->so_snd.sb_mb, off, (int) len,
- mtod(m, caddr_t) + hdrlen);
- m->m_len += len;
- } else {
- m->m_next = m_copy(so->so_snd.sb_mb, off, (int) len);
- if (m->m_next == 0) {
- (void) m_free(m);
- error = ENOBUFS;
- goto out;
- }
- }
-#endif
- /*
- * If we're sending everything we've got, set PUSH.
- * (This will keep happy those implementations which only
- * give data to the user when a buffer fills or
- * a PUSH comes in.)
- */
- if (off + len == so->so_snd.sb_cc)
- flags |= TH_PUSH;
- } else {
- if (tp->t_flags & TF_ACKNOW)
- tcpstat.tcps_sndacks++;
- else if (flags & (TH_SYN|TH_FIN|TH_RST))
- tcpstat.tcps_sndctrl++;
- else if (SEQ_GT(tp->snd_up, tp->snd_una))
- tcpstat.tcps_sndurg++;
- else
- tcpstat.tcps_sndwinup++;
-
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- }
- m->m_data += max_linkhdr;
- m->m_len = hdrlen;
- }
- m->m_pkthdr.rcvif = (struct ifnet *)0;
- ti = mtod(m, struct tcpiphdr *);
- if (tp->t_template == 0)
- panic("tcp_output");
- (void)memcpy(ti, tp->t_template, sizeof (struct tcpiphdr));
-
- /*
- * Fill in fields, remembering maximum advertised
- * window for use in delaying messages about window sizes.
- * If resending a FIN, be sure not to use a new sequence number.
- */
- if (flags & TH_FIN && tp->t_flags & TF_SENTFIN &&
- tp->snd_nxt == tp->snd_max)
- tp->snd_nxt--;
- /*
- * If we are doing retransmissions, then snd_nxt will
- * not reflect the first unsent octet. For ACK only
- * packets, we do not want the sequence number of the
- * retransmitted packet, we want the sequence number
- * of the next unsent octet. So, if there is no data
- * (and no SYN or FIN), use snd_max instead of snd_nxt
- * when filling in ti_seq. But if we are in persist
- * state, snd_max might reflect one byte beyond the
- * right edge of the window, so use snd_nxt in that
- * case, since we know we aren't doing a retransmission.
- * (retransmit and persist are mutually exclusive...)
- */
- if (len || (flags & (TH_SYN|TH_FIN)) || tp->t_timer[TCPT_PERSIST])
- ti->ti_seq = htonl(tp->snd_nxt);
- else
- ti->ti_seq = htonl(tp->snd_max);
- ti->ti_ack = htonl(tp->rcv_nxt);
- if (optlen) {
- bcopy(opt, ti + 1, optlen);
- ti->ti_off = (sizeof (struct tcphdr) + optlen) >> 2;
- }
- ti->ti_flags = flags;
- /*
- * Calculate receive window. Don't shrink window,
- * but avoid silly window syndrome.
- */
- if (win < (long)(so->so_rcv.sb_hiwat / 4) && win < (long)tp->t_maxseg)
- win = 0;
- if (win < (long)(tp->rcv_adv - tp->rcv_nxt))
- win = (long)(tp->rcv_adv - tp->rcv_nxt);
- if (win > (long)TCP_MAXWIN << tp->rcv_scale)
- win = (long)TCP_MAXWIN << tp->rcv_scale;
- ti->ti_win = htons((u_short) (win>>tp->rcv_scale));
- if (SEQ_GT(tp->snd_up, tp->snd_nxt)) {
- ti->ti_urp = htons((u_short)(tp->snd_up - tp->snd_nxt));
- ti->ti_flags |= TH_URG;
- } else
- /*
- * If no urgent pointer to send, then we pull
- * the urgent pointer to the left edge of the send window
- * so that it doesn't drift into the send window on sequence
- * number wraparound.
- */
- tp->snd_up = tp->snd_una; /* drag it along */
-
- /*
- * Put TCP length in extended header, and then
- * checksum extended header and data.
- */
- if (len + optlen)
- ti->ti_len = htons((u_short)(sizeof (struct tcphdr) +
- optlen + len));
- ti->ti_sum = in_cksum(m, (int)(hdrlen + len));
-
- /*
- * In transmit state, time the transmission and arrange for
- * the retransmit. In persist state, just set snd_max.
- */
- if (tp->t_force == 0 || tp->t_timer[TCPT_PERSIST] == 0) {
- tcp_seq startseq = tp->snd_nxt;
-
- /*
- * Advance snd_nxt over sequence space of this segment.
- */
- if (flags & (TH_SYN|TH_FIN)) {
- if (flags & TH_SYN)
- tp->snd_nxt++;
- if (flags & TH_FIN) {
- tp->snd_nxt++;
- tp->t_flags |= TF_SENTFIN;
- }
- }
- tp->snd_nxt += len;
- if (SEQ_GT(tp->snd_nxt, tp->snd_max)) {
- tp->snd_max = tp->snd_nxt;
- /*
- * Time this transmission if not a retransmission and
- * not currently timing anything.
- */
- if (tp->t_rtt == 0) {
- tp->t_rtt = 1;
- tp->t_rtseq = startseq;
- tcpstat.tcps_segstimed++;
- }
- }
-
- /*
- * Set retransmit timer if not currently set,
- * and not doing an ack or a keep-alive probe.
- * Initial value for retransmit timer is smoothed
- * round-trip time + 2 * round-trip time variance.
- * Initialize shift counter which is used for backoff
- * of retransmit time.
- */
- if (tp->t_timer[TCPT_REXMT] == 0 &&
- tp->snd_nxt != tp->snd_una) {
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
- if (tp->t_timer[TCPT_PERSIST]) {
- tp->t_timer[TCPT_PERSIST] = 0;
- tp->t_rxtshift = 0;
- }
- }
- } else
- if (SEQ_GT(tp->snd_nxt + len, tp->snd_max))
- tp->snd_max = tp->snd_nxt + len;
-
-#ifdef TCPDEBUG
- /*
- * Trace.
- */
- if (so->so_options & SO_DEBUG)
- tcp_trace(TA_OUTPUT, tp->t_state, tp, ti, 0);
-#endif
-
- /*
- * Fill in IP length and desired time to live and
- * send to IP level. There should be a better way
- * to handle ttl and tos; we could keep them in
- * the template, but need a way to checksum without them.
- */
- m->m_pkthdr.len = hdrlen + len;
-#ifdef TUBA
- if (tp->t_tuba_pcb)
- error = tuba_output(m, tp);
- else
-#endif
- {
-#if 1
- struct rtentry *rt;
-#endif
- ((struct ip *)ti)->ip_len = m->m_pkthdr.len;
- ((struct ip *)ti)->ip_ttl = tp->t_inpcb->inp_ip_ttl; /* XXX */
- ((struct ip *)ti)->ip_tos = tp->t_inpcb->inp_ip_tos; /* XXX */
-#if 1
- /*
- * See if we should do MTU discovery. We do it only if the following
- * are true:
- * 1) we have a valid route to the destination
- * 2) the MTU is not locked (if it is, then discovery has been
- * disabled)
- */
- if ((rt = tp->t_inpcb->inp_route.ro_rt)
- && rt->rt_flags & RTF_UP
- && !(rt->rt_rmx.rmx_locks & RTV_MTU)) {
- ((struct ip *)ti)->ip_off |= IP_DF;
- }
-#endif
- error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route,
- so->so_options & SO_DONTROUTE, 0);
- }
- if (error) {
-out:
- if (error == ENOBUFS) {
- tcp_quench(tp->t_inpcb, 0);
- return (0);
- }
-#if 1
- if (error == EMSGSIZE) {
- /*
- * ip_output() will have already fixed the route
- * for us. tcp_mtudisc() will, as its last action,
- * initiate retransmission, so it is important to
- * not do so here.
- */
- tcp_mtudisc(tp->t_inpcb, 0);
- return 0;
- }
-#endif
- if ((error == EHOSTUNREACH || error == ENETDOWN)
- && TCPS_HAVERCVDSYN(tp->t_state)) {
- tp->t_softerror = error;
- return (0);
- }
- return (error);
- }
- tcpstat.tcps_sndtotal++;
-
- /*
- * Data sent (as far as we can tell).
- * If this advertises a larger window than any other segment,
- * then remember the size of the advertised window.
- * Any pending ACK has now been sent.
- */
- if (win > 0 && SEQ_GT(tp->rcv_nxt+win, tp->rcv_adv))
- tp->rcv_adv = tp->rcv_nxt + win;
- tp->last_ack_sent = tp->rcv_nxt;
- tp->t_flags &= ~(TF_ACKNOW|TF_DELACK);
- if (sendalot)
- goto again;
- return (0);
-}
-
-void
-tcp_setpersist(tp)
- register struct tcpcb *tp;
-{
- register int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1;
-
- if (tp->t_timer[TCPT_REXMT])
- panic("tcp_output REXMT");
- /*
- * Start/restart persistance timer.
- */
- TCPT_RANGESET(tp->t_timer[TCPT_PERSIST],
- t * tcp_backoff[tp->t_rxtshift],
- TCPTV_PERSMIN, TCPTV_PERSMAX);
- if (tp->t_rxtshift < TCP_MAXRXTSHIFT)
- tp->t_rxtshift++;
-}
diff --git a/c/src/exec/libnetworking/netinet/tcp_seq.h b/c/src/exec/libnetworking/netinet/tcp_seq.h
deleted file mode 100644
index 8cccf199e1..0000000000
--- a/c/src/exec/libnetworking/netinet/tcp_seq.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993, 1995
- * 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.
- *
- * @(#)tcp_seq.h 8.3 (Berkeley) 6/21/95
- * $Id$
- */
-
-#ifndef _NETINET_TCP_SEQ_H_
-#define _NETINET_TCP_SEQ_H_
-/*
- * TCP sequence numbers are 32 bit integers operated
- * on with modular arithmetic. These macros can be
- * used to compare such integers.
- */
-#define SEQ_LT(a,b) ((int)((a)-(b)) < 0)
-#define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0)
-#define SEQ_GT(a,b) ((int)((a)-(b)) > 0)
-#define SEQ_GEQ(a,b) ((int)((a)-(b)) >= 0)
-
-/* for modulo comparisons of timestamps */
-#define TSTMP_LT(a,b) ((int)((a)-(b)) < 0)
-#define TSTMP_GEQ(a,b) ((int)((a)-(b)) >= 0)
-
-/*
- * TCP connection counts are 32 bit integers operated
- * on with modular arithmetic. These macros can be
- * used to compare such integers.
- */
-#define CC_LT(a,b) ((int)((a)-(b)) < 0)
-#define CC_LEQ(a,b) ((int)((a)-(b)) <= 0)
-#define CC_GT(a,b) ((int)((a)-(b)) > 0)
-#define CC_GEQ(a,b) ((int)((a)-(b)) >= 0)
-
-/* Macro to increment a CC: skip 0 which has a special meaning */
-#define CC_INC(c) (++(c) == 0 ? ++(c) : (c))
-
-/*
- * Macros to initialize tcp sequence numbers for
- * send and receive from initial send and receive
- * sequence numbers.
- */
-#define tcp_rcvseqinit(tp) \
- (tp)->rcv_adv = (tp)->rcv_nxt = (tp)->irs + 1
-
-#define tcp_sendseqinit(tp) \
- (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \
- (tp)->iss
-
-#define TCP_PAWS_IDLE (24 * 24 * 60 * 60 * PR_SLOWHZ)
- /* timestamp wrap-around time */
-
-#ifdef KERNEL
-extern tcp_cc tcp_ccgen; /* global connection count */
-
-/*
- * Increment for tcp_iss each second.
- * This is designed to increment at the standard 250 KB/s,
- * but with a random component averaging 128 KB.
- * We also increment tcp_iss by a quarter of this amount
- * each time we use the value for a new connection.
- * If defined, the tcp_random18() macro should produce a
- * number in the range [0-0x3ffff] that is hard to predict.
- */
-#ifndef tcp_random18
-#define tcp_random18() ((random() >> 14) & 0x3ffff)
-#endif
-#define TCP_ISSINCR (122*1024 + tcp_random18())
-
-extern tcp_seq tcp_iss; /* tcp initial send seq # */
-#else
-#define TCP_ISSINCR (250*1024) /* increment for tcp_iss each second */
-#endif /* KERNEL */
-#endif /* _NETINET_TCP_SEQ_H_ */
diff --git a/c/src/exec/libnetworking/netinet/tcp_subr.c b/c/src/exec/libnetworking/netinet/tcp_subr.c
deleted file mode 100644
index a9cde3fdf0..0000000000
--- a/c/src/exec/libnetworking/netinet/tcp_subr.c
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/proc.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <net/route.h>
-#include <net/if.h>
-
-#define _IP_VHL
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-int tcp_mssdflt = TCP_MSS;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt,
- CTLFLAG_RW, &tcp_mssdflt , 0, "");
-
-static int tcp_do_rfc1323 = 1;
-static int tcp_do_rfc1644 = 1;
-#if !defined(__rtems__)
-static int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_RTTDFLT, rttdflt,
- CTLFLAG_RW, &tcp_rttdflt , 0, "");
-
-SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323,
- CTLFLAG_RW, &tcp_do_rfc1323 , 0, "");
-
-SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1644, rfc1644,
- CTLFLAG_RW, &tcp_do_rfc1644 , 0, "");
-#endif
-
-static void tcp_cleartaocache(void);
-static void tcp_notify __P((struct inpcb *, int));
-
-/*
- * Target size of TCP PCB hash table. Will be rounded down to a prime
- * number.
- */
-#ifndef TCBHASHSIZE
-#define TCBHASHSIZE 128
-#endif
-
-/*
- * Tcp initialization
- */
-void
-tcp_init()
-{
-
- tcp_iss = random(); /* wrong, but better than a constant */
- tcp_ccgen = 1;
- tcp_cleartaocache();
- LIST_INIT(&tcb);
- tcbinfo.listhead = &tcb;
- tcbinfo.hashbase = hashinit(TCBHASHSIZE, M_PCB, &tcbinfo.hashmask);
- if (max_protohdr < sizeof(struct tcpiphdr))
- max_protohdr = sizeof(struct tcpiphdr);
- if (max_linkhdr + sizeof(struct tcpiphdr) > MHLEN)
- panic("tcp_init");
-}
-
-/*
- * Create template to be used to send tcp packets on a connection.
- * Call after host entry created, allocates an mbuf and fills
- * in a skeletal tcp/ip header, minimizing the amount of work
- * necessary when the connection is used.
- */
-struct tcpiphdr *
-tcp_template(tp)
- struct tcpcb *tp;
-{
- register struct inpcb *inp = tp->t_inpcb;
- register struct mbuf *m;
- register struct tcpiphdr *n;
-
- if ((n = tp->t_template) == 0) {
- m = m_get(M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- return (0);
- m->m_len = sizeof (struct tcpiphdr);
- n = mtod(m, struct tcpiphdr *);
- }
- n->ti_next = n->ti_prev = 0;
- n->ti_x1 = 0;
- n->ti_pr = IPPROTO_TCP;
- n->ti_len = htons(sizeof (struct tcpiphdr) - sizeof (struct ip));
- n->ti_src = inp->inp_laddr;
- n->ti_dst = inp->inp_faddr;
- n->ti_sport = inp->inp_lport;
- n->ti_dport = inp->inp_fport;
- n->ti_seq = 0;
- n->ti_ack = 0;
- n->ti_x2 = 0;
- n->ti_off = 5;
- n->ti_flags = 0;
- n->ti_win = 0;
- n->ti_sum = 0;
- n->ti_urp = 0;
- return (n);
-}
-
-/*
- * Send a single message to the TCP at address specified by
- * the given TCP/IP header. If m == 0, then we make a copy
- * of the tcpiphdr at ti and send directly to the addressed host.
- * This is used to force keep alive messages out using the TCP
- * template for a connection tp->t_template. If flags are given
- * then we send a message back to the TCP which originated the
- * segment ti, and discard the mbuf containing it and any other
- * attached mbufs.
- *
- * In any case the ack and sequence number of the transmitted
- * segment are as specified by the parameters.
- *
- * NOTE: If m != NULL, then ti must point to *inside* the mbuf.
- */
-void
-tcp_respond(tp, ti, m, ack, seq, flags)
- struct tcpcb *tp;
- register struct tcpiphdr *ti;
- register struct mbuf *m;
- tcp_seq ack, seq;
- int flags;
-{
- register int tlen;
- int win = 0;
- struct route *ro = 0;
- struct route sro;
-
- if (tp) {
- win = sbspace(&tp->t_inpcb->inp_socket->so_rcv);
- ro = &tp->t_inpcb->inp_route;
- } else {
- ro = &sro;
- bzero(ro, sizeof *ro);
- }
- if (m == 0) {
- m = m_gethdr(M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- return;
-#ifdef TCP_COMPAT_42
- tlen = 1;
-#else
- tlen = 0;
-#endif
- m->m_data += max_linkhdr;
- *mtod(m, struct tcpiphdr *) = *ti;
- ti = mtod(m, struct tcpiphdr *);
- flags = TH_ACK;
- } else {
- m_freem(m->m_next);
- m->m_next = 0;
- m->m_data = (caddr_t)ti;
- m->m_len = sizeof (struct tcpiphdr);
- tlen = 0;
-#define xchg(a,b,type) { type t; t=a; a=b; b=t; }
- xchg(ti->ti_dst.s_addr, ti->ti_src.s_addr, u_long);
- xchg(ti->ti_dport, ti->ti_sport, u_short);
-#undef xchg
- }
- ti->ti_len = htons((u_short)(sizeof (struct tcphdr) + tlen));
- tlen += sizeof (struct tcpiphdr);
- m->m_len = tlen;
- m->m_pkthdr.len = tlen;
- m->m_pkthdr.rcvif = (struct ifnet *) 0;
- ti->ti_next = ti->ti_prev = 0;
- ti->ti_x1 = 0;
- ti->ti_seq = htonl(seq);
- ti->ti_ack = htonl(ack);
- ti->ti_x2 = 0;
- ti->ti_off = sizeof (struct tcphdr) >> 2;
- ti->ti_flags = flags;
- if (tp)
- ti->ti_win = htons((u_short) (win >> tp->rcv_scale));
- else
- ti->ti_win = htons((u_short)win);
- ti->ti_urp = 0;
- ti->ti_sum = 0;
- ti->ti_sum = in_cksum(m, tlen);
- ((struct ip *)ti)->ip_len = tlen;
- ((struct ip *)ti)->ip_ttl = ip_defttl;
-#ifdef TCPDEBUG
- if (tp == NULL || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
- tcp_trace(TA_OUTPUT, 0, tp, ti, 0);
-#endif
- (void) ip_output(m, NULL, ro, 0, NULL);
- if (ro == &sro && ro->ro_rt) {
- RTFREE(ro->ro_rt);
- }
-}
-
-/*
- * Create a new TCP control block, making an
- * empty reassembly queue and hooking it to the argument
- * protocol control block.
- */
-struct tcpcb *
-tcp_newtcpcb(inp)
- struct inpcb *inp;
-{
- register struct tcpcb *tp;
-
- tp = malloc(sizeof(*tp), M_PCB, M_NOWAIT);
- if (tp == NULL)
- return ((struct tcpcb *)0);
- bzero((char *) tp, sizeof(struct tcpcb));
- tp->seg_next = tp->seg_prev = (struct tcpiphdr *)tp;
- tp->t_maxseg = tp->t_maxopd = tcp_mssdflt;
-
- if (tcp_do_rfc1323)
- tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP);
- if (tcp_do_rfc1644)
- tp->t_flags |= TF_REQ_CC;
- tp->t_inpcb = inp;
- /*
- * Init srtt to TCPTV_SRTTBASE (0), so we can tell that we have no
- * rtt estimate. Set rttvar so that srtt + 4 * rttvar gives
- * reasonable initial retransmit time.
- */
- tp->t_srtt = TCPTV_SRTTBASE;
- tp->t_rttvar = ((TCPTV_RTOBASE - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4;
- tp->t_rttmin = TCPTV_MIN;
- tp->t_rxtcur = TCPTV_RTOBASE;
- tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT;
- tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT;
- inp->inp_ip_ttl = ip_defttl;
- inp->inp_ppcb = (caddr_t)tp;
- return (tp);
-}
-
-/*
- * Drop a TCP connection, reporting
- * the specified error. If connection is synchronized,
- * then send a RST to peer.
- */
-struct tcpcb *
-tcp_drop(tp, errnum)
- register struct tcpcb *tp;
- int errnum;
-{
- struct socket *so = tp->t_inpcb->inp_socket;
-
- if (TCPS_HAVERCVDSYN(tp->t_state)) {
- tp->t_state = TCPS_CLOSED;
- (void) tcp_output(tp);
- tcpstat.tcps_drops++;
- } else
- tcpstat.tcps_conndrops++;
- if (errnum == ETIMEDOUT && tp->t_softerror)
- errnum = tp->t_softerror;
- so->so_error = errnum;
- return (tcp_close(tp));
-}
-
-/*
- * Close a TCP control block:
- * discard all space held by the tcp
- * discard internet protocol block
- * wake up any sleepers
- */
-struct tcpcb *
-tcp_close(tp)
- register struct tcpcb *tp;
-{
- register struct tcpiphdr *t;
- struct inpcb *inp = tp->t_inpcb;
- struct socket *so = inp->inp_socket;
- register struct mbuf *m;
- register struct rtentry *rt;
-
- /*
- * If we got enough samples through the srtt filter,
- * save the rtt and rttvar in the routing entry.
- * 'Enough' is arbitrarily defined as the 16 samples.
- * 16 samples is enough for the srtt filter to converge
- * to within 5% of the correct value; fewer samples and
- * we could save a very bogus rtt.
- *
- * Don't update the default route's characteristics and don't
- * update anything that the user "locked".
- */
- if (tp->t_rttupdated >= 16 &&
- (rt = inp->inp_route.ro_rt) &&
- ((struct sockaddr_in *)rt_key(rt))->sin_addr.s_addr != INADDR_ANY) {
- register u_long i = 0;
-
- if ((rt->rt_rmx.rmx_locks & RTV_RTT) == 0) {
- i = tp->t_srtt *
- (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTT_SCALE));
- if (rt->rt_rmx.rmx_rtt && i)
- /*
- * filter this update to half the old & half
- * the new values, converting scale.
- * See route.h and tcp_var.h for a
- * description of the scaling constants.
- */
- rt->rt_rmx.rmx_rtt =
- (rt->rt_rmx.rmx_rtt + i) / 2;
- else
- rt->rt_rmx.rmx_rtt = i;
- tcpstat.tcps_cachedrtt++;
- }
- if ((rt->rt_rmx.rmx_locks & RTV_RTTVAR) == 0) {
- i = tp->t_rttvar *
- (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTTVAR_SCALE));
- if (rt->rt_rmx.rmx_rttvar && i)
- rt->rt_rmx.rmx_rttvar =
- (rt->rt_rmx.rmx_rttvar + i) / 2;
- else
- rt->rt_rmx.rmx_rttvar = i;
- tcpstat.tcps_cachedrttvar++;
- }
- /*
- * update the pipelimit (ssthresh) if it has been updated
- * already or if a pipesize was specified & the threshhold
- * got below half the pipesize. I.e., wait for bad news
- * before we start updating, then update on both good
- * and bad news.
- */
- if (((rt->rt_rmx.rmx_locks & RTV_SSTHRESH) == 0 &&
- ((i = tp->snd_ssthresh) != 0) && rt->rt_rmx.rmx_ssthresh) ||
- i < (rt->rt_rmx.rmx_sendpipe / 2)) {
- /*
- * convert the limit from user data bytes to
- * packets then to packet data bytes.
- */
- i = (i + tp->t_maxseg / 2) / tp->t_maxseg;
- if (i < 2)
- i = 2;
- i *= (u_long)(tp->t_maxseg + sizeof (struct tcpiphdr));
- if (rt->rt_rmx.rmx_ssthresh)
- rt->rt_rmx.rmx_ssthresh =
- (rt->rt_rmx.rmx_ssthresh + i) / 2;
- else
- rt->rt_rmx.rmx_ssthresh = i;
- tcpstat.tcps_cachedssthresh++;
- }
- }
- /* free the reassembly queue, if any */
- t = tp->seg_next;
- while (t != (struct tcpiphdr *)tp) {
- t = (struct tcpiphdr *)t->ti_next;
- m = REASS_MBUF((struct tcpiphdr *)t->ti_prev);
- remque(t->ti_prev);
- m_freem(m);
- }
- if (tp->t_template)
- (void) m_free(dtom(tp->t_template));
- free(tp, M_PCB);
- inp->inp_ppcb = 0;
- soisdisconnected(so);
- in_pcbdetach(inp);
- tcpstat.tcps_closed++;
- return ((struct tcpcb *)0);
-}
-
-void
-tcp_drain()
-{
-
-}
-
-/*
- * Notify a tcp user of an asynchronous error;
- * store error as soft error, but wake up user
- * (for now, won't do anything until can select for soft error).
- */
-static void
-tcp_notify(inp, error)
- struct inpcb *inp;
- int error;
-{
- register struct tcpcb *tp = (struct tcpcb *)inp->inp_ppcb;
- register struct socket *so = inp->inp_socket;
-
- /*
- * Ignore some errors if we are hooked up.
- * If connection hasn't completed, has retransmitted several times,
- * and receives a second error, give up now. This is better
- * than waiting a long time to establish a connection that
- * can never complete.
- */
- if (tp->t_state == TCPS_ESTABLISHED &&
- (error == EHOSTUNREACH || error == ENETUNREACH ||
- error == EHOSTDOWN)) {
- return;
- } else if (tp->t_state < TCPS_ESTABLISHED && tp->t_rxtshift > 3 &&
- tp->t_softerror)
- so->so_error = error;
- else
- tp->t_softerror = error;
- soconnwakeup (so);
- sorwakeup(so);
- sowwakeup(so);
-}
-
-void
-tcp_ctlinput(cmd, sa, vip)
- int cmd;
- struct sockaddr *sa;
- void *vip;
-{
- register struct ip *ip = vip;
- register struct tcphdr *th;
- void (*notify) __P((struct inpcb *, int)) = tcp_notify;
-
- if (cmd == PRC_QUENCH)
- notify = tcp_quench;
-#if 1
- else if (cmd == PRC_MSGSIZE)
- notify = tcp_mtudisc;
-#endif
- else if (!PRC_IS_REDIRECT(cmd) &&
- ((unsigned)cmd > PRC_NCMDS || inetctlerrmap[cmd] == 0))
- return;
- if (ip) {
- th = (struct tcphdr *)((caddr_t)ip
- + (IP_VHL_HL(ip->ip_vhl) << 2));
- in_pcbnotify(&tcb, sa, th->th_dport, ip->ip_src, th->th_sport,
- cmd, notify);
- } else
- in_pcbnotify(&tcb, sa, 0, zeroin_addr, 0, cmd, notify);
-}
-
-/*
- * When a source quench is received, close congestion window
- * to one segment. We will gradually open it again as we proceed.
- */
-void
-tcp_quench(inp, errnum)
- struct inpcb *inp;
- int errnum;
-{
- struct tcpcb *tp = intotcpcb(inp);
-
- if (tp)
- tp->snd_cwnd = tp->t_maxseg;
-}
-
-#if 1
-/*
- * When `need fragmentation' ICMP is received, update our idea of the MSS
- * based on the new value in the route. Also nudge TCP to send something,
- * since we know the packet we just sent was dropped.
- * This duplicates some code in the tcp_mss() function in tcp_input.c.
- */
-void
-tcp_mtudisc(inp, errnum)
- struct inpcb *inp;
- int errnum;
-{
- struct tcpcb *tp = intotcpcb(inp);
- struct rtentry *rt;
- struct rmxp_tao *taop;
- struct socket *so = inp->inp_socket;
- int offered;
- int mss;
-
- if (tp) {
- rt = tcp_rtlookup(inp);
- if (!rt || !rt->rt_rmx.rmx_mtu) {
- tp->t_maxopd = tp->t_maxseg = tcp_mssdflt;
- return;
- }
- taop = rmx_taop(rt->rt_rmx);
- offered = taop->tao_mssopt;
- mss = rt->rt_rmx.rmx_mtu - sizeof(struct tcpiphdr);
- if (offered)
- mss = min(mss, offered);
- /*
- * XXX - The above conditional probably violates the TCP
- * spec. The problem is that, since we don't know the
- * other end's MSS, we are supposed to use a conservative
- * default. But, if we do that, then MTU discovery will
- * never actually take place, because the conservative
- * default is much less than the MTUs typically seen
- * on the Internet today. For the moment, we'll sweep
- * this under the carpet.
- *
- * The conservative default might not actually be a problem
- * if the only case this occurs is when sending an initial
- * SYN with options and data to a host we've never talked
- * to before. Then, they will reply with an MSS value which
- * will get recorded and the new parameters should get
- * recomputed. For Further Study.
- */
- if (tp->t_maxopd <= mss)
- return;
- tp->t_maxopd = mss;
-
- if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP &&
- (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP)
- mss -= TCPOLEN_TSTAMP_APPA;
- if ((tp->t_flags & (TF_REQ_CC|TF_NOOPT)) == TF_REQ_CC &&
- (tp->t_flags & TF_RCVD_CC) == TF_RCVD_CC)
- mss -= TCPOLEN_CC_APPA;
-#if (MCLBYTES & (MCLBYTES - 1)) == 0
- if (mss > MCLBYTES)
- mss &= ~(MCLBYTES-1);
-#else
- if (mss > MCLBYTES)
- mss = mss / MCLBYTES * MCLBYTES;
-#endif
- if (so->so_snd.sb_hiwat < mss)
- mss = so->so_snd.sb_hiwat;
-
- tp->t_maxseg = mss;
-
- tcpstat.tcps_mturesent++;
- tp->t_rtt = 0;
- tp->snd_nxt = tp->snd_una;
- tcp_output(tp);
- }
-}
-#endif
-
-/*
- * Look-up the routing entry to the peer of this inpcb. If no route
- * is found and it cannot be allocated the return NULL. This routine
- * is called by TCP routines that access the rmx structure and by tcp_mss
- * to get the interface MTU.
- */
-struct rtentry *
-tcp_rtlookup(inp)
- struct inpcb *inp;
-{
- struct route *ro;
- struct rtentry *rt;
-
- ro = &inp->inp_route;
- rt = ro->ro_rt;
- if (rt == NULL || !(rt->rt_flags & RTF_UP)) {
- /* No route yet, so try to acquire one */
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- ro->ro_dst.sa_family = AF_INET;
- ro->ro_dst.sa_len = sizeof(ro->ro_dst);
- ((struct sockaddr_in *) &ro->ro_dst)->sin_addr =
- inp->inp_faddr;
- rtalloc(ro);
- rt = ro->ro_rt;
- }
- }
- return rt;
-}
-
-/*
- * Return a pointer to the cached information about the remote host.
- * The cached information is stored in the protocol specific part of
- * the route metrics.
- */
-struct rmxp_tao *
-tcp_gettaocache(inp)
- struct inpcb *inp;
-{
- struct rtentry *rt = tcp_rtlookup(inp);
-
- /* Make sure this is a host route and is up. */
- if (rt == NULL ||
- (rt->rt_flags & (RTF_UP|RTF_HOST)) != (RTF_UP|RTF_HOST))
- return NULL;
-
- return rmx_taop(rt->rt_rmx);
-}
-
-/*
- * Clear all the TAO cache entries, called from tcp_init.
- *
- * XXX
- * This routine is just an empty one, because we assume that the routing
- * routing tables are initialized at the same time when TCP, so there is
- * nothing in the cache left over.
- */
-static void
-tcp_cleartaocache(void)
-{ }
diff --git a/c/src/exec/libnetworking/netinet/tcp_timer.c b/c/src/exec/libnetworking/netinet/tcp_timer.c
deleted file mode 100644
index 04d3d604e2..0000000000
--- a/c/src/exec/libnetworking/netinet/tcp_timer.c
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#ifndef TUBA_INCLUDE
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-int tcp_keepinit = TCPTV_KEEP_INIT;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit,
- CTLFLAG_RW, &tcp_keepinit , 0, "");
-
-int tcp_keepidle = TCPTV_KEEP_IDLE;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPIDLE, keepidle,
- CTLFLAG_RW, &tcp_keepidle , 0, "");
-
-static int tcp_keepintvl = TCPTV_KEEPINTVL;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPINTVL, keepintvl,
- CTLFLAG_RW, &tcp_keepintvl , 0, "");
-
-static int always_keepalive = 0;
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive,
- CTLFLAG_RW, &always_keepalive , 0, "");
-
-static int tcp_keepcnt = TCPTV_KEEPCNT;
- /* max idle probes */
-static int tcp_maxpersistidle = TCPTV_KEEP_IDLE;
- /* max idle time in persist */
-int tcp_maxidle;
-#else /* TUBA_INCLUDE */
-
-static int tcp_maxpersistidle;
-#endif /* TUBA_INCLUDE */
-
-/*
- * Fast timeout routine for processing delayed acks
- */
-void
-tcp_fasttimo()
-{
- register struct inpcb *inp;
- register struct tcpcb *tp;
- int s;
-
- s = splnet();
-
- for (inp = tcb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if ((tp = (struct tcpcb *)inp->inp_ppcb) &&
- (tp->t_flags & TF_DELACK)) {
- tp->t_flags &= ~TF_DELACK;
- tp->t_flags |= TF_ACKNOW;
- tcpstat.tcps_delack++;
- (void) tcp_output(tp);
- }
- }
- splx(s);
-}
-
-/*
- * Tcp protocol timeout routine called every 500 ms.
- * Updates the timers in all active tcb's and
- * causes finite state machine actions if timers expire.
- */
-void
-tcp_slowtimo()
-{
- register struct inpcb *ip, *ipnxt;
- register struct tcpcb *tp;
- register int i;
- int s;
-#ifdef TCPDEBUG
- int ostate;
-#endif
-
- s = splnet();
-
- tcp_maxidle = tcp_keepcnt * tcp_keepintvl;
-
- ip = tcb.lh_first;
- if (ip == NULL) {
- splx(s);
- return;
- }
- /*
- * Search through tcb's and update active timers.
- */
- for (; ip != NULL; ip = ipnxt) {
- ipnxt = ip->inp_list.le_next;
- tp = intotcpcb(ip);
- if (tp == 0 || tp->t_state == TCPS_LISTEN)
- continue;
- for (i = 0; i < TCPT_NTIMERS; i++) {
- if (tp->t_timer[i] && --tp->t_timer[i] == 0) {
-#ifdef TCPDEBUG
- ostate = tp->t_state;
-#endif
- tp = tcp_timers(tp, i);
- if (tp == NULL)
- goto tpgone;
-#ifdef TCPDEBUG
- if (tp->t_inpcb->inp_socket->so_options
- & SO_DEBUG)
- tcp_trace(TA_USER, ostate, tp,
- (struct tcpiphdr *)0,
- PRU_SLOWTIMO);
-#endif
- }
- }
- tp->t_idle++;
- tp->t_duration++;
- if (tp->t_rtt)
- tp->t_rtt++;
-tpgone:
- ;
- }
- tcp_iss += TCP_ISSINCR/PR_SLOWHZ; /* increment iss */
-#ifdef TCP_COMPAT_42
- if ((int)tcp_iss < 0)
- tcp_iss = TCP_ISSINCR; /* XXX */
-#endif
- tcp_now++; /* for timestamps */
- splx(s);
-}
-#ifndef TUBA_INCLUDE
-
-/*
- * Cancel all timers for TCP tp.
- */
-void
-tcp_canceltimers(tp)
- struct tcpcb *tp;
-{
- register int i;
-
- for (i = 0; i < TCPT_NTIMERS; i++)
- tp->t_timer[i] = 0;
-}
-
-int tcp_backoff[TCP_MAXRXTSHIFT + 1] =
- { 1, 2, 4, 8, 16, 32, 64, 64, 64, 64, 64, 64, 64 };
-
-static int tcp_totbackoff = 511; /* sum of tcp_backoff[] */
-
-/*
- * TCP timer processing.
- */
-struct tcpcb *
-tcp_timers(tp, timer)
- register struct tcpcb *tp;
- int timer;
-{
- register int rexmt;
-
- switch (timer) {
-
- /*
- * 2 MSL timeout in shutdown went off. If we're closed but
- * still waiting for peer to close and connection has been idle
- * too long, or if 2MSL time is up from TIME_WAIT, delete connection
- * control block. Otherwise, check again in a bit.
- */
- case TCPT_2MSL:
- if (tp->t_state != TCPS_TIME_WAIT &&
- tp->t_idle <= tcp_maxidle)
- tp->t_timer[TCPT_2MSL] = tcp_keepintvl;
- else
- tp = tcp_close(tp);
- break;
-
- /*
- * Retransmission timer went off. Message has not
- * been acked within retransmit interval. Back off
- * to a longer retransmit interval and retransmit one segment.
- */
- case TCPT_REXMT:
- if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) {
- tp->t_rxtshift = TCP_MAXRXTSHIFT;
- tcpstat.tcps_timeoutdrop++;
- tp = tcp_drop(tp, tp->t_softerror ?
- tp->t_softerror : ETIMEDOUT);
- break;
- }
- tcpstat.tcps_rexmttimeo++;
- rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
- TCPT_RANGESET(tp->t_rxtcur, rexmt,
- tp->t_rttmin, TCPTV_REXMTMAX);
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
- /*
- * If losing, let the lower level know and try for
- * a better route. Also, if we backed off this far,
- * our srtt estimate is probably bogus. Clobber it
- * so we'll take the next rtt measurement as our srtt;
- * move the current srtt into rttvar to keep the current
- * retransmit times until then.
- */
- if (tp->t_rxtshift > TCP_MAXRXTSHIFT / 4) {
- in_losing(tp->t_inpcb);
- tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT);
- tp->t_srtt = 0;
- }
- tp->snd_nxt = tp->snd_una;
- /*
- * Force a segment to be sent.
- */
- tp->t_flags |= TF_ACKNOW;
- /*
- * If timing a segment in this window, stop the timer.
- */
- tp->t_rtt = 0;
- /*
- * Close the congestion window down to one segment
- * (we'll open it by one segment for each ack we get).
- * Since we probably have a window's worth of unacked
- * data accumulated, this "slow start" keeps us from
- * dumping all that data as back-to-back packets (which
- * might overwhelm an intermediate gateway).
- *
- * There are two phases to the opening: Initially we
- * open by one mss on each ack. This makes the window
- * size increase exponentially with time. If the
- * window is larger than the path can handle, this
- * exponential growth results in dropped packet(s)
- * almost immediately. To get more time between
- * drops but still "push" the network to take advantage
- * of improving conditions, we switch from exponential
- * to linear window opening at some threshhold size.
- * For a threshhold, we use half the current window
- * size, truncated to a multiple of the mss.
- *
- * (the minimum cwnd that will give us exponential
- * growth is 2 mss. We don't allow the threshhold
- * to go below this.)
- */
- {
- u_int win = min(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg;
- if (win < 2)
- win = 2;
- tp->snd_cwnd = tp->t_maxseg;
- tp->snd_ssthresh = win * tp->t_maxseg;
- tp->t_dupacks = 0;
- }
- (void) tcp_output(tp);
- break;
-
- /*
- * Persistance timer into zero window.
- * Force a byte to be output, if possible.
- */
- case TCPT_PERSIST:
- tcpstat.tcps_persisttimeo++;
- /*
- * Hack: if the peer is dead/unreachable, we do not
- * time out if the window is closed. After a full
- * backoff, drop the connection if the idle time
- * (no responses to probes) reaches the maximum
- * backoff that we would use if retransmitting.
- */
- if (tp->t_rxtshift == TCP_MAXRXTSHIFT) {
- u_long maxidle = TCP_REXMTVAL(tp);
- if (maxidle < tp->t_rttmin)
- maxidle = tp->t_rttmin;
- maxidle *= tcp_totbackoff;
- if (tp->t_idle >= tcp_maxpersistidle ||
- tp->t_idle >= maxidle) {
- tcpstat.tcps_persistdrop++;
- tp = tcp_drop(tp, ETIMEDOUT);
- break;
- }
- }
- tcp_setpersist(tp);
- tp->t_force = 1;
- (void) tcp_output(tp);
- tp->t_force = 0;
- break;
-
- /*
- * Keep-alive timer went off; send something
- * or drop connection if idle for too long.
- */
- case TCPT_KEEP:
- tcpstat.tcps_keeptimeo++;
- if (tp->t_state < TCPS_ESTABLISHED)
- goto dropit;
- if ((always_keepalive ||
- tp->t_inpcb->inp_socket->so_options & SO_KEEPALIVE) &&
- tp->t_state <= TCPS_CLOSING) {
- if (tp->t_idle >= tcp_keepidle + tcp_maxidle)
- goto dropit;
- /*
- * Send a packet designed to force a response
- * if the peer is up and reachable:
- * either an ACK if the connection is still alive,
- * or an RST if the peer has closed the connection
- * due to timeout or reboot.
- * Using sequence number tp->snd_una-1
- * causes the transmitted zero-length segment
- * to lie outside the receive window;
- * by the protocol spec, this requires the
- * correspondent TCP to respond.
- */
- tcpstat.tcps_keepprobe++;
-#ifdef TCP_COMPAT_42
- /*
- * The keepalive packet must have nonzero length
- * to get a 4.2 host to respond.
- */
- tcp_respond(tp, tp->t_template, (struct mbuf *)NULL,
- tp->rcv_nxt - 1, tp->snd_una - 1, 0);
-#else
- tcp_respond(tp, tp->t_template, (struct mbuf *)NULL,
- tp->rcv_nxt, tp->snd_una - 1, 0);
-#endif
- tp->t_timer[TCPT_KEEP] = tcp_keepintvl;
- } else
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- break;
- dropit:
- tcpstat.tcps_keepdrops++;
- tp = tcp_drop(tp, ETIMEDOUT);
- break;
- }
- return (tp);
-}
-#endif /* TUBA_INCLUDE */
diff --git a/c/src/exec/libnetworking/netinet/tcp_timer.h b/c/src/exec/libnetworking/netinet/tcp_timer.h
deleted file mode 100644
index 38ffac4ee7..0000000000
--- a/c/src/exec/libnetworking/netinet/tcp_timer.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_timer.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_TIMER_H_
-#define _NETINET_TCP_TIMER_H_
-
-/*
- * Definitions of the TCP timers. These timers are counted
- * down PR_SLOWHZ times a second.
- */
-#define TCPT_NTIMERS 4
-
-#define TCPT_REXMT 0 /* retransmit */
-#define TCPT_PERSIST 1 /* retransmit persistence */
-#define TCPT_KEEP 2 /* keep alive */
-#define TCPT_2MSL 3 /* 2*msl quiet time timer */
-
-/*
- * The TCPT_REXMT timer is used to force retransmissions.
- * The TCP has the TCPT_REXMT timer set whenever segments
- * have been sent for which ACKs are expected but not yet
- * received. If an ACK is received which advances tp->snd_una,
- * then the retransmit timer is cleared (if there are no more
- * outstanding segments) or reset to the base value (if there
- * are more ACKs expected). Whenever the retransmit timer goes off,
- * we retransmit one unacknowledged segment, and do a backoff
- * on the retransmit timer.
- *
- * The TCPT_PERSIST timer is used to keep window size information
- * flowing even if the window goes shut. If all previous transmissions
- * have been acknowledged (so that there are no retransmissions in progress),
- * and the window is too small to bother sending anything, then we start
- * the TCPT_PERSIST timer. When it expires, if the window is nonzero,
- * we go to transmit state. Otherwise, at intervals send a single byte
- * into the peer's window to force him to update our window information.
- * We do this at most as often as TCPT_PERSMIN time intervals,
- * but no more frequently than the current estimate of round-trip
- * packet time. The TCPT_PERSIST timer is cleared whenever we receive
- * a window update from the peer.
- *
- * The TCPT_KEEP timer is used to keep connections alive. If an
- * connection is idle (no segments received) for TCPTV_KEEP_INIT amount of time,
- * but not yet established, then we drop the connection. Once the connection
- * is established, if the connection is idle for TCPTV_KEEP_IDLE time
- * (and keepalives have been enabled on the socket), we begin to probe
- * the connection. We force the peer to send us a segment by sending:
- * <SEQ=SND.UNA-1><ACK=RCV.NXT><CTL=ACK>
- * This segment is (deliberately) outside the window, and should elicit
- * an ack segment in response from the peer. If, despite the TCPT_KEEP
- * initiated segments we cannot elicit a response from a peer in TCPT_MAXIDLE
- * amount of time probing, then we drop the connection.
- */
-
-/*
- * Time constants.
- */
-#define TCPTV_MSL ( 30*PR_SLOWHZ) /* max seg lifetime (hah!) */
-#define TCPTV_SRTTBASE 0 /* base roundtrip time;
- if 0, no idea yet */
-#define TCPTV_RTOBASE ( 3*PR_SLOWHZ) /* assumed RTO if no info */
-#define TCPTV_SRTTDFLT ( 3*PR_SLOWHZ) /* assumed RTT if no info */
-
-#define TCPTV_PERSMIN ( 5*PR_SLOWHZ) /* retransmit persistence */
-#define TCPTV_PERSMAX ( 60*PR_SLOWHZ) /* maximum persist interval */
-
-#define TCPTV_KEEP_INIT ( 75*PR_SLOWHZ) /* initial connect keep alive */
-#define TCPTV_KEEP_IDLE (120*60*PR_SLOWHZ) /* dflt time before probing */
-#define TCPTV_KEEPINTVL ( 75*PR_SLOWHZ) /* default probe interval */
-#define TCPTV_KEEPCNT 8 /* max probes before drop */
-
-#define TCPTV_MIN ( 1*PR_SLOWHZ) /* minimum allowable value */
-#define TCPTV_REXMTMAX ( 64*PR_SLOWHZ) /* max allowable REXMT value */
-
-#define TCPTV_TWTRUNC 8 /* RTO factor to truncate TW */
-
-#define TCP_LINGERTIME 120 /* linger at most 2 minutes */
-
-#define TCP_MAXRXTSHIFT 12 /* maximum retransmits */
-
-#ifdef TCPTIMERS
-static char *tcptimers[] =
- { "REXMT", "PERSIST", "KEEP", "2MSL" };
-#endif
-
-/*
- * Force a time value to be in a certain range.
- */
-#define TCPT_RANGESET(tv, value, tvmin, tvmax) { \
- (tv) = (value); \
- if ((u_long)(tv) < (u_long)(tvmin)) \
- (tv) = (tvmin); \
- else if ((u_long)(tv) > (u_long)(tvmax)) \
- (tv) = (tvmax); \
-}
-
-#ifdef KERNEL
-extern int tcp_keepinit; /* time to establish connection */
-extern int tcp_keepidle; /* time before keepalive probes begin */
-extern int tcp_keepintvl; /* time between keepalive probes */
-extern int tcp_maxidle; /* time to drop after starting probes */
-extern int tcp_ttl; /* time to live for TCP segs */
-extern int tcp_backoff[];
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/netinet/tcp_usrreq.c b/c/src/exec/libnetworking/netinet/tcp_usrreq.c
deleted file mode 100644
index ecd9d95636..0000000000
--- a/c/src/exec/libnetworking/netinet/tcp_usrreq.c
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-#include <sys/stat.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-/*
- * TCP protocol interface to socket abstraction.
- */
-extern char *tcpstates[];
-
-static int tcp_attach __P((struct socket *));
-static int tcp_connect __P((struct tcpcb *, struct mbuf *));
-static struct tcpcb *
- tcp_disconnect __P((struct tcpcb *));
-static struct tcpcb *
- tcp_usrclosed __P((struct tcpcb *));
-
-#ifdef TCPDEBUG
-#define TCPDEBUG0 int ostate
-#define TCPDEBUG1() ostate = tp ? tp->t_state : 0
-#define TCPDEBUG2(req) if (tp && (so->so_options & SO_DEBUG)) \
- tcp_trace(TA_USER, ostate, tp, 0, req)
-#else
-#define TCPDEBUG0
-#define TCPDEBUG1()
-#define TCPDEBUG2(req)
-#endif
-
-/*
- * TCP attaches to socket via pru_attach(), reserving space,
- * and an internet control block.
- */
-static int
-tcp_usr_attach(struct socket *so, int proto)
-{
- int s = splnet();
- int error;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp = 0;
- TCPDEBUG0;
-
- TCPDEBUG1();
- if (inp) {
- error = EISCONN;
- goto out;
- }
-
- error = tcp_attach(so);
- if (error)
- goto out;
-
- if ((so->so_options & SO_LINGER) && so->so_linger == 0)
- so->so_linger = TCP_LINGERTIME * hz;
- tp = sototcpcb(so);
-out:
- TCPDEBUG2(PRU_ATTACH);
- splx(s);
- return error;
-}
-
-/*
- * pru_detach() detaches the TCP protocol from the socket.
- * If the protocol state is non-embryonic, then can't
- * do this directly: have to initiate a pru_disconnect(),
- * which may finish later; embryonic TCB's can just
- * be discarded here.
- */
-static int
-tcp_usr_detach(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
- TCPDEBUG0;
-
- if (inp == 0) {
- splx(s);
- return EINVAL; /* XXX */
- }
- tp = intotcpcb(inp);
- TCPDEBUG1();
- if (tp->t_state > TCPS_LISTEN)
- tp = tcp_disconnect(tp);
- else
- tp = tcp_close(tp);
-
- TCPDEBUG2(PRU_DETACH);
- splx(s);
- return error;
-}
-
-#define COMMON_START() TCPDEBUG0; \
- do { \
- if (inp == 0) { \
- splx(s); \
- return EINVAL; \
- } \
- tp = intotcpcb(inp); \
- TCPDEBUG1(); \
- } while(0)
-
-#define COMMON_END(req) out: TCPDEBUG2(req); splx(s); return error; goto out
-
-
-/*
- * Give the socket an address.
- */
-static int
-tcp_usr_bind(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
- struct sockaddr_in *sinp;
-
- COMMON_START();
-
- /*
- * Must check for multicast addresses and disallow binding
- * to them.
- */
- sinp = mtod(nam, struct sockaddr_in *);
- if (sinp->sin_family == AF_INET &&
- IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) {
- error = EAFNOSUPPORT;
- goto out;
- }
- error = in_pcbbind(inp, nam);
- if (error)
- goto out;
- COMMON_END(PRU_BIND);
-
-}
-
-/*
- * Prepare to accept connections.
- */
-static int
-tcp_usr_listen(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- if (inp->inp_lport == 0)
- error = in_pcbbind(inp, NULL);
- if (error == 0)
- tp->t_state = TCPS_LISTEN;
- COMMON_END(PRU_LISTEN);
-}
-
-/*
- * Initiate connection to peer.
- * Create a template for use in transmissions on this connection.
- * Enter SYN_SENT state, and mark socket as connecting.
- * Start keep-alive timer, and seed output sequence space.
- * Send initial segment on connection.
- */
-static int
-tcp_usr_connect(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
- struct sockaddr_in *sinp;
-
- COMMON_START();
-
- /*
- * Must disallow TCP ``connections'' to multicast addresses.
- */
- sinp = mtod(nam, struct sockaddr_in *);
- if (sinp->sin_family == AF_INET
- && IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) {
- error = EAFNOSUPPORT;
- goto out;
- }
-
- if ((error = tcp_connect(tp, nam)) != 0)
- goto out;
- error = tcp_output(tp);
- COMMON_END(PRU_CONNECT);
-}
-
-/*
- * Initiate disconnect from peer.
- * If connection never passed embryonic stage, just drop;
- * else if don't need to let data drain, then can just drop anyways,
- * else have to begin TCP shutdown process: mark socket disconnecting,
- * drain unread data, state switch to reflect user close, and
- * send segment (e.g. FIN) to peer. Socket will be really disconnected
- * when peer sends FIN and acks ours.
- *
- * SHOULD IMPLEMENT LATER PRU_CONNECT VIA REALLOC TCPCB.
- */
-static int
-tcp_usr_disconnect(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- tp = tcp_disconnect(tp);
- COMMON_END(PRU_DISCONNECT);
-}
-
-/*
- * Accept a connection. Essentially all the work is
- * done at higher levels; just return the address
- * of the peer, storing through addr.
- */
-static int
-tcp_usr_accept(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- in_setpeeraddr(inp, nam);
- COMMON_END(PRU_ACCEPT);
-}
-
-/*
- * Mark the connection as being incapable of further output.
- */
-static int
-tcp_usr_shutdown(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- socantsendmore(so);
- tp = tcp_usrclosed(tp);
- if (tp)
- error = tcp_output(tp);
- COMMON_END(PRU_SHUTDOWN);
-}
-
-/*
- * After a receive, possibly send window update to peer.
- */
-static int
-tcp_usr_rcvd(struct socket *so, int flags)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- tcp_output(tp);
- COMMON_END(PRU_RCVD);
-}
-
-/*
- * Do a send by putting data in output queue and updating urgent
- * marker if URG set. Possibly send more data.
- */
-static int
-tcp_usr_send(struct socket *so, int flags, struct mbuf *m, struct mbuf *nam,
- struct mbuf *control)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- if (control && control->m_len) {
- m_freem(control); /* XXX shouldn't caller do this??? */
- if (m)
- m_freem(m);
- error = EINVAL;
- goto out;
- }
-
- if(!(flags & PRUS_OOB)) {
- sbappend(&so->so_snd, m);
- if (nam && tp->t_state < TCPS_SYN_SENT) {
- /*
- * Do implied connect if not yet connected,
- * initialize window to default value, and
- * initialize maxseg/maxopd using peer's cached
- * MSS.
- */
- error = tcp_connect(tp, nam);
- if (error)
- goto out;
- tp->snd_wnd = TTCP_CLIENT_SND_WND;
- tcp_mss(tp, -1);
- }
-
- if (flags & PRUS_EOF) {
- /*
- * Close the send side of the connection after
- * the data is sent.
- */
- socantsendmore(so);
- tp = tcp_usrclosed(tp);
- }
- if (tp != NULL)
- error = tcp_output(tp);
- } else {
- if (sbspace(&so->so_snd) < -512) {
- m_freem(m);
- error = ENOBUFS;
- goto out;
- }
- /*
- * According to RFC961 (Assigned Protocols),
- * the urgent pointer points to the last octet
- * of urgent data. We continue, however,
- * to consider it to indicate the first octet
- * of data past the urgent section.
- * Otherwise, snd_up should be one lower.
- */
- sbappend(&so->so_snd, m);
- if (nam && tp->t_state < TCPS_SYN_SENT) {
- /*
- * Do implied connect if not yet connected,
- * initialize window to default value, and
- * initialize maxseg/maxopd using peer's cached
- * MSS.
- */
- error = tcp_connect(tp, nam);
- if (error)
- goto out;
- tp->snd_wnd = TTCP_CLIENT_SND_WND;
- tcp_mss(tp, -1);
- }
- tp->snd_up = tp->snd_una + so->so_snd.sb_cc;
- tp->t_force = 1;
- error = tcp_output(tp);
- tp->t_force = 0;
- }
- COMMON_END((flags & PRUS_OOB) ? PRU_SENDOOB :
- ((flags & PRUS_EOF) ? PRU_SEND_EOF : PRU_SEND));
-}
-
-/*
- * Abort the TCP.
- */
-static int
-tcp_usr_abort(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- tp = tcp_drop(tp, ECONNABORTED);
- COMMON_END(PRU_ABORT);
-}
-
-/*
- * Fill in st_bklsize for fstat() operations on a socket.
- */
-static int
-tcp_usr_sense(struct socket *so, struct stat *sb)
-{
- int s = splnet();
-
- sb->st_blksize = so->so_snd.sb_hiwat;
- splx(s);
- return 0;
-}
-
-/*
- * Receive out-of-band data.
- */
-static int
-tcp_usr_rcvoob(struct socket *so, struct mbuf *m, int flags)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- if ((so->so_oobmark == 0 &&
- (so->so_state & SS_RCVATMARK) == 0) ||
- so->so_options & SO_OOBINLINE ||
- tp->t_oobflags & TCPOOB_HADDATA) {
- error = EINVAL;
- goto out;
- }
- if ((tp->t_oobflags & TCPOOB_HAVEDATA) == 0) {
- error = EWOULDBLOCK;
- goto out;
- }
- m->m_len = 1;
- *mtod(m, caddr_t) = tp->t_iobc;
- if ((flags & MSG_PEEK) == 0)
- tp->t_oobflags ^= (TCPOOB_HAVEDATA | TCPOOB_HADDATA);
- COMMON_END(PRU_RCVOOB);
-}
-
-static int
-tcp_usr_sockaddr(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- in_setsockaddr(inp, nam);
- COMMON_END(PRU_SOCKADDR);
-}
-
-static int
-tcp_usr_peeraddr(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- in_setpeeraddr(inp, nam);
- COMMON_END(PRU_PEERADDR);
-}
-
-/*
- * XXX - this should just be a call to in_control, but we need to get
- * the types worked out.
- */
-static int
-tcp_usr_control(struct socket *so, int cmd, caddr_t arg, struct ifnet *ifp)
-{
- return in_control(so, cmd, arg, ifp);
-}
-
-/* xxx - should be const */
-struct pr_usrreqs tcp_usrreqs = {
- tcp_usr_abort, tcp_usr_accept, tcp_usr_attach, tcp_usr_bind,
- tcp_usr_connect, pru_connect2_notsupp, tcp_usr_control, tcp_usr_detach,
- tcp_usr_disconnect, tcp_usr_listen, tcp_usr_peeraddr, tcp_usr_rcvd,
- tcp_usr_rcvoob, tcp_usr_send, tcp_usr_sense, tcp_usr_shutdown,
- tcp_usr_sockaddr
-};
-
-/*
- * Common subroutine to open a TCP connection to remote host specified
- * by struct sockaddr_in in mbuf *nam. Call in_pcbbind to assign a local
- * port number if needed. Call in_pcbladdr to do the routing and to choose
- * a local host address (interface). If there is an existing incarnation
- * of the same connection in TIME-WAIT state and if the remote host was
- * sending CC options and if the connection duration was < MSL, then
- * truncate the previous TIME-WAIT state and proceed.
- * Initialize connection parameters and enter SYN-SENT state.
- */
-static int
-tcp_connect(tp, nam)
- register struct tcpcb *tp;
- struct mbuf *nam;
-{
- struct inpcb *inp = tp->t_inpcb, *oinp;
- struct socket *so = inp->inp_socket;
- struct tcpcb *otp;
- struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *);
- struct sockaddr_in *ifaddr;
- int error;
- struct rmxp_tao *taop;
- struct rmxp_tao tao_noncached;
-
- if (inp->inp_lport == 0) {
- error = in_pcbbind(inp, NULL);
- if (error)
- return error;
- }
-
- /*
- * Cannot simply call in_pcbconnect, because there might be an
- * earlier incarnation of this same connection still in
- * TIME_WAIT state, creating an ADDRINUSE error.
- */
- error = in_pcbladdr(inp, nam, &ifaddr);
- if (error)
- return error;
- oinp = in_pcblookuphash(inp->inp_pcbinfo,
- sin->sin_addr, sin->sin_port,
- inp->inp_laddr.s_addr != INADDR_ANY ? inp->inp_laddr
- : ifaddr->sin_addr,
- inp->inp_lport, 0);
- if (oinp) {
- if (oinp != inp && (otp = intotcpcb(oinp)) != NULL &&
- otp->t_state == TCPS_TIME_WAIT &&
- otp->t_duration < TCPTV_MSL &&
- (otp->t_flags & TF_RCVD_CC))
- otp = tcp_close(otp);
- else
- return EADDRINUSE;
- }
- if (inp->inp_laddr.s_addr == INADDR_ANY)
- inp->inp_laddr = ifaddr->sin_addr;
- inp->inp_faddr = sin->sin_addr;
- inp->inp_fport = sin->sin_port;
- in_pcbrehash(inp);
-
- tp->t_template = tcp_template(tp);
- if (tp->t_template == 0) {
- in_pcbdisconnect(inp);
- return ENOBUFS;
- }
-
- /* Compute window scaling to request. */
- while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
- (TCP_MAXWIN << tp->request_r_scale) < so->so_rcv.sb_hiwat)
- tp->request_r_scale++;
-
- soisconnecting(so);
- tcpstat.tcps_connattempt++;
- tp->t_state = TCPS_SYN_SENT;
- tp->t_timer[TCPT_KEEP] = tcp_keepinit;
- tp->iss = tcp_iss; tcp_iss += TCP_ISSINCR/2;
- tcp_sendseqinit(tp);
-
- /*
- * Generate a CC value for this connection and
- * check whether CC or CCnew should be used.
- */
- if ((taop = tcp_gettaocache(tp->t_inpcb)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
-
- tp->cc_send = CC_INC(tcp_ccgen);
- if (taop->tao_ccsent != 0 &&
- CC_GEQ(tp->cc_send, taop->tao_ccsent)) {
- taop->tao_ccsent = tp->cc_send;
- } else {
- taop->tao_ccsent = 0;
- tp->t_flags |= TF_SENDCCNEW;
- }
-
- return 0;
-}
-
-int
-tcp_ctloutput(op, so, level, optname, mp)
- int op;
- struct socket *so;
- int level, optname;
- struct mbuf **mp;
-{
- int error = 0, s;
- struct inpcb *inp;
- register struct tcpcb *tp;
- register struct mbuf *m;
- register int i;
-
- s = splnet();
- inp = sotoinpcb(so);
- if (inp == NULL) {
- splx(s);
- if (op == PRCO_SETOPT && *mp)
- (void) m_free(*mp);
- return (ECONNRESET);
- }
- if (level != IPPROTO_TCP) {
- error = ip_ctloutput(op, so, level, optname, mp);
- splx(s);
- return (error);
- }
- tp = intotcpcb(inp);
-
- switch (op) {
-
- case PRCO_SETOPT:
- m = *mp;
- switch (optname) {
-
- case TCP_NODELAY:
- if (m == NULL || m->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(m, int *))
- tp->t_flags |= TF_NODELAY;
- else
- tp->t_flags &= ~TF_NODELAY;
- break;
-
- case TCP_MAXSEG:
- if (m && (i = *mtod(m, int *)) > 0 && i <= tp->t_maxseg)
- tp->t_maxseg = i;
- else
- error = EINVAL;
- break;
-
- case TCP_NOOPT:
- if (m == NULL || m->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(m, int *))
- tp->t_flags |= TF_NOOPT;
- else
- tp->t_flags &= ~TF_NOOPT;
- break;
-
- case TCP_NOPUSH:
- if (m == NULL || m->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(m, int *))
- tp->t_flags |= TF_NOPUSH;
- else
- tp->t_flags &= ~TF_NOPUSH;
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- if (m)
- (void) m_free(m);
- break;
-
- case PRCO_GETOPT:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof(int);
-
- switch (optname) {
- case TCP_NODELAY:
- *mtod(m, int *) = tp->t_flags & TF_NODELAY;
- break;
- case TCP_MAXSEG:
- *mtod(m, int *) = tp->t_maxseg;
- break;
- case TCP_NOOPT:
- *mtod(m, int *) = tp->t_flags & TF_NOOPT;
- break;
- case TCP_NOPUSH:
- *mtod(m, int *) = tp->t_flags & TF_NOPUSH;
- break;
- default:
- error = ENOPROTOOPT;
- break;
- }
- break;
- }
- splx(s);
- return (error);
-}
-
-/*
- * tcp_sendspace and tcp_recvspace are the default send and receive window
- * sizes, respectively. These are obsolescent (this information should
- * be set by the route).
- */
-u_long tcp_sendspace = 1024*16;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_SENDSPACE, sendspace,
- CTLFLAG_RW, &tcp_sendspace , 0, "");
-u_long tcp_recvspace = 1024*16;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace,
- CTLFLAG_RW, &tcp_recvspace , 0, "");
-
-/*
- * Attach TCP protocol to socket, allocating
- * internet protocol control block, tcp control block,
- * bufer space, and entering LISTEN state if to accept connections.
- */
-static int
-tcp_attach(so)
- struct socket *so;
-{
- register struct tcpcb *tp;
- struct inpcb *inp;
- int error;
-
- if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) {
- error = soreserve(so, tcp_sendspace, tcp_recvspace);
- if (error)
- return (error);
- }
- error = in_pcballoc(so, &tcbinfo);
- if (error)
- return (error);
- inp = sotoinpcb(so);
- tp = tcp_newtcpcb(inp);
- if (tp == 0) {
- int nofd = so->so_state & SS_NOFDREF; /* XXX */
-
- so->so_state &= ~SS_NOFDREF; /* don't free the socket yet */
- in_pcbdetach(inp);
- so->so_state |= nofd;
- return (ENOBUFS);
- }
- tp->t_state = TCPS_CLOSED;
- return (0);
-}
-
-/*
- * Initiate (or continue) disconnect.
- * If embryonic state, just send reset (once).
- * If in ``let data drain'' option and linger null, just drop.
- * Otherwise (hard), mark socket disconnecting and drop
- * current input data; switch states based on user close, and
- * send segment to peer (with FIN).
- */
-static struct tcpcb *
-tcp_disconnect(tp)
- register struct tcpcb *tp;
-{
- struct socket *so = tp->t_inpcb->inp_socket;
-
- if (tp->t_state < TCPS_ESTABLISHED)
- tp = tcp_close(tp);
- else if ((so->so_options & SO_LINGER) && so->so_linger == 0)
- tp = tcp_drop(tp, 0);
- else {
- soisdisconnecting(so);
- sbflush(&so->so_rcv);
- tp = tcp_usrclosed(tp);
- if (tp)
- (void) tcp_output(tp);
- }
- return (tp);
-}
-
-/*
- * User issued close, and wish to trail through shutdown states:
- * if never received SYN, just forget it. If got a SYN from peer,
- * but haven't sent FIN, then go to FIN_WAIT_1 state to send peer a FIN.
- * If already got a FIN from peer, then almost done; go to LAST_ACK
- * state. In all other cases, have already sent FIN to peer (e.g.
- * after PRU_SHUTDOWN), and just have to play tedious game waiting
- * for peer to send FIN or not respond to keep-alives, etc.
- * We can let the user exit from the close as soon as the FIN is acked.
- */
-static struct tcpcb *
-tcp_usrclosed(tp)
- register struct tcpcb *tp;
-{
-
- switch (tp->t_state) {
-
- case TCPS_CLOSED:
- case TCPS_LISTEN:
- tp->t_state = TCPS_CLOSED;
- tp = tcp_close(tp);
- break;
-
- case TCPS_SYN_SENT:
- case TCPS_SYN_RECEIVED:
- tp->t_flags |= TF_NEEDFIN;
- break;
-
- case TCPS_ESTABLISHED:
- tp->t_state = TCPS_FIN_WAIT_1;
- break;
-
- case TCPS_CLOSE_WAIT:
- tp->t_state = TCPS_LAST_ACK;
- break;
- }
- if (tp && tp->t_state >= TCPS_FIN_WAIT_2) {
- soisdisconnected(tp->t_inpcb->inp_socket);
- /* To prevent the connection hanging in FIN_WAIT_2 forever. */
- if (tp->t_state == TCPS_FIN_WAIT_2)
- tp->t_timer[TCPT_2MSL] = tcp_maxidle;
- }
- return (tp);
-}
-
diff --git a/c/src/exec/libnetworking/netinet/tcp_var.h b/c/src/exec/libnetworking/netinet/tcp_var.h
deleted file mode 100644
index 8e63a2cafe..0000000000
--- a/c/src/exec/libnetworking/netinet/tcp_var.h
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993, 1994, 1995
- * 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.
- *
- * @(#)tcp_var.h 8.4 (Berkeley) 5/24/95
- * $Id$
- */
-
-#ifndef _NETINET_TCP_VAR_H_
-#define _NETINET_TCP_VAR_H_
-/*
- * Kernel variables for tcp.
- */
-
-/*
- * Tcp control block, one per tcp; fields:
- */
-struct tcpcb {
- struct tcpiphdr *seg_next; /* sequencing queue */
- struct tcpiphdr *seg_prev;
- int t_state; /* state of this connection */
- int t_timer[TCPT_NTIMERS]; /* tcp timers */
- int t_rxtshift; /* log(2) of rexmt exp. backoff */
- int t_rxtcur; /* current retransmit value */
- int t_dupacks; /* consecutive dup acks recd */
- u_int t_maxseg; /* maximum segment size */
- u_int t_maxopd; /* mss plus options */
- int t_force; /* 1 if forcing out a byte */
- u_int t_flags;
-#define TF_ACKNOW 0x0001 /* ack peer immediately */
-#define TF_DELACK 0x0002 /* ack, but try to delay it */
-#define TF_NODELAY 0x0004 /* don't delay packets to coalesce */
-#define TF_NOOPT 0x0008 /* don't use tcp options */
-#define TF_SENTFIN 0x0010 /* have sent FIN */
-#define TF_REQ_SCALE 0x0020 /* have/will request window scaling */
-#define TF_RCVD_SCALE 0x0040 /* other side has requested scaling */
-#define TF_REQ_TSTMP 0x0080 /* have/will request timestamps */
-#define TF_RCVD_TSTMP 0x0100 /* a timestamp was received in SYN */
-#define TF_SACK_PERMIT 0x0200 /* other side said I could SACK */
-#define TF_NEEDSYN 0x0400 /* send SYN (implicit state) */
-#define TF_NEEDFIN 0x0800 /* send FIN (implicit state) */
-#define TF_NOPUSH 0x1000 /* don't push */
-#define TF_REQ_CC 0x2000 /* have/will request CC */
-#define TF_RCVD_CC 0x4000 /* a CC was received in SYN */
-#define TF_SENDCCNEW 0x8000 /* send CCnew instead of CC in SYN */
-
- struct tcpiphdr *t_template; /* skeletal packet for transmit */
- struct inpcb *t_inpcb; /* back pointer to internet pcb */
-/*
- * The following fields are used as in the protocol specification.
- * See RFC783, Dec. 1981, page 21.
- */
-/* send sequence variables */
- tcp_seq snd_una; /* send unacknowledged */
- tcp_seq snd_nxt; /* send next */
- tcp_seq snd_up; /* send urgent pointer */
- tcp_seq snd_wl1; /* window update seg seq number */
- tcp_seq snd_wl2; /* window update seg ack number */
- tcp_seq iss; /* initial send sequence number */
- u_long snd_wnd; /* send window */
-/* receive sequence variables */
- u_long rcv_wnd; /* receive window */
- tcp_seq rcv_nxt; /* receive next */
- tcp_seq rcv_up; /* receive urgent pointer */
- tcp_seq irs; /* initial receive sequence number */
-/*
- * Additional variables for this implementation.
- */
-/* receive variables */
- tcp_seq rcv_adv; /* advertised window */
-/* retransmit variables */
- tcp_seq snd_max; /* highest sequence number sent;
- * used to recognize retransmits
- */
-/* congestion control (for slow start, source quench, retransmit after loss) */
- u_long snd_cwnd; /* congestion-controlled window */
- u_long snd_ssthresh; /* snd_cwnd size threshold for
- * for slow start exponential to
- * linear switch
- */
-/*
- * transmit timing stuff. See below for scale of srtt and rttvar.
- * "Variance" is actually smoothed difference.
- */
- u_int t_idle; /* inactivity time */
- int t_rtt; /* round trip time */
- tcp_seq t_rtseq; /* sequence number being timed */
- int t_srtt; /* smoothed round-trip time */
- int t_rttvar; /* variance in round-trip time */
- u_int t_rttmin; /* minimum rtt allowed */
- u_long max_sndwnd; /* largest window peer has offered */
-
-/* out-of-band data */
- char t_oobflags; /* have some */
- char t_iobc; /* input character */
-#define TCPOOB_HAVEDATA 0x01
-#define TCPOOB_HADDATA 0x02
- int t_softerror; /* possible error not yet reported */
-
-/* RFC 1323 variables */
- u_char snd_scale; /* window scaling for send window */
- u_char rcv_scale; /* window scaling for recv window */
- u_char request_r_scale; /* pending window scaling */
- u_char requested_s_scale;
- u_long ts_recent; /* timestamp echo data */
- u_long ts_recent_age; /* when last updated */
- tcp_seq last_ack_sent;
-/* RFC 1644 variables */
- tcp_cc cc_send; /* send connection count */
- tcp_cc cc_recv; /* receive connection count */
- u_long t_duration; /* connection duration */
-
-/* TUBA stuff */
- caddr_t t_tuba_pcb; /* next level down pcb for TCP over z */
-/* More RTT stuff */
- u_long t_rttupdated; /* number of times rtt sampled */
-};
-
-/*
- * Structure to hold TCP options that are only used during segment
- * processing (in tcp_input), but not held in the tcpcb.
- * It's basically used to reduce the number of parameters
- * to tcp_dooptions.
- */
-struct tcpopt {
- u_long to_flag; /* which options are present */
-#define TOF_TS 0x0001 /* timestamp */
-#define TOF_CC 0x0002 /* CC and CCnew are exclusive */
-#define TOF_CCNEW 0x0004
-#define TOF_CCECHO 0x0008
- u_long to_tsval;
- u_long to_tsecr;
- tcp_cc to_cc; /* holds CC or CCnew */
- tcp_cc to_ccecho;
-};
-
-/*
- * The TAO cache entry which is stored in the protocol family specific
- * portion of the route metrics.
- */
-struct rmxp_tao {
- tcp_cc tao_cc; /* latest CC in valid SYN */
- tcp_cc tao_ccsent; /* latest CC sent to peer */
- u_short tao_mssopt; /* peer's cached MSS */
-#ifdef notyet
- u_short tao_flags; /* cache status flags */
-#define TAOF_DONT 0x0001 /* peer doesn't understand rfc1644 */
-#define TAOF_OK 0x0002 /* peer does understand rfc1644 */
-#define TAOF_UNDEF 0 /* we don't know yet */
-#endif /* notyet */
-};
-#define rmx_taop(r) ((struct rmxp_tao *)(r).rmx_filler)
-
-#define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb)
-#define sototcpcb(so) (intotcpcb(sotoinpcb(so)))
-
-/*
- * The smoothed round-trip time and estimated variance
- * are stored as fixed point numbers scaled by the values below.
- * For convenience, these scales are also used in smoothing the average
- * (smoothed = (1/scale)sample + ((scale-1)/scale)smoothed).
- * With these scales, srtt has 3 bits to the right of the binary point,
- * and thus an "ALPHA" of 0.875. rttvar has 2 bits to the right of the
- * binary point, and is smoothed with an ALPHA of 0.75.
- */
-#define TCP_RTT_SCALE 32 /* multiplier for srtt; 3 bits frac. */
-#define TCP_RTT_SHIFT 5 /* shift for srtt; 3 bits frac. */
-#define TCP_RTTVAR_SCALE 16 /* multiplier for rttvar; 2 bits */
-#define TCP_RTTVAR_SHIFT 4 /* shift for rttvar; 2 bits */
-#define TCP_DELTA_SHIFT 2 /* see tcp_input.c */
-
-/*
- * The initial retransmission should happen at rtt + 4 * rttvar.
- * Because of the way we do the smoothing, srtt and rttvar
- * will each average +1/2 tick of bias. When we compute
- * the retransmit timer, we want 1/2 tick of rounding and
- * 1 extra tick because of +-1/2 tick uncertainty in the
- * firing of the timer. The bias will give us exactly the
- * 1.5 tick we need. But, because the bias is
- * statistical, we have to test that we don't drop below
- * the minimum feasible timer (which is 2 ticks).
- * This version of the macro adapted from a paper by Lawrence
- * Brakmo and Larry Peterson which outlines a problem caused
- * by insufficient precision in the original implementation,
- * which results in inappropriately large RTO values for very
- * fast networks.
- */
-#define TCP_REXMTVAL(tp) \
- ((((tp)->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT)) \
- + (tp)->t_rttvar) >> TCP_DELTA_SHIFT)
-
-/* XXX
- * We want to avoid doing m_pullup on incoming packets but that
- * means avoiding dtom on the tcp reassembly code. That in turn means
- * keeping an mbuf pointer in the reassembly queue (since we might
- * have a cluster). As a quick hack, the source & destination
- * port numbers (which are no longer needed once we've located the
- * tcpcb) are overlayed with an mbuf pointer.
- */
-#define REASS_MBUF(ti) (*(struct mbuf **)&((ti)->ti_t))
-
-/*
- * TCP statistics.
- * Many of these should be kept per connection,
- * but that's inconvenient at the moment.
- */
-struct tcpstat {
- u_long tcps_connattempt; /* connections initiated */
- u_long tcps_accepts; /* connections accepted */
- u_long tcps_connects; /* connections established */
- u_long tcps_drops; /* connections dropped */
- u_long tcps_conndrops; /* embryonic connections dropped */
- u_long tcps_closed; /* conn. closed (includes drops) */
- u_long tcps_segstimed; /* segs where we tried to get rtt */
- u_long tcps_rttupdated; /* times we succeeded */
- u_long tcps_delack; /* delayed acks sent */
- u_long tcps_timeoutdrop; /* conn. dropped in rxmt timeout */
- u_long tcps_rexmttimeo; /* retransmit timeouts */
- u_long tcps_persisttimeo; /* persist timeouts */
- u_long tcps_keeptimeo; /* keepalive timeouts */
- u_long tcps_keepprobe; /* keepalive probes sent */
- u_long tcps_keepdrops; /* connections dropped in keepalive */
-
- u_long tcps_sndtotal; /* total packets sent */
- u_long tcps_sndpack; /* data packets sent */
- u_long tcps_sndbyte; /* data bytes sent */
- u_long tcps_sndrexmitpack; /* data packets retransmitted */
- u_long tcps_sndrexmitbyte; /* data bytes retransmitted */
- u_long tcps_sndacks; /* ack-only packets sent */
- u_long tcps_sndprobe; /* window probes sent */
- u_long tcps_sndurg; /* packets sent with URG only */
- u_long tcps_sndwinup; /* window update-only packets sent */
- u_long tcps_sndctrl; /* control (SYN|FIN|RST) packets sent */
-
- u_long tcps_rcvtotal; /* total packets received */
- u_long tcps_rcvpack; /* packets received in sequence */
- u_long tcps_rcvbyte; /* bytes received in sequence */
- u_long tcps_rcvbadsum; /* packets received with ccksum errs */
- u_long tcps_rcvbadoff; /* packets received with bad offset */
- u_long tcps_rcvshort; /* packets received too short */
- u_long tcps_rcvduppack; /* duplicate-only packets received */
- u_long tcps_rcvdupbyte; /* duplicate-only bytes received */
- u_long tcps_rcvpartduppack; /* packets with some duplicate data */
- u_long tcps_rcvpartdupbyte; /* dup. bytes in part-dup. packets */
- u_long tcps_rcvoopack; /* out-of-order packets received */
- u_long tcps_rcvoobyte; /* out-of-order bytes received */
- u_long tcps_rcvpackafterwin; /* packets with data after window */
- u_long tcps_rcvbyteafterwin; /* bytes rcvd after window */
- u_long tcps_rcvafterclose; /* packets rcvd after "close" */
- u_long tcps_rcvwinprobe; /* rcvd window probe packets */
- u_long tcps_rcvdupack; /* rcvd duplicate acks */
- u_long tcps_rcvacktoomuch; /* rcvd acks for unsent data */
- u_long tcps_rcvackpack; /* rcvd ack packets */
- u_long tcps_rcvackbyte; /* bytes acked by rcvd acks */
- u_long tcps_rcvwinupd; /* rcvd window update packets */
- u_long tcps_pawsdrop; /* segments dropped due to PAWS */
- u_long tcps_predack; /* times hdr predict ok for acks */
- u_long tcps_preddat; /* times hdr predict ok for data pkts */
- u_long tcps_pcbcachemiss;
- u_long tcps_cachedrtt; /* times cached RTT in route updated */
- u_long tcps_cachedrttvar; /* times cached rttvar updated */
- u_long tcps_cachedssthresh; /* times cached ssthresh updated */
- u_long tcps_usedrtt; /* times RTT initialized from route */
- u_long tcps_usedrttvar; /* times RTTVAR initialized from rt */
- u_long tcps_usedssthresh; /* times ssthresh initialized from rt*/
- u_long tcps_persistdrop; /* timeout in persist state */
- u_long tcps_badsyn; /* bogus SYN, e.g. premature ACK */
- u_long tcps_mturesent; /* resends due to MTU discovery */
- u_long tcps_listendrop; /* listen queue overflows */
-};
-
-/*
- * Names for TCP sysctl objects
- */
-#define TCPCTL_DO_RFC1323 1 /* use RFC-1323 extensions */
-#define TCPCTL_DO_RFC1644 2 /* use RFC-1644 extensions */
-#define TCPCTL_MSSDFLT 3 /* MSS default */
-#define TCPCTL_STATS 4 /* statistics (read-only) */
-#define TCPCTL_RTTDFLT 5 /* default RTT estimate */
-#define TCPCTL_KEEPIDLE 6 /* keepalive idle timer */
-#define TCPCTL_KEEPINTVL 7 /* interval to send keepalives */
-#define TCPCTL_SENDSPACE 8 /* send buffer space */
-#define TCPCTL_RECVSPACE 9 /* receive buffer space */
-#define TCPCTL_KEEPINIT 10 /* receive buffer space */
-#define TCPCTL_MAXID 11
-
-#define TCPCTL_NAMES { \
- { 0, 0 }, \
- { "rfc1323", CTLTYPE_INT }, \
- { "rfc1644", CTLTYPE_INT }, \
- { "mssdflt", CTLTYPE_INT }, \
- { "stats", CTLTYPE_STRUCT }, \
- { "rttdflt", CTLTYPE_INT }, \
- { "keepidle", CTLTYPE_INT }, \
- { "keepintvl", CTLTYPE_INT }, \
- { "sendspace", CTLTYPE_INT }, \
- { "recvspace", CTLTYPE_INT }, \
- { "keepinit", CTLTYPE_INT }, \
-}
-
-#ifdef KERNEL
-extern struct inpcbhead tcb; /* head of queue of active tcpcb's */
-extern struct inpcbinfo tcbinfo;
-extern struct tcpstat tcpstat; /* tcp statistics */
-extern int tcp_mssdflt; /* XXX */
-extern u_long tcp_now; /* for RFC 1323 timestamps */
-
-void tcp_canceltimers __P((struct tcpcb *));
-struct tcpcb *
- tcp_close __P((struct tcpcb *));
-void tcp_ctlinput __P((int, struct sockaddr *, void *));
-int tcp_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
-struct tcpcb *
- tcp_drop __P((struct tcpcb *, int));
-void tcp_drain __P((void));
-void tcp_fasttimo __P((void));
-struct rmxp_tao *
- tcp_gettaocache __P((struct inpcb *));
-void tcp_init __P((void));
-void tcp_input __P((struct mbuf *, int));
-void tcp_mss __P((struct tcpcb *, int));
-int tcp_mssopt __P((struct tcpcb *));
-void tcp_mtudisc __P((struct inpcb *, int));
-struct tcpcb *
- tcp_newtcpcb __P((struct inpcb *));
-int tcp_output __P((struct tcpcb *));
-void tcp_quench __P((struct inpcb *, int));
-void tcp_respond __P((struct tcpcb *,
- struct tcpiphdr *, struct mbuf *, u_long, u_long, int));
-struct rtentry *
- tcp_rtlookup __P((struct inpcb *));
-void tcp_setpersist __P((struct tcpcb *));
-void tcp_slowtimo __P((void));
-struct tcpiphdr *
- tcp_template __P((struct tcpcb *));
-struct tcpcb *
- tcp_timers __P((struct tcpcb *, int));
-void tcp_trace __P((int, int, struct tcpcb *, struct tcpiphdr *, int));
-
-extern struct pr_usrreqs tcp_usrreqs;
-extern u_long tcp_sendspace;
-extern u_long tcp_recvspace;
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_TCP_VAR_H_ */
diff --git a/c/src/exec/libnetworking/netinet/tcpip.h b/c/src/exec/libnetworking/netinet/tcpip.h
deleted file mode 100644
index b8634bfd15..0000000000
--- a/c/src/exec/libnetworking/netinet/tcpip.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcpip.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCPIP_H_
-#define _NETINET_TCPIP_H_
-
-/*
- * Tcp+ip header, after ip options removed.
- */
-struct tcpiphdr {
- struct ipovly ti_i; /* overlaid ip structure */
- struct tcphdr ti_t; /* tcp header */
-};
-#ifdef notyet
-/*
- * Tcp+ip header, after ip options removed but including TCP options.
- */
-struct full_tcpiphdr {
- struct ipovly ti_i; /* overlaid ip structure */
- struct tcphdr ti_t; /* tcp header */
- char ti_o[TCP_MAXOLEN]; /* space for tcp options */
-};
-#endif /* notyet */
-#define ti_next ti_i.ih_next
-#define ti_prev ti_i.ih_prev
-#define ti_x1 ti_i.ih_x1
-#define ti_pr ti_i.ih_pr
-#define ti_len ti_i.ih_len
-#define ti_src ti_i.ih_src
-#define ti_dst ti_i.ih_dst
-#define ti_sport ti_t.th_sport
-#define ti_dport ti_t.th_dport
-#define ti_seq ti_t.th_seq
-#define ti_ack ti_t.th_ack
-#define ti_x2 ti_t.th_x2
-#define ti_off ti_t.th_off
-#define ti_flags ti_t.th_flags
-#define ti_win ti_t.th_win
-#define ti_sum ti_t.th_sum
-#define ti_urp ti_t.th_urp
-
-#endif
diff --git a/c/src/exec/libnetworking/netinet/udp.h b/c/src/exec/libnetworking/netinet/udp.h
deleted file mode 100644
index e73e1f4ddb..0000000000
--- a/c/src/exec/libnetworking/netinet/udp.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)udp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_UDP_H_
-#define _NETINET_UDP_H_
-
-/*
- * Udp protocol header.
- * Per RFC 768, September, 1981.
- */
-struct udphdr {
- u_short uh_sport; /* source port */
- u_short uh_dport; /* destination port */
- u_short uh_ulen; /* udp length */
- u_short uh_sum; /* udp checksum */
-};
-
-#endif
diff --git a/c/src/exec/libnetworking/netinet/udp_usrreq.c b/c/src/exec/libnetworking/netinet/udp_usrreq.c
deleted file mode 100644
index 16c5fce2df..0000000000
--- a/c/src/exec/libnetworking/netinet/udp_usrreq.c
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/stat.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/syslog.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-
-/*
- * UDP protocol implementation.
- * Per RFC 768, August, 1980.
- */
-#ifndef COMPAT_42
-static int udpcksum = 1;
-#else
-static int udpcksum = 0; /* XXX */
-#endif
-SYSCTL_INT(_net_inet_udp, UDPCTL_CHECKSUM, checksum, CTLFLAG_RW,
- &udpcksum, 0, "");
-
-static int log_in_vain = 0;
-SYSCTL_INT(_net_inet_udp, OID_AUTO, log_in_vain, CTLFLAG_RW,
- &log_in_vain, 0, "");
-
-static struct inpcbhead udb; /* from udp_var.h */
-static struct inpcbinfo udbinfo;
-
-#ifndef UDBHASHSIZE
-#define UDBHASHSIZE 64
-#endif
-
- struct udpstat udpstat; /* from udp_var.h */
-SYSCTL_STRUCT(_net_inet_udp, UDPCTL_STATS, stats, CTLFLAG_RD,
- &udpstat, udpstat, "");
-
-static struct sockaddr_in udp_in = { sizeof(udp_in), AF_INET };
-
-static void udp_detach __P((struct inpcb *));
-static int udp_output __P((struct inpcb *, struct mbuf *, struct mbuf *,
- struct mbuf *));
-static void udp_notify __P((struct inpcb *, int));
-
-void
-udp_init()
-{
- LIST_INIT(&udb);
- udbinfo.listhead = &udb;
- udbinfo.hashbase = hashinit(UDBHASHSIZE, M_PCB, &udbinfo.hashmask);
-}
-
-void
-udp_input(m, iphlen)
- register struct mbuf *m;
- int iphlen;
-{
- register struct ip *ip;
- register struct udphdr *uh;
- register struct inpcb *inp;
- struct mbuf *opts = 0;
- int len;
- struct ip save_ip;
-
- udpstat.udps_ipackets++;
-
- /*
- * Strip IP options, if any; should skip this,
- * make available to user, and use on returned packets,
- * but we don't yet have a way to check the checksum
- * with options still present.
- */
- if (iphlen > sizeof (struct ip)) {
- ip_stripoptions(m, (struct mbuf *)0);
- iphlen = sizeof(struct ip);
- }
-
- /*
- * Get IP and UDP header together in first mbuf.
- */
- ip = mtod(m, struct ip *);
- if (m->m_len < iphlen + sizeof(struct udphdr)) {
- if ((m = m_pullup(m, iphlen + sizeof(struct udphdr))) == 0) {
- udpstat.udps_hdrops++;
- return;
- }
- ip = mtod(m, struct ip *);
- }
- uh = (struct udphdr *)((caddr_t)ip + iphlen);
-
- /*
- * Make mbuf data length reflect UDP length.
- * If not enough data to reflect UDP length, drop.
- */
- len = ntohs((u_short)uh->uh_ulen);
- if (ip->ip_len != len) {
- if (len > ip->ip_len || len < sizeof(struct udphdr)) {
- udpstat.udps_badlen++;
- goto bad;
- }
- m_adj(m, len - ip->ip_len);
- /* ip->ip_len = len; */
- }
- /*
- * Save a copy of the IP header in case we want restore it
- * for sending an ICMP error message in response.
- */
- save_ip = *ip;
-
- /*
- * Checksum extended UDP header and data.
- */
- if (uh->uh_sum) {
- ((struct ipovly *)ip)->ih_next = 0;
- ((struct ipovly *)ip)->ih_prev = 0;
- ((struct ipovly *)ip)->ih_x1 = 0;
- ((struct ipovly *)ip)->ih_len = uh->uh_ulen;
- uh->uh_sum = in_cksum(m, len + sizeof (struct ip));
- if (uh->uh_sum) {
- udpstat.udps_badsum++;
- m_freem(m);
- return;
- }
- }
-
- if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
- in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) {
- struct inpcb *last;
- /*
- * Deliver a multicast or broadcast datagram to *all* sockets
- * for which the local and remote addresses and ports match
- * those of the incoming datagram. This allows more than
- * one process to receive multi/broadcasts on the same port.
- * (This really ought to be done for unicast datagrams as
- * well, but that would cause problems with existing
- * applications that open both address-specific sockets and
- * a wildcard socket listening to the same port -- they would
- * end up receiving duplicates of every unicast datagram.
- * Those applications open the multiple sockets to overcome an
- * inadequacy of the UDP socket interface, but for backwards
- * compatibility we avoid the problem here rather than
- * fixing the interface. Maybe 4.5BSD will remedy this?)
- */
-
- /*
- * Construct sockaddr format source address.
- */
- udp_in.sin_port = uh->uh_sport;
- udp_in.sin_addr = ip->ip_src;
- m->m_len -= sizeof (struct udpiphdr);
- m->m_data += sizeof (struct udpiphdr);
- /*
- * Locate pcb(s) for datagram.
- * (Algorithm copied from raw_intr().)
- */
- last = NULL;
- for (inp = udb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_lport != uh->uh_dport)
- continue;
- if (inp->inp_laddr.s_addr != INADDR_ANY) {
- if (inp->inp_laddr.s_addr !=
- ip->ip_dst.s_addr)
- continue;
- }
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- if (inp->inp_faddr.s_addr !=
- ip->ip_src.s_addr ||
- inp->inp_fport != uh->uh_sport)
- continue;
- }
-
- if (last != NULL) {
- struct mbuf *n;
-
- if ((n = m_copy(m, 0, M_COPYALL)) != NULL) {
- if (last->inp_flags & INP_CONTROLOPTS
- || last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, n);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&udp_in,
- n, opts) == 0) {
- m_freem(n);
- if (opts)
- m_freem(opts);
- udpstat.udps_fullsock++;
- } else
- sorwakeup(last->inp_socket);
- opts = 0;
- }
- }
- last = inp;
- /*
- * Don't look for additional matches if this one does
- * not have either the SO_REUSEPORT or SO_REUSEADDR
- * socket options set. This heuristic avoids searching
- * through all pcbs in the common case of a non-shared
- * port. It * assumes that an application will never
- * clear these options after setting them.
- */
- if (((last->inp_socket->so_options&(SO_REUSEPORT|SO_REUSEADDR)) == 0))
- break;
- }
-
- if (last == NULL) {
- /*
- * No matching pcb found; discard datagram.
- * (No need to send an ICMP Port Unreachable
- * for a broadcast or multicast datgram.)
- */
- udpstat.udps_noportbcast++;
- goto bad;
- }
- if (last->inp_flags & INP_CONTROLOPTS
- || last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, m);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&udp_in,
- m, opts) == 0) {
- udpstat.udps_fullsock++;
- goto bad;
- }
- sorwakeup(last->inp_socket);
- return;
- }
- /*
- * Locate pcb for datagram.
- */
- inp = in_pcblookuphash(&udbinfo, ip->ip_src, uh->uh_sport,
- ip->ip_dst, uh->uh_dport, 1);
- if (inp == NULL) {
- if (log_in_vain) {
- char buf[4*sizeof "123"];
-
- strcpy(buf, inet_ntoa(ip->ip_dst));
- log(LOG_INFO, "Connection attempt to UDP %s:%d"
- " from %s:%d\n",
- buf, ntohs(uh->uh_dport),
- inet_ntoa(ip->ip_src), ntohs(uh->uh_sport));
- }
- udpstat.udps_noport++;
- if (m->m_flags & (M_BCAST | M_MCAST)) {
- udpstat.udps_noportbcast++;
- goto bad;
- }
- *ip = save_ip;
- icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0);
- return;
- }
-
- /*
- * Construct sockaddr format source address.
- * Stuff source address and datagram in user buffer.
- */
- udp_in.sin_port = uh->uh_sport;
- udp_in.sin_addr = ip->ip_src;
- if (inp->inp_flags & INP_CONTROLOPTS
- || inp->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(inp, &opts, ip, m);
- iphlen += sizeof(struct udphdr);
- m->m_len -= iphlen;
- m->m_pkthdr.len -= iphlen;
- m->m_data += iphlen;
- if (sbappendaddr(&inp->inp_socket->so_rcv, (struct sockaddr *)&udp_in,
- m, opts) == 0) {
- udpstat.udps_fullsock++;
- goto bad;
- }
- sorwakeup(inp->inp_socket);
- return;
-bad:
- m_freem(m);
- if (opts)
- m_freem(opts);
-}
-
-/*
- * Notify a udp user of an asynchronous error;
- * just wake up so that he can collect error status.
- */
-static void
-udp_notify(inp, errnum)
- register struct inpcb *inp;
- int errnum;
-{
- inp->inp_socket->so_error = errnum;
- sorwakeup(inp->inp_socket);
- sowwakeup(inp->inp_socket);
-}
-
-void
-udp_ctlinput(cmd, sa, vip)
- int cmd;
- struct sockaddr *sa;
- void *vip;
-{
- register struct ip *ip = vip;
- register struct udphdr *uh;
-
- if (!PRC_IS_REDIRECT(cmd) &&
- ((unsigned)cmd >= PRC_NCMDS || inetctlerrmap[cmd] == 0))
- return;
- if (ip) {
- uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2));
- in_pcbnotify(&udb, sa, uh->uh_dport, ip->ip_src, uh->uh_sport,
- cmd, udp_notify);
- } else
- in_pcbnotify(&udb, sa, 0, zeroin_addr, 0, cmd, udp_notify);
-}
-
-static int
-udp_output(inp, m, addr, control)
- register struct inpcb *inp;
- register struct mbuf *m;
- struct mbuf *addr, *control;
-{
- register struct udpiphdr *ui;
- register int len = m->m_pkthdr.len;
- struct in_addr laddr;
- int s = 0, error = 0;
-
- if (control)
- m_freem(control); /* XXX */
-
- if (len + sizeof(struct udpiphdr) > IP_MAXPACKET) {
- error = EMSGSIZE;
- goto release;
- }
-
- if (addr) {
- laddr = inp->inp_laddr;
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- error = EISCONN;
- goto release;
- }
- /*
- * Must block input while temporarily connected.
- */
- s = splnet();
- error = in_pcbconnect(inp, addr);
- if (error) {
- splx(s);
- goto release;
- }
- } else {
- if (inp->inp_faddr.s_addr == INADDR_ANY) {
- error = ENOTCONN;
- goto release;
- }
- }
- /*
- * Calculate data length and get a mbuf
- * for UDP and IP headers.
- */
- M_PREPEND(m, sizeof(struct udpiphdr), M_DONTWAIT);
- if (m == 0) {
- error = ENOBUFS;
- if (addr)
- splx(s);
- goto release;
- }
-
- /*
- * Fill in mbuf with extended UDP header
- * and addresses and length put into network format.
- */
- ui = mtod(m, struct udpiphdr *);
- ui->ui_next = ui->ui_prev = 0;
- ui->ui_x1 = 0;
- ui->ui_pr = IPPROTO_UDP;
- ui->ui_len = htons((u_short)len + sizeof (struct udphdr));
- ui->ui_src = inp->inp_laddr;
- ui->ui_dst = inp->inp_faddr;
- ui->ui_sport = inp->inp_lport;
- ui->ui_dport = inp->inp_fport;
- ui->ui_ulen = ui->ui_len;
-
- /*
- * Stuff checksum and output datagram.
- */
- ui->ui_sum = 0;
- if (udpcksum) {
- if ((ui->ui_sum = in_cksum(m, sizeof (struct udpiphdr) + len)) == 0)
- ui->ui_sum = 0xffff;
- }
- ((struct ip *)ui)->ip_len = sizeof (struct udpiphdr) + len;
- ((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; /* XXX */
- ((struct ip *)ui)->ip_tos = inp->inp_ip_tos; /* XXX */
- udpstat.udps_opackets++;
- error = ip_output(m, inp->inp_options, &inp->inp_route,
- inp->inp_socket->so_options & (SO_DONTROUTE | SO_BROADCAST),
- inp->inp_moptions);
-
- if (addr) {
- in_pcbdisconnect(inp);
- inp->inp_laddr = laddr;
- splx(s);
- }
- return (error);
-
-release:
- m_freem(m);
- return (error);
-}
-
-static u_long udp_sendspace = 9216; /* really max datagram size */
- /* 40 1K datagrams */
-SYSCTL_INT(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW,
- &udp_sendspace, 0, "");
-
-static u_long udp_recvspace = 40 * (1024 + sizeof(struct sockaddr_in));
-SYSCTL_INT(_net_inet_udp, UDPCTL_RECVSPACE, recvspace, CTLFLAG_RW,
- &udp_recvspace, 0, "");
-
-/*ARGSUSED*/
-int
-udp_usrreq(so, req, m, addr, control)
- struct socket *so;
- int req;
- struct mbuf *m, *addr, *control;
-{
- struct inpcb *inp = sotoinpcb(so);
- int error = 0;
- int s;
-
- if (req == PRU_CONTROL)
- return (in_control(so, (u_long)m, (caddr_t)addr,
- (struct ifnet *)control));
- if (inp == NULL && req != PRU_ATTACH) {
- error = EINVAL;
- goto release;
- }
- /*
- * Note: need to block udp_input while changing
- * the udp pcb queue and/or pcb addresses.
- */
- switch (req) {
-
- case PRU_ATTACH:
- if (inp != NULL) {
- error = EINVAL;
- break;
- }
- s = splnet();
- error = in_pcballoc(so, &udbinfo);
- splx(s);
- if (error)
- break;
- error = soreserve(so, udp_sendspace, udp_recvspace);
- if (error)
- break;
- ((struct inpcb *) so->so_pcb)->inp_ip_ttl = ip_defttl;
- break;
-
- case PRU_DETACH:
- udp_detach(inp);
- break;
-
- case PRU_BIND:
- s = splnet();
- error = in_pcbbind(inp, addr);
- splx(s);
- break;
-
- case PRU_LISTEN:
- error = EOPNOTSUPP;
- break;
-
- case PRU_CONNECT:
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- error = EISCONN;
- break;
- }
- s = splnet();
- error = in_pcbconnect(inp, addr);
- splx(s);
- if (error == 0)
- soisconnected(so);
- break;
-
- case PRU_CONNECT2:
- error = EOPNOTSUPP;
- break;
-
- case PRU_ACCEPT:
- error = EOPNOTSUPP;
- break;
-
- case PRU_DISCONNECT:
- if (inp->inp_faddr.s_addr == INADDR_ANY) {
- error = ENOTCONN;
- break;
- }
- s = splnet();
- in_pcbdisconnect(inp);
- inp->inp_laddr.s_addr = INADDR_ANY;
- splx(s);
- so->so_state &= ~SS_ISCONNECTED; /* XXX */
- break;
-
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- case PRU_SEND:
- return (udp_output(inp, m, addr, control));
-
- case PRU_ABORT:
- soisdisconnected(so);
- udp_detach(inp);
- break;
-
- case PRU_SOCKADDR:
- in_setsockaddr(inp, addr);
- break;
-
- case PRU_PEERADDR:
- in_setpeeraddr(inp, addr);
- break;
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- case PRU_SENDOOB:
- case PRU_FASTTIMO:
- case PRU_SLOWTIMO:
- case PRU_PROTORCV:
- case PRU_PROTOSEND:
- error = EOPNOTSUPP;
- break;
-
- case PRU_RCVD:
- case PRU_RCVOOB:
- return (EOPNOTSUPP); /* do not free mbuf's */
-
- default:
- panic("udp_usrreq");
- }
-
-release:
- if (control) {
- printf("udp control data unexpectedly retained\n");
- m_freem(control);
- }
- if (m)
- m_freem(m);
- return (error);
-}
-
-static void
-udp_detach(inp)
- struct inpcb *inp;
-{
- int s = splnet();
-
- in_pcbdetach(inp);
- splx(s);
-}
diff --git a/c/src/exec/libnetworking/netinet/udp_var.h b/c/src/exec/libnetworking/netinet/udp_var.h
deleted file mode 100644
index 90785b53de..0000000000
--- a/c/src/exec/libnetworking/netinet/udp_var.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 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.
- *
- * @(#)udp_var.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_UDP_VAR_H_
-#define _NETINET_UDP_VAR_H_
-
-/*
- * UDP kernel structures and variables.
- */
-struct udpiphdr {
- struct ipovly ui_i; /* overlaid ip structure */
- struct udphdr ui_u; /* udp header */
-};
-#define ui_next ui_i.ih_next
-#define ui_prev ui_i.ih_prev
-#define ui_x1 ui_i.ih_x1
-#define ui_pr ui_i.ih_pr
-#define ui_len ui_i.ih_len
-#define ui_src ui_i.ih_src
-#define ui_dst ui_i.ih_dst
-#define ui_sport ui_u.uh_sport
-#define ui_dport ui_u.uh_dport
-#define ui_ulen ui_u.uh_ulen
-#define ui_sum ui_u.uh_sum
-
-struct udpstat {
- /* input statistics: */
- u_long udps_ipackets; /* total input packets */
- u_long udps_hdrops; /* packet shorter than header */
- u_long udps_badsum; /* checksum error */
- u_long udps_badlen; /* data length larger than packet */
- u_long udps_noport; /* no socket on port */
- u_long udps_noportbcast; /* of above, arrived as broadcast */
- u_long udps_fullsock; /* not delivered, input socket full */
- u_long udpps_pcbcachemiss; /* input packets missing pcb cache */
- u_long udpps_pcbhashmiss; /* input packets not for hashed pcb */
- /* output statistics: */
- u_long udps_opackets; /* total output packets */
-};
-
-/*
- * Names for UDP sysctl objects
- */
-#define UDPCTL_CHECKSUM 1 /* checksum UDP packets */
-#define UDPCTL_STATS 2 /* statistics (read-only) */
-#define UDPCTL_MAXDGRAM 3 /* max datagram size */
-#define UDPCTL_RECVSPACE 4 /* default receive buffer space */
-#define UDPCTL_MAXID 5
-
-#define UDPCTL_NAMES { \
- { 0, 0 }, \
- { "checksum", CTLTYPE_INT }, \
- { "stats", CTLTYPE_STRUCT }, \
- { "maxdgram", CTLTYPE_INT }, \
- { "recvspace", CTLTYPE_INT }, \
-}
-
-#ifdef KERNEL
-extern struct inpcbhead udb;
-extern struct inpcbinfo udbinfo;
-extern struct udpstat udpstat;
-
-void udp_ctlinput __P((int, struct sockaddr *, void *));
-void udp_init __P((void));
-void udp_input __P((struct mbuf *, int));
-int udp_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/nfs/bootp_subr.c b/c/src/exec/libnetworking/nfs/bootp_subr.c
deleted file mode 100644
index cb7d3d3407..0000000000
--- a/c/src/exec/libnetworking/nfs/bootp_subr.c
+++ /dev/null
@@ -1,968 +0,0 @@
-/* $Id$ */
-
-/*
- * Copyright (c) 1995 Gordon Ross, Adam Glass
- * Copyright (c) 1992 Regents of the University of California.
- * All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * 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, Lawrence Berkeley Laboratory 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.
- *
- * based on:
- * nfs/krpc_subr.c
- * $NetBSD: krpc_subr.c,v 1.10 1995/08/08 20:43:43 gwr Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/conf.h>
-#include <sys/sockio.h>
-#include <sys/proc.h>
-#include <sys/mount.h>
-#include <sys/mbuf.h>
-#include <sys/reboot.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <net/if_types.h>
-#include <net/if_dl.h>
-#include <netinet/if_ether.h>
-
-#include <nfs/rpcv2.h>
-#include <nfs/nfsproto.h>
-#include <nfs/nfs.h>
-#include <nfs/nfsdiskless.h>
-#include <nfs/krpc.h>
-#include <nfs/xdr_subs.h>
-
-#define BOOTP_MIN_LEN 300 /* Minimum size of bootp udp packet */
-
-/*
- * What is the longest we will wait before re-sending a request?
- * Note this is also the frequency of "RPC timeout" messages.
- * The re-send loop count sup linearly to this maximum, so the
- * first complaint will happen after (1+2+3+4+5)=15 seconds.
- */
-#define MAX_RESEND_DELAY 5 /* seconds */
-
-/* Definitions from RFC951 */
-struct bootp_packet {
- u_int8_t op;
- u_int8_t htype;
- u_int8_t hlen;
- u_int8_t hops;
- u_int32_t xid;
- u_int16_t secs;
- u_int16_t flags;
- struct in_addr ciaddr;
- struct in_addr yiaddr;
- struct in_addr siaddr;
- struct in_addr giaddr;
- unsigned char chaddr[16];
- char sname[64];
- char file[128];
- unsigned char vend[256];
-};
-
-#define IPPORT_BOOTPC 68
-#define IPPORT_BOOTPS 67
-
-extern int nfs_diskless_valid;
-extern struct nfsv3_diskless nfsv3_diskless;
-
-/* mountd RPC */
-#if !defined(__rtems__)
-static int md_mount __P((struct sockaddr_in *mdsin, char *path,
- u_char *fhp, int *fhsizep, struct nfs_args *args,struct proc *procp));
-static int md_lookup_swap __P((struct sockaddr_in *mdsin,char *path,
- u_char *fhp, int *fhsizep,
- struct nfs_args *args,
- struct proc *procp));
-static int setfs __P((struct sockaddr_in *addr, char *path, char *p));
-#endif
-static int getdec __P((char **ptr));
-static char *substr __P((char *a,char *b));
-#if !defined(__rtems__)
-static void mountopts __P((struct nfs_args *args, char *p));
-static int xdr_opaque_decode __P((struct mbuf **ptr,u_char *buf,
- int len));
-static int xdr_int_decode __P((struct mbuf **ptr,int *iptr));
-#endif
-static void printip __P((char *prefix,struct in_addr addr));
-
-#ifdef BOOTP_DEBUG
-void bootpboot_p_sa(struct sockaddr *sa,struct sockaddr *ma);
-void bootpboot_p_ma(struct sockaddr *ma);
-void bootpboot_p_rtentry(struct rtentry *rt);
-void bootpboot_p_tree(struct radix_node *rn);
-void bootpboot_p_rtlist(void);
-void bootpboot_p_iflist(void);
-#endif
-
-int bootpc_call(struct bootp_packet *call,
- struct bootp_packet *reply,
- struct proc *procp);
-
-int bootpc_fakeup_interface(struct ifreq *ireq,struct socket *so,
- struct proc *procp);
-
-int
-bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
- struct sockaddr_in *myaddr,
- struct sockaddr_in *netmask,
- struct sockaddr_in *gw,
- struct proc *procp);
-
-void bootpc_init(void);
-
-#ifdef BOOTP_DEBUG
-void bootpboot_p_sa(sa,ma)
- struct sockaddr *sa;
- struct sockaddr *ma;
-{
- if (!sa) {
- printf("(sockaddr *) <null>");
- return;
- }
- switch (sa->sa_family) {
- case AF_INET:
- {
- struct sockaddr_in *sin = (struct sockaddr_in *) sa;
- printf("inet %x",ntohl(sin->sin_addr.s_addr));
- if (ma) {
- struct sockaddr_in *sin = (struct sockaddr_in *) ma;
- printf(" mask %x",ntohl(sin->sin_addr.s_addr));
- }
- }
- break;
- case AF_LINK:
- {
- struct sockaddr_dl *sli = (struct sockaddr_dl *) sa;
- int i;
- printf("link %.*s ",sli->sdl_nlen,sli->sdl_data);
- for (i=0;i<sli->sdl_alen;i++) {
- if (i>0)
- printf(":");
- printf("%x",(unsigned char) sli->sdl_data[i+sli->sdl_nlen]);
- }
- }
- break;
- default:
- printf("af%d",sa->sa_family);
- }
-}
-
-void bootpboot_p_ma(ma)
- struct sockaddr *ma;
-{
- if (!ma) {
- printf("<null>");
- return;
- }
- printf("%x",*(int*)ma);
-}
-
-void bootpboot_p_rtentry(rt)
- struct rtentry *rt;
-{
- bootpboot_p_sa(rt_key(rt),rt_mask(rt));
- printf(" ");
- bootpboot_p_ma(rt->rt_genmask);
- printf(" ");
- bootpboot_p_sa(rt->rt_gateway,NULL);
- printf(" ");
- printf("flags %x",(unsigned short) rt->rt_flags);
- printf(" %d",rt->rt_rmx.rmx_expire);
- printf(" %s%d\n",rt->rt_ifp->if_name,rt->rt_ifp->if_unit);
-}
-void bootpboot_p_tree(rn)
- struct radix_node *rn;
-{
- while (rn) {
- if (rn->rn_b < 0) {
- if (rn->rn_flags & RNF_ROOT) {
- } else {
- bootpboot_p_rtentry((struct rtentry *) rn);
- }
- rn = rn->rn_dupedkey;
- } else {
- bootpboot_p_tree(rn->rn_l);
- bootpboot_p_tree(rn->rn_r);
- return;
- }
-
- }
-}
-
-void bootpboot_p_rtlist(void)
-{
- printf("Routing table:\n");
- bootpboot_p_tree(rt_tables[AF_INET]->rnh_treetop);
-}
-
-void bootpboot_p_iflist(void)
-{
- struct ifnet *ifp;
- struct ifaddr *ifa;
- printf("Interface list:\n");
- for (ifp = TAILQ_FIRST(&ifnet); ifp != 0; ifp = TAILQ_NEXT(ifp,if_link))
- {
- for (ifa = TAILQ_FIRST(&ifp->if_addrhead) ;ifa;
- ifa=TAILQ_NEXT(ifa,ifa_link))
- if (ifa->ifa_addr->sa_family == AF_INET ) {
- printf("%s%d flags %x, addr %x, bcast %x, net %x\n",
- ifp->if_name,ifp->if_unit,
- (unsigned short) ifp->if_flags,
- ntohl(((struct sockaddr_in *) ifa->ifa_addr)->sin_addr.s_addr),
- ntohl(((struct sockaddr_in *) ifa->ifa_dstaddr)->sin_addr.s_addr),
- ntohl(((struct sockaddr_in *) ifa->ifa_netmask)->sin_addr.s_addr)
- );
- }
- }
-}
-#endif
-
-int
-bootpc_call(call,reply,procp)
- struct bootp_packet *call;
- struct bootp_packet *reply; /* output */
- struct proc *procp;
-{
- struct socket *so;
- struct sockaddr_in *sin;
- struct mbuf *m, *nam;
- struct uio auio;
- struct iovec aio;
- int error, rcvflg, timo, secs, len;
-
- /* Free at end if not null. */
- nam = NULL;
-
- /*
- * Create socket and set its recieve timeout.
- */
- if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0,procp)))
- goto out;
-
- m = m_get(M_WAIT, MT_SOOPTS);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- } else {
- struct timeval *tv;
- tv = mtod(m, struct timeval *);
- m->m_len = sizeof(*tv);
- tv->tv_sec = 1;
- tv->tv_usec = 0;
- if ((error = sosetopt(so, SOL_SOCKET, SO_RCVTIMEO, m)))
- goto out;
- }
-
- /*
- * Enable broadcast.
- */
- {
- int *on;
- m = m_get(M_WAIT, MT_SOOPTS);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- }
- on = mtod(m, int *);
- m->m_len = sizeof(*on);
- *on = 1;
- if ((error = sosetopt(so, SOL_SOCKET, SO_BROADCAST, m)))
- goto out;
- }
-
- /*
- * Bind the local endpoint to a bootp client port.
- */
- m = m_getclr(M_WAIT, MT_SONAME);
- sin = mtod(m, struct sockaddr_in *);
- sin->sin_len = m->m_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_ANY;
- sin->sin_port = htons(IPPORT_BOOTPC);
- error = sobind(so, m);
- m_freem(m);
- if (error) {
- printf("bind failed\n");
- goto out;
- }
-
- /*
- * Setup socket address for the server.
- */
- nam = m_get(M_WAIT, MT_SONAME);
- if (nam == NULL) {
- error = ENOBUFS;
- goto out;
- }
- sin = mtod(nam, struct sockaddr_in *);
- sin-> sin_len = sizeof(*sin);
- sin-> sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_BROADCAST;
- sin->sin_port = htons(IPPORT_BOOTPS);
-
- nam->m_len = sizeof(*sin);
-
- /*
- * Send it, repeatedly, until a reply is received,
- * but delay each re-send by an increasing amount.
- * If the delay hits the maximum, start complaining.
- */
- timo = 0;
- for (;;) {
- /* Send BOOTP request (or re-send). */
-
- aio.iov_base = (caddr_t) call;
- aio.iov_len = sizeof(*call);
-
- auio.uio_iov = &aio;
- auio.uio_iovcnt = 1;
- auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_rw = UIO_WRITE;
- auio.uio_offset = 0;
- auio.uio_resid = sizeof(*call);
- auio.uio_procp = procp;
-
- error = sosend(so, nam, &auio, NULL, NULL, 0);
- if (error) {
- printf("bootpc_call: sosend: %d\n", error);
- goto out;
- }
-
- /* Determine new timeout. */
- if (timo < MAX_RESEND_DELAY)
- timo++;
- else
- printf("BOOTP timeout for server 0x%x\n",
- (int)ntohl(sin->sin_addr.s_addr));
-
- /*
- * Wait for up to timo seconds for a reply.
- * The socket receive timeout was set to 1 second.
- */
- secs = timo;
- while (secs > 0) {
- aio.iov_base = (caddr_t) reply;
- aio.iov_len = sizeof(*reply);
-
- auio.uio_iov = &aio;
- auio.uio_iovcnt = 1;
- auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_rw = UIO_READ;
- auio.uio_offset = 0;
- auio.uio_resid = sizeof(*reply);
- auio.uio_procp = procp;
-
- rcvflg = 0;
- error = soreceive(so, NULL, &auio, NULL, NULL, &rcvflg);
- if (error == EWOULDBLOCK) {
- secs--;
- call->secs=htons(ntohs(call->secs)+1);
- continue;
- }
- if (error)
- goto out;
- len = sizeof(*reply) - auio.uio_resid;
-
- /* Do we have the required number of bytes ? */
- if (len < BOOTP_MIN_LEN)
- continue;
-
- /* Is it the right reply? */
- if (reply->op != 2)
- continue;
-
- if (reply->xid != call->xid)
- continue;
-
- if (reply->hlen != call->hlen)
- continue;
-
- if (bcmp(reply->chaddr,call->chaddr,call->hlen))
- continue;
-
- goto gotreply; /* break two levels */
-
- } /* while secs */
- } /* forever send/receive */
-
- error = ETIMEDOUT;
- goto out;
-
- gotreply:
- out:
- if (nam) m_freem(nam);
- soclose(so);
- return error;
-}
-
-int
-bootpc_fakeup_interface(struct ifreq *ireq,struct socket *so,
- struct proc *procp)
-{
- struct sockaddr_in *sin;
- int error;
- struct sockaddr_in dst;
- struct sockaddr_in gw;
- struct sockaddr_in mask;
-
- /*
- * Bring up the interface.
- *
- * Get the old interface flags and or IFF_UP into them; if
- * IFF_UP set blindly, interface selection can be clobbered.
- */
- error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: GIFFLAGS, error=%d", error);
- ireq->ifr_flags |= IFF_UP;
- error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: SIFFLAGS, error=%d", error);
-
- /*
- * Do enough of ifconfig(8) so that the chosen interface
- * can talk to the servers. (just set the address)
- */
-
- /* addr is 0.0.0.0 */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_ANY;
- error = ifioctl(so, SIOCSIFADDR, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: set if addr, error=%d", error);
-
- /* netmask is 0.0.0.0 */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_ANY;
- error = ifioctl(so, SIOCSIFNETMASK, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: set if net addr, error=%d", error);
-
- /* Broadcast is 255.255.255.255 */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_BROADCAST;
- error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: set if broadcast addr, error=%d", error);
-
- /* Add default route to 0.0.0.0 so we can send data */
-
- bzero((caddr_t) &dst, sizeof(dst));
- dst.sin_len=sizeof(dst);
- dst.sin_family=AF_INET;
- dst.sin_addr.s_addr = htonl(0);
-
- bzero((caddr_t) &gw, sizeof(gw));
- gw.sin_len=sizeof(gw);
- gw.sin_family=AF_INET;
- gw.sin_addr.s_addr = htonl(0x0);
-
- bzero((caddr_t) &mask, sizeof(mask));
- mask.sin_len=sizeof(mask);
- mask.sin_family=AF_INET;
- mask.sin_addr.s_addr = htonl(0);
-
- error = rtrequest(RTM_ADD,
- (struct sockaddr *) &dst,
- (struct sockaddr *) &gw,
- (struct sockaddr *) &mask,
- RTF_UP | RTF_STATIC
- , NULL);
- if (error)
- printf("bootpc_fakeup_interface: add default route, error=%d\n", error);
- return error;
-}
-
-int
-bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
- struct sockaddr_in *myaddr,
- struct sockaddr_in *netmask,
- struct sockaddr_in *gw,
- struct proc *procp)
-{
- int error;
- struct sockaddr_in oldgw;
- struct sockaddr_in olddst;
- struct sockaddr_in oldmask;
- struct sockaddr_in *sin;
-
- /* Remove old default route to 0.0.0.0 */
-
- bzero((caddr_t) &olddst, sizeof(olddst));
- olddst.sin_len=sizeof(olddst);
- olddst.sin_family=AF_INET;
- olddst.sin_addr.s_addr = INADDR_ANY;
-
- bzero((caddr_t) &oldgw, sizeof(oldgw));
- oldgw.sin_len=sizeof(oldgw);
- oldgw.sin_family=AF_INET;
- oldgw.sin_addr.s_addr = INADDR_ANY;
-
- bzero((caddr_t) &oldmask, sizeof(oldmask));
- oldmask.sin_len=sizeof(oldmask);
- oldmask.sin_family=AF_INET;
- oldmask.sin_addr.s_addr = INADDR_ANY;
-
- error = rtrequest(RTM_DELETE,
- (struct sockaddr *) &olddst,
- (struct sockaddr *) &oldgw,
- (struct sockaddr *) &oldmask,
- (RTF_UP | RTF_STATIC), NULL);
- if (error) {
- printf("nfs_boot: del default route, error=%d\n", error);
- return error;
- }
-
- /*
- * Do enough of ifconfig(8) so that the chosen interface
- * can talk to the servers. (just set the address)
- */
- bcopy(netmask,&ireq->ifr_addr,sizeof(*netmask));
- error = ifioctl(so, SIOCSIFNETMASK, (caddr_t)ireq, procp);
- if (error)
- panic("nfs_boot: set if netmask, error=%d", error);
-
- /* Broadcast is with host part of IP address all 1's */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = myaddr->sin_addr.s_addr | ~ netmask->sin_addr.s_addr;
- error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_call: set if broadcast addr, error=%d", error);
-
- bcopy(myaddr,&ireq->ifr_addr,sizeof(*myaddr));
- error = ifioctl(so, SIOCSIFADDR, (caddr_t)ireq, procp);
- if (error)
- panic("nfs_boot: set if addr, error=%d", error);
-
- /* Add new default route */
-
- error = rtrequest(RTM_ADD,
- (struct sockaddr *) &olddst,
- (struct sockaddr *) gw,
- (struct sockaddr *) &oldmask,
- (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL);
- if (error) {
- printf("nfs_boot: add net route, error=%d\n", error);
- return error;
- }
-
- return 0;
-}
-
-#if !defined(__rtems__)
-static int setfs(addr, path, p)
- struct sockaddr_in *addr;
- char *path;
- char *p;
-{
- unsigned ip = 0;
- int val;
-
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip = val << 24;
- if (*p != '.') return(0);
- p++;
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip |= (val << 16);
- if (*p != '.') return(0);
- p++;
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip |= (val << 8);
- if (*p != '.') return(0);
- p++;
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip |= val;
- if (*p != ':') return(0);
- p++;
-
- addr->sin_addr.s_addr = htonl(ip);
- addr->sin_len = sizeof(struct sockaddr_in);
- addr->sin_family = AF_INET;
-
- strncpy(path,p,MNAMELEN-1);
- return(1);
-}
-#endif
-
-static int getdec(ptr)
- char **ptr;
-{
- char *p = *ptr;
- int ret=0;
- if ((*p < '0') || (*p > '9')) return(-1);
- while ((*p >= '0') && (*p <= '9')) {
- ret = ret*10 + (*p - '0');
- p++;
- }
- *ptr = p;
- return(ret);
-}
-
-static char *substr(a,b)
- char *a,*b;
-{
- char *loc1;
- char *loc2;
-
- while (*a != '\0') {
- loc1 = a;
- loc2 = b;
- while (*loc1 == *loc2++) {
- if (*loc1 == '\0') return (0);
- loc1++;
- if (*loc2 == '\0') return (loc1);
- }
- a++;
- }
- return (0);
-}
-
-static void printip(char *prefix,struct in_addr addr)
-{
- unsigned int ip;
-
- ip = ntohl(addr.s_addr);
-
- printf("%s is %d.%d.%d.%d\n",prefix,
- ip >> 24, (ip >> 16) & 255 ,(ip >> 8) & 255 ,ip & 255 );
-}
-
-void
-bootpc_init(void)
-{
- struct bootp_packet call;
- struct bootp_packet reply;
- static u_int32_t xid = ~0xFF;
-
- struct ifreq ireq;
- struct ifnet *ifp;
- struct socket *so;
- int error;
- int code,ncode,len;
- int j;
- char *p;
- unsigned int ip;
-
- struct sockaddr_in myaddr;
- struct sockaddr_in netmask;
- struct sockaddr_in gw;
- int gotgw=0;
- int gotnetmask=0;
-#if !defined(__rtems__)
- int gotrootpath=0;
- int gotswappath=0;
-#endif
- char lookup_path[24];
-
-#define EALEN 6
-#if !defined(__rtems__)
- unsigned char ea[EALEN];
-#endif
- struct ifaddr *ifa;
- struct sockaddr_dl *sdl = NULL;
- char *delim;
- struct proc *procp = NULL;
-
- /*
- * If already filled in, don't touch it here
- */
- if (nfs_diskless_valid)
- return;
-
- /*
- * Bump time if 0.
- if (!time.tv_sec)
- time.tv_sec++;
- */
-
- /*
- * Find a network interface.
- */
- for (ifp = ifnet; ifp != 0; ifp = ifp->if_next)
- if ((ifp->if_flags &
- (IFF_LOOPBACK|IFF_POINTOPOINT)) == 0)
- break;
- if (ifp == NULL)
- panic("bootpc_init: no suitable interface");
- bzero(&ireq,sizeof(ireq));
- sprintf(ireq.ifr_name, "%s%d", ifp->if_name,ifp->if_unit);
- printf("bootpc_init: using network interface '%s'\n",
- ireq.ifr_name);
-
- if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0,procp)) != 0)
- panic("nfs_boot: socreate, error=%d", error);
-
- bootpc_fakeup_interface(&ireq,so,procp);
-
- printf("Bootpc testing starting\n");
-
- /* Get HW address */
-
- for (ifa = ifp->if_addrlist;ifa; ifa = ifa->ifa_next)
- if (ifa->ifa_addr->sa_family == AF_LINK &&
- (sdl = ((struct sockaddr_dl *) ifa->ifa_addr)) &&
- sdl->sdl_type == IFT_ETHER)
- break;
-
- if (!sdl)
- panic("bootpc: Unable to find HW address");
- if (sdl->sdl_alen != EALEN )
- panic("bootpc: HW address len is %d, expected value is %d",
- sdl->sdl_alen,EALEN);
-
- printf("bootpc hw address is ");
- delim="";
- for (j=0;j<sdl->sdl_alen;j++) {
- printf("%s%x",delim,((unsigned char *)LLADDR(sdl))[j]);
- delim=":";
- }
- printf("\n");
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
-
- bzero((caddr_t) &call, sizeof(call));
-
- /* bootpc part */
- call.op = 1; /* BOOTREQUEST */
- call.htype= 1; /* 10mb ethernet */
- call.hlen=sdl->sdl_alen; /* Hardware address length */
- call.hops=0;
- xid++;
- call.xid = txdr_unsigned(xid);
- bcopy(LLADDR(sdl),&call.chaddr,sdl->sdl_alen);
-
- call.vend[0]=99;
- call.vend[1]=130;
- call.vend[2]=83;
- call.vend[3]=99;
- call.vend[4]=255;
-
- call.secs = 0;
- call.flags = htons(0x8000); /* We need an broadcast answer */
-
- error = bootpc_call(&call,&reply,procp);
-
- if (error)
- panic("BOOTP call failed -- error %d", error);
-
- bzero(&myaddr,sizeof(myaddr));
- bzero(&netmask,sizeof(netmask));
- bzero(&gw,sizeof(gw));
-
- myaddr.sin_len = sizeof(myaddr);
- myaddr.sin_family = AF_INET;
-
- netmask.sin_len = sizeof(netmask);
- netmask.sin_family = AF_INET;
-
- gw.sin_len = sizeof(gw);
- gw.sin_family= AF_INET;
-
- rtems_bsdnet_bootp_server_address = reply.siaddr;
- rtems_bsdnet_log_host_address = reply.siaddr;
-
- myaddr.sin_addr = reply.yiaddr;
-
- ip = ntohl(myaddr.sin_addr.s_addr);
- sprintf(lookup_path,"swap.%d.%d.%d.%d",
- ip >> 24, (ip >> 16) & 255 ,(ip >> 8) & 255 ,ip & 255 );
-
- printip("My ip address",myaddr.sin_addr);
-
- printip("Server ip address",reply.siaddr);
-
- gw.sin_addr = reply.giaddr;
- printip("Gateway ip address",reply.giaddr);
-
- if (reply.sname[0])
- printf("Server name is %s\n",reply.sname);
- if (reply.file[0])
- printf("boot file is %s\n",reply.file);
- rtems_bsdnet_bootp_boot_file_name = strdup (reply.file);
- if (reply.vend[0]==99 && reply.vend[1]==130 &&
- reply.vend[2]==83 && reply.vend[3]==99) {
- j=4;
- ncode = reply.vend[j];
- while (j<sizeof(reply.vend)) {
- code = reply.vend[j] = ncode;
- if (code==255)
- break;
- if (code==0) {
- j++;
- continue;
- }
- len = reply.vend[j+1];
- j+=2;
- if (len+j>=sizeof(reply.vend)) {
- printf("Truncated field");
- break;
- }
- ncode = reply.vend[j+len];
- reply.vend[j+len]='\0';
- p = &reply.vend[j];
- switch (code) {
- case 1:
- if (len!=4)
- panic("bootpc: subnet mask len is %d",len);
- bcopy(&reply.vend[j],&netmask.sin_addr,4);
- gotnetmask=1;
- printip("Subnet mask",netmask.sin_addr);
- break;
- case 6:
- /* Domain Name servers */
- if (len % 4)
- panic("bootpc: DNS Len is %d",len);
- {
- int dlen = 0;
- while ((dlen < len) &&
- (rtems_bsdnet_nameserver_count < sizeof rtems_bsdnet_config.name_server /
- sizeof rtems_bsdnet_config.name_server[0])) {
- bcopy(&reply.vend[j+dlen],
- &rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count],
- 4);
- printip("Domain Name Server",
- rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count]);
- rtems_bsdnet_nameserver_count++;
- dlen += 4;
- }
- }
- break;
- case 16: /* Swap server IP address. unused */
- case 2:
- /* Time offset */
- break;
- case 3:
- /* Routers */
- if (len % 4)
- panic("bootpc: Router Len is %d",len);
- if (len > 0) {
- bcopy(&reply.vend[j],&gw.sin_addr,4);
- printip("Router",gw.sin_addr);
- gotgw=1;
- }
- break;
- case 7:
- /* Log servers */
- if (len % 4)
- panic("bootpc: Log server len is %d",len);
- if (len > 0) {
- bcopy(&reply.vend[j],&rtems_bsdnet_log_host_address,4);
- printip("Log server",rtems_bsdnet_log_host_address);
- }
- break;
- case 12:
- if (len>=MAXHOSTNAMELEN)
- panic("bootpc: hostname >=%d bytes",MAXHOSTNAMELEN);
- if (sethostname (&reply.vend[j], len) < 0)
- panic("Can't set host name");
- printf("Hostname is %.*s\n",len,&reply.vend[j]);
- break;
- case 15:
- /* Domain name */
- rtems_bsdnet_domain_name = strdup (&reply.vend[j]);
- if (rtems_bsdnet_domain_name)
- printf("Domain name is %s\n", rtems_bsdnet_domain_name);
- break;
- default:
- printf("Ignoring field type %d\n",code);
- }
- j+=len;
- }
- }
-
- if (!gotnetmask) {
- if (IN_CLASSA(ntohl(myaddr.sin_addr.s_addr)))
- netmask.sin_addr.s_addr = htonl(IN_CLASSA_NET);
- else if (IN_CLASSB(ntohl(myaddr.sin_addr.s_addr)))
- netmask.sin_addr.s_addr = htonl(IN_CLASSB_NET);
- else
- netmask.sin_addr.s_addr = htonl(IN_CLASSC_NET);
- }
- if (!gotgw) {
- /* Use proxyarp */
- gw.sin_addr.s_addr = myaddr.sin_addr.s_addr;
- }
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
- error = bootpc_adjust_interface(&ireq,so,
- &myaddr,&netmask,&gw,procp);
-
- soclose(so);
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
-
-
-#if 0
- myaddr.sin_addr.s_addr | ~ netmask.sin_addr.s_addr;
-#endif
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
- return;
-}
diff --git a/c/src/exec/libnetworking/nfs/krpc.h b/c/src/exec/libnetworking/nfs/krpc.h
deleted file mode 100644
index 8a21392657..0000000000
--- a/c/src/exec/libnetworking/nfs/krpc.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* $NetBSD: krpc.h,v 1.4 1995/12/19 23:07:11 cgd Exp $ */
-/* $Id$ */
-
-#include <sys/cdefs.h>
-
-int krpc_call __P((struct sockaddr_in *sin,
- u_int prog, u_int vers, u_int func,
- struct mbuf **data, struct mbuf **from, struct proc *procp));
-
-int krpc_portmap __P((struct sockaddr_in *sin,
- u_int prog, u_int vers, u_int16_t *portp, struct proc *procp));
-
-struct mbuf *xdr_string_encode __P((char *str, int len));
-
-/*
- * RPC definitions for the portmapper
- */
-#define PMAPPORT 111
-#define PMAPPROG 100000
-#define PMAPVERS 2
-#define PMAPPROC_NULL 0
-#define PMAPPROC_SET 1
-#define PMAPPROC_UNSET 2
-#define PMAPPROC_GETPORT 3
-#define PMAPPROC_DUMP 4
-#define PMAPPROC_CALLIT 5
diff --git a/c/src/exec/libnetworking/nfs/nfs.h b/c/src/exec/libnetworking/nfs/nfs.h
deleted file mode 100644
index 68f206e213..0000000000
--- a/c/src/exec/libnetworking/nfs/nfs.h
+++ /dev/null
@@ -1,620 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)nfs.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_NFS_H_
-#define _NFS_NFS_H_
-
-#include <nfs/rpcv2.h>
-
-/*
- * Tunable constants for nfs
- */
-
-#define NFS_MAXIOVEC 34
-#define NFS_TICKINTVL 5 /* Desired time for a tick (msec) */
-#define NFS_HZ (hz / nfs_ticks) /* Ticks/sec */
-#define NFS_TIMEO (1 * NFS_HZ) /* Default timeout = 1 second */
-#define NFS_MINTIMEO (1 * NFS_HZ) /* Min timeout to use */
-#define NFS_MAXTIMEO (60 * NFS_HZ) /* Max timeout to backoff to */
-#define NFS_MINIDEMTIMEO (5 * NFS_HZ) /* Min timeout for non-idempotent ops*/
-#define NFS_MAXREXMIT 100 /* Stop counting after this many */
-#define NFS_MAXWINDOW 1024 /* Max number of outstanding requests */
-#define NFS_RETRANS 10 /* Num of retrans for soft mounts */
-#define NFS_MAXGRPS 16 /* Max. size of groups list */
-#ifndef NFS_MINATTRTIMO
-#define NFS_MINATTRTIMO 5 /* Attribute cache timeout in sec */
-#endif
-#ifndef NFS_MAXATTRTIMO
-#define NFS_MAXATTRTIMO 60
-#endif
-#define NFS_WSIZE 8192 /* Def. write data size <= 8192 */
-#define NFS_RSIZE 8192 /* Def. read data size <= 8192 */
-#define NFS_READDIRSIZE 8192 /* Def. readdir size */
-#define NFS_DEFRAHEAD 1 /* Def. read ahead # blocks */
-#define NFS_MAXRAHEAD 4 /* Max. read ahead # blocks */
-#define NFS_MAXUIDHASH 64 /* Max. # of hashed uid entries/mp */
-#define NFS_MAXASYNCDAEMON 20 /* Max. number async_daemons runnable */
-#define NFS_MAXGATHERDELAY 100 /* Max. write gather delay (msec) */
-#ifndef NFS_GATHERDELAY
-#define NFS_GATHERDELAY 10 /* Default write gather delay (msec) */
-#endif
-#define NFS_DIRBLKSIZ 4096 /* Must be a multiple of DIRBLKSIZ */
-
-/*
- * Oddballs
- */
-#define NMOD(a) ((a) % nfs_asyncdaemons)
-#define NFS_CMPFH(n, f, s) \
- ((n)->n_fhsize == (s) && !bcmp((caddr_t)(n)->n_fhp, (caddr_t)(f), (s)))
-#define NFS_ISV3(v) (VFSTONFS((v)->v_mount)->nm_flag & NFSMNT_NFSV3)
-#define NFS_SRVMAXDATA(n) \
- (((n)->nd_flag & ND_NFSV3) ? (((n)->nd_nam2) ? \
- NFS_MAXDGRAMDATA : NFS_MAXDATA) : NFS_V2MAXDATA)
-
-/*
- * XXX
- * sys/buf.h should be edited to change B_APPENDWRITE --> B_NEEDCOMMIT, but
- * until then...
- * Same goes for sys/malloc.h, which needs M_NFSDIROFF,
- * M_NFSRVDESC and M_NFSBIGFH added.
- * The VA_EXCLUSIVE flag should be added for va_vaflags and set for an
- * exclusive create.
- * The B_INVAFTERWRITE flag should be set to whatever is required by the
- * buffer cache code to say "Invalidate the block after it is written back".
- */
-#ifndef B_NEEDCOMMIT
-#define B_NEEDCOMMIT B_APPENDWRITE
-#endif
-#ifndef M_NFSRVDESC
-#define M_NFSRVDESC M_TEMP
-#endif
-#ifndef M_NFSDIROFF
-#define M_NFSDIROFF M_TEMP
-#endif
-#ifndef M_NFSBIGFH
-#define M_NFSBIGFH M_TEMP
-#endif
-#ifndef VA_EXCLUSIVE
-#define VA_EXCLUSIVE 0
-#endif
-#ifdef __FreeBSD__
-#define B_INVAFTERWRITE B_NOCACHE
-#else
-#define B_INVAFTERWRITE B_INVAL
-#endif
-
-/*
- * These ifdefs try to handle the differences between the various 4.4BSD-Lite
- * based vfs interfaces.
- * btw: NetBSD-current does have a VOP_LEASDE(), but I don't know how to
- * differentiate between NetBSD-1.0 and NetBSD-current, so..
- * I also don't know about BSDi's 2.0 release.
- */
-#if !defined(HAS_VOPLEASE) && !defined(__FreeBSD__) && !defined(__NetBSD__)
-#define HAS_VOPLEASE 1
-#endif
-#if !defined(HAS_VOPREVOKE) && !defined(__FreeBSD__) && !defined(__NetBSD__)
-#define HAS_VOPREVOKE 1
-#endif
-
-/*
- * The IO_METASYNC flag should be implemented for local file systems.
- * (Until then, it is nothin at all.)
- */
-#ifndef IO_METASYNC
-#define IO_METASYNC 0
-#endif
-
-/*
- * Set the attribute timeout based on how recently the file has been modified.
- */
-#define NFS_ATTRTIMEO(np) \
- ((((np)->n_flag & NMODIFIED) || \
- (time.tv_sec - (np)->n_mtime) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \
- ((time.tv_sec - (np)->n_mtime) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \
- (time.tv_sec - (np)->n_mtime) / 10))
-
-/*
- * Expected allocation sizes for major data structures. If the actual size
- * of the structure exceeds these sizes, then malloc() will be allocating
- * almost twice the memory required. This is used in nfs_init() to warn
- * the sysadmin that the size of a structure should be reduced.
- * (These sizes are always a power of 2. If the kernel malloc() changes
- * to one that does not allocate space in powers of 2 size, then this all
- * becomes bunk!)
- */
-#define NFS_NODEALLOC 256
-#define NFS_MNTALLOC 512
-#define NFS_SVCALLOC 256
-#define NFS_UIDALLOC 128
-
-/*
- * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs
- * should ever try and use it.
- */
-struct nfsd_args {
- int sock; /* Socket to serve */
- caddr_t name; /* Client address for connection based sockets */
- int namelen; /* Length of name */
-};
-
-struct nfsd_srvargs {
- struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */
- uid_t nsd_uid; /* Effective uid mapped to cred */
- u_long nsd_haddr; /* Ip address of client */
- struct ucred nsd_cr; /* Cred. uid maps to */
- int nsd_authlen; /* Length of auth string (ret) */
- u_char *nsd_authstr; /* Auth string (ret) */
- int nsd_verflen; /* and the verfier */
- u_char *nsd_verfstr;
- struct timeval nsd_timestamp; /* timestamp from verifier */
- u_long nsd_ttl; /* credential ttl (sec) */
- NFSKERBKEY_T nsd_key; /* Session key */
-};
-
-struct nfsd_cargs {
- char *ncd_dirp; /* Mount dir path */
- uid_t ncd_authuid; /* Effective uid */
- int ncd_authtype; /* Type of authenticator */
- int ncd_authlen; /* Length of authenticator string */
- u_char *ncd_authstr; /* Authenticator string */
- int ncd_verflen; /* and the verifier */
- u_char *ncd_verfstr;
- NFSKERBKEY_T ncd_key; /* Session key */
-};
-
-/*
- * Stats structure
- */
-struct nfsstats {
- int attrcache_hits;
- int attrcache_misses;
- int lookupcache_hits;
- int lookupcache_misses;
- int direofcache_hits;
- int direofcache_misses;
- int biocache_reads;
- int read_bios;
- int read_physios;
- int biocache_writes;
- int write_bios;
- int write_physios;
- int biocache_readlinks;
- int readlink_bios;
- int biocache_readdirs;
- int readdir_bios;
- int rpccnt[NFS_NPROCS];
- int rpcretries;
- int srvrpccnt[NFS_NPROCS];
- int srvrpc_errs;
- int srv_errs;
- int rpcrequests;
- int rpctimeouts;
- int rpcunexpected;
- int rpcinvalid;
- int srvcache_inproghits;
- int srvcache_idemdonehits;
- int srvcache_nonidemdonehits;
- int srvcache_misses;
- int srvnqnfs_leases;
- int srvnqnfs_maxleases;
- int srvnqnfs_getleases;
- int srvvop_writes;
-};
-
-/*
- * Flags for nfssvc() system call.
- */
-#define NFSSVC_BIOD 0x002
-#define NFSSVC_NFSD 0x004
-#define NFSSVC_ADDSOCK 0x008
-#define NFSSVC_AUTHIN 0x010
-#define NFSSVC_GOTAUTH 0x040
-#define NFSSVC_AUTHINFAIL 0x080
-#define NFSSVC_MNTD 0x100
-
-/*
- * fs.nfs sysctl(3) identifiers
- */
-#define NFS_NFSSTATS 1 /* struct: struct nfsstats */
-#define NFS_NFSPRIVPORT 2 /* int: prohibit nfs to resvports */
-
-#define FS_NFS_NAMES { \
- { 0, 0 }, \
- { "nfsstats", CTLTYPE_STRUCT }, \
- { "nfsprivport", CTLTYPE_INT }, \
-}
-
-/*
- * The set of signals the interrupt an I/O in progress for NFSMNT_INT mounts.
- * What should be in this set is open to debate, but I believe that since
- * I/O system calls on ufs are never interrupted by signals the set should
- * be minimal. My reasoning is that many current programs that use signals
- * such as SIGALRM will not expect file I/O system calls to be interrupted
- * by them and break.
- */
-#if defined(KERNEL) || defined(_KERNEL)
-
-struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
-
-#define NFSINT_SIGMASK (sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGKILL)| \
- sigmask(SIGHUP)|sigmask(SIGQUIT))
-
-/*
- * Socket errors ignored for connectionless sockets??
- * For now, ignore them all
- */
-#define NFSIGNORE_SOERROR(s, e) \
- ((e) != EINTR && (e) != ERESTART && (e) != EWOULDBLOCK && \
- ((s) & PR_CONNREQUIRED) == 0)
-
-/*
- * Nfs outstanding request list element
- */
-struct nfsreq {
- TAILQ_ENTRY(nfsreq) r_chain;
- struct mbuf *r_mreq;
- struct mbuf *r_mrep;
- struct mbuf *r_md;
- caddr_t r_dpos;
- struct nfsmount *r_nmp;
- struct vnode *r_vp;
- u_long r_xid;
- int r_flags; /* flags on request, see below */
- int r_retry; /* max retransmission count */
- int r_rexmit; /* current retrans count */
- int r_timer; /* tick counter on reply */
- int r_procnum; /* NFS procedure number */
- int r_rtt; /* RTT for rpc */
- struct proc *r_procp; /* Proc that did I/O system call */
-};
-
-/*
- * Queue head for nfsreq's
- */
-extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
-
-/* Flag values for r_flags */
-#define R_TIMING 0x01 /* timing request (in mntp) */
-#define R_SENT 0x02 /* request has been sent */
-#define R_SOFTTERM 0x04 /* soft mnt, too many retries */
-#define R_INTR 0x08 /* intr mnt, signal pending */
-#define R_SOCKERR 0x10 /* Fatal error on socket */
-#define R_TPRINTFMSG 0x20 /* Did a tprintf msg. */
-#define R_MUSTRESEND 0x40 /* Must resend request */
-#define R_GETONEREP 0x80 /* Probe for one reply only */
-
-/*
- * A list of nfssvc_sock structures is maintained with all the sockets
- * that require service by the nfsd.
- * The nfsuid structs hang off of the nfssvc_sock structs in both lru
- * and uid hash lists.
- */
-#ifndef NFS_UIDHASHSIZ
-#define NFS_UIDHASHSIZ 29 /* Tune the size of nfssvc_sock with this */
-#endif
-#define NUIDHASH(sock, uid) \
- (&(sock)->ns_uidhashtbl[(uid) % NFS_UIDHASHSIZ])
-#ifndef NFS_WDELAYHASHSIZ
-#define NFS_WDELAYHASHSIZ 16 /* and with this */
-#endif
-#define NWDELAYHASH(sock, f) \
- (&(sock)->ns_wdelayhashtbl[(*((u_long *)(f))) % NFS_WDELAYHASHSIZ])
-#ifndef NFS_MUIDHASHSIZ
-#define NFS_MUIDHASHSIZ 63 /* Tune the size of nfsmount with this */
-#endif
-#define NMUIDHASH(nmp, uid) \
- (&(nmp)->nm_uidhashtbl[(uid) % NFS_MUIDHASHSIZ])
-#define NFSNOHASH(fhsum) \
- (&nfsnodehashtbl[(fhsum) & nfsnodehash])
-
-/*
- * Network address hash list element
- */
-union nethostaddr {
- u_long had_inetaddr;
- struct mbuf *had_nam;
-};
-
-struct nfsuid {
- TAILQ_ENTRY(nfsuid) nu_lru; /* LRU chain */
- LIST_ENTRY(nfsuid) nu_hash; /* Hash list */
- int nu_flag; /* Flags */
- union nethostaddr nu_haddr; /* Host addr. for dgram sockets */
- struct ucred nu_cr; /* Cred uid mapped to */
- int nu_expire; /* Expiry time (sec) */
- struct timeval nu_timestamp; /* Kerb. timestamp */
- u_long nu_nickname; /* Nickname on server */
- NFSKERBKEY_T nu_key; /* and session key */
-};
-
-#define nu_inetaddr nu_haddr.had_inetaddr
-#define nu_nam nu_haddr.had_nam
-/* Bits for nu_flag */
-#define NU_INETADDR 0x1
-#define NU_NAM 0x2
-#define NU_NETFAM(u) (((u)->nu_flag & NU_INETADDR) ? AF_INET : AF_ISO)
-
-struct nfssvc_sock {
- TAILQ_ENTRY(nfssvc_sock) ns_chain; /* List of all nfssvc_sock's */
- TAILQ_HEAD(, nfsuid) ns_uidlruhead;
- struct file *ns_fp;
- struct socket *ns_so;
- struct mbuf *ns_nam;
- struct mbuf *ns_raw;
- struct mbuf *ns_rawend;
- struct mbuf *ns_rec;
- struct mbuf *ns_recend;
- struct mbuf *ns_frag;
- int ns_flag;
- int ns_solock;
- int ns_cc;
- int ns_reclen;
- int ns_numuids;
- u_long ns_sref;
- LIST_HEAD(, nfsrv_descript) ns_tq; /* Write gather lists */
- LIST_HEAD(, nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ];
- LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ];
-};
-
-/* Bits for "ns_flag" */
-#define SLP_VALID 0x01
-#define SLP_DOREC 0x02
-#define SLP_NEEDQ 0x04
-#define SLP_DISCONN 0x08
-#define SLP_GETSTREAM 0x10
-#define SLP_LASTFRAG 0x20
-#define SLP_ALLFLAGS 0xff
-
-extern TAILQ_HEAD(nfssvc_sockhead, nfssvc_sock) nfssvc_sockhead;
-extern int nfssvc_sockhead_flag;
-#define SLP_INIT 0x01
-#define SLP_WANTINIT 0x02
-
-/*
- * One of these structures is allocated for each nfsd.
- */
-struct nfsd {
- TAILQ_ENTRY(nfsd) nfsd_chain; /* List of all nfsd's */
- int nfsd_flag; /* NFSD_ flags */
- struct nfssvc_sock *nfsd_slp; /* Current socket */
- int nfsd_authlen; /* Authenticator len */
- u_char nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */
- int nfsd_verflen; /* and the Verifier */
- u_char nfsd_verfstr[RPCVERF_MAXSIZ];
- struct proc *nfsd_procp; /* Proc ptr */
- struct nfsrv_descript *nfsd_nd; /* Associated nfsrv_descript */
-};
-
-/* Bits for "nfsd_flag" */
-#define NFSD_WAITING 0x01
-#define NFSD_REQINPROG 0x02
-#define NFSD_NEEDAUTH 0x04
-#define NFSD_AUTHFAIL 0x08
-
-/*
- * This structure is used by the server for describing each request.
- * Some fields are used only when write request gathering is performed.
- */
-struct nfsrv_descript {
- u_quad_t nd_time; /* Write deadline (usec) */
- off_t nd_off; /* Start byte offset */
- off_t nd_eoff; /* and end byte offset */
- LIST_ENTRY(nfsrv_descript) nd_hash; /* Hash list */
- LIST_ENTRY(nfsrv_descript) nd_tq; /* and timer list */
- LIST_HEAD(,nfsrv_descript) nd_coalesce; /* coalesced writes */
- struct mbuf *nd_mrep; /* Request mbuf list */
- struct mbuf *nd_md; /* Current dissect mbuf */
- struct mbuf *nd_mreq; /* Reply mbuf list */
- struct mbuf *nd_nam; /* and socket addr */
- struct mbuf *nd_nam2; /* return socket addr */
- caddr_t nd_dpos; /* Current dissect pos */
- int nd_procnum; /* RPC # */
- int nd_stable; /* storage type */
- int nd_flag; /* nd_flag */
- int nd_len; /* Length of this write */
- int nd_repstat; /* Reply status */
- u_long nd_retxid; /* Reply xid */
- u_long nd_duration; /* Lease duration */
- struct timeval nd_starttime; /* Time RPC initiated */
- fhandle_t nd_fh; /* File handle */
- struct ucred nd_cr; /* Credentials */
-};
-
-/* Bits for "nd_flag" */
-#define ND_READ LEASE_READ
-#define ND_WRITE LEASE_WRITE
-#define ND_CHECK 0x04
-#define ND_LEASE (ND_READ | ND_WRITE | ND_CHECK)
-#define ND_NFSV3 0x08
-#define ND_NQNFS 0x10
-#define ND_KERBNICK 0x20
-#define ND_KERBFULL 0x40
-#define ND_KERBAUTH (ND_KERBNICK | ND_KERBFULL)
-
-extern TAILQ_HEAD(nfsd_head, nfsd) nfsd_head;
-extern int nfsd_head_flag;
-#define NFSD_CHECKSLP 0x01
-
-/*
- * These macros compare nfsrv_descript structures.
- */
-#define NFSW_CONTIG(o, n) \
- ((o)->nd_eoff >= (n)->nd_off && \
- !bcmp((caddr_t)&(o)->nd_fh, (caddr_t)&(n)->nd_fh, NFSX_V3FH))
-
-#define NFSW_SAMECRED(o, n) \
- (((o)->nd_flag & ND_KERBAUTH) == ((n)->nd_flag & ND_KERBAUTH) && \
- !bcmp((caddr_t)&(o)->nd_cr, (caddr_t)&(n)->nd_cr, \
- sizeof (struct ucred)))
-
-int nfs_reply __P((struct nfsreq *));
-int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
-int nfs_send __P((struct socket *,struct mbuf *,struct mbuf *,struct nfsreq *));
-int nfs_rephead __P((int,struct nfsrv_descript *,struct nfssvc_sock *,int,int,u_quad_t *,struct mbuf **,struct mbuf **,caddr_t *));
-int nfs_sndlock __P((int *,struct nfsreq *));
-void nfs_sndunlock __P((int *flagp));
-int nfs_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *));
-int nfs_vinvalbuf __P((struct vnode *,int,struct ucred *,struct proc *,int));
-int nfs_readrpc __P((struct vnode *,struct uio *,struct ucred *));
-int nfs_writerpc __P((struct vnode *,struct uio *,struct ucred *,int *,int *));
-int nfs_readdirrpc __P((register struct vnode *,struct uio *,struct ucred *));
-int nfs_asyncio __P((struct buf *,struct ucred *));
-int nfs_doio __P((struct buf *,struct ucred *,struct proc *));
-int nfs_readlinkrpc __P((struct vnode *,struct uio *,struct ucred *));
-int nfs_sigintr __P((struct nfsmount *,struct nfsreq *r,struct proc *));
-int nfs_readdirplusrpc __P((struct vnode *,register struct uio *,struct ucred *));
-int nfsm_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *));
-void nfsm_srvfattr __P((struct nfsrv_descript *,struct vattr *,struct nfs_fattr *));
-void nfsm_srvwcc __P((struct nfsrv_descript *,int,struct vattr *,int,struct vattr *,struct mbuf **,char **));
-void nfsm_srvpostopattr __P((struct nfsrv_descript *,int,struct vattr *,struct mbuf **,char **));
-int netaddr_match __P((int,union nethostaddr *,struct mbuf *));
-int nfs_request __P((struct vnode *,struct mbuf *,int,struct proc *,struct ucred *,struct mbuf **,struct mbuf **,caddr_t *));
-int nfs_loadattrcache __P((struct vnode **,struct mbuf **,caddr_t *,struct vattr *));
-int nfs_namei __P((struct nameidata *,fhandle_t *,int,struct nfssvc_sock *,struct mbuf *,struct mbuf **,caddr_t *,struct vnode **,struct proc *,int));
-void nfsm_adj __P((struct mbuf *,int,int));
-int nfsm_mbuftouio __P((struct mbuf **,struct uio *,int,caddr_t *));
-void nfsrv_initcache __P((void));
-int nfs_getauth __P((struct nfsmount *,struct nfsreq *,struct ucred *,char **,int *,char *,int *,NFSKERBKEY_T));
-int nfs_getnickauth __P((struct nfsmount *,struct ucred *,char **,int *,char *,int));
-int nfs_savenickauth __P((struct nfsmount *,struct ucred *,int,NFSKERBKEY_T,struct mbuf **,char **,struct mbuf *));
-int nfs_adv __P((struct mbuf **,caddr_t *,int,int));
-void nfs_nhinit __P((void));
-void nfs_timer __P((void*));
-u_long nfs_hash __P((nfsfh_t *,int));
-void nfsrv_slpderef __P((struct nfssvc_sock *slp));
-int nfsrv_dorec __P((struct nfssvc_sock *,struct nfsd *,struct nfsrv_descript **));
-void nfsrv_cleancache __P((void));
-int nfsrv_getcache __P((struct nfsrv_descript *,struct nfssvc_sock *,struct mbuf **));
-int nfs_init __P((void));
-void nfsrv_updatecache __P((struct nfsrv_descript *,int,struct mbuf *));
-int nfs_connect __P((struct nfsmount *,struct nfsreq *));
-void nfs_disconnect __P((struct nfsmount *nmp));
-int nfs_getattrcache __P((struct vnode *,struct vattr *));
-int nfsm_strtmbuf __P((struct mbuf **,char **,char *,long));
-int nfs_bioread __P((struct vnode *,struct uio *,int,struct ucred *, int getpages));
-int nfsm_uiotombuf __P((struct uio *,struct mbuf **,int,caddr_t *));
-void nfsrv_init __P((int));
-void nfs_clearcommit __P((struct mount *));
-int nfsrv_errmap __P((struct nfsrv_descript *, int));
-void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag));
-void nfsrvw_sort __P((gid_t [],int));
-void nfsrv_setcred __P((struct ucred *,struct ucred *));
-int nfs_writebp __P((struct buf *,int));
-int nfsrv_object_create __P(( struct vnode * ));
-void nfsrv_wakenfsd __P((struct nfssvc_sock *slp));
-int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *,
- struct proc *, struct mbuf **));
-int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *,
- struct proc *p));
-
-int nfsrv3_access __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **,
- struct ucred *,struct nfssvc_sock *,struct mbuf *,
- int *,int));
-int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_link __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_lookup __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_mkdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_mknod __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_noop __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_null __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_pathconf __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_read __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_readdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_readdirplus __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_readlink __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_remove __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_rename __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_rmdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_setattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_statfs __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_symlink __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-
-#ifdef NFS_DEBUG
-
-extern int nfs_debug;
-#define NFS_DEBUG_ASYNCIO 1 /* asynchronous i/o */
-#define NFS_DEBUG_WG 2 /* server write gathering */
-#define NFS_DEBUG_RC 4 /* server request caching */
-
-#define NFS_DPF(cat, args) \
- do { \
- if (nfs_debug & NFS_DEBUG_##cat) printf args; \
- } while (0)
-
-#else
-
-#define NFS_DPF(cat, args)
-
-#endif
-
-#endif /* KERNEL */
-
-#endif
diff --git a/c/src/exec/libnetworking/nfs/nfsdiskless.h b/c/src/exec/libnetworking/nfs/nfsdiskless.h
deleted file mode 100644
index 0ed5c8f6f7..0000000000
--- a/c/src/exec/libnetworking/nfs/nfsdiskless.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)nfsdiskless.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_NFSDISKLESS_H_
-#define _NFS_NFSDISKLESS_H_
-
-/*
- * Structure that must be initialized for a diskless nfs client.
- * This structure is used by nfs_mountroot() to set up the root and swap
- * vnodes plus do a partial ifconfig(8) and route(8) so that the critical net
- * interface can communicate with the server.
- * The primary bootstrap is expected to fill in the appropriate fields before
- * starting the kernel. Whether or not the swap area is nfs mounted is determined
- * by the value in swdevt[0]. (equal to NODEV --> swap over nfs)
- * Currently only works for AF_INET protocols.
- * NB: All fields are stored in net byte order to avoid hassles with
- * client/server byte ordering differences.
- */
-
-/*
- * I have defined a new structure that can handle an NFS Version 3 file handle
- * but the kernel still expects the old Version 2 one to be provided. The
- * changes required in nfs_vfsops.c for using the new are documented there in
- * comments. (I felt that breaking network booting code by changing this
- * structure would not be prudent at this time, since almost all servers are
- * still Version 2 anyhow.)
- */
-struct nfsv3_diskless {
- struct ifaliasreq myif; /* Default interface */
- struct sockaddr_in mygateway; /* Default gateway */
- struct nfs_args swap_args; /* Mount args for swap file */
- int swap_fhsize; /* Size of file handle */
- u_char swap_fh[NFSX_V3FHMAX]; /* Swap file's file handle */
- struct sockaddr_in swap_saddr; /* Address of swap server */
- char swap_hostnam[MNAMELEN]; /* Host name for mount pt */
- int swap_nblks; /* Size of server swap file */
- struct ucred swap_ucred; /* Swap credentials */
- struct nfs_args root_args; /* Mount args for root fs */
- int root_fhsize; /* Size of root file handle */
- u_char root_fh[NFSX_V3FHMAX]; /* File handle of root dir */
- struct sockaddr_in root_saddr; /* Address of root server */
- char root_hostnam[MNAMELEN]; /* Host name for mount pt */
- long root_time; /* Timestamp of root fs */
- char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */
-};
-
-struct nfs_diskless {
- struct ifaliasreq myif; /* Default interface */
- struct sockaddr_in mygateway; /* Default gateway */
- struct nfs_args swap_args; /* Mount args for swap file */
- u_char swap_fh[NFSX_V2FH]; /* Swap file's file handle */
- struct sockaddr_in swap_saddr; /* Address of swap server */
- char swap_hostnam[MNAMELEN]; /* Host name for mount pt */
- int swap_nblks; /* Size of server swap file */
- struct ucred swap_ucred; /* Swap credentials */
- struct nfs_args root_args; /* Mount args for root fs */
- u_char root_fh[NFSX_V2FH]; /* File handle of root dir */
- struct sockaddr_in root_saddr; /* Address of root server */
- char root_hostnam[MNAMELEN]; /* Host name for mount pt */
- long root_time; /* Timestamp of root fs */
- char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */
-};
-
-#endif
diff --git a/c/src/exec/libnetworking/nfs/nfsproto.h b/c/src/exec/libnetworking/nfs/nfsproto.h
deleted file mode 100644
index 6ce7c5b960..0000000000
--- a/c/src/exec/libnetworking/nfs/nfsproto.h
+++ /dev/null
@@ -1,441 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)nfsproto.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_NFSPROTO_H_
-#define _NFS_NFSPROTO_H_
-
-/*
- * nfs definitions as per the Version 2 and 3 specs
- */
-
-/*
- * Constants as defined in the Sun NFS Version 2 and 3 specs.
- * "NFS: Network File System Protocol Specification" RFC1094
- * and in the "NFS: Network File System Version 3 Protocol
- * Specification"
- */
-
-#define NFS_PORT 2049
-#define NFS_PROG 100003
-#define NFS_VER2 2
-#define NFS_VER3 3
-#define NFS_V2MAXDATA 8192
-#define NFS_MAXDGRAMDATA 16384
-#define NFS_MAXDATA 32768
-#define NFS_MAXPATHLEN 1024
-#define NFS_MAXNAMLEN 255
-#define NFS_MAXPKTHDR 404
-#define NFS_MAXPACKET (NFS_MAXPKTHDR + NFS_MAXDATA)
-#define NFS_MINPACKET 20
-#define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */
-
-/* Stat numbers for rpc returns (version 2 and 3) */
-#define NFS_OK 0
-#define NFSERR_PERM 1
-#define NFSERR_NOENT 2
-#define NFSERR_IO 5
-#define NFSERR_NXIO 6
-#define NFSERR_ACCES 13
-#define NFSERR_EXIST 17
-#define NFSERR_XDEV 18 /* Version 3 only */
-#define NFSERR_NODEV 19
-#define NFSERR_NOTDIR 20
-#define NFSERR_ISDIR 21
-#define NFSERR_INVAL 22 /* Version 3 only */
-#define NFSERR_FBIG 27
-#define NFSERR_NOSPC 28
-#define NFSERR_ROFS 30
-#define NFSERR_MLINK 31 /* Version 3 only */
-#define NFSERR_NAMETOL 63
-#define NFSERR_NOTEMPTY 66
-#define NFSERR_DQUOT 69
-#define NFSERR_STALE 70
-#define NFSERR_REMOTE 71 /* Version 3 only */
-#define NFSERR_WFLUSH 99 /* Version 2 only */
-#define NFSERR_BADHANDLE 10001 /* The rest Version 3 only */
-#define NFSERR_NOT_SYNC 10002
-#define NFSERR_BAD_COOKIE 10003
-#define NFSERR_NOTSUPP 10004
-#define NFSERR_TOOSMALL 10005
-#define NFSERR_SERVERFAULT 10006
-#define NFSERR_BADTYPE 10007
-#define NFSERR_JUKEBOX 10008
-#define NFSERR_TRYLATER NFSERR_JUKEBOX
-#define NFSERR_STALEWRITEVERF 30001 /* Fake return for nfs_commit() */
-
-#define NFSERR_RETVOID 0x20000000 /* Return void, not error */
-#define NFSERR_AUTHERR 0x40000000 /* Mark an authentication error */
-#define NFSERR_RETERR 0x80000000 /* Mark an error return for V3 */
-
-/* Sizes in bytes of various nfs rpc components */
-#define NFSX_UNSIGNED 4
-
-/* specific to NFS Version 2 */
-#define NFSX_V2FH 32
-#define NFSX_V2FATTR 68
-#define NFSX_V2SATTR 32
-#define NFSX_V2COOKIE 4
-#define NFSX_V2STATFS 20
-
-/* specific to NFS Version 3 */
-#define NFSX_V3FH (sizeof (fhandle_t)) /* size this server uses */
-#define NFSX_V3FHMAX 64 /* max. allowed by protocol */
-#define NFSX_V3FATTR 84
-#define NFSX_V3SATTR 60 /* max. all fields filled in */
-#define NFSX_V3SRVSATTR (sizeof (struct nfsv3_sattr))
-#define NFSX_V3POSTOPATTR (NFSX_V3FATTR + NFSX_UNSIGNED)
-#define NFSX_V3WCCDATA (NFSX_V3POSTOPATTR + 8 * NFSX_UNSIGNED)
-#define NFSX_V3COOKIEVERF 8
-#define NFSX_V3WRITEVERF 8
-#define NFSX_V3CREATEVERF 8
-#define NFSX_V3STATFS 52
-#define NFSX_V3FSINFO 48
-#define NFSX_V3PATHCONF 24
-
-/* variants for both versions */
-#define NFSX_FH(v3) ((v3) ? (NFSX_V3FHMAX + NFSX_UNSIGNED) : \
- NFSX_V2FH)
-#define NFSX_SRVFH(v3) ((v3) ? NFSX_V3FH : NFSX_V2FH)
-#define NFSX_FATTR(v3) ((v3) ? NFSX_V3FATTR : NFSX_V2FATTR)
-#define NFSX_PREOPATTR(v3) ((v3) ? (7 * NFSX_UNSIGNED) : 0)
-#define NFSX_POSTOPATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : 0)
-#define NFSX_POSTOPORFATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : \
- NFSX_V2FATTR)
-#define NFSX_WCCDATA(v3) ((v3) ? NFSX_V3WCCDATA : 0)
-#define NFSX_WCCORFATTR(v3) ((v3) ? NFSX_V3WCCDATA : NFSX_V2FATTR)
-#define NFSX_SATTR(v3) ((v3) ? NFSX_V3SATTR : NFSX_V2SATTR)
-#define NFSX_COOKIEVERF(v3) ((v3) ? NFSX_V3COOKIEVERF : 0)
-#define NFSX_WRITEVERF(v3) ((v3) ? NFSX_V3WRITEVERF : 0)
-#define NFSX_READDIR(v3) ((v3) ? (5 * NFSX_UNSIGNED) : \
- (2 * NFSX_UNSIGNED))
-#define NFSX_STATFS(v3) ((v3) ? NFSX_V3STATFS : NFSX_V2STATFS)
-
-/* nfs rpc procedure numbers (before version mapping) */
-#define NFSPROC_NULL 0
-#define NFSPROC_GETATTR 1
-#define NFSPROC_SETATTR 2
-#define NFSPROC_LOOKUP 3
-#define NFSPROC_ACCESS 4
-#define NFSPROC_READLINK 5
-#define NFSPROC_READ 6
-#define NFSPROC_WRITE 7
-#define NFSPROC_CREATE 8
-#define NFSPROC_MKDIR 9
-#define NFSPROC_SYMLINK 10
-#define NFSPROC_MKNOD 11
-#define NFSPROC_REMOVE 12
-#define NFSPROC_RMDIR 13
-#define NFSPROC_RENAME 14
-#define NFSPROC_LINK 15
-#define NFSPROC_READDIR 16
-#define NFSPROC_READDIRPLUS 17
-#define NFSPROC_FSSTAT 18
-#define NFSPROC_FSINFO 19
-#define NFSPROC_PATHCONF 20
-#define NFSPROC_COMMIT 21
-
-/* And leasing (nqnfs) procedure numbers (must be last) */
-#define NQNFSPROC_GETLEASE 22
-#define NQNFSPROC_VACATED 23
-#define NQNFSPROC_EVICTED 24
-
-#define NFSPROC_NOOP 25
-#define NFS_NPROCS 26
-
-/* Actual Version 2 procedure numbers */
-#define NFSV2PROC_NULL 0
-#define NFSV2PROC_GETATTR 1
-#define NFSV2PROC_SETATTR 2
-#define NFSV2PROC_NOOP 3
-#define NFSV2PROC_ROOT NFSV2PROC_NOOP /* Obsolete */
-#define NFSV2PROC_LOOKUP 4
-#define NFSV2PROC_READLINK 5
-#define NFSV2PROC_READ 6
-#define NFSV2PROC_WRITECACHE NFSV2PROC_NOOP /* Obsolete */
-#define NFSV2PROC_WRITE 8
-#define NFSV2PROC_CREATE 9
-#define NFSV2PROC_REMOVE 10
-#define NFSV2PROC_RENAME 11
-#define NFSV2PROC_LINK 12
-#define NFSV2PROC_SYMLINK 13
-#define NFSV2PROC_MKDIR 14
-#define NFSV2PROC_RMDIR 15
-#define NFSV2PROC_READDIR 16
-#define NFSV2PROC_STATFS 17
-
-/*
- * Constants used by the Version 3 protocol for various RPCs
- */
-#define NFSV3SATTRTIME_DONTCHANGE 0
-#define NFSV3SATTRTIME_TOSERVER 1
-#define NFSV3SATTRTIME_TOCLIENT 2
-
-#define NFSV3ACCESS_READ 0x01
-#define NFSV3ACCESS_LOOKUP 0x02
-#define NFSV3ACCESS_MODIFY 0x04
-#define NFSV3ACCESS_EXTEND 0x08
-#define NFSV3ACCESS_DELETE 0x10
-#define NFSV3ACCESS_EXECUTE 0x20
-
-#define NFSV3WRITE_UNSTABLE 0
-#define NFSV3WRITE_DATASYNC 1
-#define NFSV3WRITE_FILESYNC 2
-
-#define NFSV3CREATE_UNCHECKED 0
-#define NFSV3CREATE_GUARDED 1
-#define NFSV3CREATE_EXCLUSIVE 2
-
-#define NFSV3FSINFO_LINK 0x01
-#define NFSV3FSINFO_SYMLINK 0x02
-#define NFSV3FSINFO_HOMOGENEOUS 0x08
-#define NFSV3FSINFO_CANSETTIME 0x10
-
-/* Conversion macros */
-#define vtonfsv2_mode(t,m) \
- txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \
- MAKEIMODE((t), (m)))
-#define vtonfsv3_mode(m) txdr_unsigned((m) & 07777)
-#define nfstov_mode(a) (fxdr_unsigned(u_short, (a))&07777)
-#define vtonfsv2_type(a) txdr_unsigned(nfsv2_type[((long)(a))])
-#define vtonfsv3_type(a) txdr_unsigned(nfsv3_type[((long)(a))])
-#define nfsv2tov_type(a) nv2tov_type[fxdr_unsigned(u_long,(a))&0x7]
-#define nfsv3tov_type(a) nv3tov_type[fxdr_unsigned(u_long,(a))&0x7]
-
-/* File types */
-typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5,
- NFSOCK=6, NFFIFO=7 } nfstype;
-
-/* Structs for common parts of the rpc's */
-/*
- * File Handle (32 bytes for version 2), variable up to 64 for version 3.
- * File Handles of up to NFS_SMALLFH in size are stored directly in the
- * nfs node, whereas larger ones are malloc'd. (This never happens when
- * NFS_SMALLFH is set to 64.)
- * NFS_SMALLFH should be in the range of 32 to 64 and be divisible by 4.
- */
-#ifndef NFS_SMALLFH
-#define NFS_SMALLFH 64
-#endif
-union nfsfh {
- fhandle_t fh_generic;
- u_char fh_bytes[NFS_SMALLFH];
-};
-typedef union nfsfh nfsfh_t;
-
-struct nfsv2_time {
- u_long nfsv2_sec;
- u_long nfsv2_usec;
-};
-typedef struct nfsv2_time nfstime2;
-
-struct nfsv3_time {
- u_long nfsv3_sec;
- u_long nfsv3_nsec;
-};
-typedef struct nfsv3_time nfstime3;
-
-/*
- * Quads are defined as arrays of 2 longs to ensure dense packing for the
- * protocol and to facilitate xdr conversion.
- */
-struct nfs_uquad {
- u_long nfsuquad[2];
-};
-typedef struct nfs_uquad nfsuint64;
-
-/*
- * Used to convert between two u_longs and a u_quad_t.
- */
-union nfs_quadconvert {
- u_long lval[2];
- u_quad_t qval;
-};
-typedef union nfs_quadconvert nfsquad_t;
-
-/*
- * NFS Version 3 special file number.
- */
-struct nfsv3_spec {
- u_long specdata1;
- u_long specdata2;
-};
-typedef struct nfsv3_spec nfsv3spec;
-
-/*
- * File attributes and setable attributes. These structures cover both
- * NFS version 2 and the version 3 protocol. Note that the union is only
- * used so that one pointer can refer to both variants. These structures
- * go out on the wire and must be densely packed, so no quad data types
- * are used. (all fields are longs or u_longs or structures of same)
- * NB: You can't do sizeof(struct nfs_fattr), you must use the
- * NFSX_FATTR(v3) macro.
- */
-struct nfs_fattr {
- u_long fa_type;
- u_long fa_mode;
- u_long fa_nlink;
- u_long fa_uid;
- u_long fa_gid;
- union {
- struct {
- u_long nfsv2fa_size;
- u_long nfsv2fa_blocksize;
- u_long nfsv2fa_rdev;
- u_long nfsv2fa_blocks;
- u_long nfsv2fa_fsid;
- u_long nfsv2fa_fileid;
- nfstime2 nfsv2fa_atime;
- nfstime2 nfsv2fa_mtime;
- nfstime2 nfsv2fa_ctime;
- } fa_nfsv2;
- struct {
- nfsuint64 nfsv3fa_size;
- nfsuint64 nfsv3fa_used;
- nfsv3spec nfsv3fa_rdev;
- nfsuint64 nfsv3fa_fsid;
- nfsuint64 nfsv3fa_fileid;
- nfstime3 nfsv3fa_atime;
- nfstime3 nfsv3fa_mtime;
- nfstime3 nfsv3fa_ctime;
- } fa_nfsv3;
- } fa_un;
-};
-
-/* and some ugly defines for accessing union components */
-#define fa2_size fa_un.fa_nfsv2.nfsv2fa_size
-#define fa2_blocksize fa_un.fa_nfsv2.nfsv2fa_blocksize
-#define fa2_rdev fa_un.fa_nfsv2.nfsv2fa_rdev
-#define fa2_blocks fa_un.fa_nfsv2.nfsv2fa_blocks
-#define fa2_fsid fa_un.fa_nfsv2.nfsv2fa_fsid
-#define fa2_fileid fa_un.fa_nfsv2.nfsv2fa_fileid
-#define fa2_atime fa_un.fa_nfsv2.nfsv2fa_atime
-#define fa2_mtime fa_un.fa_nfsv2.nfsv2fa_mtime
-#define fa2_ctime fa_un.fa_nfsv2.nfsv2fa_ctime
-#define fa3_size fa_un.fa_nfsv3.nfsv3fa_size
-#define fa3_used fa_un.fa_nfsv3.nfsv3fa_used
-#define fa3_rdev fa_un.fa_nfsv3.nfsv3fa_rdev
-#define fa3_fsid fa_un.fa_nfsv3.nfsv3fa_fsid
-#define fa3_fileid fa_un.fa_nfsv3.nfsv3fa_fileid
-#define fa3_atime fa_un.fa_nfsv3.nfsv3fa_atime
-#define fa3_mtime fa_un.fa_nfsv3.nfsv3fa_mtime
-#define fa3_ctime fa_un.fa_nfsv3.nfsv3fa_ctime
-
-struct nfsv2_sattr {
- u_long sa_mode;
- u_long sa_uid;
- u_long sa_gid;
- u_long sa_size;
- nfstime2 sa_atime;
- nfstime2 sa_mtime;
-};
-
-/*
- * NFS Version 3 sattr structure for the new node creation case.
- */
-struct nfsv3_sattr {
- u_long sa_modetrue;
- u_long sa_mode;
- u_long sa_uidtrue;
- u_long sa_uid;
- u_long sa_gidtrue;
- u_long sa_gid;
- u_long sa_sizefalse;
- u_long sa_atimetype;
- nfstime3 sa_atime;
- u_long sa_mtimetype;
- nfstime3 sa_mtime;
-};
-
-struct nfs_statfs {
- union {
- struct {
- u_long nfsv2sf_tsize;
- u_long nfsv2sf_bsize;
- u_long nfsv2sf_blocks;
- u_long nfsv2sf_bfree;
- u_long nfsv2sf_bavail;
- } sf_nfsv2;
- struct {
- nfsuint64 nfsv3sf_tbytes;
- nfsuint64 nfsv3sf_fbytes;
- nfsuint64 nfsv3sf_abytes;
- nfsuint64 nfsv3sf_tfiles;
- nfsuint64 nfsv3sf_ffiles;
- nfsuint64 nfsv3sf_afiles;
- u_long nfsv3sf_invarsec;
- } sf_nfsv3;
- } sf_un;
-};
-
-#define sf_tsize sf_un.sf_nfsv2.nfsv2sf_tsize
-#define sf_bsize sf_un.sf_nfsv2.nfsv2sf_bsize
-#define sf_blocks sf_un.sf_nfsv2.nfsv2sf_blocks
-#define sf_bfree sf_un.sf_nfsv2.nfsv2sf_bfree
-#define sf_bavail sf_un.sf_nfsv2.nfsv2sf_bavail
-#define sf_tbytes sf_un.sf_nfsv3.nfsv3sf_tbytes
-#define sf_fbytes sf_un.sf_nfsv3.nfsv3sf_fbytes
-#define sf_abytes sf_un.sf_nfsv3.nfsv3sf_abytes
-#define sf_tfiles sf_un.sf_nfsv3.nfsv3sf_tfiles
-#define sf_ffiles sf_un.sf_nfsv3.nfsv3sf_ffiles
-#define sf_afiles sf_un.sf_nfsv3.nfsv3sf_afiles
-#define sf_invarsec sf_un.sf_nfsv3.nfsv3sf_invarsec
-
-struct nfsv3_fsinfo {
- u_long fs_rtmax;
- u_long fs_rtpref;
- u_long fs_rtmult;
- u_long fs_wtmax;
- u_long fs_wtpref;
- u_long fs_wtmult;
- u_long fs_dtpref;
- nfsuint64 fs_maxfilesize;
- nfstime3 fs_timedelta;
- u_long fs_properties;
-};
-
-struct nfsv3_pathconf {
- u_long pc_linkmax;
- u_long pc_namemax;
- u_long pc_notrunc;
- u_long pc_chownrestricted;
- u_long pc_caseinsensitive;
- u_long pc_casepreserving;
-};
-
-#endif
diff --git a/c/src/exec/libnetworking/nfs/rpcv2.h b/c/src/exec/libnetworking/nfs/rpcv2.h
deleted file mode 100644
index 5fd6e7febf..0000000000
--- a/c/src/exec/libnetworking/nfs/rpcv2.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)rpcv2.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_RPCV2_H_
-#define _NFS_RPCV2_H_
-
-/*
- * Definitions for Sun RPC Version 2, from
- * "RPC: Remote Procedure Call Protocol Specification" RFC1057
- */
-
-/* Version # */
-#define RPC_VER2 2
-
-/* Authentication */
-#define RPCAUTH_NULL 0
-#define RPCAUTH_UNIX 1
-#define RPCAUTH_SHORT 2
-#define RPCAUTH_KERB4 4
-#define RPCAUTH_NQNFS 300000
-#define RPCAUTH_MAXSIZ 400
-#define RPCVERF_MAXSIZ 12 /* For Kerb, can actually be 400 */
-#define RPCAUTH_UNIXGIDS 16
-
-/*
- * Constants associated with authentication flavours.
- */
-#define RPCAKN_FULLNAME 0
-#define RPCAKN_NICKNAME 1
-
-/* Rpc Constants */
-#define RPC_CALL 0
-#define RPC_REPLY 1
-#define RPC_MSGACCEPTED 0
-#define RPC_MSGDENIED 1
-#define RPC_PROGUNAVAIL 1
-#define RPC_PROGMISMATCH 2
-#define RPC_PROCUNAVAIL 3
-#define RPC_GARBAGE 4 /* I like this one */
-#define RPC_MISMATCH 0
-#define RPC_AUTHERR 1
-
-/* Authentication failures */
-#define AUTH_BADCRED 1
-#define AUTH_REJECTCRED 2
-#define AUTH_BADVERF 3
-#define AUTH_REJECTVERF 4
-#define AUTH_TOOWEAK 5 /* Give em wheaties */
-
-/* Sizes of rpc header parts */
-#define RPC_SIZ 24
-#define RPC_REPLYSIZ 28
-
-/* RPC Prog definitions */
-#define RPCPROG_MNT 100005
-#define RPCMNT_VER1 1
-#define RPCMNT_VER3 3
-#define RPCMNT_MOUNT 1
-#define RPCMNT_DUMP 2
-#define RPCMNT_UMOUNT 3
-#define RPCMNT_UMNTALL 4
-#define RPCMNT_EXPORT 5
-#define RPCMNT_NAMELEN 255
-#define RPCMNT_PATHLEN 1024
-#define RPCPROG_NFS 100003
-
-/*
- * Structures used for RPCAUTH_KERB4.
- */
-struct nfsrpc_fullverf {
- u_long t1;
- u_long t2;
- u_long w2;
-};
-
-struct nfsrpc_fullblock {
- u_long t1;
- u_long t2;
- u_long w1;
- u_long w2;
-};
-
-struct nfsrpc_nickverf {
- u_long kind;
- struct nfsrpc_fullverf verf;
-};
-
-/*
- * and their sizes in bytes.. If sizeof (struct nfsrpc_xx) != these
- * constants, well then things will break in mount_nfs and nfsd.
- */
-#define RPCX_FULLVERF 12
-#define RPCX_FULLBLOCK 16
-#define RPCX_NICKVERF 16
-
-#ifdef NFSKERB
-XXX
-#else
-typedef u_char NFSKERBKEY_T[2];
-typedef u_char NFSKERBKEYSCHED_T[2];
-#endif
-#define NFS_KERBSRV "rcmd" /* Kerberos Service for NFS */
-#define NFS_KERBTTL (30 * 60) /* Credential ttl (sec) */
-#define NFS_KERBCLOCKSKEW (5 * 60) /* Clock skew (sec) */
-#define NFS_KERBW1(t) (*((u_long *)(&((t).dat[((t).length + 3) & ~0x3]))))
-#endif
diff --git a/c/src/exec/libnetworking/nfs/xdr_subs.h b/c/src/exec/libnetworking/nfs/xdr_subs.h
deleted file mode 100644
index 874730378f..0000000000
--- a/c/src/exec/libnetworking/nfs/xdr_subs.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)xdr_subs.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_XDR_SUBS_H_
-#define _NFS_XDR_SUBS_H_
-
-/*
- * Macros used for conversion to/from xdr representation by nfs...
- * These use the MACHINE DEPENDENT routines ntohl, htonl
- * As defined by "XDR: External Data Representation Standard" RFC1014
- *
- * To simplify the implementation, we use ntohl/htonl even on big-endian
- * machines, and count on them being `#define'd away. Some of these
- * might be slightly more efficient as quad_t copies on a big-endian,
- * but we cannot count on their alignment anyway.
- */
-
-#define fxdr_unsigned(t, v) ((t)ntohl((long)(v)))
-#define txdr_unsigned(v) (htonl((long)(v)))
-
-#define fxdr_nfsv2time(f, t) { \
- (t)->tv_sec = ntohl(((struct nfsv2_time *)(f))->nfsv2_sec); \
- if (((struct nfsv2_time *)(f))->nfsv2_usec != 0xffffffff) \
- (t)->tv_nsec = 1000 * ntohl(((struct nfsv2_time *)(f))->nfsv2_usec); \
- else \
- (t)->tv_nsec = 0; \
-}
-#define txdr_nfsv2time(f, t) { \
- ((struct nfsv2_time *)(t))->nfsv2_sec = htonl((f)->tv_sec); \
- if ((f)->tv_nsec != -1) \
- ((struct nfsv2_time *)(t))->nfsv2_usec = htonl((f)->tv_nsec / 1000); \
- else \
- ((struct nfsv2_time *)(t))->nfsv2_usec = 0xffffffff; \
-}
-
-#define fxdr_nfsv3time(f, t) { \
- (t)->tv_sec = ntohl(((struct nfsv3_time *)(f))->nfsv3_sec); \
- (t)->tv_nsec = ntohl(((struct nfsv3_time *)(f))->nfsv3_nsec); \
-}
-#define txdr_nfsv3time(f, t) { \
- ((struct nfsv3_time *)(t))->nfsv3_sec = htonl((f)->tv_sec); \
- ((struct nfsv3_time *)(t))->nfsv3_nsec = htonl((f)->tv_nsec); \
-}
-
-#define fxdr_hyper(f, t) { \
- ((long *)(t))[_QUAD_HIGHWORD] = ntohl(((long *)(f))[0]); \
- ((long *)(t))[_QUAD_LOWWORD] = ntohl(((long *)(f))[1]); \
-}
-#define txdr_hyper(f, t) { \
- ((long *)(t))[0] = htonl(((long *)(f))[_QUAD_HIGHWORD]); \
- ((long *)(t))[1] = htonl(((long *)(f))[_QUAD_LOWWORD]); \
-}
-
-#endif
diff --git a/c/src/exec/libnetworking/opt_ipfw.h b/c/src/exec/libnetworking/opt_ipfw.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/exec/libnetworking/opt_ipfw.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/exec/libnetworking/opt_mrouting.h b/c/src/exec/libnetworking/opt_mrouting.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/exec/libnetworking/opt_mrouting.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/exec/libnetworking/opt_tcpdebug.h b/c/src/exec/libnetworking/opt_tcpdebug.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/exec/libnetworking/opt_tcpdebug.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/exec/libnetworking/poll.h b/c/src/exec/libnetworking/poll.h
deleted file mode 100644
index 74dfca76c1..0000000000
--- a/c/src/exec/libnetworking/poll.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*-
- * Copyright (c) 1997 Peter Wemm <peter@freebsd.org>
- * 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. 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 BY THE AUTHOR 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 AUTHOR 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.
- *
- * $Id$
- */
-
-#ifndef _SYS_POLL_H_
-#define _SYS_POLL_H_
-
-/*
- * This file is intended to be compatable with the traditional poll.h.
- */
-
-/*
- * This structure is passed as an array to poll(2).
- */
-struct pollfd {
- int fd; /* which file descriptor to poll */
- short events; /* events we are interested in */
- short revents; /* events found on return */
-};
-
-/*
- * Requestable events. If poll(2) finds any of these set, they are
- * copied to revents on return.
- * XXX Note that FreeBSD doesn't make much distinction between POLLPRI
- * and POLLRDBAND since none of the file types have distinct priority
- * bands - and only some have an urgent "mode".
- * XXX Note POLLIN isn't really supported in true SVSV terms. Under SYSV
- * POLLIN includes all of normal, band and urgent data. Most poll handlers
- * on FreeBSD only treat it as "normal" data.
- */
-#define POLLIN 0x0001 /* any readable data available */
-#define POLLPRI 0x0002 /* OOB/Urgent readable data */
-#define POLLOUT 0x0004 /* file descriptor is writeable */
-#define POLLRDNORM 0x0040 /* non-OOB/URG data available */
-#define POLLWRNORM POLLOUT /* no write type differentiation */
-#define POLLRDBAND 0x0080 /* OOB/Urgent readable data */
-#define POLLWRBAND 0x0100 /* OOB/Urgent data can be written */
-
-/*
- * FreeBSD extensions: polling on a regular file might return one
- * of these events (currently only supported on UFS).
- */
-#define POLLEXTEND 0x0200 /* file may have been extended */
-#define POLLATTRIB 0x0400 /* file attributes may have changed */
-#define POLLNLINK 0x0800 /* (un)link/rename may have happened */
-#define POLLWRITE 0x1000 /* file's contents may have changed */
-
-/*
- * These events are set if they occur regardless of whether they were
- * requested.
- */
-#define POLLERR 0x0008 /* some poll error occurred */
-#define POLLHUP 0x0010 /* file descriptor was "hung up" */
-#define POLLNVAL 0x0020 /* requested events "invalid" */
-
-#define POLLSTANDARD (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|\
- POLLWRBAND|POLLERR|POLLHUP|POLLNVAL)
-
-/*
- * Request that poll() wait forever.
- * XXX in SYSV, this is defined in stropts.h, which is not included
- * by poll.h.
- */
-#define INFTIM (-1)
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-/*
- * XXX logically, poll() should be declared in <poll.h>, but SVR4 at
- * least has it here in <sys/poll.h>.
- * XXX poll() has "unsigned long" nfds on SVR4, not unsigned as on the
- * other BSDs.
- */
-int poll __P((struct pollfd *_pfd, unsigned _nfds, int _timeout));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif /* !_SYS_POLL_H_ */
diff --git a/c/src/exec/libnetworking/resolv.h b/c/src/exec/libnetworking/resolv.h
deleted file mode 100644
index 614f204706..0000000000
--- a/c/src/exec/libnetworking/resolv.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/*-
- * Copyright (c) 1983, 1987, 1989, 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.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * @(#)resolv.h 8.1 (Berkeley) 6/2/93
- * From Id: resolv.h,v 8.12 1998/04/28 19:36:46 halley Exp $
- * $Id$
- */
-
-#ifndef _RESOLV_H_
-#define _RESOLV_H_
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/cdefs.h>
-#include <stdio.h>
-
-/*
- * Revision information. This is the release date in YYYYMMDD format.
- * It can change every day so the right thing to do with it is use it
- * in preprocessor commands such as "#if (__RES > 19931104)". Do not
- * compare for equality; rather, use it to determine whether your resolver
- * is new enough to contain a certain feature.
- */
-
-#define __RES 19960801
-
-/*
- * This used to be defined in res_query.c, now it's in herror.c. It was
- * never extern'd by any *.h file before it was placed here. herror.c is
- * part of libresolv.a even though it might make more sense in libnetdb.a
- * or even libnet.a.
- */
-
-extern int h_errno;
-
-/*
- * Resolver configuration file.
- * Normally not present, but may contain the address of the
- * inital name server(s) to query and the domain search list.
- */
-
-#ifndef _PATH_RESCONF
-#define _PATH_RESCONF "/etc/resolv.conf"
-#endif
-
-/*
- * Global defines and variables for resolver stub.
- */
-#define MAXNS 3 /* max # name servers we'll track */
-#define MAXDFLSRCH 3 /* # default domain levels to try */
-#define MAXDNSRCH 6 /* max # domains in search path */
-#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
-
-#define RES_TIMEOUT 5 /* min. seconds between retries */
-#define MAXRESOLVSORT 10 /* number of net to sort on */
-#define RES_MAXNDOTS 15 /* should reflect bit field size */
-
-struct __res_state {
- int retrans; /* retransmition time interval */
- int retry; /* number of times to retransmit */
- u_long options; /* option flags - see below. */
- int nscount; /* number of name servers */
- struct sockaddr_in
- nsaddr_list[MAXNS]; /* address of name server */
-#define nsaddr nsaddr_list[0] /* for backward compatibility */
- u_short id; /* current message id */
- char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
- char defdname[256]; /* default domain (deprecated) */
- u_long pfcode; /* RES_PRF_ flags - see below. */
- unsigned ndots:4; /* threshold for initial abs. query */
- unsigned nsort:4; /* number of elements in sort_list[] */
- char unused[3];
- struct {
- struct in_addr addr;
- u_int32_t mask;
- } sort_list[MAXRESOLVSORT];
- char pad[72]; /* on an i386 this means 512b total */
-};
-
-/*
- * Resolver options (keep these in synch with res_debug.c, please)
- */
-#define RES_INIT 0x00000001 /* address initialized */
-#define RES_DEBUG 0x00000002 /* print debug messages */
-#define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/
-#define RES_USEVC 0x00000008 /* use virtual circuit */
-#define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */
-#define RES_IGNTC 0x00000020 /* ignore truncation errors */
-#define RES_RECURSE 0x00000040 /* recursion desired */
-#define RES_DEFNAMES 0x00000080 /* use default domain name */
-#define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */
-#define RES_DNSRCH 0x00000200 /* search up local domain tree */
-#define RES_INSECURE1 0x00000400 /* type 1 security disabled */
-#define RES_INSECURE2 0x00000800 /* type 2 security disabled */
-#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
-#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
-#define RES_NOTLDQUERY 0x00004000 /* Don't query TLD names */
-
-#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
-
-/*
- * Resolver "pfcode" values. Used by dig.
- */
-#define RES_PRF_STATS 0x00000001
-#define RES_PRF_UPDATE 0x00000002
-#define RES_PRF_CLASS 0x00000004
-#define RES_PRF_CMD 0x00000008
-#define RES_PRF_QUES 0x00000010
-#define RES_PRF_ANS 0x00000020
-#define RES_PRF_AUTH 0x00000040
-#define RES_PRF_ADD 0x00000080
-#define RES_PRF_HEAD1 0x00000100
-#define RES_PRF_HEAD2 0x00000200
-#define RES_PRF_TTLID 0x00000400
-#define RES_PRF_HEADX 0x00000800
-#define RES_PRF_QUERY 0x00001000
-#define RES_PRF_REPLY 0x00002000
-#define RES_PRF_INIT 0x00004000
-/* 0x00008000 */
-
-typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
- res_sendhookact;
-
-typedef res_sendhookact (*res_send_qhook)__P((struct sockaddr_in * const *ns,
- const u_char **query,
- int *querylen,
- u_char *ans,
- int anssiz,
- int *resplen));
-
-typedef res_sendhookact (*res_send_rhook)__P((const struct sockaddr_in *ns,
- const u_char *query,
- int querylen,
- u_char *ans,
- int anssiz,
- int *resplen));
-
-struct res_sym {
- int number; /* Identifying number, like T_MX */
- char * name; /* Its symbolic name, like "MX" */
- char * humanname; /* Its fun name, like "mail exchanger" */
-};
-
-extern struct __res_state _res;
-extern const struct res_sym __p_class_syms[];
-extern const struct res_sym __p_type_syms[];
-
-/* Private routines shared between libc/net, named, nslookup and others. */
-#define res_hnok __res_hnok
-#define res_ownok __res_ownok
-#define res_mailok __res_mailok
-#define res_dnok __res_dnok
-#define sym_ston __sym_ston
-#define sym_ntos __sym_ntos
-#define sym_ntop __sym_ntop
-#define b64_ntop __b64_ntop
-#define b64_pton __b64_pton
-#define loc_ntoa __loc_ntoa
-#define loc_aton __loc_aton
-#define fp_resstat __fp_resstat
-#define p_query __p_query
-#define dn_skipname __dn_skipname
-#define fp_resstat __fp_resstat
-#define fp_query __fp_query
-#define fp_nquery __fp_nquery
-#define hostalias __hostalias
-#define putlong __putlong
-#define putshort __putshort
-#define p_class __p_class
-#define p_time __p_time
-#define p_type __p_type
-#define p_query __p_query
-#define p_cdnname __p_cdnname
-#define p_section __p_section
-#define p_cdname __p_cdname
-#define p_fqnname __p_fqnname
-#define p_fqname __p_fqname
-#define p_option __p_option
-#define p_secstodate __p_secstodate
-#define dn_count_labels __dn_count_labels
-#define dn_comp __dn_comp
-#define dn_expand __dn_expand
-#define res_init __res_init
-#define res_randomid __res_randomid
-#define res_query __res_query
-#define res_search __res_search
-#define res_querydomain __res_querydomain
-#define res_mkquery __res_mkquery
-#define res_send __res_send
-#define res_isourserver __res_isourserver
-#define res_nameinquery __res_nameinquery
-#define res_queriesmatch __res_queriesmatch
-#define res_close __res_close
-#define res_mkupdate __res_mkupdate
-#define res_mkupdrec __res_mkupdrec
-#define res_freeupdrec __res_freeupdrec
-
-__BEGIN_DECLS
-int res_hnok __P((const char *));
-int res_ownok __P((const char *));
-int res_mailok __P((const char *));
-int res_dnok __P((const char *));
-int sym_ston __P((const struct res_sym *, const char *, int *));
-const char * sym_ntos __P((const struct res_sym *, int, int *));
-const char * sym_ntop __P((const struct res_sym *, int, int *));
-int b64_ntop __P((u_char const *, size_t, char *, size_t));
-int b64_pton __P((char const *, u_char *, size_t));
-int loc_aton __P((const char *, u_char *));
-const char * loc_ntoa __P((const u_char *, char *));
-int dn_skipname __P((const u_char *, const u_char *));
-void fp_resstat __P((struct __res_state *, FILE *));
-void fp_query __P((const u_char *, FILE *));
-void fp_nquery __P((const u_char *, int, FILE *));
-const char * hostalias __P((const char *));
-void putlong __P((u_int32_t, u_char *));
-void putshort __P((u_int16_t, u_char *));
-const char * p_class __P((int));
-const char * p_time __P((u_int32_t));
-const char * p_type __P((int));
-void p_query __P((const u_char *));
-const u_char * p_cdnname __P((const u_char *, const u_char *, int, FILE *));
-const u_char * p_cdname __P((const u_char *, const u_char *, FILE *));
-const u_char * p_fqnname __P((const u_char *, const u_char *,
- int, char *, int));
-const u_char * p_fqname __P((const u_char *, const u_char *, FILE *));
-const char * p_option __P((u_long));
-char * p_secstodate __P((u_long));
-int dn_count_labels __P((const char *));
-int dn_comp __P((const char *, u_char *, int,
- u_char **, u_char **));
-int dn_expand __P((const u_char *, const u_char *, const u_char *,
- char *, int));
-int res_init __P((void));
-u_int res_randomid __P((void));
-int res_query __P((const char *, int, int, u_char *, int));
-int res_search __P((const char *, int, int, u_char *, int));
-int res_querydomain __P((const char *, const char *, int, int,
- u_char *, int));
-int res_mkquery __P((int, const char *, int, int, const u_char *,
- int, const u_char *, u_char *, int));
-int res_send __P((const u_char *, int, u_char *, int));
-int res_isourserver __P((const struct sockaddr_in *));
-int res_nameinquery __P((const char *, int, int,
- const u_char *, const u_char *));
-int res_queriesmatch __P((const u_char *, const u_char *,
- const u_char *, const u_char *));
-void res_close __P((void));
-const char * p_section __P((int, int));
-/* XXX The following depend on the ns_updrec typedef in arpa/nameser.h */
-#ifdef _ARPA_NAMESER_H_
-int res_update __P((ns_updrec *));
-int res_mkupdate __P((ns_updrec *, u_char *, int));
-ns_updrec * res_mkupdrec __P((int, const char *, u_int, u_int, u_long));
-void res_freeupdrec __P((ns_updrec *));
-#endif
-__END_DECLS
-
-#endif /* !_RESOLV_H_ */
diff --git a/c/src/exec/libnetworking/rtems/issetugid.c b/c/src/exec/libnetworking/rtems/issetugid.c
deleted file mode 100644
index 3baf0ec88b..0000000000
--- a/c/src/exec/libnetworking/rtems/issetugid.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Dummy version of BSD routine
- *
- * $Id$
- */
-
-int
-issetugid (void)
-{
- return 0;
-}
diff --git a/c/src/exec/libnetworking/rtems/rtems_bootp.c b/c/src/exec/libnetworking/rtems/rtems_bootp.c
deleted file mode 100644
index 47e3db758f..0000000000
--- a/c/src/exec/libnetworking/rtems/rtems_bootp.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/error.h>
-#include <sys/types.h>
-#include <rtems/rtems_bsdnet.h>
-
-/*
- * Perform a BOOTP request
- */
-void
-rtems_bsdnet_do_bootp (void)
-{
- rtems_bsdnet_semaphore_obtain ();
- bootpc_init ();
- rtems_bsdnet_semaphore_release ();
-}
diff --git a/c/src/exec/libnetworking/rtems/rtems_bsdnet.h b/c/src/exec/libnetworking/rtems/rtems_bsdnet.h
deleted file mode 100644
index 73ad92fa30..0000000000
--- a/c/src/exec/libnetworking/rtems/rtems_bsdnet.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef _RTEMS_BSDNET_
-#define _RTEMS_BSDNET_
-
-#include <rtems.h>
-
-/*
- * Values that may be obtained by BOOTP
- */
-extern struct in_addr rtems_bsdnet_bootp_server_address;
-extern char *rtems_bsdnet_bootp_boot_file_name;
-
-/*
- * Manipulate routing tables
- */
-struct sockaddr;
-struct rtentry;
-int rtems_bsdnet_rtrequest (
- int req,
- struct sockaddr *dst,
- struct sockaddr *gateway,
- struct sockaddr *netmask,
- int flags,
- struct rtentry **net_nrt);
-
-/*
- * Diagnostics
- */
-void rtems_bsdnet_show_inet_routes (void);
-void rtems_bsdnet_show_mbuf_stats (void);
-void rtems_bsdnet_show_if_stats (void);
-void rtems_bsdnet_show_ip_stats (void);
-void rtems_bsdnet_show_icmp_stats (void);
-void rtems_bsdnet_show_udp_stats (void);
-void rtems_bsdnet_show_tcp_stats (void);
-
-/*
- * Network configuration
- */
-struct rtems_bsdnet_ifconfig {
- /*
- * These two entries must be supplied for each interface.
- */
- char *name;
- int (*attach)(struct rtems_bsdnet_ifconfig *conf);
-
- /*
- * Link to next interface
- */
- struct rtems_bsdnet_ifconfig *next;
-
- /*
- * The following entries may be obtained
- * from BOOTP or explicitily supplied.
- */
- char *ip_address;
- char *ip_netmask;
- void *hardware_address;
-
- /*
- * The driver assigns defaults values to the following
- * entries if they are not explicitly supplied.
- */
- int ignore_broadcast;
- int mtu;
- int rbuf_count;
- int xbuf_count;
-
- /*
- * For external ethernet controller board the following
- * parameters are needed
- */
- unsigned int port; /* port of the board */
- unsigned int irno; /* irq of the board */
- unsigned int bpar; /* memory of the board */
-
-};
-
-struct rtems_bsdnet_config {
- /*
- * This entry points to the head of the ifconfig chain.
- */
- struct rtems_bsdnet_ifconfig *ifconfig;
-
- /*
- * This entry should be rtems_bsdnet_do_bootp if BOOTP
- * is being used to configure the network, and NULL
- * if BOOTP is not being used.
- */
- void (*bootp)(void);
-
- /*
- * The remaining items can be initialized to 0, in
- * which case the default value will be used.
- */
- rtems_task_priority network_task_priority; /* 100 */
- unsigned long mbuf_bytecount; /* 64 kbytes */
- unsigned long mbuf_cluster_bytecount; /* 128 kbytes */
- char *hostname; /* BOOTP */
- char *domainname; /* BOOTP */
- char *gateway; /* BOOTP */
- char *log_host; /* BOOTP */
- char *name_server[3]; /* BOOTP */
-};
-extern struct rtems_bsdnet_config rtems_bsdnet_config;
-int rtems_bsdnet_initialize_network (void);
-void rtems_bsdnet_do_bootp (void);
-
-#endif /* _RTEMS_BSDNET_ */
diff --git a/c/src/exec/libnetworking/rtems/rtems_bsdnet_internal.h b/c/src/exec/libnetworking/rtems/rtems_bsdnet_internal.h
deleted file mode 100644
index 559bafd4c5..0000000000
--- a/c/src/exec/libnetworking/rtems/rtems_bsdnet_internal.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Declarations to fit FreeBSD to RTEMS.
- *
- *******************************************************************
- * WARNING *
- * This file should *never* be included by any application program *
- *******************************************************************
- *
- * $Id$
- */
-
-#ifndef _RTEMS_BSDNET_INTERNAL_H_
-#define _RTEMS_BSDNET_INTERNAL_H_
-
-typedef unsigned int vm_offset_t;
-typedef long long vm_ooffset_t;
-typedef unsigned int vm_pindex_t;
-typedef unsigned int vm_size_t;
-
-#define _BSD_OFF_T_ rtems_signed32
-#define _BSD_PID_T_ rtems_id
-#define _BSD_VA_LIST_ char *
-
-/* make sure we get the network versions of these */
-#include "../machine/types.h"
-#include "../machine/param.h"
-
-#include <sys/time.h>
-struct itimerval {
- struct timeval it_interval;
- struct timeval it_value;
-};
-struct mdproc {
- int md_flags;
- int *md_regs;
-};
-
-#define USHRT_MAX 65535
-
-/*
- * Other RTEMS/BSD glue
- */
-struct socket;
-extern void soconnsleep (struct socket *so);
-extern void soconnwakeup (struct socket *so);
-#define splnet() 0
-#define splimp() 0
-#define splx(_s) do { (_s) = 0; } while(0)
-
-#define ovbcopy(f,t,n) bcopy(f,t,n)
-#define copyout(f,t,n) (memcpy(t,f,n),0)
-#define copyin(f,t,n) (memcpy(t,f,n),0)
-
-#define random() rtems_bsdnet_random()
-#define panic rtems_panic
-#define suser(a,b) 0
-
-void microtime (struct timeval *tv);
-#define hz rtems_bsdnet_ticks_per_second
-#define tick rtems_bsdnet_microseconds_per_tick
-
-#define SHRT_MAX 65535
-
-#define log rtems_bsdnet_log
-
-/*
- * Since we can't have two sys/types.h files, we'll hack around
- * and copy the contents of the BSD sys/types.h to here....
- */
-#include <sys/cdefs.h>
-
-typedef u_int64_t u_quad_t; /* quads */
-typedef int64_t quad_t;
-typedef quad_t * qaddr_t;
-
-typedef void __sighandler_t __P((int));
-typedef __sighandler_t *sig_t; /* type of pointer to a signal function */
-#define NSIG 32
-struct sigaltstack {
- char *ss_sp; /* signal stack base */
- int ss_size; /* signal stack length */
- int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */
-};
-
-#ifdef KERNEL
-typedef int boolean_t;
-typedef struct vm_page *vm_page_t;
-#endif
-
-#ifndef _POSIX_SOURCE
-/*
- * minor() gives a cookie instead of an index since we don't want to
- * change the meanings of bits 0-15 or waste time and space shifting
- * bits 16-31 for devices that don't use them.
- */
-#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
-#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */
-#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */
-#endif
-
-#include <machine/endian.h>
-
-typedef quad_t rlim_t; /* resource limit */
-typedef u_int32_t fixpt_t; /* fixed point number */
-
-/*
- * Forward structure declarations for function prototypes. We include the
- * common structures that cross subsystem boundaries here; others are mostly
- * used in the same place that the structure is defined.
- */
-struct proc;
-struct pgrp;
-struct ucred;
-struct rusage;
-struct file;
-struct buf;
-struct tty;
-struct uio;
-
-/*
- * Redo kernel memory allocation
- */
-#define malloc rtems_bsdnet_malloc
-#define free rtems_bsdnet_free
-
-#define M_NOWAIT 0x0001
-void *rtems_bsdnet_malloc (unsigned long size, int type, int flags);
-void rtems_bsdnet_free (void *addr, int type);
-
-void rtems_bsdnet_semaphore_obtain (void);
-void rtems_bsdnet_semaphore_release (void);
-void rtems_bsdnet_schednetisr (int n);
-
-unsigned long rtems_bsdnet_seconds_since_boot (void);
-unsigned long rtems_bsdnet_random (void);
-
-rtems_id rtems_bsdnet_newproc (
- char *name,
- int stacksize,
- void (*entry)(void *),
- void *arg
-);
-
-rtems_status_code rtems_bsdnet_event_receive (
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-);
-
-/*
- * Network configuration
- */
-extern int rtems_bsdnet_ticks_per_second;
-extern int rtems_bsdnet_microseconds_per_tick;
-extern struct in_addr rtems_bsdnet_log_host_address;
-extern char *rtems_bsdnet_domain_name;
-extern struct in_addr rtems_bsdnet_nameserver[];
-extern int rtems_bsdnet_nameserver_count;
-
-/*
- * Internal IOCTL command
- */
-#define SIO_RTEMS_SHOW_STATS _IO('i', 250)
-
-/*
- * Some extra prototypes
- */
-int sethostname (char *name, int namelen);
-void domaininit (void *);
-void ifinit (void *);
-void ipintr (void);
-void arpintr (void);
-void bootpc_init(void);
-int socket (int, int, int);
-int ioctl (int, unsigned long, ...);
-
-#endif /* _RTEMS_BSDNET_INTERNAL_H_ */
diff --git a/c/src/exec/libnetworking/rtems/rtems_glue.c b/c/src/exec/libnetworking/rtems/rtems_glue.c
deleted file mode 100644
index dd80a13d08..0000000000
--- a/c/src/exec/libnetworking/rtems/rtems_glue.c
+++ /dev/null
@@ -1,905 +0,0 @@
-/*
- * $Id$
- */
-
-#include <string.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <errno.h>
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/error.h>
-#include <rtems/rtems_bsdnet.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/domain.h>
-#include <sys/mbuf.h>
-#include <sys/socketvar.h>
-#include <sys/socket.h>
-#include <sys/sockio.h>
-#include <sys/callout.h>
-#include <sys/proc.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <vm/vm.h>
-#include <arpa/inet.h>
-
-#include <net/netisr.h>
-#include <net/route.h>
-
-/*
- * Events used by networking routines.
- * Everything will break if the application
- * tries to use these events or if the `sleep'
- * events are equal to any of the NETISR * events.
- */
-#define SBWAIT_EVENT RTEMS_EVENT_24
-#define SOSLEEP_EVENT RTEMS_EVENT_25
-#define NETISR_IP_EVENT (1 << NETISR_IP)
-#define NETISR_ARP_EVENT (1 << NETISR_ARP)
-#define NETISR_EVENTS (NETISR_IP_EVENT|NETISR_ARP_EVENT)
-
-
-/*
- * Memory allocation
- */
-static int nmbuf = (64 * 1024) / MSIZE;
- int nmbclusters = (128 * 1024) / MCLBYTES;
-
-/*
- * Socket buffering parameters
- */
-unsigned long sb_efficiency = 8;
-
-/*
- * Network task synchronization
- */
-static rtems_id networkSemaphore;
-static rtems_id networkDaemonTid;
-static rtems_unsigned32 networkDaemonPriority;
-static void networkDaemon (void *task_argument);
-
-/*
- * Network timing
- */
-int rtems_bsdnet_ticks_per_second;
-int rtems_bsdnet_microseconds_per_tick;
-
-/*
- * Callout processing
- */
-static rtems_interval ticksWhenCalloutsLastChecked;
-static struct callout *callfree, calltodo;
-
-/*
- * FreeBSD variables
- */
-int nfs_diskless_valid;
-
-/*
- * BOOTP values
- */
-struct in_addr rtems_bsdnet_log_host_address;
-struct in_addr rtems_bsdnet_bootp_server_address;
-char *rtems_bsdnet_bootp_boot_file_name;
-char *rtems_bsdnet_domain_name;
-struct in_addr rtems_bsdnet_nameserver[sizeof rtems_bsdnet_config.name_server /
- sizeof rtems_bsdnet_config.name_server[0]];
-int rtems_bsdnet_nameserver_count;
-
-extern rtems_libio_handler_t rtems_bsdnet_io_handler;
-
-/*
- * Perform FreeBSD memory allocation.
- * FIXME: This should be modified to keep memory allocation statistics.
- */
-#undef malloc
-#undef free
-extern void *malloc (size_t);
-extern void free (void *);
-void *
-rtems_bsdnet_malloc (unsigned long size, int type, int flags)
-{
- void *p;
-
- for (;;) {
- p = malloc (size);
- if (p)
- return p;
- if (flags & M_NOWAIT)
- return p;
- /*
- * FIXME: This should be redone as:
- * static volatile int rtems_bsdnet_need_memory;
- *
- * rtems_bsdnet_need_memory = 1;
- * message_queue_receive
- *
- * Then in rtems_bsdnet_freee:
- * free (....);
- * if (rtems_bsdnet_need_memory)
- * rtems_bsdnet_need_memory = 0;
- * message_queue_broadcast
- */
- rtems_task_wake_after (rtems_bsdnet_ticks_per_second);
- }
-}
-
-/*
- * Free FreeBSD memory
- * FIXME: This should be modified to keep memory allocation statistics.
- */
-void
-rtems_bsdnet_free (void *addr, int type)
-{
- free (addr);
-}
-
-/*
- * Do the initializations required by the BSD code
- * FIXME: Maybe we should use a different memory allocation scheme that
- * would let us share space between mbufs and mbuf clusters.
- * For now, we'll just take the easy way out!
- */
-static void
-bsd_init ()
-{
- /*
- * Set up mbuf data strutures
- * Cluster allocation *must* come first -- see comment on kmem_malloc().
- */
- m_clalloc (nmbclusters, M_DONTWAIT);
- mclrefcnt = malloc (nmbclusters);
- if (mclrefcnt == NULL)
- rtems_panic ("No memory for mbuf cluster reference counts.");
- memset (mclrefcnt, '\0', nmbclusters);
- m_mballoc (nmbuf, M_DONTWAIT);
- mbstat.m_mtypes[MT_FREE] = nmbuf;
-
-
- /*
- * Set up domains
- */
- {
- extern struct domain routedomain;
- extern struct domain inetdomain;
-
- routedomain.dom_next = domains;
- domains = &routedomain;
- inetdomain.dom_next = domains;
- domains = &inetdomain;
- domaininit (NULL);
- }
-
- /*
- * Set up interfaces
- */
- ifinit (NULL);
-}
-
-/*
- * Initialize and start network operations
- */
-static void
-rtems_bsdnet_initialize (void)
-{
- rtems_status_code sc;
-
- /*
- * Set the priority of all network tasks
- */
- if (rtems_bsdnet_config.network_task_priority == 0)
- networkDaemonPriority = 100;
- else
- networkDaemonPriority = rtems_bsdnet_config.network_task_priority;
-
- /*
- * Set the memory allocation limits
- */
- if (rtems_bsdnet_config.mbuf_bytecount)
- nmbuf = rtems_bsdnet_config.mbuf_bytecount / MSIZE;
- if (rtems_bsdnet_config.mbuf_cluster_bytecount)
- nmbclusters = rtems_bsdnet_config.mbuf_cluster_bytecount / MCLBYTES;
-
- /*
- * Create the task-synchronization semaphore
- */
- sc = rtems_semaphore_create (rtems_build_name('B', 'S', 'D', 'n'),
- 0,
- RTEMS_FIFO |
- RTEMS_BINARY_SEMAPHORE |
- RTEMS_NO_INHERIT_PRIORITY |
- RTEMS_NO_PRIORITY_CEILING |
- RTEMS_LOCAL,
- 0,
- &networkSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't create network seamphore: `%s'\n", rtems_status_text (sc));
-
- /*
- * Compute clock tick conversion factors
- */
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &rtems_bsdnet_ticks_per_second);
- if (rtems_bsdnet_ticks_per_second <= 0)
- rtems_bsdnet_ticks_per_second = 1;
- rtems_bsdnet_microseconds_per_tick = 1000000 / rtems_bsdnet_ticks_per_second;
-
- /*
- * Ensure that `seconds' is greater than 0
- */
- rtems_task_wake_after (rtems_bsdnet_ticks_per_second);
-
- /*
- * Set up BSD-style sockets
- */
- bsd_init ();
-
- /*
- * Start network daemon
- */
- networkDaemonTid = rtems_bsdnet_newproc ("ntwk", 4096, networkDaemon, NULL);
-
- /*
- * Register as an external I/O handler
- */
- rtems_register_libio_handler (RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET,
- &rtems_bsdnet_io_handler);
-
- /*
- * Let other network tasks begin
- */
- rtems_bsdnet_semaphore_release ();
-}
-
-rtems_id TaskWithSemaphore;
-/*
- * Obtain network mutex
- */
-void
-rtems_bsdnet_semaphore_obtain (void)
-{
- rtems_status_code sc;
-
- sc = rtems_semaphore_obtain (networkSemaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-rtems_task_ident (RTEMS_SELF, 0, &TaskWithSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't obtain network semaphore: `%s'\n", rtems_status_text (sc));
-}
-
-/*
- * Release network mutex
- */
-void
-rtems_bsdnet_semaphore_release (void)
-{
- rtems_status_code sc;
-
-TaskWithSemaphore = 0;
- sc = rtems_semaphore_release (networkSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't release network semaphore: `%s'\n", rtems_status_text (sc));
- }
-
-/*
- * Wait for something to happen to a socket buffer
- */
-int
-sbwait(sb)
- struct sockbuf *sb;
-{
- rtems_event_set events;
- rtems_id tid;
- rtems_status_code sc;
-
- /*
- * Soak up any pending events.
- * The sleep/wakeup synchronization in the FreeBSD
- * kernel has no memory.
- */
- rtems_event_receive (SBWAIT_EVENT, RTEMS_EVENT_ANY | RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Set this task as the target of the wakeup operation.
- */
- if (sb->sb_sel.si_pid)
- rtems_panic ("Another task is already sleeping on that socket buffer");
- rtems_task_ident (RTEMS_SELF, 0, &tid);
- sb->sb_sel.si_pid = tid;
-
- /*
- * Mark the socket buffer as waiting.
- */
- sb->sb_flags |= SB_WAIT;
-
- /*
- * Release the network semaphore.
- */
- rtems_bsdnet_semaphore_release ();
-
- /*
- * Wait for the wakeup event.
- */
- sc = rtems_event_receive (SBWAIT_EVENT, RTEMS_EVENT_ANY | RTEMS_WAIT, sb->sb_timeo, &events);
-
- /*
- * Reobtain the network semaphore.
- */
- rtems_bsdnet_semaphore_obtain ();
-
- /*
- * Relinquish ownership of the socket buffer
- */
- sb->sb_flags &= ~SB_WAIT;
- sb->sb_sel.si_pid = 0;
-
- /*
- * Return the status of the wait.
- */
- switch (sc) {
- case RTEMS_SUCCESSFUL: return 0;
- case RTEMS_TIMEOUT: return EWOULDBLOCK;
- default: return ENXIO;
- }
-}
-
-
-/*
- * Wake up the task waiting on a socket buffer.
- */
-void
-sowakeup(so, sb)
- register struct socket *so;
- register struct sockbuf *sb;
-{
- if (sb->sb_flags & SB_WAIT) {
- sb->sb_flags &= ~SB_WAIT;
- rtems_event_send (sb->sb_sel.si_pid, SBWAIT_EVENT);
- }
-}
-
-/*
- * For now, a socket can be used by only one task at a time.
- */
-int
-sb_lock(sb)
- register struct sockbuf *sb;
-{
- rtems_panic ("Socket buffer is already in use.");
- return 0;
-}
-void
-wakeup (void *p)
-{
- rtems_panic ("Wakeup called");
-}
-
-/*
- * Wait for a connection/disconnection event.
- */
-void
-soconnsleep (struct socket *so)
-{
- rtems_event_set events;
- rtems_id tid;
-
- /*
- * Soak up any pending events.
- * The sleep/wakeup synchronization in the FreeBSD
- * kernel has no memory.
- */
- rtems_event_receive (SOSLEEP_EVENT, RTEMS_EVENT_ANY | RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Set this task as the target of the wakeup operation.
- */
- if (so->so_pgid)
- rtems_panic ("Another task is already sleeping on that socket");
- rtems_task_ident (RTEMS_SELF, 0, &tid);
- so->so_pgid = tid;
-
- /*
- * Wait for the wakeup event.
- */
- rtems_bsdnet_event_receive (SOSLEEP_EVENT, RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Relinquish ownership of the socket.
- */
- so->so_pgid = 0;
-}
-
-/*
- * Wake up a task waiting for a connection/disconnection to complete.
- */
-void
-soconnwakeup (struct socket *so)
-{
- if (so->so_pgid)
- rtems_event_send (so->so_pgid, SOSLEEP_EVENT);
-}
-
-/*
- * Send an event to the network daemon.
- * This corresponds to sending a software interrupt in the BSD kernel.
- */
-void
-rtems_bsdnet_schednetisr (int n)
-{
- rtems_event_send (networkDaemonTid, 1 << n);
-}
-
-/*
- * The network daemon
- * This provides a context to run BSD software interrupts
- */
-static void
-networkDaemon (void *task_argument)
-{
- rtems_event_set events;
- rtems_interval now;
- int ticksPassed;
- unsigned32 timeout;
- struct callout *c;
-
- for (;;) {
- c = calltodo.c_next;
- if (c)
- timeout = c->c_time;
- else
- timeout = RTEMS_NO_TIMEOUT;
- rtems_bsdnet_event_receive (NETISR_EVENTS,
- RTEMS_EVENT_ANY | RTEMS_WAIT,
- timeout,
- &events);
- if (events & NETISR_IP_EVENT)
- ipintr ();
- if (events & NETISR_ARP_EVENT)
- arpintr ();
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- ticksPassed = now - ticksWhenCalloutsLastChecked;
- if (ticksPassed != 0) {
- ticksWhenCalloutsLastChecked = now;
-
- c = calltodo.c_next;
- if (c) {
- c->c_time -= ticksPassed;
- while ((c = calltodo.c_next) != NULL && c->c_time <= 0) {
- void *arg;
- void (*func) (void *);
-
- func = c->c_func;
- arg = c->c_arg;
- calltodo.c_next = c->c_next;
- c->c_next = callfree;
- callfree = c;
- (*func)(arg);
- }
- }
- }
- }
-}
-
-/*
- * Structure passed to task-start stub
- */
-struct newtask {
- void (*entry)(void *);
- void *arg;
-};
-
-/*
- * Task-start stub
- */
-static void
-taskEntry (rtems_task_argument arg)
-{
- struct newtask t;
-
- /*
- * Pick up task information and free
- * the memory allocated to pass the
- * information to this task.
- */
- t = *(struct newtask *)arg;
- free ((struct newtask *)arg);
-
- /*
- * Enter the competition for the network semaphore
- */
- rtems_bsdnet_semaphore_obtain ();
-
- /*
- * Enter the task
- */
- (*t.entry)(t.arg);
- rtems_panic ("Network task returned!\n");
-}
-
-/*
- * Start a network task
- */
-rtems_id
-rtems_bsdnet_newproc (char *name, int stacksize, void(*entry)(void *), void *arg)
-{
- struct newtask *t;
- char nm[4];
- rtems_id tid;
- rtems_status_code sc;
-
- strncpy (nm, name, 4);
- sc = rtems_task_create (rtems_build_name(nm[0], nm[1], nm[2], nm[3]),
- networkDaemonPriority,
- stacksize,
- RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
- RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
- &tid);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't create network daemon `%s': `%s'\n", name, rtems_status_text (sc));
-
- /*
- * Set up task arguments
- */
- t = malloc (sizeof *t);
- t->entry = entry;
- t->arg = arg;
-
- /*
- * Start the task
- */
- sc = rtems_task_start (tid, taskEntry, (rtems_task_argument)t);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't start network daemon `%s': `%s'\n", name, rtems_status_text (sc));
-
- /*
- * Let our caller know the i.d. of the new task
- */
- return tid;
-}
-
-rtems_status_code rtems_bsdnet_event_receive (
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out)
-{
- rtems_status_code sc;
-
- rtems_bsdnet_semaphore_release ();
- sc = rtems_event_receive (event_in, option_set, ticks, event_out);
- rtems_bsdnet_semaphore_obtain ();
- return sc;
-}
-
-/*
- * Return time since startup
- */
-void
-microtime (struct timeval *t)
-{
- rtems_interval now;
-
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- t->tv_sec = now / rtems_bsdnet_ticks_per_second;
- t->tv_usec = (now % rtems_bsdnet_ticks_per_second) * rtems_bsdnet_microseconds_per_tick;
-}
-
-unsigned long
-rtems_bsdnet_seconds_since_boot (void)
-{
- rtems_interval now;
-
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- return now / rtems_bsdnet_ticks_per_second;
-}
-
-/*
- * Fake random number generator
- */
-unsigned long
-rtems_bsdnet_random (void)
-{
- rtems_interval now;
-
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- return (now * 99991);
-}
-
-/*
- * Callout list processing
- */
-void
-timeout(void (*ftn)(void *), void *arg, int ticks)
-{
- register struct callout *new, *p, *t;
-
- if (ticks <= 0)
- ticks = 1;
-
- /* Fill in the next free callout structure. */
- if (callfree == NULL) {
- callfree = malloc (sizeof *callfree);
- if (callfree == NULL)
- rtems_panic ("No memory for timeout table entry");
- callfree->c_next = NULL;
- }
-
- new = callfree;
- callfree = new->c_next;
- new->c_arg = arg;
- new->c_func = ftn;
-
- /*
- * The time for each event is stored as a difference from the time
- * of the previous event on the queue. Walk the queue, correcting
- * the ticks argument for queue entries passed. Correct the ticks
- * value for the queue entry immediately after the insertion point
- * as well. Watch out for negative c_time values; these represent
- * overdue events.
- */
- for (p = &calltodo;
- (t = p->c_next) != NULL && ticks > t->c_time; p = t)
- if (t->c_time > 0)
- ticks -= t->c_time;
- new->c_time = ticks;
- if (t != NULL)
- t->c_time -= ticks;
-
- /* Insert the new entry into the queue. */
- p->c_next = new;
- new->c_next = t;
-}
-
-/*
- * Ticks till specified time
- * FIXME: This version worries only about seconds, but that's good
- * enough for the way the network code uses this routine.
- */
-int
-hzto(struct timeval *tv)
-{
- long diff = tv->tv_sec - rtems_bsdnet_seconds_since_boot();
-
- if (diff <= 0)
- return 1;
- return diff * rtems_bsdnet_ticks_per_second;
-}
-
-/*
- * Kernel debugging
- */
-int rtems_bsdnet_log_priority;
-void
-rtems_bsdnet_log (int priority, const char *fmt, ...)
-{
- va_list args;
-
- if (priority & rtems_bsdnet_log_priority) {
- va_start (args, fmt);
- vprintf (fmt, args);
- va_end (args);
- }
-}
-
-/*
- * Hack alert: kmem_malloc `knows' that its
- * first invocation is to get mbuf clusters!
- */
-int mb_map_full;
-vm_map_t mb_map;
-vm_offset_t
-kmem_malloc (vm_map_t *map, vm_size_t size, boolean_t waitflag)
-{
- void *p;
-
- /*
- * Can't get memory if we're already running.
- */
- if (networkDaemonTid) {
- if (waitflag == M_WAITOK)
- rtems_panic (
-"Network mbuf space can not be enlarged after rtems_bsdnet_initialize() has\n"
-"returned. Enlarge the initial mbuf/cluster size in rtems_bsdnet_config.");
- return 0;
- }
-
-#define ROUNDSIZE 2048
- p = malloc (size+ROUNDSIZE);
- p = (void *)((unsigned long)p & ~(ROUNDSIZE-1));
- if ((p == NULL) && (waitflag == M_WAITOK))
- rtems_panic ("Can't get initial network memory!");
- if (mbutl == NULL)
- mbutl = p;
- return (vm_offset_t)p;
-}
-
-/*
- * IP header checksum routine for processors which don't have an inline version
- */
-u_int
-in_cksum_hdr (const void *ip)
-{
- rtems_unsigned32 sum;
- const rtems_unsigned16 *sp;
- int i;
-
- sum = 0;
- sp = (rtems_unsigned16 *)ip;
- for (i = 0 ; i < 10 ; i++)
- sum += *sp++;
- while (sum > 0xFFFF)
- sum = (sum & 0xffff) + (sum >> 16);
- return ~sum & 0xFFFF;
-}
-
-/*
- * Manipulate routing tables
- */
-int rtems_bsdnet_rtrequest (
- int req,
- struct sockaddr *dst,
- struct sockaddr *gateway,
- struct sockaddr *netmask,
- int flags,
- struct rtentry **net_nrt)
-{
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- error = rtrequest (req, dst, gateway, netmask, flags, net_nrt);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- errno = error;
- return -1;
- }
- return 0;
-}
-
-static void
-rtems_bsdnet_setup (void)
-{
- struct rtems_bsdnet_ifconfig *ifp;
- int s;
- struct ifreq ifreq;
- struct sockaddr_in address;
- struct sockaddr_in netmask;
- struct sockaddr_in broadcast;
- struct sockaddr_in gateway;
- int i;
-
- /*
- * Set local parameters
- */
- if (rtems_bsdnet_config.hostname)
- sethostname (rtems_bsdnet_config.hostname,
- strlen (rtems_bsdnet_config.hostname));
- if (rtems_bsdnet_config.domainname)
- rtems_bsdnet_domain_name =
- strdup (rtems_bsdnet_config.domainname);
- if (rtems_bsdnet_config.log_host)
- rtems_bsdnet_log_host_address.s_addr =
- inet_addr (rtems_bsdnet_config.log_host);
- for (i = 0 ; i < sizeof rtems_bsdnet_config.name_server /
- sizeof rtems_bsdnet_config.name_server[0] ; i++) {
- if (!rtems_bsdnet_config.name_server[i])
- break;
- rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count++].s_addr
- = inet_addr (rtems_bsdnet_config.name_server[i]);
- }
-
- /*
- * Configure interfaces
- */
- s = socket (AF_INET, SOCK_DGRAM, 0);
- if (s < 0)
- rtems_panic ("Can't create initial socket: %s", strerror (errno));
- for (ifp = rtems_bsdnet_config.ifconfig ; ifp ; ifp = ifp->next) {
- if (ifp->ip_address == NULL)
- continue;
-
- /*
- * Get the interface flags
- */
- strcpy (ifreq.ifr_name, ifp->name);
- if (ioctl (s, SIOCGIFFLAGS, &ifreq) < 0)
- rtems_panic ("Can't get %s flags: %s", ifp->name, strerror (errno));
-
- /*
- * Bring interface up
- */
- ifreq.ifr_flags |= IFF_UP;
- if (ioctl (s, SIOCSIFFLAGS, &ifreq) < 0)
- rtems_panic ("Can't bring %s up: %s", ifp->name, strerror (errno));
-
- /*
- * Set interface netmask
- */
- memset (&netmask, '\0', sizeof netmask);
- netmask.sin_len = sizeof netmask;
- netmask.sin_family = AF_INET;
- netmask.sin_addr.s_addr = inet_addr (ifp->ip_netmask);
- memcpy (&ifreq.ifr_addr, &netmask, sizeof netmask);
- if (ioctl (s, SIOCSIFNETMASK, &ifreq) < 0)
- rtems_panic ("Can't set %s netmask: %s", ifp->name, strerror (errno));
-
- /*
- * Set interface address
- */
- memset (&address, '\0', sizeof address);
- address.sin_len = sizeof address;
- address.sin_family = AF_INET;
- address.sin_addr.s_addr = inet_addr (ifp->ip_address);
- memcpy (&ifreq.ifr_addr, &address, sizeof address);
- if (ioctl (s, SIOCSIFADDR, &ifreq) < 0)
- rtems_panic ("Can't set %s address: %s", ifp->name, strerror (errno));
-
- /*
- * Set interface broadcast address
- */
- memset (&broadcast, '\0', sizeof broadcast);
- broadcast.sin_len = sizeof broadcast;
- broadcast.sin_family = AF_INET;
- broadcast.sin_addr.s_addr = address.sin_addr.s_addr | ~netmask.sin_addr.s_addr;
- memcpy (&ifreq.ifr_broadaddr, &broadcast, sizeof broadcast);
- if (ioctl (s, SIOCSIFBRDADDR, &ifreq) < 0)
- rtems_panic ("Can't set %s broadcast address: %s", ifp->name, strerror (errno));
- }
-
- /*
- * We're done with the dummy socket
- */
- close (s);
-
- /*
- * Set default route
- */
- if (rtems_bsdnet_config.gateway) {
- address.sin_addr.s_addr = INADDR_ANY;
- netmask.sin_addr.s_addr = INADDR_ANY;
- memset (&gateway, '\0', sizeof gateway);
- gateway.sin_len = sizeof gateway;
- gateway.sin_family = AF_INET;
- gateway.sin_addr.s_addr = inet_addr (rtems_bsdnet_config.gateway);
- if (rtems_bsdnet_rtrequest (
- RTM_ADD,
- (struct sockaddr *)&address,
- (struct sockaddr *)&gateway,
- (struct sockaddr *)&netmask,
- (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL) < 0)
- rtems_panic ("Can't set default route: %s", strerror (errno));
- }
-}
-
-/*
- * Initialize the network
- */
-int
-rtems_bsdnet_initialize_network (void)
-{
- struct rtems_bsdnet_ifconfig *ifp;
-
- /*
- * Start network tasks.
- * Initialize BSD network data structures.
- */
- rtems_bsdnet_initialize ();
-
- /*
- * Attach interfaces
- */
- for (ifp = rtems_bsdnet_config.ifconfig ; ifp ; ifp = ifp->next) {
- rtems_bsdnet_semaphore_obtain ();
- (ifp->attach)(ifp);
- rtems_bsdnet_semaphore_release ();
- }
-
- /*
- * Bring up the network
- */
- rtems_bsdnet_setup ();
- if (rtems_bsdnet_config.bootp)
- (*rtems_bsdnet_config.bootp)();
- return 0;
-}
diff --git a/c/src/exec/libnetworking/rtems/rtems_showicmpstat.c b/c/src/exec/libnetworking/rtems/rtems_showicmpstat.c
deleted file mode 100644
index 1faea2512b..0000000000
--- a/c/src/exec/libnetworking/rtems/rtems_showicmpstat.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/icmp_var.h>
-
-/*
- * Display ICMP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showicmpstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_icmp_stats (void)
-{
- int i;
- char cbuf[20];
-
- printf ("************ ICMP Statistics ************\n");
- showicmpstat ("Calls to icmp_error()", icmpstat.icps_error);
- showicmpstat ("Errors not sent -- old was icmp", icmpstat.icps_oldicmp);
- for (i = 0 ; i <= ICMP_MAXTYPE ; i++) {
- if (icmpstat.icps_outhist[i]) {
- sprintf (cbuf, "Type %d sent", i);
- showicmpstat (cbuf, icmpstat.icps_outhist[i]);
- }
- }
- showicmpstat ("icmp_code out of range", icmpstat.icps_badcode);
- showicmpstat ("packet < ICMP_MINLEN", icmpstat.icps_tooshort);
- showicmpstat ("bad checksum", icmpstat.icps_checksum);
- showicmpstat ("calculated bound mismatch", icmpstat.icps_badlen);
- showicmpstat ("number of responses", icmpstat.icps_reflect);
- showicmpstat ("b/mcast echo requests dropped", icmpstat.icps_bmcastecho);
- showicmpstat ("b/mcast tstamp requests dropped", icmpstat.icps_bmcasttstamp);
- for (i = 0 ; i <= ICMP_MAXTYPE ; i++) {
- if (icmpstat.icps_inhist[i]) {
- sprintf (cbuf, "Type %d received", i);
- showicmpstat (cbuf, icmpstat.icps_inhist[i]);
- }
- }
-
- printf ("\n");
-}
diff --git a/c/src/exec/libnetworking/rtems/rtems_showifstat.c b/c/src/exec/libnetworking/rtems/rtems_showifstat.c
deleted file mode 100644
index 9f9efc5ac2..0000000000
--- a/c/src/exec/libnetworking/rtems/rtems_showifstat.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <netinet/in.h>
-
-/*
- * Display an address
- */
-static int
-showaddress (char *name, struct sockaddr *a)
-{
- struct sockaddr_in *sa;
-
- if (!a || (a->sa_family != AF_INET))
- return 0;
- printf ("%s:", name);
- sa = (struct sockaddr_in *)a;
- printf ("%-16s", inet_ntoa (sa->sin_addr));
- return 1;
-}
-
-/*
- * Display interface statistics
- */
-void
-rtems_bsdnet_show_if_stats (void)
-{
- struct ifnet *ifp;
- struct ifaddr *ifa;
- unsigned int bit, flags;
- int printed;
-
- printf ("************ INTERFACE STATISTICS ************\n");
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- printf ("***** %s%d *****\n", ifp->if_name, ifp->if_unit);
- for (ifa = ifp->if_addrlist ; ifa ; ifa = ifa->ifa_next) {
- printed = showaddress ("Address", ifa->ifa_addr);
- if (ifp->if_flags & IFF_BROADCAST)
- printed |= showaddress ("Broadcast Address", ifa->ifa_broadaddr);
- if (ifp->if_flags & IFF_POINTOPOINT)
- printed |= showaddress ("Destination Address", ifa->ifa_dstaddr);
- printed |= showaddress ("Net mask", ifa->ifa_netmask);
- if (printed)
- printf ("\n");
- }
-
- printf ("Flags:");
- for (bit = 1, flags = ifp->if_flags ; flags ; bit <<= 1) {
- char *cp;
- switch (flags & bit) {
- default: cp = NULL; break;
- case IFF_UP: cp = "Up"; break;
- case IFF_BROADCAST: cp = "Broadcast"; break;
- case IFF_DEBUG: cp = "Debug"; break;
- case IFF_LOOPBACK: cp = "Loopback"; break;
- case IFF_POINTOPOINT: cp = "Point-to-point"; break;
- case IFF_RUNNING: cp = "Running"; break;
- case IFF_NOARP: cp = "No-ARP"; break;
- case IFF_PROMISC: cp = "Promiscuous"; break;
- case IFF_ALLMULTI: cp = "All-multicast"; break;
- case IFF_OACTIVE: cp = "Active"; break;
- case IFF_SIMPLEX: cp = "Simplex"; break;
- case IFF_LINK0: cp = "Link0"; break;
- case IFF_LINK1: cp = "Link1"; break;
- case IFF_LINK2: cp = "Link2"; break;
- case IFF_MULTICAST: cp = "Multicast"; break;
- }
- if (cp) {
- flags &= ~bit;
- printf (" %s", cp);
- }
- }
- printf ("\n");
-
- printf ("Send queue limit:%-4d length:%-4d Dropped:%-8d\n",
- ifp->if_snd.ifq_maxlen,
- ifp->if_snd.ifq_len,
- ifp->if_snd.ifq_drops);
-
- /*
- * FIXME: Could print if_data statistics here,
- * but right now the drivers maintain their
- * own statistics.
- */
-
- /*
- * Grab the network semaphore.
- * In most cases this is not necessary, but it's
- * easier to always call the driver ioctl function
- * while holding the semaphore than to try
- * and explain why some ioctl commands are invoked
- * while holding the semaphore and others are
- * invoked while not holding the semaphore.
- */
- rtems_bsdnet_semaphore_obtain ();
- (*ifp->if_ioctl)(ifp, SIO_RTEMS_SHOW_STATS, NULL);
- rtems_bsdnet_semaphore_release ();
- }
- printf ("\n");
-}
diff --git a/c/src/exec/libnetworking/rtems/rtems_showipstat.c b/c/src/exec/libnetworking/rtems/rtems_showipstat.c
deleted file mode 100644
index 2dd499a8c0..0000000000
--- a/c/src/exec/libnetworking/rtems/rtems_showipstat.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-
-/*
- * Display IP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showipstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_ip_stats (void)
-{
- printf ("************ IP Statistics ************\n");
- showipstat ("total packets received", ipstat.ips_total);
- showipstat ("checksum bad", ipstat.ips_badsum);
- showipstat ("packet too short", ipstat.ips_tooshort);
- showipstat ("not enough data", ipstat.ips_toosmall);
- showipstat ("ip header length < data size", ipstat.ips_badhlen);
- showipstat ("ip length < ip header length", ipstat.ips_badlen);
- showipstat ("fragments received", ipstat.ips_fragments);
- showipstat ("frags dropped (dups, out of space)", ipstat.ips_fragdropped);
- showipstat ("fragments timed out", ipstat.ips_fragtimeout);
- showipstat ("packets forwarded", ipstat.ips_forward);
- showipstat ("packets rcvd for unreachable dest", ipstat.ips_cantforward);
- showipstat ("packets forwarded on same net", ipstat.ips_redirectsent);
- showipstat ("unknown or unsupported protocol", ipstat.ips_noproto);
- showipstat ("datagrams delivered to upper level", ipstat.ips_delivered);
- showipstat ("total ip packets generated here", ipstat.ips_localout);
- showipstat ("lost packets due to nobufs, etc.", ipstat.ips_odropped);
- showipstat ("total packets reassembled ok", ipstat.ips_reassembled);
- showipstat ("datagrams successfully fragmented", ipstat.ips_fragmented);
- showipstat ("output fragments created", ipstat.ips_ofragments);
- showipstat ("don't fragment flag was set, etc.", ipstat.ips_cantfrag);
- showipstat ("error in option processing", ipstat.ips_badoptions);
- showipstat ("packets discarded due to no route", ipstat.ips_noroute);
- showipstat ("ip version != 4", ipstat.ips_badvers);
- showipstat ("total raw ip packets generated", ipstat.ips_rawout);
- showipstat ("ip length > max ip packet size", ipstat.ips_toolong);
- printf ("\n");
-}
diff --git a/c/src/exec/libnetworking/rtems/rtems_showmbuf.c b/c/src/exec/libnetworking/rtems/rtems_showmbuf.c
deleted file mode 100644
index 39523bd00a..0000000000
--- a/c/src/exec/libnetworking/rtems/rtems_showmbuf.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-
-/*
- * Display MBUF statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-void
-rtems_bsdnet_show_mbuf_stats (void)
-{
- int i;
- int printed = 0;
- char *cp;
-
- printf ("************ MBUF STATISTICS ************\n");
- printf ("mbufs:%4lu clusters:%4lu free:%4lu\n",
- mbstat.m_mbufs, mbstat.m_clusters, mbstat.m_clfree);
- printf ("drops:%4lu waits:%4lu drains:%4lu\n",
- mbstat.m_drops, mbstat.m_wait, mbstat.m_drain);
- for (i = 0 ; i < 20 ; i++) {
- switch (i) {
- case MT_FREE: cp = "free"; break;
- case MT_DATA: cp = "data"; break;
- case MT_HEADER: cp = "header"; break;
- case MT_SOCKET: cp = "socket"; break;
- case MT_PCB: cp = "pcb"; break;
- case MT_RTABLE: cp = "rtable"; break;
- case MT_HTABLE: cp = "htable"; break;
- case MT_ATABLE: cp = "atable"; break;
- case MT_SONAME: cp = "soname"; break;
- case MT_SOOPTS: cp = "soopts"; break;
- case MT_FTABLE: cp = "ftable"; break;
- case MT_RIGHTS: cp = "rights"; break;
- case MT_IFADDR: cp = "ifaddr"; break;
- case MT_CONTROL: cp = "control"; break;
- case MT_OOBDATA: cp = "oobdata"; break;
- default: cp = NULL; break;
- }
- if ((cp != NULL) || (mbstat.m_mtypes[i] != 0)) {
- char cbuf[16];
- if (cp == NULL) {
- sprintf (cbuf, "Type %d", i);
- cp = cbuf;
- }
- printf ("%10s:%-8u", cp, mbstat.m_mtypes[i]);
- if (++printed == 4) {
- printf ("\n");
- printed = 0;
- }
- }
- }
- if (printed)
- printf ("\n");
- printf ("\n");
-}
diff --git a/c/src/exec/libnetworking/rtems/rtems_showroute.c b/c/src/exec/libnetworking/rtems/rtems_showroute.c
deleted file mode 100644
index b8196de8d3..0000000000
--- a/c/src/exec/libnetworking/rtems/rtems_showroute.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * $Id$
- */
-
-#include <stdlib.h>
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-
-#include <arpa/inet.h>
-
-/*
- * We'll use the application versions of malloc and free.
- */
-#undef malloc
-#undef free
-
-/*
- * Information per route
- */
-struct rinfo {
- struct sockaddr dst;
- union {
- struct sockaddr sa;
- struct sockaddr_in sin;
- struct sockaddr_dl sdl;
- } un;
- unsigned long pksent;
- unsigned long expire;
- int flags;
- char ifname[16];
- short ifunit;
- short refcnt;
-};
-
-/*
- * Information per display
- */
-struct dinfo {
- int capacity;
- int count;
- struct rinfo *routes;
-};
-
-/*
- * Copy address
- */
-static void
-copyAddress (void *to, void *from, int tolen)
-{
- int ncopy;
- struct sockaddr dummy;
-
- if (from == NULL) {
- /*
- * Create a fake address of unspecified type
- */
- from = &dummy;
- dummy.sa_len = 4;
- dummy.sa_family = AF_UNSPEC;
- }
- ncopy = ((struct sockaddr *)from)->sa_len;
- if (ncopy > tolen)
- ncopy = tolen;
- memcpy (to, from, ncopy);
-}
-
-/*
- * Package everything up before printing it.
- * We don't want to block all network operations till
- * the printing completes!
- */
-static int
-show_inet_route (rn, vw)
- struct radix_node *rn;
- void *vw;
-{
- struct rtentry *rt = (struct rtentry *)rn;
- struct ifnet *ifp;
- struct dinfo *dp = (struct dinfo *)vw;
- struct rinfo *r;
-
- /*
- * Get a pointer to a new route info structure
- */
- if (dp->count >= dp->capacity) {
- r = realloc (dp->routes, (sizeof *r) * (dp->capacity + 20));
- if (r == 0)
- return ENOMEM;
- dp->capacity += 20;
- dp->routes = r;
- }
- r = dp->routes + dp->count++;
-
- /*
- * Fill in the route info structure
- */
- copyAddress (&r->dst, rt_key(rt), sizeof r->dst);
- if (rt->rt_flags & (RTF_GATEWAY | RTF_HOST)) {
- copyAddress (&r->un, rt->rt_gateway, sizeof r->un);
- }
- else {
- /*
- * Create a fake address to hold the mask
- */
- struct sockaddr_in dummy;
-
- dummy.sin_family = AF_INET;
- dummy.sin_len = sizeof dummy;
- dummy.sin_addr = ((struct sockaddr_in *)rt_mask(rt))->sin_addr;
- copyAddress (&r->un, &dummy, sizeof r->un);
- }
- r->flags = rt->rt_flags;
- r->refcnt = rt->rt_refcnt;
- r->pksent = rt->rt_rmx.rmx_pksent;
- r->expire = rt->rt_rmx.rmx_expire;
- ifp = rt->rt_ifp;
- strncpy (r->ifname, ifp->if_name, sizeof r->ifname);
- r->ifunit = ifp->if_unit;
- return 0;
-}
-
-/*
- * Convert link address to ASCII
- */
-static char *
-link_ascii (struct sockaddr_dl *sdl, char *buf, int bufsize)
-{
- char *cp;
- int i;
- int first = 1;
- int nleft = sdl->sdl_alen;
- unsigned char *ap = LLADDR (sdl);
- static const char hextab[16] = "0123456789ABCDEF";
-
- cp = buf;
- while (nleft && (bufsize > 4)) {
- if (first) {
- first = 0;
- }
- else {
- *cp++ = ':';
- bufsize--;
- }
- i = *ap++;
- *cp++ = hextab[(i >> 4) & 0xf];
- *cp++ = hextab[i & 0xf];
- nleft--;
- bufsize -= 2;
- }
- *cp = '\0';
- return buf;
-}
-
-void
-rtems_bsdnet_show_inet_routes (void)
-{
- struct radix_node_head *rnh;
- struct dinfo d;
- struct rinfo *r;
- int i, error;
-
- /*
- * For now we'll handle only AF_INET
- */
- rnh = rt_tables[AF_INET];
- if (!rnh)
- return;
- d.count = d.capacity = 0;
- d.routes = NULL;
- rtems_bsdnet_semaphore_obtain ();
- error = rnh->rnh_walktree(rnh, show_inet_route, &d);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- printf ("Can't get route info: %s\n", strerror (error));
- return;
- }
- if (d.count == 0) {
- printf ("No routes!\n");
- return;
- }
- printf ("Destination Gateway/Mask/Hw Flags Refs Use Expire Interface\n");
- for (i = 0, r = d.routes ; i < d.count ; i++, r++) {
- char buf[30];
- char *cp, *fc, flagbuf[10];
- const char *addr;
- unsigned long flagbit;
- struct sockaddr_in *sin;
-
- sin = (struct sockaddr_in *)&r->dst;
- if (sin->sin_addr.s_addr == INADDR_ANY)
- addr = "default";
- else
- addr = inet_ntop (AF_INET, &sin->sin_addr, buf, sizeof buf);
- printf ("%-16s", addr);
- switch (r->un.sa.sa_family) {
- case AF_INET:
- addr = inet_ntop (AF_INET, &r->un.sin.sin_addr, buf, sizeof buf);
- break;
-
- case AF_LINK:
- addr = link_ascii (&r->un.sdl, buf, sizeof buf);
- break;
-
- default:
- addr = "";
- break;
- }
- printf ("%-19s", addr);
- fc = "UGHRDM XLS";
- for (flagbit = 0x1, cp = flagbuf ; *fc ; flagbit <<= 1, fc++) {
- if ((r->flags & flagbit) && (*fc != ' '))
- *cp++ = *fc;
- }
- *cp = '\0';
- printf ("%-10s%3d%9ld%7ld %.*s%d\n", flagbuf,
- r->refcnt, r->pksent,
- r->expire,
- (int)sizeof r->ifname, r->ifname,
- r->ifunit);
- }
- free (d.routes);
-}
diff --git a/c/src/exec/libnetworking/rtems/rtems_showtcpstat.c b/c/src/exec/libnetworking/rtems/rtems_showtcpstat.c
deleted file mode 100644
index b9a0366819..0000000000
--- a/c/src/exec/libnetworking/rtems/rtems_showtcpstat.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_var.h>
-
-/*
- * Display TCP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showtcpstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_tcp_stats (void)
-{
- printf ("************ TCP Statistics ************\n");
- showtcpstat ("connections initiated", tcpstat.tcps_connattempt);
- showtcpstat ("connections accepted", tcpstat.tcps_accepts);
- showtcpstat ("connections established", tcpstat.tcps_connects);
- showtcpstat ("connections dropped", tcpstat.tcps_drops);
- showtcpstat ("embryonic connections dropped", tcpstat.tcps_conndrops);
- showtcpstat ("conn. closed (includes drops)", tcpstat.tcps_closed);
- showtcpstat ("segs where we tried to get rtt", tcpstat.tcps_segstimed);
- showtcpstat ("times we succeeded", tcpstat.tcps_rttupdated);
- showtcpstat ("delayed acks sent", tcpstat.tcps_delack);
- showtcpstat ("conn. dropped in rxmt timeout", tcpstat.tcps_timeoutdrop);
- showtcpstat ("retransmit timeouts", tcpstat.tcps_rexmttimeo);
- showtcpstat ("persist timeouts", tcpstat.tcps_persisttimeo);
- showtcpstat ("keepalive timeouts", tcpstat.tcps_keeptimeo);
- showtcpstat ("keepalive probes sent", tcpstat.tcps_keepprobe);
- showtcpstat ("connections dropped in keepalive", tcpstat.tcps_keepdrops);
-
- showtcpstat ("total packets sent", tcpstat.tcps_sndtotal);
- showtcpstat ("data packets sent", tcpstat.tcps_sndpack);
- showtcpstat ("data bytes sent", tcpstat.tcps_sndbyte);
- showtcpstat ("data packets retransmitted", tcpstat.tcps_sndrexmitpack);
- showtcpstat ("data bytes retransmitted", tcpstat.tcps_sndrexmitbyte);
- showtcpstat ("ack-only packets sent", tcpstat.tcps_sndacks);
- showtcpstat ("window probes sent", tcpstat.tcps_sndprobe);
- showtcpstat ("packets sent with URG only", tcpstat.tcps_sndurg);
- showtcpstat ("window update-only packets sent", tcpstat.tcps_sndwinup);
- showtcpstat ("control (SYN|FIN|RST) packets sent", tcpstat.tcps_sndctrl);
-
- showtcpstat ("total packets received", tcpstat.tcps_rcvtotal);
- showtcpstat ("packets received in sequence", tcpstat.tcps_rcvpack);
- showtcpstat ("bytes received in sequence", tcpstat.tcps_rcvbyte);
- showtcpstat ("packets received with ccksum errs", tcpstat.tcps_rcvbadsum);
- showtcpstat ("packets received with bad offset", tcpstat.tcps_rcvbadoff);
- showtcpstat ("packets received too short", tcpstat.tcps_rcvshort);
- showtcpstat ("duplicate-only packets received", tcpstat.tcps_rcvduppack);
- showtcpstat ("duplicate-only bytes received", tcpstat.tcps_rcvdupbyte);
- showtcpstat ("packets with some duplicate data", tcpstat.tcps_rcvpartduppack);
- showtcpstat ("dup. bytes in part-dup. packets", tcpstat.tcps_rcvpartdupbyte);
- showtcpstat ("out-of-order packets received", tcpstat.tcps_rcvoopack);
- showtcpstat ("out-of-order bytes received", tcpstat.tcps_rcvoobyte);
- showtcpstat ("packets with data after window", tcpstat.tcps_rcvpackafterwin);
- showtcpstat ("bytes rcvd after window", tcpstat.tcps_rcvbyteafterwin);
- showtcpstat ("packets rcvd after \"close\"", tcpstat.tcps_rcvafterclose);
- showtcpstat ("rcvd window probe packets", tcpstat.tcps_rcvwinprobe);
- showtcpstat ("rcvd duplicate acks", tcpstat.tcps_rcvdupack);
- showtcpstat ("rcvd acks for unsent data", tcpstat.tcps_rcvacktoomuch);
- showtcpstat ("rcvd ack packets", tcpstat.tcps_rcvackpack);
- showtcpstat ("bytes acked by rcvd acks", tcpstat.tcps_rcvackbyte);
- showtcpstat ("rcvd window update packets", tcpstat.tcps_rcvwinupd);
- showtcpstat ("segments dropped due to PAWS", tcpstat.tcps_pawsdrop);
- showtcpstat ("times hdr predict ok for acks", tcpstat.tcps_predack);
- showtcpstat ("times hdr predict ok for data pkts", tcpstat.tcps_preddat);
- showtcpstat ("pcb cache misses", tcpstat.tcps_pcbcachemiss);
- showtcpstat ("times cached RTT in route updated", tcpstat.tcps_cachedrtt);
- showtcpstat ("times cached rttvar updated", tcpstat.tcps_cachedrttvar);
- showtcpstat ("times cached ssthresh updated", tcpstat.tcps_cachedssthresh);
- showtcpstat ("times RTT initialized from route", tcpstat.tcps_usedrtt);
- showtcpstat ("times RTTVAR initialized from rt", tcpstat.tcps_usedrttvar);
- showtcpstat ("times ssthresh initialized from rt", tcpstat.tcps_usedssthresh);
- showtcpstat ("timeout in persist state", tcpstat.tcps_persistdrop);
- showtcpstat ("bogus SYN, e.g. premature ACK", tcpstat.tcps_badsyn);
- showtcpstat ("resends due to MTU discovery", tcpstat.tcps_mturesent);
- showtcpstat ("listen queue overflows", tcpstat.tcps_listendrop);
- printf ("\n");
-}
diff --git a/c/src/exec/libnetworking/rtems/rtems_showudpstat.c b/c/src/exec/libnetworking/rtems/rtems_showudpstat.c
deleted file mode 100644
index 1fc2d15a0b..0000000000
--- a/c/src/exec/libnetworking/rtems/rtems_showudpstat.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-
-/*
- * Display UDP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showudpstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_udp_stats (void)
-{
- printf ("************ UDP Statistics ************\n");
- showudpstat ("total input packets", udpstat.udps_ipackets);
- showudpstat ("packet shorter than header", udpstat.udps_hdrops);
- showudpstat ("checksum error", udpstat.udps_badsum);
- showudpstat ("data length larger than packet", udpstat.udps_badlen);
- showudpstat ("no socket on port", udpstat.udps_noport);
- showudpstat ("of above, arrived as broadcast", udpstat.udps_noportbcast);
- showudpstat ("not delivered, input socket full", udpstat.udps_fullsock);
- showudpstat ("input packets missing pcb cache", udpstat.udpps_pcbcachemiss);
- showudpstat ("input packets not for hashed pcb", udpstat.udpps_pcbhashmiss);
- showudpstat ("total output packets", udpstat.udps_opackets);
- printf ("\n");
-}
diff --git a/c/src/exec/libnetworking/rtems/rtems_syscall.c b/c/src/exec/libnetworking/rtems/rtems_syscall.c
deleted file mode 100644
index 782a2f907b..0000000000
--- a/c/src/exec/libnetworking/rtems/rtems_syscall.c
+++ /dev/null
@@ -1,761 +0,0 @@
-/*
- * $Id$
- */
-
-#include <string.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/error.h>
-#include <rtems/rtems_bsdnet.h>
-
-#include <sys/errno.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/proc.h>
-#include <sys/filio.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-/*
- *********************************************************************
- * Map RTEMS file descriptor to BSD socket *
- *********************************************************************
- */
-struct fdsock {
- int indexFreeNext;
- struct socket *sock;
-};
-static struct fdsock *fdsock;
-static int fdsockCount;
-static int indexFreeHead = -1;
-
-/*
- * Convert an RTEMS file descriptor to a BSD socket pointer.
- */
-static struct socket *
-fdToSocket (int fd)
-{
- int i;
- struct socket *s;
-
- if ((fd < 0)
- || (rtems_file_descriptor_type(fd) != RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET)
- || ((i = rtems_file_descriptor_base(fd)) >= fdsockCount)
- || ((s = fdsock[i].sock) == NULL)) {
- errno = EBADF;
- return NULL;
- }
- return s;
-}
-
-/*
- * Enlarge the size of the file-descritor/socket pointer map.
- */
-static int
-enlargeFdMap (void)
-{
- struct fdsock *nfdsock;
- int i;
-
- nfdsock = realloc (fdsock, sizeof *fdsock * (fdsockCount + 20));
- if (nfdsock == NULL) {
- errno = ENFILE;
- return 0;
- }
- fdsock = nfdsock;
- for (i = fdsockCount, fdsockCount += 20 ; i < fdsockCount ; i++) {
- fdsock[i].sock = NULL;
- fdsock[i].indexFreeNext = indexFreeHead;
- indexFreeHead = i;
- }
- return 1;
-}
-
-/*
- * Create a file descriptor for a new socket
- */
-static int
-makeFd (struct socket *s)
-{
- int i;
-
- if ((indexFreeHead < 0) && !enlargeFdMap ())
- return -1;
- i = indexFreeHead;
- indexFreeHead = fdsock[i].indexFreeNext;
- fdsock[i].sock = s;
- return rtems_make_file_descriptor(i,RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET);
-}
-
-/*
- * Package system call argument into mbuf.
- */
-static int
-sockargstombuf (struct mbuf **mp, const void *buf, int buflen, int type)
-{
- struct mbuf *m;
-
- if ((u_int)buflen > MLEN)
- return (EINVAL);
- m = m_get(M_WAIT, type);
- if (m == NULL)
- return (ENOBUFS);
- m->m_len = buflen;
- memcpy (mtod(m, caddr_t), buf, buflen);
- *mp = m;
- if (type == MT_SONAME) {
- struct sockaddr *sa;
- sa = mtod(m, struct sockaddr *);
- sa->sa_len = buflen;
- }
- return 0;
-}
-
-/*
- *********************************************************************
- * BSD-style entry points *
- *********************************************************************
- */
-int
-socket (int domain, int type, int protocol)
-{
- int fd = -1;
- int error;
- struct socket *so;
-
- rtems_bsdnet_semaphore_obtain ();
- error = socreate(domain, &so, type, protocol, NULL);
- if (error == 0) {
- fd = makeFd (so);
- if (fd < 0)
- soclose (so);
- }
- else {
- errno = error;
- fd = -1;
- }
- rtems_bsdnet_semaphore_release ();
- return fd;
-}
-
-int
-bind (int s, struct sockaddr *name, int namelen)
-{
- int error;
- int ret = -1;
- struct socket *so;
- struct mbuf *nam;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) != NULL) {
- error = sockargstombuf (&nam, name, namelen, MT_SONAME);
- if (error == 0) {
- error = sobind (so, nam);
- if (error == 0)
- ret = 0;
- else
- errno = error;
- m_freem (nam);
- }
- else {
- errno = error;
- }
- }
- rtems_bsdnet_semaphore_release ();
- return ret;
-}
-
-int
-connect (int s, struct sockaddr *name, int namelen)
-{
- int error;
- int ret = -1;
- struct socket *so;
- struct mbuf *nam;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((so->so_state & SS_NBIO) && (so->so_state & SS_ISCONNECTING)) {
- errno = EALREADY;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- error = sockargstombuf (&nam, name, namelen, MT_SONAME);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- error = soconnect (so, nam);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((so->so_state & SS_NBIO) && (so->so_state & SS_ISCONNECTING)) {
- m_freem(nam);
- errno = EINPROGRESS;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) {
- soconnsleep (so);
- }
- if (error == 0) {
- error = so->so_error;
- so->so_error = 0;
- }
- so->so_state &= ~SS_ISCONNECTING;
- m_freem (nam);
- if (error == 0)
- ret = 0;
- rtems_bsdnet_semaphore_release ();
- return ret;
-}
-
-int
-listen (int s, int backlog)
-{
- int error;
- int ret = -1;
- struct socket *so;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) != NULL) {
- error = solisten (so, backlog);
- if (error == 0)
- ret = 0;
- else
- errno = error;
- }
- rtems_bsdnet_semaphore_release ();
- return ret;
-}
-
-int
-accept (int s, struct sockaddr *name, int *namelen)
-{
- int fd;
- struct socket *head, *so;
- struct mbuf *nam;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((head = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((head->so_options & SO_ACCEPTCONN) == 0) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((head->so_state & SS_NBIO) && head->so_comp.tqh_first == NULL) {
- errno = EWOULDBLOCK;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- while (head->so_comp.tqh_first == NULL && head->so_error == 0) {
- if (head->so_state & SS_CANTRCVMORE) {
- head->so_error = ECONNABORTED;
- break;
- }
- soconnsleep (head);
- }
- if (head->so_error) {
- errno = head->so_error;
- head->so_error = 0;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
-
- so = head->so_comp.tqh_first;
- TAILQ_REMOVE(&head->so_comp, so, so_list);
- head->so_qlen--;
-
- fd = makeFd (so);
- if (fd < 0) {
- TAILQ_INSERT_HEAD(&head->so_comp, so, so_list);
- head->so_qlen++;
- soconnwakeup (head);
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- so->so_state &= ~SS_COMP;
- so->so_head = NULL;
-
- nam = m_get(M_WAIT, MT_SONAME);
- (void) soaccept(so, nam);
- if (name) {
- /* check length before it is destroyed */
- if (*namelen > nam->m_len)
- *namelen = nam->m_len;
- memcpy (name, mtod(nam, caddr_t), *namelen);
- }
- m_freem(nam);
- rtems_bsdnet_semaphore_release ();
- return (fd);
-
-}
-
-/*
- * All `transmit' operations end up calling this routine.
- */
-ssize_t
-sendmsg (int s, const struct msghdr *mp, int flags)
-{
- int ret = -1;
- int error;
- struct uio auio;
- struct iovec *iov;
- struct socket *so;
- struct mbuf *to, *control;
- int i;
- int len;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- auio.uio_iov = mp->msg_iov;
- auio.uio_iovcnt = mp->msg_iovlen;
- auio.uio_segflg = UIO_USERSPACE;
- auio.uio_rw = UIO_WRITE;
- auio.uio_offset = 0;
- auio.uio_resid = 0;
- iov = mp->msg_iov;
- for (i = 0; i < mp->msg_iovlen; i++, iov++) {
- if ((auio.uio_resid += iov->iov_len) < 0) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- if (mp->msg_name) {
- error = sockargstombuf (&to, mp->msg_name, mp->msg_namelen, MT_SONAME);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- else {
- to = NULL;
- }
- if (mp->msg_control) {
- if (mp->msg_controllen < sizeof (struct cmsghdr)) {
- errno = EINVAL;
- if (to)
- m_freem(to);
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- sockargstombuf (&control, mp->msg_control, mp->msg_controllen, MT_CONTROL);
- }
- else {
- control = NULL;
- }
- len = auio.uio_resid;
- error = sosend (so, to, &auio, (struct mbuf *)0, control, flags);
- if (error) {
- if (auio.uio_resid != len && (error == EINTR || error == EWOULDBLOCK))
- error = 0;
- }
- if (error)
- errno = error;
- else
- ret = len - auio.uio_resid;
- if (to)
- m_freem(to);
- rtems_bsdnet_semaphore_release ();
- return (ret);
-}
-
-/*
- * Send a message to a host
- */
-ssize_t
-sendto (int s, const void *buf, size_t buflen, int flags, const struct sockaddr *to, int tolen)
-{
- struct msghdr msg;
- struct iovec iov;
-
- iov.iov_base = (void *)buf;
- iov.iov_len = buflen;
- msg.msg_name = (caddr_t)to;
- msg.msg_namelen = tolen;
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
- msg.msg_control = NULL;
- msg.msg_controllen = 0;
- return sendmsg (s, &msg, flags);
-}
-
-/*
- * Send a message to a connected host
- */
-ssize_t
-send (int s, const void *buf, size_t buflen, int flags)
-{
- return sendto (s, buf, buflen, flags, NULL, 0);
-}
-
-/*
- * All `receive' operations end up calling this routine.
- */
-ssize_t
-recvmsg (int s, struct msghdr *mp, int flags)
-{
- int ret = -1;
- int error;
- struct uio auio;
- struct iovec *iov;
- struct socket *so;
- struct mbuf *from = NULL, *control = NULL;
- int i;
- int len;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- auio.uio_iov = mp->msg_iov;
- auio.uio_iovcnt = mp->msg_iovlen;
- auio.uio_segflg = UIO_USERSPACE;
- auio.uio_rw = UIO_READ;
- auio.uio_offset = 0;
- auio.uio_resid = 0;
- iov = mp->msg_iov;
- for (i = 0; i < mp->msg_iovlen; i++, iov++) {
- if ((auio.uio_resid += iov->iov_len) < 0) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- len = auio.uio_resid;
- mp->msg_flags = flags;
- error = soreceive (so, &from, &auio, (struct mbuf **)NULL,
- mp->msg_control ? &control : (struct mbuf **)NULL,
- &mp->msg_flags);
- if (error) {
- if (auio.uio_resid != len && (error == EINTR || error == EWOULDBLOCK))
- error = 0;
- }
- if (error) {
- errno = error;
- }
- else {
- ret = len - auio.uio_resid;
- if (mp->msg_name) {
- len = mp->msg_namelen;
- if ((len <= 0) || (from == NULL)) {
- len = 0;
- }
- else {
- if (len > from->m_len)
- len = from->m_len;
- memcpy (mp->msg_name, mtod(from, caddr_t), len);
- }
- mp->msg_namelen = len;
- }
- if (mp->msg_control) {
- struct mbuf *m;
- caddr_t ctlbuf;
-
- len = mp->msg_controllen;
- m = control;
- mp->msg_controllen = 0;
- ctlbuf = (caddr_t) mp->msg_control;
-
- while (m && (len > 0)) {
- unsigned int tocopy;
-
- if (len >= m->m_len)
- tocopy = m->m_len;
- else {
- mp->msg_flags |= MSG_CTRUNC;
- tocopy = len;
- }
- memcpy(ctlbuf, mtod(m, caddr_t), tocopy);
- ctlbuf += tocopy;
- len -= tocopy;
- m = m->m_next;
- }
- mp->msg_controllen = ctlbuf - mp->msg_control;
- }
- }
- if (from)
- m_freem (from);
- if (control)
- m_freem (control);
- rtems_bsdnet_semaphore_release ();
- return (ret);
-}
-
-/*
- * Receive a message from a host
- */
-ssize_t
-recvfrom (int s, void *buf, size_t buflen, int flags, const struct sockaddr *from, int *fromlen)
-{
- struct msghdr msg;
- struct iovec iov;
- int ret;
-
- iov.iov_base = buf;
- iov.iov_len = buflen;
- msg.msg_name = (caddr_t)from;
- msg.msg_namelen = *fromlen;
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
- msg.msg_control = NULL;
- msg.msg_controllen = 0;
- ret = recvmsg (s, &msg, flags);
- if ((from != NULL) && (fromlen != NULL) && (ret >= 0))
- *fromlen = msg.msg_namelen;
- return ret;
-}
-
-/*
- * Receive a message from a connected host
- */
-ssize_t
-recv (int s, void *buf, size_t buflen, int flags)
-{
- return recvfrom (s, buf, buflen, flags, NULL, NULL);
-}
-
-int
-setsockopt (int s, int level, int name, const void *val, int len)
-{
- struct socket *so;
- struct mbuf *m = NULL;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (len > MLEN) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (val) {
- error = sockargstombuf (&m, val, len, MT_SOOPTS);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- error = sosetopt(so, level, name, m);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- rtems_bsdnet_semaphore_release ();
- return 0;
-}
-
-int
-getsockopt (int s, int level, int name, void *aval, int *avalsize)
-{
- struct socket *so;
- struct mbuf *m = NULL, *m0;
- char *val = aval;
- int i, op, valsize;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (val)
- valsize = *avalsize;
- else
- valsize = 0;
- if (((error = sogetopt(so, level, name, &m)) == 0) && val && valsize && m) {
- op = 0;
- while (m && op < valsize) {
- i = valsize - op;
- if (i > m->m_len)
- i = m->m_len;
- memcpy (val, mtod(m, caddr_t), i);
- op += i;
- val += i;
- m0 = m;
- MFREE (m0, m);
- }
- *avalsize = op;
- }
- if (m != NULL)
- (void) m_free(m);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- rtems_bsdnet_semaphore_release ();
- return 0;
-}
-
-static int
-getpeersockname (int s, struct sockaddr *name, int *namelen, int pflag)
-{
- struct socket *so;
- struct mbuf *m;
- int len = *namelen;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- m = m_getclr(M_WAIT, MT_SONAME);
- if (m == NULL) {
- errno = ENOBUFS;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (pflag)
- error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, m);
- else
- error = (*so->so_proto->pr_usrreqs->pru_sockaddr)(so, m);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (len > m->m_len) {
- len = m->m_len;
- *namelen = len;
- }
- memcpy (name, mtod(m, caddr_t), len);
- m_freem (m);
- rtems_bsdnet_semaphore_release ();
- return 0;
-}
-
-int
-getpeername (int s, struct sockaddr *name, int *namelen)
-{
- return getpeersockname (s, name, namelen, 1);
-}
-int
-getsockname (int s, struct sockaddr *name, int *namelen)
-{
- return getpeersockname (s, name, namelen, 0);
-}
-
-/*
- ************************************************************************
- * RTEMS EXTERNAL I/O HANDLER ROUTINES *
- ************************************************************************
- */
-static int
-rtems_bsdnet_close (int fd)
-{
- struct socket *so;
- int error;
- int i;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (fd)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- i = rtems_file_descriptor_base(fd);
- fdsock[i].indexFreeNext = indexFreeHead;;
- indexFreeHead = i;
- error = soclose (so);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- errno = error;
- return -1;
- }
- return 0;
-}
-
-static int
-rtems_bsdnet_read (int fd, void *buffer, unsigned32 count)
-{
- return recv (fd, buffer, count, 0);
-}
-
-static int
-rtems_bsdnet_write (int fd, const void *buffer, unsigned32 count)
-{
- return send (fd, buffer, count, 0);
-}
-
-static int
-so_ioctl (struct socket *so, unsigned32 command, void *buffer)
-{
- switch (command) {
- case FIONBIO:
- if (*(int *)buffer)
- so->so_state |= SS_NBIO;
- else
- so->so_state &= ~SS_NBIO;
- return 0;
-
- case FIONREAD:
- *(int *)buffer = so->so_rcv.sb_cc;
- return 0;
- }
-
- if (IOCGROUP(command) == 'i')
- return ifioctl (so, command, buffer, NULL);
- if (IOCGROUP(command) == 'r')
- return rtioctl (command, buffer, NULL);
- return (*so->so_proto->pr_usrreqs->pru_control)(so, command, buffer, 0);
-}
-
-static int
-rtems_bsdnet_ioctl (int fd, unsigned32 command, void *buffer)
-{
- struct socket *so;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (fd)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- error = so_ioctl (so, command, buffer);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- errno = error;
- return -1;
- }
- return 0;
-}
-
-rtems_libio_handler_t rtems_bsdnet_io_handler = {
- NULL, /* open */
- rtems_bsdnet_close, /* close */
- rtems_bsdnet_read, /* read */
- rtems_bsdnet_write, /* write */
- rtems_bsdnet_ioctl, /* ioctl */
- NULL, /* lseek */
-};
-
diff --git a/c/src/exec/libnetworking/rtems/sghostname.c b/c/src/exec/libnetworking/rtems/sghostname.c
deleted file mode 100644
index 36894caa86..0000000000
--- a/c/src/exec/libnetworking/rtems/sghostname.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * RTEMS versions of hostname functions
- * FIXME: Not thread-safe
- *
- * $Id$
- */
-
-#include <string.h>
-#include <errno.h>
-#include <rtems/rtems_bsdnet.h>
-#include <sys/param.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-
-static char *rtems_hostname;
-
-int
-gethostname (char *name, int namelen)
-{
- char *cp = rtems_hostname;
-
- if (cp == NULL)
- cp = "";
- strncpy (name, cp, namelen);
- return 0;
-}
-
-int
-sethostname (char *name, int namelen)
-{
- char *old, *new;
-
- if (namelen >= MAXHOSTNAMELEN) {
- errno = EINVAL;
- return -1;
- }
- new = malloc (namelen + 1, M_HTABLE, M_NOWAIT);
- if (new == NULL) {
- errno = ENOMEM;
- return -1;
- }
- strncpy (new, name, namelen);
- new[namelen] = '\0';
- old = rtems_hostname;
- rtems_hostname = new;
- if (old)
- free (old, M_HTABLE);
- return 0;
-}
diff --git a/c/src/exec/libnetworking/rtems/tftp.h b/c/src/exec/libnetworking/rtems/tftp.h
deleted file mode 100644
index d09782e22b..0000000000
--- a/c/src/exec/libnetworking/rtems/tftp.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * $Id$
- */
-
-/*
- * Trivial File Transfer Protocol (TFTP)
- *
- * Transfer file to/from remote host
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- */
-
-/*
- * Usage:
- *
- * To open `/bootfiles/image' on `hostname' for reading:
- * fd = open ("/TFTP/hostname/bootfiles/image", O_RDONLY);
- *
- * The `hostname' must be four dot-separated decimal values.
- *
- * To open a file on the host which supplied the BOOTP
- * information just leave the `hostname' part empty:
- * fd = open ("/TFTP//bootfiles/image", O_RDONLY);
- *
- */
-
-#ifndef _TFTP_DRIVER_h
-#define _TFTP_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Driver entry points
- */
-#define TFTP_DRIVER_TABLE_ENTRY \
- { rtems_tftp_initialize, rtems_tftp_open, rtems_tftp_close, \
- rtems_tftp_read, rtems_tftp_write, rtems_tftp_control }
-
-rtems_device_driver rtems_tftp_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_open(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_close(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_read(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_write(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_control(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/sys/buf.h b/c/src/exec/libnetworking/sys/buf.h
deleted file mode 100644
index 6cca571141..0000000000
--- a/c/src/exec/libnetworking/sys/buf.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)buf.h 8.9 (Berkeley) 3/30/95
- * $Id$
- */
-
-#ifndef _SYS_BUF_H_
-#define _SYS_BUF_H_
-
-#include <sys/queue.h>
-
-#define NOLIST ((struct buf *)0x87654321)
-
-struct buf;
-
-struct iodone_chain {
- long ic_prev_flags;
- void (*ic_prev_iodone) __P((struct buf *));
- void *ic_prev_iodone_chain;
- struct {
- long ia_long;
- void *ia_ptr;
- } ic_args[5];
-};
-
-typedef TAILQ_HEAD(buf_queue_head, buf) buf_queue_head, *buf_queue_head_t;
-
-/*
- * The buffer header describes an I/O operation in the kernel.
- */
-struct buf {
- LIST_ENTRY(buf) b_hash; /* Hash chain. */
- LIST_ENTRY(buf) b_vnbufs; /* Buffer's associated vnode. */
- TAILQ_ENTRY(buf) b_freelist; /* Free list position if not active. */
- TAILQ_ENTRY(buf) b_act; /* Device driver queue when active. *new* */
- struct proc *b_proc; /* Associated proc; NULL if kernel. */
- long b_flags; /* B_* flags. */
- unsigned short b_qindex; /* buffer queue index */
- unsigned char b_usecount; /* buffer use count */
- int b_error; /* Errno value. */
- long b_bufsize; /* Allocated buffer size. */
- long b_bcount; /* Valid bytes in buffer. */
- long b_resid; /* Remaining I/O. */
- dev_t b_dev; /* Device associated with buffer. */
- struct {
- caddr_t b_addr; /* Memory, superblocks, indirect etc. */
- } b_un;
- caddr_t b_kvabase; /* base kva for buffer */
- int b_kvasize; /* size of kva for buffer */
- void *b_saveaddr; /* Original b_addr for physio. */
- daddr_t b_lblkno; /* Logical block number. */
- daddr_t b_blkno; /* Underlying physical block number. */
- /* Function to call upon completion. */
- void (*b_iodone) __P((struct buf *));
- /* For nested b_iodone's. */
- struct iodone_chain *b_iodone_chain;
- struct vnode *b_vp; /* Device vnode. */
- int b_dirtyoff; /* Offset in buffer of dirty region. */
- int b_dirtyend; /* Offset of end of dirty region. */
- struct ucred *b_rcred; /* Read credentials reference. */
- struct ucred *b_wcred; /* Write credentials reference. */
- int b_validoff; /* Offset in buffer of valid region. */
- int b_validend; /* Offset of end of valid region. */
- daddr_t b_pblkno; /* physical block number */
- caddr_t b_savekva; /* saved kva for transfer while bouncing */
- void *b_driver1; /* for private use by the driver */
- void *b_driver2; /* for private use by the driver */
- void *b_spc;
- union cluster_info {
- TAILQ_HEAD(cluster_list_head, buf) cluster_head;
- TAILQ_ENTRY(buf) cluster_entry;
- } b_cluster;
- struct vm_page *b_pages[btoc(MAXPHYS)];
- int b_npages;
-};
-
-/* Device driver compatibility definitions. */
-#define b_data b_un.b_addr /* b_un.b_addr is not changeable. */
-
-/*
- * These flags are kept in b_flags.
- */
-#define B_AGE 0x00000001 /* Move to age queue when I/O done. */
-#define B_NEEDCOMMIT 0x00000002 /* Append-write in progress. */
-#define B_ASYNC 0x00000004 /* Start I/O, do not wait. */
-#define B_BAD 0x00000008 /* Bad block revectoring in progress. */
-#define B_BUSY 0x00000010 /* I/O in progress. */
-#define B_CACHE 0x00000020 /* Bread found us in the cache. */
-#define B_CALL 0x00000040 /* Call b_iodone from biodone. */
-#define B_DELWRI 0x00000080 /* Delay I/O until buffer reused. */
-#define B_DIRTY 0x00000100 /* Dirty page to be pushed out async. */
-#define B_DONE 0x00000200 /* I/O completed. */
-#define B_EINTR 0x00000400 /* I/O was interrupted */
-#define B_ERROR 0x00000800 /* I/O error occurred. */
-#define B_GATHERED 0x00001000 /* LFS: already in a segment. */
-#define B_INVAL 0x00002000 /* Does not contain valid info. */
-#define B_LOCKED 0x00004000 /* Locked in core (not reusable). */
-#define B_NOCACHE 0x00008000 /* Do not cache block after use. */
-#define B_MALLOC 0x00010000 /* malloced b_data */
-#define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */
-#define B_PHYS 0x00040000 /* I/O to user memory. */
-#define B_RAW 0x00080000 /* Set by physio for raw transfers. */
-#define B_READ 0x00100000 /* Read buffer. */
-#define B_TAPE 0x00200000 /* Magnetic tape I/O. */
-#define B_RELBUF 0x00400000 /* Release VMIO buffer. */
-#define B_WANTED 0x00800000 /* Process wants this buffer. */
-#define B_WRITE 0x00000000 /* Write buffer (pseudo flag). */
-#define B_WRITEINPROG 0x01000000 /* Write in progress. */
-#define B_XXX 0x02000000 /* Debugging flag. */
-#define B_PAGING 0x04000000 /* volatile paging I/O -- bypass VMIO */
-#define B_ORDERED 0x08000000 /* Must guarantee I/O ordering */
-#define B_VMIO 0x20000000 /* VMIO flag */
-#define B_CLUSTER 0x40000000 /* pagein op, so swap() can count it */
-#define B_BOUNCE 0x80000000 /* bounce buffer flag */
-
-/*
- * number of buffer hash entries
- */
-#define BUFHSZ 512
-
-/*
- * buffer hash table calculation, originally by David Greenman
- */
-#define BUFHASH(vnp, bn) \
- (&bufhashtbl[(((unsigned long)(vnp) >> 7)+(int)(bn)) % BUFHSZ])
-
-/*
- * Definitions for the buffer free lists.
- */
-#define BUFFER_QUEUES 6 /* number of free buffer queues */
-
-extern LIST_HEAD(bufhashhdr, buf) bufhashtbl[BUFHSZ], invalhash;
-extern TAILQ_HEAD(bqueues, buf) bufqueues[BUFFER_QUEUES];
-
-#define QUEUE_NONE 0 /* on no queue */
-#define QUEUE_LOCKED 1 /* locked buffers */
-#define QUEUE_LRU 2 /* useful buffers */
-#define QUEUE_VMIO 3 /* VMIO buffers */
-#define QUEUE_AGE 4 /* not-useful buffers */
-#define QUEUE_EMPTY 5 /* empty buffer headers*/
-
-/*
- * Zero out the buffer's data area.
- */
-#define clrbuf(bp) { \
- bzero((bp)->b_data, (u_int)(bp)->b_bcount); \
- (bp)->b_resid = 0; \
-}
-
-/* Flags to low-level allocation routines. */
-#define B_CLRBUF 0x01 /* Request allocated buffer be cleared. */
-#define B_SYNC 0x02 /* Do all allocations synchronously. */
-
-#ifdef KERNEL
-extern int nbuf; /* The number of buffer headers */
-extern struct buf *buf; /* The buffer headers. */
-extern char *buffers; /* The buffer contents. */
-extern int bufpages; /* Number of memory pages in the buffer pool. */
-extern struct buf *swbuf; /* Swap I/O buffer headers. */
-extern int nswbuf; /* Number of swap I/O buffer headers. */
-extern TAILQ_HEAD(swqueue, buf) bswlist;
-
-void bufinit __P((void));
-void bremfree __P((struct buf *));
-int bread __P((struct vnode *, daddr_t, int,
- struct ucred *, struct buf **));
-int breadn __P((struct vnode *, daddr_t, int, daddr_t *, int *, int,
- struct ucred *, struct buf **));
-int bwrite __P((struct buf *));
-void bdwrite __P((struct buf *));
-void bawrite __P((struct buf *));
-int bowrite __P((struct buf *));
-void brelse __P((struct buf *));
-void bqrelse __P((struct buf *));
-int vfs_bio_awrite __P((struct buf *));
-struct buf * getpbuf __P((void));
-struct buf *incore __P((struct vnode *, daddr_t));
-struct buf *gbincore __P((struct vnode *, daddr_t));
-int inmem __P((struct vnode *, daddr_t));
-struct buf *getblk __P((struct vnode *, daddr_t, int, int, int));
-struct buf *geteblk __P((int));
-int allocbuf __P((struct buf *, int));
-int biowait __P((struct buf *));
-void biodone __P((struct buf *));
-
-void cluster_callback __P((struct buf *));
-int cluster_read __P((struct vnode *, u_quad_t, daddr_t, long,
- struct ucred *, struct buf **));
-int cluster_wbuild __P((struct vnode *, long, daddr_t, int));
-void cluster_write __P((struct buf *, u_quad_t));
-int physio __P((void (*)(struct buf *), struct buf *, dev_t,
- int, u_int (*)(struct buf *), struct uio *));
-u_int minphys __P((struct buf *));
-void vfs_bio_clrbuf __P((struct buf *));
-void vfs_busy_pages __P((struct buf *, int clear_modify));
-void vfs_unbusy_pages(struct buf *);
-void vwakeup __P((struct buf *));
-void vmapbuf __P((struct buf *));
-void vunmapbuf __P((struct buf *));
-void relpbuf __P((struct buf *));
-void brelvp __P((struct buf *));
-void bgetvp __P((struct vnode *, struct buf *));
-void pbgetvp __P((struct vnode *, struct buf *));
-void pbrelvp __P((struct buf *));
-void reassignbuf __P((struct buf *, struct vnode *));
-struct buf *trypbuf __P((void));
-void vm_bounce_alloc __P((struct buf *));
-void vm_bounce_free __P((struct buf *));
-vm_offset_t vm_bounce_kva_alloc __P((int));
-void vm_bounce_kva_alloc_free __P((vm_offset_t, int));
-#endif /* KERNEL */
-
-#endif /* !_SYS_BUF_H_ */
diff --git a/c/src/exec/libnetworking/sys/callout.h b/c/src/exec/libnetworking/sys/callout.h
deleted file mode 100644
index 5fec98f28b..0000000000
--- a/c/src/exec/libnetworking/sys/callout.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)callout.h 8.2 (Berkeley) 1/21/94
- * $Id$
- */
-
-#ifndef _SYS_CALLOUT_H_
-#define _SYS_CALLOUT_H_
-
-struct callout {
- struct callout *c_next; /* next callout in queue */
- void *c_arg; /* function argument */
- void (*c_func) __P((void *)); /* function to call */
- int c_time; /* ticks to the event */
-};
-
-#ifdef KERNEL
-extern struct callout *callfree, *callout, calltodo;
-extern int ncallout;
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/sys/conf.h b/c/src/exec/libnetworking/sys/conf.h
deleted file mode 100644
index 92d99d9d07..0000000000
--- a/c/src/exec/libnetworking/sys/conf.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)conf.h 8.5 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _SYS_CONF_H_
-#define _SYS_CONF_H_
-
-/*
- * Definitions of device driver entry switches
- */
-
-struct buf;
-struct proc;
-struct tty;
-struct uio;
-struct vnode;
-
-typedef int d_open_t __P((dev_t dev, int oflags, int devtype, struct proc *p));
-typedef int d_close_t __P((dev_t dev, int fflag, int devtype, struct proc *p));
-typedef void d_strategy_t __P((struct buf *bp));
-typedef int d_ioctl_t __P((dev_t dev, int cmd, caddr_t data,
- int fflag, struct proc *p));
-typedef int d_dump_t __P((dev_t dev));
-typedef int d_psize_t __P((dev_t dev));
-
-typedef int d_read_t __P((dev_t dev, struct uio *uio, int ioflag));
-typedef int d_write_t __P((dev_t dev, struct uio *uio, int ioflag));
-typedef void d_stop_t __P((struct tty *tp, int rw));
-typedef int d_reset_t __P((dev_t dev));
-typedef struct tty *d_devtotty_t __P((dev_t dev));
-typedef int d_select_t __P((dev_t dev, int which, struct proc *p));
-typedef int d_mmap_t __P((dev_t dev, int offset, int nprot));
-
-typedef int l_open_t __P((dev_t dev, struct tty *tp));
-typedef int l_close_t __P((struct tty *tp, int flag));
-typedef int l_read_t __P((struct tty *tp, struct uio *uio, int flag));
-typedef int l_write_t __P((struct tty *tp, struct uio *uio, int flag));
-typedef int l_ioctl_t __P((struct tty *tp, int cmd, caddr_t data,
- int flag, struct proc *p));
-typedef int l_rint_t __P((int c, struct tty *tp));
-typedef int l_start_t __P((struct tty *tp));
-typedef int l_modem_t __P((struct tty *tp, int flag));
-
-/*
- * Block device switch table
- */
-struct bdevsw {
- d_open_t *d_open;
- d_close_t *d_close;
- d_strategy_t *d_strategy;
- d_ioctl_t *d_ioctl;
- d_dump_t *d_dump;
- d_psize_t *d_psize;
- int d_flags;
- char *d_name; /* name of the driver e.g. audio */
- struct cdevsw *d_cdev; /* cross pointer to the cdev */
- int d_maj; /* the major number we were assigned */
-};
-
-#ifdef KERNEL
-extern struct bdevsw *bdevsw[];
-#endif
-
-/*
- * Character device switch table
- */
-struct cdevsw {
- d_open_t *d_open;
- d_close_t *d_close;
- d_read_t *d_read;
- d_write_t *d_write;
- d_ioctl_t *d_ioctl;
- d_stop_t *d_stop;
- d_reset_t *d_reset; /* XXX not used */
- d_devtotty_t *d_devtotty;
- d_select_t *d_select;
- d_mmap_t *d_mmap;
- d_strategy_t *d_strategy;
- char *d_name; /* see above */
- struct bdevsw *d_bdev;
- int d_maj;
-};
-
-#ifdef KERNEL
-extern struct cdevsw *cdevsw[];
-#endif
-
-/*
- * Line discipline switch table
- */
-struct linesw {
- l_open_t *l_open;
- l_close_t *l_close;
- l_read_t *l_read;
- l_write_t *l_write;
- l_ioctl_t *l_ioctl;
- l_rint_t *l_rint;
- l_start_t *l_start;
- l_modem_t *l_modem;
-};
-
-#ifdef KERNEL
-extern struct linesw linesw[];
-extern int nlinesw;
-
-int ldisc_register __P((int , struct linesw *));
-void ldisc_deregister __P((int));
-#define LDISC_LOAD -1 /* Loadable line discipline */
-#endif
-
-/*
- * Swap device table
- */
-struct swdevt {
- dev_t sw_dev;
- int sw_flags;
- int sw_nblks;
- struct vnode *sw_vp;
-};
-#define SW_FREED 0x01
-#define SW_SEQUENTIAL 0x02
-#define sw_freed sw_flags /* XXX compat */
-
-#ifdef KERNEL
-d_open_t noopen;
-d_close_t noclose;
-d_read_t noread;
-d_write_t nowrite;
-d_ioctl_t noioctl;
-d_stop_t nostop;
-d_reset_t noreset;
-d_devtotty_t nodevtotty;
-d_select_t noselect;
-d_mmap_t nommap;
-
-/* Bogus defines for compatibility. */
-#define noioc noioctl
-#define nostrat nostrategy
-#define zerosize nopsize
-/*
- * XXX d_strategy seems to be unused for cdevs that aren't associated with
- * bdevs and called without checking for it being non-NULL for bdevs.
- */
-#define nostrategy ((d_strategy_t *)NULL)
-
-d_dump_t nodump;
-
-/*
- * nopsize is little used, so not worth having dummy functions for.
- */
-#define nopsize ((d_psize_t *)NULL)
-
-d_open_t nullopen;
-d_close_t nullclose;
-#define nullstop nostop /* one void return is as good as another */
-#define nullreset noreset /* one unused function is as good as another */
-
-d_open_t nxopen;
-d_close_t nxclose;
-d_read_t nxread;
-d_write_t nxwrite;
-d_ioctl_t nxioctl;
-#define nxstop nostop /* one void return is as good as another */
-#define nxreset noreset /* one unused function is as good as another */
-#define nxdevtotty nodevtotty /* one NULL return is as good as another */
-d_select_t nxselect;
-#define nxmmap nommap /* one -1 return is as good as another */
-#define nxstrategy nostrategy /* one NULL value is as good as another */
-d_dump_t nxdump;
-#define nxpsize nopsize /* one NULL value is as good as another */
-
-d_read_t rawread;
-d_write_t rawwrite;
-
-l_read_t l_noread;
-l_write_t l_nowrite;
-
-int bdevsw_add __P((dev_t *descrip,struct bdevsw *new,struct bdevsw **old));
-int cdevsw_add __P((dev_t *descrip,struct cdevsw *new,struct cdevsw **old));
-void cdevsw_make __P((struct bdevsw *from));
-void bdevsw_add_generic __P((int bdev, int cdev, struct bdevsw *bdevsw));
-dev_t chrtoblk __P((dev_t dev));
-int isdisk __P((dev_t dev, int type));
-int iskmemdev __P((dev_t dev));
-int iszerodev __P((dev_t dev));
-void setconf __P((void));
-#endif /* KERNEL */
-
-#include <machine/conf.h>
-
-#endif /* !_SYS_CONF_H_ */
diff --git a/c/src/exec/libnetworking/sys/domain.h b/c/src/exec/libnetworking/sys/domain.h
deleted file mode 100644
index 2ec8a5fb05..0000000000
--- a/c/src/exec/libnetworking/sys/domain.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)domain.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_DOMAIN_H_
-#define _SYS_DOMAIN_H_
-
-/*
- * Structure per communications domain.
- */
-
-/*
- * Forward structure declarations for function prototypes [sic].
- */
-struct mbuf;
-
-struct domain {
- int dom_family; /* AF_xxx */
- char *dom_name;
- void (*dom_init) /* initialize domain data structures */
- __P((void));
- int (*dom_externalize) /* externalize access rights */
- __P((struct mbuf *));
- void (*dom_dispose) /* dispose of internalized rights */
- __P((struct mbuf *));
- struct protosw *dom_protosw, *dom_protoswNPROTOSW;
- struct domain *dom_next;
- int (*dom_rtattach) /* initialize routing table */
- __P((void **, int));
- int dom_rtoffset; /* an arg to rtattach, in bits */
- int dom_maxrtkey; /* for routing layer */
-};
-
-#ifdef KERNEL
-extern struct domain *domains;
-extern struct domain localdomain;
-
-#define DOMAIN_SET(name) \
- DATA_SET(domain_set, name ## domain);
-
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/sys/kernel.h b/c/src/exec/libnetworking/sys/kernel.h
deleted file mode 100644
index 35bce70bd6..0000000000
--- a/c/src/exec/libnetworking/sys/kernel.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/*-
- * Copyright (c) 1995 Terrence R. Lambert
- * All rights reserved.
- *
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)kernel.h 8.3 (Berkeley) 1/21/94
- * $Id$
- */
-
-#ifndef _SYS_KERNEL_H_
-#define _SYS_KERNEL_H_
-
-/* Global variables for the kernel. */
-
-/* 1.1 */
-extern long hostid;
-extern char hostname[MAXHOSTNAMELEN];
-extern int hostnamelen;
-extern char domainname[MAXHOSTNAMELEN];
-extern int domainnamelen;
-extern char kernelname[MAXPATHLEN];
-
-/* 1.2 */
-extern volatile struct timeval mono_time;
-extern struct timeval boottime;
-extern struct timeval runtime;
-/* extern volatile struct timeval time; */
-extern struct timezone tz; /* XXX */
-
-extern int tick; /* usec per tick (1000000 / hz) */
-extern int hz; /* system clock's frequency */
-extern int psratio; /* ratio: prof / stat */
-extern int stathz; /* statistics clock's frequency */
-extern int profhz; /* profiling clock's frequency */
-extern int ticks;
-extern int lbolt; /* once a second sleep address */
-extern int tickdelta;
-extern long timedelta;
-
-/*
- * The following macros are used to declare global sets of objects, which
- * are collected by the linker into a `struct linker_set' as defined below.
- *
- * NB: the constants defined below must match those defined in
- * ld/ld.h. Since their calculation requires arithmetic, we
- * can't name them symbolically (e.g., 23 is N_SETT | N_EXT).
- */
-#define MAKE_SET(set, sym, type)
-#define TEXT_SET(set, sym) MAKE_SET(set, sym, 23)
-#define DATA_SET(set, sym) MAKE_SET(set, sym, 25)
-#define BSS_SET(set, sym) MAKE_SET(set, sym, 27)
-#define ABS_SET(set, sym) MAKE_SET(set, sym, 21)
-
-
-/*
- * Enumerated types for known system startup interfaces.
- *
- * Startup occurs in ascending numeric order; the list entries are
- * sorted prior to attempting startup to guarantee order. Items
- * of the same level are arbitrated for order based on the 'order'
- * element.
- *
- * These numbers are arbitrary and are chosen ONLY for ordering; the
- * enumeration values are explicit rather than implicit to provide
- * for binary compatibility with inserted elements.
- *
- * The SI_SUB_RUN_SCHEDULER value must have the highest lexical value.
- *
- * The SI_SUB_CONSOLE and SI_SUB_SWAP values represent values used by
- * the BSD 4.4Lite but not by FreeBSD; they are maintained in dependent
- * order to support porting.
- *
- * The SI_SUB_PROTO_BEGIN and SI_SUB_PROTO_END bracket a range of
- * initializations to take place at splimp(). This is a historical
- * wart that should be removed -- probably running everything at
- * splimp() until the first init that doesn't want it is the correct
- * fix. They are currently present to ensure historical behavior.
- */
-enum sysinit_sub_id {
- SI_SUB_DUMMY = 0x00000000, /* not executed; for linker*/
- SI_SUB_CONSOLE = 0x08000000, /* console*/
- SI_SUB_COPYRIGHT = 0x08000001, /* first use of console*/
- SI_SUB_VM = 0x10000000, /* virtual memory system init*/
- SI_SUB_KMEM = 0x18000000, /* kernel memory*/
- SI_SUB_CPU = 0x20000000, /* CPU resource(s)*/
- SI_SUB_DEVFS = 0x22000000, /* get DEVFS ready */
- SI_SUB_DRIVERS = 0x23000000, /* Let Drivers initialize */
- SI_SUB_CONFIGURE = 0x24000000, /* Configure devices */
- SI_SUB_INTRINSIC = 0x28000000, /* proc 0*/
- SI_SUB_RUN_QUEUE = 0x30000000, /* the run queue*/
- SI_SUB_VM_CONF = 0x38000000, /* config VM, set limits*/
- SI_SUB_VFS = 0x40000000, /* virtual file system*/
- SI_SUB_CLOCKS = 0x48000000, /* real time and stat clocks*/
- SI_SUB_MBUF = 0x50000000, /* mbufs*/
- SI_SUB_CLIST = 0x58000000, /* clists*/
- SI_SUB_SYSV_SHM = 0x64000000, /* System V shared memory*/
- SI_SUB_SYSV_SEM = 0x68000000, /* System V semaphores*/
- SI_SUB_SYSV_MSG = 0x6C000000, /* System V message queues*/
- SI_SUB_PSEUDO = 0x70000000, /* pseudo devices*/
- SI_SUB_PROTO_BEGIN = 0x80000000, /* XXX: set splimp (kludge)*/
- SI_SUB_PROTO_IF = 0x84000000, /* interfaces*/
- SI_SUB_PROTO_DOMAIN = 0x88000000, /* domains (address families?)*/
- SI_SUB_PROTO_END = 0x8fffffff, /* XXX: set splx (kludge)*/
- SI_SUB_KPROF = 0x90000000, /* kernel profiling*/
- SI_SUB_KICK_SCHEDULER = 0xa0000000, /* start the timeout events*/
- SI_SUB_ROOT = 0xb0000000, /* root mount*/
- SI_SUB_ROOT_FDTAB = 0xb8000000, /* root vnode in fd table...*/
- SI_SUB_SWAP = 0xc0000000, /* swap*/
- SI_SUB_INTRINSIC_POST = 0xd0000000, /* proc 0 cleanup*/
- SI_SUB_KTHREAD_INIT = 0xe0000000, /* init process*/
- SI_SUB_KTHREAD_PAGE = 0xe4000000, /* pageout daemon*/
- SI_SUB_KTHREAD_VM = 0xe8000000, /* vm daemon*/
- SI_SUB_KTHREAD_UPDATE = 0xec000000, /* update daemon*/
- SI_SUB_RUN_SCHEDULER = 0xffffffff /* scheduler: no return*/
-};
-
-
-/*
- * Some enumerated orders; "ANY" sorts last.
- */
-enum sysinit_elem_order {
- SI_ORDER_FIRST = 0x00000000, /* first*/
- SI_ORDER_SECOND = 0x00000001, /* second*/
- SI_ORDER_THIRD = 0x00000002, /* third*/
- SI_ORDER_MIDDLE = 0x10000000, /* somewhere in the middle */
- SI_ORDER_ANY = 0xffffffff /* last*/
-};
-
-
-/*
- * System initialization call types; currently two are supported... one
- * to do a simple function call and one to cause a process to be started
- * by the kernel on the callers behalf.
- */
-typedef enum sysinit_elem_type {
- SI_TYPE_DEFAULT = 0x00000000, /* No special processing*/
- SI_TYPE_KTHREAD = 0x00000001 /* start kernel thread*/
-} si_elem_t;
-
-
-/*
- * A system initialization call instance
- *
- * The subsystem
- */
-struct sysinit {
- unsigned int subsystem; /* subsystem identifier*/
- unsigned int order; /* init order within subsystem*/
- void (*func) __P((void *)); /* init function*/
- void *udata; /* multiplexer/argument */
- si_elem_t type; /* sysinit_elem_type*/
-};
-
-
-/*
- * Default: no special processing
- */
-#define SYSINIT(uniquifier, subsystem, order, func, ident)
-
-/*
- * Call 'fork()' before calling '(*func)(ident)';
- * for making a kernel 'thread' (or builtin process.)
- */
-#define SYSINIT_KT(uniquifier, subsystem, order, func, ident)
-
-
-/*
- * A kernel process descriptor; used to start "internal" daemons
- *
- * Note: global_procpp may be NULL for no global save area
- */
-struct kproc_desc {
- char *arg0; /* arg 0 (for 'ps' listing)*/
- void (*func) __P((void)); /* "main" for kernel process*/
- struct proc **global_procpp; /* ptr to proc ptr save area*/
-};
-
-void kproc_start __P((void *udata));
-
-#ifdef PSEUDO_LKM
-#include <sys/conf.h>
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-#define PSEUDO_SET(init, name) \
- extern struct linker_set MODVNOPS; \
- MOD_MISC(name); \
- static int \
- name ## _load(struct lkm_table *lkmtp, int cmd) \
- { init((void *)NULL /* XXX unused (?) */); return 0; } \
- static int \
- name ## _unload(struct lkm_table *lkmtp, int cmd) \
- { return EINVAL; } \
- int \
- name ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \
- DISPATCH(lkmtp, cmd, ver, name ## _load, name ## _unload, \
- lkm_nullcmd); }
-#else /* PSEUDO_LKM */
-
-/*
- * Compatibility. To be deprecated after LKM is updated.
- */
-#define PSEUDO_SET(sym, name) SYSINIT(ps, SI_SUB_PSEUDO, SI_ORDER_ANY, sym, 0)
-
-#endif /* PSEUDO_LKM */
-
-struct linker_set {
- int ls_length;
- const void *ls_items[1]; /* really ls_length of them,
- * trailing NULL */
-};
-
-extern struct linker_set execsw_set;
-
-#endif /* !_SYS_KERNEL_H_*/
diff --git a/c/src/exec/libnetworking/sys/libkern.h b/c/src/exec/libnetworking/sys/libkern.h
deleted file mode 100644
index c01e35b273..0000000000
--- a/c/src/exec/libnetworking/sys/libkern.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * 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.
- *
- * @(#)libkern.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _SYS_LIBKERN_H_
-#define _SYS_LIBKERN_H_
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-/* BCD conversions. */
-extern u_char const bcd2bin_data[];
-extern u_char const bin2bcd_data[];
-extern char const hex2ascii_data[];
-
-#define bcd2bin(bcd) (bcd2bin_data[bcd])
-#define bin2bcd(bin) (bin2bcd_data[bin])
-#define hex2ascii(hex) (hex2ascii_data[hex])
-
-static __inline int imax(int a, int b) { return (a > b ? a : b); }
-static __inline int imin(int a, int b) { return (a < b ? a : b); }
-static __inline long lmax(long a, long b) { return (a > b ? a : b); }
-static __inline long lmin(long a, long b) { return (a < b ? a : b); }
-static __inline u_int max(u_int a, u_int b) { return (a > b ? a : b); }
-static __inline u_int min(u_int a, u_int b) { return (a < b ? a : b); }
-static __inline quad_t qmax(quad_t a, quad_t b) { return (a > b ? a : b); }
-static __inline quad_t qmin(quad_t a, quad_t b) { return (a < b ? a : b); }
-static __inline u_long ulmax(u_long a, u_long b) { return (a > b ? a : b); }
-static __inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); }
-
-/* Prototypes for non-quad routines. */
-int bcmp __P((const void *, const void *, size_t));
-#ifndef HAVE_INLINE_FFS
-int ffs __P((int));
-#endif
-#ifndef HAVE_INLINE_FLS
-int fls __P((int));
-#endif
-int locc __P((int, char *, u_int));
-void qsort __P((void *base, size_t nmemb, size_t size,
- int (*compar)(const void *, const void *)));
-u_long random __P((void));
-char *index __P((const char *, int));
-char *rindex __P((const char *, int));
-int scanc __P((u_int, const u_char *, const u_char *, int));
-int skpc __P((int, int, char *));
-void srandom __P((u_long));
-char *strcat __P((char *, const char *));
-int strcmp __P((const char *, const char *));
-char *strdup __P((const char *s));
-char *strcpy __P((char *, const char *));
-size_t strlen __P((const char *));
-int strncmp __P((const char *, const char *, size_t));
-char *strncpy __P((char *, const char *, size_t));
-char *strerror __P((int errnum));
-
-#endif /* !_SYS_LIBKERN_H_ */
diff --git a/c/src/exec/libnetworking/sys/malloc.h b/c/src/exec/libnetworking/sys/malloc.h
deleted file mode 100644
index ec85c1814d..0000000000
--- a/c/src/exec/libnetworking/sys/malloc.h
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Copyright (c) 1987, 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.
- *
- * @(#)malloc.h 8.5 (Berkeley) 5/3/95
- * $Id$
- */
-
-#ifndef _SYS_MALLOC_H_
-#define _SYS_MALLOC_H_
-
-#include <rtems/rtems_bsdnet_internal.h> /* Ensure we get RTEMS malloc hooks */
-#define KMEMSTATS
-
-/*
- * flags to malloc
- */
-#define M_WAITOK 0x0000
-#define M_NOWAIT 0x0001
-#define M_KERNEL 0x0002
-
-/*
- * Types of memory to be allocated
- */
-#define M_FREE 0 /* should be on free list */
-#define M_MBUF 1 /* mbuf */
-#define M_DEVBUF 2 /* device driver memory */
-#define M_SOCKET 3 /* socket structure */
-#define M_PCB 4 /* protocol control block */
-#define M_RTABLE 5 /* routing tables */
-#define M_HTABLE 6 /* IMP host tables */
-#define M_FTABLE 7 /* fragment reassembly header */
-#define M_ZOMBIE 8 /* zombie proc status */
-#define M_IFADDR 9 /* interface address */
-#define M_SOOPTS 10 /* socket options */
-#define M_SONAME 11 /* socket name */
-#define M_NAMEI 12 /* namei path name buffer */
-#define M_GPROF 13 /* kernel profiling buffer */
-#define M_IOCTLOPS 14 /* ioctl data buffer */
-#define M_MAPMEM 15 /* mapped memory descriptors */
-#define M_CRED 16 /* credentials */
-#define M_PGRP 17 /* process group header */
-#define M_SESSION 18 /* session header */
-#define M_IOV 19 /* large iov's */
-#define M_MOUNT 20 /* vfs mount struct */
-#define M_FHANDLE 21 /* network file handle */
-#define M_NFSREQ 22 /* NFS request header */
-#define M_NFSMNT 23 /* NFS mount structure */
-#define M_NFSNODE 24 /* NFS vnode private part */
-#define M_VNODE 25 /* Dynamically allocated vnodes */
-#define M_CACHE 26 /* Dynamically allocated cache entries */
-#define M_DQUOT 27 /* UFS quota entries */
-#define M_UFSMNT 28 /* UFS mount structure */
-#define M_SHM 29 /* SVID compatible shared memory segments */
-#define M_VMMAP 30 /* VM map structures */
-#define M_VMMAPENT 31 /* VM map entry structures */
-#define M_VMOBJ 32 /* VM object structure */
-#define M_VMOBJHASH 33 /* VM object hash structure */
-#define M_VMPMAP 34 /* VM pmap */
-#define M_VMPVENT 35 /* VM phys-virt mapping entry */
-#define M_VMPAGER 36 /* XXX: VM pager struct */
-#define M_VMPGDATA 37 /* XXX: VM pager private data */
-#define M_FILE 38 /* Open file structure */
-#define M_FILEDESC 39 /* Open file descriptor table */
-#define M_LOCKF 40 /* Byte-range locking structures */
-#define M_PROC 41 /* Proc structures */
-#define M_SUBPROC 42 /* Proc sub-structures */
-#define M_SEGMENT 43 /* Segment for LFS */
-#define M_LFSNODE 44 /* LFS vnode private part */
-#define M_FFSNODE 45 /* FFS vnode private part */
-#define M_MFSNODE 46 /* MFS vnode private part */
-#define M_NQLEASE 47 /* Nqnfs lease */
-#define M_NQMHOST 48 /* Nqnfs host address table */
-#define M_NETADDR 49 /* Export host address structure */
-#define M_NFSSVC 50 /* Nfs server structure */
-#define M_NFSUID 51 /* Nfs uid mapping structure */
-#define M_NFSD 52 /* Nfs server daemon structure */
-#define M_IPMOPTS 53 /* internet multicast options */
-#define M_IPMADDR 54 /* internet multicast address */
-#define M_IFMADDR 55 /* link-level multicast address */
-#define M_MRTABLE 56 /* multicast routing tables */
-#define M_ISOFSMNT 57 /* ISOFS mount structure */
-#define M_ISOFSNODE 58 /* ISOFS vnode private part */
-#define M_NFSRVDESC 59 /* NFS server socket descriptor */
-#define M_NFSDIROFF 60 /* NFS directory offset data */
-#define M_NFSBIGFH 61 /* NFS version 3 file handle */
-#define M_MSDOSFSMNT 67 /* MSDOSFS mount structure */
-#define M_MSDOSFSNODE 68 /* MSDOSFS vnode private part */
-#define M_MSDOSFSFAT 69 /* MSDOSFS file allocation table */
-#define M_DEVFSMNT 70 /* DEVFS mount structure */
-#define M_DEVFSBACK 71 /* DEVFS Back node */
-#define M_DEVFSFRONT 72 /* DEVFS Front node */
-#define M_DEVFSNODE 73 /* DEVFS node */
-#define M_TEMP 74 /* misc temporary data buffers */
-#define M_TTYS 75 /* tty data structures */
-#define M_GZIP 76 /* Gzip trees */
-#define M_IPFW 77 /* IpFw/IpAcct chain's */
-#define M_DEVL 78 /* isa_device lists in userconfig() */
-#define M_PKTCLASS 79 /* structures used in packet classifier */
-#define M_SYSCTL 80 /* sysctl internal magic */
-#define M_SECA 81 /* security associations, key management */
-#define M_BIOBUF 82 /* BIO buffer */
-#define M_KTRACE 83 /* KTRACE */
-#define M_SELECT 84 /* select() buffer */
-#define M_CFS 85 /* Coda */
-#define M_LAST 86 /* Must be last type + 1 */
-
-#define INITKMEMNAMES { \
- "free", /* 0 M_FREE */ \
- "mbuf", /* 1 M_MBUF */ \
- "devbuf", /* 2 M_DEVBUF */ \
- "socket", /* 3 M_SOCKET */ \
- "pcb", /* 4 M_PCB */ \
- "routetbl", /* 5 M_RTABLE */ \
- "hosttbl", /* 6 M_HTABLE */ \
- "fragtbl", /* 7 M_FTABLE */ \
- "zombie", /* 8 M_ZOMBIE */ \
- "ifaddr", /* 9 M_IFADDR */ \
- "soopts", /* 10 M_SOOPTS */ \
- "soname", /* 11 M_SONAME */ \
- "namei", /* 12 M_NAMEI */ \
- "gprof", /* 13 M_GPROF */ \
- "ioctlops", /* 14 M_IOCTLOPS */ \
- "mapmem", /* 15 M_MAPMEM */ \
- "cred", /* 16 M_CRED */ \
- "pgrp", /* 17 M_PGRP */ \
- "session", /* 18 M_SESSION */ \
- "iov", /* 19 M_IOV */ \
- "mount", /* 20 M_MOUNT */ \
- "fhandle", /* 21 M_FHANDLE */ \
- "NFS req", /* 22 M_NFSREQ */ \
- "NFS mount", /* 23 M_NFSMNT */ \
- "NFS node", /* 24 M_NFSNODE */ \
- "vnodes", /* 25 M_VNODE */ \
- "namecache", /* 26 M_CACHE */ \
- "UFS quota", /* 27 M_DQUOT */ \
- "UFS mount", /* 28 M_UFSMNT */ \
- "shm", /* 29 M_SHM */ \
- "VM map", /* 30 M_VMMAP */ \
- "VM mapent", /* 31 M_VMMAPENT */ \
- "VM object", /* 32 M_VMOBJ */ \
- "VM objhash", /* 33 M_VMOBJHASH */ \
- "VM pmap", /* 34 M_VMPMAP */ \
- "VM pvmap", /* 35 M_VMPVENT */ \
- "VM pager", /* 36 M_VMPAGER */ \
- "VM pgdata", /* 37 M_VMPGDATA */ \
- "file", /* 38 M_FILE */ \
- "file desc", /* 39 M_FILEDESC */ \
- "lockf", /* 40 M_LOCKF */ \
- "proc", /* 41 M_PROC */ \
- "subproc", /* 42 M_SUBPROC */ \
- "LFS segment", /* 43 M_SEGMENT */ \
- "LFS node", /* 44 M_LFSNODE */ \
- "FFS node", /* 45 M_FFSNODE */ \
- "MFS node", /* 46 M_MFSNODE */ \
- "NQNFS Lease", /* 47 M_NQLEASE */ \
- "NQNFS Host", /* 48 M_NQMHOST */ \
- "Export Host", /* 49 M_NETADDR */ \
- "NFS srvsock", /* 50 M_NFSSVC */ \
- "NFS uid", /* 51 M_NFSUID */ \
- "NFS daemon", /* 52 M_NFSD */ \
- "ip_moptions", /* 53 M_IPMOPTS */ \
- "in_multi", /* 54 M_IPMADDR */ \
- "ether_multi", /* 55 M_IFMADDR */ \
- "mrt", /* 56 M_MRTABLE */ \
- "ISOFS mount", /* 57 M_ISOFSMNT */ \
- "ISOFS node", /* 58 M_ISOFSNODE */ \
- "NFSV3 srvdesc",/* 59 M_NFSRVDESC */ \
- "NFSV3 diroff", /* 60 M_NFSDIROFF */ \
- "NFSV3 bigfh", /* 61 M_NFSBIGFH */ \
- NULL, \
- NULL, NULL, NULL, NULL, \
- "MSDOSFS mount",/* 67 M_MSDOSFSMNT */ \
- "MSDOSFS node", /* 68 M_MSDOSFSNODE */ \
- "MSDOSFS FAT", /* 69 M_MSDOSFSFAR */ \
- "DEVFS mount", /* 70 M_DEVFSMNT */ \
- "DEVFS back", /* 71 M_DEVFSBACK */ \
- "DEVFS front", /* 72 M_DEVFSFRONT */ \
- "DEVFS node", /* 73 M_DEVFSNODE */ \
- "temp", /* 74 M_TEMP */ \
- "ttys", /* 75 M_TTYS */ \
- "Gzip trees", /* 76 M_GZIP */ \
- "IpFw/IpAcct", /* 77 M_IPFW */ \
- "isa_devlist", /* 78 M_DEVL */ \
- "PktClass", /* 79 M_PKTCLASS */ \
- "sysctl", /* 80 M_SYSCTL */ \
- "key mgmt", /* 81 M_SECA */ \
- "BIO buffer", /* 82 M_BIOBUF */ \
- "KTRACE", /* 83 M_KTRACE */ \
- "select", /* 84 M_SELECT */ \
- "Coda", /* 85 M_CFS */ \
-}
-
-struct kmemstats {
- long ks_inuse; /* # of packets of this type currently in use */
- long ks_calls; /* total packets of this type ever allocated */
- long ks_memuse; /* total memory held in bytes */
- u_short ks_limblocks; /* number of times blocked for hitting limit */
- u_short ks_mapblocks; /* number of times blocked for kernel map */
- long ks_maxused; /* maximum number ever used */
- long ks_limit; /* most that are allowed to exist */
- long ks_size; /* sizes of this thing that are allocated */
- long ks_spare;
-};
-
-/*
- * Array of descriptors that describe the contents of each page
- */
-struct kmemusage {
- short ku_indx; /* bucket index */
- union {
- u_short freecnt;/* for small allocations, free pieces in page */
- u_short pagecnt;/* for large allocations, pages alloced */
- } ku_un;
-};
-#define ku_freecnt ku_un.freecnt
-#define ku_pagecnt ku_un.pagecnt
-
-/*
- * Set of buckets for each size of memory block that is retained
- */
-struct kmembuckets {
- caddr_t kb_next; /* list of free blocks */
- caddr_t kb_last; /* last free block */
- long kb_calls; /* total calls to allocate this size */
- long kb_total; /* total number of blocks allocated */
- long kb_totalfree; /* # of free elements in this bucket */
- long kb_elmpercl; /* # of elements in this sized allocation */
- long kb_highwat; /* high water mark */
- long kb_couldfree; /* over high water mark and could free */
-};
-
-#ifdef KERNEL
-#define MINALLOCSIZE (1 << MINBUCKET)
-#define BUCKETINDX(size) \
- ((size) <= (MINALLOCSIZE * 128) \
- ? (size) <= (MINALLOCSIZE * 8) \
- ? (size) <= (MINALLOCSIZE * 2) \
- ? (size) <= (MINALLOCSIZE * 1) \
- ? (MINBUCKET + 0) \
- : (MINBUCKET + 1) \
- : (size) <= (MINALLOCSIZE * 4) \
- ? (MINBUCKET + 2) \
- : (MINBUCKET + 3) \
- : (size) <= (MINALLOCSIZE* 32) \
- ? (size) <= (MINALLOCSIZE * 16) \
- ? (MINBUCKET + 4) \
- : (MINBUCKET + 5) \
- : (size) <= (MINALLOCSIZE * 64) \
- ? (MINBUCKET + 6) \
- : (MINBUCKET + 7) \
- : (size) <= (MINALLOCSIZE * 2048) \
- ? (size) <= (MINALLOCSIZE * 512) \
- ? (size) <= (MINALLOCSIZE * 256) \
- ? (MINBUCKET + 8) \
- : (MINBUCKET + 9) \
- : (size) <= (MINALLOCSIZE * 1024) \
- ? (MINBUCKET + 10) \
- : (MINBUCKET + 11) \
- : (size) <= (MINALLOCSIZE * 8192) \
- ? (size) <= (MINALLOCSIZE * 4096) \
- ? (MINBUCKET + 12) \
- : (MINBUCKET + 13) \
- : (size) <= (MINALLOCSIZE * 16384) \
- ? (MINBUCKET + 14) \
- : (MINBUCKET + 15))
-
-/*
- * Turn virtual addresses into kmem map indices
- */
-#define kmemxtob(alloc) (kmembase + (alloc) * PAGE_SIZE)
-#define btokmemx(addr) (((caddr_t)(addr) - kmembase) / PAGE_SIZE)
-#define btokup(addr) (&kmemusage[(caddr_t)(addr) - kmembase >> PAGE_SHIFT])
-
-/*
- * Macro versions for the usual cases of malloc/free
- */
-#if defined(KMEMSTATS) || defined(DIAGNOSTIC)
-#define MALLOC(space, cast, size, type, flags) \
- (space) = (cast)malloc((u_long)(size), type, flags)
-#define FREE(addr, type) free((addr), type)
-
-#else /* do not collect statistics */
-#define MALLOC(space, cast, size, type, flags) { \
- register struct kmembuckets *kbp = &bucket[BUCKETINDX(size)]; \
- long s = splimp(); \
- if (kbp->kb_next == NULL) { \
- (space) = (cast)malloc((u_long)(size), type, flags); \
- } else { \
- (space) = (cast)kbp->kb_next; \
- kbp->kb_next = *(caddr_t *)(space); \
- } \
- splx(s); \
-}
-
-#define FREE(addr, type) { \
- register struct kmembuckets *kbp; \
- register struct kmemusage *kup = btokup(addr); \
- long s = splimp(); \
- if (1 << kup->ku_indx > MAXALLOCSAVE) { \
- free((addr), type); \
- } else { \
- kbp = &bucket[kup->ku_indx]; \
- if (kbp->kb_next == NULL) \
- kbp->kb_next = (caddr_t)(addr); \
- else \
- *(caddr_t *)(kbp->kb_last) = (caddr_t)(addr); \
- *(caddr_t *)(addr) = NULL; \
- kbp->kb_last = (caddr_t)(addr); \
- } \
- splx(s); \
-}
-#endif /* do not collect statistics */
-
-extern struct kmemstats kmemstats[];
-extern struct kmemusage *kmemusage;
-extern char *kmembase;
-extern struct kmembuckets bucket[];
-
-void *contigmalloc __P((unsigned long size, int type, int flags,
- unsigned long low, unsigned long high,
- unsigned long alignment, unsigned long boundary));
-void free __P((void *addr, int type));
-void *malloc __P((unsigned long size, int type, int flags));
-#endif /* KERNEL */
-
-#endif /* !_SYS_MALLOC_H_ */
diff --git a/c/src/exec/libnetworking/sys/mbuf.h b/c/src/exec/libnetworking/sys/mbuf.h
deleted file mode 100644
index b380b3fca3..0000000000
--- a/c/src/exec/libnetworking/sys/mbuf.h
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)mbuf.h 8.5 (Berkeley) 2/19/95
- * $Id$
- */
-
-#ifndef _SYS_MBUF_H_
-#define _SYS_MBUF_H_
-
-#ifndef M_WAITOK
-#include <sys/malloc.h>
-#endif
-
-/*
- * Mbufs are of a single size, MSIZE (machine/machparam.h), which
- * includes overhead. An mbuf may add a single "mbuf cluster" of size
- * MCLBYTES (also in machine/machparam.h), which has no additional overhead
- * and is used instead of the internal data area; this is done when
- * at least MINCLSIZE of data must be stored.
- */
-
-#define MLEN (MSIZE - sizeof(struct m_hdr)) /* normal data len */
-#define MHLEN (MLEN - sizeof(struct pkthdr)) /* data len w/pkthdr */
-
-#define MINCLSIZE (MHLEN + MLEN) /* smallest amount to put in cluster */
-#define M_MAXCOMPRESS (MHLEN / 2) /* max amount to copy for compression */
-
-/*
- * Macros for type conversion
- * mtod(m,t) - convert mbuf pointer to data pointer of correct type
- * dtom(x) - convert data pointer within mbuf to mbuf pointer (XXX)
- * mtocl(x) - convert pointer within cluster to cluster index #
- * cltom(x) - convert cluster # to ptr to beginning of cluster
- */
-#define mtod(m,t) ((t)((m)->m_data))
-#define dtom(x) ((struct mbuf *)((long)(x) & ~(MSIZE-1)))
-#define mtocl(x) (((u_long)(x) - (u_long)mbutl) >> MCLSHIFT)
-#define cltom(x) ((caddr_t)((u_long)mbutl + ((u_long)(x) << MCLSHIFT)))
-
-/* header at beginning of each mbuf: */
-struct m_hdr {
- struct mbuf *mh_next; /* next buffer in chain */
- struct mbuf *mh_nextpkt; /* next chain in queue/record */
- caddr_t mh_data; /* location of data */
- int mh_len; /* amount of data in this mbuf */
- short mh_type; /* type of data in this mbuf */
- short mh_flags; /* flags; see below */
-};
-
-/* record/packet header in first mbuf of chain; valid if M_PKTHDR set */
-struct pkthdr {
- struct ifnet *rcvif; /* rcv interface */
- int len; /* total packet length */
-};
-
-/* description of external storage mapped into mbuf, valid if M_EXT set */
-struct m_ext {
- caddr_t ext_buf; /* start of buffer */
- void (*ext_free) /* free routine if not the usual */
- __P((caddr_t, u_int));
- u_int ext_size; /* size of buffer, for ext_free */
- void (*ext_ref) /* add a reference to the ext object */
- __P((caddr_t, u_int));
-};
-
-struct mbuf {
- struct m_hdr m_hdr;
- union {
- struct {
- struct pkthdr MH_pkthdr; /* M_PKTHDR set */
- union {
- struct m_ext MH_ext; /* M_EXT set */
- char MH_databuf[MHLEN];
- } MH_dat;
- } MH;
- char M_databuf[MLEN]; /* !M_PKTHDR, !M_EXT */
- } M_dat;
-};
-#define m_next m_hdr.mh_next
-#define m_len m_hdr.mh_len
-#define m_data m_hdr.mh_data
-#define m_type m_hdr.mh_type
-#define m_flags m_hdr.mh_flags
-#define m_nextpkt m_hdr.mh_nextpkt
-#define m_act m_nextpkt
-#define m_pkthdr M_dat.MH.MH_pkthdr
-#define m_ext M_dat.MH.MH_dat.MH_ext
-#define m_pktdat M_dat.MH.MH_dat.MH_databuf
-#define m_dat M_dat.M_databuf
-
-/* mbuf flags */
-#define M_EXT 0x0001 /* has associated external storage */
-#define M_PKTHDR 0x0002 /* start of record */
-#define M_EOR 0x0004 /* end of record */
-#define M_PROTO1 0x0008 /* protocol-specific */
-
-/* mbuf pkthdr flags, also in m_flags */
-#define M_BCAST 0x0100 /* send/received as link-level broadcast */
-#define M_MCAST 0x0200 /* send/received as link-level multicast */
-
-/* flags copied when copying m_pkthdr */
-#define M_COPYFLAGS (M_PKTHDR|M_EOR|M_PROTO1|M_BCAST|M_MCAST)
-
-/* mbuf types */
-#define MT_FREE 0 /* should be on free list */
-#define MT_DATA 1 /* dynamic (data) allocation */
-#define MT_HEADER 2 /* packet header */
-#define MT_SOCKET 3 /* socket structure */
-#define MT_PCB 4 /* protocol control block */
-#define MT_RTABLE 5 /* routing tables */
-#define MT_HTABLE 6 /* IMP host tables */
-#define MT_ATABLE 7 /* address resolution tables */
-#define MT_SONAME 8 /* socket name */
-#define MT_SOOPTS 10 /* socket options */
-#define MT_FTABLE 11 /* fragment reassembly header */
-#define MT_RIGHTS 12 /* access rights */
-#define MT_IFADDR 13 /* interface address */
-#define MT_CONTROL 14 /* extra-data protocol message */
-#define MT_OOBDATA 15 /* expedited data */
-
-/* flags to m_get/MGET */
-#define M_DONTWAIT M_NOWAIT
-#define M_WAIT M_WAITOK
-
-/* Freelists:
- *
- * Normal mbuf clusters are normally treated as character arrays
- * after allocation, but use the first word of the buffer as a free list
- * pointer while on the free list.
- */
-union mcluster {
- union mcluster *mcl_next;
- char mcl_buf[MCLBYTES];
-};
-
-/*
- * mbuf utility macros:
- *
- * MBUFLOCK(code)
- * prevents a section of code from from being interrupted by network
- * drivers.
- */
-#define MBUFLOCK(code) \
- { int ms = splimp(); \
- { code } \
- splx(ms); \
- }
-
-/*
- * mbuf allocation/deallocation macros:
- *
- * MGET(struct mbuf *m, int how, int type)
- * allocates an mbuf and initializes it to contain internal data.
- *
- * MGETHDR(struct mbuf *m, int how, int type)
- * allocates an mbuf and initializes it to contain a packet header
- * and internal data.
- */
-#define MGET(m, how, type) { \
- int _ms = splimp(); \
- if (mmbfree == 0) \
- (void)m_mballoc(1, (how)); \
- if (((m) = mmbfree) != 0) { \
- mmbfree = (m)->m_next; \
- mbstat.m_mtypes[MT_FREE]--; \
- (m)->m_type = (type); \
- mbstat.m_mtypes[type]++; \
- (m)->m_next = (struct mbuf *)NULL; \
- (m)->m_nextpkt = (struct mbuf *)NULL; \
- (m)->m_data = (m)->m_dat; \
- (m)->m_flags = 0; \
- splx(_ms); \
- } else { \
- splx(_ms); \
- (m) = m_retry((how), (type)); \
- } \
-}
-
-#define MGETHDR(m, how, type) { \
- int _ms = splimp(); \
- if (mmbfree == 0) \
- (void)m_mballoc(1, (how)); \
- if (((m) = mmbfree) != 0) { \
- mmbfree = (m)->m_next; \
- mbstat.m_mtypes[MT_FREE]--; \
- (m)->m_type = (type); \
- mbstat.m_mtypes[type]++; \
- (m)->m_next = (struct mbuf *)NULL; \
- (m)->m_nextpkt = (struct mbuf *)NULL; \
- (m)->m_data = (m)->m_pktdat; \
- (m)->m_flags = M_PKTHDR; \
- splx(_ms); \
- } else { \
- splx(_ms); \
- (m) = m_retryhdr((how), (type)); \
- } \
-}
-
-/*
- * Mbuf cluster macros.
- * MCLALLOC(caddr_t p, int how) allocates an mbuf cluster.
- * MCLGET adds such clusters to a normal mbuf;
- * the flag M_EXT is set upon success.
- * MCLFREE releases a reference to a cluster allocated by MCLALLOC,
- * freeing the cluster if the reference count has reached 0.
- */
-#define MCLALLOC(p, how) \
- MBUFLOCK( \
- if (mclfree == 0) \
- (void)m_clalloc(1, (how)); \
- if (((p) = (caddr_t)mclfree) != 0) { \
- ++mclrefcnt[mtocl(p)]; \
- mbstat.m_clfree--; \
- mclfree = ((union mcluster *)(p))->mcl_next; \
- } \
- )
-
-#define MCLGET(m, how) \
- { MCLALLOC((m)->m_ext.ext_buf, (how)); \
- if ((m)->m_ext.ext_buf != NULL) { \
- (m)->m_data = (m)->m_ext.ext_buf; \
- (m)->m_flags |= M_EXT; \
- (m)->m_ext.ext_free = NULL; \
- (m)->m_ext.ext_ref = NULL; \
- (m)->m_ext.ext_size = MCLBYTES; \
- } \
- }
-
-#define MCLFREE(p) \
- MBUFLOCK ( \
- if (--mclrefcnt[mtocl(p)] == 0) { \
- ((union mcluster *)(p))->mcl_next = mclfree; \
- mclfree = (union mcluster *)(p); \
- mbstat.m_clfree++; \
- } \
- )
-
-/*
- * MFREE(struct mbuf *m, struct mbuf *n)
- * Free a single mbuf and associated external storage.
- * Place the successor, if any, in n.
- */
-#define MFREE(m, n) \
- MBUFLOCK( \
- mbstat.m_mtypes[(m)->m_type]--; \
- if ((m)->m_flags & M_EXT) { \
- if ((m)->m_ext.ext_free) \
- (*((m)->m_ext.ext_free))((m)->m_ext.ext_buf, \
- (m)->m_ext.ext_size); \
- else { \
- char *p = (m)->m_ext.ext_buf; \
- if (--mclrefcnt[mtocl(p)] == 0) { \
- ((union mcluster *)(p))->mcl_next = mclfree; \
- mclfree = (union mcluster *)(p); \
- mbstat.m_clfree++; \
- } \
- } \
- } \
- (n) = (m)->m_next; \
- (m)->m_type = MT_FREE; \
- mbstat.m_mtypes[MT_FREE]++; \
- (m)->m_next = mmbfree; \
- mmbfree = (m); \
- )
-
-/*
- * Copy mbuf pkthdr from from to to.
- * from must have M_PKTHDR set, and to must be empty.
- */
-#define M_COPY_PKTHDR(to, from) { \
- (to)->m_pkthdr = (from)->m_pkthdr; \
- (to)->m_flags = (from)->m_flags & M_COPYFLAGS; \
- (to)->m_data = (to)->m_pktdat; \
-}
-
-/*
- * Set the m_data pointer of a newly-allocated mbuf (m_get/MGET) to place
- * an object of the specified size at the end of the mbuf, longword aligned.
- */
-#define M_ALIGN(m, len) \
- { (m)->m_data += (MLEN - (len)) &~ (sizeof(long) - 1); }
-/*
- * As above, for mbufs allocated with m_gethdr/MGETHDR
- * or initialized by M_COPY_PKTHDR.
- */
-#define MH_ALIGN(m, len) \
- { (m)->m_data += (MHLEN - (len)) &~ (sizeof(long) - 1); }
-
-/*
- * Compute the amount of space available
- * before the current start of data in an mbuf.
- */
-#define M_LEADINGSPACE(m) \
- ((m)->m_flags & M_EXT ? /* (m)->m_data - (m)->m_ext.ext_buf */ 0 : \
- (m)->m_flags & M_PKTHDR ? (m)->m_data - (m)->m_pktdat : \
- (m)->m_data - (m)->m_dat)
-
-/*
- * Compute the amount of space available
- * after the end of data in an mbuf.
- */
-#define M_TRAILINGSPACE(m) \
- ((m)->m_flags & M_EXT ? (m)->m_ext.ext_buf + (m)->m_ext.ext_size - \
- ((m)->m_data + (m)->m_len) : \
- &(m)->m_dat[MLEN] - ((m)->m_data + (m)->m_len))
-
-/*
- * Arrange to prepend space of size plen to mbuf m.
- * If a new mbuf must be allocated, how specifies whether to wait.
- * If how is M_DONTWAIT and allocation fails, the original mbuf chain
- * is freed and m is set to NULL.
- */
-#define M_PREPEND(m, plen, how) { \
- if (M_LEADINGSPACE(m) >= (plen)) { \
- (m)->m_data -= (plen); \
- (m)->m_len += (plen); \
- } else \
- (m) = m_prepend((m), (plen), (how)); \
- if ((m) && (m)->m_flags & M_PKTHDR) \
- (m)->m_pkthdr.len += (plen); \
-}
-
-/* change mbuf to new type */
-#define MCHTYPE(m, t) { \
- MBUFLOCK(mbstat.m_mtypes[(m)->m_type]--; mbstat.m_mtypes[t]++;) \
- (m)->m_type = t;\
-}
-
-/* length to m_copy to copy all */
-#define M_COPYALL 1000000000
-
-/* compatibility with 4.3 */
-#define m_copy(m, o, l) m_copym((m), (o), (l), M_DONTWAIT)
-
-/*
- * Mbuf statistics.
- */
-struct mbstat {
- u_long m_mbufs; /* mbufs obtained from page pool */
- u_long m_clusters; /* clusters obtained from page pool */
- u_long m_spare; /* spare field */
- u_long m_clfree; /* free clusters */
- u_long m_drops; /* times failed to find space */
- u_long m_wait; /* times waited for space */
- u_long m_drain; /* times drained protocols for space */
- u_short m_mtypes[256]; /* type specific mbuf allocations */
-};
-
-#ifdef KERNEL
-extern struct mbuf *mbutl; /* virtual address of mclusters */
-extern char *mclrefcnt; /* cluster reference counts */
-extern struct mbstat mbstat;
-extern int nmbclusters;
-extern int nmbufs;
-extern struct mbuf *mmbfree;
-extern union mcluster *mclfree;
-extern int max_linkhdr; /* largest link-level header */
-extern int max_protohdr; /* largest protocol header */
-extern int max_hdr; /* largest link+protocol header */
-extern int max_datalen; /* MHLEN - max_hdr */
-extern int mbtypes[]; /* XXX */
-
-struct mbuf *m_copym __P((struct mbuf *, int, int, int));
-struct mbuf *m_copypacket __P((struct mbuf *, int));
-struct mbuf *m_devget __P((char *, int, int, struct ifnet *,
- void (*copy)(char *, caddr_t, u_int)));
-struct mbuf *m_free __P((struct mbuf *));
-struct mbuf *m_get __P((int, int));
-struct mbuf *m_getclr __P((int, int));
-struct mbuf *m_gethdr __P((int, int));
-struct mbuf *m_prepend __P((struct mbuf *,int,int));
-struct mbuf *m_pullup __P((struct mbuf *, int));
-struct mbuf *m_retry __P((int, int));
-struct mbuf *m_retryhdr __P((int, int));
-struct mbuf *m_split __P((struct mbuf *,int,int));
-void m_adj __P((struct mbuf *, int));
-void m_cat __P((struct mbuf *,struct mbuf *));
-int m_mballoc __P((int, int));
-int m_clalloc __P((int, int));
-void m_copyback __P((struct mbuf *, int, int, caddr_t));
-void m_copydata __P((struct mbuf *,int,int,caddr_t));
-void m_freem __P((struct mbuf *));
-
-#ifdef MBTYPES
-int mbtypes[] = { /* XXX */
- M_FREE, /* MT_FREE 0 should be on free list */
- M_MBUF, /* MT_DATA 1 dynamic (data) allocation */
- M_MBUF, /* MT_HEADER 2 packet header */
- M_SOCKET, /* MT_SOCKET 3 socket structure */
- M_PCB, /* MT_PCB 4 protocol control block */
- M_RTABLE, /* MT_RTABLE 5 routing tables */
- M_HTABLE, /* MT_HTABLE 6 IMP host tables */
- 0, /* MT_ATABLE 7 address resolution tables */
- M_MBUF, /* MT_SONAME 8 socket name */
- 0, /* 9 */
- M_SOOPTS, /* MT_SOOPTS 10 socket options */
- M_FTABLE, /* MT_FTABLE 11 fragment reassembly header */
- M_MBUF, /* MT_RIGHTS 12 access rights */
- M_IFADDR, /* MT_IFADDR 13 interface address */
- M_MBUF, /* MT_CONTROL 14 extra-data protocol message */
- M_MBUF, /* MT_OOBDATA 15 expedited data */
-#ifdef DATAKIT
- 25, 26, 27, 28, 29, 30, 31, 32 /* datakit ugliness */
-#endif
-};
-#endif
-#endif
-
-#endif /* !_SYS_MBUF_H_ */
diff --git a/c/src/exec/libnetworking/sys/mount.h b/c/src/exec/libnetworking/sys/mount.h
deleted file mode 100644
index a6254e302d..0000000000
--- a/c/src/exec/libnetworking/sys/mount.h
+++ /dev/null
@@ -1,531 +0,0 @@
-/*
- * Copyright (c) 1989, 1991, 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.
- *
- * @(#)mount.h 8.13 (Berkeley) 3/27/94
- * $Id$
- */
-
-#ifndef _SYS_MOUNT_H_
-#define _SYS_MOUNT_H_
-
-#ifndef KERNEL
-#include <sys/ucred.h>
-#endif
-#include <sys/queue.h>
-
-typedef struct fsid { long val[2]; } fsid_t; /* file system id type */
-
-/*
- * File identifier.
- * These are unique per filesystem on a single machine.
- */
-#define MAXFIDSZ 16
-
-struct fid {
- u_short fid_len; /* length of data in bytes */
- u_short fid_reserved; /* force longword alignment */
- char fid_data[MAXFIDSZ]; /* data (variable length) */
-};
-
-/*
- * file system statistics
- */
-
-#define MNAMELEN 90 /* length of buffer for returned name */
-
-struct statfs {
- long f_spare2; /* placeholder */
- long f_bsize; /* fundamental file system block size */
- long f_iosize; /* optimal transfer block size */
- long f_blocks; /* total data blocks in file system */
- long f_bfree; /* free blocks in fs */
- long f_bavail; /* free blocks avail to non-superuser */
- long f_files; /* total file nodes in file system */
- long f_ffree; /* free file nodes in fs */
- fsid_t f_fsid; /* file system id */
- uid_t f_owner; /* user that mounted the filesystem */
- int f_type; /* type of filesystem (see below) */
- int f_flags; /* copy of mount flags */
- long f_spare[6]; /* spare for later */
- char f_mntonname[MNAMELEN]; /* directory on which mounted */
- char f_mntfromname[MNAMELEN];/* mounted filesystem */
-};
-
-/*
- * File system types.
- */
-#define MOUNT_NONE 0
-#define MOUNT_UFS 1 /* Fast Filesystem */
-#define MOUNT_NFS 2 /* Sun-compatible Network Filesystem */
-#define MOUNT_MFS 3 /* Memory-based Filesystem */
-#define MOUNT_MSDOS 4 /* MS/DOS Filesystem */
-#define MOUNT_LFS 5 /* Log-based Filesystem */
-#define MOUNT_LOFS 6 /* Loopback Filesystem */
-#define MOUNT_FDESC 7 /* File Descriptor Filesystem */
-#define MOUNT_PORTAL 8 /* Portal Filesystem */
-#define MOUNT_NULL 9 /* Minimal Filesystem Layer */
-#define MOUNT_UMAP 10 /* User/Group Identifier Remapping Filesystem */
-#define MOUNT_KERNFS 11 /* Kernel Information Filesystem */
-#define MOUNT_PROCFS 12 /* /proc Filesystem */
-#define MOUNT_AFS 13 /* Andrew Filesystem */
-#define MOUNT_CD9660 14 /* ISO9660 (aka CDROM) Filesystem */
-#define MOUNT_UNION 15 /* Union (translucent) Filesystem */
-#define MOUNT_DEVFS 16 /* existing device Filesystem */
-#define MOUNT_EXT2FS 17 /* Linux EXT2FS */
-#define MOUNT_TFS 18 /* Netcon Novell filesystem */
-#define MOUNT_CFS 19 /* Coda filesystem */
-#define MOUNT_MAXTYPE 19
-
-#define INITMOUNTNAMES { \
- "none", /* 0 MOUNT_NONE */ \
- "ufs", /* 1 MOUNT_UFS */ \
- "nfs", /* 2 MOUNT_NFS */ \
- "mfs", /* 3 MOUNT_MFS */ \
- "msdos", /* 4 MOUNT_MSDOS */ \
- "lfs", /* 5 MOUNT_LFS */ \
- "lofs", /* 6 MOUNT_LOFS */ \
- "fdesc", /* 7 MOUNT_FDESC */ \
- "portal", /* 8 MOUNT_PORTAL */ \
- "null", /* 9 MOUNT_NULL */ \
- "umap", /* 10 MOUNT_UMAP */ \
- "kernfs", /* 11 MOUNT_KERNFS */ \
- "procfs", /* 12 MOUNT_PROCFS */ \
- "afs", /* 13 MOUNT_AFS */ \
- "cd9660", /* 14 MOUNT_CD9660 */ \
- "union", /* 15 MOUNT_UNION */ \
- "devfs", /* 16 MOUNT_DEVFS */ \
- "ext2fs", /* 17 MOUNT_EXT2FS */ \
- "tfs", /* 18 MOUNT_TFS */ \
- "cfs", /* 19 MOUNT_CFS */ \
- 0, /* 20 MOUNT_SPARE */ \
-}
-
-/*
- * Structure per mounted file system. Each mounted file system has an
- * array of operations and an instance record. The file systems are
- * put on a doubly linked list.
- */
-LIST_HEAD(vnodelst, vnode);
-
-struct mount {
- CIRCLEQ_ENTRY(mount) mnt_list; /* mount list */
- struct vfsops *mnt_op; /* operations on fs */
- struct vfsconf *mnt_vfc; /* configuration info */
- struct vnode *mnt_vnodecovered; /* vnode we mounted on */
- struct vnodelst mnt_vnodelist; /* list of vnodes this mount */
- int mnt_flag; /* flags */
- int mnt_maxsymlinklen; /* max size of short symlink */
- struct statfs mnt_stat; /* cache of filesystem stats */
- qaddr_t mnt_data; /* private data */
-/* struct vfsconf *mnt_vfc; */ /* configuration info */
- time_t mnt_time; /* last time written*/
-};
-
-/*
- * Mount flags.
- *
- * Unmount uses MNT_FORCE flag.
- */
-#define MNT_RDONLY 0x00000001 /* read only filesystem */
-#define MNT_SYNCHRONOUS 0x00000002 /* file system written synchronously */
-#define MNT_NOEXEC 0x00000004 /* can't exec from filesystem */
-#define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */
-#define MNT_NODEV 0x00000010 /* don't interpret special files */
-#define MNT_UNION 0x00000020 /* union with underlying filesystem */
-#define MNT_ASYNC 0x00000040 /* file system written asynchronously */
-#define MNT_NOATIME 0x10000000 /* Disable update of file access times */
-
-/*
- * exported mount flags.
- */
-#define MNT_EXRDONLY 0x00000080 /* exported read only */
-#define MNT_EXPORTED 0x00000100 /* file system is exported */
-#define MNT_DEFEXPORTED 0x00000200 /* exported to the world */
-#define MNT_EXPORTANON 0x00000400 /* use anon uid mapping for everyone */
-#define MNT_EXKERB 0x00000800 /* exported with Kerberos uid mapping */
-
-/*
- * Flags set by internal operations.
- */
-#define MNT_LOCAL 0x00001000 /* filesystem is stored locally */
-#define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */
-#define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */
-#define MNT_USER 0x00008000 /* mounted by a user */
-
-/*
- * Mask of flags that are visible to statfs()
- */
-#define MNT_VISFLAGMASK (MNT_RDONLY|MNT_SYNCHRONOUS|MNT_NOEXEC|MNT_NOSUID| \
- MNT_NODEV|MNT_UNION|MNT_ASYNC|MNT_EXRDONLY|MNT_EXPORTED| \
- MNT_DEFEXPORTED|MNT_EXPORTANON|MNT_EXKERB|MNT_LOCAL| \
- MNT_QUOTA|MNT_ROOTFS|MNT_USER|MNT_NOATIME)
-
-/*
- * filesystem control flags.
- *
- * MNT_MLOCK lock the mount entry so that name lookup cannot proceed
- * past the mount point. This keeps the subtree stable during mounts
- * and unmounts.
- */
-#define MNT_UPDATE 0x00010000 /* not a real mount, just an update */
-#define MNT_DELEXPORT 0x00020000 /* delete export host lists */
-#define MNT_RELOAD 0x00040000 /* reload filesystem data */
-#define MNT_FORCE 0x00080000 /* force unmount or readonly change */
-#define MNT_MLOCK 0x00100000 /* lock so that subtree is stable */
-#define MNT_MWAIT 0x00200000 /* someone is waiting for lock */
-#define MNT_MPBUSY 0x00400000 /* scan of mount point in progress */
-#define MNT_MPWANT 0x00800000 /* waiting for mount point */
-#define MNT_UNMOUNT 0x01000000 /* unmount in progress */
-#define MNT_WANTRDWR 0x02000000 /* want upgrade to read/write */
-
-/*
- * used to get configured filesystems information
- */
-#define VFS_MAXNAMELEN 32
-struct vfsconf {
- void *vfc_vfsops;
- char vfc_name[VFS_MAXNAMELEN];
- int vfc_index;
- int vfc_refcount;
- int vfc_flags;
-};
-
-/*
- * NB: these flags refer to IMPLEMENTATION properties, not properties of
- * any actual mounts; i.e., it does not make sense to change the flags.
- */
-#define VFCF_STATIC 0x00000001 /* statically compiled into kernel */
-#define VFCF_NETWORK 0x00000002 /* may get data over the network */
-#define VFCF_READONLY 0x00000004 /* writes are not implemented */
-#define VFCF_SYNTHETIC 0x00000008 /* data does not represent real files */
-#define VFCF_LOOPBACK 0x00000010 /* aliases some other mounted FS */
-#define VFCF_UNICODE 0x00000020 /* stores file names as Unicode*/
-
-/*
- * Operations supported on mounted file system.
- */
-#ifdef KERNEL
-
-extern int doforce; /* Flag to permit forcible unmounting. */
-extern struct vfsconf void_vfsconf;
-extern struct vfsconf *vfsconf[];
-
-#ifdef __STDC__
-struct nameidata;
-struct mbuf;
-#endif
-
-struct vfsops {
- int (*vfs_mount) __P((struct mount *mp, char *path, caddr_t data,
- struct nameidata *ndp, struct proc *p));
- int (*vfs_start) __P((struct mount *mp, int flags,
- struct proc *p));
- int (*vfs_unmount) __P((struct mount *mp, int mntflags,
- struct proc *p));
- int (*vfs_root) __P((struct mount *mp, struct vnode **vpp));
- int (*vfs_quotactl) __P((struct mount *mp, int cmds, uid_t uid,
- caddr_t arg, struct proc *p));
- int (*vfs_statfs) __P((struct mount *mp, struct statfs *sbp,
- struct proc *p));
- int (*vfs_sync) __P((struct mount *mp, int waitfor,
- struct ucred *cred, struct proc *p));
- int (*vfs_vget) __P((struct mount *mp, ino_t ino,
- struct vnode **vpp));
- int (*vfs_fhtovp) __P((struct mount *mp, struct fid *fhp,
- struct mbuf *nam, struct vnode **vpp,
- int *exflagsp, struct ucred **credanonp));
- int (*vfs_vptofh) __P((struct vnode *vp, struct fid *fhp));
- int (*vfs_init) __P((void));
-};
-
-#define VFS_MOUNT(MP, PATH, DATA, NDP, P) \
- (*(MP)->mnt_op->vfs_mount)(MP, PATH, DATA, NDP, P)
-#define VFS_START(MP, FLAGS, P) (*(MP)->mnt_op->vfs_start)(MP, FLAGS, P)
-#define VFS_UNMOUNT(MP, FORCE, P) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE, P)
-#define VFS_ROOT(MP, VPP) (*(MP)->mnt_op->vfs_root)(MP, VPP)
-#define VFS_QUOTACTL(MP,C,U,A,P) (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A, P)
-#define VFS_STATFS(MP, SBP, P) (*(MP)->mnt_op->vfs_statfs)(MP, SBP, P)
-#define VFS_SYNC(MP, WAIT, C, P) (*(MP)->mnt_op->vfs_sync)(MP, WAIT, C, P)
-#define VFS_VGET(MP, INO, VPP) (*(MP)->mnt_op->vfs_vget)(MP, INO, VPP)
-#define VFS_FHTOVP(MP, FIDP, NAM, VPP, EXFLG, CRED) \
- (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, NAM, VPP, EXFLG, CRED)
-#define VFS_VPTOFH(VP, FIDP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP)
-
-#ifdef VFS_LKM
-#include <sys/conf.h>
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-#define VFS_SET(vfsops, fsname, index, flags) \
- static struct vfsconf _fs_vfsconf = { \
- &vfsops, \
- #fsname, \
- index, \
- 0, \
- flags \
- }; \
- extern struct linker_set MODVNOPS; \
- MOD_VFS(#fsname,index,&MODVNOPS,&_fs_vfsconf); \
- int \
- fsname ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \
- DISPATCH(lkmtp, cmd, ver, lkm_nullcmd, lkm_nullcmd, lkm_nullcmd); }
-#else
-
-#define VFS_SET(vfsops, fsname, index, flags) \
- static struct vfsconf _fs_vfsconf = { \
- &vfsops, \
- #fsname, \
- index, \
- 0, \
- flags | VFCF_STATIC \
- }; \
- DATA_SET(vfs_set,_fs_vfsconf)
-#endif /* VFS_LKM */
-
-#endif /* KERNEL */
-
-/*
- * Flags for various system call interfaces.
- *
- * waitfor flags to vfs_sync() and getfsstat()
- */
-#define MNT_WAIT 1
-#define MNT_NOWAIT 2
-
-/*
- * Generic file handle
- */
-struct fhandle {
- fsid_t fh_fsid; /* File system id of mount point */
- struct fid fh_fid; /* File sys specific id */
-};
-typedef struct fhandle fhandle_t;
-
-#ifdef KERNEL
-#include <net/radix.h>
-#include <sys/socket.h> /* XXX for AF_MAX */
-
-/*
- * Network address lookup element
- */
-struct netcred {
- struct radix_node netc_rnodes[2];
- int netc_exflags;
- struct ucred netc_anon;
-};
-
-/*
- * Network export information
- */
-struct netexport {
- struct netcred ne_defexported; /* Default export */
- struct radix_node_head *ne_rtable[AF_MAX+1]; /* Individual exports */
-};
-#endif /* KERNEL */
-
-/*
- * Export arguments for local filesystem mount calls.
- */
-struct export_args {
- int ex_flags; /* export related flags */
- uid_t ex_root; /* mapping for root uid */
- struct ucred ex_anon; /* mapping for anonymous user */
- struct sockaddr *ex_addr; /* net address to which exported */
- int ex_addrlen; /* and the net address length */
- struct sockaddr *ex_mask; /* mask of valid bits in saddr */
- int ex_masklen; /* and the smask length */
-};
-
-/*
- * Arguments to mount UFS-based filesystems
- */
-struct ufs_args {
- char *fspec; /* block special device to mount */
- struct export_args export; /* network export information */
-};
-
-#ifdef MFS
-/*
- * Arguments to mount MFS
- */
-struct mfs_args {
- char *fspec; /* name to export for statfs */
- struct export_args export; /* if exported MFSes are supported */
- caddr_t base; /* base of file system in memory */
- u_long size; /* size of file system */
-};
-#endif /* MFS */
-
-#ifdef MSDOSFS
-/*
- * Arguments to mount MSDOS filesystems.
- */
-struct msdosfs_args {
- char *fspec; /* blocks special holding the fs to mount */
- struct export_args export; /* network export information */
- uid_t uid; /* uid that owns msdosfs files */
- gid_t gid; /* gid that owns msdosfs files */
- mode_t mask; /* mask to be applied for msdosfs perms */
-};
-#endif
-
-#ifdef CD9660
-/*
- * Arguments to mount ISO 9660 filesystems.
- */
-struct iso_args {
- char *fspec; /* block special device to mount */
- struct export_args export; /* network export info */
- int flags; /* mounting flags, see below */
- int ssector; /* starting sector */
-
-};
-#define ISOFSMNT_NORRIP 0x00000001 /* disable Rock Ridge Ext.*/
-#define ISOFSMNT_GENS 0x00000002 /* enable generation numbers */
-#define ISOFSMNT_EXTATT 0x00000004 /* enable extended attributes */
-#endif /* CD9660 */
-
-#ifdef NFS
-/*
- * Arguments to mount NFS
- */
-struct nfs_args {
- struct sockaddr *addr; /* file server address */
- int addrlen; /* length of address */
- int sotype; /* Socket type */
- int proto; /* and Protocol */
- u_char *fh; /* File handle to be mounted */
- int fhsize; /* Size, in bytes, of fh */
- int flags; /* flags */
- int wsize; /* write size in bytes */
- int rsize; /* read size in bytes */
- int readdirsize; /* readdir size in bytes */
- int timeo; /* initial timeout in .1 secs */
- int retrans; /* times to retry send */
- int maxgrouplist; /* Max. size of group list */
- int readahead; /* # of blocks to readahead */
- int leaseterm; /* Term (sec) of lease */
- int deadthresh; /* Retrans threshold */
- char *hostname; /* server's name */
-};
-
-/*
- * NFS mount option flags
- */
-#define NFSMNT_SOFT 0x00000001 /* soft mount (hard is default) */
-#define NFSMNT_WSIZE 0x00000002 /* set write size */
-#define NFSMNT_RSIZE 0x00000004 /* set read size */
-#define NFSMNT_TIMEO 0x00000008 /* set initial timeout */
-#define NFSMNT_RETRANS 0x00000010 /* set number of request retrys */
-#define NFSMNT_MAXGRPS 0x00000020 /* set maximum grouplist size */
-#define NFSMNT_INT 0x00000040 /* allow interrupts on hard mount */
-#define NFSMNT_NOCONN 0x00000080 /* Don't Connect the socket */
-#define NFSMNT_NQNFS 0x00000100 /* Use Nqnfs protocol */
-#define NFSMNT_NFSV3 0x00000200 /* Use NFS Version 3 protocol */
-#define NFSMNT_KERB 0x00000400 /* Use Kerberos authentication */
-#define NFSMNT_DUMBTIMR 0x00000800 /* Don't estimate rtt dynamically */
-#define NFSMNT_LEASETERM 0x00001000 /* set lease term (nqnfs) */
-#define NFSMNT_READAHEAD 0x00002000 /* set read ahead */
-#define NFSMNT_DEADTHRESH 0x00004000 /* set dead server retry thresh */
-#define NFSMNT_RESVPORT 0x00008000 /* Allocate a reserved port */
-#define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */
-#define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */
-#define NFSMNT_INTERNAL 0xfffc0000 /* Bits set internally */
-#define NFSMNT_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */
-#define NFSMNT_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */
-#define NFSMNT_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */
-#define NFSMNT_MNTD 0x00200000 /* Mnt server for mnt point */
-#define NFSMNT_DISMINPROG 0x00400000 /* Dismount in progress */
-#define NFSMNT_DISMNT 0x00800000 /* Dismounted */
-#define NFSMNT_SNDLOCK 0x01000000 /* Send socket lock */
-#define NFSMNT_WANTSND 0x02000000 /* Want above */
-#define NFSMNT_RCVLOCK 0x04000000 /* Rcv socket lock */
-#define NFSMNT_WANTRCV 0x08000000 /* Want above */
-#define NFSMNT_WAITAUTH 0x10000000 /* Wait for authentication */
-#define NFSMNT_HASAUTH 0x20000000 /* Has authenticator */
-#define NFSMNT_WANTAUTH 0x40000000 /* Wants an authenticator */
-#define NFSMNT_AUTHERR 0x80000000 /* Authentication error */
-#endif /* NFS */
-
-#ifdef KERNEL
-extern int (*mountroot) __P((void *));
-extern struct vfsops *mountrootvfsops;
-
-/*
- * exported vnode operations
- */
-int dounmount __P((struct mount *, int, struct proc *));
-struct mount *getvfs __P((fsid_t *)); /* return vfs given fsid */
-void getnewfsid __P((struct mount *, int));
-int vflush __P((struct mount *, struct vnode *, int));
-int vfs_export /* process mount export info */
- __P((struct mount *, struct netexport *, struct export_args *));
-struct netcred *vfs_export_lookup /* lookup host in fs export list */
- __P((struct mount *, struct netexport *, struct mbuf *));
-int vfs_lock __P((struct mount *)); /* lock a vfs */
-int vfs_mountedon __P((struct vnode *)); /* is a vfs mounted on vp */
-int vfs_mountroot __P((void *)); /* XXX goes away? */
-void vfs_msync __P((struct mount *, int));
-void vfs_unlock __P((struct mount *)); /* unlock a vfs */
-void vfs_unmountall __P((void));
-int vfs_busy __P((struct mount *)); /* mark a vfs busy */
-void vfs_unbusy __P((struct mount *)); /* mark a vfs not busy */
-extern CIRCLEQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */
-extern struct vfsops *vfssw[]; /* filesystem type table */
-
-#else /* KERNEL */
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int fstatfs __P((int, struct statfs *));
-int getfh __P((const char *, fhandle_t *));
-int getfsstat __P((struct statfs *, long, int));
-int getmntinfo __P((struct statfs **, int));
-int mount __P((int, const char *, int, void *));
-int statfs __P((const char *, struct statfs *));
-int unmount __P((const char *, int));
-
-/* C library stuff */
-struct vfsconf *getvfsbyname __P((const char *));
-struct vfsconf *getvfsbytype __P((int));
-struct vfsconf *getvfsent __P((void));
-void setvfsent __P((int));
-void endvfsent __P((void));
-int vfsisloadable __P((const char *));
-int vfsload __P((const char *));
-__END_DECLS
-
-#endif /* KERNEL */
-
-#endif /* !_SYS_MOUNT_H_ */
diff --git a/c/src/exec/libnetworking/sys/param.h b/c/src/exec/libnetworking/sys/param.h
deleted file mode 100644
index 21a9758520..0000000000
--- a/c/src/exec/libnetworking/sys/param.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)param.h 8.3 (Berkeley) 4/4/95
- * $Id$
- */
-
-#ifndef _SYS_PARAM_H_
-#define _SYS_PARAM_H_
-
-#include <unistd.h>
-
-#define BSD 199506 /* System version (year & month). */
-#define BSD4_3 1
-#define BSD4_4 1
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef LOCORE
-#include <sys/types.h>
-#endif
-
-/*
- * Machine-independent constants (some used in following include files).
- * Redefined constants are from POSIX 1003.1 limits file.
- *
- * MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>)
- * MAXLOGNAME should be >= UT_NAMESIZE (see <utmp.h>)
- */
-#include <sys/syslimits.h>
-
-#define MAXCOMLEN 16 /* max command name remembered */
-#define MAXINTERP 32 /* max interpreter file name length */
-#define MAXLOGNAME 12 /* max login name length */
-#define MAXUPRC CHILD_MAX /* max simultaneous processes */
-#define NCARGS ARG_MAX /* max bytes for an exec function */
-#define NGROUPS NGROUPS_MAX /* max number groups */
-#define NOFILE OPEN_MAX /* max open files per process */
-#define NOGROUP 65535 /* marker for empty group set member */
-#define MAXHOSTNAMELEN 256 /* max hostname size */
-
-/* More types and definitions used throughout the kernel. */
-#ifdef KERNEL
-#include <sys/cdefs.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/ucred.h>
-#include <sys/uio.h>
-#include <sys/rtprio.h>
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-#endif
-
-/* Signals. */
-#include <sys/signal.h>
-
-/* Machine type dependent parameters. */
-#include <machine/param.h>
-#include <machine/limits.h>
-
-/*
- * Priorities. Note that with 32 run queues, differences less than 4 are
- * insignificant.
- */
-#define PSWP 0
-#define PVM 4
-#define PINOD 8
-#define PRIBIO 16
-#define PVFS 20
-#define PZERO 22 /* No longer magic, shouldn't be here. XXX */
-#define PSOCK 24
-#define PWAIT 32
-#define PLOCK 36
-#define PPAUSE 40
-#define PUSER 50
-#define MAXPRI 127 /* Priorities range from 0 through MAXPRI. */
-
-#define PRIMASK 0x0ff
-#define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */
-
-#define NZERO 0 /* default "nice" */
-
-#define NBPW sizeof(int) /* number of bytes per word (integer) */
-
-#define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */
-#define NODEV (dev_t)(-1) /* non-existent device */
-
-/*
- * Clustering of hardware pages on machines with ridiculously small
- * page sizes is done here. The paging subsystem deals with units of
- * CLSIZE pte's describing PAGE_SIZE (from machine/machparam.h) pages each.
- */
-#if 0
-#define CLBYTES (CLSIZE*PAGE_SIZE)
-#endif
-
-#define CBLOCK 128 /* Clist block size, must be a power of 2. */
-#define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */
- /* Data chars/clist. */
-#define CBSIZE (CBLOCK - sizeof(struct cblock *) - CBQSIZE)
-#define CROUND (CBLOCK - 1) /* Clist rounding. */
-
-/*
- * File system parameters and macros.
- *
- * The file system is made out of blocks of at most MAXBSIZE units, with
- * smaller units (fragments) only in the last direct block. MAXBSIZE
- * primarily determines the size of buffers in the buffer pool. It may be
- * made larger without any effect on existing file systems; however making
- * it smaller make make some file systems unmountable. Also, MAXBSIZE
- * must be less than MAXPHYS!!! DFLTBSIZE is the average amount of
- * memory allocated by vfs_bio per nbuf. BKVASIZE is the average amount
- * of kernel virtual space allocated per nbuf. BKVASIZE should be >=
- * DFLTBSIZE. If it is significantly bigger than DFLTBSIZE, then
- * kva fragmentation causes fewer performance problems.
- */
-#define MAXBSIZE 65536
-#define BKVASIZE 8192
-#define DFLTBSIZE 4096
-#define MAXFRAG 8
-
-/*
- * MAXPATHLEN defines the longest permissible path length after expanding
- * symbolic links. It is used to allocate a temporary buffer from the buffer
- * pool in which to do the name expansion, hence should be a power of two,
- * and must be less than or equal to MAXBSIZE. MAXSYMLINKS defines the
- * maximum number of symbolic links that may be expanded in a path name.
- * It should be set high enough to allow all legitimate uses, but halt
- * infinite loops reasonably quickly.
- */
-#if !defined(__rtems__)
-#define MAXPATHLEN PATH_MAX
-#endif
-#define MAXSYMLINKS 32
-
-/* Bit map related macros. */
-#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
-#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
-#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
-#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
-
-/* Macros for counting and rounding. */
-#ifndef howmany
-#define howmany(x, y) (((x)+((y)-1))/(y))
-#endif
-#define rounddown(x, y) (((x)/(y))*(y))
-#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */
-#define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */
-#define powerof2(x) ((((x)-1)&(x))==0)
-
-/* Macros for min/max. */
-#ifndef KERNEL
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#endif
-
-/*
- * Constants for setting the parameters of the kernel memory allocator.
- *
- * 2 ** MINBUCKET is the smallest unit of memory that will be
- * allocated. It must be at least large enough to hold a pointer.
- *
- * Units of memory less or equal to MAXALLOCSAVE will permanently
- * allocate physical memory; requests for these size pieces of
- * memory are quite fast. Allocations greater than MAXALLOCSAVE must
- * always allocate and free physical memory; requests for these
- * size allocations should be done infrequently as they will be slow.
- *
- * Constraints: PAGE_SIZE <= MAXALLOCSAVE <= 2 ** (MINBUCKET + 14), and
- * MAXALLOCSIZE must be a power of two.
- */
-#define MINBUCKET 4 /* 4 => min allocation of 16 bytes */
-#define MAXALLOCSAVE (2 * PAGE_SIZE)
-
-/*
- * Scale factor for scaled integers used to count %cpu time and load avgs.
- *
- * The number of CPU `tick's that map to a unique `%age' can be expressed
- * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that
- * can be calculated (assuming 32 bits) can be closely approximated using
- * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15).
- *
- * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age',
- * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024.
- */
-#define FSHIFT 11 /* bits to right of fixed binary point */
-#define FSCALE (1<<FSHIFT)
-
-#endif /* _SYS_PARAM_H_ */
diff --git a/c/src/exec/libnetworking/sys/proc.h b/c/src/exec/libnetworking/sys/proc.h
deleted file mode 100644
index 2189a33b11..0000000000
--- a/c/src/exec/libnetworking/sys/proc.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Dummy structure
- *
- * $Id$
- */
-struct proc {
- int this_should_never_be_referenced;
-};
diff --git a/c/src/exec/libnetworking/sys/protosw.h b/c/src/exec/libnetworking/sys/protosw.h
deleted file mode 100644
index a7aa52feea..0000000000
--- a/c/src/exec/libnetworking/sys/protosw.h
+++ /dev/null
@@ -1,300 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)protosw.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_PROTOSW_H_
-#define _SYS_PROTOSW_H_
-
-struct ifnet;
-struct mbuf;
-struct sockaddr;
-struct socket;
-struct sockproto;
-struct stat;
-
-/*
- * Protocol switch table.
- *
- * Each protocol has a handle initializing one of these structures,
- * which is used for protocol-protocol and system-protocol communication.
- *
- * A protocol is called through the pr_init entry before any other.
- * Thereafter it is called every 200ms through the pr_fasttimo entry and
- * every 500ms through the pr_slowtimo for timer based actions.
- * The system will call the pr_drain entry if it is low on space and
- * this should throw away any non-critical data.
- *
- * Protocols pass data between themselves as chains of mbufs using
- * the pr_input and pr_output hooks. Pr_input passes data up (towards
- * UNIX) and pr_output passes it down (towards the imps); control
- * information passes up and down on pr_ctlinput and pr_ctloutput.
- * The protocol is responsible for the space occupied by any the
- * arguments to these entries and must dispose it.
- *
- * The userreq routine interfaces protocols to the system and is
- * described below.
- */
-struct protosw {
- short pr_type; /* socket type used for */
- struct domain *pr_domain; /* domain protocol a member of */
- short pr_protocol; /* protocol number */
- short pr_flags; /* see below */
-/* protocol-protocol hooks */
- void (*pr_input) __P((struct mbuf *, int len));
- /* input to protocol (from below) */
- int (*pr_output) __P((struct mbuf *m, struct socket *so));
- /* output to protocol (from above) */
- void (*pr_ctlinput)__P((int, struct sockaddr *, void *));
- /* control input (from below) */
- int (*pr_ctloutput)__P((int, struct socket *, int, int,
- struct mbuf **));
- /* control output (from above) */
-/* user-protocol hook */
- int (*pr_ousrreq) __P((struct socket *, int, struct mbuf *,
- struct mbuf *, struct mbuf *));
- /* user request: see list below */
-/* utility hooks */
- void (*pr_init) __P((void)); /* initialization hook */
- void (*pr_fasttimo) __P((void));
- /* fast timeout (200ms) */
- void (*pr_slowtimo) __P((void));
- /* slow timeout (500ms) */
- void (*pr_drain) __P((void));
- /* flush any excess space possible */
- struct pr_usrreqs *pr_usrreqs; /* supersedes pr_usrreq() */
-};
-
-#define PR_SLOWHZ 2 /* 2 slow timeouts per second */
-#define PR_FASTHZ 5 /* 5 fast timeouts per second */
-
-/*
- * Values for pr_flags.
- * PR_ADDR requires PR_ATOMIC;
- * PR_ADDR and PR_CONNREQUIRED are mutually exclusive.
- * PR_IMPLOPCL means that the protocol allows sendto without prior connect,
- * and the protocol understands the MSG_EOF flag. The first property is
- * is only relevant if PR_CONNREQUIRED is set (otherwise sendto is allowed
- * anyhow).
- */
-#define PR_ATOMIC 0x01 /* exchange atomic messages only */
-#define PR_ADDR 0x02 /* addresses given with messages */
-#define PR_CONNREQUIRED 0x04 /* connection required by protocol */
-#define PR_WANTRCVD 0x08 /* want PRU_RCVD calls */
-#define PR_RIGHTS 0x10 /* passes capabilities */
-#define PR_IMPLOPCL 0x20 /* implied open/close */
-
-/*
- * The arguments to usrreq are:
- * (*protosw[].pr_usrreq)(up, req, m, nam, opt);
- * where up is a (struct socket *), req is one of these requests,
- * m is a optional mbuf chain containing a message,
- * nam is an optional mbuf chain containing an address,
- * and opt is a pointer to a socketopt structure or nil.
- * The protocol is responsible for disposal of the mbuf chain m,
- * the caller is responsible for any space held by nam and opt.
- * A non-zero return from usrreq gives an
- * UNIX error number which should be passed to higher level software.
- */
-#define PRU_ATTACH 0 /* attach protocol to up */
-#define PRU_DETACH 1 /* detach protocol from up */
-#define PRU_BIND 2 /* bind socket to address */
-#define PRU_LISTEN 3 /* listen for connection */
-#define PRU_CONNECT 4 /* establish connection to peer */
-#define PRU_ACCEPT 5 /* accept connection from peer */
-#define PRU_DISCONNECT 6 /* disconnect from peer */
-#define PRU_SHUTDOWN 7 /* won't send any more data */
-#define PRU_RCVD 8 /* have taken data; more room now */
-#define PRU_SEND 9 /* send this data */
-#define PRU_ABORT 10 /* abort (fast DISCONNECT, DETATCH) */
-#define PRU_CONTROL 11 /* control operations on protocol */
-#define PRU_SENSE 12 /* return status into m */
-#define PRU_RCVOOB 13 /* retrieve out of band data */
-#define PRU_SENDOOB 14 /* send out of band data */
-#define PRU_SOCKADDR 15 /* fetch socket's address */
-#define PRU_PEERADDR 16 /* fetch peer's address */
-#define PRU_CONNECT2 17 /* connect two sockets */
-/* begin for protocols internal use */
-#define PRU_FASTTIMO 18 /* 200ms timeout */
-#define PRU_SLOWTIMO 19 /* 500ms timeout */
-#define PRU_PROTORCV 20 /* receive from below */
-#define PRU_PROTOSEND 21 /* send to below */
-/* end for protocol's internal use */
-#define PRU_SEND_EOF 22 /* send and close */
-#define PRU_NREQ 22
-
-#ifdef PRUREQUESTS
-char *prurequests[] = {
- "ATTACH", "DETACH", "BIND", "LISTEN",
- "CONNECT", "ACCEPT", "DISCONNECT", "SHUTDOWN",
- "RCVD", "SEND", "ABORT", "CONTROL",
- "SENSE", "RCVOOB", "SENDOOB", "SOCKADDR",
- "PEERADDR", "CONNECT2", "FASTTIMO", "SLOWTIMO",
- "PROTORCV", "PROTOSEND",
- "SEND_EOF",
-};
-#endif
-
-#ifdef KERNEL /* users shouldn't see this decl */
-struct stat;
-struct ifnet;
-
-/*
- * If the ordering here looks odd, that's because it's alphabetical.
- */
-struct pr_usrreqs {
- int (*pru_abort) __P((struct socket *so));
- int (*pru_accept) __P((struct socket *so, struct mbuf *nam));
- int (*pru_attach) __P((struct socket *so, int proto));
- int (*pru_bind) __P((struct socket *so, struct mbuf *nam));
- int (*pru_connect) __P((struct socket *so, struct mbuf *nam));
- int (*pru_connect2) __P((struct socket *so1, struct socket *so2));
- int (*pru_control) __P((struct socket *so, int cmd, caddr_t data,
- struct ifnet *ifp));
- int (*pru_detach) __P((struct socket *so));
- int (*pru_disconnect) __P((struct socket *so));
- int (*pru_listen) __P((struct socket *so));
- int (*pru_peeraddr) __P((struct socket *so, struct mbuf *nam));
- int (*pru_rcvd) __P((struct socket *so, int flags));
- int (*pru_rcvoob) __P((struct socket *so, struct mbuf *m,
- int flags));
- /*
- * The `m' parameter here is almost certainly going to become a
- * `struct uio' at some point in the future. Similar changes
- * will probably happen for the receive entry points.
- */
- int (*pru_send) __P((struct socket *so, int flags, struct mbuf *m,
- struct mbuf *addr, struct mbuf *control));
-#define PRUS_OOB 0x1
-#define PRUS_EOF 0x2
- int (*pru_sense) __P((struct socket *so, struct stat *sb));
- int (*pru_shutdown) __P((struct socket *so));
- int (*pru_sockaddr) __P((struct socket *so, struct mbuf *nam));
-};
-
-int pru_accept_notsupp __P((struct socket *so, struct mbuf *nam));
-int pru_connect2_notsupp __P((struct socket *so1, struct socket *so2));
-int pru_control_notsupp __P((struct socket *so, int cmd, caddr_t data,
- struct ifnet *ifp));
-int pru_listen_notsupp __P((struct socket *so));
-int pru_rcvd_notsupp __P((struct socket *so, int flags));
-int pru_rcvoob_notsupp __P((struct socket *so, struct mbuf *m, int flags));
-int pru_sense_null __P((struct socket *so, struct stat *sb));
-
-#define PRU_OLDSTYLE
-
-#ifdef PRU_OLDSTYLE
-/*
- * Protocols which don't yet implement pr_usrreqs can point it to this
- * structure, which will call the old pr_usrreq() entry point with the
- * appropriate arguments.
- */
-extern struct pr_usrreqs pru_oldstyle;
-#endif /* PRU_OLDSTYLE */
-
-#endif /* KERNEL */
-
-/*
- * The arguments to the ctlinput routine are
- * (*protosw[].pr_ctlinput)(cmd, sa, arg);
- * where cmd is one of the commands below, sa is a pointer to a sockaddr,
- * and arg is a `void *' argument used within a protocol family.
- */
-#define PRC_IFDOWN 0 /* interface transition */
-#define PRC_ROUTEDEAD 1 /* select new route if possible ??? */
-#define PRC_QUENCH2 3 /* DEC congestion bit says slow down */
-#define PRC_QUENCH 4 /* some one said to slow down */
-#define PRC_MSGSIZE 5 /* message size forced drop */
-#define PRC_HOSTDEAD 6 /* host appears to be down */
-#define PRC_HOSTUNREACH 7 /* deprecated (use PRC_UNREACH_HOST) */
-#define PRC_UNREACH_NET 8 /* no route to network */
-#define PRC_UNREACH_HOST 9 /* no route to host */
-#define PRC_UNREACH_PROTOCOL 10 /* dst says bad protocol */
-#define PRC_UNREACH_PORT 11 /* bad port # */
-/* was PRC_UNREACH_NEEDFRAG 12 (use PRC_MSGSIZE) */
-#define PRC_UNREACH_SRCFAIL 13 /* source route failed */
-#define PRC_REDIRECT_NET 14 /* net routing redirect */
-#define PRC_REDIRECT_HOST 15 /* host routing redirect */
-#define PRC_REDIRECT_TOSNET 16 /* redirect for type of service & net */
-#define PRC_REDIRECT_TOSHOST 17 /* redirect for tos & host */
-#define PRC_TIMXCEED_INTRANS 18 /* packet lifetime expired in transit */
-#define PRC_TIMXCEED_REASS 19 /* lifetime expired on reass q */
-#define PRC_PARAMPROB 20 /* header incorrect */
-
-#define PRC_NCMDS 21
-
-#define PRC_IS_REDIRECT(cmd) \
- ((cmd) >= PRC_REDIRECT_NET && (cmd) <= PRC_REDIRECT_TOSHOST)
-
-#ifdef PRCREQUESTS
-char *prcrequests[] = {
- "IFDOWN", "ROUTEDEAD", "#2", "DEC-BIT-QUENCH2",
- "QUENCH", "MSGSIZE", "HOSTDEAD", "#7",
- "NET-UNREACH", "HOST-UNREACH", "PROTO-UNREACH", "PORT-UNREACH",
- "#12", "SRCFAIL-UNREACH", "NET-REDIRECT", "HOST-REDIRECT",
- "TOSNET-REDIRECT", "TOSHOST-REDIRECT", "TX-INTRANS", "TX-REASS",
- "PARAMPROB"
-};
-#endif
-
-/*
- * The arguments to ctloutput are:
- * (*protosw[].pr_ctloutput)(req, so, level, optname, optval);
- * req is one of the actions listed below, so is a (struct socket *),
- * level is an indication of which protocol layer the option is intended.
- * optname is a protocol dependent socket option request,
- * optval is a pointer to a mbuf-chain pointer, for value-return results.
- * The protocol is responsible for disposal of the mbuf chain *optval
- * if supplied,
- * the caller is responsible for any space held by *optval, when returned.
- * A non-zero return from usrreq gives an
- * UNIX error number which should be passed to higher level software.
- */
-#define PRCO_GETOPT 0
-#define PRCO_SETOPT 1
-
-#define PRCO_NCMDS 2
-
-#ifdef PRCOREQUESTS
-char *prcorequests[] = {
- "GETOPT", "SETOPT",
-};
-#endif
-
-#ifdef KERNEL
-struct protosw *pffindproto __P((int family, int protocol, int type));
-struct protosw *pffindtype __P((int family, int type));
-#endif
-
-#endif
diff --git a/c/src/exec/libnetworking/sys/queue.h b/c/src/exec/libnetworking/sys/queue.h
deleted file mode 100644
index e8aa08cf5d..0000000000
--- a/c/src/exec/libnetworking/sys/queue.h
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * Copyright (c) 1991, 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.
- *
- * @(#)queue.h 8.5 (Berkeley) 8/20/94
- * $Id$
- */
-
-#ifndef _SYS_QUEUE_H_
-#define _SYS_QUEUE_H_
-
-/*
- * This file defines five types of data structures: singly-linked lists,
- * slingly-linked tail queues, lists, tail queues, and circular queues.
- *
- * A singly-linked list is headed by a single forward pointer. The elements
- * are singly linked for minimum space and pointer manipulation overhead at
- * the expense of O(n) removal for arbitrary elements. New elements can be
- * added to the list after an existing element or at the head of the list.
- * Elements being removed from the head of the list should use the explicit
- * macro for this purpose for optimum efficiency. A singly-linked list may
- * only be traversed in the forward direction. Singly-linked lists are ideal
- * for applications with large datasets and few or no removals or for
- * implementing a LIFO queue.
- *
- * A singly-linked tail queue is headed by a pair of pointers, one to the
- * head of the list and the other to the tail of the list. The elements are
- * singly linked for minimum space and pointer manipulation overhead at the
- * expense of O(n) removal for arbitrary elements. New elements can be added
- * to the list after an existing element, at the head of the list, or at the
- * end of the list. Elements being removed from the head of the tail queue
- * should use the explicit macro for this purpose for optimum efficiency.
- * A singly-linked tail queue may only be traversed in the forward direction.
- * Singly-linked tail queues are ideal for applications with large datasets
- * and few or no removals or for implementing a FIFO queue.
- *
- * A list is headed by a single forward pointer (or an array of forward
- * pointers for a hash table header). The elements are doubly linked
- * so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before
- * or after an existing element or at the head of the list. A list
- * may only be traversed in the forward direction.
- *
- * A tail queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or
- * after an existing element, at the head of the list, or at the end of
- * the list. A tail queue may only be traversed in the forward direction.
- *
- * A circle queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or after
- * an existing element, at the head of the list, or at the end of the list.
- * A circle queue may be traversed in either direction, but has a more
- * complex end of list detection.
- *
- * For details on the use of these macros, see the queue(3) manual page.
- */
-
-/*
- * Singly-linked List definitions.
- */
-#define SLIST_HEAD(name, type) \
-struct name { \
- struct type *slh_first; /* first element */ \
-}
-
-#define SLIST_ENTRY(type) \
-struct { \
- struct type *sle_next; /* next element */ \
-}
-
-/*
- * Singly-linked List functions.
- */
-#define SLIST_INIT(head) { \
- (head)->slh_first = NULL; \
-}
-
-#define SLIST_INSERT_AFTER(slistelm, elm, field) { \
- (elm)->field.sle_next = (slistelm)->field.sle_next; \
- (slistelm)->field.sle_next = (elm); \
-}
-
-#define SLIST_INSERT_HEAD(head, elm, field) { \
- (elm)->field.sle_next = (head)->slh_first; \
- (head)->slh_first = (elm); \
-}
-
-#define SLIST_REMOVE_HEAD(head, field) { \
- (head)->slh_first = (head)->slh_first->field.sle_next; \
-}
-
-#define SLIST_REMOVE(head, elm, type, field) { \
- if ((head)->slh_first == (elm)) { \
- SLIST_REMOVE_HEAD((head), field); \
- } \
- else { \
- struct type *curelm = (head)->slh_first; \
- while( curelm->field.sle_next != (elm) ) \
- curelm = curelm->field.sle_next; \
- curelm->field.sle_next = \
- curelm->field.sle_next->field.sle_next; \
- } \
-}
-
-/*
- * Singly-linked Tail queue definitions.
- */
-#define STAILQ_HEAD(name, type) \
-struct name { \
- struct type *stqh_first;/* first element */ \
- struct type **stqh_last;/* addr of last next element */ \
-}
-
-#define STAILQ_ENTRY(type) \
-struct { \
- struct type *stqe_next; /* next element */ \
-}
-
-/*
- * Singly-linked Tail queue functions.
- */
-#define STAILQ_INIT(head) { \
- (head)->stqh_first = NULL; \
- (head)->stqh_last = &(head)->stqh_first; \
-}
-
-#define STAILQ_INSERT_HEAD(head, elm, field) { \
- if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
- (head)->stqh_last = &(elm)->field.stqe_next; \
- (head)->stqh_first = (elm); \
-}
-
-#define STAILQ_INSERT_TAIL(head, elm, field) { \
- (elm)->field.stqe_next = NULL; \
- *(head)->stqh_last = (elm); \
- (head)->stqh_last = &(elm)->field.stqe_next; \
-}
-
-#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) { \
- if (((elm)->field.stqe_next = (tqelm)->field.stqe_next) == NULL)\
- (head)->stqh_last = &(elm)->field.stqe_next; \
- (tqelm)->field.stqe_next = (elm); \
-}
-
-#define STAILQ_REMOVE_HEAD(head, field) { \
- if (((head)->stqh_first = \
- (head)->stqh_first->field.stqe_next) == NULL) \
- (head)->stqh_last = &(head)->stqh_first; \
-}
-
-#define STAILQ_REMOVE(head, elm, type, field) { \
- if ((head)->stqh_first == (elm)) { \
- STAILQ_REMOVE_HEAD(head, field); \
- } \
- else { \
- struct type *curelm = (head)->stqh_first; \
- while( curelm->field.stqe_next != (elm) ) \
- curelm = curelm->field.stqe_next; \
- if((curelm->field.stqe_next = \
- curelm->field.stqe_next->field.stqe_next) == NULL) \
- (head)->stqh_last = &(curelm)->field.stqe_next; \
- } \
-}
-
-/*
- * List definitions.
- */
-#define LIST_HEAD(name, type) \
-struct name { \
- struct type *lh_first; /* first element */ \
-}
-
-#define LIST_ENTRY(type) \
-struct { \
- struct type *le_next; /* next element */ \
- struct type **le_prev; /* address of previous next element */ \
-}
-
-/*
- * List functions.
- */
-#define LIST_INIT(head) { \
- (head)->lh_first = NULL; \
-}
-
-#define LIST_INSERT_AFTER(listelm, elm, field) { \
- if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
- (listelm)->field.le_next->field.le_prev = \
- &(elm)->field.le_next; \
- (listelm)->field.le_next = (elm); \
- (elm)->field.le_prev = &(listelm)->field.le_next; \
-}
-
-#define LIST_INSERT_BEFORE(listelm, elm, field) { \
- (elm)->field.le_prev = (listelm)->field.le_prev; \
- (elm)->field.le_next = (listelm); \
- *(listelm)->field.le_prev = (elm); \
- (listelm)->field.le_prev = &(elm)->field.le_next; \
-}
-
-#define LIST_INSERT_HEAD(head, elm, field) { \
- if (((elm)->field.le_next = (head)->lh_first) != NULL) \
- (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
- (head)->lh_first = (elm); \
- (elm)->field.le_prev = &(head)->lh_first; \
-}
-
-#define LIST_REMOVE(elm, field) { \
- if ((elm)->field.le_next != NULL) \
- (elm)->field.le_next->field.le_prev = \
- (elm)->field.le_prev; \
- *(elm)->field.le_prev = (elm)->field.le_next; \
-}
-
-/*
- * Tail queue definitions.
- */
-#define TAILQ_HEAD(name, type) \
-struct name { \
- struct type *tqh_first; /* first element */ \
- struct type **tqh_last; /* addr of last next element */ \
-}
-
-#define TAILQ_HEAD_INITIALIZER(head) \
- { NULL, &(head).tqh_first }
-
-#define TAILQ_ENTRY(type) \
-struct { \
- struct type *tqe_next; /* next element */ \
- struct type **tqe_prev; /* address of previous next element */ \
-}
-
-/*
- * Tail queue functions.
- */
-#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
-
-#define TAILQ_FIRST(head) ((head)->tqh_first)
-
-#define TAILQ_LAST(head) ((head)->tqh_last)
-
-#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
-
-#define TAILQ_PREV(elm, field) ((elm)->field.tqe_prev)
-
-#define TAILQ_INIT(head) { \
- (head)->tqh_first = NULL; \
- (head)->tqh_last = &(head)->tqh_first; \
-}
-
-#define TAILQ_INSERT_HEAD(head, elm, field) { \
- if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
- (head)->tqh_first->field.tqe_prev = \
- &(elm)->field.tqe_next; \
- else \
- (head)->tqh_last = &(elm)->field.tqe_next; \
- (head)->tqh_first = (elm); \
- (elm)->field.tqe_prev = &(head)->tqh_first; \
-}
-
-#define TAILQ_INSERT_TAIL(head, elm, field) { \
- (elm)->field.tqe_next = NULL; \
- (elm)->field.tqe_prev = (head)->tqh_last; \
- *(head)->tqh_last = (elm); \
- (head)->tqh_last = &(elm)->field.tqe_next; \
-}
-
-#define TAILQ_INSERT_AFTER(head, listelm, elm, field) { \
- if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
- (elm)->field.tqe_next->field.tqe_prev = \
- &(elm)->field.tqe_next; \
- else \
- (head)->tqh_last = &(elm)->field.tqe_next; \
- (listelm)->field.tqe_next = (elm); \
- (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
-}
-
-#define TAILQ_INSERT_BEFORE(listelm, elm, field) { \
- (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
- (elm)->field.tqe_next = (listelm); \
- *(listelm)->field.tqe_prev = (elm); \
- (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
-}
-
-#define TAILQ_REMOVE(head, elm, field) { \
- if (((elm)->field.tqe_next) != NULL) \
- (elm)->field.tqe_next->field.tqe_prev = \
- (elm)->field.tqe_prev; \
- else \
- (head)->tqh_last = (elm)->field.tqe_prev; \
- *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
-}
-
-/*
- * Circular queue definitions.
- */
-#define CIRCLEQ_HEAD(name, type) \
-struct name { \
- struct type *cqh_first; /* first element */ \
- struct type *cqh_last; /* last element */ \
-}
-
-#define CIRCLEQ_ENTRY(type) \
-struct { \
- struct type *cqe_next; /* next element */ \
- struct type *cqe_prev; /* previous element */ \
-}
-
-/*
- * Circular queue functions.
- */
-#define CIRCLEQ_INIT(head) { \
- (head)->cqh_first = (void *)(head); \
- (head)->cqh_last = (void *)(head); \
-}
-
-#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) { \
- (elm)->field.cqe_next = (listelm)->field.cqe_next; \
- (elm)->field.cqe_prev = (listelm); \
- if ((listelm)->field.cqe_next == (void *)(head)) \
- (head)->cqh_last = (elm); \
- else \
- (listelm)->field.cqe_next->field.cqe_prev = (elm); \
- (listelm)->field.cqe_next = (elm); \
-}
-
-#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) { \
- (elm)->field.cqe_next = (listelm); \
- (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
- if ((listelm)->field.cqe_prev == (void *)(head)) \
- (head)->cqh_first = (elm); \
- else \
- (listelm)->field.cqe_prev->field.cqe_next = (elm); \
- (listelm)->field.cqe_prev = (elm); \
-}
-
-#define CIRCLEQ_INSERT_HEAD(head, elm, field) { \
- (elm)->field.cqe_next = (head)->cqh_first; \
- (elm)->field.cqe_prev = (void *)(head); \
- if ((head)->cqh_last == (void *)(head)) \
- (head)->cqh_last = (elm); \
- else \
- (head)->cqh_first->field.cqe_prev = (elm); \
- (head)->cqh_first = (elm); \
-}
-
-#define CIRCLEQ_INSERT_TAIL(head, elm, field) { \
- (elm)->field.cqe_next = (void *)(head); \
- (elm)->field.cqe_prev = (head)->cqh_last; \
- if ((head)->cqh_first == (void *)(head)) \
- (head)->cqh_first = (elm); \
- else \
- (head)->cqh_last->field.cqe_next = (elm); \
- (head)->cqh_last = (elm); \
-}
-
-#define CIRCLEQ_REMOVE(head, elm, field) { \
- if ((elm)->field.cqe_next == (void *)(head)) \
- (head)->cqh_last = (elm)->field.cqe_prev; \
- else \
- (elm)->field.cqe_next->field.cqe_prev = \
- (elm)->field.cqe_prev; \
- if ((elm)->field.cqe_prev == (void *)(head)) \
- (head)->cqh_first = (elm)->field.cqe_next; \
- else \
- (elm)->field.cqe_prev->field.cqe_next = \
- (elm)->field.cqe_next; \
-}
-
-#ifdef KERNEL
-
-/*
- * XXX insque() and remque() are an old way of handling certain queues.
- * They bogusly assumes that all queue heads look alike.
- */
-
-struct quehead {
- struct quehead *qh_link;
- struct quehead *qh_rlink;
-};
-
-#ifdef __GNUC__
-
-static __inline void
-insque(void *a, void *b)
-{
- struct quehead *element = a, *head = b;
-
- element->qh_link = head->qh_link;
- element->qh_rlink = head;
- head->qh_link = element;
- element->qh_link->qh_rlink = element;
-}
-
-static __inline void
-remque(void *a)
-{
- struct quehead *element = a;
-
- element->qh_link->qh_rlink = element->qh_rlink;
- element->qh_rlink->qh_link = element->qh_link;
- element->qh_rlink = 0;
-}
-
-#else /* !__GNUC__ */
-
-void insque __P((void *a, void *b));
-void remque __P((void *a));
-
-#endif /* __GNUC__ */
-
-#endif /* KERNEL */
-
-#endif /* !_SYS_QUEUE_H_ */
diff --git a/c/src/exec/libnetworking/sys/reboot.h b/c/src/exec/libnetworking/sys/reboot.h
deleted file mode 100644
index 48a7f0f782..0000000000
--- a/c/src/exec/libnetworking/sys/reboot.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1993, 1994
- * 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.
- *
- * @(#)reboot.h 8.3 (Berkeley) 12/13/94
- * $Id$
- */
-
-#ifndef _SYS_REBOOT_H_
-#define _SYS_REBOOT_H_
-
-/*
- * Arguments to reboot system call. These are passed to
- * the boot program and on to init.
- */
-#define RB_AUTOBOOT 0 /* flags for system auto-booting itself */
-
-#define RB_ASKNAME 0x001 /* ask for file name to reboot from */
-#define RB_SINGLE 0x002 /* reboot to single user only */
-#define RB_NOSYNC 0x004 /* dont sync before reboot */
-#define RB_HALT 0x008 /* don't reboot, just halt */
-#define RB_INITNAME 0x010 /* name given for /etc/init (unused) */
-#define RB_DFLTROOT 0x020 /* use compiled-in rootdev */
-#define RB_KDB 0x040 /* give control to kernel debugger */
-#define RB_RDONLY 0x080 /* mount root fs read-only */
-#define RB_DUMP 0x100 /* dump kernel memory before reboot */
-#define RB_MINIROOT 0x200 /* mini-root present in memory at boot time */
-#define RB_CONFIG 0x400 /* invoke user configuration routing */
-#define RB_VERBOSE 0x800 /* print all potentially useful info */
-#define RB_SERIAL 0x1000 /* user serial port as console */
-#define RB_CDROM 0x2000 /* use cdrom as root */
-#define RB_POWEROFF 0x4000 /* if you can, turn the power off */
-#define RB_GDB 0x8000 /* use GDB remote debugger instead of DDB */
-#define RB_MUTE 0x10000 /* Come up with the console muted */
-#define RB_SELFTEST 0x20000 /* don't boot to normal operation, do selftest */
-
-#define RB_BOOTINFO 0x80000000 /* have `struct bootinfo *' arg */
-
-/*
- * Constants for converting boot-style device number to type,
- * adaptor (uba, mba, etc), unit number and partition number.
- * Type (== major device number) is in the low byte
- * for backward compatibility. Except for that of the "magic
- * number", each mask applies to the shifted value.
- * Format:
- * (4) (4) (4) (4) (8) (8)
- * --------------------------------
- * |MA | AD| CT| UN| PART | TYPE |
- * --------------------------------
- */
-#define B_ADAPTORSHIFT 24
-#define B_ADAPTORMASK 0x0f
-#define B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
-#define B_CONTROLLERSHIFT 20
-#define B_CONTROLLERMASK 0xf
-#define B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
-#define B_SLICESHIFT 20
-#define B_SLICEMASK 0xff
-#define B_SLICE(val) (((val)>>B_SLICESHIFT) & B_SLICEMASK)
-#define B_UNITSHIFT 16
-#define B_UNITMASK 0xf
-#define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK)
-#define B_PARTITIONSHIFT 8
-#define B_PARTITIONMASK 0xff
-#define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
-#define B_TYPESHIFT 0
-#define B_TYPEMASK 0xff
-#define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK)
-
-#define B_MAGICMASK 0xf0000000
-#define B_DEVMAGIC 0xa0000000
-
-#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
- (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
- ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
- ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
-
-#endif
diff --git a/c/src/exec/libnetworking/sys/resourcevar.h b/c/src/exec/libnetworking/sys/resourcevar.h
deleted file mode 100644
index 2b4c47e48f..0000000000
--- a/c/src/exec/libnetworking/sys/resourcevar.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
diff --git a/c/src/exec/libnetworking/sys/rtprio.h b/c/src/exec/libnetworking/sys/rtprio.h
deleted file mode 100644
index dd9521e7c8..0000000000
--- a/c/src/exec/libnetworking/sys/rtprio.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 1994, Henrik Vestergaard Draboel
- * 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 (name).
- * 4. 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 BY THE AUTHOR 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 AUTHOR 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.
- *
- * $Id$
- */
-
-#ifndef _SYS_RTPRIO_H_
-#define _SYS_RTPRIO_H_
-
-/*
- * Process realtime-priority specifications to rtprio.
- */
-
-/* priority types */
-#define RTP_PRIO_REALTIME 0
-#define RTP_PRIO_NORMAL 1
-#define RTP_PRIO_IDLE 2
-
-/* priority range */
-#define RTP_PRIO_MIN 0 /* Highest priority */
-#define RTP_PRIO_MAX 31 /* Lowest priority */
-
-/*
- * rtprio() syscall functions
- */
-#define RTP_LOOKUP 0
-#define RTP_SET 1
-
-#ifndef LOCORE
-struct rtprio {
- u_short type;
- u_short prio;
-};
-#endif
-
-#ifndef KERNEL
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int rtprio __P((int, pid_t, struct rtprio *));
-__END_DECLS
-#endif /* !KERNEL */
-#endif /* !_SYS_RTPRIO_H_ */
diff --git a/c/src/exec/libnetworking/sys/select.h b/c/src/exec/libnetworking/sys/select.h
deleted file mode 100644
index e69971e3b6..0000000000
--- a/c/src/exec/libnetworking/sys/select.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * 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.
- *
- * @(#)select.h 8.2 (Berkeley) 1/4/94
- * $Id$
- */
-
-#ifndef _SYS_SELECT_H_
-#define _SYS_SELECT_H_
-
-/*
- * Used to maintain information about processes that wish to be
- * notified when I/O becomes possible.
- */
-struct selinfo {
- pid_t si_pid; /* process to be notified */
- short si_flags; /* see below */
-};
-#define SI_COLL 0x0001 /* collision occurred */
-
-#ifdef KERNEL
-struct proc;
-
-void selrecord __P((struct proc *selector, struct selinfo *));
-void selwakeup __P((struct selinfo *));
-#endif
-
-#endif /* !_SYS_SELECT_H_ */
diff --git a/c/src/exec/libnetworking/sys/signalvar.h b/c/src/exec/libnetworking/sys/signalvar.h
deleted file mode 100644
index 8900458fdb..0000000000
--- a/c/src/exec/libnetworking/sys/signalvar.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 1991, 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.
- *
- * @(#)signalvar.h 8.6 (Berkeley) 2/19/95
- * $Id$
- */
-
-#ifndef _SYS_SIGNALVAR_H_ /* tmp for user.h */
-#define _SYS_SIGNALVAR_H_
-
-/*
- * Kernel signal definitions and data structures,
- * not exported to user programs.
- */
-
-/*
- * Process signal actions and state, needed only within the process
- * (not necessarily resident).
- */
-struct sigacts {
- sig_t ps_sigact[NSIG]; /* disposition of signals */
- sigset_t ps_catchmask[NSIG]; /* signals to be blocked */
- sigset_t ps_sigonstack; /* signals to take on sigstack */
- sigset_t ps_sigintr; /* signals that interrupt syscalls */
- sigset_t ps_sigreset; /* signals that reset when caught */
- sigset_t ps_signodefer; /* signals not masked while handled */
- sigset_t ps_oldmask; /* saved mask from before sigpause */
- int ps_flags; /* signal flags, below */
- struct sigaltstack ps_sigstk; /* sp & on stack state variable */
- int ps_sig; /* for core dump/debugger XXX */
- u_long ps_code; /* for core dump/debugger XXX */
- sigset_t ps_usertramp; /* SunOS compat; libc sigtramp XXX */
-};
-
-/* signal flags */
-#define SAS_OLDMASK 0x01 /* need to restore mask before pause */
-#define SAS_ALTSTACK 0x02 /* have alternate signal stack */
-
-/* additional signal action values, used only temporarily/internally */
-#define SIG_CATCH ((__sighandler_t *)2)
-#define SIG_HOLD ((__sighandler_t *)3)
-
-/*
- * get signal action for process and signal; currently only for current process
- */
-#define SIGACTION(p, sig) (p->p_sigacts->ps_sigact[(sig)])
-
-/*
- * Determine signal that should be delivered to process p, the current
- * process, 0 if none. If there is a pending stop signal with default
- * action, the process stops in issignal().
- */
-#define CURSIG(p) \
- (((p)->p_siglist == 0 || \
- (((p)->p_flag & P_TRACED) == 0 && \
- ((p)->p_siglist & ~(p)->p_sigmask) == 0)) ? \
- 0 : issignal(p))
-
-/*
- * Clear a pending signal from a process.
- */
-#define CLRSIG(p, sig) { (p)->p_siglist &= ~sigmask(sig); }
-
-/*
- * Signal properties and actions.
- * The array below categorizes the signals and their default actions
- * according to the following properties:
- */
-#define SA_KILL 0x01 /* terminates process by default */
-#define SA_CORE 0x02 /* ditto and coredumps */
-#define SA_STOP 0x04 /* suspend process */
-#define SA_TTYSTOP 0x08 /* ditto, from tty */
-#define SA_IGNORE 0x10 /* ignore by default */
-#define SA_CONT 0x20 /* continue if suspended */
-#define SA_CANTMASK 0x40 /* non-maskable, catchable */
-
-#ifdef SIGPROP
-static int sigprop[NSIG + 1] = {
- 0, /* unused */
- SA_KILL, /* SIGHUP */
- SA_KILL, /* SIGINT */
- SA_KILL|SA_CORE, /* SIGQUIT */
- SA_KILL|SA_CORE, /* SIGILL */
- SA_KILL|SA_CORE, /* SIGTRAP */
- SA_KILL|SA_CORE, /* SIGABRT */
- SA_KILL|SA_CORE, /* SIGEMT */
- SA_KILL|SA_CORE, /* SIGFPE */
- SA_KILL, /* SIGKILL */
- SA_KILL|SA_CORE, /* SIGBUS */
- SA_KILL|SA_CORE, /* SIGSEGV */
- SA_KILL|SA_CORE, /* SIGSYS */
- SA_KILL, /* SIGPIPE */
- SA_KILL, /* SIGALRM */
- SA_KILL, /* SIGTERM */
- SA_IGNORE, /* SIGURG */
- SA_STOP, /* SIGSTOP */
- SA_STOP|SA_TTYSTOP, /* SIGTSTP */
- SA_IGNORE|SA_CONT, /* SIGCONT */
- SA_IGNORE, /* SIGCHLD */
- SA_STOP|SA_TTYSTOP, /* SIGTTIN */
- SA_STOP|SA_TTYSTOP, /* SIGTTOU */
- SA_IGNORE, /* SIGIO */
- SA_KILL, /* SIGXCPU */
- SA_KILL, /* SIGXFSZ */
- SA_KILL, /* SIGVTALRM */
- SA_KILL, /* SIGPROF */
- SA_IGNORE, /* SIGWINCH */
- SA_IGNORE, /* SIGINFO */
- SA_KILL, /* SIGUSR1 */
- SA_KILL, /* SIGUSR2 */
-};
-
-#define contsigmask (sigmask(SIGCONT))
-#define stopsigmask (sigmask(SIGSTOP) | sigmask(SIGTSTP) | \
- sigmask(SIGTTIN) | sigmask(SIGTTOU))
-
-#endif /* SIGPROP */
-
-#define sigcantmask (sigmask(SIGKILL) | sigmask(SIGSTOP))
-
-#ifdef KERNEL
-/*
- * Machine-independent functions:
- */
-void execsigs __P((struct proc *p));
-void gsignal __P((int pgid, int sig));
-int issignal __P((struct proc *p));
-void killproc __P((struct proc *p, char *why));
-void pgsignal __P((struct pgrp *pgrp, int sig, int checkctty));
-void postsig __P((int sig));
-void psignal __P((struct proc *p, int sig));
-void setsigvec __P((struct proc *p, int signum, struct sigaction *sa));
-void sigexit __P((struct proc *p, int signum));
-void siginit __P((struct proc *p));
-void trapsignal __P((struct proc *p, int sig, u_long code));
-
-/*
- * Machine-dependent functions:
- */
-void sendsig __P((sig_t action, int sig, int returnmask, u_long code));
-#endif /* KERNEL */
-#endif /* !_SYS_SIGNALVAR_H_ */
diff --git a/c/src/exec/libnetworking/sys/socket.h b/c/src/exec/libnetworking/sys/socket.h
deleted file mode 100644
index 7e0f6c7572..0000000000
--- a/c/src/exec/libnetworking/sys/socket.h
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
- * 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.
- *
- * @(#)socket.h 8.4 (Berkeley) 2/21/94
- * $Id$
- */
-
-#ifndef _SYS_SOCKET_H_
-#define _SYS_SOCKET_H_
-
-/*
- * Definitions related to sockets: types, address families, options.
- */
-
-/*
- * Types
- */
-#define SOCK_STREAM 1 /* stream socket */
-#define SOCK_DGRAM 2 /* datagram socket */
-#define SOCK_RAW 3 /* raw-protocol interface */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */
-#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-#define SO_PRIVSTATE 0x1009 /* get/deny privileged state */
-
-/*
- * Structure used for manipulating linger option.
- */
-struct linger {
- int l_onoff; /* option on/off */
- int l_linger; /* linger time */
-};
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/*
- * Address families.
- */
-#define AF_UNSPEC 0 /* unspecified */
-#define AF_LOCAL 1 /* local to host (pipes, portals) */
-#define AF_UNIX AF_LOCAL /* backward compatibility */
-#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
-#define AF_IMPLINK 3 /* arpanet imp addresses */
-#define AF_PUP 4 /* pup protocols: e.g. BSP */
-#define AF_CHAOS 5 /* mit CHAOS protocols */
-#define AF_NS 6 /* XEROX NS protocols */
-#define AF_ISO 7 /* ISO protocols */
-#define AF_OSI AF_ISO
-#define AF_ECMA 8 /* European computer manufacturers */
-#define AF_DATAKIT 9 /* datakit protocols */
-#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
-#define AF_SNA 11 /* IBM SNA */
-#define AF_DECnet 12 /* DECnet */
-#define AF_DLI 13 /* DEC Direct data link interface */
-#define AF_LAT 14 /* LAT */
-#define AF_HYLINK 15 /* NSC Hyperchannel */
-#define AF_APPLETALK 16 /* Apple Talk */
-#define AF_ROUTE 17 /* Internal Routing Protocol */
-#define AF_LINK 18 /* Link layer interface */
-#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
-#define AF_COIP 20 /* connection-oriented IP, aka ST II */
-#define AF_CNT 21 /* Computer Network Technology */
-#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */
-#define AF_IPX 23 /* Novell Internet Protocol */
-#define AF_SIP 24 /* Simple Internet Protocol */
-#define pseudo_AF_PIP 25 /* Help Identify PIP packets */
-#define AF_ISDN 26 /* Integrated Services Digital Network*/
-#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */
-#define pseudo_AF_KEY 27 /* Internal key-management function */
-#define AF_INET6 28 /* IPv6 */
-
-#define AF_MAX 29
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- u_char sa_len; /* total length */
- u_char sa_family; /* address family */
- char sa_data[14]; /* actually longer; address value */
-};
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- u_short sp_family; /* address family */
- u_short sp_protocol; /* protocol */
-};
-
-/*
- * Protocol families, same as address families for now.
- */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_LOCAL AF_LOCAL
-#define PF_UNIX PF_LOCAL /* backward compatibility */
-#define PF_INET AF_INET
-#define PF_IMPLINK AF_IMPLINK
-#define PF_PUP AF_PUP
-#define PF_CHAOS AF_CHAOS
-#define PF_NS AF_NS
-#define PF_ISO AF_ISO
-#define PF_OSI AF_ISO
-#define PF_ECMA AF_ECMA
-#define PF_DATAKIT AF_DATAKIT
-#define PF_CCITT AF_CCITT
-#define PF_SNA AF_SNA
-#define PF_DECnet AF_DECnet
-#define PF_DLI AF_DLI
-#define PF_LAT AF_LAT
-#define PF_HYLINK AF_HYLINK
-#define PF_APPLETALK AF_APPLETALK
-#define PF_ROUTE AF_ROUTE
-#define PF_LINK AF_LINK
-#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
-#define PF_COIP AF_COIP
-#define PF_CNT AF_CNT
-#define PF_SIP AF_SIP
-#define PF_IPX AF_IPX /* same format as AF_NS */
-#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */
-#define PF_PIP pseudo_AF_PIP
-#define PF_ISDN AF_ISDN
-#define PF_KEY pseudo_AF_KEY
-#define PF_INET6 AF_INET6
-
-#define PF_MAX AF_MAX
-
-/*
- * Definitions for network related sysctl, CTL_NET.
- *
- * Second level is protocol family.
- * Third level is protocol number.
- *
- * Further levels are defined by the individual families below.
- */
-#define NET_MAXID AF_MAX
-
-#define CTL_NET_NAMES { \
- { 0, 0 }, \
- { "unix", CTLTYPE_NODE }, \
- { "inet", CTLTYPE_NODE }, \
- { "implink", CTLTYPE_NODE }, \
- { "pup", CTLTYPE_NODE }, \
- { "chaos", CTLTYPE_NODE }, \
- { "xerox_ns", CTLTYPE_NODE }, \
- { "iso", CTLTYPE_NODE }, \
- { "emca", CTLTYPE_NODE }, \
- { "datakit", CTLTYPE_NODE }, \
- { "ccitt", CTLTYPE_NODE }, \
- { "ibm_sna", CTLTYPE_NODE }, \
- { "decnet", CTLTYPE_NODE }, \
- { "dec_dli", CTLTYPE_NODE }, \
- { "lat", CTLTYPE_NODE }, \
- { "hylink", CTLTYPE_NODE }, \
- { "appletalk", CTLTYPE_NODE }, \
- { "route", CTLTYPE_NODE }, \
- { "link_layer", CTLTYPE_NODE }, \
- { "xtp", CTLTYPE_NODE }, \
- { "coip", CTLTYPE_NODE }, \
- { "cnt", CTLTYPE_NODE }, \
- { "rtip", CTLTYPE_NODE }, \
- { "ipx", CTLTYPE_NODE }, \
- { "sip", CTLTYPE_NODE }, \
- { "pip", CTLTYPE_NODE }, \
- { "isdn", CTLTYPE_NODE }, \
- { "key", CTLTYPE_NODE }, \
-}
-
-/*
- * PF_ROUTE - Routing table
- *
- * Three additional levels are defined:
- * Fourth: address family, 0 is wildcard
- * Fifth: type of info, defined below
- * Sixth: flag(s) to mask with for NET_RT_FLAGS
- */
-#define NET_RT_DUMP 1 /* dump; may limit to a.f. */
-#define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */
-#define NET_RT_IFLIST 3 /* survey interface list */
-#define NET_RT_MAXID 4
-
-#define CTL_NET_RT_NAMES { \
- { 0, 0 }, \
- { "dump", CTLTYPE_STRUCT }, \
- { "flags", CTLTYPE_STRUCT }, \
- { "iflist", CTLTYPE_STRUCT }, \
-}
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#define SOMAXCONN 128
-
-/*
- * Message header for recvmsg and sendmsg calls.
- * Used value-result for recvmsg, value only for sendmsg.
- */
-struct msghdr {
- caddr_t msg_name; /* optional address */
- u_int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- u_int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_control; /* ancillary data, see below */
- u_int msg_controllen; /* ancillary data buffer len */
- int msg_flags; /* flags on received message */
-};
-
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-#define MSG_EOR 0x8 /* data completes record */
-#define MSG_TRUNC 0x10 /* data discarded before delivery */
-#define MSG_CTRUNC 0x20 /* control data lost before delivery */
-#define MSG_WAITALL 0x40 /* wait for full request or error */
-#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */
-#define MSG_EOF 0x100 /* data completes connection */
-#define MSG_COMPAT 0x8000 /* used in sendit() */
-
-/*
- * Header for ancillary data objects in msg_control buffer.
- * Used for additional information with/about a datagram
- * not expressible by flags. The format is a sequence
- * of message elements headed by cmsghdr structures.
- */
-struct cmsghdr {
- u_int cmsg_len; /* data byte count, including hdr */
- int cmsg_level; /* originating protocol */
- int cmsg_type; /* protocol-specific type */
-/* followed by u_char cmsg_data[]; */
-};
-
-/* given pointer to struct cmsghdr, return pointer to data */
-#define CMSG_DATA(cmsg) ((u_char *)((cmsg) + 1))
-
-/* given pointer to struct cmsghdr, return pointer to next cmsghdr */
-#define CMSG_NXTHDR(mhdr, cmsg) \
- (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
- (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
- (struct cmsghdr *)NULL : \
- (struct cmsghdr *)((caddr_t)(cmsg) + ALIGN((cmsg)->cmsg_len)))
-
-#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
-
-/* "Socket"-level control message types: */
-#define SCM_RIGHTS 0x01 /* access rights (array of int) */
-#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */
-
-/*
- * 4.3 compat sockaddr, move to compat file later
- */
-struct osockaddr {
- u_short sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
-};
-
-/*
- * 4.3-compat message header (move to compat file later).
- */
-struct omsghdr {
- caddr_t msg_name; /* optional address */
- int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_accrights; /* access rights sent/received */
- int msg_accrightslen;
-};
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int accept __P((int, struct sockaddr *, int *));
-int bind __P((int, const struct sockaddr *, int));
-int connect __P((int, const struct sockaddr *, int));
-int getpeername __P((int, struct sockaddr *, int *));
-int getsockname __P((int, struct sockaddr *, int *));
-int getsockopt __P((int, int, int, void *, int *));
-int listen __P((int, int));
-ssize_t recv __P((int, void *, size_t, int));
-ssize_t recvfrom __P((int, void *, size_t, int, struct sockaddr *, int *));
-ssize_t recvmsg __P((int, struct msghdr *, int));
-ssize_t send __P((int, const void *, size_t, int));
-ssize_t sendto __P((int, const void *,
- size_t, int, const struct sockaddr *, int));
-ssize_t sendmsg __P((int, const struct msghdr *, int));
-int setsockopt __P((int, int, int, const void *, int));
-int shutdown __P((int, int));
-int socket __P((int, int, int));
-int socketpair __P((int, int, int, int *));
-__END_DECLS
-
-#else /* KERNEL */
-void pfctlinput __P((int, struct sockaddr *));
-#endif /* !KERNEL */
-#endif /* !_SYS_SOCKET_H_ */
diff --git a/c/src/exec/libnetworking/sys/socketvar.h b/c/src/exec/libnetworking/sys/socketvar.h
deleted file mode 100644
index 257fee012b..0000000000
--- a/c/src/exec/libnetworking/sys/socketvar.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 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.
- *
- * @(#)socketvar.h 8.3 (Berkeley) 2/19/95
- * $Id$
- */
-
-#ifndef _SYS_SOCKETVAR_H_
-#define _SYS_SOCKETVAR_H_
-
-#include <sys/queue.h> /* for TAILQ macros */
-#include <sys/select.h> /* for struct selinfo */
-
-/*
- * Kernel structure per socket.
- * Contains send and receive buffer queues,
- * handle on protocol and pointer to protocol
- * private data and error information.
- */
-struct socket {
- short so_type; /* generic type, see socket.h */
- short so_options; /* from socket call, see socket.h */
- short so_linger; /* time to linger while closing */
- short so_state; /* internal state flags SS_*, below */
- caddr_t so_pcb; /* protocol control block */
- struct protosw *so_proto; /* protocol handle */
-/*
- * Variables for connection queuing.
- * Socket where accepts occur is so_head in all subsidiary sockets.
- * If so_head is 0, socket is not related to an accept.
- * For head socket so_q0 queues partially completed connections,
- * while so_q is a queue of connections ready to be accepted.
- * If a connection is aborted and it has so_head set, then
- * it has to be pulled out of either so_q0 or so_q.
- * We allow connections to queue up based on current queue lengths
- * and limit on number of queued connections for this socket.
- */
- struct socket *so_head; /* back pointer to accept socket */
- TAILQ_HEAD(, socket) so_incomp; /* queue of partial unaccepted connections */
- TAILQ_HEAD(, socket) so_comp; /* queue of complete unaccepted connections */
- TAILQ_ENTRY(socket) so_list; /* list of unaccepted connections */
- short so_qlen; /* number of unaccepted connections */
- short so_incqlen; /* number of unaccepted incomplete
- connections */
- short so_qlimit; /* max number queued connections */
- short so_timeo; /* connection timeout */
- u_short so_error; /* error affecting connection */
- pid_t so_pgid; /* pgid for signals */
- u_long so_oobmark; /* chars to oob mark */
-/*
- * Variables for socket buffering.
- */
- struct sockbuf {
- u_long sb_cc; /* actual chars in buffer */
- u_long sb_hiwat; /* max actual char count */
- u_long sb_mbcnt; /* chars of mbufs used */
- u_long sb_mbmax; /* max chars of mbufs to use */
- long sb_lowat; /* low water mark */
- struct mbuf *sb_mb; /* the mbuf chain */
- struct selinfo sb_sel; /* process selecting read/write */
- short sb_flags; /* flags, see below */
- short sb_timeo; /* timeout for read/write */
- } so_rcv, so_snd;
-#define SB_MAX (256*1024) /* default for max chars in sockbuf */
-#define SB_LOCK 0x01 /* lock on data queue */
-#define SB_WANT 0x02 /* someone is waiting to lock */
-#define SB_WAIT 0x04 /* someone is waiting for data/space */
-#define SB_SEL 0x08 /* someone is selecting */
-#define SB_ASYNC 0x10 /* ASYNC I/O, need signals */
-#define SB_NOTIFY (SB_WAIT|SB_SEL|SB_ASYNC)
-#define SB_NOINTR 0x40 /* operations not interruptible */
-
- caddr_t so_tpcb; /* Wisc. protocol control block XXX */
- void (*so_upcall) __P((struct socket *so, caddr_t arg, int waitf));
- caddr_t so_upcallarg; /* Arg for above */
- uid_t so_uid; /* who opened the socket */
-};
-
-/*
- * Socket state bits.
- */
-#define SS_NOFDREF 0x0001 /* no file table ref any more */
-#define SS_ISCONNECTED 0x0002 /* socket connected to a peer */
-#define SS_ISCONNECTING 0x0004 /* in process of connecting to peer */
-#define SS_ISDISCONNECTING 0x0008 /* in process of disconnecting */
-#define SS_CANTSENDMORE 0x0010 /* can't send more data to peer */
-#define SS_CANTRCVMORE 0x0020 /* can't receive more data from peer */
-#define SS_RCVATMARK 0x0040 /* at mark on input */
-
-#define SS_PRIV 0x0080 /* privileged for broadcast, raw... */
-#define SS_NBIO 0x0100 /* non-blocking ops */
-#define SS_ASYNC 0x0200 /* async i/o notify */
-#define SS_ISCONFIRMING 0x0400 /* deciding to accept connection req */
-
-#define SS_INCOMP 0x0800 /* unaccepted, incomplete connection */
-#define SS_COMP 0x1000 /* unaccepted, complete connection */
-
-
-/*
- * Macros for sockets and socket buffering.
- */
-
-/*
- * How much space is there in a socket buffer (so->so_snd or so->so_rcv)?
- * This is problematical if the fields are unsigned, as the space might
- * still be negative (cc > hiwat or mbcnt > mbmax). Should detect
- * overflow and return 0. Should use "lmin" but it doesn't exist now.
- */
-#define sbspace(sb) \
- ((long) imin((int)((sb)->sb_hiwat - (sb)->sb_cc), \
- (int)((sb)->sb_mbmax - (sb)->sb_mbcnt)))
-
-/* do we have to send all at once on a socket? */
-#define sosendallatonce(so) \
- ((so)->so_proto->pr_flags & PR_ATOMIC)
-
-/* can we read something from so? */
-#define soreadable(so) \
- ((so)->so_rcv.sb_cc >= (so)->so_rcv.sb_lowat || \
- ((so)->so_state & SS_CANTRCVMORE) || \
- (so)->so_comp.tqh_first || (so)->so_error)
-
-/* can we write something to so? */
-#define sowriteable(so) \
- ((sbspace(&(so)->so_snd) >= (so)->so_snd.sb_lowat && \
- (((so)->so_state&SS_ISCONNECTED) || \
- ((so)->so_proto->pr_flags&PR_CONNREQUIRED)==0)) || \
- ((so)->so_state & SS_CANTSENDMORE) || \
- (so)->so_error)
-
-/* adjust counters in sb reflecting allocation of m */
-#define sballoc(sb, m) { \
- (sb)->sb_cc += (m)->m_len; \
- (sb)->sb_mbcnt += MSIZE; \
- if ((m)->m_flags & M_EXT) \
- (sb)->sb_mbcnt += (m)->m_ext.ext_size; \
-}
-
-/* adjust counters in sb reflecting freeing of m */
-#define sbfree(sb, m) { \
- (sb)->sb_cc -= (m)->m_len; \
- (sb)->sb_mbcnt -= MSIZE; \
- if ((m)->m_flags & M_EXT) \
- (sb)->sb_mbcnt -= (m)->m_ext.ext_size; \
-}
-
-/*
- * Set lock on sockbuf sb; sleep if lock is already held.
- * Unless SB_NOINTR is set on sockbuf, sleep is interruptible.
- * Returns error without lock if sleep is interrupted.
- */
-#define sblock(sb, wf) ((sb)->sb_flags & SB_LOCK ? \
- (((wf) == M_WAITOK) ? sb_lock(sb) : EWOULDBLOCK) : \
- ((sb)->sb_flags |= SB_LOCK), 0)
-
-/* release lock on sockbuf sb */
-#define sbunlock(sb) { \
- (sb)->sb_flags &= ~SB_LOCK; \
- if ((sb)->sb_flags & SB_WANT) { \
- (sb)->sb_flags &= ~SB_WANT; \
- wakeup((caddr_t)&(sb)->sb_flags); \
- } \
-}
-
-#define sorwakeup(so) { sowakeup((so), &(so)->so_rcv); \
- if ((so)->so_upcall) \
- (*((so)->so_upcall))((so), (so)->so_upcallarg, M_DONTWAIT); \
- }
-
-#define sowwakeup(so) sowakeup((so), &(so)->so_snd)
-
-#ifdef KERNEL
-extern u_long sb_max;
-
-/* to catch callers missing new second argument to sonewconn: */
-#define sonewconn(head, connstatus) sonewconn1((head), (connstatus))
-
-struct filedesc;
-struct mbuf;
-struct sockaddr;
-struct stat;
-
-/*
- * File operations on sockets.
- */
-int soo_ioctl __P((struct file *fp, int cmd, caddr_t data,
- struct proc *p));
-int soo_select __P((struct file *fp, int which, struct proc *p));
-int soo_stat __P((struct socket *so, struct stat *ub));
-
-/*
- * From uipc_socket and friends
- */
-int getsock __P((struct filedesc *fdp, int fdes, struct file **fpp));
-int sockargs __P((struct mbuf **mp, caddr_t buf, int buflen, int type));
-void sbappend __P((struct sockbuf *sb, struct mbuf *m));
-int sbappendaddr __P((struct sockbuf *sb, struct sockaddr *asa,
- struct mbuf *m0, struct mbuf *control));
-int sbappendcontrol __P((struct sockbuf *sb, struct mbuf *m0,
- struct mbuf *control));
-void sbappendrecord __P((struct sockbuf *sb, struct mbuf *m0));
-void sbcheck __P((struct sockbuf *sb));
-void sbcompress __P((struct sockbuf *sb, struct mbuf *m, struct mbuf *n));
-struct mbuf *
- sbcreatecontrol __P((caddr_t p, int size, int type, int level));
-void sbdrop __P((struct sockbuf *sb, int len));
-void sbdroprecord __P((struct sockbuf *sb));
-void sbflush __P((struct sockbuf *sb));
-void sbinsertoob __P((struct sockbuf *sb, struct mbuf *m0));
-void sbrelease __P((struct sockbuf *sb));
-int sbreserve __P((struct sockbuf *sb, u_long cc));
-int sbwait __P((struct sockbuf *sb));
-int sb_lock __P((struct sockbuf *sb));
-int soabort __P((struct socket *so));
-int soaccept __P((struct socket *so, struct mbuf *nam));
-int sobind __P((struct socket *so, struct mbuf *nam));
-void socantrcvmore __P((struct socket *so));
-void socantsendmore __P((struct socket *so));
-int soclose __P((struct socket *so));
-int soconnect __P((struct socket *so, struct mbuf *nam));
-int soconnect2 __P((struct socket *so1, struct socket *so2));
-int socreate __P((int dom, struct socket **aso, int type, int proto,
- struct proc *p));
-int sodisconnect __P((struct socket *so));
-void sofree __P((struct socket *so));
-int sogetopt __P((struct socket *so, int level, int optname,
- struct mbuf **mp));
-void sohasoutofband __P((struct socket *so));
-void soisconnected __P((struct socket *so));
-void soisconnecting __P((struct socket *so));
-void soisdisconnected __P((struct socket *so));
-void soisdisconnecting __P((struct socket *so));
-int solisten __P((struct socket *so, int backlog));
-struct socket *
- sodropablereq __P((struct socket *head));
-struct socket *
- sonewconn1 __P((struct socket *head, int connstatus));
-int soreceive __P((struct socket *so, struct mbuf **paddr, struct uio *uio,
- struct mbuf **mp0, struct mbuf **controlp, int *flagsp));
-int soreserve __P((struct socket *so, u_long sndcc, u_long rcvcc));
-void sorflush __P((struct socket *so));
-int sosend __P((struct socket *so, struct mbuf *addr, struct uio *uio,
- struct mbuf *top, struct mbuf *control, int flags));
-int sosetopt __P((struct socket *so, int level, int optname,
- struct mbuf *m0));
-int soshutdown __P((struct socket *so, int how));
-void sowakeup __P((struct socket *so, struct sockbuf *sb));
-#endif /* KERNEL */
-
-#endif /* !_SYS_SOCKETVAR_H_ */
diff --git a/c/src/exec/libnetworking/sys/sysctl.h b/c/src/exec/libnetworking/sys/sysctl.h
deleted file mode 100644
index b25ba43c4f..0000000000
--- a/c/src/exec/libnetworking/sys/sysctl.h
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Mike Karels at Berkeley Software Design, Inc.
- *
- * 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.
- *
- * @(#)sysctl.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_SYSCTL_H_
-#define _SYS_SYSCTL_H_
-
-/*
- * Definitions for sysctl call. The sysctl call uses a hierarchical name
- * for objects that can be examined or modified. The name is expressed as
- * a sequence of integers. Like a file path name, the meaning of each
- * component depends on its place in the hierarchy. The top-level and kern
- * identifiers are defined here, and other identifiers are defined in the
- * respective subsystem header files.
- */
-
-#define CTL_MAXNAME 12 /* largest number of components supported */
-
-/*
- * Each subsystem defined by sysctl defines a list of variables
- * for that subsystem. Each name is either a node with further
- * levels defined below it, or it is a leaf of some particular
- * type given below. Each sysctl level defines a set of name/type
- * pairs to be used by sysctl(1) in manipulating the subsystem.
- */
-struct ctlname {
- char *ctl_name; /* subsystem name */
- int ctl_type; /* type of name */
-};
-
-#define CTLTYPE 0xf /* Mask for the type */
-#define CTLTYPE_NODE 1 /* name is a node */
-#define CTLTYPE_INT 2 /* name describes an integer */
-#define CTLTYPE_STRING 3 /* name describes a string */
-#define CTLTYPE_QUAD 4 /* name describes a 64-bit number */
-#define CTLTYPE_OPAQUE 5 /* name describes a structure */
-#define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */
-
-#define CTLFLAG_RD 0x80000000 /* Allow reads of variable */
-#define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */
-#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR)
-#define CTLFLAG_NOLOCK 0x20000000 /* XXX Don't Lock */
-#define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */
-
-/*
- * USE THIS instead of a hardwired number from the categories below
- * to get dynamically assigned sysctl entries using the linker-set
- * technology. This is the way nearly all new sysctl variables should
- * be implimented.
- * e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, "");
- */
-#define OID_AUTO (-1)
-
-#ifdef KERNEL
-#define SYSCTL_HANDLER_ARGS (struct sysctl_oid *oidp, void *arg1, int arg2, \
- struct sysctl_req *req)
-
-/*
- * This describes the access space for a sysctl request. This is needed
- * so that we can use the interface from the kernel or from user-space.
- */
-struct sysctl_req {
- struct proc *p;
- int lock;
- void *oldptr;
- int oldlen;
- int oldidx;
- int (*oldfunc)(struct sysctl_req *, const void *, int);
- void *newptr;
- int newlen;
- int newidx;
- int (*newfunc)(struct sysctl_req *, void *, int);
-};
-
-/*
- * This describes one "oid" in the MIB tree. Potentially more nodes can
- * be hidden behind it, expanded by the handler.
- */
-struct sysctl_oid {
- int oid_number;
- int oid_kind;
- void *oid_arg1;
- int oid_arg2;
- const char *oid_name;
- int (*oid_handler) SYSCTL_HANDLER_ARGS;
- const char *oid_fmt;
-};
-
-#define SYSCTL_IN(r, p, l)
-#define SYSCTL_OUT(r, p, l)
-
-int sysctl_handle_int SYSCTL_HANDLER_ARGS;
-int sysctl_handle_string SYSCTL_HANDLER_ARGS;
-int sysctl_handle_opaque SYSCTL_HANDLER_ARGS;
-
-/* This is the "raw" function for a mib-oid */
-#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr)
-
-/* This makes a node from which other oids can hang */
-#define SYSCTL_NODE(parent, nbr, name, access, handler, descr)
-
-/* This is a string len can be 0 to indicate '\0' termination */
-#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr)
-
-/* This is a integer, if ptr is NULL, val is returned */
-#define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr)
-
-/* This is anything, specified by a pointer and a lenth */
-#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr)
-
-/* This is a struct, specified by a pointer and type */
-#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr)
-
-/* Needs a proc. Specify by pointer and arg */
-#define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr)
-#endif /* KERNEL */
-
-/*
- * Top-level identifiers
- */
-#define CTL_UNSPEC 0 /* unused */
-#define CTL_KERN 1 /* "high kernel": proc, limits */
-#define CTL_VM 2 /* virtual memory */
-#define CTL_VFS 3 /* file system, mount type is next */
-#define CTL_NET 4 /* network, see socket.h */
-#define CTL_DEBUG 5 /* debugging parameters */
-#define CTL_HW 6 /* generic cpu/io */
-#define CTL_MACHDEP 7 /* machine dependent */
-#define CTL_USER 8 /* user-level */
-#define CTL_MAXID 9 /* number of valid top-level ids */
-
-#define CTL_NAMES { \
- { 0, 0 }, \
- { "kern", CTLTYPE_NODE }, \
- { "vm", CTLTYPE_NODE }, \
- { "vfs", CTLTYPE_NODE }, \
- { "net", CTLTYPE_NODE }, \
- { "debug", CTLTYPE_NODE }, \
- { "hw", CTLTYPE_NODE }, \
- { "machdep", CTLTYPE_NODE }, \
- { "user", CTLTYPE_NODE }, \
-}
-
-/*
- * CTL_KERN identifiers
- */
-#define KERN_OSTYPE 1 /* string: system version */
-#define KERN_OSRELEASE 2 /* string: system release */
-#define KERN_OSREV 3 /* int: system revision */
-#define KERN_VERSION 4 /* string: compile time info */
-#define KERN_MAXVNODES 5 /* int: max vnodes */
-#define KERN_MAXPROC 6 /* int: max processes */
-#define KERN_MAXFILES 7 /* int: max open files */
-#define KERN_ARGMAX 8 /* int: max arguments to exec */
-#define KERN_SECURELVL 9 /* int: system security level */
-#define KERN_HOSTNAME 10 /* string: hostname */
-#define KERN_HOSTID 11 /* int: host identifier */
-#define KERN_CLOCKRATE 12 /* struct: struct clockrate */
-#define KERN_VNODE 13 /* struct: vnode structures */
-#define KERN_PROC 14 /* struct: process entries */
-#define KERN_FILE 15 /* struct: file entries */
-#define KERN_PROF 16 /* node: kernel profiling info */
-#define KERN_POSIX1 17 /* int: POSIX.1 version */
-#define KERN_NGROUPS 18 /* int: # of supplemental group ids */
-#define KERN_JOB_CONTROL 19 /* int: is job control available */
-#define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */
-#define KERN_BOOTTIME 21 /* struct: time kernel was booted */
-#define KERN_NISDOMAINNAME 22 /* string: YP domain name */
-#define KERN_UPDATEINTERVAL 23 /* int: update process sleep time */
-#define KERN_OSRELDATE 24 /* int: OS release date */
-#define KERN_NTP_PLL 25 /* node: NTP PLL control */
-#define KERN_BOOTFILE 26 /* string: name of booted kernel */
-#define KERN_MAXFILESPERPROC 27 /* int: max open files per proc */
-#define KERN_MAXPROCPERUID 28 /* int: max processes per uid */
-#define KERN_DUMPDEV 29 /* dev_t: device to dump on */
-#define KERN_SOMAXCONN 30 /* int: max connections in listen q */
-#define KERN_MAXSOCKBUF 31 /* int: max size of a socket buffer */
-#define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */
-#define KERN_USRSTACK 33 /* int: address of USRSTACK */
-#define KERN_MAXID 34 /* number of valid kern ids */
-
-#define CTL_KERN_NAMES { \
- { 0, 0 }, \
- { "ostype", CTLTYPE_STRING }, \
- { "osrelease", CTLTYPE_STRING }, \
- { "osrevision", CTLTYPE_INT }, \
- { "version", CTLTYPE_STRING }, \
- { "maxvnodes", CTLTYPE_INT }, \
- { "maxproc", CTLTYPE_INT }, \
- { "maxfiles", CTLTYPE_INT }, \
- { "argmax", CTLTYPE_INT }, \
- { "securelevel", CTLTYPE_INT }, \
- { "hostname", CTLTYPE_STRING }, \
- { "hostid", CTLTYPE_INT }, \
- { "clockrate", CTLTYPE_STRUCT }, \
- { "vnode", CTLTYPE_STRUCT }, \
- { "proc", CTLTYPE_STRUCT }, \
- { "file", CTLTYPE_STRUCT }, \
- { "profiling", CTLTYPE_NODE }, \
- { "posix1version", CTLTYPE_INT }, \
- { "ngroups", CTLTYPE_INT }, \
- { "job_control", CTLTYPE_INT }, \
- { "saved_ids", CTLTYPE_INT }, \
- { "boottime", CTLTYPE_STRUCT }, \
- { "nisdomainname", CTLTYPE_STRING }, \
- { "update", CTLTYPE_INT }, \
- { "osreldate", CTLTYPE_INT }, \
- { "ntp_pll", CTLTYPE_NODE }, \
- { "bootfile", CTLTYPE_STRING }, \
- { "maxfilesperproc", CTLTYPE_INT }, \
- { "maxprocperuid", CTLTYPE_INT }, \
- { "dumpdev", CTLTYPE_STRUCT }, /* we lie; don't print as int */ \
- { "somaxconn", CTLTYPE_INT }, \
- { "maxsockbuf", CTLTYPE_INT }, \
- { "ps_strings", CTLTYPE_INT }, \
- { "usrstack", CTLTYPE_INT }, \
-}
-
-/*
- * CTL_VFS identifiers
- */
-#define VFS_VFSCONF 0 /* get configured filesystems */
-#define VFS_MAXID 1 /* number of items */
-
-#define CTL_VFS_NAMES { \
- { "vfsconf", CTLTYPE_STRUCT }, \
-}
-
-/*
- * KERN_PROC subtypes
- */
-#define KERN_PROC_ALL 0 /* everything */
-#define KERN_PROC_PID 1 /* by process id */
-#define KERN_PROC_PGRP 2 /* by process group id */
-#define KERN_PROC_SESSION 3 /* by session of pid */
-#define KERN_PROC_TTY 4 /* by controlling tty */
-#define KERN_PROC_UID 5 /* by effective uid */
-#define KERN_PROC_RUID 6 /* by real uid */
-
-/*
- * CTL_HW identifiers
- */
-#define HW_MACHINE 1 /* string: machine class */
-#define HW_MODEL 2 /* string: specific machine model */
-#define HW_NCPU 3 /* int: number of cpus */
-#define HW_BYTEORDER 4 /* int: machine byte order */
-#define HW_PHYSMEM 5 /* int: total memory */
-#define HW_USERMEM 6 /* int: non-kernel memory */
-#define HW_PAGESIZE 7 /* int: software page size */
-#define HW_DISKNAMES 8 /* strings: disk drive names */
-#define HW_DISKSTATS 9 /* struct: diskstats[] */
-#define HW_FLOATINGPT 10 /* int: has HW floating point? */
-#define HW_MACHINE_ARCH 11 /* string: machine architecture */
-#define HW_MAXID 12 /* number of valid hw ids */
-
-#define CTL_HW_NAMES { \
- { 0, 0 }, \
- { "machine", CTLTYPE_STRING }, \
- { "model", CTLTYPE_STRING }, \
- { "ncpu", CTLTYPE_INT }, \
- { "byteorder", CTLTYPE_INT }, \
- { "physmem", CTLTYPE_INT }, \
- { "usermem", CTLTYPE_INT }, \
- { "pagesize", CTLTYPE_INT }, \
- { "disknames", CTLTYPE_STRUCT }, \
- { "diskstats", CTLTYPE_STRUCT }, \
- { "floatingpoint", CTLTYPE_INT }, \
-}
-
-/*
- * CTL_USER definitions
- */
-#define USER_CS_PATH 1 /* string: _CS_PATH */
-#define USER_BC_BASE_MAX 2 /* int: BC_BASE_MAX */
-#define USER_BC_DIM_MAX 3 /* int: BC_DIM_MAX */
-#define USER_BC_SCALE_MAX 4 /* int: BC_SCALE_MAX */
-#define USER_BC_STRING_MAX 5 /* int: BC_STRING_MAX */
-#define USER_COLL_WEIGHTS_MAX 6 /* int: COLL_WEIGHTS_MAX */
-#define USER_EXPR_NEST_MAX 7 /* int: EXPR_NEST_MAX */
-#define USER_LINE_MAX 8 /* int: LINE_MAX */
-#define USER_RE_DUP_MAX 9 /* int: RE_DUP_MAX */
-#define USER_POSIX2_VERSION 10 /* int: POSIX2_VERSION */
-#define USER_POSIX2_C_BIND 11 /* int: POSIX2_C_BIND */
-#define USER_POSIX2_C_DEV 12 /* int: POSIX2_C_DEV */
-#define USER_POSIX2_CHAR_TERM 13 /* int: POSIX2_CHAR_TERM */
-#define USER_POSIX2_FORT_DEV 14 /* int: POSIX2_FORT_DEV */
-#define USER_POSIX2_FORT_RUN 15 /* int: POSIX2_FORT_RUN */
-#define USER_POSIX2_LOCALEDEF 16 /* int: POSIX2_LOCALEDEF */
-#define USER_POSIX2_SW_DEV 17 /* int: POSIX2_SW_DEV */
-#define USER_POSIX2_UPE 18 /* int: POSIX2_UPE */
-#define USER_STREAM_MAX 19 /* int: POSIX2_STREAM_MAX */
-#define USER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */
-#define USER_MAXID 21 /* number of valid user ids */
-
-#define CTL_USER_NAMES { \
- { 0, 0 }, \
- { "cs_path", CTLTYPE_STRING }, \
- { "bc_base_max", CTLTYPE_INT }, \
- { "bc_dim_max", CTLTYPE_INT }, \
- { "bc_scale_max", CTLTYPE_INT }, \
- { "bc_string_max", CTLTYPE_INT }, \
- { "coll_weights_max", CTLTYPE_INT }, \
- { "expr_nest_max", CTLTYPE_INT }, \
- { "line_max", CTLTYPE_INT }, \
- { "re_dup_max", CTLTYPE_INT }, \
- { "posix2_version", CTLTYPE_INT }, \
- { "posix2_c_bind", CTLTYPE_INT }, \
- { "posix2_c_dev", CTLTYPE_INT }, \
- { "posix2_char_term", CTLTYPE_INT }, \
- { "posix2_fort_dev", CTLTYPE_INT }, \
- { "posix2_fort_run", CTLTYPE_INT }, \
- { "posix2_localedef", CTLTYPE_INT }, \
- { "posix2_sw_dev", CTLTYPE_INT }, \
- { "posix2_upe", CTLTYPE_INT }, \
- { "stream_max", CTLTYPE_INT }, \
- { "tzname_max", CTLTYPE_INT }, \
-}
-
-#ifdef KERNEL
-
-extern char cpu_model[];
-extern char machine[];
-extern char osrelease[];
-extern char ostype[];
-
-int kernel_sysctl(struct proc *p, int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen, int *retval);
-int userland_sysctl(struct proc *p, int *name, u_int namelen, void *old, size_t *oldlenp, int inkernel, void *new, size_t newlen, int *retval);
-/*
-int sysctl_clockrate __P((char *, size_t*));
-int sysctl_file __P((char *, size_t*));
-int sysctl_doproc __P((int *, u_int, char *, size_t*));
-int sysctl_doprof __P((int *, u_int, void *, size_t *, void *, size_t));
-*/
-
-#else /* !KERNEL */
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int sysctl __P((int *, u_int, void *, size_t *, void *, size_t));
-int sysctlbyname __P((const char *, void *, size_t *, void *, size_t));
-__END_DECLS
-#endif /* KERNEL */
-
-#endif /* !_SYS_SYSCTL_H_ */
diff --git a/c/src/exec/libnetworking/sys/syslimits.h b/c/src/exec/libnetworking/sys/syslimits.h
deleted file mode 100644
index 283a0241e3..0000000000
--- a/c/src/exec/libnetworking/sys/syslimits.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * @(#)syslimits.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_SYSLIMITS_H_
-#define _SYS_SYSLIMITS_H_
-
-#if !defined(__rtems__)
-#define ARG_MAX 65536 /* max bytes for an exec function */
-#endif
-
-#if !defined(__rtems__)
-#ifndef CHILD_MAX
-#define CHILD_MAX 40 /* max simultaneous processes */
-#endif
-#endif
-
-#if !defined(__rtems__)
-#define LINK_MAX 32767 /* max file link count */
-#endif
-
-#define MAX_CANON 255 /* max bytes in term canon input line */
-
-#define MAX_INPUT 255 /* max bytes in terminal input */
-
-#if !defined(__rtems__)
-#define NAME_MAX 255 /* max bytes in a file name */
-#endif
-
-#define NGROUPS_MAX 16 /* max supplemental group id's */
-
-#if !defined(__rtems__)
-#ifndef OPEN_MAX
-#define OPEN_MAX 64 /* max open files per process */
-#endif
-#endif
-
-#if !defined(__rtems__)
-#define PATH_MAX 1024 /* max bytes in pathname */
-#endif
-
-#define PIPE_BUF 512 /* max bytes for atomic pipe writes */
-
-#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */
-#define BC_DIM_MAX 2048 /* max array elements in bc(1) */
-#define BC_SCALE_MAX 99 /* max scale value in bc(1) */
-#define BC_STRING_MAX 1000 /* max const string length in bc(1) */
-#define COLL_WEIGHTS_MAX 0 /* max weights for order keyword */
-#define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */
-#define LINE_MAX 2048 /* max bytes in an input line */
-#define RE_DUP_MAX 255 /* max RE's in interval notation */
-
-#endif
diff --git a/c/src/exec/libnetworking/sys/syslog.h b/c/src/exec/libnetworking/sys/syslog.h
deleted file mode 100644
index 724bee62c7..0000000000
--- a/c/src/exec/libnetworking/sys/syslog.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)syslog.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_SYSLOG_H_
-#define _SYS_SYSLOG_H_
-
-#define _PATH_LOG "/var/run/log"
-#define _PATH_OLDLOG "/dev/log" /* backward compatibility */
-
-/*
- * priorities/facilities are encoded into a single 32-bit quantity, where the
- * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
- * (0-big number). Both the priorities and the facilities map roughly
- * one-to-one to strings in the syslogd(8) source code. This mapping is
- * included in this file.
- *
- * priorities (these are ordered)
- */
-#define LOG_EMERG 0 /* system is unusable */
-#define LOG_ALERT 1 /* action must be taken immediately */
-#define LOG_CRIT 2 /* critical conditions */
-#define LOG_ERR 3 /* error conditions */
-#define LOG_WARNING 4 /* warning conditions */
-#define LOG_NOTICE 5 /* normal but significant condition */
-#define LOG_INFO 6 /* informational */
-#define LOG_DEBUG 7 /* debug-level messages */
-
-#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
- /* extract priority */
-#define LOG_PRI(p) ((p) & LOG_PRIMASK)
-#define LOG_MAKEPRI(fac, pri) ((fac) | (pri))
-
-#ifdef SYSLOG_NAMES
-#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
- /* mark "facility" */
-#define INTERNAL_MARK LOG_MAKEPRI((LOG_NFACILITIES<<3), 0)
-typedef struct _code {
- char *c_name;
- int c_val;
-} CODE;
-
-CODE prioritynames[] = {
- { "alert", LOG_ALERT, },
- { "crit", LOG_CRIT, },
- { "debug", LOG_DEBUG, },
- { "emerg", LOG_EMERG, },
- { "err", LOG_ERR, },
- { "error", LOG_ERR, }, /* DEPRECATED */
- { "info", LOG_INFO, },
- { "none", INTERNAL_NOPRI, }, /* INTERNAL */
- { "notice", LOG_NOTICE, },
- { "panic", LOG_EMERG, }, /* DEPRECATED */
- { "warn", LOG_WARNING, }, /* DEPRECATED */
- { "warning", LOG_WARNING, },
- { NULL, -1, }
-};
-#endif
-
-/* facility codes */
-#define LOG_KERN (0<<3) /* kernel messages */
-#define LOG_USER (1<<3) /* random user-level messages */
-#define LOG_MAIL (2<<3) /* mail system */
-#define LOG_DAEMON (3<<3) /* system daemons */
-#define LOG_AUTH (4<<3) /* security/authorization messages */
-#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
-#define LOG_LPR (6<<3) /* line printer subsystem */
-#define LOG_NEWS (7<<3) /* network news subsystem */
-#define LOG_UUCP (8<<3) /* UUCP subsystem */
-#define LOG_CRON (9<<3) /* clock daemon */
-#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
- /* Facility #10 clashes in DEC UNIX, where */
- /* it's defined as LOG_MEGASAFE for AdvFS */
- /* event logging. */
-#define LOG_FTP (11<<3) /* ftp daemon */
-#define LOG_NTP (12<<3) /* NTP subsystem */
-
- /* other codes through 15 reserved for system use */
-#define LOG_LOCAL0 (16<<3) /* reserved for local use */
-#define LOG_LOCAL1 (17<<3) /* reserved for local use */
-#define LOG_LOCAL2 (18<<3) /* reserved for local use */
-#define LOG_LOCAL3 (19<<3) /* reserved for local use */
-#define LOG_LOCAL4 (20<<3) /* reserved for local use */
-#define LOG_LOCAL5 (21<<3) /* reserved for local use */
-#define LOG_LOCAL6 (22<<3) /* reserved for local use */
-#define LOG_LOCAL7 (23<<3) /* reserved for local use */
-
-#define LOG_NFACILITIES 24 /* current number of facilities */
-#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
- /* facility of pri */
-#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
-
-#ifdef SYSLOG_NAMES
-CODE facilitynames[] = {
- { "auth", LOG_AUTH, },
- { "authpriv", LOG_AUTHPRIV, },
- { "cron", LOG_CRON, },
- { "daemon", LOG_DAEMON, },
- { "ftp", LOG_FTP, },
- { "kern", LOG_KERN, },
- { "lpr", LOG_LPR, },
- { "mail", LOG_MAIL, },
- { "mark", INTERNAL_MARK, }, /* INTERNAL */
- { "news", LOG_NEWS, },
- { "ntp", LOG_NTP, },
- { "security", LOG_AUTH, }, /* DEPRECATED */
- { "syslog", LOG_SYSLOG, },
- { "user", LOG_USER, },
- { "uucp", LOG_UUCP, },
- { "local0", LOG_LOCAL0, },
- { "local1", LOG_LOCAL1, },
- { "local2", LOG_LOCAL2, },
- { "local3", LOG_LOCAL3, },
- { "local4", LOG_LOCAL4, },
- { "local5", LOG_LOCAL5, },
- { "local6", LOG_LOCAL6, },
- { "local7", LOG_LOCAL7, },
- { NULL, -1, }
-};
-#endif
-
-#ifdef KERNEL
-#define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */
-#endif
-
-/*
- * arguments to setlogmask.
- */
-#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
-#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
-
-/*
- * Option flags for openlog.
- *
- * LOG_ODELAY no longer does anything.
- * LOG_NDELAY is the inverse of what it used to be.
- */
-#define LOG_PID 0x01 /* log the pid with each message */
-#define LOG_CONS 0x02 /* log on the console if errors in sending */
-#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
-#define LOG_NDELAY 0x08 /* don't delay open */
-#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
-#define LOG_PERROR 0x20 /* log to stderr as well */
-
-#ifdef KERNEL
-
-#else /* not KERNEL */
-
-#include <sys/cdefs.h>
-#include <stdarg.h>
-
-__BEGIN_DECLS
-void closelog __P((void));
-void openlog __P((const char *, int, int));
-int setlogmask __P((int));
-void syslog __P((int, const char *, ...));
-void vsyslog __P((int, const char *, va_list));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif
diff --git a/c/src/exec/libnetworking/sys/systm.h b/c/src/exec/libnetworking/sys/systm.h
deleted file mode 100644
index 7e14867e70..0000000000
--- a/c/src/exec/libnetworking/sys/systm.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/*-
- * Copyright (c) 1982, 1988, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)systm.h 8.7 (Berkeley) 3/29/95
- * $Id$
- */
-
-#ifndef _SYS_SYSTM_H_
-#define _SYS_SYSTM_H_
-
-#include <machine/cpufunc.h>
-
-extern int securelevel; /* system security level (see init(8)) */
-
-extern int cold; /* nonzero if we are doing a cold boot */
-extern const char *panicstr; /* panic message */
-extern char version[]; /* system version */
-extern char copyright[]; /* system copyright */
-
-extern int nblkdev; /* number of entries in bdevsw */
-extern int nchrdev; /* number of entries in cdevsw */
-extern struct swdevt *swdevt; /* swap-device information */
-extern int nswdev; /* number of swap devices */
-extern int nswap; /* size of swap space */
-
-extern int selwait; /* select timeout address */
-
-extern u_char curpriority; /* priority of current process */
-
-extern int physmem; /* physical memory */
-
-extern dev_t dumpdev; /* dump device */
-extern long dumplo; /* offset into dumpdev */
-
-extern dev_t rootdev; /* root device */
-extern struct vnode *rootvp; /* vnode equivalent to above */
-
-extern dev_t swapdev; /* swapping device */
-extern struct vnode *swapdev_vp;/* vnode equivalent to above */
-
-extern int boothowto; /* reboot flags, from console subsystem */
-extern int bootverbose; /* nonzero to print verbose messages */
-
-/*
- * General function declarations.
- */
-void Debugger __P((const char *msg));
-int nullop __P((void));
-int eopnotsupp __P((void));
-int einval __P((void));
-int seltrue __P((dev_t dev, int which, struct proc *p));
-int ureadc __P((int, struct uio *));
-void *hashinit __P((int count, int type, u_long *hashmask));
-void *phashinit __P((int count, int type, u_long *nentries));
-
-void panic __P((const char *, ...)) __dead2;
-void boot __P((int)) __dead2;
-void cpu_boot __P((int));
-void tablefull __P((const char *));
-int addlog __P((const char *, ...));
-int kvprintf __P((char const *, void (*)(int, void*), void *, int,
- _BSD_VA_LIST_));
-void log __P((int, const char *, ...));
-int printf __P((const char *, ...));
-int sprintf __P((char *buf, const char *, ...));
-void uprintf __P((const char *, ...));
-void ttyprintf __P((struct tty *, const char *, ...));
-
-#define bcopy(f,t,n) memcpy((t),(f),(n))
-#define bzero(p,n) memset((p),(0),(n))
-
-int copystr __P((const void *kfaddr, void *kdaddr, size_t len,
- size_t *lencopied));
-int copyinstr __P((const void *udaddr, void *kaddr, size_t len,
- size_t *lencopied));
-int copyin __P((const void *udaddr, void *kaddr, size_t len));
-int copyout __P((const void *kaddr, void *udaddr, size_t len));
-
-int fubyte __P((const void *base));
-int fuibyte __P((const void *base));
-int subyte __P((void *base, int byte));
-int suibyte __P((void *base, int byte));
-int fuword __P((const void *base));
-int suword __P((void *base, int word));
-int susword __P((void *base, int word));
-
-int hzto __P((struct timeval *tv));
-void realitexpire __P((void *));
-
-struct clockframe;
-void hardclock __P((struct clockframe *frame));
-void softclock __P((void));
-void statclock __P((struct clockframe *frame));
-
-void startprofclock __P((struct proc *));
-void stopprofclock __P((struct proc *));
-void setstatclockrate __P((int hzrate));
-
-void hardupdate __P((long));
-void hardpps __P((struct timeval *tvp, long usec));
-
-#include <sys/libkern.h>
-
-/* Initialize the world */
-extern void consinit(void);
-extern void usrinfoinit(void);
-extern void cpu_initclocks(void);
-extern void vntblinit(void);
-extern void nchinit(void);
-
-/* Finalize the world. */
-void shutdown_nice __P((void));
-
-/*
- * Kernel to clock driver interface.
- */
-void inittodr __P((time_t base));
-void resettodr __P((void));
-void startrtclock __P((void));
-
-/* Timeouts */
-typedef void (timeout_t)(void *); /* actual timeout function type */
-typedef timeout_t *timeout_func_t; /* a pointer to this type */
-
-void timeout(timeout_func_t, void *, int);
-void untimeout(timeout_func_t, void *);
-void logwakeup __P((void));
-
-/* Various other callout lists that modules might want to know about */
-/* shutdown callout list definitions */
-typedef void (*bootlist_fn)(int,void *);
-int at_shutdown(bootlist_fn function, void *arg, int);
-int rm_at_shutdown(bootlist_fn function, void *arg);
-#define SHUTDOWN_PRE_SYNC 0
-#define SHUTDOWN_POST_SYNC 1
-
-/* forking */ /* XXX not yet */
-typedef void (*forklist_fn)(struct proc *parent,struct proc *child,int flags);
-int at_fork(forklist_fn function);
-int rm_at_fork(forklist_fn function);
-
-/* exiting */
-typedef void (*exitlist_fn)(struct proc *procp);
-int at_exit(exitlist_fn function);
-int rm_at_exit(exitlist_fn function);
-
-/* Not exactly a callout LIST, but a callout entry.. */
-/* Allow an external module to define a hardware watchdog tickler */
-/* Normally a process would do this, but there are times when the */
-/* kernel needs to be able to hold off the watchdog, when the process */
-/* is not active, e.g. when dumping core. Costs us a whole 4 bytes to */
-/* make this generic. the variable is in kern_shutdown.c */
-typedef void (*watchdog_tickle_fn)(void);
-extern watchdog_tickle_fn wdog_tickler;
-
-
-/*
- * Common `proc' functions are declared here so that proc.h can be included
- * less often.
- */
-int tsleep __P((void *chan, int pri, char *wmesg, int timo));
-void wakeup __P((void *chan));
-
-#endif /* !_SYS_SYSTM_H_ */
diff --git a/c/src/exec/libnetworking/sys/ttydefaults.h b/c/src/exec/libnetworking/sys/ttydefaults.h
deleted file mode 100644
index 68f0ddbe77..0000000000
--- a/c/src/exec/libnetworking/sys/ttydefaults.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94
- * $Id$
- */
-
-/*
- * System wide defaults for terminal state.
- */
-#ifndef _SYS_TTYDEFAULTS_H_
-#define _SYS_TTYDEFAULTS_H_
-
-/*
- * Defaults on "first" open.
- */
-#define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY)
-#define TTYDEF_OFLAG (OPOST | ONLCR)
-#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
-#define TTYDEF_CFLAG (CREAD | CS8 | HUPCL)
-#define TTYDEF_SPEED (B9600)
-
-/*
- * Control Character Defaults
- */
-#define CTRL(x) (x&037)
-#define CEOF CTRL('d')
-#define CEOL 0xff /* XXX avoid _POSIX_VDISABLE */
-#define CERASE 0177
-#define CINTR CTRL('c')
-#define CSTATUS CTRL('t')
-#define CKILL CTRL('u')
-#define CMIN 1
-#define CQUIT 034 /* FS, ^\ */
-#define CSUSP CTRL('z')
-#define CTIME 0
-#define CDSUSP CTRL('y')
-#define CSTART CTRL('q')
-#define CSTOP CTRL('s')
-#define CLNEXT CTRL('v')
-#define CDISCARD CTRL('o')
-#define CWERASE CTRL('w')
-#define CREPRINT CTRL('r')
-#define CEOT CEOF
-/* compat */
-#define CBRK CEOL
-#define CRPRNT CREPRINT
-#define CFLUSH CDISCARD
-
-/* PROTECTED INCLUSION ENDS HERE */
-#endif /* !_SYS_TTYDEFAULTS_H_ */
-
-/*
- * #define TTYDEFCHARS to include an array of default control characters.
- */
-#ifdef TTYDEFCHARS
-static cc_t ttydefchars[NCCS] = {
- CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
- _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
- CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE
-};
-#undef TTYDEFCHARS
-#endif
diff --git a/c/src/exec/libnetworking/sys/ucred.h b/c/src/exec/libnetworking/sys/ucred.h
deleted file mode 100644
index d3899c3b4c..0000000000
--- a/c/src/exec/libnetworking/sys/ucred.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1989, 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.
- *
- * @(#)ucred.h 8.4 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _SYS_UCRED_H_
-#define _SYS_UCRED_H_
-
-/*
- * Credentials.
- */
-struct ucred {
- u_short cr_ref; /* reference count */
- uid_t cr_uid; /* effective user id */
- short cr_ngroups; /* number of groups */
- gid_t cr_groups[NGROUPS]; /* groups */
-};
-#define cr_gid cr_groups[0]
-#define NOCRED ((struct ucred *)0) /* no credential available */
-#define FSCRED ((struct ucred *)-1) /* filesystem credential */
-
-#ifdef KERNEL
-#define crhold(cr) (cr)->cr_ref++
-
-struct ucred *crcopy __P((struct ucred *cr));
-struct ucred *crdup __P((struct ucred *cr));
-void crfree __P((struct ucred *cr));
-struct ucred *crget __P((void));
-int suser __P((struct ucred *cred, u_short *acflag));
-int groupmember __P((gid_t gid, struct ucred *cred));
-#endif /* KERNEL */
-
-#endif /* !_SYS_UCRED_H_ */
diff --git a/c/src/exec/libnetworking/sys/uio.h b/c/src/exec/libnetworking/sys/uio.h
deleted file mode 100644
index 305941500d..0000000000
--- a/c/src/exec/libnetworking/sys/uio.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993, 1994
- * 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.
- *
- * @(#)uio.h 8.5 (Berkeley) 2/22/94
- * $Id$
- */
-
-#ifndef _SYS_UIO_H_
-#define _SYS_UIO_H_
-
-/*
- * XXX
- * iov_base should be a void *.
- */
-struct iovec {
- char *iov_base; /* Base address. */
- size_t iov_len; /* Length. */
-};
-
-enum uio_rw { UIO_READ, UIO_WRITE };
-
-/* Segment flag values. */
-enum uio_seg {
- UIO_USERSPACE, /* from user data space */
- UIO_SYSSPACE, /* from system space */
- UIO_USERISPACE, /* from user I space */
- UIO_NOCOPY /* don't copy, already in object */
-};
-
-#ifdef KERNEL
-struct uio {
- struct iovec *uio_iov;
- int uio_iovcnt;
- off_t uio_offset;
- int uio_resid;
- enum uio_seg uio_segflg;
- enum uio_rw uio_rw;
- struct proc *uio_procp;
-};
-
-/*
- * Limits
- */
-#define UIO_MAXIOV 1024 /* max 1K of iov's */
-#define UIO_SMALLIOV 8 /* 8 on stack, else malloc */
-#endif /* KERNEL */
-
-#ifdef KERNEL
-
-int uiomove __P((caddr_t, int, struct uio *));
-
-#else /* !KERNEL */
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-ssize_t readv __P((int, const struct iovec *, int));
-ssize_t writev __P((int, const struct iovec *, int));
-__END_DECLS
-
-#endif /* KERNEL */
-
-#endif /* !_SYS_UIO_H_ */
diff --git a/c/src/exec/libnetworking/syslog.h b/c/src/exec/libnetworking/syslog.h
deleted file mode 100644
index 6d223d00b7..0000000000
--- a/c/src/exec/libnetworking/syslog.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/syslog.h>
diff --git a/c/src/exec/libnetworking/vm/vm.h b/c/src/exec/libnetworking/vm/vm.h
deleted file mode 100644
index 19ea10e5eb..0000000000
--- a/c/src/exec/libnetworking/vm/vm.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 1991, 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.
- *
- * @(#)vm.h 8.2 (Berkeley) 12/13/93
- * $Id$
- */
-
-#ifndef VM_H
-#define VM_H
-
-typedef char vm_inherit_t; /* XXX: inheritance codes */
-typedef u_char vm_prot_t; /* protection codes */
-
-union vm_map_object;
-typedef union vm_map_object vm_map_object_t;
-
-struct vm_map_entry;
-typedef struct vm_map_entry *vm_map_entry_t;
-
-struct vm_map;
-typedef struct vm_map *vm_map_t;
-
-struct vm_object;
-typedef struct vm_object *vm_object_t;
-
-#ifndef KERNEL
-/*
- * This is defined in <sys/types.h> for the kernel so that non-vm kernel
- * sources (mainly Mach-derived ones such as ddb) don't have to include
- * vm stuff. Defining it there for applications might break things.
- * Define it here for "applications" that include vm headers (e.g.,
- * genassym).
- */
-typedef int boolean_t;
-
-/*
- * This is defined in <sys/types.h> for the kernel so that vnode_if.h
- * doesn't have to include <vm/vm.h>.
- */
-struct vm_page;
-typedef struct vm_page *vm_page_t;
-#endif
-
-#endif /* VM_H */
diff --git a/c/src/exec/libnetworking/vm/vm_extern.h b/c/src/exec/libnetworking/vm/vm_extern.h
deleted file mode 100644
index 720d42dc28..0000000000
--- a/c/src/exec/libnetworking/vm/vm_extern.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-
- * 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.
- *
- * @(#)vm_extern.h 8.2 (Berkeley) 1/12/94
- * $Id$
- */
-
-#ifndef _VM_EXTERN_H_
-#define _VM_EXTERN_H_
-
-struct buf;
-struct proc;
-struct vmspace;
-struct vmtotal;
-struct mount;
-struct vnode;
-
-#ifdef KERNEL
-
-#ifdef TYPEDEF_FOR_UAP
-int getpagesize __P((struct proc * p, void *, int *));
-int madvise __P((struct proc *, void *, int *));
-int mincore __P((struct proc *, void *, int *));
-int mprotect __P((struct proc *, void *, int *));
-int msync __P((struct proc *, void *, int *));
-int munmap __P((struct proc *, void *, int *));
-int obreak __P((struct proc *, void *, int *));
-int sbrk __P((struct proc *, void *, int *));
-int smmap __P((struct proc *, void *, int *));
-int sstk __P((struct proc *, void *, int *));
-int swapon __P((struct proc *, void *, int *));
-#endif
-
-void faultin __P((struct proc *p));
-int grow __P((struct proc *, u_int));
-int kernacc __P((caddr_t, int, int));
-vm_offset_t kmem_alloc __P((vm_map_t, vm_size_t));
-vm_offset_t kmem_alloc_pageable __P((vm_map_t, vm_size_t));
-vm_offset_t kmem_alloc_wait __P((vm_map_t, vm_size_t));
-void kmem_free __P((vm_map_t, vm_offset_t, vm_size_t));
-void kmem_free_wakeup __P((vm_map_t, vm_offset_t, vm_size_t));
-void kmem_init __P((vm_offset_t, vm_offset_t));
-vm_offset_t kmem_malloc __P((vm_map_t, vm_size_t, boolean_t));
-vm_map_t kmem_suballoc __P((vm_map_t, vm_offset_t *, vm_offset_t *, vm_size_t, boolean_t));
-void munmapfd __P((struct proc *, int));
-int pager_cache __P((vm_object_t, boolean_t));
-int swaponvp __P((struct proc *, struct vnode *, dev_t , u_long));
-void swapout_procs __P((void));
-int useracc __P((caddr_t, int, int));
-int vm_fault __P((vm_map_t, vm_offset_t, vm_prot_t, boolean_t));
-void vm_fault_copy_entry __P((vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t));
-void vm_fault_unwire __P((vm_map_t, vm_offset_t, vm_offset_t));
-int vm_fault_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
-int vm_fault_user_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
-int vm_fork __P((struct proc *, struct proc *));
-int vm_mmap __P((vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, caddr_t, vm_ooffset_t));
-vm_offset_t vm_page_alloc_contig __P((vm_offset_t, vm_offset_t, vm_offset_t, vm_offset_t));
-void vm_set_page_size __P((void));
-void vmmeter __P((void));
-struct vmspace *vmspace_alloc __P((vm_offset_t, vm_offset_t, int));
-struct vmspace *vmspace_fork __P((struct vmspace *));
-void vmspace_free __P((struct vmspace *));
-void vnode_pager_setsize __P((struct vnode *, vm_ooffset_t));
-void vnode_pager_umount __P((struct mount *));
-void vnode_pager_uncache __P((struct vnode *));
-void vslock __P((caddr_t, u_int));
-void vsunlock __P((caddr_t, u_int, int));
-void vm_object_print __P((/* db_expr_t */ int, boolean_t, /* db_expr_t */ int,
- char *));
-void vm_fault_quick __P((caddr_t v, int prot));
-
-#endif /* KERNEL */
-
-#endif /* !_VM_EXTERN_H_ */
diff --git a/c/src/exec/libnetworking/vm/vm_kern.h b/c/src/exec/libnetworking/vm/vm_kern.h
deleted file mode 100644
index b1e073dd3a..0000000000
--- a/c/src/exec/libnetworking/vm/vm_kern.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * The Mach Operating System project at Carnegie-Mellon University.
- *
- * 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.
- *
- * from: @(#)vm_kern.h 8.1 (Berkeley) 6/11/93
- *
- *
- * Copyright (c) 1987, 1990 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Authors: Avadis Tevanian, Jr., Michael Wayne Young
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- *
- * $Id$
- */
-
-#ifndef _VM_VM_KERN_H_
-#define _VM_VM_KERN_H_ 1
-
-/* Kernel memory management definitions. */
-extern vm_map_t buffer_map;
-extern vm_map_t kernel_map;
-extern vm_map_t kmem_map;
-extern vm_map_t mb_map;
-extern int mb_map_full;
-extern vm_map_t io_map;
-extern vm_map_t clean_map;
-extern vm_map_t phys_map;
-extern vm_map_t exec_map;
-extern vm_map_t u_map;
-
-extern vm_offset_t kernel_vm_end;
-
-#endif /* _VM_VM_KERN_H_ */
diff --git a/c/src/exec/libnetworking/vm/vm_param.h b/c/src/exec/libnetworking/vm/vm_param.h
deleted file mode 100644
index f1cfca98ec..0000000000
--- a/c/src/exec/libnetworking/vm/vm_param.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * The Mach Operating System project at Carnegie-Mellon University.
- *
- * 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.
- *
- * from: @(#)vm_param.h 8.1 (Berkeley) 6/11/93
- *
- *
- * Copyright (c) 1987, 1990 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Authors: Avadis Tevanian, Jr., Michael Wayne Young
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- *
- * $Id$
- */
-
-/*
- * Machine independent virtual memory parameters.
- */
-
-#ifndef _VM_PARAM_
-#define _VM_PARAM_
-
-#include <machine/vmparam.h>
-
-/*
- * The machine independent pages are refered to as PAGES. A page
- * is some number of hardware pages, depending on the target machine.
- */
-#define DEFAULT_PAGE_SIZE 4096
-
-#if 0
-
-/*
- * All references to the size of a page should be done with PAGE_SIZE
- * or PAGE_SHIFT. The fact they are variables is hidden here so that
- * we can easily make them constant if we so desire.
- */
-#ifndef PAGE_SIZE
-#define PAGE_SIZE cnt.v_page_size /* size of page */
-#endif
-#ifndef PAGE_MASK
-#define PAGE_MASK page_mask /* size of page - 1 */
-#endif
-#ifndef PAGE_SHIFT
-#define PAGE_SHIFT page_shift /* bits to shift for pages */
-#endif
-
-#endif
-
-#ifdef KERNEL
-extern vm_size_t page_mask;
-extern int page_shift;
-
-#endif
-
-/*
- * CTL_VM identifiers
- */
-#define VM_METER 1 /* struct vmmeter */
-#define VM_LOADAVG 2 /* struct loadavg */
-#define VM_V_FREE_MIN 3 /* cnt.v_free_min */
-#define VM_V_FREE_TARGET 4 /* cnt.v_free_target */
-#define VM_V_FREE_RESERVED 5 /* cnt.v_free_reserved */
-#define VM_V_INACTIVE_TARGET 6 /* cnt.v_inactive_target */
-#define VM_V_CACHE_MIN 7 /* cnt.v_cache_max */
-#define VM_V_CACHE_MAX 8 /* cnt.v_cache_min */
-#define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min */
-#define VM_PAGEOUT_ALGORITHM 10 /* pageout algorithm */
-#define VM_SWAPPING_ENABLED 11 /* swapping enabled */
-#define VM_MAXID 12 /* number of valid vm ids */
-
-#define CTL_VM_NAMES { \
- { 0, 0 }, \
- { "vmmeter", CTLTYPE_STRUCT }, \
- { "loadavg", CTLTYPE_STRUCT }, \
- { "v_free_min", CTLTYPE_INT }, \
- { "v_free_target", CTLTYPE_INT }, \
- { "v_free_reserved", CTLTYPE_INT }, \
- { "v_inactive_target", CTLTYPE_INT }, \
- { "v_cache_min", CTLTYPE_INT }, \
- { "v_cache_max", CTLTYPE_INT }, \
- { "v_pageout_free_min", CTLTYPE_INT}, \
- { "pageout_algorithm", CTLTYPE_INT}, \
- { "swapping_enabled", CTLTYPE_INT},\
-}
-
-/*
- * Return values from the VM routines.
- */
-#define KERN_SUCCESS 0
-#define KERN_INVALID_ADDRESS 1
-#define KERN_PROTECTION_FAILURE 2
-#define KERN_NO_SPACE 3
-#define KERN_INVALID_ARGUMENT 4
-#define KERN_FAILURE 5
-#define KERN_RESOURCE_SHORTAGE 6
-#define KERN_NOT_RECEIVER 7
-#define KERN_NO_ACCESS 8
-
-#ifndef ASSEMBLER
-/*
- * Convert addresses to pages and vice versa.
- * No rounding is used.
- */
-#ifdef KERNEL
-#define num_pages(x) \
- ((vm_offset_t)((((vm_offset_t)(x)) + PAGE_MASK) >> PAGE_SHIFT))
-
-extern vm_size_t mem_size; /* size of physical memory (bytes) */
-extern vm_offset_t first_addr; /* first physical page */
-extern vm_offset_t last_addr; /* last physical page */
-#endif /* KERNEL */
-#endif /* ASSEMBLER */
-#endif /* _VM_PARAM_ */
diff --git a/c/src/exec/posix/Makefile.in b/c/src/exec/posix/Makefile.in
deleted file mode 100644
index edf011951a..0000000000
--- a/c/src/exec/posix/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=base sys headers $(INLINE) optman src
diff --git a/c/src/exec/posix/base/Makefile.in b/c/src/exec/posix/base/Makefile.in
deleted file mode 100644
index 1d2e92cca0..0000000000
--- a/c/src/exec/posix/base/Makefile.in
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-#H_PIECES= aio devctl intr limits mqueue pthread sched semaphore \
-# signal time unistd
-H_PIECES= pthread sched
-# limits.h may have been moved into newlib -- check before removing it
-# from the cvs tree
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-SRCS=$(H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)
diff --git a/c/src/exec/posix/base/aio.h b/c/src/exec/posix/base/aio.h
deleted file mode 100644
index 6348da4c15..0000000000
--- a/c/src/exec/posix/base/aio.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* aio.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_ASYNCHRONOUS_IO_h
-#define __POSIX_ASYNCHRONOUS_IO_h
-
-#include <rtems/posix/features.h>
-
-#if defined(_POSIX_ASYNCHRONOUS_IO)
-
-/*
- * 6.7.1 Data Definitions for Asynchronous Input and Output,
- * P1003.1b-1993, p. 151
- */
-
-#include <sys/types.h>
-#include <signal.h>
-#include <time.h>
-#include <fcntl.h>
-
-/*
- * 6.7.1.2 Manifest Constants, P1003.1b-1993, p. 153
- */
-
-#define AIO_CANCELED 0 /* all requested operations have been canceled */
-#define AIO_NOTCANCELED 1 /* some of the operations could not be canceled */
- /* since they are in progress */
-#define AIO_ALLDONE 2 /* none of the requested operations could be */
- /* canceled since they are already complete */
-
-/* lio_listio() options */
-
-#define LIO_WAIT 0 /* calling process is to suspend until the */
- /* operation is complete */
-#define LIO_NOWAIT 1 /* calling process is to continue execution while */
- /* the operation is performed and no notification */
- /* shall be given when the operation is completed */
-#define LIO_READ 2 /* request a read() */
-#define LIO_WRITE 3 /* request a write() */
-#define LIO_NOP 4 /* no transfer is requested */
-
-/*
- * 6.7.1.1 Asynchronous I/O Control Block, P1003.1b-1993, p. 151
- */
-
-struct aiocb {
- int aio_fildes; /* File descriptor */
- off_t aio_offset; /* File offset */
- volatile void *aio_buf; /* Location of buffer */
- size_t aio_nbytes; /* Length of transfer */
- int aio_reqprio; /* Request priority offset */
- struct sigevent aio_sigevent; /* Signal number and value */
- int aoi_lio_opcode; /* Operation to be performed */
-};
-
-/*
- * 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154
- */
-
-int aio_read(
- struct aiocb *aiocbp
-);
-
-/*
- * 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155
- */
-
-int aio_write(
- struct aiocb *aiocbp
-);
-
-/*
- * 6.7.4 List Directed I/O, P1003.1b-1993, p. 158
- */
-
-int lio_listio(
- int mode,
- struct aiocb * const list[],
- int nent,
- struct sigevent *sig
-);
-
-/*
- * 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161
- */
-
-int aio_error(
- const struct aiocb *aiocbp
-);
-
-/*
- * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
- * P1003.1b-1993, p. 162
- */
-
-int aio_return(
- const struct aiocb *aiocbp
-);
-
-/*
- * 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163
- */
-
-int aio_cancel(
- int filedes,
- struct aiocb *aiocbp
-);
-
-/*
- * 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164
- */
-
-int aio_suspend(
- struct aiocb * const list[],
- int nent,
- const struct timespec *timeout
-);
-
-#if defined(_POSIX_SYNCHRONIZED_IO)
-
-/*
- * 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166
- */
-
-int aio_fsync(
- int op,
- struct aiocb *aiocbp
-);
-
-#endif /* _POSIX_SYNCHRONIZED_IO */
-
-#endif /* _POSIX_ASYNCHRONOUS_IO */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/base/devctl.h b/c/src/exec/posix/base/devctl.h
deleted file mode 100644
index 5073b475ee..0000000000
--- a/c/src/exec/posix/base/devctl.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* devctl.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_DEVICE_CONTROL_h
-#define __POSIX_DEVICE_CONTROL_h
-
-#include <rtems/posix/features.h>
-
-#if defined(_POSIX_DEVICE_CONTROL)
-
-#include <sys/types.h>
-#include <unistd.h>
-
-/*
- * 21.2.1 Control a Device, P1003.4b/D8, p. 65
- */
-
-int devctl(
- int filedes,
- void *dev_data_ptr,
- size_t nbyte,
- int *dev_info_ptr
-);
-
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/base/intr.h b/c/src/exec/posix/base/intr.h
deleted file mode 100644
index f07d1f9552..0000000000
--- a/c/src/exec/posix/base/intr.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* intr.h
- *
- * XXX: It is unclear if the type "intr_t" should be defined when
- * _POSIX_INTERRUPT_CONTROL is not.
- *
- * $Id$
- */
-
-#ifndef __POSIX_INTERRUPTS_h
-#define __POSIX_INTERRUPTS_h
-
-#include <rtems/posix/features.h>
-#include <sys/types.h>
-#include <sys/time.h>
-
-#if defined(_POSIX_INTERRUPT_CONTROL)
-
-/*
- * 22.2 Concepts, P1003.4b/D8, p. 73
- */
-
-typedef int intr_t;
-
-/*
- * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
- */
-
-/*
- * Return codes from an interrupt handler
- */
-
-#define INTR_HANDLED_NOTIFY 0 /* ISR handled this interrupt, notify */
- /* the thread that registered the */
- /* ISR that the interrupt occurred. */
-#define INTR_HANDLED_DO_NOT_NOTIFY 1 /* ISR handled this interrupt, but */
- /* do NOT perform notification. */
-#define INTR_NOT_HANDLED 2 /* ISR did not handle this interrupt, */
- /* let the next handler try. */
-
-int intr_capture(
- intr_t intr,
- int (*intr_handler)( void *area ),
- volatile void *area,
- size_t areasize
-);
-
-int intr_release(
- intr_t intr,
- int (*intr_handler)( void *area )
-);
-
-int intr_lock(
- intr_t intr
-);
-
-int intr_unlock(
- intr_t intr
-);
-
-/*
- * 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76
- */
-
-int intr_timed_wait(
- int flags,
- const struct timespec *timeout
-);
-
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/base/limits.h b/c/src/exec/posix/base/limits.h
deleted file mode 100644
index e8ac4bf2fd..0000000000
--- a/c/src/exec/posix/base/limits.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/* limits.h
- *
- * This file lists the minimums for the limits set by each of
- * the POSIX features subsets.
- *
- * XXX: Careful attention needs to be paid to section 2.8 in 1003.1b-1993
- * to segregrate the variables below based on their "class" according
- * to our implementation. We also need to set the Run-Time Invariant
- * and other related values.
- *
- * $Id$
- */
-
-#include_next <limits.h>
-
-#ifndef __POSIX_LIMITS_h
-#define __POSIX_LIMITS_h
-
-/* really only to get min stack size from <rtems/score/cpu.h> */
-#include <rtems/system.h>
-
-/****************************************************************************
- ****************************************************************************
- * *
- * P1003.1b-1993 defines the constants below this comment. *
- * *
- ****************************************************************************
- ****************************************************************************/
-
-#define _POSIX_AIO_LISTIO_MAX 2
-#define _POSIX_AIO_MAX 1
-#define _POSIX_ARG_MAX 4096
-#define _POSIX_CHILD_MAX 6
-#define _POSIX_DELAYTIMER_MAX 32
-#define _POSIX_LINK_MAX 8
-#define _POSIX_MAX_CANON 255
-#define _POSIX_MAX_INPUT 255
-#define _POSIX_MQ_OPEN_MAX 8
-#define _POSIX_MQ_PRIO_MAX 32
-#define _POSIX_NAME_MAX 14
-#define _POSIX_NGROUPS_MAX 0
-#define _POSIX_OPEN_MAX 16
-#define _POSIX_PATH_MAX 255
-#define _POSIX_PIPE_BUF 512
-#define _POSIX_RTSIG_MAX 8
-#define _POSIX_SEM_NSEMS_MAX 256
-#define _POSIX_SEM_VALUE_MAX 32767
-#define _POSIX_SIGQUEUE_MAX 32
-#define _POSIX_SSIZE_MAX 32767
-#define _POSIX_STREAM_MAX 8
-#define _POSIX_TIMER_MAX 32
-#define _POSIX_TZNAME_MAX 3
-
-/*
- * Definitions of the following may be omitted if the value is >= stated
- * minimum but is indeterminate.
- */
-
-#define AIO_LISTIO_MAX 2
-#define AIO_MAX 1
-#define AIO_PRIO_DELTA_MAX 0
-#define ARG_MAX 4096
-#define CHILD_MAX 6
-#define DELAYTIMER_MAX 32
-#define MQ_OPEN_MAX 8
-#define MQ_PRIO_MAX 32
-#define OPEN_MAX 16
-#define PAGESIZE 1
-#define RTSIG_MAX 8
-#define SEM_NSEMS_MAX 256
-#define SEM_VALUE_MAX 32767
-#define SIGQUEUE_MAX 32
-#define STREAM_MAX 8
-#define TIMER_MAX 32
-#define TZNAME_MAX 3
-
-/*
- * Pathname Variables
- */
-
-#define LINK_MAX 8
-#define MAX_CANON 255
-#define MAX_INPUT 255
-#define NAME_MAX 14
-#define PATH_MAX 255
-#define PIPE_BUF 512
-
-/*
- * Invariant values
- */
-
-#define SSIZE_MAX 32767
-
-/*
- * Maximum Values
- */
-
-#define _POSIX_CLOCKRES_MIN 0 /* in nanoseconds */
-
-/****************************************************************************
- ****************************************************************************
- * *
- * P1003.1c/D10 defines the constants below this comment. *
- *
- * XXX: doc seems to have printing problems in this table :(
- * *
- ****************************************************************************
- ****************************************************************************/
-
-#define _POSIX_LOGIN_NAME_MAX 9
-#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
-#define _POSIX_THREAD_KEYS_MAX 28
-#define _POSIX_THREAD_THREADS_MAX 64
-#define _POSIX_TTY_NAME_MAX 9
-
-/*
- * Definitions of the following may be omitted if the value is >= stated
- * minimum but is indeterminate.
- */
-
-#define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
-#define TTY_NAME_MAX _POSIX_TTY_NAME_MAX
-#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
-#define PTHREAD_STACK_MIN CPU_STACK_MINIMUM_SIZE
-
-/*
- * The maximum number of keys (PTHREAD_KEYS_MAX) and threads
- * (PTHREAD_THREADS_MAX) are configurable and may exceed the minimum.
- *
-#define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX
-#define PTHREAD_THREADS_MAX _POSIX_THREAD_THREADS_MAX
-*/
-
-
-/****************************************************************************
- ****************************************************************************
- * *
- * P1003.4b/D8 defines the constants below this comment. *
- * *
- ****************************************************************************
- ****************************************************************************/
-
-#define _POSIX_INTERRUPT_OVERRUN_MAX 32
-
-/*
- * Definitions of the following may be omitted if the value is >= stated
- * minimum but is indeterminate.
- */
-
-#define INTERRUPT_OVERRUN_MAX 32
-
-/*
- * Pathname Variables
- */
-
-#define MIN_ALLOC_SIZE
-#define REC_MIN_XFER_SIZE
-#define REC_MAX_XFER_SIZE
-#define REC_INCR_XFER_SIZE
-#define REC_XFER_ALIGN
-#define MAX_ATOMIC_SIZE
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/base/mqueue.h b/c/src/exec/posix/base/mqueue.h
deleted file mode 100644
index f1b2250e5c..0000000000
--- a/c/src/exec/posix/base/mqueue.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/* mqueue.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_MESSAGE_QUEUE_h
-#define __POSIX_MESSAGE_QUEUE_h
-
-#include <rtems/posix/features.h>
-
-#if defined(_POSIX_MESSAGE_PASSING)
-
-#include <sys/types.h>
-
-#include <rtems/system.h>
-#include <rtems/score/object.h>
-
-/*
- * 15.1.1 Data Structures, P1003.1b-1993, p. 271
- */
-
-typedef Objects_Id mqd_t;
-
-struct mq_attr {
- long mq_flags; /* Message queue flags */
- long mq_maxmsg; /* Maximum number of messages */
- long mq_msgsize; /* Maximum message size */
- long mq_curmsgs; /* Number of messages currently queued */
-};
-
-/*
- * 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
- */
-
-mqd_t mq_open(
- const char *name,
- int oflag,
- ...
-);
-
-/*
- * 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275
- */
-
-int mq_close(
- mqd_t mqdes
-);
-
-/*
- * 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276
- */
-
-int mq_unlink(
- const char *name
-);
-
-/*
- * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
- *
- * NOTE: P1003.4b/D8, p. 45 adds mq_timedsend().
- */
-
-int mq_send(
- mqd_t mqdes,
- const char *msg_ptr,
- size_t msg_len,
- unsigned int msg_prio
-);
-
-#if defined(_POSIX_TIMEOUTS)
-
-#include <time.h>
-
-int mq_timedsend(
- mqd_t mqdes,
- const char *msg_ptr,
- size_t msg_len,
- unsigned int msg_prio,
- const struct timespec *timeout
-);
-
-#endif /* _POSIX_TIMEOUTS */
-
-/*
- * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
- *
- * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
- */
-
-ssize_t mq_receive(
- mqd_t mqdes,
- char *msg_ptr,
- size_t msg_len,
- unsigned int *msg_prio
-);
-
-#if defined(_POSIX_TIMEOUTS)
-
-int mq_timedreceive( /* XXX: should this be ssize_t */
- mqd_t mqdes,
- char *msg_ptr,
- size_t msg_len,
- unsigned int *msg_prio,
- const struct timespec *timeout
-);
-
-#endif /* _POSIX_TIMEOUTS */
-
-#if defined(_POSIX_REALTIME_SIGNALS)
-
-/*
- * 15.2.6 Notify Process that a Message is Available on a Queue,
- * P1003.1b-1993, p. 280
- */
-
-int mq_notify(
- mqd_t mqdes,
- const struct sigevent *notification
-);
-
-#endif /* _POSIX_REALTIME_SIGNALS */
-
-/*
- * 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281
- */
-
-int mq_setattr(
- mqd_t mqdes,
- const struct mq_attr *mqstat,
- struct mq_attr *omqstat
-);
-
-/*
- * 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
- */
-
-int mq_getattr(
- mqd_t mqdes,
- struct mq_attr *mqstat
-);
-
-#endif /* _POSIX_MESSAGE_PASSING */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/base/pthread.h b/c/src/exec/posix/base/pthread.h
deleted file mode 100644
index d70a794f38..0000000000
--- a/c/src/exec/posix/base/pthread.h
+++ /dev/null
@@ -1,500 +0,0 @@
-/* pthread.h
- *
- * $Id$
- */
-
-#ifndef __PTHREAD_h
-#define __PTHREAD_h
-
-#include <sys/features.h>
-
-#if defined(_POSIX_THREADS)
-
-#include <sys/types.h>
-#include <time.h>
-#include <sys/sched.h>
-
-/*
- * 3.1.3 Register Fork Handlers, P1003.1c/Draft 10, P1003.1c/Draft 10, p. 27
- *
- * RTEMS does not support processes, so we fall under this and do not
- * provide this routine:
- *
- * "Either the implementation shall support the pthread_atfork() function
- * as described above or the pthread_atfork() funciton shall not be
- * provided."
- */
-
-/*
- * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
- */
-
-int pthread_mutexattr_init(
- pthread_mutexattr_t *attr
-);
-
-int pthread_mutexattr_destroy(
- pthread_mutexattr_t *attr
-);
-
-int pthread_mutexattr_getpshared(
- const pthread_mutexattr_t *attr,
- int *pshared
-);
-
-int pthread_mutexattr_setpshared(
- pthread_mutexattr_t *attr,
- int pshared
-);
-
-/*
- * 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87
- */
-
-int pthread_mutex_init(
- pthread_mutex_t *mutex,
- const pthread_mutexattr_t *attr
-);
-
-int pthread_mutex_destroy(
- pthread_mutex_t *mutex
-);
-
-/*
- * This is used to statically initialize a pthread_mutex_t. Example:
- *
- * pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
- */
-
-#define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) 0xFFFFFFFF)
-
-/*
- * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93
- *
- * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29
- */
-
-int pthread_mutex_lock(
- pthread_mutex_t *mutex
-);
-
-int pthread_mutex_trylock(
- pthread_mutex_t *mutex
-);
-
-int pthread_mutex_unlock(
- pthread_mutex_t *mutex
-);
-
-#if defined(_POSIX_TIMEOUTS)
-
-int pthread_mutex_timedlock(
- pthread_mutex_t *mutex,
- const struct timespec *timeout
-);
-
-#endif /* _POSIX_TIMEOUTS */
-
-/*
- * 11.4.1 Condition Variable Initialization Attributes,
- * P1003.1c/Draft 10, p. 96
- */
-
-int pthread_condattr_init(
- pthread_condattr_t *attr
-);
-
-int pthread_condattr_destroy(
- pthread_condattr_t *attr
-);
-
-int pthread_condattr_getpshared(
- const pthread_condattr_t *attr,
- int *pshared
-);
-
-int pthread_condattr_setpshared(
- pthread_condattr_t *attr,
- int pshared
-);
-
-/*
- * 11.4.2 Initializing and Destroying a Condition Variable,
- * P1003.1c/Draft 10, p. 87
- */
-
-int pthread_cond_init(
- pthread_cond_t *cond,
- const pthread_condattr_t *attr
-);
-
-int pthread_cond_destroy(
- pthread_cond_t *mutex
-);
-
-/*
- * This is used to statically initialize a pthread_cond_t. Example:
- *
- * pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
- */
-
-#define PTHREAD_COND_INITIALIZER ((pthread_mutex_t) 0xFFFFFFFF)
-
-/*
- * 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101
- */
-
-int pthread_cond_signal(
- pthread_cond_t *cond
-);
-
-int pthread_cond_broadcast(
- pthread_cond_t *cond
-);
-
-/*
- * 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105
- */
-
-int pthread_cond_wait(
- pthread_cond_t *cond,
- pthread_mutex_t *mutex
-);
-
-int pthread_cond_timedwait(
- pthread_cond_t *cond,
- pthread_mutex_t *mutex,
- const struct timespec *abstime
-);
-
-#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
-
-/*
- * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_setscope(
- pthread_attr_t *attr,
- int contentionscope
-);
-
-int pthread_attr_getscope(
- const pthread_attr_t *attr,
- int *contentionscope
-);
-
-int pthread_attr_setinheritsched(
- pthread_attr_t *attr,
- int inheritsched
-);
-
-int pthread_attr_getinheritsched(
- const pthread_attr_t *attr,
- int *inheritsched
-);
-
-int pthread_attr_setschedpolicy(
- pthread_attr_t *attr,
- int policy
-);
-
-int pthread_attr_getschedpolicy(
- const pthread_attr_t *attr,
- int *policy
-);
-
-#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */
-
-int pthread_attr_setschedparam(
- pthread_attr_t *attr,
- const struct sched_param *param
-);
-
-int pthread_attr_getschedparam(
- const pthread_attr_t *attr,
- struct sched_param *param
-);
-
-#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
-
-/*
- * 13.5.2 Dynamic Thread Scheduling Parameters Access,
- * P1003.1c/Draft 10, p. 124
- */
-
-int pthread_getschedparam(
- pthread_t thread,
- int *policy,
- struct sched_param *param
-);
-
-int pthread_setschedparam(
- pthread_t thread,
- int policy,
- struct sched_param *param
-);
-
-#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */
-
-#if defined(_POSIX_THREAD_PRIO_INHERIT) || defined(_POSIX_THREAD_PRIO_PROTECT)
-
-/*
- * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
- */
-
-int pthread_mutexattr_setprotocol(
- pthread_mutexattr_t *attr,
- int protocol
-);
-
-int pthread_mutexattr_getprotocol(
- const pthread_mutexattr_t *attr,
- int *protocol
-);
-
-int pthread_mutexattr_setprioceiling(
- pthread_mutexattr_t *attr,
- int prioceiling
-);
-
-int pthread_mutexattr_getprioceiling(
- const pthread_mutexattr_t *attr,
- int *prioceiling
-);
-
-#endif /* _POSIX_THREAD_PRIO_INHERIT || _POSIX_THREAD_PRIO_PROTECT */
-
-#if defined(_POSIX_THREAD_PRIO_PROTECT)
-
-/*
- * 13.6.2 Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131
- */
-
-int pthread_mutex_setprioceiling(
- pthread_mutex_t *mutex,
- int prioceiling,
- int *old_ceiling
-);
-
-int pthread_mutex_getprioceiling(
- pthread_mutex_t *mutex,
- int *prioceiling
-);
-
-#endif /* _POSIX_THREAD_PRIO_PROTECT */
-
-/*
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_init(
- pthread_attr_t *attr
-);
-
-int pthread_attr_destroy(
- pthread_attr_t *attr
-);
-
-int pthread_attr_getstacksize(
- const pthread_attr_t *attr,
- size_t *stacksize
-);
-
-int pthread_attr_setstacksize(
- pthread_attr_t *attr,
- size_t stacksize
-);
-
-int pthread_attr_getstackaddr(
- const pthread_attr_t *attr,
- void **stackaddr
-);
-
-int pthread_attr_setstackaddr(
- pthread_attr_t *attr,
- void *stackaddr
-);
-
-int pthread_attr_getdetachstate(
- const pthread_attr_t *attr,
- int *detachstate
-);
-
-int pthread_attr_setdetachstate(
- pthread_attr_t *attr,
- int detachstate
-);
-
-/*
- * 16.1.2 Thread Creation, P1003.1c/Draft 10, p. 144
- */
-
-int pthread_create(
- pthread_t *thread,
- const pthread_attr_t *attr,
- void *(*start_routine)( void * ),
- void *arg
-);
-
-/*
- * 16.1.3 Wait for Thread Termination, P1003.1c/Draft 10, p. 147
- */
-
-int pthread_join(
- pthread_t thread,
- void **value_ptr
-);
-
-/*
- * 16.1.4 Detaching a Thread, P1003.1c/Draft 10, p. 149
- */
-
-int pthread_detach(
- pthread_t thread
-);
-
-/*
- * 16.1.5.1 Thread Termination, p1003.1c/Draft 10, p. 150
- */
-
-void pthread_exit(
- void *value_ptr
-);
-
-/*
- * 16.1.6 Get Calling Thread's ID, p1003.1c/Draft 10, p. XXX
- */
-
-pthread_t pthread_self( void );
-
-/*
- * 16.1.7 Compare Thread IDs, p1003.1c/Draft 10, p. 153
- */
-
-int pthread_equal(
- pthread_t t1,
- pthread_t t2
-);
-
-/*
- * 16.1.8 Dynamic Package Initialization
- */
-
-/*
- * This is used to statically initialize a pthread_once_t. Example:
- *
- * pthread_once_t once = PTHREAD_ONCE_INIT;
- *
- * NOTE: This is named inconsistently -- it should be INITIALIZER.
- */
-
-#define PTHREAD_ONCE_INIT { 1, 0 } /* is initialized and not run */
-
-int pthread_once(
- pthread_once_t *once_control,
- void (*init_routine)(void)
-);
-
-/*
- * 17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163
- */
-
-int pthread_key_create(
- pthread_key_t *key,
- void (*destructor)( void * )
-);
-
-/*
- * 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165
- */
-
-int pthread_setspecific(
- pthread_key_t key,
- const void *value
-);
-
-void *pthread_getspecific(
- pthread_key_t key
-);
-
-/*
- * 17.1.3 Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167
- */
-
-int pthread_key_delete(
- pthread_key_t key
-);
-
-/*
- * 18.2.1 Canceling Execution of a Thread, P1003.1c/Draft 10, p. 181
- */
-
-#define PTHREAD_CANCEL_ENABLE 0
-#define PTHREAD_CANCEL_DISABLE 1
-
-#define PTHREAD_CANCEL_DEFERRED 0
-#define PTHREAD_CANCEL_ASYNCHRONOUS 1
-
-int pthread_cancel(
- pthread_t thread
-);
-
-/*
- * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
- */
-
-int pthread_setcancelstate(
- int state,
- int *oldstate
-);
-
-int pthread_setcanceltype(
- int type,
- int *oldtype
-);
-
-void pthread_testcancel( void );
-
-/*
- * 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184
- */
-
-void pthread_cleanup_push(
- void (*routine)( void * ),
- void *arg
-);
-
-void pthread_cleanup_pop(
- int execute
-);
-
-#if defined(_POSIX_THREAD_CPUTIME)
-
-/*
- * 20.1.6 Accessing a Thread CPU-time Clock, P1003.4b/D8, p. 58
- */
-
-int pthread_getcpuclockid(
- pthread_t thread_id,
- clockid_t *clock_id
-);
-
-/*
- * 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/D8, p. 59
- */
-
-int pthread_attr_setcputime(
- pthread_attr_t *attr,
- int clock_allowed
-);
-
-int pthread_attr_getcputime(
- pthread_attr_t *attr,
- int *clock_allowed
-);
-
-#endif /* defined(_POSIX_THREAD_CPUTIME) */
-
-#endif /* defined(_POSIX_THREADS) */
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/base/sched.h b/c/src/exec/posix/base/sched.h
deleted file mode 100644
index 14a603c0c5..0000000000
--- a/c/src/exec/posix/base/sched.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* sched.h
- *
- * $Id$
- */
-
-
-#ifndef __POSIX_SCHEDULING_h
-#define __POSIX_SCHEDULING_h
-
-#include <sys/features.h>
-
-#if defined(_POSIX_PRIORITY_SCHEDULING)
-
-#include <sys/types.h>
-#include <time.h>
-#include <sys/sched.h>
-#include <pthread.h>
-
-/*
- * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252
- *
- */
-
-int sched_setparam(
- pid_t pid,
- const struct sched_param *param
-);
-
-/*
- * 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253
- */
-
-int sched_getparam(
- pid_t pid,
- const struct sched_param *param
-);
-
-/*
- * 13.3.3 Set Scheduling Policy and Scheduling Parameters,
- * P1003.1b-1993, p. 254
- */
-
-int sched_setscheduler(
- pid_t pid,
- int policy,
- const struct sched_param *param
-);
-
-/*
- * 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256
- */
-
-int sched_getscheduler(
- pid_t pid
-);
-
-/*
- * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
- */
-
-int sched_get_priority_max(
- int policy
-);
-
-int sched_get_priority_min(
- int policy
-);
-
-int sched_rr_get_interval(
- pid_t pid,
- struct timespec *interval
-);
-
-#endif /* _POSIX_PRIORITY_SCHEDULING */
-
-#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING)
-
-/*
- * 13.3.5 Yield Processor, P1003.1b-1993, p. 257
- */
-
-int sched_yield( void );
-
-#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/base/semaphore.h b/c/src/exec/posix/base/semaphore.h
deleted file mode 100644
index 0388f91ad9..0000000000
--- a/c/src/exec/posix/base/semaphore.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* semaphore.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_SEMAPHORE_h
-#define __POSIX_SEMAPHORE_h
-
-#include <rtems/posix/features.h>
-
-#if defined(_POSIX_SEMAPHORES)
-
-#include <sys/time.h>
-
-/*
- * 11.1 Semaphore Characteristics, P1003.1b-1993, p.219
- */
-
-typedef int sem_t;
-
-/*
- * 11.2.1 Initialize an Unnamed Semaphore, P1003.1b-1993, p.219
- */
-
-int sem_init(
- sem_t *sem,
- int pshared,
- unsigned int value
-);
-
-/*
- * 11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220
- */
-
-int sem_destroy(
- sem_t *sem
-);
-
-/*
- * 11.2.3 Initialize/Open a Named Semaphore, P1003.1b-1993, p.221
- *
- * NOTE: Follows open() calling conventions.
- */
-
-sem_t *sem_open(
- const char *name,
- int oflag,
- ...
-);
-
-/*
- * 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224
- */
-
-int sem_close(
- sem_t *sem
-);
-
-/*
- * 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225
- */
-
-int sem_unlink(
- const char *name
-);
-
-/*
- * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226
- *
- * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27
- */
-
-int sem_wait(
- sem_t *sem
-);
-
-int sem_trywait(
- sem_t *sem
-);
-
-#if defined(_POSIX_TIMEOUTS)
-int sem_timedwait(
- sem_t *sem,
- const struct timespec *timeout
-);
-#endif
-
-/*
- * 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227
- */
-
-int sem_post(
- sem_t *sem
-);
-
-/*
- * 11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229
- */
-
-int sem_getvalue(
- sem_t *sem,
- int *sval
-);
-
-#endif /* _POSIX_SEMAPHORES */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/base/unistd.h b/c/src/exec/posix/base/unistd.h
deleted file mode 100644
index 0001ecc475..0000000000
--- a/c/src/exec/posix/base/unistd.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* unistd.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_UNISTD_h
-#define __POSIX_UNISTD_h
-
-#include <rtems/posix/features.h>
-
-/*
- * 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 96
- *
- * NOTE: Table 4-2, Configurable System Variables, p. 96
- */
-
-#define _SC_AIO_LISTIO_MAX 0
-#define _SC_AIO_MAX 1
-#define _SC_AIO_PRIO_DELTA_MAX 2
-#define _SC_ARG_MAX 3
-#define _SC_CHILD_MAX 4
-#define _SC_CLK_TCK 5
-#define _SC_DELAYTIMER_MAX 6
-#define _SC_MQ_OPEN_MAX 7
-#define _SC_MQ_PRIO_MAX 8
-#define _SC_NGROUPS_MAX 9
-#define _SC_OPEN_MAX 10
-#define _SC_PAGESIZE 11
-#define _SC_RTSIG_MAX 12
-#define _SC_SEM_NSEMS_MAX 13
-#define _SC_SEM_VALUE_MAX 14
-#define _SC_SIGQUEUE_MAX 15
-#define _SC_STREAM_MAX 16
-#define _SC_TIMER_MAX 17
-#define _SC_TZNAME_MAX 18
-
-#define _SC_ASYNCHRONOUS_IO 19
-#define _SC_FSYNC 20
-#define _SC_JOB_CONTROL 21
-#define _SC_MAPPED_FILES 22
-#define _SC_MEMLOCK 23
-#define _SC_MEMLOCK_RANGE 24
-#define _SC_MEMORY_PROTECTION 25
-#define _SC_MESSAGE_PASSING 26
-#define _SC_PRIORITIZED_IO 27
-#define _SC_REALTIME_SIGNALS 28
-#define _SC_SAVED_IDS 29
-#define _SC_SEMAPHORES 30
-#define _SC_SHARED_MEMORY_OBJECTS 31
-#define _SC_SYNCHRONIZED_IO 32
-#define _SC_TIMERS 33
-#define _SC_VERSION 34
-
-/*
- * P1003.1c/D10, p. 52 adds the following.
- */
-
-#define _SC_GETGR_R_SIZE_MAX 35
-#define _SC_GETPW_R_SIZE_MAX 36
-#define _SC_LOGIN_NAME_MAX 37
-#define _SC_THREAD_DESTRUCTOR_ITERATIONS 38
-#define _SC_THREAD_KEYS_MAX 39
-#define _SC_THREAD_STACK_MIN 40
-#define _SC_THREAD_THREADS_MAX 41
-#define _SC_TTY_NAME_MAX 42
-
-#define _SC_THREADS 43
-#define _SC_THREAD_ATTR_STACKADDR 44
-#define _SC_THREAD_ATTR_STACKSIZE 45
-#define _SC_THREAD_PRIORITY_SCHEDULING 46
-#define _SC_THREAD_PRIO_INHERIT 47
-#define _SC_THREAD_PRIO_CEILING 48
-#define _SC_THREAD_PROCESS_SHARED 49
-#define _SC_THREAD_SAFE_FUNCTIONS 50
-
-/* JRS: 04/02/98: _SC_THREAD_PRIO_CEILING seems to have changed names
- * in the final standard to _SC_THREAD_PRIO_PROTECT.
- */
-
-/*
- * 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 95
- */
-
-long sysconf(
- int name
-);
-
-#endif
-/* end of include */
diff --git a/c/src/exec/posix/headers/Makefile.in b/c/src/exec/posix/headers/Makefile.in
deleted file mode 100644
index 543917d7ed..0000000000
--- a/c/src/exec/posix/headers/Makefile.in
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_PIECES= cond condmp config key mutex mutexmp posixapi \
- priority psignal pthread pthreadmp seterr threadsup time
-#H_PIECES= cancel cond condmp intr key mqueue mqueuemp mutex \
-# mutexmp pthread pthreadmp priority semaphore semaphoremp threadsup \
-# time
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-SRCS=$(H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/posix
diff --git a/c/src/exec/posix/headers/cancel.h b/c/src/exec/posix/headers/cancel.h
deleted file mode 100644
index e6d80275f4..0000000000
--- a/c/src/exec/posix/headers/cancel.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* rtems/posix/cancel.h
- *
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_CANCEL_h
-#define __RTEMS_POSIX_CANCEL_h
-
-typedef struct {
- Chain_Node Node;
- void (*routine)( void * );
- void *arg;
-} POSIX_Cancel_Handler_control;
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/headers/cond.h b/c/src/exec/posix/headers/cond.h
deleted file mode 100644
index 92c2e453ae..0000000000
--- a/c/src/exec/posix/headers/cond.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* rtems/posix/cond.h
- *
- * This include file contains all the private support information for
- * POSIX condition variables.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_CONDITION_VARIABLES_h
-#define __RTEMS_POSIX_CONDITION_VARIABLES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/threadq.h>
-
-/*
- * Constant to indicate condition variable does not currently have
- * a mutex assigned to it.
- */
-
-#define POSIX_CONDITION_VARIABLES_NO_MUTEX 0
-
-/*
- * Data Structure used to manage a POSIX condition variable
- */
-
-typedef struct {
- Objects_Control Object;
- int process_shared;
- pthread_mutex_t Mutex;
- Thread_queue_Control Wait_queue;
-} POSIX_Condition_variables_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Condition_variables_Information;
-
-/*
- * _POSIX_Condition_variables_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Condition_variables_Manager_initialization(
- unsigned32 maximum_condition_variables
-);
-
-/*
- * _POSIX_Condition_variables_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a condition variable control block from
- * the inactive chain of free condition variable control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *
- _POSIX_Condition_variables_Allocate( void );
-
-/*
- * _POSIX_Condition_variables_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a condition variable control block to the
- * inactive chain of free condition variable control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
- POSIX_Condition_variables_Control *the_condition_variable
-);
-
-/*
- * _POSIX_Condition_variables_Get
- *
- * DESCRIPTION:
- *
- * This function maps condition variable IDs to condition variable control
- * blocks. If ID corresponds to a local condition variable, then it returns
- * the_condition variable control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the condition variable ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_condition variable is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_condition variable is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
- Objects_Id *id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Condition_variables_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_condition variable is NULL
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
- POSIX_Condition_variables_Control *the_condition_variable
-);
-
-#include <rtems/posix/cond.inl>
-#include <rtems/posix/condmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/headers/condmp.h b/c/src/exec/posix/headers/condmp.h
deleted file mode 100644
index de9c5ce0d4..0000000000
--- a/c/src/exec/posix/headers/condmp.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/* condmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Condition Variable Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_CONDITION_VARIABLES_MP_h
-#define __RTEMS_POSIX_CONDITION_VARIABLES_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote condition variable operations.
- */
-
-typedef enum {
- POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_CREATE = 0,
- POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_DELETE = 1,
- POSIX_CONDITION_VARIABLES_MP_EXTRACT_PROXY = 2,
- POSIX_CONDITION_VARIABLES_MP_OBTAIN_REQUEST = 3,
- POSIX_CONDITION_VARIABLES_MP_OBTAIN_RESPONSE = 4,
- POSIX_CONDITION_VARIABLES_MP_RELEASE_REQUEST = 5,
- POSIX_CONDITION_VARIABLES_MP_RELEASE_RESPONSE = 6,
-} POSIX_Condition_variables_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote condition variable operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Condition_variables_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait; /* XXX options */
- Objects_Id proxy_id;
-} POSIX_Condition_variables_MP_Packet;
-
-/*
- * _POSIX_Condition_variables_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Condition_variables_MP_Send_process_packet (
- POSIX_Condition_variables_MP_Remote_operations operation,
- Objects_Id condition_variables_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Condition_variables_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Condition_variables_MP_Send_request_packet (
- POSIX_Condition_variables_MP_Remote_operations operation,
- Objects_Id condition_variables_id,
- boolean wait, /* XXX options */
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Condition_variables_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Condition_variables_MP_Send_response_packet (
- POSIX_Condition_variables_MP_Remote_operations operation,
- Objects_Id condition_variables_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Condition_variables_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Condition_variables_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Condition_variables_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Condition_variables_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Condition_variables_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Condition_variables_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Condition_variables_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a condition variable mp packet.
- */
-
-POSIX_Condition_variables_MP_Packet
- *_POSIX_Condition_variables_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/posix/headers/config.h b/c/src/exec/posix/headers/config.h
deleted file mode 100644
index 8753c42382..0000000000
--- a/c/src/exec/posix/headers/config.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* config.h
- *
- * This include file contains the table of user defined configuration
- * parameters specific for the POSIX API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_CONFIGURATION_h
-#define __RTEMS_POSIX_CONFIGURATION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * XXX
- *
- * The following records define the Configuration Table. The
- * information contained in this table is required in all
- * RTEMS systems, whether single or multiprocessor. This
- * table primarily defines the following:
- *
- * + required number of each object type
- */
-
-/*
- * For now, we are only allowing the user to specify the entry point
- * for posix initialization threads.
- */
-
-typedef struct {
- void *(*thread_entry)(void *);
-} posix_initialization_threads_table;
-
-typedef struct {
- int maximum_threads;
- int maximum_mutexes;
- int maximum_condition_variables;
- int maximum_keys;
- int maximum_queued_signals;
- int number_of_initialization_threads;
- posix_initialization_threads_table *User_initialization_threads_table;
-} posix_api_configuration_table;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/headers/intr.h b/c/src/exec/posix/headers/intr.h
deleted file mode 100644
index 539c66f058..0000000000
--- a/c/src/exec/posix/headers/intr.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/* rtems/posix/intr.h
- *
- * This include file contains all the private support information for
- * POSIX Interrupt Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_KEY_h
-#define __RTEMS_POSIX_KEY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-
-/*
- * Data Structure used to manage each POSIX Interrupt Vector
- */
-
-typedef struct {
- int number_installed;
- int lock_count;
- int deferred_count;
- Chain_Control Handlers;
-} POSIX_Interrupt_Control;
-
-/*
- * Data Structure used to manage a POSIX Interrupt Handler
- */
-
-typedef struct {
- Objects_Control Object;
- int is_active;
- intr_t vector;
- Thread_Control *server;
- int (*handler)( void *area );
- volatile void *user_data_area;
-} POSIX_Interrupt_Handler_control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Interrupt_Handlers_Information;
-
-/*
- * The following is an array which is used to manage the set of
- * interrupt handlers installed on each vector.
- */
-
-POSIX_EXTERN POSIX_Interrupt_Control
- _POSIX_Interrupt_Information[ ISR_NUMBER_OF_VECTORS ];
-
-/*
- * _POSIX_Interrupt_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Interrupt_Manager_initialization(
- unsigned32 maximum_interrupt_handlers
-);
-
-/*
- * _POSIX_Interrupt_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a interrupt handler control block from
- * the inactive chain of free interrupt handler control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
- _POSIX_Interrupt_Allocate( void );
-
-/*
- * _POSIX_Interrupt_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a interrupt handler control block to the
- * inactive chain of free interrupt handler control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
- POSIX_Interrupt_Handler_control *the_intr
-);
-
-/*
- * _POSIX_Interrupt_Get
- *
- * DESCRIPTION:
- *
- * This function maps interrupt handler IDs to interrupt handler control
- * blocks. If ID corresponds to a local interrupt handler, then it returns
- * the_intr control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the interrupt handler ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_intr is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_intr is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
- Objects_Id id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Interrupt_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_intr is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
- POSIX_Interrupt_Handler_control *the_intr
-);
-
-/*
- * _POSIX_Interrupt_Handler
- *
- * DESCRIPTION:
- *
- * This function XXX.
- */
-
-void _POSIX_Interrupt_Handler(
- ISR_Vector_number vector
-);
-
-#include <rtems/posix/intr.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/headers/key.h b/c/src/exec/posix/headers/key.h
deleted file mode 100644
index 22bfafd594..0000000000
--- a/c/src/exec/posix/headers/key.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/* rtems/posix/key.h
- *
- * This include file contains all the private support information for
- * POSIX key.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_KEY_h
-#define __RTEMS_POSIX_KEY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Data Structure used to manage a POSIX key
- *
- * NOTE: The Values is a table indexed by the index portion of the
- * ID of the currently executing thread.
- */
-
-typedef struct {
- Objects_Control Object;
- boolean is_active;
- void (*destructor)( void * );
- void **Values[ OBJECTS_CLASSES_LAST_THREAD_CLASS + 1 ];
-} POSIX_Keys_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Keys_Information;
-
-/*
- * _POSIX_Keys_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Key_Manager_initialization(
- unsigned32 maximum_keys
-);
-
-/*
- * _POSIX_Keys_Run_destructors
- *
- * DESCRIPTION:
- *
- * This function executes all the destructors associated with the thread's
- * keys. This function will execute until all values have been set to NULL.
- *
- * NOTE: This is the routine executed when a thread exits to
- * run through all the keys and do the destructor action.
- */
-
-void _POSIX_Keys_Run_destructors(
- Thread_Control *thread
-);
-
-/*
- * _POSIX_Keys_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a keys control block from
- * the inactive chain of free keys control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void );
-
-/*
- * _POSIX_Keys_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a keys control block to the
- * inactive chain of free keys control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
- POSIX_Keys_Control *the_key
-);
-
-/*
- * _POSIX_Keys_Get
- *
- * DESCRIPTION:
- *
- * This function maps key IDs to key control blocks.
- * If ID corresponds to a local keys, then it returns
- * the_key control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the keys ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_key is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_key is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
- Objects_Id id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Keys_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_key is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
- POSIX_Keys_Control *the_key
-);
-
-#include <rtems/posix/key.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/headers/mqueue.h b/c/src/exec/posix/headers/mqueue.h
deleted file mode 100644
index 8e2851bfb5..0000000000
--- a/c/src/exec/posix/headers/mqueue.h
+++ /dev/null
@@ -1,186 +0,0 @@
-/* rtems/posix/mqueue.h
- *
- * This include file contains all the private support information for
- * POSIX Message Queues.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MESSAGE_QUEUE_h
-#define __RTEMS_POSIX_MESSAGE_QUEUE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/coremsg.h>
-#include <rtems/score/object.h>
-
-/*
- * Data Structure used to manage a POSIX message queue
- */
-
-typedef struct {
- Objects_Control Object;
- int process_shared;
- int flags;
- boolean named;
- boolean linked;
- boolean blocking;
- unsigned32 open_count;
- CORE_message_queue_Control Message_queue;
- struct sigevent notification;
-} POSIX_Message_queue_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information;
-
-/*
- * _POSIX_Message_queue_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Message_queue_Manager_initialization(
- unsigned32 maximum_message_queues
-);
-
-/*
- *
- * _POSIX_Message_queue_Create_support
- *
- * DESCRIPTION:
- *
- * This routine performs the creation of a message queue utilizing the
- * core message queue.
- */
-
-int _POSIX_Message_queue_Create_support(
- const char *name,
- int pshared,
- unsigned int oflag,
- struct mq_attr *attr,
- POSIX_Message_queue_Control **message_queue
-);
-
-/*
- *
- * _POSIX_Message_queue_Send_support
- *
- * DESCRIPTION:
- *
- * This routine posts a message to a specified message queue.
- */
-
-int _POSIX_Message_queue_Send_support(
- mqd_t mqdes,
- const char *msg_ptr,
- unsigned32 msg_len,
- Priority_Control msg_prio,
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Message_queue_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a message queue control block from
- * the inactive chain of free message queue control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
-
-/*
- * _POSIX_Message_queue_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a message queue control block to the
- * inactive chain of free message queue control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
- POSIX_Message_queue_Control *the_mq
-);
-
-/*
- * _POSIX_Message_queue_Get
- *
- * DESCRIPTION:
- *
- * This function maps message queue IDs to message queue control blocks.
- * If ID corresponds to a local message queue, then it returns
- * the_mq control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the message queue ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_message queue is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_mq is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
- Objects_Id id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Message_queue_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_message_queue is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
- POSIX_Message_queue_Control *the_mq
-);
-
-/*
- * _POSIX_Message_queue_Name_to_id
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-int _POSIX_Message_queue_Name_to_id(
- const char *name,
- Objects_Id *id
-);
-
-/*
- * _POSIX_Message_queue_Priority_to_core
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
- unsigned int priority
-);
-
-#include <rtems/posix/mqueue.inl>
-#include <rtems/posix/mqueuemp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/headers/mqueuemp.h b/c/src/exec/posix/headers/mqueuemp.h
deleted file mode 100644
index 27742014ab..0000000000
--- a/c/src/exec/posix/headers/mqueuemp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* mqueuemp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Message Queue Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MESSAGE_QUEUE_MP_h
-#define __RTEMS_POSIX_MESSAGE_QUEUE_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote message queue operations.
- */
-
-typedef enum {
- POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0,
- POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1,
- POSIX_MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2,
- POSIX_MESSAGE_QUEUE_MP_OBTAIN_REQUEST = 3,
- POSIX_MESSAGE_QUEUE_MP_OBTAIN_RESPONSE = 4,
- POSIX_MESSAGE_QUEUE_MP_RELEASE_REQUEST = 5,
- POSIX_MESSAGE_QUEUE_MP_RELEASE_RESPONSE = 6,
-} POSIX_Message_queue_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote message queue operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Message_queue_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait; /* XXX options */
- Objects_Id proxy_id;
-} POSIX_Message_queue_MP_Packet;
-
-/*
- * _POSIX_Message_queue_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Message_queue_MP_Send_process_packet (
- POSIX_Message_queue_MP_Remote_operations operation,
- Objects_Id mq_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Message_queue_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Message_queue_MP_Send_request_packet (
- POSIX_Message_queue_MP_Remote_operations operation,
- Objects_Id mq_id,
- boolean wait, /* XXX options */
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Message_queue_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Message_queue_MP_Send_response_packet (
- POSIX_Message_queue_MP_Remote_operations operation,
- Objects_Id mq_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Message_queue_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Message_queue_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Message_queue_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Message_queue_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Message_queue_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Message_queue_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Message_queue_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a message queue mp packet.
- */
-
-POSIX_Message_queue_MP_Packet *_POSIX_Message_queue_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/posix/headers/mutex.h b/c/src/exec/posix/headers/mutex.h
deleted file mode 100644
index e6c5c44d39..0000000000
--- a/c/src/exec/posix/headers/mutex.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* rtems/posix/mutex.h
- *
- * This include file contains all the private support information for
- * POSIX mutex's.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MUTEX_h
-#define __RTEMS_POSIX_MUTEX_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/coremutex.h>
-#include <pthread.h>
-
-/*
- * Data Structure used to manage a POSIX mutex
- */
-
-typedef struct {
- Objects_Control Object;
- int process_shared;
- CORE_mutex_Control Mutex;
-} POSIX_Mutex_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Mutex_Information;
-
-/*
- * _POSIX_Mutex_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Mutex_Manager_initialization(
- unsigned32 maximum_mutexes
-);
-
-/*
- * _POSIX_Mutex_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a mutexes control block from
- * the inactive chain of free mutexes control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void );
-
-/*
- * _POSIX_Mutex_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a mutexes control block to the
- * inactive chain of free mutexes control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
- POSIX_Mutex_Control *the_mutex
-);
-
-/*
- * _POSIX_Mutex_Get
- *
- * DESCRIPTION:
- *
- * This function maps mutexes IDs to mutexes control blocks.
- * If ID corresponds to a local mutexes, then it returns
- * the_mutex control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the mutexes ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_mutex is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_mutex is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
- Objects_Id *id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Mutex_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_mutex is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
- POSIX_Mutex_Control *the_mutex
-);
-
-#include <rtems/posix/mutex.inl>
-#include <rtems/posix/mutexmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/headers/mutexmp.h b/c/src/exec/posix/headers/mutexmp.h
deleted file mode 100644
index 71f60677eb..0000000000
--- a/c/src/exec/posix/headers/mutexmp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* mutexmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Mutex Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MUTEX_MP_h
-#define __RTEMS_POSIX_MUTEX_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote mutex operations.
- */
-
-typedef enum {
- POSIX_MUTEX_MP_ANNOUNCE_CREATE = 0,
- POSIX_MUTEX_MP_ANNOUNCE_DELETE = 1,
- POSIX_MUTEX_MP_EXTRACT_PROXY = 2,
- POSIX_MUTEX_MP_OBTAIN_REQUEST = 3,
- POSIX_MUTEX_MP_OBTAIN_RESPONSE = 4,
- POSIX_MUTEX_MP_RELEASE_REQUEST = 5,
- POSIX_MUTEX_MP_RELEASE_RESPONSE = 6,
-} POSIX_Mutex_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote mutex operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Mutex_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait; /* XXX options */
- Objects_Id proxy_id;
-} POSIX_Mutex_MP_Packet;
-
-/*
- * _POSIX_Mutex_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Mutex_MP_Send_process_packet (
- POSIX_Mutex_MP_Remote_operations operation,
- Objects_Id mutex_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Mutex_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Mutex_MP_Send_request_packet (
- POSIX_Mutex_MP_Remote_operations operation,
- Objects_Id mutex_id,
- boolean wait, /* XXX options */
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Mutex_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Mutex_MP_Send_response_packet (
- POSIX_Mutex_MP_Remote_operations operation,
- Objects_Id mutex_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Mutex_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Mutex_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Mutex_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Mutex_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Mutex_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Mutex_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Mutex_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a mutex mp packet.
- */
-
-POSIX_Mutex_MP_Packet *_POSIX_Mutex_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/posix/headers/posixapi.h b/c/src/exec/posix/headers/posixapi.h
deleted file mode 100644
index f7c52985c3..0000000000
--- a/c/src/exec/posix/headers/posixapi.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * POSIX API Support
- *
- * NOTE:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __POSIX_API_h
-#define __POSIX_API_h
-
-#include <rtems/config.h>
-
-/*PAGE
- *
- * _POSIX_API_Initialize
- *
- * XXX
- */
-
-void _POSIX_API_Initialize(
- rtems_configuration_table *configuration_table
-);
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/headers/priority.h b/c/src/exec/posix/headers/priority.h
deleted file mode 100644
index c0253f3bab..0000000000
--- a/c/src/exec/posix/headers/priority.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- *
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_PRIORITY_h
-#define __RTEMS_POSIX_PRIORITY_h
-
-#include <rtems/score/priority.h>
-
-/*
- * 1003.1b-1993,2.2.2.80 definition of priority, p. 19
- *
- * "Numericallly higher values represent higher priorities."
- *
- * Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
- *
- * There are only 254 posix priority levels since a task at priority level
- * 255 would never run because of the RTEMS idle task. This is necessary
- * because GNAT maps the lowest Ada task priority to the lowest thread
- * priority. The lowest priority Ada task should get to run, so there is
- * a fundamental conflict with having 255 priorities.
- */
-
-#define POSIX_SCHEDULER_MAXIMUM_PRIORITY (254)
-
-#define POSIX_SCHEDULER_MINIMUM_PRIORITY (1)
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
- int priority
-);
-
-RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
- int priority
-);
-
-RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
- Priority_Control priority
-);
-
-#include <rtems/posix/priority.inl>
-
-#endif
diff --git a/c/src/exec/posix/headers/psignal.h b/c/src/exec/posix/headers/psignal.h
deleted file mode 100644
index 4ecba1f41c..0000000000
--- a/c/src/exec/posix/headers/psignal.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_SIGNALS_h
-#define __RTEMS_POSIX_SIGNALS_h
-
-typedef struct {
- Chain_Node Node;
- siginfo_t Info;
-} POSIX_signals_Siginfo_node;
-
-void _POSIX_signals_Manager_Initialization(
- int maximum_queued_signals
-);
-
-void _POSIX_signals_Post_switch_extension(
- Thread_Control *the_thread
-);
-
-#endif
-/* end of file */
diff --git a/c/src/exec/posix/headers/pthread.h b/c/src/exec/posix/headers/pthread.h
deleted file mode 100644
index abf5933fc2..0000000000
--- a/c/src/exec/posix/headers/pthread.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/* rtems/posix/pthread.h
- *
- * This include file contains all the private support information for
- * POSIX threads.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_THREADS_h
-#define __RTEMS_POSIX_THREADS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/posix/config.h>
-#include <rtems/posix/threadsup.h>
-
-#define PTHREAD_MINIMUM_STACK_SIZE (STACK_MINIMUM_SIZE * 2)
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Threads_Information;
-
-/*
- * These are used to manage the user initialization threads.
- */
-
-POSIX_EXTERN posix_initialization_threads_table
- *_POSIX_Threads_User_initialization_threads;
-POSIX_EXTERN unsigned32 _POSIX_Threads_Number_of_initialization_threads;
-
-
-/*
- * _POSIX_Threads_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Threads_Manager_initialization(
- unsigned32 maximum_pthreads,
- unsigned32 number_of_initialization_threads,
- posix_initialization_threads_table *user_threads
-);
-
-/*
- * _POSIX_Threads_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a pthread control block from
- * the inactive chain of free pthread control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void );
-
-/*
- * _POSIX_Threads_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a pthread control block to the
- * inactive chain of free pthread control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free(
- Thread_Control *the_pthread
-);
-
-/*
- * _POSIX_Threads_Get
- *
- * DESCRIPTION:
- *
- * This function maps pthread IDs to pthread control blocks.
- * If ID corresponds to a local pthread, then it returns
- * the_pthread control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the pthread ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_pthread is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_pthread is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get(
- pthread_t id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Threads_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_pthread is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null(
- Thread_Control *the_pthread
-);
-
-#include <rtems/posix/pthread.inl>
-#include <rtems/posix/pthreadmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/headers/pthreadmp.h b/c/src/exec/posix/headers/pthreadmp.h
deleted file mode 100644
index af5997ead7..0000000000
--- a/c/src/exec/posix/headers/pthreadmp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* pthreadmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Threads Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_THREADS_MP_h
-#define __RTEMS_POSIX_THREADS_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote pthread operations.
- */
-
-typedef enum {
- POSIX_THREADS_MP_ANNOUNCE_CREATE = 0,
- POSIX_THREADS_MP_ANNOUNCE_DELETE = 1,
- POSIX_THREADS_MP_EXTRACT_PROXY = 2,
- POSIX_THREADS_MP_OBTAIN_REQUEST = 3,
- POSIX_THREADS_MP_OBTAIN_RESPONSE = 4,
- POSIX_THREADS_MP_RELEASE_REQUEST = 5,
- POSIX_THREADS_MP_RELEASE_RESPONSE = 6
-} POSIX_Threads_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote pthread operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Threads_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait;
- Objects_Id proxy_id;
-} POSIX_Threads_MP_Packet;
-
-/*
- * _POSIX_Threads_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Threads_MP_Send_process_packet (
- POSIX_Threads_MP_Remote_operations operation,
- Objects_Id pthread_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Threads_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Threads_MP_Send_request_packet (
- POSIX_Threads_MP_Remote_operations operation,
- Objects_Id pthread_id,
- boolean wait,
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Threads_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Threads_MP_Send_response_packet (
- POSIX_Threads_MP_Remote_operations operation,
- Objects_Id pthread_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Threads_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Threads_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Threads_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Threads_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Threads_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Threads_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Threads_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a pthread mp packet.
- */
-
-POSIX_Threads_MP_Packet *_POSIX_Threads_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/posix/headers/semaphore.h b/c/src/exec/posix/headers/semaphore.h
deleted file mode 100644
index cc658ee32b..0000000000
--- a/c/src/exec/posix/headers/semaphore.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/* rtems/posix/semaphore.h
- *
- * This include file contains all the private support information for
- * POSIX Semaphores.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_SEMAPHORE_h
-#define __RTEMS_POSIX_SEMAPHORE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/coresem.h>
-
-/*
- * Data Structure used to manage a POSIX semaphore
- */
-
-typedef struct {
- Objects_Control Object;
- int process_shared;
- boolean named;
- boolean linked;
- unsigned32 open_count;
- CORE_semaphore_Control Semaphore;
-} POSIX_Semaphore_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Semaphore_Information;
-
-/*
- * _POSIX_Semaphore_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Semaphore_Manager_initialization(
- unsigned32 maximum_semaphorees
-);
-
-/*
- * _POSIX_Semaphore_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a semaphore control block from
- * the inactive chain of free semaphore control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void );
-
-/*
- * _POSIX_Semaphore_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a semaphore control block to the
- * inactive chain of free semaphore control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
- POSIX_Semaphore_Control *the_semaphore
-);
-
-/*
- * _POSIX_Semaphore_Get
- *
- * DESCRIPTION:
- *
- * This function maps semaphore IDs to semaphore control blocks.
- * If ID corresponds to a local semaphore, then it returns
- * the_semaphore control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the semaphore ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_semaphore is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_semaphore is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
- Objects_Id *id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Semaphore_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
- POSIX_Semaphore_Control *the_semaphore
-);
-
-/*
- * _POSIX_Semaphore_Name_to_id
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-int _POSIX_Semaphore_Name_to_id(
- const char *name,
- Objects_Id *id
-);
-
-#include <rtems/posix/semaphore.inl>
-#include <rtems/posix/semaphoremp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/headers/semaphoremp.h b/c/src/exec/posix/headers/semaphoremp.h
deleted file mode 100644
index 14af483f98..0000000000
--- a/c/src/exec/posix/headers/semaphoremp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* semaphoremp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Semaphore Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_SEMAPHORE_MP_h
-#define __RTEMS_POSIX_SEMAPHORE_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote semaphore operations.
- */
-
-typedef enum {
- POSIX_SEMAPHORE_MP_ANNOUNCE_CREATE = 0,
- POSIX_SEMAPHORE_MP_ANNOUNCE_DELETE = 1,
- POSIX_SEMAPHORE_MP_EXTRACT_PROXY = 2,
- POSIX_SEMAPHORE_MP_OBTAIN_REQUEST = 3,
- POSIX_SEMAPHORE_MP_OBTAIN_RESPONSE = 4,
- POSIX_SEMAPHORE_MP_RELEASE_REQUEST = 5,
- POSIX_SEMAPHORE_MP_RELEASE_RESPONSE = 6,
-} POSIX_Semaphore_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote semaphore operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Semaphore_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait; /* XXX options */
- Objects_Id proxy_id;
-} POSIX_Semaphore_MP_Packet;
-
-/*
- * _POSIX_Semaphore_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Semaphore_MP_Send_process_packet (
- POSIX_Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Semaphore_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Semaphore_MP_Send_request_packet (
- POSIX_Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- boolean wait, /* XXX options */
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Semaphore_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Semaphore_MP_Send_response_packet (
- POSIX_Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Semaphore_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Semaphore_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Semaphore_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Semaphore_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Semaphore_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Semaphore_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Semaphore_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a semaphore mp packet.
- */
-
-POSIX_Semaphore_MP_Packet *_POSIX_Semaphore_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/posix/headers/seterr.h b/c/src/exec/posix/headers/seterr.h
deleted file mode 100644
index 85311cfd8c..0000000000
--- a/c/src/exec/posix/headers/seterr.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __POSIX_SET_ERRNO_h
-#define __POSIX_SET_ERRNO_h
-
-#define set_errno_and_return_minus_one( _error ) \
- { errno = (_error); return -1; }
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/headers/threadsup.h b/c/src/exec/posix/headers/threadsup.h
deleted file mode 100644
index bb800a507f..0000000000
--- a/c/src/exec/posix/headers/threadsup.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* threadsup.h
- *
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_THREAD_SUPPORT_h
-#define __RTEMS_POSIX_THREAD_SUPPORT_h
-
-#include <rtems/score/coresem.h>
-#include <rtems/score/tqdata.h>
-
-typedef struct {
- pthread_attr_t Attributes;
- int detachstate;
- Thread_queue_Control Join_List;
- int schedpolicy;
- struct sched_param schedparam;
- int ss_high_priority;
- Watchdog_Control Sporadic_timer;
-
- sigset_t signals_blocked;
- sigset_t signals_pending;
-
-#if 0
- /*
- * POSIX Interrupts
- */
- unsigned32 interrupts_installed;
- CORE_semaphore_Control Interrupt_Semaphore;
-#endif
-
-#if 0
- /*
- * POSIX Cancelability
- */
- int cancelability_state;
- int cancelability_type;
- int cancelation_requested;
- Chain_Control Cancellation_Handlers;
-#endif
-
-} POSIX_API_Control;
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/headers/time.h b/c/src/exec/posix/headers/time.h
deleted file mode 100644
index 0e87db388e..0000000000
--- a/c/src/exec/posix/headers/time.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- *
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_TIME_h
-#define __RTEMS_POSIX_TIME_h
-
-#include <rtems/score/tod.h>
-
-/*
- * Seconds from January 1, 1970 to January 1, 1988. Used to account for
- * differences between POSIX API and RTEMS core.
- */
-
-#define POSIX_TIME_SECONDS_1970_THROUGH_1988 \
- (((1987 - 1970 + 1) * TOD_SECONDS_PER_NON_LEAP_YEAR) + \
- (4 * TOD_SECONDS_PER_DAY))
-
-/*PAGE
- *
- * _POSIX_Timespec_subtract
- */
-
-void _POSIX_Timespec_subtract(
- const struct timespec *the_start,
- const struct timespec *end,
- struct timespec *result
-);
-
-/*
- * _POSIX_Timespec_to_interval
- */
-
-Watchdog_Interval _POSIX_Timespec_to_interval(
- const struct timespec *time
-);
-
-/*PAGE
- *
- * _POSIX_Interval_to_timespec
- */
-
-void _POSIX_Interval_to_timespec(
- Watchdog_Interval ticks,
- struct timespec *time
-);
-
-#endif
diff --git a/c/src/exec/posix/include/aio.h b/c/src/exec/posix/include/aio.h
deleted file mode 100644
index 6348da4c15..0000000000
--- a/c/src/exec/posix/include/aio.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* aio.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_ASYNCHRONOUS_IO_h
-#define __POSIX_ASYNCHRONOUS_IO_h
-
-#include <rtems/posix/features.h>
-
-#if defined(_POSIX_ASYNCHRONOUS_IO)
-
-/*
- * 6.7.1 Data Definitions for Asynchronous Input and Output,
- * P1003.1b-1993, p. 151
- */
-
-#include <sys/types.h>
-#include <signal.h>
-#include <time.h>
-#include <fcntl.h>
-
-/*
- * 6.7.1.2 Manifest Constants, P1003.1b-1993, p. 153
- */
-
-#define AIO_CANCELED 0 /* all requested operations have been canceled */
-#define AIO_NOTCANCELED 1 /* some of the operations could not be canceled */
- /* since they are in progress */
-#define AIO_ALLDONE 2 /* none of the requested operations could be */
- /* canceled since they are already complete */
-
-/* lio_listio() options */
-
-#define LIO_WAIT 0 /* calling process is to suspend until the */
- /* operation is complete */
-#define LIO_NOWAIT 1 /* calling process is to continue execution while */
- /* the operation is performed and no notification */
- /* shall be given when the operation is completed */
-#define LIO_READ 2 /* request a read() */
-#define LIO_WRITE 3 /* request a write() */
-#define LIO_NOP 4 /* no transfer is requested */
-
-/*
- * 6.7.1.1 Asynchronous I/O Control Block, P1003.1b-1993, p. 151
- */
-
-struct aiocb {
- int aio_fildes; /* File descriptor */
- off_t aio_offset; /* File offset */
- volatile void *aio_buf; /* Location of buffer */
- size_t aio_nbytes; /* Length of transfer */
- int aio_reqprio; /* Request priority offset */
- struct sigevent aio_sigevent; /* Signal number and value */
- int aoi_lio_opcode; /* Operation to be performed */
-};
-
-/*
- * 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154
- */
-
-int aio_read(
- struct aiocb *aiocbp
-);
-
-/*
- * 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155
- */
-
-int aio_write(
- struct aiocb *aiocbp
-);
-
-/*
- * 6.7.4 List Directed I/O, P1003.1b-1993, p. 158
- */
-
-int lio_listio(
- int mode,
- struct aiocb * const list[],
- int nent,
- struct sigevent *sig
-);
-
-/*
- * 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161
- */
-
-int aio_error(
- const struct aiocb *aiocbp
-);
-
-/*
- * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
- * P1003.1b-1993, p. 162
- */
-
-int aio_return(
- const struct aiocb *aiocbp
-);
-
-/*
- * 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163
- */
-
-int aio_cancel(
- int filedes,
- struct aiocb *aiocbp
-);
-
-/*
- * 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164
- */
-
-int aio_suspend(
- struct aiocb * const list[],
- int nent,
- const struct timespec *timeout
-);
-
-#if defined(_POSIX_SYNCHRONIZED_IO)
-
-/*
- * 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166
- */
-
-int aio_fsync(
- int op,
- struct aiocb *aiocbp
-);
-
-#endif /* _POSIX_SYNCHRONIZED_IO */
-
-#endif /* _POSIX_ASYNCHRONOUS_IO */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/include/devctl.h b/c/src/exec/posix/include/devctl.h
deleted file mode 100644
index 5073b475ee..0000000000
--- a/c/src/exec/posix/include/devctl.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* devctl.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_DEVICE_CONTROL_h
-#define __POSIX_DEVICE_CONTROL_h
-
-#include <rtems/posix/features.h>
-
-#if defined(_POSIX_DEVICE_CONTROL)
-
-#include <sys/types.h>
-#include <unistd.h>
-
-/*
- * 21.2.1 Control a Device, P1003.4b/D8, p. 65
- */
-
-int devctl(
- int filedes,
- void *dev_data_ptr,
- size_t nbyte,
- int *dev_info_ptr
-);
-
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/include/intr.h b/c/src/exec/posix/include/intr.h
deleted file mode 100644
index f07d1f9552..0000000000
--- a/c/src/exec/posix/include/intr.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* intr.h
- *
- * XXX: It is unclear if the type "intr_t" should be defined when
- * _POSIX_INTERRUPT_CONTROL is not.
- *
- * $Id$
- */
-
-#ifndef __POSIX_INTERRUPTS_h
-#define __POSIX_INTERRUPTS_h
-
-#include <rtems/posix/features.h>
-#include <sys/types.h>
-#include <sys/time.h>
-
-#if defined(_POSIX_INTERRUPT_CONTROL)
-
-/*
- * 22.2 Concepts, P1003.4b/D8, p. 73
- */
-
-typedef int intr_t;
-
-/*
- * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
- */
-
-/*
- * Return codes from an interrupt handler
- */
-
-#define INTR_HANDLED_NOTIFY 0 /* ISR handled this interrupt, notify */
- /* the thread that registered the */
- /* ISR that the interrupt occurred. */
-#define INTR_HANDLED_DO_NOT_NOTIFY 1 /* ISR handled this interrupt, but */
- /* do NOT perform notification. */
-#define INTR_NOT_HANDLED 2 /* ISR did not handle this interrupt, */
- /* let the next handler try. */
-
-int intr_capture(
- intr_t intr,
- int (*intr_handler)( void *area ),
- volatile void *area,
- size_t areasize
-);
-
-int intr_release(
- intr_t intr,
- int (*intr_handler)( void *area )
-);
-
-int intr_lock(
- intr_t intr
-);
-
-int intr_unlock(
- intr_t intr
-);
-
-/*
- * 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76
- */
-
-int intr_timed_wait(
- int flags,
- const struct timespec *timeout
-);
-
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/include/limits.h b/c/src/exec/posix/include/limits.h
deleted file mode 100644
index e8ac4bf2fd..0000000000
--- a/c/src/exec/posix/include/limits.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/* limits.h
- *
- * This file lists the minimums for the limits set by each of
- * the POSIX features subsets.
- *
- * XXX: Careful attention needs to be paid to section 2.8 in 1003.1b-1993
- * to segregrate the variables below based on their "class" according
- * to our implementation. We also need to set the Run-Time Invariant
- * and other related values.
- *
- * $Id$
- */
-
-#include_next <limits.h>
-
-#ifndef __POSIX_LIMITS_h
-#define __POSIX_LIMITS_h
-
-/* really only to get min stack size from <rtems/score/cpu.h> */
-#include <rtems/system.h>
-
-/****************************************************************************
- ****************************************************************************
- * *
- * P1003.1b-1993 defines the constants below this comment. *
- * *
- ****************************************************************************
- ****************************************************************************/
-
-#define _POSIX_AIO_LISTIO_MAX 2
-#define _POSIX_AIO_MAX 1
-#define _POSIX_ARG_MAX 4096
-#define _POSIX_CHILD_MAX 6
-#define _POSIX_DELAYTIMER_MAX 32
-#define _POSIX_LINK_MAX 8
-#define _POSIX_MAX_CANON 255
-#define _POSIX_MAX_INPUT 255
-#define _POSIX_MQ_OPEN_MAX 8
-#define _POSIX_MQ_PRIO_MAX 32
-#define _POSIX_NAME_MAX 14
-#define _POSIX_NGROUPS_MAX 0
-#define _POSIX_OPEN_MAX 16
-#define _POSIX_PATH_MAX 255
-#define _POSIX_PIPE_BUF 512
-#define _POSIX_RTSIG_MAX 8
-#define _POSIX_SEM_NSEMS_MAX 256
-#define _POSIX_SEM_VALUE_MAX 32767
-#define _POSIX_SIGQUEUE_MAX 32
-#define _POSIX_SSIZE_MAX 32767
-#define _POSIX_STREAM_MAX 8
-#define _POSIX_TIMER_MAX 32
-#define _POSIX_TZNAME_MAX 3
-
-/*
- * Definitions of the following may be omitted if the value is >= stated
- * minimum but is indeterminate.
- */
-
-#define AIO_LISTIO_MAX 2
-#define AIO_MAX 1
-#define AIO_PRIO_DELTA_MAX 0
-#define ARG_MAX 4096
-#define CHILD_MAX 6
-#define DELAYTIMER_MAX 32
-#define MQ_OPEN_MAX 8
-#define MQ_PRIO_MAX 32
-#define OPEN_MAX 16
-#define PAGESIZE 1
-#define RTSIG_MAX 8
-#define SEM_NSEMS_MAX 256
-#define SEM_VALUE_MAX 32767
-#define SIGQUEUE_MAX 32
-#define STREAM_MAX 8
-#define TIMER_MAX 32
-#define TZNAME_MAX 3
-
-/*
- * Pathname Variables
- */
-
-#define LINK_MAX 8
-#define MAX_CANON 255
-#define MAX_INPUT 255
-#define NAME_MAX 14
-#define PATH_MAX 255
-#define PIPE_BUF 512
-
-/*
- * Invariant values
- */
-
-#define SSIZE_MAX 32767
-
-/*
- * Maximum Values
- */
-
-#define _POSIX_CLOCKRES_MIN 0 /* in nanoseconds */
-
-/****************************************************************************
- ****************************************************************************
- * *
- * P1003.1c/D10 defines the constants below this comment. *
- *
- * XXX: doc seems to have printing problems in this table :(
- * *
- ****************************************************************************
- ****************************************************************************/
-
-#define _POSIX_LOGIN_NAME_MAX 9
-#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
-#define _POSIX_THREAD_KEYS_MAX 28
-#define _POSIX_THREAD_THREADS_MAX 64
-#define _POSIX_TTY_NAME_MAX 9
-
-/*
- * Definitions of the following may be omitted if the value is >= stated
- * minimum but is indeterminate.
- */
-
-#define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
-#define TTY_NAME_MAX _POSIX_TTY_NAME_MAX
-#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
-#define PTHREAD_STACK_MIN CPU_STACK_MINIMUM_SIZE
-
-/*
- * The maximum number of keys (PTHREAD_KEYS_MAX) and threads
- * (PTHREAD_THREADS_MAX) are configurable and may exceed the minimum.
- *
-#define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX
-#define PTHREAD_THREADS_MAX _POSIX_THREAD_THREADS_MAX
-*/
-
-
-/****************************************************************************
- ****************************************************************************
- * *
- * P1003.4b/D8 defines the constants below this comment. *
- * *
- ****************************************************************************
- ****************************************************************************/
-
-#define _POSIX_INTERRUPT_OVERRUN_MAX 32
-
-/*
- * Definitions of the following may be omitted if the value is >= stated
- * minimum but is indeterminate.
- */
-
-#define INTERRUPT_OVERRUN_MAX 32
-
-/*
- * Pathname Variables
- */
-
-#define MIN_ALLOC_SIZE
-#define REC_MIN_XFER_SIZE
-#define REC_MAX_XFER_SIZE
-#define REC_INCR_XFER_SIZE
-#define REC_XFER_ALIGN
-#define MAX_ATOMIC_SIZE
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/include/mqueue.h b/c/src/exec/posix/include/mqueue.h
deleted file mode 100644
index f1b2250e5c..0000000000
--- a/c/src/exec/posix/include/mqueue.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/* mqueue.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_MESSAGE_QUEUE_h
-#define __POSIX_MESSAGE_QUEUE_h
-
-#include <rtems/posix/features.h>
-
-#if defined(_POSIX_MESSAGE_PASSING)
-
-#include <sys/types.h>
-
-#include <rtems/system.h>
-#include <rtems/score/object.h>
-
-/*
- * 15.1.1 Data Structures, P1003.1b-1993, p. 271
- */
-
-typedef Objects_Id mqd_t;
-
-struct mq_attr {
- long mq_flags; /* Message queue flags */
- long mq_maxmsg; /* Maximum number of messages */
- long mq_msgsize; /* Maximum message size */
- long mq_curmsgs; /* Number of messages currently queued */
-};
-
-/*
- * 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
- */
-
-mqd_t mq_open(
- const char *name,
- int oflag,
- ...
-);
-
-/*
- * 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275
- */
-
-int mq_close(
- mqd_t mqdes
-);
-
-/*
- * 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276
- */
-
-int mq_unlink(
- const char *name
-);
-
-/*
- * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
- *
- * NOTE: P1003.4b/D8, p. 45 adds mq_timedsend().
- */
-
-int mq_send(
- mqd_t mqdes,
- const char *msg_ptr,
- size_t msg_len,
- unsigned int msg_prio
-);
-
-#if defined(_POSIX_TIMEOUTS)
-
-#include <time.h>
-
-int mq_timedsend(
- mqd_t mqdes,
- const char *msg_ptr,
- size_t msg_len,
- unsigned int msg_prio,
- const struct timespec *timeout
-);
-
-#endif /* _POSIX_TIMEOUTS */
-
-/*
- * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
- *
- * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
- */
-
-ssize_t mq_receive(
- mqd_t mqdes,
- char *msg_ptr,
- size_t msg_len,
- unsigned int *msg_prio
-);
-
-#if defined(_POSIX_TIMEOUTS)
-
-int mq_timedreceive( /* XXX: should this be ssize_t */
- mqd_t mqdes,
- char *msg_ptr,
- size_t msg_len,
- unsigned int *msg_prio,
- const struct timespec *timeout
-);
-
-#endif /* _POSIX_TIMEOUTS */
-
-#if defined(_POSIX_REALTIME_SIGNALS)
-
-/*
- * 15.2.6 Notify Process that a Message is Available on a Queue,
- * P1003.1b-1993, p. 280
- */
-
-int mq_notify(
- mqd_t mqdes,
- const struct sigevent *notification
-);
-
-#endif /* _POSIX_REALTIME_SIGNALS */
-
-/*
- * 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281
- */
-
-int mq_setattr(
- mqd_t mqdes,
- const struct mq_attr *mqstat,
- struct mq_attr *omqstat
-);
-
-/*
- * 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
- */
-
-int mq_getattr(
- mqd_t mqdes,
- struct mq_attr *mqstat
-);
-
-#endif /* _POSIX_MESSAGE_PASSING */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/include/pthread.h b/c/src/exec/posix/include/pthread.h
deleted file mode 100644
index d70a794f38..0000000000
--- a/c/src/exec/posix/include/pthread.h
+++ /dev/null
@@ -1,500 +0,0 @@
-/* pthread.h
- *
- * $Id$
- */
-
-#ifndef __PTHREAD_h
-#define __PTHREAD_h
-
-#include <sys/features.h>
-
-#if defined(_POSIX_THREADS)
-
-#include <sys/types.h>
-#include <time.h>
-#include <sys/sched.h>
-
-/*
- * 3.1.3 Register Fork Handlers, P1003.1c/Draft 10, P1003.1c/Draft 10, p. 27
- *
- * RTEMS does not support processes, so we fall under this and do not
- * provide this routine:
- *
- * "Either the implementation shall support the pthread_atfork() function
- * as described above or the pthread_atfork() funciton shall not be
- * provided."
- */
-
-/*
- * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
- */
-
-int pthread_mutexattr_init(
- pthread_mutexattr_t *attr
-);
-
-int pthread_mutexattr_destroy(
- pthread_mutexattr_t *attr
-);
-
-int pthread_mutexattr_getpshared(
- const pthread_mutexattr_t *attr,
- int *pshared
-);
-
-int pthread_mutexattr_setpshared(
- pthread_mutexattr_t *attr,
- int pshared
-);
-
-/*
- * 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87
- */
-
-int pthread_mutex_init(
- pthread_mutex_t *mutex,
- const pthread_mutexattr_t *attr
-);
-
-int pthread_mutex_destroy(
- pthread_mutex_t *mutex
-);
-
-/*
- * This is used to statically initialize a pthread_mutex_t. Example:
- *
- * pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
- */
-
-#define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) 0xFFFFFFFF)
-
-/*
- * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93
- *
- * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29
- */
-
-int pthread_mutex_lock(
- pthread_mutex_t *mutex
-);
-
-int pthread_mutex_trylock(
- pthread_mutex_t *mutex
-);
-
-int pthread_mutex_unlock(
- pthread_mutex_t *mutex
-);
-
-#if defined(_POSIX_TIMEOUTS)
-
-int pthread_mutex_timedlock(
- pthread_mutex_t *mutex,
- const struct timespec *timeout
-);
-
-#endif /* _POSIX_TIMEOUTS */
-
-/*
- * 11.4.1 Condition Variable Initialization Attributes,
- * P1003.1c/Draft 10, p. 96
- */
-
-int pthread_condattr_init(
- pthread_condattr_t *attr
-);
-
-int pthread_condattr_destroy(
- pthread_condattr_t *attr
-);
-
-int pthread_condattr_getpshared(
- const pthread_condattr_t *attr,
- int *pshared
-);
-
-int pthread_condattr_setpshared(
- pthread_condattr_t *attr,
- int pshared
-);
-
-/*
- * 11.4.2 Initializing and Destroying a Condition Variable,
- * P1003.1c/Draft 10, p. 87
- */
-
-int pthread_cond_init(
- pthread_cond_t *cond,
- const pthread_condattr_t *attr
-);
-
-int pthread_cond_destroy(
- pthread_cond_t *mutex
-);
-
-/*
- * This is used to statically initialize a pthread_cond_t. Example:
- *
- * pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
- */
-
-#define PTHREAD_COND_INITIALIZER ((pthread_mutex_t) 0xFFFFFFFF)
-
-/*
- * 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101
- */
-
-int pthread_cond_signal(
- pthread_cond_t *cond
-);
-
-int pthread_cond_broadcast(
- pthread_cond_t *cond
-);
-
-/*
- * 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105
- */
-
-int pthread_cond_wait(
- pthread_cond_t *cond,
- pthread_mutex_t *mutex
-);
-
-int pthread_cond_timedwait(
- pthread_cond_t *cond,
- pthread_mutex_t *mutex,
- const struct timespec *abstime
-);
-
-#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
-
-/*
- * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_setscope(
- pthread_attr_t *attr,
- int contentionscope
-);
-
-int pthread_attr_getscope(
- const pthread_attr_t *attr,
- int *contentionscope
-);
-
-int pthread_attr_setinheritsched(
- pthread_attr_t *attr,
- int inheritsched
-);
-
-int pthread_attr_getinheritsched(
- const pthread_attr_t *attr,
- int *inheritsched
-);
-
-int pthread_attr_setschedpolicy(
- pthread_attr_t *attr,
- int policy
-);
-
-int pthread_attr_getschedpolicy(
- const pthread_attr_t *attr,
- int *policy
-);
-
-#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */
-
-int pthread_attr_setschedparam(
- pthread_attr_t *attr,
- const struct sched_param *param
-);
-
-int pthread_attr_getschedparam(
- const pthread_attr_t *attr,
- struct sched_param *param
-);
-
-#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
-
-/*
- * 13.5.2 Dynamic Thread Scheduling Parameters Access,
- * P1003.1c/Draft 10, p. 124
- */
-
-int pthread_getschedparam(
- pthread_t thread,
- int *policy,
- struct sched_param *param
-);
-
-int pthread_setschedparam(
- pthread_t thread,
- int policy,
- struct sched_param *param
-);
-
-#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */
-
-#if defined(_POSIX_THREAD_PRIO_INHERIT) || defined(_POSIX_THREAD_PRIO_PROTECT)
-
-/*
- * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
- */
-
-int pthread_mutexattr_setprotocol(
- pthread_mutexattr_t *attr,
- int protocol
-);
-
-int pthread_mutexattr_getprotocol(
- const pthread_mutexattr_t *attr,
- int *protocol
-);
-
-int pthread_mutexattr_setprioceiling(
- pthread_mutexattr_t *attr,
- int prioceiling
-);
-
-int pthread_mutexattr_getprioceiling(
- const pthread_mutexattr_t *attr,
- int *prioceiling
-);
-
-#endif /* _POSIX_THREAD_PRIO_INHERIT || _POSIX_THREAD_PRIO_PROTECT */
-
-#if defined(_POSIX_THREAD_PRIO_PROTECT)
-
-/*
- * 13.6.2 Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131
- */
-
-int pthread_mutex_setprioceiling(
- pthread_mutex_t *mutex,
- int prioceiling,
- int *old_ceiling
-);
-
-int pthread_mutex_getprioceiling(
- pthread_mutex_t *mutex,
- int *prioceiling
-);
-
-#endif /* _POSIX_THREAD_PRIO_PROTECT */
-
-/*
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_init(
- pthread_attr_t *attr
-);
-
-int pthread_attr_destroy(
- pthread_attr_t *attr
-);
-
-int pthread_attr_getstacksize(
- const pthread_attr_t *attr,
- size_t *stacksize
-);
-
-int pthread_attr_setstacksize(
- pthread_attr_t *attr,
- size_t stacksize
-);
-
-int pthread_attr_getstackaddr(
- const pthread_attr_t *attr,
- void **stackaddr
-);
-
-int pthread_attr_setstackaddr(
- pthread_attr_t *attr,
- void *stackaddr
-);
-
-int pthread_attr_getdetachstate(
- const pthread_attr_t *attr,
- int *detachstate
-);
-
-int pthread_attr_setdetachstate(
- pthread_attr_t *attr,
- int detachstate
-);
-
-/*
- * 16.1.2 Thread Creation, P1003.1c/Draft 10, p. 144
- */
-
-int pthread_create(
- pthread_t *thread,
- const pthread_attr_t *attr,
- void *(*start_routine)( void * ),
- void *arg
-);
-
-/*
- * 16.1.3 Wait for Thread Termination, P1003.1c/Draft 10, p. 147
- */
-
-int pthread_join(
- pthread_t thread,
- void **value_ptr
-);
-
-/*
- * 16.1.4 Detaching a Thread, P1003.1c/Draft 10, p. 149
- */
-
-int pthread_detach(
- pthread_t thread
-);
-
-/*
- * 16.1.5.1 Thread Termination, p1003.1c/Draft 10, p. 150
- */
-
-void pthread_exit(
- void *value_ptr
-);
-
-/*
- * 16.1.6 Get Calling Thread's ID, p1003.1c/Draft 10, p. XXX
- */
-
-pthread_t pthread_self( void );
-
-/*
- * 16.1.7 Compare Thread IDs, p1003.1c/Draft 10, p. 153
- */
-
-int pthread_equal(
- pthread_t t1,
- pthread_t t2
-);
-
-/*
- * 16.1.8 Dynamic Package Initialization
- */
-
-/*
- * This is used to statically initialize a pthread_once_t. Example:
- *
- * pthread_once_t once = PTHREAD_ONCE_INIT;
- *
- * NOTE: This is named inconsistently -- it should be INITIALIZER.
- */
-
-#define PTHREAD_ONCE_INIT { 1, 0 } /* is initialized and not run */
-
-int pthread_once(
- pthread_once_t *once_control,
- void (*init_routine)(void)
-);
-
-/*
- * 17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163
- */
-
-int pthread_key_create(
- pthread_key_t *key,
- void (*destructor)( void * )
-);
-
-/*
- * 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165
- */
-
-int pthread_setspecific(
- pthread_key_t key,
- const void *value
-);
-
-void *pthread_getspecific(
- pthread_key_t key
-);
-
-/*
- * 17.1.3 Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167
- */
-
-int pthread_key_delete(
- pthread_key_t key
-);
-
-/*
- * 18.2.1 Canceling Execution of a Thread, P1003.1c/Draft 10, p. 181
- */
-
-#define PTHREAD_CANCEL_ENABLE 0
-#define PTHREAD_CANCEL_DISABLE 1
-
-#define PTHREAD_CANCEL_DEFERRED 0
-#define PTHREAD_CANCEL_ASYNCHRONOUS 1
-
-int pthread_cancel(
- pthread_t thread
-);
-
-/*
- * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
- */
-
-int pthread_setcancelstate(
- int state,
- int *oldstate
-);
-
-int pthread_setcanceltype(
- int type,
- int *oldtype
-);
-
-void pthread_testcancel( void );
-
-/*
- * 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184
- */
-
-void pthread_cleanup_push(
- void (*routine)( void * ),
- void *arg
-);
-
-void pthread_cleanup_pop(
- int execute
-);
-
-#if defined(_POSIX_THREAD_CPUTIME)
-
-/*
- * 20.1.6 Accessing a Thread CPU-time Clock, P1003.4b/D8, p. 58
- */
-
-int pthread_getcpuclockid(
- pthread_t thread_id,
- clockid_t *clock_id
-);
-
-/*
- * 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/D8, p. 59
- */
-
-int pthread_attr_setcputime(
- pthread_attr_t *attr,
- int clock_allowed
-);
-
-int pthread_attr_getcputime(
- pthread_attr_t *attr,
- int *clock_allowed
-);
-
-#endif /* defined(_POSIX_THREAD_CPUTIME) */
-
-#endif /* defined(_POSIX_THREADS) */
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/include/rtems/posix/Makefile.in b/c/src/exec/posix/include/rtems/posix/Makefile.in
deleted file mode 100644
index 543917d7ed..0000000000
--- a/c/src/exec/posix/include/rtems/posix/Makefile.in
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_PIECES= cond condmp config key mutex mutexmp posixapi \
- priority psignal pthread pthreadmp seterr threadsup time
-#H_PIECES= cancel cond condmp intr key mqueue mqueuemp mutex \
-# mutexmp pthread pthreadmp priority semaphore semaphoremp threadsup \
-# time
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-SRCS=$(H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/posix
diff --git a/c/src/exec/posix/include/rtems/posix/cancel.h b/c/src/exec/posix/include/rtems/posix/cancel.h
deleted file mode 100644
index e6d80275f4..0000000000
--- a/c/src/exec/posix/include/rtems/posix/cancel.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* rtems/posix/cancel.h
- *
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_CANCEL_h
-#define __RTEMS_POSIX_CANCEL_h
-
-typedef struct {
- Chain_Node Node;
- void (*routine)( void * );
- void *arg;
-} POSIX_Cancel_Handler_control;
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/include/rtems/posix/cond.h b/c/src/exec/posix/include/rtems/posix/cond.h
deleted file mode 100644
index 92c2e453ae..0000000000
--- a/c/src/exec/posix/include/rtems/posix/cond.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* rtems/posix/cond.h
- *
- * This include file contains all the private support information for
- * POSIX condition variables.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_CONDITION_VARIABLES_h
-#define __RTEMS_POSIX_CONDITION_VARIABLES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/threadq.h>
-
-/*
- * Constant to indicate condition variable does not currently have
- * a mutex assigned to it.
- */
-
-#define POSIX_CONDITION_VARIABLES_NO_MUTEX 0
-
-/*
- * Data Structure used to manage a POSIX condition variable
- */
-
-typedef struct {
- Objects_Control Object;
- int process_shared;
- pthread_mutex_t Mutex;
- Thread_queue_Control Wait_queue;
-} POSIX_Condition_variables_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Condition_variables_Information;
-
-/*
- * _POSIX_Condition_variables_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Condition_variables_Manager_initialization(
- unsigned32 maximum_condition_variables
-);
-
-/*
- * _POSIX_Condition_variables_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a condition variable control block from
- * the inactive chain of free condition variable control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *
- _POSIX_Condition_variables_Allocate( void );
-
-/*
- * _POSIX_Condition_variables_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a condition variable control block to the
- * inactive chain of free condition variable control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
- POSIX_Condition_variables_Control *the_condition_variable
-);
-
-/*
- * _POSIX_Condition_variables_Get
- *
- * DESCRIPTION:
- *
- * This function maps condition variable IDs to condition variable control
- * blocks. If ID corresponds to a local condition variable, then it returns
- * the_condition variable control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the condition variable ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_condition variable is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_condition variable is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
- Objects_Id *id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Condition_variables_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_condition variable is NULL
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
- POSIX_Condition_variables_Control *the_condition_variable
-);
-
-#include <rtems/posix/cond.inl>
-#include <rtems/posix/condmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/include/rtems/posix/condmp.h b/c/src/exec/posix/include/rtems/posix/condmp.h
deleted file mode 100644
index de9c5ce0d4..0000000000
--- a/c/src/exec/posix/include/rtems/posix/condmp.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/* condmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Condition Variable Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_CONDITION_VARIABLES_MP_h
-#define __RTEMS_POSIX_CONDITION_VARIABLES_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote condition variable operations.
- */
-
-typedef enum {
- POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_CREATE = 0,
- POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_DELETE = 1,
- POSIX_CONDITION_VARIABLES_MP_EXTRACT_PROXY = 2,
- POSIX_CONDITION_VARIABLES_MP_OBTAIN_REQUEST = 3,
- POSIX_CONDITION_VARIABLES_MP_OBTAIN_RESPONSE = 4,
- POSIX_CONDITION_VARIABLES_MP_RELEASE_REQUEST = 5,
- POSIX_CONDITION_VARIABLES_MP_RELEASE_RESPONSE = 6,
-} POSIX_Condition_variables_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote condition variable operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Condition_variables_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait; /* XXX options */
- Objects_Id proxy_id;
-} POSIX_Condition_variables_MP_Packet;
-
-/*
- * _POSIX_Condition_variables_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Condition_variables_MP_Send_process_packet (
- POSIX_Condition_variables_MP_Remote_operations operation,
- Objects_Id condition_variables_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Condition_variables_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Condition_variables_MP_Send_request_packet (
- POSIX_Condition_variables_MP_Remote_operations operation,
- Objects_Id condition_variables_id,
- boolean wait, /* XXX options */
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Condition_variables_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Condition_variables_MP_Send_response_packet (
- POSIX_Condition_variables_MP_Remote_operations operation,
- Objects_Id condition_variables_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Condition_variables_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Condition_variables_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Condition_variables_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Condition_variables_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Condition_variables_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Condition_variables_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Condition_variables_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a condition variable mp packet.
- */
-
-POSIX_Condition_variables_MP_Packet
- *_POSIX_Condition_variables_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/posix/include/rtems/posix/config.h b/c/src/exec/posix/include/rtems/posix/config.h
deleted file mode 100644
index 8753c42382..0000000000
--- a/c/src/exec/posix/include/rtems/posix/config.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* config.h
- *
- * This include file contains the table of user defined configuration
- * parameters specific for the POSIX API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_CONFIGURATION_h
-#define __RTEMS_POSIX_CONFIGURATION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * XXX
- *
- * The following records define the Configuration Table. The
- * information contained in this table is required in all
- * RTEMS systems, whether single or multiprocessor. This
- * table primarily defines the following:
- *
- * + required number of each object type
- */
-
-/*
- * For now, we are only allowing the user to specify the entry point
- * for posix initialization threads.
- */
-
-typedef struct {
- void *(*thread_entry)(void *);
-} posix_initialization_threads_table;
-
-typedef struct {
- int maximum_threads;
- int maximum_mutexes;
- int maximum_condition_variables;
- int maximum_keys;
- int maximum_queued_signals;
- int number_of_initialization_threads;
- posix_initialization_threads_table *User_initialization_threads_table;
-} posix_api_configuration_table;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/include/rtems/posix/intr.h b/c/src/exec/posix/include/rtems/posix/intr.h
deleted file mode 100644
index 539c66f058..0000000000
--- a/c/src/exec/posix/include/rtems/posix/intr.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/* rtems/posix/intr.h
- *
- * This include file contains all the private support information for
- * POSIX Interrupt Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_KEY_h
-#define __RTEMS_POSIX_KEY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-
-/*
- * Data Structure used to manage each POSIX Interrupt Vector
- */
-
-typedef struct {
- int number_installed;
- int lock_count;
- int deferred_count;
- Chain_Control Handlers;
-} POSIX_Interrupt_Control;
-
-/*
- * Data Structure used to manage a POSIX Interrupt Handler
- */
-
-typedef struct {
- Objects_Control Object;
- int is_active;
- intr_t vector;
- Thread_Control *server;
- int (*handler)( void *area );
- volatile void *user_data_area;
-} POSIX_Interrupt_Handler_control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Interrupt_Handlers_Information;
-
-/*
- * The following is an array which is used to manage the set of
- * interrupt handlers installed on each vector.
- */
-
-POSIX_EXTERN POSIX_Interrupt_Control
- _POSIX_Interrupt_Information[ ISR_NUMBER_OF_VECTORS ];
-
-/*
- * _POSIX_Interrupt_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Interrupt_Manager_initialization(
- unsigned32 maximum_interrupt_handlers
-);
-
-/*
- * _POSIX_Interrupt_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a interrupt handler control block from
- * the inactive chain of free interrupt handler control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
- _POSIX_Interrupt_Allocate( void );
-
-/*
- * _POSIX_Interrupt_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a interrupt handler control block to the
- * inactive chain of free interrupt handler control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
- POSIX_Interrupt_Handler_control *the_intr
-);
-
-/*
- * _POSIX_Interrupt_Get
- *
- * DESCRIPTION:
- *
- * This function maps interrupt handler IDs to interrupt handler control
- * blocks. If ID corresponds to a local interrupt handler, then it returns
- * the_intr control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the interrupt handler ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_intr is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_intr is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
- Objects_Id id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Interrupt_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_intr is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
- POSIX_Interrupt_Handler_control *the_intr
-);
-
-/*
- * _POSIX_Interrupt_Handler
- *
- * DESCRIPTION:
- *
- * This function XXX.
- */
-
-void _POSIX_Interrupt_Handler(
- ISR_Vector_number vector
-);
-
-#include <rtems/posix/intr.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/include/rtems/posix/key.h b/c/src/exec/posix/include/rtems/posix/key.h
deleted file mode 100644
index 22bfafd594..0000000000
--- a/c/src/exec/posix/include/rtems/posix/key.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/* rtems/posix/key.h
- *
- * This include file contains all the private support information for
- * POSIX key.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_KEY_h
-#define __RTEMS_POSIX_KEY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Data Structure used to manage a POSIX key
- *
- * NOTE: The Values is a table indexed by the index portion of the
- * ID of the currently executing thread.
- */
-
-typedef struct {
- Objects_Control Object;
- boolean is_active;
- void (*destructor)( void * );
- void **Values[ OBJECTS_CLASSES_LAST_THREAD_CLASS + 1 ];
-} POSIX_Keys_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Keys_Information;
-
-/*
- * _POSIX_Keys_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Key_Manager_initialization(
- unsigned32 maximum_keys
-);
-
-/*
- * _POSIX_Keys_Run_destructors
- *
- * DESCRIPTION:
- *
- * This function executes all the destructors associated with the thread's
- * keys. This function will execute until all values have been set to NULL.
- *
- * NOTE: This is the routine executed when a thread exits to
- * run through all the keys and do the destructor action.
- */
-
-void _POSIX_Keys_Run_destructors(
- Thread_Control *thread
-);
-
-/*
- * _POSIX_Keys_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a keys control block from
- * the inactive chain of free keys control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void );
-
-/*
- * _POSIX_Keys_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a keys control block to the
- * inactive chain of free keys control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
- POSIX_Keys_Control *the_key
-);
-
-/*
- * _POSIX_Keys_Get
- *
- * DESCRIPTION:
- *
- * This function maps key IDs to key control blocks.
- * If ID corresponds to a local keys, then it returns
- * the_key control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the keys ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_key is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_key is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
- Objects_Id id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Keys_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_key is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
- POSIX_Keys_Control *the_key
-);
-
-#include <rtems/posix/key.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/include/rtems/posix/mqueue.h b/c/src/exec/posix/include/rtems/posix/mqueue.h
deleted file mode 100644
index 8e2851bfb5..0000000000
--- a/c/src/exec/posix/include/rtems/posix/mqueue.h
+++ /dev/null
@@ -1,186 +0,0 @@
-/* rtems/posix/mqueue.h
- *
- * This include file contains all the private support information for
- * POSIX Message Queues.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MESSAGE_QUEUE_h
-#define __RTEMS_POSIX_MESSAGE_QUEUE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/coremsg.h>
-#include <rtems/score/object.h>
-
-/*
- * Data Structure used to manage a POSIX message queue
- */
-
-typedef struct {
- Objects_Control Object;
- int process_shared;
- int flags;
- boolean named;
- boolean linked;
- boolean blocking;
- unsigned32 open_count;
- CORE_message_queue_Control Message_queue;
- struct sigevent notification;
-} POSIX_Message_queue_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information;
-
-/*
- * _POSIX_Message_queue_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Message_queue_Manager_initialization(
- unsigned32 maximum_message_queues
-);
-
-/*
- *
- * _POSIX_Message_queue_Create_support
- *
- * DESCRIPTION:
- *
- * This routine performs the creation of a message queue utilizing the
- * core message queue.
- */
-
-int _POSIX_Message_queue_Create_support(
- const char *name,
- int pshared,
- unsigned int oflag,
- struct mq_attr *attr,
- POSIX_Message_queue_Control **message_queue
-);
-
-/*
- *
- * _POSIX_Message_queue_Send_support
- *
- * DESCRIPTION:
- *
- * This routine posts a message to a specified message queue.
- */
-
-int _POSIX_Message_queue_Send_support(
- mqd_t mqdes,
- const char *msg_ptr,
- unsigned32 msg_len,
- Priority_Control msg_prio,
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Message_queue_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a message queue control block from
- * the inactive chain of free message queue control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
-
-/*
- * _POSIX_Message_queue_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a message queue control block to the
- * inactive chain of free message queue control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
- POSIX_Message_queue_Control *the_mq
-);
-
-/*
- * _POSIX_Message_queue_Get
- *
- * DESCRIPTION:
- *
- * This function maps message queue IDs to message queue control blocks.
- * If ID corresponds to a local message queue, then it returns
- * the_mq control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the message queue ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_message queue is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_mq is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
- Objects_Id id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Message_queue_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_message_queue is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
- POSIX_Message_queue_Control *the_mq
-);
-
-/*
- * _POSIX_Message_queue_Name_to_id
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-int _POSIX_Message_queue_Name_to_id(
- const char *name,
- Objects_Id *id
-);
-
-/*
- * _POSIX_Message_queue_Priority_to_core
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
- unsigned int priority
-);
-
-#include <rtems/posix/mqueue.inl>
-#include <rtems/posix/mqueuemp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/include/rtems/posix/mqueuemp.h b/c/src/exec/posix/include/rtems/posix/mqueuemp.h
deleted file mode 100644
index 27742014ab..0000000000
--- a/c/src/exec/posix/include/rtems/posix/mqueuemp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* mqueuemp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Message Queue Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MESSAGE_QUEUE_MP_h
-#define __RTEMS_POSIX_MESSAGE_QUEUE_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote message queue operations.
- */
-
-typedef enum {
- POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0,
- POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1,
- POSIX_MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2,
- POSIX_MESSAGE_QUEUE_MP_OBTAIN_REQUEST = 3,
- POSIX_MESSAGE_QUEUE_MP_OBTAIN_RESPONSE = 4,
- POSIX_MESSAGE_QUEUE_MP_RELEASE_REQUEST = 5,
- POSIX_MESSAGE_QUEUE_MP_RELEASE_RESPONSE = 6,
-} POSIX_Message_queue_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote message queue operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Message_queue_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait; /* XXX options */
- Objects_Id proxy_id;
-} POSIX_Message_queue_MP_Packet;
-
-/*
- * _POSIX_Message_queue_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Message_queue_MP_Send_process_packet (
- POSIX_Message_queue_MP_Remote_operations operation,
- Objects_Id mq_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Message_queue_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Message_queue_MP_Send_request_packet (
- POSIX_Message_queue_MP_Remote_operations operation,
- Objects_Id mq_id,
- boolean wait, /* XXX options */
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Message_queue_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Message_queue_MP_Send_response_packet (
- POSIX_Message_queue_MP_Remote_operations operation,
- Objects_Id mq_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Message_queue_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Message_queue_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Message_queue_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Message_queue_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Message_queue_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Message_queue_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Message_queue_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a message queue mp packet.
- */
-
-POSIX_Message_queue_MP_Packet *_POSIX_Message_queue_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/posix/include/rtems/posix/mutex.h b/c/src/exec/posix/include/rtems/posix/mutex.h
deleted file mode 100644
index e6c5c44d39..0000000000
--- a/c/src/exec/posix/include/rtems/posix/mutex.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* rtems/posix/mutex.h
- *
- * This include file contains all the private support information for
- * POSIX mutex's.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MUTEX_h
-#define __RTEMS_POSIX_MUTEX_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/coremutex.h>
-#include <pthread.h>
-
-/*
- * Data Structure used to manage a POSIX mutex
- */
-
-typedef struct {
- Objects_Control Object;
- int process_shared;
- CORE_mutex_Control Mutex;
-} POSIX_Mutex_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Mutex_Information;
-
-/*
- * _POSIX_Mutex_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Mutex_Manager_initialization(
- unsigned32 maximum_mutexes
-);
-
-/*
- * _POSIX_Mutex_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a mutexes control block from
- * the inactive chain of free mutexes control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void );
-
-/*
- * _POSIX_Mutex_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a mutexes control block to the
- * inactive chain of free mutexes control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
- POSIX_Mutex_Control *the_mutex
-);
-
-/*
- * _POSIX_Mutex_Get
- *
- * DESCRIPTION:
- *
- * This function maps mutexes IDs to mutexes control blocks.
- * If ID corresponds to a local mutexes, then it returns
- * the_mutex control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the mutexes ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_mutex is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_mutex is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
- Objects_Id *id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Mutex_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_mutex is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
- POSIX_Mutex_Control *the_mutex
-);
-
-#include <rtems/posix/mutex.inl>
-#include <rtems/posix/mutexmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/include/rtems/posix/mutexmp.h b/c/src/exec/posix/include/rtems/posix/mutexmp.h
deleted file mode 100644
index 71f60677eb..0000000000
--- a/c/src/exec/posix/include/rtems/posix/mutexmp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* mutexmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Mutex Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MUTEX_MP_h
-#define __RTEMS_POSIX_MUTEX_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote mutex operations.
- */
-
-typedef enum {
- POSIX_MUTEX_MP_ANNOUNCE_CREATE = 0,
- POSIX_MUTEX_MP_ANNOUNCE_DELETE = 1,
- POSIX_MUTEX_MP_EXTRACT_PROXY = 2,
- POSIX_MUTEX_MP_OBTAIN_REQUEST = 3,
- POSIX_MUTEX_MP_OBTAIN_RESPONSE = 4,
- POSIX_MUTEX_MP_RELEASE_REQUEST = 5,
- POSIX_MUTEX_MP_RELEASE_RESPONSE = 6,
-} POSIX_Mutex_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote mutex operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Mutex_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait; /* XXX options */
- Objects_Id proxy_id;
-} POSIX_Mutex_MP_Packet;
-
-/*
- * _POSIX_Mutex_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Mutex_MP_Send_process_packet (
- POSIX_Mutex_MP_Remote_operations operation,
- Objects_Id mutex_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Mutex_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Mutex_MP_Send_request_packet (
- POSIX_Mutex_MP_Remote_operations operation,
- Objects_Id mutex_id,
- boolean wait, /* XXX options */
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Mutex_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Mutex_MP_Send_response_packet (
- POSIX_Mutex_MP_Remote_operations operation,
- Objects_Id mutex_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Mutex_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Mutex_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Mutex_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Mutex_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Mutex_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Mutex_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Mutex_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a mutex mp packet.
- */
-
-POSIX_Mutex_MP_Packet *_POSIX_Mutex_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/posix/include/rtems/posix/posixapi.h b/c/src/exec/posix/include/rtems/posix/posixapi.h
deleted file mode 100644
index f7c52985c3..0000000000
--- a/c/src/exec/posix/include/rtems/posix/posixapi.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * POSIX API Support
- *
- * NOTE:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __POSIX_API_h
-#define __POSIX_API_h
-
-#include <rtems/config.h>
-
-/*PAGE
- *
- * _POSIX_API_Initialize
- *
- * XXX
- */
-
-void _POSIX_API_Initialize(
- rtems_configuration_table *configuration_table
-);
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/include/rtems/posix/priority.h b/c/src/exec/posix/include/rtems/posix/priority.h
deleted file mode 100644
index c0253f3bab..0000000000
--- a/c/src/exec/posix/include/rtems/posix/priority.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- *
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_PRIORITY_h
-#define __RTEMS_POSIX_PRIORITY_h
-
-#include <rtems/score/priority.h>
-
-/*
- * 1003.1b-1993,2.2.2.80 definition of priority, p. 19
- *
- * "Numericallly higher values represent higher priorities."
- *
- * Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
- *
- * There are only 254 posix priority levels since a task at priority level
- * 255 would never run because of the RTEMS idle task. This is necessary
- * because GNAT maps the lowest Ada task priority to the lowest thread
- * priority. The lowest priority Ada task should get to run, so there is
- * a fundamental conflict with having 255 priorities.
- */
-
-#define POSIX_SCHEDULER_MAXIMUM_PRIORITY (254)
-
-#define POSIX_SCHEDULER_MINIMUM_PRIORITY (1)
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
- int priority
-);
-
-RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
- int priority
-);
-
-RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
- Priority_Control priority
-);
-
-#include <rtems/posix/priority.inl>
-
-#endif
diff --git a/c/src/exec/posix/include/rtems/posix/psignal.h b/c/src/exec/posix/include/rtems/posix/psignal.h
deleted file mode 100644
index 4ecba1f41c..0000000000
--- a/c/src/exec/posix/include/rtems/posix/psignal.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_SIGNALS_h
-#define __RTEMS_POSIX_SIGNALS_h
-
-typedef struct {
- Chain_Node Node;
- siginfo_t Info;
-} POSIX_signals_Siginfo_node;
-
-void _POSIX_signals_Manager_Initialization(
- int maximum_queued_signals
-);
-
-void _POSIX_signals_Post_switch_extension(
- Thread_Control *the_thread
-);
-
-#endif
-/* end of file */
diff --git a/c/src/exec/posix/include/rtems/posix/pthread.h b/c/src/exec/posix/include/rtems/posix/pthread.h
deleted file mode 100644
index abf5933fc2..0000000000
--- a/c/src/exec/posix/include/rtems/posix/pthread.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/* rtems/posix/pthread.h
- *
- * This include file contains all the private support information for
- * POSIX threads.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_THREADS_h
-#define __RTEMS_POSIX_THREADS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/posix/config.h>
-#include <rtems/posix/threadsup.h>
-
-#define PTHREAD_MINIMUM_STACK_SIZE (STACK_MINIMUM_SIZE * 2)
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Threads_Information;
-
-/*
- * These are used to manage the user initialization threads.
- */
-
-POSIX_EXTERN posix_initialization_threads_table
- *_POSIX_Threads_User_initialization_threads;
-POSIX_EXTERN unsigned32 _POSIX_Threads_Number_of_initialization_threads;
-
-
-/*
- * _POSIX_Threads_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Threads_Manager_initialization(
- unsigned32 maximum_pthreads,
- unsigned32 number_of_initialization_threads,
- posix_initialization_threads_table *user_threads
-);
-
-/*
- * _POSIX_Threads_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a pthread control block from
- * the inactive chain of free pthread control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void );
-
-/*
- * _POSIX_Threads_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a pthread control block to the
- * inactive chain of free pthread control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free(
- Thread_Control *the_pthread
-);
-
-/*
- * _POSIX_Threads_Get
- *
- * DESCRIPTION:
- *
- * This function maps pthread IDs to pthread control blocks.
- * If ID corresponds to a local pthread, then it returns
- * the_pthread control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the pthread ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_pthread is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_pthread is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get(
- pthread_t id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Threads_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_pthread is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null(
- Thread_Control *the_pthread
-);
-
-#include <rtems/posix/pthread.inl>
-#include <rtems/posix/pthreadmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/include/rtems/posix/pthreadmp.h b/c/src/exec/posix/include/rtems/posix/pthreadmp.h
deleted file mode 100644
index af5997ead7..0000000000
--- a/c/src/exec/posix/include/rtems/posix/pthreadmp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* pthreadmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Threads Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_THREADS_MP_h
-#define __RTEMS_POSIX_THREADS_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote pthread operations.
- */
-
-typedef enum {
- POSIX_THREADS_MP_ANNOUNCE_CREATE = 0,
- POSIX_THREADS_MP_ANNOUNCE_DELETE = 1,
- POSIX_THREADS_MP_EXTRACT_PROXY = 2,
- POSIX_THREADS_MP_OBTAIN_REQUEST = 3,
- POSIX_THREADS_MP_OBTAIN_RESPONSE = 4,
- POSIX_THREADS_MP_RELEASE_REQUEST = 5,
- POSIX_THREADS_MP_RELEASE_RESPONSE = 6
-} POSIX_Threads_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote pthread operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Threads_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait;
- Objects_Id proxy_id;
-} POSIX_Threads_MP_Packet;
-
-/*
- * _POSIX_Threads_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Threads_MP_Send_process_packet (
- POSIX_Threads_MP_Remote_operations operation,
- Objects_Id pthread_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Threads_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Threads_MP_Send_request_packet (
- POSIX_Threads_MP_Remote_operations operation,
- Objects_Id pthread_id,
- boolean wait,
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Threads_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Threads_MP_Send_response_packet (
- POSIX_Threads_MP_Remote_operations operation,
- Objects_Id pthread_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Threads_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Threads_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Threads_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Threads_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Threads_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Threads_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Threads_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a pthread mp packet.
- */
-
-POSIX_Threads_MP_Packet *_POSIX_Threads_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/posix/include/rtems/posix/semaphore.h b/c/src/exec/posix/include/rtems/posix/semaphore.h
deleted file mode 100644
index cc658ee32b..0000000000
--- a/c/src/exec/posix/include/rtems/posix/semaphore.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/* rtems/posix/semaphore.h
- *
- * This include file contains all the private support information for
- * POSIX Semaphores.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_SEMAPHORE_h
-#define __RTEMS_POSIX_SEMAPHORE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/coresem.h>
-
-/*
- * Data Structure used to manage a POSIX semaphore
- */
-
-typedef struct {
- Objects_Control Object;
- int process_shared;
- boolean named;
- boolean linked;
- unsigned32 open_count;
- CORE_semaphore_Control Semaphore;
-} POSIX_Semaphore_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Semaphore_Information;
-
-/*
- * _POSIX_Semaphore_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Semaphore_Manager_initialization(
- unsigned32 maximum_semaphorees
-);
-
-/*
- * _POSIX_Semaphore_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a semaphore control block from
- * the inactive chain of free semaphore control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void );
-
-/*
- * _POSIX_Semaphore_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a semaphore control block to the
- * inactive chain of free semaphore control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
- POSIX_Semaphore_Control *the_semaphore
-);
-
-/*
- * _POSIX_Semaphore_Get
- *
- * DESCRIPTION:
- *
- * This function maps semaphore IDs to semaphore control blocks.
- * If ID corresponds to a local semaphore, then it returns
- * the_semaphore control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the semaphore ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_semaphore is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_semaphore is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
- Objects_Id *id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Semaphore_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
- POSIX_Semaphore_Control *the_semaphore
-);
-
-/*
- * _POSIX_Semaphore_Name_to_id
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-int _POSIX_Semaphore_Name_to_id(
- const char *name,
- Objects_Id *id
-);
-
-#include <rtems/posix/semaphore.inl>
-#include <rtems/posix/semaphoremp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/include/rtems/posix/semaphoremp.h b/c/src/exec/posix/include/rtems/posix/semaphoremp.h
deleted file mode 100644
index 14af483f98..0000000000
--- a/c/src/exec/posix/include/rtems/posix/semaphoremp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* semaphoremp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Semaphore Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_SEMAPHORE_MP_h
-#define __RTEMS_POSIX_SEMAPHORE_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote semaphore operations.
- */
-
-typedef enum {
- POSIX_SEMAPHORE_MP_ANNOUNCE_CREATE = 0,
- POSIX_SEMAPHORE_MP_ANNOUNCE_DELETE = 1,
- POSIX_SEMAPHORE_MP_EXTRACT_PROXY = 2,
- POSIX_SEMAPHORE_MP_OBTAIN_REQUEST = 3,
- POSIX_SEMAPHORE_MP_OBTAIN_RESPONSE = 4,
- POSIX_SEMAPHORE_MP_RELEASE_REQUEST = 5,
- POSIX_SEMAPHORE_MP_RELEASE_RESPONSE = 6,
-} POSIX_Semaphore_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote semaphore operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Semaphore_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait; /* XXX options */
- Objects_Id proxy_id;
-} POSIX_Semaphore_MP_Packet;
-
-/*
- * _POSIX_Semaphore_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Semaphore_MP_Send_process_packet (
- POSIX_Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Semaphore_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Semaphore_MP_Send_request_packet (
- POSIX_Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- boolean wait, /* XXX options */
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Semaphore_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Semaphore_MP_Send_response_packet (
- POSIX_Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Semaphore_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Semaphore_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Semaphore_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Semaphore_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Semaphore_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Semaphore_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Semaphore_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a semaphore mp packet.
- */
-
-POSIX_Semaphore_MP_Packet *_POSIX_Semaphore_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/posix/include/rtems/posix/seterr.h b/c/src/exec/posix/include/rtems/posix/seterr.h
deleted file mode 100644
index 85311cfd8c..0000000000
--- a/c/src/exec/posix/include/rtems/posix/seterr.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __POSIX_SET_ERRNO_h
-#define __POSIX_SET_ERRNO_h
-
-#define set_errno_and_return_minus_one( _error ) \
- { errno = (_error); return -1; }
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/include/rtems/posix/threadsup.h b/c/src/exec/posix/include/rtems/posix/threadsup.h
deleted file mode 100644
index bb800a507f..0000000000
--- a/c/src/exec/posix/include/rtems/posix/threadsup.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* threadsup.h
- *
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_THREAD_SUPPORT_h
-#define __RTEMS_POSIX_THREAD_SUPPORT_h
-
-#include <rtems/score/coresem.h>
-#include <rtems/score/tqdata.h>
-
-typedef struct {
- pthread_attr_t Attributes;
- int detachstate;
- Thread_queue_Control Join_List;
- int schedpolicy;
- struct sched_param schedparam;
- int ss_high_priority;
- Watchdog_Control Sporadic_timer;
-
- sigset_t signals_blocked;
- sigset_t signals_pending;
-
-#if 0
- /*
- * POSIX Interrupts
- */
- unsigned32 interrupts_installed;
- CORE_semaphore_Control Interrupt_Semaphore;
-#endif
-
-#if 0
- /*
- * POSIX Cancelability
- */
- int cancelability_state;
- int cancelability_type;
- int cancelation_requested;
- Chain_Control Cancellation_Handlers;
-#endif
-
-} POSIX_API_Control;
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/include/rtems/posix/time.h b/c/src/exec/posix/include/rtems/posix/time.h
deleted file mode 100644
index 0e87db388e..0000000000
--- a/c/src/exec/posix/include/rtems/posix/time.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- *
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_TIME_h
-#define __RTEMS_POSIX_TIME_h
-
-#include <rtems/score/tod.h>
-
-/*
- * Seconds from January 1, 1970 to January 1, 1988. Used to account for
- * differences between POSIX API and RTEMS core.
- */
-
-#define POSIX_TIME_SECONDS_1970_THROUGH_1988 \
- (((1987 - 1970 + 1) * TOD_SECONDS_PER_NON_LEAP_YEAR) + \
- (4 * TOD_SECONDS_PER_DAY))
-
-/*PAGE
- *
- * _POSIX_Timespec_subtract
- */
-
-void _POSIX_Timespec_subtract(
- const struct timespec *the_start,
- const struct timespec *end,
- struct timespec *result
-);
-
-/*
- * _POSIX_Timespec_to_interval
- */
-
-Watchdog_Interval _POSIX_Timespec_to_interval(
- const struct timespec *time
-);
-
-/*PAGE
- *
- * _POSIX_Interval_to_timespec
- */
-
-void _POSIX_Interval_to_timespec(
- Watchdog_Interval ticks,
- struct timespec *time
-);
-
-#endif
diff --git a/c/src/exec/posix/include/sched.h b/c/src/exec/posix/include/sched.h
deleted file mode 100644
index 14a603c0c5..0000000000
--- a/c/src/exec/posix/include/sched.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* sched.h
- *
- * $Id$
- */
-
-
-#ifndef __POSIX_SCHEDULING_h
-#define __POSIX_SCHEDULING_h
-
-#include <sys/features.h>
-
-#if defined(_POSIX_PRIORITY_SCHEDULING)
-
-#include <sys/types.h>
-#include <time.h>
-#include <sys/sched.h>
-#include <pthread.h>
-
-/*
- * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252
- *
- */
-
-int sched_setparam(
- pid_t pid,
- const struct sched_param *param
-);
-
-/*
- * 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253
- */
-
-int sched_getparam(
- pid_t pid,
- const struct sched_param *param
-);
-
-/*
- * 13.3.3 Set Scheduling Policy and Scheduling Parameters,
- * P1003.1b-1993, p. 254
- */
-
-int sched_setscheduler(
- pid_t pid,
- int policy,
- const struct sched_param *param
-);
-
-/*
- * 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256
- */
-
-int sched_getscheduler(
- pid_t pid
-);
-
-/*
- * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
- */
-
-int sched_get_priority_max(
- int policy
-);
-
-int sched_get_priority_min(
- int policy
-);
-
-int sched_rr_get_interval(
- pid_t pid,
- struct timespec *interval
-);
-
-#endif /* _POSIX_PRIORITY_SCHEDULING */
-
-#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING)
-
-/*
- * 13.3.5 Yield Processor, P1003.1b-1993, p. 257
- */
-
-int sched_yield( void );
-
-#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/include/semaphore.h b/c/src/exec/posix/include/semaphore.h
deleted file mode 100644
index 0388f91ad9..0000000000
--- a/c/src/exec/posix/include/semaphore.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* semaphore.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_SEMAPHORE_h
-#define __POSIX_SEMAPHORE_h
-
-#include <rtems/posix/features.h>
-
-#if defined(_POSIX_SEMAPHORES)
-
-#include <sys/time.h>
-
-/*
- * 11.1 Semaphore Characteristics, P1003.1b-1993, p.219
- */
-
-typedef int sem_t;
-
-/*
- * 11.2.1 Initialize an Unnamed Semaphore, P1003.1b-1993, p.219
- */
-
-int sem_init(
- sem_t *sem,
- int pshared,
- unsigned int value
-);
-
-/*
- * 11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220
- */
-
-int sem_destroy(
- sem_t *sem
-);
-
-/*
- * 11.2.3 Initialize/Open a Named Semaphore, P1003.1b-1993, p.221
- *
- * NOTE: Follows open() calling conventions.
- */
-
-sem_t *sem_open(
- const char *name,
- int oflag,
- ...
-);
-
-/*
- * 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224
- */
-
-int sem_close(
- sem_t *sem
-);
-
-/*
- * 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225
- */
-
-int sem_unlink(
- const char *name
-);
-
-/*
- * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226
- *
- * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27
- */
-
-int sem_wait(
- sem_t *sem
-);
-
-int sem_trywait(
- sem_t *sem
-);
-
-#if defined(_POSIX_TIMEOUTS)
-int sem_timedwait(
- sem_t *sem,
- const struct timespec *timeout
-);
-#endif
-
-/*
- * 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227
- */
-
-int sem_post(
- sem_t *sem
-);
-
-/*
- * 11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229
- */
-
-int sem_getvalue(
- sem_t *sem,
- int *sval
-);
-
-#endif /* _POSIX_SEMAPHORES */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/posix/include/sys/Makefile.in b/c/src/exec/posix/include/sys/Makefile.in
deleted file mode 100644
index d7d9281094..0000000000
--- a/c/src/exec/posix/include/sys/Makefile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-#H_PIECES=utsname
-H_PIECES=
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-SRCS=$(H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/sys
diff --git a/c/src/exec/posix/include/sys/utsname.h b/c/src/exec/posix/include/sys/utsname.h
deleted file mode 100644
index ca15230d40..0000000000
--- a/c/src/exec/posix/include/sys/utsname.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* sys/utsname.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_SYS_UTSNAME_h
-#define __POSIX_SYS_UTSNAME_h
-
-#include <sys/times.h>
-#include <sys/types.h>
-
-/*
- * 4.4.1 Get System Name (Table 4-1), P1003.1b-1993, p. 90
- *
- * NOTE: The lengths of the strings in this structure are
- * just long enough to reliably contain the RTEMS information.
- * For example, the fields are not long enough to support
- * Internet hostnames.
- */
-
-struct utsname {
- char sysname[ 32 ]; /* Name of this implementation of the operating system */
- char nodename[ 32 ]; /* Name of this node within an implementation */
- /* specified communication network */
- char release[ 32 ]; /* Current release level of this implementation */
- char version[ 32 ]; /* Current version level of this release */
- char machine[ 32 ]; /* Name of the hardware type on which the system */
- /* is running */
-};
-
-/*
- * 4.4.1 Get System Name, P1003.1b-1993, p. 90
- */
-
-int uname(
- struct utsname *name
-);
-
-/*
- * 4.5.2 Get Process Times, P1003.1b-1993, p. 92
- */
-
-clock_t times(
- struct tms *buffer
-);
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/include/unistd.h b/c/src/exec/posix/include/unistd.h
deleted file mode 100644
index 0001ecc475..0000000000
--- a/c/src/exec/posix/include/unistd.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* unistd.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_UNISTD_h
-#define __POSIX_UNISTD_h
-
-#include <rtems/posix/features.h>
-
-/*
- * 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 96
- *
- * NOTE: Table 4-2, Configurable System Variables, p. 96
- */
-
-#define _SC_AIO_LISTIO_MAX 0
-#define _SC_AIO_MAX 1
-#define _SC_AIO_PRIO_DELTA_MAX 2
-#define _SC_ARG_MAX 3
-#define _SC_CHILD_MAX 4
-#define _SC_CLK_TCK 5
-#define _SC_DELAYTIMER_MAX 6
-#define _SC_MQ_OPEN_MAX 7
-#define _SC_MQ_PRIO_MAX 8
-#define _SC_NGROUPS_MAX 9
-#define _SC_OPEN_MAX 10
-#define _SC_PAGESIZE 11
-#define _SC_RTSIG_MAX 12
-#define _SC_SEM_NSEMS_MAX 13
-#define _SC_SEM_VALUE_MAX 14
-#define _SC_SIGQUEUE_MAX 15
-#define _SC_STREAM_MAX 16
-#define _SC_TIMER_MAX 17
-#define _SC_TZNAME_MAX 18
-
-#define _SC_ASYNCHRONOUS_IO 19
-#define _SC_FSYNC 20
-#define _SC_JOB_CONTROL 21
-#define _SC_MAPPED_FILES 22
-#define _SC_MEMLOCK 23
-#define _SC_MEMLOCK_RANGE 24
-#define _SC_MEMORY_PROTECTION 25
-#define _SC_MESSAGE_PASSING 26
-#define _SC_PRIORITIZED_IO 27
-#define _SC_REALTIME_SIGNALS 28
-#define _SC_SAVED_IDS 29
-#define _SC_SEMAPHORES 30
-#define _SC_SHARED_MEMORY_OBJECTS 31
-#define _SC_SYNCHRONIZED_IO 32
-#define _SC_TIMERS 33
-#define _SC_VERSION 34
-
-/*
- * P1003.1c/D10, p. 52 adds the following.
- */
-
-#define _SC_GETGR_R_SIZE_MAX 35
-#define _SC_GETPW_R_SIZE_MAX 36
-#define _SC_LOGIN_NAME_MAX 37
-#define _SC_THREAD_DESTRUCTOR_ITERATIONS 38
-#define _SC_THREAD_KEYS_MAX 39
-#define _SC_THREAD_STACK_MIN 40
-#define _SC_THREAD_THREADS_MAX 41
-#define _SC_TTY_NAME_MAX 42
-
-#define _SC_THREADS 43
-#define _SC_THREAD_ATTR_STACKADDR 44
-#define _SC_THREAD_ATTR_STACKSIZE 45
-#define _SC_THREAD_PRIORITY_SCHEDULING 46
-#define _SC_THREAD_PRIO_INHERIT 47
-#define _SC_THREAD_PRIO_CEILING 48
-#define _SC_THREAD_PROCESS_SHARED 49
-#define _SC_THREAD_SAFE_FUNCTIONS 50
-
-/* JRS: 04/02/98: _SC_THREAD_PRIO_CEILING seems to have changed names
- * in the final standard to _SC_THREAD_PRIO_PROTECT.
- */
-
-/*
- * 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 95
- */
-
-long sysconf(
- int name
-);
-
-#endif
-/* end of include */
diff --git a/c/src/exec/posix/include/wrap/Makefile.in b/c/src/exec/posix/include/wrap/Makefile.in
deleted file mode 100644
index 1d2e92cca0..0000000000
--- a/c/src/exec/posix/include/wrap/Makefile.in
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-#H_PIECES= aio devctl intr limits mqueue pthread sched semaphore \
-# signal time unistd
-H_PIECES= pthread sched
-# limits.h may have been moved into newlib -- check before removing it
-# from the cvs tree
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-SRCS=$(H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)
diff --git a/c/src/exec/posix/inline/Makefile.in b/c/src/exec/posix/inline/Makefile.in
deleted file mode 100644
index 0b0d64d1ef..0000000000
--- a/c/src/exec/posix/inline/Makefile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-#I_PIECES= cond intr key mqueue mutex pthread priority semaphore
-I_PIECES=cond key mutex pthread priority
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems/posix
diff --git a/c/src/exec/posix/inline/cond.inl b/c/src/exec/posix/inline/cond.inl
deleted file mode 100644
index 3a6741b1b8..0000000000
--- a/c/src/exec/posix/inline/cond.inl
+++ /dev/null
@@ -1,77 +0,0 @@
-/* rtems/posix/cond.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX condition variables.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_CONDITION_VARIABLES_inl
-#define __RTEMS_POSIX_CONDITION_VARIABLES_inl
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
- *_POSIX_Condition_variables_Allocate( void )
-{
- return (POSIX_Condition_variables_Control *)
- _Objects_Allocate( &_POSIX_Condition_variables_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
- POSIX_Condition_variables_Control *the_condition_variable
-)
-{
- _Objects_Free(
- &_POSIX_Condition_variables_Information,
- &the_condition_variable->Object
- );
-}
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
- Objects_Id *id,
- Objects_Locations *location
-)
-{
-/* XXX really should validate pointer */
-/* XXX should support COND_INITIALIZER */
- return (POSIX_Condition_variables_Control *)
- _Objects_Get( &_POSIX_Condition_variables_Information, *id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
- POSIX_Condition_variables_Control *the_condition_variable
-)
-{
- return !the_condition_variable;
-}
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/inline/intr.inl b/c/src/exec/posix/inline/intr.inl
deleted file mode 100644
index d084a1d12a..0000000000
--- a/c/src/exec/posix/inline/intr.inl
+++ /dev/null
@@ -1,72 +0,0 @@
-/* rtems/posix/intr.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX Interrupt Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_INTERRUPT_inl
-#define __RTEMS_POSIX_INTERRUPT_inl
-
-/*PAGE
- *
- * _POSIX_Interrupt_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
- _POSIX_Interrupt_Allocate( void )
-{
- return (POSIX_Interrupt_Handler_control *)
- _Objects_Allocate( &_POSIX_Interrupt_Handlers_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Interrupt_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
- POSIX_Interrupt_Handler_control *the_intr
-)
-{
- _Objects_Free( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Interrupt_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (POSIX_Interrupt_Control *)
- _Objects_Get( &_POSIX_Interrupt_Handlers_Information, id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Interrupt_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
- POSIX_Interrupt_Handler_control *the_intr
-)
-{
- return !the_intr;
-}
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/inline/key.inl b/c/src/exec/posix/inline/key.inl
deleted file mode 100644
index fa4d31b11f..0000000000
--- a/c/src/exec/posix/inline/key.inl
+++ /dev/null
@@ -1,70 +0,0 @@
-/* rtems/posix/key.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX key's.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_KEY_inl
-#define __RTEMS_POSIX_KEY_inl
-
-/*PAGE
- *
- * _POSIX_Keys_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
-{
- return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Keys_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
- POSIX_Keys_Control *the_key
-)
-{
- _Objects_Free( &_POSIX_Keys_Information, &the_key->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Keys_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (POSIX_Keys_Control *)
- _Objects_Get( &_POSIX_Keys_Information, id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Keys_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
- POSIX_Keys_Control *the_key
-)
-{
- return !the_key;
-}
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/inline/mqueue.inl b/c/src/exec/posix/inline/mqueue.inl
deleted file mode 100644
index 51326fba7b..0000000000
--- a/c/src/exec/posix/inline/mqueue.inl
+++ /dev/null
@@ -1,83 +0,0 @@
-/* rtems/posix/mqueue.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX Message Queue.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MESSAGE_QUEUE_inl
-#define __RTEMS_POSIX_MESSAGE_QUEUE_inl
-
-/*PAGE
- *
- * _POSIX_Message_queue_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
-{
- return (POSIX_Message_queue_Control *)
- _Objects_Allocate( &_POSIX_Message_queue_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
- POSIX_Message_queue_Control *the_mq
-)
-{
- _Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (POSIX_Message_queue_Control *)
- _Objects_Get( &_POSIX_Message_queue_Information, id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
- POSIX_Message_queue_Control *the_mq
-)
-{
- return !the_mq;
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Priority_to_core
- */
-
-RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
- unsigned int priority
-)
-{
- return priority;
-}
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/inline/mutex.inl b/c/src/exec/posix/inline/mutex.inl
deleted file mode 100644
index 5c1f3b7b73..0000000000
--- a/c/src/exec/posix/inline/mutex.inl
+++ /dev/null
@@ -1,93 +0,0 @@
-/* rtems/posix/mutex.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX mutex's.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MUTEX_inl
-#define __RTEMS_POSIX_MUTEX_inl
-
-/*PAGE
- *
- * _POSIX_Mutex_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void )
-{
- return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Mutex_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
- POSIX_Mutex_Control *the_mutex
-)
-{
- _Objects_Free( &_POSIX_Mutex_Information, &the_mutex->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Mutex_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
- Objects_Id *id,
- Objects_Locations *location
-)
-{
- int status;
-
- if ( !id ) {
- *location = OBJECTS_ERROR;
- return (POSIX_Mutex_Control *) 0;
- }
-
- if ( *id == PTHREAD_MUTEX_INITIALIZER ) {
- /*
- * Do an "auto-create" here.
- */
-
- status = pthread_mutex_init( id, 0 );
- if ( status ) {
- *location = OBJECTS_ERROR;
- return (POSIX_Mutex_Control *) 0;
- }
- }
-
- /*
- * Now call Objects_Get()
- */
-
- return (POSIX_Mutex_Control *)
- _Objects_Get( &_POSIX_Mutex_Information, *id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Mutex_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
- POSIX_Mutex_Control *the_mutex
-)
-{
- return !the_mutex;
-}
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/inline/priority.inl b/c/src/exec/posix/inline/priority.inl
deleted file mode 100644
index dc8187d4ef..0000000000
--- a/c/src/exec/posix/inline/priority.inl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_PRIORITY_inl
-#define __RTEMS_POSIX_PRIORITY_inl
-
-/*
- * 1003.1b-1993,2.2.2.80 definition of priority, p. 19
- *
- * "Numericallly higher values represent higher priorities."
- *
- * Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
- int priority
-)
-{
- return (boolean) (priority >= 1 && priority <= 254);
-}
-
-RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
- int priority
-)
-{
- return (Priority_Control) (255 - priority);
-}
-
-RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
- Priority_Control priority
-)
-{
- return 255 - priority;
-}
-
-#endif
diff --git a/c/src/exec/posix/inline/pthread.inl b/c/src/exec/posix/inline/pthread.inl
deleted file mode 100644
index 51f7287384..0000000000
--- a/c/src/exec/posix/inline/pthread.inl
+++ /dev/null
@@ -1,70 +0,0 @@
-/* rtems/posix/pthread.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX threads.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_THREADS_inl
-#define __RTEMS_POSIX_THREADS_inl
-
-/*PAGE
- *
- * _POSIX_Threads_Allocate
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
-{
- return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
- Thread_Control *the_pthread
-)
-{
- _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Get
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get (
- pthread_t id,
- Objects_Locations *location
-)
-{
- return (Thread_Control *)
- _Objects_Get( &_POSIX_Threads_Information, (Objects_Id)id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null (
- Thread_Control *the_pthread
-)
-{
- return !the_pthread;
-}
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/inline/rtems/posix/Makefile.in b/c/src/exec/posix/inline/rtems/posix/Makefile.in
deleted file mode 100644
index 0b0d64d1ef..0000000000
--- a/c/src/exec/posix/inline/rtems/posix/Makefile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-#I_PIECES= cond intr key mqueue mutex pthread priority semaphore
-I_PIECES=cond key mutex pthread priority
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems/posix
diff --git a/c/src/exec/posix/inline/rtems/posix/cond.inl b/c/src/exec/posix/inline/rtems/posix/cond.inl
deleted file mode 100644
index 3a6741b1b8..0000000000
--- a/c/src/exec/posix/inline/rtems/posix/cond.inl
+++ /dev/null
@@ -1,77 +0,0 @@
-/* rtems/posix/cond.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX condition variables.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_CONDITION_VARIABLES_inl
-#define __RTEMS_POSIX_CONDITION_VARIABLES_inl
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
- *_POSIX_Condition_variables_Allocate( void )
-{
- return (POSIX_Condition_variables_Control *)
- _Objects_Allocate( &_POSIX_Condition_variables_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
- POSIX_Condition_variables_Control *the_condition_variable
-)
-{
- _Objects_Free(
- &_POSIX_Condition_variables_Information,
- &the_condition_variable->Object
- );
-}
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
- Objects_Id *id,
- Objects_Locations *location
-)
-{
-/* XXX really should validate pointer */
-/* XXX should support COND_INITIALIZER */
- return (POSIX_Condition_variables_Control *)
- _Objects_Get( &_POSIX_Condition_variables_Information, *id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
- POSIX_Condition_variables_Control *the_condition_variable
-)
-{
- return !the_condition_variable;
-}
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/inline/rtems/posix/intr.inl b/c/src/exec/posix/inline/rtems/posix/intr.inl
deleted file mode 100644
index d084a1d12a..0000000000
--- a/c/src/exec/posix/inline/rtems/posix/intr.inl
+++ /dev/null
@@ -1,72 +0,0 @@
-/* rtems/posix/intr.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX Interrupt Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_INTERRUPT_inl
-#define __RTEMS_POSIX_INTERRUPT_inl
-
-/*PAGE
- *
- * _POSIX_Interrupt_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
- _POSIX_Interrupt_Allocate( void )
-{
- return (POSIX_Interrupt_Handler_control *)
- _Objects_Allocate( &_POSIX_Interrupt_Handlers_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Interrupt_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
- POSIX_Interrupt_Handler_control *the_intr
-)
-{
- _Objects_Free( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Interrupt_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (POSIX_Interrupt_Control *)
- _Objects_Get( &_POSIX_Interrupt_Handlers_Information, id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Interrupt_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
- POSIX_Interrupt_Handler_control *the_intr
-)
-{
- return !the_intr;
-}
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/inline/rtems/posix/key.inl b/c/src/exec/posix/inline/rtems/posix/key.inl
deleted file mode 100644
index fa4d31b11f..0000000000
--- a/c/src/exec/posix/inline/rtems/posix/key.inl
+++ /dev/null
@@ -1,70 +0,0 @@
-/* rtems/posix/key.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX key's.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_KEY_inl
-#define __RTEMS_POSIX_KEY_inl
-
-/*PAGE
- *
- * _POSIX_Keys_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
-{
- return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Keys_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
- POSIX_Keys_Control *the_key
-)
-{
- _Objects_Free( &_POSIX_Keys_Information, &the_key->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Keys_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (POSIX_Keys_Control *)
- _Objects_Get( &_POSIX_Keys_Information, id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Keys_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
- POSIX_Keys_Control *the_key
-)
-{
- return !the_key;
-}
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/inline/rtems/posix/mqueue.inl b/c/src/exec/posix/inline/rtems/posix/mqueue.inl
deleted file mode 100644
index 51326fba7b..0000000000
--- a/c/src/exec/posix/inline/rtems/posix/mqueue.inl
+++ /dev/null
@@ -1,83 +0,0 @@
-/* rtems/posix/mqueue.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX Message Queue.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MESSAGE_QUEUE_inl
-#define __RTEMS_POSIX_MESSAGE_QUEUE_inl
-
-/*PAGE
- *
- * _POSIX_Message_queue_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
-{
- return (POSIX_Message_queue_Control *)
- _Objects_Allocate( &_POSIX_Message_queue_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
- POSIX_Message_queue_Control *the_mq
-)
-{
- _Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (POSIX_Message_queue_Control *)
- _Objects_Get( &_POSIX_Message_queue_Information, id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
- POSIX_Message_queue_Control *the_mq
-)
-{
- return !the_mq;
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Priority_to_core
- */
-
-RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
- unsigned int priority
-)
-{
- return priority;
-}
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/inline/rtems/posix/mutex.inl b/c/src/exec/posix/inline/rtems/posix/mutex.inl
deleted file mode 100644
index 5c1f3b7b73..0000000000
--- a/c/src/exec/posix/inline/rtems/posix/mutex.inl
+++ /dev/null
@@ -1,93 +0,0 @@
-/* rtems/posix/mutex.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX mutex's.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MUTEX_inl
-#define __RTEMS_POSIX_MUTEX_inl
-
-/*PAGE
- *
- * _POSIX_Mutex_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void )
-{
- return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Mutex_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
- POSIX_Mutex_Control *the_mutex
-)
-{
- _Objects_Free( &_POSIX_Mutex_Information, &the_mutex->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Mutex_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
- Objects_Id *id,
- Objects_Locations *location
-)
-{
- int status;
-
- if ( !id ) {
- *location = OBJECTS_ERROR;
- return (POSIX_Mutex_Control *) 0;
- }
-
- if ( *id == PTHREAD_MUTEX_INITIALIZER ) {
- /*
- * Do an "auto-create" here.
- */
-
- status = pthread_mutex_init( id, 0 );
- if ( status ) {
- *location = OBJECTS_ERROR;
- return (POSIX_Mutex_Control *) 0;
- }
- }
-
- /*
- * Now call Objects_Get()
- */
-
- return (POSIX_Mutex_Control *)
- _Objects_Get( &_POSIX_Mutex_Information, *id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Mutex_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
- POSIX_Mutex_Control *the_mutex
-)
-{
- return !the_mutex;
-}
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/inline/rtems/posix/priority.inl b/c/src/exec/posix/inline/rtems/posix/priority.inl
deleted file mode 100644
index dc8187d4ef..0000000000
--- a/c/src/exec/posix/inline/rtems/posix/priority.inl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_PRIORITY_inl
-#define __RTEMS_POSIX_PRIORITY_inl
-
-/*
- * 1003.1b-1993,2.2.2.80 definition of priority, p. 19
- *
- * "Numericallly higher values represent higher priorities."
- *
- * Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
- int priority
-)
-{
- return (boolean) (priority >= 1 && priority <= 254);
-}
-
-RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
- int priority
-)
-{
- return (Priority_Control) (255 - priority);
-}
-
-RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
- Priority_Control priority
-)
-{
- return 255 - priority;
-}
-
-#endif
diff --git a/c/src/exec/posix/inline/rtems/posix/pthread.inl b/c/src/exec/posix/inline/rtems/posix/pthread.inl
deleted file mode 100644
index 51f7287384..0000000000
--- a/c/src/exec/posix/inline/rtems/posix/pthread.inl
+++ /dev/null
@@ -1,70 +0,0 @@
-/* rtems/posix/pthread.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX threads.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_THREADS_inl
-#define __RTEMS_POSIX_THREADS_inl
-
-/*PAGE
- *
- * _POSIX_Threads_Allocate
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
-{
- return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
- Thread_Control *the_pthread
-)
-{
- _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Get
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get (
- pthread_t id,
- Objects_Locations *location
-)
-{
- return (Thread_Control *)
- _Objects_Get( &_POSIX_Threads_Information, (Objects_Id)id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null (
- Thread_Control *the_pthread
-)
-{
- return !the_pthread;
-}
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/inline/rtems/posix/semaphore.inl b/c/src/exec/posix/inline/rtems/posix/semaphore.inl
deleted file mode 100644
index 8f2189d82a..0000000000
--- a/c/src/exec/posix/inline/rtems/posix/semaphore.inl
+++ /dev/null
@@ -1,71 +0,0 @@
-/* rtems/posix/semaphore.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX Semaphores.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_SEMAPHORE_inl
-#define __RTEMS_POSIX_SEMAPHORE_inl
-
-/*PAGE
- *
- * _POSIX_Semaphore_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
-{
- return (POSIX_Semaphore_Control *)
- _Objects_Allocate( &_POSIX_Semaphore_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
- POSIX_Semaphore_Control *the_semaphore
-)
-{
- _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
- Objects_Id *id,
- Objects_Locations *location
-)
-{
- return (POSIX_Semaphore_Control *)
- _Objects_Get( &_POSIX_Semaphore_Information, *id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
- POSIX_Semaphore_Control *the_semaphore
-)
-{
- return !the_semaphore;
-}
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/inline/semaphore.inl b/c/src/exec/posix/inline/semaphore.inl
deleted file mode 100644
index 8f2189d82a..0000000000
--- a/c/src/exec/posix/inline/semaphore.inl
+++ /dev/null
@@ -1,71 +0,0 @@
-/* rtems/posix/semaphore.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX Semaphores.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_SEMAPHORE_inl
-#define __RTEMS_POSIX_SEMAPHORE_inl
-
-/*PAGE
- *
- * _POSIX_Semaphore_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
-{
- return (POSIX_Semaphore_Control *)
- _Objects_Allocate( &_POSIX_Semaphore_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
- POSIX_Semaphore_Control *the_semaphore
-)
-{
- _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
- Objects_Id *id,
- Objects_Locations *location
-)
-{
- return (POSIX_Semaphore_Control *)
- _Objects_Get( &_POSIX_Semaphore_Information, *id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
- POSIX_Semaphore_Control *the_semaphore
-)
-{
- return !the_semaphore;
-}
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/posix/macros/Makefile.in b/c/src/exec/posix/macros/Makefile.in
deleted file mode 100644
index d402b7b788..0000000000
--- a/c/src/exec/posix/macros/Makefile.in
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# Right now there are not macro implementation of the posix inline routines
-# So it won't build
-I_PIECES=
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- #$(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems/posix
diff --git a/c/src/exec/posix/macros/rtems/posix/Makefile.in b/c/src/exec/posix/macros/rtems/posix/Makefile.in
deleted file mode 100644
index d402b7b788..0000000000
--- a/c/src/exec/posix/macros/rtems/posix/Makefile.in
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# Right now there are not macro implementation of the posix inline routines
-# So it won't build
-I_PIECES=
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- #$(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems/posix
diff --git a/c/src/exec/posix/optman/Makefile.in b/c/src/exec/posix/optman/Makefile.in
deleted file mode 100644
index 3c3c4f1887..0000000000
--- a/c/src/exec/posix/optman/Makefile.in
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-C_FILES=
-
-H_FILES=
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-PGMS=$(C_FILES:%.c=$(ARCH)/%.rel)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-ASM4FLAGS += -I $(PROJECT_INCLUDE)/rtems
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGMS)
- #$(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
diff --git a/c/src/exec/posix/src/Makefile.in b/c/src/exec/posix/src/Makefile.in
deleted file mode 100644
index f5864775d3..0000000000
--- a/c/src/exec/posix/src/Makefile.in
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# following are semi-implemented and untested
-# C_PIECES=aio cancel devctl intr mqueue ptimer semaphore time utsname
-
-ENOSYS_C_PIECES=\
- execl execle execlp execv execve execvp fork \
- pthreadatfork wait waitpid
-
-C_PIECES= adasupp cond getpid key mutex pthread psignal sched time \
- types unistd $(ENOSYS_C_PIECES)
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D__RTEMS_INSIDE__
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) ${OBJS}
-
-# temporary so we can see how many things are left to implement
-not:
- grep -i NOT_IMPL $(C_FILES) | grep -v MP_NOT_IMPL
- @echo
- @echo
- @echo
- @echo `grep -i NOT_IMPL $(C_FILES) | grep -v MP_NOT_IMPL | wc -l ` places marked not implemented
- @echo `wc -l $(C_FILES) | grep total` lines of C code to test
diff --git a/c/src/exec/posix/src/adasupp.c b/c/src/exec/posix/src/adasupp.c
deleted file mode 100644
index 234b0c2a40..0000000000
--- a/c/src/exec/posix/src/adasupp.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * $Id$
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <pthread.h>
-
-#include <rtems/system.h>
-#include <rtems/posix/pthread.h>
-
-/*PAGE
- *
- * _ada_pthread_minimum_stack_size
- *
- * This routine returns the minimum stack size so the GNAT RTS can
- * allocate enough stack for Ada tasks.
- */
-
-size_t _ada_pthread_minimum_stack_size( void )
-{
- /*
- * Eventually this may need to include a per cpu family calculation
- * but for now, this will do.
- */
-
- return PTHREAD_MINIMUM_STACK_SIZE * 2;
-}
diff --git a/c/src/exec/posix/src/aio.c b/c/src/exec/posix/src/aio.c
deleted file mode 100644
index 9fc072f820..0000000000
--- a/c/src/exec/posix/src/aio.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * $Id$
- */
-
-#include <aio.h>
-
-#include <rtems/system.h>
-
-/*PAGE
- *
- * 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154
- */
-
-int aio_read(
- struct aiocb *aiocbp
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155
- */
-
-int aio_write(
- struct aiocb *aiocbp
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 6.7.4 List Directed I/O, P1003.1b-1993, p. 158
- */
-
-int lio_listio(
- int mode,
- struct aiocb * const list[],
- int nent,
- struct sigevent *sig
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161
- */
-
-int aio_error(
- const struct aiocb *aiocbp
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
- * P1003.1b-1993, p. 162
- */
-
-int aio_return(
- const struct aiocb *aiocbp
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163
- */
-
-int aio_cancel(
- int filedes,
- struct aiocb *aiocbp
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164
- */
-
-int aio_suspend(
- struct aiocb * const list[],
- int nent,
- const struct timespec *timeout
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166
- */
-
-int aio_fsync(
- int op,
- struct aiocb *aiocbp
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
diff --git a/c/src/exec/posix/src/cancel.c b/c/src/exec/posix/src/cancel.c
deleted file mode 100644
index b6cc073456..0000000000
--- a/c/src/exec/posix/src/cancel.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * $Id$
- */
-
-#include <pthread.h>
-#include <errno.h>
-
-#include <rtems/system.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/posix/cancel.h>
-#include <rtems/posix/pthread.h>
-#include <rtems/posix/threadsup.h>
-
-/*PAGE
- *
- * POSIX_Thread_cancel_run
- *
- */
-
-void POSIX_Thread_cancel_run(
- Thread_Control *the_thread
-)
-{
- int old_cancel_state;
- POSIX_Cancel_Handler_control *handler;
- Chain_Control *handler_stack;
- POSIX_API_Thread_Support_Control *thread_support;
- ISR_Level level;
-
- thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- handler_stack = &thread_support->Cancellation_Handlers;
-
- old_cancel_state = thread_support->cancelability_state;
-
- thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE;
-
- while ( !_Chain_Is_empty( handler_stack ) ) {
- _ISR_Disable( level );
- handler = (POSIX_Cancel_Handler_control *) _Chain_Tail( handler_stack );
- _Chain_Extract_unprotected( &handler->Node );
- _ISR_Enable( level );
-
- (*handler->routine)( handler->arg );
-
- _Workspace_Free( handler );
- }
-
- thread_support->cancelation_requested = 0;
-
- thread_support->cancelability_state = old_cancel_state;
-}
-
-/*PAGE
- *
- * 18.2.1 Canceling Execution of a Thread, P1003.1c/Draft 10, p. 181
- */
-
-int pthread_cancel(
- pthread_t thread
-)
-{
- Thread_Control *the_thread;
- POSIX_API_Thread_Support_Control *thread_support;
- Objects_Locations location;
-
- the_thread = _POSIX_Threads_Get( &thread, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- return POSIX_MP_NOT_IMPLEMENTED();
- case OBJECTS_LOCAL:
- thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- thread_support->cancelation_requested = 1;
-
- _Thread_Enable_dispatch();
- return 0;
- }
-
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
- */
-
-int pthread_setcancelstate(
- int state,
- int *oldstate
-)
-{
- POSIX_API_Thread_Support_Control *thread_support;
-
- if ( !oldstate )
- return EINVAL;
-
- if ( state != PTHREAD_CANCEL_ENABLE && state != PTHREAD_CANCEL_DISABLE )
- return EINVAL;
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- *oldstate = thread_support->cancelability_state;
- thread_support->cancelability_state = state;
-
- if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
- thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
- thread_support->cancelation_requested )
- POSIX_Thread_cancel_run( _Thread_Executing );
-
- return 0;
-}
-
-/*PAGE
- *
- * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
- */
-
-int pthread_setcanceltype(
- int type,
- int *oldtype
-)
-{
- POSIX_API_Thread_Support_Control *thread_support;
-
- if ( !oldtype )
- return EINVAL;
-
- if ( type != PTHREAD_CANCEL_DEFERRED && type != PTHREAD_CANCEL_ASYNCHRONOUS )
- return EINVAL;
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- *oldtype = thread_support->cancelability_type;
- thread_support->cancelability_type = type;
-
- if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
- thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
- thread_support->cancelation_requested )
- POSIX_Thread_cancel_run( _Thread_Executing );
-
- return 0;
-}
-
-/*PAGE
- *
- * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
- */
-
-void pthread_testcancel( void )
-{
- POSIX_API_Thread_Support_Control *thread_support;
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
- thread_support->cancelation_requested )
- POSIX_Thread_cancel_run( _Thread_Executing );
-}
-
-/*PAGE
- *
- * 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184
- */
-
-void pthread_cleanup_push(
- void (*routine)( void * ),
- void *arg
-)
-{
- POSIX_Cancel_Handler_control *handler;
- Chain_Control *handler_stack;
- POSIX_API_Thread_Support_Control *thread_support;
-
- if ( !routine )
- return; /* XXX what to do really? */
-
- handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
-
- if ( !handler )
- return; /* XXX what to do really? */
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- handler_stack = &thread_support->Cancellation_Handlers;
-
- handler->routine = routine;
- handler->arg = arg;
-
- _Chain_Append( handler_stack, &handler->Node );
-}
-
-/*PAGE
- *
- * 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184
- */
-
-void pthread_cleanup_pop(
- int execute
-)
-{
- POSIX_Cancel_Handler_control *handler;
- Chain_Control *handler_stack;
- POSIX_API_Thread_Support_Control *thread_support;
- ISR_Level level;
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- handler_stack = &thread_support->Cancellation_Handlers;
-
- if ( _Chain_Is_empty( handler_stack ) )
- return;
-
- _ISR_Disable( level );
- handler = (POSIX_Cancel_Handler_control *) _Chain_Tail( handler_stack );
- _Chain_Extract_unprotected( &handler->Node );
- _ISR_Enable( level );
-
- if ( execute )
- (*handler->routine)( handler->arg );
-
- _Workspace_Free( handler );
-}
diff --git a/c/src/exec/posix/src/cond.c b/c/src/exec/posix/src/cond.c
deleted file mode 100644
index 248f836b94..0000000000
--- a/c/src/exec/posix/src/cond.c
+++ /dev/null
@@ -1,502 +0,0 @@
-/*
- * $Id$
- */
-
-#include <pthread.h>
-#include <errno.h>
-
-#include <rtems/system.h>
-#include <rtems/score/object.h>
-#include <rtems/score/states.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/posix/cond.h>
-#include <rtems/posix/time.h>
-#include <rtems/posix/mutex.h>
-
-/*
- * TEMPORARY
- */
-
-void _POSIX_Condition_variables_MP_Send_process_packet (
- POSIX_Condition_variables_MP_Remote_operations operation,
- Objects_Id condition_variables_id,
- Objects_Name name,
- Objects_Id proxy_id
-)
-{
- (void) POSIX_MP_NOT_IMPLEMENTED();
-}
-
-void _POSIX_Condition_variables_MP_Send_extract_proxy(
- Thread_Control *the_thread
-)
-{
- (void) POSIX_MP_NOT_IMPLEMENTED();
-}
-
-/*
- * END OF TEMPORARY
- */
-
-/*PAGE
- *
- * The default condition variable attributes structure.
- */
-
-const pthread_condattr_t _POSIX_Condition_variables_Default_attributes = {
- TRUE, /* is_initialized */
- PTHREAD_PROCESS_PRIVATE /* process_shared */
-};
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Manager_initialization
- *
- * This routine initializes all condition variable manager related data
- * structures.
- *
- * Input parameters:
- * maximum_condition_variables - maximum configured condition_variables
- *
- * Output parameters: NONE
- */
-
-void _POSIX_Condition_variables_Manager_initialization(
- unsigned32 maximum_condition_variables
-)
-{
- _Objects_Initialize_information(
- &_POSIX_Condition_variables_Information,
- OBJECTS_POSIX_CONDITION_VARIABLES,
- TRUE,
- maximum_condition_variables,
- sizeof( POSIX_Condition_variables_Control ),
- FALSE,
- 0,
- FALSE
- );
-}
-
-/*PAGE
- *
- * 11.4.1 Condition Variable Initialization Attributes,
- * P1003.1c/Draft 10, p. 96
- */
-
-int pthread_condattr_init(
- pthread_condattr_t *attr
-)
-{
- if ( !attr )
- return EINVAL;
-
- *attr = _POSIX_Condition_variables_Default_attributes;
- return 0;
-}
-
-/*PAGE
- *
- * 11.4.1 Condition Variable Initialization Attributes,
- * P1003.1c/Draft 10, p. 96
- */
-
-int pthread_condattr_destroy(
- pthread_condattr_t *attr
-)
-{
- if ( !attr || attr->is_initialized == FALSE )
- return EINVAL;
-
- attr->is_initialized = FALSE;
- return 0;
-}
-
-/*PAGE
- *
- * 11.4.1 Condition Variable Initialization Attributes,
- * P1003.1c/Draft 10, p. 96
- */
-
-int pthread_condattr_getpshared(
- const pthread_condattr_t *attr,
- int *pshared
-)
-{
- if ( !attr )
- return EINVAL;
-
- *pshared = attr->process_shared;
- return 0;
-}
-
-/*PAGE
- *
- * 11.4.1 Condition Variable Initialization Attributes,
- * P1003.1c/Draft 10, p. 96
- */
-
-int pthread_condattr_setpshared(
- pthread_condattr_t *attr,
- int pshared
-)
-{
- if ( !attr )
- return EINVAL;
-
- switch ( pshared ) {
- case PTHREAD_PROCESS_SHARED:
- case PTHREAD_PROCESS_PRIVATE:
- attr->process_shared = pshared;
- return 0;
-
- default:
- return EINVAL;
- }
-}
-
-/*PAGE
- *
- * 11.4.2 Initializing and Destroying a Condition Variable,
- * P1003.1c/Draft 10, p. 87
- */
-
-int pthread_cond_init(
- pthread_cond_t *cond,
- const pthread_condattr_t *attr
-)
-{
- POSIX_Condition_variables_Control *the_cond;
- const pthread_condattr_t *the_attr;
-
- if ( attr ) the_attr = attr;
- else the_attr = &_POSIX_Condition_variables_Default_attributes;
-
- /*
- * XXX: Be careful about attributes when global!!!
- */
-
- if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
- return POSIX_MP_NOT_IMPLEMENTED();
-
- if ( !the_attr->is_initialized )
- return EINVAL;
-
- _Thread_Disable_dispatch();
-
- the_cond = _POSIX_Condition_variables_Allocate();
-
- if ( !the_cond ) {
- _Thread_Enable_dispatch();
- return ENOMEM;
- }
-
- if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED &&
- !( _Objects_MP_Allocate_and_open( &_POSIX_Condition_variables_Information,
- 0, the_cond->Object.id, FALSE ) ) ) {
- _POSIX_Condition_variables_Free( the_cond );
- _Thread_Enable_dispatch();
- return EAGAIN;
- }
-
- the_cond->process_shared = the_attr->process_shared;
-
- the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
-
-/* XXX some more initialization might need to go here */
- _Thread_queue_Initialize(
- &the_cond->Wait_queue,
- OBJECTS_POSIX_CONDITION_VARIABLES,
- THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_CONDITION_VARIABLE,
- _POSIX_Condition_variables_MP_Send_extract_proxy,
- ETIMEDOUT
- );
-
- _Objects_Open(
- &_POSIX_Condition_variables_Information,
- &the_cond->Object,
- 0
- );
-
- *cond = the_cond->Object.id;
-
- if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
- _POSIX_Condition_variables_MP_Send_process_packet(
- POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_CREATE,
- the_cond->Object.id,
- 0, /* Name not used */
- 0 /* Not used */
- );
-
- _Thread_Enable_dispatch();
-
- return 0;
-}
-
-/*PAGE
- *
- * 11.4.2 Initializing and Destroying a Condition Variable,
- * P1003.1c/Draft 10, p. 87
- */
-
-int pthread_cond_destroy(
- pthread_cond_t *cond
-)
-{
- register POSIX_Condition_variables_Control *the_cond;
- Objects_Locations location;
-
- the_cond = _POSIX_Condition_variables_Get( cond, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- return EINVAL;
- case OBJECTS_LOCAL:
-
- if ( _Thread_queue_First( &the_cond->Wait_queue ) ) {
- _Thread_Enable_dispatch();
- return EBUSY;
- }
-
- _Objects_Close(
- &_POSIX_Condition_variables_Information,
- &the_cond->Object
- );
-
- _POSIX_Condition_variables_Free( the_cond );
-
- if ( the_cond->process_shared == PTHREAD_PROCESS_SHARED ) {
-
- _Objects_MP_Close(
- &_POSIX_Condition_variables_Information,
- the_cond->Object.id
- );
-
- _POSIX_Condition_variables_MP_Send_process_packet(
- POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_DELETE,
- the_cond->Object.id,
- 0, /* Not used */
- 0 /* Not used */
- );
- }
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Signal_support
- *
- * A support routine which implements guts of the broadcast and single task
- * wake up version of the "signal" operation.
- */
-
-int _POSIX_Condition_variables_Signal_support(
- pthread_cond_t *cond,
- boolean is_broadcast
-)
-{
- register POSIX_Condition_variables_Control *the_cond;
- Objects_Locations location;
- Thread_Control *the_thread;
-
- the_cond = _POSIX_Condition_variables_Get( cond, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- return EINVAL;
- case OBJECTS_LOCAL:
-
- do {
- the_thread = _Thread_queue_Dequeue( &the_cond->Wait_queue );
- if ( !the_thread )
- the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
- } while ( is_broadcast && the_thread );
-
- _Thread_Enable_dispatch();
-
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101
- */
-
-int pthread_cond_signal(
- pthread_cond_t *cond
-)
-{
- return _POSIX_Condition_variables_Signal_support( cond, FALSE );
-}
-
-/*PAGE
- *
- * 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101
- */
-
-int pthread_cond_broadcast(
- pthread_cond_t *cond
-)
-{
- return _POSIX_Condition_variables_Signal_support( cond, TRUE );
-}
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Wait_support
- *
- * A support routine which implements guts of the blocking, non-blocking, and
- * timed wait version of condition variable wait routines.
- */
-
-int _POSIX_Condition_variables_Wait_support(
- pthread_cond_t *cond,
- pthread_mutex_t *mutex,
- Watchdog_Interval timeout,
- boolean already_timedout
-)
-{
- register POSIX_Condition_variables_Control *the_cond;
- Objects_Locations location;
- int status;
- int mutex_status;
-
- if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
- return EINVAL;
- }
-
- _Thread_Unnest_dispatch();
-
- the_cond = _POSIX_Condition_variables_Get( cond, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- return EINVAL;
- case OBJECTS_LOCAL:
-
- if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) {
- _Thread_Enable_dispatch();
- return EINVAL;
- }
-
- (void) pthread_mutex_unlock( mutex );
-/* XXX ignore this for now since behavior is undefined
- if ( mutex_status ) {
- _Thread_Enable_dispatch();
- return EINVAL;
- }
-*/
-
- if ( !already_timedout ) {
- the_cond->Mutex = *mutex;
-
- _Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
- _Thread_Executing->Wait.return_code = 0;
- _Thread_Executing->Wait.queue = &the_cond->Wait_queue;
- _Thread_Executing->Wait.id = *cond;
-
- _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout );
-
- _Thread_Enable_dispatch();
-
- /*
- * Switch ourself out because we blocked as a result of the
- * _Thread_queue_Enqueue.
- */
-
- status = _Thread_Executing->Wait.return_code;
- if ( status && status != ETIMEDOUT )
- return status;
-
- } else {
- _Thread_Enable_dispatch();
- status = ETIMEDOUT;
- }
-
- /*
- * When we get here the dispatch disable level is 0.
- */
-
- mutex_status = pthread_mutex_lock( mutex );
- if ( mutex_status )
- return EINVAL;
-
- return status;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105
- */
-
-int pthread_cond_wait(
- pthread_cond_t *cond,
- pthread_mutex_t *mutex
-)
-{
- return _POSIX_Condition_variables_Wait_support(
- cond,
- mutex,
- THREAD_QUEUE_WAIT_FOREVER,
- FALSE
- );
-}
-
-/*PAGE
- *
- * 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105
- */
-
-int pthread_cond_timedwait(
- pthread_cond_t *cond,
- pthread_mutex_t *mutex,
- const struct timespec *abstime
-)
-{
- Watchdog_Interval timeout;
- struct timespec current_time;
- struct timespec difference;
- boolean already_timedout = FALSE;
-
- if ( !abstime )
- return EINVAL;
-
- /*
- * The abstime is a walltime. We turn it into an interval.
- */
-
- (void) clock_gettime( CLOCK_REALTIME, &current_time );
-
- /* XXX probably some error checking should go here */
-
- _POSIX_Timespec_subtract( &current_time, abstime, &difference );
-
- if ( ( difference.tv_sec < 0 ) || ( ( difference.tv_sec == 0 ) &&
- ( difference.tv_nsec < 0 ) ) )
- already_timedout = TRUE;
-
- timeout = _POSIX_Timespec_to_interval( &difference );
-
- return _POSIX_Condition_variables_Wait_support(
- cond,
- mutex,
- timeout,
- already_timedout
- );
-}
diff --git a/c/src/exec/posix/src/devctl.c b/c/src/exec/posix/src/devctl.c
deleted file mode 100644
index 699bc2d228..0000000000
--- a/c/src/exec/posix/src/devctl.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * $Id$
- */
-
-#include <devctl.h>
-
-#include <rtems/system.h>
-
-/*PAGE
- *
- * 21.2.1 Control a Device, P1003.4b/D8, p. 65
- */
-
-int devctl(
- int filedes,
- void *dev_data_ptr,
- size_t nbyte,
- int *dev_info_ptr
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
diff --git a/c/src/exec/posix/src/execl.c b/c/src/exec/posix/src/execl.c
deleted file mode 100644
index af26b539d5..0000000000
--- a/c/src/exec/posix/src/execl.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * execl() - POSIX 1003.1b 3.1.2
- *
- * $Id$
- */
-
-#include <errno.h>
-
-int execl(
- const char *path,
- const char *arg,
- ...
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/posix/src/execle.c b/c/src/exec/posix/src/execle.c
deleted file mode 100644
index 94b0ede939..0000000000
--- a/c/src/exec/posix/src/execle.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * execle() - POSIX 1003.1b 3.1.2
- *
- * $Id$
- */
-
-#include <errno.h>
-
-int execle(
- const char *path,
- char const *arg,
- ...
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/posix/src/execlp.c b/c/src/exec/posix/src/execlp.c
deleted file mode 100644
index 83b6ceba33..0000000000
--- a/c/src/exec/posix/src/execlp.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * execlp() - POSIX 1003.1b 3.1.2
- *
- * $Id$
- */
-
-#include <errno.h>
-
-int execlp(
- const char *file,
- const char *arg,
- ...
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/posix/src/execv.c b/c/src/exec/posix/src/execv.c
deleted file mode 100644
index d05f4a2c58..0000000000
--- a/c/src/exec/posix/src/execv.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * execv() - POSIX 1003.1b 3.1.2
- *
- * $Id$
- */
-
-#include <errno.h>
-
-int execv(
- const char *file,
- char *const argv[],
- ...
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/posix/src/execve.c b/c/src/exec/posix/src/execve.c
deleted file mode 100644
index 478af706ea..0000000000
--- a/c/src/exec/posix/src/execve.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * execve() - POSIX 1003.1b 3.1.2
- *
- * $Id$
- */
-
-#include <errno.h>
-
-int execve(
- const char *path,
- char *const argv[],
- char *const envp[],
- ...
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/posix/src/execvp.c b/c/src/exec/posix/src/execvp.c
deleted file mode 100644
index a9d7694fbd..0000000000
--- a/c/src/exec/posix/src/execvp.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * execvp() - POSIX 1003.1b 3.1.2
- *
- * $Id$
- */
-
-#include <errno.h>
-
-int execvp(
- const char *path,
- char const *argv[]
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/posix/src/fork.c b/c/src/exec/posix/src/fork.c
deleted file mode 100644
index 11cac91bdb..0000000000
--- a/c/src/exec/posix/src/fork.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * fork() - POSIX 1003.1b 3.1.1
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <errno.h>
-
-int fork( void )
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/posix/src/getpid.c b/c/src/exec/posix/src/getpid.c
deleted file mode 100644
index b42981398a..0000000000
--- a/c/src/exec/posix/src/getpid.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * $Id$
- */
-
-#include <limits.h>
-#include <errno.h>
-#include <string.h>
-#include <sys/types.h>
-
-#include <rtems/system.h>
-#include <rtems/score/object.h>
-#include <rtems/posix/seterr.h>
-
-/*PAGE
- *
- * 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83
- */
-
-pid_t getpid( void )
-{
- return _Objects_Local_node;
-}
diff --git a/c/src/exec/posix/src/intr.c b/c/src/exec/posix/src/intr.c
deleted file mode 100644
index 5d41a5fe52..0000000000
--- a/c/src/exec/posix/src/intr.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * NOTE: Each task has an interrupt semaphore associated with it.
- * No matter which interrupt occurs that it has registered,
- * the same semaphore is used.
- *
- * This whole interrupt scheme may have been eliminated in a later draft.
- *
- * $Id$
- */
-
-#include <errno.h>
-#include <intr.h>
-#include <pthread.h>
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/coresem.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/posix/intr.h>
-#include <rtems/posix/time.h>
-#include <rtems/posix/threadsup.h>
-
-/*
- * _POSIX_Interrupt_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Interrupt_Manager_initialization(
- unsigned32 maximum_interrupt_handlers
-)
-{
- unsigned32 index;
- POSIX_Interrupt_Control *the_vector;
-
- _Objects_Initialize_information(
- &_POSIX_Interrupt_Handlers_Information,
- OBJECTS_POSIX_INTERRUPTS,
- FALSE,
- maximum_interrupt_handlers,
- sizeof( POSIX_Interrupt_Handler_control ),
- FALSE,
- 0,
- FALSE
- );
-
- for ( index=0 ; index < CPU_INTERRUPT_NUMBER_OF_VECTORS ; index++ ) {
- the_vector = &_POSIX_Interrupt_Information[ index ];
-
- the_vector->number_installed = 0;
- the_vector->lock_count = 0;
- the_vector->deferred_count = 0;
- _Chain_Initialize_empty( &the_vector->Handlers );
- }
-}
-
-/*PAGE
- *
- * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
- */
-
-int intr_capture(
- intr_t intr,
- int (*intr_handler)( void *area ),
- volatile void *area,
- size_t areasize
-)
-{
- POSIX_Interrupt_Handler_control *the_intr;
- POSIX_Interrupt_Control *the_vector;
- POSIX_API_Thread_Support_Control *thread_support;
- proc_ptr old_handler;
-
- if ( !_ISR_Is_vector_number_valid( intr ) ||
- !_ISR_Is_valid_user_handler( intr_handler ) )
- return EINVAL;
-
- _Thread_Disable_dispatch();
-
- the_intr = _POSIX_Interrupt_Allocate();
-
- if ( !the_intr ) {
- _Thread_Enable_dispatch();
- return ENOMEM;
- }
-
- the_vector = &_POSIX_Interrupt_Information[ intr ];
-
- the_intr->vector = intr;
- the_intr->handler = intr_handler;
- the_intr->user_data_area = area;
- the_intr->server = _Thread_Executing;
- the_intr->is_active = TRUE;
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
- thread_support->interrupts_installed++;
-
-/* XXX should we malloc the semaphore on the fly??? if so we probably need to
- release it when the thread has released all interrupts and keep
- a count of how many it has installed. CURRENTLY NO.. ALLOCATED w/TCB
-*/
-
- /*
- * This is sufficient to have the handlers invoked in the opposite
- * order of installation. The loop invoking them can then go from
- * the front of the list to the end.
- */
-
- _Chain_Prepend( &the_vector->Handlers, &the_intr->Object.Node );
-
- if ( !the_vector->number_installed++ )
- _ISR_Install_vector(
- intr,
- (proc_ptr) _POSIX_Interrupt_Handler,
- &old_handler
- );
-
- _Objects_Open( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object, 0 );
-
- /*
- * Normally, an Id would be returned here.
- */
-
- _Thread_Enable_dispatch();
-
- return 0;
-}
-
-/*PAGE
- *
- * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
- */
-
-int intr_release(
- intr_t intr,
- int (*intr_handler)( void *area )
-)
-{
- boolean found;
- POSIX_Interrupt_Handler_control *the_intr;
- POSIX_Interrupt_Control *the_vector;
- POSIX_API_Thread_Support_Control *thread_support;
- Chain_Node *the_node;
-
- if ( !_ISR_Is_valid_user_handler( intr_handler ) )
- return EINVAL;
-
- _Thread_Disable_dispatch();
-
- /*
- * Since interrupt handlers do not have a user visible id, there is
- * no choice but to search the entire set of active interrupt handlers
- * to find this one.
- */
-
- found = FALSE;
-
- the_vector = &_POSIX_Interrupt_Information[ intr ];
-
- the_node = _Chain_Head( &the_vector->Handlers );
-
- for ( ; !_Chain_Is_tail( &the_vector->Handlers, the_node ) ; ) {
- the_intr = (POSIX_Interrupt_Handler_control *) the_node;
-
- if ( the_intr->handler == intr_handler ) {
- found = TRUE;
- break;
- }
- the_node = the_node->next;
- }
-
- if ( !found ) {
- _Thread_Enable_dispatch();
- return EINVAL;
- }
-
- if ( !_Thread_Is_executing( the_intr->server ) ) {
- _Thread_Enable_dispatch();
- return EINVAL; /* XXX should be ENOISR; */
- }
-
- /*
- * OK now we have found the interrupt handler and can do some work.
- */
-
- _Chain_Extract( &the_intr->Object.Node );
-
- the_intr->is_active = FALSE;
-
- the_vector->number_installed -= 1;
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
- thread_support->interrupts_installed--;
-
- /*
- * It is unnecessary to flush the semaphore since the handler can only
- * be "removed" by the thread which installed it. Thus it cannot be
- * blocked on the semaphore or it would not be executing this routine.
- */
-
- _Objects_Close( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object );
-
- _POSIX_Interrupt_Free( the_intr );
-
- _Thread_Enable_dispatch();
-
- return 0;
-}
-
-/*PAGE
- *
- * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
- */
-
-int intr_lock(
- intr_t intr
-)
-{
- POSIX_Interrupt_Control *the_vector;
-
- _Thread_Disable_dispatch();
-
- the_vector = &_POSIX_Interrupt_Information[ intr ];
-
- the_vector->lock_count++;
-
- _Thread_Enable_dispatch();
-
- return 0;
-}
-
-/*PAGE
- *
- * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
- */
-
-int intr_unlock(
- intr_t intr
-)
-{
- POSIX_Interrupt_Control *the_vector;
-
- _Thread_Disable_dispatch();
-
- the_vector = &_POSIX_Interrupt_Information[ intr ];
-
- if ( !--the_vector->lock_count ) {
- while ( --the_vector->deferred_count ) {
- _POSIX_Interrupt_Handler( intr );
- }
- }
-
- _Thread_Enable_dispatch();
-
- return 0;
-}
-
-/*
- * 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76
- */
-
-int intr_timed_wait(
- int flags,
- const struct timespec *timeout
-)
-{
- Watchdog_Interval ticks;
- POSIX_API_Thread_Support_Control *thread_support;
-
- ticks = _POSIX_Timespec_to_interval( timeout );
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- _Thread_Disable_dispatch();
-
- _CORE_semaphore_Seize(
- &thread_support->Interrupt_Semaphore,
- 0, /* XXX does id=0 hurt in this case? */
- TRUE,
- ticks
- );
- _Thread_Enable_dispatch();
-
- return _Thread_Executing->Wait.return_code; /* XXX should be POSIX */
-}
-
-/*PAGE
- *
- * _POSIX_Interrupt_Handler
- *
- */
-
-void _POSIX_Interrupt_Handler(
- ISR_Vector_number vector
-)
-{
- POSIX_Interrupt_Handler_control *the_intr;
- POSIX_Interrupt_Control *the_vector;
- POSIX_API_Thread_Support_Control *thread_support;
- Chain_Node *the_node;
- int status;
-
- the_vector = &_POSIX_Interrupt_Information[ vector ];
-
- the_node = _Chain_Head( &the_vector->Handlers );
-
- for ( ; !_Chain_Is_tail( &the_vector->Handlers, the_node ) ; ) {
- the_intr = (POSIX_Interrupt_Handler_control *) the_node;
-
- status = (*the_intr->handler)( (void *) the_intr->user_data_area );
-
- switch ( status ) {
- case INTR_HANDLED_NOTIFY:
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- _CORE_semaphore_Surrender(
- &thread_support->Interrupt_Semaphore,
- 0, /* XXX is id=0 a problem */
- 0 /* XXX is this a problem (mp support)*/
- );
- return;
-
- case INTR_HANDLED_DO_NOT_NOTIFY:
- return;
-
- case INTR_NOT_HANDLED:
- default: /* this should not happen */
- break;
- }
- the_node = the_node->next;
- }
-
- /* XXX
- *
- * This is an unhandled interrupt!!!
- */
-}
diff --git a/c/src/exec/posix/src/key.c b/c/src/exec/posix/src/key.c
deleted file mode 100644
index 1203343f66..0000000000
--- a/c/src/exec/posix/src/key.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * $Id$
- */
-
-#include <errno.h>
-#include <limits.h>
-#include <pthread.h>
-#include <string.h>
-
-#include <rtems/system.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/posix/key.h>
-
-/*
- * _POSIX_Key_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Key_Manager_initialization(
- unsigned32 maximum_keys
-)
-{
- _Objects_Initialize_information(
- &_POSIX_Keys_Information,
- OBJECTS_POSIX_KEYS,
- FALSE,
- maximum_keys,
- sizeof( POSIX_Keys_Control ),
- FALSE,
- 0,
- FALSE
- );
-}
-
-/*PAGE
- *
- * 17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163
- */
-
-int pthread_key_create(
- pthread_key_t *key,
- void (*destructor)( void * )
-)
-{
- POSIX_Keys_Control *the_key;
- void *table;
- unsigned32 the_class;
- unsigned32 bytes_to_allocate;
-
-
- _Thread_Disable_dispatch();
-
- the_key = _POSIX_Keys_Allocate();
-
- if ( !the_key ) {
- _Thread_Enable_dispatch();
- return EAGAIN;
- }
-
- the_key->destructor = destructor;
-
- for ( the_class = OBJECTS_CLASSES_FIRST_THREAD_CLASS;
- the_class <= OBJECTS_CLASSES_LAST_THREAD_CLASS;
- the_class++ ) {
-
- bytes_to_allocate =
- (_Objects_Information_table[ the_class ]->maximum + 1) * sizeof( void * );
-
- table = _Workspace_Allocate( bytes_to_allocate );
-
- if ( !table ) {
- for ( --the_class;
- the_class >= OBJECTS_CLASSES_FIRST_THREAD_CLASS;
- the_class-- )
- _Workspace_Free( the_key->Values[ the_class ] );
-
- _POSIX_Keys_Free( the_key );
- _Thread_Enable_dispatch();
- return ENOMEM;
- }
-
- the_key->Values[ the_class ] = table;
- memset( table, '\0', bytes_to_allocate );
- }
-
- the_key->is_active = TRUE;
-
- _Objects_Open( &_POSIX_Keys_Information, &the_key->Object, 0 );
-
- *key = the_key->Object.id;
-
- _Thread_Enable_dispatch();
-
- return 0;
-}
-
-/*PAGE
- *
- * 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165
- */
-
-int pthread_setspecific(
- pthread_key_t key,
- const void *value
-)
-{
- register POSIX_Keys_Control *the_key;
- unsigned32 index;
- unsigned32 class;
- Objects_Locations location;
-
- the_key = _POSIX_Keys_Get( key, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* should never happen */
- return EINVAL;
- case OBJECTS_LOCAL:
- index = _Objects_Get_index( _Thread_Executing->Object.id );
- class = _Objects_Get_class( _Thread_Executing->Object.id );
- the_key->Values[ class ][ index ] = (void *) value;
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165
- */
-
-void *pthread_getspecific(
- pthread_key_t key
-)
-{
- register POSIX_Keys_Control *the_key;
- unsigned32 index;
- unsigned32 class;
- Objects_Locations location;
- void *key_data;
-
- the_key = _POSIX_Keys_Get( key, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* should never happen */
- return NULL;
- case OBJECTS_LOCAL:
- index = _Objects_Get_index( _Thread_Executing->Object.id );
- class = _Objects_Get_class( _Thread_Executing->Object.id );
- key_data = (void *) the_key->Values[ class ][ index ];
- _Thread_Enable_dispatch();
- return key_data;
- }
- return (void *) POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 17.1.3 Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167
- */
-
-int pthread_key_delete(
- pthread_key_t key
-)
-{
- register POSIX_Keys_Control *the_key;
- Objects_Locations location;
- unsigned32 the_class;
-
- the_key = _POSIX_Keys_Get( key, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* should never happen */
- return EINVAL;
- case OBJECTS_LOCAL:
- _Objects_Close( &_POSIX_Keys_Information, &the_key->Object );
-
- the_key->is_active = FALSE;
-
- for ( the_class = OBJECTS_CLASSES_FIRST_THREAD_CLASS;
- the_class <= OBJECTS_CLASSES_LAST_THREAD_CLASS;
- the_class++ )
- _Workspace_Free( the_key->Values[ the_class ] );
-
- /*
- * NOTE: The destructor is not called and it is the responsibility
- * of the application to free the memory.
- */
-
- _POSIX_Keys_Free( the_key );
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * _POSIX_Keys_Run_destructors
- *
- * 17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163
- *
- * NOTE: This is the routine executed when a thread exits to
- * run through all the keys and do the destructor action.
- */
-
-void _POSIX_Keys_Run_destructors(
- Thread_Control *thread
-)
-{
- unsigned32 index;
- unsigned32 pthread_index;
- unsigned32 pthread_class;
- unsigned32 iterations;
- boolean are_all_null;
- POSIX_Keys_Control *the_key;
- void *value;
-
- pthread_index = _Objects_Get_index( thread->Object.id );
- pthread_class = _Objects_Get_class( thread->Object.id );
-
- iterations = 0;
-
- for ( ; ; ) {
-
- are_all_null = TRUE;
-
- for ( index=1 ; index <= _POSIX_Keys_Information.maximum ; index++ ) {
-
- the_key = (POSIX_Keys_Control *)
- _POSIX_Keys_Information.local_table[ index ];
-
- if ( the_key && the_key->is_active && the_key->destructor ) {
- value = the_key->Values[ pthread_class ][ pthread_index ];
- if ( value ) {
- (*the_key->destructor)( value );
- if ( the_key->Values[ pthread_class ][ pthread_index ] )
- are_all_null = FALSE;
- }
- }
- }
-
- if ( are_all_null == TRUE )
- return;
-
- iterations++;
-
- /*
- * The standard allows one to not do this and thus go into an infinite
- * loop. It seems rude to unnecessarily lock up a system.
- *
- * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99.
- */
-
- if ( iterations >= PTHREAD_DESTRUCTOR_ITERATIONS )
- return;
- }
-}
diff --git a/c/src/exec/posix/src/mqueue.c b/c/src/exec/posix/src/mqueue.c
deleted file mode 100644
index 82da4ee706..0000000000
--- a/c/src/exec/posix/src/mqueue.c
+++ /dev/null
@@ -1,710 +0,0 @@
-/*
- * NOTE: The structure of the routines is identical to that of POSIX
- * Message_queues to leave the option of having unnamed message
- * queues at a future date. They are currently not part of the
- * POSIX standard but unnamed message_queues are. This is also
- * the reason for the apparently unnecessary tracking of
- * the process_shared attribute. [In addition to the fact that
- * it would be trivial to add pshared to the mq_attr structure
- * and have process private message queues.]
- *
- * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open
- * time.
- *
- * $Id$
- */
-
-#include <stdarg.h>
-
-#include <pthread.h>
-#include <limits.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <mqueue.h>
-
-#include <rtems/system.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/posix/seterr.h>
-#include <rtems/posix/mqueue.h>
-#include <rtems/posix/time.h>
-
-/*PAGE
- *
- * _POSIX_Message_queue_Manager_initialization
- *
- * This routine initializes all message_queue manager related data structures.
- *
- * Input parameters:
- * maximum_message_queues - maximum configured message_queues
- *
- * Output parameters: NONE
- */
-
-void _POSIX_Message_queue_Manager_initialization(
- unsigned32 maximum_message_queues
-)
-{
- _Objects_Initialize_information(
- &_POSIX_Message_queue_Information,
- OBJECTS_POSIX_MESSAGE_QUEUES,
- TRUE,
- maximum_message_queues,
- sizeof( POSIX_Message_queue_Control ),
- TRUE,
- _POSIX_PATH_MAX,
- FALSE
- );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Create_support
- */
-
-int _POSIX_Message_queue_Create_support(
- const char *name,
- int pshared,
- unsigned int oflag,
- struct mq_attr *attr,
- POSIX_Message_queue_Control **message_queue
-)
-{
- POSIX_Message_queue_Control *the_mq;
-
- _Thread_Disable_dispatch();
-
- the_mq = _POSIX_Message_queue_Allocate();
-
- if ( !the_mq ) {
- _Thread_Enable_dispatch();
- set_errno_and_return_minus_one( ENFILE );
- }
-
- if ( pshared == PTHREAD_PROCESS_SHARED &&
- !( _Objects_MP_Allocate_and_open( &_POSIX_Message_queue_Information, 0,
- the_mq->Object.id, FALSE ) ) ) {
- _POSIX_Message_queue_Free( the_mq );
- _Thread_Enable_dispatch();
- set_errno_and_return_minus_one( ENFILE );
- }
-
- the_mq->process_shared = pshared;
-
- if ( name ) {
- the_mq->named = TRUE;
- the_mq->open_count = 1;
- the_mq->linked = TRUE;
- }
- else
- the_mq->named = FALSE;
-
- if ( oflag & O_NONBLOCK )
- the_mq->blocking = FALSE;
- else
- the_mq->blocking = TRUE;
-
- /* XXX
- *
- * Note that this should be based on the current scheduling policy.
- */
-
- /* XXX
- *
- * Message and waiting disciplines are not distinguished.
- */
-/*
- the_mq_attr->message_discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO;
- the_mq_attr->waiting_discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO;
- */
-
- the_mq->Message_queue.Attributes.discipline =
- CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO;
-
- if ( ! _CORE_message_queue_Initialize(
- &the_mq->Message_queue,
- OBJECTS_POSIX_MESSAGE_QUEUES,
- &the_mq->Message_queue.Attributes,
- attr->mq_maxmsg,
- attr->mq_msgsize,
- _POSIX_Message_queue_MP_Send_extract_proxy ) ) {
-
- if ( pshared == PTHREAD_PROCESS_SHARED )
- _Objects_MP_Close( &_POSIX_Message_queue_Information, the_mq->Object.id );
-
- _POSIX_Message_queue_Free( the_mq );
- _Thread_Enable_dispatch();
- set_errno_and_return_minus_one( ENOSPC );
- }
-
-
- /* XXX - need Names to be a string!!! */
- _Objects_Open(
- &_POSIX_Message_queue_Information,
- &the_mq->Object,
- (char *) name
- );
-
- *message_queue = the_mq;
-
- if ( pshared == PTHREAD_PROCESS_SHARED )
- _POSIX_Message_queue_MP_Send_process_packet(
- POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_CREATE,
- the_mq->Object.id,
- (char *) name,
- 0 /* Not used */
- );
-
- _Thread_Enable_dispatch();
- return 0;
-}
-
-/*PAGE
- *
- * 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
- */
-
-mqd_t mq_open(
- const char *name,
- int oflag,
- ...
- /* mode_t mode, */
- /* struct mq_attr attr */
-)
-{
- va_list arg;
- mode_t mode;
- struct mq_attr *attr;
- int status;
- Objects_Id the_mq_id;
- POSIX_Message_queue_Control *the_mq;
-
- if ( oflag & O_CREAT ) {
- va_start(arg, oflag);
- mode = (mode_t) va_arg( arg, mode_t * );
- attr = (struct mq_attr *) va_arg( arg, struct mq_attr ** );
- va_end(arg);
- }
-
- status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id );
-
- /*
- * If the name to id translation worked, then the message queue exists
- * and we can just return a pointer to the id. Otherwise we may
- * need to check to see if this is a "message queue does not exist"
- * or some other miscellaneous error on the name.
- */
-
- if ( status ) {
-
- if ( status == EINVAL ) { /* name -> ID translation failed */
- if ( !(oflag & O_CREAT) ) { /* willing to create it? */
- seterrno( ENOENT );
- return (mqd_t) -1;
- }
- /* we are willing to create it */
- }
- seterrno( status ); /* some type of error */
- return (mqd_t) -1;
-
- } else { /* name -> ID translation succeeded */
-
- if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
- seterrno( EEXIST );
- return (mqd_t) -1;
- }
-
- /*
- * XXX In this case we need to do an ID->pointer conversion to
- * check the mode. This is probably a good place for a subroutine.
- */
-
- the_mq->open_count += 1;
-
- return (mqd_t)&the_mq->Object.id;
-
- }
-
- /* XXX verify this comment...
- *
- * At this point, the message queue does not exist and everything has been
- * checked. We should go ahead and create a message queue.
- */
-
- status = _POSIX_Message_queue_Create_support(
- name,
- TRUE, /* shared across processes */
- oflag,
- attr,
- &the_mq
- );
-
- if ( status == -1 )
- return (mqd_t) -1;
-
- return (mqd_t) &the_mq->Object.id;
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Delete
- */
-
-void _POSIX_Message_queue_Delete(
- POSIX_Message_queue_Control *the_mq
-)
-{
- if ( !the_mq->linked && !the_mq->open_count ) {
- _POSIX_Message_queue_Free( the_mq );
-
- if ( the_mq->process_shared == PTHREAD_PROCESS_SHARED ) {
-
- _Objects_MP_Close(
- &_POSIX_Message_queue_Information,
- the_mq->Object.id
- );
-
- _POSIX_Message_queue_MP_Send_process_packet(
- POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_DELETE,
- the_mq->Object.id,
- 0, /* Not used */
- 0 /* Not used */
- );
- }
-
- }
-}
-
-/*PAGE
- *
- * 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275
- */
-
-int mq_close(
- mqd_t mqdes
-)
-{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
-
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- the_mq->open_count -= 1;
- _POSIX_Message_queue_Delete( the_mq );
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276
- */
-
-int mq_unlink(
- const char *name
-)
-{
- int status;
- register POSIX_Message_queue_Control *the_mq;
- Objects_Id the_mq_id;
- Objects_Locations location;
-
- status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id );
-
- if ( !status )
- set_errno_and_return_minus_one( status );
-
- the_mq = _POSIX_Message_queue_Get( the_mq_id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
-
- _Objects_MP_Close(
- &_POSIX_Message_queue_Information,
- the_mq->Object.id
- );
-
- the_mq->linked = FALSE;
-
- _POSIX_Message_queue_Delete( the_mq );
-
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Send_support
- */
-
-int _POSIX_Message_queue_Send_support(
- mqd_t mqdes,
- const char *msg_ptr,
- unsigned32 msg_len,
- Priority_Control msg_prio,
- Watchdog_Interval timeout
-)
-{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
-
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- /* XXX must add support for timeout and priority */
- _CORE_message_queue_Send(
- &the_mq->Message_queue,
- (void *) msg_ptr,
- msg_len,
- mqdes,
- NULL /* XXX _POSIX_Message_queue_Core_message_queue_mp_support*/
- );
- _Thread_Enable_dispatch();
- return _Thread_Executing->Wait.return_code;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
- *
- * NOTE: P1003.4b/D8, p. 45 adds mq_timedsend().
- */
-
-int mq_send(
- mqd_t mqdes,
- const char *msg_ptr,
- size_t msg_len,
- unsigned int msg_prio
-)
-{
- return _POSIX_Message_queue_Send_support(
- mqdes,
- msg_ptr,
- msg_len,
- msg_prio,
- THREAD_QUEUE_WAIT_FOREVER
- );
-}
-
-/*PAGE
- *
- * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
- *
- * NOTE: P1003.4b/D8, p. 45 adds mq_timedsend().
- */
-
-int mq_timedsend(
- mqd_t mqdes,
- const char *msg_ptr,
- size_t msg_len,
- unsigned int msg_prio,
- const struct timespec *timeout
-)
-{
- return _POSIX_Message_queue_Send_support(
- mqdes,
- msg_ptr,
- msg_len,
- msg_prio,
- _POSIX_Timespec_to_interval( timeout )
- );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Receive_support
- */
-
-/* XXX be careful ... watch the size going through all the layers ... */
-
-ssize_t _POSIX_Message_queue_Receive_support(
- mqd_t mqdes,
- char *msg_ptr,
- size_t msg_len,
- unsigned int *msg_prio,
- Watchdog_Interval timeout
-)
-{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
- unsigned32 status = 0;
- unsigned32 length_out;
-
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- /* XXX need to define the options argument to this */
- length_out = msg_len;
- _CORE_message_queue_Seize(
- &the_mq->Message_queue,
- mqdes,
- msg_ptr,
- &length_out,
- /* msg_prio, XXXX */
- the_mq->blocking,
- timeout
- );
- _Thread_Enable_dispatch();
- if ( !status )
- return length_out;
- /* XXX --- the return codes gotta be looked at .. fix this */
- return _Thread_Executing->Wait.return_code;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
- *
- * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
- */
-
-ssize_t mq_receive(
- mqd_t mqdes,
- char *msg_ptr,
- size_t msg_len,
- unsigned int *msg_prio
-)
-{
- return _POSIX_Message_queue_Receive_support(
- mqdes,
- msg_ptr,
- msg_len,
- msg_prio,
- THREAD_QUEUE_WAIT_FOREVER
- );
-}
-
-/*PAGE
- *
- * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
- *
- * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
- */
-
-int mq_timedreceive( /* XXX: should this be ssize_t */
- mqd_t mqdes,
- char *msg_ptr,
- size_t msg_len,
- unsigned int *msg_prio,
- const struct timespec *timeout
-)
-{
- return _POSIX_Message_queue_Receive_support(
- mqdes,
- msg_ptr,
- msg_len,
- msg_prio,
- _POSIX_Timespec_to_interval( timeout )
- );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Notify_handler
- *
- */
-
-void _POSIX_Message_queue_Notify_handler(
- void *user_data
-)
-{
- POSIX_Message_queue_Control *the_mq;
-
- the_mq = user_data;
-
- /* XXX do something with signals here!!!! */
-}
-
-/*PAGE
- *
- * 15.2.6 Notify Process that a Message is Available on a Queue,
- * P1003.1b-1993, p. 280
- */
-
-int mq_notify(
- mqd_t mqdes,
- const struct sigevent *notification
-)
-{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
-
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EBADF );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- if ( notification ) {
- if ( _CORE_message_queue_Is_notify_enabled( &the_mq->Message_queue ) ) {
- _Thread_Enable_dispatch();
- seterrno( EBUSY );
- return( -1 );
- }
-
- _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL );
-
- the_mq->notification = *notification;
-
- _CORE_message_queue_Set_notify(
- &the_mq->Message_queue,
- _POSIX_Message_queue_Notify_handler,
- the_mq
- );
- } else {
-
- _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL );
-
- }
-
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281
- */
-
-int mq_setattr(
- mqd_t mqdes,
- const struct mq_attr *mqstat,
- struct mq_attr *omqstat
-)
-{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
- CORE_message_queue_Attributes *the_mq_attr;
-
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- /*
- * Return the old values.
- */
-
- /* XXX this is the same stuff as is in mq_getattr... and probably */
- /* XXX should be in an inlined private routine */
-
- the_mq_attr = &the_mq->Message_queue.Attributes;
-
- omqstat->mq_flags = the_mq->flags;
- omqstat->mq_msgsize = the_mq->Message_queue.maximum_message_size;
- omqstat->mq_maxmsg = the_mq->Message_queue.maximum_pending_messages;
- omqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages;
-
- /*
- * Ignore everything except the O_NONBLOCK bit.
- */
-
- if ( mqstat->mq_flags & O_NONBLOCK )
- the_mq->blocking = FALSE;
- else
- the_mq->blocking = TRUE;
-
- the_mq->flags = mqstat->mq_flags;
-
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
- */
-
-int mq_getattr(
- mqd_t mqdes,
- struct mq_attr *mqstat
-)
-{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
- CORE_message_queue_Attributes *the_mq_attr;
-
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- /*
- * Return the old values.
- */
-
- /* XXX this is the same stuff as is in mq_setattr... and probably */
- /* XXX should be in an inlined private routine */
-
- the_mq_attr = &the_mq->Message_queue.Attributes;
-
- mqstat->mq_flags = the_mq->flags;
- mqstat->mq_msgsize = the_mq->Message_queue.maximum_message_size;
- mqstat->mq_maxmsg = the_mq->Message_queue.maximum_pending_messages;
- mqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages;
-
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
diff --git a/c/src/exec/posix/src/mutex.c b/c/src/exec/posix/src/mutex.c
deleted file mode 100644
index fa2ccc9cc5..0000000000
--- a/c/src/exec/posix/src/mutex.c
+++ /dev/null
@@ -1,688 +0,0 @@
-/*
- * $Id$
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <pthread.h>
-
-#include <rtems/system.h>
-#include <rtems/score/coremutex.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/score/mpci.h>
-#include <rtems/posix/mutex.h>
-#include <rtems/posix/priority.h>
-#include <rtems/posix/time.h>
-
-/*
- * TEMPORARY
- */
-
-void _POSIX_Mutex_MP_Send_process_packet (
- POSIX_Mutex_MP_Remote_operations operation,
- Objects_Id mutex_id,
- Objects_Name name,
- Objects_Id proxy_id
-)
-{
- (void) POSIX_MP_NOT_IMPLEMENTED();
-}
-
-void _POSIX_Mutex_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-)
-{
- (void) POSIX_MP_NOT_IMPLEMENTED();
-}
-
-int _POSIX_Mutex_MP_Send_request_packet (
- POSIX_Mutex_MP_Remote_operations operation,
- Objects_Id mutex_id,
- boolean wait, /* XXX options */
- Watchdog_Interval timeout
-)
-{
- return POSIX_MP_NOT_IMPLEMENTED();
-}
-
-void POSIX_Threads_mutex_MP_support(
- Thread_Control *the_thread,
- Objects_Id id
-)
-{
- (void) POSIX_MP_NOT_IMPLEMENTED(); /* XXX: should never get here */
-}
-
-/*
- * END OF TEMPORARY
- */
-
-/*PAGE
- *
- * The default mutex attributes structure.
- */
-
-const pthread_mutexattr_t _POSIX_Mutex_Default_attributes = {
- TRUE, /* is_initialized */
- PTHREAD_PROCESS_PRIVATE, /* process_shared */
- POSIX_SCHEDULER_MAXIMUM_PRIORITY, /* prio_ceiling */
- PTHREAD_PRIO_NONE, /* protocol */
- FALSE /* recursive */
-};
-
-/*PAGE
- *
- * _POSIX_Mutex_From_core_mutex_status
- */
-
-int _POSIX_Mutex_From_core_mutex_status(
- CORE_mutex_Status status
-)
-{
- switch ( status ) {
- case CORE_MUTEX_STATUS_SUCCESSFUL:
- return 0;
- case CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT:
- return EBUSY;
- case CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED:
- return EDEADLK;
- case CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE:
- return EPERM;
- case CORE_MUTEX_WAS_DELETED:
- return EINVAL;
- case CORE_MUTEX_TIMEOUT:
- return EAGAIN;
- case CORE_MUTEX_STATUS_CEILING_VIOLATED:
- return EINVAL;
- default:
- break;
- }
- assert( 0 );
- return 0;
-}
-
-/*PAGE
- *
- * _POSIX_Mutex_Manager_initialization
- *
- * This routine initializes all mutex manager related data structures.
- *
- * Input parameters:
- * maximum_mutexes - maximum configured mutexes
- *
- * Output parameters: NONE
- */
-
-void _POSIX_Mutex_Manager_initialization(
- unsigned32 maximum_mutexes
-)
-{
- _Objects_Initialize_information(
- &_POSIX_Mutex_Information,
- OBJECTS_POSIX_MUTEXES,
- TRUE,
- maximum_mutexes,
- sizeof( POSIX_Mutex_Control ),
- FALSE,
- 0,
- FALSE
- );
-}
-
-/*PAGE
- *
- * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
- */
-
-int pthread_mutexattr_init(
- pthread_mutexattr_t *attr
-)
-{
- if ( !attr )
- return EINVAL;
-
- *attr = _POSIX_Mutex_Default_attributes;
- return 0;
-}
-
-/*PAGE
- *
- * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
- */
-
-int pthread_mutexattr_destroy(
- pthread_mutexattr_t *attr
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- attr->is_initialized = FALSE;
- return 0;
-}
-
-/*PAGE
- *
- * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
- */
-
-int pthread_mutexattr_getpshared(
- const pthread_mutexattr_t *attr,
- int *pshared
-)
-{
- if ( !attr || !attr->is_initialized || !pshared )
- return EINVAL;
-
- *pshared = attr->process_shared;
- return 0;
-}
-
-/*PAGE
- *
- * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
- */
-
-int pthread_mutexattr_setpshared(
- pthread_mutexattr_t *attr,
- int pshared
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- switch ( pshared ) {
- case PTHREAD_PROCESS_SHARED:
- case PTHREAD_PROCESS_PRIVATE:
- attr->process_shared = pshared;
- return 0;
-
- default:
- return EINVAL;
- }
-}
-
-/*PAGE
- *
- * 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87
- *
- * NOTE: XXX Could be optimized so all the attribute error checking
- * is not performed when attr is NULL.
- */
-
-int pthread_mutex_init(
- pthread_mutex_t *mutex,
- const pthread_mutexattr_t *attr
-)
-{
- POSIX_Mutex_Control *the_mutex;
- CORE_mutex_Attributes *the_mutex_attr;
- const pthread_mutexattr_t *the_attr;
- CORE_mutex_Disciplines the_discipline;
- register POSIX_Mutex_Control *mutex_in_use;
- Objects_Locations location;
-
- if ( attr ) the_attr = attr;
- else the_attr = &_POSIX_Mutex_Default_attributes;
-
- /* Check for NULL mutex */
-
- if ( !mutex )
- return EINVAL;
-
- /* avoid infinite recursion on call to this routine in _POSIX_Mutex_Get */
-
- if ( *mutex != PTHREAD_MUTEX_INITIALIZER ) {
-
- /* EBUSY if *mutex is a valid id */
-
- mutex_in_use = _POSIX_Mutex_Get( mutex, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- break;
- case OBJECTS_REMOTE:
- case OBJECTS_LOCAL:
- _Thread_Enable_dispatch();
- return EBUSY;
- }
- }
-
- if ( !the_attr->is_initialized )
- return EINVAL;
-
- /*
- * XXX: Be careful about attributes when global!!!
- */
-
- assert( the_attr->process_shared == PTHREAD_PROCESS_PRIVATE );
-
- if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
- return POSIX_MP_NOT_IMPLEMENTED();
-
- /*
- * Determine the discipline of the mutex
- */
-
- switch ( the_attr->protocol ) {
- case PTHREAD_PRIO_NONE:
- the_discipline = CORE_MUTEX_DISCIPLINES_FIFO;
- break;
- case PTHREAD_PRIO_INHERIT:
- the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT;
- break;
- case PTHREAD_PRIO_PROTECT:
- the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
- break;
- default:
- return EINVAL;
- }
-
- if ( !_POSIX_Priority_Is_valid( the_attr->prio_ceiling ) )
- return EINVAL;
-
- _Thread_Disable_dispatch();
-
- the_mutex = _POSIX_Mutex_Allocate();
-
- if ( !the_mutex ) {
- _Thread_Enable_dispatch();
- return EAGAIN;
- }
-
- if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED &&
- !( _Objects_MP_Allocate_and_open( &_POSIX_Mutex_Information, 0,
- the_mutex->Object.id, FALSE ) ) ) {
- _POSIX_Mutex_Free( the_mutex );
- _Thread_Enable_dispatch();
- return EAGAIN;
- }
-
- the_mutex->process_shared = the_attr->process_shared;
-
- the_mutex_attr = &the_mutex->Mutex.Attributes;
-
- the_mutex_attr->allow_nesting = the_attr->recursive;
- the_mutex_attr->priority_ceiling =
- _POSIX_Priority_To_core( the_attr->prio_ceiling );
- the_mutex_attr->discipline = the_discipline;
-
- /*
- * Must be initialized to unlocked.
- */
-
- _CORE_mutex_Initialize(
- &the_mutex->Mutex,
- OBJECTS_POSIX_MUTEXES,
- the_mutex_attr,
- CORE_MUTEX_UNLOCKED,
- NULL /* proxy_extract_callout */
- );
-
- _Objects_Open( &_POSIX_Mutex_Information, &the_mutex->Object, 0 );
-
- *mutex = the_mutex->Object.id;
-
- if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
- _POSIX_Mutex_MP_Send_process_packet(
- POSIX_MUTEX_MP_ANNOUNCE_CREATE,
- the_mutex->Object.id,
- 0, /* Name not used */
- 0 /* Not used */
- );
-
- _Thread_Enable_dispatch();
- return 0;
-}
-
-/*PAGE
- *
- * 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87
- */
-
-int pthread_mutex_destroy(
- pthread_mutex_t *mutex
-)
-{
- register POSIX_Mutex_Control *the_mutex;
- Objects_Locations location;
-
- the_mutex = _POSIX_Mutex_Get( mutex, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- return EINVAL;
- case OBJECTS_LOCAL:
- /*
- * XXX: There is an error for the mutex being locked
- * or being in use by a condition variable.
- */
-
- if ( _CORE_mutex_Is_locked( &the_mutex->Mutex ) ) {
- _Thread_Enable_dispatch();
- return EBUSY;
- }
-
- _Objects_Close( &_POSIX_Mutex_Information, &the_mutex->Object );
-
- _CORE_mutex_Flush(
- &the_mutex->Mutex,
- _POSIX_Mutex_MP_Send_object_was_deleted,
- EINVAL
- );
-
- _POSIX_Mutex_Free( the_mutex );
-
- if ( the_mutex->process_shared == PTHREAD_PROCESS_SHARED ) {
-
- _Objects_MP_Close( &_POSIX_Mutex_Information, the_mutex->Object.id );
-
- _POSIX_Mutex_MP_Send_process_packet(
- POSIX_MUTEX_MP_ANNOUNCE_DELETE,
- the_mutex->Object.id,
- 0, /* Not used */
- 0 /* Not used */
- );
- }
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * _POSIX_Mutex_Lock_support
- *
- * A support routine which implements guts of the blocking, non-blocking, and
- * timed wait version of mutex lock.
- */
-
-int _POSIX_Mutex_Lock_support(
- pthread_mutex_t *mutex,
- boolean blocking,
- Watchdog_Interval timeout
-)
-{
- register POSIX_Mutex_Control *the_mutex;
- Objects_Locations location;
-
- the_mutex = _POSIX_Mutex_Get( mutex, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- return _POSIX_Mutex_MP_Send_request_packet(
- POSIX_MUTEX_MP_OBTAIN_REQUEST,
- *mutex,
- 0, /* must define the option set */
- WATCHDOG_NO_TIMEOUT
- );
- case OBJECTS_LOCAL:
- _CORE_mutex_Seize(
- &the_mutex->Mutex,
- the_mutex->Object.id,
- blocking,
- timeout
- );
- _Thread_Enable_dispatch();
- return _POSIX_Mutex_From_core_mutex_status(
- (CORE_mutex_Status) _Thread_Executing->Wait.return_code
- );
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93
- *
- * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29
- */
-
-int pthread_mutex_lock(
- pthread_mutex_t *mutex
-)
-{
- return _POSIX_Mutex_Lock_support( mutex, TRUE, THREAD_QUEUE_WAIT_FOREVER );
-}
-
-/*PAGE
- *
- * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93
- *
- * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29
- */
-
-int pthread_mutex_trylock(
- pthread_mutex_t *mutex
-)
-{
- return _POSIX_Mutex_Lock_support( mutex, FALSE, THREAD_QUEUE_WAIT_FOREVER );
-}
-
-/*PAGE
- *
- * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93
- *
- * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29
- */
-
-int pthread_mutex_unlock(
- pthread_mutex_t *mutex
-)
-{
- register POSIX_Mutex_Control *the_mutex;
- Objects_Locations location;
- CORE_mutex_Status status;
-
- the_mutex = _POSIX_Mutex_Get( mutex, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- return _POSIX_Mutex_MP_Send_request_packet(
- POSIX_MUTEX_MP_RELEASE_REQUEST,
- *mutex,
- 0, /* Not used */
- MPCI_DEFAULT_TIMEOUT
- );
- case OBJECTS_LOCAL:
- status = _CORE_mutex_Surrender(
- &the_mutex->Mutex,
- the_mutex->Object.id,
- POSIX_Threads_mutex_MP_support
- );
- _Thread_Enable_dispatch();
- return _POSIX_Mutex_From_core_mutex_status( status );
- break;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93
- *
- * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29
- */
-
-int pthread_mutex_timedlock(
- pthread_mutex_t *mutex,
- const struct timespec *timeout
-)
-{
- return _POSIX_Mutex_Lock_support(
- mutex,
- TRUE,
- _POSIX_Timespec_to_interval( timeout )
- );
-}
-
-/*PAGE
- *
- * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
- */
-
-int pthread_mutexattr_setprotocol(
- pthread_mutexattr_t *attr,
- int protocol
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- switch ( protocol ) {
- case PTHREAD_PRIO_NONE:
- case PTHREAD_PRIO_INHERIT:
- case PTHREAD_PRIO_PROTECT:
- attr->protocol = protocol;
- return 0;
-
- default:
- return EINVAL;
- }
-}
-
-/*PAGE
- *
- * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
- */
-
-int pthread_mutexattr_getprotocol(
- const pthread_mutexattr_t *attr,
- int *protocol
-)
-{
- if ( !attr || !attr->is_initialized || !protocol )
- return EINVAL;
-
- *protocol = attr->protocol;
- return 0;
-}
-
-/*PAGE
- *
- * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
- */
-
-int pthread_mutexattr_setprioceiling(
- pthread_mutexattr_t *attr,
- int prioceiling
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- if ( !_POSIX_Priority_Is_valid( prioceiling ) )
- return EINVAL;
-
- attr->prio_ceiling = prioceiling;
- return 0;
-}
-
-/*PAGE
- *
- * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
- */
-
-int pthread_mutexattr_getprioceiling(
- const pthread_mutexattr_t *attr,
- int *prioceiling
-)
-{
- if ( !attr || !attr->is_initialized || !prioceiling )
- return EINVAL;
-
- *prioceiling = attr->prio_ceiling;
- return 0;
-}
-
-/*PAGE
- *
- * 13.6.2 Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131
- */
-
-int pthread_mutex_setprioceiling(
- pthread_mutex_t *mutex,
- int prioceiling,
- int *old_ceiling
-)
-{
- register POSIX_Mutex_Control *the_mutex;
- Objects_Locations location;
- Priority_Control the_priority;
- int status;
-
- if ( !old_ceiling )
- return EINVAL;
-
- if ( !_POSIX_Priority_Is_valid( prioceiling ) )
- return EINVAL;
-
- the_priority = _POSIX_Priority_To_core( prioceiling );
-
- /*
- * Must acquire the mutex before we can change it's ceiling
- */
-
- status = pthread_mutex_lock( mutex );
- if ( status )
- return status;
-
- the_mutex = _POSIX_Mutex_Get( mutex, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL; /* impossible to get here */
- case OBJECTS_REMOTE:
- /* XXX It feels questionable to set the ceiling on a remote mutex. */
- return EINVAL;
- case OBJECTS_LOCAL:
- *old_ceiling = _POSIX_Priority_From_core(
- the_mutex->Mutex.Attributes.priority_ceiling
- );
- the_mutex->Mutex.Attributes.priority_ceiling = the_priority;
- _CORE_mutex_Surrender(
- &the_mutex->Mutex,
- the_mutex->Object.id,
- POSIX_Threads_mutex_MP_support
- );
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 13.6.2 Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131
- */
-
-int pthread_mutex_getprioceiling(
- pthread_mutex_t *mutex,
- int *prioceiling
-)
-{
- register POSIX_Mutex_Control *the_mutex;
- Objects_Locations location;
-
- if ( !prioceiling )
- return EINVAL;
-
- the_mutex = _POSIX_Mutex_Get( mutex, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- return POSIX_MP_NOT_IMPLEMENTED(); /* XXX feels questionable */
- case OBJECTS_LOCAL:
- *prioceiling = _POSIX_Priority_From_core(
- the_mutex->Mutex.Attributes.priority_ceiling
- );
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
diff --git a/c/src/exec/posix/src/psignal.c b/c/src/exec/posix/src/psignal.c
deleted file mode 100644
index 4037209009..0000000000
--- a/c/src/exec/posix/src/psignal.c
+++ /dev/null
@@ -1,1343 +0,0 @@
-/*
- * $Id$
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <pthread.h>
-#include <signal.h>
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tqdata.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/posix/seterr.h>
-#include <rtems/posix/threadsup.h>
-#include <rtems/posix/psignal.h>
-#include <rtems/posix/pthread.h>
-#include <rtems/posix/time.h>
-
-/*
- * Currently 32 signals numbered 1-32 are defined
- */
-
-#define SIGNAL_EMPTY_MASK 0x00000000
-#define SIGNAL_ALL_MASK 0xffffffff
-
-#define signo_to_mask( _sig ) (1 << ((_sig) - 1))
-
-#define is_valid_signo( _sig ) \
- ((_sig) >= 1 && (_sig) <= 32 )
-
-/*** PROCESS WIDE STUFF ****/
-
-sigset_t _POSIX_signals_Pending;
-
-void _POSIX_signals_Abormal_termination_handler( int signo )
-{
- exit( 1 );
-}
-
-#define _POSIX_signals_Stop_handler NULL
-#define _POSIX_signals_Continue_handler NULL
-
-#define SIGACTION_TERMINATE \
- { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Abormal_termination_handler} }
-#define SIGACTION_IGNORE \
- { 0, SIGNAL_ALL_MASK, {SIG_IGN} }
-#define SIGACTION_STOP \
- { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Stop_handler} }
-#define SIGACTION_CONTINUE \
- { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Continue_handler} }
-
-#define SIG_ARRAY_MAX (SIGRTMAX + 1)
-struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ] = {
- /* NO SIGNAL 0 */ SIGACTION_IGNORE,
- /* SIGHUP 1 */ SIGACTION_TERMINATE,
- /* SIGINT 2 */ SIGACTION_TERMINATE,
- /* SIGQUIT 3 */ SIGACTION_TERMINATE,
- /* SIGILL 4 */ SIGACTION_TERMINATE,
- /* SIGTRAP 5 */ SIGACTION_TERMINATE,
- /* SIGIOT 6 */ SIGACTION_TERMINATE,
- /* SIGABRT 6 SIGACTION_TERMINATE, -- alias for SIGIOT */
- /* SIGEMT 7 */ SIGACTION_TERMINATE,
- /* SIGFPE 8 */ SIGACTION_TERMINATE,
- /* SIGKILL 9 */ SIGACTION_TERMINATE,
- /* SIGBUS 10 */ SIGACTION_TERMINATE,
- /* SIGSEGV 11 */ SIGACTION_TERMINATE,
- /* SIGSYS 12 */ SIGACTION_TERMINATE,
- /* SIGPIPE 13 */ SIGACTION_TERMINATE,
- /* SIGALRM 14 */ SIGACTION_TERMINATE,
- /* SIGTERM 15 */ SIGACTION_TERMINATE,
- /* SIGUSR1 16 */ SIGACTION_TERMINATE,
- /* SIGUSR2 17 */ SIGACTION_TERMINATE,
- /* SIGRTMIN 18 */ SIGACTION_IGNORE,
- /* SIGRT 19 */ SIGACTION_IGNORE,
- /* SIGRT 20 */ SIGACTION_IGNORE,
- /* SIGRT 21 */ SIGACTION_IGNORE,
- /* SIGRT 22 */ SIGACTION_IGNORE,
- /* SIGRT 23 */ SIGACTION_IGNORE,
- /* SIGRT 24 */ SIGACTION_IGNORE,
- /* SIGRT 25 */ SIGACTION_IGNORE,
- /* SIGRT 26 */ SIGACTION_IGNORE,
- /* SIGRT 27 */ SIGACTION_IGNORE,
- /* SIGRT 28 */ SIGACTION_IGNORE,
- /* SIGRT 29 */ SIGACTION_IGNORE,
- /* SIGRT 30 */ SIGACTION_IGNORE,
- /* SIGRT 31 */ SIGACTION_IGNORE,
- /* SIGRTMAX 32 */ SIGACTION_IGNORE
-};
-
-struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ];
-
-Watchdog_Control _POSIX_signals_Alarm_timer;
-
-Thread_queue_Control _POSIX_signals_Wait_queue;
-
-Chain_Control _POSIX_signals_Inactive_siginfo;
-Chain_Control _POSIX_signals_Siginfo[ SIG_ARRAY_MAX ];
-
-/*PAGE
- *
- * XXX - move these
- */
-
-#define _States_Is_interruptible_signal( _states ) \
- ( ((_states) & \
- (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) == \
- (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL))
-
-/*PAGE
- *
- * _POSIX_signals_Unblock_thread
- */
-
-/* XXX this routine could probably be cleaned up */
-boolean _POSIX_signals_Unblock_thread(
- Thread_Control *the_thread,
- int signo,
- siginfo_t *info
-)
-{
- POSIX_API_Control *api;
- sigset_t mask;
- siginfo_t *the_info = NULL;
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- mask = signo_to_mask( signo );
-
- /*
- * Is the thread is specifically waiting for a signal?
- */
-
- if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
-
- if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
- the_thread->Wait.return_code = EINTR;
-
- the_info = (siginfo_t *) the_thread->Wait.return_argument;
-
- if ( !info ) {
- the_info->si_signo = signo;
- the_info->si_code = SI_USER;
- the_info->si_value.sival_int = 0;
- } else {
- *the_info = *info;
- }
-
- _Thread_queue_Extract_with_proxy( the_thread );
- return TRUE;
- }
-
- /*
- * This should only be reached via pthread_kill().
- */
-
- return FALSE;
- }
-
- if ( ~api->signals_blocked & mask ) {
- the_thread->do_post_task_switch_extension = TRUE;
-
- if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) {
- the_thread->Wait.return_code = EINTR;
- if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
- _Thread_queue_Extract_with_proxy( the_thread );
- else if ( _States_Is_delaying(the_thread->current_state)){
- if ( _Watchdog_Is_active( &the_thread->Timer ) )
- (void) _Watchdog_Remove( &the_thread->Timer );
- _Thread_Unblock( the_thread );
- }
- }
- }
- return FALSE;
-
-}
-
-/*PAGE
- *
- * _POSIX_signals_Set_process_signals
- */
-
-void _POSIX_signals_Set_process_signals(
- sigset_t mask
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
- if ( !_POSIX_signals_Pending )
- _Thread_Do_post_task_switch_extension++;
- _POSIX_signals_Pending |= mask;
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _POSIX_signals_Clear_process_signals
- */
-
-void _POSIX_signals_Clear_process_signals(
- sigset_t mask
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
- _POSIX_signals_Pending &= ~mask;
- if ( !_POSIX_signals_Pending )
- _Thread_Do_post_task_switch_extension--;
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _POSIX_signals_Clear_signals
- */
-
-boolean _POSIX_signals_Clear_signals(
- POSIX_API_Control *api,
- int signo,
- siginfo_t *info,
- boolean is_global,
- boolean check_blocked
-)
-{
- sigset_t mask;
- sigset_t signals_blocked;
- ISR_Level level;
- boolean do_callout;
- POSIX_signals_Siginfo_node *psiginfo;
-
- mask = signo_to_mask( signo );
-
- do_callout = FALSE;
-
- /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK
- * insures that no signals are blocked and all are checked.
- */
-
- if ( check_blocked )
- signals_blocked = ~api->signals_blocked;
- else
- signals_blocked = SIGNAL_ALL_MASK;
-
- /* XXX this is not right for siginfo type signals yet */
- /* XXX since they can't be cleared the same way */
-
- _ISR_Disable( level );
- if ( is_global ) {
- if ( mask & (_POSIX_signals_Pending & signals_blocked) ) {
- if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
- psiginfo = (POSIX_signals_Siginfo_node *)
- _Chain_Get_unprotected( &_POSIX_signals_Siginfo[ signo ] );
- if ( _Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
- _POSIX_signals_Clear_process_signals( mask );
- if ( psiginfo ) {
- *info = psiginfo->Info;
- _Chain_Append_unprotected(
- &_POSIX_signals_Inactive_siginfo,
- &psiginfo->Node
- );
- } else
- do_callout = FALSE;
- } else
- _POSIX_signals_Clear_process_signals( mask );
- do_callout = TRUE;
- }
- } else {
- if ( mask & (api->signals_pending & signals_blocked) ) {
- api->signals_pending &= ~mask;
- do_callout = TRUE;
- }
- }
- _ISR_Enable( level );
- return do_callout;
-}
-
-
-/*PAGE
- *
- * _POSIX_signals_Check_signal
- */
-
-boolean _POSIX_signals_Check_signal(
- POSIX_API_Control *api,
- int signo,
- boolean is_global
-)
-{
- siginfo_t siginfo_struct;
- sigset_t saved_signals_blocked;
-
- if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
- is_global, TRUE ) )
- return FALSE;
-
- /*
- * Since we made a union of these, only one test is necessary but this is
- * safer.
- */
-
- assert( _POSIX_signals_Vectors[ signo ].sa_handler ||
- _POSIX_signals_Vectors[ signo ].sa_sigaction );
-
- /*
- * Just to prevent sending a signal which is currently being ignored.
- */
-
- if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN )
- return FALSE;
-
- /*
- * Block the signals requested in sa_mask
- */
-
- saved_signals_blocked = api->signals_blocked;
- api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
-
- switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) {
- case SA_SIGINFO:
- assert( is_global );
-
- (*_POSIX_signals_Vectors[ signo ].sa_sigaction)(
- signo,
- &siginfo_struct,
- NULL /* context is undefined per 1003.1b-1993, p. 66 */
- );
- break;
- default:
- (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo );
- break;
- }
-
- /*
- * Restore the previous set of blocked signals
- */
-
- api->signals_blocked = saved_signals_blocked;
-
- return TRUE;
-}
-
-void _POSIX_signals_Post_switch_extension(
- Thread_Control *the_thread
-)
-{
- POSIX_API_Control *api;
- int signo;
- ISR_Level level;
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- /*
- * If we invoke any user code, there is the possibility that
- * a new signal has been posted that we should process so we
- * restart the loop if a signal handler was invoked.
- *
- * The first thing done is to check there are any signals to be
- * processed at all. No point in doing this loop otherwise.
- */
-
-restart:
- _ISR_Disable( level );
- if ( !(~api->signals_blocked &
- (api->signals_pending | _POSIX_signals_Pending)) ) {
- _ISR_Enable( level );
- return;
- }
- _ISR_Enable( level );
-
- for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
-
- if ( _POSIX_signals_Check_signal( api, signo, FALSE ) )
- goto restart;
-
- if ( _POSIX_signals_Check_signal( api, signo, TRUE ) )
- goto restart;
-
- }
-
-/* XXX - add __SIGFIRSTNOTRT or something like that to newlib siginfo.h */
-
- for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
-
- if ( _POSIX_signals_Check_signal( api, signo, FALSE ) )
- goto restart;
-
- if ( _POSIX_signals_Check_signal( api, signo, TRUE ) )
- goto restart;
-
- }
-
-}
-
-/*PAGE
- *
- * _POSIX_signals_Alarm_TSR
- */
-
-void _POSIX_signals_Alarm_TSR(
- Objects_Id id,
- void *argument
-)
-{
- int status;
-
- status = kill( getpid(), SIGALRM );
- /* XXX can't print from an ISR, should this be fatal? */
- assert( !status );
-}
-
-/*PAGE
- *
- * _POSIX_signals_Manager_Initialization
- */
-
-void _POSIX_signals_Manager_Initialization(
- int maximum_queued_signals
-)
-{
- unsigned32 signo;
-
- /*
- * Insure we have the same number of vectors and default vector entries
- */
-
- assert(
- sizeof(_POSIX_signals_Vectors) == sizeof(_POSIX_signals_Default_vectors)
- );
-
- memcpy(
- _POSIX_signals_Vectors,
- _POSIX_signals_Default_vectors,
- sizeof( _POSIX_signals_Vectors )
- );
-
- /*
- * Initialize the set of pending signals for the entire process
- */
-
- sigemptyset( &_POSIX_signals_Pending );
-
- /*
- * Initialize the timer used to implement alarm().
- */
-
- _Watchdog_Initialize(
- &_POSIX_signals_Alarm_timer,
- _POSIX_signals_Alarm_TSR,
- 0,
- NULL
- );
-
- /*
- * Initialize the queue we use to block for signals
- */
-
- _Thread_queue_Initialize(
- &_POSIX_signals_Wait_queue,
- OBJECTS_NO_CLASS,
- THREAD_QUEUE_DISCIPLINE_PRIORITY,
- STATES_WAITING_FOR_SIGNAL | STATES_INTERRUPTIBLE_BY_SIGNAL,
- NULL,
- EAGAIN
- );
-
- /* XXX status codes */
-
- /*
- * Allocate the siginfo pools.
- */
-
- for ( signo=1 ; signo<= SIGRTMAX ; signo++ )
- _Chain_Initialize_empty( &_POSIX_signals_Siginfo[ signo ] );
-
- _Chain_Initialize(
- &_POSIX_signals_Inactive_siginfo,
- _Workspace_Allocate_or_fatal_error(
- maximum_queued_signals * sizeof( POSIX_signals_Siginfo_node )
- ),
- maximum_queued_signals,
- sizeof( POSIX_signals_Siginfo_node )
- );
-}
-
-/*
- * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69
- */
-
-int sigemptyset(
- sigset_t *set
-)
-{
- if ( !set )
- set_errno_and_return_minus_one( EINVAL );
-
- *set = 0;
- return 0;
-}
-
-/*
- * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69
- */
-
-int sigfillset(
- sigset_t *set
-)
-{
- if ( !set )
- set_errno_and_return_minus_one( EINVAL );
-
- *set = SIGNAL_ALL_MASK;
- return 0;
-}
-
-/*
- * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69
- */
-
-int sigaddset(
- sigset_t *set,
- int signo
-)
-{
- if ( !set )
- set_errno_and_return_minus_one( EINVAL );
-
- if ( !signo )
- return 0;
-
- if ( !is_valid_signo(signo) )
- set_errno_and_return_minus_one( EINVAL );
-
- *set |= signo_to_mask(signo);
- return 0;
-}
-
-/*
- * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69
- */
-
-int sigdelset(
- sigset_t *set,
- int signo
-)
-{
- if ( !set )
- set_errno_and_return_minus_one( EINVAL );
-
- if ( !signo )
- return 0;
-
- if ( !is_valid_signo(signo) )
- set_errno_and_return_minus_one( EINVAL );
-
- *set &= ~signo_to_mask(signo);
- return 0;
-}
-
-/*
- * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69
- */
-
-int sigismember(
- const sigset_t *set,
- int signo
-)
-{
- if ( !set )
- set_errno_and_return_minus_one( EINVAL );
-
- if ( !signo )
- return 0;
-
- if ( !is_valid_signo(signo) )
- set_errno_and_return_minus_one( EINVAL );
-
- if ( *set & signo_to_mask(signo) )
- return 1;
-
- return 0;
-}
-
-/*
- * 3.3.4 Examine and Change Signal Action, P1003.1b-1993, p. 70
- */
-
-int sigaction(
- int sig,
- const struct sigaction *act,
- struct sigaction *oact
-)
-{
- ISR_Level level;
-
- if ( oact )
- *oact = _POSIX_signals_Vectors[ sig ];
-
- if ( !sig )
- return 0;
-
- if ( !is_valid_signo(sig) )
- set_errno_and_return_minus_one( EINVAL );
-
- /*
- * Some signals cannot be ignored (P1003.1b-1993, pp. 70-72 and references.
- *
- * NOTE: Solaris documentation claims to "silently enforce" this which
- * contradicts the POSIX specification.
- */
-
- if ( sig == SIGKILL )
- set_errno_and_return_minus_one( EINVAL );
-
- /*
- * Evaluate the new action structure and set the global signal vector
- * appropriately.
- */
-
- if ( act ) {
-
- /*
- * Unless the user is installing the default signal actions, then
- * we can just copy the provided sigaction structure into the vectors.
- */
-
- _ISR_Disable( level );
- if ( act->sa_handler == SIG_DFL ) {
- _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
- } else {
- _POSIX_signals_Clear_process_signals( signo_to_mask(sig) );
- _POSIX_signals_Vectors[ sig ] = *act;
- }
- _ISR_Enable( level );
- }
-
- /*
- * No need to evaluate or dispatch because:
- *
- * + If we were ignoring the signal before, none could be pending
- * now (signals not posted when SIG_IGN).
- * + If we are now ignoring a signal that was previously pending,
- * we clear the pending signal indicator.
- */
-
- return 0;
-}
-
-/*
- * 3.3.5 Examine and Change Blocked Signals, P1003.1b-1993, p. 73
- *
- * NOTE: P1003.1c/D10, p. 37 adds pthread_sigmask().
- *
- */
-
-int sigprocmask(
- int how,
- const sigset_t *set,
- sigset_t *oset
-)
-{
- /*
- * P1003.1c/Draft 10, p. 38 maps sigprocmask to pthread_sigmask.
- */
-
- return pthread_sigmask( how, set, oset );
-}
-
-/*
- * 3.3.5 Examine and Change Blocked Signals, P1003.1b-1993, p. 73
- *
- * NOTE: P1003.1c/D10, p. 37 adds pthread_sigmask().
- */
-
-int pthread_sigmask(
- int how,
- const sigset_t *set,
- sigset_t *oset
-)
-{
- POSIX_API_Control *api;
-
- if ( !set && !oset )
- set_errno_and_return_minus_one( EINVAL );
-
- api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- if ( oset )
- *oset = api->signals_blocked;
-
- if ( !set )
- return 0;
-
- switch ( how ) {
- case SIG_BLOCK:
- api->signals_blocked |= *set;
- break;
- case SIG_UNBLOCK:
- api->signals_blocked &= ~*set;
- break;
- case SIG_SETMASK:
- api->signals_blocked = *set;
- break;
- default:
- set_errno_and_return_minus_one( EINVAL );
- }
-
- /* XXX are there critical section problems here? */
-
- /* XXX evaluate the new set */
-
- if ( ~api->signals_blocked &
- (api->signals_pending | _POSIX_signals_Pending) ) {
- _Thread_Executing->do_post_task_switch_extension = TRUE;
- _Thread_Dispatch();
- }
-
- return 0;
-}
-
-/*
- * 3.3.6 Examine Pending Signals, P1003.1b-1993, p. 75
- */
-
-int sigpending(
- sigset_t *set
-)
-{
- POSIX_API_Control *api;
-
- if ( !set )
- set_errno_and_return_minus_one( EINVAL );
-
- api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- *set = api->signals_pending | _POSIX_signals_Pending;
-
- return 0;
-}
-
-/*
- * 3.3.7 Wait for a Signal, P1003.1b-1993, p. 75
- */
-
-int sigsuspend(
- const sigset_t *sigmask
-)
-{
- sigset_t saved_signals_blocked;
- sigset_t all_signals;
- int status;
- POSIX_API_Control *api;
-
- api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked );
-
- (void) sigfillset( &all_signals );
-
- status = sigtimedwait( &all_signals, NULL, NULL );
-
- (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL );
-
- return status;
-}
-
-/*
- * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76
- *
- * NOTE: P1003.1c/D10, p. 39 adds sigwait().
- */
-
-int sigwaitinfo(
- const sigset_t *set,
- siginfo_t *info
-)
-{
- return sigtimedwait( set, info, NULL );
-}
-
-/*
- * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76
- *
- * NOTE: P1003.1c/D10, p. 39 adds sigwait().
- */
-
-int _POSIX_signals_Get_highest(
- sigset_t set
-)
-{
- int signo;
-
- for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
- if ( set & signo_to_mask( signo ) )
- return signo;
- }
-
-/* XXX - add __SIGFIRSTNOTRT or something like that to newlib siginfo.h */
-
- for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
- if ( set & signo_to_mask( signo ) )
- return signo;
- }
-
- return 0;
-}
-
-int sigtimedwait(
- const sigset_t *set,
- siginfo_t *info,
- const struct timespec *timeout
-)
-{
- Thread_Control *the_thread;
- POSIX_API_Control *api;
- Watchdog_Interval interval;
- siginfo_t signal_information;
- siginfo_t *the_info;
- int signo;
-
- the_info = ( info ) ? info : &signal_information;
-
- the_thread = _Thread_Executing;
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- /*
- * What if they are already pending?
- */
-
- /* API signals pending? */
-
- if ( *set & api->signals_pending ) {
- /* XXX real info later */
- the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending );
- _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info,
- FALSE, FALSE );
- the_info->si_code = SI_USER;
- the_info->si_value.sival_int = 0;
- return the_info->si_signo;
- }
-
- /* Process pending signals? */
-
- if ( *set & _POSIX_signals_Pending) {
- signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending );
- _POSIX_signals_Clear_signals( api, signo, the_info, TRUE, FALSE );
-
- if ( !info ) {
- the_info->si_signo = signo;
- the_info->si_code = SI_USER;
- the_info->si_value.sival_int = 0;
- }
- }
-
- interval = 0;
- if ( timeout ) {
-
- if (timeout->tv_nsec < 0 || timeout->tv_nsec >= TOD_NANOSECONDS_PER_SECOND)
- set_errno_and_return_minus_one( EINVAL );
-
- interval = _POSIX_Timespec_to_interval( timeout );
- }
-
- the_info->si_signo = -1;
-
- _Thread_Disable_dispatch();
- the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
- the_thread->Wait.return_code = EINTR;
- the_thread->Wait.option = *set;
- the_thread->Wait.return_argument = (void *) the_info;
- _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue );
- _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval );
- _Thread_Enable_dispatch();
-
- errno = _Thread_Executing->Wait.return_code;
- return the_info->si_signo;
-}
-
-/*
- * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76
- *
- * NOTE: P1003.1c/D10, p. 39 adds sigwait().
- */
-
-int sigwait(
- const sigset_t *set,
- int *sig
-)
-{
- int status;
-
- status = sigtimedwait( set, NULL, NULL );
-
- if ( status != -1 ) {
- if ( sig )
- *sig = status;
- return 0;
- }
-
- return errno;
-}
-
-/*PAGE
- *
- * 3.3.2 Send a Signal to a Process, P1003.1b-1993, p. 68
- *
- * NOTE: Behavior of kill() depends on _POSIX_SAVED_IDS.
- */
-
-#define _POSIX_signals_Is_interested( _api, _mask ) \
- ( ~(_api)->signals_blocked & (_mask) )
-
-int killinfo(
- pid_t pid,
- int sig,
- const union sigval *value
-)
-{
- sigset_t mask;
- POSIX_API_Control *api;
- unsigned32 the_class;
- unsigned32 index;
- unsigned32 maximum;
- Objects_Information *the_info;
- Objects_Control **object_table;
- Thread_Control *the_thread;
- Thread_Control *interested_thread;
- Priority_Control interested_priority;
- Chain_Control *the_chain;
- Chain_Node *the_node;
- siginfo_t siginfo_struct;
- siginfo_t *siginfo;
- POSIX_signals_Siginfo_node *psiginfo;
-
- /*
- * Only supported for the "calling process" (i.e. this node).
- */
-
- if( pid != getpid() )
- set_errno_and_return_minus_one( ESRCH );
-
- /*
- * Validate the signal passed if not 0.
- */
-
- if ( sig && !is_valid_signo(sig) )
- set_errno_and_return_minus_one( EINVAL );
-
- /*
- * If the signal is being ignored, then we are out of here.
- */
-
- if ( !sig || _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
- return 0;
-
- /*
- * P1003.1c/Draft 10, p. 33 says that certain signals should always
- * be directed to the executing thread such as those caused by hardware
- * faults.
- */
-
- switch ( sig ) {
- case SIGFPE:
- case SIGILL:
- case SIGSEGV:
- return pthread_kill( pthread_self(), sig );
- default:
- break;
- }
-
- mask = signo_to_mask( sig );
-
- /*
- * Build up a siginfo structure
- */
-
- siginfo = &siginfo_struct;
- siginfo->si_signo = sig;
- siginfo->si_code = SI_USER;
- if ( !value ) {
- siginfo->si_value.sival_int = 0;
- } else {
- siginfo->si_value = *value;
- }
-
- _Thread_Disable_dispatch();
-
- /*
- * Is the currently executing thread interested? If so then it will
- * get it an execute it as soon as the dispatcher executes.
- */
-
- the_thread = _Thread_Executing;
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
- if ( _POSIX_signals_Is_interested( api, mask ) ) {
- goto process_it;
- }
-
- /*
- * Is an interested thread waiting for this signal (sigwait())?
- */
-
- /* XXX violation of visibility -- need to define thread queue support */
-
- for( index=0 ;
- index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
- index++ ) {
-
- the_chain = &_POSIX_signals_Wait_queue.Queues.Priority[ index ];
-
- for ( the_node = the_chain->first ;
- !_Chain_Is_tail( the_chain, the_node ) ;
- the_node = the_node->next ) {
-
- the_thread = (Thread_Control *)the_node;
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- if ((the_thread->Wait.option & mask) || (~api->signals_blocked & mask)) {
- goto process_it;
- }
-
- }
- }
-
- /*
- * Is any other thread interested? The highest priority interested
- * thread is selected. In the event of a tie, then the following
- * additional criteria is used:
- *
- * + ready thread over blocked
- * + blocked on call interruptible by signal (can return EINTR)
- * + blocked on call not interruptible by signal
- *
- * This looks at every thread in the system regardless of the creating API.
- *
- * NOTES:
- *
- * + rtems internal threads do not receive signals.
- */
-
- interested_thread = NULL;
- interested_priority = PRIORITY_MAXIMUM + 1;
-
- for ( the_class = OBJECTS_CLASSES_FIRST_THREAD_CLASS;
- the_class <= OBJECTS_CLASSES_LAST_THREAD_CLASS;
- the_class++ ) {
-
- if ( the_class == OBJECTS_INTERNAL_THREADS )
- continue;
-
- the_info = _Objects_Information_table[ the_class ];
-
- if ( !the_info ) /* manager not installed */
- continue;
-
- maximum = the_info->maximum;
- object_table = the_info->local_table;
-
- assert( object_table ); /* always at least 1 entry */
-
- for ( index = 1 ; index <= maximum ; index++ ) {
- the_thread = (Thread_Control *) object_table[ index ];
-
- if ( !the_thread )
- continue;
-
- /*
- * If this thread is of lower priority than the interested thread,
- * go on to the next thread.
- */
-
- if ( the_thread->current_priority > interested_priority )
- continue;
-
- /*
- * If this thread is not interested, then go on to the next thread.
- */
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- if ( !api || !_POSIX_signals_Is_interested( api, mask ) )
- continue;
-
- /*
- * Now we know the thread under connsideration is interested.
- * If the thread under consideration is of higher priority, then
- * it becomes the interested thread.
- */
-
- if ( the_thread->current_priority < interested_priority ) {
- interested_thread = the_thread;
- interested_priority = the_thread->current_priority;
- continue;
- }
-
- /*
- * Now the thread and the interested thread have the same priority.
- * If the interested thread is ready, then we don't need to send it
- * to a blocked thread.
- */
-
- if ( _States_Is_ready( interested_thread->current_state ) )
- continue;
-
- /*
- * Now the interested thread is blocked.
- * If the thread we are considering is not, the it becomes the
- * interested thread.
- */
-
- if ( _States_Is_ready( the_thread->current_state ) ) {
- interested_thread = the_thread;
- interested_priority = the_thread->current_priority;
- continue;
- }
-
- /*
- * Now we know both threads are blocked.
- * If the interested thread is interruptible, then just use it.
- */
-
- /* XXX need a new states macro */
- if ( interested_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL )
- continue;
-
- /*
- * Now both threads are blocked and the interested thread is not
- * interruptible.
- * If the thread under consideration is interruptible by a signal,
- * then it becomes the interested thread.
- */
-
- /* XXX need a new states macro */
- if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) {
- interested_thread = the_thread;
- interested_priority = the_thread->current_priority;
- }
- }
- }
-
- if ( interested_thread ) {
- the_thread = interested_thread;
- goto process_it;
- }
-
- /*
- * OK so no threads were interested right now. It will be left on the
- * global pending until a thread receives it. The global set of threads
- * can change interest in this signal in one of the following ways:
- *
- * + a thread is created with the signal unblocked,
- * + pthread_sigmask() unblocks the signal,
- * + sigprocmask() unblocks the signal, OR
- * + sigaction() which changes the handler to SIG_IGN.
- */
-
- the_thread = NULL;
- goto post_process_signal;
-
- /*
- * We found a thread which was interested, so now we mark that this
- * thread needs to do the post context switch extension so it can
- * evaluate the signals pending.
- */
-
-process_it:
-
- the_thread->do_post_task_switch_extension = TRUE;
-
- /*
- * Returns TRUE if the signal was synchronously given to a thread
- * blocked waiting for the signal.
- */
-
- if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
- _Thread_Enable_dispatch();
- return 0;
- }
-
-post_process_signal:
-
- /*
- * We may have woken up a thread but we definitely need to post the
- * signal to the process wide information set.
- */
-
- _POSIX_signals_Set_process_signals( mask );
-
- if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
-
- psiginfo = (POSIX_signals_Siginfo_node *)
- _Chain_Get( &_POSIX_signals_Inactive_siginfo );
- if ( !psiginfo )
- set_errno_and_return_minus_one( EAGAIN );
-
- psiginfo->Info = *siginfo;
-
- _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
- }
-
- _Thread_Enable_dispatch();
- return 0;
-}
-
-/*PAGE
- *
- * 3.3.2 Send a Signal to a Process, P1003.1b-1993, p. 68
- *
- * NOTE: Behavior of kill() depends on _POSIX_SAVED_IDS.
- */
-
-int kill(
- pid_t pid,
- int sig
-)
-{
- return killinfo( pid, sig, NULL );
-}
-
-/*
- * 3.3.9 Queue a Signal to a Process, P1003.1b-1993, p. 78
- */
-
-int sigqueue(
- pid_t pid,
- int signo,
- const union sigval value
-)
-{
- return killinfo( pid, signo, &value );
-}
-
-/*
- * 3.3.10 Send a Signal to a Thread, P1003.1c/D10, p. 43
- */
-
-int pthread_kill(
- pthread_t thread,
- int sig
-)
-{
- POSIX_API_Control *api;
- Thread_Control *the_thread;
- Objects_Locations location;
-
- if ( sig && !is_valid_signo(sig) )
- set_errno_and_return_minus_one( EINVAL );
-
- if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO )
- set_errno_and_return_minus_one( ENOSYS );
-
- /*
- * RTEMS does not support sending a siginfo signal to a specific thread.
- */
-
- the_thread = _POSIX_Threads_Get( thread, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- set_errno_and_return_minus_one( ESRCH );
- case OBJECTS_LOCAL:
- /*
- * If sig == 0 then just validate arguments
- */
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- if ( sig ) {
-
- if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
- _Thread_Enable_dispatch();
- return 0;
- }
-
- /* XXX critical section */
-
- api->signals_pending |= signo_to_mask( sig );
-
- (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
-
- the_thread->do_post_task_switch_extension = TRUE;
-
- if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
- _ISR_Signals_to_thread_executing = TRUE;
- }
- _Thread_Enable_dispatch();
- return 0;
- }
-
- return POSIX_BOTTOM_REACHED();
-}
-
-/*
- * 3.4.1 Schedule Alarm, P1003.1b-1993, p. 79
- */
-
-Watchdog_Control _POSIX_signals_Alarm_timer;
-
-unsigned int alarm(
- unsigned int seconds
-)
-{
- unsigned int remaining = 0;
- Watchdog_Control *the_timer;
-
- the_timer = &_POSIX_signals_Alarm_timer;
-
- switch ( _Watchdog_Remove( the_timer ) ) {
- case WATCHDOG_INACTIVE:
- case WATCHDOG_BEING_INSERTED:
- break;
-
- case WATCHDOG_ACTIVE:
- case WATCHDOG_REMOVE_IT:
- remaining = the_timer->initial -
- (the_timer->stop_time - the_timer->start_time);
- break;
- }
-
- _Watchdog_Insert_seconds( the_timer, seconds );
-
- return remaining;
-}
-
-/*
- * 3.4.2 Suspend Process Execution, P1003.1b-1993, p. 81
- */
-
-int pause( void )
-{
- sigset_t all_signals;
- int status;
-
- (void) sigfillset( &all_signals );
-
- status = sigtimedwait( &all_signals, NULL, NULL );
-
- return status;
-}
diff --git a/c/src/exec/posix/src/pthread.c b/c/src/exec/posix/src/pthread.c
deleted file mode 100644
index f8c6116dd0..0000000000
--- a/c/src/exec/posix/src/pthread.c
+++ /dev/null
@@ -1,1313 +0,0 @@
-/*
- * $Id$
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <pthread.h>
-#include <limits.h>
-
-#include <rtems/system.h>
-#include <rtems/score/apiext.h>
-#include <rtems/score/stack.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/userext.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/posix/pthread.h>
-#include <rtems/posix/priority.h>
-#include <rtems/posix/psignal.h>
-#include <rtems/posix/config.h>
-#include <rtems/posix/key.h>
-#include <rtems/posix/time.h>
-
-/*PAGE
- *
- * The default pthreads attributes structure.
- *
- * NOTE: Be careful .. if the default attribute set changes,
- * _POSIX_Threads_Initialize_user_threads will need to be examined.
- *
- */
-
-const pthread_attr_t _POSIX_Threads_Default_attributes = {
- TRUE, /* is_initialized */
- NULL, /* stackaddr */
- PTHREAD_MINIMUM_STACK_SIZE, /* stacksize */
- PTHREAD_SCOPE_PROCESS, /* contentionscope */
- PTHREAD_INHERIT_SCHED, /* inheritsched */
- SCHED_FIFO, /* schedpolicy */
- { /* schedparam */
- 2, /* sched_priority */
- 0, /* ss_low_priority */
- { 0L, 0 }, /* ss_replenish_period */
- { 0L, 0 } /* ss_initial_budget */
- },
- PTHREAD_CREATE_JOINABLE, /* detachstate */
- 1 /* cputime_clock_allowed */
-};
-
-/*PAGE
- *
- * _POSIX_Threads_Sporadic_budget_TSR
- */
-
-void _POSIX_Threads_Sporadic_budget_TSR(
- Objects_Id id,
- void *argument
-)
-{
- unsigned32 ticks;
- unsigned32 new_priority;
- Thread_Control *the_thread;
- POSIX_API_Control *api;
-
- the_thread = argument;
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- ticks = _POSIX_Timespec_to_interval( &api->schedparam.ss_initial_budget );
-
- if ( !ticks )
- ticks = 1;
-
- the_thread->cpu_time_budget = ticks;
-
- new_priority = _POSIX_Priority_To_core( api->ss_high_priority );
- the_thread->real_priority = new_priority;
-
- if ( the_thread->resource_count == 0 ||
- the_thread->current_priority > new_priority )
- _Thread_Change_priority( the_thread, new_priority, TRUE );
-
- ticks = _POSIX_Timespec_to_interval( &api->schedparam.ss_replenish_period );
-
- if ( !ticks )
- ticks = 1;
-
- _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Sporadic_budget_callout
- */
-
-void _POSIX_Threads_Sporadic_budget_callout(
- Thread_Control *the_thread
-)
-{
- POSIX_API_Control *api;
- unsigned32 new_priority;
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- /*
- * This will prevent the thread from consuming its entire "budget"
- * while at low priority.
- */
-
-
- the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */
-
- new_priority = _POSIX_Priority_To_core( api->schedparam.ss_low_priority );
- the_thread->real_priority = new_priority;
-
- if ( the_thread->resource_count == 0 ||
- the_thread->current_priority > new_priority )
- _Thread_Change_priority( the_thread, new_priority, TRUE );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Create_extension
- *
- * XXX
- */
-
-boolean _POSIX_Threads_Create_extension(
- Thread_Control *executing,
- Thread_Control *created
-)
-{
- POSIX_API_Control *api;
- POSIX_API_Control *executing_api;
-
- api = _Workspace_Allocate( sizeof( POSIX_API_Control ) );
-
- if ( !api )
- return FALSE;
-
- created->API_Extensions[ THREAD_API_POSIX ] = api;
-
- /* XXX check all fields are touched */
- api->Attributes = _POSIX_Threads_Default_attributes;
- api->detachstate = _POSIX_Threads_Default_attributes.detachstate;
- api->schedpolicy = _POSIX_Threads_Default_attributes.schedpolicy;
- api->schedparam = _POSIX_Threads_Default_attributes.schedparam;
- api->schedparam.sched_priority =
- _POSIX_Priority_From_core( created->current_priority );
-
- /*
- * If the thread is not a posix thread, then all posix signals are blocked
- * by default.
- */
-
- /* XXX use signal constants */
- api->signals_pending = 0;
- if ( _Objects_Get_class( created->Object.id ) == OBJECTS_POSIX_THREADS ) {
- executing_api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
- api->signals_blocked = api->signals_blocked;
- } else
- api->signals_blocked = 0xffffffff;
-
-/* XXX set signal parameters -- block all signals for non-posix threads */
-
- _Thread_queue_Initialize(
- &api->Join_List,
- OBJECTS_NO_CLASS, /* only used for proxy operations */
- THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_JOIN_AT_EXIT,
- NULL, /* no extract proxy handler */
- 0
- );
-
- _Watchdog_Initialize(
- &api->Sporadic_timer,
- _POSIX_Threads_Sporadic_budget_TSR,
- created->Object.id,
- created
- );
-
- return TRUE;
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Delete_extension
- */
-
-User_extensions_routine _POSIX_Threads_Delete_extension(
- Thread_Control *executing,
- Thread_Control *deleted
-)
-{
- Thread_Control *the_thread;
- POSIX_API_Control *api;
- void **value_ptr;
-
- api = deleted->API_Extensions[ THREAD_API_POSIX ];
-
- /* XXX run cancellation handlers */
-
- _POSIX_Keys_Run_destructors( deleted );
-
- /*
- * Wakeup all the tasks which joined with this one
- */
-
- value_ptr = (void **) deleted->Wait.return_argument;
-
- while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
- *(void **)the_thread->Wait.return_argument = value_ptr;
-
- if ( api->schedpolicy == SCHED_SPORADIC )
- (void) _Watchdog_Remove( &api->Sporadic_timer );
-
- deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
-
- (void) _Workspace_Free( api );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Initialize_user_threads
- *
- * This routine creates and starts all configured user
- * initialzation threads.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _POSIX_Threads_Initialize_user_threads( void )
-{
- int status;
- unsigned32 index;
- unsigned32 maximum;
- posix_initialization_threads_table *user_threads;
- pthread_t thread_id;
- pthread_attr_t attr;
-
- user_threads = _POSIX_Threads_User_initialization_threads;
- maximum = _POSIX_Threads_Number_of_initialization_threads;
-
- if ( !user_threads || maximum == 0 )
- return;
-
- /*
- * Be careful .. if the default attribute set changes, this may need to.
- *
- * Setting the attributes explicitly is critical, since we don't want
- * to inherit the idle tasks attributes.
- */
-
- for ( index=0 ; index < maximum ; index++ ) {
- status = pthread_attr_init( &attr );
- assert( !status );
-
- status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
- assert( !status );
-
- status = pthread_attr_setstacksize( &attr, PTHREAD_MINIMUM_STACK_SIZE * 2 );
- assert( !status );
-
- status = pthread_create(
- &thread_id,
- &attr,
- user_threads[ index ].thread_entry,
- NULL
- );
- assert( !status );
- }
-}
-
-/*PAGE
- *
- * API Extension control structures
- */
-
-API_extensions_Control _POSIX_Threads_API_extensions = {
- { NULL, NULL },
- NULL, /* predriver */
- _POSIX_Threads_Initialize_user_threads, /* postdriver */
- _POSIX_signals_Post_switch_extension, /* post switch */
-};
-
-User_extensions_Control _POSIX_Threads_User_extensions = {
- { NULL, NULL },
- { _POSIX_Threads_Create_extension, /* create */
- NULL, /* start */
- NULL, /* restart */
- _POSIX_Threads_Delete_extension, /* delete */
- NULL, /* switch */
- NULL, /* begin */
- NULL, /* exitted */
- NULL /* fatal */
- }
-};
-
-/*PAGE
- *
- * _POSIX_Threads_Manager_initialization
- *
- * This routine initializes all threads manager related data structures.
- *
- * Input parameters:
- * maximum_pthreads - maximum configured pthreads
- *
- * Output parameters: NONE
- */
-
-void _POSIX_Threads_Manager_initialization(
- unsigned32 maximum_pthreads,
- unsigned32 number_of_initialization_threads,
- posix_initialization_threads_table *user_threads
-
-)
-{
- _POSIX_Threads_Number_of_initialization_threads =
- number_of_initialization_threads;
- _POSIX_Threads_User_initialization_threads = user_threads;
-
- /*
- * There may not be any POSIX initialization threads configured.
- */
-
-#if 0
- if ( user_threads == NULL || number_of_initialization_threads == 0 )
- _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, TRUE, EINVAL );
-#endif
-
- _Objects_Initialize_information(
- &_POSIX_Threads_Information,
- OBJECTS_POSIX_THREADS,
- FALSE, /* does not support global */
- maximum_pthreads,
- sizeof( Thread_Control ),
- TRUE,
- 5, /* length is arbitrary for now */
- TRUE /* this class is threads */
- );
-
- /*
- * Add all the extensions for this API
- */
-
- _User_extensions_Add_API_set( &_POSIX_Threads_User_extensions );
-
- _API_extensions_Add( &_POSIX_Threads_API_extensions );
-
- /*
- * If we supported MP, then here we would ...
- * Register the MP Process Packet routine.
- */
-
-}
-
-/*PAGE
- *
- * 3.1.3 Register Fork Handlers, P1003.1c/Draft 10, P1003.1c/Draft 10, p. 27
- *
- * RTEMS does not support processes, so we fall under this and do not
- * provide this routine:
- *
- * "Either the implementation shall support the pthread_atfork() function
- * as described above or the pthread_atfork() funciton shall not be
- * provided."
- */
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_setscope(
- pthread_attr_t *attr,
- int contentionscope
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- switch ( contentionscope ) {
- case PTHREAD_SCOPE_PROCESS:
- attr->contentionscope = contentionscope;
- return 0;
-
- case PTHREAD_SCOPE_SYSTEM:
- return ENOTSUP;
-
- default:
- return EINVAL;
- }
-}
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_getscope(
- const pthread_attr_t *attr,
- int *contentionscope
-)
-{
- if ( !attr || !attr->is_initialized || !contentionscope )
- return EINVAL;
-
- *contentionscope = attr->contentionscope;
- return 0;
-}
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_setinheritsched(
- pthread_attr_t *attr,
- int inheritsched
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- switch ( inheritsched ) {
- case PTHREAD_INHERIT_SCHED:
- case PTHREAD_EXPLICIT_SCHED:
- attr->inheritsched = inheritsched;
- return 0;
-
- default:
- return ENOTSUP;
- }
-}
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_getinheritsched(
- const pthread_attr_t *attr,
- int *inheritsched
-)
-{
- if ( !attr || !attr->is_initialized || !inheritsched )
- return EINVAL;
-
- *inheritsched = attr->inheritsched;
- return 0;
-}
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_setschedpolicy(
- pthread_attr_t *attr,
- int policy
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- switch ( policy ) {
- case SCHED_OTHER:
- case SCHED_FIFO:
- case SCHED_RR:
- case SCHED_SPORADIC:
- attr->schedpolicy = policy;
- return 0;
-
- default:
- return ENOTSUP;
- }
-}
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Parameters, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_getschedpolicy(
- const pthread_attr_t *attr,
- int *policy
-)
-{
- if ( !attr || !attr->is_initialized || !policy )
- return EINVAL;
-
- *policy = attr->schedpolicy;
- return 0;
-}
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Parameters, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_setschedparam(
- pthread_attr_t *attr,
- const struct sched_param *param
-)
-{
- if ( !attr || !attr->is_initialized || !param )
- return EINVAL;
-
- attr->schedparam = *param;
- return 0;
-}
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_getschedparam(
- const pthread_attr_t *attr,
- struct sched_param *param
-)
-{
- if ( !attr || !attr->is_initialized || !param )
- return EINVAL;
-
- *param = attr->schedparam;
- return 0;
-}
-
-/*PAGE
- *
- * 13.5.2 Dynamic Thread Scheduling Parameters Access,
- * P1003.1c/Draft 10, p. 124
- */
-
-int pthread_getschedparam(
- pthread_t thread,
- int *policy,
- struct sched_param *param
-)
-{
- Objects_Locations location;
- POSIX_API_Control *api;
- register Thread_Control *the_thread;
-
- if ( !policy || !param )
- return EINVAL;
-
- the_thread = _POSIX_Threads_Get( thread, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- return ESRCH;
- case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
- *policy = api->schedpolicy;
- *param = api->schedparam;
- param->sched_priority =
- _POSIX_Priority_From_core( the_thread->current_priority );
- _Thread_Enable_dispatch();
- return 0;
- }
-
- return POSIX_BOTTOM_REACHED();
-
-}
-
-/*PAGE
- *
- * 13.5.2 Dynamic Thread Scheduling Parameters Access,
- * P1003.1c/Draft 10, p. 124
- */
-
-int pthread_setschedparam(
- pthread_t thread,
- int policy,
- struct sched_param *param
-)
-{
- register Thread_Control *the_thread;
- POSIX_API_Control *api;
- Thread_CPU_budget_algorithms budget_algorithm;
- Thread_CPU_budget_algorithm_callout budget_callout;
- Objects_Locations location;
-
- /*
- * Check all the parameters
- */
-
- if ( !param )
- return EINVAL;
-
- if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
- return EINVAL;
-
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
- budget_callout = NULL;
-
- switch ( policy ) {
- case SCHED_OTHER:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
- break;
-
- case SCHED_FIFO:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
- break;
-
- case SCHED_RR:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
- break;
-
- case SCHED_SPORADIC:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
- budget_callout = _POSIX_Threads_Sporadic_budget_callout;
-
- if ( _POSIX_Timespec_to_interval( &param->ss_replenish_period ) <
- _POSIX_Timespec_to_interval( &param->ss_initial_budget ) )
- return EINVAL;
-
- if ( !_POSIX_Priority_Is_valid( param->ss_low_priority ) )
- return EINVAL;
-
- break;
-
- default:
- return EINVAL;
- }
-
- /*
- * Actually change the scheduling policy and parameters
- */
-
- the_thread = _POSIX_Threads_Get( thread, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- return ESRCH;
- case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- if ( api->schedpolicy == SCHED_SPORADIC )
- (void) _Watchdog_Remove( &api->Sporadic_timer );
-
- api->schedpolicy = policy;
- api->schedparam = *param;
- the_thread->budget_algorithm = budget_algorithm;
- the_thread->budget_callout = budget_callout;
-
- switch ( api->schedpolicy ) {
- case SCHED_OTHER:
- case SCHED_FIFO:
- case SCHED_RR:
- the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
-
- the_thread->real_priority =
- _POSIX_Priority_To_core( api->schedparam.sched_priority );
-
- _Thread_Change_priority(
- the_thread,
- the_thread->real_priority,
- TRUE
- );
- break;
-
- case SCHED_SPORADIC:
- api->ss_high_priority = api->schedparam.sched_priority;
- _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread );
- break;
- }
-
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_init(
- pthread_attr_t *attr
-)
-{
- if ( !attr )
- return EINVAL;
-
- *attr = _POSIX_Threads_Default_attributes;
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_destroy(
- pthread_attr_t *attr
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- attr->is_initialized = FALSE;
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_getstacksize(
- const pthread_attr_t *attr,
- size_t *stacksize
-)
-{
- if ( !attr || !attr->is_initialized || !stacksize )
- return EINVAL;
-
- *stacksize = attr->stacksize;
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_setstacksize(
- pthread_attr_t *attr,
- size_t stacksize
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- if (stacksize < PTHREAD_MINIMUM_STACK_SIZE)
- attr->stacksize = PTHREAD_MINIMUM_STACK_SIZE;
- else
- attr->stacksize = stacksize;
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_getstackaddr(
- const pthread_attr_t *attr,
- void **stackaddr
-)
-{
- if ( !attr || !attr->is_initialized || !stackaddr )
- return EINVAL;
-
- *stackaddr = attr->stackaddr;
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_setstackaddr(
- pthread_attr_t *attr,
- void *stackaddr
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- attr->stackaddr = stackaddr;
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_getdetachstate(
- const pthread_attr_t *attr,
- int *detachstate
-)
-{
- if ( !attr || !attr->is_initialized || !detachstate )
- return EINVAL;
-
- *detachstate = attr->detachstate;
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_setdetachstate(
- pthread_attr_t *attr,
- int detachstate
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- switch ( detachstate ) {
- case PTHREAD_CREATE_DETACHED:
- case PTHREAD_CREATE_JOINABLE:
- attr->detachstate = detachstate;
- return 0;
-
- default:
- return EINVAL;
- }
-}
-
-/*PAGE
- *
- * 16.1.2 Thread Creation, P1003.1c/Draft 10, p. 144
- */
-
-int pthread_create(
- pthread_t *thread,
- const pthread_attr_t *attr,
- void *(*start_routine)( void * ),
- void *arg
-)
-{
- const pthread_attr_t *the_attr;
- Priority_Control core_priority;
- Thread_CPU_budget_algorithms budget_algorithm;
- Thread_CPU_budget_algorithm_callout budget_callout;
- boolean is_fp;
- boolean status;
- Thread_Control *the_thread;
- char *default_name = "psx";
- POSIX_API_Control *api;
- int schedpolicy = SCHED_RR;
- struct sched_param schedparam;
-
- the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
-
- if ( !the_attr->is_initialized )
- return EINVAL;
-
- /*
- * Core Thread Initialize insures we get the minimum amount of
- * stack space if it is allowed to allocate it itself.
- */
-
- if ( the_attr->stackaddr && !_Stack_Is_enough( the_attr->stacksize ) )
- return EINVAL;
-
-#if 0
- int cputime_clock_allowed; /* see time.h */
- POSIX_NOT_IMPLEMENTED();
-#endif
-
- /*
- * P1003.1c/Draft 10, p. 121.
- *
- * If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread
- * inherits scheduling attributes from the creating thread. If it is
- * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the
- * attributes structure.
- */
-
- switch ( the_attr->inheritsched ) {
- case PTHREAD_INHERIT_SCHED:
- api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
- schedpolicy = api->schedpolicy;
- schedparam = api->schedparam;
- break;
-
- case PTHREAD_EXPLICIT_SCHED:
- schedpolicy = the_attr->schedpolicy;
- schedparam = the_attr->schedparam;
- break;
-
- default:
- return EINVAL;
- }
-
- /*
- * Check the contentionscope since rtems only supports PROCESS wide
- * contention (i.e. no system wide contention).
- */
-
- if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
- return ENOTSUP;
-
- /*
- * Interpret the scheduling parameters.
- */
-
- if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
- return EINVAL;
-
- core_priority = _POSIX_Priority_To_core( schedparam.sched_priority );
-
- /*
- * Set the core scheduling policy information.
- */
-
- budget_callout = NULL;
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
-
- switch ( schedpolicy ) {
- case SCHED_OTHER:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
- break;
-
- case SCHED_FIFO:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
- break;
-
- case SCHED_RR:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
- break;
-
- case SCHED_SPORADIC:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
- budget_callout = _POSIX_Threads_Sporadic_budget_callout;
-
- if ( _POSIX_Timespec_to_interval( &schedparam.ss_replenish_period ) <
- _POSIX_Timespec_to_interval( &schedparam.ss_initial_budget ) )
- return EINVAL;
-
- if ( !_POSIX_Priority_Is_valid( schedparam.ss_low_priority ) )
- return EINVAL;
-
- break;
-
- default:
- return EINVAL;
- }
-
- /*
- * Currently all POSIX threads are floating point if the hardware
- * supports it.
- */
-
- is_fp = CPU_HARDWARE_FP;
-
- /*
- * Disable dispatch for protection
- */
-
- _Thread_Disable_dispatch();
-
- /*
- * Allocate the thread control block.
- *
- * NOTE: Global threads are not currently supported.
- */
-
- the_thread = _POSIX_Threads_Allocate();
-
- if ( !the_thread ) {
- _Thread_Enable_dispatch();
- return EAGAIN;
- }
-
- /*
- * Initialize the core thread for this task.
- */
-
- status = _Thread_Initialize(
- &_POSIX_Threads_Information,
- the_thread,
- the_attr->stackaddr,
- the_attr->stacksize,
- is_fp,
- core_priority,
- TRUE, /* preemptible */
- budget_algorithm,
- budget_callout,
- 0, /* isr level */
- &default_name /* posix threads don't have a name */
- );
-
- if ( !status ) {
- _POSIX_Threads_Free( the_thread );
- _Thread_Enable_dispatch();
- return EAGAIN;
- }
-
- /*
- * finish initializing the per API structure
- */
-
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- api->Attributes = *the_attr;
- api->detachstate = the_attr->detachstate;
- api->schedpolicy = schedpolicy;
- api->schedparam = schedparam;
-
- /*
- * This insures we evaluate the process-wide signals pending when we
- * first run.
- *
- * NOTE: Since the thread starts with all unblocked, this is necessary.
- */
-
- the_thread->do_post_task_switch_extension = TRUE;
-
- /*
- * POSIX threads are allocated and started in one operation.
- */
-
- status = _Thread_Start(
- the_thread,
- THREAD_START_POINTER,
- start_routine,
- arg,
- 0 /* unused */
- );
-
- if ( schedpolicy == SCHED_SPORADIC ) {
- _Watchdog_Insert_ticks(
- &api->Sporadic_timer,
- _POSIX_Timespec_to_interval( &api->schedparam.ss_replenish_period )
- );
- }
-
- /*
- * _Thread_Start only fails if the thread was in the incorrect state
- */
-
- if ( !status ) {
- _POSIX_Threads_Free( the_thread );
- _Thread_Enable_dispatch();
- return EINVAL;
- }
-
- /*
- * Return the id and indicate we successfully created the thread
- */
-
- *thread = the_thread->Object.id;
-
- _Thread_Enable_dispatch();
-
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.3 Wait for Thread Termination, P1003.1c/Draft 10, p. 147
- */
-
-int pthread_join(
- pthread_t thread,
- void **value_ptr
-)
-{
- register Thread_Control *the_thread;
- POSIX_API_Control *api;
- Objects_Locations location;
- void *return_pointer;
-
- the_thread = _POSIX_Threads_Get( thread, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- return ESRCH;
- case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- if ( api->detachstate == PTHREAD_CREATE_DETACHED ) {
- _Thread_Enable_dispatch();
- return EINVAL;
- }
-
- if ( _Thread_Is_executing( the_thread ) ) {
- _Thread_Enable_dispatch();
- return EDEADLK;
- }
-
- /*
- * Put ourself on the threads join list
- */
-
- _Thread_Executing->Wait.return_argument = (unsigned32 *) &return_pointer;
-
- _Thread_queue_Enter_critical_section( &api->Join_List );
-
- _Thread_queue_Enqueue( &api->Join_List, WATCHDOG_NO_TIMEOUT );
-
- _Thread_Enable_dispatch();
-
- if ( value_ptr )
- *value_ptr = return_pointer;
- return 0;
- }
-
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 16.1.4 Detaching a Thread, P1003.1c/Draft 10, p. 149
- */
-
-int pthread_detach(
- pthread_t thread
-)
-{
- register Thread_Control *the_thread;
- POSIX_API_Control *api;
- Objects_Locations location;
-
- the_thread = _POSIX_Threads_Get( thread, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- return ESRCH;
- case OBJECTS_LOCAL:
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
- api->detachstate = PTHREAD_CREATE_DETACHED;
- _Thread_Enable_dispatch();
- return 0;
- }
-
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 16.1.5.1 Thread Termination, p1003.1c/Draft 10, p. 150
- *
- * NOTE: Key destructors are executed in the POSIX api delete extension.
- */
-
-void pthread_exit(
- void *value_ptr
-)
-{
- Objects_Information *the_information;
-
- the_information = _Objects_Get_information( _Thread_Executing->Object.id );
-
- _Thread_Disable_dispatch();
-
- _Thread_Executing->Wait.return_argument = (unsigned32 *)value_ptr;
-
- _Thread_Close( the_information, _Thread_Executing );
-
- _POSIX_Threads_Free( _Thread_Executing );
-
- _Thread_Enable_dispatch();
-}
-
-/*PAGE
- *
- * 16.1.6 Get Calling Thread's ID, p1003.1c/Draft 10, p. 152
- */
-
-pthread_t pthread_self( void )
-{
- return _Thread_Executing->Object.id;
-}
-
-/*PAGE
- *
- * 16.1.7 Compare Thread IDs, p1003.1c/Draft 10, p. 153
- *
- * NOTE: POSIX does not define the behavior when either thread id is invalid.
- */
-
-int pthread_equal(
- pthread_t t1,
- pthread_t t2
-)
-{
- /*
- * If the system is configured for debug, then we will do everything we
- * can to insure that both ids are valid. Otherwise, we will do the
- * cheapest possible thing to determine if they are equal.
- */
-
-#ifndef RTEMS_DEBUG
- return _Objects_Are_ids_equal( t1, t2 );
-#else
- int status;
- Objects_Locations location;
-
- /*
- * By default this is not a match.
- */
-
- status = 0;
-
- /*
- * Validate the first id and return 0 if it is not valid
- */
-
- (void) _POSIX_Threads_Get( t1, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- break;
-
- case OBJECTS_LOCAL:
-
- /*
- * Validate the second id and return 0 if it is not valid
- */
-
- (void) _POSIX_Threads_Get( t2, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- break;
- case OBJECTS_LOCAL:
- status = _Objects_Are_ids_equal( t1, t2 );
- break;
- }
- _Thread_Unnest_dispatch();
- break;
- }
-
- _Thread_Enable_dispatch();
- return status;
-#endif
-}
-
-/*PAGE
- *
- * 16.1.8 Dynamic Package Initialization, P1003.1c/Draft 10, p. 154
- */
-
-int pthread_once(
- pthread_once_t *once_control,
- void (*init_routine)(void)
-)
-{
- if ( !once_control || !init_routine )
- return EINVAL;
-
- _Thread_Disable_dispatch();
-
- if ( !once_control->init_executed ) {
- once_control->is_initialized = TRUE;
- once_control->init_executed = TRUE;
- (*init_routine)();
- }
-
- _Thread_Enable_dispatch();
- return 0;
-}
-
-/*PAGE
- *
- * 20.1.6 Accessing a Thread CPU-time Clock, P1003.4b/Draft 8, p. 58
- */
-
-int pthread_getcpuclockid(
- pthread_t pid,
- clockid_t *clock_id
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/Draft 8, p. 59
- */
-
-int pthread_attr_setcputime(
- pthread_attr_t *attr,
- int clock_allowed
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- switch ( clock_allowed ) {
- case CLOCK_ENABLED:
- case CLOCK_DISABLED:
- attr->cputime_clock_allowed = clock_allowed;
- return 0;
-
- default:
- return EINVAL;
- }
-}
-
-/*PAGE
- *
- * 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/Draft 8, p. 59
- */
-
-int pthread_attr_getcputime(
- pthread_attr_t *attr,
- int *clock_allowed
-)
-{
- if ( !attr || !attr->is_initialized || !clock_allowed )
- return EINVAL;
-
- *clock_allowed = attr->cputime_clock_allowed;
- return 0;
-}
diff --git a/c/src/exec/posix/src/pthreadatfork.c b/c/src/exec/posix/src/pthreadatfork.c
deleted file mode 100644
index f70f8d7dc1..0000000000
--- a/c/src/exec/posix/src/pthreadatfork.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * pthread_atfork() - POSIX 1003.1b 3.1.3
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <errno.h>
-
-int pthread_atfork(
- void (*prepare)(void),
- void (*parent)(void),
- void (*child)(void)
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/posix/src/ptimer.c b/c/src/exec/posix/src/ptimer.c
deleted file mode 100644
index 0446a7a683..0000000000
--- a/c/src/exec/posix/src/ptimer.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * $Id$
- */
-
-#include <assert.h>
-#include <time.h>
-#include <errno.h>
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-
-#include <rtems/posix/time.h>
-
-/*
- * 14.2.2 Create a Per-Process Timer, P1003.1b-1993, p. 264
- */
-
-int timer_create(
- clockid_t clock_id,
- struct sigevent *evp,
- timer_t *timerid
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*
- * 14.2.3 Delete a Per_process Timer, P1003.1b-1993, p. 266
- */
-
-int timer_delete(
- timer_t timerid
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*
- * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267
- */
-
-int timer_settime(
- timer_t timerid,
- int flags,
- const struct itimerspec *value,
- struct itimerspec *ovalue
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*
- * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267
- */
-
-int timer_gettime(
- timer_t timerid,
- struct itimerspec *value
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*
- * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267
- */
-
-int timer_getoverrun(
- timer_t timerid
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
diff --git a/c/src/exec/posix/src/sched.c b/c/src/exec/posix/src/sched.c
deleted file mode 100644
index e558126926..0000000000
--- a/c/src/exec/posix/src/sched.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * $Id$
- */
-
-#include <assert.h>
-#include <sched.h>
-#include <errno.h>
-
-#include <rtems/system.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/thread.h>
-#include <rtems/posix/seterr.h>
-#include <rtems/posix/priority.h>
-#include <rtems/posix/time.h>
-
-/*PAGE
- *
- * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252
- *
- */
-
-int sched_setparam(
- pid_t pid,
- const struct sched_param *param
-)
-{
- set_errno_and_return_minus_one( ENOSYS );
-}
-
-/*PAGE
- *
- * 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253
- */
-
-int sched_getparam(
- pid_t pid,
- const struct sched_param *param
-)
-{
- set_errno_and_return_minus_one( ENOSYS );
-}
-
-/*PAGE
- *
- * 13.3.3 Set Scheduling Policy and Scheduling Parameters,
- * P1003.1b-1993, p. 254
- */
-
-int sched_setscheduler(
- pid_t pid,
- int policy,
- const struct sched_param *param
-)
-{
- set_errno_and_return_minus_one( ENOSYS );
-}
-
-/*PAGE
- *
- * 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256
- */
-
-int sched_getscheduler(
- pid_t pid
-)
-{
- set_errno_and_return_minus_one( ENOSYS );
-}
-
-/*PAGE
- *
- * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
- */
-
-int sched_get_priority_max(
- int policy
-)
-{
- switch ( policy ) {
- case SCHED_OTHER:
- case SCHED_FIFO:
- case SCHED_RR:
- case SCHED_SPORADIC:
- break;
-
- default:
- set_errno_and_return_minus_one( EINVAL );
- }
-
- return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
-}
-
-/*PAGE
- *
- * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
- */
-
-int sched_get_priority_min(
- int policy
-)
-{
- switch ( policy ) {
- case SCHED_OTHER:
- case SCHED_FIFO:
- case SCHED_RR:
- case SCHED_SPORADIC:
- break;
-
- default:
- set_errno_and_return_minus_one( EINVAL );
- }
-
- return POSIX_SCHEDULER_MINIMUM_PRIORITY;
-}
-
-/*PAGE
- *
- * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
- */
-
-int sched_rr_get_interval(
- pid_t pid,
- struct timespec *interval
-)
-{
- /* XXX do we need to support different time quantums per thread */
-
- /*
- * Only supported for the "calling process" (i.e. this node).
- */
-
- if ( pid != getpid() )
- set_errno_and_return_minus_one( ESRCH );
-
- if ( !interval )
- set_errno_and_return_minus_one( EINVAL );
-
- _POSIX_Interval_to_timespec( _Thread_Ticks_per_timeslice, interval );
- return 0;
-}
-
-/*PAGE
- *
- * 13.3.5 Yield Processor, P1003.1b-1993, p. 257
- */
-
-int sched_yield( void )
-{
- _Thread_Disable_dispatch();
- _Thread_Yield_processor();
- _Thread_Enable_dispatch();
- return 0;
-}
diff --git a/c/src/exec/posix/src/semaphore.c b/c/src/exec/posix/src/semaphore.c
deleted file mode 100644
index a968abe43b..0000000000
--- a/c/src/exec/posix/src/semaphore.c
+++ /dev/null
@@ -1,571 +0,0 @@
-/*
- * $Id$
- */
-
-#include <stdarg.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <semaphore.h>
-#include <limits.h>
-
-#include <rtems/system.h>
-#include <rtems/score/object.h>
-#include <rtems/posix/semaphore.h>
-#include <rtems/posix/time.h>
-
-/*PAGE
- *
- * _POSIX_Semaphore_Manager_initialization
- *
- * This routine initializes all semaphore manager related data structures.
- *
- * Input parameters:
- * maximum_semaphores - maximum configured semaphores
- *
- * Output parameters: NONE
- */
-
-void _POSIX_Semaphore_Manager_initialization(
- unsigned32 maximum_semaphores
-)
-{
- _Objects_Initialize_information(
- &_POSIX_Semaphore_Information,
- OBJECTS_POSIX_SEMAPHORES,
- TRUE,
- maximum_semaphores,
- sizeof( POSIX_Semaphore_Control ),
- TRUE,
- _POSIX_PATH_MAX,
- FALSE
- );
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Create_support
- */
-
-int _POSIX_Semaphore_Create_support(
- const char *name,
- int pshared,
- unsigned int value,
- POSIX_Semaphore_Control **the_sem
-)
-{
- POSIX_Semaphore_Control *the_semaphore;
- CORE_semaphore_Attributes *the_sem_attr;
-
- _Thread_Disable_dispatch();
-
- the_semaphore = _POSIX_Semaphore_Allocate();
-
- if ( !the_semaphore ) {
- _Thread_Enable_dispatch();
- set_errno_and_return_minus_one( ENOMEM );
- }
-
- if ( pshared == PTHREAD_PROCESS_SHARED &&
- !( _Objects_MP_Allocate_and_open( &_POSIX_Semaphore_Information, 0,
- the_semaphore->Object.id, FALSE ) ) ) {
- _POSIX_Semaphore_Free( the_semaphore );
- _Thread_Enable_dispatch();
- set_errno_and_return_minus_one( EAGAIN );
- }
-
- the_semaphore->process_shared = pshared;
-
- if ( name ) {
- the_semaphore->named = TRUE;
- the_semaphore->open_count = 1;
- the_semaphore->linked = TRUE;
- }
- else
- the_semaphore->named = FALSE;
-
- the_sem_attr = &the_semaphore->Semaphore.Attributes;
-
- /* XXX
- *
- * Note should this be based on the current scheduling policy?
- */
-
- the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
-
- _CORE_semaphore_Initialize(
- &the_semaphore->Semaphore,
- OBJECTS_POSIX_SEMAPHORES,
- the_sem_attr,
- value,
- 0 /* XXX - proxy_extract_callout is unused */
- );
-
- /* XXX - need Names to be a string!!! */
- _Objects_Open(
- &_POSIX_Semaphore_Information,
- &the_semaphore->Object,
- (char *) name
- );
-
- *the_sem = the_semaphore;
-
- if ( pshared == PTHREAD_PROCESS_SHARED )
- _POSIX_Semaphore_MP_Send_process_packet(
- POSIX_SEMAPHORE_MP_ANNOUNCE_CREATE,
- the_semaphore->Object.id,
- (char *) name,
- 0 /* proxy id - Not used */
- );
-
- _Thread_Enable_dispatch();
- return 0;
-}
-
-
-/*PAGE
- *
- * 11.2.1 Initialize an Unnamed Semaphore, P1003.1b-1993, p.219
- */
-
-int sem_init(
- sem_t *sem,
- int pshared,
- unsigned int value
-)
-{
- int status;
- POSIX_Semaphore_Control *the_semaphore;
-
- status = _POSIX_Semaphore_Create_support(
- NULL,
- pshared,
- value,
- &the_semaphore
- );
-
- if ( status != -1 )
- *sem = the_semaphore->Object.id;
-
- return status;
-}
-
-/*PAGE
- *
- * 11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220
- */
-
-int sem_destroy(
- sem_t *sem
-)
-{
- register POSIX_Semaphore_Control *the_semaphore;
- Objects_Locations location;
-
- the_semaphore = _POSIX_Semaphore_Get( sem, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- /*
- * Undefined operation on a named semaphore.
- */
-
- if ( the_semaphore->named == TRUE ) {
- seterrno( EINVAL );
- return( -1 );
- }
-
- _Objects_Close( &_POSIX_Semaphore_Information, &the_semaphore->Object );
-
- _CORE_semaphore_Flush(
- &the_semaphore->Semaphore,
- _POSIX_Semaphore_MP_Send_object_was_deleted,
- -1 /* XXX should also seterrno -> EINVAL */
- );
-
- _POSIX_Semaphore_Free( the_semaphore );
-
- if ( the_semaphore->process_shared == PTHREAD_PROCESS_SHARED ) {
-
- _Objects_MP_Close(
- &_POSIX_Semaphore_Information,
- the_semaphore->Object.id
- );
-
- _POSIX_Semaphore_MP_Send_process_packet(
- POSIX_SEMAPHORE_MP_ANNOUNCE_DELETE,
- the_semaphore->Object.id,
- 0, /* Not used */
- 0 /* Not used */
- );
- }
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.2.3 Initialize/Open a Named Semaphore, P1003.1b-1993, p.221
- *
- * NOTE: When oflag is O_CREAT, then optional third and fourth
- * parameters must be present.
- */
-
-sem_t *sem_open(
- const char *name,
- int oflag,
- ...
- /* mode_t mode, */
- /* unsigned int value */
-)
-{
- va_list arg;
- mode_t mode;
- unsigned int value;
- int status;
- Objects_Id the_semaphore_id;
- POSIX_Semaphore_Control *the_semaphore;
-
-
- if ( oflag & O_CREAT ) {
- va_start(arg, oflag);
- mode = (mode_t) va_arg( arg, mode_t * );
- value = (unsigned int) va_arg( arg, unsigned int * );
- va_end(arg);
- }
-
- status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id );
-
- /*
- * If the name to id translation worked, then the semaphore exists
- * and we can just return a pointer to the id. Otherwise we may
- * need to check to see if this is a "semaphore does not exist"
- * or some other miscellaneous error on the name.
- */
-
- if ( status ) {
-
- if ( status == EINVAL ) { /* name -> ID translation failed */
- if ( !(oflag & O_CREAT) ) { /* willing to create it? */
- seterrno( ENOENT );
- return (sem_t *) -1;
- }
- /* we are willing to create it */
- }
- seterrno( status ); /* some type of error */
- return (sem_t *) -1;
-
- } else { /* name -> ID translation succeeded */
-
- if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
- seterrno( EEXIST );
- return (sem_t *) -1;
- }
-
- /*
- * XXX In this case we need to do an ID->pointer conversion to
- * check the mode. This is probably a good place for a subroutine.
- */
-
- the_semaphore->open_count += 1;
-
- return (sem_t *)&the_semaphore->Object.id;
-
- }
-
- /* XXX verify this comment...
- *
- * At this point, the semaphore does not exist and everything has been
- * checked. We should go ahead and create a semaphore.
- */
-
- status = _POSIX_Semaphore_Create_support(
- name,
- TRUE, /* shared across processes */
- value,
- &the_semaphore
- );
-
- if ( status == -1 )
- return (sem_t *) -1;
-
- return (sem_t *) &the_semaphore->Object.id;
-
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Delete
- */
-
-void _POSIX_Semaphore_Delete(
- POSIX_Semaphore_Control *the_semaphore
-)
-{
- if ( !the_semaphore->linked && !the_semaphore->open_count ) {
- _POSIX_Semaphore_Free( the_semaphore );
-
- if ( the_semaphore->process_shared == PTHREAD_PROCESS_SHARED ) {
-
- _Objects_MP_Close(
- &_POSIX_Semaphore_Information,
- the_semaphore->Object.id
- );
-
- _POSIX_Semaphore_MP_Send_process_packet(
- POSIX_SEMAPHORE_MP_ANNOUNCE_DELETE,
- the_semaphore->Object.id,
- 0, /* Not used */
- 0 /* Not used */
- );
- }
-
- }
-}
-
-/*PAGE
- *
- * 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224
- */
-
-int sem_close(
- sem_t *sem
-)
-{
- register POSIX_Semaphore_Control *the_semaphore;
- Objects_Locations location;
-
- the_semaphore = _POSIX_Semaphore_Get( sem, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- the_semaphore->open_count -= 1;
- _POSIX_Semaphore_Delete( the_semaphore );
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225
- */
-
-int sem_unlink(
- const char *name
-)
-{
- int status;
- register POSIX_Semaphore_Control *the_semaphore;
- Objects_Id the_semaphore_id;
- Objects_Locations location;
-
- status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id );
-
- if ( !status )
- set_errno_and_return_minus_one( status );
-
- the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
-
- if ( the_semaphore->process_shared == PTHREAD_PROCESS_SHARED ) {
- _Objects_MP_Close(
- &_POSIX_Semaphore_Information,
- the_semaphore->Object.id
- );
- }
-
- the_semaphore->linked = FALSE;
-
- _POSIX_Semaphore_Delete( the_semaphore );
-
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Wait_support
- */
-
-int _POSIX_Semaphore_Wait_support(
- sem_t *sem,
- boolean blocking,
- Watchdog_Interval timeout
-)
-{
- register POSIX_Semaphore_Control *the_semaphore;
- Objects_Locations location;
-
- the_semaphore = _POSIX_Semaphore_Get( sem, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- _CORE_semaphore_Seize(
- &the_semaphore->Semaphore,
- the_semaphore->Object.id,
- blocking,
- timeout
- );
- _Thread_Enable_dispatch();
- return _Thread_Executing->Wait.return_code;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226
- *
- * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27
- */
-
-int sem_wait(
- sem_t *sem
-)
-{
- return _POSIX_Semaphore_Wait_support( sem, TRUE, THREAD_QUEUE_WAIT_FOREVER );
-}
-
-/*PAGE
- *
- * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226
- *
- * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27
- */
-
-int sem_trywait(
- sem_t *sem
-)
-{
- return _POSIX_Semaphore_Wait_support( sem, FALSE, THREAD_QUEUE_WAIT_FOREVER );
-}
-
-/*PAGE
- *
- * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226
- *
- * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27
- */
-
-int sem_timedwait(
- sem_t *sem,
- const struct timespec *timeout
-)
-{
- return _POSIX_Semaphore_Wait_support(
- sem,
- TRUE,
- _POSIX_Timespec_to_interval( timeout )
- );
-}
-
-/*PAGE
- *
- * 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227
- */
-
-void POSIX_Semaphore_MP_support(
- Thread_Control *the_thread,
- Objects_Id id
-)
-{
- (void) POSIX_MP_NOT_IMPLEMENTED();
-}
-
-
-int sem_post(
- sem_t *sem
-)
-{
- register POSIX_Semaphore_Control *the_semaphore;
- Objects_Locations location;
-
- the_semaphore = _POSIX_Semaphore_Get( sem, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- _CORE_semaphore_Surrender(
- &the_semaphore->Semaphore,
- the_semaphore->Object.id,
- POSIX_Semaphore_MP_support
- );
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229
- */
-
-int sem_getvalue(
- sem_t *sem,
- int *sval
-)
-{
- register POSIX_Semaphore_Control *the_semaphore;
- Objects_Locations location;
-
- the_semaphore = _POSIX_Semaphore_Get( sem, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- *sval = _CORE_semaphore_Get_count( &the_semaphore->Semaphore );
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
diff --git a/c/src/exec/posix/src/time.c b/c/src/exec/posix/src/time.c
deleted file mode 100644
index a14eb71f8e..0000000000
--- a/c/src/exec/posix/src/time.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
- * $Id$
- */
-
-#include <assert.h>
-#include <time.h>
-#include <errno.h>
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-
-#include <rtems/posix/seterr.h>
-#include <rtems/posix/time.h>
-
-/*PAGE
- *
- * _POSIX_Timespec_subtract
- */
-
-void _POSIX_Timespec_subtract(
- const struct timespec *the_start,
- const struct timespec *end,
- struct timespec *result
-)
-{
- struct timespec start_struct = *the_start;
- struct timespec *start = &start_struct;
- unsigned int nsecs_per_sec = TOD_NANOSECONDS_PER_SECOND;
-
- if (end->tv_nsec < start->tv_nsec) {
- int seconds = (start->tv_nsec - end->tv_nsec) / nsecs_per_sec + 1;
- start->tv_nsec -= nsecs_per_sec * seconds;
- start->tv_sec += seconds;
- }
-
- if (end->tv_nsec - start->tv_nsec > nsecs_per_sec) {
- int seconds = (start->tv_nsec - end->tv_nsec) / nsecs_per_sec;
- start->tv_nsec += nsecs_per_sec * seconds;
- start->tv_sec -= seconds;
- }
-
- result->tv_sec = end->tv_sec - start->tv_sec;
- result->tv_nsec = end->tv_nsec - start->tv_nsec;
-}
-
-/*PAGE
- *
- * _POSIX_Timespec_to_interval
- */
-
-Watchdog_Interval _POSIX_Timespec_to_interval(
- const struct timespec *time
-)
-{
- Watchdog_Interval ticks;
-
- ticks = (time->tv_sec * TOD_MICROSECONDS_PER_SECOND) /
- _TOD_Microseconds_per_tick;
-
- ticks += (time->tv_nsec / TOD_NANOSECONDS_PER_MICROSECOND) /
- _TOD_Microseconds_per_tick;
-
- if (ticks)
- return ticks;
-
- return 1;
-}
-
-/*PAGE
- *
- * _POSIX_Interval_to_timespec
- */
-
-void _POSIX_Interval_to_timespec(
- Watchdog_Interval ticks,
- struct timespec *time
-)
-{
- unsigned32 usecs;
-
- usecs = ticks * _TOD_Microseconds_per_tick;
-
- time->tv_sec = usecs / TOD_MICROSECONDS_PER_SECOND;
- time->tv_nsec = (usecs % TOD_MICROSECONDS_PER_SECOND) *
- TOD_NANOSECONDS_PER_MICROSECOND;
-}
-
-/*PAGE
- *
- * 4.5.1 Get System Time, P1003.1b-1993, p. 91
- */
-
-/* Using the implementation in newlib */
-#if 0
-time_t time(
- time_t *tloc
-)
-{
- time_t seconds_since_epoch;
-
- /*
- * No error is the time of day is not set. For RTEMS the system time
- * starts out at the rtems epoch.
- */
-
- /*
- * Internally the RTEMS epoch is 1988. This must be taken into account.
- */
-
- seconds_since_epoch = _TOD_Seconds_since_epoch;
-
- seconds_since_epoch += POSIX_TIME_SECONDS_1970_THROUGH_1988;
-
- if ( tloc )
- *tloc = seconds_since_epoch;
-
- return seconds_since_epoch;
-}
-#endif
-
-/*PAGE
- *
- * 14.2.1 Clocks, P1003.1b-1993, p. 263
- */
-
-int clock_settime(
- clockid_t clock_id,
- const struct timespec *tp
-)
-{
- struct tm split_time;
- TOD_Control tod;
- Watchdog_Interval seconds;
-
- assert( tp );
-
- switch ( clock_id ) {
-
- case CLOCK_REALTIME:
- (void) gmtime_r( &tp->tv_sec, &split_time );
-
- /*
- * Convert the tm structure format to that used by the TOD Handler
- *
- * NOTE: TOD Handler does not honor leap seconds.
- */
-
- tod.year = split_time.tm_year + 1900; /* RHS is years since 1900 */
- tod.month = split_time.tm_mon + 1; /* RHS uses 0-11 */
- tod.day = split_time.tm_mday;
- tod.hour = split_time.tm_hour;
- tod.minute = split_time.tm_min;
- tod.second = split_time.tm_sec; /* RHS allows 0-61 for leap seconds */
-
- tod.ticks = (tp->tv_nsec / TOD_NANOSECONDS_PER_MICROSECOND) /
- _TOD_Microseconds_per_tick;
-
- if ( !_TOD_Validate( &tod ) )
- set_errno_and_return_minus_one( EINVAL );
-
- /*
- * We can't use the tp->tv_sec field because it is based on
- * a different EPOCH.
- */
-
- seconds = _TOD_To_seconds( &tod );
- _Thread_Disable_dispatch();
- _TOD_Set( &tod, seconds );
- _Thread_Enable_dispatch();
- break;
-
-#ifdef _POSIX_CPUTIME
- case CLOCK_PROCESS_CPUTIME:
- return POSIX_NOT_IMPLEMENTED();
- break;
-#endif
-
-#ifdef _POSIX_THREAD_CPUTIME
- case CLOCK_THREAD_CPUTIME:
- return POSIX_NOT_IMPLEMENTED();
- break;
-#endif
- default:
- set_errno_and_return_minus_one( EINVAL );
-
- }
- return 0;
-}
-
-/*PAGE
- *
- * 14.2.1 Clocks, P1003.1b-1993, p. 263
- */
-
-int clock_gettime(
- clockid_t clock_id,
- struct timespec *tp
-)
-{
- ISR_Level level;
- time_t seconds;
- long ticks;
-
- if ( !tp )
- set_errno_and_return_minus_one( EINVAL );
-
- switch ( clock_id ) {
-
- case CLOCK_REALTIME:
-
- _ISR_Disable( level );
- seconds = _TOD_Seconds_since_epoch;
- ticks = _TOD_Current.ticks;
- _ISR_Enable( level );
-
- tp->tv_sec = seconds + POSIX_TIME_SECONDS_1970_THROUGH_1988;
- tp->tv_nsec = ticks * _TOD_Microseconds_per_tick *
- TOD_NANOSECONDS_PER_MICROSECOND;
- break;
-
-#ifdef _POSIX_CPUTIME
- case CLOCK_PROCESS_CPUTIME:
- /* don't base this on _Watchdog_Ticks_since_boot--duration is too short*/
- return POSIX_NOT_IMPLEMENTED();
- break;
-#endif
-
-#ifdef _POSIX_THREAD_CPUTIME
- case CLOCK_THREAD_CPUTIME:
- return POSIX_NOT_IMPLEMENTED();
- break;
-#endif
- default:
- set_errno_and_return_minus_one( EINVAL );
-
- }
- return 0;
-}
-
-/*PAGE
- *
- * 14.2.1 Clocks, P1003.1b-1993, p. 263
- */
-
-int clock_getres(
- clockid_t clock_id,
- struct timespec *res
-)
-{
- if ( !res )
- set_errno_and_return_minus_one( EINVAL );
-
- switch ( clock_id ) {
-
- /*
- * All time in rtems is based on the same clock tick.
- */
-
- case CLOCK_REALTIME:
- case CLOCK_PROCESS_CPUTIME:
- case CLOCK_THREAD_CPUTIME:
- if ( res )
- _POSIX_Interval_to_timespec( _TOD_Microseconds_per_tick, res );
- break;
-
- default:
- set_errno_and_return_minus_one( EINVAL );
-
- }
- return 0;
-}
-
-/*PAGE
- *
- * 14.2.5 High Resolution Sleep, P1003.1b-1993, p. 269
- */
-
-int nanosleep(
- const struct timespec *rqtp,
- struct timespec *rmtp
-)
-{
- Watchdog_Interval ticks;
- struct timespec *the_rqtp;
-
- if ( !rqtp )
- set_errno_and_return_minus_one( EINVAL );
-
- the_rqtp = (struct timespec *)rqtp;
-
- /*
- * Return EAGAIN if the delay interval is negative.
- *
- * NOTE: This behavior is beyond the POSIX specification.
- * FSU pthreads shares this behavior.
- */
-
- if ( the_rqtp->tv_sec < 0 )
- the_rqtp->tv_sec = 0;
-
- if ( /* the_rqtp->tv_sec < 0 || */ the_rqtp->tv_nsec < 0 )
- set_errno_and_return_minus_one( EAGAIN );
-
- if ( the_rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
- set_errno_and_return_minus_one( EINVAL );
-
- ticks = _POSIX_Timespec_to_interval( the_rqtp );
-
- /*
- * This behavior is also beyond the POSIX specification but is
- * consistent with the RTEMS api and yields desirable behavior.
- */
-
- if ( !ticks ) {
- _Thread_Yield_processor();
- _Thread_Dispatch();
- if ( rmtp ) {
- rmtp->tv_sec = 0;
- rmtp->tv_nsec = 0;
- }
- return 0;
- }
-
- _Thread_Disable_dispatch();
- _Thread_Set_state(
- _Thread_Executing,
- STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL
- );
- _Watchdog_Initialize(
- &_Thread_Executing->Timer,
- _Thread_Delay_ended,
- _Thread_Executing->Object.id,
- NULL
- );
- _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks );
- _Thread_Enable_dispatch();
-
- /* calculate time remaining */
-
- if ( rmtp ) {
- ticks -=
- _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time;
-
- _POSIX_Interval_to_timespec( ticks, rmtp );
-
- /*
- * If there is time remaining, then we were interrupted by a signal.
- */
-
- if ( ticks )
- set_errno_and_return_minus_one( EINTR );
- }
-
- return 0;
-}
-
-/*PAGE
- *
- * 20.1.3 Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55
- */
-
-int clock_getcpuclockid(
- pid_t pid,
- clockid_t *clock_id
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 20.1.5 CPU-time Clock Attribute Access, P1003.4b/D8, p. 58
- */
-
-int clock_setenable_attr(
- clockid_t clock_id,
- int attr
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 20.1.5 CPU-time Clock Attribute Access, P1003.4b/D8, p. 58
- */
-
-int clock_getenable_attr(
- clockid_t clock_id,
- int *attr
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
diff --git a/c/src/exec/posix/src/types.c b/c/src/exec/posix/src/types.c
deleted file mode 100644
index 4386ad5292..0000000000
--- a/c/src/exec/posix/src/types.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * $Id$
- */
-
-#include <limits.h>
-#include <errno.h>
-#include <string.h>
-#include <sys/types.h>
-
-#include <rtems/system.h>
-#include <rtems/score/object.h>
-#include <rtems/posix/seterr.h>
-
-pid_t _POSIX_types_Ppid = 0;
-uid_t _POSIX_types_Uid = 0;
-uid_t _POSIX_types_Euid = 0;
-gid_t _POSIX_types_Gid = 0;
-gid_t _POSIX_types_Egid = 0;
-
-/*PAGE
- *
- * 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83
- */
-
-pid_t getppid( void )
-{
- return _POSIX_types_Ppid;
-}
-
-/*PAGE
- *
- * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
- * P1003.1b-1993, p. 84
- */
-
-uid_t getuid( void )
-{
- return _POSIX_types_Uid;
-}
-
-/*PAGE
- *
- * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
- * P1003.1b-1993, p. 84
- */
-
-uid_t geteuid( void )
-{
- return _POSIX_types_Euid;
-}
-
-/*PAGE
- *
- * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
- * P1003.1b-1993, p. 84
- */
-
-gid_t getgid( void )
-{
- return _POSIX_types_Gid;
-}
-
-/*PAGE
- *
- * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
- * P1003.1b-1993, p. 84
- */
-
-gid_t getegid( void )
-{
- return _POSIX_types_Egid;
-}
-
-/*PAGE
- *
- * 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
- */
-
-int setuid(
- uid_t uid
-)
-{
- _POSIX_types_Uid = uid;
- return 0;
-}
-
-/*PAGE
- *
- * 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
- */
-
-int setgid(
- gid_t gid
-)
-{
- _POSIX_types_Gid = gid;
- return 0;
-}
-
-/*PAGE
- *
- * 4.2.3 Get Supplementary IDs, P1003.1b-1993, p. 86
- */
-
-int getgroups(
- int gidsetsize,
- gid_t grouplist[]
-)
-{
- return 0; /* no supplemental group ids */
-}
-
-/*PAGE
- *
- * 4.2.4 Get User Name, P1003.1b-1993, p. 87
- *
- * NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
- */
-
-static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];
-
-char *getlogin( void )
-{
- (void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX );
- return _POSIX_types_Getlogin_buffer;
-}
-
-/*PAGE
- *
- * 4.2.4 Get User Name, P1003.1b-1993, p. 87
- *
- * NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
- */
-
-int getlogin_r(
- char *name,
- size_t namesize
-)
-{
- if ( namesize < LOGIN_NAME_MAX )
- return ERANGE;
-
- strcpy( name, "posixapp" );
- return 0;
-}
-
-/*PAGE
- *
- * 4.3.1 Get Process Group IDs, P1003.1b-1993, p. 89
- */
-
-pid_t getpgrp( void )
-{
- /*
- * This always succeeds and returns the process group id. For rtems,
- * this will always be the local node;
- */
-
- return _Objects_Local_node;
-}
-
-/*PAGE
- *
- * 4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88
- */
-
-pid_t setsid( void )
-{
- set_errno_and_return_minus_one( ENOSYS );
-}
-
-/*PAGE
- *
- * 4.3.3 Set Process Group ID for Job Control, P1003.1b-1993, p. 89
- */
-
-int setpgid(
- pid_t pid,
- pid_t pgid
-)
-{
- set_errno_and_return_minus_one( ENOSYS );
-}
-
-/*
- * TEMPORARY
- */
-
-#include <assert.h>
-
-int POSIX_MP_NOT_IMPLEMENTED()
-{
- assert( 0 );
- return 0;
-}
-
-int POSIX_BOTTOM_REACHED()
-{
- assert( 0 );
- return 0;
-}
-
-int POSIX_NOT_IMPLEMENTED()
-{
- assert( 0 );
- return 0;
-}
-
-/*
- * END OF TEMPORARY
- */
-
diff --git a/c/src/exec/posix/src/unistd.c b/c/src/exec/posix/src/unistd.c
deleted file mode 100644
index 8d930ce33c..0000000000
--- a/c/src/exec/posix/src/unistd.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * $Id$
- */
-
-#include <time.h>
-#include <unistd.h>
-
-#include <rtems/system.h>
-
-
-/*
- * 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81
- */
-
-unsigned int sleep(
- unsigned int seconds
-)
-{
- /* XXX can we get away with this implementation? */
- struct timespec tp;
- struct timespec tm;
-
- tp.tv_sec = seconds;
- tp.tv_nsec = 0;
-
- nanosleep( &tp, &tm );
-
- return tm.tv_sec; /* seconds remaining */
-}
-
-/*PAGE
- *
- * 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 95
- */
-
-long sysconf(
- int name
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
diff --git a/c/src/exec/posix/src/utsname.c b/c/src/exec/posix/src/utsname.c
deleted file mode 100644
index 7fba3d610f..0000000000
--- a/c/src/exec/posix/src/utsname.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * $Id$
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <sys/utsname.h>
-
-#include <rtems/system.h>
-#include <rtems/score/system.h>
-#include <rtems/score/object.h>
-
-/*PAGE
- *
- * 4.4.1 Get System Name, P1003.1b-1993, p. 90
- */
-
-int uname(
- struct utsname *name
-)
-{
- /* XXX: Here is what Solaris returns...
- sysname = SunOS
- nodename = node_name
- release = 5.3
- version = Generic_101318-12
- machine = sun4m
- */
-
- strcpy( name->sysname, "RTEMS" );
-
- sprintf( name->nodename, "Node %d\n", _Objects_Local_node );
-
- /* XXX release string is in BAD format for this routine!!! */
- strcpy( name->release, "3.2.0" );
-
- /* XXX does this have any meaning for RTEMS */
-
- strcpy( name->release, "" );
-
- sprintf( name->machine, "%s/%s", CPU_NAME, CPU_MODEL_NAME );
-
- return 0;
-}
-
-/*PAGE
- *
- * 4.5.2 Get Process Times, P1003.1b-1993, p. 92
- */
-
-clock_t times(
- struct tms *buffer
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
diff --git a/c/src/exec/posix/src/wait.c b/c/src/exec/posix/src/wait.c
deleted file mode 100644
index bbef04a2eb..0000000000
--- a/c/src/exec/posix/src/wait.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * waitpid() - POSIX 1003.1b 3.2.1
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <errno.h>
-
-int wait(
- int *stat_loc
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/posix/src/waitpid.c b/c/src/exec/posix/src/waitpid.c
deleted file mode 100644
index f20161b5a9..0000000000
--- a/c/src/exec/posix/src/waitpid.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * wait() - POSIX 1003.1b 3.2.1
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <errno.h>
-
-int wait(
- int *stat_loc
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/exec/posix/sys/Makefile.in b/c/src/exec/posix/sys/Makefile.in
deleted file mode 100644
index d7d9281094..0000000000
--- a/c/src/exec/posix/sys/Makefile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-#H_PIECES=utsname
-H_PIECES=
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-SRCS=$(H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/sys
diff --git a/c/src/exec/posix/sys/utsname.h b/c/src/exec/posix/sys/utsname.h
deleted file mode 100644
index ca15230d40..0000000000
--- a/c/src/exec/posix/sys/utsname.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* sys/utsname.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_SYS_UTSNAME_h
-#define __POSIX_SYS_UTSNAME_h
-
-#include <sys/times.h>
-#include <sys/types.h>
-
-/*
- * 4.4.1 Get System Name (Table 4-1), P1003.1b-1993, p. 90
- *
- * NOTE: The lengths of the strings in this structure are
- * just long enough to reliably contain the RTEMS information.
- * For example, the fields are not long enough to support
- * Internet hostnames.
- */
-
-struct utsname {
- char sysname[ 32 ]; /* Name of this implementation of the operating system */
- char nodename[ 32 ]; /* Name of this node within an implementation */
- /* specified communication network */
- char release[ 32 ]; /* Current release level of this implementation */
- char version[ 32 ]; /* Current version level of this release */
- char machine[ 32 ]; /* Name of the hardware type on which the system */
- /* is running */
-};
-
-/*
- * 4.4.1 Get System Name, P1003.1b-1993, p. 90
- */
-
-int uname(
- struct utsname *name
-);
-
-/*
- * 4.5.2 Get Process Times, P1003.1b-1993, p. 92
- */
-
-clock_t times(
- struct tms *buffer
-);
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/rtems/Makefile.in b/c/src/exec/rtems/Makefile.in
deleted file mode 100644
index 0ef0ca0e76..0000000000
--- a/c/src/exec/rtems/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=headers $(INLINE) optman src
diff --git a/c/src/exec/rtems/headers/Makefile.in b/c/src/exec/rtems/headers/Makefile.in
deleted file mode 100644
index adb4903db8..0000000000
--- a/c/src/exec/rtems/headers/Makefile.in
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_PIECES=asr attr clock config dpmem event eventmp eventset \
- intr message modes mp msgmp options part partmp \
- ratemon region regionmp rtemsapi sem semmp signal signalmp status \
- support taskmp tasks timer types
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-# H_FILES that get installed externally
-EXTERNAL_H_PIECES = rtems
-EXTERNAL_H_FILES=$(EXTERNAL_H_PIECES:%=$(srcdir)/%.h)
-
-SRCS=$(H_FILES) $(EXTERNAL_H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/rtems
- $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
diff --git a/c/src/exec/rtems/headers/asr.h b/c/src/exec/rtems/headers/asr.h
deleted file mode 100644
index 3fac2fa3e3..0000000000
--- a/c/src/exec/rtems/headers/asr.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* asr.h
- *
- * This include file contains all the constants and structures associated
- * with the Asynchronous Signal Handler. This Handler provides the low-level
- * support required by the Signal Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_ASR_h
-#define __RTEMS_ASR_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/modes.h>
-
-/*
- *
- * The following type defines the control block used to manage
- * each signal set.
- */
-
-typedef unsigned32 rtems_signal_set;
-
-/*
- * Return type for ASR Handler
- */
-
-typedef void rtems_asr;
-
-/*
- * The following type corresponds to the applications asynchronous
- * signal processing routine.
- */
-
-typedef rtems_asr ( *rtems_asr_entry )(
- rtems_signal_set
- );
-
-/*
- *
- * The following defines the control structure used to manage
- * signals. Each thread has a copy of this record.
- */
-
-typedef struct {
- boolean is_enabled; /* are ASRs enabled currently? */
- rtems_asr_entry handler; /* address of RTEMS_ASR */
- Modes_Control mode_set; /* RTEMS_ASR mode */
- rtems_signal_set signals_posted; /* signal set */
- rtems_signal_set signals_pending; /* pending signal set */
- unsigned32 nest_level; /* nest level of RTEMS_ASR */
-} ASR_Information;
-
-/*
- * The following constants define the individual signals which may
- * be used to compose a signal set.
- */
-
-#define RTEMS_SIGNAL_0 0x00000001
-#define RTEMS_SIGNAL_1 0x00000002
-#define RTEMS_SIGNAL_2 0x00000004
-#define RTEMS_SIGNAL_3 0x00000008
-#define RTEMS_SIGNAL_4 0x00000010
-#define RTEMS_SIGNAL_5 0x00000020
-#define RTEMS_SIGNAL_6 0x00000040
-#define RTEMS_SIGNAL_7 0x00000080
-#define RTEMS_SIGNAL_8 0x00000100
-#define RTEMS_SIGNAL_9 0x00000200
-#define RTEMS_SIGNAL_10 0x00000400
-#define RTEMS_SIGNAL_11 0x00000800
-#define RTEMS_SIGNAL_12 0x00001000
-#define RTEMS_SIGNAL_13 0x00002000
-#define RTEMS_SIGNAL_14 0x00004000
-#define RTEMS_SIGNAL_15 0x00008000
-#define RTEMS_SIGNAL_16 0x00010000
-#define RTEMS_SIGNAL_17 0x00020000
-#define RTEMS_SIGNAL_18 0x00040000
-#define RTEMS_SIGNAL_19 0x00080000
-#define RTEMS_SIGNAL_20 0x00100000
-#define RTEMS_SIGNAL_21 0x00200000
-#define RTEMS_SIGNAL_22 0x00400000
-#define RTEMS_SIGNAL_23 0x00800000
-#define RTEMS_SIGNAL_24 0x01000000
-#define RTEMS_SIGNAL_25 0x02000000
-#define RTEMS_SIGNAL_26 0x04000000
-#define RTEMS_SIGNAL_27 0x08000000
-#define RTEMS_SIGNAL_28 0x10000000
-#define RTEMS_SIGNAL_29 0x20000000
-#define RTEMS_SIGNAL_30 0x40000000
-#define RTEMS_SIGNAL_31 0x80000000
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/asr.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/attr.h b/c/src/exec/rtems/headers/attr.h
deleted file mode 100644
index 215b27f9a0..0000000000
--- a/c/src/exec/rtems/headers/attr.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* attr.h
- *
- * This include file contains all information about the Object Attributes
- * Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_ATTRIBUTES_h
-#define __RTEMS_ATTRIBUTES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* types */
-
-typedef unsigned32 rtems_attribute;
-
-/* constants */
-
-#define RTEMS_DEFAULT_ATTRIBUTES 0x00000000
-
-#define RTEMS_NO_FLOATING_POINT 0x00000000 /* don't use FP HW */
-#define RTEMS_FLOATING_POINT 0x00000001 /* utilize coprocessor */
-
-#define RTEMS_LOCAL 0x00000000 /* local resource */
-#define RTEMS_GLOBAL 0x00000002 /* global resource */
-
-#define RTEMS_FIFO 0x00000000 /* process RTEMS_FIFO */
-#define RTEMS_PRIORITY 0x00000004 /* process by priority */
-
-#define RTEMS_COUNTING_SEMAPHORE 0x00000000
-#define RTEMS_BINARY_SEMAPHORE 0x00000010
-
-#define RTEMS_NO_INHERIT_PRIORITY 0x00000000
-#define RTEMS_INHERIT_PRIORITY 0x00000020
-
-#define RTEMS_NO_PRIORITY_CEILING 0x00000000
-#define RTEMS_PRIORITY_CEILING 0x00000040
-
-#define RTEMS_APPLICATION_TASK 0x00000000
-#define RTEMS_SYSTEM_TASK 0x00000080
-
-#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
-#define ATTRIBUTES_NOT_SUPPORTED 0
-#else
-#define ATTRIBUTES_NOT_SUPPORTED RTEMS_FLOATING_POINT
-#endif
-
-#if ( CPU_ALL_TASKS_ARE_FP == TRUE )
-#define ATTRIBUTES_REQUIRED RTEMS_FLOATING_POINT
-#else
-#define ATTRIBUTES_REQUIRED 0
-#endif
-
-/*
- * _Attributes_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs initialization for this handler.
- *
- * NOTE: There is no initialization required in C. Conditional compilation
- * takes care of this in C.
- */
-
-#define _Attributes_Handler_initialization()
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/attr.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/clock.h b/c/src/exec/rtems/headers/clock.h
deleted file mode 100644
index c991d769cf..0000000000
--- a/c/src/exec/rtems/headers/clock.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* clock.h
- *
- * This include file contains all the constants and structures associated
- * with the Clock Manager. This manager provides facilities to set, obtain,
- * and continually update the current date and time.
- *
- * This manager provides directives to:
- *
- * + set the current date and time
- * + obtain the current date and time
- * + announce a clock tick
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CLOCK_h
-#define __RTEMS_CLOCK_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/tod.h>
-#include <rtems/rtems/types.h>
-
-/*
- * List of things which can be returned by the rtems_clock_get directive.
- */
-
-typedef enum {
- RTEMS_CLOCK_GET_TOD,
- RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH,
- RTEMS_CLOCK_GET_TICKS_SINCE_BOOT,
- RTEMS_CLOCK_GET_TICKS_PER_SECOND,
- RTEMS_CLOCK_GET_TIME_VALUE
-} rtems_clock_get_options;
-
-/*
- * Standard flavor style to return TOD in for a rtems_clock_get option.
- */
-
-typedef struct {
- unsigned32 seconds;
- unsigned32 microseconds;
-} rtems_clock_time_value;
-
-/*
- * rtems_clock_get
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_clock_get directive. It returns
- * one of the following:
- * + current time of day
- * + seconds since epoch
- * + ticks since boot
- * + ticks per second
- */
-
-rtems_status_code rtems_clock_get(
- rtems_clock_get_options option,
- void *time_buffer
-);
-
-/*
- * rtems_clock_set
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_clock_set directive. It sets
- * the current time of day to that in the time_buffer record.
- */
-
-rtems_status_code rtems_clock_set(
- rtems_time_of_day *time_buffer
-);
-
-/*
- * rtems_clock_tick
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_clock_tick directive. It is invoked
- * to inform RTEMS of the occurrence of a clock tick.
- */
-
-rtems_status_code rtems_clock_tick( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/config.h b/c/src/exec/rtems/headers/config.h
deleted file mode 100644
index f395710271..0000000000
--- a/c/src/exec/rtems/headers/config.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* config.h
- *
- * This include file contains the table of user defined configuration
- * parameters specific for the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_CONFIGURATION_h
-#define __RTEMS_RTEMS_CONFIGURATION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/tasks.h>
-
-/*
- * The following records define the Configuration Table. The
- * information contained in this table is required in all
- * RTEMS systems, whether single or multiprocessor. This
- * table primarily defines the following:
- *
- * + required number of each object type
- */
-
-typedef struct {
- unsigned32 maximum_tasks;
- unsigned32 maximum_timers;
- unsigned32 maximum_semaphores;
- unsigned32 maximum_message_queues;
- unsigned32 maximum_partitions;
- unsigned32 maximum_regions;
- unsigned32 maximum_ports;
- unsigned32 maximum_periods;
- unsigned32 number_of_initialization_tasks;
- rtems_initialization_tasks_table *User_initialization_tasks_table;
-} rtems_api_configuration_table;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/dpmem.h b/c/src/exec/rtems/headers/dpmem.h
deleted file mode 100644
index a74fc90f2a..0000000000
--- a/c/src/exec/rtems/headers/dpmem.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/* dpmem.h
- *
- * This include file contains all the constants and structures associated
- * with the Dual Ported Memory Manager. This manager provides a mechanism
- * for converting addresses between internal and external representations
- * for multiple dual-ported memory areas.
- *
- * Directives provided are:
- *
- * + create a port
- * + get ID of a port
- * + delete a port
- * + convert external to internal address
- * + convert internal to external address
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_DUAL_PORTED_MEMORY_h
-#define __RTEMS_DUAL_PORTED_MEMORY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-
-/*
- * The following structure defines the port control block. Each port
- * has a control block associated with it. This control block contains
- * all information required to support the port related operations.
- */
-
-typedef struct {
- Objects_Control Object;
- void *internal_base; /* base internal address */
- void *external_base; /* base external address */
- unsigned32 length; /* length of dual-ported area */
-} Dual_ported_memory_Control;
-
-/*
- * The following define the internal Dual Ported Memory information.
- */
-
-RTEMS_EXTERN Objects_Information _Dual_ported_memory_Information;
-
-/*
- * _Dual_ported_memory_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Dual_ported_memory_Manager_initialization(
- unsigned32 maximum_ports
-);
-
-/*
- * rtems_port_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_port_create directive. The port
- * will have the name name. The port maps onto an area of dual ported
- * memory of length bytes which has internal_start and external_start
- * as the internal and external starting addresses, respectively.
- * It returns the id of the created port in ID.
- */
-
-rtems_status_code rtems_port_create(
- rtems_name name,
- void *internal_start,
- void *external_start,
- unsigned32 length,
- Objects_Id *id
-);
-
-/*
- * rtems_port_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_port_ident directive. This directive
- * returns the port ID associated with name. If more than one port is
- * named name, then the port to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_port_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_port_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_port_delete directive. It deletes
- * the port associated with ID.
- */
-
-rtems_status_code rtems_port_delete(
- Objects_Id id
-);
-
-/*
- * rtems_port_external_to_internal
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_port_external_to_internal directive.
- * It returns the internal port address which maps to the provided
- * external port address for the specified port ID.
- */
-
-rtems_status_code rtems_port_external_to_internal(
- Objects_Id id,
- void *external,
- void **internal
-);
-
-/*
- * rtems_port_internal_to_external
- *
- * DESCRIPTION:
- *
- * This routine implements the Port_internal_to_external directive.
- * It returns the external port address which maps to the provided
- * internal port address for the specified port ID.
- */
-
-rtems_status_code rtems_port_internal_to_external(
- Objects_Id id,
- void *internal,
- void **external
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/dpmem.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/event.h b/c/src/exec/rtems/headers/event.h
deleted file mode 100644
index 48045bdade..0000000000
--- a/c/src/exec/rtems/headers/event.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/* event.h
- *
- * This include file contains the information pertaining to the Event
- * Manager. This manager provides a high performance method of communication
- * and synchronization.
- *
- * Directives provided are:
- *
- * + send an event set to a task
- * + receive event condition
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_EVENT_h
-#define __RTEMS_EVENT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/rtems/eventset.h>
-
-/*
- * This constant is passed as the event_in to the
- * rtems_event_receive directive to determine which events are pending.
- */
-
-#define EVENT_CURRENT 0
-
-/*
- * The following enumerated types indicate what happened while the event
- * manager was in the synchronization window.
- */
-
-typedef enum {
- EVENT_SYNC_SYNCHRONIZED,
- EVENT_SYNC_NOTHING_HAPPENED,
- EVENT_SYNC_TIMEOUT,
- EVENT_SYNC_SATISFIED
-} Event_Sync_states;
-
-/*
- * Event_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Event_Manager_initialization( void );
-
-/*
- * rtems_event_send
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_event_send directive. It sends
- * event_in to the task specified by ID. If the task is blocked
- * waiting to receive events and the posting of event_in satisfies
- * the task's event condition, then it is unblocked.
- */
-
-rtems_status_code rtems_event_send (
- Objects_Id id,
- rtems_event_set event_in
-);
-
-/*
- * rtems_event_receive
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_event_receive directive. This
- * directive is invoked when the calling task wishes to receive
- * the event_in event condition. One of the fields in the option_set
- * parameter determines whether the receive request is satisfied if
- * any or all of the events are pending. If the event condition
- * is not satisfied immediately, then the task may block with an
- * optional timeout of TICKS clock ticks or return immediately.
- * This determination is based on another field in the option_set
- * parameter. This directive returns the events received in the
- * event_out parameter.
- */
-
-rtems_status_code rtems_event_receive (
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-);
-
-/*
- * _Event_Seize
- *
- * DESCRIPTION:
- *
- * This routine determines if the event condition event_in is
- * satisfied. If so or if the no_wait option is enabled in option_set,
- * then the procedure returns immediately. If neither of these
- * conditions is true, then the calling task is blocked with an
- * optional timeout of ticks clock ticks.
- */
-
-void _Event_Seize (
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-);
-
-/*
- * _Event_Surrender
- *
- * DESCRIPTION:
- *
- * This routine determines if the event condition of the_thread
- * has been satisfied. If so, it unblocks the_thread.
- */
-
-void _Event_Surrender (
- Thread_Control *the_thread
-);
-
-/*
- * _Event_Timeout
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task's event receive request
- * has not been satisfied after the specified timeout interval.
- * The task represented by ID will be unblocked and its status
- * code will be set in it's control block to indicate that a timeout
- * has occurred.
- */
-
-void _Event_Timeout (
- Objects_Id id,
- void *ignored
-);
-
-/*
- * The following defines the synchronization flag used by the
- * Event Manager to insure that signals sent to the currently
- * executing thread are received properly.
- */
-
-RTEMS_EXTERN volatile Event_Sync_states _Event_Sync_state;
-
-#include <rtems/rtems/eventmp.h>
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/event.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/eventmp.h b/c/src/exec/rtems/headers/eventmp.h
deleted file mode 100644
index 2d609cbb37..0000000000
--- a/c/src/exec/rtems/headers/eventmp.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* eventmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Event Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_EVENT_MP_h
-#define __RTEMS_EVENT_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/event.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote event operations.
- */
-
-typedef enum {
- EVENT_MP_SEND_REQUEST = 0,
- EVENT_MP_SEND_RESPONSE = 1
-} Event_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote event operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Event_MP_Remote_operations operation;
- rtems_event_set event_in;
-} Event_MP_Packet;
-
-/*
- * _Event_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- *
- * This routine is not needed since there are no process
- * packets to be sent by this manager.
- */
-
-/*
- * _Event_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Event_MP_Send_request_packet (
- Event_MP_Remote_operations operation,
- Objects_Id event_id,
- rtems_event_set event_in
-);
-
-/*
- * _Event_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Event_MP_Send_response_packet (
- Event_MP_Remote_operations operation,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Event_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Event_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Event_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _Event_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _Event_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a event mp packet.
- */
-
-Event_MP_Packet *_Event_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/rtems/headers/eventset.h b/c/src/exec/rtems/headers/eventset.h
deleted file mode 100644
index fe1f9eb170..0000000000
--- a/c/src/exec/rtems/headers/eventset.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* eventset.h
- *
- * This include file contains the information pertaining to the
- * Event Sets Handler. This handler provides methods for the manipulation
- * of event sets which will be sent and received by tasks.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_EVENT_SET_h
-#define __RTEMS_EVENT_SET_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following defines the type used to control event sets.
- */
-
-typedef unsigned32 rtems_event_set;
-
-/*
- * The following constants define the individual events which may
- * be used to compose an event set.
- */
-
-#define RTEMS_PENDING_EVENTS 0 /* receive pending events */
-#define RTEMS_ALL_EVENTS 0xFFFFFFFF
-
-#define RTEMS_EVENT_0 0x00000001
-#define RTEMS_EVENT_1 0x00000002
-#define RTEMS_EVENT_2 0x00000004
-#define RTEMS_EVENT_3 0x00000008
-#define RTEMS_EVENT_4 0x00000010
-#define RTEMS_EVENT_5 0x00000020
-#define RTEMS_EVENT_6 0x00000040
-#define RTEMS_EVENT_7 0x00000080
-#define RTEMS_EVENT_8 0x00000100
-#define RTEMS_EVENT_9 0x00000200
-#define RTEMS_EVENT_10 0x00000400
-#define RTEMS_EVENT_11 0x00000800
-#define RTEMS_EVENT_12 0x00001000
-#define RTEMS_EVENT_13 0x00002000
-#define RTEMS_EVENT_14 0x00004000
-#define RTEMS_EVENT_15 0x00008000
-#define RTEMS_EVENT_16 0x00010000
-#define RTEMS_EVENT_17 0x00020000
-#define RTEMS_EVENT_18 0x00040000
-#define RTEMS_EVENT_19 0x00080000
-#define RTEMS_EVENT_20 0x00100000
-#define RTEMS_EVENT_21 0x00200000
-#define RTEMS_EVENT_22 0x00400000
-#define RTEMS_EVENT_23 0x00800000
-#define RTEMS_EVENT_24 0x01000000
-#define RTEMS_EVENT_25 0x02000000
-#define RTEMS_EVENT_26 0x04000000
-#define RTEMS_EVENT_27 0x08000000
-#define RTEMS_EVENT_28 0x10000000
-#define RTEMS_EVENT_29 0x20000000
-#define RTEMS_EVENT_30 0x40000000
-#define RTEMS_EVENT_31 0x80000000
-
-
-/*
- * The following constant is the value of an event set which
- * has no events pending.
- */
-
-#define EVENT_SETS_NONE_PENDING 0
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/eventset.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/intr.h b/c/src/exec/rtems/headers/intr.h
deleted file mode 100644
index 168806bff2..0000000000
--- a/c/src/exec/rtems/headers/intr.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/* intr.h
- *
- * This include file contains all the constants and structures associated
- * with the Interrupt Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_INTERRUPT_h
-#define __RTEMS_INTERRUPT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/isr.h>
-
-/*
- * Interrupt level type
- */
-
-typedef ISR_Level rtems_interrupt_level;
-
-/*
- * The following type defines the control block used to manage
- * the vectors.
- */
-
-typedef ISR_Vector_number rtems_vector_number;
-
-/*
- * Return type for ISR Handler
- */
-
-typedef void rtems_isr;
-
-/*
- * Pointer to an ISR Handler
- */
-
-typedef rtems_isr ( *rtems_isr_entry )(
- rtems_vector_number
- );
-
-/*
- * _Interrupt_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the interrupt manager.
- *
- */
-
-void _Interrupt_Manager_initialization( void );
-
-/*
- * rtems_interrupt_catch
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_interrupt_catch directive. This
- * directive installs new_isr_handler as the RTEMS interrupt service
- * routine for vector. The previous RTEMS interrupt service
- * routine is returned in old_isr_handler.
- */
-
-rtems_status_code rtems_interrupt_catch(
- rtems_isr_entry new_isr_handler,
- rtems_vector_number vector,
- rtems_isr_entry *old_isr_handler
-);
-
-/*
- * rtems_interrupt_disable
- *
- * DESCRIPTION:
- *
- * This routine disables all maskable interrupts and returns the
- * previous level in _isr_cookie.
- */
-
-#define rtems_interrupt_disable( _isr_cookie ) \
- _ISR_Disable(_isr_cookie)
-
-/*
- * rtems_interrupt_enable
- *
- * DESCRIPTION:
- *
- * This routine enables maskable interrupts to the level indicated
- * _isr_cookie.
- */
-
-#define rtems_interrupt_enable( _isr_cookie ) \
- _ISR_Enable(_isr_cookie)
-
-/*
- * rtems_interrupt_flash
- *
- * DESCRIPTION:
- *
- * This routine temporarily enables maskable interrupts to the
- * level in _isr_cookie before redisabling them.
- */
-
-#define rtems_interrupt_flash( _isr_cookie ) \
- _ISR_Flash(_isr_cookie)
-
-/*
- * rtems_interrupt_is_in_progress
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the processor is currently servicing
- * an interrupt and FALSE otherwise. A return value of TRUE indicates
- * that the caller is an interrupt service routine, NOT a thread. The
- * directives available to an interrupt service routine are restricted.
- */
-
-#define rtems_interrupt_is_in_progress() \
- _ISR_Is_in_progress()
-
-/*
- * rtems_interrupt_cause
- *
- * DESCRIPTION:
- *
- * This routine generates an interrupt.
- *
- * NOTE: No implementation.
- */
-
-#define rtems_interrupt_cause( _interrupt_to_cause )
-
-/*
- * rtems_interrupt_cause
- *
- * DESCRIPTION:
- *
- * This routine clears the specified interrupt.
- *
- * NOTE: No implementation.
- */
-
-#define rtems_interrupt_clear( _interrupt_to_clear )
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/message.h b/c/src/exec/rtems/headers/message.h
deleted file mode 100644
index 611d46fde8..0000000000
--- a/c/src/exec/rtems/headers/message.h
+++ /dev/null
@@ -1,334 +0,0 @@
-/* message.h
- *
- * This include file contains all the constants and structures associated
- * with the Message Queue Manager. This manager provides a mechanism for
- * communication and synchronization between tasks using messages.
- *
- * Directives provided are:
- *
- * + create a queue
- * + get ID of a queue
- * + delete a queue
- * + put a message at the rear of a queue
- * + put a message at the front of a queue
- * + broadcast N messages to a queue
- * + receive message from a queue
- * + flush all messages on a queue
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MESSAGE_QUEUE_h
-#define __RTEMS_MESSAGE_QUEUE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/coremsg.h>
-
-/*
- * The following enumerated type details the modes in which a message
- * may be submitted to a message queue. The message may be posted
- * in a send or urgent fashion.
- */
-
-typedef enum {
- MESSAGE_QUEUE_SEND_REQUEST = 0,
- MESSAGE_QUEUE_URGENT_REQUEST = 1
-} Message_queue_Submit_types;
-
-/*
- * The following records define the control block used to manage
- * each message queue.
- */
-
-typedef struct {
- Objects_Control Object;
- rtems_attribute attribute_set;
- CORE_message_queue_Control message_queue;
-} Message_queue_Control;
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Message_queue_Information;
-
-/*
- * _Message_queue_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Message_queue_Manager_initialization(
- unsigned32 maximum_message_queues
-);
-
-/*
- * rtems_message_queue_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_create directive. The
- * message queue will have the name name. If the attribute_set indicates
- * that the message queue is to be limited in the number of messages
- * that can be outstanding, then count indicates the maximum number of
- * messages that will be held. It returns the id of the created
- * message queue in ID.
- */
-
-rtems_status_code rtems_message_queue_create(
- rtems_name name,
- unsigned32 count,
- unsigned32 max_message_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-);
-
-/*
- * rtems_message_queue_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_ident directive.
- * This directive returns the message queue ID associated with NAME.
- * If more than one message queue is named name, then the message
- * queue to which the ID belongs is arbitrary. node indicates the
- * extent of the search for the ID of the message queue named name.
- * The search can be limited to a particular node or allowed to
- * encompass all nodes.
- */
-
-rtems_status_code rtems_message_queue_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-);
-
-/*
- * rtems_message_queue_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_delete directive. The
- * message queue indicated by ID is deleted.
- */
-
-rtems_status_code rtems_message_queue_delete(
- Objects_Id id
-);
-
-/*
- * rtems_message_queue_send
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_send directive.
- * This directive sends the message buffer to the message queue
- * indicated by ID. If one or more tasks is blocked waiting
- * to receive a message from this message queue, then one will
- * receive the message. The task selected to receive the
- * message is based on the task queue discipline algorithm in
- * use by this particular message queue. If no tasks are waiting,
- * then the message buffer will be placed at the rear of the
- * chain of pending messages for this message queue.
- */
-
-rtems_status_code rtems_message_queue_send(
- Objects_Id id,
- void *buffer,
- unsigned32 size
-);
-
-/*
- * rtems_message_queue_urgent
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_send directive.
- * This directive sends the message buffer to the message queue
- * indicated by ID. If one or more tasks is blocked waiting
- * to receive a message from this message queue, then one will
- * receive the message. The task selected to receive the
- * message is based on the task queue discipline algorithm in
- * use by this particular message queue. If no tasks are waiting,
- * then the message buffer will be placed at the rear of the
- * chain of pending messages for this message queue.
- */
-
-rtems_status_code rtems_message_queue_urgent(
- Objects_Id id,
- void *buffer,
- unsigned32 size
-);
-
-/*
- * rtems_message_queue_broadcast
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_send directive.
- * This directive sends the message buffer to the message queue
- * indicated by ID. If one or more tasks is blocked waiting
- * to receive a message from this message queue, then one will
- * receive the message. The task selected to receive the
- * message is based on the task queue discipline algorithm in
- * use by this particular message queue. If no tasks are waiting,
- * then the message buffer will be placed at the rear of the
- * chain of pending messages for this message queue.
- */
-
-rtems_status_code rtems_message_queue_broadcast(
- Objects_Id id,
- void *buffer,
- unsigned32 size,
- unsigned32 *count
-);
-
-/*
- * rtems_message_queue_receive
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_receive directive.
- * This directive is invoked when the calling task wishes to receive
- * a message from the message queue indicated by ID. The received
- * message is to be placed in buffer. If no messages are outstanding
- * and the option_set indicates that the task is willing to block,
- * then the task will be blocked until a message arrives or until,
- * optionally, timeout clock ticks have passed.
- */
-
-rtems_status_code rtems_message_queue_receive(
- Objects_Id id,
- void *buffer,
- unsigned32 *size,
- unsigned32 option_set,
- rtems_interval timeout
-);
-
-/*
- * rtems_message_queue_flush
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_flush directive.
- * This directive takes all outstanding messages for the message
- * queue indicated by ID and returns them to the inactive message
- * chain. The number of messages flushed is returned in COUNT.
- */
-
-rtems_status_code rtems_message_queue_flush(
- Objects_Id id,
- unsigned32 *count
-);
-
-/*
- * rtems_message_queue_get_number_pending
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_get_number_pending
- * directive. This directive returns the number of pending
- * messages for the message queue indicated by ID
- * chain. The number of messages pending is returned in COUNT.
- */
-
-rtems_status_code rtems_message_queue_get_number_pending(
- Objects_Id id,
- unsigned32 *count
-);
-
-
-/*
- * _Message_queue_Submit
- *
- * DESCRIPTION:
- *
- * This routine implements the directives rtems_message_queue_send
- * and rtems_message_queue_urgent. It processes a message that is
- * to be submitted to the designated message queue. The message will
- * either be processed as a send send message which it will be inserted
- * at the rear of the queue or it will be processed as an urgent message
- * which will be inserted at the front of the queue.
- */
-
-rtems_status_code _Message_queue_Submit(
- Objects_Id id,
- void *buffer,
- unsigned32 size,
- Message_queue_Submit_types submit_type
-);
-
-/*
- * _Message_queue_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a message queue control block from
- * the inactive chain of free message queue control blocks.
- */
-
-Message_queue_Control *_Message_queue_Allocate (
- unsigned32 count,
- unsigned32 max_message_size
-);
-
-/*
- * _Message_queue_Translate_core_message_queue_return_code
- *
- * DESCRIPTION:
- *
- * This function returns a RTEMS status code based on the core message queue
- * status code specified.
- */
-
-rtems_status_code _Message_queue_Translate_core_message_queue_return_code (
- unsigned32 the_message_queue_status
-);
-
-/*
- *
- * _Message_queue_Core_message_queue_mp_support
- *
- * Input parameters:
- * the_thread - the remote thread the message was submitted to
- * id - id of the message queue
- *
- * Output parameters: NONE
- */
-
-void _Message_queue_Core_message_queue_mp_support (
- Thread_Control *the_thread,
- Objects_Id id
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/message.inl>
-#endif
-#include <rtems/rtems/msgmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/modes.h b/c/src/exec/rtems/headers/modes.h
deleted file mode 100644
index 05205078c5..0000000000
--- a/c/src/exec/rtems/headers/modes.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* modes.h
- *
- * This include file contains all constants and structures associated
- * with the RTEMS thread and RTEMS_ASR modes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MODES_h
-#define __RTEMS_MODES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/isr.h>
-
-/*
- * The following type defines the control block used to manage
- * each a mode set.
- */
-
-typedef unsigned32 Modes_Control;
-
-/*
- * The following constants define the individual modes and masks
- * which may be used to compose a mode set and to alter modes.
- */
-
-#define RTEMS_ALL_MODE_MASKS 0x0000ffff
-
-#define RTEMS_DEFAULT_MODES 0x00000000
-#define RTEMS_CURRENT_MODE 0
-
-#define RTEMS_PREEMPT_MASK 0x00000100 /* preemption bit */
-#define RTEMS_TIMESLICE_MASK 0x00000200 /* timeslice bit */
-#define RTEMS_ASR_MASK 0x00000400 /* RTEMS_ASR enable bit */
-#define RTEMS_INTERRUPT_MASK CPU_MODES_INTERRUPT_MASK
-
-#define RTEMS_PREEMPT 0x00000000 /* enable preemption */
-#define RTEMS_NO_PREEMPT 0x00000100 /* disable preemption */
-
-#define RTEMS_NO_TIMESLICE 0x00000000 /* disable timeslicing */
-#define RTEMS_TIMESLICE 0x00000200 /* enable timeslicing */
-
-#define RTEMS_ASR 0x00000000 /* enable RTEMS_ASR */
-#define RTEMS_NO_ASR 0x00000400 /* disable RTEMS_ASR */
-
-/*
- * The number of bits for interrupt levels is CPU dependent.
- * RTEMS supports 0 to 256 levels in bits 0-7 of the mode.
- */
-
-/*PAGE
- *
- * RTEMS_INTERRUPT_LEVEL
- *
- * DESCRIPTION:
- *
- * This function returns the processor dependent interrupt
- * level which corresponds to the requested interrupt level.
- *
- * NOTE: RTEMS supports 256 interrupt levels using the least
- * significant eight bits of MODES.CONTROL. On any
- * particular CPU, fewer than 256 levels may be supported.
- */
-
-#define RTEMS_INTERRUPT_LEVEL( _mode_set ) \
- ( (_mode_set) & RTEMS_INTERRUPT_MASK )
-
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/modes.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/mp.h b/c/src/exec/rtems/headers/mp.h
deleted file mode 100644
index 77dd8a707f..0000000000
--- a/c/src/exec/rtems/headers/mp.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* mp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MP_h
-#define __RTEMS_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- *
- * _Multiprocessing_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Multiprocessing_Manager_initialization ( void );
-
-/*
- *
- * rtems_multiprocessing_announce
- *
- * DESCRIPTION:
- *
- * This routine implements the MULTIPROCESSING_ANNOUNCE directive.
- * It is invoked by the MPCI layer to indicate that an MPCI packet
- * has been received.
- */
-
-void rtems_multiprocessing_announce ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/msgmp.h b/c/src/exec/rtems/headers/msgmp.h
deleted file mode 100644
index 64fa8da93b..0000000000
--- a/c/src/exec/rtems/headers/msgmp.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/* msgmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Message Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MESSAGE_QUEUE_MP_h
-#define __RTEMS_MESSAGE_QUEUE_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/message.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote message queue operations.
- */
-
-typedef enum {
- MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0,
- MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1,
- MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2,
- MESSAGE_QUEUE_MP_RECEIVE_REQUEST = 3,
- MESSAGE_QUEUE_MP_RECEIVE_RESPONSE = 4,
- MESSAGE_QUEUE_MP_SEND_REQUEST = 5,
- MESSAGE_QUEUE_MP_SEND_RESPONSE = 6,
- MESSAGE_QUEUE_MP_URGENT_REQUEST = 7,
- MESSAGE_QUEUE_MP_URGENT_RESPONSE = 8,
- MESSAGE_QUEUE_MP_BROADCAST_REQUEST = 9,
- MESSAGE_QUEUE_MP_BROADCAST_RESPONSE = 10,
- MESSAGE_QUEUE_MP_FLUSH_REQUEST = 11,
- MESSAGE_QUEUE_MP_FLUSH_RESPONSE = 12,
- MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST = 13,
- MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE = 14
-} Message_queue_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote message queue operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Message_queue_MP_Remote_operations operation;
- rtems_name name;
- rtems_option option_set;
- Objects_Id proxy_id;
- unsigned32 count;
- unsigned32 size;
- unsigned32 pad0;
- CORE_message_queue_Buffer Buffer;
-} Message_queue_MP_Packet;
-
-/*
- * _Message_queue_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _Message_queue_MP_Send_process_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- rtems_name name,
- Objects_Id proxy_id
-);
-
-/*
- * _Message_queue_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Message_queue_MP_Send_request_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- void *buffer,
- unsigned32 *size_p,
- rtems_option option_set,
- Watchdog_Interval timeout
-);
-
-/*
- * _Message_queue_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Message_queue_MP_Send_response_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Message_queue_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Message_queue_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Message_queue_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _Message_queue_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _Message_queue_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _Message_queue_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _Message_queue_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a message queue mp packet.
- */
-
-Message_queue_MP_Packet *_Message_queue_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/rtems/headers/options.h b/c/src/exec/rtems/headers/options.h
deleted file mode 100644
index 7746524f98..0000000000
--- a/c/src/exec/rtems/headers/options.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* options.h
- *
- * This include file contains information which defines the
- * options available on many directives.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_OPTIONS_h
-#define __RTEMS_OPTIONS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type defines the control block used to manage
- * option sets.
- */
-
-typedef unsigned32 rtems_option;
-
-/*
- * The following constants define the individual options which may
- * be used to compose an option set.
- */
-
-#define RTEMS_DEFAULT_OPTIONS 0x00000000
-
-#define RTEMS_WAIT 0x00000000 /* wait on resource */
-#define RTEMS_NO_WAIT 0x00000001 /* do not wait on resource */
-
-#define RTEMS_EVENT_ALL 0x00000000 /* wait for all events */
-#define RTEMS_EVENT_ANY 0x00000002 /* wait on any event */
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/options.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/part.h b/c/src/exec/rtems/headers/part.h
deleted file mode 100644
index 1d720db146..0000000000
--- a/c/src/exec/rtems/headers/part.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/* partition.h
- *
- * This include file contains all the constants and structures associated
- * with the Partition Manager. This manager provides facilities to
- * dynamically allocate memory in fixed-sized units which are returned
- * as buffers.
- *
- * Directives provided are:
- *
- * + create a partition
- * + get an ID of a partition
- * + delete a partition
- * + get a buffer from a partition
- * + return a buffer to a partition
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_PARTITION_h
-#define __RTEMS_PARTITION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/address.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/rtems/types.h>
-
-/*
- * The following defines the control block used to manage each partition.
- */
-
-typedef struct {
- Objects_Control Object;
- void *starting_address; /* physical address */
- unsigned32 length; /* in bytes */
- unsigned32 buffer_size; /* in bytes */
- rtems_attribute attribute_set; /* attributes */
- unsigned32 number_of_used_blocks; /* or allocated buffers */
- Chain_Control Memory; /* buffer chain */
-} Partition_Control;
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Partition_Information;
-
-/*
- * _Partition_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Partition_Manager_initialization(
- unsigned32 maximum_partitions
-);
-
-/*
- * rtems_partition_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_create directive. The
- * partition will have the name name. The memory area managed by
- * the partition is of length bytes and starts at starting_address.
- * The memory area will be divided into as many buffers of
- * buffer_size bytes as possible. The attribute_set determines if
- * the partition is global or local. It returns the id of the
- * created partition in ID.
- */
-
-rtems_status_code rtems_partition_create(
- rtems_name name,
- void *starting_address,
- unsigned32 length,
- unsigned32 buffer_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-);
-
-/*
- * rtems_partition_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_ident directive.
- * This directive returns the partition ID associated with name.
- * If more than one partition is named name, then the partition
- * to which the ID belongs is arbitrary. node indicates the
- * extent of the search for the ID of the partition named name.
- * The search can be limited to a particular node or allowed to
- * encompass all nodes.
- */
-
-rtems_status_code rtems_partition_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-);
-
-/*
- * rtems_partition_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_delete directive. The
- * partition indicated by ID is deleted.
- */
-
-rtems_status_code rtems_partition_delete(
- Objects_Id id
-);
-
-/*
- * rtems_partition_get_buffer
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_get_buffer directive. It
- * attempts to allocate a buffer from the partition associated with ID.
- * If a buffer is allocated, its address is returned in buffer.
- */
-
-rtems_status_code rtems_partition_get_buffer(
- Objects_Id id,
- void **buffer
-);
-
-/*
- * rtems_partition_return_buffer
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_return_buffer directive. It
- * frees the buffer to the partition associated with ID. The buffer must
- * have been previously allocated from the same partition.
- */
-
-rtems_status_code rtems_partition_return_buffer(
- Objects_Id id,
- void *buffer
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/part.inl>
-#endif
-#include <rtems/rtems/partmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/partmp.h b/c/src/exec/rtems/headers/partmp.h
deleted file mode 100644
index 0bac39258b..0000000000
--- a/c/src/exec/rtems/headers/partmp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* partmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Partition Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_PARTITION_MP_h
-#define __RTEMS_PARTITION_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/thread.h>
-
-#include <rtems/rtems/part.h>
-
-/*
- * The following enumerated type defines the list of
- * remote partition operations.
- */
-
-typedef enum {
- PARTITION_MP_ANNOUNCE_CREATE = 0,
- PARTITION_MP_ANNOUNCE_DELETE = 1,
- PARTITION_MP_EXTRACT_PROXY = 2,
- PARTITION_MP_GET_BUFFER_REQUEST = 3,
- PARTITION_MP_GET_BUFFER_RESPONSE = 4,
- PARTITION_MP_RETURN_BUFFER_REQUEST = 5,
- PARTITION_MP_RETURN_BUFFER_RESPONSE = 6
-} Partition_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote partition operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Partition_MP_Remote_operations operation;
- rtems_name name;
- void *buffer;
- Objects_Id proxy_id;
-} Partition_MP_Packet;
-
-/*
- * _Partition_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _Partition_MP_Send_process_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- rtems_name name,
- Objects_Id proxy_id
-);
-
-/*
- * _Partition_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Partition_MP_Send_request_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- void *buffer
-);
-
-/*
- * _Partition_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Partition_MP_Send_response_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Partition_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Partition_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Partition_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed by the Partition since a partition
- * cannot be deleted when buffers are in use.
- */
-
-/*
- * _Partition_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _Partition_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _Partition_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a partition mp packet.
- */
-
-Partition_MP_Packet *_Partition_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/rtems/headers/ratemon.h b/c/src/exec/rtems/headers/ratemon.h
deleted file mode 100644
index 0e1dfbfad3..0000000000
--- a/c/src/exec/rtems/headers/ratemon.h
+++ /dev/null
@@ -1,213 +0,0 @@
-/* ratemon.h
- *
- * This include file contains all the constants, structures, and
- * prototypes associated with the Rate Monotonic Manager. This manager
- * provides facilities to implement tasks which execute in a periodic fashion.
- *
- * Directives provided are:
- *
- * + create a rate monotonic timer
- * + cancel a period
- * + delete a rate monotonic timer
- * + conclude current and start the next period
- * + obtain status information on a period
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RATE_MONOTONIC_h
-#define __RTEMS_RATE_MONOTONIC_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the states in which a
- * period may be.
- */
-
-typedef enum {
- RATE_MONOTONIC_INACTIVE, /* off chain, never initialized */
- RATE_MONOTONIC_OWNER_IS_BLOCKING, /* on chain, owner is blocking on it */
- RATE_MONOTONIC_ACTIVE, /* on chain, running continuously */
- RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING, /* on chain, expired while owner was */
- /* was blocking on it */
- RATE_MONOTONIC_EXPIRED /* off chain, will be reset by next */
- /* rtems_rate_monotonic_period */
-} rtems_rate_monotonic_period_states;
-
-/*
- * The following constant is the interval passed to the rate_monontonic_period
- * directive to obtain status information.
- */
-
-#define RTEMS_PERIOD_STATUS WATCHDOG_NO_TIMEOUT
-
-/*
- * The following defines the period status structure.
- */
-
-typedef struct {
- rtems_rate_monotonic_period_states state;
- unsigned32 ticks_since_last_period;
- unsigned32 ticks_executed_since_last_period;
-} rtems_rate_monotonic_period_status;
-
-/*
- * The following structure defines the control block used to manage
- * each period.
- */
-
-typedef struct {
- Objects_Control Object;
- Watchdog_Control Timer;
- rtems_rate_monotonic_period_states state;
- unsigned32 owner_ticks_executed_at_period;
- unsigned32 time_at_period;
- Thread_Control *owner;
-} Rate_monotonic_Control;
-
-RTEMS_EXTERN Objects_Information _Rate_monotonic_Information;
-
-/*
- * _Rate_monotonic_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Rate_monotonic_Manager_initialization(
- unsigned32 maximum_periods
-);
-
-/*
- * rtems_rate_monotonic_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rate_monotonic_create directive. The
- * period will have the name name. It returns the id of the
- * created period in ID.
- */
-
-rtems_status_code rtems_rate_monotonic_create(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_rate_monotonic_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_ident directive.
- * This directive returns the period ID associated with name.
- * If more than one period is named name, then the period
- * to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_rate_monotonic_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_rate_monotonic_cancel
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_cancel directive. This
- * directive stops the period associated with ID from continuing to
- * run.
- */
-
-rtems_status_code rtems_rate_monotonic_cancel(
- Objects_Id id
-);
-
-/*
- * rtems_rate_monotonic_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_delete directive. The
- * period indicated by ID is deleted.
- */
-
-rtems_status_code rtems_rate_monotonic_delete(
- Objects_Id id
-);
-
-/*
- * rtems_rate_monotonic_get_status
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_get_status directive.
- * Information about the period indicated by ID is returned.
- *
- */
-
-rtems_status_code rtems_rate_monotonic_get_status(
- Objects_Id id,
- rtems_rate_monotonic_period_status *status
-);
-
-/*
- * rtems_rate_monotonic_period
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_period directive. When
- * length is non-zero, this directive initiates the period associated with
- * ID from continuing for a period of length. If length is zero, then
- * result is set to indicate the current state of the period.
- */
-
-rtems_status_code rtems_rate_monotonic_period(
- Objects_Id id,
- rtems_interval length
-);
-
-/*
- * _Rate_monotonic_Timeout
- *
- * DESCRIPTION:
- *
- * This routine is invoked when the period represented
- * by ID expires. If the task which owns this period is blocked
- * waiting for the period to expire, then it is readied and the
- * period is restarted. If the owning task is not waiting for the
- * period to expire, then the period is placed in the EXPIRED
- * state and not restarted.
- */
-
-void _Rate_monotonic_Timeout (
- Objects_Id id,
- void *ignored
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/ratemon.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/region.h b/c/src/exec/rtems/headers/region.h
deleted file mode 100644
index 05418f6a95..0000000000
--- a/c/src/exec/rtems/headers/region.h
+++ /dev/null
@@ -1,234 +0,0 @@
-/* region.h
- *
- * This include file contains all the constants and structures associated
- * with the Region Manager. This manager provides facilities to dynamically
- * allocate memory in variable sized units which are returned as segments.
- *
- * Directives provided are:
- *
- * + create a region
- * + get an ID of a region
- * + delete a region
- * + get a segment from a region
- * + return a segment to a region
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_REGION_h
-#define __RTEMS_REGION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/heap.h>
-#include <rtems/debug.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/rtems/types.h>
-
-/*
- * The following records define the control block used to manage
- * each region.
- */
-
-typedef struct {
- Objects_Control Object;
- Thread_queue_Control Wait_queue; /* waiting threads */
- void *starting_address; /* physical start addr */
- unsigned32 length; /* physical length(bytes) */
- unsigned32 page_size; /* in bytes */
- unsigned32 maximum_segment_size; /* in bytes */
- rtems_attribute attribute_set;
- unsigned32 number_of_used_blocks; /* blocks allocated */
- Heap_Control Memory;
-} Region_Control;
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Region_Information;
-
-/*
- * _Region_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Region_Manager_initialization(
- unsigned32 maximum_regions
-);
-
-/*
- * rtems_region_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_create directive. The
- * region will have the name name. The memory area managed by
- * the region is of length bytes and starts at starting_address.
- * The memory area will be divided into as many allocatable units of
- * page_size bytes as possible. The attribute_set determines which
- * thread queue discipline is used by the region. It returns the
- * id of the created region in ID.
- */
-
-rtems_status_code rtems_region_create(
- rtems_name name,
- void *starting_address,
- unsigned32 length,
- unsigned32 page_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-);
-
-/*
- * rtems_region_extend
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_extend directive. The
- * region will have the name name. The memory area managed by
- * the region will be attempted to be grown by length bytes using
- * the memory starting at starting_address.
- */
-
-rtems_status_code rtems_region_extend(
- Objects_Id id,
- void *starting_address,
- unsigned32 length
-);
-
-/*
- * rtems_region_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_ident directive.
- * This directive returns the region ID associated with name.
- * If more than one region is named name, then the region
- * to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_region_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_region_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_delete directive. The
- * region indicated by ID is deleted.
- */
-
-rtems_status_code rtems_region_delete(
- Objects_Id id
-);
-
-/*
- * rtems_region_get_segment
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_get_segment directive. It
- * attempts to allocate a segment from the region associated with ID.
- * If a segment of the requested size can be allocated, its address
- * is returned in segment. If no segment is available, then the task
- * may return immediately or block waiting for a segment with an optional
- * timeout of timeout clock ticks. Whether the task blocks or returns
- * immediately is based on the no_wait option in the option_set.
- */
-
-rtems_status_code rtems_region_get_segment(
- Objects_Id id,
- unsigned32 size,
- rtems_option option_set,
- rtems_interval timeout,
- void **segment
-);
-
-/*
- * rtems_region_get_segment_size
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_get_segment_size directive. It
- * returns the size in bytes of the specified user memory area.
- */
-
-rtems_status_code rtems_region_get_segment_size(
- Objects_Id id,
- void *segment,
- unsigned32 *size
-);
-
-/*
- * rtems_region_return_segment
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_return_segment directive. It
- * frees the segment to the region associated with ID. The segment must
- * have been previously allocated from the same region. If freeing the
- * segment results in enough memory being available to satisfy the
- * rtems_region_get_segment of the first blocked task, then that task and as
- * many subsequent tasks as possible will be unblocked with their requests
- * satisfied.
- */
-
-rtems_status_code rtems_region_return_segment(
- Objects_Id id,
- void *segment
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/region.inl>
-#endif
-#include <rtems/rtems/regionmp.h>
-
-/*
- * _Region_Debug_Walk
- *
- * DESCRIPTION:
- *
- * This routine is invoked to verify the integrity of a heap associated
- * with the_region.
- */
-
-#ifdef RTEMS_DEBUG
-
-#define _Region_Debug_Walk( _the_region, _source ) \
- do { \
- if ( _Debug_Is_enabled( RTEMS_DEBUG_REGION ) ) \
- _Heap_Walk( &(_the_region)->Memory, _source, FALSE ); \
- } while ( 0 )
-
-#else
-
-#define _Region_Debug_Walk( _the_region, _source )
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/regionmp.h b/c/src/exec/rtems/headers/regionmp.h
deleted file mode 100644
index fcdfa03178..0000000000
--- a/c/src/exec/rtems/headers/regionmp.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/* regionmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Region Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_REGION_MP_h
-#define __RTEMS_REGION_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/region.h>
-
-/*
- * The following enumerated type defines the list of
- * remote region operations.
- */
-
-typedef enum {
- REGION_MP_ANNOUNCE_CREATE = 0,
- REGION_MP_ANNOUNCE_DELETE = 1,
- REGION_MP_EXTRACT_PROXY = 2,
- REGION_MP_GET_SEGMENT_REQUEST = 3,
- REGION_MP_GET_SEGMENT_RESPONSE = 4,
- REGION_MP_RETURN_SEGMENT_REQUEST = 5,
- REGION_MP_RETURN_SEGMENT_RESPONSE = 6
-} Region_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote region operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Region_MP_Remote_operations operation;
- rtems_name name;
- rtems_option option_set;
- unsigned32 size;
- Objects_Id proxy_id;
- void *segment;
-} Region_MP_Packet;
-
-/*
- * _Region_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _Region_MP_Send_process_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- rtems_name name,
- Objects_Id proxy_id
-);
-
-/*
- * _Region_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Region_MP_Send_request_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- void *segment,
- unsigned32 size,
- rtems_option option_set,
- rtems_interval timeout
-);
-
-/*
- * _Region_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Region_MP_Send_response_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Region_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Region_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Region_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed by the Region since a region
- * cannot be deleted when segments are in use.
- */
-
-/*
- * _Region_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _Region_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _Region_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a region mp packet.
- */
-
-Region_MP_Packet *_Region_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/rtems/headers/rtems.h b/c/src/exec/rtems/headers/rtems.h
deleted file mode 100644
index 9a165c08dd..0000000000
--- a/c/src/exec/rtems/headers/rtems.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* rtems.h
- *
- * This include file contains information about RTEMS executive that
- * is required by the application and is CPU independent. It includes
- * two (2) CPU dependent files to tailor its data structures for a
- * particular processor.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_GENERIC_h
-#define __RTEMS_RTEMS_GENERIC_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Unless told otherwise, the RTEMS include files will hide some stuff
- * from normal application code. Defining this crosses a boundary which
- * is undesirable since it means your application is using RTEMS features
- * which are not included in the formally defined and supported API.
- * Define this at your own risk.
- */
-
-#if !defined(__RTEMS_VIOLATE_KERNEL_VISIBILITY__) && !defined(__RTEMS_INSIDE__)
-#define __RTEMS_APPLICATION__
-#endif
-
-#include <rtems/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/types.h>
-
-#include <rtems/config.h>
-#include <rtems/init.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/rtems/intr.h>
-#include <rtems/rtems/clock.h>
-#include <rtems/extension.h>
-#include <rtems/rtems/timer.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/rtems/message.h>
-#include <rtems/rtems/event.h>
-#include <rtems/rtems/signal.h>
-#include <rtems/rtems/event.h>
-#include <rtems/rtems/part.h>
-#include <rtems/rtems/region.h>
-#include <rtems/rtems/dpmem.h>
-#include <rtems/io.h>
-#include <rtems/fatal.h>
-#include <rtems/rtems/ratemon.h>
-#include <rtems/rtems/mp.h>
-
-#include <rtems/rtems/support.h>
-#include <rtems/score/sysstate.h>
-
-#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP
-
-/*
- * The following define the constants which may be used in name searches.
- */
-
-#define RTEMS_SEARCH_ALL_NODES OBJECTS_SEARCH_ALL_NODES
-#define RTEMS_SEARCH_OTHER_NODES OBJECTS_SEARCH_OTHER_NODES
-#define RTEMS_SEARCH_LOCAL_NODE OBJECTS_SEARCH_LOCAL_NODE
-#define RTEMS_WHO_AM_I OBJECTS_WHO_AM_I
-
-/*
- * Parameters and return id's for _Objects_Get_next
- */
-
-#define RTEMS_OBJECT_ID_INITIAL_INDEX OBJECTS_ID_INITIAL_INDEX
-#define RTEMS_OBJECT_ID_FINAL_INDEX OBJECTS_ID_FINAL_INDEX
-
-#define RTEMS_OBJECT_ID_INITIAL(class, node) OBJECTS_ID_INITIAL(class, node)
-#define RTEMS_OBJECT_ID_FINAL OBJECTS_ID_FINAL
-
-/*
- * The following constant defines the minimum stack size which every
- * thread must exceed.
- */
-
-#define RTEMS_MINIMUM_STACK_SIZE STACK_MINIMUM_SIZE
-
-/*
- * Constant for indefinite wait. (actually an illegal interval)
- */
-
-#define RTEMS_NO_TIMEOUT WATCHDOG_NO_TIMEOUT
-
-/*
- * An MPCI must support packets of at least this size.
- */
-
-#define RTEMS_MINIMUM_PACKET_SIZE MP_PACKET_MINIMUM_PACKET_SIZE
-
-/*
- * The following constant defines the number of unsigned32's
- * in a packet which must be converted to native format in a
- * heterogeneous system. In packets longer than
- * MP_PACKET_MINIMUN_HETERO_CONVERSION unsigned32's, some of the "extra" data
- * may a user message buffer which is not automatically endian swapped.
- */
-
-#define RTEMS_MINIMUN_HETERO_CONVERSION MP_PACKET_MINIMUN_HETERO_CONVERSION
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/rtemsapi.h b/c/src/exec/rtems/headers/rtemsapi.h
deleted file mode 100644
index dcea660f43..0000000000
--- a/c/src/exec/rtems/headers/rtemsapi.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * RTEMS API Support
- *
- * NOTE:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_API_h
-#define __RTEMS_API_h
-
-#include <rtems/config.h>
-
-/*PAGE
- *
- * _RTEMS_API_Initialize
- *
- * XXX
- */
-
-void _RTEMS_API_Initialize(
- rtems_configuration_table *configuration_table
-);
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/sem.h b/c/src/exec/rtems/headers/sem.h
deleted file mode 100644
index 191e62b414..0000000000
--- a/c/src/exec/rtems/headers/sem.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/* semaphore.h
- *
- * This include file contains all the constants and structures associated
- * with the Semaphore Manager. This manager utilizes standard Dijkstra
- * counting semaphores to provide synchronization and mutual exclusion
- * capabilities.
- *
- * Directives provided are:
- *
- * + create a semaphore
- * + get an ID of a semaphore
- * + delete a semaphore
- * + acquire a semaphore
- * + release a semaphore
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SEMAPHORE_h
-#define __RTEMS_SEMAPHORE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/score/coremutex.h>
-#include <rtems/score/object.h>
-#include <rtems/score/coresem.h>
-#include <rtems/score/threadq.h>
-
-/*
- * The following defines the control block used to manage each semaphore.
- */
-
-typedef struct {
- Objects_Control Object;
- rtems_attribute attribute_set;
- union {
- CORE_mutex_Control mutex;
- CORE_semaphore_Control semaphore;
- } Core_control;
-} Semaphore_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Semaphore_Information;
-
-/*
- * _Semaphore_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Semaphore_Manager_initialization(
- unsigned32 maximum_semaphores
-);
-
-/*
- * rtems_semaphore_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_create directive. The
- * semaphore will have the name name. The starting count for
- * the semaphore is count. The attribute_set determines if
- * the semaphore is global or local and the thread queue
- * discipline. It returns the id of the created semaphore in ID.
- */
-
-rtems_status_code rtems_semaphore_create(
- rtems_name name,
- unsigned32 count,
- rtems_attribute attribute_set,
- rtems_task_priority priority_ceiling,
- rtems_id *id
-);
-
-/*
- * rtems_semaphore_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_ident directive.
- * This directive returns the semaphore ID associated with name.
- * If more than one semaphore is named name, then the semaphore
- * to which the ID belongs is arbitrary. node indicates the
- * extent of the search for the ID of the semaphore named name.
- * The search can be limited to a particular node or allowed to
- * encompass all nodes.
- */
-
-rtems_status_code rtems_semaphore_ident(
- rtems_name name,
- unsigned32 node,
- rtems_id *id
-);
-
-/*
- * rtems_semaphore_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_delete directive. The
- * semaphore indicated by ID is deleted.
- */
-
-rtems_status_code rtems_semaphore_delete(
- rtems_id id
-);
-
-/*
- * rtems_semaphore_obtain
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_obtain directive. It
- * attempts to obtain a unit from the semaphore associated with ID.
- * If a unit can be allocated, the calling task will return immediately.
- * If no unit is available, then the task may return immediately or
- * block waiting for a unit with an optional timeout of timeout
- * clock ticks. Whether the task blocks or returns immediately
- * is based on the RTEMS_NO_WAIT option in the option_set.
- */
-
-rtems_status_code rtems_semaphore_obtain(
- rtems_id id,
- unsigned32 option_set,
- rtems_interval timeout
-);
-
-/*
- * rtems_semaphore_release
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_release directive. It
- * frees a unit to the semaphore associated with ID. If a task was
- * blocked waiting for a unit from this semaphore, then that task will
- * be readied and the unit given to that task. Otherwise, the unit
- * will be returned to the semaphore.
- */
-
-rtems_status_code rtems_semaphore_release(
- rtems_id id
-);
-
-/*
- * _Semaphore_Seize
- *
- * DESCRIPTION:
- *
- * This routine attempts to receive a unit from the_semaphore.
- * If a unit is available or if the RTEMS_NO_WAIT option is enabled in
- * option_set, then the routine returns. Otherwise, the calling task
- * is blocked until a unit becomes available.
- */
-
-boolean _Semaphore_Seize(
- Semaphore_Control *the_semaphore,
- unsigned32 option_set
-);
-
-/*
- * _Semaphore_Translate_core_mutex_return_code
- *
- * DESCRIPTION:
- *
- * This function returns a RTEMS status code based on the mutex
- * status code specified.
- */
-
-rtems_status_code _Semaphore_Translate_core_mutex_return_code (
- unsigned32 the_mutex_status
-);
-
-/*
- * _Semaphore_Translate_core_semaphore_return_code
- *
- * DESCRIPTION:
- *
- * This function returns a RTEMS status code based on the semaphore
- * status code specified.
- */
-
-rtems_status_code _Semaphore_Translate_core_semaphore_return_code (
- unsigned32 the_mutex_status
-);
-
-/*PAGE
- *
- * _Semaphore_Core_mutex_mp_support
- *
- * DESCRIPTION:
- *
- * This function processes the global actions necessary for remote
- * accesses to a global semaphore based on a core mutex. This function
- * is called by the core.
- */
-
-void _Semaphore_Core_mutex_mp_support (
- Thread_Control *the_thread,
- rtems_id id
-);
-
-/*PAGE
- *
- * _Semaphore_Core_mp_support
- *
- * DESCRIPTION:
- *
- * This function processes the global actions necessary for remote
- * accesses to a global semaphore based on a core semaphore. This function
- * is called by the core.
- */
-
-void _Semaphore_Core_semaphore_mp_support (
- Thread_Control *the_thread,
- rtems_id id
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/sem.inl>
-#endif
-#include <rtems/rtems/semmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/semmp.h b/c/src/exec/rtems/headers/semmp.h
deleted file mode 100644
index fdea66f6a4..0000000000
--- a/c/src/exec/rtems/headers/semmp.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/* semmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Semaphore Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SEMAPHORE_MP_h
-#define __RTEMS_SEMAPHORE_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote semaphore operations.
- */
-
-typedef enum {
- SEMAPHORE_MP_ANNOUNCE_CREATE = 0,
- SEMAPHORE_MP_ANNOUNCE_DELETE = 1,
- SEMAPHORE_MP_EXTRACT_PROXY = 2,
- SEMAPHORE_MP_OBTAIN_REQUEST = 3,
- SEMAPHORE_MP_OBTAIN_RESPONSE = 4,
- SEMAPHORE_MP_RELEASE_REQUEST = 5,
- SEMAPHORE_MP_RELEASE_RESPONSE = 6
-} Semaphore_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote semaphore operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Semaphore_MP_Remote_operations operation;
- rtems_name name;
- rtems_option option_set;
- Objects_Id proxy_id;
-} Semaphore_MP_Packet;
-
-/*
- * _Semaphore_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _Semaphore_MP_Send_process_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- rtems_name name,
- Objects_Id proxy_id
-);
-
-/*
- * _Semaphore_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Semaphore_MP_Send_request_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- rtems_option option_set,
- rtems_interval timeout
-);
-
-/*
- * _Semaphore_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Semaphore_MP_Send_response_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Semaphore_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Semaphore_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Semaphore_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _Semaphore_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _Semaphore_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _Semaphore_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _Semaphore_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a semaphore mp packet.
- */
-
-Semaphore_MP_Packet *_Semaphore_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/rtems/headers/signal.h b/c/src/exec/rtems/headers/signal.h
deleted file mode 100644
index 2b247762e9..0000000000
--- a/c/src/exec/rtems/headers/signal.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* signal.h
- *
- * This include file contains all the constants and structures associated
- * with the Signal Manager. This manager provides capabilities required
- * for asynchronous communication between tasks via signal sets.
- *
- * Directives provided are:
- *
- * + establish an asynchronous signal routine
- * + send a signal set to a task
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SIGNAL_h
-#define __RTEMS_SIGNAL_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/asr.h>
-#include <rtems/rtems/modes.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/types.h>
-
-/*
- * _Signal_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Signal_Manager_initialization( void );
-
-/*
- * rtems_signal_catch
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_signal_catch directive. This directive
- * is used to establish asr_handler as the Asynchronous Signal Routine
- * (RTEMS_ASR) for the calling task. The asr_handler will execute with a
- * mode of mode_set.
- */
-
-rtems_status_code rtems_signal_catch(
- rtems_asr_entry asr_handler,
- rtems_mode mode_set
-);
-
-/*
- * rtems_signal_send
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_signal_send directive. This directive
- * sends the signal_set to the task specified by ID.
- */
-
-rtems_status_code rtems_signal_send(
- Objects_Id id,
- rtems_signal_set signal_set
-);
-
-#include <rtems/rtems/signalmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/signalmp.h b/c/src/exec/rtems/headers/signalmp.h
deleted file mode 100644
index 2b13a0707e..0000000000
--- a/c/src/exec/rtems/headers/signalmp.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* signalmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Signal Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SIGNAL_MP_h
-#define __RTEMS_SIGNAL_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/asr.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote signal operations.
- */
-
-typedef enum {
- SIGNAL_MP_SEND_REQUEST = 0,
- SIGNAL_MP_SEND_RESPONSE = 1
-} Signal_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote signal operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Signal_MP_Remote_operations operation;
- rtems_signal_set signal_in;
-} Signal_MP_Packet;
-
-/*
- * _Signal_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- *
- * This routine is not needed since there are no process
- * packets to be sent by this manager.
- */
-
-/*
- * _Signal_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Signal_MP_Send_request_packet (
- Signal_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_signal_set signal_in
-);
-
-/*
- * _Signal_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Signal_MP_Send_response_packet (
- Signal_MP_Remote_operations operation,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Signal_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Signal_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Signal_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _Signal_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _Signal_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a signal mp packet.
- */
-
-Signal_MP_Packet *_Signal_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/rtems/headers/status.h b/c/src/exec/rtems/headers/status.h
deleted file mode 100644
index db1cf2049c..0000000000
--- a/c/src/exec/rtems/headers/status.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* status.h
- *
- * This include file contains the status codes returned from the
- * executive directives.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_STATUS_h
-#define __RTEMS_STATUS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* types */
-
-/* enumerated constants */
-
-typedef enum {
- RTEMS_SUCCESSFUL = 0, /* successful completion */
- RTEMS_TASK_EXITTED = 1, /* returned from a thread */
- RTEMS_MP_NOT_CONFIGURED = 2, /* multiprocessing not configured */
- RTEMS_INVALID_NAME = 3, /* invalid object name */
- RTEMS_INVALID_ID = 4, /* invalid object id */
- RTEMS_TOO_MANY = 5, /* too many */
- RTEMS_TIMEOUT = 6, /* timed out waiting */
- RTEMS_OBJECT_WAS_DELETED = 7, /* object deleted while waiting */
- RTEMS_INVALID_SIZE = 8, /* specified size was invalid */
- RTEMS_INVALID_ADDRESS = 9, /* address specified is invalid */
- RTEMS_INVALID_NUMBER = 10, /* number was invalid */
- RTEMS_NOT_DEFINED = 11, /* item has not been initialized */
- RTEMS_RESOURCE_IN_USE = 12, /* resources still outstanding */
- RTEMS_UNSATISFIED = 13, /* request not satisfied */
- RTEMS_INCORRECT_STATE = 14, /* thread is in wrong state */
- RTEMS_ALREADY_SUSPENDED = 15, /* thread already in state */
- RTEMS_ILLEGAL_ON_SELF = 16, /* illegal on calling thread */
- RTEMS_ILLEGAL_ON_REMOTE_OBJECT = 17, /* illegal for remote object */
- RTEMS_CALLED_FROM_ISR = 18, /* called from wrong environment */
- RTEMS_INVALID_PRIORITY = 19, /* invalid thread priority */
- RTEMS_INVALID_CLOCK = 20, /* invalid date/time */
- RTEMS_INVALID_NODE = 21, /* invalid node id */
- RTEMS_NOT_CONFIGURED = 22, /* directive not configured */
- RTEMS_NOT_OWNER_OF_RESOURCE = 23, /* not owner of resource */
- RTEMS_NOT_IMPLEMENTED = 24, /* directive not implemented */
- RTEMS_INTERNAL_ERROR = 25, /* RTEMS inconsistency detected */
- RTEMS_NO_MEMORY = 26, /* could not get enough memory */
- RTEMS_IO_ERROR = 27, /* driver IO error */
- RTEMS_PROXY_BLOCKING = 28 /* internal error only */
-} rtems_status_code;
-
-#define RTEMS_STATUS_CODES_FIRST RTEMS_SUCCESSFUL
-#define RTEMS_STATUS_CODES_LAST RTEMS_PROXY_BLOCKING
-
-extern rtems_status_code _Status_Object_name_errors_to_status[];
-
-#ifdef RTEMS_API_INIT
-rtems_status_code _Status_Object_name_errors_to_status[] = {
- RTEMS_SUCCESSFUL, /* OBJECTS_SUCCESSFUL */
- RTEMS_INVALID_NAME, /* OBJECTS_INVALID_NAME */
- RTEMS_INVALID_NODE /* OBJECTS_INVALID_NODE */
-};
-#endif
-
-/*
- * Applications are allowed to use the macros to compare status codes.
- */
-
-#include <rtems/rtems/status.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/support.h b/c/src/exec/rtems/headers/support.h
deleted file mode 100644
index 643b4295bd..0000000000
--- a/c/src/exec/rtems/headers/support.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* support.h
- *
- * This include file contains information about support functions for
- * the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_SUPPORT_h
-#define __RTEMS_RTEMS_SUPPORT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-
-/*
- * rtems_build_name
- *
- * DESCRIPTION:
- *
- * This function returns an object name composed of the four characters
- * C1, C2, C3, and C4.
- *
- * NOTE:
- *
- * This must be implemented as a macro for use in Configuration Tables.
- *
- */
-
-#define rtems_build_name( _C1, _C2, _C3, _C4 ) \
- ( (_C1) << 24 | (_C2) << 16 | (_C3) << 8 | (_C4) )
-
-/*
- * rtems_get_class
- *
- * DESCRIPTION:
- *
- * This function returns the class portion of the ID.
- *
- */
-
-#define rtems_get_class( _id ) \
- _Objects_Get_class( _id )
-
-/*
- * rtems_get_node
- *
- * DESCRIPTION:
- *
- * This function returns the node portion of the ID.
- *
- */
-
-#define rtems_get_node( _id ) \
- _Objects_Get_node( _id )
-
-/*
- * rtems_get_index
- *
- * DESCRIPTION:
- *
- * This function returns the index portion of the ID.
- *
- */
-
-#define rtems_get_index( _id ) \
- _Objects_Get_index( _id )
-
-/*
- * Time related
- */
-
-#define RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) \
- TOD_MILLISECONDS_TO_MICROSECONDS(_ms)
-#define RTEMS_MILLISECONDS_TO_TICKS(_ms) \
- TOD_MILLISECONDS_TO_TICKS(_ms)
-#define RTEMS_MICROSECONDS_TO_TICKS(_ms) \
- TOD_MICROSECONDS_TO_TICKS(_ms)
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/support.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/taskmp.h b/c/src/exec/rtems/headers/taskmp.h
deleted file mode 100644
index a1ff0a3715..0000000000
--- a/c/src/exec/rtems/headers/taskmp.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/* taskmp.h
- *
- * This include file contains all the constants and structures associated
- * with the multiprocessing support in the task manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_TASKS_MP_h
-#define __RTEMS_RTEMS_TASKS_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/priority.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/score/thread.h>
-
-/*
- * The following enumerated type defines the list of
- * remote task operations.
- */
-
-typedef enum {
- RTEMS_TASKS_MP_ANNOUNCE_CREATE = 0,
- RTEMS_TASKS_MP_ANNOUNCE_DELETE = 1,
- RTEMS_TASKS_MP_SUSPEND_REQUEST = 2,
- RTEMS_TASKS_MP_SUSPEND_RESPONSE = 3,
- RTEMS_TASKS_MP_RESUME_REQUEST = 4,
- RTEMS_TASKS_MP_RESUME_RESPONSE = 5,
- RTEMS_TASKS_MP_SET_PRIORITY_REQUEST = 6,
- RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE = 7,
- RTEMS_TASKS_MP_GET_NOTE_REQUEST = 8,
- RTEMS_TASKS_MP_GET_NOTE_RESPONSE = 9,
- RTEMS_TASKS_MP_SET_NOTE_REQUEST = 10,
- RTEMS_TASKS_MP_SET_NOTE_RESPONSE = 11
-} RTEMS_tasks_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote task operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- RTEMS_tasks_MP_Remote_operations operation;
- rtems_name name;
- rtems_task_priority the_priority;
- unsigned32 notepad;
- unsigned32 note;
-} RTEMS_tasks_MP_Packet;
-
-/*
- * _RTEMS_tasks_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _RTEMS_tasks_MP_Send_process_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_name name
-);
-
-/*
- * _RTEMS_tasks_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _RTEMS_tasks_MP_Send_request_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_task_priority the_priority,
- unsigned32 notepad,
- unsigned32 note
-);
-
-/*
- * _RTEMS_tasks_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _RTEMS_tasks_MP_Send_response_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _RTEMS_tasks_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _RTEMS_tasks_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _RTEMS_tasks_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed by RTEMS_tasks since a task
- * cannot be deleted when segments are in use.
- */
-
-/*
- * _RTEMS_tasks_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*
- * _RTEMS_tasks_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a task mp packet.
- */
-
-RTEMS_tasks_MP_Packet *_RTEMS_tasks_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/rtems/headers/tasks.h b/c/src/exec/rtems/headers/tasks.h
deleted file mode 100644
index 17730cee7f..0000000000
--- a/c/src/exec/rtems/headers/tasks.h
+++ /dev/null
@@ -1,421 +0,0 @@
-/* tasks.h
- *
- * This include file contains all constants and structures associated
- * with RTEMS tasks. This manager provides a comprehensive set of directives
- * to create, delete, and administer tasks.
- *
- * Directives provided are:
- *
- * + create a task
- * + get an ID of a task
- * + start a task
- * + restart a task
- * + delete a task
- * + suspend a task
- * + resume a task
- * + set a task's priority
- * + change the current task's mode
- * + get a task notepad entry
- * + set a task notepad entry
- * + wake up after interval
- * + wake up when specified
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_TASKS_h
-#define __RTEMS_RTEMS_TASKS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/eventset.h>
-#include <rtems/rtems/asr.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/rtems/status.h>
-
-/*
- * Constant to be used as the ID of current task
- */
-
-#define RTEMS_SELF OBJECTS_ID_OF_SELF
-
-/*
- * This constant is passed to the rtems_task_wake_after directive as the
- * interval when a task wishes to yield the CPU.
- */
-
-#define RTEMS_YIELD_PROCESSOR WATCHDOG_NO_TIMEOUT
-
-/*
- * Define the type for an RTEMS API task priority.
- */
-
-typedef Priority_Control rtems_task_priority;
-
-#define RTEMS_NO_PRIORITY RTEMS_CURRENT_PRIORITY
-
-#define RTEMS_MINIMUM_PRIORITY (PRIORITY_MINIMUM + 1)
-#define RTEMS_MAXIMUM_PRIORITY PRIORITY_MAXIMUM
-
-/*
- * The following constant is passed to rtems_task_set_priority when the
- * caller wants to obtain the current priority.
- */
-
-#define RTEMS_CURRENT_PRIORITY PRIORITY_MINIMUM
-
-/*
- * Notepads constants (indices into notepad array)
- */
-
-#define RTEMS_NOTEPAD_FIRST 0 /* lowest numbered notepad */
-#define RTEMS_NOTEPAD_0 0 /* notepad location 0 */
-#define RTEMS_NOTEPAD_1 1 /* notepad location 1 */
-#define RTEMS_NOTEPAD_2 2 /* notepad location 2 */
-#define RTEMS_NOTEPAD_3 3 /* notepad location 3 */
-#define RTEMS_NOTEPAD_4 4 /* notepad location 4 */
-#define RTEMS_NOTEPAD_5 5 /* notepad location 5 */
-#define RTEMS_NOTEPAD_6 6 /* notepad location 6 */
-#define RTEMS_NOTEPAD_7 7 /* notepad location 7 */
-#define RTEMS_NOTEPAD_8 8 /* notepad location 8 */
-#define RTEMS_NOTEPAD_9 9 /* notepad location 9 */
-#define RTEMS_NOTEPAD_10 10 /* notepad location 10 */
-#define RTEMS_NOTEPAD_11 11 /* notepad location 11 */
-#define RTEMS_NOTEPAD_12 12 /* notepad location 12 */
-#define RTEMS_NOTEPAD_13 13 /* notepad location 13 */
-#define RTEMS_NOTEPAD_14 14 /* notepad location 14 */
-#define RTEMS_NOTEPAD_15 15 /* notepad location 15 */
-#define RTEMS_NOTEPAD_LAST RTEMS_NOTEPAD_15 /* highest numbered notepad */
-
-#define RTEMS_NUMBER_NOTEPADS (RTEMS_NOTEPAD_LAST+1)
-
-/*
- * External API name for Thread_Control
- */
-
-typedef Thread_Control rtems_tcb;
-
-/*
- * The following defines the "return type" of an RTEMS task.
- */
-
-typedef void rtems_task;
-
-/*
- * The following defines the argument to an RTEMS task.
- */
-
-typedef unsigned32 rtems_task_argument;
-
-/*
- * The following defines the type for the entry point of an RTEMS task.
- */
-
-typedef rtems_task ( *rtems_task_entry )(
- rtems_task_argument
- );
-
-/*
- * The following records define the Initialization Tasks Table.
- * Each entry contains the information required by RTEMS to
- * create and start a user task automatically at executive
- * initialization time.
- */
-
-typedef struct {
- rtems_name name; /* task name */
- unsigned32 stack_size; /* task stack size */
- rtems_task_priority initial_priority; /* task priority */
- rtems_attribute attribute_set; /* task attributes */
- rtems_task_entry entry_point; /* task entry point */
- rtems_mode mode_set; /* task initial mode */
- unsigned32 argument; /* task argument */
-} rtems_initialization_tasks_table;
-
-/*
- * This is the API specific information required by each thread for
- * the RTEMS API to function correctly.
- */
-
-
-typedef struct {
- unsigned32 Notepads[ RTEMS_NUMBER_NOTEPADS ];
- rtems_event_set pending_events;
- rtems_event_set event_condition;
- ASR_Information Signal;
-} RTEMS_API_Control;
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _RTEMS_tasks_Information;
-
-/*
- * These are used to manage the user initialization tasks.
- */
-
-RTEMS_EXTERN rtems_initialization_tasks_table
- *_RTEMS_tasks_User_initialization_tasks;
-RTEMS_EXTERN unsigned32 _RTEMS_tasks_Number_of_initialization_tasks;
-
-/*
- * _RTEMS_tasks_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes all Task Manager related data structures.
- */
-
-void _RTEMS_tasks_Manager_initialization(
- unsigned32 maximum_tasks,
- unsigned32 number_of_initialization_tasks,
- rtems_initialization_tasks_table *user_tasks
-);
-
-/*
- * rtems_task_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_create directive. The task
- * will have the name name. The attribute_set can be used to indicate
- * that the task will be globally accessible or utilize floating point.
- * The task's stack will be stack_size bytes. The task will begin
- * execution with initial_priority and initial_modes. It returns the
- * id of the created task in ID.
- */
-
-rtems_status_code rtems_task_create(
- rtems_name name,
- rtems_task_priority initial_priority,
- unsigned32 stack_size,
- rtems_mode initial_modes,
- rtems_attribute attribute_set,
- Objects_Id *id
-);
-
-/*
- * rtems_task_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_ident directive.
- * This directive returns the task ID associated with name.
- * If more than one task is named name, then the task to
- * which the ID belongs is arbitrary. node indicates the
- * extent of the search for the ID of the task named name.
- * The search can be limited to a particular node or allowed to
- * encompass all nodes.
- */
-
-rtems_status_code rtems_task_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-);
-
-/*
- * rtems_task_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_delete directive. The
- * task indicated by ID is deleted.
- */
-
-rtems_status_code rtems_task_delete(
- Objects_Id id
-);
-
-/*
- * rtems_task_get_note
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_get_note directive. The
- * value of the indicated notepad for the task associated with ID
- * is returned in note.
- */
-
-rtems_status_code rtems_task_get_note(
- Objects_Id id,
- unsigned32 notepad,
- unsigned32 *note
-);
-
-/*
- * rtems_task_set_note
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_set_note directive. The
- * value of the indicated notepad for the task associated with ID
- * is returned in note.
- */
-
-rtems_status_code rtems_task_set_note(
- Objects_Id id,
- unsigned32 notepad,
- unsigned32 note
-);
-
-/*
- * rtems_task_mode
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_mode directive. The current
- * values of the modes indicated by mask of the calling task are changed
- * to that indicated in mode_set. The former mode of the task is
- * returned in mode_set.
- */
-
-rtems_status_code rtems_task_mode(
- rtems_mode mode_set,
- rtems_mode mask,
- rtems_mode *previous_mode_set
-);
-
-/*
- * rtems_task_restart
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_restart directive. The
- * task associated with ID is restarted at its initial entry
- * point with the new argument.
- */
-
-rtems_status_code rtems_task_restart(
- Objects_Id id,
- unsigned32 arg
-);
-
-/*
- * rtems_task_suspend
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_suspend directive. The
- * SUSPENDED state is set for task associated with ID.
- */
-
-rtems_status_code rtems_task_suspend(
- Objects_Id id
-);
-
-/*
- * rtems_task_resume
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_resume Directive. The
- * SUSPENDED state is cleared for task associated with ID.
- */
-
-rtems_status_code rtems_task_resume(
- Objects_Id id
-);
-
-/*
- * rtems_task_set_priority
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_set_priority directive. The
- * current priority of the task associated with ID is set to
- * new_priority. The former priority of that task is returned
- * in old_priority.
- */
-
-rtems_status_code rtems_task_set_priority(
- Objects_Id id,
- rtems_task_priority new_priority,
- rtems_task_priority *old_priority
-);
-
-/*
- * rtems_task_start
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_start directive. The
- * starting execution point of the task associated with ID is
- * set to entry_point with the initial argument.
- */
-
-rtems_status_code rtems_task_start(
- Objects_Id id,
- rtems_task_entry entry_point,
- unsigned32 argument
-);
-
-/*
- * rtems_task_wake_when
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_wake_when directive. The
- * calling task is blocked until the current time of day is
- * equal to that indicated by time_buffer.
- */
-
-rtems_status_code rtems_task_wake_when(
- rtems_time_of_day *time_buffer
-);
-
-/*
- * rtems_task_wake_after
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_wake_after directive. The
- * calling task is blocked until the indicated number of clock
- * ticks have occurred.
- */
-
-rtems_status_code rtems_task_wake_after(
- rtems_interval ticks
-);
-
-/*PAGE
- *
- * _RTEMS_tasks_Initialize_user_tasks
- *
- * This routine creates and starts all configured user
- * initialzation threads.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _RTEMS_tasks_Initialize_user_tasks( void );
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/tasks.inl>
-#endif
-#include <rtems/rtems/taskmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/timer.h b/c/src/exec/rtems/headers/timer.h
deleted file mode 100644
index 4ef567c9bc..0000000000
--- a/c/src/exec/rtems/headers/timer.h
+++ /dev/null
@@ -1,207 +0,0 @@
-/* timer.h
- *
- * This include file contains all the constants, structures, and
- * prototypes associated with the Timer Manager. This manager provides
- * facilities to configure, initiate, cancel, and delete timers which will
- * fire at specified intervals of time.
- *
- * Directives provided are:
- *
- * + create a timer
- * + get an ID of a timer
- * + delete a timer
- * + set a timer to fire after a number of ticks have passed
- * + set a timer to fire when a specified date and time has been reached
- * + reset a timer
- * + cancel a time
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_TIMER_h
-#define __RTEMS_TIMER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type details the classes to which a timer
- * may belong.
- */
-
-typedef enum {
- TIMER_INTERVAL,
- TIMER_TIME_OF_DAY,
- TIMER_DORMANT
-} Timer_Classes;
-
-/*
- * The following types define a pointer to a timer service routine.
- */
-
-typedef void rtems_timer_service_routine;
-
-typedef rtems_timer_service_routine ( *rtems_timer_service_routine_entry )(
- rtems_id,
- void *
- );
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Timer_Information;
-
-/*
- * The following records define the control block used to manage
- * each timer.
- */
-
-typedef struct {
- Objects_Control Object;
- Watchdog_Control Ticker;
- Timer_Classes the_class;
-} Timer_Control;
-
-/*
- * _Timer_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Timer_Manager_initialization(
- unsigned32 maximum_timers
-);
-
-/*
- * rtems_timer_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_create directive. The
- * timer will have the name name. It returns the id of the
- * created timer in ID.
- */
-
-rtems_status_code rtems_timer_create(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_timer_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_ident directive.
- * This directive returns the timer ID associated with name.
- * If more than one timer is named name, then the timer
- * to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_timer_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_timer_cancel
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_cancel directive. It is used
- * to stop the timer associated with ID from firing.
- */
-
-rtems_status_code rtems_timer_cancel(
- Objects_Id id
-);
-
-/*
- * rtems_timer_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_delete directive. The
- * timer indicated by ID is deleted.
- */
-
-rtems_status_code rtems_timer_delete(
- Objects_Id id
-);
-
-/*
- * rtems_timer_fire_after
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_fire_after directive. It
- * initiates the timer associated with ID to fire in ticks clock
- * ticks. When the timer fires, the routine will be invoked.
- */
-
-rtems_status_code rtems_timer_fire_after(
- Objects_Id id,
- rtems_interval ticks,
- rtems_timer_service_routine_entry routine,
- void *user_data
-);
-
-/*
- * rtems_timer_fire_when
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_fire_when directive. It
- * initiates the timer associated with ID to fire at wall_time
- * When the timer fires, the routine will be invoked.
- */
-
-rtems_status_code rtems_timer_fire_when(
- Objects_Id id,
- rtems_time_of_day *wall_time,
- rtems_timer_service_routine_entry routine,
- void *user_data
-);
-
-/*
- * rtems_timer_reset
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_reset directive. It is used
- * to reinitialize the interval timer associated with ID just as if
- * rtems_timer_fire_after were re-invoked with the same arguments that
- * were used to initiate this timer.
- */
-
-rtems_status_code rtems_timer_reset(
- Objects_Id id
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/timer.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/headers/types.h b/c/src/exec/rtems/headers/types.h
deleted file mode 100644
index 4d2915bafa..0000000000
--- a/c/src/exec/rtems/headers/types.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* types.h
- *
- * This include file defines the types used by the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_TYPES_h
-#define __RTEMS_RTEMS_TYPES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/priority.h>
-#include <rtems/rtems/modes.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-
-/*
- * RTEMS basic type definitions
- */
-
-typedef unsigned8 rtems_unsigned8; /* unsigned 8-bit value */
-typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */
-typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */
-
-typedef signed8 rtems_signed8; /* signed 8-bit value */
-typedef signed16 rtems_signed16; /* signed 16-bit value */
-typedef signed32 rtems_signed32; /* signed 32-bit value */
-
-/*
- * some C++ compilers (eg: HP's) don't do 'long long'
- */
-#if defined(__GNUC__)
-typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */
-typedef signed64 rtems_signed64; /* signed 64-bit value */
-#endif
-
-typedef single_precision rtems_single; /* single precision float */
-typedef double_precision rtems_double; /* double precision float */
-
-typedef boolean rtems_boolean;
-
-typedef unsigned32 rtems_name;
-typedef Objects_Id rtems_id;
-
-typedef Context_Control rtems_context;
-typedef Context_Control_fp rtems_context_fp;
-typedef CPU_Interrupt_frame rtems_interrupt_frame;
-
-/*
- * Time related
- */
-
-typedef Watchdog_Interval rtems_interval;
-typedef TOD_Control rtems_time_of_day;
-
-/*
- * Define the type for an RTEMS API task mode.
- */
-
-typedef Modes_Control rtems_mode;
-
-/*
- * MPCI related entries
- */
-
-typedef MP_packet_Classes rtems_mp_packet_classes;
-typedef MP_packet_Prefix rtems_packet_prefix;
-
-typedef MPCI_initialization_entry rtems_mpci_initialization_entry;
-typedef MPCI_get_packet_entry rtems_mpci_get_packet_entry;
-typedef MPCI_return_packet_entry rtems_mpci_return_packet_entry;
-typedef MPCI_send_entry rtems_mpci_send_packet_entry;
-typedef MPCI_receive_entry rtems_mpci_receive_packet_entry;
-
-typedef MPCI_Entry rtems_mpci_entry;
-
-typedef MPCI_Control rtems_mpci_table;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems.h b/c/src/exec/rtems/include/rtems.h
deleted file mode 100644
index 9a165c08dd..0000000000
--- a/c/src/exec/rtems/include/rtems.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* rtems.h
- *
- * This include file contains information about RTEMS executive that
- * is required by the application and is CPU independent. It includes
- * two (2) CPU dependent files to tailor its data structures for a
- * particular processor.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_GENERIC_h
-#define __RTEMS_RTEMS_GENERIC_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Unless told otherwise, the RTEMS include files will hide some stuff
- * from normal application code. Defining this crosses a boundary which
- * is undesirable since it means your application is using RTEMS features
- * which are not included in the formally defined and supported API.
- * Define this at your own risk.
- */
-
-#if !defined(__RTEMS_VIOLATE_KERNEL_VISIBILITY__) && !defined(__RTEMS_INSIDE__)
-#define __RTEMS_APPLICATION__
-#endif
-
-#include <rtems/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/types.h>
-
-#include <rtems/config.h>
-#include <rtems/init.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/rtems/intr.h>
-#include <rtems/rtems/clock.h>
-#include <rtems/extension.h>
-#include <rtems/rtems/timer.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/rtems/message.h>
-#include <rtems/rtems/event.h>
-#include <rtems/rtems/signal.h>
-#include <rtems/rtems/event.h>
-#include <rtems/rtems/part.h>
-#include <rtems/rtems/region.h>
-#include <rtems/rtems/dpmem.h>
-#include <rtems/io.h>
-#include <rtems/fatal.h>
-#include <rtems/rtems/ratemon.h>
-#include <rtems/rtems/mp.h>
-
-#include <rtems/rtems/support.h>
-#include <rtems/score/sysstate.h>
-
-#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP
-
-/*
- * The following define the constants which may be used in name searches.
- */
-
-#define RTEMS_SEARCH_ALL_NODES OBJECTS_SEARCH_ALL_NODES
-#define RTEMS_SEARCH_OTHER_NODES OBJECTS_SEARCH_OTHER_NODES
-#define RTEMS_SEARCH_LOCAL_NODE OBJECTS_SEARCH_LOCAL_NODE
-#define RTEMS_WHO_AM_I OBJECTS_WHO_AM_I
-
-/*
- * Parameters and return id's for _Objects_Get_next
- */
-
-#define RTEMS_OBJECT_ID_INITIAL_INDEX OBJECTS_ID_INITIAL_INDEX
-#define RTEMS_OBJECT_ID_FINAL_INDEX OBJECTS_ID_FINAL_INDEX
-
-#define RTEMS_OBJECT_ID_INITIAL(class, node) OBJECTS_ID_INITIAL(class, node)
-#define RTEMS_OBJECT_ID_FINAL OBJECTS_ID_FINAL
-
-/*
- * The following constant defines the minimum stack size which every
- * thread must exceed.
- */
-
-#define RTEMS_MINIMUM_STACK_SIZE STACK_MINIMUM_SIZE
-
-/*
- * Constant for indefinite wait. (actually an illegal interval)
- */
-
-#define RTEMS_NO_TIMEOUT WATCHDOG_NO_TIMEOUT
-
-/*
- * An MPCI must support packets of at least this size.
- */
-
-#define RTEMS_MINIMUM_PACKET_SIZE MP_PACKET_MINIMUM_PACKET_SIZE
-
-/*
- * The following constant defines the number of unsigned32's
- * in a packet which must be converted to native format in a
- * heterogeneous system. In packets longer than
- * MP_PACKET_MINIMUN_HETERO_CONVERSION unsigned32's, some of the "extra" data
- * may a user message buffer which is not automatically endian swapped.
- */
-
-#define RTEMS_MINIMUN_HETERO_CONVERSION MP_PACKET_MINIMUN_HETERO_CONVERSION
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/Makefile.in b/c/src/exec/rtems/include/rtems/rtems/Makefile.in
deleted file mode 100644
index adb4903db8..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/Makefile.in
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_PIECES=asr attr clock config dpmem event eventmp eventset \
- intr message modes mp msgmp options part partmp \
- ratemon region regionmp rtemsapi sem semmp signal signalmp status \
- support taskmp tasks timer types
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-# H_FILES that get installed externally
-EXTERNAL_H_PIECES = rtems
-EXTERNAL_H_FILES=$(EXTERNAL_H_PIECES:%=$(srcdir)/%.h)
-
-SRCS=$(H_FILES) $(EXTERNAL_H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/rtems
- $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
diff --git a/c/src/exec/rtems/include/rtems/rtems/asr.h b/c/src/exec/rtems/include/rtems/rtems/asr.h
deleted file mode 100644
index 3fac2fa3e3..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/asr.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* asr.h
- *
- * This include file contains all the constants and structures associated
- * with the Asynchronous Signal Handler. This Handler provides the low-level
- * support required by the Signal Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_ASR_h
-#define __RTEMS_ASR_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/modes.h>
-
-/*
- *
- * The following type defines the control block used to manage
- * each signal set.
- */
-
-typedef unsigned32 rtems_signal_set;
-
-/*
- * Return type for ASR Handler
- */
-
-typedef void rtems_asr;
-
-/*
- * The following type corresponds to the applications asynchronous
- * signal processing routine.
- */
-
-typedef rtems_asr ( *rtems_asr_entry )(
- rtems_signal_set
- );
-
-/*
- *
- * The following defines the control structure used to manage
- * signals. Each thread has a copy of this record.
- */
-
-typedef struct {
- boolean is_enabled; /* are ASRs enabled currently? */
- rtems_asr_entry handler; /* address of RTEMS_ASR */
- Modes_Control mode_set; /* RTEMS_ASR mode */
- rtems_signal_set signals_posted; /* signal set */
- rtems_signal_set signals_pending; /* pending signal set */
- unsigned32 nest_level; /* nest level of RTEMS_ASR */
-} ASR_Information;
-
-/*
- * The following constants define the individual signals which may
- * be used to compose a signal set.
- */
-
-#define RTEMS_SIGNAL_0 0x00000001
-#define RTEMS_SIGNAL_1 0x00000002
-#define RTEMS_SIGNAL_2 0x00000004
-#define RTEMS_SIGNAL_3 0x00000008
-#define RTEMS_SIGNAL_4 0x00000010
-#define RTEMS_SIGNAL_5 0x00000020
-#define RTEMS_SIGNAL_6 0x00000040
-#define RTEMS_SIGNAL_7 0x00000080
-#define RTEMS_SIGNAL_8 0x00000100
-#define RTEMS_SIGNAL_9 0x00000200
-#define RTEMS_SIGNAL_10 0x00000400
-#define RTEMS_SIGNAL_11 0x00000800
-#define RTEMS_SIGNAL_12 0x00001000
-#define RTEMS_SIGNAL_13 0x00002000
-#define RTEMS_SIGNAL_14 0x00004000
-#define RTEMS_SIGNAL_15 0x00008000
-#define RTEMS_SIGNAL_16 0x00010000
-#define RTEMS_SIGNAL_17 0x00020000
-#define RTEMS_SIGNAL_18 0x00040000
-#define RTEMS_SIGNAL_19 0x00080000
-#define RTEMS_SIGNAL_20 0x00100000
-#define RTEMS_SIGNAL_21 0x00200000
-#define RTEMS_SIGNAL_22 0x00400000
-#define RTEMS_SIGNAL_23 0x00800000
-#define RTEMS_SIGNAL_24 0x01000000
-#define RTEMS_SIGNAL_25 0x02000000
-#define RTEMS_SIGNAL_26 0x04000000
-#define RTEMS_SIGNAL_27 0x08000000
-#define RTEMS_SIGNAL_28 0x10000000
-#define RTEMS_SIGNAL_29 0x20000000
-#define RTEMS_SIGNAL_30 0x40000000
-#define RTEMS_SIGNAL_31 0x80000000
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/asr.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/attr.h b/c/src/exec/rtems/include/rtems/rtems/attr.h
deleted file mode 100644
index 215b27f9a0..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/attr.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* attr.h
- *
- * This include file contains all information about the Object Attributes
- * Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_ATTRIBUTES_h
-#define __RTEMS_ATTRIBUTES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* types */
-
-typedef unsigned32 rtems_attribute;
-
-/* constants */
-
-#define RTEMS_DEFAULT_ATTRIBUTES 0x00000000
-
-#define RTEMS_NO_FLOATING_POINT 0x00000000 /* don't use FP HW */
-#define RTEMS_FLOATING_POINT 0x00000001 /* utilize coprocessor */
-
-#define RTEMS_LOCAL 0x00000000 /* local resource */
-#define RTEMS_GLOBAL 0x00000002 /* global resource */
-
-#define RTEMS_FIFO 0x00000000 /* process RTEMS_FIFO */
-#define RTEMS_PRIORITY 0x00000004 /* process by priority */
-
-#define RTEMS_COUNTING_SEMAPHORE 0x00000000
-#define RTEMS_BINARY_SEMAPHORE 0x00000010
-
-#define RTEMS_NO_INHERIT_PRIORITY 0x00000000
-#define RTEMS_INHERIT_PRIORITY 0x00000020
-
-#define RTEMS_NO_PRIORITY_CEILING 0x00000000
-#define RTEMS_PRIORITY_CEILING 0x00000040
-
-#define RTEMS_APPLICATION_TASK 0x00000000
-#define RTEMS_SYSTEM_TASK 0x00000080
-
-#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
-#define ATTRIBUTES_NOT_SUPPORTED 0
-#else
-#define ATTRIBUTES_NOT_SUPPORTED RTEMS_FLOATING_POINT
-#endif
-
-#if ( CPU_ALL_TASKS_ARE_FP == TRUE )
-#define ATTRIBUTES_REQUIRED RTEMS_FLOATING_POINT
-#else
-#define ATTRIBUTES_REQUIRED 0
-#endif
-
-/*
- * _Attributes_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs initialization for this handler.
- *
- * NOTE: There is no initialization required in C. Conditional compilation
- * takes care of this in C.
- */
-
-#define _Attributes_Handler_initialization()
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/attr.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/clock.h b/c/src/exec/rtems/include/rtems/rtems/clock.h
deleted file mode 100644
index c991d769cf..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/clock.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* clock.h
- *
- * This include file contains all the constants and structures associated
- * with the Clock Manager. This manager provides facilities to set, obtain,
- * and continually update the current date and time.
- *
- * This manager provides directives to:
- *
- * + set the current date and time
- * + obtain the current date and time
- * + announce a clock tick
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CLOCK_h
-#define __RTEMS_CLOCK_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/tod.h>
-#include <rtems/rtems/types.h>
-
-/*
- * List of things which can be returned by the rtems_clock_get directive.
- */
-
-typedef enum {
- RTEMS_CLOCK_GET_TOD,
- RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH,
- RTEMS_CLOCK_GET_TICKS_SINCE_BOOT,
- RTEMS_CLOCK_GET_TICKS_PER_SECOND,
- RTEMS_CLOCK_GET_TIME_VALUE
-} rtems_clock_get_options;
-
-/*
- * Standard flavor style to return TOD in for a rtems_clock_get option.
- */
-
-typedef struct {
- unsigned32 seconds;
- unsigned32 microseconds;
-} rtems_clock_time_value;
-
-/*
- * rtems_clock_get
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_clock_get directive. It returns
- * one of the following:
- * + current time of day
- * + seconds since epoch
- * + ticks since boot
- * + ticks per second
- */
-
-rtems_status_code rtems_clock_get(
- rtems_clock_get_options option,
- void *time_buffer
-);
-
-/*
- * rtems_clock_set
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_clock_set directive. It sets
- * the current time of day to that in the time_buffer record.
- */
-
-rtems_status_code rtems_clock_set(
- rtems_time_of_day *time_buffer
-);
-
-/*
- * rtems_clock_tick
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_clock_tick directive. It is invoked
- * to inform RTEMS of the occurrence of a clock tick.
- */
-
-rtems_status_code rtems_clock_tick( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/config.h b/c/src/exec/rtems/include/rtems/rtems/config.h
deleted file mode 100644
index f395710271..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/config.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* config.h
- *
- * This include file contains the table of user defined configuration
- * parameters specific for the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_CONFIGURATION_h
-#define __RTEMS_RTEMS_CONFIGURATION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/tasks.h>
-
-/*
- * The following records define the Configuration Table. The
- * information contained in this table is required in all
- * RTEMS systems, whether single or multiprocessor. This
- * table primarily defines the following:
- *
- * + required number of each object type
- */
-
-typedef struct {
- unsigned32 maximum_tasks;
- unsigned32 maximum_timers;
- unsigned32 maximum_semaphores;
- unsigned32 maximum_message_queues;
- unsigned32 maximum_partitions;
- unsigned32 maximum_regions;
- unsigned32 maximum_ports;
- unsigned32 maximum_periods;
- unsigned32 number_of_initialization_tasks;
- rtems_initialization_tasks_table *User_initialization_tasks_table;
-} rtems_api_configuration_table;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/dpmem.h b/c/src/exec/rtems/include/rtems/rtems/dpmem.h
deleted file mode 100644
index a74fc90f2a..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/dpmem.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/* dpmem.h
- *
- * This include file contains all the constants and structures associated
- * with the Dual Ported Memory Manager. This manager provides a mechanism
- * for converting addresses between internal and external representations
- * for multiple dual-ported memory areas.
- *
- * Directives provided are:
- *
- * + create a port
- * + get ID of a port
- * + delete a port
- * + convert external to internal address
- * + convert internal to external address
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_DUAL_PORTED_MEMORY_h
-#define __RTEMS_DUAL_PORTED_MEMORY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-
-/*
- * The following structure defines the port control block. Each port
- * has a control block associated with it. This control block contains
- * all information required to support the port related operations.
- */
-
-typedef struct {
- Objects_Control Object;
- void *internal_base; /* base internal address */
- void *external_base; /* base external address */
- unsigned32 length; /* length of dual-ported area */
-} Dual_ported_memory_Control;
-
-/*
- * The following define the internal Dual Ported Memory information.
- */
-
-RTEMS_EXTERN Objects_Information _Dual_ported_memory_Information;
-
-/*
- * _Dual_ported_memory_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Dual_ported_memory_Manager_initialization(
- unsigned32 maximum_ports
-);
-
-/*
- * rtems_port_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_port_create directive. The port
- * will have the name name. The port maps onto an area of dual ported
- * memory of length bytes which has internal_start and external_start
- * as the internal and external starting addresses, respectively.
- * It returns the id of the created port in ID.
- */
-
-rtems_status_code rtems_port_create(
- rtems_name name,
- void *internal_start,
- void *external_start,
- unsigned32 length,
- Objects_Id *id
-);
-
-/*
- * rtems_port_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_port_ident directive. This directive
- * returns the port ID associated with name. If more than one port is
- * named name, then the port to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_port_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_port_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_port_delete directive. It deletes
- * the port associated with ID.
- */
-
-rtems_status_code rtems_port_delete(
- Objects_Id id
-);
-
-/*
- * rtems_port_external_to_internal
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_port_external_to_internal directive.
- * It returns the internal port address which maps to the provided
- * external port address for the specified port ID.
- */
-
-rtems_status_code rtems_port_external_to_internal(
- Objects_Id id,
- void *external,
- void **internal
-);
-
-/*
- * rtems_port_internal_to_external
- *
- * DESCRIPTION:
- *
- * This routine implements the Port_internal_to_external directive.
- * It returns the external port address which maps to the provided
- * internal port address for the specified port ID.
- */
-
-rtems_status_code rtems_port_internal_to_external(
- Objects_Id id,
- void *internal,
- void **external
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/dpmem.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/event.h b/c/src/exec/rtems/include/rtems/rtems/event.h
deleted file mode 100644
index 48045bdade..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/event.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/* event.h
- *
- * This include file contains the information pertaining to the Event
- * Manager. This manager provides a high performance method of communication
- * and synchronization.
- *
- * Directives provided are:
- *
- * + send an event set to a task
- * + receive event condition
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_EVENT_h
-#define __RTEMS_EVENT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/rtems/eventset.h>
-
-/*
- * This constant is passed as the event_in to the
- * rtems_event_receive directive to determine which events are pending.
- */
-
-#define EVENT_CURRENT 0
-
-/*
- * The following enumerated types indicate what happened while the event
- * manager was in the synchronization window.
- */
-
-typedef enum {
- EVENT_SYNC_SYNCHRONIZED,
- EVENT_SYNC_NOTHING_HAPPENED,
- EVENT_SYNC_TIMEOUT,
- EVENT_SYNC_SATISFIED
-} Event_Sync_states;
-
-/*
- * Event_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Event_Manager_initialization( void );
-
-/*
- * rtems_event_send
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_event_send directive. It sends
- * event_in to the task specified by ID. If the task is blocked
- * waiting to receive events and the posting of event_in satisfies
- * the task's event condition, then it is unblocked.
- */
-
-rtems_status_code rtems_event_send (
- Objects_Id id,
- rtems_event_set event_in
-);
-
-/*
- * rtems_event_receive
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_event_receive directive. This
- * directive is invoked when the calling task wishes to receive
- * the event_in event condition. One of the fields in the option_set
- * parameter determines whether the receive request is satisfied if
- * any or all of the events are pending. If the event condition
- * is not satisfied immediately, then the task may block with an
- * optional timeout of TICKS clock ticks or return immediately.
- * This determination is based on another field in the option_set
- * parameter. This directive returns the events received in the
- * event_out parameter.
- */
-
-rtems_status_code rtems_event_receive (
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-);
-
-/*
- * _Event_Seize
- *
- * DESCRIPTION:
- *
- * This routine determines if the event condition event_in is
- * satisfied. If so or if the no_wait option is enabled in option_set,
- * then the procedure returns immediately. If neither of these
- * conditions is true, then the calling task is blocked with an
- * optional timeout of ticks clock ticks.
- */
-
-void _Event_Seize (
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-);
-
-/*
- * _Event_Surrender
- *
- * DESCRIPTION:
- *
- * This routine determines if the event condition of the_thread
- * has been satisfied. If so, it unblocks the_thread.
- */
-
-void _Event_Surrender (
- Thread_Control *the_thread
-);
-
-/*
- * _Event_Timeout
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task's event receive request
- * has not been satisfied after the specified timeout interval.
- * The task represented by ID will be unblocked and its status
- * code will be set in it's control block to indicate that a timeout
- * has occurred.
- */
-
-void _Event_Timeout (
- Objects_Id id,
- void *ignored
-);
-
-/*
- * The following defines the synchronization flag used by the
- * Event Manager to insure that signals sent to the currently
- * executing thread are received properly.
- */
-
-RTEMS_EXTERN volatile Event_Sync_states _Event_Sync_state;
-
-#include <rtems/rtems/eventmp.h>
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/event.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/eventmp.h b/c/src/exec/rtems/include/rtems/rtems/eventmp.h
deleted file mode 100644
index 2d609cbb37..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/eventmp.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* eventmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Event Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_EVENT_MP_h
-#define __RTEMS_EVENT_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/event.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote event operations.
- */
-
-typedef enum {
- EVENT_MP_SEND_REQUEST = 0,
- EVENT_MP_SEND_RESPONSE = 1
-} Event_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote event operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Event_MP_Remote_operations operation;
- rtems_event_set event_in;
-} Event_MP_Packet;
-
-/*
- * _Event_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- *
- * This routine is not needed since there are no process
- * packets to be sent by this manager.
- */
-
-/*
- * _Event_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Event_MP_Send_request_packet (
- Event_MP_Remote_operations operation,
- Objects_Id event_id,
- rtems_event_set event_in
-);
-
-/*
- * _Event_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Event_MP_Send_response_packet (
- Event_MP_Remote_operations operation,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Event_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Event_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Event_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _Event_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _Event_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a event mp packet.
- */
-
-Event_MP_Packet *_Event_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/eventset.h b/c/src/exec/rtems/include/rtems/rtems/eventset.h
deleted file mode 100644
index fe1f9eb170..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/eventset.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* eventset.h
- *
- * This include file contains the information pertaining to the
- * Event Sets Handler. This handler provides methods for the manipulation
- * of event sets which will be sent and received by tasks.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_EVENT_SET_h
-#define __RTEMS_EVENT_SET_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following defines the type used to control event sets.
- */
-
-typedef unsigned32 rtems_event_set;
-
-/*
- * The following constants define the individual events which may
- * be used to compose an event set.
- */
-
-#define RTEMS_PENDING_EVENTS 0 /* receive pending events */
-#define RTEMS_ALL_EVENTS 0xFFFFFFFF
-
-#define RTEMS_EVENT_0 0x00000001
-#define RTEMS_EVENT_1 0x00000002
-#define RTEMS_EVENT_2 0x00000004
-#define RTEMS_EVENT_3 0x00000008
-#define RTEMS_EVENT_4 0x00000010
-#define RTEMS_EVENT_5 0x00000020
-#define RTEMS_EVENT_6 0x00000040
-#define RTEMS_EVENT_7 0x00000080
-#define RTEMS_EVENT_8 0x00000100
-#define RTEMS_EVENT_9 0x00000200
-#define RTEMS_EVENT_10 0x00000400
-#define RTEMS_EVENT_11 0x00000800
-#define RTEMS_EVENT_12 0x00001000
-#define RTEMS_EVENT_13 0x00002000
-#define RTEMS_EVENT_14 0x00004000
-#define RTEMS_EVENT_15 0x00008000
-#define RTEMS_EVENT_16 0x00010000
-#define RTEMS_EVENT_17 0x00020000
-#define RTEMS_EVENT_18 0x00040000
-#define RTEMS_EVENT_19 0x00080000
-#define RTEMS_EVENT_20 0x00100000
-#define RTEMS_EVENT_21 0x00200000
-#define RTEMS_EVENT_22 0x00400000
-#define RTEMS_EVENT_23 0x00800000
-#define RTEMS_EVENT_24 0x01000000
-#define RTEMS_EVENT_25 0x02000000
-#define RTEMS_EVENT_26 0x04000000
-#define RTEMS_EVENT_27 0x08000000
-#define RTEMS_EVENT_28 0x10000000
-#define RTEMS_EVENT_29 0x20000000
-#define RTEMS_EVENT_30 0x40000000
-#define RTEMS_EVENT_31 0x80000000
-
-
-/*
- * The following constant is the value of an event set which
- * has no events pending.
- */
-
-#define EVENT_SETS_NONE_PENDING 0
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/eventset.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/intr.h b/c/src/exec/rtems/include/rtems/rtems/intr.h
deleted file mode 100644
index 168806bff2..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/intr.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/* intr.h
- *
- * This include file contains all the constants and structures associated
- * with the Interrupt Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_INTERRUPT_h
-#define __RTEMS_INTERRUPT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/isr.h>
-
-/*
- * Interrupt level type
- */
-
-typedef ISR_Level rtems_interrupt_level;
-
-/*
- * The following type defines the control block used to manage
- * the vectors.
- */
-
-typedef ISR_Vector_number rtems_vector_number;
-
-/*
- * Return type for ISR Handler
- */
-
-typedef void rtems_isr;
-
-/*
- * Pointer to an ISR Handler
- */
-
-typedef rtems_isr ( *rtems_isr_entry )(
- rtems_vector_number
- );
-
-/*
- * _Interrupt_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the interrupt manager.
- *
- */
-
-void _Interrupt_Manager_initialization( void );
-
-/*
- * rtems_interrupt_catch
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_interrupt_catch directive. This
- * directive installs new_isr_handler as the RTEMS interrupt service
- * routine for vector. The previous RTEMS interrupt service
- * routine is returned in old_isr_handler.
- */
-
-rtems_status_code rtems_interrupt_catch(
- rtems_isr_entry new_isr_handler,
- rtems_vector_number vector,
- rtems_isr_entry *old_isr_handler
-);
-
-/*
- * rtems_interrupt_disable
- *
- * DESCRIPTION:
- *
- * This routine disables all maskable interrupts and returns the
- * previous level in _isr_cookie.
- */
-
-#define rtems_interrupt_disable( _isr_cookie ) \
- _ISR_Disable(_isr_cookie)
-
-/*
- * rtems_interrupt_enable
- *
- * DESCRIPTION:
- *
- * This routine enables maskable interrupts to the level indicated
- * _isr_cookie.
- */
-
-#define rtems_interrupt_enable( _isr_cookie ) \
- _ISR_Enable(_isr_cookie)
-
-/*
- * rtems_interrupt_flash
- *
- * DESCRIPTION:
- *
- * This routine temporarily enables maskable interrupts to the
- * level in _isr_cookie before redisabling them.
- */
-
-#define rtems_interrupt_flash( _isr_cookie ) \
- _ISR_Flash(_isr_cookie)
-
-/*
- * rtems_interrupt_is_in_progress
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the processor is currently servicing
- * an interrupt and FALSE otherwise. A return value of TRUE indicates
- * that the caller is an interrupt service routine, NOT a thread. The
- * directives available to an interrupt service routine are restricted.
- */
-
-#define rtems_interrupt_is_in_progress() \
- _ISR_Is_in_progress()
-
-/*
- * rtems_interrupt_cause
- *
- * DESCRIPTION:
- *
- * This routine generates an interrupt.
- *
- * NOTE: No implementation.
- */
-
-#define rtems_interrupt_cause( _interrupt_to_cause )
-
-/*
- * rtems_interrupt_cause
- *
- * DESCRIPTION:
- *
- * This routine clears the specified interrupt.
- *
- * NOTE: No implementation.
- */
-
-#define rtems_interrupt_clear( _interrupt_to_clear )
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/message.h b/c/src/exec/rtems/include/rtems/rtems/message.h
deleted file mode 100644
index 611d46fde8..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/message.h
+++ /dev/null
@@ -1,334 +0,0 @@
-/* message.h
- *
- * This include file contains all the constants and structures associated
- * with the Message Queue Manager. This manager provides a mechanism for
- * communication and synchronization between tasks using messages.
- *
- * Directives provided are:
- *
- * + create a queue
- * + get ID of a queue
- * + delete a queue
- * + put a message at the rear of a queue
- * + put a message at the front of a queue
- * + broadcast N messages to a queue
- * + receive message from a queue
- * + flush all messages on a queue
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MESSAGE_QUEUE_h
-#define __RTEMS_MESSAGE_QUEUE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/coremsg.h>
-
-/*
- * The following enumerated type details the modes in which a message
- * may be submitted to a message queue. The message may be posted
- * in a send or urgent fashion.
- */
-
-typedef enum {
- MESSAGE_QUEUE_SEND_REQUEST = 0,
- MESSAGE_QUEUE_URGENT_REQUEST = 1
-} Message_queue_Submit_types;
-
-/*
- * The following records define the control block used to manage
- * each message queue.
- */
-
-typedef struct {
- Objects_Control Object;
- rtems_attribute attribute_set;
- CORE_message_queue_Control message_queue;
-} Message_queue_Control;
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Message_queue_Information;
-
-/*
- * _Message_queue_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Message_queue_Manager_initialization(
- unsigned32 maximum_message_queues
-);
-
-/*
- * rtems_message_queue_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_create directive. The
- * message queue will have the name name. If the attribute_set indicates
- * that the message queue is to be limited in the number of messages
- * that can be outstanding, then count indicates the maximum number of
- * messages that will be held. It returns the id of the created
- * message queue in ID.
- */
-
-rtems_status_code rtems_message_queue_create(
- rtems_name name,
- unsigned32 count,
- unsigned32 max_message_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-);
-
-/*
- * rtems_message_queue_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_ident directive.
- * This directive returns the message queue ID associated with NAME.
- * If more than one message queue is named name, then the message
- * queue to which the ID belongs is arbitrary. node indicates the
- * extent of the search for the ID of the message queue named name.
- * The search can be limited to a particular node or allowed to
- * encompass all nodes.
- */
-
-rtems_status_code rtems_message_queue_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-);
-
-/*
- * rtems_message_queue_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_delete directive. The
- * message queue indicated by ID is deleted.
- */
-
-rtems_status_code rtems_message_queue_delete(
- Objects_Id id
-);
-
-/*
- * rtems_message_queue_send
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_send directive.
- * This directive sends the message buffer to the message queue
- * indicated by ID. If one or more tasks is blocked waiting
- * to receive a message from this message queue, then one will
- * receive the message. The task selected to receive the
- * message is based on the task queue discipline algorithm in
- * use by this particular message queue. If no tasks are waiting,
- * then the message buffer will be placed at the rear of the
- * chain of pending messages for this message queue.
- */
-
-rtems_status_code rtems_message_queue_send(
- Objects_Id id,
- void *buffer,
- unsigned32 size
-);
-
-/*
- * rtems_message_queue_urgent
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_send directive.
- * This directive sends the message buffer to the message queue
- * indicated by ID. If one or more tasks is blocked waiting
- * to receive a message from this message queue, then one will
- * receive the message. The task selected to receive the
- * message is based on the task queue discipline algorithm in
- * use by this particular message queue. If no tasks are waiting,
- * then the message buffer will be placed at the rear of the
- * chain of pending messages for this message queue.
- */
-
-rtems_status_code rtems_message_queue_urgent(
- Objects_Id id,
- void *buffer,
- unsigned32 size
-);
-
-/*
- * rtems_message_queue_broadcast
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_send directive.
- * This directive sends the message buffer to the message queue
- * indicated by ID. If one or more tasks is blocked waiting
- * to receive a message from this message queue, then one will
- * receive the message. The task selected to receive the
- * message is based on the task queue discipline algorithm in
- * use by this particular message queue. If no tasks are waiting,
- * then the message buffer will be placed at the rear of the
- * chain of pending messages for this message queue.
- */
-
-rtems_status_code rtems_message_queue_broadcast(
- Objects_Id id,
- void *buffer,
- unsigned32 size,
- unsigned32 *count
-);
-
-/*
- * rtems_message_queue_receive
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_receive directive.
- * This directive is invoked when the calling task wishes to receive
- * a message from the message queue indicated by ID. The received
- * message is to be placed in buffer. If no messages are outstanding
- * and the option_set indicates that the task is willing to block,
- * then the task will be blocked until a message arrives or until,
- * optionally, timeout clock ticks have passed.
- */
-
-rtems_status_code rtems_message_queue_receive(
- Objects_Id id,
- void *buffer,
- unsigned32 *size,
- unsigned32 option_set,
- rtems_interval timeout
-);
-
-/*
- * rtems_message_queue_flush
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_flush directive.
- * This directive takes all outstanding messages for the message
- * queue indicated by ID and returns them to the inactive message
- * chain. The number of messages flushed is returned in COUNT.
- */
-
-rtems_status_code rtems_message_queue_flush(
- Objects_Id id,
- unsigned32 *count
-);
-
-/*
- * rtems_message_queue_get_number_pending
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_get_number_pending
- * directive. This directive returns the number of pending
- * messages for the message queue indicated by ID
- * chain. The number of messages pending is returned in COUNT.
- */
-
-rtems_status_code rtems_message_queue_get_number_pending(
- Objects_Id id,
- unsigned32 *count
-);
-
-
-/*
- * _Message_queue_Submit
- *
- * DESCRIPTION:
- *
- * This routine implements the directives rtems_message_queue_send
- * and rtems_message_queue_urgent. It processes a message that is
- * to be submitted to the designated message queue. The message will
- * either be processed as a send send message which it will be inserted
- * at the rear of the queue or it will be processed as an urgent message
- * which will be inserted at the front of the queue.
- */
-
-rtems_status_code _Message_queue_Submit(
- Objects_Id id,
- void *buffer,
- unsigned32 size,
- Message_queue_Submit_types submit_type
-);
-
-/*
- * _Message_queue_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a message queue control block from
- * the inactive chain of free message queue control blocks.
- */
-
-Message_queue_Control *_Message_queue_Allocate (
- unsigned32 count,
- unsigned32 max_message_size
-);
-
-/*
- * _Message_queue_Translate_core_message_queue_return_code
- *
- * DESCRIPTION:
- *
- * This function returns a RTEMS status code based on the core message queue
- * status code specified.
- */
-
-rtems_status_code _Message_queue_Translate_core_message_queue_return_code (
- unsigned32 the_message_queue_status
-);
-
-/*
- *
- * _Message_queue_Core_message_queue_mp_support
- *
- * Input parameters:
- * the_thread - the remote thread the message was submitted to
- * id - id of the message queue
- *
- * Output parameters: NONE
- */
-
-void _Message_queue_Core_message_queue_mp_support (
- Thread_Control *the_thread,
- Objects_Id id
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/message.inl>
-#endif
-#include <rtems/rtems/msgmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/modes.h b/c/src/exec/rtems/include/rtems/rtems/modes.h
deleted file mode 100644
index 05205078c5..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/modes.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* modes.h
- *
- * This include file contains all constants and structures associated
- * with the RTEMS thread and RTEMS_ASR modes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MODES_h
-#define __RTEMS_MODES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/isr.h>
-
-/*
- * The following type defines the control block used to manage
- * each a mode set.
- */
-
-typedef unsigned32 Modes_Control;
-
-/*
- * The following constants define the individual modes and masks
- * which may be used to compose a mode set and to alter modes.
- */
-
-#define RTEMS_ALL_MODE_MASKS 0x0000ffff
-
-#define RTEMS_DEFAULT_MODES 0x00000000
-#define RTEMS_CURRENT_MODE 0
-
-#define RTEMS_PREEMPT_MASK 0x00000100 /* preemption bit */
-#define RTEMS_TIMESLICE_MASK 0x00000200 /* timeslice bit */
-#define RTEMS_ASR_MASK 0x00000400 /* RTEMS_ASR enable bit */
-#define RTEMS_INTERRUPT_MASK CPU_MODES_INTERRUPT_MASK
-
-#define RTEMS_PREEMPT 0x00000000 /* enable preemption */
-#define RTEMS_NO_PREEMPT 0x00000100 /* disable preemption */
-
-#define RTEMS_NO_TIMESLICE 0x00000000 /* disable timeslicing */
-#define RTEMS_TIMESLICE 0x00000200 /* enable timeslicing */
-
-#define RTEMS_ASR 0x00000000 /* enable RTEMS_ASR */
-#define RTEMS_NO_ASR 0x00000400 /* disable RTEMS_ASR */
-
-/*
- * The number of bits for interrupt levels is CPU dependent.
- * RTEMS supports 0 to 256 levels in bits 0-7 of the mode.
- */
-
-/*PAGE
- *
- * RTEMS_INTERRUPT_LEVEL
- *
- * DESCRIPTION:
- *
- * This function returns the processor dependent interrupt
- * level which corresponds to the requested interrupt level.
- *
- * NOTE: RTEMS supports 256 interrupt levels using the least
- * significant eight bits of MODES.CONTROL. On any
- * particular CPU, fewer than 256 levels may be supported.
- */
-
-#define RTEMS_INTERRUPT_LEVEL( _mode_set ) \
- ( (_mode_set) & RTEMS_INTERRUPT_MASK )
-
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/modes.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/mp.h b/c/src/exec/rtems/include/rtems/rtems/mp.h
deleted file mode 100644
index 77dd8a707f..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/mp.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* mp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MP_h
-#define __RTEMS_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- *
- * _Multiprocessing_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Multiprocessing_Manager_initialization ( void );
-
-/*
- *
- * rtems_multiprocessing_announce
- *
- * DESCRIPTION:
- *
- * This routine implements the MULTIPROCESSING_ANNOUNCE directive.
- * It is invoked by the MPCI layer to indicate that an MPCI packet
- * has been received.
- */
-
-void rtems_multiprocessing_announce ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/msgmp.h b/c/src/exec/rtems/include/rtems/rtems/msgmp.h
deleted file mode 100644
index 64fa8da93b..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/msgmp.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/* msgmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Message Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MESSAGE_QUEUE_MP_h
-#define __RTEMS_MESSAGE_QUEUE_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/message.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote message queue operations.
- */
-
-typedef enum {
- MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0,
- MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1,
- MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2,
- MESSAGE_QUEUE_MP_RECEIVE_REQUEST = 3,
- MESSAGE_QUEUE_MP_RECEIVE_RESPONSE = 4,
- MESSAGE_QUEUE_MP_SEND_REQUEST = 5,
- MESSAGE_QUEUE_MP_SEND_RESPONSE = 6,
- MESSAGE_QUEUE_MP_URGENT_REQUEST = 7,
- MESSAGE_QUEUE_MP_URGENT_RESPONSE = 8,
- MESSAGE_QUEUE_MP_BROADCAST_REQUEST = 9,
- MESSAGE_QUEUE_MP_BROADCAST_RESPONSE = 10,
- MESSAGE_QUEUE_MP_FLUSH_REQUEST = 11,
- MESSAGE_QUEUE_MP_FLUSH_RESPONSE = 12,
- MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST = 13,
- MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE = 14
-} Message_queue_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote message queue operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Message_queue_MP_Remote_operations operation;
- rtems_name name;
- rtems_option option_set;
- Objects_Id proxy_id;
- unsigned32 count;
- unsigned32 size;
- unsigned32 pad0;
- CORE_message_queue_Buffer Buffer;
-} Message_queue_MP_Packet;
-
-/*
- * _Message_queue_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _Message_queue_MP_Send_process_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- rtems_name name,
- Objects_Id proxy_id
-);
-
-/*
- * _Message_queue_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Message_queue_MP_Send_request_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- void *buffer,
- unsigned32 *size_p,
- rtems_option option_set,
- Watchdog_Interval timeout
-);
-
-/*
- * _Message_queue_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Message_queue_MP_Send_response_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Message_queue_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Message_queue_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Message_queue_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _Message_queue_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _Message_queue_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _Message_queue_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _Message_queue_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a message queue mp packet.
- */
-
-Message_queue_MP_Packet *_Message_queue_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/options.h b/c/src/exec/rtems/include/rtems/rtems/options.h
deleted file mode 100644
index 7746524f98..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/options.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* options.h
- *
- * This include file contains information which defines the
- * options available on many directives.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_OPTIONS_h
-#define __RTEMS_OPTIONS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type defines the control block used to manage
- * option sets.
- */
-
-typedef unsigned32 rtems_option;
-
-/*
- * The following constants define the individual options which may
- * be used to compose an option set.
- */
-
-#define RTEMS_DEFAULT_OPTIONS 0x00000000
-
-#define RTEMS_WAIT 0x00000000 /* wait on resource */
-#define RTEMS_NO_WAIT 0x00000001 /* do not wait on resource */
-
-#define RTEMS_EVENT_ALL 0x00000000 /* wait for all events */
-#define RTEMS_EVENT_ANY 0x00000002 /* wait on any event */
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/options.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/part.h b/c/src/exec/rtems/include/rtems/rtems/part.h
deleted file mode 100644
index 1d720db146..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/part.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/* partition.h
- *
- * This include file contains all the constants and structures associated
- * with the Partition Manager. This manager provides facilities to
- * dynamically allocate memory in fixed-sized units which are returned
- * as buffers.
- *
- * Directives provided are:
- *
- * + create a partition
- * + get an ID of a partition
- * + delete a partition
- * + get a buffer from a partition
- * + return a buffer to a partition
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_PARTITION_h
-#define __RTEMS_PARTITION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/address.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/rtems/types.h>
-
-/*
- * The following defines the control block used to manage each partition.
- */
-
-typedef struct {
- Objects_Control Object;
- void *starting_address; /* physical address */
- unsigned32 length; /* in bytes */
- unsigned32 buffer_size; /* in bytes */
- rtems_attribute attribute_set; /* attributes */
- unsigned32 number_of_used_blocks; /* or allocated buffers */
- Chain_Control Memory; /* buffer chain */
-} Partition_Control;
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Partition_Information;
-
-/*
- * _Partition_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Partition_Manager_initialization(
- unsigned32 maximum_partitions
-);
-
-/*
- * rtems_partition_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_create directive. The
- * partition will have the name name. The memory area managed by
- * the partition is of length bytes and starts at starting_address.
- * The memory area will be divided into as many buffers of
- * buffer_size bytes as possible. The attribute_set determines if
- * the partition is global or local. It returns the id of the
- * created partition in ID.
- */
-
-rtems_status_code rtems_partition_create(
- rtems_name name,
- void *starting_address,
- unsigned32 length,
- unsigned32 buffer_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-);
-
-/*
- * rtems_partition_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_ident directive.
- * This directive returns the partition ID associated with name.
- * If more than one partition is named name, then the partition
- * to which the ID belongs is arbitrary. node indicates the
- * extent of the search for the ID of the partition named name.
- * The search can be limited to a particular node or allowed to
- * encompass all nodes.
- */
-
-rtems_status_code rtems_partition_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-);
-
-/*
- * rtems_partition_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_delete directive. The
- * partition indicated by ID is deleted.
- */
-
-rtems_status_code rtems_partition_delete(
- Objects_Id id
-);
-
-/*
- * rtems_partition_get_buffer
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_get_buffer directive. It
- * attempts to allocate a buffer from the partition associated with ID.
- * If a buffer is allocated, its address is returned in buffer.
- */
-
-rtems_status_code rtems_partition_get_buffer(
- Objects_Id id,
- void **buffer
-);
-
-/*
- * rtems_partition_return_buffer
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_return_buffer directive. It
- * frees the buffer to the partition associated with ID. The buffer must
- * have been previously allocated from the same partition.
- */
-
-rtems_status_code rtems_partition_return_buffer(
- Objects_Id id,
- void *buffer
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/part.inl>
-#endif
-#include <rtems/rtems/partmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/partmp.h b/c/src/exec/rtems/include/rtems/rtems/partmp.h
deleted file mode 100644
index 0bac39258b..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/partmp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* partmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Partition Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_PARTITION_MP_h
-#define __RTEMS_PARTITION_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/thread.h>
-
-#include <rtems/rtems/part.h>
-
-/*
- * The following enumerated type defines the list of
- * remote partition operations.
- */
-
-typedef enum {
- PARTITION_MP_ANNOUNCE_CREATE = 0,
- PARTITION_MP_ANNOUNCE_DELETE = 1,
- PARTITION_MP_EXTRACT_PROXY = 2,
- PARTITION_MP_GET_BUFFER_REQUEST = 3,
- PARTITION_MP_GET_BUFFER_RESPONSE = 4,
- PARTITION_MP_RETURN_BUFFER_REQUEST = 5,
- PARTITION_MP_RETURN_BUFFER_RESPONSE = 6
-} Partition_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote partition operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Partition_MP_Remote_operations operation;
- rtems_name name;
- void *buffer;
- Objects_Id proxy_id;
-} Partition_MP_Packet;
-
-/*
- * _Partition_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _Partition_MP_Send_process_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- rtems_name name,
- Objects_Id proxy_id
-);
-
-/*
- * _Partition_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Partition_MP_Send_request_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- void *buffer
-);
-
-/*
- * _Partition_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Partition_MP_Send_response_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Partition_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Partition_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Partition_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed by the Partition since a partition
- * cannot be deleted when buffers are in use.
- */
-
-/*
- * _Partition_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _Partition_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _Partition_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a partition mp packet.
- */
-
-Partition_MP_Packet *_Partition_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/ratemon.h b/c/src/exec/rtems/include/rtems/rtems/ratemon.h
deleted file mode 100644
index 0e1dfbfad3..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/ratemon.h
+++ /dev/null
@@ -1,213 +0,0 @@
-/* ratemon.h
- *
- * This include file contains all the constants, structures, and
- * prototypes associated with the Rate Monotonic Manager. This manager
- * provides facilities to implement tasks which execute in a periodic fashion.
- *
- * Directives provided are:
- *
- * + create a rate monotonic timer
- * + cancel a period
- * + delete a rate monotonic timer
- * + conclude current and start the next period
- * + obtain status information on a period
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RATE_MONOTONIC_h
-#define __RTEMS_RATE_MONOTONIC_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the states in which a
- * period may be.
- */
-
-typedef enum {
- RATE_MONOTONIC_INACTIVE, /* off chain, never initialized */
- RATE_MONOTONIC_OWNER_IS_BLOCKING, /* on chain, owner is blocking on it */
- RATE_MONOTONIC_ACTIVE, /* on chain, running continuously */
- RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING, /* on chain, expired while owner was */
- /* was blocking on it */
- RATE_MONOTONIC_EXPIRED /* off chain, will be reset by next */
- /* rtems_rate_monotonic_period */
-} rtems_rate_monotonic_period_states;
-
-/*
- * The following constant is the interval passed to the rate_monontonic_period
- * directive to obtain status information.
- */
-
-#define RTEMS_PERIOD_STATUS WATCHDOG_NO_TIMEOUT
-
-/*
- * The following defines the period status structure.
- */
-
-typedef struct {
- rtems_rate_monotonic_period_states state;
- unsigned32 ticks_since_last_period;
- unsigned32 ticks_executed_since_last_period;
-} rtems_rate_monotonic_period_status;
-
-/*
- * The following structure defines the control block used to manage
- * each period.
- */
-
-typedef struct {
- Objects_Control Object;
- Watchdog_Control Timer;
- rtems_rate_monotonic_period_states state;
- unsigned32 owner_ticks_executed_at_period;
- unsigned32 time_at_period;
- Thread_Control *owner;
-} Rate_monotonic_Control;
-
-RTEMS_EXTERN Objects_Information _Rate_monotonic_Information;
-
-/*
- * _Rate_monotonic_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Rate_monotonic_Manager_initialization(
- unsigned32 maximum_periods
-);
-
-/*
- * rtems_rate_monotonic_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rate_monotonic_create directive. The
- * period will have the name name. It returns the id of the
- * created period in ID.
- */
-
-rtems_status_code rtems_rate_monotonic_create(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_rate_monotonic_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_ident directive.
- * This directive returns the period ID associated with name.
- * If more than one period is named name, then the period
- * to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_rate_monotonic_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_rate_monotonic_cancel
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_cancel directive. This
- * directive stops the period associated with ID from continuing to
- * run.
- */
-
-rtems_status_code rtems_rate_monotonic_cancel(
- Objects_Id id
-);
-
-/*
- * rtems_rate_monotonic_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_delete directive. The
- * period indicated by ID is deleted.
- */
-
-rtems_status_code rtems_rate_monotonic_delete(
- Objects_Id id
-);
-
-/*
- * rtems_rate_monotonic_get_status
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_get_status directive.
- * Information about the period indicated by ID is returned.
- *
- */
-
-rtems_status_code rtems_rate_monotonic_get_status(
- Objects_Id id,
- rtems_rate_monotonic_period_status *status
-);
-
-/*
- * rtems_rate_monotonic_period
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_period directive. When
- * length is non-zero, this directive initiates the period associated with
- * ID from continuing for a period of length. If length is zero, then
- * result is set to indicate the current state of the period.
- */
-
-rtems_status_code rtems_rate_monotonic_period(
- Objects_Id id,
- rtems_interval length
-);
-
-/*
- * _Rate_monotonic_Timeout
- *
- * DESCRIPTION:
- *
- * This routine is invoked when the period represented
- * by ID expires. If the task which owns this period is blocked
- * waiting for the period to expire, then it is readied and the
- * period is restarted. If the owning task is not waiting for the
- * period to expire, then the period is placed in the EXPIRED
- * state and not restarted.
- */
-
-void _Rate_monotonic_Timeout (
- Objects_Id id,
- void *ignored
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/ratemon.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/region.h b/c/src/exec/rtems/include/rtems/rtems/region.h
deleted file mode 100644
index 05418f6a95..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/region.h
+++ /dev/null
@@ -1,234 +0,0 @@
-/* region.h
- *
- * This include file contains all the constants and structures associated
- * with the Region Manager. This manager provides facilities to dynamically
- * allocate memory in variable sized units which are returned as segments.
- *
- * Directives provided are:
- *
- * + create a region
- * + get an ID of a region
- * + delete a region
- * + get a segment from a region
- * + return a segment to a region
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_REGION_h
-#define __RTEMS_REGION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/heap.h>
-#include <rtems/debug.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/rtems/types.h>
-
-/*
- * The following records define the control block used to manage
- * each region.
- */
-
-typedef struct {
- Objects_Control Object;
- Thread_queue_Control Wait_queue; /* waiting threads */
- void *starting_address; /* physical start addr */
- unsigned32 length; /* physical length(bytes) */
- unsigned32 page_size; /* in bytes */
- unsigned32 maximum_segment_size; /* in bytes */
- rtems_attribute attribute_set;
- unsigned32 number_of_used_blocks; /* blocks allocated */
- Heap_Control Memory;
-} Region_Control;
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Region_Information;
-
-/*
- * _Region_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Region_Manager_initialization(
- unsigned32 maximum_regions
-);
-
-/*
- * rtems_region_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_create directive. The
- * region will have the name name. The memory area managed by
- * the region is of length bytes and starts at starting_address.
- * The memory area will be divided into as many allocatable units of
- * page_size bytes as possible. The attribute_set determines which
- * thread queue discipline is used by the region. It returns the
- * id of the created region in ID.
- */
-
-rtems_status_code rtems_region_create(
- rtems_name name,
- void *starting_address,
- unsigned32 length,
- unsigned32 page_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-);
-
-/*
- * rtems_region_extend
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_extend directive. The
- * region will have the name name. The memory area managed by
- * the region will be attempted to be grown by length bytes using
- * the memory starting at starting_address.
- */
-
-rtems_status_code rtems_region_extend(
- Objects_Id id,
- void *starting_address,
- unsigned32 length
-);
-
-/*
- * rtems_region_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_ident directive.
- * This directive returns the region ID associated with name.
- * If more than one region is named name, then the region
- * to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_region_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_region_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_delete directive. The
- * region indicated by ID is deleted.
- */
-
-rtems_status_code rtems_region_delete(
- Objects_Id id
-);
-
-/*
- * rtems_region_get_segment
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_get_segment directive. It
- * attempts to allocate a segment from the region associated with ID.
- * If a segment of the requested size can be allocated, its address
- * is returned in segment. If no segment is available, then the task
- * may return immediately or block waiting for a segment with an optional
- * timeout of timeout clock ticks. Whether the task blocks or returns
- * immediately is based on the no_wait option in the option_set.
- */
-
-rtems_status_code rtems_region_get_segment(
- Objects_Id id,
- unsigned32 size,
- rtems_option option_set,
- rtems_interval timeout,
- void **segment
-);
-
-/*
- * rtems_region_get_segment_size
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_get_segment_size directive. It
- * returns the size in bytes of the specified user memory area.
- */
-
-rtems_status_code rtems_region_get_segment_size(
- Objects_Id id,
- void *segment,
- unsigned32 *size
-);
-
-/*
- * rtems_region_return_segment
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_return_segment directive. It
- * frees the segment to the region associated with ID. The segment must
- * have been previously allocated from the same region. If freeing the
- * segment results in enough memory being available to satisfy the
- * rtems_region_get_segment of the first blocked task, then that task and as
- * many subsequent tasks as possible will be unblocked with their requests
- * satisfied.
- */
-
-rtems_status_code rtems_region_return_segment(
- Objects_Id id,
- void *segment
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/region.inl>
-#endif
-#include <rtems/rtems/regionmp.h>
-
-/*
- * _Region_Debug_Walk
- *
- * DESCRIPTION:
- *
- * This routine is invoked to verify the integrity of a heap associated
- * with the_region.
- */
-
-#ifdef RTEMS_DEBUG
-
-#define _Region_Debug_Walk( _the_region, _source ) \
- do { \
- if ( _Debug_Is_enabled( RTEMS_DEBUG_REGION ) ) \
- _Heap_Walk( &(_the_region)->Memory, _source, FALSE ); \
- } while ( 0 )
-
-#else
-
-#define _Region_Debug_Walk( _the_region, _source )
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/regionmp.h b/c/src/exec/rtems/include/rtems/rtems/regionmp.h
deleted file mode 100644
index fcdfa03178..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/regionmp.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/* regionmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Region Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_REGION_MP_h
-#define __RTEMS_REGION_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/region.h>
-
-/*
- * The following enumerated type defines the list of
- * remote region operations.
- */
-
-typedef enum {
- REGION_MP_ANNOUNCE_CREATE = 0,
- REGION_MP_ANNOUNCE_DELETE = 1,
- REGION_MP_EXTRACT_PROXY = 2,
- REGION_MP_GET_SEGMENT_REQUEST = 3,
- REGION_MP_GET_SEGMENT_RESPONSE = 4,
- REGION_MP_RETURN_SEGMENT_REQUEST = 5,
- REGION_MP_RETURN_SEGMENT_RESPONSE = 6
-} Region_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote region operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Region_MP_Remote_operations operation;
- rtems_name name;
- rtems_option option_set;
- unsigned32 size;
- Objects_Id proxy_id;
- void *segment;
-} Region_MP_Packet;
-
-/*
- * _Region_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _Region_MP_Send_process_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- rtems_name name,
- Objects_Id proxy_id
-);
-
-/*
- * _Region_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Region_MP_Send_request_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- void *segment,
- unsigned32 size,
- rtems_option option_set,
- rtems_interval timeout
-);
-
-/*
- * _Region_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Region_MP_Send_response_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Region_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Region_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Region_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed by the Region since a region
- * cannot be deleted when segments are in use.
- */
-
-/*
- * _Region_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _Region_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _Region_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a region mp packet.
- */
-
-Region_MP_Packet *_Region_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/rtemsapi.h b/c/src/exec/rtems/include/rtems/rtems/rtemsapi.h
deleted file mode 100644
index dcea660f43..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/rtemsapi.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * RTEMS API Support
- *
- * NOTE:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_API_h
-#define __RTEMS_API_h
-
-#include <rtems/config.h>
-
-/*PAGE
- *
- * _RTEMS_API_Initialize
- *
- * XXX
- */
-
-void _RTEMS_API_Initialize(
- rtems_configuration_table *configuration_table
-);
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/sem.h b/c/src/exec/rtems/include/rtems/rtems/sem.h
deleted file mode 100644
index 191e62b414..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/sem.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/* semaphore.h
- *
- * This include file contains all the constants and structures associated
- * with the Semaphore Manager. This manager utilizes standard Dijkstra
- * counting semaphores to provide synchronization and mutual exclusion
- * capabilities.
- *
- * Directives provided are:
- *
- * + create a semaphore
- * + get an ID of a semaphore
- * + delete a semaphore
- * + acquire a semaphore
- * + release a semaphore
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SEMAPHORE_h
-#define __RTEMS_SEMAPHORE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/score/coremutex.h>
-#include <rtems/score/object.h>
-#include <rtems/score/coresem.h>
-#include <rtems/score/threadq.h>
-
-/*
- * The following defines the control block used to manage each semaphore.
- */
-
-typedef struct {
- Objects_Control Object;
- rtems_attribute attribute_set;
- union {
- CORE_mutex_Control mutex;
- CORE_semaphore_Control semaphore;
- } Core_control;
-} Semaphore_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Semaphore_Information;
-
-/*
- * _Semaphore_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Semaphore_Manager_initialization(
- unsigned32 maximum_semaphores
-);
-
-/*
- * rtems_semaphore_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_create directive. The
- * semaphore will have the name name. The starting count for
- * the semaphore is count. The attribute_set determines if
- * the semaphore is global or local and the thread queue
- * discipline. It returns the id of the created semaphore in ID.
- */
-
-rtems_status_code rtems_semaphore_create(
- rtems_name name,
- unsigned32 count,
- rtems_attribute attribute_set,
- rtems_task_priority priority_ceiling,
- rtems_id *id
-);
-
-/*
- * rtems_semaphore_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_ident directive.
- * This directive returns the semaphore ID associated with name.
- * If more than one semaphore is named name, then the semaphore
- * to which the ID belongs is arbitrary. node indicates the
- * extent of the search for the ID of the semaphore named name.
- * The search can be limited to a particular node or allowed to
- * encompass all nodes.
- */
-
-rtems_status_code rtems_semaphore_ident(
- rtems_name name,
- unsigned32 node,
- rtems_id *id
-);
-
-/*
- * rtems_semaphore_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_delete directive. The
- * semaphore indicated by ID is deleted.
- */
-
-rtems_status_code rtems_semaphore_delete(
- rtems_id id
-);
-
-/*
- * rtems_semaphore_obtain
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_obtain directive. It
- * attempts to obtain a unit from the semaphore associated with ID.
- * If a unit can be allocated, the calling task will return immediately.
- * If no unit is available, then the task may return immediately or
- * block waiting for a unit with an optional timeout of timeout
- * clock ticks. Whether the task blocks or returns immediately
- * is based on the RTEMS_NO_WAIT option in the option_set.
- */
-
-rtems_status_code rtems_semaphore_obtain(
- rtems_id id,
- unsigned32 option_set,
- rtems_interval timeout
-);
-
-/*
- * rtems_semaphore_release
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_release directive. It
- * frees a unit to the semaphore associated with ID. If a task was
- * blocked waiting for a unit from this semaphore, then that task will
- * be readied and the unit given to that task. Otherwise, the unit
- * will be returned to the semaphore.
- */
-
-rtems_status_code rtems_semaphore_release(
- rtems_id id
-);
-
-/*
- * _Semaphore_Seize
- *
- * DESCRIPTION:
- *
- * This routine attempts to receive a unit from the_semaphore.
- * If a unit is available or if the RTEMS_NO_WAIT option is enabled in
- * option_set, then the routine returns. Otherwise, the calling task
- * is blocked until a unit becomes available.
- */
-
-boolean _Semaphore_Seize(
- Semaphore_Control *the_semaphore,
- unsigned32 option_set
-);
-
-/*
- * _Semaphore_Translate_core_mutex_return_code
- *
- * DESCRIPTION:
- *
- * This function returns a RTEMS status code based on the mutex
- * status code specified.
- */
-
-rtems_status_code _Semaphore_Translate_core_mutex_return_code (
- unsigned32 the_mutex_status
-);
-
-/*
- * _Semaphore_Translate_core_semaphore_return_code
- *
- * DESCRIPTION:
- *
- * This function returns a RTEMS status code based on the semaphore
- * status code specified.
- */
-
-rtems_status_code _Semaphore_Translate_core_semaphore_return_code (
- unsigned32 the_mutex_status
-);
-
-/*PAGE
- *
- * _Semaphore_Core_mutex_mp_support
- *
- * DESCRIPTION:
- *
- * This function processes the global actions necessary for remote
- * accesses to a global semaphore based on a core mutex. This function
- * is called by the core.
- */
-
-void _Semaphore_Core_mutex_mp_support (
- Thread_Control *the_thread,
- rtems_id id
-);
-
-/*PAGE
- *
- * _Semaphore_Core_mp_support
- *
- * DESCRIPTION:
- *
- * This function processes the global actions necessary for remote
- * accesses to a global semaphore based on a core semaphore. This function
- * is called by the core.
- */
-
-void _Semaphore_Core_semaphore_mp_support (
- Thread_Control *the_thread,
- rtems_id id
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/sem.inl>
-#endif
-#include <rtems/rtems/semmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/semmp.h b/c/src/exec/rtems/include/rtems/rtems/semmp.h
deleted file mode 100644
index fdea66f6a4..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/semmp.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/* semmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Semaphore Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SEMAPHORE_MP_h
-#define __RTEMS_SEMAPHORE_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote semaphore operations.
- */
-
-typedef enum {
- SEMAPHORE_MP_ANNOUNCE_CREATE = 0,
- SEMAPHORE_MP_ANNOUNCE_DELETE = 1,
- SEMAPHORE_MP_EXTRACT_PROXY = 2,
- SEMAPHORE_MP_OBTAIN_REQUEST = 3,
- SEMAPHORE_MP_OBTAIN_RESPONSE = 4,
- SEMAPHORE_MP_RELEASE_REQUEST = 5,
- SEMAPHORE_MP_RELEASE_RESPONSE = 6
-} Semaphore_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote semaphore operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Semaphore_MP_Remote_operations operation;
- rtems_name name;
- rtems_option option_set;
- Objects_Id proxy_id;
-} Semaphore_MP_Packet;
-
-/*
- * _Semaphore_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _Semaphore_MP_Send_process_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- rtems_name name,
- Objects_Id proxy_id
-);
-
-/*
- * _Semaphore_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Semaphore_MP_Send_request_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- rtems_option option_set,
- rtems_interval timeout
-);
-
-/*
- * _Semaphore_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Semaphore_MP_Send_response_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Semaphore_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Semaphore_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Semaphore_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _Semaphore_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _Semaphore_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _Semaphore_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _Semaphore_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a semaphore mp packet.
- */
-
-Semaphore_MP_Packet *_Semaphore_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/signal.h b/c/src/exec/rtems/include/rtems/rtems/signal.h
deleted file mode 100644
index 2b247762e9..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/signal.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* signal.h
- *
- * This include file contains all the constants and structures associated
- * with the Signal Manager. This manager provides capabilities required
- * for asynchronous communication between tasks via signal sets.
- *
- * Directives provided are:
- *
- * + establish an asynchronous signal routine
- * + send a signal set to a task
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SIGNAL_h
-#define __RTEMS_SIGNAL_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/asr.h>
-#include <rtems/rtems/modes.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/types.h>
-
-/*
- * _Signal_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Signal_Manager_initialization( void );
-
-/*
- * rtems_signal_catch
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_signal_catch directive. This directive
- * is used to establish asr_handler as the Asynchronous Signal Routine
- * (RTEMS_ASR) for the calling task. The asr_handler will execute with a
- * mode of mode_set.
- */
-
-rtems_status_code rtems_signal_catch(
- rtems_asr_entry asr_handler,
- rtems_mode mode_set
-);
-
-/*
- * rtems_signal_send
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_signal_send directive. This directive
- * sends the signal_set to the task specified by ID.
- */
-
-rtems_status_code rtems_signal_send(
- Objects_Id id,
- rtems_signal_set signal_set
-);
-
-#include <rtems/rtems/signalmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/signalmp.h b/c/src/exec/rtems/include/rtems/rtems/signalmp.h
deleted file mode 100644
index 2b13a0707e..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/signalmp.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* signalmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Signal Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SIGNAL_MP_h
-#define __RTEMS_SIGNAL_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/asr.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote signal operations.
- */
-
-typedef enum {
- SIGNAL_MP_SEND_REQUEST = 0,
- SIGNAL_MP_SEND_RESPONSE = 1
-} Signal_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote signal operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Signal_MP_Remote_operations operation;
- rtems_signal_set signal_in;
-} Signal_MP_Packet;
-
-/*
- * _Signal_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- *
- * This routine is not needed since there are no process
- * packets to be sent by this manager.
- */
-
-/*
- * _Signal_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Signal_MP_Send_request_packet (
- Signal_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_signal_set signal_in
-);
-
-/*
- * _Signal_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Signal_MP_Send_response_packet (
- Signal_MP_Remote_operations operation,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Signal_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Signal_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Signal_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _Signal_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _Signal_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a signal mp packet.
- */
-
-Signal_MP_Packet *_Signal_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/status.h b/c/src/exec/rtems/include/rtems/rtems/status.h
deleted file mode 100644
index db1cf2049c..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/status.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* status.h
- *
- * This include file contains the status codes returned from the
- * executive directives.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_STATUS_h
-#define __RTEMS_STATUS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* types */
-
-/* enumerated constants */
-
-typedef enum {
- RTEMS_SUCCESSFUL = 0, /* successful completion */
- RTEMS_TASK_EXITTED = 1, /* returned from a thread */
- RTEMS_MP_NOT_CONFIGURED = 2, /* multiprocessing not configured */
- RTEMS_INVALID_NAME = 3, /* invalid object name */
- RTEMS_INVALID_ID = 4, /* invalid object id */
- RTEMS_TOO_MANY = 5, /* too many */
- RTEMS_TIMEOUT = 6, /* timed out waiting */
- RTEMS_OBJECT_WAS_DELETED = 7, /* object deleted while waiting */
- RTEMS_INVALID_SIZE = 8, /* specified size was invalid */
- RTEMS_INVALID_ADDRESS = 9, /* address specified is invalid */
- RTEMS_INVALID_NUMBER = 10, /* number was invalid */
- RTEMS_NOT_DEFINED = 11, /* item has not been initialized */
- RTEMS_RESOURCE_IN_USE = 12, /* resources still outstanding */
- RTEMS_UNSATISFIED = 13, /* request not satisfied */
- RTEMS_INCORRECT_STATE = 14, /* thread is in wrong state */
- RTEMS_ALREADY_SUSPENDED = 15, /* thread already in state */
- RTEMS_ILLEGAL_ON_SELF = 16, /* illegal on calling thread */
- RTEMS_ILLEGAL_ON_REMOTE_OBJECT = 17, /* illegal for remote object */
- RTEMS_CALLED_FROM_ISR = 18, /* called from wrong environment */
- RTEMS_INVALID_PRIORITY = 19, /* invalid thread priority */
- RTEMS_INVALID_CLOCK = 20, /* invalid date/time */
- RTEMS_INVALID_NODE = 21, /* invalid node id */
- RTEMS_NOT_CONFIGURED = 22, /* directive not configured */
- RTEMS_NOT_OWNER_OF_RESOURCE = 23, /* not owner of resource */
- RTEMS_NOT_IMPLEMENTED = 24, /* directive not implemented */
- RTEMS_INTERNAL_ERROR = 25, /* RTEMS inconsistency detected */
- RTEMS_NO_MEMORY = 26, /* could not get enough memory */
- RTEMS_IO_ERROR = 27, /* driver IO error */
- RTEMS_PROXY_BLOCKING = 28 /* internal error only */
-} rtems_status_code;
-
-#define RTEMS_STATUS_CODES_FIRST RTEMS_SUCCESSFUL
-#define RTEMS_STATUS_CODES_LAST RTEMS_PROXY_BLOCKING
-
-extern rtems_status_code _Status_Object_name_errors_to_status[];
-
-#ifdef RTEMS_API_INIT
-rtems_status_code _Status_Object_name_errors_to_status[] = {
- RTEMS_SUCCESSFUL, /* OBJECTS_SUCCESSFUL */
- RTEMS_INVALID_NAME, /* OBJECTS_INVALID_NAME */
- RTEMS_INVALID_NODE /* OBJECTS_INVALID_NODE */
-};
-#endif
-
-/*
- * Applications are allowed to use the macros to compare status codes.
- */
-
-#include <rtems/rtems/status.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/support.h b/c/src/exec/rtems/include/rtems/rtems/support.h
deleted file mode 100644
index 643b4295bd..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/support.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* support.h
- *
- * This include file contains information about support functions for
- * the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_SUPPORT_h
-#define __RTEMS_RTEMS_SUPPORT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-
-/*
- * rtems_build_name
- *
- * DESCRIPTION:
- *
- * This function returns an object name composed of the four characters
- * C1, C2, C3, and C4.
- *
- * NOTE:
- *
- * This must be implemented as a macro for use in Configuration Tables.
- *
- */
-
-#define rtems_build_name( _C1, _C2, _C3, _C4 ) \
- ( (_C1) << 24 | (_C2) << 16 | (_C3) << 8 | (_C4) )
-
-/*
- * rtems_get_class
- *
- * DESCRIPTION:
- *
- * This function returns the class portion of the ID.
- *
- */
-
-#define rtems_get_class( _id ) \
- _Objects_Get_class( _id )
-
-/*
- * rtems_get_node
- *
- * DESCRIPTION:
- *
- * This function returns the node portion of the ID.
- *
- */
-
-#define rtems_get_node( _id ) \
- _Objects_Get_node( _id )
-
-/*
- * rtems_get_index
- *
- * DESCRIPTION:
- *
- * This function returns the index portion of the ID.
- *
- */
-
-#define rtems_get_index( _id ) \
- _Objects_Get_index( _id )
-
-/*
- * Time related
- */
-
-#define RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) \
- TOD_MILLISECONDS_TO_MICROSECONDS(_ms)
-#define RTEMS_MILLISECONDS_TO_TICKS(_ms) \
- TOD_MILLISECONDS_TO_TICKS(_ms)
-#define RTEMS_MICROSECONDS_TO_TICKS(_ms) \
- TOD_MICROSECONDS_TO_TICKS(_ms)
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/support.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/taskmp.h b/c/src/exec/rtems/include/rtems/rtems/taskmp.h
deleted file mode 100644
index a1ff0a3715..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/taskmp.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/* taskmp.h
- *
- * This include file contains all the constants and structures associated
- * with the multiprocessing support in the task manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_TASKS_MP_h
-#define __RTEMS_RTEMS_TASKS_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/priority.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/score/thread.h>
-
-/*
- * The following enumerated type defines the list of
- * remote task operations.
- */
-
-typedef enum {
- RTEMS_TASKS_MP_ANNOUNCE_CREATE = 0,
- RTEMS_TASKS_MP_ANNOUNCE_DELETE = 1,
- RTEMS_TASKS_MP_SUSPEND_REQUEST = 2,
- RTEMS_TASKS_MP_SUSPEND_RESPONSE = 3,
- RTEMS_TASKS_MP_RESUME_REQUEST = 4,
- RTEMS_TASKS_MP_RESUME_RESPONSE = 5,
- RTEMS_TASKS_MP_SET_PRIORITY_REQUEST = 6,
- RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE = 7,
- RTEMS_TASKS_MP_GET_NOTE_REQUEST = 8,
- RTEMS_TASKS_MP_GET_NOTE_RESPONSE = 9,
- RTEMS_TASKS_MP_SET_NOTE_REQUEST = 10,
- RTEMS_TASKS_MP_SET_NOTE_RESPONSE = 11
-} RTEMS_tasks_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote task operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- RTEMS_tasks_MP_Remote_operations operation;
- rtems_name name;
- rtems_task_priority the_priority;
- unsigned32 notepad;
- unsigned32 note;
-} RTEMS_tasks_MP_Packet;
-
-/*
- * _RTEMS_tasks_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _RTEMS_tasks_MP_Send_process_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_name name
-);
-
-/*
- * _RTEMS_tasks_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _RTEMS_tasks_MP_Send_request_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_task_priority the_priority,
- unsigned32 notepad,
- unsigned32 note
-);
-
-/*
- * _RTEMS_tasks_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _RTEMS_tasks_MP_Send_response_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _RTEMS_tasks_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _RTEMS_tasks_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _RTEMS_tasks_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed by RTEMS_tasks since a task
- * cannot be deleted when segments are in use.
- */
-
-/*
- * _RTEMS_tasks_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*
- * _RTEMS_tasks_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a task mp packet.
- */
-
-RTEMS_tasks_MP_Packet *_RTEMS_tasks_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/tasks.h b/c/src/exec/rtems/include/rtems/rtems/tasks.h
deleted file mode 100644
index 17730cee7f..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/tasks.h
+++ /dev/null
@@ -1,421 +0,0 @@
-/* tasks.h
- *
- * This include file contains all constants and structures associated
- * with RTEMS tasks. This manager provides a comprehensive set of directives
- * to create, delete, and administer tasks.
- *
- * Directives provided are:
- *
- * + create a task
- * + get an ID of a task
- * + start a task
- * + restart a task
- * + delete a task
- * + suspend a task
- * + resume a task
- * + set a task's priority
- * + change the current task's mode
- * + get a task notepad entry
- * + set a task notepad entry
- * + wake up after interval
- * + wake up when specified
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_TASKS_h
-#define __RTEMS_RTEMS_TASKS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/eventset.h>
-#include <rtems/rtems/asr.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/rtems/status.h>
-
-/*
- * Constant to be used as the ID of current task
- */
-
-#define RTEMS_SELF OBJECTS_ID_OF_SELF
-
-/*
- * This constant is passed to the rtems_task_wake_after directive as the
- * interval when a task wishes to yield the CPU.
- */
-
-#define RTEMS_YIELD_PROCESSOR WATCHDOG_NO_TIMEOUT
-
-/*
- * Define the type for an RTEMS API task priority.
- */
-
-typedef Priority_Control rtems_task_priority;
-
-#define RTEMS_NO_PRIORITY RTEMS_CURRENT_PRIORITY
-
-#define RTEMS_MINIMUM_PRIORITY (PRIORITY_MINIMUM + 1)
-#define RTEMS_MAXIMUM_PRIORITY PRIORITY_MAXIMUM
-
-/*
- * The following constant is passed to rtems_task_set_priority when the
- * caller wants to obtain the current priority.
- */
-
-#define RTEMS_CURRENT_PRIORITY PRIORITY_MINIMUM
-
-/*
- * Notepads constants (indices into notepad array)
- */
-
-#define RTEMS_NOTEPAD_FIRST 0 /* lowest numbered notepad */
-#define RTEMS_NOTEPAD_0 0 /* notepad location 0 */
-#define RTEMS_NOTEPAD_1 1 /* notepad location 1 */
-#define RTEMS_NOTEPAD_2 2 /* notepad location 2 */
-#define RTEMS_NOTEPAD_3 3 /* notepad location 3 */
-#define RTEMS_NOTEPAD_4 4 /* notepad location 4 */
-#define RTEMS_NOTEPAD_5 5 /* notepad location 5 */
-#define RTEMS_NOTEPAD_6 6 /* notepad location 6 */
-#define RTEMS_NOTEPAD_7 7 /* notepad location 7 */
-#define RTEMS_NOTEPAD_8 8 /* notepad location 8 */
-#define RTEMS_NOTEPAD_9 9 /* notepad location 9 */
-#define RTEMS_NOTEPAD_10 10 /* notepad location 10 */
-#define RTEMS_NOTEPAD_11 11 /* notepad location 11 */
-#define RTEMS_NOTEPAD_12 12 /* notepad location 12 */
-#define RTEMS_NOTEPAD_13 13 /* notepad location 13 */
-#define RTEMS_NOTEPAD_14 14 /* notepad location 14 */
-#define RTEMS_NOTEPAD_15 15 /* notepad location 15 */
-#define RTEMS_NOTEPAD_LAST RTEMS_NOTEPAD_15 /* highest numbered notepad */
-
-#define RTEMS_NUMBER_NOTEPADS (RTEMS_NOTEPAD_LAST+1)
-
-/*
- * External API name for Thread_Control
- */
-
-typedef Thread_Control rtems_tcb;
-
-/*
- * The following defines the "return type" of an RTEMS task.
- */
-
-typedef void rtems_task;
-
-/*
- * The following defines the argument to an RTEMS task.
- */
-
-typedef unsigned32 rtems_task_argument;
-
-/*
- * The following defines the type for the entry point of an RTEMS task.
- */
-
-typedef rtems_task ( *rtems_task_entry )(
- rtems_task_argument
- );
-
-/*
- * The following records define the Initialization Tasks Table.
- * Each entry contains the information required by RTEMS to
- * create and start a user task automatically at executive
- * initialization time.
- */
-
-typedef struct {
- rtems_name name; /* task name */
- unsigned32 stack_size; /* task stack size */
- rtems_task_priority initial_priority; /* task priority */
- rtems_attribute attribute_set; /* task attributes */
- rtems_task_entry entry_point; /* task entry point */
- rtems_mode mode_set; /* task initial mode */
- unsigned32 argument; /* task argument */
-} rtems_initialization_tasks_table;
-
-/*
- * This is the API specific information required by each thread for
- * the RTEMS API to function correctly.
- */
-
-
-typedef struct {
- unsigned32 Notepads[ RTEMS_NUMBER_NOTEPADS ];
- rtems_event_set pending_events;
- rtems_event_set event_condition;
- ASR_Information Signal;
-} RTEMS_API_Control;
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _RTEMS_tasks_Information;
-
-/*
- * These are used to manage the user initialization tasks.
- */
-
-RTEMS_EXTERN rtems_initialization_tasks_table
- *_RTEMS_tasks_User_initialization_tasks;
-RTEMS_EXTERN unsigned32 _RTEMS_tasks_Number_of_initialization_tasks;
-
-/*
- * _RTEMS_tasks_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes all Task Manager related data structures.
- */
-
-void _RTEMS_tasks_Manager_initialization(
- unsigned32 maximum_tasks,
- unsigned32 number_of_initialization_tasks,
- rtems_initialization_tasks_table *user_tasks
-);
-
-/*
- * rtems_task_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_create directive. The task
- * will have the name name. The attribute_set can be used to indicate
- * that the task will be globally accessible or utilize floating point.
- * The task's stack will be stack_size bytes. The task will begin
- * execution with initial_priority and initial_modes. It returns the
- * id of the created task in ID.
- */
-
-rtems_status_code rtems_task_create(
- rtems_name name,
- rtems_task_priority initial_priority,
- unsigned32 stack_size,
- rtems_mode initial_modes,
- rtems_attribute attribute_set,
- Objects_Id *id
-);
-
-/*
- * rtems_task_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_ident directive.
- * This directive returns the task ID associated with name.
- * If more than one task is named name, then the task to
- * which the ID belongs is arbitrary. node indicates the
- * extent of the search for the ID of the task named name.
- * The search can be limited to a particular node or allowed to
- * encompass all nodes.
- */
-
-rtems_status_code rtems_task_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-);
-
-/*
- * rtems_task_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_delete directive. The
- * task indicated by ID is deleted.
- */
-
-rtems_status_code rtems_task_delete(
- Objects_Id id
-);
-
-/*
- * rtems_task_get_note
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_get_note directive. The
- * value of the indicated notepad for the task associated with ID
- * is returned in note.
- */
-
-rtems_status_code rtems_task_get_note(
- Objects_Id id,
- unsigned32 notepad,
- unsigned32 *note
-);
-
-/*
- * rtems_task_set_note
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_set_note directive. The
- * value of the indicated notepad for the task associated with ID
- * is returned in note.
- */
-
-rtems_status_code rtems_task_set_note(
- Objects_Id id,
- unsigned32 notepad,
- unsigned32 note
-);
-
-/*
- * rtems_task_mode
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_mode directive. The current
- * values of the modes indicated by mask of the calling task are changed
- * to that indicated in mode_set. The former mode of the task is
- * returned in mode_set.
- */
-
-rtems_status_code rtems_task_mode(
- rtems_mode mode_set,
- rtems_mode mask,
- rtems_mode *previous_mode_set
-);
-
-/*
- * rtems_task_restart
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_restart directive. The
- * task associated with ID is restarted at its initial entry
- * point with the new argument.
- */
-
-rtems_status_code rtems_task_restart(
- Objects_Id id,
- unsigned32 arg
-);
-
-/*
- * rtems_task_suspend
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_suspend directive. The
- * SUSPENDED state is set for task associated with ID.
- */
-
-rtems_status_code rtems_task_suspend(
- Objects_Id id
-);
-
-/*
- * rtems_task_resume
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_resume Directive. The
- * SUSPENDED state is cleared for task associated with ID.
- */
-
-rtems_status_code rtems_task_resume(
- Objects_Id id
-);
-
-/*
- * rtems_task_set_priority
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_set_priority directive. The
- * current priority of the task associated with ID is set to
- * new_priority. The former priority of that task is returned
- * in old_priority.
- */
-
-rtems_status_code rtems_task_set_priority(
- Objects_Id id,
- rtems_task_priority new_priority,
- rtems_task_priority *old_priority
-);
-
-/*
- * rtems_task_start
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_start directive. The
- * starting execution point of the task associated with ID is
- * set to entry_point with the initial argument.
- */
-
-rtems_status_code rtems_task_start(
- Objects_Id id,
- rtems_task_entry entry_point,
- unsigned32 argument
-);
-
-/*
- * rtems_task_wake_when
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_wake_when directive. The
- * calling task is blocked until the current time of day is
- * equal to that indicated by time_buffer.
- */
-
-rtems_status_code rtems_task_wake_when(
- rtems_time_of_day *time_buffer
-);
-
-/*
- * rtems_task_wake_after
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_wake_after directive. The
- * calling task is blocked until the indicated number of clock
- * ticks have occurred.
- */
-
-rtems_status_code rtems_task_wake_after(
- rtems_interval ticks
-);
-
-/*PAGE
- *
- * _RTEMS_tasks_Initialize_user_tasks
- *
- * This routine creates and starts all configured user
- * initialzation threads.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _RTEMS_tasks_Initialize_user_tasks( void );
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/tasks.inl>
-#endif
-#include <rtems/rtems/taskmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/timer.h b/c/src/exec/rtems/include/rtems/rtems/timer.h
deleted file mode 100644
index 4ef567c9bc..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/timer.h
+++ /dev/null
@@ -1,207 +0,0 @@
-/* timer.h
- *
- * This include file contains all the constants, structures, and
- * prototypes associated with the Timer Manager. This manager provides
- * facilities to configure, initiate, cancel, and delete timers which will
- * fire at specified intervals of time.
- *
- * Directives provided are:
- *
- * + create a timer
- * + get an ID of a timer
- * + delete a timer
- * + set a timer to fire after a number of ticks have passed
- * + set a timer to fire when a specified date and time has been reached
- * + reset a timer
- * + cancel a time
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_TIMER_h
-#define __RTEMS_TIMER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type details the classes to which a timer
- * may belong.
- */
-
-typedef enum {
- TIMER_INTERVAL,
- TIMER_TIME_OF_DAY,
- TIMER_DORMANT
-} Timer_Classes;
-
-/*
- * The following types define a pointer to a timer service routine.
- */
-
-typedef void rtems_timer_service_routine;
-
-typedef rtems_timer_service_routine ( *rtems_timer_service_routine_entry )(
- rtems_id,
- void *
- );
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Timer_Information;
-
-/*
- * The following records define the control block used to manage
- * each timer.
- */
-
-typedef struct {
- Objects_Control Object;
- Watchdog_Control Ticker;
- Timer_Classes the_class;
-} Timer_Control;
-
-/*
- * _Timer_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Timer_Manager_initialization(
- unsigned32 maximum_timers
-);
-
-/*
- * rtems_timer_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_create directive. The
- * timer will have the name name. It returns the id of the
- * created timer in ID.
- */
-
-rtems_status_code rtems_timer_create(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_timer_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_ident directive.
- * This directive returns the timer ID associated with name.
- * If more than one timer is named name, then the timer
- * to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_timer_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_timer_cancel
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_cancel directive. It is used
- * to stop the timer associated with ID from firing.
- */
-
-rtems_status_code rtems_timer_cancel(
- Objects_Id id
-);
-
-/*
- * rtems_timer_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_delete directive. The
- * timer indicated by ID is deleted.
- */
-
-rtems_status_code rtems_timer_delete(
- Objects_Id id
-);
-
-/*
- * rtems_timer_fire_after
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_fire_after directive. It
- * initiates the timer associated with ID to fire in ticks clock
- * ticks. When the timer fires, the routine will be invoked.
- */
-
-rtems_status_code rtems_timer_fire_after(
- Objects_Id id,
- rtems_interval ticks,
- rtems_timer_service_routine_entry routine,
- void *user_data
-);
-
-/*
- * rtems_timer_fire_when
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_fire_when directive. It
- * initiates the timer associated with ID to fire at wall_time
- * When the timer fires, the routine will be invoked.
- */
-
-rtems_status_code rtems_timer_fire_when(
- Objects_Id id,
- rtems_time_of_day *wall_time,
- rtems_timer_service_routine_entry routine,
- void *user_data
-);
-
-/*
- * rtems_timer_reset
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_reset directive. It is used
- * to reinitialize the interval timer associated with ID just as if
- * rtems_timer_fire_after were re-invoked with the same arguments that
- * were used to initiate this timer.
- */
-
-rtems_status_code rtems_timer_reset(
- Objects_Id id
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/timer.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/include/rtems/rtems/types.h b/c/src/exec/rtems/include/rtems/rtems/types.h
deleted file mode 100644
index 4d2915bafa..0000000000
--- a/c/src/exec/rtems/include/rtems/rtems/types.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* types.h
- *
- * This include file defines the types used by the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_TYPES_h
-#define __RTEMS_RTEMS_TYPES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/priority.h>
-#include <rtems/rtems/modes.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-
-/*
- * RTEMS basic type definitions
- */
-
-typedef unsigned8 rtems_unsigned8; /* unsigned 8-bit value */
-typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */
-typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */
-
-typedef signed8 rtems_signed8; /* signed 8-bit value */
-typedef signed16 rtems_signed16; /* signed 16-bit value */
-typedef signed32 rtems_signed32; /* signed 32-bit value */
-
-/*
- * some C++ compilers (eg: HP's) don't do 'long long'
- */
-#if defined(__GNUC__)
-typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */
-typedef signed64 rtems_signed64; /* signed 64-bit value */
-#endif
-
-typedef single_precision rtems_single; /* single precision float */
-typedef double_precision rtems_double; /* double precision float */
-
-typedef boolean rtems_boolean;
-
-typedef unsigned32 rtems_name;
-typedef Objects_Id rtems_id;
-
-typedef Context_Control rtems_context;
-typedef Context_Control_fp rtems_context_fp;
-typedef CPU_Interrupt_frame rtems_interrupt_frame;
-
-/*
- * Time related
- */
-
-typedef Watchdog_Interval rtems_interval;
-typedef TOD_Control rtems_time_of_day;
-
-/*
- * Define the type for an RTEMS API task mode.
- */
-
-typedef Modes_Control rtems_mode;
-
-/*
- * MPCI related entries
- */
-
-typedef MP_packet_Classes rtems_mp_packet_classes;
-typedef MP_packet_Prefix rtems_packet_prefix;
-
-typedef MPCI_initialization_entry rtems_mpci_initialization_entry;
-typedef MPCI_get_packet_entry rtems_mpci_get_packet_entry;
-typedef MPCI_return_packet_entry rtems_mpci_return_packet_entry;
-typedef MPCI_send_entry rtems_mpci_send_packet_entry;
-typedef MPCI_receive_entry rtems_mpci_receive_packet_entry;
-
-typedef MPCI_Entry rtems_mpci_entry;
-
-typedef MPCI_Control rtems_mpci_table;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/Makefile.in b/c/src/exec/rtems/inline/Makefile.in
deleted file mode 100644
index 9c11a33172..0000000000
--- a/c/src/exec/rtems/inline/Makefile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-I_PIECES=asr attr dpmem event eventset message modes options \
- part ratemon region sem status support tasks timer
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems/rtems
diff --git a/c/src/exec/rtems/inline/asr.inl b/c/src/exec/rtems/inline/asr.inl
deleted file mode 100644
index fede9dea9b..0000000000
--- a/c/src/exec/rtems/inline/asr.inl
+++ /dev/null
@@ -1,128 +0,0 @@
-/* inline/asr.inl
- *
- * This include file contains the implemenation of all routines
- * associated with the asynchronous signal handler which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_ASR_inl
-#define __INLINE_ASR_inl
-
-#include <rtems/score/isr.h>
-
-/*PAGE
- *
- * _ASR_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the given RTEMS_ASR information record.
- */
-
-RTEMS_INLINE_ROUTINE void _ASR_Initialize (
- ASR_Information *information
-)
-{
- information->is_enabled = TRUE;
- information->handler = NULL;
- information->mode_set = RTEMS_DEFAULT_MODES;
- information->signals_posted = 0;
- information->signals_pending = 0;
- information->nest_level = 0;
-}
-
-/*PAGE
- *
- * _ASR_Swap_signals
- *
- * DESCRIPTION:
- *
- * This routine atomically swaps the pending and posted signal
- * sets. This is done when the thread alters its mode in such a
- * way that the RTEMS_ASR disable/enable flag changes.
- */
-
-RTEMS_INLINE_ROUTINE void _ASR_Swap_signals (
- ASR_Information *information
-)
-{
- rtems_signal_set _signals;
- ISR_Level _level;
-
- _ISR_Disable( _level );
- _signals = information->signals_pending;
- information->signals_pending = information->signals_posted;
- information->signals_posted = _signals;
- _ISR_Enable( _level );
-}
-
-/*PAGE
- *
- * _ASR_Is_null_handler
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the given asr_handler is NULL and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ASR_Is_null_handler (
- rtems_asr_entry asr_handler
-)
-{
- return asr_handler == NULL;
-}
-
-/*PAGE
- *
- * _ASR_Are_signals_pending
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if there are signals pending in the
- * given RTEMS_ASR information record and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ASR_Are_signals_pending (
- ASR_Information *information
-)
-{
- return information->signals_posted != 0;
-}
-
-/*PAGE
- *
- * _ASR_Post_signals
- *
- * DESCRIPTION:
- *
- * This routine posts the given signals into the signal_set
- * passed in. The result is returned to the user in signal_set.
- *
- * NOTE: This must be implemented as a macro.
- */
-
-RTEMS_INLINE_ROUTINE void _ASR_Post_signals(
- rtems_signal_set signals,
- rtems_signal_set *signal_set
-)
-{
- ISR_Level _level;
-
- _ISR_Disable( _level );
- *signal_set |= signals;
- _ISR_Enable( _level );
-}
-
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/attr.inl b/c/src/exec/rtems/inline/attr.inl
deleted file mode 100644
index 3cec1edd3b..0000000000
--- a/c/src/exec/rtems/inline/attr.inl
+++ /dev/null
@@ -1,176 +0,0 @@
-/* inline/attr.inl
- *
- * This include file contains all of the inlined routines associated
- * with attributes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_ATTRIBUTES_inl
-#define __INLINE_ATTRIBUTES_inl
-
-/*PAGE
- *
- * _Attributes_Set
- *
- * DESCRIPTION:
- *
- * This function sets the requested new_attributes in the attribute_set
- * passed in. The result is returned to the user.
- */
-
-RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Set (
- rtems_attribute new_attributes,
- rtems_attribute attribute_set
-)
-{
- return attribute_set | new_attributes;
-}
-
-/*PAGE
- *
- * _Attributes_Clear
- *
- * DESCRIPTION:
- *
- * This function clears the requested new_attributes in the attribute_set
- * passed in. The result is returned to the user.
- */
-
-RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Clear (
- rtems_attribute attribute_set,
- rtems_attribute mask
-)
-{
- return attribute_set & ~mask;
-}
-
-/*PAGE
- *
- * _Attributes_Is_floating_point
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the floating point attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_floating_point(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_FLOATING_POINT );
-}
-
-/*PAGE
- *
- * _Attributes_Is_global
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the global object attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_global(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_GLOBAL );
-}
-
-/*PAGE
- *
- * _Attributes_Is_priority
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_PRIORITY );
-}
-
-/*PAGE
- *
- * _Attributes_Is_binary_semaphore
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the binary semaphore attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_binary_semaphore(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_BINARY_SEMAPHORE );
-}
-
-/*PAGE
- *
- * _Attributes_Is_inherit_priority
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority inheritance attribute
- * is enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_inherit_priority(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_INHERIT_PRIORITY );
-}
-
-/*PAGE
- *
- * _Attributes_Is_priority_ceiling
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority ceiling attribute
- * is enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority_ceiling(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_PRIORITY_CEILING );
-}
-
-/*PAGE
- *
- * _Attributes_Is_system_task
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the system task attribute
- * is enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_system_task(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_PRIORITY_CEILING );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/dpmem.inl b/c/src/exec/rtems/inline/dpmem.inl
deleted file mode 100644
index 777a886452..0000000000
--- a/c/src/exec/rtems/inline/dpmem.inl
+++ /dev/null
@@ -1,95 +0,0 @@
-/* inline/dpmem.inl
- *
- * This include file contains the inline routine used in conjunction
- * with the Dual Ported Memory Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_DPMEM_inl
-#define __INLINE_DPMEM_inl
-
-
-/*PAGE
- *
- * _Dual_ported_memory_Allocate
- *
- * DESCRIPTION:
- *
- * This routine allocates a port control block from the inactive chain
- * of free port control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Dual_ported_memory_Control
- *_Dual_ported_memory_Allocate ( void )
-{
- return (Dual_ported_memory_Control *)
- _Objects_Allocate( &_Dual_ported_memory_Information );
-}
-
-/*PAGE
- *
- * _Dual_ported_memory_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a port control block to the inactive chain
- * of free port control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Dual_ported_memory_Free (
- Dual_ported_memory_Control *the_port
-)
-{
- _Objects_Free( &_Dual_ported_memory_Information, &the_port->Object );
-}
-
-/*PAGE
- *
- * _Dual_ported_memory_Get
- *
- * DESCRIPTION:
- *
- * This function maps port IDs to port control blocks. If ID
- * corresponds to a local port, then it returns the_port control
- * pointer which maps to ID and location is set to OBJECTS_LOCAL.
- * Global ports are not supported, thus if ID does not map to a
- * local port, location is set to OBJECTS_ERROR and the_port is
- * undefined.
- */
-
-RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Dual_ported_memory_Control *)
- _Objects_Get( &_Dual_ported_memory_Information, id, location );
-}
-
-/*PAGE
- *
- * _Dual_ported_memory_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_port is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Dual_ported_memory_Is_null(
- Dual_ported_memory_Control *the_port
-)
-{
- return ( the_port == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/event.inl b/c/src/exec/rtems/inline/event.inl
deleted file mode 100644
index a4c6ec7930..0000000000
--- a/c/src/exec/rtems/inline/event.inl
+++ /dev/null
@@ -1,21 +0,0 @@
-/* inline/event.inl
- *
- * This include file contains the static inline implementation of
- * macros for the Event Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_EVENT_inl
-#define __MACROS_EVENT_inl
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/eventset.inl b/c/src/exec/rtems/inline/eventset.inl
deleted file mode 100644
index eed8c33751..0000000000
--- a/c/src/exec/rtems/inline/eventset.inl
+++ /dev/null
@@ -1,95 +0,0 @@
-/* inline/eventset.inl
- *
- * This include file contains the information pertaining to event sets.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_EVENT_SET_inl
-#define __INLINE_EVENT_SET_inl
-
-/*PAGE
- *
- * _Event_sets_Is_empty
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if on events are posted in the event_set,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Event_sets_Is_empty(
- rtems_event_set the_event_set
-)
-{
- return ( the_event_set == 0 );
-}
-
-/*PAGE
- *
- * _Event_sets_Post
- *
- * DESCRIPTION:
- *
- * This routine posts the given new_events into the event_set
- * passed in. The result is returned to the user in event_set.
- */
-
-RTEMS_INLINE_ROUTINE void _Event_sets_Post(
- rtems_event_set the_new_events,
- rtems_event_set *the_event_set
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
- *the_event_set |= the_new_events;
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Event_sets_Get
- *
- * DESCRIPTION:
- *
- * This function returns the events in event_condition which are
- * set in event_set.
- */
-
-RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get(
- rtems_event_set the_event_set,
- rtems_event_set the_event_condition
-)
-{
- return ( the_event_set & the_event_condition );
-}
-
-/*PAGE
- *
- * _Event_sets_Clear
- *
- * DESCRIPTION:
- *
- * This function removes the events in mask from the event_set
- * passed in. The result is returned to the user in event_set.
- */
-
-RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear(
- rtems_event_set the_event_set,
- rtems_event_set the_mask
-)
-{
- return ( the_event_set & ~(the_mask) );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/message.inl b/c/src/exec/rtems/inline/message.inl
deleted file mode 100644
index f3f763ca2e..0000000000
--- a/c/src/exec/rtems/inline/message.inl
+++ /dev/null
@@ -1,83 +0,0 @@
-/* message.inl
- *
- * This include file contains the static inline implementation of all
- * inlined routines in the Message Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MESSAGE_QUEUE_inl
-#define __MESSAGE_QUEUE_inl
-
-#include <rtems/score/wkspace.h>
-
-/*PAGE
- *
- * _Message_queue_Is_null
- *
- * DESCRIPTION:
- *
- * This function places the_message at the rear of the outstanding
- * messages on the_message_queue.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Message_queue_Is_null (
- Message_queue_Control *the_message_queue
-)
-{
- return ( the_message_queue == NULL );
-}
-
-
-/*PAGE
- *
- * _Message_queue_Free
- *
- * DESCRIPTION:
- *
- * This routine deallocates a message queue control block into
- * the inactive chain of free message queue control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Message_queue_Free (
- Message_queue_Control *the_message_queue
-)
-{
- _Objects_Free( &_Message_queue_Information, &the_message_queue->Object );
-}
-
-/*PAGE
- *
- * _Message_queue_Get
- *
- * DESCRIPTION:
- *
- * This function maps message queue IDs to message queue control
- * blocks. If ID corresponds to a local message queue, then it
- * returns the_message_queue control pointer which maps to ID
- * and location is set to OBJECTS_LOCAL. If the message queue ID is
- * global and resides on a remote node, then location is set
- * to OBJECTS_REMOTE, and the_message_queue is undefined.
- * Otherwise, location is set to OBJECTS_ERROR and
- * the_message_queue is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Message_queue_Control *)
- _Objects_Get( &_Message_queue_Information, id, location );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/modes.inl b/c/src/exec/rtems/inline/modes.inl
deleted file mode 100644
index f72c2468e3..0000000000
--- a/c/src/exec/rtems/inline/modes.inl
+++ /dev/null
@@ -1,152 +0,0 @@
-/* modes.inl
- *
- * This include file contains the static inline implementation of the
- * inlined routines in the Mode Handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MODES_inl
-#define __MODES_inl
-
-/*PAGE
- *
- * _Modes_Mask_changed
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if any of the mode flags in mask
- * are set in mode_set, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Modes_Mask_changed (
- Modes_Control mode_set,
- Modes_Control masks
-)
-{
- return ( mode_set & masks );
-}
-
-/*PAGE
- *
- * _Modes_Is_asr_disabled
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if mode_set indicates that Asynchronous
- * Signal Processing is disabled, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Modes_Is_asr_disabled (
- Modes_Control mode_set
-)
-{
- return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR;
-}
-
-/*PAGE
- *
- * _Modes_Is_preempt
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if mode_set indicates that preemption
- * is enabled, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Modes_Is_preempt (
- Modes_Control mode_set
-)
-{
- return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
-}
-
-/*PAGE
- *
- * _Modes_Is_timeslice
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if mode_set indicates that timeslicing
- * is enabled, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Modes_Is_timeslice (
- Modes_Control mode_set
-)
-{
- return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;
-}
-
-/*PAGE
- *
- * _Modes_Get_interrupt_level
- *
- * DESCRIPTION:
- *
- * This function returns the interrupt level portion of the mode_set.
- */
-
-RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
- Modes_Control mode_set
-)
-{
- return ( mode_set & RTEMS_INTERRUPT_MASK );
-}
-
-/*PAGE
- *
- * _Modes_Set_interrupt_level
- *
- * DESCRIPTION:
- *
- * This routine sets the current interrupt level to that specified
- * in the mode_set.
- */
-
-RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
- Modes_Control mode_set
-)
-{
- _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
-}
-
-/*PAGE
- *
- * _Modes_Change
- *
- * DESCRIPTION:
- *
- * This routine changes the modes in old_mode_set indicated by
- * mask to the requested values in new_mode_set. The resulting
- * mode set is returned in out_mode_set and the modes that changed
- * is returned in changed.
- */
-
-RTEMS_INLINE_ROUTINE void _Modes_Change (
- Modes_Control old_mode_set,
- Modes_Control new_mode_set,
- Modes_Control mask,
- Modes_Control *out_mode_set,
- Modes_Control *changed
-)
-{
- Modes_Control _out_mode;
-
- _out_mode = old_mode_set;
- _out_mode &= ~mask;
- _out_mode |= new_mode_set & mask;
- *changed = _out_mode ^ old_mode_set;
- *out_mode_set = _out_mode;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/options.inl b/c/src/exec/rtems/inline/options.inl
deleted file mode 100644
index f92acf56c4..0000000000
--- a/c/src/exec/rtems/inline/options.inl
+++ /dev/null
@@ -1,55 +0,0 @@
-/* options.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines from the Options Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OPTIONS_inl
-#define __OPTIONS_inl
-
-/*PAGE
- *
- * _Options_Is_no_wait
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the RTEMS_NO_WAIT option is enabled in
- * option_set, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Options_Is_no_wait (
- rtems_option option_set
-)
-{
- return (option_set & RTEMS_NO_WAIT);
-}
-
-/*PAGE
- *
- * _Options_Is_any
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the RTEMS_EVENT_ANY option is enabled in
- * OPTION_SET, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Options_Is_any (
- rtems_option option_set
-)
-{
- return (option_set & RTEMS_EVENT_ANY);
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/part.inl b/c/src/exec/rtems/inline/part.inl
deleted file mode 100644
index 18c948d5c4..0000000000
--- a/c/src/exec/rtems/inline/part.inl
+++ /dev/null
@@ -1,199 +0,0 @@
-/* part.inl
- *
- * This file contains the macro implementation of all inlined routines
- * in the Partition Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PARTITION_inl
-#define __PARTITION_inl
-
-/*PAGE
- *
- * _Partition_Allocate_buffer
- *
- * DESCRIPTION:
- *
- * This function attempts to allocate a buffer from the_partition.
- * If successful, it returns the address of the allocated buffer.
- * Otherwise, it returns NULL.
- */
-
-RTEMS_INLINE_ROUTINE void *_Partition_Allocate_buffer (
- Partition_Control *the_partition
-)
-{
- return _Chain_Get( &the_partition->Memory );
-}
-
-/*PAGE
- *
- * _Partition_Free_buffer
- *
- * DESCRIPTION:
- *
- * This routine frees the_buffer to the_partition.
- */
-
-RTEMS_INLINE_ROUTINE void _Partition_Free_buffer (
- Partition_Control *the_partition,
- Chain_Node *the_buffer
-)
-{
- _Chain_Append( &the_partition->Memory, the_buffer );
-}
-
-/*PAGE
- *
- * _Partition_Is_buffer_on_boundary
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_buffer is on a valid buffer
- * boundary for the_partition, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Partition_Is_buffer_on_boundary (
- void *the_buffer,
- Partition_Control *the_partition
-)
-{
- unsigned32 offset;
-
- offset = (unsigned32) _Addresses_Subtract(
- the_buffer,
- the_partition->starting_address
- );
-
- return ((offset % the_partition->buffer_size) == 0);
-}
-
-/*PAGE
- *
- * _Partition_Is_buffer_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_buffer is a valid buffer from
- * the_partition, otherwise FALSE is returned.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Partition_Is_buffer_valid (
- Chain_Node *the_buffer,
- Partition_Control *the_partition
-)
-{
- void *starting;
- void *ending;
-
- starting = the_partition->starting_address;
- ending = _Addresses_Add_offset( starting, the_partition->length );
-
- return (
- _Addresses_Is_in_range( the_buffer, starting, ending ) &&
- _Partition_Is_buffer_on_boundary( the_buffer, the_partition )
- );
-}
-
-/*PAGE
- *
- * _Partition_Is_buffer_size_aligned
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the use of the specified buffer_size
- * will result in the allocation of buffers whose first byte is
- * properly aligned, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Partition_Is_buffer_size_aligned (
- unsigned32 buffer_size
-)
-{
- return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0);
-}
-
-/*PAGE
- *
- * _Partition_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a partition control block from
- * the inactive chain of free partition control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void )
-{
- return (Partition_Control *) _Objects_Allocate( &_Partition_Information );
-}
-
-/*PAGE
- *
- * _Partition_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a partition control block to the
- * inactive chain of free partition control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Partition_Free (
- Partition_Control *the_partition
-)
-{
- _Objects_Free( &_Partition_Information, &the_partition->Object );
-}
-
-/*PAGE
- *
- * _Partition_Get
- *
- * DESCRIPTION:
- *
- * This function maps partition IDs to partition control blocks.
- * If ID corresponds to a local partition, then it returns
- * the_partition control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. If the partition ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_partition is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_partition is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Partition_Control *)
- _Objects_Get( &_Partition_Information, id, location );
-}
-
-/*PAGE
- *
- * _Partition_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_partition is NULL
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Partition_Is_null (
- Partition_Control *the_partition
-)
-{
- return ( the_partition == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/ratemon.inl b/c/src/exec/rtems/inline/ratemon.inl
deleted file mode 100644
index f1293ef75a..0000000000
--- a/c/src/exec/rtems/inline/ratemon.inl
+++ /dev/null
@@ -1,143 +0,0 @@
-/* ratemon.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines in the Rate Monotonic Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RATE_MONOTONIC_inl
-#define __RATE_MONOTONIC_inl
-
-/*PAGE
- *
- * _Rate_monotonic_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a period control block from
- * the inactive chain of free period control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void )
-{
- return (Rate_monotonic_Control *)
- _Objects_Allocate( &_Rate_monotonic_Information );
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Free
- *
- * DESCRIPTION:
- *
- * This routine allocates a period control block from
- * the inactive chain of free period control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Rate_monotonic_Free (
- Rate_monotonic_Control *the_period
-)
-{
- _Objects_Free( &_Rate_monotonic_Information, &the_period->Object );
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Get
- *
- * DESCRIPTION:
- *
- * This function maps period IDs to period control blocks.
- * If ID corresponds to a local period, then it returns
- * the_period control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. Otherwise, location is set
- * to OBJECTS_ERROR and the_period is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Rate_monotonic_Control *)
- _Objects_Get( &_Rate_monotonic_Information, id, location );
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Is_active
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_period is in the ACTIVE state,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_active (
- Rate_monotonic_Control *the_period
-)
-{
- return (the_period->state == RATE_MONOTONIC_ACTIVE);
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Is_inactive
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_period is in the ACTIVE state,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_inactive (
- Rate_monotonic_Control *the_period
-)
-{
- return (the_period->state == RATE_MONOTONIC_INACTIVE);
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Is_expired
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_period is in the EXPIRED state,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_expired (
- Rate_monotonic_Control *the_period
-)
-{
- return (the_period->state == RATE_MONOTONIC_EXPIRED);
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_period is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_null (
- Rate_monotonic_Control *the_period
-)
-{
- return (the_period == NULL);
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/region.inl b/c/src/exec/rtems/inline/region.inl
deleted file mode 100644
index 37f098ae63..0000000000
--- a/c/src/exec/rtems/inline/region.inl
+++ /dev/null
@@ -1,127 +0,0 @@
-/* region.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Region Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __REGION_inl
-#define __REGION_inl
-
-/*PAGE
- *
- * _Region_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a region control block from
- * the inactive chain of free region control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Region_Control *_Region_Allocate( void )
-{
- return (Region_Control *) _Objects_Allocate( &_Region_Information );
-}
-
-/*PAGE
- *
- * _Region_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a region control block to the
- * inactive chain of free region control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Region_Free (
- Region_Control *the_region
-)
-{
- _Objects_Free( &_Region_Information, &the_region->Object );
-}
-
-/*PAGE
- *
- * _Region_Get
- *
- * DESCRIPTION:
- *
- * This function maps region IDs to region control blocks.
- * If ID corresponds to a local region, then it returns
- * the_region control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. Otherwise, location is set
- * to OBJECTS_ERROR and the_region is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Region_Control *_Region_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Region_Control *)
- _Objects_Get( &_Region_Information, id, location );
-}
-
-/*PAGE
- *
- * _Region_Allocate_segment
- *
- * DESCRIPTION:
- *
- * This function attempts to allocate a segment from the_region.
- * If successful, it returns the address of the allocated segment.
- * Otherwise, it returns NULL.
- */
-
-RTEMS_INLINE_ROUTINE void *_Region_Allocate_segment (
- Region_Control *the_region,
- unsigned32 size
-)
-{
- return _Heap_Allocate( &the_region->Memory, size );
-}
-
-/*PAGE
- *
- * _Region_Free_segment
- *
- * DESCRIPTION:
- *
- * This function frees the_segment to the_region.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Region_Free_segment (
- Region_Control *the_region,
- void *the_segment
-)
-{
- return _Heap_Free( &the_region->Memory, the_segment );
-}
-
-/*PAGE
- *
- * _Region_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_region is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Region_Is_null (
- Region_Control *the_region
-)
-{
- return ( the_region == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/Makefile.in b/c/src/exec/rtems/inline/rtems/rtems/Makefile.in
deleted file mode 100644
index 9c11a33172..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/Makefile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-I_PIECES=asr attr dpmem event eventset message modes options \
- part ratemon region sem status support tasks timer
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems/rtems
diff --git a/c/src/exec/rtems/inline/rtems/rtems/asr.inl b/c/src/exec/rtems/inline/rtems/rtems/asr.inl
deleted file mode 100644
index fede9dea9b..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/asr.inl
+++ /dev/null
@@ -1,128 +0,0 @@
-/* inline/asr.inl
- *
- * This include file contains the implemenation of all routines
- * associated with the asynchronous signal handler which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_ASR_inl
-#define __INLINE_ASR_inl
-
-#include <rtems/score/isr.h>
-
-/*PAGE
- *
- * _ASR_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the given RTEMS_ASR information record.
- */
-
-RTEMS_INLINE_ROUTINE void _ASR_Initialize (
- ASR_Information *information
-)
-{
- information->is_enabled = TRUE;
- information->handler = NULL;
- information->mode_set = RTEMS_DEFAULT_MODES;
- information->signals_posted = 0;
- information->signals_pending = 0;
- information->nest_level = 0;
-}
-
-/*PAGE
- *
- * _ASR_Swap_signals
- *
- * DESCRIPTION:
- *
- * This routine atomically swaps the pending and posted signal
- * sets. This is done when the thread alters its mode in such a
- * way that the RTEMS_ASR disable/enable flag changes.
- */
-
-RTEMS_INLINE_ROUTINE void _ASR_Swap_signals (
- ASR_Information *information
-)
-{
- rtems_signal_set _signals;
- ISR_Level _level;
-
- _ISR_Disable( _level );
- _signals = information->signals_pending;
- information->signals_pending = information->signals_posted;
- information->signals_posted = _signals;
- _ISR_Enable( _level );
-}
-
-/*PAGE
- *
- * _ASR_Is_null_handler
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the given asr_handler is NULL and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ASR_Is_null_handler (
- rtems_asr_entry asr_handler
-)
-{
- return asr_handler == NULL;
-}
-
-/*PAGE
- *
- * _ASR_Are_signals_pending
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if there are signals pending in the
- * given RTEMS_ASR information record and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ASR_Are_signals_pending (
- ASR_Information *information
-)
-{
- return information->signals_posted != 0;
-}
-
-/*PAGE
- *
- * _ASR_Post_signals
- *
- * DESCRIPTION:
- *
- * This routine posts the given signals into the signal_set
- * passed in. The result is returned to the user in signal_set.
- *
- * NOTE: This must be implemented as a macro.
- */
-
-RTEMS_INLINE_ROUTINE void _ASR_Post_signals(
- rtems_signal_set signals,
- rtems_signal_set *signal_set
-)
-{
- ISR_Level _level;
-
- _ISR_Disable( _level );
- *signal_set |= signals;
- _ISR_Enable( _level );
-}
-
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/attr.inl b/c/src/exec/rtems/inline/rtems/rtems/attr.inl
deleted file mode 100644
index 3cec1edd3b..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/attr.inl
+++ /dev/null
@@ -1,176 +0,0 @@
-/* inline/attr.inl
- *
- * This include file contains all of the inlined routines associated
- * with attributes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_ATTRIBUTES_inl
-#define __INLINE_ATTRIBUTES_inl
-
-/*PAGE
- *
- * _Attributes_Set
- *
- * DESCRIPTION:
- *
- * This function sets the requested new_attributes in the attribute_set
- * passed in. The result is returned to the user.
- */
-
-RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Set (
- rtems_attribute new_attributes,
- rtems_attribute attribute_set
-)
-{
- return attribute_set | new_attributes;
-}
-
-/*PAGE
- *
- * _Attributes_Clear
- *
- * DESCRIPTION:
- *
- * This function clears the requested new_attributes in the attribute_set
- * passed in. The result is returned to the user.
- */
-
-RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Clear (
- rtems_attribute attribute_set,
- rtems_attribute mask
-)
-{
- return attribute_set & ~mask;
-}
-
-/*PAGE
- *
- * _Attributes_Is_floating_point
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the floating point attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_floating_point(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_FLOATING_POINT );
-}
-
-/*PAGE
- *
- * _Attributes_Is_global
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the global object attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_global(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_GLOBAL );
-}
-
-/*PAGE
- *
- * _Attributes_Is_priority
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_PRIORITY );
-}
-
-/*PAGE
- *
- * _Attributes_Is_binary_semaphore
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the binary semaphore attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_binary_semaphore(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_BINARY_SEMAPHORE );
-}
-
-/*PAGE
- *
- * _Attributes_Is_inherit_priority
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority inheritance attribute
- * is enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_inherit_priority(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_INHERIT_PRIORITY );
-}
-
-/*PAGE
- *
- * _Attributes_Is_priority_ceiling
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority ceiling attribute
- * is enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority_ceiling(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_PRIORITY_CEILING );
-}
-
-/*PAGE
- *
- * _Attributes_Is_system_task
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the system task attribute
- * is enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_system_task(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_PRIORITY_CEILING );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/dpmem.inl b/c/src/exec/rtems/inline/rtems/rtems/dpmem.inl
deleted file mode 100644
index 777a886452..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/dpmem.inl
+++ /dev/null
@@ -1,95 +0,0 @@
-/* inline/dpmem.inl
- *
- * This include file contains the inline routine used in conjunction
- * with the Dual Ported Memory Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_DPMEM_inl
-#define __INLINE_DPMEM_inl
-
-
-/*PAGE
- *
- * _Dual_ported_memory_Allocate
- *
- * DESCRIPTION:
- *
- * This routine allocates a port control block from the inactive chain
- * of free port control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Dual_ported_memory_Control
- *_Dual_ported_memory_Allocate ( void )
-{
- return (Dual_ported_memory_Control *)
- _Objects_Allocate( &_Dual_ported_memory_Information );
-}
-
-/*PAGE
- *
- * _Dual_ported_memory_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a port control block to the inactive chain
- * of free port control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Dual_ported_memory_Free (
- Dual_ported_memory_Control *the_port
-)
-{
- _Objects_Free( &_Dual_ported_memory_Information, &the_port->Object );
-}
-
-/*PAGE
- *
- * _Dual_ported_memory_Get
- *
- * DESCRIPTION:
- *
- * This function maps port IDs to port control blocks. If ID
- * corresponds to a local port, then it returns the_port control
- * pointer which maps to ID and location is set to OBJECTS_LOCAL.
- * Global ports are not supported, thus if ID does not map to a
- * local port, location is set to OBJECTS_ERROR and the_port is
- * undefined.
- */
-
-RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Dual_ported_memory_Control *)
- _Objects_Get( &_Dual_ported_memory_Information, id, location );
-}
-
-/*PAGE
- *
- * _Dual_ported_memory_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_port is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Dual_ported_memory_Is_null(
- Dual_ported_memory_Control *the_port
-)
-{
- return ( the_port == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/event.inl b/c/src/exec/rtems/inline/rtems/rtems/event.inl
deleted file mode 100644
index a4c6ec7930..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/event.inl
+++ /dev/null
@@ -1,21 +0,0 @@
-/* inline/event.inl
- *
- * This include file contains the static inline implementation of
- * macros for the Event Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_EVENT_inl
-#define __MACROS_EVENT_inl
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/eventset.inl b/c/src/exec/rtems/inline/rtems/rtems/eventset.inl
deleted file mode 100644
index eed8c33751..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/eventset.inl
+++ /dev/null
@@ -1,95 +0,0 @@
-/* inline/eventset.inl
- *
- * This include file contains the information pertaining to event sets.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_EVENT_SET_inl
-#define __INLINE_EVENT_SET_inl
-
-/*PAGE
- *
- * _Event_sets_Is_empty
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if on events are posted in the event_set,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Event_sets_Is_empty(
- rtems_event_set the_event_set
-)
-{
- return ( the_event_set == 0 );
-}
-
-/*PAGE
- *
- * _Event_sets_Post
- *
- * DESCRIPTION:
- *
- * This routine posts the given new_events into the event_set
- * passed in. The result is returned to the user in event_set.
- */
-
-RTEMS_INLINE_ROUTINE void _Event_sets_Post(
- rtems_event_set the_new_events,
- rtems_event_set *the_event_set
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
- *the_event_set |= the_new_events;
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Event_sets_Get
- *
- * DESCRIPTION:
- *
- * This function returns the events in event_condition which are
- * set in event_set.
- */
-
-RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get(
- rtems_event_set the_event_set,
- rtems_event_set the_event_condition
-)
-{
- return ( the_event_set & the_event_condition );
-}
-
-/*PAGE
- *
- * _Event_sets_Clear
- *
- * DESCRIPTION:
- *
- * This function removes the events in mask from the event_set
- * passed in. The result is returned to the user in event_set.
- */
-
-RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear(
- rtems_event_set the_event_set,
- rtems_event_set the_mask
-)
-{
- return ( the_event_set & ~(the_mask) );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/message.inl b/c/src/exec/rtems/inline/rtems/rtems/message.inl
deleted file mode 100644
index f3f763ca2e..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/message.inl
+++ /dev/null
@@ -1,83 +0,0 @@
-/* message.inl
- *
- * This include file contains the static inline implementation of all
- * inlined routines in the Message Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MESSAGE_QUEUE_inl
-#define __MESSAGE_QUEUE_inl
-
-#include <rtems/score/wkspace.h>
-
-/*PAGE
- *
- * _Message_queue_Is_null
- *
- * DESCRIPTION:
- *
- * This function places the_message at the rear of the outstanding
- * messages on the_message_queue.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Message_queue_Is_null (
- Message_queue_Control *the_message_queue
-)
-{
- return ( the_message_queue == NULL );
-}
-
-
-/*PAGE
- *
- * _Message_queue_Free
- *
- * DESCRIPTION:
- *
- * This routine deallocates a message queue control block into
- * the inactive chain of free message queue control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Message_queue_Free (
- Message_queue_Control *the_message_queue
-)
-{
- _Objects_Free( &_Message_queue_Information, &the_message_queue->Object );
-}
-
-/*PAGE
- *
- * _Message_queue_Get
- *
- * DESCRIPTION:
- *
- * This function maps message queue IDs to message queue control
- * blocks. If ID corresponds to a local message queue, then it
- * returns the_message_queue control pointer which maps to ID
- * and location is set to OBJECTS_LOCAL. If the message queue ID is
- * global and resides on a remote node, then location is set
- * to OBJECTS_REMOTE, and the_message_queue is undefined.
- * Otherwise, location is set to OBJECTS_ERROR and
- * the_message_queue is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Message_queue_Control *)
- _Objects_Get( &_Message_queue_Information, id, location );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/modes.inl b/c/src/exec/rtems/inline/rtems/rtems/modes.inl
deleted file mode 100644
index f72c2468e3..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/modes.inl
+++ /dev/null
@@ -1,152 +0,0 @@
-/* modes.inl
- *
- * This include file contains the static inline implementation of the
- * inlined routines in the Mode Handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MODES_inl
-#define __MODES_inl
-
-/*PAGE
- *
- * _Modes_Mask_changed
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if any of the mode flags in mask
- * are set in mode_set, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Modes_Mask_changed (
- Modes_Control mode_set,
- Modes_Control masks
-)
-{
- return ( mode_set & masks );
-}
-
-/*PAGE
- *
- * _Modes_Is_asr_disabled
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if mode_set indicates that Asynchronous
- * Signal Processing is disabled, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Modes_Is_asr_disabled (
- Modes_Control mode_set
-)
-{
- return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR;
-}
-
-/*PAGE
- *
- * _Modes_Is_preempt
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if mode_set indicates that preemption
- * is enabled, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Modes_Is_preempt (
- Modes_Control mode_set
-)
-{
- return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
-}
-
-/*PAGE
- *
- * _Modes_Is_timeslice
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if mode_set indicates that timeslicing
- * is enabled, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Modes_Is_timeslice (
- Modes_Control mode_set
-)
-{
- return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;
-}
-
-/*PAGE
- *
- * _Modes_Get_interrupt_level
- *
- * DESCRIPTION:
- *
- * This function returns the interrupt level portion of the mode_set.
- */
-
-RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
- Modes_Control mode_set
-)
-{
- return ( mode_set & RTEMS_INTERRUPT_MASK );
-}
-
-/*PAGE
- *
- * _Modes_Set_interrupt_level
- *
- * DESCRIPTION:
- *
- * This routine sets the current interrupt level to that specified
- * in the mode_set.
- */
-
-RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
- Modes_Control mode_set
-)
-{
- _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
-}
-
-/*PAGE
- *
- * _Modes_Change
- *
- * DESCRIPTION:
- *
- * This routine changes the modes in old_mode_set indicated by
- * mask to the requested values in new_mode_set. The resulting
- * mode set is returned in out_mode_set and the modes that changed
- * is returned in changed.
- */
-
-RTEMS_INLINE_ROUTINE void _Modes_Change (
- Modes_Control old_mode_set,
- Modes_Control new_mode_set,
- Modes_Control mask,
- Modes_Control *out_mode_set,
- Modes_Control *changed
-)
-{
- Modes_Control _out_mode;
-
- _out_mode = old_mode_set;
- _out_mode &= ~mask;
- _out_mode |= new_mode_set & mask;
- *changed = _out_mode ^ old_mode_set;
- *out_mode_set = _out_mode;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/options.inl b/c/src/exec/rtems/inline/rtems/rtems/options.inl
deleted file mode 100644
index f92acf56c4..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/options.inl
+++ /dev/null
@@ -1,55 +0,0 @@
-/* options.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines from the Options Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OPTIONS_inl
-#define __OPTIONS_inl
-
-/*PAGE
- *
- * _Options_Is_no_wait
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the RTEMS_NO_WAIT option is enabled in
- * option_set, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Options_Is_no_wait (
- rtems_option option_set
-)
-{
- return (option_set & RTEMS_NO_WAIT);
-}
-
-/*PAGE
- *
- * _Options_Is_any
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the RTEMS_EVENT_ANY option is enabled in
- * OPTION_SET, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Options_Is_any (
- rtems_option option_set
-)
-{
- return (option_set & RTEMS_EVENT_ANY);
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/part.inl b/c/src/exec/rtems/inline/rtems/rtems/part.inl
deleted file mode 100644
index 18c948d5c4..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/part.inl
+++ /dev/null
@@ -1,199 +0,0 @@
-/* part.inl
- *
- * This file contains the macro implementation of all inlined routines
- * in the Partition Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PARTITION_inl
-#define __PARTITION_inl
-
-/*PAGE
- *
- * _Partition_Allocate_buffer
- *
- * DESCRIPTION:
- *
- * This function attempts to allocate a buffer from the_partition.
- * If successful, it returns the address of the allocated buffer.
- * Otherwise, it returns NULL.
- */
-
-RTEMS_INLINE_ROUTINE void *_Partition_Allocate_buffer (
- Partition_Control *the_partition
-)
-{
- return _Chain_Get( &the_partition->Memory );
-}
-
-/*PAGE
- *
- * _Partition_Free_buffer
- *
- * DESCRIPTION:
- *
- * This routine frees the_buffer to the_partition.
- */
-
-RTEMS_INLINE_ROUTINE void _Partition_Free_buffer (
- Partition_Control *the_partition,
- Chain_Node *the_buffer
-)
-{
- _Chain_Append( &the_partition->Memory, the_buffer );
-}
-
-/*PAGE
- *
- * _Partition_Is_buffer_on_boundary
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_buffer is on a valid buffer
- * boundary for the_partition, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Partition_Is_buffer_on_boundary (
- void *the_buffer,
- Partition_Control *the_partition
-)
-{
- unsigned32 offset;
-
- offset = (unsigned32) _Addresses_Subtract(
- the_buffer,
- the_partition->starting_address
- );
-
- return ((offset % the_partition->buffer_size) == 0);
-}
-
-/*PAGE
- *
- * _Partition_Is_buffer_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_buffer is a valid buffer from
- * the_partition, otherwise FALSE is returned.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Partition_Is_buffer_valid (
- Chain_Node *the_buffer,
- Partition_Control *the_partition
-)
-{
- void *starting;
- void *ending;
-
- starting = the_partition->starting_address;
- ending = _Addresses_Add_offset( starting, the_partition->length );
-
- return (
- _Addresses_Is_in_range( the_buffer, starting, ending ) &&
- _Partition_Is_buffer_on_boundary( the_buffer, the_partition )
- );
-}
-
-/*PAGE
- *
- * _Partition_Is_buffer_size_aligned
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the use of the specified buffer_size
- * will result in the allocation of buffers whose first byte is
- * properly aligned, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Partition_Is_buffer_size_aligned (
- unsigned32 buffer_size
-)
-{
- return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0);
-}
-
-/*PAGE
- *
- * _Partition_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a partition control block from
- * the inactive chain of free partition control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void )
-{
- return (Partition_Control *) _Objects_Allocate( &_Partition_Information );
-}
-
-/*PAGE
- *
- * _Partition_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a partition control block to the
- * inactive chain of free partition control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Partition_Free (
- Partition_Control *the_partition
-)
-{
- _Objects_Free( &_Partition_Information, &the_partition->Object );
-}
-
-/*PAGE
- *
- * _Partition_Get
- *
- * DESCRIPTION:
- *
- * This function maps partition IDs to partition control blocks.
- * If ID corresponds to a local partition, then it returns
- * the_partition control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. If the partition ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_partition is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_partition is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Partition_Control *)
- _Objects_Get( &_Partition_Information, id, location );
-}
-
-/*PAGE
- *
- * _Partition_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_partition is NULL
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Partition_Is_null (
- Partition_Control *the_partition
-)
-{
- return ( the_partition == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/ratemon.inl b/c/src/exec/rtems/inline/rtems/rtems/ratemon.inl
deleted file mode 100644
index f1293ef75a..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/ratemon.inl
+++ /dev/null
@@ -1,143 +0,0 @@
-/* ratemon.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines in the Rate Monotonic Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RATE_MONOTONIC_inl
-#define __RATE_MONOTONIC_inl
-
-/*PAGE
- *
- * _Rate_monotonic_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a period control block from
- * the inactive chain of free period control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void )
-{
- return (Rate_monotonic_Control *)
- _Objects_Allocate( &_Rate_monotonic_Information );
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Free
- *
- * DESCRIPTION:
- *
- * This routine allocates a period control block from
- * the inactive chain of free period control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Rate_monotonic_Free (
- Rate_monotonic_Control *the_period
-)
-{
- _Objects_Free( &_Rate_monotonic_Information, &the_period->Object );
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Get
- *
- * DESCRIPTION:
- *
- * This function maps period IDs to period control blocks.
- * If ID corresponds to a local period, then it returns
- * the_period control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. Otherwise, location is set
- * to OBJECTS_ERROR and the_period is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Rate_monotonic_Control *)
- _Objects_Get( &_Rate_monotonic_Information, id, location );
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Is_active
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_period is in the ACTIVE state,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_active (
- Rate_monotonic_Control *the_period
-)
-{
- return (the_period->state == RATE_MONOTONIC_ACTIVE);
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Is_inactive
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_period is in the ACTIVE state,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_inactive (
- Rate_monotonic_Control *the_period
-)
-{
- return (the_period->state == RATE_MONOTONIC_INACTIVE);
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Is_expired
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_period is in the EXPIRED state,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_expired (
- Rate_monotonic_Control *the_period
-)
-{
- return (the_period->state == RATE_MONOTONIC_EXPIRED);
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_period is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_null (
- Rate_monotonic_Control *the_period
-)
-{
- return (the_period == NULL);
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/region.inl b/c/src/exec/rtems/inline/rtems/rtems/region.inl
deleted file mode 100644
index 37f098ae63..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/region.inl
+++ /dev/null
@@ -1,127 +0,0 @@
-/* region.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Region Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __REGION_inl
-#define __REGION_inl
-
-/*PAGE
- *
- * _Region_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a region control block from
- * the inactive chain of free region control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Region_Control *_Region_Allocate( void )
-{
- return (Region_Control *) _Objects_Allocate( &_Region_Information );
-}
-
-/*PAGE
- *
- * _Region_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a region control block to the
- * inactive chain of free region control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Region_Free (
- Region_Control *the_region
-)
-{
- _Objects_Free( &_Region_Information, &the_region->Object );
-}
-
-/*PAGE
- *
- * _Region_Get
- *
- * DESCRIPTION:
- *
- * This function maps region IDs to region control blocks.
- * If ID corresponds to a local region, then it returns
- * the_region control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. Otherwise, location is set
- * to OBJECTS_ERROR and the_region is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Region_Control *_Region_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Region_Control *)
- _Objects_Get( &_Region_Information, id, location );
-}
-
-/*PAGE
- *
- * _Region_Allocate_segment
- *
- * DESCRIPTION:
- *
- * This function attempts to allocate a segment from the_region.
- * If successful, it returns the address of the allocated segment.
- * Otherwise, it returns NULL.
- */
-
-RTEMS_INLINE_ROUTINE void *_Region_Allocate_segment (
- Region_Control *the_region,
- unsigned32 size
-)
-{
- return _Heap_Allocate( &the_region->Memory, size );
-}
-
-/*PAGE
- *
- * _Region_Free_segment
- *
- * DESCRIPTION:
- *
- * This function frees the_segment to the_region.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Region_Free_segment (
- Region_Control *the_region,
- void *the_segment
-)
-{
- return _Heap_Free( &the_region->Memory, the_segment );
-}
-
-/*PAGE
- *
- * _Region_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_region is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Region_Is_null (
- Region_Control *the_region
-)
-{
- return ( the_region == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/sem.inl b/c/src/exec/rtems/inline/rtems/rtems/sem.inl
deleted file mode 100644
index 75774b2917..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/sem.inl
+++ /dev/null
@@ -1,93 +0,0 @@
-/* sem.inl
- *
- * This file contains the static inlin implementation of the inlined
- * routines from the Semaphore Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __SEMAPHORE_inl
-#define __SEMAPHORE_inl
-
-/*PAGE
- *
- * _Semaphore_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a semaphore control block from
- * the inactive chain of free semaphore control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void )
-{
- return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information );
-}
-
-/*PAGE
- *
- * _Semaphore_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a semaphore control block to the
- * inactive chain of free semaphore control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Semaphore_Free (
- Semaphore_Control *the_semaphore
-)
-{
- _Objects_Free( &_Semaphore_Information, &the_semaphore->Object );
-}
-
-/*PAGE
- *
- * _Semaphore_Get
- *
- * DESCRIPTION:
- *
- * This function maps semaphore IDs to semaphore control blocks.
- * If ID corresponds to a local semaphore, then it returns
- * the_semaphore control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the semaphore ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_semaphore is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_semaphore is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Semaphore_Control *)
- _Objects_Get( &_Semaphore_Information, id, location );
-}
-
-/*PAGE
- *
- * _Semaphore_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Semaphore_Is_null (
- Semaphore_Control *the_semaphore
-)
-{
- return ( the_semaphore == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/status.inl b/c/src/exec/rtems/inline/rtems/rtems/status.inl
deleted file mode 100644
index b9182c6f63..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/status.inl
+++ /dev/null
@@ -1,56 +0,0 @@
-/* inline/status.inl
- *
- * This include file contains the implementations of the inlined
- * routines for the status package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_STATUS_inl
-#define __INLINE_STATUS_inl
-
-/*PAGE
- *
- * rtems_is_status_successful
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the status code is equal to RTEMS_SUCCESSFUL,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean rtems_is_status_successful(
- rtems_status_code code
-)
-{
- return (code == RTEMS_SUCCESSFUL);
-}
-
-/*PAGE
- *
- * rtems_are_statuses_equal
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the status code1 is equal to code2,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean rtems_are_statuses_equal(
- rtems_status_code code1,
- rtems_status_code code2
-)
-{
- return (code1 == code2);
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/support.inl b/c/src/exec/rtems/inline/rtems/rtems/support.inl
deleted file mode 100644
index 06de8d1f59..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/support.inl
+++ /dev/null
@@ -1,61 +0,0 @@
-/* support.inl
- *
- * This include file contains the static inline implementation of all
- * of the inlined routines specific to the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SUPPORT_inl
-#define __RTEMS_SUPPORT_inl
-
-/*PAGE
- *
- * rtems_is_name_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the name is valid, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE rtems_boolean rtems_is_name_valid (
- rtems_name name
-)
-{
- return ( name != 0 );
-}
-
-/*PAGE
- *
- * rtems_name_to_characters
- *
- * DESCRIPTION:
- *
- * This function breaks the object name into the four component
- * characters C1, C2, C3, and C4.
- */
-
-RTEMS_INLINE_ROUTINE void rtems_name_to_characters(
- rtems_name name,
- char *c1,
- char *c2,
- char *c3,
- char *c4
-)
-{
- *c1 = (name >> 24) & 0xff;
- *c2 = (name >> 16) & 0xff;
- *c3 = (name >> 8) & 0xff;
- *c4 = name & 0xff;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/tasks.inl b/c/src/exec/rtems/inline/rtems/rtems/tasks.inl
deleted file mode 100644
index 34c1e055a8..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/tasks.inl
+++ /dev/null
@@ -1,90 +0,0 @@
-/* tasks.inl
- *
- * This file contains the static inline implementation of all inlined
- * routines in the with RTEMS Tasks Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_TASKS_inl
-#define __RTEMS_TASKS_inl
-
-/*PAGE
- *
- * _RTEMS_tasks_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a task control block from
- * the inactive chain of free task control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_RTEMS_tasks_Allocate( void )
-{
- return (Thread_Control *) _Objects_Allocate( &_RTEMS_tasks_Information );
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a task control block to the
- * inactive chain of free task control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free (
- Thread_Control *the_task
-)
-{
- _Objects_Free(
- _Objects_Get_information( the_task->Object.id ),
- &the_task->Object
- );
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Priority_to_Core
- *
- * DESCRIPTION:
- *
- * This function converts an RTEMS API priority into a core priority.
- */
-
-RTEMS_INLINE_ROUTINE Priority_Control _RTEMS_tasks_Priority_to_Core(
- rtems_task_priority priority
-)
-{
- return (Priority_Control) priority;
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Priority_is_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_priority is a valid user task priority
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _RTEMS_tasks_Priority_is_valid (
- rtems_task_priority the_priority
-)
-{
- return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) &&
- ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/rtems/rtems/timer.inl b/c/src/exec/rtems/inline/rtems/rtems/timer.inl
deleted file mode 100644
index b884e02f4d..0000000000
--- a/c/src/exec/rtems/inline/rtems/rtems/timer.inl
+++ /dev/null
@@ -1,142 +0,0 @@
-/* timer.inl
- *
- * This file contains the static inline implementation of the inlined routines
- * from the Timer Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIMER_inl
-#define __TIMER_inl
-
-/*PAGE
- *
- * _Timer_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a timer control block from
- * the inactive chain of free timer control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void )
-{
- return (Timer_Control *) _Objects_Allocate( &_Timer_Information );
-}
-
-/*PAGE
- *
- * _Timer_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a timer control block to the
- * inactive chain of free timer control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Timer_Free (
- Timer_Control *the_timer
-)
-{
- _Objects_Free( &_Timer_Information, &the_timer->Object );
-}
-
-/*PAGE
- *
- * _Timer_Get
- *
- * DESCRIPTION:
- *
- * This function maps timer IDs to timer control blocks.
- * If ID corresponds to a local timer, then it returns
- * the timer control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. Otherwise, location is set
- * to OBJECTS_ERROR and the returned value is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Timer_Control *)
- _Objects_Get( &_Timer_Information, id, location );
-}
-
-/*PAGE
- *
- * _Timer_Is_interval_class
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the class is that of an INTERVAL
- * timer, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Timer_Is_interval_class (
- Timer_Classes the_class
-)
-{
- return ( the_class == TIMER_INTERVAL );
-}
-
-/*PAGE
- *
- * _Timer_Is_time_of_day_class
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the class is that of an INTERVAL
- * timer, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Timer_Is_timer_of_day_class (
- Timer_Classes the_class
-)
-{
- return ( the_class == TIMER_TIME_OF_DAY );
-}
-
-/*PAGE
- *
- * _Timer_Is_dormant_class
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the class is that of a DORMANT
- * timer, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Timer_Is_dormant_class (
- Timer_Classes the_class
-)
-{
- return ( the_class == TIMER_DORMANT );
-}
-
-/*PAGE
- *
- * _Timer_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_timer is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Timer_Is_null (
- Timer_Control *the_timer
-)
-{
- return ( the_timer == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/sem.inl b/c/src/exec/rtems/inline/sem.inl
deleted file mode 100644
index 75774b2917..0000000000
--- a/c/src/exec/rtems/inline/sem.inl
+++ /dev/null
@@ -1,93 +0,0 @@
-/* sem.inl
- *
- * This file contains the static inlin implementation of the inlined
- * routines from the Semaphore Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __SEMAPHORE_inl
-#define __SEMAPHORE_inl
-
-/*PAGE
- *
- * _Semaphore_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a semaphore control block from
- * the inactive chain of free semaphore control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void )
-{
- return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information );
-}
-
-/*PAGE
- *
- * _Semaphore_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a semaphore control block to the
- * inactive chain of free semaphore control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Semaphore_Free (
- Semaphore_Control *the_semaphore
-)
-{
- _Objects_Free( &_Semaphore_Information, &the_semaphore->Object );
-}
-
-/*PAGE
- *
- * _Semaphore_Get
- *
- * DESCRIPTION:
- *
- * This function maps semaphore IDs to semaphore control blocks.
- * If ID corresponds to a local semaphore, then it returns
- * the_semaphore control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the semaphore ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_semaphore is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_semaphore is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Semaphore_Control *)
- _Objects_Get( &_Semaphore_Information, id, location );
-}
-
-/*PAGE
- *
- * _Semaphore_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Semaphore_Is_null (
- Semaphore_Control *the_semaphore
-)
-{
- return ( the_semaphore == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/status.inl b/c/src/exec/rtems/inline/status.inl
deleted file mode 100644
index b9182c6f63..0000000000
--- a/c/src/exec/rtems/inline/status.inl
+++ /dev/null
@@ -1,56 +0,0 @@
-/* inline/status.inl
- *
- * This include file contains the implementations of the inlined
- * routines for the status package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_STATUS_inl
-#define __INLINE_STATUS_inl
-
-/*PAGE
- *
- * rtems_is_status_successful
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the status code is equal to RTEMS_SUCCESSFUL,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean rtems_is_status_successful(
- rtems_status_code code
-)
-{
- return (code == RTEMS_SUCCESSFUL);
-}
-
-/*PAGE
- *
- * rtems_are_statuses_equal
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the status code1 is equal to code2,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean rtems_are_statuses_equal(
- rtems_status_code code1,
- rtems_status_code code2
-)
-{
- return (code1 == code2);
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/support.inl b/c/src/exec/rtems/inline/support.inl
deleted file mode 100644
index 06de8d1f59..0000000000
--- a/c/src/exec/rtems/inline/support.inl
+++ /dev/null
@@ -1,61 +0,0 @@
-/* support.inl
- *
- * This include file contains the static inline implementation of all
- * of the inlined routines specific to the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SUPPORT_inl
-#define __RTEMS_SUPPORT_inl
-
-/*PAGE
- *
- * rtems_is_name_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the name is valid, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE rtems_boolean rtems_is_name_valid (
- rtems_name name
-)
-{
- return ( name != 0 );
-}
-
-/*PAGE
- *
- * rtems_name_to_characters
- *
- * DESCRIPTION:
- *
- * This function breaks the object name into the four component
- * characters C1, C2, C3, and C4.
- */
-
-RTEMS_INLINE_ROUTINE void rtems_name_to_characters(
- rtems_name name,
- char *c1,
- char *c2,
- char *c3,
- char *c4
-)
-{
- *c1 = (name >> 24) & 0xff;
- *c2 = (name >> 16) & 0xff;
- *c3 = (name >> 8) & 0xff;
- *c4 = name & 0xff;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/tasks.inl b/c/src/exec/rtems/inline/tasks.inl
deleted file mode 100644
index 34c1e055a8..0000000000
--- a/c/src/exec/rtems/inline/tasks.inl
+++ /dev/null
@@ -1,90 +0,0 @@
-/* tasks.inl
- *
- * This file contains the static inline implementation of all inlined
- * routines in the with RTEMS Tasks Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_TASKS_inl
-#define __RTEMS_TASKS_inl
-
-/*PAGE
- *
- * _RTEMS_tasks_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a task control block from
- * the inactive chain of free task control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_RTEMS_tasks_Allocate( void )
-{
- return (Thread_Control *) _Objects_Allocate( &_RTEMS_tasks_Information );
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a task control block to the
- * inactive chain of free task control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free (
- Thread_Control *the_task
-)
-{
- _Objects_Free(
- _Objects_Get_information( the_task->Object.id ),
- &the_task->Object
- );
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Priority_to_Core
- *
- * DESCRIPTION:
- *
- * This function converts an RTEMS API priority into a core priority.
- */
-
-RTEMS_INLINE_ROUTINE Priority_Control _RTEMS_tasks_Priority_to_Core(
- rtems_task_priority priority
-)
-{
- return (Priority_Control) priority;
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Priority_is_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_priority is a valid user task priority
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _RTEMS_tasks_Priority_is_valid (
- rtems_task_priority the_priority
-)
-{
- return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) &&
- ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/inline/timer.inl b/c/src/exec/rtems/inline/timer.inl
deleted file mode 100644
index b884e02f4d..0000000000
--- a/c/src/exec/rtems/inline/timer.inl
+++ /dev/null
@@ -1,142 +0,0 @@
-/* timer.inl
- *
- * This file contains the static inline implementation of the inlined routines
- * from the Timer Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIMER_inl
-#define __TIMER_inl
-
-/*PAGE
- *
- * _Timer_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a timer control block from
- * the inactive chain of free timer control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void )
-{
- return (Timer_Control *) _Objects_Allocate( &_Timer_Information );
-}
-
-/*PAGE
- *
- * _Timer_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a timer control block to the
- * inactive chain of free timer control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Timer_Free (
- Timer_Control *the_timer
-)
-{
- _Objects_Free( &_Timer_Information, &the_timer->Object );
-}
-
-/*PAGE
- *
- * _Timer_Get
- *
- * DESCRIPTION:
- *
- * This function maps timer IDs to timer control blocks.
- * If ID corresponds to a local timer, then it returns
- * the timer control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. Otherwise, location is set
- * to OBJECTS_ERROR and the returned value is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Timer_Control *)
- _Objects_Get( &_Timer_Information, id, location );
-}
-
-/*PAGE
- *
- * _Timer_Is_interval_class
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the class is that of an INTERVAL
- * timer, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Timer_Is_interval_class (
- Timer_Classes the_class
-)
-{
- return ( the_class == TIMER_INTERVAL );
-}
-
-/*PAGE
- *
- * _Timer_Is_time_of_day_class
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the class is that of an INTERVAL
- * timer, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Timer_Is_timer_of_day_class (
- Timer_Classes the_class
-)
-{
- return ( the_class == TIMER_TIME_OF_DAY );
-}
-
-/*PAGE
- *
- * _Timer_Is_dormant_class
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the class is that of a DORMANT
- * timer, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Timer_Is_dormant_class (
- Timer_Classes the_class
-)
-{
- return ( the_class == TIMER_DORMANT );
-}
-
-/*PAGE
- *
- * _Timer_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_timer is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Timer_Is_null (
- Timer_Control *the_timer
-)
-{
- return ( the_timer == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/Makefile.in b/c/src/exec/rtems/macros/Makefile.in
deleted file mode 100644
index 9c11a33172..0000000000
--- a/c/src/exec/rtems/macros/Makefile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-I_PIECES=asr attr dpmem event eventset message modes options \
- part ratemon region sem status support tasks timer
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems/rtems
diff --git a/c/src/exec/rtems/macros/asr.inl b/c/src/exec/rtems/macros/asr.inl
deleted file mode 100644
index d3ed229ca9..0000000000
--- a/c/src/exec/rtems/macros/asr.inl
+++ /dev/null
@@ -1,90 +0,0 @@
-/* macros/asr.h
- *
- * This include file contains the implemenation of all routines
- * associated with the asynchronous signal handler which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_ASR_h
-#define __INLINE_ASR_h
-
-#include <rtems/score/isr.h>
-
-/*PAGE
- *
- * _ASR_Initialize
- *
- */
-
-#define _ASR_Initialize( _information ) \
-{ \
- (_information)->is_enabled = TRUE; \
- (_information)->handler = NULL; \
- (_information)->mode_set = RTEMS_DEFAULT_MODES; \
- (_information)->signals_posted = 0; \
- (_information)->signals_pending = 0; \
- (_information)->nest_level = 0; \
-}
-
-/*PAGE
- *
- * _ASR_Swap_signals
- *
- */
-
-#define _ASR_Swap_signals( _information ) \
-{ \
- rtems_signal_set _signals; \
- ISR_Level _level; \
- \
- _ISR_Disable( _level ); \
- _signals = (_information)->signals_pending; \
- (_information)->signals_pending = (_information)->signals_posted; \
- (_information)->signals_posted = _signals; \
- _ISR_Enable( _level ); \
-}
-
-/*PAGE
- *
- * _ASR_Is_null_handler
- *
- */
-
-#define _ASR_Is_null_handler( _asr_handler ) \
- ( (_asr_handler) == NULL )
-
-/*PAGE
- *
- * _ASR_Are_signals_pending
- *
- */
-
-#define _ASR_Are_signals_pending( _information ) \
- ( (_information)->signals_posted != 0 )
-
-/*PAGE
- *
- * _ASR_Post_signals
- *
- */
-
-#define _ASR_Post_signals( _signals, _signal_set ) \
- do { \
- ISR_Level _level; \
- \
- _ISR_Disable( _level ); \
- *(_signal_set) |= (_signals); \
- _ISR_Enable( _level ); \
- } while ( 0 )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/attr.inl b/c/src/exec/rtems/macros/attr.inl
deleted file mode 100644
index 290e7f7870..0000000000
--- a/c/src/exec/rtems/macros/attr.inl
+++ /dev/null
@@ -1,100 +0,0 @@
-/* macros/attr.h
- *
- * This include file contains all of the inlined routines associated
- * with attributes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_ATTRIBUTES_h
-#define __MACROS_ATTRIBUTES_h
-
-/*PAGE
- *
- * _Attributes_Set
- */
-
-#define _Attributes_Set( _new_attributes, _attribute_set ) \
- ( (_attribute_set) | (_new_attributes) )
-
-/*PAGE
- *
- * _Attributes_Clear
- */
-
-#define _Attributes_Clear( _attribute_set, _mask ) \
- ( (_attribute_set) & ~(_mask) )
-
-/*PAGE
- *
- * _Attributes_Is_floating_point
- *
- */
-
-#define _Attributes_Is_floating_point( _attribute_set ) \
- ( (_attribute_set) & RTEMS_FLOATING_POINT )
-
-/*PAGE
- *
- * _Attributes_Is_global
- *
- */
-
-#define _Attributes_Is_global( _attribute_set ) \
- ( (_attribute_set) & RTEMS_GLOBAL )
-
-/*PAGE
- *
- * _Attributes_Is_priority
- *
- */
-
-#define _Attributes_Is_priority( _attribute_set ) \
- ( (_attribute_set) & RTEMS_PRIORITY )
-
-/*PAGE
- *
- * _Attributes_Is_binary_semaphore
- *
- */
-
-#define _Attributes_Is_binary_semaphore( _attribute_set ) \
- ( (_attribute_set) & RTEMS_BINARY_SEMAPHORE )
-
-/*PAGE
- *
- * _Attributes_Is_inherit_priority
- *
- */
-
-#define _Attributes_Is_inherit_priority( _attribute_set ) \
- ( (_attribute_set) & RTEMS_INHERIT_PRIORITY )
-
-/*PAGE
- *
- * _Attributes_Is_priority_ceiling
- *
- */
-
-#define _Attributes_Is_priority_ceiling( _attribute_set ) \
- ( (_attribute_set) & RTEMS_PRIORITY_CEILING )
-
-/*PAGE
- *
- * _Attributes_Is_system_task
- *
- */
-
-#define _Attributes_Is_system_task( _attribute_set ) \
- ( (_attribute_set) & RTEMS_SYSTEM_TASK )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/dpmem.inl b/c/src/exec/rtems/macros/dpmem.inl
deleted file mode 100644
index 171f15d8e9..0000000000
--- a/c/src/exec/rtems/macros/dpmem.inl
+++ /dev/null
@@ -1,59 +0,0 @@
-/* macros/dpmem.h
- *
- * This include file contains the inline routine used in conjunction
- * with the Dual Ported Memory Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_DPMEM_h
-#define __MACROS_DPMEM_h
-
-/*PAGE
- *
- * _Dual_ported_memory_Allocate
- *
- */
-
-#define _Dual_ported_memory_Allocate() \
- (Dual_ported_memory_Control *) \
- _Objects_Allocate( &_Dual_ported_memory_Information )
-
-/*PAGE
- *
- * _Dual_ported_memory_Free
- *
- */
-
-#define _Dual_ported_memory_Free( _the_port ) \
- _Objects_Free( &_Dual_ported_memory_Information, &(_the_port)->Object )
-
-/*PAGE
- *
- * _Dual_ported_memory_Get
- *
- */
-
-#define _Dual_ported_memory_Get( _id, _location ) \
- (Dual_ported_memory_Control *) \
- _Objects_Get( &_Dual_ported_memory_Information, (_id), (_location) )
-
-
-/*PAGE
- *
- * _Dual_ported_memory_Is_null
- */
-
-#define _Dual_ported_memory_Is_null( _the_port ) \
- ( (_the_port) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/event.inl b/c/src/exec/rtems/macros/event.inl
deleted file mode 100644
index e0d18e7817..0000000000
--- a/c/src/exec/rtems/macros/event.inl
+++ /dev/null
@@ -1,21 +0,0 @@
-/* macros/event.h
- *
- * This include file contains the implementation of macros for
- * the Event Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_EVENT_h
-#define __MACROS_EVENT_h
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/eventset.inl b/c/src/exec/rtems/macros/eventset.inl
deleted file mode 100644
index 3eeb2bea63..0000000000
--- a/c/src/exec/rtems/macros/eventset.inl
+++ /dev/null
@@ -1,59 +0,0 @@
-/* eventset.inl
- *
- * This include file contains the macro implementation of inlined
- * routines in the event set object.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __EVENT_SET_inl
-#define __EVENT_SET_inl
-
-/*PAGE
- *
- * _Event_sets_Is_empty
- */
-
-#define _Event_sets_Is_empty( _the_event_set ) \
- ((_the_event_set) == 0 )
-
-/*PAGE
- *
- * _Event_sets_Is_empty
- */
-
-#define _Event_sets_Post( _the_new_events, _the_event_set ) \
- do { \
- ISR_Level level; \
- \
- _ISR_Disable( level ); \
- *(_the_event_set) |= (_the_new_events); \
- _ISR_Enable( level ); \
- } while (0);
-
-/*PAGE
- *
- * _Event_sets_Is_empty
- */
-
-#define _Event_sets_Get( _the_event_set, _the_event_condition ) \
- ((_the_event_set) & (_the_event_condition))
-
-/*PAGE
- *
- * _Event_sets_Clear
- */
-
-#define _Event_sets_Clear( _the_event_set, _the_mask ) \
- ((_the_event_set) & ~(_the_mask))
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/message.inl b/c/src/exec/rtems/macros/message.inl
deleted file mode 100644
index 537701d41b..0000000000
--- a/c/src/exec/rtems/macros/message.inl
+++ /dev/null
@@ -1,49 +0,0 @@
-/* message.inl
- *
- * This include file contains the macro implementation of all
- * inlined routines in the Message Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MESSAGE_QUEUE_inl
-#define __MESSAGE_QUEUE_inl
-
-/*PAGE
- *
- * _Message_queue_Is_null
- *
- */
-
-#define _Message_queue_Is_null( _the_message_queue ) \
- ( (_the_message_queue) == NULL )
-
-/*PAGE
- *
- * _Message_queue_Free
- *
- */
-
-#define _Message_queue_Free( _the_message_queue ) \
- _Objects_Free( &_Message_queue_Information, &(_the_message_queue)->Object )
-
-/*PAGE
- *
- * _Message_queue_Get
- *
- */
-
-#define _Message_queue_Get( _id, _location ) \
- (Message_queue_Control *) \
- _Objects_Get( &_Message_queue_Information, (_id), (_location) )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/modes.inl b/c/src/exec/rtems/macros/modes.inl
deleted file mode 100644
index e84bf25b32..0000000000
--- a/c/src/exec/rtems/macros/modes.inl
+++ /dev/null
@@ -1,92 +0,0 @@
-/* modes.inl
- *
- * This include file contains the macro implementation of the
- * inlined routines in the Mode Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MODES_inl
-#define __MODES_inl
-
-/*PAGE
- *
- * _Modes_Mask_changed
- *
- */
-
-#define _Modes_Mask_changed( _mode_set, _masks ) \
- ( (_mode_set) & (_masks) )
-
-/*PAGE
- *
- * _Modes_Is_asr_disabled
- *
- */
-
-#define _Modes_Is_asr_disabled( _mode_set ) \
- (((_mode_set) & RTEMS_ASR_MASK) == RTEMS_NO_ASR)
-
-/*PAGE
- *
- * _Modes_Is_preempt
- *
- */
-
-#define _Modes_Is_preempt( _mode_set ) \
- ( ( (_mode_set) & RTEMS_PREEMPT_MASK ) == RTEMS_PREEMPT )
-
-/*PAGE
- *
- * _Modes_Is_timeslice
- *
- */
-
-#define _Modes_Is_timeslice( _mode_set ) \
- (((_mode_set) & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE)
-
-/*PAGE
- *
- * _Modes_Get_interrupt_level
- *
- */
-
-#define _Modes_Get_interrupt_level( _mode_set ) \
- ( (_mode_set) & RTEMS_INTERRUPT_MASK )
-
-/*PAGE
- *
- * _Modes_Set_interrupt_level
- *
- */
-
-#define _Modes_Set_interrupt_level( _mode_set ) \
- _ISR_Set_level( _Modes_Get_interrupt_level( (_mode_set) ) )
-
-/*PAGE
- *
- * _Modes_Change
- *
- */
-
-#define _Modes_Change( _old_mode_set, _new_mode_set, \
- _mask, _out_mode_set, _changed ) \
- { Modes_Control _out_mode; \
- \
- _out_mode = (_old_mode_set); \
- _out_mode &= ~(_mask); \
- _out_mode |= (_new_mode_set) & (_mask); \
- *(_changed) = _out_mode ^ (_old_mode_set); \
- *(_out_mode_set) = _out_mode; \
- }
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/options.inl b/c/src/exec/rtems/macros/options.inl
deleted file mode 100644
index 78068ab17c..0000000000
--- a/c/src/exec/rtems/macros/options.inl
+++ /dev/null
@@ -1,39 +0,0 @@
-/* options.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Options Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OPTIONS_inl
-#define __OPTIONS_inl
-
-/*PAGE
- *
- * _Options_Is_no_wait
- *
- */
-
-#define _Options_Is_no_wait( _option_set ) \
- ( (_option_set) & RTEMS_NO_WAIT )
-
-/*PAGE
- *
- * _Options_Is_any
- *
- */
-
-#define _Options_Is_any( _option_set ) \
- ( (_option_set) & RTEMS_EVENT_ANY )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/part.inl b/c/src/exec/rtems/macros/part.inl
deleted file mode 100644
index 027a7427e5..0000000000
--- a/c/src/exec/rtems/macros/part.inl
+++ /dev/null
@@ -1,117 +0,0 @@
-/* part.inl
- *
- * This file contains the macro implementation of all inlined routines
- * in the Partition Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PARTITION_inl
-#define __PARTITION_inl
-
-/*PAGE
- *
- * _Partition_Allocate_buffer
- *
- */
-
-#define _Partition_Allocate_buffer( _the_partition ) \
- _Chain_Get( &(_the_partition)->Memory )
-
-/*PAGE
- *
- * _Partition_Free_buffer
- *
- */
-
-#define _Partition_Free_buffer( _the_partition, _the_buffer ) \
- _Chain_Append( &(_the_partition)->Memory, (_the_buffer) )
-
-/*PAGE
- *
- * _Partition_Is_buffer_on_boundary
- *
- */
-
-#define _Partition_Is_buffer_on_boundary( _the_buffer, _the_partition ) \
- ((((unsigned32) _Addresses_Subtract( \
- (_the_buffer), \
- (_the_partition)->starting_address ) \
- ) % \
- (_the_partition)->buffer_size) == 0)
-
-/*PAGE
- *
- * _Partition_Is_buffer_valid
- *
- */
-
-#define _Partition_Is_buffer_valid( _the_buffer, _the_partition ) \
- ( \
- _Addresses_Is_in_range( \
- (_the_buffer), \
- (_the_partition)->starting_address, \
- _Addresses_Add_offset( \
- (_the_partition)->starting_address, \
- (_the_partition)->length \
- ) \
- ) && \
- _Partition_Is_buffer_on_boundary( (_the_buffer), (_the_partition) ) \
- )
-
-/*PAGE
- *
- * _Partition_Is_buffer_size_aligned
- *
- */
-
-#define _Partition_Is_buffer_size_aligned( _buffer_size ) \
- ((_buffer_size) % CPU_PARTITION_ALIGNMENT == 0)
-
-/*PAGE
- *
- * _Partition_Allocate
- *
- */
-
-#define _Partition_Allocate() \
- (Partition_Control *) _Objects_Allocate( &_Partition_Information )
-
-/*PAGE
- *
- * _Partition_Free
- *
- */
-
-#define _Partition_Free( _the_partition ) \
- _Objects_Free( &_Partition_Information, &(_the_partition)->Object )
-
-/*PAGE
- *
- * _Partition_Get
- *
- */
-
-#define _Partition_Get( _id, _location ) \
- (Partition_Control *) \
- _Objects_Get( &_Partition_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Partition_Is_null
- *
- */
-
-#define _Partition_Is_null( _the_partition ) \
- ( (_the_partition) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/ratemon.inl b/c/src/exec/rtems/macros/ratemon.inl
deleted file mode 100644
index 8a550d91e0..0000000000
--- a/c/src/exec/rtems/macros/ratemon.inl
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ratemon.inl
- *
- * This file contains the macro implementation of the inlined
- * routines in the Rate Monotonic Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RATE_MONOTONIC_inl
-#define __RATE_MONOTONIC_inl
-
-/*PAGE
- *
- * _Rate_monotonic_Allocate
- *
- */
-
-#define _Rate_monotonic_Allocate() \
- (Rate_monotonic_Control *) \
- _Objects_Allocate( &_Rate_monotonic_Information )
-
-/*PAGE
- *
- * _Rate_monotonic_Free
- *
- */
-
-#define _Rate_monotonic_Free( _the_period ) \
- _Objects_Free( &_Rate_monotonic_Information, &(_the_period)->Object )
-
-/*PAGE
- *
- * _Rate_monotonic_Get
- *
- */
-
-#define _Rate_monotonic_Get( _id, _location ) \
- (Rate_monotonic_Control *) \
- _Objects_Get( &_Rate_monotonic_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Rate_monotonic_Is_active
- *
- */
-
-#define _Rate_monotonic_Is_active( _the_period ) \
- ((_the_period)->state == RATE_MONOTONIC_ACTIVE)
-
-/*PAGE
- *
- * _Rate_monotonic_Is_inactive
- *
- */
-
-#define _Rate_monotonic_Is_inactive( _the_period ) \
- ((_the_period)->state == RATE_MONOTONIC_INACTIVE)
-
-/*PAGE
- *
- * _Rate_monotonic_Is_expired
- *
- */
-
-#define _Rate_monotonic_Is_expired( _the_period ) \
- ((_the_period)->state == RATE_MONOTONIC_EXPIRED)
-
-/*PAGE
- *
- * _Rate_monotonic_Is_null
- *
- */
-
-#define _Rate_monotonic_Is_null( _the_period ) ( (_the_period) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/region.inl b/c/src/exec/rtems/macros/region.inl
deleted file mode 100644
index 8c36bdeb34..0000000000
--- a/c/src/exec/rtems/macros/region.inl
+++ /dev/null
@@ -1,75 +0,0 @@
-/* region.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Region Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __REGION_inl
-#define __REGION_inl
-
-/*PAGE
- *
- * _Region_Allocate
- *
- */
-
-#define _Region_Allocate() \
- (Region_Control *) _Objects_Allocate( &_Region_Information )
-
-/*PAGE
- *
- * _Region_Free
- *
- */
-
-#define _Region_Free( _the_region ) \
- _Objects_Free( &_Region_Information, &(_the_region)->Object )
-
-/*PAGE
- *
- * _Region_Get
- *
- */
-
-#define _Region_Get( _id, _location ) \
- (Region_Control *) \
- _Objects_Get( &_Region_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Region_Allocate_segment
- *
- */
-
-#define _Region_Allocate_segment( _the_region, _size ) \
- _Heap_Allocate( &(_the_region)->Memory, (_size) )
-
-/*PAGE
- *
- * _Region_Free_segment
- *
- */
-
-#define _Region_Free_segment( _the_region, _the_segment ) \
- _Heap_Free( &(_the_region)->Memory, (_the_segment) )
-
-/*PAGE
- *
- * _Region_Is_null
- *
- */
-
-#define _Region_Is_null( _the_region ) ( (_the_region) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/Makefile.in b/c/src/exec/rtems/macros/rtems/rtems/Makefile.in
deleted file mode 100644
index 9c11a33172..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/Makefile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-I_PIECES=asr attr dpmem event eventset message modes options \
- part ratemon region sem status support tasks timer
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems/rtems
diff --git a/c/src/exec/rtems/macros/rtems/rtems/asr.inl b/c/src/exec/rtems/macros/rtems/rtems/asr.inl
deleted file mode 100644
index d3ed229ca9..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/asr.inl
+++ /dev/null
@@ -1,90 +0,0 @@
-/* macros/asr.h
- *
- * This include file contains the implemenation of all routines
- * associated with the asynchronous signal handler which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_ASR_h
-#define __INLINE_ASR_h
-
-#include <rtems/score/isr.h>
-
-/*PAGE
- *
- * _ASR_Initialize
- *
- */
-
-#define _ASR_Initialize( _information ) \
-{ \
- (_information)->is_enabled = TRUE; \
- (_information)->handler = NULL; \
- (_information)->mode_set = RTEMS_DEFAULT_MODES; \
- (_information)->signals_posted = 0; \
- (_information)->signals_pending = 0; \
- (_information)->nest_level = 0; \
-}
-
-/*PAGE
- *
- * _ASR_Swap_signals
- *
- */
-
-#define _ASR_Swap_signals( _information ) \
-{ \
- rtems_signal_set _signals; \
- ISR_Level _level; \
- \
- _ISR_Disable( _level ); \
- _signals = (_information)->signals_pending; \
- (_information)->signals_pending = (_information)->signals_posted; \
- (_information)->signals_posted = _signals; \
- _ISR_Enable( _level ); \
-}
-
-/*PAGE
- *
- * _ASR_Is_null_handler
- *
- */
-
-#define _ASR_Is_null_handler( _asr_handler ) \
- ( (_asr_handler) == NULL )
-
-/*PAGE
- *
- * _ASR_Are_signals_pending
- *
- */
-
-#define _ASR_Are_signals_pending( _information ) \
- ( (_information)->signals_posted != 0 )
-
-/*PAGE
- *
- * _ASR_Post_signals
- *
- */
-
-#define _ASR_Post_signals( _signals, _signal_set ) \
- do { \
- ISR_Level _level; \
- \
- _ISR_Disable( _level ); \
- *(_signal_set) |= (_signals); \
- _ISR_Enable( _level ); \
- } while ( 0 )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/attr.inl b/c/src/exec/rtems/macros/rtems/rtems/attr.inl
deleted file mode 100644
index 290e7f7870..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/attr.inl
+++ /dev/null
@@ -1,100 +0,0 @@
-/* macros/attr.h
- *
- * This include file contains all of the inlined routines associated
- * with attributes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_ATTRIBUTES_h
-#define __MACROS_ATTRIBUTES_h
-
-/*PAGE
- *
- * _Attributes_Set
- */
-
-#define _Attributes_Set( _new_attributes, _attribute_set ) \
- ( (_attribute_set) | (_new_attributes) )
-
-/*PAGE
- *
- * _Attributes_Clear
- */
-
-#define _Attributes_Clear( _attribute_set, _mask ) \
- ( (_attribute_set) & ~(_mask) )
-
-/*PAGE
- *
- * _Attributes_Is_floating_point
- *
- */
-
-#define _Attributes_Is_floating_point( _attribute_set ) \
- ( (_attribute_set) & RTEMS_FLOATING_POINT )
-
-/*PAGE
- *
- * _Attributes_Is_global
- *
- */
-
-#define _Attributes_Is_global( _attribute_set ) \
- ( (_attribute_set) & RTEMS_GLOBAL )
-
-/*PAGE
- *
- * _Attributes_Is_priority
- *
- */
-
-#define _Attributes_Is_priority( _attribute_set ) \
- ( (_attribute_set) & RTEMS_PRIORITY )
-
-/*PAGE
- *
- * _Attributes_Is_binary_semaphore
- *
- */
-
-#define _Attributes_Is_binary_semaphore( _attribute_set ) \
- ( (_attribute_set) & RTEMS_BINARY_SEMAPHORE )
-
-/*PAGE
- *
- * _Attributes_Is_inherit_priority
- *
- */
-
-#define _Attributes_Is_inherit_priority( _attribute_set ) \
- ( (_attribute_set) & RTEMS_INHERIT_PRIORITY )
-
-/*PAGE
- *
- * _Attributes_Is_priority_ceiling
- *
- */
-
-#define _Attributes_Is_priority_ceiling( _attribute_set ) \
- ( (_attribute_set) & RTEMS_PRIORITY_CEILING )
-
-/*PAGE
- *
- * _Attributes_Is_system_task
- *
- */
-
-#define _Attributes_Is_system_task( _attribute_set ) \
- ( (_attribute_set) & RTEMS_SYSTEM_TASK )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/dpmem.inl b/c/src/exec/rtems/macros/rtems/rtems/dpmem.inl
deleted file mode 100644
index 171f15d8e9..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/dpmem.inl
+++ /dev/null
@@ -1,59 +0,0 @@
-/* macros/dpmem.h
- *
- * This include file contains the inline routine used in conjunction
- * with the Dual Ported Memory Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_DPMEM_h
-#define __MACROS_DPMEM_h
-
-/*PAGE
- *
- * _Dual_ported_memory_Allocate
- *
- */
-
-#define _Dual_ported_memory_Allocate() \
- (Dual_ported_memory_Control *) \
- _Objects_Allocate( &_Dual_ported_memory_Information )
-
-/*PAGE
- *
- * _Dual_ported_memory_Free
- *
- */
-
-#define _Dual_ported_memory_Free( _the_port ) \
- _Objects_Free( &_Dual_ported_memory_Information, &(_the_port)->Object )
-
-/*PAGE
- *
- * _Dual_ported_memory_Get
- *
- */
-
-#define _Dual_ported_memory_Get( _id, _location ) \
- (Dual_ported_memory_Control *) \
- _Objects_Get( &_Dual_ported_memory_Information, (_id), (_location) )
-
-
-/*PAGE
- *
- * _Dual_ported_memory_Is_null
- */
-
-#define _Dual_ported_memory_Is_null( _the_port ) \
- ( (_the_port) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/event.inl b/c/src/exec/rtems/macros/rtems/rtems/event.inl
deleted file mode 100644
index e0d18e7817..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/event.inl
+++ /dev/null
@@ -1,21 +0,0 @@
-/* macros/event.h
- *
- * This include file contains the implementation of macros for
- * the Event Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_EVENT_h
-#define __MACROS_EVENT_h
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/eventset.inl b/c/src/exec/rtems/macros/rtems/rtems/eventset.inl
deleted file mode 100644
index 3eeb2bea63..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/eventset.inl
+++ /dev/null
@@ -1,59 +0,0 @@
-/* eventset.inl
- *
- * This include file contains the macro implementation of inlined
- * routines in the event set object.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __EVENT_SET_inl
-#define __EVENT_SET_inl
-
-/*PAGE
- *
- * _Event_sets_Is_empty
- */
-
-#define _Event_sets_Is_empty( _the_event_set ) \
- ((_the_event_set) == 0 )
-
-/*PAGE
- *
- * _Event_sets_Is_empty
- */
-
-#define _Event_sets_Post( _the_new_events, _the_event_set ) \
- do { \
- ISR_Level level; \
- \
- _ISR_Disable( level ); \
- *(_the_event_set) |= (_the_new_events); \
- _ISR_Enable( level ); \
- } while (0);
-
-/*PAGE
- *
- * _Event_sets_Is_empty
- */
-
-#define _Event_sets_Get( _the_event_set, _the_event_condition ) \
- ((_the_event_set) & (_the_event_condition))
-
-/*PAGE
- *
- * _Event_sets_Clear
- */
-
-#define _Event_sets_Clear( _the_event_set, _the_mask ) \
- ((_the_event_set) & ~(_the_mask))
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/message.inl b/c/src/exec/rtems/macros/rtems/rtems/message.inl
deleted file mode 100644
index 537701d41b..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/message.inl
+++ /dev/null
@@ -1,49 +0,0 @@
-/* message.inl
- *
- * This include file contains the macro implementation of all
- * inlined routines in the Message Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MESSAGE_QUEUE_inl
-#define __MESSAGE_QUEUE_inl
-
-/*PAGE
- *
- * _Message_queue_Is_null
- *
- */
-
-#define _Message_queue_Is_null( _the_message_queue ) \
- ( (_the_message_queue) == NULL )
-
-/*PAGE
- *
- * _Message_queue_Free
- *
- */
-
-#define _Message_queue_Free( _the_message_queue ) \
- _Objects_Free( &_Message_queue_Information, &(_the_message_queue)->Object )
-
-/*PAGE
- *
- * _Message_queue_Get
- *
- */
-
-#define _Message_queue_Get( _id, _location ) \
- (Message_queue_Control *) \
- _Objects_Get( &_Message_queue_Information, (_id), (_location) )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/modes.inl b/c/src/exec/rtems/macros/rtems/rtems/modes.inl
deleted file mode 100644
index e84bf25b32..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/modes.inl
+++ /dev/null
@@ -1,92 +0,0 @@
-/* modes.inl
- *
- * This include file contains the macro implementation of the
- * inlined routines in the Mode Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MODES_inl
-#define __MODES_inl
-
-/*PAGE
- *
- * _Modes_Mask_changed
- *
- */
-
-#define _Modes_Mask_changed( _mode_set, _masks ) \
- ( (_mode_set) & (_masks) )
-
-/*PAGE
- *
- * _Modes_Is_asr_disabled
- *
- */
-
-#define _Modes_Is_asr_disabled( _mode_set ) \
- (((_mode_set) & RTEMS_ASR_MASK) == RTEMS_NO_ASR)
-
-/*PAGE
- *
- * _Modes_Is_preempt
- *
- */
-
-#define _Modes_Is_preempt( _mode_set ) \
- ( ( (_mode_set) & RTEMS_PREEMPT_MASK ) == RTEMS_PREEMPT )
-
-/*PAGE
- *
- * _Modes_Is_timeslice
- *
- */
-
-#define _Modes_Is_timeslice( _mode_set ) \
- (((_mode_set) & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE)
-
-/*PAGE
- *
- * _Modes_Get_interrupt_level
- *
- */
-
-#define _Modes_Get_interrupt_level( _mode_set ) \
- ( (_mode_set) & RTEMS_INTERRUPT_MASK )
-
-/*PAGE
- *
- * _Modes_Set_interrupt_level
- *
- */
-
-#define _Modes_Set_interrupt_level( _mode_set ) \
- _ISR_Set_level( _Modes_Get_interrupt_level( (_mode_set) ) )
-
-/*PAGE
- *
- * _Modes_Change
- *
- */
-
-#define _Modes_Change( _old_mode_set, _new_mode_set, \
- _mask, _out_mode_set, _changed ) \
- { Modes_Control _out_mode; \
- \
- _out_mode = (_old_mode_set); \
- _out_mode &= ~(_mask); \
- _out_mode |= (_new_mode_set) & (_mask); \
- *(_changed) = _out_mode ^ (_old_mode_set); \
- *(_out_mode_set) = _out_mode; \
- }
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/options.inl b/c/src/exec/rtems/macros/rtems/rtems/options.inl
deleted file mode 100644
index 78068ab17c..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/options.inl
+++ /dev/null
@@ -1,39 +0,0 @@
-/* options.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Options Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OPTIONS_inl
-#define __OPTIONS_inl
-
-/*PAGE
- *
- * _Options_Is_no_wait
- *
- */
-
-#define _Options_Is_no_wait( _option_set ) \
- ( (_option_set) & RTEMS_NO_WAIT )
-
-/*PAGE
- *
- * _Options_Is_any
- *
- */
-
-#define _Options_Is_any( _option_set ) \
- ( (_option_set) & RTEMS_EVENT_ANY )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/part.inl b/c/src/exec/rtems/macros/rtems/rtems/part.inl
deleted file mode 100644
index 027a7427e5..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/part.inl
+++ /dev/null
@@ -1,117 +0,0 @@
-/* part.inl
- *
- * This file contains the macro implementation of all inlined routines
- * in the Partition Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PARTITION_inl
-#define __PARTITION_inl
-
-/*PAGE
- *
- * _Partition_Allocate_buffer
- *
- */
-
-#define _Partition_Allocate_buffer( _the_partition ) \
- _Chain_Get( &(_the_partition)->Memory )
-
-/*PAGE
- *
- * _Partition_Free_buffer
- *
- */
-
-#define _Partition_Free_buffer( _the_partition, _the_buffer ) \
- _Chain_Append( &(_the_partition)->Memory, (_the_buffer) )
-
-/*PAGE
- *
- * _Partition_Is_buffer_on_boundary
- *
- */
-
-#define _Partition_Is_buffer_on_boundary( _the_buffer, _the_partition ) \
- ((((unsigned32) _Addresses_Subtract( \
- (_the_buffer), \
- (_the_partition)->starting_address ) \
- ) % \
- (_the_partition)->buffer_size) == 0)
-
-/*PAGE
- *
- * _Partition_Is_buffer_valid
- *
- */
-
-#define _Partition_Is_buffer_valid( _the_buffer, _the_partition ) \
- ( \
- _Addresses_Is_in_range( \
- (_the_buffer), \
- (_the_partition)->starting_address, \
- _Addresses_Add_offset( \
- (_the_partition)->starting_address, \
- (_the_partition)->length \
- ) \
- ) && \
- _Partition_Is_buffer_on_boundary( (_the_buffer), (_the_partition) ) \
- )
-
-/*PAGE
- *
- * _Partition_Is_buffer_size_aligned
- *
- */
-
-#define _Partition_Is_buffer_size_aligned( _buffer_size ) \
- ((_buffer_size) % CPU_PARTITION_ALIGNMENT == 0)
-
-/*PAGE
- *
- * _Partition_Allocate
- *
- */
-
-#define _Partition_Allocate() \
- (Partition_Control *) _Objects_Allocate( &_Partition_Information )
-
-/*PAGE
- *
- * _Partition_Free
- *
- */
-
-#define _Partition_Free( _the_partition ) \
- _Objects_Free( &_Partition_Information, &(_the_partition)->Object )
-
-/*PAGE
- *
- * _Partition_Get
- *
- */
-
-#define _Partition_Get( _id, _location ) \
- (Partition_Control *) \
- _Objects_Get( &_Partition_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Partition_Is_null
- *
- */
-
-#define _Partition_Is_null( _the_partition ) \
- ( (_the_partition) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/ratemon.inl b/c/src/exec/rtems/macros/rtems/rtems/ratemon.inl
deleted file mode 100644
index 8a550d91e0..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/ratemon.inl
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ratemon.inl
- *
- * This file contains the macro implementation of the inlined
- * routines in the Rate Monotonic Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RATE_MONOTONIC_inl
-#define __RATE_MONOTONIC_inl
-
-/*PAGE
- *
- * _Rate_monotonic_Allocate
- *
- */
-
-#define _Rate_monotonic_Allocate() \
- (Rate_monotonic_Control *) \
- _Objects_Allocate( &_Rate_monotonic_Information )
-
-/*PAGE
- *
- * _Rate_monotonic_Free
- *
- */
-
-#define _Rate_monotonic_Free( _the_period ) \
- _Objects_Free( &_Rate_monotonic_Information, &(_the_period)->Object )
-
-/*PAGE
- *
- * _Rate_monotonic_Get
- *
- */
-
-#define _Rate_monotonic_Get( _id, _location ) \
- (Rate_monotonic_Control *) \
- _Objects_Get( &_Rate_monotonic_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Rate_monotonic_Is_active
- *
- */
-
-#define _Rate_monotonic_Is_active( _the_period ) \
- ((_the_period)->state == RATE_MONOTONIC_ACTIVE)
-
-/*PAGE
- *
- * _Rate_monotonic_Is_inactive
- *
- */
-
-#define _Rate_monotonic_Is_inactive( _the_period ) \
- ((_the_period)->state == RATE_MONOTONIC_INACTIVE)
-
-/*PAGE
- *
- * _Rate_monotonic_Is_expired
- *
- */
-
-#define _Rate_monotonic_Is_expired( _the_period ) \
- ((_the_period)->state == RATE_MONOTONIC_EXPIRED)
-
-/*PAGE
- *
- * _Rate_monotonic_Is_null
- *
- */
-
-#define _Rate_monotonic_Is_null( _the_period ) ( (_the_period) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/region.inl b/c/src/exec/rtems/macros/rtems/rtems/region.inl
deleted file mode 100644
index 8c36bdeb34..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/region.inl
+++ /dev/null
@@ -1,75 +0,0 @@
-/* region.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Region Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __REGION_inl
-#define __REGION_inl
-
-/*PAGE
- *
- * _Region_Allocate
- *
- */
-
-#define _Region_Allocate() \
- (Region_Control *) _Objects_Allocate( &_Region_Information )
-
-/*PAGE
- *
- * _Region_Free
- *
- */
-
-#define _Region_Free( _the_region ) \
- _Objects_Free( &_Region_Information, &(_the_region)->Object )
-
-/*PAGE
- *
- * _Region_Get
- *
- */
-
-#define _Region_Get( _id, _location ) \
- (Region_Control *) \
- _Objects_Get( &_Region_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Region_Allocate_segment
- *
- */
-
-#define _Region_Allocate_segment( _the_region, _size ) \
- _Heap_Allocate( &(_the_region)->Memory, (_size) )
-
-/*PAGE
- *
- * _Region_Free_segment
- *
- */
-
-#define _Region_Free_segment( _the_region, _the_segment ) \
- _Heap_Free( &(_the_region)->Memory, (_the_segment) )
-
-/*PAGE
- *
- * _Region_Is_null
- *
- */
-
-#define _Region_Is_null( _the_region ) ( (_the_region) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/sem.inl b/c/src/exec/rtems/macros/rtems/rtems/sem.inl
deleted file mode 100644
index 132422a30b..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/sem.inl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* sem.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Semaphore Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __SEMAPHORE_inl
-#define __SEMAPHORE_inl
-
-/*PAGE
- *
- * _Semaphore_Allocate
- *
- */
-
-#define _Semaphore_Allocate() \
- (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information )
-
-/*PAGE
- *
- * _Semaphore_Free
- *
- */
-
-#define _Semaphore_Free( _the_semaphore ) \
- _Objects_Free( &_Semaphore_Information, &(_the_semaphore)->Object )
-
-/*PAGE
- *
- * _Semaphore_Get
- *
- */
-
-#define _Semaphore_Get( _id, _location ) \
- (Semaphore_Control *) \
- _Objects_Get( &_Semaphore_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Semaphore_Is_null
- *
- */
-
-#define _Semaphore_Is_null( _the_semaphore ) \
- ( (_the_semaphore) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/status.inl b/c/src/exec/rtems/macros/rtems/rtems/status.inl
deleted file mode 100644
index 6db9086df0..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/status.inl
+++ /dev/null
@@ -1,39 +0,0 @@
-/* macros/status.h
- *
- * This include file contains the implementations of the inlined
- * routines for the status package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_STATUS_h
-#define __MACROS_STATUS_h
-
-/*PAGE
- *
- * rtems_is_status_successful
- *
- */
-
-#define rtems_is_status_successful( _code ) \
- ( (_code) == RTEMS_SUCCESSFUL )
-
-/*PAGE
- *
- * rtems_are_statuses_equal
- *
- */
-
-#define rtems_are_statuses_equal( _code1, _code2 ) \
- ((_code1) == (_code2))
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/support.inl b/c/src/exec/rtems/macros/rtems/rtems/support.inl
deleted file mode 100644
index fc84a2e7ee..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/support.inl
+++ /dev/null
@@ -1,44 +0,0 @@
-/* support.inl
- *
- * This include file contains the macros implementation of all
- * of the inlined routines specific to the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SUPPORT_inl
-#define __RTEMS_SUPPORT_inl
-
-/*PAGE
- *
- * rtems_is_name_valid
- *
- */
-
-#define rtems_is_name_valid( _name ) \
- ( (_name) != 0 )
-
-/*PAGE
- *
- * rtems_name_to_characters
- *
- */
-
-#define rtems_name_to_characters( _name, _c1, _c2, _c3, _c4 ) \
- { \
- (*(_c1) = ((_name) >> 24) & 0xff; \
- (*(_c2) = ((_name) >> 16) & 0xff; \
- (*(_c3) = ((_name) >> 8) & 0xff; \
- (*(_c4) = ((_name)) & 0xff; \
- }
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/tasks.inl b/c/src/exec/rtems/macros/rtems/rtems/tasks.inl
deleted file mode 100644
index a60d80d60c..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/tasks.inl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* tasks.inl
- *
- * This file contains the macro implementation of all inlined
- * routines in the with RTEMS Tasks Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_TASKS_inl
-#define __RTEMS_TASKS_inl
-
-/*PAGE
- *
- * _RTEMS_tasks_Allocate
- *
- */
-
-#define _RTEMS_tasks_Allocate() \
- (Thread_Control *) _Objects_Allocate( &_RTEMS_tasks_Information )
-
-/*PAGE
- *
- * _RTEMS_tasks_Free
- *
- */
-
-#define _RTEMS_tasks_Free( _the_task ) \
- _Objects_Free( &_RTEMS_tasks_Information, &(_the_task)->Object )
-
-/*PAGE
- *
- * _RTEMS_tasks_Priority_to_Core
- */
-
-#define _RTEMS_tasks_Priority_to_Core( _priority ) \
- ((Priority_Control) (_priority))
-
-/*PAGE
- *
- * _RTEMS_tasks_Priority_is_valid
- *
- */
-
-#define _RTEMS_tasks_Priority_is_valid( _the_priority ) \
- ( ((_the_priority) >= RTEMS_MINIMUM_PRIORITY) && \
- ((_the_priority) <= RTEMS_MAXIMUM_PRIORITY) )
-
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/rtems/rtems/timer.inl b/c/src/exec/rtems/macros/rtems/rtems/timer.inl
deleted file mode 100644
index 5dc329a203..0000000000
--- a/c/src/exec/rtems/macros/rtems/rtems/timer.inl
+++ /dev/null
@@ -1,85 +0,0 @@
-/* timer.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the Timer Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIMER_inl
-#define __TIMER_inl
-
-/*PAGE
- *
- * _Timer_Allocate
- *
- */
-
-#define _Timer_Allocate() \
- (Timer_Control *) _Objects_Allocate( &_Timer_Information )
-
-/*PAGE
- *
- * _Timer_Free
- *
- */
-
-#define _Timer_Free( _the_timer ) \
- _Objects_Free( &_Timer_Information, &(_the_timer)->Object )
-
-/*PAGE
- *
- * _Timer_Get
- *
- */
-
-#define _Timer_Get( _id, _location ) \
- (Timer_Control *) \
- _Objects_Get( &_Timer_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Timer_Is_interval_class
- *
- */
-
-#define _Timer_Is_interval_class( _the_class ) \
- ( (_the_class) == TIMER_INTERVAL )
-
-/*PAGE
- *
- * _Timer_Is_time_of_day_class
- *
- */
-
-#define _Timer_Is_time_of_day_class( _the_class ) \
- ( (_the_class) == TIMER_TIME_OF_DAY )
-
-/*PAGE
- *
- * _Timer_Is_dormant_class
- *
- */
-
-#define _Timer_Is_dormant_class( _the_class ) \
- ( (_the_class) == TIMER_DORMANT )
-
-/*PAGE
- *
- * _Timer_Is_null
- *
- */
-
-#define _Timer_Is_null( _the_timer ) \
- ( (_the_timer) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/sem.inl b/c/src/exec/rtems/macros/sem.inl
deleted file mode 100644
index 132422a30b..0000000000
--- a/c/src/exec/rtems/macros/sem.inl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* sem.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Semaphore Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __SEMAPHORE_inl
-#define __SEMAPHORE_inl
-
-/*PAGE
- *
- * _Semaphore_Allocate
- *
- */
-
-#define _Semaphore_Allocate() \
- (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information )
-
-/*PAGE
- *
- * _Semaphore_Free
- *
- */
-
-#define _Semaphore_Free( _the_semaphore ) \
- _Objects_Free( &_Semaphore_Information, &(_the_semaphore)->Object )
-
-/*PAGE
- *
- * _Semaphore_Get
- *
- */
-
-#define _Semaphore_Get( _id, _location ) \
- (Semaphore_Control *) \
- _Objects_Get( &_Semaphore_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Semaphore_Is_null
- *
- */
-
-#define _Semaphore_Is_null( _the_semaphore ) \
- ( (_the_semaphore) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/status.inl b/c/src/exec/rtems/macros/status.inl
deleted file mode 100644
index 6db9086df0..0000000000
--- a/c/src/exec/rtems/macros/status.inl
+++ /dev/null
@@ -1,39 +0,0 @@
-/* macros/status.h
- *
- * This include file contains the implementations of the inlined
- * routines for the status package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_STATUS_h
-#define __MACROS_STATUS_h
-
-/*PAGE
- *
- * rtems_is_status_successful
- *
- */
-
-#define rtems_is_status_successful( _code ) \
- ( (_code) == RTEMS_SUCCESSFUL )
-
-/*PAGE
- *
- * rtems_are_statuses_equal
- *
- */
-
-#define rtems_are_statuses_equal( _code1, _code2 ) \
- ((_code1) == (_code2))
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/support.inl b/c/src/exec/rtems/macros/support.inl
deleted file mode 100644
index fc84a2e7ee..0000000000
--- a/c/src/exec/rtems/macros/support.inl
+++ /dev/null
@@ -1,44 +0,0 @@
-/* support.inl
- *
- * This include file contains the macros implementation of all
- * of the inlined routines specific to the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SUPPORT_inl
-#define __RTEMS_SUPPORT_inl
-
-/*PAGE
- *
- * rtems_is_name_valid
- *
- */
-
-#define rtems_is_name_valid( _name ) \
- ( (_name) != 0 )
-
-/*PAGE
- *
- * rtems_name_to_characters
- *
- */
-
-#define rtems_name_to_characters( _name, _c1, _c2, _c3, _c4 ) \
- { \
- (*(_c1) = ((_name) >> 24) & 0xff; \
- (*(_c2) = ((_name) >> 16) & 0xff; \
- (*(_c3) = ((_name) >> 8) & 0xff; \
- (*(_c4) = ((_name)) & 0xff; \
- }
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/tasks.inl b/c/src/exec/rtems/macros/tasks.inl
deleted file mode 100644
index a60d80d60c..0000000000
--- a/c/src/exec/rtems/macros/tasks.inl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* tasks.inl
- *
- * This file contains the macro implementation of all inlined
- * routines in the with RTEMS Tasks Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_TASKS_inl
-#define __RTEMS_TASKS_inl
-
-/*PAGE
- *
- * _RTEMS_tasks_Allocate
- *
- */
-
-#define _RTEMS_tasks_Allocate() \
- (Thread_Control *) _Objects_Allocate( &_RTEMS_tasks_Information )
-
-/*PAGE
- *
- * _RTEMS_tasks_Free
- *
- */
-
-#define _RTEMS_tasks_Free( _the_task ) \
- _Objects_Free( &_RTEMS_tasks_Information, &(_the_task)->Object )
-
-/*PAGE
- *
- * _RTEMS_tasks_Priority_to_Core
- */
-
-#define _RTEMS_tasks_Priority_to_Core( _priority ) \
- ((Priority_Control) (_priority))
-
-/*PAGE
- *
- * _RTEMS_tasks_Priority_is_valid
- *
- */
-
-#define _RTEMS_tasks_Priority_is_valid( _the_priority ) \
- ( ((_the_priority) >= RTEMS_MINIMUM_PRIORITY) && \
- ((_the_priority) <= RTEMS_MAXIMUM_PRIORITY) )
-
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/macros/timer.inl b/c/src/exec/rtems/macros/timer.inl
deleted file mode 100644
index 5dc329a203..0000000000
--- a/c/src/exec/rtems/macros/timer.inl
+++ /dev/null
@@ -1,85 +0,0 @@
-/* timer.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the Timer Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIMER_inl
-#define __TIMER_inl
-
-/*PAGE
- *
- * _Timer_Allocate
- *
- */
-
-#define _Timer_Allocate() \
- (Timer_Control *) _Objects_Allocate( &_Timer_Information )
-
-/*PAGE
- *
- * _Timer_Free
- *
- */
-
-#define _Timer_Free( _the_timer ) \
- _Objects_Free( &_Timer_Information, &(_the_timer)->Object )
-
-/*PAGE
- *
- * _Timer_Get
- *
- */
-
-#define _Timer_Get( _id, _location ) \
- (Timer_Control *) \
- _Objects_Get( &_Timer_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Timer_Is_interval_class
- *
- */
-
-#define _Timer_Is_interval_class( _the_class ) \
- ( (_the_class) == TIMER_INTERVAL )
-
-/*PAGE
- *
- * _Timer_Is_time_of_day_class
- *
- */
-
-#define _Timer_Is_time_of_day_class( _the_class ) \
- ( (_the_class) == TIMER_TIME_OF_DAY )
-
-/*PAGE
- *
- * _Timer_Is_dormant_class
- *
- */
-
-#define _Timer_Is_dormant_class( _the_class ) \
- ( (_the_class) == TIMER_DORMANT )
-
-/*PAGE
- *
- * _Timer_Is_null
- *
- */
-
-#define _Timer_Is_null( _the_timer ) \
- ( (_the_timer) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/rtems/optman/Makefile.in b/c/src/exec/rtems/optman/Makefile.in
deleted file mode 100644
index 41d7274161..0000000000
--- a/c/src/exec/rtems/optman/Makefile.in
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-C_FILES= no-dpmem.c no-event.c no-mp.c no-msg.c \
- no-part.c no-region.c no-rtmon.c no-sem.c no-signal.c no-timer.c
-
-S_FILES=
-
-H_FILES=
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES)
-
-PGMS=$(C_FILES:%.c=$(ARCH)/%.rel)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-ASM4FLAGS += -I $(PROJECT_INCLUDE)/rtems
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGMS)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
diff --git a/c/src/exec/rtems/optman/no-dpmem.c b/c/src/exec/rtems/optman/no-dpmem.c
deleted file mode 100644
index b3a122abb7..0000000000
--- a/c/src/exec/rtems/optman/no-dpmem.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Dual Port Memory Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/address.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/dpmem.h>
-
-void _Dual_ported_memory_Manager_initialization(
- unsigned32 maximum_ports
-)
-{
-}
-
-rtems_status_code rtems_port_create(
- rtems_name name,
- void *internal_start,
- void *external_start,
- unsigned32 length,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_port_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_port_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_port_internal_to_external(
- Objects_Id id,
- void *internal,
- void **external
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_port_external_to_internal(
- Objects_Id id,
- void *external,
- void **internal
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/exec/rtems/optman/no-event.c b/c/src/exec/rtems/optman/no-event.c
deleted file mode 100644
index 5aa427ce73..0000000000
--- a/c/src/exec/rtems/optman/no-event.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Event Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/event.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-void _Event_Manager_initialization( void )
-{
-}
-
-rtems_status_code rtems_event_send(
- Objects_Id id,
- rtems_event_set event_in
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_event_receive(
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
diff --git a/c/src/exec/rtems/optman/no-mp.c b/c/src/exec/rtems/optman/no-mp.c
deleted file mode 100644
index 71c38826f3..0000000000
--- a/c/src/exec/rtems/optman/no-mp.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Multiprocessing Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/mp.h>
-#include <rtems/score/cpu.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/tqdata.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/interr.h>
-
-void _Multiprocessing_Manager_initialization ( void )
-{
-}
-
-void rtems_multiprocessing_announce ( void )
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-void _MPCI_Handler_initialization(
- MPCI_Control *users_mpci_table,
- unsigned32 timeout_status
-)
-{
-}
-
-void _MPCI_Create_server( void )
-{
-}
-
-void _MPCI_Initialization ( void )
-{
-}
-
-void _MPCI_Register_packet_processor(
- MP_packet_Classes the_class,
- MPCI_Packet_processor the_packet_processor
-
-)
-{
-}
-
-MP_packet_Prefix *_MPCI_Get_packet ( void )
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return NULL;
-}
-
-void _MPCI_Return_packet (
- MP_packet_Prefix *the_packet
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-void _MPCI_Send_process_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-unsigned32 _MPCI_Send_request_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet,
- States_Control extra_state
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return 0;
-}
-
-void _MPCI_Send_response_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-MP_packet_Prefix *_MPCI_Receive_packet ( void )
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return NULL;
-}
-
-Thread_Control *_MPCI_Process_response (
- MP_packet_Prefix *the_packet
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return NULL;
-}
-
-Thread _MPCI_Receive_server(
- unsigned32 ignore
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-void _MPCI_Announce ( void )
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-
-void _MPCI_Internal_packets_Send_process_packet (
- MPCI_Internal_Remote_operations operation
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-void _MPCI_Internal_packets_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void )
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return NULL;
-}
-
-/* end of file */
diff --git a/c/src/exec/rtems/optman/no-msg.c b/c/src/exec/rtems/optman/no-msg.c
deleted file mode 100644
index 65103dcb7d..0000000000
--- a/c/src/exec/rtems/optman/no-msg.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Message Queue Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/isr.h>
-#include <rtems/rtems/message.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/interr.h>
-
-void _Message_queue_Manager_initialization(
- unsigned32 maximum_message_queues
-)
-{
-}
-
-rtems_status_code rtems_message_queue_create(
- rtems_name name,
- unsigned32 count,
- unsigned32 max_message_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_message_queue_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_message_queue_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_message_queue_send(
- Objects_Id id,
- void *buffer,
- unsigned32 size
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_message_queue_urgent(
- Objects_Id id,
- void *buffer,
- unsigned32 size
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_message_queue_broadcast(
- Objects_Id id,
- void *buffer,
- unsigned32 size,
- unsigned32 *count
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_message_queue_receive(
- Objects_Id id,
- void *buffer,
- unsigned32 *size_p,
- unsigned32 option_set,
- rtems_interval timeout
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_message_queue_flush(
- Objects_Id id,
- unsigned32 *count
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-unsigned32 _Message_queue_Flush_support(
- Message_queue_Control *the_message_queue
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
- return 0;
-}
-
-boolean _Message_queue_Seize(
- Message_queue_Control *the_message_queue,
- rtems_option option_set,
- void *buffer,
- unsigned32 *size_p
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
- _Thread_Executing->Wait.return_code = RTEMS_UNSATISFIED;
- return TRUE;
-}
-
-rtems_status_code _Message_queue_Submit(
- Objects_Id id,
- void *buffer,
- unsigned32 size,
- Message_queue_Submit_types submit_type
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/exec/rtems/optman/no-part.c b/c/src/exec/rtems/optman/no-part.c
deleted file mode 100644
index 56abcb7af1..0000000000
--- a/c/src/exec/rtems/optman/no-part.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Partition Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/address.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/part.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-void _Partition_Manager_initialization(
- unsigned32 maximum_partitions
-)
-{
-}
-
-rtems_status_code rtems_partition_create(
- rtems_name name,
- void *starting_address,
- unsigned32 length,
- unsigned32 buffer_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_partition_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_partition_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_partition_get_buffer(
- Objects_Id id,
- void **buffer
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_partition_return_buffer(
- Objects_Id id,
- void *buffer
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/exec/rtems/optman/no-region.c b/c/src/exec/rtems/optman/no-region.c
deleted file mode 100644
index 3ae7c86f35..0000000000
--- a/c/src/exec/rtems/optman/no-region.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Region Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/region.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-void _Region_Manager_initialization(
- unsigned32 maximum_regions
-)
-{
-}
-
-rtems_status_code rtems_region_create(
- rtems_name name,
- void *starting_address,
- unsigned32 length,
- unsigned32 page_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_region_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_region_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_region_get_segment(
- Objects_Id id,
- unsigned32 size,
- rtems_option option_set,
- rtems_interval timeout,
- void **segment
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_region_get_segment_size(
- Objects_Id id,
- void *segment,
- unsigned32 *size
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_region_return_segment(
- Objects_Id id,
- void *segment
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/exec/rtems/optman/no-rtmon.c b/c/src/exec/rtems/optman/no-rtmon.c
deleted file mode 100644
index 96e6fe8228..0000000000
--- a/c/src/exec/rtems/optman/no-rtmon.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Rate Monotonic Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/ratemon.h>
-
-void _Rate_monotonic_Manager_initialization(
- unsigned32 maximum_periods
-)
-{
-}
-
-rtems_status_code rtems_rate_monotonic_create(
- rtems_name name,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_rate_monotonic_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_rate_monotonic_cancel(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_rate_monotonic_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_rate_monotonic_period(
- Objects_Id id,
- rtems_interval length
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-void _Rate_monotonic_Timeout(
- Objects_Id id,
- void *ignored
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-boolean _Rate_monotonic_Set_state(
-Rate_monotonic_Control *the_period
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return FALSE;
-}
diff --git a/c/src/exec/rtems/optman/no-sem.c b/c/src/exec/rtems/optman/no-sem.c
deleted file mode 100644
index 2f31e50cd9..0000000000
--- a/c/src/exec/rtems/optman/no-sem.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Semaphore Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/interr.h>
-
-void _Semaphore_Manager_initialization(
- unsigned32 maximum_semaphores
-)
-{
-}
-
-rtems_status_code rtems_semaphore_create(
- rtems_name name,
- unsigned32 count,
- rtems_attribute attribute_set,
- rtems_task_priority priority_ceiling,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_semaphore_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_semaphore_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_semaphore_obtain(
- Objects_Id id,
- unsigned32 option_set,
- rtems_interval timeout
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_semaphore_release(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-boolean _Semaphore_Seize(
- Semaphore_Control *the_semaphore,
- rtems_option option_set
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- _Thread_Executing->Wait.return_code = RTEMS_UNSATISFIED;
- return TRUE;
-}
diff --git a/c/src/exec/rtems/optman/no-signal.c b/c/src/exec/rtems/optman/no-signal.c
deleted file mode 100644
index b73d12c97b..0000000000
--- a/c/src/exec/rtems/optman/no-signal.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Signal Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-#include <rtems/rtems/asr.h>
-#include <rtems/rtems/modes.h>
-#include <rtems/rtems/signal.h>
-
-void _Signal_Manager_initialization( void )
-{
-}
-
-rtems_status_code rtems_signal_catch(
- rtems_asr_entry handler,
- rtems_mode mode_set
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_signal_send(
- rtems_id id,
- rtems_signal_set signal_set
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-/* end of file */
diff --git a/c/src/exec/rtems/optman/no-timer.c b/c/src/exec/rtems/optman/no-timer.c
deleted file mode 100644
index 5d6ec63d4e..0000000000
--- a/c/src/exec/rtems/optman/no-timer.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Timer Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/score/interr.h>
-
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/timer.h>
-
-void _Timer_Manager_initialization(
- unsigned32 maximum_timers
-)
-{
-}
-
-rtems_status_code rtems_timer_create(
- rtems_name name,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_timer_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_timer_cancel(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_timer_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_timer_fire_after(
- Objects_Id id,
- rtems_interval ticks,
- rtems_timer_service_routine_entry routine,
- void *user_data
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_timer_fire_when(
- Objects_Id id,
- rtems_time_of_day *wall_time,
- rtems_timer_service_routine_entry routine,
- void *user_data
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_timer_reset(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/exec/rtems/src/Makefile.in b/c/src/exec/rtems/src/Makefile.in
deleted file mode 100644
index cfab26e662..0000000000
--- a/c/src/exec/rtems/src/Makefile.in
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-C_PIECES=attr clock dpmem event eventmp intr intrbody mp msg msgmp \
- part partmp ratemon region regionmp sem semmp signal signalmp \
- taskmp tasks timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D__RTEMS_INSIDE__
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) ${OBJS}
diff --git a/c/src/exec/rtems/src/attr.c b/c/src/exec/rtems/src/attr.c
deleted file mode 100644
index ea0f68be70..0000000000
--- a/c/src/exec/rtems/src/attr.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Body for Attribute Routines
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/score/stack.h>
-#include <rtems/rtems/modes.h>
-
-rtems_unsigned32 rtems_minimum_stack_size = STACK_MINIMUM_SIZE;
-rtems_unsigned32 rtems_interrupt_mask = RTEMS_INTERRUPT_MASK;
-
-rtems_attribute rtems_interrupt_level_attribute(
- unsigned32 level
-)
-{
- return RTEMS_INTERRUPT_LEVEL(level);
-}
-
diff --git a/c/src/exec/rtems/src/clock.c b/c/src/exec/rtems/src/clock.c
deleted file mode 100644
index 8a1b6b56af..0000000000
--- a/c/src/exec/rtems/src/clock.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Clock Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/clock.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
-
-/*PAGE
- *
- * rtems_clock_get
- *
- * This directive returns the current date and time. If the time has
- * not been set by a tm_set then an error is returned.
- *
- * Input parameters:
- * option - which value to return
- * time_buffer - pointer to output buffer (a time and date structure
- * or an interval)
- *
- * Output parameters:
- * time_buffer - output filled in
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_clock_get(
- rtems_clock_get_options option,
- void *time_buffer
-)
-{
- ISR_Level level;
- rtems_interval tmp;
-
- switch ( option ) {
- case RTEMS_CLOCK_GET_TOD:
- if ( !_TOD_Is_set )
- return RTEMS_NOT_DEFINED;
-
- *(rtems_time_of_day *)time_buffer = _TOD_Current;
- return RTEMS_SUCCESSFUL;
-
- case RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH:
- if ( !_TOD_Is_set )
- return RTEMS_NOT_DEFINED;
-
- *(rtems_interval *)time_buffer = _TOD_Seconds_since_epoch;
- return RTEMS_SUCCESSFUL;
-
- case RTEMS_CLOCK_GET_TICKS_SINCE_BOOT:
- *(rtems_interval *)time_buffer = _Watchdog_Ticks_since_boot;
- return RTEMS_SUCCESSFUL;
-
- case RTEMS_CLOCK_GET_TICKS_PER_SECOND:
- *(rtems_interval *)time_buffer = _TOD_Ticks_per_second;
- return RTEMS_SUCCESSFUL;
-
- case RTEMS_CLOCK_GET_TIME_VALUE:
- if ( !_TOD_Is_set )
- return RTEMS_NOT_DEFINED;
-
- _ISR_Disable( level );
- ((rtems_clock_time_value *)time_buffer)->seconds =
- _TOD_Seconds_since_epoch;
- tmp = _TOD_Current.ticks;
- _ISR_Enable( level );
-
- tmp *= _TOD_Microseconds_per_tick;
- ((rtems_clock_time_value *)time_buffer)->microseconds = tmp;
-
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* should never get here */
-
-}
-
-/*PAGE
- *
- * rtems_clock_set
- *
- * This directive sets the date and time for this node.
- *
- * Input parameters:
- * time_buffer - pointer to the time and date structure
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_clock_set(
- rtems_time_of_day *time_buffer
-)
-{
- rtems_interval seconds;
-
- if ( _TOD_Validate( time_buffer ) ) {
- seconds = _TOD_To_seconds( time_buffer );
- _Thread_Disable_dispatch();
- _TOD_Set( time_buffer, seconds );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- return RTEMS_INVALID_CLOCK;
-}
-
-/*PAGE
- *
- * rtems_clock_tick
- *
- * This directive notifies the executve that a tick has occurred.
- * When the tick occurs the time manager updates and maintains
- * the calendar time, timeslicing, and any timeout delays.
- *
- * Input parameters: NONE
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - always succeeds
- *
- * NOTE: This routine only works for leap-years through 2099.
- */
-
-rtems_status_code rtems_clock_tick( void )
-{
- _TOD_Tickle_ticks();
-
- _Watchdog_Tickle_ticks();
-
- _Thread_Tickle_timeslice();
-
- if ( _Thread_Is_context_switch_necessary() &&
- _Thread_Is_dispatching_enabled() )
- _Thread_Dispatch();
-
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/exec/rtems/src/dpmem.c b/c/src/exec/rtems/src/dpmem.c
deleted file mode 100644
index 9cc778df82..0000000000
--- a/c/src/exec/rtems/src/dpmem.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Dual Port Memory Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/address.h>
-#include <rtems/rtems/dpmem.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/dpmem.h>
-
-/*PAGE
- *
- * _Dual_ported_memory_Manager_initialization
- *
- * This routine initializes all dual-ported memory manager related
- * data structures.
- *
- * Input parameters:
- * maximum_ports - number of ports to initialize
- *
- * Output parameters: NONE
- */
-
-void _Dual_ported_memory_Manager_initialization(
- unsigned32 maximum_ports
-)
-{
- _Objects_Initialize_information(
- &_Dual_ported_memory_Information,
- OBJECTS_RTEMS_PORTS,
- FALSE,
- maximum_ports,
- sizeof( Dual_ported_memory_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-}
-
-/*PAGE
- *
- * rtems_port_create
- *
- * This directive creates a port into a dual-ported memory area.
- *
- * Input parameters:
- * name - user defined port name
- * internal_start - internal start address of port
- * external_start - external start address of port
- * length - physical length in bytes
- * id - address of port id to set
- *
- * Output parameters:
- * id - port id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_port_create(
- rtems_name name,
- void *internal_start,
- void *external_start,
- unsigned32 length,
- Objects_Id *id
-)
-{
- register Dual_ported_memory_Control *the_port;
-
- if ( !rtems_is_name_valid( name) )
- return RTEMS_INVALID_NAME;
-
- if ( !_Addresses_Is_aligned( internal_start ) ||
- !_Addresses_Is_aligned( external_start ) )
- return RTEMS_INVALID_ADDRESS;
-
- _Thread_Disable_dispatch(); /* to prevent deletion */
-
- the_port = _Dual_ported_memory_Allocate();
-
- if ( !the_port ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- the_port->internal_base = internal_start;
- the_port->external_base = external_start;
- the_port->length = length - 1;
-
- _Objects_Open(
- &_Dual_ported_memory_Information,
- &the_port->Object,
- &name
- );
-
- *id = the_port->Object.id;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_port_ident
- *
- * This directive returns the system ID associated with
- * the port name.
- *
- * Input parameters:
- * name - user defined port name
- * id - pointer to port id
- *
- * Output parameters:
- * *id - port id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_port_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id(
- &_Dual_ported_memory_Information,
- &name,
- OBJECTS_SEARCH_ALL_NODES,
- id
- );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_port_delete
- *
- * This directive allows a thread to delete a dual-ported memory area
- * specified by the dual-ported memory identifier.
- *
- * Input parameters:
- * id - dual-ported memory area id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_port_delete(
- Objects_Id id
-)
-{
- register Dual_ported_memory_Control *the_port;
- Objects_Locations location;
-
- the_port = _Dual_ported_memory_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- _Objects_Close( &_Dual_ported_memory_Information, &the_port->Object );
- _Dual_ported_memory_Free( the_port );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_port_internal_to_external
- *
- * This directive converts an internal dual-ported memory address to an
- * external dual-ported memory address. If the given internal address
- * is an invalid dual-ported address, then the external address is set
- * to the given internal address.
- *
- * Input parameters:
- * id - id of dual-ported memory object
- * internal - internal address to set
- * external - pointer to external address
- *
- * Output parameters:
- * external - external address
- * RTEMS_SUCCESSFUL - always succeeds
- */
-
-rtems_status_code rtems_port_internal_to_external(
- Objects_Id id,
- void *internal,
- void **external
-)
-{
- register Dual_ported_memory_Control *the_port;
- Objects_Locations location;
- unsigned32 ending;
-
- the_port = _Dual_ported_memory_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- ending = _Addresses_Subtract( internal, the_port->internal_base );
- if ( ending > the_port->length )
- *external = internal;
- else
- *external = _Addresses_Add_offset( the_port->external_base,
- ending );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_port_external_to_internal
- *
- * This directive converts an external dual-ported memory address to an
- * internal dual-ported memory address. If the given external address
- * is an invalid dual-ported address, then the internal address is set
- * to the given external address.
- *
- * Input parameters:
- * id - id of dp memory object
- * external - external address
- * internal - pointer of internal address to set
- *
- * Output parameters:
- * internal - internal address
- * RTEMS_SUCCESSFUL - always succeeds
- */
-
-rtems_status_code rtems_port_external_to_internal(
- Objects_Id id,
- void *external,
- void **internal
-)
-{
- register Dual_ported_memory_Control *the_port;
- Objects_Locations location;
- unsigned32 ending;
-
- the_port = _Dual_ported_memory_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- ending = _Addresses_Subtract( external, the_port->external_base );
- if ( ending > the_port->length )
- *internal = external;
- else
- *internal = _Addresses_Add_offset( the_port->internal_base,
- ending );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
diff --git a/c/src/exec/rtems/src/event.c b/c/src/exec/rtems/src/event.c
deleted file mode 100644
index a780ba7cf7..0000000000
--- a/c/src/exec/rtems/src/event.c
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * Event Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/event.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/tasks.h>
-
-/*PAGE
- *
- * _Event_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Event_Manager_initialization( void )
-{
- _Event_Sync_state = EVENT_SYNC_SYNCHRONIZED;
-
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor( MP_PACKET_EVENT, _Event_MP_Process_packet );
-}
-
-/*PAGE
- *
- * rtems_event_send
- *
- * This directive allows a thread send an event set to another thread.
- *
- * Input parameters:
- * id - thread id
- * event - event set
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_event_send(
- Objects_Id id,
- rtems_event_set event_in
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
- RTEMS_API_Control *api;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return(
- _Event_MP_Send_request_packet(
- EVENT_MP_SEND_REQUEST,
- id,
- event_in
- )
- );
- case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
- _Event_sets_Post( event_in, &api->pending_events );
- _Event_Surrender( the_thread );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_event_receive
- *
- * This directive allows a thread to receive a set of events.
- *
- * Input parameters:
- * event_in - input event condition
- * option_set - options
- * ticks - number of ticks to wait (0 means wait forever)
- * event_out - pointer to output event set
- *
- * Output parameters:
- * event out - event set
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_event_receive(
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-)
-{
- RTEMS_API_Control *api;
-
- api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ];
-
- if ( _Event_sets_Is_empty( event_in ) ) {
- *event_out = api->pending_events;
- return RTEMS_SUCCESSFUL;
- }
-
- _Thread_Disable_dispatch();
- _Event_Seize( event_in, option_set, ticks, event_out );
- _Thread_Enable_dispatch();
- return( _Thread_Executing->Wait.return_code );
-}
-
-
-/*PAGE
- *
- * _Event_Seize
- *
- * This routine attempts to satisfy the requested event condition
- * for the running thread.
- *
- * Input parameters:
- * event_in - the event condition to satisfy
- * option_set - acquire event options
- * ticks - interval to wait
- * event_out - pointer to event set output area
- *
- * Output parameters: NONE
- * *event_out - event set output area filled in
- *
- * INTERRUPT LATENCY:
- * available
- * wait
- * check sync
- */
-
-void _Event_Seize(
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-)
-{
- Thread_Control *executing;
- rtems_event_set seized_events;
- rtems_event_set pending_events;
- ISR_Level level;
- RTEMS_API_Control *api;
- Event_Sync_states sync_state;
-
- executing = _Thread_Executing;
- executing->Wait.return_code = RTEMS_SUCCESSFUL;
-
- api = executing->API_Extensions[ THREAD_API_RTEMS ];
-
- _ISR_Disable( level );
- pending_events = api->pending_events;
- seized_events = _Event_sets_Get( pending_events, event_in );
-
- if ( !_Event_sets_Is_empty( seized_events ) &&
- (seized_events == event_in || _Options_Is_any( option_set )) ) {
- api->pending_events =
- _Event_sets_Clear( pending_events, seized_events );
- _ISR_Enable( level );
- *event_out = seized_events;
- return;
- }
-
- if ( _Options_Is_no_wait( option_set ) ) {
- _ISR_Enable( level );
- executing->Wait.return_code = RTEMS_UNSATISFIED;
- *event_out = seized_events;
- return;
- }
-
- _Event_Sync_state = EVENT_SYNC_NOTHING_HAPPENED;
-
- executing->Wait.option = (unsigned32) option_set;
- executing->Wait.count = (unsigned32) event_in;
- executing->Wait.return_argument = event_out;
-
- _ISR_Enable( level );
-
- if ( ticks ) {
- _Watchdog_Initialize(
- &executing->Timer,
- _Event_Timeout,
- executing->Object.id,
- NULL
- );
- _Watchdog_Insert_ticks( &executing->Timer, ticks );
- }
-
- _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT );
-
- _ISR_Disable( level );
-
- sync_state = _Event_Sync_state;
- _Event_Sync_state = EVENT_SYNC_SYNCHRONIZED;
-
- switch ( sync_state ) {
- case EVENT_SYNC_SYNCHRONIZED:
- /*
- * This cannot happen. It indicates that this routine did not
- * enter the synchronization states above.
- */
- return;
-
- case EVENT_SYNC_NOTHING_HAPPENED:
- _ISR_Enable( level );
- return;
-
- case EVENT_SYNC_TIMEOUT:
- executing->Wait.return_code = RTEMS_TIMEOUT;
- _ISR_Enable( level );
- _Thread_Unblock( executing );
- return;
-
- case EVENT_SYNC_SATISFIED:
- if ( _Watchdog_Is_active( &executing->Timer ) ) {
- _Watchdog_Deactivate( &executing->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &executing->Timer );
- } else
- _ISR_Enable( level );
- _Thread_Unblock( executing );
- return;
- }
-}
-
-/*PAGE
- *
- * _Event_Surrender
- *
- * This routines remove a thread from the specified threadq.
- *
- * Input parameters:
- * the_thread - pointer to thread to be dequeued
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * before flash
- * after flash
- * check sync
- */
-
-void _Event_Surrender(
- Thread_Control *the_thread
-)
-{
- ISR_Level level;
- rtems_event_set pending_events;
- rtems_event_set event_condition;
- rtems_event_set seized_events;
- rtems_option option_set;
- RTEMS_API_Control *api;
-
- api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
-
- option_set = (rtems_option) the_thread->Wait.option;
-
- _ISR_Disable( level );
- pending_events = api->pending_events;
- event_condition = (rtems_event_set) the_thread->Wait.count;
-
- seized_events = _Event_sets_Get( pending_events, event_condition );
-
- if ( !_Event_sets_Is_empty( seized_events ) ) {
- if ( _States_Is_waiting_for_event( the_thread->current_state ) ) {
- if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
- api->pending_events =
- _Event_sets_Clear( pending_events, seized_events );
- *(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
-
- _ISR_Flash( level );
-
- if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
- _ISR_Enable( level );
- _Thread_Unblock( the_thread );
- }
- else {
- _Watchdog_Deactivate( &the_thread->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &the_thread->Timer );
- _Thread_Unblock( the_thread );
- }
- return;
- }
- }
-
- switch ( _Event_Sync_state ) {
- case EVENT_SYNC_SYNCHRONIZED:
- case EVENT_SYNC_SATISFIED:
- break;
-
- case EVENT_SYNC_NOTHING_HAPPENED:
- case EVENT_SYNC_TIMEOUT:
- if ( !_Thread_Is_executing( the_thread ) )
- break;
-
- if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
- api->pending_events =
- _Event_sets_Clear( pending_events,seized_events );
- *(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
- _Event_Sync_state = EVENT_SYNC_SATISFIED;
- }
- break;
- }
- }
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Event_Timeout
- *
- * This routine processes a thread which timeouts while waiting to
- * receive an event_set. It is called by the watchdog handler.
- *
- * Input parameters:
- * id - thread id
- *
- * Output parameters: NONE
- */
-
-void _Event_Timeout(
- Objects_Id id,
- void *ignored
-)
-{
- Thread_Control *the_thread;
- Objects_Locations location;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* impossible */
- break;
- case OBJECTS_LOCAL:
-
- /*
- * If the event manager is not synchronized, then it is either
- * "nothing happened", "timeout", or "satisfied". If the_thread
- * is the executing thread, then it is in the process of blocking
- * and it is the thread which is responsible for the synchronization
- * process.
- *
- * If it is not satisfied, then it is "nothing happened" and
- * this is the "timeout" transition. After a request is satisfied,
- * a timeout is not allowed to occur.
- */
-
- if ( _Event_Sync_state != EVENT_SYNC_SYNCHRONIZED &&
- _Thread_Is_executing( the_thread ) ) {
- if ( _Event_Sync_state != EVENT_SYNC_SATISFIED )
- _Event_Sync_state = EVENT_SYNC_TIMEOUT;
- } else {
- the_thread->Wait.return_code = RTEMS_TIMEOUT;
- _Thread_Unblock( the_thread );
- }
- _Thread_Unnest_dispatch();
- break;
- }
-}
diff --git a/c/src/exec/rtems/src/eventmp.c b/c/src/exec/rtems/src/eventmp.c
deleted file mode 100644
index 4a561e69a2..0000000000
--- a/c/src/exec/rtems/src/eventmp.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Multiprocessing Support for the Event Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/event.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _Event_MP_Send_process_packet
- *
- * This subprogram is not needed since there are no process
- * packets to be sent by this manager.
- *
- */
-
-/*PAGE
- *
- * _Event_MP_Send_request_packet
- *
- */
-
-rtems_status_code _Event_MP_Send_request_packet (
- Event_MP_Remote_operations operation,
- Objects_Id event_id,
- rtems_event_set event_in
-)
-{
- Event_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case EVENT_MP_SEND_REQUEST:
-
- the_packet = _Event_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_EVENT;
- the_packet->Prefix.length = sizeof ( Event_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Event_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = event_id;
- the_packet->event_in = event_in;
-
- return (rtems_status_code)
- _MPCI_Send_request_packet(
- rtems_get_node( event_id ),
- &the_packet->Prefix,
- STATES_READY
- );
-
- break;
-
- case EVENT_MP_SEND_RESPONSE:
- break;
-
- }
- /*
- * The following line is included to satisfy compilers which
- * produce warnings when a function does not end with a return.
- */
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _Event_MP_Send_response_packet
- *
- */
-
-void _Event_MP_Send_response_packet (
- Event_MP_Remote_operations operation,
- Thread_Control *the_thread
-)
-{
- Event_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case EVENT_MP_SEND_RESPONSE:
-
- the_packet = ( Event_MP_Packet *) the_thread->receive_packet;
-
-/*
- * The packet being returned already contains the class, length, and
- * to_convert fields, therefore they are not set in this routine.
- */
- the_packet->operation = operation;
- the_packet->Prefix.id = the_packet->Prefix.source_tid;
-
- _MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
- &the_packet->Prefix
- );
- break;
-
- case EVENT_MP_SEND_REQUEST:
- break;
-
- }
-}
-
-/*PAGE
- *
- *
- * _Event_MP_Process_packet
- *
- */
-
-void _Event_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-)
-{
- Event_MP_Packet *the_packet;
- Thread_Control *the_thread;
-
- the_packet = (Event_MP_Packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case EVENT_MP_SEND_REQUEST:
-
- the_packet->Prefix.return_code = rtems_event_send(
- the_packet->Prefix.id,
- the_packet->event_in
- );
-
- _Event_MP_Send_response_packet(
- EVENT_MP_SEND_RESPONSE,
- _Thread_Executing
- );
- break;
-
- case EVENT_MP_SEND_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- _MPCI_Return_packet( the_packet_prefix );
-
- break;
-
- }
-}
-
-/*PAGE
- *
- * _Event_MP_Send_object_was_deleted
- *
- * This subprogram is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*PAGE
- *
- * _Event_MP_Send_extract_proxy
- *
- * This subprogram is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*PAGE
- *
- * _Event_MP_Get_packet
- *
- */
-
-Event_MP_Packet *_Event_MP_Get_packet ( void )
-{
- return ( (Event_MP_Packet *) _MPCI_Get_packet() );
-}
-
-/* end of file */
diff --git a/c/src/exec/rtems/src/intr.c b/c/src/exec/rtems/src/intr.c
deleted file mode 100644
index 45dce11bdd..0000000000
--- a/c/src/exec/rtems/src/intr.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Interrupt Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/isr.h>
-#include <rtems/rtems/intr.h>
-
-/* _Interrupt_Manager_initialization
- *
- * This routine initializes the interrupt manager.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _Interrupt_Manager_initialization( void )
-{
-}
-
-/* rtems_interrupt_catch
- *
- * This directive allows a thread to specify what action to take when
- * catching signals.
- *
- * Input parameters:
- * new_isr_handler - address of interrupt service routine (isr)
- * vector - interrupt vector number
- * old_isr_handler - address at which to store previous ISR address
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - always succeeds
- * *old_isr_handler - previous ISR address
- */
-
-rtems_status_code rtems_interrupt_catch(
- rtems_isr_entry new_isr_handler,
- rtems_vector_number vector,
- rtems_isr_entry *old_isr_handler
-)
-{
- if ( !_ISR_Is_vector_number_valid( vector ) )
- return RTEMS_INVALID_NUMBER;
-
- if ( !_ISR_Is_valid_user_handler( (void *) new_isr_handler ) )
- return RTEMS_INVALID_ADDRESS;
-
- if ( !_ISR_Is_valid_user_handler( (void *) old_isr_handler ) )
- return RTEMS_INVALID_ADDRESS;
-
- _ISR_Install_vector(
- vector, (proc_ptr)new_isr_handler, (proc_ptr *)old_isr_handler );
-
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/exec/rtems/src/intrbody.c b/c/src/exec/rtems/src/intrbody.c
deleted file mode 100644
index d72e21281d..0000000000
--- a/c/src/exec/rtems/src/intrbody.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Bodies for Inlined Interrupt Manager Routines
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/isr.h>
-#include <rtems/rtems/intr.h>
-
-/*
- * Real body for rtems_interrupt_disable
- */
-
-#undef rtems_interrupt_disable
-
-rtems_interrupt_level rtems_interrupt_disable( void )
-{
- rtems_interrupt_level previous_level;
-
- _ISR_Disable( previous_level );
-
- return previous_level;
-}
-
-/*
- * Real body for rtems_interrupt_enable
- */
-
-#undef rtems_interrupt_enable
-
-void rtems_interrupt_enable(
- rtems_interrupt_level previous_level
-)
-{
- _ISR_Enable( previous_level );
-}
-
-/*
- * Real body for rtems_interrupt_flash
- */
-
-#undef rtems_interrupt_flash
-
-void rtems_interrupt_flash(
- rtems_interrupt_level previous_level
-)
-{
- _ISR_Flash( previous_level );
-}
-
-/*
- * Real body for rtems_interrupt_is_in_progress
- */
-
-#undef rtems_interrupt_is_in_progress
-
-boolean rtems_interrupt_is_in_progress( void )
-{
- return _ISR_Is_in_progress();
-}
diff --git a/c/src/exec/rtems/src/mp.c b/c/src/exec/rtems/src/mp.c
deleted file mode 100644
index 7d9f93c51c..0000000000
--- a/c/src/exec/rtems/src/mp.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Multiprocessing Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/mp.h>
-#include <rtems/score/mpci.h>
-
-/*PAGE
- *
- * _Multiprocessing_Manager_initialization
- *
- */
-
-void _Multiprocessing_Manager_initialization ( void )
-{
-}
-
-/*PAGE
- *
- * rtems_multiprocessing_announce
- *
- */
-
-void rtems_multiprocessing_announce ( void )
-{
- _MPCI_Announce();
-}
-
-/* end of file */
diff --git a/c/src/exec/rtems/src/msg.c b/c/src/exec/rtems/src/msg.c
deleted file mode 100644
index f49e1cac21..0000000000
--- a/c/src/exec/rtems/src/msg.c
+++ /dev/null
@@ -1,764 +0,0 @@
-/*
- * Message Queue Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/coremsg.h>
-#include <rtems/score/object.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/mpci.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/rtems/message.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _Message_queue_Manager_initialization
- *
- * This routine initializes all message queue manager related
- * data structures.
- *
- * Input parameters:
- * maximum_message_queues - number of message queues to initialize
- *
- * Output parameters: NONE
- */
-
-void _Message_queue_Manager_initialization(
- unsigned32 maximum_message_queues
-)
-{
- _Objects_Initialize_information(
- &_Message_queue_Information,
- OBJECTS_RTEMS_MESSAGE_QUEUES,
- TRUE,
- maximum_message_queues,
- sizeof( Message_queue_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor(
- MP_PACKET_MESSAGE_QUEUE,
- _Message_queue_MP_Process_packet
- );
-
-}
-
-/*PAGE
- *
- * _Message_queue_Allocate
- *
- * Allocate a message queue and the space for its messages
- *
- * Input parameters:
- * the_message_queue - the message queue to allocate message buffers
- * count - maximum message and reserved buffer count
- * max_message_size - maximum size of each message
- *
- * Output parameters:
- * the_message_queue - set if successful, NULL otherwise
- */
-
-Message_queue_Control *_Message_queue_Allocate (
- unsigned32 count,
- unsigned32 max_message_size
-)
-{
- return
- (Message_queue_Control *)_Objects_Allocate(&_Message_queue_Information);
-
-}
-
-/*PAGE
- *
- * rtems_message_queue_create
- *
- * This directive creates a message queue by allocating and initializing
- * a message queue data structure.
- *
- * Input parameters:
- * name - user defined queue name
- * count - maximum message and reserved buffer count
- * max_message_size - maximum size of each message
- * attribute_set - process method
- * id - pointer to queue
- *
- * Output parameters:
- * id - queue id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_create(
- rtems_name name,
- unsigned32 count,
- unsigned32 max_message_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-)
-{
- register Message_queue_Control *the_message_queue;
- CORE_message_queue_Attributes the_message_queue_attributes;
- boolean is_global;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- if ( (is_global = _Attributes_Is_global( attribute_set ) ) &&
- !_System_state_Is_multiprocessing )
- return RTEMS_MP_NOT_CONFIGURED;
-
- if (count == 0)
- return RTEMS_INVALID_NUMBER;
-
- if (max_message_size == 0)
- return RTEMS_INVALID_SIZE;
-
-#if 1
- /*
- * I am not 100% sure this should be an error.
- * It seems reasonable to create a que with a large max size,
- * and then just send smaller msgs from remote (or all) nodes.
- */
-
- if ( is_global && (_MPCI_table->maximum_packet_size < max_message_size) )
- return RTEMS_INVALID_SIZE;
-
-#endif
-
- _Thread_Disable_dispatch(); /* protects object pointer */
-
- the_message_queue = _Message_queue_Allocate( count, max_message_size );
-
- if ( !the_message_queue ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- if ( is_global &&
- !( _Objects_MP_Allocate_and_open( &_Message_queue_Information,
- name, the_message_queue->Object.id, FALSE ) ) ) {
- _Message_queue_Free( the_message_queue );
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- the_message_queue->attribute_set = attribute_set;
-
- if (_Attributes_Is_priority( attribute_set ) )
- the_message_queue_attributes.discipline =
- CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY;
- else
- the_message_queue_attributes.discipline =
- CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO;
-
- if ( ! _CORE_message_queue_Initialize(
- &the_message_queue->message_queue,
- OBJECTS_RTEMS_MESSAGE_QUEUES,
- &the_message_queue_attributes,
- count,
- max_message_size,
- _Message_queue_MP_Send_extract_proxy ) ) {
- if ( is_global )
- _Objects_MP_Close(
- &_Message_queue_Information, the_message_queue->Object.id);
-
- _Message_queue_Free( the_message_queue );
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- _Objects_Open(
- &_Message_queue_Information,
- &the_message_queue->Object,
- &name
- );
-
- *id = the_message_queue->Object.id;
-
- if ( is_global )
- _Message_queue_MP_Send_process_packet(
- MESSAGE_QUEUE_MP_ANNOUNCE_CREATE,
- the_message_queue->Object.id,
- name,
- 0
- );
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_message_queue_ident
- *
- * This directive returns the system ID associated with
- * the message queue name.
- *
- * Input parameters:
- * name - user defined message queue name
- * node - node(s) to be searched
- * id - pointer to message queue id
- *
- * Output parameters:
- * *id - message queue id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id(
- &_Message_queue_Information,
- &name,
- node,
- id
- );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_message_queue_delete
- *
- * This directive allows a thread to delete the message queue specified
- * by the given queue identifier.
- *
- * Input parameters:
- * id - queue id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_delete(
- Objects_Id id
-)
-{
- register Message_queue_Control *the_message_queue;
- Objects_Locations location;
-
- the_message_queue = _Message_queue_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
- case OBJECTS_LOCAL:
- _Objects_Close( &_Message_queue_Information,
- &the_message_queue->Object );
-
- _CORE_message_queue_Close(
- &the_message_queue->message_queue,
- _Message_queue_MP_Send_object_was_deleted,
- CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED
- );
-
- _Message_queue_Free( the_message_queue );
-
- if ( _Attributes_Is_global( the_message_queue->attribute_set ) ) {
- _Objects_MP_Close(
- &_Message_queue_Information,
- the_message_queue->Object.id
- );
-
- _Message_queue_MP_Send_process_packet(
- MESSAGE_QUEUE_MP_ANNOUNCE_DELETE,
- the_message_queue->Object.id,
- 0, /* Not used */
- 0
- );
- }
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_message_queue_send
- *
- * This routine implements the directives q_send. It sends a
- * message to the specified message queue.
- *
- * Input parameters:
- * id - pointer to message queue
- * buffer - pointer to message buffer
- * size - size of message to sent urgently
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_send(
- Objects_Id id,
- void *buffer,
- unsigned32 size
-)
-{
- return( _Message_queue_Submit(id, buffer, size, MESSAGE_QUEUE_SEND_REQUEST) );
-}
-
-/*PAGE
- *
- * rtems_message_queue_urgent
- *
- * This routine implements the directives q_urgent. It urgents a
- * message to the specified message queue.
- *
- * Input parameters:
- * id - pointer to message queue
- * buffer - pointer to message buffer
- * size - size of message to sent urgently
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_urgent(
- Objects_Id id,
- void *buffer,
- unsigned32 size
-)
-{
- return(_Message_queue_Submit(id, buffer, size, MESSAGE_QUEUE_URGENT_REQUEST));
-}
-
-/*PAGE
- *
- * rtems_message_queue_broadcast
- *
- * This directive sends a message for every thread waiting on the queue
- * designated by id.
- *
- * Input parameters:
- * id - pointer to message queue
- * buffer - pointer to message buffer
- * size - size of message to broadcast
- * count - pointer to area to store number of threads made ready
- *
- * Output parameters:
- * count - number of threads made ready
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_broadcast(
- Objects_Id id,
- void *buffer,
- unsigned32 size,
- unsigned32 *count
-)
-{
- register Message_queue_Control *the_message_queue;
- Objects_Locations location;
- CORE_message_queue_Status core_status;
-
- the_message_queue = _Message_queue_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Executing->Wait.return_argument = count;
-
- return
- _Message_queue_MP_Send_request_packet(
- MESSAGE_QUEUE_MP_BROADCAST_REQUEST,
- id,
- buffer,
- &size,
- 0, /* option_set not used */
- MPCI_DEFAULT_TIMEOUT
- );
-
- case OBJECTS_LOCAL:
- core_status = _CORE_message_queue_Broadcast(
- &the_message_queue->message_queue,
- buffer,
- size,
- id,
- _Message_queue_Core_message_queue_mp_support,
- count
- );
-
- _Thread_Enable_dispatch();
- return
- _Message_queue_Translate_core_message_queue_return_code( core_status );
-
- }
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_message_queue_receive
- *
- * This directive dequeues a message from the designated message queue
- * and copies it into the requesting thread's buffer.
- *
- * Input parameters:
- * id - queue id
- * buffer - pointer to message buffer
- * size - size of message receive
- * option_set - options on receive
- * timeout - number of ticks to wait
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_receive(
- Objects_Id id,
- void *buffer,
- unsigned32 *size,
- unsigned32 option_set,
- rtems_interval timeout
-)
-{
- register Message_queue_Control *the_message_queue;
- Objects_Locations location;
- boolean wait;
-
- the_message_queue = _Message_queue_Get( id, &location );
- switch ( location ) {
-
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
-
- case OBJECTS_REMOTE:
- return _Message_queue_MP_Send_request_packet(
- MESSAGE_QUEUE_MP_RECEIVE_REQUEST,
- id,
- buffer,
- size,
- option_set,
- timeout
- );
-
- case OBJECTS_LOCAL:
- if ( _Options_Is_no_wait( option_set ) )
- wait = FALSE;
- else
- wait = TRUE;
-
- _CORE_message_queue_Seize(
- &the_message_queue->message_queue,
- the_message_queue->Object.id,
- buffer,
- size,
- wait,
- timeout
- );
- _Thread_Enable_dispatch();
- return( _Message_queue_Translate_core_message_queue_return_code(
- _Thread_Executing->Wait.return_code ) );
-
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_message_queue_flush
- *
- * This directive removes all pending messages from a queue and returns
- * the number of messages removed. If no messages were present then
- * a count of zero is returned.
- *
- * Input parameters:
- * id - queue id
- * count - return area for count
- *
- * Output parameters:
- * count - number of messages removed ( 0 = empty queue )
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_flush(
- Objects_Id id,
- unsigned32 *count
-)
-{
- register Message_queue_Control *the_message_queue;
- Objects_Locations location;
-
- the_message_queue = _Message_queue_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Executing->Wait.return_argument = count;
-
- return
- _Message_queue_MP_Send_request_packet(
- MESSAGE_QUEUE_MP_FLUSH_REQUEST,
- id,
- 0, /* buffer not used */
- 0, /* size */
- 0, /* option_set not used */
- MPCI_DEFAULT_TIMEOUT
- );
-
- case OBJECTS_LOCAL:
- *count = _CORE_message_queue_Flush( &the_message_queue->message_queue );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_message_queue_get_number_pending
- *
- * This directive returns the number of messages pending.
- *
- * Input parameters:
- * id - queue id
- * count - return area for count
- *
- * Output parameters:
- * count - number of messages removed ( 0 = empty queue )
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_get_number_pending(
- Objects_Id id,
- unsigned32 *count
-)
-{
- register Message_queue_Control *the_message_queue;
- Objects_Locations location;
-
- the_message_queue = _Message_queue_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Executing->Wait.return_argument = count;
-
- return
- _Message_queue_MP_Send_request_packet(
- MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST,
- id,
- 0, /* buffer not used */
- 0, /* size */
- 0, /* option_set not used */
- MPCI_DEFAULT_TIMEOUT
- );
-
- case OBJECTS_LOCAL:
- *count = the_message_queue->message_queue.number_of_pending_messages;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * _Message_queue_Submit
- *
- * This routine implements the directives rtems_message_queue_send
- * and rtems_message_queue_urgent. It processes a message that is
- * to be submitted to the designated message queue. The message will
- * either be processed as a send send message which it will be inserted
- * at the rear of the queue or it will be processed as an urgent message
- * which will be inserted at the front of the queue.
- *
- * Input parameters:
- * id - pointer to message queue
- * buffer - pointer to message buffer
- * size - size in bytes of message to send
- * submit_type - send or urgent message
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code _Message_queue_Submit(
- Objects_Id id,
- void *buffer,
- unsigned32 size,
- Message_queue_Submit_types submit_type
-)
-{
- register Message_queue_Control *the_message_queue;
- Objects_Locations location;
- CORE_message_queue_Status core_status;
-
- the_message_queue = _Message_queue_Get( id, &location );
- switch ( location )
- {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
-
- case OBJECTS_REMOTE:
- switch ( submit_type ) {
- case MESSAGE_QUEUE_SEND_REQUEST:
- return
- _Message_queue_MP_Send_request_packet(
- MESSAGE_QUEUE_MP_SEND_REQUEST,
- id,
- buffer,
- &size,
- 0, /* option_set */
- MPCI_DEFAULT_TIMEOUT
- );
-
- case MESSAGE_QUEUE_URGENT_REQUEST:
- return
- _Message_queue_MP_Send_request_packet(
- MESSAGE_QUEUE_MP_URGENT_REQUEST,
- id,
- buffer,
- &size,
- 0, /* option_set */
- MPCI_DEFAULT_TIMEOUT
- );
- }
-
- case OBJECTS_LOCAL:
- switch ( submit_type ) {
- case MESSAGE_QUEUE_SEND_REQUEST:
- core_status = _CORE_message_queue_Send(
- &the_message_queue->message_queue,
- buffer,
- size,
- id,
- _Message_queue_Core_message_queue_mp_support
- );
- break;
- case MESSAGE_QUEUE_URGENT_REQUEST:
- core_status = _CORE_message_queue_Urgent(
- &the_message_queue->message_queue,
- buffer,
- size,
- id,
- _Message_queue_Core_message_queue_mp_support
- );
- break;
- default:
- core_status = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
- return RTEMS_INTERNAL_ERROR; /* should never get here */
- }
-
- _Thread_Enable_dispatch();
- return _Message_queue_Translate_core_message_queue_return_code(
- core_status );
-
- }
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * _Message_queue_Translate_core_message_queue_return_code
- *
- * Input parameters:
- * the_message_queue_status - message_queue status code to translate
- *
- * Output parameters:
- * rtems status code - translated RTEMS status code
- *
- */
-
-rtems_status_code _Message_queue_Translate_core_message_queue_return_code (
- unsigned32 the_message_queue_status
-)
-{
- switch ( the_message_queue_status ) {
- case CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL:
- return RTEMS_SUCCESSFUL;
- case CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE:
- return RTEMS_INVALID_SIZE;
- case CORE_MESSAGE_QUEUE_STATUS_TOO_MANY:
- return RTEMS_TOO_MANY;
- case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED:
- return RTEMS_UNSATISFIED;
- case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT:
- return RTEMS_UNSATISFIED;
- case CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED:
- return RTEMS_OBJECT_WAS_DELETED;
- case CORE_MESSAGE_QUEUE_STATUS_TIMEOUT:
- return RTEMS_TIMEOUT;
- case THREAD_STATUS_PROXY_BLOCKING:
- return RTEMS_PROXY_BLOCKING;
- }
- _Internal_error_Occurred( /* XXX */
- INTERNAL_ERROR_RTEMS_API,
- TRUE,
- the_message_queue_status
- );
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * _Message_queue_Core_message_queue_mp_support
- *
- * Input parameters:
- * the_thread - the remote thread the message was submitted to
- * id - id of the message queue
- *
- * Output parameters: NONE
- */
-
-void _Message_queue_Core_message_queue_mp_support (
- Thread_Control *the_thread,
- Objects_Id id
-)
-{
- the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
-
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_RECEIVE_RESPONSE,
- id,
- the_thread
- );
-}
diff --git a/c/src/exec/rtems/src/msgmp.c b/c/src/exec/rtems/src/msgmp.c
deleted file mode 100644
index 707aa94b44..0000000000
--- a/c/src/exec/rtems/src/msgmp.c
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * Multiprocessing Support for the Message Queue Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/message.h>
-#include <rtems/score/mpci.h>
-#include <rtems/rtems/msgmp.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _Message_queue_MP_Send_process_packet
- *
- */
-
-void _Message_queue_MP_Send_process_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- rtems_name name,
- Objects_Id proxy_id
-)
-{
- Message_queue_MP_Packet *the_packet;
- unsigned32 node;
-
- switch ( operation ) {
-
- case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE:
- case MESSAGE_QUEUE_MP_ANNOUNCE_DELETE:
- case MESSAGE_QUEUE_MP_EXTRACT_PROXY:
-
- the_packet = _Message_queue_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_MESSAGE_QUEUE;
- the_packet->Prefix.length = sizeof ( Message_queue_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Message_queue_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = message_queue_id;
- the_packet->name = name;
- the_packet->proxy_id = proxy_id;
-
- if ( operation == MESSAGE_QUEUE_MP_EXTRACT_PROXY )
- node = rtems_get_node( message_queue_id );
- else
- node = MPCI_ALL_NODES;
-
- _MPCI_Send_process_packet( node, &the_packet->Prefix );
- break;
-
- case MESSAGE_QUEUE_MP_RECEIVE_REQUEST:
- case MESSAGE_QUEUE_MP_RECEIVE_RESPONSE:
- case MESSAGE_QUEUE_MP_SEND_REQUEST:
- case MESSAGE_QUEUE_MP_SEND_RESPONSE:
- case MESSAGE_QUEUE_MP_URGENT_REQUEST:
- case MESSAGE_QUEUE_MP_URGENT_RESPONSE:
- case MESSAGE_QUEUE_MP_BROADCAST_REQUEST:
- case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE:
- case MESSAGE_QUEUE_MP_FLUSH_REQUEST:
- case MESSAGE_QUEUE_MP_FLUSH_RESPONSE:
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST:
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE:
- break;
-
- }
-}
-
-/*PAGE
- *
- * _Message_queue_MP_Send_request_packet
- *
- */
-
-rtems_status_code _Message_queue_MP_Send_request_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- void *buffer,
- unsigned32 *size_p,
- rtems_option option_set,
- rtems_interval timeout
-)
-{
- Message_queue_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case MESSAGE_QUEUE_MP_SEND_REQUEST:
- case MESSAGE_QUEUE_MP_URGENT_REQUEST:
- case MESSAGE_QUEUE_MP_BROADCAST_REQUEST:
- case MESSAGE_QUEUE_MP_FLUSH_REQUEST:
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST:
-
- the_packet = _Message_queue_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_MESSAGE_QUEUE;
- the_packet->Prefix.length = sizeof(Message_queue_MP_Packet);
- if ( size_p )
- the_packet->Prefix.length += *size_p;
- the_packet->Prefix.to_convert = sizeof(Message_queue_MP_Packet);
-
- /*
- * make sure message is not too big for our MPCI driver
- * We have to check it here instead of waiting for MPCI because
- * we are about to slam in the payload
- */
-
- if (the_packet->Prefix.length > _MPCI_table->maximum_packet_size) {
- _Thread_Enable_dispatch();
- return RTEMS_INVALID_SIZE;
- }
-
- if (! _Options_Is_no_wait(option_set))
- the_packet->Prefix.timeout = timeout;
-
- the_packet->operation = operation;
- the_packet->Prefix.id = message_queue_id;
- the_packet->option_set = option_set;
-
- /*
- * Copy the data into place if needed
- */
-
- if (buffer) {
- the_packet->Buffer.size = *size_p;
- _CORE_message_queue_Copy_buffer(
- buffer,
- the_packet->Buffer.buffer,
- *size_p
- );
- }
-
- return (rtems_status_code) _MPCI_Send_request_packet(
- rtems_get_node(message_queue_id),
- &the_packet->Prefix,
- STATES_WAITING_FOR_MESSAGE
- );
- break;
-
- case MESSAGE_QUEUE_MP_RECEIVE_REQUEST:
-
- the_packet = _Message_queue_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_MESSAGE_QUEUE;
- the_packet->Prefix.length = sizeof(Message_queue_MP_Packet);
- the_packet->Prefix.to_convert = sizeof(Message_queue_MP_Packet);
-
- if (! _Options_Is_no_wait(option_set))
- the_packet->Prefix.timeout = timeout;
-
- the_packet->operation = MESSAGE_QUEUE_MP_RECEIVE_REQUEST;
- the_packet->Prefix.id = message_queue_id;
- the_packet->option_set = option_set;
- the_packet->size = 0; /* just in case of an error */
-
- _Thread_Executing->Wait.return_argument = (unsigned32 *)buffer;
- _Thread_Executing->Wait.return_argument_1 = size_p;
-
- return (rtems_status_code) _MPCI_Send_request_packet(
- rtems_get_node(message_queue_id),
- &the_packet->Prefix,
- STATES_WAITING_FOR_MESSAGE
- );
- break;
-
- case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE:
- case MESSAGE_QUEUE_MP_ANNOUNCE_DELETE:
- case MESSAGE_QUEUE_MP_EXTRACT_PROXY:
- case MESSAGE_QUEUE_MP_RECEIVE_RESPONSE:
- case MESSAGE_QUEUE_MP_SEND_RESPONSE:
- case MESSAGE_QUEUE_MP_URGENT_RESPONSE:
- case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE:
- case MESSAGE_QUEUE_MP_FLUSH_RESPONSE:
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE:
- break;
- }
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _Message_queue_MP_Send_response_packet
- *
- */
-
-void _Message_queue_MP_Send_response_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- Thread_Control *the_thread
-)
-{
- Message_queue_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case MESSAGE_QUEUE_MP_RECEIVE_RESPONSE:
- case MESSAGE_QUEUE_MP_SEND_RESPONSE:
- case MESSAGE_QUEUE_MP_URGENT_RESPONSE:
- case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE:
- case MESSAGE_QUEUE_MP_FLUSH_RESPONSE:
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE:
-
- the_packet = ( Message_queue_MP_Packet *) the_thread->receive_packet;
-
-/*
- * The packet being returned already contains the class, length, and
- * to_convert fields, therefore they are not set in this routine.
- *
- * Exception: MESSAGE_QUEUE_MP_RECEIVE_RESPONSE needs payload length
- * added to 'length'
- */
- the_packet->operation = operation;
- the_packet->Prefix.id = the_packet->Prefix.source_tid;
-
- if (operation == MESSAGE_QUEUE_MP_RECEIVE_RESPONSE)
- the_packet->Prefix.length += the_packet->size;
-
- _MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
- &the_packet->Prefix
- );
- break;
-
- case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE:
- case MESSAGE_QUEUE_MP_ANNOUNCE_DELETE:
- case MESSAGE_QUEUE_MP_EXTRACT_PROXY:
- case MESSAGE_QUEUE_MP_RECEIVE_REQUEST:
- case MESSAGE_QUEUE_MP_SEND_REQUEST:
- case MESSAGE_QUEUE_MP_URGENT_REQUEST:
- case MESSAGE_QUEUE_MP_BROADCAST_REQUEST:
- case MESSAGE_QUEUE_MP_FLUSH_REQUEST:
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST:
- break;
-
- }
-}
-
-/*PAGE
- *
- *
- * _Message_queue_MP_Process_packet
- *
- */
-
-void _Message_queue_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-)
-{
- Message_queue_MP_Packet *the_packet;
- Thread_Control *the_thread;
- boolean ignored;
-
- the_packet = (Message_queue_MP_Packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE:
-
- ignored = _Objects_MP_Allocate_and_open(
- &_Message_queue_Information,
- the_packet->name,
- the_packet->Prefix.id,
- TRUE
- );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case MESSAGE_QUEUE_MP_ANNOUNCE_DELETE:
-
- _Objects_MP_Close( &_Message_queue_Information, the_packet->Prefix.id );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case MESSAGE_QUEUE_MP_EXTRACT_PROXY:
-
- the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
-
- if (! _Thread_Is_null( the_thread ) )
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case MESSAGE_QUEUE_MP_RECEIVE_REQUEST:
-
- the_packet->Prefix.return_code = rtems_message_queue_receive(
- the_packet->Prefix.id,
- the_packet->Buffer.buffer,
- &the_packet->size,
- the_packet->option_set,
- the_packet->Prefix.timeout
- );
-
- if (! _Thread_Is_proxy_blocking( the_packet->Prefix.return_code ) )
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_RECEIVE_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case MESSAGE_QUEUE_MP_RECEIVE_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- if (the_packet->Prefix.return_code == RTEMS_SUCCESSFUL) {
- *(rtems_unsigned32 *)the_thread->Wait.return_argument_1 =
- the_packet->size;
-
- _CORE_message_queue_Copy_buffer(
- the_packet->Buffer.buffer,
- the_thread->Wait.return_argument,
- the_packet->size
- );
- }
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case MESSAGE_QUEUE_MP_SEND_REQUEST:
-
- the_packet->Prefix.return_code = rtems_message_queue_send(
- the_packet->Prefix.id,
- the_packet->Buffer.buffer,
- the_packet->Buffer.size
- );
-
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_SEND_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case MESSAGE_QUEUE_MP_SEND_RESPONSE:
- case MESSAGE_QUEUE_MP_URGENT_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case MESSAGE_QUEUE_MP_URGENT_REQUEST:
-
- the_packet->Prefix.return_code = rtems_message_queue_urgent(
- the_packet->Prefix.id,
- the_packet->Buffer.buffer,
- the_packet->Buffer.size
- );
-
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_URGENT_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case MESSAGE_QUEUE_MP_BROADCAST_REQUEST:
-
- the_packet->Prefix.return_code = rtems_message_queue_broadcast(
- the_packet->Prefix.id,
- the_packet->Buffer.buffer,
- the_packet->Buffer.size,
- &the_packet->count
- );
-
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_BROADCAST_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE:
- case MESSAGE_QUEUE_MP_FLUSH_RESPONSE:
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- *(unsigned32 *)the_thread->Wait.return_argument = the_packet->count;
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case MESSAGE_QUEUE_MP_FLUSH_REQUEST:
-
- the_packet->Prefix.return_code = rtems_message_queue_flush(
- the_packet->Prefix.id,
- &the_packet->count
- );
-
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_FLUSH_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST:
-
- the_packet->Prefix.return_code = rtems_message_queue_get_number_pending(
- the_packet->Prefix.id,
- &the_packet->count
- );
-
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- }
-}
-
-/*PAGE
- *
- * _Message_queue_MP_Send_object_was_deleted
- *
- */
-
-void _Message_queue_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-)
-{
- the_proxy->receive_packet->return_code = RTEMS_OBJECT_WAS_DELETED;
-
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_RECEIVE_RESPONSE,
- the_proxy->Wait.id,
- the_proxy
- );
-}
-
-/*PAGE
- *
- * _Message_queue_MP_Send_extract_proxy
- *
- */
-
-void _Message_queue_MP_Send_extract_proxy (
- Thread_Control *the_thread
-)
-{
- _Message_queue_MP_Send_process_packet(
- MESSAGE_QUEUE_MP_EXTRACT_PROXY,
- the_thread->Wait.id,
- (rtems_name) 0,
- the_thread->Object.id
- );
-}
-
-/*PAGE
- *
- * _Message_queue_MP_Get_packet
- *
- */
-
-Message_queue_MP_Packet *_Message_queue_MP_Get_packet ( void )
-{
- return ( (Message_queue_MP_Packet *) _MPCI_Get_packet() );
-}
-
-/* end of file */
diff --git a/c/src/exec/rtems/src/part.c b/c/src/exec/rtems/src/part.c
deleted file mode 100644
index 0698f0db71..0000000000
--- a/c/src/exec/rtems/src/part.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Partition Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/address.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/part.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/sysstate.h>
-
-/*PAGE
- *
- * _Partition_Manager_initialization
- *
- * This routine initializes all partition manager related
- * data structures.
- *
- * Input parameters:
- * maximum_partitions - number of partitions to initialize
- *
- * Output parameters: NONE
- */
-
-void _Partition_Manager_initialization(
- unsigned32 maximum_partitions
-)
-{
- _Objects_Initialize_information(
- &_Partition_Information,
- OBJECTS_RTEMS_PARTITIONS,
- TRUE,
- maximum_partitions,
- sizeof( Partition_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor(
- MP_PACKET_PARTITION,
- _Partition_MP_Process_packet
- );
-
-}
-
-/*PAGE
- *
- * rtems_partition_create
- *
- * This directive creates a partiton of fixed sized buffers from the
- * given contiguous memory area.
- *
- * Input parameters:
- * name - user defined partition name
- * starting_address - physical start address of partition
- * length - physical length in bytes
- * buffer_size - size of buffers in bytes
- * attribute_set - partition attributes
- * id - pointer to partition id
- *
- * Output parameters:
- * id - partition id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_partition_create(
- rtems_name name,
- void *starting_address,
- unsigned32 length,
- unsigned32 buffer_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-)
-{
- register Partition_Control *the_partition;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- if ( length == 0 || buffer_size == 0 || length < buffer_size ||
- !_Partition_Is_buffer_size_aligned( buffer_size ) )
- return RTEMS_INVALID_SIZE;
-
- if ( !_Addresses_Is_aligned( starting_address ) )
- return RTEMS_INVALID_ADDRESS;
-
- if ( _Attributes_Is_global( attribute_set ) &&
- !_System_state_Is_multiprocessing )
- return RTEMS_MP_NOT_CONFIGURED;
-
- _Thread_Disable_dispatch(); /* prevents deletion */
-
- the_partition = _Partition_Allocate();
-
- if ( !the_partition ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- if ( _Attributes_Is_global( attribute_set ) &&
- !( _Objects_MP_Allocate_and_open( &_Partition_Information, name,
- the_partition->Object.id, FALSE ) ) ) {
- _Partition_Free( the_partition );
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
- the_partition->starting_address = starting_address;
- the_partition->length = length;
- the_partition->buffer_size = buffer_size;
- the_partition->attribute_set = attribute_set;
- the_partition->number_of_used_blocks = 0;
-
- _Chain_Initialize( &the_partition->Memory, starting_address,
- length / buffer_size, buffer_size );
-
- _Objects_Open( &_Partition_Information, &the_partition->Object, &name );
-
- *id = the_partition->Object.id;
- if ( _Attributes_Is_global( attribute_set ) )
- _Partition_MP_Send_process_packet(
- PARTITION_MP_ANNOUNCE_CREATE,
- the_partition->Object.id,
- name,
- 0 /* Not used */
- );
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_partition_ident
- *
- * This directive returns the system ID associated with
- * the partition name.
- *
- * Input parameters:
- * name - user defined partition name
- * node - node(s) to be searched
- * id - pointer to partition id
- *
- * Output parameters:
- * *id - partition id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_partition_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id( &_Partition_Information, &name, node, id );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_partition_delete
- *
- * This directive allows a thread to delete a partition specified by
- * the partition identifier, provided that none of its buffers are
- * still allocated.
- *
- * Input parameters:
- * id - partition id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_partition_delete(
- Objects_Id id
-)
-{
- register Partition_Control *the_partition;
- Objects_Locations location;
-
- the_partition = _Partition_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
- case OBJECTS_LOCAL:
- if ( the_partition->number_of_used_blocks == 0 ) {
- _Objects_Close( &_Partition_Information, &the_partition->Object );
- _Partition_Free( the_partition );
- if ( _Attributes_Is_global( the_partition->attribute_set ) ) {
-
- _Objects_MP_Close(
- &_Partition_Information,
- the_partition->Object.id
- );
-
- _Partition_MP_Send_process_packet(
- PARTITION_MP_ANNOUNCE_DELETE,
- the_partition->Object.id,
- 0, /* Not used */
- 0 /* Not used */
- );
- }
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_RESOURCE_IN_USE;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_partition_get_buffer
- *
- * This directive will obtain a buffer from a buffer partition.
- *
- * Input parameters:
- * id - partition id
- * buffer - pointer to buffer address
- *
- * Output parameters:
- * buffer - pointer to buffer address filled in
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_partition_get_buffer(
- Objects_Id id,
- void **buffer
-)
-{
- register Partition_Control *the_partition;
- Objects_Locations location;
- void *the_buffer;
-
- the_partition = _Partition_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Executing->Wait.return_argument = buffer;
- return(
- _Partition_MP_Send_request_packet(
- PARTITION_MP_GET_BUFFER_REQUEST,
- id,
- 0 /* Not used */
- )
- );
- case OBJECTS_LOCAL:
- the_buffer = _Partition_Allocate_buffer( the_partition );
- if ( the_buffer ) {
- the_partition->number_of_used_blocks += 1;
- _Thread_Enable_dispatch();
- *buffer = the_buffer;
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_UNSATISFIED;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_partition_return_buffer
- *
- * This directive will return the given buffer to the specified
- * buffer partition.
- *
- * Input parameters:
- * id - partition id
- * buffer - pointer to buffer address
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_partition_return_buffer(
- Objects_Id id,
- void *buffer
-)
-{
- register Partition_Control *the_partition;
- Objects_Locations location;
-
- the_partition = _Partition_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return(
- _Partition_MP_Send_request_packet(
- PARTITION_MP_RETURN_BUFFER_REQUEST,
- id,
- buffer
- )
- );
- case OBJECTS_LOCAL:
- if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) {
- _Partition_Free_buffer( the_partition, buffer );
- the_partition->number_of_used_blocks -= 1;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_INVALID_ADDRESS;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
diff --git a/c/src/exec/rtems/src/partmp.c b/c/src/exec/rtems/src/partmp.c
deleted file mode 100644
index 17234974ef..0000000000
--- a/c/src/exec/rtems/src/partmp.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Multiprocessing Support for the Partition Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/part.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _Partition_MP_Send_process_packet
- *
- */
-
-void _Partition_MP_Send_process_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- rtems_name name,
- Objects_Id proxy_id
-)
-{
- Partition_MP_Packet *the_packet;
- unsigned32 node;
-
- switch ( operation ) {
-
- case PARTITION_MP_ANNOUNCE_CREATE:
- case PARTITION_MP_ANNOUNCE_DELETE:
- case PARTITION_MP_EXTRACT_PROXY:
-
- the_packet = _Partition_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_PARTITION;
- the_packet->Prefix.length = sizeof ( Partition_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Partition_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = partition_id;
- the_packet->name = name;
- the_packet->proxy_id = proxy_id;
-
- if ( operation == PARTITION_MP_EXTRACT_PROXY )
- node = rtems_get_node( partition_id );
- else
- node = MPCI_ALL_NODES;
-
- _MPCI_Send_process_packet( node, &the_packet->Prefix );
- break;
-
- case PARTITION_MP_GET_BUFFER_REQUEST:
- case PARTITION_MP_GET_BUFFER_RESPONSE:
- case PARTITION_MP_RETURN_BUFFER_REQUEST:
- case PARTITION_MP_RETURN_BUFFER_RESPONSE:
- break;
- }
-}
-
-/*PAGE
- *
- * _Partition_MP_Send_request_packet
- *
- */
-
-rtems_status_code _Partition_MP_Send_request_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- void *buffer
-)
-{
- Partition_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case PARTITION_MP_GET_BUFFER_REQUEST:
- case PARTITION_MP_RETURN_BUFFER_REQUEST:
-
- the_packet = _Partition_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_PARTITION;
- the_packet->Prefix.length = sizeof ( Partition_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Partition_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = partition_id;
- the_packet->buffer = buffer;
-
- return
- _MPCI_Send_request_packet(
- rtems_get_node( partition_id ),
- &the_packet->Prefix,
- STATES_READY /* Not used */
- );
-
- break;
-
- case PARTITION_MP_ANNOUNCE_CREATE:
- case PARTITION_MP_ANNOUNCE_DELETE:
- case PARTITION_MP_EXTRACT_PROXY:
- case PARTITION_MP_GET_BUFFER_RESPONSE:
- case PARTITION_MP_RETURN_BUFFER_RESPONSE:
- break;
-
- }
- /*
- * The following line is included to satisfy compilers which
- * produce warnings when a function does not end with a return.
- */
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _Partition_MP_Send_response_packet
- *
- */
-
-void _Partition_MP_Send_response_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- Thread_Control *the_thread
-)
-{
- Partition_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case PARTITION_MP_GET_BUFFER_RESPONSE:
- case PARTITION_MP_RETURN_BUFFER_RESPONSE:
-
- the_packet = ( Partition_MP_Packet *) the_thread->receive_packet;
-
-/*
- * The packet being returned already contains the class, length, and
- * to_convert fields, therefore they are not set in this routine.
- */
- the_packet->operation = operation;
- the_packet->Prefix.id = the_packet->Prefix.source_tid;
-
- _MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
- &the_packet->Prefix
- );
- break;
-
- case PARTITION_MP_ANNOUNCE_CREATE:
- case PARTITION_MP_ANNOUNCE_DELETE:
- case PARTITION_MP_EXTRACT_PROXY:
- case PARTITION_MP_GET_BUFFER_REQUEST:
- case PARTITION_MP_RETURN_BUFFER_REQUEST:
- break;
-
- }
-}
-
-/*PAGE
- *
- *
- * _Partition_MP_Process_packet
- *
- */
-
-void _Partition_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-)
-{
- Partition_MP_Packet *the_packet;
- Thread_Control *the_thread;
- boolean ignored;
-
- the_packet = (Partition_MP_Packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case PARTITION_MP_ANNOUNCE_CREATE:
-
- ignored = _Objects_MP_Allocate_and_open(
- &_Partition_Information,
- the_packet->name,
- the_packet->Prefix.id,
- TRUE
- );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case PARTITION_MP_ANNOUNCE_DELETE:
-
- _Objects_MP_Close( &_Partition_Information, the_packet->Prefix.id );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case PARTITION_MP_EXTRACT_PROXY:
-
- the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
-
- if ( ! _Thread_Is_null( the_thread ) )
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case PARTITION_MP_GET_BUFFER_REQUEST:
-
- the_packet->Prefix.return_code = rtems_partition_get_buffer(
- the_packet->Prefix.id,
- &the_packet->buffer
- );
-
- _Partition_MP_Send_response_packet(
- PARTITION_MP_GET_BUFFER_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case PARTITION_MP_GET_BUFFER_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- *(void **)the_thread->Wait.return_argument = the_packet->buffer;
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case PARTITION_MP_RETURN_BUFFER_REQUEST:
-
- the_packet->Prefix.return_code = rtems_partition_return_buffer(
- the_packet->Prefix.id,
- the_packet->buffer
- );
-
- _Partition_MP_Send_response_packet(
- PARTITION_MP_RETURN_BUFFER_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case PARTITION_MP_RETURN_BUFFER_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- }
-}
-
-/*PAGE
- *
- * _Partition_MP_Send_object_was_deleted
- *
- * This routine is not needed by the Partition since a partition
- * cannot be deleted when buffers are in use.
- *
- */
-
-/*PAGE
- *
- * _Partition_MP_Send_extract_proxy
- *
- */
-
-void _Partition_MP_Send_extract_proxy (
- Thread_Control *the_thread
-)
-{
- _Partition_MP_Send_process_packet(
- PARTITION_MP_EXTRACT_PROXY,
- the_thread->Wait.id,
- (rtems_name) 0,
- the_thread->Object.id
- );
-
-}
-
-/*PAGE
- *
- * _Partition_MP_Get_packet
- *
- */
-
-Partition_MP_Packet *_Partition_MP_Get_packet ( void )
-{
- return ( (Partition_MP_Packet *) _MPCI_Get_packet() );
-}
-
-/* end of file */
diff --git a/c/src/exec/rtems/src/ratemon.c b/c/src/exec/rtems/src/ratemon.c
deleted file mode 100644
index ff9bb5bc21..0000000000
--- a/c/src/exec/rtems/src/ratemon.c
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- * Rate Monotonic Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/ratemon.h>
-#include <rtems/score/thread.h>
-
-/*PAGE
- *
- * _Rate_monotonic_Manager_initialization
- *
- * This routine initializes all Rate Monotonic Manager related
- * data structures.
- *
- * Input parameters:
- * maximum_periods - number of periods timers to initialize
- *
- * Output parameters: NONE
- *
- * NOTE: The Rate Monotonic Manager is built on top of the Watchdog
- * Handler.
- */
-
-void _Rate_monotonic_Manager_initialization(
- unsigned32 maximum_periods
-)
-{
- _Objects_Initialize_information(
- &_Rate_monotonic_Information,
- OBJECTS_RTEMS_PERIODS,
- FALSE,
- maximum_periods,
- sizeof( Rate_monotonic_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-}
-
-/*PAGE
- *
- * rtems_rate_monotonic_create
- *
- * This directive creates a rate monotonic timer and performs
- * some initialization.
- *
- * Input parameters:
- * name - name of period
- * id - pointer to rate monotonic id
- *
- * Output parameters:
- * id - rate monotonic id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_rate_monotonic_create(
- rtems_name name,
- Objects_Id *id
-)
-{
- Rate_monotonic_Control *the_period;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- _Thread_Disable_dispatch(); /* to prevent deletion */
-
- the_period = _Rate_monotonic_Allocate();
-
- if ( !the_period ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- the_period->owner = _Thread_Executing;
- the_period->state = RATE_MONOTONIC_INACTIVE;
-
- _Objects_Open( &_Rate_monotonic_Information, &the_period->Object, &name );
-
- *id = the_period->Object.id;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_rate_monotonic_ident
- *
- * This directive returns the system ID associated with
- * the rate monotonic period name.
- *
- * Input parameters:
- * name - user defined period name
- * id - pointer to period id
- *
- * Output parameters:
- * *id - region id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_rate_monotonic_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id(
- &_Rate_monotonic_Information,
- &name,
- OBJECTS_SEARCH_LOCAL_NODE,
- id
- );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_rate_monotonic_cancel
- *
- * This directive allows a thread to cancel a rate monotonic timer.
- *
- * Input parameters:
- * id - rate monotonic id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful and caller is not the owning thread
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_rate_monotonic_cancel(
- Objects_Id id
-)
-{
- Rate_monotonic_Control *the_period;
- Objects_Locations location;
-
- the_period = _Rate_monotonic_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return RTEMS_INTERNAL_ERROR; /* should never return this */
- case OBJECTS_LOCAL:
- if ( !_Thread_Is_executing( the_period->owner ) ) {
- _Thread_Enable_dispatch();
- return RTEMS_NOT_OWNER_OF_RESOURCE;
- }
- (void) _Watchdog_Remove( &the_period->Timer );
- the_period->state = RATE_MONOTONIC_INACTIVE;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_rate_monotonic_delete
- *
- * This directive allows a thread to delete a rate monotonic timer.
- *
- * Input parameters:
- * id - rate monotonic id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_rate_monotonic_delete(
- Objects_Id id
-)
-{
- Rate_monotonic_Control *the_period;
- Objects_Locations location;
-
- the_period = _Rate_monotonic_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- _Objects_Close( &_Rate_monotonic_Information, &the_period->Object );
- (void) _Watchdog_Remove( &the_period->Timer );
- the_period->state = RATE_MONOTONIC_INACTIVE;
- _Rate_monotonic_Free( the_period );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_rate_monotonic_get_status
- *
- * This directive allows a thread to obtain status information on a
- * period.
- *
- * Input parameters:
- * id - rate monotonic id
- * status - pointer to status control block
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- *
- */
-
-rtems_status_code rtems_rate_monotonic_get_status(
- Objects_Id id,
- rtems_rate_monotonic_period_status *status
-)
-{
- Objects_Locations location;
- Rate_monotonic_Control *the_period;
-
- if ( status == NULL )
- return RTEMS_INVALID_ADDRESS;
-
- the_period = _Rate_monotonic_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- status->state = the_period->state;
-
- if ( status->state == RATE_MONOTONIC_INACTIVE ) {
- status->ticks_since_last_period = 0;
- status->ticks_executed_since_last_period = 0;
- } else {
- status->ticks_since_last_period =
- _Watchdog_Ticks_since_boot - the_period->time_at_period;
-
- status->ticks_executed_since_last_period =
- the_period->owner->ticks_executed -
- the_period->owner_ticks_executed_at_period;
- }
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-
-/*PAGE
- *
- * rtems_rate_monotonic_period
- *
- * This directive allows a thread to manipulate a rate monotonic timer.
- *
- * Input parameters:
- * id - rate monotonic id
- * length - length of period (in ticks)
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_rate_monotonic_period(
- Objects_Id id,
- rtems_interval length
-)
-{
- Rate_monotonic_Control *the_period;
- Objects_Locations location;
- rtems_status_code return_value;
- rtems_rate_monotonic_period_states local_state;
- ISR_Level level;
-
- the_period = _Rate_monotonic_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- if ( !_Thread_Is_executing( the_period->owner ) ) {
- _Thread_Enable_dispatch();
- return RTEMS_NOT_OWNER_OF_RESOURCE;
- }
-
- if ( length == RTEMS_PERIOD_STATUS ) {
- switch ( the_period->state ) {
- case RATE_MONOTONIC_INACTIVE:
- return_value = RTEMS_NOT_DEFINED;
- break;
- case RATE_MONOTONIC_ACTIVE:
- return_value = RTEMS_SUCCESSFUL;
- break;
- case RATE_MONOTONIC_EXPIRED:
- return_value = RTEMS_TIMEOUT;
- break;
- default: /* unreached -- only to remove warnings */
- return_value = RTEMS_INTERNAL_ERROR;
- break;
- }
- _Thread_Enable_dispatch();
- return( return_value );
- }
-
- _ISR_Disable( level );
- switch ( the_period->state ) {
- case RATE_MONOTONIC_INACTIVE:
- _ISR_Enable( level );
- the_period->state = RATE_MONOTONIC_ACTIVE;
- _Watchdog_Initialize(
- &the_period->Timer,
- _Rate_monotonic_Timeout,
- id,
- NULL
- );
-
- the_period->owner_ticks_executed_at_period =
- _Thread_Executing->ticks_executed;
-
- the_period->time_at_period = _Watchdog_Ticks_since_boot;
-
- _Watchdog_Insert_ticks( &the_period->Timer, length );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-
- case RATE_MONOTONIC_ACTIVE:
- /*
- * This tells the _Rate_monotonic_Timeout that this task is
- * in the process of blocking on the period.
- */
-
- the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING;
- _ISR_Enable( level );
-
- _Thread_Executing->Wait.id = the_period->Object.id;
- _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
-
- /*
- * Did the watchdog timer expire while we were actually blocking
- * on it?
- */
-
- _ISR_Disable( level );
- local_state = the_period->state;
- the_period->state = RATE_MONOTONIC_ACTIVE;
- _ISR_Enable( level );
-
- /*
- * If it did, then we want to unblock ourself and continue as
- * if nothing happen. The period was reset in the timeout routine.
- */
-
- if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING )
- _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- break;
-
- case RATE_MONOTONIC_EXPIRED:
- _ISR_Enable( level );
- the_period->state = RATE_MONOTONIC_ACTIVE;
- the_period->owner_ticks_executed_at_period =
- _Thread_Executing->ticks_executed;
- the_period->time_at_period = _Watchdog_Ticks_since_boot;
-
- _Watchdog_Insert_ticks( &the_period->Timer, length );
- _Thread_Enable_dispatch();
- return RTEMS_TIMEOUT;
-
- case RATE_MONOTONIC_OWNER_IS_BLOCKING:
- case RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING:
- /*
- * These should never happen.
- */
- break;
- }
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Timeout
- *
- * This routine processes a period ending. If the owning thread
- * is waiting for the period, that thread is unblocked and the
- * period reinitiated. Otherwise, the period is expired.
- * This routine is called by the watchdog handler.
- *
- * Input parameters:
- * id - period id
- *
- * Output parameters: NONE
- */
-
-void _Rate_monotonic_Timeout(
- Objects_Id id,
- void *ignored
-)
-{
- Rate_monotonic_Control *the_period;
- Objects_Locations location;
- Thread_Control *the_thread;
-
- the_period = _Rate_monotonic_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* impossible */
- break;
- case OBJECTS_LOCAL:
- the_thread = the_period->owner;
- if ( _States_Is_waiting_for_period( the_thread->current_state ) &&
- the_thread->Wait.id == the_period->Object.id ) {
- _Thread_Unblock( the_thread );
- the_period->owner_ticks_executed_at_period =
- the_thread->ticks_executed;
-
- the_period->time_at_period = _Watchdog_Ticks_since_boot;
-
- _Watchdog_Reset( &the_period->Timer );
- } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) {
- the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
- the_period->owner_ticks_executed_at_period =
- the_thread->ticks_executed;
-
- the_period->time_at_period = _Watchdog_Ticks_since_boot;
- _Watchdog_Reset( &the_period->Timer );
- } else
- the_period->state = RATE_MONOTONIC_EXPIRED;
- _Thread_Unnest_dispatch();
- break;
- }
-}
-
diff --git a/c/src/exec/rtems/src/region.c b/c/src/exec/rtems/src/region.c
deleted file mode 100644
index c238bf51c5..0000000000
--- a/c/src/exec/rtems/src/region.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Region Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/region.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-
-/*PAGE
- *
- * _Region_Manager_initialization
- *
- * This routine initializes all region manager related data structures.
- *
- * Input parameters:
- * maximum_regions - number of regions to initialize
- *
- * Output parameters: NONE
- */
-
-void _Region_Manager_initialization(
- unsigned32 maximum_regions
-)
-{
- _Objects_Initialize_information(
- &_Region_Information,
- OBJECTS_RTEMS_REGIONS,
- FALSE,
- maximum_regions,
- sizeof( Region_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor(
- MP_PACKET_REGION,
- 0 /* XXX _Region_MP_Process_packet */
- );
-
-}
-
-/*PAGE
- *
- * rtems_region_create
- *
- * This directive creates a region of physical contiguous memory area
- * from which variable sized segments can be allocated.
- *
- * Input parameters:
- * name - user defined region name
- * starting_address - physical start address of region
- * length - physical length in bytes
- * page_size - page size in bytes
- * attribute_set - region attributes
- * id - address of region id to set
- *
- * Output parameters:
- * id - region id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_region_create(
- rtems_name name,
- void *starting_address,
- unsigned32 length,
- unsigned32 page_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-)
-{
- Region_Control *the_region;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- if ( !_Addresses_Is_aligned( starting_address ) )
- return RTEMS_INVALID_ADDRESS;
-
- _Thread_Disable_dispatch(); /* to prevent deletion */
-
- the_region = _Region_Allocate();
-
- if ( !the_region ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- the_region->maximum_segment_size =
- _Heap_Initialize(&the_region->Memory, starting_address, length, page_size);
-
- if ( !the_region->maximum_segment_size ) {
- _Region_Free( the_region );
- _Thread_Enable_dispatch();
- return RTEMS_INVALID_SIZE;
- }
-
- the_region->starting_address = starting_address;
- the_region->length = length;
- the_region->page_size = page_size;
- the_region->attribute_set = attribute_set;
- the_region->number_of_used_blocks = 0;
-
- _Thread_queue_Initialize(
- &the_region->Wait_queue,
- OBJECTS_RTEMS_REGIONS,
- _Attributes_Is_priority( attribute_set ) ?
- THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_SEGMENT,
- _Region_MP_Send_extract_proxy,
- RTEMS_TIMEOUT
- );
-
- _Objects_Open( &_Region_Information, &the_region->Object, &name );
-
- *id = the_region->Object.id;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_region_ident
- *
- * This directive returns the system ID associated with
- * the region name.
- *
- * Input parameters:
- * name - user defined region name
- * id - pointer to region id
- *
- * Output parameters:
- * *id - region id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_region_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id(
- &_Region_Information,
- &name,
- OBJECTS_SEARCH_LOCAL_NODE,
- id
- );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_region_delete
- *
- * This directive allows a thread to delete a region specified by
- * the region identifier, provided that none of its segments are
- * still allocated.
- *
- * Input parameters:
- * id - region id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_region_delete(
- Objects_Id id
-)
-{
- register Region_Control *the_region;
- Objects_Locations location;
-
- the_region = _Region_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- _Region_Debug_Walk( the_region, 5 );
- if ( the_region->number_of_used_blocks == 0 ) {
- _Objects_Close( &_Region_Information, &the_region->Object );
- _Region_Free( the_region );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_RESOURCE_IN_USE;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_region_extend
- *
- * This directive attempts to grow a region of physical contiguous memory area
- * from which variable sized segments can be allocated.
- *
- * Input parameters:
- * id - id of region to grow
- * start - starting address of memory area for extension
- * length - physical length in bytes to grow the region
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_region_extend(
- Objects_Id id,
- void *starting_address,
- unsigned32 length
-)
-{
- Region_Control *the_region;
- Objects_Locations location;
- unsigned32 amount_extended;
- Heap_Extend_status heap_status;
- rtems_status_code status;
-
- status = RTEMS_SUCCESSFUL;
-
- the_region = _Region_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
-
- heap_status = _Heap_Extend(
- &the_region->Memory,
- starting_address,
- length,
- &amount_extended
- );
-
- switch ( heap_status ) {
- case HEAP_EXTEND_SUCCESSFUL:
- the_region->length += amount_extended;
- the_region->maximum_segment_size += amount_extended;
- break;
- case HEAP_EXTEND_ERROR:
- status = RTEMS_INVALID_ADDRESS;
- break;
- case HEAP_EXTEND_NOT_IMPLEMENTED:
- status = RTEMS_NOT_IMPLEMENTED;
- break;
- }
- _Thread_Enable_dispatch();
- return( status );
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_region_get_segment
- *
- * This directive will obtain a segment from the given region.
- *
- * Input parameters:
- * id - region id
- * size - segment size in bytes
- * option_set - wait option
- * timeout - number of ticks to wait (0 means wait forever)
- * segment - pointer to segment address
- *
- * Output parameters:
- * segment - pointer to segment address filled in
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_region_get_segment(
- Objects_Id id,
- unsigned32 size,
- rtems_option option_set,
- rtems_interval timeout,
- void **segment
-)
-{
- register Region_Control *the_region;
- Objects_Locations location;
- Thread_Control *executing;
- void *the_segment;
-
- *segment = NULL;
-
- if ( size == 0 )
- return RTEMS_INVALID_SIZE;
-
- executing = _Thread_Executing;
- the_region = _Region_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- if ( size > the_region->maximum_segment_size ) {
- _Thread_Enable_dispatch();
- return RTEMS_INVALID_SIZE;
- }
-
- _Region_Debug_Walk( the_region, 1 );
-
- the_segment = _Region_Allocate_segment( the_region, size );
-
- _Region_Debug_Walk( the_region, 2 );
-
- if ( the_segment ) {
- the_region->number_of_used_blocks += 1;
- _Thread_Enable_dispatch();
- *segment = the_segment;
- return RTEMS_SUCCESSFUL;
- }
-
- if ( _Options_Is_no_wait( option_set ) ) {
- _Thread_Enable_dispatch();
- return RTEMS_UNSATISFIED;
- }
-
- executing->Wait.queue = &the_region->Wait_queue;
- executing->Wait.id = id;
- executing->Wait.count = size;
- executing->Wait.return_argument = (unsigned32 *) segment;
-
- _Thread_queue_Enter_critical_section( &the_region->Wait_queue );
-
- _Thread_queue_Enqueue( &the_region->Wait_queue, timeout );
-
- _Thread_Enable_dispatch();
- return (rtems_status_code) executing->Wait.return_code;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-/*PAGE
- *
- * rtems_region_get_segment_size
- *
- * This directive will return the size of the segment indicated
- *
- * Input parameters:
- * id - region id
- * segment - segment address
- * size - pointer to segment size in bytes
- *
- * Output parameters:
- * size - segment size in bytes filled in
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_region_get_segment_size(
- Objects_Id id,
- void *segment,
- unsigned32 *size
-)
-{
- register Region_Control *the_region;
- Objects_Locations location;
- Thread_Control *executing;
-
- executing = _Thread_Executing;
- the_region = _Region_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
-
- if ( _Heap_Size_of_user_area( &the_region->Memory, segment, size ) ) {
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_INVALID_ADDRESS;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_region_return_segment
- *
- * This directive will return a segment to its region.
- *
- * Input parameters:
- * id - region id
- * segment - pointer to segment address
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_region_return_segment(
- Objects_Id id,
- void *segment
-)
-{
- register Region_Control *the_region;
- Thread_Control *the_thread;
- Objects_Locations location;
- void **the_segment;
- int status;
-
- the_region = _Region_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
-
- _Region_Debug_Walk( the_region, 3 );
-
- status = _Region_Free_segment( the_region, segment );
-
- _Region_Debug_Walk( the_region, 4 );
-
- if ( !status ) {
- _Thread_Enable_dispatch();
- return RTEMS_INVALID_ADDRESS;
- }
-
- the_region->number_of_used_blocks -= 1;
- for ( ; ; ) {
- the_thread = _Thread_queue_First( &the_region->Wait_queue );
-
- if ( the_thread == NULL )
- break;
-
- the_segment = (void **) _Region_Allocate_segment(
- the_region,
- the_thread->Wait.count
- );
-
- if ( the_segment == NULL )
- break;
-
- *(void **)the_thread->Wait.return_argument = the_segment;
- the_region->number_of_used_blocks += 1;
- _Thread_queue_Extract( &the_region->Wait_queue, the_thread );
- the_thread->Wait.return_code = RTEMS_SUCCESSFUL;
- }
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
diff --git a/c/src/exec/rtems/src/regionmp.c b/c/src/exec/rtems/src/regionmp.c
deleted file mode 100644
index 0b833f8671..0000000000
--- a/c/src/exec/rtems/src/regionmp.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Multiprocessing Support for the Region Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/region.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _Region_MP_Send_process_packet
- *
- */
-
-void _Region_MP_Send_process_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- rtems_name name,
- Objects_Id proxy_id
-)
-{
- Region_MP_Packet *the_packet;
- unsigned32 node;
-
- switch ( operation ) {
-
- case REGION_MP_ANNOUNCE_CREATE:
- case REGION_MP_ANNOUNCE_DELETE:
- case REGION_MP_EXTRACT_PROXY:
-
- the_packet = _Region_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_REGION;
- the_packet->Prefix.length = sizeof ( Region_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Region_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = region_id;
- the_packet->name = name;
- the_packet->proxy_id = proxy_id;
-
- if ( operation == REGION_MP_EXTRACT_PROXY )
- node = rtems_get_node( region_id );
- else
- node = MPCI_ALL_NODES;
-
- _MPCI_Send_process_packet( node, &the_packet->Prefix );
- break;
-
- case REGION_MP_GET_SEGMENT_REQUEST:
- case REGION_MP_GET_SEGMENT_RESPONSE:
- case REGION_MP_RETURN_SEGMENT_REQUEST:
- case REGION_MP_RETURN_SEGMENT_RESPONSE:
- break;
- }
-}
-
-/*PAGE
- *
- * _Region_MP_Send_request_packet
- *
- */
-
-rtems_status_code _Region_MP_Send_request_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- void *segment,
- unsigned32 size,
- rtems_option option_set,
- rtems_interval timeout
-)
-{
- Region_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case REGION_MP_GET_SEGMENT_REQUEST:
- case REGION_MP_RETURN_SEGMENT_REQUEST:
-
- the_packet = _Region_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_REGION;
- the_packet->Prefix.length = sizeof ( Region_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Region_MP_Packet );
- if ( ! _Options_Is_no_wait(option_set))
- the_packet->Prefix.timeout = timeout;
-
- the_packet->operation = operation;
- the_packet->Prefix.id = region_id;
- the_packet->segment = segment;
- the_packet->size = size;
- the_packet->option_set = option_set;
-
- return (rtems_status_code) _MPCI_Send_request_packet(
- rtems_get_node( region_id ),
- &the_packet->Prefix,
- STATES_READY /* Not used */
- );
- break;
-
- case REGION_MP_ANNOUNCE_CREATE:
- case REGION_MP_ANNOUNCE_DELETE:
- case REGION_MP_EXTRACT_PROXY:
- case REGION_MP_GET_SEGMENT_RESPONSE:
- case REGION_MP_RETURN_SEGMENT_RESPONSE:
- break;
-
- }
- /*
- * The following line is included to satisfy compilers which
- * produce warnings when a function does not end with a return.
- */
- return RTEMS_INTERNAL_ERROR;
-}
-
-/*PAGE
- *
- * _Region_MP_Send_response_packet
- *
- */
-
-void _Region_MP_Send_response_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- Thread_Control *the_thread
-)
-{
- Region_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case REGION_MP_GET_SEGMENT_RESPONSE:
- case REGION_MP_RETURN_SEGMENT_RESPONSE:
-
- the_packet = ( Region_MP_Packet *) the_thread->receive_packet;
-
-/*
- * The packet being returned already contains the class, length, and
- * to_convert fields, therefore they are not set in this routine.
- */
- the_packet->operation = operation;
- the_packet->Prefix.id = the_packet->Prefix.source_tid;
-
- _MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
- &the_packet->Prefix
- );
- break;
-
- case REGION_MP_ANNOUNCE_CREATE:
- case REGION_MP_ANNOUNCE_DELETE:
- case REGION_MP_EXTRACT_PROXY:
- case REGION_MP_GET_SEGMENT_REQUEST:
- case REGION_MP_RETURN_SEGMENT_REQUEST:
- break;
-
- }
-}
-
-/*PAGE
- *
- *
- * _Region_MP_Process_packet
- *
- */
-
-void _Region_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-)
-{
- Region_MP_Packet *the_packet;
- Thread_Control *the_thread;
- boolean ignored;
-
- the_packet = (Region_MP_Packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case REGION_MP_ANNOUNCE_CREATE:
-
- ignored = _Objects_MP_Allocate_and_open(
- &_Region_Information,
- the_packet->name,
- the_packet->Prefix.id,
- TRUE
- );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case REGION_MP_ANNOUNCE_DELETE:
-
- _Objects_MP_Close( &_Region_Information, the_packet->Prefix.id );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case REGION_MP_EXTRACT_PROXY:
-
- the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
-
- if ( ! _Thread_Is_null( the_thread ) )
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case REGION_MP_GET_SEGMENT_REQUEST:
-
- the_packet->Prefix.return_code = rtems_region_get_segment(
- the_packet->Prefix.id,
- the_packet->size,
- the_packet->option_set,
- the_packet->Prefix.timeout,
- &the_packet->segment
- );
-
- _Region_MP_Send_response_packet(
- REGION_MP_GET_SEGMENT_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case REGION_MP_GET_SEGMENT_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- *(void **)the_thread->Wait.return_argument = the_packet->segment;
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case REGION_MP_RETURN_SEGMENT_REQUEST:
-
- the_packet->Prefix.return_code = rtems_region_return_segment(
- the_packet->Prefix.id,
- the_packet->segment
- );
-
- _Region_MP_Send_response_packet(
- REGION_MP_RETURN_SEGMENT_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case REGION_MP_RETURN_SEGMENT_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- }
-}
-
-/*PAGE
- *
- * _Region_MP_Send_object_was_deleted
- *
- * This routine is not needed by the Region since a region
- * cannot be deleted when segments are in use.
- *
- */
-
-/*PAGE
- *
- * _Region_MP_Send_extract_proxy
- *
- */
-
-void _Region_MP_Send_extract_proxy (
- Thread_Control *the_thread
-)
-{
- _Region_MP_Send_process_packet(
- REGION_MP_EXTRACT_PROXY,
- the_thread->Wait.id,
- (rtems_name) 0,
- the_thread->Object.id
- );
-}
-
-/*PAGE
- *
- * _Region_MP_Get_packet
- *
- */
-
-Region_MP_Packet *_Region_MP_Get_packet ( void )
-{
- return ( (Region_MP_Packet *) _MPCI_Get_packet() );
-}
-
-/* end of file */
diff --git a/c/src/exec/rtems/src/rtclock.c b/c/src/exec/rtems/src/rtclock.c
deleted file mode 100644
index 8a1b6b56af..0000000000
--- a/c/src/exec/rtems/src/rtclock.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Clock Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/clock.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
-
-/*PAGE
- *
- * rtems_clock_get
- *
- * This directive returns the current date and time. If the time has
- * not been set by a tm_set then an error is returned.
- *
- * Input parameters:
- * option - which value to return
- * time_buffer - pointer to output buffer (a time and date structure
- * or an interval)
- *
- * Output parameters:
- * time_buffer - output filled in
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_clock_get(
- rtems_clock_get_options option,
- void *time_buffer
-)
-{
- ISR_Level level;
- rtems_interval tmp;
-
- switch ( option ) {
- case RTEMS_CLOCK_GET_TOD:
- if ( !_TOD_Is_set )
- return RTEMS_NOT_DEFINED;
-
- *(rtems_time_of_day *)time_buffer = _TOD_Current;
- return RTEMS_SUCCESSFUL;
-
- case RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH:
- if ( !_TOD_Is_set )
- return RTEMS_NOT_DEFINED;
-
- *(rtems_interval *)time_buffer = _TOD_Seconds_since_epoch;
- return RTEMS_SUCCESSFUL;
-
- case RTEMS_CLOCK_GET_TICKS_SINCE_BOOT:
- *(rtems_interval *)time_buffer = _Watchdog_Ticks_since_boot;
- return RTEMS_SUCCESSFUL;
-
- case RTEMS_CLOCK_GET_TICKS_PER_SECOND:
- *(rtems_interval *)time_buffer = _TOD_Ticks_per_second;
- return RTEMS_SUCCESSFUL;
-
- case RTEMS_CLOCK_GET_TIME_VALUE:
- if ( !_TOD_Is_set )
- return RTEMS_NOT_DEFINED;
-
- _ISR_Disable( level );
- ((rtems_clock_time_value *)time_buffer)->seconds =
- _TOD_Seconds_since_epoch;
- tmp = _TOD_Current.ticks;
- _ISR_Enable( level );
-
- tmp *= _TOD_Microseconds_per_tick;
- ((rtems_clock_time_value *)time_buffer)->microseconds = tmp;
-
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* should never get here */
-
-}
-
-/*PAGE
- *
- * rtems_clock_set
- *
- * This directive sets the date and time for this node.
- *
- * Input parameters:
- * time_buffer - pointer to the time and date structure
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_clock_set(
- rtems_time_of_day *time_buffer
-)
-{
- rtems_interval seconds;
-
- if ( _TOD_Validate( time_buffer ) ) {
- seconds = _TOD_To_seconds( time_buffer );
- _Thread_Disable_dispatch();
- _TOD_Set( time_buffer, seconds );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- return RTEMS_INVALID_CLOCK;
-}
-
-/*PAGE
- *
- * rtems_clock_tick
- *
- * This directive notifies the executve that a tick has occurred.
- * When the tick occurs the time manager updates and maintains
- * the calendar time, timeslicing, and any timeout delays.
- *
- * Input parameters: NONE
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - always succeeds
- *
- * NOTE: This routine only works for leap-years through 2099.
- */
-
-rtems_status_code rtems_clock_tick( void )
-{
- _TOD_Tickle_ticks();
-
- _Watchdog_Tickle_ticks();
-
- _Thread_Tickle_timeslice();
-
- if ( _Thread_Is_context_switch_necessary() &&
- _Thread_Is_dispatching_enabled() )
- _Thread_Dispatch();
-
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/exec/rtems/src/rtemstimer.c b/c/src/exec/rtems/src/rtemstimer.c
deleted file mode 100644
index 9d04686d40..0000000000
--- a/c/src/exec/rtems/src/rtemstimer.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Timer Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/timer.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
-
-/*PAGE
- *
- * _Timer_Manager_initialization
- *
- * This routine initializes all timer manager related data structures.
- *
- * Input parameters:
- * maximum_timers - number of timers to initialize
- *
- * Output parameters: NONE
- */
-
-void _Timer_Manager_initialization(
- unsigned32 maximum_timers
-)
-{
- _Objects_Initialize_information(
- &_Timer_Information,
- OBJECTS_RTEMS_TIMERS,
- FALSE,
- maximum_timers,
- sizeof( Timer_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-}
-
-/*PAGE
- *
- * rtems_timer_create
- *
- * This directive creates a timer and performs some initialization.
- *
- * Input parameters:
- * name - timer name
- * id - pointer to timer id
- *
- * Output parameters:
- * id - timer id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_create(
- rtems_name name,
- Objects_Id *id
-)
-{
- Timer_Control *the_timer;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- _Thread_Disable_dispatch(); /* to prevent deletion */
-
- the_timer = _Timer_Allocate();
-
- if ( !the_timer ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- the_timer->the_class = TIMER_DORMANT;
-
- _Objects_Open( &_Timer_Information, &the_timer->Object, &name );
-
- *id = the_timer->Object.id;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_timer_ident
- *
- * This directive returns the system ID associated with
- * the timer name.
- *
- * Input parameters:
- * name - user defined message queue name
- * id - pointer to timer id
- *
- * Output parameters:
- * *id - message queue id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id(
- &_Timer_Information,
- &name,
- OBJECTS_SEARCH_LOCAL_NODE,
- id
- );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_timer_cancel
- *
- * This directive allows a thread to cancel a timer.
- *
- * Input parameters:
- * id - timer id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_cancel(
- Objects_Id id
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
- (void) _Watchdog_Remove( &the_timer->Ticker );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_timer_delete
- *
- * This directive allows a thread to delete a timer.
- *
- * Input parameters:
- * id - timer id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_delete(
- Objects_Id id
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- _Objects_Close( &_Timer_Information, &the_timer->Object );
- (void) _Watchdog_Remove( &the_timer->Ticker );
- _Timer_Free( the_timer );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_timer_fire_after
- *
- * This directive allows a thread to start a timer.
- *
- * Input parameters:
- * id - timer id
- * ticks - interval until routine is fired
- * routine - routine to schedule
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_fire_after(
- Objects_Id id,
- rtems_interval ticks,
- rtems_timer_service_routine_entry routine,
- void *user_data
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
-
- if ( ticks == 0 )
- return RTEMS_INVALID_NUMBER;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- (void) _Watchdog_Remove( &the_timer->Ticker );
- the_timer->the_class = TIMER_INTERVAL;
- _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
- _Watchdog_Insert_ticks( &the_timer->Ticker, ticks );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_timer_fire_when
- *
- * This directive allows a thread to start a timer.
- *
- * Input parameters:
- * id - timer id
- * wall_time - time of day to fire timer
- * routine - routine to schedule
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_fire_when(
- Objects_Id id,
- rtems_time_of_day *wall_time,
- rtems_timer_service_routine_entry routine,
- void *user_data
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
- rtems_interval seconds;
-
- if ( !_TOD_Is_set )
- return RTEMS_NOT_DEFINED;
-
- if ( !_TOD_Validate( wall_time ) )
- return RTEMS_INVALID_CLOCK;
-
- seconds = _TOD_To_seconds( wall_time );
- if ( seconds <= _TOD_Seconds_since_epoch )
- return RTEMS_INVALID_CLOCK;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- (void) _Watchdog_Remove( &the_timer->Ticker );
- the_timer->the_class = TIMER_TIME_OF_DAY;
- _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
- _Watchdog_Insert_seconds(
- &the_timer->Ticker,
- seconds - _TOD_Seconds_since_epoch
- );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_timer_reset
- *
- * This directive allows a thread to reset a timer.
- *
- * Input parameters:
- * id - timer id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_reset(
- Objects_Id id
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- if ( _Timer_Is_interval_class( the_timer->the_class ) ) {
- _Watchdog_Reset( &the_timer->Ticker );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_NOT_DEFINED;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
diff --git a/c/src/exec/rtems/src/sem.c b/c/src/exec/rtems/src/sem.c
deleted file mode 100644
index f1c1f1fbb9..0000000000
--- a/c/src/exec/rtems/src/sem.c
+++ /dev/null
@@ -1,571 +0,0 @@
-/*
- * Semaphore Manager
- *
- * DESCRIPTION:
- *
- * This package is the implementation of the Semaphore Manager.
- * This manager utilizes standard Dijkstra counting semaphores to provide
- * synchronization and mutual exclusion capabilities.
- *
- * Directives provided are:
- *
- * + create a semaphore
- * + get an ID of a semaphore
- * + delete a semaphore
- * + acquire a semaphore
- * + release a semaphore
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/score/coremutex.h>
-#include <rtems/score/coresem.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/sysstate.h>
-
-#include <rtems/score/interr.h>
-
-/*PAGE
- *
- * _Semaphore_Manager_initialization
- *
- * This routine initializes all semaphore manager related data structures.
- *
- * Input parameters:
- * maximum_semaphores - maximum configured semaphores
- *
- * Output parameters: NONE
- */
-
-void _Semaphore_Manager_initialization(
- unsigned32 maximum_semaphores
-)
-{
- _Objects_Initialize_information(
- &_Semaphore_Information,
- OBJECTS_RTEMS_SEMAPHORES,
- TRUE,
- maximum_semaphores,
- sizeof( Semaphore_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor(
- MP_PACKET_SEMAPHORE,
- _Semaphore_MP_Process_packet
- );
-
-}
-
-/*PAGE
- *
- * rtems_semaphore_create
- *
- * This directive creates a semaphore and sets the initial value based
- * on the given count. A semaphore id is returned.
- *
- * Input parameters:
- * name - user defined semaphore name
- * count - initial count of semaphore
- * attribute_set - semaphore attributes
- * priority_ceiling - semaphore's ceiling priority
- * id - pointer to semaphore id
- *
- * Output parameters:
- * id - semaphore id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_semaphore_create(
- rtems_name name,
- unsigned32 count,
- rtems_attribute attribute_set,
- rtems_task_priority priority_ceiling,
- Objects_Id *id
-)
-{
- register Semaphore_Control *the_semaphore;
- CORE_mutex_Attributes the_mutex_attributes;
- CORE_semaphore_Attributes the_semaphore_attributes;
- unsigned32 lock;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- if ( _Attributes_Is_global( attribute_set ) ) {
-
- if ( !_System_state_Is_multiprocessing )
- return RTEMS_MP_NOT_CONFIGURED;
-
- if ( _Attributes_Is_inherit_priority( attribute_set ) )
- return RTEMS_NOT_DEFINED;
-
- } else if ( _Attributes_Is_inherit_priority( attribute_set ) ||
- _Attributes_Is_priority_ceiling( attribute_set ) ) {
-
- if ( ! ( _Attributes_Is_binary_semaphore( attribute_set ) &&
- _Attributes_Is_priority( attribute_set ) ) )
- return RTEMS_NOT_DEFINED;
-
- }
-
- if ( _Attributes_Is_binary_semaphore( attribute_set ) && ( count > 1 ) )
- return RTEMS_INVALID_NUMBER;
-
- _Thread_Disable_dispatch(); /* prevents deletion */
-
- the_semaphore = _Semaphore_Allocate();
-
- if ( !the_semaphore ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- if ( _Attributes_Is_global( attribute_set ) &&
- ! ( _Objects_MP_Allocate_and_open( &_Semaphore_Information, name,
- the_semaphore->Object.id, FALSE ) ) ) {
- _Semaphore_Free( the_semaphore );
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- the_semaphore->attribute_set = attribute_set;
-
- if ( _Attributes_Is_binary_semaphore( attribute_set ) ) {
- if ( _Attributes_Is_inherit_priority( attribute_set ) )
- the_mutex_attributes.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT;
- else if (_Attributes_Is_priority_ceiling( attribute_set ) )
- the_mutex_attributes.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
- else if (_Attributes_Is_priority( attribute_set ) )
- the_mutex_attributes.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY;
- else
- the_mutex_attributes.discipline = CORE_MUTEX_DISCIPLINES_FIFO;
-
- the_mutex_attributes.allow_nesting = TRUE;
-
- /* Add priority ceiling code here ????? */
-
- the_mutex_attributes.priority_ceiling = priority_ceiling;
-
- if ( count == 1 )
- lock = CORE_MUTEX_UNLOCKED;
- else
- lock = CORE_MUTEX_LOCKED;
-
- _CORE_mutex_Initialize(
- &the_semaphore->Core_control.mutex,
- OBJECTS_RTEMS_SEMAPHORES,
- &the_mutex_attributes,
- lock,
- _Semaphore_MP_Send_extract_proxy
- );
- }
- else {
- if ( _Attributes_Is_priority( attribute_set ) )
- the_semaphore_attributes.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY;
- else
- the_semaphore_attributes.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
-
- /*
- * The following are just to make Purify happy.
- */
-
- the_mutex_attributes.allow_nesting = TRUE;
- the_mutex_attributes.priority_ceiling = PRIORITY_MINIMUM;
-
- _CORE_semaphore_Initialize(
- &the_semaphore->Core_control.semaphore,
- OBJECTS_RTEMS_SEMAPHORES,
- &the_semaphore_attributes,
- count,
- _Semaphore_MP_Send_extract_proxy
- );
- }
-
- _Objects_Open( &_Semaphore_Information, &the_semaphore->Object, &name );
-
- *id = the_semaphore->Object.id;
-
- if ( _Attributes_Is_global( attribute_set ) )
- _Semaphore_MP_Send_process_packet(
- SEMAPHORE_MP_ANNOUNCE_CREATE,
- the_semaphore->Object.id,
- name,
- 0 /* Not used */
- );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_semaphore_ident
- *
- * This directive returns the system ID associated with
- * the semaphore name.
- *
- * Input parameters:
- * name - user defined semaphore name
- * node - node(s) to be searched
- * id - pointer to semaphore id
- *
- * Output parameters:
- * *id - semaphore id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_semaphore_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id( &_Semaphore_Information, &name, node, id );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_semaphore_delete
- *
- * This directive allows a thread to delete a semaphore specified by
- * the semaphore id. The semaphore is freed back to the inactive
- * semaphore chain.
- *
- * Input parameters:
- * id - semaphore id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_semaphore_delete(
- Objects_Id id
-)
-{
- register Semaphore_Control *the_semaphore;
- Objects_Locations location;
-
- the_semaphore = _Semaphore_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
- case OBJECTS_LOCAL:
- if ( _Attributes_Is_binary_semaphore( the_semaphore->attribute_set) ) {
- if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) ) {
- _Thread_Enable_dispatch();
- return RTEMS_RESOURCE_IN_USE;
- }
- else
- _CORE_mutex_Flush(
- &the_semaphore->Core_control.mutex,
- _Semaphore_MP_Send_object_was_deleted,
- CORE_MUTEX_WAS_DELETED
- );
- }
- else
- _CORE_semaphore_Flush(
- &the_semaphore->Core_control.semaphore,
- _Semaphore_MP_Send_object_was_deleted,
- CORE_SEMAPHORE_WAS_DELETED
- );
-
- _Objects_Close( &_Semaphore_Information, &the_semaphore->Object );
-
- _Semaphore_Free( the_semaphore );
-
- if ( _Attributes_Is_global( the_semaphore->attribute_set ) ) {
-
- _Objects_MP_Close( &_Semaphore_Information, the_semaphore->Object.id );
-
- _Semaphore_MP_Send_process_packet(
- SEMAPHORE_MP_ANNOUNCE_DELETE,
- the_semaphore->Object.id,
- 0, /* Not used */
- 0 /* Not used */
- );
- }
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_semaphore_obtain
- *
- * This directive allows a thread to acquire a semaphore.
- *
- * Input parameters:
- * id - semaphore id
- * option_set - wait option
- * timeout - number of ticks to wait (0 means wait forever)
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_semaphore_obtain(
- Objects_Id id,
- unsigned32 option_set,
- rtems_interval timeout
-)
-{
- register Semaphore_Control *the_semaphore;
- Objects_Locations location;
- boolean wait;
-
- the_semaphore = _Semaphore_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return _Semaphore_MP_Send_request_packet(
- SEMAPHORE_MP_OBTAIN_REQUEST,
- id,
- option_set,
- timeout
- );
- case OBJECTS_LOCAL:
- if ( _Options_Is_no_wait( option_set ) )
- wait = FALSE;
- else
- wait = TRUE;
-
- if ( _Attributes_Is_binary_semaphore( the_semaphore->attribute_set ) ) {
- _CORE_mutex_Seize(
- &the_semaphore->Core_control.mutex,
- id,
- wait,
- timeout
- );
- _Thread_Enable_dispatch();
- return _Semaphore_Translate_core_mutex_return_code(
- _Thread_Executing->Wait.return_code );
- } else {
- _CORE_semaphore_Seize(
- &the_semaphore->Core_control.semaphore,
- id,
- wait,
- timeout
- );
- _Thread_Enable_dispatch();
- return _Semaphore_Translate_core_semaphore_return_code(
- _Thread_Executing->Wait.return_code );
- }
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_semaphore_release
- *
- * This directive allows a thread to release a semaphore.
- *
- * Input parameters:
- * id - semaphore id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_semaphore_release(
- Objects_Id id
-)
-{
- register Semaphore_Control *the_semaphore;
- Objects_Locations location;
- CORE_mutex_Status mutex_status;
- CORE_semaphore_Status semaphore_status;
-
- the_semaphore = _Semaphore_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return _Semaphore_MP_Send_request_packet(
- SEMAPHORE_MP_RELEASE_REQUEST,
- id,
- 0, /* Not used */
- MPCI_DEFAULT_TIMEOUT
- );
- case OBJECTS_LOCAL:
- if ( _Attributes_Is_binary_semaphore( the_semaphore->attribute_set ) ) {
- mutex_status = _CORE_mutex_Surrender(
- &the_semaphore->Core_control.mutex,
- id,
- _Semaphore_Core_mutex_mp_support
- );
- _Thread_Enable_dispatch();
- return _Semaphore_Translate_core_mutex_return_code( mutex_status );
- }
- else
- semaphore_status = _CORE_semaphore_Surrender(
- &the_semaphore->Core_control.semaphore,
- id,
- _Semaphore_Core_semaphore_mp_support
- );
- _Thread_Enable_dispatch();
- return
- _Semaphore_Translate_core_semaphore_return_code( semaphore_status );
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * _Semaphore_Translate_core_mutex_return_code
- *
- * Input parameters:
- * the_mutex_status - mutex status code to translate
- *
- * Output parameters:
- * rtems status code - translated RTEMS status code
- *
- */
-
-rtems_status_code _Semaphore_Translate_core_mutex_return_code (
- unsigned32 the_mutex_status
-)
-{
- switch ( the_mutex_status ) {
- case CORE_MUTEX_STATUS_SUCCESSFUL:
- return RTEMS_SUCCESSFUL;
- case CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT:
- return RTEMS_UNSATISFIED;
- case CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED:
- return RTEMS_INTERNAL_ERROR;
- case CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE:
- return RTEMS_NOT_OWNER_OF_RESOURCE;
- case CORE_MUTEX_WAS_DELETED:
- return RTEMS_OBJECT_WAS_DELETED;
- case CORE_MUTEX_TIMEOUT:
- return RTEMS_TIMEOUT;
- case THREAD_STATUS_PROXY_BLOCKING:
- return THREAD_STATUS_PROXY_BLOCKING;
- }
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * _Semaphore_Translate_core_semaphore_return_code
- *
- * Input parameters:
- * the_semaphore_status - semaphore status code to translate
- *
- * Output parameters:
- * rtems status code - translated RTEMS status code
- *
- */
-
-rtems_status_code _Semaphore_Translate_core_semaphore_return_code (
- unsigned32 the_semaphore_status
-)
-{
- switch ( the_semaphore_status ) {
- case CORE_SEMAPHORE_STATUS_SUCCESSFUL:
- return RTEMS_SUCCESSFUL;
- case CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT:
- return RTEMS_UNSATISFIED;
- case CORE_SEMAPHORE_WAS_DELETED:
- return RTEMS_OBJECT_WAS_DELETED;
- case CORE_SEMAPHORE_TIMEOUT:
- return RTEMS_TIMEOUT;
- case THREAD_STATUS_PROXY_BLOCKING:
- return THREAD_STATUS_PROXY_BLOCKING;
- }
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * _Semaphore_Core_mutex_mp_support
- *
- * Input parameters:
- * the_thread - the remote thread the semaphore was surrendered to
- * id - id of the surrendered semaphore
- *
- * Output parameters: NONE
- */
-
-void _Semaphore_Core_mutex_mp_support (
- Thread_Control *the_thread,
- Objects_Id id
-)
-{
- the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
-
- _Semaphore_MP_Send_response_packet(
- SEMAPHORE_MP_OBTAIN_RESPONSE,
- id,
- the_thread
- );
-}
-
-
-/*PAGE
- *
- * _Semaphore_Core_semaphore_mp_support
- *
- * Input parameters:
- * the_thread - the remote thread the semaphore was surrendered to
- * id - id of the surrendered semaphore
- *
- * Output parameters: NONE
- */
-
-void _Semaphore_Core_semaphore_mp_support (
- Thread_Control *the_thread,
- Objects_Id id
-)
-{
- the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
-
- _Semaphore_MP_Send_response_packet(
- SEMAPHORE_MP_OBTAIN_RESPONSE,
- id,
- the_thread
- );
-}
diff --git a/c/src/exec/rtems/src/semmp.c b/c/src/exec/rtems/src/semmp.c
deleted file mode 100644
index 01efdfca4e..0000000000
--- a/c/src/exec/rtems/src/semmp.c
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Multiprocessing Support for the Semaphore Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _Semaphore_MP_Send_process_packet
- *
- */
-
-void _Semaphore_MP_Send_process_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- rtems_name name,
- Objects_Id proxy_id
-)
-{
- Semaphore_MP_Packet *the_packet;
- unsigned32 node;
-
- switch ( operation ) {
-
- case SEMAPHORE_MP_ANNOUNCE_CREATE:
- case SEMAPHORE_MP_ANNOUNCE_DELETE:
- case SEMAPHORE_MP_EXTRACT_PROXY:
-
- the_packet = _Semaphore_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_SEMAPHORE;
- the_packet->Prefix.length = sizeof ( Semaphore_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Semaphore_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = semaphore_id;
- the_packet->name = name;
- the_packet->proxy_id = proxy_id;
-
- if ( operation == SEMAPHORE_MP_EXTRACT_PROXY )
- node = rtems_get_node( semaphore_id );
- else
- node = MPCI_ALL_NODES;
-
- _MPCI_Send_process_packet( node, &the_packet->Prefix );
- break;
-
- case SEMAPHORE_MP_OBTAIN_REQUEST:
- case SEMAPHORE_MP_OBTAIN_RESPONSE:
- case SEMAPHORE_MP_RELEASE_REQUEST:
- case SEMAPHORE_MP_RELEASE_RESPONSE:
- break;
- }
-}
-
-/*PAGE
- *
- * _Semaphore_MP_Send_request_packet
- *
- */
-
-rtems_status_code _Semaphore_MP_Send_request_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- rtems_option option_set,
- rtems_interval timeout
-)
-{
- Semaphore_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case SEMAPHORE_MP_OBTAIN_REQUEST:
- case SEMAPHORE_MP_RELEASE_REQUEST:
-
- the_packet = _Semaphore_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_SEMAPHORE;
- the_packet->Prefix.length = sizeof ( Semaphore_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Semaphore_MP_Packet );
- if ( ! _Options_Is_no_wait(option_set))
- the_packet->Prefix.timeout = timeout;
-
- the_packet->operation = operation;
- the_packet->Prefix.id = semaphore_id;
- the_packet->option_set = option_set;
-
- return _MPCI_Send_request_packet(
- rtems_get_node( semaphore_id ),
- &the_packet->Prefix,
- STATES_WAITING_FOR_SEMAPHORE
- );
- break;
-
- case SEMAPHORE_MP_ANNOUNCE_CREATE:
- case SEMAPHORE_MP_ANNOUNCE_DELETE:
- case SEMAPHORE_MP_EXTRACT_PROXY:
- case SEMAPHORE_MP_OBTAIN_RESPONSE:
- case SEMAPHORE_MP_RELEASE_RESPONSE:
- break;
-
- }
- /*
- * The following line is included to satisfy compilers which
- * produce warnings when a function does not end with a return.
- */
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _Semaphore_MP_Send_response_packet
- *
- */
-
-void _Semaphore_MP_Send_response_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- Thread_Control *the_thread
-)
-{
- Semaphore_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case SEMAPHORE_MP_OBTAIN_RESPONSE:
- case SEMAPHORE_MP_RELEASE_RESPONSE:
-
- the_packet = ( Semaphore_MP_Packet *) the_thread->receive_packet;
-
-/*
- * The packet being returned already contains the class, length, and
- * to_convert fields, therefore they are not set in this routine.
- */
- the_packet->operation = operation;
- the_packet->Prefix.id = the_packet->Prefix.source_tid;
-
- _MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
- &the_packet->Prefix
- );
- break;
-
- case SEMAPHORE_MP_ANNOUNCE_CREATE:
- case SEMAPHORE_MP_ANNOUNCE_DELETE:
- case SEMAPHORE_MP_EXTRACT_PROXY:
- case SEMAPHORE_MP_OBTAIN_REQUEST:
- case SEMAPHORE_MP_RELEASE_REQUEST:
- break;
-
- }
-}
-
-/*PAGE
- *
- *
- * _Semaphore_MP_Process_packet
- *
- */
-
-void _Semaphore_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-)
-{
- Semaphore_MP_Packet *the_packet;
- Thread_Control *the_thread;
- boolean ignored;
-
- the_packet = (Semaphore_MP_Packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case SEMAPHORE_MP_ANNOUNCE_CREATE:
-
- ignored = _Objects_MP_Allocate_and_open(
- &_Semaphore_Information,
- the_packet->name,
- the_packet->Prefix.id,
- TRUE
- );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case SEMAPHORE_MP_ANNOUNCE_DELETE:
-
- _Objects_MP_Close( &_Semaphore_Information, the_packet->Prefix.id );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case SEMAPHORE_MP_EXTRACT_PROXY:
-
- the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
-
- if ( ! _Thread_Is_null( the_thread ) )
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case SEMAPHORE_MP_OBTAIN_REQUEST:
-
- the_packet->Prefix.return_code = rtems_semaphore_obtain(
- the_packet->Prefix.id,
- the_packet->option_set,
- the_packet->Prefix.timeout
- );
-
- if ( ! _Thread_Is_proxy_blocking( the_packet->Prefix.return_code ) )
- _Semaphore_MP_Send_response_packet(
- SEMAPHORE_MP_OBTAIN_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case SEMAPHORE_MP_OBTAIN_RESPONSE:
- case SEMAPHORE_MP_RELEASE_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case SEMAPHORE_MP_RELEASE_REQUEST:
-
- the_packet->Prefix.return_code = rtems_semaphore_release(
- the_packet->Prefix.id
- );
-
- _Semaphore_MP_Send_response_packet(
- SEMAPHORE_MP_RELEASE_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
- }
-}
-
-/*PAGE
- *
- * _Semaphore_MP_Send_object_was_deleted
- *
- */
-
-void _Semaphore_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-)
-{
- the_proxy->receive_packet->return_code = RTEMS_OBJECT_WAS_DELETED;
-
- _Semaphore_MP_Send_response_packet(
- SEMAPHORE_MP_OBTAIN_RESPONSE,
- the_proxy->Wait.id,
- the_proxy
- );
-
-}
-
-/*PAGE
- *
- * _Semaphore_MP_Send_extract_proxy
- *
- */
-
-void _Semaphore_MP_Send_extract_proxy (
- Thread_Control *the_thread
-)
-{
- _Semaphore_MP_Send_process_packet(
- SEMAPHORE_MP_EXTRACT_PROXY,
- the_thread->Wait.id,
- (rtems_name) 0,
- the_thread->Object.id
- );
-
-}
-
-/*PAGE
- *
- * _Semaphore_MP_Get_packet
- *
- */
-
-Semaphore_MP_Packet *_Semaphore_MP_Get_packet ( void )
-{
- return ( (Semaphore_MP_Packet *) _MPCI_Get_packet() );
-}
-
-/* end of file */
diff --git a/c/src/exec/rtems/src/signal.c b/c/src/exec/rtems/src/signal.c
deleted file mode 100644
index efdcf70eea..0000000000
--- a/c/src/exec/rtems/src/signal.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Signal Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/asr.h>
-#include <rtems/score/isr.h>
-#include <rtems/rtems/modes.h>
-#include <rtems/rtems/signal.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/tasks.h>
-
-/*PAGE
- *
- * _Signal_Manager_initialization
- *
- * This routine initializes all signal manager related data structures.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _Signal_Manager_initialization( void )
-{
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor(
- MP_PACKET_SIGNAL,
- _Signal_MP_Process_packet
- );
-}
-
-/*PAGE
- *
- * rtems_signal_catch
- *
- * This directive allows a thread to specify what action to take when
- * catching signals.
- *
- * Input parameters:
- * handler - address of asynchronous signal routine (asr)
- * ( NULL indicates asr is invalid )
- * mode_set - mode value for asr
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - always succeeds
- */
-
-rtems_status_code rtems_signal_catch(
- rtems_asr_entry asr_handler,
- rtems_mode mode_set
-)
-{
- Thread_Control *executing;
- RTEMS_API_Control *api;
- ASR_Information *asr;
-
-/* XXX normalize mode */
- executing = _Thread_Executing;
- api = executing->API_Extensions[ THREAD_API_RTEMS ];
- asr = &api->Signal;
-
- _Thread_Disable_dispatch(); /* cannot reschedule while */
- /* the thread is inconsistent */
-
- if ( !_ASR_Is_null_handler( asr_handler ) ) {
- asr->mode_set = mode_set;
- asr->handler = asr_handler;
- }
- else
- _ASR_Initialize( asr );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_signal_send
- *
- * This directive allows a thread to send signals to a thread.
- *
- * Input parameters:
- * id - thread id
- * signal_set - signal set
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_signal_send(
- Objects_Id id,
- rtems_signal_set signal_set
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
- RTEMS_API_Control *api;
- ASR_Information *asr;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return _Signal_MP_Send_request_packet(
- SIGNAL_MP_SEND_REQUEST,
- id,
- signal_set
- );
- case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
- asr = &api->Signal;
-
- if ( ! _ASR_Is_null_handler( asr->handler ) ) {
- if ( asr->is_enabled ) {
- _ASR_Post_signals( signal_set, &asr->signals_posted );
-
- the_thread->do_post_task_switch_extension = TRUE;
-
- if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
- _ISR_Signals_to_thread_executing = TRUE;
- } else {
- _ASR_Post_signals( signal_set, &asr->signals_pending );
- }
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_NOT_DEFINED;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
diff --git a/c/src/exec/rtems/src/signalmp.c b/c/src/exec/rtems/src/signalmp.c
deleted file mode 100644
index f78e94d366..0000000000
--- a/c/src/exec/rtems/src/signalmp.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Multiprocessing Support for the Signal Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/signal.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _Signal_MP_Send_process_packet
- *
- * This subprogram is not needed since there are no process
- * packets to be sent by this manager.
- *
- */
-
-/*PAGE
- *
- * _Signal_MP_Send_request_packet
- *
- */
-
-rtems_status_code _Signal_MP_Send_request_packet (
- Signal_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_signal_set signal_in
-)
-{
- Signal_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case SIGNAL_MP_SEND_REQUEST:
-
- the_packet = _Signal_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_SIGNAL;
- the_packet->Prefix.length = sizeof ( Signal_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Signal_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = task_id;
- the_packet->signal_in = signal_in;
-
- return _MPCI_Send_request_packet(
- rtems_get_node( task_id ),
- &the_packet->Prefix,
- STATES_READY /* Not used */
- );
- break;
-
- case SIGNAL_MP_SEND_RESPONSE:
- break;
-
- }
- /*
- * The following line is included to satisfy compilers which
- * produce warnings when a function does not end with a return.
- */
- return RTEMS_INTERNAL_ERROR;
-}
-
-/*PAGE
- *
- * _Signal_MP_Send_response_packet
- *
- */
-
-void _Signal_MP_Send_response_packet (
- Signal_MP_Remote_operations operation,
- Thread_Control *the_thread
-)
-{
- Signal_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case SIGNAL_MP_SEND_RESPONSE:
-
- the_packet = ( Signal_MP_Packet *) the_thread->receive_packet;
-
-/*
- * The packet being returned already contains the class, length, and
- * to_convert fields, therefore they are not set in this routine.
- */
- the_packet->operation = operation;
- the_packet->Prefix.id = the_packet->Prefix.source_tid;
-
- _MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
- &the_packet->Prefix
- );
- break;
-
- case SIGNAL_MP_SEND_REQUEST:
- break;
-
- }
-}
-
-/*PAGE
- *
- *
- * _Signal_MP_Process_packet
- *
- */
-
-void _Signal_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-)
-{
- Signal_MP_Packet *the_packet;
- Thread_Control *the_thread;
-
- the_packet = (Signal_MP_Packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case SIGNAL_MP_SEND_REQUEST:
-
- the_packet->Prefix.return_code = rtems_signal_send(
- the_packet->Prefix.id,
- the_packet->signal_in
- );
-
- _Signal_MP_Send_response_packet(
- SIGNAL_MP_SEND_RESPONSE,
- _Thread_Executing
- );
- break;
-
- case SIGNAL_MP_SEND_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- }
-}
-
-/*PAGE
- *
- * _Signal_MP_Send_object_was_deleted
- *
- * This subprogram is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*PAGE
- *
- * _Signal_MP_Send_extract_proxy
- *
- * This subprogram is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*PAGE
- *
- * _Signal_MP_Get_packet
- *
- */
-
-Signal_MP_Packet *_Signal_MP_Get_packet ( void )
-{
- return ( (Signal_MP_Packet *) _MPCI_Get_packet() );
-}
-
-/* end of file */
diff --git a/c/src/exec/rtems/src/taskmp.c b/c/src/exec/rtems/src/taskmp.c
deleted file mode 100644
index 5d5f3df763..0000000000
--- a/c/src/exec/rtems/src/taskmp.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * Multiprocessing Support for the RTEMS Task Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _RTEMS_tasks_MP_Send_process_packet
- *
- */
-
-void _RTEMS_tasks_MP_Send_process_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_name name
-)
-{
- RTEMS_tasks_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case RTEMS_TASKS_MP_ANNOUNCE_CREATE:
- case RTEMS_TASKS_MP_ANNOUNCE_DELETE:
-
- the_packet = _RTEMS_tasks_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_TASKS;
- the_packet->Prefix.length = sizeof ( RTEMS_tasks_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( RTEMS_tasks_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = task_id;
- the_packet->name = name;
-
- _MPCI_Send_process_packet( MPCI_ALL_NODES, &the_packet->Prefix );
- break;
-
- case RTEMS_TASKS_MP_SUSPEND_REQUEST:
- case RTEMS_TASKS_MP_SUSPEND_RESPONSE:
- case RTEMS_TASKS_MP_RESUME_REQUEST:
- case RTEMS_TASKS_MP_RESUME_RESPONSE:
- case RTEMS_TASKS_MP_SET_PRIORITY_REQUEST:
- case RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE:
- case RTEMS_TASKS_MP_GET_NOTE_REQUEST:
- case RTEMS_TASKS_MP_GET_NOTE_RESPONSE:
- case RTEMS_TASKS_MP_SET_NOTE_REQUEST:
- case RTEMS_TASKS_MP_SET_NOTE_RESPONSE:
- break;
- }
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_MP_Send_request_packet
- *
- */
-
-rtems_status_code _RTEMS_tasks_MP_Send_request_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_task_priority new_priority,
- unsigned32 notepad,
- unsigned32 note
-)
-{
- RTEMS_tasks_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case RTEMS_TASKS_MP_SUSPEND_REQUEST:
- case RTEMS_TASKS_MP_RESUME_REQUEST:
- case RTEMS_TASKS_MP_SET_PRIORITY_REQUEST:
- case RTEMS_TASKS_MP_GET_NOTE_REQUEST:
- case RTEMS_TASKS_MP_SET_NOTE_REQUEST:
-
- the_packet = _RTEMS_tasks_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_TASKS;
- the_packet->Prefix.length = sizeof ( RTEMS_tasks_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( RTEMS_tasks_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = task_id;
- the_packet->the_priority = new_priority;
- the_packet->notepad = notepad;
- the_packet->note = note;
-
- return _MPCI_Send_request_packet(
- rtems_get_node( task_id ),
- &the_packet->Prefix,
- STATES_READY /* Not used */
- );
- break;
-
- case RTEMS_TASKS_MP_ANNOUNCE_CREATE:
- case RTEMS_TASKS_MP_ANNOUNCE_DELETE:
- case RTEMS_TASKS_MP_SUSPEND_RESPONSE:
- case RTEMS_TASKS_MP_RESUME_RESPONSE:
- case RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE:
- case RTEMS_TASKS_MP_GET_NOTE_RESPONSE:
- case RTEMS_TASKS_MP_SET_NOTE_RESPONSE:
- break;
-
- }
- /*
- * The following line is included to satisfy compilers which
- * produce warnings when a function does not end with a return.
- */
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_MP_Send_response_packet
- *
- */
-
-void _RTEMS_tasks_MP_Send_response_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Thread_Control *the_thread
-)
-{
- RTEMS_tasks_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case RTEMS_TASKS_MP_SUSPEND_RESPONSE:
- case RTEMS_TASKS_MP_RESUME_RESPONSE:
- case RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE:
- case RTEMS_TASKS_MP_GET_NOTE_RESPONSE:
- case RTEMS_TASKS_MP_SET_NOTE_RESPONSE:
-
- the_packet = (RTEMS_tasks_MP_Packet *) the_thread->receive_packet;
-
-/*
- * The packet being returned already contains the class, length, and
- * to_convert fields, therefore they are not set in this routine.
- */
- the_packet->operation = operation;
- the_packet->Prefix.id = the_packet->Prefix.source_tid;
-
- _MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
- &the_packet->Prefix
- );
- break;
-
- case RTEMS_TASKS_MP_ANNOUNCE_CREATE:
- case RTEMS_TASKS_MP_ANNOUNCE_DELETE:
- case RTEMS_TASKS_MP_SUSPEND_REQUEST:
- case RTEMS_TASKS_MP_RESUME_REQUEST:
- case RTEMS_TASKS_MP_SET_PRIORITY_REQUEST:
- case RTEMS_TASKS_MP_GET_NOTE_REQUEST:
- case RTEMS_TASKS_MP_SET_NOTE_REQUEST:
- break;
-
- }
-}
-
-/*PAGE
- *
- *
- * _RTEMS_tasks_MP_Process_packet
- *
- */
-
-void _RTEMS_tasks_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-)
-{
- RTEMS_tasks_MP_Packet *the_packet;
- Thread_Control *the_thread;
- boolean ignored;
-
- the_packet = (RTEMS_tasks_MP_Packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case RTEMS_TASKS_MP_ANNOUNCE_CREATE:
-
- ignored = _Objects_MP_Allocate_and_open(
- &_RTEMS_tasks_Information,
- the_packet->name,
- the_packet->Prefix.id,
- TRUE
- );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case RTEMS_TASKS_MP_ANNOUNCE_DELETE:
-
- _Objects_MP_Close( &_RTEMS_tasks_Information, the_packet->Prefix.id );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case RTEMS_TASKS_MP_SUSPEND_REQUEST:
-
- the_packet->Prefix.return_code = rtems_task_suspend(
- the_packet->Prefix.id
- );
-
- _RTEMS_tasks_MP_Send_response_packet(
- RTEMS_TASKS_MP_SUSPEND_RESPONSE,
- _Thread_Executing
- );
- break;
-
- case RTEMS_TASKS_MP_SUSPEND_RESPONSE:
- case RTEMS_TASKS_MP_RESUME_RESPONSE:
- case RTEMS_TASKS_MP_SET_NOTE_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case RTEMS_TASKS_MP_RESUME_REQUEST:
-
- the_packet->Prefix.return_code = rtems_task_resume(
- the_packet->Prefix.id
- );
-
- _RTEMS_tasks_MP_Send_response_packet(
- RTEMS_TASKS_MP_RESUME_RESPONSE,
- _Thread_Executing
- );
- break;
-
- case RTEMS_TASKS_MP_SET_PRIORITY_REQUEST:
-
- the_packet->Prefix.return_code = rtems_task_set_priority(
- the_packet->Prefix.id,
- the_packet->the_priority,
- &the_packet->the_priority
- );
-
- _RTEMS_tasks_MP_Send_response_packet(
- RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE,
- _Thread_Executing
- );
- break;
-
- case RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- *(rtems_task_priority *)the_thread->Wait.return_argument =
- the_packet->the_priority;
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case RTEMS_TASKS_MP_GET_NOTE_REQUEST:
-
- the_packet->Prefix.return_code = rtems_task_get_note(
- the_packet->Prefix.id,
- the_packet->notepad,
- &the_packet->note
- );
-
- _RTEMS_tasks_MP_Send_response_packet(
- RTEMS_TASKS_MP_GET_NOTE_RESPONSE,
- _Thread_Executing
- );
- break;
-
- case RTEMS_TASKS_MP_GET_NOTE_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- *(unsigned32 *)the_thread->Wait.return_argument = the_packet->note;
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case RTEMS_TASKS_MP_SET_NOTE_REQUEST:
-
- the_packet->Prefix.return_code = rtems_task_set_note(
- the_packet->Prefix.id,
- the_packet->notepad,
- the_packet->note
- );
-
- _RTEMS_tasks_MP_Send_response_packet(
- RTEMS_TASKS_MP_SET_NOTE_RESPONSE,
- _Thread_Executing
- );
- break;
- }
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_MP_Send_object_was_deleted
- *
- * This routine is not neededby the Tasks since a task
- * cannot be globally deleted.
- *
- */
-
-/*PAGE
- *
- * _RTEMS_tasks_MP_Send_extract_proxy
- *
- * This routine is not neededby the Tasks since a task
- * cannot be globally deleted.
- *
- */
-
-/*PAGE
- *
- * _RTEMS_tasks_MP_Get_packet
- *
- */
-
-RTEMS_tasks_MP_Packet *_RTEMS_tasks_MP_Get_packet ( void )
-{
- return (RTEMS_tasks_MP_Packet *) _MPCI_Get_packet();
-}
-
-/* end of file */
diff --git a/c/src/exec/rtems/src/tasks.c b/c/src/exec/rtems/src/tasks.c
deleted file mode 100644
index 723a769836..0000000000
--- a/c/src/exec/rtems/src/tasks.c
+++ /dev/null
@@ -1,1130 +0,0 @@
-/*
- * RTEMS Task Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/modes.h>
-#include <rtems/score/object.h>
-#include <rtems/score/stack.h>
-#include <rtems/score/states.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/userext.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/apiext.h>
-#include <rtems/score/sysstate.h>
-
-/*PAGE
- *
- * _RTEMS_tasks_Create_extension
- *
- * XXX
- */
-
-boolean _RTEMS_tasks_Create_extension(
- Thread_Control *executing,
- Thread_Control *created
-)
-{
- RTEMS_API_Control *api;
-
- api = _Workspace_Allocate( sizeof( RTEMS_API_Control ) );
-
- if ( !api )
- return FALSE;
-
- created->API_Extensions[ THREAD_API_RTEMS ] = api;
-
- api->pending_events = EVENT_SETS_NONE_PENDING;
- _ASR_Initialize( &api->Signal );
- return TRUE;
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Start_extension
- *
- * XXX
- */
-
-User_extensions_routine _RTEMS_tasks_Start_extension(
- Thread_Control *executing,
- Thread_Control *started
-)
-{
- RTEMS_API_Control *api;
-
- api = started->API_Extensions[ THREAD_API_RTEMS ];
-
- api->pending_events = EVENT_SETS_NONE_PENDING;
-
- _ASR_Initialize( &api->Signal );
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Delete_extension
- *
- * XXX
- */
-
-User_extensions_routine _RTEMS_tasks_Delete_extension(
- Thread_Control *executing,
- Thread_Control *deleted
-)
-{
- (void) _Workspace_Free( deleted->API_Extensions[ THREAD_API_RTEMS ] );
-
- deleted->API_Extensions[ THREAD_API_RTEMS ] = NULL;
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Switch_extension
- *
- * XXX
- */
-
-void _RTEMS_tasks_Switch_extension(
- Thread_Control *executing
-)
-{
- ISR_Level level;
- RTEMS_API_Control *api;
- ASR_Information *asr;
- rtems_signal_set signal_set;
- Modes_Control prev_mode;
-
- api = executing->API_Extensions[ THREAD_API_RTEMS ];
- asr = &api->Signal;
-
- _ISR_Disable( level );
- signal_set = asr->signals_posted;
- asr->signals_posted = 0;
- _ISR_Enable( level );
-
-
- if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
- return;
-
- asr->nest_level += 1;
- rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
-
- (*asr->handler)( signal_set );
-
- asr->nest_level -= 1;
- rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
-
-}
-
-API_extensions_Control _RTEMS_tasks_API_extensions = {
- { NULL, NULL },
- NULL, /* predriver */
- _RTEMS_tasks_Initialize_user_tasks, /* postdriver */
- _RTEMS_tasks_Switch_extension /* post switch */
-};
-
-User_extensions_Control _RTEMS_tasks_User_extensions = {
- { NULL, NULL },
- { _RTEMS_tasks_Create_extension, /* create */
- _RTEMS_tasks_Start_extension, /* start */
- _RTEMS_tasks_Start_extension, /* restart */
- _RTEMS_tasks_Delete_extension, /* delete */
- NULL, /* switch */
- NULL, /* begin */
- NULL, /* exitted */
- NULL /* fatal */
- }
-};
-
-/*PAGE
- *
- * _RTEMS_tasks_Manager_initialization
- *
- * This routine initializes all Task Manager related data structures.
- *
- * Input parameters:
- * maximum_tasks - number of tasks to initialize
- *
- * Output parameters: NONE
- */
-
-void _RTEMS_tasks_Manager_initialization(
- unsigned32 maximum_tasks,
- unsigned32 number_of_initialization_tasks,
- rtems_initialization_tasks_table *user_tasks
-)
-{
-
- _RTEMS_tasks_Number_of_initialization_tasks = number_of_initialization_tasks;
- _RTEMS_tasks_User_initialization_tasks = user_tasks;
-
- /*
- * There may not be any RTEMS initialization tasks configured.
- */
-
-#if 0
- if ( user_tasks == NULL || number_of_initialization_tasks == 0 )
- _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, TRUE, RTEMS_TOO_MANY );
-#endif
-
- _Objects_Initialize_information(
- &_RTEMS_tasks_Information,
- OBJECTS_RTEMS_TASKS,
- TRUE,
- maximum_tasks,
- sizeof( Thread_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- TRUE
- );
-
- /*
- * Add all the extensions for this API
- */
-
- _User_extensions_Add_API_set( &_RTEMS_tasks_User_extensions );
-
- _API_extensions_Add( &_RTEMS_tasks_API_extensions );
-
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor(
- MP_PACKET_TASKS,
- _RTEMS_tasks_MP_Process_packet
- );
-
-}
-
-/*PAGE
- *
- * rtems_task_create
- *
- * This directive creates a thread by allocating and initializing a
- * thread control block and a stack. The newly created thread is
- * placed in the dormant state.
- *
- * Input parameters:
- * name - user defined thread name
- * initial_priority - thread priority
- * stack_size - stack size in bytes
- * initial_modes - initial thread mode
- * attribute_set - thread attributes
- * id - pointer to thread id
- *
- * Output parameters:
- * id - thread id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_create(
- rtems_name name,
- rtems_task_priority initial_priority,
- unsigned32 stack_size,
- rtems_mode initial_modes,
- rtems_attribute attribute_set,
- Objects_Id *id
-)
-{
- register Thread_Control *the_thread;
- Objects_MP_Control *the_global_object = NULL;
- boolean is_fp;
- boolean is_global;
- boolean status;
- rtems_attribute the_attribute_set;
- Priority_Control core_priority;
- RTEMS_API_Control *api;
- ASR_Information *asr;
-
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- /*
- * Core Thread Initialize insures we get the minimum amount of
- * stack space.
- */
-
-#if 0
- if ( !_Stack_Is_enough( stack_size ) )
- return RTEMS_INVALID_SIZE;
-#endif
-
- /*
- * Fix the attribute set to match the attributes which
- * this processor (1) requires and (2) is able to support.
- * First add in the required flags for attribute_set
- * Typically this might include FP if the platform
- * or application required all tasks to be fp aware.
- * Then turn off the requested bits which are not supported.
- */
-
- the_attribute_set = _Attributes_Set( attribute_set, ATTRIBUTES_REQUIRED );
- the_attribute_set =
- _Attributes_Clear( the_attribute_set, ATTRIBUTES_NOT_SUPPORTED );
-
- if ( _Attributes_Is_floating_point( the_attribute_set ) )
- is_fp = TRUE;
- else
- is_fp = FALSE;
-
- /*
- * Validate the RTEMS API priority and convert it to the core priority range.
- */
-
- if ( !_Attributes_Is_system_task( the_attribute_set ) ) {
- if ( !_RTEMS_tasks_Priority_is_valid( initial_priority ) )
- return RTEMS_INVALID_PRIORITY;
- }
-
- core_priority = _RTEMS_tasks_Priority_to_Core( initial_priority );
-
- if ( _Attributes_Is_global( the_attribute_set ) ) {
-
- is_global = TRUE;
-
- if ( !_System_state_Is_multiprocessing )
- return RTEMS_MP_NOT_CONFIGURED;
-
- } else
- is_global = FALSE;
-
- /*
- * Make sure system is MP if this task is global
- */
-
- /*
- * Disable dispatch for protection
- */
-
- _Thread_Disable_dispatch();
-
- /*
- * Allocate the thread control block and -- if the task is global --
- * allocate a global object control block.
- *
- * NOTE: This routine does not use the combined allocate and open
- * global object routine because this results in a lack of
- * control over when memory is allocated and can be freed in
- * the event of an error.
- */
-
- the_thread = _RTEMS_tasks_Allocate();
-
- if ( !the_thread ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- if ( is_global ) {
- the_global_object = _Objects_MP_Allocate_global_object();
-
- if ( _Objects_MP_Is_null_global_object( the_global_object ) ) {
- _RTEMS_tasks_Free( the_thread );
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
- }
-
- /*
- * Initialize the core thread for this task.
- */
-
- status = _Thread_Initialize(
- &_RTEMS_tasks_Information,
- the_thread,
- NULL,
- stack_size,
- is_fp,
- core_priority,
- _Modes_Is_preempt(initial_modes) ? TRUE : FALSE,
- _Modes_Is_timeslice(initial_modes) ?
- THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE :
- THREAD_CPU_BUDGET_ALGORITHM_NONE,
- NULL, /* no budget algorithm callout */
- _Modes_Get_interrupt_level(initial_modes),
- &name
- );
-
- if ( !status ) {
- if ( is_global )
- _Objects_MP_Free_global_object( the_global_object );
- _RTEMS_tasks_Free( the_thread );
- _Thread_Enable_dispatch();
- return RTEMS_UNSATISFIED;
- }
-
- api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
- asr = &api->Signal;
-
- asr->is_enabled = _Modes_Is_asr_disabled(initial_modes) ? FALSE : TRUE;
-
- *id = the_thread->Object.id;
-
- if ( is_global ) {
-
- the_thread->is_global = TRUE;
-
- _Objects_MP_Open(
- &_RTEMS_tasks_Information,
- the_global_object,
- name,
- the_thread->Object.id
- );
-
- _RTEMS_tasks_MP_Send_process_packet(
- RTEMS_TASKS_MP_ANNOUNCE_CREATE,
- the_thread->Object.id,
- name
- );
-
- }
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_task_ident
- *
- * This directive returns the system ID associated with
- * the thread name.
- *
- * Input parameters:
- * name - user defined thread name
- * node - node(s) to be searched
- * id - pointer to thread id
- *
- * Output parameters:
- * *id - thread id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- if ( name == OBJECTS_ID_OF_SELF ) {
- *id = _Thread_Executing->Object.id;
- return RTEMS_SUCCESSFUL;
- }
-
- status = _Objects_Name_to_id( &_RTEMS_tasks_Information, &name, node, id );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_task_start
- *
- * This directive readies the thread identified by the "id"
- * based on its current priorty, to await execution. A thread
- * can be started only from the dormant state.
- *
- * Input parameters:
- * id - thread id
- * entry_point - start execution address of thread
- * argument - thread argument
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_start(
- rtems_id id,
- rtems_task_entry entry_point,
- unsigned32 argument
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
-
- if ( entry_point == NULL )
- return RTEMS_INVALID_ADDRESS;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
- case OBJECTS_LOCAL:
- if ( _Thread_Start(
- the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) {
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_INCORRECT_STATE;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_restart
- *
- * This directive readies the specified thread. It restores
- * the thread environment to the original values established
- * at thread creation and start time. A thread can be restarted
- * from any state except the dormant state.
- *
- * Input parameters:
- * id - thread id
- * argument - thread argument
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_restart(
- Objects_Id id,
- unsigned32 argument
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
- case OBJECTS_LOCAL:
- if ( _Thread_Restart( the_thread, NULL, argument ) ) {
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_INCORRECT_STATE;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_delete
- *
- * This directive allows a thread to delete itself or the thread
- * identified in the id field. The executive halts execution
- * of the thread and frees the thread control block.
- *
- * Input parameters:
- * id - thread id
- *
- * Output parameters:
- * nothing - if id is the requesting thread (always succeeds)
- * RTEMS_SUCCESSFUL - if successful and id is
- * not the requesting thread
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_delete(
- Objects_Id id
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
- Objects_Information *the_information;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
- case OBJECTS_LOCAL:
- the_information = _Objects_Get_information( the_thread->Object.id );
-
- if ( !the_information ) {
- _Thread_Enable_dispatch();
- return RTEMS_INVALID_ID;
- /* This should never happen if _Thread_Get() works right */
- }
-
- _Thread_Close( the_information, the_thread );
-
- _RTEMS_tasks_Free( the_thread );
-
- if ( the_thread->is_global ) {
-
- _Objects_MP_Close( &_RTEMS_tasks_Information, the_thread->Object.id );
-
- _RTEMS_tasks_MP_Send_process_packet(
- RTEMS_TASKS_MP_ANNOUNCE_DELETE,
- the_thread->Object.id,
- 0 /* Not used */
- );
- }
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_suspend
- *
- * This directive will place the specified thread in the "suspended"
- * state. Note that the suspended state can be in addition to
- * other waiting states.
- *
- * Input parameters:
- * id - thread id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_suspend(
- Objects_Id id
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return _RTEMS_tasks_MP_Send_request_packet(
- RTEMS_TASKS_MP_SUSPEND_REQUEST,
- id,
- 0, /* Not used */
- 0, /* Not used */
- 0 /* Not used */
- );
- case OBJECTS_LOCAL:
- if ( !_States_Is_suspended( the_thread->current_state ) ) {
- _Thread_Set_state( the_thread, STATES_SUSPENDED );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_ALREADY_SUSPENDED;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_resume
- *
- * This directive will remove the specified thread
- * from the suspended state.
- *
- * Input parameters:
- * id - thread id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_resume(
- Objects_Id id
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return(
- _RTEMS_tasks_MP_Send_request_packet(
- RTEMS_TASKS_MP_RESUME_REQUEST,
- id,
- 0, /* Not used */
- 0, /* Not used */
- 0 /* Not used */
- )
- );
- case OBJECTS_LOCAL:
- if ( _States_Is_suspended( the_thread->current_state ) ) {
- _Thread_Resume( the_thread );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_INCORRECT_STATE;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_set_priority
- *
- * This directive changes the priority of the specified thread.
- * The specified thread can be any thread in the system including
- * the requesting thread.
- *
- * Input parameters:
- * id - thread id (0 indicates requesting thread)
- * new_priority - thread priority (0 indicates current priority)
- * old_priority - pointer to previous priority
- *
- * Output parameters:
- * old_priority - previous priority
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_set_priority(
- Objects_Id id,
- rtems_task_priority new_priority,
- rtems_task_priority *old_priority
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
-
- if ( new_priority != RTEMS_CURRENT_PRIORITY &&
- !_RTEMS_tasks_Priority_is_valid( new_priority ) )
- return RTEMS_INVALID_PRIORITY;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Executing->Wait.return_argument = old_priority;
- return(
- _RTEMS_tasks_MP_Send_request_packet(
- RTEMS_TASKS_MP_SET_PRIORITY_REQUEST,
- id,
- new_priority,
- 0, /* Not used */
- 0 /* Not used */
- )
- );
- case OBJECTS_LOCAL:
- *old_priority = the_thread->current_priority;
- if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
- the_thread->real_priority = new_priority;
- if ( the_thread->resource_count == 0 ||
- the_thread->current_priority > new_priority )
- _Thread_Change_priority( the_thread, new_priority, FALSE );
- }
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_mode
- *
- * This directive enables and disables several modes of
- * execution for the requesting thread.
- *
- * Input parameters:
- * mode_set - new mode
- * mask - mask
- * previous_mode_set - address of previous mode set
- *
- * Output:
- * *previous_mode_set - previous mode set
- * always return RTEMS_SUCCESSFUL;
- */
-
-rtems_status_code rtems_task_mode(
- rtems_mode mode_set,
- rtems_mode mask,
- rtems_mode *previous_mode_set
-)
-{
- Thread_Control *executing;
- RTEMS_API_Control *api;
- ASR_Information *asr;
- boolean is_asr_enabled = FALSE;
- boolean needs_asr_dispatching = FALSE;
- rtems_mode old_mode;
-
- executing = _Thread_Executing;
- api = executing->API_Extensions[ THREAD_API_RTEMS ];
- asr = &api->Signal;
-
- old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
-
- if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
- old_mode |= RTEMS_NO_TIMESLICE;
- else
- old_mode |= RTEMS_TIMESLICE;
-
- old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
- old_mode |= _ISR_Get_level();
-
- *previous_mode_set = old_mode;
-
- /*
- * These are generic thread scheduling characteristics.
- */
-
- if ( mask & RTEMS_PREEMPT_MASK )
- executing->is_preemptible = _Modes_Is_preempt(mode_set) ? TRUE : FALSE;
-
- if ( mask & RTEMS_TIMESLICE_MASK ) {
- if ( _Modes_Is_timeslice(mode_set) )
- executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
- else
- executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
- }
-
- /*
- * Set the new interrupt level
- */
-
- if ( mask & RTEMS_INTERRUPT_MASK )
- _Modes_Set_interrupt_level( mode_set );
-
- /*
- * This is specific to the RTEMS API
- */
-
- is_asr_enabled = FALSE;
- needs_asr_dispatching = FALSE;
-
- if ( mask & RTEMS_ASR_MASK ) {
- is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? FALSE : TRUE;
- if ( is_asr_enabled != asr->is_enabled ) {
- asr->is_enabled = is_asr_enabled;
- _ASR_Swap_signals( asr );
- if ( _ASR_Are_signals_pending( asr ) ) {
- needs_asr_dispatching = TRUE;
- executing->do_post_task_switch_extension = TRUE;
- }
- }
- }
-
- if ( _Thread_Evaluate_mode() || needs_asr_dispatching )
- _Thread_Dispatch();
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_task_get_note
- *
- * This directive obtains the note from the specified notepad
- * of the specified thread.
- *
- * Input parameters:
- * id - thread id
- * notepad - notepad number
- * note - pointer to note
- *
- * Output parameters:
- * note - filled in if successful
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_get_note(
- Objects_Id id,
- unsigned32 notepad,
- unsigned32 *note
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
- RTEMS_API_Control *api;
-
- /*
- * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would
- * be checking an unsigned number for being negative.
- */
-
- if ( notepad > RTEMS_NOTEPAD_LAST )
- return RTEMS_INVALID_NUMBER;
-
- /*
- * Optimize the most likely case to avoid the Thread_Dispatch.
- */
-
- if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ||
- _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) {
- api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ];
- *note = api->Notepads[ notepad ];
- return RTEMS_SUCCESSFUL;
- }
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Executing->Wait.return_argument = note;
-
- return _RTEMS_tasks_MP_Send_request_packet(
- RTEMS_TASKS_MP_GET_NOTE_REQUEST,
- id,
- 0, /* Not used */
- notepad,
- 0 /* Not used */
- );
- case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
- *note = api->Notepads[ notepad ];
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_set_note
- *
- * This directive sets the specified notepad contents to the given
- * note.
- *
- * Input parameters:
- * id - thread id
- * notepad - notepad number
- * note - note value
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_set_note(
- Objects_Id id,
- unsigned32 notepad,
- unsigned32 note
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
- RTEMS_API_Control *api;
-
- /*
- * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would
- * be checking an unsigned number for being negative.
- */
-
- if ( notepad > RTEMS_NOTEPAD_LAST )
- return RTEMS_INVALID_NUMBER;
-
- /*
- * Optimize the most likely case to avoid the Thread_Dispatch.
- */
-
- if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ||
- _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) {
- api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ];
- api->Notepads[ notepad ] = note;
- return RTEMS_SUCCESSFUL;
- }
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return _RTEMS_tasks_MP_Send_request_packet(
- RTEMS_TASKS_MP_SET_NOTE_REQUEST,
- id,
- 0, /* Not used */
- notepad,
- note
- );
-
- case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
- api->Notepads[ notepad ] = note;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_wake_after
- *
- * This directive suspends the requesting thread for the given amount
- * of ticks.
- *
- * Input parameters:
- * ticks - number of ticks to wait
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - always successful
- */
-
-rtems_status_code rtems_task_wake_after(
- rtems_interval ticks
-)
-{
- if ( ticks == 0 ) {
- _Thread_Yield_processor();
- _Thread_Dispatch();
- } else {
- _Thread_Disable_dispatch();
- _Thread_Set_state( _Thread_Executing, STATES_DELAYING );
- _Watchdog_Initialize(
- &_Thread_Executing->Timer,
- _Thread_Delay_ended,
- _Thread_Executing->Object.id,
- NULL
- );
- _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks );
- _Thread_Enable_dispatch();
- }
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_task_wake_when
- *
- * This directive blocks the requesting thread until the given date and
- * time is reached.
- *
- * Input parameters:
- * time_buffer - pointer to the time and date structure
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_wake_when(
-rtems_time_of_day *time_buffer
-)
-{
- Watchdog_Interval seconds;
-
- if ( !_TOD_Is_set )
- return RTEMS_NOT_DEFINED;
-
- time_buffer->ticks = 0;
-
- if ( !_TOD_Validate( time_buffer ) )
- return RTEMS_INVALID_CLOCK;
-
- seconds = _TOD_To_seconds( time_buffer );
-
- if ( seconds <= _TOD_Seconds_since_epoch )
- return RTEMS_INVALID_CLOCK;
-
- _Thread_Disable_dispatch();
- _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME );
- _Watchdog_Initialize(
- &_Thread_Executing->Timer,
- _Thread_Delay_ended,
- _Thread_Executing->Object.id,
- NULL
- );
- _Watchdog_Insert_seconds(
- &_Thread_Executing->Timer,
- seconds - _TOD_Seconds_since_epoch
- );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Initialize_user_tasks
- *
- * This routine creates and starts all configured user
- * initialzation threads.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _RTEMS_tasks_Initialize_user_tasks( void )
-{
- unsigned32 index;
- unsigned32 maximum;
- rtems_id id;
- rtems_status_code return_value;
- rtems_initialization_tasks_table *user_tasks;
-
- /*
- * NOTE: This is slightly different from the Ada implementation.
- */
-
- user_tasks = _RTEMS_tasks_User_initialization_tasks;
- maximum = _RTEMS_tasks_Number_of_initialization_tasks;
-
- if ( !user_tasks || maximum == 0 )
- return;
-
- for ( index=0 ; index < maximum ; index++ ) {
- return_value = rtems_task_create(
- user_tasks[ index ].name,
- user_tasks[ index ].initial_priority,
- user_tasks[ index ].stack_size,
- user_tasks[ index ].mode_set,
- user_tasks[ index ].attribute_set,
- &id
- );
-
- if ( !rtems_is_status_successful( return_value ) )
- _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, TRUE, return_value );
-
- return_value = rtems_task_start(
- id,
- user_tasks[ index ].entry_point,
- user_tasks[ index ].argument
- );
-
- if ( !rtems_is_status_successful( return_value ) )
- _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, TRUE, return_value );
- }
-}
-
diff --git a/c/src/exec/rtems/src/timer.c b/c/src/exec/rtems/src/timer.c
deleted file mode 100644
index 9d04686d40..0000000000
--- a/c/src/exec/rtems/src/timer.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Timer Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/timer.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
-
-/*PAGE
- *
- * _Timer_Manager_initialization
- *
- * This routine initializes all timer manager related data structures.
- *
- * Input parameters:
- * maximum_timers - number of timers to initialize
- *
- * Output parameters: NONE
- */
-
-void _Timer_Manager_initialization(
- unsigned32 maximum_timers
-)
-{
- _Objects_Initialize_information(
- &_Timer_Information,
- OBJECTS_RTEMS_TIMERS,
- FALSE,
- maximum_timers,
- sizeof( Timer_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-}
-
-/*PAGE
- *
- * rtems_timer_create
- *
- * This directive creates a timer and performs some initialization.
- *
- * Input parameters:
- * name - timer name
- * id - pointer to timer id
- *
- * Output parameters:
- * id - timer id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_create(
- rtems_name name,
- Objects_Id *id
-)
-{
- Timer_Control *the_timer;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- _Thread_Disable_dispatch(); /* to prevent deletion */
-
- the_timer = _Timer_Allocate();
-
- if ( !the_timer ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- the_timer->the_class = TIMER_DORMANT;
-
- _Objects_Open( &_Timer_Information, &the_timer->Object, &name );
-
- *id = the_timer->Object.id;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_timer_ident
- *
- * This directive returns the system ID associated with
- * the timer name.
- *
- * Input parameters:
- * name - user defined message queue name
- * id - pointer to timer id
- *
- * Output parameters:
- * *id - message queue id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id(
- &_Timer_Information,
- &name,
- OBJECTS_SEARCH_LOCAL_NODE,
- id
- );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_timer_cancel
- *
- * This directive allows a thread to cancel a timer.
- *
- * Input parameters:
- * id - timer id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_cancel(
- Objects_Id id
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
- (void) _Watchdog_Remove( &the_timer->Ticker );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_timer_delete
- *
- * This directive allows a thread to delete a timer.
- *
- * Input parameters:
- * id - timer id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_delete(
- Objects_Id id
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- _Objects_Close( &_Timer_Information, &the_timer->Object );
- (void) _Watchdog_Remove( &the_timer->Ticker );
- _Timer_Free( the_timer );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_timer_fire_after
- *
- * This directive allows a thread to start a timer.
- *
- * Input parameters:
- * id - timer id
- * ticks - interval until routine is fired
- * routine - routine to schedule
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_fire_after(
- Objects_Id id,
- rtems_interval ticks,
- rtems_timer_service_routine_entry routine,
- void *user_data
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
-
- if ( ticks == 0 )
- return RTEMS_INVALID_NUMBER;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- (void) _Watchdog_Remove( &the_timer->Ticker );
- the_timer->the_class = TIMER_INTERVAL;
- _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
- _Watchdog_Insert_ticks( &the_timer->Ticker, ticks );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_timer_fire_when
- *
- * This directive allows a thread to start a timer.
- *
- * Input parameters:
- * id - timer id
- * wall_time - time of day to fire timer
- * routine - routine to schedule
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_fire_when(
- Objects_Id id,
- rtems_time_of_day *wall_time,
- rtems_timer_service_routine_entry routine,
- void *user_data
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
- rtems_interval seconds;
-
- if ( !_TOD_Is_set )
- return RTEMS_NOT_DEFINED;
-
- if ( !_TOD_Validate( wall_time ) )
- return RTEMS_INVALID_CLOCK;
-
- seconds = _TOD_To_seconds( wall_time );
- if ( seconds <= _TOD_Seconds_since_epoch )
- return RTEMS_INVALID_CLOCK;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- (void) _Watchdog_Remove( &the_timer->Ticker );
- the_timer->the_class = TIMER_TIME_OF_DAY;
- _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
- _Watchdog_Insert_seconds(
- &the_timer->Ticker,
- seconds - _TOD_Seconds_since_epoch
- );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_timer_reset
- *
- * This directive allows a thread to reset a timer.
- *
- * Input parameters:
- * id - timer id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_reset(
- Objects_Id id
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- if ( _Timer_Is_interval_class( the_timer->the_class ) ) {
- _Watchdog_Reset( &the_timer->Ticker );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_NOT_DEFINED;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
diff --git a/c/src/exec/sapi/Makefile.in b/c/src/exec/sapi/Makefile.in
deleted file mode 100644
index 0ef0ca0e76..0000000000
--- a/c/src/exec/sapi/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=headers $(INLINE) optman src
diff --git a/c/src/exec/sapi/headers/Makefile.in b/c/src/exec/sapi/headers/Makefile.in
deleted file mode 100644
index 109bb18c44..0000000000
--- a/c/src/exec/sapi/headers/Makefile.in
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_PIECES= config directives extension fatal init io mptables
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-# H_FILES that get installed externally
-EXTERNAL_H_PIECES = confdefs
-EXTERNAL_H_FILES=$(EXTERNAL_H_PIECES:%=$(srcdir)/%.h)
-
-SRCS=$(H_FILES) $(EXTERNAL_H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS) $(ARCH) $(PROJECT_INCLUDE)/rtems/sptables.h
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/
- $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
-
-$(PROJECT_INCLUDE)/rtems/sptables.h: $(ARCH)/sptables.h-tmp
- $(INSTALL) -m 444 $(ARCH)/sptables.h-tmp $@
-
-$(ARCH)/sptables.h-tmp: $(srcdir)/sptables.h
- $(SED) -e 's?REPLACE_THIS_WITH_THE_BSP?$(RTEMS_BSP)?' \
- < $< >$(ARCH)/sptables.h-tmp
-
diff --git a/c/src/exec/sapi/headers/README b/c/src/exec/sapi/headers/README
deleted file mode 100644
index 5fcc0d14c7..0000000000
--- a/c/src/exec/sapi/headers/README
+++ /dev/null
@@ -1,135 +0,0 @@
-#
-# $Id$
-#
-
-Configuring a System Using the Template in confdefs.h
-=====================================================
-
-The file confdefs.h is a Configuration Template file which can be
-used to greatly simplify the creation and maintenance of RTEMS
-Configuration Tables. The basic concepts are:
-
- + confdefs.h provides defaults for all configuration parameters
-
- + applications specify only those values they wish to override
-
- + confdefs.h can be the only file which knows the precise layout
- of the RTEMS Configuration Tables.
-
-The Configuration Template setup is used by all RTEMS tests to
-simplify the maintenance of the tests.
-
-Here is the section from the system.h file from test tm21 from
-the Timing Test Suite:
-
- /* configuration information */
-
- #define CONFIGURE_TMTEST
-
- #define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
- #define CONFIGURE_TEST_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
-
- #include <confdefs.h>
-
-
-The above example overrides a number of the configuration parameters.
-It informs the template that it is a member of the Timing Suite,
-requires a console and timer driver, and that it needs 102 tasks,
-100 timers, 100 semaphores, 100 message queues, 100 partitions,
-100 regions, 100 ports, and 100 periods. By default, the test
-would have gotten no drivers, 10 tasks, and no other RTEMS objects.
-
-The following shows the configuration tables generated by the
-template by default.
-
-
-#include <bsp.h>
-
-#define NULL_DRIVER_TABLE_ENTRY \
- { NULL, NULL, NULL, NULL, NULL, NULL }
-
-rtems_driver_address_table Device_drivers[] = {
-#ifdef CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
- CONSOLE_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
- CLOCK_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER
- STUB_DRIVER_TABLE_ENTRY,
-#endif
- NULL_DRIVER_TABLE_ENTRY,
-};
-
-rtems_initialization_tasks_table Initialization_tasks[] = {
- { rtems_build_name( 'U', 'I', '1', ' ' ), /* init task name */
- RTEMS_MINIMUM_STACK_SIZE, /* init task stack size */
- 1, /* init task priority */
- RTEMS_DEFAULT_ATTRIBUTES, /* init task attributes */
- Init, /* init task entry point */
- RTEMS_NO_PREEMPT, /* init task initial mode */
- 0 /* init task argument list */
- }
-};
-
-#ifdef CONFIGURE_MPTEST
-/*
- * NODE_NUMBER is assumed to be set on the compile line.
- */
-
-rtems_multiprocessing_table Multiprocessing_configuration = {
- NODE_NUMBER, /* local node number */
- 2, /* maximum # nodes in system */
- 32, /* maximum # global objects */
- 32, /* maximum # proxies */
- &MPCI_table /* pointer to MPCI config table */
-};
-#endif
-
-/*
- * CONFIGURE_EXECUTIVE_RAM_SIZE is a rough guess based on the number of
- * tasks in the system plus enough extra to get a whole 64K extra.
- *
- * The NULL address for the workspace area is assumed to be assigned
- * at startup time by the BSP.
- */
-
-rtems_configuration_table Configuration = {
- NULL, /* executive RAM work area */
- CONFIGURE_EXECUTIVE_RAM_SIZE, /* executive RAM size */
- 10, /* maximum # tasks */
- 0, /* maximum # timers */
- 0, /* maximum # semaphores */
- 0, /* maximum # message queues */
- 0, /* maximum # messages */
- 0, /* maximum # partitions */
- 0, /* maximum # regions */
- 0, /* maximum # dp memory areas */
- 0, /* maximum # periods */
- 0, /* maximum # user extensions */
- RTEMS_MILLISECONDS_TO_MICROSECONDS(10), /* # us in a tick */
- 50, /* # ticks in a timeslice */
- sizeof (Initialization_tasks) / sizeof(rtems_initialization_tasks_table),
- /* number of init tasks */
- Initialization_tasks, /* init task(s) table */
- sizeof (Device_drivers) / sizeof(rtems_driver_address_table),
- /* number of device drivers */
- Device_drivers, /* pointer to driver address table */
- NULL, /* pointer to initial extensions */
-#ifdef CONFIGURE_MPTEST
- &Multiprocessing_configuration
-#else
- NULL /* ptr to MP config table */
-#endif
-};
diff --git a/c/src/exec/sapi/headers/confdefs.h b/c/src/exec/sapi/headers/confdefs.h
deleted file mode 100644
index e31218ac0d..0000000000
--- a/c/src/exec/sapi/headers/confdefs.h
+++ /dev/null
@@ -1,656 +0,0 @@
-/* confdefs.h
- *
- * This include file contains the configuration table template that will
- * be used by the single processor tests to define its default configuration
- * parameters.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __CONFIGURATION_TEMPLATE_h
-#define __CONFIGURATION_TEMPLATE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern rtems_initialization_tasks_table Initialization_tasks[];
-extern rtems_driver_address_table Device_drivers[];
-extern rtems_configuration_table Configuration;
-extern rtems_multiprocessing_table Multiprocessing_configuration;
-#ifdef RTEMS_POSIX_API
-extern posix_api_configuration_table Configuration_POSIX_API;
-#endif
-
-/*
- * RTEMS C Library and Newlib support
- *
- * NOTE: This ends up defining these even when newlib is not used.
- */
-
-#define CONFIGURE_NEWLIB_EXTENSION 1
-#define CONFIGURE_MALLOC_REGION 1
-
-#ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
-#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
-#endif
-
-#define CONFIGURE_LIBIO_SEMAPHORES \
- (CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS + 1)
-
-#ifdef CONFIGURE_INIT
-unsigned32 rtems_libio_number_iops = CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS;
-#endif
-
-/*
- * Stack Checker Requirements
- */
-
-#ifdef STACK_CHECKER_ON
-#define CONFIGURE_STACK_CHECKER_EXTENSION 1
-#else
-#define CONFIGURE_STACK_CHECKER_EXTENSION 0
-#endif
-
-/*
- * Interrupt Stack Space
- */
-
-#if (CPU_ALLOCATE_INTERRUPT_STACK == 0)
-#define CONFIGURE_INTERRUPT_STACK_MEMORY 0
-#else
- #ifndef CONFIGURE_INTERRUPT_STACK_MEMORY
- #define CONFIGURE_INTERRUPT_STACK_MEMORY RTEMS_MINIMUM_STACK_SIZE
- #else
- #define CONFIGURE_INTERRUPT_STACK_MEMORY 0
- #endif
-#endif
-
-/*
- * Default User Initialization Task Table. This table guarantees that
- * one user initialization table is defined.
- */
-
-#ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE
-
-/*
- * The user is defining their own table information and setting the
- * appropriate variables.
- */
-
-#else
-
-#ifndef CONFIGURE_INIT_TASK_NAME
-#define CONFIGURE_INIT_TASK_NAME rtems_build_name( 'U', 'I', '1', ' ' )
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_STACK_SIZE
-#define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_PRIORITY
-#define CONFIGURE_INIT_TASK_PRIORITY 1
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_ATTRIBUTES
-#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_ENTRY_POINT
-#define CONFIGURE_INIT_TASK_ENTRY_POINT Init
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_INITIAL_MODES
-#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_ARGUMENTS
-#define CONFIGURE_INIT_TASK_ARGUMENTS 0
-#endif
-
-#ifdef CONFIGURE_INIT
-rtems_initialization_tasks_table Initialization_tasks[] = {
- { CONFIGURE_INIT_TASK_NAME,
- CONFIGURE_INIT_TASK_STACK_SIZE,
- CONFIGURE_INIT_TASK_PRIORITY,
- CONFIGURE_INIT_TASK_ATTRIBUTES,
- CONFIGURE_INIT_TASK_ENTRY_POINT,
- CONFIGURE_INIT_TASK_INITIAL_MODES,
- CONFIGURE_INIT_TASK_ARGUMENTS
- }
-};
-#endif
-
-#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
-
-#define CONFIGURE_INIT_TASK_TABLE_SIZE \
- sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
-
-#endif /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */
-
-#else /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */
-
-#define CONFIGURE_INIT_TASK_TABLE NULL
-#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
-
-#endif
-
-/*
- * Default Device Driver Table. Each driver needed by the test is explicitly
- * choosen by that test. There is always a null driver entry.
- */
-
-#define NULL_DRIVER_TABLE_ENTRY \
- { NULL, NULL, NULL, NULL, NULL, NULL }
-
-#ifdef CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-#include <timerdrv.h>
-#endif
-
-#ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER
-#include <stubdrv.h>
-#endif
-
-#ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
-
-#ifdef CONFIGURE_INIT
-rtems_driver_address_table Device_drivers[] = {
-#ifdef CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
- CONSOLE_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
- CLOCK_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER
- STUB_DRIVER_TABLE_ENTRY,
-#endif
- NULL_DRIVER_TABLE_ENTRY
-};
-#endif
-
-#endif /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */
-
-/*
- * Default the number of devices per device driver. This value may be
- * overridden by the user.
- */
-
-#ifndef CONFIGURE_HAS_OWN_NUMBER_OF_DEVICES
-
-#ifndef CONFIGURE_MAXIMUM_DEVICES
-#define CONFIGURE_MAXIMUM_DEVICES 20
-#endif
-
-#endif /* CONFIGURE_HAS_OWN_NUMBER_OF_DEVICES */
-
-/*
- * Default Configuration Table. This table contains the most values set in
- * the RTEMS Test Suite. Each value may be overridden within each test to
- * customize the environment.
- */
-
-#ifdef CONFIGURE_MPTEST
-#ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
-
-#ifndef CONFIGURE_MP_NODE_NUMBER
-#define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER
-#endif
-
-#ifndef CONFIGURE_MP_MAXIMUM_NODES
-#define CONFIGURE_MP_MAXIMUM_NODES 2
-#endif
-
-#ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
-#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32
-#endif
-
-#ifndef CONFIGURE_MP_MAXIMUM_PROXIES
-#define CONFIGURE_MP_MAXIMUM_PROXIES 32
-#endif
-
-#ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
-#include <mpci.h>
-#define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table
-#endif
-
-#ifdef CONFIGURE_INIT
-rtems_multiprocessing_table Multiprocessing_configuration = {
- CONFIGURE_MP_NODE_NUMBER, /* local node number */
- CONFIGURE_MP_MAXIMUM_NODES, /* maximum # nodes in system */
- CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS, /* maximum # global objects */
- CONFIGURE_MP_MAXIMUM_PROXIES, /* maximum # proxies */
- CONFIGURE_MP_MPCI_TABLE_POINTER /* pointer to MPCI config table */
-};
-#endif
-
-#define CONFIGURE_MULTIPROCESSING_TABLE &Multiprocessing_configuration
-
-#endif /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */
-
-#else
-
-#define CONFIGURE_MULTIPROCESSING_TABLE NULL
-
-#endif /* CONFIGURE_MPTEST */
-
-/*
- * Default Configuration Table. This table contains the most values set in
- * the RTEMS Test Suite. Each value may be overridden within each test to
- * customize the environment.
- */
-
-#ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE
-
-#ifndef CONFIGURE_EXECUTIVE_RAM_WORK_AREA
-#define CONFIGURE_EXECUTIVE_RAM_WORK_AREA NULL
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_TASKS
-#define CONFIGURE_MAXIMUM_TASKS 10
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_TIMERS
-#define CONFIGURE_MAXIMUM_TIMERS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_SEMAPHORES
-#define CONFIGURE_MAXIMUM_SEMAPHORES 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_PARTITIONS
-#define CONFIGURE_MAXIMUM_PARTITIONS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_REGIONS
-#define CONFIGURE_MAXIMUM_REGIONS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_PORTS
-#define CONFIGURE_MAXIMUM_PORTS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_PERIODS
-#define CONFIGURE_MAXIMUM_PERIODS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
-#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0
-#endif
-
-#ifndef CONFIGURE_MICROSECONDS_PER_TICK
-#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(10)
-#endif
-
-#ifndef CONFIGURE_TICKS_PER_TIMESLICE
-#define CONFIGURE_TICKS_PER_TIMESLICE 50
-#endif
-
-/*
- * Initial Extension Set
- */
-
-#ifdef CONFIGURE_INIT
-#ifdef STACK_CHECKER_ON
-#include <stackchk.h>
-#endif
-
-rtems_extensions_table Configuration_Initial_Extensions[] = {
-#ifdef CONFIGURE_INITIAL_EXTENSIONS
- CONFIGURE_INITIAL_EXTENSIONS,
-#endif
-#ifdef STACK_CHECKER_ON
- STACK_CHECKER_EXTENSION,
-#endif
- { NULL, NULL, NULL, NULL, NULL, NULL, NULL }
-};
-
-#define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \
- ((sizeof(Configuration_Initial_Extensions) / \
- sizeof(rtems_extensions_table)) - 1)
-
-#endif
-
-/*
- * POSIX API Configuration Parameters
- */
-
-#ifdef RTEMS_POSIX_API
-
-#include <sys/types.h>
-#include <rtems/posix/cond.h>
-#include <rtems/posix/mutex.h>
-#include <rtems/posix/key.h>
-#include <rtems/posix/psignal.h>
-#include <rtems/posix/threadsup.h>
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_KEYS
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
-#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0
-#endif
-
-#ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
-
-/*
- * The user is defining their own table information and setting the
- * appropriate variables.
- */
-
-#else
-
-#ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
-#define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init
-#endif
-
-#ifdef CONFIGURE_INIT
-posix_initialization_threads_table POSIX_Initialization_threads[] = {
- { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT }
-};
-#endif
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME POSIX_Initialization_threads
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
- sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \
- sizeof(posix_initialization_threads_table)
-
-#endif /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
-
-#else /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0
-
-#endif
-
-#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \
- ( \
- sizeof (POSIX_API_Control) + \
- (sizeof (void *) * (CONFIGURE_GNAT_KEYS + CONFIGURE_MAXIMUM_POSIX_KEYS)) \
- )
-
-#define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \
- ((_mutexes) * \
- ( sizeof(POSIX_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condition_variables) \
- ((_condition_variables) * \
- ( sizeof(POSIX_Condition_variables_Control) + \
- CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \
- ((_keys) * \
- ( sizeof(POSIX_Keys_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
- ((_queued_signals) * \
- ( sizeof(POSIX_signals_Siginfo_node) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-
-
-#define CONFIGURE_MEMORY_FOR_POSIX \
- ( \
- CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \
- CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
- CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \
- CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \
- CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
- CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) \
- )
-
-
-#else
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 0
-#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0
-#define CONFIGURE_MEMORY_FOR_POSIX 0
-
-#endif /* RTEMS_POSIX_API */
-
-/*
- * Calculate the RAM size based on the maximum number of objects configured.
- * The model is to estimate the memory required for each configured item,
- * sum the memory requirements and insure that there is at least 32K greater
- * than that for things not directly addressed such as:
- *
- * + stacks greater than minimum size
- * + FP contexts
- * + API areas (should be optional)
- * + messages
- * + object name and local pointer table overhead
- * + per node memory requirements
- * + executive fixed requirements (including at least internal threads
- * and the Ready chains)
- *
- * NOTE: Eventually this should take into account some of the above.
- * Basically, this is a "back of the envelope" estimate for
- * memory requirements. It could be more accurate.
- */
-
-#ifndef CONFIGURE_EXECUTIVE_RAM_SIZE
-
-#define CONFIGURE_OBJECT_TABLE_STUFF \
- ( sizeof(Objects_Control *) + sizeof(rtems_name *) + sizeof(rtems_name) )
-
-#define CONFIGURE_MEMORY_FOR_TASKS(_tasks) \
- (((_tasks) + 1 ) * \
- ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \
- STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \
- CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \
- CONFIGURE_OBJECT_TABLE_STUFF)) \
- )
-
-#define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \
- ((_timers) * ( sizeof(Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \
- ((_semaphores) * \
- ( sizeof(Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \
- ( (_queues) * \
- ( sizeof(Message_queue_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \
- ( (_partitions) * \
- ( sizeof(Partition_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \
- ( (_regions) * \
- ( sizeof(Region_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_PORTS(_ports) \
- ( (_ports) * \
- ( sizeof(Dual_ported_memory_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \
- ( (_periods) * \
- ( sizeof(Rate_monotonic_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \
- ( (_extensions) * \
- ( sizeof(Extension_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_DEVICES(_devices) \
- (((_devices) + 1) * ( sizeof(rtems_driver_name_t) ) )
-
-#ifdef CONFIGURE_MPTEST
-
-#ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
-
-#define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \
- ( ((_proxies) + 1) * ( sizeof(Thread_Proxy_control) ) )
-
-#define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \
- ((_global_objects) * ( sizeof(Objects_MP_Control) ) )
-
-#define CONFIGURE_MEMORY_FOR_MP \
- ( CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \
- CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \
- CONFIGURE_MEMORY_FOR_TASKS(1) \
- )
-
-#endif /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */
-
-#else
-
-#define CONFIGURE_MEMORY_FOR_MP 0
-
-#endif
-
-#ifndef CONFIGURE_MEMORY_OVERHEAD
-#define CONFIGURE_MEMORY_OVERHEAD 0
-#endif
-
-#ifndef CONFIGURE_EXTRA_TASK_STACKS
-#define CONFIGURE_EXTRA_TASK_STACKS 0
-#endif
-
-#define CONFIGURE_MEMORY_FOR_SYSTEM_OVEREHAD \
- ( CONFIGURE_MEMORY_FOR_TASKS(1) + /* IDLE */ \
- (256 * 12) + /* Ready chains */ \
- 256 + /* name/ptr table overhead */ \
- CONFIGURE_INTERRUPT_STACK_MEMORY /* interrupt stack */ \
- )
-
-#define CONFIGURE_EXECUTIVE_RAM_SIZE \
-(( CONFIGURE_MEMORY_FOR_POSIX + \
- CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS + \
- CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS ) + \
- CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \
- CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \
- CONFIGURE_LIBIO_SEMAPHORES) + \
- CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \
- CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \
- CONFIGURE_MEMORY_FOR_REGIONS( \
- CONFIGURE_MAXIMUM_REGIONS + CONFIGURE_MALLOC_REGION ) + \
- CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \
- CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \
- CONFIGURE_MEMORY_FOR_USER_EXTENSIONS( \
- CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION + \
- CONFIGURE_STACK_CHECKER_EXTENSION ) + \
- CONFIGURE_MEMORY_FOR_DEVICES(CONFIGURE_MAXIMUM_DEVICES) + \
- CONFIGURE_MEMORY_FOR_MP + \
- CONFIGURE_MEMORY_FOR_SYSTEM_OVEREHAD + \
- (((CONFIGURE_MEMORY_OVERHEAD)+1) * 1024) + \
- (CONFIGURE_EXTRA_TASK_STACKS) + (CONFIGURE_ADA_TASKS_STACK) \
-) & 0xfffffc00)
-#endif
-
-#ifdef CONFIGURE_GNAT_RTEMS
-#define CONFIGURE_GNAT_MUTEXES 10
-#define CONFIGURE_GNAT_KEYS 1
-
-/* 20 are required to run all tests in the ACVC */
-#ifndef CONFIGURE_MAXIMUM_ADA_TASKS
-#define CONFIGURE_MAXIMUM_ADA_TASKS 20
-#endif
-
-/* This is the number of non-Ada tasks which invoked Ada code. */
-#ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
-#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
-#endif
-
-/* Ada tasks are allocated twice the minimum stack space */
-#define CONFIGURE_ADA_TASKS_STACK \
- (CONFIGURE_MAXIMUM_ADA_TASKS * (RTEMS_MINIMUM_STACK_SIZE + (6 * 1024)))
-
-#else
-#define CONFIGURE_GNAT_MUTEXES 0
-#define CONFIGURE_GNAT_KEYS 0
-#define CONFIGURE_MAXIMUM_ADA_TASKS 0
-#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
-#define CONFIGURE_ADA_TASKS_STACK 0
-#endif
-
-
-#ifdef CONFIGURE_INIT
-
-rtems_api_configuration_table Configuration_RTEMS_API = {
- CONFIGURE_MAXIMUM_TASKS,
- CONFIGURE_MAXIMUM_TIMERS,
- CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES,
- CONFIGURE_MAXIMUM_MESSAGE_QUEUES,
- CONFIGURE_MAXIMUM_PARTITIONS,
- CONFIGURE_MAXIMUM_REGIONS + CONFIGURE_MALLOC_REGION,
- CONFIGURE_MAXIMUM_PORTS,
- CONFIGURE_MAXIMUM_PERIODS,
- CONFIGURE_INIT_TASK_TABLE_SIZE,
- CONFIGURE_INIT_TASK_TABLE
-};
-
-#ifdef RTEMS_POSIX_API
-posix_api_configuration_table Configuration_POSIX_API = {
- CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS,
- CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES +
- CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS,
- CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES +
- CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS,
- CONFIGURE_MAXIMUM_POSIX_KEYS + CONFIGURE_GNAT_KEYS,
- CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS,
- CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE,
- CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME
-};
-#endif
-
-rtems_configuration_table Configuration = {
- CONFIGURE_EXECUTIVE_RAM_WORK_AREA,
- CONFIGURE_EXECUTIVE_RAM_SIZE,
- CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION +
- CONFIGURE_STACK_CHECKER_EXTENSION,
- CONFIGURE_MICROSECONDS_PER_TICK,
- CONFIGURE_TICKS_PER_TIMESLICE,
- CONFIGURE_MAXIMUM_DEVICES,
- sizeof (Device_drivers)/
- sizeof(rtems_driver_address_table), /* number of device drivers */
- Device_drivers, /* pointer to driver table */
- CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of initial extensions */
- Configuration_Initial_Extensions, /* pointer to initial extensions */
- CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */
- &Configuration_RTEMS_API, /* pointer to RTEMS API config */
-#ifdef RTEMS_POSIX_API
- &Configuration_POSIX_API /* pointer to POSIX API config */
-#else
- NULL /* pointer to POSIX API config */
-#endif
-};
-#endif
-
-#endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/headers/config.h b/c/src/exec/sapi/headers/config.h
deleted file mode 100644
index e3ae50d7d1..0000000000
--- a/c/src/exec/sapi/headers/config.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* config.h
- *
- * This include file contains the table of user defined configuration
- * parameters.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CONFIGURATION_h
-#define __RTEMS_CONFIGURATION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This is kind of kludgy but it allows targets to totally ignore the
- * POSIX API safely.
- */
-
-#ifdef RTEMS_POSIX_API
-#include <rtems/posix/config.h>
-#else
-
-typedef void *posix_api_configuration_table;
-#endif
-
-#include <rtems/rtems/config.h>
-
-/* XXX <rtems/rtems/config.h> should cover these
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/tasks.h>
-*/
-
-#include <rtems/extension.h>
-#include <rtems/io.h>
-#include <rtems/score/mpci.h>
-
-/*
- * The following records define the Multiprocessor Configuration
- * Table. This table defines the multiprocessor system
- * characteristics which must be known by RTEMS in a multiprocessor
- * system.
- */
-
-typedef struct {
- unsigned32 node; /* local node number */
- unsigned32 maximum_nodes; /* maximum # nodes in system */
- unsigned32 maximum_global_objects; /* maximum # global objects */
- unsigned32 maximum_proxies; /* maximum # proxies */
- MPCI_Control *User_mpci_table; /* pointer to MPCI table */
-} rtems_multiprocessing_table;
-
-/*
- * The following records define the Configuration Table. The
- * information contained in this table is required in all
- * RTEMS systems, whether single or multiprocessor. This
- * table primarily defines the following:
- *
- * + location and size of the RTEMS Workspace
- * + microseconds per clock tick
- * + clock ticks per task timeslice
- * + required number of each object type for each API configured
- */
-
-typedef struct {
- void *work_space_start;
- unsigned32 work_space_size;
- unsigned32 maximum_extensions;
- unsigned32 microseconds_per_tick;
- unsigned32 ticks_per_timeslice;
- unsigned32 maximum_devices;
- unsigned32 number_of_device_drivers;
- rtems_driver_address_table *Device_driver_table;
- unsigned32 number_of_initial_extensions;
- rtems_extensions_table *User_extension_table;
- rtems_multiprocessing_table *User_multiprocessing_table;
- rtems_api_configuration_table *RTEMS_api_configuration;
- posix_api_configuration_table *POSIX_api_configuration;
-} rtems_configuration_table;
-
-/*
- * The following are provided strictly for the convenience of
- * the user. They are not used in RTEMS itself.
- */
-
-SAPI_EXTERN rtems_configuration_table *_Configuration_Table;
-SAPI_EXTERN rtems_multiprocessing_table *_Configuration_MP_table;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/headers/directives.h b/c/src/exec/sapi/headers/directives.h
deleted file mode 100644
index 785ab0760e..0000000000
--- a/c/src/exec/sapi/headers/directives.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* directives.h
- *
- * The following definitions are the directive numbers used
- * in the assembly interface.
- *
- * COPYRIGHT (c) 1989-1997
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_DIRECTIVES_h
-#define __RTEMS_DIRECTIVES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define RTEMS_INITIALIZE_EXECUTIVE 0
-#define RTEMS_INITIALIZE_EXECUTIVE_EARLY 1
-#define RTEMS_INITIALIZE_EXECUTIVE_LATE 2
-#define RTEMS_SHUTDOWN_EXECUTIVE 3
-#define RTEMS_TASKS_CREATE 4
-#define RTEMS_TASKS_NAME_TO_ID 5
-#define RTEMS_TASKS_START 6
-#define RTEMS_TASKS_RESTART 7
-#define RTEMS_TASKS_DELETE 8
-#define RTEMS_TASKS_SUSPEND 9
-#define RTEMS_TASKS_RESUME 10
-#define RTEMS_TASKS_SET_PRIORITY 11
-#define RTEMS_TASKS_MODE 12
-#define RTEMS_TASKS_GET_NOTE 13
-#define RTEMS_TASKS_SET_NOTE 14
-#define RTEMS_TASKS_WAKE_AFTER 15
-#define RTEMS_TASKS_WAKE_WHEN 16
-#define RTEMS_INTERRUPT_CATCH 17
-#define RTEMS_CLOCK_SET 18
-#define RTEMS_CLOCK_GET 19
-#define RTEMS_CLOCK_TICK 20
-#define RTEMS_EXTENSION_CREATE 21
-#define RTEMS_EXTENSION_NAME_TO_ID 22
-#define RTEMS_EXTENSION_DELETE 23
-#define RTEMS_TIMER_CREATE 24
-#define RTEMS_TIMER_NAME_TO_ID 25
-#define RTEMS_TIMER_CANCEL 26
-#define RTEMS_TIMER_DELETE 27
-#define RTEMS_TIMER_FIRE_AFTER 28
-#define RTEMS_TIMER_FIRE_WHEN 29
-#define RTEMS_TIMER_RESET 30
-#define RTEMS_SEMAPHORE_CREATE 31
-#define RTEMS_SEMAPHORE_NAME_TO_ID 32
-#define RTEMS_SEMAPHORE_DELETE 33
-#define RTEMS_SEMAPHORE_OBTAIN 34
-#define RTEMS_SEMAPHORE_RELEASE 35
-#define RTEMS_MESSAGE_QUEUE_CREATE 36
-#define RTEMS_MESSAGE_QUEUE_NAME_TO_ID 37
-#define RTEMS_MESSAGE_QUEUE_DELETE 38
-#define RTEMS_MESSAGE_QUEUE_SEND 39
-#define RTEMS_MESSAGE_QUEUE_URGENT 40
-#define RTEMS_MESSAGE_QUEUE_BROADCAST 41
-#define RTEMS_MESSAGE_QUEUE_RECEIVE 42
-#define RTEMS_MESSAGE_QUEUE_FLUSH 43
-#define RTEMS_EVENT_SEND 44
-#define RTEMS_EVENT_RECEIVE 45
-#define RTEMS_SIGNAL_CATCH 46
-#define RTEMS_SIGNAL_SEND 47
-#define RTEMS_PARTITION_CREATE 48
-#define RTEMS_PARTITION_NAME_TO_ID 49
-#define RTEMS_PARTITION_DELETE 50
-#define RTEMS_PARTITION_GET_BUFFER 51
-#define RTEMS_PARTITION_RETURN_BUFFER 52
-#define RTEMS_REGION_CREATE 53
-#define RTEMS_REGION_EXTEND 54
-#define RTEMS_REGION_NAME_TO_ID 55
-#define RTEMS_REGION_DELETE 56
-#define RTEMS_REGION_GET_SEGMENT_SIZE 57
-#define RTEMS_REGION_GET_SEGMENT 58
-#define RTEMS_REGION_RETURN_SEGMENT 59
-#define RTEMS_DUAL_PORTED_MEMORY_CREATE 60
-#define RTEMS_DUAL_PORTED_MEMORY_NAME_TO_ID 61
-#define RTEMS_DUAL_PORTED_MEMORY_DELETE 62
-#define RTEMS_DUAL_PORTED_MEMORY_EXTERNAL_TO_INTERNAL 63
-#define RTEMS_DUAL_PORTED_MEMORY_INTERNAL_TO_EXTERNAL 64
-#define RTEMS_IO_INITIALIZE 65
-#define RTEMS_IO_REGISTER_NAME 66
-#define RTEMS_IO_LOOKUP_NAME 67
-#define RTEMS_IO_OPEN 68
-#define RTEMS_IO_CLOSE 69
-#define RTEMS_IO_READ 70
-#define RTEMS_IO_WRITE 71
-#define RTEMS_IO_CONTROL 72
-#define RTEMS_FATAL_ERROR_OCCURRED 73
-#define RTEMS_RATE_MONOTONIC_CREATE 74
-#define RTEMS_RATE_MONOTONIC_NAME_TO_ID 75
-#define RTEMS_RATE_MONOTONIC_DELETE 76
-#define RTEMS_RATE_MONOTONIC_CANCEL 77
-#define RTEMS_RATE_MONOTONIC_PERIOD 78
-#define RTEMS_MULTIPROCESSING_ANNOUNCE 79
-#define RTEMS_DEBUG_ENABLE 80
-#define RTEMS_DEBUG_DISABLE 81
-
-#define RTEMS_NUMBER_OF_ENTRY_POINTS 82
-
-/*
- * The jump table of entry points into RTEMS directives.
- */
-
-extern const void *_Entry_points[ RTEMS_NUMBER_OF_ENTRY_POINTS ];
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of directives.h */
diff --git a/c/src/exec/sapi/headers/extension.h b/c/src/exec/sapi/headers/extension.h
deleted file mode 100644
index 9b6b21c70e..0000000000
--- a/c/src/exec/sapi/headers/extension.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/* extension.h
- *
- * This include file contains all the constants, structures, and
- * prototypes associated with the User Extension Manager. This manager
- * provides a mechanism for manipulating sets of user-defined extensions.
- *
- * Directives provided are:
- *
- * + create user extension set
- * + get ID of user extension set
- * + delete user extension set
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_EXTENSION_MANAGER_h
-#define __RTEMS_EXTENSION_MANAGER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/userext.h>
-#include <rtems/rtems/status.h> /* XXX */
-#include <rtems/rtems/types.h> /* XXX */
-
-/*
- * Extension related types
- */
-
-typedef User_extensions_routine rtems_extension;
-typedef User_extensions_thread_create_extension rtems_task_create_extension;
-typedef User_extensions_thread_delete_extension rtems_task_delete_extension;
-typedef User_extensions_thread_start_extension rtems_task_start_extension;
-typedef User_extensions_thread_restart_extension rtems_task_restart_extension;
-typedef User_extensions_thread_switch_extension rtems_task_switch_extension;
-typedef User_extensions_thread_post_switch_extension
- rtems_task_post_switch_extension;
-typedef User_extensions_thread_begin_extension rtems_task_begin_extension;
-typedef User_extensions_thread_exitted_extension rtems_task_exitted_extension;
-typedef User_extensions_fatal_extension rtems_fatal_extension;
-
-typedef User_extensions_Table rtems_extensions_table;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-SAPI_EXTERN Objects_Information _Extension_Information;
-
-/*
- * The following records define the control block used to manage
- * each extension.
- */
-
-typedef struct {
- Objects_Control Object;
- User_extensions_Control Extension;
-} Extension_Control;
-
-/*
- * _Extension_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Extension_Manager_initialization(
- unsigned32 maximum_extensions
-);
-
-/*
- * rtems_extension_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_extension_create directive. The
- * extension will have the name name. The entry points of the
- * routines which constitute this extension set are in EXTENSION_TABLE.
- * It returns the id of the created extension in ID.
- */
-
-rtems_status_code rtems_extension_create(
- rtems_name name,
- rtems_extensions_table *extension_table,
- Objects_Id *id
-);
-
-/*
- * rtems_extension_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_extension_ident directive.
- * This directive returns the extension ID associated with name.
- * If more than one extension is named name, then the extension
- * to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_extension_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_extension_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_extension_delete directive. The
- * extension indicated by ID is deleted.
- */
-
-rtems_status_code rtems_extension_delete(
- Objects_Id id
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/extension.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/headers/fatal.h b/c/src/exec/sapi/headers/fatal.h
deleted file mode 100644
index 7f0a7b443a..0000000000
--- a/c/src/exec/sapi/headers/fatal.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* fatal.h
- *
- * This include file contains constants and prototypes related
- * to the Fatal Error Manager. This manager processes all fatal or
- * irrecoverable errors.
- *
- * This manager provides directives to:
- *
- * + announce a fatal error has occurred
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_FATAL_h
-#define __RTEMS_FATAL_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * rtems_fatal_error_occurred
- *
- * DESCRIPTION:
- *
- * This is the routine which implements the rtems_fatal_error_occurred
- * directive. It is invoked when the application or RTEMS
- * determines that a fatal error has occurred.
- */
-
-void volatile rtems_fatal_error_occurred(
- unsigned32 the_error
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/headers/init.h b/c/src/exec/sapi/headers/init.h
deleted file mode 100644
index a4f24d8010..0000000000
--- a/c/src/exec/sapi/headers/init.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* init.h
- *
- * This include file contains all the constants and structures associated
- * with the Initialization Manager. This manager is responsible for
- * initializing RTEMS, creating and starting all configured initialization
- * tasks, invoking the initialization routine for each user-supplied device
- * driver, and initializing the optional multiprocessor layer.
- *
- * This manager provides directives to:
- *
- * + initialize the RTEMS executive
- * + shutdown the RTEMS executive
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_INIT_h
-#define __RTEMS_INIT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-#include <rtems/config.h>
-#include <rtems/rtems/intr.h>
-
-/*
- * The following defines the default Multiprocessing Configuration
- * Table. This table is used in a single processor system.
- */
-
-extern const rtems_multiprocessing_table
- _Initialization_Default_multiprocessing_table;
-
-/*
- * rtems_initialize_executive
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_initialize_executive directive. This
- * directive is invoked at system startup to initialize the RTEMS
- * multitasking environment.
- */
-
-void rtems_initialize_executive(
- rtems_configuration_table *configuration_table,
- rtems_cpu_table *cpu_table
-);
-
-/*
- * rtems_initialize_executive_early
- *
- * DESCRIPTION:
- *
- * This routine implements the early portion of rtems_initialize_executive
- * directive up to the pretasking hook. This directive is invoked at system
- * startup to initialize the RTEMS multitasking environment.
- */
-
-rtems_interrupt_level rtems_initialize_executive_early(
- rtems_configuration_table *configuration_table,
- rtems_cpu_table *cpu_table
-);
-
-/*
- * rtems_initialize_executive_late
- *
- * DESCRIPTION:
- *
- * This routine implements the early portion of rtems_initialize_executive
- * directive up to the pretasking hook. This directive is invoked at system
- * startup to initialize the RTEMS multitasking environment.
- */
-
-void rtems_initialize_executive_late(
- rtems_interrupt_level bsp_level
-);
-
-/*
- * rtems_shutdown_executive
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_shutdown_executive directive. The
- * invocation of this directive results in the RTEMS environment being
- * shutdown and multitasking halted. From the application's perspective,
- * invocation of this directive results in the rtems_initialize_executive
- * directive exitting to the startup code which invoked it.
- */
-
-void rtems_shutdown_executive(
- unsigned32 result
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/headers/io.h b/c/src/exec/sapi/headers/io.h
deleted file mode 100644
index 11b4f812cd..0000000000
--- a/c/src/exec/sapi/headers/io.h
+++ /dev/null
@@ -1,244 +0,0 @@
-/* io.h
- *
- * This include file contains all the constants and structures associated
- * with the Input/Output Manager. This manager provides a well defined
- * mechanism for accessing device drivers and a structured methodology for
- * organizing device drivers.
- *
- * Directives provided are:
- *
- * + initialize a device driver
- * + open a device driver
- * + close a device driver
- * + read from a device driver
- * + write to a device driver
- * + special device services
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_IO_h
-#define __RTEMS_IO_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/status.h>
-
-/*
- *
- * The following defines the types for:
- *
- * + major and minor numbers
- * + the return type of a device driver entry
- * + a pointer to a device driver entry
- * + an entry in the the Device Driver Address Table. Each entry in this
- * table corresponds to an application provided device driver and
- * defines the entry points for that device driver.
- */
-
-typedef unsigned32 rtems_device_major_number;
-typedef unsigned32 rtems_device_minor_number;
-
-typedef rtems_status_code rtems_device_driver;
-
-typedef rtems_device_driver ( *rtems_device_driver_entry )(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
- );
-
-typedef struct {
- rtems_device_driver_entry initialization; /* initialization procedure */
- rtems_device_driver_entry open; /* open request procedure */
- rtems_device_driver_entry close; /* close request procedure */
- rtems_device_driver_entry read; /* read request procedure */
- rtems_device_driver_entry write; /* write request procedure */
- rtems_device_driver_entry control; /* special functions procedure */
-} rtems_driver_address_table;
-
-/*
- * Table for the io device names
- */
-
-typedef struct {
- char *device_name;
- unsigned32 device_name_length;
- rtems_device_major_number major;
- rtems_device_minor_number minor;
-} rtems_driver_name_t;
-
-/*
- * This is the table of device names.
- */
-
-/*
- * The following declare the data required to manage the Driver
- * Address Table and Device Name Table.
- */
-
-SAPI_EXTERN unsigned32 _IO_Number_of_drivers;
-SAPI_EXTERN rtems_driver_address_table *_IO_Driver_address_table;
-SAPI_EXTERN unsigned32 _IO_Number_of_devices;
-SAPI_EXTERN rtems_driver_name_t *_IO_Driver_name_table;
-
-/*
- * _IO_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _IO_Manager_initialization(
- rtems_driver_address_table *driver_table,
- unsigned32 number_of_drivers,
- unsigned32 number_of_devices
-);
-
-/*
- * rtems_io_register_name
- *
- * DESCRIPTION:
- *
- * Associate a name with a driver.
- *
- */
-
-rtems_status_code rtems_io_register_name(
- char *device_name,
- rtems_device_major_number major,
- rtems_device_minor_number minor
-);
-
-
-/*
- * rtems_io_lookup_name
- *
- * DESCRIPTION:
- *
- * Find what driver "owns" this name
- */
-
-rtems_status_code rtems_io_lookup_name(
- const char *name,
- rtems_driver_name_t **device_info
-);
-
-
-/*
- * rtems_io_initialize
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_initialize directive. It is invoked
- * to initialize a device driver or an individual device.
- */
-
-rtems_status_code rtems_io_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_open
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_open directive. It is invoked
- * to open a device.
- */
-
-rtems_status_code rtems_io_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_close
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_close directive. It is invoked
- * to close a device.
- */
-
-rtems_status_code rtems_io_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_read
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_read directive. It is invoked
- * to read from a device.
- */
-
-rtems_status_code rtems_io_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_write
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_write directive. It is invoked
- * to write to a device.
- */
-
-rtems_status_code rtems_io_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_control
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_control directive. It is invoked
- * to perform a device specific operation on a device.
- */
-
-rtems_status_code rtems_io_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * _IO_Initialize_all_drivers
- *
- * DESCRIPTION:
- *
- * This routine initializes all of the device drivers configured
- * in the Device Driver Address Table.
- */
-
-void _IO_Initialize_all_drivers( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/headers/mptables.h b/c/src/exec/sapi/headers/mptables.h
deleted file mode 100644
index 8fdbdfebd2..0000000000
--- a/c/src/exec/sapi/headers/mptables.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mptables.h
- *
- * This include file contains the executive's pre-initialized tables
- * used in a multiprocessor configuration.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MPTABLES_h
-#define __RTEMS_MPTABLES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/headers/sptables.h b/c/src/exec/sapi/headers/sptables.h
deleted file mode 100644
index ed5b4f896e..0000000000
--- a/c/src/exec/sapi/headers/sptables.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/* sptables.h
- *
- * This include file contains the executive's pre-initialized tables
- * used when in a single processor configuration.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SPTABLES_h
-#define __RTEMS_SPTABLES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/config.h>
-
-#include <rtems/debug.h>
-#include <rtems/fatal.h>
-#include <rtems/init.h>
-#include <rtems/io.h>
-#include <rtems/score/sysstate.h>
-
-#include <rtems/rtems/intr.h>
-#include <rtems/rtems/clock.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/rtems/dpmem.h>
-#include <rtems/rtems/event.h>
-#include <rtems/rtems/message.h>
-#include <rtems/rtems/mp.h>
-#include <rtems/rtems/part.h>
-#include <rtems/rtems/ratemon.h>
-#include <rtems/rtems/region.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/rtems/signal.h>
-#include <rtems/rtems/timer.h>
-
-/*
- * This is the default Multiprocessing Configuration Table.
- * It is used in single processor configurations.
- */
-
-const rtems_multiprocessing_table
- _Initialization_Default_multiprocessing_table = {
- 1, /* local node number */
- 1, /* maximum number nodes in system */
- 0, /* maximum number global objects */
- 0, /* maximum number proxies */
- NULL, /* pointer to MPCI address table */
-};
-
-/*
- * This is the version string.
- */
-
-#define RTEMS_VERSION "rtems-4.0.0"
-
-const char _RTEMS_version[] =
- "RTEMS RELEASE " RTEMS_VERSION
- "(" CPU_NAME "/" CPU_MODEL_NAME "/REPLACE_THIS_WITH_THE_BSP)";
-
-
-/*
- * This table is used by the single entry point code.
- */
-
-const void * _Entry_points[ RTEMS_NUMBER_OF_ENTRY_POINTS ] = {
- (void *) rtems_initialize_executive, /* 0 */
- (void *) rtems_initialize_executive_early, /* 1 */
- (void *) rtems_initialize_executive_late, /* 2 */
- (void *) rtems_shutdown_executive, /* 3 */
- (void *) rtems_task_create, /* 4 */
- (void *) rtems_task_ident, /* 5 */
- (void *) rtems_task_start, /* 6 */
- (void *) rtems_task_restart, /* 7 */
- (void *) rtems_task_delete, /* 8 */
- (void *) rtems_task_suspend, /* 9 */
- (void *) rtems_task_resume, /* 10 */
- (void *) rtems_task_set_priority, /* 11 */
- (void *) rtems_task_mode, /* 12 */
- (void *) rtems_task_get_note, /* 13 */
- (void *) rtems_task_set_note, /* 14 */
- (void *) rtems_task_wake_after, /* 15 */
- (void *) rtems_task_wake_when, /* 16 */
- (void *) rtems_interrupt_catch, /* 17 */
- (void *) rtems_clock_set, /* 18 */
- (void *) rtems_clock_get, /* 19 */
- (void *) rtems_clock_tick, /* 20 */
- (void *) rtems_extension_create, /* 21 */
- (void *) rtems_extension_ident, /* 22 */
- (void *) rtems_extension_delete, /* 23 */
- (void *) rtems_timer_create, /* 24 */
- (void *) rtems_timer_ident, /* 25 */
- (void *) rtems_timer_cancel, /* 26 */
- (void *) rtems_timer_delete, /* 27 */
- (void *) rtems_timer_fire_after, /* 28 */
- (void *) rtems_timer_fire_when, /* 29 */
- (void *) rtems_timer_reset, /* 30 */
- (void *) rtems_semaphore_create, /* 31 */
- (void *) rtems_semaphore_ident, /* 32 */
- (void *) rtems_semaphore_delete, /* 33 */
- (void *) rtems_semaphore_obtain, /* 34 */
- (void *) rtems_semaphore_release, /* 35 */
- (void *) rtems_message_queue_create, /* 36 */
- (void *) rtems_message_queue_ident, /* 37 */
- (void *) rtems_message_queue_delete, /* 38 */
- (void *) rtems_message_queue_send, /* 39 */
- (void *) rtems_message_queue_urgent, /* 40 */
- (void *) rtems_message_queue_broadcast, /* 41 */
- (void *) rtems_message_queue_receive, /* 42 */
- (void *) rtems_message_queue_flush, /* 43 */
- (void *) rtems_event_send, /* 44 */
- (void *) rtems_event_receive, /* 45 */
- (void *) rtems_signal_catch, /* 46 */
- (void *) rtems_signal_send, /* 47 */
- (void *) rtems_partition_create, /* 48 */
- (void *) rtems_partition_ident, /* 49 */
- (void *) rtems_partition_delete, /* 50 */
- (void *) rtems_partition_get_buffer, /* 51 */
- (void *) rtems_partition_return_buffer, /* 52 */
- (void *) rtems_region_create, /* 53 */
- (void *) rtems_region_extend, /* 54 */
- (void *) rtems_region_ident, /* 55 */
- (void *) rtems_region_delete, /* 56 */
- (void *) rtems_region_get_segment, /* 57 */
- (void *) rtems_region_get_segment_size, /* 58 */
- (void *) rtems_region_return_segment, /* 59 */
- (void *) rtems_port_create, /* 60 */
- (void *) rtems_port_ident, /* 61 */
- (void *) rtems_port_delete, /* 62 */
- (void *) rtems_port_external_to_internal, /* 63 */
- (void *) rtems_port_internal_to_external, /* 64 */
- (void *) rtems_io_initialize, /* 65 */
- (void *) rtems_io_register_name, /* 66 */
- (void *) rtems_io_lookup_name, /* 67 */
- (void *) rtems_io_open, /* 68 */
- (void *) rtems_io_close, /* 69 */
- (void *) rtems_io_read, /* 70 */
- (void *) rtems_io_write, /* 71 */
- (void *) rtems_io_control, /* 72 */
- (void *) rtems_fatal_error_occurred, /* 73 */
- (void *) rtems_rate_monotonic_create, /* 74 */
- (void *) rtems_rate_monotonic_ident, /* 75 */
- (void *) rtems_rate_monotonic_delete, /* 76 */
- (void *) rtems_rate_monotonic_cancel, /* 77 */
- (void *) rtems_rate_monotonic_period, /* 78 */
- (void *) rtems_multiprocessing_announce, /* 79 */
- (void *) rtems_debug_enable, /* 80 */
- (void *) rtems_debug_disable /* 81 */
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/include/confdefs.h b/c/src/exec/sapi/include/confdefs.h
deleted file mode 100644
index e31218ac0d..0000000000
--- a/c/src/exec/sapi/include/confdefs.h
+++ /dev/null
@@ -1,656 +0,0 @@
-/* confdefs.h
- *
- * This include file contains the configuration table template that will
- * be used by the single processor tests to define its default configuration
- * parameters.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __CONFIGURATION_TEMPLATE_h
-#define __CONFIGURATION_TEMPLATE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern rtems_initialization_tasks_table Initialization_tasks[];
-extern rtems_driver_address_table Device_drivers[];
-extern rtems_configuration_table Configuration;
-extern rtems_multiprocessing_table Multiprocessing_configuration;
-#ifdef RTEMS_POSIX_API
-extern posix_api_configuration_table Configuration_POSIX_API;
-#endif
-
-/*
- * RTEMS C Library and Newlib support
- *
- * NOTE: This ends up defining these even when newlib is not used.
- */
-
-#define CONFIGURE_NEWLIB_EXTENSION 1
-#define CONFIGURE_MALLOC_REGION 1
-
-#ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
-#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
-#endif
-
-#define CONFIGURE_LIBIO_SEMAPHORES \
- (CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS + 1)
-
-#ifdef CONFIGURE_INIT
-unsigned32 rtems_libio_number_iops = CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS;
-#endif
-
-/*
- * Stack Checker Requirements
- */
-
-#ifdef STACK_CHECKER_ON
-#define CONFIGURE_STACK_CHECKER_EXTENSION 1
-#else
-#define CONFIGURE_STACK_CHECKER_EXTENSION 0
-#endif
-
-/*
- * Interrupt Stack Space
- */
-
-#if (CPU_ALLOCATE_INTERRUPT_STACK == 0)
-#define CONFIGURE_INTERRUPT_STACK_MEMORY 0
-#else
- #ifndef CONFIGURE_INTERRUPT_STACK_MEMORY
- #define CONFIGURE_INTERRUPT_STACK_MEMORY RTEMS_MINIMUM_STACK_SIZE
- #else
- #define CONFIGURE_INTERRUPT_STACK_MEMORY 0
- #endif
-#endif
-
-/*
- * Default User Initialization Task Table. This table guarantees that
- * one user initialization table is defined.
- */
-
-#ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE
-
-/*
- * The user is defining their own table information and setting the
- * appropriate variables.
- */
-
-#else
-
-#ifndef CONFIGURE_INIT_TASK_NAME
-#define CONFIGURE_INIT_TASK_NAME rtems_build_name( 'U', 'I', '1', ' ' )
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_STACK_SIZE
-#define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_PRIORITY
-#define CONFIGURE_INIT_TASK_PRIORITY 1
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_ATTRIBUTES
-#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_ENTRY_POINT
-#define CONFIGURE_INIT_TASK_ENTRY_POINT Init
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_INITIAL_MODES
-#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_ARGUMENTS
-#define CONFIGURE_INIT_TASK_ARGUMENTS 0
-#endif
-
-#ifdef CONFIGURE_INIT
-rtems_initialization_tasks_table Initialization_tasks[] = {
- { CONFIGURE_INIT_TASK_NAME,
- CONFIGURE_INIT_TASK_STACK_SIZE,
- CONFIGURE_INIT_TASK_PRIORITY,
- CONFIGURE_INIT_TASK_ATTRIBUTES,
- CONFIGURE_INIT_TASK_ENTRY_POINT,
- CONFIGURE_INIT_TASK_INITIAL_MODES,
- CONFIGURE_INIT_TASK_ARGUMENTS
- }
-};
-#endif
-
-#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
-
-#define CONFIGURE_INIT_TASK_TABLE_SIZE \
- sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
-
-#endif /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */
-
-#else /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */
-
-#define CONFIGURE_INIT_TASK_TABLE NULL
-#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
-
-#endif
-
-/*
- * Default Device Driver Table. Each driver needed by the test is explicitly
- * choosen by that test. There is always a null driver entry.
- */
-
-#define NULL_DRIVER_TABLE_ENTRY \
- { NULL, NULL, NULL, NULL, NULL, NULL }
-
-#ifdef CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-#include <timerdrv.h>
-#endif
-
-#ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER
-#include <stubdrv.h>
-#endif
-
-#ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
-
-#ifdef CONFIGURE_INIT
-rtems_driver_address_table Device_drivers[] = {
-#ifdef CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
- CONSOLE_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
- CLOCK_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER
- STUB_DRIVER_TABLE_ENTRY,
-#endif
- NULL_DRIVER_TABLE_ENTRY
-};
-#endif
-
-#endif /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */
-
-/*
- * Default the number of devices per device driver. This value may be
- * overridden by the user.
- */
-
-#ifndef CONFIGURE_HAS_OWN_NUMBER_OF_DEVICES
-
-#ifndef CONFIGURE_MAXIMUM_DEVICES
-#define CONFIGURE_MAXIMUM_DEVICES 20
-#endif
-
-#endif /* CONFIGURE_HAS_OWN_NUMBER_OF_DEVICES */
-
-/*
- * Default Configuration Table. This table contains the most values set in
- * the RTEMS Test Suite. Each value may be overridden within each test to
- * customize the environment.
- */
-
-#ifdef CONFIGURE_MPTEST
-#ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
-
-#ifndef CONFIGURE_MP_NODE_NUMBER
-#define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER
-#endif
-
-#ifndef CONFIGURE_MP_MAXIMUM_NODES
-#define CONFIGURE_MP_MAXIMUM_NODES 2
-#endif
-
-#ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
-#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32
-#endif
-
-#ifndef CONFIGURE_MP_MAXIMUM_PROXIES
-#define CONFIGURE_MP_MAXIMUM_PROXIES 32
-#endif
-
-#ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
-#include <mpci.h>
-#define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table
-#endif
-
-#ifdef CONFIGURE_INIT
-rtems_multiprocessing_table Multiprocessing_configuration = {
- CONFIGURE_MP_NODE_NUMBER, /* local node number */
- CONFIGURE_MP_MAXIMUM_NODES, /* maximum # nodes in system */
- CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS, /* maximum # global objects */
- CONFIGURE_MP_MAXIMUM_PROXIES, /* maximum # proxies */
- CONFIGURE_MP_MPCI_TABLE_POINTER /* pointer to MPCI config table */
-};
-#endif
-
-#define CONFIGURE_MULTIPROCESSING_TABLE &Multiprocessing_configuration
-
-#endif /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */
-
-#else
-
-#define CONFIGURE_MULTIPROCESSING_TABLE NULL
-
-#endif /* CONFIGURE_MPTEST */
-
-/*
- * Default Configuration Table. This table contains the most values set in
- * the RTEMS Test Suite. Each value may be overridden within each test to
- * customize the environment.
- */
-
-#ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE
-
-#ifndef CONFIGURE_EXECUTIVE_RAM_WORK_AREA
-#define CONFIGURE_EXECUTIVE_RAM_WORK_AREA NULL
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_TASKS
-#define CONFIGURE_MAXIMUM_TASKS 10
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_TIMERS
-#define CONFIGURE_MAXIMUM_TIMERS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_SEMAPHORES
-#define CONFIGURE_MAXIMUM_SEMAPHORES 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_PARTITIONS
-#define CONFIGURE_MAXIMUM_PARTITIONS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_REGIONS
-#define CONFIGURE_MAXIMUM_REGIONS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_PORTS
-#define CONFIGURE_MAXIMUM_PORTS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_PERIODS
-#define CONFIGURE_MAXIMUM_PERIODS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
-#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0
-#endif
-
-#ifndef CONFIGURE_MICROSECONDS_PER_TICK
-#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(10)
-#endif
-
-#ifndef CONFIGURE_TICKS_PER_TIMESLICE
-#define CONFIGURE_TICKS_PER_TIMESLICE 50
-#endif
-
-/*
- * Initial Extension Set
- */
-
-#ifdef CONFIGURE_INIT
-#ifdef STACK_CHECKER_ON
-#include <stackchk.h>
-#endif
-
-rtems_extensions_table Configuration_Initial_Extensions[] = {
-#ifdef CONFIGURE_INITIAL_EXTENSIONS
- CONFIGURE_INITIAL_EXTENSIONS,
-#endif
-#ifdef STACK_CHECKER_ON
- STACK_CHECKER_EXTENSION,
-#endif
- { NULL, NULL, NULL, NULL, NULL, NULL, NULL }
-};
-
-#define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \
- ((sizeof(Configuration_Initial_Extensions) / \
- sizeof(rtems_extensions_table)) - 1)
-
-#endif
-
-/*
- * POSIX API Configuration Parameters
- */
-
-#ifdef RTEMS_POSIX_API
-
-#include <sys/types.h>
-#include <rtems/posix/cond.h>
-#include <rtems/posix/mutex.h>
-#include <rtems/posix/key.h>
-#include <rtems/posix/psignal.h>
-#include <rtems/posix/threadsup.h>
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_KEYS
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
-#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0
-#endif
-
-#ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
-
-/*
- * The user is defining their own table information and setting the
- * appropriate variables.
- */
-
-#else
-
-#ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
-#define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init
-#endif
-
-#ifdef CONFIGURE_INIT
-posix_initialization_threads_table POSIX_Initialization_threads[] = {
- { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT }
-};
-#endif
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME POSIX_Initialization_threads
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
- sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \
- sizeof(posix_initialization_threads_table)
-
-#endif /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
-
-#else /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0
-
-#endif
-
-#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \
- ( \
- sizeof (POSIX_API_Control) + \
- (sizeof (void *) * (CONFIGURE_GNAT_KEYS + CONFIGURE_MAXIMUM_POSIX_KEYS)) \
- )
-
-#define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \
- ((_mutexes) * \
- ( sizeof(POSIX_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condition_variables) \
- ((_condition_variables) * \
- ( sizeof(POSIX_Condition_variables_Control) + \
- CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \
- ((_keys) * \
- ( sizeof(POSIX_Keys_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
- ((_queued_signals) * \
- ( sizeof(POSIX_signals_Siginfo_node) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-
-
-#define CONFIGURE_MEMORY_FOR_POSIX \
- ( \
- CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \
- CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
- CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \
- CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \
- CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
- CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) \
- )
-
-
-#else
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 0
-#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0
-#define CONFIGURE_MEMORY_FOR_POSIX 0
-
-#endif /* RTEMS_POSIX_API */
-
-/*
- * Calculate the RAM size based on the maximum number of objects configured.
- * The model is to estimate the memory required for each configured item,
- * sum the memory requirements and insure that there is at least 32K greater
- * than that for things not directly addressed such as:
- *
- * + stacks greater than minimum size
- * + FP contexts
- * + API areas (should be optional)
- * + messages
- * + object name and local pointer table overhead
- * + per node memory requirements
- * + executive fixed requirements (including at least internal threads
- * and the Ready chains)
- *
- * NOTE: Eventually this should take into account some of the above.
- * Basically, this is a "back of the envelope" estimate for
- * memory requirements. It could be more accurate.
- */
-
-#ifndef CONFIGURE_EXECUTIVE_RAM_SIZE
-
-#define CONFIGURE_OBJECT_TABLE_STUFF \
- ( sizeof(Objects_Control *) + sizeof(rtems_name *) + sizeof(rtems_name) )
-
-#define CONFIGURE_MEMORY_FOR_TASKS(_tasks) \
- (((_tasks) + 1 ) * \
- ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \
- STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \
- CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \
- CONFIGURE_OBJECT_TABLE_STUFF)) \
- )
-
-#define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \
- ((_timers) * ( sizeof(Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \
- ((_semaphores) * \
- ( sizeof(Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \
- ( (_queues) * \
- ( sizeof(Message_queue_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \
- ( (_partitions) * \
- ( sizeof(Partition_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \
- ( (_regions) * \
- ( sizeof(Region_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_PORTS(_ports) \
- ( (_ports) * \
- ( sizeof(Dual_ported_memory_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \
- ( (_periods) * \
- ( sizeof(Rate_monotonic_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \
- ( (_extensions) * \
- ( sizeof(Extension_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_DEVICES(_devices) \
- (((_devices) + 1) * ( sizeof(rtems_driver_name_t) ) )
-
-#ifdef CONFIGURE_MPTEST
-
-#ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
-
-#define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \
- ( ((_proxies) + 1) * ( sizeof(Thread_Proxy_control) ) )
-
-#define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \
- ((_global_objects) * ( sizeof(Objects_MP_Control) ) )
-
-#define CONFIGURE_MEMORY_FOR_MP \
- ( CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \
- CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \
- CONFIGURE_MEMORY_FOR_TASKS(1) \
- )
-
-#endif /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */
-
-#else
-
-#define CONFIGURE_MEMORY_FOR_MP 0
-
-#endif
-
-#ifndef CONFIGURE_MEMORY_OVERHEAD
-#define CONFIGURE_MEMORY_OVERHEAD 0
-#endif
-
-#ifndef CONFIGURE_EXTRA_TASK_STACKS
-#define CONFIGURE_EXTRA_TASK_STACKS 0
-#endif
-
-#define CONFIGURE_MEMORY_FOR_SYSTEM_OVEREHAD \
- ( CONFIGURE_MEMORY_FOR_TASKS(1) + /* IDLE */ \
- (256 * 12) + /* Ready chains */ \
- 256 + /* name/ptr table overhead */ \
- CONFIGURE_INTERRUPT_STACK_MEMORY /* interrupt stack */ \
- )
-
-#define CONFIGURE_EXECUTIVE_RAM_SIZE \
-(( CONFIGURE_MEMORY_FOR_POSIX + \
- CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS + \
- CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS ) + \
- CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \
- CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \
- CONFIGURE_LIBIO_SEMAPHORES) + \
- CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \
- CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \
- CONFIGURE_MEMORY_FOR_REGIONS( \
- CONFIGURE_MAXIMUM_REGIONS + CONFIGURE_MALLOC_REGION ) + \
- CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \
- CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \
- CONFIGURE_MEMORY_FOR_USER_EXTENSIONS( \
- CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION + \
- CONFIGURE_STACK_CHECKER_EXTENSION ) + \
- CONFIGURE_MEMORY_FOR_DEVICES(CONFIGURE_MAXIMUM_DEVICES) + \
- CONFIGURE_MEMORY_FOR_MP + \
- CONFIGURE_MEMORY_FOR_SYSTEM_OVEREHAD + \
- (((CONFIGURE_MEMORY_OVERHEAD)+1) * 1024) + \
- (CONFIGURE_EXTRA_TASK_STACKS) + (CONFIGURE_ADA_TASKS_STACK) \
-) & 0xfffffc00)
-#endif
-
-#ifdef CONFIGURE_GNAT_RTEMS
-#define CONFIGURE_GNAT_MUTEXES 10
-#define CONFIGURE_GNAT_KEYS 1
-
-/* 20 are required to run all tests in the ACVC */
-#ifndef CONFIGURE_MAXIMUM_ADA_TASKS
-#define CONFIGURE_MAXIMUM_ADA_TASKS 20
-#endif
-
-/* This is the number of non-Ada tasks which invoked Ada code. */
-#ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
-#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
-#endif
-
-/* Ada tasks are allocated twice the minimum stack space */
-#define CONFIGURE_ADA_TASKS_STACK \
- (CONFIGURE_MAXIMUM_ADA_TASKS * (RTEMS_MINIMUM_STACK_SIZE + (6 * 1024)))
-
-#else
-#define CONFIGURE_GNAT_MUTEXES 0
-#define CONFIGURE_GNAT_KEYS 0
-#define CONFIGURE_MAXIMUM_ADA_TASKS 0
-#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
-#define CONFIGURE_ADA_TASKS_STACK 0
-#endif
-
-
-#ifdef CONFIGURE_INIT
-
-rtems_api_configuration_table Configuration_RTEMS_API = {
- CONFIGURE_MAXIMUM_TASKS,
- CONFIGURE_MAXIMUM_TIMERS,
- CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES,
- CONFIGURE_MAXIMUM_MESSAGE_QUEUES,
- CONFIGURE_MAXIMUM_PARTITIONS,
- CONFIGURE_MAXIMUM_REGIONS + CONFIGURE_MALLOC_REGION,
- CONFIGURE_MAXIMUM_PORTS,
- CONFIGURE_MAXIMUM_PERIODS,
- CONFIGURE_INIT_TASK_TABLE_SIZE,
- CONFIGURE_INIT_TASK_TABLE
-};
-
-#ifdef RTEMS_POSIX_API
-posix_api_configuration_table Configuration_POSIX_API = {
- CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS,
- CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES +
- CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS,
- CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES +
- CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS,
- CONFIGURE_MAXIMUM_POSIX_KEYS + CONFIGURE_GNAT_KEYS,
- CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS,
- CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE,
- CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME
-};
-#endif
-
-rtems_configuration_table Configuration = {
- CONFIGURE_EXECUTIVE_RAM_WORK_AREA,
- CONFIGURE_EXECUTIVE_RAM_SIZE,
- CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION +
- CONFIGURE_STACK_CHECKER_EXTENSION,
- CONFIGURE_MICROSECONDS_PER_TICK,
- CONFIGURE_TICKS_PER_TIMESLICE,
- CONFIGURE_MAXIMUM_DEVICES,
- sizeof (Device_drivers)/
- sizeof(rtems_driver_address_table), /* number of device drivers */
- Device_drivers, /* pointer to driver table */
- CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of initial extensions */
- Configuration_Initial_Extensions, /* pointer to initial extensions */
- CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */
- &Configuration_RTEMS_API, /* pointer to RTEMS API config */
-#ifdef RTEMS_POSIX_API
- &Configuration_POSIX_API /* pointer to POSIX API config */
-#else
- NULL /* pointer to POSIX API config */
-#endif
-};
-#endif
-
-#endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/include/rtems/Makefile.in b/c/src/exec/sapi/include/rtems/Makefile.in
deleted file mode 100644
index 109bb18c44..0000000000
--- a/c/src/exec/sapi/include/rtems/Makefile.in
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_PIECES= config directives extension fatal init io mptables
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-# H_FILES that get installed externally
-EXTERNAL_H_PIECES = confdefs
-EXTERNAL_H_FILES=$(EXTERNAL_H_PIECES:%=$(srcdir)/%.h)
-
-SRCS=$(H_FILES) $(EXTERNAL_H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS) $(ARCH) $(PROJECT_INCLUDE)/rtems/sptables.h
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/
- $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
-
-$(PROJECT_INCLUDE)/rtems/sptables.h: $(ARCH)/sptables.h-tmp
- $(INSTALL) -m 444 $(ARCH)/sptables.h-tmp $@
-
-$(ARCH)/sptables.h-tmp: $(srcdir)/sptables.h
- $(SED) -e 's?REPLACE_THIS_WITH_THE_BSP?$(RTEMS_BSP)?' \
- < $< >$(ARCH)/sptables.h-tmp
-
diff --git a/c/src/exec/sapi/include/rtems/README b/c/src/exec/sapi/include/rtems/README
deleted file mode 100644
index 5fcc0d14c7..0000000000
--- a/c/src/exec/sapi/include/rtems/README
+++ /dev/null
@@ -1,135 +0,0 @@
-#
-# $Id$
-#
-
-Configuring a System Using the Template in confdefs.h
-=====================================================
-
-The file confdefs.h is a Configuration Template file which can be
-used to greatly simplify the creation and maintenance of RTEMS
-Configuration Tables. The basic concepts are:
-
- + confdefs.h provides defaults for all configuration parameters
-
- + applications specify only those values they wish to override
-
- + confdefs.h can be the only file which knows the precise layout
- of the RTEMS Configuration Tables.
-
-The Configuration Template setup is used by all RTEMS tests to
-simplify the maintenance of the tests.
-
-Here is the section from the system.h file from test tm21 from
-the Timing Test Suite:
-
- /* configuration information */
-
- #define CONFIGURE_TMTEST
-
- #define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
- #define CONFIGURE_TEST_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
-
- #include <confdefs.h>
-
-
-The above example overrides a number of the configuration parameters.
-It informs the template that it is a member of the Timing Suite,
-requires a console and timer driver, and that it needs 102 tasks,
-100 timers, 100 semaphores, 100 message queues, 100 partitions,
-100 regions, 100 ports, and 100 periods. By default, the test
-would have gotten no drivers, 10 tasks, and no other RTEMS objects.
-
-The following shows the configuration tables generated by the
-template by default.
-
-
-#include <bsp.h>
-
-#define NULL_DRIVER_TABLE_ENTRY \
- { NULL, NULL, NULL, NULL, NULL, NULL }
-
-rtems_driver_address_table Device_drivers[] = {
-#ifdef CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
- CONSOLE_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
- CLOCK_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER
- STUB_DRIVER_TABLE_ENTRY,
-#endif
- NULL_DRIVER_TABLE_ENTRY,
-};
-
-rtems_initialization_tasks_table Initialization_tasks[] = {
- { rtems_build_name( 'U', 'I', '1', ' ' ), /* init task name */
- RTEMS_MINIMUM_STACK_SIZE, /* init task stack size */
- 1, /* init task priority */
- RTEMS_DEFAULT_ATTRIBUTES, /* init task attributes */
- Init, /* init task entry point */
- RTEMS_NO_PREEMPT, /* init task initial mode */
- 0 /* init task argument list */
- }
-};
-
-#ifdef CONFIGURE_MPTEST
-/*
- * NODE_NUMBER is assumed to be set on the compile line.
- */
-
-rtems_multiprocessing_table Multiprocessing_configuration = {
- NODE_NUMBER, /* local node number */
- 2, /* maximum # nodes in system */
- 32, /* maximum # global objects */
- 32, /* maximum # proxies */
- &MPCI_table /* pointer to MPCI config table */
-};
-#endif
-
-/*
- * CONFIGURE_EXECUTIVE_RAM_SIZE is a rough guess based on the number of
- * tasks in the system plus enough extra to get a whole 64K extra.
- *
- * The NULL address for the workspace area is assumed to be assigned
- * at startup time by the BSP.
- */
-
-rtems_configuration_table Configuration = {
- NULL, /* executive RAM work area */
- CONFIGURE_EXECUTIVE_RAM_SIZE, /* executive RAM size */
- 10, /* maximum # tasks */
- 0, /* maximum # timers */
- 0, /* maximum # semaphores */
- 0, /* maximum # message queues */
- 0, /* maximum # messages */
- 0, /* maximum # partitions */
- 0, /* maximum # regions */
- 0, /* maximum # dp memory areas */
- 0, /* maximum # periods */
- 0, /* maximum # user extensions */
- RTEMS_MILLISECONDS_TO_MICROSECONDS(10), /* # us in a tick */
- 50, /* # ticks in a timeslice */
- sizeof (Initialization_tasks) / sizeof(rtems_initialization_tasks_table),
- /* number of init tasks */
- Initialization_tasks, /* init task(s) table */
- sizeof (Device_drivers) / sizeof(rtems_driver_address_table),
- /* number of device drivers */
- Device_drivers, /* pointer to driver address table */
- NULL, /* pointer to initial extensions */
-#ifdef CONFIGURE_MPTEST
- &Multiprocessing_configuration
-#else
- NULL /* ptr to MP config table */
-#endif
-};
diff --git a/c/src/exec/sapi/include/rtems/config.h b/c/src/exec/sapi/include/rtems/config.h
deleted file mode 100644
index e3ae50d7d1..0000000000
--- a/c/src/exec/sapi/include/rtems/config.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* config.h
- *
- * This include file contains the table of user defined configuration
- * parameters.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CONFIGURATION_h
-#define __RTEMS_CONFIGURATION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This is kind of kludgy but it allows targets to totally ignore the
- * POSIX API safely.
- */
-
-#ifdef RTEMS_POSIX_API
-#include <rtems/posix/config.h>
-#else
-
-typedef void *posix_api_configuration_table;
-#endif
-
-#include <rtems/rtems/config.h>
-
-/* XXX <rtems/rtems/config.h> should cover these
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/tasks.h>
-*/
-
-#include <rtems/extension.h>
-#include <rtems/io.h>
-#include <rtems/score/mpci.h>
-
-/*
- * The following records define the Multiprocessor Configuration
- * Table. This table defines the multiprocessor system
- * characteristics which must be known by RTEMS in a multiprocessor
- * system.
- */
-
-typedef struct {
- unsigned32 node; /* local node number */
- unsigned32 maximum_nodes; /* maximum # nodes in system */
- unsigned32 maximum_global_objects; /* maximum # global objects */
- unsigned32 maximum_proxies; /* maximum # proxies */
- MPCI_Control *User_mpci_table; /* pointer to MPCI table */
-} rtems_multiprocessing_table;
-
-/*
- * The following records define the Configuration Table. The
- * information contained in this table is required in all
- * RTEMS systems, whether single or multiprocessor. This
- * table primarily defines the following:
- *
- * + location and size of the RTEMS Workspace
- * + microseconds per clock tick
- * + clock ticks per task timeslice
- * + required number of each object type for each API configured
- */
-
-typedef struct {
- void *work_space_start;
- unsigned32 work_space_size;
- unsigned32 maximum_extensions;
- unsigned32 microseconds_per_tick;
- unsigned32 ticks_per_timeslice;
- unsigned32 maximum_devices;
- unsigned32 number_of_device_drivers;
- rtems_driver_address_table *Device_driver_table;
- unsigned32 number_of_initial_extensions;
- rtems_extensions_table *User_extension_table;
- rtems_multiprocessing_table *User_multiprocessing_table;
- rtems_api_configuration_table *RTEMS_api_configuration;
- posix_api_configuration_table *POSIX_api_configuration;
-} rtems_configuration_table;
-
-/*
- * The following are provided strictly for the convenience of
- * the user. They are not used in RTEMS itself.
- */
-
-SAPI_EXTERN rtems_configuration_table *_Configuration_Table;
-SAPI_EXTERN rtems_multiprocessing_table *_Configuration_MP_table;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/include/rtems/directives.h b/c/src/exec/sapi/include/rtems/directives.h
deleted file mode 100644
index 785ab0760e..0000000000
--- a/c/src/exec/sapi/include/rtems/directives.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* directives.h
- *
- * The following definitions are the directive numbers used
- * in the assembly interface.
- *
- * COPYRIGHT (c) 1989-1997
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_DIRECTIVES_h
-#define __RTEMS_DIRECTIVES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define RTEMS_INITIALIZE_EXECUTIVE 0
-#define RTEMS_INITIALIZE_EXECUTIVE_EARLY 1
-#define RTEMS_INITIALIZE_EXECUTIVE_LATE 2
-#define RTEMS_SHUTDOWN_EXECUTIVE 3
-#define RTEMS_TASKS_CREATE 4
-#define RTEMS_TASKS_NAME_TO_ID 5
-#define RTEMS_TASKS_START 6
-#define RTEMS_TASKS_RESTART 7
-#define RTEMS_TASKS_DELETE 8
-#define RTEMS_TASKS_SUSPEND 9
-#define RTEMS_TASKS_RESUME 10
-#define RTEMS_TASKS_SET_PRIORITY 11
-#define RTEMS_TASKS_MODE 12
-#define RTEMS_TASKS_GET_NOTE 13
-#define RTEMS_TASKS_SET_NOTE 14
-#define RTEMS_TASKS_WAKE_AFTER 15
-#define RTEMS_TASKS_WAKE_WHEN 16
-#define RTEMS_INTERRUPT_CATCH 17
-#define RTEMS_CLOCK_SET 18
-#define RTEMS_CLOCK_GET 19
-#define RTEMS_CLOCK_TICK 20
-#define RTEMS_EXTENSION_CREATE 21
-#define RTEMS_EXTENSION_NAME_TO_ID 22
-#define RTEMS_EXTENSION_DELETE 23
-#define RTEMS_TIMER_CREATE 24
-#define RTEMS_TIMER_NAME_TO_ID 25
-#define RTEMS_TIMER_CANCEL 26
-#define RTEMS_TIMER_DELETE 27
-#define RTEMS_TIMER_FIRE_AFTER 28
-#define RTEMS_TIMER_FIRE_WHEN 29
-#define RTEMS_TIMER_RESET 30
-#define RTEMS_SEMAPHORE_CREATE 31
-#define RTEMS_SEMAPHORE_NAME_TO_ID 32
-#define RTEMS_SEMAPHORE_DELETE 33
-#define RTEMS_SEMAPHORE_OBTAIN 34
-#define RTEMS_SEMAPHORE_RELEASE 35
-#define RTEMS_MESSAGE_QUEUE_CREATE 36
-#define RTEMS_MESSAGE_QUEUE_NAME_TO_ID 37
-#define RTEMS_MESSAGE_QUEUE_DELETE 38
-#define RTEMS_MESSAGE_QUEUE_SEND 39
-#define RTEMS_MESSAGE_QUEUE_URGENT 40
-#define RTEMS_MESSAGE_QUEUE_BROADCAST 41
-#define RTEMS_MESSAGE_QUEUE_RECEIVE 42
-#define RTEMS_MESSAGE_QUEUE_FLUSH 43
-#define RTEMS_EVENT_SEND 44
-#define RTEMS_EVENT_RECEIVE 45
-#define RTEMS_SIGNAL_CATCH 46
-#define RTEMS_SIGNAL_SEND 47
-#define RTEMS_PARTITION_CREATE 48
-#define RTEMS_PARTITION_NAME_TO_ID 49
-#define RTEMS_PARTITION_DELETE 50
-#define RTEMS_PARTITION_GET_BUFFER 51
-#define RTEMS_PARTITION_RETURN_BUFFER 52
-#define RTEMS_REGION_CREATE 53
-#define RTEMS_REGION_EXTEND 54
-#define RTEMS_REGION_NAME_TO_ID 55
-#define RTEMS_REGION_DELETE 56
-#define RTEMS_REGION_GET_SEGMENT_SIZE 57
-#define RTEMS_REGION_GET_SEGMENT 58
-#define RTEMS_REGION_RETURN_SEGMENT 59
-#define RTEMS_DUAL_PORTED_MEMORY_CREATE 60
-#define RTEMS_DUAL_PORTED_MEMORY_NAME_TO_ID 61
-#define RTEMS_DUAL_PORTED_MEMORY_DELETE 62
-#define RTEMS_DUAL_PORTED_MEMORY_EXTERNAL_TO_INTERNAL 63
-#define RTEMS_DUAL_PORTED_MEMORY_INTERNAL_TO_EXTERNAL 64
-#define RTEMS_IO_INITIALIZE 65
-#define RTEMS_IO_REGISTER_NAME 66
-#define RTEMS_IO_LOOKUP_NAME 67
-#define RTEMS_IO_OPEN 68
-#define RTEMS_IO_CLOSE 69
-#define RTEMS_IO_READ 70
-#define RTEMS_IO_WRITE 71
-#define RTEMS_IO_CONTROL 72
-#define RTEMS_FATAL_ERROR_OCCURRED 73
-#define RTEMS_RATE_MONOTONIC_CREATE 74
-#define RTEMS_RATE_MONOTONIC_NAME_TO_ID 75
-#define RTEMS_RATE_MONOTONIC_DELETE 76
-#define RTEMS_RATE_MONOTONIC_CANCEL 77
-#define RTEMS_RATE_MONOTONIC_PERIOD 78
-#define RTEMS_MULTIPROCESSING_ANNOUNCE 79
-#define RTEMS_DEBUG_ENABLE 80
-#define RTEMS_DEBUG_DISABLE 81
-
-#define RTEMS_NUMBER_OF_ENTRY_POINTS 82
-
-/*
- * The jump table of entry points into RTEMS directives.
- */
-
-extern const void *_Entry_points[ RTEMS_NUMBER_OF_ENTRY_POINTS ];
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of directives.h */
diff --git a/c/src/exec/sapi/include/rtems/extension.h b/c/src/exec/sapi/include/rtems/extension.h
deleted file mode 100644
index 9b6b21c70e..0000000000
--- a/c/src/exec/sapi/include/rtems/extension.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/* extension.h
- *
- * This include file contains all the constants, structures, and
- * prototypes associated with the User Extension Manager. This manager
- * provides a mechanism for manipulating sets of user-defined extensions.
- *
- * Directives provided are:
- *
- * + create user extension set
- * + get ID of user extension set
- * + delete user extension set
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_EXTENSION_MANAGER_h
-#define __RTEMS_EXTENSION_MANAGER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/userext.h>
-#include <rtems/rtems/status.h> /* XXX */
-#include <rtems/rtems/types.h> /* XXX */
-
-/*
- * Extension related types
- */
-
-typedef User_extensions_routine rtems_extension;
-typedef User_extensions_thread_create_extension rtems_task_create_extension;
-typedef User_extensions_thread_delete_extension rtems_task_delete_extension;
-typedef User_extensions_thread_start_extension rtems_task_start_extension;
-typedef User_extensions_thread_restart_extension rtems_task_restart_extension;
-typedef User_extensions_thread_switch_extension rtems_task_switch_extension;
-typedef User_extensions_thread_post_switch_extension
- rtems_task_post_switch_extension;
-typedef User_extensions_thread_begin_extension rtems_task_begin_extension;
-typedef User_extensions_thread_exitted_extension rtems_task_exitted_extension;
-typedef User_extensions_fatal_extension rtems_fatal_extension;
-
-typedef User_extensions_Table rtems_extensions_table;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-SAPI_EXTERN Objects_Information _Extension_Information;
-
-/*
- * The following records define the control block used to manage
- * each extension.
- */
-
-typedef struct {
- Objects_Control Object;
- User_extensions_Control Extension;
-} Extension_Control;
-
-/*
- * _Extension_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Extension_Manager_initialization(
- unsigned32 maximum_extensions
-);
-
-/*
- * rtems_extension_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_extension_create directive. The
- * extension will have the name name. The entry points of the
- * routines which constitute this extension set are in EXTENSION_TABLE.
- * It returns the id of the created extension in ID.
- */
-
-rtems_status_code rtems_extension_create(
- rtems_name name,
- rtems_extensions_table *extension_table,
- Objects_Id *id
-);
-
-/*
- * rtems_extension_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_extension_ident directive.
- * This directive returns the extension ID associated with name.
- * If more than one extension is named name, then the extension
- * to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_extension_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_extension_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_extension_delete directive. The
- * extension indicated by ID is deleted.
- */
-
-rtems_status_code rtems_extension_delete(
- Objects_Id id
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/extension.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/include/rtems/fatal.h b/c/src/exec/sapi/include/rtems/fatal.h
deleted file mode 100644
index 7f0a7b443a..0000000000
--- a/c/src/exec/sapi/include/rtems/fatal.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* fatal.h
- *
- * This include file contains constants and prototypes related
- * to the Fatal Error Manager. This manager processes all fatal or
- * irrecoverable errors.
- *
- * This manager provides directives to:
- *
- * + announce a fatal error has occurred
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_FATAL_h
-#define __RTEMS_FATAL_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * rtems_fatal_error_occurred
- *
- * DESCRIPTION:
- *
- * This is the routine which implements the rtems_fatal_error_occurred
- * directive. It is invoked when the application or RTEMS
- * determines that a fatal error has occurred.
- */
-
-void volatile rtems_fatal_error_occurred(
- unsigned32 the_error
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/include/rtems/init.h b/c/src/exec/sapi/include/rtems/init.h
deleted file mode 100644
index a4f24d8010..0000000000
--- a/c/src/exec/sapi/include/rtems/init.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* init.h
- *
- * This include file contains all the constants and structures associated
- * with the Initialization Manager. This manager is responsible for
- * initializing RTEMS, creating and starting all configured initialization
- * tasks, invoking the initialization routine for each user-supplied device
- * driver, and initializing the optional multiprocessor layer.
- *
- * This manager provides directives to:
- *
- * + initialize the RTEMS executive
- * + shutdown the RTEMS executive
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_INIT_h
-#define __RTEMS_INIT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-#include <rtems/config.h>
-#include <rtems/rtems/intr.h>
-
-/*
- * The following defines the default Multiprocessing Configuration
- * Table. This table is used in a single processor system.
- */
-
-extern const rtems_multiprocessing_table
- _Initialization_Default_multiprocessing_table;
-
-/*
- * rtems_initialize_executive
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_initialize_executive directive. This
- * directive is invoked at system startup to initialize the RTEMS
- * multitasking environment.
- */
-
-void rtems_initialize_executive(
- rtems_configuration_table *configuration_table,
- rtems_cpu_table *cpu_table
-);
-
-/*
- * rtems_initialize_executive_early
- *
- * DESCRIPTION:
- *
- * This routine implements the early portion of rtems_initialize_executive
- * directive up to the pretasking hook. This directive is invoked at system
- * startup to initialize the RTEMS multitasking environment.
- */
-
-rtems_interrupt_level rtems_initialize_executive_early(
- rtems_configuration_table *configuration_table,
- rtems_cpu_table *cpu_table
-);
-
-/*
- * rtems_initialize_executive_late
- *
- * DESCRIPTION:
- *
- * This routine implements the early portion of rtems_initialize_executive
- * directive up to the pretasking hook. This directive is invoked at system
- * startup to initialize the RTEMS multitasking environment.
- */
-
-void rtems_initialize_executive_late(
- rtems_interrupt_level bsp_level
-);
-
-/*
- * rtems_shutdown_executive
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_shutdown_executive directive. The
- * invocation of this directive results in the RTEMS environment being
- * shutdown and multitasking halted. From the application's perspective,
- * invocation of this directive results in the rtems_initialize_executive
- * directive exitting to the startup code which invoked it.
- */
-
-void rtems_shutdown_executive(
- unsigned32 result
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/include/rtems/io.h b/c/src/exec/sapi/include/rtems/io.h
deleted file mode 100644
index 11b4f812cd..0000000000
--- a/c/src/exec/sapi/include/rtems/io.h
+++ /dev/null
@@ -1,244 +0,0 @@
-/* io.h
- *
- * This include file contains all the constants and structures associated
- * with the Input/Output Manager. This manager provides a well defined
- * mechanism for accessing device drivers and a structured methodology for
- * organizing device drivers.
- *
- * Directives provided are:
- *
- * + initialize a device driver
- * + open a device driver
- * + close a device driver
- * + read from a device driver
- * + write to a device driver
- * + special device services
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_IO_h
-#define __RTEMS_IO_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/status.h>
-
-/*
- *
- * The following defines the types for:
- *
- * + major and minor numbers
- * + the return type of a device driver entry
- * + a pointer to a device driver entry
- * + an entry in the the Device Driver Address Table. Each entry in this
- * table corresponds to an application provided device driver and
- * defines the entry points for that device driver.
- */
-
-typedef unsigned32 rtems_device_major_number;
-typedef unsigned32 rtems_device_minor_number;
-
-typedef rtems_status_code rtems_device_driver;
-
-typedef rtems_device_driver ( *rtems_device_driver_entry )(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
- );
-
-typedef struct {
- rtems_device_driver_entry initialization; /* initialization procedure */
- rtems_device_driver_entry open; /* open request procedure */
- rtems_device_driver_entry close; /* close request procedure */
- rtems_device_driver_entry read; /* read request procedure */
- rtems_device_driver_entry write; /* write request procedure */
- rtems_device_driver_entry control; /* special functions procedure */
-} rtems_driver_address_table;
-
-/*
- * Table for the io device names
- */
-
-typedef struct {
- char *device_name;
- unsigned32 device_name_length;
- rtems_device_major_number major;
- rtems_device_minor_number minor;
-} rtems_driver_name_t;
-
-/*
- * This is the table of device names.
- */
-
-/*
- * The following declare the data required to manage the Driver
- * Address Table and Device Name Table.
- */
-
-SAPI_EXTERN unsigned32 _IO_Number_of_drivers;
-SAPI_EXTERN rtems_driver_address_table *_IO_Driver_address_table;
-SAPI_EXTERN unsigned32 _IO_Number_of_devices;
-SAPI_EXTERN rtems_driver_name_t *_IO_Driver_name_table;
-
-/*
- * _IO_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _IO_Manager_initialization(
- rtems_driver_address_table *driver_table,
- unsigned32 number_of_drivers,
- unsigned32 number_of_devices
-);
-
-/*
- * rtems_io_register_name
- *
- * DESCRIPTION:
- *
- * Associate a name with a driver.
- *
- */
-
-rtems_status_code rtems_io_register_name(
- char *device_name,
- rtems_device_major_number major,
- rtems_device_minor_number minor
-);
-
-
-/*
- * rtems_io_lookup_name
- *
- * DESCRIPTION:
- *
- * Find what driver "owns" this name
- */
-
-rtems_status_code rtems_io_lookup_name(
- const char *name,
- rtems_driver_name_t **device_info
-);
-
-
-/*
- * rtems_io_initialize
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_initialize directive. It is invoked
- * to initialize a device driver or an individual device.
- */
-
-rtems_status_code rtems_io_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_open
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_open directive. It is invoked
- * to open a device.
- */
-
-rtems_status_code rtems_io_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_close
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_close directive. It is invoked
- * to close a device.
- */
-
-rtems_status_code rtems_io_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_read
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_read directive. It is invoked
- * to read from a device.
- */
-
-rtems_status_code rtems_io_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_write
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_write directive. It is invoked
- * to write to a device.
- */
-
-rtems_status_code rtems_io_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_control
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_control directive. It is invoked
- * to perform a device specific operation on a device.
- */
-
-rtems_status_code rtems_io_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * _IO_Initialize_all_drivers
- *
- * DESCRIPTION:
- *
- * This routine initializes all of the device drivers configured
- * in the Device Driver Address Table.
- */
-
-void _IO_Initialize_all_drivers( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/include/rtems/mptables.h b/c/src/exec/sapi/include/rtems/mptables.h
deleted file mode 100644
index 8fdbdfebd2..0000000000
--- a/c/src/exec/sapi/include/rtems/mptables.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mptables.h
- *
- * This include file contains the executive's pre-initialized tables
- * used in a multiprocessor configuration.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MPTABLES_h
-#define __RTEMS_MPTABLES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/include/rtems/sptables.h b/c/src/exec/sapi/include/rtems/sptables.h
deleted file mode 100644
index ed5b4f896e..0000000000
--- a/c/src/exec/sapi/include/rtems/sptables.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/* sptables.h
- *
- * This include file contains the executive's pre-initialized tables
- * used when in a single processor configuration.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SPTABLES_h
-#define __RTEMS_SPTABLES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/config.h>
-
-#include <rtems/debug.h>
-#include <rtems/fatal.h>
-#include <rtems/init.h>
-#include <rtems/io.h>
-#include <rtems/score/sysstate.h>
-
-#include <rtems/rtems/intr.h>
-#include <rtems/rtems/clock.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/rtems/dpmem.h>
-#include <rtems/rtems/event.h>
-#include <rtems/rtems/message.h>
-#include <rtems/rtems/mp.h>
-#include <rtems/rtems/part.h>
-#include <rtems/rtems/ratemon.h>
-#include <rtems/rtems/region.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/rtems/signal.h>
-#include <rtems/rtems/timer.h>
-
-/*
- * This is the default Multiprocessing Configuration Table.
- * It is used in single processor configurations.
- */
-
-const rtems_multiprocessing_table
- _Initialization_Default_multiprocessing_table = {
- 1, /* local node number */
- 1, /* maximum number nodes in system */
- 0, /* maximum number global objects */
- 0, /* maximum number proxies */
- NULL, /* pointer to MPCI address table */
-};
-
-/*
- * This is the version string.
- */
-
-#define RTEMS_VERSION "rtems-4.0.0"
-
-const char _RTEMS_version[] =
- "RTEMS RELEASE " RTEMS_VERSION
- "(" CPU_NAME "/" CPU_MODEL_NAME "/REPLACE_THIS_WITH_THE_BSP)";
-
-
-/*
- * This table is used by the single entry point code.
- */
-
-const void * _Entry_points[ RTEMS_NUMBER_OF_ENTRY_POINTS ] = {
- (void *) rtems_initialize_executive, /* 0 */
- (void *) rtems_initialize_executive_early, /* 1 */
- (void *) rtems_initialize_executive_late, /* 2 */
- (void *) rtems_shutdown_executive, /* 3 */
- (void *) rtems_task_create, /* 4 */
- (void *) rtems_task_ident, /* 5 */
- (void *) rtems_task_start, /* 6 */
- (void *) rtems_task_restart, /* 7 */
- (void *) rtems_task_delete, /* 8 */
- (void *) rtems_task_suspend, /* 9 */
- (void *) rtems_task_resume, /* 10 */
- (void *) rtems_task_set_priority, /* 11 */
- (void *) rtems_task_mode, /* 12 */
- (void *) rtems_task_get_note, /* 13 */
- (void *) rtems_task_set_note, /* 14 */
- (void *) rtems_task_wake_after, /* 15 */
- (void *) rtems_task_wake_when, /* 16 */
- (void *) rtems_interrupt_catch, /* 17 */
- (void *) rtems_clock_set, /* 18 */
- (void *) rtems_clock_get, /* 19 */
- (void *) rtems_clock_tick, /* 20 */
- (void *) rtems_extension_create, /* 21 */
- (void *) rtems_extension_ident, /* 22 */
- (void *) rtems_extension_delete, /* 23 */
- (void *) rtems_timer_create, /* 24 */
- (void *) rtems_timer_ident, /* 25 */
- (void *) rtems_timer_cancel, /* 26 */
- (void *) rtems_timer_delete, /* 27 */
- (void *) rtems_timer_fire_after, /* 28 */
- (void *) rtems_timer_fire_when, /* 29 */
- (void *) rtems_timer_reset, /* 30 */
- (void *) rtems_semaphore_create, /* 31 */
- (void *) rtems_semaphore_ident, /* 32 */
- (void *) rtems_semaphore_delete, /* 33 */
- (void *) rtems_semaphore_obtain, /* 34 */
- (void *) rtems_semaphore_release, /* 35 */
- (void *) rtems_message_queue_create, /* 36 */
- (void *) rtems_message_queue_ident, /* 37 */
- (void *) rtems_message_queue_delete, /* 38 */
- (void *) rtems_message_queue_send, /* 39 */
- (void *) rtems_message_queue_urgent, /* 40 */
- (void *) rtems_message_queue_broadcast, /* 41 */
- (void *) rtems_message_queue_receive, /* 42 */
- (void *) rtems_message_queue_flush, /* 43 */
- (void *) rtems_event_send, /* 44 */
- (void *) rtems_event_receive, /* 45 */
- (void *) rtems_signal_catch, /* 46 */
- (void *) rtems_signal_send, /* 47 */
- (void *) rtems_partition_create, /* 48 */
- (void *) rtems_partition_ident, /* 49 */
- (void *) rtems_partition_delete, /* 50 */
- (void *) rtems_partition_get_buffer, /* 51 */
- (void *) rtems_partition_return_buffer, /* 52 */
- (void *) rtems_region_create, /* 53 */
- (void *) rtems_region_extend, /* 54 */
- (void *) rtems_region_ident, /* 55 */
- (void *) rtems_region_delete, /* 56 */
- (void *) rtems_region_get_segment, /* 57 */
- (void *) rtems_region_get_segment_size, /* 58 */
- (void *) rtems_region_return_segment, /* 59 */
- (void *) rtems_port_create, /* 60 */
- (void *) rtems_port_ident, /* 61 */
- (void *) rtems_port_delete, /* 62 */
- (void *) rtems_port_external_to_internal, /* 63 */
- (void *) rtems_port_internal_to_external, /* 64 */
- (void *) rtems_io_initialize, /* 65 */
- (void *) rtems_io_register_name, /* 66 */
- (void *) rtems_io_lookup_name, /* 67 */
- (void *) rtems_io_open, /* 68 */
- (void *) rtems_io_close, /* 69 */
- (void *) rtems_io_read, /* 70 */
- (void *) rtems_io_write, /* 71 */
- (void *) rtems_io_control, /* 72 */
- (void *) rtems_fatal_error_occurred, /* 73 */
- (void *) rtems_rate_monotonic_create, /* 74 */
- (void *) rtems_rate_monotonic_ident, /* 75 */
- (void *) rtems_rate_monotonic_delete, /* 76 */
- (void *) rtems_rate_monotonic_cancel, /* 77 */
- (void *) rtems_rate_monotonic_period, /* 78 */
- (void *) rtems_multiprocessing_announce, /* 79 */
- (void *) rtems_debug_enable, /* 80 */
- (void *) rtems_debug_disable /* 81 */
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/inline/Makefile.in b/c/src/exec/sapi/inline/Makefile.in
deleted file mode 100644
index 634df7f643..0000000000
--- a/c/src/exec/sapi/inline/Makefile.in
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-I_PIECES= extension
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/exec/sapi/inline/extension.inl b/c/src/exec/sapi/inline/extension.inl
deleted file mode 100644
index 49cd834832..0000000000
--- a/c/src/exec/sapi/inline/extension.inl
+++ /dev/null
@@ -1,91 +0,0 @@
-/* extension.inl
- *
- * This file contains the static inline implementation of the inlined routines
- * from the Extension Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __EXTENSION_MANAGER_inl
-#define __EXTENSION_MANAGER_inl
-
-/*PAGE
- *
- * _Extension_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a extension control block from
- * the inactive chain of free extension control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Allocate( void )
-{
- return (Extension_Control *) _Objects_Allocate( &_Extension_Information );
-}
-
-/*PAGE
- *
- * _Extension_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a extension control block to the
- * inactive chain of free extension control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Extension_Free (
- Extension_Control *the_extension
-)
-{
- _Objects_Free( &_Extension_Information, &the_extension->Object );
-}
-
-/*PAGE
- *
- * _Extension_Get
- *
- * DESCRIPTION:
- *
- * This function maps extension IDs to extension control blocks.
- * If ID corresponds to a local extension, then it returns
- * the extension control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. Otherwise, location is set
- * to OBJECTS_ERROR and the returned value is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Extension_Control *)
- _Objects_Get( &_Extension_Information, id, location );
-}
-
-/*PAGE
- *
- * _Extension_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_extension is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Extension_Is_null (
- Extension_Control *the_extension
-)
-{
- return ( the_extension == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/inline/rtems/Makefile.in b/c/src/exec/sapi/inline/rtems/Makefile.in
deleted file mode 100644
index 634df7f643..0000000000
--- a/c/src/exec/sapi/inline/rtems/Makefile.in
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-I_PIECES= extension
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/exec/sapi/inline/rtems/extension.inl b/c/src/exec/sapi/inline/rtems/extension.inl
deleted file mode 100644
index 49cd834832..0000000000
--- a/c/src/exec/sapi/inline/rtems/extension.inl
+++ /dev/null
@@ -1,91 +0,0 @@
-/* extension.inl
- *
- * This file contains the static inline implementation of the inlined routines
- * from the Extension Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __EXTENSION_MANAGER_inl
-#define __EXTENSION_MANAGER_inl
-
-/*PAGE
- *
- * _Extension_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a extension control block from
- * the inactive chain of free extension control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Allocate( void )
-{
- return (Extension_Control *) _Objects_Allocate( &_Extension_Information );
-}
-
-/*PAGE
- *
- * _Extension_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a extension control block to the
- * inactive chain of free extension control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Extension_Free (
- Extension_Control *the_extension
-)
-{
- _Objects_Free( &_Extension_Information, &the_extension->Object );
-}
-
-/*PAGE
- *
- * _Extension_Get
- *
- * DESCRIPTION:
- *
- * This function maps extension IDs to extension control blocks.
- * If ID corresponds to a local extension, then it returns
- * the extension control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. Otherwise, location is set
- * to OBJECTS_ERROR and the returned value is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Extension_Control *)
- _Objects_Get( &_Extension_Information, id, location );
-}
-
-/*PAGE
- *
- * _Extension_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_extension is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Extension_Is_null (
- Extension_Control *the_extension
-)
-{
- return ( the_extension == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/macros/Makefile.in b/c/src/exec/sapi/macros/Makefile.in
deleted file mode 100644
index 634df7f643..0000000000
--- a/c/src/exec/sapi/macros/Makefile.in
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-I_PIECES= extension
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/exec/sapi/macros/extension.inl b/c/src/exec/sapi/macros/extension.inl
deleted file mode 100644
index 225f6b188d..0000000000
--- a/c/src/exec/sapi/macros/extension.inl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* extension.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the Extension Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __EXTENSION_inl
-#define __EXTENSION_inl
-
-/*PAGE
- *
- * _Extension_Allocate
- *
- */
-
-#define _Extension_Allocate() \
- (Extension_Control *) _Objects_Allocate( &_Extension_Information )
-
-/*PAGE
- *
- * _Extension_Free
- *
- */
-
-#define _Extension_Free( _the_extension ) \
- _Objects_Free( &_Extension_Information, &(_the_extension)->Object )
-
-/*PAGE
- *
- * _Extension_Get
- *
- */
-
-#define _Extension_Get( _id, _location ) \
- (Extension_Control *) \
- _Objects_Get( &_Extension_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Extension_Is_null
- *
- */
-
-#define _Extension_Is_null( _the_extension ) \
- ( (_the_extension) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/macros/rtems/Makefile.in b/c/src/exec/sapi/macros/rtems/Makefile.in
deleted file mode 100644
index 634df7f643..0000000000
--- a/c/src/exec/sapi/macros/rtems/Makefile.in
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-I_PIECES= extension
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/exec/sapi/macros/rtems/extension.inl b/c/src/exec/sapi/macros/rtems/extension.inl
deleted file mode 100644
index 225f6b188d..0000000000
--- a/c/src/exec/sapi/macros/rtems/extension.inl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* extension.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the Extension Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __EXTENSION_inl
-#define __EXTENSION_inl
-
-/*PAGE
- *
- * _Extension_Allocate
- *
- */
-
-#define _Extension_Allocate() \
- (Extension_Control *) _Objects_Allocate( &_Extension_Information )
-
-/*PAGE
- *
- * _Extension_Free
- *
- */
-
-#define _Extension_Free( _the_extension ) \
- _Objects_Free( &_Extension_Information, &(_the_extension)->Object )
-
-/*PAGE
- *
- * _Extension_Get
- *
- */
-
-#define _Extension_Get( _id, _location ) \
- (Extension_Control *) \
- _Objects_Get( &_Extension_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Extension_Is_null
- *
- */
-
-#define _Extension_Is_null( _the_extension ) \
- ( (_the_extension) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/sapi/optman/Makefile.in b/c/src/exec/sapi/optman/Makefile.in
deleted file mode 100644
index 7a78007848..0000000000
--- a/c/src/exec/sapi/optman/Makefile.in
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-C_FILES= no-ext.c no-io.c
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-PGMS=$(C_FILES:%.c=$(ARCH)/%.rel)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-ASM4FLAGS += -I $(PROJECT_INCLUDE)/rtems
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGMS)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
diff --git a/c/src/exec/sapi/optman/no-ext.c b/c/src/exec/sapi/optman/no-ext.c
deleted file mode 100644
index ae72a6e552..0000000000
--- a/c/src/exec/sapi/optman/no-ext.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Extension Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/extension.h>
-#include <rtems/score/interr.h>
-
-void _Extension_Manager_initialization(
- unsigned32 maximum_extensions
-)
-{
-}
-
-rtems_status_code rtems_extension_create(
- rtems_name name,
- rtems_extensions_table *extension_table,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_extension_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_extension_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/exec/sapi/optman/no-io.c b/c/src/exec/sapi/optman/no-io.c
deleted file mode 100644
index 7b38c436d4..0000000000
--- a/c/src/exec/sapi/optman/no-io.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Input/Output Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/io.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-void _IO_Manager_initialization(
- rtems_driver_address_table *driver_table,
- unsigned32 number_of_drivers,
- unsigned32 number_of_devices
-)
-{
-}
-
-void _IO_Initialize_all_drivers( void )
-{
-}
-
-rtems_status_code rtems_io_register_name(
- char *device_name,
- rtems_device_major_number major,
- rtems_device_minor_number minor
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_io_lookup_name(
- const char *pathname,
- rtems_driver_name_t **rnp
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_io_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_io_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_io_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_io_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_io_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_io_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/exec/sapi/src/Makefile.in b/c/src/exec/sapi/src/Makefile.in
deleted file mode 100644
index 23e87931c7..0000000000
--- a/c/src/exec/sapi/src/Makefile.in
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-C_PIECES= debug extension fatal exinit io posixapi rtemsapi
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D__RTEMS_INSIDE__
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) ${OBJS}
diff --git a/c/src/exec/sapi/src/debug.c b/c/src/exec/sapi/src/debug.c
deleted file mode 100644
index e44e837dc9..0000000000
--- a/c/src/exec/sapi/src/debug.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Debug Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/debug.h>
-
-/*PAGE
- *
- * _Debug_Manager_initialization
- */
-
-void _Debug_Manager_initialization( void )
-{
- rtems_debug_disable( RTEMS_DEBUG_ALL_MASK );
-}
-
-/*PAGE
- *
- * rtems_debug_enable
- */
-
-void rtems_debug_enable (
- rtems_debug_control to_be_enabled
-)
-{
- _Debug_Level |= to_be_enabled;
-}
-
-/*PAGE
- *
- * rtems_debug_disable
- */
-
-void rtems_debug_disable (
- rtems_debug_control to_be_disabled
-)
-{
- _Debug_Level &= ~to_be_disabled;
-}
-
-/*PAGE
- *
- * _Debug_Is_enabled
- */
-
-boolean _Debug_Is_enabled(
- rtems_debug_control level
-)
-{
- return (_Debug_Level & level);
-}
diff --git a/c/src/exec/sapi/src/exinit.c b/c/src/exec/sapi/src/exinit.c
deleted file mode 100644
index dabf21dcc0..0000000000
--- a/c/src/exec/sapi/src/exinit.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Initialization Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * SCORE_INIT and SAPI_INIT are defined so all of the super core and
- * super API data will be included in this object file.
- */
-
-#define SAPI_INIT
-#define SCORE_INIT
-
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/debug.h>
-#include <rtems/extension.h>
-#include <rtems/fatal.h>
-#include <rtems/init.h>
-#include <rtems/io.h>
-#include <rtems/score/sysstate.h>
-
-#include <rtems/score/apiext.h>
-#include <rtems/score/copyrt.h>
-#include <rtems/score/heap.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/userext.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/score/wkspace.h>
-
-#include <rtems/directives.h>
-#include <rtems/sptables.h>
-
-
-#include <rtems/rtems/rtemsapi.h>
-#ifdef RTEMS_POSIX_API
-#include <rtems/posix/posixapi.h>
-#endif
-
-/*PAGE
- *
- * rtems_initialize_executive
- *
- * This directive initializes all the kernels data structures
- * to the states necessary for the kernel to begin execution. All
- * include files that contain global variable definitions should be
- * included in this file. The system threads and initialization threads
- * are created and started by this routine. This routine then
- * initiates multithreading.
- *
- * Input parameters:
- * configuration_table - pointer to the user's configuration table
- * cpu_table - pointer to the user's CPU configuration table
- *
- * Output parameters: NONE
- */
-
-void rtems_initialize_executive(
- rtems_configuration_table *configuration_table,
- rtems_cpu_table *cpu_table
-)
-{
- rtems_interrupt_level bsp_level;
-
- bsp_level = rtems_initialize_executive_early(configuration_table, cpu_table);
- rtems_initialize_executive_late( bsp_level );
-}
-
-rtems_interrupt_level rtems_initialize_executive_early(
- rtems_configuration_table *configuration_table,
- rtems_cpu_table *cpu_table
-)
-{
- rtems_interrupt_level bsp_level;
- rtems_multiprocessing_table *multiprocessing_table;
-
- /*
- * Dispatching and interrupts are disabled until the end of the
- * initialization sequence. This prevents an inadvertent context
- * switch before the executive is initialized.
- */
-
- _ISR_Disable( bsp_level );
-
- if ( configuration_table == NULL )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_NO_CONFIGURATION_TABLE
- );
-
- /*
- * Initialize the system state based on whether this is an MP system.
- */
-
- multiprocessing_table = configuration_table->User_multiprocessing_table;
-
- _System_state_Handler_initialization(
- (multiprocessing_table) ? TRUE : FALSE
- );
-
- /*
- * Provided just for user convenience.
- */
-
- _Configuration_Table = configuration_table;
- _Configuration_MP_table = multiprocessing_table;
-
- /*
- * Internally we view single processor systems as a very restricted
- * multiprocessor system.
- */
-
- if ( multiprocessing_table == NULL )
- multiprocessing_table =
- (void *)&_Initialization_Default_multiprocessing_table;
-
- if ( cpu_table == NULL )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_NO_CPU_TABLE
- );
-
- _CPU_Initialize( cpu_table, _Thread_Dispatch );
-
- /*
- * Do this as early as possible to insure no debugging output
- * is even attempted to be printed.
- */
-
- _Debug_Manager_initialization();
-
- _API_extensions_Initialization();
-
- _Thread_Dispatch_initialization();
-
- _Workspace_Handler_initialization(
- (void *)configuration_table->work_space_start,
- configuration_table->work_space_size
- );
-
- _User_extensions_Handler_initialization(
- configuration_table->number_of_initial_extensions,
- configuration_table->User_extension_table
- );
-
- _ISR_Handler_initialization();
-
- _Objects_Handler_initialization(
- multiprocessing_table->node,
- multiprocessing_table->maximum_nodes,
- multiprocessing_table->maximum_global_objects
- );
-
- _Priority_Handler_initialization();
-
- _Watchdog_Handler_initialization();
-
- _TOD_Handler_initialization( configuration_table->microseconds_per_tick );
-
- _Thread_Handler_initialization(
- configuration_table->ticks_per_timeslice,
- configuration_table->maximum_extensions,
- multiprocessing_table->maximum_proxies
- );
-
- _MPCI_Handler_initialization(
- multiprocessing_table->User_mpci_table,
- RTEMS_TIMEOUT
- );
-
-/* MANAGERS */
-
- _Extension_Manager_initialization( configuration_table->maximum_extensions );
-
- _IO_Manager_initialization(
- configuration_table->Device_driver_table,
- configuration_table->number_of_device_drivers,
- configuration_table->maximum_devices
- );
-
- _RTEMS_API_Initialize( configuration_table );
-
-#ifdef RTEMS_POSIX_API
- _POSIX_API_Initialize( configuration_table );
-#endif
-
- _System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING );
-
- if ( cpu_table->pretasking_hook )
- (*cpu_table->pretasking_hook)();
-
- /*
- * No threads should be created before this point!!!
- *
- * At this point all API extensions are in place. After the call to
- * _Thread_Create_idle() _Thread_Executing will be set.
- * and _Thread_Heir are not set yet.
- */
-
- _Thread_Create_idle();
-
- _MPCI_Create_server();
-
- /*
- * Run the API and BSPs predriver hook.
- */
-
- _API_extensions_Run_predriver();
-
- if ( _CPU_Table.predriver_hook )
- (*_CPU_Table.predriver_hook)();
-
- /*
- * Initialize all the device drivers and initialize the MPCI layer.
- *
- * NOTE: The MPCI may be build upon a device driver.
- */
-
- _IO_Initialize_all_drivers();
-
- if ( _System_state_Is_multiprocessing ) {
- _MPCI_Initialization();
- _MPCI_Internal_packets_Send_process_packet(
- MPCI_PACKETS_SYSTEM_VERIFY
- );
- }
-
- /*
- * Run the APIs and BSPs postdriver hooks.
- *
- * The API extensions are supposed to create user initialization tasks.
- */
-
- _API_extensions_Run_postdriver();
-
- if ( _CPU_Table.postdriver_hook )
- (*_CPU_Table.postdriver_hook)();
-
- return bsp_level;
-}
-
-void rtems_initialize_executive_late(
- rtems_interrupt_level bsp_level
-)
-{
-
- _System_state_Set( SYSTEM_STATE_BEGIN_MULTITASKING );
-
- _Thread_Start_multitasking();
-
- /*
- * Restore the interrupt level to what the BSP had. Technically,
- * this is unnecessary since the BSP should have all interrupts
- * disabled when rtems_initialize_executive is invoked. But this keeps
- * the ISR Disable/Enable calls paired.
- */
-
- _ISR_Enable( bsp_level );
-}
-
-/*PAGE
- *
- * rtems_shutdown_executive
- *
- * This kernel routine shutdowns the executive. It halts multitasking
- * and returns control to the application execution "thread" which
- * initialially invoked the rtems_initialize_executive directive.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void rtems_shutdown_executive(
- unsigned32 result
-)
-{
- if ( _System_state_Current != SYSTEM_STATE_SHUTDOWN ) {
- _System_state_Set( SYSTEM_STATE_SHUTDOWN );
- _Thread_Stop_multitasking();
- }
-}
diff --git a/c/src/exec/sapi/src/extension.c b/c/src/exec/sapi/src/extension.c
deleted file mode 100644
index 09d9e09d33..0000000000
--- a/c/src/exec/sapi/src/extension.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Extension Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/extension.h>
-
-/*PAGE
- *
- * _Extension_Manager_initialization
- *
- * This routine initializes all extension manager related data structures.
- *
- * Input parameters:
- * maximum_extensions - number of extensions to initialize
- *
- * Output parameters: NONE
- */
-
-void _Extension_Manager_initialization(
- unsigned32 maximum_extensions
-)
-{
- _Objects_Initialize_information(
- &_Extension_Information,
- OBJECTS_RTEMS_EXTENSIONS,
- FALSE,
- maximum_extensions,
- sizeof( Extension_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-}
-
-/*PAGE
- *
- * rtems_extension_create
- *
- * This directive creates a extension and performs some initialization.
- *
- * Input parameters:
- * name - extension name
- * extension_table - pointer to extension set information
- * id - pointer to extension id
- *
- * Output parameters:
- * id - extension id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_extension_create(
- rtems_name name,
- rtems_extensions_table *extension_table,
- Objects_Id *id
-)
-{
- Extension_Control *the_extension;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- _Thread_Disable_dispatch(); /* to prevent deletion */
-
- the_extension = _Extension_Allocate();
-
- if ( !the_extension ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- _User_extensions_Add_set( &the_extension->Extension, extension_table );
-
- _Objects_Open( &_Extension_Information, &the_extension->Object, &name );
-
- *id = the_extension->Object.id;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_extension_ident
- *
- * This directive returns the system ID associated with
- * the extension name.
- *
- * Input parameters:
- * name - user defined message queue name
- * id - pointer to extension id
- *
- * Output parameters:
- * *id - message queue id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_extension_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id(
- &_Extension_Information,
- &name,
- OBJECTS_SEARCH_LOCAL_NODE,
- id
- );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_extension_delete
- *
- * This directive allows a thread to delete a extension.
- *
- * Input parameters:
- * id - extension id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_extension_delete(
- Objects_Id id
-)
-{
- Extension_Control *the_extension;
- Objects_Locations location;
-
- the_extension = _Extension_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INVALID_ID;
- case OBJECTS_LOCAL:
- _User_extensions_Remove_set( &the_extension->Extension );
- _Objects_Close( &_Extension_Information, &the_extension->Object );
- _Extension_Free( the_extension );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
diff --git a/c/src/exec/sapi/src/fatal.c b/c/src/exec/sapi/src/fatal.c
deleted file mode 100644
index d0fc3ff5c7..0000000000
--- a/c/src/exec/sapi/src/fatal.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Fatal Error Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/fatal.h>
-#include <rtems/score/interr.h>
-
-/*PAGE
- *
- * rtems_fatal_error_occurred
- *
- * This directive will invoke the internal fatal error handler.
- *
- * Input parameters:
- * the_error - fatal error status code
- *
- * Output parameters: NONE
- */
-
-void volatile rtems_fatal_error_occurred(
- unsigned32 the_error
-)
-{
- _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, FALSE, the_error );
-
-/* will not return from this routine */
-}
diff --git a/c/src/exec/sapi/src/io.c b/c/src/exec/sapi/src/io.c
deleted file mode 100644
index 92de490885..0000000000
--- a/c/src/exec/sapi/src/io.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Input/Output Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/io.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-
-#include <string.h>
-
-/*PAGE
- *
- * _IO_Manager_initialization
- *
- */
-
-void _IO_Manager_initialization(
- rtems_driver_address_table *driver_table,
- unsigned32 number_of_drivers,
- unsigned32 number_of_devices
-)
-{
- void *tmp;
- unsigned32 index;
- rtems_driver_name_t *np;
-
- _IO_Driver_address_table = driver_table;
- _IO_Number_of_drivers = number_of_drivers;
- _IO_Number_of_devices = number_of_devices;
-
- tmp = _Workspace_Allocate_or_fatal_error(
- sizeof( rtems_driver_name_t ) * ( number_of_devices + 1 )
- );
-
- _IO_Driver_name_table = (rtems_driver_name_t *) tmp;
-
- for( index=0, np = _IO_Driver_name_table ;
- index < _IO_Number_of_devices ;
- index++, np++ ) {
- np->device_name = 0;
- np->device_name_length = 0;
- np->major = 0;
- np->minor = 0;
- }
-}
-
-/*PAGE
- *
- * _IO_Initialize_all_drivers
- *
- * This routine initializes all device drivers
- *
- * Input Paramters: NONE
- *
- * Output Parameters: NONE
- */
-
-void _IO_Initialize_all_drivers( void )
-{
- rtems_device_major_number major;
-
- for ( major=0 ; major < _IO_Number_of_drivers ; major ++ )
- (void) rtems_io_initialize( major, 0, NULL);
-}
-
-/*PAGE
- *
- * rtems_io_register_name
- *
- * Associate a name with a driver
- *
- * Input Paramters:
- * device_name - pointer to name string to associate with device
- * major - device major number to receive name
- * minor - device minor number to receive name
- *
- * Output Parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_io_register_name(
- char *device_name,
- rtems_device_major_number major,
- rtems_device_minor_number minor
- )
-{
- rtems_driver_name_t *np;
- unsigned32 level;
- unsigned32 index;
-
- /* find an empty slot */
- for( index=0, np = _IO_Driver_name_table ;
- index < _IO_Number_of_devices ;
- index++, np++ )
- {
-
- _ISR_Disable(level);
- if (np->device_name == 0)
- {
- np->device_name = device_name;
- np->device_name_length = strlen(device_name);
- np->major = major;
- np->minor = minor;
- _ISR_Enable(level);
-
- return RTEMS_SUCCESSFUL;
- }
- _ISR_Enable(level);
- }
-
- return RTEMS_TOO_MANY;
-}
-
-/*PAGE
- *
- * rtems_io_lookup_name
- *
- * Find what driver "owns" this name
- *
- * Input Paramters:
- * name - name to lookup the associated device
- *
- * Output Parameters:
- * device_info - device associate with name
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_io_lookup_name(
- const char *name,
- rtems_driver_name_t **device_info
-)
-{
- rtems_driver_name_t *np;
- unsigned32 index;
-
- for( index=0, np = _IO_Driver_name_table ;
- index < _IO_Number_of_devices ;
- index++, np++ )
- if (np->device_name)
- if (strncmp(np->device_name, name, np->device_name_length) == 0)
- {
- *device_info = np;
- return RTEMS_SUCCESSFUL;
- }
-
- *device_info = 0;
- return RTEMS_UNSATISFIED;
-}
-
-
-/*PAGE
- *
- * rtems_io_initialize
- *
- * This routine is the initialization directive of the IO manager.
- *
- * Input Paramters:
- * major - device driver number
- * minor - device number
- * argument - pointer to argument(s)
- *
- * Output Parameters:
- * returns - return code
- */
-
-rtems_status_code rtems_io_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- rtems_device_driver_entry callout;
-
- if ( major >= _IO_Number_of_drivers )
- return RTEMS_INVALID_NUMBER;
-
- callout = _IO_Driver_address_table[major].initialization;
- return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_io_open
- *
- * This routine is the open directive of the IO manager.
- *
- * Input Paramters:
- * major - device driver number
- * minor - device number
- * argument - pointer to argument(s)
- *
- * Output Parameters:
- * returns - return code
- */
-
-rtems_status_code rtems_io_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- rtems_device_driver_entry callout;
-
- if ( major >= _IO_Number_of_drivers )
- return RTEMS_INVALID_NUMBER;
-
- callout = _IO_Driver_address_table[major].open;
- return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_io_close
- *
- * This routine is the close directive of the IO manager.
- *
- * Input Paramters:
- * major - device driver number
- * minor - device number
- * argument - pointer to argument(s)
- *
- * Output Parameters:
- * returns - return code
- */
-
-rtems_status_code rtems_io_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- rtems_device_driver_entry callout;
-
- if ( major >= _IO_Number_of_drivers )
- return RTEMS_INVALID_NUMBER;
-
- callout = _IO_Driver_address_table[major].close;
- return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_io_read
- *
- * This routine is the read directive of the IO manager.
- *
- * Input Paramters:
- * major - device driver number
- * minor - device number
- * argument - pointer to argument(s)
- *
- * Output Parameters:
- * returns - return code
- */
-
-rtems_status_code rtems_io_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- rtems_device_driver_entry callout;
-
- if ( major >= _IO_Number_of_drivers )
- return RTEMS_INVALID_NUMBER;
-
- callout = _IO_Driver_address_table[major].read;
- return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_io_write
- *
- * This routine is the write directive of the IO manager.
- *
- * Input Paramters:
- * major - device driver number
- * minor - device number
- * argument - pointer to argument(s)
- *
- * Output Parameters:
- * returns - return code
- */
-
-rtems_status_code rtems_io_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- rtems_device_driver_entry callout;
-
- if ( major >= _IO_Number_of_drivers )
- return RTEMS_INVALID_NUMBER;
-
- callout = _IO_Driver_address_table[major].write;
- return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_io_control
- *
- * This routine is the control directive of the IO manager.
- *
- * Input Paramters:
- * major - device driver number
- * minor - device number
- * argument - pointer to argument(s)
- *
- * Output Parameters:
- * returns - return code
- */
-
-rtems_status_code rtems_io_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- rtems_device_driver_entry callout;
-
- if ( major >= _IO_Number_of_drivers )
- return RTEMS_INVALID_NUMBER;
-
- callout = _IO_Driver_address_table[major].control;
- return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/exec/sapi/src/posixapi.c b/c/src/exec/sapi/src/posixapi.c
deleted file mode 100644
index cc41c30d20..0000000000
--- a/c/src/exec/sapi/src/posixapi.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * RTEMS API Initialization Support
- *
- * NOTE:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <assert.h>
-
-/*
- * POSIX_API_INIT is defined so all of the POSIX API
- * data will be included in this object file.
- */
-
-#define POSIX_API_INIT
-
-#include <rtems/system.h> /* include this before checking RTEMS_POSIX_API */
-#ifdef RTEMS_POSIX_API
-
-#include <sys/types.h>
-#include <rtems/config.h>
-#include <rtems/score/object.h>
-#include <rtems/posix/cond.h>
-#include <rtems/posix/config.h>
-#include <rtems/posix/key.h>
-#include <rtems/posix/mutex.h>
-#include <rtems/posix/priority.h>
-#include <rtems/posix/psignal.h>
-#include <rtems/posix/pthread.h>
-#include <rtems/posix/time.h>
-
-/*PAGE
- *
- * _POSIX_API_Initialize
- *
- * XXX
- */
-
-posix_api_configuration_table _POSIX_Default_configuration = {
- 0, /* maximum_threads */
- 0, /* maximum_mutexes */
- 0, /* maximum_condition_variables */
- 0, /* maximum_keys */
- 0, /* maximum_queued_signals */
- 0, /* number_of_initialization_threads */
- NULL /* User_initialization_threads_table */
-};
-
-
-void _POSIX_API_Initialize(
- rtems_configuration_table *configuration_table
-)
-{
- posix_api_configuration_table *api_configuration;
-
- /* XXX need to assert here based on size assumptions */
-
- assert( sizeof(pthread_t) == sizeof(Objects_Id) );
-
- api_configuration = configuration_table->POSIX_api_configuration;
- if ( !api_configuration )
- api_configuration = &_POSIX_Default_configuration;
-
- _POSIX_signals_Manager_Initialization(
- api_configuration->maximum_queued_signals
- );
-
- _POSIX_Threads_Manager_initialization(
- api_configuration->maximum_threads,
- api_configuration->number_of_initialization_threads,
- api_configuration->User_initialization_threads_table
- );
-
- _POSIX_Condition_variables_Manager_initialization(
- api_configuration->maximum_condition_variables
- );
-
- _POSIX_Key_Manager_initialization( api_configuration->maximum_keys );
-
- _POSIX_Mutex_Manager_initialization(
- api_configuration->maximum_mutexes
- );
-
-}
-
-#endif
-/* end of file */
diff --git a/c/src/exec/sapi/src/rtemsapi.c b/c/src/exec/sapi/src/rtemsapi.c
deleted file mode 100644
index d860ad7f99..0000000000
--- a/c/src/exec/sapi/src/rtemsapi.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * POSIX API Initialization Support
- *
- * NOTE:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * RTEMS_API_INIT is defined so all of the RTEMS API
- * data will be included in this object file.
- */
-
-#define RTEMS_API_INIT
-
-#include <rtems/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/rtemsapi.h>
-
-#include <rtems/rtems/intr.h>
-#include <rtems/rtems/clock.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/rtems/dpmem.h>
-#include <rtems/rtems/event.h>
-#include <rtems/rtems/message.h>
-#include <rtems/rtems/mp.h>
-#include <rtems/rtems/part.h>
-#include <rtems/rtems/ratemon.h>
-#include <rtems/rtems/region.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/rtems/signal.h>
-#include <rtems/rtems/timer.h>
-
-/*PAGE
- *
- * _RTEMS_API_Initialize
- *
- * XXX
- */
-
-void _RTEMS_API_Initialize(
- rtems_configuration_table *configuration_table
-)
-{
- rtems_api_configuration_table *api_configuration;
-
- api_configuration = configuration_table->RTEMS_api_configuration;
-
- _Attributes_Handler_initialization();
-
- _Interrupt_Manager_initialization();
-
- _Multiprocessing_Manager_initialization();
-
- _RTEMS_tasks_Manager_initialization(
- api_configuration->maximum_tasks,
- api_configuration->number_of_initialization_tasks,
- api_configuration->User_initialization_tasks_table
- );
-
- _Timer_Manager_initialization( api_configuration->maximum_timers );
-
- _Signal_Manager_initialization();
-
- _Event_Manager_initialization();
-
- _Message_queue_Manager_initialization(
- api_configuration->maximum_message_queues
- );
-
- _Semaphore_Manager_initialization( api_configuration->maximum_semaphores );
-
- _Partition_Manager_initialization( api_configuration->maximum_partitions );
-
- _Region_Manager_initialization( api_configuration->maximum_regions );
-
- _Dual_ported_memory_Manager_initialization( api_configuration->maximum_ports);
-
- _Rate_monotonic_Manager_initialization( api_configuration->maximum_periods );
-}
-
-/* end of file */
diff --git a/c/src/exec/score/Makefile.in b/c/src/exec/score/Makefile.in
deleted file mode 100644
index 3266e1fc58..0000000000
--- a/c/src/exec/score/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=headers $(INLINE) tools cpu src
diff --git a/c/src/exec/score/cpu/Makefile.in b/c/src/exec/score/cpu/Makefile.in
deleted file mode 100644
index a4e56fed6e..0000000000
--- a/c/src/exec/score/cpu/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=$(RTEMS_CPU)
diff --git a/c/src/exec/score/cpu/a29k/Makefile.in b/c/src/exec/score/cpu/a29k/Makefile.in
deleted file mode 100644
index f22da60b68..0000000000
--- a/c/src/exec/score/cpu/a29k/Makefile.in
+++ /dev/null
@@ -1,83 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-RELS=$(ARCH)/rtems-cpu.rel
-
-# C source names, if any, go here -- minus the .c
-# Normally cpu_asm and rtems are assembly files
-C_PIECES=cpu rtems
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/cpu.h $(srcdir)/a29k.h $(srcdir)/a29ktypes.h
-
-# H_FILES that get installed externally
-EXTERNAL_H_FILES = $(srcdir)/asm.h $(srcdir)/amd.ah \
- $(srcdir)/pswmacro.ah $(srcdir)/register.ah
-
-# Assembly source names, if any, go here -- minus the .s
-# Normally cpu_asm and rtems are assembly files
-S_PIECES=cpu_asm sig
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) $(EXTERNAL_H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) preinstall $(OBJS) $(RELS)
- $(INSTALL_VARIANT) -m 444 $(RELS) ${PROJECT_RELEASE}/lib
-
-$(ARCH)/rtems-cpu.rel: $(OBJS)
- $(make-rel)
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-
-preinstall: $(ARCH) \
- $(PROJECT_INCLUDE)/rtems/score/targopts.h \
- ${PROJECT_RELEASE}/lib/bsp_specs
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
-# we will share the basic cpu file
- $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
-
-$(PROJECT_INCLUDE)/rtems/score/targopts.h: $(ARCH)/targopts.h-tmp
- $(INSTALL) -m 444 $(ARCH)/targopts.h-tmp $@
-
-# $(ARCH)/targopts.h-tmp rule is in leaf.cfg
-
-${PROJECT_RELEASE}/lib/bsp_specs: $(ARCH)/bsp_specs.tmp
- $(INSTALL) -m 444 $(ARCH)/bsp_specs.tmp $@
-
-# $(ARCH)/bsp_specs.tmp rule is in leaf.cfg
diff --git a/c/src/exec/score/cpu/a29k/a29k.h b/c/src/exec/score/cpu/a29k/a29k.h
deleted file mode 100644
index c22a70d437..0000000000
--- a/c/src/exec/score/cpu/a29k/a29k.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* a29k.h
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- *
- */
-/* @(#)a29k.h 10/21/96 1.3 */
-
-#ifndef _INCLUDE_A29K_h
-#define _INCLUDE_A29K_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This file contains the information required to build
- * RTEMS for a particular member of the "no cpu"
- * family when executing in protected mode. It does
- * this by setting variables to indicate which implementation
- * dependent features are present in a particular member
- * of the family.
- */
-
-#if defined(a29205)
-
-#define CPU_MODEL_NAME "a29205"
-#define A29K_HAS_FPU 0
-
-#else
-
-#error "Unsupported CPU Model"
-
-#endif
-
-/*
- * Define the name of the CPU family.
- */
-
-#define CPU_NAME "AMD 29K"
-
-/*
- * Some bits in the CPS:
- */
-#define TD 0x20000
-#define DI 0x00002
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! _INCLUDE_A29K_h */
-/* end of include file */
diff --git a/c/src/exec/score/cpu/a29k/a29ktypes.h b/c/src/exec/score/cpu/a29k/a29ktypes.h
deleted file mode 100644
index 943a922695..0000000000
--- a/c/src/exec/score/cpu/a29k/a29ktypes.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* no_cputypes.h
- *
- * This include file contains type definitions pertaining to the Intel
- * no_cpu processor family.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __NO_CPU_TYPES_h
-#define __NO_CPU_TYPES_h
-
-#ifndef ASM
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* unsigned 8-bit integer */
-typedef unsigned short unsigned16; /* unsigned 16-bit integer */
-typedef unsigned int unsigned32; /* unsigned 32-bit integer */
-typedef unsigned long unsigned64; /* unsigned 64-bit integer */
-
-typedef unsigned16 Priority_Bit_map_control;
-
-typedef signed char signed8; /* 8-bit signed integer */
-typedef signed short signed16; /* 16-bit signed integer */
-typedef signed int signed32; /* 32-bit signed integer */
-typedef signed long signed64; /* 64 bit signed integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-typedef void no_cpu_isr;
-typedef void ( *no_cpu_isr_entry )( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !ASM */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/cpu/a29k/amd.ah b/c/src/exec/score/cpu/a29k/amd.ah
deleted file mode 100644
index 006e7e15e7..0000000000
--- a/c/src/exec/score/cpu/a29k/amd.ah
+++ /dev/null
@@ -1,531 +0,0 @@
-; /* @(#)amd.ah 1.1 96/05/23 08:56:58, TEI */
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Initialization values for registers after RESET
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;
-: /* $Id$ */
-;* File information and includes.
-
- .file "amd.ah"
- .ident "@(#)amd.ah 1.1 96/05/23 08:56:58, TEI"
-
-
-
-;
-;* AMD PROCESSOR SPECIFIC VALUES...
-;
-
-;
-;* Processor revision levels...
-;
-
-; PRL values: 31-28 27-24
-; Am29000 0 x
-; Am29005 1 x
-; Am29050 2 x
-; Am29035 3 x
-; Am29030 4 x
-; Am29200 5 x
-; Am29205 5 1x
-; Am29240 6 0
-; Manx 7 0
-; Cougar 8 0
-
-
- .equ AM29000_PRL, 0x00
-
- .equ AM29005_PRL, 0x10
-
- .equ AM29050_PRL, 0x20
-
- .equ AM29035_PRL, 0x30
-
- .equ AM29030_PRL, 0x40
-
- .equ AM29200_PRL, 0x50
-
- .equ AM29205_PRL, 0x58
-
- .equ AM29240_PRL, 0x60
-
- .equ AM29040_PRL, 0x70
-
- .equ MANX_PRL, 0x70
-
- .equ COUGAR_PRL, 0x80
-
-;
-;* data structures sizes.
-;
- .equ CFGINFO_SIZE, 16*4
-
- .equ PGMINFO_SIZE, 16*4
-
- .equ VARARGS_SPACE, 16*4
-
- .equ WINDOWSIZE, 0x80
-;
-;* Am29027 Mode registers
-;
-
- .equ Am29027Mode1, 0x0fc00820
-
- .equ Am29027Mode2, 0x00001375
-
-
-
-;* Processor Based Equates and Defines
-
- .equ SIG_SYNC, -1
-
- .equ ENABLE, (SM)
-
- .equ DISABLE, (ENABLE | DI | DA)
-
- .equ DISABLE_FZ, (FZ | ENABLE | DI | DA)
-
- .equ CLR_TRAP, (FZ | DA)
-
- .equ InitOPS, (TD | SM | (3<<IMShift) | DI | DA)
-
- .equ InitCPS, (TD | SM | (0<<IMShift) | DI | DA)
-
- .equ InitCPS1, (TD | SM | (0<<IMShift) | DI )
-
- .equ CPS_TMR, (SM | (0<<IMShift) | DI)
-
- .equ CPS_INT0, (TD | SM | (0<<IMShift))
-
- .equ CPS_TMRINT0, (SM | (0<<IMShift))
-
- .equ InitCFG, 0x0
-
- .equ InitRBP, (B0|B1|B2|B3|B4|B5)
-
- .equ TMC_VALUE, 0xFFFFFF
-
- .equ TMR_VALUE, (IE | TMC_VALUE)
-
-
-
-
-
-
-;* 29205 specific (internal) peripheral initialization constants.
-
-; Current Processor Status (CPS) Register.
-; Old Processor Status Register (OPS).
-
- .equ DA, 0x00001
- .equ DI, 0x00002
- .equ IMShift,0x2
- .equ SM, 0x00010
- .equ PI, 0x00020
- .equ PD, 0x00040
- .equ WM, 0x00080
- .equ RE, 0x00100
- .equ LK, 0x00200
- .equ FZ, 0x00400
- .equ TU, 0x00800
- .equ TP, 0x01000
- .equ TE, 0x02000
- .equ IP, 0x04000
- .equ CA, 0x08000
- .equ MM, 0x10000
- .equ TD, 0x20000
-
-; Configuration Register (CFG)
-
- .equ CD, 0x01
- .equ CP, 0x02
- .equ BO, 0x04
- .equ RV, 0x08
- .equ VF, 0x10
- .equ DW, 0x20
- .equ CO, 0x40
- .equ EE, 0x80
- .equ IDShift, 8
- .equ CFG_ID, 0x100
- .equ ILShift, 9
- .equ CFG_ILMask, 0x600
- .equ DDShift, 11
- .equ CFG_DD, 0x800
- .equ DLShift, 12
- .equ CFG_DLMask, 0x3000
- .equ PCEShift, 14
- .equ CFG_PCE, 0x4000
- .equ PMBShift, 16
- .equ D16, 0x8000
- .equ TBOShift, 23
- .equ PRLShift, 24
-
-; Channel Control Register (CHC)
-
- .equ CV, 0x1
- .equ NN, 0x2
- .equ TRShift, 2
- .equ TF, 0x400
- .equ PER, 0x800
- .equ LA, 0x1000
- .equ ST, 0x2000
- .equ ML, 0x4000
- .equ LS, 0x8000
- .equ CRShift, 16
- .equ CNTLShift, 24
- .equ CEShift, 31
- .equ WBERShift, 31
-
-; Register Bank Protect (RBP)
- .equ B0, 0x1
- .equ B1, 0x2
- .equ B2, 0x4
- .equ B3, 0x8
- .equ B4, 0x10
- .equ B5, 0x20
- .equ B6, 0x40
- .equ B7, 0x80
- .equ B8, 0x100
- .equ B9, 0x200
- .equ B10, 0x400
- .equ B11, 0x800
- .equ B12, 0x1000
- .equ B13, 0x2000
- .equ B14, 0x4000
- .equ B15, 0x8000
-
-; Timer Counter
-
- .equ TCVMask, 0xffffff
-
-; Timer Reload Register
-
- .equ IE, 0x1000000
- .equ IN, 0x2000000
- .equ OV, 0x4000000
- .equ TRVMAsk, 0xffffff
-
-; MMU Configuration
-
- .equ PSShift, 8
- .equ PS0Shift, 8
- .equ PS1Shift, 12
-
-; LRU Recommendation (LRU)
- .equ LRUMask, 0xff
-
-; Reason Vector (RSN)
- .equ RSNMask, 0xff
-
-; Region Mapping Address (RMA0 | RMA1)
- .equ PBAMask,0xffff
- .equ VBAShift, 16
-
-; Region Mapping Control (RMC0 | RMC1)
- .equ TIDMask, 0xff
- .equ RMC_UE, 0x100
- .equ RMC_UW, 0x200
- .equ RMC_UR, 0x400
- .equ RMC_SE, 0x800
- .equ RMC_SW, 0x1000
- .equ RMC_SR, 0x2000
- .equ RMC_VE, 0x4000
- .equ RMC_IO, 0x10000
- .equ RGSShift, 17
- .equ RMC_PGMShift, 22
-
-; Instruction breakpoint Control (IBC0 | IBC1)
- .equ BPIDMask, 0xff
- .equ BTE, 0x100
- .equ BRM, 0x200
- .equ IBC_BSY, 0x400
- .equ BEN, 0x800
- .equ BHO, 0x1000
-
-; Cache Data Register (CDR)
- .equ CDR_US, 0x1
- .equ P, 0x2
- .equ CDR_V, 0x4
- .equ IATAGShift, 20
-
-; Cache Interface Register (CIR)
- .equ CPTRShift, 2
- .equ CIR_RW, 0x1000000
- .equ FSELShift, 28
-
-; Indirect Pointer A, B, C (IPA, IPB, IPC)
- .equ IPShift, 2
-
-; ALU Status (ALU)
- .equ FCMask, 0x1F
- .equ BPShift, 5
- .equ C, 0x80
- .equ Z, 0x100
- .equ N, 0x200
- .equ ALU_V, 0x400
- .equ DF, 0x800
-
-; Byte Pointer
- .equ BPMask, 0x3
-
-; Load/Store Count Remaining (CR)
- .equ CRMask, 0xff
-
-; Floating Point Environment (FPE)
- .equ NM, 0x1
- .equ RM, 0x2
- .equ VM, 0x4
- .equ UM, 0x8
- .equ XM, 0x10
- .equ DM, 0x20
- .equ FRMShift, 6
- .equ FF, 0x100
- .equ ACFShift, 9
-
-; Integer Environment (INTE)
- .equ MO, 0x1
- .equ DO, 0x2
-
-; Floating Point Status (FPS)
- .equ NS, 0x1
- .equ RS, 0x2
- .equ VS, 0x4
- .equ FPS_US, 0x8
- .equ XS, 0x10
- .equ DS, 0x20
- .equ NT, 0x100
- .equ RT, 0x200
- .equ VT, 0x400
- .equ UT, 0x800
- .equ XT, 0x1000
- .equ DT, 0x2000
-
-; Exception Opcode (EXOP)
- .equ IOPMask, 0xff
-
-; TLB Entry Word 0
-; .equ TIDMask, 0xff already defined above
- .equ TLB_UE, 0x100
- .equ TLB_UW, 0x200
- .equ TLB_UR, 0x400
- .equ TLB_SE, 0x800
- .equ TLB_SW, 0x1000
- .equ TLB_SR, 0x2000
- .equ TLB_VE, 0x4000
- .equ VTAGShift, 15
-
-; TLB Entry Word 1
- .equ TLB_IO, 0x1
- .equ U, 0x2
- .equ TLB_PGMShift, 6
- .equ RPNShift, 10
-
-; Am29200 ROM Control bits.
- .equ RMCT_DW0Shift, 29
- .equ RMCT_DW1Shift, 21
- .equ RMCT_DW2Shift, 13
- .equ RMCT_DW3Shift, 5
-
-; Am29200 DRAM Control bits.
- .equ DW3, (1<<18)
- .equ DW2, (1<<22)
- .equ DW1, (1<<26)
- .equ DW0, (1<<30)
-
- ; Internal peripheral address assignments.
- .equ RMCT, 0x80000000
- .equ RMCF, 0x80000004
- .equ DRCT, 0x80000008
- .equ DRCF, 0x8000000C
- .equ DRM0, 0x80000010
- .equ DRM1, 0x80000014
- .equ DRM2, 0x80000018
- .equ DRM3, 0x8000001C
- .equ PIACT0, 0x80000020
- .equ PIACT1, 0x80000020
- .equ ICT, 0x80000028
- .equ DMCT0, 0x80000030
- .equ DMAD0, 0x80000034
- .ifdef revA
- .equ TAD0, 0x80000036
- .equ TCN0, 0x8000003A
- .else
- .equ TAD0, 0x80000070 ; default
- .equ TCN0, 0x8000003C ; default
- .endif
- .equ DMCN0, 0x80000038
- .equ DMCT1, 0x80000040
- .equ DMAD1, 0x80000044
- .equ DMCN1, 0x80000048
- .equ SPCT, 0x80000080
- .equ SPST, 0x80000084
- .equ SPTH, 0x80000088
- .equ SPRB, 0x8000008C
- .equ BAUD, 0x80000090
- .equ PPCT, 0x800000C0
- .equ PPST, 0x800000C1
- .equ PPDT, 0x800000C4
- .equ POCT, 0x800000D0
- .equ PIN, 0x800000D4
- .equ POUT, 0x800000D8
- .equ POEN, 0x800000DC
- .equ VCT, 0x800000E0
- .equ TOP, 0x800000E4
- .equ SIDE, 0x800000E8
- .equ VDT, 0x800000EC
-
- ; Interrupt Controller Register bits.
- .equ TXDI, (1<<5)
- .equ RXDI, (1<<6)
- .equ RXSI, (1<<7)
- .equ PPI, (1<<11)
- .equ DMA1I, (1<<13)
- .equ DMA0I, (1<<14)
- .equ IOPIMask, (0xFF<<16)
- .equ VDI, (1<<27)
- .equ ICT200_I, (TXDI|RXDI|RXSI|PPI|DMA1I|DMA0I|IOPIMask|VDI)
- .equ ICT205_I, (TXDI|RXDI|RXSI|PPI|DMA1I|DMA0I|IOPIMask|VDI)
-
- ; Serial port Initialization bits
- .equ NO_PARITY, 0
-
-
- ; SPST bits
- .equ THREShift, 22
-
-;* REGISTER Addresses
-
- .equ ROMCntlRegAddr, 0x80000000
-
- .equ ROMCfgRegAddr, 0x80000004
-
- .equ DRAMCntlRegAddr, 0x80000008
-
- .equ DRAMCfgRegAddr, 0x8000000C
-
- .equ DRAMMap0RegAddr, 0x80000010
-
- .equ DRAMMap1RegAddr, 0x80000014
-
- .equ DRAMMap2RegAddr, 0x80000018
-
- .equ DRAMMap3RegAddr, 0x8000001C
-
- .equ PIACntl0RegAddr, 0x80000020
-
- .equ PIACntl1RegAddr, 0x80000024
-
- .equ INTRCntlRegAddr, 0x80000028
-
- .equ DMACntl0RegAddr, 0x80000030
-
- .equ DMACntl1RegAddr, 0x80000040
-
- .equ SERPortCntlRegAddr, 0x80000080
-
- .equ SERPortStatRegAddr, 0x80000084
-
- .equ SERPortTHLDRegAddr, 0x80000088
-
- .equ SERPortRbufRegAddr, 0x8000008C
-
- .equ SERPortBaudRegAddr, 0x80000090
-
- .equ PARPortCntlRegAddr, 0x800000C0
-
- .equ PIOCntlRegAddr, 0x800000D0
-
- .equ PIOInpRegAddr, 0x800000D4
-
- .equ PIOOutRegAddr, 0x800000D8
-
- .equ PIOOutEnaRegAddr, 0x800000DC
-
- .equ VCTCntlRegAddr, 0x800000E0
-
-;
-;* Control constants
-;
-
-;* AM29030 Timer related constants.
-
- .equ TMR_IE, 0x01000000
-
- .equ TMR_IN, 0x02000000
-
- .equ TMR_OV, 0x04000000
-
- .equ TMC_INITCNT, 1613
-
-;
-;* System initialization values.
-;
-
- .equ __os_version, 0x0001 ;
-
- .equ STACKSize, 0x8000 ;
-
- .equ PGMExecMode, 0x0000 ;
-
- .equ TSTCK_OFST, 28 * 4
-
- .equ CSTCK_OFST, 29 * 4
-
- .equ TMSTCK_OFST, 30 * 4
-
- .equ CMSTCK_OFST, 31 * 4
-
- .equ CTXSW_OK, 0xA55A ; ctx switch ok
-
- .set NV_STARTOFST, 0x20 ; 32 bytes
-
- .set NV_BAUDOFST, 0x00 ; 00 bytes
-
- .set reg_cir, 29
-
- .set reg_cdr, 30
-
- .equ MSG_BUFSIZE, 0x1000 ; serial buffer size
-
- .equ ILLOPTRAP, 0
-
- .equ UATRAP, 1
-
- .equ PVTRAP, 5
-
- .equ UITLBMISSTRAP, 8
-
- .equ UDTLBMISSTRAP, 9
-
- .equ TIMERTRAP, 14
-
- .equ TRACETRAP, 15
-
- .equ XLINXTRAP, 16
-
- .equ SERIALTRAP, 17
-
- .equ SLOWTMRTRAP, 18
-
- .equ PORTTRAP, 19
-
- .equ SVSCTRAP, 80
-
- .equ SVSCTRAP1, 81
-
- .equ V_CACHETRAP, 66 ;
-
- .equ V_SETSERVICE, 67 ;
-
- .equ INIT_TIMER, 100
-
- .equ DISABLE_TIMER, 101
-
- .equ GET_TIMER, 102
-
- .equ CLEAR_TIMER, 103
-
- .equ V_SPILL, 64
-
- .equ V_FILL, 65
-
- .equ SIGDFL, 105
diff --git a/c/src/exec/score/cpu/a29k/asm.h b/c/src/exec/score/cpu/a29k/asm.h
deleted file mode 100644
index 5622b124ce..0000000000
--- a/c/src/exec/score/cpu/a29k/asm.h
+++ /dev/null
@@ -1,103 +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.
- *
- * !!! THIS FILE DOES NOT APPEAR TO HAVE BEEN USED IN THE 29K PORT !!!
- *
- * 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-1997
- * On-Line Applications Research Corporation (OAR).
- *
- * $Id$
- */
-
-#ifndef __A29K_ASM_h
-#define __A29K_ASM_h
-
-/*
- * Indicate we are in an assembly file and get the basic CPU definitions.
- */
-
-#ifndef ASM
-#define ASM
-#endif
-#include <rtems/score/targopts.h>
-#include <rtems/score/asm.h>
-
-/*
- * 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/c/src/exec/score/cpu/a29k/cpu.c b/c/src/exec/score/cpu/a29k/cpu.c
deleted file mode 100644
index 111533a2ae..0000000000
--- a/c/src/exec/score/cpu/a29k/cpu.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * AMD 29K CPU Dependent Source
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 lint
-static char _sccsid[] = "@(#)cpu.c 10/21/96 1.8\n";
-#endif
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/thread.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-void a29k_ISR_Handler(unsigned32 vector);
-
-/* _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 */
-)
-{
- unsigned int i;
- /*
- * The thread_dispatch argument is the address of the entry point
- * for the routine called at the end of an ISR once it has been
- * decided a context switch is necessary. On some compilation
- * systems it is difficult to call a high-level language routine
- * from assembly. This allows us to trick these systems.
- *
- * If you encounter this problem save the entry point in a CPU
- * dependent variable.
- */
-
- _CPU_Thread_dispatch_pointer = thread_dispatch;
-
- /*
- * If there is not an easy way to initialize the FP context
- * during Context_Initialize, then it is usually easier to
- * save an "uninitialized" FP context here and copy it to
- * the task's during Context_Initialize.
- */
-
- /* FP context initialization support goes here */
-
- _CPU_Table = *cpu_table;
-
- for ( i = 0; i < ISR_NUMBER_OF_VECTORS; i++ )
- {
- _ISR_Vector_table[i] = (proc_ptr)NULL;
- }
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- unsigned32 cps;
-
- /*
- * This routine returns the current interrupt level.
- */
- cps = a29k_getops();
- if (cps & (TD|DI))
- return 1;
- else
- return 0;
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-extern void intr14( void );
-extern void intr18( void );
-extern void intr19( void );
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- /*
- * This is where we install the interrupt handler into the "raw" interrupt
- * table used by the CPU to dispatch interrupt handlers.
- */
- switch( vector )
- {
- case 14:
- _settrap( vector, intr14 );
- break;
- case 18:
- _settrap( vector, intr18 );
- break;
- case 19:
- _settrap( vector, intr19 );
- break;
-
- default:
- break;
- }
-}
-
-
-/*PAGE
- *
- * _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
-)
-{
- *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.
- */
-
- _CPU_ISR_install_raw_handler( vector, new_handler, old_handler );
-
- /*
- * 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;
-}
-
-/*PAGE
- *
- * _CPU_Install_interrupt_stack
- */
-
-void _CPU_Install_interrupt_stack( void )
-{
-}
-
-/*PAGE
- *
- * _CPU_Internal_threads_Idle_thread_body
- *
- * NOTES:
- *
- * 1. This is the same as the regular CPU independent algorithm.
- *
- * 2. If you implement this using a "halt", "idle", or "shutdown"
- * instruction, then don't forget to put it in an infinite loop.
- *
- * 3. Be warned. Some processors with onboard DMA have been known
- * to stop the DMA if the CPU were put in IDLE mode. This might
- * also be a problem with other on-chip peripherals. So use this
- * hook with caution.
- */
-
-void _CPU_Internal_threads_Idle_thread_body( void )
-{
-
- for( ; ; )
- {
- }
- /* insert your "halt" instruction here */ ;
-}
-
-void a29k_fatal_error( unsigned32 error )
-{
- printf("\n\nfatal error %d, rebooting!!!\n",error );
- exit(error);
-}
-
- /*
- * This discussion ignores a lot of the ugly details in a real
- * implementation such as saving enough registers/state to be
- * able to do something real. Keep in mind that the goal is
- * to invoke a user's ISR handler which is written in C and
- * uses a certain set of registers.
- *
- * Also note that the exact order is to a large extent flexible.
- * Hardware will dictate a sequence for a certain subset of
- * _ISR_Handler while requirements for setting
- */
-
- /*
- * At entry to "common" _ISR_Handler, the vector number must be
- * available. On some CPUs the hardware puts either the vector
- * number or the offset into the vector table for this ISR in a
- * known place. If the hardware does not give us this information,
- * then the assembly portion of RTEMS for this port will contain
- * a set of distinct interrupt entry points which somehow place
- * the vector number in a known place (which is safe if another
- * interrupt nests this one) and branches to _ISR_Handler.
- *
- */
-
-void a29k_ISR_Handler(unsigned32 vector)
-{
- _ISR_Nest_level++;
- _Thread_Dispatch_disable_level++;
- if ( _ISR_Vector_table[ vector ] )
- (*_ISR_Vector_table[ vector ])( vector );
- --_Thread_Dispatch_disable_level;
- --_ISR_Nest_level;
- if ( !_Thread_Dispatch_disable_level && !_ISR_Nest_level &&
- (_Context_Switch_necessary || _ISR_Signals_to_thread_executing ))
- _Thread_Dispatch();
- return;
-}
diff --git a/c/src/exec/score/cpu/a29k/cpu.h b/c/src/exec/score/cpu/a29k/cpu.h
deleted file mode 100644
index 3bc939ca91..0000000000
--- a/c/src/exec/score/cpu/a29k/cpu.h
+++ /dev/null
@@ -1,983 +0,0 @@
-/* cpu.h
- *
- * This include file contains information pertaining to the AMD 29K
- * processor.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu_asm.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-/* @(#)cpu.h 10/21/96 1.11 */
-
-#ifndef __CPU_h
-#define __CPU_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/a29k.h> /* pick up machine definitions */
-#ifndef ASM
-#include <rtems/score/a29ktypes.h>
-#endif
-
-extern unsigned int a29k_disable( void );
-extern void a29k_enable( unsigned int cookie );
-extern unsigned int a29k_getops( void );
-extern void a29k_getops_sup( void );
-extern void a29k_disable_sup( void );
-extern void a29k_enable_sup( void );
-extern void a29k_disable_all( void );
-extern void a29k_disable_all_sup( void );
-extern void a29k_enable_all( void );
-extern void a29k_enable_all_sup( void );
-extern void a29k_halt( void );
-extern void a29k_fatal_error( unsigned32 error );
-extern void a29k_as70( void );
-extern void a29k_super_mode( void );
-extern void a29k_context_switch_sup(void);
-extern void a29k_context_restore_sup(void);
-extern void a29k_context_save_sup(void);
-extern void a29k_sigdfl_sup(void);
-
-/* conditional compilation parameters */
-
-/*
- * Should the calls to _Thread_Enable_dispatch be inlined?
- *
- * If TRUE, then they are inlined.
- * If FALSE, then a subroutine call is made.
- *
- * Basically this is an example of the classic trade-off of size
- * versus speed. Inlining the call (TRUE) typically increases the
- * size of RTEMS while speeding up the enabling of dispatching.
- * [NOTE: In general, the _Thread_Dispatch_disable_level will
- * only be 0 or 1 unless you are in an interrupt handler and that
- * interrupt handler invokes the executive.] When not inlined
- * something calls _Thread_Enable_dispatch which in turns calls
- * _Thread_Dispatch. If the enable dispatch is inlined, then
- * one subroutine call is avoided entirely.]
- */
-
-#define CPU_INLINE_ENABLE_DISPATCH TRUE
-
-/*
- * Should the body of the search loops in _Thread_queue_Enqueue_priority
- * be unrolled one time? In unrolled each iteration of the loop examines
- * two "nodes" on the chain being searched. Otherwise, only one node
- * is examined per iteration.
- *
- * If TRUE, then the loops are unrolled.
- * If FALSE, then the loops are not unrolled.
- *
- * The primary factor in making this decision is the cost of disabling
- * and enabling interrupts (_ISR_Flash) versus the cost of rest of the
- * body of the loop. On some CPUs, the flash is more expensive than
- * one iteration of the loop body. In this case, it might be desirable
- * to unroll the loop. It is important to note that on some CPUs, this
- * code is the longest interrupt disable period in RTEMS. So it is
- * necessary to strike a balance when setting this parameter.
- */
-
-#define CPU_UNROLL_ENQUEUE_PRIORITY TRUE
-
-/*
- * Does RTEMS manage a dedicated interrupt stack in software?
- *
- * If TRUE, then a stack is allocated in _Interrupt_Manager_initialization.
- * If FALSE, nothing is done.
- *
- * If the CPU supports a dedicated interrupt stack in hardware,
- * then it is generally the responsibility of the BSP to allocate it
- * and set it up.
- *
- * If the CPU does not support a dedicated interrupt stack, then
- * the porter has two options: (1) execute interrupts on the
- * stack of the interrupted task, and (2) have RTEMS manage a dedicated
- * interrupt stack.
- *
- * If this is TRUE, CPU_ALLOCATE_INTERRUPT_STACK should also be TRUE.
- *
- * Only one of CPU_HAS_SOFTWARE_INTERRUPT_STACK and
- * CPU_HAS_HARDWARE_INTERRUPT_STACK should be set to TRUE. It is
- * possible that both are FALSE for a particular CPU. Although it
- * is unclear what that would imply about the interrupt processing
- * procedure on that CPU.
- */
-
-#define CPU_HAS_SOFTWARE_INTERRUPT_STACK FALSE
-
-/*
- * Does this CPU have hardware support for a dedicated interrupt stack?
- *
- * If TRUE, then it must be installed during initialization.
- * If FALSE, then no installation is performed.
- *
- * If this is TRUE, CPU_ALLOCATE_INTERRUPT_STACK should also be TRUE.
- *
- * Only one of CPU_HAS_SOFTWARE_INTERRUPT_STACK and
- * CPU_HAS_HARDWARE_INTERRUPT_STACK should be set to TRUE. It is
- * possible that both are FALSE for a particular CPU. Although it
- * is unclear what that would imply about the interrupt processing
- * procedure on that CPU.
- */
-
-#define CPU_HAS_HARDWARE_INTERRUPT_STACK FALSE
-
-/*
- * Does RTEMS allocate a dedicated interrupt stack in the Interrupt Manager?
- *
- * If TRUE, then the memory is allocated during initialization.
- * If FALSE, then the memory is allocated during initialization.
- *
- * This should be TRUE is CPU_HAS_SOFTWARE_INTERRUPT_STACK is TRUE
- * or CPU_INSTALL_HARDWARE_INTERRUPT_STACK is TRUE.
- */
-
-#define CPU_ALLOCATE_INTERRUPT_STACK FALSE
-
-/*
- * Does the RTEMS invoke the user's ISR with the vector number and
- * a pointer to the saved interrupt frame (1) or just the vector
- * number (0)?
- */
-
-#define CPU_ISR_PASSES_FRAME_POINTER 0
-
-/*
- * Does the CPU have hardware floating point?
- *
- * If TRUE, then the RTEMS_FLOATING_POINT task attribute is supported.
- * If FALSE, then the RTEMS_FLOATING_POINT task attribute is ignored.
- *
- * If there is a FP coprocessor such as the i387 or mc68881, then
- * the answer is TRUE.
- *
- * The macro name "NO_CPU_HAS_FPU" should be made CPU specific.
- * It indicates whether or not this CPU model has FP support. For
- * example, it would be possible to have an i386_nofp CPU model
- * which set this to false to indicate that you have an i386 without
- * an i387 and wish to leave floating point support out of RTEMS.
- */
-
-#if ( A29K_HAS_FPU == 1 )
-#define CPU_HARDWARE_FP TRUE
-#else
-#define CPU_HARDWARE_FP FALSE
-#endif
-
-/*
- * Are all tasks RTEMS_FLOATING_POINT tasks implicitly?
- *
- * If TRUE, then the RTEMS_FLOATING_POINT task attribute is assumed.
- * If FALSE, then the RTEMS_FLOATING_POINT task attribute is followed.
- *
- * So far, the only CPU in which this option has been used is the
- * HP PA-RISC. The HP C compiler and gcc both implicitly use the
- * floating point registers to perform integer multiplies. If
- * a function which you would not think utilize the FP unit DOES,
- * then one can not easily predict which tasks will use the FP hardware.
- * In this case, this option should be TRUE.
- *
- * If CPU_HARDWARE_FP is FALSE, then this should be FALSE as well.
- */
-
-#define CPU_ALL_TASKS_ARE_FP FALSE
-
-/*
- * Should the IDLE task have a floating point context?
- *
- * If TRUE, then the IDLE task is created as a RTEMS_FLOATING_POINT task
- * and it has a floating point context which is switched in and out.
- * If FALSE, then the IDLE task does not have a floating point context.
- *
- * Setting this to TRUE negatively impacts the time required to preempt
- * the IDLE task from an interrupt because the floating point context
- * must be saved as part of the preemption.
- */
-
-#define CPU_IDLE_TASK_IS_FP FALSE
-
-/*
- * Should the saving of the floating point registers be deferred
- * until a context switch is made to another different floating point
- * task?
- *
- * If TRUE, then the floating point context will not be stored until
- * necessary. It will remain in the floating point registers and not
- * disturned until another floating point task is switched to.
- *
- * If FALSE, then the floating point context is saved when a floating
- * point task is switched out and restored when the next floating point
- * task is restored. The state of the floating point registers between
- * those two operations is not specified.
- *
- * If the floating point context does NOT have to be saved as part of
- * interrupt dispatching, then it should be safe to set this to TRUE.
- *
- * Setting this flag to TRUE results in using a different algorithm
- * for deciding when to save and restore the floating point context.
- * The deferred FP switch algorithm minimizes the number of times
- * the FP context is saved and restored. The FP context is not saved
- * until a context switch is made to another, different FP task.
- * Thus in a system with only one FP task, the FP context will never
- * be saved or restored.
- */
-
-#define CPU_USE_DEFERRED_FP_SWITCH TRUE
-
-/*
- * Does this port provide a CPU dependent IDLE task implementation?
- *
- * If TRUE, then the routine _CPU_Internal_threads_Idle_thread_body
- * must be provided and is the default IDLE thread body instead of
- * _Internal_threads_Idle_thread_body.
- *
- * If FALSE, then use the generic IDLE thread body if the BSP does
- * not provide one.
- *
- * This is intended to allow for supporting processors which have
- * a low power or idle mode. When the IDLE thread is executed, then
- * the CPU can be powered down.
- *
- * The order of precedence for selecting the IDLE thread body is:
- *
- * 1. BSP provided
- * 2. CPU dependent (if provided)
- * 3. generic (if no BSP and no CPU dependent)
- */
-
-#define CPU_PROVIDES_IDLE_THREAD_BODY TRUE
-
-/*
- * Does the stack grow up (toward higher addresses) or down
- * (toward lower addresses)?
- *
- * If TRUE, then the grows upward.
- * If FALSE, then the grows toward smaller addresses.
- */
-
-#define CPU_STACK_GROWS_UP FALSE
-
-/*
- * The following is the variable attribute used to force alignment
- * of critical RTEMS structures. On some processors it may make
- * sense to have these aligned on tighter boundaries than
- * the minimum requirements of the compiler in order to have as
- * much of the critical data area as possible in a cache line.
- *
- * The placement of this macro in the declaration of the variables
- * is based on the syntactically requirements of the GNU C
- * "__attribute__" extension. For example with GNU C, use
- * the following to force a structures to a 32 byte boundary.
- *
- * __attribute__ ((aligned (32)))
- *
- * NOTE: Currently only the Priority Bit Map table uses this feature.
- * To benefit from using this, the data must be heavily
- * used so it will stay in the cache and used frequently enough
- * in the executive to justify turning this on.
- */
-
-#define CPU_STRUCTURE_ALIGNMENT
-
-/*
- * Define what is required to specify how the network to host conversion
- * routines are handled.
- *
- */
-
-#error "Check these definitions!!!"
-
-#define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE
-#define CPU_BIG_ENDIAN TRUE
-#define CPU_LITTLE_ENDIAN FALSE
-
-/*
- * The following defines the number of bits actually used in the
- * interrupt field of the task mode. How those bits map to the
- * CPU interrupt levels is defined by the routine _CPU_ISR_Set_level().
- */
-
-#define CPU_MODES_INTERRUPT_MASK 0x00000001
-
-/*
- * Processor defined structures
- *
- * Examples structures include the descriptor tables from the i386
- * and the processor control structure on the i960ca.
- */
-
-/* may need to put some structures here. */
-
-/*
- * Contexts
- *
- * Generally there are 2 types of context to save.
- * 1. Interrupt registers to save
- * 2. Task level registers to save
- *
- * This means we have the following 3 context items:
- * 1. task level context stuff:: Context_Control
- * 2. floating point task stuff:: Context_Control_fp
- * 3. special interrupt level context :: Context_Control_interrupt
- *
- * On some processors, it is cost-effective to save only the callee
- * preserved registers during a task context switch. This means
- * that the ISR code needs to save those registers which do not
- * persist across function calls. It is not mandatory to make this
- * distinctions between the caller/callee saves registers for the
- * purpose of minimizing context saved during task switch and on interrupts.
- * If the cost of saving extra registers is minimal, simplicity is the
- * choice. Save the same context on interrupt entry as for tasks in
- * this case.
- *
- * Additionally, if gdb is to be made aware of RTEMS tasks for this CPU, then
- * care should be used in designing the context area.
- *
- * On some CPUs with hardware floating point support, the Context_Control_fp
- * structure will not be used or it simply consist of an array of a
- * fixed number of bytes. This is done when the floating point context
- * is dumped by a "FP save context" type instruction and the format
- * is not really defined by the CPU. In this case, there is no need
- * to figure out the exact format -- only the size. Of course, although
- * this is enough information for RTEMS, it is probably not enough for
- * a debugger such as gdb. But that is another problem.
- */
-
-typedef struct {
- unsigned32 signal;
- unsigned32 gr1;
- unsigned32 rab;
- unsigned32 PC0;
- unsigned32 PC1;
- unsigned32 PC2;
- unsigned32 CHA;
- unsigned32 CHD;
- unsigned32 CHC;
- unsigned32 ALU;
- unsigned32 OPS;
- unsigned32 tav;
- unsigned32 lr1;
- unsigned32 rfb;
- unsigned32 msp;
-
- unsigned32 FPStat0;
- unsigned32 FPStat1;
- unsigned32 FPStat2;
- unsigned32 IPA;
- unsigned32 IPB;
- unsigned32 IPC;
- unsigned32 Q;
-
- unsigned32 gr96;
- unsigned32 gr97;
- unsigned32 gr98;
- unsigned32 gr99;
- unsigned32 gr100;
- unsigned32 gr101;
- unsigned32 gr102;
- unsigned32 gr103;
- unsigned32 gr104;
- unsigned32 gr105;
- unsigned32 gr106;
- unsigned32 gr107;
- unsigned32 gr108;
- unsigned32 gr109;
- unsigned32 gr110;
- unsigned32 gr111;
-
- unsigned32 gr112;
- unsigned32 gr113;
- unsigned32 gr114;
- unsigned32 gr115;
-
- unsigned32 gr116;
- unsigned32 gr117;
- unsigned32 gr118;
- unsigned32 gr119;
- unsigned32 gr120;
- unsigned32 gr121;
- unsigned32 gr122;
- unsigned32 gr123;
- unsigned32 gr124;
-
- unsigned32 local_count;
-
- unsigned32 locals[128];
-} Context_Control;
-
-typedef struct {
- double some_float_register;
-} Context_Control_fp;
-
-typedef struct {
- unsigned32 special_interrupt_register;
-} CPU_Interrupt_frame;
-
-
-/*
- * The following table contains the information required to configure
- * the XXX processor specific parameters.
- *
- * NOTE: The interrupt_stack_size field is required if
- * CPU_ALLOCATE_INTERRUPT_STACK is defined as TRUE.
- *
- * The pretasking_hook, predriver_hook, and postdriver_hook,
- * and the do_zero_of_workspace fields are required on ALL CPUs.
- */
-
-typedef struct {
- void (*pretasking_hook)( void );
- void (*predriver_hook)( void );
- void (*postdriver_hook)( void );
- void (*idle_task)( void );
- boolean do_zero_of_workspace;
- unsigned32 idle_task_stack_size;
- unsigned32 interrupt_stack_size;
- unsigned32 extra_system_initialization_stack;
- unsigned32 some_other_cpu_dependent_info;
-} rtems_cpu_table;
-
-/*
- * This variable is optional. It is used on CPUs on which it is difficult
- * to generate an "uninitialized" FP context. It is filled in by
- * _CPU_Initialize and copied into the task's FP context area during
- * _CPU_Context_Initialize.
- */
-
-EXTERN Context_Control_fp _CPU_Null_fp_context;
-
-/*
- * On some CPUs, RTEMS supports a software managed interrupt stack.
- * This stack is allocated by the Interrupt Manager and the switch
- * is performed in _ISR_Handler. These variables contain pointers
- * to the lowest and highest addresses in the chunk of memory allocated
- * for the interrupt stack. Since it is unknown whether the stack
- * grows up or down (in general), this give the CPU dependent
- * code the option of picking the version it wants to use.
- *
- * NOTE: These two variables are required if the macro
- * CPU_HAS_SOFTWARE_INTERRUPT_STACK is defined as TRUE.
- */
-
-EXTERN void *_CPU_Interrupt_stack_low;
-EXTERN void *_CPU_Interrupt_stack_high;
-
-/*
- * With some compilation systems, it is difficult if not impossible to
- * call a high-level language routine from assembly language. This
- * is especially true of commercial Ada compilers and name mangling
- * C++ ones. This variable can be optionally defined by the CPU porter
- * and contains the address of the routine _Thread_Dispatch. This
- * can make it easier to invoke that routine at the end of the interrupt
- * sequence (if a dispatch is necessary).
- */
-
-EXTERN void (*_CPU_Thread_dispatch_pointer)();
-
-/*
- * Nothing prevents the porter from declaring more CPU specific variables.
- */
-
-/* XXX: if needed, put more variables here */
-
-/*
- * The size of the floating point context area. On some CPUs this
- * will not be a "sizeof" because the format of the floating point
- * area is not defined -- only the size is. This is usually on
- * CPUs with a "floating point save context" instruction.
- */
-
-#define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp )
-
-/*
- * Amount of extra stack (above minimum stack size) required by
- * system initialization thread. Remember that in a multiprocessor
- * system the system intialization thread becomes the MP server thread.
- */
-
-#define CPU_SYSTEM_INITIALIZATION_THREAD_EXTRA_STACK 0
-
-/*
- * This defines the number of entries in the ISR_Vector_table managed
- * by RTEMS.
- */
-
-#define CPU_INTERRUPT_NUMBER_OF_VECTORS 256
-#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1)
-
-/*
- * Should be large enough to run all RTEMS tests. This insures
- * that a "reasonable" small application should not have any problems.
- */
-
-#define CPU_STACK_MINIMUM_SIZE (8192)
-
-/*
- * CPU's worst alignment requirement for data types on a byte boundary. This
- * alignment does not take into account the requirements for the stack.
- */
-
-#define CPU_ALIGNMENT 4
-
-/*
- * This number corresponds to the byte alignment requirement for the
- * heap handler. This alignment requirement may be stricter than that
- * for the data types alignment specified by CPU_ALIGNMENT. It is
- * common for the heap to follow the same alignment requirement as
- * CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict enough for the heap,
- * then this should be set to CPU_ALIGNMENT.
- *
- * NOTE: This does not have to be a power of 2. It does have to
- * be greater or equal to than CPU_ALIGNMENT.
- */
-
-#define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * This number corresponds to the byte alignment requirement for memory
- * buffers allocated by the partition manager. This alignment requirement
- * may be stricter than that for the data types alignment specified by
- * CPU_ALIGNMENT. It is common for the partition to follow the same
- * alignment requirement as CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict
- * enough for the partition, then this should be set to CPU_ALIGNMENT.
- *
- * NOTE: This does not have to be a power of 2. It does have to
- * be greater or equal to than CPU_ALIGNMENT.
- */
-
-#define CPU_PARTITION_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * This number corresponds to the byte alignment requirement for the
- * stack. This alignment requirement may be stricter than that for the
- * data types alignment specified by CPU_ALIGNMENT. If the CPU_ALIGNMENT
- * is strict enough for the stack, then this should be set to 0.
- *
- * NOTE: This must be a power of 2 either 0 or greater than CPU_ALIGNMENT.
- */
-
-#define CPU_STACK_ALIGNMENT 0
-
-/* ISR handler macros */
-
-/*
- * Disable all interrupts for an RTEMS critical section. The previous
- * level is returned in _level.
- */
-
-#define _CPU_ISR_Disable( _isr_cookie ) \
- do{ _isr_cookie = a29k_disable(); }while(0)
-
-/*
- * Enable interrupts to the previous level (returned by _CPU_ISR_Disable).
- * This indicates the end of an RTEMS critical section. The parameter
- * _level is not modified.
- */
-
-#define _CPU_ISR_Enable( _isr_cookie ) \
- do{ a29k_enable(_isr_cookie) ; }while(0)
-
-/*
- * This temporarily restores the interrupt to _level before immediately
- * disabling them again. This is used to divide long RTEMS critical
- * sections into two or more parts. The parameter _level is not
- * modified.
- */
-
-#define _CPU_ISR_Flash( _isr_cookie ) \
- do{ \
- _CPU_ISR_Enable( _isr_cookie ); \
- _CPU_ISR_Disable( _isr_cookie ); \
- }while(0)
-
-/*
- * Map interrupt level in task mode onto the hardware that the CPU
- * actually provides. Currently, interrupt levels which do not
- * map onto the CPU in a generic fashion are undefined. Someday,
- * it would be nice if these were "mapped" by the application
- * via a callout. For example, m68k has 8 levels 0 - 7, levels
- * 8 - 255 would be available for bsp/application specific meaning.
- * This could be used to manage a programmable interrupt controller
- * via the rtems_task_mode directive.
- */
-
-#define _CPU_ISR_Set_level( new_level ) \
- do{ \
- if ( new_level ) a29k_disable_all(); \
- else a29k_enable_all(); \
- }while(0);
-
-/* end of ISR handler macros */
-
-/* Context handler macros */
-
-extern void _CPU_Context_save(
- Context_Control *new_context
-);
-
-/*
- * Initialize the context to a state suitable for starting a
- * task after a context restore operation. Generally, this
- * involves:
- *
- * - setting a starting address
- * - preparing the stack
- * - preparing the stack and frame pointers
- * - setting the proper interrupt level in the context
- * - initializing the floating point context
- *
- * This routine generally does not set any unnecessary register
- * in the context. The state of the "general data" registers is
- * undefined at task start time.
- *
- * NOTE: This is_fp parameter is TRUE if the thread is to be a floating
- * point thread. This is typically only used on CPUs where the
- * FPU may be easily disabled by software such as on the SPARC
- * where the PSR contains an enable FPU bit.
- */
-
-#define _CPU_Context_Initialize( _the_context, _stack_base, _size, \
- _isr, _entry_point, _is_fp ) \
- do{ /* allocate 1/4 of stack for memory stack, 3/4 of stack for register stack */ \
- unsigned32 _mem_stack_tmp = (unsigned32)(_stack_base) + (_size); \
- unsigned32 _reg_stack_tmp = (unsigned32)(_stack_base) + (((_size)*3)/4); \
- _mem_stack_tmp &= ~(CPU_ALIGNMENT-1); \
- _reg_stack_tmp &= ~(CPU_ALIGNMENT-1); \
- _CPU_Context_save(_the_context); \
- (_the_context)->msp = _mem_stack_tmp; /* gr125 */ \
- (_the_context)->lr1 = \
- (_the_context)->locals[1] = \
- (_the_context)->rfb = _reg_stack_tmp; /* gr127 */ \
- (_the_context)->gr1 = _reg_stack_tmp - 4 * 4; \
- (_the_context)->rab = _reg_stack_tmp - 128 * 4; /* gr126 */ \
- (_the_context)->local_count = 1-1; \
- (_the_context)->PC1 = _entry_point; \
- (_the_context)->PC0 = (unsigned32)((char *)_entry_point + 4); \
- if (_isr) { (_the_context)->OPS |= (TD | DI); } \
- else \
- { (_the_context)->OPS &= ~(TD | DI); } \
- }while(0)
-
-/*
- * This routine is responsible for somehow restarting the currently
- * executing task. If you are lucky, then all that is necessary
- * is restoring the context. Otherwise, there will need to be
- * a special assembly routine which does something special in this
- * case. Context_Restore should work most of the time. It will
- * not work if restarting self conflicts with the stack frame
- * assumptions of restoring a context.
- */
-
-#define _CPU_Context_Restart_self( _the_context ) \
- _CPU_Context_restore( (_the_context) )
-
-/*
- * The purpose of this macro is to allow the initial pointer into
- * a floating point context area (used to save the floating point
- * context) to be at an arbitrary place in the floating point
- * context area.
- *
- * This is necessary because some FP units are designed to have
- * their context saved as a stack which grows into lower addresses.
- * Other FP units can be saved by simply moving registers into offsets
- * from the base of the context area. Finally some FP units provide
- * a "dump context" instruction which could fill in from high to low
- * or low to high based on the whim of the CPU designers.
- */
-
-#define _CPU_Context_Fp_start( _base, _offset ) \
- ( (char *) (_base) + (_offset) )
-
-/*
- * This routine initializes the FP context area passed to it to.
- * There are a few standard ways in which to initialize the
- * floating point context. The code included for this macro assumes
- * that this is a CPU in which a "initial" FP context was saved into
- * _CPU_Null_fp_context and it simply copies it to the destination
- * context passed to it.
- *
- * Other models include (1) not doing anything, and (2) putting
- * a "null FP status word" in the correct place in the FP context.
- */
-
-#define _CPU_Context_Initialize_fp( _destination ) \
- do { \
- *((Context_Control_fp *) *((void **) _destination)) = _CPU_Null_fp_context; \
- } while(0)
-
-/* end of Context handler macros */
-
-/* Fatal Error manager macros */
-
-/*
- * This routine copies _error into a known place -- typically a stack
- * location or a register, optionally disables interrupts, and
- * halts/stops the CPU.
- */
-
-#define _CPU_Fatal_halt( _error ) \
- a29k_fatal_error(_error)
-
-/* end of Fatal Error manager macros */
-
-/* Bitfield handler macros */
-
-/*
- * This routine sets _output to the bit number of the first bit
- * set in _value. _value is of CPU dependent type Priority_Bit_map_control.
- * This type may be either 16 or 32 bits wide although only the 16
- * least significant bits will be used.
- *
- * There are a number of variables in using a "find first bit" type
- * instruction.
- *
- * (1) What happens when run on a value of zero?
- * (2) Bits may be numbered from MSB to LSB or vice-versa.
- * (3) The numbering may be zero or one based.
- * (4) The "find first bit" instruction may search from MSB or LSB.
- *
- * RTEMS guarantees that (1) will never happen so it is not a concern.
- * (2),(3), (4) are handled by the macros _CPU_Priority_mask() and
- * _CPU_Priority_bits_index(). These three form a set of routines
- * which must logically operate together. Bits in the _value are
- * set and cleared based on masks built by _CPU_Priority_mask().
- * The basic major and minor values calculated by _Priority_Major()
- * and _Priority_Minor() are "massaged" by _CPU_Priority_bits_index()
- * to properly range between the values returned by the "find first bit"
- * instruction. This makes it possible for _Priority_Get_highest() to
- * calculate the major and directly index into the minor table.
- * This mapping is necessary to ensure that 0 (a high priority major/minor)
- * is the first bit found.
- *
- * This entire "find first bit" and mapping process depends heavily
- * on the manner in which a priority is broken into a major and minor
- * components with the major being the 4 MSB of a priority and minor
- * the 4 LSB. Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
- * priority. And (15 << 4) + 14 corresponds to priority 254 -- the next
- * to the lowest priority.
- *
- * If your CPU does not have a "find first bit" instruction, then
- * there are ways to make do without it. Here are a handful of ways
- * to implement this in software:
- *
- * - a series of 16 bit test instructions
- * - a "binary search using if's"
- * - _number = 0
- * if _value > 0x00ff
- * _value >>=8
- * _number = 8;
- *
- * if _value > 0x0000f
- * _value >=8
- * _number += 4
- *
- * _number += bit_set_table[ _value ]
- *
- * where bit_set_table[ 16 ] has values which indicate the first
- * bit set
- */
-
-#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
-#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
-
-#if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
-
-#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
- { \
- (_output) = 0; /* do something to prevent warnings */ \
- }
-
-#endif
-
-/* end of Bitfield handler macros */
-
-/*
- * This routine builds the mask which corresponds to the bit fields
- * as searched by _CPU_Bitfield_Find_first_bit(). See the discussion
- * for that routine.
- */
-
-#if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
-
-#define _CPU_Priority_Mask( _bit_number ) \
- ( 1 << (_bit_number) )
-
-#endif
-
-/*
- * This routine translates the bit numbers returned by
- * _CPU_Bitfield_Find_first_bit() into something suitable for use as
- * a major or minor component of a priority. See the discussion
- * for that routine.
- */
-
-#if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
-
-#define _CPU_Priority_bits_index( _priority ) \
- (_priority)
-
-#endif
-
-/* end of Priority handler macros */
-
-/* functions */
-
-/*
- * _CPU_Initialize
- *
- * This routine performs CPU dependent initialization.
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch)()
-);
-
-/*
- * _CPU_ISR_install_raw_handler
- *
- * This routine installs a "raw" interrupt handler directly into the
- * processor's vector table.
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_ISR_install_vector
- *
- * This routine installs an interrupt vector.
- */
-
-void _CPU_ISR_install_vector(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_Install_interrupt_stack
- *
- * This routine installs the hardware interrupt stack pointer.
- *
- * NOTE: It need only be provided if CPU_HAS_HARDWARE_INTERRUPT_STACK
- * is TRUE.
- */
-
-void _CPU_Install_interrupt_stack( void );
-
-/*
- * _CPU_Internal_threads_Idle_thread_body
- *
- * This routine is the CPU dependent IDLE thread body.
- *
- * NOTE: It need only be provided if CPU_PROVIDES_IDLE_THREAD_BODY
- * is TRUE.
- */
-
-void _CPU_Internal_threads_Idle_thread_body( void );
-
-/*
- * _CPU_Context_switch
- *
- * This routine switches from the run context to the heir context.
- */
-
-void _CPU_Context_switch(
- Context_Control *run,
- Context_Control *heir
-);
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally 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.
- */
-
-void _CPU_Context_restore(
- Context_Control *new_context
-);
-
-/*
- * _CPU_Context_save_fp
- *
- * This routine saves the floating point context passed to it.
- */
-
-void _CPU_Context_save_fp(
- void **fp_context_ptr
-);
-
-/*
- * _CPU_Context_restore_fp
- *
- * This routine restores the floating point context passed to it.
- */
-
-void _CPU_Context_restore_fp(
- void **fp_context_ptr
-);
-
-/* The following routine swaps the endian format of an unsigned int.
- * It must be static because it is referenced indirectly.
- *
- * This version will work on any processor, but if there is a better
- * way for your CPU PLEASE use it. The most common way to do this is to:
- *
- * swap least significant two bytes with 16-bit rotate
- * swap upper and lower 16-bits
- * swap most significant two bytes with 16-bit rotate
- *
- * Some CPUs have special instructions which swap a 32-bit quantity in
- * a single instruction (e.g. i486). It is probably best to avoid
- * an "endian swapping control bit" in the CPU. One good reason is
- * that interrupts would probably have to be disabled to insure that
- * an interrupt does not try to access the same "chunk" with the wrong
- * endian. Another good reason is that on some CPUs, the endian bit
- * endianness for ALL fetches -- both code and data -- so the code
- * will be fetched incorrectly.
- */
-
-#define CPU_swap_u32( value ) \
- ((value&0xff) << 24) | (((value >> 8)&0xff) << 16) | \
- (((value >> 16)&0xff) << 8) | ((value>>24)&0xff)
-
-#define CPU_swap_u16( value ) \
- (((value&0xff) << 8) | ((value >> 8)&0xff))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/exec/score/cpu/a29k/cpu_asm.h b/c/src/exec/score/cpu/a29k/cpu_asm.h
deleted file mode 100644
index 65eaf29737..0000000000
--- a/c/src/exec/score/cpu/a29k/cpu_asm.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * cpu_asm.h
- *
- * Very loose template for an include file for the cpu_asm.? file
- * if it is implemented as a ".S" file (preprocessed by cpp) instead
- * of a ".s" file (preprocessed by gm4 or gasp).
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- *
- */
-/* @(#)cpu_asm.h 06/08/96 1.2 */
-
-#ifndef __CPU_ASM_h
-#define __CPU_ASM_h
-
-/* pull in the generated offsets */
-
-/* #include <rtems/score/offsets.h> */
-
-/*
- * Hardware General Registers
- */
-
-/* put something here */
-
-/*
- * Hardware Floating Point Registers
- */
-
-/* put something here */
-
-/*
- * Hardware Control Registers
- */
-
-/* put something here */
-
-/*
- * Calling Convention
- */
-
-/* put something here */
-
-/*
- * Temporary registers
- */
-
-/* put something here */
-
-/*
- * Floating Point Registers - SW Conventions
- */
-
-/* put something here */
-
-/*
- * Temporary floating point registers
- */
-
-/* put something here */
-
-#endif
-
-/* end of file */
diff --git a/c/src/exec/score/cpu/a29k/cpu_asm.s b/c/src/exec/score/cpu/a29k/cpu_asm.s
deleted file mode 100644
index a3ed2c59c3..0000000000
--- a/c/src/exec/score/cpu/a29k/cpu_asm.s
+++ /dev/null
@@ -1,491 +0,0 @@
-;/* cpu_asm.c ===> cpu_asm.S or cpu_asm.s
-; *
-; * Author: Craig Lebakken <craigl@transition.com>
-; *
-; * COPYRIGHT (c) 1996 by Transition Networks Inc.
-; *
-; * 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 Transition Networks not be used in
-; * advertising or publicity pertaining to distribution of the
-; * software without specific, written prior permission.
-; * Transition Networks makes no representations about the suitability
-; * of this software for any purpose.
-; *
-; *
-; * This file contains the basic algorithms for all assembly code used
-; * in an specific CPU port of RTEMS. These algorithms must be implemented
-; * in assembly language
-; *
-; * NOTE: This is supposed to be a .S or .s file NOT a C file.
-; *
-; * COPYRIGHT (c) 1989-1998.
-; * On-Line Applications Research Corporation (OAR).
-; * Copyright assigned to U.S. Government, 1994.
-; *
-; * The license and distribution 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 is supposed to be an assembly file. This means that system.h
-; * and cpu.h should not be included in a "real" cpu_asm file. An
-; * implementation in assembly should include "cpu_asm.h>
-; */
-
-;#include <cpu_asm.h>
- .include "register.ah"
- .include "amd.ah"
- .include "pswmacro.ah"
-; .extern _bsp_exit
-;
-; push a register onto the struct
- .macro spush, sp, reg
- store 0, 0, reg, sp ; push register
- add sp, sp, 4 ; adjust stack pointer
- .endm
-; push a register onto the struct
- .macro spushsr, sp, reg, sr
- mfsr reg, sr
- store 0, 0, reg, sp ; push register
- add sp, sp, 4 ; adjust stack pointer
- .endm
-; pop a register from the struct
- .macro spop, reg, sp
- load 0, 0, reg, sp
- add sp,sp,4
- .endm
-; pop a special register from the struct
- .macro spopsr, sreg, reg, sp
- load 0, 0, reg, sp
- mtsr sreg, reg
- add sp,sp,4
- .endm
-;
-;/*
-; * _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.
-; */
-
-;#if 0
-;void _CPU_Context_save_fp(
-; void **fp_context_ptr
-;)
-;{
-;}
-;#endif
- .global _CPU_Context_save_fp
-_CPU_Context_save_fp:
- jmpi lr0
- nop
-
-;/*
-; * _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.
-; */
-
-;#if 0
-;void _CPU_Context_restore_fp(
-; void **fp_context_ptr
-;)
-;{
-;}
-;#endif
- .global __CPU_Context_restore_fp
-__CPU_Context_restore_fp:
- jmpi lr0
- nop
-
-;/* _CPU_Context_switch
-; *
-; * This routine performs a normal non-FP context switch.
-; */
-;#if 0
-;void _CPU_Context_switch(
-; Context_Control *run,
-; Context_Control *heir
-;)
-;{
-;}
-;#endif
- .global __CPU_Context_switch
-__CPU_Context_switch:
- asneq 106, gr1, gr1 ; syscall
- jmpi lr0 ;
- nop ;
-
-
-
- .global _a29k_context_switch_sup
-_a29k_context_switch_sup:
- add pcb,lr2,0
- add kt1,lr3,0 ;move heir pointer to safe location
- constn it0,SIG_SYNC
- spush pcb,it0
- spush pcb,gr1
- spush pcb,rab ;push rab
- spushsr pcb,it0,pc0 ;push specials
- spushsr pcb,it0,pc1
- add pcb,pcb,1*4 ;space pc2
- spushsr pcb,it0,CHA ;push CHA
- spushsr pcb,it0,CHD ;push CHD
- spushsr pcb,it0,CHC ;push CHC
- add pcb,pcb,1*4 ;space for alu
- spushsr pcb,it0,ops ;push OPS
- mfsr kt0,cps ;current status
- const it1,FZ ;FZ constant
- andn it1,kt0,it1 ;clear FZ bit
- mtsr cps,it1 ;cps without FZ
- add pcb,pcb,1*4 ;space for tav
- mtsrim chc,0 ;possible DERR
-;
- spush pcb,lr1 ;push R-stack
- spush pcb,rfb ; support
- spush pcb,msp ;push M-stack pnt.
-;
- add pcb,pcb,3*4 ;space for floating point
-; spush pcb,FPStat0 ;floating point
-; spush pcb,FPStat1
-; spush pcb,FPStat2
-;
- add pcb,pcb,4*4 ;space for IPA..Q
-;
- mtsrim cr,29-1
- storem 0,0,gr96,pcb ;push gr96-124, optional
- add pcb,pcb,29*4 ;space for gr96-124
-;
- sub it0,rfb,gr1 ;get bytes in cache
- srl it0,it0,2 ;adjust to words
- sub it0,it0,1
- spush pcb,it0
- mtsr cr,it0
- storem 0,0,lr0,pcb ;save lr0-rfb
-;
-context_restore:
- add pcb,kt1,0 ;pcb=heir
- add pcb,pcb,4 ;space for signal num
- spop gr1,pcb ;restore freeze registers
- add gr1,gr1,0 ;alu op
- add pcb,pcb,9*4 ;move past freeze registers
- add pcb,pcb,1*4 ;space for tav
- spop lr1,pcb
- spop rfb,pcb
- spop msp,pcb
-; spop FPStat0,pcb
-; spop FPStat1,pcb
-; spop FPStat2,pcb
- add pcb,pcb,3*4 ;space for floating point
- add pcb,pcb,4*4 ;space for IPA..Q
- mtsrim cr,29-1
- loadm 0,0,gr96,pcb ;pop gr96-gr124
- add pcb,pcb,29*4 ;space for gr96-124
-
- spop it1,pcb ;pop locals count
- mtsr cr,it1
- loadm 0,0,lr0,pcb ;load locals
-
- add pcb,kt1,0 ;pcb=heir
- mtsr cps,kt0 ;cps with FZ
- nop
- add pcb,pcb,4 ;space for signal num
- spop gr1,pcb ;restore freeze registers
- add gr1,gr1,0 ;alu op
- spop rab,pcb
- spopsr pc0,it1,pcb
- spopsr pc1,it1,pcb
- add pcb,pcb,4 ;space for pc2
- spopsr CHA,it1,pcb
- spopsr CHD,it1,pcb
- spopsr CHC,it1,pcb
- add pcb,pcb,4 ;space for alu
- spopsr ops,it1,pcb
- nop
- iret
-
-
-;/*
-; * _CPU_Context_restore
-; *
-; * This routine is generally 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.
-; */
-;#if 0
-;void _CPU_Context_restore(
-; Context_Control *new_context
-;)
-;{
-;}
-;#endif
-
- .global __CPU_Context_restore
-__CPU_Context_restore:
- asneq 107, gr1, gr1 ; syscall
- jmpi lr0 ;
- nop ;
-
- .global _a29k_context_restore_sup
-_a29k_context_restore_sup:
- add kt1,lr2,0 ;kt1 = restore context
- mfsr kt0,cps ;current status
- const it1,FZ ;FZ constant
- andn it1,kt0,it1 ;clear FZ bit
- mtsr cps,it1 ;cps without FZ
- jmp context_restore
- nop
-
- .global _a29k_context_save_sup
-_a29k_context_save_sup:
- add pcb,lr2,0
- constn it0,SIG_SYNC
- spush pcb,it0
- spush pcb,gr1
- spush pcb,rab ;push rab
- spushsr pcb,it0,pc0 ;push specials
- spushsr pcb,it0,pc1
- add pcb,pcb,1*4 ;space pc2
- spushsr pcb,it0,CHA ;push CHA
- spushsr pcb,it0,CHD ;push CHD
- spushsr pcb,it0,CHC ;push CHC
- add pcb,pcb,1*4 ;space for alu
- spushsr pcb,it0,ops ;push OPS
- mfsr it0,cps ;current status
-SaveFZState it1,it2
- add pcb,pcb,1*4 ;space for tav
- mtsrim chc,0 ;possible DERR
-;
- spush pcb,lr1 ;push R-stack
- spush pcb,rfb ; support
- spush pcb,msp ;push M-stack pnt.
-;
- spush pcb,FPStat0 ;floating point
- spush pcb,FPStat1
- spush pcb,FPStat2
-;
- add pcb,pcb,4*4 ;space for IPA..Q
-;
- mtsrim cr,29-1
- storem 0,0,gr96,pcb ;push gr96-124, optional
- add pcb,pcb,29*4 ;space for gr96-124
-;
- sub kt0,rfb,gr1 ;get bytes in cache
- srl kt0,kt0,2 ;adjust to words
- sub kt0,kt0,1
- spush pcb,kt0 ;push number of words
- mtsr cr,kt0
- storem 0,0,lr0,pcb ;save lr0-rfb
-;
- mtsr cps,it0 ;cps with FZ
-RestoreFZState it1,it2
-
- nop
- nop
- nop
-;
- iret
-;
-
- .global __CPU_Context_save
-__CPU_Context_save:
- asneq 108, gr1, gr1 ; syscall
- jmpi lr0 ;
- nop ;
-
-
-;/* void __ISR_Handler()
-; *
-; * This routine provides the RTEMS interrupt management.
-; *
-; */
-
-;#if 0
-;void _ISR_Handler()
-;{
-; /*
-; * This discussion ignores a lot of the ugly details in a real
-; * implementation such as saving enough registers/state to be
-; * able to do something real. Keep in mind that the goal is
-; * to invoke a user's ISR handler which is written in C and
-; * uses a certain set of registers.
-; *
-; * Also note that the exact order is to a large extent flexible.
-; * Hardware will dictate a sequence for a certain subset of
-; * _ISR_Handler while requirements for setting
-; */
-
-; /*
-; * At entry to "common" _ISR_Handler, the vector number must be
-; * available. On some CPUs the hardware puts either the vector
-; * number or the offset into the vector table for this ISR in a
-; * known place. If the hardware does not give us this information,
-; * then the assembly portion of RTEMS for this port will contain
-; * a set of distinct interrupt entry points which somehow place
-; * the vector number in a known place (which is safe if another
-; * interrupt nests this one) and branches to _ISR_Handler.
-; *
-; * save some or all context on stack
-; * may need to save some special interrupt information for exit
-; *
-; * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
-; * if ( _ISR_Nest_level == 0 )
-; * switch to software interrupt stack
-; * #endif
-; *
-; * _ISR_Nest_level++;
-; *
-; * _Thread_Dispatch_disable_level++;
-; *
-; * (*_ISR_Vector_table[ vector ])( vector );
-; *
-; * --_ISR_Nest_level;
-; *
-; * if ( _ISR_Nest_level )
-; * goto the label "exit interrupt (simple case)"
-; *
-; * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
-; * restore stack
-; * #endif
-; *
-; * if ( !_Context_Switch_necessary )
-; * goto the label "exit interrupt (simple case)"
-; *
-; * if ( !_ISR_Signals_to_thread_executing )
-; * goto the label "exit interrupt (simple case)"
-; *
-; * call _Thread_Dispatch() or prepare to return to _ISR_Dispatch
-; *
-; * prepare to get out of interrupt
-; * return from interrupt (maybe to _ISR_Dispatch)
-; *
-; * LABEL "exit interrupt (simple case):
-; * prepare to get out of interrupt
-; * return from interrupt
-; */
-;}
-;#endif
-; .global __ISR_Handler
-;__ISR_Handler:
-; jmpi lr0
-; nop
-
- .global _a29k_getops
-_a29k_getops:
- asneq 113, gr96, gr96
- jmpi lr0
- nop
-
- .global _a29k_getops_sup
-_a29k_getops_sup:
- mfsr gr96, ops ; caller wants ops
- iret
- nop
-
- .global _a29k_disable
-_a29k_disable:
- asneq 110, gr96, gr96
- jmpi lr0
- nop
-
- .global _a29k_disable_sup
-_a29k_disable_sup:
- mfsr kt0, ops
- add gr96, kt0, 0 ; return ops to caller
- const kt1, (DI | TD)
- consth kt1, (DI | TD)
- or kt1, kt0, kt1
- mtsr ops, kt1
- iret
- nop
-
- .global _a29k_disable_all
-_a29k_disable_all:
- asneq 112, gr96, gr96
- jmpi lr0
- nop
-
- .global _a29k_disable_all_sup
-_a29k_disable_all_sup:
- mfsr kt0, ops
- const kt1, (DI | TD)
- consth kt1, (DI | TD)
- or kt1, kt0, kt1
- mtsr ops, kt1
- iret
- nop
-
- .global _a29k_enable_all
-_a29k_enable_all:
- asneq 111, gr96, gr96
- jmpi lr0
- nop
-
- .global _a29k_enable_all_sup
-_a29k_enable_all_sup:
- mfsr kt0, ops
- const kt1, (DI | TD)
- consth kt1, (DI | TD)
- andn kt1, kt0, kt1
- mtsr ops, kt1
- iret
- nop
-
- .global _a29k_enable
-_a29k_enable:
- asneq 109, gr96, gr96
- jmpi lr0
- nop
-
- .global _a29k_enable_sup
-_a29k_enable_sup:
- mfsr kt0, ops
- const kt1, (DI | TD)
- consth kt1, (DI | TD)
- and kt3, lr2, kt1
- andn kt0, kt0, kt1
- or kt1, kt0, kt3
- mtsr ops, kt1
- iret
- nop
-
- .global _a29k_halt
-_a29k_halt:
- halt
- jmp _a29k_halt
- nop
-
- .global _a29k_super_mode
-_a29k_super_mode:
- mfsr gr96, ops
- or gr96, gr96, 0x10
- mtsr ops, gr96
- iret
- nop
-
- .global _a29k_as70
-_a29k_as70:
- asneq 70,gr96,gr96
- jmpi lr0
- nop
diff --git a/c/src/exec/score/cpu/a29k/pswmacro.ah b/c/src/exec/score/cpu/a29k/pswmacro.ah
deleted file mode 100644
index c21eee4f35..0000000000
--- a/c/src/exec/score/cpu/a29k/pswmacro.ah
+++ /dev/null
@@ -1,442 +0,0 @@
-; /* @(#)pswmacro.ah 1.1 96/05/23 08:56:58, TEI */
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; macros: Do_install and init_TLB
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; /* $Id$ */
-
-;* File information and includes.
-
- .file "macro.ah"
- .ident "@(#)pswmacro.ah 1.1 96/05/23 08:56:58, TEI"
-
-
- .macro CONST32, RegName, RegValue
- const RegName, RegValue
- consth RegName, RegValue
- .endm
-
- .macro CONSTX, RegName, RegValue
- .if (RegValue) <= 0x0000ffff
- const RegName, RegValue
- .else
- const RegName, RegValue
- consth RegName, RegValue
- .endif
- .endm
-
- .macro PRODEV, RegName
- srl RegName, RegName, 24
- .endm
-
-;
-;* MACRO TO INSTALL VECTOR TABLE ENTRIES
-;
-
-;* Assumes vector table address in v0
-
- .macro _setvec, trapnum, trapaddr
- mfsr v0, vab ;
- const v2, trapnum ;
- sll v1, v2, 2 ;
- add v1, v1, v0 ; v0 has location of vector tab
-
- const v2, trapaddr ;
- consth v2, trapaddr ;
- store 0, 0, v2, v1 ;
- nop ;
- .endm
-
- .macro syscall, name
- const tav, HIF_@name ;
- asneq V_SYSCALL, gr1, gr1 ;
- nop ;
- nop ;
- .endm
-
-
-
-;* MACRO TO INSTALL VECTOR TABLE ENTRIES
-
- .macro Do_Install, V_Number, V_Address
- const lr4, V_Address
- consth lr4, V_Address
- const lr3, V_Number * 4
- consth lr3, V_Number * 4
- call lr0, V_Install
- nop
- .endm
-
- .macro Do_InstallX, V_Number, V_Address
- const lr4, V_Address
- consth lr4, V_Address
- const lr3, V_Number * 4
- consth lr3, V_Number * 4
- call lr0, V_InstallX
- nop
- .endm
-
-
-
-; push a register onto the stack
- .macro pushreg, reg, sp
- sub sp, sp, 4 ; adjust stack pointer
- store 0, 0, reg, sp ; push register
- .endm
-
- .macro push, sp, reg
- sub sp, sp, 4
- store 0, 0, reg, sp
- .endm
-
-; pop the register from stack
- .macro popreg, reg, sp
- load 0, 0, reg, sp ; pop register
- add sp, sp, 4 ; adjust stack pointer
- .endm
- .macro pop, reg, sp
- load 0, 0, reg, sp
- add sp, sp, 4
- .endm
-
-; push a special register onto stack
- .macro pushspcl, spcl, tmpreg, sp
- sub sp, sp, 4 ; adjust stack pointer
- mfsr tmpreg, spcl ; get spcl reg
- store 0, 0, tmpreg, sp ; push onto stack
- .endm
-
- .macro pushsr, sp, reg, sreg
- mfsr reg, sreg
- sub sp, sp, 4
- store 0, 0, reg, sp
- .endm
-
-; pop a special register from stack
- .macro popspcl, spcl, tmpreg, sp
- load 0, 0, tmpreg, sp ; pop from stack
- add sp, sp, 4 ; adjust stack pointer
- mtsr spcl, tmpreg ; set spcl reg
- .endm
-
- .macro popsr, sreg, reg, sp
- load 0, 0, reg, sp
- add sp, sp, 4
- mtsr sreg, reg
- .endm
-
-;
-; save freeze mode registers on memory stack.
-;
-
- .macro SaveFZState, tmp1, tmp2
-
- ; save freeze mode registers.
-
- pushspcl pc0, tmp1, msp
- pushspcl pc1, tmp1, msp
- pushspcl alu, tmp1, msp
-
- pushspcl cha, tmp1, msp
- pushspcl chd, tmp1, msp
- pushspcl chc, tmp1, msp
-
- pushspcl ops, tmp1, msp
-
- ; turn freeze off
-
- const tmp2, FZ
- mfsr tmp1, cps
- andn tmp1, tmp1, tmp2
- mtsr cps, tmp1
- .endm
-
-; restore freeze mode registers from memory stack.
-
- .macro RestoreFZState, tmp1, tmp2
-
- ; turn freeze on
-
- const tmp2, (FZ|DI|DA)
- mfsr tmp1, cps
- or tmp1, tmp1, tmp2
- mtsr cps, tmp1
-
- ; restore freeze mode registers.
-
- popspcl ops, tmp1, msp
- popspcl chc, tmp1, msp
- popspcl chd, tmp1, msp
- popspcl cha, tmp1, msp
- popspcl alu, tmp1, msp
- popspcl pc1, tmp1, msp
- popspcl pc0, tmp1, msp
- .endm
-
-;
-;*
-;
- .equ WS, 512 ; window size
- .equ RALLOC, 4 * 4 ; stack alloc for C
- .equ SIGCTX_UM_SIZE, 40 * 4 ;
- .equ SIGCTX_RFB, (38) * 4 ; user mode saved
- .equ SIGCTX_SM_SIZE, 12 * 4 ;
- .equ SIGCTX_SIG, (11)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_GR1, (10)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_RAB, (9)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_PC0, (8)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_PC1, (7)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_PC2, (6)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_CHC, (3)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_OPS, (1)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_TAV, (0)*4 + SIGCTX_UM_SIZE ;
-
- .macro sup_sv
- add it2, trapreg, 0 ; transfer signal #
- sub msp, msp, 4 ;
- store 0, 0, it2, msp ; save signal number
- sub msp, msp, 4 ; push gr1
-
- store 0, 0, gr1, msp ;
- sub msp, msp, 4 ; push rab
- store 0, 0, rab, msp ;
- const it0, WS ; Window size
-
- sub rab, rfb, it0 ; set rab = rfb-512
- pushsr msp, it0, PC0 ; save program counter0
- pushsr msp, it0, PC1 ; save program counter1
- pushsr msp, it0, PC2 ; save program counter2
-
- pushsr msp, it0, CHA ; save channel address
- pushsr msp, it0, CHD ; save channel data
- pushsr msp, it0, CHC ; save channel control
- pushsr msp, it0, ALU ; save alu
-
- pushsr msp, it0, OPS ; save ops
- sub msp, msp, 4 ;
- store 0, 0, tav, msp ; push tav
- mtsrim chc, 0 ; no loadm/storem
-
- mfsr it0, ops ; get ops value
- const it1, (TD | DI) ; disable interrupts
- consth it1, (TD | DI) ; disable interrupts
- or it0, it0, it1 ; set bits
-
- mtsr ops, it0 ; set new ops
- const it0, _sigcode ; signal handler
- consth it0, _sigcode ; signal handler
- mtsr pc1, it0 ; store pc1
-
- add it1, it0, 4 ; next addr
- mtsr pc0, it1 ; store pc1 location
- iret ; return
- nop ; ALIGN
- .endm
-
- .macro sig_return
- mfsr it0, cps ; get processor status
- const it1, FZ|DA ; Freeze + traps disable
- or it0, it0, it1 ; to set FZ+DA
- mtsr cps, it0 ; in freeze mode
-
- load 0, 0, tav, msp ; restore tav
- add msp, msp, 4 ;
-
- popsr OPS,it0, msp ;
- popsr ALU,it0, msp ;
- popsr CHC,it0, msp ;
- popsr CHD,it0, msp ;
-
- popsr CHA,it0, msp ;
- popsr PC2,it0, msp ;
- popsr PC1,it0, msp ;
- popsr PC0,it0, msp ;
-
- load 0, 0, rab, msp ;
- add msp, msp, 4 ;
- load 0, 0, it0, msp ;
- add gr1, it0, 0 ; pop rsp
-
- add msp, msp, 8 ; discount signal #
- iret
- .endm
-
- .macro repair_R_stack
- add v0, msp, SIGCTX_GR1 ; interrupted gr1
- load 0, 0, v2, v0 ;
- add v0, msp, SIGCTX_RFB ;
- load 0, 0, v3, v0 ; interupted rfb
-
- const v1, WS ;
- sub v1, v3, v1 ; rfb-512
- cpltu v0, v2, v1 ; test gr1 < rfb-512
- jmpf v0, $1 ;
-
- add gr1, rab, 0 ;
- add v2, v1, 0 ; set LB = rfb-512
-$1:
-;* if gr1 < rfb-512 yes LB = rfb-512 signalled during spill
-;* if no, LB=gr1 interrupted cache < 126 registers
- cpleu v0, v2, rfb ; test LB<=rfb
- jmpf v0, $2 ;
- nop ;
- add v2, rfb, 0 ;
-$2:
- cpeq v0, v3, rfb ; fill rfb->'rfb
- jmpt v0, $3 ; if rfb==rfb'
- const tav, (0x80<<2) ; prepare for fill
- or tav, tav, v2 ;
-
- mtsr IPA, tav ; IPA=LA<<2
- sub tav, v3, gr98 ; cache fill LA->rfb
- srl tav, tav, 2 ; convert to words
- sub tav, tav, 1 ;
-
- mtsr cr, tav ;
- loadm 0, 0, gr0, v2 ; fill from LA->rfb
-$3:
- add rfb, v3, 0 ; move rfb upto 'rfb
- sub rab, v1, 0 ; assign rab to rfb-512
-
- add v0, msp, SIGCTX_GR1 ;
- load 0, 0, v2, v0 ; v0 = interrupted gr1
- add gr1, v2, 0 ; move gr1 upto 'gr1
- nop ;
- .endm
-
- .macro repair_regs
- mtsrim cr, 29 - 1 ; to restore locals
- loadm 0, 0, v0, msp ;
- add msp, msp, 29*4 ;
- popsr Q, tav, msp ;
-
- popsr IPC, tav, msp ;
- popsr IPB, tav, msp ;
- popsr IPA, tav, msp ;
- pop FPStat3, msp ; floating point regs
-
- pop FPStat2, msp ; floating point regs
- pop FPStat1, msp ; floating point regs
- pop FPStat0, msp ; floating point regs
-
- add msp, msp, 3*4 ; R-stack repaired
- .endm
-
-;
-;*HIF related...
-;
-
-
-
-
-; send the message in bufaddr to Montip.
- .macro SendMessageToMontip, bufaddr
- const lr2, bufaddr
-$1:
- call lr0, _msg_send
- consth lr2, bufaddr
- cpeq gr96, gr96, 0
- jmpf gr96, $1
- const lr2, bufaddr
- .endm
-
-; build a HIF_CALL message in bufaddr to send to montip.
- .macro BuildHIFCALLMsg, bufaddr, tmp1, tmp2
- const tmp1, bufaddr
- consth tmp1, bufaddr
- const tmp2, HIF_CALL_MSGCODE
- store 0, 0, tmp2, tmp1 ; msg code
- add tmp1, tmp1, 4
- const tmp2, HIF_CALL_MSGLEN
- store 0, 0, tmp2, tmp1 ; msg len
- add tmp1, tmp1, 4
- store 0, 0, gr121, tmp1 ; service number
- add tmp1, tmp1, 4
- store 0, 0, lr2, tmp1 ; lr2
- add tmp1, tmp1, 4
- store 0, 0, lr3, tmp1 ; lr3
- add tmp1, tmp1, 4
- store 0, 0, lr4, tmp1 ; lr4
- .endm
-
-;
-;*
-;* All the funky AMD style macros go in here...simply for
-;* compatility
-;
-;
- .macro IMPORT, symbol
- .extern symbol
- .endm
-
- .macro GLOBAL, symbol
- .global symbol
- .endm
-
- .macro USESECT, name, type
- .sect name, type
- .use name
- .endm
-
- .macro SECTION, name, type
- .sect name, type
- .endm
-
- .macro FUNC, fname, lineno
- .global fname
-fname:
- .endm
-
- .macro ENDFUNC, fname, lineno
- .endm
-
-;*************************************LONG
- .macro LONG, varname
-varname:
- .block 4
- .endm
-
-;*************************************UNSIGNED LONG
- .macro ULONG, varname
-varname:
- .block 4
- .endm
-
-;*************************************SHORT
- .macro SHORT, varname
-varname:
- .block 2
- .endm
-
-;*************************************CHAR
- .macro CHAR, varname
-varname:
- .block 1
- .endm
-
-;*************************************LONGARRAY
- .macro LONGARRAY, name, count
-name:
- .block count*4
- .endm
-
-;*************************************SHORTARRAY
-
- .macro SHORTARRAY, name, count
-name:
- .block count*2
- .endm
-
-;*************************************CHARARRAY
-
- .macro CHARARRAY, name, count
-name:
- .block count
- .endm
-
-
-;*************************************VOID_FPTR
-
- .macro VOID_FPTR, name
-name:
- .block 4
- .endm
diff --git a/c/src/exec/score/cpu/a29k/register.ah b/c/src/exec/score/cpu/a29k/register.ah
deleted file mode 100644
index 35142b508f..0000000000
--- a/c/src/exec/score/cpu/a29k/register.ah
+++ /dev/null
@@ -1,214 +0,0 @@
-; /* @(#)register.ah 1.1 96/05/23 08:56:57, TEI */
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; naming of various registers
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; /* $Id$ */
-
-;* File information and includes.
-
- .file "register.ah"
- .ident "@(#)register.ah 1.1 96/05/23 08:56:57, TEI\n"
-
-;* Register Stack pointer and frame pointer registers.
-
- .extern Rrsp, Rfp
-
- .reg regsp, %%Rrsp
- .reg fp, %%Rfp
-
-
- .extern RTrapReg
- .extern Rtrapreg
-
- .reg TrapReg, %%RTrapReg
- .reg trapreg, %%Rtrapreg
-
-
-;* Operating system Interrupt handler registers (gr64-gr67)
-
- .extern ROSint0, ROSint1, ROSint2, ROSint3
-
- .reg OSint0, %%ROSint0
- .reg OSint1, %%ROSint1
- .reg OSint2, %%ROSint2
- .reg OSint3, %%ROSint3
-
- .reg it0, %%ROSint0
- .reg it1, %%ROSint1
- .reg it2, %%ROSint2
- .reg it3, %%ROSint3
-
-
-
-;* Operating system temporary (or scratch) registers (gr68-gr79)
-
- .extern ROStmp0, ROStmp1, ROStmp2, ROStmp3
- .extern ROStmp4, ROStmp5, ROStmp6, ROStmp7
- .extern ROStmp8, ROStmp9, ROStmp10, ROStmp11
-
- .reg OStmp0, %%ROStmp0
- .reg OStmp1, %%ROStmp1
- .reg OStmp2, %%ROStmp2
- .reg OStmp3, %%ROStmp3
-
- .reg OStmp4, %%ROStmp4
- .reg OStmp5, %%ROStmp5
- .reg OStmp6, %%ROStmp6
- .reg OStmp7, %%ROStmp7
-
- .reg OStmp8, %%ROStmp8
- .reg OStmp9, %%ROStmp9
- .reg OStmp10, %%ROStmp10
- .reg OStmp11, %%ROStmp11
-
-
- .reg kt0, %%ROStmp0
- .reg kt1, %%ROStmp1
- .reg kt2, %%ROStmp2
- .reg kt3, %%ROStmp3
-
- .reg kt4, %%ROStmp4
- .reg kt5, %%ROStmp5
- .reg kt6, %%ROStmp6
- .reg kt7, %%ROStmp7
-
- .reg kt8, %%ROStmp8
- .reg kt9, %%ROStmp9
- .reg kt10, %%ROStmp10
- .reg kt11, %%ROStmp11
-
-
- .reg TempReg0, %%ROSint0
- .reg TempReg1, %%ROSint1
- .reg TempReg2, %%ROSint2
- .reg TempReg3, %%ROSint3
-
- .reg TempReg4, %%ROStmp0
- .reg TempReg5, %%ROStmp1
- .reg TempReg6, %%ROStmp2
- .reg TempReg7, %%ROStmp3
-
- .reg TempReg8, %%ROStmp4
- .reg TempReg9, %%ROStmp5
- .reg TempReg10, %%ROStmp6
- .reg TempReg11, %%ROStmp7
-
- .reg TempReg12, %%ROStmp8
- .reg TempReg13, %%ROStmp9
- .reg TempReg14, %%ROStmp10
- .reg TempReg15, %%ROStmp11
-
-
-;* Assigned static registers
-
- .extern RSpillAddrReg, RFillAddrReg, RSignalAddrReg
- .extern Rpcb, Retc
- .extern RTimerExt, RTimerUtil, RLEDReg, RERRReg
- .extern Ret0, Ret1, Ret2, Ret3, Ret4, Ret5, Ret6, Ret7, Reta, Retb
- .extern Retx, Rety, Retz
-
-
- .reg SpillAddrReg, %%RSpillAddrReg
- .reg FillAddrReg, %%RFillAddrReg
- .reg SignalAddrReg, %%RSignalAddrReg
- .reg pcb, %%Rpcb
-
- .reg etx, %%Retx
- .reg ety, %%Rety
- .reg etz, %%Retz
- .reg eta, %%Reta
-
- .reg etb, %%Retb
- .reg etc, %%Retc
- .reg TimerExt, %%RTimerExt
- .reg TimerUtil, %%RTimerUtil
-
- .reg LEDReg, %%RLEDReg
- .reg ERRReg, %%RERRReg
-
-
- .reg et0, %%Ret0
- .reg et1, %%Ret1
- .reg et2, %%Ret2
- .reg et3, %%Ret3
-
- .reg et4, %%Ret4
- .reg et5, %%Ret5
- .reg et6, %%Ret6
- .reg et7, %%Ret7
-
-;
- .equ SCB1REG_NUM, 88
- .reg SCB1REG_PTR, %%Ret0
-
-; The floating point trap handlers need a few static registers
-
- .extern RFPStat0, RFPStat1, RFPStat2, RFPStat3
- .extern Rheapptr, RHeapPtr, RArgvPtr
-
- .reg FPStat0, %%RFPStat0
- .reg FPStat1, %%RFPStat1
- .reg FPStat2, %%RFPStat2
- .reg FPStat3, %%RFPStat3
-
- .reg heapptr, %%Rheapptr
- .reg HeapPtr, %%RHeapPtr
- .reg ArgvPtr, %%RArgvPtr
-
- .extern RXLINXReg, RVMBCReg, RUARTReg, RETHERReg
-
- .reg XLINXReg, %%RXLINXReg
- .reg VMBCReg, %%RVMBCReg
- .reg UARTReg, %%RUARTReg
- .reg ETHERReg, %%RXLINXReg
-
-;* Compiler and programmer registers. (gr96-gr127)
-
- .extern Rv0, Rv1, Rv2, Rv3, Rv4, Rv5, Rv6, Rv7, Rv8, Rv9
- .extern Rv10, Rv11, Rv12, Rv13, Rv14, Rv15
-
- .reg v0, %%Rv0
- .reg v1, %%Rv1
- .reg v2, %%Rv2
- .reg v3, %%Rv3
-
- .reg v4, %%Rv4
- .reg v5, %%Rv5
- .reg v6, %%Rv6
- .reg v7, %%Rv7
-
- .reg v8, %%Rv8
- .reg v9, %%Rv9
- .reg v10, %%Rv10
- .reg v11, %%Rv11
-
- .reg v12, %%Rv12
- .reg v13, %%Rv13
- .reg v14, %%Rv14
- .reg v15, %%Rv15
-
- .extern Rtv0, Rtv1, Rtv2, Rtv3, Rtv4
-
- .reg tv0, %%Rtv0
- .reg tv1, %%Rtv1
- .reg tv2, %%Rtv2
- .reg tv3, %%Rtv3
- .reg tv4, %%Rtv4
-
-; ****************************************************************************
-; For uatrap
-; register definitions -- since this trap handler must allow for
-; nested traps and interrupts such as TLB miss, protection violation,
-; or Data Access Exception, and these trap handlers use the shared
-; Temp registers, we must maintain our own that are safe over user-
-; mode loads and stores. The following must be assigned global
-; registers which are not used in INTR[0-3], TRAP[0-1], TLB miss,
-; TLB protection violation, or data exception trap handlers.
-
-; .reg cha_cpy, OStmp4 ; copy of CHA
-; .reg chd_cpy, OStmp5 ; copy of CHD
-; .reg chc_cpy, OStmp6 ; copy of CHC
-; .reg LTemp0, OStmp7 ; local temp 0
-; .reg LTemp1, OStmp8 ; local temp 1
-
-; ****************************************************************************
diff --git a/c/src/exec/score/cpu/a29k/rtems.c b/c/src/exec/score/cpu/a29k/rtems.c
deleted file mode 100644
index 35fef9ed1a..0000000000
--- a/c/src/exec/score/cpu/a29k/rtems.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* rtems.c ===> rtems.S or rtems.s
- *
- * This file contains the single entry point code for
- * the XXX implementation of RTEMS.
- *
- * NOTE: This is supposed to be a .S or .s file NOT a C file.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 lint
-static char _sccsid[] = "@(#)rtems.c 04/08/96 1.1\n";
-#endif
-
-/*
- * This is supposed to be an assembly file. This means that system.h
- * and cpu.h should not be included in a "real" rtems file.
- */
-
-#include <rtems/system.h>
-#include <rtems/score/cpu.h>
-/* #include "asm.h> */
-
-/*
- * RTEMS
- *
- * This routine jumps to the directive indicated in the
- * CPU defined register. This routine is used when RTEMS is
- * linked by itself and placed in ROM. This routine is the
- * first address in the ROM space for RTEMS. The user "calls"
- * this address with the directive arguments in the normal place.
- * This routine then jumps indirectly to the correct directive
- * preserving the arguments. The directive should not realize
- * it has been "wrapped" in this way. The table "_Entry_points"
- * is used to look up the directive.
- */
-
-void RTEMS()
-{
-}
-
diff --git a/c/src/exec/score/cpu/a29k/sig.s b/c/src/exec/score/cpu/a29k/sig.s
deleted file mode 100644
index 245570ffcb..0000000000
--- a/c/src/exec/score/cpu/a29k/sig.s
+++ /dev/null
@@ -1,197 +0,0 @@
-;/*
-; * $Id$
-; */
-
-; .include "register.ah"
- .include "amd.ah"
- .include "pswmacro.ah"
- .comm WindowSize,4
- .text
- .reg it0,gr64
- .reg it1,gr65
- .reg it2,gr66
- .reg it3,gr67
- .reg v0,gr96
- .reg v1,gr97
- .reg v2,gr98
- .reg v3,gr99
- .reg trapreg,it0
- .reg FPStat0,gr79
- .reg FPStat1,gr79
- .reg FPStat2,gr79
- .reg FPStat3,gr79
-
- .global _intr14
-_intr14:
- const it3,14
- sup_sv
- jmp interrupt
- nop
-
- .global _intr18
-_intr18:
- const it3,18
- sup_sv
- jmp interrupt
- nop
-
- .global _intr19
-_intr19:
- const it3,19
- sup_sv
- jmp interrupt
- nop
-
-interrupt:
- push msp,it3
- push msp,gr1
- push msp,rab
- const it0,512
- sub rab,rfb,it0 ;set rab = rfb-512
- pushsr msp,it0,pc0
- pushsr msp,it0,pc1
- pushsr msp,it0,pc2
- pushsr msp,it0,cha
- pushsr msp,it0,chd
- pushsr msp,it0,chc
- pushsr msp,it0,alu
- pushsr msp,it0,ops
- push msp,tav
-;
-;now come off freeze, and go to user-mode code.
-;ensure load/store does not restart
-;
- mtsrim chc,0
-
- mfsr it0, cps
- const it1, FZ
- consth it1, FZ
- andn it0, it0, it1
- const it1,(DI|TD)
- consth it1,(DI|TD)
- or it0,it1,it0
- mtsr cps, it0
-; fall through to _sigcode
-
- .extern _a29k_ISR_Handler
- .global _sigcode
-_sigcode:
-
- push msp, lr1 ; R stack support
- push msp, rfb ; support
- push msp, msp ; M stack support
-
-; push msp, FPStat0 ; Floating point 0
-; push msp, FPStat1 ; Floating point 1
-; push msp, FPStat2 ; Floating point 2
-; push msp, FPStat3 ; Floating point 3
- sub msp,msp,4*4
-
- pushsr msp, tav, IPA ; save user mode special
- pushsr msp, tav, IPB ; save user mode special
- pushsr msp, tav, IPC ; save user mode special
- pushsr msp, tav, Q ; save user mode special
-
- sub msp, msp, 29*4 ; gr96-gr124
- mtsrim cr, 29-1 ;
- storem 0, 0, gr96, msp ;
-
-
- const v0, WindowSize ; Window Size value
- consth v0, WindowSize ; Window Size value
- load 0, 0, v0, v0 ; load Window size
- add v2, msp, SIGCTX_RAB ; intr RAB value
-
- load 0, 0, v2, v2 ; rab value
-
- sub v1, rfb, v2 ;
- cpgeu v1, v1, v0 ;
- jmpt v1, nfill ; jmp if spill
- add v1, gr1, 8 ;
-
- cpgtu v1, v1, rfb ; longjump test
- jmpt v1, nfill ;
- nop ;
-
-ifill:
- add v0, msp, SIGCTX_RAB+4 ;
- push v0, rab ;
- const v2, fill+4 ;
- consth v2, fill+4 ;
-
- push v0, v2 ; resave PC0
- sub v2, v2, 4 ;
- push v0, v2 ; resave PC1
- const v2, 0 ;
-
- sub v0, v0, 3*4 ;
- push v0, v2 ;
-
-nfill:
- cpgtu v0, gr1, rfb ; if gr1>rfb -> gr1=rfb
- jmpt v0, lower ;
- cpltu v0, gr1, rab ;
- jmpt v0, raise ; gr1<rab then gr1=rab
- nop ;
-
-sendsig:
- sub gr1, gr1, RALLOC ;
- asgeu V_SPILL, gr1, rab ;
- add lr1, rfb, 0 ;
- add v1, msp, SIGCTX_SIG ;
-
-cont:
- add lr2,it3,0 ; signal #
- call lr0, _a29k_ISR_Handler ; call the handler
- nop
-
- nop ; WASTE
- jmp _a29k_sigdfl ; return code
- nop ; WASTE
- nop ; ALIGN
-
-lower:
- jmp sendsig ;
- add gr1, rfb, 0 ;
-raise:
- jmp sendsig ;
- add gr1, rab, 0 ;
-
-
- .global _a29k_sigdfl_sup
-_a29k_sigdfl_sup:
- repair_R_stack ;
- repair_regs ;
- sig_return ; return
- halt ; never executes
-
-
- .global _sigret
-_sigret:
-;assume msp points to tav
- mfsr it0,cps
- const it1,FZ
- or it1,it0,it1
- mtsr cps,it1
- nop
- nop
-_sigret1:
- pop tav,msp
- popsr ops,it0,msp
- popsr alu,it0,msp
- popsr chc,it0,msp
- popsr chd,it0,msp
- popsr cha,it0,msp
- popsr pc2,it0,msp
- popsr pc1,it0,msp
- popsr pc0,it0,msp
- pop rab,msp
- pop it0,msp
- add gr1,it0,0
- add msp,msp,4 ;discount signal
- iret
-
-_a29k_sigdfl:
- asneq SIGDFL,gr1,gr1
- jmpi lr0
- nop
diff --git a/c/src/exec/score/cpu/hppa1.1/Makefile.in b/c/src/exec/score/cpu/hppa1.1/Makefile.in
deleted file mode 100644
index 6409a374fa..0000000000
--- a/c/src/exec/score/cpu/hppa1.1/Makefile.in
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-RELS=$(ARCH)/rtems-cpu.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=cpu
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/cpu.h $(srcdir)/hppa.h $(srcdir)/cpu_asm.h \
- $(srcdir)/hppatypes.h
-
-# H_FILES that get installed externally
-EXTERNAL_H_FILES =
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=cpu_asm rtems
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) $(EXTERNAL_H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS := -I$(ARCH) $(CPPFLAGS)
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(ARCH)/offsets.h: $(ARCH) cpu.h $(PROJECT_RELEASE)/bin/genoffsets
- $(RM) $@
- $(PROJECT_RELEASE)/bin/genoffsets > $@
- $(CHMOD) -w $@
-
-$(ARCH)/rtems-cpu.rel: $(OBJS)
- $(make-rel)
-
-all: ${ARCH} install-headers preinstall $(RELS)
-
-preinstall: $(ARCH) $(SRCS) $(ARCH)/offsets.h
- $(INSTALL) -m 444 $(ARCH)/offsets.h $(PROJECT_INCLUDE)/rtems/score
-
-install-headers: $(ARCH) $(PROJECT_INCLUDE)/rtems/score/targopts.h \
- ${PROJECT_RELEASE}/lib/bsp_specs
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
-# we will share the basic cpu file
- $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
-
-$(PROJECT_INCLUDE)/rtems/score/targopts.h: $(ARCH)/targopts.h-tmp
- $(INSTALL) -m 444 $(ARCH)/targopts.h-tmp $@
-
-# $(ARCH)/targopts.h-tmp rule is in leaf.cfg
-
-${PROJECT_RELEASE}/lib/bsp_specs: $(ARCH)/bsp_specs.tmp
- $(INSTALL) -m 444 $(ARCH)/bsp_specs.tmp $@
-
-# $(ARCH)/bsp_specs.tmp rule is in leaf.cfg
diff --git a/c/src/exec/score/cpu/hppa1.1/cpu.c b/c/src/exec/score/cpu/hppa1.1/cpu.c
deleted file mode 100644
index 282e0e53b6..0000000000
--- a/c/src/exec/score/cpu/hppa1.1/cpu.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * HP PA-RISC Dependent Source
- *
- * COPYRIGHT (c) 1994 by Division Incorporated
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-void hppa_cpu_halt(unsigned32 the_error);
-
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- /*
- * This is unsupported. For HPPA this function is handled by BSP
- */
-
- _CPU_Fatal_halt( 0xdeaddead );
-}
-
-
-
-/*
- * This is the default handler which is called if
- * _CPU_ISR_install_vector() has not been called for the
- * specified vector. It simply forwards onto the spurious
- * handler defined in the cpu-table.
- */
-
-static ISR_Handler
-hppa_interrupt_report_spurious(ISR_Vector_number vector,
- void* rtems_isr_frame) /* HPPA extension */
-{
-
- /*
- * If the CPU table defines a spurious_handler, then
- * call it. If the handler returns halt.
- */
- if ( _CPU_Table.spurious_handler )
- _CPU_Table.spurious_handler(vector, rtems_isr_frame);
-
- hppa_cpu_halt(vector);
-}
-
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level(void)
-{
- int level;
- HPPA_ASM_SSM(0, level); /* change no bits; just get copy */
- if (level & HPPA_PSW_I)
- return 0;
- return 1;
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_vector
- *
- * This kernel routine installs the RTEMS handler for the
- * specified vector. The handler is a C callable routine.
- *
- * 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
-)
-{
- *old_handler = _ISR_Vector_table[vector];
-
- _ISR_Vector_table[vector] = new_handler;
-}
-
-/* _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 */
-)
-{
- register unsigned8 *fp_context;
- unsigned32 i;
- proc_ptr old_handler;
-
- /*
- * This is the default fp context for all tasks
- * Set it up so that denormalized results go to zero.
- */
-
- fp_context = (unsigned8*) &_CPU_Null_fp_context;
- for (i=0 ; i<sizeof(Context_Control_fp); i++)
- *fp_context++ = 0;
- *((unsigned32 *) &_CPU_Null_fp_context) = HPPA_FPSTATUS_D;
-
- /*
- * Save r27 into _CPU_Default_gr27 so it will hopefully be the correct
- * global data pointer for the entire system.
- */
-
- asm volatile( "stw %%r27,%0" : "=m" (_CPU_Default_gr27): );
-
- /*
- * Init the 2nd level interrupt handlers
- */
-
- for (i=0; i < CPU_INTERRUPT_NUMBER_OF_VECTORS; i++)
- _CPU_ISR_install_vector(i,
- hppa_interrupt_report_spurious,
- &old_handler);
-
- _CPU_Table = *cpu_table;
-
-}
-
-
-/*
- * Halt the system.
- * Called by the _CPU_Fatal_halt macro
- *
- * XXX
- * Later on, this will allow us to return to the prom.
- * For now, we just ignore 'type_of_halt'
- *
- * XXX
- * NOTE: for gcc, this function must be at the bottom
- * of the file, that is because if it is at the top
- * of the file, gcc will inline it's calls. Since
- * the function uses the HPPA_ASM_LABEL() macro, when
- * gcc inlines it, you get two definitions of the same
- * label name, which is an assembly error.
- */
-
-
-void
-hppa_cpu_halt(unsigned32 the_error)
-{
- unsigned32 isrlevel;
-
- _CPU_ISR_Disable(isrlevel);
-
- /*
- * XXXXX NOTE: This label is only needed that that when
- * the simulator stops, it shows the label name specified
- */
- HPPA_ASM_LABEL("_hppa_cpu_halt");
- HPPA_ASM_BREAK(0, 0);
-}
-
diff --git a/c/src/exec/score/cpu/hppa1.1/cpu.h b/c/src/exec/score/cpu/hppa1.1/cpu.h
deleted file mode 100644
index ea13c01a66..0000000000
--- a/c/src/exec/score/cpu/hppa1.1/cpu.h
+++ /dev/null
@@ -1,620 +0,0 @@
-/* cpu.h
- *
- * This include file contains information pertaining to the HP
- * PA-RISC processor (Level 1.1).
- *
- * COPYRIGHT (c) 1994 by Division Incorporated
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Note:
- * This file is included by both C and assembler code ( -DASM )
- *
- * $Id$
- */
-
-#ifndef __CPU_h
-#define __CPU_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/hppa.h> /* pick up machine definitions */
-#ifndef ASM
-#include <rtems/score/hppatypes.h>
-#endif
-
-/* conditional compilation parameters */
-
-#define CPU_INLINE_ENABLE_DISPATCH FALSE
-#define CPU_UNROLL_ENQUEUE_PRIORITY TRUE
-
-/*
- * RTEMS manages an interrupt stack in software for the HPPA.
- */
-
-#define CPU_HAS_SOFTWARE_INTERRUPT_STACK TRUE
-#define CPU_HAS_HARDWARE_INTERRUPT_STACK FALSE
-#define CPU_ALLOCATE_INTERRUPT_STACK TRUE
-
-/*
- * Does the RTEMS invoke the user's ISR with the vector number and
- * a pointer to the saved interrupt frame (1) or just the vector
- * number (0)?
- */
-
-#define CPU_ISR_PASSES_FRAME_POINTER 0
-
-/*
- * HPPA has hardware FP, it is assumed to exist by GCC so all tasks
- * may implicitly use it (especially for integer multiplies). Because
- * the FP context is technically part of the basic integer context
- * on this CPU, we cannot use the deferred FP context switch algorithm.
- */
-
-#define CPU_HARDWARE_FP TRUE
-#define CPU_ALL_TASKS_ARE_FP TRUE
-#define CPU_IDLE_TASK_IS_FP FALSE
-#define CPU_USE_DEFERRED_FP_SWITCH FALSE
-
-#define CPU_PROVIDES_IDLE_THREAD_BODY FALSE
-#define CPU_STACK_GROWS_UP TRUE
-#define CPU_STRUCTURE_ALIGNMENT __attribute__ ((__aligned__ (32)))
-
-/*
- * Define what is required to specify how the network to host conversion
- * routines are handled.
- */
-
-#define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE
-#define CPU_BIG_ENDIAN TRUE
-#define CPU_LITTLE_ENDIAN FALSE
-
-/* constants */
-
-#define CPU_MODES_INTERRUPT_LEVEL 0x00000001 /* interrupt level in mode */
-#define CPU_MODES_INTERRUPT_MASK 0x00000001 /* interrupt level in mode */
-
-/*
- * PSW contstants
- */
-
-#define CPU_PSW_BASE (HPPA_PSW_C | HPPA_PSW_Q | HPPA_PSW_P | HPPA_PSW_D)
-#define CPU_PSW_INTERRUPTS_ON (CPU_PSW_BASE | HPPA_PSW_I)
-#define CPU_PSW_INTERRUPTS_OFF (CPU_PSW_BASE)
-
-#define CPU_PSW_DEFAULT CPU_PSW_BASE
-
-
-#ifndef ASM
-
-/*
- * Contexts
- *
- * This means we have the following context items:
- * 1. task level context stuff:: Context_Control
- * 2. floating point task stuff:: Context_Control_fp
- *
- * The PA-RISC is very fast so the expense of saving an extra register
- * or two is not of great concern at the present. So we are not making
- * a distinction between what is saved during a task switch and what is
- * saved at each interrupt. Plus saving the entire context should make
- * it easier to make gdb aware of RTEMS tasks.
- */
-
-typedef struct {
- unsigned32 flags; /* whatever */
- unsigned32 gr1; /* scratch -- caller saves */
- unsigned32 gr2; /* RP -- return pointer */
- unsigned32 gr3; /* scratch -- callee saves */
- unsigned32 gr4; /* scratch -- callee saves */
- unsigned32 gr5; /* scratch -- callee saves */
- unsigned32 gr6; /* scratch -- callee saves */
- unsigned32 gr7; /* scratch -- callee saves */
- unsigned32 gr8; /* scratch -- callee saves */
- unsigned32 gr9; /* scratch -- callee saves */
- unsigned32 gr10; /* scratch -- callee saves */
- unsigned32 gr11; /* scratch -- callee saves */
- unsigned32 gr12; /* scratch -- callee saves */
- unsigned32 gr13; /* scratch -- callee saves */
- unsigned32 gr14; /* scratch -- callee saves */
- unsigned32 gr15; /* scratch -- callee saves */
- unsigned32 gr16; /* scratch -- callee saves */
- unsigned32 gr17; /* scratch -- callee saves */
- unsigned32 gr18; /* scratch -- callee saves */
- unsigned32 gr19; /* scratch -- caller saves */
- unsigned32 gr20; /* scratch -- caller saves */
- unsigned32 gr21; /* scratch -- caller saves */
- unsigned32 gr22; /* scratch -- caller saves */
- unsigned32 gr23; /* argument 3 */
- unsigned32 gr24; /* argument 2 */
- unsigned32 gr25; /* argument 1 */
- unsigned32 gr26; /* argument 0 */
- unsigned32 gr27; /* DP -- global data pointer */
- unsigned32 gr28; /* return values -- caller saves */
- unsigned32 gr29; /* return values -- caller saves */
- unsigned32 sp; /* gr30 */
- unsigned32 gr31;
-
- /* Various control registers */
-
- unsigned32 sar; /* cr11 */
- unsigned32 ipsw; /* cr22; full 32 bits of psw */
- unsigned32 iir; /* cr19; interrupt instruction register */
- unsigned32 ior; /* cr21; interrupt offset register */
- unsigned32 isr; /* cr20; interrupt space register (not used) */
- unsigned32 pcoqfront; /* cr18; front que offset */
- unsigned32 pcoqback; /* cr18; back que offset */
- unsigned32 pcsqfront; /* cr17; front que space (not used) */
- unsigned32 pcsqback; /* cr17; back que space (not used) */
- unsigned32 itimer; /* cr16; itimer value */
-
-} Context_Control;
-
-
-/* Must be double word aligned.
- * This will be ok since our allocator returns 8 byte aligned chunks
- */
-
-typedef struct {
- double fr0; /* status */
- double fr1; /* exception information */
- double fr2; /* exception information */
- double fr3; /* exception information */
- double fr4; /* argument */
- double fr5; /* argument */
- double fr6; /* argument */
- double fr7; /* argument */
- double fr8; /* scratch -- caller saves */
- double fr9; /* scratch -- caller saves */
- double fr10; /* scratch -- caller saves */
- double fr11; /* scratch -- caller saves */
- double fr12; /* callee saves -- (PA-RISC 1.1 CPUs) */
- double fr13; /* callee saves -- (PA-RISC 1.1 CPUs) */
- double fr14; /* callee saves -- (PA-RISC 1.1 CPUs) */
- double fr15; /* callee saves -- (PA-RISC 1.1 CPUs) */
- double fr16; /* callee saves -- (PA-RISC 1.1 CPUs) */
- double fr17; /* callee saves -- (PA-RISC 1.1 CPUs) */
- double fr18; /* callee saves -- (PA-RISC 1.1 CPUs) */
- double fr19; /* callee saves -- (PA-RISC 1.1 CPUs) */
- double fr20; /* callee saves -- (PA-RISC 1.1 CPUs) */
- double fr21; /* callee saves -- (PA-RISC 1.1 CPUs) */
- double fr22; /* caller saves -- (PA-RISC 1.1 CPUs) */
- double fr23; /* caller saves -- (PA-RISC 1.1 CPUs) */
- double fr24; /* caller saves -- (PA-RISC 1.1 CPUs) */
- double fr25; /* caller saves -- (PA-RISC 1.1 CPUs) */
- double fr26; /* caller saves -- (PA-RISC 1.1 CPUs) */
- double fr27; /* caller saves -- (PA-RISC 1.1 CPUs) */
- double fr28; /* caller saves -- (PA-RISC 1.1 CPUs) */
- double fr29; /* caller saves -- (PA-RISC 1.1 CPUs) */
- double fr30; /* caller saves -- (PA-RISC 1.1 CPUs) */
- double fr31; /* caller saves -- (PA-RISC 1.1 CPUs) */
-} Context_Control_fp;
-
-/*
- * The following structure defines the set of information saved
- * on the current stack by RTEMS upon receipt of each interrupt.
- */
-
-typedef struct {
- Context_Control Integer;
- Context_Control_fp Floating_Point;
-} CPU_Interrupt_frame;
-
-/*
- * Our interrupt handlers take a 2nd argument:
- * a pointer to a CPU_Interrupt_frame
- * So we use our own prototype instead of rtems_isr_entry
- */
-
-typedef void ( *hppa_rtems_isr_entry )(
- unsigned32,
- CPU_Interrupt_frame *
- );
-
-/*
- * The following table contains the information required to configure
- * the HPPA specific parameters.
- */
-
-typedef struct {
- void (*pretasking_hook)( void );
- void (*predriver_hook)( void );
- void (*postdriver_hook)( void );
- void (*idle_task)( void );
- boolean do_zero_of_workspace;
- unsigned32 idle_task_stack_size;
- unsigned32 interrupt_stack_size;
- unsigned32 extra_mpci_receive_server_stack;
- void * (*stack_allocate_hook)( unsigned32 );
- void (*stack_free_hook)( void * );
- /* end of fields required on all CPUs */
-
- hppa_rtems_isr_entry spurious_handler;
-
- unsigned32 itimer_clicks_per_microsecond; /* for use by Clock driver */
-} rtems_cpu_table;
-
-/* variables */
-
-SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context;
-SCORE_EXTERN unsigned32 _CPU_Default_gr27;
-SCORE_EXTERN void *_CPU_Interrupt_stack_low;
-SCORE_EXTERN void *_CPU_Interrupt_stack_high;
-
-#endif /* ! ASM */
-
-/*
- * context sizes
- */
-
-#ifndef ASM
-#define CPU_CONTEXT_SIZE sizeof( Context_Control )
-#define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp )
-#endif
-
-/*
- * size of a frame on the stack
- */
-
-#define CPU_FRAME_SIZE (16 * 4)
-
-/*
- * (Optional) # of bytes for libmisc/stackchk to check
- * If not specifed, then it defaults to something reasonable
- * for most architectures.
- */
-
-#define CPU_STACK_CHECK_SIZE (CPU_FRAME_SIZE * 2)
-
-/*
- * extra stack required by the MPCI receive server thread
- */
-
-#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0
-
-/*
- * HPPA has 32 traps, then 32 external interrupts
- * Rtems (_ISR_Vector_Table) is aware ONLY of the first 32
- * The BSP is aware of the external interrupts and possibly more.
- *
- */
-
-#define CPU_INTERRUPT_NUMBER_OF_VECTORS (HPPA_INTERNAL_TRAPS)
-#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1)
-
-/*
- * Don't be chintzy here; we don't want to debug these problems
- * Some of the tests eat almost 4k.
- * Plus, the HPPA always allocates chunks of 64 bytes for stack
- * growth.
- */
-
-#define CPU_STACK_MINIMUM_SIZE (8 * 1024)
-
-/*
- * HPPA double's must be on 8 byte boundary
- */
-
-#define CPU_ALIGNMENT 8
-
-/*
- * just follow the basic HPPA alignment for the heap and partition
- */
-
-#define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT
-#define CPU_PARTITION_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * HPPA stack is best when 64 byte aligned.
- */
-
-#define CPU_STACK_ALIGNMENT 64
-
-#ifndef ASM
-
-/* macros */
-
-/*
- * ISR handler macros
- *
- * These macros perform the following functions:
- * + disable all maskable CPU interrupts
- * + restore previous interrupt level (enable)
- * + temporarily restore interrupts (flash)
- * + set a particular level
- */
-
-/* Disable interrupts; returning previous psw bits in _isr_level */
-#define _CPU_ISR_Disable( _isr_level ) \
- do { \
- HPPA_ASM_RSM(HPPA_PSW_I, _isr_level); \
- if (_isr_level & HPPA_PSW_I) _isr_level = 0; \
- else _isr_level = 1; \
- } while(0)
-
-/* Enable interrupts to previous level from _CPU_ISR_Disable
- * does not change 'level' */
-#define _CPU_ISR_Enable( _isr_level ) \
- { \
- register int _ignore; \
- if (_isr_level == 0) HPPA_ASM_SSM(HPPA_PSW_I, _ignore); \
- else HPPA_ASM_RSM(HPPA_PSW_I, _ignore); \
- }
-
-/* restore, then disable interrupts; does not change level */
-#define _CPU_ISR_Flash( _isr_level ) \
- { \
- if (_isr_level == 0) \
- { \
- register int _ignore; \
- HPPA_ASM_SSM(HPPA_PSW_I, _ignore); \
- HPPA_ASM_RSM(HPPA_PSW_I, _ignore); \
- } \
- }
-
-/*
- * Interrupt task levels
- *
- * Future scheme proposal
- * level will be an index into a array.
- * Each entry of array will be the interrupt bits
- * enabled for that level. There will be 32 bits of external
- * interrupts (to be placed in EIEM) and some (optional) bsp
- * specific bits
- *
- * For pixel flow this *may* mean something like:
- * level 0: all interrupts enabled (external + rhino)
- * level 1: rhino disabled
- * level 2: all io interrupts disabled (timer still enabled)
- * level 7: *ALL* disabled (timer disabled)
- */
-
-/* set interrupts on or off; does not return new level */
-#define _CPU_ISR_Set_level( new_level ) \
- { \
- volatile int ignore; \
- if ( new_level ) HPPA_ASM_RSM(HPPA_PSW_I, ignore); \
- else HPPA_ASM_SSM(HPPA_PSW_I, ignore); \
- }
-
-/* return current level */
-unsigned32 _CPU_ISR_Get_level( void );
-
-/* end of ISR handler macros */
-
-/*
- * Context handler macros
- *
- * These macros perform the following functions:
- * + initialize a context area
- * + restart the current thread
- * + calculate the initial pointer into a FP context area
- * + initialize an FP context area
- *
- * HPPA port adds two macros which hide the "indirectness" of the
- * pointer passed the save/restore FP context assembly routines.
- */
-
-#define _CPU_Context_Initialize( _the_context, _stack_base, _size, \
- _new_level, _entry_point, _is_fp ) \
- do { \
- unsigned32 _stack; \
- \
- (_the_context)->flags = 0xfeedf00d; \
- (_the_context)->pcoqfront = (unsigned32)(_entry_point); \
- (_the_context)->pcoqback = (unsigned32)(_entry_point) + 4; \
- (_the_context)->pcsqfront = 0; \
- (_the_context)->pcsqback = 0; \
- if ( (_new_level) ) \
- (_the_context)->ipsw = CPU_PSW_INTERRUPTS_OFF; \
- else \
- (_the_context)->ipsw = CPU_PSW_INTERRUPTS_ON; \
- \
- _stack = ((unsigned32)(_stack_base) + (CPU_STACK_ALIGNMENT - 1)); \
- _stack &= ~(CPU_STACK_ALIGNMENT - 1); \
- if ((_stack - (unsigned32) (_stack_base)) < CPU_FRAME_SIZE) \
- _stack += CPU_FRAME_SIZE; \
- \
- (_the_context)->sp = (_stack); \
- (_the_context)->gr27 = _CPU_Default_gr27; \
- } while (0)
-
-#define _CPU_Context_Restart_self( _the_context ) \
- do { \
- _CPU_Context_restore( (_the_context) ); \
- } while (0)
-
-#define _CPU_Context_Fp_start( _base, _offset ) \
- ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
-
-#define _CPU_Context_Initialize_fp( _destination ) \
- do { \
- *((Context_Control_fp *) *((void **) _destination)) = _CPU_Null_fp_context;\
- } while(0)
-
-#define _CPU_Context_save_fp( _fp_context ) \
- _CPU_Save_float_context( *(Context_Control_fp **)(_fp_context) )
-
-#define _CPU_Context_restore_fp( _fp_context ) \
- _CPU_Restore_float_context( *(Context_Control_fp **)(_fp_context) )
-
-/* end of Context handler macros */
-
-/*
- * Fatal Error manager macros
- *
- * These macros perform the following functions:
- * + disable interrupts and halt the CPU
- */
-
-void hppa_cpu_halt(unsigned32 the_error);
-#define _CPU_Fatal_halt( _error ) \
- hppa_cpu_halt(_error)
-
-/* end of Fatal Error manager macros */
-
-/*
- * Bitfield handler macros
- *
- * These macros perform the following functions:
- * + scan for the highest numbered (MSB) set in a 16 bit bitfield
- *
- * NOTE:
- *
- * The HPPA does not have a scan instruction. This functionality
- * is implemented in software.
- */
-
-#define CPU_USE_GENERIC_BITFIELD_CODE FALSE
-#define CPU_USE_GENERIC_BITFIELD_DATA FALSE
-
-int hppa_rtems_ffs(unsigned int value);
-#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
- _output = hppa_rtems_ffs(_value)
-
-/* end of Bitfield handler macros */
-
-/*
- * Priority handler macros
- *
- * These macros perform the following functions:
- * + return a mask with the bit for this major/minor portion of
- * of thread priority set.
- * + translate the bit number returned by "Bitfield_find_first_bit"
- * into an index into the thread ready chain bit maps
- *
- * Note: 255 is the lowest priority
- */
-
-#define _CPU_Priority_Mask( _bit_number ) \
- ( 1 << (_bit_number) )
-
-#define _CPU_Priority_bits_index( _priority ) \
- (_priority)
-
-/* end of Priority handler macros */
-
-/* functions */
-
-/*
- * _CPU_Initialize
- *
- * This routine performs CPU dependent initialization.
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch)
-);
-
-/*
- * _CPU_ISR_install_raw_handler
- *
- * This routine installs a "raw" interrupt handler directly into the
- * processor's vector table.
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_ISR_install_vector
- *
- * This routine installs an interrupt vector.
- */
-
-void _CPU_ISR_install_vector(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_Context_switch
- *
- * This routine switches from the run context to the heir context.
- */
-
-void _CPU_Context_switch(
- Context_Control *run,
- Context_Control *heir
-);
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally used only to restart self in an
- * efficient manner and avoid stack conflicts.
- */
-
-void _CPU_Context_restore(
- Context_Control *new_context
-);
-
-/*
- * _CPU_Save_float_context
- *
- * This routine saves the floating point context passed to it.
- *
- * NOTE: _CPU_Context_save_fp is implemented as a macro on the HPPA
- * which dereferences the pointer before calling this.
- */
-
-void _CPU_Save_float_context(
- Context_Control_fp *fp_context
-);
-
-/*
- * _CPU_Restore_float_context
- *
- * This routine restores the floating point context passed to it.
- *
- * NOTE: _CPU_Context_save_fp is implemented as a macro on the HPPA
- * which dereferences the pointer before calling this.
- */
-
-void _CPU_Restore_float_context(
- Context_Control_fp *fp_context
-);
-
-
-/*
- * The raw interrupt handler for external interrupts
- */
-
-extern void _Generic_ISR_Handler(
- void
-);
-
-
-/* The following routine swaps the endian format of an unsigned int.
- * It must be static so it can be referenced indirectly.
- */
-
-static inline unsigned int
-CPU_swap_u32(unsigned32 value)
-{
- unsigned32 swapped;
-
- HPPA_ASM_SWAPBYTES(value, swapped);
-
- return( swapped );
-}
-
-#define CPU_swap_u16( value ) \
- (((value&0xff) << 8) | ((value >> 8)&0xff))
-
-#endif /* ! ASM */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! __CPU_h */
diff --git a/c/src/exec/score/cpu/hppa1.1/cpu_asm.h b/c/src/exec/score/cpu/hppa1.1/cpu_asm.h
deleted file mode 100644
index 951f80dcf0..0000000000
--- a/c/src/exec/score/cpu/hppa1.1/cpu_asm.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 1990,1991 The University of Utah and
- * the Center for Software Science (CSS). All rights reserved.
- *
- * Permission to use, copy, modify and distribute this software is hereby
- * granted provided that (1) source code retains these copyright, permission,
- * and disclaimer notices, and (2) redistributions including binaries
- * reproduce the notices in supporting documentation, and (3) all advertising
- * materials mentioning features or use of this software display the following
- * acknowledgement: ``This product includes software developed by the Center
- * for Software Science at the University of Utah.''
- *
- * THE UNIVERSITY OF UTAH AND CSS ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
- * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSS DISCLAIM ANY LIABILITY OF
- * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * CSS requests users of this software to return to css-dist@cs.utah.edu any
- * improvements that they make and grant CSS redistribution rights.
- *
- * Utah $Hdr: asm.h 1.6 91/12/03$
- *
- * $Id$
- */
-
-/*
- * Hardware Space Registers
- */
-sr0 .reg %sr0
-sr1 .reg %sr1
-sr2 .reg %sr2
-sr3 .reg %sr3
-sr4 .reg %sr4
-sr5 .reg %sr5
-sr6 .reg %sr6
-sr7 .reg %sr7
-
-/*
- * Control register aliases
- */
-
-rctr .reg %cr0
-pidr1 .reg %cr8
-pidr2 .reg %cr9
-ccr .reg %cr10
-sar .reg %cr11
-pidr3 .reg %cr12
-pidr4 .reg %cr13
-iva .reg %cr14
-eiem .reg %cr15
-itmr .reg %cr16
-pcsq .reg %cr17
-pcoq .reg %cr18
-iir .reg %cr19
-isr .reg %cr20
-ior .reg %cr21
-ipsw .reg %cr22
-eirr .reg %cr23
-
-/*
- * Calling Convention
- */
-rp .reg %r2
-arg3 .reg %r23
-arg2 .reg %r24
-arg1 .reg %r25
-arg0 .reg %r26
-dp .reg %r27
-ret0 .reg %r28
-ret1 .reg %r29
-sl .reg %r29
-sp .reg %r30
-
-
diff --git a/c/src/exec/score/cpu/hppa1.1/cpu_asm.s b/c/src/exec/score/cpu/hppa1.1/cpu_asm.s
deleted file mode 100644
index e6d9fd08d8..0000000000
--- a/c/src/exec/score/cpu/hppa1.1/cpu_asm.s
+++ /dev/null
@@ -1,778 +0,0 @@
-/*
- * TODO:
- * Context_switch needs to only save callee save registers
- * I think this means can skip: r1, r2, r19-29, r31
- * Ref: p 3-2 of Procedure Calling Conventions Manual
- * This should be #ifndef DEBUG so that debugger has
- * accurate visibility into all registers
- *
- * This file contains the assembly code for the HPPA implementation
- * of RTEMS.
- *
- * COPYRIGHT (c) 1994,95 by Division Incorporated
- *
- * The license and distribution terms 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/score/hppa.h>
-#include <rtems/score/cpu_asm.h>
-#include <rtems/score/cpu.h>
-#include <rtems/score/offsets.h>
-
- .SPACE $PRIVATE$
- .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
- .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
- .SPACE $TEXT$
- .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
- .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
- .SPACE $TEXT$
- .SUBSPA $CODE$
-
-/*
- * Special register usage for context switch and interrupts
- * Stay away from %cr28 which is used for TLB misses on 72000
- */
-
-isr_arg0 .reg %cr24
-isr_r9 .reg %cr25
-isr_r8 .reg %cr26
-
-/*
- * Interrupt stack frame looks like this
- *
- * offset item
- * -----------------------------------------------------------------
- * INTEGER_CONTEXT_OFFSET Context_Control
- * FP_CONTEXT_OFFSET Context_Control_fp
- *
- * It is padded out to a multiple of 64
- */
-
-
-/*PAGE^L
- * void _Generic_ISR_Handler()
- *
- * This routine provides the RTEMS interrupt management.
- *
- * We jump here from the interrupt vector.
- * The HPPA hardware has done some stuff for us:
- * PSW saved in IPSW
- * PSW set to 0
- * PSW[E] set to default (0)
- * PSW[M] set to 1 iff this is HPMC
- *
- * IIA queue is frozen (since PSW[Q] is now 0)
- * privilege level promoted to 0
- * IIR, ISR, IOR potentially updated if PSW[Q] was 1 at trap
- * registers GR 1,8,9,16,17,24,25 copied to shadow regs
- * SHR 0 1 2 3 4 5 6
- *
- * Our vector stub (in the BSP) MUST have done the following:
- *
- * a) Saved the original %r9 into %isr_r9 (%cr25)
- * b) Placed the vector number in %r9
- * c) Was allowed to also destroy $isr_r8 (%cr26),
- * but the stub was NOT allowed to destroy any other registers.
- *
- * The typical stub sequence (in the BSP) should look like this:
- *
- * a) mtctl %r9,isr_r9 ; (save r9 in cr25)
- * b) ldi vector,%r9 ; (load constant vector number in r9)
- * c) mtctl %r8,isr_r8 ; (save r8 in cr26)
- * d) ldil L%MY_BSP_first_level_interrupt_handler,%r8
- * e) ldo R%MY_BSP_first_level_interrupt_handler(%r8),%r8
- * ; (point to BSP raw handler table)
- * f) ldwx,s %r9(%r8),%r8 ; (load value from raw handler table)
- * g) bv 0(%r8) ; (call raw handler: _Generic_ISR_Handler)
- * h) mfctl isr_r8,%r8 ; (restore r8 from cr26 in delay slot)
- *
- * Optionally, steps (c) thru (h) _could_ be replaced with a single
- * bl,n _Generic_ISR_Handler,%r0
- *
- *
- */
- .EXPORT _Generic_ISR_Handler,ENTRY,PRIV_LEV=0
-_Generic_ISR_Handler:
- .PROC
- .CALLINFO FRAME=0,NO_CALLS
- .ENTRY
-
- mtctl arg0, isr_arg0
-
-/*
- * save interrupt state
- */
- mfctl ipsw, arg0
- stw arg0, IPSW_OFFSET(sp)
-
- mfctl iir, arg0
- stw arg0, IIR_OFFSET(sp)
-
- mfctl ior, arg0
- stw arg0, IOR_OFFSET(sp)
-
- mfctl pcoq, arg0
- stw arg0, PCOQFRONT_OFFSET(sp)
-
- mtctl %r0, pcoq
- mfctl pcoq, arg0
- stw arg0, PCOQBACK_OFFSET(sp)
-
- mfctl %sar, arg0
- stw arg0, SAR_OFFSET(sp)
-
-/*
- * Build an interrupt frame to hold the contexts we will need.
- * We have already saved the interrupt items on the stack
- *
- * At this point the following registers are damaged wrt the interrupt
- * reg current value saved value
- * ------------------------------------------------
- * arg0 scratch isr_arg0 (cr24)
- * r9 vector number isr_r9 (cr25)
- *
- * Point to beginning of integer context and
- * save the integer context
- */
- stw %r1,R1_OFFSET(sp)
- stw %r2,R2_OFFSET(sp)
- stw %r3,R3_OFFSET(sp)
- stw %r4,R4_OFFSET(sp)
- stw %r5,R5_OFFSET(sp)
- stw %r6,R6_OFFSET(sp)
- stw %r7,R7_OFFSET(sp)
- stw %r8,R8_OFFSET(sp)
-/*
- * skip r9
- */
- stw %r10,R10_OFFSET(sp)
- stw %r11,R11_OFFSET(sp)
- stw %r12,R12_OFFSET(sp)
- stw %r13,R13_OFFSET(sp)
- stw %r14,R14_OFFSET(sp)
- stw %r15,R15_OFFSET(sp)
- stw %r16,R16_OFFSET(sp)
- stw %r17,R17_OFFSET(sp)
- stw %r18,R18_OFFSET(sp)
- stw %r19,R19_OFFSET(sp)
- stw %r20,R20_OFFSET(sp)
- stw %r21,R21_OFFSET(sp)
- stw %r22,R22_OFFSET(sp)
- stw %r23,R23_OFFSET(sp)
- stw %r24,R24_OFFSET(sp)
- stw %r25,R25_OFFSET(sp)
-/*
- * skip arg0
- */
- stw %r27,R27_OFFSET(sp)
- stw %r28,R28_OFFSET(sp)
- stw %r29,R29_OFFSET(sp)
- stw %r30,R30_OFFSET(sp)
- stw %r31,R31_OFFSET(sp)
-
-/* Now most registers are available since they have been saved
- *
- * The following items are currently wrong in the integer context
- * reg current value saved value
- * ------------------------------------------------
- * arg0 scratch isr_arg0 (cr24)
- * r9 vector number isr_r9 (cr25)
- *
- * Fix them
- */
-
- mfctl isr_arg0,%r3
- stw %r3,ARG0_OFFSET(sp)
-
- mfctl isr_r9,%r3
- stw %r3,R9_OFFSET(sp)
-
-/*
- * At this point we are done with isr_arg0, and isr_r9 control registers
- *
- * Prepare to re-enter virtual mode
- * We need Q in case the interrupt handler enables interrupts
- */
-
- ldil L%CPU_PSW_DEFAULT, arg0
- ldo R%CPU_PSW_DEFAULT(arg0), arg0
- mtctl arg0, ipsw
-
-/*
- * Now jump to "rest_of_isr_handler" with the rfi
- * We are assuming the space queues are all correct already
- */
-
- ldil L%rest_of_isr_handler, arg0
- ldo R%rest_of_isr_handler(arg0), arg0
- mtctl arg0, pcoq
- ldo 4(arg0), arg0
- mtctl arg0, pcoq
-
- rfi
- nop
-
-/*
- * At this point we are back in virtual mode and all our
- * normal addressing is once again ok.
- *
- * It is now ok to take an exception or trap
- */
-
-rest_of_isr_handler:
-
-/*
- * Point to beginning of float context and
- * save the floating point context -- doing whatever patches are necessary
- */
-
- .call ARGW0=GR
- bl _CPU_Save_float_context,%r2
- ldo FP_CONTEXT_OFFSET(sp),arg0
-
-/*
- * save the ptr to interrupt frame as an argument for the interrupt handler
- */
-
- copy sp, arg1
-
-/*
- * Advance the frame to point beyond all interrupt contexts (integer & float)
- * this also includes the pad to align to 64byte stack boundary
- */
- ldo CPU_INTERRUPT_FRAME_SIZE(sp), sp
-
-/*
- * r3 -- &_ISR_Nest_level
- * r5 -- value _ISR_Nest_level
- * r4 -- &_Thread_Dispatch_disable_level
- * r6 -- value _Thread_Dispatch_disable_level
- * r9 -- vector number
- */
-
- .import _ISR_Nest_level,data
- ldil L%_ISR_Nest_level,%r3
- ldo R%_ISR_Nest_level(%r3),%r3
- ldw 0(%r3),%r5
-
- .import _Thread_Dispatch_disable_level,data
- ldil L%_Thread_Dispatch_disable_level,%r4
- ldo R%_Thread_Dispatch_disable_level(%r4),%r4
- ldw 0(%r4),%r6
-
-/*
- * increment interrupt nest level counter. If outermost interrupt
- * switch the stack and squirrel away the previous sp.
- */
- addi 1,%r5,%r5
- stw %r5, 0(%r3)
-
-/*
- * compute and save new stack (with frame)
- * just in case we are nested -- simpler this way
- */
- comibf,= 1,%r5,stack_done
- ldo 128(sp),%r7
-
-/*
- * Switch to interrupt stack allocated by the interrupt manager (intr.c)
- */
- .import _CPU_Interrupt_stack_low,data
- ldil L%_CPU_Interrupt_stack_low,%r7
- ldw R%_CPU_Interrupt_stack_low(%r7),%r7
- ldo 128(%r7),%r7
-
-stack_done:
-/*
- * save our current stack pointer where the "old sp" is supposed to be
- */
- stw sp, -4(%r7)
-/*
- * and switch stacks (or advance old stack in nested case)
- */
- copy %r7, sp
-
-/*
- * increment the dispatch disable level counter.
- */
- addi 1,%r6,%r6
- stw %r6, 0(%r4)
-
-/*
- * load address of user handler
- * Note: No error checking is done, it is assumed that the
- * vector table contains a valid address or a stub
- * spurious handler.
- */
- .import _ISR_Vector_table,data
- ldil L%_ISR_Vector_table,%r8
- ldo R%_ISR_Vector_table(%r8),%r8
- ldwx,s %r9(%r8),%r8
-
-/*
- * invoke user interrupt handler
- * Interrupts are currently disabled, as per RTEMS convention
- * The handler has the option of re-enabling interrupts
- * NOTE: can not use 'bl' since it uses "pc-relative" addressing
- * and we are using a hard coded address from a table
- * So... we fudge r2 ourselves (ala dynacall)
- * arg0 = vector number, arg1 = ptr to rtems_interrupt_frame
- */
- copy %r9, %r26
- .call ARGW0=GR, ARGW1=GR
- blr %r0, rp
- bv,n 0(%r8)
-
-post_user_interrupt_handler:
-
-/*
- * Back from user handler(s)
- * Disable external interrupts (since the interrupt handler could
- * have turned them on) and return to the interrupted task stack (assuming
- * (_ISR_Nest_level == 0)
- */
-
- rsm HPPA_PSW_I + HPPA_PSW_R, %r0
- ldw -4(sp), sp
-
-/*
- * r3 -- (most of) &_ISR_Nest_level
- * r5 -- value _ISR_Nest_level
- * r4 -- (most of) &_Thread_Dispatch_disable_level
- * r6 -- value _Thread_Dispatch_disable_level
- * r7 -- (most of) &_ISR_Signals_to_thread_executing
- * r8 -- value _ISR_Signals_to_thread_executing
- */
-
- .import _ISR_Nest_level,data
- ldil L%_ISR_Nest_level,%r3
- ldw R%_ISR_Nest_level(%r3),%r5
-
- .import _Thread_Dispatch_disable_level,data
- ldil L%_Thread_Dispatch_disable_level,%r4
- ldw R%_Thread_Dispatch_disable_level(%r4),%r6
-
- .import _ISR_Signals_to_thread_executing,data
- ldil L%_ISR_Signals_to_thread_executing,%r7
-
-/*
- * decrement isr nest level
- */
- addi -1, %r5, %r5
- stw %r5, R%_ISR_Nest_level(%r3)
-
-/*
- * decrement dispatch disable level counter and, if not 0, go on
- */
- addi -1,%r6,%r6
- comibf,= 0,%r6,isr_restore
- stw %r6, R%_Thread_Dispatch_disable_level(%r4)
-
-/*
- * check whether or not a context switch is necessary
- */
- .import _Context_Switch_necessary,data
- ldil L%_Context_Switch_necessary,%r8
- ldw R%_Context_Switch_necessary(%r8),%r8
- comibf,=,n 0,%r8,ISR_dispatch
-
-/*
- * check whether or not a context switch is necessary because an ISR
- * sent signals to the interrupted task
- */
- ldw R%_ISR_Signals_to_thread_executing(%r7),%r8
- comibt,=,n 0,%r8,isr_restore
-
-
-/*
- * OK, something happened while in ISR and we need to switch to a task
- * other than the one which was interrupted or the
- * ISR_Signals_to_thread_executing case
- * We also turn on interrupts, since the interrupted task had them
- * on (obviously :-) and Thread_Dispatch is happy to leave ints on.
- */
-
-ISR_dispatch:
- stw %r0, R%_ISR_Signals_to_thread_executing(%r7)
-
- ssm HPPA_PSW_I, %r0
-
- .import _Thread_Dispatch,code
- .call
- bl _Thread_Dispatch,%r2
- ldo 128(sp),sp
-
- ldo -128(sp),sp
-
-isr_restore:
-
-/*
- * enable interrupts during most of restore
- */
- ssm HPPA_PSW_I, %r0
-
-/*
- * Get a pointer to beginning of our stack frame
- */
- ldo -CPU_INTERRUPT_FRAME_SIZE(sp), %arg1
-
-/*
- * restore float
- */
- .call ARGW0=GR
- bl _CPU_Restore_float_context,%r2
- ldo FP_CONTEXT_OFFSET(%arg1), arg0
-
- copy %arg1, %arg0
-
-/*
- * ********** FALL THRU **********
- */
-
-/*
- * Jump here from bottom of Context_Switch
- * Also called directly by _CPU_Context_Restart_self via _Thread_Restart_self
- * restore interrupt state
- */
-
- .EXPORT _CPU_Context_restore
-_CPU_Context_restore:
-
-/*
- * restore integer state
- */
- ldw R1_OFFSET(arg0),%r1
- ldw R2_OFFSET(arg0),%r2
- ldw R3_OFFSET(arg0),%r3
- ldw R4_OFFSET(arg0),%r4
- ldw R5_OFFSET(arg0),%r5
- ldw R6_OFFSET(arg0),%r6
- ldw R7_OFFSET(arg0),%r7
- ldw R8_OFFSET(arg0),%r8
- ldw R9_OFFSET(arg0),%r9
- ldw R10_OFFSET(arg0),%r10
- ldw R11_OFFSET(arg0),%r11
- ldw R12_OFFSET(arg0),%r12
- ldw R13_OFFSET(arg0),%r13
- ldw R14_OFFSET(arg0),%r14
- ldw R15_OFFSET(arg0),%r15
- ldw R16_OFFSET(arg0),%r16
- ldw R17_OFFSET(arg0),%r17
- ldw R18_OFFSET(arg0),%r18
- ldw R19_OFFSET(arg0),%r19
- ldw R20_OFFSET(arg0),%r20
- ldw R21_OFFSET(arg0),%r21
- ldw R22_OFFSET(arg0),%r22
- ldw R23_OFFSET(arg0),%r23
- ldw R24_OFFSET(arg0),%r24
-/*
- * skipping r25; used as scratch register below
- * skipping r26 (arg0) until we are done with it
- */
- ldw R27_OFFSET(arg0),%r27
- ldw R28_OFFSET(arg0),%r28
- ldw R29_OFFSET(arg0),%r29
-/*
- * skipping r30 (sp) until we turn off interrupts
- */
- ldw R31_OFFSET(arg0),%r31
-
-/*
- * Turn off Q & R & I so we can write r30 and interrupt control registers
- */
- rsm HPPA_PSW_Q + HPPA_PSW_R + HPPA_PSW_I, %r0
-
-/*
- * now safe to restore r30
- */
- ldw R30_OFFSET(arg0),%r30
-
- ldw IPSW_OFFSET(arg0), %r25
- mtctl %r25, ipsw
-
- ldw SAR_OFFSET(arg0), %r25
- mtctl %r25, sar
-
- ldw PCOQFRONT_OFFSET(arg0), %r25
- mtctl %r25, pcoq
-
- ldw PCOQBACK_OFFSET(arg0), %r25
- mtctl %r25, pcoq
-
-/*
- * Load r25 with interrupts off
- */
- ldw R25_OFFSET(arg0),%r25
-/*
- * Must load r26 (arg0) last
- */
- ldw R26_OFFSET(arg0),%r26
-
-isr_exit:
- rfi
- .EXIT
- .PROCEND
-
-/*
- * This section is used to context switch floating point registers.
- * Ref: 6-35 of Architecture 1.1
- *
- * NOTE: since integer multiply uses the floating point unit,
- * we have to save/restore fp on every trap. We cannot
- * just try to keep track of fp usage.
- */
-
- .align 32
- .EXPORT _CPU_Save_float_context,ENTRY,PRIV_LEV=0
-_CPU_Save_float_context:
- .PROC
- .CALLINFO FRAME=0,NO_CALLS
- .ENTRY
- fstds,ma %fr0,8(%arg0)
- fstds,ma %fr1,8(%arg0)
- fstds,ma %fr2,8(%arg0)
- fstds,ma %fr3,8(%arg0)
- fstds,ma %fr4,8(%arg0)
- fstds,ma %fr5,8(%arg0)
- fstds,ma %fr6,8(%arg0)
- fstds,ma %fr7,8(%arg0)
- fstds,ma %fr8,8(%arg0)
- fstds,ma %fr9,8(%arg0)
- fstds,ma %fr10,8(%arg0)
- fstds,ma %fr11,8(%arg0)
- fstds,ma %fr12,8(%arg0)
- fstds,ma %fr13,8(%arg0)
- fstds,ma %fr14,8(%arg0)
- fstds,ma %fr15,8(%arg0)
- fstds,ma %fr16,8(%arg0)
- fstds,ma %fr17,8(%arg0)
- fstds,ma %fr18,8(%arg0)
- fstds,ma %fr19,8(%arg0)
- fstds,ma %fr20,8(%arg0)
- fstds,ma %fr21,8(%arg0)
- fstds,ma %fr22,8(%arg0)
- fstds,ma %fr23,8(%arg0)
- fstds,ma %fr24,8(%arg0)
- fstds,ma %fr25,8(%arg0)
- fstds,ma %fr26,8(%arg0)
- fstds,ma %fr27,8(%arg0)
- fstds,ma %fr28,8(%arg0)
- fstds,ma %fr29,8(%arg0)
- fstds,ma %fr30,8(%arg0)
- fstds %fr31,0(%arg0)
- bv 0(%r2)
- addi -(31*8), %arg0, %arg0 ; restore arg0 just for fun
- .EXIT
- .PROCEND
-
- .align 32
- .EXPORT _CPU_Restore_float_context,ENTRY,PRIV_LEV=0
-_CPU_Restore_float_context:
- .PROC
- .CALLINFO FRAME=0,NO_CALLS
- .ENTRY
- addi (31*8), %arg0, %arg0 ; point at last double
- fldds 0(%arg0),%fr31
- fldds,mb -8(%arg0),%fr30
- fldds,mb -8(%arg0),%fr29
- fldds,mb -8(%arg0),%fr28
- fldds,mb -8(%arg0),%fr27
- fldds,mb -8(%arg0),%fr26
- fldds,mb -8(%arg0),%fr25
- fldds,mb -8(%arg0),%fr24
- fldds,mb -8(%arg0),%fr23
- fldds,mb -8(%arg0),%fr22
- fldds,mb -8(%arg0),%fr21
- fldds,mb -8(%arg0),%fr20
- fldds,mb -8(%arg0),%fr19
- fldds,mb -8(%arg0),%fr18
- fldds,mb -8(%arg0),%fr17
- fldds,mb -8(%arg0),%fr16
- fldds,mb -8(%arg0),%fr15
- fldds,mb -8(%arg0),%fr14
- fldds,mb -8(%arg0),%fr13
- fldds,mb -8(%arg0),%fr12
- fldds,mb -8(%arg0),%fr11
- fldds,mb -8(%arg0),%fr10
- fldds,mb -8(%arg0),%fr9
- fldds,mb -8(%arg0),%fr8
- fldds,mb -8(%arg0),%fr7
- fldds,mb -8(%arg0),%fr6
- fldds,mb -8(%arg0),%fr5
- fldds,mb -8(%arg0),%fr4
- fldds,mb -8(%arg0),%fr3
- fldds,mb -8(%arg0),%fr2
- fldds,mb -8(%arg0),%fr1
- bv 0(%r2)
- fldds,mb -8(%arg0),%fr0
- .EXIT
- .PROCEND
-
-/*
- * These 2 small routines are unused right now.
- * Normally we just go thru _CPU_Save_float_context (and Restore)
- *
- * Here we just deref the ptr and jump up, letting _CPU_Save_float_context
- * do the return for us.
- */
-
- .EXPORT _CPU_Context_save_fp,ENTRY,PRIV_LEV=0
-_CPU_Context_save_fp:
- .PROC
- .CALLINFO FRAME=0,NO_CALLS
- .ENTRY
- bl _CPU_Save_float_context, %r0
- ldw 0(%arg0), %arg0
- .EXIT
- .PROCEND
-
- .EXPORT _CPU_Context_restore_fp,ENTRY,PRIV_LEV=0
-_CPU_Context_restore_fp:
- .PROC
- .CALLINFO FRAME=0,NO_CALLS
- .ENTRY
- bl _CPU_Restore_float_context, %r0
- ldw 0(%arg0), %arg0
- .EXIT
- .PROCEND
-
-
-/*
- * void _CPU_Context_switch( run_context, heir_context )
- *
- * This routine performs a normal non-FP context switch.
- */
-
- .align 32
- .EXPORT _CPU_Context_switch,ENTRY,PRIV_LEV=0,ARGW0=GR,ARGW1=GR
-_CPU_Context_switch:
- .PROC
- .CALLINFO FRAME=64
- .ENTRY
-
-/*
- * Save the integer context
- */
- stw %r1,R1_OFFSET(arg0)
- stw %r2,R2_OFFSET(arg0)
- stw %r3,R3_OFFSET(arg0)
- stw %r4,R4_OFFSET(arg0)
- stw %r5,R5_OFFSET(arg0)
- stw %r6,R6_OFFSET(arg0)
- stw %r7,R7_OFFSET(arg0)
- stw %r8,R8_OFFSET(arg0)
- stw %r9,R9_OFFSET(arg0)
- stw %r10,R10_OFFSET(arg0)
- stw %r11,R11_OFFSET(arg0)
- stw %r12,R12_OFFSET(arg0)
- stw %r13,R13_OFFSET(arg0)
- stw %r14,R14_OFFSET(arg0)
- stw %r15,R15_OFFSET(arg0)
- stw %r16,R16_OFFSET(arg0)
- stw %r17,R17_OFFSET(arg0)
- stw %r18,R18_OFFSET(arg0)
- stw %r19,R19_OFFSET(arg0)
- stw %r20,R20_OFFSET(arg0)
- stw %r21,R21_OFFSET(arg0)
- stw %r22,R22_OFFSET(arg0)
- stw %r23,R23_OFFSET(arg0)
- stw %r24,R24_OFFSET(arg0)
- stw %r25,R25_OFFSET(arg0)
- stw %r26,R26_OFFSET(arg0)
- stw %r27,R27_OFFSET(arg0)
- stw %r28,R28_OFFSET(arg0)
- stw %r29,R29_OFFSET(arg0)
- stw %r30,R30_OFFSET(arg0)
- stw %r31,R31_OFFSET(arg0)
-
-/*
- * fill in interrupt context section
- */
- stw %r2, PCOQFRONT_OFFSET(%arg0)
- ldo 4(%r2), %r2
- stw %r2, PCOQBACK_OFFSET(%arg0)
-
-/*
- * Generate a suitable IPSW by using the system default psw
- * with the current low bits added in.
- */
-
- ldil L%CPU_PSW_DEFAULT, %r2
- ldo R%CPU_PSW_DEFAULT(%r2), %r2
- ssm 0, %arg2
- dep %arg2, 31, 8, %r2
- stw %r2, IPSW_OFFSET(%arg0)
-
-/*
- * at this point, the running task context is completely saved
- * Now jump to the bottom of the interrupt handler to load the
- * heirs context
- */
-
- b _CPU_Context_restore
- copy %arg1, %arg0
-
- .EXIT
- .PROCEND
-
-
-/*
- * Find first bit
- * NOTE:
- * This is used (and written) only for the ready chain code and
- * priority bit maps.
- * Any other use constitutes fraud.
- * Returns first bit from the least significant side.
- * Eg: if input is 0x8001
- * output will indicate the '1' bit and return 0.
- * This is counter to HPPA bit numbering which calls this
- * bit 31. This way simplifies the macros _CPU_Priority_Mask
- * and _CPU_Priority_Bits_index.
- *
- * NOTE:
- * We just use 16 bit version
- * does not handle zero case
- *
- * Based on the UTAH Mach libc version of ffs.
- */
-
- .align 32
- .EXPORT hppa_rtems_ffs,ENTRY,PRIV_LEV=0,ARGW0=GR
-hppa_rtems_ffs:
- .PROC
- .CALLINFO FRAME=0,NO_CALLS
- .ENTRY
-
-#ifdef RETURN_ERROR_ON_ZERO
- comb,= %arg0,%r0,ffsdone ; If arg0 is 0
- ldi -1,%ret0 ; return -1
-#endif
-
-#if BITFIELD_SIZE == 32
- ldi 31,%ret0 ; Set return to high bit
- extru,= %arg0,31,16,%r0 ; If low 16 bits are non-zero
- addi,tr -16,%ret0,%ret0 ; subtract 16 from bitpos
- shd %r0,%arg0,16,%arg0 ; else shift right 16 bits
-#else
- ldi 15,%ret0 ; Set return to high bit
-#endif
- extru,= %arg0,31,8,%r0 ; If low 8 bits are non-zero
- addi,tr -8,%ret0,%ret0 ; subtract 8 from bitpos
- shd %r0,%arg0,8,%arg0 ; else shift right 8 bits
- extru,= %arg0,31,4,%r0 ; If low 4 bits are non-zero
- addi,tr -4,%ret0,%ret0 ; subtract 4 from bitpos
- shd %r0,%arg0,4,%arg0 ; else shift right 4 bits
- extru,= %arg0,31,2,%r0 ; If low 2 bits are non-zero
- addi,tr -2,%ret0,%ret0 ; subtract 2 from bitpos
- shd %r0,%arg0,2,%arg0 ; else shift right 2 bits
- extru,= %arg0,31,1,%r0 ; If low bit is non-zero
- addi -1,%ret0,%ret0 ; subtract 1 from bitpos
-ffsdone:
- bv,n 0(%r2)
- nop
- .EXIT
- .PROCEND
diff --git a/c/src/exec/score/cpu/hppa1.1/hppa.h b/c/src/exec/score/cpu/hppa1.1/hppa.h
deleted file mode 100644
index 049981ea84..0000000000
--- a/c/src/exec/score/cpu/hppa1.1/hppa.h
+++ /dev/null
@@ -1,716 +0,0 @@
-/*
- * Description:
- *
- * Definitions for HP PA Risc
- * ref: PA RISC 1.1 Architecture and Instruction Set Reference Manual
- *
- * COPYRIGHT (c) 1994 by Division Incorporated
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Note:
- * This file is included by both C and assembler code ( -DASM )
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_HPPA_H
-#define _INCLUDE_HPPA_H
-
-#ifdef ASM
-#include <rtems/score/targopts.h>
-#endif
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-/*
- * This section contains the information required to build
- * RTEMS for a particular member of the Hewlett Packard
- * PA-RISC family. It does this by setting variables to
- * indicate which implementation dependent features are
- * present in a particular member of the family.
- */
-
-#if defined(hppa7100)
-
-#define CPU_MODEL_NAME "hppa 7100"
-
-#elif defined(hppa7200)
-
-#define CPU_MODEL_NAME "hppa 7200"
-
-#else
-
-#error "Unsupported CPU Model"
-
-#endif
-
-/*
- * Define the name of the CPU family.
- */
-
-#if !defined(CPU_NAME)
-#define CPU_NAME "HP PA-RISC 1.1"
-#endif
-
-/*
- * Processor Status Word (PSW) Masks
- */
-
-
-#define HPPA_PSW_Y 0x80000000 /* Data Debug Trap Disable */
-#define HPPA_PSW_Z 0x40000000 /* Instruction Debug Trap Disable */
-#define HPPA_PSW_r2 0x20000000 /* reserved */
-#define HPPA_PSW_r3 0x10000000 /* reserved */
-#define HPPA_PSW_r4 0x08000000 /* reserved */
-#define HPPA_PSW_E 0x04000000 /* Little Endian on Memory References */
-#define HPPA_PSW_S 0x02000000 /* Secure Interval Timer */
-#define HPPA_PSW_T 0x01000000 /* Taken Branch Trap Enable */
-#define HPPA_PSW_H 0x00800000 /* Higher-Privilege Transfer Trap Enable*/
-#define HPPA_PSW_L 0x00400000 /* Lower-Privilege Transfer Trap Enable */
-#define HPPA_PSW_N 0x00200000 /* PC Queue Front Instruction Nullified */
-#define HPPA_PSW_X 0x00100000 /* Data Memory Break Disable */
-#define HPPA_PSW_B 0x00080000 /* Taken Branch in Previous Cycle */
-#define HPPA_PSW_C 0x00040000 /* Code Address Translation Enable */
-#define HPPA_PSW_V 0x00020000 /* Divide Step Correction */
-#define HPPA_PSW_M 0x00010000 /* High-Priority Machine Check Disable */
-#define HPPA_PSW_CB 0x0000ff00 /* Carry/Borrow Bits */
-#define HPPA_PSW_r24 0x00000080 /* reserved */
-#define HPPA_PSW_G 0x00000040 /* Debug trap Enable */
-#define HPPA_PSW_F 0x00000020 /* Performance monitor interrupt unmask */
-#define HPPA_PSW_R 0x00000010 /* Recovery Counter Enable */
-#define HPPA_PSW_Q 0x00000008 /* Interruption State Collection Enable */
-#define HPPA_PSW_P 0x00000004 /* Protection ID Validation Enable */
-#define HPPA_PSW_D 0x00000002 /* Data Address Translation Enable */
-#define HPPA_PSW_I 0x00000001 /* External, Power Failure, */
- /* Low-Priority Machine Check */
- /* Interruption Enable */
-
-/*
- * HPPA traps and interrupts
- * basic layout. Note numbers do not denote priority
- *
- * 0-31 basic traps and interrupts defined by HPPA architecture
- * 0-31 32 external interrupts
- * 32-... bsp defined
- */
-
-#define HPPA_TRAP_NON_EXISTENT 0
-/* group 1 */
-#define HPPA_TRAP_HIGH_PRIORITY_MACHINE_CHECK 1
-/* group 2 */
-#define HPPA_TRAP_POWER_FAIL 2
-#define HPPA_TRAP_RECOVERY_COUNTER 3
-#define HPPA_TRAP_EXTERNAL_INTERRUPT 4
-#define HPPA_TRAP_LOW_PRIORITY_MACHINE_CHECK 5
-#define HPPA_TRAP_PERFORMANCE_MONITOR 29
-/* group 3 */
-#define HPPA_TRAP_INSTRUCTION_TLB_MISS 6
-#define HPPA_TRAP_INSTRUCTION_MEMORY_PROTECTION 7
-#define HPPA_TRAP_INSTRUCTION_DEBUG 30
-#define HPPA_TRAP_ILLEGAL_INSTRUCTION 8
-#define HPPA_TRAP_BREAK_INSTRUCTION 9
-#define HPPA_TRAP_PRIVILEGED_OPERATION 10
-#define HPPA_TRAP_PRIVILEGED_REGISTER 11
-#define HPPA_TRAP_OVERFLOW 12
-#define HPPA_TRAP_CONDITIONAL 13
-#define HPPA_TRAP_ASSIST_EXCEPTION 14
-#define HPPA_TRAP_DATA_TLB_MISS 15
-#define HPPA_TRAP_NON_ACCESS_INSTRUCTION_TLB_MISS 16
-#define HPPA_TRAP_NON_ACCESS_DATA_TLB_MISS 17
-#define HPPA_TRAP_DATA_MEMORY_ACCESS_RIGHTS 26
-#define HPPA_TRAP_DATA_MEMORY_PROTECTION_ID 27
-#define HPPA_TRAP_UNALIGNED_DATA_REFERENCE 28
-#define HPPA_TRAP_DATA_MEMORY_PROTECTION 18
-#define HPPA_TRAP_DATA_MEMORY_BREAK 19
-#define HPPA_TRAP_TLB_DIRTY_BIT 20
-#define HPPA_TRAP_PAGE_REFERENCE 21
-#define HPPA_TRAP_DATA_DEBUG 31
-#define HPPA_TRAP_ASSIST_EMULATION 22
-/* group 4 */
-#define HPPA_TRAP_HIGHER_PRIVILEGE_TRANSFER 23
-#define HPPA_TRAP_LOWER_PRIVILEGE_TRANSFER 24
-#define HPPA_TRAP_TAKEN_BRANCH 25
-
-#define HPPA_INTERNAL_TRAPS 32
-
-/* External Interrupts via interrupt 4 */
-
-#define HPPA_INTERRUPT_EXTERNAL_0 0
-#define HPPA_INTERRUPT_EXTERNAL_1 1
-#define HPPA_INTERRUPT_EXTERNAL_2 2
-#define HPPA_INTERRUPT_EXTERNAL_3 3
-#define HPPA_INTERRUPT_EXTERNAL_4 4
-#define HPPA_INTERRUPT_EXTERNAL_5 5
-#define HPPA_INTERRUPT_EXTERNAL_6 6
-#define HPPA_INTERRUPT_EXTERNAL_7 7
-#define HPPA_INTERRUPT_EXTERNAL_8 8
-#define HPPA_INTERRUPT_EXTERNAL_9 9
-#define HPPA_INTERRUPT_EXTERNAL_10 10
-#define HPPA_INTERRUPT_EXTERNAL_11 11
-#define HPPA_INTERRUPT_EXTERNAL_12 12
-#define HPPA_INTERRUPT_EXTERNAL_13 13
-#define HPPA_INTERRUPT_EXTERNAL_14 14
-#define HPPA_INTERRUPT_EXTERNAL_15 15
-#define HPPA_INTERRUPT_EXTERNAL_16 16
-#define HPPA_INTERRUPT_EXTERNAL_17 17
-#define HPPA_INTERRUPT_EXTERNAL_18 18
-#define HPPA_INTERRUPT_EXTERNAL_19 19
-#define HPPA_INTERRUPT_EXTERNAL_20 20
-#define HPPA_INTERRUPT_EXTERNAL_21 21
-#define HPPA_INTERRUPT_EXTERNAL_22 22
-#define HPPA_INTERRUPT_EXTERNAL_23 23
-#define HPPA_INTERRUPT_EXTERNAL_24 24
-#define HPPA_INTERRUPT_EXTERNAL_25 25
-#define HPPA_INTERRUPT_EXTERNAL_26 26
-#define HPPA_INTERRUPT_EXTERNAL_27 27
-#define HPPA_INTERRUPT_EXTERNAL_28 28
-#define HPPA_INTERRUPT_EXTERNAL_29 29
-#define HPPA_INTERRUPT_EXTERNAL_30 30
-#define HPPA_INTERRUPT_EXTERNAL_31 31
-
-#define HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER HPPA_INTERRUPT_EXTERNAL_0
-#define HPPA_EXTERNAL_INTERRUPTS 32
-
-/* BSP defined interrupts begin here */
-
-#define HPPA_INTERRUPT_MAX 32
-
-/*
- * Cache characteristics
- */
-
-#define HPPA_CACHELINE_SIZE 32
-#define HPPA_CACHELINE_MASK (HPPA_CACHELINE_SIZE - 1)
-
-/*
- * page size characteristics
- */
-
-#define HPPA_PAGE_SIZE 4096
-#define HPPA_PAGE_MASK (0xfffff000)
-
-
-/*
- * TLB characteristics
- *
- * Flags and Access Control layout for using TLB protection insertion
- *
- * 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
- * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * |?|?|T|D|B|type |PL1|Pl2|U| access id |?|
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- *
- */
-
-/*
- * Access rights (type + PL1 + PL2)
- */
-#define HPPA_PROT_R 0x00c00000 /* Read Only, no Write, no Execute */
-#define HPPA_PROT_RW 0x01c00000 /* Read & Write Only, no Execute */
-#define HPPA_PROT_RX 0x02c00000 /* Read & Execute Only, no Write */
-#define HPPA_PROT_RWX 0x03c00000 /* Read, Write, Execute */
-#define HPPA_PROT_X0 0x04c00000 /* Execute Only, Promote to Level 0 */
-#define HPPA_PROT_X1 0x05c00000 /* Execute Only, Promote to Level 1 */
-#define HPPA_PROT_X2 0x06c00000 /* Execute Only, Promote to Level 2 */
-#define HPPA_PROT_X3 0x07c00000 /* Execute Only, Promote to Level 3 */
-
-/*
- * Floating point status register definitions
- */
-
-#define HPPA_FPSTATUS_ENABLE_I 0x00000001 /* inexact operation */
-#define HPPA_FPSTATUS_ENABLE_U 0x00000002 /* underflow */
-#define HPPA_FPSTATUS_ENABLE_O 0x00000004 /* overflow */
-#define HPPA_FPSTATUS_ENABLE_Z 0x00000008 /* division by zero */
-#define HPPA_FPSTATUS_ENABLE_V 0x00000010 /* invalid operation */
-#define HPPA_FPSTATUS_D 0x00000020 /* denormalize as zero */
-#define HPPA_FPSTATUS_T 0x00000040 /* delayed trap */
-#define HPPA_FPSTATUS_RM_MASK 0x00000600 /* rounding mode */
-#define HPPA_FPSTATUS_RM_SHIFT 9
-#define HPPA_FPSTATUS_CQ_MASK 0x001FFC00 /* compare queue */
-#define HPPA_FPSTATUS_CQ_SHIFT 13
-#define HPPA_FPSTATUS_C 0x04000000 /* most recent ompare bit */
-#define HPPA_FPSTATUS_FLAG_I 0x08000000 /* inexact */
-#define HPPA_FPSTATUS_FLAG_U 0x10000000 /* underflow */
-#define HPPA_FPSTATUS_FLAG_O 0x20000000 /* overflow */
-#define HPPA_FPSTATUS_FLAG_Z 0x40000000 /* division by zero */
-#define HPPA_FPSTATUS_FLAG_V 0x80000000 /* invalid operation */
-
-
-/*
- * Inline macros for misc. interesting opcodes
- */
-
-/* generate a global label */
-#define HPPA_ASM_LABEL(label) \
- asm(".export " label ", ! .label " label);
-
-/* Return From Interrupt RFI */
-#define HPPA_ASM_RFI() asm volatile ("rfi")
-
-/* Set System Mask SSM i,t */
-#define HPPA_ASM_SSM(i,gr) asm volatile ("ssm %1, %0" \
- : "=r" (gr) \
- : "i" (i))
-/* Reset System Mask RSM i,t */
-#define HPPA_ASM_RSM(i,gr) asm volatile ("rsm %1, %0" \
- : "=r" (gr) \
- : "i" (i))
-/* Move To System Mask MTSM r */
-#define HPPA_ASM_MTSM(gr) asm volatile ("mtsm %0" \
- : : "r" (gr))
-
-/* Load Space Identifier LDSID (s,b),t */
-#define HPPA_ASM_LDSID(sr,grb,grt) asm volatile ("ldsid (%1,%2),%0" \
- : "=r" (grt) \
- : "i" (sr), \
- "r" (grb))
-
-/*
- * Gcc extended asm doesn't really allow for treatment of space registers
- * as "registers", so we have to use "i" format.
- * Unfortunately this means that the "=" constraint is not available.
- */
-
-/* Move To Space Register MTSP r,sr */
-#define HPPA_ASM_MTSP(gr,sr) asm volatile ("mtsp %1,%0" \
- : : "i" (sr), \
- "r" (gr))
-
-/* Move From Space Register MFSP sr,t */
-#define HPPA_ASM_MFSP(sr,gr) asm volatile ("mfsp %1,%0" \
- : "=r" (gr) \
- : "i" (sr))
-
-/* Move To Control register MTCTL r,t */
-#define HPPA_ASM_MTCTL(gr,cr) asm volatile ("mtctl %1,%0" \
- : : "i" (cr), \
- "r" (gr))
-
-/* Move From Control register MFCTL r,t */
-#define HPPA_ASM_MFCTL(cr,gr) asm volatile ("mfctl %1,%0" \
- : "=r" (gr) \
- : "i" (cr))
-
-/* Synchronize caches SYNC */
-#define HPPA_ASM_SYNC() asm volatile ("sync")
-
-/* Probe Read Access PROBER (s,b),r,t */
-#define HPPA_ASM_PROBER(sr,groff,gracc,grt) \
- asm volatile ("prober (%1,%2),%3,%0" \
- : "=r" (grt) \
- : "i" (sr), \
- "r" (groff), \
- "r" (gracc))
-
-/* Probe Read Access Immediate PROBERI (s,b),i,t*/
-#define HPPA_ASM_PROBERI(sr,groff,iacc,grt) \
- asm volatile ("proberi (%1,%2),%3,%0" \
- : "=r" (grt) \
- : "i" (sr), \
- "r" (groff), \
- "i" (iacc))
-
-/* Probe Write Access PROBEW (s,b),r,t */
-#define HPPA_ASM_PROBEW(sr,groff,gracc,grt) \
- asm volatile ("probew (%1,%2),%3,%0" \
- : "=r" (grt) \
- : "i" (sr), \
- "r" (groff), \
- "r" (gracc))
-
-/* Probe Write Access Immediate PROBEWI (s,b),i,t */
-#define HPPA_ASM_PROBEWI(sr,groff,iacc,grt) \
- asm volatile ("probewi (%1,%2),%3,%0" \
- : "=r" (grt) \
- : "i" (sr), \
- "r" (groff), \
- "i" (iacc))
-
-/* Load Physical Address LPA x(s,b),t */
-#define HPPA_ASM_LPA(sr,grb,grt) asm volatile ("lpa %%r0(%1,%2),%0" \
- : "=r" (grt) \
- : "i" (sr), \
- "r" (grb))
-
-/* Load Coherence Index LCI x(s,b),t */
-/* AKA: Load Hash Address LHA x(s,b),t */
-#define HPPA_ASM_LCI(grx,sr,grb,grt) asm volatile ("lha %1(%2,%3),%0" \
- : "=r" (grt) \
- : "r" (grx),\
- "i" (sr), \
- "r" (grb))
-#define HPPA_ASM_LHA(grx,sr,grb,grt) HPPA_ASM_LCI(grx,sr,grb,grt)
-
-/* Purge Data Tlb PDTLB x(s,b) */
-#define HPPA_ASM_PDTLB(grx,sr,grb) asm volatile ("pdtlb %0(%1,%2)" \
- : : "r" (grx), \
- "i" (sr), \
- "r" (grb))
-
-/* Purge Instruction Tlb PITLB x(s,b) */
-#define HPPA_ASM_PITLB(grx,sr,grb) asm volatile ("pitlb %0(%1,%2)" \
- : : "r" (grx), \
- "i" (sr), \
- "r" (grb))
-
-/* Purge Data Tlb Entry PDTLBE x(s,b) */
-#define HPPA_ASM_PDTLBE(grx,sr,grb) asm volatile ("pdtlbe %0(%1,%2)" \
- : : "r" (grx), \
- "i" (sr), \
- "r" (grb))
-
-/* Purge Instruction Tlb Entry PITLBE x(s,b) */
-#define HPPA_ASM_PITLBE(grx,sr,grb) asm volatile ("pitlbe %0(%1,%2)" \
- : : "r" (grx), \
- "i" (sr), \
- "r" (grb))
-
-
-/* Insert Data TLB Address IDTLBA r,(s,b) */
-#define HPPA_ASM_IDTLBA(gr,sr,grb) asm volatile ("idtlba %0,(%1,%2)" \
- : : "r" (gr), \
- "i" (sr), \
- "r" (grb))
-
-/* Insert Instruction TLB Address IITLBA r,(s,b) */
-#define HPPA_ASM_IITLBA(gr,sr,grb) asm volatile ("iitlba %0,(%1,%2)" \
- : : "r" (gr), \
- "i" (sr), \
- "r" (grb))
-
-/* Insert Data TLB Protection IDTLBP r,(s,b) */
-#define HPPA_ASM_IDTLBP(gr,sr,grb) asm volatile ("idtlbp %0,(%1,%2)" \
- : : "r" (gr), \
- "i" (sr), \
- "r" (grb))
-
-/* Insert Instruction TLB Protection IITLBP r,(s,b) */
-#define HPPA_ASM_IITLBP(gr,sr,grb) asm volatile ("iitlbp %0,(%1,%2)" \
- : : "r" (gr), \
- "i" (sr), \
- "r" (grb))
-
-/* Purge Data Cache PDC x(s,b) */
-#define HPPA_ASM_PDC(grx,sr,grb) asm volatile ("pdc %0(%1,%2)" \
- : : "r" (grx), \
- "i" (sr), \
- "r" (grb))
-
-/* Flush Data Cache FDC x(s,b) */
-#define HPPA_ASM_FDC(grx,sr,grb) asm volatile ("fdc %0(%1,%2)" \
- : : "r" (grx), \
- "i" (sr), \
- "r" (grb))
-
-/* Flush Instruction Cache FDC x(s,b) */
-#define HPPA_ASM_FIC(grx,sr,grb) asm volatile ("fic %0(%1,%2)" \
- : : "r" (grx), \
- "i" (sr), \
- "r" (grb))
-
-/* Flush Data Cache Entry FDCE x(s,b) */
-#define HPPA_ASM_FDCE(grx,sr,grb) asm volatile ("fdce %0(%1,%2)" \
- : : "r" (grx), \
- "i" (sr), \
- "r" (grb))
-
-/* Flush Instruction Cache Entry FICE x(s,b) */
-#define HPPA_ASM_FICE(grx,sr,grb) asm volatile ("fice %0(%1,%2)" \
- : : "r" (grx), \
- "i" (sr), \
- "r" (grb))
-
-/* Break BREAK i5,i13 */
-#define HPPA_ASM_BREAK(i5,i13) asm volatile ("break %0,%1" \
- : : "i" (i5), \
- "i" (i13))
-
-/* Load and Clear Word Short LDCWS d(s,b),t */
-#define HPPA_ASM_LDCWS(i,sr,grb,grt) asm volatile ("ldcws %1(%2,%3),%0" \
- : "=r" (grt) \
- : "i" (i), \
- "i" (sr), \
- "r" (grb))
-
-/* Load and Clear Word Indexed LDCWX x(s,b),t */
-#define HPPA_ASM_LDCWX(grx,sr,grb,grt) asm volatile ("ldcwx %1(%2,%3),%0" \
- : "=r" (grt) \
- : "r" (grx), \
- "i" (sr), \
- "r" (grb))
-
-/* Load Word Absolute Short LDWAS d(b),t */
-/* NOTE: "short" here means "short displacement" */
-#define HPPA_ASM_LDWAS(disp,grbase,gr) asm volatile("ldwas %1(%2),%0" \
- : "=r" (gr) \
- : "i" (disp), \
- "r" (grbase))
-
-/* Store Word Absolute Short STWAS r,d(b) */
-/* NOTE: "short" here means "short displacement" */
-#define HPPA_ASM_STWAS(gr,disp,grbase) asm volatile("stwas %0,%1(%2)" \
- : : "r" (gr), \
- "i" (disp), \
- "r" (grbase))
-
-/*
- * Swap bytes
- * REFERENCE: PA72000 TRM -- Appendix C
- */
-#define HPPA_ASM_SWAPBYTES(value, swapped) asm volatile( \
- " shd %1,%1,16,%0 \n\
- dep %0,15,8,%0 \n\
- shd %1,%0,8,%0" \
- : "=r" (swapped) \
- : "r" (value) \
- )
-
-
-/* 72000 Diagnose instructions follow
- * These macros assume gas knows about these instructions.
- * gas2.2.u1 did not.
- * I added them to my copy and installed it locally.
- *
- * There are *very* special requirements for these guys
- * ref: TRM 6.1.3 Programming Constraints
- *
- * The macros below handle the following rules
- *
- * Except for WIT, WDT, WDD, WIDO, WIDE, all DIAGNOSE must be doubled.
- * Must never be nullified (hence the leading nop)
- * NOP must preced every RDD,RDT,WDD,WDT,RDTLB
- * Instruction preceeding GR_SHDW must not set any of the GR's saved
- *
- * The macros do *NOT* deal with the following problems
- * doubled DIAGNOSE instructions must not straddle a page boundary
- * if code translation enabled. (since 2nd could trap on ITLB)
- * If you care about DHIT and DPE bits of DR0, then
- * No store instruction in the 2 insn window before RDD
- */
-
-
-/* Move To CPU/DIAG register MTCPU r,t */
-#define HPPA_ASM_MTCPU(gr,dr) asm volatile (" nop \n" \
- " mtcpu %1,%0 \n" \
- " mtcpu %1,%0" \
- : : "i" (dr), \
- "r" (gr))
-
-/* Move From CPU/DIAG register MFCPU r,t */
-#define HPPA_ASM_MFCPU(dr,gr) asm volatile (" nop \n" \
- " mfcpu %1,%0\n" \
- " mfcpu %1,%0" \
- : "=r" (gr) \
- : "i" (dr))
-
-/* Transfer of Control Enable TOC_EN */
-#define HPPA_ASM_TOC_EN() asm volatile (" tocen \n" \
- " tocen")
-
-/* Transfer of Control Disable TOC_DIS */
-#define HPPA_ASM_TOC_DIS() asm volatile (" tocdis \n" \
- " tocdis")
-
-/* Shadow Registers to General Register SHDW_GR */
-#define HPPA_ASM_SHDW_GR() asm volatile (" shdwgr \n" \
- " shdwgr" \
- ::: "r1" "r8" "r9" "r16" \
- "r17" "r24" "r25")
-
-/* General Registers to Shadow Register GR_SHDW */
-#define HPPA_ASM_GR_SHDW() asm volatile (" nop \n" \
- " grshdw \n" \
- " grshdw")
-
-/*
- * Definitions of special registers for use by the above macros.
- */
-
-/* Hardware Space Registers */
-#define HPPA_SR0 0
-#define HPPA_SR1 1
-#define HPPA_SR2 2
-#define HPPA_SR3 3
-#define HPPA_SR4 4
-#define HPPA_SR5 5
-#define HPPA_SR6 6
-#define HPPA_SR7 7
-
-/* Hardware Control Registers */
-#define HPPA_CR0 0
-#define HPPA_RCTR 0 /* Recovery Counter Register */
-
-#define HPPA_CR8 8 /* Protection ID 1 */
-#define HPPA_PIDR1 8
-
-#define HPPA_CR9 9 /* Protection ID 2 */
-#define HPPA_PIDR2 9
-
-#define HPPA_CR10 10
-#define HPPA_CCR 10 /* Coprocessor Confiquration Register */
-
-#define HPPA_CR11 11
-#define HPPA_SAR 11 /* Shift Amount Register */
-
-#define HPPA_CR12 12
-#define HPPA_PIDR3 12 /* Protection ID 3 */
-
-#define HPPA_CR13 13
-#define HPPA_PIDR4 13 /* Protection ID 4 */
-
-#define HPPA_CR14 14
-#define HPPA_IVA 14 /* Interrupt Vector Address */
-
-#define HPPA_CR15 15
-#define HPPA_EIEM 15 /* External Interrupt Enable Mask */
-
-#define HPPA_CR16 16
-#define HPPA_ITMR 16 /* Interval Timer */
-
-#define HPPA_CR17 17
-#define HPPA_PCSQ 17 /* Program Counter Space queue */
-
-#define HPPA_CR18 18
-#define HPPA_PCOQ 18 /* Program Counter Offset queue */
-
-#define HPPA_CR19 19
-#define HPPA_IIR 19 /* Interruption Instruction Register */
-
-#define HPPA_CR20 20
-#define HPPA_ISR 20 /* Interruption Space Register */
-
-#define HPPA_CR21 21
-#define HPPA_IOR 21 /* Interruption Offset Register */
-
-#define HPPA_CR22 22
-#define HPPA_IPSW 22 /* Interrpution Processor Status Word */
-
-#define HPPA_CR23 23
-#define HPPA_EIRR 23 /* External Interrupt Request */
-
-#define HPPA_CR24 24
-#define HPPA_PPDA 24 /* Physcial Page Directory Address */
-#define HPPA_TR0 24 /* Temporary register 0 */
-
-#define HPPA_CR25 25
-#define HPPA_HTA 25 /* Hash Table Address */
-#define HPPA_TR1 25 /* Temporary register 1 */
-
-#define HPPA_CR26 26
-#define HPPA_TR2 26 /* Temporary register 2 */
-
-#define HPPA_CR27 27
-#define HPPA_TR3 27 /* Temporary register 3 */
-
-#define HPPA_CR28 28
-#define HPPA_TR4 28 /* Temporary register 4 */
-
-#define HPPA_CR29 29
-#define HPPA_TR5 29 /* Temporary register 5 */
-
-#define HPPA_CR30 30
-#define HPPA_TR6 30 /* Temporary register 6 */
-
-#define HPPA_CR31 31
-#define HPPA_CPUID 31 /* MP identifier */
-
-/*
- * Diagnose registers
- */
-
-#define HPPA_DR0 0
-#define HPPA_DR1 1
-#define HPPA_DR8 8
-#define HPPA_DR24 24
-#define HPPA_DR25 25
-
-/*
- * Tear apart a break instruction to find its type.
- */
-#define HPPA_BREAK5(x) ((x) & 0x1F)
-#define HPPA_BREAK13(x) (((x) >> 13) & 0x1FFF)
-
-/* assemble a break instruction */
-#define HPPA_BREAK(i5,i13) (((i5) & 0x1F) | (((i13) & 0x1FFF) << 13))
-
-
-/*
- * this won't work in ASM or non-GNU compilers
- */
-
-#if !defined(ASM) && defined(__GNUC__)
-
-/*
- * static inline utility functions to get at control registers
- */
-
-#define EMIT_GET_CONTROL(name, reg) \
-static __inline__ unsigned int \
-get_ ## name (void) \
-{ \
- unsigned int value; \
- HPPA_ASM_MFCTL(reg, value); \
- return value; \
-}
-
-#define EMIT_SET_CONTROL(name, reg) \
-static __inline__ void \
-set_ ## name (unsigned int new_value) \
-{ \
- HPPA_ASM_MTCTL(new_value, reg); \
-}
-
-#define EMIT_CONTROLS(name, reg) \
- EMIT_GET_CONTROL(name, reg) \
- EMIT_SET_CONTROL(name, reg)
-
-EMIT_CONTROLS(recovery, HPPA_RCTR); /* CR0 */
-EMIT_CONTROLS(pid1, HPPA_PIDR1); /* CR8 */
-EMIT_CONTROLS(pid2, HPPA_PIDR2); /* CR9 */
-EMIT_CONTROLS(ccr, HPPA_CCR); /* CR10; CCR and SCR share CR10 */
-EMIT_CONTROLS(scr, HPPA_CCR); /* CR10; CCR and SCR share CR10 */
-EMIT_CONTROLS(sar, HPPA_SAR); /* CR11 */
-EMIT_CONTROLS(pid3, HPPA_PIDR3); /* CR12 */
-EMIT_CONTROLS(pid4, HPPA_PIDR4); /* CR13 */
-EMIT_CONTROLS(iva, HPPA_IVA); /* CR14 */
-EMIT_CONTROLS(eiem, HPPA_EIEM); /* CR15 */
-EMIT_CONTROLS(itimer, HPPA_ITMR); /* CR16 */
-EMIT_CONTROLS(pcsq, HPPA_PCSQ); /* CR17 */
-EMIT_CONTROLS(pcoq, HPPA_PCOQ); /* CR18 */
-EMIT_CONTROLS(iir, HPPA_IIR); /* CR19 */
-EMIT_CONTROLS(isr, HPPA_ISR); /* CR20 */
-EMIT_CONTROLS(ior, HPPA_IOR); /* CR21 */
-EMIT_CONTROLS(ipsw, HPPA_IPSW); /* CR22 */
-EMIT_CONTROLS(eirr, HPPA_EIRR); /* CR23 */
-EMIT_CONTROLS(tr0, HPPA_TR0); /* CR24 */
-EMIT_CONTROLS(tr1, HPPA_TR1); /* CR25 */
-EMIT_CONTROLS(tr2, HPPA_TR2); /* CR26 */
-EMIT_CONTROLS(tr3, HPPA_TR3); /* CR27 */
-EMIT_CONTROLS(tr4, HPPA_TR4); /* CR28 */
-EMIT_CONTROLS(tr5, HPPA_TR5); /* CR29 */
-EMIT_CONTROLS(tr6, HPPA_TR6); /* CR30 */
-EMIT_CONTROLS(tr7, HPPA_CR31); /* CR31 */
-
-#endif /* ASM and GNU */
-
-/*
- * If and How to invoke the debugger (a ROM debugger generally)
- */
-#define CPU_INVOKE_DEBUGGER \
- do { \
- HPPA_ASM_BREAK(1,1); \
- } while (0)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! _INCLUDE_HPPA_H */
-
diff --git a/c/src/exec/score/cpu/hppa1.1/hppatypes.h b/c/src/exec/score/cpu/hppa1.1/hppatypes.h
deleted file mode 100644
index 512323819b..0000000000
--- a/c/src/exec/score/cpu/hppa1.1/hppatypes.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* hppatypes.h
- *
- * This include file contains type definitions pertaining to the Hewlett
- * Packard PA-RISC processor family.
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_HPPATYPES_H
-#define _INCLUDE_HPPATYPES_H
-
-#ifndef ASM
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* 8-bit unsigned integer */
-typedef unsigned short unsigned16; /* 16-bit unsigned integer */
-typedef unsigned int unsigned32; /* 32-bit unsigned integer */
-typedef unsigned long long unsigned64; /* 64-bit unsigned integer */
-
-typedef unsigned16 Priority_Bit_map_control;
-
-typedef signed char signed8; /* 8-bit signed integer */
-typedef signed short signed16; /* 16-bit signed integer */
-typedef signed int signed32; /* 32-bit signed integer */
-typedef signed long long signed64; /* 64 bit signed integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !ASM */
-
-#endif /* _INCLUDE_HPPATYPES_H */
-/* end of include file */
diff --git a/c/src/exec/score/cpu/hppa1.1/rtems.s b/c/src/exec/score/cpu/hppa1.1/rtems.s
deleted file mode 100644
index 3f02c9d006..0000000000
--- a/c/src/exec/score/cpu/hppa1.1/rtems.s
+++ /dev/null
@@ -1,53 +0,0 @@
-/* rtems.S
- *
- * This file contains the single entry point code for
- * the HPPA implementation of RTEMS.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/score/hppa.h>
-#include <rtems/score/cpu_asm.h>
-
- .SPACE $PRIVATE$
- .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
- .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
- .SPACE $TEXT$
- .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
- .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
- .SPACE $TEXT$
- .SUBSPA $CODE$
-
- .align 32
- .EXPORT cpu_jump_to_directive,ENTRY,PRIV_LEV=0
-cpu_jump_to_directive
- .PROC
- .CALLINFO FRAME=0,NO_CALLS
- .ENTRY
-
-# invoke user interrupt handler
-
-# XXX: look at register usage and code
-# XXX: this is not necessarily right!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-# r9 = directive number
-
- .import _Entry_points,data
- ldil L%_Entry_points,%r8
- ldo R%_Entry_points(%r8),%r8
- ldwx,s %r9(%r8),%r8
-
- .call ARGW0=GR
- bv,n 0(%r8)
- nop
-
- .EXIT
- .PROCEND
-
diff --git a/c/src/exec/score/cpu/i386/Makefile.in b/c/src/exec/score/cpu/i386/Makefile.in
deleted file mode 100644
index af64e214dd..0000000000
--- a/c/src/exec/score/cpu/i386/Makefile.in
+++ /dev/null
@@ -1,81 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-RELS=$(ARCH)/rtems-cpu.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=cpu
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/cpu.h $(srcdir)/i386.h $(srcdir)/i386types.h
-
-# H_FILES that get installed externally
-# i386.h is handled specially
-EXTERNAL_H_FILES = $(srcdir)/asm.h
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=cpu_asm rtems
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) $(EXTERNAL_H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(ARCH)/rtems-cpu.rel: $(OBJS)
- $(make-rel)
-
-all: ${ARCH} $(SRCS) preinstall $(OBJS) $(RELS)
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-install: all
-
-preinstall: $(ARCH) \
- $(PROJECT_INCLUDE)/rtems/score/targopts.h \
- ${PROJECT_RELEASE}/lib/bsp_specs
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
-# we will share the basic cpu file
- $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
-
-$(PROJECT_INCLUDE)/rtems/score/targopts.h: $(ARCH)/targopts.h-tmp
- $(INSTALL) -m 444 $(ARCH)/targopts.h-tmp $@
-
-# $(ARCH)/targopts.h-tmp rule is in leaf.cfg
-
-${PROJECT_RELEASE}/lib/bsp_specs: $(ARCH)/bsp_specs.tmp
- $(INSTALL) -m 444 $(ARCH)/bsp_specs.tmp $@
-
-# $(ARCH)/bsp_specs.tmp rule is in leaf.cfg
diff --git a/c/src/exec/score/cpu/i386/asm.h b/c/src/exec/score/cpu/i386/asm.h
deleted file mode 100644
index 9fe867c04c..0000000000
--- a/c/src/exec/score/cpu/i386/asm.h
+++ /dev/null
@@ -1,151 +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 <rtems/score/targopts.h>
-#include <rtems/score/i386.h>
-
-/*
- * 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.
- */
-
-/*
- * Go32 suffers the same bug as __REGISTER_PREFIX__
- */
-
-#if __GO32__
-#undef __USER_LABEL_PREFIX__
-#define __USER_LABEL_PREFIX__ _
-#endif
-
-#ifndef __USER_LABEL_PREFIX__
-#define __USER_LABEL_PREFIX__ _
-#endif
-
-/*
- * 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/c/src/exec/score/cpu/i386/cpu.c b/c/src/exec/score/cpu/i386/cpu.c
deleted file mode 100644
index 90473bdb14..0000000000
--- a/c/src/exec/score/cpu/i386/cpu.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Intel i386 Dependent Source
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <bspIo.h>
-#include <rtems/score/thread.h>
-
-
-/* _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 */
-)
-{
- register unsigned16 fp_status asm ("ax");
- register void *fp_context;
-
- _CPU_Table = *cpu_table;
-
- /*
- * The following code saves a NULL i387 context which is given
- * to each task at start and restart time. The following code
- * is based upon that provided in the i386 Programmer's
- * Manual and should work on any coprocessor greater than
- * the i80287.
- *
- * NOTE: The NO RTEMS_WAIT form of the coprocessor instructions
- * MUST be used in case there is not a coprocessor
- * to wait for.
- */
-
- fp_status = 0xa5a5;
- asm volatile( "fninit" );
- asm volatile( "fnstsw %0" : "=a" (fp_status) : "0" (fp_status) );
-
- if ( fp_status == 0 ) {
-
- fp_context = &_CPU_Null_fp_context;
-
- asm volatile( "fsave (%0)" : "=r" (fp_context)
- : "0" (fp_context)
- );
- }
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- unsigned32 level;
-
- i386_get_interrupt_level( level );
-
- return level;
-}
-
-void _CPU_Thread_Idle_body ()
-{
- while(1){
- asm volatile ("hlt");
- }
-}
-
-void _defaultExcHandler (CPU_Exception_frame *ctx)
-{
- printk("----------------------------------------------------------\n");
- printk("Exception %d caught at PC %x by thread %d\n",
- ctx->idtIndex,
- ctx->eip,
- _Thread_Executing->Object.id);
- printk("----------------------------------------------------------\n");
- printk("Processor execution context at time of the fault was :\n");
- printk("----------------------------------------------------------\n");
- printk(" EAX = %x EBX = %x ECX = %x EDX = %x\n",
- ctx->eax, ctx->ebx, ctx->ecx, ctx->edx);
- printk(" ESI = %x EDI = %x EBP = %x ESP = %x\n",
- ctx->esi, ctx->edi, ctx->ebp, ctx->esp0);
- printk("----------------------------------------------------------\n");
- printk("Error code pushed by processor itself (if not 0) = %x\n",
- ctx->faultCode);
- printk("----------------------------------------------------------\n\n");
- if (_ISR_Nest_level > 0) {
- /*
- * In this case we shall not delete the task interrupted as
- * it has nothing to do with the fault. We cannot return either
- * because the eip points to the faulty instruction so...
- */
- printk("Exception while executing ISR!!!. System locked\n");
- while(1);
- }
- else {
- /*
- * OK I could probably use a simplified version but at least this
- * should work.
- */
- printk(" ************ FAULTY THREAD WILL BE DELETED **************\n");
- rtems_task_delete(_Thread_Executing->Object.id);
- }
-}
-
-cpuExcHandlerType _currentExcHandler = _defaultExcHandler;
-
-extern void rtems_exception_prologue_0();
-extern void rtems_exception_prologue_1();
-extern void rtems_exception_prologue_2();
-extern void rtems_exception_prologue_3();
-extern void rtems_exception_prologue_4();
-extern void rtems_exception_prologue_5();
-extern void rtems_exception_prologue_6();
-extern void rtems_exception_prologue_7();
-extern void rtems_exception_prologue_8();
-extern void rtems_exception_prologue_9();
-extern void rtems_exception_prologue_10();
-extern void rtems_exception_prologue_11();
-extern void rtems_exception_prologue_12();
-extern void rtems_exception_prologue_13();
-extern void rtems_exception_prologue_14();
-extern void rtems_exception_prologue_16();
-extern void rtems_exception_prologue_17();
-extern void rtems_exception_prologue_18();
-
-static rtems_raw_irq_hdl tbl[] = {
- rtems_exception_prologue_0,
- rtems_exception_prologue_1,
- rtems_exception_prologue_2,
- rtems_exception_prologue_3,
- rtems_exception_prologue_4,
- rtems_exception_prologue_5,
- rtems_exception_prologue_6,
- rtems_exception_prologue_7,
- rtems_exception_prologue_8,
- rtems_exception_prologue_9,
- rtems_exception_prologue_10,
- rtems_exception_prologue_11,
- rtems_exception_prologue_12,
- rtems_exception_prologue_13,
- rtems_exception_prologue_14,
- rtems_exception_prologue_16,
- rtems_exception_prologue_17,
- rtems_exception_prologue_18,
-};
-
-void rtems_exception_init_mngt()
-{
- unsigned int i,j;
- interrupt_gate_descriptor *currentIdtEntry;
- unsigned limit;
- unsigned level;
-
- i = sizeof(tbl) / sizeof (rtems_raw_irq_hdl);
-
- i386_get_info_from_IDTR (&currentIdtEntry, &limit);
-
- _CPU_ISR_Disable(level);
- for (j = 0; j < i; j++) {
- create_interrupt_gate_descriptor (&currentIdtEntry[j], tbl[j]);
- }
- _CPU_ISR_Enable(level);
-}
-
diff --git a/c/src/exec/score/cpu/i386/cpu.h b/c/src/exec/score/cpu/i386/cpu.h
deleted file mode 100644
index 28d450dad6..0000000000
--- a/c/src/exec/score/cpu/i386/cpu.h
+++ /dev/null
@@ -1,485 +0,0 @@
-/* cpu.h
- *
- * This include file contains information pertaining to the Intel
- * i386 processor.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_h
-#define __CPU_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/i386.h> /* pick up machine definitions */
-#include <libcpu/cpu.h>
-
-#ifndef ASM
-#include <rtems/score/i386types.h>
-#endif
-
-/* conditional compilation parameters */
-
-#define CPU_INLINE_ENABLE_DISPATCH TRUE
-#define CPU_UNROLL_ENQUEUE_PRIORITY FALSE
-
-/*
- * i386 has an RTEMS allocated and managed interrupt stack.
- */
-
-#define CPU_HAS_SOFTWARE_INTERRUPT_STACK TRUE
-#define CPU_HAS_HARDWARE_INTERRUPT_STACK FALSE
-#define CPU_ALLOCATE_INTERRUPT_STACK TRUE
-
-/*
- * Does the RTEMS invoke the user's ISR with the vector number and
- * a pointer to the saved interrupt frame (1) or just the vector
- * number (0)?
- */
-
-#define CPU_ISR_PASSES_FRAME_POINTER 0
-
-/*
- * Some family members have no FP, some have an FPU such as the i387
- * for the i386, others have it built in (i486DX, Pentium).
- */
-
-#if ( I386_HAS_FPU == 1 )
-#define CPU_HARDWARE_FP TRUE /* i387 for i386 */
-#else
-#define CPU_HARDWARE_FP FALSE
-#endif
-
-#define CPU_ALL_TASKS_ARE_FP FALSE
-#define CPU_IDLE_TASK_IS_FP FALSE
-#define CPU_USE_DEFERRED_FP_SWITCH TRUE
-
-#define CPU_STACK_GROWS_UP FALSE
-#define CPU_STRUCTURE_ALIGNMENT
-
-/*
- * Does this port provide a CPU dependent IDLE task implementation?
- *
- * If TRUE, then the routine _CPU_Thread_Idle_body
- * must be provided and is the default IDLE thread body instead of
- * _CPU_Thread_Idle_body.
- *
- * If FALSE, then use the generic IDLE thread body if the BSP does
- * not provide one.
- */
-
-#define CPU_PROVIDES_IDLE_THREAD_BODY TRUE
-
-/*
- * Define what is required to specify how the network to host conversion
- * routines are handled.
- */
-
-#define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE
-#define CPU_BIG_ENDIAN FALSE
-#define CPU_LITTLE_ENDIAN TRUE
-
-/* structures */
-
-/*
- * Basic integer context for the i386 family.
- */
-
-typedef struct {
- unsigned32 eflags; /* extended flags register */
- void *esp; /* extended stack pointer register */
- void *ebp; /* extended base pointer register */
- unsigned32 ebx; /* extended bx register */
- unsigned32 esi; /* extended source index register */
- unsigned32 edi; /* extended destination index flags register */
-} Context_Control;
-
-/*
- * FP context save area for the i387 numeric coprocessors.
- */
-
-typedef struct {
- unsigned8 fp_save_area[108]; /* context size area for I80387 */
- /* 28 bytes for environment */
-} Context_Control_fp;
-
-
-/*
- * The following structure defines the set of information saved
- * on the current stack by RTEMS upon receipt of execptions.
- *
- * idtIndex is either the interrupt number or the trap/exception number.
- * faultCode is the code pushed by the processor on some exceptions.
- */
-
-typedef struct {
- unsigned32 edi;
- unsigned32 esi;
- unsigned32 ebp;
- unsigned32 esp0;
- unsigned32 ebx;
- unsigned32 edx;
- unsigned32 ecx;
- unsigned32 eax;
- unsigned32 idtIndex;
- unsigned32 faultCode;
- unsigned32 eip;
- unsigned32 cs;
- unsigned32 eflags;
-} CPU_Exception_frame;
-
-typedef void (*cpuExcHandlerType) (CPU_Exception_frame*);
-extern cpuExcHandlerType _currentExcHandler;
-extern void rtems_exception_init_mngt();
-
-/*
- * The following structure defines the set of information saved
- * on the current stack by RTEMS upon receipt of each interrupt
- * that will lead to re-enter the kernel to signal the thread.
- */
-
-typedef CPU_Exception_frame CPU_Interrupt_frame;
-
-typedef enum {
- DIVIDE_BY_ZERO = 0,
- DEBUG = 1,
- NMI = 2,
- BREAKPOINT = 3,
- OVERFLOW = 4,
- BOUND = 5,
- ILLEGAL_INSTR = 6,
- MATH_COPROC_UNAVAIL = 7,
- DOUBLE_FAULT = 8,
- I386_COPROC_SEG_ERR = 9,
- INVALID_TSS = 10,
- SEGMENT_NOT_PRESENT = 11,
- STACK_SEGMENT_FAULT = 12,
- GENERAL_PROT_ERR = 13,
- PAGE_FAULT = 14,
- INTEL_RES15 = 15,
- FLOAT_ERROR = 16,
- ALIGN_CHECK = 17,
- MACHINE_CHECK = 18
-} Intel_symbolic_exception_name;
-
-
-/*
- * The following table contains the information required to configure
- * the i386 specific parameters.
- */
-
-typedef struct {
- void (*pretasking_hook)( void );
- void (*predriver_hook)( void );
- void (*postdriver_hook)( void );
- void (*idle_task)( void );
- boolean do_zero_of_workspace;
- unsigned32 idle_task_stack_size;
- unsigned32 interrupt_stack_size;
- unsigned32 extra_mpci_receive_server_stack;
- void * (*stack_allocate_hook)( unsigned32 );
- void (*stack_free_hook)( void* );
- /* end of fields required on all CPUs */
-
- unsigned32 interrupt_table_segment;
- void *interrupt_table_offset;
-} rtems_cpu_table;
-
-/*
- * context size area for floating point
- *
- * NOTE: This is out of place on the i386 to avoid a forward reference.
- */
-
-#define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp )
-
-/* variables */
-
-SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context;
-SCORE_EXTERN void *_CPU_Interrupt_stack_low;
-SCORE_EXTERN void *_CPU_Interrupt_stack_high;
-
-/* constants */
-
-/*
- * This defines the number of levels and the mask used to pick those
- * bits out of a thread mode.
- */
-
-#define CPU_MODES_INTERRUPT_LEVEL 0x00000001 /* interrupt level in mode */
-#define CPU_MODES_INTERRUPT_MASK 0x00000001 /* interrupt level in mode */
-
-/*
- * extra stack required by the MPCI receive server thread
- */
-
-#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 1024
-
-/*
- * i386 family supports 256 distinct vectors.
- */
-
-#define CPU_INTERRUPT_NUMBER_OF_VECTORS 256
-#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1)
-
-/*
- * Minimum size of a thread's stack.
- */
-
-#define CPU_STACK_MINIMUM_SIZE 1024
-
-/*
- * i386 is pretty tolerant of alignment. Just put things on 4 byte boundaries.
- */
-
-#define CPU_ALIGNMENT 4
-#define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT
-#define CPU_PARTITION_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * On i386 thread stacks require no further alignment after allocation
- * from the Workspace.
- */
-
-#define CPU_STACK_ALIGNMENT 0
-
-/* macros */
-
-/*
- * ISR handler macros
- *
- * These macros perform the following functions:
- * + disable all maskable CPU interrupts
- * + restore previous interrupt level (enable)
- * + temporarily restore interrupts (flash)
- * + set a particular level
- */
-
-#define _CPU_ISR_Disable( _level ) i386_disable_interrupts( _level )
-
-#define _CPU_ISR_Enable( _level ) i386_enable_interrupts( _level )
-
-#define _CPU_ISR_Flash( _level ) i386_flash_interrupts( _level )
-
-#define _CPU_ISR_Set_level( _new_level ) \
- { \
- if ( _new_level ) asm volatile ( "cli" ); \
- else asm volatile ( "sti" ); \
- }
-
-unsigned32 _CPU_ISR_Get_level( void );
-
-/* end of ISR handler macros */
-
-/*
- * Context handler macros
- *
- * These macros perform the following functions:
- * + initialize a context area
- * + restart the current thread
- * + calculate the initial pointer into a FP context area
- * + initialize an FP context area
- */
-
-#define CPU_EFLAGS_INTERRUPTS_ON 0x00003202
-#define CPU_EFLAGS_INTERRUPTS_OFF 0x00003002
-
-#define _CPU_Context_Initialize( _the_context, _stack_base, _size, \
- _isr, _entry_point, _is_fp ) \
- do { \
- unsigned32 _stack; \
- \
- if ( (_isr) ) (_the_context)->eflags = CPU_EFLAGS_INTERRUPTS_OFF; \
- else (_the_context)->eflags = CPU_EFLAGS_INTERRUPTS_ON; \
- \
- _stack = ((unsigned32)(_stack_base)) + (_size) - 4; \
- \
- *((proc_ptr *)(_stack)) = (_entry_point); \
- (_the_context)->ebp = (void *) _stack; \
- (_the_context)->esp = (void *) _stack; \
- } while (0)
-
-#define _CPU_Context_Restart_self( _the_context ) \
- _CPU_Context_restore( (_the_context) );
-
-#define _CPU_Context_Fp_start( _base, _offset ) \
- ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
-
-#define _CPU_Context_Initialize_fp( _fp_area ) \
- { \
- unsigned32 *_source = (unsigned32 *) &_CPU_Null_fp_context; \
- unsigned32 *_destination = *(_fp_area); \
- unsigned32 _index; \
- \
- for ( _index=0 ; _index < CPU_CONTEXT_FP_SIZE/4 ; _index++ ) \
- *_destination++ = *_source++; \
- }
-
-/* end of Context handler macros */
-
-/*
- * Fatal Error manager macros
- *
- * These macros perform the following functions:
- * + disable interrupts and halt the CPU
- */
-
-#define _CPU_Fatal_halt( _error ) \
- { \
- asm volatile ( "cli ; \
- movl %0,%%eax ; \
- hlt" \
- : "=r" ((_error)) : "0" ((_error)) \
- ); \
- }
-
-/* end of Fatal Error manager macros */
-
-/*
- * Bitfield handler macros
- *
- * These macros perform the following functions:
- * + scan for the highest numbered (MSB) set in a 16 bit bitfield
- */
-
-#define CPU_USE_GENERIC_BITFIELD_CODE FALSE
-#define CPU_USE_GENERIC_BITFIELD_DATA FALSE
-
-#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
- { \
- register unsigned16 __value_in_register = (_value); \
- \
- _output = 0; \
- \
- asm volatile ( "bsfw %0,%1 " \
- : "=r" (__value_in_register), "=r" (_output) \
- : "0" (__value_in_register), "1" (_output) \
- ); \
- }
-
-/* end of Bitfield handler macros */
-
-/*
- * Priority handler macros
- *
- * These macros perform the following functions:
- * + return a mask with the bit for this major/minor portion of
- * of thread priority set.
- * + translate the bit number returned by "Bitfield_find_first_bit"
- * into an index into the thread ready chain bit maps
- */
-
-#define _CPU_Priority_Mask( _bit_number ) \
- ( 1 << (_bit_number) )
-
-#define _CPU_Priority_bits_index( _priority ) \
- (_priority)
-
-/* functions */
-
-/*
- * _CPU_Initialize
- *
- * This routine performs CPU dependent initialization.
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch)
-);
-
-/*
- * _CPU_ISR_install_raw_handler
- *
- * This routine installs a "raw" interrupt handler directly into the
- * processor's vector table.
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_ISR_install_vector
- *
- * This routine installs an interrupt vector.
- */
-
-void _CPU_ISR_install_vector(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_Thread_Idle_body
- *
- * Use the halt instruction of low power mode of a particular i386 model.
- */
-
-#if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
-
-void _CPU_Thread_Idle_body( void );
-
-#endif /* CPU_PROVIDES_IDLE_THREAD_BODY */
-
-/*
- * _CPU_Context_switch
- *
- * This routine switches from the run context to the heir context.
- */
-
-void _CPU_Context_switch(
- Context_Control *run,
- Context_Control *heir
-);
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally used only to restart self in an
- * efficient manner and avoid stack conflicts.
- */
-
-void _CPU_Context_restore(
- Context_Control *new_context
-);
-
-/*
- * _CPU_Context_save_fp
- *
- * This routine saves the floating point context passed to it.
- */
-
-void _CPU_Context_save_fp(
- void **fp_context_ptr
-);
-
-/*
- * _CPU_Context_restore_fp
- *
- * This routine restores the floating point context passed to it.
- */
-
-void _CPU_Context_restore_fp(
- void **fp_context_ptr
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/cpu/i386/cpu_asm.s b/c/src/exec/score/cpu/i386/cpu_asm.s
deleted file mode 100644
index 16d0a7c205..0000000000
--- a/c/src/exec/score/cpu/i386/cpu_asm.s
+++ /dev/null
@@ -1,281 +0,0 @@
-/* cpu_asm.s
- *
- * This file contains all assembly code for the Intel i386 implementation
- * of RTEMS.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <asm.h>
-
-/*
- * Format of i386 Register structure
- */
-
-.set REG_EFLAGS, 0
-.set REG_ESP, REG_EFLAGS + 4
-.set REG_EBP, REG_ESP + 4
-.set REG_EBX, REG_EBP + 4
-.set REG_ESI, REG_EBX + 4
-.set REG_EDI, REG_ESI + 4
-.set SIZE_REGS, REG_EDI + 4
-
- BEGIN_CODE
-
-/*
- * void _CPU_Context_switch( run_context, heir_context )
- *
- * This routine performs a normal non-FP context.
- */
-
- .p2align 1
- PUBLIC (_CPU_Context_switch)
-
-.set RUNCONTEXT_ARG, 4 # save context argument
-.set HEIRCONTEXT_ARG, 8 # restore context argument
-
-SYM (_CPU_Context_switch):
- movl RUNCONTEXT_ARG(esp),eax # eax = running threads context
- pushf # push eflags
- popl REG_EFLAGS(eax) # save eflags
- movl esp,REG_ESP(eax) # save stack pointer
- movl ebp,REG_EBP(eax) # save base pointer
- movl ebx,REG_EBX(eax) # save ebx
- movl esi,REG_ESI(eax) # save source register
- movl edi,REG_EDI(eax) # save destination register
-
- movl HEIRCONTEXT_ARG(esp),eax # eax = heir threads context
-
-restore:
- pushl REG_EFLAGS(eax) # push eflags
- popf # restore eflags
- movl REG_ESP(eax),esp # restore stack pointer
- movl REG_EBP(eax),ebp # restore base pointer
- movl REG_EBX(eax),ebx # restore ebx
- movl REG_ESI(eax),esi # restore source register
- movl REG_EDI(eax),edi # restore destination register
- ret
-
-/*
- * NOTE: May be unnecessary to reload some registers.
- */
-
-/*
- * void _CPU_Context_restore( new_context )
- *
- * This routine performs a normal non-FP context.
- */
-
- PUBLIC (_CPU_Context_restore)
-
-.set NEWCONTEXT_ARG, 4 # context to restore argument
-
-SYM (_CPU_Context_restore):
-
- movl NEWCONTEXT_ARG(esp),eax # eax = running threads context
- jmp restore
-
-/*PAGE
- * void _CPU_Context_save_fp_context( &fp_context_ptr )
- * void _CPU_Context_restore_fp_context( &fp_context_ptr )
- *
- * This section is used to context switch an i80287, i80387,
- * the built-in coprocessor or the i80486 or compatible.
- */
-
-.set FPCONTEXT_ARG, 4 # FP context argument
-
- .p2align 1
- PUBLIC (_CPU_Context_save_fp)
-SYM (_CPU_Context_save_fp):
- movl FPCONTEXT_ARG(esp),eax # eax = &ptr to FP context area
- movl (eax),eax # eax = FP context area
- fsave (eax) # save FP context
- ret
-
- .p2align 1
- PUBLIC (_CPU_Context_restore_fp)
-SYM (_CPU_Context_restore_fp):
- movl FPCONTEXT_ARG(esp),eax # eax = &ptr to FP context area
- movl (eax),eax # eax = FP context area
- frstor (eax) # restore FP context
- ret
-
-SYM (_Exception_Handler):
- pusha # Push general purpose registers
- pushl esp # Push exception frame address
- movl _currentExcHandler, eax # Call function storead in _currentExcHandler
- call * eax
- addl $4, esp
- popa # restore general purpose registers
- addl $8, esp # skill vector number and faultCode
- iret
-
-#define DISTINCT_EXCEPTION_WITH_FAULTCODE_ENTRY(_vector) \
- .p2align 4 ; \
- PUBLIC (rtems_exception_prologue_ ## _vector ) ; \
-SYM (rtems_exception_prologue_ ## _vector ): \
- pushl $ _vector ; \
- jmp SYM (_Exception_Handler) ;
-
-#define DISTINCT_EXCEPTION_WITHOUT_FAULTCODE_ENTRY(_vector) \
- .p2align 4 ; \
- PUBLIC (rtems_exception_prologue_ ## _vector ) ; \
-SYM (rtems_exception_prologue_ ## _vector ): \
- pushl $ 0 ; \
- pushl $ _vector ; \
- jmp SYM (_Exception_Handler) ;
-
-/*
- * Divide Error
- */
-DISTINCT_EXCEPTION_WITHOUT_FAULTCODE_ENTRY (0)
-/*
- * Debug Exception
- */
-DISTINCT_EXCEPTION_WITHOUT_FAULTCODE_ENTRY (1)
-/*
- * NMI
- */
-DISTINCT_EXCEPTION_WITHOUT_FAULTCODE_ENTRY (2)
-/*
- * Breakpoint
- */
-DISTINCT_EXCEPTION_WITHOUT_FAULTCODE_ENTRY (3)
-/*
- * Overflow
- */
-DISTINCT_EXCEPTION_WITHOUT_FAULTCODE_ENTRY (4)
-/*
- * Bound Range Exceeded
- */
-DISTINCT_EXCEPTION_WITHOUT_FAULTCODE_ENTRY (5)
-/*
- * Invalid Opcode
- */
-DISTINCT_EXCEPTION_WITHOUT_FAULTCODE_ENTRY (6)
-/*
- * No Math Coproc
- */
-DISTINCT_EXCEPTION_WITHOUT_FAULTCODE_ENTRY (7)
-/*
- * Double Fault
- */
-DISTINCT_EXCEPTION_WITH_FAULTCODE_ENTRY (8)
-/*
- * Coprocessor segment overrun
- */
-DISTINCT_EXCEPTION_WITHOUT_FAULTCODE_ENTRY (9)
-/*
- * Invalid TSS
- */
-DISTINCT_EXCEPTION_WITH_FAULTCODE_ENTRY (10)
-/*
- * Segment Not Present
- */
-DISTINCT_EXCEPTION_WITH_FAULTCODE_ENTRY (11)
-/*
- * Stack segment Fault
- */
-DISTINCT_EXCEPTION_WITH_FAULTCODE_ENTRY (12)
-/*
- * General Protection Fault
- */
-DISTINCT_EXCEPTION_WITH_FAULTCODE_ENTRY (13)
-/*
- * Page Fault
- */
-DISTINCT_EXCEPTION_WITH_FAULTCODE_ENTRY (14)
-/*
- * Floating point error (NB 15 is reserved it is therefor skipped)
- */
-DISTINCT_EXCEPTION_WITHOUT_FAULTCODE_ENTRY (16)
-/*
- * Aligment Check
- */
-DISTINCT_EXCEPTION_WITH_FAULTCODE_ENTRY (17)
-/*
- * Machine Check
- */
-DISTINCT_EXCEPTION_WITH_FAULTCODE_ENTRY (18)
-
-
-/*
- * GO32 does not require these segment related routines.
- */
-
-#ifndef __GO32__
-
-/*
- * void *i386_Logical_to_physical(
- * rtems_unsigned16 segment,
- * void *address
- * );
- *
- * Returns thirty-two bit physical address for segment:address.
- */
-
-.set SEGMENT_ARG, 4
-.set ADDRESS_ARG, 8
-
- PUBLIC (i386_Logical_to_physical)
-
-SYM (i386_Logical_to_physical):
-
- xorl eax,eax # clear eax
- movzwl SEGMENT_ARG(esp),ecx # ecx = segment value
- movl $ SYM (_Global_descriptor_table),edx
- # edx = address of our GDT
- addl ecx,edx # edx = address of desired entry
- movb 7(edx),ah # ah = base 31:24
- movb 4(edx),al # al = base 23:16
- shll $16,eax # move ax into correct bits
- movw 2(edx),ax # ax = base 0:15
- movl ADDRESS_ARG(esp),ecx # ecx = address to convert
- addl eax,ecx # ecx = physical address equivalent
- movl ecx,eax # eax = ecx
- ret
-
-/*
- * void *i386_Physical_to_logical(
- * rtems_unsigned16 segment,
- * void *address
- * );
- *
- * Returns thirty-two bit physical address for segment:address.
- */
-
-/*
- *.set SEGMENT_ARG, 4
- *.set ADDRESS_ARG, 8 -- use sets from above
- */
-
- PUBLIC (i386_Physical_to_logical)
-
-SYM (i386_Physical_to_logical):
- xorl eax,eax # clear eax
- movzwl SEGMENT_ARG(esp),ecx # ecx = segment value
- movl $ SYM (_Global_descriptor_table),edx
- # edx = address of our GDT
- addl ecx,edx # edx = address of desired entry
- movb 7(edx),ah # ah = base 31:24
- movb 4(edx),al # al = base 23:16
- shll $16,eax # move ax into correct bits
- movw 2(edx),ax # ax = base 0:15
- movl ADDRESS_ARG(esp),ecx # ecx = address to convert
- subl eax,ecx # ecx = logical address equivalent
- movl ecx,eax # eax = ecx
- ret
-#endif /* __GO32__ */
-
-END_CODE
-
-END
diff --git a/c/src/exec/score/cpu/i386/i386.h b/c/src/exec/score/cpu/i386/i386.h
deleted file mode 100644
index 0eb936a6f7..0000000000
--- a/c/src/exec/score/cpu/i386/i386.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/* i386.h
- *
- * This include file contains information pertaining to the Intel
- * i386 processor.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __i386_h
-#define __i386_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This section contains the information required to build
- * RTEMS for a particular member of the Intel i386
- * family when executing in protected mode. It does
- * this by setting variables to indicate which implementation
- * dependent features are present in a particular member
- * of the family.
- *
- * Currently recognized:
- * i386_fp (i386 DX or SX w/i387)
- * i386_nofp (i386 DX or SX w/o i387)
- * i486dx
- * i486sx
- * pentium
- *
- * CPU Model Feature Flags:
- *
- * I386_HAS_BSWAP: Defined to "1" if the instruction for endian swapping
- * (bswap) should be used. This instruction appears to
- * be present in all i486's and above.
- *
- * I386_HAS_FPU: Defined to "1" if the CPU has an FPU.
- *
- */
-
-#if defined(i386_fp)
-
-#define CPU_MODEL_NAME "i386 with i387"
-#define I386_HAS_BSWAP 0
-
-#elif defined(i386_nofp)
-
-#define CPU_MODEL_NAME "i386 w/o i387"
-#define I386_HAS_FPU 0
-#define I386_HAS_BSWAP 0
-
-#elif defined(i486dx)
-
-#define CPU_MODEL_NAME "i486dx"
-
-#elif defined(i486sx)
-
-#define CPU_MODEL_NAME "i486sx"
-#define I386_HAS_FPU 0
-
-#elif defined(pentium)
-
-#define CPU_MODEL_NAME "Pentium"
-
-#else
-
-#error "Unsupported CPU Model"
-
-#endif
-
-/*
- * Set default values for CPU model feature flags
- *
- * NOTE: These settings are chosen to reflect most of the family members.
- */
-
-#ifndef I386_HAS_FPU
-#define I386_HAS_FPU 1
-#endif
-
-#ifndef I386_HAS_BSWAP
-#define I386_HAS_BSWAP 1
-#endif
-
-/*
- * Define the name of the CPU family.
- */
-
-#define CPU_NAME "Intel i386"
-
-#ifndef ASM
-
-/*
- * The following routine swaps the endian format of an unsigned int.
- * It must be static so it can be referenced indirectly.
- */
-
-static inline unsigned int i386_swap_U32(
- unsigned int value
-)
-{
- unsigned long lout;
-
-#if (I386_HAS_BSWAP == 0)
- asm volatile( "rorw $8,%%ax;"
- "rorl $16,%0;"
- "rorw $8,%%ax" : "=a" (lout) : "0" (value) );
-#else
- __asm__ volatile( "bswap %0" : "=r" (lout) : "0" (value));
-#endif
- return( lout );
-}
-
-static inline unsigned int i386_swap_U16(
- unsigned int value
-)
-{
- unsigned short sout;
-
- __asm__ volatile( "rorw $8,%0" : "=r" (sout) : "0" (value));
- return (sout);
-}
-
-
-/* routines */
-
-/*
- * i386_Logical_to_physical
- *
- * Converts logical address to physical address.
- */
-
-void *i386_Logical_to_physical(
- unsigned short segment,
- void *address
-);
-
-/*
- * i386_Physical_to_logical
- *
- * Converts physical address to logical address.
- */
-
-void *i386_Physical_to_logical(
- unsigned short segment,
- void *address
-);
-
-
-/*
- * "Simpler" names for a lot of the things defined in this file
- */
-
-/* segment access routines */
-
-#define get_cs() i386_get_cs()
-#define get_ds() i386_get_ds()
-#define get_es() i386_get_es()
-#define get_ss() i386_get_ss()
-#define get_fs() i386_get_fs()
-#define get_gs() i386_get_gs()
-
-#define CPU_swap_u32( _value ) i386_swap_U32( _value )
-#define CPU_swap_u16( _value ) i386_swap_U16( _value )
-
-/* i80x86 I/O instructions */
-
-#define outport_byte( _port, _value ) i386_outport_byte( _port, _value )
-#define outport_word( _port, _value ) i386_outport_word( _port, _value )
-#define outport_long( _port, _value ) i386_outport_long( _port, _value )
-#define inport_byte( _port, _value ) i386_inport_byte( _port, _value )
-#define inport_word( _port, _value ) i386_inport_word( _port, _value )
-#define inport_long( _port, _value ) i386_inport_long( _port, _value )
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !ASM */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/cpu/i386/i386types.h b/c/src/exec/score/cpu/i386/i386types.h
deleted file mode 100644
index 7d2a8a1f4f..0000000000
--- a/c/src/exec/score/cpu/i386/i386types.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* i386types.h
- *
- * This include file contains type definitions pertaining to the Intel
- * i386 processor family.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __i386_TYPES_h
-#define __i386_TYPES_h
-
-#ifndef ASM
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* unsigned 8-bit integer */
-typedef unsigned short unsigned16; /* unsigned 16-bit integer */
-typedef unsigned int unsigned32; /* unsigned 32-bit integer */
-typedef unsigned long long unsigned64; /* unsigned 64-bit integer */
-
-typedef unsigned16 Priority_Bit_map_control;
-
-typedef signed char signed8; /* 8-bit signed integer */
-typedef signed short signed16; /* 16-bit signed integer */
-typedef signed int signed32; /* 32-bit signed integer */
-typedef signed long long signed64; /* 64 bit signed integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-typedef void i386_isr;
-
-typedef i386_isr ( *i386_isr_entry )( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !ASM */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/cpu/i386/rtems.s b/c/src/exec/score/cpu/i386/rtems.s
deleted file mode 100644
index ac2822b7fd..0000000000
--- a/c/src/exec/score/cpu/i386/rtems.s
+++ /dev/null
@@ -1,31 +0,0 @@
-/* rtems.s
- *
- * This file contains the single entry point code for
- * the i386 implementation of RTEMS.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <asm.h>
-
- EXTERN (_Entry_points)
-
- BEGIN_CODE
-
- .align 2
- PUBLIC (RTEMS)
-
-SYM (RTEMS):
- jmpl SYM (_Entry_points)(,eax,4)
-
- END_CODE
-
-END
diff --git a/c/src/exec/score/cpu/i960/Makefile.in b/c/src/exec/score/cpu/i960/Makefile.in
deleted file mode 100644
index 641de5b218..0000000000
--- a/c/src/exec/score/cpu/i960/Makefile.in
+++ /dev/null
@@ -1,80 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-RELS=$(ARCH)/rtems-cpu.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=cpu
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/cpu.h $(srcdir)/i960.h $(srcdir)/i960types.h
-
-# H_FILES that get installed externally
-EXTERNAL_H_FILES = $(srcdir)/asm.h
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=cpu_asm rtems
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) $(EXTERNAL_H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(ARCH)/rtems-cpu.rel: $(OBJS)
- $(make-rel)
-
-all: ${ARCH} $(SRCS) preinstall $(OBJS) $(RELS)
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-install: all
-
-preinstall: $(ARCH) \
- $(PROJECT_INCLUDE)/rtems/score/targopts.h \
- ${PROJECT_RELEASE}/lib/bsp_specs
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
-# we will share the basic cpu file
- $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
-
-$(PROJECT_INCLUDE)/rtems/score/targopts.h: $(ARCH)/targopts.h-tmp
- $(INSTALL) -m 444 $(ARCH)/targopts.h-tmp $@
-
-# $(ARCH)/targopts.h-tmp rule is in leaf.cfg
-
-${PROJECT_RELEASE}/lib/bsp_specs: $(ARCH)/bsp_specs.tmp
- $(INSTALL) -m 444 $(ARCH)/bsp_specs.tmp $@
-
-# $(ARCH)/bsp_specs.tmp rule is in leaf.cfg
diff --git a/c/src/exec/score/cpu/i960/asm.h b/c/src/exec/score/cpu/i960/asm.h
deleted file mode 100644
index a9a0788925..0000000000
--- a/c/src/exec/score/cpu/i960/asm.h
+++ /dev/null
@@ -1,110 +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 __i960_ASM_h
-#define __i960_ASM_h
-
-/*
- * Indicate we are in an assembly file and get the basic CPU definitions.
- */
-
-#ifndef ASM
-#define ASM
-#endif
-#include <rtems/score/targopts.h>
-#include <rtems/score/i960.h>
-
-/*
- * 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 g0 REG (g0)
-#define g1 REG (g1)
-#define g2 REG (g2)
-#define g3 REG (g3)
-#define g4 REG (g4)
-#define g5 REG (g5)
-#define g6 REG (g6)
-#define g7 REG (g7)
-#define g8 REG (g8)
-#define g9 REG (g9)
-#define g10 REG (g10)
-#define g11 REG (g11)
-#define g12 REG (g12)
-#define g13 REG (g13)
-#define g14 REG (g14)
-#define g15 REG (g15)
-
-/*
- * 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/c/src/exec/score/cpu/i960/cpu.c b/c/src/exec/score/cpu/i960/cpu.c
deleted file mode 100644
index 7dbbb5828f..0000000000
--- a/c/src/exec/score/cpu/i960/cpu.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Intel i960CA Dependent Source
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#if defined(__i960CA__) || defined(__i960_CA__) || defined(__i960CA)
-#else
-#warning "*** ENTIRE FILE IMPLEMENTED & TESTED FOR CA ONLY ***"
-#warning "*** THIS FILE WILL NOT COMPILE ON ANOTHER FAMILY MEMBER ***"
-#endif
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-
-/* _CPU_Initialize
- *
- * This routine performs processor dependent initialization.
- *
- * INPUT PARAMETERS:
- * cpu_table - CPU table to initialize
- * thread_dispatch - address of disptaching routine
- *
- * OUTPUT PARAMETERS: NONE
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch) /* ignored on this CPU */
-)
-{
-
- _CPU_Table = *cpu_table;
-
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- unsigned32 level;
-
- i960_get_interrupt_level( level );
-
- return level;
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-#define _Is_vector_caching_enabled( _prcb ) \
- ((_prcb)->control_tbl->icon & 0x2000)
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- i960ca_PRCB *prcb = _CPU_Table.Prcb;
- proc_ptr *cached_intr_tbl = NULL;
-
- /* The i80960CA does not support vectors 0-7. The first 9 entries
- * in the Interrupt Table are used to manage pending interrupts.
- * Thus vector 8, the first valid vector number, is actually in
- * slot 9 in the table.
- */
-
- *old_handler = prcb->intr_tbl[ vector + 1 ];
-
- prcb->intr_tbl[ vector + 1 ] = new_handler;
-
- if ( _Is_vector_caching_enabled( prcb ) )
- if ( (vector & 0xf) == 0x2 ) /* cacheable? */
- cached_intr_tbl[ vector >> 4 ] = new_handler;
-}
-
-/*PAGE
- *
- * _CPU__ISR_install_vector
- *
- * Install the RTEMS vector wrapper in the CPU's interrupt table.
- *
- * 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 ];
-
- _CPU_ISR_install_raw_handler( vector, _ISR_Handler, &ignored );
-
- _ISR_Vector_table[ vector ] = new_handler;
-}
-
-/*PAGE
- *
- * _CPU_Install_interrupt_stack
- */
-
-#define soft_reset( prcb ) \
- { register i960ca_PRCB *_prcb = (prcb); \
- register unsigned32 *_next=0; \
- register unsigned32 _cmd = 0x30000; \
- asm volatile( "lda next,%1; \
- sysctl %0,%1,%2; \
- next: mov g0,g0" \
- : "=d" (_cmd), "=d" (_next), "=d" (_prcb) \
- : "0" (_cmd), "1" (_next), "2" (_prcb) ); \
- }
-
-void _CPU_Install_interrupt_stack( void )
-{
- i960ca_PRCB *prcb = _CPU_Table.Prcb;
- unsigned32 level;
-
- /*
- * Set the Interrupt Stack in the PRCB and force a reload of it.
- * Interrupts are disabled for safety.
- */
-
- _CPU_ISR_Disable( level );
-
- prcb->intr_stack = _CPU_Interrupt_stack_low;
-
- soft_reset( prcb );
-
- _CPU_ISR_Enable( level );
-}
diff --git a/c/src/exec/score/cpu/i960/cpu.h b/c/src/exec/score/cpu/i960/cpu.h
deleted file mode 100644
index 1deb8c08b4..0000000000
--- a/c/src/exec/score/cpu/i960/cpu.h
+++ /dev/null
@@ -1,468 +0,0 @@
-/* cpu.h
- *
- * This include file contains information pertaining to the Intel
- * i960 processor family.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_h
-#define __CPU_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#pragma align 4 /* for GNU C structure alignment */
-
-#include <rtems/score/i960.h> /* pick up machine definitions */
-#ifndef ASM
-#include <rtems/score/i960types.h>
-#endif
-
-#define CPU_INLINE_ENABLE_DISPATCH FALSE
-#define CPU_UNROLL_ENQUEUE_PRIORITY FALSE
-
-/*
- * Use the i960's hardware interrupt stack support and have the
- * interrupt manager allocate the memory for it.
- */
-
-#define CPU_HAS_SOFTWARE_INTERRUPT_STACK FALSE
-#define CPU_HAS_HARDWARE_INTERRUPT_STACK TRUE
-#define CPU_ALLOCATE_INTERRUPT_STACK TRUE
-
-/*
- * Does the RTEMS invoke the user's ISR with the vector number and
- * a pointer to the saved interrupt frame (1) or just the vector
- * number (0)?
- */
-
-#define CPU_ISR_PASSES_FRAME_POINTER 0
-
-/*
- * Some family members have no FP (SA/KA/CA/CF), others have it built in
- * (KB/MC/MX). There does not appear to be an external coprocessor
- * for this family.
- */
-
-#if ( I960_HAS_FPU == 1 )
-#define CPU_HARDWARE_FP TRUE
-#error "Floating point support for i960 family has been implemented!!!"
-#else
-#define CPU_HARDWARE_FP FALSE
-#endif
-
-#define CPU_ALL_TASKS_ARE_FP FALSE
-#define CPU_IDLE_TASK_IS_FP FALSE
-#define CPU_USE_DEFERRED_FP_SWITCH TRUE
-
-#define CPU_PROVIDES_IDLE_THREAD_BODY FALSE
-#define CPU_STACK_GROWS_UP TRUE
-#define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned (16)))
-
-/*
- * Define what is required to specify how the network to host conversion
- * routines are handled.
- */
-
-#define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE
-#define CPU_BIG_ENDIAN TRUE
-#define CPU_LITTLE_ENDIAN FALSE
-
-
-/* structures */
-
-/*
- * Basic integer context for the i960 family.
- */
-
-typedef struct {
- void *r0_pfp; /* (r0) Previous Frame Pointer */
- void *r1_sp; /* (r1) Stack Pointer */
- unsigned32 pc; /* (pc) Processor Control */
- void *g8; /* (g8) Global Register 8 */
- void *g9; /* (g9) Global Register 9 */
- void *g10; /* (g10) Global Register 10 */
- void *g11; /* (g11) Global Register 11 */
- void *g12; /* (g12) Global Register 12 */
- void *g13; /* (g13) Global Register 13 */
- unsigned32 g14; /* (g14) Global Register 14 */
- void *g15_fp; /* (g15) Frame Pointer */
-} Context_Control;
-
-/*
- * FP context save area for the i960 Numeric Extension
- */
-
-typedef struct {
- unsigned32 fp0_1; /* (fp0) first word */
- unsigned32 fp0_2; /* (fp0) second word */
- unsigned32 fp0_3; /* (fp0) third word */
- unsigned32 fp1_1; /* (fp1) first word */
- unsigned32 fp1_2; /* (fp1) second word */
- unsigned32 fp1_3; /* (fp1) third word */
- unsigned32 fp2_1; /* (fp2) first word */
- unsigned32 fp2_2; /* (fp2) second word */
- unsigned32 fp2_3; /* (fp2) third word */
- unsigned32 fp3_1; /* (fp3) first word */
- unsigned32 fp3_2; /* (fp3) second word */
- unsigned32 fp3_3; /* (fp3) third word */
-} Context_Control_fp;
-
-/*
- * The following structure defines the set of information saved
- * on the current stack by RTEMS upon receipt of each interrupt.
- */
-
-typedef struct {
- unsigned32 TBD; /* XXX Fix for this CPU */
-} CPU_Interrupt_frame;
-
-/*
- * Call frame for the i960 family.
- */
-
-typedef struct {
- void *r0_pfp; /* (r0) Previous Frame Pointer */
- void *r1_sp; /* (r1) Stack Pointer */
- void *r2_rip; /* (r2) Return Instruction Pointer */
- void *r3; /* (r3) Local Register 3 */
- void *r4; /* (r4) Local Register 4 */
- void *r5; /* (r5) Local Register 5 */
- void *r6; /* (r6) Local Register 6 */
- void *r7; /* (r7) Local Register 7 */
- void *r8; /* (r8) Local Register 8 */
- void *r9; /* (r9) Local Register 9 */
- void *r10; /* (r10) Local Register 10 */
- void *r11; /* (r11) Local Register 11 */
- void *r12; /* (r12) Local Register 12 */
- void *r13; /* (r13) Local Register 13 */
- void *r14; /* (r14) Local Register 14 */
- void *r15; /* (r15) Local Register 15 */
- /* XXX Looks like sometimes there is FP stuff here (MC manual)? */
-} CPU_Call_frame;
-
-/*
- * The following table contains the information required to configure
- * the i960 specific parameters.
- */
-
-typedef struct {
- void (*pretasking_hook)( void );
- void (*predriver_hook)( void );
- void (*postdriver_hook)( void );
- void (*idle_task)( void );
- boolean do_zero_of_workspace;
- unsigned32 idle_task_stack_size;
- unsigned32 interrupt_stack_size;
- unsigned32 extra_mpci_receive_server_stack;
- void * (*stack_allocate_hook)( unsigned32 );
- void (*stack_free_hook)( void* );
- /* end of fields required on all CPUs */
-
-#if defined(__i960CA__) || defined(__i960_CA__) || defined(__i960CA)
- i960ca_PRCB *Prcb;
-#endif
-} rtems_cpu_table;
-
-/* variables */
-
-SCORE_EXTERN void *_CPU_Interrupt_stack_low;
-SCORE_EXTERN void *_CPU_Interrupt_stack_high;
-
-/* constants */
-
-/*
- * This defines the number of levels and the mask used to pick those
- * bits out of a thread mode.
- */
-
-#define CPU_MODES_INTERRUPT_LEVEL 0x0000001f /* interrupt level in mode */
-#define CPU_MODES_INTERRUPT_MASK 0x0000001f /* interrupt level in mode */
-
-/*
- * context size area for floating point
- */
-
-#define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp )
-
-/*
- * extra stack required by the MPCI receive server thread
- */
-
-#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK (CPU_STACK_MINIMUM_SIZE)
-
-/*
- * i960 family supports 256 distinct vectors.
- */
-
-#define CPU_INTERRUPT_NUMBER_OF_VECTORS 256
-#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1)
-
-/*
- * Minimum size of a thread's stack.
- *
- * NOTE: See CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK
- */
-
-#define CPU_STACK_MINIMUM_SIZE 2048
-
-/*
- * i960 is pretty tolerant of alignment. Just put things on 4 byte boundaries.
- */
-
-#define CPU_ALIGNMENT 4
-#define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT
-#define CPU_PARTITION_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * i960ca stack requires 16 byte alignment
- *
- * NOTE: This factor may need to be family member dependent.
- */
-
-#define CPU_STACK_ALIGNMENT 16
-
-/* macros */
-
-/*
- * ISR handler macros
- *
- * These macros perform the following functions:
- * + disable all maskable CPU interrupts
- * + restore previous interrupt level (enable)
- * + temporarily restore interrupts (flash)
- * + set a particular level
- */
-
-#define _CPU_ISR_Disable( _level ) i960_disable_interrupts( _level )
-#define _CPU_ISR_Enable( _level ) i960_enable_interrupts( _level )
-#define _CPU_ISR_Flash( _level ) i960_flash_interrupts( _level )
-
-#define _CPU_ISR_Set_level( newlevel ) \
- { \
- unsigned32 _mask = 0; \
- unsigned32 _level = (newlevel); \
- \
- __asm__ volatile ( "ldconst 0x1f0000,%0; \
- modpc 0,%0,%1" : "=d" (_mask), "=d" (_level) \
- : "0" (_mask), "1" (_level) \
- ); \
- }
-
-unsigned32 _CPU_ISR_Get_level( void );
-
-/* ISR handler section macros */
-
-/*
- * Context handler macros
- *
- * These macros perform the following functions:
- * + initialize a context area
- * + restart the current thread
- * + calculate the initial pointer into a FP context area
- * + initialize an FP context area
- */
-
-#define _CPU_Context_Initialize( _the_context, _stack_base, _size, \
- _isr, _entry, _is_fp ) \
- { CPU_Call_frame *_texit_frame; \
- unsigned32 _mask; \
- unsigned32 _base_pc; \
- unsigned32 _stack_tmp; \
- void *_stack; \
- \
- _stack_tmp = (unsigned32)(_stack_base) + CPU_STACK_ALIGNMENT; \
- _stack_tmp &= ~(CPU_STACK_ALIGNMENT - 1); \
- _stack = (void *) _stack_tmp; \
- \
- __asm__ volatile ( "flushreg" : : ); /* flush register cache */ \
- \
- (_the_context)->r0_pfp = _stack; \
- (_the_context)->g15_fp = _stack + (1 * sizeof(CPU_Call_frame)); \
- (_the_context)->r1_sp = _stack + (2 * sizeof(CPU_Call_frame)); \
- __asm__ volatile ( "ldconst 0x1f0000,%0 ; " \
- "modpc 0,0,%1 ; " \
- "andnot %0,%1,%1 ; " \
- : "=d" (_mask), "=d" (_base_pc) : ); \
- (_the_context)->pc = _base_pc | ((_isr) << 16); \
- (_the_context)->g14 = 0; \
- \
- _texit_frame = (CPU_Call_frame *)_stack; \
- _texit_frame->r0_pfp = NULL; \
- _texit_frame->r1_sp = (_the_context)->g15_fp; \
- _texit_frame->r2_rip = (_entry); \
- }
-
-#define _CPU_Context_Restart_self( _the_context ) \
- _CPU_Context_restore( (_the_context) );
-
-#define _CPU_Context_Fp_start( _base, _offset ) NULL
-
-#define _CPU_Context_Initialize_fp( _fp_area )
-
-/* end of Context handler macros */
-
-/*
- * Fatal Error manager macros
- *
- * These macros perform the following functions:
- * + disable interrupts and halt the CPU
- */
-
-#define _CPU_Fatal_halt( _errorcode ) \
- { unsigned32 _mask, _level; \
- unsigned32 _error = (_errorcode); \
- \
- __asm__ volatile ( "ldconst 0x1f0000,%0 ; \
- mov %0,%1 ; \
- modpc 0,%0,%1 ; \
- mov %2,g0 ; \
- self: b self " \
- : "=d" (_mask), "=d" (_level), "=d" (_error) : ); \
- }
-
-/* end of Fatal Error Manager macros */
-
-/*
- * Bitfield handler macros
- *
- * These macros perform the following functions:
- * + scan for the highest numbered (MSB) set in a 16 bit bitfield
- */
-
-#define CPU_USE_GENERIC_BITFIELD_CODE FALSE
-#define CPU_USE_GENERIC_BITFIELD_DATA FALSE
-
-#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
- { unsigned32 _search = (_value); \
- \
- (_output) = 0; /* to prevent warnings */ \
- __asm__ volatile ( "scanbit %0,%1 " \
- : "=d" (_search), "=d" (_output) \
- : "0" (_search), "1" (_output) ); \
- }
-
-/* end of Bitfield handler macros */
-
-/*
- * Priority handler macros
- *
- * These macros perform the following functions:
- * + return a mask with the bit for this major/minor portion of
- * of thread priority set.
- * + translate the bit number returned by "Bitfield_find_first_bit"
- * into an index into the thread ready chain bit maps
- */
-
-#define _CPU_Priority_Mask( _bit_number ) \
- ( 0x8000 >> (_bit_number) )
-
-#define _CPU_Priority_bits_index( _priority ) \
- ( 15 - (_priority) )
-
-/* end of Priority handler macros */
-
-/* functions */
-
-/*
- * _CPU_Initialize
- *
- * This routine performs CPU dependent initialization.
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch)
-);
-
-/*
- * _CPU_ISR_install_raw_handler
- *
- * This routine installs a "raw" interrupt handler directly into the
- * processor's vector table.
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_ISR_install_vector
- *
- * This routine installs an interrupt vector.
- */
-
-void _CPU_ISR_install_vector(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_Install_interrupt_stack
- *
- * This routine installs the hardware interrupt stack pointer.
- */
-
-void _CPU_Install_interrupt_stack( void );
-
-/*
- * _CPU_Context_switch
- *
- * This routine switches from the run context to the heir context.
- */
-
-void _CPU_Context_switch(
- Context_Control *run,
- Context_Control *heir
-);
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally used only to restart self in an
- * efficient manner and avoid stack conflicts.
- */
-
-void _CPU_Context_restore(
- Context_Control *new_context
-);
-
-/*
- * _CPU_Context_save_fp
- *
- * This routine saves the floating point context passed to it.
- */
-
-void _CPU_Context_save_fp(
- void **fp_context_ptr
-);
-
-/*
- * _CPU_Context_restore_fp
- *
- * This routine restores the floating point context passed to it.
- */
-
-void _CPU_Context_restore_fp(
- void **fp_context_ptr
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/cpu/i960/cpu_asm.s b/c/src/exec/score/cpu/i960/cpu_asm.s
deleted file mode 100644
index fbed8babd8..0000000000
--- a/c/src/exec/score/cpu/i960/cpu_asm.s
+++ /dev/null
@@ -1,199 +0,0 @@
-/* cpu_asm.s
- *
- * This file contains all assembly code for the i960CA implementation
- * of RTEMS.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
- .text
-/*
- * Format of i960ca Register structure
- */
-
-.set REG_R0_PFP , 0 # (r0) Previous Frame Pointer
-.set REG_R1_SP , REG_R0_PFP+4 # (r1) Stack Pointer
-.set REG_PC , REG_R1_SP+4 # (pc) Processor Controls
-.set REG_G8 , REG_PC+4 # (g8) Global Register 8
-.set REG_G9 , REG_G8+4 # (g9) Global Register 9
-.set REG_G10 , REG_G9+4 # (g10) Global Register 10
-.set REG_G11 , REG_G10+4 # (g11) Global Register 11
-.set REG_G12 , REG_G11+4 # (g12) Global Register 12
-.set REG_G13 , REG_G12+4 # (g13) Global Register 13
-.set REG_G14 , REG_G13+4 # (g14) Global Register 14
-.set REG_G15_FP , REG_G14+4 # (g15) Global Register 15
-.set SIZE_REGS , REG_G15_FP+4 # size of cpu_context_registers
- # structure
-
-/*
- * void _CPU_Context_switch( run_context, heir_context )
- *
- * This routine performs a normal non-FP context.
- */
- .align 4
- .globl __CPU_Context_switch
-
-__CPU_Context_switch:
- modpc 0,0,g2 # get old intr level (PC)
- st g2,REG_PC(g0) # save pc
- stq g8,REG_G8(g0) # save g8-g11
- stq g12,REG_G12(g0) # save g12-g15
- stl pfp,REG_R0_PFP(g0) # save pfp, sp
-
-restore: flushreg # flush register cache
- ldconst 0x001f0000,g2 # g2 = PC mask
- ld REG_PC(g1),g3 # thread->Regs.pc = pc;
- ldq REG_G12(g1),g12 # restore g12-g15
- ldl REG_R0_PFP(g1),pfp # restore pfp, sp
- ldq REG_G8(g1),g8 # restore g8-g11
- modpc 0,g2,g3 # restore PC register
- ret
-
-/*
- * void _CPU_Context_restore( new_context )
- *
- * This routine performs a normal non-FP context.
- */
-
- .globl __CPU_Context_restore
-__CPU_Context_restore:
- mov g0,g1 # g0 = _Thread_executing
- b restore
-
-/*PAGE
- * void _CPU_Context_save_fp_context( &fp_context_ptr )
- * void _CPU_Context_restore_fp_context( &fp_context_ptr )
- *
- * There is currently no hardware floating point for the i960.
- */
-
- .globl __CPU_Context_save_fp
- .globl __CPU_Context_restore_fp
-__CPU_Context_save_fp:
-__CPU_Context_restore_fp:
-#if ( I960_HAS_FPU == 1 )
-#error "Floating point support for i960 family has been implemented!!!"
-#endif
- ret
-
-/*PAGE
- * void __ISR_Handler()
- *
- * This routine provides the RTEMS interrupt management.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE:
- * Upon entry, the supervisor stack will contain a stack frame
- * back to the interrupted thread and the interrupt stack will contain
- * an interrupt stack frame. If dispatching is enabled, this
- * is the outer most interrupt, and (a context switch is necessary or
- * the current thread has signals), then set up the supervisor stack to
- * transfer control to the interrupt dispatcher.
- */
-
- .globl __ISR_Handler
-__ISR_Handler:
- #ldconst 1,r8
- #modpc 0,r8,r8 # enable tracing
-
- # r4 = &_Thread_Dispatch_disable_level
- ld __Thread_Dispatch_disable_level,r4
- movl g0,r8 # save g0-g1
-
- ld -16+8(fp),g0 # g0 = vector number
- movl g2,r10 # save g2-g3
-
- ld __ISR_Nest_level,r5 # r5 = &_Isr_nest_level
- mov g14,r7 # save g14
-
- lda 0,g14 # NOT Branch and Link
- movl g4,r12 # save g4-g5
-
- lda 1(r4),r4 # increment dispatch disable level
- movl g6,r14 # save g6-g7
-
- ld __ISR_Vector_table[g0*4],g1 # g1 = Users handler
- addo 1,r5,r5 # increment ISR level
-
- st r4,__Thread_Dispatch_disable_level
- # one ISR nest level deeper
- subo 1,r4,r4 # decrement dispatch disable level
-
- st r5,__ISR_Nest_level # disable multitasking
- subo 1,r5,r5 # decrement ISR nest level
-
- callx (g1) # invoke user ISR
-
- st r4,__Thread_Dispatch_disable_level
- # unnest multitasking
- st r5,__ISR_Nest_level # one less ISR nest level
- cmpobne.f 0,r4,exit # If dispatch disabled, exit
- ldl -16(fp),g0 # g0 = threads PC reg
- # g1 = threads AC reg
- ld __Context_Switch_necessary,r6
- # r6 = Is thread switch necessary?
- bbs.f 13,g0,exit # not outer level, then exit
- cmpobne.f 0,r6,bframe # Switch necessary?
-
- ld __ISR_Signals_to_thread_executing,g2
- # signals sent to Run_thread
- # while in interrupt handler?
- cmpobe.f 0,g2,exit # No, then exit
-
-bframe: mov 0,g2
- st g2,__ISR_Signals_to_thread_executing
-
- ldconst 0x1f0000,g2 # g2 = intr disable mask
- mov g2,g3 # g3 = new intr level
- modpc 0,g2,g3 # set new level
-
- andnot 7,pfp,r4 # r4 = pfp without ret type
- flushreg # flush registers
- # push _Isr_dispatch ret frame
- # build ISF in r4-r6
- ldconst 64,g2 # g2 = size of stack frame
- ld 4(r4),g3 # g3 = previous sp
- addo g2,g3,r5 # r5 = _Isr_dispatch SP
- lda __ISR_Dispatch,r6 # r6 = _Isr_dispatch entry
- stt r4,(g3) # set _Isr_dispatch ret info
- st g1,16(g3) # set r4 = AC for ISR disp
- or 7,g3,pfp # pfp to _Isr_dispatch
-
-exit: mov r7,g14 # restore g14
- movq r8,g0 # restore g0-g3
- movq r12,g4 # restore g4-g7
- ret
-
-
-/*PAGE
- *
- * void __ISR_Dispatch()
- *
- * Entry point from the outermost interrupt service routine exit.
- * The current stack is the supervisor mode stack.
- */
-
-__ISR_Dispatch:
- mov g14,r7
- mov 0,g14
- movq g0,r8
- movq g4,r12
- call __Thread_Dispatch
-
- ldconst -1,r5 # r5 = reload mask
- modac r5,r4,r4 # restore threads AC register
- mov r7,g14
- movq r8,g0
- movq r12,g4
- ret
diff --git a/c/src/exec/score/cpu/i960/i960.h b/c/src/exec/score/cpu/i960/i960.h
deleted file mode 100644
index 78260a5a57..0000000000
--- a/c/src/exec/score/cpu/i960/i960.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/* i960.h
- *
- * This include file contains information pertaining to the Intel
- * i960 processor family.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __i960_h
-#define __i960_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This file contains the information required to build
- * RTEMS for a particular member of the Intel i960
- * family. It does this by setting variables to indicate
- * which implementation dependent features are present
- * in a particular member of the family.
- *
- * NOTE: For now i960 is really the i960ca. eventually need
- * to put in at least support for FPU.
- */
-
-#if defined(__i960CA__)
-
-#define CPU_MODEL_NAME "i960ca"
-#define I960_HAS_FPU 0
-
-#else
-
-#error "Unsupported CPU Model"
-
-#endif
-
-/*
- * Define the name of the CPU family.
- */
-
-#define CPU_NAME "Intel i960"
-
-#ifndef ASM
-
-/*
- * XXX should have an ifdef here and have stuff for the other
- * XXX family members...
- */
-
-#if defined(__i960CA__)
-
-/* i960CA control structures */
-
-/* Intel i960CA Control Table */
-
-typedef struct {
- /* Control Group 0 */
- unsigned int ipb0; /* IP breakpoint 0 */
- unsigned int ipb1; /* IP breakpoint 1 */
- unsigned int dab0; /* data address breakpoint 0 */
- unsigned int dab1; /* data address breakpoint 1 */
- /* Control Group 1 */
- unsigned int imap0; /* interrupt map 0 */
- unsigned int imap1; /* interrupt map 1 */
- unsigned int imap2; /* interrupt map 2 */
- unsigned int icon; /* interrupt control */
- /* Control Group 2 */
- unsigned int mcon0; /* memory region 0 configuration */
- unsigned int mcon1; /* memory region 1 configuration */
- unsigned int mcon2; /* memory region 2 configuration */
- unsigned int mcon3; /* memory region 3 configuration */
- /* Control Group 3 */
- unsigned int mcon4; /* memory region 4 configuration */
- unsigned int mcon5; /* memory region 5 configuration */
- unsigned int mcon6; /* memory region 6 configuration */
- unsigned int mcon7; /* memory region 7 configuration */
- /* Control Group 4 */
- unsigned int mcon8; /* memory region 8 configuration */
- unsigned int mcon9; /* memory region 9 configuration */
- unsigned int mcon10; /* memory region 10 configuration */
- unsigned int mcon11; /* memory region 11 configuration */
- /* Control Group 5 */
- unsigned int mcon12; /* memory region 12 configuration */
- unsigned int mcon13; /* memory region 13 configuration */
- unsigned int mcon14; /* memory region 14 configuration */
- unsigned int mcon15; /* memory region 15 configuration */
- /* Control Group 6 */
- unsigned int bpcon; /* breakpoint control */
- unsigned int tc; /* trace control */
- unsigned int bcon; /* bus configuration control */
- unsigned int reserved; /* reserved */
-} i960ca_control_table;
-
-/* Intel i960CA Processor Control Block */
-
-typedef struct {
- unsigned int *fault_tbl; /* fault table base address */
- i960ca_control_table
- *control_tbl; /* control table base address */
- unsigned int initial_ac; /* AC register initial value */
- unsigned int fault_config; /* fault configuration word */
- void **intr_tbl; /* interrupt table base address */
- void *sys_proc_tbl; /* system procedure table
- base address */
- unsigned int reserved; /* reserved */
- unsigned int *intr_stack; /* interrupt stack pointer */
- unsigned int ins_cache_cfg; /* instruction cache
- configuration word */
- unsigned int reg_cache_cfg; /* register cache configuration word */
-} i960ca_PRCB;
-
-#endif
-
-/*
- * Interrupt Level Routines
- */
-
-#define i960_disable_interrupts( oldlevel ) \
- { (oldlevel) = 0x1f0000; \
- asm volatile ( "modpc 0,%1,%1" \
- : "=d" ((oldlevel)) \
- : "0" ((oldlevel)) ); \
- }
-
-#define i960_enable_interrupts( oldlevel ) \
- { unsigned int _mask = 0x1f0000; \
- asm volatile ( "modpc 0,%0,%1" \
- : "=d" (_mask), "=d" ((oldlevel)) \
- : "0" (_mask), "1" ((oldlevel)) ); \
- }
-
-#define i960_flash_interrupts( oldlevel ) \
- { unsigned int _mask = 0x1f0000; \
- asm volatile ( "modpc 0,%0,%1 ; \
- mov %0,%1 ; \
- modpc 0,%0,%1" \
- : "=d" (_mask), "=d" ((oldlevel)) \
- : "0" (_mask), "1" ((oldlevel)) ); \
- }
-
-#define i960_get_interrupt_level( _level ) \
- { \
- i960_disable_interrupts( _level ); \
- i960_enable_interrupts( _level ); \
- (_level) = ((_level) & 0x1f0000) >> 16; \
- } while ( 0 )
-
-#define i960_atomic_modify( mask, addr, prev ) \
- { register unsigned int _mask = (mask); \
- register unsigned int *_addr = (unsigned int *)(addr); \
- asm volatile( "atmod %0,%1,%1" \
- : "=d" (_addr), "=d" (_mask) \
- : "0" (_addr), "1" (_mask) ); \
- (prev) = _mask; \
- }
-
-
-#define atomic_modify( _mask, _address, _previous ) \
- i960_atomic_modify( _mask, _address, _previous )
-
-#define i960_enable_tracing() \
- { register unsigned int _pc = 0x1; \
- asm volatile( "modpc 0,%0,%0" : "=d" (_pc) : "0" (_pc) ); \
- }
-
-#define i960_unmask_intr( xint ) \
- { register unsigned int _mask= (1<<(xint)); \
- asm volatile( "or sf1,%0,sf1" : "=d" (_mask) : "0" (_mask) ); \
- }
-
-#define i960_mask_intr( xint ) \
- { register unsigned int _mask= (1<<(xint)); \
- asm volatile( "andnot %0,sf1,sf1" : "=d" (_mask) : "0" (_mask) ); \
- }
-
-#define i960_clear_intr( xint ) \
- { register unsigned int _xint=(xint); \
-asm volatile( "loop_til_cleared: clrbit %0,sf0,sf0 ; \
- bbs %0,sf0, loop_til_cleared" \
- : "=d" (_xint) : "0" (_xint) ); \
- }
-
-#define i960_reload_ctl_group( group ) \
- { register int _cmd = ((group)|0x400) ; \
- asm volatile( "sysctl %0,%0,%0" : "=d" (_cmd) : "0" (_cmd) ); \
- }
-
-#define i960_cause_intr( intr ) \
- { register int _intr = (intr); \
- asm volatile( "sysctl %0,%0,%0" : "=d" (_intr) : "0" (_intr) ); \
- }
-
-#define i960_soft_reset( prcb ) \
- { register i960ca_PRCB *_prcb = (prcb); \
- register unsigned int *_next=0; \
- register unsigned int _cmd = 0x30000; \
- asm volatile( "lda next,%1; \
- sysctl %0,%1,%2; \
- next: mov g0,g0" \
- : "=d" (_cmd), "=d" (_next), "=d" (_prcb) \
- : "0" (_cmd), "1" (_next), "2" (_prcb) ); \
- }
-
-static inline unsigned int i960_pend_intrs()
-{ register unsigned int _intr=0;
- asm volatile( "mov sf0,%0" : "=d" (_intr) : "0" (_intr) );
- return ( _intr );
-}
-
-static inline unsigned int i960_mask_intrs()
-{ register unsigned int _intr=0;
- asm volatile( "mov sf1,%0" : "=d" (_intr) : "0" (_intr) );
- return( _intr );
-}
-
-static inline unsigned int i960_get_fp()
-{ register unsigned int _fp=0;
- asm volatile( "mov fp,%0" : "=d" (_fp) : "0" (_fp) );
- return ( _fp );
-}
-
-/*
- * The following routine swaps the endian format of an unsigned int.
- * It must be static because it is referenced indirectly.
- *
- * This version is based on code presented in Vol. 4, No. 4 of
- * Insight 960. It is certainly something you wouldn't think
- * of on your own.
- */
-
-static inline unsigned int CPU_swap_u32(
- unsigned int value
-)
-{
- register unsigned int to_swap = value;
- register unsigned int temp = 0xFF00FF00;
- register unsigned int swapped = 0;
-
- /* to_swap swapped */
- asm volatile ( "rotate 16,%0,%2 ;" /* 0x12345678 0x56781234 */
- "modify %1,%0,%2 ;" /* 0x12345678 0x12785634 */
- "rotate 8,%2,%2" /* 0x12345678 0x78563412 */
- : "=r" (to_swap), "=r" (temp), "=r" (swapped)
- : "0" (to_swap), "1" (temp), "2" (swapped)
- );
- return( swapped );
-}
-
-#define CPU_swap_u16( value ) \
- (((value&0xff) << 8) | ((value >> 8)&0xff))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !ASM */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/cpu/i960/i960types.h b/c/src/exec/score/cpu/i960/i960types.h
deleted file mode 100644
index dff4c95f83..0000000000
--- a/c/src/exec/score/cpu/i960/i960types.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* i960types.h
- *
- * This include file contains type definitions pertaining to the Intel
- * i960 processor family.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __i960_TYPES_h
-#define __i960_TYPES_h
-
-#ifndef ASM
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* unsigned 8-bit integer */
-typedef unsigned short unsigned16; /* unsigned 16-bit integer */
-typedef unsigned int unsigned32; /* unsigned 32-bit integer */
-typedef unsigned long long unsigned64; /* unsigned 64-bit integer */
-
-typedef unsigned32 Priority_Bit_map_control;
-
-typedef signed char signed8; /* 8-bit signed integer */
-typedef signed short signed16; /* 16-bit signed integer */
-typedef signed int signed32; /* 32-bit signed integer */
-typedef signed long long signed64; /* 64 bit signed integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-typedef void i960_isr;
-
-typedef void ( *i960_isr_entry )( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !ASM */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/cpu/i960/rtems.s b/c/src/exec/score/cpu/i960/rtems.s
deleted file mode 100644
index 37fb734436..0000000000
--- a/c/src/exec/score/cpu/i960/rtems.s
+++ /dev/null
@@ -1,25 +0,0 @@
-/* rtems.s
- *
- * This file contains the single entry point code for
- * the i960 implementation of RTEMS.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
- .text
-
- .align 4
- .globl RTEMS
-
-RTEMS:
- ld __Entry_points[g7*4],r4
- bx (r4)
-
diff --git a/c/src/exec/score/cpu/m68k/Makefile.in b/c/src/exec/score/cpu/m68k/Makefile.in
deleted file mode 100644
index f273d69362..0000000000
--- a/c/src/exec/score/cpu/m68k/Makefile.in
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-RELS=$(ARCH)/rtems-cpu.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=cpu memcpy
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/cpu.h $(srcdir)/m68k.h $(srcdir)/m68ktypes.h
-
-# H_FILES that get installed externally
-EXTERNAL_H_FILES = $(srcdir)/asm.h $(srcdir)/m68302.h $(srcdir)/m68360.h \
- $(srcdir)/qsm.h $(srcdir)/sim.h
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=cpu_asm rtems
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) $(EXTERNAL_H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(ARCH)/rtems-cpu.rel: $(OBJS)
- $(make-rel)
-
-all: ${ARCH} $(SRCS) preinstall $(OBJS) $(RELS)
-
-preinstall: $(ARCH) $(PROJECT_INCLUDE)/rtems/score/targopts.h \
- ${PROJECT_RELEASE}/lib/bsp_specs
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
-# we will share the basic cpu file
- $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
-
-$(PROJECT_INCLUDE)/rtems/score/targopts.h: $(ARCH)/targopts.h-tmp
- $(INSTALL) -m 444 $(ARCH)/targopts.h-tmp $@
-
-# $(ARCH)/targopts.h-tmp rule is in leaf.cfg
-
-${PROJECT_RELEASE}/lib/bsp_specs: $(ARCH)/bsp_specs.tmp
- $(INSTALL) -m 444 $(ARCH)/bsp_specs.tmp $@
-
-# $(ARCH)/bsp_specs.tmp rule is in leaf.cfg
diff --git a/c/src/exec/score/cpu/m68k/asm.h b/c/src/exec/score/cpu/m68k/asm.h
deleted file mode 100644
index 456b213cb2..0000000000
--- a/c/src/exec/score/cpu/m68k/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 <rtems/score/targopts.h>
-#include <rtems/score/cpu.h>
-
-/*
- * 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/c/src/exec/score/cpu/m68k/cpu.c b/c/src/exec/score/cpu/m68k/cpu.c
deleted file mode 100644
index e714933350..0000000000
--- a/c/src/exec/score/cpu/m68k/cpu.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Motorola MC68xxx Dependent Source
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-
-/* _CPU_Initialize
- *
- * This routine performs processor dependent initialization.
- *
- * INPUT PARAMETERS:
- * cpu_table - CPU table to initialize
- * thread_dispatch - entry pointer to thread dispatcher
- *
- * OUTPUT PARAMETERS: NONE
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch) /* ignored on this CPU */
-)
-{
-#if ( M68K_HAS_VBR == 0 )
- /* fill the isr redirect table with the code to place the format/id
- onto the stack */
-
- unsigned32 slot;
-
- for (slot = 0; slot < CPU_INTERRUPT_NUMBER_OF_VECTORS; slot++)
- {
- _CPU_ISR_jump_table[slot].move_a7 = M68K_MOVE_A7;
- _CPU_ISR_jump_table[slot].format_id = slot << 2;
- _CPU_ISR_jump_table[slot].jmp = M68K_JMP;
- _CPU_ISR_jump_table[slot].isr_handler = (unsigned32) 0xDEADDEAD;
- }
-#endif /* M68K_HAS_VBR */
-
- _CPU_Table = *cpu_table;
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- unsigned32 level;
-
- m68k_get_interrupt_level( level );
-
- return level;
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- proc_ptr *interrupt_table = NULL;
-
-#if (M68K_HAS_FPSP_PACKAGE == 1)
- /*
- * If this vector being installed is one related to FP, then the
- * FPSP will install the handler itself and handle it completely
- * with no intervention from RTEMS.
- */
-
- if (*_FPSP_install_raw_handler &&
- (*_FPSP_install_raw_handler)(vector, new_handler, *old_handler))
- return;
-#endif
-
-
- /*
- * On CPU models without a VBR, it is necessary for there to be some
- * header code for each ISR which saves a register, loads the vector
- * number, and jumps to _ISR_Handler.
- */
-
- m68k_get_vbr( interrupt_table );
- *old_handler = interrupt_table[ vector ];
-#if ( M68K_HAS_VBR == 1 )
- interrupt_table[ vector ] = new_handler;
-#else
- _CPU_ISR_jump_table[vector].isr_handler = (unsigned32) new_handler;
- interrupt_table[ vector ] = (proc_ptr) &_CPU_ISR_jump_table[vector];
-#endif /* M68K_HAS_VBR */
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_vector
- *
- * This kernel routine installs the RTEMS handler for the
- * specified vector.
- *
- * Input parameters:
- * vector - interrupt vector number
- * new_handler - replacement ISR for this vector number
- * old_handler - former 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 ];
-
- _CPU_ISR_install_raw_handler( vector, _ISR_Handler, &ignored );
-
- _ISR_Vector_table[ vector ] = new_handler;
-}
-
-
-/*PAGE
- *
- * _CPU_Install_interrupt_stack
- */
-
-void _CPU_Install_interrupt_stack( void )
-{
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
- void *isp = _CPU_Interrupt_stack_high;
-
- asm volatile ( "movec %0,%%isp" : "=r" (isp) : "0" (isp) );
-#endif
-}
-
-#if ( M68K_HAS_BFFFO != 1 )
-/*
- * Returns table for duplication of the BFFFO instruction (16 bits only)
- */
-const unsigned char __BFFFOtable[256] = {
- 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 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,
- 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, 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, 0, 0
-};
-#endif
-
-/*PAGE
- *
- * The following code context switches the software FPU emulation
- * code provided with GCC.
- */
-
-#if (CPU_SOFTWARE_FP == TRUE)
-extern Context_Control_fp _fpCCR;
-
-void CPU_Context_save_fp (void **fp_context_ptr)
-{
- Context_Control_fp *fp;
-
- fp = (Context_Control_fp *) *fp_context_ptr;
-
- *fp = _fpCCR;
-}
-
-void CPU_Context_restore_fp (void **fp_context_ptr)
-{
- Context_Control_fp *fp;
-
- fp = (Context_Control_fp *) *fp_context_ptr;
-
- _fpCCR = *fp;
-}
-#endif
-
diff --git a/c/src/exec/score/cpu/m68k/cpu.h b/c/src/exec/score/cpu/m68k/cpu.h
deleted file mode 100644
index 743677a944..0000000000
--- a/c/src/exec/score/cpu/m68k/cpu.h
+++ /dev/null
@@ -1,647 +0,0 @@
-/* cpu.h
- *
- * This include file contains information pertaining to the Motorola
- * m68xxx processor family.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_h
-#define __CPU_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/m68k.h> /* pick up machine definitions */
-#ifndef ASM
-#include <rtems/score/m68ktypes.h>
-#endif
-
-/* conditional compilation parameters */
-
-#define CPU_INLINE_ENABLE_DISPATCH TRUE
-#define CPU_UNROLL_ENQUEUE_PRIORITY FALSE
-
-/*
- * Use the m68k's hardware interrupt stack support and have the
- * interrupt manager allocate the memory for it.
- */
-
-#if ( M68K_HAS_SEPARATE_STACKS == 1)
-#define CPU_HAS_SOFTWARE_INTERRUPT_STACK 0
-#define CPU_HAS_HARDWARE_INTERRUPT_STACK 1
-#else
-#define CPU_HAS_SOFTWARE_INTERRUPT_STACK 1
-#define CPU_HAS_HARDWARE_INTERRUPT_STACK 0
-#endif
-#define CPU_ALLOCATE_INTERRUPT_STACK 1
-
-/*
- * Does the RTEMS invoke the user's ISR with the vector number and
- * a pointer to the saved interrupt frame (1) or just the vector
- * number (0)?
- */
-
-#define CPU_ISR_PASSES_FRAME_POINTER 0
-
-/*
- * Some family members have no FP, some have an FPU such as the
- * MC68881/MC68882 for the MC68020, others have it built in (MC68030, 040).
- *
- * NOTE: If on a CPU without hardware FP, then one can use software
- * emulation. The gcc software FP emulation code has data which
- * must be contexted switched on a per task basis.
- */
-
-#if ( M68K_HAS_FPU == 1 )
-#define CPU_HARDWARE_FP TRUE
-#define CPU_SOFTWARE_FP FALSE
-#else
-#define CPU_HARDWARE_FP FALSE
-#if defined(__GCC__)
-#define CPU_SOFTWARE_FP TRUE
-#else
-#define CPU_SOFTWARE_FP FALSE
-#endif
-#endif
-
-/*
- * All tasks are not by default floating point tasks on this CPU.
- * The IDLE task does not have a floating point context on this CPU.
- * It is safe to use the deferred floating point context switch
- * algorithm on this CPU.
- */
-
-#define CPU_ALL_TASKS_ARE_FP FALSE
-#define CPU_IDLE_TASK_IS_FP FALSE
-#define CPU_USE_DEFERRED_FP_SWITCH TRUE
-
-#define CPU_PROVIDES_IDLE_THREAD_BODY FALSE
-#define CPU_STACK_GROWS_UP FALSE
-#define CPU_STRUCTURE_ALIGNMENT
-
-/*
- * Define what is required to specify how the network to host conversion
- * routines are handled.
- */
-
-#define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE
-#define CPU_BIG_ENDIAN TRUE
-#define CPU_LITTLE_ENDIAN FALSE
-
-#ifndef ASM
-/* structures */
-
-/*
- * Basic integer context for the m68k family.
- */
-
-typedef struct {
- unsigned32 sr; /* (sr) status register */
- unsigned32 d2; /* (d2) data register 2 */
- unsigned32 d3; /* (d3) data register 3 */
- unsigned32 d4; /* (d4) data register 4 */
- unsigned32 d5; /* (d5) data register 5 */
- unsigned32 d6; /* (d6) data register 6 */
- unsigned32 d7; /* (d7) data register 7 */
- void *a2; /* (a2) address register 2 */
- void *a3; /* (a3) address register 3 */
- void *a4; /* (a4) address register 4 */
- void *a5; /* (a5) address register 5 */
- void *a6; /* (a6) address register 6 */
- void *a7_msp; /* (a7) master stack pointer */
-} Context_Control;
-
-/*
- * Floating point context ares
- */
-
-#if (CPU_SOFTWARE_FP == TRUE)
-
-/*
- * This is the same as gcc's view of the software FP condition code
- * register _fpCCR. The implementation of the emulation code is
- * in the gcc-VERSION/config/m68k directory. This structure is
- * correct as of gcc 2.7.2.2.
- */
-
-typedef struct {
- unsigned16 _exception_bits;
- unsigned16 _trap_enable_bits;
- unsigned16 _sticky_bits;
- unsigned16 _rounding_mode;
- unsigned16 _format;
- unsigned16 _last_operation;
- union {
- float sf;
- double df;
- } _operand1;
- union {
- float sf;
- double df;
- } _operand2;
-} Context_Control_fp;
-
-#else
-
-/*
- * FP context save area for the M68881/M68882 numeric coprocessors.
- */
-
-typedef struct {
- unsigned8 fp_save_area[332]; /* 216 bytes for FSAVE/FRESTORE */
- /* 96 bytes for FMOVEM FP0-7 */
- /* 12 bytes for FMOVEM CREGS */
- /* 4 bytes for non-null flag */
-} Context_Control_fp;
-#endif
-
-/*
- * The following structure defines the set of information saved
- * on the current stack by RTEMS upon receipt of each interrupt.
- */
-
-typedef struct {
- unsigned32 TBD; /* XXX Fix for this CPU */
-} CPU_Interrupt_frame;
-
-/*
- * The following table contains the information required to configure
- * the m68k specific parameters.
- */
-
-typedef struct {
- void (*pretasking_hook)( void );
- void (*predriver_hook)( void );
- void (*postdriver_hook)( void );
- void (*idle_task)( void );
- boolean do_zero_of_workspace;
- unsigned32 idle_task_stack_size;
- unsigned32 interrupt_stack_size;
- unsigned32 extra_mpci_receive_server_stack;
- void * (*stack_allocate_hook)( unsigned32 );
- void (*stack_free_hook)( void* );
- /* end of fields required on all CPUs */
-
- m68k_isr *interrupt_vector_table;
-} rtems_cpu_table;
-
-/* variables */
-
-SCORE_EXTERN void *_CPU_Interrupt_stack_low;
-SCORE_EXTERN void *_CPU_Interrupt_stack_high;
-
-extern char _VBR[];
-
-#if ( M68K_HAS_VBR == 0 )
-
-/*
- * Table of ISR handler entries that resides in RAM. The FORMAT/ID is
- * pushed onto the stack. This is not is the same order as VBR processors.
- * The ISR handler takes the format and uses it for dispatching the user
- * handler.
- *
- * FIXME : should be moved to below CPU_INTERRUPT_NUMBER_OF_VECTORS
- *
- */
-
-typedef struct {
- unsigned16 move_a7; /* move #FORMAT_ID,%a7@- */
- unsigned16 format_id;
- unsigned16 jmp; /* jmp _ISR_Handlers */
- unsigned32 isr_handler;
-} _CPU_ISR_handler_entry;
-
-#define M68K_MOVE_A7 0x3F3C
-#define M68K_JMP 0x4EF9
-
- /* points to jsr-exception-table in targets wo/ VBR register */
-SCORE_EXTERN _CPU_ISR_handler_entry _CPU_ISR_jump_table[256];
-
-#endif /* M68K_HAS_VBR */
-#endif /* ASM */
-
-/* constants */
-
-/*
- * This defines the number of levels and the mask used to pick those
- * bits out of a thread mode.
- */
-
-#define CPU_MODES_INTERRUPT_LEVEL 0x00000007 /* interrupt level in mode */
-#define CPU_MODES_INTERRUPT_MASK 0x00000007 /* interrupt level in mode */
-
-/*
- * context size area for floating point
- */
-
-#define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp )
-
-/*
- * extra stack required by the MPCI receive server thread
- */
-
-#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 1024
-
-/*
- * m68k family supports 256 distinct vectors.
- */
-
-#define CPU_INTERRUPT_NUMBER_OF_VECTORS 256
-#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1)
-
-/*
- * Minimum size of a thread's stack.
- */
-
-#define CPU_STACK_MINIMUM_SIZE 2048
-
-/*
- * m68k is pretty tolerant of alignment. Just put things on 4 byte boundaries.
- */
-
-#define CPU_ALIGNMENT 4
-#define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT
-#define CPU_PARTITION_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * On m68k thread stacks require no further alignment after allocation
- * from the Workspace.
- */
-
-#define CPU_STACK_ALIGNMENT 0
-
-#ifndef ASM
-
-/* macros */
-
-/*
- * ISR handler macros
- *
- * These macros perform the following functions:
- * + disable all maskable CPU interrupts
- * + restore previous interrupt level (enable)
- * + temporarily restore interrupts (flash)
- * + set a particular level
- */
-
-#define _CPU_ISR_Disable( _level ) \
- m68k_disable_interrupts( _level )
-
-#define _CPU_ISR_Enable( _level ) \
- m68k_enable_interrupts( _level )
-
-#define _CPU_ISR_Flash( _level ) \
- m68k_flash_interrupts( _level )
-
-#define _CPU_ISR_Set_level( _newlevel ) \
- m68k_set_interrupt_level( _newlevel )
-
-unsigned32 _CPU_ISR_Get_level( void );
-
-/* end of ISR handler macros */
-
-/*
- * Context handler macros
- *
- * These macros perform the following functions:
- * + initialize a context area
- * + restart the current thread
- * + calculate the initial pointer into a FP context area
- * + initialize an FP context area
- */
-
-#define _CPU_Context_Initialize( _the_context, _stack_base, _size, \
- _isr, _entry_point, _is_fp ) \
- do { \
- unsigned32 _stack; \
- \
- (_the_context)->sr = 0x3000 | ((_isr) << 8); \
- _stack = (unsigned32)(_stack_base) + (_size) - 4; \
- (_the_context)->a7_msp = (void *)_stack; \
- *(void **)_stack = (void *)(_entry_point); \
- } while ( 0 )
-
-#define _CPU_Context_Restart_self( _the_context ) \
- { asm volatile( "movew %0,%%sr ; " \
- "moval %1,%%a7 ; " \
- "rts" \
- : "=d" ((_the_context)->sr), "=d" ((_the_context)->a7_msp) \
- : "0" ((_the_context)->sr), "1" ((_the_context)->a7_msp) ); \
- }
-
-/*
- * Floating Point Context Area Support routines
- */
-
-#if (CPU_SOFTWARE_FP == TRUE)
-
-/*
- * This software FP implementation is only for GCC.
- */
-
-#define _CPU_Context_Fp_start( _base, _offset ) \
- ((void *) _Addresses_Add_offset( (_base), (_offset) ) )
-
-
-#define _CPU_Context_Initialize_fp( _fp_area ) \
- { \
- Context_Control_fp *_fp; \
- _fp = *(Context_Control_fp **)_fp_area; \
- _fp->_exception_bits = 0; \
- _fp->_trap_enable_bits = 0; \
- _fp->_sticky_bits = 0; \
- _fp->_rounding_mode = 0; /* ROUND_TO_NEAREST */ \
- _fp->_format = 0; /* NIL */ \
- _fp->_last_operation = 0; /* NOOP */ \
- _fp->_operand1.df = 0; \
- _fp->_operand2.df = 0; \
- }
-#else
-#define _CPU_Context_Fp_start( _base, _offset ) \
- ((void *) \
- _Addresses_Add_offset( \
- (_base), \
- (_offset) + CPU_CONTEXT_FP_SIZE - 4 \
- ) \
- )
-
-#define _CPU_Context_Initialize_fp( _fp_area ) \
- { unsigned32 *_fp_context = (unsigned32 *)*(_fp_area); \
- \
- *(--(_fp_context)) = 0; \
- *(_fp_area) = (unsigned8 *)(_fp_context); \
- }
-#endif
-
-/* end of Context handler macros */
-
-/*
- * Fatal Error manager macros
- *
- * These macros perform the following functions:
- * + disable interrupts and halt the CPU
- */
-
-#if ( M68K_COLDFIRE_ARCH == 1 )
-#define _CPU_Fatal_halt( _error ) \
- { asm volatile( "move.w %%sr,%%d0\n\t" \
- "or.l %2,%%d0\n\t" \
- "move.w %%d0,%%sr\n\t" \
- "move.l %1,%%d0\n\t" \
- "move.l #0xDEADBEEF,%%d1\n\t" \
- "halt" \
- : "=g" (_error) \
- : "0" (_error), "d"(0x0700) \
- : "d0", "d1" ); \
- }
-#else
-#define _CPU_Fatal_halt( _error ) \
- { asm volatile( "movl %0,%%d0; " \
- "orw #0x0700,%%sr; " \
- "stop #0x2700" : "=d" ((_error)) : "0" ((_error)) ); \
- }
-#endif
-
-/* end of Fatal Error manager macros */
-
-/*
- * Bitfield handler macros
- *
- * These macros perform the following functions:
- * + scan for the highest numbered (MSB) set in a 16 bit bitfield
- *
- * NOTE:
- *
- * It appears that on the M68020 bitfield are always 32 bits wide
- * when in a register. This code forces the bitfield to be in
- * memory (it really always is anyway). This allows us to
- * have a real 16 bit wide bitfield which operates "correctly."
- */
-
-#define CPU_USE_GENERIC_BITFIELD_CODE FALSE
-#define CPU_USE_GENERIC_BITFIELD_DATA FALSE
-
-#if ( M68K_HAS_BFFFO == 1 )
-
-#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
- asm volatile( "bfffo (%1),#0,#16,%0" : "=d" (_output) : "a" (&_value));
-#else
-
-/* duplicates BFFFO results for 16 bits (i.e., 15-(_priority) in
- _CPU_Priority_bits_index is not needed), handles the 0 case, and
- does not molest _value -- jsg */
-#if ( M68K_COLDFIRE_ARCH == 1 )
-#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
- { \
- extern const unsigned char __BFFFOtable[256]; \
- register int dumby; \
- \
- asm volatile ( \
- " clr.l %1\n" \
- " move.w %2,%1\n" \
- " lsr.l #8,%1\n" \
- " beq.s 1f\n" \
- " move.b (%3,%1),%0\n" \
- " bra.s 0f\n" \
- "1: move.w %2,%1\n" \
- " move.b (%3,%1),%0\n" \
- " addq.l #8,%0\n" \
- "0: and.l #0xff,%0\n" \
- : "=&d" ((_output)), "=&d" ((dumby)) \
- : "d" ((_value)), "ao" ((__BFFFOtable)) \
- : "cc" ) ; \
- }
-#elif ( M68K_HAS_EXTB_L == 1 )
-#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
- { \
- extern const unsigned char __BFFFOtable[256]; \
- register int dumby; \
- \
- asm volatile ( " move.w %2,%1\n" \
- " lsr.w #8,%1\n" \
- " beq.s 1f\n" \
- " move.b (%3,%1.w),%0\n" \
- " extb.l %0\n" \
- " bra.s 0f\n" \
- "1: moveq.l #8,%0\n" \
- " add.b (%3,%2.w),%0\n" \
- "0:\n" \
- : "=&d" ((_output)), "=&d" ((dumby)) \
- : "d" ((_value)), "ao" ((__BFFFOtable)) \
- : "cc" ) ; \
- }
-#else
-#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
- { \
- extern const unsigned char __BFFFOtable[256]; \
- register int dumby; \
- \
- asm volatile ( " move.w %2,%1\n" \
- " lsr.w #8,%1\n" \
- " beq.s 1f\n" \
- " move.b (%3,%1.w),%0\n" \
- " and.l #0x000000ff,%0\n"\
- " bra.s 0f\n" \
- "1: moveq.l #8,%0\n" \
- " add.b (%3,%2.w),%0\n" \
- "0:\n" \
- : "=&d" ((_output)), "=&d" ((dumby)) \
- : "d" ((_value)), "ao" ((__BFFFOtable)) \
- : "cc" ) ; \
- }
-#endif
-
-#endif
-
-/* end of Bitfield handler macros */
-
-/*
- * Priority handler macros
- *
- * These macros perform the following functions:
- * + return a mask with the bit for this major/minor portion of
- * of thread priority set.
- * + translate the bit number returned by "Bitfield_find_first_bit"
- * into an index into the thread ready chain bit maps
- */
-
-#define _CPU_Priority_Mask( _bit_number ) \
- ( 0x8000 >> (_bit_number) )
-
-#define _CPU_Priority_bits_index( _priority ) \
- (_priority)
-
-/* end of Priority handler macros */
-
-/* functions */
-
-/*
- * _CPU_Initialize
- *
- * This routine performs CPU dependent initialization.
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch)
-);
-
-/*
- * _CPU_ISR_install_raw_handler
- *
- * This routine installs a "raw" interrupt handler directly into the
- * processor's vector table.
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_ISR_install_vector
- *
- * This routine installs an interrupt vector.
- */
-
-void _CPU_ISR_install_vector(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_Install_interrupt_stack
- *
- * This routine installs the hardware interrupt stack pointer.
- */
-
-void _CPU_Install_interrupt_stack( void );
-
-/*
- * _CPU_Context_switch
- *
- * This routine switches from the run context to the heir context.
- */
-
-void _CPU_Context_switch(
- Context_Control *run,
- Context_Control *heir
-);
-
-/*
- * _CPU_Context_save_fp
- *
- * This routine saves the floating point context passed to it.
- */
-
-void _CPU_Context_save_fp(
- void **fp_context_ptr
-);
-
-/*
- * _CPU_Context_restore_fp
- *
- * This routine restores the floating point context passed to it.
- */
-
-void _CPU_Context_restore_fp(
- void **fp_context_ptr
-);
-
-#if (M68K_HAS_FPSP_PACKAGE == 1)
-/*
- * Hooks for the Floating Point Support Package (FPSP) provided by Motorola
- *
- * NOTES:
- *
- * Motorola 68k family CPU's before the 68040 used a coprocessor
- * (68881 or 68882) to handle floating point. The 68040 has internal
- * floating point support -- but *not* the complete support provided by
- * the 68881 or 68882. The leftover functions are taken care of by the
- * M68040 Floating Point Support Package. Quoting from the MC68040
- * Microprocessors User's Manual, Section 9, Floating-Point Unit (MC68040):
- *
- * "When used with the M68040FPSP, the MC68040 FPU is fully
- * compliant with IEEE floating-point standards."
- *
- * M68KFPSPInstallExceptionHandlers is in libcpu/m68k/MODEL/fpsp and
- * is invoked early in the application code to insure that proper FP
- * behavior is installed. This is not left to the BSP to call, since
- * this would force all applications using that BSP to use FPSP which
- * is not necessarily desirable.
- *
- * There is a similar package for the 68060 but RTEMS does not yet
- * support the 68060.
- */
-
-void M68KFPSPInstallExceptionHandlers (void);
-
-SCORE_EXTERN int (*_FPSP_install_raw_handler)(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-#endif
-
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/cpu/m68k/cpu_asm.s b/c/src/exec/score/cpu/m68k/cpu_asm.s
deleted file mode 100644
index 03747222e5..0000000000
--- a/c/src/exec/score/cpu/m68k/cpu_asm.s
+++ /dev/null
@@ -1,291 +0,0 @@
-/* cpu_asm.s
- *
- * This file contains all assembly code for the MC68020 implementation
- * of RTEMS.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <asm.h>
-
- .text
-
-/* void _CPU_Context_switch( run_context, heir_context )
- *
- * This routine performs a normal non-FP context.
- */
-
- .align 4
- .global SYM (_CPU_Context_switch)
-
-.set RUNCONTEXT_ARG, 4 | save context argument
-.set HEIRCONTEXT_ARG, 8 | restore context argument
-
-SYM (_CPU_Context_switch):
- moval a7@(RUNCONTEXT_ARG),a0| a0 = running thread context
- movw sr,d1 | d1 = status register
- movml d1-d7/a2-a7,a0@ | save context
-
- moval a7@(HEIRCONTEXT_ARG),a0| a0 = heir thread context
-restore: movml a0@,d1-d7/a2-a7 | restore context
- movw d1,sr | restore status register
- rts
-
-/*PAGE
- * void __CPU_Context_save_fp_context( &fp_context_ptr )
- * void __CPU_Context_restore_fp_context( &fp_context_ptr )
- *
- * These routines are used to context switch a MC68881 or MC68882.
- *
- * NOTE: Context save and restore code is based upon the code shown
- * on page 6-38 of the MC68881/68882 Users Manual (rev 1).
- *
- * CPU_FP_CONTEXT_SIZE is higher than expected to account for the
- * -1 pushed at end of this sequence.
- *
- * Neither of these entries is required if we have software FPU
- * emulation. But if we don't have an FPU or emulation, then
- * we need the stub versions of these routines.
- */
-
-#if (CPU_SOFTWARE_FP == FALSE)
-
-.set FPCONTEXT_ARG, 4 | save FP context argument
-
- .align 4
- .global SYM (_CPU_Context_save_fp)
-SYM (_CPU_Context_save_fp):
-#if ( M68K_HAS_FPU == 1 )
- moval a7@(FPCONTEXT_ARG),a1 | a1 = &ptr to context area
- moval a1@,a0 | a0 = Save context area
- fsave a0@- | save 68881/68882 state frame
- tstb a0@ | check for a null frame
- beq nosv | Yes, skip save of user model
- fmovem fp0-fp7,a0@- | save data registers (fp0-fp7)
- fmovem fpc/fps/fpi,a0@- | and save control registers
- movl #-1,a0@- | place not-null flag on stack
-nosv: movl a0,a1@ | save pointer to saved context
-#endif
- rts
-
- .align 4
- .global SYM (_CPU_Context_restore_fp)
-SYM (_CPU_Context_restore_fp):
-#if ( M68K_HAS_FPU == 1 )
- moval a7@(FPCONTEXT_ARG),a1 | a1 = &ptr to context area
- moval a1@,a0 | a0 = address of saved context
- tstb a0@ | Null context frame?
- beq norst | Yes, skip fp restore
- addql #4,a0 | throwaway non-null flag
- fmovem a0@+,fpc/fps/fpi | restore control registers
- fmovem a0@+,fp0-fp7 | restore data regs (fp0-fp7)
-norst: frestore a0@+ | restore the fp state frame
- movl a0,a1@ | save pointer to saved context
-#endif
- rts
-#endif
-
-/*PAGE
- * void _ISR_Handler()
- *
- * This routine provides the RTEMS interrupt management.
- *
- * NOTE:
- * Upon entry, the master stack will contain an interrupt stack frame
- * back to the interrupted thread and the interrupt stack will contain
- * a throwaway interrupt stack frame. If dispatching is enabled, this
- * is the outer most interrupt, and (a context switch is necessary or
- * the current thread has signals), then set up the master stack to
- * transfer control to the interrupt dispatcher.
- */
-
-/*
- * With this approach, lower priority interrupts may
- * execute twice if a higher priority interrupt is
- * acknowledged before _Thread_Dispatch_disable is
- * incremented and the higher priority interrupt
- * performs a context switch after executing. The lower
- * priority interrupt will execute (1) at the end of the
- * higher priority interrupt in the new context if
- * permitted by the new interrupt level mask, and (2) when
- * the original context regains the cpu.
- */
-
-#if ( M68K_COLDFIRE_ARCH == 1 )
-.set SR_OFFSET, 2 | Status register offset
-.set PC_OFFSET, 4 | Program Counter offset
-.set FVO_OFFSET, 0 | Format/vector offset
-#elif ( M68K_HAS_VBR == 1)
-.set SR_OFFSET, 0 | Status register offset
-.set PC_OFFSET, 2 | Program Counter offset
-.set FVO_OFFSET, 6 | Format/vector offset
-#else
-.set SR_OFFSET, 2 | Status register offset
-.set PC_OFFSET, 4 | Program Counter offset
-.set FVO_OFFSET, 0 | Format/vector offset placed in the stack
-#endif /* M68K_HAS_VBR */
-
-.set SAVED, 16 | space for saved registers
-
- .align 4
- .global SYM (_ISR_Handler)
-
-SYM (_ISR_Handler):
- addql #1,SYM (_Thread_Dispatch_disable_level) | disable multitasking
-#if ( M68K_COLDFIRE_ARCH == 0 )
- moveml d0-d1/a0-a1,a7@- | save d0-d1,a0-a1
- movew a7@(SAVED+FVO_OFFSET),d0 | d0 = F/VO
- andl #0x0fff,d0 | d0 = vector offset in vbr
-#else
- lea a7@(-SAVED),a7
- movm.l d0-d1/a0-a1,a7@ | save d0-d1,a0-a1
- movew a7@(SAVED+FVO_OFFSET),d0 | d0 = F/VO
- andl #0x0ffc,d0 | d0 = vector offset in vbr
-#endif
-
-
-#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 )
- #if ( M68K_COLDFIRE_ARCH == 0 )
- movew sr,d1 | Save status register
- oriw #0x700,sr | Disable interrupts
- #else
- move.l d0,a7@- | Save d0 value
- move.l #0x700,d0 | Load in disable ints value
- move.w sr,d1 | Grab SR
- or.l d1,d0 | Create new SR
- move.w d0,sr | Disable interrupts
- move.l a7@+,d0 | Restore d0 value
- #endif
-
- tstl SYM (_ISR_Nest_level) | Interrupting an interrupt handler?
- bne 1f | Yes, just skip over stack switch code
- movel SYM(_CPU_Interrupt_stack_high),a0 | End of interrupt stack
- movel a7,a0@- | Save task stack pointer
- movel a0,a7 | Switch to interrupt stack
-1:
- addql #1,SYM(_ISR_Nest_level) | one nest level deeper
- movew d1,sr | Restore status register
-#else
- addql #1,SYM (_ISR_Nest_level) | one nest level deeper
-#endif /* CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 */
-
-#if ( M68K_HAS_PREINDEXING == 1 )
- movel @( SYM (_ISR_Vector_table),d0:w:1),a0| fetch the ISR
-#else
- movel # SYM (_ISR_Vector_table),a0 | a0 = base of RTEMS table
- addal d0,a0 | a0 = address of vector
- movel (a0),a0 | a0 = address of user routine
-#endif
-
- lsrl #2,d0 | d0 = vector number
- movel d0,a7@- | push vector number
- jbsr a0@ | invoke the user ISR
- addql #4,a7 | remove vector number
-
-#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 )
- #if ( M68K_COLDFIRE_ARCH == 0 )
- movew sr,d0 | Save status register
- oriw #0x700,sr | Disable interrupts
- #else
- move.l #0x700,d1 | Load in disable int value
- move.w sr,d0 | Grab SR
- or.l d0,d1 | Create new SR
- move.w d1,sr | Load to disable interrupts
- #endif
-
- subql #1,SYM(_ISR_Nest_level) | Reduce interrupt-nesting count
- bne 1f | Skip if return to interrupt
- movel (a7),a7 | Restore task stack pointer
-1:
- movew d0,sr | Restore status register
-#else
- subql #1,SYM (_ISR_Nest_level) | one less nest level
-#endif /* CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 */
-
- subql #1,SYM (_Thread_Dispatch_disable_level)
- | unnest multitasking
- bne exit | If dispatch disabled, exit
-
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
- movew #0xf000,d0 | isolate format nibble
- andw a7@(SAVED+FVO_OFFSET),d0 | get F/VO
- cmpiw #0x1000,d0 | is it a throwaway isf?
- bne exit | NOT outer level, so branch
-#endif
-
- tstl SYM (_Context_Switch_necessary)
- | Is thread switch necessary?
- bne bframe | Yes, invoke dispatcher
-
- tstl SYM (_ISR_Signals_to_thread_executing)
- | signals sent to Run_thread
- | while in interrupt handler?
- beq exit | No, then exit
-
-
-bframe: clrl SYM (_ISR_Signals_to_thread_executing)
- | If sent, will be processed
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
- movec msp,a0 | a0 = master stack pointer
- movew #0,a0@- | push format word
- movel #SYM(_ISR_Dispatch),a0@- | push return addr
- movew a0@(6),a0@- | push saved sr
- movec a0,msp | set master stack pointer
-#else
- jsr SYM (_Thread_Dispatch) | Perform context switch
-#endif
-
-#if ( M68K_COLDFIRE_ARCH == 0 )
-exit: moveml a7@+,d0-d1/a0-a1 | restore d0-d1,a0-a1
-#else
-exit: moveml a7@,d0-d1/a0-a1 | restore d0-d1,a0-a1
- lea a7@(SAVED),a7
-#endif
-
-#if ( M68K_HAS_VBR == 0 )
- addql #2,a7 | pop format/id
-#endif /* M68K_HAS_VBR */
- rte | return to thread
- | OR _Isr_dispatch
-
-/*PAGE
- * void _ISR_Dispatch()
- *
- * Entry point from the outermost interrupt service routine exit.
- * The current stack is the supervisor mode stack if this processor
- * has separate stacks.
- *
- * 1. save all registers not preserved across C calls.
- * 2. invoke the _Thread_Dispatch routine to switch tasks
- * or a signal to the currently executing task.
- * 3. restore all registers not preserved across C calls.
- * 4. return from interrupt
- */
-
- .global SYM (_ISR_Dispatch)
-SYM (_ISR_Dispatch):
-#if ( M68K_COLDFIRE_ARCH == 0 )
- movml d0-d1/a0-a1,a7@-
- jsr SYM (_Thread_Dispatch)
- movml a7@+,d0-d1/a0-a1
-#else
- lea a7@(-SAVED),a7
- movml d0-d1/a0-a1,a7@
- jsr SYM (_Thread_Dispatch)
- movml a7@,d0-d1/a0-a1
- lea a7@(SAVED),a7
-#endif
-
-#if ( M68K_HAS_VBR == 0 )
- addql #2,a7 | pop format/id
-#endif /* M68K_HAS_VBR */
- rte
diff --git a/c/src/exec/score/cpu/m68k/m68302.h b/c/src/exec/score/cpu/m68k/m68302.h
deleted file mode 100644
index 084ceac034..0000000000
--- a/c/src/exec/score/cpu/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 */
- 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/c/src/exec/score/cpu/m68k/m68360.h b/c/src/exec/score/cpu/m68k/m68360.h
deleted file mode 100644
index 84687c49fa..0000000000
--- a/c/src/exec/score/cpu/m68k/m68360.h
+++ /dev/null
@@ -1,880 +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_ {
- rtems_unsigned32 br;
- rtems_unsigned32 or;
- rtems_unsigned32 _pad[2];
-} m360MEMCRegisters_t;
-
-/*
- * Serial Communications Controller registers
- */
-typedef struct m360SCCRegisters_ {
- rtems_unsigned32 gsmr_l;
- rtems_unsigned32 gsmr_h;
- rtems_unsigned16 psmr;
- rtems_unsigned16 _pad0;
- rtems_unsigned16 todr;
- rtems_unsigned16 dsr;
- rtems_unsigned16 scce;
- rtems_unsigned16 _pad1;
- rtems_unsigned16 sccm;
- rtems_unsigned8 _pad2;
- rtems_unsigned8 sccs;
- rtems_unsigned32 _pad3[2];
-} m360SCCRegisters_t;
-
-/*
- * Serial Management Controller registers
- */
-typedef struct m360SMCRegisters_ {
- rtems_unsigned16 _pad0;
- rtems_unsigned16 smcmr;
- rtems_unsigned16 _pad1;
- rtems_unsigned8 smce;
- rtems_unsigned8 _pad2;
- rtems_unsigned16 _pad3;
- rtems_unsigned8 smcm;
- rtems_unsigned8 _pad4;
- rtems_unsigned32 _pad5;
-} m360SMCRegisters_t;
-
-
-/*
- *************************************************************************
- * Miscellaneous Parameters *
- *************************************************************************
- */
-typedef struct m360MiscParms_ {
- rtems_unsigned16 rev_num;
- rtems_unsigned16 _res1;
- rtems_unsigned32 _res2;
- rtems_unsigned32 _res3;
-} m360MiscParms_t;
-
-/*
- *************************************************************************
- * RISC Timers *
- *************************************************************************
- */
-typedef struct m360TimerParms_ {
- rtems_unsigned16 tm_base;
- rtems_unsigned16 _tm_ptr;
- rtems_unsigned16 _r_tmr;
- rtems_unsigned16 _r_tmv;
- rtems_unsigned32 tm_cmd;
- rtems_unsigned32 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_ {
- rtems_unsigned16 ibase;
- rtems_unsigned16 ibptr;
- rtems_unsigned32 _istate;
- rtems_unsigned32 _itemp;
-} m360IDMAparms_t;
-
-/*
- *************************************************************************
- * Serial Communication Controllers *
- *************************************************************************
- */
-typedef struct m360SCCparms_ {
- rtems_unsigned16 rbase;
- rtems_unsigned16 tbase;
- rtems_unsigned8 rfcr;
- rtems_unsigned8 tfcr;
- rtems_unsigned16 mrblr;
- rtems_unsigned32 _rstate;
- rtems_unsigned32 _pad0;
- rtems_unsigned16 _rbptr;
- rtems_unsigned16 _pad1;
- rtems_unsigned32 _pad2;
- rtems_unsigned32 _tstate;
- rtems_unsigned32 _pad3;
- rtems_unsigned16 _tbptr;
- rtems_unsigned16 _pad4;
- rtems_unsigned32 _pad5;
- rtems_unsigned32 _rcrc;
- rtems_unsigned32 _tcrc;
- union {
- struct {
- rtems_unsigned32 _res0;
- rtems_unsigned32 _res1;
- rtems_unsigned16 max_idl;
- rtems_unsigned16 _idlc;
- rtems_unsigned16 brkcr;
- rtems_unsigned16 parec;
- rtems_unsigned16 frmec;
- rtems_unsigned16 nosec;
- rtems_unsigned16 brkec;
- rtems_unsigned16 brklen;
- rtems_unsigned16 uaddr[2];
- rtems_unsigned16 _rtemp;
- rtems_unsigned16 toseq;
- rtems_unsigned16 character[8];
- rtems_unsigned16 rccm;
- rtems_unsigned16 rccr;
- rtems_unsigned16 rlbc;
- } uart;
- } un;
-} m360SCCparms_t;
-
-typedef struct m360SCCENparms_ {
- rtems_unsigned16 rbase;
- rtems_unsigned16 tbase;
- rtems_unsigned8 rfcr;
- rtems_unsigned8 tfcr;
- rtems_unsigned16 mrblr;
- rtems_unsigned32 _rstate;
- rtems_unsigned32 _pad0;
- rtems_unsigned16 _rbptr;
- rtems_unsigned16 _pad1;
- rtems_unsigned32 _pad2;
- rtems_unsigned32 _tstate;
- rtems_unsigned32 _pad3;
- rtems_unsigned16 _tbptr;
- rtems_unsigned16 _pad4;
- rtems_unsigned32 _pad5;
- rtems_unsigned32 _rcrc;
- rtems_unsigned32 _tcrc;
- union {
- struct {
- rtems_unsigned32 _res0;
- rtems_unsigned32 _res1;
- rtems_unsigned16 max_idl;
- rtems_unsigned16 _idlc;
- rtems_unsigned16 brkcr;
- rtems_unsigned16 parec;
- rtems_unsigned16 frmec;
- rtems_unsigned16 nosec;
- rtems_unsigned16 brkec;
- rtems_unsigned16 brklen;
- rtems_unsigned16 uaddr[2];
- rtems_unsigned16 _rtemp;
- rtems_unsigned16 toseq;
- rtems_unsigned16 character[8];
- rtems_unsigned16 rccm;
- rtems_unsigned16 rccr;
- rtems_unsigned16 rlbc;
- } uart;
- struct {
- rtems_unsigned32 c_pres;
- rtems_unsigned32 c_mask;
- rtems_unsigned32 crcec;
- rtems_unsigned32 alec;
- rtems_unsigned32 disfc;
- rtems_unsigned16 pads;
- rtems_unsigned16 ret_lim;
- rtems_unsigned16 _ret_cnt;
- rtems_unsigned16 mflr;
- rtems_unsigned16 minflr;
- rtems_unsigned16 maxd1;
- rtems_unsigned16 maxd2;
- rtems_unsigned16 _maxd;
- rtems_unsigned16 dma_cnt;
- rtems_unsigned16 _max_b;
- rtems_unsigned16 gaddr1;
- rtems_unsigned16 gaddr2;
- rtems_unsigned16 gaddr3;
- rtems_unsigned16 gaddr4;
- rtems_unsigned32 _tbuf0data0;
- rtems_unsigned32 _tbuf0data1;
- rtems_unsigned32 _tbuf0rba0;
- rtems_unsigned32 _tbuf0crc;
- rtems_unsigned16 _tbuf0bcnt;
- rtems_unsigned16 paddr_h;
- rtems_unsigned16 paddr_m;
- rtems_unsigned16 paddr_l;
- rtems_unsigned16 p_per;
- rtems_unsigned16 _rfbd_ptr;
- rtems_unsigned16 _tfbd_ptr;
- rtems_unsigned16 _tlbd_ptr;
- rtems_unsigned32 _tbuf1data0;
- rtems_unsigned32 _tbuf1data1;
- rtems_unsigned32 _tbuf1rba0;
- rtems_unsigned32 _tbuf1crc;
- rtems_unsigned16 _tbuf1bcnt;
- rtems_unsigned16 _tx_len;
- rtems_unsigned16 iaddr1;
- rtems_unsigned16 iaddr2;
- rtems_unsigned16 iaddr3;
- rtems_unsigned16 iaddr4;
- rtems_unsigned16 _boff_cnt;
- rtems_unsigned16 taddr_l;
- rtems_unsigned16 taddr_m;
- rtems_unsigned16 taddr_h;
- } ethernet;
- } 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_ {
- rtems_unsigned16 rbase;
- rtems_unsigned16 tbase;
- rtems_unsigned8 rfcr;
- rtems_unsigned8 tfcr;
- rtems_unsigned16 mrblr;
- rtems_unsigned32 _rstate;
- rtems_unsigned32 _pad0;
- rtems_unsigned16 _rbptr;
- rtems_unsigned16 _pad1;
- rtems_unsigned32 _pad2;
- rtems_unsigned32 _tstate;
- rtems_unsigned32 _pad3;
- rtems_unsigned16 _tbptr;
- rtems_unsigned16 _pad4;
- rtems_unsigned32 _pad5;
- union {
- struct {
- rtems_unsigned16 max_idl;
- rtems_unsigned16 _pad0;
- rtems_unsigned16 brklen;
- rtems_unsigned16 brkec;
- rtems_unsigned16 brkcr;
- rtems_unsigned16 _r_mask;
- } uart;
- struct {
- rtems_unsigned16 _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_ {
- rtems_unsigned16 rbase;
- rtems_unsigned16 tbase;
- rtems_unsigned8 rfcr;
- rtems_unsigned8 tfcr;
- rtems_unsigned16 mrblr;
- rtems_unsigned32 _rstate;
- rtems_unsigned32 _pad0;
- rtems_unsigned16 _rbptr;
- rtems_unsigned16 _pad1;
- rtems_unsigned32 _pad2;
- rtems_unsigned32 _tstate;
- rtems_unsigned32 _pad3;
- rtems_unsigned16 _tbptr;
- rtems_unsigned16 _pad4;
- rtems_unsigned32 _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_ {
- rtems_unsigned16 status;
- rtems_unsigned16 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_ {
- rtems_unsigned16 status;
- rtems_unsigned16 _pad;
- rtems_unsigned32 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
- */
- rtems_unsigned8 dpram0[0x400]; /* Microcode program */
- rtems_unsigned8 dpram1[0x200];
- rtems_unsigned8 dpram2[0x100]; /* Microcode scratch */
- rtems_unsigned8 dpram3[0x100]; /* Not on REV A or B masks */
- rtems_unsigned8 _rsv0[0xC00-0x800];
- m360SCCENparms_t scc1p;
- rtems_unsigned8 _rsv1[0xCB0-0xC00-sizeof(m360SCCENparms_t)];
- m360MiscParms_t miscp;
- rtems_unsigned8 _rsv2[0xD00-0xCB0-sizeof(m360MiscParms_t)];
- m360SCCparms_t scc2p;
- rtems_unsigned8 _rsv3[0xD80-0xD00-sizeof(m360SCCparms_t)];
- m360SPIparms_t spip;
- rtems_unsigned8 _rsv4[0xDB0-0xD80-sizeof(m360SPIparms_t)];
- m360TimerParms_t tmp;
- rtems_unsigned8 _rsv5[0xE00-0xDB0-sizeof(m360TimerParms_t)];
- m360SCCparms_t scc3p;
- rtems_unsigned8 _rsv6[0xE70-0xE00-sizeof(m360SCCparms_t)];
- m360IDMAparms_t idma1p;
- rtems_unsigned8 _rsv7[0xE80-0xE70-sizeof(m360IDMAparms_t)];
- m360SMCparms_t smc1p;
- rtems_unsigned8 _rsv8[0xF00-0xE80-sizeof(m360SMCparms_t)];
- m360SCCparms_t scc4p;
- rtems_unsigned8 _rsv9[0xF70-0xF00-sizeof(m360SCCparms_t)];
- m360IDMAparms_t idma2p;
- rtems_unsigned8 _rsv10[0xF80-0xF70-sizeof(m360IDMAparms_t)];
- m360SMCparms_t smc2p;
- rtems_unsigned8 _rsv11[0x1000-0xF80-sizeof(m360SMCparms_t)];
-
- /*
- * SIM Block
- */
- rtems_unsigned32 mcr;
- rtems_unsigned32 _pad00;
- rtems_unsigned8 avr;
- rtems_unsigned8 rsr;
- rtems_unsigned16 _pad01;
- rtems_unsigned8 clkocr;
- rtems_unsigned8 _pad02;
- rtems_unsigned16 _pad03;
- rtems_unsigned16 pllcr;
- rtems_unsigned16 _pad04;
- rtems_unsigned16 cdvcr;
- rtems_unsigned16 pepar;
- rtems_unsigned32 _pad05[2];
- rtems_unsigned16 _pad06;
- rtems_unsigned8 sypcr;
- rtems_unsigned8 swiv;
- rtems_unsigned16 _pad07;
- rtems_unsigned16 picr;
- rtems_unsigned16 _pad08;
- rtems_unsigned16 pitr;
- rtems_unsigned16 _pad09;
- rtems_unsigned8 _pad10;
- rtems_unsigned8 swsr;
- rtems_unsigned32 bkar;
- rtems_unsigned32 bcar;
- rtems_unsigned32 _pad11[2];
-
- /*
- * MEMC Block
- */
- rtems_unsigned32 gmr;
- rtems_unsigned16 mstat;
- rtems_unsigned16 _pad12;
- rtems_unsigned32 _pad13[2];
- m360MEMCRegisters_t memc[8];
- rtems_unsigned8 _pad14[0xF0-0xD0];
- rtems_unsigned8 _pad15[0x100-0xF0];
- rtems_unsigned8 _pad16[0x500-0x100];
-
- /*
- * IDMA1 Block
- */
- rtems_unsigned16 iccr;
- rtems_unsigned16 _pad17;
- rtems_unsigned16 cmr1;
- rtems_unsigned16 _pad18;
- rtems_unsigned32 sapr1;
- rtems_unsigned32 dapr1;
- rtems_unsigned32 bcr1;
- rtems_unsigned8 fcr1;
- rtems_unsigned8 _pad19;
- rtems_unsigned8 cmar1;
- rtems_unsigned8 _pad20;
- rtems_unsigned8 csr1;
- rtems_unsigned8 _pad21;
- rtems_unsigned16 _pad22;
-
- /*
- * SDMA Block
- */
- rtems_unsigned8 sdsr;
- rtems_unsigned8 _pad23;
- rtems_unsigned16 sdcr;
- rtems_unsigned32 sdar;
-
- /*
- * IDMA2 Block
- */
- rtems_unsigned16 _pad24;
- rtems_unsigned16 cmr2;
- rtems_unsigned32 sapr2;
- rtems_unsigned32 dapr2;
- rtems_unsigned32 bcr2;
- rtems_unsigned8 fcr2;
- rtems_unsigned8 _pad26;
- rtems_unsigned8 cmar2;
- rtems_unsigned8 _pad27;
- rtems_unsigned8 csr2;
- rtems_unsigned8 _pad28;
- rtems_unsigned16 _pad29;
- rtems_unsigned32 _pad30;
-
- /*
- * CPIC Block
- */
- rtems_unsigned32 cicr;
- rtems_unsigned32 cipr;
- rtems_unsigned32 cimr;
- rtems_unsigned32 cisr;
-
- /*
- * Parallel I/O Block
- */
- rtems_unsigned16 padir;
- rtems_unsigned16 papar;
- rtems_unsigned16 paodr;
- rtems_unsigned16 padat;
- rtems_unsigned32 _pad31[2];
- rtems_unsigned16 pcdir;
- rtems_unsigned16 pcpar;
- rtems_unsigned16 pcso;
- rtems_unsigned16 pcdat;
- rtems_unsigned16 pcint;
- rtems_unsigned16 _pad32;
- rtems_unsigned32 _pad33[5];
-
- /*
- * TIMER Block
- */
- rtems_unsigned16 tgcr;
- rtems_unsigned16 _pad34;
- rtems_unsigned32 _pad35[3];
- rtems_unsigned16 tmr1;
- rtems_unsigned16 tmr2;
- rtems_unsigned16 trr1;
- rtems_unsigned16 trr2;
- rtems_unsigned16 tcr1;
- rtems_unsigned16 tcr2;
- rtems_unsigned16 tcn1;
- rtems_unsigned16 tcn2;
- rtems_unsigned16 tmr3;
- rtems_unsigned16 tmr4;
- rtems_unsigned16 trr3;
- rtems_unsigned16 trr4;
- rtems_unsigned16 tcr3;
- rtems_unsigned16 tcr4;
- rtems_unsigned16 tcn3;
- rtems_unsigned16 tcn4;
- rtems_unsigned16 ter1;
- rtems_unsigned16 ter2;
- rtems_unsigned16 ter3;
- rtems_unsigned16 ter4;
- rtems_unsigned32 _pad36[2];
-
- /*
- * CP Block
- */
- rtems_unsigned16 cr;
- rtems_unsigned16 _pad37;
- rtems_unsigned16 rccr;
- rtems_unsigned16 _pad38;
- rtems_unsigned32 _pad39[3];
- rtems_unsigned16 _pad40;
- rtems_unsigned16 rter;
- rtems_unsigned16 _pad41;
- rtems_unsigned16 rtmr;
- rtems_unsigned32 _pad42[5];
-
- /*
- * BRG Block
- */
- rtems_unsigned32 brgc1;
- rtems_unsigned32 brgc2;
- rtems_unsigned32 brgc3;
- rtems_unsigned32 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
- */
- rtems_unsigned16 spmode;
- rtems_unsigned16 _pad43[2];
- rtems_unsigned8 spie;
- rtems_unsigned8 _pad44;
- rtems_unsigned16 _pad45;
- rtems_unsigned8 spim;
- rtems_unsigned8 _pad46[2];
- rtems_unsigned8 spcom;
- rtems_unsigned16 _pad47[2];
-
- /*
- * PIP Block
- */
- rtems_unsigned16 pipc;
- rtems_unsigned16 _pad48;
- rtems_unsigned16 ptpr;
- rtems_unsigned32 pbdir;
- rtems_unsigned32 pbpar;
- rtems_unsigned16 _pad49;
- rtems_unsigned16 pbodr;
- rtems_unsigned32 pbdat;
- rtems_unsigned32 _pad50[6];
-
- /*
- * SI Block
- */
- rtems_unsigned32 simode;
- rtems_unsigned8 sigmr;
- rtems_unsigned8 _pad51;
- rtems_unsigned8 sistr;
- rtems_unsigned8 sicmr;
- rtems_unsigned32 _pad52;
- rtems_unsigned32 sicr;
- rtems_unsigned16 _pad53;
- rtems_unsigned16 sirp[2];
- rtems_unsigned16 _pad54;
- rtems_unsigned32 _pad55[2];
- rtems_unsigned8 siram[256];
-} m360_t;
-
-extern volatile m360_t m360;
-
-#endif /* __MC68360_h */
diff --git a/c/src/exec/score/cpu/m68k/m68k.h b/c/src/exec/score/cpu/m68k/m68k.h
deleted file mode 100644
index 5f4c3597b5..0000000000
--- a/c/src/exec/score/cpu/m68k/m68k.h
+++ /dev/null
@@ -1,363 +0,0 @@
-/* m68k.h
- *
- * This include file contains information pertaining to the Motorola
- * m68xxx processor family.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __M68k_h
-#define __M68k_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This section contains the information required to build
- * RTEMS for a particular member of the Motorola MC68xxx
- * family. It does this by setting variables to indicate
- * which implementation dependent features are present in
- * a particular member of the family.
- *
- * Currently recognized:
- * -m68000
- * -m68000 -msoft-float
- * -m68020
- * -m68020 -msoft-float
- * -m68030
- * -m68040 -msoft-float
- * -m68040
- * -m68040 -msoft-float
- * -m68060
- * -m68060 -msoft-float
- * -m68302 (no FP) (deprecated, use -m68000)
- * -m68332 (no FP) (deprecated, use -mcpu32)
- * -mcpu32 (no FP)
- * -m5200 (no FP)
- *
- * As of gcc 2.8.1 and egcs 1.1, there is no distinction made between
- * the CPU32 and CPU32+. The option -mcpu32 generates code which can
- * be run on either core. RTEMS distinguishes between these two cores
- * because they have different alignment rules which impact performance.
- * If you are using a CPU32+, then the symbol RTEMS__mcpu32p__ should
- * be defined in your custom file (see make/custom/gen68360.cfg for an
- * example of how to do this. If gcc ever distinguishes between these
- * two cores, then RTEMS__mcpu32p__ usage will be replaced with the
- * appropriate compiler defined predefine.
- *
- * Here is some information on the 040 variants (courtesy of Doug McBride,
- * mcbride@rodin.colorado.edu):
- *
- * "The 68040 is a superset of the 68EC040 and the 68LC040. The
- * 68EC040 and 68LC040 do not have FPU's. The 68LC040 and the
- * 68EC040 have renamed the DLE pin as JS0 which must be tied to
- * Gnd or Vcc. The 68EC040 has renamed the MDIS pin as JS1. The
- * 68EC040 has access control units instead of memory management units.
- * The 68EC040 should not have the PFLUSH or PTEST instructions executed
- * (cause an indeterminate result). The 68EC040 and 68LC040 do not
- * implement the DLE or multiplexed bus modes. The 68EC040 does not
- * implement the output buffer impedance selection mode of operation."
- *
- * M68K_HAS_EXTB_L is used to enable/disable usage of the extb.l instruction
- * which is not available for 68000 or 68ec000 cores (68000, 68001, 68008,
- * 68010, 68302, 68306, 68307). This instruction is available on the 68020
- * up and the cpu32 based models.
- *
- * M68K_HAS_MISALIGNED is non-zero if the CPU allows byte-misaligned
- * data access (68020, 68030, 68040, 68060, CPU32+).
- *
- * NOTE:
- * Eventually it would be nice to evaluate doing a lot of this section
- * by having each model specify which core it uses and then go from there.
- */
-
-#if defined(__mc68020__)
-
-#define CPU_MODEL_NAME "m68020"
-#define M68K_HAS_VBR 1
-#define M68K_HAS_SEPARATE_STACKS 1
-#define M68K_HAS_BFFFO 1
-#define M68K_HAS_PREINDEXING 1
-#define M68K_HAS_EXTB_L 1
-#define M68K_HAS_MISALIGNED 1
-# if defined (__HAVE_68881__)
-# define M68K_HAS_FPU 1
-# define M68K_HAS_FPSP_PACKAGE 0
-# else
-# define M68K_HAS_FPU 0
-# define M68K_HAS_FPSP_PACKAGE 0
-# endif
-
-#elif defined(__mc68030__)
-
-#define CPU_MODEL_NAME "m68030"
-#define M68K_HAS_VBR 1
-#define M68K_HAS_SEPARATE_STACKS 1
-#define M68K_HAS_BFFFO 1
-#define M68K_HAS_PREINDEXING 1
-#define M68K_HAS_EXTB_L 1
-#define M68K_HAS_MISALIGNED 1
-# if defined (__HAVE_68881__)
-# define M68K_HAS_FPU 1
-# define M68K_HAS_FPSP_PACKAGE 0
-# else
-# define M68K_HAS_FPU 0
-# define M68K_HAS_FPSP_PACKAGE 0
-# endif
-
-#elif defined(__mc68040__)
-
-#define CPU_MODEL_NAME "m68040"
-#define M68K_HAS_VBR 1
-#define M68K_HAS_SEPARATE_STACKS 1
-#define M68K_HAS_BFFFO 1
-#define M68K_HAS_PREINDEXING 1
-#define M68K_HAS_EXTB_L 1
-#define M68K_HAS_MISALIGNED 1
-# if defined (__HAVE_68881__)
-# define M68K_HAS_FPU 1
-# define M68K_HAS_FPSP_PACKAGE 1
-# else
-# define M68K_HAS_FPU 0
-# define M68K_HAS_FPSP_PACKAGE 0
-# endif
-
-#elif defined(__mc68060__)
-
-#define CPU_MODEL_NAME "m68060"
-#define M68K_HAS_VBR 1
-#define M68K_HAS_SEPARATE_STACKS 0
-#define M68K_HAS_BFFFO 1
-#define M68K_HAS_PREINDEXING 1
-#define M68K_HAS_EXTB_L 1
-#define M68K_HAS_MISALIGNED 1
-# if defined (__HAVE_68881__)
-# define M68K_HAS_FPU 1
-# define M68K_HAS_FPSP_PACKAGE 1
-# else
-# define M68K_HAS_FPU 0
-# define M68K_HAS_FPSP_PACKAGE 0
-# endif
-
-#elif defined(__mc68302__)
-#define CPU_MODEL_NAME "m68302"
-#define M68K_HAS_VBR 0
-#define M68K_HAS_SEPARATE_STACKS 0
-#define M68K_HAS_BFFFO 0
-#define M68K_HAS_PREINDEXING 0
-#define M68K_HAS_EXTB_L 0
-#define M68K_HAS_MISALIGNED 0
-#define M68K_HAS_FPU 0
-#define M68K_HAS_FPSP_PACKAGE 0
-
- /* gcc and egcs do not distinguish between CPU32 and CPU32+ */
-#elif defined(RTEMS__mcpu32p__)
-
-#define CPU_MODEL_NAME "mcpu32+"
-#define M68K_HAS_VBR 1
-#define M68K_HAS_SEPARATE_STACKS 0
-#define M68K_HAS_BFFFO 0
-#define M68K_HAS_PREINDEXING 1
-#define M68K_HAS_EXTB_L 1
-#define M68K_HAS_MISALIGNED 1
-#define M68K_HAS_FPU 0
-#define M68K_HAS_FPSP_PACKAGE 0
-
-#elif defined(__mcpu32__)
-
-#define CPU_MODEL_NAME "mcpu32"
-#define M68K_HAS_VBR 1
-#define M68K_HAS_SEPARATE_STACKS 0
-#define M68K_HAS_BFFFO 0
-#define M68K_HAS_PREINDEXING 1
-#define M68K_HAS_EXTB_L 1
-#define M68K_HAS_MISALIGNED 0
-#define M68K_HAS_FPU 0
-#define M68K_HAS_FPSP_PACKAGE 0
-
-#elif defined(__mcf5200__)
-/* Motorola ColdFire V2 core - RISC/68020 hybrid */
-#define CPU_MODEL_NAME "m5200"
-#define M68K_HAS_VBR 1
-#define M68K_HAS_BFFFO 0
-#define M68K_HAS_SEPARATE_STACKS 0
-#define M68K_HAS_PREINDEXING 0
-#define M68K_HAS_EXTB_L 1
-#define M68K_HAS_MISALIGNED 1
-#define M68K_HAS_FPU 0
-#define M68K_HAS_FPSP_PACKAGE 0
-#define M68K_COLDFIRE_ARCH 1
-
-#elif defined(__mc68000__)
-
-#define CPU_MODEL_NAME "m68000"
-#define M68K_HAS_VBR 0
-#define M68K_HAS_SEPARATE_STACKS 0
-#define M68K_HAS_BFFFO 0
-#define M68K_HAS_PREINDEXING 0
-#define M68K_HAS_EXTB_L 0
-#define M68K_HAS_MISALIGNED 0
-# if defined (__HAVE_68881__)
-# define M68K_HAS_FPU 1
-# define M68K_HAS_FPSP_PACKAGE 0
-# else
-# define M68K_HAS_FPU 0
-# define M68K_HAS_FPSP_PACKAGE 0
-# endif
-
-#else
-
-#error "Unsupported CPU model -- are you sure you're running a 68k compiler?"
-
-#endif
-
-/*
- * If the above did not specify a ColdFire architecture, then set
- * this flag to indicate that it is not a ColdFire CPU.
- */
-
-#if !defined(M68K_COLDFIRE_ARCH)
-#define M68K_COLDFIRE_ARCH 0
-#endif
-
-/*
- * Define the name of the CPU family.
- */
-
-#if ( M68K_COLDFIRE_ARCH == 1 )
- #define CPU_NAME "Motorola ColdFire"
-#else
- #define CPU_NAME "Motorola MC68xxx"
-#endif
-
-#ifndef ASM
-
-#if ( M68K_COLDFIRE_ARCH == 1 )
-#define m68k_disable_interrupts( _level ) \
- do { register unsigned32 _tmpsr = 0x0700; \
- asm volatile ( "move.w %%sr,%0\n\t" \
- "or.l %0,%1\n\t" \
- "move.w %1,%%sr" \
- : "=d" (_level), "=d"(_tmpsr) : "1"(_tmpsr) ); \
- } while( 0 )
-#else
-#define m68k_disable_interrupts( _level ) \
- asm volatile ( "move.w %%sr,%0\n\t" \
- "or.w #0x0700,%%sr" \
- : "=d" (_level))
-#endif
-
-#define m68k_enable_interrupts( _level ) \
- asm volatile ( "move.w %0,%%sr " : : "d" (_level));
-
-#if ( M68K_COLDFIRE_ARCH == 1 )
-#define m68k_flash_interrupts( _level ) \
- do { register unsigned32 _tmpsr = 0x0700; \
- asm volatile ( "move.w %2,%%sr\n\t" \
- "or.l %2,%1\n\t" \
- "move.w %1,%%sr" \
- : "=d"(_tmpsr) : "0"(_tmpsr), "d"(_level) ); \
- } while( 0 )
-#else
-#define m68k_flash_interrupts( _level ) \
- asm volatile ( "move.w %0,%%sr\n\t" \
- "or.w #0x0700,%%sr" \
- : : "d" (_level))
-#endif
-
-#define m68k_get_interrupt_level( _level ) \
- do { \
- register unsigned32 _tmpsr; \
- \
- asm volatile( "move.w %%sr,%0" : "=d" (_tmpsr)); \
- _level = (_tmpsr & 0x0700) >> 8; \
- } while (0)
-
-#define m68k_set_interrupt_level( _newlevel ) \
- do { \
- register unsigned32 _tmpsr; \
- \
- asm volatile( "move.w %%sr,%0" : "=d" (_tmpsr)); \
- _tmpsr = (_tmpsr & 0xf8ff) | ((_newlevel) << 8); \
- asm volatile( "move.w %0,%%sr" : : "d" (_tmpsr)); \
- } while (0)
-
-#if ( M68K_HAS_VBR == 1 && M68K_COLDFIRE_ARCH == 0 )
-#define m68k_get_vbr( vbr ) \
- asm volatile ( "movec %%vbr,%0 " : "=r" (vbr))
-
-#define m68k_set_vbr( vbr ) \
- asm volatile ( "movec %0,%%vbr " : : "r" (vbr))
-
-#elif ( M68K_COLDFIRE_ARCH == 1 )
-#define m68k_get_vbr( _vbr ) _vbr = (void *)_VBR
-
-#define m68k_set_vbr( _vbr ) \
- asm volatile ("move.l %%a7,%%d1 \n\t" \
- "move.l %0,%%a7\n\t" \
- "movec %%a7,%%vbr\n\t" \
- "move.l %%d1,%%a7\n\t" \
- : : "d" (_vbr) : "d1" );
-
-#else
-#define m68k_get_vbr( _vbr ) _vbr = (void *)_VBR
-#define m68k_set_vbr( _vbr )
-#endif
-
-/*
- * The following routine swaps the endian format of an unsigned int.
- * It must be static because it is referenced indirectly.
- */
-
-static inline unsigned int m68k_swap_u32(
- unsigned int value
-)
-{
- unsigned int swapped = value;
-
- asm volatile( "rorw #8,%0" : "=d" (swapped) : "0" (swapped) );
- asm volatile( "swap %0" : "=d" (swapped) : "0" (swapped) );
- asm volatile( "rorw #8,%0" : "=d" (swapped) : "0" (swapped) );
-
- return( swapped );
-}
-
-static inline unsigned int m68k_swap_u16(
- unsigned int value
-)
-{
- unsigned short swapped = value;
-
- asm volatile( "rorw #8,%0" : "=d" (swapped) : "0" (swapped) );
-
- return( swapped );
-}
-
-/* XXX this is only valid for some m68k family members and should be fixed */
-
-#define m68k_enable_caching() \
- { register unsigned32 _ctl=0x01; \
- asm volatile ( "movec %0,%%cacr" \
- : "=d" (_ctl) : "0" (_ctl) ); \
- }
-
-#define CPU_swap_u32( value ) m68k_swap_u32( value )
-#define CPU_swap_u16( value ) m68k_swap_u16( value )
-
-#endif /* !ASM */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/cpu/m68k/m68ktypes.h b/c/src/exec/score/cpu/m68k/m68ktypes.h
deleted file mode 100644
index 6592d36187..0000000000
--- a/c/src/exec/score/cpu/m68k/m68ktypes.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* m68ktypes.h
- *
- * This include file contains type definitions pertaining to the Motorola
- * m68xxx processor family.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __M68k_TYPES_h
-#define __M68k_TYPES_h
-
-#ifndef ASM
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* unsigned 8-bit integer */
-typedef unsigned short unsigned16; /* unsigned 16-bit integer */
-typedef unsigned int unsigned32; /* unsigned 32-bit integer */
-typedef unsigned long long unsigned64; /* unsigned 64-bit integer */
-
-typedef unsigned16 Priority_Bit_map_control;
-
-typedef signed char signed8; /* 8-bit signed integer */
-typedef signed short signed16; /* 16-bit signed integer */
-typedef signed int signed32; /* 32-bit signed integer */
-typedef signed long long signed64; /* 64 bit signed integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-typedef void m68k_isr;
-
-typedef void ( *m68k_isr_entry )( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !ASM */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/cpu/m68k/memcpy.c b/c/src/exec/score/cpu/m68k/memcpy.c
deleted file mode 100644
index 3948411f4b..0000000000
--- a/c/src/exec/score/cpu/m68k/memcpy.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * C library memcpy routine
- *
- * This routine has code to optimize performance on the CPU32+
- * and another version for other 68k machines.
- *
- * It could be optimized more for machines with MOVE16 instructions.
- *
- * The routine is placed in this source directory to ensure that it
- * is picked up by all applications.
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- */
-
-#include <string.h>
-#include <rtems/score/m68k.h>
-
-#if defined(__mcpu32__)
-#define COPYSETUP(n) n--
-#define COPY(to,from,n,size) \
- asm volatile ("1:\n" \
- "\tmove." size " (%0)+,(%1)+\n" \
- "\tdbf %2,1b\n" \
- "\tsub.l #0x10000,%2\n" \
- "\tbpl.b 1b\n" : \
- "=a" (from), "=a" (to), "=d" (n) :\
- "0" (from), "1" (to), "2" (n) : \
- "cc", "memory")
-#else
-#define COPYSETUP(n)
-#define COPY(to,from,n,size) \
- asm volatile ("1:\n" \
- "\tmove." size " (%0)+,(%1)+\n" \
- "\tsubq.l #1,%2\n\tbne.b 1b\n" : \
- "=a" (from), "=a" (to), "=d" (n) :\
- "0" (from), "1" (to), "2" (n) : \
- "cc", "memory")
-#endif
-
-void *
-memcpy(void *s1, const void *s2, size_t n)
-{
- char *p1 = s1;
- const char *p2 = s2;
-
- if (n) {
- if (n < 16) {
- COPYSETUP (n);
- COPY (p1, p2, n, "b");
- }
- else {
- int nbyte;
- int nl;
- nbyte = (int)p1 & 0x3;
- if (nbyte) {
- nbyte = 4 - nbyte;
- n -= nbyte;
- COPYSETUP (nbyte);
- COPY (p1, p2, nbyte, "b");
- }
-#if (M68K_HAS_MISALIGNED == 0)
- /*
- * Take care of machines that can't
- * handle misaligned references.
- */
- if ((int)p2 & 0x1) {
- COPYSETUP (n);
- COPY (p1, p2, n, "b");
- return s1;
- }
-#endif
- nl = (unsigned int)n >> 2;
- COPYSETUP (nl);
- COPY (p1, p2, nl, "l");
- nbyte = (int)n & 0x3;
- if (nbyte) {
- COPYSETUP (nbyte);
- COPY (p1, p2, nbyte, "b");
- }
- }
- }
- return s1;
-}
diff --git a/c/src/exec/score/cpu/m68k/qsm.h b/c/src/exec/score/cpu/m68k/qsm.h
deleted file mode 100644
index e1bf33bc12..0000000000
--- a/c/src/exec/score/cpu/m68k/qsm.h
+++ /dev/null
@@ -1,209 +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_
-
-
-#include <efi332.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/c/src/exec/score/cpu/m68k/rtems.s b/c/src/exec/score/cpu/m68k/rtems.s
deleted file mode 100644
index e8cba8204c..0000000000
--- a/c/src/exec/score/cpu/m68k/rtems.s
+++ /dev/null
@@ -1,52 +0,0 @@
-/* rtems.s
- *
- * This file contains the single entry point code for
- * the m68k implementation of RTEMS.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <asm.h>
-
-/*
- * There seems to be no reason to have two versions of this.
- * The following version should work across the entire family.
- * The worst assumption is that gcc will put entry in a scratch
- * register and not screw up the stack.
- *
- * NOTE: This is a 68020 version:
- *
- * jmpl @(%%d0:l:4)@(__Entry_points)
- */
-
- EXTERN (_Entry_points)
-
- BEGIN_CODE
-
- .align 4
- .global SYM (RTEMS)
-
-SYM (RTEMS):
- moveal SYM (_Entry_points), a0
- lsll #2, d0
- addal d0, a0
-
-#if (M68K_COLDFIRE_ARCH == 0)
- moveal @(a0),a0
- jmpl @(a0)
-#else
- moveal (a0),a0
- jmpl (a0)
-#endif
-
- END_CODE
-END
diff --git a/c/src/exec/score/cpu/m68k/sim.h b/c/src/exec/score/cpu/m68k/sim.h
deleted file mode 100644
index d70f56d360..0000000000
--- a/c/src/exec/score/cpu/m68k/sim.h
+++ /dev/null
@@ -1,342 +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_
-
-
-/*
- * XXX Why is a generic file like this including a bsp specific file?
-
-#include <efi332.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 */
-/* not included in ram_init.h */
-#if SIM_MM == 0
-#define SIM_CRB 0x7ffa00
-#else
-#undef SIM_MM
-#define SIM_MM 1
-#define SIM_CRB 0xfffa00
-#endif
-/* end not included in ram_init.h */
-
-
-
-#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 W 0x8000 /* Frequency Control (VCO) */
-#define X 0x4000 /* Frequency Control Bit (Prescale) */
-#define Y 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/c/src/exec/score/cpu/mips/asm.h b/c/src/exec/score/cpu/mips/asm.h
deleted file mode 100644
index fccd89069f..0000000000
--- a/c/src/exec/score/cpu/mips/asm.h
+++ /dev/null
@@ -1,102 +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 <rtems/score/targopts.h>
-#include <rtems/score/no_cpu.h>
-
-/*
- * 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/c/src/exec/score/cpu/mips/cpu.c b/c/src/exec/score/cpu/mips/cpu.c
deleted file mode 100644
index 4617be460d..0000000000
--- a/c/src/exec/score/cpu/mips/cpu.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Mips CPU Dependent Source
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)cpu.c 08/20/96 1.5\n";
- */
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/wkspace.h>
-
-
-ISR_Handler_entry _ISR_Vector_table[ ISR_NUMBER_OF_VECTORS ];
-
-/* _CPU_Initialize
- *
- * This routine performs processor dependent initialization.
- *
- * INPUT PARAMETERS:
- * cpu_table - CPU table to initialize
- * thread_dispatch - address of disptaching routine
- */
-
-
-void null_handler( void )
-{
-}
-
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch) /* ignored on this CPU */
-)
-{
- unsigned int i = ISR_NUMBER_OF_VECTORS;
-
- while ( i-- )
- {
- _ISR_Vector_table[i] = (ISR_Handler_entry)null_handler;
- }
-
- /*
- * The thread_dispatch argument is the address of the entry point
- * for the routine called at the end of an ISR once it has been
- * decided a context switch is necessary. On some compilation
- * systems it is difficult to call a high-level language routine
- * from assembly. This allows us to trick these systems.
- *
- * If you encounter this problem save the entry point in a CPU
- * dependent variable.
- */
-
- _CPU_Thread_dispatch_pointer = thread_dispatch;
-
- /*
- * If there is not an easy way to initialize the FP context
- * during Context_Initialize, then it is usually easier to
- * save an "uninitialized" FP context here and copy it to
- * the task's during Context_Initialize.
- */
-
- /* FP context initialization support goes here */
-
- _CPU_Table = *cpu_table;
-
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-#if 0 /* located in cpu_asm.S */
-unsigned32 _CPU_ISR_Get_level( void )
-{
- /*
- * This routine returns the current interrupt level.
- */
-}
-#endif
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- /*
- * This is where we install the interrupt handler into the "raw" interrupt
- * table used by the CPU to dispatch interrupt handlers.
- */
-
-#if 0 /* not necessary */
-/* use IDT/Sim to set interrupt vector. Needed to co-exist with debugger. */
- add_ext_int_func( vector, new_handler );
-#endif
-}
-
-/*PAGE
- *
- * _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
-)
-{
- *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.
- */
-
- _CPU_ISR_install_raw_handler( vector, _ISR_Handler, old_handler );
-
- /*
- * 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;
-}
-
-/*PAGE
- *
- * _CPU_Install_interrupt_stack
- */
-
-void _CPU_Install_interrupt_stack( void )
-{
-/* we don't support this yet */
-}
-
-/*PAGE
- *
- * _CPU_Internal_threads_Idle_thread_body
- *
- * NOTES:
- *
- * 1. This is the same as the regular CPU independent algorithm.
- *
- * 2. If you implement this using a "halt", "idle", or "shutdown"
- * instruction, then don't forget to put it in an infinite loop.
- *
- * 3. Be warned. Some processors with onboard DMA have been known
- * to stop the DMA if the CPU were put in IDLE mode. This might
- * also be a problem with other on-chip peripherals. So use this
- * hook with caution.
- */
-
-#if 0 /* located in cpu_asm.S */
-void _CPU_Thread_Idle_body( void )
-{
-
- for( ; ; )
- /* insert your "halt" instruction here */ ;
-}
-#endif
-
-extern void mips_break( int error );
-
-#include <stdio.h>
-
-void mips_fatal_error( int error )
-{
- printf("fatal error 0x%x %d\n",error,error);
- mips_break( error );
-}
diff --git a/c/src/exec/score/cpu/mips/cpu_asm.S b/c/src/exec/score/cpu/mips/cpu_asm.S
deleted file mode 100644
index 7dcb8fbda7..0000000000
--- a/c/src/exec/score/cpu/mips/cpu_asm.S
+++ /dev/null
@@ -1,972 +0,0 @@
-/* cpu_asm.S
- *
- * This file contains the basic algorithms for all assembly code used
- * in an specific CPU port of RTEMS. These algorithms must be implemented
- * in assembly language
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu_asm.s:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-/* @(#)cpu_asm.S 08/20/96 1.15 */
-
-#include "cpu_asm.h"
-
-#include "iregdef.h"
-#include "idtcpu.h"
-
-#define FRAME(name,frm_reg,offset,ret_reg) \
- .globl name; \
- .ent name; \
-name:; \
- .frame frm_reg,offset,ret_reg
-#define ENDFRAME(name) \
- .end name
-
-
-#define EXCP_STACK_SIZE (NREGS*R_SZ)
-
-#if __ghs__
-#define sd sw
-#define ld lw
-#define dmtc0 mtc0
-#define dsll sll
-#define dmfc0 mfc0
-#endif
-
-#if 1 /* 32 bit unsigned32 types */
-#define sint sw
-#define lint lw
-#define stackadd addiu
-#define intadd addu
-#define SZ_INT 4
-#define SZ_INT_POW2 2
-#else /* 64 bit unsigned32 types */
-#define sint dw
-#define lint dw
-#define stackadd daddiu
-#define intadd daddu
-#define SZ_INT 8
-#define SZ_INT_POW2 3
-#endif
-
-#ifdef __GNUC__
-#define EXTERN(x,size) .extern x,size
-#else
-#define EXTERN(x,size)
-#endif
-
-/* NOTE: these constants must match the Context_Control structure in cpu.h */
-#define S0_OFFSET 0
-#define S1_OFFSET 1
-#define S2_OFFSET 2
-#define S3_OFFSET 3
-#define S4_OFFSET 4
-#define S5_OFFSET 5
-#define S6_OFFSET 6
-#define S7_OFFSET 7
-#define SP_OFFSET 8
-#define FP_OFFSET 9
-#define RA_OFFSET 10
-#define C0_SR_OFFSET 11
-#define C0_EPC_OFFSET 12
-
-/* NOTE: these constants must match the Context_Control_fp structure in cpu.h */
-#define FP0_OFFSET 0
-#define FP1_OFFSET 1
-#define FP2_OFFSET 2
-#define FP3_OFFSET 3
-#define FP4_OFFSET 4
-#define FP5_OFFSET 5
-#define FP6_OFFSET 6
-#define FP7_OFFSET 7
-#define FP8_OFFSET 8
-#define FP9_OFFSET 9
-#define FP10_OFFSET 10
-#define FP11_OFFSET 11
-#define FP12_OFFSET 12
-#define FP13_OFFSET 13
-#define FP14_OFFSET 14
-#define FP15_OFFSET 15
-#define FP16_OFFSET 16
-#define FP17_OFFSET 17
-#define FP18_OFFSET 18
-#define FP19_OFFSET 19
-#define FP20_OFFSET 20
-#define FP21_OFFSET 21
-#define FP22_OFFSET 22
-#define FP23_OFFSET 23
-#define FP24_OFFSET 24
-#define FP25_OFFSET 25
-#define FP26_OFFSET 26
-#define FP27_OFFSET 27
-#define FP28_OFFSET 28
-#define FP29_OFFSET 29
-#define FP30_OFFSET 30
-#define FP31_OFFSET 31
-
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-#if 0
-unsigned32 _CPU_ISR_Get_level( void )
-{
- /*
- * This routine returns the current interrupt level.
- */
-}
-#endif
-/* return the current exception level for the 4650 */
-FRAME(_CPU_ISR_Get_level,sp,0,ra)
- mfc0 v0,C0_SR
- nop
- andi v0,SR_EXL
- srl v0,1
- j ra
-ENDFRAME(_CPU_ISR_Get_level)
-
-FRAME(_CPU_ISR_Set_level,sp,0,ra)
- nop
- mfc0 a0,C0_SR
- nop
- andi a0,SR_EXL
- beqz a0,_CPU_ISR_Set_1 /* normalize a0 */
- nop
- li a0,1
-_CPU_ISR_Set_1:
- beq v0,a0,_CPU_ISR_Set_exit /* if (current_level != new_level ) */
- nop
- bnez a0,_CPU_ISR_Set_2
- nop
- nop
- mfc0 t0,C0_SR
- nop
- li t1,~SR_EXL
- and t0,t1
- nop
- mtc0 t0,C0_SR /* disable exception level */
- nop
- j ra
- nop
-_CPU_ISR_Set_2:
- nop
- mfc0 t0,C0_SR
- nop
- li t1,~SR_IE
- and t0,t1
- nop
- mtc0 t0,C0_SR /* first disable ie bit (recommended) */
- nop
- ori t0,SR_EXL|SR_IE /* enable exception level */
- nop
- mtc0 t0,C0_SR
- nop
-_CPU_ISR_Set_exit:
- j ra
- nop
-ENDFRAME(_CPU_ISR_Set_level)
-
-/*
- * _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.
- */
-
-/* void _CPU_Context_save_fp(
- * void **fp_context_ptr
- * )
- * {
- * }
- */
-
-FRAME(_CPU_Context_save_fp,sp,0,ra)
- .set noat
- ld a1,(a0)
- swc1 $f0,FP0_OFFSET*4(a1)
- swc1 $f1,FP1_OFFSET*4(a1)
- swc1 $f2,FP2_OFFSET*4(a1)
- swc1 $f3,FP3_OFFSET*4(a1)
- swc1 $f4,FP4_OFFSET*4(a1)
- swc1 $f5,FP5_OFFSET*4(a1)
- swc1 $f6,FP6_OFFSET*4(a1)
- swc1 $f7,FP7_OFFSET*4(a1)
- swc1 $f8,FP8_OFFSET*4(a1)
- swc1 $f9,FP9_OFFSET*4(a1)
- swc1 $f10,FP10_OFFSET*4(a1)
- swc1 $f11,FP11_OFFSET*4(a1)
- swc1 $f12,FP12_OFFSET*4(a1)
- swc1 $f13,FP13_OFFSET*4(a1)
- swc1 $f14,FP14_OFFSET*4(a1)
- swc1 $f15,FP15_OFFSET*4(a1)
- swc1 $f16,FP16_OFFSET*4(a1)
- swc1 $f17,FP17_OFFSET*4(a1)
- swc1 $f18,FP18_OFFSET*4(a1)
- swc1 $f19,FP19_OFFSET*4(a1)
- swc1 $f20,FP20_OFFSET*4(a1)
- swc1 $f21,FP21_OFFSET*4(a1)
- swc1 $f22,FP22_OFFSET*4(a1)
- swc1 $f23,FP23_OFFSET*4(a1)
- swc1 $f24,FP24_OFFSET*4(a1)
- swc1 $f25,FP25_OFFSET*4(a1)
- swc1 $f26,FP26_OFFSET*4(a1)
- swc1 $f27,FP27_OFFSET*4(a1)
- swc1 $f28,FP28_OFFSET*4(a1)
- swc1 $f29,FP29_OFFSET*4(a1)
- swc1 $f30,FP30_OFFSET*4(a1)
- swc1 $f31,FP31_OFFSET*4(a1)
- j ra
- nop
- .set at
-ENDFRAME(_CPU_Context_save_fp)
-
-/*
- * _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.
- */
-
-/* void _CPU_Context_restore_fp(
- * void **fp_context_ptr
- * )
- * {
- * }
- */
-
-FRAME(_CPU_Context_restore_fp,sp,0,ra)
- .set noat
- ld a1,(a0)
- lwc1 $f0,FP0_OFFSET*4(a1)
- lwc1 $f1,FP1_OFFSET*4(a1)
- lwc1 $f2,FP2_OFFSET*4(a1)
- lwc1 $f3,FP3_OFFSET*4(a1)
- lwc1 $f4,FP4_OFFSET*4(a1)
- lwc1 $f5,FP5_OFFSET*4(a1)
- lwc1 $f6,FP6_OFFSET*4(a1)
- lwc1 $f7,FP7_OFFSET*4(a1)
- lwc1 $f8,FP8_OFFSET*4(a1)
- lwc1 $f9,FP9_OFFSET*4(a1)
- lwc1 $f10,FP10_OFFSET*4(a1)
- lwc1 $f11,FP11_OFFSET*4(a1)
- lwc1 $f12,FP12_OFFSET*4(a1)
- lwc1 $f13,FP13_OFFSET*4(a1)
- lwc1 $f14,FP14_OFFSET*4(a1)
- lwc1 $f15,FP15_OFFSET*4(a1)
- lwc1 $f16,FP16_OFFSET*4(a1)
- lwc1 $f17,FP17_OFFSET*4(a1)
- lwc1 $f18,FP18_OFFSET*4(a1)
- lwc1 $f19,FP19_OFFSET*4(a1)
- lwc1 $f20,FP20_OFFSET*4(a1)
- lwc1 $f21,FP21_OFFSET*4(a1)
- lwc1 $f22,FP22_OFFSET*4(a1)
- lwc1 $f23,FP23_OFFSET*4(a1)
- lwc1 $f24,FP24_OFFSET*4(a1)
- lwc1 $f25,FP25_OFFSET*4(a1)
- lwc1 $f26,FP26_OFFSET*4(a1)
- lwc1 $f27,FP27_OFFSET*4(a1)
- lwc1 $f28,FP28_OFFSET*4(a1)
- lwc1 $f29,FP29_OFFSET*4(a1)
- lwc1 $f30,FP30_OFFSET*4(a1)
- lwc1 $f31,FP31_OFFSET*4(a1)
- j ra
- nop
- .set at
-ENDFRAME(_CPU_Context_restore_fp)
-
-/* _CPU_Context_switch
- *
- * This routine performs a normal non-FP context switch.
- */
-
-/* void _CPU_Context_switch(
- * Context_Control *run,
- * Context_Control *heir
- * )
- * {
- * }
- */
-
-FRAME(_CPU_Context_switch,sp,0,ra)
-
- mfc0 t0,C0_SR
- li t1,~SR_IE
- sd t0,C0_SR_OFFSET*8(a0) /* save status register */
- and t0,t1
- mtc0 t0,C0_SR /* first disable ie bit (recommended) */
- ori t0,SR_EXL|SR_IE /* enable exception level to disable interrupts */
- mtc0 t0,C0_SR
-
- sd ra,RA_OFFSET*8(a0) /* save current context */
- sd sp,SP_OFFSET*8(a0)
- sd fp,FP_OFFSET*8(a0)
- sd s0,S0_OFFSET*8(a0)
- sd s1,S1_OFFSET*8(a0)
- sd s2,S2_OFFSET*8(a0)
- sd s3,S3_OFFSET*8(a0)
- sd s4,S4_OFFSET*8(a0)
- sd s5,S5_OFFSET*8(a0)
- sd s6,S6_OFFSET*8(a0)
- sd s7,S7_OFFSET*8(a0)
- dmfc0 t0,C0_EPC
- sd t0,C0_EPC_OFFSET*8(a0)
-
-_CPU_Context_switch_restore:
- ld s0,S0_OFFSET*8(a1) /* restore context */
- ld s1,S1_OFFSET*8(a1)
- ld s2,S2_OFFSET*8(a1)
- ld s3,S3_OFFSET*8(a1)
- ld s4,S4_OFFSET*8(a1)
- ld s5,S5_OFFSET*8(a1)
- ld s6,S6_OFFSET*8(a1)
- ld s7,S7_OFFSET*8(a1)
- ld fp,FP_OFFSET*8(a1)
- ld sp,SP_OFFSET*8(a1)
- ld ra,RA_OFFSET*8(a1)
- ld t0,C0_EPC_OFFSET*8(a1)
- dmtc0 t0,C0_EPC
- ld t0,C0_SR_OFFSET*8(a1)
- andi t0,SR_EXL
- bnez t0,_CPU_Context_1 /* set exception level from restore context */
- li t0,~SR_EXL
- mfc0 t1,C0_SR
- nop
- and t1,t0
- mtc0 t1,C0_SR
-_CPU_Context_1:
- j ra
- nop
-ENDFRAME(_CPU_Context_switch)
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally 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.
- */
-
-#if 0
-void _CPU_Context_restore(
- Context_Control *new_context
-)
-{
-}
-#endif
-
-FRAME(_CPU_Context_restore,sp,0,ra)
- dadd a1,a0,zero
- j _CPU_Context_switch_restore
- nop
-ENDFRAME(_CPU_Context_restore)
-
-EXTERN(_ISR_Nest_level, SZ_INT)
-EXTERN(_Thread_Dispatch_disable_level,SZ_INT)
-EXTERN(_Context_Switch_necessary,SZ_INT)
-EXTERN(_ISR_Signals_to_thread_executing,SZ_INT)
-.extern _Thread_Dispatch
-.extern _ISR_Vector_table
-
-/* void __ISR_Handler()
- *
- * This routine provides the RTEMS interrupt management.
- *
- */
-
-#if 0
-void _ISR_Handler()
-{
- /*
- * This discussion ignores a lot of the ugly details in a real
- * implementation such as saving enough registers/state to be
- * able to do something real. Keep in mind that the goal is
- * to invoke a user's ISR handler which is written in C and
- * uses a certain set of registers.
- *
- * Also note that the exact order is to a large extent flexible.
- * Hardware will dictate a sequence for a certain subset of
- * _ISR_Handler while requirements for setting
- */
-
- /*
- * At entry to "common" _ISR_Handler, the vector number must be
- * available. On some CPUs the hardware puts either the vector
- * number or the offset into the vector table for this ISR in a
- * known place. If the hardware does not give us this information,
- * then the assembly portion of RTEMS for this port will contain
- * a set of distinct interrupt entry points which somehow place
- * the vector number in a known place (which is safe if another
- * interrupt nests this one) and branches to _ISR_Handler.
- *
- */
-#endif
-FRAME(_ISR_Handler,sp,0,ra)
-.set noreorder
-#if USE_IDTKIT
-/* IDT/Kit incorrectly adds 4 to EPC before returning. This compensates */
- lreg k0, R_EPC*R_SZ(sp)
- daddiu k0,k0,-4
- sreg k0, R_EPC*R_SZ(sp)
- lreg k0, R_CAUSE*R_SZ(sp)
- li k1, ~CAUSE_BD
- and k0, k1
- sreg k0, R_CAUSE*R_SZ(sp)
-#endif
-
-/* save registers not already saved by IDT/sim */
- stackadd sp,sp,-EXCP_STACK_SIZE /* store ra on the stack */
-
- sreg ra, R_RA*R_SZ(sp)
- sreg v0, R_V0*R_SZ(sp)
- sreg v1, R_V1*R_SZ(sp)
- sreg a0, R_A0*R_SZ(sp)
- sreg a1, R_A1*R_SZ(sp)
- sreg a2, R_A2*R_SZ(sp)
- sreg a3, R_A3*R_SZ(sp)
- sreg t0, R_T0*R_SZ(sp)
- sreg t1, R_T1*R_SZ(sp)
- sreg t2, R_T2*R_SZ(sp)
- sreg t3, R_T3*R_SZ(sp)
- sreg t4, R_T4*R_SZ(sp)
- sreg t5, R_T5*R_SZ(sp)
- sreg t6, R_T6*R_SZ(sp)
- sreg t7, R_T7*R_SZ(sp)
- mflo k0
- sreg t8, R_T8*R_SZ(sp)
- sreg k0, R_MDLO*R_SZ(sp)
- sreg t9, R_T9*R_SZ(sp)
- mfhi k0
- sreg gp, R_GP*R_SZ(sp)
- sreg fp, R_FP*R_SZ(sp)
- sreg k0, R_MDHI*R_SZ(sp)
- .set noat
- sreg AT, R_AT*R_SZ(sp)
- .set at
-
- stackadd sp,sp,-40 /* store ra on the stack */
- sd ra,32(sp)
-
-/* determine if an interrupt generated this exception */
- mfc0 k0,C0_CAUSE
- and k1,k0,CAUSE_EXCMASK
- bnez k1,_ISR_Handler_prom_exit /* not an external interrupt, pass exception to Monitor */
- mfc0 k1,C0_SR
- and k0,k1
- and k0,CAUSE_IPMASK
- beq k0,zero,_ISR_Handler_quick_exit /* external interrupt not enabled, ignore */
- nop
-
- /*
- * save some or all context on stack
- * may need to save some special interrupt information for exit
- *
- * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- * if ( _ISR_Nest_level == 0 )
- * switch to software interrupt stack
- * #endif
- */
-#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- lint t0,_ISR_Nest_level
- beq t0, zero, _ISR_Handler_1
- nop
- /* switch stacks */
-_ISR_Handler_1:
-#else
- lint t0,_ISR_Nest_level
-#endif
- /*
- * _ISR_Nest_level++;
- */
- addi t0,t0,1
- sint t0,_ISR_Nest_level
- /*
- * _Thread_Dispatch_disable_level++;
- */
- lint t1,_Thread_Dispatch_disable_level
- addi t1,t1,1
- sint t1,_Thread_Dispatch_disable_level
-#if 0
- nop
- j _ISR_Handler_4
- nop
- /*
- * while ( interrupts_pending(cause_reg) ) {
- * vector = BITFIELD_TO_INDEX(cause_reg);
- * (*_ISR_Vector_table[ vector ])( vector );
- * }
- */
-_ISR_Handler_2:
-/* software interrupt priorities can be applied here */
- li t1,-1
-/* convert bit field into interrupt index */
-_ISR_Handler_3:
- andi t2,t0,1
- addi t1,1
- beql t2,zero,_ISR_Handler_3
- dsrl t0,1
- li t1,7
- dsll t1,3 /* convert index to byte offset (*8) */
- la t3,_ISR_Vector_table
- intadd t1,t3
- lint t1,(t1)
- jalr t1
- nop
- j _ISR_Handler_5
- nop
-_ISR_Handler_4:
- mfc0 t0,C0_CAUSE
- andi t0,CAUSE_IPMASK
- bne t0,zero,_ISR_Handler_2
- dsrl t0,t0,8
-_ISR_Handler_5:
-#else
- nop
- li t1,7
- dsll t1,t1,SZ_INT_POW2
- la t3,_ISR_Vector_table
- intadd t1,t3
- lint t1,(t1)
- jalr t1
- nop
-#endif
- /*
- * --_ISR_Nest_level;
- */
- lint t2,_ISR_Nest_level
- addi t2,t2,-1
- sint t2,_ISR_Nest_level
- /*
- * --_Thread_Dispatch_disable_level;
- */
- lint t1,_Thread_Dispatch_disable_level
- addi t1,t1,-1
- sint t1,_Thread_Dispatch_disable_level
- /*
- * if ( _Thread_Dispatch_disable_level || _ISR_Nest_level )
- * goto the label "exit interrupt (simple case)"
- */
- or t0,t2,t1
- bne t0,zero,_ISR_Handler_exit
- nop
- /*
- * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- * restore stack
- * #endif
- *
- * if ( !_Context_Switch_necessary && !_ISR_Signals_to_thread_executing )
- * goto the label "exit interrupt (simple case)"
- */
- lint t0,_Context_Switch_necessary
- lint t1,_ISR_Signals_to_thread_executing
- or t0,t0,t1
- beq t0,zero,_ISR_Handler_exit
- nop
-
- /*
- * call _Thread_Dispatch() or prepare to return to _ISR_Dispatch
- */
- jal _Thread_Dispatch
- nop
- /*
- * prepare to get out of interrupt
- * return from interrupt (maybe to _ISR_Dispatch)
- *
- * LABEL "exit interrupt (simple case):
- * prepare to get out of interrupt
- * return from interrupt
- */
-_ISR_Handler_exit:
- ld ra,32(sp)
- stackadd sp,sp,40
-
-/* restore interrupt context from stack */
- lreg k0, R_MDLO*R_SZ(sp)
- mtlo k0
- lreg k0, R_MDHI*R_SZ(sp)
- lreg a2, R_A2*R_SZ(sp)
- mthi k0
- lreg a3, R_A3*R_SZ(sp)
- lreg t0, R_T0*R_SZ(sp)
- lreg t1, R_T1*R_SZ(sp)
- lreg t2, R_T2*R_SZ(sp)
- lreg t3, R_T3*R_SZ(sp)
- lreg t4, R_T4*R_SZ(sp)
- lreg t5, R_T5*R_SZ(sp)
- lreg t6, R_T6*R_SZ(sp)
- lreg t7, R_T7*R_SZ(sp)
- lreg t8, R_T8*R_SZ(sp)
- lreg t9, R_T9*R_SZ(sp)
- lreg gp, R_GP*R_SZ(sp)
- lreg fp, R_FP*R_SZ(sp)
- lreg ra, R_RA*R_SZ(sp)
- lreg a0, R_A0*R_SZ(sp)
- lreg a1, R_A1*R_SZ(sp)
- lreg v1, R_V1*R_SZ(sp)
- lreg v0, R_V0*R_SZ(sp)
- .set noat
- lreg AT, R_AT*R_SZ(sp)
- .set at
-
- stackadd sp,sp,EXCP_STACK_SIZE /* store ra on the stack */
-
-#if USE_IDTKIT
-/* we handled exception, so return non-zero value */
- li v0,1
-#endif
-
-_ISR_Handler_quick_exit:
-#ifdef USE_IDTKIT
- j ra
-#else
- eret
-#endif
- nop
-
-_ISR_Handler_prom_exit:
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
- .set reorder
-
-ENDFRAME(_ISR_Handler)
-
-
-FRAME(mips_enable_interrupts,sp,0,ra)
- mfc0 t0,C0_SR /* get status reg */
- nop
- or t0,t0,a0
- mtc0 t0,C0_SR /* save updated status reg */
- j ra
- nop
-ENDFRAME(mips_enable_interrupts)
-
-FRAME(mips_disable_interrupts,sp,0,ra)
- mfc0 v0,C0_SR /* get status reg */
- li t1,SR_IMASK /* t1 = load interrupt mask word */
- not t0,t1 /* t0 = ~t1 */
- and t0,v0 /* clear imask bits */
- mtc0 t0,C0_SR /* save status reg */
- and v0,t1 /* mask return value (only return imask bits) */
- jr ra
- nop
-ENDFRAME(mips_disable_interrupts)
-
-FRAME(mips_enable_global_interrupts,sp,0,ra)
- mfc0 t0,C0_SR /* get status reg */
- nop
- ori t0,SR_IE
- mtc0 t0,C0_SR /* save updated status reg */
- j ra
- nop
-ENDFRAME(mips_enable_global_interrupts)
-
-FRAME(mips_disable_global_interrupts,sp,0,ra)
- li t1,SR_IE
- mfc0 t0,C0_SR /* get status reg */
- not t1
- and t0,t1
- mtc0 t0,C0_SR /* save updated status reg */
- j ra
- nop
-ENDFRAME(mips_disable_global_interrupts)
-
-/* return the value of the status register in v0. Used for debugging */
-FRAME(mips_get_sr,sp,0,ra)
- mfc0 v0,C0_SR
- j ra
- nop
-ENDFRAME(mips_get_sr)
-
-FRAME(mips_break,sp,0,ra)
-#if 1
- break 0x0
- j mips_break
-#else
- j ra
-#endif
- nop
-ENDFRAME(mips_break)
-
-/*PAGE
- *
- * _CPU_Internal_threads_Idle_thread_body
- *
- * NOTES:
- *
- * 1. This is the same as the regular CPU independent algorithm.
- *
- * 2. If you implement this using a "halt", "idle", or "shutdown"
- * instruction, then don't forget to put it in an infinite loop.
- *
- * 3. Be warned. Some processors with onboard DMA have been known
- * to stop the DMA if the CPU were put in IDLE mode. This might
- * also be a problem with other on-chip peripherals. So use this
- * hook with caution.
- */
-
-FRAME(_CPU_Thread_Idle_body,sp,0,ra)
- wait /* enter low power mode */
- j _CPU_Thread_Idle_body
- nop
-ENDFRAME(_CPU_Thread_Idle_body)
-
-#define VEC_CODE_LENGTH 10*4
-
-/**************************************************************************
-**
-** init_exc_vecs() - moves the exception code into the addresses
-** reserved for exception vectors
-**
-** UTLB Miss exception vector at address 0x80000000
-**
-** General exception vector at address 0x80000080
-**
-** RESET exception vector is at address 0xbfc00000
-**
-***************************************************************************/
-
-#define INITEXCFRM ((2*4)+4) /* ra + 2 arguments */
-FRAME(init_exc_vecs,sp,0,ra)
-/* This code yanked from SIM */
-#if defined(CPU_R3000)
- .set noreorder
- la t1,exc_utlb_code
- la t2,exc_norm_code
- li t3,UT_VEC
- li t4,E_VEC
- li t5,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- lw t7,0(t2)
- sw t6,0(t3)
- sw t7,0(t4)
- addiu t1,4
- addiu t3,4
- addiu t4,4
- subu t5,4
- bne t5,zero,1b
- addiu t2,4
- move t5,ra # assumes clear_cache doesnt use t5
- li a0,UT_VEC
- jal clear_cache
- li a1,VEC_CODE_LENGTH
- nop
- li a0,E_VEC
- jal clear_cache
- li a1,VEC_CODE_LENGTH
- move ra,t5 # restore ra
- j ra
- nop
- .set reorder
-#endif
-#if defined(CPU_R4000)
- .set reorder
- move t5,ra # assumes clear_cache doesnt use t5
-
- /* TLB exception vector */
- la t1,exc_tlb_code
- li t2,T_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- li a0,T_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- la t1,exc_xtlb_code
- li t2,X_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- /* extended TLB exception vector */
- li a0,X_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- /* cache error exception vector */
- la t1,exc_cache_code
- li t2,C_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- li a0,C_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- /* normal exception vector */
- la t1,exc_norm_code
- li t2,E_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- li a0,E_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- move ra,t5 # restore ra
- j ra
-#endif
-ENDFRAME(init_exc_vecs)
-
-
-#if defined(CPU_R4000)
-FRAME(exc_tlb_code,sp,0,ra)
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
-ENDFRAME(exc_tlb_code)
-
-
-FRAME(exc_xtlb_code,sp,0,ra)
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
-ENDFRAME(exc_xtlb_code)
-
-
-FRAME(exc_cache_code,sp,0,ra)
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
-ENDFRAME(exc_cache_code)
-
-
-FRAME(exc_norm_code,sp,0,ra)
- la k0, _ISR_Handler /* generic external int hndlr */
- j k0
- nop
- subu sp, EXCP_STACK_SIZE /* set up local stack frame */
-ENDFRAME(exc_norm_code)
-#endif
-
-/**************************************************************************
-**
-** enable_int(mask) - enables interrupts - mask is positioned so it only
-** needs to be or'ed into the status reg. This
-** also does some other things !!!! caution should
-** be used if invoking this while in the middle
-** of a debugging session where the client may have
-** nested interrupts.
-**
-****************************************************************************/
-FRAME(enable_int,sp,0,ra)
- .set noreorder
- mfc0 t0,C0_SR
- or a0,1
- or t0,a0
- mtc0 t0,C0_SR
- j ra
- nop
- .set reorder
-ENDFRAME(enable_int)
-
-
-/***************************************************************************
-**
-** disable_int(mask) - disable the interrupt - mask is the complement
-** of the bits to be cleared - i.e. to clear ext int
-** 5 the mask would be - 0xffff7fff
-**
-****************************************************************************/
-FRAME(disable_int,sp,0,ra)
- .set noreorder
- mfc0 t0,C0_SR
- nop
- and t0,a0
- mtc0 t0,C0_SR
- j ra
- nop
-ENDFRAME(disable_int)
-
-
diff --git a/c/src/exec/score/cpu/mips/cpu_asm.h b/c/src/exec/score/cpu/mips/cpu_asm.h
deleted file mode 100644
index 5d78f39d7c..0000000000
--- a/c/src/exec/score/cpu/mips/cpu_asm.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * cpu_asm.h
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu_asm.h:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- *
- */
-/* @(#)cpu_asm.h 08/20/96 1.2 */
-
-#ifndef __CPU_ASM_h
-#define __CPU_ASM_h
-
-/* pull in the generated offsets */
-
-/* #include <rtems/score/offsets.h> */
-
-/*
- * Hardware General Registers
- */
-
-/* put something here */
-
-/*
- * 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
-
-/*
- * Hardware Control Registers
- */
-
-/* put something here */
-
-/*
- * Calling Convention
- */
-
-/* put something here */
-
-/*
- * Temporary registers
- */
-
-/* put something here */
-
-/*
- * Floating Point Registers - SW Conventions
- */
-
-/* put something here */
-
-/*
- * Temporary floating point registers
- */
-
-/* put something here */
-
-#endif
-
-/* end of file */
diff --git a/c/src/exec/score/cpu/mips/idtcpu.h b/c/src/exec/score/cpu/mips/idtcpu.h
deleted file mode 100644
index f921e85ef6..0000000000
--- a/c/src/exec/score/cpu/mips/idtcpu.h
+++ /dev/null
@@ -1,440 +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 defined(CPU_R4000)
-#define KSBASE 0xe0000000
-#define KSSIZE 0x20000000
-#endif
-
-#define KUBASE 0
-#define KUSIZE 0x80000000
-
-/*
-** Exception Vectors
-*/
-#if defined(CPU_R3000)
-#define UT_VEC K0BASE /* utlbmiss vector */
-#define E_VEC (K0BASE+0x80) /* exception vevtor */
-#endif
-#if defined(CPU_R4000)
-#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 */
-#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 defined(CPU_R4000)
-/* 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
-
-#ifndef wait
-#define wait .word 0x42000020
-#endif wait
-
-#endif
-
-/*
-** TLB resource defines
-*/
-#if defined(CPU_R3000)
-#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 defined(CPU_R4000)
-#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<<TLBLO_CSHIFT)
-#define TLBLO_NONCOHERENT (CFG_C_NONCOHERENT<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTXCL (CFG_C_COHERENTXCL<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTXCLW (CFG_C_COHERENTXCLW<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTUPD (CFG_C_COHERENTUPD<<TLBLO_CSHIFT)
-
-#define TLBINX_PROBE 0x80000000
-#define TLBINX_INXMASK 0x0000003f
-
-#define TLBRAND_RANDMASK 0x0000003f
-
-#define TLBCTXT_BASEMASK 0xff800000
-#define TLBCTXT_BASESHIFT 23
-
-#define TLBCTXT_VPN2MASK 0x007ffff0
-#define TLBCTXT_VPN2SHIFT 4
-
-#define TLBPGMASK_MASK 0x01ffe000
-#endif
-
-#if defined(CPU_R3000)
-#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_BEV 0x00400000 /* use boot exception vectors */
-
-/* Cache control bits */
-#define SR_TS 0x00200000 /* TLB shutdown */
-#define SR_PE 0x00100000 /* cache parity error */
-#define SR_CM 0x00080000 /* cache miss */
-#define SR_PZ 0x00040000 /* cache parity zero */
-#define SR_SWC 0x00020000 /* swap cache */
-#define SR_ISC 0x00010000 /* Isolate data cache */
-
-/*
-** 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_KUO 0x00000020 /* old kernel/user, 0 => 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 defined(CPU_R4000)
-#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_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 defined(CPU_R3000)
-#define C0_TLBLO $2 /* tlb entry low */
-#endif
-#if defined(CPU_R4000)
-#define C0_TLBLO0 $2 /* tlb entry low 0 */
-#define C0_TLBLO1 $3 /* tlb entry low 1 */
-#endif
-
-#define C0_CTXT $4 /* tlb context */
-
-#if defined(CPU_R4000)
-#define C0_PAGEMASK $5 /* tlb page mask */
-#define C0_WIRED $6 /* number of wired tlb entries */
-#endif
-
-#define C0_BADVADDR $8 /* bad virtual address */
-
-#if defined(CPU_R4000)
-#define C0_COUNT $9 /* cycle count */
-#endif
-
-#define C0_TLBHI $10 /* tlb entry hi */
-
-#if defined(CPU_R4000)
-#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 defined(CPU_R3000)
-#define C0_CONFIG $3 /* configuration register R3081*/
-#endif
-
-#if defined(CPU_R4000)
-#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
-
-#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/c/src/exec/score/cpu/mips/idtmon.h b/c/src/exec/score/cpu/mips/idtmon.h
deleted file mode 100644
index b42211ed5c..0000000000
--- a/c/src/exec/score/cpu/mips/idtmon.h
+++ /dev/null
@@ -1,171 +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$
-*/
-
-/*
-** idtmon.h - General header file for the IDT Prom Monitor
-**
-** Copyright 1989 Integrated Device Technology, Inc.
-** All Rights Reserved.
-**
-** June 1989 - D.Cahoon
-*/
-#ifndef __IDTMON_H__
-#define __IDTMON_H__
-
-/*
-** P_STACKSIZE is the size of the Prom Stack.
-** the prom stack grows downward
-*/
-#define P_STACKSIZE 0x2000 /* sets stack size to 8k */
-
-/*
-** M_BUSWIDTH
-** Memory bus width (including bank interleaving) in bytes
-** used when doing memory sizing to prevent bus capacitance
-** reporting ghost memory locations
-*/
-#if defined(CPU_R3000)
-#define M_BUSWIDTH 8 /* 32bit memory bank interleaved */
-#endif
-#if defined(CPU_R4000)
-#define M_BUSWIDTH 16 /* 64 bit memory bank interleaved */
-#endif
-
-/*
-** this is the default value for the number of bytes to add in calculating
-** the checksums in the checksum command
-*/
-#define CHK_SUM_CNT 0x20000 /* number of bytes to calc chksum for */
-
-/*
-** Monitor modes
-*/
-#define MODE_MONITOR 5 /* IDT Prom Monitor is executing */
-#define MODE_USER 0xa /* USER is executing */
-
-/*
-** memory reference widths
-*/
-#define SW_BYTE 1
-#define SW_HALFWORD 2
-#define SW_WORD 4
-#define SW_TRIBYTEL 12
-#define SW_TRIBYTER 20
-
-#ifdef CPU_R4000
-/*
-** definitions for select_cache call
-*/
-#define DCACHE 0
-#define ICACHE 1
-#define SCACHE 2
-
-#endif
-
-#if defined (CLANGUAGE) || defined(_LANGUAGE_C)
-typedef struct {
- unsigned int mem_size;
- unsigned int icache_size;
- unsigned int dcache_size;
-#ifdef CPU_R4000
- unsigned int scache_size;
-#endif
-
- } mem_config;
-
-#endif CLANGUAGE || defined(_LANGUAGE_C)
-
-/*
-** general equates for diagnostics and boolean functions
-*/
-#define PASS 0
-#define FAIL 1
-
-#ifndef TRUE
-#define TRUE 1
-#endif TRUE
-#ifndef NULL
-#define NULL 0
-#endif NULL
-
-#ifndef FALSE
-#define FALSE 0
-#endif FALSE
-
-
-/*
-** portablility equates
-*/
-
-#ifndef BOOL
-#define BOOL unsigned int
-#endif BOOL
-
-#ifndef GLOBAL
-#define GLOBAL /**/
-#endif GLOBAL
-
-#ifndef MLOCAL
-#define MLOCAL static
-#endif MLOCAL
-
-
-#ifdef XDS
-#define CONST const
-#else
-#define CONST
-#endif XDS
-
-#define u_char unsigned char
-#define u_short unsigned short
-#define u_int unsigned int
-/*
-** assembly instructions for compatability between xds and mips
-*/
-#ifndef XDS
-#define sllv sll
-#define srlv srl
-#endif XDS
-/*
-** 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
-#endif /* __IDTMON_H__ */
diff --git a/c/src/exec/score/cpu/mips/iregdef.h b/c/src/exec/score/cpu/mips/iregdef.h
deleted file mode 100644
index f0953da852..0000000000
--- a/c/src/exec/score/cpu/mips/iregdef.h
+++ /dev/null
@@ -1,325 +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 save reg area
-*/
-#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_F0 32
-#define R_F1 33
-#define R_F2 34
-#define R_F3 35
-#define R_F4 36
-#define R_F5 37
-#define R_F6 38
-#define R_F7 39
-#define R_F8 40
-#define R_F9 41
-#define R_F10 42
-#define R_F11 43
-#define R_F12 44
-#define R_F13 45
-#define R_F14 46
-#define R_F15 47
-#define R_F16 48
-#define R_F17 49
-#define R_F18 50
-#define R_F19 51
-#define R_F20 52
-#define R_F21 53
-#define R_F22 54
-#define R_F23 55
-#define R_F24 56
-#define R_F25 57
-#define R_F26 58
-#define R_F27 59
-#define R_F28 60
-#define R_F29 61
-#define R_F30 62
-#define R_F31 63
-#define NCLIENTREGS 64
-#define R_EPC 64
-#define R_MDHI 65
-#define R_MDLO 66
-#define R_SR 67
-#define R_CAUSE 68
-#define R_TLBHI 69
-#if defined(CPU_R3000)
-#define R_TLBLO 70
-#endif
-#if defined(CPU_R4000)
-#define R_TLBLO0 70
-#endif
-#define R_BADVADDR 71
-#define R_INX 72
-#define R_RAND 73
-#define R_CTXT 74
-#define R_EXCTYPE 75
-#define R_MODE 76
-#define R_PRID 77
-#define R_FCSR 78
-#define R_FEIR 79
-#if defined(CPU_R3000)
-#define NREGS 80
-#endif
-#if defined(CPU_R4000)
-#define R_TLBLO1 80
-#define R_PAGEMASK 81
-#define R_WIRED 82
-#define R_COUNT 83
-#define R_COMPARE 84
-#define R_CONFIG 85
-#define R_LLADDR 86
-#define R_WATCHLO 87
-#define R_WATCHHI 88
-#define R_ECC 89
-#define R_CACHEERR 90
-#define R_TAGLO 91
-#define R_TAGHI 92
-#define R_ERRPC 93
-#define R_XCTXT 94 /* Ketan added from SIM64bit */
-
-#define NREGS 95
-#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
-
-/* Ketan added the following */
-#ifdef CPU_R3000
-#define sreg sw
-#define lreg lw
-#define rmfc0 mfc0
-#define rmtc0 mtc0
-#define R_SZ 4
-#endif CPU_R3000
-
-#ifdef CPU_R4000
-#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 CPU_R4000
-/* Ketan till here */
-
-#endif /* __IREGDEF_H__ */
-
diff --git a/c/src/exec/score/cpu/mips/rtems.c b/c/src/exec/score/cpu/mips/rtems.c
deleted file mode 100644
index 356f1b8b9e..0000000000
--- a/c/src/exec/score/cpu/mips/rtems.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* rtems.c ===> rtems.S or rtems.s
- *
- * This file contains the single entry point code for
- * the XXX implementation of RTEMS.
- *
- * NOTE: This is supposed to be a .S or .s file NOT a C file.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)rtems.c 03/15/96 1.1\n";
- */
-
-
-/*
- * This is supposed to be an assembly file. This means that system.h
- * and cpu.h should not be included in a "real" rtems file.
- */
-
-#include <rtems/system.h>
-#include <rtems/score/cpu.h>
-/* #include "asm.h> */
-
-/*
- * RTEMS
- *
- * This routine jumps to the directive indicated in the
- * CPU defined register. This routine is used when RTEMS is
- * linked by itself and placed in ROM. This routine is the
- * first address in the ROM space for RTEMS. The user "calls"
- * this address with the directive arguments in the normal place.
- * This routine then jumps indirectly to the correct directive
- * preserving the arguments. The directive should not realize
- * it has been "wrapped" in this way. The table "_Entry_points"
- * is used to look up the directive.
- */
-
-void RTEMS()
-{
-}
-
diff --git a/c/src/exec/score/cpu/mips64orion/Makefile.in b/c/src/exec/score/cpu/mips64orion/Makefile.in
deleted file mode 100644
index 21985cd257..0000000000
--- a/c/src/exec/score/cpu/mips64orion/Makefile.in
+++ /dev/null
@@ -1,82 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-RELS=$(ARCH)/rtems-cpu.rel
-
-# C source names, if any, go here -- minus the .c
-# Normally cpu_asm and rtems are assembly files
-C_PIECES=cpu rtems
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/cpu.h $(srcdir)/mips64orion.h $(srcdir)/mipstypes.h \
- $(srcdir)/idtcpu.h $(srcdir)/iregdef.h $(srcdir)/idtmon.h
-
-# H_FILES that get installed externally
-EXTERNAL_H_FILES = $(srcdir)/asm.h
-
-# Assembly source names, if any, go here -- minus the .s
-# Normally cpu_asm and rtems are assembly files
-S_PIECES=cpu_asm
-S_FILES=$(S_PIECES:%=%.S)
-S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) $(EXTERNAL_H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) preinstall $(OBJS) $(RELS)
- $(INSTALL_VARIANT) -m 444 $(RELS) ${PROJECT_RELEASE}/lib
-
-$(ARCH)/rtems-cpu.rel: $(OBJS)
- $(make-rel)
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-
-preinstall: $(ARCH) $(PROJECT_INCLUDE)/rtems/score/targopts.h \
- ${PROJECT_RELEASE}/lib/bsp_specs
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
-# we will share the basic cpu file
- $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
-
-$(PROJECT_INCLUDE)/rtems/score/targopts.h: $(ARCH)/targopts.h-tmp
- $(INSTALL) -m 444 $(ARCH)/targopts.h-tmp $@
-
-# $(ARCH)/targopts.h-tmp rule is in leaf.cfg
-
-${PROJECT_RELEASE}/lib/bsp_specs: $(ARCH)/bsp_specs.tmp
- $(INSTALL) -m 444 $(ARCH)/bsp_specs.tmp $@
-
-# $(ARCH)/bsp_specs.tmp rule is in leaf.cfg
diff --git a/c/src/exec/score/cpu/mips64orion/asm.h b/c/src/exec/score/cpu/mips64orion/asm.h
deleted file mode 100644
index fccd89069f..0000000000
--- a/c/src/exec/score/cpu/mips64orion/asm.h
+++ /dev/null
@@ -1,102 +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 <rtems/score/targopts.h>
-#include <rtems/score/no_cpu.h>
-
-/*
- * 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/c/src/exec/score/cpu/mips64orion/cpu.c b/c/src/exec/score/cpu/mips64orion/cpu.c
deleted file mode 100644
index 4617be460d..0000000000
--- a/c/src/exec/score/cpu/mips64orion/cpu.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Mips CPU Dependent Source
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)cpu.c 08/20/96 1.5\n";
- */
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/wkspace.h>
-
-
-ISR_Handler_entry _ISR_Vector_table[ ISR_NUMBER_OF_VECTORS ];
-
-/* _CPU_Initialize
- *
- * This routine performs processor dependent initialization.
- *
- * INPUT PARAMETERS:
- * cpu_table - CPU table to initialize
- * thread_dispatch - address of disptaching routine
- */
-
-
-void null_handler( void )
-{
-}
-
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch) /* ignored on this CPU */
-)
-{
- unsigned int i = ISR_NUMBER_OF_VECTORS;
-
- while ( i-- )
- {
- _ISR_Vector_table[i] = (ISR_Handler_entry)null_handler;
- }
-
- /*
- * The thread_dispatch argument is the address of the entry point
- * for the routine called at the end of an ISR once it has been
- * decided a context switch is necessary. On some compilation
- * systems it is difficult to call a high-level language routine
- * from assembly. This allows us to trick these systems.
- *
- * If you encounter this problem save the entry point in a CPU
- * dependent variable.
- */
-
- _CPU_Thread_dispatch_pointer = thread_dispatch;
-
- /*
- * If there is not an easy way to initialize the FP context
- * during Context_Initialize, then it is usually easier to
- * save an "uninitialized" FP context here and copy it to
- * the task's during Context_Initialize.
- */
-
- /* FP context initialization support goes here */
-
- _CPU_Table = *cpu_table;
-
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-#if 0 /* located in cpu_asm.S */
-unsigned32 _CPU_ISR_Get_level( void )
-{
- /*
- * This routine returns the current interrupt level.
- */
-}
-#endif
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- /*
- * This is where we install the interrupt handler into the "raw" interrupt
- * table used by the CPU to dispatch interrupt handlers.
- */
-
-#if 0 /* not necessary */
-/* use IDT/Sim to set interrupt vector. Needed to co-exist with debugger. */
- add_ext_int_func( vector, new_handler );
-#endif
-}
-
-/*PAGE
- *
- * _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
-)
-{
- *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.
- */
-
- _CPU_ISR_install_raw_handler( vector, _ISR_Handler, old_handler );
-
- /*
- * 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;
-}
-
-/*PAGE
- *
- * _CPU_Install_interrupt_stack
- */
-
-void _CPU_Install_interrupt_stack( void )
-{
-/* we don't support this yet */
-}
-
-/*PAGE
- *
- * _CPU_Internal_threads_Idle_thread_body
- *
- * NOTES:
- *
- * 1. This is the same as the regular CPU independent algorithm.
- *
- * 2. If you implement this using a "halt", "idle", or "shutdown"
- * instruction, then don't forget to put it in an infinite loop.
- *
- * 3. Be warned. Some processors with onboard DMA have been known
- * to stop the DMA if the CPU were put in IDLE mode. This might
- * also be a problem with other on-chip peripherals. So use this
- * hook with caution.
- */
-
-#if 0 /* located in cpu_asm.S */
-void _CPU_Thread_Idle_body( void )
-{
-
- for( ; ; )
- /* insert your "halt" instruction here */ ;
-}
-#endif
-
-extern void mips_break( int error );
-
-#include <stdio.h>
-
-void mips_fatal_error( int error )
-{
- printf("fatal error 0x%x %d\n",error,error);
- mips_break( error );
-}
diff --git a/c/src/exec/score/cpu/mips64orion/cpu.h b/c/src/exec/score/cpu/mips64orion/cpu.h
deleted file mode 100644
index 0dfa3b0e98..0000000000
--- a/c/src/exec/score/cpu/mips64orion/cpu.h
+++ /dev/null
@@ -1,969 +0,0 @@
-/* cpu.h
- *
- * This include file contains information pertaining to the IDT 4650
- * processor.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu.h:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-/* @(#)cpu.h 08/29/96 1.7 */
-
-#ifndef __CPU_h
-#define __CPU_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mips64orion.h> /* pick up machine definitions */
-#ifndef ASM
-#include <rtems/score/mipstypes.h>
-#endif
-
-extern int mips_disable_interrupts( void );
-extern void mips_enable_interrupts( int _level );
-extern int mips_disable_global_interrupts( void );
-extern void mips_enable_global_interrupts( void );
-extern void mips_fatal_error ( int error );
-
-/* conditional compilation parameters */
-
-/*
- * Should the calls to _Thread_Enable_dispatch be inlined?
- *
- * If TRUE, then they are inlined.
- * If FALSE, then a subroutine call is made.
- *
- * Basically this is an example of the classic trade-off of size
- * versus speed. Inlining the call (TRUE) typically increases the
- * size of RTEMS while speeding up the enabling of dispatching.
- * [NOTE: In general, the _Thread_Dispatch_disable_level will
- * only be 0 or 1 unless you are in an interrupt handler and that
- * interrupt handler invokes the executive.] When not inlined
- * something calls _Thread_Enable_dispatch which in turns calls
- * _Thread_Dispatch. If the enable dispatch is inlined, then
- * one subroutine call is avoided entirely.]
- */
-
-#define CPU_INLINE_ENABLE_DISPATCH TRUE
-
-/*
- * Should the body of the search loops in _Thread_queue_Enqueue_priority
- * be unrolled one time? In unrolled each iteration of the loop examines
- * two "nodes" on the chain being searched. Otherwise, only one node
- * is examined per iteration.
- *
- * If TRUE, then the loops are unrolled.
- * If FALSE, then the loops are not unrolled.
- *
- * The primary factor in making this decision is the cost of disabling
- * and enabling interrupts (_ISR_Flash) versus the cost of rest of the
- * body of the loop. On some CPUs, the flash is more expensive than
- * one iteration of the loop body. In this case, it might be desirable
- * to unroll the loop. It is important to note that on some CPUs, this
- * code is the longest interrupt disable period in RTEMS. So it is
- * necessary to strike a balance when setting this parameter.
- */
-
-#define CPU_UNROLL_ENQUEUE_PRIORITY TRUE
-
-/*
- * Does RTEMS manage a dedicated interrupt stack in software?
- *
- * If TRUE, then a stack is allocated in _Interrupt_Manager_initialization.
- * If FALSE, nothing is done.
- *
- * If the CPU supports a dedicated interrupt stack in hardware,
- * then it is generally the responsibility of the BSP to allocate it
- * and set it up.
- *
- * If the CPU does not support a dedicated interrupt stack, then
- * the porter has two options: (1) execute interrupts on the
- * stack of the interrupted task, and (2) have RTEMS manage a dedicated
- * interrupt stack.
- *
- * If this is TRUE, CPU_ALLOCATE_INTERRUPT_STACK should also be TRUE.
- *
- * Only one of CPU_HAS_SOFTWARE_INTERRUPT_STACK and
- * CPU_HAS_HARDWARE_INTERRUPT_STACK should be set to TRUE. It is
- * possible that both are FALSE for a particular CPU. Although it
- * is unclear what that would imply about the interrupt processing
- * procedure on that CPU.
- */
-
-#define CPU_HAS_SOFTWARE_INTERRUPT_STACK FALSE
-
-/*
- * Does this CPU have hardware support for a dedicated interrupt stack?
- *
- * If TRUE, then it must be installed during initialization.
- * If FALSE, then no installation is performed.
- *
- * If this is TRUE, CPU_ALLOCATE_INTERRUPT_STACK should also be TRUE.
- *
- * Only one of CPU_HAS_SOFTWARE_INTERRUPT_STACK and
- * CPU_HAS_HARDWARE_INTERRUPT_STACK should be set to TRUE. It is
- * possible that both are FALSE for a particular CPU. Although it
- * is unclear what that would imply about the interrupt processing
- * procedure on that CPU.
- */
-
-#define CPU_HAS_HARDWARE_INTERRUPT_STACK FALSE
-
-/*
- * Does RTEMS allocate a dedicated interrupt stack in the Interrupt Manager?
- *
- * If TRUE, then the memory is allocated during initialization.
- * If FALSE, then the memory is allocated during initialization.
- *
- * This should be TRUE is CPU_HAS_SOFTWARE_INTERRUPT_STACK is TRUE
- * or CPU_INSTALL_HARDWARE_INTERRUPT_STACK is TRUE.
- */
-
-#define CPU_ALLOCATE_INTERRUPT_STACK FALSE
-
-/*
- * Does the RTEMS invoke the user's ISR with the vector number and
- * a pointer to the saved interrupt frame (1) or just the vector
- * number (0)?
- */
-
-#define CPU_ISR_PASSES_FRAME_POINTER 0
-
-/*
- * Does the CPU have hardware floating point?
- *
- * If TRUE, then the RTEMS_FLOATING_POINT task attribute is supported.
- * If FALSE, then the RTEMS_FLOATING_POINT task attribute is ignored.
- *
- * If there is a FP coprocessor such as the i387 or mc68881, then
- * the answer is TRUE.
- *
- * The macro name "MIPS64ORION_HAS_FPU" should be made CPU specific.
- * It indicates whether or not this CPU model has FP support. For
- * example, it would be possible to have an i386_nofp CPU model
- * which set this to false to indicate that you have an i386 without
- * an i387 and wish to leave floating point support out of RTEMS.
- */
-
-#if ( MIPS64ORION_HAS_FPU == 1 )
-#define CPU_HARDWARE_FP TRUE
-#else
-#define CPU_HARDWARE_FP FALSE
-#endif
-
-/*
- * Are all tasks RTEMS_FLOATING_POINT tasks implicitly?
- *
- * If TRUE, then the RTEMS_FLOATING_POINT task attribute is assumed.
- * If FALSE, then the RTEMS_FLOATING_POINT task attribute is followed.
- *
- * So far, the only CPU in which this option has been used is the
- * HP PA-RISC. The HP C compiler and gcc both implicitly use the
- * floating point registers to perform integer multiplies. If
- * a function which you would not think utilize the FP unit DOES,
- * then one can not easily predict which tasks will use the FP hardware.
- * In this case, this option should be TRUE.
- *
- * If CPU_HARDWARE_FP is FALSE, then this should be FALSE as well.
- */
-
-#define CPU_ALL_TASKS_ARE_FP FALSE
-
-/*
- * Should the IDLE task have a floating point context?
- *
- * If TRUE, then the IDLE task is created as a RTEMS_FLOATING_POINT task
- * and it has a floating point context which is switched in and out.
- * If FALSE, then the IDLE task does not have a floating point context.
- *
- * Setting this to TRUE negatively impacts the time required to preempt
- * the IDLE task from an interrupt because the floating point context
- * must be saved as part of the preemption.
- */
-
-#define CPU_IDLE_TASK_IS_FP FALSE
-
-/*
- * Should the saving of the floating point registers be deferred
- * until a context switch is made to another different floating point
- * task?
- *
- * If TRUE, then the floating point context will not be stored until
- * necessary. It will remain in the floating point registers and not
- * disturned until another floating point task is switched to.
- *
- * If FALSE, then the floating point context is saved when a floating
- * point task is switched out and restored when the next floating point
- * task is restored. The state of the floating point registers between
- * those two operations is not specified.
- *
- * If the floating point context does NOT have to be saved as part of
- * interrupt dispatching, then it should be safe to set this to TRUE.
- *
- * Setting this flag to TRUE results in using a different algorithm
- * for deciding when to save and restore the floating point context.
- * The deferred FP switch algorithm minimizes the number of times
- * the FP context is saved and restored. The FP context is not saved
- * until a context switch is made to another, different FP task.
- * Thus in a system with only one FP task, the FP context will never
- * be saved or restored.
- */
-
-#define CPU_USE_DEFERRED_FP_SWITCH TRUE
-
-/*
- * Does this port provide a CPU dependent IDLE task implementation?
- *
- * If TRUE, then the routine _CPU_Internal_threads_Idle_thread_body
- * must be provided and is the default IDLE thread body instead of
- * _Internal_threads_Idle_thread_body.
- *
- * If FALSE, then use the generic IDLE thread body if the BSP does
- * not provide one.
- *
- * This is intended to allow for supporting processors which have
- * a low power or idle mode. When the IDLE thread is executed, then
- * the CPU can be powered down.
- *
- * The order of precedence for selecting the IDLE thread body is:
- *
- * 1. BSP provided
- * 2. CPU dependent (if provided)
- * 3. generic (if no BSP and no CPU dependent)
- */
-
-/* we can use the low power wait instruction for the IDLE thread */
-#define CPU_PROVIDES_IDLE_THREAD_BODY TRUE
-
-/*
- * Does the stack grow up (toward higher addresses) or down
- * (toward lower addresses)?
- *
- * If TRUE, then the grows upward.
- * If FALSE, then the grows toward smaller addresses.
- */
-
-/* our stack grows down */
-#define CPU_STACK_GROWS_UP FALSE
-
-/*
- * The following is the variable attribute used to force alignment
- * of critical RTEMS structures. On some processors it may make
- * sense to have these aligned on tighter boundaries than
- * the minimum requirements of the compiler in order to have as
- * much of the critical data area as possible in a cache line.
- *
- * The placement of this macro in the declaration of the variables
- * is based on the syntactically requirements of the GNU C
- * "__attribute__" extension. For example with GNU C, use
- * the following to force a structures to a 32 byte boundary.
- *
- * __attribute__ ((aligned (32)))
- *
- * NOTE: Currently only the Priority Bit Map table uses this feature.
- * To benefit from using this, the data must be heavily
- * used so it will stay in the cache and used frequently enough
- * in the executive to justify turning this on.
- */
-
-/* our cache line size is 16 bytes */
-#if __GNUC__
-#define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned (16)))
-#else
-#define CPU_STRUCTURE_ALIGNMENT
-#endif
-
-/*
- * Define what is required to specify how the network to host conversion
- * routines are handled.
- */
-
-#define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE
-#define CPU_BIG_ENDIAN TRUE
-#define CPU_LITTLE_ENDIAN FALSE
-
-/*
- * The following defines the number of bits actually used in the
- * interrupt field of the task mode. How those bits map to the
- * CPU interrupt levels is defined by the routine _CPU_ISR_Set_level().
- */
-
-#define CPU_MODES_INTERRUPT_MASK 0x00000001
-
-/*
- * Processor defined structures
- *
- * Examples structures include the descriptor tables from the i386
- * and the processor control structure on the i960ca.
- */
-
-/* may need to put some structures here. */
-
-/*
- * Contexts
- *
- * Generally there are 2 types of context to save.
- * 1. Interrupt registers to save
- * 2. Task level registers to save
- *
- * This means we have the following 3 context items:
- * 1. task level context stuff:: Context_Control
- * 2. floating point task stuff:: Context_Control_fp
- * 3. special interrupt level context :: Context_Control_interrupt
- *
- * On some processors, it is cost-effective to save only the callee
- * preserved registers during a task context switch. This means
- * that the ISR code needs to save those registers which do not
- * persist across function calls. It is not mandatory to make this
- * distinctions between the caller/callee saves registers for the
- * purpose of minimizing context saved during task switch and on interrupts.
- * If the cost of saving extra registers is minimal, simplicity is the
- * choice. Save the same context on interrupt entry as for tasks in
- * this case.
- *
- * Additionally, if gdb is to be made aware of RTEMS tasks for this CPU, then
- * care should be used in designing the context area.
- *
- * On some CPUs with hardware floating point support, the Context_Control_fp
- * structure will not be used or it simply consist of an array of a
- * fixed number of bytes. This is done when the floating point context
- * is dumped by a "FP save context" type instruction and the format
- * is not really defined by the CPU. In this case, there is no need
- * to figure out the exact format -- only the size. Of course, although
- * this is enough information for RTEMS, it is probably not enough for
- * a debugger such as gdb. But that is another problem.
- */
-
-/* WARNING: If this structure is modified, the constants in cpu.h must be updated. */
-typedef struct {
- unsigned64 s0;
- unsigned64 s1;
- unsigned64 s2;
- unsigned64 s3;
- unsigned64 s4;
- unsigned64 s5;
- unsigned64 s6;
- unsigned64 s7;
- unsigned64 sp;
- unsigned64 fp;
- unsigned64 ra;
- unsigned64 c0_sr;
- unsigned64 c0_epc;
-} Context_Control;
-
-/* WARNING: If this structure is modified, the constants in cpu.h must be updated. */
-typedef struct {
- unsigned32 fp0;
- unsigned32 fp1;
- unsigned32 fp2;
- unsigned32 fp3;
- unsigned32 fp4;
- unsigned32 fp5;
- unsigned32 fp6;
- unsigned32 fp7;
- unsigned32 fp8;
- unsigned32 fp9;
- unsigned32 fp10;
- unsigned32 fp11;
- unsigned32 fp12;
- unsigned32 fp13;
- unsigned32 fp14;
- unsigned32 fp15;
- unsigned32 fp16;
- unsigned32 fp17;
- unsigned32 fp18;
- unsigned32 fp19;
- unsigned32 fp20;
- unsigned32 fp21;
- unsigned32 fp22;
- unsigned32 fp23;
- unsigned32 fp24;
- unsigned32 fp25;
- unsigned32 fp26;
- unsigned32 fp27;
- unsigned32 fp28;
- unsigned32 fp29;
- unsigned32 fp30;
- unsigned32 fp31;
-} Context_Control_fp;
-
-typedef struct {
- unsigned32 special_interrupt_register;
-} CPU_Interrupt_frame;
-
-
-/*
- * The following table contains the information required to configure
- * the mips processor specific parameters.
- */
-
-typedef struct {
- void (*pretasking_hook)( void );
- void (*predriver_hook)( void );
- void (*postdriver_hook)( void );
- void (*idle_task)( void );
- boolean do_zero_of_workspace;
- unsigned32 idle_task_stack_size;
- unsigned32 interrupt_stack_size;
- unsigned32 extra_mpci_receive_server_stack;
- void * (*stack_allocate_hook)( unsigned32 );
- void (*stack_free_hook)( void* );
- /* end of fields required on all CPUs */
-
- unsigned32 some_other_cpu_dependent_info;
-} rtems_cpu_table;
-
-/*
- * This variable is optional. It is used on CPUs on which it is difficult
- * to generate an "uninitialized" FP context. It is filled in by
- * _CPU_Initialize and copied into the task's FP context area during
- * _CPU_Context_Initialize.
- */
-
-SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context;
-
-/*
- * On some CPUs, RTEMS supports a software managed interrupt stack.
- * This stack is allocated by the Interrupt Manager and the switch
- * is performed in _ISR_Handler. These variables contain pointers
- * to the lowest and highest addresses in the chunk of memory allocated
- * for the interrupt stack. Since it is unknown whether the stack
- * grows up or down (in general), this give the CPU dependent
- * code the option of picking the version it wants to use.
- *
- * NOTE: These two variables are required if the macro
- * CPU_HAS_SOFTWARE_INTERRUPT_STACK is defined as TRUE.
- */
-
-SCORE_EXTERN void *_CPU_Interrupt_stack_low;
-SCORE_EXTERN void *_CPU_Interrupt_stack_high;
-
-/*
- * With some compilation systems, it is difficult if not impossible to
- * call a high-level language routine from assembly language. This
- * is especially true of commercial Ada compilers and name mangling
- * C++ ones. This variable can be optionally defined by the CPU porter
- * and contains the address of the routine _Thread_Dispatch. This
- * can make it easier to invoke that routine at the end of the interrupt
- * sequence (if a dispatch is necessary).
- */
-
-SCORE_EXTERN void (*_CPU_Thread_dispatch_pointer)();
-
-/*
- * Nothing prevents the porter from declaring more CPU specific variables.
- */
-
-/* XXX: if needed, put more variables here */
-
-/*
- * The size of the floating point context area. On some CPUs this
- * will not be a "sizeof" because the format of the floating point
- * area is not defined -- only the size is. This is usually on
- * CPUs with a "floating point save context" instruction.
- */
-
-#define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp )
-
-/*
- * Amount of extra stack (above minimum stack size) required by
- * system initialization thread. Remember that in a multiprocessor
- * system the system intialization thread becomes the MP server thread.
- */
-
-#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0
-
-/*
- * This defines the number of entries in the ISR_Vector_table managed
- * by RTEMS.
- */
-
-#define CPU_INTERRUPT_NUMBER_OF_VECTORS 8
-#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1)
-
-/*
- * Should be large enough to run all RTEMS tests. This insures
- * that a "reasonable" small application should not have any problems.
- */
-
-#define CPU_STACK_MINIMUM_SIZE (2048*sizeof(unsigned32))
-
-/*
- * CPU's worst alignment requirement for data types on a byte boundary. This
- * alignment does not take into account the requirements for the stack.
- */
-
-#define CPU_ALIGNMENT 8
-
-/*
- * This number corresponds to the byte alignment requirement for the
- * heap handler. This alignment requirement may be stricter than that
- * for the data types alignment specified by CPU_ALIGNMENT. It is
- * common for the heap to follow the same alignment requirement as
- * CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict enough for the heap,
- * then this should be set to CPU_ALIGNMENT.
- *
- * NOTE: This does not have to be a power of 2. It does have to
- * be greater or equal to than CPU_ALIGNMENT.
- */
-
-#define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * This number corresponds to the byte alignment requirement for memory
- * buffers allocated by the partition manager. This alignment requirement
- * may be stricter than that for the data types alignment specified by
- * CPU_ALIGNMENT. It is common for the partition to follow the same
- * alignment requirement as CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict
- * enough for the partition, then this should be set to CPU_ALIGNMENT.
- *
- * NOTE: This does not have to be a power of 2. It does have to
- * be greater or equal to than CPU_ALIGNMENT.
- */
-
-#define CPU_PARTITION_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * This number corresponds to the byte alignment requirement for the
- * stack. This alignment requirement may be stricter than that for the
- * data types alignment specified by CPU_ALIGNMENT. If the CPU_ALIGNMENT
- * is strict enough for the stack, then this should be set to 0.
- *
- * NOTE: This must be a power of 2 either 0 or greater than CPU_ALIGNMENT.
- */
-
-#define CPU_STACK_ALIGNMENT CPU_ALIGNMENT
-
-/* ISR handler macros */
-
-/*
- * Disable all interrupts for an RTEMS critical section. The previous
- * level is returned in _level.
- */
-
-#define _CPU_ISR_Disable( _int_level ) \
- do{ \
- _int_level = mips_disable_interrupts(); \
- }while(0)
-
-/*
- * Enable interrupts to the previous level (returned by _CPU_ISR_Disable).
- * This indicates the end of an RTEMS critical section. The parameter
- * _level is not modified.
- */
-
-#define _CPU_ISR_Enable( _level ) \
- do{ \
- mips_enable_interrupts(_level); \
- }while(0)
-
-/*
- * This temporarily restores the interrupt to _level before immediately
- * disabling them again. This is used to divide long RTEMS critical
- * sections into two or more parts. The parameter _level is not
- * modified.
- */
-
-#define _CPU_ISR_Flash( _xlevel ) \
- do{ \
- int _scratch; \
- _CPU_ISR_Enable( _xlevel ); \
- _CPU_ISR_Disable( _scratch ); \
- }while(0)
-
-/*
- * Map interrupt level in task mode onto the hardware that the CPU
- * actually provides. Currently, interrupt levels which do not
- * map onto the CPU in a generic fashion are undefined. Someday,
- * it would be nice if these were "mapped" by the application
- * via a callout. For example, m68k has 8 levels 0 - 7, levels
- * 8 - 255 would be available for bsp/application specific meaning.
- * This could be used to manage a programmable interrupt controller
- * via the rtems_task_mode directive.
- */
-extern void _CPU_ISR_Set_level( unsigned32 _new_level );
-
-unsigned32 _CPU_ISR_Get_level( void );
-
-/* end of ISR handler macros */
-
-/* Context handler macros */
-
-/*
- * Initialize the context to a state suitable for starting a
- * task after a context restore operation. Generally, this
- * involves:
- *
- * - setting a starting address
- * - preparing the stack
- * - preparing the stack and frame pointers
- * - setting the proper interrupt level in the context
- * - initializing the floating point context
- *
- * This routine generally does not set any unnecessary register
- * in the context. The state of the "general data" registers is
- * undefined at task start time.
- *
- * NOTE: This is_fp parameter is TRUE if the thread is to be a floating
- * point thread. This is typically only used on CPUs where the
- * FPU may be easily disabled by software such as on the SPARC
- * where the PSR contains an enable FPU bit.
- */
-
-#define _CPU_Context_Initialize( _the_context, _stack_base, _size, \
- _isr, _entry_point, _is_fp ) \
- { \
- unsigned32 _stack_tmp = (unsigned32)(_stack_base) + (_size) - CPU_STACK_ALIGNMENT; \
- _stack_tmp &= ~(CPU_STACK_ALIGNMENT - 1); \
- (_the_context)->sp = _stack_tmp; \
- (_the_context)->fp = _stack_tmp; \
- (_the_context)->ra = (unsigned64)_entry_point; \
- (_the_context)->c0_sr = 0; \
- }
-
-/*
- * This routine is responsible for somehow restarting the currently
- * executing task. If you are lucky, then all that is necessary
- * is restoring the context. Otherwise, there will need to be
- * a special assembly routine which does something special in this
- * case. Context_Restore should work most of the time. It will
- * not work if restarting self conflicts with the stack frame
- * assumptions of restoring a context.
- */
-
-#define _CPU_Context_Restart_self( _the_context ) \
- _CPU_Context_restore( (_the_context) );
-
-/*
- * The purpose of this macro is to allow the initial pointer into
- * A floating point context area (used to save the floating point
- * context) to be at an arbitrary place in the floating point
- * context area.
- *
- * This is necessary because some FP units are designed to have
- * their context saved as a stack which grows into lower addresses.
- * Other FP units can be saved by simply moving registers into offsets
- * from the base of the context area. Finally some FP units provide
- * a "dump context" instruction which could fill in from high to low
- * or low to high based on the whim of the CPU designers.
- */
-
-#define _CPU_Context_Fp_start( _base, _offset ) \
- ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
-
-/*
- * This routine initializes the FP context area passed to it to.
- * There are a few standard ways in which to initialize the
- * floating point context. The code included for this macro assumes
- * that this is a CPU in which a "initial" FP context was saved into
- * _CPU_Null_fp_context and it simply copies it to the destination
- * context passed to it.
- *
- * Other models include (1) not doing anything, and (2) putting
- * a "null FP status word" in the correct place in the FP context.
- */
-
-#define _CPU_Context_Initialize_fp( _destination ) \
- { \
- *((Context_Control_fp *) *((void **) _destination)) = _CPU_Null_fp_context; \
- }
-
-/* end of Context handler macros */
-
-/* Fatal Error manager macros */
-
-/*
- * This routine copies _error into a known place -- typically a stack
- * location or a register, optionally disables interrupts, and
- * halts/stops the CPU.
- */
-
-#define _CPU_Fatal_halt( _error ) \
- { \
- mips_disable_global_interrupts(); \
- mips_fatal_error(_error); \
- }
-
-/* end of Fatal Error manager macros */
-
-/* Bitfield handler macros */
-
-/*
- * This routine sets _output to the bit number of the first bit
- * set in _value. _value is of CPU dependent type Priority_Bit_map_control.
- * This type may be either 16 or 32 bits wide although only the 16
- * least significant bits will be used.
- *
- * There are a number of variables in using a "find first bit" type
- * instruction.
- *
- * (1) What happens when run on a value of zero?
- * (2) Bits may be numbered from MSB to LSB or vice-versa.
- * (3) The numbering may be zero or one based.
- * (4) The "find first bit" instruction may search from MSB or LSB.
- *
- * RTEMS guarantees that (1) will never happen so it is not a concern.
- * (2),(3), (4) are handled by the macros _CPU_Priority_mask() and
- * _CPU_Priority_bits_index(). These three form a set of routines
- * which must logically operate together. Bits in the _value are
- * set and cleared based on masks built by _CPU_Priority_mask().
- * The basic major and minor values calculated by _Priority_Major()
- * and _Priority_Minor() are "massaged" by _CPU_Priority_bits_index()
- * to properly range between the values returned by the "find first bit"
- * instruction. This makes it possible for _Priority_Get_highest() to
- * calculate the major and directly index into the minor table.
- * This mapping is necessary to ensure that 0 (a high priority major/minor)
- * is the first bit found.
- *
- * This entire "find first bit" and mapping process depends heavily
- * on the manner in which a priority is broken into a major and minor
- * components with the major being the 4 MSB of a priority and minor
- * the 4 LSB. Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
- * priority. And (15 << 4) + 14 corresponds to priority 254 -- the next
- * to the lowest priority.
- *
- * If your CPU does not have a "find first bit" instruction, then
- * there are ways to make do without it. Here are a handful of ways
- * to implement this in software:
- *
- * - a series of 16 bit test instructions
- * - a "binary search using if's"
- * - _number = 0
- * if _value > 0x00ff
- * _value >>=8
- * _number = 8;
- *
- * if _value > 0x0000f
- * _value >=8
- * _number += 4
- *
- * _number += bit_set_table[ _value ]
- *
- * where bit_set_table[ 16 ] has values which indicate the first
- * bit set
- */
-
-#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
-#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
-
-#if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
-
-#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
- { \
- (_output) = 0; /* do something to prevent warnings */ \
- }
-
-#endif
-
-/* end of Bitfield handler macros */
-
-/*
- * This routine builds the mask which corresponds to the bit fields
- * as searched by _CPU_Bitfield_Find_first_bit(). See the discussion
- * for that routine.
- */
-
-#if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
-
-#define _CPU_Priority_Mask( _bit_number ) \
- ( 1 << (_bit_number) )
-
-#endif
-
-/*
- * This routine translates the bit numbers returned by
- * _CPU_Bitfield_Find_first_bit() into something suitable for use as
- * a major or minor component of a priority. See the discussion
- * for that routine.
- */
-
-#if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
-
-#define _CPU_Priority_bits_index( _priority ) \
- (_priority)
-
-#endif
-
-/* end of Priority handler macros */
-
-/* functions */
-
-/*
- * _CPU_Initialize
- *
- * This routine performs CPU dependent initialization.
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch)
-);
-
-/*
- * _CPU_ISR_install_raw_handler
- *
- * This routine installs a "raw" interrupt handler directly into the
- * processor's vector table.
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_ISR_install_vector
- *
- * This routine installs an interrupt vector.
- */
-
-void _CPU_ISR_install_vector(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_Install_interrupt_stack
- *
- * This routine installs the hardware interrupt stack pointer.
- *
- * NOTE: It need only be provided if CPU_HAS_HARDWARE_INTERRUPT_STACK
- * is TRUE.
- */
-
-void _CPU_Install_interrupt_stack( void );
-
-/*
- * _CPU_Internal_threads_Idle_thread_body
- *
- * This routine is the CPU dependent IDLE thread body.
- *
- * NOTE: It need only be provided if CPU_PROVIDES_IDLE_THREAD_BODY
- * is TRUE.
- */
-
-void _CPU_Thread_Idle_body( void );
-
-/*
- * _CPU_Context_switch
- *
- * This routine switches from the run context to the heir context.
- */
-
-void _CPU_Context_switch(
- Context_Control *run,
- Context_Control *heir
-);
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally 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.
- */
-
-void _CPU_Context_restore(
- Context_Control *new_context
-);
-
-/*
- * _CPU_Context_save_fp
- *
- * This routine saves the floating point context passed to it.
- */
-
-void _CPU_Context_save_fp(
- void **fp_context_ptr
-);
-
-/*
- * _CPU_Context_restore_fp
- *
- * This routine restores the floating point context passed to it.
- */
-
-void _CPU_Context_restore_fp(
- void **fp_context_ptr
-);
-
-/* The following routine swaps the endian format of an unsigned int.
- * It must be static because it is referenced indirectly.
- *
- * This version will work on any processor, but if there is a better
- * way for your CPU PLEASE use it. The most common way to do this is to:
- *
- * swap least significant two bytes with 16-bit rotate
- * swap upper and lower 16-bits
- * swap most significant two bytes with 16-bit rotate
- *
- * Some CPUs have special instructions which swap a 32-bit quantity in
- * a single instruction (e.g. i486). It is probably best to avoid
- * an "endian swapping control bit" in the CPU. One good reason is
- * that interrupts would probably have to be disabled to insure that
- * an interrupt does not try to access the same "chunk" with the wrong
- * endian. Another good reason is that on some CPUs, the endian bit
- * endianness for ALL fetches -- both code and data -- so the code
- * will be fetched incorrectly.
- */
-
-static inline unsigned int CPU_swap_u32(
- unsigned int value
-)
-{
- unsigned32 byte1, byte2, byte3, byte4, swapped;
-
- byte4 = (value >> 24) & 0xff;
- byte3 = (value >> 16) & 0xff;
- byte2 = (value >> 8) & 0xff;
- byte1 = value & 0xff;
-
- swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4;
- return( swapped );
-}
-
-#define CPU_swap_u16( value ) \
- (((value&0xff) << 8) | ((value >> 8)&0xff))
-
-/*
- * Miscellaneous prototypes
- *
- * NOTE: The names should have mips64orion in them.
- */
-
-void disable_int( unsigned32 mask );
-void enable_int( unsigned32 mask );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/exec/score/cpu/mips64orion/cpu_asm.S b/c/src/exec/score/cpu/mips64orion/cpu_asm.S
deleted file mode 100644
index 7dcb8fbda7..0000000000
--- a/c/src/exec/score/cpu/mips64orion/cpu_asm.S
+++ /dev/null
@@ -1,972 +0,0 @@
-/* cpu_asm.S
- *
- * This file contains the basic algorithms for all assembly code used
- * in an specific CPU port of RTEMS. These algorithms must be implemented
- * in assembly language
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu_asm.s:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-/* @(#)cpu_asm.S 08/20/96 1.15 */
-
-#include "cpu_asm.h"
-
-#include "iregdef.h"
-#include "idtcpu.h"
-
-#define FRAME(name,frm_reg,offset,ret_reg) \
- .globl name; \
- .ent name; \
-name:; \
- .frame frm_reg,offset,ret_reg
-#define ENDFRAME(name) \
- .end name
-
-
-#define EXCP_STACK_SIZE (NREGS*R_SZ)
-
-#if __ghs__
-#define sd sw
-#define ld lw
-#define dmtc0 mtc0
-#define dsll sll
-#define dmfc0 mfc0
-#endif
-
-#if 1 /* 32 bit unsigned32 types */
-#define sint sw
-#define lint lw
-#define stackadd addiu
-#define intadd addu
-#define SZ_INT 4
-#define SZ_INT_POW2 2
-#else /* 64 bit unsigned32 types */
-#define sint dw
-#define lint dw
-#define stackadd daddiu
-#define intadd daddu
-#define SZ_INT 8
-#define SZ_INT_POW2 3
-#endif
-
-#ifdef __GNUC__
-#define EXTERN(x,size) .extern x,size
-#else
-#define EXTERN(x,size)
-#endif
-
-/* NOTE: these constants must match the Context_Control structure in cpu.h */
-#define S0_OFFSET 0
-#define S1_OFFSET 1
-#define S2_OFFSET 2
-#define S3_OFFSET 3
-#define S4_OFFSET 4
-#define S5_OFFSET 5
-#define S6_OFFSET 6
-#define S7_OFFSET 7
-#define SP_OFFSET 8
-#define FP_OFFSET 9
-#define RA_OFFSET 10
-#define C0_SR_OFFSET 11
-#define C0_EPC_OFFSET 12
-
-/* NOTE: these constants must match the Context_Control_fp structure in cpu.h */
-#define FP0_OFFSET 0
-#define FP1_OFFSET 1
-#define FP2_OFFSET 2
-#define FP3_OFFSET 3
-#define FP4_OFFSET 4
-#define FP5_OFFSET 5
-#define FP6_OFFSET 6
-#define FP7_OFFSET 7
-#define FP8_OFFSET 8
-#define FP9_OFFSET 9
-#define FP10_OFFSET 10
-#define FP11_OFFSET 11
-#define FP12_OFFSET 12
-#define FP13_OFFSET 13
-#define FP14_OFFSET 14
-#define FP15_OFFSET 15
-#define FP16_OFFSET 16
-#define FP17_OFFSET 17
-#define FP18_OFFSET 18
-#define FP19_OFFSET 19
-#define FP20_OFFSET 20
-#define FP21_OFFSET 21
-#define FP22_OFFSET 22
-#define FP23_OFFSET 23
-#define FP24_OFFSET 24
-#define FP25_OFFSET 25
-#define FP26_OFFSET 26
-#define FP27_OFFSET 27
-#define FP28_OFFSET 28
-#define FP29_OFFSET 29
-#define FP30_OFFSET 30
-#define FP31_OFFSET 31
-
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-#if 0
-unsigned32 _CPU_ISR_Get_level( void )
-{
- /*
- * This routine returns the current interrupt level.
- */
-}
-#endif
-/* return the current exception level for the 4650 */
-FRAME(_CPU_ISR_Get_level,sp,0,ra)
- mfc0 v0,C0_SR
- nop
- andi v0,SR_EXL
- srl v0,1
- j ra
-ENDFRAME(_CPU_ISR_Get_level)
-
-FRAME(_CPU_ISR_Set_level,sp,0,ra)
- nop
- mfc0 a0,C0_SR
- nop
- andi a0,SR_EXL
- beqz a0,_CPU_ISR_Set_1 /* normalize a0 */
- nop
- li a0,1
-_CPU_ISR_Set_1:
- beq v0,a0,_CPU_ISR_Set_exit /* if (current_level != new_level ) */
- nop
- bnez a0,_CPU_ISR_Set_2
- nop
- nop
- mfc0 t0,C0_SR
- nop
- li t1,~SR_EXL
- and t0,t1
- nop
- mtc0 t0,C0_SR /* disable exception level */
- nop
- j ra
- nop
-_CPU_ISR_Set_2:
- nop
- mfc0 t0,C0_SR
- nop
- li t1,~SR_IE
- and t0,t1
- nop
- mtc0 t0,C0_SR /* first disable ie bit (recommended) */
- nop
- ori t0,SR_EXL|SR_IE /* enable exception level */
- nop
- mtc0 t0,C0_SR
- nop
-_CPU_ISR_Set_exit:
- j ra
- nop
-ENDFRAME(_CPU_ISR_Set_level)
-
-/*
- * _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.
- */
-
-/* void _CPU_Context_save_fp(
- * void **fp_context_ptr
- * )
- * {
- * }
- */
-
-FRAME(_CPU_Context_save_fp,sp,0,ra)
- .set noat
- ld a1,(a0)
- swc1 $f0,FP0_OFFSET*4(a1)
- swc1 $f1,FP1_OFFSET*4(a1)
- swc1 $f2,FP2_OFFSET*4(a1)
- swc1 $f3,FP3_OFFSET*4(a1)
- swc1 $f4,FP4_OFFSET*4(a1)
- swc1 $f5,FP5_OFFSET*4(a1)
- swc1 $f6,FP6_OFFSET*4(a1)
- swc1 $f7,FP7_OFFSET*4(a1)
- swc1 $f8,FP8_OFFSET*4(a1)
- swc1 $f9,FP9_OFFSET*4(a1)
- swc1 $f10,FP10_OFFSET*4(a1)
- swc1 $f11,FP11_OFFSET*4(a1)
- swc1 $f12,FP12_OFFSET*4(a1)
- swc1 $f13,FP13_OFFSET*4(a1)
- swc1 $f14,FP14_OFFSET*4(a1)
- swc1 $f15,FP15_OFFSET*4(a1)
- swc1 $f16,FP16_OFFSET*4(a1)
- swc1 $f17,FP17_OFFSET*4(a1)
- swc1 $f18,FP18_OFFSET*4(a1)
- swc1 $f19,FP19_OFFSET*4(a1)
- swc1 $f20,FP20_OFFSET*4(a1)
- swc1 $f21,FP21_OFFSET*4(a1)
- swc1 $f22,FP22_OFFSET*4(a1)
- swc1 $f23,FP23_OFFSET*4(a1)
- swc1 $f24,FP24_OFFSET*4(a1)
- swc1 $f25,FP25_OFFSET*4(a1)
- swc1 $f26,FP26_OFFSET*4(a1)
- swc1 $f27,FP27_OFFSET*4(a1)
- swc1 $f28,FP28_OFFSET*4(a1)
- swc1 $f29,FP29_OFFSET*4(a1)
- swc1 $f30,FP30_OFFSET*4(a1)
- swc1 $f31,FP31_OFFSET*4(a1)
- j ra
- nop
- .set at
-ENDFRAME(_CPU_Context_save_fp)
-
-/*
- * _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.
- */
-
-/* void _CPU_Context_restore_fp(
- * void **fp_context_ptr
- * )
- * {
- * }
- */
-
-FRAME(_CPU_Context_restore_fp,sp,0,ra)
- .set noat
- ld a1,(a0)
- lwc1 $f0,FP0_OFFSET*4(a1)
- lwc1 $f1,FP1_OFFSET*4(a1)
- lwc1 $f2,FP2_OFFSET*4(a1)
- lwc1 $f3,FP3_OFFSET*4(a1)
- lwc1 $f4,FP4_OFFSET*4(a1)
- lwc1 $f5,FP5_OFFSET*4(a1)
- lwc1 $f6,FP6_OFFSET*4(a1)
- lwc1 $f7,FP7_OFFSET*4(a1)
- lwc1 $f8,FP8_OFFSET*4(a1)
- lwc1 $f9,FP9_OFFSET*4(a1)
- lwc1 $f10,FP10_OFFSET*4(a1)
- lwc1 $f11,FP11_OFFSET*4(a1)
- lwc1 $f12,FP12_OFFSET*4(a1)
- lwc1 $f13,FP13_OFFSET*4(a1)
- lwc1 $f14,FP14_OFFSET*4(a1)
- lwc1 $f15,FP15_OFFSET*4(a1)
- lwc1 $f16,FP16_OFFSET*4(a1)
- lwc1 $f17,FP17_OFFSET*4(a1)
- lwc1 $f18,FP18_OFFSET*4(a1)
- lwc1 $f19,FP19_OFFSET*4(a1)
- lwc1 $f20,FP20_OFFSET*4(a1)
- lwc1 $f21,FP21_OFFSET*4(a1)
- lwc1 $f22,FP22_OFFSET*4(a1)
- lwc1 $f23,FP23_OFFSET*4(a1)
- lwc1 $f24,FP24_OFFSET*4(a1)
- lwc1 $f25,FP25_OFFSET*4(a1)
- lwc1 $f26,FP26_OFFSET*4(a1)
- lwc1 $f27,FP27_OFFSET*4(a1)
- lwc1 $f28,FP28_OFFSET*4(a1)
- lwc1 $f29,FP29_OFFSET*4(a1)
- lwc1 $f30,FP30_OFFSET*4(a1)
- lwc1 $f31,FP31_OFFSET*4(a1)
- j ra
- nop
- .set at
-ENDFRAME(_CPU_Context_restore_fp)
-
-/* _CPU_Context_switch
- *
- * This routine performs a normal non-FP context switch.
- */
-
-/* void _CPU_Context_switch(
- * Context_Control *run,
- * Context_Control *heir
- * )
- * {
- * }
- */
-
-FRAME(_CPU_Context_switch,sp,0,ra)
-
- mfc0 t0,C0_SR
- li t1,~SR_IE
- sd t0,C0_SR_OFFSET*8(a0) /* save status register */
- and t0,t1
- mtc0 t0,C0_SR /* first disable ie bit (recommended) */
- ori t0,SR_EXL|SR_IE /* enable exception level to disable interrupts */
- mtc0 t0,C0_SR
-
- sd ra,RA_OFFSET*8(a0) /* save current context */
- sd sp,SP_OFFSET*8(a0)
- sd fp,FP_OFFSET*8(a0)
- sd s0,S0_OFFSET*8(a0)
- sd s1,S1_OFFSET*8(a0)
- sd s2,S2_OFFSET*8(a0)
- sd s3,S3_OFFSET*8(a0)
- sd s4,S4_OFFSET*8(a0)
- sd s5,S5_OFFSET*8(a0)
- sd s6,S6_OFFSET*8(a0)
- sd s7,S7_OFFSET*8(a0)
- dmfc0 t0,C0_EPC
- sd t0,C0_EPC_OFFSET*8(a0)
-
-_CPU_Context_switch_restore:
- ld s0,S0_OFFSET*8(a1) /* restore context */
- ld s1,S1_OFFSET*8(a1)
- ld s2,S2_OFFSET*8(a1)
- ld s3,S3_OFFSET*8(a1)
- ld s4,S4_OFFSET*8(a1)
- ld s5,S5_OFFSET*8(a1)
- ld s6,S6_OFFSET*8(a1)
- ld s7,S7_OFFSET*8(a1)
- ld fp,FP_OFFSET*8(a1)
- ld sp,SP_OFFSET*8(a1)
- ld ra,RA_OFFSET*8(a1)
- ld t0,C0_EPC_OFFSET*8(a1)
- dmtc0 t0,C0_EPC
- ld t0,C0_SR_OFFSET*8(a1)
- andi t0,SR_EXL
- bnez t0,_CPU_Context_1 /* set exception level from restore context */
- li t0,~SR_EXL
- mfc0 t1,C0_SR
- nop
- and t1,t0
- mtc0 t1,C0_SR
-_CPU_Context_1:
- j ra
- nop
-ENDFRAME(_CPU_Context_switch)
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally 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.
- */
-
-#if 0
-void _CPU_Context_restore(
- Context_Control *new_context
-)
-{
-}
-#endif
-
-FRAME(_CPU_Context_restore,sp,0,ra)
- dadd a1,a0,zero
- j _CPU_Context_switch_restore
- nop
-ENDFRAME(_CPU_Context_restore)
-
-EXTERN(_ISR_Nest_level, SZ_INT)
-EXTERN(_Thread_Dispatch_disable_level,SZ_INT)
-EXTERN(_Context_Switch_necessary,SZ_INT)
-EXTERN(_ISR_Signals_to_thread_executing,SZ_INT)
-.extern _Thread_Dispatch
-.extern _ISR_Vector_table
-
-/* void __ISR_Handler()
- *
- * This routine provides the RTEMS interrupt management.
- *
- */
-
-#if 0
-void _ISR_Handler()
-{
- /*
- * This discussion ignores a lot of the ugly details in a real
- * implementation such as saving enough registers/state to be
- * able to do something real. Keep in mind that the goal is
- * to invoke a user's ISR handler which is written in C and
- * uses a certain set of registers.
- *
- * Also note that the exact order is to a large extent flexible.
- * Hardware will dictate a sequence for a certain subset of
- * _ISR_Handler while requirements for setting
- */
-
- /*
- * At entry to "common" _ISR_Handler, the vector number must be
- * available. On some CPUs the hardware puts either the vector
- * number or the offset into the vector table for this ISR in a
- * known place. If the hardware does not give us this information,
- * then the assembly portion of RTEMS for this port will contain
- * a set of distinct interrupt entry points which somehow place
- * the vector number in a known place (which is safe if another
- * interrupt nests this one) and branches to _ISR_Handler.
- *
- */
-#endif
-FRAME(_ISR_Handler,sp,0,ra)
-.set noreorder
-#if USE_IDTKIT
-/* IDT/Kit incorrectly adds 4 to EPC before returning. This compensates */
- lreg k0, R_EPC*R_SZ(sp)
- daddiu k0,k0,-4
- sreg k0, R_EPC*R_SZ(sp)
- lreg k0, R_CAUSE*R_SZ(sp)
- li k1, ~CAUSE_BD
- and k0, k1
- sreg k0, R_CAUSE*R_SZ(sp)
-#endif
-
-/* save registers not already saved by IDT/sim */
- stackadd sp,sp,-EXCP_STACK_SIZE /* store ra on the stack */
-
- sreg ra, R_RA*R_SZ(sp)
- sreg v0, R_V0*R_SZ(sp)
- sreg v1, R_V1*R_SZ(sp)
- sreg a0, R_A0*R_SZ(sp)
- sreg a1, R_A1*R_SZ(sp)
- sreg a2, R_A2*R_SZ(sp)
- sreg a3, R_A3*R_SZ(sp)
- sreg t0, R_T0*R_SZ(sp)
- sreg t1, R_T1*R_SZ(sp)
- sreg t2, R_T2*R_SZ(sp)
- sreg t3, R_T3*R_SZ(sp)
- sreg t4, R_T4*R_SZ(sp)
- sreg t5, R_T5*R_SZ(sp)
- sreg t6, R_T6*R_SZ(sp)
- sreg t7, R_T7*R_SZ(sp)
- mflo k0
- sreg t8, R_T8*R_SZ(sp)
- sreg k0, R_MDLO*R_SZ(sp)
- sreg t9, R_T9*R_SZ(sp)
- mfhi k0
- sreg gp, R_GP*R_SZ(sp)
- sreg fp, R_FP*R_SZ(sp)
- sreg k0, R_MDHI*R_SZ(sp)
- .set noat
- sreg AT, R_AT*R_SZ(sp)
- .set at
-
- stackadd sp,sp,-40 /* store ra on the stack */
- sd ra,32(sp)
-
-/* determine if an interrupt generated this exception */
- mfc0 k0,C0_CAUSE
- and k1,k0,CAUSE_EXCMASK
- bnez k1,_ISR_Handler_prom_exit /* not an external interrupt, pass exception to Monitor */
- mfc0 k1,C0_SR
- and k0,k1
- and k0,CAUSE_IPMASK
- beq k0,zero,_ISR_Handler_quick_exit /* external interrupt not enabled, ignore */
- nop
-
- /*
- * save some or all context on stack
- * may need to save some special interrupt information for exit
- *
- * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- * if ( _ISR_Nest_level == 0 )
- * switch to software interrupt stack
- * #endif
- */
-#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- lint t0,_ISR_Nest_level
- beq t0, zero, _ISR_Handler_1
- nop
- /* switch stacks */
-_ISR_Handler_1:
-#else
- lint t0,_ISR_Nest_level
-#endif
- /*
- * _ISR_Nest_level++;
- */
- addi t0,t0,1
- sint t0,_ISR_Nest_level
- /*
- * _Thread_Dispatch_disable_level++;
- */
- lint t1,_Thread_Dispatch_disable_level
- addi t1,t1,1
- sint t1,_Thread_Dispatch_disable_level
-#if 0
- nop
- j _ISR_Handler_4
- nop
- /*
- * while ( interrupts_pending(cause_reg) ) {
- * vector = BITFIELD_TO_INDEX(cause_reg);
- * (*_ISR_Vector_table[ vector ])( vector );
- * }
- */
-_ISR_Handler_2:
-/* software interrupt priorities can be applied here */
- li t1,-1
-/* convert bit field into interrupt index */
-_ISR_Handler_3:
- andi t2,t0,1
- addi t1,1
- beql t2,zero,_ISR_Handler_3
- dsrl t0,1
- li t1,7
- dsll t1,3 /* convert index to byte offset (*8) */
- la t3,_ISR_Vector_table
- intadd t1,t3
- lint t1,(t1)
- jalr t1
- nop
- j _ISR_Handler_5
- nop
-_ISR_Handler_4:
- mfc0 t0,C0_CAUSE
- andi t0,CAUSE_IPMASK
- bne t0,zero,_ISR_Handler_2
- dsrl t0,t0,8
-_ISR_Handler_5:
-#else
- nop
- li t1,7
- dsll t1,t1,SZ_INT_POW2
- la t3,_ISR_Vector_table
- intadd t1,t3
- lint t1,(t1)
- jalr t1
- nop
-#endif
- /*
- * --_ISR_Nest_level;
- */
- lint t2,_ISR_Nest_level
- addi t2,t2,-1
- sint t2,_ISR_Nest_level
- /*
- * --_Thread_Dispatch_disable_level;
- */
- lint t1,_Thread_Dispatch_disable_level
- addi t1,t1,-1
- sint t1,_Thread_Dispatch_disable_level
- /*
- * if ( _Thread_Dispatch_disable_level || _ISR_Nest_level )
- * goto the label "exit interrupt (simple case)"
- */
- or t0,t2,t1
- bne t0,zero,_ISR_Handler_exit
- nop
- /*
- * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- * restore stack
- * #endif
- *
- * if ( !_Context_Switch_necessary && !_ISR_Signals_to_thread_executing )
- * goto the label "exit interrupt (simple case)"
- */
- lint t0,_Context_Switch_necessary
- lint t1,_ISR_Signals_to_thread_executing
- or t0,t0,t1
- beq t0,zero,_ISR_Handler_exit
- nop
-
- /*
- * call _Thread_Dispatch() or prepare to return to _ISR_Dispatch
- */
- jal _Thread_Dispatch
- nop
- /*
- * prepare to get out of interrupt
- * return from interrupt (maybe to _ISR_Dispatch)
- *
- * LABEL "exit interrupt (simple case):
- * prepare to get out of interrupt
- * return from interrupt
- */
-_ISR_Handler_exit:
- ld ra,32(sp)
- stackadd sp,sp,40
-
-/* restore interrupt context from stack */
- lreg k0, R_MDLO*R_SZ(sp)
- mtlo k0
- lreg k0, R_MDHI*R_SZ(sp)
- lreg a2, R_A2*R_SZ(sp)
- mthi k0
- lreg a3, R_A3*R_SZ(sp)
- lreg t0, R_T0*R_SZ(sp)
- lreg t1, R_T1*R_SZ(sp)
- lreg t2, R_T2*R_SZ(sp)
- lreg t3, R_T3*R_SZ(sp)
- lreg t4, R_T4*R_SZ(sp)
- lreg t5, R_T5*R_SZ(sp)
- lreg t6, R_T6*R_SZ(sp)
- lreg t7, R_T7*R_SZ(sp)
- lreg t8, R_T8*R_SZ(sp)
- lreg t9, R_T9*R_SZ(sp)
- lreg gp, R_GP*R_SZ(sp)
- lreg fp, R_FP*R_SZ(sp)
- lreg ra, R_RA*R_SZ(sp)
- lreg a0, R_A0*R_SZ(sp)
- lreg a1, R_A1*R_SZ(sp)
- lreg v1, R_V1*R_SZ(sp)
- lreg v0, R_V0*R_SZ(sp)
- .set noat
- lreg AT, R_AT*R_SZ(sp)
- .set at
-
- stackadd sp,sp,EXCP_STACK_SIZE /* store ra on the stack */
-
-#if USE_IDTKIT
-/* we handled exception, so return non-zero value */
- li v0,1
-#endif
-
-_ISR_Handler_quick_exit:
-#ifdef USE_IDTKIT
- j ra
-#else
- eret
-#endif
- nop
-
-_ISR_Handler_prom_exit:
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
- .set reorder
-
-ENDFRAME(_ISR_Handler)
-
-
-FRAME(mips_enable_interrupts,sp,0,ra)
- mfc0 t0,C0_SR /* get status reg */
- nop
- or t0,t0,a0
- mtc0 t0,C0_SR /* save updated status reg */
- j ra
- nop
-ENDFRAME(mips_enable_interrupts)
-
-FRAME(mips_disable_interrupts,sp,0,ra)
- mfc0 v0,C0_SR /* get status reg */
- li t1,SR_IMASK /* t1 = load interrupt mask word */
- not t0,t1 /* t0 = ~t1 */
- and t0,v0 /* clear imask bits */
- mtc0 t0,C0_SR /* save status reg */
- and v0,t1 /* mask return value (only return imask bits) */
- jr ra
- nop
-ENDFRAME(mips_disable_interrupts)
-
-FRAME(mips_enable_global_interrupts,sp,0,ra)
- mfc0 t0,C0_SR /* get status reg */
- nop
- ori t0,SR_IE
- mtc0 t0,C0_SR /* save updated status reg */
- j ra
- nop
-ENDFRAME(mips_enable_global_interrupts)
-
-FRAME(mips_disable_global_interrupts,sp,0,ra)
- li t1,SR_IE
- mfc0 t0,C0_SR /* get status reg */
- not t1
- and t0,t1
- mtc0 t0,C0_SR /* save updated status reg */
- j ra
- nop
-ENDFRAME(mips_disable_global_interrupts)
-
-/* return the value of the status register in v0. Used for debugging */
-FRAME(mips_get_sr,sp,0,ra)
- mfc0 v0,C0_SR
- j ra
- nop
-ENDFRAME(mips_get_sr)
-
-FRAME(mips_break,sp,0,ra)
-#if 1
- break 0x0
- j mips_break
-#else
- j ra
-#endif
- nop
-ENDFRAME(mips_break)
-
-/*PAGE
- *
- * _CPU_Internal_threads_Idle_thread_body
- *
- * NOTES:
- *
- * 1. This is the same as the regular CPU independent algorithm.
- *
- * 2. If you implement this using a "halt", "idle", or "shutdown"
- * instruction, then don't forget to put it in an infinite loop.
- *
- * 3. Be warned. Some processors with onboard DMA have been known
- * to stop the DMA if the CPU were put in IDLE mode. This might
- * also be a problem with other on-chip peripherals. So use this
- * hook with caution.
- */
-
-FRAME(_CPU_Thread_Idle_body,sp,0,ra)
- wait /* enter low power mode */
- j _CPU_Thread_Idle_body
- nop
-ENDFRAME(_CPU_Thread_Idle_body)
-
-#define VEC_CODE_LENGTH 10*4
-
-/**************************************************************************
-**
-** init_exc_vecs() - moves the exception code into the addresses
-** reserved for exception vectors
-**
-** UTLB Miss exception vector at address 0x80000000
-**
-** General exception vector at address 0x80000080
-**
-** RESET exception vector is at address 0xbfc00000
-**
-***************************************************************************/
-
-#define INITEXCFRM ((2*4)+4) /* ra + 2 arguments */
-FRAME(init_exc_vecs,sp,0,ra)
-/* This code yanked from SIM */
-#if defined(CPU_R3000)
- .set noreorder
- la t1,exc_utlb_code
- la t2,exc_norm_code
- li t3,UT_VEC
- li t4,E_VEC
- li t5,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- lw t7,0(t2)
- sw t6,0(t3)
- sw t7,0(t4)
- addiu t1,4
- addiu t3,4
- addiu t4,4
- subu t5,4
- bne t5,zero,1b
- addiu t2,4
- move t5,ra # assumes clear_cache doesnt use t5
- li a0,UT_VEC
- jal clear_cache
- li a1,VEC_CODE_LENGTH
- nop
- li a0,E_VEC
- jal clear_cache
- li a1,VEC_CODE_LENGTH
- move ra,t5 # restore ra
- j ra
- nop
- .set reorder
-#endif
-#if defined(CPU_R4000)
- .set reorder
- move t5,ra # assumes clear_cache doesnt use t5
-
- /* TLB exception vector */
- la t1,exc_tlb_code
- li t2,T_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- li a0,T_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- la t1,exc_xtlb_code
- li t2,X_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- /* extended TLB exception vector */
- li a0,X_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- /* cache error exception vector */
- la t1,exc_cache_code
- li t2,C_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- li a0,C_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- /* normal exception vector */
- la t1,exc_norm_code
- li t2,E_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- li a0,E_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- move ra,t5 # restore ra
- j ra
-#endif
-ENDFRAME(init_exc_vecs)
-
-
-#if defined(CPU_R4000)
-FRAME(exc_tlb_code,sp,0,ra)
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
-ENDFRAME(exc_tlb_code)
-
-
-FRAME(exc_xtlb_code,sp,0,ra)
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
-ENDFRAME(exc_xtlb_code)
-
-
-FRAME(exc_cache_code,sp,0,ra)
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
-ENDFRAME(exc_cache_code)
-
-
-FRAME(exc_norm_code,sp,0,ra)
- la k0, _ISR_Handler /* generic external int hndlr */
- j k0
- nop
- subu sp, EXCP_STACK_SIZE /* set up local stack frame */
-ENDFRAME(exc_norm_code)
-#endif
-
-/**************************************************************************
-**
-** enable_int(mask) - enables interrupts - mask is positioned so it only
-** needs to be or'ed into the status reg. This
-** also does some other things !!!! caution should
-** be used if invoking this while in the middle
-** of a debugging session where the client may have
-** nested interrupts.
-**
-****************************************************************************/
-FRAME(enable_int,sp,0,ra)
- .set noreorder
- mfc0 t0,C0_SR
- or a0,1
- or t0,a0
- mtc0 t0,C0_SR
- j ra
- nop
- .set reorder
-ENDFRAME(enable_int)
-
-
-/***************************************************************************
-**
-** disable_int(mask) - disable the interrupt - mask is the complement
-** of the bits to be cleared - i.e. to clear ext int
-** 5 the mask would be - 0xffff7fff
-**
-****************************************************************************/
-FRAME(disable_int,sp,0,ra)
- .set noreorder
- mfc0 t0,C0_SR
- nop
- and t0,a0
- mtc0 t0,C0_SR
- j ra
- nop
-ENDFRAME(disable_int)
-
-
diff --git a/c/src/exec/score/cpu/mips64orion/cpu_asm.h b/c/src/exec/score/cpu/mips64orion/cpu_asm.h
deleted file mode 100644
index 5d78f39d7c..0000000000
--- a/c/src/exec/score/cpu/mips64orion/cpu_asm.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * cpu_asm.h
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu_asm.h:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- *
- */
-/* @(#)cpu_asm.h 08/20/96 1.2 */
-
-#ifndef __CPU_ASM_h
-#define __CPU_ASM_h
-
-/* pull in the generated offsets */
-
-/* #include <rtems/score/offsets.h> */
-
-/*
- * Hardware General Registers
- */
-
-/* put something here */
-
-/*
- * 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
-
-/*
- * Hardware Control Registers
- */
-
-/* put something here */
-
-/*
- * Calling Convention
- */
-
-/* put something here */
-
-/*
- * Temporary registers
- */
-
-/* put something here */
-
-/*
- * Floating Point Registers - SW Conventions
- */
-
-/* put something here */
-
-/*
- * Temporary floating point registers
- */
-
-/* put something here */
-
-#endif
-
-/* end of file */
diff --git a/c/src/exec/score/cpu/mips64orion/idtcpu.h b/c/src/exec/score/cpu/mips64orion/idtcpu.h
deleted file mode 100644
index f921e85ef6..0000000000
--- a/c/src/exec/score/cpu/mips64orion/idtcpu.h
+++ /dev/null
@@ -1,440 +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 defined(CPU_R4000)
-#define KSBASE 0xe0000000
-#define KSSIZE 0x20000000
-#endif
-
-#define KUBASE 0
-#define KUSIZE 0x80000000
-
-/*
-** Exception Vectors
-*/
-#if defined(CPU_R3000)
-#define UT_VEC K0BASE /* utlbmiss vector */
-#define E_VEC (K0BASE+0x80) /* exception vevtor */
-#endif
-#if defined(CPU_R4000)
-#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 */
-#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 defined(CPU_R4000)
-/* 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
-
-#ifndef wait
-#define wait .word 0x42000020
-#endif wait
-
-#endif
-
-/*
-** TLB resource defines
-*/
-#if defined(CPU_R3000)
-#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 defined(CPU_R4000)
-#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<<TLBLO_CSHIFT)
-#define TLBLO_NONCOHERENT (CFG_C_NONCOHERENT<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTXCL (CFG_C_COHERENTXCL<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTXCLW (CFG_C_COHERENTXCLW<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTUPD (CFG_C_COHERENTUPD<<TLBLO_CSHIFT)
-
-#define TLBINX_PROBE 0x80000000
-#define TLBINX_INXMASK 0x0000003f
-
-#define TLBRAND_RANDMASK 0x0000003f
-
-#define TLBCTXT_BASEMASK 0xff800000
-#define TLBCTXT_BASESHIFT 23
-
-#define TLBCTXT_VPN2MASK 0x007ffff0
-#define TLBCTXT_VPN2SHIFT 4
-
-#define TLBPGMASK_MASK 0x01ffe000
-#endif
-
-#if defined(CPU_R3000)
-#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_BEV 0x00400000 /* use boot exception vectors */
-
-/* Cache control bits */
-#define SR_TS 0x00200000 /* TLB shutdown */
-#define SR_PE 0x00100000 /* cache parity error */
-#define SR_CM 0x00080000 /* cache miss */
-#define SR_PZ 0x00040000 /* cache parity zero */
-#define SR_SWC 0x00020000 /* swap cache */
-#define SR_ISC 0x00010000 /* Isolate data cache */
-
-/*
-** 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_KUO 0x00000020 /* old kernel/user, 0 => 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 defined(CPU_R4000)
-#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_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 defined(CPU_R3000)
-#define C0_TLBLO $2 /* tlb entry low */
-#endif
-#if defined(CPU_R4000)
-#define C0_TLBLO0 $2 /* tlb entry low 0 */
-#define C0_TLBLO1 $3 /* tlb entry low 1 */
-#endif
-
-#define C0_CTXT $4 /* tlb context */
-
-#if defined(CPU_R4000)
-#define C0_PAGEMASK $5 /* tlb page mask */
-#define C0_WIRED $6 /* number of wired tlb entries */
-#endif
-
-#define C0_BADVADDR $8 /* bad virtual address */
-
-#if defined(CPU_R4000)
-#define C0_COUNT $9 /* cycle count */
-#endif
-
-#define C0_TLBHI $10 /* tlb entry hi */
-
-#if defined(CPU_R4000)
-#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 defined(CPU_R3000)
-#define C0_CONFIG $3 /* configuration register R3081*/
-#endif
-
-#if defined(CPU_R4000)
-#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
-
-#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/c/src/exec/score/cpu/mips64orion/idtmon.h b/c/src/exec/score/cpu/mips64orion/idtmon.h
deleted file mode 100644
index b42211ed5c..0000000000
--- a/c/src/exec/score/cpu/mips64orion/idtmon.h
+++ /dev/null
@@ -1,171 +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$
-*/
-
-/*
-** idtmon.h - General header file for the IDT Prom Monitor
-**
-** Copyright 1989 Integrated Device Technology, Inc.
-** All Rights Reserved.
-**
-** June 1989 - D.Cahoon
-*/
-#ifndef __IDTMON_H__
-#define __IDTMON_H__
-
-/*
-** P_STACKSIZE is the size of the Prom Stack.
-** the prom stack grows downward
-*/
-#define P_STACKSIZE 0x2000 /* sets stack size to 8k */
-
-/*
-** M_BUSWIDTH
-** Memory bus width (including bank interleaving) in bytes
-** used when doing memory sizing to prevent bus capacitance
-** reporting ghost memory locations
-*/
-#if defined(CPU_R3000)
-#define M_BUSWIDTH 8 /* 32bit memory bank interleaved */
-#endif
-#if defined(CPU_R4000)
-#define M_BUSWIDTH 16 /* 64 bit memory bank interleaved */
-#endif
-
-/*
-** this is the default value for the number of bytes to add in calculating
-** the checksums in the checksum command
-*/
-#define CHK_SUM_CNT 0x20000 /* number of bytes to calc chksum for */
-
-/*
-** Monitor modes
-*/
-#define MODE_MONITOR 5 /* IDT Prom Monitor is executing */
-#define MODE_USER 0xa /* USER is executing */
-
-/*
-** memory reference widths
-*/
-#define SW_BYTE 1
-#define SW_HALFWORD 2
-#define SW_WORD 4
-#define SW_TRIBYTEL 12
-#define SW_TRIBYTER 20
-
-#ifdef CPU_R4000
-/*
-** definitions for select_cache call
-*/
-#define DCACHE 0
-#define ICACHE 1
-#define SCACHE 2
-
-#endif
-
-#if defined (CLANGUAGE) || defined(_LANGUAGE_C)
-typedef struct {
- unsigned int mem_size;
- unsigned int icache_size;
- unsigned int dcache_size;
-#ifdef CPU_R4000
- unsigned int scache_size;
-#endif
-
- } mem_config;
-
-#endif CLANGUAGE || defined(_LANGUAGE_C)
-
-/*
-** general equates for diagnostics and boolean functions
-*/
-#define PASS 0
-#define FAIL 1
-
-#ifndef TRUE
-#define TRUE 1
-#endif TRUE
-#ifndef NULL
-#define NULL 0
-#endif NULL
-
-#ifndef FALSE
-#define FALSE 0
-#endif FALSE
-
-
-/*
-** portablility equates
-*/
-
-#ifndef BOOL
-#define BOOL unsigned int
-#endif BOOL
-
-#ifndef GLOBAL
-#define GLOBAL /**/
-#endif GLOBAL
-
-#ifndef MLOCAL
-#define MLOCAL static
-#endif MLOCAL
-
-
-#ifdef XDS
-#define CONST const
-#else
-#define CONST
-#endif XDS
-
-#define u_char unsigned char
-#define u_short unsigned short
-#define u_int unsigned int
-/*
-** assembly instructions for compatability between xds and mips
-*/
-#ifndef XDS
-#define sllv sll
-#define srlv srl
-#endif XDS
-/*
-** 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
-#endif /* __IDTMON_H__ */
diff --git a/c/src/exec/score/cpu/mips64orion/iregdef.h b/c/src/exec/score/cpu/mips64orion/iregdef.h
deleted file mode 100644
index f0953da852..0000000000
--- a/c/src/exec/score/cpu/mips64orion/iregdef.h
+++ /dev/null
@@ -1,325 +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 save reg area
-*/
-#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_F0 32
-#define R_F1 33
-#define R_F2 34
-#define R_F3 35
-#define R_F4 36
-#define R_F5 37
-#define R_F6 38
-#define R_F7 39
-#define R_F8 40
-#define R_F9 41
-#define R_F10 42
-#define R_F11 43
-#define R_F12 44
-#define R_F13 45
-#define R_F14 46
-#define R_F15 47
-#define R_F16 48
-#define R_F17 49
-#define R_F18 50
-#define R_F19 51
-#define R_F20 52
-#define R_F21 53
-#define R_F22 54
-#define R_F23 55
-#define R_F24 56
-#define R_F25 57
-#define R_F26 58
-#define R_F27 59
-#define R_F28 60
-#define R_F29 61
-#define R_F30 62
-#define R_F31 63
-#define NCLIENTREGS 64
-#define R_EPC 64
-#define R_MDHI 65
-#define R_MDLO 66
-#define R_SR 67
-#define R_CAUSE 68
-#define R_TLBHI 69
-#if defined(CPU_R3000)
-#define R_TLBLO 70
-#endif
-#if defined(CPU_R4000)
-#define R_TLBLO0 70
-#endif
-#define R_BADVADDR 71
-#define R_INX 72
-#define R_RAND 73
-#define R_CTXT 74
-#define R_EXCTYPE 75
-#define R_MODE 76
-#define R_PRID 77
-#define R_FCSR 78
-#define R_FEIR 79
-#if defined(CPU_R3000)
-#define NREGS 80
-#endif
-#if defined(CPU_R4000)
-#define R_TLBLO1 80
-#define R_PAGEMASK 81
-#define R_WIRED 82
-#define R_COUNT 83
-#define R_COMPARE 84
-#define R_CONFIG 85
-#define R_LLADDR 86
-#define R_WATCHLO 87
-#define R_WATCHHI 88
-#define R_ECC 89
-#define R_CACHEERR 90
-#define R_TAGLO 91
-#define R_TAGHI 92
-#define R_ERRPC 93
-#define R_XCTXT 94 /* Ketan added from SIM64bit */
-
-#define NREGS 95
-#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
-
-/* Ketan added the following */
-#ifdef CPU_R3000
-#define sreg sw
-#define lreg lw
-#define rmfc0 mfc0
-#define rmtc0 mtc0
-#define R_SZ 4
-#endif CPU_R3000
-
-#ifdef CPU_R4000
-#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 CPU_R4000
-/* Ketan till here */
-
-#endif /* __IREGDEF_H__ */
-
diff --git a/c/src/exec/score/cpu/mips64orion/mips64orion.h b/c/src/exec/score/cpu/mips64orion/mips64orion.h
deleted file mode 100644
index ec89a32a0d..0000000000
--- a/c/src/exec/score/cpu/mips64orion/mips64orion.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* mips64orion.h
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/no_cpu.h:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-/* @(#)mips64orion.h 08/29/96 1.3 */
-
-#ifndef _INCLUDE_MIPS64ORION_h
-#define _INCLUDE_MIPS64ORION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This file contains the information required to build
- * RTEMS for a particular member of the "no cpu"
- * family when executing in protected mode. It does
- * this by setting variables to indicate which implementation
- * dependent features are present in a particular member
- * of the family.
- */
-
-#if defined(R4650)
-
-#define CPU_MODEL_NAME "R4650"
-#define MIPS64ORION_HAS_FPU 1
-
-#elif defined(R4600)
-
-#define CPU_MODEL_NAME "R4600"
-#define MIPS64ORION_HAS_FPU 1
-
-#else
-
-#error "Unsupported CPU Model"
-
-#endif
-
-/*
- * Define the name of the CPU family.
- */
-
-#define CPU_NAME "MIPS R46xxx"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! _INCLUDE_MIPS64ORION_h */
-/* end of include file */
diff --git a/c/src/exec/score/cpu/mips64orion/mipstypes.h b/c/src/exec/score/cpu/mips64orion/mipstypes.h
deleted file mode 100644
index 50f28ccf9b..0000000000
--- a/c/src/exec/score/cpu/mips64orion/mipstypes.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* mipstypes.h
- *
- * This include file contains type definitions pertaining to the IDT 4650
- * processor family.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-/* @(#)mipstypes.h 08/20/96 1.4 */
-
-#ifndef __MIPS_TYPES_h
-#define __MIPS_TYPES_h
-
-#ifndef ASM
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* unsigned 8-bit integer */
-typedef unsigned short unsigned16; /* unsigned 16-bit integer */
-typedef unsigned int unsigned32; /* unsigned 32-bit integer */
-typedef unsigned long long unsigned64; /* unsigned 64-bit integer */
-
-typedef unsigned16 Priority_Bit_map_control;
-
-typedef signed char signed8; /* 8-bit signed integer */
-typedef signed short signed16; /* 16-bit signed integer */
-typedef signed int signed32; /* 32-bit signed integer */
-typedef signed long long signed64; /* 64 bit signed integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-typedef void mips_isr;
-typedef void ( *mips_isr_entry )( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !ASM */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/cpu/mips64orion/rtems.c b/c/src/exec/score/cpu/mips64orion/rtems.c
deleted file mode 100644
index 356f1b8b9e..0000000000
--- a/c/src/exec/score/cpu/mips64orion/rtems.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* rtems.c ===> rtems.S or rtems.s
- *
- * This file contains the single entry point code for
- * the XXX implementation of RTEMS.
- *
- * NOTE: This is supposed to be a .S or .s file NOT a C file.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)rtems.c 03/15/96 1.1\n";
- */
-
-
-/*
- * This is supposed to be an assembly file. This means that system.h
- * and cpu.h should not be included in a "real" rtems file.
- */
-
-#include <rtems/system.h>
-#include <rtems/score/cpu.h>
-/* #include "asm.h> */
-
-/*
- * RTEMS
- *
- * This routine jumps to the directive indicated in the
- * CPU defined register. This routine is used when RTEMS is
- * linked by itself and placed in ROM. This routine is the
- * first address in the ROM space for RTEMS. The user "calls"
- * this address with the directive arguments in the normal place.
- * This routine then jumps indirectly to the correct directive
- * preserving the arguments. The directive should not realize
- * it has been "wrapped" in this way. The table "_Entry_points"
- * is used to look up the directive.
- */
-
-void RTEMS()
-{
-}
-
diff --git a/c/src/exec/score/cpu/no_cpu/Makefile.in b/c/src/exec/score/cpu/no_cpu/Makefile.in
deleted file mode 100644
index 8277c5e5b7..0000000000
--- a/c/src/exec/score/cpu/no_cpu/Makefile.in
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-RELS=$(ARCH)/rtems-cpu.rel
-
-# C source names, if any, go here -- minus the .c
-# Normally cpu_asm and rtems are assembly files
-C_PIECES=cpu cpu_asm rtems
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/cpu.h $(srcdir)/no_cpu.h $(srcdir)/no_cputypes.h
-
-# H_FILES that get installed externally
-EXTERNAL_H_FILES = $(srcdir)/asm.h
-
-# Assembly source names, if any, go here -- minus the .s
-# Normally cpu_asm and rtems are assembly files
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) $(EXTERNAL_H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) preinstall $(OBJS) $(RELS)
-
-$(ARCH)/rtems-cpu.rel: $(OBJS)
- $(make-rel)
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-install: all
-
-# Real ports using the gnu tools will need to have bsp_specs!!!
-# ${PROJECT_RELEASE}/lib/bsp_specs
-preinstall: $(ARCH) \
- $(PROJECT_INCLUDE)/rtems/score/targopts.h
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
-# we will share the basic cpu file
- $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
-
-$(PROJECT_INCLUDE)/rtems/score/targopts.h: $(ARCH)/targopts.h-tmp
- $(INSTALL) -m 444 $(ARCH)/targopts.h-tmp $@
-
-# $(ARCH)/targopts.h-tmp rule is in leaf.cfg
-
-# Real ports using the gnu tools will need to have bsp_specs!!!
-#${PROJECT_RELEASE}/lib/bsp_specs: $(ARCH)/bsp_specs.tmp
-# $(INSTALL) -m 444 $(ARCH)/bsp_specs.tmp $@
-
-# $(ARCH)/bsp_specs.tmp rule is in leaf.cfg
diff --git a/c/src/exec/score/cpu/no_cpu/asm.h b/c/src/exec/score/cpu/no_cpu/asm.h
deleted file mode 100644
index 1ca7fd435b..0000000000
--- a/c/src/exec/score/cpu/no_cpu/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 <rtems/score/targopts.h>
-#include <rtems/score/no_cpu.h>
-
-/*
- * 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/c/src/exec/score/cpu/no_cpu/cpu.c b/c/src/exec/score/cpu/no_cpu/cpu.c
deleted file mode 100644
index 58e71f9266..0000000000
--- a/c/src/exec/score/cpu/no_cpu/cpu.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * XXX CPU Dependent Source
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/wkspace.h>
-
-/* _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 */
-)
-{
- /*
- * The thread_dispatch argument is the address of the entry point
- * for the routine called at the end of an ISR once it has been
- * decided a context switch is necessary. On some compilation
- * systems it is difficult to call a high-level language routine
- * from assembly. This allows us to trick these systems.
- *
- * If you encounter this problem save the entry point in a CPU
- * dependent variable.
- */
-
- _CPU_Thread_dispatch_pointer = thread_dispatch;
-
- /*
- * If there is not an easy way to initialize the FP context
- * during Context_Initialize, then it is usually easier to
- * save an "uninitialized" FP context here and copy it to
- * the task's during Context_Initialize.
- */
-
- /* FP context initialization support goes here */
-
- _CPU_Table = *cpu_table;
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- /*
- * This routine returns the current interrupt level.
- */
-
- return 0;
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- /*
- * This is where we install the interrupt handler into the "raw" interrupt
- * table used by the CPU to dispatch interrupt handlers.
- */
-}
-
-/*PAGE
- *
- * _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
-)
-{
- *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.
- */
-
- _CPU_ISR_install_raw_handler( vector, new_handler, old_handler );
-
- /*
- * 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;
-}
-
-/*PAGE
- *
- * _CPU_Install_interrupt_stack
- */
-
-void _CPU_Install_interrupt_stack( void )
-{
-}
-
-/*PAGE
- *
- * _CPU_Thread_Idle_body
- *
- * NOTES:
- *
- * 1. This is the same as the regular CPU independent algorithm.
- *
- * 2. If you implement this using a "halt", "idle", or "shutdown"
- * instruction, then don't forget to put it in an infinite loop.
- *
- * 3. Be warned. Some processors with onboard DMA have been known
- * to stop the DMA if the CPU were put in IDLE mode. This might
- * also be a problem with other on-chip peripherals. So use this
- * hook with caution.
- */
-
-void _CPU_Thread_Idle_body( void )
-{
-
- for( ; ; )
- /* insert your "halt" instruction here */ ;
-}
diff --git a/c/src/exec/score/cpu/no_cpu/cpu.h b/c/src/exec/score/cpu/no_cpu/cpu.h
deleted file mode 100644
index 68d75c6b9f..0000000000
--- a/c/src/exec/score/cpu/no_cpu/cpu.h
+++ /dev/null
@@ -1,878 +0,0 @@
-/* cpu.h
- *
- * This include file contains information pertaining to the XXX
- * processor.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_h
-#define __CPU_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/no_cpu.h> /* pick up machine definitions */
-#ifndef ASM
-#include <rtems/score/no_cputypes.h>
-#endif
-
-/* conditional compilation parameters */
-
-/*
- * Should the calls to _Thread_Enable_dispatch be inlined?
- *
- * If TRUE, then they are inlined.
- * If FALSE, then a subroutine call is made.
- *
- * Basically this is an example of the classic trade-off of size
- * versus speed. Inlining the call (TRUE) typically increases the
- * size of RTEMS while speeding up the enabling of dispatching.
- * [NOTE: In general, the _Thread_Dispatch_disable_level will
- * only be 0 or 1 unless you are in an interrupt handler and that
- * interrupt handler invokes the executive.] When not inlined
- * something calls _Thread_Enable_dispatch which in turns calls
- * _Thread_Dispatch. If the enable dispatch is inlined, then
- * one subroutine call is avoided entirely.]
- */
-
-#define CPU_INLINE_ENABLE_DISPATCH FALSE
-
-/*
- * Should the body of the search loops in _Thread_queue_Enqueue_priority
- * be unrolled one time? In unrolled each iteration of the loop examines
- * two "nodes" on the chain being searched. Otherwise, only one node
- * is examined per iteration.
- *
- * If TRUE, then the loops are unrolled.
- * If FALSE, then the loops are not unrolled.
- *
- * The primary factor in making this decision is the cost of disabling
- * and enabling interrupts (_ISR_Flash) versus the cost of rest of the
- * body of the loop. On some CPUs, the flash is more expensive than
- * one iteration of the loop body. In this case, it might be desirable
- * to unroll the loop. It is important to note that on some CPUs, this
- * code is the longest interrupt disable period in RTEMS. So it is
- * necessary to strike a balance when setting this parameter.
- */
-
-#define CPU_UNROLL_ENQUEUE_PRIORITY TRUE
-
-/*
- * Does RTEMS manage a dedicated interrupt stack in software?
- *
- * If TRUE, then a stack is allocated in _Interrupt_Manager_initialization.
- * If FALSE, nothing is done.
- *
- * If the CPU supports a dedicated interrupt stack in hardware,
- * then it is generally the responsibility of the BSP to allocate it
- * and set it up.
- *
- * If the CPU does not support a dedicated interrupt stack, then
- * the porter has two options: (1) execute interrupts on the
- * stack of the interrupted task, and (2) have RTEMS manage a dedicated
- * interrupt stack.
- *
- * If this is TRUE, CPU_ALLOCATE_INTERRUPT_STACK should also be TRUE.
- *
- * Only one of CPU_HAS_SOFTWARE_INTERRUPT_STACK and
- * CPU_HAS_HARDWARE_INTERRUPT_STACK should be set to TRUE. It is
- * possible that both are FALSE for a particular CPU. Although it
- * is unclear what that would imply about the interrupt processing
- * procedure on that CPU.
- */
-
-#define CPU_HAS_SOFTWARE_INTERRUPT_STACK FALSE
-
-/*
- * Does this CPU have hardware support for a dedicated interrupt stack?
- *
- * If TRUE, then it must be installed during initialization.
- * If FALSE, then no installation is performed.
- *
- * If this is TRUE, CPU_ALLOCATE_INTERRUPT_STACK should also be TRUE.
- *
- * Only one of CPU_HAS_SOFTWARE_INTERRUPT_STACK and
- * CPU_HAS_HARDWARE_INTERRUPT_STACK should be set to TRUE. It is
- * possible that both are FALSE for a particular CPU. Although it
- * is unclear what that would imply about the interrupt processing
- * procedure on that CPU.
- */
-
-#define CPU_HAS_HARDWARE_INTERRUPT_STACK TRUE
-
-/*
- * Does RTEMS allocate a dedicated interrupt stack in the Interrupt Manager?
- *
- * If TRUE, then the memory is allocated during initialization.
- * If FALSE, then the memory is allocated during initialization.
- *
- * This should be TRUE is CPU_HAS_SOFTWARE_INTERRUPT_STACK is TRUE
- * or CPU_INSTALL_HARDWARE_INTERRUPT_STACK is TRUE.
- */
-
-#define CPU_ALLOCATE_INTERRUPT_STACK TRUE
-
-/*
- * Does the RTEMS invoke the user's ISR with the vector number and
- * a pointer to the saved interrupt frame (1) or just the vector
- * number (0)?
- */
-
-#define CPU_ISR_PASSES_FRAME_POINTER 0
-
-/*
- * Does the CPU have hardware floating point?
- *
- * If TRUE, then the RTEMS_FLOATING_POINT task attribute is supported.
- * If FALSE, then the RTEMS_FLOATING_POINT task attribute is ignored.
- *
- * If there is a FP coprocessor such as the i387 or mc68881, then
- * the answer is TRUE.
- *
- * The macro name "NO_CPU_HAS_FPU" should be made CPU specific.
- * It indicates whether or not this CPU model has FP support. For
- * example, it would be possible to have an i386_nofp CPU model
- * which set this to false to indicate that you have an i386 without
- * an i387 and wish to leave floating point support out of RTEMS.
- */
-
-#if ( NO_CPU_HAS_FPU == 1 )
-#define CPU_HARDWARE_FP TRUE
-#else
-#define CPU_HARDWARE_FP FALSE
-#endif
-
-/*
- * Are all tasks RTEMS_FLOATING_POINT tasks implicitly?
- *
- * If TRUE, then the RTEMS_FLOATING_POINT task attribute is assumed.
- * If FALSE, then the RTEMS_FLOATING_POINT task attribute is followed.
- *
- * So far, the only CPU in which this option has been used is the
- * HP PA-RISC. The HP C compiler and gcc both implicitly use the
- * floating point registers to perform integer multiplies. If
- * a function which you would not think utilize the FP unit DOES,
- * then one can not easily predict which tasks will use the FP hardware.
- * In this case, this option should be TRUE.
- *
- * If CPU_HARDWARE_FP is FALSE, then this should be FALSE as well.
- */
-
-#define CPU_ALL_TASKS_ARE_FP TRUE
-
-/*
- * Should the IDLE task have a floating point context?
- *
- * If TRUE, then the IDLE task is created as a RTEMS_FLOATING_POINT task
- * and it has a floating point context which is switched in and out.
- * If FALSE, then the IDLE task does not have a floating point context.
- *
- * Setting this to TRUE negatively impacts the time required to preempt
- * the IDLE task from an interrupt because the floating point context
- * must be saved as part of the preemption.
- */
-
-#define CPU_IDLE_TASK_IS_FP FALSE
-
-/*
- * Should the saving of the floating point registers be deferred
- * until a context switch is made to another different floating point
- * task?
- *
- * If TRUE, then the floating point context will not be stored until
- * necessary. It will remain in the floating point registers and not
- * disturned until another floating point task is switched to.
- *
- * If FALSE, then the floating point context is saved when a floating
- * point task is switched out and restored when the next floating point
- * task is restored. The state of the floating point registers between
- * those two operations is not specified.
- *
- * If the floating point context does NOT have to be saved as part of
- * interrupt dispatching, then it should be safe to set this to TRUE.
- *
- * Setting this flag to TRUE results in using a different algorithm
- * for deciding when to save and restore the floating point context.
- * The deferred FP switch algorithm minimizes the number of times
- * the FP context is saved and restored. The FP context is not saved
- * until a context switch is made to another, different FP task.
- * Thus in a system with only one FP task, the FP context will never
- * be saved or restored.
- */
-
-#define CPU_USE_DEFERRED_FP_SWITCH TRUE
-
-/*
- * Does this port provide a CPU dependent IDLE task implementation?
- *
- * If TRUE, then the routine _CPU_Thread_Idle_body
- * must be provided and is the default IDLE thread body instead of
- * _CPU_Thread_Idle_body.
- *
- * If FALSE, then use the generic IDLE thread body if the BSP does
- * not provide one.
- *
- * This is intended to allow for supporting processors which have
- * a low power or idle mode. When the IDLE thread is executed, then
- * the CPU can be powered down.
- *
- * The order of precedence for selecting the IDLE thread body is:
- *
- * 1. BSP provided
- * 2. CPU dependent (if provided)
- * 3. generic (if no BSP and no CPU dependent)
- */
-
-#define CPU_PROVIDES_IDLE_THREAD_BODY TRUE
-
-/*
- * Does the stack grow up (toward higher addresses) or down
- * (toward lower addresses)?
- *
- * If TRUE, then the grows upward.
- * If FALSE, then the grows toward smaller addresses.
- */
-
-#define CPU_STACK_GROWS_UP TRUE
-
-/*
- * The following is the variable attribute used to force alignment
- * of critical RTEMS structures. On some processors it may make
- * sense to have these aligned on tighter boundaries than
- * the minimum requirements of the compiler in order to have as
- * much of the critical data area as possible in a cache line.
- *
- * The placement of this macro in the declaration of the variables
- * is based on the syntactically requirements of the GNU C
- * "__attribute__" extension. For example with GNU C, use
- * the following to force a structures to a 32 byte boundary.
- *
- * __attribute__ ((aligned (32)))
- *
- * NOTE: Currently only the Priority Bit Map table uses this feature.
- * To benefit from using this, the data must be heavily
- * used so it will stay in the cache and used frequently enough
- * in the executive to justify turning this on.
- */
-
-#define CPU_STRUCTURE_ALIGNMENT
-
-/*
- * Define what is required to specify how the network to host conversion
- * routines are handled.
- */
-
-#define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE
-#define CPU_BIG_ENDIAN TRUE
-#define CPU_LITTLE_ENDIAN FALSE
-
-/*
- * The following defines the number of bits actually used in the
- * interrupt field of the task mode. How those bits map to the
- * CPU interrupt levels is defined by the routine _CPU_ISR_Set_level().
- */
-
-#define CPU_MODES_INTERRUPT_MASK 0x00000001
-
-/*
- * Processor defined structures
- *
- * Examples structures include the descriptor tables from the i386
- * and the processor control structure on the i960ca.
- */
-
-/* may need to put some structures here. */
-
-/*
- * Contexts
- *
- * Generally there are 2 types of context to save.
- * 1. Interrupt registers to save
- * 2. Task level registers to save
- *
- * This means we have the following 3 context items:
- * 1. task level context stuff:: Context_Control
- * 2. floating point task stuff:: Context_Control_fp
- * 3. special interrupt level context :: Context_Control_interrupt
- *
- * On some processors, it is cost-effective to save only the callee
- * preserved registers during a task context switch. This means
- * that the ISR code needs to save those registers which do not
- * persist across function calls. It is not mandatory to make this
- * distinctions between the caller/callee saves registers for the
- * purpose of minimizing context saved during task switch and on interrupts.
- * If the cost of saving extra registers is minimal, simplicity is the
- * choice. Save the same context on interrupt entry as for tasks in
- * this case.
- *
- * Additionally, if gdb is to be made aware of RTEMS tasks for this CPU, then
- * care should be used in designing the context area.
- *
- * On some CPUs with hardware floating point support, the Context_Control_fp
- * structure will not be used or it simply consist of an array of a
- * fixed number of bytes. This is done when the floating point context
- * is dumped by a "FP save context" type instruction and the format
- * is not really defined by the CPU. In this case, there is no need
- * to figure out the exact format -- only the size. Of course, although
- * this is enough information for RTEMS, it is probably not enough for
- * a debugger such as gdb. But that is another problem.
- */
-
-typedef struct {
- unsigned32 some_integer_register;
- unsigned32 some_system_register;
-} Context_Control;
-
-typedef struct {
- double some_float_register;
-} Context_Control_fp;
-
-typedef struct {
- unsigned32 special_interrupt_register;
-} CPU_Interrupt_frame;
-
-
-/*
- * The following table contains the information required to configure
- * the XXX processor specific parameters.
- */
-
-typedef struct {
- void (*pretasking_hook)( void );
- void (*predriver_hook)( void );
- void (*postdriver_hook)( void );
- void (*idle_task)( void );
- boolean do_zero_of_workspace;
- unsigned32 idle_task_stack_size;
- unsigned32 interrupt_stack_size;
- unsigned32 extra_mpci_receive_server_stack;
- void * (*stack_allocate_hook)( unsigned32 );
- void (*stack_free_hook)( void* );
- /* end of fields required on all CPUs */
-
- unsigned32 some_other_cpu_dependent_info;
-} rtems_cpu_table;
-
-/*
- * This variable is optional. It is used on CPUs on which it is difficult
- * to generate an "uninitialized" FP context. It is filled in by
- * _CPU_Initialize and copied into the task's FP context area during
- * _CPU_Context_Initialize.
- */
-
-SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context;
-
-/*
- * On some CPUs, RTEMS supports a software managed interrupt stack.
- * This stack is allocated by the Interrupt Manager and the switch
- * is performed in _ISR_Handler. These variables contain pointers
- * to the lowest and highest addresses in the chunk of memory allocated
- * for the interrupt stack. Since it is unknown whether the stack
- * grows up or down (in general), this give the CPU dependent
- * code the option of picking the version it wants to use.
- *
- * NOTE: These two variables are required if the macro
- * CPU_HAS_SOFTWARE_INTERRUPT_STACK is defined as TRUE.
- */
-
-SCORE_EXTERN void *_CPU_Interrupt_stack_low;
-SCORE_EXTERN void *_CPU_Interrupt_stack_high;
-
-/*
- * With some compilation systems, it is difficult if not impossible to
- * call a high-level language routine from assembly language. This
- * is especially true of commercial Ada compilers and name mangling
- * C++ ones. This variable can be optionally defined by the CPU porter
- * and contains the address of the routine _Thread_Dispatch. This
- * can make it easier to invoke that routine at the end of the interrupt
- * sequence (if a dispatch is necessary).
- */
-
-SCORE_EXTERN void (*_CPU_Thread_dispatch_pointer)();
-
-/*
- * Nothing prevents the porter from declaring more CPU specific variables.
- */
-
-/* XXX: if needed, put more variables here */
-
-/*
- * The size of the floating point context area. On some CPUs this
- * will not be a "sizeof" because the format of the floating point
- * area is not defined -- only the size is. This is usually on
- * CPUs with a "floating point save context" instruction.
- */
-
-#define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp )
-
-/*
- * Amount of extra stack (above minimum stack size) required by
- * MPCI receive server thread. Remember that in a multiprocessor
- * system this thread must exist and be able to process all directives.
- */
-
-#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0
-
-/*
- * This defines the number of entries in the ISR_Vector_table managed
- * by RTEMS.
- */
-
-#define CPU_INTERRUPT_NUMBER_OF_VECTORS 32
-#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1)
-
-/*
- * Should be large enough to run all RTEMS tests. This insures
- * that a "reasonable" small application should not have any problems.
- */
-
-#define CPU_STACK_MINIMUM_SIZE (1024*4)
-
-/*
- * CPU's worst alignment requirement for data types on a byte boundary. This
- * alignment does not take into account the requirements for the stack.
- */
-
-#define CPU_ALIGNMENT 8
-
-/*
- * This number corresponds to the byte alignment requirement for the
- * heap handler. This alignment requirement may be stricter than that
- * for the data types alignment specified by CPU_ALIGNMENT. It is
- * common for the heap to follow the same alignment requirement as
- * CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict enough for the heap,
- * then this should be set to CPU_ALIGNMENT.
- *
- * NOTE: This does not have to be a power of 2. It does have to
- * be greater or equal to than CPU_ALIGNMENT.
- */
-
-#define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * This number corresponds to the byte alignment requirement for memory
- * buffers allocated by the partition manager. This alignment requirement
- * may be stricter than that for the data types alignment specified by
- * CPU_ALIGNMENT. It is common for the partition to follow the same
- * alignment requirement as CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict
- * enough for the partition, then this should be set to CPU_ALIGNMENT.
- *
- * NOTE: This does not have to be a power of 2. It does have to
- * be greater or equal to than CPU_ALIGNMENT.
- */
-
-#define CPU_PARTITION_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * This number corresponds to the byte alignment requirement for the
- * stack. This alignment requirement may be stricter than that for the
- * data types alignment specified by CPU_ALIGNMENT. If the CPU_ALIGNMENT
- * is strict enough for the stack, then this should be set to 0.
- *
- * NOTE: This must be a power of 2 either 0 or greater than CPU_ALIGNMENT.
- */
-
-#define CPU_STACK_ALIGNMENT 0
-
-/* ISR handler macros */
-
-/*
- * Disable all interrupts for an RTEMS critical section. The previous
- * level is returned in _level.
- */
-
-#define _CPU_ISR_Disable( _isr_cookie ) \
- { \
- (_isr_cookie) = 0; /* do something to prevent warnings */ \
- }
-
-/*
- * Enable interrupts to the previous level (returned by _CPU_ISR_Disable).
- * This indicates the end of an RTEMS critical section. The parameter
- * _level is not modified.
- */
-
-#define _CPU_ISR_Enable( _isr_cookie ) \
- { \
- }
-
-/*
- * This temporarily restores the interrupt to _level before immediately
- * disabling them again. This is used to divide long RTEMS critical
- * sections into two or more parts. The parameter _level is not
- * modified.
- */
-
-#define _CPU_ISR_Flash( _isr_cookie ) \
- { \
- }
-
-/*
- * Map interrupt level in task mode onto the hardware that the CPU
- * actually provides. Currently, interrupt levels which do not
- * map onto the CPU in a generic fashion are undefined. Someday,
- * it would be nice if these were "mapped" by the application
- * via a callout. For example, m68k has 8 levels 0 - 7, levels
- * 8 - 255 would be available for bsp/application specific meaning.
- * This could be used to manage a programmable interrupt controller
- * via the rtems_task_mode directive.
- *
- * The get routine usually must be implemented as a subroutine.
- */
-
-#define _CPU_ISR_Set_level( new_level ) \
- { \
- }
-
-unsigned32 _CPU_ISR_Get_level( void );
-
-/* end of ISR handler macros */
-
-/* Context handler macros */
-
-/*
- * Initialize the context to a state suitable for starting a
- * task after a context restore operation. Generally, this
- * involves:
- *
- * - setting a starting address
- * - preparing the stack
- * - preparing the stack and frame pointers
- * - setting the proper interrupt level in the context
- * - initializing the floating point context
- *
- * This routine generally does not set any unnecessary register
- * in the context. The state of the "general data" registers is
- * undefined at task start time.
- *
- * NOTE: This is_fp parameter is TRUE if the thread is to be a floating
- * point thread. This is typically only used on CPUs where the
- * FPU may be easily disabled by software such as on the SPARC
- * where the PSR contains an enable FPU bit.
- */
-
-#define _CPU_Context_Initialize( _the_context, _stack_base, _size, \
- _isr, _entry_point, _is_fp ) \
- { \
- }
-
-/*
- * This routine is responsible for somehow restarting the currently
- * executing task. If you are lucky, then all that is necessary
- * is restoring the context. Otherwise, there will need to be
- * a special assembly routine which does something special in this
- * case. Context_Restore should work most of the time. It will
- * not work if restarting self conflicts with the stack frame
- * assumptions of restoring a context.
- */
-
-#define _CPU_Context_Restart_self( _the_context ) \
- _CPU_Context_restore( (_the_context) );
-
-/*
- * The purpose of this macro is to allow the initial pointer into
- * a floating point context area (used to save the floating point
- * context) to be at an arbitrary place in the floating point
- * context area.
- *
- * This is necessary because some FP units are designed to have
- * their context saved as a stack which grows into lower addresses.
- * Other FP units can be saved by simply moving registers into offsets
- * from the base of the context area. Finally some FP units provide
- * a "dump context" instruction which could fill in from high to low
- * or low to high based on the whim of the CPU designers.
- */
-
-#define _CPU_Context_Fp_start( _base, _offset ) \
- ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
-
-/*
- * This routine initializes the FP context area passed to it to.
- * There are a few standard ways in which to initialize the
- * floating point context. The code included for this macro assumes
- * that this is a CPU in which a "initial" FP context was saved into
- * _CPU_Null_fp_context and it simply copies it to the destination
- * context passed to it.
- *
- * Other models include (1) not doing anything, and (2) putting
- * a "null FP status word" in the correct place in the FP context.
- */
-
-#define _CPU_Context_Initialize_fp( _destination ) \
- { \
- *((Context_Control_fp *) *((void **) _destination)) = _CPU_Null_fp_context; \
- }
-
-/* end of Context handler macros */
-
-/* Fatal Error manager macros */
-
-/*
- * This routine copies _error into a known place -- typically a stack
- * location or a register, optionally disables interrupts, and
- * halts/stops the CPU.
- */
-
-#define _CPU_Fatal_halt( _error ) \
- { \
- }
-
-/* end of Fatal Error manager macros */
-
-/* Bitfield handler macros */
-
-/*
- * This routine sets _output to the bit number of the first bit
- * set in _value. _value is of CPU dependent type Priority_Bit_map_control.
- * This type may be either 16 or 32 bits wide although only the 16
- * least significant bits will be used.
- *
- * There are a number of variables in using a "find first bit" type
- * instruction.
- *
- * (1) What happens when run on a value of zero?
- * (2) Bits may be numbered from MSB to LSB or vice-versa.
- * (3) The numbering may be zero or one based.
- * (4) The "find first bit" instruction may search from MSB or LSB.
- *
- * RTEMS guarantees that (1) will never happen so it is not a concern.
- * (2),(3), (4) are handled by the macros _CPU_Priority_mask() and
- * _CPU_Priority_bits_index(). These three form a set of routines
- * which must logically operate together. Bits in the _value are
- * set and cleared based on masks built by _CPU_Priority_mask().
- * The basic major and minor values calculated by _Priority_Major()
- * and _Priority_Minor() are "massaged" by _CPU_Priority_bits_index()
- * to properly range between the values returned by the "find first bit"
- * instruction. This makes it possible for _Priority_Get_highest() to
- * calculate the major and directly index into the minor table.
- * This mapping is necessary to ensure that 0 (a high priority major/minor)
- * is the first bit found.
- *
- * This entire "find first bit" and mapping process depends heavily
- * on the manner in which a priority is broken into a major and minor
- * components with the major being the 4 MSB of a priority and minor
- * the 4 LSB. Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
- * priority. And (15 << 4) + 14 corresponds to priority 254 -- the next
- * to the lowest priority.
- *
- * If your CPU does not have a "find first bit" instruction, then
- * there are ways to make do without it. Here are a handful of ways
- * to implement this in software:
- *
- * - a series of 16 bit test instructions
- * - a "binary search using if's"
- * - _number = 0
- * if _value > 0x00ff
- * _value >>=8
- * _number = 8;
- *
- * if _value > 0x0000f
- * _value >=8
- * _number += 4
- *
- * _number += bit_set_table[ _value ]
- *
- * where bit_set_table[ 16 ] has values which indicate the first
- * bit set
- */
-
-#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
-#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
-
-#if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
-
-#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
- { \
- (_output) = 0; /* do something to prevent warnings */ \
- }
-
-#endif
-
-/* end of Bitfield handler macros */
-
-/*
- * This routine builds the mask which corresponds to the bit fields
- * as searched by _CPU_Bitfield_Find_first_bit(). See the discussion
- * for that routine.
- */
-
-#if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
-
-#define _CPU_Priority_Mask( _bit_number ) \
- ( 1 << (_bit_number) )
-
-#endif
-
-/*
- * This routine translates the bit numbers returned by
- * _CPU_Bitfield_Find_first_bit() into something suitable for use as
- * a major or minor component of a priority. See the discussion
- * for that routine.
- */
-
-#if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
-
-#define _CPU_Priority_bits_index( _priority ) \
- (_priority)
-
-#endif
-
-/* end of Priority handler macros */
-
-/* functions */
-
-/*
- * _CPU_Initialize
- *
- * This routine performs CPU dependent initialization.
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch)
-);
-
-/*
- * _CPU_ISR_install_raw_handler
- *
- * This routine installs a "raw" interrupt handler directly into the
- * processor's vector table.
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_ISR_install_vector
- *
- * This routine installs an interrupt vector.
- */
-
-void _CPU_ISR_install_vector(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_Install_interrupt_stack
- *
- * This routine installs the hardware interrupt stack pointer.
- *
- * NOTE: It need only be provided if CPU_HAS_HARDWARE_INTERRUPT_STACK
- * is TRUE.
- */
-
-void _CPU_Install_interrupt_stack( void );
-
-/*
- * _CPU_Thread_Idle_body
- *
- * This routine is the CPU dependent IDLE thread body.
- *
- * NOTE: It need only be provided if CPU_PROVIDES_IDLE_THREAD_BODY
- * is TRUE.
- */
-
-void _CPU_Thread_Idle_body( void );
-
-/*
- * _CPU_Context_switch
- *
- * This routine switches from the run context to the heir context.
- */
-
-void _CPU_Context_switch(
- Context_Control *run,
- Context_Control *heir
-);
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally 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.
- */
-
-void _CPU_Context_restore(
- Context_Control *new_context
-);
-
-/*
- * _CPU_Context_save_fp
- *
- * This routine saves the floating point context passed to it.
- */
-
-void _CPU_Context_save_fp(
- void **fp_context_ptr
-);
-
-/*
- * _CPU_Context_restore_fp
- *
- * This routine restores the floating point context passed to it.
- */
-
-void _CPU_Context_restore_fp(
- void **fp_context_ptr
-);
-
-/* The following routine swaps the endian format of an unsigned int.
- * It must be static because it is referenced indirectly.
- *
- * This version will work on any processor, but if there is a better
- * way for your CPU PLEASE use it. The most common way to do this is to:
- *
- * swap least significant two bytes with 16-bit rotate
- * swap upper and lower 16-bits
- * swap most significant two bytes with 16-bit rotate
- *
- * Some CPUs have special instructions which swap a 32-bit quantity in
- * a single instruction (e.g. i486). It is probably best to avoid
- * an "endian swapping control bit" in the CPU. One good reason is
- * that interrupts would probably have to be disabled to insure that
- * an interrupt does not try to access the same "chunk" with the wrong
- * endian. Another good reason is that on some CPUs, the endian bit
- * endianness for ALL fetches -- both code and data -- so the code
- * will be fetched incorrectly.
- */
-
-static inline unsigned int CPU_swap_u32(
- unsigned int value
-)
-{
- unsigned32 byte1, byte2, byte3, byte4, swapped;
-
- byte4 = (value >> 24) & 0xff;
- byte3 = (value >> 16) & 0xff;
- byte2 = (value >> 8) & 0xff;
- byte1 = value & 0xff;
-
- swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4;
- return( swapped );
-}
-
-#define CPU_swap_u16( value ) \
- (((value&0xff) << 8) | ((value >> 8)&0xff))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/exec/score/cpu/no_cpu/cpu_asm.c b/c/src/exec/score/cpu/no_cpu/cpu_asm.c
deleted file mode 100644
index d6abcab5c2..0000000000
--- a/c/src/exec/score/cpu/no_cpu/cpu_asm.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/* cpu_asm.c ===> cpu_asm.S or cpu_asm.s
- *
- * This file contains the basic algorithms for all assembly code used
- * in an specific CPU port of RTEMS. These algorithms must be implemented
- * in assembly language
- *
- * NOTE: This is supposed to be a .S or .s file NOT a C file.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 is supposed to be an assembly file. This means that system.h
- * and cpu.h should not be included in a "real" cpu_asm file. An
- * implementation in assembly should include "cpu_asm.h>
- */
-
-#include <rtems/system.h>
-#include <rtems/score/cpu.h>
-/* #include "cpu_asm.h> */
-
-/*
- * _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.
- */
-
-void _CPU_Context_save_fp(
- void **fp_context_ptr
-)
-{
-}
-
-/*
- * _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.
- */
-
-void _CPU_Context_restore_fp(
- void **fp_context_ptr
-)
-{
-}
-
-/* _CPU_Context_switch
- *
- * This routine performs a normal non-FP context switch.
- */
-
-void _CPU_Context_switch(
- Context_Control *run,
- Context_Control *heir
-)
-{
-}
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally 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.
- */
-
-void _CPU_Context_restore(
- Context_Control *new_context
-)
-{
-}
-
-/* void __ISR_Handler()
- *
- * This routine provides the RTEMS interrupt management.
- *
- */
-
-void _ISR_Handler()
-{
- /*
- * This discussion ignores a lot of the ugly details in a real
- * implementation such as saving enough registers/state to be
- * able to do something real. Keep in mind that the goal is
- * to invoke a user's ISR handler which is written in C and
- * uses a certain set of registers.
- *
- * Also note that the exact order is to a large extent flexible.
- * Hardware will dictate a sequence for a certain subset of
- * _ISR_Handler while requirements for setting
- */
-
- /*
- * At entry to "common" _ISR_Handler, the vector number must be
- * available. On some CPUs the hardware puts either the vector
- * number or the offset into the vector table for this ISR in a
- * known place. If the hardware does not give us this information,
- * then the assembly portion of RTEMS for this port will contain
- * a set of distinct interrupt entry points which somehow place
- * the vector number in a known place (which is safe if another
- * interrupt nests this one) and branches to _ISR_Handler.
- *
- * save some or all context on stack
- * may need to save some special interrupt information for exit
- *
- * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- * if ( _ISR_Nest_level == 0 )
- * switch to software interrupt stack
- * #endif
- *
- * _ISR_Nest_level++;
- *
- * _Thread_Dispatch_disable_level++;
- *
- * (*_ISR_Vector_table[ vector ])( vector );
- *
- * --_ISR_Nest_level;
- *
- * if ( _ISR_Nest_level )
- * goto the label "exit interrupt (simple case)"
- *
- * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- * restore stack
- * #endif
- *
- * if ( !_Context_Switch_necessary )
- * goto the label "exit interrupt (simple case)"
- *
- * if ( !_ISR_Signals_to_thread_executing )
- * _ISR_Signals_to_thread_executing = FALSE;
- * goto the label "exit interrupt (simple case)"
- *
- * call _Thread_Dispatch() or prepare to return to _ISR_Dispatch
- *
- * prepare to get out of interrupt
- * return from interrupt (maybe to _ISR_Dispatch)
- *
- * LABEL "exit interrupt (simple case):
- * prepare to get out of interrupt
- * return from interrupt
- */
-}
-
diff --git a/c/src/exec/score/cpu/no_cpu/cpu_asm.h b/c/src/exec/score/cpu/no_cpu/cpu_asm.h
deleted file mode 100644
index ed58c331bc..0000000000
--- a/c/src/exec/score/cpu/no_cpu/cpu_asm.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * cpu_asm.h
- *
- * Very loose template for an include file for the cpu_asm.? file
- * if it is implemented as a ".S" file (preprocessed by cpp) instead
- * of a ".s" file (preprocessed by gm4 or gasp).
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution 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_ASM_h
-#define __CPU_ASM_h
-
-/* pull in the generated offsets */
-
-#include <rtems/score/offsets.h>
-
-/*
- * Hardware General Registers
- */
-
-/* put something here */
-
-/*
- * Hardware Floating Point Registers
- */
-
-/* put something here */
-
-/*
- * Hardware Control Registers
- */
-
-/* put something here */
-
-/*
- * Calling Convention
- */
-
-/* put something here */
-
-/*
- * Temporary registers
- */
-
-/* put something here */
-
-/*
- * Floating Point Registers - SW Conventions
- */
-
-/* put something here */
-
-/*
- * Temporary floating point registers
- */
-
-/* put something here */
-
-#endif
-
-/* end of file */
diff --git a/c/src/exec/score/cpu/no_cpu/no_cpu.h b/c/src/exec/score/cpu/no_cpu/no_cpu.h
deleted file mode 100644
index a6df61a908..0000000000
--- a/c/src/exec/score/cpu/no_cpu/no_cpu.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* no_cpu.h
- *
- * This file is an example (i.e. "no CPU") of the file which is
- * created for each CPU family port of RTEMS.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution 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 _INCLUDE_NO_CPU_h
-#define _INCLUDE_NO_CPU_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This file contains the information required to build
- * RTEMS for a particular member of the "no cpu"
- * family when executing in protected mode. It does
- * this by setting variables to indicate which implementation
- * dependent features are present in a particular member
- * of the family.
- */
-
-#if defined(no_cpu)
-
-#define CPU_MODEL_NAME "no_cpu"
-#define NOCPU_HAS_FPU 1
-
-#else
-
-#error "Unsupported CPU Model"
-
-#endif
-
-/*
- * Define the name of the CPU family.
- */
-
-#define CPU_NAME "NO CPU"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! _INCLUDE_NO_CPU_h */
-/* end of include file */
diff --git a/c/src/exec/score/cpu/no_cpu/no_cputypes.h b/c/src/exec/score/cpu/no_cpu/no_cputypes.h
deleted file mode 100644
index a195711342..0000000000
--- a/c/src/exec/score/cpu/no_cpu/no_cputypes.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* no_cputypes.h
- *
- * This include file contains type definitions pertaining to the Intel
- * no_cpu processor family.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __NO_CPU_TYPES_h
-#define __NO_CPU_TYPES_h
-
-#ifndef ASM
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* unsigned 8-bit integer */
-typedef unsigned short unsigned16; /* unsigned 16-bit integer */
-typedef unsigned int unsigned32; /* unsigned 32-bit integer */
-typedef unsigned long long unsigned64; /* unsigned 64-bit integer */
-
-typedef unsigned16 Priority_Bit_map_control;
-
-typedef signed char signed8; /* 8-bit signed integer */
-typedef signed short signed16; /* 16-bit signed integer */
-typedef signed int signed32; /* 32-bit signed integer */
-typedef signed long long signed64; /* 64 bit signed integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-typedef void no_cpu_isr;
-typedef void ( *no_cpu_isr_entry )( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !ASM */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/cpu/no_cpu/rtems.c b/c/src/exec/score/cpu/no_cpu/rtems.c
deleted file mode 100644
index 7744c53dab..0000000000
--- a/c/src/exec/score/cpu/no_cpu/rtems.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* rtems.c ===> rtems.S or rtems.s
- *
- * This file contains the single entry point code for
- * the XXX implementation of RTEMS.
- *
- * NOTE: This is supposed to be a .S or .s file NOT a C file.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 is supposed to be an assembly file. This means that system.h
- * and cpu.h should not be included in a "real" rtems file.
- */
-
-#include <rtems/system.h>
-#include <rtems/score/cpu.h>
-/* #include "asm.h> */
-
-/*
- * RTEMS
- *
- * This routine jumps to the directive indicated in the
- * CPU defined register. This routine is used when RTEMS is
- * linked by itself and placed in ROM. This routine is the
- * first address in the ROM space for RTEMS. The user "calls"
- * this address with the directive arguments in the normal place.
- * This routine then jumps indirectly to the correct directive
- * preserving the arguments. The directive should not realize
- * it has been "wrapped" in this way. The table "_Entry_points"
- * is used to look up the directive.
- */
-
-void RTEMS()
-{
-}
-
diff --git a/c/src/exec/score/cpu/powerpc/Makefile.in b/c/src/exec/score/cpu/powerpc/Makefile.in
deleted file mode 100644
index f5f7ca5b92..0000000000
--- a/c/src/exec/score/cpu/powerpc/Makefile.in
+++ /dev/null
@@ -1,86 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-RELS=$(ARCH)/rtems-cpu.rel
-
-# C source names, if any, go here -- minus the .c
-# Normally cpu_asm and rtems are assembly files
-C_PIECES=cpu
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/cpu.h $(srcdir)/ppc.h $(srcdir)/ppctypes.h
-
-# H_FILES that get installed externally
-EXTERNAL_H_FILES = $(srcdir)/asm.h
-
-# Assembly source names, if any, go here -- minus the .s
-# Normally cpu_asm and rtems are assembly files
-S_PIECES=cpu_asm rtems
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) $(EXTERNAL_H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) preinstall $(OBJS) $(RELS)
-
-$(ARCH)/rtems-cpu.rel: $(OBJS)
- $(make-rel)
-
-$(ARCH)/cpu_asm.o: irq_stub.s
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-install: all
-
-preinstall: $(ARCH) \
- $(PROJECT_INCLUDE)/rtems/score/targopts.h \
- ${PROJECT_RELEASE}/lib/bsp_specs
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
-# we will share the basic cpu file
- $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
-# make a link in case we are not compiling in the source directory
- test -f irq_stub.s || $(LN) -s $(srcdir)/irq_stub.s irq_stub.s
-
-$(PROJECT_INCLUDE)/rtems/score/targopts.h: $(ARCH)/targopts.h-tmp
- $(INSTALL) -m 444 $(ARCH)/targopts.h-tmp $@
-
-# $(ARCH)/targopts.h-tmp rule is in leaf.cfg
-
-${PROJECT_RELEASE}/lib/bsp_specs: $(ARCH)/bsp_specs.tmp
- $(INSTALL) -m 444 $(ARCH)/bsp_specs.tmp $@
-
-# $(ARCH)/bsp_specs.tmp rule is in leaf.cfg
diff --git a/c/src/exec/score/cpu/powerpc/README b/c/src/exec/score/cpu/powerpc/README
deleted file mode 100644
index 0b87ac1ea7..0000000000
--- a/c/src/exec/score/cpu/powerpc/README
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# $Id$
-#
-
-There are various issues regarding this port:
-
-
-
-1) Legal
-
-This port is written by Andrew Bray <andy@i-cubed.co.uk>, and
-is copyright 1995 i-cubed ltd.
-
-This port was later updated by Joel Sherrill <joel@OARcorp.com>
-to test the support for the PPC603, PPC603e, and PPC604. 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,
-and PPC604 processors. A good faith attempt has been made to include
-support other models based upon available documentation.
-
-This port was originally written and tested on the PPC403GA (using
-software floating point). Current ports are tested 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 and .
-
-Andrew Bray, 4 December 1995
-Joel Sherrill, 16 July 1997
diff --git a/c/src/exec/score/cpu/powerpc/TODO b/c/src/exec/score/cpu/powerpc/TODO
deleted file mode 100644
index 64c96cb14c..0000000000
--- a/c/src/exec/score/cpu/powerpc/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/exec/score/cpu/powerpc/cpu.c b/c/src/exec/score/cpu/powerpc/cpu.c
deleted file mode 100644
index da6ecf4d19..0000000000
--- a/c/src/exec/score/cpu/powerpc/cpu.c
+++ /dev/null
@@ -1,651 +0,0 @@
-/*
- * PowerPC CPU Dependent Source
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/context.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-/*
- * 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 *);
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch) /* ignored on this CPU */
-)
-{
- proc_ptr handler = (proc_ptr)ppc_spurious;
- int i;
-#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;
- _CPU_IRQ_info.Vector_table = _ISR_Vector_table;
-#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
-
- 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;
-
- _CPU_Table = *cpu_table;
-}
-
-/*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
-#ifdef ppc403
- 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
-}
-
-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) */
-};
-
-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
- *old_handler = 0;
-
- /*
- * Copy the template to the slot and then fix it.
- */
- *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)
-
-/* 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(ppc604)
- case PPC_IRQ_ADDR_BRK:
- Offset = 0x1300;
- break;
- case PPC_IRQ_SYS_MGT:
- Offset = 0x1400;
- break;
-#endif
-
- }
- Top += Offset;
- return Top;
-}
-
diff --git a/c/src/exec/score/cpu/powerpc/cpu.h b/c/src/exec/score/cpu/powerpc/cpu.h
deleted file mode 100644
index 1240f68451..0000000000
--- a/c/src/exec/score/cpu/powerpc/cpu.h
+++ /dev/null
@@ -1,1143 +0,0 @@
-/* cpu.h
- *
- * This include file contains information pertaining to the PowerPC
- * processor.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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.h:
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-#ifndef __CPU_h
-#define __CPU_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/ppc.h> /* pick up machine definitions */
-#ifndef ASM
-struct CPU_Interrupt_frame;
-
-#include <rtems/score/ppctypes.h>
-#endif
-
-/* conditional compilation parameters */
-
-/*
- * Should the calls to _Thread_Enable_dispatch be inlined?
- *
- * If TRUE, then they are inlined.
- * If FALSE, then a subroutine call is made.
- *
- * Basically this is an example of the classic trade-off of size
- * versus speed. Inlining the call (TRUE) typically increases the
- * size of RTEMS while speeding up the enabling of dispatching.
- * [NOTE: In general, the _Thread_Dispatch_disable_level will
- * only be 0 or 1 unless you are in an interrupt handler and that
- * interrupt handler invokes the executive.] When not inlined
- * something calls _Thread_Enable_dispatch which in turns calls
- * _Thread_Dispatch. If the enable dispatch is inlined, then
- * one subroutine call is avoided entirely.]
- */
-
-#define CPU_INLINE_ENABLE_DISPATCH FALSE
-
-/*
- * Should the body of the search loops in _Thread_queue_Enqueue_priority
- * be unrolled one time? In unrolled each iteration of the loop examines
- * two "nodes" on the chain being searched. Otherwise, only one node
- * is examined per iteration.
- *
- * If TRUE, then the loops are unrolled.
- * If FALSE, then the loops are not unrolled.
- *
- * The primary factor in making this decision is the cost of disabling
- * and enabling interrupts (_ISR_Flash) versus the cost of rest of the
- * body of the loop. On some CPUs, the flash is more expensive than
- * one iteration of the loop body. In this case, it might be desirable
- * to unroll the loop. It is important to note that on some CPUs, this
- * code is the longest interrupt disable period in RTEMS. So it is
- * necessary to strike a balance when setting this parameter.
- */
-
-#define CPU_UNROLL_ENQUEUE_PRIORITY FALSE
-
-/*
- * Does RTEMS manage a dedicated interrupt stack in software?
- *
- * If TRUE, then a stack is allocated in _Interrupt_Manager_initialization.
- * If FALSE, nothing is done.
- *
- * If the CPU supports a dedicated interrupt stack in hardware,
- * then it is generally the responsibility of the BSP to allocate it
- * and set it up.
- *
- * If the CPU does not support a dedicated interrupt stack, then
- * the porter has two options: (1) execute interrupts on the
- * stack of the interrupted task, and (2) have RTEMS manage a dedicated
- * interrupt stack.
- *
- * If this is TRUE, CPU_ALLOCATE_INTERRUPT_STACK should also be TRUE.
- *
- * Only one of CPU_HAS_SOFTWARE_INTERRUPT_STACK and
- * CPU_HAS_HARDWARE_INTERRUPT_STACK should be set to TRUE. It is
- * possible that both are FALSE for a particular CPU. Although it
- * is unclear what that would imply about the interrupt processing
- * procedure on that CPU.
- */
-
-#define CPU_HAS_SOFTWARE_INTERRUPT_STACK FALSE
-
-/*
- * Does this CPU have hardware support for a dedicated interrupt stack?
- *
- * If TRUE, then it must be installed during initialization.
- * If FALSE, then no installation is performed.
- *
- * If this is TRUE, CPU_ALLOCATE_INTERRUPT_STACK should also be TRUE.
- *
- * Only one of CPU_HAS_SOFTWARE_INTERRUPT_STACK and
- * CPU_HAS_HARDWARE_INTERRUPT_STACK should be set to TRUE. It is
- * possible that both are FALSE for a particular CPU. Although it
- * is unclear what that would imply about the interrupt processing
- * procedure on that CPU.
- */
-
-/*
- * ACB: This is a lie, but it gets us a handle on a call to set up
- * a variable derived from the top of the interrupt stack.
- */
-
-#define CPU_HAS_HARDWARE_INTERRUPT_STACK TRUE
-
-/*
- * Does RTEMS allocate a dedicated interrupt stack in the Interrupt Manager?
- *
- * If TRUE, then the memory is allocated during initialization.
- * If FALSE, then the memory is allocated during initialization.
- *
- * This should be TRUE is CPU_HAS_SOFTWARE_INTERRUPT_STACK is TRUE
- * or CPU_INSTALL_HARDWARE_INTERRUPT_STACK is TRUE.
- */
-
-#define CPU_ALLOCATE_INTERRUPT_STACK TRUE
-
-/*
- * Does the RTEMS invoke the user's ISR with the vector number and
- * a pointer to the saved interrupt frame (1) or just the vector
- * number (0)?
- */
-
-#define CPU_ISR_PASSES_FRAME_POINTER 1
-
-/*
- * Does the CPU have hardware floating point?
- *
- * If TRUE, then the RTEMS_FLOATING_POINT task attribute is supported.
- * If FALSE, then the RTEMS_FLOATING_POINT task attribute is ignored.
- *
- * If there is a FP coprocessor such as the i387 or mc68881, then
- * the answer is TRUE.
- *
- * The macro name "PPC_HAS_FPU" should be made CPU specific.
- * It indicates whether or not this CPU model has FP support. For
- * example, it would be possible to have an i386_nofp CPU model
- * which set this to false to indicate that you have an i386 without
- * an i387 and wish to leave floating point support out of RTEMS.
- */
-
-#if ( PPC_HAS_FPU == 1 )
-#define CPU_HARDWARE_FP TRUE
-#else
-#define CPU_HARDWARE_FP FALSE
-#endif
-
-/*
- * Are all tasks RTEMS_FLOATING_POINT tasks implicitly?
- *
- * If TRUE, then the RTEMS_FLOATING_POINT task attribute is assumed.
- * If FALSE, then the RTEMS_FLOATING_POINT task attribute is followed.
- *
- * So far, the only CPU in which this option has been used is the
- * HP PA-RISC. The HP C compiler and gcc both implicitly use the
- * floating point registers to perform integer multiplies. If
- * a function which you would not think utilize the FP unit DOES,
- * then one can not easily predict which tasks will use the FP hardware.
- * In this case, this option should be TRUE.
- *
- * If CPU_HARDWARE_FP is FALSE, then this should be FALSE as well.
- */
-
-#define CPU_ALL_TASKS_ARE_FP FALSE
-
-/*
- * Should the IDLE task have a floating point context?
- *
- * If TRUE, then the IDLE task is created as a RTEMS_FLOATING_POINT task
- * and it has a floating point context which is switched in and out.
- * If FALSE, then the IDLE task does not have a floating point context.
- *
- * Setting this to TRUE negatively impacts the time required to preempt
- * the IDLE task from an interrupt because the floating point context
- * must be saved as part of the preemption.
- */
-
-#define CPU_IDLE_TASK_IS_FP FALSE
-
-/*
- * Should the saving of the floating point registers be deferred
- * until a context switch is made to another different floating point
- * task?
- *
- * If TRUE, then the floating point context will not be stored until
- * necessary. It will remain in the floating point registers and not
- * disturned until another floating point task is switched to.
- *
- * If FALSE, then the floating point context is saved when a floating
- * point task is switched out and restored when the next floating point
- * task is restored. The state of the floating point registers between
- * those two operations is not specified.
- *
- * If the floating point context does NOT have to be saved as part of
- * interrupt dispatching, then it should be safe to set this to TRUE.
- *
- * Setting this flag to TRUE results in using a different algorithm
- * for deciding when to save and restore the floating point context.
- * The deferred FP switch algorithm minimizes the number of times
- * the FP context is saved and restored. The FP context is not saved
- * until a context switch is made to another, different FP task.
- * Thus in a system with only one FP task, the FP context will never
- * be saved or restored.
- */
-/*
- * ACB Note: This could make debugging tricky..
- */
-
-#define CPU_USE_DEFERRED_FP_SWITCH TRUE
-
-/*
- * Does this port provide a CPU dependent IDLE task implementation?
- *
- * If TRUE, then the routine _CPU_Thread_Idle_body
- * must be provided and is the default IDLE thread body instead of
- * _CPU_Thread_Idle_body.
- *
- * If FALSE, then use the generic IDLE thread body if the BSP does
- * not provide one.
- *
- * This is intended to allow for supporting processors which have
- * a low power or idle mode. When the IDLE thread is executed, then
- * the CPU can be powered down.
- *
- * The order of precedence for selecting the IDLE thread body is:
- *
- * 1. BSP provided
- * 2. CPU dependent (if provided)
- * 3. generic (if no BSP and no CPU dependent)
- */
-
-#define CPU_PROVIDES_IDLE_THREAD_BODY FALSE
-
-/*
- * Does the stack grow up (toward higher addresses) or down
- * (toward lower addresses)?
- *
- * If TRUE, then the grows upward.
- * If FALSE, then the grows toward smaller addresses.
- */
-
-#define CPU_STACK_GROWS_UP FALSE
-
-/*
- * The following is the variable attribute used to force alignment
- * of critical RTEMS structures. On some processors it may make
- * sense to have these aligned on tighter boundaries than
- * the minimum requirements of the compiler in order to have as
- * much of the critical data area as possible in a cache line.
- *
- * The placement of this macro in the declaration of the variables
- * is based on the syntactically requirements of the GNU C
- * "__attribute__" extension. For example with GNU C, use
- * the following to force a structures to a 32 byte boundary.
- *
- * __attribute__ ((aligned (32)))
- *
- * NOTE: Currently only the Priority Bit Map table uses this feature.
- * To benefit from using this, the data must be heavily
- * used so it will stay in the cache and used frequently enough
- * in the executive to justify turning this on.
- */
-
-#define CPU_STRUCTURE_ALIGNMENT \
- __attribute__ ((aligned (PPC_CACHE_ALIGNMENT)))
-
-/*
- * Define what is required to specify how the network to host conversion
- * routines are handled.
- */
-
-#define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE
-#define CPU_BIG_ENDIAN TRUE
-#define CPU_LITTLE_ENDIAN FALSE
-
-/*
- * The following defines the number of bits actually used in the
- * interrupt field of the task mode. How those bits map to the
- * CPU interrupt levels is defined by the routine _CPU_ISR_Set_level().
- *
- * The interrupt level is bit mapped for the PowerPC family. The
- * bits are set to 0 to indicate that a particular exception source
- * enabled and 1 if it is disabled. This keeps with RTEMS convention
- * that interrupt level 0 means all sources are enabled.
- *
- * The bits are assigned to correspond to enable bits in the MSR.
- */
-
-#define PPC_INTERRUPT_LEVEL_ME 0x01
-#define PPC_INTERRUPT_LEVEL_EE 0x02
-#define PPC_INTERRUPT_LEVEL_CE 0x04
-
-/* XXX should these be maskable? */
-#if 0
-#define PPC_INTERRUPT_LEVEL_DE 0x08
-#define PPC_INTERRUPT_LEVEL_BE 0x10
-#define PPC_INTERRUPT_LEVEL_SE 0x20
-#endif
-
-#define CPU_MODES_INTERRUPT_MASK 0x00000007
-
-/*
- * Processor defined structures
- *
- * Examples structures include the descriptor tables from the i386
- * and the processor control structure on the i960ca.
- */
-
-/* may need to put some structures here. */
-
-/*
- * Contexts
- *
- * Generally there are 2 types of context to save.
- * 1. Interrupt registers to save
- * 2. Task level registers to save
- *
- * This means we have the following 3 context items:
- * 1. task level context stuff:: Context_Control
- * 2. floating point task stuff:: Context_Control_fp
- * 3. special interrupt level context :: Context_Control_interrupt
- *
- * On some processors, it is cost-effective to save only the callee
- * preserved registers during a task context switch. This means
- * that the ISR code needs to save those registers which do not
- * persist across function calls. It is not mandatory to make this
- * distinctions between the caller/callee saves registers for the
- * purpose of minimizing context saved during task switch and on interrupts.
- * If the cost of saving extra registers is minimal, simplicity is the
- * choice. Save the same context on interrupt entry as for tasks in
- * this case.
- *
- * Additionally, if gdb is to be made aware of RTEMS tasks for this CPU, then
- * care should be used in designing the context area.
- *
- * On some CPUs with hardware floating point support, the Context_Control_fp
- * structure will not be used or it simply consist of an array of a
- * fixed number of bytes. This is done when the floating point context
- * is dumped by a "FP save context" type instruction and the format
- * is not really defined by the CPU. In this case, there is no need
- * to figure out the exact format -- only the size. Of course, although
- * this is enough information for RTEMS, it is probably not enough for
- * a debugger such as gdb. But that is another problem.
- */
-
-typedef struct {
- unsigned32 gpr1; /* Stack pointer for all */
- unsigned32 gpr2; /* TOC in PowerOpen, reserved SVR4, section ptr EABI + */
- unsigned32 gpr13; /* First non volatile PowerOpen, section ptr SVR4/EABI */
- unsigned32 gpr14; /* Non volatile for all */
- unsigned32 gpr15; /* Non volatile for all */
- unsigned32 gpr16; /* Non volatile for all */
- unsigned32 gpr17; /* Non volatile for all */
- unsigned32 gpr18; /* Non volatile for all */
- unsigned32 gpr19; /* Non volatile for all */
- unsigned32 gpr20; /* Non volatile for all */
- unsigned32 gpr21; /* Non volatile for all */
- unsigned32 gpr22; /* Non volatile for all */
- unsigned32 gpr23; /* Non volatile for all */
- unsigned32 gpr24; /* Non volatile for all */
- unsigned32 gpr25; /* Non volatile for all */
- unsigned32 gpr26; /* Non volatile for all */
- unsigned32 gpr27; /* Non volatile for all */
- unsigned32 gpr28; /* Non volatile for all */
- unsigned32 gpr29; /* Non volatile for all */
- unsigned32 gpr30; /* Non volatile for all */
- unsigned32 gpr31; /* Non volatile for all */
- unsigned32 cr; /* PART of the CR is non volatile for all */
- unsigned32 pc; /* Program counter/Link register */
- unsigned32 msr; /* Initial interrupt level */
-} Context_Control;
-
-typedef struct {
- /* The ABIs (PowerOpen/SVR4/EABI) only require saving f14-f31 over
- * procedure calls. However, this would mean that the interrupt
- * frame had to hold f0-f13, and the fpscr. And as the majority
- * of tasks will not have an FP context, we will save the whole
- * context here.
- */
-#if (PPC_HAS_DOUBLE == 1)
- double f[32];
- double fpscr;
-#else
- float f[32];
- float fpscr;
-#endif
-} Context_Control_fp;
-
-typedef struct CPU_Interrupt_frame {
- unsigned32 stacklink; /* Ensure this is a real frame (also reg1 save) */
-#if (PPC_ABI == PPC_ABI_POWEROPEN || PPC_ABI == PPC_ABI_GCC27)
- unsigned32 dummy[13]; /* Used by callees: PowerOpen ABI */
-#else
- unsigned32 dummy[1]; /* Used by callees: SVR4/EABI */
-#endif
- /* This is what is left out of the primary contexts */
- unsigned32 gpr0;
- unsigned32 gpr2; /* play safe */
- unsigned32 gpr3;
- unsigned32 gpr4;
- unsigned32 gpr5;
- unsigned32 gpr6;
- unsigned32 gpr7;
- unsigned32 gpr8;
- unsigned32 gpr9;
- unsigned32 gpr10;
- unsigned32 gpr11;
- unsigned32 gpr12;
- unsigned32 gpr13; /* Play safe */
- unsigned32 gpr28; /* For internal use by the IRQ handler */
- unsigned32 gpr29; /* For internal use by the IRQ handler */
- unsigned32 gpr30; /* For internal use by the IRQ handler */
- unsigned32 gpr31; /* For internal use by the IRQ handler */
- unsigned32 cr; /* Bits of this are volatile, so no-one may save */
- unsigned32 ctr;
- unsigned32 xer;
- unsigned32 lr;
- unsigned32 pc;
- unsigned32 msr;
- unsigned32 pad[3];
-} CPU_Interrupt_frame;
-
-
-/*
- * The following table contains the information required to configure
- * the PowerPC processor specific parameters.
- */
-
-typedef struct {
- void (*pretasking_hook)( void );
- void (*predriver_hook)( void );
- void (*postdriver_hook)( void );
- void (*idle_task)( void );
- boolean do_zero_of_workspace;
- unsigned32 idle_task_stack_size;
- unsigned32 interrupt_stack_size;
- unsigned32 extra_mpci_receive_server_stack;
- void * (*stack_allocate_hook)( unsigned32 );
- void (*stack_free_hook)( void* );
- /* end of fields required on all CPUs */
-
- unsigned32 clicks_per_usec; /* Timer clicks per microsecond */
- void (*spurious_handler)(unsigned32 vector, CPU_Interrupt_frame *);
- boolean exceptions_in_RAM; /* TRUE if in RAM */
-
-#if defined(ppc403)
- unsigned32 serial_per_sec; /* Serial clocks per second */
- boolean serial_external_clock;
- boolean serial_xon_xoff;
- boolean serial_cts_rts;
- unsigned32 serial_rate;
- unsigned32 timer_average_overhead; /* Average overhead of timer in ticks */
- unsigned32 timer_least_valid; /* Least valid number from timer */
- boolean timer_internal_clock; /* TRUE, when timer runs with CPU clk */
-#endif
-} rtems_cpu_table;
-
-/*
- * The following type defines an entry in the PPC's trap table.
- *
- * NOTE: The instructions chosen are RTEMS dependent although one is
- * obligated to use two of the four instructions to perform a
- * long jump. The other instructions load one register with the
- * trap type (a.k.a. vector) and another with the psr.
- */
-
-typedef struct {
- unsigned32 stwu_r1; /* stwu %r1, -(??+IP_END)(%1)*/
- unsigned32 stw_r0; /* stw %r0, IP_0(%r1) */
- unsigned32 li_r0_IRQ; /* li %r0, _IRQ */
- unsigned32 b_Handler; /* b PROC (_ISR_Handler) */
-} CPU_Trap_table_entry;
-
-/*
- * This variable is optional. It is used on CPUs on which it is difficult
- * to generate an "uninitialized" FP context. It is filled in by
- * _CPU_Initialize and copied into the task's FP context area during
- * _CPU_Context_Initialize.
- */
-
-/* EXTERN Context_Control_fp _CPU_Null_fp_context; */
-
-/*
- * On some CPUs, RTEMS supports a software managed interrupt stack.
- * This stack is allocated by the Interrupt Manager and the switch
- * is performed in _ISR_Handler. These variables contain pointers
- * to the lowest and highest addresses in the chunk of memory allocated
- * for the interrupt stack. Since it is unknown whether the stack
- * grows up or down (in general), this give the CPU dependent
- * code the option of picking the version it wants to use.
- *
- * NOTE: These two variables are required if the macro
- * CPU_HAS_SOFTWARE_INTERRUPT_STACK is defined as TRUE.
- */
-
-SCORE_EXTERN void *_CPU_Interrupt_stack_low;
-SCORE_EXTERN void *_CPU_Interrupt_stack_high;
-
-/*
- * With some compilation systems, it is difficult if not impossible to
- * call a high-level language routine from assembly language. This
- * is especially true of commercial Ada compilers and name mangling
- * C++ ones. This variable can be optionally defined by the CPU porter
- * and contains the address of the routine _Thread_Dispatch. This
- * can make it easier to invoke that routine at the end of the interrupt
- * sequence (if a dispatch is necessary).
- */
-
-/* EXTERN void (*_CPU_Thread_dispatch_pointer)(); */
-
-/*
- * Nothing prevents the porter from declaring more CPU specific variables.
- */
-
-
-SCORE_EXTERN struct {
- unsigned32 *Nest_level;
- unsigned32 *Disable_level;
- void *Vector_table;
- void *Stack;
-#if (PPC_ABI == PPC_ABI_POWEROPEN)
- unsigned32 Dispatch_r2;
-#else
- unsigned32 Default_r2;
-#if (PPC_ABI != PPC_ABI_GCC27)
- unsigned32 Default_r13;
-#endif
-#endif
- volatile boolean *Switch_necessary;
- boolean *Signal;
-
- unsigned32 msr_initial;
-} _CPU_IRQ_info CPU_STRUCTURE_ALIGNMENT;
-
-/*
- * The size of the floating point context area. On some CPUs this
- * will not be a "sizeof" because the format of the floating point
- * area is not defined -- only the size is. This is usually on
- * CPUs with a "floating point save context" instruction.
- */
-
-#define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp )
-
-/*
- * (Optional) # of bytes for libmisc/stackchk to check
- * If not specifed, then it defaults to something reasonable
- * for most architectures.
- */
-
-#define CPU_STACK_CHECK_SIZE (128)
-
-/*
- * Amount of extra stack (above minimum stack size) required by
- * MPCI receive server thread. Remember that in a multiprocessor
- * system this thread must exist and be able to process all directives.
- */
-
-#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0
-
-/*
- * This defines the number of entries in the ISR_Vector_table managed
- * by RTEMS.
- */
-
-#define CPU_INTERRUPT_NUMBER_OF_VECTORS (PPC_INTERRUPT_MAX)
-#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (PPC_INTERRUPT_MAX - 1)
-
-/*
- * Should be large enough to run all RTEMS tests. This insures
- * that a "reasonable" small application should not have any problems.
- */
-
-#define CPU_STACK_MINIMUM_SIZE (1024*3)
-
-/*
- * CPU's worst alignment requirement for data types on a byte boundary. This
- * alignment does not take into account the requirements for the stack.
- */
-
-#define CPU_ALIGNMENT (PPC_ALIGNMENT)
-
-/*
- * This number corresponds to the byte alignment requirement for the
- * heap handler. This alignment requirement may be stricter than that
- * for the data types alignment specified by CPU_ALIGNMENT. It is
- * common for the heap to follow the same alignment requirement as
- * CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict enough for the heap,
- * then this should be set to CPU_ALIGNMENT.
- *
- * NOTE: This does not have to be a power of 2. It does have to
- * be greater or equal to than CPU_ALIGNMENT.
- */
-
-#define CPU_HEAP_ALIGNMENT (PPC_ALIGNMENT)
-
-/*
- * This number corresponds to the byte alignment requirement for memory
- * buffers allocated by the partition manager. This alignment requirement
- * may be stricter than that for the data types alignment specified by
- * CPU_ALIGNMENT. It is common for the partition to follow the same
- * alignment requirement as CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict
- * enough for the partition, then this should be set to CPU_ALIGNMENT.
- *
- * NOTE: This does not have to be a power of 2. It does have to
- * be greater or equal to than CPU_ALIGNMENT.
- */
-
-#define CPU_PARTITION_ALIGNMENT (PPC_ALIGNMENT)
-
-/*
- * This number corresponds to the byte alignment requirement for the
- * stack. This alignment requirement may be stricter than that for the
- * data types alignment specified by CPU_ALIGNMENT. If the CPU_ALIGNMENT
- * is strict enough for the stack, then this should be set to 0.
- *
- * NOTE: This must be a power of 2 either 0 or greater than CPU_ALIGNMENT.
- */
-
-#define CPU_STACK_ALIGNMENT (PPC_STACK_ALIGNMENT)
-
-/* ISR handler macros */
-
-/*
- * Disable all interrupts for an RTEMS critical section. The previous
- * level is returned in _isr_cookie.
- */
-
-#define loc_string(a,b) a " (" #b ")\n"
-
-#define _CPU_MSR_Value( _msr_value ) \
- do { \
- _msr_value = 0; \
- asm volatile ("mfmsr %0" : "=&r" ((_msr_value)) : "0" ((_msr_value))); \
- } while (0)
-
-#define _CPU_MSR_SET( _msr_value ) \
-{ asm volatile ("mtmsr %0" : "=&r" ((_msr_value)) : "0" ((_msr_value))); }
-
-#if 0
-#define _CPU_ISR_Disable( _isr_cookie ) \
- { register unsigned int _disable_mask = PPC_MSR_DISABLE_MASK; \
- _isr_cookie = 0; \
- asm volatile (
- "mfmsr %0" : \
- "=r" ((_isr_cookie)) : \
- "0" ((_isr_cookie)) \
- ); \
- asm volatile (
- "andc %1,%0,%1" : \
- "=r" ((_isr_cookie)), "=&r" ((_disable_mask)) : \
- "0" ((_isr_cookie)), "1" ((_disable_mask)) \
- ); \
- asm volatile (
- "mtmsr %1" : \
- "=r" ((_disable_mask)) : \
- "0" ((_disable_mask)) \
- ); \
- }
-#endif
-
-#define _CPU_ISR_Disable( _isr_cookie ) \
- { register unsigned int _disable_mask = PPC_MSR_DISABLE_MASK; \
- _isr_cookie = 0; \
- asm volatile ( \
- "mfmsr %0; andc %1,%0,%1; mtmsr %1" : \
- "=&r" ((_isr_cookie)), "=&r" ((_disable_mask)) : \
- "0" ((_isr_cookie)), "1" ((_disable_mask)) \
- ); \
- }
-
-
-#define _CPU_Data_Cache_Block_Flush( _address ) \
- do { register void *__address = (_address); \
- register unsigned32 _zero = 0; \
- asm volatile ( "dcbf %0,%1" : \
- "=r" (_zero), "=r" (__address) : \
- "0" (_zero), "1" (__address) \
- ); \
- } while (0)
-
-
-/*
- * Enable interrupts to the previous level (returned by _CPU_ISR_Disable).
- * This indicates the end of an RTEMS critical section. The parameter
- * _isr_cookie is not modified.
- */
-
-#define _CPU_ISR_Enable( _isr_cookie ) \
- { \
- asm volatile ( "mtmsr %0" : \
- "=r" ((_isr_cookie)) : \
- "0" ((_isr_cookie))); \
- }
-
-/*
- * This temporarily restores the interrupt to _isr_cookie before immediately
- * disabling them again. This is used to divide long RTEMS critical
- * sections into two or more parts. The parameter _isr_cookie is not
- * modified.
- *
- * NOTE: The version being used is not very optimized but it does
- * not trip a problem in gcc where the disable mask does not
- * get loaded. Check this for future (post 10/97 gcc versions.
- */
-
-#define _CPU_ISR_Flash( _isr_cookie ) \
- { register unsigned int _disable_mask = PPC_MSR_DISABLE_MASK; \
- asm volatile ( \
- "mtmsr %0; andc %1,%0,%1; mtmsr %1" : \
- "=r" ((_isr_cookie)), "=r" ((_disable_mask)) : \
- "0" ((_isr_cookie)), "1" ((_disable_mask)) \
- ); \
- }
-
-/*
- * Map interrupt level in task mode onto the hardware that the CPU
- * actually provides. Currently, interrupt levels which do not
- * map onto the CPU in a generic fashion are undefined. Someday,
- * it would be nice if these were "mapped" by the application
- * via a callout. For example, m68k has 8 levels 0 - 7, levels
- * 8 - 255 would be available for bsp/application specific meaning.
- * This could be used to manage a programmable interrupt controller
- * via the rtems_task_mode directive.
- */
-
-unsigned32 _CPU_ISR_Calculate_level(
- unsigned32 new_level
-);
-
-void _CPU_ISR_Set_level(
- unsigned32 new_level
-);
-
-unsigned32 _CPU_ISR_Get_level( void );
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/* end of ISR handler macros */
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define CPU_Get_timebase_low( _value ) \
- asm volatile( "mftb %0" : "=r" (_value) )
-
-#define delay( _microseconds ) \
- do { \
- unsigned32 start, ticks, now; \
- CPU_Get_timebase_low( start ) ; \
- ticks = (_microseconds) * Cpu_table.clicks_per_usec; \
- do \
- CPU_Get_timebase_low( now ) ; \
- while (now - start < ticks); \
- } while (0)
-
-#define delay_in_bus_cycles( _cycles ) \
- do { \
- unsigned32 start, now; \
- CPU_Get_timebase_low( start ); \
- do \
- CPU_Get_timebase_low( now ); \
- while (now - start < (_cycles)); \
- } while (0)
-
-
-
-/* Context handler macros */
-
-/*
- * Initialize the context to a state suitable for starting a
- * task after a context restore operation. Generally, this
- * involves:
- *
- * - setting a starting address
- * - preparing the stack
- * - preparing the stack and frame pointers
- * - setting the proper interrupt level in the context
- * - initializing the floating point context
- *
- * This routine generally does not set any unnecessary register
- * in the context. The state of the "general data" registers is
- * undefined at task start time.
- *
- * NOTE: Implemented as a subroutine for the SPARC port.
- */
-
-void _CPU_Context_Initialize(
- Context_Control *the_context,
- unsigned32 *stack_base,
- unsigned32 size,
- unsigned32 new_level,
- void *entry_point,
- boolean is_fp
-);
-
-/*
- * This routine is responsible for somehow restarting the currently
- * executing task. If you are lucky, then all that is necessary
- * is restoring the context. Otherwise, there will need to be
- * a special assembly routine which does something special in this
- * case. Context_Restore should work most of the time. It will
- * not work if restarting self conflicts with the stack frame
- * assumptions of restoring a context.
- */
-
-#define _CPU_Context_Restart_self( _the_context ) \
- _CPU_Context_restore( (_the_context) );
-
-/*
- * The purpose of this macro is to allow the initial pointer into
- * a floating point context area (used to save the floating point
- * context) to be at an arbitrary place in the floating point
- * context area.
- *
- * This is necessary because some FP units are designed to have
- * their context saved as a stack which grows into lower addresses.
- * Other FP units can be saved by simply moving registers into offsets
- * from the base of the context area. Finally some FP units provide
- * a "dump context" instruction which could fill in from high to low
- * or low to high based on the whim of the CPU designers.
- */
-
-#define _CPU_Context_Fp_start( _base, _offset ) \
- ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
-
-/*
- * This routine initializes the FP context area passed to it to.
- * There are a few standard ways in which to initialize the
- * floating point context. The code included for this macro assumes
- * that this is a CPU in which a "initial" FP context was saved into
- * _CPU_Null_fp_context and it simply copies it to the destination
- * context passed to it.
- *
- * Other models include (1) not doing anything, and (2) putting
- * a "null FP status word" in the correct place in the FP context.
- */
-
-#define _CPU_Context_Initialize_fp( _destination ) \
- { \
- ((Context_Control_fp *) *((void **) _destination))->fpscr = PPC_INIT_FPSCR; \
- }
-
-/* end of Context handler macros */
-
-/* Fatal Error manager macros */
-
-/*
- * This routine copies _error into a known place -- typically a stack
- * location or a register, optionally disables interrupts, and
- * halts/stops the CPU.
- */
-
-#define _CPU_Fatal_halt( _error ) \
- _CPU_Fatal_error(_error)
-
-/* end of Fatal Error manager macros */
-
-/* Bitfield handler macros */
-
-/*
- * This routine sets _output to the bit number of the first bit
- * set in _value. _value is of CPU dependent type Priority_Bit_map_control.
- * This type may be either 16 or 32 bits wide although only the 16
- * least significant bits will be used.
- *
- * There are a number of variables in using a "find first bit" type
- * instruction.
- *
- * (1) What happens when run on a value of zero?
- * (2) Bits may be numbered from MSB to LSB or vice-versa.
- * (3) The numbering may be zero or one based.
- * (4) The "find first bit" instruction may search from MSB or LSB.
- *
- * RTEMS guarantees that (1) will never happen so it is not a concern.
- * (2),(3), (4) are handled by the macros _CPU_Priority_mask() and
- * _CPU_Priority_Bits_index(). These three form a set of routines
- * which must logically operate together. Bits in the _value are
- * set and cleared based on masks built by _CPU_Priority_mask().
- * The basic major and minor values calculated by _Priority_Major()
- * and _Priority_Minor() are "massaged" by _CPU_Priority_Bits_index()
- * to properly range between the values returned by the "find first bit"
- * instruction. This makes it possible for _Priority_Get_highest() to
- * calculate the major and directly index into the minor table.
- * This mapping is necessary to ensure that 0 (a high priority major/minor)
- * is the first bit found.
- *
- * This entire "find first bit" and mapping process depends heavily
- * on the manner in which a priority is broken into a major and minor
- * components with the major being the 4 MSB of a priority and minor
- * the 4 LSB. Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
- * priority. And (15 << 4) + 14 corresponds to priority 254 -- the next
- * to the lowest priority.
- *
- * If your CPU does not have a "find first bit" instruction, then
- * there are ways to make do without it. Here are a handful of ways
- * to implement this in software:
- *
- * - a series of 16 bit test instructions
- * - a "binary search using if's"
- * - _number = 0
- * if _value > 0x00ff
- * _value >>=8
- * _number = 8;
- *
- * if _value > 0x0000f
- * _value >=8
- * _number += 4
- *
- * _number += bit_set_table[ _value ]
- *
- * where bit_set_table[ 16 ] has values which indicate the first
- * bit set
- */
-
-#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
- { \
- asm volatile ("cntlzw %0, %1" : "=r" ((_output)), "=r" ((_value)) : \
- "1" ((_value))); \
- }
-
-/* end of Bitfield handler macros */
-
-/*
- * This routine builds the mask which corresponds to the bit fields
- * as searched by _CPU_Bitfield_Find_first_bit(). See the discussion
- * for that routine.
- */
-
-#define _CPU_Priority_Mask( _bit_number ) \
- ( 0x80000000 >> (_bit_number) )
-
-/*
- * This routine translates the bit numbers returned by
- * _CPU_Bitfield_Find_first_bit() into something suitable for use as
- * a major or minor component of a priority. See the discussion
- * for that routine.
- */
-
-#define _CPU_Priority_bits_index( _priority ) \
- (_priority)
-
-/* end of Priority handler macros */
-
-/* variables */
-
-extern const unsigned32 _CPU_msrs[4];
-
-/* functions */
-
-/*
- * _CPU_Initialize
- *
- * This routine performs CPU dependent initialization.
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch)
-);
-
-/*
- * _CPU_ISR_install_vector
- *
- * This routine installs an interrupt vector.
- */
-
-void _CPU_ISR_install_vector(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_Install_interrupt_stack
- *
- * This routine installs the hardware interrupt stack pointer.
- *
- * NOTE: It need only be provided if CPU_HAS_HARDWARE_INTERRUPT_STACK
- * is TRUE.
- */
-
-void _CPU_Install_interrupt_stack( void );
-
-/*
- * _CPU_Context_switch
- *
- * This routine switches from the run context to the heir context.
- */
-
-void _CPU_Context_switch(
- Context_Control *run,
- Context_Control *heir
-);
-
-/*
- * _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.
- */
-
-void _CPU_Context_restore(
- Context_Control *new_context
-);
-
-/*
- * _CPU_Context_save_fp
- *
- * This routine saves the floating point context passed to it.
- */
-
-void _CPU_Context_save_fp(
- void **fp_context_ptr
-);
-
-/*
- * _CPU_Context_restore_fp
- *
- * This routine restores the floating point context passed to it.
- */
-
-void _CPU_Context_restore_fp(
- void **fp_context_ptr
-);
-
-void _CPU_Fatal_error(
- unsigned32 _error
-);
-
-/* The following routine swaps the endian format of an unsigned int.
- * It must be static because it is referenced indirectly.
- *
- * This version will work on any processor, but if there is a better
- * way for your CPU PLEASE use it. The most common way to do this is to:
- *
- * swap least significant two bytes with 16-bit rotate
- * swap upper and lower 16-bits
- * swap most significant two bytes with 16-bit rotate
- *
- * Some CPUs have special instructions which swap a 32-bit quantity in
- * a single instruction (e.g. i486). It is probably best to avoid
- * an "endian swapping control bit" in the CPU. One good reason is
- * that interrupts would probably have to be disabled to insure that
- * an interrupt does not try to access the same "chunk" with the wrong
- * endian. Another good reason is that on some CPUs, the endian bit
- * endianness for ALL fetches -- both code and data -- so the code
- * will be fetched incorrectly.
- */
-
-static inline unsigned int CPU_swap_u32(
- unsigned int value
-)
-{
- unsigned32 swapped;
-
- asm volatile("rlwimi %0,%1,8,24,31;"
- "rlwimi %0,%1,24,16,23;"
- "rlwimi %0,%1,8,8,15;"
- "rlwimi %0,%1,24,0,7;" :
- "=&r" ((swapped)) : "r" ((value)));
-
- return( swapped );
-}
-
-#define CPU_swap_u16( value ) \
- (((value&0xff) << 8) | ((value >> 8)&0xff))
-
-/*
- * Routines to access the decrementer register
- */
-
-#define PPC_Set_decrementer( _clicks ) \
- do { \
- asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
- } while (0)
-
-/*
- * Routines to access the time base register
- */
-
-static inline unsigned64 PPC_Get_timebase_register( void )
-{
- unsigned32 tbr_low;
- unsigned32 tbr_high;
- unsigned32 tbr_high_old;
- unsigned64 tbr;
-
- do {
- asm volatile( "mftbu %0" : "=r" (tbr_high_old));
- asm volatile( "mftb %0" : "=r" (tbr_low));
- asm volatile( "mftbu %0" : "=r" (tbr_high));
- } while ( tbr_high_old != tbr_high );
-
- tbr = tbr_high;
- tbr <<= 32;
- tbr |= tbr_low;
- return tbr;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/exec/score/cpu/powerpc/cpu_asm.s b/c/src/exec/score/cpu/powerpc/cpu_asm.s
deleted file mode 100644
index 7370764607..0000000000
--- a/c/src/exec/score/cpu/powerpc/cpu_asm.s
+++ /dev/null
@@ -1,809 +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 <andy@i-cubed.co.uk>
- *
- * 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).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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 <asm.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
-
- 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/exec/score/cpu/powerpc/irq_stub.s b/c/src/exec/score/cpu/powerpc/irq_stub.s
deleted file mode 100644
index 76c8927305..0000000000
--- a/c/src/exec/score/cpu/powerpc/irq_stub.s
+++ /dev/null
@@ -1,268 +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 <andy@i-cubed.co.uk>
- *
- * 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$
- */
-
-/* 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
- dcbt r0, r11
- 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/exec/score/cpu/powerpc/ppc.h b/c/src/exec/score/cpu/powerpc/ppc.h
deleted file mode 100644
index a4b091c430..0000000000
--- a/c/src/exec/score/cpu/powerpc/ppc.h
+++ /dev/null
@@ -1,494 +0,0 @@
-/* ppc.h
- *
- * This file contains definitions for the IBM/Motorola PowerPC
- * family members.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/no_cpu.h:
- *
- * 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.
- *
- *
- * Note:
- * This file is included by both C and assembler code ( -DASM )
- *
- * $Id$
- */
-
-
-#ifndef _INCLUDE_PPC_h
-#define _INCLUDE_PPC_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Define the name of the CPU family.
- */
-
-#define CPU_NAME "PowerPC"
-
-/*
- * This file contains the information required to build
- * RTEMS for a particular member of the PowerPC family. It does
- * this by setting variables to indicate which implementation
- * dependent features are present in a particular member
- * of the family.
- *
- * The following architectural feature definitions are defaulted
- * unless specifically set by the model definition:
- *
- * + PPC_DEBUG_MODEL - PPC_DEBUG_MODEL_STANDARD
- * + PPC_INTERRUPT_MAX - 16
- * + PPC_CACHE_ALIGNMENT - 32
- * + PPC_LOW_POWER_MODE - PPC_LOW_POWER_MODE_NONE
- * + PPC_HAS_EXCEPTION_PREFIX - 1
- * + PPC_HAS_FPU - 1
- * + PPC_HAS_DOUBLE - 1 if PPC_HAS_FPU,
- * - 0 otherwise
- * + PPC_USE_MULTIPLE - 0
- */
-
-/*
- * Define the debugging assistance models found in the PPC family.
- *
- * Standard: single step and branch trace
- * Single Step Only: single step only
- * IBM 4xx: debug exception
- */
-
-#define PPC_DEBUG_MODEL_STANDARD 1
-#define PPC_DEBUG_MODEL_SINGLE_STEP_ONLY 2
-#define PPC_DEBUG_MODEL_IBM4xx 3
-
-/*
- * Define the low power mode models
- *
- * Standard: as defined for 603e
- * Nap Mode: nap mode only (604)
- * XXX 403GB, 603, 603e, 604, 821
- */
-
-#define PPC_LOW_POWER_MODE_NONE 0
-#define PPC_LOW_POWER_MODE_STANDARD 1
-
-#if defined(ppc403)
-/*
- * IBM 403
- *
- * Developed for 403GA. Book checked for 403GB.
- *
- * Does not have user mode.
- */
-
-#define CPU_MODEL_NAME "PowerPC 403"
-#define PPC_ALIGNMENT 4
-#define PPC_CACHE_ALIGNMENT 16
-#define PPC_HAS_RFCI 1
-#define PPC_HAS_FPU 0
-#define PPC_USE_MULTIPLE 1
-#define PPC_I_CACHE 2048
-#define PPC_D_CACHE 1024
-
-#define PPC_DEBUG_MODEL PPC_DEBUG_MODEL_IBM4xx
-#define PPC_HAS_EXCEPTION_PREFIX 0
-#define PPC_HAS_EVPR 1
-
-#elif defined(ppc601)
-/*
- * Submitted with original port -- book checked only.
- */
-
-#define CPU_MODEL_NAME "PowerPC 601"
-
-#define PPC_ALIGNMENT 8
-#define PPC_USE_MULTIPLE 1
-#define PPC_I_CACHE 0
-#define PPC_D_CACHE 32768
-
-#define PPC_DEBUG_MODEL PPC_DEBUG_MODEL_SINGLE_STEP_ONLY
-
-#elif defined(ppc602)
-/*
- * Submitted with original port -- book checked only.
- */
-
-#define CPU_MODEL_NAME "PowerPC 602"
-
-#define PPC_ALIGNMENT 4
-#define PPC_HAS_DOUBLE 0
-#define PPC_I_CACHE 4096
-#define PPC_D_CACHE 4096
-
-#elif defined(ppc603)
-/*
- * Submitted with original port -- book checked only.
- */
-
-#define CPU_MODEL_NAME "PowerPC 603"
-
-#define PPC_ALIGNMENT 8
-#define PPC_I_CACHE 8192
-#define PPC_D_CACHE 8192
-
-#elif defined(ppc603e)
-
-#define CPU_MODEL_NAME "PowerPC 603e"
-/*
- * Submitted with original port.
- *
- * Known to work on real hardware.
- */
-
-#define PPC_ALIGNMENT 8
-#define PPC_I_CACHE 16384
-#define PPC_D_CACHE 16384
-
-#define PPC_LOW_POWER_MODE PPC_LOW_POWER_MODE_STANDARD
-
-#elif defined(ppc604)
-/*
- * Submitted with original port -- book checked only.
- */
-
-#define CPU_MODEL_NAME "PowerPC 604"
-
-#define PPC_ALIGNMENT 8
-#define PPC_I_CACHE 16384
-#define PPC_D_CACHE 16384
-
-#else
-
-#error "Unsupported CPU Model"
-
-#endif
-
-/*
- * Application binary interfaces.
- *
- * PPC_ABI MUST be defined as one of these.
- * Only PPC_ABI_POWEROPEN is currently fully supported.
- * Only EABI will be supported in the end when
- * the tools are there.
- * Only big endian is currently supported.
- */
-/*
- * PowerOpen ABI. This is Andy's hack of the
- * PowerOpen ABI to ELF. ELF rather than a
- * XCOFF assembler is used. This may work
- * if PPC_ASM == PPC_ASM_XCOFF is defined.
- */
-#define PPC_ABI_POWEROPEN 0
-/*
- * GCC 2.7.0 munched version of EABI, with
- * PowerOpen calling convention and stack frames,
- * but EABI style indirect function calls.
- */
-#define PPC_ABI_GCC27 1
-/*
- * SVR4 ABI
- */
-#define PPC_ABI_SVR4 2
-/*
- * Embedded ABI
- */
-#define PPC_ABI_EABI 3
-
-#if (PPC_ABI == PPC_ABI_POWEROPEN)
-#define PPC_STACK_ALIGNMENT 8
-#elif (PPC_ABI == PPC_ABI_GCC27)
-#define PPC_STACK_ALIGNMENT 8
-#elif (PPC_ABI == PPC_ABI_SVR4)
-#define PPC_STACK_ALIGNMENT 16
-#elif (PPC_ABI == PPC_ABI_EABI)
-#define PPC_STACK_ALIGNMENT 8
-#else
-#error "PPC_ABI is not properly defined"
-#endif
-#ifndef PPC_ABI
-#error "PPC_ABI is not properly defined"
-#endif
-
-/*
- * Assemblers.
- * PPC_ASM MUST be defined as one of these.
- *
- * PPC_ASM_ELF: ELF assembler. Currently used for all ABIs.
- * PPC_ASM_XCOFF: XCOFF assembler. May be needed for PowerOpen ABI.
- *
- * NOTE: Only PPC_ABI_ELF is currently fully supported.
- */
-
-#define PPC_ASM_ELF 0
-#define PPC_ASM_XCOFF 1
-
-/*
- * Use the default debug scheme defined in the architectural specification
- * if another model has not been specified.
- */
-
-#ifndef PPC_DEBUG_MODEL
-#define PPC_DEBUG_MODEL PPC_DEBUG_MODEL_STANDARD
-#endif
-
-/*
- * If the maximum number of exception sources has not been defined,
- * then default it to 16.
- */
-
-#ifndef PPC_INTERRUPT_MAX
-#define PPC_INTERRUPT_MAX 16
-#endif
-
-/*
- * Unless specified otherwise, the cache line size is defaulted to 32.
- *
- * The derive the power of 2 the cache line is.
- */
-
-#ifndef PPC_CACHE_ALIGNMENT
-#define PPC_CACHE_ALIGNMENT 32
-#endif
-
-#if (PPC_CACHE_ALIGNMENT == 16)
-#define PPC_CACHE_ALIGN_POWER 4
-#elif (PPC_CACHE_ALIGNMENT == 32)
-#define PPC_CACHE_ALIGN_POWER 5
-#else
-#error "Undefined power of 2 for PPC_CACHE_ALIGNMENT"
-#endif
-
-/*
- * Unless otherwise specified, assume the model has an IP/EP bit to
- * set the exception address prefix.
- */
-
-#ifndef PPC_HAS_EXCEPTION_PREFIX
-#define PPC_HAS_EXCEPTION_PREFIX 1
-#endif
-
-/*
- * Unless otherwise specified, assume the model does NOT have
- * 403 style EVPR register to set the exception address prefix.
- */
-
-#ifndef PPC_HAS_EVPR
-#define PPC_HAS_EVPR 0
-#endif
-
-/*
- * If no low power mode model was specified, then assume there is none.
- */
-
-#ifndef PPC_LOW_POWER_MODE
-#define PPC_LOW_POWER_MODE PPC_LOW_POWER_MODE_NONE
-#endif
-
-/*
- * Unless specified above, then assume the model has FP support.
- */
-
-#ifndef PPC_HAS_FPU
-#define PPC_HAS_FPU 1
-#endif
-
-/*
- * Unless specified above, If the model has FP support, it is assumed to
- * support doubles (8-byte floating point numbers).
- *
- * If the model does NOT have FP support, then the model does
- * NOT have double length FP registers.
- */
-
-#ifndef PPC_HAS_DOUBLE
-#if (PPC_HAS_FPU)
-#define PPC_HAS_DOUBLE 1
-#else
-#define PPC_HAS_DOUBLE 0
-#endif
-#endif
-
-/*
- * Unless specified above, then assume the model does NOT have critical
- * interrupt support.
- */
-
-#ifndef PPC_HAS_RFCI
-#define PPC_HAS_RFCI 0
-#endif
-
-/*
- * Unless specified above, do not use the load/store multiple instructions
- * in a context switch.
- */
-
-#ifndef PPC_USE_MULTIPLE
-#define PPC_USE_MULTIPLE 0
-#endif
-
-/*
- * The following exceptions are not maskable, and are not
- * necessarily predictable, so cannot be offered to RTEMS:
- * Alignment exception - handled by the CPU module
- * Data exceptions.
- * Instruction exceptions.
- */
-
-/*
- * Base Interrupt vectors supported on all models.
- */
-#define PPC_IRQ_SYSTEM_RESET 0 /* 0x00100 - System reset. */
-#define PPC_IRQ_MCHECK 1 /* 0x00200 - Machine check */
-#define PPC_IRQ_PROTECT 2 /* 0x00300 - Protection violation */
-#define PPC_IRQ_ISI 3 /* 0x00400 - Instruction Fetch error */
-#define PPC_IRQ_EXTERNAL 4 /* 0x00500 - External interrupt */
-#define PPC_IRQ_ALIGNMENT 5 /* 0X00600 - Alignment exception */
-#define PPC_IRQ_PROGRAM 6 /* 0x00700 - Program exception */
-#define PPC_IRQ_NOFP 7 /* 0x00800 - Floating point unavailable */
-#define PPC_IRQ_DECREMENTER 8 /* 0x00900 - Decrementer interrupt */
-#define PPC_IRQ_RESERVED_A 9 /* 0x00a00 - Implementation Reserved */
-#define PPC_IRQ_RESERVED_B 10 /* 0x00a00 - Implementation Reserved */
-#define PPC_IRQ_SCALL 11 /* 0x00c00 - System call */
-#define PPC_IRQ_TRACE 12 /* 0x00d00 - Trace Exception */
-#define PPC_IRQ_FP_ASST 13 /* ox00e00 - Floating point assist */
-#define PPC_STD_IRQ_LAST PPC_IRQ_FP_ASST
-
-#define PPC_IRQ_FIRST PPC_IRQ_SYSTEM_RESET
-
-#if defined(ppc403)
-
-#define PPC_IRQ_CRIT PPC_IRQ_SYSTEM_RESET /*0x00100- Critical int. pin */
-#define PPC_IRQ_PIT (PPC_STD_IRQ_LAST+1) /*0x01000- Pgm interval timer*/
-#define PPC_IRQ_FIT (PPC_STD_IRQ_LAST+2) /*0x01010- Fixed int. timer */
-#define PPC_IRQ_WATCHDOG (PPC_STD_IRQ_LAST+3) /*0x01020- Watchdog timer */
-#define PPC_IRQ_DEBUG (PPC_STD_IRQ_LAST+4) /*0x02000- Debug exceptions */
-#define PPC_IRQ_LAST PPC_IRQ_DEBUG
-
-#elif defined(ppc601)
-#define PPC_IRQ_TRACE (PPC_STD_IRQ_LAST+1) /*0x02000-Run/Trace Exception*/
-#define PPC_IRQ_LAST PPC_IRQ_TRACE
-
-#elif defined(ppc602)
-#define PPC_IRQ_LAST (PPC_STD_IRQ_LAST)
-
-#elif defined(ppc603)
-#define PPC_IRQ_TRANS_MISS (PPC_STD_IRQ_LAST+1) /*0x1000-Ins Translation Miss*/
-#define PPC_IRQ_DATA_LOAD (PPC_STD_IRQ_LAST+2) /*0x1100-Data Load Trans Miss*/
-#define PPC_IRQ_DATA_STORE (PPC_STD_IRQ_LAST+3) /*0x1200-Data Store Miss */
-#define PPC_IRQ_ADDR_BRK (PPC_STD_IRQ_LAST+4) /*0x1300-Instruction Bkpoint */
-#define PPC_IRQ_SYS_MGT (PPC_STD_IRQ_LAST+5) /*0x1400-System Management */
-#define PPC_IRQ_LAST PPC_IRQ_SYS_MGT
-
-#elif defined(ppc603e)
-#define PPC_TLB_INST_MISS (PPC_STD_IRQ_LAST+1) /*0x1000-Instruction TLB Miss*/
-#define PPC_TLB_LOAD_MISS (PPC_STD_IRQ_LAST+2) /*0x1100-TLB miss on load */
-#define PPC_TLB_STORE_MISS (PPC_STD_IRQ_LAST+3) /*0x1200-TLB Miss on store */
-#define PPC_IRQ_ADDRBRK (PPC_STD_IRQ_LAST+4) /*0x1300-Instruct addr break */
-#define PPC_IRQ_SYS_MGT (PPC_STD_IRQ_LAST+5) /*0x1400-System Management */
-#define PPC_IRQ_LAST PPC_IRQ_SYS_MGT
-
-
-#elif defined(ppc604)
-#define PPC_IRQ_ADDR_BRK (PPC_STD_IRQ_LAST+1) /*0x1300- Inst. addr break */
-#define PPC_IRQ_SYS_MGT (PPC_STD_IRQ_LAST+2) /*0x1400- System Management */
-#define PPC_IRQ_LAST PPC604_IRQ_SYS_MGT
-
-#endif
-
-/*
- * Machine Status Register (MSR) Constants Used by RTEMS
- */
-
-/*
- * Some PPC model manuals refer to the Exception Prefix (EP) bit as
- * IP for no apparent reason.
- */
-
-#define PPC_MSR_RI 0x000000002 /* bit 30 - recoverable exception */
-#define PPC_MSR_DR 0x000000010 /* bit 27 - data address translation */
-#define PPC_MSR_IR 0x000000020 /* bit 26 - instruction addr translation*/
-
-#if (PPC_HAS_EXCEPTION_PREFIX)
-#define PPC_MSR_EP 0x000000040 /* bit 25 - exception prefix */
-#else
-#define PPC_MSR_EP 0x000000000 /* bit 25 - exception prefix */
-#endif
-
-#if (PPC_HAS_FPU)
-#define PPC_MSR_FP 0x000002000 /* bit 18 - floating point enable */
-#else
-#define PPC_MSR_FP 0x000000000 /* bit 18 - floating point enable */
-#endif
-
-#if (PPC_LOW_POWER_MODE == PPC_LOW_POWER_MODE_NONE)
-#define PPC_MSR_POW 0x000000000 /* bit 13 - power management enable */
-#else
-#define PPC_MSR_POW 0x000040000 /* bit 13 - power management enable */
-#endif
-
-/*
- * Interrupt/exception MSR bits set as defined on p. 2-20 in "The Programming
- * Environments" and the manuals for various PPC models.
- */
-
-#if (PPC_DEBUG_MODEL == PPC_DEBUG_MODEL_STANDARD)
-#define PPC_MSR_DE 0x000000000 /* bit 22 - debug exception enable */
-#define PPC_MSR_BE 0x000000200 /* bit 22 - branch trace enable */
-#define PPC_MSR_SE 0x000000400 /* bit 21 - single step trace enable */
-#elif (PPC_DEBUG_MODEL == PPC_DEBUG_MODEL_SINGLE_STEP_ONLY)
-#define PPC_MSR_DE 0x000000000 /* bit 22 - debug exception enable */
-#define PPC_MSR_BE 0x000000200 /* bit 22 - branch trace enable */
-#define PPC_MSR_SE 0x000000000 /* bit 21 - single step trace enable */
-#elif (PPC_DEBUG_MODEL == PPC_DEBUG_MODEL_IBM4xx)
-#define PPC_MSR_DE 0x000000200 /* bit 22 - debug exception enable */
-#define PPC_MSR_BE 0x000000000 /* bit 22 - branch trace enable */
-#define PPC_MSR_SE 0x000000000 /* bit 21 - single step trace enable */
-#else
-#error "MSR constants -- unknown PPC_DEBUG_MODEL!!"
-#endif
-
-#define PPC_MSR_ME 0x000001000 /* bit 19 - machine check enable */
-#define PPC_MSR_EE 0x000008000 /* bit 16 - external interrupt enable */
-
-#if (PPC_HAS_RFCI)
-#define PPC_MSR_CE 0x000020000 /* bit 14 - critical interrupt enable */
-#else
-#define PPC_MSR_CE 0x000000000 /* bit 14 - critical interrupt enable */
-#endif
-
-#define PPC_MSR_DISABLE_MASK (PPC_MSR_ME|PPC_MSR_EE|PPC_MSR_CE)
-
-/*
- * Initial value for the FPSCR register
- */
-
-#define PPC_INIT_FPSCR 0x000000f8
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! _INCLUDE_PPC_h */
-/* end of include file */
-
-
diff --git a/c/src/exec/score/cpu/powerpc/ppctypes.h b/c/src/exec/score/cpu/powerpc/ppctypes.h
deleted file mode 100644
index 71f1b814b2..0000000000
--- a/c/src/exec/score/cpu/powerpc/ppctypes.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* ppctypes.h
- *
- * This include file contains type definitions pertaining to the PowerPC
- * processor family.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/no_cputypes.h:
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-#ifndef __PPC_TYPES_h
-#define __PPC_TYPES_h
-
-#ifndef ASM
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* unsigned 8-bit integer */
-typedef unsigned short unsigned16; /* unsigned 16-bit integer */
-typedef unsigned int unsigned32; /* unsigned 32-bit integer */
-typedef unsigned long long unsigned64; /* unsigned 64-bit integer */
-
-typedef unsigned32 Priority_Bit_map_control;
-
-typedef signed char signed8; /* 8-bit signed integer */
-typedef signed short signed16; /* 16-bit signed integer */
-typedef signed int signed32; /* 32-bit signed integer */
-typedef signed long long signed64; /* 64 bit signed integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-typedef void ppc_isr;
-typedef void ( *ppc_isr_entry )( int, struct CPU_Interrupt_frame * );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !ASM */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/cpu/powerpc/rtems.s b/c/src/exec/score/cpu/powerpc/rtems.s
deleted file mode 100644
index b653152411..0000000000
--- a/c/src/exec/score/cpu/powerpc/rtems.s
+++ /dev/null
@@ -1,132 +0,0 @@
-/* rtems.s
- *
- * This file contains the single entry point code for
- * the PowerPC implementation of RTEMS.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/rtems.c:
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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 <asm.h>
-
- BEGIN_CODE
-/*
- * RTEMS
- *
- * This routine jumps to the directive indicated in r11.
- * This routine is used when RTEMS is linked by itself and placed
- * in ROM. This routine is the first address in the ROM space for
- * RTEMS. The user "calls" this address with the directive arguments
- * in the normal place.
- * This routine then jumps indirectly to the correct directive
- * preserving the arguments. The directive should not realize
- * it has been "wrapped" in this way. The table "_Entry_points"
- * is used to look up the directive.
- */
-
- ALIGN (4, 2)
- PUBLIC_PROC (RTEMS)
-PROC (RTEMS):
-#if (PPC_ABI == PPC_ABI_POWEROPEN)
- mflr r0
- stw r0, 8(r1)
- stwu r1, -64(r1)
-
- /* Establish addressing */
- bl base
-base:
- mflr r12
- addi r12, r12, tabaddr - base
-
- lwz r12, Entry_points-abase(r12)
- slwi r11, r11, 2
- lwzx r12, r12, r11
-
- stw r2, 56(r1)
- lwz r0, 0(r12)
- mtlr r0
- lwz r2, 4(r12)
- lwz r11, 8(r12)
- blrl
- lwz r2, 56(r1)
- addi r1, r1, 64
- lwz r0, 8(r1)
- mtlr r0
-#else
- mflr r0
- stw r0, 4(r1)
- stwu r1, -16(r1)
-
- /* Establish addressing */
- bl base
-base:
- mflr r12
- addi r12, r12, tabaddr - base
-
- lwz r12, Entry_points-abase(r12)
- slwi r11, r11, 2
- lwzx r11, r12, r11
-
- stw r2, 8(r1)
-#if (PPC_ABI != PPC_ABI_GCC27)
- stw r13, 12(r1)
-#endif
- mtlr r11
- lwz r11, irqinfo-abase(r12)
- lwz r2, 0(r11)
-#if (PPC_ABI != PPC_ABI_GCC27)
- lwz r13, 4(r11)
-#endif
- blrl
- lwz r2, 8(r1)
-#if (PPC_ABI != PPC_ABI_GCC27)
- lwz r13, 12(r1)
-#endif
- addi r1, r1, 16
- lwz r0, 4(r1)
- mtlr r0
-#endif
- blr
-
-
- /* Addressability stuff */
-tabaddr:
-abase:
- EXTERN_VAR (_Entry_points)
-Entry_points:
- EXT_SYM_REF (_Entry_points)
-#if (PPC_ABI != PPC_ABI_POWEROPEN)
- EXTERN_VAR (_CPU_IRQ_info)
-irqinfo:
- EXT_SYM_REF (_CPU_IRQ_info)
-#endif
-
-#if (PPC_ABI == PPC_ABI_POWEROPEN)
- DESCRIPTOR (RTEMS)
-#endif
-
-
diff --git a/c/src/exec/score/cpu/sh/Makefile.in b/c/src/exec/score/cpu/sh/Makefile.in
deleted file mode 100644
index 54e1ed15ec..0000000000
--- a/c/src/exec/score/cpu/sh/Makefile.in
+++ /dev/null
@@ -1,87 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-RELS=$(ARCH)/rtems-cpu.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=cpu cpu_asm cpu_isps rtems
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES= \
- $(srcdir)/cpu.h \
- $(srcdir)/shtypes.h \
- $(srcdir)/sh.h \
- $(srcdir)/sh_io.h \
- $(srcdir)/cpu_isps.h \
- $(srcdir)/iosh7030.h
-
-# H_FILES that get installed externally
-EXTERNAL_H_FILES = \
- $(srcdir)/asm.h
-
-# Assembly source names, if any, go here -- minus the .s
-# Normally cpu_asm and rtems are assembly files
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) $(EXTERNAL_H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) preinstall $(OBJS) $(RELS)
-
-$(ARCH)/rtems-cpu.rel: $(OBJS)
- $(make-rel)
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-install: all
-
-preinstall: $(ARCH) $(PROJECT_INCLUDE)/rtems/score/targopts.h \
- ${PROJECT_RELEASE}/lib/bsp_specs
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
-# we will share the basic cpu file
- $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
-
-$(PROJECT_INCLUDE)/rtems/score/targopts.h: $(ARCH)/targopts.h-tmp
- $(INSTALL) -m 444 $(ARCH)/targopts.h-tmp $@
-
-# $(ARCH)/targopts.h-tmp rule is in leaf.cfg
-
-${PROJECT_RELEASE}/lib/bsp_specs: $(ARCH)/bsp_specs.tmp
- $(INSTALL) -m 444 $(ARCH)/bsp_specs.tmp $@
-
-# $(ARCH)/bsp_specs.tmp rule is in leaf.cfg
diff --git a/c/src/exec/score/cpu/sh/asm.h b/c/src/exec/score/cpu/sh/asm.h
deleted file mode 100644
index f6fff9f40e..0000000000
--- a/c/src/exec/score/cpu/sh/asm.h
+++ /dev/null
@@ -1,137 +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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <rtems/score/targopts.h>
-#include <rtems/score/sh.h>
-
-/*
- * 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/c/src/exec/score/cpu/sh/cpu.c b/c/src/exec/score/cpu/sh/cpu.c
deleted file mode 100644
index cc07552cf0..0000000000
--- a/c/src/exec/score/cpu/sh/cpu.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * This file contains information pertaining to the Hitachi SH
- * processor.
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/sh_io.h>
-#include <rtems/score/cpu.h>
-#include <rtems/score/sh.h>
-
-
-/* referenced in start.s */
-extern proc_ptr vectab[] ;
-
-proc_ptr vectab[256] ;
-
-extern proc_ptr _Hardware_isr_Table[];
-
-/* _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 */
-)
-{
- register unsigned32 level = 0;
-
- /*
- * The thread_dispatch argument is the address of the entry point
- * for the routine called at the end of an ISR once it has been
- * decided a context switch is necessary. On some compilation
- * systems it is difficult to call a high-level language routine
- * from assembly. This allows us to trick these systems.
- *
- * If you encounter this problem save the entry point in a CPU
- * dependent variable.
- */
-
- _CPU_Thread_dispatch_pointer = thread_dispatch;
-
- /*
- * If there is not an easy way to initialize the FP context
- * during Context_Initialize, then it is usually easier to
- * save an "uninitialized" FP context here and copy it to
- * the task's during Context_Initialize.
- */
-
- /* FP context initialization support goes here */
-
- _CPU_Table = *cpu_table;
-
- /* enable interrupts */
- _CPU_ISR_Set_level( level);
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- /*
- * This routine returns the current interrupt level.
- */
-
- register unsigned32 _mask ;
-
- sh_get_interrupt_level( _mask );
-
- return ( _mask);
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- /*
- * This is where we install the interrupt handler into the "raw" interrupt
- * table used by the CPU to dispatch interrupt handlers.
- */
- volatile proc_ptr *vbr ;
-
-#if SH_PARANOID_ISR
- unsigned32 level ;
-
- sh_disable_interrupts( level );
-#endif
-
- /* get vbr */
- asm ( "stc vbr,%0" : "=r" (vbr) );
-
- *old_handler = vbr[vector] ;
- vbr[vector] = new_handler ;
-
-#if SH_PARANOID_ISR
- sh_enable_interrupts( level );
-#endif
-}
-
-
-/*PAGE
- *
- * _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 ;
-
- if(( vector <= 113) && ( vector >= 11))
- {
- *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.
- */
- _CPU_ISR_install_raw_handler(vector,
- _Hardware_isr_Table[vector],
- &ignored );
-
- /*
- * We put the actual user ISR address in '_ISR_Vector_table'.
- * This will be used by __ISR_Handler so the user gets control.
- */
-
- _ISR_Vector_table[ vector ] = new_handler;
- }
-}
-
-/*PAGE
- *
- * _CPU_Thread_Idle_body
- *
- * NOTES:
- *
- * 1. This is the same as the regular CPU independent algorithm.
- *
- * 2. If you implement this using a "halt", "idle", or "shutdown"
- * instruction, then don't forget to put it in an infinite loop.
- *
- * 3. Be warned. Some processors with onboard DMA have been known
- * to stop the DMA if the CPU were put in IDLE mode. This might
- * also be a problem with other on-chip peripherals. So use this
- * hook with caution.
- */
-
-#if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
-void _CPU_Thread_Idle_body( void )
-{
-
- for( ; ; )
- {
- asm volatile("nop");
- }
- /* insert your "halt" instruction here */ ;
-}
-#endif
-
-#if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
-
-unsigned8 _bit_set_table[16] =
- { 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 1,0};
-
-
-#endif
-
-void _CPU_Context_Initialize(
- Context_Control *_the_context,
- void *_stack_base,
- unsigned32 _size,
- unsigned32 _isr,
- void (*_entry_point)(void),
- int _is_fp )
-{
- _the_context->r15 = (unsigned32*) ((unsigned32) (_stack_base) + (_size) );
- _the_context->sr = (_isr << 4) & 0x00f0 ;
- _the_context->pr = (unsigned32*) _entry_point ;
-}
diff --git a/c/src/exec/score/cpu/sh/cpu.h b/c/src/exec/score/cpu/sh/cpu.h
deleted file mode 100644
index 0a67679b5e..0000000000
--- a/c/src/exec/score/cpu/sh/cpu.h
+++ /dev/null
@@ -1,875 +0,0 @@
-/*
- * This include file contains information pertaining to the Hitachi SH
- * processor.
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _SH_CPU_h
-#define _SH_CPU_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/sh.h> /* pick up machine definitions */
-#ifndef ASM
-#include <rtems/score/shtypes.h>
-#endif
-
-/* conditional compilation parameters */
-
-/*
- * Should the calls to _Thread_Enable_dispatch be inlined?
- *
- * If TRUE, then they are inlined.
- * If FALSE, then a subroutine call is made.
- *
- * Basically this is an example of the classic trade-off of size
- * versus speed. Inlining the call (TRUE) typically increases the
- * size of RTEMS while speeding up the enabling of dispatching.
- * [NOTE: In general, the _Thread_Dispatch_disable_level will
- * only be 0 or 1 unless you are in an interrupt handler and that
- * interrupt handler invokes the executive.] When not inlined
- * something calls _Thread_Enable_dispatch which in turns calls
- * _Thread_Dispatch. If the enable dispatch is inlined, then
- * one subroutine call is avoided entirely.]
- */
-
-#define CPU_INLINE_ENABLE_DISPATCH FALSE
-
-/*
- * Should the body of the search loops in _Thread_queue_Enqueue_priority
- * be unrolled one time? In unrolled each iteration of the loop examines
- * two "nodes" on the chain being searched. Otherwise, only one node
- * is examined per iteration.
- *
- * If TRUE, then the loops are unrolled.
- * If FALSE, then the loops are not unrolled.
- *
- * The primary factor in making this decision is the cost of disabling
- * and enabling interrupts (_ISR_Flash) versus the cost of rest of the
- * body of the loop. On some CPUs, the flash is more expensive than
- * one iteration of the loop body. In this case, it might be desirable
- * to unroll the loop. It is important to note that on some CPUs, this
- * code is the longest interrupt disable period in RTEMS. So it is
- * necessary to strike a balance when setting this parameter.
- */
-
-#define CPU_UNROLL_ENQUEUE_PRIORITY TRUE
-
-/*
- * Does RTEMS manage a dedicated interrupt stack in software?
- *
- * If TRUE, then a stack is allocated in _Interrupt_Manager_initialization.
- * If FALSE, nothing is done.
- *
- * If the CPU supports a dedicated interrupt stack in hardware,
- * then it is generally the responsibility of the BSP to allocate it
- * and set it up.
- *
- * If the CPU does not support a dedicated interrupt stack, then
- * the porter has two options: (1) execute interrupts on the
- * stack of the interrupted task, and (2) have RTEMS manage a dedicated
- * interrupt stack.
- *
- * If this is TRUE, CPU_ALLOCATE_INTERRUPT_STACK should also be TRUE.
- *
- * Only one of CPU_HAS_SOFTWARE_INTERRUPT_STACK and
- * CPU_HAS_HARDWARE_INTERRUPT_STACK should be set to TRUE. It is
- * possible that both are FALSE for a particular CPU. Although it
- * is unclear what that would imply about the interrupt processing
- * procedure on that CPU.
- */
-
-#define CPU_HAS_SOFTWARE_INTERRUPT_STACK TRUE
-#define CPU_HAS_HARDWARE_INTERRUPT_STACK FALSE
-
-/*
- * We define the interrupt stack in the linker script
- */
-#define CPU_ALLOCATE_INTERRUPT_STACK FALSE
-
-/*
- * Does the RTEMS invoke the user's ISR with the vector number and
- * a pointer to the saved interrupt frame (1) or just the vector
- * number (0)?
- */
-
-#define CPU_ISR_PASSES_FRAME_POINTER 0
-
-/*
- * Does the CPU have hardware floating point?
- *
- * If TRUE, then the RTEMS_FLOATING_POINT task attribute is supported.
- * If FALSE, then the RTEMS_FLOATING_POINT task attribute is ignored.
- *
- * We currently support sh1 only, which has no FPU, other SHes have an FPU
- *
- * The macro name "NO_CPU_HAS_FPU" should be made CPU specific.
- * It indicates whether or not this CPU model has FP support. For
- * example, it would be possible to have an i386_nofp CPU model
- * which set this to false to indicate that you have an i386 without
- * an i387 and wish to leave floating point support out of RTEMS.
- */
-
-#define CPU_HARDWARE_FP FALSE
-
-/*
- * Are all tasks RTEMS_FLOATING_POINT tasks implicitly?
- *
- * If TRUE, then the RTEMS_FLOATING_POINT task attribute is assumed.
- * If FALSE, then the RTEMS_FLOATING_POINT task attribute is followed.
- *
- * So far, the only CPU in which this option has been used is the
- * HP PA-RISC. The HP C compiler and gcc both implicitly use the
- * floating point registers to perform integer multiplies. If
- * a function which you would not think utilize the FP unit DOES,
- * then one can not easily predict which tasks will use the FP hardware.
- * In this case, this option should be TRUE.
- *
- * If CPU_HARDWARE_FP is FALSE, then this should be FALSE as well.
- */
-
-#define CPU_ALL_TASKS_ARE_FP FALSE
-
-/*
- * Should the IDLE task have a floating point context?
- *
- * If TRUE, then the IDLE task is created as a RTEMS_FLOATING_POINT task
- * and it has a floating point context which is switched in and out.
- * If FALSE, then the IDLE task does not have a floating point context.
- *
- * Setting this to TRUE negatively impacts the time required to preempt
- * the IDLE task from an interrupt because the floating point context
- * must be saved as part of the preemption.
- */
-
-#define CPU_IDLE_TASK_IS_FP FALSE
-
-/*
- * Should the saving of the floating point registers be deferred
- * until a context switch is made to another different floating point
- * task?
- *
- * If TRUE, then the floating point context will not be stored until
- * necessary. It will remain in the floating point registers and not
- * disturned until another floating point task is switched to.
- *
- * If FALSE, then the floating point context is saved when a floating
- * point task is switched out and restored when the next floating point
- * task is restored. The state of the floating point registers between
- * those two operations is not specified.
- *
- * If the floating point context does NOT have to be saved as part of
- * interrupt dispatching, then it should be safe to set this to TRUE.
- *
- * Setting this flag to TRUE results in using a different algorithm
- * for deciding when to save and restore the floating point context.
- * The deferred FP switch algorithm minimizes the number of times
- * the FP context is saved and restored. The FP context is not saved
- * until a context switch is made to another, different FP task.
- * Thus in a system with only one FP task, the FP context will never
- * be saved or restored.
- */
-
-#define CPU_USE_DEFERRED_FP_SWITCH TRUE
-
-/*
- * Does this port provide a CPU dependent IDLE task implementation?
- *
- * If TRUE, then the routine _CPU_Thread_Idle_body
- * must be provided and is the default IDLE thread body instead of
- * _CPU_Thread_Idle_body.
- *
- * If FALSE, then use the generic IDLE thread body if the BSP does
- * not provide one.
- *
- * This is intended to allow for supporting processors which have
- * a low power or idle mode. When the IDLE thread is executed, then
- * the CPU can be powered down.
- *
- * The order of precedence for selecting the IDLE thread body is:
- *
- * 1. BSP provided
- * 2. CPU dependent (if provided)
- * 3. generic (if no BSP and no CPU dependent)
- */
-
-#define CPU_PROVIDES_IDLE_THREAD_BODY TRUE
-
-/*
- * Does the stack grow up (toward higher addresses) or down
- * (toward lower addresses)?
- *
- * If TRUE, then the grows upward.
- * If FALSE, then the grows toward smaller addresses.
- */
-
-#define CPU_STACK_GROWS_UP FALSE
-
-/*
- * The following is the variable attribute used to force alignment
- * of critical RTEMS structures. On some processors it may make
- * sense to have these aligned on tighter boundaries than
- * the minimum requirements of the compiler in order to have as
- * much of the critical data area as possible in a cache line.
- *
- * The placement of this macro in the declaration of the variables
- * is based on the syntactically requirements of the GNU C
- * "__attribute__" extension. For example with GNU C, use
- * the following to force a structures to a 32 byte boundary.
- *
- * __attribute__ ((aligned (32)))
- *
- * NOTE: Currently only the Priority Bit Map table uses this feature.
- * To benefit from using this, the data must be heavily
- * used so it will stay in the cache and used frequently enough
- * in the executive to justify turning this on.
- */
-
-#define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned(16)))
-
-/*
- * Define what is required to specify how the network to host conversion
- * routines are handled.
- *
- * NOTE: SHes can be big or little endian, the default is big endian
- */
-
-#define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE
-
-/* __LITTLE_ENDIAN__ is defined if -ml is given to gcc */
-#if defined(__LITTLE_ENDIAN__)
-#define CPU_BIG_ENDIAN FALSE
-#define CPU_LITTLE_ENDIAN TRUE
-#else
-#define CPU_BIG_ENDIAN TRUE
-#define CPU_LITTLE_ENDIAN FALSE
-#endif
-
-/*
- * The following defines the number of bits actually used in the
- * interrupt field of the task mode. How those bits map to the
- * CPU interrupt levels is defined by the routine _CPU_ISR_Set_level().
- */
-
-#define CPU_MODES_INTERRUPT_MASK 0x0000000f
-
-/*
- * Processor defined structures
- *
- * Examples structures include the descriptor tables from the i386
- * and the processor control structure on the i960ca.
- */
-
-/* may need to put some structures here. */
-
-/*
- * Contexts
- *
- * Generally there are 2 types of context to save.
- * 1. Interrupt registers to save
- * 2. Task level registers to save
- *
- * This means we have the following 3 context items:
- * 1. task level context stuff:: Context_Control
- * 2. floating point task stuff:: Context_Control_fp
- * 3. special interrupt level context :: Context_Control_interrupt
- *
- * On some processors, it is cost-effective to save only the callee
- * preserved registers during a task context switch. This means
- * that the ISR code needs to save those registers which do not
- * persist across function calls. It is not mandatory to make this
- * distinctions between the caller/callee saves registers for the
- * purpose of minimizing context saved during task switch and on interrupts.
- * If the cost of saving extra registers is minimal, simplicity is the
- * choice. Save the same context on interrupt entry as for tasks in
- * this case.
- *
- * Additionally, if gdb is to be made aware of RTEMS tasks for this CPU, then
- * care should be used in designing the context area.
- *
- * On some CPUs with hardware floating point support, the Context_Control_fp
- * structure will not be used or it simply consist of an array of a
- * fixed number of bytes. This is done when the floating point context
- * is dumped by a "FP save context" type instruction and the format
- * is not really defined by the CPU. In this case, there is no need
- * to figure out the exact format -- only the size. Of course, although
- * this is enough information for RTEMS, it is probably not enough for
- * a debugger such as gdb. But that is another problem.
- */
-
-typedef struct {
- unsigned32 *r15; /* stack pointer */
-
- unsigned32 macl;
- unsigned32 mach;
- unsigned32 *pr;
-
- unsigned32 *r14; /* frame pointer/call saved */
-
- unsigned32 r13; /* call saved */
- unsigned32 r12; /* call saved */
- unsigned32 r11; /* call saved */
- unsigned32 r10; /* call saved */
- unsigned32 r9; /* call saved */
- unsigned32 r8; /* call saved */
-
- unsigned32 *r7; /* arg in */
- unsigned32 *r6; /* arg in */
-
-#if 0
- unsigned32 *r5; /* arg in */
- unsigned32 *r4; /* arg in */
-#endif
-
- unsigned32 *r3; /* scratch */
- unsigned32 *r2; /* scratch */
- unsigned32 *r1; /* scratch */
-
- unsigned32 *r0; /* arg return */
-
- unsigned32 gbr;
- unsigned32 sr;
-
-} Context_Control;
-
-typedef struct {
-} Context_Control_fp;
-
-typedef struct {
-} CPU_Interrupt_frame;
-
-
-/*
- * The following table contains the information required to configure
- * the SH processor specific parameters.
- */
-
-typedef struct {
- void (*pretasking_hook)( void );
- void (*predriver_hook)( void );
- void (*postdriver_hook)( void );
- void (*idle_task)( void );
- boolean do_zero_of_workspace;
- unsigned32 idle_task_stack_size;
- unsigned32 interrupt_stack_size;
- unsigned32 extra_mpci_receive_server_stack;
- void * (*stack_allocate_hook)( unsigned32 );
- void (*stack_free_hook)( void* );
- /* end of fields required on all CPUs */
-} rtems_cpu_table;
-
-/*
- * This variable is optional. It is used on CPUs on which it is difficult
- * to generate an "uninitialized" FP context. It is filled in by
- * _CPU_Initialize and copied into the task's FP context area during
- * _CPU_Context_Initialize.
- */
-
-/*
-SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context;
-*/
-
-/*
- * On some CPUs, RTEMS supports a software managed interrupt stack.
- * This stack is allocated by the Interrupt Manager and the switch
- * is performed in _ISR_Handler. These variables contain pointers
- * to the lowest and highest addresses in the chunk of memory allocated
- * for the interrupt stack. Since it is unknown whether the stack
- * grows up or down (in general), this give the CPU dependent
- * code the option of picking the version it wants to use.
- *
- * NOTE: These two variables are required if the macro
- * CPU_HAS_SOFTWARE_INTERRUPT_STACK is defined as TRUE.
- */
-
-SCORE_EXTERN void *_CPU_Interrupt_stack_low;
-SCORE_EXTERN void *_CPU_Interrupt_stack_high;
-
-/*
- * With some compilation systems, it is difficult if not impossible to
- * call a high-level language routine from assembly language. This
- * is especially true of commercial Ada compilers and name mangling
- * C++ ones. This variable can be optionally defined by the CPU porter
- * and contains the address of the routine _Thread_Dispatch. This
- * can make it easier to invoke that routine at the end of the interrupt
- * sequence (if a dispatch is necessary).
- */
-
-SCORE_EXTERN void (*_CPU_Thread_dispatch_pointer)();
-
-/*
- * Nothing prevents the porter from declaring more CPU specific variables.
- */
-
-/* XXX: if needed, put more variables here */
-
-/*
- * The size of the floating point context area. On some CPUs this
- * will not be a "sizeof" because the format of the floating point
- * area is not defined -- only the size is. This is usually on
- * CPUs with a "floating point save context" instruction.
- */
-
-#define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp )
-
-/*
- * Amount of extra stack (above minimum stack size) required by
- * MPCI receive server thread. Remember that in a multiprocessor
- * system this thread must exist and be able to process all directives.
- */
-
-#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0
-
-/*
- * This defines the number of entries in the ISR_Vector_table managed
- * by RTEMS.
- */
-
-#define CPU_INTERRUPT_NUMBER_OF_VECTORS 256
-#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1)
-
-/*
- * Should be large enough to run all RTEMS tests. This insures
- * that a "reasonable" small application should not have any problems.
- *
- * We have been able to run the sptests with this value, but have not
- * been able to run the tmtest suite.
- */
-
-#define CPU_STACK_MINIMUM_SIZE 4096
-
-/*
- * CPU's worst alignment requirement for data types on a byte boundary. This
- * alignment does not take into account the requirements for the stack.
- */
-
-#define CPU_ALIGNMENT 4
-
-/*
- * This number corresponds to the byte alignment requirement for the
- * heap handler. This alignment requirement may be stricter than that
- * for the data types alignment specified by CPU_ALIGNMENT. It is
- * common for the heap to follow the same alignment requirement as
- * CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict enough for the heap,
- * then this should be set to CPU_ALIGNMENT.
- *
- * NOTE: This does not have to be a power of 2. It does have to
- * be greater or equal to than CPU_ALIGNMENT.
- */
-
-#define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * This number corresponds to the byte alignment requirement for memory
- * buffers allocated by the partition manager. This alignment requirement
- * may be stricter than that for the data types alignment specified by
- * CPU_ALIGNMENT. It is common for the partition to follow the same
- * alignment requirement as CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict
- * enough for the partition, then this should be set to CPU_ALIGNMENT.
- *
- * NOTE: This does not have to be a power of 2. It does have to
- * be greater or equal to than CPU_ALIGNMENT.
- */
-
-#define CPU_PARTITION_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * This number corresponds to the byte alignment requirement for the
- * stack. This alignment requirement may be stricter than that for the
- * data types alignment specified by CPU_ALIGNMENT. If the CPU_ALIGNMENT
- * is strict enough for the stack, then this should be set to 0.
- *
- * NOTE: This must be a power of 2 either 0 or greater than CPU_ALIGNMENT.
- */
-
-#define CPU_STACK_ALIGNMENT CPU_ALIGNMENT
-
-/* ISR handler macros */
-
-/*
- * Disable all interrupts for an RTEMS critical section. The previous
- * level is returned in _level.
- */
-
-#define _CPU_ISR_Disable( _level) \
- sh_disable_interrupts( _level )
-
-/*
- * Enable interrupts to the previous level (returned by _CPU_ISR_Disable).
- * This indicates the end of an RTEMS critical section. The parameter
- * _level is not modified.
- */
-
-#define _CPU_ISR_Enable( _level) \
- sh_enable_interrupts( _level)
-
-/*
- * This temporarily restores the interrupt to _level before immediately
- * disabling them again. This is used to divide long RTEMS critical
- * sections into two or more parts. The parameter _level is not
- * modified.
- */
-
-#define _CPU_ISR_Flash( _level) \
- sh_flash_interrupts( _level)
-
-/*
- * Map interrupt level in task mode onto the hardware that the CPU
- * actually provides. Currently, interrupt levels which do not
- * map onto the CPU in a generic fashion are undefined. Someday,
- * it would be nice if these were "mapped" by the application
- * via a callout. For example, m68k has 8 levels 0 - 7, levels
- * 8 - 255 would be available for bsp/application specific meaning.
- * This could be used to manage a programmable interrupt controller
- * via the rtems_task_mode directive.
- */
-
-#define _CPU_ISR_Set_level( _newlevel) \
- sh_set_interrupt_level(_newlevel)
-
-unsigned32 _CPU_ISR_Get_level( void );
-
-/* end of ISR handler macros */
-
-/* Context handler macros */
-
-/*
- * Initialize the context to a state suitable for starting a
- * task after a context restore operation. Generally, this
- * involves:
- *
- * - setting a starting address
- * - preparing the stack
- * - preparing the stack and frame pointers
- * - setting the proper interrupt level in the context
- * - initializing the floating point context
- *
- * This routine generally does not set any unnecessary register
- * in the context. The state of the "general data" registers is
- * undefined at task start time.
- *
- * NOTE: This is_fp parameter is TRUE if the thread is to be a floating
- * point thread. This is typically only used on CPUs where the
- * FPU may be easily disabled by software such as on the SPARC
- * where the PSR contains an enable FPU bit.
- */
-
-/*
- * FIXME: defined as a function for debugging - should be a macro
- */
-SCORE_EXTERN void _CPU_Context_Initialize(
- Context_Control *_the_context,
- void *_stack_base,
- unsigned32 _size,
- unsigned32 _isr,
- void (*_entry_point)(void),
- int _is_fp );
-
-/*
- * This routine is responsible for somehow restarting the currently
- * executing task. If you are lucky, then all that is necessary
- * is restoring the context. Otherwise, there will need to be
- * a special assembly routine which does something special in this
- * case. Context_Restore should work most of the time. It will
- * not work if restarting self conflicts with the stack frame
- * assumptions of restoring a context.
- */
-
-#define _CPU_Context_Restart_self( _the_context ) \
- _CPU_Context_restore( (_the_context) );
-
-/*
- * The purpose of this macro is to allow the initial pointer into
- * a floating point context area (used to save the floating point
- * context) to be at an arbitrary place in the floating point
- * context area.
- *
- * This is necessary because some FP units are designed to have
- * their context saved as a stack which grows into lower addresses.
- * Other FP units can be saved by simply moving registers into offsets
- * from the base of the context area. Finally some FP units provide
- * a "dump context" instruction which could fill in from high to low
- * or low to high based on the whim of the CPU designers.
- */
-
-#define _CPU_Context_Fp_start( _base, _offset ) \
- ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
-
-/*
- * This routine initializes the FP context area passed to it to.
- * There are a few standard ways in which to initialize the
- * floating point context. The code included for this macro assumes
- * that this is a CPU in which a "initial" FP context was saved into
- * _CPU_Null_fp_context and it simply copies it to the destination
- * context passed to it.
- *
- * Other models include (1) not doing anything, and (2) putting
- * a "null FP status word" in the correct place in the FP context.
- * SH has no FPU !!!!!!!!!!!!
- */
-
-#define _CPU_Context_Initialize_fp( _destination ) \
- { }
-
-/* end of Context handler macros */
-
-/* Fatal Error manager macros */
-
-/*
- * FIXME: Trap32 ???
- *
- * This routine copies _error into a known place -- typically a stack
- * location or a register, optionally disables interrupts, and
- * invokes a Trap32 Instruction which returns to the breakpoint
- * routine of cmon.
- */
-
-#ifdef BSP_FATAL_HALT
- /* we manage the fatal error in the board support package */
- void bsp_fatal_halt( unsigned32 _error);
-#define _CPU_Fatal_halt( _error ) bsp_fatal_halt( _error)
-#else
-#define _CPU_Fatal_halt( _error)\
-{ \
- asm volatile("mov.l %0,r0"::"m" (_error)); \
- asm volatile("trapa #34"); \
-}
-#endif
-
-/* end of Fatal Error manager macros */
-
-/* Bitfield handler macros */
-
-/*
- * This routine sets _output to the bit number of the first bit
- * set in _value. _value is of CPU dependent type Priority_Bit_map_control.
- * This type may be either 16 or 32 bits wide although only the 16
- * least significant bits will be used.
- *
- * There are a number of variables in using a "find first bit" type
- * instruction.
- *
- * (1) What happens when run on a value of zero?
- * (2) Bits may be numbered from MSB to LSB or vice-versa.
- * (3) The numbering may be zero or one based.
- * (4) The "find first bit" instruction may search from MSB or LSB.
- *
- * RTEMS guarantees that (1) will never happen so it is not a concern.
- * (2),(3), (4) are handled by the macros _CPU_Priority_mask() and
- * _CPU_Priority_bits_index(). These three form a set of routines
- * which must logically operate together. Bits in the _value are
- * set and cleared based on masks built by _CPU_Priority_mask().
- * The basic major and minor values calculated by _Priority_Major()
- * and _Priority_Minor() are "massaged" by _CPU_Priority_bits_index()
- * to properly range between the values returned by the "find first bit"
- * instruction. This makes it possible for _Priority_Get_highest() to
- * calculate the major and directly index into the minor table.
- * This mapping is necessary to ensure that 0 (a high priority major/minor)
- * is the first bit found.
- *
- * This entire "find first bit" and mapping process depends heavily
- * on the manner in which a priority is broken into a major and minor
- * components with the major being the 4 MSB of a priority and minor
- * the 4 LSB. Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
- * priority. And (15 << 4) + 14 corresponds to priority 254 -- the next
- * to the lowest priority.
- *
- * If your CPU does not have a "find first bit" instruction, then
- * there are ways to make do without it. Here are a handful of ways
- * to implement this in software:
- *
- * - a series of 16 bit test instructions
- * - a "binary search using if's"
- * - _number = 0
- * if _value > 0x00ff
- * _value >>=8
- * _number = 8;
- *
- * if _value > 0x0000f
- * _value >=8
- * _number += 4
- *
- * _number += bit_set_table[ _value ]
- *
- * where bit_set_table[ 16 ] has values which indicate the first
- * bit set
- */
-
-#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
-#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
-
-#if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
-
-extern unsigned8 _bit_set_table[];
-
-#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
- { \
- _output = 0;\
- if(_value > 0x00ff) \
- { _value >>= 8; _output = 8; } \
- if(_value > 0x000f) \
- { _output += 4; _value >>= 4; } \
- _output += _bit_set_table[ _value]; }
-
-#endif
-
-/* end of Bitfield handler macros */
-
-/*
- * This routine builds the mask which corresponds to the bit fields
- * as searched by _CPU_Bitfield_Find_first_bit(). See the discussion
- * for that routine.
- */
-
-#if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
-
-#define _CPU_Priority_Mask( _bit_number ) \
- ( 1 << (_bit_number) )
-
-#endif
-
-/*
- * This routine translates the bit numbers returned by
- * _CPU_Bitfield_Find_first_bit() into something suitable for use as
- * a major or minor component of a priority. See the discussion
- * for that routine.
- */
-
-#if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
-
-#define _CPU_Priority_bits_index( _priority ) \
- (_priority)
-
-#endif
-
-/* end of Priority handler macros */
-
-/* functions */
-
-/*
- * _CPU_Initialize
- *
- * This routine performs CPU dependent initialization.
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch)
-);
-
-/*
- * _CPU_ISR_install_raw_handler
- *
- * This routine installs a "raw" interrupt handler directly into the
- * processor's vector table.
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_ISR_install_vector
- *
- * This routine installs an interrupt vector.
- */
-
-void _CPU_ISR_install_vector(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_Install_interrupt_stack
- *
- * This routine installs the hardware interrupt stack pointer.
- *
- * NOTE: It needs only be provided if CPU_HAS_HARDWARE_INTERRUPT_STACK
- * is TRUE.
- */
-
-void _CPU_Install_interrupt_stack( void );
-
-/*
- * _CPU_Thread_Idle_body
- *
- * This routine is the CPU dependent IDLE thread body.
- *
- * NOTE: It need only be provided if CPU_PROVIDES_IDLE_THREAD_BODY
- * is TRUE.
- */
-
-void _CPU_Thread_Idle_body( void );
-
-/*
- * _CPU_Context_switch
- *
- * This routine switches from the run context to the heir context.
- */
-
-void _CPU_Context_switch(
- Context_Control *run,
- Context_Control *heir
-);
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally used only to restart self in an
- * efficient manner. It may simply be a label in _CPU_Context_switch.
- */
-
-void _CPU_Context_restore(
- Context_Control *new_context
-);
-
-/*
- * _CPU_Context_save_fp
- *
- * This routine saves the floating point context passed to it.
- */
-
-void _CPU_Context_save_fp(
- void **fp_context_ptr
-);
-
-/*
- * _CPU_Context_restore_fp
- *
- * This routine restores the floating point context passed to it.
- */
-
-void _CPU_Context_restore_fp(
- void **fp_context_ptr
-);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/exec/score/cpu/sh/cpu_asm.c b/c/src/exec/score/cpu/sh/cpu_asm.c
deleted file mode 100644
index 42764f6eb1..0000000000
--- a/c/src/exec/score/cpu/sh/cpu_asm.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- * This file contains the basic algorithms for all assembly code used
- * in an specific CPU port of RTEMS. These algorithms must be implemented
- * in assembly language
- *
- * NOTE: This port uses a C file with inline assembler instructions
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 material may be reproduced by or for the U.S. Government pursuant
- * to the copyright license under the clause at DFARS 252.227-7013. This
- * notice must appear in all copies of this file and its derivatives.
- *
- */
-
-/*
- * This is supposed to be an assembly file. This means that system.h
- * and cpu.h should not be included in a "real" cpu_asm file. An
- * implementation in assembly should include "cpu_asm.h"
- */
-
-#include <rtems/system.h>
-#include <rtems/score/cpu.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/cpu_isps.h>
-#include <rtems/score/sh_io.h>
-#include <rtems/score/sh.h>
-#include <rtems/score/iosh7030.h>
-
-/* from cpu_isps.c */
-extern proc_ptr _Hardware_isr_Table[];
-
-#if( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
- unsigned long *_old_stack_ptr;
-#endif
-
-register unsigned long *stack_ptr asm("r15");
-
-/*
- * sh_set_irq_priority
- *
- * this function sets the interrupt level of the specified interrupt
- *
- * parameters:
- * - irq : interrupt number
- * - prio: priority to set for this interrupt number
- *
- * returns: 0 if ok
- * -1 on error
- */
-
-unsigned int sh_set_irq_priority(
- unsigned int irq,
- unsigned int prio )
-{
- unsigned32 shiftcount;
- unsigned32 prioreg;
- unsigned16 temp16;
- unsigned32 level;
-
- /*
- * first check for valid interrupt
- */
- if(( irq > 113) || (_Hardware_isr_Table[irq] == _dummy_isp))
- return -1;
- /*
- * check for valid irq priority
- */
- if( prio > 15 )
- return -1;
-
- /*
- * look up appropriate interrupt priority register
- */
- if( irq > 71)
- {
- irq = irq - 72;
- shiftcount = 12 - ((irq & ~0x03) % 16);
-
- switch( irq / 16)
- {
- case 0: { prioreg = INTC_IPRC; break;}
- case 1: { prioreg = INTC_IPRD; break;}
- case 2: { prioreg = INTC_IPRE; break;}
- default: return -1;
- }
- }
- else
- {
- shiftcount = 12 - 4 * ( irq % 4);
- if( irq > 67)
- prioreg = INTC_IPRB;
- else
- prioreg = INTC_IPRA;
- }
-
- /*
- * Set the interrupt priority register
- */
- _CPU_ISR_Disable( level );
-
- temp16 = read16( prioreg);
- temp16 &= ~( 15 << shiftcount);
- temp16 |= prio << shiftcount;
- write16( temp16, prioreg);
-
- _CPU_ISR_Enable( level );
-
- return 0;
-}
-
-/*
- * _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.
- */
-
-void _CPU_Context_save_fp(
- void **fp_context_ptr
-)
-{
-}
-
-/*
- * _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.
- */
-
-void _CPU_Context_restore_fp(
- void **fp_context_ptr
-)
-{
-}
-
-/* _CPU_Context_switch
- *
- * This routine performs a normal non-FP context switch.
- */
-
-/* within __CPU_Context_switch:
- * _CPU_Context_switch
- * _CPU_Context_restore
- *
- * This routine is generally used only to restart self in an
- * efficient manner. It may simply be a label in _CPU_Context_switch.
- *
- * NOTE: It should be safe not to store r4, r5
- *
- * NOTE: It is doubtful if r0 is really needed to be stored
- *
- * NOTE: gbr is added, but should not be necessary, as it is
- * only used globally in this port.
- */
-
-/*
- * FIXME: This is an ugly hack, but we wanted to avoid recalculating
- * the offset each time Context_Control is changed
- */
-void __CPU_Context_switch(
- Context_Control *run, /* r4 */
- Context_Control *heir /* r5 */
-)
-{
-
-asm volatile("
- .global __CPU_Context_switch
-__CPU_Context_switch:
-
- add %0,r4
-
- stc.l sr,@-r4
- stc.l gbr,@-r4
- mov.l r0,@-r4
- mov.l r1,@-r4
- mov.l r2,@-r4
- mov.l r3,@-r4
-
- mov.l r6,@-r4
- mov.l r7,@-r4
- mov.l r8,@-r4
- mov.l r9,@-r4
- mov.l r10,@-r4
- mov.l r11,@-r4
- mov.l r12,@-r4
- mov.l r13,@-r4
- mov.l r14,@-r4
- sts.l pr,@-r4
- sts.l mach,@-r4
- sts.l macl,@-r4
- mov.l r15,@-r4
-
- mov r5, r4"
- :: "I" (sizeof(Context_Control))
- );
-
- asm volatile("
- .global __CPU_Context_restore
-__CPU_Context_restore:
- mov.l @r4+,r15
- lds.l @r4+,macl
- lds.l @r4+,mach
- lds.l @r4+,pr
- mov.l @r4+,r14
- mov.l @r4+,r13
- mov.l @r4+,r12
- mov.l @r4+,r11
- mov.l @r4+,r10
- mov.l @r4+,r9
- mov.l @r4+,r8
- mov.l @r4+,r7
- mov.l @r4+,r6
-
- mov.l @r4+,r3
- mov.l @r4+,r2
- mov.l @r4+,r1
- mov.l @r4+,r0
- ldc.l @r4+,gbr
- ldc.l @r4+,sr
-
- rts
- nop" );
-}
-
-/*
- * This routine provides the RTEMS interrupt management.
- */
-
-void __ISR_Handler( unsigned32 vector)
-{
- register unsigned32 level;
-
- _CPU_ISR_Disable( level );
-
- _Thread_Dispatch_disable_level++;
-
-#if( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
- if( _ISR_Nest_level == 0 )
- {
- /* Install irq stack */
- _old_stack_ptr = stack_ptr;
- stack_ptr = _CPU_Interrupt_stack_high;
- }
-
-#endif
-
- _ISR_Nest_level++;
-
- _CPU_ISR_Enable( level );
-
- /* call isp */
- if( _ISR_Vector_table[ vector])
- (*_ISR_Vector_table[ vector ])( vector );
-
- _CPU_ISR_Disable( level );
-
- _ISR_Nest_level--;
-
-#if( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
-
- if( _ISR_Nest_level == 0 )
- /* restore old stack pointer */
- stack_ptr = _old_stack_ptr;
-#endif
-
- _Thread_Dispatch_disable_level--;
-
- _CPU_ISR_Enable( level );
-
- if ( _Thread_Dispatch_disable_level == 0 )
- {
- if(( _Context_Switch_necessary) || (! _ISR_Signals_to_thread_executing))
- {
- _ISR_Signals_to_thread_executing = FALSE;
- _Thread_Dispatch();
- }
- }
-}
diff --git a/c/src/exec/score/cpu/sh/cpu_isps.c b/c/src/exec/score/cpu/sh/cpu_isps.c
deleted file mode 100644
index 3ef3c32465..0000000000
--- a/c/src/exec/score/cpu/sh/cpu_isps.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * This file contains the isp frames for the user interrupts.
- * From these procedures __ISR_Handler is called with the vector number
- * as argument.
- *
- * __ISR_Handler is kept in a separate file (cpu_asm.c), because a bug in
- * some releases of gcc doesn't properly handle #pragma interrupt, if a
- * file contains both isrs and normal functions.
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/shtypes.h>
-#include <rtems/score/cpu_isps.h>
-
-/*
- * This is a exception vector table
- *
- * It has the same structure like the actual vector table (vectab)
- */
-proc_ptr _Hardware_isr_Table[256]={
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp,
-_nmi_isp, _usb_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp,
-/* trapa 0 -31 */
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-/* irq 64 ... */
-_irq0_isp, _irq1_isp, _irq2_isp, _irq3_isp,
-_irq4_isp, _irq5_isp, _irq6_isp, _irq7_isp,
-_dma0_isp, _dummy_isp, _dma1_isp, _dummy_isp,
-_dma2_isp, _dummy_isp, _dma3_isp, _dummy_isp,
-_imia0_isp, _imib0_isp, _ovi0_isp, _dummy_isp,
-_imia1_isp, _imib1_isp, _ovi1_isp, _dummy_isp,
-_imia2_isp, _imib2_isp, _ovi2_isp, _dummy_isp,
-_imia3_isp, _imib3_isp, _ovi3_isp, _dummy_isp,
-_imia4_isp, _imib4_isp, _ovi4_isp, _dummy_isp,
-_eri0_isp, _rxi0_isp, _txi0_isp, _tei0_isp,
-_eri1_isp, _rxi1_isp, _txi1_isp, _tei1_isp,
-_prt_isp, _adu_isp, _dummy_isp, _dummy_isp,
-_wdt_isp,
-/* 113 */ _dref_isp
-};
-
-#define Str(a)#a
-
-/*
- * Some versions of gcc and all version of egcs at least until egcs-1.1b
- * are not able to handle #pragma interrupt correctly if more than 1 isr is
- * contained in a file and when optimizing.
- * We try to work around this problem by using the macro below.
- */
-#define isp( name, number, func)\
-asm (".global _"Str(name)"\n\t" \
- "_"Str(name)": \n\t" \
- " mov.l r0,@-r15 \n\t" \
- " mov.l r1,@-r15 \n\t" \
- " mov.l r2,@-r15 \n\t" \
- " mov.l r3,@-r15 \n\t" \
- " mov.l r4,@-r15 \n\t" \
- " mov.l r5,@-r15 \n\t" \
- " mov.l r6,@-r15 \n\t" \
- " mov.l r7,@-r15 \n\t" \
- " mov.l r14,@-r15 \n\t" \
- " sts.l pr,@-r15 \n\t" \
- " sts.l mach,@-r15 \n\t" \
- " sts.l macl,@-r15 \n\t" \
- " mov r15,r14 \n\t" \
- " mov.l "Str(name)"_k, r1\n\t" \
- " jsr @r1 \n\t" \
- " mov #"Str(number)", r4\n\t" \
- " mov r14,r15 \n\t" \
- " lds.l @r15+,macl \n\t" \
- " lds.l @r15+,mach \n\t" \
- " lds.l @r15+,pr \n\t" \
- " mov.l @r15+,r14 \n\t" \
- " mov.l @r15+,r7 \n\t" \
- " mov.l @r15+,r6 \n\t" \
- " mov.l @r15+,r5 \n\t" \
- " mov.l @r15+,r4 \n\t" \
- " mov.l @r15+,r3 \n\t" \
- " mov.l @r15+,r2 \n\t" \
- " mov.l @r15+,r1 \n\t" \
- " mov.l @r15+,r0 \n\t" \
- " rte \n\t" \
- " nop \n\t" \
- " .align 2 \n\t" \
- #name"_k: \n\t" \
- ".long "Str(func));
-
-/************************************************
- * Dummy interrupt service procedure for
- * interrupts being not allowed --> Trap 34
- ************************************************/
-asm(" .section .text
-.global __dummy_isp
-__dummy_isp:
- mov.l r14,@-r15
- mov r15, r14
- trapa #34
- mov.l @r15+,r14
- rte
- nop");
-
-/*****************************
- * Non maskable interrupt
- *****************************/
-isp( _nmi_isp, NMI_ISP_V, ___ISR_Handler);
-
-/*****************************
- * User break controller
- *****************************/
-isp( _usb_isp, USB_ISP_V, ___ISR_Handler);
-
-/*****************************
- * External interrupts 0-7
- *****************************/
-isp( _irq0_isp, IRQ0_ISP_V, ___ISR_Handler);
-isp( _irq1_isp, IRQ1_ISP_V, ___ISR_Handler);
-isp( _irq2_isp, IRQ2_ISP_V, ___ISR_Handler);
-isp( _irq3_isp, IRQ3_ISP_V, ___ISR_Handler);
-isp( _irq4_isp, IRQ4_ISP_V, ___ISR_Handler);
-isp( _irq5_isp, IRQ5_ISP_V, ___ISR_Handler);
-isp( _irq6_isp, IRQ6_ISP_V, ___ISR_Handler);
-isp( _irq7_isp, IRQ7_ISP_V, ___ISR_Handler);
-
-/*****************************
- * DMA - controller
- *****************************/
-isp( _dma0_isp, DMA0_ISP_V, ___ISR_Handler);
-isp( _dma1_isp, DMA1_ISP_V, ___ISR_Handler);
-isp( _dma2_isp, DMA2_ISP_V, ___ISR_Handler);
-isp( _dma3_isp, DMA3_ISP_V, ___ISR_Handler);
-
-
-/*****************************
- * Interrupt timer unit
- *****************************/
-
-/*****************************
- * Timer 0
- *****************************/
-isp( _imia0_isp, IMIA0_ISP_V, ___ISR_Handler);
-isp( _imib0_isp, IMIB0_ISP_V, ___ISR_Handler);
-isp( _ovi0_isp, OVI0_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Timer 1
- *****************************/
-isp( _imia1_isp, IMIA1_ISP_V, ___ISR_Handler);
-isp( _imib1_isp, IMIB1_ISP_V, ___ISR_Handler);
-isp( _ovi1_isp, OVI1_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Timer 2
- *****************************/
-isp( _imia2_isp, IMIA2_ISP_V, ___ISR_Handler);
-isp( _imib2_isp, IMIB2_ISP_V, ___ISR_Handler);
-isp( _ovi2_isp, OVI2_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Timer 3
- *****************************/
-isp( _imia3_isp, IMIA3_ISP_V, ___ISR_Handler);
-isp( _imib3_isp, IMIB3_ISP_V, ___ISR_Handler);
-isp( _ovi3_isp, OVI3_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Timer 4
- *****************************/
-isp( _imia4_isp, IMIA4_ISP_V, ___ISR_Handler);
-isp( _imib4_isp, IMIB4_ISP_V, ___ISR_Handler);
-isp( _ovi4_isp, OVI4_ISP_V, ___ISR_Handler);
-
-
-/*****************************
- * Serial interfaces
- *****************************/
-
-/*****************************
- * Serial interface 0
- *****************************/
-isp( _eri0_isp, ERI0_ISP_V, ___ISR_Handler);
-isp( _rxi0_isp, RXI0_ISP_V, ___ISR_Handler);
-isp( _txi0_isp, TXI0_ISP_V, ___ISR_Handler);
-isp( _tei0_isp, TEI0_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Serial interface 1
- *****************************/
-isp( _eri1_isp, ERI1_ISP_V, ___ISR_Handler);
-isp( _rxi1_isp, RXI1_ISP_V, ___ISR_Handler);
-isp( _txi1_isp, TXI1_ISP_V, ___ISR_Handler);
-isp( _tei1_isp, TEI1_ISP_V, ___ISR_Handler);
-
-
-/*****************************
- * Parity control unit of
- * the bus state controller
- *****************************/
-isp( _prt_isp, PRT_ISP_V, ___ISR_Handler);
-
-
-/******************************
- * Analog digital converter
- * ADC
- ******************************/
-isp( _adu_isp, ADU_ISP_V, ___ISR_Handler);
-
-
-/******************************
- * Watchdog timer
- ******************************/
-isp( _wdt_isp, WDT_ISP_V, ___ISR_Handler);
-
-
-/******************************
- * DRAM refresh control unit
- * of bus state controller
- ******************************/
-isp( _dref_isp, DREF_ISP_V, ___ISR_Handler);
diff --git a/c/src/exec/score/cpu/sh/cpu_isps.h b/c/src/exec/score/cpu/sh/cpu_isps.h
deleted file mode 100644
index 3f9baf1ad2..0000000000
--- a/c/src/exec/score/cpu/sh/cpu_isps.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * This include file contains information pertaining to the Hitachi SH
- * processor.
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_ISPS_H
-#define __CPU_ISPS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/shtypes.h>
-
-extern void __ISR_Handler( unsigned32 vector );
-
-
-/*
- * interrupt vector table offsets
- */
-#define NMI_ISP_V 11
-#define USB_ISP_V 12
-#define IRQ0_ISP_V 64
-#define IRQ1_ISP_V 65
-#define IRQ2_ISP_V 66
-#define IRQ3_ISP_V 67
-#define IRQ4_ISP_V 68
-#define IRQ5_ISP_V 69
-#define IRQ6_ISP_V 70
-#define IRQ7_ISP_V 71
-#define DMA0_ISP_V 72
-#define DMA1_ISP_V 74
-#define DMA2_ISP_V 76
-#define DMA3_ISP_V 78
-
-#define IMIA0_ISP_V 80
-#define IMIB0_ISP_V 81
-#define OVI0_ISP_V 82
-
-#define IMIA1_ISP_V 84
-#define IMIB1_ISP_V 85
-#define OVI1_ISP_V 86
-
-#define IMIA2_ISP_V 88
-#define IMIB2_ISP_V 89
-#define OVI2_ISP_V 90
-
-#define IMIA3_ISP_V 92
-#define IMIB3_ISP_V 93
-#define OVI3_ISP_V 94
-
-#define IMIA4_ISP_V 96
-#define IMIB4_ISP_V 97
-#define OVI4_ISP_V 98
-
-#define ERI0_ISP_V 100
-#define RXI0_ISP_V 101
-#define TXI0_ISP_V 102
-#define TEI0_ISP_V 103
-
-#define ERI1_ISP_V 104
-#define RXI1_ISP_V 105
-#define TXI1_ISP_V 106
-#define TEI1_ISP_V 107
-
-#define PRT_ISP_V 108
-#define ADU_ISP_V 109
-#define WDT_ISP_V 112
-#define DREF_ISP_V 113
-
-
-/* dummy ISP */
-extern void _dummy_isp( void );
-
-/* Non Maskable Interrupt */
-extern void _nmi_isp( void );
-
-/* User Break Controller */
-extern void _usb_isp( void );
-
-/* External interrupts 0-7 */
-extern void _irq0_isp( void );
-extern void _irq1_isp( void );
-extern void _irq2_isp( void );
-extern void _irq3_isp( void );
-extern void _irq4_isp( void );
-extern void _irq5_isp( void );
-extern void _irq6_isp( void );
-extern void _irq7_isp( void );
-
-/* DMA - Controller */
-extern void _dma0_isp( void );
-extern void _dma1_isp( void );
-extern void _dma2_isp( void );
-extern void _dma3_isp( void );
-
-/* Interrupt Timer Unit */
-/* Timer 0 */
-extern void _imia0_isp( void );
-extern void _imib0_isp( void );
-extern void _ovi0_isp( void );
-/* Timer 1 */
-extern void _imia1_isp( void );
-extern void _imib1_isp( void );
-extern void _ovi1_isp( void );
-/* Timer 2 */
-extern void _imia2_isp( void );
-extern void _imib2_isp( void );
-extern void _ovi2_isp( void );
-/* Timer 3 */
-extern void _imia3_isp( void );
-extern void _imib3_isp( void );
-extern void _ovi3_isp( void );
-/* Timer 4 */
-extern void _imia4_isp( void );
-extern void _imib4_isp( void );
-extern void _ovi4_isp( void );
-
-/* seriell interfaces */
-extern void _eri0_isp( void );
-extern void _rxi0_isp( void );
-extern void _txi0_isp( void );
-extern void _tei0_isp( void );
-extern void _eri1_isp( void );
-extern void _rxi1_isp( void );
-extern void _txi1_isp( void );
-extern void _tei1_isp( void );
-
-/* Parity Control Unit of the Bus State Controllers */
-extern void _prt_isp( void );
-
-/* ADC */
-extern void _adu_isp( void );
-
-/* Watchdog Timer */
-extern void _wdt_isp( void );
-
-/* DRAM refresh control unit of bus state controller */
-extern void _dref_isp( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/exec/score/cpu/sh/iosh7030.h b/c/src/exec/score/cpu/sh/iosh7030.h
deleted file mode 100644
index 48463aed47..0000000000
--- a/c/src/exec/score/cpu/sh/iosh7030.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * This include file contains information pertaining to the Hitachi SH
- * processor.
- *
- * NOTE: NOT ALL VALUES HAVE BEEN CHECKED !!
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * Based on "iosh7030.h" distributed with Hitachi's EVB's tutorials, which
- * contained no copyright notice.
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __IOSH7030_H
-#define __IOSH7030_H
-
-/*
- * After each line is explained whether the access is char short or long.
- * The functions read/writeb, w, l, 8, 16, 32 can be found
- * in exec/score/cpu/sh/sh_io.h
- *
- * 8 bit == char ( readb, writeb, read8, write8)
- * 16 bit == short ( readw, writew, read16, write16 )
- * 32 bit == long ( readl, writel, read32, write32 )
- */
-
-#define SCI0_SMR 0x05fffec0 /* char */
-#define SCI0_BRR 0x05fffec1 /* char */
-#define SCI0_SCR 0x05fffec2 /* char */
-#define SCI0_TDR 0x05fffec3 /* char */
-#define SCI0_SSR 0x05fffec4 /* char */
-#define SCI0_RDR 0x05fffec5 /* char */
-
-#define SCI1_SMR 0x05fffec8 /* char */
-#define SCI1_BRR 0x05fffec9 /* char */
-#define SCI1_SCR 0x05fffeca /* char */
-#define SCI1_TDR 0x05fffecb /* char */
-#define SCI1_SSR 0x05fffecc /* char */
-#define SCI1_RDR 0x05fffecd /* char */
-
-
-#define ADDRAH 0x05fffee0 /* char */
-#define ADDRAL 0x05fffee1 /* char */
-#define ADDRBH 0x05fffee2 /* char */
-#define ADDRBL 0x05fffee3 /* char */
-#define ADDRCH 0x05fffee4 /* char */
-#define ADDRCL 0x05fffee5 /* char */
-#define ADDRDH 0x05fffee6 /* char */
-#define ADDRDL 0x05fffee7 /* char */
-#define AD_DRA 0x05fffee0 /* short */
-#define AD_DRB 0x05fffee2 /* short */
-#define AD_DRC 0x05fffee4 /* short */
-#define AD_DRD 0x05fffee6 /* short */
-#define ADCSR 0x05fffee8 /* char */
-#define ADCR 0x05fffee9 /* char */
-
-/*ITU SHARED*/
-#define ITU_TSTR 0x05ffff00 /* char */
-#define ITU_TSNC 0x05ffff01 /* char */
-#define ITU_TMDR 0x05ffff02 /* char */
-#define ITU_TFCR 0x05ffff03 /* char */
-
-/*ITU CHANNEL 0*/
-#define ITU_TCR0 0x05ffff04 /* char */
-#define ITU_TIOR0 0x05ffff05 /* char */
-#define ITU_TIER0 0x05ffff06 /* char */
-#define ITU_TSR0 0x05ffff07 /* char */
-#define ITU_TCNT0 0x05ffff08 /* short */
-#define ITU_GRA0 0x05ffff0a /* short */
-#define ITU_GRB0 0x05ffff0c /* short */
-
- /*ITU CHANNEL 1*/
-#define ITU_TCR1 0x05ffff0E /* char */
-#define ITU_TIOR1 0x05ffff0F /* char */
-#define ITU_TIER1 0x05ffff10 /* char */
-#define ITU_TSR1 0x05ffff11 /* char */
-#define ITU_TCNT1 0x05ffff12 /* short */
-#define ITU_GRA1 0x05ffff14 /* short */
-#define ITU_GRB1 0x05ffff16 /* short */
-
-
- /*ITU CHANNEL 2*/
-#define ITU_TCR2 0x05ffff18 /* char */
-#define ITU_TIOR2 0x05ffff19 /* char */
-#define ITU_TIER2 0x05ffff1A /* char */
-#define ITU_TSR2 0x05ffff1B /* char */
-#define ITU_TCNT2 0x05ffff1C /* short */
-#define ITU_GRA2 0x05ffff1E /* short */
-#define ITU_GRB2 0x05ffff20 /* short */
-
- /*ITU CHANNEL 3*/
-#define ITU_TCR3 0x05ffff22 /* char */
-#define ITU_TIOR3 0x05ffff23 /* char */
-#define ITU_TIER3 0x05ffff24 /* char */
-#define ITU_TSR3 0x05ffff25 /* char */
-#define ITU_TCNT3 0x05ffff26 /* short */
-#define ITU_GRA3 0x05ffff28 /* short */
-#define ITU_GRB3 0x05ffff2A /* short */
-#define ITU_BRA3 0x05ffff2C /* short */
-#define ITU_BRB3 0x05ffff2E /* short */
-
- /*ITU CHANNELS 0-4 SHARED*/
-#define ITU_TOCR 0x05ffff31 /* char */
-
- /*ITU CHANNEL 4*/
-#define ITU_TCR4 0x05ffff32 /* char */
-#define ITU_TIOR4 0x05ffff33 /* char */
-#define ITU_TIER4 0x05ffff34 /* char */
-#define ITU_TSR4 0x05ffff35 /* char */
-#define ITU_TCNT4 0x05ffff36 /* short */
-#define ITU_GRA4 0x05ffff38 /* short */
-#define ITU_GRB4 0x05ffff3A /* short */
-#define ITU_BRA4 0x05ffff3C /* short */
-#define ITU_BRB4 0x05ffff3E /* short */
-
- /*DMAC CHANNELS 0-3 SHARED*/
-#define DMAOR 0x05ffff48 /* short */
-
- /*DMAC CHANNEL 0*/
-#define DMA_SAR0 0x05ffff40 /* long */
-#define DMA_DAR0 0x05ffff44 /* long */
-#define DMA_TCR0 0x05ffff4a /* short */
-#define DMA_CHCR0 0x05ffff4e /* short */
-
- /*DMAC CHANNEL 1*/
-#define DMA_SAR1 0x05ffff50 /* long */
-#define DMA_DAR1 0x05ffff54 /* long */
-#define DMA_TCR1 0x05fffF5a /* short */
-#define DMA_CHCR1 0x05ffff5e /* short */
-
- /*DMAC CHANNEL 3*/
-#define DMA_SAR3 0x05ffff60 /* long */
-#define DMA_DAR3 0x05ffff64 /* long */
-#define DMA_TCR3 0x05fffF6a /* short */
-#define DMA_CHCR3 0x05ffff6e /* short */
-
-/*DMAC CHANNEL 4*/
-#define DMA_SAR4 0x05ffff70 /* long */
-#define DMA_DAR4 0x05ffff74 /* long */
-#define DMA_TCR4 0x05fffF7a /* short */
-#define DMA_CHCR4 0x05ffff7e /* short */
-
-/*INTC*/
-#define INTC_IPRA 0x05ffff84 /* short */
-#define INTC_IPRB 0x05ffff86 /* short */
-#define INTC_IPRC 0x05ffff88 /* short */
-#define INTC_IPRD 0x05ffff8A /* short */
-#define INTC_IPRE 0x05ffff8C /* short */
-#define INTC_ICR 0x05ffff8E /* short */
-
-/*UBC*/
-#define UBC_BARH 0x05ffff90 /* short */
-#define UBC_BARL 0x05ffff92 /* short */
-#define UBC_BAMRH 0x05ffff94 /* short */
-#define UBC_BAMRL 0x05ffff96 /* short */
-#define UBC_BBR 0x05ffff98 /* short */
-
-/*BSC*/
-#define BSC_BCR 0x05ffffA0 /* short */
-#define BSC_WCR1 0x05ffffA2 /* short */
-#define BSC_WCR2 0x05ffffA4 /* short */
-#define BSC_WCR3 0x05ffffA6 /* short */
-#define BSC_DCR 0x05ffffA8 /* short */
-#define BSC_PCR 0x05ffffAA /* short */
-#define BSC_RCR 0x05ffffAC /* short */
-#define BSC_RTCSR 0x05ffffAE /* short */
-#define BSC_RTCNT 0x05ffffB0 /* short */
-#define BSC_RTCOR 0x05ffffB2 /* short */
-
-/*WDT*/
-#define WDT_TCSR 0x05ffffB8 /* char */
-#define WDT_TCNT 0x05ffffB9 /* char */
-#define WDT_RSTCSR 0x05ffffBB /* char */
-
-/*POWER DOWN STATE*/
-#define PDT_SBYCR 0x05ffffBC /* char */
-
-/*PORT A*/
-#define PADR 0x05ffffC0 /* short */
-
-/*PORT B*/
-#define PBDR 0x05ffffC2 /* short */
-
- /*PORT C*/
-#define PCDR 0x05ffffD0 /* short */
-
-/*PFC*/
-#define PFC_PAIOR 0x05ffffC4 /* short */
-#define PFC_PBIOR 0x05ffffC6 /* short */
-#define PFC_PACR1 0x05ffffC8 /* short */
-#define PFC_PACR2 0x05ffffCA /* short */
-#define PFC_PBCR1 0x05ffffCC /* short */
-#define PFC_PBCR2 0x05ffffCE /* short */
-#define PFC_CASCR 0x05ffffEE /* short */
-
-/*TPC*/
-#define TPC_TPMR 0x05ffffF0 /* short */
-#define TPC_TPCR 0x05ffffF1 /* short */
-#define TPC_NDERH 0x05ffffF2 /* short */
-#define TPC_NDERL 0x05ffffF3 /* short */
-#define TPC_NDRB 0x05ffffF4 /* char */
-#define TPC_NDRA 0x05ffff5F /* char */
-#define TPC_NDRB1 0x05ffffF6 /* char */
-#define TPC_NDRA1 0x05ffffF7 /* char */
-
-#endif
diff --git a/c/src/exec/score/cpu/sh/ispsh7032.c b/c/src/exec/score/cpu/sh/ispsh7032.c
deleted file mode 100644
index 3ef3c32465..0000000000
--- a/c/src/exec/score/cpu/sh/ispsh7032.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * This file contains the isp frames for the user interrupts.
- * From these procedures __ISR_Handler is called with the vector number
- * as argument.
- *
- * __ISR_Handler is kept in a separate file (cpu_asm.c), because a bug in
- * some releases of gcc doesn't properly handle #pragma interrupt, if a
- * file contains both isrs and normal functions.
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/shtypes.h>
-#include <rtems/score/cpu_isps.h>
-
-/*
- * This is a exception vector table
- *
- * It has the same structure like the actual vector table (vectab)
- */
-proc_ptr _Hardware_isr_Table[256]={
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp,
-_nmi_isp, _usb_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp,
-/* trapa 0 -31 */
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-/* irq 64 ... */
-_irq0_isp, _irq1_isp, _irq2_isp, _irq3_isp,
-_irq4_isp, _irq5_isp, _irq6_isp, _irq7_isp,
-_dma0_isp, _dummy_isp, _dma1_isp, _dummy_isp,
-_dma2_isp, _dummy_isp, _dma3_isp, _dummy_isp,
-_imia0_isp, _imib0_isp, _ovi0_isp, _dummy_isp,
-_imia1_isp, _imib1_isp, _ovi1_isp, _dummy_isp,
-_imia2_isp, _imib2_isp, _ovi2_isp, _dummy_isp,
-_imia3_isp, _imib3_isp, _ovi3_isp, _dummy_isp,
-_imia4_isp, _imib4_isp, _ovi4_isp, _dummy_isp,
-_eri0_isp, _rxi0_isp, _txi0_isp, _tei0_isp,
-_eri1_isp, _rxi1_isp, _txi1_isp, _tei1_isp,
-_prt_isp, _adu_isp, _dummy_isp, _dummy_isp,
-_wdt_isp,
-/* 113 */ _dref_isp
-};
-
-#define Str(a)#a
-
-/*
- * Some versions of gcc and all version of egcs at least until egcs-1.1b
- * are not able to handle #pragma interrupt correctly if more than 1 isr is
- * contained in a file and when optimizing.
- * We try to work around this problem by using the macro below.
- */
-#define isp( name, number, func)\
-asm (".global _"Str(name)"\n\t" \
- "_"Str(name)": \n\t" \
- " mov.l r0,@-r15 \n\t" \
- " mov.l r1,@-r15 \n\t" \
- " mov.l r2,@-r15 \n\t" \
- " mov.l r3,@-r15 \n\t" \
- " mov.l r4,@-r15 \n\t" \
- " mov.l r5,@-r15 \n\t" \
- " mov.l r6,@-r15 \n\t" \
- " mov.l r7,@-r15 \n\t" \
- " mov.l r14,@-r15 \n\t" \
- " sts.l pr,@-r15 \n\t" \
- " sts.l mach,@-r15 \n\t" \
- " sts.l macl,@-r15 \n\t" \
- " mov r15,r14 \n\t" \
- " mov.l "Str(name)"_k, r1\n\t" \
- " jsr @r1 \n\t" \
- " mov #"Str(number)", r4\n\t" \
- " mov r14,r15 \n\t" \
- " lds.l @r15+,macl \n\t" \
- " lds.l @r15+,mach \n\t" \
- " lds.l @r15+,pr \n\t" \
- " mov.l @r15+,r14 \n\t" \
- " mov.l @r15+,r7 \n\t" \
- " mov.l @r15+,r6 \n\t" \
- " mov.l @r15+,r5 \n\t" \
- " mov.l @r15+,r4 \n\t" \
- " mov.l @r15+,r3 \n\t" \
- " mov.l @r15+,r2 \n\t" \
- " mov.l @r15+,r1 \n\t" \
- " mov.l @r15+,r0 \n\t" \
- " rte \n\t" \
- " nop \n\t" \
- " .align 2 \n\t" \
- #name"_k: \n\t" \
- ".long "Str(func));
-
-/************************************************
- * Dummy interrupt service procedure for
- * interrupts being not allowed --> Trap 34
- ************************************************/
-asm(" .section .text
-.global __dummy_isp
-__dummy_isp:
- mov.l r14,@-r15
- mov r15, r14
- trapa #34
- mov.l @r15+,r14
- rte
- nop");
-
-/*****************************
- * Non maskable interrupt
- *****************************/
-isp( _nmi_isp, NMI_ISP_V, ___ISR_Handler);
-
-/*****************************
- * User break controller
- *****************************/
-isp( _usb_isp, USB_ISP_V, ___ISR_Handler);
-
-/*****************************
- * External interrupts 0-7
- *****************************/
-isp( _irq0_isp, IRQ0_ISP_V, ___ISR_Handler);
-isp( _irq1_isp, IRQ1_ISP_V, ___ISR_Handler);
-isp( _irq2_isp, IRQ2_ISP_V, ___ISR_Handler);
-isp( _irq3_isp, IRQ3_ISP_V, ___ISR_Handler);
-isp( _irq4_isp, IRQ4_ISP_V, ___ISR_Handler);
-isp( _irq5_isp, IRQ5_ISP_V, ___ISR_Handler);
-isp( _irq6_isp, IRQ6_ISP_V, ___ISR_Handler);
-isp( _irq7_isp, IRQ7_ISP_V, ___ISR_Handler);
-
-/*****************************
- * DMA - controller
- *****************************/
-isp( _dma0_isp, DMA0_ISP_V, ___ISR_Handler);
-isp( _dma1_isp, DMA1_ISP_V, ___ISR_Handler);
-isp( _dma2_isp, DMA2_ISP_V, ___ISR_Handler);
-isp( _dma3_isp, DMA3_ISP_V, ___ISR_Handler);
-
-
-/*****************************
- * Interrupt timer unit
- *****************************/
-
-/*****************************
- * Timer 0
- *****************************/
-isp( _imia0_isp, IMIA0_ISP_V, ___ISR_Handler);
-isp( _imib0_isp, IMIB0_ISP_V, ___ISR_Handler);
-isp( _ovi0_isp, OVI0_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Timer 1
- *****************************/
-isp( _imia1_isp, IMIA1_ISP_V, ___ISR_Handler);
-isp( _imib1_isp, IMIB1_ISP_V, ___ISR_Handler);
-isp( _ovi1_isp, OVI1_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Timer 2
- *****************************/
-isp( _imia2_isp, IMIA2_ISP_V, ___ISR_Handler);
-isp( _imib2_isp, IMIB2_ISP_V, ___ISR_Handler);
-isp( _ovi2_isp, OVI2_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Timer 3
- *****************************/
-isp( _imia3_isp, IMIA3_ISP_V, ___ISR_Handler);
-isp( _imib3_isp, IMIB3_ISP_V, ___ISR_Handler);
-isp( _ovi3_isp, OVI3_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Timer 4
- *****************************/
-isp( _imia4_isp, IMIA4_ISP_V, ___ISR_Handler);
-isp( _imib4_isp, IMIB4_ISP_V, ___ISR_Handler);
-isp( _ovi4_isp, OVI4_ISP_V, ___ISR_Handler);
-
-
-/*****************************
- * Serial interfaces
- *****************************/
-
-/*****************************
- * Serial interface 0
- *****************************/
-isp( _eri0_isp, ERI0_ISP_V, ___ISR_Handler);
-isp( _rxi0_isp, RXI0_ISP_V, ___ISR_Handler);
-isp( _txi0_isp, TXI0_ISP_V, ___ISR_Handler);
-isp( _tei0_isp, TEI0_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Serial interface 1
- *****************************/
-isp( _eri1_isp, ERI1_ISP_V, ___ISR_Handler);
-isp( _rxi1_isp, RXI1_ISP_V, ___ISR_Handler);
-isp( _txi1_isp, TXI1_ISP_V, ___ISR_Handler);
-isp( _tei1_isp, TEI1_ISP_V, ___ISR_Handler);
-
-
-/*****************************
- * Parity control unit of
- * the bus state controller
- *****************************/
-isp( _prt_isp, PRT_ISP_V, ___ISR_Handler);
-
-
-/******************************
- * Analog digital converter
- * ADC
- ******************************/
-isp( _adu_isp, ADU_ISP_V, ___ISR_Handler);
-
-
-/******************************
- * Watchdog timer
- ******************************/
-isp( _wdt_isp, WDT_ISP_V, ___ISR_Handler);
-
-
-/******************************
- * DRAM refresh control unit
- * of bus state controller
- ******************************/
-isp( _dref_isp, DREF_ISP_V, ___ISR_Handler);
diff --git a/c/src/exec/score/cpu/sh/rtems.c b/c/src/exec/score/cpu/sh/rtems.c
deleted file mode 100644
index b0e0e22e02..0000000000
--- a/c/src/exec/score/cpu/sh/rtems.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * This file contains the single entry point code for
- * the SH implementation of RTEMS.
- *
- * NOTE: This is supposed to be a .S or .s file NOT a C file.
- *
- * NOTE: UNTESTED, very likely this does not not work.
- *
- * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 is supposed to be an assembly file. This means that system.h
- * and cpu.h should not be included in a "real" rtems file.
- */
-
-/* #include <rtems/system.h> */
-/* #include <rtems/score/cpu.h> */
-/* #include "asm.h" */
-
-/*
- * This should work but due to a bug in rtems building scheme it doesn't work
- */
-
-/* #include <rtems/directives.h> */
-
-extern void* _Entry_points[] ;
-
-/*
- * RTEMS
- *
- * This routine jumps to the directive indicated in the
- * CPU defined register. This routine is used when RTEMS is
- * linked by itself and placed in ROM. This routine is the
- * first address in the ROM space for RTEMS. The user "calls"
- * this address with the directive arguments in the normal place.
- * This routine then jumps indirectly to the correct directive
- * preserving the arguments. The directive should not realize
- * it has been "wrapped" in this way. The table "_Entry_points"
- * is used to look up the directive.
- */
-
-void __RTEMS()
-{
- asm volatile (
- ".global _RTEMS
-_RTEMS:" );
-
- asm volatile (
- "jmp %0
- rts
- nop"
- :: "m" (_Entry_points) );
-}
diff --git a/c/src/exec/score/cpu/sh/sh.h b/c/src/exec/score/cpu/sh/sh.h
deleted file mode 100644
index 03d9077d3e..0000000000
--- a/c/src/exec/score/cpu/sh/sh.h
+++ /dev/null
@@ -1,186 +0,0 @@
-/* sh.h
- *
- * This include file contains information pertaining to the Hitachi SH
- * processor.
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _sh_h
-#define _sh_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This file contains the information required to build
- * RTEMS for a particular member of the "SH" family.
- *
- * It does this by setting variables to indicate which implementation
- * dependent features are present in a particular member of the family.
- */
-
-#if defined(sh7032)
-
-#define CPU_MODEL_NAME "SH 7032"
-
-#define SH_HAS_FPU 0
-
-/*
- * If the following macro is set to 0 there will be no software irq stack
- */
-#define SH_HAS_SEPARATE_STACKS 1
-
-#else
-
-#error "Unsupported CPU Model"
-
-#endif
-
-/*
- * Define the name of the CPU family.
- */
-
-#define CPU_NAME "Hitachi SH"
-
-#ifndef ASM
-
-/*
- * Mask for disabling interrupts
- */
-#define SH_IRQDIS_VALUE 0xf0
-
-#define sh_disable_interrupts( _level ) \
- asm volatile ( \
- "stc sr,%0\n\t" \
- "ldc %1,sr\n\t"\
- : "=r" (_level ) \
- : "r" (SH_IRQDIS_VALUE) );
-
-#define sh_enable_interrupts( _level ) \
- asm volatile( "ldc %0,sr\n\t" \
- "nop\n\t" \
- :: "r" (_level) );
-
-/*
- * This temporarily restores the interrupt to _level before immediately
- * disabling them again. This is used to divide long RTEMS critical
- * sections into two or more parts. The parameter _level is not
- * modified.
- */
-
-#define sh_flash_interrupts( _level ) \
- asm volatile( \
- "ldc %1,sr\n\t" \
- "nop\n\t" \
- "ldc %0,sr\n\t" \
- "nop\n\t" \
- : : "r" (SH_IRQDIS_VALUE), "r" (_level) );
-
-#define sh_get_interrupt_level( _level ) \
-{ \
- register unsigned32 _tmpsr ; \
- \
- asm volatile( "stc sr, %0" : "=r" (_tmpsr) ); \
- _level = (_tmpsr & 0xf0) >> 4 ; \
-}
-
-#define sh_set_interrupt_level( _newlevel ) \
-{ \
- register unsigned32 _tmpsr; \
- \
- asm volatile ( "stc sr, %0" : "=r" (_tmpsr) ); \
- _tmpsr = ( _tmpsr & ~0xf0 ) | ((_newlevel) << 4) ; \
- asm volatile( "ldc %0,sr" :: "r" (_tmpsr) ); \
-}
-
-/*
- * The following routine swaps the endian format of an unsigned int.
- * It must be static because it is referenced indirectly.
- */
-
-static inline unsigned int sh_swap_u32(
- unsigned int value
-)
-{
- register unsigned int swapped;
-
- asm volatile (
- "swap.b %1,%0; "
- "swap.w %0,%0; "
- "swap.b %0,%0"
- : "=r" (swapped)
- : "r" (value) );
-
- return( swapped );
-}
-
-static inline unsigned int sh_swap_u16(
- unsigned int value
-)
-{
- register unsigned int swapped ;
-
- asm volatile ( "swap.b %1,%0" : "=r" (swapped) : "r" (value) );
-
- return( swapped );
-}
-
-#define CPU_swap_u32( value ) sh_swap_u32( value )
-#define CPU_swap_u16( value ) sh_swap_u16( value )
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- *
- * Since we don't have a real time clock, this is a very rough
- * approximation, assuming that each cycle of the delay loop takes
- * approx. 4 machine cycles.
- *
- * e.g.: MHZ = 20 => 5e-8 secs per instruction
- * => 4 * 5e-8 secs per delay loop
- */
-
-#define sh_delay( microseconds ) \
-{ register unsigned int _delay = (microseconds) * (MHZ / 4 ); \
- asm volatile ( \
-"0: add #-1,%0\n \
- nop\n \
- cmp/pl %0\n \
- bt 0b\
- nop" \
- :: "r" (_delay) ); \
-}
-
-#define CPU_delay( microseconds ) sh_delay( microseconds )
-
-extern unsigned int sh_set_irq_priority(
- unsigned int irq,
- unsigned int prio );
-
-#endif /* !ASM */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/exec/score/cpu/sh/sh_io.h b/c/src/exec/score/cpu/sh/sh_io.h
deleted file mode 100644
index 2a9111e307..0000000000
--- a/c/src/exec/score/cpu/sh/sh_io.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * These are some macros to access memory mapped devices
- * on the SH7000-architecture.
- *
- * Inspired from the linux kernel's include/asm/io.h
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * COPYRIGHT (c) 1996-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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _asm_io_h
-#define _asm_io_h
-
-#define readb(addr) (*(volatile unsigned char *) (addr))
-#define readw(addr) (*(volatile unsigned short *) (addr))
-#define readl(addr) (*(volatile unsigned int *) (addr))
-#define read8(addr) (*(volatile unsigned8 *) (addr))
-#define read16(addr) (*(volatile unsigned16 *) (addr))
-#define read32(addr) (*(volatile unsigned32 *) (addr))
-
-#define writeb(b,addr) ((*(volatile unsigned char *) (addr)) = (b))
-#define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b))
-#define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b))
-#define write8(b,addr) ((*(volatile unsigned8 *) (addr)) = (b))
-#define write16(b,addr) ((*(volatile unsigned16 *) (addr)) = (b))
-#define write32(b,addr) ((*(volatile unsigned32 *) (addr)) = (b))
-
-#define inb(addr) readb(addr)
-#define outb(b,addr) writeb(b,addr)
-
-#endif
diff --git a/c/src/exec/score/cpu/sh/shtypes.h b/c/src/exec/score/cpu/sh/shtypes.h
deleted file mode 100644
index 853479c13b..0000000000
--- a/c/src/exec/score/cpu/sh/shtypes.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * This include file contains information pertaining to the Hitachi SH
- * processor.
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_TYPES_h
-#define __CPU_SH_TYPES_h
-
-#ifndef ASM
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* unsigned 8-bit integer */
-typedef unsigned short unsigned16; /* unsigned 16-bit integer */
-typedef unsigned int unsigned32; /* unsigned 32-bit integer */
-typedef unsigned long long unsigned64; /* unsigned 64-bit integer */
-
-typedef unsigned16 Priority_Bit_map_control;
-
-typedef signed char signed8; /* 8-bit signed integer */
-typedef signed short signed16; /* 16-bit signed integer */
-typedef signed int signed32; /* 32-bit signed integer */
-typedef signed long long signed64; /* 64 bit signed integer */
-
-typedef unsigned16 boolean; /* Boolean value, external */
- /* data bus has 16 bits */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-typedef void sh_isr;
-typedef void ( *sh_isr_entry )( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !ASM */
-
-#endif
-
diff --git a/c/src/exec/score/cpu/sparc/Makefile.in b/c/src/exec/score/cpu/sparc/Makefile.in
deleted file mode 100644
index 565128f2c3..0000000000
--- a/c/src/exec/score/cpu/sparc/Makefile.in
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-RELS=$(ARCH)/rtems-cpu.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=cpu
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/cpu.h $(srcdir)/sparc.h $(srcdir)/sparctypes.h
-
-# H_FILES that get installed externally
-EXTERNAL_H_FILES = $(srcdir)/asm.h $(srcdir)/erc32.h
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=cpu_asm rtems
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) $(EXTERNAL_H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(ARCH)/rtems-cpu.rel: $(OBJS)
- $(make-rel)
-
-all: ${ARCH} $(SRCS) preinstall $(OBJS) $(RELS)
-
-preinstall: $(ARCH) $(PROJECT_INCLUDE)/rtems/score/targopts.h \
- ${PROJECT_RELEASE}/lib/bsp_specs
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
-# we will share the basic cpu file
- $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
-
-$(PROJECT_INCLUDE)/rtems/score/targopts.h: $(ARCH)/targopts.h-tmp
- $(INSTALL) -m 444 $(ARCH)/targopts.h-tmp $@
-
-# $(ARCH)/targopts.h-tmp rule is in leaf.cfg
-
-${PROJECT_RELEASE}/lib/bsp_specs: $(ARCH)/bsp_specs.tmp
- $(INSTALL) -m 444 $(ARCH)/bsp_specs.tmp $@
-
-# $(ARCH)/bsp_specs.tmp rule is in leaf.cfg
diff --git a/c/src/exec/score/cpu/sparc/README b/c/src/exec/score/cpu/sparc/README
deleted file mode 100644
index c4c2200075..0000000000
--- a/c/src/exec/score/cpu/sparc/README
+++ /dev/null
@@ -1,110 +0,0 @@
-#
-# $Id$
-#
-
-This file discusses SPARC specific issues which are important to
-this port. The primary topics in this file are:
-
- + Global Register Usage
- + Stack Frame
- + EF bit in the PSR
-
-
-Global Register Usage
-=====================
-
-This information on register usage is based heavily on a comment in the
-file gcc-2.7.0/config/sparc/sparc.h in the the gcc 2.7.0 source.
-
- + g0 is hardwired to 0
- + On non-v9 systems:
- - g1 is free to use as temporary.
- - g2-g4 are reserved for applications. Gcc normally uses them as
- temporaries, but this can be disabled via the -mno-app-regs option.
- - g5 through g7 are reserved for the operating system.
- + On v9 systems:
- - g1 and g5 are free to use as temporaries.
- - g2-g4 are reserved for applications (the compiler will not normally use
- them, but they can be used as temporaries with -mapp-regs).
- - g6-g7 are reserved for the operating system.
-
- NOTE: As of gcc 2.7.0 register g1 was used in the following scenarios:
-
- + as a temporary by the 64 bit sethi pattern
- + when restoring call-preserved registers in large stack frames
-
-RTEMS places no constraints on the usage of the global registers. Although
-gcc assumes that either g5-g7 (non-V9) or g6-g7 (V9) are reserved for the
-operating system, RTEMS does not assume any special use for them.
-
-
-
-Stack Frame
-===========
-
-The stack grows downward (i.e. to lower addresses) on the SPARC architecture.
-
-The following is the organization of the stack frame:
-
-
-
- | ............... |
- fp | |
- +-------------------------------+
- | |
- | Local registers, temporaries, |
- | and saved floats | x bytes
- | |
- sp + x +-------------------------------+
- | |
- | outgoing parameters past |
- | the sixth one | x bytes
- | |
- sp + 92 +-------------------------------+ *
- | | *
- | area for callee to save | *
- | register arguments | * 24 bytes
- | | *
- sp + 68 +-------------------------------+ *
- | | *
- | structure return pointer | * 4 bytes
- | | *
- sp + 64 +-------------------------------+ *
- | | *
- | local register set | * 32 bytes
- | | *
- sp + 32 +-------------------------------+ *
- | | *
- | input register set | * 32 bytes
- | | *
- sp +-------------------------------+ *
-
-
-* = minimal stack frame
-
-x = optional components
-
-EF bit in the PSR
-=================
-
-The EF (enable floating point unit) in the PSR is utilized in this port to
-prevent non-floating point tasks from performing floating point
-operations. This bit is maintained as part of the integer context.
-However, the floating point context is switched BEFORE the integer
-context. Thus the EF bit in place at the time of the FP switch may
-indicate that FP operations are disabled. This occurs on certain task
-switches, when the EF bit will be 0 for the outgoing task and thus a fault
-will be generated on the first FP operation of the FP context save.
-
-The remedy for this is to enable FP access as the first step in both the
-save and restore of the FP context area. This bit will be subsequently
-reloaded by the integer context switch.
-
-Two of the scenarios which demonstrate this problem are outlined below:
-
-1. When the first FP task is switched to. The system tasks are not FP and
-thus would be unable to restore the FP context of the incoming task.
-
-2. On a deferred FP context switch. In this case, the system might switch
-from FP Task A to non-FP Task B and then to FP Task C. In this scenario,
-the floating point state must technically be saved by a non-FP task.
diff --git a/c/src/exec/score/cpu/sparc/asm.h b/c/src/exec/score/cpu/sparc/asm.h
deleted file mode 100644
index b9a3aabeea..0000000000
--- a/c/src/exec/score/cpu/sparc/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 <rtems/score/targopts.h>
-#include <rtems/score/cpu.h>
-
-/*
- * 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. */
-#undef __USER_LABEL_PREFIX__
-#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 for ERC32 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/c/src/exec/score/cpu/sparc/cpu.c b/c/src/exec/score/cpu/sparc/cpu.c
deleted file mode 100644
index 70b0f8f219..0000000000
--- a/c/src/exec/score/cpu/sparc/cpu.c
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
- * SPARC Dependent Source
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-
-#if defined(erc32)
-#include <erc32.h>
-#endif
-
-/*
- * This initializes the set of opcodes placed in each trap
- * table entry. The routine which installs a handler is responsible
- * for filling in the fields for the _handler address and the _vector
- * trap type.
- *
- * The constants following this structure are masks for the fields which
- * must be filled in when the handler is installed.
- */
-
-const CPU_Trap_table_entry _CPU_Trap_slot_template = {
- 0xa1480000, /* mov %psr, %l0 */
- 0x29000000, /* sethi %hi(_handler), %l4 */
- 0x81c52000, /* jmp %l4 + %lo(_handler) */
- 0xa6102000 /* mov _vector, %l3 */
-};
-
-/*PAGE
- *
- * _CPU_Initialize
- *
- * This routine performs processor dependent initialization.
- *
- * Input Parameters:
- * cpu_table - CPU table to initialize
- * thread_dispatch - address of disptaching routine
- *
- * Output Parameters: NONE
- *
- * NOTE: There is no need to save the pointer to the thread dispatch routine.
- * The SPARC's assembly code can reference it directly with no problems.
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch) /* ignored on this CPU */
-)
-{
- void *pointer;
-
-#ifndef NO_TABLE_MOVE
- unsigned32 trap_table_start;
- unsigned32 tbr_value;
- CPU_Trap_table_entry *old_tbr;
- CPU_Trap_table_entry *trap_table;
-
- /*
- * Install the executive's trap table. All entries from the original
- * trap table are copied into the executive's trap table. This is essential
- * since this preserves critical trap handlers such as the window underflow
- * and overflow handlers. It is the responsibility of the BSP to provide
- * install these in the initial trap table.
- */
-
-
- trap_table_start = (unsigned32) &_CPU_Trap_Table_area;
- if (trap_table_start & (SPARC_TRAP_TABLE_ALIGNMENT-1))
- trap_table_start = (trap_table_start + SPARC_TRAP_TABLE_ALIGNMENT) &
- ~(SPARC_TRAP_TABLE_ALIGNMENT-1);
-
- trap_table = (CPU_Trap_table_entry *) trap_table_start;
-
- sparc_get_tbr( tbr_value );
-
- old_tbr = (CPU_Trap_table_entry *) (tbr_value & 0xfffff000);
-
- memcpy( trap_table, (void *) old_tbr, 256 * sizeof( CPU_Trap_table_entry ) );
-
- sparc_set_tbr( trap_table_start );
-
-#endif
-
- /*
- * This seems to be the most appropriate way to obtain an initial
- * FP context on the SPARC. The NULL fp context is copied it to
- * the task's FP context during Context_Initialize.
- */
-
- pointer = &_CPU_Null_fp_context;
- _CPU_Context_save_fp( &pointer );
-
- /*
- * Grab our own copy of the user's CPU table.
- */
-
- _CPU_Table = *cpu_table;
-
-#if defined(erc32)
-
- /*
- * ERC32 specific initialization
- */
-
- _ERC32_MEC_Timer_Control_Mirror = 0;
- ERC32_MEC.Timer_Control = 0;
-
- ERC32_MEC.Control |= ERC32_CONFIGURATION_POWER_DOWN_ALLOWED;
-
-#endif
-
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- *
- * Input Parameters: NONE
- *
- * Output Parameters:
- * returns the current interrupt level (PIL field of the PSR)
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- unsigned32 level;
-
- sparc_get_interrupt_level( level );
-
- return level;
-}
-
-/*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:
- *
- * On the SPARC, there are really only 256 vectors. However, the executive
- * has no easy, fast, reliable way to determine which traps are synchronous
- * and which are asynchronous. By default, synchronous traps return to the
- * instruction which caused the interrupt. So if you 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.
- *
- * So vectors 0 through 255 are treated as regular asynchronous traps which
- * provide the "correct" return address. Vectors 256 through 512 are assumed
- * by the executive to be synchronous and to require that the return address
- * be fudged.
- *
- * If you use this mechanism to install a trap handler which must reexecute
- * the instruction which caused the trap, then it should be installed as
- * an asynchronous trap. This will avoid the executive changing the return
- * address.
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- unsigned32 real_vector;
- CPU_Trap_table_entry *tbr;
- CPU_Trap_table_entry *slot;
- unsigned32 u32_tbr;
- unsigned32 u32_handler;
-
- /*
- * Get the "real" trap number for this vector ignoring the synchronous
- * versus asynchronous indicator included with our vector numbers.
- */
-
- real_vector = SPARC_REAL_TRAP_NUMBER( vector );
-
- /*
- * Get the current base address of the trap table and calculate a pointer
- * to the slot we are interested in.
- */
-
- sparc_get_tbr( u32_tbr );
-
- u32_tbr &= 0xfffff000;
-
- tbr = (CPU_Trap_table_entry *) u32_tbr;
-
- slot = &tbr[ 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->mov_psr_l0 == _CPU_Trap_slot_template.mov_psr_l0 ) {
- u32_handler =
- ((slot->sethi_of_handler_to_l4 & HIGH_BITS_MASK) << HIGH_BITS_SHIFT) |
- (slot->jmp_to_low_of_handler_plus_l4 & LOW_BITS_MASK);
- *old_handler = (proc_ptr) u32_handler;
- } else
- *old_handler = 0;
-
- /*
- * Copy the template to the slot and then fix it.
- */
-
- *slot = _CPU_Trap_slot_template;
-
- u32_handler = (unsigned32) new_handler;
-
- slot->mov_vector_l3 |= vector;
- slot->sethi_of_handler_to_l4 |=
- (u32_handler & HIGH_BITS_MASK) >> HIGH_BITS_SHIFT;
- slot->jmp_to_low_of_handler_plus_l4 |= (u32_handler & LOW_BITS_MASK);
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_vector
- *
- * This kernel routine installs the RTEMS handler for the
- * specified vector.
- *
- * Input parameters:
- * vector - interrupt vector number
- * new_handler - replacement ISR for this vector number
- * old_handler - pointer to former ISR for this vector number
- *
- * Output parameters:
- * *old_handler - former ISR for this vector number
- *
- */
-
-void _CPU_ISR_install_vector(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- unsigned32 real_vector;
- proc_ptr ignored;
-
- /*
- * Get the "real" trap number for this vector ignoring the synchronous
- * versus asynchronous indicator included with our vector numbers.
- */
-
- real_vector = SPARC_REAL_TRAP_NUMBER( vector );
-
- /*
- * Return the previous ISR handler.
- */
-
- *old_handler = _ISR_Vector_table[ real_vector ];
-
- /*
- * Install the wrapper so this ISR can be invoked properly.
- */
-
- _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[ real_vector ] = new_handler;
-}
-
-/*PAGE
- *
- * _CPU_Context_Initialize
- *
- * This kernel routine initializes the basic non-FP context area associated
- * with each thread.
- *
- * Input parameters:
- * the_context - pointer to the context area
- * stack_base - address of memory for the SPARC
- * size - size in bytes of the stack area
- * new_level - interrupt level for this context area
- * entry_point - the starting execution point for this this context
- * is_fp - TRUE if this context is associated with an FP thread
- *
- * Output parameters: NONE
- */
-
-void _CPU_Context_Initialize(
- Context_Control *the_context,
- unsigned32 *stack_base,
- unsigned32 size,
- unsigned32 new_level,
- void *entry_point,
- boolean is_fp
-)
-{
- unsigned32 stack_high; /* highest "stack aligned" address */
- unsigned32 the_size;
- unsigned32 tmp_psr;
-
- /*
- * On CPUs with stacks which grow down (i.e. SPARC), we build the stack
- * based on the stack_high address.
- */
-
- stack_high = ((unsigned32)(stack_base) + size);
- stack_high &= ~(CPU_STACK_ALIGNMENT - 1);
-
- the_size = size & ~(CPU_STACK_ALIGNMENT - 1);
-
- /*
- * See the README in this directory for a diagram of the stack.
- */
-
- the_context->o7 = ((unsigned32) entry_point) - 8;
- the_context->o6_sp = stack_high - CPU_MINIMUM_STACK_FRAME_SIZE;
- the_context->i6_fp = stack_high;
-
- /*
- * Build the PSR for the task. Most everything can be 0 and the
- * CWP is corrected during the context switch.
- *
- * The EF bit determines if the floating point unit is available.
- * The FPU is ONLY enabled if the context is associated with an FP task
- * and this SPARC model has an FPU.
- */
-
- sparc_get_psr( tmp_psr );
- tmp_psr &= ~SPARC_PSR_PIL_MASK;
- tmp_psr |= (new_level << 8) & SPARC_PSR_PIL_MASK;
- tmp_psr &= ~SPARC_PSR_EF_MASK; /* disabled by default */
-
-#if (SPARC_HAS_FPU == 1)
- /*
- * If this bit is not set, then a task gets a fault when it accesses
- * a floating point register. This is a nice way to detect floating
- * point tasks which are not currently declared as such.
- */
-
- if ( is_fp )
- tmp_psr |= SPARC_PSR_EF_MASK;
-#endif
- the_context->psr = tmp_psr;
-}
-
-/*PAGE
- *
- * _CPU_Thread_Idle_body
- *
- * Some SPARC implementations have low power, sleep, or idle modes. This
- * tries to take advantage of those models.
- */
-
-#if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
-
-/*
- * This is the implementation for the erc32.
- *
- * NOTE: Low power mode was enabled at initialization time.
- */
-
-#if defined(erc32)
-
-void _CPU_Thread_Idle_body( void )
-{
- while (1) {
- ERC32_MEC.Power_Down = 0; /* value is irrelevant */
- }
-}
-
-#endif
-
-#endif /* CPU_PROVIDES_IDLE_THREAD_BODY */
diff --git a/c/src/exec/score/cpu/sparc/cpu.h b/c/src/exec/score/cpu/sparc/cpu.h
deleted file mode 100644
index 592a3a438f..0000000000
--- a/c/src/exec/score/cpu/sparc/cpu.h
+++ /dev/null
@@ -1,1015 +0,0 @@
-/* cpu.h
- *
- * This include file contains information pertaining to the port of
- * the executive to the SPARC processor.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#ifndef __CPU_h
-#define __CPU_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/sparc.h> /* pick up machine definitions */
-#ifndef ASM
-#include <rtems/score/sparctypes.h>
-#endif
-
-/* conditional compilation parameters */
-
-/*
- * Should the calls to _Thread_Enable_dispatch be inlined?
- *
- * If TRUE, then they are inlined.
- * If FALSE, then a subroutine call is made.
- */
-
-#define CPU_INLINE_ENABLE_DISPATCH TRUE
-
-/*
- * Should the body of the search loops in _Thread_queue_Enqueue_priority
- * be unrolled one time? In unrolled each iteration of the loop examines
- * two "nodes" on the chain being searched. Otherwise, only one node
- * is examined per iteration.
- *
- * If TRUE, then the loops are unrolled.
- * If FALSE, then the loops are not unrolled.
- *
- * This parameter could go either way on the SPARC. The interrupt flash
- * code is relatively lengthy given the requirements for nops following
- * writes to the psr. But if the clock speed were high enough, this would
- * not represent a great deal of time.
- */
-
-#define CPU_UNROLL_ENQUEUE_PRIORITY TRUE
-
-/*
- * Does the executive manage a dedicated interrupt stack in software?
- *
- * If TRUE, then a stack is allocated in _Interrupt_Manager_initialization.
- * If FALSE, nothing is done.
- *
- * The SPARC does not have a dedicated HW interrupt stack and one has
- * been implemented in SW.
- */
-
-#define CPU_HAS_SOFTWARE_INTERRUPT_STACK TRUE
-
-/*
- * Does this CPU have hardware support for a dedicated interrupt stack?
- *
- * If TRUE, then it must be installed during initialization.
- * If FALSE, then no installation is performed.
- *
- * The SPARC does not have a dedicated HW interrupt stack.
- */
-
-#define CPU_HAS_HARDWARE_INTERRUPT_STACK FALSE
-
-/*
- * Do we allocate a dedicated interrupt stack in the Interrupt Manager?
- *
- * If TRUE, then the memory is allocated during initialization.
- * If FALSE, then the memory is allocated during initialization.
- */
-
-#define CPU_ALLOCATE_INTERRUPT_STACK TRUE
-
-/*
- * Does the RTEMS invoke the user's ISR with the vector number and
- * a pointer to the saved interrupt frame (1) or just the vector
- * number (0)?
- */
-
-#define CPU_ISR_PASSES_FRAME_POINTER 0
-
-/*
- * Does the CPU have hardware floating point?
- *
- * If TRUE, then the FLOATING_POINT task attribute is supported.
- * If FALSE, then the FLOATING_POINT task attribute is ignored.
- */
-
-#if ( SPARC_HAS_FPU == 1 )
-#define CPU_HARDWARE_FP TRUE
-#else
-#define CPU_HARDWARE_FP FALSE
-#endif
-
-/*
- * Are all tasks FLOATING_POINT tasks implicitly?
- *
- * If TRUE, then the FLOATING_POINT task attribute is assumed.
- * If FALSE, then the FLOATING_POINT task attribute is followed.
- */
-
-#define CPU_ALL_TASKS_ARE_FP FALSE
-
-/*
- * Should the IDLE task have a floating point context?
- *
- * If TRUE, then the IDLE task is created as a FLOATING_POINT task
- * and it has a floating point context which is switched in and out.
- * If FALSE, then the IDLE task does not have a floating point context.
- */
-
-#define CPU_IDLE_TASK_IS_FP FALSE
-
-/*
- * Should the saving of the floating point registers be deferred
- * until a context switch is made to another different floating point
- * task?
- *
- * If TRUE, then the floating point context will not be stored until
- * necessary. It will remain in the floating point registers and not
- * disturned until another floating point task is switched to.
- *
- * If FALSE, then the floating point context is saved when a floating
- * point task is switched out and restored when the next floating point
- * task is restored. The state of the floating point registers between
- * those two operations is not specified.
- */
-
-#define CPU_USE_DEFERRED_FP_SWITCH TRUE
-
-/*
- * Does this port provide a CPU dependent IDLE task implementation?
- *
- * If TRUE, then the routine _CPU_Thread_Idle_body
- * must be provided and is the default IDLE thread body instead of
- * _CPU_Thread_Idle_body.
- *
- * If FALSE, then use the generic IDLE thread body if the BSP does
- * not provide one.
- */
-
-#if (SPARC_HAS_LOW_POWER_MODE == 1)
-#define CPU_PROVIDES_IDLE_THREAD_BODY TRUE
-#else
-#define CPU_PROVIDES_IDLE_THREAD_BODY FALSE
-#endif
-
-/*
- * Does the stack grow up (toward higher addresses) or down
- * (toward lower addresses)?
- *
- * If TRUE, then the grows upward.
- * If FALSE, then the grows toward smaller addresses.
- *
- * The stack grows to lower addresses on the SPARC.
- */
-
-#define CPU_STACK_GROWS_UP FALSE
-
-/*
- * The following is the variable attribute used to force alignment
- * of critical data structures. On some processors it may make
- * sense to have these aligned on tighter boundaries than
- * the minimum requirements of the compiler in order to have as
- * much of the critical data area as possible in a cache line.
- *
- * The SPARC does not appear to have particularly strict alignment
- * requirements. This value was chosen to take advantages of caches.
- */
-
-#define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned (16)))
-
-/*
- * Define what is required to specify how the network to host conversion
- * routines are handled.
- */
-
-#define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE
-#define CPU_BIG_ENDIAN TRUE
-#define CPU_LITTLE_ENDIAN FALSE
-
-/*
- * The following defines the number of bits actually used in the
- * interrupt field of the task mode. How those bits map to the
- * CPU interrupt levels is defined by the routine _CPU_ISR_Set_level().
- *
- * The SPARC has 16 interrupt levels in the PIL field of the PSR.
- */
-
-#define CPU_MODES_INTERRUPT_MASK 0x0000000F
-
-/*
- * This structure represents the organization of the minimum stack frame
- * for the SPARC. More framing information is required in certain situaions
- * such as when there are a large number of out parameters or when the callee
- * must save floating point registers.
- */
-
-#ifndef ASM
-
-typedef struct {
- unsigned32 l0;
- unsigned32 l1;
- unsigned32 l2;
- unsigned32 l3;
- unsigned32 l4;
- unsigned32 l5;
- unsigned32 l6;
- unsigned32 l7;
- unsigned32 i0;
- unsigned32 i1;
- unsigned32 i2;
- unsigned32 i3;
- unsigned32 i4;
- unsigned32 i5;
- unsigned32 i6_fp;
- unsigned32 i7;
- void *structure_return_address;
- /*
- * The following are for the callee to save the register arguments in
- * should this be necessary.
- */
- unsigned32 saved_arg0;
- unsigned32 saved_arg1;
- unsigned32 saved_arg2;
- unsigned32 saved_arg3;
- unsigned32 saved_arg4;
- unsigned32 saved_arg5;
- unsigned32 pad0;
-} CPU_Minimum_stack_frame;
-
-#endif /* ASM */
-
-#define CPU_STACK_FRAME_L0_OFFSET 0x00
-#define CPU_STACK_FRAME_L1_OFFSET 0x04
-#define CPU_STACK_FRAME_L2_OFFSET 0x08
-#define CPU_STACK_FRAME_L3_OFFSET 0x0c
-#define CPU_STACK_FRAME_L4_OFFSET 0x10
-#define CPU_STACK_FRAME_L5_OFFSET 0x14
-#define CPU_STACK_FRAME_L6_OFFSET 0x18
-#define CPU_STACK_FRAME_L7_OFFSET 0x1c
-#define CPU_STACK_FRAME_I0_OFFSET 0x20
-#define CPU_STACK_FRAME_I1_OFFSET 0x24
-#define CPU_STACK_FRAME_I2_OFFSET 0x28
-#define CPU_STACK_FRAME_I3_OFFSET 0x2c
-#define CPU_STACK_FRAME_I4_OFFSET 0x30
-#define CPU_STACK_FRAME_I5_OFFSET 0x34
-#define CPU_STACK_FRAME_I6_FP_OFFSET 0x38
-#define CPU_STACK_FRAME_I7_OFFSET 0x3c
-#define CPU_STRUCTURE_RETURN_ADDRESS_OFFSET 0x40
-#define CPU_STACK_FRAME_SAVED_ARG0_OFFSET 0x44
-#define CPU_STACK_FRAME_SAVED_ARG1_OFFSET 0x48
-#define CPU_STACK_FRAME_SAVED_ARG2_OFFSET 0x4c
-#define CPU_STACK_FRAME_SAVED_ARG3_OFFSET 0x50
-#define CPU_STACK_FRAME_SAVED_ARG4_OFFSET 0x54
-#define CPU_STACK_FRAME_SAVED_ARG5_OFFSET 0x58
-#define CPU_STACK_FRAME_PAD0_OFFSET 0x5c
-
-#define CPU_MINIMUM_STACK_FRAME_SIZE 0x60
-
-/*
- * Contexts
- *
- * Generally there are 2 types of context to save.
- * 1. Interrupt registers to save
- * 2. Task level registers to save
- *
- * This means we have the following 3 context items:
- * 1. task level context stuff:: Context_Control
- * 2. floating point task stuff:: Context_Control_fp
- * 3. special interrupt level context :: Context_Control_interrupt
- *
- * On the SPARC, we are relatively conservative in that we save most
- * of the CPU state in the context area. The ET (enable trap) bit and
- * the CWP (current window pointer) fields of the PSR are considered
- * system wide resources and are not maintained on a per-thread basis.
- */
-
-#ifndef ASM
-
-typedef struct {
- /*
- * Using a double g0_g1 will put everything in this structure on a
- * double word boundary which allows us to use double word loads
- * and stores safely in the context switch.
- */
- double g0_g1;
- unsigned32 g2;
- unsigned32 g3;
- unsigned32 g4;
- unsigned32 g5;
- unsigned32 g6;
- unsigned32 g7;
-
- unsigned32 l0;
- unsigned32 l1;
- unsigned32 l2;
- unsigned32 l3;
- unsigned32 l4;
- unsigned32 l5;
- unsigned32 l6;
- unsigned32 l7;
-
- unsigned32 i0;
- unsigned32 i1;
- unsigned32 i2;
- unsigned32 i3;
- unsigned32 i4;
- unsigned32 i5;
- unsigned32 i6_fp;
- unsigned32 i7;
-
- unsigned32 o0;
- unsigned32 o1;
- unsigned32 o2;
- unsigned32 o3;
- unsigned32 o4;
- unsigned32 o5;
- unsigned32 o6_sp;
- unsigned32 o7;
-
- unsigned32 psr;
-} Context_Control;
-
-#endif /* ASM */
-
-/*
- * Offsets of fields with Context_Control for assembly routines.
- */
-
-#define G0_OFFSET 0x00
-#define G1_OFFSET 0x04
-#define G2_OFFSET 0x08
-#define G3_OFFSET 0x0C
-#define G4_OFFSET 0x10
-#define G5_OFFSET 0x14
-#define G6_OFFSET 0x18
-#define G7_OFFSET 0x1C
-
-#define L0_OFFSET 0x20
-#define L1_OFFSET 0x24
-#define L2_OFFSET 0x28
-#define L3_OFFSET 0x2C
-#define L4_OFFSET 0x30
-#define L5_OFFSET 0x34
-#define L6_OFFSET 0x38
-#define L7_OFFSET 0x3C
-
-#define I0_OFFSET 0x40
-#define I1_OFFSET 0x44
-#define I2_OFFSET 0x48
-#define I3_OFFSET 0x4C
-#define I4_OFFSET 0x50
-#define I5_OFFSET 0x54
-#define I6_FP_OFFSET 0x58
-#define I7_OFFSET 0x5C
-
-#define O0_OFFSET 0x60
-#define O1_OFFSET 0x64
-#define O2_OFFSET 0x68
-#define O3_OFFSET 0x6C
-#define O4_OFFSET 0x70
-#define O5_OFFSET 0x74
-#define O6_SP_OFFSET 0x78
-#define O7_OFFSET 0x7C
-
-#define PSR_OFFSET 0x80
-
-#define CONTEXT_CONTROL_SIZE 0x84
-
-/*
- * The floating point context area.
- */
-
-#ifndef ASM
-
-typedef struct {
- double f0_f1;
- double f2_f3;
- double f4_f5;
- double f6_f7;
- double f8_f9;
- double f10_f11;
- double f12_f13;
- double f14_f15;
- double f16_f17;
- double f18_f19;
- double f20_f21;
- double f22_f23;
- double f24_f25;
- double f26_f27;
- double f28_f29;
- double f30_f31;
- unsigned32 fsr;
-} Context_Control_fp;
-
-#endif /* ASM */
-
-/*
- * Offsets of fields with Context_Control_fp for assembly routines.
- */
-
-#define FO_F1_OFFSET 0x00
-#define F2_F3_OFFSET 0x08
-#define F4_F5_OFFSET 0x10
-#define F6_F7_OFFSET 0x18
-#define F8_F9_OFFSET 0x20
-#define F1O_F11_OFFSET 0x28
-#define F12_F13_OFFSET 0x30
-#define F14_F15_OFFSET 0x38
-#define F16_F17_OFFSET 0x40
-#define F18_F19_OFFSET 0x48
-#define F2O_F21_OFFSET 0x50
-#define F22_F23_OFFSET 0x58
-#define F24_F25_OFFSET 0x60
-#define F26_F27_OFFSET 0x68
-#define F28_F29_OFFSET 0x70
-#define F3O_F31_OFFSET 0x78
-#define FSR_OFFSET 0x80
-
-#define CONTEXT_CONTROL_FP_SIZE 0x84
-
-#ifndef ASM
-
-/*
- * Context saved on stack for an interrupt.
- *
- * NOTE: The PSR, PC, and NPC are only saved in this structure for the
- * benefit of the user's handler.
- */
-
-typedef struct {
- CPU_Minimum_stack_frame Stack_frame;
- unsigned32 psr;
- unsigned32 pc;
- unsigned32 npc;
- unsigned32 g1;
- unsigned32 g2;
- unsigned32 g3;
- unsigned32 g4;
- unsigned32 g5;
- unsigned32 g6;
- unsigned32 g7;
- unsigned32 i0;
- unsigned32 i1;
- unsigned32 i2;
- unsigned32 i3;
- unsigned32 i4;
- unsigned32 i5;
- unsigned32 i6_fp;
- unsigned32 i7;
- unsigned32 y;
- unsigned32 pad0_offset;
-} CPU_Interrupt_frame;
-
-#endif /* ASM */
-
-/*
- * Offsets of fields with CPU_Interrupt_frame for assembly routines.
- */
-
-#define ISF_STACK_FRAME_OFFSET 0x00
-#define ISF_PSR_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x00
-#define ISF_PC_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x04
-#define ISF_NPC_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x08
-#define ISF_G1_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x0c
-#define ISF_G2_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x10
-#define ISF_G3_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x14
-#define ISF_G4_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x18
-#define ISF_G5_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x1c
-#define ISF_G6_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x20
-#define ISF_G7_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x24
-#define ISF_I0_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x28
-#define ISF_I1_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x2c
-#define ISF_I2_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x30
-#define ISF_I3_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x34
-#define ISF_I4_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x38
-#define ISF_I5_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x3c
-#define ISF_I6_FP_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x40
-#define ISF_I7_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x44
-#define ISF_Y_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x48
-#define ISF_PAD0_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x4c
-
-#define CONTEXT_CONTROL_INTERRUPT_FRAME_SIZE CPU_MINIMUM_STACK_FRAME_SIZE + 0x50
-#ifndef ASM
-
-/*
- * The following table contains the information required to configure
- * the processor specific parameters.
- */
-
-typedef struct {
- void (*pretasking_hook)( void );
- void (*predriver_hook)( void );
- void (*postdriver_hook)( void );
- void (*idle_task)( void );
- boolean do_zero_of_workspace;
- unsigned32 idle_task_stack_size;
- unsigned32 interrupt_stack_size;
- unsigned32 extra_mpci_receive_server_stack;
- void * (*stack_allocate_hook)( unsigned32 );
- void (*stack_free_hook)( void* );
- /* end of fields required on all CPUs */
-
-} rtems_cpu_table;
-
-/*
- * This variable is contains the initialize context for the FP unit.
- * It is filled in by _CPU_Initialize and copied into the task's FP
- * context area during _CPU_Context_Initialize.
- */
-
-SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context CPU_STRUCTURE_ALIGNMENT;
-
-/*
- * This stack is allocated by the Interrupt Manager and the switch
- * is performed in _ISR_Handler. These variables contain pointers
- * to the lowest and highest addresses in the chunk of memory allocated
- * for the interrupt stack. Since it is unknown whether the stack
- * grows up or down (in general), this give the CPU dependent
- * code the option of picking the version it wants to use. Thus
- * both must be present if either is.
- *
- * The SPARC supports a software based interrupt stack and these
- * are required.
- */
-
-SCORE_EXTERN void *_CPU_Interrupt_stack_low;
-SCORE_EXTERN void *_CPU_Interrupt_stack_high;
-
-#if defined(erc32)
-
-/*
- * ERC32 Specific Variables
- */
-
-SCORE_EXTERN unsigned32 _ERC32_MEC_Timer_Control_Mirror;
-
-#endif
-
-/*
- * The following type defines an entry in the SPARC's trap table.
- *
- * NOTE: The instructions chosen are RTEMS dependent although one is
- * obligated to use two of the four instructions to perform a
- * long jump. The other instructions load one register with the
- * trap type (a.k.a. vector) and another with the psr.
- */
-
-typedef struct {
- unsigned32 mov_psr_l0; /* mov %psr, %l0 */
- unsigned32 sethi_of_handler_to_l4; /* sethi %hi(_handler), %l4 */
- unsigned32 jmp_to_low_of_handler_plus_l4; /* jmp %l4 + %lo(_handler) */
- unsigned32 mov_vector_l3; /* mov _vector, %l3 */
-} CPU_Trap_table_entry;
-
-/*
- * This is the set of opcodes for the instructions loaded into a trap
- * table entry. The routine which installs a handler is responsible
- * for filling in the fields for the _handler address and the _vector
- * trap type.
- *
- * The constants following this structure are masks for the fields which
- * must be filled in when the handler is installed.
- */
-
-extern const CPU_Trap_table_entry _CPU_Trap_slot_template;
-
-/*
- * This is the executive's trap table which is installed into the TBR
- * register.
- *
- * NOTE: Unfortunately, this must be aligned on a 4096 byte boundary.
- * The GNU tools as of binutils 2.5.2 and gcc 2.7.0 would not
- * align an entity to anything greater than a 512 byte boundary.
- *
- * Because of this, we pull a little bit of a trick. We allocate
- * enough memory so we can grab an address on a 4096 byte boundary
- * from this area.
- */
-
-#define SPARC_TRAP_TABLE_ALIGNMENT 4096
-
-#ifndef NO_TABLE_MOVE
-
-SCORE_EXTERN unsigned8 _CPU_Trap_Table_area[ 8192 ]
- __attribute__ ((aligned (SPARC_TRAP_TABLE_ALIGNMENT)));
-#endif
-
-
-/*
- * The size of the floating point context area.
- */
-
-#define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp )
-
-#endif
-
-/*
- * Amount of extra stack (above minimum stack size) required by
- * MPCI receive server thread. Remember that in a multiprocessor
- * system this thread must exist and be able to process all directives.
- */
-
-#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 1024
-
-/*
- * This defines the number of entries in the ISR_Vector_table managed
- * by the executive.
- *
- * On the SPARC, there are really only 256 vectors. However, the executive
- * has no easy, fast, reliable way to determine which traps are synchronous
- * and which are asynchronous. By default, synchronous traps return to the
- * instruction which caused the interrupt. So if you 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.
- *
- * So vectors 0 through 255 are treated as regular asynchronous traps which
- * provide the "correct" return address. Vectors 256 through 512 are assumed
- * by the executive to be synchronous and to require that the return address
- * be fudged.
- *
- * If you use this mechanism to install a trap handler which must reexecute
- * the instruction which caused the trap, then it should be installed as
- * an asynchronous trap. This will avoid the executive changing the return
- * address.
- */
-
-#define CPU_INTERRUPT_NUMBER_OF_VECTORS 256
-#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER 511
-
-#define SPARC_SYNCHRONOUS_TRAP_BIT_MASK 0x100
-#define SPARC_ASYNCHRONOUS_TRAP( _trap ) (_trap)
-#define SPARC_SYNCHRONOUS_TRAP( _trap ) ((_trap) + 256 )
-
-#define SPARC_REAL_TRAP_NUMBER( _trap ) ((_trap) % 256)
-
-/*
- * Should be large enough to run all tests. This insures
- * that a "reasonable" small application should not have any problems.
- *
- * This appears to be a fairly generous number for the SPARC since
- * represents a call depth of about 20 routines based on the minimum
- * stack frame.
- */
-
-#define CPU_STACK_MINIMUM_SIZE (1024*2 + 512)
-
-/*
- * CPU's worst alignment requirement for data types on a byte boundary. This
- * alignment does not take into account the requirements for the stack.
- *
- * On the SPARC, this is required for double word loads and stores.
- */
-
-#define CPU_ALIGNMENT 8
-
-/*
- * This number corresponds to the byte alignment requirement for the
- * heap handler. This alignment requirement may be stricter than that
- * for the data types alignment specified by CPU_ALIGNMENT. It is
- * common for the heap to follow the same alignment requirement as
- * CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict enough for the heap,
- * then this should be set to CPU_ALIGNMENT.
- *
- * NOTE: This does not have to be a power of 2. It does have to
- * be greater or equal to than CPU_ALIGNMENT.
- */
-
-#define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * This number corresponds to the byte alignment requirement for memory
- * buffers allocated by the partition manager. This alignment requirement
- * may be stricter than that for the data types alignment specified by
- * CPU_ALIGNMENT. It is common for the partition to follow the same
- * alignment requirement as CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict
- * enough for the partition, then this should be set to CPU_ALIGNMENT.
- *
- * NOTE: This does not have to be a power of 2. It does have to
- * be greater or equal to than CPU_ALIGNMENT.
- */
-
-#define CPU_PARTITION_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * This number corresponds to the byte alignment requirement for the
- * stack. This alignment requirement may be stricter than that for the
- * data types alignment specified by CPU_ALIGNMENT. If the CPU_ALIGNMENT
- * is strict enough for the stack, then this should be set to 0.
- *
- * NOTE: This must be a power of 2 either 0 or greater than CPU_ALIGNMENT.
- *
- * The alignment restrictions for the SPARC are not that strict but this
- * should unsure that the stack is always sufficiently alignment that the
- * window overflow, underflow, and flush routines can use double word loads
- * and stores.
- */
-
-#define CPU_STACK_ALIGNMENT 16
-
-#ifndef ASM
-
-/* ISR handler macros */
-
-/*
- * Disable all interrupts for a critical section. The previous
- * level is returned in _level.
- */
-
-#define _CPU_ISR_Disable( _level ) \
- sparc_disable_interrupts( _level )
-
-/*
- * Enable interrupts to the previous level (returned by _CPU_ISR_Disable).
- * This indicates the end of a critical section. The parameter
- * _level is not modified.
- */
-
-#define _CPU_ISR_Enable( _level ) \
- sparc_enable_interrupts( _level )
-
-/*
- * This temporarily restores the interrupt to _level before immediately
- * disabling them again. This is used to divide long critical
- * sections into two or more parts. The parameter _level is not
- * modified.
- */
-
-#define _CPU_ISR_Flash( _level ) \
- sparc_flash_interrupts( _level )
-
-/*
- * Map interrupt level in task mode onto the hardware that the CPU
- * actually provides. Currently, interrupt levels which do not
- * map onto the CPU in a straight fashion are undefined.
- */
-
-#define _CPU_ISR_Set_level( _newlevel ) \
- sparc_set_interrupt_level( _newlevel )
-
-unsigned32 _CPU_ISR_Get_level( void );
-
-/* end of ISR handler macros */
-
-/* Context handler macros */
-
-/*
- * Initialize the context to a state suitable for starting a
- * task after a context restore operation. Generally, this
- * involves:
- *
- * - setting a starting address
- * - preparing the stack
- * - preparing the stack and frame pointers
- * - setting the proper interrupt level in the context
- * - initializing the floating point context
- *
- * NOTE: Implemented as a subroutine for the SPARC port.
- */
-
-void _CPU_Context_Initialize(
- Context_Control *the_context,
- unsigned32 *stack_base,
- unsigned32 size,
- unsigned32 new_level,
- void *entry_point,
- boolean is_fp
-);
-
-/*
- * This routine is responsible for somehow restarting the currently
- * executing task.
- *
- * On the SPARC, this is is relatively painless but requires a small
- * amount of wrapper code before using the regular restore code in
- * of the context switch.
- */
-
-#define _CPU_Context_Restart_self( _the_context ) \
- _CPU_Context_restore( (_the_context) );
-
-/*
- * The FP context area for the SPARC is a simple structure and nothing
- * special is required to find the "starting load point"
- */
-
-#define _CPU_Context_Fp_start( _base, _offset ) \
- ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
-
-/*
- * This routine initializes the FP context area passed to it to.
- *
- * The SPARC allows us to use the simple initialization model
- * in which an "initial" FP context was saved into _CPU_Null_fp_context
- * at CPU initialization and it is simply copied into the destination
- * context.
- */
-
-#define _CPU_Context_Initialize_fp( _destination ) \
- do { \
- *((Context_Control_fp *) *((void **) _destination)) = _CPU_Null_fp_context; \
- } while (0)
-
-/* end of Context handler macros */
-
-/* Fatal Error manager macros */
-
-/*
- * This routine copies _error into a known place -- typically a stack
- * location or a register, optionally disables interrupts, and
- * halts/stops the CPU.
- */
-
-#define _CPU_Fatal_halt( _error ) \
- do { \
- unsigned32 level; \
- \
- sparc_disable_interrupts( level ); \
- asm volatile ( "mov %0, %%g1 " : "=r" (level) : "0" (level) ); \
- while (1); /* loop forever */ \
- } while (0)
-
-/* end of Fatal Error manager macros */
-
-/* Bitfield handler macros */
-
-/*
- * The SPARC port uses the generic C algorithm for bitfield scan if the
- * CPU model does not have a scan instruction.
- */
-
-#if ( SPARC_HAS_BITSCAN == 0 )
-#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
-#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
-#else
-#error "scan instruction not currently supported by RTEMS!!"
-#endif
-
-/* end of Bitfield handler macros */
-
-/* Priority handler handler macros */
-
-/*
- * The SPARC port uses the generic C algorithm for bitfield scan if the
- * CPU model does not have a scan instruction.
- */
-
-#if ( SPARC_HAS_BITSCAN == 1 )
-#error "scan instruction not currently supported by RTEMS!!"
-#endif
-
-/* end of Priority handler macros */
-
-/* functions */
-
-/*
- * _CPU_Initialize
- *
- * This routine performs CPU dependent initialization.
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch)
-);
-
-/*
- * _CPU_ISR_install_raw_handler
- *
- * This routine installs new_handler to be directly called from the trap
- * table.
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_ISR_install_vector
- *
- * This routine installs an interrupt vector.
- */
-
-void _CPU_ISR_install_vector(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-#if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
-
-/*
- * _CPU_Thread_Idle_body
- *
- * Some SPARC implementations have low power, sleep, or idle modes. This
- * tries to take advantage of those models.
- */
-
-void _CPU_Thread_Idle_body( void );
-
-#endif /* CPU_PROVIDES_IDLE_THREAD_BODY */
-
-/*
- * _CPU_Context_switch
- *
- * This routine switches from the run context to the heir context.
- */
-
-void _CPU_Context_switch(
- Context_Control *run,
- Context_Control *heir
-);
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally used only to restart self in an
- * efficient manner.
- */
-
-void _CPU_Context_restore(
- Context_Control *new_context
-);
-
-/*
- * _CPU_Context_save_fp
- *
- * This routine saves the floating point context passed to it.
- */
-
-void _CPU_Context_save_fp(
- void **fp_context_ptr
-);
-
-/*
- * _CPU_Context_restore_fp
- *
- * This routine restores the floating point context passed to it.
- */
-
-void _CPU_Context_restore_fp(
- void **fp_context_ptr
-);
-
-/*
- * CPU_swap_u32
- *
- * The following routine swaps the endian format of an unsigned int.
- * It must be static because it is referenced indirectly.
- *
- * This version will work on any processor, but if you come across a better
- * way for the SPARC PLEASE use it. The most common way to swap a 32-bit
- * entity as shown below is not any more efficient on the SPARC.
- *
- * swap least significant two bytes with 16-bit rotate
- * swap upper and lower 16-bits
- * swap most significant two bytes with 16-bit rotate
- *
- * It is not obvious how the SPARC can do significantly better than the
- * generic code. gcc 2.7.0 only generates about 12 instructions for the
- * following code at optimization level four (i.e. -O4).
- */
-
-static inline unsigned int CPU_swap_u32(
- unsigned int value
-)
-{
- unsigned32 byte1, byte2, byte3, byte4, swapped;
-
- byte4 = (value >> 24) & 0xff;
- byte3 = (value >> 16) & 0xff;
- byte2 = (value >> 8) & 0xff;
- byte1 = value & 0xff;
-
- swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4;
- return( swapped );
-}
-
-#define CPU_swap_u16( value ) \
- (((value&0xff) << 8) | ((value >> 8)&0xff))
-
-#endif ASM
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/exec/score/cpu/sparc/cpu_asm.s b/c/src/exec/score/cpu/sparc/cpu_asm.s
deleted file mode 100644
index 39962eedeb..0000000000
--- a/c/src/exec/score/cpu/sparc/cpu_asm.s
+++ /dev/null
@@ -1,726 +0,0 @@
-/* cpu_asm.s
- *
- * This file contains the basic algorithms for all assembly code used
- * in an specific CPU port of RTEMS. These algorithms must be implemented
- * in assembly language.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#include <asm.h>
-
-#if (SPARC_HAS_FPU == 1)
-
-/*
- * void _CPU_Context_save_fp(
- * void **fp_context_ptr
- * )
- *
- * 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.
- *
- * NOTE: See the README in this directory for information on the
- * management of the "EF" bit in the PSR.
- */
-
- .align 4
- PUBLIC(_CPU_Context_save_fp)
-SYM(_CPU_Context_save_fp):
- save %sp, -CPU_MINIMUM_STACK_FRAME_SIZE, %sp
-
- /*
- * The following enables the floating point unit.
- */
-
- mov %psr, %l0
- sethi %hi(SPARC_PSR_EF_MASK), %l1
- or %l1, %lo(SPARC_PSR_EF_MASK), %l1
- or %l0, %l1, %l0
- mov %l0, %psr ! **** ENABLE FLOAT ACCESS ****
-
- ld [%i0], %l0
- std %f0, [%l0 + FO_F1_OFFSET]
- std %f2, [%l0 + F2_F3_OFFSET]
- std %f4, [%l0 + F4_F5_OFFSET]
- std %f6, [%l0 + F6_F7_OFFSET]
- std %f8, [%l0 + F8_F9_OFFSET]
- std %f10, [%l0 + F1O_F11_OFFSET]
- std %f12, [%l0 + F12_F13_OFFSET]
- std %f14, [%l0 + F14_F15_OFFSET]
- std %f16, [%l0 + F16_F17_OFFSET]
- std %f18, [%l0 + F18_F19_OFFSET]
- std %f20, [%l0 + F2O_F21_OFFSET]
- std %f22, [%l0 + F22_F23_OFFSET]
- std %f24, [%l0 + F24_F25_OFFSET]
- std %f26, [%l0 + F26_F27_OFFSET]
- std %f28, [%l0 + F28_F29_OFFSET]
- std %f30, [%l0 + F3O_F31_OFFSET]
- st %fsr, [%l0 + FSR_OFFSET]
- ret
- restore
-
-/*
- * void _CPU_Context_restore_fp(
- * void **fp_context_ptr
- * )
- *
- * 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.
- *
- * NOTE: See the README in this directory for information on the
- * management of the "EF" bit in the PSR.
- */
-
- .align 4
- PUBLIC(_CPU_Context_restore_fp)
-SYM(_CPU_Context_restore_fp):
- save %sp, -CPU_MINIMUM_STACK_FRAME_SIZE , %sp
-
- /*
- * The following enables the floating point unit.
- */
-
- mov %psr, %l0
- sethi %hi(SPARC_PSR_EF_MASK), %l1
- or %l1, %lo(SPARC_PSR_EF_MASK), %l1
- or %l0, %l1, %l0
- mov %l0, %psr ! **** ENABLE FLOAT ACCESS ****
-
- ld [%i0], %l0
- ldd [%l0 + FO_F1_OFFSET], %f0
- ldd [%l0 + F2_F3_OFFSET], %f2
- ldd [%l0 + F4_F5_OFFSET], %f4
- ldd [%l0 + F6_F7_OFFSET], %f6
- ldd [%l0 + F8_F9_OFFSET], %f8
- ldd [%l0 + F1O_F11_OFFSET], %f10
- ldd [%l0 + F12_F13_OFFSET], %f12
- ldd [%l0 + F14_F15_OFFSET], %f14
- ldd [%l0 + F16_F17_OFFSET], %f16
- ldd [%l0 + F18_F19_OFFSET], %f18
- ldd [%l0 + F2O_F21_OFFSET], %f20
- ldd [%l0 + F22_F23_OFFSET], %f22
- ldd [%l0 + F24_F25_OFFSET], %f24
- ldd [%l0 + F26_F27_OFFSET], %f26
- ldd [%l0 + F28_F29_OFFSET], %f28
- ldd [%l0 + F3O_F31_OFFSET], %f30
- ld [%l0 + FSR_OFFSET], %fsr
- ret
- restore
-
-#endif /* SPARC_HAS_FPU */
-
-/*
- * void _CPU_Context_switch(
- * Context_Control *run,
- * Context_Control *heir
- * )
- *
- * This routine performs a normal non-FP context switch.
- */
-
- .align 4
- PUBLIC(_CPU_Context_switch)
-SYM(_CPU_Context_switch):
- ! skip g0
- st %g1, [%o0 + G1_OFFSET] ! save the global registers
- std %g2, [%o0 + G2_OFFSET]
- std %g4, [%o0 + G4_OFFSET]
- std %g6, [%o0 + G6_OFFSET]
-
- std %l0, [%o0 + L0_OFFSET] ! save the local registers
- std %l2, [%o0 + L2_OFFSET]
- std %l4, [%o0 + L4_OFFSET]
- std %l6, [%o0 + L6_OFFSET]
-
- std %i0, [%o0 + I0_OFFSET] ! save the input registers
- std %i2, [%o0 + I2_OFFSET]
- std %i4, [%o0 + I4_OFFSET]
- std %i6, [%o0 + I6_FP_OFFSET]
-
- std %o0, [%o0 + O0_OFFSET] ! save the output registers
- std %o2, [%o0 + O2_OFFSET]
- std %o4, [%o0 + O4_OFFSET]
- std %o6, [%o0 + O6_SP_OFFSET]
-
- rd %psr, %o2
- st %o2, [%o0 + PSR_OFFSET] ! save status register
-
- /*
- * This is entered from _CPU_Context_restore with:
- * o1 = context to restore
- * o2 = psr
- */
-
- PUBLIC(_CPU_Context_restore_heir)
-SYM(_CPU_Context_restore_heir):
- /*
- * Flush all windows with valid contents except the current one.
- * In examining the set register windows, one may logically divide
- * the windows into sets (some of which may be empty) based on their
- * current status:
- *
- * + current (i.e. in use),
- * + used (i.e. a restore would not trap)
- * + invalid (i.e. 1 in corresponding bit in WIM)
- * + unused
- *
- * Either the used or unused set of windows may be empty.
- *
- * NOTE: We assume only one bit is set in the WIM at a time.
- *
- * Given a CWP of 5 and a WIM of 0x1, the registers are divided
- * into sets as follows:
- *
- * + 0 - invalid
- * + 1-4 - unused
- * + 5 - current
- * + 6-7 - used
- *
- * In this case, we only would save the used windows -- 6 and 7.
- *
- * Traps are disabled for the same logical period as in a
- * flush all windows trap handler.
- *
- * Register Usage while saving the windows:
- * g1 = current PSR
- * g2 = current wim
- * g3 = CWP
- * g4 = wim scratch
- * g5 = scratch
- */
-
- ld [%o1 + PSR_OFFSET], %g1 ! g1 = saved psr
-
- and %o2, SPARC_PSR_CWP_MASK, %g3 ! g3 = CWP
- ! g1 = psr w/o cwp
- andn %g1, SPARC_PSR_ET_MASK | SPARC_PSR_CWP_MASK, %g1
- or %g1, %g3, %g1 ! g1 = heirs psr
- mov %g1, %psr ! restore status register and
- ! **** DISABLE TRAPS ****
- mov %wim, %g2 ! g2 = wim
- mov 1, %g4
- sll %g4, %g3, %g4 ! g4 = WIM mask for CW invalid
-
-save_frame_loop:
- sll %g4, 1, %g5 ! rotate the "wim" left 1
- srl %g4, SPARC_NUMBER_OF_REGISTER_WINDOWS - 1, %g4
- or %g4, %g5, %g4 ! g4 = wim if we do one restore
-
- /*
- * If a restore would not underflow, then continue.
- */
-
- andcc %g4, %g2, %g0 ! Any windows to flush?
- bnz done_flushing ! No, then continue
- nop
-
- restore ! back one window
-
- /*
- * Now save the window just as if we overflowed to it.
- */
-
- std %l0, [%sp + CPU_STACK_FRAME_L0_OFFSET]
- std %l2, [%sp + CPU_STACK_FRAME_L2_OFFSET]
- std %l4, [%sp + CPU_STACK_FRAME_L4_OFFSET]
- std %l6, [%sp + CPU_STACK_FRAME_L6_OFFSET]
-
- std %i0, [%sp + CPU_STACK_FRAME_I0_OFFSET]
- std %i2, [%sp + CPU_STACK_FRAME_I2_OFFSET]
- std %i4, [%sp + CPU_STACK_FRAME_I4_OFFSET]
- std %i6, [%sp + CPU_STACK_FRAME_I6_FP_OFFSET]
-
- ba save_frame_loop
- nop
-
-done_flushing:
-
- add %g3, 1, %g3 ! calculate desired WIM
- and %g3, SPARC_NUMBER_OF_REGISTER_WINDOWS - 1, %g3
- mov 1, %g4
- sll %g4, %g3, %g4 ! g4 = new WIM
- mov %g4, %wim
-
- or %g1, SPARC_PSR_ET_MASK, %g1
- mov %g1, %psr ! **** ENABLE TRAPS ****
- ! and restore CWP
- nop
- nop
- nop
-
- ! skip g0
- ld [%o1 + G1_OFFSET], %g1 ! restore the global registers
- ldd [%o1 + G2_OFFSET], %g2
- ldd [%o1 + G4_OFFSET], %g4
- ldd [%o1 + G6_OFFSET], %g6
-
- ldd [%o1 + L0_OFFSET], %l0 ! restore the local registers
- ldd [%o1 + L2_OFFSET], %l2
- ldd [%o1 + L4_OFFSET], %l4
- ldd [%o1 + L6_OFFSET], %l6
-
- ldd [%o1 + I0_OFFSET], %i0 ! restore the output registers
- ldd [%o1 + I2_OFFSET], %i2
- ldd [%o1 + I4_OFFSET], %i4
- ldd [%o1 + I6_FP_OFFSET], %i6
-
- ldd [%o1 + O2_OFFSET], %o2 ! restore the output registers
- ldd [%o1 + O4_OFFSET], %o4
- ldd [%o1 + O6_SP_OFFSET], %o6
- ! do o0/o1 last to avoid destroying heir context pointer
- ldd [%o1 + O0_OFFSET], %o0 ! overwrite heir pointer
-
- jmp %o7 + 8 ! return
- nop ! delay slot
-
-/*
- * void _CPU_Context_restore(
- * Context_Control *new_context
- * )
- *
- * This routine is generally used only to perform restart self.
- *
- * NOTE: It is unnecessary to reload some registers.
- */
-
- .align 4
- PUBLIC(_CPU_Context_restore)
-SYM(_CPU_Context_restore):
- save %sp, -CPU_MINIMUM_STACK_FRAME_SIZE, %sp
- rd %psr, %o2
- ba SYM(_CPU_Context_restore_heir)
- mov %i0, %o1 ! in the delay slot
-
-/*
- * void _ISR_Handler()
- *
- * This routine provides the RTEMS interrupt management.
- *
- * We enter this handler from the 4 instructions in the trap table with
- * the following registers assumed to be set as shown:
- *
- * l0 = PSR
- * l1 = PC
- * l2 = nPC
- * l3 = trap type
- *
- * NOTE: By an executive defined convention, trap type is between 0 and 255 if
- * it is an asynchonous trap and 256 and 511 if it is synchronous.
- */
-
- .align 4
- PUBLIC(_ISR_Handler)
-SYM(_ISR_Handler):
- /*
- * Fix the return address for synchronous traps.
- */
-
- andcc %l3, SPARC_SYNCHRONOUS_TRAP_BIT_MASK, %g0
- ! Is this a synchronous trap?
- be,a win_ovflow ! No, then skip the adjustment
- nop ! DELAY
- mov %l2, %l1 ! do not return to the instruction
- add %l2, 4, %l2 ! indicated
-
-win_ovflow:
- /*
- * Save the globals this block uses.
- *
- * These registers are not restored from the locals. Their contents
- * are saved directly from the locals into the ISF below.
- */
-
- mov %g4, %l4 ! save the globals this block uses
- mov %g5, %l5
-
- /*
- * When at a "window overflow" trap, (wim == (1 << cwp)).
- * If we get here like that, then process a window overflow.
- */
-
- rd %wim, %g4
- srl %g4, %l0, %g5 ! g5 = win >> cwp ; shift count and CWP
- ! are LS 5 bits ; how convenient :)
- cmp %g5, 1 ! Is this an invalid window?
- bne dont_do_the_window ! No, then skip all this stuff
- ! we are using the delay slot
-
- /*
- * The following is same as a 1 position right rotate of WIM
- */
-
- srl %g4, 1, %g5 ! g5 = WIM >> 1
- sll %g4, SPARC_NUMBER_OF_REGISTER_WINDOWS-1 , %g4
- ! g4 = WIM << (Number Windows - 1)
- or %g4, %g5, %g4 ! g4 = (WIM >> 1) |
- ! (WIM << (Number Windows - 1))
-
- /*
- * At this point:
- *
- * g4 = the new WIM
- * g5 is free
- */
-
- /*
- * Since we are tinkering with the register windows, we need to
- * make sure that all the required information is in global registers.
- */
-
- save ! Save into the window
- wr %g4, 0, %wim ! WIM = new WIM
- nop ! delay slots
- nop
- nop
-
- /*
- * Now save the window just as if we overflowed to it.
- */
-
- std %l0, [%sp + CPU_STACK_FRAME_L0_OFFSET]
- std %l2, [%sp + CPU_STACK_FRAME_L2_OFFSET]
- std %l4, [%sp + CPU_STACK_FRAME_L4_OFFSET]
- std %l6, [%sp + CPU_STACK_FRAME_L6_OFFSET]
-
- std %i0, [%sp + CPU_STACK_FRAME_I0_OFFSET]
- std %i2, [%sp + CPU_STACK_FRAME_I2_OFFSET]
- std %i4, [%sp + CPU_STACK_FRAME_I4_OFFSET]
- std %i6, [%sp + CPU_STACK_FRAME_I6_FP_OFFSET]
-
- restore
- nop
-
-dont_do_the_window:
- /*
- * Global registers %g4 and %g5 are saved directly from %l4 and
- * %l5 directly into the ISF below.
- */
-
-save_isf:
-
- /*
- * Save the state of the interrupted task -- especially the global
- * registers -- in the Interrupt Stack Frame. Note that the ISF
- * includes a regular minimum stack frame which will be used if
- * needed by register window overflow and underflow handlers.
- *
- * REGISTERS SAME AS AT _ISR_Handler
- */
-
- sub %fp, CONTEXT_CONTROL_INTERRUPT_FRAME_SIZE, %sp
- ! make space for ISF
-
- std %l0, [%sp + ISF_PSR_OFFSET] ! save psr, PC
- st %l2, [%sp + ISF_NPC_OFFSET] ! save nPC
- st %g1, [%sp + ISF_G1_OFFSET] ! save g1
- std %g2, [%sp + ISF_G2_OFFSET] ! save g2, g3
- std %l4, [%sp + ISF_G4_OFFSET] ! save g4, g5 -- see above
- std %g6, [%sp + ISF_G6_OFFSET] ! save g6, g7
-
- std %i0, [%sp + ISF_I0_OFFSET] ! save i0, i1
- std %i2, [%sp + ISF_I2_OFFSET] ! save i2, i3
- std %i4, [%sp + ISF_I4_OFFSET] ! save i4, i5
- std %i6, [%sp + ISF_I6_FP_OFFSET] ! save i6/fp, i7
-
- rd %y, %g1
- st %g1, [%sp + ISF_Y_OFFSET] ! save y
-
- mov %sp, %o1 ! 2nd arg to ISR Handler
-
- /*
- * Increment ISR nest level and Thread dispatch disable level.
- *
- * Register usage for this section:
- *
- * l4 = _Thread_Dispatch_disable_level pointer
- * l5 = _ISR_Nest_level pointer
- * l6 = _Thread_Dispatch_disable_level value
- * l7 = _ISR_Nest_level value
- *
- * NOTE: It is assumed that l4 - l7 will be preserved until the ISR
- * nest and thread dispatch disable levels are unnested.
- */
-
- sethi %hi(SYM(_Thread_Dispatch_disable_level)), %l4
- ld [%l4 + %lo(SYM(_Thread_Dispatch_disable_level))], %l6
- sethi %hi(SYM(_ISR_Nest_level)), %l5
- ld [%l5 + %lo(SYM(_ISR_Nest_level))], %l7
-
- add %l6, 1, %l6
- st %l6, [%l4 + %lo(SYM(_Thread_Dispatch_disable_level))]
-
- add %l7, 1, %l7
- st %l7, [%l5 + %lo(SYM(_ISR_Nest_level))]
-
- /*
- * If ISR nest level was zero (now 1), then switch stack.
- */
-
- mov %sp, %fp
- subcc %l7, 1, %l7 ! outermost interrupt handler?
- bnz dont_switch_stacks ! No, then do not switch stacks
-
- sethi %hi(SYM(_CPU_Interrupt_stack_high)), %g4
- ld [%g4 + %lo(SYM(_CPU_Interrupt_stack_high))], %sp
-
-dont_switch_stacks:
- /*
- * Make sure we have a place on the stack for the window overflow
- * trap handler to write into. At this point it is safe to
- * enable traps again.
- */
-
- sub %sp, CPU_MINIMUM_STACK_FRAME_SIZE, %sp
-
- /*
- * Check if we have an external interrupt (trap 0x11 - 0x1f). If so,
- * set the PIL in the %psr to mask off interrupts with lower priority.
- * The original %psr in %l0 is not modified since it will be restored
- * when the interrupt handler returns.
- */
-
- mov %l0, %g5
- subcc %l3, 0x11, %g0
- bl dont_fix_pil
- subcc %l3, 0x1f, %g0
- bg dont_fix_pil
- sll %l3, 8, %g4
- and %g4, SPARC_PSR_PIL_MASK, %g4
- andn %l0, SPARC_PSR_PIL_MASK, %g5
- or %g4, %g5, %g5
-dont_fix_pil:
- wr %g5, SPARC_PSR_ET_MASK, %psr ! **** ENABLE TRAPS ****
-
- /*
- * Vector to user's handler.
- *
- * NOTE: TBR may no longer have vector number in it since
- * we just enabled traps. It is definitely in l3.
- */
-
- sethi %hi(SYM(_ISR_Vector_table)), %g4
- or %g4, %lo(SYM(_ISR_Vector_table)), %g4
- and %l3, 0xFF, %g5 ! remove synchronous trap indicator
- sll %g5, 2, %g5 ! g5 = offset into table
- ld [%g4 + %g5], %g4 ! g4 = _ISR_Vector_table[ vector ]
-
-
- ! o1 = 2nd arg = address of the ISF
- ! WAS LOADED WHEN ISF WAS SAVED!!!
- mov %l3, %o0 ! o0 = 1st arg = vector number
- call %g4, 0
- nop ! delay slot
-
- /*
- * Redisable traps so we can finish up the interrupt processing.
- * This is a VERY conservative place to do this.
- *
- * NOTE: %l0 has the PSR which was in place when we took the trap.
- */
-
- mov %l0, %psr ! **** DISABLE TRAPS ****
-
- /*
- * Decrement ISR nest level and Thread dispatch disable level.
- *
- * Register usage for this section:
- *
- * l4 = _Thread_Dispatch_disable_level pointer
- * l5 = _ISR_Nest_level pointer
- * l6 = _Thread_Dispatch_disable_level value
- * l7 = _ISR_Nest_level value
- */
-
- sub %l6, 1, %l6
- st %l6, [%l4 + %lo(SYM(_Thread_Dispatch_disable_level))]
-
- st %l7, [%l5 + %lo(SYM(_ISR_Nest_level))]
-
- /*
- * If dispatching is disabled (includes nested interrupt case),
- * then do a "simple" exit.
- */
-
- orcc %l6, %g0, %g0 ! Is dispatching disabled?
- bnz simple_return ! Yes, then do a "simple" exit
- nop ! delay slot
-
- /*
- * If a context switch is necessary, then do fudge stack to
- * return to the interrupt dispatcher.
- */
-
- sethi %hi(SYM(_Context_Switch_necessary)), %l4
- ld [%l4 + %lo(SYM(_Context_Switch_necessary))], %l5
-
- orcc %l5, %g0, %g0 ! Is thread switch necessary?
- bnz SYM(_ISR_Dispatch) ! yes, then invoke the dispatcher
- nop ! delay slot
-
- /*
- * Finally, check to see if signals were sent to the currently
- * executing task. If so, we need to invoke the interrupt dispatcher.
- */
-
- sethi %hi(SYM(_ISR_Signals_to_thread_executing)), %l6
- ld [%l6 + %lo(SYM(_ISR_Signals_to_thread_executing))], %l7
-
- orcc %l7, %g0, %g0 ! Were signals sent to the currently
- ! executing thread?
- bz simple_return ! yes, then invoke the dispatcher
- ! use the delay slot to clear the signals
- ! to the currently executing task flag
- st %g0, [%l6 + %lo(SYM(_ISR_Signals_to_thread_executing))]
-
-
- /*
- * Invoke interrupt dispatcher.
- */
-
- PUBLIC(_ISR_Dispatch)
-SYM(_ISR_Dispatch):
-
- /*
- * The following subtract should get us back on the interrupted
- * tasks stack and add enough room to invoke the dispatcher.
- * When we enable traps, we are mostly back in the context
- * of the task and subsequent interrupts can operate normally.
- */
-
- sub %fp, CPU_MINIMUM_STACK_FRAME_SIZE, %sp
-
- or %l0, SPARC_PSR_ET_MASK, %l7 ! l7 = PSR with ET=1
- mov %l7, %psr ! **** ENABLE TRAPS ****
- nop
- nop
- nop
-
- call SYM(_Thread_Dispatch), 0
- nop
-
- /*
- * The CWP in place at this point may be different from
- * that which was in effect at the beginning of the ISR if we
- * have been context switched between the beginning of this invocation
- * of _ISR_Handler and this point. Thus the CWP and WIM should
- * not be changed back to their values at ISR entry time. Any
- * changes to the PSR must preserve the CWP.
- */
-
-simple_return:
- ld [%fp + ISF_Y_OFFSET], %l5 ! restore y
- wr %l5, 0, %y
-
- ldd [%fp + ISF_PSR_OFFSET], %l0 ! restore psr, PC
- ld [%fp + ISF_NPC_OFFSET], %l2 ! restore nPC
- rd %psr, %l3
- and %l3, SPARC_PSR_CWP_MASK, %l3 ! want "current" CWP
- andn %l0, SPARC_PSR_CWP_MASK, %l0 ! want rest from task
- or %l3, %l0, %l0 ! install it later...
- andn %l0, SPARC_PSR_ET_MASK, %l0
-
- /*
- * Restore tasks global and out registers
- */
-
- mov %fp, %g1
-
- ! g1 is restored later
- ldd [%fp + ISF_G2_OFFSET], %g2 ! restore g2, g3
- ldd [%fp + ISF_G4_OFFSET], %g4 ! restore g4, g5
- ldd [%fp + ISF_G6_OFFSET], %g6 ! restore g6, g7
-
- ldd [%fp + ISF_I0_OFFSET], %i0 ! restore i0, i1
- ldd [%fp + ISF_I2_OFFSET], %i2 ! restore i2, i3
- ldd [%fp + ISF_I4_OFFSET], %i4 ! restore i4, i5
- ldd [%fp + ISF_I6_FP_OFFSET], %i6 ! restore i6/fp, i7
-
- /*
- * Registers:
- *
- * ALL global registers EXCEPT G1 and the input registers have
- * already been restored and thuse off limits.
- *
- * The following is the contents of the local registers:
- *
- * l0 = original psr
- * l1 = return address (i.e. PC)
- * l2 = nPC
- * l3 = CWP
- */
-
- /*
- * if (CWP + 1) is an invalid window then we need to reload it.
- *
- * WARNING: Traps should now be disabled
- */
-
- mov %l0, %psr ! **** DISABLE TRAPS ****
- nop
- nop
- nop
- rd %wim, %l4
- add %l0, 1, %l6 ! l6 = cwp + 1
- and %l6, SPARC_PSR_CWP_MASK, %l6 ! do the modulo on it
- srl %l4, %l6, %l5 ! l5 = win >> cwp + 1 ; shift count
- ! and CWP are conveniently LS 5 bits
- cmp %l5, 1 ! Is tasks window invalid?
- bne good_task_window
-
- /*
- * The following code is the same as a 1 position left rotate of WIM.
- */
-
- sll %l4, 1, %l5 ! l5 = WIM << 1
- srl %l4, SPARC_NUMBER_OF_REGISTER_WINDOWS-1 , %l4
- ! l4 = WIM >> (Number Windows - 1)
- or %l4, %l5, %l4 ! l4 = (WIM << 1) |
- ! (WIM >> (Number Windows - 1))
-
- /*
- * Now restore the window just as if we underflowed to it.
- */
-
- wr %l4, 0, %wim ! WIM = new WIM
- nop ! must delay after writing WIM
- nop
- nop
- restore ! now into the tasks window
-
- ldd [%g1 + CPU_STACK_FRAME_L0_OFFSET], %l0
- ldd [%g1 + CPU_STACK_FRAME_L2_OFFSET], %l2
- ldd [%g1 + CPU_STACK_FRAME_L4_OFFSET], %l4
- ldd [%g1 + CPU_STACK_FRAME_L6_OFFSET], %l6
- ldd [%g1 + CPU_STACK_FRAME_I0_OFFSET], %i0
- ldd [%g1 + CPU_STACK_FRAME_I2_OFFSET], %i2
- ldd [%g1 + CPU_STACK_FRAME_I4_OFFSET], %i4
- ldd [%g1 + CPU_STACK_FRAME_I6_FP_OFFSET], %i6
- ! reload of sp clobbers ISF
- save ! Back to ISR dispatch window
-
-good_task_window:
-
- mov %l0, %psr ! **** DISABLE TRAPS ****
- ! and restore condition codes.
- ld [%g1 + ISF_G1_OFFSET], %g1 ! restore g1
- jmp %l1 ! transfer control and
- rett %l2 ! go back to tasks window
-
-/* end of file */
diff --git a/c/src/exec/score/cpu/sparc/erc32.h b/c/src/exec/score/cpu/sparc/erc32.h
deleted file mode 100644
index 50df21267f..0000000000
--- a/c/src/exec/score/cpu/sparc/erc32.h
+++ /dev/null
@@ -1,521 +0,0 @@
-/* erc32.h
- *
- * This include file contains information pertaining to the ERC32.
- * The ERC32 is a custom SPARC V7 implementation based on the Cypress
- * 601/602 chipset. This CPU has a number of on-board peripherals and
- * was developed by the European Space Agency to target space applications.
- *
- * NOTE: Other than where absolutely required, this version currently
- * supports only the peripherals and bits used by the basic board
- * support package. This includes at least significant pieces of
- * the following items:
- *
- * + UART Channels A and B
- * + General Purpose Timer
- * + Real Time Clock
- * + Watchdog Timer (so it can be disabled)
- * + Control Register (so powerdown mode can be enabled)
- * + Memory Control Register
- * + Interrupt Control
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_ERC32_h
-#define _INCLUDE_ERC32_h
-
-#include <rtems/score/sparc.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Interrupt Sources
- *
- * The interrupt source numbers directly map to the trap type and to
- * the bits used in the Interrupt Clear, Interrupt Force, Interrupt Mask,
- * and the Interrupt Pending Registers.
- */
-
-#define ERC32_INTERRUPT_MASKED_ERRORS 1
-#define ERC32_INTERRUPT_EXTERNAL_1 2
-#define ERC32_INTERRUPT_EXTERNAL_2 3
-#define ERC32_INTERRUPT_UART_A_RX_TX 4
-#define ERC32_INTERRUPT_UART_B_RX_TX 5
-#define ERC32_INTERRUPT_CORRECTABLE_MEMORY_ERROR 6
-#define ERC32_INTERRUPT_UART_ERROR 7
-#define ERC32_INTERRUPT_DMA_ACCESS_ERROR 8
-#define ERC32_INTERRUPT_DMA_TIMEOUT 9
-#define ERC32_INTERRUPT_EXTERNAL_3 10
-#define ERC32_INTERRUPT_EXTERNAL_4 11
-#define ERC32_INTERRUPT_GENERAL_PURPOSE_TIMER 12
-#define ERC32_INTERRUPT_REAL_TIME_CLOCK 13
-#define ERC32_INTERRUPT_EXTERNAL_5 14
-#define ERC32_INTERRUPT_WATCHDOG_TIMEOUT 15
-
-#ifndef ASM
-
-/*
- * Trap Types for on-chip peripherals
- *
- * Source: Table 8 - Interrupt Trap Type and Default Priority Assignments
- *
- * NOTE: The priority level for each source corresponds to the least
- * significant nibble of the trap type.
- */
-
-#define ERC32_TRAP_TYPE( _source ) SPARC_ASYNCHRONOUS_TRAP((_source) + 0x10)
-
-#define ERC32_TRAP_SOURCE( _trap ) ((_trap) - 0x10)
-
-#define ERC32_Is_MEC_Trap( _trap ) \
- ( (_trap) >= ERC32_TRAP_TYPE( ERC32_INTERRUPT_MASKED_ERRORS ) && \
- (_trap) <= ERC32_TRAP_TYPE( ERC32_INTERRUPT_WATCHDOG_TIMEOUT ) )
-
-/*
- * Structure for ERC32 memory mapped registers.
- *
- * Source: Section 3.25.2 - Register Address Map
- *
- * NOTE: There is only one of these structures per CPU, its base address
- * is 0x01f80000, and the variable MEC is placed there by the
- * linkcmds file.
- */
-
-typedef struct {
- volatile unsigned32 Control; /* offset 0x00 */
- volatile unsigned32 Software_Reset; /* offset 0x04 */
- volatile unsigned32 Power_Down; /* offset 0x08 */
- volatile unsigned32 Unimplemented_0; /* offset 0x0c */
- volatile unsigned32 Memory_Configuration; /* offset 0x10 */
- volatile unsigned32 IO_Configuration; /* offset 0x14 */
- volatile unsigned32 Wait_State_Configuration; /* offset 0x18 */
- volatile unsigned32 Unimplemented_1; /* offset 0x1c */
- volatile unsigned32 Memory_Access_0; /* offset 0x20 */
- volatile unsigned32 Memory_Access_1; /* offset 0x24 */
- volatile unsigned32 Unimplemented_2[ 7 ]; /* offset 0x28 */
- volatile unsigned32 Interrupt_Shape; /* offset 0x44 */
- volatile unsigned32 Interrupt_Pending; /* offset 0x48 */
- volatile unsigned32 Interrupt_Mask; /* offset 0x4c */
- volatile unsigned32 Interrupt_Clear; /* offset 0x50 */
- volatile unsigned32 Interrupt_Force; /* offset 0x54 */
- volatile unsigned32 Unimplemented_3[ 2 ]; /* offset 0x58 */
- /* offset 0x60 */
- volatile unsigned32 Watchdog_Program_and_Timeout_Acknowledge;
- volatile unsigned32 Watchdog_Trap_Door_Set; /* offset 0x64 */
- volatile unsigned32 Unimplemented_4[ 6 ]; /* offset 0x68 */
- volatile unsigned32 Real_Time_Clock_Counter; /* offset 0x80 */
- volatile unsigned32 Real_Time_Clock_Scalar; /* offset 0x84 */
- volatile unsigned32 General_Purpose_Timer_Counter; /* offset 0x88 */
- volatile unsigned32 General_Purpose_Timer_Scalar; /* offset 0x8c */
- volatile unsigned32 Unimplemented_5[ 2 ]; /* offset 0x90 */
- volatile unsigned32 Timer_Control; /* offset 0x98 */
- volatile unsigned32 Unimplemented_6; /* offset 0x9c */
- volatile unsigned32 System_Fault_Status; /* offset 0xa0 */
- volatile unsigned32 First_Failing_Address; /* offset 0xa4 */
- volatile unsigned32 First_Failing_Data; /* offset 0xa8 */
- volatile unsigned32 First_Failing_Syndrome_and_Check_Bits;/* offset 0xac */
- volatile unsigned32 Error_and_Reset_Status; /* offset 0xb0 */
- volatile unsigned32 Error_Mask; /* offset 0xb4 */
- volatile unsigned32 Unimplemented_7[ 2 ]; /* offset 0xb8 */
- volatile unsigned32 Debug_Control; /* offset 0xc0 */
- volatile unsigned32 Breakpoint; /* offset 0xc4 */
- volatile unsigned32 Watchpoint; /* offset 0xc8 */
- volatile unsigned32 Unimplemented_8; /* offset 0xcc */
- volatile unsigned32 Test_Control; /* offset 0xd0 */
- volatile unsigned32 Test_Data; /* offset 0xd4 */
- volatile unsigned32 Unimplemented_9[ 2 ]; /* offset 0xd8 */
- volatile unsigned32 UART_Channel_A; /* offset 0xe0 */
- volatile unsigned32 UART_Channel_B; /* offset 0xe4 */
- volatile unsigned32 UART_Status; /* offset 0xe8 */
-} ERC32_Register_Map;
-
-#endif
-
-/*
- * The following constants are intended to be used ONLY in assembly
- * language files.
- *
- * NOTE: The intended style of usage is to load the address of MEC
- * into a register and then use these as displacements from
- * that register.
- */
-
-#ifdef ASM
-
-#define ERC32_MEC_CONTROL_OFFSET 0x00
-#define ERC32_MEC_SOFTWARE_RESET_OFFSET 0x04
-#define ERC32_MEC_POWER_DOWN_OFFSET 0x08
-#define ERC32_MEC_UNIMPLEMENTED_0_OFFSET 0x0C
-#define ERC32_MEC_MEMORY_CONFIGURATION_OFFSET 0x10
-#define ERC32_MEC_IO_CONFIGURATION_OFFSET 0x14
-#define ERC32_MEC_WAIT_STATE_CONFIGURATION_OFFSET 0x18
-#define ERC32_MEC_UNIMPLEMENTED_1_OFFSET 0x1C
-#define ERC32_MEC_MEMORY_ACCESS_0_OFFSET 0x20
-#define ERC32_MEC_MEMORY_ACCESS_1_OFFSET 0x24
-#define ERC32_MEC_UNIMPLEMENTED_2_OFFSET 0x28
-#define ERC32_MEC_INTERRUPT_SHAPE_OFFSET 0x44
-#define ERC32_MEC_INTERRUPT_PENDING_OFFSET 0x48
-#define ERC32_MEC_INTERRUPT_MASK_OFFSET 0x4C
-#define ERC32_MEC_INTERRUPT_CLEAR_OFFSET 0x50
-#define ERC32_MEC_INTERRUPT_FORCE_OFFSET 0x54
-#define ERC32_MEC_UNIMPLEMENTED_3_OFFSET 0x58
-#define ERC32_MEC_WATCHDOG_PROGRAM_AND_TIMEOUT_ACKNOWLEDGE_OFFSET 0x60
-#define ERC32_MEC_WATCHDOG_TRAP_DOOR_SET_OFFSET 0x64
-#define ERC32_MEC_UNIMPLEMENTED_4_OFFSET 0x6C
-#define ERC32_MEC_REAL_TIME_CLOCK_COUNTER_OFFSET 0x80
-#define ERC32_MEC_REAL_TIME_CLOCK_SCALAR_OFFSET 0x84
-#define ERC32_MEC_GENERAL_PURPOSE_TIMER_COUNTER_OFFSET 0x88
-#define ERC32_MEC_GENERAL_PURPOSE_TIMER_SCALAR_OFFSET 0x8C
-#define ERC32_MEC_UNIMPLEMENTED_5_OFFSET 0x90
-#define ERC32_MEC_TIMER_CONTROL_OFFSET 0x98
-#define ERC32_MEC_UNIMPLEMENTED_6_OFFSET 0x9C
-#define ERC32_MEC_SYSTEM_FAULT_STATUS_OFFSET 0xA0
-#define ERC32_MEC_FIRST_FAILING_ADDRESS_OFFSET 0xA4
-#define ERC32_MEC_FIRST_FAILING_DATA_OFFSET 0xA8
-#define ERC32_MEC_FIRST_FAILING_SYNDROME_AND_CHECK_BITS_OFFSET 0xAC
-#define ERC32_MEC_ERROR_AND_RESET_STATUS_OFFSET 0xB0
-#define ERC32_MEC_ERROR_MASK_OFFSET 0xB4
-#define ERC32_MEC_UNIMPLEMENTED_7_OFFSET 0xB8
-#define ERC32_MEC_DEBUG_CONTROL_OFFSET 0xC0
-#define ERC32_MEC_BREAKPOINT_OFFSET 0xC4
-#define ERC32_MEC_WATCHPOINT_OFFSET 0xC8
-#define ERC32_MEC_UNIMPLEMENTED_8_OFFSET 0xCC
-#define ERC32_MEC_TEST_CONTROL_OFFSET 0xD0
-#define ERC32_MEC_TEST_DATA_OFFSET 0xD4
-#define ERC32_MEC_UNIMPLEMENTED_9_OFFSET 0xD8
-#define ERC32_MEC_UART_CHANNEL_A_OFFSET 0xE0
-#define ERC32_MEC_UART_CHANNEL_B_OFFSET 0xE4
-#define ERC32_MEC_UART_STATUS_OFFSET 0xE8
-
-#endif
-
-/*
- * The following defines the bits in the Configuration Register.
- */
-
-#define ERC32_CONFIGURATION_POWER_DOWN_MASK 0x00000001
-#define ERC32_CONFIGURATION_POWER_DOWN_ALLOWED 0x00000001
-#define ERC32_CONFIGURATION_POWER_DOWN_DISABLED 0x00000000
-
-#define ERC32_CONFIGURATION_SOFTWARE_RESET_MASK 0x00000002
-#define ERC32_CONFIGURATION_SOFTWARE_RESET_ALLOWED 0x00000002
-#define ERC32_CONFIGURATION_SOFTWARE_RESET_DISABLED 0x00000000
-
-#define ERC32_CONFIGURATION_BUS_TIMEOUT_MASK 0x00000004
-#define ERC32_CONFIGURATION_BUS_TIMEOUT_ENABLED 0x00000004
-#define ERC32_CONFIGURATION_BUS_TIMEOUT_DISABLED 0x00000000
-
-#define ERC32_CONFIGURATION_ACCESS_PROTECTION_MASK 0x00000008
-#define ERC32_CONFIGURATION_ACCESS_PROTECTION_ENABLED 0x00000008
-#define ERC32_CONFIGURATION_ACCESS_PROTECTION_DISABLED 0x00000000
-
-
-/*
- * The following defines the bits in the Memory Configuration Register.
- */
-
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_MASK 0x00001C00
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_256K ( 0 << 10 )
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_512K ( 1 << 10 )
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_1MB ( 2 << 10 )
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_2MB ( 3 << 10 )
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_4MB ( 4 << 10 )
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_8MB ( 5 << 10 )
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_16MB ( 6 << 10 )
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_32MB ( 7 << 10 )
-
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_MASK 0x001C0000
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_128K ( 0 << 18 )
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_256K ( 1 << 18 )
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_512K ( 2 << 18 )
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_1M ( 3 << 18 )
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_2M ( 4 << 18 )
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_4M ( 5 << 18 )
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_8M ( 6 << 18 )
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_16M ( 7 << 18 )
-
-/*
- * The following defines the bits in the Timer Control Register.
- */
-
-#define ERC32_MEC_TIMER_CONTROL_GCR 0x00000001 /* 1 = reload at 0 */
- /* 0 = stop at 0 */
-#define ERC32_MEC_TIMER_CONTROL_GCL 0x00000002 /* 1 = load and start */
- /* 0 = no function */
-#define ERC32_MEC_TIMER_CONTROL_GSE 0x00000004 /* 1 = enable counting */
- /* 0 = hold scalar and counter */
-#define ERC32_MEC_TIMER_CONTROL_GSL 0x00000008 /* 1 = load scalar and start */
- /* 0 = no function */
-
-#define ERC32_MEC_TIMER_CONTROL_RTCCR 0x00000100 /* 1 = reload at 0 */
- /* 0 = stop at 0 */
-#define ERC32_MEC_TIMER_CONTROL_RTCCL 0x00000200 /* 1 = load and start */
- /* 0 = no function */
-#define ERC32_MEC_TIMER_CONTROL_RTCSE 0x00000400 /* 1 = enable counting */
- /* 0 = hold scalar and counter */
-#define ERC32_MEC_TIMER_CONTROL_RTCSL 0x00000800 /* 1 = load scalar and start */
- /* 0 = no function */
-
-/*
- * The following defines the bits in the UART Control Registers.
- *
- */
-
-#define ERC32_MEC_UART_CONTROL_RTD 0x000000FF /* RX/TX data */
-
-/*
- * The following defines the bits in the MEC UART Control Registers.
- */
-
-#define ERC32_MEC_UART_STATUS_DR 0x00000001 /* Data Ready */
-#define ERC32_MEC_UART_STATUS_TSE 0x00000002 /* TX Send Register Empty */
-#define ERC32_MEC_UART_STATUS_THE 0x00000004 /* TX Hold Register Empty */
-#define ERC32_MEC_UART_STATUS_FE 0x00000010 /* RX Framing Error */
-#define ERC32_MEC_UART_STATUS_PE 0x00000020 /* RX Parity Error */
-#define ERC32_MEC_UART_STATUS_OE 0x00000040 /* RX Overrun Error */
-#define ERC32_MEC_UART_STATUS_CU 0x00000080 /* Clear Errors */
-#define ERC32_MEC_UART_STATUS_TXE 0x00000006 /* TX Empty */
-#define ERC32_MEC_UART_STATUS_CLRA 0x00000080 /* Clear UART A */
-#define ERC32_MEC_UART_STATUS_CLRB 0x00800000 /* Clear UART B */
-#define ERC32_MEC_UART_STATUS_ERRA 0x00000070 /* Error in UART A */
-#define ERC32_MEC_UART_STATUS_ERRB 0x00700000 /* Error in UART B */
-
-#define ERC32_MEC_UART_STATUS_DRA (ERC32_MEC_UART_STATUS_DR << 0)
-#define ERC32_MEC_UART_STATUS_TSEA (ERC32_MEC_UART_STATUS_TSE << 0)
-#define ERC32_MEC_UART_STATUS_THEA (ERC32_MEC_UART_STATUS_THE << 0)
-#define ERC32_MEC_UART_STATUS_FEA (ERC32_MEC_UART_STATUS_FE << 0)
-#define ERC32_MEC_UART_STATUS_PEA (ERC32_MEC_UART_STATUS_PE << 0)
-#define ERC32_MEC_UART_STATUS_OEA (ERC32_MEC_UART_STATUS_OE << 0)
-#define ERC32_MEC_UART_STATUS_CUA (ERC32_MEC_UART_STATUS_CU << 0)
-#define ERC32_MEC_UART_STATUS_TXEA (ERC32_MEC_UART_STATUS_TXE << 0)
-
-#define ERC32_MEC_UART_STATUS_DRB (ERC32_MEC_UART_STATUS_DR << 16)
-#define ERC32_MEC_UART_STATUS_TSEB (ERC32_MEC_UART_STATUS_TSE << 16)
-#define ERC32_MEC_UART_STATUS_THEB (ERC32_MEC_UART_STATUS_THE << 16)
-#define ERC32_MEC_UART_STATUS_FEB (ERC32_MEC_UART_STATUS_FE << 16)
-#define ERC32_MEC_UART_STATUS_PEB (ERC32_MEC_UART_STATUS_PE << 16)
-#define ERC32_MEC_UART_STATUS_OEB (ERC32_MEC_UART_STATUS_OE << 16)
-#define ERC32_MEC_UART_STATUS_CUB (ERC32_MEC_UART_STATUS_CU << 16)
-#define ERC32_MEC_UART_STATUS_TXEB (ERC32_MEC_UART_STATUS_TXE << 16)
-
-#ifndef ASM
-
-/*
- * This is used to manipulate the on-chip registers.
- *
- * The following symbol must be defined in the linkcmds file and point
- * to the correct location.
- */
-
-extern ERC32_Register_Map ERC32_MEC;
-
-/*
- * Macros to manipulate the Interrupt Clear, Interrupt Force, Interrupt Mask,
- * and the Interrupt Pending Registers.
- *
- * NOTE: For operations which are not atomic, this code disables interrupts
- * to guarantee there are no intervening accesses to the same register.
- * The operations which read the register, modify the value and then
- * store the result back are vulnerable.
- */
-
-#define ERC32_Clear_interrupt( _source ) \
- do { \
- ERC32_MEC.Interrupt_Clear = (1 << (_source)); \
- } while (0)
-
-#define ERC32_Force_interrupt( _source ) \
- do { \
- unsigned32 _level; \
- \
- sparc_disable_interrupts( _level ); \
- ERC32_MEC.Test_Control = ERC32_MEC.Test_Control | 0x80000; \
- ERC32_MEC.Interrupt_Force = (1 << (_source)); \
- sparc_enable_interrupts( _level ); \
- } while (0)
-
-#define ERC32_Is_interrupt_pending( _source ) \
- (ERC32_MEC.Interrupt_Pending & (1 << (_source)))
-
-#define ERC32_Is_interrupt_masked( _source ) \
- (ERC32_MEC.Interrupt_Masked & (1 << (_source)))
-
-#define ERC32_Mask_interrupt( _source ) \
- do { \
- unsigned32 _level; \
- \
- sparc_disable_interrupts( _level ); \
- ERC32_MEC.Interrupt_Mask |= (1 << (_source)); \
- sparc_enable_interrupts( _level ); \
- } while (0)
-
-#define ERC32_Unmask_interrupt( _source ) \
- do { \
- unsigned32 _level; \
- \
- sparc_disable_interrupts( _level ); \
- ERC32_MEC.Interrupt_Mask &= ~(1 << (_source)); \
- sparc_enable_interrupts( _level ); \
- } while (0)
-
-#define ERC32_Disable_interrupt( _source, _previous ) \
- do { \
- unsigned32 _level; \
- unsigned32 _mask = 1 << (_source); \
- \
- sparc_disable_interrupts( _level ); \
- (_previous) = ERC32_MEC.Interrupt_Mask; \
- ERC32_MEC.Interrupt_Mask = _previous | _mask; \
- sparc_enable_interrupts( _level ); \
- (_previous) &= ~_mask; \
- } while (0)
-
-#define ERC32_Restore_interrupt( _source, _previous ) \
- do { \
- unsigned32 _level; \
- unsigned32 _mask = 1 << (_source); \
- \
- sparc_disable_interrupts( _level ); \
- ERC32_MEC.Interrupt_Mask = \
- (ERC32_MEC.Interrupt_Mask & ~_mask) | (_previous); \
- sparc_enable_interrupts( _level ); \
- } while (0)
-
-/*
- * The following macros attempt to hide the fact that the General Purpose
- * Timer and Real Time Clock Timer share the Timer Control Register. Because
- * the Timer Control Register is write only, we must mirror it in software
- * and insure that writes to one timer do not alter the current settings
- * and status of the other timer.
- *
- * This code promotes the view that the two timers are completely independent.
- * By exclusively using the routines below to access the Timer Control
- * Register, the application can view the system as having a General Purpose
- * Timer Control Register and a Real Time Clock Timer Control Register
- * rather than the single shared value.
- *
- * Each logical timer control register is organized as follows:
- *
- * D0 - Counter Reload
- * 1 = reload counter at zero and restart
- * 0 = stop counter at zero
- *
- * D1 - Counter Load
- * 1 = load counter with preset value and restart
- * 0 = no function
- *
- * D2 - Enable
- * 1 = enable counting
- * 0 = hold scaler and counter
- *
- * D3 - Scaler Load
- * 1 = load scalar with preset value and restart
- * 0 = no function
- *
- * To insure the management of the mirror is atomic, we disable interrupts
- * around updates.
- */
-
-#define ERC32_MEC_TIMER_COUNTER_RELOAD_AT_ZERO 0x00000001
-#define ERC32_MEC_TIMER_COUNTER_STOP_AT_ZERO 0x00000000
-
-#define ERC32_MEC_TIMER_COUNTER_LOAD_COUNTER 0x00000002
-
-#define ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING 0x00000004
-#define ERC32_MEC_TIMER_COUNTER_DISABLE_COUNTING 0x00000000
-
-#define ERC32_MEC_TIMER_COUNTER_LOAD_SCALER 0x00000008
-
-#define ERC32_MEC_TIMER_COUNTER_RELOAD_MASK 0x00000001
-#define ERC32_MEC_TIMER_COUNTER_ENABLE_MASK 0x00000004
-
-#define ERC32_MEC_TIMER_COUNTER_DEFINED_MASK 0x0000000F
-#define ERC32_MEC_TIMER_COUNTER_CURRENT_MODE_MASK 0x00000005
-
-extern unsigned32 _ERC32_MEC_Timer_Control_Mirror;
-
-/*
- * This macros manipulate the General Purpose Timer portion of the
- * Timer Control register and promote the view that there are actually
- * two independent Timer Control Registers.
- */
-
-#define ERC32_MEC_Set_General_Purpose_Timer_Control( _value ) \
- do { \
- unsigned32 _level; \
- unsigned32 _control; \
- unsigned32 __value; \
- \
- __value = ((_value) & 0x0f); \
- sparc_disable_interrupts( _level ); \
- _control = _ERC32_MEC_Timer_Control_Mirror; \
- _control &= ERC32_MEC_TIMER_COUNTER_DEFINED_MASK << 8; \
- _ERC32_MEC_Timer_Control_Mirror = _control | _value; \
- _control &= (ERC32_MEC_TIMER_COUNTER_CURRENT_MODE_MASK << 8); \
- _control |= __value; \
- /* printf( "GPT 0x%x 0x%x 0x%x\n", _value, __value, _control ); */ \
- ERC32_MEC.Timer_Control = _control; \
- sparc_enable_interrupts( _level ); \
- } while ( 0 )
-
-#define ERC32_MEC_Get_General_Purpose_Timer_Control( _value ) \
- do { \
- (_value) = _ERC32_MEC_Timer_Control_Mirror & 0xf; \
- } while ( 0 )
-
-/*
- * This macros manipulate the Real Timer Clock Timer portion of the
- * Timer Control register and promote the view that there are actually
- * two independent Timer Control Registers.
- */
-
-#define ERC32_MEC_Set_Real_Time_Clock_Timer_Control( _value ) \
- do { \
- unsigned32 _level; \
- unsigned32 _control; \
- unsigned32 __value; \
- \
- __value = ((_value) & 0x0f) << 8; \
- sparc_disable_interrupts( _level ); \
- _control = _ERC32_MEC_Timer_Control_Mirror; \
- _control &= ERC32_MEC_TIMER_COUNTER_DEFINED_MASK; \
- _ERC32_MEC_Timer_Control_Mirror = _control | __value; \
- _control &= ERC32_MEC_TIMER_COUNTER_CURRENT_MODE_MASK; \
- _control |= __value; \
- /* printf( "RTC 0x%x 0x%x 0x%x\n", _value, __value, _control ); */ \
- ERC32_MEC.Timer_Control = _control; \
- sparc_enable_interrupts( _level ); \
- } while ( 0 )
-
-#define ERC32_MEC_Get_Real_Time_Clock_Timer_Control( _value ) \
- do { \
- (_value) = (_ERC32_MEC_Timer_Control_Mirror >> 8) & 0xf; \
- } while ( 0 )
-
-
-#endif /* !ASM */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_INCLUDE_ERC32_h */
-/* end of include file */
-
diff --git a/c/src/exec/score/cpu/sparc/rtems.s b/c/src/exec/score/cpu/sparc/rtems.s
deleted file mode 100644
index f20d8c8288..0000000000
--- a/c/src/exec/score/cpu/sparc/rtems.s
+++ /dev/null
@@ -1,58 +0,0 @@
-/* rtems.s
- *
- * This file contains the single entry point code for
- * the SPARC port of RTEMS.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#include <asm.h>
-
-/*
- * RTEMS
- *
- * This routine jumps to the directive indicated in the
- * CPU defined register. This routine is used when RTEMS is
- * linked by itself and placed in ROM. This routine is the
- * first address in the ROM space for RTEMS. The user "calls"
- * this address with the directive arguments in the normal place.
- * This routine then jumps indirectly to the correct directive
- * preserving the arguments. The directive should not realize
- * it has been "wrapped" in this way. The table "_Entry_points"
- * is used to look up the directive.
- *
- * void RTEMS()
- */
-
- .align 4
- PUBLIC(RTEMS)
-SYM(RTEMS):
- /*
- * g2 was chosen because gcc uses it as a scratch register in
- * similar code scenarios and the other locals, ins, and outs
- * are off limits to this routine unless it does a "save" and
- * copies its in registers to the outs which only works up until
- * 6 parameters. Best to take the simple approach in this case.
- */
- sethi SYM(_Entry_points), %g2
- or %g2, %lo(SYM(_Entry_points)), %g2
- sll %g1, 2, %g1
- add %g1, %g2, %g2
- jmp %g2
- nop
-
diff --git a/c/src/exec/score/cpu/sparc/sparc.h b/c/src/exec/score/cpu/sparc/sparc.h
deleted file mode 100644
index 283548728a..0000000000
--- a/c/src/exec/score/cpu/sparc/sparc.h
+++ /dev/null
@@ -1,253 +0,0 @@
-/* sparc.h
- *
- * This include file contains information pertaining to the SPARC
- * processor family.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_SPARC_h
-#define _INCLUDE_SPARC_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This file contains the information required to build
- * RTEMS for a particular member of the "sparc" family. It does
- * this by setting variables to indicate which implementation
- * dependent features are present in a particular member
- * of the family.
- *
- * Currently recognized feature flags:
- *
- * + SPARC_HAS_FPU
- * 0 - no HW FPU
- * 1 - has HW FPU (assumed to be compatible w/90C602)
- *
- * + SPARC_HAS_BITSCAN
- * 0 - does not have scan instructions
- * 1 - has scan instruction (not currently implemented)
- *
- * + SPARC_NUMBER_OF_REGISTER_WINDOWS
- * 8 is the most common number supported by SPARC implementations.
- * SPARC_PSR_CWP_MASK is derived from this value.
- *
- * + SPARC_HAS_LOW_POWER_MODE
- * 0 - does not have low power mode support (or not supported)
- * 1 - has low power mode and thus a CPU model dependent idle task.
- *
- */
-
-#if defined(erc32)
-
-#define CPU_MODEL_NAME "erc32"
-#define SPARC_HAS_FPU 1
-#define SPARC_HAS_BITSCAN 0
-#define SPARC_NUMBER_OF_REGISTER_WINDOWS 8
-#define SPARC_HAS_LOW_POWER_MODE 1
-
-#else
-
-#error "Unsupported CPU Model"
-
-#endif
-
-/*
- * Define the name of the CPU family.
- */
-
-#define CPU_NAME "SPARC"
-
-/*
- * Miscellaneous constants
- */
-
-/*
- * PSR masks and starting bit positions
- *
- * NOTE: Reserved bits are ignored.
- */
-
-#if (SPARC_NUMBER_OF_REGISTER_WINDOWS == 8)
-#define SPARC_PSR_CWP_MASK 0x07 /* bits 0 - 4 */
-#elif (SPARC_NUMBER_OF_REGISTER_WINDOWS == 16)
-#define SPARC_PSR_CWP_MASK 0x0F /* bits 0 - 4 */
-#elif (SPARC_NUMBER_OF_REGISTER_WINDOWS == 32)
-#define SPARC_PSR_CWP_MASK 0x1F /* bits 0 - 4 */
-#else
-#error "Unsupported number of register windows for this cpu"
-#endif
-
-#define SPARC_PSR_ET_MASK 0x00000020 /* bit 5 */
-#define SPARC_PSR_PS_MASK 0x00000040 /* bit 6 */
-#define SPARC_PSR_S_MASK 0x00000080 /* bit 7 */
-#define SPARC_PSR_PIL_MASK 0x00000F00 /* bits 8 - 11 */
-#define SPARC_PSR_EF_MASK 0x00001000 /* bit 12 */
-#define SPARC_PSR_EC_MASK 0x00002000 /* bit 13 */
-#define SPARC_PSR_ICC_MASK 0x00F00000 /* bits 20 - 23 */
-#define SPARC_PSR_VER_MASK 0x0F000000 /* bits 24 - 27 */
-#define SPARC_PSR_IMPL_MASK 0xF0000000 /* bits 28 - 31 */
-
-#define SPARC_PSR_CWP_BIT_POSITION 0 /* bits 0 - 4 */
-#define SPARC_PSR_ET_BIT_POSITION 5 /* bit 5 */
-#define SPARC_PSR_PS_BIT_POSITION 6 /* bit 6 */
-#define SPARC_PSR_S_BIT_POSITION 7 /* bit 7 */
-#define SPARC_PSR_PIL_BIT_POSITION 8 /* bits 8 - 11 */
-#define SPARC_PSR_EF_BIT_POSITION 12 /* bit 12 */
-#define SPARC_PSR_EC_BIT_POSITION 13 /* bit 13 */
-#define SPARC_PSR_ICC_BIT_POSITION 20 /* bits 20 - 23 */
-#define SPARC_PSR_VER_BIT_POSITION 24 /* bits 24 - 27 */
-#define SPARC_PSR_IMPL_BIT_POSITION 28 /* bits 28 - 31 */
-
-#ifndef ASM
-
-/*
- * Standard nop
- */
-
-#define nop() \
- do { \
- asm volatile ( "nop" ); \
- } while ( 0 )
-
-/*
- * Get and set the PSR
- */
-
-#define sparc_get_psr( _psr ) \
- do { \
- (_psr) = 0; \
- asm volatile( "rd %%psr, %0" : "=r" (_psr) : "0" (_psr) ); \
- } while ( 0 )
-
-#define sparc_set_psr( _psr ) \
- do { \
- asm volatile ( "mov %0, %%psr " : "=r" ((_psr)) : "0" ((_psr)) ); \
- nop(); \
- nop(); \
- nop(); \
- } while ( 0 )
-
-/*
- * Get and set the TBR
- */
-
-#define sparc_get_tbr( _tbr ) \
- do { \
- (_tbr) = 0; /* to avoid unitialized warnings */ \
- asm volatile( "rd %%tbr, %0" : "=r" (_tbr) : "0" (_tbr) ); \
- } while ( 0 )
-
-#define sparc_set_tbr( _tbr ) \
- do { \
- asm volatile( "wr %0, 0, %%tbr" : "=r" (_tbr) : "0" (_tbr) ); \
- } while ( 0 )
-
-/*
- * Get and set the WIM
- */
-
-#define sparc_get_wim( _wim ) \
- do { \
- asm volatile( "rd %%wim, %0" : "=r" (_wim) : "0" (_wim) ); \
- } while ( 0 )
-
-#define sparc_set_wim( _wim ) \
- do { \
- asm volatile( "wr %0, %%wim" : "=r" (_wim) : "0" (_wim) ); \
- nop(); \
- nop(); \
- nop(); \
- } while ( 0 )
-
-/*
- * Get and set the Y
- */
-
-#define sparc_get_y( _y ) \
- do { \
- asm volatile( "rd %%y, %0" : "=r" (_y) : "0" (_y) ); \
- } while ( 0 )
-
-#define sparc_set_y( _y ) \
- do { \
- asm volatile( "wr %0, %%y" : "=r" (_y) : "0" (_y) ); \
- } while ( 0 )
-
-/*
- * Manipulate the interrupt level in the psr
- *
- */
-
-#define sparc_disable_interrupts( _level ) \
- do { \
- register unsigned int _newlevel; \
- \
- sparc_get_psr( _level ); \
- (_newlevel) = (_level) | SPARC_PSR_PIL_MASK; \
- sparc_set_psr( _newlevel ); \
- } while ( 0 )
-
-#define sparc_enable_interrupts( _level ) \
- do { \
- unsigned int _tmp; \
- \
- sparc_get_psr( _tmp ); \
- _tmp &= ~SPARC_PSR_PIL_MASK; \
- _tmp |= (_level) & SPARC_PSR_PIL_MASK; \
- sparc_set_psr( _tmp ); \
- } while ( 0 )
-
-#define sparc_flash_interrupts( _level ) \
- do { \
- register unsigned32 _ignored = 0; \
- \
- sparc_enable_interrupts( (_level) ); \
- sparc_disable_interrupts( _ignored ); \
- } while ( 0 )
-
-#define sparc_set_interrupt_level( _new_level ) \
- do { \
- register unsigned32 _new_psr_level = 0; \
- \
- sparc_get_psr( _new_psr_level ); \
- _new_psr_level &= ~SPARC_PSR_PIL_MASK; \
- _new_psr_level |= \
- (((_new_level) << SPARC_PSR_PIL_BIT_POSITION) & SPARC_PSR_PIL_MASK); \
- sparc_set_psr( _new_psr_level ); \
- } while ( 0 )
-
-#define sparc_get_interrupt_level( _level ) \
- do { \
- register unsigned32 _psr_level = 0; \
- \
- sparc_get_psr( _psr_level ); \
- (_level) = \
- (_psr_level & SPARC_PSR_PIL_MASK) >> SPARC_PSR_PIL_BIT_POSITION; \
- } while ( 0 )
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! _INCLUDE_SPARC_h */
-/* end of include file */
diff --git a/c/src/exec/score/cpu/sparc/sparctypes.h b/c/src/exec/score/cpu/sparc/sparctypes.h
deleted file mode 100644
index 7a7b2bb606..0000000000
--- a/c/src/exec/score/cpu/sparc/sparctypes.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* sparctypes.h
- *
- * This include file contains type definitions pertaining to the
- * SPARC processor family.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#ifndef __SPARC_TYPES_h
-#define __SPARC_TYPES_h
-
-#ifndef ASM
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* unsigned 8-bit integer */
-typedef unsigned short unsigned16; /* unsigned 16-bit integer */
-typedef unsigned int unsigned32; /* unsigned 32-bit integer */
-typedef unsigned long long unsigned64; /* unsigned 64-bit integer */
-
-typedef unsigned16 Priority_Bit_map_control;
-
-typedef signed char signed8; /* 8-bit signed integer */
-typedef signed short signed16; /* 16-bit signed integer */
-typedef signed int signed32; /* 32-bit signed integer */
-typedef signed long long signed64; /* 64 bit signed integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-typedef void sparc_isr;
-typedef void ( *sparc_isr_entry )( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !ASM */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/cpu/unix/Makefile.in b/c/src/exec/score/cpu/unix/Makefile.in
deleted file mode 100644
index 0589977f7f..0000000000
--- a/c/src/exec/score/cpu/unix/Makefile.in
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-RELS=$(ARCH)/rtems-cpu.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=cpu
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/cpu.h $(srcdir)/unix.h $(srcdir)/unixtypes.h
-
-# Assembly source names, if any, go here -- minus the .S
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.S)
-S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V) -DCPU_SYNC_IO $(LIBC_DEFINES)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(ARCH)/unixsize.h: $(ARCH) cpu.h $(PROJECT_RELEASE)/bin/gensize
- $(RM) $@
- $(PROJECT_RELEASE)/bin/gensize > $@
- $(CHMOD) -w $@
-
-$(ARCH)/rtems-cpu.rel: $(OBJS)
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(ARCH)/unixsize.h preinstall $(RELS)
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-install: all
-
-# Real ports using the gnu tools will need to have bsp_specs!!!
-# ${PROJECT_RELEASE}/lib/bsp_specs
-preinstall: $(ARCH) $(ARCH)/unixsize.h \
- $(PROJECT_INCLUDE)/rtems/score/targopts.h \
- $(PROJECT_RELEASE)/lib/bsp_specs
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
- $(INSTALL) -m 444 ${ARCH}/unixsize.h $(PROJECT_INCLUDE)/rtems/score
-
-$(PROJECT_INCLUDE)/rtems/score/targopts.h: $(ARCH)/targopts.h-tmp
- $(INSTALL) -m 444 $(ARCH)/targopts.h-tmp $@
-
-# $(ARCH)/targopts.h-tmp rule is in leaf.cfg
-
-# Real ports using the gnu tools will need to have bsp_specs!!!
-${PROJECT_RELEASE}/lib/bsp_specs: $(ARCH)/bsp_specs.tmp
- $(INSTALL) -m 444 $(ARCH)/bsp_specs.tmp $@
-#
-# $(ARCH)/bsp_specs.tmp rule is in leaf.cfg
diff --git a/c/src/exec/score/cpu/unix/cpu.c b/c/src/exec/score/cpu/unix/cpu.c
deleted file mode 100644
index 3b3dbcd383..0000000000
--- a/c/src/exec/score/cpu/unix/cpu.c
+++ /dev/null
@@ -1,1117 +0,0 @@
-/*
- * UNIX Simulator Dependent Source
- *
- * COPYRIGHT (c) 1994,95 by Division Incorporated
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/interr.h>
-
-#if defined(__linux__)
-#define _XOPEN_SOURCE
-#define MALLOC_0_RETURNS_NULL
-#endif
-
-#include <sys/types.h>
-#include <sys/times.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <setjmp.h>
-#include <signal.h>
-#include <time.h>
-#include <sys/time.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/sem.h>
-#include <string.h> /* memset */
-
-#ifndef SA_RESTART
-#define SA_RESTART 0
-#endif
-
-typedef struct {
- jmp_buf regs;
- int isr_level;
-} Context_Control_overlay;
-
-void _CPU_Signal_initialize(void);
-void _CPU_Stray_signal(int);
-void _CPU_ISR_Handler(int);
-
-static sigset_t _CPU_Signal_mask;
-static Context_Control_overlay
- _CPU_Context_Default_with_ISRs_enabled CPU_STRUCTURE_ALIGNMENT;
-static Context_Control_overlay
- _CPU_Context_Default_with_ISRs_disabled CPU_STRUCTURE_ALIGNMENT;
-
-/*
- * Sync IO support, an entry for each fd that can be set
- */
-
-void _CPU_Sync_io_Init();
-
-static rtems_sync_io_handler _CPU_Sync_io_handlers[FD_SETSIZE];
-static int sync_io_nfds;
-static fd_set sync_io_readfds;
-static fd_set sync_io_writefds;
-static fd_set sync_io_exceptfds;
-
-/*
- * Which cpu are we? Used by libcpu and libbsp.
- */
-
-int cpu_number;
-
-/*PAGE
- *
- * _CPU_ISR_From_CPU_Init
- */
-
-sigset_t posix_empty_mask;
-
-void _CPU_ISR_From_CPU_Init()
-{
- unsigned32 i;
- proc_ptr old_handler;
-
- /*
- * Generate an empty mask to be used by disable_support
- */
-
- sigemptyset(&posix_empty_mask);
-
- /*
- * Block all the signals except SIGTRAP for the debugger
- * and fatal error signals.
- */
-
- (void) sigfillset(&_CPU_Signal_mask);
- (void) sigdelset(&_CPU_Signal_mask, SIGTRAP);
- (void) sigdelset(&_CPU_Signal_mask, SIGABRT);
- (void) sigdelset(&_CPU_Signal_mask, SIGIOT);
- (void) sigdelset(&_CPU_Signal_mask, SIGCONT);
- (void) sigdelset(&_CPU_Signal_mask, SIGSEGV);
- (void) sigdelset(&_CPU_Signal_mask, SIGBUS);
- (void) sigdelset(&_CPU_Signal_mask, SIGFPE);
-
- _CPU_ISR_Enable(1);
-
- /*
- * Set the handler for all signals to be signal_handler
- * which will then vector out to the correct handler
- * for whichever signal actually happened. Initially
- * set the vectors to the stray signal handler.
- */
-
- for (i = 0; i < CPU_INTERRUPT_NUMBER_OF_VECTORS; i++)
- (void)_CPU_ISR_install_vector(i, _CPU_Stray_signal, &old_handler);
-
- _CPU_Signal_initialize();
-}
-
-void _CPU_Signal_initialize( void )
-{
- struct sigaction act;
- sigset_t mask;
-
- /* mark them all active except for TraceTrap and Abort */
-
- mask = _CPU_Signal_mask;
- sigprocmask(SIG_UNBLOCK, &mask, 0);
-
- act.sa_handler = _CPU_ISR_Handler;
- act.sa_mask = mask;
- act.sa_flags = SA_RESTART;
-
- sigaction(SIGHUP, &act, 0);
- sigaction(SIGINT, &act, 0);
- sigaction(SIGQUIT, &act, 0);
- sigaction(SIGILL, &act, 0);
-#ifdef SIGEMT
- sigaction(SIGEMT, &act, 0);
-#endif
- sigaction(SIGFPE, &act, 0);
- sigaction(SIGKILL, &act, 0);
- sigaction(SIGBUS, &act, 0);
- sigaction(SIGSEGV, &act, 0);
-#ifdef SIGSYS
- sigaction(SIGSYS, &act, 0);
-#endif
- sigaction(SIGPIPE, &act, 0);
- sigaction(SIGALRM, &act, 0);
- sigaction(SIGTERM, &act, 0);
- sigaction(SIGUSR1, &act, 0);
- sigaction(SIGUSR2, &act, 0);
- sigaction(SIGCHLD, &act, 0);
-#ifdef SIGCLD
- sigaction(SIGCLD, &act, 0);
-#endif
-#ifdef SIGPWR
- sigaction(SIGPWR, &act, 0);
-#endif
- sigaction(SIGVTALRM, &act, 0);
- sigaction(SIGPROF, &act, 0);
- sigaction(SIGIO, &act, 0);
- sigaction(SIGWINCH, &act, 0);
- sigaction(SIGSTOP, &act, 0);
- sigaction(SIGTTIN, &act, 0);
- sigaction(SIGTTOU, &act, 0);
- sigaction(SIGURG, &act, 0);
-#ifdef SIGLOST
- sigaction(SIGLOST, &act, 0);
-#endif
-}
-
-/*PAGE
- *
- * _CPU_Context_From_CPU_Init
- */
-
-void _CPU_Context_From_CPU_Init()
-{
-
-#if defined(__hppa__) && defined(RTEMS_UNIXLIB_SETJMP)
- /*
- * HACK - set the _SYSTEM_ID to 0x20c so that setjmp/longjmp
- * will handle the full 32 floating point registers.
- */
-
- {
- extern unsigned32 _SYSTEM_ID;
-
- _SYSTEM_ID = 0x20c;
- }
-#endif
-
- /*
- * get default values to use in _CPU_Context_Initialize()
- */
-
-
- (void) memset(
- &_CPU_Context_Default_with_ISRs_enabled,
- 0,
- sizeof(Context_Control)
- );
- (void) memset(
- &_CPU_Context_Default_with_ISRs_disabled,
- 0,
- sizeof(Context_Control)
- );
-
- _CPU_ISR_Set_level( 0 );
- _CPU_Context_switch(
- (Context_Control *) &_CPU_Context_Default_with_ISRs_enabled,
- (Context_Control *) &_CPU_Context_Default_with_ISRs_enabled
- );
-
- _CPU_ISR_Set_level( 1 );
- _CPU_Context_switch(
- (Context_Control *) &_CPU_Context_Default_with_ISRs_disabled,
- (Context_Control *) &_CPU_Context_Default_with_ISRs_disabled
- );
-}
-
-/*PAGE
- *
- * _CPU_Sync_io_Init
- */
-
-void _CPU_Sync_io_Init()
-{
- int fd;
-
- for (fd = 0; fd < FD_SETSIZE; fd++)
- _CPU_Sync_io_handlers[fd] = NULL;
-
- sync_io_nfds = 0;
- FD_ZERO(&sync_io_readfds);
- FD_ZERO(&sync_io_writefds);
- FD_ZERO(&sync_io_exceptfds);
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- sigset_t old_mask;
-
-#if defined(__linux__)
- sigemptyset( &old_mask );
-#endif
- sigprocmask(SIG_BLOCK, 0, &old_mask);
-
- if (memcmp((void *)&posix_empty_mask, (void *)&old_mask, sizeof(sigset_t)))
- return 1;
-
- return 0;
-}
-
-/* _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 */
-)
-{
- /*
- * The thread_dispatch argument is the address of the entry point
- * for the routine called at the end of an ISR once it has been
- * decided a context switch is necessary. On some compilation
- * systems it is difficult to call a high-level language routine
- * from assembly. This allows us to trick these systems.
- *
- * If you encounter this problem save the entry point in a CPU
- * dependent variable.
- */
-
- _CPU_Thread_dispatch_pointer = thread_dispatch;
-
- /*
- * XXX; If there is not an easy way to initialize the FP context
- * during Context_Initialize, then it is usually easier to
- * save an "uninitialized" FP context here and copy it to
- * the task's during Context_Initialize.
- */
-
- /* XXX: FP context initialization support */
-
- _CPU_Table = *cpu_table;
-
- _CPU_ISR_From_CPU_Init();
-
- _CPU_Sync_io_Init();
-
- _CPU_Context_From_CPU_Init();
-
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- _CPU_Fatal_halt( 0xdeaddead );
-}
-
-/*PAGE
- *
- * _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
-)
-{
- *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.
- */
-
- /*
- * We put the actual user ISR address in '_ISR_vector_table'. This will
- * be used by the _CPU_ISR_Handler so the user gets control.
- */
-
- _ISR_Vector_table[ vector ] = new_handler;
-}
-
-/*PAGE
- *
- * _CPU_Install_interrupt_stack
- */
-
-void _CPU_Install_interrupt_stack( void )
-{
-}
-
-/*PAGE
- *
- * _CPU_Thread_Idle_body
- *
- * Stop until we get a signal which is the logically the same thing
- * entering low-power or sleep mode on a real processor and waiting for
- * an interrupt. This significantly reduces the consumption of host
- * CPU cycles which is again similar to low power mode.
- */
-
-void _CPU_Thread_Idle_body( void )
-{
-#if CPU_SYNC_IO
- extern void _Thread_Dispatch(void);
- int fd;
-#endif
-
- while (1) {
-#ifdef RTEMS_DEBUG
- /* interrupts had better be enabled at this point! */
- if (_CPU_ISR_Get_level() != 0)
- abort();
-#endif
-
- /*
- * Block on a select statement, the CPU interface added allow the
- * user to add new descriptors which are to be blocked on
- */
-
-#if CPU_SYNC_IO
- if (sync_io_nfds) {
- int result;
- fd_set readfds, writefds, exceptfds;
-
- readfds = sync_io_readfds;
- writefds = sync_io_writefds;
- exceptfds = sync_io_exceptfds;
- result = select(sync_io_nfds,
- &readfds,
- &writefds,
- &exceptfds,
- NULL);
-
- if (result < 0) {
- if (errno != EINTR)
- _CPU_Fatal_error(0x200); /* FIXME : what number should go here !! */
- _Thread_Dispatch();
- continue;
- }
-
- for (fd = 0; fd < sync_io_nfds; fd++) {
- boolean read = FD_ISSET(fd, &readfds);
- boolean write = FD_ISSET(fd, &writefds);
- boolean except = FD_ISSET(fd, &exceptfds);
-
- if (_CPU_Sync_io_handlers[fd] && (read || write || except))
- _CPU_Sync_io_handlers[fd](fd, read, write, except);
- }
-
- _Thread_Dispatch();
- } else
- pause();
-#else
- pause();
-#endif
-
- }
-
-}
-
-/*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 *addr;
- unsigned32 jmp_addr;
- unsigned32 _stack_low; /* lowest "stack aligned" address */
- unsigned32 _stack_high; /* highest "stack aligned" address */
- unsigned32 _the_size;
-
- jmp_addr = (unsigned32) _entry_point;
-
- /*
- * On CPUs with stacks which grow down, we build the stack
- * based on the _stack_high address. On CPUs with stacks which
- * grow up, we build the stack based on the _stack_low address.
- */
-
- _stack_low = (unsigned32)(_stack_base) + CPU_STACK_ALIGNMENT - 1;
- _stack_low &= ~(CPU_STACK_ALIGNMENT - 1);
-
- _stack_high = (unsigned32)(_stack_base) + _size;
- _stack_high &= ~(CPU_STACK_ALIGNMENT - 1);
-
- if (_stack_high > _stack_low)
- _the_size = _stack_high - _stack_low;
- else
- _the_size = _stack_low - _stack_high;
-
- /*
- * Slam our jmp_buf template into the context we are creating
- */
-
- if ( _new_level == 0 )
- *_the_context = *(Context_Control *)
- &_CPU_Context_Default_with_ISRs_enabled;
- else
- *_the_context = *(Context_Control *)
- &_CPU_Context_Default_with_ISRs_disabled;
-
- addr = (unsigned32 *)_the_context;
-
-#if defined(__hppa__)
- *(addr + RP_OFF) = jmp_addr;
- *(addr + SP_OFF) = (unsigned32)(_stack_low + CPU_FRAME_SIZE);
-
- /*
- * See if we are using shared libraries by checking
- * bit 30 in 24 off of newp. If bit 30 is set then
- * we are using shared libraries and the jump address
- * points to the pointer, so we put that into rp instead.
- */
-
- if (jmp_addr & 0x40000000) {
- jmp_addr &= 0xfffffffc;
- *(addr + RP_OFF) = *(unsigned32 *)jmp_addr;
- }
-#elif defined(__sparc__)
-
- /*
- * See /usr/include/sys/stack.h in Solaris 2.3 for a nice
- * diagram of the stack.
- */
-
- asm ("ta 0x03"); /* flush registers */
-
- *(addr + RP_OFF) = jmp_addr + ADDR_ADJ_OFFSET;
- *(addr + SP_OFF) = (unsigned32)(_stack_high - CPU_FRAME_SIZE);
- *(addr + FP_OFF) = (unsigned32)(_stack_high);
-
-#elif defined(__i386__)
-
- /*
- * This information was gathered by disassembling setjmp().
- */
-
- {
- unsigned32 stack_ptr;
-
- stack_ptr = _stack_high - CPU_FRAME_SIZE;
-
- *(addr + EBX_OFF) = 0xFEEDFEED;
- *(addr + ESI_OFF) = 0xDEADDEAD;
- *(addr + EDI_OFF) = 0xDEAFDEAF;
- *(addr + EBP_OFF) = stack_ptr;
- *(addr + ESP_OFF) = stack_ptr;
- *(addr + RET_OFF) = jmp_addr;
-
- addr = (unsigned32 *) stack_ptr;
-
- addr[ 0 ] = jmp_addr;
- addr[ 1 ] = (unsigned32) stack_ptr;
- addr[ 2 ] = (unsigned32) stack_ptr;
- }
-
-#else
-#error "UNKNOWN CPU!!!"
-#endif
-
-}
-
-/*PAGE
- *
- * _CPU_Context_restore
- */
-
-void _CPU_Context_restore(
- Context_Control *next
-)
-{
- Context_Control_overlay *nextp = (Context_Control_overlay *)next;
-
- _CPU_ISR_Enable(nextp->isr_level);
- longjmp( nextp->regs, 0 );
-}
-
-/*PAGE
- *
- * _CPU_Context_switch
- */
-
-static void do_jump(
- Context_Control_overlay *currentp,
- Context_Control_overlay *nextp
-);
-
-void _CPU_Context_switch(
- Context_Control *current,
- Context_Control *next
-)
-{
- Context_Control_overlay *currentp = (Context_Control_overlay *)current;
- Context_Control_overlay *nextp = (Context_Control_overlay *)next;
-#if 0
- int status;
-#endif
-
- currentp->isr_level = _CPU_ISR_Disable_support();
-
- do_jump( currentp, nextp );
-
-#if 0
- if (sigsetjmp(currentp->regs, 1) == 0) { /* Save the current context */
- siglongjmp(nextp->regs, 0); /* Switch to the new context */
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- status
- );
- }
-#endif
-
-#ifdef RTEMS_DEBUG
- if (_CPU_ISR_Get_level() == 0)
- abort();
-#endif
-
- _CPU_ISR_Enable(currentp->isr_level);
-}
-
-static void do_jump(
- Context_Control_overlay *currentp,
- Context_Control_overlay *nextp
-)
-{
- int status;
-
- if (setjmp(currentp->regs) == 0) { /* Save the current context */
- longjmp(nextp->regs, 0); /* Switch to the new context */
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- status
- );
- }
-}
-
-/*PAGE
- *
- * _CPU_Save_float_context
- */
-
-void _CPU_Save_float_context(
- Context_Control_fp *fp_context
-)
-{
-}
-
-/*PAGE
- *
- * _CPU_Restore_float_context
- */
-
-void _CPU_Restore_float_context(
- Context_Control_fp *fp_context
-)
-{
-}
-
-/*PAGE
- *
- * _CPU_ISR_Disable_support
- */
-
-unsigned32 _CPU_ISR_Disable_support(void)
-{
- int status;
- sigset_t old_mask;
-
- status = sigprocmask(SIG_BLOCK, &_CPU_Signal_mask, &old_mask);
- if ( status )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- status
- );
-
- if (memcmp((void *)&posix_empty_mask, (void *)&old_mask, sizeof(sigset_t)))
- return 1;
-
- return 0;
-}
-
-/*PAGE
- *
- * _CPU_ISR_Enable
- */
-
-void _CPU_ISR_Enable(
- unsigned32 level
-)
-{
- int status;
-
- if (level == 0)
- status = sigprocmask(SIG_UNBLOCK, &_CPU_Signal_mask, 0);
- else
- status = sigprocmask(SIG_BLOCK, &_CPU_Signal_mask, 0);
-
- if ( status )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- status
- );
-}
-
-/*PAGE
- *
- * _CPU_ISR_Handler
- *
- * External interrupt handler.
- * This is installed as a UNIX signal handler.
- * It vectors out to specific user interrupt handlers.
- */
-
-void _CPU_ISR_Handler(int vector)
-{
- extern void _Thread_Dispatch(void);
- extern unsigned32 _Thread_Dispatch_disable_level;
- extern boolean _Context_Switch_necessary;
-
- if (_ISR_Nest_level++ == 0) {
- /* switch to interrupt stack */
- }
-
- _Thread_Dispatch_disable_level++;
-
- if (_ISR_Vector_table[vector]) {
- _ISR_Vector_table[vector](vector);
- } else {
- _CPU_Stray_signal(vector);
- }
-
- if (_ISR_Nest_level-- == 0) {
- /* switch back to original stack */
- }
-
- _Thread_Dispatch_disable_level--;
-
- if (_Thread_Dispatch_disable_level == 0 &&
- (_Context_Switch_necessary || _ISR_Signals_to_thread_executing)) {
- _ISR_Signals_to_thread_executing = FALSE;
- _CPU_ISR_Enable(0);
- _Thread_Dispatch();
- }
-}
-
-/*PAGE
- *
- * _CPU_Stray_signal
- */
-
-void _CPU_Stray_signal(int sig_num)
-{
- char buffer[ 4 ];
-
- /*
- * print "stray" msg about ones which that might mean something
- * Avoid using the stdio section of the library.
- * The following is generally safe.
- */
-
- switch (sig_num)
- {
-#ifdef SIGCLD
- case SIGCLD:
- break;
-#endif
- default:
- {
- /*
- * We avoid using the stdio section of the library.
- * The following is generally safe
- */
-
- int digit;
- int number = sig_num;
- int len = 0;
-
- digit = number / 100;
- number %= 100;
- if (digit) buffer[len++] = '0' + digit;
-
- digit = number / 10;
- number %= 10;
- if (digit || len) buffer[len++] = '0' + digit;
-
- digit = number;
- buffer[len++] = '0' + digit;
-
- buffer[ len++ ] = '\n';
-
- write( 2, "Stray signal ", 13 );
- write( 2, buffer, len );
-
- }
- }
-
- /*
- * If it was a "fatal" signal, then exit here
- * If app code has installed a hander for one of these, then
- * we won't call _CPU_Stray_signal, so this is ok.
- */
-
- switch (sig_num) {
- case SIGINT:
- case SIGHUP:
- case SIGQUIT:
- case SIGILL:
-#ifdef SIGEMT
- case SIGEMT:
-#endif
- case SIGKILL:
- case SIGBUS:
- case SIGSEGV:
- case SIGTERM:
- case SIGIOT:
- _CPU_Fatal_error(0x100 + sig_num);
- }
-}
-
-/*PAGE
- *
- * _CPU_Fatal_error
- */
-
-void _CPU_Fatal_error(unsigned32 error)
-{
- setitimer(ITIMER_REAL, 0, 0);
-
- if ( error ) {
-#ifdef RTEMS_DEBUG
- abort();
-#endif
- if (getenv("RTEMS_DEBUG"))
- abort();
- }
-
- _exit(error);
-}
-
-/*
- * Special Purpose Routines to hide the use of UNIX system calls.
- */
-
-int _CPU_Set_sync_io_handler(
- int fd,
- boolean read,
- boolean write,
- boolean except,
- rtems_sync_io_handler handler
-)
-{
- if ((fd < FD_SETSIZE) && (_CPU_Sync_io_handlers[fd] == NULL)) {
- if (read)
- FD_SET(fd, &sync_io_readfds);
- else
- FD_CLR(fd, &sync_io_readfds);
- if (write)
- FD_SET(fd, &sync_io_writefds);
- else
- FD_CLR(fd, &sync_io_writefds);
- if (except)
- FD_SET(fd, &sync_io_exceptfds);
- else
- FD_CLR(fd, &sync_io_exceptfds);
- _CPU_Sync_io_handlers[fd] = handler;
- if ((fd + 1) > sync_io_nfds)
- sync_io_nfds = fd + 1;
- return 0;
- }
- return -1;
-}
-
-int _CPU_Clear_sync_io_handler(
- int fd
-)
-{
- if ((fd < FD_SETSIZE) && _CPU_Sync_io_handlers[fd]) {
- FD_CLR(fd, &sync_io_readfds);
- FD_CLR(fd, &sync_io_writefds);
- FD_CLR(fd, &sync_io_exceptfds);
- _CPU_Sync_io_handlers[fd] = NULL;
- sync_io_nfds = 0;
- for (fd = 0; fd < FD_SETSIZE; fd++)
- if (FD_ISSET(fd, &sync_io_readfds) ||
- FD_ISSET(fd, &sync_io_writefds) ||
- FD_ISSET(fd, &sync_io_exceptfds))
- sync_io_nfds = fd + 1;
- return 0;
- }
- return -1;
-}
-
-int _CPU_Get_clock_vector( void )
-{
- return SIGALRM;
-}
-
-void _CPU_Start_clock(
- int microseconds
-)
-{
- struct itimerval new;
-
- new.it_value.tv_sec = 0;
- new.it_value.tv_usec = microseconds;
- new.it_interval.tv_sec = 0;
- new.it_interval.tv_usec = microseconds;
-
- setitimer(ITIMER_REAL, &new, 0);
-}
-
-void _CPU_Stop_clock( void )
-{
- struct itimerval new;
- struct sigaction act;
-
- /*
- * Set the SIGALRM signal to ignore any last
- * signals that might come in while we are
- * disarming the timer and removing the interrupt
- * vector.
- */
-
- (void) memset(&act, 0, sizeof(act));
- act.sa_handler = SIG_IGN;
-
- sigaction(SIGALRM, &act, 0);
-
- (void) memset(&new, 0, sizeof(new));
- setitimer(ITIMER_REAL, &new, 0);
-}
-
-int _CPU_SHM_Semid;
-extern void fix_syscall_errno( void );
-
-void _CPU_SHM_Init(
- unsigned32 maximum_nodes,
- boolean is_master_node,
- void **shm_address,
- unsigned32 *shm_length
-)
-{
- int i;
- int shmid;
- char *shm_addr;
- key_t shm_key;
- key_t sem_key;
- int status = 0; /* to avoid unitialized warnings */
- int shm_size;
-
- if (getenv("RTEMS_SHM_KEY"))
- shm_key = strtol(getenv("RTEMS_SHM_KEY"), 0, 0);
- else
-#ifdef RTEMS_SHM_KEY
- shm_key = RTEMS_SHM_KEY;
-#else
- shm_key = 0xa000;
-#endif
-
- if (getenv("RTEMS_SHM_SIZE"))
- shm_size = strtol(getenv("RTEMS_SHM_SIZE"), 0, 0);
- else
-#ifdef RTEMS_SHM_SIZE
- shm_size = RTEMS_SHM_SIZE;
-#else
- shm_size = 64 * 1024;
-#endif
-
- if (getenv("RTEMS_SHM_SEMAPHORE_KEY"))
- sem_key = strtol(getenv("RTEMS_SHM_SEMAPHORE_KEY"), 0, 0);
- else
-#ifdef RTEMS_SHM_SEMAPHORE_KEY
- sem_key = RTEMS_SHM_SEMAPHORE_KEY;
-#else
- sem_key = 0xa001;
-#endif
-
- shmid = shmget(shm_key, shm_size, IPC_CREAT | 0660);
- if ( shmid == -1 ) {
- fix_syscall_errno(); /* in case of newlib */
- perror( "shmget" );
- _CPU_Fatal_halt( 0xdead0001 );
- }
-
- shm_addr = shmat(shmid, (char *)0, SHM_RND);
- if ( shm_addr == (void *)-1 ) {
- fix_syscall_errno(); /* in case of newlib */
- perror( "shmat" );
- _CPU_Fatal_halt( 0xdead0002 );
- }
-
- _CPU_SHM_Semid = semget(sem_key, maximum_nodes + 1, IPC_CREAT | 0660);
- if ( _CPU_SHM_Semid == -1 ) {
- fix_syscall_errno(); /* in case of newlib */
- perror( "semget" );
- _CPU_Fatal_halt( 0xdead0003 );
- }
-
- if ( is_master_node ) {
- for ( i=0 ; i <= maximum_nodes ; i++ ) {
-#if defined(solaris2)
- union semun {
- int val;
- struct semid_ds *buf;
- ushort *array;
- } help;
-
- help.val = 1;
- status = semctl( _CPU_SHM_Semid, i, SETVAL, help );
-#elif defined(__linux__) || defined(__FreeBSD__)
- union semun help;
-
- help.val = 1;
- status = semctl( _CPU_SHM_Semid, i, SETVAL, help );
-#elif defined(hpux)
- status = semctl( _CPU_SHM_Semid, i, SETVAL, 1 );
-#else
-#error "Not a supported unix variant"
-#endif
-
- fix_syscall_errno(); /* in case of newlib */
- if ( status == -1 ) {
- _CPU_Fatal_halt( 0xdead0004 );
- }
- }
- }
-
- *shm_address = shm_addr;
- *shm_length = shm_size;
-
-}
-
-int _CPU_Get_pid( void )
-{
- return getpid();
-}
-
-/*
- * Define this to use signals for MPCI shared memory driver.
- * If undefined, the shared memory driver will poll from the
- * clock interrupt.
- * Ref: ../shmsupp/getcfg.c
- *
- * BEWARE:: many UN*X kernels and debuggers become severely confused when
- * debugging programs which use signals. The problem is *much*
- * worse when using multiple signals, since ptrace(2) tends to
- * drop all signals except 1 in the case of multiples.
- * On hpux9, this problem was so bad, we couldn't use interrupts
- * with the shared memory driver if we ever hoped to debug
- * RTEMS programs.
- * Maybe systems that use /proc don't have this problem...
- */
-
-
-int _CPU_SHM_Get_vector( void )
-{
-#ifdef CPU_USE_SHM_INTERRUPTS
- return SIGUSR1;
-#else
- return 0;
-#endif
-}
-
-void _CPU_SHM_Send_interrupt(
- int pid,
- int vector
-)
-{
- kill((pid_t) pid, vector);
-}
-
-void _CPU_SHM_Lock(
- int semaphore
-)
-{
- struct sembuf sb;
-
- sb.sem_num = semaphore;
- sb.sem_op = -1;
- sb.sem_flg = 0;
-
- while (1) {
- int status = -1;
-
- status = semop(_CPU_SHM_Semid, &sb, 1);
- if ( status >= 0 )
- break;
- if ( status == -1 ) {
- fix_syscall_errno(); /* in case of newlib */
- if (errno == EINTR)
- continue;
- perror("shm lock");
- _CPU_Fatal_halt( 0xdead0005 );
- }
- }
-
-}
-
-void _CPU_SHM_Unlock(
- int semaphore
-)
-{
- struct sembuf sb;
- int status;
-
- sb.sem_num = semaphore;
- sb.sem_op = 1;
- sb.sem_flg = 0;
-
- while (1) {
- status = semop(_CPU_SHM_Semid, &sb, 1);
- if ( status >= 0 )
- break;
-
- if ( status == -1 ) {
- fix_syscall_errno(); /* in case of newlib */
- if (errno == EINTR)
- continue;
- perror("shm unlock");
- _CPU_Fatal_halt( 0xdead0006 );
- }
- }
-
-}
diff --git a/c/src/exec/score/cpu/unix/cpu.h b/c/src/exec/score/cpu/unix/cpu.h
deleted file mode 100644
index 227a631139..0000000000
--- a/c/src/exec/score/cpu/unix/cpu.h
+++ /dev/null
@@ -1,1081 +0,0 @@
-/* cpu.h
- *
- * This include file contains information pertaining to the HP
- * PA-RISC processor (Level 1.1).
- *
- * COPYRIGHT (c) 1994 by Division Incorporated
- *
- * The license and distribution 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_h
-#define __CPU_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/unix.h> /* pick up machine definitions */
-#ifndef ASM
-#include <rtems/score/unixtypes.h>
-#endif
-
-#include <rtems/score/unixsize.h>
-
-#if defined(solaris2)
-#undef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 3
-#undef __STRICT_ANSI__
-#define __STRICT_ANSI__
-#endif
-
-#if defined(linux)
-#define MALLOC_0_RETURNS_NULL
-#endif
-
-/* conditional compilation parameters */
-
-/*
- * Should the calls to _Thread_Enable_dispatch be inlined?
- *
- * If TRUE, then they are inlined.
- * If FALSE, then a subroutine call is made.
- *
- * Basically this is an example of the classic trade-off of size
- * versus speed. Inlining the call (TRUE) typically increases the
- * size of RTEMS while speeding up the enabling of dispatching.
- * [NOTE: In general, the _Thread_Dispatch_disable_level will
- * only be 0 or 1 unless you are in an interrupt handler and that
- * interrupt handler invokes the executive.] When not inlined
- * something calls _Thread_Enable_dispatch which in turns calls
- * _Thread_Dispatch. If the enable dispatch is inlined, then
- * one subroutine call is avoided entirely.]
- */
-
-#define CPU_INLINE_ENABLE_DISPATCH FALSE
-
-/*
- * Should the body of the search loops in _Thread_queue_Enqueue_priority
- * be unrolled one time? In unrolled each iteration of the loop examines
- * two "nodes" on the chain being searched. Otherwise, only one node
- * is examined per iteration.
- *
- * If TRUE, then the loops are unrolled.
- * If FALSE, then the loops are not unrolled.
- *
- * The primary factor in making this decision is the cost of disabling
- * and enabling interrupts (_ISR_Flash) versus the cost of rest of the
- * body of the loop. On some CPUs, the flash is more expensive than
- * one iteration of the loop body. In this case, it might be desirable
- * to unroll the loop. It is important to note that on some CPUs, this
- * code is the longest interrupt disable period in RTEMS. So it is
- * necessary to strike a balance when setting this parameter.
- */
-
-#define CPU_UNROLL_ENQUEUE_PRIORITY TRUE
-
-/*
- * Does RTEMS manage a dedicated interrupt stack in software?
- *
- * If TRUE, then a stack is allocated in _Interrupt_Manager_initialization.
- * If FALSE, nothing is done.
- *
- * If the CPU supports a dedicated interrupt stack in hardware,
- * then it is generally the responsibility of the BSP to allocate it
- * and set it up.
- *
- * If the CPU does not support a dedicated interrupt stack, then
- * the porter has two options: (1) execute interrupts on the
- * stack of the interrupted task, and (2) have RTEMS manage a dedicated
- * interrupt stack.
- *
- * If this is TRUE, CPU_ALLOCATE_INTERRUPT_STACK should also be TRUE.
- *
- * Only one of CPU_HAS_SOFTWARE_INTERRUPT_STACK and
- * CPU_HAS_HARDWARE_INTERRUPT_STACK should be set to TRUE. It is
- * possible that both are FALSE for a particular CPU. Although it
- * is unclear what that would imply about the interrupt processing
- * procedure on that CPU.
- */
-
-#define CPU_HAS_SOFTWARE_INTERRUPT_STACK FALSE
-
-/*
- * Does this CPU have hardware support for a dedicated interrupt stack?
- *
- * If TRUE, then it must be installed during initialization.
- * If FALSE, then no installation is performed.
- *
- * If this is TRUE, CPU_ALLOCATE_INTERRUPT_STACK should also be TRUE.
- *
- * Only one of CPU_HAS_SOFTWARE_INTERRUPT_STACK and
- * CPU_HAS_HARDWARE_INTERRUPT_STACK should be set to TRUE. It is
- * possible that both are FALSE for a particular CPU. Although it
- * is unclear what that would imply about the interrupt processing
- * procedure on that CPU.
- */
-
-#define CPU_HAS_HARDWARE_INTERRUPT_STACK TRUE
-
-/*
- * Does RTEMS allocate a dedicated interrupt stack in the Interrupt Manager?
- *
- * If TRUE, then the memory is allocated during initialization.
- * If FALSE, then the memory is allocated during initialization.
- *
- * This should be TRUE if CPU_HAS_SOFTWARE_INTERRUPT_STACK is TRUE
- * or CPU_INSTALL_HARDWARE_INTERRUPT_STACK is TRUE.
- */
-
-#define CPU_ALLOCATE_INTERRUPT_STACK FALSE
-
-/*
- * Does the RTEMS invoke the user's ISR with the vector number and
- * a pointer to the saved interrupt frame (1) or just the vector
- * number (0)?
- */
-
-#define CPU_ISR_PASSES_FRAME_POINTER 0
-
-/*
- * Does the CPU have hardware floating point?
- *
- * If TRUE, then the RTEMS_FLOATING_POINT task attribute is supported.
- * If FALSE, then the RTEMS_FLOATING_POINT task attribute is ignored.
- *
- * If there is a FP coprocessor such as the i387 or mc68881, then
- * the answer is TRUE.
- *
- * The macro name "NO_CPU_HAS_FPU" should be made CPU specific.
- * It indicates whether or not this CPU model has FP support. For
- * example, it would be possible to have an i386_nofp CPU model
- * which set this to false to indicate that you have an i386 without
- * an i387 and wish to leave floating point support out of RTEMS.
- */
-
-#define CPU_HARDWARE_FP TRUE
-
-/*
- * Are all tasks RTEMS_FLOATING_POINT tasks implicitly?
- *
- * If TRUE, then the RTEMS_FLOATING_POINT task attribute is assumed.
- * If FALSE, then the RTEMS_FLOATING_POINT task attribute is followed.
- *
- * So far, the only CPU in which this option has been used is the
- * HP PA-RISC. The HP C compiler and gcc both implicitly use the
- * floating point registers to perform integer multiplies. If
- * a function which you would not think utilize the FP unit DOES,
- * then one can not easily predict which tasks will use the FP hardware.
- * In this case, this option should be TRUE.
- *
- * If CPU_HARDWARE_FP is FALSE, then this should be FALSE as well.
- */
-
-#define CPU_ALL_TASKS_ARE_FP FALSE
-
-/*
- * Should the IDLE task have a floating point context?
- *
- * If TRUE, then the IDLE task is created as a RTEMS_FLOATING_POINT task
- * and it has a floating point context which is switched in and out.
- * If FALSE, then the IDLE task does not have a floating point context.
- *
- * Setting this to TRUE negatively impacts the time required to preempt
- * the IDLE task from an interrupt because the floating point context
- * must be saved as part of the preemption.
- */
-
-#define CPU_IDLE_TASK_IS_FP FALSE
-
-/*
- * Should the saving of the floating point registers be deferred
- * until a context switch is made to another different floating point
- * task?
- *
- * If TRUE, then the floating point context will not be stored until
- * necessary. It will remain in the floating point registers and not
- * disturned until another floating point task is switched to.
- *
- * If FALSE, then the floating point context is saved when a floating
- * point task is switched out and restored when the next floating point
- * task is restored. The state of the floating point registers between
- * those two operations is not specified.
- *
- * If the floating point context does NOT have to be saved as part of
- * interrupt dispatching, then it should be safe to set this to TRUE.
- *
- * Setting this flag to TRUE results in using a different algorithm
- * for deciding when to save and restore the floating point context.
- * The deferred FP switch algorithm minimizes the number of times
- * the FP context is saved and restored. The FP context is not saved
- * until a context switch is made to another, different FP task.
- * Thus in a system with only one FP task, the FP context will never
- * be saved or restored.
- */
-
-#define CPU_USE_DEFERRED_FP_SWITCH TRUE
-
-/*
- * Does this port provide a CPU dependent IDLE task implementation?
- *
- * If TRUE, then the routine _CPU_Thread_Idle_body
- * must be provided and is the default IDLE thread body instead of
- * _CPU_Thread_Idle_body.
- *
- * If FALSE, then use the generic IDLE thread body if the BSP does
- * not provide one.
- *
- * This is intended to allow for supporting processors which have
- * a low power or idle mode. When the IDLE thread is executed, then
- * the CPU can be powered down.
- *
- * The order of precedence for selecting the IDLE thread body is:
- *
- * 1. BSP provided
- * 2. CPU dependent (if provided)
- * 3. generic (if no BSP and no CPU dependent)
- */
-
-#define CPU_PROVIDES_IDLE_THREAD_BODY TRUE
-
-/*
- * Does the stack grow up (toward higher addresses) or down
- * (toward lower addresses)?
- *
- * If TRUE, then the grows upward.
- * If FALSE, then the grows toward smaller addresses.
- */
-
-#if defined(__hppa__)
-#define CPU_STACK_GROWS_UP TRUE
-#elif defined(__sparc__) || defined(__i386__)
-#define CPU_STACK_GROWS_UP FALSE
-#else
-#error "unknown CPU!!"
-#endif
-
-
-/*
- * The following is the variable attribute used to force alignment
- * of critical RTEMS structures. On some processors it may make
- * sense to have these aligned on tighter boundaries than
- * the minimum requirements of the compiler in order to have as
- * much of the critical data area as possible in a cache line.
- *
- * The placement of this macro in the declaration of the variables
- * is based on the syntactically requirements of the GNU C
- * "__attribute__" extension. For example with GNU C, use
- * the following to force a structures to a 32 byte boundary.
- *
- * __attribute__ ((aligned (32)))
- *
- * NOTE: Currently only the Priority Bit Map table uses this feature.
- * To benefit from using this, the data must be heavily
- * used so it will stay in the cache and used frequently enough
- * in the executive to justify turning this on.
- */
-
-#ifdef __GNUC__
-#define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned (32)))
-#else
-#define CPU_STRUCTURE_ALIGNMENT
-#endif
-
-/*
- * Define what is required to specify how the network to host conversion
- * routines are handled.
- */
-
-#if defined(__hppa__) || defined(__sparc__)
-#define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE
-#define CPU_BIG_ENDIAN TRUE
-#define CPU_LITTLE_ENDIAN FALSE
-#elif defined(__i386__)
-#define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE
-#define CPU_BIG_ENDIAN FALSE
-#define CPU_LITTLE_ENDIAN TRUE
-#else
-#error "Unknown CPU!!!"
-#endif
-
-/*
- * The following defines the number of bits actually used in the
- * interrupt field of the task mode. How those bits map to the
- * CPU interrupt levels is defined by the routine _CPU_ISR_Set_level().
- */
-
-#define CPU_MODES_INTERRUPT_MASK 0x00000001
-
-#define CPU_NAME "UNIX"
-
-/*
- * Processor defined structures
- *
- * Examples structures include the descriptor tables from the i386
- * and the processor control structure on the i960ca.
- */
-
-/* may need to put some structures here. */
-
-#if defined(__hppa__)
-/*
- * Word indices within a jmp_buf structure
- */
-
-#ifdef RTEMS_NEWLIB_SETJMP
-#define RP_OFF 6
-#define SP_OFF 2
-#define R3_OFF 10
-#define R4_OFF 11
-#define R5_OFF 12
-#define R6_OFF 13
-#define R7_OFF 14
-#define R8_OFF 15
-#define R9_OFF 16
-#define R10_OFF 17
-#define R11_OFF 18
-#define R12_OFF 19
-#define R13_OFF 20
-#define R14_OFF 21
-#define R15_OFF 22
-#define R16_OFF 23
-#define R17_OFF 24
-#define R18_OFF 25
-#define DP_OFF 26
-#endif
-
-#ifdef RTEMS_UNIXLIB_SETJMP
-#define RP_OFF 0
-#define SP_OFF 1
-#define R3_OFF 4
-#define R4_OFF 5
-#define R5_OFF 6
-#define R6_OFF 7
-#define R7_OFF 8
-#define R8_OFF 9
-#define R9_OFF 10
-#define R10_OFF 11
-#define R11_OFF 12
-#define R12_OFF 13
-#define R13_OFF 14
-#define R14_OFF 15
-#define R15_OFF 16
-#define R16_OFF 17
-#define R17_OFF 18
-#define R18_OFF 19
-#define DP_OFF 20
-#endif
-#endif
-
-#if defined(__i386__)
-
-#ifdef RTEMS_NEWLIB
-#error "Newlib not installed"
-#endif
-
-/*
- * For Linux 1.1
- */
-
-#ifdef RTEMS_UNIXLIB
-#if defined(__FreeBSD__)
-#define RET_OFF 0
-#define EBX_OFF 1
-#define EBP_OFF 2
-#define ESP_OFF 3
-#define ESI_OFF 4
-#define EDI_OFF 5
-#else
-#define EBX_OFF 0
-#define ESI_OFF 1
-#define EDI_OFF 2
-#define EBP_OFF 3
-#define ESP_OFF 4
-#define RET_OFF 5
-#endif
-#endif
-
-#endif
-
-#if defined(__sparc__)
-
-/*
- * Word indices within a jmp_buf structure
- */
-
-#ifdef RTEMS_NEWLIB
-#define ADDR_ADJ_OFFSET -8
-#define SP_OFF 0
-#define RP_OFF 1
-#define FP_OFF 2
-#endif
-
-#ifdef RTEMS_UNIXLIB
-#define ADDR_ADJ_OFFSET 0
-#define G0_OFF 0
-#define SP_OFF 1
-#define RP_OFF 2
-#define FP_OFF 3
-#define I7_OFF 4
-#endif
-
-#endif
-
-/*
- * Contexts
- *
- * Generally there are 2 types of context to save.
- * 1. Interrupt registers to save
- * 2. Task level registers to save
- *
- * This means we have the following 3 context items:
- * 1. task level context stuff:: Context_Control
- * 2. floating point task stuff:: Context_Control_fp
- * 3. special interrupt level context :: Context_Control_interrupt
- *
- * On some processors, it is cost-effective to save only the callee
- * preserved registers during a task context switch. This means
- * that the ISR code needs to save those registers which do not
- * persist across function calls. It is not mandatory to make this
- * distinctions between the caller/callee saves registers for the
- * purpose of minimizing context saved during task switch and on interrupts.
- * If the cost of saving extra registers is minimal, simplicity is the
- * choice. Save the same context on interrupt entry as for tasks in
- * this case.
- *
- * Additionally, if gdb is to be made aware of RTEMS tasks for this CPU, then
- * care should be used in designing the context area.
- *
- * On some CPUs with hardware floating point support, the Context_Control_fp
- * structure will not be used or it simply consist of an array of a
- * fixed number of bytes. This is done when the floating point context
- * is dumped by a "FP save context" type instruction and the format
- * is not really defined by the CPU. In this case, there is no need
- * to figure out the exact format -- only the size. Of course, although
- * this is enough information for RTEMS, it is probably not enough for
- * a debugger such as gdb. But that is another problem.
- */
-
-/*
- * This is really just the area for the following fields.
- *
- * jmp_buf regs;
- * unsigned32 isr_level;
- *
- * Doing it this way avoids conflicts between the native stuff and the
- * RTEMS stuff.
- *
- * NOTE:
- * hpux9 setjmp is optimized for the case where the setjmp buffer
- * is 8 byte aligned. In a RISC world, this seems likely to enable
- * 8 byte copies, especially for the float registers.
- * So we always align them on 8 byte boundaries.
- */
-
-#ifdef __GNUC__
-#define CONTEXT_STRUCTURE_ALIGNMENT __attribute__ ((aligned (8)))
-#else
-#define CONTEXT_STRUCTURE_ALIGNMENT
-#endif
-
-typedef struct {
- char Area[ CPU_CONTEXT_SIZE_IN_BYTES ] CONTEXT_STRUCTURE_ALIGNMENT;
-} Context_Control;
-
-typedef struct {
-} Context_Control_fp;
-
-typedef struct {
-} CPU_Interrupt_frame;
-
-
-/*
- * The following table contains the information required to configure
- * the UNIX Simulator specific parameters.
- */
-
-typedef struct {
- void (*pretasking_hook)( void );
- void (*predriver_hook)( void );
- void (*postdriver_hook)( void );
- void (*idle_task)( void );
- boolean do_zero_of_workspace;
- unsigned32 idle_task_stack_size;
- unsigned32 interrupt_stack_size;
- unsigned32 extra_mpci_receive_server_stack;
- void * (*stack_allocate_hook)( unsigned32 );
- void (*stack_free_hook)( void* );
- /* end of required fields */
-} rtems_cpu_table;
-
-/*
- * This variable is optional. It is used on CPUs on which it is difficult
- * to generate an "uninitialized" FP context. It is filled in by
- * _CPU_Initialize and copied into the task's FP context area during
- * _CPU_Context_Initialize.
- */
-
-SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context;
-
-/*
- * On some CPUs, RTEMS supports a software managed interrupt stack.
- * This stack is allocated by the Interrupt Manager and the switch
- * is performed in _ISR_Handler. These variables contain pointers
- * to the lowest and highest addresses in the chunk of memory allocated
- * for the interrupt stack. Since it is unknown whether the stack
- * grows up or down (in general), this give the CPU dependent
- * code the option of picking the version it wants to use.
- *
- * NOTE: These two variables are required if the macro
- * CPU_HAS_SOFTWARE_INTERRUPT_STACK is defined as TRUE.
- */
-
-SCORE_EXTERN void *_CPU_Interrupt_stack_low;
-SCORE_EXTERN void *_CPU_Interrupt_stack_high;
-
-/*
- * With some compilation systems, it is difficult if not impossible to
- * call a high-level language routine from assembly language. This
- * is especially true of commercial Ada compilers and name mangling
- * C++ ones. This variable can be optionally defined by the CPU porter
- * and contains the address of the routine _Thread_Dispatch. This
- * can make it easier to invoke that routine at the end of the interrupt
- * sequence (if a dispatch is necessary).
- */
-
-SCORE_EXTERN void (*_CPU_Thread_dispatch_pointer)();
-
-/*
- * Nothing prevents the porter from declaring more CPU specific variables.
- */
-
-/* XXX: if needed, put more variables here */
-
-/*
- * The size of the floating point context area. On some CPUs this
- * will not be a "sizeof" because the format of the floating point
- * area is not defined -- only the size is. This is usually on
- * CPUs with a "floating point save context" instruction.
- */
-
-#define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp )
-
-/*
- * The size of a frame on the stack
- */
-
-#if defined(__hppa__)
-#define CPU_FRAME_SIZE (32 * 4)
-#elif defined(__sparc__)
-#define CPU_FRAME_SIZE (112) /* based on disassembled test code */
-#elif defined(__i386__)
-#define CPU_FRAME_SIZE (24) /* return address, sp, and bp pushed plus fudge */
-#else
-#error "Unknown CPU!!!"
-#endif
-
-/*
- * Amount of extra stack (above minimum stack size) required by
- * MPCI receive server thread. Remember that in a multiprocessor
- * system this thread must exist and be able to process all directives.
- */
-
-#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0
-
-/*
- * This defines the number of entries in the ISR_Vector_table managed
- * by RTEMS.
- */
-
-#define CPU_INTERRUPT_NUMBER_OF_VECTORS 64
-#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1)
-
-/*
- * Should be large enough to run all RTEMS tests. This insures
- * that a "reasonable" small application should not have any problems.
- */
-
-#define CPU_STACK_MINIMUM_SIZE (16 * 1024)
-
-/*
- * CPU's worst alignment requirement for data types on a byte boundary. This
- * alignment does not take into account the requirements for the stack.
- */
-
-#define CPU_ALIGNMENT 8
-
-/*
- * This number corresponds to the byte alignment requirement for the
- * heap handler. This alignment requirement may be stricter than that
- * for the data types alignment specified by CPU_ALIGNMENT. It is
- * common for the heap to follow the same alignment requirement as
- * CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict enough for the heap,
- * then this should be set to CPU_ALIGNMENT.
- *
- * NOTE: This does not have to be a power of 2. It does have to
- * be greater or equal to than CPU_ALIGNMENT.
- */
-
-#define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * This number corresponds to the byte alignment requirement for memory
- * buffers allocated by the partition manager. This alignment requirement
- * may be stricter than that for the data types alignment specified by
- * CPU_ALIGNMENT. It is common for the partition to follow the same
- * alignment requirement as CPU_ALIGNMENT. If the CPU_ALIGNMENT is strict
- * enough for the partition, then this should be set to CPU_ALIGNMENT.
- *
- * NOTE: This does not have to be a power of 2. It does have to
- * be greater or equal to than CPU_ALIGNMENT.
- */
-
-#define CPU_PARTITION_ALIGNMENT CPU_ALIGNMENT
-
-/*
- * This number corresponds to the byte alignment requirement for the
- * stack. This alignment requirement may be stricter than that for the
- * data types alignment specified by CPU_ALIGNMENT. If the CPU_ALIGNMENT
- * is strict enough for the stack, then this should be set to 0.
- *
- * NOTE: This must be a power of 2 either 0 or greater than CPU_ALIGNMENT.
- */
-
-#define CPU_STACK_ALIGNMENT 64
-
-/* ISR handler macros */
-
-/*
- * Disable all interrupts for an RTEMS critical section. The previous
- * level is returned in _level.
- */
-
-extern unsigned32 _CPU_ISR_Disable_support(void);
-
-#define _CPU_ISR_Disable( _level ) \
- do { \
- (_level) = _CPU_ISR_Disable_support(); \
- } while ( 0 )
-
-/*
- * Enable interrupts to the previous level (returned by _CPU_ISR_Disable).
- * This indicates the end of an RTEMS critical section. The parameter
- * _level is not modified.
- */
-
-void _CPU_ISR_Enable(unsigned32 level);
-
-/*
- * This temporarily restores the interrupt to _level before immediately
- * disabling them again. This is used to divide long RTEMS critical
- * sections into two or more parts. The parameter _level is not
- * modified.
- */
-
-#define _CPU_ISR_Flash( _level ) \
- do { \
- register unsigned32 _ignored = 0; \
- _CPU_ISR_Enable( (_level) ); \
- _CPU_ISR_Disable( _ignored ); \
- } while ( 0 )
-
-/*
- * Map interrupt level in task mode onto the hardware that the CPU
- * actually provides. Currently, interrupt levels which do not
- * map onto the CPU in a generic fashion are undefined. Someday,
- * it would be nice if these were "mapped" by the application
- * via a callout. For example, m68k has 8 levels 0 - 7, levels
- * 8 - 255 would be available for bsp/application specific meaning.
- * This could be used to manage a programmable interrupt controller
- * via the rtems_task_mode directive.
- */
-
-#define _CPU_ISR_Set_level( new_level ) \
- { \
- if ( new_level == 0 ) _CPU_ISR_Enable( 0 ); \
- else _CPU_ISR_Enable( 1 ); \
- }
-
-unsigned32 _CPU_ISR_Get_level( void );
-
-/* end of ISR handler macros */
-
-/* Context handler macros */
-
-/*
- * This routine is responsible for somehow restarting the currently
- * executing task. If you are lucky, then all that is necessary
- * is restoring the context. Otherwise, there will need to be
- * a special assembly routine which does something special in this
- * case. Context_Restore should work most of the time. It will
- * not work if restarting self conflicts with the stack frame
- * assumptions of restoring a context.
- */
-
-#define _CPU_Context_Restart_self( _the_context ) \
- _CPU_Context_restore( (_the_context) );
-
-/*
- * The purpose of this macro is to allow the initial pointer into
- * a floating point context area (used to save the floating point
- * context) to be at an arbitrary place in the floating point
- * context area.
- *
- * This is necessary because some FP units are designed to have
- * their context saved as a stack which grows into lower addresses.
- * Other FP units can be saved by simply moving registers into offsets
- * from the base of the context area. Finally some FP units provide
- * a "dump context" instruction which could fill in from high to low
- * or low to high based on the whim of the CPU designers.
- */
-
-#define _CPU_Context_Fp_start( _base, _offset ) \
- ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
-
-/*
- * This routine initializes the FP context area passed to it to.
- * There are a few standard ways in which to initialize the
- * floating point context. The code included for this macro assumes
- * that this is a CPU in which a "initial" FP context was saved into
- * _CPU_Null_fp_context and it simply copies it to the destination
- * context passed to it.
- *
- * Other models include (1) not doing anything, and (2) putting
- * a "null FP status word" in the correct place in the FP context.
- */
-
-#define _CPU_Context_Initialize_fp( _destination ) \
- { \
- *((Context_Control_fp *) *((void **) _destination)) = _CPU_Null_fp_context; \
- }
-
-#define _CPU_Context_save_fp( _fp_context ) \
- _CPU_Save_float_context( *(Context_Control_fp **)(_fp_context))
-
-#define _CPU_Context_restore_fp( _fp_context ) \
- _CPU_Restore_float_context( *(Context_Control_fp **)(_fp_context))
-
-extern void _CPU_Context_Initialize(
- Context_Control *_the_context,
- unsigned32 *_stack_base,
- unsigned32 _size,
- unsigned32 _new_level,
- void *_entry_point,
- boolean _is_fp
-);
-
-/* end of Context handler macros */
-
-/* Fatal Error manager macros */
-
-/*
- * This routine copies _error into a known place -- typically a stack
- * location or a register, optionally disables interrupts, and
- * halts/stops the CPU.
- */
-
-#define _CPU_Fatal_halt( _error ) \
- _CPU_Fatal_error( _error )
-
-/* end of Fatal Error manager macros */
-
-/* Bitfield handler macros */
-
-/*
- * This routine sets _output to the bit number of the first bit
- * set in _value. _value is of CPU dependent type Priority_Bit_map_control.
- * This type may be either 16 or 32 bits wide although only the 16
- * least significant bits will be used.
- *
- * There are a number of variables in using a "find first bit" type
- * instruction.
- *
- * (1) What happens when run on a value of zero?
- * (2) Bits may be numbered from MSB to LSB or vice-versa.
- * (3) The numbering may be zero or one based.
- * (4) The "find first bit" instruction may search from MSB or LSB.
- *
- * RTEMS guarantees that (1) will never happen so it is not a concern.
- * (2),(3), (4) are handled by the macros _CPU_Priority_mask() and
- * _CPU_Priority_bits_index(). These three form a set of routines
- * which must logically operate together. Bits in the _value are
- * set and cleared based on masks built by _CPU_Priority_mask().
- * The basic major and minor values calculated by _Priority_Major()
- * and _Priority_Minor() are "massaged" by _CPU_Priority_bits_index()
- * to properly range between the values returned by the "find first bit"
- * instruction. This makes it possible for _Priority_Get_highest() to
- * calculate the major and directly index into the minor table.
- * This mapping is necessary to ensure that 0 (a high priority major/minor)
- * is the first bit found.
- *
- * This entire "find first bit" and mapping process depends heavily
- * on the manner in which a priority is broken into a major and minor
- * components with the major being the 4 MSB of a priority and minor
- * the 4 LSB. Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
- * priority. And (15 << 4) + 14 corresponds to priority 254 -- the next
- * to the lowest priority.
- *
- * If your CPU does not have a "find first bit" instruction, then
- * there are ways to make do without it. Here are a handful of ways
- * to implement this in software:
- *
- * - a series of 16 bit test instructions
- * - a "binary search using if's"
- * - _number = 0
- * if _value > 0x00ff
- * _value >>=8
- * _number = 8;
- *
- * if _value > 0x0000f
- * _value >=8
- * _number += 4
- *
- * _number += bit_set_table[ _value ]
- *
- * where bit_set_table[ 16 ] has values which indicate the first
- * bit set
- */
-
-/*
- * The UNIX port uses the generic C algorithm for bitfield scan to avoid
- * dependencies on either a native bitscan instruction or an ffs() in the
- * C library.
- */
-
-#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
-#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
-
-/* end of Bitfield handler macros */
-
-/* Priority handler handler macros */
-
-/*
- * The UNIX port uses the generic C algorithm for bitfield scan to avoid
- * dependencies on either a native bitscan instruction or an ffs() in the
- * C library.
- */
-
-/* end of Priority handler macros */
-
-/* functions */
-
-/*
- * _CPU_Initialize
- *
- * This routine performs CPU dependent initialization.
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch)
-);
-
-/*
- * _CPU_ISR_install_raw_handler
- *
- * This routine installs a "raw" interrupt handler directly into the
- * processor's vector table.
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_ISR_install_vector
- *
- * This routine installs an interrupt vector.
- */
-
-void _CPU_ISR_install_vector(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-);
-
-/*
- * _CPU_Install_interrupt_stack
- *
- * This routine installs the hardware interrupt stack pointer.
- *
- * NOTE: It need only be provided if CPU_HAS_HARDWARE_INTERRUPT_STACK
- * is TRUE.
- */
-
-void _CPU_Install_interrupt_stack( void );
-
-/*
- * _CPU_Thread_Idle_body
- *
- * This routine is the CPU dependent IDLE thread body.
- *
- * NOTE: It need only be provided if CPU_PROVIDES_IDLE_THREAD_BODY
- * is TRUE.
- */
-
-void _CPU_Thread_Idle_body( void );
-
-/*
- * _CPU_Context_switch
- *
- * This routine switches from the run context to the heir context.
- */
-
-void _CPU_Context_switch(
- Context_Control *run,
- Context_Control *heir
-);
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally 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.
- */
-
-void _CPU_Context_restore(
- Context_Control *new_context
-);
-
-/*
- * _CPU_Save_float_context
- *
- * This routine saves the floating point context passed to it.
- */
-
-void _CPU_Save_float_context(
- Context_Control_fp *fp_context_ptr
-);
-
-/*
- * _CPU_Restore_float_context
- *
- * This routine restores the floating point context passed to it.
- */
-
-void _CPU_Restore_float_context(
- Context_Control_fp *fp_context_ptr
-);
-
-
-void _CPU_ISR_Set_signal_level(
- unsigned32 level
-);
-
-void _CPU_Fatal_error(
- unsigned32 _error
-);
-
-/* The following routine swaps the endian format of an unsigned int.
- * It must be static because it is referenced indirectly.
- *
- * This version will work on any processor, but if there is a better
- * way for your CPU PLEASE use it. The most common way to do this is to:
- *
- * swap least significant two bytes with 16-bit rotate
- * swap upper and lower 16-bits
- * swap most significant two bytes with 16-bit rotate
- *
- * Some CPUs have special instructions which swap a 32-bit quantity in
- * a single instruction (e.g. i486). It is probably best to avoid
- * an "endian swapping control bit" in the CPU. One good reason is
- * that interrupts would probably have to be disabled to insure that
- * an interrupt does not try to access the same "chunk" with the wrong
- * endian. Another good reason is that on some CPUs, the endian bit
- * endianness for ALL fetches -- both code and data -- so the code
- * will be fetched incorrectly.
- */
-
-static inline unsigned int CPU_swap_u32(
- unsigned int value
-)
-{
- unsigned32 byte1, byte2, byte3, byte4, swapped;
-
- byte4 = (value >> 24) & 0xff;
- byte3 = (value >> 16) & 0xff;
- byte2 = (value >> 8) & 0xff;
- byte1 = value & 0xff;
-
- swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4;
- return( swapped );
-}
-
-#define CPU_swap_u16( value ) \
- (((value&0xff) << 8) | ((value >> 8)&0xff))
-
-/*
- * Special Purpose Routines to hide the use of UNIX system calls.
- */
-
-
-/*
- * Pointer to a sync io Handler
- */
-
-typedef void ( *rtems_sync_io_handler )(
- int fd,
- boolean read,
- boolean wrtie,
- boolean except
-);
-
-/* returns -1 if fd to large, 0 is successful */
-int _CPU_Set_sync_io_handler(
- int fd,
- boolean read,
- boolean write,
- boolean except,
- rtems_sync_io_handler handler
-);
-
-/* returns -1 if fd to large, o if successful */
-int _CPU_Clear_sync_io_handler(
- int fd
-);
-
-int _CPU_Get_clock_vector( void );
-
-void _CPU_Start_clock(
- int microseconds
-);
-
-void _CPU_Stop_clock( void );
-
-void _CPU_SHM_Init(
- unsigned32 maximum_nodes,
- boolean is_master_node,
- void **shm_address,
- unsigned32 *shm_length
-);
-
-int _CPU_Get_pid( void );
-
-int _CPU_SHM_Get_vector( void );
-
-void _CPU_SHM_Send_interrupt(
- int pid,
- int vector
-);
-
-void _CPU_SHM_Lock(
- int semaphore
-);
-
-void _CPU_SHM_Unlock(
- int semaphore
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/exec/score/cpu/unix/unix.h b/c/src/exec/score/cpu/unix/unix.h
deleted file mode 100644
index 52cfef79e4..0000000000
--- a/c/src/exec/score/cpu/unix/unix.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* unix.h
- *
- * This include file contains the definitions required by RTEMS
- * which are typical for a modern UNIX computer using GCC.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __UNIX_h
-#define __UNIX_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This file contains the information required to build
- * RTEMS for a particular member of the "unix"
- * family when executing in protected mode. It does
- * this by setting variables to indicate which implementation
- * dependent features are present in a particular member
- * of the family.
- */
-
-#if defined(hpux)
-
-#define CPU_MODEL_NAME "HP-UX"
-
-#elif defined(solaris2)
-
-#define CPU_MODEL_NAME "Solaris"
-
-#elif defined(__linux__)
-
-#define CPU_MODEL_NAME "Linux"
-
-#elif defined(linux)
-
-#define CPU_MODEL_NAME "Linux"
-
-#elif defined(__FreeBSD__)
-
-#define CPU_MODEL_NAME "FreeBSD"
-
-#else
-
-#error "Unsupported CPU Model"
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/score/cpu/unix/unixtypes.h b/c/src/exec/score/cpu/unix/unixtypes.h
deleted file mode 100644
index 1ecaa2307d..0000000000
--- a/c/src/exec/score/cpu/unix/unixtypes.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* unixtypes.h
- *
- * This include file contains type definitions which are appropriate
- * for a typical modern UNIX box using GNU C for the RTEMS simulator.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __UNIX_TYPES_h
-#define __UNIX_TYPES_h
-
-#ifndef ASM
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * some C++ compilers (eg: HP's) don't do 'signed' or 'volatile'
- */
-#if defined(__cplusplus) && !defined(__GNUC__)
-#define signed
-#define volatile
-#endif
-
-/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* unsigned 8-bit integer */
-typedef unsigned short unsigned16; /* unsigned 16-bit integer */
-typedef unsigned int unsigned32; /* unsigned 32-bit integer */
-
-typedef unsigned16 Priority_Bit_map_control;
-
-typedef signed char signed8; /* 8-bit signed integer */
-typedef signed short signed16; /* 16-bit signed integer */
-typedef signed int signed32; /* 32-bit signed integer */
-
-/*
- * some C++ compilers (eg: HP's) don't do 'long long'
- */
-#if defined(__GNUC__)
-typedef unsigned long long unsigned64; /* unsigned 64-bit integer */
-typedef signed long long signed64; /* 64 bit signed integer */
-#endif
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-typedef void unix_isr;
-
-typedef unix_isr ( *unix_isr_entry )( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !ASM */
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/Makefile.in b/c/src/exec/score/headers/Makefile.in
deleted file mode 100644
index 920e738c03..0000000000
--- a/c/src/exec/score/headers/Makefile.in
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# H_FILES that get installed in the rtems/score subdirectoy
-H_PIECES= address apiext bitfield chain context copyrt coremsg coremutex \
- coresem heap interr isr mpci mppkt object objectmp \
- priority stack states sysstate thread threadmp threadq \
- tod tqdata userext watchdog wkspace
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-# H_FILES that get installed in the rtems subdirectoy
-SAPI_H_PIECES=debug system
-SAPI_H_FILES=$(SAPI_H_PIECES:%=$(srcdir)/%.h)
-
-# H_FILES that get installed at the top level
-EXTERNAL_H_PIECES =
-EXTERNAL_H_FILES=$(EXTERNAL_H_PIECES:%=$(srcdir)/%.h)
-
-SRCS=$(H_FILES) $(SAPI_H_FILES) $(EXTERNAL_H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
- $(INSTALL) -m 444 ${SAPI_H_FILES} $(PROJECT_INCLUDE)/rtems/
-# $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
diff --git a/c/src/exec/score/headers/address.h b/c/src/exec/score/headers/address.h
deleted file mode 100644
index e64cd54931..0000000000
--- a/c/src/exec/score/headers/address.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* address.h
- *
- * This include file contains the information required to manipulate
- * physical addresses.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_ADDRESSES_h
-#define __RTEMS_ADDRESSES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/address.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/apiext.h b/c/src/exec/score/headers/apiext.h
deleted file mode 100644
index 804b2dea4c..0000000000
--- a/c/src/exec/score/headers/apiext.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* apiext.h
- *
- * XXX
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __API_EXTENSIONS_h
-#define __API_EXTENSIONS_h
-
-#include <rtems/score/chain.h>
-#include <rtems/score/thread.h>
-
-/*
- * The control structure which defines the points at which an API
- * can add an extension to the system initialization thread.
- */
-
-typedef void (*API_extensions_Predriver_hook)(void);
-typedef void (*API_extensions_Postdriver_hook)(void);
-typedef void (*API_extensions_Postswitch_hook)(
- Thread_Control *
- );
-
-
-typedef struct {
- Chain_Node Node;
- API_extensions_Predriver_hook predriver_hook;
- API_extensions_Postdriver_hook postdriver_hook;
- API_extensions_Postswitch_hook postswitch_hook;
-} API_extensions_Control;
-
-/*
- * This is the list of API extensions to the system initialization.
- */
-
-SCORE_EXTERN Chain_Control _API_extensions_List;
-
-/*
- * _API_extensions_Initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the API extension handler.
- *
- */
-
-void _API_extensions_Initialization( void );
-
-/*
- * _API_extensions_Add
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _API_extensions_Add(
- API_extensions_Control *the_extension
-);
-
-/*
- * _API_extensions_Run_predriver
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _API_extensions_Run_predriver( void );
-
-/*
- * _API_extensions_Run_postdriver
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _API_extensions_Run_postdriver( void );
-
-/*
- * _API_extensions_Run_postswitch
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _API_extensions_Run_postswitch( void );
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/bitfield.h b/c/src/exec/score/headers/bitfield.h
deleted file mode 100644
index bbced47652..0000000000
--- a/c/src/exec/score/headers/bitfield.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* bitfield.h
- *
- * This include file contains all bit field manipulation routines.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_BITFIELD_h
-#define __RTEMS_BITFIELD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * _Bitfield_Find_first_bit
- *
- * DESCRIPTION:
- *
- * This routine returns the bit_number of the first bit set
- * in the specified value. The correspondence between bit_number
- * and actual bit position is processor dependent. The search for
- * the first bit set may run from most to least significant bit
- * or vice-versa.
- *
- * NOTE:
- *
- * This routine is used when the executing thread is removed
- * from the ready state and, as a result, its performance has a
- * significant impact on the performance of the executive as a whole.
- */
-
-#if ( CPU_USE_GENERIC_BITFIELD_DATA == TRUE )
-
-#ifndef SCORE_INIT
-extern const unsigned char __log2table[256];
-#else
-const unsigned char __log2table[256] = {
- 7, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 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,
- 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, 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, 0, 0
-};
-#endif
-
-#endif
-
-#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE )
-
-#define _Bitfield_Find_first_bit( _value, _bit_number ) \
- _CPU_Bitfield_Find_first_bit( _value, _bit_number )
-
-#else
-
-/*
- * The following must be a macro because if a CPU specific version
- * is used it will most likely use inline assembly.
- */
-
-#define _Bitfield_Find_first_bit( _value, _bit_number ) \
- { \
- register unsigned32 __value = (unsigned32) (_value); \
- register const unsigned char *__p = __log2table; \
- \
- if ( __value < 0x100 ) \
- (_bit_number) = __p[ __value ] + 8; \
- else \
- (_bit_number) = __p[ __value >> 8 ]; \
- }
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/chain.h b/c/src/exec/score/headers/chain.h
deleted file mode 100644
index 910f5e4414..0000000000
--- a/c/src/exec/score/headers/chain.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/* chain.h
- *
- * This include file contains all the constants and structures associated
- * with the Doubly Linked Chain Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CHAIN_h
-#define __RTEMS_CHAIN_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/address.h>
-
-/*
- * This is used to manage each element (node) which is placed
- * on a chain.
- *
- * NOTE: Typically, a more complicated structure will use the
- * chain package. The more complicated structure will
- * include a chain node as the first element in its
- * control structure. It will then call the chain package
- * with a pointer to that node element. The node pointer
- * and the higher level structure start at the same address
- * so the user can cast the pointers back and forth.
- *
- */
-
-typedef struct Chain_Node_struct Chain_Node;
-
-struct Chain_Node_struct {
- Chain_Node *next;
- Chain_Node *previous;
-};
-
-/*
- * This is used to manage a chain. A chain consists of a doubly
- * linked list of zero or more nodes.
- *
- * NOTE: This implementation does not require special checks for
- * manipulating the first and last elements on the chain.
- * To accomplish this the chain control structure is
- * treated as two overlapping chain nodes. The permanent
- * head of the chain overlays a node structure on the
- * first and permanent_null fields. The permanent tail
- * of the chain overlays a node structure on the
- * permanent_null and last elements of the structure.
- *
- */
-
-typedef struct {
- Chain_Node *first;
- Chain_Node *permanent_null;
- Chain_Node *last;
-} Chain_Control;
-
-/*
- * _Chain_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the_chain structure to manage the
- * contiguous array of number_nodes nodes which starts at
- * starting_address. Each node is of node_size bytes.
- *
- */
-
-void _Chain_Initialize(
- Chain_Control *the_chain,
- void *starting_address,
- unsigned32 number_nodes,
- unsigned32 node_size
-);
-
-/*
- * _Chain_Get_first_unprotected
- */
-
-#ifndef USE_INLINES
-Chain_Node *_Chain_Get_first_unprotected(
- Chain_Control *the_chain
-);
-#endif
-
-/*
- * _Chain_Extract
- *
- * DESCRIPTION:
- *
- * This routine extracts the_node from the chain on which it resides.
- * It disables interrupts to insure the atomicity of the
- * extract operation.
- *
- */
-
-void _Chain_Extract(
- Chain_Node *the_node
-);
-
-/*
- * _Chain_Get
- *
- * DESCRIPTION:
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. If the_chain is empty, then NULL is returned.
- * It disables interrupts to insure the atomicity of the
- * get operation.
- *
- */
-
-Chain_Node *_Chain_Get(
- Chain_Control *the_chain
-);
-
-/*
- * _Chain_Insert
- *
- * DESCRIPTION:
- *
- * This routine inserts the_node on a chain immediately following
- * after_node. It disables interrupts to insure the atomicity
- * of the extract operation.
- *
- */
-
-void _Chain_Insert(
- Chain_Node *after_node,
- Chain_Node *the_node
-);
-
-/*
- * _Chain_Append
- *
- * DESCRIPTION:
- *
- * This routine appends the_node onto the end of the_chain.
- * It disables interrupts to insure the atomicity of the
- * append operation.
- *
- */
-
-void _Chain_Append(
- Chain_Control *the_chain,
- Chain_Node *the_node
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/chain.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/context.h b/c/src/exec/score/headers/context.h
deleted file mode 100644
index 5a22fd4b6d..0000000000
--- a/c/src/exec/score/headers/context.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/* context.h
- *
- * This include file contains all information about a context.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CONTEXT_h
-#define __RTEMS_CONTEXT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/cpu.h>
-
-/*
- * The following constant defines the number of bytes required
- * to store a full floating point context.
- */
-
-#define CONTEXT_FP_SIZE CPU_CONTEXT_FP_SIZE
-
-/*
- * The following variable is set to TRUE when a reschedule operation
- * has determined that the processor should be taken away from the
- * currently executing thread and given to the heir thread.
- */
-
-SCORE_EXTERN volatile boolean _Context_Switch_necessary;
-
-/*
- * _Context_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes THE_CONTEXT such that the stack
- * pointer, interrupt level, and entry point are correct for the
- * thread's initial state.
- */
-
-#define \
- _Context_Initialize( _the_context, _stack, _size, _isr, _entry, _is_fp ) \
- _CPU_Context_Initialize( _the_context, _stack, _size, _isr, _entry, _is_fp )
-
-/*
- * _Context_Switch
- *
- * DESCRIPTION:
- *
- * This routine saves the current context into the EXECUTING
- * context record and restores the context specified by HEIR.
- */
-
-#define _Context_Switch( _executing, _heir ) \
- _CPU_Context_switch( _executing, _heir )
-
-/*
- * _Context_Restart_self
- *
- * DESCRIPTION:
- *
- * This routine restarts the calling thread by restoring its initial
- * stack pointer and returning to the thread's entry point.
- */
-
-#define _Context_Restart_self( _the_context ) \
- _CPU_Context_Restart_self( _the_context )
-
-/*
- * _Context_Fp_start
- *
- * DESCRIPTION:
- *
- * This function returns the starting address of the floating
- * point context save area. It is assumed that the are reserved
- * for the floating point save area is large enough.
- */
-
-#define _Context_Fp_start( _base, _offset ) \
- _CPU_Context_Fp_start( (_base), (_offset) )
-
-/*
- * _Context_Initialize_fp
- *
- * DESCRIPTION:
- *
- * This routine initializes the floating point context save
- * area to contain an initial known state.
- */
-
-#define _Context_Initialize_fp( _fp_area ) \
- _CPU_Context_Initialize_fp( _fp_area )
-
-/*
- * _Context_Restore_fp
- *
- * DESCRIPTION:
- *
- * This routine restores the floating point context contained
- * in the FP_CONTEXT area. It is assumed that the current
- * floating point context has been saved by a previous invocation
- * of SAVE_FP.
- */
-
-#define _Context_Restore_fp( _fp ) \
- _CPU_Context_restore_fp( _fp )
-
-/*
- * _Context_Save_fp
- *
- * DESCRIPTION:
- *
- * This routine saves the current floating point context
- * in the FP_CONTEXT area.
- */
-
-#define _Context_Save_fp( _fp ) \
- _CPU_Context_save_fp( _fp )
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/copyrt.h b/c/src/exec/score/headers/copyrt.h
deleted file mode 100644
index 3a9a5a5c60..0000000000
--- a/c/src/exec/score/headers/copyrt.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* copyrt.h
- *
- * This include file contains the copyright notice for RTEMS
- * which is included in every binary copy of the executive.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_COPYRIGHT_h
-#define __RTEMS_COPYRIGHT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef SCORE_INIT
-
-const char _Copyright_Notice[] =
-"COPYRIGHT (c) 1989-1998.\n\
-On-Line Applications Research Corporation (OAR).\n\
-Copyright assigned to U.S. Government, 1994.\n";
-
-#else
-
-extern const char _Copyright_Notice[];
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/coremsg.h b/c/src/exec/score/headers/coremsg.h
deleted file mode 100644
index 03277e12b7..0000000000
--- a/c/src/exec/score/headers/coremsg.h
+++ /dev/null
@@ -1,267 +0,0 @@
-/* coremsg.h
- *
- * This include file contains all the constants and structures associated
- * with the Message queue Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CORE_MESSAGE_QUEUE_h
-#define __RTEMS_CORE_MESSAGE_QUEUE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following type defines the callout which the API provides
- * to support global/multiprocessor operations on message_queues.
- */
-
-typedef void ( *CORE_message_queue_API_mp_support_callout )(
- Thread_Control *,
- Objects_Id
- );
-
-/*
- * The following defines the data types needed to manipulate
- * the contents of message buffers.
- *
- * NOTE: The buffer field is normally longer than a single unsigned32.
- * but since messages are variable length we just make a ptr to 1.
- */
-
-typedef struct {
- unsigned32 size;
- unsigned32 buffer[1];
-} CORE_message_queue_Buffer;
-
-/*
- * The following records define the organization of a message
- * buffer.
- */
-
-typedef struct {
- Chain_Node Node;
- CORE_message_queue_Buffer Contents;
-} CORE_message_queue_Buffer_control;
-
-/*
- * Blocking disciplines for a message_queue.
- */
-
-typedef enum {
- CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO,
- CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY
-} CORE_message_queue_Disciplines;
-
-/*
- * The following enumerated type details the modes in which a message
- * may be submitted to a message queue. The message may be posted
- * in a send or urgent fashion.
- */
-
-typedef enum {
- CORE_MESSAGE_QUEUE_SEND_REQUEST = 0,
- CORE_MESSAGE_QUEUE_URGENT_REQUEST = 1
-} CORE_message_queue_Submit_types;
-
-/*
- * Core Message queue handler return statuses.
- */
-
-typedef enum {
- CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL,
- CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE,
- CORE_MESSAGE_QUEUE_STATUS_TOO_MANY,
- CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED,
- CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT,
- CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED,
- CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
-} CORE_message_queue_Status;
-
-/*
- * The following defines the control block used to manage the
- * attributes of each message queue.
- */
-
-typedef struct {
- CORE_message_queue_Disciplines discipline;
-} CORE_message_queue_Attributes;
-
-/*
- * The following defines the type for a Notification handler. A notification
- * handler is invoked when the message queue makes a 0->1 transition on
- * pending messages.
- */
-
-typedef void (*CORE_message_queue_Notify_Handler)( void * );
-
-/*
- * The following defines the control block used to manage each
- * counting message_queue.
- */
-
-typedef struct {
- Thread_queue_Control Wait_queue;
- CORE_message_queue_Attributes Attributes;
- unsigned32 maximum_pending_messages;
- unsigned32 number_of_pending_messages;
- unsigned32 maximum_message_size;
- Chain_Control Pending_messages;
- CORE_message_queue_Buffer *message_buffers;
- CORE_message_queue_Notify_Handler notify_handler;
- void *notify_argument;
- Chain_Control Inactive_messages;
-} CORE_message_queue_Control;
-
-/*
- * _CORE_message_queue_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the message_queue based on the parameters passed.
- */
-
-boolean _CORE_message_queue_Initialize(
- CORE_message_queue_Control *the_message_queue,
- Objects_Classes the_class,
- CORE_message_queue_Attributes *the_message_queue_attributes,
- unsigned32 maximum_pending_messages,
- unsigned32 maximum_message_size,
- Thread_queue_Extract_callout proxy_extract_callout
-);
-
-/*
- * _CORE_message_queue_Close
- *
- * DESCRIPTION:
- *
- * This function closes a message by returning all allocated space and
- * flushing the message_queue's task wait queue.
- */
-
-void _CORE_message_queue_Close(
- CORE_message_queue_Control *the_message_queue,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-);
-
-/*
- *
- * _CORE_message_queue_Flush
- *
- * DESCRIPTION:
- *
- * This function flushes the message_queue's task wait queue. The number
- * messages flushed from the queue is returned.
- *
- */
-
-unsigned32 _CORE_message_queue_Flush(
- CORE_message_queue_Control *the_message_queue
-);
-
-/*
- * _CORE_message_queue_Flush_support
- *
- * DESCRIPTION:
- *
- * This routine flushes all outstanding messages and returns
- * them to the inactive message chain.
- */
-
-unsigned32 _CORE_message_queue_Flush_support(
- CORE_message_queue_Control *the_message_queue
-);
-
-/*
- *
- * _CORE_message_queue_Broadcast
- *
- * DESCRIPTION:
- *
- * This function sends a message for every thread waiting on the queue and
- * returns the number of threads made ready by the message.
- *
- */
-
-CORE_message_queue_Status _CORE_message_queue_Broadcast(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support,
- unsigned32 *count
-);
-
-/*
- *
- * _CORE_message_queue_Submit
- *
- * DESCRIPTION:
- *
- * This routine implements the send and urgent message functions. It
- * processes a message that is to be submitted to the designated
- * message queue. The message will either be processed as a
- * send message which it will be inserted at the rear of the queue
- * or it will be processed as an urgent message which will be inserted
- * at the front of the queue.
- *
- */
-
-CORE_message_queue_Status _CORE_message_queue_Submit(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support,
- CORE_message_queue_Submit_types submit_type
-);
-
-/*
- *
- * _CORE_message_queue_Seize
- *
- * DESCRIPTION:
- *
- * This kernel routine dequeues a message, copies the message buffer to
- * a given destination buffer, and frees the message buffer to the
- * inactive message pool. The thread will be blocked if wait is TRUE,
- * otherwise an error will be given to the thread if no messages are available.
- *
- */
-
-void _CORE_message_queue_Seize(
- CORE_message_queue_Control *the_message_queue,
- Objects_Id id,
- void *buffer,
- unsigned32 *size,
- boolean wait,
- Watchdog_Interval timeout
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/coremsg.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/score/headers/coremutex.h b/c/src/exec/score/headers/coremutex.h
deleted file mode 100644
index 7145e4f19f..0000000000
--- a/c/src/exec/score/headers/coremutex.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/* mutex.h
- *
- * This include file contains all the constants and structures associated
- * with the Mutex Handler. A mutex is an enhanced version of the standard
- * Dijkstra binary semaphore used to provide synchronization and mutual
- * exclusion capabilities.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CORE_MUTEX_h
-#define __RTEMS_CORE_MUTEX_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following type defines the callout which the API provides
- * to support global/multiprocessor operations on mutexes.
- */
-
-typedef void ( *CORE_mutex_API_mp_support_callout )(
- Thread_Control *,
- Objects_Id
- );
-
-/*
- * Blocking disciplines for a mutex.
- */
-
-typedef enum {
- CORE_MUTEX_DISCIPLINES_FIFO,
- CORE_MUTEX_DISCIPLINES_PRIORITY,
- CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT,
- CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING
-} CORE_mutex_Disciplines;
-
-/*
- * Mutex handler return statuses.
- */
-
-typedef enum {
- CORE_MUTEX_STATUS_SUCCESSFUL,
- CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT,
- CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED,
- CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE,
- CORE_MUTEX_WAS_DELETED,
- CORE_MUTEX_TIMEOUT,
- CORE_MUTEX_STATUS_CEILING_VIOLATED
-} CORE_mutex_Status;
-
-/*
- * Locked and unlocked values
- */
-
-#define CORE_MUTEX_UNLOCKED 1
-#define CORE_MUTEX_LOCKED 0
-
-/*
- * The following defines the control block used to manage the
- * attributes of each mutex.
- */
-
-typedef struct {
- boolean allow_nesting;
- CORE_mutex_Disciplines discipline;
- Priority_Control priority_ceiling;
-} CORE_mutex_Attributes;
-
-/*
- * The following defines the control block used to manage each mutex.
- */
-
-typedef struct {
- Thread_queue_Control Wait_queue;
- CORE_mutex_Attributes Attributes;
- unsigned32 lock;
- unsigned32 nest_count;
- Thread_Control *holder;
- Objects_Id holder_id;
-} CORE_mutex_Control;
-
-/*
- * _CORE_mutex_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the mutex based on the parameters passed.
- */
-
-void _CORE_mutex_Initialize(
- CORE_mutex_Control *the_mutex,
- Objects_Classes the_class,
- CORE_mutex_Attributes *the_mutex_attributes,
- unsigned32 initial_lock,
- Thread_queue_Extract_callout proxy_extract_callout
-);
-
-/*
- * _CORE_mutex_Seize
- *
- * DESCRIPTION:
- *
- * This routine attempts to receive a unit from the_mutex.
- * If a unit is available or if the wait flag is FALSE, then the routine
- * returns. Otherwise, the calling task is blocked until a unit becomes
- * available.
- */
-
-void _CORE_mutex_Seize(
- CORE_mutex_Control *the_mutex,
- Objects_Id id,
- boolean wait,
- Watchdog_Interval timeout
-);
-
-/*
- * _CORE_mutex_Surrender
- *
- * DESCRIPTION:
- *
- * This routine frees a unit to the mutex. If a task was blocked waiting for
- * a unit from this mutex, then that task will be readied and the unit
- * given to that task. Otherwise, the unit will be returned to the mutex.
- */
-
-CORE_mutex_Status _CORE_mutex_Surrender(
- CORE_mutex_Control *the_mutex,
- Objects_Id id,
- CORE_mutex_API_mp_support_callout api_mutex_mp_support
-);
-
-/*
- * _CORE_mutex_Flush
- *
- * DESCRIPTION:
- *
- * This routine assists in the deletion of a mutex by flushing the associated
- * wait queue.
- */
-
-void _CORE_mutex_Flush(
- CORE_mutex_Control *the_mutex,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/coremutex.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/score/headers/coresem.h b/c/src/exec/score/headers/coresem.h
deleted file mode 100644
index 2ef1371e8d..0000000000
--- a/c/src/exec/score/headers/coresem.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/* core_sem.h
- *
- * This include file contains all the constants and structures associated
- * with the Counting Semaphore Handler. A counting semaphore is the
- * standard Dijkstra binary semaphore used to provide synchronization
- * and mutual exclusion capabilities.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CORE_COUNTING_SEMAPHORE_h
-#define __RTEMS_CORE_COUNTING_SEMAPHORE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following type defines the callout which the API provides
- * to support global/multiprocessor operations on semaphores.
- */
-
-typedef void ( *CORE_semaphore_API_mp_support_callout )(
- Thread_Control *,
- Objects_Id
- );
-
-/*
- * Blocking disciplines for a semaphore.
- */
-
-typedef enum {
- CORE_SEMAPHORE_DISCIPLINES_FIFO,
- CORE_SEMAPHORE_DISCIPLINES_PRIORITY
-} CORE_semaphore_Disciplines;
-
-/*
- * Core Semaphore handler return statuses.
- */
-
-typedef enum {
- CORE_SEMAPHORE_STATUS_SUCCESSFUL,
- CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT,
- CORE_SEMAPHORE_WAS_DELETED,
- CORE_SEMAPHORE_TIMEOUT
-} CORE_semaphore_Status;
-
-/*
- * The following defines the control block used to manage the
- * attributes of each semaphore.
- */
-
-typedef struct {
- CORE_semaphore_Disciplines discipline;
-} CORE_semaphore_Attributes;
-
-/*
- * The following defines the control block used to manage each
- * counting semaphore.
- */
-
-typedef struct {
- Thread_queue_Control Wait_queue;
- CORE_semaphore_Attributes Attributes;
- unsigned32 count;
-} CORE_semaphore_Control;
-
-/*
- * _CORE_semaphore_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the semaphore based on the parameters passed.
- */
-
-void _CORE_semaphore_Initialize(
- CORE_semaphore_Control *the_semaphore,
- Objects_Classes the_class,
- CORE_semaphore_Attributes *the_semaphore_attributes,
- unsigned32 initial_value,
- Thread_queue_Extract_callout proxy_extract_callout
-);
-
-/*
- * _CORE_semaphore_Seize
- *
- * DESCRIPTION:
- *
- * This routine attempts to receive a unit from the_semaphore.
- * If a unit is available or if the wait flag is FALSE, then the routine
- * returns. Otherwise, the calling task is blocked until a unit becomes
- * available.
- */
-
-void _CORE_semaphore_Seize(
- CORE_semaphore_Control *the_semaphore,
- Objects_Id id,
- boolean wait,
- Watchdog_Interval timeout
-);
-
-/*
- * _CORE_semaphore_Surrender
- *
- * DESCRIPTION:
- *
- * This routine frees a unit to the semaphore. If a task was blocked waiting
- * for a unit from this semaphore, then that task will be readied and the unit
- * given to that task. Otherwise, the unit will be returned to the semaphore.
- */
-
-CORE_semaphore_Status _CORE_semaphore_Surrender(
- CORE_semaphore_Control *the_semaphore,
- Objects_Id id,
- CORE_semaphore_API_mp_support_callout api_semaphore_mp_support
-);
-
-/*
- * _CORE_semaphore_Flush
- *
- * DESCRIPTION:
- *
- * This routine assists in the deletion of a semaphore by flushing the
- * associated wait queue.
- */
-
-void _CORE_semaphore_Flush(
- CORE_semaphore_Control *the_semaphore,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/coresem.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/score/headers/debug.h b/c/src/exec/score/headers/debug.h
deleted file mode 100644
index 5c83e67d05..0000000000
--- a/c/src/exec/score/headers/debug.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* debug.h
- *
- * This include file contains the information pertaining to the debug
- * support within RTEMS. It is currently cast in the form of a
- * Manager since it is externally accessible.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_DEBUG_h
-#define __RTEMS_DEBUG_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type is used to manage the debug mask.
- */
-
-typedef unsigned32 rtems_debug_control;
-
-/*
- * These constants represent various classes of debugging.
- */
-
-#define RTEMS_DEBUG_ALL_MASK 0xffffffff
-#define RTEMS_DEBUG_REGION 0x00000001
-
-/*
- * This variable contains the current debug level.
- */
-
-SCORE_EXTERN rtems_debug_control _Debug_Level;
-
-/*
- * _Debug_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Debug_Manager_initialization( void );
-
-/*
- * rtems_debug_enable
- *
- * DESCRIPTION:
- *
- * This routine enables the specified types of debug checks.
- */
-
-void rtems_debug_enable (
- rtems_debug_control to_be_enabled
-);
-
-/*
- * rtems_debug_disable
- *
- * DESCRIPTION:
- *
- * This routine disables the specified types of debug checks.
- */
-
-void rtems_debug_disable (
- rtems_debug_control to_be_disabled
-);
-
-/*
- *
- * _Debug_Is_enabled
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the requested debug level is
- * enabled, and FALSE otherwise.
- */
-
-boolean _Debug_Is_enabled(
- rtems_debug_control level
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/heap.h b/c/src/exec/score/headers/heap.h
deleted file mode 100644
index eaee7cde3f..0000000000
--- a/c/src/exec/score/headers/heap.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/* heap.h
- *
- * This include file contains the information pertaining to the Heap
- * Handler. A heap is a doubly linked list of variable size
- * blocks which are allocated using the first fit method. Garbage
- * collection is performed each time a block is returned to the heap by
- * coalescing neighbor blocks. Control information for both allocated
- * and unallocated blocks is contained in the heap space. A heap header
- * contains control information for the heap.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_HEAP_h
-#define __RTEMS_HEAP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Status codes for heap_extend
- */
-
-typedef enum {
- HEAP_EXTEND_SUCCESSFUL,
- HEAP_EXTEND_ERROR,
- HEAP_EXTEND_NOT_IMPLEMENTED
-} Heap_Extend_status;
-
-/*
- * Constants used in the size/used field of each heap block to
- * indicate when a block is free or in use.
- */
-
-#define HEAP_BLOCK_USED 1 /* indicates block is in use */
-#define HEAP_BLOCK_FREE 0 /* indicates block is free */
-
-/*
- * The size/used field value for the dummy front and back flags.
- */
-
-#define HEAP_DUMMY_FLAG (0 + HEAP_BLOCK_USED)
-
-/*
- * The following constants reflect various requirements of the
- * heap data structures which impact the management of a heap.
- *
- * NOTE: Because free block overhead is greater than used block
- * overhead AND a portion of the allocated space is from
- * the extra free block overhead, the absolute lower bound
- * of the minimum fragment size is equal to the size of
- * the free block overhead.
- */
-
-#define HEAP_OVERHEAD \
- (sizeof( unsigned32 ) * 2) /* size dummy first and last blocks */
-#define HEAP_BLOCK_USED_OVERHEAD \
- (sizeof( void * ) * 2) /* num bytes overhead in used block */
-#define HEAP_MINIMUM_SIZE \
- (HEAP_OVERHEAD + sizeof (Heap_Block))
- /* min number of bytes the user may */
- /* specify for the heap size */
-
-/*
- * The following defines the data structure used to manage
- * individual blocks in a heap. When the block is allocated, the
- * next and previous fields are not used by the Heap Handler
- * and thus the address returned for the block starts at
- * the address of the next field.
- *
- * NOTE: The next and previous pointers are only valid when the
- * block is free. Caution must be exercised to insure that
- * allocated blocks are large enough to contain them and
- * that they are not accidentally overwritten when the
- * block is actually allocated.
- */
-
-typedef struct Heap_Block_struct Heap_Block;
-
-struct Heap_Block_struct {
- unsigned32 back_flag; /* size and status of prev block */
- unsigned32 front_flag; /* size and status of block */
- Heap_Block *next; /* pointer to next block */
- Heap_Block *previous; /* pointer to previous block */
-};
-
-/*
- * The following defines the control block used to manage each heap.
- *
- * NOTE:
- *
- * This structure is layed out such that it can be used a a dummy
- * first and last block on the free block chain. The extra padding
- * insures the dummy last block is the correct size.
- *
- * The first Heap_Block starts at first while the second starts at
- * final. This is effectively the same trick as is used in the Chain
- * Handler.
- */
-
-typedef struct {
- Heap_Block *start; /* first valid block address in heap */
- Heap_Block *final; /* last valid block address in heap */
-
- Heap_Block *first; /* pointer to first block in heap */
- Heap_Block *permanent_null; /* always NULL pointer */
- Heap_Block *last; /* pointer to last block in heap */
- unsigned32 page_size; /* allocation unit */
- unsigned32 reserved;
-} Heap_Control;
-
-/*
- * _Heap_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the_heap record to manage the
- * contiguous heap of size bytes which starts at starting_address.
- * Blocks of memory are allocated from the heap in multiples of
- * page_size byte units.
- */
-
-unsigned32 _Heap_Initialize(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 size,
- unsigned32 page_size
-);
-
-/*
- * _Heap_Extend
- *
- * DESCRIPTION:
- *
- * This routine grows the_heap memory area using the size bytes which
- * begin at starting_address.
- */
-
-Heap_Extend_status _Heap_Extend(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 size,
- unsigned32 *amount_extended
-);
-
-/*
- * _Heap_Allocate
- *
- * DESCRIPTION:
- *
- * DESCRIPTION:
- *
- * This function attempts to allocate a block of size bytes from
- * the_heap. If insufficient memory is free in the_heap to allocate
- * a block of the requested size, then NULL is returned.
- */
-
-void *_Heap_Allocate(
- Heap_Control *the_heap,
- unsigned32 size
-);
-
-/*
- * _Heap_Size_of_user_area
- *
- * DESCRIPTION:
- *
- * This kernel routine sets size to the size of the given heap block.
- * It returns TRUE if the starting_address is in the heap, and FALSE
- * otherwise.
- */
-
-boolean _Heap_Size_of_user_area(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 *size
-);
-
-/*
- * _Heap_Free
- *
- * DESCRIPTION:
- *
- * This routine returns the block of memory which begins
- * at starting_address to the_heap. Any coalescing which is
- * possible with the freeing of this routine is performed.
- */
-
-boolean _Heap_Free(
- Heap_Control *the_heap,
- void *start_address
-);
-
-/*
- * _Heap_Walk
- *
- * DESCRIPTION:
- *
- * This routine walks the heap to verify its integrity.
- */
-
-void _Heap_Walk(
- Heap_Control *the_heap,
- int source,
- boolean do_dump
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/heap.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/interr.h b/c/src/exec/score/headers/interr.h
deleted file mode 100644
index e999ceff7a..0000000000
--- a/c/src/exec/score/headers/interr.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* interr.h
- *
- * This include file contains constants and prototypes related
- * to the Internal Error Handler.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_INTERNAL_ERROR_h
-#define __RTEMS_INTERNAL_ERROR_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This type lists the possible sources from which an error
- * can be reported.
- */
-
-typedef enum {
- INTERNAL_ERROR_CORE,
- INTERNAL_ERROR_RTEMS_API,
- INTERNAL_ERROR_POSIX_API
-} Internal_errors_Source;
-
-/*
- * A list of errors which are generated internally by the executive core.
- */
-
-typedef enum {
- INTERNAL_ERROR_NO_CONFIGURATION_TABLE,
- INTERNAL_ERROR_NO_CPU_TABLE,
- INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS,
- INTERNAL_ERROR_TOO_LITTLE_WORKSPACE,
- INTERNAL_ERROR_WORKSPACE_ALLOCATION,
- INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL,
- INTERNAL_ERROR_THREAD_EXITTED,
- INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION,
- INTERNAL_ERROR_INVALID_NODE,
- INTERNAL_ERROR_NO_MPCI,
- INTERNAL_ERROR_BAD_PACKET,
- INTERNAL_ERROR_OUT_OF_PACKETS,
- INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS,
- INTERNAL_ERROR_OUT_OF_PROXIES,
- INTERNAL_ERROR_INVALID_GLOBAL_ID,
- INTERNAL_ERROR_BAD_STACK_HOOK
-} Internal_errors_Core_list;
-
-/*
- * This type holds the fatal error information.
- */
-
-typedef struct {
- Internal_errors_Source the_source;
- boolean is_internal;
- unsigned32 the_error;
-} Internal_errors_Information;
-
-/*
- * When a fatal error occurs, the error information is stored here.
- */
-
-SCORE_EXTERN Internal_errors_Information Internal_errors_What_happened;
-
-/*
- * _Internal_error_Occurred
- *
- * DESCRIPTION:
- *
- * This routine is invoked when the application or the executive itself
- * determines that a fatal error has occurred.
- */
-
-void volatile _Internal_error_Occurred(
- Internal_errors_Source the_source,
- boolean is_internal,
- unsigned32 the_error
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/isr.h b/c/src/exec/score/headers/isr.h
deleted file mode 100644
index 97ffe7f2ec..0000000000
--- a/c/src/exec/score/headers/isr.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/* isr.h
- *
- * This include file contains all the constants and structures associated
- * with the management of processor interrupt levels. This handler
- * supports interrupt critical sections, vectoring of user interrupt
- * handlers, nesting of interrupts, and manipulating interrupt levels.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __ISR_h
-#define __ISR_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type defines the control block used to manage
- * the interrupt level portion of the status register.
- */
-
-typedef unsigned32 ISR_Level;
-
-/*
- * The following type defines the type used to manage the vectors.
- */
-
-typedef unsigned32 ISR_Vector_number;
-
-/*
- * Return type for ISR Handler
- */
-
-typedef void ISR_Handler;
-
-/*
- * Pointer to an ISR Handler
- */
-
-#if (CPU_ISR_PASSES_FRAME_POINTER == 1)
-typedef ISR_Handler ( *ISR_Handler_entry )(
- ISR_Vector_number,
- CPU_Interrupt_frame *
- );
-#else
-typedef ISR_Handler ( *ISR_Handler_entry )(
- ISR_Vector_number
- );
-#endif
-/*
- * This constant promotes out the number of vectors truly supported by
- * the current CPU being used. This is usually the number of distinct vectors
- * the cpu can vector.
- */
-
-#define ISR_NUMBER_OF_VECTORS CPU_INTERRUPT_NUMBER_OF_VECTORS
-
-/*
- * This constant promotes out the highest valid interrupt vector number.
- */
-
-#define ISR_INTERRUPT_MAXIMUM_VECTOR_NUMBER CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER
-
-/*
- * The following is TRUE if signals have been sent to the currently
- * executing thread by an ISR handler.
- */
-
-SCORE_EXTERN boolean _ISR_Signals_to_thread_executing;
-
-/*
- * The following contains the interrupt service routine nest level.
- * When this variable is zero, a thread is executing.
- */
-
-SCORE_EXTERN unsigned32 _ISR_Nest_level;
-
-/*
- * The following declares the Vector Table. Application
- * interrupt service routines are vectored by the ISR Handler via this table.
- */
-
-SCORE_EXTERN ISR_Handler_entry _ISR_Vector_table[ ISR_NUMBER_OF_VECTORS ];
-
-/*
- * _ISR_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _ISR_Handler_initialization ( void );
-
-/*
- * _ISR_Disable
- *
- * DESCRIPTION:
- *
- * This routine disables all interrupts so that a critical section
- * of code can be executing without being interrupted. Upon return,
- * the argument _level will contain the previous interrupt mask level.
- */
-
-#define _ISR_Disable( _level ) \
- _CPU_ISR_Disable( _level )
-
-/*
- * _ISR_Enable
- *
- * DESCRIPTION:
- *
- * This routine enables interrupts to the previous interrupt mask
- * LEVEL. It is used at the end of a critical section of code to
- * enable interrupts so they can be processed again.
- */
-
-#define _ISR_Enable( _level ) \
- _CPU_ISR_Enable( _level )
-
-/*
- * _ISR_Flash
- *
- * DESCRIPTION:
- *
- * This routine temporarily enables interrupts to the previous
- * interrupt mask level and then disables all interrupts so that
- * the caller can continue into the second part of a critical
- * section. This routine is used to temporarily enable interrupts
- * during a long critical section. It is used in long sections of
- * critical code when a point is reached at which interrupts can
- * be temporarily enabled. Deciding where to flash interrupts
- * in a long critical section is often difficult and the point
- * must be selected with care to insure that the critical section
- * properly protects itself.
- */
-
-#define _ISR_Flash( _level ) \
- _CPU_ISR_Flash( _level )
-
-/*
- * _ISR_Install_vector
- *
- * DESCRIPTION:
- *
- * This routine installs new_handler as the interrupt service routine
- * for the specified vector. The previous interrupt service routine is
- * returned as old_handler.
- */
-
-#define _ISR_Install_vector( _vector, _new_handler, _old_handler ) \
- _CPU_ISR_install_vector( _vector, _new_handler, _old_handler )
-
-/*
- * _ISR_Get_level
- *
- * DESCRIPTION:
- *
- * This routine returns the current interrupt level.
- */
-
-#define _ISR_Get_level() \
- _CPU_ISR_Get_level()
-
-/*
- * _ISR_Set_level
- *
- * DESCRIPTION:
- *
- * This routine sets the current interrupt level to that specified
- * by new_level. The new interrupt level is effective when the
- * routine exits.
- */
-
-#define _ISR_Set_level( _new_level ) \
- _CPU_ISR_Set_level( _new_level )
-
-/*
- * _ISR_Handler
- *
- * DESCRIPTION:
- *
- * This routine is the interrupt dispatcher. ALL interrupts
- * are vectored to this routine so that minimal context can be saved
- * and setup performed before the application's high-level language
- * interrupt service routine is invoked. After the application's
- * interrupt service routine returns control to this routine, it
- * will determine if a thread dispatch is necessary. If so, it will
- * insure that the necessary thread scheduling operations are
- * performed when the outermost interrupt service routine exits.
- *
- * NOTE: Implemented in assembly language.
- */
-
-void _ISR_Handler( void );
-
-/*
- * _ISR_Dispatch
- *
- * DESCRIPTION:
- *
- * This routine provides a wrapper so that the routine
- * _Thread_Dispatch can be invoked when a reschedule is necessary
- * at the end of the outermost interrupt service routine. This
- * wrapper is necessary to establish the processor context needed
- * by _Thread_Dispatch and to save the processor context which is
- * corrupted by _Thread_Dispatch. This context typically consists
- * of registers which are not preserved across routine invocations.
- *
- * NOTE: Implemented in assembly language.
- */
-
-void _ISR_Dispatch( void );
-
-#include <rtems/score/isr.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/mpci.h b/c/src/exec/score/headers/mpci.h
deleted file mode 100644
index 4475021eca..0000000000
--- a/c/src/exec/score/headers/mpci.h
+++ /dev/null
@@ -1,412 +0,0 @@
-/* mpci.h
- *
- * This include file contains all the constants and structures associated
- * with the MPCI layer. It provides mechanisms to utilize packets.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MPCI_h
-#define __MPCI_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/tqdata.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/score/coresem.h>
-
-/*
- * The following constants define the stack size requirements for
- * the system threads.
- */
-
-#define MPCI_RECEIVE_SERVER_STACK_SIZE \
- ( STACK_MINIMUM_SIZE + \
- CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \
- _CPU_Table.extra_mpci_receive_server_stack \
- )
-
-/*
- * The following defines the node number used when a broadcast is desired.
- */
-
-#define MPCI_ALL_NODES 0
-
-/*
- * For packets associated with requests that don't already have a timeout,
- * use the one specified by this MPCI driver. The value specified by
- * the MPCI driver sets an upper limit on how long a remote request
- * should take to complete.
- */
-
-#define MPCI_DEFAULT_TIMEOUT 0xFFFFFFFF
-
-/*
- * The following records define the Multiprocessor Communications
- * Interface (MPCI) Table. This table defines the user-provided
- * MPCI which is a required part of a multiprocessor system.
- *
- * For non-blocking local operations that become remote operations,
- * we need a timeout. This is a per-driver timeout: default_timeout
- */
-
-typedef void MPCI_Entry;
-
-typedef MPCI_Entry ( *MPCI_initialization_entry )( void );
-
-typedef MPCI_Entry ( *MPCI_get_packet_entry )(
- MP_packet_Prefix **
- );
-
-typedef MPCI_Entry ( *MPCI_return_packet_entry )(
- MP_packet_Prefix *
- );
-
-typedef MPCI_Entry ( *MPCI_send_entry )(
- unsigned32,
- MP_packet_Prefix *
- );
-
-typedef MPCI_Entry ( *MPCI_receive_entry )(
- MP_packet_Prefix **
- );
-
-typedef struct {
- unsigned32 default_timeout; /* in ticks */
- unsigned32 maximum_packet_size;
- MPCI_initialization_entry initialization;
- MPCI_get_packet_entry get_packet;
- MPCI_return_packet_entry return_packet;
- MPCI_send_entry send_packet;
- MPCI_receive_entry receive_packet;
-} MPCI_Control;
-
-/*
- * The following defines the type for packet processing routines
- * invoked by the MPCI Receive server.
- */
-
-typedef void (*MPCI_Packet_processor)( MP_packet_Prefix * );
-
-/*
- * The following enumerated type defines the list of
- * internal MP operations.
- */
-
-typedef enum {
- MPCI_PACKETS_SYSTEM_VERIFY = 0
-} MPCI_Internal_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote event operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- MPCI_Internal_Remote_operations operation;
- unsigned32 maximum_nodes;
- unsigned32 maximum_global_objects;
-} MPCI_Internal_packet;
-
-/*
- * This is the core semaphore which the MPCI Receive Server blocks on.
- */
-
-SCORE_EXTERN CORE_semaphore_Control _MPCI_Semaphore;
-/*
- * The following thread queue is used to maintain a list of tasks
- * which currently have outstanding remote requests.
- */
-
-SCORE_EXTERN Thread_queue_Control _MPCI_Remote_blocked_threads;
-
-/*
- * The following define the internal pointers to the user's
- * configuration information.
- */
-
-SCORE_EXTERN MPCI_Control *_MPCI_table;
-
-/*
- * The following points to the MPCI Receive Server.
- */
-
-SCORE_EXTERN Thread_Control *_MPCI_Receive_server_tcb;
-
-/*
- * The following table contains the process packet routines provided
- * by each object that supports MP operations.
- */
-
-SCORE_EXTERN MPCI_Packet_processor
- _MPCI_Packet_processors[MP_PACKET_CLASSES_LAST+1];
-
-/*
- * _MPCI_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _MPCI_Handler_initialization(
- MPCI_Control *users_mpci_table,
- unsigned32 timeout_status
-);
-
-/*
- * _MPCI_Create_server
- *
- * DESCRIPTION:
- *
- * This routine creates the packet receive server used in MP systems.
- */
-
-void _MPCI_Create_server( void );
-
-/*
- * _MPCI_Initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the MPCI driver by
- * invoking the user provided MPCI initialization callout.
- */
-
-void _MPCI_Initialization ( void );
-
-/*
- * _MPCI_Register_packet_processor
- *
- * DESCRIPTION:
- *
- * This routine registers the MPCI packet processor for the
- * designated object class.
- */
-
-void _MPCI_Register_packet_processor(
- MP_packet_Classes the_class,
- MPCI_Packet_processor the_packet_processor
-
-);
-
-/*
- * _MPCI_Get_packet
- *
- * DESCRIPTION:
- *
- * This function obtains a packet by invoking the user provided
- * MPCI get packet callout.
- */
-
-MP_packet_Prefix *_MPCI_Get_packet ( void );
-
-/*
- * _MPCI_Return_packet
- *
- * DESCRIPTION:
- *
- * This routine returns a packet by invoking the user provided
- * MPCI return packet callout.
- */
-
-void _MPCI_Return_packet (
- MP_packet_Prefix *the_packet
-);
-
-/*
- * _MPCI_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine sends a process packet by invoking the user provided
- * MPCI send callout.
- */
-
-void _MPCI_Send_process_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet
-);
-
-/*
- * _MPCI_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine sends a request packet by invoking the user provided
- * MPCI send callout.
- */
-
-unsigned32 _MPCI_Send_request_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet,
- States_Control extra_state
-);
-
-/*
- * _MPCI_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine sends a response packet by invoking the user provided
- * MPCI send callout.
- */
-
-void _MPCI_Send_response_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet
-);
-
-/*
- * _MPCI_Receive_packet
- *
- * DESCRIPTION:
- *
- * This routine receives a packet by invoking the user provided
- * MPCI receive callout.
- */
-
-MP_packet_Prefix *_MPCI_Receive_packet ( void );
-
-/*
- * _MPCI_Process_response
- *
- * DESCRIPTION:
- *
- * This routine obtains a packet by invoking the user provided
- * MPCI get packet callout.
- */
-
-Thread_Control *_MPCI_Process_response (
- MP_packet_Prefix *the_packet
-);
-
-/*PAGE
- *
- * _MPCI_Receive_server
- *
- */
-
-Thread _MPCI_Receive_server(
- unsigned32 ignored
-);
-
-/*PAGE
- *
- * _MPCI_Announce
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _MPCI_Announce ( void );
-
-/*
- * _MPCI_Internal_packets_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _MPCI_Internal_packets_Send_process_packet (
- MPCI_Internal_Remote_operations operation
-);
-
-/*
- * _MPCI_Internal_packets_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- *
- * This routine is not needed since there are no request
- * packets to be sent by this manager.
- */
-
-/*
- * _MPCI_Internal_packets_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- *
- * This routine is not needed since there are no response
- * packets to be sent by this manager.
- */
-
-/*
- *
- * _MPCI_Internal_packets_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _MPCI_Internal_packets_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _MPCI_Internal_packets_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _MPCI_Internal_packets_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _MPCI_Internal_packets_Get_packet
- *
- * DESCRIPTION:
- *
- * This routine is used to obtain a internal threads mp packet.
- */
-
- MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/mppkt.h b/c/src/exec/score/headers/mppkt.h
deleted file mode 100644
index 1838d92336..0000000000
--- a/c/src/exec/score/headers/mppkt.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* mppkt.h
- *
- * This package is the specification for the Packet Handler.
- * This handler defines the basic packet and provides
- * mechanisms to utilize packets based on this prefix.
- * Packets are the fundamental basis for messages passed between
- * nodes in an MP system.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MP_PACKET_h
-#define __MP_PACKET_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the packet classes.
- *
- * NOTE: In general, each class corresponds to a manager
- * which supports global operations. Each manager
- * defines the set of supported operations.
- */
-
-typedef enum {
- 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
-} MP_packet_Classes;
-
-#define MP_PACKET_CLASSES_FIRST MP_PACKET_MPCI_INTERNAL
-#define MP_PACKET_CLASSES_LAST MP_PACKET_SIGNAL
-
-/*
- * The following record contains the prefix for every packet
- * passed between nodes in an MP system.
- *
- * NOTE: This structure is padded to insure that anything
- * following it is on a 16 byte boundary. This is
- * the most stringent structure alignment rule
- * encountered yet (i960CA).
- */
-
-typedef struct {
- MP_packet_Classes the_class;
- Objects_Id id;
- Objects_Id source_tid;
- Priority_Control source_priority;
- unsigned32 return_code;
- unsigned32 length;
- unsigned32 to_convert;
- Watchdog_Interval timeout;
-} MP_packet_Prefix;
-
-/*
- * An MPCI must support packets of at least this size.
- */
-
-#define MP_PACKET_MINIMUM_PACKET_SIZE 64
-
-/*
- * The following constant defines the number of unsigned32's
- * in a packet which must be converted to native format in a
- * heterogeneous system. In packets longer than
- * MP_PACKET_MINIMUN_HETERO_CONVERSION unsigned32's, some of the "extra" data
- * may a user message buffer which is not automatically endian swapped.
- */
-
-#define MP_PACKET_MINIMUN_HETERO_CONVERSION \
- ( sizeof( MP_packet_Prefix ) / sizeof( unsigned32 ) )
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/mppkt.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/object.h b/c/src/exec/score/headers/object.h
deleted file mode 100644
index 0198731b96..0000000000
--- a/c/src/exec/score/headers/object.h
+++ /dev/null
@@ -1,397 +0,0 @@
-/* object.h
- *
- * This include file contains all the constants and structures associated
- * with the Object Handler. This Handler provides mechanisms which
- * can be used to initialize and manipulate all objects which have
- * ids.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OBJECTS_h
-#define __OBJECTS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/chain.h>
-
-/*
- * The following type defines the control block used to manage
- * object names.
- */
-
-typedef void * Objects_Name;
-
-/*
- * Space for object names is allocated in multiples of this.
- *
- * NOTE: Must be a power of 2. Matches the name manipulation routines.
- */
-
-#define OBJECTS_NAME_ALIGNMENT sizeof( unsigned32 )
-
-/*
- * Functions which compare names are prototyped like this.
- */
-
-typedef boolean (*Objects_Name_comparators)(
- void * /* name_1 */,
- void * /* name_2 */,
- unsigned32 /* length */
-);
-
-/*
- * The following type defines the control block used to manage
- * object IDs. The format is as follows (0=LSB):
- *
- * Bits 0 .. 15 = index
- * Bits 16 .. 25 = node
- * Bits 26 .. 31 = class
- */
-
-typedef unsigned32 Objects_Id;
-
-#define OBJECTS_INDEX_START_BIT 0
-#define OBJECTS_NODE_START_BIT 16
-#define OBJECTS_CLASS_START_BIT 26
-
-#define OBJECTS_INDEX_MASK 0x0000ffff
-#define OBJECTS_NODE_MASK 0x03ff0000
-#define OBJECTS_CLASS_MASK 0xfc000000
-
-#define OBJECTS_INDEX_VALID_BITS 0x0000ffff
-#define OBJECTS_NODE_VALID_BITS 0x000003ff
-#define OBJECTS_CLASS_VALID_BITS 0x000000cf
-
-/*
- * This enumerated type is used in the class field of the object ID.
- */
-
-typedef enum {
- OBJECTS_NO_CLASS = 0,
- OBJECTS_INTERNAL_THREADS = 1,
- OBJECTS_RTEMS_TASKS = 2,
- OBJECTS_POSIX_THREADS = 3,
- OBJECTS_RTEMS_TIMERS = 4,
- OBJECTS_RTEMS_SEMAPHORES = 5,
- OBJECTS_RTEMS_MESSAGE_QUEUES = 6,
- OBJECTS_RTEMS_PARTITIONS = 7,
- OBJECTS_RTEMS_REGIONS = 8,
- OBJECTS_RTEMS_PORTS = 9,
- OBJECTS_RTEMS_PERIODS = 10,
- OBJECTS_RTEMS_EXTENSIONS = 11,
- OBJECTS_POSIX_KEYS = 12,
- OBJECTS_POSIX_INTERRUPTS = 13,
- OBJECTS_POSIX_MESSAGE_QUEUES = 14,
- OBJECTS_POSIX_MUTEXES = 15,
- OBJECTS_POSIX_SEMAPHORES = 16,
- OBJECTS_POSIX_CONDITION_VARIABLES = 17
-} Objects_Classes;
-
-#define OBJECTS_CLASSES_FIRST OBJECTS_NO_CLASS
-#define OBJECTS_CLASSES_LAST OBJECTS_POSIX_CONDITION_VARIABLES
-#define OBJECTS_CLASSES_FIRST_THREAD_CLASS OBJECTS_INTERNAL_THREADS
-#define OBJECTS_CLASSES_LAST_THREAD_CLASS OBJECTS_POSIX_THREADS
-
-/*
- * This enumerated type lists the locations which may be returned
- * by _Objects_Get. These codes indicate the success of locating
- * an object with the specified ID.
- */
-
-typedef enum {
- OBJECTS_LOCAL = 0, /* object is local */
- OBJECTS_REMOTE = 1, /* object is remote */
- OBJECTS_ERROR = 2 /* id was invalid */
-} Objects_Locations;
-
-/*
- * The following defines the Object Control Block used to manage
- * each object local to this node.
- */
-
-typedef struct {
- Chain_Node Node;
- Objects_Id id;
- Objects_Name name;
-} Objects_Control;
-
-/*
- * The following defines the structure for the information used to
- * manage each class of objects.
- */
-
-typedef struct {
- Objects_Classes the_class; /* Class of this object */
- Objects_Id minimum_id; /* minimum valid id of this type */
- Objects_Id maximum_id; /* maximum valid id of this type */
- unsigned32 maximum; /* maximum number of objects */
- Objects_Control **local_table; /* table of local object pointers */
- Objects_Name *name_table; /* table of local object names */
- Chain_Control *global_table; /* pointer to global table */
- Chain_Control Inactive; /* chain of inactive ctl blocks */
- boolean is_string; /* TRUE if names are strings */
- unsigned32 name_length; /* maximum length of names */
- boolean is_thread; /* TRUE if these are threads */
- /* irregardless of API */
-} Objects_Information;
-
-/*
- * The following defines the data storage which contains the
- * node number of the local node.
- */
-
-SCORE_EXTERN unsigned32 _Objects_Local_node;
-SCORE_EXTERN unsigned32 _Objects_Maximum_nodes;
-
-/*
- * The following is the list of information blocks for each object
- * class. From the ID, we can go to one of these information blocks,
- * and obtain a pointer to the appropriate object control block.
- */
-
-SCORE_EXTERN Objects_Information
- *_Objects_Information_table[OBJECTS_CLASSES_LAST + 1];
-
-/*
- * The following defines the constant which may be used
- * with _Objects_Get to manipulate the calling task.
- *
- */
-
-#define OBJECTS_ID_OF_SELF ((Objects_Id) 0)
-
-/*
- * The following define the constants which may be used in name searches.
- */
-
-#define OBJECTS_SEARCH_ALL_NODES 0
-#define OBJECTS_SEARCH_OTHER_NODES 0x7FFFFFFE
-#define OBJECTS_SEARCH_LOCAL_NODE 0x7FFFFFFF
-#define OBJECTS_WHO_AM_I 0
-
-/*
- * Parameters and return id's for _Objects_Get_next
- */
-
-#define OBJECTS_ID_INITIAL_INDEX (0)
-#define OBJECTS_ID_FINAL_INDEX (0xffff)
-
-#define OBJECTS_ID_INITIAL(_class, _node) \
- _Objects_Build_id( (_class), (_node), OBJECTS_ID_INITIAL_INDEX )
-
-#define OBJECTS_ID_FINAL ((Objects_Id)~0)
-
-/*
- * _Objects_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This function performs the initialization necessary for this handler.
- *
- */
-
-void _Objects_Handler_initialization(
- unsigned32 node,
- unsigned32 maximum_nodes,
- unsigned32 maximum_global_objects
-);
-
-/*
- * _Objects_Initialize_information
- *
- * DESCRIPTION:
- *
- * This function initializes an object class information record.
- * SUPPORTS_GLOBAL is TRUE if the object class supports global
- * objects, and FALSE otherwise. Maximum indicates the number
- * of objects required in this class and size indicates the size
- * in bytes of each control block for this object class. The
- * name length and string designator are also set. In addition,
- * the class may be a task, therefore this information is also included.
- */
-
-void _Objects_Initialize_information (
- Objects_Information *information,
- Objects_Classes the_class,
- boolean supports_global,
- unsigned32 maximum,
- unsigned32 size,
- boolean is_string,
- unsigned32 maximum_name_length,
- boolean is_task
-);
-
-/*
- * _Objects_Clear_name
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _Objects_Clear_name(
- void *name,
- unsigned32 length
-);
-
-/*
- * _Objects_Copy_name_string
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _Objects_Copy_name_string(
- void *source,
- void *destination
-);
-
-/*
- * _Objects_Copy_name_raw
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _Objects_Copy_name_raw(
- void *source,
- void *destination,
- unsigned32 length
-);
-
-/*
- * _Objects_Compare_name_string
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-boolean _Objects_Compare_name_string(
- void *name_1,
- void *name_2,
- unsigned32 length
-);
-
-/*
- * _Objects_Compare_name_raw
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-boolean _Objects_Compare_name_raw(
- void *name_1,
- void *name_2,
- unsigned32 length
-);
-/*
- * _Objects_Name_to_id
- *
- * DESCRIPTION:
- *
- * This function implements the common portion of the object
- * identification directives. This directive returns the object
- * id associated with name. If more than one object of this class
- * is named name, then the object to which the id belongs is
- * arbitrary. Node indicates the extent of the search for the
- * id of the object named name. If the object class supports global
- * objects, then the search can be limited to a particular node
- * or allowed to encompass all nodes.
- *
- */
-
-typedef enum {
- OBJECTS_SUCCESSFUL,
- OBJECTS_INVALID_NAME,
- OBJECTS_INVALID_NODE
-} Objects_Name_to_id_errors;
-
-#define OBJECTS_NAME_ERRORS_FIRST OBJECTS_SUCCESSFUL
-#define OBJECTS_NAME_ERRORS_LAST OBJECTS_INVALID_NODE
-
-Objects_Name_to_id_errors _Objects_Name_to_id(
- Objects_Information *information,
- Objects_Name name,
- unsigned32 node,
- Objects_Id *id
-);
-
-/*
- * _Objects_Get
- *
- * DESCRIPTION:
- *
- * This function maps object ids to object control blocks.
- * If id corresponds to a local object, then it returns
- * the_object control pointer which maps to id and location
- * is set to OBJECTS_LOCAL. If the object class supports global
- * objects and the object id is global and resides on a remote
- * node, then location is set to OBJECTS_REMOTE, and the_object
- * is undefined. Otherwise, location is set to OBJECTS_ERROR
- * and the_object is undefined.
- *
- */
-
-Objects_Control *_Objects_Get (
- Objects_Information *information,
- Objects_Id id,
- Objects_Locations *location
-);
-
-/*
- * _Objects_Get_next
- *
- * DESCRIPTION:
- *
- * Like _Objects_Get, but is used to find "next" open object.
- *
- */
-
-Objects_Control *_Objects_Get_next(
- Objects_Information *information,
- Objects_Id id,
- Objects_Locations *location_p,
- Objects_Id *next_id_p
-);
-
-/*
- * _Objects_Get_information
- *
- * DESCRIPTION:
- *
- * Returns the information control block for the class of objects
- * corresponding to this id.
- */
-
-Objects_Information *_Objects_Get_information(
- Objects_Id id
-);
-
-/*
- * Pieces of object.inl are promoted out to the user
- */
-
-#include <rtems/score/object.inl>
-#include <rtems/score/objectmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/objectmp.h b/c/src/exec/score/headers/objectmp.h
deleted file mode 100644
index e307ca4264..0000000000
--- a/c/src/exec/score/headers/objectmp.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/* objectmp.h
- *
- * This include file contains all the constants and structures associated
- * with the manipulation of Global RTEMS Objects.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_OBJECTS_MP_h
-#define __RTEMS_OBJECTS_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This defines the Global Object Control Block used to manage
- * objects resident on other nodes.
- */
-
-typedef struct {
- Objects_Control Object;
- unsigned32 name; /* XXX broken but works */
- /* XXX If any API is MP with variable length names .. BOOM!!!! */
-} Objects_MP_Control;
-
-/*
- * _Objects_MP_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine intializes the inactive global object chain
- * based on the maximum number of global objects configured.
- */
-
-void _Objects_MP_Handler_initialization (
- unsigned32 node,
- unsigned32 maximum_nodes,
- unsigned32 maximum_global_objects
-);
-
-/*PAGE
- *
- * _Objects_MP_Open
- *
- * DESCRIPTION:
- *
- * This routine place the specified global object in the
- * specified information table.
- */
-
-void _Objects_MP_Open (
- Objects_Information *information,
- Objects_MP_Control *the_global_object,
- unsigned32 the_name, /* XXX -- wrong for variable */
- Objects_Id the_id
-);
-
-/*
- * _Objects_MP_Allocate_and_open
- *
- * DESCRIPTION:
- *
- * This routine allocates a global object control block
- * and places it in the specified information table. If the
- * allocation fails, then is_fatal_error determines the
- * error processing actions taken.
- */
-
-boolean _Objects_MP_Allocate_and_open (
- Objects_Information *information,
- unsigned32 the_name, /* XXX -- wrong for variable length */
- Objects_Id the_id,
- boolean is_fatal_error
-);
-
-/*
- * _Objects_MP_Close
- *
- * DESCRIPTION:
- *
- * This routine removes a global object from the specified
- * information table and deallocates the global object control block.
- */
-
-void _Objects_MP_Close (
- Objects_Information *information,
- Objects_Id the_id
-);
-
-/*
- * _Objects_MP_Global_name_search
- *
- * DESCRIPTION:
- *
- * This routine looks for the object with the_name in the global
- * object tables indicated by information. It returns the ID of the
- * object with that name if one is found.
- */
-
-Objects_Name_to_id_errors _Objects_MP_Global_name_search (
- Objects_Information *information,
- Objects_Name the_name,
- unsigned32 nodes_to_search,
- Objects_Id *the_id
-);
-
-/*
- * _Objects_MP_Is_remote
- *
- * DESCRIPTION:
- *
- * This function searches the Global Object Table managed
- * by information for the object indicated by ID. If the object
- * is found, then location is set to objects_remote, otherwise
- * location is set to objects_error. In both cases, the_object
- * is undefined.
- */
-
-void _Objects_MP_Is_remote (
- Objects_Information *information,
- Objects_Id the_id,
- Objects_Locations *location,
- Objects_Control **the_object
-);
-
-/*
- * The following chain header is used to manage the set of
- * inactive global object control blocks.
- */
-
-SCORE_EXTERN unsigned32 _Objects_MP_Maximum_global_objects;
-SCORE_EXTERN Chain_Control _Objects_MP_Inactive_global_objects;
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/objectmp.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/priority.h b/c/src/exec/score/headers/priority.h
deleted file mode 100644
index 7241888242..0000000000
--- a/c/src/exec/score/headers/priority.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* priority.h
- *
- * This include file contains all thread priority manipulation routines.
- * This Handler provides mechanisms which can be used to
- * initialize and manipulate thread priorities.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PRIORITY_h
-#define __PRIORITY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type defines the control block used to manage
- * thread priorities.
- *
- * NOTE: Priority 0 is reserved for internal threads only.
- */
-
-typedef unsigned32 Priority_Control;
-
-#define PRIORITY_MINIMUM 0 /* highest thread priority */
-#define PRIORITY_MAXIMUM 255 /* lowest thread priority */
-
-/*
- * The following record defines the information associated with
- * each thread to manage its interaction with the priority bit maps.
- */
-
-typedef struct {
- Priority_Bit_map_control *minor; /* addr of minor bit map slot */
- Priority_Bit_map_control ready_major; /* priority bit map ready mask */
- Priority_Bit_map_control ready_minor; /* priority bit map ready mask */
- Priority_Bit_map_control block_major; /* priority bit map block mask */
- Priority_Bit_map_control block_minor; /* priority bit map block mask */
-} Priority_Information;
-
-/*
- * The following data items are the priority bit map.
- * Each of the sixteen bits used in the _Priority_Major_bit_map is
- * associated with one of the sixteen entries in the _Priority_Bit_map.
- * Each bit in the _Priority_Bit_map indicates whether or not there are
- * threads ready at a particular priority. The mapping of
- * individual priority levels to particular bits is processor
- * dependent as is the value of each bit used to indicate that
- * threads are ready at that priority.
- */
-
-SCORE_EXTERN volatile Priority_Bit_map_control _Priority_Major_bit_map;
-SCORE_EXTERN Priority_Bit_map_control
- _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;
-
-/*
- * The definition of the Priority_Bit_map_control type is CPU dependent.
- *
- */
-
-/*
- * Priority Bitfield Manipulation Routines
- *
- * NOTE:
- *
- * These may simply be pass throughs to CPU dependent routines.
- */
-
-#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE )
-
-#define _Priority_Mask( _bit_number ) \
- _CPU_Priority_Mask( _bit_number )
-
-#define _Priority_Bits_index( _priority ) \
- _CPU_Priority_bits_index( _priority )
-
-#endif
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/priority.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/stack.h b/c/src/exec/score/headers/stack.h
deleted file mode 100644
index 1fc4a13966..0000000000
--- a/c/src/exec/score/headers/stack.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* stack.h
- *
- * This include file contains all information about the thread
- * Stack Handler. This Handler provides mechanisms which can be used to
- * initialize and utilize stacks.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STACK_h
-#define __STACK_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following constant defines the minimum stack size which every
- * thread must exceed.
- */
-
-#define STACK_MINIMUM_SIZE CPU_STACK_MINIMUM_SIZE
-
-/*
- * The following defines the control block used to manage each stack.
- */
-
-typedef struct {
- unsigned32 size; /* stack size */
- void *area; /* low memory addr of stack */
-} Stack_Control;
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/stack.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/states.h b/c/src/exec/score/headers/states.h
deleted file mode 100644
index a0d7ed8ab8..0000000000
--- a/c/src/exec/score/headers/states.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* states.h
- *
- * This include file contains thread execution state information.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_STATES_h
-#define __RTEMS_STATES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type defines the control block used to manage a
- * thread's state.
- */
-
-typedef unsigned32 States_Control;
-
-/*
- * The following constants define the individual states which may be
- * be used to compose and manipulate a thread's state.
- */
-
-#define STATES_ALL_SET 0xfffff /* all states */
-#define STATES_READY 0x00000 /* ready to run */
-#define STATES_DORMANT 0x00001 /* created not started */
-#define STATES_SUSPENDED 0x00002 /* waiting for resume */
-#define STATES_TRANSIENT 0x00004 /* in transition */
-#define STATES_DELAYING 0x00008 /* wait for timeout */
-#define STATES_WAITING_FOR_TIME 0x00010 /* wait for TOD */
-#define STATES_WAITING_FOR_BUFFER 0x00020
-#define STATES_WAITING_FOR_SEGMENT 0x00040
-#define STATES_WAITING_FOR_MESSAGE 0x00080
-#define STATES_WAITING_FOR_EVENT 0x00100
-#define STATES_WAITING_FOR_SEMAPHORE 0x00200
-#define STATES_WAITING_FOR_MUTEX 0x00400
-#define STATES_WAITING_FOR_CONDITION_VARIABLE 0x00800
-#define STATES_WAITING_FOR_JOIN_AT_EXIT 0x01000
-#define STATES_WAITING_FOR_RPC_REPLY 0x02000
-#define STATES_WAITING_FOR_PERIOD 0x04000
-#define STATES_WAITING_FOR_SIGNAL 0x08000
-#define STATES_INTERRUPTIBLE_BY_SIGNAL 0x10000
-
-#define STATES_LOCALLY_BLOCKED ( STATES_WAITING_FOR_BUFFER | \
- STATES_WAITING_FOR_SEGMENT | \
- STATES_WAITING_FOR_MESSAGE | \
- STATES_WAITING_FOR_SEMAPHORE | \
- STATES_WAITING_FOR_MUTEX | \
- STATES_WAITING_FOR_CONDITION_VARIABLE | \
- STATES_WAITING_FOR_JOIN_AT_EXIT | \
- STATES_WAITING_FOR_SIGNAL )
-
-#define STATES_WAITING_ON_THREAD_QUEUE \
- ( STATES_LOCALLY_BLOCKED | \
- STATES_WAITING_FOR_RPC_REPLY )
-
-#define STATES_BLOCKED ( STATES_DELAYING | \
- STATES_WAITING_FOR_TIME | \
- STATES_WAITING_FOR_PERIOD | \
- STATES_WAITING_FOR_EVENT | \
- STATES_WAITING_ON_THREAD_QUEUE | \
- STATES_INTERRUPTIBLE_BY_SIGNAL )
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/states.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/sysstate.h b/c/src/exec/score/headers/sysstate.h
deleted file mode 100644
index 8451894e97..0000000000
--- a/c/src/exec/score/headers/sysstate.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* sysstates.h
- *
- * This include file contains information regarding the system state.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SYSTEM_STATE_h
-#define __RTEMS_SYSTEM_STATE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* types */
-
-/* enumerated constants */
-
-/*
- * The following type defines the possible system states.
- */
-
-typedef enum {
- SYSTEM_STATE_BEFORE_INITIALIZATION, /* start -> end of 1st init part */
- SYSTEM_STATE_BEFORE_MULTITASKING, /* end of 1st -> beginning of 2nd */
- SYSTEM_STATE_BEGIN_MULTITASKING, /* just before multitasking starts */
- SYSTEM_STATE_UP, /* normal operation */
- SYSTEM_STATE_SHUTDOWN, /* shutdown */
- SYSTEM_STATE_FAILED /* fatal error occurred */
-} System_state_Codes;
-
-#define SYSTEM_STATE_CODES_FIRST SYSTEM_STATE_BEFORE_INITIALIZATION
-#define SYSTEM_STATE_CODES_LAST SYSTEM_STATE_FAILED
-
-/*
- * The following variable indicates whether or not this is
- * an multiprocessing system.
- */
-
-SCORE_EXTERN boolean _System_state_Is_multiprocessing;
-
-/*
- * The following variable contains the current system state.
- */
-
-SCORE_EXTERN System_state_Codes _System_state_Current;
-
-/*
- * Make it possible for the application to get the system state information.
- */
-
-#include <rtems/score/sysstate.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/system.h b/c/src/exec/score/headers/system.h
deleted file mode 100644
index 5e1cc80ed5..0000000000
--- a/c/src/exec/score/headers/system.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the executive. This must be the first include file
- * included in all internal RTEMS files.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SYSTEM_h
-#define __RTEMS_SYSTEM_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The target options include file defines all target dependent
- * parameters for this build of RTEMS. It must be included
- * first so the basic macro definitions are in place.
- */
-
-#include <rtems/score/targopts.h>
-
-/*
- * The following insures that all data is declared in the space
- * of the initialization routine for either the Initialization Manager
- * or the initialization file for the appropriate API. It is
- * referenced as "external" in every other file.
- */
-
-#ifdef SCORE_INIT
-#undef SCORE_EXTERN
-#define SCORE_EXTERN
-#else
-#undef SCORE_EXTERN
-#define SCORE_EXTERN extern
-#endif
-
-#ifdef SAPI_INIT
-#undef SAPI_EXTERN
-#define SAPI_EXTERN
-#else
-#undef SAPI_EXTERN
-#define SAPI_EXTERN extern
-#endif
-
-#ifdef RTEMS_API_INIT
-#undef RTEMS_EXTERN
-#define RTEMS_EXTERN
-#else
-#undef RTEMS_EXTERN
-#define RTEMS_EXTERN extern
-#endif
-
-#ifdef POSIX_API_INIT
-#undef POSIX_EXTERN
-#define POSIX_EXTERN
-#else
-#undef POSIX_EXTERN
-#define POSIX_EXTERN extern
-#endif
-
-/*
- * The following (in conjunction with compiler arguments) are used
- * to choose between the use of static inline functions and macro
- * functions. The static inline implementation allows better
- * type checking with no cost in code size or execution speed.
- */
-
-#ifdef USE_INLINES
-# ifdef __GNUC__
-# define RTEMS_INLINE_ROUTINE static __inline__
-# else
-# define RTEMS_INLINE_ROUTINE static inline
-# endif
-#else
-# define RTEMS_INLINE_ROUTINE
-#endif
-
-/*
- * Include a base set of files.
- */
-
-/*
- * XXX: Eventually proc_ptr needs to disappear!!!
- */
-
-typedef void * proc_ptr;
-
-/*
- * Define NULL
- */
-
-#ifndef NULL
-#define NULL 0 /* NULL value */
-#endif
-
-/*
- * Boolean constants
- */
-
-#if !defined( TRUE ) || (TRUE != 1)
-#undef TRUE
-#define TRUE (1)
-#endif
-
-#if !defined( FALSE ) || (FALSE != 0)
-#undef FALSE
-#define FALSE (0)
-#endif
-
-#include <rtems/score/cpu.h> /* processor specific information */
-
-#define stringify( _x ) # _x
-
-#define RTEMS_offsetof(type, field) \
- ((unsigned32) &(((type *) 0)->field))
-
-/*
- * The following is the extern for the RTEMS version string.
- * The contents of this string are CPU specific.
- */
-
-extern const char _RTEMS_version[]; /* RTEMS version string */
-extern const char _Copyright_Notice[]; /* RTEMS copyright string */
-
-/*
- * The following defines the CPU dependent information table.
- */
-
-SCORE_EXTERN rtems_cpu_table _CPU_Table; /* CPU dependent info */
-
-/*
- * XXX weird RTEMS stuff
- */
-
-#define RTEMS_MAXIMUM_NAME_LENGTH 4
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/thread.h b/c/src/exec/score/headers/thread.h
deleted file mode 100644
index da6fa76bd0..0000000000
--- a/c/src/exec/score/headers/thread.h
+++ /dev/null
@@ -1,622 +0,0 @@
-/* thread.h
- *
- * This include file contains all constants and structures associated
- * with the thread control block.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_h
-#define __THREAD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/context.h>
-#include <rtems/score/cpu.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/stack.h>
-#include <rtems/score/states.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/tqdata.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following defines the "return type" of a thread.
- */
-
-typedef void Thread;
-
-/*
- * The following defines the ways in which the entry point for a
- * thread can be invoked. Basically, it can be passed any
- * combination/permutation of a pointer and an unsigned32 value.
- *
- * NOTE: For now, we are ignoring the return type.
- */
-
-typedef enum {
- THREAD_START_NUMERIC,
- THREAD_START_POINTER,
- THREAD_START_BOTH_POINTER_FIRST,
- THREAD_START_BOTH_NUMERIC_FIRST
-} Thread_Start_types;
-
-typedef Thread ( *Thread_Entry )(); /* basic type */
-
-typedef Thread ( *Thread_Entry_numeric )( unsigned32 );
-typedef Thread ( *Thread_Entry_pointer )( void * );
-typedef Thread ( *Thread_Entry_both_pointer_first )( void *, unsigned32 );
-typedef Thread ( *Thread_Entry_both_numeric_first )( unsigned32, void * );
-
-/*
- * The following lists the algorithms used to manage the thread cpu budget.
- *
- * Reset Timeslice: At each context switch, reset the time quantum.
- * Exhaust Timeslice: Only reset the quantum once it is consumed.
- * Callout: Execute routine when budget is consumed.
- */
-
-typedef enum {
- THREAD_CPU_BUDGET_ALGORITHM_NONE,
- THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE,
- THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE,
- THREAD_CPU_BUDGET_ALGORITHM_CALLOUT
-} Thread_CPU_budget_algorithms;
-
-typedef struct Thread_Control_struct Thread_Control;
-
-typedef void (*Thread_CPU_budget_algorithm_callout )( Thread_Control * );
-
-/*
- * The following structure contains the information which defines
- * the starting state of a thread.
- */
-
-typedef struct {
- Thread_Entry entry_point; /* starting thread address */
- Thread_Start_types prototype; /* how task is invoked */
- void *pointer_argument; /* pointer argument */
- unsigned32 numeric_argument; /* numeric argument */
- /* initial execution modes */
- boolean is_preemptible;
- Thread_CPU_budget_algorithms budget_algorithm;
- Thread_CPU_budget_algorithm_callout budget_callout;
- unsigned32 isr_level;
- Priority_Control initial_priority; /* initial priority */
- boolean core_allocated_stack;
- Stack_Control Initial_stack; /* stack information */
- void *fp_context; /* initial FP context area address */
- void *stack; /* initial stack area address */
-} Thread_Start_information;
-
-/*
- * The following structure contains the information necessary to manage
- * a thread which it is waiting for a resource.
- */
-
-#define THREAD_STATUS_PROXY_BLOCKING 0x1111111
-
-typedef struct {
- Objects_Id id; /* waiting on this object */
- unsigned32 count; /* "generic" fields to be used */
- void *return_argument; /* when blocking */
- void *return_argument_1;
- unsigned32 option;
-
- /*
- * NOTE: The following assumes that all API return codes can be
- * treated as an unsigned32.
- */
- unsigned32 return_code; /* status for thread awakened */
-
- Chain_Control Block2n; /* 2 - n priority blocked chain */
- Thread_queue_Control *queue; /* pointer to thread queue */
-} Thread_Wait_information;
-
-/*
- * The following defines the control block used to manage
- * each thread proxy.
- *
- * NOTE: It is critical that proxies and threads have identical
- * memory images for the shared part.
- */
-
-typedef struct {
- Objects_Control Object;
- States_Control current_state;
- Priority_Control current_priority;
- Priority_Control real_priority;
- unsigned32 resource_count;
- Thread_Wait_information Wait;
- Watchdog_Control Timer;
- MP_packet_Prefix *receive_packet;
- /****************** end of common block ********************/
- Chain_Node Active;
-} Thread_Proxy_control;
-
-
-/*
- * The following record defines the control block used
- * to manage each thread.
- *
- * NOTE: It is critical that proxies and threads have identical
- * memory images for the shared part.
- */
-
-typedef enum {
- THREAD_API_RTEMS,
- THREAD_API_POSIX
-} Thread_APIs;
-
-#define THREAD_API_FIRST THREAD_API_RTEMS
-#define THREAD_API_LAST THREAD_API_POSIX
-
-struct Thread_Control_struct {
- Objects_Control Object;
- States_Control current_state;
- Priority_Control current_priority;
- Priority_Control real_priority;
- unsigned32 resource_count;
- Thread_Wait_information Wait;
- Watchdog_Control Timer;
- MP_packet_Prefix *receive_packet;
- /****************** end of common block ********************/
- boolean is_global;
- boolean do_post_task_switch_extension;
-
- boolean is_preemptible;
- unsigned32 cpu_time_budget;
- Thread_CPU_budget_algorithms budget_algorithm;
- Thread_CPU_budget_algorithm_callout budget_callout;
-
- unsigned32 ticks_executed;
- Chain_Control *ready;
- Priority_Information Priority_map;
- Thread_Start_information Start;
- Context_Control Registers;
- void *fp_context;
- void *API_Extensions[ THREAD_API_LAST + 1 ];
- void **extensions;
-};
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-SCORE_EXTERN Objects_Information _Thread_Internal_information;
-
-/*
- * The following define the thread control pointers used to access
- * and manipulate the idle thread.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_Idle;
-
-/*
- * The following context area contains the context of the "thread"
- * which invoked the start multitasking routine. This context is
- * restored as the last action of the stop multitasking routine. Thus
- * control of the processor can be returned to the environment
- * which initiated the system.
- */
-
-SCORE_EXTERN Context_Control _Thread_BSP_context;
-
-/*
- * The following declares the dispatch critical section nesting
- * counter which is used to prevent context switches at inopportune
- * moments.
- */
-
-SCORE_EXTERN unsigned32 _Thread_Dispatch_disable_level;
-
-/*
- * If this is non-zero, then the post-task switch extension
- * is run regardless of the state of the per thread flag.
- */
-
-SCORE_EXTERN unsigned32 _Thread_Do_post_task_switch_extension;
-
-/*
- * The following holds how many user extensions are in the system. This
- * is used to determine how many user extension data areas to allocate
- * per thread.
- */
-
-SCORE_EXTERN unsigned32 _Thread_Maximum_extensions;
-
-/*
- * The following is used to manage the length of a timeslice quantum.
- */
-
-SCORE_EXTERN unsigned32 _Thread_Ticks_per_timeslice;
-
-/*
- * The following points to the array of FIFOs used to manage the
- * set of ready threads.
- */
-
-SCORE_EXTERN Chain_Control *_Thread_Ready_chain;
-
-/*
- * The following points to the thread which is currently executing.
- * This thread is implicitly manipulated by numerous directives.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_Executing;
-
-/*
- * The following points to the highest priority ready thread
- * in the system. Unless the current thread is not preemptibl,
- * then this thread will be context switched to when the next
- * dispatch occurs.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_Heir;
-
-/*
- * The following points to the thread whose floating point
- * context is currently loaded.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_Allocated_fp;
-
-/*
- * _Thread_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _Thread_Handler_initialization (
- unsigned32 ticks_per_timeslice,
- unsigned32 maximum_extensions,
- unsigned32 maximum_proxies
-);
-
-/*
- * _Thread_Create_idle
- *
- * DESCRIPTION:
- *
- * This routine creates the idle thread.
- *
- * WARNING!! No thread should be created before this one.
- */
-
-void _Thread_Create_idle( void );
-
-/*
- * _Thread_Start_multitasking
- *
- * DESCRIPTION:
- *
- * This routine initiates multitasking. It is invoked only as
- * part of initialization and its invocation is the last act of
- * the non-multitasking part of the system initialization.
- */
-
-void _Thread_Start_multitasking( void );
-
-/*
- * _Thread_Dispatch
- *
- * DESCRIPTION:
- *
- * This routine is responsible for transferring control of the
- * processor from the executing thread to the heir thread. As part
- * of this process, it is responsible for the following actions:
- *
- * + saving the context of the executing thread
- * + restoring the context of the heir thread
- * + dispatching any signals for the resulting executing thread
- */
-
-void _Thread_Dispatch( void );
-
-/*
- * _Thread_Initialize
- *
- * DESCRIPTION:
- *
- * XXX
- *
- * NOTES:
- *
- * If stack_area is NULL, it is allocated from the workspace.
- *
- * If the stack is allocated from the workspace, then it is guaranteed to be
- * of at least minimum size.
- */
-
-boolean _Thread_Initialize(
- Objects_Information *information,
- Thread_Control *the_thread,
- void *stack_area,
- unsigned32 stack_size,
- boolean is_fp,
- Priority_Control priority,
- boolean is_preemptible,
- Thread_CPU_budget_algorithms budget_algorithm,
- Thread_CPU_budget_algorithm_callout budget_callout,
- unsigned32 isr_level,
- Objects_Name name
-);
-
-/*
- * _Thread_Start
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-boolean _Thread_Start(
- Thread_Control *the_thread,
- Thread_Start_types the_prototype,
- void *entry_point,
- void *pointer_argument,
- unsigned32 numeric_argument
-);
-
-/*
- * _Thread_Restart
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-/* XXX multiple task arg profiles */
-
-boolean _Thread_Restart(
- Thread_Control *the_thread,
- void *pointer_argument,
- unsigned32 numeric_argument
-);
-
-/*
- * _Thread_Close
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _Thread_Close(
- Objects_Information *information,
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_Ready
- *
- * DESCRIPTION:
- *
- * This routine removes any set states for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-void _Thread_Ready(
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_Clear_state
- *
- * DESCRIPTION:
- *
- * This routine clears the indicated STATES for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-void _Thread_Clear_state(
- Thread_Control *the_thread,
- States_Control state
-);
-
-/*
- * _Thread_Set_state
- *
- * DESCRIPTION:
- *
- * This routine sets the indicated states for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- *
- */
-
-void _Thread_Set_state(
- Thread_Control *the_thread,
- States_Control state
-);
-
-/*
- * _Thread_Set_transient
- *
- * DESCRIPTION:
- *
- * This routine sets the TRANSIENT state for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-void _Thread_Set_transient(
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_Reset_timeslice
- *
- * DESCRIPTION:
- *
- * This routine is invoked upon expiration of the currently
- * executing thread's timeslice. If no other thread's are ready
- * at the priority of the currently executing thread, then the
- * executing thread's timeslice is reset. Otherwise, the
- * currently executing thread is placed at the rear of the
- * FIFO for this priority and a new heir is selected.
- */
-
-void _Thread_Reset_timeslice( void );
-
-/*
- * _Thread_Tickle_timeslice
- *
- * DESCRIPTION:
- *
- * This routine is invoked as part of processing each clock tick.
- * It is responsible for determining if the current thread allows
- * timeslicing and, if so, when its timeslice expires.
- */
-
-void _Thread_Tickle_timeslice( void );
-
-/*
- * _Thread_Yield_processor
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a thread wishes to voluntarily
- * transfer control of the processor to another thread of equal
- * or greater priority.
- */
-
-void _Thread_Yield_processor( void );
-
-/*
- * _Thread_Load_environment
- *
- * DESCRIPTION:
- *
- * This routine initializes the context of the_thread to its
- * appropriate starting state.
- */
-
-void _Thread_Load_environment(
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_Handler
- *
- * DESCRIPTION:
- *
- * This routine is the wrapper function for all threads. It is
- * the starting point for all threads. The user provided thread
- * entry point is invoked by this routine. Operations
- * which must be performed immediately before and after the user's
- * thread executes are found here.
- */
-
-void _Thread_Handler( void );
-
-/*
- * _Thread_Delay_ended
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a thread must be unblocked at the
- * end of a time based delay (i.e. wake after or wake when).
- */
-
-void _Thread_Delay_ended(
- Objects_Id id,
- void *ignored
-);
-
-/*
- * _Thread_Change_priority
- *
- * DESCRIPTION:
- *
- * This routine changes the current priority of the_thread to
- * new_priority. It performs any necessary scheduling operations
- * including the selection of a new heir thread.
- */
-
-void _Thread_Change_priority (
- Thread_Control *the_thread,
- Priority_Control new_priority,
- boolean prepend_it
-);
-
-/*
- * _Thread_Set_priority
- *
- * DESCRIPTION:
- *
- * This routine updates the priority related fields in the_thread
- * control block to indicate the current priority is now new_priority.
- */
-
-void _Thread_Set_priority(
- Thread_Control *the_thread,
- Priority_Control new_priority
-);
-
-/*
- * _Thread_Evaluate_mode
- *
- * DESCRIPTION:
- *
- * This routine XXX
- */
-
-boolean _Thread_Evaluate_mode( void );
-
-/*
- * _Thread_Get
- *
- * NOTE: If we are not using static inlines, this must be a real
- * subroutine call.
- */
-
-#ifndef USE_INLINES
-Thread_Control *_Thread_Get (
- Objects_Id id,
- Objects_Locations *location
-);
-#endif
-
-/*
- * _Thread_Idle_body
- *
- * DESCRIPTION:
- *
- * This routine is the body of the system idle thread.
- */
-
-#if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)
-Thread _Thread_Idle_body(
- unsigned32 ignored
-);
-#endif
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/thread.inl>
-#endif
-#include <rtems/score/threadmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/threadmp.h b/c/src/exec/score/headers/threadmp.h
deleted file mode 100644
index 497bdc8c5b..0000000000
--- a/c/src/exec/score/headers/threadmp.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* threadmp.h
- *
- * This include file contains the specification for all routines
- * and data specific to the multiprocessing portion of the thread package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_THREAD_MP_h
-#define __RTEMS_THREAD_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * _Thread_MP_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the multiprocessing portion of the Thread Handler.
- */
-
-void _Thread_MP_Handler_initialization (
- unsigned32 maximum_proxies
-);
-
-/*
- * _Thread_MP_Allocate_proxy
- *
- * DESCRIPTION:
- *
- * This allocates a proxy control block from
- * the inactive chain of free proxy control blocks.
- *
- * NOTE: This function returns a thread control pointer
- * because proxies are substitutes for remote threads.
- */
-
-Thread_Control *_Thread_MP_Allocate_proxy (
- States_Control the_state
-);
-
-/*
- * _Thread_MP_Find_proxy
- *
- * DESCRIPTION:
- *
- * This function removes the proxy control block for the specified
- * id from the active chain of proxy control blocks.
- */
-
-Thread_Control *_Thread_MP_Find_proxy (
- Objects_Id the_id
-);
-
-/*
- * The following is used to determine when the multiprocessing receive
- * thread is executing so that a proxy can be allocated instead of
- * blocking the multiprocessing receive thread.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_MP_Receive;
-
-/*
- * The following chains are used to manage proxies.
- */
-
-SCORE_EXTERN Chain_Control _Thread_MP_Active_proxies;
-SCORE_EXTERN Chain_Control _Thread_MP_Inactive_proxies;
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/threadmp.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/threadq.h b/c/src/exec/score/headers/threadq.h
deleted file mode 100644
index d3a0f58ad1..0000000000
--- a/c/src/exec/score/headers/threadq.h
+++ /dev/null
@@ -1,301 +0,0 @@
-/* threadq.h
- *
- * This include file contains all the constants and structures associated
- * with the manipulation of objects.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_QUEUE_h
-#define __THREAD_QUEUE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/tqdata.h>
-
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * Constant for indefinite wait.
- */
-
-#define THREAD_QUEUE_WAIT_FOREVER WATCHDOG_NO_TIMEOUT
-
-/*
- * The following type defines the callout used when a remote task
- * is extracted from a local thread queue.
- */
-
-typedef void ( *Thread_queue_Flush_callout )(
- Thread_Control *
- );
-
-/*
- * The following type defines the callout used when a local task
- * is extracted from a remote thread queue (i.e. it's proxy must
- * extracted from the remote queue).
- */
-
-typedef void ( *Thread_queue_Extract_callout )(
- Thread_Control *
- );
-
-SCORE_EXTERN Thread_queue_Extract_callout
- _Thread_queue_Extract_table[ OBJECTS_CLASSES_LAST + 1 ];
-
-/*
- * _Thread_queue_Dequeue
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to a thread waiting on
- * the_thread_queue. The selection of this thread is based on
- * the discipline of the_thread_queue. If no threads are waiting
- * on the_thread_queue, then NULL is returned.
- */
-
-Thread_Control *_Thread_queue_Dequeue(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Enqueue
- *
- * DESCRIPTION:
- *
- * This routine enqueues the currently executing thread on
- * the_thread_queue with an optional timeout.
- */
-
-void _Thread_queue_Enqueue(
- Thread_queue_Control *the_thread_queue,
- Watchdog_Interval timeout
-);
-
-/*
- * _Thread_queue_Extract
- *
- * DESCRIPTION:
- *
- * This routine removes the_thread from the_thread_queue
- * and cancels any timeouts associated with this blocking.
- */
-
-void _Thread_queue_Extract(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_queue_Extract_with_proxy
- *
- * DESCRIPTION:
- *
- * This routine extracts the_thread from the_thread_queue
- * and insures that if there is a proxy for this task on
- * another node, it is also dealt with.
- */
-
-boolean _Thread_queue_Extract_with_proxy(
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_queue_First
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the "first" thread
- * on the_thread_queue. The "first" thread is selected
- * based on the discipline of the_thread_queue.
- */
-
-Thread_Control *_Thread_queue_First(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Flush
- *
- * DESCRIPTION:
- *
- * This routine unblocks all threads blocked on the_thread_queue
- * and cancels any associated timeouts.
- */
-
-void _Thread_queue_Flush(
- Thread_queue_Control *the_thread_queue,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-);
-
-/*
- * _Thread_queue_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the_thread_queue based on the
- * discipline indicated in attribute_set. The state set on
- * threads which block on the_thread_queue is state.
- */
-
-void _Thread_queue_Initialize(
- Thread_queue_Control *the_thread_queue,
- Objects_Classes the_class,
- Thread_queue_Disciplines the_discipline,
- States_Control state,
- Thread_queue_Extract_callout proxy_extract_callout,
- unsigned32 timeout_status
-);
-
-/*
- * _Thread_queue_Dequeue_priority
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the highest priority
- * thread waiting on the_thread_queue. If no threads are waiting
- * on the_thread_queue, then NULL is returned.
- */
-
-Thread_Control *_Thread_queue_Dequeue_priority(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Enqueue_priority
- *
- * DESCRIPTION:
- *
- * This routine enqueues the currently executing thread on
- * the_thread_queue with an optional timeout using the
- * priority discipline.
- */
-
-void _Thread_queue_Enqueue_priority(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread,
- Watchdog_Interval timeout
-);
-
-/*
- * _Thread_queue_Extract_priority
- *
- * DESCRIPTION:
- *
- * This routine removes the_thread from the_thread_queue
- * and cancels any timeouts associated with this blocking.
- */
-
-void _Thread_queue_Extract_priority(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_queue_First_priority
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the "first" thread
- * on the_thread_queue. The "first" thread is the highest
- * priority thread waiting on the_thread_queue.
- */
-
-Thread_Control *_Thread_queue_First_priority(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Dequeue_FIFO
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the thread which has
- * been waiting the longest on the_thread_queue. If no
- * threads are waiting on the_thread_queue, then NULL is returned.
- */
-
-Thread_Control *_Thread_queue_Dequeue_fifo(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Enqueue_FIFO
- *
- * DESCRIPTION:
- *
- * This routine enqueues the currently executing thread on
- * the_thread_queue with an optional timeout using the
- * FIFO discipline.
- */
-
-void _Thread_queue_Enqueue_fifo(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread,
- Watchdog_Interval timeout
-);
-
-/*
- * _Thread_queue_Extract_FIFO
- *
- * DESCRIPTION:
- *
- * This routine removes the_thread from the_thread_queue
- * and cancels any timeouts associated with this blocking.
- */
-
-void _Thread_queue_Extract_fifo(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_queue_First_FIFO
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the "first" thread
- * on the_thread_queue. The first thread is the thread
- * which has been waiting longest on the_thread_queue.
- */
-
-Thread_Control *_Thread_queue_First_fifo(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_timeout
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task's request has not
- * been satisfied after the timeout interval specified to
- * enqueue. The task represented by ID will be unblocked and
- * its status code will be set in it's control block to indicate
- * that a timeout has occurred.
- */
-
-void _Thread_queue_Timeout (
- Objects_Id id,
- void *ignored
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/tod.h b/c/src/exec/score/headers/tod.h
deleted file mode 100644
index b87486bda1..0000000000
--- a/c/src/exec/score/headers/tod.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/* tod.h
- *
- * This include file contains all the constants and structures associated
- * with the Time of Day Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIME_OF_DAY_h
-#define __TIME_OF_DAY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following constants are related to the time of day.
- */
-
-#define TOD_SECONDS_PER_MINUTE 60
-#define TOD_MINUTES_PER_HOUR 60
-#define TOD_MONTHS_PER_YEAR 12
-#define TOD_DAYS_PER_YEAR 365
-#define TOD_HOURS_PER_DAY 24
-#define TOD_SECONDS_PER_DAY (TOD_SECONDS_PER_MINUTE * \
- TOD_MINUTES_PER_HOUR * \
- TOD_HOURS_PER_DAY)
-
-#define TOD_SECONDS_PER_NON_LEAP_YEAR (365 * TOD_SECONDS_PER_DAY)
-
-#define TOD_MILLISECONDS_PER_SECOND 1000
-#define TOD_MICROSECONDS_PER_SECOND 1000000
-#define TOD_NANOSECONDS_PER_SECOND 1000000000
-#define TOD_NANOSECONDS_PER_MICROSECOND 1000
-
-/*
- * The following constant define the earliest year to which an
- * time of day can be initialized. This is considered the
- * epoch.
- */
-
-#define TOD_BASE_YEAR 1988
-
-/*
- * The following record defines the time of control block. This
- * control block is used to maintain the current time of day.
- */
-
-typedef struct { /* RTEID style time/date */
- unsigned32 year; /* year, A.D. */
- unsigned32 month; /* month, 1 -> 12 */
- unsigned32 day; /* day, 1 -> 31 */
- unsigned32 hour; /* hour, 0 -> 23 */
- unsigned32 minute; /* minute, 0 -> 59 */
- unsigned32 second; /* second, 0 -> 59 */
- unsigned32 ticks; /* elapsed ticks between secs */
-} TOD_Control;
-
-/*
- * The following is TRUE if the application has set the current
- * time of day, and FALSE otherwise.
- */
-
-SCORE_EXTERN boolean _TOD_Is_set;
-
-/*
- * The following contains the current time of day.
- */
-
-SCORE_EXTERN TOD_Control _TOD_Current;
-
-/*
- * The following contains the number of seconds from 00:00:00
- * January 1, TOD_BASE_YEAR until the current time of day.
- */
-
-SCORE_EXTERN Watchdog_Interval _TOD_Seconds_since_epoch;
-
-/*
- * The following contains the number of microseconds per tick.
- */
-
-SCORE_EXTERN unsigned32 _TOD_Microseconds_per_tick;
-
-/*
- * The following contains the number of clock ticks per second.
- *
- * NOTE:
- *
- * If one second is NOT evenly divisible by the number of microseconds
- * per clock tick, this value will contain only the integer portion
- * of the division. This means that the interval between clock ticks
- * can be a source of error in the current time of day.
- */
-
-SCORE_EXTERN unsigned32 _TOD_Ticks_per_second;
-
-/*
- * This is the control structure for the watchdog timer which
- * fires to service the seconds chain.
- */
-
-SCORE_EXTERN Watchdog_Control _TOD_Seconds_watchdog;
-
-#ifdef SCORE_INIT
-
-/*
- * The following array contains the number of days in all months.
- * The first dimension should be 1 for leap years, and 0 otherwise.
- * The second dimension should range from 1 to 12 for January to
- * February, respectively.
- */
-
-const unsigned32 _TOD_Days_per_month[ 2 ][ 13 ] = {
- { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
- { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
-};
-
-/*
- * The following array contains the number of days in all months
- * up to the month indicated by the index of the second dimension.
- * The first dimension should be 1 for leap years, and 0 otherwise.
- */
-
-const unsigned16 _TOD_Days_to_date[2][13] = {
- { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 },
- { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }
-};
-
-/*
- * The following array contains the number of days in the years
- * since the last leap year. The index should be 0 for leap
- * years, and the number of years since the beginning of a leap
- * year otherwise.
- */
-
-const unsigned16 _TOD_Days_since_last_leap_year[4] = { 0, 366, 731, 1096 };
-
-#else
-
-extern const unsigned16 _TOD_Days_to_date[2][13]; /* Julian days */
-extern const unsigned16 _TOD_Days_since_last_leap_year[4];
-extern const unsigned32 _TOD_Days_per_month[2][13];
-
-#endif
-
-/*
- * _TOD_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _TOD_Handler_initialization(
- unsigned32 microseconds_per_tick
-);
-
-/*
- * _TOD_Set
- *
- * DESCRIPTION:
- *
- * This routine sets the current time of day to THE_TOD and
- * the equivalent SECONDS_SINCE_EPOCH.
- */
-
-void _TOD_Set(
- TOD_Control *the_tod,
- Watchdog_Interval seconds_since_epoch
-);
-
-/*
- * _TOD_Validate
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if THE_TOD contains
- * a valid time of day, and FALSE otherwise.
- */
-
-boolean _TOD_Validate(
- TOD_Control *the_tod
-);
-
-/*
- * _TOD_To_seconds
- *
- * DESCRIPTION:
- *
- * This function returns the number seconds between the epoch and THE_TOD.
- */
-
-Watchdog_Interval _TOD_To_seconds(
- TOD_Control *the_tod
-);
-
-/*
- * _TOD_Tickle
- *
- * DESCRIPTION:
- *
- * This routine is scheduled as a watchdog function and is invoked at
- * each second boundary. It updates the current time of day to indicate
- * that a second has passed and processes the seconds watchdog chain.
- */
-
-void _TOD_Tickle(
- Objects_Id id,
- void *ignored
-);
-
-/*
- * TOD_MILLISECONDS_TO_MICROSECONDS
- *
- * DESCRIPTION:
- *
- * This routine converts an interval expressed in milliseconds to microseconds.
- *
- * NOTE:
- *
- * This must be a macro so it can be used in "static" tables.
- */
-
-#define TOD_MILLISECONDS_TO_MICROSECONDS(_ms) ((_ms) * 1000)
-
-/*
- * TOD_MICROSECONDS_TO_TICKS
- *
- * DESCRIPTION:
- *
- * This routine converts an interval expressed in microseconds to ticks.
- *
- * NOTE:
- *
- * This must be a macro so it can be used in "static" tables.
- */
-
-#define TOD_MICROSECONDS_TO_TICKS(_us) \
- ((_us) / _TOD_Microseconds_per_tick)
-
-/*
- * TOD_MILLISECONDS_TO_TICKS
- *
- * DESCRIPTION:
- *
- * This routine converts an interval expressed in milliseconds to ticks.
- *
- * NOTE:
- *
- * This must be a macro so it can be used in "static" tables.
- */
-
-#define TOD_MILLISECONDS_TO_TICKS(_ms) \
- (TOD_MILLISECONDS_TO_MICROSECONDS(_ms) / _TOD_Microseconds_per_tick)
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/tod.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/tqdata.h b/c/src/exec/score/headers/tqdata.h
deleted file mode 100644
index 6136d35412..0000000000
--- a/c/src/exec/score/headers/tqdata.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* tqdata.h
- *
- * This include file contains all the constants and structures
- * needed to declare a thread queue.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_QUEUE_DATA_h
-#define __THREAD_QUEUE_DATA_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/chain.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/states.h>
-
-/*
- * The following enumerated type details all of the disciplines
- * supported by the Thread Queue Handler.
- */
-
-typedef enum {
- THREAD_QUEUE_DISCIPLINE_FIFO, /* FIFO queue discipline */
- THREAD_QUEUE_DISCIPLINE_PRIORITY /* PRIORITY queue discipline */
-} Thread_queue_Disciplines;
-
-/*
- * The following enumerated types indicate what happened while the thread
- * queue was in the synchronization window.
- */
-
-typedef enum {
- THREAD_QUEUE_SYNCHRONIZED,
- THREAD_QUEUE_NOTHING_HAPPENED,
- THREAD_QUEUE_TIMEOUT,
- THREAD_QUEUE_SATISFIED
-} Thread_queue_States;
-
-/*
- * The following constants are used to manage the priority queues.
- *
- * There are four chains used to maintain a priority -- each chain
- * manages a distinct set of task priorities. The number of chains
- * is determined by TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS.
- * The following set must be consistent.
- *
- * The set below configures 4 headers -- each contains 64 priorities.
- * Header x manages priority range (x*64) through ((x*64)+63). If
- * the priority is more than half way through the priority range it
- * is in, then the search is performed from the rear of the chain.
- * This halves the search time to find the insertion point.
- */
-
-#define TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS 4
-#define TASK_QUEUE_DATA_PRIORITIES_PER_HEADER 64
-#define TASK_QUEUE_DATA_REVERSE_SEARCH_MASK 0x20
-
-typedef struct {
- union {
- Chain_Control Fifo; /* FIFO discipline list */
- Chain_Control Priority[TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS];
- /* priority discipline list */
- } Queues;
- Thread_queue_States sync_state; /* alloc/dealloc critical section */
- Thread_queue_Disciplines discipline; /* queue discipline */
- States_Control state; /* state of threads on Thread_q */
- unsigned32 timeout_status;
-} Thread_queue_Control;
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/tqdata.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/userext.h b/c/src/exec/score/headers/userext.h
deleted file mode 100644
index 29b0e9564e..0000000000
--- a/c/src/exec/score/headers/userext.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/* userext.h
- *
- * This include file contains all information about user extensions. This
- * Handler provides mechanisms which can be used to initialize and manipulate
- * all user extensions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __USER_EXTENSIONS_h
-#define __USER_EXTENSIONS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/interr.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/thread.h>
-
-/*
- * The following records defines the User Extension Table.
- * This table defines the application dependent routines which
- * are invoked at critical points in the life of each thread and
- * the system as a whole.
- */
-
-typedef void User_extensions_routine;
-
-typedef boolean ( *User_extensions_thread_create_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_delete_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_start_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_restart_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_switch_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine (
- *User_extensions_thread_post_switch_extension )(
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_begin_extension )(
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_exitted_extension )(
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_fatal_extension )(
- Internal_errors_Source /* the_source */,
- boolean /* is_internal */,
- unsigned32 /* the_error */
- );
-
-
-typedef struct {
- User_extensions_thread_create_extension thread_create;
- User_extensions_thread_start_extension thread_start;
- User_extensions_thread_restart_extension thread_restart;
- User_extensions_thread_delete_extension thread_delete;
- User_extensions_thread_switch_extension thread_switch;
- User_extensions_thread_begin_extension thread_begin;
- User_extensions_thread_exitted_extension thread_exitted;
- User_extensions_fatal_extension fatal;
-} User_extensions_Table;
-
-/*
- * The following is used to manage each user extension set.
- */
-
-typedef struct {
- Chain_Node Node;
- User_extensions_Table Callouts;
-} User_extensions_Control;
-
-/*
- * The following is used to manage the list of active extensions.
- */
-
-SCORE_EXTERN Chain_Control _User_extensions_List;
-
-/*
- * _User_extensions_Thread_create
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension for
- * the thread creation operate.
- */
-
-boolean _User_extensions_Thread_create (
- Thread_Control *the_thread
-);
-
-/*
- * _User_extensions_Thread_delete
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension for
- * the thread deletion operation.
- */
-
-void _User_extensions_Thread_delete (
- Thread_Control *the_thread
-);
-
-/*
- * _User_extensions_Thread_start
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension for
- * the thread start operation.
- */
-
-void _User_extensions_Thread_start (
- Thread_Control *the_thread
-);
-
-/*
- * _User_extensions_Thread_restart
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension for
- * the thread restart operation.
- */
-
-void _User_extensions_Thread_restart (
- Thread_Control *the_thread
-);
-
-/*
- * _User_extensions_Thread_begin
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension which
- * is invoked when a thread begins.
- */
-
-void _User_extensions_Thread_begin (
- Thread_Control *executing
-);
-
-/*
- * _User_extensions_Thread_exitted
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension which
- * is invoked when a thread exits.
- */
-
-void _User_extensions_Thread_exitted (
- Thread_Control *executing
-);
-
-/*
- * _User_extensions_Fatal
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension invoked
- * when a fatal error occurs.
- */
-
-void _User_extensions_Fatal (
- Internal_errors_Source the_source,
- boolean is_internal,
- unsigned32 the_error
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/userext.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/watchdog.h b/c/src/exec/score/headers/watchdog.h
deleted file mode 100644
index ceb09793f6..0000000000
--- a/c/src/exec/score/headers/watchdog.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/* watchdog.h
- *
- * This include file contains all the constants and structures associated
- * with watchdog timers. This Handler provides mechanisms which can be
- * used to initialize and manipulate watchdog timers.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WATCHDOG_h
-#define __WATCHDOG_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-
-/*
- * The following type defines the control block used to manage
- * intervals.
- */
-
-typedef unsigned32 Watchdog_Interval;
-
-/*
- * The following types define a pointer to a watchdog service routine.
- */
-
-typedef void Watchdog_Service_routine;
-
-typedef Watchdog_Service_routine ( *Watchdog_Service_routine_entry )(
- Objects_Id,
- void *
- );
-
-/*
- * Constant for indefinite wait. (actually an illegal interval)
- */
-
-#define WATCHDOG_NO_TIMEOUT 0
-
-/*
- * The following enumerated type lists the states in which a
- * watchdog timer may be at any given time.
- */
-
-typedef enum {
- WATCHDOG_INACTIVE, /* off all chains */
- WATCHDOG_BEING_INSERTED, /* off all chains, searching for insertion point */
- WATCHDOG_ACTIVE, /* on chain, allowed to fire */
- WATCHDOG_REMOVE_IT /* on chain, remove without firing if expires */
-} Watchdog_States;
-
-/*
- * The following enumerated type details the manner in which
- * a watchdog chain may be adjusted by the Watchdog_Adjust
- * routine. The direction indicates a movement FORWARD
- * or BACKWARD in time.
- */
-
-typedef enum {
- WATCHDOG_FORWARD, /* adjust delta value forward */
- WATCHDOG_BACKWARD /* adjust delta value backward */
-} Watchdog_Adjust_directions;
-
-/*
- * The following record defines the control block used
- * to manage each watchdog timer.
- */
-
-typedef struct {
- Chain_Node Node;
- Watchdog_States state;
- Watchdog_Interval initial;
- Watchdog_Interval delta_interval;
- Watchdog_Interval start_time;
- Watchdog_Interval stop_time;
- Watchdog_Service_routine_entry routine;
- Objects_Id id;
- void *user_data;
-} Watchdog_Control;
-
-/*
- * The following are used for synchronization purposes
- * during an insert on a watchdog delta chain.
- */
-
-SCORE_EXTERN volatile unsigned32 _Watchdog_Sync_level;
-SCORE_EXTERN volatile unsigned32 _Watchdog_Sync_count;
-
-/*
- * The following contains the number of ticks since the
- * system was booted.
- */
-
-SCORE_EXTERN Watchdog_Interval _Watchdog_Ticks_since_boot;
-
-/*
- * The following defines the watchdog chains which are managed
- * on ticks and second boundaries.
- */
-
-SCORE_EXTERN Chain_Control _Watchdog_Ticks_chain;
-SCORE_EXTERN Chain_Control _Watchdog_Seconds_chain;
-
-/*
- * _Watchdog_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the watchdog handler. The watchdog
- * synchronization flag is initialized and the watchdog chains are
- * initialized and emptied.
- */
-
-void _Watchdog_Handler_initialization( void );
-
-/*
- * _Watchdog_Remove
- *
- * DESCRIPTION:
- *
- * This routine removes THE_WATCHDOG from the watchdog chain on which
- * it resides and returns the state THE_WATCHDOG timer was in.
- */
-
-Watchdog_States _Watchdog_Remove (
- Watchdog_Control *the_watchdog
-);
-
-/*
- * _Watchdog_Adjust
- *
- * DESCRIPTION:
- *
- * This routine adjusts the HEADER watchdog chain in the forward
- * or backward DIRECTION for UNITS ticks.
- */
-
-void _Watchdog_Adjust (
- Chain_Control *header,
- Watchdog_Adjust_directions direction,
- Watchdog_Interval units
-);
-
-/*
- * _Watchdog_Insert
- *
- * DESCRIPTION:
- *
- * This routine inserts THE_WATCHDOG into the HEADER watchdog chain
- * for a time of UNITS. The INSERT_MODE indicates whether
- * THE_WATCHDOG is to be activated automatically or later, explicitly
- * by the caller.
- *
- */
-
-void _Watchdog_Insert (
- Chain_Control *header,
- Watchdog_Control *the_watchdog
-);
-
-/*
- * _Watchdog_Tickle
- *
- * DESCRIPTION:
- *
- * This routine is invoked at appropriate intervals to update
- * the HEADER watchdog chain.
- */
-
-void _Watchdog_Tickle (
- Chain_Control *header
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/watchdog.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/headers/wkspace.h b/c/src/exec/score/headers/wkspace.h
deleted file mode 100644
index 3b4b84f95f..0000000000
--- a/c/src/exec/score/headers/wkspace.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* wkspace.h
- *
- * This include file contains information related to the
- * RAM Workspace. This Handler provides mechanisms which can be used to
- * define, initialize and manipulate the workspace.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WORKSPACE_h
-#define __WORKSPACE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/heap.h>
-#include <rtems/score/interr.h>
-
-/*
- * The following is used to manage the Workspace.
- *
- */
-
-SCORE_EXTERN Heap_Control _Workspace_Area; /* executive heap header */
-
-/*
- * _Workspace_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _Workspace_Handler_initialization(
- void *starting_address,
- unsigned32 size
-);
-
-/*
- * _Workspace_Allocate_or_fatal_error
- *
- * DESCRIPTION:
- *
- * This routine returns the address of a block of memory of size
- * bytes. If a block of the appropriate size cannot be allocated
- * from the workspace, then the internal error handler is invoked.
- */
-
-void *_Workspace_Allocate_or_fatal_error(
- unsigned32 size
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/wkspace.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/debug.h b/c/src/exec/score/include/rtems/debug.h
deleted file mode 100644
index 5c83e67d05..0000000000
--- a/c/src/exec/score/include/rtems/debug.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* debug.h
- *
- * This include file contains the information pertaining to the debug
- * support within RTEMS. It is currently cast in the form of a
- * Manager since it is externally accessible.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_DEBUG_h
-#define __RTEMS_DEBUG_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type is used to manage the debug mask.
- */
-
-typedef unsigned32 rtems_debug_control;
-
-/*
- * These constants represent various classes of debugging.
- */
-
-#define RTEMS_DEBUG_ALL_MASK 0xffffffff
-#define RTEMS_DEBUG_REGION 0x00000001
-
-/*
- * This variable contains the current debug level.
- */
-
-SCORE_EXTERN rtems_debug_control _Debug_Level;
-
-/*
- * _Debug_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Debug_Manager_initialization( void );
-
-/*
- * rtems_debug_enable
- *
- * DESCRIPTION:
- *
- * This routine enables the specified types of debug checks.
- */
-
-void rtems_debug_enable (
- rtems_debug_control to_be_enabled
-);
-
-/*
- * rtems_debug_disable
- *
- * DESCRIPTION:
- *
- * This routine disables the specified types of debug checks.
- */
-
-void rtems_debug_disable (
- rtems_debug_control to_be_disabled
-);
-
-/*
- *
- * _Debug_Is_enabled
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the requested debug level is
- * enabled, and FALSE otherwise.
- */
-
-boolean _Debug_Is_enabled(
- rtems_debug_control level
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/Makefile.in b/c/src/exec/score/include/rtems/score/Makefile.in
deleted file mode 100644
index 920e738c03..0000000000
--- a/c/src/exec/score/include/rtems/score/Makefile.in
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# H_FILES that get installed in the rtems/score subdirectoy
-H_PIECES= address apiext bitfield chain context copyrt coremsg coremutex \
- coresem heap interr isr mpci mppkt object objectmp \
- priority stack states sysstate thread threadmp threadq \
- tod tqdata userext watchdog wkspace
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-# H_FILES that get installed in the rtems subdirectoy
-SAPI_H_PIECES=debug system
-SAPI_H_FILES=$(SAPI_H_PIECES:%=$(srcdir)/%.h)
-
-# H_FILES that get installed at the top level
-EXTERNAL_H_PIECES =
-EXTERNAL_H_FILES=$(EXTERNAL_H_PIECES:%=$(srcdir)/%.h)
-
-SRCS=$(H_FILES) $(SAPI_H_FILES) $(EXTERNAL_H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
- $(INSTALL) -m 444 ${SAPI_H_FILES} $(PROJECT_INCLUDE)/rtems/
-# $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
diff --git a/c/src/exec/score/include/rtems/score/address.h b/c/src/exec/score/include/rtems/score/address.h
deleted file mode 100644
index e64cd54931..0000000000
--- a/c/src/exec/score/include/rtems/score/address.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* address.h
- *
- * This include file contains the information required to manipulate
- * physical addresses.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_ADDRESSES_h
-#define __RTEMS_ADDRESSES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/address.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/apiext.h b/c/src/exec/score/include/rtems/score/apiext.h
deleted file mode 100644
index 804b2dea4c..0000000000
--- a/c/src/exec/score/include/rtems/score/apiext.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* apiext.h
- *
- * XXX
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __API_EXTENSIONS_h
-#define __API_EXTENSIONS_h
-
-#include <rtems/score/chain.h>
-#include <rtems/score/thread.h>
-
-/*
- * The control structure which defines the points at which an API
- * can add an extension to the system initialization thread.
- */
-
-typedef void (*API_extensions_Predriver_hook)(void);
-typedef void (*API_extensions_Postdriver_hook)(void);
-typedef void (*API_extensions_Postswitch_hook)(
- Thread_Control *
- );
-
-
-typedef struct {
- Chain_Node Node;
- API_extensions_Predriver_hook predriver_hook;
- API_extensions_Postdriver_hook postdriver_hook;
- API_extensions_Postswitch_hook postswitch_hook;
-} API_extensions_Control;
-
-/*
- * This is the list of API extensions to the system initialization.
- */
-
-SCORE_EXTERN Chain_Control _API_extensions_List;
-
-/*
- * _API_extensions_Initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the API extension handler.
- *
- */
-
-void _API_extensions_Initialization( void );
-
-/*
- * _API_extensions_Add
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _API_extensions_Add(
- API_extensions_Control *the_extension
-);
-
-/*
- * _API_extensions_Run_predriver
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _API_extensions_Run_predriver( void );
-
-/*
- * _API_extensions_Run_postdriver
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _API_extensions_Run_postdriver( void );
-
-/*
- * _API_extensions_Run_postswitch
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _API_extensions_Run_postswitch( void );
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/bitfield.h b/c/src/exec/score/include/rtems/score/bitfield.h
deleted file mode 100644
index bbced47652..0000000000
--- a/c/src/exec/score/include/rtems/score/bitfield.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* bitfield.h
- *
- * This include file contains all bit field manipulation routines.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_BITFIELD_h
-#define __RTEMS_BITFIELD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * _Bitfield_Find_first_bit
- *
- * DESCRIPTION:
- *
- * This routine returns the bit_number of the first bit set
- * in the specified value. The correspondence between bit_number
- * and actual bit position is processor dependent. The search for
- * the first bit set may run from most to least significant bit
- * or vice-versa.
- *
- * NOTE:
- *
- * This routine is used when the executing thread is removed
- * from the ready state and, as a result, its performance has a
- * significant impact on the performance of the executive as a whole.
- */
-
-#if ( CPU_USE_GENERIC_BITFIELD_DATA == TRUE )
-
-#ifndef SCORE_INIT
-extern const unsigned char __log2table[256];
-#else
-const unsigned char __log2table[256] = {
- 7, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 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,
- 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, 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, 0, 0
-};
-#endif
-
-#endif
-
-#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE )
-
-#define _Bitfield_Find_first_bit( _value, _bit_number ) \
- _CPU_Bitfield_Find_first_bit( _value, _bit_number )
-
-#else
-
-/*
- * The following must be a macro because if a CPU specific version
- * is used it will most likely use inline assembly.
- */
-
-#define _Bitfield_Find_first_bit( _value, _bit_number ) \
- { \
- register unsigned32 __value = (unsigned32) (_value); \
- register const unsigned char *__p = __log2table; \
- \
- if ( __value < 0x100 ) \
- (_bit_number) = __p[ __value ] + 8; \
- else \
- (_bit_number) = __p[ __value >> 8 ]; \
- }
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/chain.h b/c/src/exec/score/include/rtems/score/chain.h
deleted file mode 100644
index 910f5e4414..0000000000
--- a/c/src/exec/score/include/rtems/score/chain.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/* chain.h
- *
- * This include file contains all the constants and structures associated
- * with the Doubly Linked Chain Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CHAIN_h
-#define __RTEMS_CHAIN_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/address.h>
-
-/*
- * This is used to manage each element (node) which is placed
- * on a chain.
- *
- * NOTE: Typically, a more complicated structure will use the
- * chain package. The more complicated structure will
- * include a chain node as the first element in its
- * control structure. It will then call the chain package
- * with a pointer to that node element. The node pointer
- * and the higher level structure start at the same address
- * so the user can cast the pointers back and forth.
- *
- */
-
-typedef struct Chain_Node_struct Chain_Node;
-
-struct Chain_Node_struct {
- Chain_Node *next;
- Chain_Node *previous;
-};
-
-/*
- * This is used to manage a chain. A chain consists of a doubly
- * linked list of zero or more nodes.
- *
- * NOTE: This implementation does not require special checks for
- * manipulating the first and last elements on the chain.
- * To accomplish this the chain control structure is
- * treated as two overlapping chain nodes. The permanent
- * head of the chain overlays a node structure on the
- * first and permanent_null fields. The permanent tail
- * of the chain overlays a node structure on the
- * permanent_null and last elements of the structure.
- *
- */
-
-typedef struct {
- Chain_Node *first;
- Chain_Node *permanent_null;
- Chain_Node *last;
-} Chain_Control;
-
-/*
- * _Chain_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the_chain structure to manage the
- * contiguous array of number_nodes nodes which starts at
- * starting_address. Each node is of node_size bytes.
- *
- */
-
-void _Chain_Initialize(
- Chain_Control *the_chain,
- void *starting_address,
- unsigned32 number_nodes,
- unsigned32 node_size
-);
-
-/*
- * _Chain_Get_first_unprotected
- */
-
-#ifndef USE_INLINES
-Chain_Node *_Chain_Get_first_unprotected(
- Chain_Control *the_chain
-);
-#endif
-
-/*
- * _Chain_Extract
- *
- * DESCRIPTION:
- *
- * This routine extracts the_node from the chain on which it resides.
- * It disables interrupts to insure the atomicity of the
- * extract operation.
- *
- */
-
-void _Chain_Extract(
- Chain_Node *the_node
-);
-
-/*
- * _Chain_Get
- *
- * DESCRIPTION:
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. If the_chain is empty, then NULL is returned.
- * It disables interrupts to insure the atomicity of the
- * get operation.
- *
- */
-
-Chain_Node *_Chain_Get(
- Chain_Control *the_chain
-);
-
-/*
- * _Chain_Insert
- *
- * DESCRIPTION:
- *
- * This routine inserts the_node on a chain immediately following
- * after_node. It disables interrupts to insure the atomicity
- * of the extract operation.
- *
- */
-
-void _Chain_Insert(
- Chain_Node *after_node,
- Chain_Node *the_node
-);
-
-/*
- * _Chain_Append
- *
- * DESCRIPTION:
- *
- * This routine appends the_node onto the end of the_chain.
- * It disables interrupts to insure the atomicity of the
- * append operation.
- *
- */
-
-void _Chain_Append(
- Chain_Control *the_chain,
- Chain_Node *the_node
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/chain.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/context.h b/c/src/exec/score/include/rtems/score/context.h
deleted file mode 100644
index 5a22fd4b6d..0000000000
--- a/c/src/exec/score/include/rtems/score/context.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/* context.h
- *
- * This include file contains all information about a context.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CONTEXT_h
-#define __RTEMS_CONTEXT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/cpu.h>
-
-/*
- * The following constant defines the number of bytes required
- * to store a full floating point context.
- */
-
-#define CONTEXT_FP_SIZE CPU_CONTEXT_FP_SIZE
-
-/*
- * The following variable is set to TRUE when a reschedule operation
- * has determined that the processor should be taken away from the
- * currently executing thread and given to the heir thread.
- */
-
-SCORE_EXTERN volatile boolean _Context_Switch_necessary;
-
-/*
- * _Context_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes THE_CONTEXT such that the stack
- * pointer, interrupt level, and entry point are correct for the
- * thread's initial state.
- */
-
-#define \
- _Context_Initialize( _the_context, _stack, _size, _isr, _entry, _is_fp ) \
- _CPU_Context_Initialize( _the_context, _stack, _size, _isr, _entry, _is_fp )
-
-/*
- * _Context_Switch
- *
- * DESCRIPTION:
- *
- * This routine saves the current context into the EXECUTING
- * context record and restores the context specified by HEIR.
- */
-
-#define _Context_Switch( _executing, _heir ) \
- _CPU_Context_switch( _executing, _heir )
-
-/*
- * _Context_Restart_self
- *
- * DESCRIPTION:
- *
- * This routine restarts the calling thread by restoring its initial
- * stack pointer and returning to the thread's entry point.
- */
-
-#define _Context_Restart_self( _the_context ) \
- _CPU_Context_Restart_self( _the_context )
-
-/*
- * _Context_Fp_start
- *
- * DESCRIPTION:
- *
- * This function returns the starting address of the floating
- * point context save area. It is assumed that the are reserved
- * for the floating point save area is large enough.
- */
-
-#define _Context_Fp_start( _base, _offset ) \
- _CPU_Context_Fp_start( (_base), (_offset) )
-
-/*
- * _Context_Initialize_fp
- *
- * DESCRIPTION:
- *
- * This routine initializes the floating point context save
- * area to contain an initial known state.
- */
-
-#define _Context_Initialize_fp( _fp_area ) \
- _CPU_Context_Initialize_fp( _fp_area )
-
-/*
- * _Context_Restore_fp
- *
- * DESCRIPTION:
- *
- * This routine restores the floating point context contained
- * in the FP_CONTEXT area. It is assumed that the current
- * floating point context has been saved by a previous invocation
- * of SAVE_FP.
- */
-
-#define _Context_Restore_fp( _fp ) \
- _CPU_Context_restore_fp( _fp )
-
-/*
- * _Context_Save_fp
- *
- * DESCRIPTION:
- *
- * This routine saves the current floating point context
- * in the FP_CONTEXT area.
- */
-
-#define _Context_Save_fp( _fp ) \
- _CPU_Context_save_fp( _fp )
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/copyrt.h b/c/src/exec/score/include/rtems/score/copyrt.h
deleted file mode 100644
index 3a9a5a5c60..0000000000
--- a/c/src/exec/score/include/rtems/score/copyrt.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* copyrt.h
- *
- * This include file contains the copyright notice for RTEMS
- * which is included in every binary copy of the executive.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_COPYRIGHT_h
-#define __RTEMS_COPYRIGHT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef SCORE_INIT
-
-const char _Copyright_Notice[] =
-"COPYRIGHT (c) 1989-1998.\n\
-On-Line Applications Research Corporation (OAR).\n\
-Copyright assigned to U.S. Government, 1994.\n";
-
-#else
-
-extern const char _Copyright_Notice[];
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/coremsg.h b/c/src/exec/score/include/rtems/score/coremsg.h
deleted file mode 100644
index 03277e12b7..0000000000
--- a/c/src/exec/score/include/rtems/score/coremsg.h
+++ /dev/null
@@ -1,267 +0,0 @@
-/* coremsg.h
- *
- * This include file contains all the constants and structures associated
- * with the Message queue Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CORE_MESSAGE_QUEUE_h
-#define __RTEMS_CORE_MESSAGE_QUEUE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following type defines the callout which the API provides
- * to support global/multiprocessor operations on message_queues.
- */
-
-typedef void ( *CORE_message_queue_API_mp_support_callout )(
- Thread_Control *,
- Objects_Id
- );
-
-/*
- * The following defines the data types needed to manipulate
- * the contents of message buffers.
- *
- * NOTE: The buffer field is normally longer than a single unsigned32.
- * but since messages are variable length we just make a ptr to 1.
- */
-
-typedef struct {
- unsigned32 size;
- unsigned32 buffer[1];
-} CORE_message_queue_Buffer;
-
-/*
- * The following records define the organization of a message
- * buffer.
- */
-
-typedef struct {
- Chain_Node Node;
- CORE_message_queue_Buffer Contents;
-} CORE_message_queue_Buffer_control;
-
-/*
- * Blocking disciplines for a message_queue.
- */
-
-typedef enum {
- CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO,
- CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY
-} CORE_message_queue_Disciplines;
-
-/*
- * The following enumerated type details the modes in which a message
- * may be submitted to a message queue. The message may be posted
- * in a send or urgent fashion.
- */
-
-typedef enum {
- CORE_MESSAGE_QUEUE_SEND_REQUEST = 0,
- CORE_MESSAGE_QUEUE_URGENT_REQUEST = 1
-} CORE_message_queue_Submit_types;
-
-/*
- * Core Message queue handler return statuses.
- */
-
-typedef enum {
- CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL,
- CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE,
- CORE_MESSAGE_QUEUE_STATUS_TOO_MANY,
- CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED,
- CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT,
- CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED,
- CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
-} CORE_message_queue_Status;
-
-/*
- * The following defines the control block used to manage the
- * attributes of each message queue.
- */
-
-typedef struct {
- CORE_message_queue_Disciplines discipline;
-} CORE_message_queue_Attributes;
-
-/*
- * The following defines the type for a Notification handler. A notification
- * handler is invoked when the message queue makes a 0->1 transition on
- * pending messages.
- */
-
-typedef void (*CORE_message_queue_Notify_Handler)( void * );
-
-/*
- * The following defines the control block used to manage each
- * counting message_queue.
- */
-
-typedef struct {
- Thread_queue_Control Wait_queue;
- CORE_message_queue_Attributes Attributes;
- unsigned32 maximum_pending_messages;
- unsigned32 number_of_pending_messages;
- unsigned32 maximum_message_size;
- Chain_Control Pending_messages;
- CORE_message_queue_Buffer *message_buffers;
- CORE_message_queue_Notify_Handler notify_handler;
- void *notify_argument;
- Chain_Control Inactive_messages;
-} CORE_message_queue_Control;
-
-/*
- * _CORE_message_queue_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the message_queue based on the parameters passed.
- */
-
-boolean _CORE_message_queue_Initialize(
- CORE_message_queue_Control *the_message_queue,
- Objects_Classes the_class,
- CORE_message_queue_Attributes *the_message_queue_attributes,
- unsigned32 maximum_pending_messages,
- unsigned32 maximum_message_size,
- Thread_queue_Extract_callout proxy_extract_callout
-);
-
-/*
- * _CORE_message_queue_Close
- *
- * DESCRIPTION:
- *
- * This function closes a message by returning all allocated space and
- * flushing the message_queue's task wait queue.
- */
-
-void _CORE_message_queue_Close(
- CORE_message_queue_Control *the_message_queue,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-);
-
-/*
- *
- * _CORE_message_queue_Flush
- *
- * DESCRIPTION:
- *
- * This function flushes the message_queue's task wait queue. The number
- * messages flushed from the queue is returned.
- *
- */
-
-unsigned32 _CORE_message_queue_Flush(
- CORE_message_queue_Control *the_message_queue
-);
-
-/*
- * _CORE_message_queue_Flush_support
- *
- * DESCRIPTION:
- *
- * This routine flushes all outstanding messages and returns
- * them to the inactive message chain.
- */
-
-unsigned32 _CORE_message_queue_Flush_support(
- CORE_message_queue_Control *the_message_queue
-);
-
-/*
- *
- * _CORE_message_queue_Broadcast
- *
- * DESCRIPTION:
- *
- * This function sends a message for every thread waiting on the queue and
- * returns the number of threads made ready by the message.
- *
- */
-
-CORE_message_queue_Status _CORE_message_queue_Broadcast(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support,
- unsigned32 *count
-);
-
-/*
- *
- * _CORE_message_queue_Submit
- *
- * DESCRIPTION:
- *
- * This routine implements the send and urgent message functions. It
- * processes a message that is to be submitted to the designated
- * message queue. The message will either be processed as a
- * send message which it will be inserted at the rear of the queue
- * or it will be processed as an urgent message which will be inserted
- * at the front of the queue.
- *
- */
-
-CORE_message_queue_Status _CORE_message_queue_Submit(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support,
- CORE_message_queue_Submit_types submit_type
-);
-
-/*
- *
- * _CORE_message_queue_Seize
- *
- * DESCRIPTION:
- *
- * This kernel routine dequeues a message, copies the message buffer to
- * a given destination buffer, and frees the message buffer to the
- * inactive message pool. The thread will be blocked if wait is TRUE,
- * otherwise an error will be given to the thread if no messages are available.
- *
- */
-
-void _CORE_message_queue_Seize(
- CORE_message_queue_Control *the_message_queue,
- Objects_Id id,
- void *buffer,
- unsigned32 *size,
- boolean wait,
- Watchdog_Interval timeout
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/coremsg.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/score/include/rtems/score/coremutex.h b/c/src/exec/score/include/rtems/score/coremutex.h
deleted file mode 100644
index 7145e4f19f..0000000000
--- a/c/src/exec/score/include/rtems/score/coremutex.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/* mutex.h
- *
- * This include file contains all the constants and structures associated
- * with the Mutex Handler. A mutex is an enhanced version of the standard
- * Dijkstra binary semaphore used to provide synchronization and mutual
- * exclusion capabilities.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CORE_MUTEX_h
-#define __RTEMS_CORE_MUTEX_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following type defines the callout which the API provides
- * to support global/multiprocessor operations on mutexes.
- */
-
-typedef void ( *CORE_mutex_API_mp_support_callout )(
- Thread_Control *,
- Objects_Id
- );
-
-/*
- * Blocking disciplines for a mutex.
- */
-
-typedef enum {
- CORE_MUTEX_DISCIPLINES_FIFO,
- CORE_MUTEX_DISCIPLINES_PRIORITY,
- CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT,
- CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING
-} CORE_mutex_Disciplines;
-
-/*
- * Mutex handler return statuses.
- */
-
-typedef enum {
- CORE_MUTEX_STATUS_SUCCESSFUL,
- CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT,
- CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED,
- CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE,
- CORE_MUTEX_WAS_DELETED,
- CORE_MUTEX_TIMEOUT,
- CORE_MUTEX_STATUS_CEILING_VIOLATED
-} CORE_mutex_Status;
-
-/*
- * Locked and unlocked values
- */
-
-#define CORE_MUTEX_UNLOCKED 1
-#define CORE_MUTEX_LOCKED 0
-
-/*
- * The following defines the control block used to manage the
- * attributes of each mutex.
- */
-
-typedef struct {
- boolean allow_nesting;
- CORE_mutex_Disciplines discipline;
- Priority_Control priority_ceiling;
-} CORE_mutex_Attributes;
-
-/*
- * The following defines the control block used to manage each mutex.
- */
-
-typedef struct {
- Thread_queue_Control Wait_queue;
- CORE_mutex_Attributes Attributes;
- unsigned32 lock;
- unsigned32 nest_count;
- Thread_Control *holder;
- Objects_Id holder_id;
-} CORE_mutex_Control;
-
-/*
- * _CORE_mutex_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the mutex based on the parameters passed.
- */
-
-void _CORE_mutex_Initialize(
- CORE_mutex_Control *the_mutex,
- Objects_Classes the_class,
- CORE_mutex_Attributes *the_mutex_attributes,
- unsigned32 initial_lock,
- Thread_queue_Extract_callout proxy_extract_callout
-);
-
-/*
- * _CORE_mutex_Seize
- *
- * DESCRIPTION:
- *
- * This routine attempts to receive a unit from the_mutex.
- * If a unit is available or if the wait flag is FALSE, then the routine
- * returns. Otherwise, the calling task is blocked until a unit becomes
- * available.
- */
-
-void _CORE_mutex_Seize(
- CORE_mutex_Control *the_mutex,
- Objects_Id id,
- boolean wait,
- Watchdog_Interval timeout
-);
-
-/*
- * _CORE_mutex_Surrender
- *
- * DESCRIPTION:
- *
- * This routine frees a unit to the mutex. If a task was blocked waiting for
- * a unit from this mutex, then that task will be readied and the unit
- * given to that task. Otherwise, the unit will be returned to the mutex.
- */
-
-CORE_mutex_Status _CORE_mutex_Surrender(
- CORE_mutex_Control *the_mutex,
- Objects_Id id,
- CORE_mutex_API_mp_support_callout api_mutex_mp_support
-);
-
-/*
- * _CORE_mutex_Flush
- *
- * DESCRIPTION:
- *
- * This routine assists in the deletion of a mutex by flushing the associated
- * wait queue.
- */
-
-void _CORE_mutex_Flush(
- CORE_mutex_Control *the_mutex,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/coremutex.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/score/include/rtems/score/coresem.h b/c/src/exec/score/include/rtems/score/coresem.h
deleted file mode 100644
index 2ef1371e8d..0000000000
--- a/c/src/exec/score/include/rtems/score/coresem.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/* core_sem.h
- *
- * This include file contains all the constants and structures associated
- * with the Counting Semaphore Handler. A counting semaphore is the
- * standard Dijkstra binary semaphore used to provide synchronization
- * and mutual exclusion capabilities.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CORE_COUNTING_SEMAPHORE_h
-#define __RTEMS_CORE_COUNTING_SEMAPHORE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following type defines the callout which the API provides
- * to support global/multiprocessor operations on semaphores.
- */
-
-typedef void ( *CORE_semaphore_API_mp_support_callout )(
- Thread_Control *,
- Objects_Id
- );
-
-/*
- * Blocking disciplines for a semaphore.
- */
-
-typedef enum {
- CORE_SEMAPHORE_DISCIPLINES_FIFO,
- CORE_SEMAPHORE_DISCIPLINES_PRIORITY
-} CORE_semaphore_Disciplines;
-
-/*
- * Core Semaphore handler return statuses.
- */
-
-typedef enum {
- CORE_SEMAPHORE_STATUS_SUCCESSFUL,
- CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT,
- CORE_SEMAPHORE_WAS_DELETED,
- CORE_SEMAPHORE_TIMEOUT
-} CORE_semaphore_Status;
-
-/*
- * The following defines the control block used to manage the
- * attributes of each semaphore.
- */
-
-typedef struct {
- CORE_semaphore_Disciplines discipline;
-} CORE_semaphore_Attributes;
-
-/*
- * The following defines the control block used to manage each
- * counting semaphore.
- */
-
-typedef struct {
- Thread_queue_Control Wait_queue;
- CORE_semaphore_Attributes Attributes;
- unsigned32 count;
-} CORE_semaphore_Control;
-
-/*
- * _CORE_semaphore_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the semaphore based on the parameters passed.
- */
-
-void _CORE_semaphore_Initialize(
- CORE_semaphore_Control *the_semaphore,
- Objects_Classes the_class,
- CORE_semaphore_Attributes *the_semaphore_attributes,
- unsigned32 initial_value,
- Thread_queue_Extract_callout proxy_extract_callout
-);
-
-/*
- * _CORE_semaphore_Seize
- *
- * DESCRIPTION:
- *
- * This routine attempts to receive a unit from the_semaphore.
- * If a unit is available or if the wait flag is FALSE, then the routine
- * returns. Otherwise, the calling task is blocked until a unit becomes
- * available.
- */
-
-void _CORE_semaphore_Seize(
- CORE_semaphore_Control *the_semaphore,
- Objects_Id id,
- boolean wait,
- Watchdog_Interval timeout
-);
-
-/*
- * _CORE_semaphore_Surrender
- *
- * DESCRIPTION:
- *
- * This routine frees a unit to the semaphore. If a task was blocked waiting
- * for a unit from this semaphore, then that task will be readied and the unit
- * given to that task. Otherwise, the unit will be returned to the semaphore.
- */
-
-CORE_semaphore_Status _CORE_semaphore_Surrender(
- CORE_semaphore_Control *the_semaphore,
- Objects_Id id,
- CORE_semaphore_API_mp_support_callout api_semaphore_mp_support
-);
-
-/*
- * _CORE_semaphore_Flush
- *
- * DESCRIPTION:
- *
- * This routine assists in the deletion of a semaphore by flushing the
- * associated wait queue.
- */
-
-void _CORE_semaphore_Flush(
- CORE_semaphore_Control *the_semaphore,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/coresem.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/exec/score/include/rtems/score/heap.h b/c/src/exec/score/include/rtems/score/heap.h
deleted file mode 100644
index eaee7cde3f..0000000000
--- a/c/src/exec/score/include/rtems/score/heap.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/* heap.h
- *
- * This include file contains the information pertaining to the Heap
- * Handler. A heap is a doubly linked list of variable size
- * blocks which are allocated using the first fit method. Garbage
- * collection is performed each time a block is returned to the heap by
- * coalescing neighbor blocks. Control information for both allocated
- * and unallocated blocks is contained in the heap space. A heap header
- * contains control information for the heap.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_HEAP_h
-#define __RTEMS_HEAP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Status codes for heap_extend
- */
-
-typedef enum {
- HEAP_EXTEND_SUCCESSFUL,
- HEAP_EXTEND_ERROR,
- HEAP_EXTEND_NOT_IMPLEMENTED
-} Heap_Extend_status;
-
-/*
- * Constants used in the size/used field of each heap block to
- * indicate when a block is free or in use.
- */
-
-#define HEAP_BLOCK_USED 1 /* indicates block is in use */
-#define HEAP_BLOCK_FREE 0 /* indicates block is free */
-
-/*
- * The size/used field value for the dummy front and back flags.
- */
-
-#define HEAP_DUMMY_FLAG (0 + HEAP_BLOCK_USED)
-
-/*
- * The following constants reflect various requirements of the
- * heap data structures which impact the management of a heap.
- *
- * NOTE: Because free block overhead is greater than used block
- * overhead AND a portion of the allocated space is from
- * the extra free block overhead, the absolute lower bound
- * of the minimum fragment size is equal to the size of
- * the free block overhead.
- */
-
-#define HEAP_OVERHEAD \
- (sizeof( unsigned32 ) * 2) /* size dummy first and last blocks */
-#define HEAP_BLOCK_USED_OVERHEAD \
- (sizeof( void * ) * 2) /* num bytes overhead in used block */
-#define HEAP_MINIMUM_SIZE \
- (HEAP_OVERHEAD + sizeof (Heap_Block))
- /* min number of bytes the user may */
- /* specify for the heap size */
-
-/*
- * The following defines the data structure used to manage
- * individual blocks in a heap. When the block is allocated, the
- * next and previous fields are not used by the Heap Handler
- * and thus the address returned for the block starts at
- * the address of the next field.
- *
- * NOTE: The next and previous pointers are only valid when the
- * block is free. Caution must be exercised to insure that
- * allocated blocks are large enough to contain them and
- * that they are not accidentally overwritten when the
- * block is actually allocated.
- */
-
-typedef struct Heap_Block_struct Heap_Block;
-
-struct Heap_Block_struct {
- unsigned32 back_flag; /* size and status of prev block */
- unsigned32 front_flag; /* size and status of block */
- Heap_Block *next; /* pointer to next block */
- Heap_Block *previous; /* pointer to previous block */
-};
-
-/*
- * The following defines the control block used to manage each heap.
- *
- * NOTE:
- *
- * This structure is layed out such that it can be used a a dummy
- * first and last block on the free block chain. The extra padding
- * insures the dummy last block is the correct size.
- *
- * The first Heap_Block starts at first while the second starts at
- * final. This is effectively the same trick as is used in the Chain
- * Handler.
- */
-
-typedef struct {
- Heap_Block *start; /* first valid block address in heap */
- Heap_Block *final; /* last valid block address in heap */
-
- Heap_Block *first; /* pointer to first block in heap */
- Heap_Block *permanent_null; /* always NULL pointer */
- Heap_Block *last; /* pointer to last block in heap */
- unsigned32 page_size; /* allocation unit */
- unsigned32 reserved;
-} Heap_Control;
-
-/*
- * _Heap_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the_heap record to manage the
- * contiguous heap of size bytes which starts at starting_address.
- * Blocks of memory are allocated from the heap in multiples of
- * page_size byte units.
- */
-
-unsigned32 _Heap_Initialize(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 size,
- unsigned32 page_size
-);
-
-/*
- * _Heap_Extend
- *
- * DESCRIPTION:
- *
- * This routine grows the_heap memory area using the size bytes which
- * begin at starting_address.
- */
-
-Heap_Extend_status _Heap_Extend(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 size,
- unsigned32 *amount_extended
-);
-
-/*
- * _Heap_Allocate
- *
- * DESCRIPTION:
- *
- * DESCRIPTION:
- *
- * This function attempts to allocate a block of size bytes from
- * the_heap. If insufficient memory is free in the_heap to allocate
- * a block of the requested size, then NULL is returned.
- */
-
-void *_Heap_Allocate(
- Heap_Control *the_heap,
- unsigned32 size
-);
-
-/*
- * _Heap_Size_of_user_area
- *
- * DESCRIPTION:
- *
- * This kernel routine sets size to the size of the given heap block.
- * It returns TRUE if the starting_address is in the heap, and FALSE
- * otherwise.
- */
-
-boolean _Heap_Size_of_user_area(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 *size
-);
-
-/*
- * _Heap_Free
- *
- * DESCRIPTION:
- *
- * This routine returns the block of memory which begins
- * at starting_address to the_heap. Any coalescing which is
- * possible with the freeing of this routine is performed.
- */
-
-boolean _Heap_Free(
- Heap_Control *the_heap,
- void *start_address
-);
-
-/*
- * _Heap_Walk
- *
- * DESCRIPTION:
- *
- * This routine walks the heap to verify its integrity.
- */
-
-void _Heap_Walk(
- Heap_Control *the_heap,
- int source,
- boolean do_dump
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/heap.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/interr.h b/c/src/exec/score/include/rtems/score/interr.h
deleted file mode 100644
index e999ceff7a..0000000000
--- a/c/src/exec/score/include/rtems/score/interr.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* interr.h
- *
- * This include file contains constants and prototypes related
- * to the Internal Error Handler.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_INTERNAL_ERROR_h
-#define __RTEMS_INTERNAL_ERROR_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This type lists the possible sources from which an error
- * can be reported.
- */
-
-typedef enum {
- INTERNAL_ERROR_CORE,
- INTERNAL_ERROR_RTEMS_API,
- INTERNAL_ERROR_POSIX_API
-} Internal_errors_Source;
-
-/*
- * A list of errors which are generated internally by the executive core.
- */
-
-typedef enum {
- INTERNAL_ERROR_NO_CONFIGURATION_TABLE,
- INTERNAL_ERROR_NO_CPU_TABLE,
- INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS,
- INTERNAL_ERROR_TOO_LITTLE_WORKSPACE,
- INTERNAL_ERROR_WORKSPACE_ALLOCATION,
- INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL,
- INTERNAL_ERROR_THREAD_EXITTED,
- INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION,
- INTERNAL_ERROR_INVALID_NODE,
- INTERNAL_ERROR_NO_MPCI,
- INTERNAL_ERROR_BAD_PACKET,
- INTERNAL_ERROR_OUT_OF_PACKETS,
- INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS,
- INTERNAL_ERROR_OUT_OF_PROXIES,
- INTERNAL_ERROR_INVALID_GLOBAL_ID,
- INTERNAL_ERROR_BAD_STACK_HOOK
-} Internal_errors_Core_list;
-
-/*
- * This type holds the fatal error information.
- */
-
-typedef struct {
- Internal_errors_Source the_source;
- boolean is_internal;
- unsigned32 the_error;
-} Internal_errors_Information;
-
-/*
- * When a fatal error occurs, the error information is stored here.
- */
-
-SCORE_EXTERN Internal_errors_Information Internal_errors_What_happened;
-
-/*
- * _Internal_error_Occurred
- *
- * DESCRIPTION:
- *
- * This routine is invoked when the application or the executive itself
- * determines that a fatal error has occurred.
- */
-
-void volatile _Internal_error_Occurred(
- Internal_errors_Source the_source,
- boolean is_internal,
- unsigned32 the_error
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/isr.h b/c/src/exec/score/include/rtems/score/isr.h
deleted file mode 100644
index 97ffe7f2ec..0000000000
--- a/c/src/exec/score/include/rtems/score/isr.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/* isr.h
- *
- * This include file contains all the constants and structures associated
- * with the management of processor interrupt levels. This handler
- * supports interrupt critical sections, vectoring of user interrupt
- * handlers, nesting of interrupts, and manipulating interrupt levels.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __ISR_h
-#define __ISR_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type defines the control block used to manage
- * the interrupt level portion of the status register.
- */
-
-typedef unsigned32 ISR_Level;
-
-/*
- * The following type defines the type used to manage the vectors.
- */
-
-typedef unsigned32 ISR_Vector_number;
-
-/*
- * Return type for ISR Handler
- */
-
-typedef void ISR_Handler;
-
-/*
- * Pointer to an ISR Handler
- */
-
-#if (CPU_ISR_PASSES_FRAME_POINTER == 1)
-typedef ISR_Handler ( *ISR_Handler_entry )(
- ISR_Vector_number,
- CPU_Interrupt_frame *
- );
-#else
-typedef ISR_Handler ( *ISR_Handler_entry )(
- ISR_Vector_number
- );
-#endif
-/*
- * This constant promotes out the number of vectors truly supported by
- * the current CPU being used. This is usually the number of distinct vectors
- * the cpu can vector.
- */
-
-#define ISR_NUMBER_OF_VECTORS CPU_INTERRUPT_NUMBER_OF_VECTORS
-
-/*
- * This constant promotes out the highest valid interrupt vector number.
- */
-
-#define ISR_INTERRUPT_MAXIMUM_VECTOR_NUMBER CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER
-
-/*
- * The following is TRUE if signals have been sent to the currently
- * executing thread by an ISR handler.
- */
-
-SCORE_EXTERN boolean _ISR_Signals_to_thread_executing;
-
-/*
- * The following contains the interrupt service routine nest level.
- * When this variable is zero, a thread is executing.
- */
-
-SCORE_EXTERN unsigned32 _ISR_Nest_level;
-
-/*
- * The following declares the Vector Table. Application
- * interrupt service routines are vectored by the ISR Handler via this table.
- */
-
-SCORE_EXTERN ISR_Handler_entry _ISR_Vector_table[ ISR_NUMBER_OF_VECTORS ];
-
-/*
- * _ISR_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _ISR_Handler_initialization ( void );
-
-/*
- * _ISR_Disable
- *
- * DESCRIPTION:
- *
- * This routine disables all interrupts so that a critical section
- * of code can be executing without being interrupted. Upon return,
- * the argument _level will contain the previous interrupt mask level.
- */
-
-#define _ISR_Disable( _level ) \
- _CPU_ISR_Disable( _level )
-
-/*
- * _ISR_Enable
- *
- * DESCRIPTION:
- *
- * This routine enables interrupts to the previous interrupt mask
- * LEVEL. It is used at the end of a critical section of code to
- * enable interrupts so they can be processed again.
- */
-
-#define _ISR_Enable( _level ) \
- _CPU_ISR_Enable( _level )
-
-/*
- * _ISR_Flash
- *
- * DESCRIPTION:
- *
- * This routine temporarily enables interrupts to the previous
- * interrupt mask level and then disables all interrupts so that
- * the caller can continue into the second part of a critical
- * section. This routine is used to temporarily enable interrupts
- * during a long critical section. It is used in long sections of
- * critical code when a point is reached at which interrupts can
- * be temporarily enabled. Deciding where to flash interrupts
- * in a long critical section is often difficult and the point
- * must be selected with care to insure that the critical section
- * properly protects itself.
- */
-
-#define _ISR_Flash( _level ) \
- _CPU_ISR_Flash( _level )
-
-/*
- * _ISR_Install_vector
- *
- * DESCRIPTION:
- *
- * This routine installs new_handler as the interrupt service routine
- * for the specified vector. The previous interrupt service routine is
- * returned as old_handler.
- */
-
-#define _ISR_Install_vector( _vector, _new_handler, _old_handler ) \
- _CPU_ISR_install_vector( _vector, _new_handler, _old_handler )
-
-/*
- * _ISR_Get_level
- *
- * DESCRIPTION:
- *
- * This routine returns the current interrupt level.
- */
-
-#define _ISR_Get_level() \
- _CPU_ISR_Get_level()
-
-/*
- * _ISR_Set_level
- *
- * DESCRIPTION:
- *
- * This routine sets the current interrupt level to that specified
- * by new_level. The new interrupt level is effective when the
- * routine exits.
- */
-
-#define _ISR_Set_level( _new_level ) \
- _CPU_ISR_Set_level( _new_level )
-
-/*
- * _ISR_Handler
- *
- * DESCRIPTION:
- *
- * This routine is the interrupt dispatcher. ALL interrupts
- * are vectored to this routine so that minimal context can be saved
- * and setup performed before the application's high-level language
- * interrupt service routine is invoked. After the application's
- * interrupt service routine returns control to this routine, it
- * will determine if a thread dispatch is necessary. If so, it will
- * insure that the necessary thread scheduling operations are
- * performed when the outermost interrupt service routine exits.
- *
- * NOTE: Implemented in assembly language.
- */
-
-void _ISR_Handler( void );
-
-/*
- * _ISR_Dispatch
- *
- * DESCRIPTION:
- *
- * This routine provides a wrapper so that the routine
- * _Thread_Dispatch can be invoked when a reschedule is necessary
- * at the end of the outermost interrupt service routine. This
- * wrapper is necessary to establish the processor context needed
- * by _Thread_Dispatch and to save the processor context which is
- * corrupted by _Thread_Dispatch. This context typically consists
- * of registers which are not preserved across routine invocations.
- *
- * NOTE: Implemented in assembly language.
- */
-
-void _ISR_Dispatch( void );
-
-#include <rtems/score/isr.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/mpci.h b/c/src/exec/score/include/rtems/score/mpci.h
deleted file mode 100644
index 4475021eca..0000000000
--- a/c/src/exec/score/include/rtems/score/mpci.h
+++ /dev/null
@@ -1,412 +0,0 @@
-/* mpci.h
- *
- * This include file contains all the constants and structures associated
- * with the MPCI layer. It provides mechanisms to utilize packets.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MPCI_h
-#define __MPCI_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/tqdata.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/score/coresem.h>
-
-/*
- * The following constants define the stack size requirements for
- * the system threads.
- */
-
-#define MPCI_RECEIVE_SERVER_STACK_SIZE \
- ( STACK_MINIMUM_SIZE + \
- CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \
- _CPU_Table.extra_mpci_receive_server_stack \
- )
-
-/*
- * The following defines the node number used when a broadcast is desired.
- */
-
-#define MPCI_ALL_NODES 0
-
-/*
- * For packets associated with requests that don't already have a timeout,
- * use the one specified by this MPCI driver. The value specified by
- * the MPCI driver sets an upper limit on how long a remote request
- * should take to complete.
- */
-
-#define MPCI_DEFAULT_TIMEOUT 0xFFFFFFFF
-
-/*
- * The following records define the Multiprocessor Communications
- * Interface (MPCI) Table. This table defines the user-provided
- * MPCI which is a required part of a multiprocessor system.
- *
- * For non-blocking local operations that become remote operations,
- * we need a timeout. This is a per-driver timeout: default_timeout
- */
-
-typedef void MPCI_Entry;
-
-typedef MPCI_Entry ( *MPCI_initialization_entry )( void );
-
-typedef MPCI_Entry ( *MPCI_get_packet_entry )(
- MP_packet_Prefix **
- );
-
-typedef MPCI_Entry ( *MPCI_return_packet_entry )(
- MP_packet_Prefix *
- );
-
-typedef MPCI_Entry ( *MPCI_send_entry )(
- unsigned32,
- MP_packet_Prefix *
- );
-
-typedef MPCI_Entry ( *MPCI_receive_entry )(
- MP_packet_Prefix **
- );
-
-typedef struct {
- unsigned32 default_timeout; /* in ticks */
- unsigned32 maximum_packet_size;
- MPCI_initialization_entry initialization;
- MPCI_get_packet_entry get_packet;
- MPCI_return_packet_entry return_packet;
- MPCI_send_entry send_packet;
- MPCI_receive_entry receive_packet;
-} MPCI_Control;
-
-/*
- * The following defines the type for packet processing routines
- * invoked by the MPCI Receive server.
- */
-
-typedef void (*MPCI_Packet_processor)( MP_packet_Prefix * );
-
-/*
- * The following enumerated type defines the list of
- * internal MP operations.
- */
-
-typedef enum {
- MPCI_PACKETS_SYSTEM_VERIFY = 0
-} MPCI_Internal_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote event operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- MPCI_Internal_Remote_operations operation;
- unsigned32 maximum_nodes;
- unsigned32 maximum_global_objects;
-} MPCI_Internal_packet;
-
-/*
- * This is the core semaphore which the MPCI Receive Server blocks on.
- */
-
-SCORE_EXTERN CORE_semaphore_Control _MPCI_Semaphore;
-/*
- * The following thread queue is used to maintain a list of tasks
- * which currently have outstanding remote requests.
- */
-
-SCORE_EXTERN Thread_queue_Control _MPCI_Remote_blocked_threads;
-
-/*
- * The following define the internal pointers to the user's
- * configuration information.
- */
-
-SCORE_EXTERN MPCI_Control *_MPCI_table;
-
-/*
- * The following points to the MPCI Receive Server.
- */
-
-SCORE_EXTERN Thread_Control *_MPCI_Receive_server_tcb;
-
-/*
- * The following table contains the process packet routines provided
- * by each object that supports MP operations.
- */
-
-SCORE_EXTERN MPCI_Packet_processor
- _MPCI_Packet_processors[MP_PACKET_CLASSES_LAST+1];
-
-/*
- * _MPCI_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _MPCI_Handler_initialization(
- MPCI_Control *users_mpci_table,
- unsigned32 timeout_status
-);
-
-/*
- * _MPCI_Create_server
- *
- * DESCRIPTION:
- *
- * This routine creates the packet receive server used in MP systems.
- */
-
-void _MPCI_Create_server( void );
-
-/*
- * _MPCI_Initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the MPCI driver by
- * invoking the user provided MPCI initialization callout.
- */
-
-void _MPCI_Initialization ( void );
-
-/*
- * _MPCI_Register_packet_processor
- *
- * DESCRIPTION:
- *
- * This routine registers the MPCI packet processor for the
- * designated object class.
- */
-
-void _MPCI_Register_packet_processor(
- MP_packet_Classes the_class,
- MPCI_Packet_processor the_packet_processor
-
-);
-
-/*
- * _MPCI_Get_packet
- *
- * DESCRIPTION:
- *
- * This function obtains a packet by invoking the user provided
- * MPCI get packet callout.
- */
-
-MP_packet_Prefix *_MPCI_Get_packet ( void );
-
-/*
- * _MPCI_Return_packet
- *
- * DESCRIPTION:
- *
- * This routine returns a packet by invoking the user provided
- * MPCI return packet callout.
- */
-
-void _MPCI_Return_packet (
- MP_packet_Prefix *the_packet
-);
-
-/*
- * _MPCI_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine sends a process packet by invoking the user provided
- * MPCI send callout.
- */
-
-void _MPCI_Send_process_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet
-);
-
-/*
- * _MPCI_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine sends a request packet by invoking the user provided
- * MPCI send callout.
- */
-
-unsigned32 _MPCI_Send_request_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet,
- States_Control extra_state
-);
-
-/*
- * _MPCI_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine sends a response packet by invoking the user provided
- * MPCI send callout.
- */
-
-void _MPCI_Send_response_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet
-);
-
-/*
- * _MPCI_Receive_packet
- *
- * DESCRIPTION:
- *
- * This routine receives a packet by invoking the user provided
- * MPCI receive callout.
- */
-
-MP_packet_Prefix *_MPCI_Receive_packet ( void );
-
-/*
- * _MPCI_Process_response
- *
- * DESCRIPTION:
- *
- * This routine obtains a packet by invoking the user provided
- * MPCI get packet callout.
- */
-
-Thread_Control *_MPCI_Process_response (
- MP_packet_Prefix *the_packet
-);
-
-/*PAGE
- *
- * _MPCI_Receive_server
- *
- */
-
-Thread _MPCI_Receive_server(
- unsigned32 ignored
-);
-
-/*PAGE
- *
- * _MPCI_Announce
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _MPCI_Announce ( void );
-
-/*
- * _MPCI_Internal_packets_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _MPCI_Internal_packets_Send_process_packet (
- MPCI_Internal_Remote_operations operation
-);
-
-/*
- * _MPCI_Internal_packets_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- *
- * This routine is not needed since there are no request
- * packets to be sent by this manager.
- */
-
-/*
- * _MPCI_Internal_packets_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- *
- * This routine is not needed since there are no response
- * packets to be sent by this manager.
- */
-
-/*
- *
- * _MPCI_Internal_packets_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _MPCI_Internal_packets_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _MPCI_Internal_packets_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _MPCI_Internal_packets_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _MPCI_Internal_packets_Get_packet
- *
- * DESCRIPTION:
- *
- * This routine is used to obtain a internal threads mp packet.
- */
-
- MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/mppkt.h b/c/src/exec/score/include/rtems/score/mppkt.h
deleted file mode 100644
index 1838d92336..0000000000
--- a/c/src/exec/score/include/rtems/score/mppkt.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* mppkt.h
- *
- * This package is the specification for the Packet Handler.
- * This handler defines the basic packet and provides
- * mechanisms to utilize packets based on this prefix.
- * Packets are the fundamental basis for messages passed between
- * nodes in an MP system.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MP_PACKET_h
-#define __MP_PACKET_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the packet classes.
- *
- * NOTE: In general, each class corresponds to a manager
- * which supports global operations. Each manager
- * defines the set of supported operations.
- */
-
-typedef enum {
- 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
-} MP_packet_Classes;
-
-#define MP_PACKET_CLASSES_FIRST MP_PACKET_MPCI_INTERNAL
-#define MP_PACKET_CLASSES_LAST MP_PACKET_SIGNAL
-
-/*
- * The following record contains the prefix for every packet
- * passed between nodes in an MP system.
- *
- * NOTE: This structure is padded to insure that anything
- * following it is on a 16 byte boundary. This is
- * the most stringent structure alignment rule
- * encountered yet (i960CA).
- */
-
-typedef struct {
- MP_packet_Classes the_class;
- Objects_Id id;
- Objects_Id source_tid;
- Priority_Control source_priority;
- unsigned32 return_code;
- unsigned32 length;
- unsigned32 to_convert;
- Watchdog_Interval timeout;
-} MP_packet_Prefix;
-
-/*
- * An MPCI must support packets of at least this size.
- */
-
-#define MP_PACKET_MINIMUM_PACKET_SIZE 64
-
-/*
- * The following constant defines the number of unsigned32's
- * in a packet which must be converted to native format in a
- * heterogeneous system. In packets longer than
- * MP_PACKET_MINIMUN_HETERO_CONVERSION unsigned32's, some of the "extra" data
- * may a user message buffer which is not automatically endian swapped.
- */
-
-#define MP_PACKET_MINIMUN_HETERO_CONVERSION \
- ( sizeof( MP_packet_Prefix ) / sizeof( unsigned32 ) )
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/mppkt.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/object.h b/c/src/exec/score/include/rtems/score/object.h
deleted file mode 100644
index 0198731b96..0000000000
--- a/c/src/exec/score/include/rtems/score/object.h
+++ /dev/null
@@ -1,397 +0,0 @@
-/* object.h
- *
- * This include file contains all the constants and structures associated
- * with the Object Handler. This Handler provides mechanisms which
- * can be used to initialize and manipulate all objects which have
- * ids.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OBJECTS_h
-#define __OBJECTS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/chain.h>
-
-/*
- * The following type defines the control block used to manage
- * object names.
- */
-
-typedef void * Objects_Name;
-
-/*
- * Space for object names is allocated in multiples of this.
- *
- * NOTE: Must be a power of 2. Matches the name manipulation routines.
- */
-
-#define OBJECTS_NAME_ALIGNMENT sizeof( unsigned32 )
-
-/*
- * Functions which compare names are prototyped like this.
- */
-
-typedef boolean (*Objects_Name_comparators)(
- void * /* name_1 */,
- void * /* name_2 */,
- unsigned32 /* length */
-);
-
-/*
- * The following type defines the control block used to manage
- * object IDs. The format is as follows (0=LSB):
- *
- * Bits 0 .. 15 = index
- * Bits 16 .. 25 = node
- * Bits 26 .. 31 = class
- */
-
-typedef unsigned32 Objects_Id;
-
-#define OBJECTS_INDEX_START_BIT 0
-#define OBJECTS_NODE_START_BIT 16
-#define OBJECTS_CLASS_START_BIT 26
-
-#define OBJECTS_INDEX_MASK 0x0000ffff
-#define OBJECTS_NODE_MASK 0x03ff0000
-#define OBJECTS_CLASS_MASK 0xfc000000
-
-#define OBJECTS_INDEX_VALID_BITS 0x0000ffff
-#define OBJECTS_NODE_VALID_BITS 0x000003ff
-#define OBJECTS_CLASS_VALID_BITS 0x000000cf
-
-/*
- * This enumerated type is used in the class field of the object ID.
- */
-
-typedef enum {
- OBJECTS_NO_CLASS = 0,
- OBJECTS_INTERNAL_THREADS = 1,
- OBJECTS_RTEMS_TASKS = 2,
- OBJECTS_POSIX_THREADS = 3,
- OBJECTS_RTEMS_TIMERS = 4,
- OBJECTS_RTEMS_SEMAPHORES = 5,
- OBJECTS_RTEMS_MESSAGE_QUEUES = 6,
- OBJECTS_RTEMS_PARTITIONS = 7,
- OBJECTS_RTEMS_REGIONS = 8,
- OBJECTS_RTEMS_PORTS = 9,
- OBJECTS_RTEMS_PERIODS = 10,
- OBJECTS_RTEMS_EXTENSIONS = 11,
- OBJECTS_POSIX_KEYS = 12,
- OBJECTS_POSIX_INTERRUPTS = 13,
- OBJECTS_POSIX_MESSAGE_QUEUES = 14,
- OBJECTS_POSIX_MUTEXES = 15,
- OBJECTS_POSIX_SEMAPHORES = 16,
- OBJECTS_POSIX_CONDITION_VARIABLES = 17
-} Objects_Classes;
-
-#define OBJECTS_CLASSES_FIRST OBJECTS_NO_CLASS
-#define OBJECTS_CLASSES_LAST OBJECTS_POSIX_CONDITION_VARIABLES
-#define OBJECTS_CLASSES_FIRST_THREAD_CLASS OBJECTS_INTERNAL_THREADS
-#define OBJECTS_CLASSES_LAST_THREAD_CLASS OBJECTS_POSIX_THREADS
-
-/*
- * This enumerated type lists the locations which may be returned
- * by _Objects_Get. These codes indicate the success of locating
- * an object with the specified ID.
- */
-
-typedef enum {
- OBJECTS_LOCAL = 0, /* object is local */
- OBJECTS_REMOTE = 1, /* object is remote */
- OBJECTS_ERROR = 2 /* id was invalid */
-} Objects_Locations;
-
-/*
- * The following defines the Object Control Block used to manage
- * each object local to this node.
- */
-
-typedef struct {
- Chain_Node Node;
- Objects_Id id;
- Objects_Name name;
-} Objects_Control;
-
-/*
- * The following defines the structure for the information used to
- * manage each class of objects.
- */
-
-typedef struct {
- Objects_Classes the_class; /* Class of this object */
- Objects_Id minimum_id; /* minimum valid id of this type */
- Objects_Id maximum_id; /* maximum valid id of this type */
- unsigned32 maximum; /* maximum number of objects */
- Objects_Control **local_table; /* table of local object pointers */
- Objects_Name *name_table; /* table of local object names */
- Chain_Control *global_table; /* pointer to global table */
- Chain_Control Inactive; /* chain of inactive ctl blocks */
- boolean is_string; /* TRUE if names are strings */
- unsigned32 name_length; /* maximum length of names */
- boolean is_thread; /* TRUE if these are threads */
- /* irregardless of API */
-} Objects_Information;
-
-/*
- * The following defines the data storage which contains the
- * node number of the local node.
- */
-
-SCORE_EXTERN unsigned32 _Objects_Local_node;
-SCORE_EXTERN unsigned32 _Objects_Maximum_nodes;
-
-/*
- * The following is the list of information blocks for each object
- * class. From the ID, we can go to one of these information blocks,
- * and obtain a pointer to the appropriate object control block.
- */
-
-SCORE_EXTERN Objects_Information
- *_Objects_Information_table[OBJECTS_CLASSES_LAST + 1];
-
-/*
- * The following defines the constant which may be used
- * with _Objects_Get to manipulate the calling task.
- *
- */
-
-#define OBJECTS_ID_OF_SELF ((Objects_Id) 0)
-
-/*
- * The following define the constants which may be used in name searches.
- */
-
-#define OBJECTS_SEARCH_ALL_NODES 0
-#define OBJECTS_SEARCH_OTHER_NODES 0x7FFFFFFE
-#define OBJECTS_SEARCH_LOCAL_NODE 0x7FFFFFFF
-#define OBJECTS_WHO_AM_I 0
-
-/*
- * Parameters and return id's for _Objects_Get_next
- */
-
-#define OBJECTS_ID_INITIAL_INDEX (0)
-#define OBJECTS_ID_FINAL_INDEX (0xffff)
-
-#define OBJECTS_ID_INITIAL(_class, _node) \
- _Objects_Build_id( (_class), (_node), OBJECTS_ID_INITIAL_INDEX )
-
-#define OBJECTS_ID_FINAL ((Objects_Id)~0)
-
-/*
- * _Objects_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This function performs the initialization necessary for this handler.
- *
- */
-
-void _Objects_Handler_initialization(
- unsigned32 node,
- unsigned32 maximum_nodes,
- unsigned32 maximum_global_objects
-);
-
-/*
- * _Objects_Initialize_information
- *
- * DESCRIPTION:
- *
- * This function initializes an object class information record.
- * SUPPORTS_GLOBAL is TRUE if the object class supports global
- * objects, and FALSE otherwise. Maximum indicates the number
- * of objects required in this class and size indicates the size
- * in bytes of each control block for this object class. The
- * name length and string designator are also set. In addition,
- * the class may be a task, therefore this information is also included.
- */
-
-void _Objects_Initialize_information (
- Objects_Information *information,
- Objects_Classes the_class,
- boolean supports_global,
- unsigned32 maximum,
- unsigned32 size,
- boolean is_string,
- unsigned32 maximum_name_length,
- boolean is_task
-);
-
-/*
- * _Objects_Clear_name
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _Objects_Clear_name(
- void *name,
- unsigned32 length
-);
-
-/*
- * _Objects_Copy_name_string
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _Objects_Copy_name_string(
- void *source,
- void *destination
-);
-
-/*
- * _Objects_Copy_name_raw
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _Objects_Copy_name_raw(
- void *source,
- void *destination,
- unsigned32 length
-);
-
-/*
- * _Objects_Compare_name_string
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-boolean _Objects_Compare_name_string(
- void *name_1,
- void *name_2,
- unsigned32 length
-);
-
-/*
- * _Objects_Compare_name_raw
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-boolean _Objects_Compare_name_raw(
- void *name_1,
- void *name_2,
- unsigned32 length
-);
-/*
- * _Objects_Name_to_id
- *
- * DESCRIPTION:
- *
- * This function implements the common portion of the object
- * identification directives. This directive returns the object
- * id associated with name. If more than one object of this class
- * is named name, then the object to which the id belongs is
- * arbitrary. Node indicates the extent of the search for the
- * id of the object named name. If the object class supports global
- * objects, then the search can be limited to a particular node
- * or allowed to encompass all nodes.
- *
- */
-
-typedef enum {
- OBJECTS_SUCCESSFUL,
- OBJECTS_INVALID_NAME,
- OBJECTS_INVALID_NODE
-} Objects_Name_to_id_errors;
-
-#define OBJECTS_NAME_ERRORS_FIRST OBJECTS_SUCCESSFUL
-#define OBJECTS_NAME_ERRORS_LAST OBJECTS_INVALID_NODE
-
-Objects_Name_to_id_errors _Objects_Name_to_id(
- Objects_Information *information,
- Objects_Name name,
- unsigned32 node,
- Objects_Id *id
-);
-
-/*
- * _Objects_Get
- *
- * DESCRIPTION:
- *
- * This function maps object ids to object control blocks.
- * If id corresponds to a local object, then it returns
- * the_object control pointer which maps to id and location
- * is set to OBJECTS_LOCAL. If the object class supports global
- * objects and the object id is global and resides on a remote
- * node, then location is set to OBJECTS_REMOTE, and the_object
- * is undefined. Otherwise, location is set to OBJECTS_ERROR
- * and the_object is undefined.
- *
- */
-
-Objects_Control *_Objects_Get (
- Objects_Information *information,
- Objects_Id id,
- Objects_Locations *location
-);
-
-/*
- * _Objects_Get_next
- *
- * DESCRIPTION:
- *
- * Like _Objects_Get, but is used to find "next" open object.
- *
- */
-
-Objects_Control *_Objects_Get_next(
- Objects_Information *information,
- Objects_Id id,
- Objects_Locations *location_p,
- Objects_Id *next_id_p
-);
-
-/*
- * _Objects_Get_information
- *
- * DESCRIPTION:
- *
- * Returns the information control block for the class of objects
- * corresponding to this id.
- */
-
-Objects_Information *_Objects_Get_information(
- Objects_Id id
-);
-
-/*
- * Pieces of object.inl are promoted out to the user
- */
-
-#include <rtems/score/object.inl>
-#include <rtems/score/objectmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/objectmp.h b/c/src/exec/score/include/rtems/score/objectmp.h
deleted file mode 100644
index e307ca4264..0000000000
--- a/c/src/exec/score/include/rtems/score/objectmp.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/* objectmp.h
- *
- * This include file contains all the constants and structures associated
- * with the manipulation of Global RTEMS Objects.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_OBJECTS_MP_h
-#define __RTEMS_OBJECTS_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This defines the Global Object Control Block used to manage
- * objects resident on other nodes.
- */
-
-typedef struct {
- Objects_Control Object;
- unsigned32 name; /* XXX broken but works */
- /* XXX If any API is MP with variable length names .. BOOM!!!! */
-} Objects_MP_Control;
-
-/*
- * _Objects_MP_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine intializes the inactive global object chain
- * based on the maximum number of global objects configured.
- */
-
-void _Objects_MP_Handler_initialization (
- unsigned32 node,
- unsigned32 maximum_nodes,
- unsigned32 maximum_global_objects
-);
-
-/*PAGE
- *
- * _Objects_MP_Open
- *
- * DESCRIPTION:
- *
- * This routine place the specified global object in the
- * specified information table.
- */
-
-void _Objects_MP_Open (
- Objects_Information *information,
- Objects_MP_Control *the_global_object,
- unsigned32 the_name, /* XXX -- wrong for variable */
- Objects_Id the_id
-);
-
-/*
- * _Objects_MP_Allocate_and_open
- *
- * DESCRIPTION:
- *
- * This routine allocates a global object control block
- * and places it in the specified information table. If the
- * allocation fails, then is_fatal_error determines the
- * error processing actions taken.
- */
-
-boolean _Objects_MP_Allocate_and_open (
- Objects_Information *information,
- unsigned32 the_name, /* XXX -- wrong for variable length */
- Objects_Id the_id,
- boolean is_fatal_error
-);
-
-/*
- * _Objects_MP_Close
- *
- * DESCRIPTION:
- *
- * This routine removes a global object from the specified
- * information table and deallocates the global object control block.
- */
-
-void _Objects_MP_Close (
- Objects_Information *information,
- Objects_Id the_id
-);
-
-/*
- * _Objects_MP_Global_name_search
- *
- * DESCRIPTION:
- *
- * This routine looks for the object with the_name in the global
- * object tables indicated by information. It returns the ID of the
- * object with that name if one is found.
- */
-
-Objects_Name_to_id_errors _Objects_MP_Global_name_search (
- Objects_Information *information,
- Objects_Name the_name,
- unsigned32 nodes_to_search,
- Objects_Id *the_id
-);
-
-/*
- * _Objects_MP_Is_remote
- *
- * DESCRIPTION:
- *
- * This function searches the Global Object Table managed
- * by information for the object indicated by ID. If the object
- * is found, then location is set to objects_remote, otherwise
- * location is set to objects_error. In both cases, the_object
- * is undefined.
- */
-
-void _Objects_MP_Is_remote (
- Objects_Information *information,
- Objects_Id the_id,
- Objects_Locations *location,
- Objects_Control **the_object
-);
-
-/*
- * The following chain header is used to manage the set of
- * inactive global object control blocks.
- */
-
-SCORE_EXTERN unsigned32 _Objects_MP_Maximum_global_objects;
-SCORE_EXTERN Chain_Control _Objects_MP_Inactive_global_objects;
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/objectmp.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/priority.h b/c/src/exec/score/include/rtems/score/priority.h
deleted file mode 100644
index 7241888242..0000000000
--- a/c/src/exec/score/include/rtems/score/priority.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* priority.h
- *
- * This include file contains all thread priority manipulation routines.
- * This Handler provides mechanisms which can be used to
- * initialize and manipulate thread priorities.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PRIORITY_h
-#define __PRIORITY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type defines the control block used to manage
- * thread priorities.
- *
- * NOTE: Priority 0 is reserved for internal threads only.
- */
-
-typedef unsigned32 Priority_Control;
-
-#define PRIORITY_MINIMUM 0 /* highest thread priority */
-#define PRIORITY_MAXIMUM 255 /* lowest thread priority */
-
-/*
- * The following record defines the information associated with
- * each thread to manage its interaction with the priority bit maps.
- */
-
-typedef struct {
- Priority_Bit_map_control *minor; /* addr of minor bit map slot */
- Priority_Bit_map_control ready_major; /* priority bit map ready mask */
- Priority_Bit_map_control ready_minor; /* priority bit map ready mask */
- Priority_Bit_map_control block_major; /* priority bit map block mask */
- Priority_Bit_map_control block_minor; /* priority bit map block mask */
-} Priority_Information;
-
-/*
- * The following data items are the priority bit map.
- * Each of the sixteen bits used in the _Priority_Major_bit_map is
- * associated with one of the sixteen entries in the _Priority_Bit_map.
- * Each bit in the _Priority_Bit_map indicates whether or not there are
- * threads ready at a particular priority. The mapping of
- * individual priority levels to particular bits is processor
- * dependent as is the value of each bit used to indicate that
- * threads are ready at that priority.
- */
-
-SCORE_EXTERN volatile Priority_Bit_map_control _Priority_Major_bit_map;
-SCORE_EXTERN Priority_Bit_map_control
- _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;
-
-/*
- * The definition of the Priority_Bit_map_control type is CPU dependent.
- *
- */
-
-/*
- * Priority Bitfield Manipulation Routines
- *
- * NOTE:
- *
- * These may simply be pass throughs to CPU dependent routines.
- */
-
-#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE )
-
-#define _Priority_Mask( _bit_number ) \
- _CPU_Priority_Mask( _bit_number )
-
-#define _Priority_Bits_index( _priority ) \
- _CPU_Priority_bits_index( _priority )
-
-#endif
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/priority.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/stack.h b/c/src/exec/score/include/rtems/score/stack.h
deleted file mode 100644
index 1fc4a13966..0000000000
--- a/c/src/exec/score/include/rtems/score/stack.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* stack.h
- *
- * This include file contains all information about the thread
- * Stack Handler. This Handler provides mechanisms which can be used to
- * initialize and utilize stacks.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STACK_h
-#define __STACK_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following constant defines the minimum stack size which every
- * thread must exceed.
- */
-
-#define STACK_MINIMUM_SIZE CPU_STACK_MINIMUM_SIZE
-
-/*
- * The following defines the control block used to manage each stack.
- */
-
-typedef struct {
- unsigned32 size; /* stack size */
- void *area; /* low memory addr of stack */
-} Stack_Control;
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/stack.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/states.h b/c/src/exec/score/include/rtems/score/states.h
deleted file mode 100644
index a0d7ed8ab8..0000000000
--- a/c/src/exec/score/include/rtems/score/states.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* states.h
- *
- * This include file contains thread execution state information.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_STATES_h
-#define __RTEMS_STATES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type defines the control block used to manage a
- * thread's state.
- */
-
-typedef unsigned32 States_Control;
-
-/*
- * The following constants define the individual states which may be
- * be used to compose and manipulate a thread's state.
- */
-
-#define STATES_ALL_SET 0xfffff /* all states */
-#define STATES_READY 0x00000 /* ready to run */
-#define STATES_DORMANT 0x00001 /* created not started */
-#define STATES_SUSPENDED 0x00002 /* waiting for resume */
-#define STATES_TRANSIENT 0x00004 /* in transition */
-#define STATES_DELAYING 0x00008 /* wait for timeout */
-#define STATES_WAITING_FOR_TIME 0x00010 /* wait for TOD */
-#define STATES_WAITING_FOR_BUFFER 0x00020
-#define STATES_WAITING_FOR_SEGMENT 0x00040
-#define STATES_WAITING_FOR_MESSAGE 0x00080
-#define STATES_WAITING_FOR_EVENT 0x00100
-#define STATES_WAITING_FOR_SEMAPHORE 0x00200
-#define STATES_WAITING_FOR_MUTEX 0x00400
-#define STATES_WAITING_FOR_CONDITION_VARIABLE 0x00800
-#define STATES_WAITING_FOR_JOIN_AT_EXIT 0x01000
-#define STATES_WAITING_FOR_RPC_REPLY 0x02000
-#define STATES_WAITING_FOR_PERIOD 0x04000
-#define STATES_WAITING_FOR_SIGNAL 0x08000
-#define STATES_INTERRUPTIBLE_BY_SIGNAL 0x10000
-
-#define STATES_LOCALLY_BLOCKED ( STATES_WAITING_FOR_BUFFER | \
- STATES_WAITING_FOR_SEGMENT | \
- STATES_WAITING_FOR_MESSAGE | \
- STATES_WAITING_FOR_SEMAPHORE | \
- STATES_WAITING_FOR_MUTEX | \
- STATES_WAITING_FOR_CONDITION_VARIABLE | \
- STATES_WAITING_FOR_JOIN_AT_EXIT | \
- STATES_WAITING_FOR_SIGNAL )
-
-#define STATES_WAITING_ON_THREAD_QUEUE \
- ( STATES_LOCALLY_BLOCKED | \
- STATES_WAITING_FOR_RPC_REPLY )
-
-#define STATES_BLOCKED ( STATES_DELAYING | \
- STATES_WAITING_FOR_TIME | \
- STATES_WAITING_FOR_PERIOD | \
- STATES_WAITING_FOR_EVENT | \
- STATES_WAITING_ON_THREAD_QUEUE | \
- STATES_INTERRUPTIBLE_BY_SIGNAL )
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/states.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/sysstate.h b/c/src/exec/score/include/rtems/score/sysstate.h
deleted file mode 100644
index 8451894e97..0000000000
--- a/c/src/exec/score/include/rtems/score/sysstate.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* sysstates.h
- *
- * This include file contains information regarding the system state.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SYSTEM_STATE_h
-#define __RTEMS_SYSTEM_STATE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* types */
-
-/* enumerated constants */
-
-/*
- * The following type defines the possible system states.
- */
-
-typedef enum {
- SYSTEM_STATE_BEFORE_INITIALIZATION, /* start -> end of 1st init part */
- SYSTEM_STATE_BEFORE_MULTITASKING, /* end of 1st -> beginning of 2nd */
- SYSTEM_STATE_BEGIN_MULTITASKING, /* just before multitasking starts */
- SYSTEM_STATE_UP, /* normal operation */
- SYSTEM_STATE_SHUTDOWN, /* shutdown */
- SYSTEM_STATE_FAILED /* fatal error occurred */
-} System_state_Codes;
-
-#define SYSTEM_STATE_CODES_FIRST SYSTEM_STATE_BEFORE_INITIALIZATION
-#define SYSTEM_STATE_CODES_LAST SYSTEM_STATE_FAILED
-
-/*
- * The following variable indicates whether or not this is
- * an multiprocessing system.
- */
-
-SCORE_EXTERN boolean _System_state_Is_multiprocessing;
-
-/*
- * The following variable contains the current system state.
- */
-
-SCORE_EXTERN System_state_Codes _System_state_Current;
-
-/*
- * Make it possible for the application to get the system state information.
- */
-
-#include <rtems/score/sysstate.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/thread.h b/c/src/exec/score/include/rtems/score/thread.h
deleted file mode 100644
index da6fa76bd0..0000000000
--- a/c/src/exec/score/include/rtems/score/thread.h
+++ /dev/null
@@ -1,622 +0,0 @@
-/* thread.h
- *
- * This include file contains all constants and structures associated
- * with the thread control block.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_h
-#define __THREAD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/context.h>
-#include <rtems/score/cpu.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/stack.h>
-#include <rtems/score/states.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/tqdata.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following defines the "return type" of a thread.
- */
-
-typedef void Thread;
-
-/*
- * The following defines the ways in which the entry point for a
- * thread can be invoked. Basically, it can be passed any
- * combination/permutation of a pointer and an unsigned32 value.
- *
- * NOTE: For now, we are ignoring the return type.
- */
-
-typedef enum {
- THREAD_START_NUMERIC,
- THREAD_START_POINTER,
- THREAD_START_BOTH_POINTER_FIRST,
- THREAD_START_BOTH_NUMERIC_FIRST
-} Thread_Start_types;
-
-typedef Thread ( *Thread_Entry )(); /* basic type */
-
-typedef Thread ( *Thread_Entry_numeric )( unsigned32 );
-typedef Thread ( *Thread_Entry_pointer )( void * );
-typedef Thread ( *Thread_Entry_both_pointer_first )( void *, unsigned32 );
-typedef Thread ( *Thread_Entry_both_numeric_first )( unsigned32, void * );
-
-/*
- * The following lists the algorithms used to manage the thread cpu budget.
- *
- * Reset Timeslice: At each context switch, reset the time quantum.
- * Exhaust Timeslice: Only reset the quantum once it is consumed.
- * Callout: Execute routine when budget is consumed.
- */
-
-typedef enum {
- THREAD_CPU_BUDGET_ALGORITHM_NONE,
- THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE,
- THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE,
- THREAD_CPU_BUDGET_ALGORITHM_CALLOUT
-} Thread_CPU_budget_algorithms;
-
-typedef struct Thread_Control_struct Thread_Control;
-
-typedef void (*Thread_CPU_budget_algorithm_callout )( Thread_Control * );
-
-/*
- * The following structure contains the information which defines
- * the starting state of a thread.
- */
-
-typedef struct {
- Thread_Entry entry_point; /* starting thread address */
- Thread_Start_types prototype; /* how task is invoked */
- void *pointer_argument; /* pointer argument */
- unsigned32 numeric_argument; /* numeric argument */
- /* initial execution modes */
- boolean is_preemptible;
- Thread_CPU_budget_algorithms budget_algorithm;
- Thread_CPU_budget_algorithm_callout budget_callout;
- unsigned32 isr_level;
- Priority_Control initial_priority; /* initial priority */
- boolean core_allocated_stack;
- Stack_Control Initial_stack; /* stack information */
- void *fp_context; /* initial FP context area address */
- void *stack; /* initial stack area address */
-} Thread_Start_information;
-
-/*
- * The following structure contains the information necessary to manage
- * a thread which it is waiting for a resource.
- */
-
-#define THREAD_STATUS_PROXY_BLOCKING 0x1111111
-
-typedef struct {
- Objects_Id id; /* waiting on this object */
- unsigned32 count; /* "generic" fields to be used */
- void *return_argument; /* when blocking */
- void *return_argument_1;
- unsigned32 option;
-
- /*
- * NOTE: The following assumes that all API return codes can be
- * treated as an unsigned32.
- */
- unsigned32 return_code; /* status for thread awakened */
-
- Chain_Control Block2n; /* 2 - n priority blocked chain */
- Thread_queue_Control *queue; /* pointer to thread queue */
-} Thread_Wait_information;
-
-/*
- * The following defines the control block used to manage
- * each thread proxy.
- *
- * NOTE: It is critical that proxies and threads have identical
- * memory images for the shared part.
- */
-
-typedef struct {
- Objects_Control Object;
- States_Control current_state;
- Priority_Control current_priority;
- Priority_Control real_priority;
- unsigned32 resource_count;
- Thread_Wait_information Wait;
- Watchdog_Control Timer;
- MP_packet_Prefix *receive_packet;
- /****************** end of common block ********************/
- Chain_Node Active;
-} Thread_Proxy_control;
-
-
-/*
- * The following record defines the control block used
- * to manage each thread.
- *
- * NOTE: It is critical that proxies and threads have identical
- * memory images for the shared part.
- */
-
-typedef enum {
- THREAD_API_RTEMS,
- THREAD_API_POSIX
-} Thread_APIs;
-
-#define THREAD_API_FIRST THREAD_API_RTEMS
-#define THREAD_API_LAST THREAD_API_POSIX
-
-struct Thread_Control_struct {
- Objects_Control Object;
- States_Control current_state;
- Priority_Control current_priority;
- Priority_Control real_priority;
- unsigned32 resource_count;
- Thread_Wait_information Wait;
- Watchdog_Control Timer;
- MP_packet_Prefix *receive_packet;
- /****************** end of common block ********************/
- boolean is_global;
- boolean do_post_task_switch_extension;
-
- boolean is_preemptible;
- unsigned32 cpu_time_budget;
- Thread_CPU_budget_algorithms budget_algorithm;
- Thread_CPU_budget_algorithm_callout budget_callout;
-
- unsigned32 ticks_executed;
- Chain_Control *ready;
- Priority_Information Priority_map;
- Thread_Start_information Start;
- Context_Control Registers;
- void *fp_context;
- void *API_Extensions[ THREAD_API_LAST + 1 ];
- void **extensions;
-};
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-SCORE_EXTERN Objects_Information _Thread_Internal_information;
-
-/*
- * The following define the thread control pointers used to access
- * and manipulate the idle thread.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_Idle;
-
-/*
- * The following context area contains the context of the "thread"
- * which invoked the start multitasking routine. This context is
- * restored as the last action of the stop multitasking routine. Thus
- * control of the processor can be returned to the environment
- * which initiated the system.
- */
-
-SCORE_EXTERN Context_Control _Thread_BSP_context;
-
-/*
- * The following declares the dispatch critical section nesting
- * counter which is used to prevent context switches at inopportune
- * moments.
- */
-
-SCORE_EXTERN unsigned32 _Thread_Dispatch_disable_level;
-
-/*
- * If this is non-zero, then the post-task switch extension
- * is run regardless of the state of the per thread flag.
- */
-
-SCORE_EXTERN unsigned32 _Thread_Do_post_task_switch_extension;
-
-/*
- * The following holds how many user extensions are in the system. This
- * is used to determine how many user extension data areas to allocate
- * per thread.
- */
-
-SCORE_EXTERN unsigned32 _Thread_Maximum_extensions;
-
-/*
- * The following is used to manage the length of a timeslice quantum.
- */
-
-SCORE_EXTERN unsigned32 _Thread_Ticks_per_timeslice;
-
-/*
- * The following points to the array of FIFOs used to manage the
- * set of ready threads.
- */
-
-SCORE_EXTERN Chain_Control *_Thread_Ready_chain;
-
-/*
- * The following points to the thread which is currently executing.
- * This thread is implicitly manipulated by numerous directives.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_Executing;
-
-/*
- * The following points to the highest priority ready thread
- * in the system. Unless the current thread is not preemptibl,
- * then this thread will be context switched to when the next
- * dispatch occurs.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_Heir;
-
-/*
- * The following points to the thread whose floating point
- * context is currently loaded.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_Allocated_fp;
-
-/*
- * _Thread_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _Thread_Handler_initialization (
- unsigned32 ticks_per_timeslice,
- unsigned32 maximum_extensions,
- unsigned32 maximum_proxies
-);
-
-/*
- * _Thread_Create_idle
- *
- * DESCRIPTION:
- *
- * This routine creates the idle thread.
- *
- * WARNING!! No thread should be created before this one.
- */
-
-void _Thread_Create_idle( void );
-
-/*
- * _Thread_Start_multitasking
- *
- * DESCRIPTION:
- *
- * This routine initiates multitasking. It is invoked only as
- * part of initialization and its invocation is the last act of
- * the non-multitasking part of the system initialization.
- */
-
-void _Thread_Start_multitasking( void );
-
-/*
- * _Thread_Dispatch
- *
- * DESCRIPTION:
- *
- * This routine is responsible for transferring control of the
- * processor from the executing thread to the heir thread. As part
- * of this process, it is responsible for the following actions:
- *
- * + saving the context of the executing thread
- * + restoring the context of the heir thread
- * + dispatching any signals for the resulting executing thread
- */
-
-void _Thread_Dispatch( void );
-
-/*
- * _Thread_Initialize
- *
- * DESCRIPTION:
- *
- * XXX
- *
- * NOTES:
- *
- * If stack_area is NULL, it is allocated from the workspace.
- *
- * If the stack is allocated from the workspace, then it is guaranteed to be
- * of at least minimum size.
- */
-
-boolean _Thread_Initialize(
- Objects_Information *information,
- Thread_Control *the_thread,
- void *stack_area,
- unsigned32 stack_size,
- boolean is_fp,
- Priority_Control priority,
- boolean is_preemptible,
- Thread_CPU_budget_algorithms budget_algorithm,
- Thread_CPU_budget_algorithm_callout budget_callout,
- unsigned32 isr_level,
- Objects_Name name
-);
-
-/*
- * _Thread_Start
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-boolean _Thread_Start(
- Thread_Control *the_thread,
- Thread_Start_types the_prototype,
- void *entry_point,
- void *pointer_argument,
- unsigned32 numeric_argument
-);
-
-/*
- * _Thread_Restart
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-/* XXX multiple task arg profiles */
-
-boolean _Thread_Restart(
- Thread_Control *the_thread,
- void *pointer_argument,
- unsigned32 numeric_argument
-);
-
-/*
- * _Thread_Close
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _Thread_Close(
- Objects_Information *information,
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_Ready
- *
- * DESCRIPTION:
- *
- * This routine removes any set states for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-void _Thread_Ready(
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_Clear_state
- *
- * DESCRIPTION:
- *
- * This routine clears the indicated STATES for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-void _Thread_Clear_state(
- Thread_Control *the_thread,
- States_Control state
-);
-
-/*
- * _Thread_Set_state
- *
- * DESCRIPTION:
- *
- * This routine sets the indicated states for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- *
- */
-
-void _Thread_Set_state(
- Thread_Control *the_thread,
- States_Control state
-);
-
-/*
- * _Thread_Set_transient
- *
- * DESCRIPTION:
- *
- * This routine sets the TRANSIENT state for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-void _Thread_Set_transient(
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_Reset_timeslice
- *
- * DESCRIPTION:
- *
- * This routine is invoked upon expiration of the currently
- * executing thread's timeslice. If no other thread's are ready
- * at the priority of the currently executing thread, then the
- * executing thread's timeslice is reset. Otherwise, the
- * currently executing thread is placed at the rear of the
- * FIFO for this priority and a new heir is selected.
- */
-
-void _Thread_Reset_timeslice( void );
-
-/*
- * _Thread_Tickle_timeslice
- *
- * DESCRIPTION:
- *
- * This routine is invoked as part of processing each clock tick.
- * It is responsible for determining if the current thread allows
- * timeslicing and, if so, when its timeslice expires.
- */
-
-void _Thread_Tickle_timeslice( void );
-
-/*
- * _Thread_Yield_processor
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a thread wishes to voluntarily
- * transfer control of the processor to another thread of equal
- * or greater priority.
- */
-
-void _Thread_Yield_processor( void );
-
-/*
- * _Thread_Load_environment
- *
- * DESCRIPTION:
- *
- * This routine initializes the context of the_thread to its
- * appropriate starting state.
- */
-
-void _Thread_Load_environment(
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_Handler
- *
- * DESCRIPTION:
- *
- * This routine is the wrapper function for all threads. It is
- * the starting point for all threads. The user provided thread
- * entry point is invoked by this routine. Operations
- * which must be performed immediately before and after the user's
- * thread executes are found here.
- */
-
-void _Thread_Handler( void );
-
-/*
- * _Thread_Delay_ended
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a thread must be unblocked at the
- * end of a time based delay (i.e. wake after or wake when).
- */
-
-void _Thread_Delay_ended(
- Objects_Id id,
- void *ignored
-);
-
-/*
- * _Thread_Change_priority
- *
- * DESCRIPTION:
- *
- * This routine changes the current priority of the_thread to
- * new_priority. It performs any necessary scheduling operations
- * including the selection of a new heir thread.
- */
-
-void _Thread_Change_priority (
- Thread_Control *the_thread,
- Priority_Control new_priority,
- boolean prepend_it
-);
-
-/*
- * _Thread_Set_priority
- *
- * DESCRIPTION:
- *
- * This routine updates the priority related fields in the_thread
- * control block to indicate the current priority is now new_priority.
- */
-
-void _Thread_Set_priority(
- Thread_Control *the_thread,
- Priority_Control new_priority
-);
-
-/*
- * _Thread_Evaluate_mode
- *
- * DESCRIPTION:
- *
- * This routine XXX
- */
-
-boolean _Thread_Evaluate_mode( void );
-
-/*
- * _Thread_Get
- *
- * NOTE: If we are not using static inlines, this must be a real
- * subroutine call.
- */
-
-#ifndef USE_INLINES
-Thread_Control *_Thread_Get (
- Objects_Id id,
- Objects_Locations *location
-);
-#endif
-
-/*
- * _Thread_Idle_body
- *
- * DESCRIPTION:
- *
- * This routine is the body of the system idle thread.
- */
-
-#if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)
-Thread _Thread_Idle_body(
- unsigned32 ignored
-);
-#endif
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/thread.inl>
-#endif
-#include <rtems/score/threadmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/threadmp.h b/c/src/exec/score/include/rtems/score/threadmp.h
deleted file mode 100644
index 497bdc8c5b..0000000000
--- a/c/src/exec/score/include/rtems/score/threadmp.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* threadmp.h
- *
- * This include file contains the specification for all routines
- * and data specific to the multiprocessing portion of the thread package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_THREAD_MP_h
-#define __RTEMS_THREAD_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * _Thread_MP_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the multiprocessing portion of the Thread Handler.
- */
-
-void _Thread_MP_Handler_initialization (
- unsigned32 maximum_proxies
-);
-
-/*
- * _Thread_MP_Allocate_proxy
- *
- * DESCRIPTION:
- *
- * This allocates a proxy control block from
- * the inactive chain of free proxy control blocks.
- *
- * NOTE: This function returns a thread control pointer
- * because proxies are substitutes for remote threads.
- */
-
-Thread_Control *_Thread_MP_Allocate_proxy (
- States_Control the_state
-);
-
-/*
- * _Thread_MP_Find_proxy
- *
- * DESCRIPTION:
- *
- * This function removes the proxy control block for the specified
- * id from the active chain of proxy control blocks.
- */
-
-Thread_Control *_Thread_MP_Find_proxy (
- Objects_Id the_id
-);
-
-/*
- * The following is used to determine when the multiprocessing receive
- * thread is executing so that a proxy can be allocated instead of
- * blocking the multiprocessing receive thread.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_MP_Receive;
-
-/*
- * The following chains are used to manage proxies.
- */
-
-SCORE_EXTERN Chain_Control _Thread_MP_Active_proxies;
-SCORE_EXTERN Chain_Control _Thread_MP_Inactive_proxies;
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/threadmp.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/threadq.h b/c/src/exec/score/include/rtems/score/threadq.h
deleted file mode 100644
index d3a0f58ad1..0000000000
--- a/c/src/exec/score/include/rtems/score/threadq.h
+++ /dev/null
@@ -1,301 +0,0 @@
-/* threadq.h
- *
- * This include file contains all the constants and structures associated
- * with the manipulation of objects.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_QUEUE_h
-#define __THREAD_QUEUE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/tqdata.h>
-
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * Constant for indefinite wait.
- */
-
-#define THREAD_QUEUE_WAIT_FOREVER WATCHDOG_NO_TIMEOUT
-
-/*
- * The following type defines the callout used when a remote task
- * is extracted from a local thread queue.
- */
-
-typedef void ( *Thread_queue_Flush_callout )(
- Thread_Control *
- );
-
-/*
- * The following type defines the callout used when a local task
- * is extracted from a remote thread queue (i.e. it's proxy must
- * extracted from the remote queue).
- */
-
-typedef void ( *Thread_queue_Extract_callout )(
- Thread_Control *
- );
-
-SCORE_EXTERN Thread_queue_Extract_callout
- _Thread_queue_Extract_table[ OBJECTS_CLASSES_LAST + 1 ];
-
-/*
- * _Thread_queue_Dequeue
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to a thread waiting on
- * the_thread_queue. The selection of this thread is based on
- * the discipline of the_thread_queue. If no threads are waiting
- * on the_thread_queue, then NULL is returned.
- */
-
-Thread_Control *_Thread_queue_Dequeue(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Enqueue
- *
- * DESCRIPTION:
- *
- * This routine enqueues the currently executing thread on
- * the_thread_queue with an optional timeout.
- */
-
-void _Thread_queue_Enqueue(
- Thread_queue_Control *the_thread_queue,
- Watchdog_Interval timeout
-);
-
-/*
- * _Thread_queue_Extract
- *
- * DESCRIPTION:
- *
- * This routine removes the_thread from the_thread_queue
- * and cancels any timeouts associated with this blocking.
- */
-
-void _Thread_queue_Extract(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_queue_Extract_with_proxy
- *
- * DESCRIPTION:
- *
- * This routine extracts the_thread from the_thread_queue
- * and insures that if there is a proxy for this task on
- * another node, it is also dealt with.
- */
-
-boolean _Thread_queue_Extract_with_proxy(
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_queue_First
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the "first" thread
- * on the_thread_queue. The "first" thread is selected
- * based on the discipline of the_thread_queue.
- */
-
-Thread_Control *_Thread_queue_First(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Flush
- *
- * DESCRIPTION:
- *
- * This routine unblocks all threads blocked on the_thread_queue
- * and cancels any associated timeouts.
- */
-
-void _Thread_queue_Flush(
- Thread_queue_Control *the_thread_queue,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-);
-
-/*
- * _Thread_queue_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the_thread_queue based on the
- * discipline indicated in attribute_set. The state set on
- * threads which block on the_thread_queue is state.
- */
-
-void _Thread_queue_Initialize(
- Thread_queue_Control *the_thread_queue,
- Objects_Classes the_class,
- Thread_queue_Disciplines the_discipline,
- States_Control state,
- Thread_queue_Extract_callout proxy_extract_callout,
- unsigned32 timeout_status
-);
-
-/*
- * _Thread_queue_Dequeue_priority
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the highest priority
- * thread waiting on the_thread_queue. If no threads are waiting
- * on the_thread_queue, then NULL is returned.
- */
-
-Thread_Control *_Thread_queue_Dequeue_priority(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Enqueue_priority
- *
- * DESCRIPTION:
- *
- * This routine enqueues the currently executing thread on
- * the_thread_queue with an optional timeout using the
- * priority discipline.
- */
-
-void _Thread_queue_Enqueue_priority(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread,
- Watchdog_Interval timeout
-);
-
-/*
- * _Thread_queue_Extract_priority
- *
- * DESCRIPTION:
- *
- * This routine removes the_thread from the_thread_queue
- * and cancels any timeouts associated with this blocking.
- */
-
-void _Thread_queue_Extract_priority(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_queue_First_priority
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the "first" thread
- * on the_thread_queue. The "first" thread is the highest
- * priority thread waiting on the_thread_queue.
- */
-
-Thread_Control *_Thread_queue_First_priority(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Dequeue_FIFO
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the thread which has
- * been waiting the longest on the_thread_queue. If no
- * threads are waiting on the_thread_queue, then NULL is returned.
- */
-
-Thread_Control *_Thread_queue_Dequeue_fifo(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Enqueue_FIFO
- *
- * DESCRIPTION:
- *
- * This routine enqueues the currently executing thread on
- * the_thread_queue with an optional timeout using the
- * FIFO discipline.
- */
-
-void _Thread_queue_Enqueue_fifo(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread,
- Watchdog_Interval timeout
-);
-
-/*
- * _Thread_queue_Extract_FIFO
- *
- * DESCRIPTION:
- *
- * This routine removes the_thread from the_thread_queue
- * and cancels any timeouts associated with this blocking.
- */
-
-void _Thread_queue_Extract_fifo(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_queue_First_FIFO
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the "first" thread
- * on the_thread_queue. The first thread is the thread
- * which has been waiting longest on the_thread_queue.
- */
-
-Thread_Control *_Thread_queue_First_fifo(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_timeout
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task's request has not
- * been satisfied after the timeout interval specified to
- * enqueue. The task represented by ID will be unblocked and
- * its status code will be set in it's control block to indicate
- * that a timeout has occurred.
- */
-
-void _Thread_queue_Timeout (
- Objects_Id id,
- void *ignored
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/tod.h b/c/src/exec/score/include/rtems/score/tod.h
deleted file mode 100644
index b87486bda1..0000000000
--- a/c/src/exec/score/include/rtems/score/tod.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/* tod.h
- *
- * This include file contains all the constants and structures associated
- * with the Time of Day Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIME_OF_DAY_h
-#define __TIME_OF_DAY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following constants are related to the time of day.
- */
-
-#define TOD_SECONDS_PER_MINUTE 60
-#define TOD_MINUTES_PER_HOUR 60
-#define TOD_MONTHS_PER_YEAR 12
-#define TOD_DAYS_PER_YEAR 365
-#define TOD_HOURS_PER_DAY 24
-#define TOD_SECONDS_PER_DAY (TOD_SECONDS_PER_MINUTE * \
- TOD_MINUTES_PER_HOUR * \
- TOD_HOURS_PER_DAY)
-
-#define TOD_SECONDS_PER_NON_LEAP_YEAR (365 * TOD_SECONDS_PER_DAY)
-
-#define TOD_MILLISECONDS_PER_SECOND 1000
-#define TOD_MICROSECONDS_PER_SECOND 1000000
-#define TOD_NANOSECONDS_PER_SECOND 1000000000
-#define TOD_NANOSECONDS_PER_MICROSECOND 1000
-
-/*
- * The following constant define the earliest year to which an
- * time of day can be initialized. This is considered the
- * epoch.
- */
-
-#define TOD_BASE_YEAR 1988
-
-/*
- * The following record defines the time of control block. This
- * control block is used to maintain the current time of day.
- */
-
-typedef struct { /* RTEID style time/date */
- unsigned32 year; /* year, A.D. */
- unsigned32 month; /* month, 1 -> 12 */
- unsigned32 day; /* day, 1 -> 31 */
- unsigned32 hour; /* hour, 0 -> 23 */
- unsigned32 minute; /* minute, 0 -> 59 */
- unsigned32 second; /* second, 0 -> 59 */
- unsigned32 ticks; /* elapsed ticks between secs */
-} TOD_Control;
-
-/*
- * The following is TRUE if the application has set the current
- * time of day, and FALSE otherwise.
- */
-
-SCORE_EXTERN boolean _TOD_Is_set;
-
-/*
- * The following contains the current time of day.
- */
-
-SCORE_EXTERN TOD_Control _TOD_Current;
-
-/*
- * The following contains the number of seconds from 00:00:00
- * January 1, TOD_BASE_YEAR until the current time of day.
- */
-
-SCORE_EXTERN Watchdog_Interval _TOD_Seconds_since_epoch;
-
-/*
- * The following contains the number of microseconds per tick.
- */
-
-SCORE_EXTERN unsigned32 _TOD_Microseconds_per_tick;
-
-/*
- * The following contains the number of clock ticks per second.
- *
- * NOTE:
- *
- * If one second is NOT evenly divisible by the number of microseconds
- * per clock tick, this value will contain only the integer portion
- * of the division. This means that the interval between clock ticks
- * can be a source of error in the current time of day.
- */
-
-SCORE_EXTERN unsigned32 _TOD_Ticks_per_second;
-
-/*
- * This is the control structure for the watchdog timer which
- * fires to service the seconds chain.
- */
-
-SCORE_EXTERN Watchdog_Control _TOD_Seconds_watchdog;
-
-#ifdef SCORE_INIT
-
-/*
- * The following array contains the number of days in all months.
- * The first dimension should be 1 for leap years, and 0 otherwise.
- * The second dimension should range from 1 to 12 for January to
- * February, respectively.
- */
-
-const unsigned32 _TOD_Days_per_month[ 2 ][ 13 ] = {
- { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
- { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
-};
-
-/*
- * The following array contains the number of days in all months
- * up to the month indicated by the index of the second dimension.
- * The first dimension should be 1 for leap years, and 0 otherwise.
- */
-
-const unsigned16 _TOD_Days_to_date[2][13] = {
- { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 },
- { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }
-};
-
-/*
- * The following array contains the number of days in the years
- * since the last leap year. The index should be 0 for leap
- * years, and the number of years since the beginning of a leap
- * year otherwise.
- */
-
-const unsigned16 _TOD_Days_since_last_leap_year[4] = { 0, 366, 731, 1096 };
-
-#else
-
-extern const unsigned16 _TOD_Days_to_date[2][13]; /* Julian days */
-extern const unsigned16 _TOD_Days_since_last_leap_year[4];
-extern const unsigned32 _TOD_Days_per_month[2][13];
-
-#endif
-
-/*
- * _TOD_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _TOD_Handler_initialization(
- unsigned32 microseconds_per_tick
-);
-
-/*
- * _TOD_Set
- *
- * DESCRIPTION:
- *
- * This routine sets the current time of day to THE_TOD and
- * the equivalent SECONDS_SINCE_EPOCH.
- */
-
-void _TOD_Set(
- TOD_Control *the_tod,
- Watchdog_Interval seconds_since_epoch
-);
-
-/*
- * _TOD_Validate
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if THE_TOD contains
- * a valid time of day, and FALSE otherwise.
- */
-
-boolean _TOD_Validate(
- TOD_Control *the_tod
-);
-
-/*
- * _TOD_To_seconds
- *
- * DESCRIPTION:
- *
- * This function returns the number seconds between the epoch and THE_TOD.
- */
-
-Watchdog_Interval _TOD_To_seconds(
- TOD_Control *the_tod
-);
-
-/*
- * _TOD_Tickle
- *
- * DESCRIPTION:
- *
- * This routine is scheduled as a watchdog function and is invoked at
- * each second boundary. It updates the current time of day to indicate
- * that a second has passed and processes the seconds watchdog chain.
- */
-
-void _TOD_Tickle(
- Objects_Id id,
- void *ignored
-);
-
-/*
- * TOD_MILLISECONDS_TO_MICROSECONDS
- *
- * DESCRIPTION:
- *
- * This routine converts an interval expressed in milliseconds to microseconds.
- *
- * NOTE:
- *
- * This must be a macro so it can be used in "static" tables.
- */
-
-#define TOD_MILLISECONDS_TO_MICROSECONDS(_ms) ((_ms) * 1000)
-
-/*
- * TOD_MICROSECONDS_TO_TICKS
- *
- * DESCRIPTION:
- *
- * This routine converts an interval expressed in microseconds to ticks.
- *
- * NOTE:
- *
- * This must be a macro so it can be used in "static" tables.
- */
-
-#define TOD_MICROSECONDS_TO_TICKS(_us) \
- ((_us) / _TOD_Microseconds_per_tick)
-
-/*
- * TOD_MILLISECONDS_TO_TICKS
- *
- * DESCRIPTION:
- *
- * This routine converts an interval expressed in milliseconds to ticks.
- *
- * NOTE:
- *
- * This must be a macro so it can be used in "static" tables.
- */
-
-#define TOD_MILLISECONDS_TO_TICKS(_ms) \
- (TOD_MILLISECONDS_TO_MICROSECONDS(_ms) / _TOD_Microseconds_per_tick)
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/tod.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/tqdata.h b/c/src/exec/score/include/rtems/score/tqdata.h
deleted file mode 100644
index 6136d35412..0000000000
--- a/c/src/exec/score/include/rtems/score/tqdata.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* tqdata.h
- *
- * This include file contains all the constants and structures
- * needed to declare a thread queue.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_QUEUE_DATA_h
-#define __THREAD_QUEUE_DATA_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/chain.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/states.h>
-
-/*
- * The following enumerated type details all of the disciplines
- * supported by the Thread Queue Handler.
- */
-
-typedef enum {
- THREAD_QUEUE_DISCIPLINE_FIFO, /* FIFO queue discipline */
- THREAD_QUEUE_DISCIPLINE_PRIORITY /* PRIORITY queue discipline */
-} Thread_queue_Disciplines;
-
-/*
- * The following enumerated types indicate what happened while the thread
- * queue was in the synchronization window.
- */
-
-typedef enum {
- THREAD_QUEUE_SYNCHRONIZED,
- THREAD_QUEUE_NOTHING_HAPPENED,
- THREAD_QUEUE_TIMEOUT,
- THREAD_QUEUE_SATISFIED
-} Thread_queue_States;
-
-/*
- * The following constants are used to manage the priority queues.
- *
- * There are four chains used to maintain a priority -- each chain
- * manages a distinct set of task priorities. The number of chains
- * is determined by TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS.
- * The following set must be consistent.
- *
- * The set below configures 4 headers -- each contains 64 priorities.
- * Header x manages priority range (x*64) through ((x*64)+63). If
- * the priority is more than half way through the priority range it
- * is in, then the search is performed from the rear of the chain.
- * This halves the search time to find the insertion point.
- */
-
-#define TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS 4
-#define TASK_QUEUE_DATA_PRIORITIES_PER_HEADER 64
-#define TASK_QUEUE_DATA_REVERSE_SEARCH_MASK 0x20
-
-typedef struct {
- union {
- Chain_Control Fifo; /* FIFO discipline list */
- Chain_Control Priority[TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS];
- /* priority discipline list */
- } Queues;
- Thread_queue_States sync_state; /* alloc/dealloc critical section */
- Thread_queue_Disciplines discipline; /* queue discipline */
- States_Control state; /* state of threads on Thread_q */
- unsigned32 timeout_status;
-} Thread_queue_Control;
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/tqdata.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/userext.h b/c/src/exec/score/include/rtems/score/userext.h
deleted file mode 100644
index 29b0e9564e..0000000000
--- a/c/src/exec/score/include/rtems/score/userext.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/* userext.h
- *
- * This include file contains all information about user extensions. This
- * Handler provides mechanisms which can be used to initialize and manipulate
- * all user extensions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __USER_EXTENSIONS_h
-#define __USER_EXTENSIONS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/interr.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/thread.h>
-
-/*
- * The following records defines the User Extension Table.
- * This table defines the application dependent routines which
- * are invoked at critical points in the life of each thread and
- * the system as a whole.
- */
-
-typedef void User_extensions_routine;
-
-typedef boolean ( *User_extensions_thread_create_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_delete_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_start_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_restart_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_switch_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine (
- *User_extensions_thread_post_switch_extension )(
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_begin_extension )(
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_exitted_extension )(
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_fatal_extension )(
- Internal_errors_Source /* the_source */,
- boolean /* is_internal */,
- unsigned32 /* the_error */
- );
-
-
-typedef struct {
- User_extensions_thread_create_extension thread_create;
- User_extensions_thread_start_extension thread_start;
- User_extensions_thread_restart_extension thread_restart;
- User_extensions_thread_delete_extension thread_delete;
- User_extensions_thread_switch_extension thread_switch;
- User_extensions_thread_begin_extension thread_begin;
- User_extensions_thread_exitted_extension thread_exitted;
- User_extensions_fatal_extension fatal;
-} User_extensions_Table;
-
-/*
- * The following is used to manage each user extension set.
- */
-
-typedef struct {
- Chain_Node Node;
- User_extensions_Table Callouts;
-} User_extensions_Control;
-
-/*
- * The following is used to manage the list of active extensions.
- */
-
-SCORE_EXTERN Chain_Control _User_extensions_List;
-
-/*
- * _User_extensions_Thread_create
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension for
- * the thread creation operate.
- */
-
-boolean _User_extensions_Thread_create (
- Thread_Control *the_thread
-);
-
-/*
- * _User_extensions_Thread_delete
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension for
- * the thread deletion operation.
- */
-
-void _User_extensions_Thread_delete (
- Thread_Control *the_thread
-);
-
-/*
- * _User_extensions_Thread_start
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension for
- * the thread start operation.
- */
-
-void _User_extensions_Thread_start (
- Thread_Control *the_thread
-);
-
-/*
- * _User_extensions_Thread_restart
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension for
- * the thread restart operation.
- */
-
-void _User_extensions_Thread_restart (
- Thread_Control *the_thread
-);
-
-/*
- * _User_extensions_Thread_begin
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension which
- * is invoked when a thread begins.
- */
-
-void _User_extensions_Thread_begin (
- Thread_Control *executing
-);
-
-/*
- * _User_extensions_Thread_exitted
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension which
- * is invoked when a thread exits.
- */
-
-void _User_extensions_Thread_exitted (
- Thread_Control *executing
-);
-
-/*
- * _User_extensions_Fatal
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension invoked
- * when a fatal error occurs.
- */
-
-void _User_extensions_Fatal (
- Internal_errors_Source the_source,
- boolean is_internal,
- unsigned32 the_error
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/userext.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/watchdog.h b/c/src/exec/score/include/rtems/score/watchdog.h
deleted file mode 100644
index ceb09793f6..0000000000
--- a/c/src/exec/score/include/rtems/score/watchdog.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/* watchdog.h
- *
- * This include file contains all the constants and structures associated
- * with watchdog timers. This Handler provides mechanisms which can be
- * used to initialize and manipulate watchdog timers.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WATCHDOG_h
-#define __WATCHDOG_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-
-/*
- * The following type defines the control block used to manage
- * intervals.
- */
-
-typedef unsigned32 Watchdog_Interval;
-
-/*
- * The following types define a pointer to a watchdog service routine.
- */
-
-typedef void Watchdog_Service_routine;
-
-typedef Watchdog_Service_routine ( *Watchdog_Service_routine_entry )(
- Objects_Id,
- void *
- );
-
-/*
- * Constant for indefinite wait. (actually an illegal interval)
- */
-
-#define WATCHDOG_NO_TIMEOUT 0
-
-/*
- * The following enumerated type lists the states in which a
- * watchdog timer may be at any given time.
- */
-
-typedef enum {
- WATCHDOG_INACTIVE, /* off all chains */
- WATCHDOG_BEING_INSERTED, /* off all chains, searching for insertion point */
- WATCHDOG_ACTIVE, /* on chain, allowed to fire */
- WATCHDOG_REMOVE_IT /* on chain, remove without firing if expires */
-} Watchdog_States;
-
-/*
- * The following enumerated type details the manner in which
- * a watchdog chain may be adjusted by the Watchdog_Adjust
- * routine. The direction indicates a movement FORWARD
- * or BACKWARD in time.
- */
-
-typedef enum {
- WATCHDOG_FORWARD, /* adjust delta value forward */
- WATCHDOG_BACKWARD /* adjust delta value backward */
-} Watchdog_Adjust_directions;
-
-/*
- * The following record defines the control block used
- * to manage each watchdog timer.
- */
-
-typedef struct {
- Chain_Node Node;
- Watchdog_States state;
- Watchdog_Interval initial;
- Watchdog_Interval delta_interval;
- Watchdog_Interval start_time;
- Watchdog_Interval stop_time;
- Watchdog_Service_routine_entry routine;
- Objects_Id id;
- void *user_data;
-} Watchdog_Control;
-
-/*
- * The following are used for synchronization purposes
- * during an insert on a watchdog delta chain.
- */
-
-SCORE_EXTERN volatile unsigned32 _Watchdog_Sync_level;
-SCORE_EXTERN volatile unsigned32 _Watchdog_Sync_count;
-
-/*
- * The following contains the number of ticks since the
- * system was booted.
- */
-
-SCORE_EXTERN Watchdog_Interval _Watchdog_Ticks_since_boot;
-
-/*
- * The following defines the watchdog chains which are managed
- * on ticks and second boundaries.
- */
-
-SCORE_EXTERN Chain_Control _Watchdog_Ticks_chain;
-SCORE_EXTERN Chain_Control _Watchdog_Seconds_chain;
-
-/*
- * _Watchdog_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the watchdog handler. The watchdog
- * synchronization flag is initialized and the watchdog chains are
- * initialized and emptied.
- */
-
-void _Watchdog_Handler_initialization( void );
-
-/*
- * _Watchdog_Remove
- *
- * DESCRIPTION:
- *
- * This routine removes THE_WATCHDOG from the watchdog chain on which
- * it resides and returns the state THE_WATCHDOG timer was in.
- */
-
-Watchdog_States _Watchdog_Remove (
- Watchdog_Control *the_watchdog
-);
-
-/*
- * _Watchdog_Adjust
- *
- * DESCRIPTION:
- *
- * This routine adjusts the HEADER watchdog chain in the forward
- * or backward DIRECTION for UNITS ticks.
- */
-
-void _Watchdog_Adjust (
- Chain_Control *header,
- Watchdog_Adjust_directions direction,
- Watchdog_Interval units
-);
-
-/*
- * _Watchdog_Insert
- *
- * DESCRIPTION:
- *
- * This routine inserts THE_WATCHDOG into the HEADER watchdog chain
- * for a time of UNITS. The INSERT_MODE indicates whether
- * THE_WATCHDOG is to be activated automatically or later, explicitly
- * by the caller.
- *
- */
-
-void _Watchdog_Insert (
- Chain_Control *header,
- Watchdog_Control *the_watchdog
-);
-
-/*
- * _Watchdog_Tickle
- *
- * DESCRIPTION:
- *
- * This routine is invoked at appropriate intervals to update
- * the HEADER watchdog chain.
- */
-
-void _Watchdog_Tickle (
- Chain_Control *header
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/watchdog.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/score/wkspace.h b/c/src/exec/score/include/rtems/score/wkspace.h
deleted file mode 100644
index 3b4b84f95f..0000000000
--- a/c/src/exec/score/include/rtems/score/wkspace.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* wkspace.h
- *
- * This include file contains information related to the
- * RAM Workspace. This Handler provides mechanisms which can be used to
- * define, initialize and manipulate the workspace.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WORKSPACE_h
-#define __WORKSPACE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/heap.h>
-#include <rtems/score/interr.h>
-
-/*
- * The following is used to manage the Workspace.
- *
- */
-
-SCORE_EXTERN Heap_Control _Workspace_Area; /* executive heap header */
-
-/*
- * _Workspace_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _Workspace_Handler_initialization(
- void *starting_address,
- unsigned32 size
-);
-
-/*
- * _Workspace_Allocate_or_fatal_error
- *
- * DESCRIPTION:
- *
- * This routine returns the address of a block of memory of size
- * bytes. If a block of the appropriate size cannot be allocated
- * from the workspace, then the internal error handler is invoked.
- */
-
-void *_Workspace_Allocate_or_fatal_error(
- unsigned32 size
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/wkspace.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/include/rtems/system.h b/c/src/exec/score/include/rtems/system.h
deleted file mode 100644
index 5e1cc80ed5..0000000000
--- a/c/src/exec/score/include/rtems/system.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the executive. This must be the first include file
- * included in all internal RTEMS files.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SYSTEM_h
-#define __RTEMS_SYSTEM_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The target options include file defines all target dependent
- * parameters for this build of RTEMS. It must be included
- * first so the basic macro definitions are in place.
- */
-
-#include <rtems/score/targopts.h>
-
-/*
- * The following insures that all data is declared in the space
- * of the initialization routine for either the Initialization Manager
- * or the initialization file for the appropriate API. It is
- * referenced as "external" in every other file.
- */
-
-#ifdef SCORE_INIT
-#undef SCORE_EXTERN
-#define SCORE_EXTERN
-#else
-#undef SCORE_EXTERN
-#define SCORE_EXTERN extern
-#endif
-
-#ifdef SAPI_INIT
-#undef SAPI_EXTERN
-#define SAPI_EXTERN
-#else
-#undef SAPI_EXTERN
-#define SAPI_EXTERN extern
-#endif
-
-#ifdef RTEMS_API_INIT
-#undef RTEMS_EXTERN
-#define RTEMS_EXTERN
-#else
-#undef RTEMS_EXTERN
-#define RTEMS_EXTERN extern
-#endif
-
-#ifdef POSIX_API_INIT
-#undef POSIX_EXTERN
-#define POSIX_EXTERN
-#else
-#undef POSIX_EXTERN
-#define POSIX_EXTERN extern
-#endif
-
-/*
- * The following (in conjunction with compiler arguments) are used
- * to choose between the use of static inline functions and macro
- * functions. The static inline implementation allows better
- * type checking with no cost in code size or execution speed.
- */
-
-#ifdef USE_INLINES
-# ifdef __GNUC__
-# define RTEMS_INLINE_ROUTINE static __inline__
-# else
-# define RTEMS_INLINE_ROUTINE static inline
-# endif
-#else
-# define RTEMS_INLINE_ROUTINE
-#endif
-
-/*
- * Include a base set of files.
- */
-
-/*
- * XXX: Eventually proc_ptr needs to disappear!!!
- */
-
-typedef void * proc_ptr;
-
-/*
- * Define NULL
- */
-
-#ifndef NULL
-#define NULL 0 /* NULL value */
-#endif
-
-/*
- * Boolean constants
- */
-
-#if !defined( TRUE ) || (TRUE != 1)
-#undef TRUE
-#define TRUE (1)
-#endif
-
-#if !defined( FALSE ) || (FALSE != 0)
-#undef FALSE
-#define FALSE (0)
-#endif
-
-#include <rtems/score/cpu.h> /* processor specific information */
-
-#define stringify( _x ) # _x
-
-#define RTEMS_offsetof(type, field) \
- ((unsigned32) &(((type *) 0)->field))
-
-/*
- * The following is the extern for the RTEMS version string.
- * The contents of this string are CPU specific.
- */
-
-extern const char _RTEMS_version[]; /* RTEMS version string */
-extern const char _Copyright_Notice[]; /* RTEMS copyright string */
-
-/*
- * The following defines the CPU dependent information table.
- */
-
-SCORE_EXTERN rtems_cpu_table _CPU_Table; /* CPU dependent info */
-
-/*
- * XXX weird RTEMS stuff
- */
-
-#define RTEMS_MAXIMUM_NAME_LENGTH 4
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/Makefile.in b/c/src/exec/score/inline/Makefile.in
deleted file mode 100644
index f97d3bfcf3..0000000000
--- a/c/src/exec/score/inline/Makefile.in
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-I_PIECES= address chain coremsg coremutex coresem heap \
- isr mppkt object objectmp priority stack states sysstate thread \
- threadmp tod tqdata userext watchdog wkspace
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems/score
diff --git a/c/src/exec/score/inline/address.inl b/c/src/exec/score/inline/address.inl
deleted file mode 100644
index 2e3049d08e..0000000000
--- a/c/src/exec/score/inline/address.inl
+++ /dev/null
@@ -1,120 +0,0 @@
-/* inline/address.inl
- *
- * This include file contains the bodies of the routines
- * about addresses which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_ADDRESSES_inl
-#define __INLINE_ADDRESSES_inl
-
-/*PAGE
- *
- * _Addresses_Add_offset
- *
- * DESCRIPTION:
- *
- * This function is used to add an offset to a base address.
- * It returns the resulting address. This address is typically
- * converted to an access type before being used further.
- */
-
-RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
- void *base,
- unsigned32 offset
-)
-{
- return (void *)((char *)base + offset);
-}
-
-/*PAGE
- *
- * _Addresses_Subtract_offset
- *
- * DESCRIPTION:
- *
- * This function is used to subtract an offset from a base
- * address. It returns the resulting address. This address is
- * typically converted to an access type before being used further.
- */
-
-RTEMS_INLINE_ROUTINE void *_Addresses_Subtract_offset (
- void *base,
- unsigned32 offset
-)
-{
- return (void *)((char *)base - offset);
-}
-
-/*PAGE
- *
- * _Addresses_Subtract
- *
- * DESCRIPTION:
- *
- * This function is used to subtract two addresses. It returns the
- * resulting offset.
- *
- * NOTE: The cast of an address to an unsigned32 makes this code
- * dependent on an addresses being thirty two bits.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Addresses_Subtract (
- void *left,
- void *right
-)
-{
- return ((char *) left - (char *) right);
-}
-
-/*PAGE
- *
- * _Addresses_Is_aligned
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the given address is correctly
- * aligned for this processor and FALSE otherwise. Proper alignment
- * is based on correctness and efficiency.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Addresses_Is_aligned (
- void *address
-)
-{
- return ( ( (unsigned32)address % CPU_ALIGNMENT ) == 0 );
-}
-
-/*PAGE
- *
- * _Addresses_Is_in_range
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the given address is within the
- * memory range specified and FALSE otherwise. base is the address
- * of the first byte in the memory range and limit is the address
- * of the last byte in the memory range. The base address is
- * assumed to be lower than the limit address.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Addresses_Is_in_range (
- void *address,
- void *base,
- void *limit
-)
-{
- return ( address >= base && address <= limit );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/chain.inl b/c/src/exec/score/inline/chain.inl
deleted file mode 100644
index 4bd80116ae..0000000000
--- a/c/src/exec/score/inline/chain.inl
+++ /dev/null
@@ -1,390 +0,0 @@
-/* inline/chain.inl
- *
- * This include file contains the bodies of the routines which are
- * associated with doubly linked chains and inlined.
- *
- * NOTE: The routines in this file are ordered from simple
- * to complex. No other Chain Handler routine is referenced
- * unless it has already been defined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_CHAIN_inl
-#define __INLINE_CHAIN_inl
-
-/*PAGE
- *
- * _Chain_Are_nodes_equal
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if LEFT and RIGHT are equal,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Are_nodes_equal(
- Chain_Node *left,
- Chain_Node *right
-)
-{
- return left == right;
-}
-
-/*PAGE
- *
- * _Chain_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_chain is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_null(
- Chain_Control *the_chain
-)
-{
- return ( the_chain == NULL );
-}
-
-/*PAGE
- *
- * _Chain_Is_null_node
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_null_node(
- Chain_Node *the_node
-)
-{
- return ( the_node == NULL );
-}
-
-/*PAGE
- *
- * _Chain_Head
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the first node on the chain.
- */
-
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head(
- Chain_Control *the_chain
-)
-{
- return (Chain_Node *) the_chain;
-}
-
-/*PAGE
- *
- * _Chain_Tail
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the last node on the chain.
- */
-
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
- Chain_Control *the_chain
-)
-{
- return (Chain_Node *) &the_chain->permanent_null;
-}
-
-/*PAGE
- *
- * _Chain_Is_empty
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if there a no nodes on the_chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_empty(
- Chain_Control *the_chain
-)
-{
- return ( the_chain->first == _Chain_Tail( the_chain ) );
-}
-
-/*PAGE
- *
- * _Chain_Is_first
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is the first node on a chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_first(
- Chain_Node *the_node
-)
-{
- return ( the_node->previous == NULL );
-}
-
-/*PAGE
- *
- * _Chain_Is_last
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is the last node on a chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_last(
- Chain_Node *the_node
-)
-{
- return ( the_node->next == NULL );
-}
-
-/*PAGE
- *
- * _Chain_Has_only_one_node
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if there is only one node on the_chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Has_only_one_node(
- Chain_Control *the_chain
-)
-{
- return ( the_chain->first == the_chain->last );
-}
-
-/*PAGE
- *
- * _Chain_Is_head
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is the head of the_chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_head(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- return ( the_node == _Chain_Head( the_chain ) );
-}
-
-/*PAGE
- *
- * _Chain_Is_tail
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is the tail of the_chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_tail(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- return ( the_node == _Chain_Tail( the_chain ) );
-}
-
-/*PAGE
- *
- * Chain_Initialize_empty
- *
- * DESCRIPTION:
- *
- * This routine initializes the specified chain to contain zero nodes.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
- Chain_Control *the_chain
-)
-{
- the_chain->first = _Chain_Tail( the_chain );
- the_chain->permanent_null = NULL;
- the_chain->last = _Chain_Head( the_chain );
-}
-
-/*PAGE
- *
- * _Chain_Extract_unprotected
- *
- * DESCRIPTION:
- *
- * This routine extracts the_node from the chain on which it resides.
- * It does NOT disable interrupts to insure the atomicity of the
- * extract operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Extract_unprotected(
- Chain_Node *the_node
-)
-{
- Chain_Node *next;
- Chain_Node *previous;
-
- next = the_node->next;
- previous = the_node->previous;
- next->previous = previous;
- previous->next = next;
-}
-
-/*PAGE
- *
- * _Chain_Get_first_unprotected
- *
- * DESCRIPTION:
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. It does NOT disable interrupts to insure
- * the atomicity of the get operation.
- */
-
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected(
- Chain_Control *the_chain
-)
-{
- Chain_Node *return_node;
- Chain_Node *new_first;
-
- return_node = the_chain->first;
- new_first = return_node->next;
- the_chain->first = new_first;
- new_first->previous = _Chain_Head( the_chain );
-
- return return_node;
-}
-
-/*PAGE
- *
- * Chain_Get_unprotected
- *
- * DESCRIPTION:
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. If the_chain is empty, then NULL is returned.
- * It does NOT disable interrupts to insure the atomicity of the
- * get operation.
- */
-
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
- Chain_Control *the_chain
-)
-{
- if ( !_Chain_Is_empty( the_chain ) )
- return _Chain_Get_first_unprotected( the_chain );
- else
- return NULL;
-}
-
-/*PAGE
- *
- * _Chain_Insert_unprotected
- *
- * DESCRIPTION:
- *
- * This routine inserts the_node on a chain immediately following
- * after_node. It does NOT disable interrupts to insure the atomicity
- * of the extract operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Insert_unprotected(
- Chain_Node *after_node,
- Chain_Node *the_node
-)
-{
- Chain_Node *before_node;
-
- the_node->previous = after_node;
- before_node = after_node->next;
- after_node->next = the_node;
- the_node->next = before_node;
- before_node->previous = the_node;
-}
-
-/*PAGE
- *
- * _Chain_Append_unprotected
- *
- * DESCRIPTION:
- *
- * This routine appends the_node onto the end of the_chain.
- * It does NOT disable interrupts to insure the atomicity of the
- * append operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- Chain_Node *old_last_node;
-
- the_node->next = _Chain_Tail( the_chain );
- old_last_node = the_chain->last;
- the_chain->last = the_node;
- old_last_node->next = the_node;
- the_node->previous = old_last_node;
-}
-
-/*PAGE
- *
- * _Chain_Prepend_unprotected
- *
- * DESCRIPTION:
- *
- * This routine prepends the_node onto the front of the_chain.
- * It does NOT disable interrupts to insure the atomicity of the
- * prepend operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- _Chain_Insert_unprotected( _Chain_Head( the_chain ), the_node );
-
-}
-
-/*PAGE
- *
- * _Chain_Prepend
- *
- * DESCRIPTION:
- *
- * This routine prepends the_node onto the front of the_chain.
- * It disables interrupts to insure the atomicity of the
- * prepend operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Prepend(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- _Chain_Insert( _Chain_Head( the_chain ), the_node );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/coremsg.inl b/c/src/exec/score/inline/coremsg.inl
deleted file mode 100644
index a43b0e7b06..0000000000
--- a/c/src/exec/score/inline/coremsg.inl
+++ /dev/null
@@ -1,260 +0,0 @@
-/* coremsg.inl
- *
- * This include file contains the static inline implementation of all
- * inlined routines in the Core Message Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __CORE_MESSAGE_QUEUE_inl
-#define __CORE_MESSAGE_QUEUE_inl
-
-#include <string.h> /* needed for memcpy */
-
-/*PAGE
- *
- * _CORE_message_queue_Send
- *
- * DESCRIPTION:
- *
- * This routine sends a message to the end of the specified message queue.
- */
-
-RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Send(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support
-)
-{
- return _CORE_message_queue_Submit(
- the_message_queue,
- buffer,
- size,
- id,
- api_message_queue_mp_support,
- CORE_MESSAGE_QUEUE_SEND_REQUEST
- );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Urgent
- *
- * DESCRIPTION:
- *
- * This routine sends a message to the front of the specified message queue.
- */
-
-RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Urgent(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support
-)
-{
- return _CORE_message_queue_Submit(
- the_message_queue,
- buffer,
- size,
- id,
- api_message_queue_mp_support,
- CORE_MESSAGE_QUEUE_URGENT_REQUEST
- );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Copy_buffer
- *
- * DESCRIPTION:
- *
- * This routine copies the contents of the source message buffer
- * to the destination message buffer.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Copy_buffer (
- void *source,
- void *destination,
- unsigned32 size
-)
-{
- memcpy(destination, source, size);
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Allocate_message_buffer
- *
- * DESCRIPTION:
- *
- * This function allocates a message buffer from the inactive
- * message buffer chain.
- */
-
-RTEMS_INLINE_ROUTINE CORE_message_queue_Buffer_control *
-_CORE_message_queue_Allocate_message_buffer (
- CORE_message_queue_Control *the_message_queue
-)
-{
- return (CORE_message_queue_Buffer_control *)
- _Chain_Get( &the_message_queue->Inactive_messages );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Free_message_buffer
- *
- * DESCRIPTION:
- *
- * This routine frees a message buffer to the inactive
- * message buffer chain.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer (
- CORE_message_queue_Control *the_message_queue,
- CORE_message_queue_Buffer_control *the_message
-)
-{
- _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Get_pending_message
- *
- * DESCRIPTION:
- *
- * This function removes the first message from the_message_queue
- * and returns a pointer to it.
- */
-
-RTEMS_INLINE_ROUTINE
- CORE_message_queue_Buffer_control *_CORE_message_queue_Get_pending_message (
- CORE_message_queue_Control *the_message_queue
-)
-{
- return (CORE_message_queue_Buffer_control *)
- _Chain_Get_unprotected( &the_message_queue->Pending_messages );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Is_priority
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_priority(
- CORE_message_queue_Attributes *the_attribute
-)
-{
- return (the_attribute->discipline == CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY);
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Append
- *
- * DESCRIPTION:
- *
- * This routine places the_message at the rear of the outstanding
- * messages on the_message_queue.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Append (
- CORE_message_queue_Control *the_message_queue,
- CORE_message_queue_Buffer_control *the_message
-)
-{
- _Chain_Append( &the_message_queue->Pending_messages, &the_message->Node );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Prepend
- *
- * DESCRIPTION:
- *
- * This routine places the_message at the front of the outstanding
- * messages on the_message_queue.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Prepend (
- CORE_message_queue_Control *the_message_queue,
- CORE_message_queue_Buffer_control *the_message
-)
-{
- _Chain_Prepend(
- &the_message_queue->Pending_messages,
- &the_message->Node
- );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_message_queue is TRUE and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_null (
- CORE_message_queue_Control *the_message_queue
-)
-{
- return ( the_message_queue == NULL );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Is_notify_enabled
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if notification is enabled on this message
- * queue and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_notify_enabled (
- CORE_message_queue_Control *the_message_queue
-)
-{
- return (the_message_queue->notify_handler != NULL);
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Set_notify
- *
- * DESCRIPTION:
- *
- * This routine initializes the notification information for the_message_queue.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Set_notify (
- CORE_message_queue_Control *the_message_queue,
- CORE_message_queue_Notify_Handler the_handler,
- void *the_argument
-)
-{
- the_message_queue->notify_handler = the_handler;
- the_message_queue->notify_argument = the_argument;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/coremutex.inl b/c/src/exec/score/inline/coremutex.inl
deleted file mode 100644
index 457f7c7d7d..0000000000
--- a/c/src/exec/score/inline/coremutex.inl
+++ /dev/null
@@ -1,124 +0,0 @@
-/* inline/coremutex.inl
- *
- * This include file contains all of the inlined routines associated
- * with the CORE mutexes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_CORE_MUTEX_inl
-#define __INLINE_CORE_MUTEX_inl
-
-/*PAGE
- *
- * _CORE_mutex_Is_locked
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex specified is locked and FALSE
- * otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_locked(
- CORE_mutex_Control *the_mutex
-)
-{
- return the_mutex->lock == CORE_MUTEX_LOCKED;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_fifo
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex's wait discipline is FIFO and FALSE
- * otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_fifo(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_FIFO;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_priority
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex's wait discipline is PRIORITY and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_priority(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_inherit_priority
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex's wait discipline is
- * INHERIT_PRIORITY and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_inherit_priority(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_priority_ceiling
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex's wait discipline is
- * PRIORITY_CEILING and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_priority_ceiling(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_nesting_allowed
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex allows a task to obtain a
- * semaphore more than once and nest.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_nesting_allowed(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->allow_nesting == TRUE;
-
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/coresem.inl b/c/src/exec/score/inline/coresem.inl
deleted file mode 100644
index 7ef8c93990..0000000000
--- a/c/src/exec/score/inline/coresem.inl
+++ /dev/null
@@ -1,54 +0,0 @@
-/* inline/coresem.inl
- *
- * This include file contains all of the inlined routines associated
- * with the CORE semaphore.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_CORE_SEMAPHORE_inl
-#define __INLINE_CORE_SEMAPHORE_inl
-
-/*PAGE
- *
- * _CORE_semaphore_Is_priority
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_semaphore_Is_priority(
- CORE_semaphore_Attributes *the_attribute
-)
-{
- return ( the_attribute->discipline == CORE_SEMAPHORE_DISCIPLINES_PRIORITY );
-}
-
-/*PAGE
- *
- * _CORE_semaphore_Get_count
- *
- * DESCRIPTION:
- *
- * This routine returns the current count associated with the semaphore.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _CORE_semaphore_Get_count(
- CORE_semaphore_Control *the_semaphore
-)
-{
- return the_semaphore->count;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/heap.inl b/c/src/exec/score/inline/heap.inl
deleted file mode 100644
index 92936f8135..0000000000
--- a/c/src/exec/score/inline/heap.inl
+++ /dev/null
@@ -1,274 +0,0 @@
-/* heap.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines from the heap handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __HEAP_inl
-#define __HEAP_inl
-
-#include <rtems/score/address.h>
-
-/*PAGE
- *
- * _Heap_Head
- *
- * DESCRIPTION:
- *
- * This function returns the head of the specified heap.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Head (
- Heap_Control *the_heap
-)
-{
- return (Heap_Block *)&the_heap->start;
-}
-
-/*PAGE
- *
- * _Heap_Tail
- *
- * DESCRIPTION:
- *
- * This function returns the tail of the specified heap.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Tail (
- Heap_Control *the_heap
-)
-{
- return (Heap_Block *)&the_heap->final;
-}
-
-/*PAGE
- *
- * _Heap_Previous_block
- *
- * DESCRIPTION:
- *
- * This function returns the address of the block which physically
- * precedes the_block in memory.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Previous_block (
- Heap_Block *the_block
-)
-{
- return (Heap_Block *) _Addresses_Subtract_offset(
- (void *)the_block,
- the_block->back_flag & ~ HEAP_BLOCK_USED
- );
-}
-
-/*PAGE
- *
- * _Heap_Next_block
- *
- * DESCRIPTION:
- *
- * This function returns the address of the block which physically
- * follows the_block in memory.
- *
- * NOTE: Next_block assumes that the block is free.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Next_block (
- Heap_Block *the_block
-)
-{
- return (Heap_Block *) _Addresses_Add_offset(
- (void *)the_block,
- the_block->front_flag & ~ HEAP_BLOCK_USED
- );
-}
-
-/*PAGE
- *
- * _Heap_Block_at
- *
- * DESCRIPTION:
- *
- * This function calculates and returns a block's location (address)
- * in the heap based upon a base address and an offset.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
- void *base,
- unsigned32 offset
-)
-{
- return (Heap_Block *) _Addresses_Add_offset( (void *)base, offset );
-}
-
-/*PAGE
- *
- * _Heap_User_block_at
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_User_block_at(
- void *base
-)
-{
- unsigned32 offset;
-
- offset = *(((unsigned32 *) base) - 1);
- return _Heap_Block_at( base, -offset + -HEAP_BLOCK_USED_OVERHEAD);
-}
-
-/*PAGE
- *
- * _Heap_Is_previous_block_free
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the previous block of the_block
- * is free, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_previous_block_free (
- Heap_Block *the_block
-)
-{
- return !(the_block->back_flag & HEAP_BLOCK_USED);
-}
-
-/*PAGE
- *
- * _Heap_Is_block_free
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the block is free, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_block_free (
- Heap_Block *the_block
-)
-{
- return !(the_block->front_flag & HEAP_BLOCK_USED);
-}
-
-/*PAGE
- *
- * _Heap_Is_block_used
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the block is currently allocated,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_block_used (
- Heap_Block *the_block
-)
-{
- return (the_block->front_flag & HEAP_BLOCK_USED);
-}
-
-/*PAGE
- *
- * _Heap_Block_size
- *
- * DESCRIPTION:
- *
- * This function returns the size of the_block in bytes.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Heap_Block_size (
- Heap_Block *the_block
-)
-{
- return (the_block->front_flag & ~HEAP_BLOCK_USED);
-}
-
-/*PAGE
- *
- * _Heap_Start_of_user_area
- *
- * DESCRIPTION:
- *
- * This function returns the starting address of the portion of the block
- * which the user may access.
- */
-
-RTEMS_INLINE_ROUTINE void *_Heap_Start_of_user_area (
- Heap_Block *the_block
-)
-{
- return (void *) &the_block->next;
-}
-
-/*PAGE
- *
- * _Heap_Is_block_in
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_block is within the memory area
- * managed by the_heap, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_block_in (
- Heap_Control *the_heap,
- Heap_Block *the_block
-)
-{
- return _Addresses_Is_in_range( the_block, the_heap->start, the_heap->final );
-}
-
-/*PAGE
- *
- * _Heap_Is_page_size_valid
- *
- * DESCRIPTION:
- *
- * This function validates a specified heap page size. If the page size
- * is 0 or if lies outside a page size alignment boundary it is invalid
- * and FALSE is returned. Otherwise, the page size is valid and TRUE is
- * returned.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_page_size_valid(
- unsigned32 page_size
-)
-{
- return ((page_size != 0) &&
- ((page_size % CPU_HEAP_ALIGNMENT) == 0));
-}
-
-/*PAGE
- *
- * _Heap_Build_flag
- *
- * DESCRIPTION:
- *
- * This function returns the block flag composed of size and in_use_flag.
- * The flag returned is suitable for use as a back or front flag in a
- * heap block.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Heap_Build_flag (
- unsigned32 size,
- unsigned32 in_use_flag
-)
-{
- return size | in_use_flag;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/isr.inl b/c/src/exec/score/inline/isr.inl
deleted file mode 100644
index 6bd6e09d16..0000000000
--- a/c/src/exec/score/inline/isr.inl
+++ /dev/null
@@ -1,73 +0,0 @@
-/* isr.inl
- *
- * This include file contains the static implementation of all
- * inlined routines in the Interrupt Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __ISR_inl
-#define __ISR_inl
-
-/*PAGE
- *
- * _ISR_Is_in_progress
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the processor is currently servicing
- * and interrupt and FALSE otherwise. A return value of TRUE indicates
- * that the caller is an interrupt service routine, NOT a thread. The
- * directives available to an interrupt service routine are restricted.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ISR_Is_in_progress( void )
-{
- return (_ISR_Nest_level != 0);
-}
-
-/*PAGE
- *
- * _ISR_Is_vector_number_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the vector is a valid vector number
- * for this processor and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ISR_Is_vector_number_valid (
- unsigned32 vector
-)
-{
- return ( vector <= CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER );
-}
-
-/*PAGE
- *
- * _ISR_Is_valid_user_handler
- *
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if handler is the entry point of a valid
- * use interrupt service routine and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ISR_Is_valid_user_handler (
- void *handler
-)
-{
- return ( handler != NULL);
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/mppkt.inl b/c/src/exec/score/inline/mppkt.inl
deleted file mode 100644
index 4be286b294..0000000000
--- a/c/src/exec/score/inline/mppkt.inl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* inline/mppkt.inl
- *
- * This package is the implementation of the Packet Handler
- * routines which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_MP_PACKET_inl
-#define __INLINE_MP_PACKET_inl
-
-/*PAGE
- *
- * _Mp_packet_Is_valid_packet_class
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the the_packet_class is valid,
- * and FALSE otherwise.
- *
- * NOTE: Check for lower bounds (MP_PACKET_CLASSES_FIRST ) is unnecessary
- * because this enum starts at lower bound of zero.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Mp_packet_Is_valid_packet_class (
- MP_packet_Classes the_packet_class
-)
-{
- return ( the_packet_class <= MP_PACKET_CLASSES_LAST );
-}
-
-/*PAGE
- *
- * _Mp_packet_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the the_packet_class is null,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Mp_packet_Is_null (
- MP_packet_Prefix *the_packet
-)
-{
- return the_packet == NULL;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/object.inl b/c/src/exec/score/inline/object.inl
deleted file mode 100644
index 7e4d12aeec..0000000000
--- a/c/src/exec/score/inline/object.inl
+++ /dev/null
@@ -1,244 +0,0 @@
-/* object.inl
- *
- * This include file contains the static inline implementation of all
- * of the inlined routines in the Object Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OBJECTS_inl
-#define __OBJECTS_inl
-
-/*PAGE
- *
- * _Objects_Build_id
- *
- * DESCRIPTION:
- *
- * This function builds an object's id from the processor node and index
- * values specified.
- */
-
-RTEMS_INLINE_ROUTINE Objects_Id _Objects_Build_id(
- Objects_Classes the_class,
- unsigned32 node,
- unsigned32 index
-)
-{
- return ( (the_class << OBJECTS_CLASS_START_BIT) |
- (node << OBJECTS_NODE_START_BIT) |
- (index << OBJECTS_INDEX_START_BIT) );
-}
-
-/*PAGE
- *
- * _Objects_Get_class
- *
- * DESCRIPTION:
- *
- * This function returns the class portion of the ID.
- */
-
-RTEMS_INLINE_ROUTINE Objects_Classes _Objects_Get_class(
- Objects_Id id
-)
-{
- return (Objects_Classes)
- ((id >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS);
-}
-
-
-/*PAGE
- *
- * _Objects_Get_node
- *
- * DESCRIPTION:
- *
- * This function returns the node portion of the ID.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Objects_Get_node(
- Objects_Id id
-)
-{
- return (id >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS;
-}
-
-/*PAGE
- *
- * _Objects_Get_index
- *
- * DESCRIPTION:
- *
- * This function returns the index portion of the ID.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Objects_Get_index(
- Objects_Id id
-)
-{
- return (id >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS;
-}
-
-/*PAGE
- *
- * _Objects_Is_class_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the class is valid.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_Is_class_valid(
- Objects_Classes the_class
-)
-{
- return the_class && the_class <= OBJECTS_CLASSES_LAST;
-}
-
-/*PAGE
- *
- * _Objects_Is_local_node
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the node is of the local object, and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_Is_local_node(
- unsigned32 node
-)
-{
- return ( node == _Objects_Local_node );
-}
-
-/*PAGE
- *
- * _Objects_Is_local_id
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the id is of a local object, and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_Is_local_id(
- Objects_Id id
-)
-{
- return _Objects_Is_local_node( _Objects_Get_node(id) );
-}
-
-/*PAGE
- *
- * _Objects_Are_ids_equal
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if left and right are equal,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_Are_ids_equal(
- Objects_Id left,
- Objects_Id right
-)
-{
- return ( left == right );
-}
-
-/*PAGE
- *
- * _Objects_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a object control block from
- * the inactive chain of free object control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Objects_Control *_Objects_Allocate(
- Objects_Information *information
-)
-{
- return (Objects_Control *) _Chain_Get( &information->Inactive );
-}
-
-/*PAGE
- *
- * _Objects_Free
- *
- * DESCRIPTION:
- *
- * This function frees a object control block to the
- * inactive chain of free object control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Objects_Free(
- Objects_Information *information,
- Objects_Control *the_object
-)
-{
- _Chain_Append( &information->Inactive, &the_object->Node );
-}
-
-/*PAGE
- *
- * _Objects_Open
- *
- * DESCRIPTION:
- *
- * This function places the_object control pointer and object name
- * in the Local Pointer and Local Name Tables, respectively.
- */
-
-RTEMS_INLINE_ROUTINE void _Objects_Open(
- Objects_Information *information,
- Objects_Control *the_object,
- Objects_Name name
-)
-{
- unsigned32 index;
-
- index = _Objects_Get_index( the_object->id );
- information->local_table[ index ] = the_object;
-
- if ( information->is_string )
- _Objects_Copy_name_string( name, the_object->name );
- else
- _Objects_Copy_name_raw( name, the_object->name, information->name_length );
-}
-
-/*PAGE
- *
- * _Objects_Close
- *
- * DESCRIPTION:
- *
- * This function removes the_object control pointer and object name
- * in the Local Pointer and Local Name Tables.
- */
-
-RTEMS_INLINE_ROUTINE void _Objects_Close(
- Objects_Information *information,
- Objects_Control *the_object
-)
-{
- unsigned32 index;
-
- index = _Objects_Get_index( the_object->id );
- information->local_table[ index ] = (Objects_Control *) NULL;
- _Objects_Clear_name( the_object->name, information->name_length );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/objectmp.inl b/c/src/exec/score/inline/objectmp.inl
deleted file mode 100644
index f8fc62e129..0000000000
--- a/c/src/exec/score/inline/objectmp.inl
+++ /dev/null
@@ -1,73 +0,0 @@
-/* inline/objectmp.inl
- *
- * This include file contains the bodies of all inlined routines
- * which deal with global objects.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_MP_OBJECTS_inl
-#define __INLINE_MP_OBJECTS_inl
-
-/*PAGE
- *
- * _Objects_MP_Allocate_global_object
- *
- * DESCRIPTION:
- *
- * This function allocates a Global Object control block.
- */
-
-RTEMS_INLINE_ROUTINE Objects_MP_Control *_Objects_MP_Allocate_global_object (
- void
-)
-{
- return (Objects_MP_Control *)
- _Chain_Get( &_Objects_MP_Inactive_global_objects );
-}
-
-/*PAGE
- *
- * _Objects_MP_Free_global_object
- *
- * DESCRIPTION:
- *
- * This routine deallocates a Global Object control block.
- */
-
-RTEMS_INLINE_ROUTINE void _Objects_MP_Free_global_object (
- Objects_MP_Control *the_object
-)
-{
- _Chain_Append(
- &_Objects_MP_Inactive_global_objects,
- &the_object->Object.Node
- );
-}
-
-/*PAGE
- *
- * _Objects_MP_Is_null_global_object
- *
- * DESCRIPTION:
- *
- * This function returns whether the global object is NULL or not.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_MP_Is_null_global_object (
- Objects_MP_Control *the_object
-)
-{
- return( the_object == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/priority.inl b/c/src/exec/score/inline/priority.inl
deleted file mode 100644
index b19d157976..0000000000
--- a/c/src/exec/score/inline/priority.inl
+++ /dev/null
@@ -1,247 +0,0 @@
-/* priority.inl
- *
- * This file contains the static inline implementation of all inlined
- * routines in the Priority Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PRIORITY_inl
-#define __PRIORITY_inl
-
-#include <rtems/score/bitfield.h>
-
-/*PAGE
- *
- * _Priority_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-RTEMS_INLINE_ROUTINE void _Priority_Handler_initialization( void )
-{
- unsigned32 index;
-
- _Priority_Major_bit_map = 0;
- for ( index=0 ; index <16 ; index++ )
- _Priority_Bit_map[ index ] = 0;
-}
-
-/*PAGE
- *
- * _Priority_Is_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_priority if valid for a
- * user task, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Priority_Is_valid (
- Priority_Control the_priority
-)
-{
- /*
- * Since PRIORITY_MINIMUM is 0 and priorities are stored unsigned,
- * then checking for less than 0 is unnecessary.
- */
-
- return ( the_priority <= PRIORITY_MAXIMUM );
-}
-
-/*PAGE
- *
- * _Priority_Major
- *
- * DESCRIPTION:
- *
- * This function returns the major portion of the_priority.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Priority_Major (
- Priority_Control the_priority
-)
-{
- return ( the_priority / 16 );
-}
-
-/*PAGE
- *
- * _Priority_Minor
- *
- * DESCRIPTION:
- *
- * This function returns the minor portion of the_priority.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Priority_Minor (
- Priority_Control the_priority
-)
-{
- return ( the_priority % 16 );
-}
-
-#if ( CPU_USE_GENERIC_BITFIELD_CODE == TRUE )
-
-/*PAGE
- *
- * _Priority_Mask
- *
- * DESCRIPTION:
- *
- * This function returns the mask associated with the major or minor
- * number passed to it.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Priority_Mask (
- unsigned32 bit_number
-)
-{
- return (0x8000 >> bit_number);
-}
-
-
-/*PAGE
- *
- * _Priority_Bits_index
- *
- * DESCRIPTION:
- *
- * This function translates the bit numbers returned by the bit scan
- * of a priority bit field into something suitable for use as
- * a major or minor component of a priority.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Priority_Bits_index (
- unsigned32 bit_number
-)
-{
- return bit_number;
-}
-
-#endif
-
-/*PAGE
- *
- * _Priority_Add_to_bit_map
- *
- * DESCRIPTION:
- *
- * This routine uses the_priority_map to update the priority
- * bit maps to indicate that a thread has been readied.
- */
-
-RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map (
- Priority_Information *the_priority_map
-)
-{
- *the_priority_map->minor |= the_priority_map->ready_minor;
- _Priority_Major_bit_map |= the_priority_map->ready_major;
-}
-
-/*PAGE
- *
- * _Priority_Remove_from_bit_map
- *
- * DESCRIPTION:
- *
- * This routine uses the_priority_map to update the priority
- * bit maps to indicate that a thread has been removed from the
- * ready state.
- */
-
-RTEMS_INLINE_ROUTINE void _Priority_Remove_from_bit_map (
- Priority_Information *the_priority_map
-)
-{
- *the_priority_map->minor &= the_priority_map->block_minor;
- if ( *the_priority_map->minor == 0 )
- _Priority_Major_bit_map &= the_priority_map->block_major;
-}
-
-/*PAGE
- *
- * _Priority_Get_highest
- *
- * DESCRIPTION:
- *
- * This function returns the priority of the highest priority
- * ready thread.
- */
-
-RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void )
-{
- Priority_Bit_map_control minor;
- Priority_Bit_map_control major;
-
- _Bitfield_Find_first_bit( _Priority_Major_bit_map, major );
- _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
-
- return (_Priority_Bits_index( major ) << 4) +
- _Priority_Bits_index( minor );
-}
-
-/*PAGE
- *
- * _Priority_Initialize_information
- *
- * DESCRIPTION:
- *
- * This routine initializes the_priority_map so that it
- * contains the information necessary to manage a thread
- * at new_priority.
- */
-
-RTEMS_INLINE_ROUTINE void _Priority_Initialize_information(
- Priority_Information *the_priority_map,
- Priority_Control new_priority
-)
-{
- Priority_Bit_map_control major;
- Priority_Bit_map_control minor;
- Priority_Bit_map_control mask;
-
- major = _Priority_Major( new_priority );
- minor = _Priority_Minor( new_priority );
-
- the_priority_map->minor =
- &_Priority_Bit_map[ _Priority_Bits_index(major) ];
-
- mask = _Priority_Mask( major );
- the_priority_map->ready_major = mask;
- the_priority_map->block_major = ~mask;
-
- mask = _Priority_Mask( minor );
- the_priority_map->ready_minor = mask;
- the_priority_map->block_minor = ~mask;
-}
-
-/*PAGE
- *
- * _Priority_Is_group_empty
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority GROUP is empty, and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Priority_Is_group_empty (
- Priority_Control the_priority
-)
-{
- return the_priority == 0;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/Makefile.in b/c/src/exec/score/inline/rtems/score/Makefile.in
deleted file mode 100644
index f97d3bfcf3..0000000000
--- a/c/src/exec/score/inline/rtems/score/Makefile.in
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-I_PIECES= address chain coremsg coremutex coresem heap \
- isr mppkt object objectmp priority stack states sysstate thread \
- threadmp tod tqdata userext watchdog wkspace
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems/score
diff --git a/c/src/exec/score/inline/rtems/score/address.inl b/c/src/exec/score/inline/rtems/score/address.inl
deleted file mode 100644
index 2e3049d08e..0000000000
--- a/c/src/exec/score/inline/rtems/score/address.inl
+++ /dev/null
@@ -1,120 +0,0 @@
-/* inline/address.inl
- *
- * This include file contains the bodies of the routines
- * about addresses which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_ADDRESSES_inl
-#define __INLINE_ADDRESSES_inl
-
-/*PAGE
- *
- * _Addresses_Add_offset
- *
- * DESCRIPTION:
- *
- * This function is used to add an offset to a base address.
- * It returns the resulting address. This address is typically
- * converted to an access type before being used further.
- */
-
-RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
- void *base,
- unsigned32 offset
-)
-{
- return (void *)((char *)base + offset);
-}
-
-/*PAGE
- *
- * _Addresses_Subtract_offset
- *
- * DESCRIPTION:
- *
- * This function is used to subtract an offset from a base
- * address. It returns the resulting address. This address is
- * typically converted to an access type before being used further.
- */
-
-RTEMS_INLINE_ROUTINE void *_Addresses_Subtract_offset (
- void *base,
- unsigned32 offset
-)
-{
- return (void *)((char *)base - offset);
-}
-
-/*PAGE
- *
- * _Addresses_Subtract
- *
- * DESCRIPTION:
- *
- * This function is used to subtract two addresses. It returns the
- * resulting offset.
- *
- * NOTE: The cast of an address to an unsigned32 makes this code
- * dependent on an addresses being thirty two bits.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Addresses_Subtract (
- void *left,
- void *right
-)
-{
- return ((char *) left - (char *) right);
-}
-
-/*PAGE
- *
- * _Addresses_Is_aligned
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the given address is correctly
- * aligned for this processor and FALSE otherwise. Proper alignment
- * is based on correctness and efficiency.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Addresses_Is_aligned (
- void *address
-)
-{
- return ( ( (unsigned32)address % CPU_ALIGNMENT ) == 0 );
-}
-
-/*PAGE
- *
- * _Addresses_Is_in_range
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the given address is within the
- * memory range specified and FALSE otherwise. base is the address
- * of the first byte in the memory range and limit is the address
- * of the last byte in the memory range. The base address is
- * assumed to be lower than the limit address.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Addresses_Is_in_range (
- void *address,
- void *base,
- void *limit
-)
-{
- return ( address >= base && address <= limit );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/chain.inl b/c/src/exec/score/inline/rtems/score/chain.inl
deleted file mode 100644
index 4bd80116ae..0000000000
--- a/c/src/exec/score/inline/rtems/score/chain.inl
+++ /dev/null
@@ -1,390 +0,0 @@
-/* inline/chain.inl
- *
- * This include file contains the bodies of the routines which are
- * associated with doubly linked chains and inlined.
- *
- * NOTE: The routines in this file are ordered from simple
- * to complex. No other Chain Handler routine is referenced
- * unless it has already been defined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_CHAIN_inl
-#define __INLINE_CHAIN_inl
-
-/*PAGE
- *
- * _Chain_Are_nodes_equal
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if LEFT and RIGHT are equal,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Are_nodes_equal(
- Chain_Node *left,
- Chain_Node *right
-)
-{
- return left == right;
-}
-
-/*PAGE
- *
- * _Chain_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_chain is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_null(
- Chain_Control *the_chain
-)
-{
- return ( the_chain == NULL );
-}
-
-/*PAGE
- *
- * _Chain_Is_null_node
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_null_node(
- Chain_Node *the_node
-)
-{
- return ( the_node == NULL );
-}
-
-/*PAGE
- *
- * _Chain_Head
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the first node on the chain.
- */
-
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head(
- Chain_Control *the_chain
-)
-{
- return (Chain_Node *) the_chain;
-}
-
-/*PAGE
- *
- * _Chain_Tail
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the last node on the chain.
- */
-
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
- Chain_Control *the_chain
-)
-{
- return (Chain_Node *) &the_chain->permanent_null;
-}
-
-/*PAGE
- *
- * _Chain_Is_empty
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if there a no nodes on the_chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_empty(
- Chain_Control *the_chain
-)
-{
- return ( the_chain->first == _Chain_Tail( the_chain ) );
-}
-
-/*PAGE
- *
- * _Chain_Is_first
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is the first node on a chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_first(
- Chain_Node *the_node
-)
-{
- return ( the_node->previous == NULL );
-}
-
-/*PAGE
- *
- * _Chain_Is_last
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is the last node on a chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_last(
- Chain_Node *the_node
-)
-{
- return ( the_node->next == NULL );
-}
-
-/*PAGE
- *
- * _Chain_Has_only_one_node
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if there is only one node on the_chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Has_only_one_node(
- Chain_Control *the_chain
-)
-{
- return ( the_chain->first == the_chain->last );
-}
-
-/*PAGE
- *
- * _Chain_Is_head
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is the head of the_chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_head(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- return ( the_node == _Chain_Head( the_chain ) );
-}
-
-/*PAGE
- *
- * _Chain_Is_tail
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is the tail of the_chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_tail(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- return ( the_node == _Chain_Tail( the_chain ) );
-}
-
-/*PAGE
- *
- * Chain_Initialize_empty
- *
- * DESCRIPTION:
- *
- * This routine initializes the specified chain to contain zero nodes.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
- Chain_Control *the_chain
-)
-{
- the_chain->first = _Chain_Tail( the_chain );
- the_chain->permanent_null = NULL;
- the_chain->last = _Chain_Head( the_chain );
-}
-
-/*PAGE
- *
- * _Chain_Extract_unprotected
- *
- * DESCRIPTION:
- *
- * This routine extracts the_node from the chain on which it resides.
- * It does NOT disable interrupts to insure the atomicity of the
- * extract operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Extract_unprotected(
- Chain_Node *the_node
-)
-{
- Chain_Node *next;
- Chain_Node *previous;
-
- next = the_node->next;
- previous = the_node->previous;
- next->previous = previous;
- previous->next = next;
-}
-
-/*PAGE
- *
- * _Chain_Get_first_unprotected
- *
- * DESCRIPTION:
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. It does NOT disable interrupts to insure
- * the atomicity of the get operation.
- */
-
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected(
- Chain_Control *the_chain
-)
-{
- Chain_Node *return_node;
- Chain_Node *new_first;
-
- return_node = the_chain->first;
- new_first = return_node->next;
- the_chain->first = new_first;
- new_first->previous = _Chain_Head( the_chain );
-
- return return_node;
-}
-
-/*PAGE
- *
- * Chain_Get_unprotected
- *
- * DESCRIPTION:
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. If the_chain is empty, then NULL is returned.
- * It does NOT disable interrupts to insure the atomicity of the
- * get operation.
- */
-
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
- Chain_Control *the_chain
-)
-{
- if ( !_Chain_Is_empty( the_chain ) )
- return _Chain_Get_first_unprotected( the_chain );
- else
- return NULL;
-}
-
-/*PAGE
- *
- * _Chain_Insert_unprotected
- *
- * DESCRIPTION:
- *
- * This routine inserts the_node on a chain immediately following
- * after_node. It does NOT disable interrupts to insure the atomicity
- * of the extract operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Insert_unprotected(
- Chain_Node *after_node,
- Chain_Node *the_node
-)
-{
- Chain_Node *before_node;
-
- the_node->previous = after_node;
- before_node = after_node->next;
- after_node->next = the_node;
- the_node->next = before_node;
- before_node->previous = the_node;
-}
-
-/*PAGE
- *
- * _Chain_Append_unprotected
- *
- * DESCRIPTION:
- *
- * This routine appends the_node onto the end of the_chain.
- * It does NOT disable interrupts to insure the atomicity of the
- * append operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- Chain_Node *old_last_node;
-
- the_node->next = _Chain_Tail( the_chain );
- old_last_node = the_chain->last;
- the_chain->last = the_node;
- old_last_node->next = the_node;
- the_node->previous = old_last_node;
-}
-
-/*PAGE
- *
- * _Chain_Prepend_unprotected
- *
- * DESCRIPTION:
- *
- * This routine prepends the_node onto the front of the_chain.
- * It does NOT disable interrupts to insure the atomicity of the
- * prepend operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- _Chain_Insert_unprotected( _Chain_Head( the_chain ), the_node );
-
-}
-
-/*PAGE
- *
- * _Chain_Prepend
- *
- * DESCRIPTION:
- *
- * This routine prepends the_node onto the front of the_chain.
- * It disables interrupts to insure the atomicity of the
- * prepend operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Prepend(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- _Chain_Insert( _Chain_Head( the_chain ), the_node );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/coremsg.inl b/c/src/exec/score/inline/rtems/score/coremsg.inl
deleted file mode 100644
index a43b0e7b06..0000000000
--- a/c/src/exec/score/inline/rtems/score/coremsg.inl
+++ /dev/null
@@ -1,260 +0,0 @@
-/* coremsg.inl
- *
- * This include file contains the static inline implementation of all
- * inlined routines in the Core Message Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __CORE_MESSAGE_QUEUE_inl
-#define __CORE_MESSAGE_QUEUE_inl
-
-#include <string.h> /* needed for memcpy */
-
-/*PAGE
- *
- * _CORE_message_queue_Send
- *
- * DESCRIPTION:
- *
- * This routine sends a message to the end of the specified message queue.
- */
-
-RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Send(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support
-)
-{
- return _CORE_message_queue_Submit(
- the_message_queue,
- buffer,
- size,
- id,
- api_message_queue_mp_support,
- CORE_MESSAGE_QUEUE_SEND_REQUEST
- );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Urgent
- *
- * DESCRIPTION:
- *
- * This routine sends a message to the front of the specified message queue.
- */
-
-RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Urgent(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support
-)
-{
- return _CORE_message_queue_Submit(
- the_message_queue,
- buffer,
- size,
- id,
- api_message_queue_mp_support,
- CORE_MESSAGE_QUEUE_URGENT_REQUEST
- );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Copy_buffer
- *
- * DESCRIPTION:
- *
- * This routine copies the contents of the source message buffer
- * to the destination message buffer.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Copy_buffer (
- void *source,
- void *destination,
- unsigned32 size
-)
-{
- memcpy(destination, source, size);
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Allocate_message_buffer
- *
- * DESCRIPTION:
- *
- * This function allocates a message buffer from the inactive
- * message buffer chain.
- */
-
-RTEMS_INLINE_ROUTINE CORE_message_queue_Buffer_control *
-_CORE_message_queue_Allocate_message_buffer (
- CORE_message_queue_Control *the_message_queue
-)
-{
- return (CORE_message_queue_Buffer_control *)
- _Chain_Get( &the_message_queue->Inactive_messages );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Free_message_buffer
- *
- * DESCRIPTION:
- *
- * This routine frees a message buffer to the inactive
- * message buffer chain.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer (
- CORE_message_queue_Control *the_message_queue,
- CORE_message_queue_Buffer_control *the_message
-)
-{
- _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Get_pending_message
- *
- * DESCRIPTION:
- *
- * This function removes the first message from the_message_queue
- * and returns a pointer to it.
- */
-
-RTEMS_INLINE_ROUTINE
- CORE_message_queue_Buffer_control *_CORE_message_queue_Get_pending_message (
- CORE_message_queue_Control *the_message_queue
-)
-{
- return (CORE_message_queue_Buffer_control *)
- _Chain_Get_unprotected( &the_message_queue->Pending_messages );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Is_priority
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_priority(
- CORE_message_queue_Attributes *the_attribute
-)
-{
- return (the_attribute->discipline == CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY);
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Append
- *
- * DESCRIPTION:
- *
- * This routine places the_message at the rear of the outstanding
- * messages on the_message_queue.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Append (
- CORE_message_queue_Control *the_message_queue,
- CORE_message_queue_Buffer_control *the_message
-)
-{
- _Chain_Append( &the_message_queue->Pending_messages, &the_message->Node );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Prepend
- *
- * DESCRIPTION:
- *
- * This routine places the_message at the front of the outstanding
- * messages on the_message_queue.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Prepend (
- CORE_message_queue_Control *the_message_queue,
- CORE_message_queue_Buffer_control *the_message
-)
-{
- _Chain_Prepend(
- &the_message_queue->Pending_messages,
- &the_message->Node
- );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_message_queue is TRUE and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_null (
- CORE_message_queue_Control *the_message_queue
-)
-{
- return ( the_message_queue == NULL );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Is_notify_enabled
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if notification is enabled on this message
- * queue and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_notify_enabled (
- CORE_message_queue_Control *the_message_queue
-)
-{
- return (the_message_queue->notify_handler != NULL);
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Set_notify
- *
- * DESCRIPTION:
- *
- * This routine initializes the notification information for the_message_queue.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Set_notify (
- CORE_message_queue_Control *the_message_queue,
- CORE_message_queue_Notify_Handler the_handler,
- void *the_argument
-)
-{
- the_message_queue->notify_handler = the_handler;
- the_message_queue->notify_argument = the_argument;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/coremutex.inl b/c/src/exec/score/inline/rtems/score/coremutex.inl
deleted file mode 100644
index 457f7c7d7d..0000000000
--- a/c/src/exec/score/inline/rtems/score/coremutex.inl
+++ /dev/null
@@ -1,124 +0,0 @@
-/* inline/coremutex.inl
- *
- * This include file contains all of the inlined routines associated
- * with the CORE mutexes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_CORE_MUTEX_inl
-#define __INLINE_CORE_MUTEX_inl
-
-/*PAGE
- *
- * _CORE_mutex_Is_locked
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex specified is locked and FALSE
- * otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_locked(
- CORE_mutex_Control *the_mutex
-)
-{
- return the_mutex->lock == CORE_MUTEX_LOCKED;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_fifo
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex's wait discipline is FIFO and FALSE
- * otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_fifo(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_FIFO;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_priority
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex's wait discipline is PRIORITY and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_priority(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_inherit_priority
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex's wait discipline is
- * INHERIT_PRIORITY and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_inherit_priority(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_priority_ceiling
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex's wait discipline is
- * PRIORITY_CEILING and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_priority_ceiling(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_nesting_allowed
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex allows a task to obtain a
- * semaphore more than once and nest.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_nesting_allowed(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->allow_nesting == TRUE;
-
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/coresem.inl b/c/src/exec/score/inline/rtems/score/coresem.inl
deleted file mode 100644
index 7ef8c93990..0000000000
--- a/c/src/exec/score/inline/rtems/score/coresem.inl
+++ /dev/null
@@ -1,54 +0,0 @@
-/* inline/coresem.inl
- *
- * This include file contains all of the inlined routines associated
- * with the CORE semaphore.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_CORE_SEMAPHORE_inl
-#define __INLINE_CORE_SEMAPHORE_inl
-
-/*PAGE
- *
- * _CORE_semaphore_Is_priority
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_semaphore_Is_priority(
- CORE_semaphore_Attributes *the_attribute
-)
-{
- return ( the_attribute->discipline == CORE_SEMAPHORE_DISCIPLINES_PRIORITY );
-}
-
-/*PAGE
- *
- * _CORE_semaphore_Get_count
- *
- * DESCRIPTION:
- *
- * This routine returns the current count associated with the semaphore.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _CORE_semaphore_Get_count(
- CORE_semaphore_Control *the_semaphore
-)
-{
- return the_semaphore->count;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/heap.inl b/c/src/exec/score/inline/rtems/score/heap.inl
deleted file mode 100644
index 92936f8135..0000000000
--- a/c/src/exec/score/inline/rtems/score/heap.inl
+++ /dev/null
@@ -1,274 +0,0 @@
-/* heap.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines from the heap handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __HEAP_inl
-#define __HEAP_inl
-
-#include <rtems/score/address.h>
-
-/*PAGE
- *
- * _Heap_Head
- *
- * DESCRIPTION:
- *
- * This function returns the head of the specified heap.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Head (
- Heap_Control *the_heap
-)
-{
- return (Heap_Block *)&the_heap->start;
-}
-
-/*PAGE
- *
- * _Heap_Tail
- *
- * DESCRIPTION:
- *
- * This function returns the tail of the specified heap.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Tail (
- Heap_Control *the_heap
-)
-{
- return (Heap_Block *)&the_heap->final;
-}
-
-/*PAGE
- *
- * _Heap_Previous_block
- *
- * DESCRIPTION:
- *
- * This function returns the address of the block which physically
- * precedes the_block in memory.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Previous_block (
- Heap_Block *the_block
-)
-{
- return (Heap_Block *) _Addresses_Subtract_offset(
- (void *)the_block,
- the_block->back_flag & ~ HEAP_BLOCK_USED
- );
-}
-
-/*PAGE
- *
- * _Heap_Next_block
- *
- * DESCRIPTION:
- *
- * This function returns the address of the block which physically
- * follows the_block in memory.
- *
- * NOTE: Next_block assumes that the block is free.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Next_block (
- Heap_Block *the_block
-)
-{
- return (Heap_Block *) _Addresses_Add_offset(
- (void *)the_block,
- the_block->front_flag & ~ HEAP_BLOCK_USED
- );
-}
-
-/*PAGE
- *
- * _Heap_Block_at
- *
- * DESCRIPTION:
- *
- * This function calculates and returns a block's location (address)
- * in the heap based upon a base address and an offset.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
- void *base,
- unsigned32 offset
-)
-{
- return (Heap_Block *) _Addresses_Add_offset( (void *)base, offset );
-}
-
-/*PAGE
- *
- * _Heap_User_block_at
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_User_block_at(
- void *base
-)
-{
- unsigned32 offset;
-
- offset = *(((unsigned32 *) base) - 1);
- return _Heap_Block_at( base, -offset + -HEAP_BLOCK_USED_OVERHEAD);
-}
-
-/*PAGE
- *
- * _Heap_Is_previous_block_free
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the previous block of the_block
- * is free, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_previous_block_free (
- Heap_Block *the_block
-)
-{
- return !(the_block->back_flag & HEAP_BLOCK_USED);
-}
-
-/*PAGE
- *
- * _Heap_Is_block_free
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the block is free, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_block_free (
- Heap_Block *the_block
-)
-{
- return !(the_block->front_flag & HEAP_BLOCK_USED);
-}
-
-/*PAGE
- *
- * _Heap_Is_block_used
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the block is currently allocated,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_block_used (
- Heap_Block *the_block
-)
-{
- return (the_block->front_flag & HEAP_BLOCK_USED);
-}
-
-/*PAGE
- *
- * _Heap_Block_size
- *
- * DESCRIPTION:
- *
- * This function returns the size of the_block in bytes.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Heap_Block_size (
- Heap_Block *the_block
-)
-{
- return (the_block->front_flag & ~HEAP_BLOCK_USED);
-}
-
-/*PAGE
- *
- * _Heap_Start_of_user_area
- *
- * DESCRIPTION:
- *
- * This function returns the starting address of the portion of the block
- * which the user may access.
- */
-
-RTEMS_INLINE_ROUTINE void *_Heap_Start_of_user_area (
- Heap_Block *the_block
-)
-{
- return (void *) &the_block->next;
-}
-
-/*PAGE
- *
- * _Heap_Is_block_in
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_block is within the memory area
- * managed by the_heap, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_block_in (
- Heap_Control *the_heap,
- Heap_Block *the_block
-)
-{
- return _Addresses_Is_in_range( the_block, the_heap->start, the_heap->final );
-}
-
-/*PAGE
- *
- * _Heap_Is_page_size_valid
- *
- * DESCRIPTION:
- *
- * This function validates a specified heap page size. If the page size
- * is 0 or if lies outside a page size alignment boundary it is invalid
- * and FALSE is returned. Otherwise, the page size is valid and TRUE is
- * returned.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_page_size_valid(
- unsigned32 page_size
-)
-{
- return ((page_size != 0) &&
- ((page_size % CPU_HEAP_ALIGNMENT) == 0));
-}
-
-/*PAGE
- *
- * _Heap_Build_flag
- *
- * DESCRIPTION:
- *
- * This function returns the block flag composed of size and in_use_flag.
- * The flag returned is suitable for use as a back or front flag in a
- * heap block.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Heap_Build_flag (
- unsigned32 size,
- unsigned32 in_use_flag
-)
-{
- return size | in_use_flag;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/isr.inl b/c/src/exec/score/inline/rtems/score/isr.inl
deleted file mode 100644
index 6bd6e09d16..0000000000
--- a/c/src/exec/score/inline/rtems/score/isr.inl
+++ /dev/null
@@ -1,73 +0,0 @@
-/* isr.inl
- *
- * This include file contains the static implementation of all
- * inlined routines in the Interrupt Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __ISR_inl
-#define __ISR_inl
-
-/*PAGE
- *
- * _ISR_Is_in_progress
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the processor is currently servicing
- * and interrupt and FALSE otherwise. A return value of TRUE indicates
- * that the caller is an interrupt service routine, NOT a thread. The
- * directives available to an interrupt service routine are restricted.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ISR_Is_in_progress( void )
-{
- return (_ISR_Nest_level != 0);
-}
-
-/*PAGE
- *
- * _ISR_Is_vector_number_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the vector is a valid vector number
- * for this processor and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ISR_Is_vector_number_valid (
- unsigned32 vector
-)
-{
- return ( vector <= CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER );
-}
-
-/*PAGE
- *
- * _ISR_Is_valid_user_handler
- *
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if handler is the entry point of a valid
- * use interrupt service routine and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ISR_Is_valid_user_handler (
- void *handler
-)
-{
- return ( handler != NULL);
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/mppkt.inl b/c/src/exec/score/inline/rtems/score/mppkt.inl
deleted file mode 100644
index 4be286b294..0000000000
--- a/c/src/exec/score/inline/rtems/score/mppkt.inl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* inline/mppkt.inl
- *
- * This package is the implementation of the Packet Handler
- * routines which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_MP_PACKET_inl
-#define __INLINE_MP_PACKET_inl
-
-/*PAGE
- *
- * _Mp_packet_Is_valid_packet_class
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the the_packet_class is valid,
- * and FALSE otherwise.
- *
- * NOTE: Check for lower bounds (MP_PACKET_CLASSES_FIRST ) is unnecessary
- * because this enum starts at lower bound of zero.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Mp_packet_Is_valid_packet_class (
- MP_packet_Classes the_packet_class
-)
-{
- return ( the_packet_class <= MP_PACKET_CLASSES_LAST );
-}
-
-/*PAGE
- *
- * _Mp_packet_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the the_packet_class is null,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Mp_packet_Is_null (
- MP_packet_Prefix *the_packet
-)
-{
- return the_packet == NULL;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/object.inl b/c/src/exec/score/inline/rtems/score/object.inl
deleted file mode 100644
index 7e4d12aeec..0000000000
--- a/c/src/exec/score/inline/rtems/score/object.inl
+++ /dev/null
@@ -1,244 +0,0 @@
-/* object.inl
- *
- * This include file contains the static inline implementation of all
- * of the inlined routines in the Object Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OBJECTS_inl
-#define __OBJECTS_inl
-
-/*PAGE
- *
- * _Objects_Build_id
- *
- * DESCRIPTION:
- *
- * This function builds an object's id from the processor node and index
- * values specified.
- */
-
-RTEMS_INLINE_ROUTINE Objects_Id _Objects_Build_id(
- Objects_Classes the_class,
- unsigned32 node,
- unsigned32 index
-)
-{
- return ( (the_class << OBJECTS_CLASS_START_BIT) |
- (node << OBJECTS_NODE_START_BIT) |
- (index << OBJECTS_INDEX_START_BIT) );
-}
-
-/*PAGE
- *
- * _Objects_Get_class
- *
- * DESCRIPTION:
- *
- * This function returns the class portion of the ID.
- */
-
-RTEMS_INLINE_ROUTINE Objects_Classes _Objects_Get_class(
- Objects_Id id
-)
-{
- return (Objects_Classes)
- ((id >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS);
-}
-
-
-/*PAGE
- *
- * _Objects_Get_node
- *
- * DESCRIPTION:
- *
- * This function returns the node portion of the ID.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Objects_Get_node(
- Objects_Id id
-)
-{
- return (id >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS;
-}
-
-/*PAGE
- *
- * _Objects_Get_index
- *
- * DESCRIPTION:
- *
- * This function returns the index portion of the ID.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Objects_Get_index(
- Objects_Id id
-)
-{
- return (id >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS;
-}
-
-/*PAGE
- *
- * _Objects_Is_class_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the class is valid.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_Is_class_valid(
- Objects_Classes the_class
-)
-{
- return the_class && the_class <= OBJECTS_CLASSES_LAST;
-}
-
-/*PAGE
- *
- * _Objects_Is_local_node
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the node is of the local object, and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_Is_local_node(
- unsigned32 node
-)
-{
- return ( node == _Objects_Local_node );
-}
-
-/*PAGE
- *
- * _Objects_Is_local_id
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the id is of a local object, and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_Is_local_id(
- Objects_Id id
-)
-{
- return _Objects_Is_local_node( _Objects_Get_node(id) );
-}
-
-/*PAGE
- *
- * _Objects_Are_ids_equal
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if left and right are equal,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_Are_ids_equal(
- Objects_Id left,
- Objects_Id right
-)
-{
- return ( left == right );
-}
-
-/*PAGE
- *
- * _Objects_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a object control block from
- * the inactive chain of free object control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Objects_Control *_Objects_Allocate(
- Objects_Information *information
-)
-{
- return (Objects_Control *) _Chain_Get( &information->Inactive );
-}
-
-/*PAGE
- *
- * _Objects_Free
- *
- * DESCRIPTION:
- *
- * This function frees a object control block to the
- * inactive chain of free object control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Objects_Free(
- Objects_Information *information,
- Objects_Control *the_object
-)
-{
- _Chain_Append( &information->Inactive, &the_object->Node );
-}
-
-/*PAGE
- *
- * _Objects_Open
- *
- * DESCRIPTION:
- *
- * This function places the_object control pointer and object name
- * in the Local Pointer and Local Name Tables, respectively.
- */
-
-RTEMS_INLINE_ROUTINE void _Objects_Open(
- Objects_Information *information,
- Objects_Control *the_object,
- Objects_Name name
-)
-{
- unsigned32 index;
-
- index = _Objects_Get_index( the_object->id );
- information->local_table[ index ] = the_object;
-
- if ( information->is_string )
- _Objects_Copy_name_string( name, the_object->name );
- else
- _Objects_Copy_name_raw( name, the_object->name, information->name_length );
-}
-
-/*PAGE
- *
- * _Objects_Close
- *
- * DESCRIPTION:
- *
- * This function removes the_object control pointer and object name
- * in the Local Pointer and Local Name Tables.
- */
-
-RTEMS_INLINE_ROUTINE void _Objects_Close(
- Objects_Information *information,
- Objects_Control *the_object
-)
-{
- unsigned32 index;
-
- index = _Objects_Get_index( the_object->id );
- information->local_table[ index ] = (Objects_Control *) NULL;
- _Objects_Clear_name( the_object->name, information->name_length );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/objectmp.inl b/c/src/exec/score/inline/rtems/score/objectmp.inl
deleted file mode 100644
index f8fc62e129..0000000000
--- a/c/src/exec/score/inline/rtems/score/objectmp.inl
+++ /dev/null
@@ -1,73 +0,0 @@
-/* inline/objectmp.inl
- *
- * This include file contains the bodies of all inlined routines
- * which deal with global objects.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_MP_OBJECTS_inl
-#define __INLINE_MP_OBJECTS_inl
-
-/*PAGE
- *
- * _Objects_MP_Allocate_global_object
- *
- * DESCRIPTION:
- *
- * This function allocates a Global Object control block.
- */
-
-RTEMS_INLINE_ROUTINE Objects_MP_Control *_Objects_MP_Allocate_global_object (
- void
-)
-{
- return (Objects_MP_Control *)
- _Chain_Get( &_Objects_MP_Inactive_global_objects );
-}
-
-/*PAGE
- *
- * _Objects_MP_Free_global_object
- *
- * DESCRIPTION:
- *
- * This routine deallocates a Global Object control block.
- */
-
-RTEMS_INLINE_ROUTINE void _Objects_MP_Free_global_object (
- Objects_MP_Control *the_object
-)
-{
- _Chain_Append(
- &_Objects_MP_Inactive_global_objects,
- &the_object->Object.Node
- );
-}
-
-/*PAGE
- *
- * _Objects_MP_Is_null_global_object
- *
- * DESCRIPTION:
- *
- * This function returns whether the global object is NULL or not.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_MP_Is_null_global_object (
- Objects_MP_Control *the_object
-)
-{
- return( the_object == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/priority.inl b/c/src/exec/score/inline/rtems/score/priority.inl
deleted file mode 100644
index b19d157976..0000000000
--- a/c/src/exec/score/inline/rtems/score/priority.inl
+++ /dev/null
@@ -1,247 +0,0 @@
-/* priority.inl
- *
- * This file contains the static inline implementation of all inlined
- * routines in the Priority Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PRIORITY_inl
-#define __PRIORITY_inl
-
-#include <rtems/score/bitfield.h>
-
-/*PAGE
- *
- * _Priority_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-RTEMS_INLINE_ROUTINE void _Priority_Handler_initialization( void )
-{
- unsigned32 index;
-
- _Priority_Major_bit_map = 0;
- for ( index=0 ; index <16 ; index++ )
- _Priority_Bit_map[ index ] = 0;
-}
-
-/*PAGE
- *
- * _Priority_Is_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_priority if valid for a
- * user task, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Priority_Is_valid (
- Priority_Control the_priority
-)
-{
- /*
- * Since PRIORITY_MINIMUM is 0 and priorities are stored unsigned,
- * then checking for less than 0 is unnecessary.
- */
-
- return ( the_priority <= PRIORITY_MAXIMUM );
-}
-
-/*PAGE
- *
- * _Priority_Major
- *
- * DESCRIPTION:
- *
- * This function returns the major portion of the_priority.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Priority_Major (
- Priority_Control the_priority
-)
-{
- return ( the_priority / 16 );
-}
-
-/*PAGE
- *
- * _Priority_Minor
- *
- * DESCRIPTION:
- *
- * This function returns the minor portion of the_priority.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Priority_Minor (
- Priority_Control the_priority
-)
-{
- return ( the_priority % 16 );
-}
-
-#if ( CPU_USE_GENERIC_BITFIELD_CODE == TRUE )
-
-/*PAGE
- *
- * _Priority_Mask
- *
- * DESCRIPTION:
- *
- * This function returns the mask associated with the major or minor
- * number passed to it.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Priority_Mask (
- unsigned32 bit_number
-)
-{
- return (0x8000 >> bit_number);
-}
-
-
-/*PAGE
- *
- * _Priority_Bits_index
- *
- * DESCRIPTION:
- *
- * This function translates the bit numbers returned by the bit scan
- * of a priority bit field into something suitable for use as
- * a major or minor component of a priority.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Priority_Bits_index (
- unsigned32 bit_number
-)
-{
- return bit_number;
-}
-
-#endif
-
-/*PAGE
- *
- * _Priority_Add_to_bit_map
- *
- * DESCRIPTION:
- *
- * This routine uses the_priority_map to update the priority
- * bit maps to indicate that a thread has been readied.
- */
-
-RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map (
- Priority_Information *the_priority_map
-)
-{
- *the_priority_map->minor |= the_priority_map->ready_minor;
- _Priority_Major_bit_map |= the_priority_map->ready_major;
-}
-
-/*PAGE
- *
- * _Priority_Remove_from_bit_map
- *
- * DESCRIPTION:
- *
- * This routine uses the_priority_map to update the priority
- * bit maps to indicate that a thread has been removed from the
- * ready state.
- */
-
-RTEMS_INLINE_ROUTINE void _Priority_Remove_from_bit_map (
- Priority_Information *the_priority_map
-)
-{
- *the_priority_map->minor &= the_priority_map->block_minor;
- if ( *the_priority_map->minor == 0 )
- _Priority_Major_bit_map &= the_priority_map->block_major;
-}
-
-/*PAGE
- *
- * _Priority_Get_highest
- *
- * DESCRIPTION:
- *
- * This function returns the priority of the highest priority
- * ready thread.
- */
-
-RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void )
-{
- Priority_Bit_map_control minor;
- Priority_Bit_map_control major;
-
- _Bitfield_Find_first_bit( _Priority_Major_bit_map, major );
- _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
-
- return (_Priority_Bits_index( major ) << 4) +
- _Priority_Bits_index( minor );
-}
-
-/*PAGE
- *
- * _Priority_Initialize_information
- *
- * DESCRIPTION:
- *
- * This routine initializes the_priority_map so that it
- * contains the information necessary to manage a thread
- * at new_priority.
- */
-
-RTEMS_INLINE_ROUTINE void _Priority_Initialize_information(
- Priority_Information *the_priority_map,
- Priority_Control new_priority
-)
-{
- Priority_Bit_map_control major;
- Priority_Bit_map_control minor;
- Priority_Bit_map_control mask;
-
- major = _Priority_Major( new_priority );
- minor = _Priority_Minor( new_priority );
-
- the_priority_map->minor =
- &_Priority_Bit_map[ _Priority_Bits_index(major) ];
-
- mask = _Priority_Mask( major );
- the_priority_map->ready_major = mask;
- the_priority_map->block_major = ~mask;
-
- mask = _Priority_Mask( minor );
- the_priority_map->ready_minor = mask;
- the_priority_map->block_minor = ~mask;
-}
-
-/*PAGE
- *
- * _Priority_Is_group_empty
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority GROUP is empty, and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Priority_Is_group_empty (
- Priority_Control the_priority
-)
-{
- return the_priority == 0;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/stack.inl b/c/src/exec/score/inline/rtems/score/stack.inl
deleted file mode 100644
index eedd2f5ba2..0000000000
--- a/c/src/exec/score/inline/rtems/score/stack.inl
+++ /dev/null
@@ -1,81 +0,0 @@
-/* stack.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines from the Stack Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STACK_inl
-#define __STACK_inl
-
-/*PAGE
- *
- * _Stack_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the_stack record to indicate that
- * size bytes of memory starting at starting_address have been
- * reserved for a stack.
- */
-
-RTEMS_INLINE_ROUTINE void _Stack_Initialize (
- Stack_Control *the_stack,
- void *starting_address,
- unsigned32 size
-)
-{
- the_stack->area = starting_address;
- the_stack->size = size;
-}
-
-/*PAGE
- *
- * _Stack_Is_enough
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if size bytes is enough memory for
- * a valid stack area on this processor, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Stack_Is_enough (
- unsigned32 size
-)
-{
- return ( size >= STACK_MINIMUM_SIZE );
-}
-
-/*PAGE
- *
- * _Stack_Adjust_size
- *
- * DESCRIPTION:
- *
- * This function increases the stack size to insure that the thread
- * has the desired amount of stack space after the initial stack
- * pointer is determined based on alignment restrictions.
- *
- * NOTE:
- *
- * The amount of adjustment for alignment is CPU dependent.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Stack_Adjust_size (
- unsigned32 size
-)
-{
- return size + CPU_STACK_ALIGNMENT;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/states.inl b/c/src/exec/score/inline/rtems/score/states.inl
deleted file mode 100644
index 1e67b14144..0000000000
--- a/c/src/exec/score/inline/rtems/score/states.inl
+++ /dev/null
@@ -1,384 +0,0 @@
-/* states.inl
- *
- * This file contains the macro implementation of the inlined
- * routines associated with thread state information.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STATES_inl
-#define __STATES_inl
-
-/*PAGE
- *
- * _States_Set
- *
- * DESCRIPTION:
- *
- * This function sets the given states_to_set into the current_state
- * passed in. The result is returned to the user in current_state.
- */
-
-RTEMS_INLINE_ROUTINE States_Control _States_Set (
- States_Control states_to_set,
- States_Control current_state
-)
-{
- return (current_state | states_to_set);
-}
-
-/*PAGE
- *
- * _States_Clear
- *
- * DESCRIPTION:
- *
- * This function clears the given states_to_clear into the current_state
- * passed in. The result is returned to the user in current_state.
- */
-
-RTEMS_INLINE_ROUTINE States_Control _States_Clear (
- States_Control states_to_clear,
- States_Control current_state
-)
-{
- return (current_state & ~states_to_clear);
-}
-
-/*PAGE
- *
- * _States_Is_ready
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_states indicates that the
- * state is READY, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_ready (
- States_Control the_states
-)
-{
- return (the_states == STATES_READY);
-}
-
-/*PAGE
- *
- * _States_Is_only_dormant
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the DORMANT state is the ONLY state
- * set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_only_dormant (
- States_Control the_states
-)
-{
- return (the_states == STATES_DORMANT);
-}
-
-/*PAGE
- *
- * _States_Is_dormant
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the DORMANT state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_dormant (
- States_Control the_states
-)
-{
- return (the_states & STATES_DORMANT);
-}
-
-/*PAGE
- *
- * _States_Is_suspended
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the SUSPENDED state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_suspended (
- States_Control the_states
-)
-{
- return (the_states & STATES_SUSPENDED);
-}
-
-/*PAGE
- *
- * _States_Is_Transient
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the TRANSIENT state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_transient (
- States_Control the_states
-)
-{
- return (the_states & STATES_TRANSIENT);
-}
-
-/*PAGE
- *
- * _States_Is_delaying
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the DELAYING state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_delaying (
- States_Control the_states
-)
-{
- return (the_states & STATES_DELAYING);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_buffer
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_BUFFER state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_buffer (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_BUFFER);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_segment
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_SEGMENT state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_segment (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_SEGMENT);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_message
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_MESSAGE state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_message (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_MESSAGE);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_event
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_EVENT state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_event (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_EVENT);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_mutex
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_MUTEX state
- * is set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_mutex (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_MUTEX);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_semaphore
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_SEMAPHORE state
- * is set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_semaphore (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_SEMAPHORE);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_time
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_TIME state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_time (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_TIME);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_rpc_reply
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_TIME state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_rpc_reply (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_RPC_REPLY);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_period
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_PERIOD state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_period (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_PERIOD);
-}
-
-/*PAGE
- *
- * _States_Is_locally_blocked
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if one of the states which indicates
- * that a task is blocked waiting for a local resource is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_locally_blocked (
- States_Control the_states
-)
-{
- return (the_states & STATES_LOCALLY_BLOCKED);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_on_thread_queue
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if one of the states which indicates
- * that a task is blocked waiting for a local resource is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_on_thread_queue (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
-}
-
-/*PAGE
- *
- * _States_Is_blocked
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if one of the states which indicates
- * that a task is blocked is set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_blocked (
- States_Control the_states
-)
-{
- return (the_states & STATES_BLOCKED);
-}
-
-/*PAGE
- *
- *
- * _States_Are_set
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if any of the states in the mask
- * are set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Are_set (
- States_Control the_states,
- States_Control mask
-)
-{
- return ( (the_states & mask) != STATES_READY);
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/sysstate.inl b/c/src/exec/score/inline/rtems/score/sysstate.inl
deleted file mode 100644
index dea36d2806..0000000000
--- a/c/src/exec/score/inline/rtems/score/sysstate.inl
+++ /dev/null
@@ -1,154 +0,0 @@
-/* sysstates.inl
- *
- * This file contains the inline implementation of routines regarding the
- * system state.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __SYSTEM_STATE_inl
-#define __SYSTEM_STATE_inl
-
-/*PAGE
- *
- * _System_state_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the system state handler.
- */
-
-RTEMS_INLINE_ROUTINE void _System_state_Handler_initialization (
- boolean is_multiprocessing
-)
-{
- _System_state_Current = SYSTEM_STATE_BEFORE_INITIALIZATION;
- _System_state_Is_multiprocessing = is_multiprocessing;
-}
-
-/*PAGE
- *
- * _System_state_Set
- *
- * DESCRIPTION:
- *
- * This routine sets the current system state to that specified by
- * the called.
- */
-
-RTEMS_INLINE_ROUTINE void _System_state_Set (
- System_state_Codes state
-)
-{
- _System_state_Current = state;
-}
-
-/*PAGE
- *
- * _System_state_Get
- *
- * DESCRIPTION:
- *
- * This function returns the current system state.
- */
-
-RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void )
-{
- return _System_state_Current;
-}
-
-/*PAGE
- *
- * _System_state_Is_before_initialization
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "before initialization" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_before_initialization (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_BEFORE_INITIALIZATION);
-}
-
-/*PAGE
- *
- * _System_state_Is_before_multitasking
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "before multitasking" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_before_multitasking (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_BEFORE_MULTITASKING);
-}
-
-/*PAGE
- *
- * _System_state_Is_begin_multitasking
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "begin multitasking" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_begin_multitasking (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_BEGIN_MULTITASKING);
-}
-
-/*PAGE
- *
- * _System_state_Is_up
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "up" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_up (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_UP);
-}
-
-/*PAGE
- *
- * _System_state_Is_failed
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "failed" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_failed (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_FAILED);
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/thread.inl b/c/src/exec/score/inline/rtems/score/thread.inl
deleted file mode 100644
index eef4532c07..0000000000
--- a/c/src/exec/score/inline/rtems/score/thread.inl
+++ /dev/null
@@ -1,404 +0,0 @@
-/* thread.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Thread handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_inl
-#define __THREAD_inl
-
-/*PAGE
- *
- * _Thread_Stop_multitasking
- *
- * DESCRIPTION:
- *
- * This routine halts multitasking and returns control to
- * the "thread" (i.e. the BSP) which initially invoked the
- * routine which initialized the system.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Stop_multitasking( void )
-{
- _Context_Switch( &_Thread_Executing->Registers, &_Thread_BSP_context );
-}
-
-/*PAGE
- *
- * _Thread_Is_executing
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_thread is the currently executing
- * thread, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_executing (
- Thread_Control *the_thread
-)
-{
- return ( the_thread == _Thread_Executing );
-}
-
-/*PAGE
- *
- * _Thread_Is_heir
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_thread is the heir
- * thread, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_heir (
- Thread_Control *the_thread
-)
-{
- return ( the_thread == _Thread_Heir );
-}
-
-/*PAGE
- *
- * _Thread_Is_executing_also_the_heir
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the currently executing thread
- * is also the heir thread, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_executing_also_the_heir( void )
-{
- return ( _Thread_Executing == _Thread_Heir );
-}
-
-/*PAGE
- *
- * _Thread_Resume
- *
- * DESCRIPTION:
- *
- * This routine clears the SUSPENDED state for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Resume (
- Thread_Control *the_thread
-)
-{
- _Thread_Clear_state( the_thread, STATES_SUSPENDED );
-}
-
-/*PAGE
- *
- * _Thread_Unblock
- *
- * DESCRIPTION:
- *
- * This routine clears any blocking state for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Unblock (
- Thread_Control *the_thread
-)
-{
- _Thread_Clear_state( the_thread, STATES_BLOCKED );
-}
-
-/*PAGE
- *
- * _Thread_Restart_self
- *
- * DESCRIPTION:
- *
- * This routine resets the current context of the calling thread
- * to that of its initial state.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void )
-{
- if ( _Thread_Executing->fp_context != NULL )
- _Context_Restore_fp( &_Thread_Executing->fp_context );
-
- _CPU_Context_Restart_self( &_Thread_Executing->Registers );
-}
-
-/*PAGE
- *
- * _Thread_Calculate_heir
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the highest priority
- * ready thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void )
-{
- _Thread_Heir = (Thread_Control *)
- _Thread_Ready_chain[ _Priority_Get_highest() ].first;
-}
-
-/*PAGE
- *
- * _Thread_Is_allocated_fp
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the floating point context of
- * the_thread is currently loaded in the floating point unit, and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_allocated_fp (
- Thread_Control *the_thread
-)
-{
- return ( the_thread == _Thread_Allocated_fp );
-}
-
-/*PAGE
- *
- * _Thread_Deallocate_fp
- *
- * DESCRIPTION:
- *
- * This routine is invoked when the currently loaded floating
- * point context is now longer associated with an active thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void )
-{
- _Thread_Allocated_fp = NULL;
-}
-
-/*PAGE
- *
- * _Thread_Disable_dispatch
- *
- * DESCRIPTION:
- *
- * This routine prevents dispatching.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Disable_dispatch( void )
-{
- _Thread_Dispatch_disable_level += 1;
-}
-
-/*PAGE
- *
- * _Thread_Enable_dispatch
- *
- * DESCRIPTION:
- *
- * This routine allows dispatching to occur again. If this is
- * the outer most dispatching critical section, then a dispatching
- * operation will be performed and, if necessary, control of the
- * processor will be transferred to the heir thread.
- */
-
-#if ( CPU_INLINE_ENABLE_DISPATCH == TRUE )
-RTEMS_INLINE_ROUTINE void _Thread_Enable_dispatch()
-{
- if ( (--_Thread_Dispatch_disable_level) == 0 )
- _Thread_Dispatch();
-}
-#endif
-
-#if ( CPU_INLINE_ENABLE_DISPATCH == FALSE )
-void _Thread_Enable_dispatch( void );
-#endif
-
-/*PAGE
- *
- * _Thread_Unnest_dispatch
- *
- * DESCRIPTION:
- *
- * This routine allows dispatching to occur again. However,
- * no dispatching operation is performed even if this is the outer
- * most dispatching critical section.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
-{
- _Thread_Dispatch_disable_level -= 1;
-}
-
-/*PAGE
- *
- * _Thread_Is_dispatching_enabled
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if dispatching is disabled, and FALSE
- * otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_dispatching_enabled( void )
-{
- return ( _Thread_Dispatch_disable_level == 0 );
-}
-
-/*PAGE
- *
- * _Thread_Is_context_switch_necessary
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if dispatching is disabled, and FALSE
- * otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_context_switch_necessary( void )
-{
- return ( _Context_Switch_necessary );
-}
-
-/*PAGE
- *
- * _Thread_Dispatch_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the thread dispatching subsystem.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void )
-{
- _Thread_Dispatch_disable_level = 1;
-}
-
-/*PAGE
- *
- * _Thread_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_thread is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_null (
- Thread_Control *the_thread
-)
-{
- return ( the_thread == NULL );
-}
-
-/*PAGE
- *
- * _Thread_Get
- *
- * DESCRIPTION:
- *
- * This function maps thread IDs to thread control
- * blocks. If ID corresponds to a local thread, then it
- * returns the_thread control pointer which maps to ID
- * and location is set to OBJECTS_LOCAL. If the thread ID is
- * global and resides on a remote node, then location is set
- * to OBJECTS_REMOTE, and the_thread is undefined.
- * Otherwise, location is set to OBJECTS_ERROR and
- * the_thread is undefined.
- *
- * NOTE: XXX... This routine may be able to be optimized.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- Objects_Classes the_class;
- Objects_Information *information;
- Thread_Control *tp = (Thread_Control *) 0;
-
- if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
- _Thread_Disable_dispatch();
- *location = OBJECTS_LOCAL;
- tp = _Thread_Executing;
- goto done;
- }
-
- the_class = _Objects_Get_class( id );
-
- if ( the_class > OBJECTS_CLASSES_LAST ) {
- *location = OBJECTS_ERROR;
- goto done;
- }
-
- information = _Objects_Information_table[ the_class ];
-
- if ( !information || !information->is_thread ) {
- *location = OBJECTS_ERROR;
- goto done;
- }
-
- tp = (Thread_Control *) _Objects_Get( information, id, location );
-
-done:
- return tp;
-}
-
-
-/*
- * _Thread_Is_proxy_blocking
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the status code is equal to the
- * status which indicates that a proxy is blocking, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_proxy_blocking (
- unsigned32 code
-)
-{
- return (code == THREAD_STATUS_PROXY_BLOCKING);
-}
-
-/*PAGE
- *
- * _Thread_Internal_allocate
- *
- * DESCRIPTION:
- *
- * This routine allocates an internal thread.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Internal_allocate( void )
-{
- return (Thread_Control *) _Objects_Allocate( &_Thread_Internal_information );
-}
-
-/*PAGE
- *
- * _Thread_Internal_free
- *
- * DESCRIPTION:
- *
- * This routine frees an internal thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Internal_free (
- Thread_Control *the_task
-)
-{
- _Objects_Free( &_Thread_Internal_information, &the_task->Object );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/threadmp.inl b/c/src/exec/score/inline/rtems/score/threadmp.inl
deleted file mode 100644
index 7a0391ff73..0000000000
--- a/c/src/exec/score/inline/rtems/score/threadmp.inl
+++ /dev/null
@@ -1,61 +0,0 @@
-/* inline/threadmp.inl
- *
- * This include file contains the bodies of all inlined routines
- * for the multiprocessing part of thread package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_MP_THREAD_inl
-#define __INLINE_MP_THREAD_inl
-
-/*PAGE
- *
- * _Thread_MP_Is_receive
- *
- * DESCRIPTION:
- *
- * This function returns true if the thread in question is the
- * multiprocessing receive thread.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_MP_Is_receive (
- Thread_Control *the_thread
-)
-{
- return the_thread == _Thread_MP_Receive;
-}
-
-/*PAGE
- *
- * _Thread_MP_Free_proxy
- *
- * DESCRIPTION:
- *
- * This routine frees a proxy control block to the
- * inactive chain of free proxy control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_MP_Free_proxy (
- Thread_Control *the_thread
-)
-{
- Thread_Proxy_control *the_proxy;
-
- the_proxy = (Thread_Proxy_control *) the_thread;
-
- _Chain_Extract( &the_proxy->Active );
-
- _Chain_Append( &_Thread_MP_Inactive_proxies, &the_thread->Object.Node );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/tod.inl b/c/src/exec/score/inline/rtems/score/tod.inl
deleted file mode 100644
index 326d662e64..0000000000
--- a/c/src/exec/score/inline/rtems/score/tod.inl
+++ /dev/null
@@ -1,67 +0,0 @@
-/* tod.inl
- *
- * This file contains the static inline implementation of the inlined routines
- * from the Time of Day Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIME_OF_DAY_inl
-#define __TIME_OF_DAY_inl
-
-/*PAGE
- *
- * _TOD_Tickle_ticks
- *
- * DESCRIPTION:
- *
- * This routine increments the ticks field of the current time of
- * day at each clock tick.
- */
-
-RTEMS_INLINE_ROUTINE void _TOD_Tickle_ticks( void )
-{
- _TOD_Current.ticks += 1;
- _Watchdog_Ticks_since_boot += 1;
-}
-
-/*PAGE
- *
- * _TOD_Deactivate
- *
- * DESCRIPTION:
- *
- * This routine deactivates updating of the current time of day.
- */
-
-RTEMS_INLINE_ROUTINE void _TOD_Deactivate( void )
-{
- _Watchdog_Remove( &_TOD_Seconds_watchdog );
-}
-
-/*PAGE
- *
- * _TOD_Activate
- *
- * DESCRIPTION:
- *
- * This routine activates updating of the current time of day.
- */
-
-RTEMS_INLINE_ROUTINE void _TOD_Activate(
- Watchdog_Interval ticks
-)
-{
- _Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, ticks );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/tqdata.inl b/c/src/exec/score/inline/rtems/score/tqdata.inl
deleted file mode 100644
index d589933cf8..0000000000
--- a/c/src/exec/score/inline/rtems/score/tqdata.inl
+++ /dev/null
@@ -1,73 +0,0 @@
-/* tqdata.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines needed to support the Thread Queue Data.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_QUEUE_DATA_inl
-#define __THREAD_QUEUE_DATA_inl
-
-/*PAGE
- *
- * _Thread_queue_Header_number
- *
- * DESCRIPTION:
- *
- * This function returns the index of the priority chain on which
- * a thread of the_priority should be placed.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Thread_queue_Header_number (
- Priority_Control the_priority
-)
-{
- return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER);
-}
-
-/*PAGE
- *
- * _Thread_queue_Is_reverse_search
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_priority indicates that the
- * enqueue search should start at the front of this priority
- * group chain, and FALSE if the search should start at the rear.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_queue_Is_reverse_search (
- Priority_Control the_priority
-)
-{
- return ( the_priority & TASK_QUEUE_DATA_REVERSE_SEARCH_MASK );
-}
-
-/*PAGE
- *
- * _Thread_queue_Enter_critical_section
- *
- * DESCRIPTION:
- *
- * This routine is invoked to indicate that the specified thread queue is
- * entering a critical section.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
- Thread_queue_Control *the_thread_queue
-)
-{
- the_thread_queue->sync_state = THREAD_QUEUE_NOTHING_HAPPENED;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/userext.inl b/c/src/exec/score/inline/rtems/score/userext.inl
deleted file mode 100644
index 29f7975aaa..0000000000
--- a/c/src/exec/score/inline/rtems/score/userext.inl
+++ /dev/null
@@ -1,132 +0,0 @@
-/* userext.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the User Extension Handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __USER_EXTENSIONS_inl
-#define __USER_EXTENSIONS_inl
-
-#include <rtems/score/wkspace.h>
-
-/*PAGE
- *
- * _User_extensions_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Handler_initialization (
- unsigned32 number_of_extensions,
- User_extensions_Table *initial_extensions
-)
-{
- User_extensions_Control *extension;
- unsigned32 i;
-
- _Chain_Initialize_empty( &_User_extensions_List );
-
- if ( initial_extensions ) {
- for (i=0 ; i<number_of_extensions ; i++ ) {
- extension =
- _Workspace_Allocate_or_fatal_error( sizeof(User_extensions_Control) );
-
- extension->Callouts = initial_extensions[i];
- _Chain_Append( &_User_extensions_List, &extension->Node );
- }
- }
-}
-
-/*PAGE
- *
- * _User_extensions_Add_set
- *
- * DESCRIPTION:
- *
- * This routine is used to add a user extension set to the active list.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Add_set (
- User_extensions_Control *the_extension,
- User_extensions_Table *extension_table
-)
-{
- the_extension->Callouts = *extension_table;
-
- _Chain_Append( &_User_extensions_List, &the_extension->Node );
-}
-
-/*PAGE
- *
- * _User_extensions_Add_API_set
- * DESCRIPTION:
- *
- * This routine is used to add an API extension set to the active list.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Add_API_set (
- User_extensions_Control *the_extension
-)
-{
- _Chain_Prepend( &_User_extensions_List, &the_extension->Node );
-}
-
-/*PAGE
- *
- * _User_extensions_Remove_set
- *
- * DESCRIPTION:
- *
- * This routine is used to remove a user extension set from the active list.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Remove_set (
- User_extensions_Control *the_extension
-)
-{
- _Chain_Extract( &the_extension->Node );
-}
-
-/*PAGE
- *
- * _User_extensions_Thread_switch
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension which
- * is invoked when a context switch occurs.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Thread_switch (
- Thread_Control *executing,
- Thread_Control *heir
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.first ;
- !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_switch != NULL )
- (*the_extension->Callouts.thread_switch)( executing, heir );
- }
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/watchdog.inl b/c/src/exec/score/inline/rtems/score/watchdog.inl
deleted file mode 100644
index 9662a9abc6..0000000000
--- a/c/src/exec/score/inline/rtems/score/watchdog.inl
+++ /dev/null
@@ -1,324 +0,0 @@
-/* watchdog.inl
- *
- * This file contains the static inline implementation of all inlined
- * routines in the Watchdog Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WATCHDOG_inl
-#define __WATCHDOG_inl
-
-/*PAGE
- *
- * _Watchdog_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the specified watchdog. The watchdog is
- * made inactive, the watchdog id and handler routine are set to the
- * specified values.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Initialize(
- Watchdog_Control *the_watchdog,
- Watchdog_Service_routine_entry routine,
- Objects_Id id,
- void *user_data
-)
-{
- the_watchdog->state = WATCHDOG_INACTIVE;
- the_watchdog->routine = routine;
- the_watchdog->id = id;
- the_watchdog->user_data = user_data;
-}
-
-/*PAGE
- *
- * _Watchdog_Is_active
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the watchdog timer is in the ACTIVE
- * state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Watchdog_Is_active(
- Watchdog_Control *the_watchdog
-)
-{
-
- return ( the_watchdog->state == WATCHDOG_ACTIVE );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Activate
- *
- * DESCRIPTION:
- *
- * This routine activates THE_WATCHDOG timer which is already
- * on a watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Activate(
- Watchdog_Control *the_watchdog
-)
-{
-
- the_watchdog->state = WATCHDOG_ACTIVE;
-
-}
-
-/*PAGE
- *
- * _Watchdog_Deactivate
- *
- * DESCRIPTION:
- *
- * This routine deactivates THE_WATCHDOG timer which will remain
- * on a watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
- Watchdog_Control *the_watchdog
-)
-{
-
- the_watchdog->state = WATCHDOG_REMOVE_IT;
-
-}
-
-/*PAGE
- *
- * _Watchdog_Tickle_ticks
- *
- * DESCRIPTION:
- *
- * This routine is invoked at each clock tick to update the ticks
- * watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_ticks( void )
-{
-
- _Watchdog_Tickle( &_Watchdog_Ticks_chain );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Tickle_seconds
- *
- * DESCRIPTION:
- *
- * This routine is invoked at each clock tick to update the seconds
- * watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_seconds( void )
-{
-
- _Watchdog_Tickle( &_Watchdog_Seconds_chain );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Insert_ticks
- *
- * DESCRIPTION:
- *
- * This routine inserts THE_WATCHDOG into the ticks watchdog chain
- * for a time of UNITS ticks. The INSERT_MODE indicates whether
- * THE_WATCHDOG is to be activated automatically or later, explicitly
- * by the caller.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Insert_ticks(
- Watchdog_Control *the_watchdog,
- Watchdog_Interval units
-)
-{
-
- the_watchdog->initial = units;
-
- _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Insert_seconds
- *
- * DESCRIPTION:
- *
- * This routine inserts THE_WATCHDOG into the seconds watchdog chain
- * for a time of UNITS seconds. The INSERT_MODE indicates whether
- * THE_WATCHDOG is to be activated automatically or later, explicitly
- * by the caller.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Insert_seconds(
- Watchdog_Control *the_watchdog,
- Watchdog_Interval units
-)
-{
-
- the_watchdog->initial = units;
-
- _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Adjust_seconds
- *
- * DESCRIPTION:
- *
- * This routine adjusts the seconds watchdog chain in the forward
- * or backward DIRECTION for UNITS seconds. This is invoked when the
- * current time of day is changed.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Adjust_seconds(
- Watchdog_Adjust_directions direction,
- Watchdog_Interval units
-)
-{
-
- _Watchdog_Adjust( &_Watchdog_Seconds_chain, direction, units );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Adjust_ticks
- *
- * DESCRIPTION:
- *
- * This routine adjusts the ticks watchdog chain in the forward
- * or backward DIRECTION for UNITS ticks.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Adjust_ticks(
- Watchdog_Adjust_directions direction,
- Watchdog_Interval units
-)
-{
-
- _Watchdog_Adjust( &_Watchdog_Ticks_chain, direction, units );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Reset
- *
- * DESCRIPTION:
- *
- * This routine resets THE_WATCHDOG timer to its state at INSERT
- * time. This routine is valid only on interval watchdog timers
- * and is used to make an interval watchdog timer fire "every" so
- * many ticks.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Reset(
- Watchdog_Control *the_watchdog
-)
-{
-
- (void) _Watchdog_Remove( the_watchdog );
-
- _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Next
- *
- * DESCRIPTION:
- *
- * This routine returns a pointer to the watchdog timer following
- * THE_WATCHDOG on the watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next(
- Watchdog_Control *the_watchdog
-)
-{
-
- return ( (Watchdog_Control *) the_watchdog->Node.next );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Previous
- *
- * DESCRIPTION:
- *
- * This routine returns a pointer to the watchdog timer preceding
- * THE_WATCHDOG on the watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Previous(
- Watchdog_Control *the_watchdog
-)
-{
-
- return ( (Watchdog_Control *) the_watchdog->Node.previous );
-
-}
-
-/*PAGE
- *
- * _Watchdog_First
- *
- * DESCRIPTION:
- *
- * This routine returns a pointer to the first watchdog timer
- * on the watchdog chain HEADER.
- */
-
-RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
- Chain_Control *header
-)
-{
-
- return ( (Watchdog_Control *) header->first );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Last
- *
- * DESCRIPTION:
- *
- * This routine returns a pointer to the last watchdog timer
- * on the watchdog chain HEADER.
- */
-
-RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Last(
- Chain_Control *header
-)
-{
-
- return ( (Watchdog_Control *) header->last );
-
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/rtems/score/wkspace.inl b/c/src/exec/score/inline/rtems/score/wkspace.inl
deleted file mode 100644
index f92bde0f41..0000000000
--- a/c/src/exec/score/inline/rtems/score/wkspace.inl
+++ /dev/null
@@ -1,57 +0,0 @@
-/* wkspace.inl
- *
- * This include file contains the bodies of the routines which contains
- * information related to the RAM Workspace.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WORKSPACE_inl
-#define __WORKSPACE_inl
-
-/*PAGE
- *
- * _Workspace_Allocate
- *
- * DESCRIPTION:
- *
- * This routine returns the address of a block of memory of size
- * bytes. If a block of the appropriate size cannot be allocated
- * from the workspace, then NULL is returned.
- */
-
-RTEMS_INLINE_ROUTINE void *_Workspace_Allocate(
- unsigned32 size
-)
-{
- return _Heap_Allocate( &_Workspace_Area, size );
-}
-
-/*PAGE
- *
- * _Workspace_Free
- *
- * DESCRIPTION:
- *
- * This function frees the specified block of memory. If the block
- * belongs to the Workspace and can be successfully freed, then
- * TRUE is returned. Otherwise FALSE is returned.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Workspace_Free(
- void *block
-)
-{
- return _Heap_Free( &_Workspace_Area, block );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/stack.inl b/c/src/exec/score/inline/stack.inl
deleted file mode 100644
index eedd2f5ba2..0000000000
--- a/c/src/exec/score/inline/stack.inl
+++ /dev/null
@@ -1,81 +0,0 @@
-/* stack.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines from the Stack Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STACK_inl
-#define __STACK_inl
-
-/*PAGE
- *
- * _Stack_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the_stack record to indicate that
- * size bytes of memory starting at starting_address have been
- * reserved for a stack.
- */
-
-RTEMS_INLINE_ROUTINE void _Stack_Initialize (
- Stack_Control *the_stack,
- void *starting_address,
- unsigned32 size
-)
-{
- the_stack->area = starting_address;
- the_stack->size = size;
-}
-
-/*PAGE
- *
- * _Stack_Is_enough
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if size bytes is enough memory for
- * a valid stack area on this processor, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Stack_Is_enough (
- unsigned32 size
-)
-{
- return ( size >= STACK_MINIMUM_SIZE );
-}
-
-/*PAGE
- *
- * _Stack_Adjust_size
- *
- * DESCRIPTION:
- *
- * This function increases the stack size to insure that the thread
- * has the desired amount of stack space after the initial stack
- * pointer is determined based on alignment restrictions.
- *
- * NOTE:
- *
- * The amount of adjustment for alignment is CPU dependent.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Stack_Adjust_size (
- unsigned32 size
-)
-{
- return size + CPU_STACK_ALIGNMENT;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/states.inl b/c/src/exec/score/inline/states.inl
deleted file mode 100644
index 1e67b14144..0000000000
--- a/c/src/exec/score/inline/states.inl
+++ /dev/null
@@ -1,384 +0,0 @@
-/* states.inl
- *
- * This file contains the macro implementation of the inlined
- * routines associated with thread state information.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STATES_inl
-#define __STATES_inl
-
-/*PAGE
- *
- * _States_Set
- *
- * DESCRIPTION:
- *
- * This function sets the given states_to_set into the current_state
- * passed in. The result is returned to the user in current_state.
- */
-
-RTEMS_INLINE_ROUTINE States_Control _States_Set (
- States_Control states_to_set,
- States_Control current_state
-)
-{
- return (current_state | states_to_set);
-}
-
-/*PAGE
- *
- * _States_Clear
- *
- * DESCRIPTION:
- *
- * This function clears the given states_to_clear into the current_state
- * passed in. The result is returned to the user in current_state.
- */
-
-RTEMS_INLINE_ROUTINE States_Control _States_Clear (
- States_Control states_to_clear,
- States_Control current_state
-)
-{
- return (current_state & ~states_to_clear);
-}
-
-/*PAGE
- *
- * _States_Is_ready
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_states indicates that the
- * state is READY, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_ready (
- States_Control the_states
-)
-{
- return (the_states == STATES_READY);
-}
-
-/*PAGE
- *
- * _States_Is_only_dormant
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the DORMANT state is the ONLY state
- * set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_only_dormant (
- States_Control the_states
-)
-{
- return (the_states == STATES_DORMANT);
-}
-
-/*PAGE
- *
- * _States_Is_dormant
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the DORMANT state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_dormant (
- States_Control the_states
-)
-{
- return (the_states & STATES_DORMANT);
-}
-
-/*PAGE
- *
- * _States_Is_suspended
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the SUSPENDED state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_suspended (
- States_Control the_states
-)
-{
- return (the_states & STATES_SUSPENDED);
-}
-
-/*PAGE
- *
- * _States_Is_Transient
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the TRANSIENT state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_transient (
- States_Control the_states
-)
-{
- return (the_states & STATES_TRANSIENT);
-}
-
-/*PAGE
- *
- * _States_Is_delaying
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the DELAYING state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_delaying (
- States_Control the_states
-)
-{
- return (the_states & STATES_DELAYING);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_buffer
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_BUFFER state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_buffer (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_BUFFER);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_segment
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_SEGMENT state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_segment (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_SEGMENT);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_message
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_MESSAGE state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_message (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_MESSAGE);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_event
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_EVENT state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_event (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_EVENT);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_mutex
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_MUTEX state
- * is set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_mutex (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_MUTEX);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_semaphore
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_SEMAPHORE state
- * is set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_semaphore (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_SEMAPHORE);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_time
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_TIME state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_time (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_TIME);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_rpc_reply
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_TIME state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_rpc_reply (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_RPC_REPLY);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_period
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_PERIOD state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_period (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_PERIOD);
-}
-
-/*PAGE
- *
- * _States_Is_locally_blocked
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if one of the states which indicates
- * that a task is blocked waiting for a local resource is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_locally_blocked (
- States_Control the_states
-)
-{
- return (the_states & STATES_LOCALLY_BLOCKED);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_on_thread_queue
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if one of the states which indicates
- * that a task is blocked waiting for a local resource is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_on_thread_queue (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
-}
-
-/*PAGE
- *
- * _States_Is_blocked
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if one of the states which indicates
- * that a task is blocked is set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_blocked (
- States_Control the_states
-)
-{
- return (the_states & STATES_BLOCKED);
-}
-
-/*PAGE
- *
- *
- * _States_Are_set
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if any of the states in the mask
- * are set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Are_set (
- States_Control the_states,
- States_Control mask
-)
-{
- return ( (the_states & mask) != STATES_READY);
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/sysstate.inl b/c/src/exec/score/inline/sysstate.inl
deleted file mode 100644
index dea36d2806..0000000000
--- a/c/src/exec/score/inline/sysstate.inl
+++ /dev/null
@@ -1,154 +0,0 @@
-/* sysstates.inl
- *
- * This file contains the inline implementation of routines regarding the
- * system state.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __SYSTEM_STATE_inl
-#define __SYSTEM_STATE_inl
-
-/*PAGE
- *
- * _System_state_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the system state handler.
- */
-
-RTEMS_INLINE_ROUTINE void _System_state_Handler_initialization (
- boolean is_multiprocessing
-)
-{
- _System_state_Current = SYSTEM_STATE_BEFORE_INITIALIZATION;
- _System_state_Is_multiprocessing = is_multiprocessing;
-}
-
-/*PAGE
- *
- * _System_state_Set
- *
- * DESCRIPTION:
- *
- * This routine sets the current system state to that specified by
- * the called.
- */
-
-RTEMS_INLINE_ROUTINE void _System_state_Set (
- System_state_Codes state
-)
-{
- _System_state_Current = state;
-}
-
-/*PAGE
- *
- * _System_state_Get
- *
- * DESCRIPTION:
- *
- * This function returns the current system state.
- */
-
-RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void )
-{
- return _System_state_Current;
-}
-
-/*PAGE
- *
- * _System_state_Is_before_initialization
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "before initialization" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_before_initialization (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_BEFORE_INITIALIZATION);
-}
-
-/*PAGE
- *
- * _System_state_Is_before_multitasking
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "before multitasking" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_before_multitasking (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_BEFORE_MULTITASKING);
-}
-
-/*PAGE
- *
- * _System_state_Is_begin_multitasking
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "begin multitasking" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_begin_multitasking (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_BEGIN_MULTITASKING);
-}
-
-/*PAGE
- *
- * _System_state_Is_up
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "up" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_up (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_UP);
-}
-
-/*PAGE
- *
- * _System_state_Is_failed
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "failed" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_failed (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_FAILED);
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/thread.inl b/c/src/exec/score/inline/thread.inl
deleted file mode 100644
index eef4532c07..0000000000
--- a/c/src/exec/score/inline/thread.inl
+++ /dev/null
@@ -1,404 +0,0 @@
-/* thread.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Thread handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_inl
-#define __THREAD_inl
-
-/*PAGE
- *
- * _Thread_Stop_multitasking
- *
- * DESCRIPTION:
- *
- * This routine halts multitasking and returns control to
- * the "thread" (i.e. the BSP) which initially invoked the
- * routine which initialized the system.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Stop_multitasking( void )
-{
- _Context_Switch( &_Thread_Executing->Registers, &_Thread_BSP_context );
-}
-
-/*PAGE
- *
- * _Thread_Is_executing
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_thread is the currently executing
- * thread, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_executing (
- Thread_Control *the_thread
-)
-{
- return ( the_thread == _Thread_Executing );
-}
-
-/*PAGE
- *
- * _Thread_Is_heir
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_thread is the heir
- * thread, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_heir (
- Thread_Control *the_thread
-)
-{
- return ( the_thread == _Thread_Heir );
-}
-
-/*PAGE
- *
- * _Thread_Is_executing_also_the_heir
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the currently executing thread
- * is also the heir thread, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_executing_also_the_heir( void )
-{
- return ( _Thread_Executing == _Thread_Heir );
-}
-
-/*PAGE
- *
- * _Thread_Resume
- *
- * DESCRIPTION:
- *
- * This routine clears the SUSPENDED state for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Resume (
- Thread_Control *the_thread
-)
-{
- _Thread_Clear_state( the_thread, STATES_SUSPENDED );
-}
-
-/*PAGE
- *
- * _Thread_Unblock
- *
- * DESCRIPTION:
- *
- * This routine clears any blocking state for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Unblock (
- Thread_Control *the_thread
-)
-{
- _Thread_Clear_state( the_thread, STATES_BLOCKED );
-}
-
-/*PAGE
- *
- * _Thread_Restart_self
- *
- * DESCRIPTION:
- *
- * This routine resets the current context of the calling thread
- * to that of its initial state.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void )
-{
- if ( _Thread_Executing->fp_context != NULL )
- _Context_Restore_fp( &_Thread_Executing->fp_context );
-
- _CPU_Context_Restart_self( &_Thread_Executing->Registers );
-}
-
-/*PAGE
- *
- * _Thread_Calculate_heir
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the highest priority
- * ready thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void )
-{
- _Thread_Heir = (Thread_Control *)
- _Thread_Ready_chain[ _Priority_Get_highest() ].first;
-}
-
-/*PAGE
- *
- * _Thread_Is_allocated_fp
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the floating point context of
- * the_thread is currently loaded in the floating point unit, and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_allocated_fp (
- Thread_Control *the_thread
-)
-{
- return ( the_thread == _Thread_Allocated_fp );
-}
-
-/*PAGE
- *
- * _Thread_Deallocate_fp
- *
- * DESCRIPTION:
- *
- * This routine is invoked when the currently loaded floating
- * point context is now longer associated with an active thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void )
-{
- _Thread_Allocated_fp = NULL;
-}
-
-/*PAGE
- *
- * _Thread_Disable_dispatch
- *
- * DESCRIPTION:
- *
- * This routine prevents dispatching.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Disable_dispatch( void )
-{
- _Thread_Dispatch_disable_level += 1;
-}
-
-/*PAGE
- *
- * _Thread_Enable_dispatch
- *
- * DESCRIPTION:
- *
- * This routine allows dispatching to occur again. If this is
- * the outer most dispatching critical section, then a dispatching
- * operation will be performed and, if necessary, control of the
- * processor will be transferred to the heir thread.
- */
-
-#if ( CPU_INLINE_ENABLE_DISPATCH == TRUE )
-RTEMS_INLINE_ROUTINE void _Thread_Enable_dispatch()
-{
- if ( (--_Thread_Dispatch_disable_level) == 0 )
- _Thread_Dispatch();
-}
-#endif
-
-#if ( CPU_INLINE_ENABLE_DISPATCH == FALSE )
-void _Thread_Enable_dispatch( void );
-#endif
-
-/*PAGE
- *
- * _Thread_Unnest_dispatch
- *
- * DESCRIPTION:
- *
- * This routine allows dispatching to occur again. However,
- * no dispatching operation is performed even if this is the outer
- * most dispatching critical section.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
-{
- _Thread_Dispatch_disable_level -= 1;
-}
-
-/*PAGE
- *
- * _Thread_Is_dispatching_enabled
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if dispatching is disabled, and FALSE
- * otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_dispatching_enabled( void )
-{
- return ( _Thread_Dispatch_disable_level == 0 );
-}
-
-/*PAGE
- *
- * _Thread_Is_context_switch_necessary
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if dispatching is disabled, and FALSE
- * otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_context_switch_necessary( void )
-{
- return ( _Context_Switch_necessary );
-}
-
-/*PAGE
- *
- * _Thread_Dispatch_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the thread dispatching subsystem.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void )
-{
- _Thread_Dispatch_disable_level = 1;
-}
-
-/*PAGE
- *
- * _Thread_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_thread is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_null (
- Thread_Control *the_thread
-)
-{
- return ( the_thread == NULL );
-}
-
-/*PAGE
- *
- * _Thread_Get
- *
- * DESCRIPTION:
- *
- * This function maps thread IDs to thread control
- * blocks. If ID corresponds to a local thread, then it
- * returns the_thread control pointer which maps to ID
- * and location is set to OBJECTS_LOCAL. If the thread ID is
- * global and resides on a remote node, then location is set
- * to OBJECTS_REMOTE, and the_thread is undefined.
- * Otherwise, location is set to OBJECTS_ERROR and
- * the_thread is undefined.
- *
- * NOTE: XXX... This routine may be able to be optimized.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- Objects_Classes the_class;
- Objects_Information *information;
- Thread_Control *tp = (Thread_Control *) 0;
-
- if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
- _Thread_Disable_dispatch();
- *location = OBJECTS_LOCAL;
- tp = _Thread_Executing;
- goto done;
- }
-
- the_class = _Objects_Get_class( id );
-
- if ( the_class > OBJECTS_CLASSES_LAST ) {
- *location = OBJECTS_ERROR;
- goto done;
- }
-
- information = _Objects_Information_table[ the_class ];
-
- if ( !information || !information->is_thread ) {
- *location = OBJECTS_ERROR;
- goto done;
- }
-
- tp = (Thread_Control *) _Objects_Get( information, id, location );
-
-done:
- return tp;
-}
-
-
-/*
- * _Thread_Is_proxy_blocking
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the status code is equal to the
- * status which indicates that a proxy is blocking, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_proxy_blocking (
- unsigned32 code
-)
-{
- return (code == THREAD_STATUS_PROXY_BLOCKING);
-}
-
-/*PAGE
- *
- * _Thread_Internal_allocate
- *
- * DESCRIPTION:
- *
- * This routine allocates an internal thread.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Internal_allocate( void )
-{
- return (Thread_Control *) _Objects_Allocate( &_Thread_Internal_information );
-}
-
-/*PAGE
- *
- * _Thread_Internal_free
- *
- * DESCRIPTION:
- *
- * This routine frees an internal thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Internal_free (
- Thread_Control *the_task
-)
-{
- _Objects_Free( &_Thread_Internal_information, &the_task->Object );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/threadmp.inl b/c/src/exec/score/inline/threadmp.inl
deleted file mode 100644
index 7a0391ff73..0000000000
--- a/c/src/exec/score/inline/threadmp.inl
+++ /dev/null
@@ -1,61 +0,0 @@
-/* inline/threadmp.inl
- *
- * This include file contains the bodies of all inlined routines
- * for the multiprocessing part of thread package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_MP_THREAD_inl
-#define __INLINE_MP_THREAD_inl
-
-/*PAGE
- *
- * _Thread_MP_Is_receive
- *
- * DESCRIPTION:
- *
- * This function returns true if the thread in question is the
- * multiprocessing receive thread.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_MP_Is_receive (
- Thread_Control *the_thread
-)
-{
- return the_thread == _Thread_MP_Receive;
-}
-
-/*PAGE
- *
- * _Thread_MP_Free_proxy
- *
- * DESCRIPTION:
- *
- * This routine frees a proxy control block to the
- * inactive chain of free proxy control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_MP_Free_proxy (
- Thread_Control *the_thread
-)
-{
- Thread_Proxy_control *the_proxy;
-
- the_proxy = (Thread_Proxy_control *) the_thread;
-
- _Chain_Extract( &the_proxy->Active );
-
- _Chain_Append( &_Thread_MP_Inactive_proxies, &the_thread->Object.Node );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/tod.inl b/c/src/exec/score/inline/tod.inl
deleted file mode 100644
index 326d662e64..0000000000
--- a/c/src/exec/score/inline/tod.inl
+++ /dev/null
@@ -1,67 +0,0 @@
-/* tod.inl
- *
- * This file contains the static inline implementation of the inlined routines
- * from the Time of Day Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIME_OF_DAY_inl
-#define __TIME_OF_DAY_inl
-
-/*PAGE
- *
- * _TOD_Tickle_ticks
- *
- * DESCRIPTION:
- *
- * This routine increments the ticks field of the current time of
- * day at each clock tick.
- */
-
-RTEMS_INLINE_ROUTINE void _TOD_Tickle_ticks( void )
-{
- _TOD_Current.ticks += 1;
- _Watchdog_Ticks_since_boot += 1;
-}
-
-/*PAGE
- *
- * _TOD_Deactivate
- *
- * DESCRIPTION:
- *
- * This routine deactivates updating of the current time of day.
- */
-
-RTEMS_INLINE_ROUTINE void _TOD_Deactivate( void )
-{
- _Watchdog_Remove( &_TOD_Seconds_watchdog );
-}
-
-/*PAGE
- *
- * _TOD_Activate
- *
- * DESCRIPTION:
- *
- * This routine activates updating of the current time of day.
- */
-
-RTEMS_INLINE_ROUTINE void _TOD_Activate(
- Watchdog_Interval ticks
-)
-{
- _Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, ticks );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/tqdata.inl b/c/src/exec/score/inline/tqdata.inl
deleted file mode 100644
index d589933cf8..0000000000
--- a/c/src/exec/score/inline/tqdata.inl
+++ /dev/null
@@ -1,73 +0,0 @@
-/* tqdata.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines needed to support the Thread Queue Data.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_QUEUE_DATA_inl
-#define __THREAD_QUEUE_DATA_inl
-
-/*PAGE
- *
- * _Thread_queue_Header_number
- *
- * DESCRIPTION:
- *
- * This function returns the index of the priority chain on which
- * a thread of the_priority should be placed.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Thread_queue_Header_number (
- Priority_Control the_priority
-)
-{
- return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER);
-}
-
-/*PAGE
- *
- * _Thread_queue_Is_reverse_search
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_priority indicates that the
- * enqueue search should start at the front of this priority
- * group chain, and FALSE if the search should start at the rear.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_queue_Is_reverse_search (
- Priority_Control the_priority
-)
-{
- return ( the_priority & TASK_QUEUE_DATA_REVERSE_SEARCH_MASK );
-}
-
-/*PAGE
- *
- * _Thread_queue_Enter_critical_section
- *
- * DESCRIPTION:
- *
- * This routine is invoked to indicate that the specified thread queue is
- * entering a critical section.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
- Thread_queue_Control *the_thread_queue
-)
-{
- the_thread_queue->sync_state = THREAD_QUEUE_NOTHING_HAPPENED;
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/userext.inl b/c/src/exec/score/inline/userext.inl
deleted file mode 100644
index 29f7975aaa..0000000000
--- a/c/src/exec/score/inline/userext.inl
+++ /dev/null
@@ -1,132 +0,0 @@
-/* userext.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the User Extension Handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __USER_EXTENSIONS_inl
-#define __USER_EXTENSIONS_inl
-
-#include <rtems/score/wkspace.h>
-
-/*PAGE
- *
- * _User_extensions_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Handler_initialization (
- unsigned32 number_of_extensions,
- User_extensions_Table *initial_extensions
-)
-{
- User_extensions_Control *extension;
- unsigned32 i;
-
- _Chain_Initialize_empty( &_User_extensions_List );
-
- if ( initial_extensions ) {
- for (i=0 ; i<number_of_extensions ; i++ ) {
- extension =
- _Workspace_Allocate_or_fatal_error( sizeof(User_extensions_Control) );
-
- extension->Callouts = initial_extensions[i];
- _Chain_Append( &_User_extensions_List, &extension->Node );
- }
- }
-}
-
-/*PAGE
- *
- * _User_extensions_Add_set
- *
- * DESCRIPTION:
- *
- * This routine is used to add a user extension set to the active list.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Add_set (
- User_extensions_Control *the_extension,
- User_extensions_Table *extension_table
-)
-{
- the_extension->Callouts = *extension_table;
-
- _Chain_Append( &_User_extensions_List, &the_extension->Node );
-}
-
-/*PAGE
- *
- * _User_extensions_Add_API_set
- * DESCRIPTION:
- *
- * This routine is used to add an API extension set to the active list.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Add_API_set (
- User_extensions_Control *the_extension
-)
-{
- _Chain_Prepend( &_User_extensions_List, &the_extension->Node );
-}
-
-/*PAGE
- *
- * _User_extensions_Remove_set
- *
- * DESCRIPTION:
- *
- * This routine is used to remove a user extension set from the active list.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Remove_set (
- User_extensions_Control *the_extension
-)
-{
- _Chain_Extract( &the_extension->Node );
-}
-
-/*PAGE
- *
- * _User_extensions_Thread_switch
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension which
- * is invoked when a context switch occurs.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Thread_switch (
- Thread_Control *executing,
- Thread_Control *heir
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.first ;
- !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_switch != NULL )
- (*the_extension->Callouts.thread_switch)( executing, heir );
- }
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/watchdog.inl b/c/src/exec/score/inline/watchdog.inl
deleted file mode 100644
index 9662a9abc6..0000000000
--- a/c/src/exec/score/inline/watchdog.inl
+++ /dev/null
@@ -1,324 +0,0 @@
-/* watchdog.inl
- *
- * This file contains the static inline implementation of all inlined
- * routines in the Watchdog Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WATCHDOG_inl
-#define __WATCHDOG_inl
-
-/*PAGE
- *
- * _Watchdog_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the specified watchdog. The watchdog is
- * made inactive, the watchdog id and handler routine are set to the
- * specified values.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Initialize(
- Watchdog_Control *the_watchdog,
- Watchdog_Service_routine_entry routine,
- Objects_Id id,
- void *user_data
-)
-{
- the_watchdog->state = WATCHDOG_INACTIVE;
- the_watchdog->routine = routine;
- the_watchdog->id = id;
- the_watchdog->user_data = user_data;
-}
-
-/*PAGE
- *
- * _Watchdog_Is_active
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the watchdog timer is in the ACTIVE
- * state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Watchdog_Is_active(
- Watchdog_Control *the_watchdog
-)
-{
-
- return ( the_watchdog->state == WATCHDOG_ACTIVE );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Activate
- *
- * DESCRIPTION:
- *
- * This routine activates THE_WATCHDOG timer which is already
- * on a watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Activate(
- Watchdog_Control *the_watchdog
-)
-{
-
- the_watchdog->state = WATCHDOG_ACTIVE;
-
-}
-
-/*PAGE
- *
- * _Watchdog_Deactivate
- *
- * DESCRIPTION:
- *
- * This routine deactivates THE_WATCHDOG timer which will remain
- * on a watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
- Watchdog_Control *the_watchdog
-)
-{
-
- the_watchdog->state = WATCHDOG_REMOVE_IT;
-
-}
-
-/*PAGE
- *
- * _Watchdog_Tickle_ticks
- *
- * DESCRIPTION:
- *
- * This routine is invoked at each clock tick to update the ticks
- * watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_ticks( void )
-{
-
- _Watchdog_Tickle( &_Watchdog_Ticks_chain );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Tickle_seconds
- *
- * DESCRIPTION:
- *
- * This routine is invoked at each clock tick to update the seconds
- * watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_seconds( void )
-{
-
- _Watchdog_Tickle( &_Watchdog_Seconds_chain );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Insert_ticks
- *
- * DESCRIPTION:
- *
- * This routine inserts THE_WATCHDOG into the ticks watchdog chain
- * for a time of UNITS ticks. The INSERT_MODE indicates whether
- * THE_WATCHDOG is to be activated automatically or later, explicitly
- * by the caller.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Insert_ticks(
- Watchdog_Control *the_watchdog,
- Watchdog_Interval units
-)
-{
-
- the_watchdog->initial = units;
-
- _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Insert_seconds
- *
- * DESCRIPTION:
- *
- * This routine inserts THE_WATCHDOG into the seconds watchdog chain
- * for a time of UNITS seconds. The INSERT_MODE indicates whether
- * THE_WATCHDOG is to be activated automatically or later, explicitly
- * by the caller.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Insert_seconds(
- Watchdog_Control *the_watchdog,
- Watchdog_Interval units
-)
-{
-
- the_watchdog->initial = units;
-
- _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Adjust_seconds
- *
- * DESCRIPTION:
- *
- * This routine adjusts the seconds watchdog chain in the forward
- * or backward DIRECTION for UNITS seconds. This is invoked when the
- * current time of day is changed.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Adjust_seconds(
- Watchdog_Adjust_directions direction,
- Watchdog_Interval units
-)
-{
-
- _Watchdog_Adjust( &_Watchdog_Seconds_chain, direction, units );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Adjust_ticks
- *
- * DESCRIPTION:
- *
- * This routine adjusts the ticks watchdog chain in the forward
- * or backward DIRECTION for UNITS ticks.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Adjust_ticks(
- Watchdog_Adjust_directions direction,
- Watchdog_Interval units
-)
-{
-
- _Watchdog_Adjust( &_Watchdog_Ticks_chain, direction, units );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Reset
- *
- * DESCRIPTION:
- *
- * This routine resets THE_WATCHDOG timer to its state at INSERT
- * time. This routine is valid only on interval watchdog timers
- * and is used to make an interval watchdog timer fire "every" so
- * many ticks.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Reset(
- Watchdog_Control *the_watchdog
-)
-{
-
- (void) _Watchdog_Remove( the_watchdog );
-
- _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Next
- *
- * DESCRIPTION:
- *
- * This routine returns a pointer to the watchdog timer following
- * THE_WATCHDOG on the watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next(
- Watchdog_Control *the_watchdog
-)
-{
-
- return ( (Watchdog_Control *) the_watchdog->Node.next );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Previous
- *
- * DESCRIPTION:
- *
- * This routine returns a pointer to the watchdog timer preceding
- * THE_WATCHDOG on the watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Previous(
- Watchdog_Control *the_watchdog
-)
-{
-
- return ( (Watchdog_Control *) the_watchdog->Node.previous );
-
-}
-
-/*PAGE
- *
- * _Watchdog_First
- *
- * DESCRIPTION:
- *
- * This routine returns a pointer to the first watchdog timer
- * on the watchdog chain HEADER.
- */
-
-RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
- Chain_Control *header
-)
-{
-
- return ( (Watchdog_Control *) header->first );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Last
- *
- * DESCRIPTION:
- *
- * This routine returns a pointer to the last watchdog timer
- * on the watchdog chain HEADER.
- */
-
-RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Last(
- Chain_Control *header
-)
-{
-
- return ( (Watchdog_Control *) header->last );
-
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/inline/wkspace.inl b/c/src/exec/score/inline/wkspace.inl
deleted file mode 100644
index f92bde0f41..0000000000
--- a/c/src/exec/score/inline/wkspace.inl
+++ /dev/null
@@ -1,57 +0,0 @@
-/* wkspace.inl
- *
- * This include file contains the bodies of the routines which contains
- * information related to the RAM Workspace.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WORKSPACE_inl
-#define __WORKSPACE_inl
-
-/*PAGE
- *
- * _Workspace_Allocate
- *
- * DESCRIPTION:
- *
- * This routine returns the address of a block of memory of size
- * bytes. If a block of the appropriate size cannot be allocated
- * from the workspace, then NULL is returned.
- */
-
-RTEMS_INLINE_ROUTINE void *_Workspace_Allocate(
- unsigned32 size
-)
-{
- return _Heap_Allocate( &_Workspace_Area, size );
-}
-
-/*PAGE
- *
- * _Workspace_Free
- *
- * DESCRIPTION:
- *
- * This function frees the specified block of memory. If the block
- * belongs to the Workspace and can be successfully freed, then
- * TRUE is returned. Otherwise FALSE is returned.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Workspace_Free(
- void *block
-)
-{
- return _Heap_Free( &_Workspace_Area, block );
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/Makefile.in b/c/src/exec/score/macros/Makefile.in
deleted file mode 100644
index f97d3bfcf3..0000000000
--- a/c/src/exec/score/macros/Makefile.in
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-I_PIECES= address chain coremsg coremutex coresem heap \
- isr mppkt object objectmp priority stack states sysstate thread \
- threadmp tod tqdata userext watchdog wkspace
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems/score
diff --git a/c/src/exec/score/macros/README b/c/src/exec/score/macros/README
deleted file mode 100644
index b2f0c4d481..0000000000
--- a/c/src/exec/score/macros/README
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# $Id$
-#
-
-The files in this directory are not considered the "primary" source
-of inlined routines for RTEMS. The "inline" directory contains
-the implementations of the inlined basis which are regularly
-tested. In general, an effort is made to keep the contents of
-this directory up to date but testing is only performed irregularly
-and even then it is usually with a single target processor and BSP.
-
-The primary purpose of the code in this directory is to insure
-that RTEMS can be compiled using a C compiler which does not support
-static inline routines.
-
-These were last successfully tested on 2/1/95 on a prerelease version
-of 3.2.0. The testing was done only on the Force CPU386 i386 target board.
-No testing was done on version of the code in the final release.
diff --git a/c/src/exec/score/macros/address.inl b/c/src/exec/score/macros/address.inl
deleted file mode 100644
index 712809a4e7..0000000000
--- a/c/src/exec/score/macros/address.inl
+++ /dev/null
@@ -1,68 +0,0 @@
-/* macros/address.h
- *
- * This include file contains the bodies of the routines
- * about addresses which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_ADDRESSES_h
-#define __MACROS_ADDRESSES_h
-
-/*PAGE
- *
- * _Addresses_Add_offset
- *
- */
-
-#define _Addresses_Add_offset( _base, _offset ) \
- ((void *)((char *)(_base) + (_offset)))
-
-/*PAGE
- *
- * _Addresses_Subtract_offset
- *
- */
-
-#define _Addresses_Subtract_offset( _base, _offset ) \
- ((void *)((char *)(_base) - (_offset)))
-
-/*PAGE
- *
- * _Addresses_Subtract
- *
- * NOTE: The cast of an address to an unsigned32 makes this code
- * dependent on an addresses being thirty two bits.
- */
-
-#define _Addresses_Subtract( _left, _right ) \
- ((void *)(_left) - (void *)(_right))
-
-/*PAGE
- *
- * _Addresses_Is_aligned
- *
- */
-
-#define _Addresses_Is_aligned( _address ) \
- ( ( (unsigned32)(_address) % 4 ) == 0 )
-
-/*PAGE
- *
- * _Addresses_Is_in_range
- *
- */
-
-#define _Addresses_Is_in_range( _address, _base, _limit ) \
- ( (_address) >= (_base) && (_address) <= (_limit) )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/chain.inl b/c/src/exec/score/macros/chain.inl
deleted file mode 100644
index 85ede31c12..0000000000
--- a/c/src/exec/score/macros/chain.inl
+++ /dev/null
@@ -1,200 +0,0 @@
-/* macros/chain.h
- *
- * This include file contains the bodies of the routines which are
- * associated with doubly linked chains and inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_CHAIN_h
-#define __MACROS_CHAIN_h
-
-/*PAGE
- *
- * _Chain_Are_nodes_equal
- */
-
-#define _Chain_Are_nodes_equal( _left, _right ) \
- ( (_left) == (_right) )
-
-/*PAGE
- *
- * _Chain_Is_null
- */
-
-#define _Chain_Is_null( _the_chain ) \
- ( (_the_chain) == NULL )
-
-/*PAGE
- *
- * _Chain_Is_null_node
- */
-
-#define _Chain_Is_null_node( _the_node ) \
- ( (_the_node) == NULL )
-
-/*PAGE
- *
- * _Chain_Head
- */
-
-#define _Chain_Head( _the_chain ) \
- ((Chain_Node *) (_the_chain))
-
-/*PAGE
- *
- * _Chain_Tail
- */
-
-#define _Chain_Tail( _the_chain ) \
- ((Chain_Node *) &(_the_chain)->permanent_null)
-
-/*PAGE
- *
- * _Chain_Is_empty
- */
-
-#define _Chain_Is_empty( _the_chain ) \
- ( (_the_chain)->first == _Chain_Tail( (_the_chain) ) )
-
-/*PAGE
- *
- * _Chain_Is_first
- */
-
-#define _Chain_Is_first( _the_node ) \
- ( (the_node)->previous == NULL )
-
-/*PAGE
- *
- * _Chain_Is_last
- */
-
-#define _Chain_Is_last( _the_node ) \
- ( (_the_node)->next == NULL )
-
-/*PAGE
- *
- * _Chain_Has_only_one_node
- */
-
-#define _Chain_Has_only_one_node( _the_chain ) \
- ( (_the_chain)->first == (_the_chain)->last )
-
-/*PAGE
- *
- * _Chain_Is_head
- */
-
-#define _Chain_Is_head( _the_chain, _the_node ) \
- ( (_the_node) == _Chain_Head( (_the_chain) ) )
-
-/*PAGE
- *
- * _Chain_Is_tail
- */
-
-#define _Chain_Is_tail( _the_chain, _the_node ) \
- ( (_the_node) == _Chain_Tail( (_the_chain) ) )
-
-/*PAGE
- *
- * Chain_Initialize_empty
- */
-
-#define _Chain_Initialize_empty( _the_chain ) \
-{ \
- (_the_chain)->first = _Chain_Tail( (_the_chain) ); \
- (_the_chain)->permanent_null = NULL; \
- (_the_chain)->last = _Chain_Head( (_the_chain) ); \
-}
-
-/*PAGE
- *
- * _Chain_Extract_unprotected
- */
-
-#define _Chain_Extract_unprotected( _the_node ) \
-{ \
- Chain_Node *_next; \
- Chain_Node *_previous; \
- \
- _next = (_the_node)->next; \
- _previous = (_the_node)->previous; \
- _next->previous = _previous; \
- _previous->next = _next; \
-}
-
-/*PAGE
- *
- * _Chain_Get_unprotected
- */
-
-/*PAGE
- *
- * Chain_Get_unprotected
- */
-
-#define _Chain_Get_unprotected( _the_chain ) \
- (( !_Chain_Is_empty( (_the_chain) ) ) \
- ? _Chain_Get_first_unprotected( (_the_chain) ) \
- : NULL)
-
-/*PAGE
- *
- * _Chain_Insert_unprotected
- */
-
-#define _Chain_Insert_unprotected( _after_node, _the_node ) \
-do { \
- Chain_Node *_before_node; \
- \
- (_the_node)->previous = (_after_node); \
- _before_node = (_after_node)->next; \
- (_after_node)->next = (_the_node); \
- (_the_node)->next = _before_node; \
- _before_node->previous = (_the_node); \
-} while (0)
-
-/*PAGE
- *
- * _Chain_Append_unprotected
- */
-
-#define _Chain_Append_unprotected( _the_chain, _the_node ) \
-{ \
- Chain_Node *_old_last_node; \
- \
- (_the_node)->next = _Chain_Tail( (_the_chain) ); \
- _old_last_node = (_the_chain)->last; \
- (_the_chain)->last = (_the_node); \
- _old_last_node->next = (_the_node); \
- (_the_node)->previous = _old_last_node; \
-}
-
-/*PAGE
- *
- * _Chain_Prepend_unprotected
- */
-
-#define _Chain_Prepend_unprotected( _the_chain, _the_node ) \
- _Chain_Insert_unprotected( _Chain_Head( (_the_chain) ), (_the_node) )
-
-/*PAGE
- *
- * _Chain_Prepend
- */
-
-#define _Chain_Prepend( _the_chain, _the_node ) \
- _Chain_Insert( _Chain_Head( (_the_chain) ), (_the_node) )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/coremsg.inl b/c/src/exec/score/macros/coremsg.inl
deleted file mode 100644
index 9868c97074..0000000000
--- a/c/src/exec/score/macros/coremsg.inl
+++ /dev/null
@@ -1,143 +0,0 @@
-/* coremsg.inl
- *
- * This include file contains the macro implementation of all
- * inlined routines in the Core Message Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __CORE_MESSAGE_QUEUE_inl
-#define __CORE_MESSAGE_QUEUE_inl
-
-/*PAGE
- *
- * _CORE_message_queue_Send
- *
- */
-
-#define _CORE_message_queue_Send( _the_message_queue, _buffer, _size, \
-_id, _api_message_queue_mp_support ) \
- _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \
- (_id), (_api_message_queue_mp_support), CORE_MESSAGE_QUEUE_SEND_REQUEST )
-
-/*PAGE
- *
- * _CORE_message_queue_Urgent
- *
- */
-
-#define _CORE_message_queue_Urgent( _the_message_queue, _buffer, _size, \
-_id, _api_message_queue_mp_support ) \
- _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \
- (_id), (_api_message_queue_mp_support), CORE_MESSAGE_QUEUE_URGENT_REQUEST )
-
-/*PAGE
- *
- * _CORE_message_queue_Copy_buffer
- */
-
-#define _CORE_message_queue_Copy_buffer( _source, _destination, _size ) \
- memcpy( _destination, _source, _size)
-
-/*PAGE
- *
- * _CORE_message_queue_Allocate_message_buffer
- *
- */
-
-#define _CORE_message_queue_Allocate_message_buffer( _the_message_queue ) \
- (CORE_message_queue_Buffer_control *) \
- _Chain_Get( &(_the_message_queue)->Inactive_messages )
-
-/*PAGE
- *
- * _CORE_message_queue_Free_message_buffer
- *
- */
-
-#define _CORE_message_queue_Free_message_buffer( _the_message_queue, _the_message ) \
- _Chain_Append( \
- &(_the_message_queue)->Inactive_messages, \
- &(_the_message)->Node \
- )
-
-/*PAGE
- *
- * _CORE_message_queue_Is_priority
- *
- */
-
-#define _CORE_message_queue_Is_priority( _the_attribute ) \
- ((_the_attribute)->discipline == CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY)
-
-/*PAGE
- *
- * _CORE_message_queue_Get_pending_message
- *
- */
-
-#define _CORE_message_queue_Get_pending_message( _the_message_queue ) \
- (CORE_message_queue_Buffer_control *) \
- _Chain_Get_unprotected( &(_the_message_queue)->Pending_messages )
-
-/*PAGE
- *
- * _CORE_message_queue_Append
- *
- */
-
-#define _CORE_message_queue_Append( _the_message_queue, _the_message ) \
- _Chain_Append( &(_the_message_queue)->Pending_messages, \
- &(_the_message)->Node )
-
-/*PAGE
- *
- * _CORE_message_queue_Prepend
- *
- */
-
-#define _CORE_message_queue_Prepend( _the_message_queue, _the_message ) \
- _Chain_Prepend( &(_the_message_queue)->Pending_messages, \
- &(_the_message)->Node )
-
-/*PAGE
- *
- * _CORE_message_queue_Is_null
- *
- */
-
-#define _CORE_message_queue_Is_null( _the_message_queue ) \
- ( (_the_message_queue) == NULL )
-
-/*PAGE
- *
- * _CORE_message_queue_Is_notify_enabled
- *
- */
-
-#define _CORE_message_queue_Is_notify_enabled( _the_message_queue ) \
- ( (_the_message_queue)->notify_handler != NULL )
-
-/*PAGE
- *
- * _CORE_message_queue_Set_notify
- *
- */
-
-#define _CORE_message_queue_Set_notify( \
- _the_message_queue, _the_handler, _the_argument ) \
- do { \
- (_the_message_queue)->notify_handler = (_the_handler); \
- (_the_message_queue)->notify_argument = (_the_argument); \
- } while ( 0 )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/coremutex.inl b/c/src/exec/score/macros/coremutex.inl
deleted file mode 100644
index 19d535dc4e..0000000000
--- a/c/src/exec/score/macros/coremutex.inl
+++ /dev/null
@@ -1,77 +0,0 @@
-/* macros/coremutex.h
- *
- * This include file contains all of the inlined routines associated
- * with core mutexes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_CORE_MUTEX_h
-#define __MACROS_CORE_MUTEX_h
-
-
-/*PAGE
- *
- * _CORE_mutex_Is_locked
- *
- */
-
-#define _CORE_mutex_Is_locked( _the_mutex ) \
- ( (_the_mutex)->lock == CORE_MUTEX_LOCKED )
-
-/*PAGE
- *
- * _CORE_mutex_Is_fifo
- *
- */
-
-#define _CORE_mutex_Is_fifo( _the_attribute ) \
- ( (_the_attribute)->discipline == CORE_MUTEX_DISCIPLINES_FIFO )
-
-/*PAGE
- *
- * _CORE_mutex_Is_priority
- *
- */
-
-#define _CORE_mutex_Is_priority( _the_attribute ) \
- ( (_the_attribute)->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY )
-
-/*PAGE
- *
- * _CORE_mutex_Is_inherit_priority
- *
- */
-
-#define _CORE_mutex_Is_inherit_priority( _the_attribute ) \
- ( (_the_attribute)->discipline == \
- CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT )
-
-/*PAGE
- *
- * _CORE_mutex_Is_priority_ceiling
- *
- */
-
-#define _CORE_mutex_Is_priority_ceiling( _the_attribute )\
- ( (_the_attribute)->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING )
-
-/*PAGE
- *
- * _CORE_mutex_Is_nesting_allowed
- *
- */
-
-#define _CORE_mutex_Is_nesting_allowed( _the_attribute ) \
- ( (_the_attribute)->allow_nesting == TRUE )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/coresem.inl b/c/src/exec/score/macros/coresem.inl
deleted file mode 100644
index fed9227c59..0000000000
--- a/c/src/exec/score/macros/coresem.inl
+++ /dev/null
@@ -1,40 +0,0 @@
-/* macros/coresem.h
- *
- * This include file contains all of the inlined routines associated
- * with core semaphores.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_CORE_SEMAPHORE_h
-#define __MACROS_CORE_SEMAPHORE_h
-
-/*PAGE
- *
- * _CORE_semaphore_Is_priority
- *
- */
-
-#define _CORE_semaphore_Is_priority( _the_attribute ) \
- ( (_the_attribute)->discipline == CORE_SEMAPHORE_DISCIPLINES_PRIORITY )
-
-/*PAGE
- *
- * _Core_semaphore_Get_count
- *
- */
-
-#define _Core_semaphore_Get_count( _the_semaphore ) \
- ( (_the_semaphore)->count )
-
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/heap.inl b/c/src/exec/score/macros/heap.inl
deleted file mode 100644
index d4bb8edb97..0000000000
--- a/c/src/exec/score/macros/heap.inl
+++ /dev/null
@@ -1,150 +0,0 @@
-/* heap.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the heap handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __HEAP_inl
-#define __HEAP_inl
-
-#include <rtems/score/address.h>
-
-/*PAGE
- *
- * _Heap_Head
- */
-
-#define _Heap_Head( _the_heap ) \
- ((Heap_Block *)&(_the_heap)->start)
-
-/*PAGE
- *
- * _Heap_Tail
- */
-
-#define _Heap_Tail( _the_heap ) \
- ((Heap_Block *)&(_the_heap)->final)
-
-/*PAGE
- *
- * _Heap_Previous_block
- */
-
-#define _Heap_Previous_block( _the_block ) \
- ( (Heap_Block *) _Addresses_Subtract_offset( \
- (void *)(_the_block), \
- (_the_block)->back_flag & ~ HEAP_BLOCK_USED \
- ) \
- )
-
-/*PAGE
- *
- * _Heap_Next_block
- */
-
-#define _Heap_Next_block( _the_block ) \
- ( (Heap_Block *) _Addresses_Add_offset( \
- (void *)(_the_block), \
- (_the_block)->front_flag & ~ HEAP_BLOCK_USED \
- ) \
- )
-
-/*PAGE
- *
- * _Heap_Block_at
- */
-
-#define _Heap_Block_at( _base, _offset ) \
- ( (Heap_Block *) \
- _Addresses_Add_offset( (void *)(_base), (_offset) ) )
-
-/*PAGE
- *
- * _Heap_User_block_at
- *
- */
-
-#define _Heap_User_block_at( _base ) \
- _Heap_Block_at( \
- (_base), \
- -*(((unsigned32 *) (_base)) - 1) + -HEAP_BLOCK_USED_OVERHEAD \
- )
-
-/*PAGE
- *
- * _Heap_Is_previous_block_free
- */
-
-#define _Heap_Is_previous_block_free( _the_block ) \
- ( !((_the_block)->back_flag & HEAP_BLOCK_USED) )
-
-/*PAGE
- *
- * _Heap_Is_block_free
- */
-
-#define _Heap_Is_block_free( _the_block ) \
- ( !((_the_block)->front_flag & HEAP_BLOCK_USED) )
-
-/*PAGE
- *
- * _Heap_Is_block_used
- */
-
-#define _Heap_Is_block_used( _the_block ) \
- ((_the_block)->front_flag & HEAP_BLOCK_USED)
-
-/*PAGE
- *
- * _Heap_Block_size
- */
-
-#define _Heap_Block_size( _the_block ) \
- ((_the_block)->front_flag & ~HEAP_BLOCK_USED)
-
-/*PAGE
- *
- * _Heap_Start_of_user_area
- */
-
-#define _Heap_Start_of_user_area( _the_block ) \
- ((void *) &(_the_block)->next)
-
-/*PAGE
- *
- * _Heap_Is_block_in
- */
-
-#define _Heap_Is_block_in( _the_heap, _the_block ) \
- ( ((_the_block) >= (_the_heap)->start) && \
- ((_the_block) <= (_the_heap)->final) )
-
-/*PAGE
- *
- * _Heap_Is_page_size_valid
- */
-
-#define _Heap_Is_page_size_valid( _page_size ) \
- ( ((_page_size) != 0) && \
- (((_page_size) % CPU_HEAP_ALIGNMENT) == 0) )
-
-/*PAGE
- *
- * _Heap_Build_flag
- */
-
-#define _Heap_Build_flag( _size, _in_use_flag ) \
- ( (_size) | (_in_use_flag))
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/isr.inl b/c/src/exec/score/macros/isr.inl
deleted file mode 100644
index b642c4fed2..0000000000
--- a/c/src/exec/score/macros/isr.inl
+++ /dev/null
@@ -1,48 +0,0 @@
-/* isr.inl
- *
- * This include file contains the macro implementation of all
- * inlined routines in the Interrupt Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __ISR_inl
-#define __ISR_inl
-
-/*PAGE
- *
- * _ISR_Is_in_progress
- *
- */
-
-#define _ISR_Is_in_progress() \
- (_ISR_Nest_level != 0)
-
-/*PAGE
- *
- * _ISR_Is_vector_number_valid
- *
- */
-
-#define _ISR_Is_vector_number_valid( _vector ) \
- ( (_vector) <= CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER )
-
-/*PAGE
- *
- * _ISR_Is_valid_user_handler
- *
- */
-
-#define _ISR_Is_valid_user_handler( _handler ) \
- ((_handler) != NULL)
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/mppkt.inl b/c/src/exec/score/macros/mppkt.inl
deleted file mode 100644
index b698602626..0000000000
--- a/c/src/exec/score/macros/mppkt.inl
+++ /dev/null
@@ -1,41 +0,0 @@
-/* macros/mppkt.h
- *
- * This package is the implementation of the Packet Handler
- * routines which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_MP_PACKET_h
-#define __MACROS_MP_PACKET_h
-
-/*PAGE
- *
- * _Mp_packet_Is_valid_packet_class
- *
- * NOTE: Check for lower bounds (MP_PACKET_CLASSES_FIRST ) is unnecessary
- * because this enum starts at lower bound of zero.
- */
-
-#define _Mp_packet_Is_valid_packet_class( _the_packet_class ) \
- ( (_the_packet_class) <= MP_PACKET_CLASSES_LAST )
-
-/*PAGE
- *
- * _Mp_packet_Is_null
- *
- */
-
-#define _Mp_packet_Is_null ( _the_packet ) \
- ( (_the_packet) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/object.inl b/c/src/exec/score/macros/object.inl
deleted file mode 100644
index cce2cbde9b..0000000000
--- a/c/src/exec/score/macros/object.inl
+++ /dev/null
@@ -1,148 +0,0 @@
-/* object.inl
- *
- * This include file contains the macro implementation of all
- * of the inlined routines in the Object Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OBJECTS_inl
-#define __OBJECTS_inl
-
-/*PAGE
- *
- * _Objects_Build_id
- *
- */
-
-#define _Objects_Build_id( _the_class, _node, _index ) \
- ( ((_the_class) << OBJECTS_CLASS_START_BIT) | \
- ((_node) << OBJECTS_NODE_START_BIT) | \
- ((_index) << OBJECTS_INDEX_START_BIT) )
-
-/*PAGE
- *
- * _Objects_Get_class
- */
-
-#define _Objects_Get_class( _id ) \
- (Objects_Classes) \
- (((_id) >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS)
-
-/*PAGE
- *
- * _Objects_Get_node
- *
- */
-
-#define _Objects_Get_node( _id ) \
- (((_id) >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS)
-
-/*PAGE
- *
- * _Objects_Get_index
- *
- */
-
-#define _Objects_Get_index( _id ) \
- (((_id) >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS)
-
-/*PAGE
- *
- * _Objects_Is_class_valid
- *
- */
-
-#define _Objects_Is_class_valid( _the_class ) \
- ( (_the_class) && (_the_class) <= OBJECTS_CLASSES_LAST )
-
-/*PAGE
- *
- * _Objects_Is_local_node
- *
- */
-
-#define _Objects_Is_local_node( _node ) \
- ( (_node) == _Objects_Local_node )
-
-/*PAGE
- *
- * _Objects_Is_local_id
- *
- */
-
-#define _Objects_Is_local_id( _id ) \
- _Objects_Is_local_node( _Objects_Get_node(_id) )
-
-/*PAGE
- *
- * _Objects_Are_ids_equal
- *
- */
-
-#define _Objects_Are_ids_equal( _left, _right ) \
- ( (_left) == (_right) )
-
-/*PAGE
- *
- * _Objects_Allocate
- *
- */
-
-#define _Objects_Allocate( _information ) \
- (Objects_Control *) _Chain_Get( &(_information)->Inactive )
-
-/*PAGE
- *
- * _Objects_Free
- *
- */
-
-#define _Objects_Free( _information, _the_object ) \
- _Chain_Append( &(_information)->Inactive, &(_the_object)->Node )
-
-/*PAGE
- *
- * _Objects_Open
- *
- */
-
-#define _Objects_Open( _information, _the_object, _name ) \
- { \
- unsigned32 _index; \
- \
- _index = _Objects_Get_index( (_the_object)->id ); \
- (_information)->local_table[ _index ] = (_the_object); \
- \
- if ( (_information)->is_string ) \
- _Objects_Copy_name_string( (_name), (_the_object)->name ); \
- else \
- _Objects_Copy_name_raw( \
- (_name), (_the_object)->name, (_information)->name_length ); \
- }
-
-/*PAGE
- *
- * _Objects_Close
- *
- */
-
-#define _Objects_Close( _information, _the_object ) \
- { \
- unsigned32 _index; \
- \
- _index = _Objects_Get_index( (_the_object)->id ); \
- (_information)->local_table[ _index ] = (Objects_Control *) NULL; \
- _Objects_Clear_name( (_the_object)->name, (_information)->name_length ); \
- }
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/objectmp.inl b/c/src/exec/score/macros/objectmp.inl
deleted file mode 100644
index 4593857fba..0000000000
--- a/c/src/exec/score/macros/objectmp.inl
+++ /dev/null
@@ -1,50 +0,0 @@
-/* macros/objectmp.inl
- *
- * This include file contains the bodies of all inlined routines
- * which deal with global objects.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_MP_OBJECTS_inl
-#define __MACROS_MP_OBJECTS_inl
-
-/*PAGE
- *
- * _Objects_MP_Allocate_global_object
- *
- */
-
-#define _Objects_MP_Allocate_global_object() \
- (Objects_MP_Control *) \
- _Chain_Get( &_Objects_MP_Inactive_global_objects )
-
-/*PAGE
- * _Objects_MP_Free_global_object
- *
- */
-
-#define _Objects_MP_Free_global_object( _the_object ) \
- _Chain_Append( \
- &_Objects_MP_Inactive_global_objects, \
- &(_the_object)->Object.Node \
- )
-
-/*PAGE
- * _Objects_MP_Is_null_global_object
- *
- */
-
-#define _Objects_MP_Is_null_global_object( _the_object ) \
- ( (_the_object) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/priority.inl b/c/src/exec/score/macros/priority.inl
deleted file mode 100644
index c588289163..0000000000
--- a/c/src/exec/score/macros/priority.inl
+++ /dev/null
@@ -1,170 +0,0 @@
-/* priority.inl
- *
- * This file contains the macro implementation of all inlined routines
- * in the Priority Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PRIORITY_inl
-#define __PRIORITY_inl
-
-#include <rtems/score/bitfield.h>
-
-/*PAGE
- *
- * _Priority_Handler_initialization
- *
- */
-
-#define _Priority_Handler_initialization() \
- { \
- unsigned32 index; \
- \
- _Priority_Major_bit_map = 0; \
- for ( index=0 ; index <16 ; index++ ) \
- _Priority_Bit_map[ index ] = 0; \
- }
-
-/*PAGE
- *
- * _Priority_Is_valid
- *
- */
-
- /*
- * Since PRIORITY_MINIMUM is 0 and priorities are stored unsigned,
- * then checking for less than 0 is unnecessary.
- */
-
-#define _Priority_Is_valid( _the_priority ) \
- ( (_the_priority) <= PRIORITY_MAXIMUM )
-
-/*PAGE
- *
- * _Priority_Major
- *
- */
-
-#define _Priority_Major( _the_priority ) ( (_the_priority) / 16 )
-
-/*PAGE
- *
- * _Priority_Minor
- *
- */
-
-#define _Priority_Minor( _the_priority ) ( (_the_priority) % 16 )
-
-#if ( CPU_USE_GENERIC_BITFIELD_CODE == TRUE )
-
-/*PAGE
- *
- * _Priority_Mask
- *
- */
-
-#define _Priority_Mask( _bit_number ) \
- (0x8000 >> _bit_number)
-
-/*PAGE
- *
- * _Priority_Bits_index
- *
- */
-
-#define _Priority_Bits_index( _bit_number ) \
- (_bit_number)
-
-#endif
-
-/*PAGE
- *
- * _Priority_Add_to_bit_map
- *
- */
-
-#define _Priority_Add_to_bit_map( _the_priority_map ) \
- { \
- *(_the_priority_map)->minor |= (_the_priority_map)->ready_minor; \
- _Priority_Major_bit_map |= (_the_priority_map)->ready_major; \
- }
-
-/*PAGE
- *
- * _Priority_Remove_from_bit_map
- *
- */
-
-#define _Priority_Remove_from_bit_map( _the_priority_map ) \
- { \
- *(_the_priority_map)->minor &= (_the_priority_map)->block_minor; \
- if ( *(_the_priority_map)->minor == 0 ) \
- _Priority_Major_bit_map &= (_the_priority_map)->block_major; \
- }
-
-/*PAGE
- *
- * _Priority_Get_highest
- *
- */
-
-#define _Priority_Get_highest( _high_priority ) \
- { \
- Priority_Bit_map_control minor; \
- Priority_Bit_map_control major; \
- \
- _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); \
- _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); \
- \
- (_high_priority) = (_Priority_Bits_index( major ) * 16) + \
- _Priority_Bits_index( minor ); \
- }
-
-/*PAGE
- *
- * _Priority_Initialize_information
- *
- */
-
-#define _Priority_Initialize_information( \
- _the_priority_map, _new_priority ) \
- { \
- Priority_Bit_map_control _major; \
- Priority_Bit_map_control _minor; \
- Priority_Bit_map_control _mask; \
- \
- _major = _Priority_Major( (_new_priority) ); \
- _minor = _Priority_Minor( (_new_priority) ); \
- \
- (_the_priority_map)->minor = \
- &_Priority_Bit_map[ _Priority_Bits_index(_major) ]; \
- \
- _mask = _Priority_Mask( _major ); \
- (_the_priority_map)->ready_major = _mask; \
- (_the_priority_map)->block_major = ~_mask; \
- \
- _mask = _Priority_Mask( _minor ); \
- (_the_priority_map)->ready_minor = _mask; \
- (_the_priority_map)->block_minor = ~_mask; \
- }
-
-/*PAGE
- *
- * _Priority_Is_group_empty
- *
- */
-
-#define _Priority_Is_group_empty ( _the_priority ) \
- ( (_the_priority) == 0 )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/Makefile.in b/c/src/exec/score/macros/rtems/score/Makefile.in
deleted file mode 100644
index f97d3bfcf3..0000000000
--- a/c/src/exec/score/macros/rtems/score/Makefile.in
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-I_PIECES= address chain coremsg coremutex coresem heap \
- isr mppkt object objectmp priority stack states sysstate thread \
- threadmp tod tqdata userext watchdog wkspace
-I_FILES=$(I_PIECES:%=$(srcdir)/%.inl)
-
-SRCS=$(I_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 ${I_FILES} $(PROJECT_INCLUDE)/rtems/score
diff --git a/c/src/exec/score/macros/rtems/score/README b/c/src/exec/score/macros/rtems/score/README
deleted file mode 100644
index b2f0c4d481..0000000000
--- a/c/src/exec/score/macros/rtems/score/README
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# $Id$
-#
-
-The files in this directory are not considered the "primary" source
-of inlined routines for RTEMS. The "inline" directory contains
-the implementations of the inlined basis which are regularly
-tested. In general, an effort is made to keep the contents of
-this directory up to date but testing is only performed irregularly
-and even then it is usually with a single target processor and BSP.
-
-The primary purpose of the code in this directory is to insure
-that RTEMS can be compiled using a C compiler which does not support
-static inline routines.
-
-These were last successfully tested on 2/1/95 on a prerelease version
-of 3.2.0. The testing was done only on the Force CPU386 i386 target board.
-No testing was done on version of the code in the final release.
diff --git a/c/src/exec/score/macros/rtems/score/address.inl b/c/src/exec/score/macros/rtems/score/address.inl
deleted file mode 100644
index 712809a4e7..0000000000
--- a/c/src/exec/score/macros/rtems/score/address.inl
+++ /dev/null
@@ -1,68 +0,0 @@
-/* macros/address.h
- *
- * This include file contains the bodies of the routines
- * about addresses which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_ADDRESSES_h
-#define __MACROS_ADDRESSES_h
-
-/*PAGE
- *
- * _Addresses_Add_offset
- *
- */
-
-#define _Addresses_Add_offset( _base, _offset ) \
- ((void *)((char *)(_base) + (_offset)))
-
-/*PAGE
- *
- * _Addresses_Subtract_offset
- *
- */
-
-#define _Addresses_Subtract_offset( _base, _offset ) \
- ((void *)((char *)(_base) - (_offset)))
-
-/*PAGE
- *
- * _Addresses_Subtract
- *
- * NOTE: The cast of an address to an unsigned32 makes this code
- * dependent on an addresses being thirty two bits.
- */
-
-#define _Addresses_Subtract( _left, _right ) \
- ((void *)(_left) - (void *)(_right))
-
-/*PAGE
- *
- * _Addresses_Is_aligned
- *
- */
-
-#define _Addresses_Is_aligned( _address ) \
- ( ( (unsigned32)(_address) % 4 ) == 0 )
-
-/*PAGE
- *
- * _Addresses_Is_in_range
- *
- */
-
-#define _Addresses_Is_in_range( _address, _base, _limit ) \
- ( (_address) >= (_base) && (_address) <= (_limit) )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/chain.inl b/c/src/exec/score/macros/rtems/score/chain.inl
deleted file mode 100644
index 85ede31c12..0000000000
--- a/c/src/exec/score/macros/rtems/score/chain.inl
+++ /dev/null
@@ -1,200 +0,0 @@
-/* macros/chain.h
- *
- * This include file contains the bodies of the routines which are
- * associated with doubly linked chains and inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_CHAIN_h
-#define __MACROS_CHAIN_h
-
-/*PAGE
- *
- * _Chain_Are_nodes_equal
- */
-
-#define _Chain_Are_nodes_equal( _left, _right ) \
- ( (_left) == (_right) )
-
-/*PAGE
- *
- * _Chain_Is_null
- */
-
-#define _Chain_Is_null( _the_chain ) \
- ( (_the_chain) == NULL )
-
-/*PAGE
- *
- * _Chain_Is_null_node
- */
-
-#define _Chain_Is_null_node( _the_node ) \
- ( (_the_node) == NULL )
-
-/*PAGE
- *
- * _Chain_Head
- */
-
-#define _Chain_Head( _the_chain ) \
- ((Chain_Node *) (_the_chain))
-
-/*PAGE
- *
- * _Chain_Tail
- */
-
-#define _Chain_Tail( _the_chain ) \
- ((Chain_Node *) &(_the_chain)->permanent_null)
-
-/*PAGE
- *
- * _Chain_Is_empty
- */
-
-#define _Chain_Is_empty( _the_chain ) \
- ( (_the_chain)->first == _Chain_Tail( (_the_chain) ) )
-
-/*PAGE
- *
- * _Chain_Is_first
- */
-
-#define _Chain_Is_first( _the_node ) \
- ( (the_node)->previous == NULL )
-
-/*PAGE
- *
- * _Chain_Is_last
- */
-
-#define _Chain_Is_last( _the_node ) \
- ( (_the_node)->next == NULL )
-
-/*PAGE
- *
- * _Chain_Has_only_one_node
- */
-
-#define _Chain_Has_only_one_node( _the_chain ) \
- ( (_the_chain)->first == (_the_chain)->last )
-
-/*PAGE
- *
- * _Chain_Is_head
- */
-
-#define _Chain_Is_head( _the_chain, _the_node ) \
- ( (_the_node) == _Chain_Head( (_the_chain) ) )
-
-/*PAGE
- *
- * _Chain_Is_tail
- */
-
-#define _Chain_Is_tail( _the_chain, _the_node ) \
- ( (_the_node) == _Chain_Tail( (_the_chain) ) )
-
-/*PAGE
- *
- * Chain_Initialize_empty
- */
-
-#define _Chain_Initialize_empty( _the_chain ) \
-{ \
- (_the_chain)->first = _Chain_Tail( (_the_chain) ); \
- (_the_chain)->permanent_null = NULL; \
- (_the_chain)->last = _Chain_Head( (_the_chain) ); \
-}
-
-/*PAGE
- *
- * _Chain_Extract_unprotected
- */
-
-#define _Chain_Extract_unprotected( _the_node ) \
-{ \
- Chain_Node *_next; \
- Chain_Node *_previous; \
- \
- _next = (_the_node)->next; \
- _previous = (_the_node)->previous; \
- _next->previous = _previous; \
- _previous->next = _next; \
-}
-
-/*PAGE
- *
- * _Chain_Get_unprotected
- */
-
-/*PAGE
- *
- * Chain_Get_unprotected
- */
-
-#define _Chain_Get_unprotected( _the_chain ) \
- (( !_Chain_Is_empty( (_the_chain) ) ) \
- ? _Chain_Get_first_unprotected( (_the_chain) ) \
- : NULL)
-
-/*PAGE
- *
- * _Chain_Insert_unprotected
- */
-
-#define _Chain_Insert_unprotected( _after_node, _the_node ) \
-do { \
- Chain_Node *_before_node; \
- \
- (_the_node)->previous = (_after_node); \
- _before_node = (_after_node)->next; \
- (_after_node)->next = (_the_node); \
- (_the_node)->next = _before_node; \
- _before_node->previous = (_the_node); \
-} while (0)
-
-/*PAGE
- *
- * _Chain_Append_unprotected
- */
-
-#define _Chain_Append_unprotected( _the_chain, _the_node ) \
-{ \
- Chain_Node *_old_last_node; \
- \
- (_the_node)->next = _Chain_Tail( (_the_chain) ); \
- _old_last_node = (_the_chain)->last; \
- (_the_chain)->last = (_the_node); \
- _old_last_node->next = (_the_node); \
- (_the_node)->previous = _old_last_node; \
-}
-
-/*PAGE
- *
- * _Chain_Prepend_unprotected
- */
-
-#define _Chain_Prepend_unprotected( _the_chain, _the_node ) \
- _Chain_Insert_unprotected( _Chain_Head( (_the_chain) ), (_the_node) )
-
-/*PAGE
- *
- * _Chain_Prepend
- */
-
-#define _Chain_Prepend( _the_chain, _the_node ) \
- _Chain_Insert( _Chain_Head( (_the_chain) ), (_the_node) )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/coremsg.inl b/c/src/exec/score/macros/rtems/score/coremsg.inl
deleted file mode 100644
index 9868c97074..0000000000
--- a/c/src/exec/score/macros/rtems/score/coremsg.inl
+++ /dev/null
@@ -1,143 +0,0 @@
-/* coremsg.inl
- *
- * This include file contains the macro implementation of all
- * inlined routines in the Core Message Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __CORE_MESSAGE_QUEUE_inl
-#define __CORE_MESSAGE_QUEUE_inl
-
-/*PAGE
- *
- * _CORE_message_queue_Send
- *
- */
-
-#define _CORE_message_queue_Send( _the_message_queue, _buffer, _size, \
-_id, _api_message_queue_mp_support ) \
- _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \
- (_id), (_api_message_queue_mp_support), CORE_MESSAGE_QUEUE_SEND_REQUEST )
-
-/*PAGE
- *
- * _CORE_message_queue_Urgent
- *
- */
-
-#define _CORE_message_queue_Urgent( _the_message_queue, _buffer, _size, \
-_id, _api_message_queue_mp_support ) \
- _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \
- (_id), (_api_message_queue_mp_support), CORE_MESSAGE_QUEUE_URGENT_REQUEST )
-
-/*PAGE
- *
- * _CORE_message_queue_Copy_buffer
- */
-
-#define _CORE_message_queue_Copy_buffer( _source, _destination, _size ) \
- memcpy( _destination, _source, _size)
-
-/*PAGE
- *
- * _CORE_message_queue_Allocate_message_buffer
- *
- */
-
-#define _CORE_message_queue_Allocate_message_buffer( _the_message_queue ) \
- (CORE_message_queue_Buffer_control *) \
- _Chain_Get( &(_the_message_queue)->Inactive_messages )
-
-/*PAGE
- *
- * _CORE_message_queue_Free_message_buffer
- *
- */
-
-#define _CORE_message_queue_Free_message_buffer( _the_message_queue, _the_message ) \
- _Chain_Append( \
- &(_the_message_queue)->Inactive_messages, \
- &(_the_message)->Node \
- )
-
-/*PAGE
- *
- * _CORE_message_queue_Is_priority
- *
- */
-
-#define _CORE_message_queue_Is_priority( _the_attribute ) \
- ((_the_attribute)->discipline == CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY)
-
-/*PAGE
- *
- * _CORE_message_queue_Get_pending_message
- *
- */
-
-#define _CORE_message_queue_Get_pending_message( _the_message_queue ) \
- (CORE_message_queue_Buffer_control *) \
- _Chain_Get_unprotected( &(_the_message_queue)->Pending_messages )
-
-/*PAGE
- *
- * _CORE_message_queue_Append
- *
- */
-
-#define _CORE_message_queue_Append( _the_message_queue, _the_message ) \
- _Chain_Append( &(_the_message_queue)->Pending_messages, \
- &(_the_message)->Node )
-
-/*PAGE
- *
- * _CORE_message_queue_Prepend
- *
- */
-
-#define _CORE_message_queue_Prepend( _the_message_queue, _the_message ) \
- _Chain_Prepend( &(_the_message_queue)->Pending_messages, \
- &(_the_message)->Node )
-
-/*PAGE
- *
- * _CORE_message_queue_Is_null
- *
- */
-
-#define _CORE_message_queue_Is_null( _the_message_queue ) \
- ( (_the_message_queue) == NULL )
-
-/*PAGE
- *
- * _CORE_message_queue_Is_notify_enabled
- *
- */
-
-#define _CORE_message_queue_Is_notify_enabled( _the_message_queue ) \
- ( (_the_message_queue)->notify_handler != NULL )
-
-/*PAGE
- *
- * _CORE_message_queue_Set_notify
- *
- */
-
-#define _CORE_message_queue_Set_notify( \
- _the_message_queue, _the_handler, _the_argument ) \
- do { \
- (_the_message_queue)->notify_handler = (_the_handler); \
- (_the_message_queue)->notify_argument = (_the_argument); \
- } while ( 0 )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/coremutex.inl b/c/src/exec/score/macros/rtems/score/coremutex.inl
deleted file mode 100644
index 19d535dc4e..0000000000
--- a/c/src/exec/score/macros/rtems/score/coremutex.inl
+++ /dev/null
@@ -1,77 +0,0 @@
-/* macros/coremutex.h
- *
- * This include file contains all of the inlined routines associated
- * with core mutexes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_CORE_MUTEX_h
-#define __MACROS_CORE_MUTEX_h
-
-
-/*PAGE
- *
- * _CORE_mutex_Is_locked
- *
- */
-
-#define _CORE_mutex_Is_locked( _the_mutex ) \
- ( (_the_mutex)->lock == CORE_MUTEX_LOCKED )
-
-/*PAGE
- *
- * _CORE_mutex_Is_fifo
- *
- */
-
-#define _CORE_mutex_Is_fifo( _the_attribute ) \
- ( (_the_attribute)->discipline == CORE_MUTEX_DISCIPLINES_FIFO )
-
-/*PAGE
- *
- * _CORE_mutex_Is_priority
- *
- */
-
-#define _CORE_mutex_Is_priority( _the_attribute ) \
- ( (_the_attribute)->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY )
-
-/*PAGE
- *
- * _CORE_mutex_Is_inherit_priority
- *
- */
-
-#define _CORE_mutex_Is_inherit_priority( _the_attribute ) \
- ( (_the_attribute)->discipline == \
- CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT )
-
-/*PAGE
- *
- * _CORE_mutex_Is_priority_ceiling
- *
- */
-
-#define _CORE_mutex_Is_priority_ceiling( _the_attribute )\
- ( (_the_attribute)->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING )
-
-/*PAGE
- *
- * _CORE_mutex_Is_nesting_allowed
- *
- */
-
-#define _CORE_mutex_Is_nesting_allowed( _the_attribute ) \
- ( (_the_attribute)->allow_nesting == TRUE )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/coresem.inl b/c/src/exec/score/macros/rtems/score/coresem.inl
deleted file mode 100644
index fed9227c59..0000000000
--- a/c/src/exec/score/macros/rtems/score/coresem.inl
+++ /dev/null
@@ -1,40 +0,0 @@
-/* macros/coresem.h
- *
- * This include file contains all of the inlined routines associated
- * with core semaphores.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_CORE_SEMAPHORE_h
-#define __MACROS_CORE_SEMAPHORE_h
-
-/*PAGE
- *
- * _CORE_semaphore_Is_priority
- *
- */
-
-#define _CORE_semaphore_Is_priority( _the_attribute ) \
- ( (_the_attribute)->discipline == CORE_SEMAPHORE_DISCIPLINES_PRIORITY )
-
-/*PAGE
- *
- * _Core_semaphore_Get_count
- *
- */
-
-#define _Core_semaphore_Get_count( _the_semaphore ) \
- ( (_the_semaphore)->count )
-
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/heap.inl b/c/src/exec/score/macros/rtems/score/heap.inl
deleted file mode 100644
index d4bb8edb97..0000000000
--- a/c/src/exec/score/macros/rtems/score/heap.inl
+++ /dev/null
@@ -1,150 +0,0 @@
-/* heap.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the heap handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __HEAP_inl
-#define __HEAP_inl
-
-#include <rtems/score/address.h>
-
-/*PAGE
- *
- * _Heap_Head
- */
-
-#define _Heap_Head( _the_heap ) \
- ((Heap_Block *)&(_the_heap)->start)
-
-/*PAGE
- *
- * _Heap_Tail
- */
-
-#define _Heap_Tail( _the_heap ) \
- ((Heap_Block *)&(_the_heap)->final)
-
-/*PAGE
- *
- * _Heap_Previous_block
- */
-
-#define _Heap_Previous_block( _the_block ) \
- ( (Heap_Block *) _Addresses_Subtract_offset( \
- (void *)(_the_block), \
- (_the_block)->back_flag & ~ HEAP_BLOCK_USED \
- ) \
- )
-
-/*PAGE
- *
- * _Heap_Next_block
- */
-
-#define _Heap_Next_block( _the_block ) \
- ( (Heap_Block *) _Addresses_Add_offset( \
- (void *)(_the_block), \
- (_the_block)->front_flag & ~ HEAP_BLOCK_USED \
- ) \
- )
-
-/*PAGE
- *
- * _Heap_Block_at
- */
-
-#define _Heap_Block_at( _base, _offset ) \
- ( (Heap_Block *) \
- _Addresses_Add_offset( (void *)(_base), (_offset) ) )
-
-/*PAGE
- *
- * _Heap_User_block_at
- *
- */
-
-#define _Heap_User_block_at( _base ) \
- _Heap_Block_at( \
- (_base), \
- -*(((unsigned32 *) (_base)) - 1) + -HEAP_BLOCK_USED_OVERHEAD \
- )
-
-/*PAGE
- *
- * _Heap_Is_previous_block_free
- */
-
-#define _Heap_Is_previous_block_free( _the_block ) \
- ( !((_the_block)->back_flag & HEAP_BLOCK_USED) )
-
-/*PAGE
- *
- * _Heap_Is_block_free
- */
-
-#define _Heap_Is_block_free( _the_block ) \
- ( !((_the_block)->front_flag & HEAP_BLOCK_USED) )
-
-/*PAGE
- *
- * _Heap_Is_block_used
- */
-
-#define _Heap_Is_block_used( _the_block ) \
- ((_the_block)->front_flag & HEAP_BLOCK_USED)
-
-/*PAGE
- *
- * _Heap_Block_size
- */
-
-#define _Heap_Block_size( _the_block ) \
- ((_the_block)->front_flag & ~HEAP_BLOCK_USED)
-
-/*PAGE
- *
- * _Heap_Start_of_user_area
- */
-
-#define _Heap_Start_of_user_area( _the_block ) \
- ((void *) &(_the_block)->next)
-
-/*PAGE
- *
- * _Heap_Is_block_in
- */
-
-#define _Heap_Is_block_in( _the_heap, _the_block ) \
- ( ((_the_block) >= (_the_heap)->start) && \
- ((_the_block) <= (_the_heap)->final) )
-
-/*PAGE
- *
- * _Heap_Is_page_size_valid
- */
-
-#define _Heap_Is_page_size_valid( _page_size ) \
- ( ((_page_size) != 0) && \
- (((_page_size) % CPU_HEAP_ALIGNMENT) == 0) )
-
-/*PAGE
- *
- * _Heap_Build_flag
- */
-
-#define _Heap_Build_flag( _size, _in_use_flag ) \
- ( (_size) | (_in_use_flag))
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/isr.inl b/c/src/exec/score/macros/rtems/score/isr.inl
deleted file mode 100644
index b642c4fed2..0000000000
--- a/c/src/exec/score/macros/rtems/score/isr.inl
+++ /dev/null
@@ -1,48 +0,0 @@
-/* isr.inl
- *
- * This include file contains the macro implementation of all
- * inlined routines in the Interrupt Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __ISR_inl
-#define __ISR_inl
-
-/*PAGE
- *
- * _ISR_Is_in_progress
- *
- */
-
-#define _ISR_Is_in_progress() \
- (_ISR_Nest_level != 0)
-
-/*PAGE
- *
- * _ISR_Is_vector_number_valid
- *
- */
-
-#define _ISR_Is_vector_number_valid( _vector ) \
- ( (_vector) <= CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER )
-
-/*PAGE
- *
- * _ISR_Is_valid_user_handler
- *
- */
-
-#define _ISR_Is_valid_user_handler( _handler ) \
- ((_handler) != NULL)
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/mppkt.inl b/c/src/exec/score/macros/rtems/score/mppkt.inl
deleted file mode 100644
index b698602626..0000000000
--- a/c/src/exec/score/macros/rtems/score/mppkt.inl
+++ /dev/null
@@ -1,41 +0,0 @@
-/* macros/mppkt.h
- *
- * This package is the implementation of the Packet Handler
- * routines which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_MP_PACKET_h
-#define __MACROS_MP_PACKET_h
-
-/*PAGE
- *
- * _Mp_packet_Is_valid_packet_class
- *
- * NOTE: Check for lower bounds (MP_PACKET_CLASSES_FIRST ) is unnecessary
- * because this enum starts at lower bound of zero.
- */
-
-#define _Mp_packet_Is_valid_packet_class( _the_packet_class ) \
- ( (_the_packet_class) <= MP_PACKET_CLASSES_LAST )
-
-/*PAGE
- *
- * _Mp_packet_Is_null
- *
- */
-
-#define _Mp_packet_Is_null ( _the_packet ) \
- ( (_the_packet) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/object.inl b/c/src/exec/score/macros/rtems/score/object.inl
deleted file mode 100644
index cce2cbde9b..0000000000
--- a/c/src/exec/score/macros/rtems/score/object.inl
+++ /dev/null
@@ -1,148 +0,0 @@
-/* object.inl
- *
- * This include file contains the macro implementation of all
- * of the inlined routines in the Object Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OBJECTS_inl
-#define __OBJECTS_inl
-
-/*PAGE
- *
- * _Objects_Build_id
- *
- */
-
-#define _Objects_Build_id( _the_class, _node, _index ) \
- ( ((_the_class) << OBJECTS_CLASS_START_BIT) | \
- ((_node) << OBJECTS_NODE_START_BIT) | \
- ((_index) << OBJECTS_INDEX_START_BIT) )
-
-/*PAGE
- *
- * _Objects_Get_class
- */
-
-#define _Objects_Get_class( _id ) \
- (Objects_Classes) \
- (((_id) >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS)
-
-/*PAGE
- *
- * _Objects_Get_node
- *
- */
-
-#define _Objects_Get_node( _id ) \
- (((_id) >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS)
-
-/*PAGE
- *
- * _Objects_Get_index
- *
- */
-
-#define _Objects_Get_index( _id ) \
- (((_id) >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS)
-
-/*PAGE
- *
- * _Objects_Is_class_valid
- *
- */
-
-#define _Objects_Is_class_valid( _the_class ) \
- ( (_the_class) && (_the_class) <= OBJECTS_CLASSES_LAST )
-
-/*PAGE
- *
- * _Objects_Is_local_node
- *
- */
-
-#define _Objects_Is_local_node( _node ) \
- ( (_node) == _Objects_Local_node )
-
-/*PAGE
- *
- * _Objects_Is_local_id
- *
- */
-
-#define _Objects_Is_local_id( _id ) \
- _Objects_Is_local_node( _Objects_Get_node(_id) )
-
-/*PAGE
- *
- * _Objects_Are_ids_equal
- *
- */
-
-#define _Objects_Are_ids_equal( _left, _right ) \
- ( (_left) == (_right) )
-
-/*PAGE
- *
- * _Objects_Allocate
- *
- */
-
-#define _Objects_Allocate( _information ) \
- (Objects_Control *) _Chain_Get( &(_information)->Inactive )
-
-/*PAGE
- *
- * _Objects_Free
- *
- */
-
-#define _Objects_Free( _information, _the_object ) \
- _Chain_Append( &(_information)->Inactive, &(_the_object)->Node )
-
-/*PAGE
- *
- * _Objects_Open
- *
- */
-
-#define _Objects_Open( _information, _the_object, _name ) \
- { \
- unsigned32 _index; \
- \
- _index = _Objects_Get_index( (_the_object)->id ); \
- (_information)->local_table[ _index ] = (_the_object); \
- \
- if ( (_information)->is_string ) \
- _Objects_Copy_name_string( (_name), (_the_object)->name ); \
- else \
- _Objects_Copy_name_raw( \
- (_name), (_the_object)->name, (_information)->name_length ); \
- }
-
-/*PAGE
- *
- * _Objects_Close
- *
- */
-
-#define _Objects_Close( _information, _the_object ) \
- { \
- unsigned32 _index; \
- \
- _index = _Objects_Get_index( (_the_object)->id ); \
- (_information)->local_table[ _index ] = (Objects_Control *) NULL; \
- _Objects_Clear_name( (_the_object)->name, (_information)->name_length ); \
- }
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/objectmp.inl b/c/src/exec/score/macros/rtems/score/objectmp.inl
deleted file mode 100644
index 4593857fba..0000000000
--- a/c/src/exec/score/macros/rtems/score/objectmp.inl
+++ /dev/null
@@ -1,50 +0,0 @@
-/* macros/objectmp.inl
- *
- * This include file contains the bodies of all inlined routines
- * which deal with global objects.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_MP_OBJECTS_inl
-#define __MACROS_MP_OBJECTS_inl
-
-/*PAGE
- *
- * _Objects_MP_Allocate_global_object
- *
- */
-
-#define _Objects_MP_Allocate_global_object() \
- (Objects_MP_Control *) \
- _Chain_Get( &_Objects_MP_Inactive_global_objects )
-
-/*PAGE
- * _Objects_MP_Free_global_object
- *
- */
-
-#define _Objects_MP_Free_global_object( _the_object ) \
- _Chain_Append( \
- &_Objects_MP_Inactive_global_objects, \
- &(_the_object)->Object.Node \
- )
-
-/*PAGE
- * _Objects_MP_Is_null_global_object
- *
- */
-
-#define _Objects_MP_Is_null_global_object( _the_object ) \
- ( (_the_object) == NULL )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/priority.inl b/c/src/exec/score/macros/rtems/score/priority.inl
deleted file mode 100644
index c588289163..0000000000
--- a/c/src/exec/score/macros/rtems/score/priority.inl
+++ /dev/null
@@ -1,170 +0,0 @@
-/* priority.inl
- *
- * This file contains the macro implementation of all inlined routines
- * in the Priority Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PRIORITY_inl
-#define __PRIORITY_inl
-
-#include <rtems/score/bitfield.h>
-
-/*PAGE
- *
- * _Priority_Handler_initialization
- *
- */
-
-#define _Priority_Handler_initialization() \
- { \
- unsigned32 index; \
- \
- _Priority_Major_bit_map = 0; \
- for ( index=0 ; index <16 ; index++ ) \
- _Priority_Bit_map[ index ] = 0; \
- }
-
-/*PAGE
- *
- * _Priority_Is_valid
- *
- */
-
- /*
- * Since PRIORITY_MINIMUM is 0 and priorities are stored unsigned,
- * then checking for less than 0 is unnecessary.
- */
-
-#define _Priority_Is_valid( _the_priority ) \
- ( (_the_priority) <= PRIORITY_MAXIMUM )
-
-/*PAGE
- *
- * _Priority_Major
- *
- */
-
-#define _Priority_Major( _the_priority ) ( (_the_priority) / 16 )
-
-/*PAGE
- *
- * _Priority_Minor
- *
- */
-
-#define _Priority_Minor( _the_priority ) ( (_the_priority) % 16 )
-
-#if ( CPU_USE_GENERIC_BITFIELD_CODE == TRUE )
-
-/*PAGE
- *
- * _Priority_Mask
- *
- */
-
-#define _Priority_Mask( _bit_number ) \
- (0x8000 >> _bit_number)
-
-/*PAGE
- *
- * _Priority_Bits_index
- *
- */
-
-#define _Priority_Bits_index( _bit_number ) \
- (_bit_number)
-
-#endif
-
-/*PAGE
- *
- * _Priority_Add_to_bit_map
- *
- */
-
-#define _Priority_Add_to_bit_map( _the_priority_map ) \
- { \
- *(_the_priority_map)->minor |= (_the_priority_map)->ready_minor; \
- _Priority_Major_bit_map |= (_the_priority_map)->ready_major; \
- }
-
-/*PAGE
- *
- * _Priority_Remove_from_bit_map
- *
- */
-
-#define _Priority_Remove_from_bit_map( _the_priority_map ) \
- { \
- *(_the_priority_map)->minor &= (_the_priority_map)->block_minor; \
- if ( *(_the_priority_map)->minor == 0 ) \
- _Priority_Major_bit_map &= (_the_priority_map)->block_major; \
- }
-
-/*PAGE
- *
- * _Priority_Get_highest
- *
- */
-
-#define _Priority_Get_highest( _high_priority ) \
- { \
- Priority_Bit_map_control minor; \
- Priority_Bit_map_control major; \
- \
- _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); \
- _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); \
- \
- (_high_priority) = (_Priority_Bits_index( major ) * 16) + \
- _Priority_Bits_index( minor ); \
- }
-
-/*PAGE
- *
- * _Priority_Initialize_information
- *
- */
-
-#define _Priority_Initialize_information( \
- _the_priority_map, _new_priority ) \
- { \
- Priority_Bit_map_control _major; \
- Priority_Bit_map_control _minor; \
- Priority_Bit_map_control _mask; \
- \
- _major = _Priority_Major( (_new_priority) ); \
- _minor = _Priority_Minor( (_new_priority) ); \
- \
- (_the_priority_map)->minor = \
- &_Priority_Bit_map[ _Priority_Bits_index(_major) ]; \
- \
- _mask = _Priority_Mask( _major ); \
- (_the_priority_map)->ready_major = _mask; \
- (_the_priority_map)->block_major = ~_mask; \
- \
- _mask = _Priority_Mask( _minor ); \
- (_the_priority_map)->ready_minor = _mask; \
- (_the_priority_map)->block_minor = ~_mask; \
- }
-
-/*PAGE
- *
- * _Priority_Is_group_empty
- *
- */
-
-#define _Priority_Is_group_empty ( _the_priority ) \
- ( (_the_priority) == 0 )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/stack.inl b/c/src/exec/score/macros/rtems/score/stack.inl
deleted file mode 100644
index 0e976eb0e0..0000000000
--- a/c/src/exec/score/macros/rtems/score/stack.inl
+++ /dev/null
@@ -1,50 +0,0 @@
-/* stack.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Stack Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STACK_inl
-#define __STACK_inl
-
-/*PAGE
- *
- * _Stack_Initialize
- *
- */
-
-#define _Stack_Initialize( _the_stack, _starting_address, _size ) \
- { \
- (_the_stack)->area = (_starting_address); \
- (_the_stack)->size = (_size); \
- }
-
-/*PAGE
- *
- * _Stack_Is_enough
- *
- */
-
-#define _Stack_Is_enough( _size ) \
- ( (_size) >= STACK_MINIMUM_SIZE )
-
-/*PAGE
- *
- * _Stack_Adjust_size
- */
-
-#define _Stack_Adjust_size( _size ) \
- ((_size) + CPU_STACK_ALIGNMENT)
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/states.inl b/c/src/exec/score/macros/rtems/score/states.inl
deleted file mode 100644
index a100da077a..0000000000
--- a/c/src/exec/score/macros/rtems/score/states.inl
+++ /dev/null
@@ -1,210 +0,0 @@
-/* states.inl
- *
- * This file contains the macro implementation of the inlined
- * routines associated with thread state information.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STATES_inl
-#define __STATES_inl
-
-/*PAGE
- *
- * _States_Set
- *
- */
-
-#define _States_Set( _states_to_set, _current_state ) \
- ((_current_state) | (_states_to_set))
-
-/*PAGE
- *
- * _States_Clear
- *
- */
-
-#define _States_Clear( _states_to_clear, _current_state ) \
- ((_current_state) & ~(_states_to_clear))
-
-/*PAGE
- *
- * _States_Is_ready
- *
- */
-
-#define _States_Is_ready( _the_states ) \
- ( (_the_states) == STATES_READY )
-
-/*PAGE
- *
- * _States_Is_only_dormant
- *
- */
-
-#define _States_Is_only_dormant( _the_states ) \
- ( (_the_states) == STATES_DORMANT )
-
-/*PAGE
- *
- * _States_Is_dormant
- *
- */
-
-#define _States_Is_dormant( _the_states ) \
- ( (_the_states) & STATES_DORMANT )
-
-/*PAGE
- *
- * _States_Is_suspended
- *
- */
-
-#define _States_Is_suspended( _the_states ) \
- ( (_the_states) & STATES_SUSPENDED )
-
-/*PAGE
- *
- * _States_Is_Transient
- *
- */
-
-#define _States_Is_transient( _the_states ) \
- ( (_the_states) & STATES_TRANSIENT )
-
-/*PAGE
- *
- * _States_Is_delaying
- *
- */
-
-#define _States_Is_delaying( _the_states ) \
- ( (_the_states) & STATES_DELAYING )
-
-/*PAGE
- *
- * _States_Is_waiting_for_buffer
- *
- */
-
-#define _States_Is_waiting_for_buffer( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_BUFFER )
-
-/*PAGE
- *
- * _States_Is_waiting_for_segment
- *
- */
-
-#define _States_Is_waiting_for_segment( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_SEGMENT )
-
-/*PAGE
- *
- * _States_Is_waiting_for_message
- *
- */
-
-#define _States_Is_waiting_for_message( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_MESSAGE )
-
-/*PAGE
- *
- * _States_Is_waiting_for_event
- *
- */
-
-#define _States_Is_waiting_for_event( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_EVENT )
-
-/*PAGE
- *
- * _States_Is_waiting_for_mutex
- *
- */
-
-#define _States_Is_waiting_for_mutex( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_MUTEX )
-
-/*PAGE
- *
- * _States_Is_waiting_for_semaphore
- *
- */
-
-#define _States_Is_waiting_for_semaphore( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_SEMAPHORE )
-
-/*PAGE
- *
- * _States_Is_waiting_for_time
- *
- */
-
-#define _States_Is_waiting_for_time( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_TIME )
-
-/*PAGE
- *
- * _States_Is_waiting_for_rpc_reply
- *
- */
-
-#define _States_Is_waiting_for_rpc_reply( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_RPC_REPLY )
-
-/*PAGE
- *
- * _States_Is_waiting_for_period
- *
- */
-
-#define _States_Is_waiting_for_period( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_PERIOD )
-
-/*PAGE
- *
- * _States_Is_locally_blocked
- *
- */
-
-#define _States_Is_locally_blocked( _the_states ) \
- ( (_the_states) & STATES_LOCALLY_BLOCKED )
-
-/*PAGE
- *
- * _States_Is_waiting_on_thread_queue
- *
- */
-
-#define _States_Is_waiting_on_thread_queue( _the_states ) \
- ( (_the_states) & STATES_WAITING_ON_THREAD_QUEUE )
-
-/*PAGE
- *
- * _States_Is_blocked
- *
- */
-
-#define _States_Is_blocked( _the_states ) \
- ( (_the_states) & STATES_BLOCKED )
-
-/*PAGE
- *
- * _States_Are_set
- *
- */
-
-#define _States_Are_set( _the_states, _mask ) \
- ( ((_the_states) & (_mask)) != STATES_READY )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/sysstate.inl b/c/src/exec/score/macros/rtems/score/sysstate.inl
deleted file mode 100644
index 44957f6faa..0000000000
--- a/c/src/exec/score/macros/rtems/score/sysstate.inl
+++ /dev/null
@@ -1,90 +0,0 @@
-/* sysstates.inl
- *
- * This file contains the macro implementation of routines regarding the
- * system state.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __SYSTEM_STATE_inl
-#define __SYSTEM_STATE_inl
-
-/*PAGE
- *
- * _System_state_Handler_initialization
- */
-
-#define _System_state_Handler_initialization( _is_multiprocessing ) \
- do { \
- _System_state_Current = SYSTEM_STATE_BEFORE_INITIALIZATION; \
- _System_state_Is_multiprocessing = (_is_multiprocessing); \
- } while ( 0 )
-
-/*PAGE
- *
- * _System_state_Set
- */
-
-#define _System_state_Set( _state ) \
- do { \
- _System_state_Current = (_state); \
- } while ( 0 )
-
-/*PAGE
- *
- * _System_state_Get
- */
-
-#define _System_state_Get() \
- (_System_state_Current)
-
-/*PAGE
- *
- * _System_state_Is_before_initialization
- */
-
-#define _System_state_Is_before_initialization( _state ) \
- ((_state) == SYSTEM_STATE_BEFORE_INITIALIZATION)
-
-/*PAGE
- *
- * _System_state_Is_before_multitasking
- */
-
-#define _System_state_Is_before_multitasking( _state ) \
- ((_state) == SYSTEM_STATE_BEFORE_MULTITASKING)
-
-/*PAGE
- *
- * _System_state_Is_begin_multitasking
- */
-
-#define _System_state_Is_begin_multitasking( _state ) \
- ((_state) == SYSTEM_STATE_BEGIN_MULTITASKING)
-
-/*PAGE
- *
- * _System_state_Is_up
- */
-
-#define _System_state_Is_up( _state ) \
- ((_state) == SYSTEM_STATE_UP)
-
-/*PAGE
- *
- * _System_state_Is_failed
- */
-
-#define _System_state_Is_failed( _state ) \
- ((_state) == SYSTEM_STATE_FAILED)
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/thread.inl b/c/src/exec/score/macros/rtems/score/thread.inl
deleted file mode 100644
index 96761143b8..0000000000
--- a/c/src/exec/score/macros/rtems/score/thread.inl
+++ /dev/null
@@ -1,217 +0,0 @@
-/* thread.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Thread handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_inl
-#define __THREAD_inl
-
-/*PAGE
- *
- * _Thread_Stop_multitasking
- *
- */
-
-#define _Thread_Stop_multitasking() \
- _Context_Switch( &_Thread_Executing->Registers, &_Thread_BSP_context );
-
-/*PAGE
- *
- * _Thread_Is_executing
- *
- */
-
-#define _Thread_Is_executing( _the_thread ) \
- ( (_the_thread) == _Thread_Executing )
-
-/*PAGE
- *
- * _Thread_Is_heir
- *
- */
-
-#define _Thread_Is_heir( _the_thread ) \
- ( (_the_thread) == _Thread_Heir )
-
-/*PAGE
- *
- * _Thread_Is_executing_also_the_heir
- *
- */
-
-#define _Thread_Is_executing_also_the_heir() \
- ( _Thread_Executing == _Thread_Heir )
-
-/*PAGE
- *
- * _Thread_Resume
- *
- */
-
-#define _Thread_Resume( _the_thread ) \
- _Thread_Clear_state( (_the_thread), STATES_SUSPENDED )
-
-/*PAGE
- *
- * _Thread_Unblock
- *
- */
-
-#define _Thread_Unblock( _the_thread ) \
- _Thread_Clear_state( (_the_thread), STATES_BLOCKED );
-
-/*PAGE
- *
- * _Thread_Restart_self
- *
- */
-
-#define _Thread_Restart_self() \
- { \
- if ( _Thread_Executing->fp_context != NULL ) \
- _Context_Restore_fp( &_Thread_Executing->fp_context ); \
- \
- _CPU_Context_Restart_self( &_Thread_Executing->Registers ); \
- }
-
-/*PAGE
- *
- * _Thread_Calculate_heir
- *
- */
-
-#define _Thread_Calculate_heir() \
- { \
- Priority_Control highest; \
- \
- _Priority_Get_highest( highest ); \
- \
- _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ highest ].first; \
- }
-
-/*PAGE
- *
- * _Thread_Is_allocated_fp
- *
- */
-
-#define _Thread_Is_allocated_fp( _the_thread ) \
- ( (_the_thread) == _Thread_Allocated_fp )
-
-/*PAGE
- *
- * _Thread_Deallocate_fp
- *
- */
-
-#define _Thread_Deallocate_fp() \
- _Thread_Allocated_fp = NULL
-
-/*PAGE
- *
- * _Thread_Disable_dispatch
- *
- */
-
-#define _Thread_Disable_dispatch() \
- _Thread_Dispatch_disable_level += 1
-
-/*PAGE
- *
- * _Thread_Enable_dispatch
- *
- */
-
-#if ( CPU_INLINE_ENABLE_DISPATCH == TRUE )
-#define _Thread_Enable_dispatch() \
- { if ( (--_Thread_Dispatch_disable_level) == 0 ) \
- _Thread_Dispatch(); \
- }
-#endif
-
-#if ( CPU_INLINE_ENABLE_DISPATCH == FALSE )
-void _Thread_Enable_dispatch( void );
-#endif
-
-/*PAGE
- *
- * _Thread_Unnest_dispatch
- *
- */
-
-#define _Thread_Unnest_dispatch() \
- _Thread_Dispatch_disable_level -= 1
-
-/*PAGE
- *
- * _Thread_Is_dispatching_enabled
- *
- */
-
-#define _Thread_Is_dispatching_enabled() \
- ( _Thread_Dispatch_disable_level == 0 )
-
-/*PAGE
- *
- * _Thread_Is_context_switch_necessary
- *
- */
-
-#define _Thread_Is_context_switch_necessary() \
- ( _Context_Switch_necessary == TRUE )
-
-/*PAGE
- *
- * _Thread_Dispatch_initialization
- *
- */
-
-#define _Thread_Dispatch_initialization() \
- _Thread_Dispatch_disable_level = 1
-
-/*PAGE
- *
- * _Thread_Is_null
- *
- */
-
-#define _Thread_Is_null( _the_thread ) \
- ( (_the_thread) == NULL )
-
-/*
- * _Thread_Is_proxy_blocking
- *
- */
-
-#define _Thread_Is_proxy_blocking( _code ) \
- ( (_code) == THREAD_STATUS_PROXY_BLOCKING )
-
-/*
- * _Thread_Internal_allocate
- *
- */
-
-#define _Thread_Internal_allocate() \
- ((Thread_Control *) _Objects_Allocate( &_Thread_Internal_information ))
-
-/*
- * _Thread_Internal_free
- *
- */
-
-#define _Thread_Internal_free( _the_task ) \
- _Objects_Free( &_Thread_Internal_information, &(_the_task)->Object )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/threadmp.inl b/c/src/exec/score/macros/rtems/score/threadmp.inl
deleted file mode 100644
index c9cc91319f..0000000000
--- a/c/src/exec/score/macros/rtems/score/threadmp.inl
+++ /dev/null
@@ -1,50 +0,0 @@
-/* macros/threadmp.h
- *
- * This include file contains the bodies of all inlined routines
- * for the multiprocessing part of thread package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_MP_THREAD_h
-#define __MACROS_MP_THREAD_h
-
-/*PAGE
- *
- * _Thread_MP_Is_receive
- *
- */
-
-#define _Thread_MP_Is_receive( _the_thread ) \
- ( (_the_thread) == _Thread_MP_Receive)
-
-/*PAGE
- *
- * _Thread_MP_Free_proxy
- *
- */
-
-#define _Thread_MP_Free_proxy( _the_thread ) \
-{ \
- Thread_Proxy_control *_the_proxy; \
- \
- _the_proxy = (Thread_Proxy_control *) (_the_thread); \
- \
- _Chain_Extract( &_the_proxy->Active ); \
- \
- _Chain_Append( \
- &_Thread_MP_Inactive_proxies, \
- &(_the_thread)->Object.Node \
- ); \
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/tod.inl b/c/src/exec/score/macros/rtems/score/tod.inl
deleted file mode 100644
index 85603550ee..0000000000
--- a/c/src/exec/score/macros/rtems/score/tod.inl
+++ /dev/null
@@ -1,49 +0,0 @@
-/* tod.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the Time of Day Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIME_OF_DAY_inl
-#define __TIME_OF_DAY_inl
-
-/*PAGE
- *
- * _TOD_Tickle_ticks
- *
- */
-
-#define _TOD_Tickle_ticks() \
- _TOD_Current.ticks++; \
- _Watchdog_Ticks_since_boot++
-
-/*PAGE
- *
- * _TOD_Deactivate
- *
- */
-
-#define _TOD_Deactivate() \
- _Watchdog_Remove( &_TOD_Seconds_watchdog )
-
-/*PAGE
- *
- * _TOD_Activate
- *
- */
-
-#define _TOD_Activate( _ticks ) \
- _Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, (_ticks) )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/tqdata.inl b/c/src/exec/score/macros/rtems/score/tqdata.inl
deleted file mode 100644
index 0749e612d6..0000000000
--- a/c/src/exec/score/macros/rtems/score/tqdata.inl
+++ /dev/null
@@ -1,50 +0,0 @@
-/* tqdata.inl
- *
- * This file contains the macro implementation of the inlined
- * routines needed to support the Thread Queue Data.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_QUEUE_DATA_inl
-#define __THREAD_QUEUE_DATA_inl
-
-/*PAGE
- *
- * _Thread_queue_Header_number
- *
- */
-
-#define _Thread_queue_Header_number( _the_priority ) \
- ((_the_priority) / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER)
-
-/*PAGE
- *
- * _Thread_queue_Is_reverse_search
- *
- */
-
-#define _Thread_queue_Is_reverse_search( _the_priority ) \
- ( (_the_priority) & TASK_QUEUE_DATA_REVERSE_SEARCH_MASK )
-
-/*PAGE
- *
- * _Thread_queue_Enter_critical_section
- *
- */
-
-#define _Thread_queue_Enter_critical_section( _the_thread_queue ) \
- do { \
- (_the_thread_queue)->sync_state = THREAD_QUEUE_NOTHING_HAPPENED; \
- } while ( 0 )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/userext.inl b/c/src/exec/score/macros/rtems/score/userext.inl
deleted file mode 100644
index 37b0bf8d2a..0000000000
--- a/c/src/exec/score/macros/rtems/score/userext.inl
+++ /dev/null
@@ -1,126 +0,0 @@
-/* userext.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the User Extension Handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __USER_EXTENSIONS_inl
-#define __USER_EXTENSIONS_inl
-
-/*PAGE
- *
- * _User_extensions_Handler_initialization
- *
- */
-
-#define _User_extensions_Handler_initialization( _initial_extensions ) \
- { \
- _Chain_Initialize_empty( &_User_extensions_List ); \
- \
- if ( (_initial_extensions) ) { \
- _User_extensions_Initial.Callouts = *(_initial_extensions); \
- _Chain_Append( \
- &_User_extensions_List, &_User_extensions_Initial.Node ); \
- } \
- }
-
-/*PAGE
- *
- * _User_extensions_Add_set
- */
-
-#define _User_extensions_Add_set( _the_extension, _extension_table ) \
- do { \
- (_the_extension)->Callouts = *(_extension_table); \
- \
- _Chain_Append( &_User_extensions_List, &(_the_extension)->Node ); \
- } while ( 0 )
-
-/*PAGE
- *
- * _User_extensions_Add_API_set
- */
-
-#define _User_extensions_Add_API_set( _the_extension ) \
- _Chain_Prepend( &_User_extensions_List, &(_the_extension)->Node )
-
-
-/*PAGE
- *
- * _User_extensions_Remove_set
- */
-
-#define _User_extensions_Remove_set( _the_extension ) \
- _Chain_Extract( &(_the_extension)->Node )
-
-/*PAGE
- *
- * _User_extensions_Run_list_forward
- *
- * NOTE: No parentheses around macro names here to avoid
- * messing up the name and function call expansion.
- */
-
-#define _User_extensions_Run_list_forward( _name, _arguments ) \
- do { \
- Chain_Node *the_node; \
- User_extensions_Control *the_extension; \
- \
- for ( the_node = _User_extensions_List.first ; \
- !_Chain_Is_tail( &_User_extensions_List, the_node ) ; \
- the_node = the_node->next ) { \
- the_extension = (User_extensions_Control *) the_node; \
- \
- if ( the_extension->Callouts.## _name != NULL ) \
- (*the_extension->Callouts.## _name) _arguments; \
- \
- } \
- \
- } while ( 0 )
-
-/*PAGE
- *
- * _User_extensions_Run_list_backward
- *
- * NOTE: No parentheses around macro names here to avoid
- * messing up the name and function call expansion.
- */
-
-#define _User_extensions_Run_list_backward( _name, _arguments ) \
- do { \
- Chain_Node *the_node; \
- User_extensions_Control *the_extension; \
- \
- for ( the_node = _User_extensions_List.last ; \
- !_Chain_Is_head( &_User_extensions_List, the_node ) ; \
- the_node = the_node->previous ) { \
- the_extension = (User_extensions_Control *) the_node; \
- \
- if ( the_extension->Callouts.## _name != NULL ) \
- (*the_extension->Callouts.## _name) _arguments; \
- \
- } \
- \
- } while ( 0 )
-
-/*PAGE
- *
- * _User_extensions_Thread_switch
- *
- */
-
-#define _User_extensions_Thread_switch( _executing, _heir ) \
- _User_extensions_Run_list_forward(thread_switch, (_executing, _heir) )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/watchdog.inl b/c/src/exec/score/macros/rtems/score/watchdog.inl
deleted file mode 100644
index fecc20e4f1..0000000000
--- a/c/src/exec/score/macros/rtems/score/watchdog.inl
+++ /dev/null
@@ -1,172 +0,0 @@
-/* watchdog.inl
- *
- * This file contains the macro implementation of all inlined routines
- * in the Watchdog Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WATCHDOG_inl
-#define __WATCHDOG_inl
-
-#include <rtems/score/object.h>
-
-/*PAGE
- *
- * _Watchdog_Initialize
- *
- */
-
-#define _Watchdog_Initialize( _the_watchdog, _routine, _id, _user_data ) \
- { \
- (_the_watchdog)->state = WATCHDOG_INACTIVE; \
- (_the_watchdog)->routine = (_routine); \
- (_the_watchdog)->id = (_id); \
- (_the_watchdog)->user_data = (_user_data); \
- }
-
-/*PAGE
- *
- * _Watchdog_Is_active
- *
- */
-
-#define _Watchdog_Is_active( _the_watchdog ) \
- ( (_the_watchdog)->state == WATCHDOG_ACTIVE )
-
-/*PAGE
- *
- * _Watchdog_Activate
- *
- */
-
-#define _Watchdog_Activate( _the_watchdog ) \
- (_the_watchdog)->state = WATCHDOG_ACTIVE
-
-/*PAGE
- *
- * _Watchdog_Deactivate
- *
- */
-
-#define _Watchdog_Deactivate( _the_watchdog ) \
- (_the_watchdog)->state = WATCHDOG_REMOVE_IT
-
-/*PAGE
- *
- * _Watchdog_Tickle_ticks
- *
- */
-
-#define _Watchdog_Tickle_ticks() \
- _Watchdog_Tickle( &_Watchdog_Ticks_chain )
-
-/*PAGE
- *
- * _Watchdog_Tickle_seconds
- *
- */
-
-#define _Watchdog_Tickle_seconds() \
- _Watchdog_Tickle( &_Watchdog_Seconds_chain )
-
-/*PAGE
- *
- * _Watchdog_Insert_ticks
- *
- */
-
-#define _Watchdog_Insert_ticks( _the_watchdog, _units ) \
- do { \
- (_the_watchdog)->initial = (_units); \
- _Watchdog_Insert( &_Watchdog_Ticks_chain, (_the_watchdog) ); \
- } while ( 0 )
-
-/*PAGE
- *
- * _Watchdog_Insert_seconds
- *
- */
-
-#define _Watchdog_Insert_seconds( _the_watchdog, _units ) \
- do { \
- (_the_watchdog)->initial = (_units); \
- _Watchdog_Insert( &_Watchdog_Seconds_chain, (_the_watchdog) ); \
- } while ( 0 )
-
-/*PAGE
- *
- * _Watchdog_Adjust_seconds
- *
- */
-
-#define _Watchdog_Adjust_seconds( _direction, _units ) \
- _Watchdog_Adjust( &_Watchdog_Seconds_chain, (_direction), (_units) )
-
-/*PAGE
- *
- * _Watchdog_Adjust_ticks
- *
- */
-
-#define _Watchdog_Adjust_ticks( _direction, _units ) \
- _Watchdog_Adjust( &_Watchdog_Ticks_chain, (_direction), (_units) )
-
-/*PAGE
- *
- * _Watchdog_Reset
- *
- */
-
-#define _Watchdog_Reset( _the_watchdog ) \
- { \
- (void) _Watchdog_Remove( (_the_watchdog) ); \
- _Watchdog_Insert( &_Watchdog_Ticks_chain, (_the_watchdog) ); \
- }
-
-/*PAGE
- *
- * _Watchdog_Next
- *
- */
-
-#define _Watchdog_Next( _watchdog ) \
- ((Watchdog_Control *) (_watchdog)->Node.next)
-
-/*PAGE
- *
- * _Watchdog_Previous
- *
- */
-
-#define _Watchdog_Previous( _watchdog ) \
- ((Watchdog_Control *) (_watchdog)->Node.previous)
-
-/*PAGE
- *
- * _Watchdog_First
- *
- */
-
-#define _Watchdog_First( _header ) \
- ((Watchdog_Control *) (_header)->first)
-
-/*PAGE
- *
- * _Watchdog_Last
- *
- */
-
-#define _Watchdog_Last( _header ) \
- ((Watchdog_Control *) (_header)->last)
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/wkspace.inl b/c/src/exec/score/macros/rtems/score/wkspace.inl
deleted file mode 100644
index 525756db6b..0000000000
--- a/c/src/exec/score/macros/rtems/score/wkspace.inl
+++ /dev/null
@@ -1,39 +0,0 @@
-/* wkspace.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the RAM Workspace Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WORKSPACE_inl
-#define __WORKSPACE_inl
-
-/*PAGE
- *
- * _Workspace_Allocate
- *
- */
-
-#define _Workspace_Allocate( _size ) \
- _Heap_Allocate( &_Workspace_Area, (_size) )
-
-/*PAGE
- *
- * _Workspace_Free
- *
- */
-
-#define _Workspace_Free( _block ) \
- _Heap_Free( &_Workspace_Area, (_block) )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/stack.inl b/c/src/exec/score/macros/stack.inl
deleted file mode 100644
index 0e976eb0e0..0000000000
--- a/c/src/exec/score/macros/stack.inl
+++ /dev/null
@@ -1,50 +0,0 @@
-/* stack.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Stack Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STACK_inl
-#define __STACK_inl
-
-/*PAGE
- *
- * _Stack_Initialize
- *
- */
-
-#define _Stack_Initialize( _the_stack, _starting_address, _size ) \
- { \
- (_the_stack)->area = (_starting_address); \
- (_the_stack)->size = (_size); \
- }
-
-/*PAGE
- *
- * _Stack_Is_enough
- *
- */
-
-#define _Stack_Is_enough( _size ) \
- ( (_size) >= STACK_MINIMUM_SIZE )
-
-/*PAGE
- *
- * _Stack_Adjust_size
- */
-
-#define _Stack_Adjust_size( _size ) \
- ((_size) + CPU_STACK_ALIGNMENT)
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/states.inl b/c/src/exec/score/macros/states.inl
deleted file mode 100644
index a100da077a..0000000000
--- a/c/src/exec/score/macros/states.inl
+++ /dev/null
@@ -1,210 +0,0 @@
-/* states.inl
- *
- * This file contains the macro implementation of the inlined
- * routines associated with thread state information.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STATES_inl
-#define __STATES_inl
-
-/*PAGE
- *
- * _States_Set
- *
- */
-
-#define _States_Set( _states_to_set, _current_state ) \
- ((_current_state) | (_states_to_set))
-
-/*PAGE
- *
- * _States_Clear
- *
- */
-
-#define _States_Clear( _states_to_clear, _current_state ) \
- ((_current_state) & ~(_states_to_clear))
-
-/*PAGE
- *
- * _States_Is_ready
- *
- */
-
-#define _States_Is_ready( _the_states ) \
- ( (_the_states) == STATES_READY )
-
-/*PAGE
- *
- * _States_Is_only_dormant
- *
- */
-
-#define _States_Is_only_dormant( _the_states ) \
- ( (_the_states) == STATES_DORMANT )
-
-/*PAGE
- *
- * _States_Is_dormant
- *
- */
-
-#define _States_Is_dormant( _the_states ) \
- ( (_the_states) & STATES_DORMANT )
-
-/*PAGE
- *
- * _States_Is_suspended
- *
- */
-
-#define _States_Is_suspended( _the_states ) \
- ( (_the_states) & STATES_SUSPENDED )
-
-/*PAGE
- *
- * _States_Is_Transient
- *
- */
-
-#define _States_Is_transient( _the_states ) \
- ( (_the_states) & STATES_TRANSIENT )
-
-/*PAGE
- *
- * _States_Is_delaying
- *
- */
-
-#define _States_Is_delaying( _the_states ) \
- ( (_the_states) & STATES_DELAYING )
-
-/*PAGE
- *
- * _States_Is_waiting_for_buffer
- *
- */
-
-#define _States_Is_waiting_for_buffer( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_BUFFER )
-
-/*PAGE
- *
- * _States_Is_waiting_for_segment
- *
- */
-
-#define _States_Is_waiting_for_segment( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_SEGMENT )
-
-/*PAGE
- *
- * _States_Is_waiting_for_message
- *
- */
-
-#define _States_Is_waiting_for_message( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_MESSAGE )
-
-/*PAGE
- *
- * _States_Is_waiting_for_event
- *
- */
-
-#define _States_Is_waiting_for_event( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_EVENT )
-
-/*PAGE
- *
- * _States_Is_waiting_for_mutex
- *
- */
-
-#define _States_Is_waiting_for_mutex( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_MUTEX )
-
-/*PAGE
- *
- * _States_Is_waiting_for_semaphore
- *
- */
-
-#define _States_Is_waiting_for_semaphore( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_SEMAPHORE )
-
-/*PAGE
- *
- * _States_Is_waiting_for_time
- *
- */
-
-#define _States_Is_waiting_for_time( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_TIME )
-
-/*PAGE
- *
- * _States_Is_waiting_for_rpc_reply
- *
- */
-
-#define _States_Is_waiting_for_rpc_reply( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_RPC_REPLY )
-
-/*PAGE
- *
- * _States_Is_waiting_for_period
- *
- */
-
-#define _States_Is_waiting_for_period( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_PERIOD )
-
-/*PAGE
- *
- * _States_Is_locally_blocked
- *
- */
-
-#define _States_Is_locally_blocked( _the_states ) \
- ( (_the_states) & STATES_LOCALLY_BLOCKED )
-
-/*PAGE
- *
- * _States_Is_waiting_on_thread_queue
- *
- */
-
-#define _States_Is_waiting_on_thread_queue( _the_states ) \
- ( (_the_states) & STATES_WAITING_ON_THREAD_QUEUE )
-
-/*PAGE
- *
- * _States_Is_blocked
- *
- */
-
-#define _States_Is_blocked( _the_states ) \
- ( (_the_states) & STATES_BLOCKED )
-
-/*PAGE
- *
- * _States_Are_set
- *
- */
-
-#define _States_Are_set( _the_states, _mask ) \
- ( ((_the_states) & (_mask)) != STATES_READY )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/sysstate.inl b/c/src/exec/score/macros/sysstate.inl
deleted file mode 100644
index 44957f6faa..0000000000
--- a/c/src/exec/score/macros/sysstate.inl
+++ /dev/null
@@ -1,90 +0,0 @@
-/* sysstates.inl
- *
- * This file contains the macro implementation of routines regarding the
- * system state.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __SYSTEM_STATE_inl
-#define __SYSTEM_STATE_inl
-
-/*PAGE
- *
- * _System_state_Handler_initialization
- */
-
-#define _System_state_Handler_initialization( _is_multiprocessing ) \
- do { \
- _System_state_Current = SYSTEM_STATE_BEFORE_INITIALIZATION; \
- _System_state_Is_multiprocessing = (_is_multiprocessing); \
- } while ( 0 )
-
-/*PAGE
- *
- * _System_state_Set
- */
-
-#define _System_state_Set( _state ) \
- do { \
- _System_state_Current = (_state); \
- } while ( 0 )
-
-/*PAGE
- *
- * _System_state_Get
- */
-
-#define _System_state_Get() \
- (_System_state_Current)
-
-/*PAGE
- *
- * _System_state_Is_before_initialization
- */
-
-#define _System_state_Is_before_initialization( _state ) \
- ((_state) == SYSTEM_STATE_BEFORE_INITIALIZATION)
-
-/*PAGE
- *
- * _System_state_Is_before_multitasking
- */
-
-#define _System_state_Is_before_multitasking( _state ) \
- ((_state) == SYSTEM_STATE_BEFORE_MULTITASKING)
-
-/*PAGE
- *
- * _System_state_Is_begin_multitasking
- */
-
-#define _System_state_Is_begin_multitasking( _state ) \
- ((_state) == SYSTEM_STATE_BEGIN_MULTITASKING)
-
-/*PAGE
- *
- * _System_state_Is_up
- */
-
-#define _System_state_Is_up( _state ) \
- ((_state) == SYSTEM_STATE_UP)
-
-/*PAGE
- *
- * _System_state_Is_failed
- */
-
-#define _System_state_Is_failed( _state ) \
- ((_state) == SYSTEM_STATE_FAILED)
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/thread.inl b/c/src/exec/score/macros/thread.inl
deleted file mode 100644
index 96761143b8..0000000000
--- a/c/src/exec/score/macros/thread.inl
+++ /dev/null
@@ -1,217 +0,0 @@
-/* thread.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Thread handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_inl
-#define __THREAD_inl
-
-/*PAGE
- *
- * _Thread_Stop_multitasking
- *
- */
-
-#define _Thread_Stop_multitasking() \
- _Context_Switch( &_Thread_Executing->Registers, &_Thread_BSP_context );
-
-/*PAGE
- *
- * _Thread_Is_executing
- *
- */
-
-#define _Thread_Is_executing( _the_thread ) \
- ( (_the_thread) == _Thread_Executing )
-
-/*PAGE
- *
- * _Thread_Is_heir
- *
- */
-
-#define _Thread_Is_heir( _the_thread ) \
- ( (_the_thread) == _Thread_Heir )
-
-/*PAGE
- *
- * _Thread_Is_executing_also_the_heir
- *
- */
-
-#define _Thread_Is_executing_also_the_heir() \
- ( _Thread_Executing == _Thread_Heir )
-
-/*PAGE
- *
- * _Thread_Resume
- *
- */
-
-#define _Thread_Resume( _the_thread ) \
- _Thread_Clear_state( (_the_thread), STATES_SUSPENDED )
-
-/*PAGE
- *
- * _Thread_Unblock
- *
- */
-
-#define _Thread_Unblock( _the_thread ) \
- _Thread_Clear_state( (_the_thread), STATES_BLOCKED );
-
-/*PAGE
- *
- * _Thread_Restart_self
- *
- */
-
-#define _Thread_Restart_self() \
- { \
- if ( _Thread_Executing->fp_context != NULL ) \
- _Context_Restore_fp( &_Thread_Executing->fp_context ); \
- \
- _CPU_Context_Restart_self( &_Thread_Executing->Registers ); \
- }
-
-/*PAGE
- *
- * _Thread_Calculate_heir
- *
- */
-
-#define _Thread_Calculate_heir() \
- { \
- Priority_Control highest; \
- \
- _Priority_Get_highest( highest ); \
- \
- _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ highest ].first; \
- }
-
-/*PAGE
- *
- * _Thread_Is_allocated_fp
- *
- */
-
-#define _Thread_Is_allocated_fp( _the_thread ) \
- ( (_the_thread) == _Thread_Allocated_fp )
-
-/*PAGE
- *
- * _Thread_Deallocate_fp
- *
- */
-
-#define _Thread_Deallocate_fp() \
- _Thread_Allocated_fp = NULL
-
-/*PAGE
- *
- * _Thread_Disable_dispatch
- *
- */
-
-#define _Thread_Disable_dispatch() \
- _Thread_Dispatch_disable_level += 1
-
-/*PAGE
- *
- * _Thread_Enable_dispatch
- *
- */
-
-#if ( CPU_INLINE_ENABLE_DISPATCH == TRUE )
-#define _Thread_Enable_dispatch() \
- { if ( (--_Thread_Dispatch_disable_level) == 0 ) \
- _Thread_Dispatch(); \
- }
-#endif
-
-#if ( CPU_INLINE_ENABLE_DISPATCH == FALSE )
-void _Thread_Enable_dispatch( void );
-#endif
-
-/*PAGE
- *
- * _Thread_Unnest_dispatch
- *
- */
-
-#define _Thread_Unnest_dispatch() \
- _Thread_Dispatch_disable_level -= 1
-
-/*PAGE
- *
- * _Thread_Is_dispatching_enabled
- *
- */
-
-#define _Thread_Is_dispatching_enabled() \
- ( _Thread_Dispatch_disable_level == 0 )
-
-/*PAGE
- *
- * _Thread_Is_context_switch_necessary
- *
- */
-
-#define _Thread_Is_context_switch_necessary() \
- ( _Context_Switch_necessary == TRUE )
-
-/*PAGE
- *
- * _Thread_Dispatch_initialization
- *
- */
-
-#define _Thread_Dispatch_initialization() \
- _Thread_Dispatch_disable_level = 1
-
-/*PAGE
- *
- * _Thread_Is_null
- *
- */
-
-#define _Thread_Is_null( _the_thread ) \
- ( (_the_thread) == NULL )
-
-/*
- * _Thread_Is_proxy_blocking
- *
- */
-
-#define _Thread_Is_proxy_blocking( _code ) \
- ( (_code) == THREAD_STATUS_PROXY_BLOCKING )
-
-/*
- * _Thread_Internal_allocate
- *
- */
-
-#define _Thread_Internal_allocate() \
- ((Thread_Control *) _Objects_Allocate( &_Thread_Internal_information ))
-
-/*
- * _Thread_Internal_free
- *
- */
-
-#define _Thread_Internal_free( _the_task ) \
- _Objects_Free( &_Thread_Internal_information, &(_the_task)->Object )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/threadmp.inl b/c/src/exec/score/macros/threadmp.inl
deleted file mode 100644
index c9cc91319f..0000000000
--- a/c/src/exec/score/macros/threadmp.inl
+++ /dev/null
@@ -1,50 +0,0 @@
-/* macros/threadmp.h
- *
- * This include file contains the bodies of all inlined routines
- * for the multiprocessing part of thread package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_MP_THREAD_h
-#define __MACROS_MP_THREAD_h
-
-/*PAGE
- *
- * _Thread_MP_Is_receive
- *
- */
-
-#define _Thread_MP_Is_receive( _the_thread ) \
- ( (_the_thread) == _Thread_MP_Receive)
-
-/*PAGE
- *
- * _Thread_MP_Free_proxy
- *
- */
-
-#define _Thread_MP_Free_proxy( _the_thread ) \
-{ \
- Thread_Proxy_control *_the_proxy; \
- \
- _the_proxy = (Thread_Proxy_control *) (_the_thread); \
- \
- _Chain_Extract( &_the_proxy->Active ); \
- \
- _Chain_Append( \
- &_Thread_MP_Inactive_proxies, \
- &(_the_thread)->Object.Node \
- ); \
-}
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/tod.inl b/c/src/exec/score/macros/tod.inl
deleted file mode 100644
index 85603550ee..0000000000
--- a/c/src/exec/score/macros/tod.inl
+++ /dev/null
@@ -1,49 +0,0 @@
-/* tod.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the Time of Day Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIME_OF_DAY_inl
-#define __TIME_OF_DAY_inl
-
-/*PAGE
- *
- * _TOD_Tickle_ticks
- *
- */
-
-#define _TOD_Tickle_ticks() \
- _TOD_Current.ticks++; \
- _Watchdog_Ticks_since_boot++
-
-/*PAGE
- *
- * _TOD_Deactivate
- *
- */
-
-#define _TOD_Deactivate() \
- _Watchdog_Remove( &_TOD_Seconds_watchdog )
-
-/*PAGE
- *
- * _TOD_Activate
- *
- */
-
-#define _TOD_Activate( _ticks ) \
- _Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, (_ticks) )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/tqdata.inl b/c/src/exec/score/macros/tqdata.inl
deleted file mode 100644
index 0749e612d6..0000000000
--- a/c/src/exec/score/macros/tqdata.inl
+++ /dev/null
@@ -1,50 +0,0 @@
-/* tqdata.inl
- *
- * This file contains the macro implementation of the inlined
- * routines needed to support the Thread Queue Data.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_QUEUE_DATA_inl
-#define __THREAD_QUEUE_DATA_inl
-
-/*PAGE
- *
- * _Thread_queue_Header_number
- *
- */
-
-#define _Thread_queue_Header_number( _the_priority ) \
- ((_the_priority) / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER)
-
-/*PAGE
- *
- * _Thread_queue_Is_reverse_search
- *
- */
-
-#define _Thread_queue_Is_reverse_search( _the_priority ) \
- ( (_the_priority) & TASK_QUEUE_DATA_REVERSE_SEARCH_MASK )
-
-/*PAGE
- *
- * _Thread_queue_Enter_critical_section
- *
- */
-
-#define _Thread_queue_Enter_critical_section( _the_thread_queue ) \
- do { \
- (_the_thread_queue)->sync_state = THREAD_QUEUE_NOTHING_HAPPENED; \
- } while ( 0 )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/userext.inl b/c/src/exec/score/macros/userext.inl
deleted file mode 100644
index 37b0bf8d2a..0000000000
--- a/c/src/exec/score/macros/userext.inl
+++ /dev/null
@@ -1,126 +0,0 @@
-/* userext.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the User Extension Handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __USER_EXTENSIONS_inl
-#define __USER_EXTENSIONS_inl
-
-/*PAGE
- *
- * _User_extensions_Handler_initialization
- *
- */
-
-#define _User_extensions_Handler_initialization( _initial_extensions ) \
- { \
- _Chain_Initialize_empty( &_User_extensions_List ); \
- \
- if ( (_initial_extensions) ) { \
- _User_extensions_Initial.Callouts = *(_initial_extensions); \
- _Chain_Append( \
- &_User_extensions_List, &_User_extensions_Initial.Node ); \
- } \
- }
-
-/*PAGE
- *
- * _User_extensions_Add_set
- */
-
-#define _User_extensions_Add_set( _the_extension, _extension_table ) \
- do { \
- (_the_extension)->Callouts = *(_extension_table); \
- \
- _Chain_Append( &_User_extensions_List, &(_the_extension)->Node ); \
- } while ( 0 )
-
-/*PAGE
- *
- * _User_extensions_Add_API_set
- */
-
-#define _User_extensions_Add_API_set( _the_extension ) \
- _Chain_Prepend( &_User_extensions_List, &(_the_extension)->Node )
-
-
-/*PAGE
- *
- * _User_extensions_Remove_set
- */
-
-#define _User_extensions_Remove_set( _the_extension ) \
- _Chain_Extract( &(_the_extension)->Node )
-
-/*PAGE
- *
- * _User_extensions_Run_list_forward
- *
- * NOTE: No parentheses around macro names here to avoid
- * messing up the name and function call expansion.
- */
-
-#define _User_extensions_Run_list_forward( _name, _arguments ) \
- do { \
- Chain_Node *the_node; \
- User_extensions_Control *the_extension; \
- \
- for ( the_node = _User_extensions_List.first ; \
- !_Chain_Is_tail( &_User_extensions_List, the_node ) ; \
- the_node = the_node->next ) { \
- the_extension = (User_extensions_Control *) the_node; \
- \
- if ( the_extension->Callouts.## _name != NULL ) \
- (*the_extension->Callouts.## _name) _arguments; \
- \
- } \
- \
- } while ( 0 )
-
-/*PAGE
- *
- * _User_extensions_Run_list_backward
- *
- * NOTE: No parentheses around macro names here to avoid
- * messing up the name and function call expansion.
- */
-
-#define _User_extensions_Run_list_backward( _name, _arguments ) \
- do { \
- Chain_Node *the_node; \
- User_extensions_Control *the_extension; \
- \
- for ( the_node = _User_extensions_List.last ; \
- !_Chain_Is_head( &_User_extensions_List, the_node ) ; \
- the_node = the_node->previous ) { \
- the_extension = (User_extensions_Control *) the_node; \
- \
- if ( the_extension->Callouts.## _name != NULL ) \
- (*the_extension->Callouts.## _name) _arguments; \
- \
- } \
- \
- } while ( 0 )
-
-/*PAGE
- *
- * _User_extensions_Thread_switch
- *
- */
-
-#define _User_extensions_Thread_switch( _executing, _heir ) \
- _User_extensions_Run_list_forward(thread_switch, (_executing, _heir) )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/watchdog.inl b/c/src/exec/score/macros/watchdog.inl
deleted file mode 100644
index fecc20e4f1..0000000000
--- a/c/src/exec/score/macros/watchdog.inl
+++ /dev/null
@@ -1,172 +0,0 @@
-/* watchdog.inl
- *
- * This file contains the macro implementation of all inlined routines
- * in the Watchdog Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WATCHDOG_inl
-#define __WATCHDOG_inl
-
-#include <rtems/score/object.h>
-
-/*PAGE
- *
- * _Watchdog_Initialize
- *
- */
-
-#define _Watchdog_Initialize( _the_watchdog, _routine, _id, _user_data ) \
- { \
- (_the_watchdog)->state = WATCHDOG_INACTIVE; \
- (_the_watchdog)->routine = (_routine); \
- (_the_watchdog)->id = (_id); \
- (_the_watchdog)->user_data = (_user_data); \
- }
-
-/*PAGE
- *
- * _Watchdog_Is_active
- *
- */
-
-#define _Watchdog_Is_active( _the_watchdog ) \
- ( (_the_watchdog)->state == WATCHDOG_ACTIVE )
-
-/*PAGE
- *
- * _Watchdog_Activate
- *
- */
-
-#define _Watchdog_Activate( _the_watchdog ) \
- (_the_watchdog)->state = WATCHDOG_ACTIVE
-
-/*PAGE
- *
- * _Watchdog_Deactivate
- *
- */
-
-#define _Watchdog_Deactivate( _the_watchdog ) \
- (_the_watchdog)->state = WATCHDOG_REMOVE_IT
-
-/*PAGE
- *
- * _Watchdog_Tickle_ticks
- *
- */
-
-#define _Watchdog_Tickle_ticks() \
- _Watchdog_Tickle( &_Watchdog_Ticks_chain )
-
-/*PAGE
- *
- * _Watchdog_Tickle_seconds
- *
- */
-
-#define _Watchdog_Tickle_seconds() \
- _Watchdog_Tickle( &_Watchdog_Seconds_chain )
-
-/*PAGE
- *
- * _Watchdog_Insert_ticks
- *
- */
-
-#define _Watchdog_Insert_ticks( _the_watchdog, _units ) \
- do { \
- (_the_watchdog)->initial = (_units); \
- _Watchdog_Insert( &_Watchdog_Ticks_chain, (_the_watchdog) ); \
- } while ( 0 )
-
-/*PAGE
- *
- * _Watchdog_Insert_seconds
- *
- */
-
-#define _Watchdog_Insert_seconds( _the_watchdog, _units ) \
- do { \
- (_the_watchdog)->initial = (_units); \
- _Watchdog_Insert( &_Watchdog_Seconds_chain, (_the_watchdog) ); \
- } while ( 0 )
-
-/*PAGE
- *
- * _Watchdog_Adjust_seconds
- *
- */
-
-#define _Watchdog_Adjust_seconds( _direction, _units ) \
- _Watchdog_Adjust( &_Watchdog_Seconds_chain, (_direction), (_units) )
-
-/*PAGE
- *
- * _Watchdog_Adjust_ticks
- *
- */
-
-#define _Watchdog_Adjust_ticks( _direction, _units ) \
- _Watchdog_Adjust( &_Watchdog_Ticks_chain, (_direction), (_units) )
-
-/*PAGE
- *
- * _Watchdog_Reset
- *
- */
-
-#define _Watchdog_Reset( _the_watchdog ) \
- { \
- (void) _Watchdog_Remove( (_the_watchdog) ); \
- _Watchdog_Insert( &_Watchdog_Ticks_chain, (_the_watchdog) ); \
- }
-
-/*PAGE
- *
- * _Watchdog_Next
- *
- */
-
-#define _Watchdog_Next( _watchdog ) \
- ((Watchdog_Control *) (_watchdog)->Node.next)
-
-/*PAGE
- *
- * _Watchdog_Previous
- *
- */
-
-#define _Watchdog_Previous( _watchdog ) \
- ((Watchdog_Control *) (_watchdog)->Node.previous)
-
-/*PAGE
- *
- * _Watchdog_First
- *
- */
-
-#define _Watchdog_First( _header ) \
- ((Watchdog_Control *) (_header)->first)
-
-/*PAGE
- *
- * _Watchdog_Last
- *
- */
-
-#define _Watchdog_Last( _header ) \
- ((Watchdog_Control *) (_header)->last)
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/macros/wkspace.inl b/c/src/exec/score/macros/wkspace.inl
deleted file mode 100644
index 525756db6b..0000000000
--- a/c/src/exec/score/macros/wkspace.inl
+++ /dev/null
@@ -1,39 +0,0 @@
-/* wkspace.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the RAM Workspace Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WORKSPACE_inl
-#define __WORKSPACE_inl
-
-/*PAGE
- *
- * _Workspace_Allocate
- *
- */
-
-#define _Workspace_Allocate( _size ) \
- _Heap_Allocate( &_Workspace_Area, (_size) )
-
-/*PAGE
- *
- * _Workspace_Free
- *
- */
-
-#define _Workspace_Free( _block ) \
- _Heap_Free( &_Workspace_Area, (_block) )
-
-#endif
-/* end of include file */
diff --git a/c/src/exec/score/src/Makefile.in b/c/src/exec/score/src/Makefile.in
deleted file mode 100644
index 4548b4cdde..0000000000
--- a/c/src/exec/score/src/Makefile.in
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES=apiext chain coremsg coremutex coresem heap interr \
- isr mpci object objectmp thread threadmp threadq tod userext \
- watchdog wkspace
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D__RTEMS_INSIDE__
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) ${OBJS}
diff --git a/c/src/exec/score/src/apiext.c b/c/src/exec/score/src/apiext.c
deleted file mode 100644
index 2fb2155558..0000000000
--- a/c/src/exec/score/src/apiext.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* apiext.c
- *
- * XXX
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/apiext.h>
-
-/*PAGE
- *
- * _API_extensions_Initialization
- */
-
-void _API_extensions_Initialization( void )
-{
- _Chain_Initialize_empty( &_API_extensions_List );
-}
-
-/*PAGE
- *
- * _API_extensions_Add
- */
-
-void _API_extensions_Add(
- API_extensions_Control *the_extension
-)
-{
- _Chain_Append( &_API_extensions_List, &the_extension->Node );
-}
-
-/*PAGE
- *
- * _API_extensions_Run_predriver
- */
-
-void _API_extensions_Run_predriver( void )
-{
- Chain_Node *the_node;
- API_extensions_Control *the_extension;
-
- for ( the_node = _API_extensions_List.first ;
- !_Chain_Is_tail( &_API_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (API_extensions_Control *) the_node;
-
- if ( the_extension->predriver_hook )
- (*the_extension->predriver_hook)();
- }
-}
-
-/*PAGE
- *
- * _API_extensions_Run_postdriver
- */
-
-void _API_extensions_Run_postdriver( void )
-{
- Chain_Node *the_node;
- API_extensions_Control *the_extension;
-
- for ( the_node = _API_extensions_List.first ;
- !_Chain_Is_tail( &_API_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (API_extensions_Control *) the_node;
-
- if ( the_extension->postdriver_hook )
- (*the_extension->postdriver_hook)();
- }
-}
-
-/*PAGE
- *
- * _API_extensions_Run_postswitch
- */
-
-void _API_extensions_Run_postswitch( void )
-{
- Chain_Node *the_node;
- API_extensions_Control *the_extension;
-
- for ( the_node = _API_extensions_List.first ;
- !_Chain_Is_tail( &_API_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (API_extensions_Control *) the_node;
-
- if ( the_extension->postswitch_hook )
- (*the_extension->postswitch_hook)( _Thread_Executing );
- }
-}
-
-/* end of file */
diff --git a/c/src/exec/score/src/chain.c b/c/src/exec/score/src/chain.c
deleted file mode 100644
index 690141d3ee..0000000000
--- a/c/src/exec/score/src/chain.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Chain Handler
- *
- * NOTE:
- *
- * The order of this file is to allow proper compilation due to the
- * order of inlining required by the compiler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/address.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/isr.h>
-
-/*PAGE
- *
- * _Chain_Initialize
- *
- * This kernel routine initializes a doubly linked chain.
- *
- * Input parameters:
- * the_chain - pointer to chain header
- * starting_address - starting address of first node
- * number_nodes - number of nodes in chain
- * node_size - size of node in bytes
- *
- * Output parameters: NONE
- */
-
-void _Chain_Initialize(
- Chain_Control *the_chain,
- void *starting_address,
- unsigned32 number_nodes,
- unsigned32 node_size
-)
-{
- unsigned32 count;
- Chain_Node *current;
- Chain_Node *next;
-
- count = number_nodes;
- current = _Chain_Head( the_chain );
- the_chain->permanent_null = NULL;
- next = (Chain_Node *)starting_address;
- while ( count-- ) {
- current->next = next;
- next->previous = current;
- current = next;
- next = (Chain_Node *)
- _Addresses_Add_offset( (void *) next, node_size );
- }
- current->next = _Chain_Tail( the_chain );
- the_chain->last = current;
-}
-
-/*PAGE
- *
- * _Chain_Get_first_unprotected
- */
-
-#ifndef USE_INLINES
-Chain_Node *_Chain_Get_first_unprotected(
- Chain_Control *the_chain
-)
-{
- Chain_Node *return_node;
- Chain_Node *new_first;
-
- return_node = the_chain->first;
- new_first = return_node->next;
- the_chain->first = new_first;
- new_first->previous = _Chain_Head( the_chain );
-
- return return_node;
-}
-#endif /* USE_INLINES */
-
-/*PAGE
- *
- * _Chain_Get
- *
- * This kernel routine returns a pointer to a node taken from the
- * given chain.
- *
- * Input parameters:
- * the_chain - pointer to chain header
- *
- * Output parameters:
- * return_node - pointer to node in chain allocated
- * CHAIN_END - if no nodes available
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-Chain_Node *_Chain_Get(
- Chain_Control *the_chain
-)
-{
- ISR_Level level;
- Chain_Node *return_node;
-
- return_node = NULL;
- _ISR_Disable( level );
- if ( !_Chain_Is_empty( the_chain ) )
- return_node = _Chain_Get_first_unprotected( the_chain );
- _ISR_Enable( level );
- return return_node;
-}
-
-/*PAGE
- *
- * _Chain_Append
- *
- * This kernel routine puts a node on the end of the specified chain.
- *
- * Input parameters:
- * the_chain - pointer to chain header
- * node - address of node to put at rear of chain
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-void _Chain_Append(
- Chain_Control *the_chain,
- Chain_Node *node
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
- _Chain_Append_unprotected( the_chain, node );
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Chain_Extract
- *
- * This kernel routine deletes the given node from a chain.
- *
- * Input parameters:
- * node - pointer to node in chain to be deleted
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-void _Chain_Extract(
- Chain_Node *node
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
- _Chain_Extract_unprotected( node );
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Chain_Insert
- *
- * This kernel routine inserts a given node after a specified node
- * a requested chain.
- *
- * Input parameters:
- * after_node - pointer to node in chain to be inserted after
- * node - pointer to node to be inserted
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-void _Chain_Insert(
- Chain_Node *after_node,
- Chain_Node *node
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
- _Chain_Insert_unprotected( after_node, node );
- _ISR_Enable( level );
-}
diff --git a/c/src/exec/score/src/coremsg.c b/c/src/exec/score/src/coremsg.c
deleted file mode 100644
index 34778d26cd..0000000000
--- a/c/src/exec/score/src/coremsg.c
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * CORE Message Queue Handler
- *
- * DESCRIPTION:
- *
- * This package is the implementation of the CORE Message Queue Handler.
- * This core object provides task synchronization and communication functions
- * via messages passed to queue objects.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/score/coremsg.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/mpci.h>
-
-/*PAGE
- *
- * _CORE_message_queue_Initialize
- *
- * This routine initializes a newly created message queue based on the
- * specified data.
- *
- * Input parameters:
- * the_message_queue - the message queue to initialize
- * the_class - the API specific object class
- * the_message_queue_attributes - the message queue's attributes
- * maximum_pending_messages - maximum message and reserved buffer count
- * maximum_message_size - maximum size of each message
- * proxy_extract_callout - remote extract support
- *
- * Output parameters:
- * TRUE - if the message queue is initialized
- * FALSE - if the message queue is NOT initialized
- */
-
-boolean _CORE_message_queue_Initialize(
- CORE_message_queue_Control *the_message_queue,
- Objects_Classes the_class,
- CORE_message_queue_Attributes *the_message_queue_attributes,
- unsigned32 maximum_pending_messages,
- unsigned32 maximum_message_size,
- Thread_queue_Extract_callout proxy_extract_callout
-)
-{
- unsigned32 message_buffering_required;
- unsigned32 allocated_message_size;
-
- the_message_queue->maximum_pending_messages = maximum_pending_messages;
- the_message_queue->number_of_pending_messages = 0;
- the_message_queue->maximum_message_size = maximum_message_size;
- _CORE_message_queue_Set_notify( the_message_queue, NULL, NULL );
-
- /*
- * round size up to multiple of a ptr for chain init
- */
-
- allocated_message_size = maximum_message_size;
- if (allocated_message_size & (sizeof(unsigned32) - 1)) {
- allocated_message_size += sizeof(unsigned32);
- allocated_message_size &= ~(sizeof(unsigned32) - 1);
- }
-
- message_buffering_required = maximum_pending_messages *
- (allocated_message_size + sizeof(CORE_message_queue_Buffer_control));
-
- the_message_queue->message_buffers = (CORE_message_queue_Buffer *)
- _Workspace_Allocate( message_buffering_required );
-
- if (the_message_queue->message_buffers == 0)
- return FALSE;
-
- _Chain_Initialize (
- &the_message_queue->Inactive_messages,
- the_message_queue->message_buffers,
- maximum_pending_messages,
- allocated_message_size + sizeof( CORE_message_queue_Buffer_control )
- );
-
- _Chain_Initialize_empty( &the_message_queue->Pending_messages );
-
- _Thread_queue_Initialize(
- &the_message_queue->Wait_queue,
- the_class,
- _CORE_message_queue_Is_priority( the_message_queue_attributes ) ?
- THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_MESSAGE,
- proxy_extract_callout,
- CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
- );
-
- return TRUE;
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Close
- *
- * This function closes a message by returning all allocated space and
- * flushing the message_queue's task wait queue.
- *
- * Input parameters:
- * the_message_queue - the message_queue to be flushed
- * remote_extract_callout - function to invoke remotely
- * status - status to pass to thread
- *
- * Output parameters: NONE
- */
-
-void _CORE_message_queue_Close(
- CORE_message_queue_Control *the_message_queue,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-)
-{
-
- if ( the_message_queue->number_of_pending_messages != 0 )
- (void) _CORE_message_queue_Flush_support( the_message_queue );
- else
- _Thread_queue_Flush(
- &the_message_queue->Wait_queue,
- remote_extract_callout,
- status
- );
-
- (void) _Workspace_Free( the_message_queue->message_buffers );
-
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Flush
- *
- * This function flushes the message_queue's task wait queue. The number
- * of messages flushed from the queue is returned.
- *
- * Input parameters:
- * the_message_queue - the message_queue to be flushed
- *
- * Output parameters:
- * returns - the number of messages flushed from the queue
- */
-
-unsigned32 _CORE_message_queue_Flush(
- CORE_message_queue_Control *the_message_queue
-)
-{
- if ( the_message_queue->number_of_pending_messages != 0 )
- return _CORE_message_queue_Flush_support( the_message_queue );
- else
- return 0;
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Broadcast
- *
- * This function sends a message for every thread waiting on the queue and
- * returns the number of threads made ready by the message.
- *
- * Input parameters:
- * the_message_queue - message is submitted to this message queue
- * buffer - pointer to message buffer
- * size - size in bytes of message to send
- * id - id of message queue
- * api_message_queue_mp_support - api specific mp support callout
- * count - area to store number of threads made ready
- *
- * Output parameters:
- * count - number of threads made ready
- * CORE_MESSAGE_QUEUE_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-CORE_message_queue_Status _CORE_message_queue_Broadcast(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support,
- unsigned32 *count
-)
-{
- Thread_Control *the_thread;
- unsigned32 number_broadcasted;
- Thread_Wait_information *waitp;
- unsigned32 constrained_size;
-
- number_broadcasted = 0;
- while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) {
- waitp = &the_thread->Wait;
- number_broadcasted += 1;
-
- constrained_size = size;
- if ( size > the_message_queue->maximum_message_size )
- constrained_size = the_message_queue->maximum_message_size;
-
- _CORE_message_queue_Copy_buffer(
- buffer,
- waitp->return_argument,
- constrained_size
- );
-
- *(unsigned32 *)the_thread->Wait.return_argument_1 = size;
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- (*api_message_queue_mp_support) ( the_thread, id );
-
- }
- *count = number_broadcasted;
- return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Seize
- *
- * This kernel routine dequeues a message, copies the message buffer to
- * a given destination buffer, and frees the message buffer to the
- * inactive message pool. The thread will be blocked if wait is TRUE,
- * otherwise an error will be given to the thread if no messages are available.
- *
- * Input parameters:
- * the_message_queue - pointer to message queue
- * id - id of object we are waitig on
- * buffer - pointer to message buffer to be filled
- * size - pointer to the size of buffer to be filled
- * wait - TRUE if wait is allowed, FALSE otherwise
- * timeout - time to wait for a message
- *
- * Output parameters: NONE
- *
- * NOTE: Dependent on BUFFER_LENGTH
- *
- * INTERRUPT LATENCY:
- * available
- * wait
- */
-
-void _CORE_message_queue_Seize(
- CORE_message_queue_Control *the_message_queue,
- Objects_Id id,
- void *buffer,
- unsigned32 *size,
- boolean wait,
- Watchdog_Interval timeout
-)
-{
- ISR_Level level;
- CORE_message_queue_Buffer_control *the_message;
- Thread_Control *executing;
-
- executing = _Thread_Executing;
- executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
- _ISR_Disable( level );
- if ( the_message_queue->number_of_pending_messages != 0 ) {
- the_message_queue->number_of_pending_messages -= 1;
-
- the_message = _CORE_message_queue_Get_pending_message( the_message_queue );
- _ISR_Enable( level );
- *size = the_message->Contents.size;
- _CORE_message_queue_Copy_buffer(the_message->Contents.buffer,buffer,*size );
- _CORE_message_queue_Free_message_buffer(the_message_queue, the_message );
- return;
- }
-
- if ( !wait ) {
- _ISR_Enable( level );
- executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT;
- return;
- }
-
- _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue );
- executing->Wait.queue = &the_message_queue->Wait_queue;
- executing->Wait.id = id;
- executing->Wait.return_argument = (void *)buffer;
- executing->Wait.return_argument_1 = (void *)size;
- _ISR_Enable( level );
-
- _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Flush_support
- *
- * This message handler routine removes all messages from a message queue
- * and returns them to the inactive message pool. The number of messages
- * flushed from the queue is returned
- *
- * Input parameters:
- * the_message_queue - pointer to message queue
- *
- * Output parameters:
- * returns - number of messages placed on inactive chain
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-unsigned32 _CORE_message_queue_Flush_support(
- CORE_message_queue_Control *the_message_queue
-)
-{
- ISR_Level level;
- Chain_Node *inactive_first;
- Chain_Node *message_queue_first;
- Chain_Node *message_queue_last;
- unsigned32 count;
-
- _ISR_Disable( level );
- inactive_first = the_message_queue->Inactive_messages.first;
- message_queue_first = the_message_queue->Pending_messages.first;
- message_queue_last = the_message_queue->Pending_messages.last;
-
- the_message_queue->Inactive_messages.first = message_queue_first;
- message_queue_last->next = inactive_first;
- inactive_first->previous = message_queue_last;
- message_queue_first->previous =
- _Chain_Head( &the_message_queue->Inactive_messages );
-
- _Chain_Initialize_empty( &the_message_queue->Pending_messages );
-
- count = the_message_queue->number_of_pending_messages;
- the_message_queue->number_of_pending_messages = 0;
- _ISR_Enable( level );
- return count;
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Submit
- *
- * This routine implements the send and urgent message functions. It
- * processes a message that is to be submitted to the designated
- * message queue. The message will either be processed as a
- * send message which it will be inserted at the rear of the queue
- * or it will be processed as an urgent message which will be inserted
- * at the front of the queue.
- *
- * Input parameters:
- * the_message_queue - message is submitted to this message queue
- * buffer - pointer to message buffer
- * size - size in bytes of message to send
- * id - id of message queue
- * api_message_queue_mp_support - api specific mp support callout
- * submit_type - send or urgent message
- *
- * Output parameters:
- * CORE_MESSAGE_QUEUE_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-CORE_message_queue_Status _CORE_message_queue_Submit(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support,
- CORE_message_queue_Submit_types submit_type
-)
-{
- CORE_message_queue_Buffer_control *the_message;
- Thread_Control *the_thread;
-
- if ( size > the_message_queue->maximum_message_size )
- return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE;
-
- /*
- * Is there a thread currently waiting on this message queue?
- */
-
- the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue );
- if ( the_thread )
- {
- _CORE_message_queue_Copy_buffer(
- buffer,
- the_thread->Wait.return_argument,
- size
- );
- *(unsigned32 *)the_thread->Wait.return_argument_1 = size;
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- (*api_message_queue_mp_support) ( the_thread, id );
-
- return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
- }
-
- /*
- * No one waiting on this one currently.
- * Allocate a message buffer and store it away
- */
-
- if ( the_message_queue->number_of_pending_messages ==
- the_message_queue->maximum_pending_messages ) {
- return CORE_MESSAGE_QUEUE_STATUS_TOO_MANY;
- }
-
- the_message = _CORE_message_queue_Allocate_message_buffer(the_message_queue);
- if ( the_message == 0)
- return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED;
-
- _CORE_message_queue_Copy_buffer( buffer, the_message->Contents.buffer, size );
- the_message->Contents.size = size;
-
- the_message_queue->number_of_pending_messages += 1;
-
- switch ( submit_type ) {
- case CORE_MESSAGE_QUEUE_SEND_REQUEST:
- _CORE_message_queue_Append( the_message_queue, the_message );
- break;
- case CORE_MESSAGE_QUEUE_URGENT_REQUEST:
- _CORE_message_queue_Prepend( the_message_queue, the_message );
- break;
- }
-
- return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
-}
diff --git a/c/src/exec/score/src/coremutex.c b/c/src/exec/score/src/coremutex.c
deleted file mode 100644
index dac5a5172b..0000000000
--- a/c/src/exec/score/src/coremutex.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Mutex Handler
- *
- * DESCRIPTION:
- *
- * This package is the implementation of the Mutex Handler.
- * This handler provides synchronization and mutual exclusion capabilities.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/coremutex.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-
-/*PAGE
- *
- * _CORE_mutex_Initialize
- *
- * This routine initializes a mutex at create time and set the control
- * structure according to the values passed.
- *
- * Input parameters:
- * the_mutex - the mutex control block to initialize
- * the_class - the API class of the object
- * the_mutex_attributes - the mutex attributes specified at create time
- * initial_lock - mutex initial lock or unlocked status
- * proxy_extract_callout - MP specific extract callout
- *
- * Output parameters: NONE
- */
-
-void _CORE_mutex_Initialize(
- CORE_mutex_Control *the_mutex,
- Objects_Classes the_class,
- CORE_mutex_Attributes *the_mutex_attributes,
- unsigned32 initial_lock,
- Thread_queue_Extract_callout proxy_extract_callout
-)
-{
-
-/* Add this to the RTEMS environment later ?????????
- rtems_assert( initial_lock == CORE_MUTEX_LOCKED ||
- initial_lock == CORE_MUTEX_UNLOCKED );
- */
-
- the_mutex->Attributes = *the_mutex_attributes;
- the_mutex->lock = initial_lock;
-
- if ( initial_lock == CORE_MUTEX_LOCKED ) {
- the_mutex->nest_count = 1;
- the_mutex->holder = _Thread_Executing;
- the_mutex->holder_id = _Thread_Executing->Object.id;
- _Thread_Executing->resource_count++;
- } else {
- the_mutex->nest_count = 0;
- the_mutex->holder = NULL;
- the_mutex->holder_id = 0;
- }
-
- _Thread_queue_Initialize(
- &the_mutex->Wait_queue,
- the_class,
- _CORE_mutex_Is_fifo( the_mutex_attributes ) ?
- THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY,
- STATES_WAITING_FOR_MUTEX,
- proxy_extract_callout,
- CORE_MUTEX_TIMEOUT
- );
-}
-
-/*PAGE
- *
- * _CORE_mutex_Seize
- *
- * This routine attempts to allocate a mutex to the calling thread.
- *
- * Input parameters:
- * the_mutex - pointer to mutex control block
- * id - id of object to wait on
- * wait - TRUE if wait is allowed, FALSE otherwise
- * timeout - number of ticks to wait (0 means forever)
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * available
- * wait
- */
-
-void _CORE_mutex_Seize(
- CORE_mutex_Control *the_mutex,
- Objects_Id id,
- boolean wait,
- Watchdog_Interval timeout
-)
-{
- Thread_Control *executing;
- ISR_Level level;
-
- executing = _Thread_Executing;
- switch ( the_mutex->Attributes.discipline ) {
- case CORE_MUTEX_DISCIPLINES_FIFO:
- case CORE_MUTEX_DISCIPLINES_PRIORITY:
- case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
- break;
- case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
- if ( executing->current_priority <
- the_mutex->Attributes.priority_ceiling) {
- executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED;
- return;
- }
- }
- executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
- _ISR_Disable( level );
- if ( ! _CORE_mutex_Is_locked( the_mutex ) ) {
- the_mutex->lock = CORE_MUTEX_LOCKED;
- the_mutex->holder = executing;
- the_mutex->holder_id = executing->Object.id;
- the_mutex->nest_count = 1;
- executing->resource_count++;
- _ISR_Enable( level );
- switch ( the_mutex->Attributes.discipline ) {
- case CORE_MUTEX_DISCIPLINES_FIFO:
- case CORE_MUTEX_DISCIPLINES_PRIORITY:
- case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
- /* already the highest priority */
- break;
- case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
- if ( the_mutex->Attributes.priority_ceiling <
- executing->current_priority ) {
- _Thread_Change_priority(
- the_mutex->holder,
- the_mutex->Attributes.priority_ceiling,
- FALSE
- );
- }
- }
- return;
- }
-
- if ( _Objects_Are_ids_equal(
- _Thread_Executing->Object.id, the_mutex->holder_id ) ) {
- if ( _CORE_mutex_Is_nesting_allowed( &the_mutex->Attributes ) )
- the_mutex->nest_count++;
- else
- executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
-
- _ISR_Enable( level );
- return;
- }
-
- if ( !wait ) {
- _ISR_Enable( level );
- executing->Wait.return_code = CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT;
- return;
- }
-
- _Thread_queue_Enter_critical_section( &the_mutex->Wait_queue );
- executing->Wait.queue = &the_mutex->Wait_queue;
- executing->Wait.id = id;
- _ISR_Enable( level );
-
- switch ( the_mutex->Attributes.discipline ) {
- case CORE_MUTEX_DISCIPLINES_FIFO:
- case CORE_MUTEX_DISCIPLINES_PRIORITY:
- case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
- break;
- case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
- if ( the_mutex->holder->current_priority > executing->current_priority ) {
- _Thread_Change_priority(
- the_mutex->holder,
- executing->current_priority,
- FALSE
- );
- }
- break;
- }
-
- _Thread_queue_Enqueue( &the_mutex->Wait_queue, timeout );
-
- if ( _Thread_Executing->Wait.return_code == CORE_MUTEX_STATUS_SUCCESSFUL ) {
- switch ( the_mutex->Attributes.discipline ) {
- case CORE_MUTEX_DISCIPLINES_FIFO:
- case CORE_MUTEX_DISCIPLINES_PRIORITY:
- case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
- break;
- case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
- if ( the_mutex->Attributes.priority_ceiling <
- executing->current_priority ) {
- _Thread_Change_priority(
- executing,
- the_mutex->Attributes.priority_ceiling,
- FALSE
- );
- };
- break;
- }
- }
-}
-
-/*
- * _CORE_mutex_Surrender
- *
- * DESCRIPTION:
- *
- * This routine frees a unit to the mutex. If a task was blocked waiting for
- * a unit from this mutex, then that task will be readied and the unit
- * given to that task. Otherwise, the unit will be returned to the mutex.
- *
- * Input parameters:
- * the_mutex - the mutex to be flushed
- * id - id of parent mutex
- * api_mutex_mp_support - api dependent MP support actions
- *
- * Output parameters:
- * CORE_MUTEX_STATUS_SUCCESSFUL - if successful
- * core error code - if unsuccessful
- */
-
-CORE_mutex_Status _CORE_mutex_Surrender(
- CORE_mutex_Control *the_mutex,
- Objects_Id id,
- CORE_mutex_API_mp_support_callout api_mutex_mp_support
-)
-{
- Thread_Control *the_thread;
- Thread_Control *executing;
-
- executing = _Thread_Executing;
-
- /*
- * The following code allows a thread (or ISR) other than the thread
- * which acquired the mutex to release that mutex. This is only
- * allowed when the mutex in quetion is FIFO or simple Priority
- * discipline. But Priority Ceiling or Priority Inheritance mutexes
- * must be released by the thread which acquired them.
- */
-
- if ( !_Objects_Are_ids_equal(
- _Thread_Executing->Object.id, the_mutex->holder_id ) ) {
-
- switch ( the_mutex->Attributes.discipline ) {
- case CORE_MUTEX_DISCIPLINES_FIFO:
- case CORE_MUTEX_DISCIPLINES_PRIORITY:
- break;
- case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
- case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
- return( CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE );
- break;
- }
- }
-
- the_mutex->nest_count--;
-
- if ( the_mutex->nest_count != 0 )
- return( CORE_MUTEX_STATUS_SUCCESSFUL );
-
- _Thread_Executing->resource_count--;
- the_mutex->holder = NULL;
- the_mutex->holder_id = 0;
-
- /*
- * Whether or not someone is waiting for the mutex, an
- * inherited priority must be lowered if this is the last
- * mutex (i.e. resource) this task has.
- */
-
- switch ( the_mutex->Attributes.discipline ) {
- case CORE_MUTEX_DISCIPLINES_FIFO:
- case CORE_MUTEX_DISCIPLINES_PRIORITY:
- break;
- case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
- case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
- if ( executing->resource_count == 0 &&
- executing->real_priority != executing->current_priority ) {
- _Thread_Change_priority( executing, executing->real_priority, TRUE );
- }
- break;
- }
-
-
- if ( ( the_thread = _Thread_queue_Dequeue( &the_mutex->Wait_queue ) ) ) {
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) ) {
-
- the_mutex->holder = NULL;
- the_mutex->holder_id = the_thread->Object.id;
- the_mutex->nest_count = 1;
-
- ( *api_mutex_mp_support)( the_thread, id );
-
- } else {
-
- the_mutex->holder = the_thread;
- the_mutex->holder_id = the_thread->Object.id;
- the_thread->resource_count++;
- the_mutex->nest_count = 1;
-
- /*
- * No special action for priority inheritance or priority ceiling
- * because the_thread is guaranteed to be the highest priority
- * thread waiting for the mutex.
- */
- }
- } else
- the_mutex->lock = CORE_MUTEX_UNLOCKED;
-
- return( CORE_MUTEX_STATUS_SUCCESSFUL );
-}
-
-/*PAGE
- *
- * _CORE_mutex_Flush
- *
- * This function a flushes the mutex's task wait queue.
- *
- * Input parameters:
- * the_mutex - the mutex to be flushed
- * remote_extract_callout - function to invoke remotely
- * status - status to pass to thread
- *
- * Output parameters: NONE
- */
-
-void _CORE_mutex_Flush(
- CORE_mutex_Control *the_mutex,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-)
-{
- _Thread_queue_Flush(
- &the_mutex->Wait_queue,
- remote_extract_callout,
- status
- );
-}
diff --git a/c/src/exec/score/src/coresem.c b/c/src/exec/score/src/coresem.c
deleted file mode 100644
index 074ba2cb22..0000000000
--- a/c/src/exec/score/src/coresem.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * CORE Semaphore Handler
- *
- * DESCRIPTION:
- *
- * This package is the implementation of the CORE Semaphore Handler.
- * This core object utilizes standard Dijkstra counting semaphores to provide
- * synchronization and mutual exclusion capabilities.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/coresem.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/mpci.h>
-
-/*PAGE
- *
- * CORE_semaphore_Initialize
- *
- * This function initialize a semaphore and sets the initial value based
- * on the given count.
- *
- * Input parameters:
- * the_semaphore - the semaphore control block to initialize
- * the_class - the API class of the object
- * the_semaphore_attributes - the attributes specified at create time
- * initial_value - semaphore's initial value
- * proxy_extract_callout - MP specific extract callout
- *
- * Output parameters: NONE
- */
-
-void _CORE_semaphore_Initialize(
- CORE_semaphore_Control *the_semaphore,
- Objects_Classes the_class,
- CORE_semaphore_Attributes *the_semaphore_attributes,
- unsigned32 initial_value,
- Thread_queue_Extract_callout proxy_extract_callout
-)
-{
-
- the_semaphore->Attributes = *the_semaphore_attributes;
- the_semaphore->count = initial_value;
-
- _Thread_queue_Initialize(
- &the_semaphore->Wait_queue,
- the_class,
- _CORE_semaphore_Is_priority( the_semaphore_attributes ) ?
- THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_SEMAPHORE,
- proxy_extract_callout,
- CORE_SEMAPHORE_TIMEOUT
- );
-}
-
-/*PAGE
- *
- * _CORE_semaphore_Surrender
- *
- * Input parameters:
- * the_semaphore - the semaphore to be flushed
- * id - id of parent semaphore
- * api_semaphore_mp_support - api dependent MP support actions
- *
- * Output parameters:
- * CORE_SEMAPHORE_STATUS_SUCCESSFUL - if successful
- * core error code - if unsuccessful
- *
- * Output parameters:
- */
-
-CORE_semaphore_Status _CORE_semaphore_Surrender(
- CORE_semaphore_Control *the_semaphore,
- Objects_Id id,
- CORE_semaphore_API_mp_support_callout api_semaphore_mp_support
-)
-{
- Thread_Control *the_thread;
-
- if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) {
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- (*api_semaphore_mp_support) ( the_thread, id );
-
- } else
- the_semaphore->count += 1;
-
- return( CORE_SEMAPHORE_STATUS_SUCCESSFUL );
-}
-
-/*PAGE
- *
- * _CORE_semaphore_Seize
- *
- * This routine attempts to allocate a core semaphore to the calling thread.
- *
- * Input parameters:
- * the_semaphore - pointer to semaphore control block
- * id - id of object to wait on
- * wait - TRUE if wait is allowed, FALSE otherwise
- * timeout - number of ticks to wait (0 means forever)
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * available
- * wait
- */
-
-void _CORE_semaphore_Seize(
- CORE_semaphore_Control *the_semaphore,
- Objects_Id id,
- boolean wait,
- Watchdog_Interval timeout
-)
-{
- Thread_Control *executing;
- ISR_Level level;
-
- executing = _Thread_Executing;
- executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
- _ISR_Disable( level );
- if ( the_semaphore->count != 0 ) {
- the_semaphore->count -= 1;
- _ISR_Enable( level );
- return;
- }
-
- if ( !wait ) {
- _ISR_Enable( level );
- executing->Wait.return_code = CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT;
- return;
- }
-
- _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue );
- executing->Wait.queue = &the_semaphore->Wait_queue;
- executing->Wait.id = id;
- _ISR_Enable( level );
-
- _Thread_queue_Enqueue( &the_semaphore->Wait_queue, timeout );
-}
-
-
-/*PAGE
- *
- * _CORE_semaphore_Flush
- *
- * This function a flushes the semaphore's task wait queue.
- *
- * Input parameters:
- * the_semaphore - the semaphore to be flushed
- * remote_extract_callout - function to invoke remotely
- * status - status to pass to thread
- *
- * Output parameters: NONE
- */
-
-void _CORE_semaphore_Flush(
- CORE_semaphore_Control *the_semaphore,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-)
-{
-
- _Thread_queue_Flush(
- &the_semaphore->Wait_queue,
- remote_extract_callout,
- status
- );
-
-}
diff --git a/c/src/exec/score/src/coretod.c b/c/src/exec/score/src/coretod.c
deleted file mode 100644
index 72742944b4..0000000000
--- a/c/src/exec/score/src/coretod.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Time of Day (TOD) Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
-
-/*PAGE
- *
- * _TOD_Handler_initialization
- *
- * This routine initializes the time of day handler.
- *
- * Input parameters:
- * microseconds_per_tick - microseconds between clock ticks
- *
- * Output parameters: NONE
- */
-
-void _TOD_Handler_initialization(
- unsigned32 microseconds_per_tick
-)
-{
- _TOD_Microseconds_per_tick = microseconds_per_tick;
-
- _TOD_Seconds_since_epoch = 0;
-
- _TOD_Current.year = TOD_BASE_YEAR;
- _TOD_Current.month = 1;
- _TOD_Current.day = 1;
- _TOD_Current.hour = 0;
- _TOD_Current.minute = 0;
- _TOD_Current.second = 0;
- _TOD_Current.ticks = 0;
-
- if ( microseconds_per_tick == 0 )
- _TOD_Ticks_per_second = 0;
- else
- _TOD_Ticks_per_second =
- TOD_MICROSECONDS_PER_SECOND / microseconds_per_tick;
-
- _Watchdog_Initialize( &_TOD_Seconds_watchdog, _TOD_Tickle, 0, NULL );
-
- _TOD_Is_set = FALSE;
- _TOD_Activate( _TOD_Ticks_per_second );
-}
-
-/*PAGE
- *
- * _TOD_Set
- *
- * This rountine sets the current date and time with the specified
- * new date and time structure.
- *
- * Input parameters:
- * the_tod - pointer to the time and date structure
- * seconds_since_epoch - seconds since system epoch
- *
- * Output parameters: NONE
- */
-
-void _TOD_Set(
- TOD_Control *the_tod,
- Watchdog_Interval seconds_since_epoch
-)
-{
- Watchdog_Interval ticks_until_next_second;
-
- _Thread_Disable_dispatch();
- _TOD_Deactivate();
-
- if ( seconds_since_epoch < _TOD_Seconds_since_epoch )
- _Watchdog_Adjust_seconds( WATCHDOG_BACKWARD,
- _TOD_Seconds_since_epoch - seconds_since_epoch );
- else
- _Watchdog_Adjust_seconds( WATCHDOG_FORWARD,
- seconds_since_epoch - _TOD_Seconds_since_epoch );
-
- ticks_until_next_second = _TOD_Ticks_per_second;
- if ( ticks_until_next_second > _TOD_Current.ticks )
- ticks_until_next_second -= _TOD_Current.ticks;
-
- _TOD_Current = *the_tod;
- _TOD_Seconds_since_epoch = seconds_since_epoch;
- _TOD_Is_set = TRUE;
- _TOD_Activate( ticks_until_next_second );
-
- _Thread_Enable_dispatch();
-}
-
-/*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;
-}
-
-/*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 );
-}
-
-/*PAGE
- *
- * _TOD_Tickle
- *
- * This routine updates the calendar time and tickles the
- * per second watchdog timer chain.
- *
- * Input parameters:
- * ignored - this parameter is ignored
- *
- * Output parameters: NONE
- *
- * NOTE: This routine only works for leap-years through 2099.
- */
-
-void _TOD_Tickle(
- Objects_Id id,
- void *ignored
-)
-{
- unsigned32 leap;
-
- _TOD_Current.ticks = 0;
- ++_TOD_Seconds_since_epoch;
- if ( ++_TOD_Current.second >= TOD_SECONDS_PER_MINUTE ) {
- _TOD_Current.second = 0;
- if ( ++_TOD_Current.minute >= TOD_MINUTES_PER_HOUR ) {
- _TOD_Current.minute = 0;
- if ( ++_TOD_Current.hour >= TOD_HOURS_PER_DAY ) {
- _TOD_Current.hour = 0;
- if ( _TOD_Current.year & 0x3 ) leap = 0;
- else leap = 1;
- if ( ++_TOD_Current.day >
- _TOD_Days_per_month[ leap ][ _TOD_Current.month ]) {
- _TOD_Current.day = 1;
- if ( ++_TOD_Current.month > TOD_MONTHS_PER_YEAR ) {
- _TOD_Current.month = 1;
- _TOD_Current.year++;
- }
- }
- }
- }
- }
-
- _Watchdog_Tickle_seconds();
- _Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, _TOD_Ticks_per_second );
-}
diff --git a/c/src/exec/score/src/heap.c b/c/src/exec/score/src/heap.c
deleted file mode 100644
index d8a1aad8bd..0000000000
--- a/c/src/exec/score/src/heap.c
+++ /dev/null
@@ -1,538 +0,0 @@
-/*
- * Heap Handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/heap.h>
-
-/*PAGE
- *
- * _Heap_Initialize
- *
- * This kernel routine initializes a heap.
- *
- * Input parameters:
- * the_heap - pointer to heap header
- * starting_address - starting address of heap
- * size - size of heap
- * page_size - allocatable unit of memory
- *
- * Output parameters:
- * returns - maximum memory available if RTEMS_SUCCESSFUL
- * 0 - otherwise
- *
- * This is what a heap looks like in memory immediately
- * after initialization:
- *
- * +--------------------------------+
- * 0 | size = 0 | status = used | a.k.a. dummy back flag
- * +--------------------------------+
- * 4 | size = size-8 | status = free | a.k.a. front flag
- * +--------------------------------+
- * 8 | next = PERM HEAP_TAIL |
- * +--------------------------------+
- * 12 | previous = PERM HEAP_HEAD |
- * +--------------------------------+
- * | |
- * | memory available |
- * | for allocation |
- * | |
- * +--------------------------------+
- * size - 8 | size = size-8 | status = free | a.k.a. back flag
- * +--------------------------------+
- * size - 4 | size = 0 | status = used | a.k.a. dummy front flag
- * +--------------------------------+
- */
-
-unsigned32 _Heap_Initialize(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 size,
- unsigned32 page_size
-)
-{
- Heap_Block *the_block;
- unsigned32 the_size;
-
- if ( !_Heap_Is_page_size_valid( page_size ) ||
- (size < HEAP_MINIMUM_SIZE) )
- return 0;
-
- the_heap->page_size = page_size;
- the_size = size - HEAP_OVERHEAD;
-
- the_block = (Heap_Block *) starting_address;
- the_block->back_flag = HEAP_DUMMY_FLAG;
- the_block->front_flag = the_size;
- the_block->next = _Heap_Tail( the_heap );
- the_block->previous = _Heap_Head( the_heap );
-
- the_heap->start = the_block;
- the_heap->first = the_block;
- the_heap->permanent_null = NULL;
- the_heap->last = the_block;
-
- the_block = _Heap_Next_block( the_block );
- the_block->back_flag = the_size;
- the_block->front_flag = HEAP_DUMMY_FLAG;
- the_heap->final = the_block;
-
- return ( the_size - HEAP_BLOCK_USED_OVERHEAD );
-}
-
-/*PAGE
- *
- * _Heap_Extend
- *
- * This routine grows the_heap memory area using the size bytes which
- * begin at starting_address.
- *
- * Input parameters:
- * the_heap - pointer to heap header.
- * starting_address - pointer to the memory area.
- * size - size in bytes of the memory block to allocate.
- *
- * Output parameters:
- * *amount_extended - amount of memory added to the_heap
- */
-
-Heap_Extend_status _Heap_Extend(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 size,
- unsigned32 *amount_extended
-)
-{
- Heap_Block *the_block;
- unsigned32 *p;
-
- /*
- * The overhead was taken from the original heap memory.
- */
-
- Heap_Block *old_final;
- Heap_Block *new_final;
-
- /*
- * There are five possibilities for the location of starting
- * address:
- *
- * 1. non-contiguous lower address (NOT SUPPORTED)
- * 2. contiguous lower address (NOT SUPPORTED)
- * 3. in the heap (ERROR)
- * 4. contiguous higher address (SUPPORTED)
- * 5. non-contiguous higher address (NOT SUPPORTED)
- *
- * As noted, this code only supports (4).
- */
-
- if ( starting_address >= (void *) the_heap->start && /* case 3 */
- starting_address <= (void *) the_heap->final
- )
- return HEAP_EXTEND_ERROR;
-
- if ( starting_address < (void *) the_heap->start ) { /* cases 1 and 2 */
-
- return HEAP_EXTEND_NOT_IMPLEMENTED; /* cases 1 and 2 */
-
- } else { /* cases 4 and 5 */
-
- the_block = (Heap_Block *)
- _Addresses_Subtract_offset( starting_address, HEAP_OVERHEAD );
- if ( the_block != the_heap->final )
- return HEAP_EXTEND_NOT_IMPLEMENTED; /* case 5 */
- }
-
- /*
- * Currently only case 4 should make it to this point.
- * The basic trick is to make the extend area look like a used
- * block and free it.
- */
-
- *amount_extended = size;
-
- old_final = the_heap->final;
- new_final = _Addresses_Add_offset( old_final, size );
- /* SAME AS: _Addresses_Add_offset( starting_address, size-HEAP_OVERHEAD ); */
-
- the_heap->final = new_final;
-
- old_final->front_flag =
- new_final->back_flag = _Heap_Build_flag( size, HEAP_BLOCK_USED );
- new_final->front_flag = HEAP_DUMMY_FLAG;
-
- /*
- * Must pass in address of "user" area
- * So add in the offset field.
- */
-
- p = (unsigned32 *) &old_final->next;
- *p = sizeof(unsigned32);
- p++;
- _Heap_Free( the_heap, p );
-
- return HEAP_EXTEND_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _Heap_Allocate
- *
- * This kernel routine allocates the requested size of memory
- * from the specified heap.
- *
- * Input parameters:
- * the_heap - pointer to heap header.
- * size - size in bytes of the memory block to allocate.
- *
- * Output parameters:
- * returns - starting address of memory block allocated
- */
-
-void *_Heap_Allocate(
- Heap_Control *the_heap,
- unsigned32 size
-)
-{
- unsigned32 excess;
- unsigned32 the_size;
- Heap_Block *the_block;
- Heap_Block *next_block;
- Heap_Block *temporary_block;
- void *ptr;
- unsigned32 offset;
-
- excess = size % the_heap->page_size;
- the_size = size + the_heap->page_size + HEAP_BLOCK_USED_OVERHEAD;
-
- if ( excess )
- the_size += the_heap->page_size - excess;
-
- if ( the_size < sizeof( Heap_Block ) )
- the_size = sizeof( Heap_Block );
-
- for ( the_block = the_heap->first;
- ;
- the_block = the_block->next ) {
- if ( the_block == _Heap_Tail( the_heap ) )
- return( NULL );
- if ( the_block->front_flag >= the_size )
- break;
- }
-
- if ( (the_block->front_flag - the_size) >
- (the_heap->page_size + HEAP_BLOCK_USED_OVERHEAD) ) {
- the_block->front_flag -= the_size;
- next_block = _Heap_Next_block( the_block );
- next_block->back_flag = the_block->front_flag;
-
- temporary_block = _Heap_Block_at( next_block, the_size );
- temporary_block->back_flag =
- next_block->front_flag = _Heap_Build_flag( the_size,
- HEAP_BLOCK_USED );
- ptr = _Heap_Start_of_user_area( next_block );
- } else {
- next_block = _Heap_Next_block( the_block );
- next_block->back_flag = _Heap_Build_flag( the_block->front_flag,
- HEAP_BLOCK_USED );
- the_block->front_flag = next_block->back_flag;
- the_block->next->previous = the_block->previous;
- the_block->previous->next = the_block->next;
- ptr = _Heap_Start_of_user_area( the_block );
- }
-
- /*
- * round ptr up to a multiple of page size
- * Have to save the bump amount in the buffer so that free can figure it out
- */
-
- offset = the_heap->page_size - (((unsigned32) ptr) & (the_heap->page_size - 1));
- ptr = _Addresses_Add_offset( ptr, offset );
- *(((unsigned32 *) ptr) - 1) = offset;
-
-#ifdef RTEMS_DEBUG
- {
- unsigned32 ptr_u32;
- ptr_u32 = (unsigned32) ptr;
- if (ptr_u32 & (the_heap->page_size - 1))
- abort();
- }
-#endif
-
- return ptr;
-}
-
-/*PAGE
- *
- * _Heap_Size_of_user_area
- *
- * This kernel routine returns the size of the memory area
- * given heap block.
- *
- * Input parameters:
- * the_heap - pointer to heap header
- * starting_address - starting address of the memory block to free.
- * size - pointer to size of area
- *
- * Output parameters:
- * size - size of area filled in
- * TRUE - if starting_address is valid heap address
- * FALSE - if starting_address is invalid heap address
- */
-
-boolean _Heap_Size_of_user_area(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 *size
-)
-{
- Heap_Block *the_block;
- Heap_Block *next_block;
- unsigned32 the_size;
-
- the_block = _Heap_User_block_at( starting_address );
-
- if ( !_Heap_Is_block_in( the_heap, the_block ) ||
- _Heap_Is_block_free( the_block ) )
- return( FALSE );
-
- the_size = _Heap_Block_size( the_block );
- next_block = _Heap_Block_at( the_block, the_size );
-
- if ( !_Heap_Is_block_in( the_heap, next_block ) ||
- (the_block->front_flag != next_block->back_flag) )
- return( FALSE );
-
- *size = the_size;
- return( TRUE );
-}
-
-/*PAGE
- *
- * _Heap_Free
- *
- * This kernel routine returns the memory designated by the
- * given heap and given starting address to the memory pool.
- *
- * Input parameters:
- * the_heap - pointer to heap header
- * starting_address - starting address of the memory block to free.
- *
- * Output parameters:
- * TRUE - if starting_address is valid heap address
- * FALSE - if starting_address is invalid heap address
- */
-
-boolean _Heap_Free(
- Heap_Control *the_heap,
- void *starting_address
-)
-{
- Heap_Block *the_block;
- Heap_Block *next_block;
- Heap_Block *new_next_block;
- Heap_Block *previous_block;
- Heap_Block *temporary_block;
- unsigned32 the_size;
-
- the_block = _Heap_User_block_at( starting_address );
-
- if ( !_Heap_Is_block_in( the_heap, the_block ) ||
- _Heap_Is_block_free( the_block ) ) {
- return( FALSE );
- }
-
- the_size = _Heap_Block_size( the_block );
- next_block = _Heap_Block_at( the_block, the_size );
-
- if ( !_Heap_Is_block_in( the_heap, next_block ) ||
- (the_block->front_flag != next_block->back_flag) ) {
- return( FALSE );
- }
-
- if ( _Heap_Is_previous_block_free( the_block ) ) {
- previous_block = _Heap_Previous_block( the_block );
-
- if ( !_Heap_Is_block_in( the_heap, previous_block ) ) {
- return( FALSE );
- }
-
- if ( _Heap_Is_block_free( next_block ) ) { /* coalesce both */
- previous_block->front_flag += next_block->front_flag + the_size;
- temporary_block = _Heap_Next_block( previous_block );
- temporary_block->back_flag = previous_block->front_flag;
- next_block->next->previous = next_block->previous;
- next_block->previous->next = next_block->next;
- }
- else { /* coalesce prev */
- previous_block->front_flag =
- next_block->back_flag = previous_block->front_flag + the_size;
- }
- }
- else if ( _Heap_Is_block_free( next_block ) ) { /* coalesce next */
- the_block->front_flag = the_size + next_block->front_flag;
- new_next_block = _Heap_Next_block( the_block );
- new_next_block->back_flag = the_block->front_flag;
- the_block->next = next_block->next;
- the_block->previous = next_block->previous;
- next_block->previous->next = the_block;
- next_block->next->previous = the_block;
-
- if (the_heap->first == next_block)
- the_heap->first = the_block;
- }
- else { /* no coalesce */
- next_block->back_flag =
- the_block->front_flag = the_size;
- the_block->previous = _Heap_Head( the_heap );
- the_block->next = the_heap->first;
- the_heap->first = the_block;
- the_block->next->previous = the_block;
- }
-
- return( TRUE );
-}
-
-/*PAGE
- *
- * _Heap_Walk
- *
- * This kernel routine walks the heap and verifies its correctness.
- *
- * Input parameters:
- * the_heap - pointer to heap header
- * source - a numeric indicator of the invoker of this routine
- * do_dump - when TRUE print the information
- *
- * Output parameters: NONE
- */
-
-#ifndef RTEMS_DEBUG
-
-void _Heap_Walk(
- Heap_Control *the_heap,
- int source,
- boolean do_dump
-)
-{
-}
-
-#else
-
-#include <stdio.h>
-#include <unistd.h>
-
-void _Heap_Walk(
- Heap_Control *the_heap,
- int source,
- boolean do_dump
-)
-{
- Heap_Block *the_block = 0; /* avoid warnings */
- Heap_Block *next_block = 0; /* avoid warnings */
- int notdone = 1;
- int error = 0;
- int passes = 0;
-
- /*
- * We don't want to allow walking the heap until we have
- * transferred control to the user task so we watch the
- * system state.
- */
-
- if ( !_System_state_Is_up( _System_state_Get() ) )
- return;
-
- the_block = the_heap->start;
-
- if (do_dump == TRUE) {
- printf("\nPASS: %d start @ 0x%p final 0x%p, first 0x%p last 0x%p\n",
- source, the_heap->start, the_heap->final,
- the_heap->first, the_heap->last
- );
- }
-
- /*
- * Handle the 1st block
- */
-
- if (the_block->back_flag != HEAP_DUMMY_FLAG) {
- printf("PASS: %d Back flag of 1st block isn't HEAP_DUMMY_FLAG\n", source);
- error = 1;
- }
-
- while (notdone) {
- passes++;
- if (error && (passes > 10))
- abort();
-
- if (do_dump == TRUE) {
- printf("PASS: %d Block @ 0x%p Back %d, Front %d",
- source, the_block,
- the_block->back_flag, the_block->front_flag);
- if ( _Heap_Is_block_free(the_block) ) {
- printf( " Prev 0x%p, Next 0x%p\n",
- the_block->previous, the_block->next);
- } else {
- printf("\n");
- }
- }
-
- /*
- * Handle the last block
- */
-
- if ( the_block->front_flag != HEAP_DUMMY_FLAG ) {
- next_block = _Heap_Next_block(the_block);
- if ( the_block->front_flag != next_block->back_flag ) {
- error = 1;
- printf("PASS: %d Front and back flags don't match\n", source);
- printf(" Current Block (%p): Back - %d, Front - %d",
- the_block, the_block->back_flag, the_block->front_flag);
- if (do_dump == TRUE) {
- if (_Heap_Is_block_free(the_block)) {
- printf(" Prev 0x%p, Next 0x%p\n",
- the_block->previous, the_block->next);
- } else {
- printf("\n");
- }
- } else {
- printf("\n");
- }
- printf(" Next Block (%p): Back - %d, Front - %d",
- next_block, next_block->back_flag, next_block->front_flag);
- if (do_dump == TRUE) {
- if (_Heap_Is_block_free(next_block)) {
- printf(" Prev 0x%p, Next 0x%p\n",
- the_block->previous, the_block->next);
- } else {
- printf("\n");
- }
- } else {
- printf("\n");
- }
- }
- }
-
- if (the_block->front_flag == HEAP_DUMMY_FLAG)
- notdone = 0;
- else
- the_block = next_block;
- }
-
- if (error)
- abort();
-}
-#endif
diff --git a/c/src/exec/score/src/interr.c b/c/src/exec/score/src/interr.c
deleted file mode 100644
index c3a6d48514..0000000000
--- a/c/src/exec/score/src/interr.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Internal Error Handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/userext.h>
-
-/*PAGE
- *
- * _Internal_error_Occurred
- *
- * This routine will invoke the fatal error handler supplied by the user
- * followed by the the default one provided by the executive. The default
- * error handler assumes no hardware is present to help inform the user
- * of the problem. Halt stores the error code in a known register,
- * disables interrupts, and halts the CPU. If the CPU does not have a
- * halt instruction, it will loop to itself.
- *
- * Input parameters:
- * the_source - what subsystem the error originated in
- * is_internal - if the error was internally generated
- * the_error - fatal error status code
- *
- * Output parameters:
- * As much information as possible is stored in a CPU dependent fashion.
- * See the CPU dependent code for more information.
- *
- * NOTE: The the_error is not necessarily a directive status code.
- */
-
-void volatile _Internal_error_Occurred(
- Internal_errors_Source the_source,
- boolean is_internal,
- unsigned32 the_error
-)
-{
-
- Internal_errors_What_happened.the_source = the_source;
- Internal_errors_What_happened.is_internal = is_internal;
- Internal_errors_What_happened.the_error = the_error;
-
- _User_extensions_Fatal( the_source, is_internal, the_error );
-
- _System_state_Set( SYSTEM_STATE_FAILED );
-
- _CPU_Fatal_halt( the_error );
-
- /* will not return from this routine */
-}
diff --git a/c/src/exec/score/src/isr.c b/c/src/exec/score/src/isr.c
deleted file mode 100644
index 53baf388c4..0000000000
--- a/c/src/exec/score/src/isr.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * ISR Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/stack.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/wkspace.h>
-
-/* _ISR_Handler_initialization
- *
- * This routine initializes the ISR handler.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _ISR_Handler_initialization( void )
-{
- _ISR_Signals_to_thread_executing = FALSE;
-
- _ISR_Nest_level = 0;
-
-#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
-
- if ( _CPU_Table.interrupt_stack_size < STACK_MINIMUM_SIZE )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL
- );
-
- _CPU_Interrupt_stack_low =
- _Workspace_Allocate_or_fatal_error( _CPU_Table.interrupt_stack_size );
-
- _CPU_Interrupt_stack_high = _Addresses_Add_offset(
- _CPU_Interrupt_stack_low,
- _CPU_Table.interrupt_stack_size
- );
-
-#endif
-
-#if ( CPU_HAS_HARDWARE_INTERRUPT_STACK == TRUE )
- _CPU_Install_interrupt_stack();
-#endif
-
-}
diff --git a/c/src/exec/score/src/mpci.c b/c/src/exec/score/src/mpci.c
deleted file mode 100644
index efe63160f3..0000000000
--- a/c/src/exec/score/src/mpci.c
+++ /dev/null
@@ -1,525 +0,0 @@
-/*
- * Multiprocessing Communications Interface (MPCI) Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/cpu.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/tqdata.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/score/sysstate.h>
-
-#include <rtems/score/coresem.h>
-
-/*PAGE
- *
- * _MPCI_Handler_initialization
- *
- * This subprogram performs the initialization necessary for this handler.
- */
-
-void _MPCI_Handler_initialization(
- MPCI_Control *users_mpci_table,
- unsigned32 timeout_status
-)
-{
- CORE_semaphore_Attributes attributes;
-
- if ( _System_state_Is_multiprocessing && !users_mpci_table )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_NO_MPCI
- );
-
- _MPCI_table = users_mpci_table;
-
- if ( !_System_state_Is_multiprocessing )
- return;
-
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor(
- MP_PACKET_MPCI_INTERNAL,
- _MPCI_Internal_packets_Process_packet
- );
-
- /*
- * Create the counting semaphore used by the MPCI Receive Server.
- */
-
- attributes.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
-
- _CORE_semaphore_Initialize(
- &_MPCI_Semaphore,
- OBJECTS_NO_CLASS, /* free floating semaphore */
- &attributes, /* the_semaphore_attributes */
- 0, /* initial_value */
- NULL /* proxy_extract_callout */
- );
-
- _Thread_queue_Initialize(
- &_MPCI_Remote_blocked_threads,
- OBJECTS_NO_CLASS,
- THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_RPC_REPLY,
- NULL,
- timeout_status
- );
-}
-
-/*PAGE
- *
- * _MPCI_Create_server
- *
- * This subprogram creates the MPCI receive server.
- */
-
-char *_MPCI_Internal_name = "MPCI";
-
-void _MPCI_Create_server( void )
-{
-
- if ( !_System_state_Is_multiprocessing )
- return;
-
- /*
- * Initialize the MPCI Receive Server
- */
-
- _MPCI_Receive_server_tcb = _Thread_Internal_allocate();
-
- _Thread_Initialize(
- &_Thread_Internal_information,
- _MPCI_Receive_server_tcb,
- NULL, /* allocate the stack */
- MPCI_RECEIVE_SERVER_STACK_SIZE,
- CPU_ALL_TASKS_ARE_FP,
- PRIORITY_MINIMUM,
- FALSE, /* no preempt */
- THREAD_CPU_BUDGET_ALGORITHM_NONE,
- NULL, /* no budget algorithm callout */
- 0, /* all interrupts enabled */
- _MPCI_Internal_name
- );
-
- _Thread_Start(
- _MPCI_Receive_server_tcb,
- THREAD_START_NUMERIC,
- (void *) _MPCI_Receive_server,
- NULL,
- 0
- );
-}
-
-/*PAGE
- *
- * _MPCI_Initialization
- *
- * This subprogram initializes the MPCI driver by
- * invoking the user provided MPCI initialization callout.
- */
-
-void _MPCI_Initialization ( void )
-{
- (*_MPCI_table->initialization)();
-}
-
-/*PAGE
- *
- * _MPCI_Register_packet_processor
- *
- * This routine registers the MPCI packet processor for the
- * designated object class.
- */
-
-void _MPCI_Register_packet_processor(
- MP_packet_Classes the_class,
- MPCI_Packet_processor the_packet_processor
-
-)
-{
- _MPCI_Packet_processors[ the_class ] = the_packet_processor;
-}
-
-/*PAGE
- *
- * _MPCI_Get_packet
- *
- * This subprogram obtains a packet by invoking the user provided
- * MPCI get packet callout.
- */
-
-MP_packet_Prefix *_MPCI_Get_packet ( void )
-{
- MP_packet_Prefix *the_packet;
-
- (*_MPCI_table->get_packet)( &the_packet );
-
- if ( the_packet == NULL )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_OUT_OF_PACKETS
- );
-
- /*
- * Put in a default timeout that will be used for
- * all packets that do not otherwise have a timeout.
- */
-
- the_packet->timeout = MPCI_DEFAULT_TIMEOUT;
-
- return the_packet;
-}
-
-/*PAGE
- *
- * _MPCI_Return_packet
- *
- * This subprogram returns a packet by invoking the user provided
- * MPCI return packet callout.
- */
-
-void _MPCI_Return_packet (
- MP_packet_Prefix *the_packet
-)
-{
- (*_MPCI_table->return_packet)( the_packet );
-}
-
-/*PAGE
- *
- * _MPCI_Send_process_packet
- *
- * This subprogram sends a process packet by invoking the user provided
- * MPCI send callout.
- */
-
-void _MPCI_Send_process_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet
-)
-{
- the_packet->source_tid = _Thread_Executing->Object.id;
- the_packet->to_convert =
- ( the_packet->to_convert - sizeof(MP_packet_Prefix) ) /
- sizeof(unsigned32);
-
- (*_MPCI_table->send_packet)( destination, the_packet );
-}
-
-/*PAGE
- *
- * _MPCI_Send_request_packet
- *
- * This subprogram sends a request packet by invoking the user provided
- * MPCI send callout.
- */
-
-unsigned32 _MPCI_Send_request_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet,
- States_Control extra_state
-)
-{
- the_packet->source_tid = _Thread_Executing->Object.id;
- the_packet->source_priority = _Thread_Executing->current_priority;
- the_packet->to_convert =
- ( the_packet->to_convert - sizeof(MP_packet_Prefix) ) /
- sizeof(unsigned32);
-
- _Thread_Executing->Wait.id = the_packet->id;
-
- _Thread_Executing->Wait.queue = &_MPCI_Remote_blocked_threads;
-
- _Thread_Disable_dispatch();
-
- (*_MPCI_table->send_packet)( destination, the_packet );
-
- _Thread_queue_Enter_critical_section( &_MPCI_Remote_blocked_threads );
-
- /*
- * See if we need a default timeout
- */
-
- if (the_packet->timeout == MPCI_DEFAULT_TIMEOUT)
- the_packet->timeout = _MPCI_table->default_timeout;
-
- _Thread_queue_Enqueue( &_MPCI_Remote_blocked_threads, the_packet->timeout );
-
- _Thread_Executing->current_state =
- _States_Set( extra_state, _Thread_Executing->current_state );
-
- _Thread_Enable_dispatch();
-
- return _Thread_Executing->Wait.return_code;
-}
-
-/*PAGE
- *
- * _MPCI_Send_response_packet
- *
- * This subprogram sends a response packet by invoking the user provided
- * MPCI send callout.
- */
-
-void _MPCI_Send_response_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet
-)
-{
- the_packet->source_tid = _Thread_Executing->Object.id;
-
- (*_MPCI_table->send_packet)( destination, the_packet );
-}
-
-/*PAGE
- *
- * _MPCI_Receive_packet
- *
- * This subprogram receives a packet by invoking the user provided
- * MPCI receive callout.
- */
-
-MP_packet_Prefix *_MPCI_Receive_packet ( void )
-{
- MP_packet_Prefix *the_packet;
-
- (*_MPCI_table->receive_packet)( &the_packet );
-
- return the_packet;
-}
-
-/*PAGE
- *
- * _MPCI_Process_response
- *
- * This subprogram obtains a packet by invoking the user provided
- * MPCI get packet callout.
- */
-
-Thread_Control *_MPCI_Process_response (
- MP_packet_Prefix *the_packet
-)
-{
- Thread_Control *the_thread;
- Objects_Locations location;
-
- the_thread = _Thread_Get( the_packet->id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- the_thread = NULL; /* IMPOSSIBLE */
- break;
- case OBJECTS_LOCAL:
- _Thread_queue_Extract( &_MPCI_Remote_blocked_threads, the_thread );
- the_thread->Wait.return_code = the_packet->return_code;
- _Thread_Unnest_dispatch();
- break;
- }
-
- return the_thread;
-}
-
-/*PAGE
- *
- * _MPCI_Receive_server
- *
- */
-
-Thread _MPCI_Receive_server(
- unsigned32 ignored
-)
-{
-
- MP_packet_Prefix *the_packet;
- MPCI_Packet_processor the_function;
- Thread_Control *executing;
-
- executing = _Thread_Executing;
-
- for ( ; ; ) {
-
- executing->receive_packet = NULL;
-
- _Thread_Disable_dispatch();
- _CORE_semaphore_Seize( &_MPCI_Semaphore, 0, TRUE, WATCHDOG_NO_TIMEOUT );
- _Thread_Enable_dispatch();
-
- for ( ; ; ) {
- the_packet = _MPCI_Receive_packet();
-
- if ( !the_packet )
- break;
-
- executing->receive_packet = the_packet;
-
- if ( !_Mp_packet_Is_valid_packet_class ( the_packet->the_class ) )
- break;
-
- the_function = _MPCI_Packet_processors[ the_packet->the_class ];
-
- if ( !the_function )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_BAD_PACKET
- );
-
- (*the_function)( the_packet );
- }
- }
-}
-
-/*PAGE
- *
- * _MPCI_Announce
- *
- */
-
-void _MPCI_Announce ( void )
-{
- _Thread_Disable_dispatch();
- (void) _CORE_semaphore_Surrender( &_MPCI_Semaphore, 0, 0 );
- _Thread_Enable_dispatch();
-}
-
-/*PAGE
- *
- * _MPCI_Internal_packets_Send_process_packet
- *
- */
-
-void _MPCI_Internal_packets_Send_process_packet (
- MPCI_Internal_Remote_operations operation
-)
-{
- MPCI_Internal_packet *the_packet;
-
- switch ( operation ) {
-
- case MPCI_PACKETS_SYSTEM_VERIFY:
-
- the_packet = _MPCI_Internal_packets_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_MPCI_INTERNAL;
- the_packet->Prefix.length = sizeof ( MPCI_Internal_packet );
- the_packet->Prefix.to_convert = sizeof ( MPCI_Internal_packet );
- the_packet->operation = operation;
-
- the_packet->maximum_nodes = _Objects_Maximum_nodes;
-
- the_packet->maximum_global_objects = _Objects_MP_Maximum_global_objects;
-
- _MPCI_Send_process_packet( MPCI_ALL_NODES, &the_packet->Prefix );
- break;
- }
-}
-
-/*PAGE
- *
- * _MPCI_Internal_packets_Send_request_packet
- *
- * This subprogram is not needed since there are no request
- * packets to be sent by this manager.
- *
- */
-
-/*PAGE
- *
- * _MPCI_Internal_packets_Send_response_packet
- *
- * This subprogram is not needed since there are no response
- * packets to be sent by this manager.
- *
- */
-
-/*PAGE
- *
- *
- * _MPCI_Internal_packets_Process_packet
- *
- */
-
-void _MPCI_Internal_packets_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-)
-{
- MPCI_Internal_packet *the_packet;
- unsigned32 maximum_nodes;
- unsigned32 maximum_global_objects;
-
- the_packet = (MPCI_Internal_packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case MPCI_PACKETS_SYSTEM_VERIFY:
-
- maximum_nodes = the_packet->maximum_nodes;
- maximum_global_objects = the_packet->maximum_global_objects;
- if ( maximum_nodes != _Objects_Maximum_nodes ||
- maximum_global_objects != _Objects_MP_Maximum_global_objects ) {
-
- _MPCI_Return_packet( the_packet_prefix );
-
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION
- );
- }
-
- _MPCI_Return_packet( the_packet_prefix );
-
- break;
- }
-}
-
-/*PAGE
- *
- * _MPCI_Internal_packets_Send_object_was_deleted
- *
- * This subprogram is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*PAGE
- *
- * _MPCI_Internal_packets_Send_extract_proxy
- *
- * This subprogram is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*PAGE
- *
- * _MPCI_Internal_packets_Get_packet
- *
- */
-
-MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void )
-{
- return ( (MPCI_Internal_packet *) _MPCI_Get_packet() );
-}
-
-/* end of file */
diff --git a/c/src/exec/score/src/object.c b/c/src/exec/score/src/object.c
deleted file mode 100644
index 7585235d3b..0000000000
--- a/c/src/exec/score/src/object.c
+++ /dev/null
@@ -1,516 +0,0 @@
-/*
- * Object Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/object.h>
-#include <rtems/score/objectmp.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/sysstate.h>
-
-/*PAGE
- *
- * _Objects_Handler_initialization
- *
- * This routine initializes the object handler.
- *
- * Input parameters:
- * node - local node
- * maximum_nodes - number of nodes in the system
- * maximum_global_objects - number of configured global objects
- *
- * Output parameters: NONE
- */
-
-void _Objects_Handler_initialization(
- unsigned32 node,
- unsigned32 maximum_nodes,
- unsigned32 maximum_global_objects
-)
-{
- if ( node < 1 || node > maximum_nodes )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_INVALID_NODE
- );
-
- _Objects_Local_node = node;
- _Objects_Maximum_nodes = maximum_nodes;
-
- _Objects_MP_Handler_initialization(
- node,
- maximum_nodes,
- maximum_global_objects
- );
-}
-
-/*PAGE
- *
- * _Objects_Initialize_information
- *
- * This routine initializes all object information related data structures.
- *
- * Input parameters:
- * information - object information table
- * the_class - object class
- * supports_global - TRUE if this is a global object class
- * maximum - maximum objects of this class
- * is_string - TRUE if names for this object are strings
- * size - size of this object's control block
- * is_thread - TRUE if this class is threads
- *
- * Output parameters: NONE
- */
-
-void _Objects_Initialize_information(
- Objects_Information *information,
- Objects_Classes the_class,
- boolean supports_global,
- unsigned32 maximum,
- unsigned32 size,
- boolean is_string,
- unsigned32 maximum_name_length,
- boolean is_thread
-)
-{
- unsigned32 minimum_index;
- unsigned32 index;
- Objects_Control *the_object;
- unsigned32 name_length;
- void *name_area;
-
- information->maximum = maximum;
- information->the_class = the_class;
- information->is_string = is_string;
- information->is_thread = is_thread;
-
- /*
- * Set the entry in the object information table.
- */
-
- _Objects_Information_table[ the_class ] = information;
-
- /*
- * Calculate minimum and maximum Id's
- */
-
- if ( maximum == 0 ) minimum_index = 0;
- else minimum_index = 1;
-
- information->minimum_id =
- _Objects_Build_id( the_class, _Objects_Local_node, minimum_index );
-
- information->maximum_id =
- _Objects_Build_id( the_class, _Objects_Local_node, maximum );
-
- /*
- * Allocate local pointer table
- */
-
- information->local_table =
- (Objects_Control **) _Workspace_Allocate_or_fatal_error(
- (maximum + 1) * sizeof(Objects_Control *)
- );
-
- /*
- * Allocate name table
- */
-
- name_length = maximum_name_length;
-
- if (name_length & (OBJECTS_NAME_ALIGNMENT-1))
- name_length = (name_length + OBJECTS_NAME_ALIGNMENT) &
- ~(OBJECTS_NAME_ALIGNMENT-1);
-
- information->name_length = name_length;
-
- name_area = (Objects_Name *)
- _Workspace_Allocate_or_fatal_error( (maximum + 1) * name_length );
- information->name_table = name_area;
-
- /*
- * Initialize local pointer table
- */
-
- for ( index=0 ; index <= maximum ; index++ ) {
- information->local_table[ index ] = NULL;
- }
-
- /*
- * Initialize objects .. if there are any
- */
-
- if ( maximum == 0 ) {
- _Chain_Initialize_empty( &information->Inactive );
- } else {
-
- _Chain_Initialize(
- &information->Inactive,
- _Workspace_Allocate_or_fatal_error( maximum * size ),
- maximum,
- size
- );
-
- the_object = (Objects_Control *) information->Inactive.first;
- for ( index=1; index <= maximum ; index++ ) {
- the_object->id =
- _Objects_Build_id( the_class, _Objects_Local_node, index );
-
- the_object->name = (void *) name_area;
-
- name_area = _Addresses_Add_offset( name_area, name_length );
-
- the_object = (Objects_Control *) the_object->Node.next;
- }
-
- }
-
- /*
- * Take care of multiprocessing
- */
-
- if ( supports_global == TRUE && _System_state_Is_multiprocessing ) {
-
- information->global_table =
- (Chain_Control *) _Workspace_Allocate_or_fatal_error(
- (_Objects_Maximum_nodes + 1) * sizeof(Chain_Control)
- );
-
- for ( index=1; index <= _Objects_Maximum_nodes ; index++ )
- _Chain_Initialize_empty( &information->global_table[ index ] );
- }
- else
- information->global_table = NULL;
-}
-
-/*PAGE
- *
- * _Objects_Clear_name
- *
- * XXX
- */
-
-void _Objects_Clear_name(
- void *name,
- unsigned32 length
-)
-{
- unsigned32 index;
- unsigned32 maximum = length / OBJECTS_NAME_ALIGNMENT;
- unsigned32 *name_ptr = (unsigned32 *) name;
-
- for ( index=0 ; index < maximum ; index++ )
- *name_ptr++ = 0;
-}
-
-/*PAGE
- *
- * _Objects_Copy_name_string
- *
- * XXX
- */
-
-void _Objects_Copy_name_string(
- void *source,
- void *destination
-)
-{
- unsigned8 *source_p = (unsigned8 *) source;
- unsigned8 *destination_p = (unsigned8 *) destination;
-
- do {
- *destination_p++ = *source_p;
- } while ( *source_p++ );
-}
-
-/*PAGE
- *
- * _Objects_Copy_name_raw
- *
- * XXX
- */
-
-void _Objects_Copy_name_raw(
- void *source,
- void *destination,
- unsigned32 length
-)
-{
- unsigned32 *source_p = (unsigned32 *) source;
- unsigned32 *destination_p = (unsigned32 *) destination;
- unsigned32 tmp_length = length / OBJECTS_NAME_ALIGNMENT;
-
- while ( tmp_length-- )
- *destination_p++ = *source_p++;
-}
-
-/*PAGE
- *
- * _Objects_Compare_name_string
- *
- * XXX
- */
-
-boolean _Objects_Compare_name_string(
- void *name_1,
- void *name_2,
- unsigned32 length
-)
-{
- unsigned8 *name_1_p = (unsigned8 *) name_1;
- unsigned8 *name_2_p = (unsigned8 *) name_2;
- unsigned32 tmp_length = length;
-
- do {
- if ( *name_1_p++ != *name_2_p++ )
- return FALSE;
- if ( !tmp_length-- )
- return FALSE;
- } while ( *name_1_p );
-
- return TRUE;
-}
-
-/*PAGE
- *
- * _Objects_Compare_name_raw
- *
- * XXX
- */
-
-boolean _Objects_Compare_name_raw(
- void *name_1,
- void *name_2,
- unsigned32 length
-)
-{
- unsigned32 *name_1_p = (unsigned32 *) name_1;
- unsigned32 *name_2_p = (unsigned32 *) name_2;
- unsigned32 tmp_length = length / OBJECTS_NAME_ALIGNMENT;
-
- while ( tmp_length-- )
- if ( *name_1_p++ != *name_2_p++ )
- return FALSE;
-
- return TRUE;
-}
-
-
-/*PAGE
- *
- * _Objects_Name_to_id
- *
- * These kernel routines search the object table(s) for the given
- * object name and returns the associated object id.
- *
- * Input parameters:
- * information - object information
- * name - user defined object name
- * node - node indentifier (0 indicates any node)
- * id - address of return ID
- *
- * Output parameters:
- * id - object id
- * OBJECTS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-Objects_Name_to_id_errors _Objects_Name_to_id(
- Objects_Information *information,
- Objects_Name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- boolean search_local_node;
- Objects_Control **objects;
- Objects_Control *the_object;
- unsigned32 index;
- unsigned32 name_length;
- Objects_Name_comparators compare_them;
-
- if ( name == 0 )
- return OBJECTS_INVALID_NAME;
-
- search_local_node = FALSE;
-
- if ( information->maximum != 0 &&
- (node == OBJECTS_SEARCH_ALL_NODES || node == OBJECTS_SEARCH_LOCAL_NODE ||
- _Objects_Is_local_node( node ) ) )
- search_local_node = TRUE;
-
- if ( search_local_node ) {
- objects = information->local_table;
-
- name_length = information->name_length;
-
- if ( information->is_string ) compare_them = _Objects_Compare_name_string;
- else compare_them = _Objects_Compare_name_raw;
-
- for ( index = 1; index <= information->maximum; index++ ) {
-
- the_object = objects[ index ];
-
- if ( !the_object || !the_object->name )
- continue;
-
- if ( (*compare_them)( name, the_object->name, name_length ) ) {
- *id = the_object->id;
- return OBJECTS_SUCCESSFUL;
- }
- }
- }
-
- if ( _Objects_Is_local_node( node ) || node == OBJECTS_SEARCH_LOCAL_NODE )
- return OBJECTS_INVALID_NAME;
-
- return ( _Objects_MP_Global_name_search( information, name, node, id ) );
-}
-
-/*PAGE
- *
- * _Objects_Get
- *
- * This routine sets the object pointer for the given
- * object id based on the given object information structure.
- *
- * Input parameters:
- * information - pointer to entry in table for this class
- * id - object id to search for
- * location - address of where to store the location
- *
- * Output parameters:
- * returns - address of object if local
- * location - one of the following:
- * OBJECTS_ERROR - invalid object ID
- * OBJECTS_REMOTE - remote object
- * OBJECTS_LOCAL - local object
- */
-
-Objects_Control *_Objects_Get(
- Objects_Information *information,
- Objects_Id id,
- Objects_Locations *location
-)
-{
- Objects_Control *the_object;
- unsigned32 index;
-
- index = id - information->minimum_id;
-
- if ( information->maximum >= index ) {
- _Thread_Disable_dispatch();
- if ( (the_object = information->local_table[index+1]) != NULL ) {
- *location = OBJECTS_LOCAL;
- return( the_object );
- }
- _Thread_Enable_dispatch();
- *location = OBJECTS_ERROR;
- return( NULL );
- }
- *location = OBJECTS_ERROR;
- _Objects_MP_Is_remote( information, id, location, &the_object );
- return the_object;
-}
-
-
-/*PAGE
- *
- * _Objects_Get_next
- *
- * Like _Objects_Get, but considers the 'id' as a "hint" and
- * finds next valid one after that point.
- * Mostly used for monitor and debug traversal of an object.
- *
- * Input parameters:
- * information - pointer to entry in table for this class
- * id - object id to search for
- * location - address of where to store the location
- * next_id - address to store next id to try
- *
- * Output parameters:
- * returns - address of object if local
- * location - one of the following:
- * OBJECTS_ERROR - invalid object ID
- * OBJECTS_REMOTE - remote object
- * OBJECTS_LOCAL - local object
- * next_id - will contain a reasonable "next" id to continue traversal
- *
- * NOTE:
- * assumes can add '1' to an id to get to next index.
- */
-
-Objects_Control *
-_Objects_Get_next(
- Objects_Information *information,
- Objects_Id id,
- Objects_Locations *location_p,
- Objects_Id *next_id_p
-)
-{
- Objects_Control *object;
- Objects_Id next_id;
-
- if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX)
- next_id = information->minimum_id;
- else
- next_id = id;
-
- do {
- /* walked off end of list? */
- if (_Objects_Get_index(next_id) > information->maximum)
- {
- *location_p = OBJECTS_ERROR;
- goto final;
- }
-
- /* try to grab one */
- object = _Objects_Get(information, next_id, location_p);
-
- next_id++;
-
- } while (*location_p != OBJECTS_LOCAL);
-
- *next_id_p = next_id;
- return object;
-
-final:
- *next_id_p = OBJECTS_ID_FINAL;
- return 0;
-}
-
-/*PAGE
- *
- * _Objects_Get_information
- *
- * XXX
- */
-
-Objects_Information *_Objects_Get_information(
- Objects_Id id
-)
-{
- Objects_Classes the_class;
-
- the_class = _Objects_Get_class( id );
-
- if ( !_Objects_Is_class_valid( the_class ) )
- return NULL;
-
- return _Objects_Information_table[ the_class ];
-}
-
diff --git a/c/src/exec/score/src/objectmp.c b/c/src/exec/score/src/objectmp.c
deleted file mode 100644
index 62f7fb5285..0000000000
--- a/c/src/exec/score/src/objectmp.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Multiprocessing Support for the Object Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/object.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/thread.h>
-
-/*PAGE
- *
- * _Objects_MP_Handler_initialization
- *
- */
-
-void _Objects_MP_Handler_initialization (
- unsigned32 node,
- unsigned32 maximum_nodes,
- unsigned32 maximum_global_objects
-)
-{
- _Objects_MP_Maximum_global_objects = maximum_global_objects;
-
- if ( maximum_global_objects == 0 ) {
- _Chain_Initialize_empty( &_Objects_MP_Inactive_global_objects );
- return;
- }
-
- _Chain_Initialize(
- &_Objects_MP_Inactive_global_objects,
- _Workspace_Allocate_or_fatal_error(
- maximum_global_objects * sizeof( Objects_MP_Control )
- ),
- maximum_global_objects,
- sizeof( Objects_MP_Control )
- );
-
-}
-
-/*PAGE
- *
- * _Objects_MP_Open
- *
- */
-
-void _Objects_MP_Open (
- Objects_Information *information,
- Objects_MP_Control *the_global_object,
- unsigned32 the_name, /* XXX -- wrong for variable */
- Objects_Id the_id
-)
-{
- the_global_object->Object.id = the_id;
- the_global_object->name = the_name;
-
- _Chain_Prepend(
- &information->global_table[ _Objects_Get_node( the_id ) ],
- &the_global_object->Object.Node
- );
-
-}
-
-/*PAGE
- *
- * _Objects_MP_Allocate_and_open
- *
- */
-
-boolean _Objects_MP_Allocate_and_open (
- Objects_Information *information,
- unsigned32 the_name, /* XXX -- wrong for variable */
- Objects_Id the_id,
- boolean is_fatal_error
-)
-{
- Objects_MP_Control *the_global_object;
-
- the_global_object = _Objects_MP_Allocate_global_object();
- if ( _Objects_MP_Is_null_global_object( the_global_object ) ) {
-
- if ( is_fatal_error == FALSE )
- return FALSE;
-
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS
- );
-
- }
-
- _Objects_MP_Open( information, the_global_object, the_name, the_id );
-
- return TRUE;
-}
-
-/*PAGE
- *
- * _Objects_MP_Close
- *
- */
-
-void _Objects_MP_Close (
- Objects_Information *information,
- Objects_Id the_id
-)
-{
- Chain_Control *the_chain;
- Chain_Node *the_node;
- Objects_MP_Control *the_object;
-
- the_chain = &information->global_table[ _Objects_Get_node( the_id ) ];
-
- for ( the_node = the_chain->first ;
- !_Chain_Is_tail( the_chain, the_node ) ;
- the_node = the_node->next ) {
-
- the_object = (Objects_MP_Control *) the_node;
-
- if ( _Objects_Are_ids_equal( the_object->Object.id, the_id ) ) {
-
- _Chain_Extract( the_node );
- _Objects_MP_Free_global_object( the_object );
- return;
- }
-
- }
-
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_INVALID_GLOBAL_ID
- );
-}
-
-/*PAGE
- *
- * _Objects_MP_Global_name_search
- *
- */
-
-Objects_Name_to_id_errors _Objects_MP_Global_name_search (
- Objects_Information *information,
- Objects_Name the_name,
- unsigned32 nodes_to_search,
- Objects_Id *the_id
-)
-{
- unsigned32 low_node;
- unsigned32 high_node;
- unsigned32 node_index;
- Chain_Control *the_chain;
- Chain_Node *the_node;
- Objects_MP_Control *the_object;
- unsigned32 name_to_use = *(unsigned32 *)the_name; /* XXX variable */
-
- if ( nodes_to_search > _Objects_Maximum_nodes )
- return OBJECTS_INVALID_NODE;
-
- if ( information->global_table == NULL )
- return OBJECTS_INVALID_NAME;
-
- if ( nodes_to_search == OBJECTS_SEARCH_ALL_NODES ||
- nodes_to_search == OBJECTS_SEARCH_OTHER_NODES ) {
- low_node = 1;
- high_node = _Objects_Maximum_nodes;
- } else {
- low_node =
- high_node = nodes_to_search;
- }
-
- _Thread_Disable_dispatch();
-
- for ( node_index = low_node ; node_index <= high_node ; node_index++ ) {
-
- /*
- * NOTE: The local node was search (if necessary) by
- * _Objects_Name_to_id before this was invoked.
- */
-
- if ( !_Objects_Is_local_node( node_index ) ) {
- the_chain = &information->global_table[ node_index ];
-
- for ( the_node = the_chain->first ;
- !_Chain_Is_tail( the_chain, the_node ) ;
- the_node = the_node->next ) {
-
- the_object = (Objects_MP_Control *) the_node;
-
- if ( the_object->name == name_to_use ) {
- *the_id = the_object->Object.id;
- _Thread_Enable_dispatch();
- return OBJECTS_SUCCESSFUL;
- }
- }
- }
- }
-
- _Thread_Enable_dispatch();
- return OBJECTS_INVALID_NAME;
-}
-
-/*PAGE
- *
- * _Objects_MP_Is_remote
- *
- */
-
-void _Objects_MP_Is_remote (
- Objects_Information *information,
- Objects_Id the_id,
- Objects_Locations *location,
- Objects_Control **the_object
-)
-{
- unsigned32 node;
- Chain_Control *the_chain;
- Chain_Node *the_node;
- Objects_MP_Control *the_global_object;
-
- node = _Objects_Get_node( the_id );
-
- /*
- * NOTE: The local node was search (if necessary) by
- * _Objects_Name_to_id before this was invoked.
- *
- * The NODE field of an object id cannot be 0
- * because 0 is an invalid node number.
- */
-
- if ( node == 0 ||
- _Objects_Is_local_node( node ) ||
- node > _Objects_Maximum_nodes ||
- information->global_table == NULL ) {
-
- *location = OBJECTS_ERROR;
- *the_object = NULL;
- return;
- }
-
- _Thread_Disable_dispatch();
-
- the_chain = &information->global_table[ node ];
-
- for ( the_node = the_chain->first ;
- !_Chain_Is_tail( the_chain, the_node ) ;
- the_node = the_node->next ) {
-
- the_global_object = (Objects_MP_Control *) the_node;
-
- if ( _Objects_Are_ids_equal( the_global_object->Object.id, the_id ) ) {
- _Thread_Unnest_dispatch();
- *location = OBJECTS_REMOTE;
- *the_object = (Objects_Control *) the_global_object;
- return;
- }
- }
-
- _Thread_Enable_dispatch();
- *location = OBJECTS_ERROR;
- *the_object = NULL;
-
-}
diff --git a/c/src/exec/score/src/thread.c b/c/src/exec/score/src/thread.c
deleted file mode 100644
index 4e44ac6f75..0000000000
--- a/c/src/exec/score/src/thread.c
+++ /dev/null
@@ -1,1396 +0,0 @@
-/*
- * Thread Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <rtems/system.h>
-#include <rtems/score/apiext.h>
-#include <rtems/score/context.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/states.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/userext.h>
-#include <rtems/score/wkspace.h>
-
-/*PAGE
- *
- * _Thread_Handler_initialization
- *
- * This routine initializes all thread manager related data structures.
- *
- * Input parameters:
- * ticks_per_timeslice - clock ticks per quantum
- * maximum_proxies - number of proxies to initialize
- *
- * Output parameters: NONE
- */
-
-char *_Thread_Idle_name = "IDLE";
-
-void _Thread_Handler_initialization(
- unsigned32 ticks_per_timeslice,
- unsigned32 maximum_extensions,
- unsigned32 maximum_proxies
-)
-{
- unsigned32 index;
-
- /*
- * BOTH stacks hooks must be set or both must be NULL.
- * Do not allow mixture.
- */
-
- if ( !( ( _CPU_Table.stack_allocate_hook == 0 )
- == ( _CPU_Table.stack_free_hook == 0 ) ) )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_BAD_STACK_HOOK
- );
-
- _Context_Switch_necessary = FALSE;
- _Thread_Executing = NULL;
- _Thread_Heir = NULL;
- _Thread_Allocated_fp = NULL;
-
- _Thread_Do_post_task_switch_extension = 0;
-
- _Thread_Maximum_extensions = maximum_extensions;
-
- _Thread_Ticks_per_timeslice = ticks_per_timeslice;
-
- _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error(
- (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control)
- );
-
- for ( index=0; index <= PRIORITY_MAXIMUM ; index++ )
- _Chain_Initialize_empty( &_Thread_Ready_chain[ index ] );
-
- _Thread_MP_Handler_initialization( maximum_proxies );
-
- /*
- * Initialize this class of objects.
- */
-
- _Objects_Initialize_information(
- &_Thread_Internal_information,
- OBJECTS_INTERNAL_THREADS,
- FALSE,
- ( _System_state_Is_multiprocessing ) ? 2 : 1,
- sizeof( Thread_Control ),
- TRUE,
- 8,
- TRUE
- );
-
-}
-
-/*PAGE
- *
- * _Thread_Create_idle
- */
-
-void _Thread_Create_idle( void )
-{
- void *idle;
- unsigned32 idle_task_stack_size;
-
- /*
- * The entire workspace is zeroed during its initialization. Thus, all
- * fields not explicitly assigned were explicitly zeroed by
- * _Workspace_Initialization.
- */
-
- _Thread_Idle = _Thread_Internal_allocate();
-
- /*
- * Initialize the IDLE task.
- */
-
-#if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
- idle = (void *) _CPU_Thread_Idle_body;
-#else
- idle = (void *) _Thread_Idle_body;
-#endif
-
- if ( _CPU_Table.idle_task )
- idle = _CPU_Table.idle_task;
-
- idle_task_stack_size = _CPU_Table.idle_task_stack_size;
- if ( idle_task_stack_size < STACK_MINIMUM_SIZE )
- idle_task_stack_size = STACK_MINIMUM_SIZE;
-
- _Thread_Initialize(
- &_Thread_Internal_information,
- _Thread_Idle,
- NULL, /* allocate the stack */
- idle_task_stack_size,
- CPU_IDLE_TASK_IS_FP,
- PRIORITY_MAXIMUM,
- TRUE, /* preemptable */
- THREAD_CPU_BUDGET_ALGORITHM_NONE,
- NULL, /* no budget algorithm callout */
- 0, /* all interrupts enabled */
- _Thread_Idle_name
- );
-
- /*
- * WARNING!!! This is necessary to "kick" start the system and
- * MUST be done before _Thread_Start is invoked.
- */
-
- _Thread_Heir =
- _Thread_Executing = _Thread_Idle;
-
- _Thread_Start(
- _Thread_Idle,
- THREAD_START_NUMERIC,
- idle,
- NULL,
- 0
- );
-
-}
-
-/*PAGE
- *
- * _Thread_Start_multitasking
- *
- * This kernel routine readies the requested thread, the thread chain
- * is adjusted. A new heir thread may be selected.
- *
- * Input parameters:
- * system_thread - pointer to system initialization thread control block
- * idle_thread - pointer to idle thread control block
- *
- * Output parameters: NONE
- *
- * NOTE: This routine uses the "blocking" heir selection mechanism.
- * This insures the correct heir after a thread restart.
- *
- * INTERRUPT LATENCY:
- * ready chain
- * select heir
- */
-
-void _Thread_Start_multitasking( void )
-{
- /*
- * The system is now multitasking and completely initialized.
- * This system thread now either "goes away" in a single processor
- * system or "turns into" the server thread in an MP system.
- */
-
- _System_state_Set( SYSTEM_STATE_UP );
-
- _Context_Switch_necessary = FALSE;
-
- _Thread_Executing = _Thread_Heir;
-
- /*
- * Get the init task(s) running.
- *
- * Note: Thread_Dispatch() is normally used to dispatch threads. As
- * part of its work, Thread_Dispatch() restores floating point
- * state for the heir task.
- *
- * This code avoids Thread_Dispatch(), and so we have to restore
- * (actually initialize) the floating point state "by hand".
- *
- * Ignore the CPU_USE_DEFERRED_FP_SWITCH because we must always
- * switch in the first thread if it is FP.
- */
-
-
-#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
- /*
- * don't need to worry about saving BSP's floating point state
- */
-
- if ( _Thread_Heir->fp_context != NULL )
- _Context_Restore_fp( &_Thread_Heir->fp_context );
-#endif
-
- _Context_Switch( &_Thread_BSP_context, &_Thread_Heir->Registers );
-}
-
-/*PAGE
- *
- * _Thread_Dispatch
- *
- * This kernel routine determines if a dispatch is needed, and if so
- * dispatches to the heir thread. Once the heir is running an attempt
- * is made to dispatch any ASRs.
- *
- * ALTERNATE ENTRY POINTS:
- * void _Thread_Enable_dispatch();
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * dispatch thread
- * no dispatch thread
- */
-
-#if ( CPU_INLINE_ENABLE_DISPATCH == FALSE )
-void _Thread_Enable_dispatch( void )
-{
- if ( --_Thread_Dispatch_disable_level )
- return;
- _Thread_Dispatch();
-}
-#endif
-
-void _Thread_Dispatch( void )
-{
- Thread_Control *executing;
- Thread_Control *heir;
- ISR_Level level;
-
- executing = _Thread_Executing;
- _ISR_Disable( level );
- while ( _Context_Switch_necessary == TRUE ) {
- heir = _Thread_Heir;
- _Thread_Dispatch_disable_level = 1;
- _Context_Switch_necessary = FALSE;
- _Thread_Executing = heir;
- _ISR_Enable( level );
-
- heir->ticks_executed++;
-
- _User_extensions_Thread_switch( executing, heir );
-
- if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE )
- heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
-
- /*
- * If the CPU has hardware floating point, then we must address saving
- * and restoring it as part of the context switch.
- *
- * The second conditional compilation section selects the algorithm used
- * to context switch between floating point tasks. The deferred algorithm
- * can be significantly better in a system with few floating point tasks
- * because it reduces the total number of save and restore FP context
- * operations. However, this algorithm can not be used on all CPUs due
- * to unpredictable use of FP registers by some compilers for integer
- * operations.
- */
-
-#if ( CPU_HARDWARE_FP == TRUE )
-#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
- if ( (heir->fp_context != NULL) && !_Thread_Is_allocated_fp( heir ) ) {
- if ( _Thread_Allocated_fp != NULL )
- _Context_Save_fp( &_Thread_Allocated_fp->fp_context );
- _Context_Restore_fp( &heir->fp_context );
- _Thread_Allocated_fp = heir;
- }
-#else
- if ( executing->fp_context != NULL )
- _Context_Save_fp( &executing->fp_context );
-
- if ( heir->fp_context != NULL )
- _Context_Restore_fp( &heir->fp_context );
-#endif
-#endif
-
- _Context_Switch( &executing->Registers, &heir->Registers );
-
- executing = _Thread_Executing;
-
- _ISR_Disable( level );
- }
-
- _Thread_Dispatch_disable_level = 0;
-
- _ISR_Enable( level );
-
- if ( _Thread_Do_post_task_switch_extension ||
- executing->do_post_task_switch_extension ) {
- executing->do_post_task_switch_extension = FALSE;
- _API_extensions_Run_postswitch();
- }
-
-}
-
-/*PAGE
- *
- * _Thread_Stack_Allocate
- *
- * Allocate the requested stack space for the thread.
- * return the actual size allocated after any adjustment
- * or return zero if the allocation failed.
- * Set the Start.stack field to the address of the stack
- */
-
-static unsigned32 _Thread_Stack_Allocate(
- Thread_Control *the_thread,
- unsigned32 stack_size)
-{
- void *stack_addr = 0;
-
- if ( !_Stack_Is_enough( stack_size ) )
- stack_size = STACK_MINIMUM_SIZE;
-
- /*
- * Call ONLY the CPU table stack allocate hook, _or_ the
- * the RTEMS workspace allocate. This is so the stack free
- * routine can call the correct deallocation routine.
- */
-
- if ( _CPU_Table.stack_allocate_hook )
- {
- stack_addr = (*_CPU_Table.stack_allocate_hook)( stack_size );
- } else {
-
- /*
- * First pad the requested size so we allocate enough memory
- * so the context initialization can align it properly. The address
- * returned the workspace allocate must be directly stored in the
- * stack control block because it is later used in the free sequence.
- *
- * Thus it is the responsibility of the CPU dependent code to
- * get and keep the stack adjust factor, the stack alignment, and
- * the context initialization sequence in sync.
- */
-
- stack_size = _Stack_Adjust_size( stack_size );
- stack_addr = _Workspace_Allocate( stack_size );
- }
-
- if ( !stack_addr )
- stack_size = 0;
-
- the_thread->Start.stack = stack_addr;
-
- return stack_size;
-}
-
-/*
- * _Thread_Stack_Free
- *
- * Deallocate the Thread's stack.
- */
-
-static void _Thread_Stack_Free(
- Thread_Control *the_thread
-)
-{
- /*
- * If the API provided the stack space, then don't free it.
- */
-
- if ( !the_thread->Start.core_allocated_stack )
- return;
-
- /*
- * Call ONLY the CPU table stack free hook, or the
- * the RTEMS workspace free. This is so the free
- * routine properly matches the allocation of the stack.
- */
-
- if ( _CPU_Table.stack_free_hook )
- (*_CPU_Table.stack_free_hook)( the_thread->Start.Initial_stack.area );
- else
- _Workspace_Free( the_thread->Start.Initial_stack.area );
-}
-
-/*PAGE
- *
- * _Thread_Initialize
- *
- * XXX
- */
-
-boolean _Thread_Initialize(
- Objects_Information *information,
- Thread_Control *the_thread,
- void *stack_area,
- unsigned32 stack_size,
- boolean is_fp,
- Priority_Control priority,
- boolean is_preemptible,
- Thread_CPU_budget_algorithms budget_algorithm,
- Thread_CPU_budget_algorithm_callout budget_callout,
- unsigned32 isr_level,
- Objects_Name name
-)
-{
- unsigned32 actual_stack_size = 0;
- void *stack = NULL;
- void *fp_area;
- void *extensions_area;
-
- /*
- * Allocate and Initialize the stack for this thread.
- */
-
-
- if ( !stack_area ) {
- if ( !_Stack_Is_enough( stack_size ) )
- actual_stack_size = STACK_MINIMUM_SIZE;
- else
- actual_stack_size = stack_size;
-
- actual_stack_size = _Thread_Stack_Allocate( the_thread, actual_stack_size );
-
- if ( !actual_stack_size )
- return FALSE; /* stack allocation failed */
-
- stack = the_thread->Start.stack;
- the_thread->Start.core_allocated_stack = TRUE;
- } else {
- stack = stack_area;
- actual_stack_size = stack_size;
- the_thread->Start.core_allocated_stack = FALSE;
- }
-
- _Stack_Initialize(
- &the_thread->Start.Initial_stack,
- stack,
- actual_stack_size
- );
-
- /*
- * Allocate the floating point area for this thread
- */
-
- if ( is_fp ) {
-
- fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE );
- if ( !fp_area ) {
- _Thread_Stack_Free( the_thread );
- return FALSE;
- }
- fp_area = _Context_Fp_start( fp_area, 0 );
-
- } else
- fp_area = NULL;
-
- the_thread->fp_context = fp_area;
- the_thread->Start.fp_context = fp_area;
-
- /*
- * Allocate the extensions area for this thread
- */
-
- if ( _Thread_Maximum_extensions ) {
- extensions_area = _Workspace_Allocate(
- (_Thread_Maximum_extensions + 1) * sizeof( void * )
- );
-
- if ( !extensions_area ) {
- if ( fp_area )
- (void) _Workspace_Free( fp_area );
-
- _Thread_Stack_Free( the_thread );
-
- return FALSE;
- }
- } else
- extensions_area = NULL;
-
- the_thread->extensions = (void **) extensions_area;
-
- /*
- * General initialization
- */
-
- the_thread->Start.is_preemptible = is_preemptible;
- the_thread->Start.budget_algorithm = budget_algorithm;
- the_thread->Start.budget_callout = budget_callout;
- the_thread->Start.isr_level = isr_level;
-
- the_thread->current_state = STATES_DORMANT;
- the_thread->resource_count = 0;
- the_thread->real_priority = priority;
- the_thread->Start.initial_priority = priority;
- the_thread->ticks_executed = 0;
-
- _Thread_Set_priority( the_thread, priority );
-
- /*
- * Open the object
- */
-
- _Objects_Open( information, &the_thread->Object, name );
-
- /*
- * Invoke create extensions
- */
-
- if ( !_User_extensions_Thread_create( the_thread ) ) {
-
- if ( extensions_area )
- (void) _Workspace_Free( extensions_area );
-
- if ( fp_area )
- (void) _Workspace_Free( fp_area );
-
- _Thread_Stack_Free( the_thread );
-
- return FALSE;
- }
-
- return TRUE;
-
-}
-
-/*
- * _Thread_Start
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-boolean _Thread_Start(
- Thread_Control *the_thread,
- Thread_Start_types the_prototype,
- void *entry_point,
- void *pointer_argument,
- unsigned32 numeric_argument
-)
-{
- if ( _States_Is_dormant( the_thread->current_state ) ) {
-
- the_thread->Start.entry_point = (Thread_Entry) entry_point;
-
- the_thread->Start.prototype = the_prototype;
- the_thread->Start.pointer_argument = pointer_argument;
- the_thread->Start.numeric_argument = numeric_argument;
-
- _Thread_Load_environment( the_thread );
-
- _Thread_Ready( the_thread );
-
- _User_extensions_Thread_start( the_thread );
-
- return TRUE;
- }
-
- return FALSE;
-
-}
-
-/*
- * _Thread_Restart
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-boolean _Thread_Restart(
- Thread_Control *the_thread,
- void *pointer_argument,
- unsigned32 numeric_argument
-)
-{
- if ( !_States_Is_dormant( the_thread->current_state ) ) {
-
- _Thread_Set_transient( the_thread );
- the_thread->resource_count = 0;
- the_thread->is_preemptible = the_thread->Start.is_preemptible;
- the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
- the_thread->budget_callout = the_thread->Start.budget_callout;
-
- the_thread->Start.pointer_argument = pointer_argument;
- the_thread->Start.numeric_argument = numeric_argument;
-
- if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
-
- if ( _Watchdog_Is_active( &the_thread->Timer ) )
- (void) _Watchdog_Remove( &the_thread->Timer );
- }
-
- if ( the_thread->current_priority != the_thread->Start.initial_priority ) {
- the_thread->real_priority = the_thread->Start.initial_priority;
- _Thread_Set_priority( the_thread, the_thread->Start.initial_priority );
- }
-
- _Thread_Load_environment( the_thread );
-
- _Thread_Ready( the_thread );
-
- _User_extensions_Thread_restart( the_thread );
-
- if ( _Thread_Is_executing ( the_thread ) )
- _Thread_Restart_self();
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-/*
- * _Thread_Close
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _Thread_Close(
- Objects_Information *information,
- Thread_Control *the_thread
-)
-{
- _Objects_Close( information, &the_thread->Object );
-
- _Thread_Set_state( the_thread, STATES_TRANSIENT );
-
- if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
-
- if ( _Watchdog_Is_active( &the_thread->Timer ) )
- (void) _Watchdog_Remove( &the_thread->Timer );
- }
-
- _User_extensions_Thread_delete( the_thread );
-
-#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
- if ( _Thread_Is_allocated_fp( the_thread ) )
- _Thread_Deallocate_fp();
-#endif
- the_thread->fp_context = NULL;
-
- if ( the_thread->Start.fp_context )
- (void) _Workspace_Free( the_thread->Start.fp_context );
-
- _Thread_Stack_Free( the_thread );
-
- if ( the_thread->extensions )
- (void) _Workspace_Free( the_thread->extensions );
-
- the_thread->Start.stack = NULL;
- the_thread->extensions = NULL;
-}
-
-/*PAGE
- *
- * _Thread_Ready
- *
- * This kernel routine readies the requested thread, the thread chain
- * is adjusted. A new heir thread may be selected.
- *
- * Input parameters:
- * the_thread - pointer to thread control block
- *
- * Output parameters: NONE
- *
- * NOTE: This routine uses the "blocking" heir selection mechanism.
- * This insures the correct heir after a thread restart.
- *
- * INTERRUPT LATENCY:
- * ready chain
- * select heir
- */
-
-void _Thread_Ready(
- Thread_Control *the_thread
-)
-{
- ISR_Level level;
- Thread_Control *heir;
-
- _ISR_Disable( level );
-
- the_thread->current_state = STATES_READY;
-
- _Priority_Add_to_bit_map( &the_thread->Priority_map );
-
- _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
-
- _ISR_Flash( level );
-
- _Thread_Calculate_heir();
-
- heir = _Thread_Heir;
-
- if ( !_Thread_Is_executing( heir ) && _Thread_Executing->is_preemptible )
- _Context_Switch_necessary = TRUE;
-
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Thread_Clear_state
- *
- * This kernel routine clears the appropriate states in the
- * requested thread. The thread ready chain is adjusted if
- * necessary and the Heir thread is set accordingly.
- *
- * Input parameters:
- * the_thread - pointer to thread control block
- * state - state set to clear
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * priority map
- * select heir
- */
-
-
-void _Thread_Clear_state(
- Thread_Control *the_thread,
- States_Control state
-)
-{
- ISR_Level level;
- States_Control current_state;
-
- _ISR_Disable( level );
- current_state = the_thread->current_state;
-
- if ( current_state & state ) {
- current_state =
- the_thread->current_state = _States_Clear( state, current_state );
-
- if ( _States_Is_ready( current_state ) ) {
-
- _Priority_Add_to_bit_map( &the_thread->Priority_map );
-
- _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node);
-
- _ISR_Flash( level );
-
- if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
- _Thread_Heir = the_thread;
- if ( _Thread_Executing->is_preemptible ||
- the_thread->current_priority == 0 )
- _Context_Switch_necessary = TRUE;
- }
- }
- }
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Thread_Set_state
- *
- * This kernel routine sets the requested state in the THREAD. The
- * THREAD chain is adjusted if necessary.
- *
- * Input parameters:
- * the_thread - pointer to thread control block
- * state - state to be set
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * ready chain
- * select map
- */
-
-void _Thread_Set_state(
- Thread_Control *the_thread,
- States_Control state
-)
-{
- ISR_Level level;
- Chain_Control *ready;
-
- ready = the_thread->ready;
- _ISR_Disable( level );
- if ( !_States_Is_ready( the_thread->current_state ) ) {
- the_thread->current_state =
- _States_Set( state, the_thread->current_state );
- _ISR_Enable( level );
- return;
- }
-
- the_thread->current_state = state;
-
- if ( _Chain_Has_only_one_node( ready ) ) {
-
- _Chain_Initialize_empty( ready );
- _Priority_Remove_from_bit_map( &the_thread->Priority_map );
-
- } else
- _Chain_Extract_unprotected( &the_thread->Object.Node );
-
- _ISR_Flash( level );
-
- if ( _Thread_Is_heir( the_thread ) )
- _Thread_Calculate_heir();
-
- if ( _Thread_Is_executing( the_thread ) )
- _Context_Switch_necessary = TRUE;
-
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Thread_Set_transient
- *
- * This kernel routine places the requested thread in the transient state
- * which will remove it from the ready queue, if necessary. No
- * rescheduling is necessary because it is assumed that the transient
- * state will be cleared before dispatching is enabled.
- *
- * Input parameters:
- * the_thread - pointer to thread control block
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-void _Thread_Set_transient(
- Thread_Control *the_thread
-)
-{
- ISR_Level level;
- unsigned32 old_state;
- Chain_Control *ready;
-
- ready = the_thread->ready;
- _ISR_Disable( level );
-
- old_state = the_thread->current_state;
- the_thread->current_state = _States_Set( STATES_TRANSIENT, old_state );
-
- if ( _States_Is_ready( old_state ) ) {
- if ( _Chain_Has_only_one_node( ready ) ) {
-
- _Chain_Initialize_empty( ready );
- _Priority_Remove_from_bit_map( &the_thread->Priority_map );
-
- } else
- _Chain_Extract_unprotected( &the_thread->Object.Node );
- }
-
- _ISR_Enable( level );
-
-}
-
-/*PAGE
- *
- * _Thread_Reset_timeslice
- *
- * This routine will remove the running thread from the ready chain
- * and place it immediately at the rear of this chain and then the
- * timeslice counter is reset. The heir THREAD will be updated if
- * the running is also the currently the heir.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * ready chain
- * select heir
- */
-
-void _Thread_Reset_timeslice( void )
-{
- ISR_Level level;
- Thread_Control *executing;
- Chain_Control *ready;
-
- executing = _Thread_Executing;
- ready = executing->ready;
- _ISR_Disable( level );
- if ( _Chain_Has_only_one_node( ready ) ) {
- _ISR_Enable( level );
- return;
- }
- _Chain_Extract_unprotected( &executing->Object.Node );
- _Chain_Append_unprotected( ready, &executing->Object.Node );
-
- _ISR_Flash( level );
-
- if ( _Thread_Is_heir( executing ) )
- _Thread_Heir = (Thread_Control *) ready->first;
-
- _Context_Switch_necessary = TRUE;
-
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Thread_Tickle_timeslice
- *
- * This scheduler routine determines if timeslicing is enabled
- * for the currently executing thread and, if so, updates the
- * timeslice count and checks for timeslice expiration.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _Thread_Tickle_timeslice( void )
-{
- Thread_Control *executing;
-
- executing = _Thread_Executing;
-
- /*
- * Increment the number of ticks this thread has been executing
- */
-
- executing->ticks_executed++;
-
- /*
- * If the thread is not preemptible or is not ready, then
- * just return.
- */
-
- if ( !executing->is_preemptible )
- return;
-
- if ( !_States_Is_ready( executing->current_state ) )
- return;
-
- /*
- * The cpu budget algorithm determines what happens next.
- */
-
- switch ( executing->budget_algorithm ) {
- case THREAD_CPU_BUDGET_ALGORITHM_NONE:
- break;
-
- case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
- case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
- if ( --executing->cpu_time_budget == 0 ) {
- _Thread_Reset_timeslice();
- executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
- }
- break;
-
- case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
- if ( --executing->cpu_time_budget == 0 )
- (*executing->budget_callout)( executing );
- break;
- }
-}
-
-/*PAGE
- *
- * _Thread_Yield_processor
- *
- * This kernel routine will remove the running THREAD from the ready chain
- * and place it immediatly at the rear of this chain. Reset timeslice
- * and yield the processor functions both use this routine, therefore if
- * reset is TRUE and this is the only thread on the chain then the
- * timeslice counter is reset. The heir THREAD will be updated if the
- * running is also the currently the heir.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * ready chain
- * select heir
- */
-
-void _Thread_Yield_processor( void )
-{
- ISR_Level level;
- Thread_Control *executing;
- Chain_Control *ready;
-
- executing = _Thread_Executing;
- ready = executing->ready;
- _ISR_Disable( level );
- if ( !_Chain_Has_only_one_node( ready ) ) {
- _Chain_Extract_unprotected( &executing->Object.Node );
- _Chain_Append_unprotected( ready, &executing->Object.Node );
-
- _ISR_Flash( level );
-
- if ( _Thread_Is_heir( executing ) )
- _Thread_Heir = (Thread_Control *) ready->first;
- _Context_Switch_necessary = TRUE;
- }
- else if ( !_Thread_Is_heir( executing ) )
- _Context_Switch_necessary = TRUE;
-
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Thread_Load_environment
- *
- * Load starting environment for another thread from its start area in the
- * thread. Only called from t_restart and t_start.
- *
- * Input parameters:
- * the_thread - thread control block pointer
- *
- * Output parameters: NONE
- */
-
-void _Thread_Load_environment(
- Thread_Control *the_thread
-)
-{
- boolean is_fp = FALSE;
-
- if ( the_thread->Start.fp_context ) {
- the_thread->fp_context = the_thread->Start.fp_context;
- _Context_Initialize_fp( &the_thread->fp_context );
- is_fp = TRUE;
- }
-
- the_thread->do_post_task_switch_extension = FALSE;
- the_thread->is_preemptible = the_thread->Start.is_preemptible;
- the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
- the_thread->budget_callout = the_thread->Start.budget_callout;
-
- _Context_Initialize(
- &the_thread->Registers,
- the_thread->Start.Initial_stack.area,
- the_thread->Start.Initial_stack.size,
- the_thread->Start.isr_level,
- _Thread_Handler,
- is_fp
- );
-
-}
-
-/*PAGE
- *
- * _Thread_Handler
- *
- * This routine is the "primal" entry point for all threads.
- * _Context_Initialize() dummies up the thread's initial context
- * to cause the first Context_Switch() to jump to _Thread_Handler().
- *
- * This routine is the default thread exitted error handler. It is
- * returned to when a thread exits. The configured fatal error handler
- * is invoked to process the exit.
- *
- * NOTE:
- *
- * On entry, it is assumed all interrupts are blocked and that this
- * routine needs to set the initial isr level. This may or may not
- * actually be needed by the context switch routine and as a result
- * interrupts may already be at there proper level. Either way,
- * setting the initial isr level properly here is safe.
- *
- * Currently this is only really needed for the posix port,
- * ref: _Context_Switch in unix/cpu.c
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _Thread_Handler( void )
-{
- ISR_Level level;
- Thread_Control *executing;
-
- executing = _Thread_Executing;
-
- /*
- * have to put level into a register for those cpu's that use
- * inline asm here
- */
-
- level = executing->Start.isr_level;
- _ISR_Set_level(level);
-
- /*
- * Take care that 'begin' extensions get to complete before
- * 'switch' extensions can run. This means must keep dispatch
- * disabled until all 'begin' extensions complete.
- */
-
- _User_extensions_Thread_begin( executing );
-
- /*
- * At this point, the dispatch disable level BETTER be 1.
- */
-
- _Thread_Enable_dispatch();
-
- switch ( executing->Start.prototype ) {
- case THREAD_START_NUMERIC:
- (*(Thread_Entry_numeric) executing->Start.entry_point)(
- executing->Start.numeric_argument
- );
- break;
- case THREAD_START_POINTER:
- (*(Thread_Entry_pointer) executing->Start.entry_point)(
- executing->Start.pointer_argument
- );
- break;
- case THREAD_START_BOTH_POINTER_FIRST:
- (*(Thread_Entry_both_pointer_first) executing->Start.entry_point)(
- executing->Start.pointer_argument,
- executing->Start.numeric_argument
- );
- break;
- case THREAD_START_BOTH_NUMERIC_FIRST:
- (*(Thread_Entry_both_numeric_first) executing->Start.entry_point)(
- executing->Start.numeric_argument,
- executing->Start.pointer_argument
- );
- break;
- }
-
- _User_extensions_Thread_exitted( executing );
-
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_THREAD_EXITTED
- );
-}
-
-/*PAGE
- *
- * _Thread_Delay_ended
- *
- * This routine processes a thread whose delay period has ended.
- * It is called by the watchdog handler.
- *
- * Input parameters:
- * id - thread id
- *
- * Output parameters: NONE
- */
-
-void _Thread_Delay_ended(
- Objects_Id id,
- void *ignored
-)
-{
- Thread_Control *the_thread;
- Objects_Locations location;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* impossible */
- break;
- case OBJECTS_LOCAL:
- _Thread_Unblock( the_thread );
- _Thread_Unnest_dispatch();
- break;
- }
-}
-
-/*PAGE
- *
- * _Thread_Change_priority
- *
- * This kernel routine changes the priority of the thread. The
- * thread chain is adjusted if necessary.
- *
- * Input parameters:
- * the_thread - pointer to thread control block
- * new_priority - ultimate priority
- * prepend_it - TRUE if the thread should be prepended to the chain
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * ready chain
- * select heir
- */
-
-void _Thread_Change_priority(
- Thread_Control *the_thread,
- Priority_Control new_priority,
- boolean prepend_it
-)
-{
- ISR_Level level;
- /* boolean do_prepend = FALSE; */
-
- /*
- * If this is a case where prepending the task to its priority is
- * potentially desired, then we need to consider whether to do it.
- * This usually occurs when a task lowers its priority implcitly as
- * the result of losing inherited priority. Normal explicit priority
- * change calls (e.g. rtems_task_set_priority) should always do an
- * append not a prepend.
- */
-
- /*
- * Techically, the prepend should conditional on the thread lowering
- * its priority but that does allow cxd2004 of the acvc 2.0.1 to
- * pass with rtems 4.0.0. This should change when gnat redoes its
- * priority scheme.
- */
-/*
- if ( prepend_it &&
- _Thread_Is_executing( the_thread ) &&
- new_priority >= the_thread->current_priority )
- prepend_it = TRUE;
-*/
-
- _Thread_Set_transient( the_thread );
-
- if ( the_thread->current_priority != new_priority )
- _Thread_Set_priority( the_thread, new_priority );
-
- _ISR_Disable( level );
-
- the_thread->current_state =
- _States_Clear( STATES_TRANSIENT, the_thread->current_state );
-
- if ( ! _States_Is_ready( the_thread->current_state ) ) {
- _ISR_Enable( level );
- return;
- }
-
- _Priority_Add_to_bit_map( &the_thread->Priority_map );
- if ( prepend_it )
- _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node );
- else
- _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
-
- _ISR_Flash( level );
-
- _Thread_Calculate_heir();
-
- if ( !_Thread_Is_executing_also_the_heir() &&
- _Thread_Executing->is_preemptible )
- _Context_Switch_necessary = TRUE;
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Thread_Set_priority
- *
- * This directive enables and disables several modes of
- * execution for the requesting thread.
- *
- * Input parameters:
- * the_thread - pointer to thread priority
- * new_priority - new priority
- *
- * Output: NONE
- */
-
-void _Thread_Set_priority(
- Thread_Control *the_thread,
- Priority_Control new_priority
-)
-{
- the_thread->current_priority = new_priority;
- the_thread->ready = &_Thread_Ready_chain[ new_priority ];
-
- _Priority_Initialize_information( &the_thread->Priority_map, new_priority );
-}
-
-/*PAGE
- *
- * _Thread_Evaluate_mode
- *
- * XXX
- */
-
-boolean _Thread_Evaluate_mode( void )
-{
- Thread_Control *executing;
-
- executing = _Thread_Executing;
-
- if ( !_States_Is_ready( executing->current_state ) ||
- ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) {
- _Context_Switch_necessary = TRUE;
- return TRUE;
- }
-
- return FALSE;
-}
-
-/*PAGE
- *
- * _Thread_Get
- *
- * NOTE: If we are not using static inlines, this must be a real
- * subroutine call.
- *
- * NOTE: XXX... This routine may be able to be optimized.
- */
-
-#ifndef USE_INLINES
-
-Thread_Control *_Thread_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- Objects_Classes the_class;
- Objects_Information *information;
-
- if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
- _Thread_Disable_dispatch();
- *location = OBJECTS_LOCAL;
- return( _Thread_Executing );
- }
-
- the_class = _Objects_Get_class( id );
-
- if ( the_class > OBJECTS_CLASSES_LAST ) {
- *location = OBJECTS_ERROR;
- return (Thread_Control *) 0;
- }
-
- information = _Objects_Information_table[ the_class ];
-
- if ( !information || !information->is_thread ) {
- *location = OBJECTS_ERROR;
- return (Thread_Control *) 0;
- }
-
- return (Thread_Control *) _Objects_Get( information, id, location );
-}
-
-#endif
-
-/*PAGE
- *
- * _Thread_Idle_body
- *
- * This kernel routine is the idle thread. The idle thread runs any time
- * no other thread is ready to run. This thread loops forever with
- * interrupts enabled.
- *
- * Input parameters:
- * ignored - this parameter is ignored
- *
- * Output parameters: NONE
- */
-
-#if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)
-Thread _Thread_Idle_body(
- unsigned32 ignored
-)
-{
- for( ; ; ) ;
-}
-#endif
diff --git a/c/src/exec/score/src/threadmp.c b/c/src/exec/score/src/threadmp.c
deleted file mode 100644
index 7f22e626c0..0000000000
--- a/c/src/exec/score/src/threadmp.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Multiprocessing Support for the Thread Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/isr.h>
-
-/*PAGE
- *
- * _Thread_MP_Handler_initialization
- *
- */
-
-void _Thread_MP_Handler_initialization (
- unsigned32 maximum_proxies
-)
-{
-
- _Chain_Initialize_empty( &_Thread_MP_Active_proxies );
-
- if ( maximum_proxies == 0 ) {
- _Chain_Initialize_empty( &_Thread_MP_Inactive_proxies );
- return;
- }
-
-
- _Chain_Initialize(
- &_Thread_MP_Inactive_proxies,
- _Workspace_Allocate_or_fatal_error(
- maximum_proxies * sizeof( Thread_Proxy_control )
- ),
- maximum_proxies,
- sizeof( Thread_Proxy_control )
- );
-
-}
-
-/*PAGE
- *
- * _Thread_MP_Allocate_proxy
- *
- */
-
-Thread_Control *_Thread_MP_Allocate_proxy (
- States_Control the_state
-)
-{
- Thread_Control *the_thread;
- Thread_Proxy_control *the_proxy;
-
- the_thread = (Thread_Control *)_Chain_Get( &_Thread_MP_Inactive_proxies );
-
- if ( !_Thread_Is_null( the_thread ) ) {
-
- the_proxy = (Thread_Proxy_control *) the_thread;
-
- _Thread_Executing->Wait.return_code = THREAD_STATUS_PROXY_BLOCKING;
-
- the_proxy->receive_packet = _Thread_MP_Receive->receive_packet;
-
- the_proxy->Object.id = _Thread_MP_Receive->receive_packet->source_tid;
-
- the_proxy->current_priority =
- _Thread_MP_Receive->receive_packet->source_priority;
-
- the_proxy->current_state = _States_Set( STATES_DORMANT, the_state );
-
- the_proxy->Wait = _Thread_Executing->Wait;
-
- _Chain_Append( &_Thread_MP_Active_proxies, &the_proxy->Active );
-
- return the_thread;
- }
-
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_OUT_OF_PROXIES
- );
-
- /*
- * NOTE: The following return insures that the compiler will
- * think that all paths return a value.
- */
-
- return NULL;
-}
-
-/*PAGE
- *
- * _Thread_MP_Find_proxy
- *
- */
-
-/*
- * The following macro provides the offset of the Active element
- * in the Thread_Proxy_control structure. This is the logical
- * equivalent of the POSITION attribute in Ada.
- */
-
-#define _Thread_MP_Proxy_Active_offset \
- ((unsigned32)&(((Thread_Proxy_control *)0))->Active)
-
-Thread_Control *_Thread_MP_Find_proxy (
- Objects_Id the_id
-)
-{
-
- Chain_Node *proxy_node;
- Thread_Control *the_thread;
- ISR_Level level;
-
-restart:
-
- _ISR_Disable( level );
-
- for ( proxy_node = _Thread_MP_Active_proxies.first;
- !_Chain_Is_tail( &_Thread_MP_Active_proxies, proxy_node ) ;
- ) {
-
- the_thread = (Thread_Control *) _Addresses_Subtract_offset(
- proxy_node,
- _Thread_MP_Proxy_Active_offset
- );
-
- if ( _Objects_Are_ids_equal( the_thread->Object.id, the_id ) ) {
- _ISR_Enable( level );
- return the_thread;
- }
-
- _ISR_Flash( level );
-
- proxy_node = proxy_node->next;
-
- /*
- * A proxy which is only dormant is not in a blocking state.
- * Therefore, we are looking at proxy which has been moved from
- * active to inactive chain (by an ISR) and need to restart
- * the search.
- */
-
- if ( _States_Is_only_dormant( the_thread->current_state ) ) {
- _ISR_Enable( level );
- goto restart;
- }
- }
-
- _ISR_Enable( level );
- return NULL;
-}
diff --git a/c/src/exec/score/src/threadq.c b/c/src/exec/score/src/threadq.c
deleted file mode 100644
index 3cdca9701b..0000000000
--- a/c/src/exec/score/src/threadq.c
+++ /dev/null
@@ -1,967 +0,0 @@
-/*
- * Thread Queue Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/tqdata.h>
-
-/*PAGE
- *
- * _Thread_queue_Initialize
- *
- * This routine initializes the specified threadq.
- *
- * Input parameters:
- * the_thread_queue - pointer to a threadq header
- * the_class - class of the object to which this belongs
- * discipline - queueing discipline
- * state - state of waiting threads
- * proxy_extract_callout - MP specific callout
- * timeout_status - return on a timeout
- *
- * Output parameters: NONE
- */
-
-void _Thread_queue_Initialize(
- Thread_queue_Control *the_thread_queue,
- Objects_Classes the_class,
- Thread_queue_Disciplines the_discipline,
- States_Control state,
- Thread_queue_Extract_callout proxy_extract_callout,
- unsigned32 timeout_status
-)
-{
- unsigned32 index;
-
- _Thread_queue_Extract_table[ the_class ] = proxy_extract_callout;
-
- the_thread_queue->state = state;
- the_thread_queue->discipline = the_discipline;
- the_thread_queue->timeout_status = timeout_status;
- the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
-
- switch ( the_discipline ) {
- case THREAD_QUEUE_DISCIPLINE_FIFO:
- _Chain_Initialize_empty( &the_thread_queue->Queues.Fifo );
- break;
- case THREAD_QUEUE_DISCIPLINE_PRIORITY:
- for( index=0 ;
- index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
- index++)
- _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] );
- break;
- }
-
-}
-
-/*PAGE
- *
- * _Thread_queue_Enqueue
- *
- * This routine blocks a thread, places it on a thread, and optionally
- * starts a timeout timer.
- *
- * Input parameters:
- * the_thread_queue - pointer to threadq
- * timeout - interval to wait
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-void _Thread_queue_Enqueue(
- Thread_queue_Control *the_thread_queue,
- Watchdog_Interval timeout
-)
-{
- Thread_Control *the_thread;
-
- the_thread = _Thread_Executing;
-
- if ( _Thread_MP_Is_receive( the_thread ) && the_thread->receive_packet )
- the_thread = _Thread_MP_Allocate_proxy( the_thread_queue->state );
- else
- _Thread_Set_state( the_thread, the_thread_queue->state );
-
- if ( timeout ) {
- _Watchdog_Initialize(
- &the_thread->Timer,
- _Thread_queue_Timeout,
- the_thread->Object.id,
- NULL
- );
-
- _Watchdog_Insert_ticks( &the_thread->Timer, timeout );
- }
-
- switch( the_thread_queue->discipline ) {
- case THREAD_QUEUE_DISCIPLINE_FIFO:
- _Thread_queue_Enqueue_fifo( the_thread_queue, the_thread, timeout );
- break;
- case THREAD_QUEUE_DISCIPLINE_PRIORITY:
- _Thread_queue_Enqueue_priority( the_thread_queue, the_thread, timeout );
- break;
- }
-}
-
-/*PAGE
- *
- * _Thread_queue_Dequeue
- *
- * This routine removes a thread from the specified threadq. If the
- * threadq discipline is FIFO, it unblocks a thread, and cancels its
- * timeout timer. Priority discipline is processed elsewhere.
- *
- * Input parameters:
- * the_thread_queue - pointer to threadq
- *
- * Output parameters:
- * returns - thread dequeued or NULL
- *
- * INTERRUPT LATENCY:
- * check sync
- */
-
-Thread_Control *_Thread_queue_Dequeue(
- Thread_queue_Control *the_thread_queue
-)
-{
- Thread_Control *the_thread;
-
- switch ( the_thread_queue->discipline ) {
- case THREAD_QUEUE_DISCIPLINE_FIFO:
- the_thread = _Thread_queue_Dequeue_fifo( the_thread_queue );
- break;
- case THREAD_QUEUE_DISCIPLINE_PRIORITY:
- the_thread = _Thread_queue_Dequeue_priority( the_thread_queue );
- break;
- default: /* this is only to prevent warnings */
- the_thread = NULL;
- break;
- }
-
- return( the_thread );
-}
-
-/*PAGE
- *
- * _Thread_queue_Extract_with_proxy
- *
- * This routine extracts the_thread from the_thread_queue
- * and insures that if there is a proxy for this task on
- * another node, it is also dealt with.
- *
- * XXX
- */
-
-boolean _Thread_queue_Extract_with_proxy(
- Thread_Control *the_thread
-)
-{
- States_Control state;
- Objects_Classes the_class;
- Thread_queue_Extract_callout proxy_extract_callout;
-
- state = the_thread->current_state;
-
- if ( _States_Is_waiting_on_thread_queue( state ) ) {
- if ( _States_Is_waiting_for_rpc_reply( state ) &&
- _States_Is_locally_blocked( state ) ) {
-
- the_class = _Objects_Get_class( the_thread->Wait.id );
-
- proxy_extract_callout = _Thread_queue_Extract_table[ the_class ];
-
- if ( proxy_extract_callout )
- (*proxy_extract_callout)( the_thread );
- }
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
-
- return TRUE;
- }
- return FALSE;
-}
-
-/*PAGE
- *
- * _Thread_queue_Extract
- *
- * This routine removes a specific thread from the specified threadq,
- * deletes any timeout, and unblocks the thread.
- *
- * Input parameters:
- * the_thread_queue - pointer to a threadq header
- * the_thread - pointer to a thread control block
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY: NONE
- */
-
-void _Thread_queue_Extract(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-)
-{
- switch ( the_thread_queue->discipline ) {
- case THREAD_QUEUE_DISCIPLINE_FIFO:
- _Thread_queue_Extract_fifo( the_thread_queue, the_thread );
- break;
- case THREAD_QUEUE_DISCIPLINE_PRIORITY:
- _Thread_queue_Extract_priority( the_thread_queue, the_thread );
- break;
- }
-}
-
-/*PAGE
- *
- * _Thread_queue_Flush
- *
- * This kernel routine flushes the given thread queue.
- *
- * Input parameters:
- * the_thread_queue - pointer to threadq to be flushed
- * remote_extract_callout - pointer to routine which extracts a remote thread
- * status - status to return to the thread
- *
- * Output parameters: NONE
- */
-
-void _Thread_queue_Flush(
- Thread_queue_Control *the_thread_queue,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-)
-{
- Thread_Control *the_thread;
-
- while ( (the_thread = _Thread_queue_Dequeue( the_thread_queue )) ) {
- if ( _Objects_Is_local_id( the_thread->Object.id ) )
- the_thread->Wait.return_code = status;
- else
- ( *remote_extract_callout )( the_thread );
- }
-}
-
-/*PAGE
- *
- * _Thread_queue_First
- *
- * This routines returns a pointer to the first thread on the
- * specified threadq.
- *
- * Input parameters:
- * the_thread_queue - pointer to thread queue
- *
- * Output parameters:
- * returns - first thread or NULL
- */
-
-Thread_Control *_Thread_queue_First(
- Thread_queue_Control *the_thread_queue
-)
-{
- Thread_Control *the_thread;
-
- switch ( the_thread_queue->discipline ) {
- case THREAD_QUEUE_DISCIPLINE_FIFO:
- the_thread = _Thread_queue_First_fifo( the_thread_queue );
- break;
- case THREAD_QUEUE_DISCIPLINE_PRIORITY:
- the_thread = _Thread_queue_First_priority( the_thread_queue );
- break;
- default: /* this is only to prevent warnings */
- the_thread = NULL;
- break;
- }
-
- return the_thread;
-}
-
-/*PAGE
- *
- * _Thread_queue_Timeout
- *
- * This routine processes a thread which timeouts while waiting on
- * a thread queue. It is called by the watchdog handler.
- *
- * Input parameters:
- * id - thread id
- *
- * Output parameters: NONE
- */
-
-void _Thread_queue_Timeout(
- Objects_Id id,
- void *ignored
-)
-{
- Thread_Control *the_thread;
- Thread_queue_Control *the_thread_queue;
- Objects_Locations location;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* impossible */
- break;
- case OBJECTS_LOCAL:
- the_thread_queue = the_thread->Wait.queue;
-
- /*
- * If the_thread_queue is not synchronized, then it is either
- * "nothing happened", "timeout", or "satisfied". If the_thread
- * is the executing thread, then it is in the process of blocking
- * and it is the thread which is responsible for the synchronization
- * process.
- *
- * If it is not satisfied, then it is "nothing happened" and
- * this is the "timeout" transition. After a request is satisfied,
- * a timeout is not allowed to occur.
- */
-
- if ( the_thread_queue->sync_state != THREAD_QUEUE_SYNCHRONIZED &&
- _Thread_Is_executing( the_thread ) ) {
- if ( the_thread_queue->sync_state != THREAD_QUEUE_SATISFIED )
- the_thread_queue->sync_state = THREAD_QUEUE_TIMEOUT;
- } else {
- the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
- }
- _Thread_Unnest_dispatch();
- break;
- }
-}
-
-/*PAGE
- *
- * _Thread_queue_Enqueue_fifo
- *
- * This routine blocks a thread, places it on a thread, and optionally
- * starts a timeout timer.
- *
- * Input parameters:
- * the_thread_queue - pointer to threadq
- * the_thread - pointer to the thread to block
- * timeout - interval to wait
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-void _Thread_queue_Enqueue_fifo (
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread,
- Watchdog_Interval timeout
-)
-{
- ISR_Level level;
- Thread_queue_States sync_state;
-
- _ISR_Disable( level );
-
- sync_state = the_thread_queue->sync_state;
- the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
-
- switch ( sync_state ) {
- case THREAD_QUEUE_SYNCHRONIZED:
- /*
- * This should never happen. It indicates that someone did not
- * enter a thread queue critical section.
- */
- break;
-
- case THREAD_QUEUE_NOTHING_HAPPENED:
- _Chain_Append_unprotected(
- &the_thread_queue->Queues.Fifo,
- &the_thread->Object.Node
- );
- _ISR_Enable( level );
- return;
-
- case THREAD_QUEUE_TIMEOUT:
- the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
- _ISR_Enable( level );
- break;
-
- case THREAD_QUEUE_SATISFIED:
- if ( _Watchdog_Is_active( &the_thread->Timer ) ) {
- _Watchdog_Deactivate( &the_thread->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &the_thread->Timer );
- } else
- _ISR_Enable( level );
- break;
- }
-
- /*
- * Global objects with thread queue's should not be operated on from an
- * ISR. But the sync code still must allow short timeouts to be processed
- * correctly.
- */
-
- _Thread_Unblock( the_thread );
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- _Thread_MP_Free_proxy( the_thread );
-
-}
-
-/*PAGE
- *
- * _Thread_queue_Dequeue_fifo
- *
- * This routine removes a thread from the specified threadq.
- *
- * Input parameters:
- * the_thread_queue - pointer to threadq
- *
- * Output parameters:
- * returns - thread dequeued or NULL
- *
- * INTERRUPT LATENCY:
- * check sync
- * FIFO
- */
-
-Thread_Control *_Thread_queue_Dequeue_fifo(
- Thread_queue_Control *the_thread_queue
-)
-{
- ISR_Level level;
- Thread_Control *the_thread;
-
- _ISR_Disable( level );
- if ( !_Chain_Is_empty( &the_thread_queue->Queues.Fifo ) ) {
-
- the_thread = (Thread_Control *)
- _Chain_Get_first_unprotected( &the_thread_queue->Queues.Fifo );
-
- if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
- _ISR_Enable( level );
- _Thread_Unblock( the_thread );
- } else {
- _Watchdog_Deactivate( &the_thread->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &the_thread->Timer );
- _Thread_Unblock( the_thread );
- }
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- _Thread_MP_Free_proxy( the_thread );
-
- return the_thread;
- }
-
- switch ( the_thread_queue->sync_state ) {
- case THREAD_QUEUE_SYNCHRONIZED:
- case THREAD_QUEUE_SATISFIED:
- _ISR_Enable( level );
- return NULL;
-
- case THREAD_QUEUE_NOTHING_HAPPENED:
- case THREAD_QUEUE_TIMEOUT:
- the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
- _ISR_Enable( level );
- return _Thread_Executing;
- }
- return NULL; /* this is only to prevent warnings */
-}
-
-/*PAGE
- *
- * _Thread_queue_Extract_fifo
- *
- * This routine removes a specific thread from the specified threadq,
- * deletes any timeout, and unblocks the thread.
- *
- * Input parameters:
- * the_thread_queue - pointer to a threadq header
- * the_thread - pointer to the thread to block
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * EXTRACT_FIFO
- */
-
-void _Thread_queue_Extract_fifo(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
-
- if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
- _ISR_Enable( level );
- return;
- }
-
- _Chain_Extract_unprotected( &the_thread->Object.Node );
-
- if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
- _ISR_Enable( level );
- } else {
- _Watchdog_Deactivate( &the_thread->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &the_thread->Timer );
- }
-
- _Thread_Unblock( the_thread );
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- _Thread_MP_Free_proxy( the_thread );
-
-}
-
-/*PAGE
- *
- * _Thread_queue_First_fifo
- *
- * This routines returns a pointer to the first thread on the
- * specified threadq.
- *
- * Input parameters:
- * the_thread_queue - pointer to threadq
- *
- * Output parameters:
- * returns - first thread or NULL
- */
-
-Thread_Control *_Thread_queue_First_fifo(
- Thread_queue_Control *the_thread_queue
-)
-{
- if ( !_Chain_Is_empty( &the_thread_queue->Queues.Fifo ) )
- return (Thread_Control *) the_thread_queue->Queues.Fifo.first;
-
- return NULL;
-}
-
-/*PAGE
- *
- * _Thread_queue_Enqueue_priority
- *
- * This routine blocks a thread, places it on a thread, and optionally
- * starts a timeout timer.
- *
- * Input parameters:
- * the_thread_queue - pointer to threadq
- * thread - thread to insert
- * timeout - timeout interval in ticks
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * forward less than
- * forward equal
- */
-
-void _Thread_queue_Enqueue_priority(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread,
- Watchdog_Interval timeout
-)
-{
- Priority_Control search_priority;
- Thread_Control *search_thread;
- ISR_Level level;
- Chain_Control *header;
- unsigned32 header_index;
- Chain_Node *the_node;
- Chain_Node *next_node;
- Chain_Node *previous_node;
- Chain_Node *search_node;
- Priority_Control priority;
- States_Control block_state;
- Thread_queue_States sync_state;
-
- _Chain_Initialize_empty( &the_thread->Wait.Block2n );
-
- priority = the_thread->current_priority;
- header_index = _Thread_queue_Header_number( priority );
- header = &the_thread_queue->Queues.Priority[ header_index ];
- block_state = the_thread_queue->state;
-
- if ( _Thread_queue_Is_reverse_search( priority ) )
- goto restart_reverse_search;
-
-restart_forward_search:
- search_priority = PRIORITY_MINIMUM - 1;
- _ISR_Disable( level );
- search_thread = (Thread_Control *) header->first;
- while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
- search_priority = search_thread->current_priority;
- if ( priority <= search_priority )
- break;
-
-#if ( CPU_UNROLL_ENQUEUE_PRIORITY == TRUE )
- search_thread = (Thread_Control *) search_thread->Object.Node.next;
- if ( _Chain_Is_tail( header, (Chain_Node *)search_thread ) )
- break;
- search_priority = search_thread->current_priority;
- if ( priority <= search_priority )
- break;
-#endif
- _ISR_Flash( level );
- if ( !_States_Are_set( search_thread->current_state, block_state) ) {
- _ISR_Enable( level );
- goto restart_forward_search;
- }
- search_thread =
- (Thread_Control *)search_thread->Object.Node.next;
- }
-
- if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
- goto synchronize;
-
- the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
-
- if ( priority == search_priority )
- goto equal_priority;
-
- search_node = (Chain_Node *) search_thread;
- previous_node = search_node->previous;
- the_node = (Chain_Node *) the_thread;
-
- the_node->next = search_node;
- the_node->previous = previous_node;
- previous_node->next = the_node;
- search_node->previous = the_node;
- _ISR_Enable( level );
- return;
-
-restart_reverse_search:
- search_priority = PRIORITY_MAXIMUM + 1;
-
- _ISR_Disable( level );
- search_thread = (Thread_Control *) header->last;
- while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
- search_priority = search_thread->current_priority;
- if ( priority >= search_priority )
- break;
-#if ( CPU_UNROLL_ENQUEUE_PRIORITY == TRUE )
- search_thread = (Thread_Control *) search_thread->Object.Node.previous;
- if ( _Chain_Is_head( header, (Chain_Node *)search_thread ) )
- break;
- search_priority = search_thread->current_priority;
- if ( priority >= search_priority )
- break;
-#endif
- _ISR_Flash( level );
- if ( !_States_Are_set( search_thread->current_state, block_state) ) {
- _ISR_Enable( level );
- goto restart_reverse_search;
- }
- search_thread = (Thread_Control *)
- search_thread->Object.Node.previous;
- }
-
- if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
- goto synchronize;
-
- the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
-
- if ( priority == search_priority )
- goto equal_priority;
-
- search_node = (Chain_Node *) search_thread;
- next_node = search_node->next;
- the_node = (Chain_Node *) the_thread;
-
- the_node->next = next_node;
- the_node->previous = search_node;
- search_node->next = the_node;
- next_node->previous = the_node;
- _ISR_Enable( level );
- return;
-
-equal_priority: /* add at end of priority group */
- search_node = _Chain_Tail( &search_thread->Wait.Block2n );
- previous_node = search_node->previous;
- the_node = (Chain_Node *) the_thread;
-
- the_node->next = search_node;
- the_node->previous = previous_node;
- previous_node->next = the_node;
- search_node->previous = the_node;
- _ISR_Enable( level );
- return;
-
-synchronize:
-
- sync_state = the_thread_queue->sync_state;
- the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
-
- switch ( sync_state ) {
- case THREAD_QUEUE_SYNCHRONIZED:
- /*
- * This should never happen. It indicates that someone did not
- * enter a thread queue critical section.
- */
- break;
-
- case THREAD_QUEUE_NOTHING_HAPPENED:
- /*
- * This should never happen. All of this was dealt with above.
- */
- break;
-
- case THREAD_QUEUE_TIMEOUT:
- the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
- _ISR_Enable( level );
- break;
-
- case THREAD_QUEUE_SATISFIED:
- if ( _Watchdog_Is_active( &the_thread->Timer ) ) {
- _Watchdog_Deactivate( &the_thread->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &the_thread->Timer );
- } else
- _ISR_Enable( level );
- break;
- }
-
- /*
- * Global objects with thread queue's should not be operated on from an
- * ISR. But the sync code still must allow short timeouts to be processed
- * correctly.
- */
-
- _Thread_Unblock( the_thread );
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- _Thread_MP_Free_proxy( the_thread );
-}
-
-/*PAGE
- *
- * _Thread_queue_Dequeue_priority
- *
- * This routine removes a thread from the specified PRIORITY based
- * threadq, unblocks it, and cancels its timeout timer.
- *
- * Input parameters:
- * the_thread_queue - pointer to thread queue
- *
- * Output parameters:
- * returns - thread dequeued or NULL
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-Thread_Control *_Thread_queue_Dequeue_priority(
- Thread_queue_Control *the_thread_queue
-)
-{
- unsigned32 index;
- ISR_Level level;
- Thread_Control *the_thread = NULL; /* just to remove warnings */
- Thread_Control *new_first_thread;
- Chain_Node *new_first_node;
- Chain_Node *new_second_node;
- Chain_Node *last_node;
- Chain_Node *next_node;
- Chain_Node *previous_node;
-
- _ISR_Disable( level );
- for( index=0 ;
- index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
- index++ ) {
- if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) {
- the_thread = (Thread_Control *)
- the_thread_queue->Queues.Priority[ index ].first;
- goto dequeue;
- }
- }
-
- switch ( the_thread_queue->sync_state ) {
- case THREAD_QUEUE_SYNCHRONIZED:
- case THREAD_QUEUE_SATISFIED:
- _ISR_Enable( level );
- return NULL;
-
- case THREAD_QUEUE_NOTHING_HAPPENED:
- case THREAD_QUEUE_TIMEOUT:
- the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
- _ISR_Enable( level );
- return _Thread_Executing;
- }
-
-dequeue:
- new_first_node = the_thread->Wait.Block2n.first;
- new_first_thread = (Thread_Control *) new_first_node;
- next_node = the_thread->Object.Node.next;
- previous_node = the_thread->Object.Node.previous;
-
- if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
- last_node = the_thread->Wait.Block2n.last;
- new_second_node = new_first_node->next;
-
- previous_node->next = new_first_node;
- next_node->previous = new_first_node;
- new_first_node->next = next_node;
- new_first_node->previous = previous_node;
-
- if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
- /* > two threads on 2-n */
- new_second_node->previous =
- _Chain_Head( &new_first_thread->Wait.Block2n );
-
- new_first_thread->Wait.Block2n.first = new_second_node;
- new_first_thread->Wait.Block2n.last = last_node;
-
- last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n );
- }
- } else {
- previous_node->next = next_node;
- next_node->previous = previous_node;
- }
-
- if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
- _ISR_Enable( level );
- _Thread_Unblock( the_thread );
- } else {
- _Watchdog_Deactivate( &the_thread->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &the_thread->Timer );
- _Thread_Unblock( the_thread );
- }
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- _Thread_MP_Free_proxy( the_thread );
- return( the_thread );
-}
-
-/*PAGE
- *
- * _Thread_queue_Extract_priority
- *
- * This routine removes a specific thread from the specified threadq,
- * deletes any timeout, and unblocks the thread.
- *
- * Input parameters:
- * the_thread_queue - pointer to a threadq header
- * the_thread - pointer to a thread control block
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * EXTRACT_PRIORITY
- */
-
-void _Thread_queue_Extract_priority(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-)
-{
- ISR_Level level;
- Chain_Node *the_node;
- Chain_Node *next_node;
- Chain_Node *previous_node;
- Thread_Control *new_first_thread;
- Chain_Node *new_first_node;
- Chain_Node *new_second_node;
- Chain_Node *last_node;
-
- the_node = (Chain_Node *) the_thread;
- _ISR_Disable( level );
- if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
- next_node = the_node->next;
- previous_node = the_node->previous;
-
- if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
- new_first_node = the_thread->Wait.Block2n.first;
- new_first_thread = (Thread_Control *) new_first_node;
- last_node = the_thread->Wait.Block2n.last;
- new_second_node = new_first_node->next;
-
- previous_node->next = new_first_node;
- next_node->previous = new_first_node;
- new_first_node->next = next_node;
- new_first_node->previous = previous_node;
-
- if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
- /* > two threads on 2-n */
- new_second_node->previous =
- _Chain_Head( &new_first_thread->Wait.Block2n );
- new_first_thread->Wait.Block2n.first = new_second_node;
-
- new_first_thread->Wait.Block2n.last = last_node;
- last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n );
- }
- } else {
- previous_node->next = next_node;
- next_node->previous = previous_node;
- }
-
- if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
- _ISR_Enable( level );
- _Thread_Unblock( the_thread );
- } else {
- _Watchdog_Deactivate( &the_thread->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &the_thread->Timer );
- _Thread_Unblock( the_thread );
- }
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- _Thread_MP_Free_proxy( the_thread );
- }
- else
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Thread_queue_First_priority
- *
- * This routines returns a pointer to the first thread on the
- * specified threadq.
- *
- * Input parameters:
- * the_thread_queue - pointer to thread queue
- *
- * Output parameters:
- * returns - first thread or NULL
- */
-
-Thread_Control *_Thread_queue_First_priority (
- Thread_queue_Control *the_thread_queue
-)
-{
- unsigned32 index;
-
- for( index=0 ;
- index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
- index++ ) {
- if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) )
- return (Thread_Control *)
- the_thread_queue->Queues.Priority[ index ].first;
- }
- return NULL;
-}
diff --git a/c/src/exec/score/src/tod.c b/c/src/exec/score/src/tod.c
deleted file mode 100644
index 72742944b4..0000000000
--- a/c/src/exec/score/src/tod.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Time of Day (TOD) Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
-
-/*PAGE
- *
- * _TOD_Handler_initialization
- *
- * This routine initializes the time of day handler.
- *
- * Input parameters:
- * microseconds_per_tick - microseconds between clock ticks
- *
- * Output parameters: NONE
- */
-
-void _TOD_Handler_initialization(
- unsigned32 microseconds_per_tick
-)
-{
- _TOD_Microseconds_per_tick = microseconds_per_tick;
-
- _TOD_Seconds_since_epoch = 0;
-
- _TOD_Current.year = TOD_BASE_YEAR;
- _TOD_Current.month = 1;
- _TOD_Current.day = 1;
- _TOD_Current.hour = 0;
- _TOD_Current.minute = 0;
- _TOD_Current.second = 0;
- _TOD_Current.ticks = 0;
-
- if ( microseconds_per_tick == 0 )
- _TOD_Ticks_per_second = 0;
- else
- _TOD_Ticks_per_second =
- TOD_MICROSECONDS_PER_SECOND / microseconds_per_tick;
-
- _Watchdog_Initialize( &_TOD_Seconds_watchdog, _TOD_Tickle, 0, NULL );
-
- _TOD_Is_set = FALSE;
- _TOD_Activate( _TOD_Ticks_per_second );
-}
-
-/*PAGE
- *
- * _TOD_Set
- *
- * This rountine sets the current date and time with the specified
- * new date and time structure.
- *
- * Input parameters:
- * the_tod - pointer to the time and date structure
- * seconds_since_epoch - seconds since system epoch
- *
- * Output parameters: NONE
- */
-
-void _TOD_Set(
- TOD_Control *the_tod,
- Watchdog_Interval seconds_since_epoch
-)
-{
- Watchdog_Interval ticks_until_next_second;
-
- _Thread_Disable_dispatch();
- _TOD_Deactivate();
-
- if ( seconds_since_epoch < _TOD_Seconds_since_epoch )
- _Watchdog_Adjust_seconds( WATCHDOG_BACKWARD,
- _TOD_Seconds_since_epoch - seconds_since_epoch );
- else
- _Watchdog_Adjust_seconds( WATCHDOG_FORWARD,
- seconds_since_epoch - _TOD_Seconds_since_epoch );
-
- ticks_until_next_second = _TOD_Ticks_per_second;
- if ( ticks_until_next_second > _TOD_Current.ticks )
- ticks_until_next_second -= _TOD_Current.ticks;
-
- _TOD_Current = *the_tod;
- _TOD_Seconds_since_epoch = seconds_since_epoch;
- _TOD_Is_set = TRUE;
- _TOD_Activate( ticks_until_next_second );
-
- _Thread_Enable_dispatch();
-}
-
-/*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;
-}
-
-/*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 );
-}
-
-/*PAGE
- *
- * _TOD_Tickle
- *
- * This routine updates the calendar time and tickles the
- * per second watchdog timer chain.
- *
- * Input parameters:
- * ignored - this parameter is ignored
- *
- * Output parameters: NONE
- *
- * NOTE: This routine only works for leap-years through 2099.
- */
-
-void _TOD_Tickle(
- Objects_Id id,
- void *ignored
-)
-{
- unsigned32 leap;
-
- _TOD_Current.ticks = 0;
- ++_TOD_Seconds_since_epoch;
- if ( ++_TOD_Current.second >= TOD_SECONDS_PER_MINUTE ) {
- _TOD_Current.second = 0;
- if ( ++_TOD_Current.minute >= TOD_MINUTES_PER_HOUR ) {
- _TOD_Current.minute = 0;
- if ( ++_TOD_Current.hour >= TOD_HOURS_PER_DAY ) {
- _TOD_Current.hour = 0;
- if ( _TOD_Current.year & 0x3 ) leap = 0;
- else leap = 1;
- if ( ++_TOD_Current.day >
- _TOD_Days_per_month[ leap ][ _TOD_Current.month ]) {
- _TOD_Current.day = 1;
- if ( ++_TOD_Current.month > TOD_MONTHS_PER_YEAR ) {
- _TOD_Current.month = 1;
- _TOD_Current.year++;
- }
- }
- }
- }
- }
-
- _Watchdog_Tickle_seconds();
- _Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, _TOD_Ticks_per_second );
-}
diff --git a/c/src/exec/score/src/userext.c b/c/src/exec/score/src/userext.c
deleted file mode 100644
index a57c6e7ee8..0000000000
--- a/c/src/exec/score/src/userext.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * User Extension Handler
- *
- * NOTE: XXX
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/userext.h>
-
-/*PAGE
- *
- * _User_extensions_Thread_create
- */
-
-boolean _User_extensions_Thread_create (
- Thread_Control *the_thread
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
- boolean status;
-
- for ( the_node = _User_extensions_List.first ;
- !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_create != NULL ) {
- status = (*the_extension->Callouts.thread_create)(
- _Thread_Executing,
- the_thread
- );
- if ( !status )
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-/*PAGE
- *
- * _User_extensions_Thread_delete
- */
-
-void _User_extensions_Thread_delete (
- Thread_Control *the_thread
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.last ;
- !_Chain_Is_head( &_User_extensions_List, the_node ) ;
- the_node = the_node->previous ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_delete != NULL )
- (*the_extension->Callouts.thread_delete)(
- _Thread_Executing,
- the_thread
- );
- }
-}
-
-/*PAGE
- *
- * _User_extensions_Thread_start
- *
- */
-
-void _User_extensions_Thread_start (
- Thread_Control *the_thread
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.first ;
- !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_start != NULL )
- (*the_extension->Callouts.thread_start)(
- _Thread_Executing,
- the_thread
- );
- }
-}
-
-/*PAGE
- *
- * _User_extensions_Thread_restart
- *
- */
-
-void _User_extensions_Thread_restart (
- Thread_Control *the_thread
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.first ;
- !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_restart != NULL )
- (*the_extension->Callouts.thread_restart)(
- _Thread_Executing,
- the_thread
- );
- }
-}
-
-/*PAGE
- *
- * _User_extensions_Thread_begin
- *
- */
-
-void _User_extensions_Thread_begin (
- Thread_Control *executing
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.first ;
- !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_begin != NULL )
- (*the_extension->Callouts.thread_begin)( executing );
- }
-}
-
-/*PAGE
- *
- * _User_extensions_Thread_exitted
- */
-
-void _User_extensions_Thread_exitted (
- Thread_Control *executing
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.last ;
- !_Chain_Is_head( &_User_extensions_List, the_node ) ;
- the_node = the_node->previous ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_exitted != NULL )
- (*the_extension->Callouts.thread_exitted)( executing );
- }
-}
-
-/*PAGE
- *
- * _User_extensions_Fatal
- */
-
-void _User_extensions_Fatal (
- Internal_errors_Source the_source,
- boolean is_internal,
- unsigned32 the_error
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.last ;
- !_Chain_Is_head( &_User_extensions_List, the_node ) ;
- the_node = the_node->previous ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.fatal != NULL )
- (*the_extension->Callouts.fatal)( the_source, is_internal, the_error );
- }
-}
-
-
diff --git a/c/src/exec/score/src/watchdog.c b/c/src/exec/score/src/watchdog.c
deleted file mode 100644
index a3ddf85420..0000000000
--- a/c/src/exec/score/src/watchdog.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * Watchdog Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/watchdog.h>
-
-/*PAGE
- *
- * _Watchdog_Handler_initialization
- *
- * This routine initializes the watchdog handler.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _Watchdog_Handler_initialization( void )
-{
- _Watchdog_Sync_count = 0;
- _Watchdog_Sync_level = 0;
- _Watchdog_Ticks_since_boot = 0;
-
- _Chain_Initialize_empty( &_Watchdog_Ticks_chain );
- _Chain_Initialize_empty( &_Watchdog_Seconds_chain );
-}
-
-/*PAGE
- *
- * _Watchdog_Remove
- *
- * The routine removes a watchdog from a delta chain and updates
- * the delta counters of the remaining watchdogs.
- */
-
-Watchdog_States _Watchdog_Remove(
- Watchdog_Control *the_watchdog
-)
-{
- ISR_Level level;
- Watchdog_States previous_state;
- Watchdog_Control *next_watchdog;
-
- _ISR_Disable( level );
- previous_state = the_watchdog->state;
- switch ( previous_state ) {
- case WATCHDOG_INACTIVE:
- break;
-
- case WATCHDOG_BEING_INSERTED:
-
- /*
- * It is not actually on the chain so just change the state and
- * the Insert operation we interrupted will be aborted.
- */
- the_watchdog->state = WATCHDOG_INACTIVE;
- break;
-
- case WATCHDOG_ACTIVE:
- case WATCHDOG_REMOVE_IT:
-
- the_watchdog->state = WATCHDOG_INACTIVE;
- next_watchdog = _Watchdog_Next( the_watchdog );
-
- if ( _Watchdog_Next(next_watchdog) )
- next_watchdog->delta_interval += the_watchdog->delta_interval;
-
- if ( _Watchdog_Sync_count )
- _Watchdog_Sync_level = _ISR_Nest_level;
-
- _Chain_Extract_unprotected( &the_watchdog->Node );
- break;
- }
- the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
-
- _ISR_Enable( level );
- return( previous_state );
-}
-
-/*PAGE
- *
- * _Watchdog_Adjust
- *
- * This routine adjusts the delta chain backward or forward in response
- * to a time change.
- *
- * Input parameters:
- * header - pointer to the delta chain to be adjusted
- * direction - forward or backward adjustment to delta chain
- * units - units to adjust
- *
- * Output parameters:
- */
-
-void _Watchdog_Adjust(
- Chain_Control *header,
- Watchdog_Adjust_directions direction,
- Watchdog_Interval units
-)
-{
- if ( !_Chain_Is_empty( header ) ) {
- switch ( direction ) {
- case WATCHDOG_BACKWARD:
- _Watchdog_First( header )->delta_interval += units;
- break;
- case WATCHDOG_FORWARD:
- while ( units ) {
- if ( units < _Watchdog_First( header )->delta_interval ) {
- _Watchdog_First( header )->delta_interval -= units;
- break;
- } else {
- units -= _Watchdog_First( header )->delta_interval;
- _Watchdog_First( header )->delta_interval = 1;
- _Watchdog_Tickle( header );
- if ( _Chain_Is_empty( header ) )
- break;
- }
- }
- break;
- }
- }
-}
-
-/*PAGE
- *
- * _Watchdog_Insert
- *
- * This routine inserts a watchdog timer on to the appropriate delta
- * chain while updating the delta interval counters.
- */
-
-void _Watchdog_Insert(
- Chain_Control *header,
- Watchdog_Control *the_watchdog
-)
-{
- ISR_Level level;
- Watchdog_Control *after;
- unsigned32 insert_isr_nest_level;
- Watchdog_Interval delta_interval;
-
-
- insert_isr_nest_level = _ISR_Nest_level;
- the_watchdog->state = WATCHDOG_BEING_INSERTED;
-
- _Watchdog_Sync_count++;
-restart:
- delta_interval = the_watchdog->initial;
-
- _ISR_Disable( level );
-
- for ( after = _Watchdog_First( header ) ;
- ;
- after = _Watchdog_Next( after ) ) {
-
- if ( delta_interval == 0 || !_Watchdog_Next( after ) )
- break;
-
- if ( delta_interval < after->delta_interval ) {
- after->delta_interval -= delta_interval;
- break;
- }
-
- delta_interval -= after->delta_interval;
-
- /*
- * If you experience problems comment out the _ISR_Flash line.
- * 3.2.0 was the first release with this critical section redesigned.
- * Under certain circumstances, the PREVIOUS critical section algorithm
- * used around this flash point allowed interrupts to execute
- * which violated the design assumptions. The critical section
- * mechanism used here WAS redesigned to address this.
- */
-
- _ISR_Flash( level );
-
- if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) {
- goto exit_insert;
- }
-
- if ( _Watchdog_Sync_level > insert_isr_nest_level ) {
- _Watchdog_Sync_level = insert_isr_nest_level;
- _ISR_Enable( level );
- goto restart;
- }
- }
-
- _Watchdog_Activate( the_watchdog );
-
- the_watchdog->delta_interval = delta_interval;
-
- _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node );
-
- the_watchdog->start_time = _Watchdog_Ticks_since_boot;
-
-exit_insert:
- _Watchdog_Sync_level = insert_isr_nest_level;
- _Watchdog_Sync_count--;
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Watchdog_Tickle
- *
- * This routine decrements the delta counter in response to a tick. The
- * delta chain is updated accordingly.
- *
- * Input parameters:
- * header - pointer to the delta chain to be tickled
- *
- * Output parameters: NONE
- */
-
-void _Watchdog_Tickle(
- Chain_Control *header
-)
-{
- Watchdog_Control *the_watchdog;
-
- if ( _Chain_Is_empty( header ) )
- return;
-
- the_watchdog = _Watchdog_First( header );
- the_watchdog->delta_interval--;
- if ( the_watchdog->delta_interval != 0 )
- return;
-
- do {
- switch( _Watchdog_Remove( the_watchdog ) ) {
- case WATCHDOG_ACTIVE:
- (*the_watchdog->routine)(
- the_watchdog->id,
- the_watchdog->user_data
- );
- break;
-
- case WATCHDOG_INACTIVE:
- /*
- * This state indicates that the watchdog is not on any chain.
- * Thus, it is NOT on a chain being tickled. This case should
- * never occur.
- */
- break;
-
- case WATCHDOG_BEING_INSERTED:
- /*
- * This state indicates that the watchdog is in the process of
- * BEING inserted on the chain. Thus, it can NOT be on a chain
- * being tickled. This case should never occur.
- */
- break;
-
- case WATCHDOG_REMOVE_IT:
- break;
- }
- the_watchdog = _Watchdog_First( header );
- } while ( !_Chain_Is_empty( header ) &&
- (the_watchdog->delta_interval == 0) );
-}
diff --git a/c/src/exec/score/src/wkspace.c b/c/src/exec/score/src/wkspace.c
deleted file mode 100644
index 5e154f5efa..0000000000
--- a/c/src/exec/score/src/wkspace.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Workspace Handler
- *
- * XXX
- *
- * NOTE:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/interr.h>
-
-/*PAGE
- *
- * _Workspace_Handler_initialization
- */
-
-void _Workspace_Handler_initialization(
- void *starting_address,
- unsigned32 size
-)
-{
- unsigned32 *zero_out_array;
- unsigned32 index;
- unsigned32 memory_available;
-
- if ( !starting_address || !_Addresses_Is_aligned( starting_address ) )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS
- );
-
- if ( _CPU_Table.do_zero_of_workspace ) {
- for( zero_out_array = (unsigned32 *) starting_address, index = 0 ;
- index < size / sizeof( unsigned32 ) ;
- index++ )
- zero_out_array[ index ] = 0;
- }
-
- memory_available = _Heap_Initialize(
- &_Workspace_Area,
- starting_address,
- size,
- CPU_HEAP_ALIGNMENT
- );
-
- if ( memory_available == 0 )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_TOO_LITTLE_WORKSPACE
- );
-}
-
-/*PAGE
- *
- * _Workspace_Allocate_or_fatal_error
- *
- */
-
-void *_Workspace_Allocate_or_fatal_error(
- unsigned32 size
-)
-{
- void *memory;
-
- memory = _Workspace_Allocate( size );
-
- if ( memory == NULL )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_WORKSPACE_ALLOCATION
- );
-
- return memory;
-}
diff --git a/c/src/exec/score/tools/Makefile.in b/c/src/exec/score/tools/Makefile.in
deleted file mode 100644
index 6dba1f38f6..0000000000
--- a/c/src/exec/score/tools/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=generic $(wildcard $(RTEMS_CPU))
diff --git a/c/src/exec/score/tools/generic/Makefile.in b/c/src/exec/score/tools/generic/Makefile.in
deleted file mode 100644
index 33c2fb81dd..0000000000
--- a/c/src/exec/score/tools/generic/Makefile.in
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# $Id$
-#
-# RTEMS build tools
-# NOTE: of course we can't use any of these tools
-# in this Makefile. Most notably: install-if-change
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-include $(RTEMS_ROOT)/make/rtems.cfg
-
-DESTDIR=$(PROJECT_RELEASE)/bin
-
-BUILD_PGMS=size_rtems
-PGMS=$(BUILD_PGMS)
-
-CLEAN_ADDITIONS += $(BUILD_PGMS)
-
-INSTALLED_PGMS=$(PGMS:%=$(DESTDIR)/%)
-
-all: $(DESTDIR) $(PGMS) install
-
-$(DESTDIR):
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-$(INSTALLED_PGMS): $(PGMS)
- @INSTALL@ $(INSTBINFLAGS) $^ $@
-
-install: $(DESTDIR) $(INSTALLED_PGMS)
diff --git a/c/src/exec/score/tools/generic/size_rtems.in b/c/src/exec/score/tools/generic/size_rtems.in
deleted file mode 100644
index 72c96e842c..0000000000
--- a/c/src/exec/score/tools/generic/size_rtems.in
+++ /dev/null
@@ -1,276 +0,0 @@
-#!@KSH@ -p
-#
-# size_rtems
-#
-# This script gathers information related to the size of RTEMS
-# using the GNU "size" command.
-#
-# This script operates by summing up the sizes of the various
-# object files which constitute a particular configuration of
-# RTEMS. This size information is gathered for placement in the
-# brochure flyers and supplement manuals.
-#
-# NOTE: The concept of the minimum executive size is buried in this script.
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and distribution terms for this file may be
-# found in the file LICENSE in this distribution or at
-# http://www.OARcorp.com/rtems/license.html.
-#
-# $Id$
-#
-
-target=@target@
-program_prefix=@program_prefix@
-
-gnusize=${program_prefix}size
-
-# check usage
-if [ $# -ne 2 ] ; then
- echo usage ${0}: bsp object_directory
- exit 1
-fi
-
-bsp=$1
-board=$1
-ARCH=$2
-
-cpu=`echo $target | sed -e 's/-.*//'`
-
-case $target in
- sparc-sun-solaris*)
- rtems_cpu=unix
- bsp=solaris2
- echo Not supported on unix port.
- exit 0
- ;;
- i[3456]86-pc-linux-gnu)
- echo linux
- rtems_cpu=unix
- bsp=linux1
- echo Not supported on unix port.
- exit 0
- ;;
- i[3456]86-unknown-freebsd2.[12]*)
- echo freebsd
- rtems_cpu=unix
- bsp=freebsd2
- echo Not supported on unix port.
- exit 0
- ;;
- *-rtems*)
- cpu=`echo $target | sed -e 's/-.*//'`
- rtems_cpu=$cpu
- ;;
- *)
- echo unknown target $target
- exit 1
- ;;
-esac
-
-case $ARCH in
- *debug*) VARIANT=debug ;;
- *profile*) VARIANT=profile ;;
- *) VARIANT=optimized;;
-esac
-
-echo
-echo Size Information for the Following Configuration:
-echo CPU: ${cpu}
-echo BSP: ${board}
-echo VARIANT: ${VARIANT}
-echo
-
-
-#
-# KLUDGE to figure out at runtime how to echo a line without a
-# newline.
-#
-count=`echo "\\c" | wc -c`
-if [ ${count} -ne 0 ] ; then
- EARG="-n"
- EOL=""
-else
- EARG=""
- EOL="\\c"
-fi
-
-if [ ! -d ${board} ] ; then
- echo "${board} does not exist ... is the current directory the build directory?"
- exit 1
-fi
-
-#DIRLIST -- so greps for DIRLIST will find this file
-CPUOBJ=c/src/exec/score/cpu/${rtems_cpu}/${ARCH}
-COREOBJ=c/src/exec/score/src/${ARCH}
-RTEMSOBJ=c/src/exec/rtems/src/${ARCH}
-SAPIOBJ=c/src/exec/sapi/src/${ARCH}
-OPTOBJ=c/src/exec/rtems/optman/${ARCH}
-
-MANLIST=" \
-${RTEMSOBJ}/clock.o \
-${RTEMSOBJ}/dpmem.o \
-${RTEMSOBJ}/event.o \
-${RTEMSOBJ}/intr.o \
-${RTEMSOBJ}/msg.o \
-${RTEMSOBJ}/part.o \
-${RTEMSOBJ}/ratemon.o \
-${RTEMSOBJ}/region.o \
-${RTEMSOBJ}/sem.o \
-${RTEMSOBJ}/signal.o \
-${RTEMSOBJ}/tasks.o \
-${RTEMSOBJ}/timer.o \
-${SAPIOBJ}/debug.o \
-${SAPIOBJ}/extension.o \
-${SAPIOBJ}/fatal.o \
-${SAPIOBJ}/exinit.o \
-${SAPIOBJ}/io.o \
-${SAPIOBJ}/rtemsapi.o \
-"
-MPLIST="\
-${RTEMSOBJ}/mp.o ${RTEMSOBJ}/eventmp.o \
-${COREOBJ}/mpci.o ${RTEMSOBJ}/msgmp.o ${COREOBJ}/objectmp.o \
-${RTEMSOBJ}/partmp.o ${RTEMSOBJ}/regionmp.o ${RTEMSOBJ}/semmp.o \
-${RTEMSOBJ}/signalmp.o ${RTEMSOBJ}/taskmp.o ${COREOBJ}/threadmp.o \
-"
-
-OPTMANLIST="\
-${OPTOBJ}/no-dpmem.rel \
-${OPTOBJ}/no-event.rel \
-${OPTOBJ}/no-mp.rel \
-${OPTOBJ}/no-msg.rel \
-${OPTOBJ}/no-part.rel \
-${OPTOBJ}/no-region.rel \
-${OPTOBJ}/no-rtmon.rel \
-${OPTOBJ}/no-sem.rel \
-${OPTOBJ}/no-signal.rel \
-${OPTOBJ}/no-timer.rel \
-"
-REQMANLIST="\
-${SAPIOBJ}/exinit.o \
-${RTEMSOBJ}/tasks.o \
-${RTEMSOBJ}/intr.o \
-${SAPIOBJ}/fatal.o \
-"
-CORELIST=" \
-${COREOBJ}/apiext.o ${COREOBJ}/chain.o \
-${COREOBJ}/coremsg.o ${COREOBJ}/coremutex.o ${COREOBJ}/coresem.o \
-${COREOBJ}/heap.o ${COREOBJ}/interr.o \
-${COREOBJ}/isr.o \
-${COREOBJ}/object.o \
-${SAPIOBJ}/rtemsapi.o \
-${COREOBJ}/thread.o ${COREOBJ}/threadq.o ${COREOBJ}/tod.o \
-${COREOBJ}/userext.o \
-${COREOBJ}/watchdog.o ${COREOBJ}/wkspace.o \
-"
-
-CPULIST="\
-${CPUOBJ}/rtems-cpu.rel \
-"
-
-# check directories
-for i in ${EXECOBJ} ${CPUOBJ} ${OPTOBJ}
-do
- if [ ! -d ${i} ] ; then
- echo "${i} does not exist ... is RTEMS compiled and installed?"
- exit 1
- fi
-done
-
-for i in ${MANLIST} ${MPLIST} ${OPTMANLIST} ${REQMANLIST} ${CORELIST} ${CPULIST}
-do
- if [ ! -r ${i} ] ; then
- echo ${i} does not exist ... is RTEMS compiled and installed?
- exit 1
- fi
-done
-
-# "rips" a line of gsize's output and prints size, data, bss
-parse_size()
-{
- echo $1 $2 $3
-}
-
-# prepares a list of code, data, bss sizes for a directory
-sizedir()
-{
- ${gnusize} $* | sed -e '1,1d' |
- while read line
- do
- parse_size ${line}
- done
-}
-
-# adds the numbers passed on the command line
-addit()
-{
- sumx=0
- for x in $*
- do
- sumx=`expr $sumx + $x`
- done
- echo $sumx
-}
-
-# adds a column from the output of sizedir
-addsizes()
-{
- # dc version is not portable enough -- It can be left out during
- # installing linux and may not be available on non-UNIX hosts.
- #cut -d' ' -f${2} ${1} | sed -e '2,$s/$/ + /' -e '$,$s/$/ p/' | dc
-
- # This may not be as fast but it is probably more portable.
- addit `cut -d' ' -f${2} ${1}`
-}
-
-# calculates total size of a directory and prints report line
-size_files()
-{
- trap "rm -f /tmp/size.$$ ; exit 1" 2 3
-
- for file in $*
- do
- parse_size `${gnusize} $file | sed -e '/text/d'`
- done >/tmp/size.$$
-
- code=`cat /tmp/size.$$ | addsizes 1`
- data=`cat /tmp/size.$$ | addsizes 2`
- bss=` cat /tmp/size.$$ | addsizes 3`
- echo "${code} ${data} ${bss}"
- rm /tmp/size.$$
-}
-
-echo
-echo " RTEMS SIZE REPORT"
-echo
-echo " CODE DATA BSS"
-echo " =================="
-echo ${EARG} "MANAGERS: " ${EOL} ; size_files $MANLIST $MPLIST
-echo ${EARG} "CORE : " ${EOL} ; size_files $CORELIST $CPULIST
-echo ${EARG} "CPU : " ${EOL} ; size_files $CPULIST
-echo ${EARG} "OVERALL : " ${EOL} ; size_files $CPULIST $CORELIST $MANLIST \
- $MPLIST
-echo ${EARG} "MINIMUM : " ${EOL} ; size_files $CPULIST $CORELIST \
- $OPTMANLIST $REQMANLIST
-echo
-
-for file in $MANLIST
-do
- base=`basename ${file}`
- echo ${EARG} ""${base} : " ${EOL} " ; size_files ${file}
-done
-
-echo ${EARG} "MP : " ${EOL} ; size_files $MPLIST
-
-echo
-for file in $OPTMANLIST
-do
- base=`basename ${file}`
- echo ${EARG} "${base} : " ${EOL} ; size_files ${file}
-done
-
-echo
-exit 0
diff --git a/c/src/exec/score/tools/hppa1.1/Makefile.in b/c/src/exec/score/tools/hppa1.1/Makefile.in
deleted file mode 100644
index 0ef6de8843..0000000000
--- a/c/src/exec/score/tools/hppa1.1/Makefile.in
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# we use host compiler here for genoffsets. Hopefully it has same alignment!!
-USE_HOST_COMPILER=yes
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=genoffsets
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-PGMS=${ARCH}/genoffsets
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-# We use files that have not been installed yet.
-CPU_DIR=../../cpu/$(RTEMS_CPU)
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I$(PROJECT_INCLUDE) \
- -I$(CPU_DIR)
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here.
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) preinstall $(PGMS)
-
-# Hack
-# we are #including files that haven't been installed yet.
-# Make sure they are available.
-preinstall: ${ARCH} headers $(SRCS) $(PGMS)
- $(INSTALL) $(INSTBINFLAGS) ${PGMS} ${PROJECT_RELEASE}/bin
-
-headers: FORCE
- cd $(CPU_DIR); $(MAKE) install-headers
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
diff --git a/c/src/exec/score/tools/hppa1.1/genoffsets.c b/c/src/exec/score/tools/hppa1.1/genoffsets.c
deleted file mode 100644
index 9be7884f7b..0000000000
--- a/c/src/exec/score/tools/hppa1.1/genoffsets.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * genoffsets.c
- *
- * This file generates the offsets.h for the HP PA-RISC port of RTEMS.
- *
- * NOTE: It only prints the offset for structures actually used
- * by the assembly code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdio.h>
-
-#if defined(__hpux__) && defined(__hppa__)
-#include <rtems/system.h>
-#endif
-
-void print_information( void );
-
-int main(
- int argc,
- char **argv
-)
-{
-#if defined(__hpux__) && defined(__hppa__)
- unsigned int size = 0;
-#endif
-
- /*
- * Print the file header
- */
-
-printf(
- "/* offsets.h\n"
- " *\n"
- " * This include file contains the offsets of elements in the\n"
- " * C data structures used by the assembly language code for the\n"
- " * HP PA-RISC 1.1 port of RTEMS.\n"
- " *\n"
- " * NOTE: THIS FILE IS AUTOMATICALLY GENERATED!!!!\n"
- " * DO NOT EDIT THIS BY HAND!!!!\n"
- " *\n"
- " * COPYRIGHT (c) 1989-1998.\n"
- " * On-Line Applications Research Corporation (OAR).\n"
- " * Copyright assigned to U.S. Government, 1994.\n"
- " *\n"
- " * The license and distribution terms for this file may be\n"
- " * found in the file LICENSE in this distribution or at\n"
- " * http://www.OARcorp.com/rtems/license.html.\n"
- " */\n"
- "\n"
- "#ifndef __OFFSETS_h\n"
- "#define __OFFSETS_h\n"
- "\n"
-);
-
-#define PRINT_IT( STRING, TYPE, FIELD ) \
- printf( "#define\t%s\t0x%p\t\t/* %d */\n", \
- STRING, \
- &((TYPE)0)->FIELD, \
- (int) &((TYPE)0)->FIELD );
-
-#define PRINT_SIZE( STRING, item ) \
- printf( "#ifdef ASM\n#define\t%s\t%d\t\t/* 0x%x */\n#endif\n", \
- STRING, \
- sizeof(item), \
- sizeof(item) );
-
-#define PRINT_COMMENT( STRING ) \
- printf( \
- "\n" \
- "/*\n" \
- " * " STRING "\n" \
- " */\n" \
- "\n" \
- );
-
-#if defined(__hpux__) && defined(__hppa__)
-
-/*
- * Offsets of elements in the Context_control structure.
- */
-
- PRINT_COMMENT("Context_Control information");
-
- PRINT_IT( "FLAGS_OFFSET", Context_Control *, flags );
- PRINT_IT( "R1_OFFSET", Context_Control *, gr1 );
- PRINT_IT( "R2_OFFSET", Context_Control *, gr2 );
- PRINT_IT( "R3_OFFSET", Context_Control *, gr3 );
- PRINT_IT( "R4_OFFSET", Context_Control *, gr4 );
- PRINT_IT( "R5_OFFSET", Context_Control *, gr5 );
- PRINT_IT( "R6_OFFSET", Context_Control *, gr6 );
- PRINT_IT( "R7_OFFSET", Context_Control *, gr7 );
- PRINT_IT( "R8_OFFSET", Context_Control *, gr8 );
- PRINT_IT( "R9_OFFSET", Context_Control *, gr9 );
- PRINT_IT( "R10_OFFSET", Context_Control *, gr10 );
- PRINT_IT( "R11_OFFSET", Context_Control *, gr11 );
- PRINT_IT( "R12_OFFSET", Context_Control *, gr12 );
- PRINT_IT( "R13_OFFSET", Context_Control *, gr13 );
- PRINT_IT( "R14_OFFSET", Context_Control *, gr14 );
- PRINT_IT( "R15_OFFSET", Context_Control *, gr15 );
- PRINT_IT( "R16_OFFSET", Context_Control *, gr16 );
- PRINT_IT( "R17_OFFSET", Context_Control *, gr17 );
- PRINT_IT( "R18_OFFSET", Context_Control *, gr18 );
- PRINT_IT( "R19_OFFSET", Context_Control *, gr19 );
- PRINT_IT( "R20_OFFSET", Context_Control *, gr20 );
- PRINT_IT( "R21_OFFSET", Context_Control *, gr21 );
- PRINT_IT( "R22_OFFSET", Context_Control *, gr22 );
- PRINT_IT( "R23_OFFSET", Context_Control *, gr23 );
- PRINT_IT( "R24_OFFSET", Context_Control *, gr24 );
- PRINT_IT( "R25_OFFSET", Context_Control *, gr25 );
- PRINT_IT( "R26_OFFSET", Context_Control *, gr26 );
- PRINT_IT( "R27_OFFSET", Context_Control *, gr27 );
- PRINT_IT( "R28_OFFSET", Context_Control *, gr28 );
- PRINT_IT( "R29_OFFSET", Context_Control *, gr29 );
- PRINT_IT( "R30_OFFSET", Context_Control *, sp );
- PRINT_IT( "R31_OFFSET", Context_Control *, gr31 );
-
- /*
- * And common aliases for the above
- */
-
- PRINT_COMMENT("Common aliases for above");
-
- PRINT_IT( "RP_OFFSET", Context_Control *, gr2 );
- PRINT_IT( "ARG3_OFFSET", Context_Control *, gr23 );
- PRINT_IT( "ARG2_OFFSET", Context_Control *, gr24 );
- PRINT_IT( "ARG1_OFFSET", Context_Control *, gr25 );
- PRINT_IT( "ARG0_OFFSET", Context_Control *, gr26 );
- PRINT_IT( "SP_OFFSET", Context_Control *, sp );
- PRINT_IT( "DP_OFFSET", Context_Control *, gr27 );
- PRINT_IT( "RET0_OFFSET", Context_Control *, gr28 );
- PRINT_IT( "RET1_OFFSET", Context_Control *, gr29 );
-
- PRINT_SIZE("CPU_CONTEXT_SIZE", Context_Control);
-
- PRINT_COMMENT("Context_Control_fp information");
-
- PRINT_IT( "FR0_OFFSET", Context_Control_fp *, fr0 );
- PRINT_IT( "FR1_OFFSET", Context_Control_fp *, fr1 );
- PRINT_IT( "FR2_OFFSET", Context_Control_fp *, fr2 );
- PRINT_IT( "FR3_OFFSET", Context_Control_fp *, fr3 );
- PRINT_IT( "FR4_OFFSET", Context_Control_fp *, fr4 );
- PRINT_IT( "FR5_OFFSET", Context_Control_fp *, fr5 );
- PRINT_IT( "FR6_OFFSET", Context_Control_fp *, fr6 );
- PRINT_IT( "FR7_OFFSET", Context_Control_fp *, fr7 );
- PRINT_IT( "FR8_OFFSET", Context_Control_fp *, fr8 );
- PRINT_IT( "FR9_OFFSET", Context_Control_fp *, fr9 );
- PRINT_IT( "FR10_OFFSET", Context_Control_fp *, fr10 );
- PRINT_IT( "FR11_OFFSET", Context_Control_fp *, fr11 );
- PRINT_IT( "FR12_OFFSET", Context_Control_fp *, fr12 );
- PRINT_IT( "FR13_OFFSET", Context_Control_fp *, fr13 );
- PRINT_IT( "FR14_OFFSET", Context_Control_fp *, fr14 );
- PRINT_IT( "FR15_OFFSET", Context_Control_fp *, fr15 );
- PRINT_IT( "FR16_OFFSET", Context_Control_fp *, fr16 );
- PRINT_IT( "FR17_OFFSET", Context_Control_fp *, fr17 );
- PRINT_IT( "FR18_OFFSET", Context_Control_fp *, fr18 );
- PRINT_IT( "FR19_OFFSET", Context_Control_fp *, fr19 );
- PRINT_IT( "FR20_OFFSET", Context_Control_fp *, fr20 );
- PRINT_IT( "FR21_OFFSET", Context_Control_fp *, fr21 );
- PRINT_IT( "FR22_OFFSET", Context_Control_fp *, fr22 );
- PRINT_IT( "FR23_OFFSET", Context_Control_fp *, fr23 );
- PRINT_IT( "FR24_OFFSET", Context_Control_fp *, fr24 );
- PRINT_IT( "FR25_OFFSET", Context_Control_fp *, fr25 );
- PRINT_IT( "FR26_OFFSET", Context_Control_fp *, fr26 );
- PRINT_IT( "FR27_OFFSET", Context_Control_fp *, fr27 );
- PRINT_IT( "FR28_OFFSET", Context_Control_fp *, fr28 );
- PRINT_IT( "FR29_OFFSET", Context_Control_fp *, fr29 );
- PRINT_IT( "FR30_OFFSET", Context_Control_fp *, fr30 );
- PRINT_IT( "FR31_OFFSET", Context_Control_fp *, fr31 );
-
- PRINT_SIZE("CPU_CONTEXT_FP_SIZE", Context_Control_fp);
-
- /*
- * And the control registers
- */
-
- PRINT_COMMENT("Control register portion of context");
-
- PRINT_IT( "SAR_OFFSET", Context_Control *, sar );
- PRINT_IT( "IPSW_OFFSET", Context_Control *, ipsw );
- PRINT_IT( "IIR_OFFSET", Context_Control *, iir );
- PRINT_IT( "IOR_OFFSET", Context_Control *, ior );
- PRINT_IT( "ISR_OFFSET", Context_Control *, isr );
- PRINT_IT( "PCOQFRONT_OFFSET", Context_Control *, pcoqfront );
- PRINT_IT( "PCOQBACK_OFFSET", Context_Control *, pcoqback );
- PRINT_IT( "PCSQFRONT_OFFSET", Context_Control *, pcsqfront );
- PRINT_IT( "PCSQBACK_OFFSET", Context_Control *, pcsqback );
- PRINT_IT( "ITIMER_OFFSET", Context_Control *, itimer );
-
- /*
- * Full interrupt frame (integer + float)
- */
- PRINT_COMMENT("Interrupt frame information");
-
- PRINT_IT( "INTEGER_CONTEXT_OFFSET", CPU_Interrupt_frame *, Integer );
- PRINT_IT( "FP_CONTEXT_OFFSET", CPU_Interrupt_frame *, Floating_Point );
- size = sizeof( CPU_Interrupt_frame );
-
- if ( size % CPU_STACK_ALIGNMENT )
- size += CPU_STACK_ALIGNMENT - (size % CPU_STACK_ALIGNMENT);
-
- printf( "#define\tCPU_INTERRUPT_FRAME_SIZE\t%d\t\t/* 0x%x */\n", size, size );
-
-#else
-
- print_information();
-
-#endif
-
-#undef PRINT_IT
-#undef PRINT_SIZE
-#undef PRINT_COMMENT
-
- /*
- * Print the end of file stuff
- */
-
- printf(
- "\n"
- "#endif /* __OFFSETS_h */\n"
- "\n"
- "/* end of include file */\n"
- );
-
- return 0;
-}
-
-void print_information( void )
-{
-
-#define PRINT_IT( STRING, NUMBER ) \
- printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
- STRING, \
- NUMBER, \
- NUMBER );
-
-#define PRINT_SIZE( STRING, NUMBER ) \
- printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
- STRING, \
- NUMBER, \
- NUMBER );
-
-#define PRINT_COMMENT( STRING ) \
- printf( \
- "\n" \
- "/*\n" \
- " * " STRING "\n" \
- " */\n" \
- "\n" \
- );
-
-/*
- * Offsets of elements in the Context_control structure.
- */
-
- PRINT_COMMENT("Context_Control information");
-
- PRINT_IT( "FLAGS_OFFSET", 0x00 );
- PRINT_IT( "R1_OFFSET", 0x04 );
- PRINT_IT( "R2_OFFSET", 0x08 );
- PRINT_IT( "R3_OFFSET", 0x0c );
- PRINT_IT( "R4_OFFSET", 0x00 );
- PRINT_IT( "R5_OFFSET", 0x14 );
- PRINT_IT( "R6_OFFSET", 0x18 );
- PRINT_IT( "R7_OFFSET", 0x1c );
- PRINT_IT( "R8_OFFSET", 0x20 );
- PRINT_IT( "R9_OFFSET", 0x24 );
- PRINT_IT( "R10_OFFSET", 0x28 );
- PRINT_IT( "R11_OFFSET", 0x2c );
- PRINT_IT( "R12_OFFSET", 0x30 );
- PRINT_IT( "R13_OFFSET", 0x34 );
- PRINT_IT( "R14_OFFSET", 0x38 );
- PRINT_IT( "R15_OFFSET", 0x3c );
- PRINT_IT( "R16_OFFSET", 0x40 );
- PRINT_IT( "R17_OFFSET", 0x44 );
- PRINT_IT( "R18_OFFSET", 0x48 );
- PRINT_IT( "R19_OFFSET", 0x4c );
- PRINT_IT( "R20_OFFSET", 0x50 );
- PRINT_IT( "R21_OFFSET", 0x54 );
- PRINT_IT( "R22_OFFSET", 0x58 );
- PRINT_IT( "R23_OFFSET", 0x5c );
- PRINT_IT( "R24_OFFSET", 0x60 );
- PRINT_IT( "R25_OFFSET", 0x64 );
- PRINT_IT( "R26_OFFSET", 0x68 );
- PRINT_IT( "R27_OFFSET", 0x6c );
- PRINT_IT( "R28_OFFSET", 0x70 );
- PRINT_IT( "R29_OFFSET", 0x74 );
- PRINT_IT( "R30_OFFSET", 0x78 );
- PRINT_IT( "R31_OFFSET", 0x7c );
-
- /*
- * And common aliases for the above
- */
-
- PRINT_COMMENT("Common aliases for above");
-
- PRINT_IT( "RP_OFFSET", 0x08 );
- PRINT_IT( "ARG3_OFFSET", 0x5c );
- PRINT_IT( "ARG2_OFFSET", 0x60 );
- PRINT_IT( "ARG1_OFFSET", 0x64 );
- PRINT_IT( "ARG0_OFFSET", 0x68 );
- PRINT_IT( "SP_OFFSET", 0x78 );
- PRINT_IT( "DP_OFFSET", 0x6c );
- PRINT_IT( "RET0_OFFSET", 0x74 );
- PRINT_IT( "RET1_OFFSET", 0x74 );
-
- PRINT_SIZE("CPU_CONTEXT_SIZE", 168 );
-
- PRINT_COMMENT("Context_Control_fp information");
-
- PRINT_SIZE("CPU_CONTEXT_FP_SIZE", 256);
-
- /*
- * And the control registers
- */
-
- PRINT_COMMENT("Control register portion of context");
-
- PRINT_IT( "SAR_OFFSET", 0x80 );
- PRINT_IT( "IPSW_OFFSET", 0x84 );
- PRINT_IT( "IIR_OFFSET", 0x88 );
- PRINT_IT( "IOR_OFFSET", 0x8c );
- PRINT_IT( "ISR_OFFSET", 0x90 );
- PRINT_IT( "PCOQFRONT_OFFSET", 0x94 );
- PRINT_IT( "PCOQBACK_OFFSET", 0x98 );
- PRINT_IT( "PCSQFRONT_OFFSET", 0x9c );
- PRINT_IT( "PCSQBACK_OFFSET", 0xa0 );
- PRINT_IT( "ITIMER_OFFSET", 0xa4 );
-
- /*
- * Full interrupt frame (integer + float)
- */
-
- PRINT_COMMENT("Interrupt frame information");
-
- PRINT_IT( "INTEGER_CONTEXT_OFFSET", 0x00 );
- PRINT_IT( "FP_CONTEXT_OFFSET", 0xa8 );
- PRINT_SIZE( "CPU_INTERRUPT_FRAME_SIZE", 448 );
-
-}
diff --git a/c/src/exec/score/tools/sh/AUTHORS b/c/src/exec/score/tools/sh/AUTHORS
deleted file mode 100644
index 225c2fa974..0000000000
--- a/c/src/exec/score/tools/sh/AUTHORS
+++ /dev/null
@@ -1,3 +0,0 @@
-Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- * Initial implementation
- * generator for sci bitrate table
diff --git a/c/src/exec/score/tools/sh/COPYING b/c/src/exec/score/tools/sh/COPYING
deleted file mode 100644
index 805cdd8ffc..0000000000
--- a/c/src/exec/score/tools/sh/COPYING
+++ /dev/null
@@ -1,19 +0,0 @@
-
- shgen - code generator for the Hitachi SH microcontroller family
-
- Copyright (C) 1998 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
diff --git a/c/src/exec/score/tools/sh/Makefile.in b/c/src/exec/score/tools/sh/Makefile.in
deleted file mode 100644
index cbda87fbd8..0000000000
--- a/c/src/exec/score/tools/sh/Makefile.in
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# $Id$
-#
-# FIXME: $ARCH shouldn't be used inside of host-tools.
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# we use the host compiler here
-USE_HOST_COMPILER=yes
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=shgen sci
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=sci.h
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-PGMS=${ARCH}/shgen@EXEEXT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -Wall
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS += -lm
-LDFLAGS +=
-
-#
-# Add your list of files to delete here.
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-DESTDIR=${PROJECT_RELEASE}/bin
-
-all: $(ARCH) $(PGMS)
-
-${PGMS}: $(OBJS) $(LINK_FILES)
- $(make-exe)
-
-$(DESTDIR):
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-# Install the program
-install: $(DESTDIR) $(PGMS)
- @INSTALL@ $(INSTBINFLAGS) ${PGMS} $(DESTDIR)
diff --git a/c/src/exec/score/tools/sh/TODO b/c/src/exec/score/tools/sh/TODO
deleted file mode 100644
index bcdd1bf6df..0000000000
--- a/c/src/exec/score/tools/sh/TODO
+++ /dev/null
@@ -1,13 +0,0 @@
-* Add support for more drivers to shgen !!!!
-
-* shgen relies on having a gnu-compatible getopt, which should be
- available on all hosts using gcc/egcs/binutils.
- Using other getopt-variants may produce faulty results or shgen may also
- refuse to compile. Probably the easiest solution to this problem would be
- to integrate libiberty into rtems.
-
-* shgen uses floating point mathematics. Therefore Makefile.in contains a
- reference to libm. In case the host doesn't have its floating point
- support in libm, shgen will fail to compile. If we should ever meet such
- a host, checks for floating point libraries have to be added to rtems'
- autoconf support.
diff --git a/c/src/exec/score/tools/sh/sci.c b/c/src/exec/score/tools/sh/sci.c
deleted file mode 100644
index 3310e7e791..0000000000
--- a/c/src/exec/score/tools/sh/sci.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 1998 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * See the file COPYING for copyright notice.
- */
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "sci.h"
-
-/*
- n .. baudrate generator source 0,1,2,3
-
- N .. BRR setting (0..255)
-
- Phi .. processor baud rate
-
- B .. bitrate
- */
-
-typedef struct sci_tab {
- unsigned int B ;
- unsigned int n ;
- int N ;
- double err ;
- } sci_tab_t ;
-
-static unsigned int bitrate [] = {
- 50,
- 75,
- 110,
- 134,
- 150,
- 200,
- 300,
- 600,
- 1200,
- 1800,
- 2400,
- 4800,
- 9600,
- 19200,
- 38400,
- 57600,
- 115200,
- 230400,
- 460800
-};
-
-static sci_tab_t test_array[4] ;
-
-static void Compute(
- unsigned int n,
- unsigned int B,
- double Phi,
- struct sci_tab *entry )
-{
- int a = ( 32 << ( 2 * n ) ) * B ;
-
- entry->n = n ;
- entry->B = B ;
- entry->N = rint( ( Phi / a ) - 1.0 ) ;
-
- if ( ( entry->N > 0 ) && ( entry->N < 256 ) )
- entry->err =
- ( ( Phi / ( (entry->N + 1) * a ) - 1.0 ) * 100.0 );
- else
- entry->err = 100.0 ;
-}
-
-static sci_tab_t *SelectN(
- unsigned int B,
- double Phi )
-{
- unsigned int i ;
- struct sci_tab* best = NULL ;
-
- for ( i = 0 ; i < 4 ; i++ )
- {
- double err ;
-
- Compute( i, B, Phi, &test_array[i] );
- err = fabs( test_array[i].err );
-
- if ( best )
- {
- if ( err < fabs( best->err ) )
- best = &test_array[i] ;
- }
- else
- best = &test_array[i] ;
- }
-
- return best ;
-}
-
-int shgen_gensci(
- FILE *file,
- double Phi ) /* Processor frequency [Hz] */
-{
- unsigned int i ;
-
- fprintf( file,
- "/*\n * Bitrate table for the serial devices (sci) of the SH at %.3f MHz\n"
- " */\n\n", Phi / 1000000.0 );
- fprintf( file,
- "/*\n"
- " * n .. SMR bits 0,1 : baud rate generator clock source\n"
- " * N .. BRR bits 0..7: setting for baud rate generator\n"
- " * error .. percentual error to nominal bitrate\n"
- " * Hitachi's HW manual recommends bitrates with an error less than 1%%\n"
- " * We experienced values less than 2%% to be stable\n"
- " */\n\n" );
- fprintf( file, "#include <termios.h>\n\n" );
- fprintf( file,
- "static struct sci_bitrate_t {\n"
- " unsigned char n ;\n"
- " unsigned char N ;\n"
- "} _sci_bitrates[] = {\n"
- "/* n N error */\n" );
-
- for ( i = 0 ; i < sizeof(bitrate)/sizeof(int) ; i++ )
- {
- struct sci_tab* best = SelectN( bitrate[i], Phi );
-
- if ( i > 0 )
- fprintf( file, ",\n" );
- fprintf( file, " { %1d, %3d } /* %+7.2f%% ; B%d */",
- best->n,
- best->N,
- best->err,
- best->B );
- }
-
- fprintf( file, "\n};\n\n" );
-
- fprintf( file,
- "int _sci_get_brparms( \n"
- " tcflag_t cflag,\n"
- " unsigned char *smr,\n"
- " unsigned char *brr )\n"
- "{\n"
- " unsigned int offset ;\n\n"
- " offset = ( cflag & ( CBAUD & ~CBAUDEX ) )\n"
- " + ( ( cflag & CBAUDEX ) ? B38400 : 0 );\n"
- " if ( offset == 0 ) return -1 ;\n"
- " offset-- ;\n\n"
- " *smr &= ~0x03;\n"
- " *smr |= _sci_bitrates[offset].n;\n"
- " *brr = _sci_bitrates[offset].N;\n\n"
- " return 0;\n"
- "}\n" );
-
- return 0 ;
-}
diff --git a/c/src/exec/score/tools/sh/sci.h b/c/src/exec/score/tools/sh/sci.h
deleted file mode 100644
index b55bbfb670..0000000000
--- a/c/src/exec/score/tools/sh/sci.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _shgen_sci_h
-#define _shgen_sci_h
-
-#include <stdio.h>
-
-extern int shgen_gensci(
- FILE *file,
- double Phi /* Processor frequency [Hz] */
- );
-
-#endif
diff --git a/c/src/exec/score/tools/sh/shgen.c b/c/src/exec/score/tools/sh/shgen.c
deleted file mode 100644
index 15c179a855..0000000000
--- a/c/src/exec/score/tools/sh/shgen.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 1998 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * See the file COPYING for copyright notice.
- */
-
-#include <stdio.h>
-#include <string.h> /* strcmp, strerror */
-#include <errno.h>
-#include <getopt.h>
-
-#include "sci.h"
-
-static void usage( char *prog )
-{
- fprintf( stderr, "usage: %s [options] driver\n", prog );
- fprintf( stderr, "options:\n" );
- fprintf( stderr, "\t-M Phi .. processor frequency [MHz] default: 20\n" );
- fprintf( stderr, "driver:\n" );
- fprintf( stderr, "\tsci .. bitrate table for sci\n" );
- exit ( 1 );
-}
-
-static void shgen_header( FILE *file )
-{
- fprintf( file,
- "/*\n * DO NOT EDIT - this file is automatically generated by shgen 0.2\n" );
- fprintf( file,
- " * Copyright (c) 1998, Ralf Corsepius (corsepiu@faw.uni-ulm.de)\n */\n" );
- fprintf( file,
- "\n/* This file is not copyrighted */\n\n" );
-}
-
-int main( int argc, char *argv[] )
-{
- double Phi = 20.0 ;
-
- while ( ( optopt = getopt( argc, argv, "M:" ) ) > 0 )
- {
- switch ( optopt )
- {
- case 'M' :
- sscanf( optarg, "%lf", &Phi );
- Phi = Phi * 1000000.0;
- break ;
- default :
- usage( argv[0] );
- break ;
- }
- }
-
- if ( argc - optind != 1 )
- usage( argv[0] );
-
- shgen_header( stdout );
-
- if ( strcmp( argv[optind], "sci" ) == 0 )
- {
- shgen_gensci( stdout, Phi );
- }
- else
- usage( argv[0] );
-
- return 0 ;
-}
diff --git a/c/src/exec/score/tools/unix/Makefile.in b/c/src/exec/score/tools/unix/Makefile.in
deleted file mode 100644
index 0b8402d15f..0000000000
--- a/c/src/exec/score/tools/unix/Makefile.in
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# we use host compiler here for gensize. Hopefully it has same alignment!!
-USE_HOST_COMPILER=yes
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=gensize
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-PGMS=${ARCH}/gensize
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-# We use files that have not been installed yet.
-CPU_DIR=../../cpu/$(RTEMS_CPU)
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I$(PROJECT_INCLUDE) \
- -I$(CPU_DIR)
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here.
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: preinstall
-
-preinstall: ${ARCH} $(SRCS) $(PGMS)
- @INSTALL@ $(INSTBINFLAGS) $(PGMS) ${PROJECT_RELEASE}/bin
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
diff --git a/c/src/exec/score/tools/unix/gensize.c b/c/src/exec/score/tools/unix/gensize.c
deleted file mode 100644
index 6299479e80..0000000000
--- a/c/src/exec/score/tools/unix/gensize.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * gensize.c
- *
- * This file generates the file unixsize.h
- *
- * NOTE: It only prints the minimal information required.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution 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 feels like a very crude way to determine if we are on a Solaris
- * host but it does work.
- */
-
-#if defined(__sun__) && defined(__sparc__) && \
- defined(__unix__) && defined(__svr4__)
-#undef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 3
-#undef __STRICT_ANSI__
-#endif
-
-#include <stdio.h>
-#include <unistd.h>
-#include <setjmp.h>
-#include <signal.h>
-
-typedef struct {
- jmp_buf regs;
- int isr_level;
-} Context_Control;
-
-int main(
- int argc,
- char **argv
-)
-{
- Context_Control *cc = 0;
-
- /*
- * Print the file header
- */
-
-printf(
- "/* unixsize.h\n"
- " *\n"
- " * This include file contans the size of the context control block\n"
- " * C data structure. This structure must be defined in such a way\n"
- " * that files NOT including the native header files can work.\n"
- " *\n"
- " * NOTE: THIS FILE IS AUTOMATICALLY GENERATED!!!!\n"
- " * DO NOT EDIT THIS BY HAND!!!!\n"
- " *\n"
- " * COPYRIGHT (c) 1989-1998.\n"
- " * On-Line Applications Research Corporation (OAR).\n"
- " * Copyright assigned to U.S. Government, 1994.\n"
- " *\n"
- " * The license and distribution terms for this file may be\n"
- " * found in the file LICENSE in this distribution or at\n"
- " * http://www.OARcorp.com/rtems/license.html.\n"
- " */\n"
- "\n"
- "#ifndef __UNIXSIZE_h\n"
- "#define __UNIXSIZE_h\n"
- "\n"
-);
-
-#define PRINT_IT( STRING, NUMBER ) \
- printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
- STRING, \
- NUMBER, \
- NUMBER );
-
-#define PRINT_SIZE( STRING, NUMBER ) \
- printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
- STRING, \
- NUMBER, \
- NUMBER );
-
-#define PRINT_COMMENT( STRING ) \
- printf( \
- "\n" \
- "/*\n" \
- " * " STRING "\n" \
- " */\n" \
- "\n" \
- );
-
- PRINT_COMMENT("Context_Control information");
-
- PRINT_SIZE("CPU_CONTEXT_SIZE_IN_BYTES", sizeof( Context_Control ) );
- PRINT_SIZE("CPU_CONTEXT_REGISTERS_OFFSET_IN_BYTES", (int) &cc->regs );
- PRINT_SIZE("CPU_CONTEXT_SIGNALS_OFFSET_IN_BYTES", (int) &cc->isr_level );
-
- /*
- * Print the end of file stuff
- */
-
- printf(
- "\n"
- "#endif /* __UNIXSIZE_h */\n"
- "\n"
- "/* end of include file */\n"
- );
-
- return 0;
-}
-
diff --git a/c/src/exec/wrapup/Makefile.in b/c/src/exec/wrapup/Makefile.in
deleted file mode 100644
index cb22815ff3..0000000000
--- a/c/src/exec/wrapup/Makefile.in
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-POSIX_DIRS_yes_V=posix
-POSIX_DIRS = $(POSIX_DIRS_$(RTEMS_HAS_POSIX_API)_V)
-
-SUB_DIRS=rtems $(POSIX_DIRS)
-
diff --git a/c/src/exec/wrapup/posix/Makefile.in b/c/src/exec/wrapup/posix/Makefile.in
deleted file mode 100644
index b9228360b1..0000000000
--- a/c/src/exec/wrapup/posix/Makefile.in
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-#
-# This is really temporary until posix is more an integral part of the tree.
-#
-#CPU_OBJS=$(wildcard ../../score/cpu/$(RTEMS_CPU)/$(ARCH)/*.rel)
-#CORE_OBJS=$(wildcard ../../score/src/$(ARCH)/*.o)
-#SAPI_OBJS=$(wildcard ../../sapi/src/$(ARCH)/*.o)
-POSIX_OBJS=$(wildcard ../../posix/src/$(ARCH)/*.o)
-
-OBJS=$(CPU_OBJS) $(CORE_OBJS) $(POSIX_OBJS) $(SAPI_OBJS)
-LIB=$(ARCH)/libposix.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/exec/wrapup/rtems/Makefile.in b/c/src/exec/wrapup/rtems/Makefile.in
deleted file mode 100644
index 6da332c467..0000000000
--- a/c/src/exec/wrapup/rtems/Makefile.in
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-CPU_OBJS=$(wildcard ../../score/cpu/$(RTEMS_CPU)/$(ARCH)/*.rel)
-CORE_OBJS=$(wildcard ../../score/src/$(ARCH)/*.o)
-SAPI_OBJS=$(wildcard ../../sapi/src/$(ARCH)/*.o)
-RTEMS_OBJS=$(wildcard ../../rtems/src/$(ARCH)/*.o)
-
-OBJS=$(CPU_OBJS) $(CORE_OBJS) $(RTEMS_OBJS) $(SAPI_OBJS)
-LIB=$(ARCH)/librtems.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
- cd $(PROJECT_ROOT) ; \
- $(PROJECT_RELEASE)/bin/size_rtems $(RTEMS_BSP) $(ARCH) \
- >$(PROJECT_RELEASE)/lib/sizeinfo$(LIB_VARIANT).txt
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/Makefile.in b/c/src/lib/Makefile.in
deleted file mode 100644
index f86d924e21..0000000000
--- a/c/src/lib/Makefile.in
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# We only build the networking library if HAS_NETWORKING was defined
-LIBNETWORKING_yes_V = libnetworking
-LIBNETWORKING = $(LIBNETWORKING_$(HAS_NETWORKING)_V)
-NETWORKING_INCLUDE_yes_V = libnetworking/include
-NETWORKING_INCLUDE = $(NETWORKING_INCLUDE_$(HAS_NETWORKING)_V)
-
-# We only build the rtems++ library if HAS_CPLUSPLUS was defined
-LIBRTEMSCPLUSPLUS_yes_V = librtems++
-LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V)
-
-# General Hardware API library
-LIBHWAPI=$(wildcard libhwapi)
-
-SUB_DIRS=start include $(NETWORKING_INCLUDE) libmisc \
- libc libchip libcpu libbsp $(LIBNETWORKING) \
- $(LIBHWAPI) $(LIBRTEMSCPLUSPLUS) wrapup
diff --git a/c/src/lib/include/Makefile.in b/c/src/lib/include/Makefile.in
deleted file mode 100644
index 4d5aef8a89..0000000000
--- a/c/src/lib/include/Makefile.in
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_PIECES=chain console clockdrv iosupp ringbuf \
- spurious timerdrv vmeintr
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-SYS_H_PIECES=termios
-SYS_H_FILES=$(SYS_H_PIECES:%=$(srcdir)/sys/%.h)
-
-MOTOROLA_H_PIECES=mc68230 mc68681
-MOTOROLA_H_FILES=$(MOTOROLA_H_PIECES:%=$(srcdir)/motorola/%.h)
-
-ZILOG_H_PIECES=z8036 z8530 z8536
-ZILOG_H_FILES=$(ZILOG_H_PIECES:%=$(srcdir)/zilog/%.h)
-
-RTEMSCPLUSPLUS_H_PIECES= rtemsEvent rtemsInterrupt rtemsMessageQueue \
- rtemsSemaphore rtemsStatusCode rtemsTask rtemsTaskMode rtemsTimer
-RTEMSCPLUSPLUS_H_FILES=$(RTEMSCPLUSPLUS_H_PIECES:%=$(srcdir)/rtems++/%.h)
-
-SRCS=$(H_FILES) $(SYS_H_FILES) \
- $(MOTOROLA_H_FILES) $(RTEMSCPLUSPLUS_H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(SYS_H_FILES) $(PROJECT_INCLUDE)/sys
- $(INSTALL) -m 444 $(MOTOROLA_H_FILES) \
- $(PROJECT_INCLUDE)/motorola
- $(INSTALL) -m 444 $(ZILOG_H_FILES) $(PROJECT_INCLUDE)/zilog
-ifeq ($(HAS_CPLUSPLUS),yes)
- $(INSTALL) -m 444 $(RTEMSCPLUSPLUS_H_FILES) $(PROJECT_INCLUDE)/rtems++
-endif
diff --git a/c/src/lib/include/chain.h b/c/src/lib/include/chain.h
deleted file mode 100644
index 98cf2b1a86..0000000000
--- a/c/src/lib/include/chain.h
+++ /dev/null
@@ -1,362 +0,0 @@
-/* chain.h
- *
- * This include file contains all the constants and structures associated
- * with doubly linked chains. This file actually just provides an
- * interface to the chain object in rtems.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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.
- *
- * $ld:
- */
-
-#ifndef __CHAIN_h
-#define __CHAIN_h
-
-#include <rtems.h>
-
-/*
- * Chain_Initialize
- *
- * This routine initializes the_chain structure to manage the
- * contiguous array of number_nodes nodes which starts at
- * starting_address. Each node is of node_size bytes.
- *
- * Chain_Control *the_chain, * IN *
- * void *starting_address, * IN *
- * rtems_unsigned32 number_nodes, * IN *
- * rtems_unsigned32 node_size * IN *
- */
-
-#define Chain_Initialize( the_chain, starting_address, \
- number_nodes, node_size ) \
- _Chain_Initialize( the_chain, starting_address, \
- number_nodes, node_size ) \
-
-
-/*
- * Chain_Initialize_empty
- *
- * This routine initializes the specified chain to contain zero nodes.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Initialize_empty( the_chain ) \
- _Chain_Initialize_empty( the_chain )
-
-
-/*
- * Chain_Are_nodes_equal
- *
- * This function returns TRUE if LEFT and RIGHT are equal,
- * and FALSE otherwise.
- *
- * Chain_Node *left, * IN *
- * Chain_Node *right * IN *
- */
-
-#define Chain_Are_nodes_equal( left, right ) \
- _Chain_Are_nodes_equal( left, right )
-
-
-/*
- * Chain_Extract_unprotected
- *
- * This routine extracts the_node from the chain on which it resides.
- * It does NOT disable interrupts to insure the atomicity of the
- * extract operation.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Extract_unprotected( the_node ) \
- _Chain_Extract_unprotected( the_node )
-
-
-/*
- * Chain_Extract
- *
- * This routine extracts the_node from the chain on which it resides.
- * It disables interrupts to insure the atomicity of the
- * extract operation.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Extract( the_node ) \
- _Chain_Extract( the_node )
-
-
-/*
- * Chain_Get_unprotected
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. If the_chain is empty, then NULL is returned.
- * It does NOT disable interrupts to insure the atomicity of the
- * get operation.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Get_unprotected( the_chain ) \
- _Chain_Get_unprotected( the_chain )
-
-
-/*
- * Chain_Get
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. If the_chain is empty, then NULL is returned.
- * It disables interrupts to insure the atomicity of the
- * get operation.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Get( the_chain ) \
- _Chain_Get( the_chain )
-
-
-/*
- * Chain_Get_first_unprotected
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. It does NOT disable interrupts to insure
- * the atomicity of the get operation.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Get_first_unprotected( the_chain ) \
- _Chain_Get_first_unprotected( the_chain )
-
-
-/*
- * Chain_Insert_unprotected
- *
- * This routine inserts the_node on a chain immediately following
- * after_node. It does NOT disable interrupts to insure the atomicity
- * of the extract operation.
- *
- * Chain_Node *after_node, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Insert_unprotected( after_node, the_node ) \
- _Chain_Insert_unprotected( after_node, the_node )
-
-
-/*
- * Chain_Insert
- *
- * This routine inserts the_node on a chain immediately following
- * after_node. It disables interrupts to insure the atomicity
- * of the extract operation.
- *
- * Chain_Node *after_node, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Insert( after_node, the_node ) \
- _Chain_Insert( after_node, the_node )
-
-
-/*
- * Chain_Append_unprotected
- *
- * This routine appends the_node onto the end of the_chain.
- * It does NOT disable interrupts to insure the atomicity of the
- * append operation.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Append_unprotected( the_chain, the_node ) \
- _Chain_Append_unprotected( the_chain, the_node )
-
-
-/*
- * Chain_Append
- *
- * This routine appends the_node onto the end of the_chain.
- * It disables interrupts to insure the atomicity of the
- * append operation.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Append( the_chain, the_node ) \
- _Chain_Append( the_chain, the_node )
-
-
-/*
- * Chain_Prepend_unprotected
- *
- * This routine prepends the_node onto the front of the_chain.
- * It does NOT disable interrupts to insure the atomicity of the
- * prepend operation.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Prepend_unprotected( the_chain, the_node ) \
- _Chain_Prepend_unprotected( the_chain, the_node )
-
-
-/*
- * Chain_Prepend
- *
- * This routine prepends the_node onto the front of the_chain.
- * It disables interrupts to insure the atomicity of the
- * prepend operation.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Prepend( the_chain, the_node ) \
- _Chain_Prepend( the_chain, the_node )
-
-
-/*
- * Chain_Head
- *
- * This function returns a pointer to the first node on the chain.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Head( the_chain ) \
- _Chain_Head( the_chain )
-
-
-/*
- * Chain_Tail
- *
- * This function returns a pointer to the last node on the chain.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Tail( the_chain ) \
- _Chain_Tail( the_chain )
-
-
-/*
- * Chain_Is_head
- *
- * This function returns TRUE if the_node is the head of the_chain and
- * FALSE otherwise.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_head( the_chain, the_node ) \
- _Chain_Is_head( the_chain, the_node )
-
-
-/*
- * Chain_Is_tail
- *
- * This function returns TRUE if the_node is the tail of the_chain and
- * FALSE otherwise.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_tail( the_chain, the_node ) \
- _Chain_Is_tail( the_chain, the_node )
-
-
-/*
- * Chain_Is_first
- *
- * This function returns TRUE if the_node is the first node on a chain and
- * FALSE otherwise.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_first( the_node ) \
- _Chain_Is_first( the_node )
-
-
-/*
- * Chain_Is_last
- *
- * This function returns TRUE if the_node is the last node on a chain and
- * FALSE otherwise.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_last( the_node ) \
- _Chain_Is_last( the_node )
-
-
-/*
- * Chain_Is_empty
- *
- * This function returns TRUE if there are no nodes on the_chain and
- * FALSE otherwise.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Is_empty( the_chain ) \
- _Chain_Is_empty( the_chain )
-
-
-/*
- * Chain_Has_only_one_node
- *
- * This function returns TRUE if there is only one node on the_chain and
- * FALSE otherwise.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Has_only_one_node( the_chain ) \
- _Chain_Has_only_one_node( the_chain )
-
-
-/*
- * Chain_Is_null
- *
- * This function returns TRUE if the_chain is NULL and FALSE otherwise.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Is_null( the_chain ) \
- _Chain_Is_null( the_chain )
-
-
-/*
- * Chain_Is_null_node
- *
- * This function returns TRUE if the_node is NULL and FALSE otherwise.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_null_node( the_node ) \
- _Chain_Is_null_node( the_node )
-
-
-#undef __RTEMS_APPLICATION__
-#include <rtems/score/chain.inl>
-#define __RTEMS_APPLICATION__
-#endif
-/* end of include file */
diff --git a/c/src/lib/include/clockdrv.h b/c/src/lib/include/clockdrv.h
deleted file mode 100644
index 74c9d5e9f7..0000000000
--- a/c/src/lib/include/clockdrv.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* clock.h
- *
- * This file describes the Clock Driver for all boards.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __CLOCK_DRIVER_h
-#define __CLOCK_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* variables */
-
-extern volatile rtems_unsigned32 Clock_driver_ticks;
-extern rtems_device_major_number rtems_clock_major;
-extern rtems_device_minor_number rtems_clock_minor;
-
-/* default clock driver entry */
-
-#define CLOCK_DRIVER_TABLE_ENTRY \
- { Clock_initialize, NULL, NULL, NULL, NULL, Clock_control }
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/include/console.h b/c/src/lib/include/console.h
deleted file mode 100644
index 2f5173d757..0000000000
--- a/c/src/lib/include/console.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* console.h
- *
- * This file describes the Console Device Driver for all boards.
- * This driver provides support for the standard C Library.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _CONSOLE_DRIVER_h
-#define _CONSOLE_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CONSOLE_DRIVER_TABLE_ENTRY \
- { console_initialize, console_open, console_close, \
- console_read, console_write, console_control }
-
-void console_reserve_resources(
- rtems_configuration_table *configuration
-);
-
-rtems_device_driver console_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_open(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_close(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_read(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_write(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_control(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/include/iosupp.h b/c/src/lib/include/iosupp.h
deleted file mode 100644
index 97175e0a7b..0000000000
--- a/c/src/lib/include/iosupp.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* iosupp.h
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __IOSUPP_h
-#define __IOSUPP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* character constants */
-
-#define BS 0x08 /* backspace */
-#define LF 0x0a /* line feed */
-#define CR 0x0d /* carriage return */
-#define XON 0x11 /* control-Q */
-#define XOFF 0x13 /* control-S */
-
-/* structures */
-
-#ifdef IOSUPP_INIT
-#define IOSUPP_EXTERN
-#else
-#undef IOSUPP_EXTERN
-#define IOSUPP_EXTERN extern
-#endif
-
-/* functions */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/lib/include/motorola/mc68230.h b/c/src/lib/include/motorola/mc68230.h
deleted file mode 100644
index bde00c4cdd..0000000000
--- a/c/src/lib/include/motorola/mc68230.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * mc68230.h -- Low level support code for the Motorola 68230 Parallel
- * Interface/Timer (PIT)
- *
- * Modified by Doug McBride, Colorado Space Grant College
- *
- * Format taken partly from RTEMS code and mostly from Motorola IDP user's
- * manual. RTEMS copyright information below.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MC68230_H__
-#define __MC68230_H__
-
-/* Some Motorola IDP User manual defines: */
-#define PIT_ADDR 0x00c01003 /* base address of the PIT */
-#define REGOFF 0x04 /* Difference between addresses */
-#define VECT 64
-#define H1VECT 0x00
-#define H2VECT 0x01
-#define H3VECT 0x02
-#define H4VECT 0x03
-
-/*
- * mc68230 register offsets
- */
-#define PGCR 0x00
-#define PSRR 1*REGOFF
-#define PADDR 2*REGOFF
-#define PBDDR 3*REGOFF
-#define PCDDR 4*REGOFF
-#define PIVR 5*REGOFF
-#define PACR 6*REGOFF
-#define PBCR 7*REGOFF
-#define PADR 8*REGOFF
-#define PBDR 9*REGOFF
-#define PAAR 10*REGOFF
-#define PBAR 11*REGOFF
-#define PCDR 12*REGOFF
-#define PITSR 13*REGOFF
-#define TCR 16*REGOFF
-#define TIVR 17*REGOFF
-#define CPRH 19*REGOFF
-#define CPRM 20*REGOFF
-#define CPRL 21*REGOFF
-#define CNTRH 23*REGOFF
-#define CNTRM 24*REGOFF
-#define CNTRL 25*REGOFF
-#define TSR 26*REGOFF
-
-/* Some RTEMS style defines: */
-#ifndef VOL8
-#define VOL8( ptr ) ((volatile rtems_unsigned8 *)(ptr))
-#endif
-
-#define MC68230_WRITE( reg, data ) \
- *(VOL8(PIT_ADDR+reg)) = (data)
-
-#define MC68230_READ( reg, data ) \
- (data) = *(VOL8(PIT_ADDR+reg))
-
-#endif
diff --git a/c/src/lib/include/motorola/mc68681.h b/c/src/lib/include/motorola/mc68681.h
deleted file mode 100644
index 7602097fd8..0000000000
--- a/c/src/lib/include/motorola/mc68681.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * mc68681-duart.h -- Low level support code for the Motorola mc68681
- * DUART.
- *
- * Originally written by rob@cygnus.com (Rob Savoye) for the libgloss
- * IDP support.
- *
- * $Id$
- */
-
-#ifndef __MC68681_H__
-#define __MC68681_H__
-
-/*
- * In the dark ages when this controller was designed, it was actually
- * possible to access data on unaligned byte boundaries with no penalty.
- * Now we find this chip in configurations in which the registers are
- * at 16-bit, 32-bit, and 64-bit boundaries at the whim of the board
- * designer. If the registers are not at byte addresses, then
- * set this multiplier before including this file to correct the offsets.
- */
-
-#ifndef MC68681_OFFSET_MULTIPLIER
-#define MC68681_OFFSET_MULTIPLIER 1
-#endif
-
-#define __MC68681_REG(_R) ((_R) * MC68681_OFFSET_MULTIPLIER)
-
-/*
- * mc68681 register offsets Read/Write Addresses
- */
-#define MC68681_MODE_REG_1A __MC68681_REG(0) /* MR1A-MR Prior to Read */
-#define MC68681_MODE_REG_2A __MC68681_REG(0) /* MR2A-MR After Read */
-
-#define MC68681_COUNT_MODE_CURRENT_MSB __MC68681_REG(6) /* CTU */
-#define MC68681_COUNTER_TIMER_UPPER_REG __MC68681_REG(6) /* CTU */
-#define MC68681_COUNT_MODE_CURRENT_LSB __MC68681_REG(7) /* CTL */
-#define MC68681_COUNTER_TIMER_LOWER_REG __MC68681_REG(7) /* CTL */
-#define MC68681_INTERRUPT_VECTOR_REG __MC68681_REG(12) /* IVR */
-
-#define MC68681_MODE_REG_1B __MC68681_REG(8) /* MR1B-MR Prior to Read */
-#define MC68681_MODE_REG_2B __MC68681_REG(8) /* MR2BA-MR After Read */
-
-/*
- * mc68681 register offsets Read Only Addresses
- */
-#define MC68681_STATUS_REG_A __MC68681_REG(1) /* SRA */
-#define MC68681_MASK_ISR_REG __MC68681_REG(2) /* MISR */
-#define MC68681_RECEIVE_BUFFER_A __MC68681_REG(3) /* RHRA */
-#define MC68681_INPUT_PORT_CHANGE_REG __MC68681_REG(4) /* IPCR */
-#define MC68681_INTERRUPT_STATUS_REG __MC68681_REG(5) /* ISR */
-#define MC68681_STATUS_REG_B __MC68681_REG(9) /* SRB */
-#define MC68681_RECEIVE_BUFFER_B __MC68681_REG(11) /* RHRB */
-#define MC68681_INPUT_PORT __MC68681_REG(13) /* IP */
-#define MC68681_START_COUNT_CMD __MC68681_REG(14) /* SCC */
-#define MC68681_STOP_COUNT_CMD __MC68681_REG(15) /* STC */
-
-/*
- * mc68681 register offsets Write Only Addresses
- */
-#define MC68681_CLOCK_SELECT_REG_A __MC68681_REG(1) /* CSRA */
-#define MC68681_COMMAND_REG_A __MC68681_REG(2) /* CRA */
-#define MC68681_TRANSMIT_BUFFER_A __MC68681_REG(3) /* THRA */
-#define MC68681_AUX_CTRL_REG __MC68681_REG(4) /* ACR */
-#define MC68681_INTERRUPT_MASK_REG __MC68681_REG(5) /* IMR */
-#define MC68681_CLOCK_SELECT_REG_B __MC68681_REG(9) /* CSRB */
-#define MC68681_COMMAND_REG_B __MC68681_REG(10) /* CRB */
-#define MC68681_TRANSMIT_BUFFER_B __MC68681_REG(11) /* THRB */
-#define MC68681_OUTPUT_PORT_CONFIG_REG __MC68681_REG(13) /* OPCR */
-#define MC68681_OUTPUT_PORT_SET_REG __MC68681_REG(14) /* SOPBC */
-#define MC68681_OUTPUT_PORT_RESET_BITS __MC68681_REG(15) /* COPBC */
-
-
-#ifndef MC6681_VOL
-#define MC6681_VOL( ptr ) ((volatile unsigned char *)(ptr))
-#endif
-
-#define MC68681_WRITE( _base, _reg, _data ) \
- *((volatile unsigned char *)_base+_reg) = (_data)
-
-#define MC68681_READ( _base, _reg ) \
- *(((volatile unsigned char *)_base+_reg))
-
-
-
-#define MC68681_CLEAR 0x00
-
-#define MC68681_PORT_A 0
-#define MC68681_PORT_B 1
-
-/*
- * DUART Command Register Definitions:
- *
- * MC68681_COMMAND_REG_A,MC68681_COMMAND_REG_B
- */
-#define MC68681_MODE_REG_ENABLE_RX 0x01
-#define MC68681_MODE_REG_DISABLE_RX 0x02
-#define MC68681_MODE_REG_ENABLE_TX 0x04
-#define MC68681_MODE_REG_DISABLE_TX 0x08
-#define MC68681_MODE_REG_RESET_MR_PTR 0x10
-#define MC68681_MODE_REG_RESET_RX 0x20
-#define MC68681_MODE_REG_RESET_TX 0x30
-#define MC68681_MODE_REG_RESET_ERROR 0x40
-#define MC68681_MODE_REG_RESET_BREAK 0x50
-#define MC68681_MODE_REG_START_BREAK 0x60
-#define MC68681_MODE_REG_STOP_BREAK 0x70
-#define MC68681_MODE_REG_SET_RX_BRG 0x80
-#define MC68681_MODE_REG_CLEAR_RX_BRG 0x90
-#define MC68681_MODE_REG_SET_TX_BRG 0xa0
-#define MC68681_MODE_REG_CLEAR_TX_BRG 0xb0
-#define MC68681_MODE_REG_SET_STANDBY 0xc0
-#define MC68681_MODE_REG_SET_ACTIVE 0xd0
-
-/*
- * Mode Register Definitions
- *
- * MC68681_MODE_REG_1A
- * MC68681_MODE_REG_1B
- */
-#define MC68681_5BIT_CHARS 0x00
-#define MC68681_6BIT_CHARS 0x01
-#define MC68681_7BIT_CHARS 0x02
-#define MC68681_8BIT_CHARS 0x03
-
-#define MC68681_ODD_PARITY 0x00
-#define MC68681_EVEN_PARITY 0x04
-
-#define MC68681_WITH_PARITY 0x00
-#define MC68681_FORCE_PARITY 0x08
-#define MC68681_NO_PARITY 0x10
-#define MC68681_MULTI_DROP 0x18
-
-#define MC68681_ERR_MODE_CHAR 0x00
-#define MC68681_ERR_MODE_BLOCK 0x20
-
-#define MC68681_RX_INTR_RX_READY 0x00
-#define MC68681_RX_INTR_FFULL 0x40
-
-#define MC68681_NO_RX_RTS_CTL 0x00
-#define MC68681_RX_RTS_CTRL 0x80
-
-
-/*
- * Mode Register Definitions
- *
- * MC68681_MODE_REG_2A
- * MC68681_MODE_REG_2B
- */
-#define MC68681_STOP_BIT_LENGTH__563 0x00
-#define MC68681_STOP_BIT_LENGTH__625 0x01
-#define MC68681_STOP_BIT_LENGTH__688 0x02
-#define MC68681_STOP_BIT_LENGTH__75 0x03
-#define MC68681_STOP_BIT_LENGTH__813 0x04
-#define MC68681_STOP_BIT_LENGTH__875 0x05
-#define MC68681_STOP_BIT_LENGTH__938 0x06
-#define MC68681_STOP_BIT_LENGTH_1 0x07
-#define MC68681_STOP_BIT_LENGTH_1_563 0x08
-#define MC68681_STOP_BIT_LENGTH_1_625 0x09
-#define MC68681_STOP_BIT_LENGTH_1_688 0x0a
-#define MC68681_STOP_BIT_LENGTH_1_75 0x0b
-#define MC68681_STOP_BIT_LENGTH_1_813 0x0c
-#define MC68681_STOP_BIT_LENGTH_1_875 0x0d
-#define MC68681_STOP_BIT_LENGTH_1_938 0x0e
-#define MC68681_STOP_BIT_LENGTH_2 0x0f
-
-#define MC68681_CTS_ENABLE_TX 0x10
-#define MC68681_TX_RTS_CTRL 0x20
-
-#define MC68681_CHANNEL_MODE_NORMAL 0x00
-#define MC68681_CHANNEL_MODE_ECHO 0x40
-#define MC68681_CHANNEL_MODE_LOCAL_LOOP 0x80
-#define MC68681_CHANNEL_MODE_REMOTE_LOOP 0xc0
-
-/*
- * Status Register Definitions
- *
- * MC68681_STATUS_REG_A, MC68681_STATUS_REG_B
- */
-#define MC68681_RX_READY 0x01
-#define MC68681_FFULL 0x02
-#define MC68681_TX_READY 0x04
-#define MC68681_TX_EMPTY 0x08
-#define MC68681_OVERRUN_ERROR 0x10
-#define MC68681_PARITY_ERROR 0x20
-#define MC68681_FRAMING_ERROR 0x40
-#define MC68681_RECEIVED_BREAK 0x80
-
-
-/*
- * Interupt Status Register Definitions.
- *
- * MC68681_INTERRUPT_STATUS_REG
- */
-
-
-/*
- * Interupt Mask Register Definitions
- *
- * MC68681_INTERRUPT_MASK_REG
- */
-#define MC68681_IR_TX_READY_A 0x01
-#define MC68681_IR_RX_READY_A 0x02
-#define MC68681_IR_BREAK_A 0x04
-#define MC68681_IR_COUNTER_READY 0x08
-#define MC68681_IR_TX_READY_B 0x10
-#define MC68681_IR_RX_READY_B 0x20
-#define MC68681_IR_BREAK_B 0x40
-#define MC68681_IR_INPUT_PORT_CHANGE 0x80
-
-/*
- * Status Register Definitions.
- *
- * MC68681_STATUS_REG_A,MC68681_STATUS_REG_B
- */
-#define MC68681_STATUS_RXRDY 0x01
-#define MC68681_STATUS_FFULL 0x02
-#define MC68681_STATUS_TXRDY 0x04
-#define MC68681_STATUS_TXEMT 0x08
-#define MC68681_STATUS_OVERRUN_ERROR 0x10
-#define MC68681_STATUS_PARITY_ERROR 0x20
-#define MC68681_STATUS_FRAMING_ERROR 0x40
-#define MC68681_STATUS_RECEIVED_BREAK 0x80
-
-/*
- * Definitions for the Interrupt Vector Register:
- *
- * MC68681_INTERRUPT_VECTOR_REG
- */
-#define MC68681_INTERRUPT_VECTOR_INIT 0x0f
-
-/*
- * Definitions for the Auxiliary Control Register
- *
- * MC68681_AUX_CTRL_REG
- */
-#define MC68681_AUX_BRG_SET1 0x00
-#define MC68681_AUX_BRG_SET2 0x80
-
-
-/*
- * The following Baud rates assume the X1 clock pin is driven with a
- * 3.6864 MHz signal. If a different frequency is used the DUART channel
- * is running at the follwoing baud rate:
- * ((Table Baud Rate)*frequency)/3.6864 MHz
- */
-
-/*
- * Definitions for the Clock Select Register:
- *
- * MC68681_CLOCK_SELECT_REG_A,MC68681_CLOCK_SELECT_REG_A
- *
- * Note: ACR[7] is the MSB of the Auxiliary Control register
- * X is the extend bit.
- * CRA - 0x08 Set Rx BRG Select Extend Bit (X=1)
- * CRA - 0x09 Clear Rx BRG Select Extend Bit (X=0)
- * CRB - 0x0a Set Tx BRG Select Extend Bit (X=1)
- * CRB - 0x0b Clear Tx BRG Select Extend Bit (x=1)
- */
-#define MC68681_BAUD_RATE_MASK_50 0x00 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_75 0x00 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_110 0x01
-#define MC68681_BAUD_RATE_MASK_134_5 0x02
-#define MC68681_BAUD_RATE_MASK_150 0x03 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_200 0x03 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_300 0x04 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_600 0x05 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_1050 0x07 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_1200 0x06 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_1800 0x0a /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_2400 0x08 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_3600 0x04 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_4800 0x09
-#define MC68681_BAUD_RATE_MASK_7200 0x0a /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_9600 0xbb
-
-#define MC68681_BAUD_RATE_MASK_14_4K 0x05 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_19_2K 0xcc /* ACR[7]=1,X=0 */
- /* ARC[7]=0,X=1 */
-#define MC68681_BAUD_RATE_MASK_28_8K 0x06 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_38_4K 0xcc /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_57_6K 0x07 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_115_5K 0x08
-#define MC68681_BAUD_RATE_MASK_TIMER 0xdd
-#define MC68681_BAUD_RATE_MASK_TIMER_16X 0xee
-#define MC68681_BAUD_RATE_MASK_TIMER_1X 0xff
-
-#endif
-
-
-
diff --git a/c/src/lib/include/ringbuf.h b/c/src/lib/include/ringbuf.h
deleted file mode 100644
index 8c80aaf9c8..0000000000
--- a/c/src/lib/include/ringbuf.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * ringbuf.h
- *
- * This file provides simple ring buffer functionality.
- *
- * $Id$
- */
-
-#ifndef __RINGBUF_H__
-#define __RINGBUF_H__
-
-#ifndef RINGBUF_QUEUE_LENGTH
-#define RINGBUF_QUEUE_LENGTH 128
-#endif
-
-typedef struct {
- char buffer[RINGBUF_QUEUE_LENGTH];
- volatile int head;
- volatile int tail;
-} Ring_buffer_t;
-
-#define Ring_buffer_Initialize( _buffer ) \
- do { \
- (_buffer)->head = (_buffer)->tail = 0; \
- } while ( 0 )
-
-#define Ring_buffer_Is_empty( _buffer ) \
- ( (_buffer)->head == (_buffer)->tail )
-
-#define Ring_buffer_Is_full( _buffer ) \
- ( (_buffer)->head == ((_buffer)->tail + 1) % RINGBUF_QUEUE_LENGTH )
-
-#define Ring_buffer_Add_character( _buffer, _ch ) \
- do { \
- rtems_unsigned32 isrlevel; \
- \
- rtems_interrupt_disable( isrlevel ); \
- (_buffer)->tail = ((_buffer)->tail+1) % RINGBUF_QUEUE_LENGTH; \
- (_buffer)->buffer[ (_buffer)->tail ] = (_ch); \
- rtems_interrupt_enable( isrlevel ); \
- } while ( 0 )
-
-#define Ring_buffer_Remove_character( _buffer, _ch ) \
- do { \
- rtems_unsigned32 isrlevel; \
- \
- rtems_interrupt_disable( isrlevel ); \
- (_buffer)->head = ((_buffer)->head+1) % RINGBUF_QUEUE_LENGTH; \
- (_ch) = (_buffer)->buffer[ (_buffer)->head ]; \
- rtems_interrupt_enable( isrlevel ); \
- } while ( 0 )
-
-#endif
diff --git a/c/src/lib/include/rtems++/rtemsEvent.h b/c/src/lib/include/rtems++/rtemsEvent.h
deleted file mode 100644
index 3cc19eeb32..0000000000
--- a/c/src/lib/include/rtems++/rtemsEvent.h
+++ /dev/null
@@ -1,127 +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.
-
- ------------------------------------------------------------------------
-
- rtemsEvent class.
-
- This class allows the user to send and receive RTEMS events to a task.
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsEvent_h_)
-#define _rtemsEvent_h_
-
-#include <rtems++/rtemsStatusCode.h>
-#include <rtems++/rtemsTask.h>
-
-/* ----
- rtemsEvent
-*/
-
-class rtemsEvent
- : public rtemsStatusCode
-{
-public:
- // attribute a task can have
-
- enum WaitMode { wait = RTEMS_WAIT,
- no_wait = RTEMS_NO_WAIT};
- enum Condition { any = RTEMS_EVENT_ANY,
- all = RTEMS_EVENT_ALL};
-
- // only the first 4 characters of the name are taken
-
- // connect to a task
- rtemsEvent(const char* name, rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
-
- // copy and default constructors
- rtemsEvent(const rtemsEvent& event);
- rtemsEvent();
-
- virtual ~rtemsEvent();
-
- // connect to an existing task object, will not be the owner
- const rtemsEvent& operator=(const rtemsEvent& event);
- virtual const rtems_status_code connect(const char *name,
- const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
-
- // send an event
- inline const rtems_status_code send(const rtems_id task,
- const rtems_event_set events);
- inline const rtems_status_code send(const rtemsTask& task,
- const rtems_event_set events) ;
- inline const rtems_status_code send(const rtems_event_set events);
-
- // receive an event, can block a task if no events waiting
- inline const rtems_status_code receive(const rtems_event_set event_in,
- rtems_event_set& event_out,
- const rtems_interval micro_secs = 0,
- const WaitMode wait = wait,
- const Condition condition = any);
-
- // object id, and name
- const rtems_id task_id_is() const { return id; }
- const rtems_name task_name_is() const { return name; }
-
-private:
- // task name
- rtems_name name;
-
- // the rtems task id, object handle
- rtems_id id;
-
-};
-
-const rtems_status_code rtemsEvent::send(const rtems_id task,
- const rtems_event_set events)
-{
- set_status_code(rtems_event_send(task, events));
- return last_status_code();
-}
-
-const rtems_status_code rtemsEvent::send(const rtemsTask& task,
- const rtems_event_set events)
-{
- set_status_code(rtems_event_send(task.id_is(), events));
- return last_status_code();
-}
-
-const rtems_status_code rtemsEvent::send(const rtems_event_set events)
-{
- set_status_code(rtems_event_send(id, events));
- return last_status_code();
-}
-
-const rtems_status_code rtemsEvent::receive(const rtems_event_set event_in,
- rtems_event_set& event_out,
- const rtems_interval micro_secs,
- const WaitMode wait,
- const Condition condition)
-{
- rtems_interval usecs =
- micro_secs && (micro_secs < _TOD_Microseconds_per_tick) ?
- _TOD_Microseconds_per_tick : micro_secs;
- set_status_code(rtems_event_receive(event_in,
- wait | condition,
- TOD_MICROSECONDS_TO_TICKS(usecs),
- &event_out));
- return last_status_code();
-}
-
-#endif // _rtemsEvent_h_
-
-
-
-
-
diff --git a/c/src/lib/include/rtems++/rtemsInterrupt.h b/c/src/lib/include/rtems++/rtemsInterrupt.h
deleted file mode 100644
index f722eb7683..0000000000
--- a/c/src/lib/include/rtems++/rtemsInterrupt.h
+++ /dev/null
@@ -1,105 +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.
-
- ------------------------------------------------------------------------
-
- rtemsInterrupt class.
-
- This class catches an interrupt and passes control to the user's
- derived class throught the handler method.
-
- The interrupt is released back to the previous handler when this
- object destructs.
-
- The old handler can be chained to after the interrupt is
- caught. Watch the stack usage!
-
- More than one instance of this class can catch the same vector. The
- application will have to chain to the other objects if required. If
- the old handler is not an instance of this class the chain is passed
- as "void (*)(void)". If it is an instance of this class, the handler
- method is directly called.
-
- The isr catch extends the documented return codes with :
-
- RTEMS_RESOURCE_IN_USE = interrupt already caught
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsInterrupt_h_)
-#define _rtemsInterrupt_h_
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- rtemsInterrupt
-*/
-
-class rtemsInterrupt
- : public rtemsStatusCode
-{
-public:
- rtemsInterrupt();
- virtual ~rtemsInterrupt();
-
- // catch the interrupt
- virtual const rtems_status_code isr_catch(const rtems_vector_number vector);
-
- // release the interrupt back to the previous handle
- virtual const rtems_status_code release();
-
- // the old handler
- const rtems_isr_entry old_isr_handler() const { return old_handler; }
-
-protected:
-
- // called after the interrupt is caught and it goes off
- virtual void handler() = 0;
-
- // chain to the previous handler,
- inline void chain() const;
-
-private:
- const rtemsInterrupt& operator=(const rtemsInterrupt& );
- rtemsInterrupt(const rtemsInterrupt& );
-
- // the vector caught
- rtems_vector_number vector;
-
- // true when the interrupt is caught
- bool caught;
-
- // returned when catching the interrupt
- rtems_isr_entry old_handler;
-
- // old interrupt table entry
- rtemsInterrupt *old_interrupt;
-
- // common handler to redirect the interrupts
- static void redirector(rtems_vector_number vector);
-};
-
-void rtemsInterrupt::chain() const
-{
- if (old_interrupt)
- old_interrupt->handler();
- else if (old_handler)
- ((void(*)()) old_handler)();
-}
-
-#endif // _rtemsInterrupt_h_
-
-
-
-
-
diff --git a/c/src/lib/include/rtems++/rtemsMessageQueue.h b/c/src/lib/include/rtems++/rtemsMessageQueue.h
deleted file mode 100644
index 910c7279f7..0000000000
--- a/c/src/lib/include/rtems++/rtemsMessageQueue.h
+++ /dev/null
@@ -1,176 +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.
-
- ------------------------------------------------------------------------
-
- rtemsMessageQueue class.
-
- This class allows the user to create a RTEMS message queue, or to
- access and manage an already existing message queue.
-
- The first constructor with the message queue parameters creates a
- RTEMS message queue object. The destructor of this object also
- deletes the message queue object. The last status code should be
- checked after construction to see if the create completed
- successfully.
-
- The second constructor connects to an existing message queue
- object. The last status code should be checked after construction to
- see if the message queue existed.
-
- The third constructor is a copy constructor. Connects to an existing
- object which is in scope.
-
- The fourth constructor allows for the message queue to be created
- after construction, or to connect to a message queue later.
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsMessageQueue_h_)
-#define _rtemsMessageQueue_h_
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- rtemsMessageQueue
-*/
-
-class rtemsMessageQueue
- : public rtemsStatusCode
-{
-public:
- // attribute a message queue can have
- enum WaitMode { wait_by_fifo = RTEMS_FIFO,
- wait_by_priority = RTEMS_PRIORITY };
- enum Scope { local = RTEMS_LOCAL,
- global = RTEMS_GLOBAL };
-
- // only the first 4 characters of the name are taken
-
- // creates a message queue
- rtemsMessageQueue(const char* name,
- const rtems_unsigned32 count,
- const rtems_unsigned32 max_message_size,
- const WaitMode wait_mode = wait_by_fifo,
- const Scope scope = local);
-
- // connects to a message queue
- rtemsMessageQueue(const char *name, const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
-
- // copy and default constructors
- rtemsMessageQueue(const rtemsMessageQueue& message_queue);
- rtemsMessageQueue();
-
- // only the creator's destructor will delete the actual object
- virtual ~rtemsMessageQueue();
-
- // create or destroy (delete) the message queue
- virtual const rtems_status_code create(const char* name,
- const rtems_unsigned32 count,
- const rtems_unsigned32 max_message_size,
- const WaitMode wait_mode = wait_by_fifo,
- const Scope scope = local);
- virtual const rtems_status_code destroy();
-
- // connect to an existing message queue object, will not be the owner
- const rtemsMessageQueue& operator=(const rtemsMessageQueue& message_queue);
- virtual const rtems_status_code connect(const char *name,
- const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
-
- // send a message of size from the buffer
- inline const rtems_status_code send(const void *buffer,
- const rtems_unsigned32 size);
- inline const rtems_status_code urgent(const void *buffer,
- const rtems_unsigned32 size);
- inline const rtems_status_code broadcast(const void *buffer,
- const rtems_unsigned32 size,
- rtems_unsigned32& count);
-
- // receive a message of size, the timeout is in micro-secs
- inline const rtems_status_code receive(const void *buffer,
- rtems_unsigned32& size,
- rtems_interval micro_secs = RTEMS_NO_TIMEOUT,
- bool wait = true);
-
- // flush a message queue, returning the number of messages dropped
- inline const rtems_status_code flush(rtems_unsigned32& size);
-
- // object id, and name
- const rtems_id id_is() const { return id; }
- const rtems_name name_is() const { return name; }
- const char *name_string() const { return name_str; }
-
-private:
-
- // make this object reference an invalid RTEMS object
- void make_invalid();
-
- // message queue name
- rtems_name name;
- char name_str[5];
-
- // owner, true if this object owns the message queue
- // will delete the message queue when it destructs
- bool owner;
-
- // the rtems id, object handle
- rtems_id id;
-};
-
-const rtems_status_code rtemsMessageQueue::send(const void *buffer,
- const rtems_unsigned32 size)
-{
- return set_status_code(rtems_message_queue_send(id, (void*) buffer, size));
-}
-
-const rtems_status_code rtemsMessageQueue::urgent(const void *buffer,
- const rtems_unsigned32 size)
-{
- return set_status_code(rtems_message_queue_urgent(id, (void*) buffer, size));
-}
-
-const rtems_status_code rtemsMessageQueue::broadcast(const void *buffer,
- const rtems_unsigned32 size,
- rtems_unsigned32& count)
-{
- return set_status_code(rtems_message_queue_broadcast(id,
- (void*) buffer,
- size,
- &count));
-}
-
-const rtems_status_code rtemsMessageQueue::receive(const void *buffer,
- rtems_unsigned32& size,
- rtems_interval micro_secs,
- bool wait)
-{
- rtems_interval usecs =
- micro_secs && (micro_secs < _TOD_Microseconds_per_tick) ?
- _TOD_Microseconds_per_tick : micro_secs;
- return set_status_code(rtems_message_queue_receive(id,
- (void*) buffer,
- &size,
- wait ? RTEMS_WAIT : RTEMS_NO_WAIT,
- TOD_MICROSECONDS_TO_TICKS(usecs)));
-}
-
-const rtems_status_code rtemsMessageQueue::flush(rtems_unsigned32& count)
-{
- return set_status_code(rtems_message_queue_flush(id, &count));
-}
-
-#endif // _rtemsMessageQueue_h_
-
-
-
-
diff --git a/c/src/lib/include/rtems++/rtemsSemaphore.h b/c/src/lib/include/rtems++/rtemsSemaphore.h
deleted file mode 100644
index 9d4fdbeb58..0000000000
--- a/c/src/lib/include/rtems++/rtemsSemaphore.h
+++ /dev/null
@@ -1,145 +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.
-
- ------------------------------------------------------------------------
-
- rtemsSemaphore class.
-
- This class allows the user to create a RTEMS semaphore, or to use an
- already existing semaphore. The type of semaphore is decitated by
- the constructor used.
-
- The first constructor with the semaphore parameters creates a RTEMS
- semaphore object. The destructor of this object also deletes the
- semaphore object. The last status code should be checked after
- construction to see if the semaphore create was successfull.
-
- The second constructor connects to an existing. The last status code
- should be checked after construction to see if the semaphore
- existed.
-
- The third constructor is a copy constructor. Connects to an existing
- object which is in scope.
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsSemaphore_h_)
-#define _rtemsSemaphore_h_
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- rtemsSemaphore
-*/
-
-class rtemsSemaphore
- : public rtemsStatusCode
-{
-public:
- // attribute a semaphore can have
- enum WaitMode { wait_by_fifo = RTEMS_FIFO,
- wait_by_priority = RTEMS_PRIORITY };
- enum Type { binary = RTEMS_BINARY_SEMAPHORE,
- counting = RTEMS_COUNTING_SEMAPHORE };
- enum Priority { no_priority_inherit = RTEMS_NO_INHERIT_PRIORITY,
- inherit_priority = RTEMS_INHERIT_PRIORITY };
- enum Ceiling { no_priority_ceiling = RTEMS_NO_PRIORITY_CEILING,
- priority_ceiling = RTEMS_PRIORITY_CEILING };
- enum Scope { local = RTEMS_LOCAL,
- global = RTEMS_GLOBAL };
-
- // only the first 4 characters of the name are taken,
- // the counter must be set to 1 for binary semaphores
-
- // create a semaphore object
- rtemsSemaphore(const char* name,
- const Scope scope = local,
- const rtems_unsigned32 counter = 1,
- const WaitMode wait_mode = wait_by_fifo,
- const Type type = binary,
- const Priority priority = no_priority_inherit,
- const Ceiling ceiling = no_priority_ceiling,
- const rtems_task_priority priority_ceiling = 0);
-
- // connect to an existing semaphore object by name
- rtemsSemaphore(const char *name, const rtems_unsigned32 node);
-
- // attach this object to an other objects semaphore
- rtemsSemaphore(const rtemsSemaphore& semaphore);
- rtemsSemaphore();
-
- // only the creator's destructor will delete the actual object
- virtual ~rtemsSemaphore();
-
- // create or destroy (delete) a semaphore
- virtual const rtems_status_code create(const char* name,
- const Scope scope = local,
- const rtems_unsigned32 counter = 1,
- const WaitMode wait_mode = wait_by_fifo,
- const Type type = binary,
- const Priority priority = no_priority_inherit,
- const Ceiling ceiling = no_priority_ceiling,
- const rtems_task_priority priority_ceiling = 0);
- virtual const rtems_status_code destroy();
-
- // connect to an existing semaphore object, will not be the owner
- const rtemsSemaphore& operator=(const rtemsSemaphore& semaphore);
- virtual const rtems_status_code connect(const char *name, rtems_unsigned32 node);
-
- // obtain the semaphore, timeout is in micro-seconds
- inline const rtems_status_code obtain(bool wait = true,
- const rtems_unsigned32 micro_secs = RTEMS_NO_TIMEOUT);
-
- // release the semaphore, blocks threads eligble
- inline const rtems_status_code release();
-
- // object id, and name
- const rtems_id id_is() const { return id; }
- const rtems_name name_is() const { return name; }
- const char *name_string() const { return name_str; }
-
-private:
-
- // make the object reference no valid RTEMS object
- void make_invalid();
-
- // semaphore name
- rtems_name name;
- char name_str[5];
-
- // owner, true if this object owns the semaphore
- // will delete the semaphore when it destructs
- bool owner;
-
- // the rtems id, object handle
- rtems_id id;
-};
-
-const rtems_status_code rtemsSemaphore::obtain(const bool wait,
- const rtems_unsigned32 micro_secs)
-{
- rtems_interval usecs =
- micro_secs && (micro_secs < _TOD_Microseconds_per_tick) ?
- _TOD_Microseconds_per_tick : micro_secs;
- return
- set_status_code(rtems_semaphore_obtain(id,
- wait ? RTEMS_WAIT : RTEMS_NO_WAIT,
- TOD_MICROSECONDS_TO_TICKS(usecs)));
-}
-
-const rtems_status_code rtemsSemaphore::release(void)
-{
- return set_status_code(rtems_semaphore_release(id));
-}
-
-#endif // _rtemsSemaphore_h_
diff --git a/c/src/lib/include/rtems++/rtemsStatusCode.h b/c/src/lib/include/rtems++/rtemsStatusCode.h
deleted file mode 100644
index fee230868b..0000000000
--- a/c/src/lib/include/rtems++/rtemsStatusCode.h
+++ /dev/null
@@ -1,57 +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.
-
- ------------------------------------------------------------------------
-
- rtemsStatusCode controls and manages status codes from the RTEMS kernel.
-
- ------------------------------------------------------------------------
-*/
-
-#if !defined(_rtemsStatusCode_h_)
-#define _rtemsStatusCode_h_
-
-#include <rtems.h>
-
-/* ----
- rtemsStatusCode
-*/
-
-class rtemsStatusCode
-{
-public:
-
- rtemsStatusCode() { last_status = RTEMS_NOT_CONFIGURED; }
-
- const bool successful() { return last_status == RTEMS_SUCCESSFUL; }
- const bool unsuccessful() { return last_status != RTEMS_SUCCESSFUL; }
-
- // return the last status code
- const rtems_status_code last_status_code() { return last_status; }
-
- // return the last status as a string
- const char *last_status_string();
-
- const char *status_string(rtems_status_code status_code);
-
-protected:
- const rtems_status_code set_status_code(const rtems_status_code status)
- { return (last_status = status); }
-
-private:
-
- // public at the moment, this might change
- rtems_status_code last_status;
-};
-
-#endif // _rtemsStatusCode_h_
diff --git a/c/src/lib/include/rtems++/rtemsTask.h b/c/src/lib/include/rtems++/rtemsTask.h
deleted file mode 100644
index 08156428fb..0000000000
--- a/c/src/lib/include/rtems++/rtemsTask.h
+++ /dev/null
@@ -1,171 +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.
-
- ------------------------------------------------------------------------
-
- rtemsTask class.
-
- This class allows the user to create a RTEMS task, or to access and
- manage an already existing task.
-
- The first constructor with the task parameters creates a RTEMS task
- object. The destructor of this object also deletes the task
- object. The last status code should be checked after construction to
- see if the create completed successfully.
-
- The second constructor connects to an existing task object. The last
- status code should be checked after construction to see if the
- task existed.
-
- The third constructor is a copy constructor. Connects to an existing
- object which is in scope.
-
- The RTEMS id is set to self in the default construction.
-
- The creation of the task object can be defered until after
- construction. This allows for static task objects to be created.
-
- RTEMS should be initialised before static constructors run, how-ever
- threads will will not. You need to watch the start-order.
-
- A task object can change state from an owner of a task to being
- connected to a task.
-
- Task objects connected to another task do not receive notification
- when the task connected to changes state.
-
- The sleep methods operate on the current thread not the task
- reference by this object.
-
- Mode control is through the rtemsTaskMode class.
-
- The rtemsTask class reserved notepad register 31.
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsTask_h_)
-#define _rtemsTask_h_
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- rtemsTask
-*/
-
-class rtemsTask
- : public rtemsStatusCode
-{
-public:
- enum FloatingPoint { fpoff = RTEMS_NO_FLOATING_POINT,
- fpon = RTEMS_FLOATING_POINT };
- enum Scope { local = RTEMS_LOCAL,
- global = RTEMS_GLOBAL };
-
- // only the first 4 characters of the name are taken
-
- // creates a task
- rtemsTask(const char* name,
- const rtems_task_priority initial_priority,
- const rtems_unsigned32 stack_size,
- const rtems_mode preemption = RTEMS_NO_PREEMPT,
- const rtems_mode timeslice = RTEMS_NO_TIMESLICE,
- const rtems_mode asr = RTEMS_NO_ASR,
- const rtems_interrupt_level interrupt_level = 0,
- const FloatingPoint floating_point = fpoff,
- const Scope scope = local);
-
- // connects to a task
- rtemsTask(const char *name, const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
-
- // copy and default constructors
- rtemsTask(const rtemsTask& task);
- rtemsTask();
-
- // only the creator's destructor will delete the actual object
- virtual ~rtemsTask();
-
- // create or destroy (delete) the task
- virtual const rtems_status_code create(const char* name,
- const rtems_task_priority initial_priority,
- const rtems_unsigned32 stack_size,
- const rtems_mode preemption = RTEMS_NO_PREEMPT,
- const rtems_mode timeslice = RTEMS_NO_TIMESLICE,
- const rtems_mode asr = RTEMS_NO_ASR,
- const rtems_interrupt_level interrupt_level = 0,
- const FloatingPoint floating_point = fpoff,
- const Scope scope = local);
- virtual const rtems_status_code destroy();
-
- // connect to an existing task object, will not be the owner
- const rtemsTask& operator=(const rtemsTask& task);
- virtual const rtems_status_code connect(const char *name,
- const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
-
- // run control
- virtual const rtems_status_code start(const rtems_task_argument argument);
- virtual const rtems_status_code restart(const rtems_task_argument argument);
- virtual const rtems_status_code suspend();
- virtual const rtems_status_code resume();
-
- // sleep control, the timeout is in micro-seconds
- virtual const rtems_status_code wake_after(const rtems_interval micro_secs);
- virtual const rtems_status_code wake_when(const rtems_time_of_day& tod);
-
- // priority control
- const rtems_status_code get_priority(rtems_task_priority& priority);
- const rtems_status_code set_priority(const rtems_task_priority priority);
- const rtems_status_code set_priority(const rtems_task_priority priority,
- rtems_task_priority& old_priority);
-
- // notepad control
- const rtems_status_code get_note(const rtems_unsigned32 notepad,
- rtems_unsigned32& note);
- const rtems_status_code set_note(const rtems_unsigned32 notepad,
- const rtems_unsigned32 note);
-
- // object id, and name
- const rtems_id id_is() const { return id; }
- const rtems_name name_is() const { return name; }
- const char *name_string() const { return name_str; }
-
-protected:
-
- // task entry point
- virtual void body(rtems_task_argument argument);
-
-private:
-
- // make the object to point to RTEMS_SELF
- void make_self();
-
- // task name
- rtems_name name;
- char name_str[5];
-
- // owner, true if this object owns the task
- // will delete the task when it destructs
- bool owner;
-
- // the rtems id, object handle
- rtems_id id;
-
- // the argument for the task, this class uses the actual argument
- // passed to RTEMS
- rtems_task_argument argument;
-
- // common entry point to the task
- static rtems_task origin(rtems_task_argument argument);
-};
-
-#endif // _rtemsTask_h_
-
diff --git a/c/src/lib/include/rtems++/rtemsTaskMode.h b/c/src/lib/include/rtems++/rtemsTaskMode.h
deleted file mode 100644
index 6d32897cc0..0000000000
--- a/c/src/lib/include/rtems++/rtemsTaskMode.h
+++ /dev/null
@@ -1,210 +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.
-
- ------------------------------------------------------------------------
-
- rtemsTaskMode class.
-
- This class allows the user to query or change the mode of an RTEMS
- task.
-
- This object only operates on the currently executing task.
-
- The standard flags defined in RTEMS are used.
-
- Methods are provided to operate on a group of modes which are
- required to be changed in a single operation. The mode and mask is
- specified by ORing the required flags.
-
- Methods are provided for accessing and controlling a specific
- mode. The returned value will only contain the requested mode's flags,
- and only the that mode will be changed when setting a mode.
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsTaskMode_h_)
-#define _rtemsTaskMode_h_
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- rtemsTaskMode
-*/
-
-class rtemsTaskMode
- : public rtemsStatusCode
-{
-public:
-
- rtemsTaskMode() {};
-
- // group mode control, OR the values together
- inline const rtems_status_code get_mode(rtems_mode& mode);
- inline const rtems_status_code set_mode(const rtems_mode mode,
- const rtems_mode mask);
- inline const rtems_status_code set_mode(const rtems_mode mode,
- const rtems_mode mask,
- rtems_mode& old_mode);
-
- // preemption control
- inline const rtems_status_code get_preemption_state(rtems_mode& preemption);
- inline const rtems_status_code set_preemption_state(const rtems_mode preemption);
- inline const rtems_status_code set_preemption_state(const rtems_mode preemption,
- rtems_mode& old_preemption);
- inline const boolean preemption_set(const rtems_mode preemption);
-
- // timeslice control
- inline const rtems_status_code get_timeslice_state(rtems_mode& timeslice);
- inline const rtems_status_code set_timeslice_state(const rtems_mode timeslice);
- inline const rtems_status_code set_timeslice_state(const rtems_mode timeslice,
- rtems_mode& old_timeslice);
- inline const boolean timeslice_set(const rtems_mode preemption);
-
- // async-sub-routine control
- inline const rtems_status_code get_asr_state(rtems_mode& asr);
- inline const rtems_status_code set_asr_state(const rtems_mode asr);
- inline const rtems_status_code set_asr_state(const rtems_mode asr,
- rtems_mode& old_asr);
- inline const boolean asr_set(const rtems_mode preemption);
-
- // interrupt mask control
- inline const rtems_status_code get_interrupt_level(rtems_interrupt_level& level);
- inline const rtems_status_code set_interrupt_level(const rtems_interrupt_level level);
- inline const rtems_status_code set_interrupt_level(const rtems_interrupt_level level,
- rtems_interrupt_level& old_level);
-};
-
-const rtems_status_code rtemsTaskMode::get_mode(rtems_mode& mode)
-{
- return set_status_code(rtems_task_mode(0, RTEMS_CURRENT_MODE, &mode));
-}
-
-const rtems_status_code rtemsTaskMode::set_mode(const rtems_mode mode,
- const rtems_mode mask)
-{
- rtems_mode old_mode;
- return set_status_code(rtems_task_mode(mode, mask, &old_mode));
-}
-
-const rtems_status_code rtemsTaskMode::set_mode(const rtems_mode mode,
- const rtems_mode mask,
- rtems_mode& old_mode)
-{
- return set_status_code(rtems_task_mode(mode, mask, &old_mode));
-}
-
-const rtems_status_code rtemsTaskMode::get_preemption_state(rtems_mode& preemption)
-{
- set_status_code(rtems_task_mode(0, RTEMS_CURRENT_MODE, &preemption));
- preemption &= RTEMS_PREEMPT_MASK;
- return last_status_code();
-}
-
-const rtems_status_code rtemsTaskMode::set_preemption_state(const rtems_mode preemption)
-{
- rtems_mode old_mode;
- return set_status_code(rtems_task_mode(preemption, RTEMS_PREEMPT_MASK, &old_mode));
-}
-
-const rtems_status_code rtemsTaskMode::set_preemption_state(const rtems_mode preemption,
- rtems_mode& old_preemption)
-{
- set_status_code(rtems_task_mode(preemption, RTEMS_PREEMPT_MASK, &old_preemption));
- old_preemption &= RTEMS_PREEMPT_MASK;
- return last_status_code();
-}
-
-const boolean rtemsTaskMode::preemption_set(const rtems_mode preemption)
-{
- return (preemption & RTEMS_PREEMPT_MASK) ? false : true;
-}
-
-const rtems_status_code rtemsTaskMode::get_timeslice_state(rtems_mode& timeslice)
-{
- set_status_code(rtems_task_mode(0, RTEMS_CURRENT_MODE, &timeslice));
- timeslice &= RTEMS_TIMESLICE_MASK;
- return last_status_code();
-}
-
-const rtems_status_code rtemsTaskMode::set_timeslice_state(const rtems_mode timeslice)
-{
- rtems_mode old_mode;
- return set_status_code(rtems_task_mode(timeslice, RTEMS_TIMESLICE_MASK, &old_mode));
-}
-
-const rtems_status_code rtemsTaskMode::set_timeslice_state(const rtems_mode timeslice,
- rtems_mode& old_timeslice)
-{
- set_status_code(rtems_task_mode(timeslice, RTEMS_TIMESLICE_MASK, &old_timeslice));
- old_timeslice &= RTEMS_TIMESLICE_MASK;
- return last_status_code();
-}
-
-const boolean rtemsTaskMode::timeslice_set(const rtems_mode timeslice)
-{
- return (timeslice & RTEMS_TIMESLICE_MASK) ? true : false;
-}
-
-const rtems_status_code rtemsTaskMode::get_asr_state(rtems_mode& asr)
-{
- set_status_code(rtems_task_mode(0, RTEMS_CURRENT_MODE, &asr));
- asr &= RTEMS_ASR_MASK;
- return last_status_code();
-}
-
-const rtems_status_code rtemsTaskMode::set_asr_state(const rtems_mode asr)
-{
- rtems_mode old_mode;
- return set_status_code(rtems_task_mode(asr, RTEMS_ASR_MASK, &old_mode));
-}
-
-const rtems_status_code rtemsTaskMode::set_asr_state(const rtems_mode asr,
- rtems_mode& old_asr)
-{
- set_status_code(rtems_task_mode(asr, RTEMS_ASR_MASK, &old_asr));
- old_asr &= RTEMS_ASR_MASK;
- return last_status_code();
-}
-
-const boolean rtemsTaskMode::asr_set(const rtems_mode asr)
-{
- return (asr & RTEMS_ASR_MASK) ? true : false;
-}
-
-const rtems_status_code rtemsTaskMode::get_interrupt_level(rtems_interrupt_level& level)
-{
- rtems_mode mode;
- set_status_code(rtems_task_mode(0, RTEMS_CURRENT_MODE, &mode));
- level = mode & RTEMS_INTERRUPT_MASK;
- return last_status_code();
-}
-
-const rtems_status_code rtemsTaskMode::set_interrupt_level(const rtems_interrupt_level level)
-{
- rtems_mode old_mode;
- return set_status_code(rtems_task_mode(level, RTEMS_INTERRUPT_MASK, &old_mode));
-}
-
-const rtems_status_code rtemsTaskMode::set_interrupt_level(rtems_interrupt_level level,
- rtems_interrupt_level& old_level)
-{
- set_status_code(rtems_task_mode(level, RTEMS_INTERRUPT_MASK, &old_level));
- old_level = old_level & RTEMS_INTERRUPT_MASK;
- return last_status_code();
-}
-
-#endif // _rtemsTaskMode_h_
-
-
-
-
diff --git a/c/src/lib/include/rtems++/rtemsTimer.h b/c/src/lib/include/rtems++/rtemsTimer.h
deleted file mode 100644
index 43401bab73..0000000000
--- a/c/src/lib/include/rtems++/rtemsTimer.h
+++ /dev/null
@@ -1,145 +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.
-
- ------------------------------------------------------------------------
-
- rtemsTimer class.
-
- This class allows the user to create a RTEMS timer.
-
- The trigger method is called when the timer expires. The method is
- called using the thread which calls the RTEMS 'rtems_clock_tick'
- method.
-
- Timers are always local to a node.
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsTimer_h_)
-#define _rtemsTimer_h_
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- rtemsTimer
-*/
-
-class rtemsTimer
- : public rtemsStatusCode
-{
-public:
- // only the first 4 characters of the name are taken,
-
- // create a timer object
- rtemsTimer(const char* name);
- rtemsTimer();
-
- // destroies the actual object
- virtual ~rtemsTimer();
-
- // create or destroy (delete) the timer
- virtual const rtems_status_code create(const char* name);
- virtual const rtems_status_code destroy();
-
- // timer control
- inline const rtems_status_code fire_after(const rtems_interval micro_secs);
- inline const rtems_status_code repeat_fire_at(const rtems_interval micro_secs);
- inline const rtems_status_code fire_when(const rtems_time_of_day& when);
-
- inline const rtems_status_code cancel();
- inline const rtems_status_code reset();
-
- // object id, and name
- const rtems_id id_is() const { return id; }
- const rtems_name name_is() const { return name; }
- const char *name_string() const { return name_str; }
-
-protected:
-
- // triggered method is called when the timer fires
- virtual void triggered() = 0;
-
-private:
- // not permitted
- rtemsTimer(const rtemsTimer& timer);
- rtemsTimer& operator=(const rtemsTimer& timer);
-
- // make this object reference an invalid RTEMS object
- void make_invalid();
-
- // semaphore name
- rtems_name name;
- char name_str[5];
-
- // repeat true restart the timer when it fires
- bool repeat;
-
- // the rtems id, object handle
- rtems_id id;
-
- // common timer handler
- static void common_handler(rtems_id id, void *user_data);
-};
-
-const rtems_status_code rtemsTimer::fire_after(const rtems_interval micro_secs)
-{
- repeat = false;
- rtems_interval usecs =
- micro_secs && (micro_secs < _TOD_Microseconds_per_tick) ?
- _TOD_Microseconds_per_tick : micro_secs;
- return set_status_code(rtems_timer_fire_after(id,
- TOD_MICROSECONDS_TO_TICKS(usecs),
- common_handler,
- this));
-}
-
-const rtems_status_code rtemsTimer::repeat_fire_at(const rtems_interval micro_secs)
-{
- repeat = true;
- rtems_interval usecs =
- micro_secs && (micro_secs < _TOD_Microseconds_per_tick) ?
- _TOD_Microseconds_per_tick : micro_secs;
- return set_status_code(rtems_timer_fire_after(id,
- TOD_MICROSECONDS_TO_TICKS(usecs),
- common_handler,
- this));
-}
-
-const rtems_status_code rtemsTimer::fire_when(const rtems_time_of_day& when)
-{
- return set_status_code(rtems_timer_fire_when(id,
- (rtems_time_of_day*) &when,
- common_handler,
- this));
-}
-
-const rtems_status_code rtemsTimer::cancel()
-{
- repeat = false;
- return set_status_code(rtems_timer_cancel(id));
-}
-
-const rtems_status_code rtemsTimer::reset()
-{
- return set_status_code(rtems_timer_reset(id));
-}
-
-#endif // _rtemsTimer_h_
-
-
-
-
-
-
-
-
diff --git a/c/src/lib/include/rtems/assoc.h b/c/src/lib/include/rtems/assoc.h
deleted file mode 100644
index 1982d654ac..0000000000
--- a/c/src/lib/include/rtems/assoc.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Rtems associativity routines. Mainly used to convert a value from
- * one space to another (eg: our errno's to host errno's and v.v)
- *
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_ASSOC_H
-#define _INCLUDE_ASSOC_H
-
-typedef struct {
- const char *name;
- unsigned32 local_value;
- unsigned32 remote_value;
-} rtems_assoc_t;
-
-/*
- * Flag/marker for optional default value in each table
- */
-
-#define RTEMS_ASSOC_DEFAULT_NAME "(default)"
-
-const rtems_assoc_t *rtems_assoc_ptr_by_name(const rtems_assoc_t *, const char *);
-const rtems_assoc_t *rtems_assoc_ptr_by_value(const rtems_assoc_t *, unsigned32);
-const rtems_assoc_t *rtems_assoc_ptr_by_remote(const rtems_assoc_t *, unsigned32);
-
-unsigned32 rtems_assoc_remote_by_local(const rtems_assoc_t *, unsigned32);
-unsigned32 rtems_assoc_local_by_remote(const rtems_assoc_t *, unsigned32);
-unsigned32 rtems_assoc_remote_by_name(const rtems_assoc_t *, const char *);
-unsigned32 rtems_assoc_local_by_name(const rtems_assoc_t *, const char *);
-const char *rtems_assoc_name_by_local(const rtems_assoc_t *, unsigned32);
-const char *rtems_assoc_name_by_remote(const rtems_assoc_t *, unsigned32);
-
-unsigned32 rtems_assoc_remote_by_local_bitfield(const rtems_assoc_t *, unsigned32);
-char *rtems_assoc_name_by_local_bitfield(const rtems_assoc_t *, unsigned32, char *);
-char *rtems_assoc_name_by_remote_bitfield(const rtems_assoc_t *, unsigned32, char *);
-unsigned32 rtems_assoc_local_by_remote_bitfield(const rtems_assoc_t *, unsigned32);
-
-
-#endif /* ! _INCLUDE_ASSOC_H */
diff --git a/c/src/lib/include/rtems/error.h b/c/src/lib/include/rtems/error.h
deleted file mode 100644
index a0698afb5d..0000000000
--- a/c/src/lib/include/rtems/error.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Defines and externs for rtems error reporting
- *
- * $Id$
- */
-
-#ifndef __RTEMS_ERROR_h
-#define __RTEMS_ERROR_h
-
-/*
- * rtems_error() and rtems_panic() support
- */
-
-#define RTEMS_ERROR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define RTEMS_ERROR_PANIC (RTEMS_ERROR_ERRNO / 2) /* err fatal; no return */
-#define RTEMS_ERROR_ABORT (RTEMS_ERROR_ERRNO / 4) /* err is fatal; panic */
-
-#define RTEMS_ERROR_MASK (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | \
- RTEMS_ERROR_PANIC) /* all */
-
-const char *rtems_status_text(rtems_status_code);
-int rtems_error(int error_code, const char *printf_format, ...);
-#ifdef __GNUC__
-void rtems_panic(const char *printf_format, ...);
-/*
- * We should be able to use this attribute but gcc complains that
- * rtems_panic does in fact return. :(
- *
- * __attribute__ ((__noreturn__));
- */
-#else
-void rtems_panic(const char *printf_format, ...);
-#endif
-
-extern int rtems_panic_in_progress;
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/include/rtems/libcsupport.h b/c/src/lib/include/rtems/libcsupport.h
deleted file mode 100644
index d007784526..0000000000
--- a/c/src/lib/include/rtems/libcsupport.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* libcsupport.h
- *
- * This include file contains the information regarding the
- * RTEMS specific support for the standard C library.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __LIBC_SUPPORT_h
-#define __LIBC_SUPPORT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <sys/types.h>
-
-void RTEMS_Malloc_Initialize(
- void *start,
- size_t length,
- size_t sbrk_amount
-);
-
-extern void malloc_dump(void);
-extern void malloc_walk(size_t source, size_t printf_enabled);
-extern void libc_init(int reentrant);
-extern int host_errno(void);
-extern void fix_syscall_errno(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/include/rtems/libio.h b/c/src/lib/include/rtems/libio.h
deleted file mode 100644
index dcdda85aec..0000000000
--- a/c/src/lib/include/rtems/libio.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * General purpose communication channel for RTEMS to allow UNIX/POSIX
- * system call behavior on top of RTEMS IO devices.
- *
- * TODO
- * stat(2)
- * unlink(2)
- * rename(2)
- *
- * $Id$
- */
-
-#ifndef _RTEMS_LIBIO_H
-#define _RTEMS_LIBIO_H
-
-#include <sys/stat.h>
-
-typedef unsigned32 rtems_libio_offset_t;
-
-/*
- * An open file data structure, indexed by 'fd'
- * TODO:
- * should really have a separate per/file data structure that this
- * points to (eg: size, offset, driver, pathname should be in that)
- */
-
-typedef struct {
- rtems_driver_name_t *driver;
- rtems_libio_offset_t size; /* size of file */
- rtems_libio_offset_t offset; /* current offset into the file */
- unsigned32 flags;
- char *pathname; /* opened pathname */
- Objects_Id sem;
- unsigned32 data0; /* private to "driver" */
- void *data1; /* ... */
-} rtems_libio_t;
-
-
-/*
- * param block for read/write
- * Note: it must include 'offset' instead of using iop's offset since
- * we can have multiple outstanding i/o's on a device.
- */
-
-typedef struct {
- rtems_libio_t *iop;
- rtems_libio_offset_t offset;
- unsigned8 *buffer;
- unsigned32 count;
- unsigned32 flags;
- unsigned32 bytes_moved;
-} rtems_libio_rw_args_t;
-
-/*
- * param block for open/close
- */
-
-typedef struct {
- rtems_libio_t *iop;
- unsigned32 flags;
- unsigned32 mode;
-} rtems_libio_open_close_args_t;
-
-/*
- * param block for ioctl
- */
-
-typedef struct {
- rtems_libio_t *iop;
- unsigned32 command;
- void *buffer;
- unsigned32 ioctl_return;
-} rtems_libio_ioctl_args_t;
-
-
-/*
- * Values for 'flag'
- */
-
-#define LIBIO_FLAGS_NO_DELAY 0x0001 /* return immediately if no data */
-#define LIBIO_FLAGS_READ 0x0002 /* reading */
-#define LIBIO_FLAGS_WRITE 0x0004 /* writing */
-#define LIBIO_FLAGS_LINE_BUFFERED 0x0008 /* line buffered io (^h, ^u, etc) */
-#define LIBIO_FLAGS_OPEN 0x0100 /* device is open */
-#define LIBIO_FLAGS_APPEND 0x0200 /* all writes append */
-#define LIBIO_FLAGS_CREATE 0x0400 /* create file */
-
-#define LIBIO_FLAGS_READ_WRITE (LIBIO_FLAGS_READ | LIBIO_FLAGS_WRITE)
-
-void rtems_libio_init(void);
-
-int __rtems_open(const char *pathname, unsigned32 flag, unsigned32 mode);
-int __rtems_close(int fd);
-int __rtems_read(int fd, void *buffer, unsigned32 count);
-int __rtems_write(int fd, const void *buffer, unsigned32 count);
-int __rtems_ioctl(int fd, unsigned32 command, void *buffer);
-int __rtems_lseek(int fd, rtems_libio_offset_t offset, int whence);
-int __rtems_fstat(int _fd, struct stat* _sbuf);
-
-/*
- * External I/O handlers
- */
-typedef struct {
- int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode);
- int (*close)(int fd);
- int (*read)(int fd, void *buffer, unsigned32 count);
- int (*write)(int fd, const void *buffer, unsigned32 count);
- int (*ioctl)(int fd, unsigned32 command, void *buffer);
- int (*lseek)(int fd, rtems_libio_offset_t offset, int whence);
-} rtems_libio_handler_t;
-
-void rtems_register_libio_handler(int handler_flag,
- const rtems_libio_handler_t *handler);
-
-#define RTEMS_FILE_DESCRIPTOR_TYPE_FILE 0x0000
-#define RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET 0x1000
-#define rtems_make_file_descriptor(fd,flags) ((fd)|(flags))
-#define rtems_file_descriptor_base(fd) ((fd) & 0x0FFF)
-#define rtems_file_descriptor_type(fd) ((fd) & 0xF000)
-#define rtems_file_descriptor_type_index(fd) ((((fd) & 0xF000) >> 12) - 1)
-
-/*
- * IOCTL values
- */
-
-#define RTEMS_IO_GET_ATTRIBUTES 1
-#define RTEMS_IO_SET_ATTRIBUTES 2
-#define RTEMS_IO_TCDRAIN 3
-
-/*
- * Callbacks from TERMIOS routines to device-dependent code
- */
-#include <termios.h>
-typedef struct rtems_termios_callbacks {
- int (*firstOpen)(int major, int minor, void *arg);
- int (*lastClose)(int major, int minor, void *arg);
- int (*pollRead)(int minor);
- int (*write)(int minor, const char *buf, int len);
- int (*setAttributes)(int minor, const struct termios *t);
- int (*stopRemoteTx)(int minor);
- int (*startRemoteTx)(int minor);
- int outputUsesInterrupts;
-} rtems_termios_callbacks;
-
-/*
- * Device-independent TERMIOS routines
- */
-void rtems_termios_initialize (void);
-rtems_status_code rtems_termios_open (
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg,
- const rtems_termios_callbacks *callbacks
- );
-rtems_status_code rtems_termios_close (void *arg);
-rtems_status_code rtems_termios_read (void *arg);
-rtems_status_code rtems_termios_write (void *arg);
-rtems_status_code rtems_termios_ioctl (void *arg);
-int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len);
-int rtems_termios_dequeue_characters (void *ttyp, int len);
-void rtems_termios_reserve_resources(
- rtems_configuration_table *configuration,
- rtems_unsigned32 number_of_devices
-);
-
-#endif /* _RTEMS_LIBIO_H */
diff --git a/c/src/lib/include/spurious.h b/c/src/lib/include/spurious.h
deleted file mode 100644
index 36fcaba904..0000000000
--- a/c/src/lib/include/spurious.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* spurious.h
- *
- * This file describes the Spurious Interrupt Driver for all boards.
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution 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 __SPURIOUS_h
-#define __SPURIOUS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define SPURIOUS_DRIVER_TABLE_ENTRY \
- { Spurious_Initialize, NULL, NULL, NULL, NULL, NULL }
-
-rtems_device_driver Spurious_Initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *,
- rtems_id,
- rtems_unsigned32 *
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/include/sys/filio.h b/c/src/lib/include/sys/filio.h
deleted file mode 100644
index b82a649c0f..0000000000
--- a/c/src/lib/include/sys/filio.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)filio.h 8.1 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_FILIO_H_
-#define _SYS_FILIO_H_
-
-#include <sys/ioccom.h>
-
-/* Generic file-descriptor ioctl's. */
-#define FIOCLEX _IO('f', 1) /* set close on exec on fd */
-#define FIONCLEX _IO('f', 2) /* remove close on exec */
-#define FIONREAD _IOR('f', 127, int) /* get # bytes to read */
-#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */
-#define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */
-#define FIOSETOWN _IOW('f', 124, int) /* set owner */
-#define FIOGETOWN _IOR('f', 123, int) /* get owner */
-
-#endif /* !_SYS_FILIO_H_ */
diff --git a/c/src/lib/include/sys/ioctl.h b/c/src/lib/include/sys/ioctl.h
deleted file mode 100644
index e3a69a5a7f..0000000000
--- a/c/src/lib/include/sys/ioctl.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)ioctl.h 8.6 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_IOCTL_H_
-#define _SYS_IOCTL_H_
-
-#include <sys/ttycom.h>
-
-/*
- * Pun for SunOS prior to 3.2. SunOS 3.2 and later support TIOCGWINSZ
- * and TIOCSWINSZ (yes, even 3.2-3.5, the fact that it wasn't documented
- * notwithstanding).
- */
-struct ttysize {
- unsigned short ts_lines;
- unsigned short ts_cols;
- unsigned short ts_xxx;
- unsigned short ts_yyy;
-};
-#define TIOCGSIZE TIOCGWINSZ
-#define TIOCSSIZE TIOCSWINSZ
-
-#include <sys/ioccom.h>
-
-#include <sys/filio.h>
-#include <sys/sockio.h>
-
-#endif /* !_SYS_IOCTL_H_ */
-
-/*
- * Keep outside _SYS_IOCTL_H_
- * Compatibility with old terminal driver
- *
- * Source level -> #define USE_OLD_TTY
- * Kernel level -> options COMPAT_43 or COMPAT_SUNOS
- */
-#if defined(USE_OLD_TTY) || defined(COMPAT_43) || defined(COMPAT_SUNOS)
-#include <sys/ioctl_compat.h>
-#endif
diff --git a/c/src/lib/include/sys/sockio.h b/c/src/lib/include/sys/sockio.h
deleted file mode 100644
index 020061170f..0000000000
--- a/c/src/lib/include/sys/sockio.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * 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.
- *
- * @(#)sockio.h 8.1 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_SOCKIO_H_
-#define _SYS_SOCKIO_H_
-
-#include <sys/ioccom.h>
-
-/* Socket ioctl's. */
-#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */
-#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */
-#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */
-#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */
-#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */
-#define SIOCSPGRP _IOW('s', 8, int) /* set process group */
-#define SIOCGPGRP _IOR('s', 9, int) /* get process group */
-
-#define SIOCADDRT _IOW('r', 10, struct ortentry) /* add route */
-#define SIOCDELRT _IOW('r', 11, struct ortentry) /* delete route */
-#define SIOCGETVIFCNT _IOWR('r', 15, struct sioc_vif_req)/* get vif pkt cnt */
-#define SIOCGETSGCNT _IOWR('r', 16, struct sioc_sg_req) /* get s,g pkt cnt */
-
-#define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */
-#define OSIOCGIFADDR _IOWR('i', 13, struct ifreq) /* get ifnet address */
-#define SIOCGIFADDR _IOWR('i', 33, struct ifreq) /* get ifnet address */
-#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */
-#define OSIOCGIFDSTADDR _IOWR('i', 15, struct ifreq) /* get p-p address */
-#define SIOCGIFDSTADDR _IOWR('i', 34, struct ifreq) /* get p-p address */
-#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */
-#define SIOCGIFFLAGS _IOWR('i', 17, struct ifreq) /* get ifnet flags */
-#define OSIOCGIFBRDADDR _IOWR('i', 18, struct ifreq) /* get broadcast addr */
-#define SIOCGIFBRDADDR _IOWR('i', 35, struct ifreq) /* get broadcast addr */
-#define SIOCSIFBRDADDR _IOW('i', 19, struct ifreq) /* set broadcast addr */
-#define OSIOCGIFCONF _IOWR('i', 20, struct ifconf) /* get ifnet list */
-#define SIOCGIFCONF _IOWR('i', 36, struct ifconf) /* get ifnet list */
-#define OSIOCGIFNETMASK _IOWR('i', 21, struct ifreq) /* get net addr mask */
-#define SIOCGIFNETMASK _IOWR('i', 37, struct ifreq) /* get net addr mask */
-#define SIOCSIFNETMASK _IOW('i', 22, struct ifreq) /* set net addr mask */
-#define SIOCGIFMETRIC _IOWR('i', 23, struct ifreq) /* get IF metric */
-#define SIOCSIFMETRIC _IOW('i', 24, struct ifreq) /* set IF metric */
-#define SIOCDIFADDR _IOW('i', 25, struct ifreq) /* delete IF addr */
-#define SIOCAIFADDR _IOW('i', 26, struct ifaliasreq)/* add/chg IF alias */
-
-#define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */
-#define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */
-#define SIOCGIFMTU _IOWR('i', 51, struct ifreq) /* get IF mtu */
-#define SIOCSIFMTU _IOW('i', 52, struct ifreq) /* set IF mtu */
-#define SIOCGIFPHYS _IOWR('i', 53, struct ifreq) /* get IF wire */
-#define SIOCSIFPHYS _IOW('i', 54, struct ifreq) /* set IF wire */
-#define SIOCSIFMEDIA _IOWR('i', 55, struct ifreq) /* set net media */
-#define SIOCGIFMEDIA _IOWR('i', 56, struct ifmediareq) /* get net media */
-
-#endif /* !_SYS_SOCKIO_H_ */
diff --git a/c/src/lib/include/sys/termios.h b/c/src/lib/include/sys/termios.h
deleted file mode 100644
index 71a2492724..0000000000
--- a/c/src/lib/include/sys/termios.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * POSIX termios implementation for RTEMS console device driver.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 TERMIOS_H
-#define TERMIOS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef unsigned char cc_t;
-typedef unsigned int speed_t;
-typedef unsigned int tcflag_t;
-
-#define NCCS 19
-struct termios {
- tcflag_t c_iflag; /* input mode flags */
- tcflag_t c_oflag; /* output mode flags */
- tcflag_t c_cflag; /* control mode flags */
- tcflag_t c_lflag; /* local mode flags */
- cc_t c_line; /* line discipline */
- cc_t c_cc[NCCS]; /* control characters */
-};
-
-/* c_cc characters */
-#define VINTR 0
-#define VQUIT 1
-#define VERASE 2
-#define VKILL 3
-#define VEOF 4
-#define VTIME 5
-#define VMIN 6
-#define VSWTC 7
-#define VSTART 8
-#define VSTOP 9
-#define VSUSP 10
-#define VEOL 11
-#define VREPRINT 12
-#define VDISCARD 13
-#define VWERASE 14
-#define VLNEXT 15
-#define VEOL2 16
-
-/* c_iflag bits */
-#define IGNBRK 0000001
-#define BRKINT 0000002
-#define IGNPAR 0000004
-#define PARMRK 0000010
-#define INPCK 0000020
-#define ISTRIP 0000040
-#define INLCR 0000100
-#define IGNCR 0000200
-#define ICRNL 0000400
-#define IUCLC 0001000
-#define IXON 0002000
-#define IXANY 0004000
-#define IXOFF 0010000
-#define IMAXBEL 0020000
-
-/* c_oflag bits */
-#define OPOST 0000001
-#define OLCUC 0000002
-#define ONLCR 0000004
-#define OCRNL 0000010
-#define ONOCR 0000020
-#define ONLRET 0000040
-#define OFILL 0000100
-#define OFDEL 0000200
-#define NLDLY 0000400
-#define NL0 0000000
-#define NL1 0000400
-#define CRDLY 0003000
-#define CR0 0000000
-#define CR1 0001000
-#define CR2 0002000
-#define CR3 0003000
-#define TABDLY 0014000
-#define TAB0 0000000
-#define TAB1 0004000
-#define TAB2 0010000
-#define TAB3 0014000
-#define XTABS 0014000
-#define BSDLY 0020000
-#define BS0 0000000
-#define BS1 0020000
-#define VTDLY 0040000
-#define VT0 0000000
-#define VT1 0040000
-#define FFDLY 0100000
-#define FF0 0000000
-#define FF1 0100000
-
-/* c_cflag bit meaning */
-#define CBAUD 0010017
-#define B0 0000000 /* hang up */
-#define B50 0000001
-#define B75 0000002
-#define B110 0000003
-#define B134 0000004
-#define B150 0000005
-#define B200 0000006
-#define B300 0000007
-#define B600 0000010
-#define B1200 0000011
-#define B1800 0000012
-#define B2400 0000013
-#define B4800 0000014
-#define B9600 0000015
-#define B19200 0000016
-#define B38400 0000017
-#define EXTA B19200
-#define EXTB B38400
-#define CSIZE 0000060
-#define CS5 0000000
-#define CS6 0000020
-#define CS7 0000040
-#define CS8 0000060
-#define CSTOPB 0000100
-#define CREAD 0000200
-#define PARENB 0000400
-#define PARODD 0001000
-#define HUPCL 0002000
-#define CLOCAL 0004000
-#define CBAUDEX 0010000
-#define B57600 0010001
-#define B115200 0010002
-#define B230400 0010003
-#define B460800 0010004
-#define CIBAUD 002003600000 /* input baud rate (not used) */
-#define CRTSCTS 020000000000 /* flow control */
-
-#define RTEMS_TERMIOS_NUMBER_BAUD_RATES 20
-
-/* c_lflag bits */
-#define ISIG 0000001
-#define ICANON 0000002
-#define XCASE 0000004
-#define ECHO 0000010
-#define ECHOE 0000020
-#define ECHOK 0000040
-#define ECHONL 0000100
-#define NOFLSH 0000200
-#define TOSTOP 0000400
-#define ECHOCTL 0001000
-#define ECHOPRT 0002000
-#define ECHOKE 0004000
-#define FLUSHO 0010000
-#define PENDIN 0040000
-#define IEXTEN 0100000
-
-/* tcflow() and TCXONC use these */
-#define TCOOFF 0
-#define TCOON 1
-#define TCIOFF 2
-#define TCION 3
-
-/* tcflush() and TCFLSH use these */
-#define TCIFLUSH 0
-#define TCOFLUSH 1
-#define TCIOFLUSH 2
-
-/* tcsetattr uses these */
-#define TCSANOW 0
-#define TCSADRAIN 1
-#define TCSAFLUSH 2
-
-int tcgetattr(int, struct termios *);
-int tcsetattr(int, int, struct termios *);
-int tcdrain(int);
-speed_t cfgetospeed(const struct termios *tp);
-int cfsetospeed(struct termios *tp, speed_t speed);
-speed_t cfgetispeed(const struct termios *tp);
-int cfsetispeed(struct termios *tp, speed_t speed);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* TERMIOS_H */
diff --git a/c/src/lib/include/sys/utsname.h b/c/src/lib/include/sys/utsname.h
deleted file mode 100644
index ca15230d40..0000000000
--- a/c/src/lib/include/sys/utsname.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* sys/utsname.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_SYS_UTSNAME_h
-#define __POSIX_SYS_UTSNAME_h
-
-#include <sys/times.h>
-#include <sys/types.h>
-
-/*
- * 4.4.1 Get System Name (Table 4-1), P1003.1b-1993, p. 90
- *
- * NOTE: The lengths of the strings in this structure are
- * just long enough to reliably contain the RTEMS information.
- * For example, the fields are not long enough to support
- * Internet hostnames.
- */
-
-struct utsname {
- char sysname[ 32 ]; /* Name of this implementation of the operating system */
- char nodename[ 32 ]; /* Name of this node within an implementation */
- /* specified communication network */
- char release[ 32 ]; /* Current release level of this implementation */
- char version[ 32 ]; /* Current version level of this release */
- char machine[ 32 ]; /* Name of the hardware type on which the system */
- /* is running */
-};
-
-/*
- * 4.4.1 Get System Name, P1003.1b-1993, p. 90
- */
-
-int uname(
- struct utsname *name
-);
-
-/*
- * 4.5.2 Get Process Times, P1003.1b-1993, p. 92
- */
-
-clock_t times(
- struct tms *buffer
-);
-
-#endif
-/* end of include file */
-
diff --git a/c/src/lib/include/timerdrv.h b/c/src/lib/include/timerdrv.h
deleted file mode 100644
index ed1ce2b9a2..0000000000
--- a/c/src/lib/include/timerdrv.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* timerdrv.h
- *
- * This file describes the Timer Driver for all boards.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIMER_DRIVER_h
-#define __TIMER_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* functions */
-
-void Timer_initialize( void );
-
-rtems_unsigned32 Read_timer( void );
-
-rtems_status_code Empty_function( void );
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/include/vmeintr.h b/c/src/lib/include/vmeintr.h
deleted file mode 100644
index 6593ba12a5..0000000000
--- a/c/src/lib/include/vmeintr.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * vmeintr.h
- *
- * This file is the specification for the VMEbus interface library
- * which should be provided by all BSPs for VMEbus Single Board
- * Computers but currently only a few do so.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __VME_INTERRUPT_h
-#define __VME_INTERRUPT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This defines the mask which is used to determine which
- * interrupt levels are affected by a call to this package.
- * The LSB corresponds to VME interrupt 0 and the MSB
- * to VME interrupt 7.
- *
- */
-
-typedef rtems_unsigned8 VME_interrupt_Mask;
-
-/*
- * VME_interrupt_Disable
- *
- */
-
-void VME_interrupt_Disable (
- VME_interrupt_Mask mask /* IN */
-);
-
-/*
- * VME_interrupt_Disable
- *
- */
-
-void VME_interrupt_Enable (
- VME_interrupt_Mask mask /* IN */
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* end of include file */
diff --git a/c/src/lib/include/zilog/z8036.h b/c/src/lib/include/zilog/z8036.h
deleted file mode 100644
index 1c53c8afac..0000000000
--- a/c/src/lib/include/zilog/z8036.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* z8036.h
- *
- * This include file defines information related to a Zilog Z8036
- * Counter/Timer/IO Chip. It is a memory mapped part.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: This file shares as much as possible with the include
- * file for the Z8536 via z8x36.h.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __Z8036_h
-#define __Z8036_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* macros */
-
-#define Z8036( ptr ) ((volatile struct z8036_map *)(ptr))
-
-#define Z8x36_STATE0 ( z8036 ) \
- { /*char *garbage = *(Z8036(z8036))->???; */ }
-
-
-#define Z8x36_WRITE( z8036, reg, data ) \
- (Z8036(z8036))->reg = (data)
-
-
-#define Z8x36_READ( z8036, reg, data ) \
- (Z8036(z8036))->reg = (data)
-
-/* structures */
-
-struct z8036_map {
-/* MAIN CONTROL REGISTERS (0x00-0x07) */
- rtems_unsigned8 MASTER_INTR; /* Master Interrupt Ctl Reg */
- rtems_unsigned8 MASTER_CFG; /* Master Configuration Ctl Reg */
- rtems_unsigned8 PORTA_VECTOR; /* Port A - Interrupt Vector */
- rtems_unsigned8 PORTB_VECTOR; /* Port B - Interrupt Vector */
- rtems_unsigned8 CNT_TMR_VECTOR; /* Counter/Timer Interrupt Vector */
- rtems_unsigned8 PORTC_DATA_POLARITY; /* Port C - Data Path Polarity */
- rtems_unsigned8 PORTC_DIRECTION; /* Port C - Data Direction */
- rtems_unsigned8 PORTC_SPECIAL_IO_CTL; /* Port C - Special IO Control */
-/* MOST OFTEN ACCESSED REGISTERS (0x08 - 0x0f) */
- rtems_unsigned8 PORTA_CMD_STATUS; /* Port A - Command Status Reg */
- rtems_unsigned8 PORTB_CMD_STATUS; /* Port B - Command Status Reg */
- rtems_unsigned8 CT1_CMD_STATUS; /* Ctr/Timer 1 - Command Status Reg */
- rtems_unsigned8 CT2_CMD_STATUS; /* Ctr/Timer 2 - Command Status Reg */
- rtems_unsigned8 CT3_CMD_STATUS; /* Ctr/Timer 3 - Command Status Reg */
- rtems_unsigned8 PORTA_DATA; /* Port A - Data */
- rtems_unsigned8 PORTB_DATA; /* Port B - Data */
- rtems_unsigned8 PORTC_DATA; /* Port C - Data */
-/* COUNTER/TIMER RELATED REGISTERS (0x10-0x1f) */
- rtems_unsigned8 CT1_CUR_CNT_MSB; /* Ctr/Timer 1 - Current Count (MSB) */
- rtems_unsigned8 CT1_CUR_CNT_LSB; /* Ctr/Timer 1 - Current Count (LSB) */
- rtems_unsigned8 CT2_CUR_CNT_MSB; /* Ctr/Timer 2 - Current Count (MSB) */
- rtems_unsigned8 CT2_CUR_CNT_LSB; /* Ctr/Timer 2 - Current Count (LSB) */
- rtems_unsigned8 CT3_CUR_CNT_MSB; /* Ctr/Timer 3 - Current Count (MSB) */
- rtems_unsigned8 CT3_CUR_CNT_LSB; /* Ctr/Timer 3 - Current Count (LSB) */
- rtems_unsigned8 CT1_TIME_CONST_MSB; /* Ctr/Timer 1 - Time Constant (MSB) */
- rtems_unsigned8 CT1_TIME_CONST_LSB; /* Ctr/Timer 1 - Time Constant (LSB) */
- rtems_unsigned8 CT2_TIME_CONST_MSB; /* Ctr/Timer 2 - Time Constant (MSB) */
- rtems_unsigned8 CT2_TIME_CONST_LSB; /* Ctr/Timer 2 - Time Constant (LSB) */
- rtems_unsigned8 CT3_TIME_CONST_MSB; /* Ctr/Timer 3 - Time Constant (MSB) */
- rtems_unsigned8 CT3_TIME_CONST_LSB; /* Ctr/Timer 3 - Time Constant (LSB) */
- rtems_unsigned8 CT1_MODE_SPEC; /* Ctr/Timer 1 - Mode Specification */
- rtems_unsigned8 CT2_MODE_SPEC; /* Ctr/Timer 2 - Mode Specification */
- rtems_unsigned8 CT3_MODE_SPEC; /* Ctr/Timer 3 - Mode Specification */
- rtems_unsigned8 CURRENT_VECTOR; /* Current Vector */
-/* PORT A SPECIFICATION REGISTERS (0x20 -0x27) */
- rtems_unsigned8 PORTA_MODE; /* Port A - Mode Specification */
- rtems_unsigned8 PORTA_HANDSHAKE; /* Port A - Handshake Specification */
- rtems_unsigned8 PORTA_DATA_POLARITY; /* Port A - Data Path Polarity */
- rtems_unsigned8 PORTA_DIRECTION; /* Port A - Data Direction */
- rtems_unsigned8 PORTA_SPECIAL_IO_CTL; /* Port A - Special IO Control */
- rtems_unsigned8 PORTA_PATT_POLARITY; /* Port A - Pattern Polarity */
- rtems_unsigned8 PORTA_PATT_TRANS; /* Port A - Pattern Transition */
- rtems_unsigned8 PORTA_PATT_MASK; /* Port A - Pattern Mask */
-/* PORT B SPECIFICATION REGISTERS (0x28-0x2f) */
- rtems_unsigned8 PORTB_MODE; /* Port B - Mode Specification */
- rtems_unsigned8 PORTB_HANDSHAKE; /* Port B - Handshake Specification */
- rtems_unsigned8 PORTB_DATA_POLARITY; /* Port B - Data Path Polarity */
- rtems_unsigned8 PORTB_DIRECTION; /* Port B - Data Direction */
- rtems_unsigned8 PORTB_SPECIAL_IO_CTL; /* Port B - Special IO Control */
- rtems_unsigned8 PORTB_PATT_POLARITY; /* Port B - Pattern Polarity */
- rtems_unsigned8 PORTB_PATT_TRANS; /* Port B - Pattern Transition */
- rtems_unsigned8 PORTB_PATT_MASK; /* Port B - Pattern Mask */
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/c/src/lib/include/zilog/z8530.h b/c/src/lib/include/zilog/z8530.h
deleted file mode 100644
index 60a3e3b771..0000000000
--- a/c/src/lib/include/zilog/z8530.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* z8530.h
- *
- * This include file defines information related to a Zilog Z8530
- * SCC Chip. It is a IO mapped part.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __Z8530_h
-#define __Z8530_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* macros */
-
-#define VOL8( ptr ) ((volatile rtems_unsigned8 *)(ptr))
-
-#define Z8x30_STATE0 ( z8530 ) \
- { char *garbage; \
- (garbage) = *(VOL8(z8530)) \
- }
-
-#define Z8x30_WRITE_CONTROL( z8530, reg, data ) \
- *(VOL8(z8530)) = (reg); \
- *(VOL8(z8530)) = (data)
-
-#define Z8x30_READ_CONTROL( z8530, reg, data ) \
- *(VOL8(z8530)) = (reg); \
- (data) = *(VOL8(z8530))
-
-#define Z8x30_WRITE_DATA( z8530, data ) \
- *(VOL8(z8530)) = (data);
-
-#define Z8x30_READ_DATA( z8530, data ) \
- (data) = *(VOL8(z8530));
-
-
-/* RR_0 Bit Definitions */
-
-#define RR_0_TX_BUFFER_EMPTY 0x04
-#define RR_0_RX_DATA_AVAILABLE 0x01
-
-/* read registers */
-
-#define RR_0 0x00
-#define RR_1 0x01
-#define RR_2 0x02
-#define RR_3 0x03
-#define RR_4 0x04
-#define RR_5 0x05
-#define RR_6 0x06
-#define RR_7 0x07
-#define RR_8 0x08
-#define RR_9 0x09
-#define RR_10 0x0A
-#define RR_11 0x0B
-#define RR_12 0x0C
-#define RR_13 0x0D
-#define RR_14 0x0E
-#define RR_15 0x0F
-
-/* write registers */
-
-#define WR_0 0x00
-#define WR_1 0x01
-#define WR_2 0x02
-#define WR_3 0x03
-#define WR_4 0x04
-#define WR_5 0x05
-#define WR_6 0x06
-#define WR_7 0x07
-#define WR_8 0x08
-#define WR_9 0x09
-#define WR_10 0x0A
-#define WR_11 0x0B
-#define WR_12 0x0C
-#define WR_13 0x0D
-#define WR_14 0x0E
-#define WR_15 0x0F
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/lib/include/zilog/z8536.h b/c/src/lib/include/zilog/z8536.h
deleted file mode 100644
index 0f0b5641e7..0000000000
--- a/c/src/lib/include/zilog/z8536.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* z8536.h
- *
- * This include file defines information related to a Zilog Z8536
- * Counter/Timer/IO Chip. It is a IO mapped part.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: This file shares as much as possible with the include
- * file for the Z8036 via z8x36.h.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __Z8536_h
-#define __Z8536_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* macros */
-
-#define VOL8( ptr ) ((volatile rtems_unsigned8 *)(ptr))
-
-#define Z8x36_STATE0 ( z8536 ) \
- { char *garbage; \
- (garbage) = *(VOL8(z8536+0xC)) \
- }
-
-#define Z8x36_WRITE( z8536, reg, data ) \
- *(VOL8(z8536+0xC)) = (reg); \
- *(VOL8(z8536+0xC)) = (data)
-
-#define Z8x36_READ( z8536, reg, data ) \
- *(VOL8(z8536+0xC)) = (reg); \
- (data) = *(VOL8(z8536+0xC))
-
-/* structures */
-
-/* MAIN CONTROL REGISTERS (0x00-0x07) */
-#define MASTER_INTR 0x00 /* Master Interrupt Ctl Reg */
-#define MASTER_CFG 0x01 /* Master Configuration Ctl Reg */
-#define PORTA_VECTOR 0x02 /* Port A - Interrupt Vector */
-#define PORTB_VECTOR 0x03 /* Port B - Interrupt Vector */
-#define CNT_TMR_VECTOR 0x04 /* Counter/Timer Interrupt Vector */
-#define PORTC_DATA_POLARITY 0x05 /* Port C - Data Path Polarity */
-#define PORTC_DIRECTION 0x06 /* Port C - Data Direction */
-#define PORTC_SPECIAL_IO_CTL 0x07 /* Port C - Special IO Control */
-
-/* MOST OFTEN ACCESSED REGISTERS (0x08 - 0x0f) */
-#define PORTA_CMD_STATUS 0x08 /* Port A - Command Status Reg */
-#define PORTB_CMD_STATUS 0x09 /* Port B - Command Status Reg */
-#define CT1_CMD_STATUS 0x0a /* Ctr/Timer 1 - Command Status Reg */
-#define CT2_CMD_STATUS 0x0b /* Ctr/Timer 2 - Command Status Reg */
-#define CT3_CMD_STATUS 0x0c /* Ctr/Timer 3 - Command Status Reg */
-#define PORTA_DATA 0x0d /* Port A - Data */
-#define PORTB_DATA 0x0e /* Port B - Data */
-#define PORTC_DATA 0x0f /* Port C - Data */
-
-/* COUNTER/TIMER RELATED REGISTERS (0x10-0x1f) */
-#define CT1_CUR_CNT_MSB 0x10 /* Ctr/Timer 1 - Current Count (MSB) */
-#define CT1_CUR_CNT_LSB 0x11 /* Ctr/Timer 1 - Current Count (LSB) */
-#define CT2_CUR_CNT_MSB 0x12 /* Ctr/Timer 2 - Current Count (MSB) */
-#define CT2_CUR_CNT_LSB 0x13 /* Ctr/Timer 2 - Current Count (LSB) */
-#define CT3_CUR_CNT_MSB 0x14 /* Ctr/Timer 3 - Current Count (MSB) */
-#define CT3_CUR_CNT_LSB 0x15 /* Ctr/Timer 3 - Current Count (LSB) */
-#define CT1_TIME_CONST_MSB 0x16 /* Ctr/Timer 1 - Time Constant (MSB) */
-#define CT1_TIME_CONST_LSB 0x17 /* Ctr/Timer 1 - Time Constant (LSB) */
-#define CT2_TIME_CONST_MSB 0x18 /* Ctr/Timer 2 - Time Constant (MSB) */
-#define CT2_TIME_CONST_LSB 0x19 /* Ctr/Timer 2 - Time Constant (LSB) */
-#define CT3_TIME_CONST_MSB 0x1a /* Ctr/Timer 3 - Time Constant (MSB) */
-#define CT3_TIME_CONST_LSB 0x1b /* Ctr/Timer 3 - Time Constant (LSB) */
-#define CT1_MODE_SPEC 0x1c /* Ctr/Timer 1 - Mode Specification */
-#define CT2_MODE_SPEC 0x1d /* Ctr/Timer 2 - Mode Specification */
-#define CT3_MODE_SPEC 0x1e /* Ctr/Timer 3 - Mode Specification */
-#define CURRENT_VECTOR 0x1f /* Current Vector */
-
-/* PORT A SPECIFICATION REGISTERS (0x20 -0x27) */
-#define PORTA_MODE 0x20 /* Port A - Mode Specification */
-#define PORTA_HANDSHAKE 0x21 /* Port A - Handshake Specification */
-#define PORTA_DATA_POLARITY 0x22 /* Port A - Data Path Polarity */
-#define PORTA_DIRECTION 0x23 /* Port A - Data Direction */
-#define PORTA_SPECIAL_IO_CTL 0x24 /* Port A - Special IO Control */
-#define PORTA_PATT_POLARITY 0x25 /* Port A - Pattern Polarity */
-#define PORTA_PATT_TRANS 0x26 /* Port A - Pattern Transition */
-#define PORTA_PATT_MASK 0x27 /* Port A - Pattern Mask */
-
-/* PORT B SPECIFICATION REGISTERS (0x28-0x2f) */
-#define PORTB_MODE 0x28 /* Port B - Mode Specification */
-#define PORTB_HANDSHAKE 0x29 /* Port B - Handshake Specification */
-#define PORTB_DATA_POLARITY 0x2a /* Port B - Data Path Polarity */
-#define PORTB_DIRECTION 0x2b /* Port B - Data Direction */
-#define PORTB_SPECIAL_IO_CTL 0x2c /* Port B - Special IO Control */
-#define PORTB_PATT_POLARITY 0x2d /* Port B - Pattern Polarity */
-#define PORTB_PATT_TRANS 0x2e /* Port B - Pattern Transition */
-#define PORTB_PATT_MASK 0x2f /* Port B - Pattern Mask */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/lib/libbsp/Makefile.in b/c/src/lib/libbsp/Makefile.in
deleted file mode 100644
index 14437a408a..0000000000
--- a/c/src/lib/libbsp/Makefile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# shmdr is a portable shared memory MPCI layer
-# We only build it if HAS_MP was defined
-MP_DRIVERS_yes_V = shmdr
-MP_DRIVERS = $(MP_DRIVERS_$(HAS_MP)_V)
-
-SUB_DIRS=$(MP_DRIVERS)
-
-# If we are building a "real" BSP, then we need to descend into the
-# appropriate CPU specific directory. The bare BSP is a special
-# case which can be built for any CPU and it resides at the same
-# level as the CPUs. If we are building the bare BSP, then descend
-# into that directory.
-
-ifeq ($(RTEMS_BSP),bare)
-SUB_DIRS += bare
-else
-SUB_DIRS += $(wildcard $(RTEMS_CPU))
-endif
diff --git a/c/src/lib/libbsp/README b/c/src/lib/libbsp/README
deleted file mode 100644
index c3b978b6cb..0000000000
--- a/c/src/lib/libbsp/README
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# $Id$
-#
-
-Board Support Package library
-
-This directory contains the source for the libbsp.a library.
-For each supported board $(RTEMS_BSP) there is a standard
-set of functions which must be provided in the BSP:
-
- + start up initialization
- + exit support
- + set vector
- + console IO support
- + drivers
-
-In addition, the BSP also determines the memory usage by providing
-any necessary linker scripts.
-
-There are also "generic" drivers in this directory. Currently
-they are shmdr and stubdr.
-
-Some of the supplied generic drivers (for example, shared memory) require
-target board specific support routines.
-
-NOTE: The library libbsp.a is actually built by $(RTEMS_BSP)/wrapup/Makefile.
-
-To execute all of the test in the RTEMS Tests Suites the following
-device drivers must be supplied:
-
- + Clock Tick
- + IO Driver Support
- + Timer
- + Shared Memory Driver Support
-
-The Timer Driver is used only by the Timing Test Suite (c/src/tests/tmtests/*).
-These tests are used to generate the execution times for RTEMS found in the
-flyers. It is recommended that these tests be run to verify a port to a new
-CPU or with a newly developed BSP. Looking at the times as compared to a
-known CPU and target can yield insights into potential performance problems
-in either the port, the BSP, or the target hardware.
-
-The Shared Memory Support is only required to execute the Multiprocessor
-Test Suite (c/src/tests/mptests/*). Multiprocessing is not a required part
-of a BSP.
-
diff --git a/c/src/lib/libbsp/a29k/Makefile.in b/c/src/lib/libbsp/a29k/Makefile.in
deleted file mode 100644
index f049e9b2e8..0000000000
--- a/c/src/lib/libbsp/a29k/Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# Descend into the $(RTEMS_BSP_FAMILY) directory
-SUB_DIRS=$(RTEMS_BSP_FAMILY)
diff --git a/c/src/lib/libbsp/a29k/portsw/Makefile.in b/c/src/lib/libbsp/a29k/portsw/Makefile.in
deleted file mode 100644
index 48f89c3690..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SRCS=README
-
-all: $(SRCS)
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include startup console wrapup
diff --git a/c/src/lib/libbsp/a29k/portsw/README b/c/src/lib/libbsp/a29k/portsw/README
deleted file mode 100644
index f18b4f65b6..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/README
+++ /dev/null
@@ -1,71 +0,0 @@
-#
-# README,v 1.2 1995/05/31 16:56:03 joel Exp
-#
-# This is a sample hardware description file for a BSP. This comment
-# block does not have to appear in a real one. The intention of this
-# file is to provide a central place to look when searching for
-# information about a board when starting a new BSP. For example,
-# you may want to find an existing timer driver for the chip you are
-# using on your board. It is easier to grep for the chip name in
-# all of the HARDWARE files than to peruse the source tree. Hopefully,
-# making the HARDDWARE files accurate will also alleviate the common
-# problem of not knowing anything about a board based on its BSP
-# name.
-#
-# NOTE: If you have a class of peripheral chip on board which
-# is not in this list please add it to this file so
-# others will also use the same name.
-#
-# Timer resolution is the way it is configured in this BSP.
-# On a counting timer, this is the length of time which
-# corresponds to 1 count.
-#
-# $Id$
-
-
-BSP NAME: fastsbc1
-BOARD: Fasssst Computers, Fast SBC-1
-BUS: SchoolBus
-CPU FAMILY: i386
-CPU: Intel Hexium
-COPROCESSORS: Witch Hex87
-MODE: 32 bit mode
-
-DEBUG MONITOR: HexBug
-
-PERIPHERALS
-===========
-TIMERS: Intel i8254
- RESOLUTION: .0001 microseconds
-SERIAL PORTS: Zilog Z8530 (with 2 ports)
-REAL-TIME CLOCK: RTC-4
-DMA: Intel i8259
-VIDEO: none
-SCSI: none
-NETWORKING: none
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: RTC-4
-IOSUPP DRIVER: Zilog Z8530 port A
-SHMSUPP: polled and interrupts
-TIMER DRIVER: Intel i8254
-TTY DRIVER: stub only
-
-STDIO
-=====
-PORT: Console port 0
-ELECTRICAL: RS-232
-BAUD: 9600
-BITS PER CHARACTER: 8
-PARITY: None
-STOP BITS: 1
-
-NOTES
-=====
-
-(1) 900 Mhz and 950 Mhz versions.
-
-(2) 1 Gb or 2 Gb RAM.
-
-(3) PC compatible if HexBug not enabled.
diff --git a/c/src/lib/libbsp/a29k/portsw/console/Makefile.in b/c/src/lib/libbsp/a29k/portsw/console/Makefile.in
deleted file mode 100644
index a7cdd9f374..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/console/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console serial
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/concntl.h
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
diff --git a/c/src/lib/libbsp/a29k/portsw/console/concntl.h b/c/src/lib/libbsp/a29k/portsw/console/concntl.h
deleted file mode 100644
index f3b3f5e4d7..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/console/concntl.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * $Id$
- */
-
-typedef enum
-{
- CON_KBHIT,
- CON_GET_RAW_BYTE,
- CON_SEND_RAW_BYTE
-} console_ioctl_t;
-
-typedef struct
-{
- console_ioctl_t ioctl_type;
- unsigned32 param;
-} console_ioctl_request_t;
diff --git a/c/src/lib/libbsp/a29k/portsw/console/console.c b/c/src/lib/libbsp/a29k/portsw/console/console.c
deleted file mode 100644
index fb5a761df1..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/console/console.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * This file contains the template for a console IO package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 NO_BSP_INIT
-
-
-/* only one of the following can be defined */
-#define SERIAL_INPUT /* use serial input */
-/* #define HIF_INPUT */ /* use HIF input */
-
-#if defined(SERIAL_INPUT) && defined(HIF_INPUT)
-#error SERIAL_INPUT and HIF_INPUT cannot both be defined!!!
-#endif
-
-/* both of the following can be defined */
-#define SERIAL_OUTPUT /* remove to disable serial port console output */
-/* #define HIF_OUTPUT */ /* remove to disable HIF console output */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include "serial.h"
-#include "concntl.h"
-
-#ifndef lint
-static char _sccsid[] = "@(#)console.c 09/12/96 1.13\n";
-#endif
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- if ( arg )
- {
- if ( console_duartinit(minor,*(unsigned32*)arg) )
- return RTEMS_INVALID_NUMBER;
- }
- else
- {
- if ( console_duartinit(1,9600) || console_duartinit(0,9600) )
- {
- return RTEMS_INVALID_NUMBER;
- }
- }
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-}
-
-
-/* is_character_ready
- *
- * This routine returns TRUE if a character is available.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_boolean is_character_ready(
- char *ch
-)
-{
- *ch = '\0'; /* return NULL for no particular reason */
- return(TRUE);
-}
-
-/* inbyte
- *
- * This routine reads a character from the SOURCE.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- * character read from SOURCE
- */
-
-char inbyte( unsigned int minor )
-{
- /*
- * If polling, wait until a character is available.
- */
-#ifdef HIF_INPUT
- char retch;
- _read( 1, &retch, 1 );
- return retch;
-#endif
-#ifdef SERIAL_INPUT
- return console_sps_getc( minor );
-#endif
-}
-
-/* outbyte
- *
- * This routine transmits a character out the SOURCE. It may support
- * XON/XOFF flow control.
- *
- * Input parameters:
- * ch - character to be transmitted
- *
- * Output parameters: NONE
- */
-
-void outbyte( unsigned int minor,
- char ch
-)
-{
- /*
- * If polling, wait for the transmitter to be ready.
- * Check for flow control requests and process.
- * Then output the character.
- */
-
-#ifdef SERIAL_OUTPUT
- console_sps_putc( minor, ch );
-#endif
-
- /*
- * Carriage Return/New line translation.
- */
-
- if ( ch == '\n' )
- outbyte( minor, '\r' );
-}
-
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- unsigned8 *buffer;
- unsigned32 maximum;
- unsigned32 count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte(minor);
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- outbyte( minor, '\n' ); /* newline */
- break;
- }
- else if (buffer[ count ] == '\b' && count > 0 )
- {
- outbyte( minor, '\b' ); /* move back one space */
- outbyte( minor, ' ' ); /* erase the character */
- outbyte( minor, '\b' ); /* move back one space */
- count-=2;
- }
- else
- outbyte( minor, buffer[ count ] ); /* echo the character */
- }
-
- rw_args->bytes_moved = count;
- return (count > 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- unsigned8 *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
-#ifdef HIF_OUTPUT
- _write( 0, buffer, maximum );
-#endif
-#ifdef SERIAL_OUTPUT
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte(minor,'\r');
- }
- outbyte( minor,buffer[ count ] );
- }
-#endif
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- if (!arg)
- return RTEMS_INVALID_ADDRESS;
-
- switch( ((console_ioctl_request_t *)arg)->ioctl_type )
- {
- case CON_KBHIT:
- /* check if keyboard was hit */
- ((console_ioctl_request_t *)arg)->param = console_sps_kbhit(minor);
- break;
-
- case CON_GET_RAW_BYTE:
- ((console_ioctl_request_t *)arg)->param = inbyte(minor);
- break;
-
- case CON_SEND_RAW_BYTE:
- outbyte(minor, ((console_ioctl_request_t *)arg)->param);
- break;
-
- default:
- break;
- }
-
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/a29k/portsw/console/serial.c b/c/src/lib/libbsp/a29k/portsw/console/serial.c
deleted file mode 100644
index 4b07dd19ae..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/console/serial.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * $Id$
- */
-
-#include "serial.h"
-#include "rtems.h"
-
-
-typedef unsigned char uchar ; /* Abbreviations */
-typedef unsigned short ushort ;
-typedef unsigned long ulong ;
-
-#if 0
-#define BAUDRate 9600 /* Fixed Uart baud rate */
-#endif
-
-#define SEND_WAIT 0x0100 /* Waiting to send character */
-
-#define TDR(i)
-
-
-/********************************************************************
- *** 16552 specific DUART definitions.
- *******************************************************************/
-
-
-typedef struct uart_16552 DUART ;
-
-#ifndef notdef
-struct uart_16552
-{
- short u_short[8*2] ;
-} ;
-#define u_reg(n) u_short[2*(n)]
-
-#else
-
-struct uart_16552
-{
- int u_int[8] ;
-} ;
-
-#define u_reg(n) u_int[(n)]
-#endif
-
-#define u_tdr u_reg(0) /* Transmit Data Register (write) */
-#define u_rdr u_reg(0) /* Receive Data Register (read) */
-#define u_dlr0 u_reg(0) /* Divisor Latch Register (lsb) */
-
-#define u_ier u_reg(1) /* Interrupt Enable Register */
-#define u_dlr1 u_reg(1) /* Divisor Latch Register (msb) */
-
-#define u_iir u_reg(2) /* Interrupt ID Register (read) */
-#define u_fcr u_reg(2) /* FIFO Control Register (write) */
-#define u_afr u_reg(2) /* Alternate Funct Reg (read/write) */
-
-#define u_lcr u_reg(3) /* Line Control Register */
-
-#define u_mcr u_reg(4) /* Modem Control Register */
-
-#define u_lsr u_reg(5) /* Line Status Register */
-
-#define u_msr u_reg(6) /* Modem Status Register */
-
-#define u_spr u_reg(7) /* Scratch Pad Register */
-
-#define uart1 ((volatile DUART *)0x90000380)
-#define uart2 ((volatile DUART *)0x90000300)
-
-#define NUM_UARTS 2
-static volatile DUART * duart[NUM_UARTS] = { uart1, uart2 };
-
-
-extern void display_msg(void);
-/*extern int sprintf();*/
-
-
-#define board_rev_reg ((volatile short *)0x90000080)
-
-static unsigned int shift_val = 0;
-
-/***********************************************************************
- *** 16552 DUART initialization routine.
- ***********************************************************************/
-
-int
-console_duartinit(unsigned int uart_num, unsigned int BAUDRate)
-{
- register uchar tmp;
- unsigned int board_rev = *board_rev_reg & 0xff;
-
- switch( BAUDRate )
- {
- case 1200:
- case 2400:
- case 9600:
- case 19200:
- case 38400:
- case 57600:
- break;
- default:
- /* unknown baud rate */
- return FALSE;
- }
-
- /* the board rev register should never be 0xff.
- if it equals 0xff, assume that we're on old hardware
- that needs all values shifted by 8. */
- if ( board_rev == 0xff )
- shift_val = 8;
- else
- shift_val = 0;
-
- if ( uart_num >= NUM_UARTS )
- return -1;
-
- duart[uart_num]->u_lcr = 0x80<<shift_val ; /* Set DLAB bit to 1 */
-
- duart[uart_num]->u_dlr0 = ((115200 / BAUDRate) >> 0)<<shift_val ; /* Set baud */
- duart[uart_num]->u_dlr1 = ((115200 / BAUDRate) >> 8)<<shift_val ; /* rate */
-
- duart[uart_num]->u_lcr = 0x03<<shift_val ; /* 8 bits, no parity, 1 stop */
-
- duart[uart_num]->u_mcr = 0x0b<<shift_val ; /* Assert RTS, DTR & OUT2 */
-
- duart[uart_num]->u_fcr = 0x00<<shift_val ; /* Clear 16552 FIFOs */
- /* Is the following write of 0x01 needed? */
- /* Let's try it without... */
- duart[uart_num]->u_fcr = 0xc7<<shift_val ; /* Enable 16552 FIFOs */
-
- duart[uart_num]->u_ier = 0x07<<shift_val ; /* Enable transmit/receive ints */
-
- tmp = duart[uart_num]->u_lsr ; /* Re-arm interrupts */
- tmp = duart[uart_num]->u_rdr ;
- tmp = duart[uart_num]->u_msr ;
-
- return(0);
-}
-
- /*------------ end of duartinit function ----------------*/
-
-
- /***********************************************************************
- *** Transmit character to host.
- ***********************************************************************/
-
-int console_sps_putc(unsigned int uart_num, int ch)
-{
- register unsigned short stat;
-
- if ( uart_num >= NUM_UARTS )
- return -1;
-
- /*
- * Pause until there is room in the UART transmit
- * buffer.
- */
-
- do {
- stat = duart[uart_num]->u_lsr>>shift_val;
- } while (!(stat & 0x40));
-
- /*
- * Transmit data. (Junk)
- */
-
- TDR(ch)
-
- duart[uart_num]->u_tdr = ch<<shift_val ;
-
- return ch;
-
-}
-
-
- /***********************************************************************
- *** Read character from host.
- ***********************************************************************/
-
-int console_sps_getc(unsigned int uart_num)
-{
- register unsigned short stat;
- register int ch;
-
- if ( uart_num >= NUM_UARTS )
- return -1;
-
- stat = duart[uart_num]->u_lsr>>shift_val;
- while (!(stat & 0x01))
- {
- rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
- stat = duart[uart_num]->u_lsr>>shift_val;
- }
-
- ch = duart[uart_num]->u_rdr>>shift_val;
-
- return ch;
-}
-
- /***********************************************************************
- *** check character from host.
- ***********************************************************************/
-
-int console_sps_kbhit(unsigned int uart_num)
-{
- register unsigned short stat;
-
- if ( uart_num >= NUM_UARTS )
- return -1;
-
- stat = duart[uart_num]->u_lsr>>shift_val;
- return ((stat & 0x01));
-}
-
-
-
-
diff --git a/c/src/lib/libbsp/a29k/portsw/console/serial.h b/c/src/lib/libbsp/a29k/portsw/console/serial.h
deleted file mode 100644
index f57787dc17..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/console/serial.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * $Id$
- */
-
-int console_duartinit(unsigned int uart_num, unsigned int BAUDRate);
-int console_sps_putc(unsigned int uart_num, int ch);
-int console_sps_getc(unsigned int uart_num);
-int console_sps_kbhit(unsigned int uart_num);
diff --git a/c/src/lib/libbsp/a29k/portsw/include/Makefile.in b/c/src/lib/libbsp/a29k/portsw/include/Makefile.in
deleted file mode 100644
index 7d8581095f..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/a29k/portsw/include/bsp.h b/c/src/lib/libbsp/a29k/portsw/include/bsp.h
deleted file mode 100644
index d3fb0630a8..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/include/bsp.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* bsp.h
- *
- * This include file contains all board IO definitions.
- *
- * XXX : put yours in here
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __NO_BSP_h
-#define __NO_BSP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <console.h>
-#include <clockdrv.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Stuff for Time Test 27
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), 0, 1 )
-
-#define Cause_tm27_intr()
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( microseconds ) \
- { \
- }
-
-/* Constants */
-#define CPU_CLOCK_RATE_MHZ 25
-
-#define RAM_START 0
-#define RAM_END 0x100000
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-no_cpu_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/a29k/portsw/include/coverhd.h b/c/src/lib/libbsp/a29k/portsw/include/coverhd.h
deleted file mode 100644
index fedd788455..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/include/coverhd.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- * This file should be updated after running the C overhead timing
- * test. Once this update has been performed, the RTEMS Time Test
- * Suite should be rebuilt to account for these overhead times in the
- * timing results.
- *
- * NOTE: If these are all zero, then the times reported include
- * all calling overhead including passing of arguments.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
-#define CALLING_OVERHEAD_TASK_CREATE 0
-#define CALLING_OVERHEAD_TASK_IDENT 0
-#define CALLING_OVERHEAD_TASK_START 0
-#define CALLING_OVERHEAD_TASK_RESTART 0
-#define CALLING_OVERHEAD_TASK_DELETE 0
-#define CALLING_OVERHEAD_TASK_SUSPEND 0
-#define CALLING_OVERHEAD_TASK_RESUME 0
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
-#define CALLING_OVERHEAD_TASK_MODE 0
-#define CALLING_OVERHEAD_TASK_GET_NOTE 0
-#define CALLING_OVERHEAD_TASK_SET_NOTE 0
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 0
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
-#define CALLING_OVERHEAD_CLOCK_GET 0
-#define CALLING_OVERHEAD_CLOCK_SET 0
-#define CALLING_OVERHEAD_CLOCK_TICK 0
-
-#define CALLING_OVERHEAD_TIMER_CREATE 0
-#define CALLING_OVERHEAD_TIMER_IDENT 0
-#define CALLING_OVERHEAD_TIMER_DELETE 0
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 0
-#define CALLING_OVERHEAD_TIMER_RESET 0
-#define CALLING_OVERHEAD_TIMER_CANCEL 0
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
-
-#define CALLING_OVERHEAD_EVENT_SEND 0
-#define CALLING_OVERHEAD_EVENT_RECEIVE 0
-#define CALLING_OVERHEAD_SIGNAL_CATCH 0
-#define CALLING_OVERHEAD_SIGNAL_SEND 0
-#define CALLING_OVERHEAD_PARTITION_CREATE 0
-#define CALLING_OVERHEAD_PARTITION_IDENT 0
-#define CALLING_OVERHEAD_PARTITION_DELETE 0
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
-#define CALLING_OVERHEAD_REGION_CREATE 0
-#define CALLING_OVERHEAD_REGION_IDENT 0
-#define CALLING_OVERHEAD_REGION_DELETE 0
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
-#define CALLING_OVERHEAD_PORT_CREATE 0
-#define CALLING_OVERHEAD_PORT_IDENT 0
-#define CALLING_OVERHEAD_PORT_DELETE 0
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 0
-#define CALLING_OVERHEAD_IO_OPEN 0
-#define CALLING_OVERHEAD_IO_CLOSE 0
-#define CALLING_OVERHEAD_IO_READ 0
-#define CALLING_OVERHEAD_IO_WRITE 0
-#define CALLING_OVERHEAD_IO_CONTROL 0
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/a29k/portsw/shmsupp/Makefile.in b/c/src/lib/libbsp/a29k/portsw/shmsupp/Makefile.in
deleted file mode 100644
index b4967b93cb..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/shmsupp/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/shmsupp.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=addrconv getcfg lock mpisr
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/a29k/portsw/shmsupp/addrconv.c b/c/src/lib/libbsp/a29k/portsw/shmsupp/addrconv.c
deleted file mode 100644
index 123616382f..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/shmsupp/addrconv.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Shm_Convert_address
- *
- * No address range conversion is required.
- *
- * Input parameters:
- * address - address to convert
- *
- * Output parameters:
- * returns - converted address
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-#ifndef lint
-static char _sccsid[] = "@(#)addrconv.c 04/08/96 1.1\n";
-#endif
-
-void *Shm_Convert_address(
- void *address
-)
-{
- return ( address );
-}
diff --git a/c/src/lib/libbsp/a29k/portsw/shmsupp/getcfg.c b/c/src/lib/libbsp/a29k/portsw/shmsupp/getcfg.c
deleted file mode 100644
index a7c0348728..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/shmsupp/getcfg.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* void Shm_Get_configuration( localnode, &shmcfg )
- *
- * This routine initializes, if necessary, and returns a pointer
- * to the Shared Memory Configuration Table for the XXX target.
- *
- * INPUT PARAMETERS:
- * localnode - local node number
- * shmcfg - address of pointer to SHM Config Table
- *
- * OUTPUT PARAMETERS:
- * *shmcfg - pointer to SHM Config Table
- *
-XXX: FIX THE COMMENTS BELOW WHEN THE CPU IS KNOWN
- * NOTES: The XYZ does not have an interprocessor interrupt.
- *
- * The following table illustrates the configuration limitations:
- *
- * BUS MAX
- * MODE ENDIAN NODES
- * ========= ====== =======
- * POLLED BIG 2+
- * INTERRUPT **** NOT SUPPORTED ****
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-#ifndef lint
-static char _sccsid[] = "@(#)getcfg.c 04/08/96 1.1\n";
-#endif
-
-/*
- * configured if currently polling of interrupt driven
- */
-
-#define INTERRUPT 0 /* XXX: */
-#define POLLING 1 /* XXX: fix me -- is polling ONLY!!! */
-
-
-shm_config_table BSP_shm_cfgtbl;
-
-void Shm_Get_configuration(
- rtems_unsigned32 localnode,
- shm_config_table **shmcfg
-)
-{
- BSP_shm_cfgtbl.base = 0x0;
- BSP_shm_cfgtbl.length = 1 * MEGABYTE;
- BSP_shm_cfgtbl.format = SHM_BIG;
-
- /*
- * Override cause_intr or shm_isr if your target has
- * special requirements.
- */
-
- BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt;
-
-#ifdef NEUTRAL_BIG
- BSP_shm_cfgtbl.convert = NULL_CONVERT;
-#else
- BSP_shm_cfgtbl.convert = CPU_swap_u32;
-#endif
-
- BSP_shm_cfgtbl.poll_intr = POLLED_MODE;
- BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT;
-
- *shmcfg = &BSP_shm_cfgtbl;
-}
diff --git a/c/src/lib/libbsp/a29k/portsw/shmsupp/lock.c b/c/src/lib/libbsp/a29k/portsw/shmsupp/lock.c
deleted file mode 100644
index 6d5884c530..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/shmsupp/lock.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Shared Memory Lock Routines
- *
- * This shared memory locked queue support routine need to be
- * able to lock the specified locked queue. Interrupts are
- * disabled while the queue is locked to prevent preemption
- * and deadlock when two tasks poll for the same lock.
- * previous level.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-#ifndef lint
-static char _sccsid[] = "@(#)lock.c 04/08/96 1.1\n";
-#endif
-
-/*
- * Shm_Initialize_lock
- *
- * Initialize the lock for the specified locked queue.
- */
-
-void Shm_Initialize_lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- lq_cb->lock = LQ_UNLOCKED;
-}
-
-/* void _Shm_Lock( &lq_cb )
- *
- * This shared memory locked queue support routine locks the
- * specified locked queue. It disables interrupts to prevent
- * a deadlock condition.
- */
-
-void Shm_Lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
- rtems_unsigned32 *lockptr = &lq_cb->lock;
- rtems_unsigned32 lock_value;
-
- lock_value = 0x80000000;
- rtems_interrupt_disable( isr_level );
-
- Shm_isrstat = isr_level;
- while ( lock_value ) {
- asm volatile( ""
- : "=r" (lockptr), "=r" (lock_value)
- : "0" (lockptr), "1" (lock_value)
- );
- /*
- * If not available, then may want to delay to reduce load on lock.
- */
-
- if ( lock_value )
- delay( 10 ); /* approximately 10 microseconds */
- }
-}
-
-/*
- * Shm_Unlock
- *
- * Unlock the lock for the specified locked queue.
- */
-
-void Shm_Unlock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
-
- lq_cb->lock = SHM_UNLOCK_VALUE;
- isr_level = Shm_isrstat;
- rtems_interrupt_enable( isr_level );
-}
-
diff --git a/c/src/lib/libbsp/a29k/portsw/shmsupp/mpisr.c b/c/src/lib/libbsp/a29k/portsw/shmsupp/mpisr.c
deleted file mode 100644
index d27d54b76d..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/shmsupp/mpisr.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Shm_isr_nobsp()
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-#ifndef lint
-static char _sccsid[] = "@(#)mpisr.c 04/08/96 1.1\n";
-#endif
-
-rtems_isr Shm_isr_nobsp( void )
-{
- /*
- * If this routine has to do anything other than the mpisr.c
- * found in the generic driver, then copy the contents of the generic
- * mpisr.c and augment it to satisfy this particular board. Typically,
- * you need to have a board specific mpisr.c when the interrupt
- * must be cleared.
- *
- * If the generic mpisr.c satisifies your requirements, then
- * remove this routine from your target's shmsupp/mpisb.c file.
- * Then simply install the generic Shm_isr in the Shm_setvec
- * routine below.
- */
-}
-
-/* Shm_setvec
- *
- * This driver routine sets the SHM interrupt vector to point to the
- * driver's SHM interrupt service routine.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void Shm_setvec( void )
-{
- /* XXX: FIX ME!!! */
-}
diff --git a/c/src/lib/libbsp/a29k/portsw/start/Makefile.in b/c/src/lib/libbsp/a29k/portsw/start/Makefile.in
deleted file mode 100644
index f89c5a7e6f..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/start/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=crt0 register
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-PGM=${ARCH}/crt0.o ${ARCH}/register.o
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/a29k/portsw/start/amd.ah b/c/src/lib/libbsp/a29k/portsw/start/amd.ah
deleted file mode 100644
index 69f34f173e..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/start/amd.ah
+++ /dev/null
@@ -1,517 +0,0 @@
-; /* @(#)amd.ah 1.1 96/05/23 08:56:58, TEI */
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Initialization values for registers after RESET
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; /* $Id$ */
-;
-;* File information and includes.
-
- .file "amd.ah"
- .ident "@(#)amd.ah 1.1 96/05/23 08:56:58, TEI"
-
-
-
-;
-;* AMD PROCESSOR SPECIFIC VALUES...
-;
-
-;
-;* Processor revision levels...
-;
-
-; PRL values: 31-28 27-24
-; Am29000 0 x
-; Am29005 1 x
-; Am29050 2 x
-; Am29035 3 x
-; Am29030 4 x
-; Am29200 5 x
-; Am29205 5 1x
-; Am29240 6 0
-; Manx 7 0
-; Cougar 8 0
-
-
- .equ AM29000_PRL, 0x00
-
- .equ AM29005_PRL, 0x10
-
- .equ AM29050_PRL, 0x20
-
- .equ AM29035_PRL, 0x30
-
- .equ AM29030_PRL, 0x40
-
- .equ AM29200_PRL, 0x50
-
- .equ AM29205_PRL, 0x58
-
- .equ AM29240_PRL, 0x60
-
- .equ AM29040_PRL, 0x70
-
- .equ MANX_PRL, 0x70
-
- .equ COUGAR_PRL, 0x80
-
-;
-;* data structures sizes.
-;
- .equ CFGINFO_SIZE, 16*4
-
- .equ PGMINFO_SIZE, 16*4
-
- .equ VARARGS_SPACE, 16*4
-
- .equ WINDOWSIZE, 0x80
-;
-;* Am29027 Mode registers
-;
-
- .equ Am29027Mode1, 0x0fc00820
-
- .equ Am29027Mode2, 0x00001375
-
-
-
-;* Processor Based Equates and Defines
-
- .equ SIG_SYNC, -1
-
- .equ ENABLE, (SM)
-
- .equ DISABLE, (ENABLE | DI | DA)
-
- .equ DISABLE_FZ, (FZ | ENABLE | DI | DA)
-
- .equ CLR_TRAP, (FZ | DA)
-
- .equ InitOPS, (TD | SM | (3<<IMShift) | DI | DA)
-
- .equ InitCPS, (TD | SM | (0<<IMShift) | DI | DA)
-
- .equ InitCPS1, (TD | SM | (0<<IMShift) | DI )
-
- .equ CPS_TMR, (SM | (0<<IMShift) | DI)
-
- .equ CPS_INT0, (TD | SM | (0<<IMShift))
-
- .equ CPS_TMRINT0, (SM | (0<<IMShift))
-
- .equ InitCFG, 0x0
-
- .equ InitRBP, (B0|B1|B2|B3|B4|B5)
-
- .equ TMC_VALUE, 0xFFFFFF
-
- .equ TMR_VALUE, (IE | TMC_VALUE)
-
-
-
-
-
-
-;* 29205 specific (internal) peripheral initialization constants.
-
-; Current Processor Status (CPS) Register.
-; Old Processor Status Register (OPS).
-
- .equ DA, 0x00001
- .equ DI, 0x00002
- .equ IMShift,0x2
- .equ SM, 0x00010
- .equ PI, 0x00020
- .equ PD, 0x00040
- .equ WM, 0x00080
- .equ RE, 0x00100
- .equ LK, 0x00200
- .equ FZ, 0x00400
- .equ TU, 0x00800
- .equ TP, 0x01000
- .equ TE, 0x02000
- .equ IP, 0x04000
- .equ CA, 0x08000
- .equ MM, 0x10000
- .equ TD, 0x20000
-
-; Configuration Register (CFG)
-
- .equ CD, 0x01
- .equ CP, 0x02
- .equ BO, 0x04
- .equ RV, 0x08
- .equ VF, 0x10
- .equ DW, 0x20
- .equ CO, 0x40
- .equ EE, 0x80
- .equ IDShift, 8
- .equ CFG_ID, 0x100
- .equ ILShift, 9
- .equ CFG_ILMask, 0x600
- .equ DDShift, 11
- .equ CFG_DD, 0x800
- .equ DLShift, 12
- .equ CFG_DLMask, 0x3000
- .equ PCEShift, 14
- .equ CFG_PCE, 0x4000
- .equ PMBShift, 16
- .equ D16, 0x8000
- .equ TBOShift, 23
- .equ PRLShift, 24
-
-; Channel Control Register (CHC)
-
- .equ CV, 0x1
- .equ NN, 0x2
- .equ TRShift, 2
- .equ TF, 0x400
- .equ PER, 0x800
- .equ LA, 0x1000
- .equ ST, 0x2000
- .equ ML, 0x4000
- .equ LS, 0x8000
- .equ CRShift, 16
- .equ CNTLShift, 24
- .equ CEShift, 31
- .equ WBERShift, 31
-
-; Register Bank Protect (RBP)
- .equ B0, 0x1
- .equ B1, 0x2
- .equ B2, 0x4
- .equ B3, 0x8
- .equ B4, 0x10
- .equ B5, 0x20
- .equ B6, 0x40
- .equ B7, 0x80
- .equ B8, 0x100
- .equ B9, 0x200
- .equ B10, 0x400
- .equ B11, 0x800
- .equ B12, 0x1000
- .equ B13, 0x2000
- .equ B14, 0x4000
- .equ B15, 0x8000
-
-; Timer Counter
-
- .equ TCVMask, 0xffffff
-
-; Timer Reload Register
-
- .equ IE, 0x1000000
- .equ IN, 0x2000000
- .equ OV, 0x4000000
- .equ TRVMAsk, 0xffffff
-
-; MMU Configuration
-
- .equ PSShift, 8
- .equ PS0Shift, 8
- .equ PS1Shift, 12
-
-; LRU Recommendation (LRU)
- .equ LRUMask, 0xff
-
-; Reason Vector (RSN)
- .equ RSNMask, 0xff
-
-; Region Mapping Address (RMA0 | RMA1)
- .equ PBAMask,0xffff
- .equ VBAShift, 16
-
-; Region Mapping Control (RMC0 | RMC1)
- .equ TIDMask, 0xff
- .equ RMC_UE, 0x100
- .equ RMC_UW, 0x200
- .equ RMC_UR, 0x400
- .equ RMC_SE, 0x800
- .equ RMC_SW, 0x1000
- .equ RMC_SR, 0x2000
- .equ RMC_VE, 0x4000
- .equ RMC_IO, 0x10000
- .equ RGSShift, 17
- .equ RMC_PGMShift, 22
-
-; Instruction breakpoint Control (IBC0 | IBC1)
- .equ BPIDMask, 0xff
- .equ BTE, 0x100
- .equ BRM, 0x200
- .equ IBC_BSY, 0x400
- .equ BEN, 0x800
- .equ BHO, 0x1000
-
-; Cache Data Register (CDR)
- .equ CDR_US, 0x1
- .equ P, 0x2
- .equ CDR_V, 0x4
- .equ IATAGShift, 20
-
-; Cache Interface Register (CIR)
- .equ CPTRShift, 2
- .equ CIR_RW, 0x1000000
- .equ FSELShift, 28
-
-; Indirect Pointer A, B, C (IPA, IPB, IPC)
- .equ IPShift, 2
-
-; ALU Status (ALU)
- .equ FCMask, 0x1F
- .equ BPShift, 5
- .equ C, 0x80
- .equ Z, 0x100
- .equ N, 0x200
- .equ ALU_V, 0x400
- .equ DF, 0x800
-
-; Byte Pointer
- .equ BPMask, 0x3
-
-; Load/Store Count Remaining (CR)
- .equ CRMask, 0xff
-
-; Floating Point Environment (FPE)
- .equ NM, 0x1
- .equ RM, 0x2
- .equ VM, 0x4
- .equ UM, 0x8
- .equ XM, 0x10
- .equ DM, 0x20
- .equ FRMShift, 6
- .equ FF, 0x100
- .equ ACFShift, 9
-
-; Integer Environment (INTE)
- .equ MO, 0x1
- .equ DO, 0x2
-
-; Floating Point Status (FPS)
- .equ NS, 0x1
- .equ RS, 0x2
- .equ VS, 0x4
- .equ FPS_US, 0x8
- .equ XS, 0x10
- .equ DS, 0x20
- .equ NT, 0x100
- .equ RT, 0x200
- .equ VT, 0x400
- .equ UT, 0x800
- .equ XT, 0x1000
- .equ DT, 0x2000
-
-; Exception Opcode (EXOP)
- .equ IOPMask, 0xff
-
-; TLB Entry Word 0
-; .equ TIDMask, 0xff already defined above
- .equ TLB_UE, 0x100
- .equ TLB_UW, 0x200
- .equ TLB_UR, 0x400
- .equ TLB_SE, 0x800
- .equ TLB_SW, 0x1000
- .equ TLB_SR, 0x2000
- .equ TLB_VE, 0x4000
- .equ VTAGShift, 15
-
-; TLB Entry Word 1
- .equ TLB_IO, 0x1
- .equ U, 0x2
- .equ TLB_PGMShift, 6
- .equ RPNShift, 10
-
-; Am29200 ROM Control bits.
- .equ RMCT_DW0Shift, 29
- .equ RMCT_DW1Shift, 21
- .equ RMCT_DW2Shift, 13
- .equ RMCT_DW3Shift, 5
-
-; Am29200 DRAM Control bits.
- .equ DW3, (1<<18)
- .equ DW2, (1<<22)
- .equ DW1, (1<<26)
- .equ DW0, (1<<30)
-
- ; Internal peripheral address assignments.
- .equ RMCT, 0x80000000
- .equ RMCF, 0x80000004
- .equ DRCT, 0x80000008
- .equ DRCF, 0x8000000C
- .equ DRM0, 0x80000010
- .equ DRM1, 0x80000014
- .equ DRM2, 0x80000018
- .equ DRM3, 0x8000001C
- .equ PIACT0, 0x80000020
- .equ PIACT1, 0x80000020
- .equ ICT, 0x80000028
- .equ DMCT0, 0x80000030
- .equ DMAD0, 0x80000034
- .ifdef revA
- .equ TAD0, 0x80000036
- .equ TCN0, 0x8000003A
- .else
- .equ TAD0, 0x80000070 ; default
- .equ TCN0, 0x8000003C ; default
- .endif
- .equ DMCN0, 0x80000038
- .equ DMCT1, 0x80000040
- .equ DMAD1, 0x80000044
- .equ DMCN1, 0x80000048
- .equ SPCT, 0x80000080
- .equ SPST, 0x80000084
- .equ SPTH, 0x80000088
- .equ SPRB, 0x8000008C
- .equ BAUD, 0x80000090
- .equ PPCT, 0x800000C0
- .equ PPST, 0x800000C1
- .equ PPDT, 0x800000C4
- .equ POCT, 0x800000D0
- .equ PIN, 0x800000D4
- .equ POUT, 0x800000D8
- .equ POEN, 0x800000DC
- .equ VCT, 0x800000E0
- .equ TOP, 0x800000E4
- .equ SIDE, 0x800000E8
- .equ VDT, 0x800000EC
-
- ; Interrupt Controller Register bits.
- .equ TXDI, (1<<5)
- .equ RXDI, (1<<6)
- .equ RXSI, (1<<7)
- .equ PPI, (1<<11)
- .equ DMA1I, (1<<13)
- .equ DMA0I, (1<<14)
- .equ IOPIMask, (0xFF<<16)
- .equ VDI, (1<<27)
- .equ ICT200_I, (TXDI|RXDI|RXSI|PPI|DMA1I|DMA0I|IOPIMask|VDI)
- .equ ICT205_I, (TXDI|RXDI|RXSI|PPI|DMA1I|DMA0I|IOPIMask|VDI)
-
- ; Serial port Initialization bits
- .equ NO_PARITY, 0
-
-
- ; SPST bits
- .equ THREShift, 22
-
-;* REGISTER Addresses
-
- .equ ROMCntlRegAddr, 0x80000000
-
- .equ ROMCfgRegAddr, 0x80000004
-
- .equ DRAMCntlRegAddr, 0x80000008
-
- .equ DRAMCfgRegAddr, 0x8000000C
-
- .equ DRAMMap0RegAddr, 0x80000010
-
- .equ DRAMMap1RegAddr, 0x80000014
-
- .equ DRAMMap2RegAddr, 0x80000018
-
- .equ DRAMMap3RegAddr, 0x8000001C
-
- .equ PIACntl0RegAddr, 0x80000020
-
- .equ PIACntl1RegAddr, 0x80000024
-
- .equ INTRCntlRegAddr, 0x80000028
-
- .equ DMACntl0RegAddr, 0x80000030
-
- .equ DMACntl1RegAddr, 0x80000040
-
- .equ SERPortCntlRegAddr, 0x80000080
-
- .equ SERPortStatRegAddr, 0x80000084
-
- .equ SERPortTHLDRegAddr, 0x80000088
-
- .equ SERPortRbufRegAddr, 0x8000008C
-
- .equ SERPortBaudRegAddr, 0x80000090
-
- .equ PARPortCntlRegAddr, 0x800000C0
-
- .equ PIOCntlRegAddr, 0x800000D0
-
- .equ PIOInpRegAddr, 0x800000D4
-
- .equ PIOOutRegAddr, 0x800000D8
-
- .equ PIOOutEnaRegAddr, 0x800000DC
-
- .equ VCTCntlRegAddr, 0x800000E0
-
-;
-;* Control constants
-;
-
-;* AM29030 Timer related constants.
-
- .equ TMR_IE, 0x01000000
-
- .equ TMR_IN, 0x02000000
-
- .equ TMR_OV, 0x04000000
-
- .equ TMC_INITCNT, 1613
-
-;
-;* System initialization values.
-;
-
- .equ __os_version, 0x0001 ;
-
- .equ STACKSize, 0x8000 ;
-
- .equ PGMExecMode, 0x0000 ;
-
- .equ TSTCK_OFST, 28 * 4
-
- .equ CSTCK_OFST, 29 * 4
-
- .equ TMSTCK_OFST, 30 * 4
-
- .equ CMSTCK_OFST, 31 * 4
-
- .equ CTXSW_OK, 0xA55A ; ctx switch ok
-
- .set NV_STARTOFST, 0x20 ; 32 bytes
-
- .set NV_BAUDOFST, 0x00 ; 00 bytes
-
- .set reg_cir, 29
-
- .set reg_cdr, 30
-
- .equ MSG_BUFSIZE, 0x1000 ; serial buffer size
-
- .equ ILLOPTRAP, 0
-
- .equ UATRAP, 1
-
- .equ PVTRAP, 5
-
- .equ UITLBMISSTRAP, 8
-
- .equ UDTLBMISSTRAP, 9
-
- .equ TIMERTRAP, 14
-
- .equ TRACETRAP, 15
-
- .equ XLINXTRAP, 16
-
- .equ SERIALTRAP, 17
-
- .equ SLOWTMRTRAP, 18
-
- .equ PORTTRAP, 19
-
- .equ SVSCTRAP, 80
-
- .equ SVSCTRAP1, 81
-
- .equ V_CACHETRAP, 66 ;
-
- .equ V_SETSERVICE, 67 ;
diff --git a/c/src/lib/libbsp/a29k/portsw/start/pswmacro.ah b/c/src/lib/libbsp/a29k/portsw/start/pswmacro.ah
deleted file mode 100644
index a994719c58..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/start/pswmacro.ah
+++ /dev/null
@@ -1,442 +0,0 @@
-; /* @(#)pswmacro.ah 1.1 96/05/23 08:56:58, TEI */
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; macros: Do_install and init_TLB
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; /* $Id$ */
-
-;* File information and includes.
-
- .file "macro.ah"
- .ident "@(#)pswmacro.ah 1.1 96/05/23 08:56:58, TEI"
-
-
- .macro CONST32, RegName, RegValue
- const RegName, RegValue
- consth RegName, RegValue
- .endm
-
- .macro CONSTX, RegName, RegValue
- .if (RegValue) <= 0x0000ffff
- const RegName, RegValue
- .else
- const RegName, RegValue
- consth RegName, RegValue
- .endif
- .endm
-
- .macro PRODEV, RegName
- srl RegName, RegName, 24
- .endm
-
-;
-;* MACRO TO INSTALL VECTOR TABLE ENTRIES
-;
-
-;* Assumes vector table address in v0
-
- .macro _setvec, trapnum, trapaddr
- mfsr v0, vab ;
- const v2, trapnum ;
- sll v1, v2, 2 ;
- add v1, v1, v0 ; v0 has location of vector tab
-
- const v2, trapaddr ;
- consth v2, trapaddr ;
- store 0, 0, v2, v1 ;
- nop ;
- .endm
-
- .macro syscall, name
- const tav, HIF_@name ;
- asneq V_SYSCALL, gr1, gr1 ;
- nop ;
- nop ;
- .endm
-
-
-
-;* MACRO TO INSTALL VECTOR TABLE ENTRIES
-
- .macro Do_Install, V_Number, V_Address
- const lr4, V_Address
- consth lr4, V_Address
- const lr3, V_Number * 4
- consth lr3, V_Number * 4
- call lr0, V_Install
- nop
- .endm
-
- .macro Do_InstallX, V_Number, V_Address
- const lr4, V_Address
- consth lr4, V_Address
- const lr3, V_Number * 4
- consth lr3, V_Number * 4
- call lr0, V_InstallX
- nop
- .endm
-
-
-
-; push a register onto the stack
- .macro pushreg, reg, sp
- sub sp, sp, 4 ; adjust stack pointer
- store 0, 0, reg, sp ; push register
- .endm
-
- .macro push, sp, reg
- sub sp, sp, 4
- store 0, 0, reg, sp
- .endm
-
-; pop the register from stack
- .macro popreg, reg, sp
- load 0, 0, reg, sp ; pop register
- add sp, sp, 4 ; adjust stack pointer
- .endm
- .macro pop, reg, sp
- load 0, 0, reg, sp
- add sp, sp, 4
- .endm
-
-; push a special register onto stack
- .macro pushspcl, spcl, tmpreg, sp
- sub sp, sp, 4 ; adjust stack pointer
- mfsr tmpreg, spcl ; get spcl reg
- store 0, 0, tmpreg, sp ; push onto stack
- .endm
-
- .macro pushsr, sp, reg, sreg
- mfsr reg, sreg
- sub sp, sp, 4
- store 0, 0, reg, sp
- .endm
-
-; pop a special register from stack
- .macro popspcl, spcl, tmpreg, sp
- load 0, 0, tmpreg, sp ; pop from stack
- add sp, sp, 4 ; adjust stack pointer
- mtsr spcl, tmpreg ; set spcl reg
- .endm
-
- .macro popsr, sreg, reg, sp
- load 0, 0, reg, sp
- add sp, sp, 4
- mtsr sreg, reg
- .endm
-
-;
-; save freeze mode registers on memory stack.
-;
-
- .macro SaveFZState, tmp1, tmp2
-
- ; save freeze mode registers.
-
- pushspcl pc0, tmp1, msp
- pushspcl pc1, tmp1, msp
- pushspcl alu, tmp1, msp
-
- pushspcl cha, tmp1, msp
- pushspcl chd, tmp1, msp
- pushspcl chc, tmp1, msp
-
- pushspcl ops, tmp1, msp
-
- ; turn freeze off
-
- const tmp2, FZ
- mfsr tmp1, cps
- andn tmp1, tmp1, tmp2
- mtsr cps, tmp1
- .endm
-
-; restore freeze mode registers from memory stack.
-
- .macro RestoreFZState, tmp1, tmp2
-
- ; turn freeze on
-
- const tmp2, (FZ|DI|DA)
- mfsr tmp1, cps
- or tmp1, tmp1, tmp2
- mtsr cps, tmp1
-
- ; restore freeze mode registers.
-
- popspcl ops, tmp1, msp
- popspcl chc, tmp1, msp
- popspcl chd, tmp1, msp
- popspcl cha, tmp1, msp
- popspcl alu, tmp1, msp
- popspcl pc1, tmp1, msp
- popspcl pc0, tmp1, msp
- .endm
-
-;
-;*
-;
- .equ WS, 512 ; window size
- .equ RALLOC, 4 * 4 ; stack alloc for C
- .equ SIGCTX_UM_SIZE, 40 * 4 ;
- .equ SIGCTX_RFB, (38) * 4 ; user mode saved
- .equ SIGCTX_SM_SIZE, 12 * 4 ;
- .equ SIGCTX_SIG, (11)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_GR1, (10)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_RAB, (9)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_PC0, (8)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_PC1, (7)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_PC2, (6)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_CHC, (3)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_OPS, (1)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_TAV, (0)*4 + SIGCTX_UM_SIZE ;
-
- .macro sup_sv
- add it2, trapreg, 0 ; transfer signal #
- sub msp, msp, 4 ;
- store 0, 0, it2, msp ; save signal number
- sub msp, msp, 4 ; push gr1
-
- store 0, 0, gr1, msp ;
- sub msp, msp, 4 ; push rab
- store 0, 0, rab, msp ;
- const it0, WS ; Window size
-
- sub rab, rfb, it0 ; set rab = rfb-512
- pushsr msp, it0, PC0 ; save program counter0
- pushsr msp, it0, PC1 ; save program counter1
- pushsr msp, it0, PC2 ; save program counter2
-
- pushsr msp, it0, CHA ; save channel address
- pushsr msp, it0, CHD ; save channel data
- pushsr msp, it0, CHC ; save channel control
- pushsr msp, it0, ALU ; save alu
-
- pushsr msp, it0, OPS ; save ops
- sub msp, msp, 4 ;
- store 0, 0, tav, msp ; push tav
- mtsrim chc, 0 ; no loadm/storem
-
- mfsr it0, ops ; get ops value
- const it1, (TD | DI) ; disable interrupts
- consth it1, (TD | DI) ; disable interrupts
- or it0, it0, it1 ; set bits
-
- mtsr ops, it0 ; set new ops
- const it0, sigcode ; signal handler
- consth it0, sigcode ; signal handler
- mtsr pc1, it0 ; store pc1
-
- add it1, it0, 4 ; next addr
- mtsr pc0, it1 ; store pc1 location
- iret ; return
- nop ; ALIGN
- .endm
-
- .macro sig_return
- mfsr it0, cps ; get processor status
- const it1, FZ|DA ; Freeze + traps disable
- or it0, it0, it1 ; to set FZ+DA
- mtsr cps, it0 ; in freeze mode
-
- load 0, 0, tav, msp ; restore tav
- add msp, msp, 4 ;
-
- popsr OPS,it0, msp ;
- popsr ALU,it0, msp ;
- popsr CHC,it0, msp ;
- popsr CHD,it0, msp ;
-
- popsr CHA,it0, msp ;
- popsr PC2,it0, msp ;
- popsr PC1,it0, msp ;
- popsr PC0,it0, msp ;
-
- load 0, 0, rab, msp ;
- add msp, msp, 4 ;
- load 0, 0, it0, msp ;
- add gr1, it0, 0 ; pop rsp
-
- add msp, msp, 8 ; discount signal #
- iret
- .endm
-
- .macro repair_R_stack
- add v0, msp, SIGCTX_GR1 ; interrupted gr1
- load 0, 0, v2, v0 ;
- add v0, msp, SIGCTX_RFB ;
- load 0, 0, v3, v0 ; interupted rfb
-
- const v1, WS ;
- sub v1, v3, v1 ; rfb-512
- cpltu v0, v2, v1 ; test gr1 < rfb-512
- jmpf v0, $1 ;
-
- add gr1, rab, 0 ;
- add v2, v1, 0 ; set LB = rfb-512
-$1:
-;* if gr1 < rfb-512 yes LB = rfb-512 signalled during spill
-;* if no, LB=gr1 interrupted cache < 126 registers
- cpleu v0, v2, rfb ; test LB<=rfb
- jmpf v0, $2 ;
- nop ;
- add v2, rfb, 0 ;
-$2:
- cpeq v0, v3, rfb ; fill rfb->'rfb
- jmpt v0, $3 ; if rfb==rfb'
- const tav, (0x80<<2) ; prepare for fill
- or tav, tav, v2 ;
-
- mtsr IPA, tav ; IPA=LA<<2
- sub tav, v3, gr98 ; cache fill LA->rfb
- srl tav, tav, 2 ; convert to words
- sub tav, tav, 1 ;
-
- mtsr cr, tav ;
- loadm 0, 0, gr0, v2 ; fill from LA->rfb
-$3:
- add rfb, v3, 0 ; move rfb upto 'rfb
- sub rab, v1, 0 ; assign rab to rfb-512
-
- add v0, msp, SIGCTX_GR1 ;
- load 0, 0, v2, v0 ; v0 = interrupted gr1
- add gr1, v2, 0 ; move gr1 upto 'gr1
- nop ;
- .endm
-
- .macro repair_regs
- mtsrim cr, 29 - 1 ; to restore locals
- loadm 0, 0, v0, msp ;
- add msp, msp, 29*4 ;
- popsr Q, tav, msp ;
-
- popsr IPC, tav, msp ;
- popsr IPB, tav, msp ;
- popsr IPA, tav, msp ;
- pop FPStat3, msp ; floating point regs
-
- pop FPStat2, msp ; floating point regs
- pop FPStat1, msp ; floating point regs
- pop FPStat0, msp ; floating point regs
-
- add msp, msp, 3*4 ; R-stack repaired
- .endm
-
-;
-;*HIF related...
-;
-
-
-
-
-; send the message in bufaddr to Montip.
- .macro SendMessageToMontip, bufaddr
- const lr2, bufaddr
-$1:
- call lr0, _msg_send
- consth lr2, bufaddr
- cpeq gr96, gr96, 0
- jmpf gr96, $1
- const lr2, bufaddr
- .endm
-
-; build a HIF_CALL message in bufaddr to send to montip.
- .macro BuildHIFCALLMsg, bufaddr, tmp1, tmp2
- const tmp1, bufaddr
- consth tmp1, bufaddr
- const tmp2, HIF_CALL_MSGCODE
- store 0, 0, tmp2, tmp1 ; msg code
- add tmp1, tmp1, 4
- const tmp2, HIF_CALL_MSGLEN
- store 0, 0, tmp2, tmp1 ; msg len
- add tmp1, tmp1, 4
- store 0, 0, gr121, tmp1 ; service number
- add tmp1, tmp1, 4
- store 0, 0, lr2, tmp1 ; lr2
- add tmp1, tmp1, 4
- store 0, 0, lr3, tmp1 ; lr3
- add tmp1, tmp1, 4
- store 0, 0, lr4, tmp1 ; lr4
- .endm
-
-;
-;*
-;* All the funky AMD style macros go in here...simply for
-;* compatility
-;
-;
- .macro IMPORT, symbol
- .extern symbol
- .endm
-
- .macro GLOBAL, symbol
- .global symbol
- .endm
-
- .macro USESECT, name, type
- .sect name, type
- .use name
- .endm
-
- .macro SECTION, name, type
- .sect name, type
- .endm
-
- .macro FUNC, fname, lineno
- .global fname
-fname:
- .endm
-
- .macro ENDFUNC, fname, lineno
- .endm
-
-;*************************************LONG
- .macro LONG, varname
-varname:
- .block 4
- .endm
-
-;*************************************UNSIGNED LONG
- .macro ULONG, varname
-varname:
- .block 4
- .endm
-
-;*************************************SHORT
- .macro SHORT, varname
-varname:
- .block 2
- .endm
-
-;*************************************CHAR
- .macro CHAR, varname
-varname:
- .block 1
- .endm
-
-;*************************************LONGARRAY
- .macro LONGARRAY, name, count
-name:
- .block count*4
- .endm
-
-;*************************************SHORTARRAY
-
- .macro SHORTARRAY, name, count
-name:
- .block count*2
- .endm
-
-;*************************************CHARARRAY
-
- .macro CHARARRAY, name, count
-name:
- .block count
- .endm
-
-
-;*************************************VOID_FPTR
-
- .macro VOID_FPTR, name
-name:
- .block 4
- .endm
diff --git a/c/src/lib/libbsp/a29k/portsw/start/register.ah b/c/src/lib/libbsp/a29k/portsw/start/register.ah
deleted file mode 100644
index 1dced5b043..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/start/register.ah
+++ /dev/null
@@ -1,214 +0,0 @@
-; /* @(#)register.ah 1.1 96/05/23 08:56:57, TEI */
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; naming of various registers
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; /* $Id$ */
-
-;* File information and includes.
-
- .file "register.ah"
- .ident "@(#)register.ah 1.1 96/05/23 08:56:57, TEI\n"
-
-;* Register Stack pointer and frame pointer registers.
-
- .extern Rrsp, Rfp
-
- .reg regsp, %%Rrsp
- .reg fp, %%Rfp
-
-
- .extern RTrapReg
- .extern Rtrapreg
-
- .reg TrapReg, %%RTrapReg
- .reg trapreg, %%Rtrapreg
-
-
-;* Operating system Interrupt handler registers (gr64-gr67)
-
- .extern ROSint0, ROSint1, ROSint2, ROSint3
-
- .reg OSint0, %%ROSint0
- .reg OSint1, %%ROSint1
- .reg OSint2, %%ROSint2
- .reg OSint3, %%ROSint3
-
- .reg it0, %%ROSint0
- .reg it1, %%ROSint1
- .reg it2, %%ROSint2
- .reg it3, %%ROSint3
-
-
-
-;* Operating system temporary (or scratch) registers (gr68-gr79)
-
- .extern ROStmp0, ROStmp1, ROStmp2, ROStmp3
- .extern ROStmp4, ROStmp5, ROStmp6, ROStmp7
- .extern ROStmp8, ROStmp9, ROStmp10, ROStmp11
-
- .reg OStmp0, %%ROStmp0
- .reg OStmp1, %%ROStmp1
- .reg OStmp2, %%ROStmp2
- .reg OStmp3, %%ROStmp3
-
- .reg OStmp4, %%ROStmp4
- .reg OStmp5, %%ROStmp5
- .reg OStmp6, %%ROStmp6
- .reg OStmp7, %%ROStmp7
-
- .reg OStmp8, %%ROStmp8
- .reg OStmp9, %%ROStmp9
- .reg OStmp10, %%ROStmp10
- .reg OStmp11, %%ROStmp11
-
-
- .reg kt0, %%ROStmp0
- .reg kt1, %%ROStmp1
- .reg kt2, %%ROStmp2
- .reg kt3, %%ROStmp3
-
- .reg kt4, %%ROStmp4
- .reg kt5, %%ROStmp5
- .reg kt6, %%ROStmp6
- .reg kt7, %%ROStmp7
-
- .reg kt8, %%ROStmp8
- .reg kt9, %%ROStmp9
- .reg kt10, %%ROStmp10
- .reg kt11, %%ROStmp11
-
-
- .reg TempReg0, %%ROSint0
- .reg TempReg1, %%ROSint1
- .reg TempReg2, %%ROSint2
- .reg TempReg3, %%ROSint3
-
- .reg TempReg4, %%ROStmp0
- .reg TempReg5, %%ROStmp1
- .reg TempReg6, %%ROStmp2
- .reg TempReg7, %%ROStmp3
-
- .reg TempReg8, %%ROStmp4
- .reg TempReg9, %%ROStmp5
- .reg TempReg10, %%ROStmp6
- .reg TempReg11, %%ROStmp7
-
- .reg TempReg12, %%ROStmp8
- .reg TempReg13, %%ROStmp9
- .reg TempReg14, %%ROStmp10
- .reg TempReg15, %%ROStmp11
-
-
-;* Assigned static registers
-
- .extern RSpillAddrReg, RFillAddrReg, RSignalAddrReg
- .extern Rpcb, Retc
- .extern RTimerExt, RTimerUtil, RLEDReg, RERRReg
- .extern Ret0, Ret1, Ret2, Ret3, Ret4, Ret5, Ret6, Ret7, Reta, Retb
- .extern Retx, Rety, Retz
-
-
- .reg SpillAddrReg, %%RSpillAddrReg
- .reg FillAddrReg, %%RFillAddrReg
- .reg SignalAddrReg, %%RSignalAddrReg
- .reg pcb, %%Rpcb
-
- .reg etx, %%Retx
- .reg ety, %%Rety
- .reg etz, %%Retz
- .reg eta, %%Reta
-
- .reg etb, %%Retb
- .reg etc, %%Retc
- .reg TimerExt, %%RTimerExt
- .reg TimerUtil, %%RTimerUtil
-
- .reg LEDReg, %%RLEDReg
- .reg ERRReg, %%RERRReg
-
-
- .reg et0, %%Ret0
- .reg et1, %%Ret1
- .reg et2, %%Ret2
- .reg et3, %%Ret3
-
- .reg et4, %%Ret4
- .reg et5, %%Ret5
- .reg et6, %%Ret6
- .reg et7, %%Ret7
-
-;
- .equ SCB1REG_NUM, 88
- .reg SCB1REG_PTR, %%Ret0
-
-; The floating point trap handlers need a few static registers
-
- .extern RFPStat0, RFPStat1, RFPStat2, RFPStat3
- .extern Rheapptr, RHeapPtr, RArgvPtr
-
- .reg FPStat0, %%RFPStat0
- .reg FPStat1, %%RFPStat1
- .reg FPStat2, %%RFPStat2
- .reg FPStat3, %%RFPStat3
-
- .reg heapptr, %%Rheapptr
- .reg HeapPtr, %%RHeapPtr
- .reg ArgvPtr, %%RArgvPtr
-
- .extern RXLINXReg, RVMBCReg, RUARTReg, RETHERReg
-
- .reg XLINXReg, %%RXLINXReg
- .reg VMBCReg, %%RVMBCReg
- .reg UARTReg, %%RUARTReg
- .reg ETHERReg, %%RXLINXReg
-
-;* Compiler and programmer registers. (gr96-gr127)
-
- .extern Rv0, Rv1, Rv2, Rv3, Rv4, Rv5, Rv6, Rv7, Rv8, Rv9
- .extern Rv10, Rv11, Rv12, Rv13, Rv14, Rv15
-
- .reg v0, %%Rv0
- .reg v1, %%Rv1
- .reg v2, %%Rv2
- .reg v3, %%Rv3
-
- .reg v4, %%Rv4
- .reg v5, %%Rv5
- .reg v6, %%Rv6
- .reg v7, %%Rv7
-
- .reg v8, %%Rv8
- .reg v9, %%Rv9
- .reg v10, %%Rv10
- .reg v11, %%Rv11
-
- .reg v12, %%Rv12
- .reg v13, %%Rv13
- .reg v14, %%Rv14
- .reg v15, %%Rv15
-
- .extern Rtv0, Rtv1, Rtv2, Rtv3, Rtv4
-
- .reg tv0, %%Rtv0
- .reg tv1, %%Rtv1
- .reg tv2, %%Rtv2
- .reg tv3, %%Rtv3
- .reg tv4, %%Rtv4
-
-; ****************************************************************************
-; For uatrap
-; register definitions -- since this trap handler must allow for
-; nested traps and interrupts such as TLB miss, protection violation,
-; or Data Access Exception, and these trap handlers use the shared
-; Temp registers, we must maintain our own that are safe over user-
-; mode loads and stores. The following must be assigned global
-; registers which are not used in INTR[0-3], TRAP[0-1], TLB miss,
-; TLB protection violation, or data exception trap handlers.
-
-; .reg cha_cpy, OStmp4 ; copy of CHA
-; .reg chd_cpy, OStmp5 ; copy of CHD
-; .reg chc_cpy, OStmp6 ; copy of CHC
-; .reg LTemp0, OStmp7 ; local temp 0
-; .reg LTemp1, OStmp8 ; local temp 1
-
-; ****************************************************************************
diff --git a/c/src/lib/libbsp/a29k/portsw/startup/Makefile.in b/c/src/lib/libbsp/a29k/portsw/startup/Makefile.in
deleted file mode 100644
index 2be725234c..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/startup/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec iface
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=ramlink romlink $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) ramlink romlink ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-
diff --git a/c/src/lib/libbsp/a29k/portsw/startup/bspclean.c b/c/src/lib/libbsp/a29k/portsw/startup/bspclean.c
deleted file mode 100644
index c943896019..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/startup/bspclean.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine normally is part of start.s and usually returns
- * control to a monitor.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-#ifndef lint
-static char _sccsid[] = "@(#)bspclean.c 04/08/96 1.1\n";
-#endif
-
-void bsp_cleanup( void )
-{
-}
diff --git a/c/src/lib/libbsp/a29k/portsw/startup/bspstart.c b/c/src/lib/libbsp/a29k/portsw/startup/bspstart.c
deleted file mode 100644
index 666a0f3d68..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/startup/bspstart.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-#ifndef lint
-static char _sccsid[] = "@(#)bspstart.c 09/11/96 1.15\n";
-#endif
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/* Initialize whatever libc we are using
- * called from postdriver hook
- */
-
-#define HEAP_BLOCK_SIZE (16 * 1024)
-
-rtems_unsigned32 heap_size = 0;
-rtems_unsigned32 heap_start;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- /* allocate a maximum of 2 megabytes for the heap */
- heap_size = 2 * 1024 * 1024;
-
- /* allocate all remaining memory to the heap */
- do {
- heap_size -= HEAP_BLOCK_SIZE;
- heap_start = _sysalloc( heap_size );
- } while ( !heap_start );
-
- if (!heap_start)
- rtems_fatal_error_occurred( heap_size );
-
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
-
- bsp_libc_init((void *) heap_start, heap_size, 0);
-
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-int bsp_start(
- int argc,
- char **argv,
- char **environp
-)
-{
- if ((argc > 0) && argv && argv[0])
- rtems_progname = argv[0];
- else
- rtems_progname = "RTEMS";
-
- /* set the PIA0 register wait states */
- *(volatile unsigned32 *)0x80000020 = 0x04080000;
-
- /*
- * Allocate the memory for the RTEMS Work Space. This can come from
- * a variety of places: hard coded address, malloc'ed from outside
- * RTEMS world (e.g. simulator or primitive memory manager), or (as
- * typically done by stock BSPs) by subtracting the required amount
- * of work space from the last physical address on the CPU board.
- */
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
-
- BSP_Configuration.work_space_start = _sysalloc( BSP_Configuration.work_space_size + 512 );
- if (!BSP_Configuration.work_space_start)
- rtems_fatal_error_occurred( BSP_Configuration.work_space_size );
-
- BSP_Configuration.work_space_start = (void *) ((unsigned int)((char *)BSP_Configuration.work_space_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1));
-
- /*
- * initialize the CPU table for this BSP
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_stack_size = 4096;
-
- _settrap( 109,&a29k_enable_sup);
- _settrap( 110,&a29k_disable_sup);
- _settrap( 111,&a29k_enable_all_sup);
- _settrap( 112,&a29k_disable_all_sup);
- _settrap( 106,&a29k_context_switch_sup);
- _settrap( 107,&a29k_context_restore_sup);
- _settrap( 108,&a29k_context_save_sup);
- _settrap( 105,&a29k_sigdfl_sup);
-
- /*
- * Start RTEMS
- */
-
- rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
-
- bsp_cleanup();
-
- return 0;
-}
diff --git a/c/src/lib/libbsp/a29k/portsw/startup/iface.c b/c/src/lib/libbsp/a29k/portsw/startup/iface.c
deleted file mode 100644
index 90ab480037..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/startup/iface.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * glue.c -- all the code to make GCC and the libraries run on
- * a target board running RTEMS. These should work with
- * any target which conforms to the RTEMS BSP.
- *
- * $Id$
- */
-
-#ifndef lint
-static char _sccsid[] = "@(#)iface.c 04/12/96 1.1\n";
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-
-int
-read(int fd,
- char *buf,
- int nbytes)
-{
- return __rtems_read(fd, buf, nbytes);
-}
-
-int
-write(int fd,
- char *buf,
- int nbytes)
-{
- return __rtems_write(fd, buf, nbytes);
-}
-
-int
-open(char *buf,
- int flags,
- int mode)
-{
- return __rtems_open(buf, flags, mode);
-}
-
-int
-close(int fd)
-{
- return __rtems_close(fd);
-}
-
-/*
- * isatty -- returns 1 if connected to a terminal device,
- * returns 0 if not.
- */
-int
-isatty(int fd)
-{
- return __rtems_isatty(fd);
-}
-
-/*
- * lseek -- move read/write pointer. Since a serial port
- * is non-seekable, we return an error.
- */
-off_t
-lseek(int fd,
- off_t offset,
- int whence)
-{
- return __rtems_lseek(fd, offset, whence);
-}
-
-/*
- * fstat -- get status of a file. Since we have no file
- * system, we just return an error.
- */
-int
-fstat(int fd,
- struct stat *buf)
-{
- return __rtems_fstat(fd, buf);
-}
-
-int
-getpid()
-{
- return __rtems_getpid();
-}
-
-/*
- * kill -- go out via exit...
- */
-int
-kill(int pid,
- int sig)
-{
- return __rtems_kill(pid, sig);
-}
-
-
diff --git a/c/src/lib/libbsp/a29k/portsw/startup/main.c b/c/src/lib/libbsp/a29k/portsw/startup/main.c
deleted file mode 100644
index 4bb9abbd1f..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/startup/main.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* main()
- *
- * This is the entry point for the application. It calls
- * the bsp_start routine to the actual dirty work.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-#ifndef lint
-static char _sccsid[] = "@(#)main.c 06/30/96 1.2\n";
-#endif
-
-int main(
- int argc,
- char **argv,
- char **environp
-)
-{
- bsp_start( argc, argv, environp );
-
- /*
- * May be able to return to the "crt/start.s" code but also
- * may not be able to. Do something here which is board dependent.
- */
-
- _exit(0);
- rtems_fatal_error_occurred( 0 );
-}
diff --git a/c/src/lib/libbsp/a29k/portsw/startup/ramlink b/c/src/lib/libbsp/a29k/portsw/startup/ramlink
deleted file mode 100644
index 8f48e3b395..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/startup/ramlink
+++ /dev/null
@@ -1,11 +0,0 @@
-;@(#)ez030.cmd 1.1 93/04/06 20:00:10, Copyright 1993 AMD.
-;Linker command file header for EZ-030 evaluation board.
-;Usage: ld29 -c .../29k/lib/ez030.cmd -o ...
-; -or-
-; hc29 -cmdez030.cmd ...
-;
-; $Id$
-;
-ALIGN .text=8192
-ALIGN .data=8192
-ORDER .text=0x40005000,!text,!data,!lit,!bss
diff --git a/c/src/lib/libbsp/a29k/portsw/startup/romlink b/c/src/lib/libbsp/a29k/portsw/startup/romlink
deleted file mode 100644
index 043b2ed32c..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/startup/romlink
+++ /dev/null
@@ -1,146 +0,0 @@
-;
-; $Id$
-;
-;#{
-;# SCCS INFORMATION:
-;# SID = @(#)sa29200.lnk 4.1; DLU=95/09/14-11:05:57
-;# Q = @(#) Copyright (C) 1995 Advanced Micro Devices, Inc.
-;# Module Type = @(#) OSBOOT/DBG_CORE absolute liker file (AMD-EPD-29K, AMIR)
-;# SCCS Path = %P\%
-;# SCCS File = %F\%
-;# FileName = sa29200.lnk
-;# SCCS ID = 4.1
-;# Date Update = 14 Sep 1995, (DLU=95/09/14-11:05:57)
-;# Date Extract = 12 Oct 1995, (DLE=95/10/12-16:27:31)
-;#}
-; @(#)sa29200.lnk 3.6 94/08/22 11:58:54, Srini, AMD.
-; This is the linker command file used to bind the inrementally linked
-; osboot.o module to a memory map. This also defines some link-time constants
-; used in the code. These constants are genral for all 29K family members.
-; You only need to customize, if necessary, the definitions that affect
-; your target processor, and leave the rest alone.
-; The default values in this file are for binding osboot.o for use with
-; SA29200 stand-alone board with the -29200/-29205 option.
-;
-; Order the code segments according to the memory map structure.
-; The defaul OSBOOT has only .text and .bss sections. You need to ORDER
-; other sections of your applications that are not included below.
-; We use separate ORDER statements below to distinguish the two memory
-; regions used. The text section is bound to ROM memory region, and the
-; data region to RAM memory space.
-; MAKE SURE to order the BSS section at the very end. This is because the
-; BSS section size could get adjusted after linking with raminit.o (produced
-; by romcoff utility) or other initialization routines. This change in size
-; could affect the offsets used by the program to refer to the remaining data
-; sections that follow BSS.
-ALIGN ProcInit=16
-ORDER Reset=0x0
-ORDER ProcInit,OsbText,.text,!text
-ORDER .lit,!lit
-ORDER vectable=0x40000000
-ORDER msg_data=0x40000400
-ORDER .data,!data
-ORDER OsbBss,dbg_030,dbg_bss,cfg_bss,.bss,!bss
-ORDER HeapBase
-ORDER .comment
-; For Stand-Alone application out of ROM use the ORDER statements below:
-; For Stand-Alone application out of RAM use the ORDER statement below:
-;ORDER Reset=0x40010000,ProcInit,OsbText,.text,!text,.lit,!lit,.data,!data,msg_data,dbg_dat,.bss,!bss,HeapBase,.comment
-;
-; definitions of link time constants used in code.
-;
-; Definition of the initial value of CPS register.
-; The value below is for an Am29200 processor. It sets TU, SM,DI, DA,IM fields
-; bits in the register. You may modify it to suit your target environment.
-; Like, changing the IM field for instance. IM is 0x11 by default enabling
-; all INTR[0-3] lines.
-;public _init_CPS=0x87F
-public _init_CPS=0x20813
-;public _init_CPS=0x2081F
-;public _init_CPS=0x081F
-; Define the memory map in general values. The code - except for simulators -
-; configures the external RAM at run-time and updates the DMemSize value.
-; DMemStart and DMemSize are the most important values below. DMemStart is
-; used to initialize the vector base address register (VAB). And DMemSize
-; is used to find the highest addressable data memory to place the register
-; and memory stacks. Remember, DMemSize is configured at run-time for hardware
-; targets and updated.
-public VectorBaseAddress=0x40000000
-public IMemStart=0x0000000
-public IMemSize=0xfffff
-public DMemStart=0x40000000
-#public DMemStart=0x100000
-public DMemSize=0xfffff
-#public DMemSize=0x17ffff
-#public DMemSize=0x3fffffff
-public RMemStart=0x0
-public RMemSize=0xfffff
-public EnableDRAMSizing=1
-;
-; For the 29K Microcontrollers, you need to define the ROM Control register
-; value (RMCT_VALUE), the ROM Configuration register value (RMCF_VALUE), and
-; the DRAM Control register value (DRCT_VALUE) based on DMemSize specified
-; above. This could be overwritten in software targets such as the simulator.
-; ROM and RAM Control registers. ROM COnfiguration. (not valid for Am2900X,
-; Am29050, and Am2903X processors)
-; The DRAM REFRATE value (in DRCT) must be specified here. To disable
-; DRAM refreshing (on a system with no DRAM), set REFRATE field in DRCT
-; to zero. Otherwise, set it to the desired frequency. The default is 0xFF
-; The default values in this file are for Am2920X processors.
-;public RMCT_VALUE=0x03030303
-;public DRCT_VALUE=0x888800FF
-;public RMCF_VALUE=0x00f8f8f8
-;
-public RMCT_VALUE=0x4a424300
-public DRCT_VALUE=0xccc000f0
-public RMCF_VALUE=0x011121ff
-;
-;
-; Execute trap handlers from ROM? If your trap handlers are in ROM space,
-; then set _TRAPINROM to TWO (0x2). It is used to modify the tarp vector
-; address installed to set the R bit when fetched. If the trap handlers in
-; ROM or if there is no ROM-space (no RE bit in CPS), set _TRAPINROM to ZERO.
-; The default in this file is for SA29200 board and _TRAPINROM is set to ZERO.
-public _TRAPINROM=0
-;
-; Define the processor clock frequencies. These values are used by the HIF
-; kernel to provide some HIF services.
-public TicksPerMillisecond=16000
-public ClockFrequency=16000000
-;
-; There are some C functions which are not leaf functions. However, they are
-; no expected to spill or fill registers. We ensure that by setting up a
-; pseudo register stack before calling those functions. The code generated
-; for those functions however do have the prologue and epilogue which refer
-; to the symbols V_SPILL and V_FILL. The linker does not know about these
-; symbols. So we define it here so that it does not complain.
-; If you use the hc29 compiler driver to link the objects it will warn that
-; the definitions here are already internally defined. You
-; can use hc29 with -nocrt0 option to do the linking for linear memory spaces.
-; public V_SPILL=64
-; public V_FILL=65
-;
-; Set the UART debug/monitor port serial communications baud rate.
-;
-public UCLK=32000000
-; INITBAUD defines the cold start baud rate. This is the baud rate
-; the monitor would use when powered up. This can be overridden by
-; defining BAUDRATE on the assembler/compiler command line.
-public INITBAUD=9600
-;
-; Is there a SCC 8530 on the target?
-; If there is an 8530 SC on target, define the symbols below appropriately.
-; The routines in scc8530.s use these values to access the registers of
-; SCC and program it. The default values are for EZ030 target.
-; Baudrate can be specified on the command-line to override the default
-; baud rate defined in scc8530.s.
-; scc channel A control
-;public SCC8530_CHA_CONTROL=0xC0000007
-; scc channel B control
-;public SCC8530_CHB_CONTROL=0xC0000003
-; scc channel A data
-;public SCC8530_CHA_DATA=0xC000000F
-; scc channel B data
-;public SCC8530_CHB_DATA=0xC000000B
-; scc baud clock generator
-;public SCC8530_BAUD_CLK_ENBL=3
diff --git a/c/src/lib/libbsp/a29k/portsw/startup/setvec.c b/c/src/lib/libbsp/a29k/portsw/startup/setvec.c
deleted file mode 100644
index e353cad88a..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/startup/setvec.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on the target Board/CPU.
- * This routine is allowed to be as board dependent as necessary.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-#ifndef lint
-static char _sccsid[] = "@(#)setvec.c 06/30/96 1.2\n";
-#endif
-
-no_cpu_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- no_cpu_isr_entry previous_isr;
-
- if ( type )
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
- else {
- /* XXX: install non-RTEMS ISR as "raw" interupt */
- _settrap( vector, handler );
- }
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/a29k/portsw/times b/c/src/lib/libbsp/a29k/portsw/times
deleted file mode 100644
index 110130b214..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/times
+++ /dev/null
@@ -1,195 +0,0 @@
-#
-# Timing Test Suite Results for the NO_BSP
-#
-# NOTE: This is just a template. The times are irrelevant since this BSP
-# can only be compiled -- not executed.
-#
-# $Id$
-#
-
-
-Board:
-CPU: include coprocessor if applicable
-Clock Speed:
-Memory Configuration: SRAM, DRAM, cache, etc
-Wait States:
-
-Times Reported in: cycles, microseconds, etc
-Timer Source: Count Down Timer, on-CPU cycle counter, etc
-
-Column X:
-Column Y:
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 20
- rtems_semaphore_delete 21
- rtems_semaphore_obtain: available 15
- rtems_semaphore_obtain: not available -- NO_WAIT 15
- rtems_semaphore_release: no waiting tasks 16
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 62
-
- 3 rtems_semaphore_release: task readied -- preempts caller 55
-
- 4 rtems_task_restart: blocked task -- preempts caller 77
- rtems_task_restart: ready task -- preempts caller 70
- rtems_semaphore_release: task readied -- returns to caller 25
- rtems_task_create 57
- rtems_task_start 31
- rtems_task_restart: suspended task -- returns to caller 36
- rtems_task_delete: suspended task 47
- rtems_task_restart: ready task -- returns to caller 37
- rtems_task_restart: blocked task -- returns to caller 46
- rtems_task_delete: blocked task 50
-
- 5 rtems_task_suspend: calling task 51
- rtems_task_resume: task readied -- preempts caller 49
-
- 6 rtems_task_restart: calling task 59
- rtems_task_suspend: returns to caller 18
- rtems_task_resume: task readied -- returns to caller 19
- rtems_task_delete: ready task 50
-
- 7 rtems_task_restart: suspended task -- preempts caller 70
-
- 8 rtems_task_set_priority: obtain current priority 12
- rtems_task_set_priority: returns to caller 27
- rtems_task_mode: obtain current mode 5
- rtems_task_mode: no reschedule 5
- rtems_task_mode: reschedule -- returns to caller 8
- rtems_task_mode: reschedule -- preempts caller 39
- rtems_task_set_note 13
- rtems_task_get_note 13
- rtems_clock_set 33
- rtems_clock_get 3
-
- 9 rtems_message_queue_create 110
- rtems_message_queue_send: no waiting tasks 37
- rtems_message_queue_urgent: no waiting tasks 37
- rtems_message_queue_receive: available 31
- rtems_message_queue_flush: no messages flushed 12
- rtems_message_queue_flush: messages flushed 16
- rtems_message_queue_delete 26
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 15
- rtems_message_queue_receive: not available -- caller blocks 62
-
-11 rtems_message_queue_send: task readied -- preempts caller 72
-
-12 rtems_message_queue_send: task readied -- returns to caller 39
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 72
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 39
-
-15 rtems_event_receive: obtain current events 1
- rtems_event_receive: not available -- NO_WAIT 12
- rtems_event_receive: not available -- caller blocks 56
- rtems_event_send: no task readied 12
- rtems_event_receive: available 12
- rtems_event_send: task readied -- returns to caller 24
-
-16 rtems_event_send: task readied -- preempts caller 55
-
-17 rtems_task_set_priority: preempts caller 62
-
-18 rtems_task_delete: calling task 83
-
-19 rtems_signal_catch 9
- rtems_signal_send: returns to caller 15
- rtems_signal_send: signal to self 18
- exit ASR overhead: returns to calling task 22
- exit ASR overhead: returns to preempting task 49
-
-20 rtems_partition_create 35
- rtems_region_create 23
- rtems_partition_get_buffer: available 15
- rtems_partition_get_buffer: not available 13
- rtems_partition_return_buffer 18
- rtems_partition_delete 16
- rtems_region_get_segment: available 22
- rtems_region_get_segment: not available -- NO_WAIT 21
- rtems_region_return_segment: no waiting tasks 19
- rtems_region_get_segment: not available -- caller blocks 64
- rtems_region_return_segment: task readied -- preempts caller 74
- rtems_region_return_segment: task readied -- returns to caller 44
- rtems_region_delete 16
- rtems_io_initialize 2
- rtems_io_open 1
- rtems_io_close 1
- rtems_io_read 1
- rtems_io_write 1
- rtems_io_control 1
-
-21 rtems_task_ident 149
- rtems_message_queue_ident 145
- rtems_semaphore_ident 156
- rtems_partition_ident 145
- rtems_region_ident 148
- rtems_port_ident 145
- rtems_timer_ident 145
- rtems_rate_monotonic_ident 145
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 42
- rtems_message_queue_broadcast: no waiting tasks 17
- rtems_message_queue_broadcast: task readied -- preempts caller 78
-
-23 rtems_timer_create 14
- rtems_timer_fire_after: inactive 22
- rtems_timer_fire_after: active 24
- rtems_timer_cancel: active 15
- rtems_timer_cancel: inactive 13
- rtems_timer_reset: inactive 21
- rtems_timer_reset: active 23
- rtems_timer_fire_when: inactive 34
- rtems_timer_fire_when: active 34
- rtems_timer_delete: active 19
- rtems_timer_delete: inactive 17
- rtems_task_wake_when 69
-
-24 rtems_task_wake_after: yield -- returns to caller 9
- rtems_task_wake_after: yields -- preempts caller 45
-
-25 rtems_clock_tick 4
-
-26 _ISR_Disable 0
- _ISR_Flash 1
- _ISR_Enable 1
- _Thread_Disable_dispatch 0
- _Thread_Enable_dispatch 7
- _Thread_Set_state 11
- _Thread_Disptach (NO FP) 31
- context switch: no floating point contexts 21
- context switch: self 10
- context switch: to another task 10
- context switch: restore 1st FP task 25
- fp context switch: save idle, restore idle 31
- fp context switch: save idle, restore initialized 19
- fp context switch: save initialized, restore initialized 20
- _Thread_Resume 7
- _Thread_Unblock 7
- _Thread_Ready 9
- _Thread_Get 4
- _Semaphore_Get 2
- _Thread_Get: invalid id 0
-
-27 interrupt entry overhead: returns to interrupted task 6
- interrupt exit overhead: returns to interrupted task 6
- interrupt entry overhead: returns to nested interrupt 6
- interrupt exit overhead: returns to nested interrupt 5
- interrupt entry overhead: returns to preempting task 7
- interrupt exit overhead: returns to preempting task 36
-
-28 rtems_port_create 16
- rtems_port_external_to_internal 11
- rtems_port_internal_to_external 11
- rtems_port_delete 16
-
-29 rtems_rate_monotonic_create 15
- rtems_rate_monotonic_period: initiate period -- returns to caller 21
- rtems_rate_monotonic_period: obtain status 13
- rtems_rate_monotonic_cancel 16
- rtems_rate_monotonic_delete: inactive 18
- rtems_rate_monotonic_delete: active 20
- rtems_rate_monotonic_period: conclude periods -- caller blocks 53
diff --git a/c/src/lib/libbsp/a29k/portsw/wrapup/Makefile.in b/c/src/lib/libbsp/a29k/portsw/wrapup/Makefile.in
deleted file mode 100644
index 122f945c4e..0000000000
--- a/c/src/lib/libbsp/a29k/portsw/wrapup/Makefile.in
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup console iic ethernet flash nvram
-CPU_PIECES=clock timer
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(CPU_PIECES), ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/bare/Makefile.in b/c/src/lib/libbsp/bare/Makefile.in
deleted file mode 100644
index 0e1a68c552..0000000000
--- a/c/src/lib/libbsp/bare/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SRCS=README
-
-all: $(SRCS)
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include wrapup
diff --git a/c/src/lib/libbsp/bare/README b/c/src/lib/libbsp/bare/README
deleted file mode 100644
index f2d43f974d..0000000000
--- a/c/src/lib/libbsp/bare/README
+++ /dev/null
@@ -1,117 +0,0 @@
-#
-# $Id$
-#
-
-#
-# Please send any comments, improvements, or bug reports to:
-# Chris Johns
-# Objective Design Systems
-# 35 Cairo Street
-# Cammeray
-# Sydney, NSW 2062
-# ccj@acm.org
-#
-
-#
-# Overview
-# ~~~~~~~~
-# This board support package is not a board support package at all, but
-# a means to build the RTEMS kernel without using a specific BSP.
-#
-# You should be able to build to build this BSP for any cpu type.
-#
-# You must provide the standard BSP type functions and support yourself
-# externally to RTEMS.
-#
-# This BSP is intended to be used by people who fit one or more of the
-# categories below :
-#
-# 1) using custom hardware of little use or interest to others. If you
-# intend to use hardware available to others, please create a BSP
-# and send to OARCorp.
-#
-# 2) production code cannot depend on software which can change. BSP code
-# can change with-out notice, while RTEMS has very tightly defined
-# interfaces which do not change.
-#
-# 3) the need to extend or change an existing BSP in ways which are not
-# of interest to others or the BSP maintainer.
-#
-# I fit all the above.
-#
-# Issues
-# ~~~~~~
-# I do not consider the bare BSP as a starting point for RTEMS. The
-# BSP code integrated into the RTEMS build tree has the advantage of
-# building all the test and sample code. The sample and test code is
-# important for validatation of your tools, and getting your BSP
-# working correctly.
-#
-# Once you gain experience with RTEM and your application matures the
-# need to break the BSP code out from the kernel becomes important. It
-# is at this point in time that the bare BSP becomes useful.
-#
-# Once free you are able to upgrade without the worry of makefile or
-# build tree changes which can break your BSP.
-#
-# How To Configure
-# ~~~~~~~~~~~~~~~~
-# RTEMS requires you to select a BSP inorder to build the kernel.
-# If you take a close look at a BSP which is closest to your
-# needs you will find somewhere the CPU model and CPU compile
-# flags are specified. This is the only piece of information
-# required by the kernel inorder for it to build.
-#
-# This highlights the clean design of the kernel and its
-# independence from the particulars of target hardware.
-#
-# The CPU model is the RTEMS model and usually tries to match with
-# the GCC model. There are variations on some processors. If you are
-# unsure please ask on the RTEMS list. Someone will know (I hope).
-#
-# The CPU flags allow you to select specific operating modes for
-# GCC. For example the PowerPC has specific flags to control various
-# cache resouces. Another example is the 68000 family of embedded
-# processor do not have FPU hardware and require software emulation.
-#
-# An example configuration command line is:
-#
-# ../rtems-4.0/configure --target=m68k-rtems \
-# --prefix=/ods/egcs/test \
-# --enable-cxx \
-# --enable-gmake-print-directory \
-# --disable-tests \
-# --disable-posix \
-# --enable-networking \
-# --enable-bare-cpu-cflags=-mcpu32 \
-# --enable-bare-cpu-model=mcpu32 \
-# --enable-rtemsbsp=bare
-#
-# Building RTEMS
-# ~~~~~~~~~~~~~~
-# You are required to do nothing special here. Just follow the documented
-# steps. The samples are built but no linking occurs. The link command
-# is stubbed out to produce a Unix shell script.
-#
-# After installation you will find a directory called 'bare'. The nature
-# of the RTEMS build system means the bare BSP will only install into the
-# the bare directory under the specifed configuration prefix.
-#
-# I therefore suggest you move the directory to another name. This allows
-# you to make and install another bare BSP for a different variant of
-# CPU without over writing the last installed variant.
-#
-# I have provided a script file I use to configure and build RTEMS
-# from the arcihve. Take a copy and use it if you find it useful.
-#
-# Creating an Application.
-# ~~~~~~~~~~~~~~~~~~~~~~~~
-# This is something which is usually specific to your local environment.
-# The bare BSP does not lock you into any specific makefile or build
-# system. A couple of suggestions are:
-#
-# o Get the sample bare BSP application, or
-# o Watch RTEMS build a BSP which is closest to yours and copy
-# the command lines used.
-#
-
diff --git a/c/src/lib/libbsp/bare/bsp_specs b/c/src/lib/libbsp/bare/bsp_specs
deleted file mode 100644
index 61dac86b53..0000000000
--- a/c/src/lib/libbsp/bare/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start.o%s} \
-%{qrtems_debug: start_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/bare/build-tools b/c/src/lib/libbsp/bare/build-tools
deleted file mode 100644
index 8ea01d3933..0000000000
--- a/c/src/lib/libbsp/bare/build-tools
+++ /dev/null
@@ -1,71 +0,0 @@
-#
-# $Id$
-#
-# Tools to help doing build scripts. Adapted from Joel's bit
-# script.
-#
-
-#
-# USERCHANGE - uncomment this if you want to watch the commands.
-#
-# set -x
-
-start=`date`
-
-#
-# Common exit routine for this script so we can print the starting
-# and ending times.
-#
-
-my_exit()
-{
- stop=`date`
-
- echo
- echo "Started: " $start
- echo "Finished: " $stop
- exit $1
-}
-
-#
-# Handle a fatal error.
-#
-
-fatal_error()
-{
- echo "ERROR: $*" >&2
- my_exit 1
-}
-
-#
-# Checks the status returned by executables and exits if it is non-zero.
-#
-
-check_fatal()
-{
- if [ $1 -ne 0 ] ; then
- shift
- fatal_error $*
- fi
-}
-
-#
-# Test for a valid path, exit if not found
-#
-
-test_path()
-{
- test -d $* || fatal_error "cannot find $*"
- return 0
-}
-
-#
-# Create a directory and check it was made correctly.
-#
-
-checked_mkdir()
-{
- mkdir -p $1
- check_fatal $? "unable to make directory $1"
- return 0
-}
diff --git a/c/src/lib/libbsp/bare/do-bare-bsp-build b/c/src/lib/libbsp/bare/do-bare-bsp-build
deleted file mode 100644
index 16da69e0fe..0000000000
--- a/c/src/lib/libbsp/bare/do-bare-bsp-build
+++ /dev/null
@@ -1,177 +0,0 @@
-#!/bin/bash
-#
-# $Id$
-#
-# RTEMS Bare BSP Build Script.
-#
-# This is designed to allow recording of stdout to log. The log
-# forms part of a clean build trace for validation and verification
-# reasons.
-#
-
-. `echo $0 | sed -e 's/do-rtems-build/build-tools/'`
-
-#
-# The current versions we are building.
-#
-# Note: Please change to suite.
-#
-
-RTEMS=rtems-980618
-
-#
-# The list of processors we want the tools built for.
-#
-
-CPUS="m68k"
-
-#
-# RTEMS CPU target we want to build.
-#
-
-RTEMS_M68K_TARGETS="68000 68030 cpu32"
-
-#
-# The particular host settings we have.
-#
-# Map particulars for different hosts here.
-#
-
-HOST=`hostname`
-
-case "${HOST}" in
- kiwi*)
- ARCHIVE="/ods/archive"
- TOOLS="/ods/egcs"
- RTEMS_PATH=development/rtems/${RTEMS}
- ;;
- *)
- fatal_error "host is not known."
- ;;
-esac
-
-#
-# Where will RTEMS live when installed ?
-#
-
-RTEMS_PREFIX=${TOOLS}/test
-
-echo "Building on ${HOST}, archives in ${ARCHIVE}"
-
-#
-# Who is doing the build.
-#
-
-echo "User profile : "`id`
-
-#
-# Find out where we are
-#
-
-TOPDIR=`pwd`
-
-echo "Top directory is ${TOPDIR}"
-
-#
-# Test the paths to the archives exist.
-#
-
-test_path ${ARCHIVE}/${RTEMS_PATH}
-
-#
-# Get the RTEMS source and patch.
-#
-
-echo "Unpacking rtems source ${ARCHIVE}/${RTEMS_PATH}/${RTEMS}.tgz ... "
-tar zxf ${ARCHIVE}/${RTEMS_PATH}/${RTEMS}.tgz
-check_fatal $? "failed to unpack ${RTEMS}.tgz."
-
-#
-# Build all the processors we support.
-#
-
-for cpu in ${CPUS}; do
-{
- #
- # Create the target.
- #
-
- TARGET=${cpu}-rtems
-
- #
- # On to RTEMS.
- #
-
- case ${cpu} in
- m68k)
- RTEMS_TARGETS=${RTEMS_M68K_TARGETS}
- ;;
- *)
- fatal_error "unknown cpu ${cpu}"
- ;;
- esac
-
- for rtems_target in ${RTEMS_TARGETS}; do
- {
- #
- # Remove the target if found.
- #
-
- echo "Removing the RTEMS bare bsp directory rtems-bare-${rtems_target} ... "
- rm -rf rtems-bare-${rtems_target}
- check_fatal $? "failed to remove rtems-bare-${rtems_target}."
-
- echo "Creating the RTEM build directory for target ${rtems_target} ... "
- checked_mkdir rtems-bare-${rtems_target}
-
- cd rtems-bare-${rtems_target}
-
- #
- # Configure RTEMS.
- #
- # FIXME: the mapping from the rtems_target to the cpu flags
- # just happens to work for the m68k targets. This should
- # be mapped in a way which does not depends on the rtems_target,
- # or RTEMS should support multilibs.
- #
-
- echo "Configuring RTEMS target bare-${rtems_target} ... "
- ../${RTEMS}/configure --target=${TARGET} --prefix=${RTEMS_PREFIX} \
- --enable-cxx --enable-gmake-print-directory \
- --disable-tests --disable-posix --enable-networking \
- --enable-bare-cpu-cflags=-m${rtems_target} \
- --enable-bare-cpu-model=m${rtems_target} \
- --enable-rtemsbsp=bare
- check_fatal $? "failed to configure rtems target."
-
- #
- # Do the RTEMS build.
- #
-
- echo "Building RTEMS target bare-${rtems_target} ... "
- make all install
- check_fatal $? "failed to complete rtems build for target ${rtems_target}."
-
- #
- # Remove the target if found.
- #
-
- echo "Removing the RTEMS bare bsp directory ${RTEMS_PREFIX}/rtems/bare-${rtems_target} ... "
- rm -rf ${RTEMS_PREFIX}/rtems/bare-${rtems_target}
- check_fatal $? "failed to remove ${RTEMS_PREFIX}/rtems/bare-${rtems_target}."
-
- #
- # Fix up the fact that RTEMS always installsthe bare bsp to the bare directory
- #
-
- echo "Moving the RTEMS bare bsp directory to bare-${rtems_target} ... "
- mv ${RTEMS_PREFIX}/rtems/bare ${RTEMS_PREFIX}/rtems/bare-${rtems_target}
- check_fatal $? "failed to move the bare bsp directory to bare-${rtems_target}."
-
- cd ../
- }; done
-}; done
-
-cd ../
-
-my_exit 0
diff --git a/c/src/lib/libbsp/bare/include/Makefile.in b/c/src/lib/libbsp/bare/include/Makefile.in
deleted file mode 100644
index ae1b37f1f7..0000000000
--- a/c/src/lib/libbsp/bare/include/Makefile.in
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: preinstall
-
-preinstall: $(SRCS)
- @INSTALL@ $(INSTINCFLAGS) $(H_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/bare/include/bsp.h b/c/src/lib/libbsp/bare/include/bsp.h
deleted file mode 100644
index 47a2ba8398..0000000000
--- a/c/src/lib/libbsp/bare/include/bsp.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* bsp.h
- *
- * This include file contains all board IO definitions.
- *
- * BARE : Allows you to build RTEMS with-out any BSP specific stuff
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __BARE_BSP_h
-#define __BARE_BSP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <console.h>
-#include <clockdrv.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Stuff for Time Test 27
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler )
-
-#define Cause_tm27_intr()
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( microseconds ) \
- { \
- }
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/*
- * How many libio files we want
- */
-
-#define BSP_LIBIO_MAX_FDS 20
-
-/* functions */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/bare/wrapup/Makefile.in b/c/src/lib/libbsp/bare/wrapup/Makefile.in
deleted file mode 100644
index 32ed030b78..0000000000
--- a/c/src/lib/libbsp/bare/wrapup/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/hppa1.1/Makefile.in b/c/src/lib/libbsp/hppa1.1/Makefile.in
deleted file mode 100644
index f049e9b2e8..0000000000
--- a/c/src/lib/libbsp/hppa1.1/Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# Descend into the $(RTEMS_BSP_FAMILY) directory
-SUB_DIRS=$(RTEMS_BSP_FAMILY)
diff --git a/c/src/lib/libbsp/hppa1.1/pxfl/Makefile.in b/c/src/lib/libbsp/hppa1.1/pxfl/Makefile.in
deleted file mode 100644
index 8a1f64f2b2..0000000000
--- a/c/src/lib/libbsp/hppa1.1/pxfl/Makefile.in
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Build the pixelflow bsp by cd'ing into another floss tree and
-# building it there.
-#
-# NOTE: we also jump sideways in rtems tree and install test/support/include
-# so that floss tests can use the rtems test structures
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-SRCS=$(srcdir)/floss-bsp.h
-
-# HACK alert
-# on a 'make -k' we don't want to bomb out of build
-EXIT_CMD=exit 1
-ifeq (k, $(findstring k, $(MAKEFLAGS)))
-EXIT_CMD=true
-endif
-
-
-all install::
- @$(ECHO); $(ECHO)
- @if [ ! -d $(FLOSS_ROOT) ]; \
- then \
- $(ECHO) "*** ERROR FLOSS_ROOT ($(FLOSS_ROOT)) points to nonexistent directory"; \
- $(ECHO); $(ECHO); \
- $(EXIT_CMD); \
- fi
- @if [ -f $(FLOSS_ROOT)/PURE ]; \
- then \
- $(ECHO) "*** Assuming $(FLOSS_HOME) up to date since ./PURE exists"; \
- else \
- cmd="cd $(RTEMS_ROOT)/c/src/tests/support/include; $(MAKE) install"; \
- $(ECHO) $$cmd; \
- eval $$cmd || $(EXIT_CMD); \
- cmd="cd $(FLOSS_ROOT); $(MAKE) $@"; \
- $(ECHO) $$cmd; \
- eval $$cmd || $(EXIT_CMD); \
- fi
- @$(ECHO); $(ECHO)
- $(INSTALL) -m 444 $(srcdir)/floss-bsp.h $(PROJECT_INCLUDE)/bsp.h
diff --git a/c/src/lib/libbsp/hppa1.1/pxfl/README b/c/src/lib/libbsp/hppa1.1/pxfl/README
deleted file mode 100644
index df3c872a34..0000000000
--- a/c/src/lib/libbsp/hppa1.1/pxfl/README
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# $Id$
-#
-
-This is included just to give rtems users an example of how a Makefile
-can "jump" out of the rtems source tree into another one. This was
-used by the developer of the pxfl bsp to allow them to keep their bsp
-outside the normal rtems tree.
diff --git a/c/src/lib/libbsp/hppa1.1/pxfl/floss-bsp.h b/c/src/lib/libbsp/hppa1.1/pxfl/floss-bsp.h
deleted file mode 100644
index 52a22d686b..0000000000
--- a/c/src/lib/libbsp/hppa1.1/pxfl/floss-bsp.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * we need a bsp.h in the rtems tree to keep the src/tests/...
- * happy.
- * But our bsp.h really lives in floss tree.
- *
- * Fake it out by installing this one in rtems
- *
- # $Id$
- */
-
-#include <floss/bsp.h>
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/Makefile.in b/c/src/lib/libbsp/hppa1.1/simhppa/Makefile.in
deleted file mode 100644
index 2dc18158d3..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/Makefile.in
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-# NOTE: we pick up HPPA clock and timer from libcpu/hppa
-SUB_DIRS=tools include start startup tty shmsupp wrapup
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/bsp_specs b/c/src/lib/libbsp/hppa1.1/simhppa/bsp_specs
deleted file mode 100644
index fe6aa2a53d..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/bsp_specs
+++ /dev/null
@@ -1,22 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start.o%s} \
-%{qrtems_debug: start_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/include/Makefile.in b/c/src/lib/libbsp/hppa1.1/simhppa/include/Makefile.in
deleted file mode 100644
index 51b045ba95..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/include/Makefile.in
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_PIECES = bsp coverhd
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-RTEMS_H_PIECES = ttydrv
-RTEMS_H_FILES=$(RTEMS_H_PIECES:%=$(srcdir)/%.h)
-
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-# If you add equate files, don't forget to uncomment the install line
-# below.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(RTEMS_H_FILES) $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h b/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h
deleted file mode 100644
index cc7f44dd9a..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* bsp.h
- *
- * This include file contains all HP PA-RISC simulator definitions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PXFL_BSP_h
-#define __PXFL_BSP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <clockdrv.h>
-#include <rtems/ttydrv.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 3 /* 3 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Define the interrupt mechanism for Time Test 27
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 1
-
-#define Install_tm27_vector( handler ) \
- ( void ) set_vector( handler, HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER, 1 );
-
-#define Cause_tm27_intr() \
- set_itimer( get_itimer() + 20 )
-
-#define Clear_tm27_intr() \
- set_eirr( 0x80000000 )
-
-#define Lower_tm27_intr() \
- { \
- register unsigned32 ignored; \
- HPPA_ASM_SSM( HPPA_PSW_I, ignored ); \
- }
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-extern void Clock_delay(rtems_unsigned32 microseconds);
-#define delay( microseconds ) \
- Clock_delay(microseconds);
-
-/*
- * Todo: this should be put somewhere else
- */
-
-#undef CLOCK_DRIVER_TABLE_ENTRY
-#define CLOCK_DRIVER_TABLE_ENTRY { Clock_initialize, NULL, NULL, NULL, NULL, Clock_control }
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-);
-
-/*
- * We printf() to a buffer if multiprocessing, *or* if this is set.
- * ref: src/lib/libbsp/hppa/pxfl/iosupp/consupp.c
- */
-
-extern int use_print_buffer;
-
-/*
- * When not doing printf to a buffer, we do printf thru RTEMS libio
- * and our tty driver. Set it up so that console is right.
- */
-
-#define CONSOLE_DRIVER_TABLE_ENTRY \
- { tty_initialize, tty_open, tty_close, tty_read, tty_write, tty_control }
-
-#define HPPA_INTERRUPT_EXTERNAL_MPCI HPPA_INTERRUPT_EXTERNAL_10
-
-rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int);
-
-void bsp_start( void );
-void bsp_cleanup( void );
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration; /* owned by BSP */
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
-extern int cpu_number; /* from 0; cpu number in a multi cpu system */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/include/coverhd.h b/c/src/lib/libbsp/hppa1.1/simhppa/include/coverhd.h
deleted file mode 100644
index c9b0ec13e3..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/include/coverhd.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C for this target.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
-#define CALLING_OVERHEAD_TASK_CREATE 0
-#define CALLING_OVERHEAD_TASK_IDENT 0
-#define CALLING_OVERHEAD_TASK_START 0
-#define CALLING_OVERHEAD_TASK_RESTART 0
-#define CALLING_OVERHEAD_TASK_DELETE 0
-#define CALLING_OVERHEAD_TASK_SUSPEND 0
-#define CALLING_OVERHEAD_TASK_RESUME 0
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
-#define CALLING_OVERHEAD_TASK_MODE 0
-#define CALLING_OVERHEAD_TASK_GET_NOTE 0
-#define CALLING_OVERHEAD_TASK_SET_NOTE 0
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 0
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
-#define CALLING_OVERHEAD_CLOCK_GET 0
-#define CALLING_OVERHEAD_CLOCK_SET 0
-#define CALLING_OVERHEAD_CLOCK_TICK 0
-
-#define CALLING_OVERHEAD_TIMER_CREATE 0
-#define CALLING_OVERHEAD_TIMER_IDENT 0
-#define CALLING_OVERHEAD_TIMER_DELETE 0
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 0
-#define CALLING_OVERHEAD_TIMER_RESET 0
-#define CALLING_OVERHEAD_TIMER_CANCEL 0
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
-
-#define CALLING_OVERHEAD_EVENT_SEND 0
-#define CALLING_OVERHEAD_EVENT_RECEIVE 0
-#define CALLING_OVERHEAD_SIGNAL_CATCH 0
-#define CALLING_OVERHEAD_SIGNAL_SEND 0
-#define CALLING_OVERHEAD_PARTITION_CREATE 0
-#define CALLING_OVERHEAD_PARTITION_IDENT 0
-#define CALLING_OVERHEAD_PARTITION_DELETE 0
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
-#define CALLING_OVERHEAD_REGION_CREATE 0
-#define CALLING_OVERHEAD_REGION_IDENT 0
-#define CALLING_OVERHEAD_REGION_DELETE 0
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
-#define CALLING_OVERHEAD_PORT_CREATE 0
-#define CALLING_OVERHEAD_PORT_IDENT 0
-#define CALLING_OVERHEAD_PORT_DELETE 0
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 0
-#define CALLING_OVERHEAD_IO_OPEN 0
-#define CALLING_OVERHEAD_IO_CLOSE 0
-#define CALLING_OVERHEAD_IO_READ 0
-#define CALLING_OVERHEAD_IO_WRITE 0
-#define CALLING_OVERHEAD_IO_CONTROL 0
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/include/ttydrv.h b/c/src/lib/libbsp/hppa1.1/simhppa/include/ttydrv.h
deleted file mode 100644
index b20878d99c..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/include/ttydrv.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * $Id$
- */
-
-/*
- * definitions for the tty driver
- */
-
-#ifndef _RTEMS_TTYDRV_H
-#define _RTEMS_TTYDRV_H
-
-rtems_device_driver
-tty_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
- );
-
-rtems_device_driver
-tty_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
- );
-
-rtems_device_driver
-tty_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
- );
-
-rtems_device_driver
-tty_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
- );
-
-rtems_device_driver
-tty_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
- );
-
-rtems_device_driver
-tty_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
- );
-
-#endif /* _RTEMS_TTYDRV_H */
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/Makefile.in b/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/Makefile.in
deleted file mode 100644
index 8825079da7..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/shmsupp.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=addrconv getcfg intr lock mpisr
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/README b/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/README
deleted file mode 100644
index cf60698ca4..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/README
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# $Id$
-#
-
-This directory contains the SHM driver support files for the
-HP PA-RISC simulator for the 72000 processor.
-
-WARNING: The interrupt support in this directory currently will
- only work in a homogeneous system.
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/addrconv.c b/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/addrconv.c
deleted file mode 100644
index 7e315c1dc8..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/addrconv.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Shm_Convert_address
- *
- * No address range conversion is required.
- *
- * Input parameters:
- * address - address to convert
- *
- * Output parameters:
- * returns - converted address
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <shm.h>
-
-void *Shm_Convert_address(
- void *address
-)
-{
- return ( address );
-}
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/getcfg.c b/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/getcfg.c
deleted file mode 100644
index 0d330ea0ed..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/getcfg.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* void Shm_Get_configuration( localnode, &shmcfg )
- *
- * This routine initializes, if necessary, and returns a pointer
- * to the Shared Memory Configuration Table for the HP PA-RISC
- * simulator.
- *
- * INPUT PARAMETERS:
- * localnode - local node number
- * shmcfg - address of pointer to SHM Config Table
- *
- * OUTPUT PARAMETERS:
- * *shmcfg - pointer to SHM Config Table
- *
- * NOTES: The MP interrupt used is the Runway bus' ability to directly
- * address the control registers of up to four CPUs and cause
- * interrupts on them.
- *
- * The following table illustrates the configuration limitations:
- *
- * BUS MAX
- * MODE ENDIAN NODES
- * ========= ====== =======
- * POLLED BIG 2+
- * INTERRUPT BIG 2..4 (on Runway)
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#include <shm.h>
-
-#define INTERRUPT 0 /* can be interrupt or polling */
-#define POLLING 1
-
-#define HPPA_RUNWAY_PROC_HPA_BASE ((void *) 0xFFFA0000)
-
-/* given a processor number, where is its HPA? */
-#define HPPA_RUNWAY_HPA(cpu) \
- ((rtems_unsigned32) (HPPA_RUNWAY_PROC_HPA_BASE + ((cpu) * 0x2000)))
-
-#define HPPA_RUNWAY_REG_IO_EIR_OFFSET 0x000
-
-shm_config_table BSP_shm_cfgtbl;
-
-extern void Shm_Cause_interrupt_pxfl( rtems_unsigned32 node );
-
-void Shm_Get_configuration(
- rtems_unsigned32 localnode,
- shm_config_table **shmcfg
-)
-{
- BSP_shm_cfgtbl.base = (vol_u32 *) 0x44000000;
- BSP_shm_cfgtbl.length = 16 * KILOBYTE;
- BSP_shm_cfgtbl.format = SHM_BIG;
-
- BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt_pxfl;
-
-#ifdef NEUTRAL_BIG
- BSP_shm_cfgtbl.convert = NULL_CONVERT;
-#else
- BSP_shm_cfgtbl.convert = CPU_swap_u32;
-#endif
-
-#if ( POLLING == 1 )
- BSP_shm_cfgtbl.poll_intr = POLLED_MODE;
- BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT;
-#else
- BSP_shm_cfgtbl.poll_intr = INTR_MODE;
- BSP_shm_cfgtbl.Intr.address =
- (vol_u32 *) (HPPA_RUNWAY_HPA( localnode - 1) +
- HPPA_RUNWAY_REG_IO_EIR_OFFSET);
- BSP_shm_cfgtbl.Intr.value = HPPA_INTERRUPT_EXTERNAL_MPCI;
- BSP_shm_cfgtbl.Intr.length = LONG;
-#endif
-
- *shmcfg = &BSP_shm_cfgtbl;
-}
-
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/intr.c b/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/intr.c
deleted file mode 100644
index 718ae6dc12..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/intr.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* void Shm_Cause_interrupt_pxfl( node )
- *
- * This routine is the shared memory driver routine which
- * generates interrupts to other CPUs.
- *
- * Input parameters:
- * node - destination of this packet (0 = broadcast)
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdio.h>
-
-#include <rtems.h>
-#include <rtems/error.h>
-
-#include <shm.h>
-
-void Shm_Cause_interrupt_pxfl(
- rtems_unsigned32 node
-)
-{
- Shm_Interrupt_information *intr;
- rtems_unsigned32 *u32;
- rtems_unsigned32 value;
-
- intr = &Shm_Interrupt_table[node];
- value = intr->value;
-
- switch ( intr->length ) {
- case NO_INTERRUPT:
- break;
-
- case LONG:
- u32 = (rtems_unsigned32 *)intr->address;
- HPPA_ASM_STWAS( value, 0, u32 );
- break;
- default:
- fprintf( stderr, "Shm_Cause_interrupt_pxfl: Unsupported length!!!\n" );
- }
-}
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/lock.c b/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/lock.c
deleted file mode 100644
index 0da4c54725..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/lock.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Shared Memory Lock Routines
- *
- * This shared memory locked queue support routine need to be
- * able to lock the specified locked queue. Interrupts are
- * disabled while the queue is locked to prevent preemption
- * and deadlock when two tasks poll for the same lock.
- * previous level.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <shm.h>
-
-/*
- * Shm_Initialize_lock
- *
- * Initialize the lock for the specified locked queue.
- */
-
-void Shm_Initialize_lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- lq_cb->lock = LQ_UNLOCKED;
-}
-
-/* Shm_Lock( &lq_cb )
- *
- * This shared memory locked queue support routine locks the
- * specified locked queue. It disables interrupts to prevent
- * a deadlock condition.
- */
-
-void Shm_Lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
- vol_u32 *lockptr = &lq_cb->lock;
- rtems_unsigned32 lock_value;
-
- rtems_interrupt_disable( isr_level );
-
- Shm_isrstat = isr_level;
-
- do {
- HPPA_ASM_LDCWS( 0, 0, lockptr, lock_value );
- } while (lock_value == SHM_LOCK_VALUE);
-}
-
-/*
- * Shm_Unlock
- *
- * Unlock the lock for the specified locked queue.
- */
-
-void Shm_Unlock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
-
- lq_cb->lock = SHM_UNLOCK_VALUE;
- isr_level = Shm_isrstat;
- rtems_interrupt_enable( isr_level );
-}
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/mpisr.c b/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/mpisr.c
deleted file mode 100644
index 741dacb941..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/mpisr.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Shm_setvec
- *
- * This driver routine sets the SHM interrupt vector to point to the
- * driver's SHM interrupt service routine.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <shm.h>
-
-void Shm_setvec( void )
-{
- set_vector( Shm_isr, HPPA_INTERRUPT_EXTERNAL_MPCI, 1 );
-}
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/start/Makefile.in b/c/src/lib/libbsp/hppa1.1/simhppa/start/Makefile.in
deleted file mode 100644
index bafd65a3ff..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/start/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/start.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/start/start.s b/c/src/lib/libbsp/hppa1.1/simhppa/start/start.s
deleted file mode 100644
index 86298f0304..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/start/start.s
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * crt0.S -- startup file for hppa on RTEMS
- *
- * $Id$
- */
-
- .COPYRIGHT "crt0.S for hppa"
-
- .DATA
-
-_progname .STRINGZ "simhppa"
-_crt0_argv .WORD _progname, 0
-
-/*
- * Set up the standard spaces (sections) These definitions come
- * from /lib/pcc_prefix.s.
- */
- .TEXT
-
-/*
- * stuff we need that is defined elsewhere.
- */
- .IMPORT boot_card, CODE
- .IMPORT _bss_start, DATA
- .IMPORT _bss_end, DATA
- .IMPORT environ, DATA
-
-/*
- * start -- set things up so the application will run.
- *
- */
- .PROC
- .CALLINFO SAVE_SP, FRAME=48
- .EXPORT $START$,ENTRY
- .EXPORT start,ENTRY
-$START$
-start:
-
-/*
- * Get a stack
- */
-
- ldil L%crt_stack+48,%r30
- ldo R%crt_stack+48(%r30),%r30
-
-/*
- * we need to set %r27 (global data pointer) here
- */
-
- ldil L%$global$,%r27
- ldo R%$global$(%r27),%r27
-
-/*
- * zerobss -- zero out the bss section
- * XXX We don't do this since simulator and boot rom will do this for us.
- */
-#if 0
- ; load the start of bss
- ldil L%_bss_start,%r4
- ldo R%_bss_start(%r4),%r4
-
- ; load the end of bss
- ldil L%_bss_end,%r5
- ldo R%_bss_end(%r5),%r5
-
-
-bssloop
- addi -1,%r5,%r5 ; decrement _bss_end
- stb %r0,0(0,%r5) ; we do this by bytes for now even
- ; though it is slower, it is safer
- combf,= %r4,%r5, bssloop
- nop
-#endif
-
- ldi 1,%ret0
-
-/*
- * Call the "boot_card" routine from the application to get it going.
- * We call it as boot_card(1, argv, 0)
- */
-
- copy %r0, %r24
-
- ldil L%_crt0_argv,%r25
- ldo R%_crt0_argv(%r25),%r25
-
- bl boot_card,%r2
- ldo 1(%r0), %r26
-
- .PROCEND
-/*
- * _exit -- Exit from the application. Normally we cause a user trap
- * to return to the ROM monitor for another run, but with
- * this monitor we can not. Still, "C" wants this symbol, it
- * should be here. Jumping to 0xF0000004 jumps back into the
- * firmware, while writing a 5 to 0xFFFE0030 causes a reset.
- */
-_exit_fallthru
- .PROC
- .CALLINFO
- .ENTRY
-
- ;; This just causes a breakpoint exception
- break 0x0,0x0
- bv,n (%rp)
- nop
- .EXIT
- .PROCEND
-
-/*
- * _sr4export -- support for called functions. (mostly for GDB)
- */
- .EXPORT _sr4export, ENTRY
-_sr4export:
- .PROC
- .CALLINFO
- .ENTRY
-
- ble 0(%sr4,%r22)
- copy %r31,%rp
- ldw -18(%sr0,%sp),%rp
- ldsid (%sr0,%rp),%r1
- mtsp %r1,%sr0
- be,n 0(%sr0,%rp)
- nop
- .EXIT
- .PROCEND
-
-
- .subspa $UNWIND_START$,QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=56
- .export $UNWIND_START
-$UNWIND_START
- .subspa $UNWIND$,QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=64
- .subspa $UNWIND_END$,QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=72
- .export $UNWIND_END
-$UNWIND_END
- .subspa $RECOVER_START$,QUAD=0,ALIGN=4,ACCESS=0x2c,SORT=73
- .export $RECOVER_START
-$RECOVER_START
- .subspa $RECOVER$,QUAD=0,ALIGN=4,ACCESS=0x2c,SORT=80
- .subspa $RECOVER_END$,QUAD=0,ALIGN=4,ACCESS=0x2c,SORT=88
- .export $RECOVER_END
-$RECOVER_END
-
-/*
- * Here we set up the standard date sub spaces.
- *
- * Set up some room for a stack. We just grab a chunk of memory.
- * We also setup some space for the global variable space, which
- * must be done using the reserved name "$global$" so "C" code
- * can find it. The stack grows towards the higher addresses.
- */
-
- .subspa $DATA$,QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=16
- .subspa $SHORTDATA$,QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=24
- .subspa $GLOBAL$,QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=40
- .export $global$
-$global$
- .subspa $SHORTBSS$,QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=80,ZERO
- .subspa $BSS$,QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=82,ZERO
-
- .subspa $STACK$,QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=88,ZERO
-
- .export crt_stack
-crt_stack
- .comm 0x1000
-
- .end
-
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/startup/Makefile.in b/c/src/lib/libbsp/hppa1.1/simhppa/startup/Makefile.in
deleted file mode 100644
index 240cf38e4b..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/startup/Makefile.in
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspclean.c b/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspclean.c
deleted file mode 100644
index 5eac4957de..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspclean.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine normally is part of start.s and returns
- * control to a monitor but on the HP PA-RISC simulator
- * we do that directly from main.c.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-/*
- * The app has "exited" (called rtems_shutdown_executive)
- */
-
-void bsp_cleanup( void )
-{
- /*
- * Invoke any fatal error extension and "halt"
- * By definition, rtems_fatal_error_occurred does not return.
- */
-
- rtems_fatal_error_occurred(0);
-}
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c b/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c
deleted file mode 100644
index 4a94bcfb9d..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-extern rtems_configuration_table Configuration;
-
-rtems_configuration_table BSP_Configuration;
-rtems_cpu_table Cpu_table;
-
-int cpu_number;
-
-#define WORKSPACE_SIZE (1024 * 1024)
-rtems_unsigned8 MY_WORK_SPACE[ WORKSPACE_SIZE ];
-
-/*
- * Amount to increment itimer by each pass
- * It is a variable instead of a #define to allow the 'looptest'
- * script to bump it without recompiling rtems
- */
-
-rtems_unsigned32 CPU_HPPA_CLICKS_PER_TICK;
-
-#if SIMHPPA_FAST_IDLE
-
-/*
- * Many of the tests are very slow on the simulator because they have
- * have 5 second delays hardwired in.
- * Try to speed those tests up by speeding up the clock when in idle
- */
-
-rtems_extension fast_idle_switch_hook(
- rtems_tcb *current_task,
- rtems_tcb *heir_task
-)
-{
- static rtems_unsigned32 normal_clock = ~0;
- static rtems_unsigned32 fast_clock;
-
- /* init our params on first call */
- if (normal_clock == (rtems_unsigned32) ~0)
- {
- normal_clock = CPU_HPPA_CLICKS_PER_TICK;
- fast_clock = CPU_HPPA_CLICKS_PER_TICK / 0x100;
- if (fast_clock == 0) /* who? me? pathological? never! */
- fast_clock++;
- }
-
- /*
- * Checking for 'name' field of 'IDLE' is not the best/safest,
- * but its the best we could think of at the moment.
- */
-
- if (heir_task == _Thread_Idle)
- CPU_HPPA_CLICKS_PER_TICK = fast_clock;
- else if (current_task == _Thread_Idle)
- CPU_HPPA_CLICKS_PER_TICK = normal_clock;
-}
-
-#endif
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * Notes:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
- /*
- * on MP systems, always use the print buffer
- * instead of the (broken) system calls
- */
-
- if (BSP_Configuration.User_multiprocessing_table)
- use_print_buffer = 1;
-
-#ifdef SIMHPPA_ROM
- use_print_buffer = 1;
-#endif
-
-#if SIMHPPA_FAST_IDLE
- /*
- * Install the fast idle task switch extension
- *
- * on MP systems, might now want to do this; it confuses at least
- * one test (mp06)
- */
-
-#if 0
- if (BSP_Configuration.User_multiprocessing_table == 0)
-#endif
- {
- rtems_extensions_table fast_idle_extension;
- rtems_id extension_id;
- rtems_status_code rc;
-
- memset(&fast_idle_extension, 0, sizeof(fast_idle_extension));
-
- fast_idle_extension.thread_switch = fast_idle_switch_hook;
-
- rc = rtems_extension_create(rtems_build_name('F', 'D', 'L', 'E'),
- &fast_idle_extension, &extension_id);
- if (rc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(rc);
- }
-#endif
-}
-
-void bsp_start(void)
-{
- /*
- * Set cpu_number to accurately reflect our cpu number
- */
-
-#ifdef hppa7200
- /*
- * Use HPPA_DR0 if supported
- */
- {
- int dr0;
- HPPA_ASM_MFCPU(HPPA_DR0, dr0);
- cpu_number = (dr0 >> 4) & 0x7;
- }
-#else
- if (Configuration.User_multiprocessing_table)
- cpu_number = Configuration.User_multiprocessing_table->node - 1;
- else
- cpu_number = 0;
-#endif
-
- BSP_Configuration.work_space_start = (void *)MY_WORK_SPACE;
- if (BSP_Configuration.work_space_size)
- BSP_Configuration.work_space_size = WORKSPACE_SIZE;
-
- /*
- * Set up our hooks
- * Make sure libc_init is done before drivers init'd so that
- * they can use atexit()
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook; /* register drivers */
-
- /*
- * Don't zero out the workspace. The simulator did it for us.
- */
-
- Cpu_table.do_zero_of_workspace = FALSE;
- Cpu_table.interrupt_stack_size = (12 * 1024);
-
- /*
- * Set this artificially low for the simulator
- */
-
- Cpu_table.itimer_clicks_per_microsecond = 1;
-
-#if 0
- /*
- * Commented by DIVISION INC. External interrupt
- * processing is now divorced from RTEMS for HPPA.
- */
-
- /*
- * Determine the external interrupt processing order
- * the external interrupt handler walks thru this table, in
- * order checking for posted interrupts.
- */
-
- Cpu_table.external_interrupts = 0;
-
- Cpu_table.external_interrupt[ Cpu_table.external_interrupts ] =
- HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER;
- Cpu_table.external_interrupts++;
-
- if ( Configuration.User_multiprocessing_table ) {
- Cpu_table.external_interrupt[ Cpu_table.external_interrupts ] =
- HPPA_INTERRUPT_EXTERNAL_10;
- Cpu_table.external_interrupts++;
- }
-#endif
-
-#if SIMHPPA_FAST_IDLE
- /*
- * Add 1 extension for fast idle
- */
-
- BSP_Configuration.maximum_extensions++;
-#endif
-
- /*
- * Add 1 extension for MPCI_fatal
- */
-
- if (BSP_Configuration.User_multiprocessing_table)
- BSP_Configuration.maximum_extensions++;
-
- /*
- * Set the "clicks per tick" for the simulator
- * used by libcpu/hppa/clock/clock.c to schedule interrupts
- *
- * Set it only if 0 to allow for simulator setting it via script
- * on test startup.
- */
-
- if (CPU_HPPA_CLICKS_PER_TICK == 0)
- CPU_HPPA_CLICKS_PER_TICK = 0x4000;
-}
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/startup/setvec.c b/c/src/lib/libbsp/hppa1.1/simhppa/startup/setvec.c
deleted file mode 100644
index b55d5e271e..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/startup/setvec.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on the HP PA-RISC simulator.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * NOTE 'type' is ignored on hppa; all interrupts are owned by RTEMS
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-/*
- * Install an interrupt handler in the right place
- * given its vector number from cpu/hppa.h
- * There are 2 places an interrupt can be installed
- * _ISR_Vector_table
- * bsp interrupt XXX: nyi
- *
- * We decide which based on the vector number
- */
-
-rtems_isr_entry
-set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- rtems_isr_entry previous_isr;
-
- /* is it an on chip interrupt? */
- /* XXX this should say CPU_INTERRUPT_NUMBER_OF_VECTORS */
- if (vector < HPPA_INTERRUPT_MAX)
- {
- rtems_interrupt_catch(handler, vector, &previous_isr);
- }
-#if 0 /* XXX */
- else if ((vector >= HPPA_INTERRUPT_BSP_BASE) &&
- (vector < (HPPA_INTERRUPT_BSP_BASE + HPPA_BSP_INTERRUPTS)))
- {
- pxfl_interrupt_install(handler,
- vector - HPPA_INTERRUPT_BSP_BASE,
- (rtems_isr_entry *) &previous_isr);
- }
-#endif
-
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/times b/c/src/lib/libbsp/hppa1.1/simhppa/times
deleted file mode 100644
index 272488a8c0..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/times
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# Timing Test Suite Results for the PA-RISC Simulator.
-#
-# $Id$
-#
-
-Times are not available for the PA-RISC Simulator.
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/tools/Makefile.in b/c/src/lib/libbsp/hppa1.1/simhppa/tools/Makefile.in
deleted file mode 100644
index e90cae8569..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/tools/Makefile.in
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# we use host compiler here for genoffsets. Hopefully it has same alignment!!
-USE_HOST_COMPILER=yes
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=print_dump
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-PGMS=${ARCH}/print_dump
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here.
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGMS)
- $(INSTALL) -m 555 ${PGMS} ${PROJECT_RELEASE}/bin
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/tools/print_dump.c b/c/src/lib/libbsp/hppa1.1/simhppa/tools/print_dump.c
deleted file mode 100644
index ec85339e41..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/tools/print_dump.c
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * print_dump
- *
- * COPYRIGHT (c) 1994 by Division Incorporated
- *
- * The license and distribution 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 GETOPTARGS "v"
-
-char *USAGE = "\
-usage: print_dump [ -v ] \n\
- -v -- verbose\n\
- Reads HP simulator 'memdump' output of 'print_buffer' structure
- on stdin. Dumps it out in vanilla ASCII.
-";
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <memory.h>
-#include <stdarg.h>
-
-#include "../../../../../../build-tools/src/config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-#if defined(__linux__) && (__GLIBC__ < 2)
-extern char *sys_errlist[];
-#endif
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-#define Failed(x) (((int) (x)) == -1)
-#define TRUE 1
-#define FALSE 0
-#define STREQ(a,b) (strcmp(a,b) == 0)
-#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
-
-/*
- * Definitions for unsigned "ints"; especially for use in data structures
- * that will be shared among (potentially) different cpu's (we punt on
- * byte ordering problems tho)
- */
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned int u32;
-
-typedef union uval {
- u8 uv_chars[4];
- u16 uv_words[2];
- u32 uv_long;
- void *uv_ptr[sizeof(long) / sizeof(void *)];
-} uval_t;
-
-
-/*
- * vars controlled by command line options
- */
-
-int verbose = FALSE; /* be verbose */
-
-extern char *optarg; /* getopt(3) control vars */
-extern int optind, opterr;
-extern int errno;
-
-char *progname; /* for error() */
-
-void error(int errn, ...);
-
-#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define ERR_FATAL (ERR_ERRNO / 2) /* error is fatal; no return */
-#define ERR_ABORT (ERR_ERRNO / 4) /* error is fatal; abort */
-#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
-
-int process(void);
-void prchar(unsigned int ch);
-
-
-int
-main(int argc, char **argv, char **env)
-{
- register int c;
- int showusage = FALSE; /* usage error? */
-
- /*
- * figure out invocation leaf-name
- */
-
- if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
- progname = argv[0];
- else
- progname++;
-
- argv[0] = progname; /* for getopt err reporting */
-
- /*
- * Check options and arguments.
- */
-
- opterr = 0; /* we'll report all errors */
- while ((c = getopt(argc, argv, GETOPTARGS)) != EOF)
- switch (c)
- {
- case 'v': /* toggle verbose */
- verbose = ! verbose;
- break;
-
- case '?':
- showusage = TRUE;
- }
-
- if (showusage)
- {
- (void) fprintf(stderr, "%s", USAGE);
- exit(1);
- }
-
- return process();
-}
-
-
-/*
- * process(arg)
- *
- * Input looks like this
- *
- * Starting address: 00000001.480035a0
- * -----------------------------------
-
-+0000 / 0d0a0d0a 2a2a2a20 53454d20 54455354 202d2d20 4e4f4445 2032202a 2a2a0d0a
-+0020 / 73703a20 30783433 30303030 31300d0a 30783438 30613161 38383a20 676f7420
- ....
-+0b40 / xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx
-
- *
- * The 'xxxxxxxxx' shows up if the page has not been allocated.
- */
-
-int
-process(void)
-{
- uval_t b[8];
- u32 ignore;
- char *p;
- int i;
- int failed_once;
-
- char line[1024];
-
-#define PRINT_BUFFER_SIZE (16 * 1024)
- struct {
- int index;
- int size;
- u8 buffer[PRINT_BUFFER_SIZE];
- } print_buffer;
-
- /* we stuff the data into print_buffer using memcpy() */
- p = (char *) &print_buffer;
-
- failed_once = 0;
-
- while (gets(line))
- {
- char *cp;
-
- /* hack; deal with the 'xxxxxxxx' problem noted above */
- for (cp=line; *cp; cp++)
- if (*cp == 'x')
- *cp = '0';
-
- if (*line != '+')
- continue;
- if (sscanf(line, "+%x / %x %x %x %x %x %x %x %x\n",
- &ignore,
- &b[0].uv_long,
- &b[1].uv_long,
- &b[2].uv_long,
- &b[3].uv_long,
- &b[4].uv_long,
- &b[5].uv_long,
- &b[6].uv_long,
- &b[7].uv_long) != 9)
- {
- if (failed_once)
- error(ERR_FATAL, "2nd format problem; giving up");
- error(0, "format problem in line: `%s`", line);
- failed_once = 1;
- }
-
- memcpy((void *) p, (void *) b, sizeof(b));
- p += sizeof(b);
- }
-
- if (verbose)
- printf("buffer size: %d\n", print_buffer.size);
-
- if (print_buffer.size < 0)
- error(ERR_FATAL, "size is too small");
-
- if (print_buffer.size != sizeof(print_buffer.buffer))
- {
- error(ERR_FATAL, "buffer size mismatch, expected %d",
- sizeof(print_buffer.buffer));
- /* XXX we really should just dynamically allocate the buffer */
- }
-
- i = print_buffer.index + 1;
- while (i != print_buffer.index)
- {
- unsigned int c;
- c = print_buffer.buffer[i++];
- if (c && (c != '\r'))
- prchar(c);
- i %= print_buffer.size;
- }
- printf("\n");
- return 0;
-}
-
-/* de-controlify */
-char *de_control[] = {
- "^@", "^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", ":", ";",
- "<", "=", ">", "?", "@", "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", "{", "|", "}", "~", "^?",
- "M-^@", "M-^A", "M-^B", "M-^C", "M-^D", "M-^E", "M-^F", "M-^G",
- "M-^H", "M-^I", "M-^J", "M-^K", "M-^L", "M-^M", "M-^N", "M-^O",
- "M-^P", "M-^Q", "M-^R", "M-^S", "M-^T", "M-^U", "M-^V", "M-^W",
- "M-^X", "M-^Y", "M-^Z", "M-^[", "M-^\\", "M-^]", "M-^~", "M-^_",
- "M- ", "M-!", "M-\"", "M-#", "M-$", "M-%", "M-&", "M-'",
- "M-(", "M-)", "M-*", "M-+", "M-,", "M--", "M-.", "M-/",
- "M-0", "M-1", "M-2", "M-3", "M-4", "M-5", "M-6", "M-7",
- "M-8", "M-9", "M-:", "M-;", "M-<", "M-=", "M->", "M-?",
- "M-@", "M-A", "M-B", "M-C", "M-D", "M-E", "M-F", "M-G",
- "M-H", "M-I", "M-J", "M-K", "M-L", "M-M", "M-N", "M-O",
- "M-P", "M-Q", "M-R", "M-S", "M-T", "M-U", "M-V", "M-W",
- "M-X", "M-Y", "M-Z", "M-[", "M-\\", "M-]", "M-^", "M-_",
- "M-`", "M-a", "M-b", "M-c", "M-d", "M-e", "M-f", "M-g",
- "M-h", "M-i", "M-j", "M-k", "M-l", "M-m", "M-n", "M-o",
- "M-p", "M-q", "M-r", "M-s", "M-t", "M-u", "M-v", "M-w",
- "M-x", "M-y", "M-z", "M-{", "M-|", "M-}", "M-~", "M-^?"
-};
-
-/*
- * prchar(ch); print ch in a readable format, ie ^X or X or ~^X or DEL, etc.
- */
-
-void
-prchar(unsigned int ch)
-{
- if (isprint(ch) || isspace(ch))
- putchar(ch);
- else
- printf("%s", de_control[ch]);
-}
-
-
-/*
- * error(errn, arglist)
- * report an error to stderr using printf(3) conventions.
- * Any output is preceded by '<progname>: '
- *
- * Uses ERR_EXIT bit to request exit(errn)
- * ERR_ABORT to request abort()
- * ERR_ERRNO to indicate use of errno instead of argument.
- *
- * If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
- * associated error message is appended to the output.
- */
-
-/*VARARGS*/
-
-void
-error(int error_flag, ...)
-{
- va_list arglist;
- register char *format;
- int local_errno;
-
- extern int errno;
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- local_errno = error_flag & ~ERR_MASK;
- if (error_flag & ERR_ERRNO) /* use errno? */
- local_errno = errno;
-
- va_start(arglist, error_flag);
- format = va_arg(arglist, char *);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, format, arglist);
- va_end(arglist);
-
- if (local_errno)
- (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
- else
- (void) fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (ERR_FATAL | ERR_ABORT))
- {
- if (error_flag & ERR_FATAL)
- {
- error(0, local_errno ? "fatal error, exiting" : "exiting");
- exit(local_errno);
- }
- else
- {
- error(0, "fatal error, aborting");
- abort();
- }
- }
-}
-
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/tty/Makefile.in b/c/src/lib/libbsp/hppa1.1/simhppa/tty/Makefile.in
deleted file mode 100644
index 62f75c3b3d..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/tty/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/tty.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=tty
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/tty/tty.c b/c/src/lib/libbsp/hppa1.1/simhppa/tty/tty.c
deleted file mode 100644
index cc854b1f25..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/tty/tty.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Tty IO Driver
- * This is a "libio" driver based on libc/support/generic/libio interface
- * which is on top of the RTEMS IO manager.
- *
- * These provide UNIX-like read and write calls for the C library.
- *
- * COPYRIGHT (c) 1994 by Division Incorporated
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <errno.h>
-
-#define PRINT_BUFFER_SIZE (16 * 1024)
-
-/*
- * NOTE: this structure is dumplicated in print_dump.c utility
- */
-
-struct {
- int index;
- int size;
- char buffer[PRINT_BUFFER_SIZE];
-} print_buffer;
-
-/* always use printf buffer if non-zero */
-int use_print_buffer;
-
-static int host_read_syscall(int fd, char *buffer, int count);
-static int host_write_syscall(int fd, char *buffer, int count);
-
-rtems_device_driver
-tty_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
- )
-{
- rtems_status_code status;
-
- status = rtems_io_register_name("/dev/tty00",
- major,
- (rtems_device_minor_number) 0);
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver
-tty_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
- )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver
-tty_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
- )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver
-tty_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
- )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-
-rtems_device_driver
-tty_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
- )
-{
- rtems_libio_rw_args_t *rw_args;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- /*
- * If we are printing to a buffer, then just return newline on all
- * read's. If we return 0 bytes read, then the pause() calls in
- * the RTEMS tests get hosed (pause() does a gets())
- */
-
- if ( use_print_buffer )
- {
- *rw_args->buffer = '\n';
- count = 1;
- }
- else
- {
- count = host_read_syscall(0, rw_args->buffer, rw_args->count);
- }
-
- if (count >= 0)
- {
- rw_args->bytes_moved = count;
- return RTEMS_SUCCESSFUL;
- }
- return RTEMS_UNSATISFIED;
-}
-
-rtems_device_driver
-tty_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
- )
-{
- unsigned32 level;
- rtems_libio_rw_args_t *rw_args;
- int count = 0;
- int fd = 1; /* XXX fixme; needs to be saved in iop */
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- /*
- * HACK alert
- *
- * Some of the simulators have real problems when multi cpu and
- * using the system calls. Until this is fixed, if we are multi
- * cpu then we write to a printf buffer
- */
-
- if ( use_print_buffer )
- {
- /* save size in memory for dumper */
- if (print_buffer.size == 0)
- print_buffer.size = PRINT_BUFFER_SIZE;
-
- while (rw_args->count-- > 0)
- {
- rtems_interrupt_disable(level);
- print_buffer.buffer[print_buffer.index] = *rw_args->buffer++;
- print_buffer.index++;
- print_buffer.index &= (PRINT_BUFFER_SIZE - 1);
- print_buffer.buffer[print_buffer.index] = 0;
- rtems_interrupt_enable(level);
- count++;
- }
- }
- else
- {
-#if 1
- /*
- * if on a multi cpu system and writing to stdout, redirect to stderr
- * so we can keep them separate
- */
-
- if ((cpu_number == 1) && (fd == 1))
- fd = 2;
-#endif
- count = host_write_syscall(fd, rw_args->buffer, rw_args->count);
- }
-
- if (count >= 0)
- {
- rw_args->bytes_moved = count;
- return RTEMS_SUCCESSFUL;
- }
- return RTEMS_UNSATISFIED;
-}
-
-
-/*
- * Host system call hack.
- * This little trick gets all the args in the right registers
- * for the system call and permits simpler inline asm.
- * Since this whole thing (syscalls under simulator) is a hack,
- * this little bit more is not going to hurt anything.
- */
-
-
-static int
-host_read_syscall(
- int fd,
- char *buffer,
- int count
- )
-{
- unsigned32 level;
- int rc;
-
- rtems_interrupt_disable(level);
-
- /* This is an HPUX system call, with return value copied out */
- asm volatile (" stw %%r19,-28(0,%%r30)\n\
- ldil L%%0xc0000000,%%r1\n\
- ble 4(7,%%r1)\n\
- ldi 3,%%r22\n\
- ldw -28(0,%%r30),%%r19\n\
- copy %%r28, %0"
- : "=r" (rc)
- : );
-
- rtems_interrupt_enable(level);
- return rc;
-}
-
-static int
-host_write_syscall(
- int fd,
- char *buffer,
- int count
- )
-{
- unsigned32 level;
- int rc;
-
- rtems_interrupt_disable(level);
-
- /* This is an HPUX system call, with return value copied out */
- asm volatile (" stw %%r19,-28(0,%%r30)\n\
- ldil L%%0xc0000000,%%r1\n\
- ble 4(7,%%r1)\n\
- ldi 4,%%r22\n\
- ldw -28(0,%%r30),%%r19\n\
- copy %%r28, %0"
- : "=r" (rc)
- : );
-
- rtems_interrupt_enable(level);
- return rc;
-}
-
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/wrapup/Makefile.in b/c/src/lib/libbsp/hppa1.1/simhppa/wrapup/Makefile.in
deleted file mode 100644
index c072dea725..0000000000
--- a/c/src/lib/libbsp/hppa1.1/simhppa/wrapup/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup tty shmsupp
-# pieces to pick up out of libcpu/hppa
-CPU_PIECES=clock milli timer
-GENERIC_PIECES=shmdr
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(CPU_PIECES), \
- ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), \
- ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/i386/Makefile.in b/c/src/lib/libbsp/i386/Makefile.in
deleted file mode 100644
index 98bc04bc5d..0000000000
--- a/c/src/lib/libbsp/i386/Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# Descend into the $(RTEMS_BSP_FAMILY) directory
-SUB_DIRS=shared $(RTEMS_BSP_FAMILY)
diff --git a/c/src/lib/libbsp/i386/force386/Makefile.in b/c/src/lib/libbsp/i386/force386/Makefile.in
deleted file mode 100644
index 47328bffdf..0000000000
--- a/c/src/lib/libbsp/i386/force386/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include start startup clock console shmsupp timer wrapup
diff --git a/c/src/lib/libbsp/i386/force386/bsp_specs b/c/src/lib/libbsp/i386/force386/bsp_specs
deleted file mode 100644
index 61dac86b53..0000000000
--- a/c/src/lib/libbsp/i386/force386/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start.o%s} \
-%{qrtems_debug: start_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/i386/force386/clock/Makefile.in b/c/src/lib/libbsp/i386/force386/clock/Makefile.in
deleted file mode 100644
index d882f1d00f..0000000000
--- a/c/src/lib/libbsp/i386/force386/clock/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i386/force386/clock/ckinit.c b/c/src/lib/libbsp/i386/force386/clock/ckinit.c
deleted file mode 100644
index 947b777654..0000000000
--- a/c/src/lib/libbsp/i386/force386/clock/ckinit.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/* Clock_initialize
- *
- * This routine initializes the Motorola MFP 68901 on the
- * FORCE CPU386 board. The tick frequency is 1 millisecond.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#include <rtems/libio.h>
-
-#include <stdlib.h>
-
-#define CLOCK_VECTOR 0x38
-
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-
-volatile rtems_unsigned32 Clock_driver_ticks;
-
-rtems_isr_entry Old_ticker;
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_major_number rtems_clock_minor = 0;
-
-/*
- * This is the ISR handler.
- */
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
- /* enable_tracing(); */
- Clock_driver_ticks += 1;
- if ( Clock_isrs == 1 ) {
- rtems_clock_tick();
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
- }
- else
- Clock_isrs -= 1;
-}
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
- Clock_driver_ticks = 0;
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- Old_ticker = ( rtems_isr_entry ) set_vector( clock_isr, CLOCK_VECTOR, 1 );
- outport_byte( TBCR, 0x14 ); /* reset it, delay mode, 50X */
- outport_byte( TBDR, 0x50 ); /* 1 millisecond */
- outport_byte( IERA, 0x41 ); /* enable interrupt for B */
- }
- atexit( Clock_exit );
-}
-
-void Clock_exit( void )
-{
- if ( BSP_Configuration.ticks_per_timeslice ) {
- outport_byte( TBCR, 0x00 ); /* initial value */
- outport_byte( IERA, 0x40 ); /* disable interrupt */
- /* ??? Is "do not restore old vector" causing problems? */
- }
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/i386/force386/console/Makefile.in b/c/src/lib/libbsp/i386/force386/console/Makefile.in
deleted file mode 100644
index fd05ddfedd..0000000000
--- a/c/src/lib/libbsp/i386/force386/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i386/force386/console/console.c b/c/src/lib/libbsp/i386/force386/console/console.c
deleted file mode 100644
index bf669748f8..0000000000
--- a/c/src/lib/libbsp/i386/force386/console/console.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * This file contains the Force CPU386 console IO package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 F386_INIT
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <stdlib.h>
-
-/* console_cleanup
- *
- * This routine is called at exit to clean up the console hardware.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-void console_cleanup( void )
-{
- register rtems_unsigned8 ignored;
- /*
- * FORCE technical support mentioned that it may be necessary to
- * read the DUSCC RX_BUFFER port four times to remove all junk.
- * This code is a little more paranoid.
- */
-
- inport_byte( RX_BUFFER, ignored );
- inport_byte( RX_BUFFER, ignored );
- inport_byte( RX_BUFFER, ignored );
- inport_byte( RX_BUFFER, ignored );
- inport_byte( RX_BUFFER, ignored );
-}
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- /*
- * flush the console now and at exit. Just in case.
- */
-
- console_cleanup();
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- atexit( console_cleanup );
-
- return RTEMS_SUCCESSFUL;
-}
-
-
-/* is_character_ready
- *
- * This routine returns TRUE if a character is available.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_boolean is_character_ready(
- char *ch
-)
-{
- register rtems_unsigned8 status;
-
- inport_byte( RX_STATUS, status );
-
- if ( Is_rx_ready( status ) ) {
- inport_byte( RX_BUFFER, status );
- *ch = status;
- return TRUE;
- }
- return FALSE;
-}
-
-/* inbyte
- *
- * This routine reads a character from the UART.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- * character read from UART
- */
-
-char inbyte( void )
-{
- register rtems_unsigned8 status;
- char ch;
-
- do {
- inport_byte( RX_STATUS, status );
- } while ( !Is_rx_ready( status ) );
-
-#if ( PORTB == 1 )
- /*
- * Force example code resets the Channel B Receiver here.
- * It appears to cause XON's to be lost.
- */
-
- /* outport_byte( RX_STATUS, 0x10 ); */
-#endif
-
- inport_byte( RX_BUFFER, ch );
-
- return ch;
-}
-
-/* outbyte
- *
- * This routine transmits a character out the port. It supports
- * XON/XOFF flow control.
- *
- * Input parameters:
- * ch - character to be transmitted
- *
- * Output parameters: NONE
- */
-
-void outbyte(
- char ch
-)
-{
- rtems_unsigned8 status;
-
- do {
- inport_byte( TX_STATUS, status );
- } while ( !Is_tx_ready( status ) );
-
-#if 0
- while ( is_character_ready( &status ) == TRUE ) { /* must be an XOFF */
- if ( status == XOFF )
- do {
- while ( is_character_ready( &status ) == FALSE ) ;
- } while ( status != XON );
- }
-#endif
-
- outport_byte( TX_BUFFER, ch );
-}
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte();
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r');
- }
- outbyte( buffer[ count ] );
- }
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libbsp/i386/force386/include/Makefile.in b/c/src/lib/libbsp/i386/force386/include/Makefile.in
deleted file mode 100644
index 7d8581095f..0000000000
--- a/c/src/lib/libbsp/i386/force386/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/i386/force386/include/bsp.h b/c/src/lib/libbsp/i386/force386/include/bsp.h
deleted file mode 100644
index 63e06e2326..0000000000
--- a/c/src/lib/libbsp/i386/force386/include/bsp.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/* bsp.h
- *
- * This include file definitions related to the Force CPU-386 board.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __FORCE386_h
-#define __FORCE386_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <iosupp.h>
-#include <console.h>
-#include <clockdrv.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Define the interrupt mechanism for Time Test 27
- *
- * NOTE: Use a software interrupt for the i386.
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), 0x90, 1 )
-
-#define Cause_tm27_intr() asm volatile( "int $0x90" : : );
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( _microseconds ) \
- { \
- rtems_unsigned32 _counter; \
- \
- _counter = (_microseconds); \
- \
- asm volatile ( "0: nop;" \
- " mov %0,%0 ;" \
- " loop 0b" : "=c" (_counter) \
- : "0" (_counter) \
- ); \
- \
- }
-
-/* Constants */
-
-#define RAM_START 0
-#define RAM_END 0x100000
-
-/* I/O addressing */
-
-/*
- * The following determines whether Port B or the Console should
- * be used for test I/O. Setting ONE (and only ONE) of these to 1
- * enables I/O on that port.
- *
- * PORT A - DUSCC MC68562 Channel A
- * PORT B - DUSCC MC68562 Channel B
- * PORT C - MFP MC68901 Channel (*** FORCEbug console ***)
- */
-
-#define PORTB 1 /* use port b as test port */
-#define PORTC 0 /* use console port as test port */
-
-#if ( PORTB == 1 )
-#define TX_STATUS 0x1b6 /* DUSCC General Status Register */
-#define RX_STATUS 0x1b6 /* DUSCC General Status Register */
-#define TX_BUFFER 0x1e0 /* DUSCC Transmitter Channel B */
-#define RX_BUFFER 0x1e8 /* DUSCC Receiver Channel B */
-#define Is_tx_ready( _status ) ( (_status) & 0x20 )
-#define Is_rx_ready( _status ) ( (_status) & 0x10 )
-#endif
-
-#if ( PORTC == 1 )
-#define TX_STATUS 0x12c /* MFP Transmit Status Register */
-#define RX_STATUS 0x12a /* MFP Receive Status Register */
-#define TX_BUFFER 0x12e /* MFP Transmitter Channel */
-#define RX_BUFFER 0x12e /* MFP Receiver Channel */
-#define Is_tx_ready( _status ) ( (_status) & 0x80 )
-#define Is_rx_ready( _status ) ( (_status) & 0x80 )
-#endif
-
-/* Timer constants */
-
-#define IERA 0x106 /* Interrupt Enable Register A */
-#define IMRA 0x112 /* Interrupt Mask Register A */
-#define TACR 0x118 /* Timer A Control Register */
-#define TADR 0x11e /* Timer A Data Register */
-
-#define IERB 0x108 /* Interrupt Enable Register B */
-#define TBCR 0x11a /* Timer B Control Register */
-#define TBDR 0x120 /* Timer B Data Register */
-
-/* Structures */
-
-#ifdef F386_INIT
-#undef BSP_EXTERN
-#define BSP_EXTERN
-#else
-#undef BSP_EXTERN
-#define BSP_EXTERN extern
-#endif
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-#define IDT_SIZE 256
-#define GDT_SIZE 8192
-
-extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE];
-extern segment_descriptors Global_descriptor_table [GDT_SIZE];
-
-BSP_EXTERN unsigned short Idt[3]; /* Interrupt Descriptor Table Address */
-BSP_EXTERN unsigned short Gdt[3]; /* Global Descriptor Table Address */
-BSP_EXTERN unsigned int Idt_base;
-BSP_EXTERN unsigned int Gdt_base;
-
-/* routines */
-
-i386_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/i386/force386/include/coverhd.h b/c/src/lib/libbsp/i386/force386/include/coverhd.h
deleted file mode 100644
index de5e7aa742..0000000000
--- a/c/src/lib/libbsp/i386/force386/include/coverhd.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C on this target.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 3
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 3
-#define CALLING_OVERHEAD_TASK_CREATE 4
-#define CALLING_OVERHEAD_TASK_IDENT 4
-#define CALLING_OVERHEAD_TASK_START 4
-#define CALLING_OVERHEAD_TASK_RESTART 3
-#define CALLING_OVERHEAD_TASK_DELETE 3
-#define CALLING_OVERHEAD_TASK_SUSPEND 3
-#define CALLING_OVERHEAD_TASK_RESUME 3
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 4
-#define CALLING_OVERHEAD_TASK_MODE 4
-#define CALLING_OVERHEAD_TASK_GET_NOTE 4
-#define CALLING_OVERHEAD_TASK_SET_NOTE 4
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 7
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 3
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 4
-#define CALLING_OVERHEAD_CLOCK_GET 7
-#define CALLING_OVERHEAD_CLOCK_SET 7
-#define CALLING_OVERHEAD_CLOCK_TICK 2
-
-#define CALLING_OVERHEAD_TIMER_CREATE 3
-#define CALLING_OVERHEAD_TIMER_IDENT 3
-#define CALLING_OVERHEAD_TIMER_DELETE 3
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 4
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 8
-#define CALLING_OVERHEAD_TIMER_RESET 3
-#define CALLING_OVERHEAD_TIMER_CANCEL 3
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 4
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 3
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 4
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 4
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 3
-
-#define CALLING_OVERHEAD_EVENT_SEND 4
-#define CALLING_OVERHEAD_EVENT_RECEIVE 4
-#define CALLING_OVERHEAD_SIGNAL_CATCH 3
-#define CALLING_OVERHEAD_SIGNAL_SEND 3
-#define CALLING_OVERHEAD_PARTITION_CREATE 4
-#define CALLING_OVERHEAD_PARTITION_IDENT 4
-#define CALLING_OVERHEAD_PARTITION_DELETE 3
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 4
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 4
-#define CALLING_OVERHEAD_REGION_CREATE 4
-#define CALLING_OVERHEAD_REGION_IDENT 3
-#define CALLING_OVERHEAD_REGION_DELETE 3
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 4
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 4
-#define CALLING_OVERHEAD_PORT_CREATE 4
-#define CALLING_OVERHEAD_PORT_IDENT 3
-#define CALLING_OVERHEAD_PORT_DELETE 3
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 4
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 4
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 4
-#define CALLING_OVERHEAD_IO_OPEN 4
-#define CALLING_OVERHEAD_IO_CLOSE 4
-#define CALLING_OVERHEAD_IO_READ 4
-#define CALLING_OVERHEAD_IO_WRITE 4
-#define CALLING_OVERHEAD_IO_CONTROL 4
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 3
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 2
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/i386/force386/shmsupp/Makefile.in b/c/src/lib/libbsp/i386/force386/shmsupp/Makefile.in
deleted file mode 100644
index 031a0aa0cd..0000000000
--- a/c/src/lib/libbsp/i386/force386/shmsupp/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/shmsupp.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=addrconv getcfg lock mpisr
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/i386/force386/shmsupp/addrconv.c b/c/src/lib/libbsp/i386/force386/shmsupp/addrconv.c
deleted file mode 100644
index 6a38f515f6..0000000000
--- a/c/src/lib/libbsp/i386/force386/shmsupp/addrconv.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Shm_Convert_address
- *
- * The CPU386 has a "normal" view of the VME address space.
- * No address range conversion is required.
- *
- * Input parameters:
- * address - address to convert
- *
- * Output parameters:
- * returns - converted address
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-void *Shm_Convert_address(
- void *address
-)
-{
- return ( address );
-}
diff --git a/c/src/lib/libbsp/i386/force386/shmsupp/getcfg.c b/c/src/lib/libbsp/i386/force386/shmsupp/getcfg.c
deleted file mode 100644
index b10d5bf4fe..0000000000
--- a/c/src/lib/libbsp/i386/force386/shmsupp/getcfg.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* void Shm_Get_configuration( localnode, &shmcfg )
- *
- * This routine initializes, if necessary, and returns a pointer
- * to the Shared Memory Configuration Table for the FORCE CPU-386
- *
- * INPUT PARAMETERS:
- * localnode - local node number
- * shmcfg - address of pointer to SHM Config Table
- *
- * OUTPUT PARAMETERS:
- * *shmcfg - pointer to SHM Config Table
- *
- * NOTES: The FORCE CPU-386 does not have an interprocessor interrupt.
- *
- * The following table illustrates the configuration limitations:
- *
- * BUS MAX
- * MODE ENDIAN NODES
- * ========= ====== =======
- * POLLED BIG 2+
- * INTERRUPT **** NOT SUPPORTED ****
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <shm.h>
-#include <bsp.h>
-
-#define INTERRUPT 0
-#define POLLING 1 /* FORCE CPU-386 target is polling ONLY!!! */
-
-
-shm_config_table BSP_shm_cfgtbl;
-
-void Shm_Get_configuration(
- rtems_unsigned32 localnode,
- shm_config_table **shmcfg
-)
-{
- set_segment( get_ds(), 0x00002000, 0xffffd000 );
-
- BSP_shm_cfgtbl.base = i386_Physical_to_logical(
- get_ds(),
- (void *) 0x20000000
- );
-
- BSP_shm_cfgtbl.length = 1 * MEGABYTE;
- BSP_shm_cfgtbl.format = SHM_BIG;
-
- BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt;
-
-#ifdef NEUTRAL_BIG
- BSP_shm_cfgtbl.convert = NULL_CONVERT;
-#else
- BSP_shm_cfgtbl.convert = CPU_swap_u32;
-#endif
-
- BSP_shm_cfgtbl.poll_intr = POLLED_MODE;
- BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT;
-
- *shmcfg = &BSP_shm_cfgtbl;
-}
diff --git a/c/src/lib/libbsp/i386/force386/shmsupp/lock.c b/c/src/lib/libbsp/i386/force386/shmsupp/lock.c
deleted file mode 100644
index d5f74fb8e3..0000000000
--- a/c/src/lib/libbsp/i386/force386/shmsupp/lock.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Shared Memory Lock Routines
- *
- * This shared memory locked queue support routine need to be
- * able to lock the specified locked queue. Interrupts are
- * disabled while the queue is locked to prevent preemption
- * and deadlock when two tasks poll for the same lock.
- * previous level.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-/*
- * Shm_Initialize_lock
- *
- * Initialize the lock for the specified locked queue.
- */
-
-void Shm_Initialize_lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- lq_cb->lock = LQ_UNLOCKED;
-}
-
-/* void _Shm_Lock( &lq_cb )
- *
- * This shared memory locked queue support routine locks the
- * specified locked queue. It disables interrupts to prevent
- * a deadlock condition.
- */
-
-void Shm_Lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
- volatile rtems_unsigned32 *lockptr = &lq_cb->lock;
- rtems_unsigned32 lock_value;
-
- lock_value = SHM_LOCK_VALUE;
- rtems_interrupt_disable( isr_level );
-
- Shm_isrstat = isr_level;
- while ( 1 ) {
- asm volatile( "lock ; xchg (%0),%1"
- : "=r" (lockptr), "=r" (lock_value)
- : "0" (lockptr), "1" (lock_value)
- );
- if ( lock_value == SHM_UNLOCK_VALUE )
- break;
- delay( 10 ); /* approximately 10 microseconds */
- }
-}
-
-/*
- * Shm_Unlock
- *
- * Unlock the lock for the specified locked queue.
- */
-
-void Shm_Unlock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
-
- lq_cb->lock = SHM_UNLOCK_VALUE;
- isr_level = Shm_isrstat;
- rtems_interrupt_enable( isr_level );
-}
-
diff --git a/c/src/lib/libbsp/i386/force386/shmsupp/mpisr.c b/c/src/lib/libbsp/i386/force386/shmsupp/mpisr.c
deleted file mode 100644
index ae0c2dd673..0000000000
--- a/c/src/lib/libbsp/i386/force386/shmsupp/mpisr.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Shm_setvec
- *
- * This driver routine sets the SHM interrupt vector to point to the
- * driver's SHM interrupt service routine.
- *
- * NOTE: This routine is not used by the FORCE CPU-386 because it
- * only supports polling mode.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-void Shm_setvec()
-{
- /* NOT USED ON FORCE CPU-386!!! */
-}
diff --git a/c/src/lib/libbsp/i386/force386/start/Makefile.in b/c/src/lib/libbsp/i386/force386/start/Makefile.in
deleted file mode 100644
index 388e25b482..0000000000
--- a/c/src/lib/libbsp/i386/force386/start/Makefile.in
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/start.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
diff --git a/c/src/lib/libbsp/i386/force386/start/start.s b/c/src/lib/libbsp/i386/force386/start/start.s
deleted file mode 100644
index c1d0ffd099..0000000000
--- a/c/src/lib/libbsp/i386/force386/start/start.s
+++ /dev/null
@@ -1,267 +0,0 @@
-/* start.s
- *
- * This file contains the entry point for the application.
- * The name of this entry point is compiler dependent.
- * It jumps to the BSP which is responsible for performing
- * all initialization.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-
-/*
- * A Descriptor table register has the following format
- */
-
-.set DTR_LIMIT, 0 # offset of two byte limit
-.set DTR_BASE, 2 # offset of four byte base address
-.set DTR_SIZE, 6 # size of DTR register
-
- BEGIN_DATA
- EXTERN (Do_Load_IDT)
- EXTERN (Do_Load_GDT)
- END_DATA
-
- BEGIN_CODE
-
- PUBLIC (start) # GNU default entry point
-
- EXTERN (boot_card)
- EXTERN (load_segments)
- EXTERN (exit)
-
-SYM (start):
- nop
- cli # DISABLE INTERRUPTS!!!
-/*
- * Load the segment registers
- *
- * NOTE: Upon return, gs will contain the segment descriptor for
- * a segment which maps directly to all of physical memory.
- */
- jmp SYM (_load_segments) # load board dependent segments
-
-/*
- * Set up the stack
- */
-
- PUBLIC (_establish_stack)
-SYM (_establish_stack):
-
- movl $end,eax # eax = end of bss/start of heap
- addl $heap_size,eax # eax = end of heap
- movl eax,stack_start # Save for brk() routine
- addl $stack_size,eax # make room for stack
- andl $0xffffffc0,eax # align it on 16 byte boundary
- movl eax,esp # set stack pointer
- movl eax,ebp # set base pointer
-/*
- * Zero out the BSS segment
- */
-SYM (zero_bss):
- cld # make direction flag count up
- movl $ SYM (end),ecx # find end of .bss
- movl $ SYM (_bss_start),edi # edi = beginning of .bss
- subl edi,ecx # ecx = size of .bss in bytes
- shrl ecx # size of .bss in longs
- shrl ecx
- xorl eax,eax # value to clear out memory
- repne # while ecx != 0
- stosl # clear a long in the bss
-
-/*
- * Copy the Global Descriptor Table to our space
- */
-
- sgdt SYM (_Original_GDTR) # save original GDT
- movzwl SYM (_Original_GDTR)+DTR_LIMIT,ecx
- /* size of GDT in bytes; limit is */
- /* 8192 entries * 8 bytes per */
-
- /*
- * make ds:esi point to the original GDT
- */
-
- movl SYM (_Original_GDTR)+DTR_BASE,esi
- push ds # save ds
- movw gs,ax
- movw ax,ds
-
- /*
- * make es:edi point to the new (our copy) GDT
- */
-
- movl $ SYM (_Global_descriptor_table),edi
-
- rep
- movsb # copy the GDT (ds:esi -> es:edi)
-
- pop ds # restore ds
-
- /*
- * Build and load new contents of GDTR
- */
- movw SYM (_Original_GDTR)+DTR_LIMIT,ecx # set new limit
- movw cx, SYM (_New_GDTR)+DTR_LIMIT
-
- push $ SYM (_Global_descriptor_table)
- push es
- call SYM (i386_Logical_to_physical)
- addl $6,esp
- movl eax, SYM (_New_GDTR)+DTR_BASE # set new base
-
- cmpb $0, SYM (_Do_Load_GDT) # Should the new GDT be loaded?
- je SYM (no_gdt_load) # NO, then branch
- lgdt SYM (_New_GDTR) # load the new GDT
-SYM (no_gdt_load):
-
-/*
- * Copy the Interrupt Descriptor Table to our space
- */
-
- sidt SYM (_Original_IDTR) # save original IDT
- movzwl SYM (_Original_IDTR)+DTR_LIMIT,ecx
- /* size of IDT in bytes; limit is */
- /* 256 entries * 8 bytes per */
-
-
- /*
- * make ds:esi point to the original IDT
- */
- movl SYM (_Original_IDTR)+DTR_BASE,esi
-
- push ds # save ds
- movw gs,ax
- movw ax,ds
-
- /*
- * make es:edi point to the new (our copy) IDT
- */
- movl $ SYM (Interrupt_descriptor_table),edi
-
- rep
- movsb # copy the IDT (ds:esi -> es:edi)
- pop ds # restore ds
-
- /*
- * Build and load new contents of IDTR
- */
- movw SYM (_Original_IDTR+DTR_LIMIT),ecx # set new limit
- movw cx,SYM (_New_IDTR)+DTR_LIMIT
-
- push $ SYM (Interrupt_descriptor_table)
- push es
- call SYM (i386_Logical_to_physical)
- addl $6,esp
- movl eax, SYM (_New_IDTR)+DTR_BASE # set new base
-
- cmpb $0, SYM (_Do_Load_IDT) # Should the new IDT be loaded?
- je SYM (no_idt_load) # NO, then branch
- lidt SYM (_New_IDTR) # load the new IDT
-SYM (no_idt_load):
-
-/*
- * Initialize the i387.
- *
- * Using the NO WAIT form of the instruction insures that
- * if it is not present the board will not lock up or get an
- * exception.
- */
-
- fninit # MUST USE NO-WAIT FORM
-
-/*
- * Transfer control to User's Board Support Package
- */
- pushl $0 # environp
- pushl $0 # argv
- pushl $0 # argc
- call SYM (boot_card)
- addl $12,esp
-
-/*
- * Clean up
- */
-
- EXTERN (return_to_monitor)
-
- PUBLIC (Bsp_cleanup)
-SYM (Bsp_cleanup):
- cmpb $0, SYM (_Do_Load_IDT) # Was the new IDT loaded?
- je SYM (no_idt_restore) # NO, then branch
- lidt SYM (_Original_IDTR) # restore the new IDT
-SYM (no_idt_restore):
-
- cmpb $0, SYM (_Do_Load_GDT) # Was the new GDT loaded?
- je SYM (no_gdt_restore) # NO, then branch
- lgdt SYM (_Original_GDTR) # restore the new GDT
-SYM (no_gdt_restore):
- jmp SYM (_return_to_monitor)
-
-END_CODE
-
-BEGIN_DATA
-
- .align 2
- PUBLIC (start_frame)
-SYM (start_frame):
- .long 0
-
- PUBLIC (stack_start)
-SYM (stack_start):
- .long 0
-
-END_DATA
-
-BEGIN_BSS
-
- PUBLIC(heap_size)
- .set heap_size,0x2000
-
- PUBLIC(stack_size)
- .set stack_size,0x1000
-
- PUBLIC (Interrupt_descriptor_table)
-SYM (Interrupt_descriptor_table):
- .space 256*8
-
- PUBLIC (_Original_IDTR)
-SYM (_Original_IDTR):
- .space DTR_SIZE
-
- PUBLIC (_New_IDTR)
-SYM (_New_IDTR):
- .space DTR_SIZE
-
- PUBLIC (_Global_descriptor_table)
-SYM (_Global_descriptor_table):
- .space 8192*8
-
- PUBLIC (_Original_GDTR)
-SYM (_Original_GDTR):
- .space DTR_SIZE
-
- PUBLIC (_New_GDTR)
-SYM (_New_GDTR):
- .space DTR_SIZE
-
- PUBLIC (_Physical_base_of_ds)
-SYM (_Physical_base_of_ds):
- .space 4
-
- PUBLIC (_Physical_base_of_cs)
-SYM (_Physical_base_of_cs):
- .space 4
-
-END_BSS
-END
diff --git a/c/src/lib/libbsp/i386/force386/startup/Makefile.in b/c/src/lib/libbsp/i386/force386/startup/Makefile.in
deleted file mode 100644
index bda5bb88da..0000000000
--- a/c/src/lib/libbsp/i386/force386/startup/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=ldsegs
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(srcdir)/linkcmds $(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-
diff --git a/c/src/lib/libbsp/i386/force386/startup/bspstart.c b/c/src/lib/libbsp/i386/force386/startup/bspstart.c
deleted file mode 100644
index c4ea26cdfb..0000000000
--- a/c/src/lib/libbsp/i386/force386/startup/bspstart.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
-
- /*
- * FORCE documentation incorrectly states that the bus request
- * level is initialized to 3. It is actually initialized by
- * FORCEbug to 0.
- */
-
- outport_byte( 0x00, 0x3f ); /* resets VMEbus request level */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
-
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
-
- Cpu_table.interrupt_table_segment = get_ds();
-
- Cpu_table.interrupt_table_offset = (void *)Interrupt_descriptor_table;
-
- Cpu_table.interrupt_stack_size = 4096;
-
- BSP_Configuration.work_space_start = (void *)
- RAM_END - BSP_Configuration.work_space_size;
-
-}
diff --git a/c/src/lib/libbsp/i386/force386/startup/exit.c b/c/src/lib/libbsp/i386/force386/startup/exit.c
deleted file mode 100644
index c17d97fa6e..0000000000
--- a/c/src/lib/libbsp/i386/force386/startup/exit.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * exit
- *
- * This routine returns control to FORCEbug.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <clockdrv.h>
-#include <iodrv.h>
-
-void _exit( )
-{
- /* Clock or Timer cleanup is run by at_exit() */
-
- Io_cleanup();
-
- bsp_cleanup();
-}
diff --git a/c/src/lib/libbsp/i386/force386/startup/ldsegs.s b/c/src/lib/libbsp/i386/force386/startup/ldsegs.s
deleted file mode 100644
index 7689a7693f..0000000000
--- a/c/src/lib/libbsp/i386/force386/startup/ldsegs.s
+++ /dev/null
@@ -1,86 +0,0 @@
-/* _load_segments
- *
- * This file assists the board independent startup code by
- * loading the proper segment register values. The values
- * loaded are board dependent.
- *
- * NOTE: No stack has been established when this routine
- * is invoked. It returns by jumping back to bspentry.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-
-BEGIN_CODE
-
-/*
- * FORCEBUG loads us into a virtual address space which
- * really starts at PHYSICAL_ADDRESS_BASE.
- */
-
-.set PHYSICAL_ADDRESS_BASE, 0x00002000
-
-/*
- * At reset time, FORCEBUG normally has the segment selectors preloaded.
- * If a human resets the instruction pointer, this will not have occurred.
- * However, no guarantee can be made of the other registers if cs:ip was
- * modified to restart the program. Because of this, the BSP reloads all
- * segment registers (except cs) with the values they have following
- * a reset.
- */
-
-
-.set RESET_SS, 0x40 # initial value of stack segment register
-.set RESET_DS, 0x40 # initial value of data segment register
-.set RESET_ES, 0x40 # initial value of extra segment register
-.set RESET_FS, 0x40 # initial value of "f" segment register
-.set RESET_GS, 0x30 # initial value of "g" segment register
-
-
-#define LOAD_SEGMENTS(_value,_segment) \
- movw $ ## _value, ax ; \
- movw ax, _segment
-
- EXTERN (establish_stack)
-
- PUBLIC (_load_segments)
-SYM (_load_segments):
- LOAD_SEGMENTS( RESET_SS, ss )
- LOAD_SEGMENTS( RESET_DS, ds )
- LOAD_SEGMENTS( RESET_ES, es )
- LOAD_SEGMENTS( RESET_FS, fs )
- LOAD_SEGMENTS( RESET_GS, gs )
-
- jmp SYM (_establish_stack) # return to the bsp entry code
-
- PUBLIC (_return_to_monitor)
-SYM (_return_to_monitor):
-
- call SYM (Clock_exit)
- movb $0,al
- int $0x20 # restart FORCEbug
- jmp SYM (start) # FORCEbug does not reset PC
-
-END_CODE
-
-BEGIN_DATA
-
- PUBLIC (_Do_Load_IDT)
-SYM (_Do_Load_IDT):
- .byte 1
-
- PUBLIC (_Do_Load_GDT)
-SYM (_Do_Load_GDT):
- .byte 0
-
-END_DATA
-END
diff --git a/c/src/lib/libbsp/i386/force386/startup/linkcmds b/c/src/lib/libbsp/i386/force386/startup/linkcmds
deleted file mode 100644
index 3892b7dedf..0000000000
--- a/c/src/lib/libbsp/i386/force386/startup/linkcmds
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the FORCE CPU386 board.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-MEMORY
- {
- ram : org = 0x0, l = 1M
- }
-
-SECTIONS
-{
- .text 0x0 :
- {
- _text_start = . ;
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
-
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- _etext = ALIGN( 0x10 ) ;
-
-
- } >RAM
-
- .init : { *(.init) } >RAM
- .fini : { *(.fini) } >RAM
- .rodata : { *(.rodata) *(.gnu.linkonce.r*) } >RAM
-
- .data :
- {
- _data_start = . ;
- *(.data)
- _edata = ALIGN( 0x10 ) ;
- } >RAM
-
- .bss :
- {
- _bss_start = . ;
- *(.bss)
- *(COMMON)
- end = . ;
- _end = . ;
- __end = . ;
- } >RAM
-}
diff --git a/c/src/lib/libbsp/i386/force386/startup/setvec.c b/c/src/lib/libbsp/i386/force386/startup/setvec.c
deleted file mode 100644
index eb2cf51e42..0000000000
--- a/c/src/lib/libbsp/i386/force386/startup/setvec.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on the Force CPU-386.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-i386_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- i386_isr_entry previous_isr;
- interrupt_gate_descriptor idt;
-
- if ( type )
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
- else {
- /* get the address of the old handler */
-
- idt = Interrupt_descriptor_table[ vector ];
-
- previous_isr = (i386_isr_entry)
- ((idt.offset_16_31 << 16) | idt.offset_0_15);
-
- /* build the IDT entry */
- idt.offset_0_15 = ((rtems_unsigned32) handler) & 0xffff;
- idt.segment_selector = get_cs();
- idt.reserved = 0x00;
- idt.p_dpl = 0x8e; /* present, ISR */
- idt.offset_16_31 = ((rtems_unsigned32) handler) >> 16;
-
- /* install the IDT entry */
- Interrupt_descriptor_table[ vector ] = idt;
- }
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/i386/force386/timer/Makefile.in b/c/src/lib/libbsp/i386/force386/timer/Makefile.in
deleted file mode 100644
index 24809cbed8..0000000000
--- a/c/src/lib/libbsp/i386/force386/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=timerisr
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i386/force386/timer/timer.c b/c/src/lib/libbsp/i386/force386/timer/timer.c
deleted file mode 100644
index ac7991173d..0000000000
--- a/c/src/lib/libbsp/i386/force386/timer/timer.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Timer_init()
- *
- * This routine initializes the timer on the FORCE CPU-386 board.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: This routine will not work if the optimizer is enabled
- * for some compilers. The multiple writes to the Z8036
- * may be optimized away.
- *
- * It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-int Ttimer_val;
-rtems_boolean Timer_driver_Find_average_overhead;
-
-rtems_isr timerisr();
-
-void Timer_initialize()
-{
-
- (void) set_vector( timerisr, 0x38, 0 ); /* install ISR */
-
- Ttimer_val = 0; /* clear timer ISR count */
-
- outport_byte( IERA, 0x40 ); /* disable interrupt */
- outport_byte( TBCR, 0x40 ); /* stop the timer */
- outport_byte( TBDR, 250 ); /* 250 units */
-
- outport_byte( TBCR, 0x11 ); /* reset it, delay mode, 4X */
-#if 0
- outport_byte( TBCR, 0x13 ); /* reset it, delay mode, 16X */
-#endif
-
- outport_byte( IERA, 0x41 ); /* enable interrupt */
-
-}
-
-#define AVG_OVERHEAD 3 /* It typically takes 3.0 microseconds */
- /* (3 ticks) to start/stop the timer. */
-#define LEAST_VALID 4 /* Don't trust a value lower than this */
-
-int Read_timer()
-{
- register rtems_unsigned32 clicks;
- register rtems_unsigned32 total;
-
- outport_byte( TBCR, 0x00 ); /* stop the timer */
-
- inport_byte( TBDR, clicks );
-
- total = Ttimer_val + 250 - clicks;
-
- outport_byte( TBCR, 0x00 ); /* initial value */
- outport_byte( IERA, 0x40 ); /* disable interrupt */
-
- /* ??? Is "do not restore old vector" causing problems? */
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in one microsecond units */
-
- else {
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
- return (total - AVG_OVERHEAD);
- }
-}
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/i386/force386/timer/timerisr.s b/c/src/lib/libbsp/i386/force386/timer/timerisr.s
deleted file mode 100644
index 3264248b05..0000000000
--- a/c/src/lib/libbsp/i386/force386/timer/timerisr.s
+++ /dev/null
@@ -1,34 +0,0 @@
-/* timer_isr()
- *
- * This routine provides the ISR for the Z8036 timer on the MVME136
- * board. The timer is set up to generate an interrupt at maximum
- * intervals.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-
- BEGIN_CODE
-
- EXTERN (Ttimer_val)
-
- PUBLIC (timerisr)
-SYM (timerisr):
- addl $250, SYM (Ttimer_val) # another 250 microseconds
- iret
-
-END_CODE
-END
diff --git a/c/src/lib/libbsp/i386/force386/times b/c/src/lib/libbsp/i386/force386/times
deleted file mode 100644
index 2c953246ac..0000000000
--- a/c/src/lib/libbsp/i386/force386/times
+++ /dev/null
@@ -1,191 +0,0 @@
-#
-# Timing Test Suite Results for the Force CPU386 BSP
-#
-# $Id$
-#
-
-Board: Force CPU-386
-CPU: i386/DX + i387
-Clock Speed: 16 Mhz
-Memory Configuration: DRAM, no cache
-Wait States: 0 wait states
-
-Times Reported in: microseconds
-Timer Source: count-down timer provided by a Motorola MC68901
-
-Column A: 3.5.1
-Column B: 3.5.17 - pre-release
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 73 64
- rtems_semaphore_delete 69 60
- rtems_semaphore_obtain: available 50 41
- rtems_semaphore_obtain: not available -- NO_WAIT 50 40
- rtems_semaphore_release: no waiting tasks 55 47
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 126 123
-
- 3 rtems_semaphore_release: task readied -- preempts caller 104 95
-
- 4 rtems_task_restart: blocked task -- preempts caller 164 162
- rtems_task_restart: ready task -- preempts caller 158 156
- rtems_semaphore_release: task readied -- returns to caller 79 70
- rtems_task_create 164 157
- rtems_task_start 93 86
- rtems_task_restart: suspended task -- returns to caller 109 103
- rtems_task_delete: suspended task 154 147
- rtems_task_restart: ready task -- returns to caller 111 105
- rtems_task_restart: blocked task -- returns to caller 144 138
- rtems_task_delete: blocked task 162 153
-
- 5 rtems_task_suspend: calling task 87 81
- rtems_task_resume: task readied -- preempts caller 79 71
-
- 6 rtems_task_restart: calling task 121 118
- rtems_task_suspend: returns to caller 54 45
- rtems_task_resume: task readied -- returns to caller 54 46
- rtems_task_delete: ready task 164 157
-
- 7 rtems_task_restart: suspended task -- preempts caller 151 149
-
- 8 rtems_task_set_priority: obtain current priority 40 30
- rtems_task_set_priority: returns to caller 75 67
- rtems_task_mode: obtain current mode 20 19
- rtems_task_mode: no reschedule 22 21
- rtems_task_mode: reschedule -- returns to caller 27 27
- rtems_task_mode: reschedule -- preempts caller 74 66
- rtems_task_set_note 41 32
- rtems_task_get_note 42 32
- rtems_clock_set 95 85
- rtems_clock_get 2 2
-
- 9 rtems_message_queue_create 304 294
- rtems_message_queue_send: no waiting tasks 124 117
- rtems_message_queue_urgent: no waiting tasks 123 117
- rtems_message_queue_receive: available 101 93
- rtems_message_queue_flush: no messages flushed 38 29
- rtems_message_queue_flush: messages flushed 50 41
- rtems_message_queue_delete 88 81
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 54 45
- rtems_message_queue_receive: not available -- caller blocks 131 127
-
-11 rtems_message_queue_send: task readied -- preempts caller 152 144
-
-12 rtems_message_queue_send: task readied -- returns to caller 126 118
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 152 144
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 126 116
-
-15 rtems_event_receive: obtain current events 0 <1
- rtems_event_receive: not available -- NO_WAIT 37 25
- rtems_event_receive: not available -- caller blocks 102 94
- rtems_event_send: no task readied 37 26
- rtems_event_receive: available 39 27
- rtems_event_send: task readied -- returns to caller 68 60
-
-16 rtems_event_send: task readied -- preempts caller 96 89
-
-17 rtems_task_set_priority: preempts caller 119 115
-
-18 rtems_task_delete: calling task 192 187
-
-19 rtems_signal_catch 23 13
- rtems_signal_send: returns to caller 43 34
- rtems_signal_send: signal to self 57 59
- exit ASR overhead: returns to calling task 39 39
- exit ASR overhead: returns to preempting task 70 60
-
-20 rtems_partition_create 96 83
- rtems_region_create 78 68
- rtems_partition_get_buffer: available 42 34
- rtems_partition_get_buffer: not available 42 33
- rtems_partition_return_buffer 49 40
- rtems_partition_delete 50 49
- rtems_region_get_segment: available 57 45
- rtems_region_get_segment: not available -- NO_WAIT 54 52
- rtems_region_return_segment: no waiting tasks 62 52
- rtems_region_get_segment: not available -- caller blocks 131 127
- rtems_region_return_segment: task readied -- preempts caller 147 138
- rtems_region_return_segment: task readied -- returns to caller 123 113
- rtems_region_delete 48 39
- rtems_io_initialize 4 4
- rtems_io_open 1 1
- rtems_io_close 1 0
- rtems_io_read 1 1
- rtems_io_write 1 1
- rtems_io_control 1 1
-
-21 rtems_task_ident 671 748
- rtems_message_queue_ident 656 730
- rtems_semaphore_ident 699 787
- rtems_partition_ident 655 730
- rtems_region_ident 670 739
- rtems_port_ident 657 728
- rtems_timer_ident 658 729
- rtems_rate_monotonic_ident 659 729
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 129 122
- rtems_message_queue_broadcast: no waiting tasks 61 53
- rtems_message_queue_broadcast: task readied -- preempts caller 155 146
-
-23 rtems_timer_create 45 34
- rtems_timer_fire_after: inactive 70 65
- rtems_timer_fire_after: active 75 69
- rtems_timer_cancel: active 45 37
- rtems_timer_cancel: inactive 41 32
- rtems_timer_reset: inactive 65 58
- rtems_timer_reset: active 69 63
- rtems_timer_fire_when: inactive 100 92
- rtems_timer_fire_when: active 100 92
- rtems_timer_delete: active 60 52
- rtems_timer_delete: inactive 56 48
- rtems_task_wake_when 132 128
-
-24 rtems_task_wake_after: yield -- returns to caller 29 18
- rtems_task_wake_after: yields -- preempts caller 71 63
-
-25 rtems_clock_tick 14 16
-
-26 _ISR_Disable 2 1
- _ISR_Flash 2 1
- _ISR_Enable 1 1
- _Thread_Disable_dispatch 1 1
- _Thread_Enable_dispatch 22 10
- _Thread_Set_state 25 26
- _Thread_Disptach (NO FP) 55 48
- context switch: no floating point contexts 42 34
- context switch: self 8 9
- context switch: to another task 10 10
- context switch: restore 1st FP task 65 57
- fp context switch: save idle, restore idle 93 83
- fp context switch: save idle, restore initialized 60 59
- fp context switch: save initialized, restore initialized 60 59
- _Thread_Resume 19 19
- _Thread_Unblock 19 19
- _Thread_Ready 22 22
- _Thread_Get 14 15
- _Semaphore_Get 11 13
- _Thread_Get: invalid id 3 3
-
-27 interrupt entry overhead: returns to interrupted task 13 13
- interrupt exit overhead: returns to interrupted task 11 11
- interrupt entry overhead: returns to nested interrupt 12 12
- interrupt exit overhead: returns to nested interrupt 10 10
- interrupt entry overhead: returns to preempting task 12 12
- interrupt exit overhead: returns to preempting task 65 58
-
-28 rtems_port_create 48 39
- rtems_port_external_to_internal 36 26
- rtems_port_internal_to_external 36 26
- rtems_port_delete 48 39
-
-29 rtems_rate_monotonic_create 47 36
- rtems_rate_monotonic_period: initiate period -- returns to caller 60 53
- rtems_rate_monotonic_period: obtain status 38 30
- rtems_rate_monotonic_cancel 48 39
- rtems_rate_monotonic_delete: inactive 57 49
- rtems_rate_monotonic_delete: active 61 53
- rtems_rate_monotonic_period: conclude periods -- caller blocks 88 82
diff --git a/c/src/lib/libbsp/i386/force386/wrapup/Makefile.in b/c/src/lib/libbsp/i386/force386/wrapup/Makefile.in
deleted file mode 100644
index 4dc4ea5208..0000000000
--- a/c/src/lib/libbsp/i386/force386/wrapup/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console shmsupp timer
-GENERIC_PIECES=shmdr
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/i386/go32/Makefile.in b/c/src/lib/libbsp/i386/go32/Makefile.in
deleted file mode 100644
index 0a2d61ae80..0000000000
--- a/c/src/lib/libbsp/i386/go32/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include startup clock console timer wrapup
diff --git a/c/src/lib/libbsp/i386/go32/README b/c/src/lib/libbsp/i386/go32/README
deleted file mode 100644
index fa0d3efd29..0000000000
--- a/c/src/lib/libbsp/i386/go32/README
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# $Id$
-#
-
-1. This is based on djgpp v1.x which has been superceded. That version
- is still available but is no longer supported. It would be greatly
- appreciated if someone would update this bsp to the current version.
-
-2. In general the regular instructions for building a cross GNU toolset
- apply to the i386-go32-rtems toolset. However, you will need some items
- from the djgpp distribution. Here is the list of djgpp files we use:
-
- djeoe112.zip - files required on target PC
- djdev112.zip - libraries and include files required on host
-
-3. We attempt to minimize what we copy into our built and installed GNU
- toolset from the binary distribution of the GNU tools. Here is what
- we do by hand. You will need to localize this to meet your directory
- structure. All paths are starting at the toolset install point.
-
- a. Copy go32.h, dpmi.h, dos.h. and pc.h in the i386-go32-rtems/include
- directory. These files only include sys/types.h and newlib has that.
-
- b. copy crt0.o to i386-go32-rtems/gcc-lib/i386-go32-rtems/2.7.2
- c. copy libc.a to i386-go32-rtems/gcc-lib/i386-go32-rtems/2.7.2/libcgo32.a
- d. copy libpc.a to i386-go32-rtems/gcc-lib/i386-go32-rtems/2.7.2/libpc.a
-
- It is almost a certainty that libcgo32.a and libpc.a have symbols and
- routines which duplicate those in newlib. In post 3.6.0 RTEMS versions,
- the --start-group and --end-group GNU ld options are used to group
- the non-GO32 supplied libraries. This attempts to resolve every symbolic
- reference from RTEMS specific libraries before getting them from
- GO32 libraries.
-
-4. This configuration is built on a UNIX host by the RTEMS Team using
- cross configurations of the tools. Building it under DOS requires
- special effort.
-
diff --git a/c/src/lib/libbsp/i386/go32/bsp_specs b/c/src/lib/libbsp/i386/go32/bsp_specs
deleted file mode 100644
index 59b0aceadd..0000000000
--- a/c/src/lib/libbsp/i386/go32/bsp_specs
+++ /dev/null
@@ -1,20 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group -lcgo32 -lpc}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: crt0_go32.o%s}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: %(old_link)}
-
diff --git a/c/src/lib/libbsp/i386/go32/clock/Makefile.in b/c/src/lib/libbsp/i386/go32/clock/Makefile.in
deleted file mode 100644
index c8c96b56d2..0000000000
--- a/c/src/lib/libbsp/i386/go32/clock/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit rtc
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i386/go32/clock/ckinit.c b/c/src/lib/libbsp/i386/go32/clock/ckinit.c
deleted file mode 100644
index 70c564fabc..0000000000
--- a/c/src/lib/libbsp/i386/go32/clock/ckinit.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/* Clock_initialize
- *
- * This routine initializes the 8254 timer under GO32.
- * The tick frequency is 1 millisecond.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <stdlib.h>
-
-volatile rtems_unsigned32 Clock_driver_ticks;
-rtems_unsigned32 Clock_isrs_per_tick; /* ISRs per tick */
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-rtems_isr_entry Old_ticker;
-
-#define CLOCK_VECTOR 0x8
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
- /* touch interrupt controller for irq0 (0x20+0) */
- outport_byte( 0x20, 0x20 );
-
- Clock_driver_ticks += 1;
-
-#if 0 && defined(pentium)
- {
- extern long long Last_RDTSC;
- __asm __volatile( ".byte 0x0F, 0x31" : "=A" (Last_RDTSC) );
- }
-#endif
-
- if ( Clock_isrs == 1 ) {
- rtems_clock_tick();
- Clock_isrs = Clock_isrs_per_tick;
- } else {
- Clock_isrs -= 1;
- }
-}
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
- unsigned int microseconds_per_isr;
-
-#if 0
- /* Initialize clock from on-board real time clock. This breaks the */
- /* test code which assumes which assumes the application will do it. */
- {
- rtems_time_of_day Now;
- extern void init_rtc( void );
- extern long rtc_read( rtems_time_of_day * tod );
- init_rtc();
- if ( rtc_read( &Now ) >= 0 )
- clock_set( &Now );
- }
-#endif
-
- /* Start by assuming hardware counter is large enough, then */
- /* scale it until it actually fits. */
- Clock_driver_ticks = 0;
- Clock_isrs_per_tick = 1;
-
- if ( BSP_Configuration.microseconds_per_tick == 0 )
- microseconds_per_isr = 10000; /* default 10 ms */
- else
- microseconds_per_isr = BSP_Configuration.microseconds_per_tick;
- while ( US_TO_TICK(microseconds_per_isr) > 65535 ) {
- Clock_isrs_per_tick *= 10;
- microseconds_per_isr /= 10;
- }
-
- /* Initialize count in ckisr.c */
- Clock_isrs = Clock_isrs_per_tick;
-
-#if 0
- /* This was dropped in the last revision. Its a nice thing to know. */
- TICKS_PER_SECOND = 1000000 / (Clock_isrs_per_tick * microseconds_per_isr);
-#endif
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- /* 105/88 approximates TIMER_TICK*1e-6 */
- unsigned int count = US_TO_TICK( microseconds_per_isr );
-
- Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
- outport_byte( TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN );
- outport_byte( TIMER_CNTR0, count >> 0 & 0xff );
- outport_byte( TIMER_CNTR0, count >> 8 & 0xff );
- }
- atexit( Clock_exit );
-}
-
-void Clock_exit( void )
-{
- if ( BSP_Configuration.ticks_per_timeslice ) {
- extern void rtc_set_dos_date( void );
-
- /* reset to DOS value: */
- outport_byte( TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN );
- outport_byte( TIMER_CNTR0, 0 );
- outport_byte( TIMER_CNTR0, 0 );
-
- /* reset time-of-day */
- rtc_set_dos_date();
-
- /* re-enable old handler: assume it was one of ours */
- set_vector( (rtems_isr_entry)Old_ticker, CLOCK_VECTOR, 1 );
- }
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
-
-#if 0 && defined(pentium)
-/* This can be used to get extremely accurate timing on a pentium. */
-/* It isn't supported. [bryce] */
-#define HZ 90.0
-volatile long long Last_RDTSC;
-#define RDTSC()\
- ({ long long _now; __asm __volatile (".byte 0x0F,0x31":"=A"(_now)); _now; })
-
-long long Kernel_Time_ns( void )
-{
- extern rtems_unsigned32 _TOD_Ticks_per_second;
- unsigned isrs_per_second = Clock_isrs_per_tick * _TOD_Ticks_per_second;
- long long now;
- int flags;
- disable_intr( flags );
- now = 1e9 * Clock_driver_ticks / isrs_per_second
- + (RDTSC() - Last_RDTSC) * (1000.0/HZ);
- enable_intr( flags );
- return now;
-}
-#endif
diff --git a/c/src/lib/libbsp/i386/go32/clock/rtc.c b/c/src/lib/libbsp/i386/go32/clock/rtc.c
deleted file mode 100644
index 38e9497000..0000000000
--- a/c/src/lib/libbsp/i386/go32/clock/rtc.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * $Id$
- */
-
-#define IO_RTC 0x70 /* RTC */
-
-#define RTC_SEC 0x00 /* seconds */
-#define RTC_SECALRM 0x01 /* seconds alarm */
-#define RTC_MIN 0x02 /* minutes */
-#define RTC_MINALRM 0x03 /* minutes alarm */
-#define RTC_HRS 0x04 /* hours */
-#define RTC_HRSALRM 0x05 /* hours alarm */
-#define RTC_WDAY 0x06 /* week day */
-#define RTC_DAY 0x07 /* day of month */
-#define RTC_MONTH 0x08 /* month of year */
-#define RTC_YEAR 0x09 /* month of year */
-#define RTC_STATUSA 0x0a /* status register A */
-#define RTCSA_TUP 0x80 /* time update, don't look now */
-
-#define RTC_STATUSB 0x0b /* status register B */
-
-#define RTC_INTR 0x0c /* status register C (R) interrupt source */
-#define RTCIR_UPDATE 0x10 /* update intr */
-#define RTCIR_ALARM 0x20 /* alarm intr */
-#define RTCIR_PERIOD 0x40 /* periodic intr */
-#define RTCIR_INT 0x80 /* interrupt output signal */
-
-#define RTC_STATUSD 0x0d /* status register D (R) Lost Power */
-#define RTCSD_PWR 0x80 /* clock lost power */
-
-#define RTC_DIAG 0x0e /* status register E - bios diagnostic */
-#define RTCDG_BITS "\020\010clock_battery\007ROM_cksum\006config_unit\005memory_size\004fixed_disk\003invalid_time"
-
-#define RTC_CENTURY 0x32 /* current century - increment in Dec99 */
-
-
-
-#include <rtems.h>
-#include <string.h>
-
-void init_rtc( void )
-{
- int s;
-
- /* initialize brain-dead battery powered clock */
- outport_byte( IO_RTC, RTC_STATUSA );
- outport_byte( IO_RTC+1, 0x26 );
- outport_byte( IO_RTC, RTC_STATUSB );
- outport_byte( IO_RTC+1, 2 );
-
- outport_byte( IO_RTC, RTC_DIAG );
- inport_byte( IO_RTC+1, s );
-#if 0
- if (s) printf("RTC BIOS diagnostic error %b\n", s, RTCDG_BITS);
-#endif
-}
-
-
-/* convert 2 digit BCD number */
-static int bcd( unsigned int i )
-{
- return ((i/16)*10 + (i%16));
-}
-
-/* convert years to seconds (from 1970) */
-static unsigned long ytos( int y )
-{
- int i;
- unsigned long ret;
-
- ret = 0;
- for(i = 1970; i < y; i++) {
- if (i % 4) ret += 365*24*60*60;
- else ret += 366*24*60*60;
- }
- return ret;
-}
-
-/* convert months to seconds */
-static unsigned long mtos( int m, int leap )
-{
- int i;
- unsigned long ret;
-
- ret = 0;
- for(i=1;i<m;i++) {
- switch(i){
- case 1: case 3: case 5: case 7: case 8: case 10: case 12:
- ret += 31*24*60*60;
- break;
- case 4: case 6: case 9: case 11:
- ret += 30*24*60*60;
- break;
- case 2:
- if (leap)
- ret += 29*24*60*60;
- else
- ret += 28*24*60*60;
- }
- }
- return ret;
-}
-
-
-static inline unsigned int rtcin( unsigned int what )
-{
- unsigned int r;
- outport_byte( IO_RTC, what );
- inport_byte( IO_RTC+1, r );
- return r;
-}
-
-
-/*
- * Initialize the time of day register, based on the time base which is, e.g.
- * from a filesystem.
- */
-long rtc_read( rtems_time_of_day * tod )
-{
- int sa;
- unsigned long sec = 0;
-
- memset( tod, 0, sizeof *tod );
-
- /* do we have a realtime clock present? (otherwise we loop below) */
- sa = rtcin(RTC_STATUSA);
- if (sa == 0xff || sa == 0)
- return -1;
-
- /* ready for a read? */
- while ((sa&RTCSA_TUP) == RTCSA_TUP)
- sa = rtcin(RTC_STATUSA);
-
- tod->year = bcd(rtcin(RTC_YEAR)) + 1900; /* year */
- if (tod->year < 1970) tod->year += 100;
- tod->month = bcd(rtcin(RTC_MONTH)); /* month */
- tod->day = bcd(rtcin(RTC_DAY)); /* day */
- (void) bcd(rtcin(RTC_WDAY)); /* weekday */
- tod->hour = bcd(rtcin(RTC_HRS)); /* hour */
- tod->minute = bcd(rtcin(RTC_MIN)); /* minutes */
- tod->second = bcd(rtcin(RTC_SEC)); /* seconds */
- tod->ticks = 0;
-#if 0
- sec = ytos( tod->year );
- sec += mtos( tod->month, tod->year % 4 == 0 );
- sec += tod->day * 24*60*60;
- sec += tod->hour * 60*60; /* hour */
- sec += tod->minute * 60; /* minutes */
- sec += tod->second; /* seconds */
-#else
- sec = 0;
-#endif
- return sec;
-}
-
-
-
-/* from djgpp: include before rtems.h to avoid conflicts */
-#undef delay
-#include <dos.h>
-
-void rtc_set_dos_date( void )
-{
- int s;
- struct date date;
- struct time time;
-
- /* initialize brain-dead battery powered clock */
- outport_byte( IO_RTC, RTC_STATUSA );
- outport_byte( IO_RTC+1, 0x26 );
- outport_byte( IO_RTC, RTC_STATUSB );
- outport_byte( IO_RTC+1, 2 );
-
- outport_byte( IO_RTC, RTC_DIAG );
- inport_byte( IO_RTC+1, s );
- if (s) {
-#if 0
- printf("RTC BIOS diagnostic error %b\n", s, RTCDG_BITS);
-#else
- return;
-#endif
- }
-
- /* check for presence of clock */
- s = rtcin(RTC_STATUSA);
- if ( s == 0xff || s == 0 ) {
-#if 0
- printf( "Real-time clock not found\n" );
-#endif
- return;
- }
-
- /* ready for a read? */
- while ((s & RTCSA_TUP) == RTCSA_TUP)
- s = rtcin(RTC_STATUSA);
-
- date.da_year = bcd(rtcin(RTC_YEAR)) + 1900; /* year */
- if ( date.da_year < 1970) date.da_year += 100;
- date.da_year -= 1980;
- date.da_mon = bcd(rtcin(RTC_MONTH)); /* month */
- date.da_day = bcd(rtcin(RTC_DAY)); /* day */
-
- (void)bcd(rtcin(RTC_WDAY)); /* weekday */
-
- time.ti_hour = bcd(rtcin(RTC_HRS)); /* hour */
- time.ti_min = bcd(rtcin(RTC_MIN)); /* minutes */
- time.ti_sec = bcd(rtcin(RTC_SEC)); /* seconds */
- time.ti_hund = 0;
-
- setdate( & date );
- settime( & time );
-}
diff --git a/c/src/lib/libbsp/i386/go32/console/Makefile.in b/c/src/lib/libbsp/i386/go32/console/Makefile.in
deleted file mode 100644
index 52e68a2b52..0000000000
--- a/c/src/lib/libbsp/i386/go32/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console inch outch
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i386/go32/console/console.c b/c/src/lib/libbsp/i386/go32/console/console.c
deleted file mode 100644
index 0449686da8..0000000000
--- a/c/src/lib/libbsp/i386/go32/console/console.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * This file contains the go32 console IO package.
- *
- * $Id$
- */
-
-#define IBMPC_INIT
-
-#include <stdlib.h>
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <dpmi.h>
-#include <go32.h>
-
-/* console_cleanup
- *
- * This routine is called at exit to clean up the console hardware.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-void console_cleanup( void )
-{
- /* nothing */
-}
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-/* Set this if console I/O should use go32 (DOS) read/write calls. */
-/* Otherwise, direct hardware accesses will be used. */
-
-int _IBMPC_Use_Go32_IO = 0;
-
-static rtems_isr_entry old_keyboard_isr = NULL;
-
-extern void _IBMPC_keyboard_isr( rtems_unsigned32 interrupt );
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- if ( _IBMPC_Use_Go32_IO ) {
- /* Nothing. We let DOS and go32 do all the work. */
- } else {
- /* Grap the keyboard interrupt so DOS doesn't steal our */
- /* keystrokes. */
- rtems_status_code status;
-
- status =
- rtems_interrupt_catch( _IBMPC_keyboard_isr, 9, &old_keyboard_isr );
-
- if ( status ) {
- int write( int, void *, int );
- void exit( int );
-
- char msg[] = "error initializing keyboard\n";
- write( 2, msg, sizeof msg - 1 );
- exit( 1 );
- }
- }
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- atexit( console_cleanup );
-
- return RTEMS_SUCCESSFUL;
-}
-
-
-/* is_character_ready
- *
- * This routine returns TRUE if a character is available.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_boolean is_character_ready(
- char *ch
-)
-{
- return _IBMPC_chrdy( ch ) ? TRUE : FALSE;
-}
-
-/* inbyte
- *
- * This routine reads a character from the UART.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- * character read from UART
- */
-
-char inbyte( void )
-{
- char ch = _IBMPC_inch();
-#if 1
- /* Echo character to screen */
- void outbyte( char ch );
- outbyte( ch );
- if ( ch == '\r' )
- outbyte( '\n' );
-#endif
- return ch;
-}
-
-/* outbyte
- *
- * This routine transmits a character out the port.
- *
- * Input parameters:
- * ch - character to be transmitted
- *
- * Output parameters: NONE
- */
-
-void outbyte( char ch )
-{
- _IBMPC_outch( ch );
-}
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte();
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- /* What if this goes past the end of the buffer? We're hosed. [bhc] */
- buffer[ count++ ] = '\n';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r');
- }
- outbyte( buffer[ count ] );
- }
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libbsp/i386/go32/console/inch.c b/c/src/lib/libbsp/i386/go32/console/inch.c
deleted file mode 100644
index e3bbbd7105..0000000000
--- a/c/src/lib/libbsp/i386/go32/console/inch.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * $Id$
- */
-
-#include <pc.h>
-#include <go32.h>
-#include <bsp.h>
-
-/*
- * Ports for PC keyboard
- */
-#define KBD_CTL 0x61
-#define KBD_DATA 0x60
-#define KBD_STATUS 0x64
-
-static char key_map[] = {
-0,033,'1','2','3','4','5','6','7','8','9','0','-','=','\b','\t',
-'q','w','e','r','t','y','u','i','o','p','[',']',015,0x80,
-'a','s','d','f','g','h','j','k','l',';',047,0140,0x80,
-0134,'z','x','c','v','b','n','m',',','.','/',0x80,
-'*',0x80,' ',0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-0x80,0x80,0x80,'0',0177
-};
-
-static char shift_map[] = {
-0,033,'!','@','#','$','%','^','&','*','(',')','_','+','\b','\t',
-'Q','W','E','R','T','Y','U','I','O','P','{','}',015,0x80,
-'A','S','D','F','G','H','J','K','L',':',042,'~',0x80,
-'|','Z','X','C','V','B','N','M','<','>','?',0x80,
-'*',0x80,' ',0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-0x80,0x80,0x80,0x80,'7','8','9',0x80,'4','5','6',0x80,
-'1','2','3','0',177
-};
-
-extern int _IBMPC_Use_Go32_IO;
-
-#define KBD_BUF_SIZE 256
-static char kbd_buffer[ KBD_BUF_SIZE ];
-static unsigned int kbd_first = 0;
-static unsigned int kbd_last = 0;
-
-/* This function can be called during a poll for input, or by an ISR. */
-/* Basically any time you want to process a keypress. */
-int _IBMPC_scankey( char * ch )
-{
- unsigned char c;
- unsigned char outch;
- static int shift_pressed = 0;
- static int ctrl_pressed = 0;
- static int caps_pressed = 0;
-
- /* Read keyboard controller, toggle enable */
- inport_byte( KBD_CTL, c );
- outport_byte( KBD_CTL, c & ~0x80 );
- outport_byte( KBD_CTL, c | 0x80 );
- outport_byte( KBD_CTL, c & ~0x80 );
-
- /* See if it has data */
- inport_byte( KBD_STATUS, c );
- if ( ( c & 0x01 ) == 0 )
- return 0;
-
- /* Read the data. Handle nonsense with shift, control, etc. */
- inport_byte( KBD_DATA, c );
- switch ( c ) {
- case 0x36:
- case 0x2a:
- shift_pressed = 1;
- return 0;
- case 0x3a:
- caps_pressed = 1;
- return 0;
- case 0x1d:
- ctrl_pressed = 1;
- return 0;
- case 0xb6:
- case 0xaa:
- shift_pressed = 0;
- return 0;
- case 0xba:
- caps_pressed = 0;
- return 0;
- case 0x9d:
- ctrl_pressed = 0;
- return 0;
- /*
- * Ignore unrecognized keys--usually arrow and such
- */
- default:
- if ( c & 0x80 )
- /* High-bit on means key is being released, not pressed */
- return 0;
- if ( c == 88 )
- /* F12 - abort */
- exit( 1 );
- if ( c > 0x39 ) {
- return 0;
- }
- }
-
- /* Strip high bit, look up in our map */
- c &= 127;
- if ( ctrl_pressed ) {
- outch = key_map[c];
- outch &= 037;
- } else {
- outch = shift_pressed ? shift_map[c] : key_map[c];
- if ( caps_pressed ) {
- if ( outch >= 'A' && outch <= 'Z' ) outch += 'a' - 'A';
- else if ( outch >= 'a' && outch <= 'z' ) outch -= 'a' - 'A';
- }
- }
-
- *ch = outch;
- return 1;
-}
-
-
-void _IBMPC_keyboard_isr( rtems_unsigned32 interrupt )
-{
- if ( _IBMPC_scankey( & kbd_buffer[ kbd_last ] ) ) {
- /* Got one; save it if there is enough room in buffer. */
- unsigned int next = (kbd_last + 1) % KBD_BUF_SIZE;
- if ( next != kbd_first )
- kbd_last = next;
- }
-
- /* Mark interrupt as handled */
- outport_byte( 0x20, 0x20 );
-}
-
-
-int _IBMPC_chrdy( char * ch )
-{
- if ( _IBMPC_Use_Go32_IO ) {
- /* Read keyboard via BIOS: raw mode. */
- if ( kbhit() ) {
- *ch = getkey();
- return 1;
- } else {
- return 0;
- }
- } else {
- /* Check buffer our ISR builds */
- if ( kbd_first != kbd_last ) {
- *ch = kbd_buffer[ kbd_first ];
- kbd_first = (kbd_first + 1) % KBD_BUF_SIZE;
- return 1;
- } else {
- return 0;
- }
- }
-}
-
-int _IBMPC_inch( void )
-{
- char Ch;
- while ( ! _IBMPC_chrdy( & Ch ) )
- continue;
- return Ch;
-}
diff --git a/c/src/lib/libbsp/i386/go32/console/outch.c b/c/src/lib/libbsp/i386/go32/console/outch.c
deleted file mode 100644
index 9f7df342db..0000000000
--- a/c/src/lib/libbsp/i386/go32/console/outch.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * $Id$
- */
-
-#include <go32.h>
-#include <bsp.h>
-
-#include <string.h>
-#include <unistd.h>
-
-#define MAX_COL 80
-#define MAX_ROW 50
-
-static unsigned nrow = 25;
-static unsigned ncol = 80;
-static unsigned short * tvram = TVRAM;
-static unsigned char current_col = 0;
-static unsigned char current_row = 0;
-static unsigned short screen_copy[ MAX_ROW*MAX_COL ];
-
-static void init_cons( void );
-
-/*
- * set_cursor_pos()
- * Set cursor position based on current absolute screen offset
- */
-static void
-set_cursor_pos(void)
-{
- register unsigned short gdc_pos = current_row * ncol + current_col;
- outport_byte( GDC_REG_PORT, 0xe );
- outport_byte( GDC_VAL_PORT, (gdc_pos >> 8) & 0xff );
- outport_byte( GDC_REG_PORT, 0xf );
- outport_byte( GDC_VAL_PORT, gdc_pos & 0xff );
-}
-
-/*
- * scroll_up()
- * Scroll screen up one line
- */
-static void
-scroll_up( unsigned short * tv, unsigned short * copy, unsigned int lines )
-{
- if ( lines > nrow )
- lines = nrow;
-
- /* move everything up */
- memmove( copy, copy+ncol*lines, (nrow-lines)*ncol*sizeof copy[0] );
-
- /* fill bottom with blanks */
- {
- int loop = ncol*lines;
- unsigned short * ptr = copy + ncol*(nrow-lines);
- while ( --loop >= 0 )
- *ptr++ = (WHITE<<8) | ' ';
- }
-
- /* copy new screen to video buffer */
- dosmemput( copy, nrow*ncol*sizeof copy[0], (int)tv );
-}
-
-
-/*
- * PUT()
- * Write character at current screen location
- */
-inline static void PUT( char c )
-{
- unsigned short loc = current_row*ncol+current_col;
- unsigned short val = (WHITE<<8) | c;
- screen_copy[loc] = val;
- dosmemput( &screen_copy[loc], sizeof screen_copy[0], (int)(tvram+loc) );
-}
-
-/*
- * cons_putc()
- * Place a character on next screen position
- */
-static void
-cons_putc( unsigned char c )
-{
- static int first = 1;
- if ( first ) {
- init_cons();
- first = 0;
- }
-
- switch (c) {
- case '\t':
- while ( current_row % 8 )
- cons_putc(' ');
- break;
- case '\r':
- current_col = 0;
- break;
- case '\n':
- if ( ++current_row >= nrow ) {
- scroll_up( tvram, screen_copy, 1 );
- current_row -= 1;
- }
- break;
- case '\b':
- if ( current_col > 0 ) {
- --current_col;
- PUT(' ');
- }
- break;
- default:
- PUT(c);
- current_col += 1;
- if ( current_col >= ncol ) {
- current_col = 0;
- current_row += 1;
- if ( current_row >= nrow ) {
- scroll_up( tvram, screen_copy, 1 );
- current_row -= 1;
- }
- }
- };
- set_cursor_pos();
-}
-
-
-/*
- * init_cons()
- * Hook for any early setup
- */
-static void
-init_cons( void )
-{
-#if 0
- /* Get a copy of original screen */
- dosmemget( (int)tvram, nrow*ncol*sizeof *tvram, screen_copy );
-#else
- /* Clear entire screen */
- scroll_up( tvram, screen_copy, nrow );
-#endif
-}
-
-
-
-void _IBMPC_outch( unsigned char ch )
-{
- extern int _IBMPC_Use_Go32_IO;
-
- if ( _IBMPC_Use_Go32_IO ) {
- write( 1, &ch, 1 );
- } else {
- cons_putc( ch );
- }
-}
diff --git a/c/src/lib/libbsp/i386/go32/include/Makefile.in b/c/src/lib/libbsp/i386/go32/include/Makefile.in
deleted file mode 100644
index 7d8581095f..0000000000
--- a/c/src/lib/libbsp/i386/go32/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/i386/go32/include/bsp.h b/c/src/lib/libbsp/i386/go32/include/bsp.h
deleted file mode 100644
index a2f79040ef..0000000000
--- a/c/src/lib/libbsp/i386/go32/include/bsp.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/* bsp.h
- *
- * This include file definitions related to the ibm386 (go32) board.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __IBMPC_h
-#define __IBMPC_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <iosupp.h>
-#include <console.h>
-#include <clockdrv.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-
-/*
- * Define the interrupt mechanism for Time Test 27
- *
- * NOTE: Use a software interrupt for the i386 family.
- */
-#define MUST_WAIT_FOR_INTERRUPT 0
-#define Install_tm27_vector( handler ) set_vector( (handler), 0x90, 1 )
-#define Cause_tm27_intr() asm volatile( "int $0x90" : : );
-#define Clear_tm27_intr()
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( _microseconds ) { \
- rtems_unsigned32 _cnt = (_microseconds); \
- asm volatile ("0: nop; mov %0,%0; loop 0b" : "=c"(_cnt) : "0"(_cnt) ); \
-}
-
-
-/* Constants */
-
-/* Assume color console */
-#define COLOR 1
-#if COLOR
-# define GDC_REG_PORT 0x3d4
-# define GDC_VAL_PORT 0x3d5
-# define TVRAM ((unsigned short *)0xb8000L)
-#else
-# define GDC_REG_PORT 0x3b4
-# define GDC_VAL_PORT 0x3b5
-# define TVRAM ((unsigned short *)0xb0000L)
-#endif
-
-/* White character attribute--works for MGA and CGA */
-#define WHITE 0x07
-
-/* Ports for PC keyboard */
-#define KBD_CTL 0x61
-#define KBD_DATA 0x60
-#define KBD_STATUS 0x64
-
-/* Constants relating to the 8254 (or 8253) programmable interval timers */
- /* Port address of the control port and timer channels */
-/*
- * Macros for specifying values to be written into a mode register.
- */
-#define IO_TIMER1 0x40
-#define TIMER_CNTR0 (IO_TIMER1 + 0) /* timer 0 counter port */
-#define TIMER_CNTR1 (IO_TIMER1 + 1) /* timer 1 counter port */
-#define TIMER_CNTR2 (IO_TIMER1 + 2) /* timer 2 counter port */
-#define TIMER_MODE (IO_TIMER1 + 3) /* timer mode port */
-#define TIMER_SEL0 0x00 /* select counter 0 */
-#define TIMER_SEL1 0x40 /* select counter 1 */
-#define TIMER_SEL2 0x80 /* select counter 2 */
-#define TIMER_INTTC 0x00 /* mode 0, intr on terminal cnt */
-#define TIMER_ONESHOT 0x02 /* mode 1, one shot */
-#define TIMER_RATEGEN 0x04 /* mode 2, rate generator */
-#define TIMER_SQWAVE 0x06 /* mode 3, square wave */
-#define TIMER_SWSTROBE 0x08 /* mode 4, s/w triggered strobe */
-#define TIMER_HWSTROBE 0x0a /* mode 5, h/w triggered strobe */
-#define TIMER_LATCH 0x00 /* latch counter for reading */
-#define TIMER_LSB 0x10 /* r/w counter LSB */
-#define TIMER_MSB 0x20 /* r/w counter MSB */
-#define TIMER_16BIT 0x30 /* r/w counter 16 bits, LSB first */
-#define TIMER_BCD 0x01 /* count in BCD */
-
-#define CLOCK_DISABLE() \
- ({ char mask; inport_byte( 0x21, mask ); outport_byte( 0x21, mask | 1 ); })
-#define CLOCK_ENABLE() \
- ({ char mask; inport_byte( 0x21, mask ); outport_byte( 0x21, mask & ~1); })
-
-/* The internal tick rate in ticks per second */
-#define TIMER_TICK 1193182
-#define US_TO_TICK(us) (((us)*105+44)/88)
-#define TICK_TO_US(tk) (((tk)*88+52)/105)
-
-/* Structures */
-
-#ifdef IBMPC_INIT
-#undef BSP_EXTERN
-#define BSP_EXTERN
-#else
-#undef BSP_EXTERN
-#define BSP_EXTERN extern
-#endif
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* functions */
-
-int _IBMPC_chrdy( char * ch );
-int _IBMPC_inch( void );
-void _IBMPC_outch( unsigned char );
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-/* routines */
-
-i386_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
-
diff --git a/c/src/lib/libbsp/i386/go32/include/coverhd.h b/c/src/lib/libbsp/i386/go32/include/coverhd.h
deleted file mode 100644
index ac186a6341..0000000000
--- a/c/src/lib/libbsp/i386/go32/include/coverhd.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C on this target.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
-#define CALLING_OVERHEAD_TASK_CREATE 0
-#define CALLING_OVERHEAD_TASK_IDENT 0
-#define CALLING_OVERHEAD_TASK_START 0
-#define CALLING_OVERHEAD_TASK_RESTART 0
-#define CALLING_OVERHEAD_TASK_DELETE 0
-#define CALLING_OVERHEAD_TASK_SUSPEND 0
-#define CALLING_OVERHEAD_TASK_RESUME 0
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
-#define CALLING_OVERHEAD_TASK_MODE 0
-#define CALLING_OVERHEAD_TASK_GET_NOTE 0
-#define CALLING_OVERHEAD_TASK_SET_NOTE 0
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 0
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
-#define CALLING_OVERHEAD_CLOCK_GET 0
-#define CALLING_OVERHEAD_CLOCK_SET 0
-#define CALLING_OVERHEAD_CLOCK_TICK 0
-
-#define CALLING_OVERHEAD_TIMER_CREATE 0
-#define CALLING_OVERHEAD_TIMER_IDENT 0
-#define CALLING_OVERHEAD_TIMER_DELETE 0
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 0
-#define CALLING_OVERHEAD_TIMER_RESET 0
-#define CALLING_OVERHEAD_TIMER_CANCEL 0
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
-
-#define CALLING_OVERHEAD_EVENT_SEND 0
-#define CALLING_OVERHEAD_EVENT_RECEIVE 0
-#define CALLING_OVERHEAD_SIGNAL_CATCH 0
-#define CALLING_OVERHEAD_SIGNAL_SEND 0
-#define CALLING_OVERHEAD_PARTITION_CREATE 0
-#define CALLING_OVERHEAD_PARTITION_IDENT 0
-#define CALLING_OVERHEAD_PARTITION_DELETE 0
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
-#define CALLING_OVERHEAD_REGION_CREATE 0
-#define CALLING_OVERHEAD_REGION_IDENT 0
-#define CALLING_OVERHEAD_REGION_DELETE 0
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
-#define CALLING_OVERHEAD_PORT_CREATE 0
-#define CALLING_OVERHEAD_PORT_IDENT 0
-#define CALLING_OVERHEAD_PORT_DELETE 0
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 0
-#define CALLING_OVERHEAD_IO_OPEN 0
-#define CALLING_OVERHEAD_IO_CLOSE 0
-#define CALLING_OVERHEAD_IO_READ 0
-#define CALLING_OVERHEAD_IO_WRITE 0
-#define CALLING_OVERHEAD_IO_CONTROL 0
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/i386/go32/startup/Makefile.in b/c/src/lib/libbsp/i386/go32/startup/Makefile.in
deleted file mode 100644
index 5942446090..0000000000
--- a/c/src/lib/libbsp/i386/go32/startup/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bsplibc bsppost bspstart sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/i386/go32/startup/bspstart.c b/c/src/lib/libbsp/i386/go32/startup/bspstart.c
deleted file mode 100644
index 958591ec8c..0000000000
--- a/c/src/lib/libbsp/i386/go32/startup/bspstart.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-#include <zilog/z8036.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- rtems_unsigned32 heap_start;
-
-#if 0
- extern int end;
- heap_start = (rtems_unsigned32) &end;
-#else
- void * sbrk( int );
- heap_start = (rtems_unsigned32) sbrk( 64 * 1024 + CPU_ALIGNMENT );
-#endif
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * main/bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-/* This is the original command line passed from DOS */
-char ** Go32_Argv;
-
-int main(
- int argc,
- char **argv,
- char **environp
-)
-{
- extern void * sbrk( int );
- extern volatile void _exit( int );
-
- /* Set up arguments that we can access later */
- Go32_Argv = argv;
-
- if ((argc > 0) && argv && argv[0])
- rtems_progname = argv[0];
- else
- rtems_progname = "RTEMS";
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_table_segment = 0;/* get_ds(); */
- Cpu_table.interrupt_table_offset = (void *)0;
- Cpu_table.interrupt_stack_size = 4096;
-
- BSP_Configuration.work_space_start = sbrk( Configuration.work_space_size );
- if ( BSP_Configuration.work_space_start == 0 ) {
- /* Big trouble */
- int write( int, void *, int );
- char msg[] = "bsp_start() couldn't sbrk() RTEMS work space\n";
- write( 2, msg, sizeof msg - 1 );
- _exit( 1 );
- }
-
- rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
- /* does not return */
-
- /* We only return here if the executive has finished. This happens */
- /* when the task has called exit(). */
- /* At this point we call _exit() which resides in djgcc. */
-
- for (;;)
- _exit( 0 );
-
- /* no cleanup necessary for GO32 */
-
- return 0;
-}
diff --git a/c/src/lib/libbsp/i386/go32/startup/exit.c b/c/src/lib/libbsp/i386/go32/startup/exit.c
deleted file mode 100644
index 057ec24865..0000000000
--- a/c/src/lib/libbsp/i386/go32/startup/exit.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * exit
- *
- * This routine returns control to DOS.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <clockdrv.h>
-#include <iodrv.h>
-
-#if 0
-/* Prefer to pick up _exit() in djgcc */
-void _exit( )
-{
- Io_cleanup();
- bsp_cleanup();
-}
-#endif
-
diff --git a/c/src/lib/libbsp/i386/go32/startup/setvec.c b/c/src/lib/libbsp/i386/go32/startup/setvec.c
deleted file mode 100644
index 36e0a34fe4..0000000000
--- a/c/src/lib/libbsp/i386/go32/startup/setvec.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector under go32.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-#include <dpmi.h>
-#include <go32.h>
-
-i386_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- i386_isr_entry previous_isr;
-
- if ( type ) {
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr);
- } else {
- _CPU_ISR_install_raw_handler( vector, handler, (proc_ptr *)&previous_isr);
- }
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/i386/go32/timer/Makefile.in b/c/src/lib/libbsp/i386/go32/timer/Makefile.in
deleted file mode 100644
index 2b32db0b00..0000000000
--- a/c/src/lib/libbsp/i386/go32/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=timerisr
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i386/go32/timer/timer.c b/c/src/lib/libbsp/i386/go32/timer/timer.c
deleted file mode 100644
index 061bbfcbf1..0000000000
--- a/c/src/lib/libbsp/i386/go32/timer/timer.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/* Timer_init()
- *
- * This routine initializes the timer on the IBM 386.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-volatile rtems_unsigned32 Ttimer_val;
-rtems_boolean Timer_driver_Find_average_overhead;
-
-#if defined(pentium)
-static inline unsigned long long rdtsc( void )
-{
- /* Return the value of the on-chip cycle counter. */
- unsigned long long result;
- __asm __volatile( ".byte 0x0F, 0x31" : "=A" (result) );
- return result;
-}
-#else
-#define US_PER_ISR 250
-extern rtems_isr timerisr();
-static rtems_isr_entry Old_Ticker;
-#endif
-
-static void Timer_exit( void )
-{
-#if defined(pentium)
- CLOCK_ENABLE();
-#else /* pentium */
- extern void rtc_set_dos_date( void );
-
- /* reset to DOS value: */
- outport_byte( TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN );
- outport_byte( TIMER_CNTR0, 0 );
- outport_byte( TIMER_CNTR0, 0 );
-
- /* reset time-of-day */
- rtc_set_dos_date();
-
- /* re-enable old handler: assume it was one of ours */
- set_vector( (rtems_isr_entry)Old_Ticker, 0x8, 0 );
-#endif /* pentium */
-}
-
-void Timer_initialize()
-{
- extern int atexit( void (*)(void) );
-
- static int First = 1;
-
- if ( First ) {
- First = 0;
-
- /* Try not to hose the system on return to DOS. */
- atexit( Timer_exit );
-
-#if defined(pentium)
- /* Disable the programmable timer so ticks don't interfere. */
- CLOCK_DISABLE();
-#else /* pentium */
- /* install a timer ISR */
- Old_Ticker = (rtems_isr_entry) set_vector( timerisr, 0x8, 0 );
-
- /* Wait for ISR to be called at least once */
- Ttimer_val = 0;
- while ( Ttimer_val == 0 )
- continue;
-
- /* load timer for US_PER_ISR microsecond period */
- outport_byte( TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN );
- outport_byte( TIMER_CNTR0, US_TO_TICK(US_PER_ISR) >> 0 & 0xff );
- outport_byte( TIMER_CNTR0, US_TO_TICK(US_PER_ISR) >> 8 & 0xff );
-#endif /* PENTIUM */
- }
-#if defined(pentium)
- Ttimer_val = rdtsc(); /* read starting time */
-#else
- /* Wait for ISR to be called at least once */
- asm( "sti" );
- Ttimer_val = 0;
- while ( Ttimer_val == 0 )
- continue;
- Ttimer_val = 0;
-#endif
-}
-
-#define AVG_OVERHEAD 0 /* 0.1 microseconds to start/stop timer. */
-#define LEAST_VALID 1 /* Don't trust a value lower than this */
-
-
-int Read_timer()
-{
- register rtems_unsigned32 total;
-#if defined(pentium)
- total = rdtsc() - Ttimer_val;
-#else /* pentium */
- register rtems_unsigned8 lsb, msb;
- register rtems_unsigned32 clicks;
- outport_byte( TIMER_MODE, TIMER_SEL0|TIMER_LATCH );
- inport_byte( TIMER_CNTR0, lsb );
- inport_byte( TIMER_CNTR0, msb );
- clicks = msb << 8 | lsb;
- total = (Ttimer_val * US_PER_ISR) + (US_PER_ISR - TICK_TO_US( clicks ));
-#endif /* pentium */
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total;
- else if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
- else
- return total - AVG_OVERHEAD;
-}
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
-
diff --git a/c/src/lib/libbsp/i386/go32/timer/timerisr.s b/c/src/lib/libbsp/i386/go32/timer/timerisr.s
deleted file mode 100644
index 2e9ccf0dc7..0000000000
--- a/c/src/lib/libbsp/i386/go32/timer/timerisr.s
+++ /dev/null
@@ -1,41 +0,0 @@
-/* timer_isr()
- *
- * This routine provides the ISR for the timer. The timer is set up
- * to generate an interrupt at maximum intervals.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-
- BEGIN_CODE
-
- EXTERN(_Ttimer_val)
-
- PUBLIC(timerisr)
-
-SYM (timerisr):
- addl $1,_Ttimer_val # another tick
- push edx
- push eax
- movw $0x20,dx
- mov edx,eax
- outb al,(dx) # touch interrupt controller
- pop eax
- pop edx
- iret
-
-END_CODE
-END
diff --git a/c/src/lib/libbsp/i386/go32/times_i486dx b/c/src/lib/libbsp/i386/go32/times_i486dx
deleted file mode 100644
index 49601b31d0..0000000000
--- a/c/src/lib/libbsp/i386/go32/times_i486dx
+++ /dev/null
@@ -1,191 +0,0 @@
-#
-# Timing Test Suite Results for the go32 BSP using an i486DX
-#
-# $Id$
-#
-
-Board: PC/AT clone
-CPU: Intel i486DX
-Clock Speed: 33 Mhz
-Memory Configuration: DRAM w/256K cache
-Wait States: unknown
-
-Times Reported in: microseconds
-Timer Source: i8254
-
-Column A: 3.5.1 pre-release
-Column B: 3.5.17 pre-release
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 57 66
- rtems_semaphore_delete 59 61
- rtems_semaphore_obtain: available 9 7
- rtems_semaphore_obtain: not available -- NO_WAIT 8 7
- rtems_semaphore_release: no waiting tasks 9 8
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 39 37
-
- 3 rtems_semaphore_release: task readied -- preempts caller 25 24
-
- 4 rtems_task_restart: blocked task -- preempts caller 124 102
- rtems_task_restart: ready task -- preempts caller 55 111
- rtems_semaphore_release: task readied -- returns to caller 16 15
- rtems_task_create 31 30
- rtems_task_start 19 18
- rtems_task_restart: suspended task -- returns to caller 20 19
- rtems_task_delete: suspended task 28 26
- rtems_task_restart: ready task -- returns to caller 20 19
- rtems_task_restart: blocked task -- returns to caller 28 26
- rtems_task_delete: blocked task 34 28
-
- 5 rtems_task_suspend: calling task 26 23
- rtems_task_resume: task readied -- preempts caller 17 15
-
- 6 rtems_task_restart: calling task 22 19
- rtems_task_suspend: returns to caller 10 8
- rtems_task_resume: task readied -- returns to caller 10 8
- rtems_task_delete: ready task 34 33
-
- 7 rtems_task_restart: suspended task -- preempts caller 37 34
-
- 8 rtems_task_set_priority: obtain current priority 7 5
- rtems_task_set_priority: returns to caller 13 12
- rtems_task_mode: obtain current mode 3 3
- rtems_task_mode: no reschedule 4 4
- rtems_task_mode: reschedule -- returns to caller 20 17
- rtems_task_mode: reschedule -- preempts caller 39 37
- rtems_task_set_note 7 5
- rtems_task_get_note 7 5
- rtems_clock_set 17 16
- rtems_clock_get 2 1
-
- 9 rtems_message_queue_create 117 113
- rtems_message_queue_send: no waiting tasks 22 19
- rtems_message_queue_urgent: no waiting tasks 22 19
- rtems_message_queue_receive: available 18 16
- rtems_message_queue_flush: no messages flushed 15 14
- rtems_message_queue_flush: messages flushed 17 17
- rtems_message_queue_delete 63 63
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 10 8
- rtems_message_queue_receive: not available -- caller blocks 42 40
-
-11 rtems_message_queue_send: task readied -- preempts caller 38 37
-
-12 rtems_message_queue_send: task readied -- returns to caller 27 24
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 38 36
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 26 24
-
-15 rtems_event_receive: obtain current events 0 0
- rtems_event_receive: not available -- NO_WAIT 6 5
- rtems_event_receive: not available -- caller blocks 34 33
- rtems_event_send: no task readied 6 5
- rtems_event_receive: available 21 19
- rtems_event_send: task readied -- returns to caller 19 15
-
-16 rtems_event_send: task readied -- preempts caller 26 24
-
-17 rtems_task_set_priority: preempts caller 36 33
-
-18 rtems_task_delete: calling task 51 52
-
-19 rtems_signal_catch 17 18
- rtems_signal_send: returns to caller 38 39
- rtems_signal_send: signal to self 46 62
- exit ASR overhead: returns to calling task 20 25
- exit ASR overhead: returns to preempting task 29 29
-
-20 rtems_partition_create 65 67
- rtems_region_create 59 54
- rtems_partition_get_buffer: available 39 35
- rtems_partition_get_buffer: not available 18 16
- rtems_partition_return_buffer 36 30
- rtems_partition_delete 32 30
- rtems_region_get_segment: available 22 21
- rtems_region_get_segment: not available -- NO_WAIT 29 25
- rtems_region_return_segment: no waiting tasks 24 22
- rtems_region_get_segment: not available -- caller blocks 83 81
- rtems_region_return_segment: task readied -- preempts caller 85 84
- rtems_region_return_segment: task readied -- returns to caller 39 41
- rtems_region_delete 30 30
- rtems_io_initialize 1 1
- rtems_io_open 0 0
- rtems_io_close 0 0
- rtems_io_read 0 0
- rtems_io_write 0 0
- rtems_io_control 0 1
-
-21 rtems_task_ident 116 114
- rtems_message_queue_ident 113 111
- rtems_semaphore_ident 122 120
- rtems_partition_ident 113 110
- rtems_region_ident 115 111
- rtems_port_ident 113 109
- rtems_timer_ident 113 109
- rtems_rate_monotonic_ident 113 111
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 82 85
- rtems_message_queue_broadcast: no waiting tasks 11 9
- rtems_message_queue_broadcast: task readied -- preempts caller 51 56
-
-23 rtems_timer_create 8 7
- rtems_timer_fire_after: inactive 14 12
- rtems_timer_fire_after: active 13 12
- rtems_timer_cancel: active 8 7
- rtems_timer_cancel: inactive 7 6
- rtems_timer_reset: inactive 11 10
- rtems_timer_reset: active 11 11
- rtems_timer_fire_when: inactive 17 16
- rtems_timer_fire_when: active 17 17
- rtems_timer_delete: active 10 9
- rtems_timer_delete: inactive 9 8
- rtems_task_wake_when 36 34
-
-24 rtems_task_wake_after: yield -- returns to caller 5 3
- rtems_task_wake_after: yields -- preempts caller 22 19
-
-25 rtems_clock_tick 31 31
-
-26 _ISR_Disable 11 12
- _ISR_Flash 9 9
- _ISR_Enable 31 67
- _Thread_Disable_dispatch 11 10
- _Thread_Enable_dispatch 18 18
- _Thread_Set_state 20 22
- _Thread_Disptach (NO FP) 37 41
- context switch: no floating point contexts 29 26
- context switch: self 14 10
- context switch: to another task 12 12
- context switch: restore 1st FP task 54 54
- fp context switch: save idle, restore idle 47 46
- fp context switch: save idle, restore initialized 25 25
- fp context switch: save initialized, restore initialized 24 25
- _Thread_Resume 23 24
- _Thread_Unblock 14 14
- _Thread_Ready 16 24
- _Thread_Get 2 2
- _Semaphore_Get 1 1
- _Thread_Get: invalid id 0 0
-
-27 interrupt entry overhead: returns to interrupted task 25 23
- interrupt exit overhead: returns to interrupted task 14 15
- interrupt entry overhead: returns to nested interrupt 12 12
- interrupt exit overhead: returns to nested interrupt 14 14
- interrupt entry overhead: returns to preempting task 14 16
- interrupt exit overhead: returns to preempting task 42 38
-
-28 rtems_port_create 43 42
- rtems_port_external_to_internal 6 4
- rtems_port_internal_to_external 6 4
- rtems_port_delete 39 33
-
-29 rtems_rate_monotonic_create 48 42
- rtems_rate_monotonic_period: initiate period -- returns to caller 61 65
- rtems_rate_monotonic_period: obtain status 23 21
- rtems_rate_monotonic_cancel 38 35
- rtems_rate_monotonic_delete: inactive 32 32
- rtems_rate_monotonic_delete: active 22 22
- rtems_rate_monotonic_period: conclude periods -- caller blocks 24 19
diff --git a/c/src/lib/libbsp/i386/go32/times_p5 b/c/src/lib/libbsp/i386/go32/times_p5
deleted file mode 100644
index 977c4ec482..0000000000
--- a/c/src/lib/libbsp/i386/go32/times_p5
+++ /dev/null
@@ -1,196 +0,0 @@
-#
-# Timing Test Suite Results for the go32 BSP using a Pentium
-#
-# $Id$
-#
-
-NOTE: To obtain the execution time in microseconds, divide the number of
- cycles by the clock speed. For example, if rtems_semaphore create
- is reported to be 1164 cycles, then at 66 Mhz it takes 17.64
- microseconds or 8.75 microseconds at 133 Mhz.
-
-Board: PC/AT clone
-CPU: Intel Pentium
-Clock Speed: 66 Mhz
-Memory Configuration: DRAM w/512 Kb cache
-Wait States: unknown
-
-Times Reported in: cycles
-Timer Source: on-CPU cycle counter
-
-Column A: 3.5.1 pre-release
-Column Y: unused
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 1164
- rtems_semaphore_delete 976
- rtems_semaphore_obtain: available 300
- rtems_semaphore_obtain: not available -- NO_WAIT 300
- rtems_semaphore_release: no waiting tasks 291
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 1182
-
- 3 rtems_semaphore_release: task readied -- preempts caller 716
-
- 4 rtems_task_restart: blocked task -- preempts caller 2130
- rtems_task_restart: ready task -- preempts caller 1861
- rtems_semaphore_release: task readied -- returns to caller 491
- rtems_task_create 1017
- rtems_task_start 965
- rtems_task_restart: suspended task -- returns to caller 816
- rtems_task_delete: suspended task 926
- rtems_task_restart: ready task -- returns to caller 850
- rtems_task_restart: blocked task -- returns to caller 1076
- rtems_task_delete: blocked task 927
-
- 5 rtems_task_suspend: calling task 714
- rtems_task_resume: task readied -- preempts caller 575
-
- 6 rtems_task_restart: calling task 646
- rtems_task_suspend: returns to caller 309
- rtems_task_resume: task readied -- returns to caller 320
- rtems_task_delete: ready task 994
-
- 7 rtems_task_restart: suspended task -- preempts caller 1025
-
- 8 rtems_task_set_priority: obtain current priority 223
- rtems_task_set_priority: returns to caller 468
- rtems_task_mode: obtain current mode 99
- rtems_task_mode: no reschedule 114
- rtems_task_mode: reschedule -- returns to caller 264
- rtems_task_mode: reschedule -- preempts caller 836
- rtems_task_set_note 236
- rtems_task_get_note 232
- rtems_clock_set 569
- rtems_clock_get 107
-
- 9 rtems_message_queue_create 3287
- rtems_message_queue_send: no waiting tasks 613
- rtems_message_queue_urgent: no waiting tasks 615
- rtems_message_queue_receive: available 534
- rtems_message_queue_flush: no messages flushed 252
- rtems_message_queue_flush: messages flushed 335
- rtems_message_queue_delete 1195
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 333
- rtems_message_queue_receive: not available -- caller blocks 1194
-
-11 rtems_message_queue_send: task readied -- preempts caller 957
-
-12 rtems_message_queue_send: task readied -- returns to caller 700
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 1261
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 697
-
-15 rtems_event_receive: obtain current events 27
- rtems_event_receive: not available -- NO_WAIT 226
- rtems_event_receive: not available -- caller blocks 888
- rtems_event_send: no task readied 221
- rtems_event_receive: available 393
- rtems_event_send: task readied -- returns to caller 496
-
-16 rtems_event_send: task readied -- preempts caller 719
-
-17 rtems_task_set_priority: preempts caller 959
-
-18 rtems_task_delete: calling task 1295
-
-19 rtems_signal_catch 223
- rtems_signal_send: returns to caller 628
- rtems_signal_send: signal to self 821
- exit ASR overhead: returns to calling task 401
- exit ASR overhead: returns to preempting task 482
-
-20 rtems_partition_create 1337
- rtems_region_create 1031
- rtems_partition_get_buffer: available 680
- rtems_partition_get_buffer: not available 303
- rtems_partition_return_buffer 617
- rtems_partition_delete 523
- rtems_region_get_segment: available 458
- rtems_region_get_segment: not available -- NO_WAIT 565
- rtems_region_return_segment: no waiting tasks 388
- rtems_region_get_segment: not available -- caller blocks 1683
- rtems_region_return_segment: task readied -- preempts caller 1476
- rtems_region_return_segment: task readied -- returns to caller 818
- rtems_region_delete 477
- rtems_io_initialize 48
- rtems_io_open 22
- rtems_io_close 22
- rtems_io_read 22
- rtems_io_write 22
- rtems_io_control 23
-
-21 rtems_task_ident 3381
- rtems_message_queue_ident 3328
- rtems_semaphore_ident 3593
- rtems_partition_ident 3286
- rtems_region_ident 3343
- rtems_port_ident 3278
- rtems_timer_ident 3282
- rtems_rate_monotonic_ident 3287
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 1322
- rtems_message_queue_broadcast: no waiting tasks 347
- rtems_message_queue_broadcast: task readied -- preempts caller 1385
-
-23 rtems_timer_create 306
- rtems_timer_fire_after: inactive 475
- rtems_timer_fire_after: active 475
- rtems_timer_cancel: active 277
- rtems_timer_cancel: inactive 251
- rtems_timer_reset: inactive 391
- rtems_timer_reset: active 465
- rtems_timer_fire_when: inactive 577
- rtems_timer_fire_when: active 578
- rtems_timer_delete: active 377
- rtems_timer_delete: inactive 350
- rtems_task_wake_when 1080
-
-24 rtems_task_wake_after: yield -- returns to caller 159
- rtems_task_wake_after: yields -- preempts caller 574
-
-25 rtems_clock_tick 505
-
-26 _ISR_Disable 33
- _ISR_Flash 33
- _ISR_Enable 26
- _Thread_Disable_dispatch 36
- _Thread_Enable_dispatch 240
- _Thread_Set_state 315
- _Thread_Disptach (NO FP) 623
- context switch: no floating point contexts 594
- context switch: self 89
- context switch: to another task 122
- context switch: restore 1st FP task 1043
- fp context switch: save idle, restore idle 978
- fp context switch: save idle, restore initialized 390
- fp context switch: save initialized, restore initialized 392
- _Thread_Resume 238
- _Thread_Unblock 171
- _Thread_Ready 176
- _Thread_Get 71
- _Semaphore_Get 61
- _Thread_Get: invalid id 10
-
-27 interrupt entry overhead: returns to interrupted task 391
- interrupt exit overhead: returns to interrupted task 110
- interrupt entry overhead: returns to nested interrupt 167
- interrupt exit overhead: returns to nested interrupt 120
- interrupt entry overhead: returns to preempting task 193
- interrupt exit overhead: returns to preempting task 961
-
-28 rtems_port_create 668
- rtems_port_external_to_internal 215
- rtems_port_internal_to_external 211
- rtems_port_delete 491
-
-29 rtems_rate_monotonic_create 823
- rtems_rate_monotonic_period: initiate period -- returns to caller 1094
- rtems_rate_monotonic_period: obtain status 345
- rtems_rate_monotonic_cancel 602
- rtems_rate_monotonic_delete: inactive 553
- rtems_rate_monotonic_delete: active 528
- rtems_rate_monotonic_period: conclude periods -- caller blocks 672
diff --git a/c/src/lib/libbsp/i386/go32/wrapup/Makefile.in b/c/src/lib/libbsp/i386/go32/wrapup/Makefile.in
deleted file mode 100644
index 714d2d51ea..0000000000
--- a/c/src/lib/libbsp/i386/go32/wrapup/Makefile.in
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console timer
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
-install: all
-
diff --git a/c/src/lib/libbsp/i386/i386ex/Makefile.in b/c/src/lib/libbsp/i386/i386ex/Makefile.in
deleted file mode 100644
index 23420b1a4f..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/Makefile.in
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-#was:
-#SUB_DIRS=include startup clock console shmsupp timer wrapup
-#is
-SUB_DIRS=include start startup clock console timer wrapup
diff --git a/c/src/lib/libbsp/i386/i386ex/README b/c/src/lib/libbsp/i386/i386ex/README
deleted file mode 100644
index 240975c3b0..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/README
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# $Id$
-#
-
-This board support package works with the uti386ex, designed and built in
-house at the University of Toronto. It should also be compatible the an
-Intel Evaluation board.
-
-There are no decisions to be made at link time. The BSP reserves ALL
-available space between the end of the bss section and the start of the
-RTEMS Workspace for the heap. If you wish to add network support, then
-you will not need to modify the heap size.
-
-
-See startup/linkcmds and bsp_start.c for details.
-
-The clock is generated from an internal i386ex timer counter. The console
-uses COMM2 -- configured as 9600 n,8,1. COMM1 is available, also
-configured as 9600,n,8,1.
-
-In general, all modification needed to support another i386ex based
-platform should be restricted to start.s. Since there is no real-time
-clock on the Intel eval board, if RTclock support is required, then adding
-rtclock driver support is necessary.
-
-Hope this helps!
-
diff --git a/c/src/lib/libbsp/i386/i386ex/bsp_specs b/c/src/lib/libbsp/i386/i386ex/bsp_specs
deleted file mode 100644
index 3d4b66ec40..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start.o%s} \
-%{qrtems_debug: start_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e reset}
-
diff --git a/c/src/lib/libbsp/i386/i386ex/clock/Makefile.in b/c/src/lib/libbsp/i386/i386ex/clock/Makefile.in
deleted file mode 100644
index e40e10fb1a..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/clock/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i386/i386ex/clock/ckinit.c b/c/src/lib/libbsp/i386/i386ex/clock/ckinit.c
deleted file mode 100644
index 091d6fab45..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/clock/ckinit.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/* Clock_initialize
- *
- * This routine initializes the Timer/Counter on the Intel
- * 386ex evaluation board.
- *
- * The tick frequency is 1 millisecond.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 TMR0 0xF040
-#define TMR1 0xF041
-#define TMR2 0xF042
-#define TMRCON 0xF043
-#define TMRCFG 0xF834
-
-#include <bsp.h>
-#include <irq.h>
-
-#include <rtems/libio.h>
-
-#include <stdlib.h>
-
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-static rtems_unsigned32 Clock_initial_isr_value;
-
-volatile rtems_unsigned32 Clock_driver_ticks;
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_major_number rtems_clock_minor = 0;
-
-/*
- * This is the ISR handler.
- */
-
-void Clock_isr()
-{
- /* enable_tracing(); */
- Clock_driver_ticks += 1;
- if ( Clock_isrs == 1 ) {
- rtems_clock_tick();
- Clock_isrs = Clock_initial_isr_value; /* BSP_Configuration.microseconds_per_tick / 1000;*/
- }
- else
- Clock_isrs -= 1;
-}
-
-void ClockOff(const rtems_irq_connect_data* unused)
-{
- outport_byte ( TMRCFG , 0x80 ); /* disable the counter timer */
-}
-
-void ClockOn(const rtems_irq_connect_data* unused)
-{
- outport_byte ( TMRCFG , 0x00 ); /* enable the counter timer */
-}
-
-int ClockIsOn(const rtems_irq_connect_data* unused)
-{
- return ((i8259s_cache & 0x1) == 0);
-}
-
-static rtems_irq_connect_data clockIrqData = {BSP_PERIODIC_TIMER,
- Clock_isr,
- ClockOn,
- ClockOff,
- ClockIsOn};
-
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- unsigned timer_counter_init_value;
- unsigned char clock_lsb, clock_msb;
-
- Clock_driver_ticks = 0;
-
- Clock_isrs =
- Clock_initial_isr_value =
- BSP_Configuration.microseconds_per_tick / 1000; /* ticks per clock_isr */
-
- /*
- * configure the counter timer ( should be based on microsecs/tick )
- * NB. The divisor(Clock_isrs) resolves the is the same number that appears in confdefs.h
- * when setting the microseconds_per_tick value.
- */
- ClockOff ( &clockIrqData );
-
- timer_counter_init_value = BSP_Configuration.microseconds_per_tick / Clock_isrs;
- clock_lsb = (unsigned char)timer_counter_init_value;
- clock_msb = timer_counter_init_value >> 8;
-
- outport_byte ( TMRCON , 0x34 );
- outport_byte ( TMR0 , clock_lsb ); /* load LSB first */
- outport_byte ( TMR0 , clock_msb ); /* then MSB */
-
- if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
- printk("Unable to initialize system clock\n");
- rtems_fatal_error_occurred(1);
- }
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr();
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
- printk("Error installing clock interrupt handler!\n");
- rtems_fatal_error_occurred(1);
- }
-#ifdef DEBUG
- else
- printk("Clock installed AGAIN\n");
-#endif
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
-
-void Clock_exit()
-{
- ClockOff(&clockIrqData);
- BSP_remove_rtems_irq_handler (&clockIrqData);
-}
diff --git a/c/src/lib/libbsp/i386/i386ex/console/Makefile.in b/c/src/lib/libbsp/i386/i386ex/console/Makefile.in
deleted file mode 100644
index e774529a2b..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/console/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-IMPORT_SRC=$(srcdir)/../../shared/io/printk.c
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console printk
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-preinstall:
- ${CP} ${IMPORT_SRC} .
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} preinstall $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i386/i386ex/console/console.c b/c/src/lib/libbsp/i386/i386ex/console/console.c
deleted file mode 100644
index 84458d5028..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/console/console.c
+++ /dev/null
@@ -1,401 +0,0 @@
-/*-------------------------------------------------------------------------+
-| console.c v1.1 - i386ex BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| This file contains the i386ex console I/O package. It is just a termios
-| wrapper.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is based on:
-| console.c,v 1.4 1995/12/19 20:07:23 joel Exp - go32 BSP
-| console.c,v 1.15 pc386 BSP
-| With the following copyright notice:
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1998.
-| * On-Line Applications Research Corporation (OAR).
-| * Copyright assigned to U.S. Government, 1994.
-| *
-| * The license and distribution terms for this file may be
-| * found in found in the file LICENSE in this distribution or at
-| * http://www.OARcorp.com/rtems/license.html.
-| **************************************************************************
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-
-/* workaround for gcc development tools */
-#undef __assert
-void __assert (const char *file, int line, const char *msg);
-
-#include <bsp.h>
-#include <irq.h>
-#include <rtems/libio.h>
-#include <termios.h>
-#include <uart.h>
-#include <libcpu/cpuModel.h>
-
-/*
- * Possible value for console input/output :
- * BSP_UART_COM1
- * BSP_UART_COM2
- * BSP_CONSOLE_PORT_CONSOLE is not valid in this BSP.
- * All references to either keyboard or video handling have been removed.
- */
-
-int BSPConsolePort = BSP_UART_COM2;
-int BSPBaseBaud = 781250;
-int BSP_poll_read(int);
-
-extern BSP_polling_getchar_function_type BSP_poll_char;
-
-static int conSetAttr(int minor, const struct termios *);
-static void isr_on(const rtems_irq_connect_data *);
-static void isr_off(const rtems_irq_connect_data *);
-static int isr_is_on(const rtems_irq_connect_data *);
-
-/*
- * Change references to com2 if required.
- */
-
-static rtems_irq_connect_data console_isr_data =
-{ BSP_UART_COM2_IRQ,
- BSP_uart_termios_isr_com2,
- isr_on,
- isr_off,
- isr_is_on};
-
-static void
-isr_on(const rtems_irq_connect_data *unused)
-{
- return;
-}
-
-static void
-isr_off(const rtems_irq_connect_data *unused)
-{
- return;
-}
-
-static int
-isr_is_on(const rtems_irq_connect_data *irq)
-{
- return BSP_irq_enabled_at_i8259s(irq->name);
-}
-
-void console_reserve_resources(rtems_configuration_table *conf)
-{
- rtems_termios_reserve_resources(conf, 1);
- return;
-}
-
-void __assert (const char *file, int line, const char *msg)
-{
- static char exit_msg[] = "EXECUTIVE SHUTDOWN! Any key to reboot...";
- unsigned char ch;
-
- /*
- * Note we cannot call exit or printf from here,
- * assert can fail inside ISR too
- */
-
- /*
- * Close console
- */
- __rtems_close(2);
- __rtems_close(1);
- __rtems_close(0);
-
- printk("\nassert failed: %s: ", file);
- printk("%d: ", line);
- printk("%s\n\n", msg);
- printk(exit_msg);
- ch = BSP_poll_char();
- printk("\nShould jump to reset now!\n");
-}
-
-
-/*-------------------------------------------------------------------------+
-| Console device driver INITIALIZE entry point.
-+--------------------------------------------------------------------------+
-| Initilizes the I/O console (keyboard + VGA display) driver.
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_initialize(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- rtems_status_code status;
-
- /*
- * Set up TERMIOS
- */
- rtems_termios_initialize ();
-
- /*
- * Do device-specific initialization
- */
-
- /* 9600-8-N-1, no hardware flow control */
- BSP_uart_init(BSPConsolePort, 9600, 0);
-
-
- /* Set interrupt handler */
- if(BSPConsolePort == BSP_UART_COM1)
- {
- console_isr_data.name = BSP_UART_COM1_IRQ;
- console_isr_data.hdl = BSP_uart_termios_isr_com1;
-
- }
- else
- {
- assert(BSPConsolePort == BSP_UART_COM2);
- console_isr_data.name = BSP_UART_COM2_IRQ;
- console_isr_data.hdl = BSP_uart_termios_isr_com2;
- }
-
- status = BSP_install_rtems_irq_handler(&console_isr_data);
-
- if (!status){
- printk("Error installing serial console interrupt handler!\n");
- rtems_fatal_error_occurred(status);
- }
- /*
- * Register the device
- */
- status = rtems_io_register_name ("/dev/console", major, 0);
- if (status != RTEMS_SUCCESSFUL)
- {
- printk("Error registering console device!\n");
- rtems_fatal_error_occurred (status);
- }
-
- if(BSPConsolePort == BSP_UART_COM1)
- {
- printk("Initialized console on port COM1 9600-8-N-1\n\n");
- }
- else
- {
- printk("Initialized console on port COM2 9600-8-N-1\n\n");
- }
-
- return RTEMS_SUCCESSFUL;
-} /* console_initialize */
-
-
-static int console_open_count = 0;
-
-static int console_last_close(int major, int minor, void *arg)
-{
- BSP_remove_rtems_irq_handler (&console_isr_data);
-
- return 0;
-}
-
-/*-------------------------------------------------------------------------+
-| Console device driver OPEN entry point
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_open(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- rtems_status_code status;
- static rtems_termios_callbacks cb =
- {
- NULL, /* firstOpen */
- console_last_close, /* lastClose */
- NULL, /* poll read */
- BSP_uart_termios_write_com2, /* write */
- conSetAttr, /* setAttributes */
- NULL, /* stopRemoteTx */
- NULL, /* startRemoteTx */
- 1 /* outputUsesInterrupts */
- };
-
- if(BSPConsolePort == BSP_UART_COM2)
- {
- cb.write = BSP_uart_termios_write_com2;
- }
-
- status = rtems_termios_open (major, minor, arg, &cb);
-
- if(status != RTEMS_SUCCESSFUL)
- {
- printk("Error openning console device\n");
- return status;
- }
-
- /*
- * Pass data area info down to driver
- */
- BSP_uart_termios_set(BSPConsolePort,
- ((rtems_libio_open_close_args_t *)arg)->iop->data1);
-
- /* Enable interrupts on channel */
- BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*-------------------------------------------------------------------------+
-| Console device driver CLOSE entry point
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_close(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
-
- return (rtems_termios_close (arg));
-
-} /* console_close */
-
-
-/*-------------------------------------------------------------------------+
-| Console device driver READ entry point.
-+--------------------------------------------------------------------------+
-| Read characters from the I/O console. We only have stdin.
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_read(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- rtems_status_code sc;
- printf("read the console\n");
-
- sc = rtems_termios_read (arg);
-
- if ( sc != RTEMS_SUCCESSFUL )
- printf("console_read: fails %s\n",rtems_status_text(sc));
-
- return sc;
-
-} /* console_read */
-
-
-/*-------------------------------------------------------------------------+
-| Console device driver WRITE entry point.
-+--------------------------------------------------------------------------+
-| Write characters to the I/O console. Stderr and stdout are the same.
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_write(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg)
-{
- return rtems_termios_write (arg);
-
-} /* console_write */
-
-
-
-/*
- * Handle ioctl request.
- */
-rtems_device_driver
-console_control(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_ioctl (arg);
-}
-
-static int
-conSetAttr(int minor, const struct termios *t)
-{
- int baud;
-
- switch (t->c_cflag & CBAUD)
- {
- case B50:
- baud = 50;
- break;
- case B75:
- baud = 75;
- break;
- case B110:
- baud = 110;
- break;
- case B134:
- baud = 134;
- break;
- case B150:
- baud = 150;
- break;
- case B200:
- baud = 200;
- break;
- case B300:
- baud = 300;
- break;
- case B600:
- baud = 600;
- break;
- case B1200:
- baud = 1200;
- break;
- case B1800:
- baud = 1800;
- break;
- case B2400:
- baud = 2400;
- break;
- case B4800:
- baud = 4800;
- break;
- case B9600:
- baud = 9600;
- break;
- case B19200:
- baud = 19200;
- break;
- case B38400:
- baud = 38400;
- break;
- case B57600:
- baud = 57600;
- break;
- case B115200:
- baud = 115200;
- break;
- default:
- baud = 0;
- rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR);
- return 0;
- }
-
- BSP_uart_set_baud(BSPConsolePort, baud);
-
- return 0;
-}
-
-/*
- * BSP initialization
- */
-
-BSP_output_char_function_type BSP_output_char =
- (BSP_output_char_function_type) BSP_output_char_via_serial;
-
-BSP_polling_getchar_function_type BSP_poll_char =
- (BSP_polling_getchar_function_type) BSP_poll_char_via_serial;
-
-int BSP_poll_read(int ttyMinor){
-
- return BSP_poll_char_via_serial();
-}
diff --git a/c/src/lib/libbsp/i386/i386ex/include/Makefile.in b/c/src/lib/libbsp/i386/i386ex/include/Makefile.in
deleted file mode 100644
index 096f514e64..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/include/Makefile.in
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
-
-install: all
diff --git a/c/src/lib/libbsp/i386/i386ex/include/bsp.h b/c/src/lib/libbsp/i386/i386ex/include/bsp.h
deleted file mode 100644
index 257030c075..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/include/bsp.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * This include file definitions related to an Intel i386ex board.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __FORCE386_h
-#define __FORCE386_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <iosupp.h>
-#include <console.h>
-#include <clockdrv.h>
-#include <bspIo.h>
-#include <irq.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Define the interrupt mechanism for Time Test 27
- *
- * NOTE: Use a software interrupt for the i386.
- */
-
-#define MUST_WAIT_FOR_INTERRUTPT 0
-
-
-#define Install_tm27_vector(handler) \
-{ \
- rtems_isr_entry dummy; \
- rtems_interrupt_catch(handler, 0x90, &dummy); \
-}
-#define Cause_tm27_intr() asm volatile( "int $0x90" : : );
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( _microseconds ) \
- { \
- rtems_unsigned32 _counter; \
- \
- _counter = (_microseconds); \
- \
- asm volatile ( "0: nop;" \
- " mov %0,%0 ;" \
- " loop 0b" : "=c" (_counter) \
- : "0" (_counter) \
- ); \
- \
- }
-
-/* Constants */
-
-#define RAM_START 0
-
-/* replaced the earlier EI kludge of 0xfffff */
-
-#define RAM_END 0x100000
-
-/* I/O addressing */
-
-/*
- *#define Is_tx_ready( _status ) ( (_status) & 0x20 )
- */
-/* dec 20. try the TE instead of TBE as the check */
-
-#define Is_tx_ready( _status ) ( (_status) & 0x40 )
-
-
-#define Is_rx_ready( _status ) ( (_status) & 0x01 )
-
-/* Structures */
-
-#ifdef F386_INIT
-#undef BSP_EXTERN
-#define BSP_EXTERN
-#else
-#undef BSP_EXTERN
-#define BSP_EXTERN extern
-#endif
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-#define IDT_SIZE 256
-#define GDT_SIZE 8192
-
-extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE];
-extern segment_descriptors Global_descriptor_table [GDT_SIZE];
-
-BSP_EXTERN unsigned short Idt[3]; /* Interrupt Descriptor Table Address */
-BSP_EXTERN unsigned short Gdt[3]; /* Global Descriptor Table Address */
-BSP_EXTERN unsigned int Idt_base;
-BSP_EXTERN unsigned int Gdt_base;
-
-/* routines */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/i386/i386ex/include/coverhd.h b/c/src/lib/libbsp/i386/i386ex/include/coverhd.h
deleted file mode 100644
index de5e7aa742..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/include/coverhd.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C on this target.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 3
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 3
-#define CALLING_OVERHEAD_TASK_CREATE 4
-#define CALLING_OVERHEAD_TASK_IDENT 4
-#define CALLING_OVERHEAD_TASK_START 4
-#define CALLING_OVERHEAD_TASK_RESTART 3
-#define CALLING_OVERHEAD_TASK_DELETE 3
-#define CALLING_OVERHEAD_TASK_SUSPEND 3
-#define CALLING_OVERHEAD_TASK_RESUME 3
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 4
-#define CALLING_OVERHEAD_TASK_MODE 4
-#define CALLING_OVERHEAD_TASK_GET_NOTE 4
-#define CALLING_OVERHEAD_TASK_SET_NOTE 4
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 7
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 3
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 4
-#define CALLING_OVERHEAD_CLOCK_GET 7
-#define CALLING_OVERHEAD_CLOCK_SET 7
-#define CALLING_OVERHEAD_CLOCK_TICK 2
-
-#define CALLING_OVERHEAD_TIMER_CREATE 3
-#define CALLING_OVERHEAD_TIMER_IDENT 3
-#define CALLING_OVERHEAD_TIMER_DELETE 3
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 4
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 8
-#define CALLING_OVERHEAD_TIMER_RESET 3
-#define CALLING_OVERHEAD_TIMER_CANCEL 3
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 4
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 3
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 4
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 4
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 3
-
-#define CALLING_OVERHEAD_EVENT_SEND 4
-#define CALLING_OVERHEAD_EVENT_RECEIVE 4
-#define CALLING_OVERHEAD_SIGNAL_CATCH 3
-#define CALLING_OVERHEAD_SIGNAL_SEND 3
-#define CALLING_OVERHEAD_PARTITION_CREATE 4
-#define CALLING_OVERHEAD_PARTITION_IDENT 4
-#define CALLING_OVERHEAD_PARTITION_DELETE 3
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 4
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 4
-#define CALLING_OVERHEAD_REGION_CREATE 4
-#define CALLING_OVERHEAD_REGION_IDENT 3
-#define CALLING_OVERHEAD_REGION_DELETE 3
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 4
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 4
-#define CALLING_OVERHEAD_PORT_CREATE 4
-#define CALLING_OVERHEAD_PORT_IDENT 3
-#define CALLING_OVERHEAD_PORT_DELETE 3
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 4
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 4
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 4
-#define CALLING_OVERHEAD_IO_OPEN 4
-#define CALLING_OVERHEAD_IO_CLOSE 4
-#define CALLING_OVERHEAD_IO_READ 4
-#define CALLING_OVERHEAD_IO_WRITE 4
-#define CALLING_OVERHEAD_IO_CONTROL 4
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 3
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 2
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/i386/i386ex/start/80386ex.h b/c/src/lib/libbsp/i386/i386ex/start/80386ex.h
deleted file mode 100644
index 24e4b9a8ee..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/start/80386ex.h
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Submitted by:
- *
- * Erik Ivanenko
- * University of Toronto
- * erik.ivanenko@utoronto.ca
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/* REMAP ADDRESSING Registers */
-#define REMAPCFGH 0x0023
-#define REMAPCFGL 0x0022
-#define REMAPCFG 0x0022
-/* INTERRUPT CONTROL REGISTERS -- SLOT 15 ADDRESSES */
-#define ICW1M 0xF020
-#define ICW1S 0xF0A0
-#define ICW2M 0xF021
-#define ICW2S 0xF0A1
-#define ICW3M 0xF021
-#define ICW3S 0xF0A1
-#define ICW4M 0xF021
-#define ICW4S 0xF0A1
-#define OCW1M 0xF021
-#define OCW1S 0xF0A1
-#define OCW2M 0xF020
-#define OCW2S 0xF0A0
-#define OCW3M 0xF020
-#define OCW3S 0xF0A0
-/* INTERRUPT CONTROL REGISTERS -- SLOT 0 ADDRESSES */
-#define ICW1MDOS 0x0020
-#define ICW1SDOS 0x00A0
-#define ICW2MDOS 0x0021
-#define ICW2SDOS 0x00A1
-#define ICW3MDOS 0x0021
-#define ICW3SDOS 0x00A1
-#define ICW4MDOS 0x0021
-#define ICW4SDOS 0x00A1
-#define OCW1MDOS 0x0021
-#define OCW1SDOS 0x00A1
-#define OCW2MDOS 0x0020
-#define OCW2SDOS 0x00A0
-#define OCW3MDOS 0x0020
-#define OCW3SDOS 0x00A0
-
-
-/* CONFIGURATION Registers */
-#define DMACFG 0xF830
-#define INTCFG 0xF832
-#define TMRCFG 0xF834
-#define SIOCFG 0xF836
-#define P1CFG 0xF820
-#define P2CFG 0xF822
-#define P3CFG 0xF824
-#define PINCFG 0xF826
-
-/* WATCHDOG TIMER Registers */
-#define WDTRLDH 0xF4C0
-#define WDTRLDL 0xF4C2
-#define WDTCNTH 0xF4C4
-#define WDTCNTL 0xF4C6
-#define WDTCLR 0xF4C8
-#define WDTSTATUS 0xF4CA
-
-/* TIMER CONTROL REGISTERS -- SLOT 15 ADDRESSES */
-#define TMR0 0xF040
-#define TMR1 0xF041
-#define TMR2 0xF042
-#define TMRCON 0xF043
-/* TIMER CONTROL REGISTERS -- SLOT 0 ADDRESSES */
-#define TMR0DOS 0x0040
-#define TMR1DOS 0x0041
-#define TMR2DOS 0x0042
-#define TMRCONDOS 0x0043
-
-/* INPUT/OUTPUT PORT UNIT Registers */
-#define P1PIN 0xF860
-#define P1LTC 0xF862
-#define P1DIR 0xF864
-#define P2PIN 0xF868
-#define P2LTC 0xF86A
-#define P2DIR 0xF86C
-#define P3PIN 0xF870
-#define P3LTC 0xF872
-#define P3DIR 0xF874
-
-/* ASYNCHRONOUS SERIAL CHANNEL 0 -- SLOT 15 ADDRESSES */
-#define RBR0 0xF4F8
-#define THR0 0xF4F8
-#define TBR0 0xF4F8
-#define DLL0 0xF4F8
-#define IER0 0xF4F9
-#define DLH0 0xF4F9
-#define IIR0 0xF4FA
-#define LCR0 0xF4FB
-#define MCR0 0xF4FC
-#define LSR0 0xF4FD
-#define MSR0 0xF4FE
-#define SCR0 0xF4FF
-/* ASYNCHRONOUS SERIAL CHANNEL 0 -- SLOT 0 ADDRESSES */
-#define RBR0DOS 0x03F8
-#define THR0DOS 0x03F8
-#define TBR0DOS 0x03F8
-#define DLL0DOS 0x03F8
-#define IER0DOS 0x03F9
-#define DLH0DOS 0x03F9
-#define IIR0DOS 0x03FA
-#define LCR0DOS 0x03FB
-#define MCR0DOS 0x03FC
-#define LSR0DOS 0x03FD
-#define MSR0DOS 0x03FE
-#define SCR0DOS 0x03FF
-
-/* ASYNCHRONOUS SERIAL CHANNEL 1 -- SLOT 15 ADDRESSES */
-#define RBR1 0xF8F8
-#define THR1 0xF8F8
-#define TBR1 0XF8F8
-#define DLL1 0xF8F8
-#define IER1 0xF8F9
-#define DLH1 0xF8F9
-#define IIR1 0xF8FA
-#define LCR1 0xF8FB
-#define MCR1 0xF8FC
-#define LSR1 0xF8FD
-#define MSR1 0xF8FE
-#define SCR1 0xF8FF
-/* ASYNCHRONOUS SERIAL CHANNEL 1 -- SLOT 0 ADDRESSES */
-#define RBR1DOS 0x02F8
-#define THR1DOS 0x02F8
-#define TBR1DOS 0x02F8
-#define DLL1DOS 0x02F8
-#define IER1DOS 0x02F9
-#define DLH1DOS 0x02F9
-#define IIR1DOS 0x02FA
-#define LCR1DOS 0x02FB
-#define MCR1DOS 0x02FC
-#define LSR1DOS 0x02FD
-#define MSR1DOS 0x02FE
-#define SCR1DOS 0x02FF
-
-/* SYNCHRONOUS SERIAL CHANNEL REGISTERS */
-#define SSIOTBUF 0xF480
-#define SSIORBUF 0xF482
-#define SSIOBAUD 0xF484
-#define SSIOCON1 0xF486
-#define SSIOCON2 0xF488
-#define SSIOCTR 0xF48A
-
-/* CHIP SELECT UNIT Registers */
-#define CS0ADL 0xF400
-#define CS0ADH 0xF402
-#define CS0MSKL 0xF404
-#define CS0MSKH 0xF406
-#define CS1ADL 0xF408
-#define CS1ADH 0xF40A
-#define CS1MSKL 0xF40C
-#define CS1MSKH 0xF40E
-#define CS2ADL 0xF410
-#define CS2ADH 0xF412
-#define CS2MSKL 0xF414
-#define CS2MSKH 0xF416
-#define CS3ADL 0xF418
-#define CS3ADH 0xF41A
-#define CS3MSKL 0xF41C
-#define CS3MSKH 0xF41E
-#define CS4ADL 0xF420
-#define CS4ADH 0xF422
-#define CS4MSKL 0xF424
-#define CS4MSKH 0xF426
-#define CS5ADL 0xF428
-#define CS5ADH 0xF42A
-#define CS5MSKL 0xF42C
-#define CS5MSKH 0xF42E
-#define CS6ADL 0xF430
-#define CS6ADH 0xF432
-#define CS6MSKL 0xF434
-#define CS6MSKH 0xF436
-#define UCSADL 0xF438
-#define UCSADH 0xF43A
-#define UCSMSKL 0xF43C
-#define UCSMSKH 0xF43E
-
-/* REFRESH CONTROL UNIT Registers */
-
-#define RFSBAD 0xF4A0
-#define RFSCIR 0xF4A2
-#define RFSCON 0xF4A4
-#define RFSADD 0xF4A6
-
-/* POWER MANAGEMENT CONTROL Registers */
-
-#define PWRCON 0xF800
-#define CLKPRS 0xF804
-
-/* DMA UNIT REGISTERS -- SLOT 15 ADDRESSES */
-#define DMA0TAR 0xF000
-#define DMA0BYC 0xF001
-#define DMA1TAR 0xF002
-#define DMA1BYC 0xF003
-#define DMACMD1 0xF008
-#define DMASTS 0xF008
-#define DMASRR 0xF009
-#define DMAMSK 0xF00A
-#define DMAMOD1 0xF00B
-#define DMACLRBP 0xF00C
-#define DMACLR 0xF00D
-#define DMACLRMSK 0xF00E
-#define DMAGRPMSK 0xF00F
-#define DMA0REQL 0xF010
-#define DMA0REQH 0xF011
-#define DMA1REQL 0xF012
-#define DMA1REQH 0xF013
-#define DMABSR 0xF018
-#define DMACHR 0xF019
-#define DMAIS 0xF019
-#define DMACMD2 0xF01A
-#define DMAMOD2 0xF01B
-#define DMAIEN 0xF01C
-#define DMAOVFE 0xF01D
-#define DMACLRTC 0xF01E
-#define DMA1TARPL 0xF083
-#define DMA1TARPH 0xF085
-#define DMA0TARPH 0xF086
-#define DMA0TARPL 0xF087
-#define DMA0BYCH 0xF098
-#define DMA1BYCH 0xF099
-
-/* DMA UNIT REGISTERS -- SLOT 0 ADDRESSES */
-#define DMA0TARDOS 0x0000
-#define DMA0BYCDOS 0x0001
-#define DMA1TARDOS 0x0002
-#define DMA1BYCDOS 0x0003
-#define DMACMD1DOS 0x0008
-#define DMASTSDOS 0x0008
-#define DMASRRDOS 0x0009
-#define DMAMSKDOS 0x000A
-#define DMAMOD1DOS 0x000B
-#define DMACLRBPDOS 0x000C
-#define DMACLRDOS 0x000D
-#define DMACLRMSKDOS 0x000E
-#define DMAGRPMSKDOS 0x000F
-#define DMA1TARPLDOS 0x0083
-#define DMA0TARPLDOS 0x0087
-
-/* A20GATE AND FAST CPU RESET -- SLOT 15 ADDRESS */
-#define PORT92 0xF092
-/* A20GATE AND FAST CPU RESET -- SLOT 0 ADDRESS */
-#define PORT92DOS 0x0092
-
-/* end of include file */
diff --git a/c/src/lib/libbsp/i386/i386ex/start/80386ex.inc b/c/src/lib/libbsp/i386/i386ex/start/80386ex.inc
deleted file mode 100644
index 798dda4215..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/start/80386ex.inc
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Submitted by:
- *
- * Erik Ivanenko
- * University of Toronto
- * erik.ivanenko@utoronto.ca
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/* REMAP ADDRESSING Registers */
-.set REMAPCFGH , 0x0023
-.set REMAPCFGL , 0x0022
-.set REMAPCFG , 0x0022
-/* INTERRUPT CONTROL REGISTERS -- SLOT 15 ADDRESSES */
-.set ICW1M , 0xF020
-.set ICW1S , 0xF0A0
-.set ICW2M , 0xF021
-.set ICW2S , 0xF0A1
-.set ICW3M , 0xF021
-.set ICW3S , 0xF0A1
-.set ICW4M , 0xF021
-.set ICW4S , 0xF0A1
-.set OCW1M , 0xF021
-.set OCW1S , 0xF0A1
-.set OCW2M , 0xF020
-.set OCW2S , 0xF0A0
-.set OCW3M , 0xF020
-.set OCW3S , 0xF0A0
-/* INTERRUPT CONTROL REGISTERS -- SLOT 0 ADDRESSES */
-.set ICW1MDOS , 0x0020
-.set ICW1SDOS , 0x00A0
-.set ICW2MDOS , 0x0021
-.set ICW2SDOS , 0x00A1
-.set ICW3MDOS , 0x0021
-.set ICW3SDOS , 0x00A1
-.set ICW4MDOS , 0x0021
-.set ICW4SDOS , 0x00A1
-.set OCW1MDOS , 0x0021
-.set OCW1SDOS , 0x00A1
-.set OCW2MDOS , 0x0020
-.set OCW2SDOS , 0x00A0
-.set OCW3MDOS , 0x0020
-.set OCW3SDOS , 0x00A0
-
-
-/* CONFIGURATION Registers */
-.set DMACFG , 0xF830
-.set INTCFG , 0xF832
-.set TMRCFG , 0xF834
-.set SIOCFG , 0xF836
-.set P1CFG , 0xF820
-.set P2CFG , 0xF822
-.set P3CFG , 0xF824
-.set PINCFG , 0xF826
-
-/* WATCHDOG TIMER Registers */
-.set WDTRLDH , 0xF4C0
-.set WDTRLDL , 0xF4C2
-.set WDTCNTH , 0xF4C4
-.set WDTCNTL , 0xF4C6
-.set WDTCLR , 0xF4C8
-.set WDTSTATUS , 0xF4CA
-
-/* TIMER CONTROL REGISTERS -- SLOT 15 ADDRESSES */
-.set TMR0 , 0xF040
-.set TMR1 , 0xF041
-.set TMR2 , 0xF042
-.set TMRCON , 0xF043
-/* TIMER CONTROL REGISTERS -- SLOT 0 ADDRESSES */
-.set TMR0DOS , 0x0040
-.set TMR1DOS , 0x0041
-.set TMR2DOS , 0x0042
-.set TMRCONDOS , 0x0043
-
-/* INPUT/OUTPUT PORT UNIT Registers */
-.set P1PIN , 0xF860
-.set P1LTC , 0xF862
-.set P1DIR , 0xF864
-.set P2PIN , 0xF868
-.set P2LTC , 0xF86A
-.set P2DIR , 0xF86C
-.set P3PIN , 0xF870
-.set P3LTC , 0xF872
-.set P3DIR , 0xF874
-
-/* ASYNCHRONOUS SERIAL CHANNEL 0 -- SLOT 15 ADDRESSES */
-.set RBR0 , 0xF4F8
-.set THR0 , 0xF4F8
-.set TBR0 , 0xF4F8
-.set DLL0 , 0xF4F8
-.set IER0 , 0xF4F9
-.set DLH0 , 0xF4F9
-.set IIR0 , 0xF4FA
-.set LCR0 , 0xF4FB
-.set MCR0 , 0xF4FC
-.set LSR0 , 0xF4FD
-.set MSR0 , 0xF4FE
-.set SCR0 , 0xF4FF
-/* ASYNCHRONOUS SERIAL CHANNEL 0 -- SLOT 0 ADDRESSES */
-.set RBR0DOS , 0x03F8
-.set THR0DOS , 0x03F8
-.set TBR0DOS , 0x03F8
-.set DLL0DOS , 0x03F8
-.set IER0DOS , 0x03F9
-.set DLH0DOS , 0x03F9
-.set IIR0DOS , 0x03FA
-.set LCR0DOS , 0x03FB
-.set MCR0DOS , 0x03FC
-.set LSR0DOS , 0x03FD
-.set MSR0DOS , 0x03FE
-.set SCR0DOS , 0x03FF
-
-/* ASYNCHRONOUS SERIAL CHANNEL 1 -- SLOT 15 ADDRESSES */
-.set RBR1 , 0xF8F8
-.set THR1 , 0xF8F8
-.set TBR1 , 0XF8F8
-.set DLL1 , 0xF8F8
-.set IER1 , 0xF8F9
-.set DLH1 , 0xF8F9
-.set IIR1 , 0xF8FA
-.set LCR1 , 0xF8FB
-.set MCR1 , 0xF8FC
-.set LSR1 , 0xF8FD
-.set MSR1 , 0xF8FE
-.set SCR1 , 0xF8FF
-/* ASYNCHRONOUS SERIAL CHANNEL 1 -- SLOT 0 ADDRESSES */
-.set RBR1DOS , 0x02F8
-.set THR1DOS , 0x02F8
-.set TBR1DOS , 0x02F8
-.set DLL1DOS , 0x02F8
-.set IER1DOS , 0x02F9
-.set DLH1DOS , 0x02F9
-.set IIR1DOS , 0x02FA
-.set LCR1DOS , 0x02FB
-.set MCR1DOS , 0x02FC
-.set LSR1DOS , 0x02FD
-.set MSR1DOS , 0x02FE
-.set SCR1DOS , 0x02FF
-
-/* SYNCHRONOUS SERIAL CHANNEL REGISTERS */
-.set SSIOTBUF , 0xF480
-.set SSIORBUF , 0xF482
-.set SSIOBAUD , 0xF484
-.set SSIOCON1 , 0xF486
-.set SSIOCON2 , 0xF488
-.set SSIOCTR , 0xF48A
-
-/* CHIP SELECT UNIT Registers */
-.set CS0ADL , 0xF400
-.set CS0ADH , 0xF402
-.set CS0MSKL , 0xF404
-.set CS0MSKH , 0xF406
-.set CS1ADL , 0xF408
-.set CS1ADH , 0xF40A
-.set CS1MSKL , 0xF40C
-.set CS1MSKH , 0xF40E
-.set CS2ADL , 0xF410
-.set CS2ADH , 0xF412
-.set CS2MSKL , 0xF414
-.set CS2MSKH , 0xF416
-.set CS3ADL , 0xF418
-.set CS3ADH , 0xF41A
-.set CS3MSKL , 0xF41C
-.set CS3MSKH , 0xF41E
-.set CS4ADL , 0xF420
-.set CS4ADH , 0xF422
-.set CS4MSKL , 0xF424
-.set CS4MSKH , 0xF426
-.set CS5ADL , 0xF428
-.set CS5ADH , 0xF42A
-.set CS5MSKL , 0xF42C
-.set CS5MSKH , 0xF42E
-.set CS6ADL , 0xF430
-.set CS6ADH , 0xF432
-.set CS6MSKL , 0xF434
-.set CS6MSKH , 0xF436
-.set UCSADL , 0xF438
-.set UCSADH , 0xF43A
-.set UCSMSKL , 0xF43C
-.set UCSMSKH , 0xF43E
-
-/* REFRESH CONTROL UNIT Registers */
-
-.set RFSBAD , 0xF4A0
-.set RFSCIR , 0xF4A2
-.set RFSCON , 0xF4A4
-.set RFSADD , 0xF4A6
-
-/* POWER MANAGEMENT CONTROL Registers */
-
-.set PWRCON , 0xF800
-.set CLKPRS , 0xF804
-
-/* DMA UNIT REGISTERS -- SLOT 15 ADDRESSES */
-.set DMA0TAR , 0xF000
-.set DMA0BYC , 0xF001
-.set DMA1TAR , 0xF002
-.set DMA1BYC , 0xF003
-.set DMACMD1 , 0xF008
-.set DMASTS , 0xF008
-.set DMASRR , 0xF009
-.set DMAMSK , 0xF00A
-.set DMAMOD1 , 0xF00B
-.set DMACLRBP , 0xF00C
-.set DMACLR , 0xF00D
-.set DMACLRMSK , 0xF00E
-.set DMAGRPMSK , 0xF00F
-.set DMA0REQL , 0xF010
-.set DMA0REQH , 0xF011
-.set DMA1REQL , 0xF012
-.set DMA1REQH , 0xF013
-.set DMABSR , 0xF018
-.set DMACHR , 0xF019
-.set DMAIS , 0xF019
-.set DMACMD2 , 0xF01A
-.set DMAMOD2 , 0xF01B
-.set DMAIEN , 0xF01C
-.set DMAOVFE , 0xF01D
-.set DMACLRTC , 0xF01E
-.set DMA1TARPL , 0xF083
-.set DMA1TARPH , 0xF085
-.set DMA0TARPH , 0xF086
-.set DMA0TARPL , 0xF087
-.set DMA0BYCH , 0xF098
-.set DMA1BYCH , 0xF099
-
-/* DMA UNIT REGISTERS -- SLOT 0 ADDRESSES */
-.set DMA0TARDOS , 0x0000
-.set DMA0BYCDOS , 0x0001
-.set DMA1TARDOS , 0x0002
-.set DMA1BYCDOS , 0x0003
-.set DMACMD1DOS , 0x0008
-.set DMASTSDOS , 0x0008
-.set DMASRRDOS , 0x0009
-.set DMAMSKDOS , 0x000A
-.set DMAMOD1DOS , 0x000B
-.set DMACLRBPDOS , 0x000C
-.set DMACLRDOS , 0x000D
-.set DMACLRMSKDOS , 0x000E
-.set DMAGRPMSKDOS , 0x000F
-.set DMA1TARPLDOS , 0x0083
-.set DMA0TARPLDOS , 0x0087
-
-/* A20GATE AND FAST CPU RESET -- SLOT 15 ADDRESS */
-.set PORT92 , 0xF092
-/* A20GATE AND FAST CPU RESET -- SLOT 0 ADDRESS */
-.set PORT92DOS , 0x0092
diff --git a/c/src/lib/libbsp/i386/i386ex/start/Makefile.in b/c/src/lib/libbsp/i386/i386ex/start/Makefile.in
deleted file mode 100644
index e5e5d1c9a0..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/start/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-RTEMS_GAS_CODE16 = @RTEMS_GAS_CODE16@
-
-PGMS=${ARCH}/start.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-ifeq ($(RTEMS_GAS_CODE16),yes)
-DEFINES += -DNEW_GAS
-endif
-
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
diff --git a/c/src/lib/libbsp/i386/i386ex/start/macros.inc b/c/src/lib/libbsp/i386/i386ex/start/macros.inc
deleted file mode 100644
index 53016ad62a..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/start/macros.inc
+++ /dev/null
@@ -1,115 +0,0 @@
-/* macros.inc
- *
- * This file assists the board independent startup code
- * by initializing the chip-select channels to
- * reflect the proper memory configuration.
- *
- * NOTE: No stack has been established when this routine
- * is invoked. It returns to start.s through ldsegs
- *
- * Submitted by:
- *
- * Erik Ivanenko
- * University of Toronto
- * erik.ivanenko@utoronto.ca
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-.set GDT_CODE_PTR , 0x10
-.set GDT_DATA_PTR , 0x18
-
-.set BOARD_SELECT , 0x301
-.set BOARD_DATA , 0x302
-.set BOARD_LATCH , 0x303
-
-
-#define SetExRegByte(_register,_value) \
- movb $ ## _value, al; \
- movw $ ## _register, dx; \
- outb al, dx
-
-#define SetExRegWord(_register,_value) \
- movw $ ## _value, ax; \
- movw $ ## _register, dx ; \
- outw ax, dx
-
-
-#define DESC2(lim_0_15, bas_0_15, bas_16_23, access, gran, bas_24_31) \
- .word lim_0_15 ; \
- .word bas_0_15 ; \
- .byte bas_16_23 ; \
- .byte access ; \
- .byte gran ; \
- .byte bas_24_31
-
-#define DESC3( _base, _limit) \
-.word _limit ; \
-.long _base
-
-/* THE GET_ACCESS IS CHANGED FROM 8E TO 9E */
-
-#define INTERRUPT_GATE( _vector ) \
- .word _vector ; \
- .word GDT_CODE_PTR ; \
- .byte 0x0 ; \
- .byte 0x8E ; \
- .word 0x0
-
-#define rLOAD_INDEX( _selector, _segment_register) \
- movl _selector , _segment_register ; \
- addb al, ( eax )
-
-#define rLOAD_SEGMENT( _reg, _segment_register) \
- mov _reg , _segment_register ; \
-
-/* #define rLOAD_SEGMENT( _reg, _segment_register) \
- .code16 ; \
- mov _reg , _segment_register ; \
- .code32
-*/
-#define pLOAD_SEGMENT( _selector, _segment_register) \
- movl $ ## _selector , eax ; .code16 ; \
- mov ax, _segment_register ; .code32
-
-/* #define MOVE_WORD( _immed32, _reg ) \
- data16 ; \
- movl _immed32, _reg
-*/
-
-#define MOVE_WORD( _immed32, _reg ) \
- movw _immed32, _reg
-
-/* #define MOVE_IMMED_WORD( _immed32, _reg ) \
- data16 ; \
- mov $ ## _immed32, _reg
-
-#define CS_OFF( _cs_symbol, _reg ) \
- data16 ; \
- mov _cs_symbol, _reg ; \
- data16 ;\
- andl $0x000ffff, _reg
-
-#define _16_NOPS \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ;
-*/
-
diff --git a/c/src/lib/libbsp/i386/i386ex/start/start.s b/c/src/lib/libbsp/i386/i386ex/start/start.s
deleted file mode 100644
index 543a300744..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/start/start.s
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
- * This file is the main boot and configuration file for the i386ex. It is
- * solely responsible for initializing the internal register set to reflect
- * the proper board configuration. This version is the "generic" i386ex
- * startup:
- *
- * 1) 512K flask ROM @3f80000
- * 2) 1 Mb RAM @ 0x0
- * 3) Timer0 used as RTEMS clock ticker, 1 msec tick rate.
- * 4) READY# is generated by CPU
- *
- * The file is a multi-section file, with sections as follows:
- * 1) interrupt gates, in section "ints"
- * 2) interrupt descriptor table, in section "idt"
- * 3) global descriptor table, in section "gdt"
- * 4) reset in section "reset"
- * 5) and initial boot code in section " initial"
- *
- * Submitted by:
- *
- * Erik Ivanenko
- * University of Toronto
- * erik.ivanenko@utoronto.ca
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
-
-
-changes:
- SetExRegByte(ICW3S , 0x02 ) # MUST be 0x02 according to intel
- SetExRegByte(ICW3M , 0x04 ) # IR2 is cascaded internally: was 0x02 => IR1 is cascaded
-
- */
-
-#include "asm.h"
-#include "macros.inc"
-#include "80386ex.inc"
-
-/*
- * NEW_GAS Needed for binutils 2.9.1.0.7 and higher
- */
-
- EXTERN (boot_card) /* exits to bspstart */
- EXTERN (stack_start) /* defined in startup/linkcmds */
- EXTERN (Clock_exit)
-
- PUBLIC (Interrupt_descriptor_table)
- PUBLIC ( SYM(IDTR) )
- PUBLIC( SYM(_initInternalRegisters) )
-
-BEGIN_DATA
-SYM(IDTR): DESC3( SYM(Interrupt_descriptor_table), 0x07ff );
-
-SYM(Interrupt_descriptor_table): /* Now in data section */
- .rept 256
- .word 0,0,0,0
- .endr
-
-END_DATA
-
-BEGIN_DATA
- PUBLIC (_Global_descriptor_table)
-
-SYM(GDTR): DESC3( GDT_TABLE, 0x1f ); # one less than the size
-SYM (_Global_descriptor_table):
-SYM(GDT_TABLE): DESC2(0,0,0,0,0,0);
-SYM(GDT_ALIAS): DESC2(32,0x1000,0x0,0x93,0,0x0);
-SYM(GDT_CODE): DESC2(0xffff,0,0x0,0x9B,0xDF,0x00);
-SYM(GDT_DATA): DESC2(0xffff,0,0x0,0x92,0xDF,0x00); # was CF
-SYM(GDT_END):
-
-END_DATA
-
-
-/* This section is the section that is used by the interrupt
- descriptor table. It is used to provide the IDT with the
- correct vector offsets. It is for symbol definition only.
-*/
-
-
- .section .reset
-
- PUBLIC ( SYM(reset) )
-SYM(reset):
- nop
- cli
- jmp SYM(_initInternalRegisters) /* different section in this file */
- .code32 /* in case this section moves */
- nop /* required by CHIP LAB to pad out size */
- nop
- nop
- nop
- nop
-
-
-
- .section .initial
-
-/*
- * Enable access to peripheral register at expanded I/O addresses
- */
-SYM(_initInternalRegisters):
- .code16
- movw $0x8000 , ax
- outb al , $REMAPCFGH
- xchg al , ah
- outb al,$REMAPCFGL
- outw ax, $REMAPCFG ;
-
-
-/*
- * Configure operation of the A20 Address Line
- */
-SYM(A20):
- movw $PORT92 , dx
-
- inb dx , al # clear A20 port reset
- andb $0xfe , al # b0 Fast Reset(0)=disabled,(1)=reset triggered
- orb $0x02 , al # Bit 1 Fast A20 = 0 (always 0) else enabled.
- outb al , dx
-
-SYM(Watchdog):
- movw $WDTSTATUS , dx # address the WDT status port
- inb dx , al # get the WDT status
- orb $0x01 , al # set the CLKDIS bit
- outb al , dx # disable the clock to the WDT
-
-/*
- * Initialize Refresh Control Unit for:
- * Refresh Address = 0x0000
-
- * Refresh gate between rows is 15.6 uSec
- * Using a CLK2 frequency of 50Mhz ( 25Mhz CPU )
- * The refresh unit is enabled
- * The refresh pin is not used.
- */
-
-SYM(InitRCU):
- SetExRegWord( RFSCIR , 390) # refresh interval was 390, tried 312
- SetExRegWord( RFSBAD , 0x0) # base address
- SetExRegWord( RFSADD , 0x0) # address register
- SetExRegWord( RFSCON , 0x8000) # enable bit
-
-/*
- * Initialize clock and power mgmt unit for:
- * Clock Frequency = 50 Mhz
- * Prescaled clock output = 1 Mhz
- * Normal halt instructions
- */
-
-SYM(InitClk):
- SetExRegByte( PWRCON, 0x0 )
- SetExRegWord( CLKPRS, 0x17) # 0x13 for 1.19318 MHz. 0x17 for 1MHz.
-
-/**************************************************************
- * Initialize the Pin Configurations
- *************************************************************/
-
-/*
- * Initialize I/O port 1 for:
- * PIN 0 = 1, DCD0# to package pin
- * PIN 1 = 1, RTS0# to package pin
- * PIN 2 = 1, DTR0# to package pin
- * PIN 3 = 1, DSR0# to package pin
- * PIN 4 = 1, RI0# to package pin
- * PIN 5 = 0, Outport (FLASH Vpp Enable, 0=Enable 1=Disable)
- * PIN 6 = 0, Outport (P16_HOLD to 386ex option header JP7 pin 5)
- * PIN 7 = 0, Outport (P17_HOLD to 386ex option header JP7 pin 3)
- */
-
-SYM(InitPort1):
- SetExRegByte( P1LTC , 0xff )
- SetExRegByte( P1DIR , 0x0 )
- SetExRegByte( P1CFG , 0x1f)
-
-/*
- * Initialize I/O port 2 for:
- * PIN 0 = 0, Outport (P20_CS0# to 386ex option header JP7 pin 11)
- * PIN 1 = 0, Outport (P21_CS1# to 386ex option header JP7 pin 9)
- * PIN 2 = 1, CS2# (SMRAM) If not using CS2 can be configured as.?
- * PIN 3 = 0, Outport ( no connect )
- * PIN 4 = 1, CS#4 (DRAM)
- * PIN 5 = 1, RXD0 input. See not for I/0 port 1 pins 1-4
- * PIN 6 = 1, TXD0 output.
- * PIN 7 = 1, CTS0# input.
- */
-
-SYM(InitPort2):
- SetExRegByte( P2LTC , 0xff )
- SetExRegByte( P2DIR , 0x0 )
- SetExRegByte( P2CFG , 0xfe)
-
-/*
- * Initialize I/O port 3 P3CFG
- * PIN 0 = 1, TMROUT0 to package pin
- * PIN 1 = 0, (TMROUT1 to 386ex option header JP7 pin 23)
- * PIN 2 = 0, INT0 (IR1) disabled, (P3.2 out to JP7 pin 21)
- * PIN 3 = 0, INT1 (IR5) disbled (P3.3 to option header JP7 pin 19)
- * PIN 4 = 0, INT2 (IR6) disbled (P3.4 to option header JP7 pin 17)
- * PIN 5 = 0, INT2 (IR7) disabled (P3.5 to 386ex header JP7 pin 15)
- * PIN 6 = 0, Inport (Debugger Break P3.6/PWRD to package pin )
- * P3.6 selected
- * PIN 7 = 0, COMCLK output disabled, 1.8432 Mhz OSC1 oscillator.
- * ( Debbugger uses COMCLK as the clocking source )
- * P3.7 connected to package pin.
- */
-
-SYM(InitPort3):
- SetExRegByte( P3LTC , 0xff )
- SetExRegByte( P3DIR , 0x41 )
- SetExRegByte( P3CFG , 0x09 ) # can check TMROUT0
-/*
- * Initialize Peripheral Pin Configurations:
- * PIN 0 = 1, RTS1# to package pin
- * PIN 1 = 1, DTR1# to package pin
- * PIN 2 = 1, TXD1 out to package pin
- * PIN 3 = 0, EOP#/TC
- * PIN 4 = 0, DACK0#
- * PIN 5 = 1, Timer2
- * PIN 6 = 0, 0 => CS6# connected to package pin
- * PIN 7 = 0, Don't care
- */
-
-SYM(InitPeriph):
- SetExRegByte( PINCFG , 0x24)
-
-/*
- * Initialize the Asynchronous Serial Ports:
- * BIT 7 = 1, Internal SIO1 modem signals
- * BIT 6 = 1, Internal SIO0 modem signals
- * BIT 2 = 0, PSCLK for SSIO clock
- * BIT 1 = 1, SERCLK for SIO1 clock
- * BIT 0 = 1, SERCLK for SIO0 clock
- */
-
-SYM(InitSIO):
- SetExRegByte( SIOCFG, 0xC3 ) # SIOn clocked internally
-
- SetExRegByte( LCR0, 0x80 ) # latch DLL0, DLH0
- SetExRegByte( DLL0, 0x51 ) # 0x51 sets to 9600 baud 0x7 -> 115,200
- SetExRegByte( DLH0, 0x00 ) # 0x145 is 2400 baud
- SetExRegByte( LCR0, 0x03 ) # enable r/w buffers, IER0 accessible
- # mode 8-n-1
- SetExRegByte( IER0, 0x00 ) # was 0x0f All interrupts detected
-
- SetExRegByte( LCR1, 0x80 ) # latch DLL0, DLH0
- SetExRegByte( DLL1, 0x51 ) # 0x51 set to 9600 baud, 0x7 = 115200
- SetExRegByte( DLH1, 0x00 ) # 0x145 is 2400 baud
- SetExRegByte( LCR1, 0x03 ) # enable r/w buffers, IER1 accessible
- # reg 8-n-1
- SetExRegByte( IER1, 0x00 ) # was 0x0f - All interrupts detected
-
-SYM(InitMCR):
-/*
- * Initialize Timer for:
- * BIT 7 = 1, Timer clocks disabled
- * BIT 6 = 0, Reserved
- * BIT 5 = 1, TMRCLK2 instead of Vcc to Gate2
- * BIT 4 = 0, PSCLK to CLK2
- * BIT 3 = 1, TMRCLK1 instead of Vcc to Gate1
- * BIT 2 = 0, PSCLK to Gate1
- * BIT 1 = 0, Vcc to Gate0
- * BIT 0 = 0, PSCLK to Gate0
- */
-
-SYM(InitTimer):
- SetExRegByte(TMRCFG , 0x80 ) # All counters disabled, Gates 0,1
- # and 2 are set to Vcc
-
- SetExRegByte(TMRCON , 0x34 ) # prepare to write counter 0 LSB,MSB
- SetExRegByte(TMR0 , 0x00 ) # sfa
- SetExRegByte(TMR0 , 0x00 ) # sfa
-
-
- SetExRegByte(TMRCON , 0x70 ) # mode 0 disables on Gate= Vcc
- SetExRegByte(TMR1 , 0x00 ) # sfa
- SetExRegByte(TMR1 , 0x00 ) # sfa
-
- SetExRegByte(TMRCON , 0xB0 ) # mode 0 disables on gate =Vcc
- SetExRegByte(TMR2 , 0x00 ) #
- SetExRegByte(TMR2 , 0x00 ) #
-
- SetExRegByte(TMRCFG , 0x80 ) # Enable = 0x00
-
-/*
- * Initialize the DMACFG register for:
- * BIT 7 = 1 , Disable DACK#1
- * BITs 6:4 = 100, TMROUT2 connected to DRQ1
- * BIT 3 = 1 , Disable DACK0#
- * BIT 2:0 = 000, Pin is connected to DRQ0
- */
-
- SetExRegByte(DMACFG , 0xC0 )
- SetExRegByte(DMACMD1, 0x00 ) # disable both DMA channels
- SetExRegByte(DMAMOD1, 0x40 )
-/*
- * Initialize the INTCFG register for:
- * BIT 7 = 0, 8259 cascade disabled
- * BIT 3 = 0, SLAVE IR6 connected to Vss
- * BIT 2 = 0, SLAVE IR5 connected to Vss
- * BIT 1 = 0, SLAVE IR1 connected to SSIOINT
- * BIT 0 = 0, SLAVE IR0 connected to Vss
- */
-
-SYM(InitInt):
-
- cli # !
-
- SetExRegByte(ICW1S , 0x11 ) # EDGE TRIGGERED
- SetExRegByte(ICW2S , 0x28 ) # Slave base vector after Master
- SetExRegByte(ICW3S , 0x02 ) # slave cascaded to IR2 on master
- SetExRegByte(ICW4S , 0x01 ) # must be 0x01
-
- SetExRegByte(ICW1M , 0x11 ) # edge triggered
- SetExRegByte(ICW2M , 0x20 ) # base vector starts at byte 32
- SetExRegByte(ICW3M , 0x04) # IR2 is cascaded internally
- SetExRegByte(ICW4M , 0x01 ) # idem
-
- SetExRegByte(OCW1M , 0xde ) # IR0 only = 0xfe. for IR5 and IR0 active use 0xde
- SetExRegByte(INTCFG , 0x00 )
-
- movw $0xFFFB, SYM(i8259s_cache) /* set up same values in cache */
-
-SYM(SetCS4):
- SetExRegWord(CS4ADL , 0x702) #Configure chip select 4
- SetExRegWord(CS4ADH , 0x00)
- SetExRegWord(CS4MSKH, 0x03F)
- SetExRegWord(CS4MSKL, 0xFC01)
-
-SYM(SetUCS1):
- SetExRegWord(UCSADL , 0x0304) # 512K block starting at 0x80000 until 0x3f80000
- SetExRegWord(UCSADH , 0x03F8)
- SetExRegWord(UCSMSKH, 0x03F7)
- SetExRegWord(UCSMSKL, 0xFC01) # configure upper chip select
-
-/******************************************************
-* The GDT must be in RAM since it must be writeable,
-* So, move the whole data section down.
-********************************************************/
-
- movw $ _ram_data_offset , di
- movw $ _ram_data_segment, cx
- mov cx , es
-
- movw $ _data_size , cx
- movw $ _rom_data_segment, ax
- movw $ _rom_data_offset , si
- mov ax , ds
-
- repne
- movsb
-
-/*****************************
- * Load the Global Descriptor
- * Table Register
- ****************************/
-
-#ifdef NEW_GAS
- data32
- addr32
-#endif
- lgdt SYM(GDTR) # location of GDT
-
-
-SYM(SetUCS):
- SetExRegWord(UCSADL, 0x0702) # now 512K starting at 0x3f80000.
- SetExRegWord(UCSADH, 0x03f8)
- SetExRegWord(UCSMSKH, 0x0007)
- SetExRegWord(UCSMSKL, 0xFC01) # configure upper chip select
-
-/***************************
- * Switch to Protected Mode
- ***************************/
- mov cr0, eax
- orw $0x1, ax
- mov eax, cr0
-
-/**************************
- * Flush prefetch queue,
- * and load CS selector
- *********************/
-
- ljmpl $ GDT_CODE_PTR , $ SYM(_load_segment_registers) # sets the code selector
-
-/*
- * Load the segment registers
- */
-SYM(_load_segment_registers):
- .code32
- pLOAD_SEGMENT( GDT_DATA_PTR, fs)
- pLOAD_SEGMENT( GDT_DATA_PTR, gs)
- pLOAD_SEGMENT( GDT_DATA_PTR, ss)
- pLOAD_SEGMENT( GDT_DATA_PTR, ds)
- pLOAD_SEGMENT( GDT_DATA_PTR, es)
-
-/*
- * Set up the stack
- */
-
-SYM(lidtr):
- lidt SYM(IDTR)
-
-SYM (_establish_stack):
- movl $end, eax # stack starts right after bss
- movl $stack_origin, esp # this is the high starting address
- movl $stack_origin, ebp
-/*
- * Zero out the BSS segment
- */
-SYM (zero_bss):
- cld # make direction flag count up
- movl $ SYM (end),ecx # find end of .bss
- movl $ SYM (_bss_start),edi # edi = beginning of .bss
- subl edi,ecx # ecx = size of .bss in bytes
- shrl ecx # size of .bss in longs
- shrl ecx
- xorl eax,eax # value to clear out memory
- repne # while ecx != 0
- stosl # clear a long in the bss
-
-/*
- * Transfer control to User's Board Support Package
- */
- pushl $0 # environp
- pushl $0 # argv
- pushl $0 # argc
- call SYM(boot_card)
- addl $12,esp
-
- cli # stops interrupts from being processed after hlt!
- hlt # shutdown
-
-END
-
diff --git a/c/src/lib/libbsp/i386/i386ex/startup/Makefile.in b/c/src/lib/libbsp/i386/i386ex/startup/Makefile.in
deleted file mode 100644
index c12bd4662f..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/startup/Makefile.in
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared:@srcdir@/../../shared/comm:@srcdir@/../../shared/irq:@srcdir@/../../shared/io
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk irq irq_init i386-stub-glue uart i386-stub
-
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-# removed initcsu piece, ldsegs piece and flush
-S_PIECES=irq_asm
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(srcdir)/linkcmds $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-#DEFINES += -DPRINTON
-
-DEFINES += -I$(srcdir) -DBSP_IS_I386EX=1
-CPPFLAGS +=
-CFLAGS += -g
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-preinstall:
- $(INSTALL) ${IMPORT_SRC} .
-
-# ${CP} ${IMPORT_SRC} .
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-all: ${ARCH} preinstall $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/i386/i386ex/startup/README b/c/src/lib/libbsp/i386/i386ex/startup/README
deleted file mode 100644
index 17fde76a91..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/startup/README
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# $Id$
-#
-
-
-The requirements for this BSP are only that the GAS used supports the
-.code16 directive. The GAS released with any GCC version 2.8.0 or better
-is required. The BSP was built with an egcs snapshot pre-1.0.2 and
-post-1.0.1. However, any egcs should work.
-
-
-The only "real" differences are in bspstart.c, where the initialization now
-configures all available RAM, (after setting up the Workspaces) as heap.
-The location of the stack was changed so that the heap was not trapped
-between low memory and the stack; the stack comes before the heap.
-
-
diff --git a/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c b/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c
deleted file mode 100644
index 7208694304..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to the i386ex and submitted by:
- *
- * Erik Ivanenko
- * University of Toronto
- * erik.ivanenko@utoronto.ca
- *
- * $Id$
- */
-
-void bsp_clean_up(void);
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-/*
- * Tells us where to put the workspace in case remote debugger is present.
- */
-
-extern rtems_unsigned32 rdb_start;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int heap_bottom;
- rtems_unsigned32 heap_start;
- rtems_unsigned32 heap_size;
-
- heap_start = (rtems_unsigned32) &heap_bottom;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- heap_size = BSP_Configuration.work_space_start -(void *) heap_start ;
- heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
-
- heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
- bsp_libc_init((void *) heap_start, heap_size, 0);
-
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- /*
- * we do not use the pretasking_hook.
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_table_segment = get_ds();
- Cpu_table.interrupt_table_offset = (void *)Interrupt_descriptor_table;
- Cpu_table.interrupt_stack_size = 8192; /* changed Sept 14 STACK_MINIMUM_SIZE */
-
-#if defined(RTEMS_POSIX_API)
- BSP_Configuration.work_space_size *= 3;
-#endif
-
- /* BSP_Configuration.work_space_size += 128 * RTEMS_MINIMUM_STACK_SIZE; */
-
- BSP_Configuration.work_space_start = (void *)
- RAM_END - BSP_Configuration.work_space_size;
-#ifdef DEBUG
- printk("workspace size = 0x%x\nstart = 0x%x, RAM_END = 0x%x\n",BSP_Configuration.work_space_size, BSP_Configuration.work_space_start, RAM_END );
-#endif
-
- /*
- * Account for the console's resources
- */
-
- /* console_reserve_resources( &BSP_Configuration ); */
- /*
- * Init rtems_interrupt_management
- */
- rtems_irq_mngt_init();
-}
-void bsp_clean_up(void) {
- printk("bsp_cleanup called\n");
-}
diff --git a/c/src/lib/libbsp/i386/i386ex/startup/linkcmds b/c/src/lib/libbsp/i386/i386ex/startup/linkcmds
deleted file mode 100644
index 8a944cdeac..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/startup/linkcmds
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the Intel 386ex evaluation board.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- *
- * Memory layout:
- *
- * 0x3f80000 -> 0x3ff0000 : text section
- * 0x3ff0000 -> 0x3ff0028 : global descriptor table in ROM
- * 0x3ff0028 -> 0x3fff000 : data section ( copied by start.s to RAM )
- * 0x3fff000 -> 0x3fffff0 : initial section ( init 386ex, goto protected mode, copy ROM-RAM )
- * 0x3fffff0 -> 0x4000000 : reset section ( jmp to initial only )
- */
-
- ENTRY(reset) ;
-SECTIONS
-{
-
-/****************************************************************************************
- * data section:
- *
- * This section defines the locations of the data section in ROM as well as in RAM.
- * start.s copies the data section to RAM in real mode. This is done PRIOR to the lgdt
- * instruction since the data section contains the Global_descriptor_table and GDTR.
- ***********************************************************************************/
-
- _rom_data_start = 0x3ff0000;
-
- _rom_data_segment = 0xF000;
- _rom_data_offset = 0x0;
-
- _ram_data_segment = 0x0000 ;
- _ram_data_offset = 0x0;
- _ram_data_location = _ram_data_segment * 16 + _ram_data_offset;
-
- .data :
- AT ( _rom_data_start )
- {
- _sdata = .;
- *(.data);
- _edata = .;
- }
- _data_start = ADDR(.data) ;
- data_start = _data_start ;
- _data_size = _edata - _sdata ;
-
-/**************************************************************************************
- * bss section:
- *
- * The bss section is the last section in RAM.
- *************************************************************************************/
- _edata = ALIGN( 0x10 );
- .bss :
- {
- _bss_start = .;
- *(.bss);
- *(COMMON);
- _ebss = ALIGN(0x10);
- end = _ebss;
- _end = end;
- __end = end;
- }
- _bss_size = _ebss - _bss_start ;
-
-/**************************************************************************************
- * General variables:
- *
- * The stack_size variable is customizable here. The heap is located directly after
- * The stack in RAM. A routine within bspstart.c uses these variables to ensure that
- * the heap used by RTEMS is as large as the RAM remaining after all workspace configurations
- * are complete.
- *************************************************************************************/
- stack_size = 0x8000 ;
- stack_origin = end + stack_size ;
- heap_bottom = stack_origin + 4 ;
-
-/***************************************************************************************
- * text section:
- *
- * This section is NOT copied into RAM. It is left in ROM, as the flash ROM is quick enough.
- ***************************************************************************************/
- .text ( 0x3f80000 ):
- {
- CREATE_OBJECT_SYMBOLS
- text_start = . ;
- _text_start = . ;
- *(.text ) ;
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- . = ALIGN (4) ;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- _rodata_start 5 . ;
- *(.rodata)
- *(.gnu.linkonce.r*)
- _erodata = ALIGN( 0x10 ) ;
- _etext = ALIGN( 0x10 );
- _endtext = . ;
- }
-
-/*******************************************************************************************
- * initial section:
- *
- * This section is defined after the data section. It must be in the top 64K of memory
- * to enable the initial short jmp from the reset section while still in real-mode. It
- * initializes the i386ex, moves the gdt from ROM to RAM,loads the gdt,
- * jumps to protected mode, copies the data section from ROM to RAM and loads the idt.
- ******************************************************************************************/
-
- .initial _rom_data_start + _data_size :
- {
- *(.initial);
- }
-
-/*******************************************************************************************
- * board reset section:
- *
- * This section contains the short jmp from the reset section to the initial section. It is
- * the first code executed on reset/power on.
- ******************************************************************************************/
-
- .reset 0x3fffff0:
- {
- *(.reset);
- }
-}
diff --git a/c/src/lib/libbsp/i386/i386ex/startup/setvec.c b/c/src/lib/libbsp/i386/i386ex/startup/setvec.c
deleted file mode 100644
index 9e7a0e758d..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/startup/setvec.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on the Force CPU-386.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-i386_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- i386_isr_entry previous_isr;
- interrupt_gate_descriptor idt;
-
- if ( type )
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
- else {
- /* get the address of the old handler */
-
- idt = Interrupt_descriptor_table[ vector ];
-
- previous_isr = (i386_isr_entry)
- ((idt.offset_16_31 << 16) | idt.offset_0_15);
-
- /* build the IDT entry */
- create_interrupt_gate_descriptor( &idt, handler );
-
- /* install the IDT entry */
- Interrupt_descriptor_table[ vector ] = idt;
- }
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/i386/i386ex/timer/Makefile.in b/c/src/lib/libbsp/i386/i386ex/timer/Makefile.in
deleted file mode 100644
index 2b32db0b00..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=timerisr
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i386/i386ex/timer/timer.c b/c/src/lib/libbsp/i386/i386ex/timer/timer.c
deleted file mode 100644
index 208c5442a1..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/timer/timer.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/* Timer_init()
- *
- * This routine initializes the timer on the FORCE CPU-386 board.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: This routine will not work if the optimizer is enabled
- * for some compilers. The multiple writes to the Z8036
- * may be optimized away.
- *
- * It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <stdlib.h>
-
-int Ttimer_val;
-rtems_boolean Timer_driver_Find_average_overhead;
-
-extern void timerisr();
-extern int ClockIsOn(const rtems_raw_irq_connect_data*);
-
-#define TMR0 0xF040
-#define TMR1 0xF041
-#define TMR2 0xF042
-#define TMRCON 0xF043
-#define TMRCFG 0xF834
-
-void TimerOn(const rtems_raw_irq_connect_data* used)
-{
-
- Ttimer_val = 0; /* clear timer ISR count */
-
- outport_byte ( TMRCON , 0xb0 ); /* select tmr2, stay in mode 0 */
- outport_byte ( TMR1 , 0xfa ); /* set to 250 usec interval */
- outport_byte ( TMR1 , 0x00 );
- outport_byte ( TMRCON , 0x64 ); /* change to mode 2 ( starts timer ) */
- /* interrupts ARE enabled */
- /* outport_byte( IERA, 0x41 ); enable interrupt */
- /*
- * enable interrrupt at i8259 level
- */
- BSP_irq_enable_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);
-}
-
-void TimerOff(const rtems_raw_irq_connect_data* used)
-{
- /*
- * disable interrrupt at i8259 level
- */
- BSP_irq_disable_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);
- /* reset timer mode to standard (DOS) value */
-}
-
-static rtems_raw_irq_connect_data timer_raw_irq_data = {
- BSP_RT_TIMER3 + BSP_IRQ_VECTOR_BASE,
- timerisr,
- TimerOn,
- TimerOff,
- ClockIsOn
-};
-
-void Timer_exit()
-{
- if (!i386_delete_idt_entry(&timer_raw_irq_data)) {
- printk("Timer_exit:Timer raw handler removal failed\n");
- rtems_fatal_error_occurred(1);
- }
-}
-
-void Timer_initialize()
-{
-
- static rtems_boolean First = TRUE;
-
- if (First)
- {
- First = FALSE;
-
- atexit(Timer_exit); /* Try not to hose the system at exit. */
- if (!i386_set_idt_entry (&timer_raw_irq_data)) {
- printk("Timer_initialize: raw handler installation failed\n");
- rtems_fatal_error_occurred(1);
- }
- }
- /* wait for ISR to be called at least once */
- Ttimer_val = 0;
- while (Ttimer_val == 0)
- continue;
- Ttimer_val = 0;
-}
-
-#define AVG_OVERHEAD 3 /* It typically takes 3.0 microseconds */
- /* (3 ticks) to start/stop the timer. */
-#define LEAST_VALID 4 /* Don't trust a value lower than this */
-
-int Read_timer()
-{
- register rtems_unsigned32 clicks;
- register rtems_unsigned32 total;
-
-/* outport_byte( TBCR, 0x00 ); stop the timer -- not needed on intel */
-
- outport_byte ( TMRCON, 0x40 ); /* latch the count */
- inport_byte ( TMR1, clicks ); /* read the count */
-
- total = Ttimer_val + 250 - clicks;
-
-/* outport_byte( TBCR, 0x00 ); initial value */
-/* outport_byte( IERA, 0x40 ); disable interrupt */
-
- /* ??? Is "do not restore old vector" causing problems? */
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in one microsecond units */
-
- else {
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
- return (total - AVG_OVERHEAD);
- }
-}
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/i386/i386ex/timer/timerisr.s b/c/src/lib/libbsp/i386/i386ex/timer/timerisr.s
deleted file mode 100644
index 53463e1e70..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/timer/timerisr.s
+++ /dev/null
@@ -1,40 +0,0 @@
-/* timer_isr()
- *
- * This routine provides the ISR for the Z8036 timer on the MVME136
- * board. The timer is set up to generate an interrupt at maximum
- * intervals.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-
- BEGIN_CODE
-
- EXTERN (Ttimer_val)
-
- PUBLIC (timerisr)
-SYM (timerisr):
- addl $250, SYM (Ttimer_val) # another 250 microseconds
- pushl eax
- movb 0xa0,al /* signal generic End Of Interrupt (EOI) to slave PIC */
- outb al, $0x20
- movb $0x20, al
- outb al, $0x20 /* signal generic EOI to Master PIC */
- popl eax
- iret
-
-END_CODE
-END
diff --git a/c/src/lib/libbsp/i386/i386ex/wrapup/Makefile.in b/c/src/lib/libbsp/i386/i386ex/wrapup/Makefile.in
deleted file mode 100644
index 714d2d51ea..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/wrapup/Makefile.in
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console timer
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
-install: all
-
diff --git a/c/src/lib/libbsp/i386/pc386/HOWTO b/c/src/lib/libbsp/i386/pc386/HOWTO
deleted file mode 100644
index 9c7a9af2b4..0000000000
--- a/c/src/lib/libbsp/i386/pc386/HOWTO
+++ /dev/null
@@ -1,308 +0,0 @@
-
-+-----------------------------------------------------------------------------+
-| RTEMS 4.0.0 PC386 BSP HOWTO - 1998/04/21 |
-+-----------------------------------------------------------------------------+
-| (C) Copyright 1998 - |
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation |
-| |
-| http://pandora.ist.utl.pt |
-| |
-| Instituto Superior Tecnico * Lisboa * PORTUGAL |
-+-----------------------------------------------------------------------------+
-| Disclaimer: |
-| |
-| This file is provided "AS IS" without warranty of any kind, either |
-| expressed or implied. |
-+-----------------------------------------------------------------------------+
-
-
-1. Introduction
----------------
-
- This tries to explain how to setup the RTEMS host environment so
-that RTEMS applications can be built for and run in a bare PC 386 or
-above.
-
- It covers essentially the aspects of loading images, since
-information concerning other issues such as building the development
-tools and the RTEMS distribution can be found in the 'RTEMS 4.0.0
-On-Line Library' under 'Getting Started with RTEMS for C/C++ Users'.
-
- Please note that everything in the following text using the
-notation '<...>' is just an alias to something and should always be
-substituted by the real thing!
-
-
-2. Building the GNU C/C++ Cross Compiler Toolset
-------------------------------------------------
-
- Obtaining, building and installing the tools for building the
-PC386 BSP of RTEMS is covered in detail in the 'RTEMS 4.0.0 On-Line
-Library' -> 'Getting Started with RTEMS for C/C++ Users' -> 'Building
-the GNU C/C++ Cross Compiler Toolset'.
-
- When running the 'bit' script you should specift the argumetn as
-either:
-
- + 'i386-elf' to indicate an 'i386-rtemself' toolset, or
- + 'i386' to indicate an 'i386-rtems' toolset.
-
-
-4. Building RTEMS
------------------
- Obtaining, building and installing the tools for building the
-PC386 BSP is covered in detail in the 'RTEMS 4.0.0 On-Line Library' ->
-'Getting Started with RTEMS for C/C++ Users' -> 'Building RTEMS'.
-
- When running configure, use the following values for the listed
-options:
-
- + with an i386-rtemself toolset
- --target=i386-rtemself
- --enable-rtemsbsp=pc386
-
- + with an i386-rtems toolset
- --target=i386-rtems
- --enable-rtemsbsp=pc386
-
-
-5. RTEMS Tests
---------------
-
- If you've completed the last step successfully, you'll find the
-RTEMS sample and test files that can be loaded with GRUB in the
-'<build_point>/pc386/tests' directory, RTEMS sample and test files in
-a format suitable for use with NetBoot in the
-'<build_point>/pc386/BootImgs' directory.
-
-
-6. Loading RTEMS PC386 applications
------------------------------------
-
-6.1. Unarchiving
-----------------
-
- Files which have been "tarred, gzipped" (i.e. .tar.gz or .tgz
-extension) may be unarchived with a command similar to one of the
-following:
-
- zcat <file>.tgz | tar xvof -
-
- OR
-
- gunzip -c <file>.tgz | tar xvof -
-
- OR
-
- tar xzvf <file>.tgz
-
- NOTE: gunzip -c is equivalent to zcat. On commercial (non-Linux)
-Unices, since the GNU utilities are not the standard 'tar' will be
-gtar (GNU tar) and 'zcat' will be 'gzcat'.
-
- Given that the necessary utility programs are installed, any of
-the above commands will extract the contents of <file>.tar.gz into the
-current directory. To view the contents of an archive without
-restoring any files, use a command similar to the following:
-
- zcat <file>.tgz | tar tvf -
-
-
-6.2 Using GRUB to load RTEMS PC386 applications
------------------------------------------------
-
- Using GRUB (GRand Unified Bootloader) is the simplest way to load
-and run your PC386 BSP samples, tests and programs.
-
- You can get the latest release of GRUB from its homepage:
-
- - http://www.uruk.org/grub/
-
-or alternatively by ftp from:
-
- - ftp://ftp.uruk.org/public/grub/
-
- Once you obtain the .tar.gz archive 'grub-0.4.tar.gz', change to a
-temporary directory (you won't need the grub files after this and can
-just go ahead and delete the whole directory structure that was
-generated) and unarchive 'grub-0.4.tar.gz' following the instructions
-given above in [2. Unarchiving].
-
- After this is done change the directory to:
-
- grub-0.4/bin_std
-
-and there you'll find the two files you'll need from this archive:
-'stage1' and 'stage2'.
-
- You should have two (2) formatted diskettes available. One of
-these will only be used temporarily to create the other one, and we'll
-refer to it as 'RAW GRUB' diskette (you can label it accordingly if
-you wish). The other diskette, which we will refer to as 'GRUB FS'
-should be high-level formatted with one of GRUB's supported file
-systems, which are: DOS FAT, BSD FFS, and Linux ext2fs.
-
- A DOS FAT diskette can, obviously, be created under DOS with the
-'FORMAT' command. Under Linux, the following commands are available to
-add file systems to low-level formatted diskettes:
-
- 1. To add a DOS FAT file system to a low-level formatted diskette:
-
- a) If you have mtools installed:
-
- 'mformat a:'.
-
- b) Assuming that you are formatting the diskette in the first
- floppy disk drive ('/dev/fd0' under Linux):
-
- 'mkdosfs /dev/fd0' or
-
- 'mkfs.msdos /dev/fd0'.
-
- 2. To add a Linux ext2fs file system to a low-level formatted
- diskette, assuming that you are formatting the diskette in the
- first floppy disk drive ('/dev/fd0' under Linux):
-
- 'mke2fs /dev/fd0' or
-
- 'mkfs.ext2 /dev/fd0'.
-
- Next we will install using 'rawrite' or 'dd' to the 'GRUB RAW'
-diskette.
-
- NOTE: This will destroy any data currently on the diskette.
-
- Execute your OS's equivalent of (this should work for recent
-FreeBSD versions and Linux just fine):
-
- dd if=stage1 of=/dev/fd0 bs=512 count=1
- dd if=stage2 of=/dev/fd0 bs=512 seek=1
-
- Under DOS/Windows/NT, courtesy of Eric Hanchrow (erich@microsoft.com):
-
- * Use the copy /b command to binary concatenate the stage1 and
- stage2 files together via:
-
- copy /b stage1 stage2 grub.raw
-
- * Use rawrite.exe (which is available in many places on the net and
- in some Linux distributions) to write grub.raw to a diskette.
-
- Next stage: copy the 'stage1' and 'stage2' files to the 'GRUB FS'
-diskette (if you are using Linux you can mount the diskette in an
-appropriate mount point and then 'cp' the files to it, if it is either
-a DOS FAT or an EXT2FS diskette, or in the case of a DOS FAT diskette
-you can use 'mcopy' from 'mtools'.)
-
- After this is done boot a PC using the 'GRUB RAW' diskette. After
-this is done, you will get GRUB's command line interface. Exchange
-'GRUB RAW' with the 'GRUB FS' diskette in the drive and issue the
-following command from GRUB's prompt:
-
- install=(fd0)/stage1 (fd0) (fd0)/stage2 0x8000 (fd0)/grubmenu
-
- This command will make the 'GRUB FS' diskette bootable. After this
-is done, you won't require the 'GRUB RAW' diskette anymore and you can
-delete the 'stage1' file from the 'GRUB FS' diskette.
-
- Next copy all the files you wish to load to the diskette. The GRUB
-loadable test and sample files in the RTEMS distribution have '.exe'
-extension and can be found under the build point in the 'pc386/tests'
-directory. You can compress this files with gzip to save space if you
-wish. GRUB loads 'gzipped' files transparently.
-
- Finally you have to create a GRUB menu configuration file. We will
-call this file 'grubmenu'. You can call it anything as long as you use
-the correct name in the 'install' command where we used 'grubmenu'.
-
- The 'grubmenu' file, as far as we are interested has the following
-syntax:
-
- title= Hello World Test
- kernel= (fd0)/hello.exe.gz
-
- You can add as many of this entries as you want to the 'grubmenu'
-file. There should be one for each program you wish to load. The
-'title=' line provides a description for the program that will appear
-after boot in the GRUB menu for the user to choose and the 'kernel='
-line describes where the file can be found by GRUB (you should leave
-the '(fd0)/' part and just substitute the rest if you've copied the
-files to the root directory of the diskette.
-
- Just boot the PC with the 'GRUB FS' diskette and you will be able
-to choose which program you want to load from GRUB's menu.
-
- The GRUB documentation is available in HTML format in the 'docs'
-directory of the GRUB tree starting with the 'index.html' file.
-
-
-6.3 Using NetBoot to load RTEMS PC386 applications
----------------------------------------------------
-
- To load the '*.bt' files you can
-
- Alternatively, if you have a PC connected to a network with a
-BOOTP server and a TFTP server (this can very well be you're Linux
-RTEMS host system), you can use Gero Kuhlmann's NetBoot loader, to
-load RTEMS to a diskless PC across a network. You can get it from:
-
- ftp://sunsite.unc.edu/pub/Linux/system/boot/ethernet/netboot-0.7.3.tar.gz
-
-or in any of Sunsite's mirrors. It is also available from NetBoot's
-homepage:
-
- http://www.han.de/~gero/netboot
-
- After unarchiving 'netboot-0.7.3.tar.gz' you should change to the
-base directory of this and run:
-
- ./configure --disable-mknbi-dos --disable-mknbi-linux --disable-mknbi-mgl
-
- Afterwards, you should follow the instructions contained in the
-'INSTALL' file also contained in the base directory, on how to setup the
-server(s) and to build a boot ROM for the client PC network card, or a
-boot diskette, and the PC client should be able to load the '*.bt' files
-from the server.
-
- The important sections to check in the 'INSTALL FILE' are the last two:
-
- - Setup of the server (only the BOOTP and TFTP parts - ignore NFS).
- ===================
-
- - Setup of the client including building the bootrom
- ==================================================
-
-all the rest can be safely ignored if you don't care to examine it.
-
-
-7. Technical Information
-------------------------
-
- NOTE: All the following paths are relative to the base directory
-of the RTEMS distribution.
-
- As of the writing of this HOWTO, PC386 images can be loaded either
-in low memory 0x10000 (64KB) until 0x97C00 (607K) using NetBoot or in
-high memory from 0x100000 (1024KB) until the top of the available
-memory using either NetBoot or GRUB.
-
- If you want to change the default loading address from 1024KB to
-something else, just change the value of the variable RELOCADDR in the
-'make/custom/pc386.cfg' file to the new value you want (make sure you
-follow the instructions indicated before the definition of RELOCADDR).
-
- Remember that GRUB restricts the loading addresses to values above
-0x100000 (1024KB), only NetBoot can load images in low memory.
-
- After you make any changes to RELOCADDR and if you are using
-NetLoader, you'll have to recompile the
-'c/src/lib/libbsp/i386/pc386/start/start16.s' file. The easiest way to
-achieve this is just to 'make clean' and the 'make all' again. The
-quickest way is to change to
-'<build_point>/c/src/lib/libbsp/i386/pc386/start' and 'make
-RTEMS_BSP=pc386 clean all'.
-
- When programming interrupt handlers take into account that the PIC
-is reprogrammed and so you should use the interface functions provided
-in '<build_point>/pc386/lib/include/irq.h> to guarantee that everything
-works ok.
diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.in b/c/src/lib/libbsp/i386/pc386/Makefile.in
deleted file mode 100644
index 68582b5145..0000000000
--- a/c/src/lib/libbsp/i386/pc386/Makefile.in
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# We only build the Network library if HAS_NETWORKING was defined
-NETWORK_yes_V = network
-NETWORK = $(NETWORK_$(HAS_NETWORKING)_V)
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include tools start startup clock console timer $(NETWORK) \
- wrapup
diff --git a/c/src/lib/libbsp/i386/pc386/README b/c/src/lib/libbsp/i386/pc386/README
deleted file mode 100644
index 00f3263a99..0000000000
--- a/c/src/lib/libbsp/i386/pc386/README
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# $Id$
-#
-
-#
-# This board support package works with a target PC
-#
-# Decisions to be made a link-edit time are:
-# - The size of the memory allocator heap. The default value is
-# 64 kbytes. If the network package is used the heap
-# should be at least 256 kbytes. If your network is large, or
-# busy, the heap should be even larger.
-# To choose a heap size of 256 kbytes,
-# CFLAGS_LD += -Wl,--defsym -Wl,HeapSize=0x40000
-
-BSP NAME: pc386
-BOARD: PC
-BUS: none
-CPU FAMILY: 386, 486, 586, 686
-COPROCESSORS: none
-MODE: not applicable
-
-DEBUG MONITOR:
-
-PERIPHERALS
-===========
-TIMERS: 8254 Programmable Interval Timer
-RESOLUTION:
-SERIAL PORTS: COM1, COM2
-REAL-TIME CLOCK:
-DMA:
-VIDEO: VGA
-SCSI:
-NETWORKING: external Ethernet controller based on WD8003.
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: 8254 Programmable Interval Timer
-IOSUPP DRIVER:
-SHMSUPP:
-TIMER DRIVER:
-
-STDIO
-=====
-PORT:
-ELECTRICAL:
-BAUD:
-BITS PER CHARACTER:
-PARITY:
-STOP BITS:
-
-NOTES
-=====
-
-Board description
------------------
-clock rate:
-bus width:
-ROM:
-RAM:
-
-Host System
------------
-Linux
diff --git a/c/src/lib/libbsp/i386/pc386/STATUS b/c/src/lib/libbsp/i386/pc386/STATUS
deleted file mode 100644
index d2a1960f72..0000000000
--- a/c/src/lib/libbsp/i386/pc386/STATUS
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# $Id$
-#
-
-
-There are a wide range of PC configurations. This BSP has been tested
-on only a handful. There are configurations which do not yet work. The
-failure is suspected to be video card related. Here is a list of
-successes and failures.
-
-SUCCESSES
-=========
- GRUB - AMD K6 MMX 200Mhz + S3 ViRGE
- GRUB - 486 DX 33Mhz + Cirrus Logic CL-GD540x/542x
- GRUB - Pentium MMX 166Mhz + S3 Trio 64V2
- GRUB - Pentium (P54C) 120Mhz + S3 Trio 64V+
- GRUB - Pentium-S 133Mhz + S3 Trio 64V2
-
-FAILURES
-========
- GRUB - 486 DX2 66Mhz + Cirrus Logic CL-GD5428 - reset
- GRUB - PII 333 Mhz + STB Vision 128 - reset
- GRUB - PII 300 Mhz + Permedia - reset
- GRUB - Pentium 60 Mhz + Mach 32/64 - reset
-
diff --git a/c/src/lib/libbsp/i386/pc386/bsp_specs b/c/src/lib/libbsp/i386/pc386/bsp_specs
deleted file mode 100644
index 61dac86b53..0000000000
--- a/c/src/lib/libbsp/i386/pc386/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start.o%s} \
-%{qrtems_debug: start_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/i386/pc386/clock/Makefile.in b/c/src/lib/libbsp/i386/pc386/clock/Makefile.in
deleted file mode 100644
index c8c96b56d2..0000000000
--- a/c/src/lib/libbsp/i386/pc386/clock/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit rtc
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i386/pc386/clock/ckinit.c b/c/src/lib/libbsp/i386/pc386/clock/ckinit.c
deleted file mode 100644
index ee252a1e44..0000000000
--- a/c/src/lib/libbsp/i386/pc386/clock/ckinit.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/*-------------------------------------------------------------------------+
-| ckinit.c v1.1 - PC386 BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| This file contains the PC386 clock package.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is based on:
-| ckinit.c,v 1.4 1995/12/19 20:07:13 joel Exp - go32 BSP
-| With the following copyright notice:
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1998.
-| * On-Line Applications Research Corporation (OAR).
-| * Copyright assigned to U.S. Government, 1994.
-| *
-| * The license and distribution terms for this file may be
-| * found in found in the file LICENSE in this distribution or at
-| * http://www.OARcorp.com/rtems/license.html.
-| **************************************************************************
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-
-#include <stdlib.h>
-
-#include <bsp.h>
-#include <irq.h>
-#include <rtems/libio.h>
-
-/*-------------------------------------------------------------------------+
-| Macros
-+--------------------------------------------------------------------------*/
-#if 0
-/* This was dropped in the last revision. Its a nice thing to know. */
-#define TICKS_PER_SECOND() \
- (1000000 / (Clock_isrs_per_tick * microseconds_per_isr))
-#endif /* 0 */
-
-/*-------------------------------------------------------------------------+
-| Global Variables
-+--------------------------------------------------------------------------*/
-
-volatile rtems_unsigned32 Clock_driver_ticks; /* Tick (interrupt) counter. */
- rtems_unsigned32 Clock_isrs_per_tick; /* ISRs per tick. */
- rtems_unsigned32 Clock_isrs; /* ISRs until next tick. */
-
-/* The following variables are set by the clock driver during its init */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-/*-------------------------------------------------------------------------+
-| Function: clockIsr
-| Description: Interrupt Service Routine for clock (0h) interruption.
-| Global Variables: Clock_driver_ticks, Clock_isrs.
-| Arguments: vector - standard RTEMS argument - see documentation.
-| Returns: standard return value - see documentation.
-+--------------------------------------------------------------------------*/
-static void clockIsr()
-{
- /*-------------------------------------------------------------------------+
- | PLEASE NOTE: The following is directly transcribed from the go32 BSP for
- | those who wish to use it with PENTIUM based machine. It needs
- | to be correctly integrated with the rest of the code!!!
- +--------------------------------------------------------------------------*/
-
-#if 0 && defined(pentium) /* more accurate clock for PENTIUMs (not supported) */
- {
- extern long long Last_RDTSC;
- __asm __volatile(".byte 0x0F, 0x31" : "=A" (Last_RDTSC));
- }
-#endif /* 0 && pentium */
-
- Clock_driver_ticks++;
-
- if ( Clock_isrs == 1 )
- {
- rtems_clock_tick();
- Clock_isrs = Clock_isrs_per_tick;
- }
- else
- Clock_isrs--;
-
-} /* clockIsr */
-
-/*-------------------------------------------------------------------------+
-| Function: Clock_exit
-| Description: Clock cleanup routine at RTEMS exit. NOTE: This routine is
-| not really necessary, since there will be a reset at exit.
-| Global Variables: None.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void clockOff(const rtems_irq_connect_data* unused)
-{
- if (BSP_Configuration.ticks_per_timeslice)
- {
- /* reset timer mode to standard (BIOS) value */
- outport_byte(TIMER_MODE, TIMER_SEL0 | TIMER_16BIT | TIMER_RATEGEN);
- outport_byte(TIMER_CNTR0, 0);
- outport_byte(TIMER_CNTR0, 0);
- }
-} /* Clock_exit */
-
-
-/*-------------------------------------------------------------------------+
-| Function: Install_clock
-| Description: Initialize and install clock interrupt handler.
-| Global Variables: None.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-static void clockOn(const rtems_irq_connect_data* unused)
-{
- rtems_unsigned32 microseconds_per_isr;
-
-#if 0
- /* Initialize clock from on-board real time clock. This breaks the */
- /* test code which assumes which assumes the application will do it. */
- {
- rtems_time_of_day now;
-
- /* External Prototypes */
- extern void init_rtc(void); /* defined in 'rtc.c' */
- extern long rtc_read(rtems_time_of_day *); /* defined in 'rtc.c' */
-
- init_rtc();
- if (rtc_read(&now) >= 0)
- clock_set(&now);
- }
-#endif /* 0 */
-
- /* Start by assuming hardware counter is large enough, then scale it until
- it actually fits. */
-
- Clock_driver_ticks = 0;
- Clock_isrs_per_tick = 1;
-
- if (BSP_Configuration.microseconds_per_tick == 0)
- microseconds_per_isr = 10000; /* default 10 ms */
- else
- microseconds_per_isr = BSP_Configuration.microseconds_per_tick;
- while (US_TO_TICK(microseconds_per_isr) > 65535)
- {
- Clock_isrs_per_tick *= 10;
- microseconds_per_isr /= 10;
- }
-
- Clock_isrs = Clock_isrs_per_tick; /* Initialize Clock_isrs */
-
- if (BSP_Configuration.ticks_per_timeslice)
- {
- /* 105/88 approximates TIMER_TICK * 1e-6 */
- rtems_unsigned32 count = US_TO_TICK(microseconds_per_isr);
-
- outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
- outport_byte(TIMER_CNTR0, count >> 0 & 0xff);
- outport_byte(TIMER_CNTR0, count >> 8 & 0xff);
- }
-
-}
-
-int clockIsOn(const rtems_irq_connect_data* unused)
-{
- return ((i8259s_cache & 0x1) == 0);
-}
-
-static rtems_irq_connect_data clockIrqData = {BSP_PERIODIC_TIMER,
- clockIsr,
- clockOn,
- clockOff,
- clockIsOn};
-
-
-
-/*-------------------------------------------------------------------------+
-| Clock device driver INITIALIZE entry point.
-+--------------------------------------------------------------------------+
-| Initilizes the clock driver.
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-Clock_initialize(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp)
-{
-
- if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
- printk("Unable to initialize system clock\n");
- rtems_fatal_error_occurred(1);
- }
- /* make major/minor avail to others such as shared memory driver */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-} /* Clock_initialize */
-
-
-/*-------------------------------------------------------------------------+
-| Console device driver CONTROL entry point
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-Clock_control(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp)
-{
- if (pargp != NULL)
- {
- rtems_libio_ioctl_args_t *args = pargp;
-
- /*-------------------------------------------------------------------------+
- | This is hokey, but until we get a defined interface to do this, it will
- | just be this simple...
- +-------------------------------------------------------------------------*/
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- clockIsr();
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
- printk("Error installing clock interrupt handler!\n");
- rtems_fatal_error_occurred(1);
- }
- }
- }
-
- return RTEMS_SUCCESSFUL;
-} /* Clock_control */
-
-void Clock_exit()
-{
- BSP_remove_rtems_irq_handler (&clockIrqData);
-}
-
-/*-------------------------------------------------------------------------+
-| PLEASE NOTE: The following is directly transcribed from the go32 BSP for
-| those who wish to use it with PENTIUM based machine. It needs
-| to be correctly integrated with the rest of the code!!!
-+--------------------------------------------------------------------------*/
-
-
-#if 0 && defined(pentium)
-
-/* This can be used to get extremely accurate timing on a pentium. */
-/* It isn't supported. [bryce] */
-
-#define HZ 90.0
-
-volatile long long Last_RDTSC;
-
-#define RDTSC()\
- ({ long long _now; __asm __volatile (".byte 0x0F,0x31":"=A"(_now)); _now; })
-
-long long Kernel_Time_ns( void )
-{
- extern rtems_unsigned32 _TOD_Ticks_per_second;
-
- unsigned isrs_per_second = Clock_isrs_per_tick * _TOD_Ticks_per_second;
- long long now;
- int flags;
-
- disable_intr(flags);
- now = 1e9 * Clock_driver_ticks / isrs_per_second +
- (RDTSC() - Last_RDTSC) * (1000.0/HZ);
- enable_intr(flags);
- return now;
-} /* Kernel_Time_ns */
-
-#endif /* 0 && pentium */
diff --git a/c/src/lib/libbsp/i386/pc386/clock/rtc.c b/c/src/lib/libbsp/i386/pc386/clock/rtc.c
deleted file mode 100644
index 14a20e5f3f..0000000000
--- a/c/src/lib/libbsp/i386/pc386/clock/rtc.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*-------------------------------------------------------------------------+
-| rtc.c v1.1 - PC386 BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| This file contains the real time clock manipulation package for the
-| PC386 board.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is based on:
-| rtc.c,v 1.4 1995/12/19 20:07:15 joel Exp - go32 BSP
-| With the following copyright notice:
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1998.
-| * On-Line Applications Research Corporation (OAR).
-| * Copyright assigned to U.S. Government, 1994.
-| *
-| * The license and distribution terms for this file may be
-| * found in found in the file LICENSE in this distribution or at
-| * http://www.OARcorp.com/rtems/license.html.
-| **************************************************************************
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-
-#include <string.h>
-
-#include <bsp.h>
-
-/*-------------------------------------------------------------------------+
-| Constants
-+--------------------------------------------------------------------------*/
-#define IO_RTC 0x70 /* RTC */
-
-#define RTC_SEC 0x00 /* seconds */
-#define RTC_SECALRM 0x01 /* seconds alarm */
-#define RTC_MIN 0x02 /* minutes */
-#define RTC_MINALRM 0x03 /* minutes alarm */
-#define RTC_HRS 0x04 /* hours */
-#define RTC_HRSALRM 0x05 /* hours alarm */
-#define RTC_WDAY 0x06 /* week day */
-#define RTC_DAY 0x07 /* day of month */
-#define RTC_MONTH 0x08 /* month of year */
-#define RTC_YEAR 0x09 /* month of year */
-#define RTC_STATUSA 0x0a /* status register A */
-#define RTCSA_TUP 0x80 /* time update, don't look now */
-
-#define RTC_STATUSB 0x0b /* status register B */
-
-#define RTC_INTR 0x0c /* status register C (R) interrupt source */
-#define RTCIR_UPDATE 0x10 /* update intr */
-#define RTCIR_ALARM 0x20 /* alarm intr */
-#define RTCIR_PERIOD 0x40 /* periodic intr */
-#define RTCIR_INT 0x80 /* interrupt output signal */
-
-#define RTC_STATUSD 0x0d /* status register D (R) Lost Power */
-#define RTCSD_PWR 0x80 /* clock lost power */
-
-#define RTC_DIAG 0x0e /* status register E - bios diagnostic */
-#define RTCDG_BITS "\020\010clock_battery\007ROM_cksum\006config_unit\005memory_size\004fixed_disk\003invalid_time"
-
-#define RTC_CENTURY 0x32 /* current century - increment in Dec99 */
-
-
-/*-------------------------------------------------------------------------+
-| Auxiliary Functions
-+--------------------------------------------------------------------------*/
-/*-------------------------------------------------------------------------+
-| Function: bcd
-| Description: Convert 2 digit number to its BCD representation.
-| Global Variables: None.
-| Arguments: i - Number to convert.
-| Returns: BCD representation of number.
-+--------------------------------------------------------------------------*/
-static inline rtems_unsigned8
-bcd(rtems_unsigned8 i)
-{
- return ((i / 16) * 10 + (i % 16));
-} /* bcd */
-
-#define QUICK_READ /* Quick read of the RTC: don't return number of seconds. */
-
-#ifndef QUICK_READ
-
-#define SECS_PER_DAY (24 * 60 * 60)
-#define SECS_PER_REG_YEAR (365 * SECS_PER_DAY)
-
-/*-------------------------------------------------------------------------+
-| Function: ytos
-| Description: Convert years to seconds (since 1970).
-| Global Variables: None.
-| Arguments: y - year to convert (1970 <= y <= 2100).
-| Returns: number of seconds since 1970.
-+--------------------------------------------------------------------------*/
-static inline rtems_unsigned32
-ytos(rtems_unsigned16 y)
-{ /* v NUM LEAP YEARS v */
- return ((y - 1970) * SECS_PER_REG_YEAR + (y - 1970 + 1) / 4 * SECS_PER_DAY);
-} /* ytos */
-
-
-/*-------------------------------------------------------------------------+
-| Function: mtos
-| Description: Convert months to seconds since January.
-| Global Variables: None.
-| Arguments: m - month to convert, leap - is this a month of a leap year.
-| Returns: number of seconds since January.
-+--------------------------------------------------------------------------*/
-static inline rtems_unsigned32
-mtos(rtems_unsigned8 m, rtems_boolean leap)
-{
- static rtems_unsigned16 daysMonth[] = { 0, 0, 31, 59, 90, 120, 151, 181,
- 212, 243, 273, 304, 334, 365 };
- /* Days since beginning of year until beginning of month. */
-
- return ((daysMonth[m] + (leap ? 1 : 0)) * SECS_PER_DAY);
-} /* mtos */
-
-#endif /* QUICK_READ */
-
-/*-------------------------------------------------------------------------+
-| Function: rtcin
-| Description: Perform action on RTC and return its result.
-| Global Variables: None.
-| Arguments: what - what to write to RTC port (what to do).
-| Returns: result received from RTC port after action performed.
-+--------------------------------------------------------------------------*/
-static inline rtems_unsigned8
-rtcin(rtems_unsigned8 what)
-{
- rtems_unsigned8 r;
-
- outport_byte(IO_RTC, what);
- inport_byte (IO_RTC+1, r);
- return r;
-} /* rtcin */
-
-
-/*-------------------------------------------------------------------------+
-| Functions
-+--------------------------------------------------------------------------*/
-/*-------------------------------------------------------------------------+
-| Function: init_rtc
-| Description: Initialize real-time clock (RTC).
-| Global Variables: None.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void
-init_rtc(void)
-{
- rtems_unsigned8 s;
-
- /* initialize brain-dead battery powered clock */
- outport_byte(IO_RTC, RTC_STATUSA);
- outport_byte(IO_RTC+1, 0x26);
- outport_byte(IO_RTC, RTC_STATUSB);
- outport_byte(IO_RTC+1, 2);
-
- outport_byte(IO_RTC, RTC_DIAG);
- inport_byte (IO_RTC+1, s);
- if (s)
- printk("RTC BIOS diagnostic error %b\n", s);
-
- /* FIXME: This was last line's original version. How was it supposed to work?
- printf("RTC BIOS diagnostic error %b\n", s, RTCDG_BITS); */
-} /* init_rtc */
-
-
-/*-------------------------------------------------------------------------+
-| Function: rtc_read
-| Description: Read present time from RTC and return it.
-| Global Variables: None.
-| Arguments: tod - to return present time in 'rtems_time_of_day' format.
-| Returns: number of seconds from 1970/01/01 corresponding to 'tod'.
-+--------------------------------------------------------------------------*/
-long int
-rtc_read(rtems_time_of_day *tod)
-{
- rtems_unsigned8 sa;
- rtems_unsigned32 sec = 0;
-
- memset(tod, 0, sizeof *tod); /* zero tod structure */
-
- /* do we have a realtime clock present? (otherwise we loop below) */
- sa = rtcin(RTC_STATUSA);
- if (sa == 0xff || sa == 0)
- return -1;
-
- /* ready for a read? */
- while ((sa&RTCSA_TUP) == RTCSA_TUP)
- sa = rtcin(RTC_STATUSA);
-
- tod->year = bcd(rtcin(RTC_YEAR)) + 1900; /* year */
- if (tod->year < 1970) tod->year += 100;
- tod->month = bcd(rtcin(RTC_MONTH)); /* month */
- tod->day = bcd(rtcin(RTC_DAY)); /* day */
- (void) bcd(rtcin(RTC_WDAY)); /* weekday */
- tod->hour = bcd(rtcin(RTC_HRS)); /* hour */
- tod->minute = bcd(rtcin(RTC_MIN)); /* minutes */
- tod->second = bcd(rtcin(RTC_SEC)); /* seconds */
- tod->ticks = 0;
-
-#ifndef QUICK_READ /* Quick read of the RTC: don't return number of seconds. */
- sec = ytos(tod->year);
- sec += mtos(tod->month, (tod->year % 4) == 0);
- sec += tod->day * SECS_PER_DAY;
- sec += tod->hour * 60 * 60; /* hour */
- sec += tod->minute * 60; /* minutes */
- sec += tod->second; /* seconds */
-#endif /* QUICK_READ */
-
- return (long int)sec;
-} /* rtc_read */
-
-
diff --git a/c/src/lib/libbsp/i386/pc386/console/Makefile.in b/c/src/lib/libbsp/i386/pc386/console/Makefile.in
deleted file mode 100644
index fa09ab4c80..0000000000
--- a/c/src/lib/libbsp/i386/pc386/console/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../shared/io
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console inch outch printk
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=videoAsm
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i386/pc386/console/console.c b/c/src/lib/libbsp/i386/pc386/console/console.c
deleted file mode 100644
index 7a07a6ca3f..0000000000
--- a/c/src/lib/libbsp/i386/pc386/console/console.c
+++ /dev/null
@@ -1,507 +0,0 @@
-/*-------------------------------------------------------------------------+
-| console.c v1.1 - PC386 BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| This file contains the PC386 console I/O package.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is based on:
-| console.c,v 1.4 1995/12/19 20:07:23 joel Exp - go32 BSP
-| With the following copyright notice:
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1998.
-| * On-Line Applications Research Corporation (OAR).
-| * Copyright assigned to U.S. Government, 1994.
-| *
-| * The license and distribution terms for this file may be
-| * found in found in the file LICENSE in this distribution or at
-| * http://www.OARcorp.com/rtems/license.html.
-| **************************************************************************
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-#undef __assert
-void __assert (const char *file, int line, const char *msg);
-
-#include <bsp.h>
-#include <irq.h>
-#include <rtems/libio.h>
-#include <termios.h>
-#include <uart.h>
-#include <libcpu/cpuModel.h>
-
-/*
- * Possible value for console input/output :
- * BSP_CONSOLE_PORT_CONSOLE
- * BSP_UART_COM1
- * BSP_UART_COM2
- */
-
-/*
- * Possible value for console input/output :
- * BSP_CONSOLE_PORT_CONSOLE
- * BSP_UART_COM1
- * BSP_UART_COM2
- */
-
-int BSPConsolePort = BSP_CONSOLE_PORT_CONSOLE;
-
-/* int BSPConsolePort = BSP_UART_COM2; */
-int BSPBaseBaud = 115200;
-
-extern BSP_polling_getchar_function_type BSP_poll_char;
-
-/*-------------------------------------------------------------------------+
-| External Prototypes
-+--------------------------------------------------------------------------*/
-extern void _IBMPC_keyboard_isr(void);
-extern rtems_boolean _IBMPC_scankey(char *); /* defined in 'inch.c' */
-extern char BSP_wait_polled_input(void);
-extern void _IBMPC_initVideo(void);
-
-static int conSetAttr(int minor, const struct termios *);
-static void isr_on(const rtems_irq_connect_data *);
-static void isr_off(const rtems_irq_connect_data *);
-static int isr_is_on(const rtems_irq_connect_data *);
-
-
-static rtems_irq_connect_data console_isr_data = {BSP_KEYBOARD,
- _IBMPC_keyboard_isr,
- isr_on,
- isr_off,
- isr_is_on};
-
-static void
-isr_on(const rtems_irq_connect_data *unused)
-{
- return;
-}
-
-static void
-isr_off(const rtems_irq_connect_data *unused)
-{
- return;
-}
-
-static int
-isr_is_on(const rtems_irq_connect_data *irq)
-{
- return BSP_irq_enabled_at_i8259s(irq->name);
-}
-
-void console_reserve_resources(rtems_configuration_table *conf)
-{
- if(BSPConsolePort != BSP_CONSOLE_PORT_CONSOLE)
- {
- rtems_termios_reserve_resources(conf, 1);
- }
-
- return;
-}
-
-void __assert (const char *file, int line, const char *msg)
-{
- static char exit_msg[] = "EXECUTIVE SHUTDOWN! Any key to reboot...";
- unsigned char ch;
-
- /*
- * Note we cannot call exit or printf from here,
- * assert can fail inside ISR too
- */
-
- /*
- * Close console
- */
- __rtems_close(2);
- __rtems_close(1);
- __rtems_close(0);
-
- printk("\nassert failed: %s: ", file);
- printk("%d: ", line);
- printk("%s\n\n", msg);
- printk(exit_msg);
- ch = BSP_poll_char();
- printk("\n\n");
- rtemsReboot();
-
-}
-
-
-/*-------------------------------------------------------------------------+
-| Console device driver INITIALIZE entry point.
-+--------------------------------------------------------------------------+
-| Initilizes the I/O console (keyboard + VGA display) driver.
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_initialize(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- rtems_status_code status;
-
- /*
- * The video was initialized in the start.s code and does not need
- * to be reinitialized.
- */
-
-
- if(BSPConsolePort == BSP_CONSOLE_PORT_CONSOLE)
- {
- /* Install keyboard interrupt handler */
- status = BSP_install_rtems_irq_handler(&console_isr_data);
-
- if (!status)
- {
- printk("Error installing keyboard interrupt handler!\n");
- rtems_fatal_error_occurred(status);
- }
-
- status = rtems_io_register_name("/dev/console", major, 0);
- if (status != RTEMS_SUCCESSFUL)
- {
- printk("Error registering console device!\n");
- rtems_fatal_error_occurred(status);
- }
- printk("Initialized console on port CONSOLE\n\n");
- }
- else
- {
- /*
- * Set up TERMIOS
- */
- rtems_termios_initialize ();
-
- /*
- * Do device-specific initialization
- */
-
- /* 9600-8-N-1 */
- BSP_uart_init(BSPConsolePort, 9600, 0);
-
-
- /* Set interrupt handler */
- if(BSPConsolePort == BSP_UART_COM1)
- {
- console_isr_data.name = BSP_UART_COM1_IRQ;
- console_isr_data.hdl = BSP_uart_termios_isr_com1;
-
- }
- else
- {
- assert(BSPConsolePort == BSP_UART_COM2);
- console_isr_data.name = BSP_UART_COM2_IRQ;
- console_isr_data.hdl = BSP_uart_termios_isr_com2;
- }
-
- status = BSP_install_rtems_irq_handler(&console_isr_data);
-
- if (!status){
- printk("Error installing serial console interrupt handler!\n");
- rtems_fatal_error_occurred(status);
- }
- /*
- * Register the device
- */
- status = rtems_io_register_name ("/dev/console", major, 0);
- if (status != RTEMS_SUCCESSFUL)
- {
- printk("Error registering console device!\n");
- rtems_fatal_error_occurred (status);
- }
-
- if(BSPConsolePort == BSP_UART_COM1)
- {
- printk("Initialized console on port COM1 9600-8-N-1\n\n");
- }
- else
- {
- printk("Initialized console on port COM2 9600-8-N-1\n\n");
- }
-#define PRINTK_ON_SERIAL
-#ifdef PRINTK_ON_SERIAL
- /*
- * You can remove the follwoing tree lines if you want to have printk
- * using the video console for output while printf use serial line.
- * This may be convenient to debug the serial line driver itself...
- */
- /* printk("Warning : This will be the last message displayed on console\n");*/
- BSP_output_char = (BSP_output_char_function_type) BSP_output_char_via_serial;
- BSP_poll_char = (BSP_polling_getchar_function_type) BSP_poll_char_via_serial;
-#endif
- }
- return RTEMS_SUCCESSFUL;
-} /* console_initialize */
-
-
-static int console_open_count = 0;
-
-static int console_last_close(int major, int minor, void *arg)
-{
- BSP_remove_rtems_irq_handler (&console_isr_data);
-
- return 0;
-}
-
-/*-------------------------------------------------------------------------+
-| Console device driver OPEN entry point
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_open(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- rtems_status_code status;
- static rtems_termios_callbacks cb =
- {
- NULL, /* firstOpen */
- console_last_close, /* lastClose */
- NULL, /* pollRead */
- BSP_uart_termios_write_com1, /* write */
- conSetAttr, /* setAttributes */
- NULL, /* stopRemoteTx */
- NULL, /* startRemoteTx */
- 1 /* outputUsesInterrupts */
- };
-
- if(BSPConsolePort == BSP_CONSOLE_PORT_CONSOLE)
- {
- ++console_open_count;
- return RTEMS_SUCCESSFUL;
- }
-
- if(BSPConsolePort == BSP_UART_COM2)
- {
- cb.write = BSP_uart_termios_write_com2;
- }
-
- status = rtems_termios_open (major, minor, arg, &cb);
-
- if(status != RTEMS_SUCCESSFUL)
- {
- printk("Error openning console device\n");
- return status;
- }
-
- /*
- * Pass data area info down to driver
- */
- BSP_uart_termios_set(BSPConsolePort,
- ((rtems_libio_open_close_args_t *)arg)->iop->data1);
-
- /* Enable interrupts on channel */
- BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*-------------------------------------------------------------------------+
-| Console device driver CLOSE entry point
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_close(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- rtems_device_driver res = RTEMS_SUCCESSFUL;
-
- if(BSPConsolePort != BSP_CONSOLE_PORT_CONSOLE)
- {
- res = rtems_termios_close (arg);
- }
- else {
- if (--console_open_count == 0) {
- console_last_close(major, minor, arg);
- }
- }
-
- return res;
-} /* console_close */
-
-
-/*-------------------------------------------------------------------------+
-| Console device driver READ entry point.
-+--------------------------------------------------------------------------+
-| Read characters from the I/O console. We only have stdin.
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_read(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *)arg;
- char *buffer = rw_args->buffer;
- int count, maximum = rw_args->count;
-
- if(BSPConsolePort != BSP_CONSOLE_PORT_CONSOLE)
- {
- return rtems_termios_read (arg);
- }
-
- for (count = 0; count < maximum; count++)
- {
- /* Get character */
- buffer[count] = _IBMPC_inch_sleep();
-
- /* Echo character to screen */
- _IBMPC_outch(buffer[count]);
- if (buffer[count] == '\r')
- {
- _IBMPC_outch('\n'); /* CR = CR + LF */
- }
-
- if (buffer[count] == '\n' || buffer[count] == '\r')
- {
- /* What if this goes past the end of the buffer? We're hosed. [bhc] */
- buffer[count++] = '\n';
- buffer[count] = '\0';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return ((count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED);
-} /* console_read */
-
-
-/*-------------------------------------------------------------------------+
-| Console device driver WRITE entry point.
-+--------------------------------------------------------------------------+
-| Write characters to the I/O console. Stderr and stdout are the same.
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_write(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg)
-{
- rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *)arg;
- char *buffer = rw_args->buffer;
- int count, maximum = rw_args->count;
-
- if(BSPConsolePort != BSP_CONSOLE_PORT_CONSOLE)
- {
- return rtems_termios_write (arg);
- }
-
- for (count = 0; count < maximum; count++)
- {
- _IBMPC_outch(buffer[count]);
- if (buffer[count] == '\n')
- _IBMPC_outch('\r'); /* LF = LF + CR */
- }
-
- rw_args->bytes_moved = maximum;
- return RTEMS_SUCCESSFUL;
-} /* console_write */
-
-
-
-/*
- * Handle ioctl request.
- */
-rtems_device_driver
-console_control(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- if(BSPConsolePort != BSP_CONSOLE_PORT_CONSOLE)
- {
- return rtems_termios_ioctl (arg);
- }
-
- return RTEMS_SUCCESSFUL;
-}
-
-static int
-conSetAttr(int minor, const struct termios *t)
-{
- int baud;
-
- switch (t->c_cflag & CBAUD)
- {
- case B50:
- baud = 50;
- break;
- case B75:
- baud = 75;
- break;
- case B110:
- baud = 110;
- break;
- case B134:
- baud = 134;
- break;
- case B150:
- baud = 150;
- break;
- case B200:
- baud = 200;
- break;
- case B300:
- baud = 300;
- break;
- case B600:
- baud = 600;
- break;
- case B1200:
- baud = 1200;
- break;
- case B1800:
- baud = 1800;
- break;
- case B2400:
- baud = 2400;
- break;
- case B4800:
- baud = 4800;
- break;
- case B9600:
- baud = 9600;
- break;
- case B19200:
- baud = 19200;
- break;
- case B38400:
- baud = 38400;
- break;
- case B57600:
- baud = 57600;
- break;
- case B115200:
- baud = 115200;
- break;
- default:
- baud = 0;
- rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR);
- return 0;
- }
-
- BSP_uart_set_baud(BSPConsolePort, baud);
-
- return 0;
-}
-
-/*
- * BSP initialization
- */
-
-BSP_output_char_function_type BSP_output_char =
- (BSP_output_char_function_type) _IBMPC_outch;
-
-BSP_polling_getchar_function_type BSP_poll_char = BSP_wait_polled_input;
-
-
diff --git a/c/src/lib/libbsp/i386/pc386/console/inch.c b/c/src/lib/libbsp/i386/pc386/console/inch.c
deleted file mode 100644
index 6783e79ba0..0000000000
--- a/c/src/lib/libbsp/i386/pc386/console/inch.c
+++ /dev/null
@@ -1,333 +0,0 @@
-/*-------------------------------------------------------------------------+
-| inch.c v1.1 - PC386 BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is based on:
-| inch.c,v 1.3 1995/12/19 20:07:25 joel Exp - go32 BSP
-| With the following copyright notice:
-| With the following copyright notice:
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1998.
-| * On-Line Applications Research Corporation (OAR).
-| * Copyright assigned to U.S. Government, 1994.
-| *
-| * The license and distribution terms for this file may be
-| * found in found in the file LICENSE in this distribution or at
-| * http://www.OARcorp.com/rtems/license.html.
-| **************************************************************************
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-#include <bsp.h>
-#include <irq.h>
-
-/*-------------------------------------------------------------------------+
-| Constants
-+--------------------------------------------------------------------------*/
-#define KBD_CTL 0x61 /* -------------------------------- */
-#define KBD_DATA 0x60 /* Ports for PC keyboard controller */
-#define KBD_STATUS 0x64 /* -------------------------------- */
-
-#define KBD_BUF_SIZE 256
-
-/*-------------------------------------------------------------------------+
-| Global Variables
-+--------------------------------------------------------------------------*/
-static char key_map[] =
-{
- 0,033,'1','2','3','4','5','6','7','8','9','0','-','=','\b','\t',
- 'q','w','e','r','t','y','u','i','o','p','[',']',015,0x80,
- 'a','s','d','f','g','h','j','k','l',';',047,0140,0x80,
- 0134,'z','x','c','v','b','n','m',',','.','/',0x80,
- '*',0x80,' ',0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
- 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
- 0x80,0x80,0x80,'0',0177
-}; /* Keyboard scancode -> character map with no modifiers. */
-
-static char shift_map[] =
-{
- 0,033,'!','@','#','$','%','^','&','*','(',')','_','+','\b','\t',
- 'Q','W','E','R','T','Y','U','I','O','P','{','}',015,0x80,
- 'A','S','D','F','G','H','J','K','L',':',042,'~',0x80,
- '|','Z','X','C','V','B','N','M','<','>','?',0x80,
- '*',0x80,' ',0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
- 0x80,0x80,0x80,0x80,'7','8','9',0x80,'4','5','6',0x80,
- '1','2','3','0',177
-}; /* Keyboard scancode -> character map with SHIFT key modifier. */
-
-static char kbd_buffer[KBD_BUF_SIZE];
-static rtems_unsigned16 kbd_first = 0;
-static rtems_unsigned16 kbd_last = 0;
-static rtems_unsigned16 kbd_end = KBD_BUF_SIZE - 1;
-
-/*-------------------------------------------------------------------------+
-| Function: rtemsReboot
-| Description: Reboot the PC.
-| Global Variables: None.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void rtemsReboot(void)
-{
- /* shutdown and reboot */
- outport_byte(0x64, 0xFE); /* use keyboard controler to do the job... */
-} /* rtemsReboot */
-
-/*-------------------------------------------------------------------------+
-| Function: _IBMPC_scankey
-| Description: This function can be called during a poll for input, or by
-| an ISR. Basically any time you want to process a keypress.
-| Global Variables: key_map, shift_map.
-| Arguments: outChar - character read in case of a valid reading,
-| otherwise unchanged.
-| Returns: TRUE in case a valid character has been read,
-| FALSE otherwise.
-+--------------------------------------------------------------------------*/
-rtems_boolean
-_IBMPC_scankey(char *outChar)
-{
- unsigned char inChar;
- static int alt_pressed = 0;
- static int ctrl_pressed = 0;
- static int shift_pressed = 0;
- static int caps_pressed = 0;
- static int extended = 0;
-
- *outChar = NULL; /* default value if we return FALSE */
-
- /* Read keyboard controller, toggle enable */
- inport_byte(KBD_CTL, inChar);
- outport_byte(KBD_CTL, inChar & ~0x80);
- outport_byte(KBD_CTL, inChar | 0x80);
- outport_byte(KBD_CTL, inChar & ~0x80);
-
- /* See if it has data */
- inport_byte(KBD_STATUS, inChar);
- if ((inChar & 0x01) == 0)
- return FALSE;
-
- /* Read the data. Handle nonsense with shift, control, etc. */
- inport_byte(KBD_DATA, inChar);
-
- if (extended)
- extended--;
-
- switch (inChar)
- {
- case 0xe0:
- extended = 2;
- return FALSE;
- break;
-
- case 0x38:
- alt_pressed = 1;
- return FALSE;
- break;
- case 0xb8:
- alt_pressed = 0;
- return FALSE;
- break;
-
- case 0x1d:
- ctrl_pressed = 1;
- return FALSE;
- break;
- case 0x9d:
- ctrl_pressed = 0;
- return FALSE;
- break;
-
- case 0x2a:
- if (extended)
- return FALSE;
- case 0x36:
- shift_pressed = 1;
- return FALSE;
- break;
- case 0xaa:
- if (extended)
- return FALSE;
- case 0xb6:
- shift_pressed = 0;
- return FALSE;
- break;
-
- case 0x3a:
- caps_pressed = 1;
- return FALSE;
- break;
- case 0xba:
- caps_pressed = 0;
- return FALSE;
- break;
-
- case 0x53:
- if (ctrl_pressed && alt_pressed)
- rtemsReboot(); /* ctrl+alt+del -> reboot */
- break;
-
- /*
- * Ignore unrecognized keys--usually arrow and such
- */
- default:
- if ((inChar & 0x80) || (inChar > 0x39))
- /* High-bit on means key is being released, not pressed */
- return FALSE;
- break;
- } /* switch */
-
- /* Strip high bit, look up in our map */
- inChar &= 0x7f;
- if (ctrl_pressed)
- {
- *outChar = key_map[inChar];
- *outChar &= 037;
- }
- else
- {
- *outChar = shift_pressed ? shift_map[inChar] : key_map[inChar];
- if (caps_pressed)
- {
- if (*outChar >= 'A' && *outChar <= 'Z')
- *outChar += 'a' - 'A';
- else if (*outChar >= 'a' && *outChar <= 'z')
- *outChar -= 'a' - 'A';
- }
- }
-
- return TRUE;
-} /* _IBMPC_scankey */
-
-/*-------------------------------------------------------------------------+
-| Function: _IBMPC_keyboard_isr
-| Description: Interrupt Service Routine for keyboard (0x01) IRQ.
-| Global Variables: kbd_buffer, kbd_first, kbd_last.
-| Arguments: vector - standard RTEMS argument - see documentation.
-| Returns: standard return value - see documentation.
-+--------------------------------------------------------------------------*/
-void _IBMPC_keyboard_isr()
-{
- if (_IBMPC_scankey(&kbd_buffer[kbd_last]))
- {
- /* Got one; save it if there is enough room in buffer. */
- unsigned int next = (kbd_last == kbd_end) ? 0 : kbd_last + 1;
-
- if (next != kbd_first)
- {
- kbd_last = next;
- }
- }
-} /* _IBMPC_keyboard_isr */
-
-
-/*-------------------------------------------------------------------------+
-| Function: _IBMPC_chrdy
-| Description: Check keyboard ISR buffer and return character if not empty.
-| Global Variables: kbd_buffer, kbd_first, kbd_last.
-| Arguments: c - character read if keyboard buffer not empty, otherwise
-| unchanged.
-| Returns: TRUE if keyboard buffer not empty, FALSE otherwise.
-+--------------------------------------------------------------------------*/
-rtems_boolean
-_IBMPC_chrdy(char *c)
-{
- /* FIX ME!!! It doesn't work without something like the following line.
- Find out why! */
- printk("");
-
- /* Check buffer our ISR builds */
- if (kbd_first != kbd_last)
- {
- *c = kbd_buffer[kbd_first];
-
- kbd_first = (kbd_first + 1) % KBD_BUF_SIZE;
- return TRUE;
- }
- else
- return FALSE;
-} /* _IBMPC_chrdy */
-
-
-/*-------------------------------------------------------------------------+
-| Function: _IBMPC_inch
-| Description: Poll keyboard until a character is ready and return it.
-| Global Variables: None.
-| Arguments: None.
-| Returns: character read from keyboard.
-+--------------------------------------------------------------------------*/
-char
-_IBMPC_inch(void)
-{
- char c;
- while (!_IBMPC_chrdy(&c))
- continue;
-
- return c;
-} /* _IBMPC_inch */
-
-
- /*
- * Routine that can be used before interrupt management is initialized.
- */
-
-char
-BSP_wait_polled_input(void)
-{
- char c;
- while (!_IBMPC_scankey(&c))
- continue;
-
- return c;
-}
-
-/*-------------------------------------------------------------------------+
-| Function: _IBMPC_inch_sleep
-| Description: If charcter is ready return it, otherwise sleep until
-| it is ready
-| Global Variables: None.
-| Arguments: None.
-| Returns: character read from keyboard.
-+--------------------------------------------------------------------------*/
-char
-_IBMPC_inch_sleep(void)
-{
- char c;
- rtems_interval ticks_per_second;
-
- ticks_per_second = 0;
-
- for(;;)
- {
- if(_IBMPC_chrdy(&c))
- {
- return c;
- }
-
- if(ticks_per_second == 0)
- {
- rtems_clock_get(RTEMS_CLOCK_GET_TICKS_PER_SECOND,
- &ticks_per_second);
- }
- rtems_task_wake_after((ticks_per_second+24)/25);
- }
-
- return c;
-} /* _IBMPC_inch */
-
-
-
-
-
-
diff --git a/c/src/lib/libbsp/i386/pc386/console/outch.c b/c/src/lib/libbsp/i386/pc386/console/outch.c
deleted file mode 100644
index 1d5c1f9c38..0000000000
--- a/c/src/lib/libbsp/i386/pc386/console/outch.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * outch.c - This file contains code for displaying characters
- * on the console uisng information that should be
- * maintained by the BIOS in its data Area.
- *
- * Copyright (C) 1998 Eric Valette (valette@crf.canon.fr)
- * Canon Centre Recherche France.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <bsp.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <crt.h>
-
-extern void wr_cursor(int, unsigned short);
-
-#define TAB_SPACE 4
-static unsigned short *bitMapBaseAddr;
-static unsigned short ioCrtBaseAddr;
-static unsigned short maxCol;
-static unsigned short maxRow;
-static unsigned char row;
-static unsigned char column;
-static unsigned short attribute;
-static unsigned int nLines;
-
-static void
-scroll(void)
-{
- int i, j; /* Counters */
- unsigned short *pt_scroll, *pt_bitmap; /* Pointers on the bit-map */
-
- pt_bitmap = bitMapBaseAddr;
- j = 0;
- pt_bitmap = pt_bitmap + j;
- pt_scroll = pt_bitmap + maxCol;
- for (i = j; i < (maxRow - 1) * maxCol; i++) {
- *pt_bitmap++ = *pt_scroll++;
- }
-
- /*
- * Blank characters are displayed on the last line.
- */
- for (i = 0; i < maxCol; i++) {
- *pt_bitmap++ = (short) (' ' | attribute);
- }
-}
-
-static void
-endColumn(void)
-{
- if (++row == maxRow) {
- scroll(); /* Scroll the screen now */
- row = maxRow - 1;
- }
- column = 0;
- nLines++;
- /* Move cursor on the next location */
- wr_cursor(row * maxCol + column, ioCrtBaseAddr);
-}
-
-
-
-static void
-videoPutChar(char car)
-{
- unsigned short *pt_bitmap = bitMapBaseAddr + row * maxCol;
-
- switch (car) {
- case '\b': {
- if (column) column--;
- /* Move cursor on the previous location */
- wr_cursor(row * maxCol + column, ioCrtBaseAddr);
- return;
- }
- case '\t': {
- int i;
-
- i = TAB_SPACE - (column & (TAB_SPACE - 1));
- pt_bitmap += column;
- column += i;
- if (column >= maxCol) {
- endColumn();
- return;
- }
- while (i--) *pt_bitmap++ = ' ' | attribute;
- wr_cursor(row * maxCol + column, ioCrtBaseAddr);
- return;
- }
- case '\n': {
- endColumn();
- return;
- }
- case 7: { /* Bell code must be inserted here */
- return;
- }
- case '\r' : { /* Already handled via \n */
- return;
- }
- default: {
- pt_bitmap += column;
- *pt_bitmap = car | attribute;
- if (++column == maxCol) endColumn();
- else wr_cursor(row * maxCol + column,
- ioCrtBaseAddr);
- return;
- }
- }
-}
-
-void
-clear_screen(void)
-{
- int i,j;
-
- for (j = 0; j <= maxRow; j++) {
- for (i = 0; i <= maxCol; i++) {
- videoPutChar(' ');
- }
- }
- column = 0;
- row = 0;
-}
-
-/*-------------------------------------------------------------------------+
-| Function: _IBMPC_outch
-| Description: Higher level (console) interface to consPutc.
-| Global Variables: None.
-| Arguments: c - character to write to console.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void
-_IBMPC_outch(char c)
-{
- videoPutChar(c);
-} /* _IBMPC_outch */
-
-
-/*-------------------------------------------------------------------------+
-| Function: _IBMPC_initVideo
-| Description: Video system initialization. Hook for any early setup.
-| Global Variables: bitMapBaseAddr, ioCrtBaseAddr, maxCol, maxRow, row
-| column, attribute, nLines;
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void
-_IBMPC_initVideo(void)
-{
- unsigned char* pt = (unsigned char*) (VIDEO_MODE_ADDR);
-
- if (*pt == VGAMODE7) {
- bitMapBaseAddr = (unsigned short*) V_MONO;
- }
- else {
- bitMapBaseAddr = (unsigned short*) V_COLOR;
- }
- ioCrtBaseAddr = *(unsigned short*) DISPLAY_CRT_BASE_IO_ADDR;
- maxCol = * (unsigned short*) NB_MAX_COL_ADDR;
- maxRow = * (unsigned char*) NB_MAX_ROW_ADDR;
- column = 0;
- row = 0;
- attribute = ((BLACK << 4) | WHITE)<<8;
- nLines = 0;
- clear_screen();
-#ifdef DEBUG_EARLY_STAGE
- printk("bitMapBaseAddr = %X, display controller base IO = %X\n",
- (unsigned) bitMapBaseAddr,
- (unsigned) ioCrtBaseAddr);
- videoPrintf("maxCol = %d, maxRow = %d\n", (unsigned) maxCol, (unsigned) maxRow);
-#endif
-} /* _IBMPC_initVideo */
diff --git a/c/src/lib/libbsp/i386/pc386/console/videoAsm.s b/c/src/lib/libbsp/i386/pc386/console/videoAsm.s
deleted file mode 100644
index a8f5cb3156..0000000000
--- a/c/src/lib/libbsp/i386/pc386/console/videoAsm.s
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * videoAsm.S - This file contains code for displaying cursor on the console
- *
- * Copyright (C) 1998 valette@crf.canon.fr
- *
- * This code is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This code 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. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Id$
- */
-
- .file "videoAsm.s"
-
-#include <crt.h>
-
- .text
- .align 4
- .globl wr_cursor /* Move cursor position */
-
-/*
- * void wr_cursor(newPosition, ioBaseAddr)
- */
-
-wr_cursor: pushl %ecx
- movl 8(%esp), %ecx /* Get new cursor position */
- movb $CC_CURSHIGH, %al /* Cursor high location */
- movl 12(%esp), %edx /* Get IO base address */
- outb (%dx)
- incw %dx /* Program Data register */
- movb %ch, %al
- outb (%dx) /* Update high location cursor */
- decw %dx /* Program Index Register */
- movb $CC_CURSLOW, %al /* Cursor low location */
- outb (%dx)
- incw %dx /* Program Data Register */
- movb %cl, %al
- outb (%dx) /* Update low location cursor */
- popl %ecx
- ret
-
diff --git a/c/src/lib/libbsp/i386/pc386/include/Makefile.in b/c/src/lib/libbsp/i386/pc386/include/Makefile.in
deleted file mode 100644
index d5864f9419..0000000000
--- a/c/src/lib/libbsp/i386/pc386/include/Makefile.in
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# This driver needs to be reworked for the BSD stack.
-# We only install wd80x3.h if HAS_NETWORKING was defined
-WD80X3_yes_V = $(srcdir)/wd80x3.h
-WD80X3 = $(WD80X3_$(HAS_NETWORKING)_V)
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h $(srcdir)/crt.h \
- $(WD80X3)
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/i386/pc386/include/bsp.h b/c/src/lib/libbsp/i386/pc386/include/bsp.h
deleted file mode 100644
index fde80f9711..0000000000
--- a/c/src/lib/libbsp/i386/pc386/include/bsp.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/*-------------------------------------------------------------------------+
-| bsp.h v1.1 - PC386 BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| This include file contains definitions related to the PC386 BSP.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Modified by Eric Valette the 20/05/98 in order to add definitions used
-| to enhance video putchar capabilities.
-|
-| Copyright (C) 1998 valette@crf.canon.fr
-|
-| Canon Centre Recherche France.
-|
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is based on:
-| bsp.h,v 1.5 1995/12/19 20:07:30 joel Exp - go32 BSP
-| With the following copyright notice:
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1998.
-| * On-Line Applications Research Corporation (OAR).
-| * Copyright assigned to U.S. Government, 1994.
-| *
-| * The license and distribution terms for this file may be
-| * found in found in the file LICENSE in this distribution or at
-| * http://www.OARcorp.com/rtems/license.html.
-| **************************************************************************
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-
-#ifndef __BSP_H_
-#define __BSP_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <iosupp.h>
-#include <console.h>
-#include <clockdrv.h>
-#include <libcpu/cpu.h>
-#include <bspIo.h>
-
-/*
- * Network driver configuration
- */
-
-struct rtems_bsdnet_ifconfig;
-extern int rtems_wd_driver_attach (struct rtems_bsdnet_ifconfig *config);
-
-#define RTEMS_BSP_NETWORK_DRIVER_NAME "wd1"
-#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_wd_driver_attach
-
-/*-------------------------------------------------------------------------+
-| Constants
-+--------------------------------------------------------------------------*/
-#define BSP_LIBIO_MAX_FDS 20 /* Number of libio files we want. */
-
-/*-------------------------------------------------------------------------+
-| Video (console) related constants.
-+--------------------------------------------------------------------------*/
-
-#include <crt.h>
-
-/*-------------------------------------------------------------------------+
-| Constants relating to the 8254 (or 8253) programmable interval timers.
-+--------------------------------------------------------------------------*/
-#define IO_TIMER1 0x40
- /* Port address of the control port and timer channels */
-#define TIMER_CNTR0 (IO_TIMER1 + 0) /* timer 0 counter port */
-#define TIMER_CNTR1 (IO_TIMER1 + 1) /* timer 1 counter port */
-#define TIMER_CNTR2 (IO_TIMER1 + 2) /* timer 2 counter port */
-#define TIMER_MODE (IO_TIMER1 + 3) /* timer mode port */
-#define TIMER_SEL0 0x00 /* select counter 0 */
-#define TIMER_SEL1 0x40 /* select counter 1 */
-#define TIMER_SEL2 0x80 /* select counter 2 */
-#define TIMER_INTTC 0x00 /* mode 0, intr on terminal cnt */
-#define TIMER_ONESHOT 0x02 /* mode 1, one shot */
-#define TIMER_RATEGEN 0x04 /* mode 2, rate generator */
-#define TIMER_SQWAVE 0x06 /* mode 3, square wave */
-#define TIMER_SWSTROBE 0x08 /* mode 4, s/w triggered strobe */
-#define TIMER_HWSTROBE 0x0a /* mode 5, h/w triggered strobe */
-#define TIMER_LATCH 0x00 /* latch counter for reading */
-#define TIMER_LSB 0x10 /* r/w counter LSB */
-#define TIMER_MSB 0x20 /* r/w counter MSB */
-#define TIMER_16BIT 0x30 /* r/w counter 16 bits, LSB first */
-#define TIMER_BCD 0x01 /* count in BCD */
-
-#define TIMER_TICK 1193182 /* The internal tick rate in ticks per second */
-
-/*-------------------------------------------------------------------------+
-| Define the time limits for RTEMS Test Suite test durations. Long test and
-| short test duration limits are provided. These values are in seconds and
-| need to be converted to ticks for the application.
-+--------------------------------------------------------------------------*/
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*-------------------------------------------------------------------------+
-| Macros
-+--------------------------------------------------------------------------*/
-/*-------------------------------------------------------------------------+
-| Define the interrupt mechanism for Time Test 27.
-| NOTE: Use a software interrupt for the i386 family.
-+--------------------------------------------------------------------------*/
-#define MUST_WAIT_FOR_INTERRUPT 0
-#define Install_tm27_vector(handler) \
-{ \
- rtems_isr_entry dummy; \
- rtems_interrupt_catch(handler, 0x90, &dummy); \
-}
-#define Cause_tm27_intr() asm volatile("int $0x90" : :);
-#define Clear_tm27_intr()
-#define Lower_tm27_intr()
-
-/*-------------------------------------------------------------------------+
-| Simple spin delay in microsecond units for device drivers.
-| This is very dependent on the clock speed of the target.
-+--------------------------------------------------------------------------*/
-#define delay(_microseconds) \
-{ \
- rtems_unsigned32 _cnt = _microseconds; \
- asm volatile ("0: nop; mov %0,%0; loop 0b" : "=c"(_cnt) : "0"(_cnt)); \
-}
-
-/*-------------------------------------------------------------------------+
-| Convert microseconds to ticks and ticks to microseconds.
-+--------------------------------------------------------------------------*/
-#define US_TO_TICK(us) (((us)*105+44)/88)
-#define TICK_TO_US(tk) (((tk)*88+52)/105)
-
-/*-------------------------------------------------------------------------+
-| External Variables.
-+--------------------------------------------------------------------------*/
-#define IDT_SIZE 256
-#define GDT_SIZE 3
-
-extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE];
-extern segment_descriptors Global_descriptor_table [GDT_SIZE];
-
-extern rtems_configuration_table BSP_Configuration;
- /* User provided BSP configuration table. */
-extern rtems_unsigned32 rtemsFreeMemStart;
- /* Address of start of free memory - should be used when creating new
- partitions or regions and updated afterwards. */
-
-/*-------------------------------------------------------------------------+
-| Function Prototypes.
-+--------------------------------------------------------------------------*/
-void _IBMPC_initVideo(void); /* from 'outch.c' */
-void _IBMPC_outch (char); /* from 'outch.c' */
-rtems_boolean _IBMPC_chrdy (char *); /* from 'inch.c' */
-char _IBMPC_inch (void); /* from 'inch.c' */
-char _IBMPC_inch_sleep (void); /* from 'inch.c' */
-
-void printk(char *fmt, ...); /* from 'printk.c' */
-
-void rtemsReboot(void); /* from 'exit.c' */
-
-/* Definitions for BSPConsolePort */
-#define BSP_CONSOLE_PORT_CONSOLE (-1)
-#define BSP_CONSOLE_PORT_COM1 (BSP_UART_COM1)
-#define BSP_CONSOLE_PORT_COM2 (BSP_UART_COM2)
-
-/* GDB stub stuff */
-void i386_stub_glue_init(int uart);
-void i386_stub_glue_init_breakin(void);
-void set_debug_traps(void);
-void breakpoint(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __BSP_H_ */
-/* end of include file */
-
-
-
-
-
-
diff --git a/c/src/lib/libbsp/i386/pc386/include/coverhd.h b/c/src/lib/libbsp/i386/pc386/include/coverhd.h
deleted file mode 100644
index e4e5514c3e..0000000000
--- a/c/src/lib/libbsp/i386/pc386/include/coverhd.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C on this target.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#ifndef __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
-#define CALLING_OVERHEAD_TASK_CREATE 0
-#define CALLING_OVERHEAD_TASK_IDENT 0
-#define CALLING_OVERHEAD_TASK_START 0
-#define CALLING_OVERHEAD_TASK_RESTART 0
-#define CALLING_OVERHEAD_TASK_DELETE 0
-#define CALLING_OVERHEAD_TASK_SUSPEND 0
-#define CALLING_OVERHEAD_TASK_RESUME 0
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
-#define CALLING_OVERHEAD_TASK_MODE 0
-#define CALLING_OVERHEAD_TASK_GET_NOTE 0
-#define CALLING_OVERHEAD_TASK_SET_NOTE 0
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 0
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
-#define CALLING_OVERHEAD_CLOCK_GET 0
-#define CALLING_OVERHEAD_CLOCK_SET 0
-#define CALLING_OVERHEAD_CLOCK_TICK 0
-
-#define CALLING_OVERHEAD_TIMER_CREATE 0
-#define CALLING_OVERHEAD_TIMER_IDENT 0
-#define CALLING_OVERHEAD_TIMER_DELETE 0
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 0
-#define CALLING_OVERHEAD_TIMER_RESET 0
-#define CALLING_OVERHEAD_TIMER_CANCEL 0
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
-
-#define CALLING_OVERHEAD_EVENT_SEND 0
-#define CALLING_OVERHEAD_EVENT_RECEIVE 0
-#define CALLING_OVERHEAD_SIGNAL_CATCH 0
-#define CALLING_OVERHEAD_SIGNAL_SEND 0
-#define CALLING_OVERHEAD_PARTITION_CREATE 0
-#define CALLING_OVERHEAD_PARTITION_IDENT 0
-#define CALLING_OVERHEAD_PARTITION_DELETE 0
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
-#define CALLING_OVERHEAD_REGION_CREATE 0
-#define CALLING_OVERHEAD_REGION_IDENT 0
-#define CALLING_OVERHEAD_REGION_DELETE 0
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
-#define CALLING_OVERHEAD_PORT_CREATE 0
-#define CALLING_OVERHEAD_PORT_IDENT 0
-#define CALLING_OVERHEAD_PORT_DELETE 0
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 0
-#define CALLING_OVERHEAD_IO_OPEN 0
-#define CALLING_OVERHEAD_IO_CLOSE 0
-#define CALLING_OVERHEAD_IO_READ 0
-#define CALLING_OVERHEAD_IO_WRITE 0
-#define CALLING_OVERHEAD_IO_CONTROL 0
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/i386/pc386/include/crt.h b/c/src/lib/libbsp/i386/pc386/include/crt.h
deleted file mode 100644
index b0cf87fc06..0000000000
--- a/c/src/lib/libbsp/i386/pc386/include/crt.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * crt.h - This file contains definitions for constants related to PC console.
- * More information can be found at
- * <http://millenium.atcg.com/~taco/helppc/tables.html>
- *
- * Copyright (C) 1998 Eric Valette (valette@crf.canon.fr)
- * Canon Centre Recherche France.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#ifndef _CRT_H
-#define _CRT_H
-
-/*
- * Bitmap video origins in text mode.
- */
-
- /* In monochrome */
-#define V_MONO 0xb0000
- /* In color */
-#define V_COLOR 0xb8000
-
-
-/*
- * Video Option Byte location. It must be maintained
- * by the BIOS.
- */
-#define VIDEO_MODE_ADDR 0x449
-/*
- * Video controller base IO address location in
- * BIOS data area
- */
-#define DISPLAY_CRT_BASE_IO_ADDR 0x463
-/*
- * Number of collums and lines locations for the
- * actual video Configuration
- */
-#define NB_MAX_COL_ADDR 0x44a
-#define NB_MAX_ROW_ADDR 0x484
-
- /*
- * Miscellaneous information set by the BIOS in offset video_mode,
- */
-
-# define VGAMODE7 0x7 /* VGA mode 7 */
-
- /* Color codes in text mode for background and foreground. */
-#define BLACK 0x0
-#define BLUE 0x1
-#define GREEN 0x2
-#define CYAN 0x3
-#define RED 0x4
-#define MAGENTA 0x5
-#define BROWN 0x6
-#define WHITE 0x7
-
-#define GRAY 0x8
-#define LT_BLUE 0x9
-#define LT_GREEN 0xa
-#define LT_CYAN 0xb
-#define LT_RED 0xc
-#define LT_MAGENTA 0xd
-#define YELLOW 0xe
-#define LT_WHITE 0xf
-
-#define BLINK 0x8 /* Mask used to determine blinking */
-#define OFF 0
-#define ON 1
-
-
-/*
- * CRT Controller register offset definitions
- */
-
-# define CC_CURSSTART 0x0a /* Cursor start scan line */
-# define CC_CURSEND 0x0b /* Cursor end scan line */
-# define CC_STARTADDRHI 0x0c /* start video ram addr msb */
-# define CC_STARTADDRLO 0x0d /* start video ram lsb */
-# define CC_CURSHIGH 0x0e /* Cursor high location (8 msb) */
-# define CC_CURSLOW 0x0f /* Cursor low location (8 msb) */
-# define CC_VRETSTART 0x10 /* vertical synchro start lsb */
-# define CC_VRETEND 0x11 /* vertical syn end (also it control) */
-# define CC_VDISPEND 0x12 /* vertical display end lsb register */
-
-#endif /* _CRT_H */
diff --git a/c/src/lib/libbsp/i386/pc386/include/wd80x3.h b/c/src/lib/libbsp/i386/pc386/include/wd80x3.h
deleted file mode 100644
index 4bad00993c..0000000000
--- a/c/src/lib/libbsp/i386/pc386/include/wd80x3.h
+++ /dev/null
@@ -1,123 +0,0 @@
-
-/* Register descriptions */
-/* Controller DP8390. */
-
-#define DATAPORT 0x10 /* Port Window. */
-#define RESET 0x1f /* Issue a read for reset */
-#define W83CREG 0x00 /* I/O port definition */
-#define ADDROM 0x08
-
-/* page 0 read or read/write registers */
-
-#define CMDR 0x00+RO
-#define CLDA0 0x01+RO /* current local dma addr 0 for read */
-#define CLDA1 0x02+RO /* current local dma addr 1 for read */
-#define BNRY 0x03+RO /* boundary reg for rd and wr */
-#define TSR 0x04+RO /* tx status reg for rd */
-#define NCR 0x05+RO /* number of collision reg for rd */
-#define FIFO 0x06+RO /* FIFO for rd */
-#define ISR 0x07+RO /* interrupt status reg for rd and wr */
-#define CRDA0 0x08+RO /* current remote dma address 0 for rd */
-#define CRDA1 0x09+RO /* current remote dma address 1 for rd */
-#define RSR 0x0C+RO /* rx status reg for rd */
-#define CNTR0 0x0D+RO /* tally cnt 0 for frm alg err for rd */
-#define CNTR1 RO+0x0E /* tally cnt 1 for crc err for rd */
-#define CNTR2 0x0F+RO /* tally cnt 2 for missed pkt for rd */
-
-/* page 0 write registers */
-
-#define PSTART 0x01+RO /* page start register */
-#define PSTOP 0x02+RO /* page stop register */
-#define TPSR 0x04+RO /* tx start page start reg */
-#define TBCR0 0x05+RO /* tx byte count 0 reg */
-#define TBCR1 0x06+RO /* tx byte count 1 reg */
-#define RSAR0 0x08+RO /* remote start address reg 0 */
-#define RSAR1 0x09+RO /* remote start address reg 1 */
-#define RBCR0 0x0A+RO /* remote byte count reg 0 */
-#define RBCR1 0x0B+RO /* remote byte count reg 1 */
-#define RCR 0x0C+RO /* rx configuration reg */
-#define TCR 0x0D+RO /* tx configuration reg */
-#define DCR RO+0x0E /* data configuration reg */
-#define IMR 0x0F+RO /* interrupt mask reg */
-
-/* page 1 registers */
-
-#define PAR 0x01+RO /* physical addr reg base for rd and wr */
-#define CURR 0x07+RO /* current page reg for rd and wr */
-#define MAR 0x08+RO /* multicast addr reg base fro rd and WR */
-#define MARsize 8 /* size of multicast addr space */
-
-/*-----W83CREG command bits-----*/
-#define MSK_RESET 0x80 /* W83CREG masks */
-#define MSK_ENASH 0x40
-#define MSK_DECOD 0x3F /* memory decode bits, corresponding */
- /* to SA 18-13. SA 19 assumed to be 1 */
-
-/*-----CMDR command bits-----*/
-#define MSK_STP 0x01 /* stop the chip */
-#define MSK_STA 0x02 /* start the chip */
-#define MSK_TXP 0x04 /* initial txing of a frm */
-#define MSK_RRE 0x08 /* remote read */
-#define MSK_RWR 0x10 /* remote write */
-#define MSK_RD2 0x20 /* no DMA used */
-#define MSK_PG0 0x00 /* select register page 0 */
-#define MSK_PG1 0x40 /* select register page 1 */
-#define MSK_PG2 0x80 /* select register page 2 */
-
-/*-----ISR and TSR status bits-----*/
-#define MSK_PRX 0x01 /* rx with no error */
-#define MSK_PTX 0x02 /* tx with no error */
-#define MSK_RXE 0x04 /* rx with error */
-#define MSK_TXE 0x08 /* tx with error */
-#define MSK_OVW 0x10 /* overwrite warning */
-#define MSK_CNT 0x20 /* MSB of one of the tally counters is set */
-#define MSK_RDC 0x40 /* remote dma completed */
-#define MSK_RST 0x80 /* reset state indicator */
-
-/*-----DCR command bits-----*/
-#define MSK_WTS 0x01 /* word transfer mode selection */
-#define MSK_BOS 0x02 /* byte order selection */
-#define MSK_LAS 0x04 /* long addr selection */
-#define MSK_BMS 0x08 /* burst mode selection */
-#define MSK_ARM 0x10 /* autoinitialize remote */
-#define MSK_FT00 0x00 /* burst lrngth selection */
-#define MSK_FT01 0x20 /* burst lrngth selection */
-#define MSK_FT10 0x40 /* burst lrngth selection */
-#define MSK_FT11 0x60 /* burst lrngth selection */
-
-/*-----RCR command bits-----*/
-#define MSK_SEP 0x01 /* save error pkts */
-#define MSK_AR 0x02 /* accept runt pkt */
-#define MSK_AB 0x04 /* 8390 RCR */
-#define MSK_AM 0x08 /* accept multicast */
-#define MSK_PRO 0x10 /* accept all pkt with physical adr */
-#define MSK_MON 0x20 /* monitor mode */
-
-/*-----TCR command bits-----*/
-#define MSK_CRC 0x01 /* inhibit CRC, do not append crc */
-#define MSK_LOOP 0x02 /* set loopback mode */
-#define MSK_BCST 0x04 /* Accept broadcasts */
-#define MSK_LB01 0x06 /* encoded loopback control */
-#define MSK_ATD 0x08 /* auto tx disable */
-#define MSK_OFST 0x10 /* collision offset enable */
-
-/*-----receive status bits-----*/
-#define SMK_PRX 0x01 /* rx without error */
-#define SMK_CRC 0x02 /* CRC error */
-#define SMK_FAE 0x04 /* frame alignment error */
-#define SMK_FO 0x08 /* FIFO overrun */
-#define SMK_MPA 0x10 /* missed pkt */
-#define SMK_PHY 0x20 /* physical/multicase address */
-#define SMK_DIS 0x40 /* receiver disable. set in monitor mode */
-#define SMK_DEF 0x80 /* deferring */
-
-/*-----transmit status bits-----*/
-#define SMK_PTX 0x01 /* tx without error */
-#define SMK_DFR 0x02 /* non deferred tx */
-#define SMK_COL 0x04 /* tx collided */
-#define SMK_ABT 0x08 /* tx abort because of excessive collisions */
-#define SMK_CRS 0x10 /* carrier sense lost */
-#define SMK_FU 0x20 /* FIFO underrun */
-#define SMK_CDH 0x40 /* collision detect heartbeat */
-#define SMK_OWC 0x80 /* out of window collision */
-
diff --git a/c/src/lib/libbsp/i386/pc386/network/Makefile.in b/c/src/lib/libbsp/i386/pc386/network/Makefile.in
deleted file mode 100644
index 59728b648d..0000000000
--- a/c/src/lib/libbsp/i386/pc386/network/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/network.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=network
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \
- -DDIAGNOSTIC -DBOOTP_COMPAT
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i386/pc386/network/network.c b/c/src/lib/libbsp/i386/pc386/network/network.c
deleted file mode 100644
index 7afab2f9de..0000000000
--- a/c/src/lib/libbsp/i386/pc386/network/network.c
+++ /dev/null
@@ -1,657 +0,0 @@
-/*
- * RTEMS driver for M68360 WD1 Ethernet
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <wd80x3.h>
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <rtems/error.h>
-#include <rtems/rtems_bsdnet.h>
-
-#include <sys/param.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/sockio.h>
-
-#include <net/if.h>
-
-#include <netinet/in.h>
-#include <netinet/if_ether.h>
-
-#include <irq.h>
-
-#define ET_MINLEN 60 /* minimum message length */
-
-/*
- * Number of WDs supported by this driver
- */
-#define NWDDRIVER 1
-
-/*
- * Default number of buffer descriptors set aside for this driver.
- * The number of transmit buffer descriptors has to be quite large
- * since a single frame often uses four or more buffer descriptors.
- */
-#define RX_BUF_COUNT 15
-#define TX_BUF_COUNT 4
-#define TX_BD_PER_BUF 4
-
-/*
- * RTEMS event used by interrupt handler to signal driver tasks.
- * This must not be any of the events used by the network task synchronization.
- */
-#define INTERRUPT_EVENT RTEMS_EVENT_1
-
-/*
- * RTEMS event used to start transmit daemon.
- * This must not be the same as INTERRUPT_EVENT.
- */
-#define START_TRANSMIT_EVENT RTEMS_EVENT_2
-
-/*
- * Receive buffer size -- Allow for a full ethernet packet including CRC
- */
-#define RBUF_SIZE 1520
-
-#if (MCLBYTES < RBUF_SIZE)
-# error "Driver must have MCLBYTES > RBUF_SIZE"
-#endif
-
-/*
- * Per-device data
- */
-struct wd_softc {
- struct arpcom arpcom;
- rtems_irq_connect_data irqInfo;
- struct mbuf **rxMbuf;
- struct mbuf **txMbuf;
- int acceptBroadcast;
- int rxBdCount;
- int txBdCount;
- int txBdHead;
- int txBdTail;
- int txBdActiveCount;
- rtems_id rxDaemonTid;
- rtems_id txDaemonTid;
-
- unsigned int port;
- unsigned char *base;
- unsigned long bpar;
-
- /*
- * Statistics
- */
- unsigned long rxInterrupts;
- unsigned long rxNotFirst;
- unsigned long rxNotLast;
- unsigned long rxGiant;
- unsigned long rxNonOctet;
- unsigned long rxRunt;
- unsigned long rxBadCRC;
- unsigned long rxOverrun;
- unsigned long rxCollision;
-
- unsigned long txInterrupts;
- unsigned long txDeferred;
- unsigned long txHeartbeat;
- unsigned long txLateCollision;
- unsigned long txRetryLimit;
- unsigned long txUnderrun;
- unsigned long txLostCarrier;
- unsigned long txRawWait;
-};
-
-#define RO 0x10
-
-#define SHATOT (8*1024) /* size of shared memory */
-#define SHAPAGE 256 /* shared memory information */
-#define MAXSIZ 1536 /*(MAXBUF - MESSH_SZ)*/
-#define OUTPAGE ((SHATOT-(MAXSIZ+SHAPAGE-1))/SHAPAGE)
-
-static unsigned long loopc;
-static volatile unsigned long overrun;
-static volatile unsigned long resend;
-static struct wd_softc wd_softc[NWDDRIVER];
-
-/*
- * WD interrupt handler
- */
-static rtems_isr
-wd8003Enet_interrupt_handler (rtems_vector_number v)
-{
- unsigned int tport;
- unsigned char status, status2;
-
- tport = wd_softc[0].port ;
-
- /*
- * Read status
- */
- inport_byte(tport+ISR, status);
- outport_byte(tport+IMR, 0x00);
-
- /*
- * Ring overwrite
- */
-
- if (status & MSK_OVW){
- outport_byte(tport+CMDR, MSK_STP + MSK_RD2); /* stop 8390 */
- Wait_X_ms(2);
- outport_byte(tport+RBCR0, 0); /* clear byte count */
- outport_byte(tport+RBCR1, 0);
- inport_byte(tport+ISR, status2);
- status |= (status2 & (MSK_PTX+MSK_TXE)) ; /* TX status */
- outport_byte(tport+TCR, MSK_LOOP); /* loopback mode */
- outport_byte(tport+CMDR, MSK_STA + MSK_RD2); /* start */
- overrun = 1 ;
- if ((status & (MSK_PTX+MSK_TXE)) == 0)
- resend = 1;
- }
-
- /*
- * Frame received?
- */
- if (status & (MSK_PRX+MSK_RXE)) {
- outport_byte(tport+ISR, status & (MSK_PRX+MSK_RXE));
- wd_softc[0].rxInterrupts++;
- rtems_event_send (wd_softc[0].rxDaemonTid, INTERRUPT_EVENT);
- }
-
-}
-
-static void nopOn(const rtems_irq_connect_data* notUsed)
-{
- /*
- * code should be moved from wd8003Enet_initialize_hardware
- * to this location
- */
-}
-
-static int wdIsOn(const rtems_irq_connect_data* irq)
-{
- return BSP_irq_enabled_at_i8259s (irq->name);
-}
-
-/*
- * Initialize the ethernet hardware
- */
-static void
-wd8003Enet_initialize_hardware (struct wd_softc *sc)
-{
- int i1, ultra;
- char cc1, cc2;
- unsigned char temp;
- rtems_status_code st;
- unsigned int tport;
- unsigned char *hwaddr;
-
- tport = sc->port;
-
- /* address from board ROM */
- inport_byte(tport+0x04, temp);
- outport_byte(tport+0x04, temp & 0x7f);
-
- hwaddr = sc->arpcom.ac_enaddr;
- for (i1=cc2=0; i1<8; i1++) {
- inport_byte(tport + ADDROM + i1, cc1);
- cc2 += cc1;
- if (i1 < 6)
- hwaddr[i1] = cc1;
- }
-
- inport_byte(tport+0x04, temp);
- outport_byte(tport+0x04, temp | 0x80); /* alternate registers */
- outport_byte(tport+W83CREG, MSK_RESET); /* reset board, set buffer */
- outport_byte(tport+W83CREG, 0);
- outport_byte(tport+W83CREG, MSK_ENASH + (int)((sc->bpar>>13)&0x3f));
-
- outport_byte(tport+CMDR, MSK_PG0 + MSK_RD2);
- cc1 = MSK_BMS + MSK_FT10; /* configure 8 or 16 bits */
-
- inport_byte(tport+0x07, temp) ;
-
- ultra = ((temp & 0xf0) == 0x20 || (temp & 0xf0) == 0x40);
- if (ultra)
- cc1 = MSK_WTS + MSK_BMS + MSK_FT10;
- outport_byte(tport+DCR, cc1);
- outport_byte(tport+RBCR0, 0);
- outport_byte(tport+RBCR1, 0);
- outport_byte(tport+RCR, MSK_MON); /* disable the rxer */
- outport_byte(tport+TCR, 0); /* normal operation */
- outport_byte(tport+PSTOP, OUTPAGE); /* init PSTOP */
- outport_byte(tport+PSTART, 0); /* init PSTART */
- outport_byte(tport+BNRY, -1); /* init BNRY */
- outport_byte(tport+ISR, -1); /* clear IR's */
- outport_byte(tport+IMR, 0x15); /* enable interrupt */
-
- outport_byte(tport+CMDR, MSK_PG1 + MSK_RD2);
-
- for (i1=0; i1<6; i1++) /* initial physical addr */
- outport_byte(tport+PAR+i1, hwaddr[i1]);
-
- for (i1=0; i1<MARsize; i1++) /* clear multicast */
- outport_byte(tport+MAR+i1, 0);
- outport_byte(tport+CURR, 0); /* init current packet */
-
- outport_byte(tport+CMDR, MSK_PG0 + MSK_RD2);
- outport_byte(tport+CMDR, MSK_STA + MSK_RD2); /* put 8390 on line */
- outport_byte(tport+RCR, MSK_AB); /* MSK_AB accept broadcast */
-
- if (ultra) {
- inport_byte(tport+0x0c, temp);
- outport_byte(tport+0x0c, temp | 0x80);
- outport_byte(tport+0x05, 0x80);
- outport_byte(tport+0x06, 0x01);
- }
-
- /*
- * Set up interrupts
- */
- sc->irqInfo.hdl = wd8003Enet_interrupt_handler;
- sc->irqInfo.on = nopOn;
- sc->irqInfo.off = nopOn;
- sc->irqInfo.isOn = wdIsOn;
-
- st = BSP_install_rtems_irq_handler (&sc->irqInfo);
- if (!st)
- rtems_panic ("Can't attach WD interrupt handler for irq %d\n",
- sc->irqInfo.name);
-}
-
-static void
-wd_rxDaemon (void *arg)
-{
- unsigned int tport;
- struct ether_header *eh;
- struct wd_softc *dp = (struct wd_softc *)&wd_softc[0];
- struct ifnet *ifp = &dp->arpcom.ac_if;
- struct mbuf *m;
- unsigned int i2;
- unsigned int len;
- volatile unsigned char start, next, current;
- char *shp, *temp;
- rtems_event_set events;
-
- tport = wd_softc[0].port ;
-
- for (;;){
-
-
- rtems_bsdnet_event_receive (INTERRUPT_EVENT,
- RTEMS_WAIT|RTEMS_EVENT_ANY,
- RTEMS_NO_TIMEOUT,
- &events);
-
- for (;;){
- inport_byte(tport+BNRY, start);
-
- outport_byte(tport+CMDR, MSK_PG1 + MSK_RD2);
- inport_byte(tport+CURR, current);
- outport_byte(tport+CMDR, MSK_PG0 + MSK_RD2);
-
- start += 1;
- if (start >= OUTPAGE){
- start = 0;
- }
-
- if (current == start)
- break;
-
- shp = dp->base + 1 + (SHAPAGE * start);
- next = *shp++;
- len = *((short *)shp)++ - 4;
-
- if (next >= OUTPAGE){
- next = 0;
- }
-
- MGETHDR (m, M_WAIT, MT_DATA);
- MCLGET (m, M_WAIT);
- m->m_pkthdr.rcvif = ifp;
-
- temp = m->m_data;
- m->m_len = m->m_pkthdr.len = len - sizeof(struct ether_header);
-
- if ((i2 = (OUTPAGE - start) * SHAPAGE - 4) < len){
- memcpy(temp, shp, i2);
- len -= i2;
- temp += i2;
- shp = dp->base;
- }
- memcpy(temp, shp, len);
-
- eh = mtod (m, struct ether_header *);
- m->m_data += sizeof(struct ether_header);
- ether_input (ifp, eh, m);
-
- outport_byte(tport+BNRY, next-1);
- }
-
- /*
- * Ring overwrite
- */
- if (overrun){
- outport_byte(tport+ISR, MSK_OVW); /* reset IR */
- outport_byte(tport+TCR, 0); /* out of loopback */
- if (resend == 1)
- outport_byte(tport+CMDR, MSK_TXP + MSK_RD2); /* resend */
- resend = 0;
- overrun = 0;
- }
-
- outport_byte(tport+IMR, 0x15); /* re-enable IT rx */
- }
-}
-
-static void
-sendpacket (struct ifnet *ifp, struct mbuf *m)
-{
- struct wd_softc *dp = ifp->if_softc;
- struct mbuf *n;
- unsigned int len, tport;
- char *shp, txReady;
-
- tport = dp->port;
-
- /*
- * Waiting for Transmitter ready
- */
- inport_byte(tport+CMDR, txReady);
- while(txReady & MSK_TXP)
- inport_byte(tport+CMDR, txReady);
-
- len = 0;
- shp = dp->base + (SHAPAGE * OUTPAGE);
-
- n = m;
-
- for (;;){
- len += m->m_len;
- memcpy(shp, (char *)m->m_data, m->m_len);
- shp += m->m_len ;
- if ((m = m->m_next) == NULL)
- break;
- }
-
- m_freem(n);
-
- if (len < ET_MINLEN) len = ET_MINLEN;
- outport_byte(tport+TBCR0, len);
- outport_byte(tport+TBCR1, (len >> 8) );
- outport_byte(tport+TPSR, OUTPAGE);
- outport_byte(tport+CMDR, MSK_TXP + MSK_RD2);
-}
-
-/*
- * Driver transmit daemon
- */
-void
-wd_txDaemon (void *arg)
-{
- struct wd_softc *sc = (struct wd_softc *)arg;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- struct mbuf *m;
- rtems_event_set events;
-
- for (;;) {
- /*
- * Wait for packet
- */
- rtems_bsdnet_event_receive (START_TRANSMIT_EVENT, RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Send packets till queue is empty
- */
- for (;;) {
- /*
- * Get the next mbuf chain to transmit.
- */
- IF_DEQUEUE(&ifp->if_snd, m);
- if (!m)
- break;
- sendpacket (ifp, m);
- }
- ifp->if_flags &= ~IFF_OACTIVE;
- }
-}
-
-/*
- * Send packet (caller provides header).
- */
-static void
-wd_start (struct ifnet *ifp)
-{
- struct wd_softc *sc = ifp->if_softc;
-
- rtems_event_send (sc->txDaemonTid, START_TRANSMIT_EVENT);
- ifp->if_flags |= IFF_OACTIVE;
-}
-
-/*
- * Initialize and start the device
- */
-static void
-wd_init (void *arg)
-{
- struct wd_softc *sc = arg;
- struct ifnet *ifp = &sc->arpcom.ac_if;
-
- if (sc->txDaemonTid == 0) {
-
- /*
- * Set up WD hardware
- */
- wd8003Enet_initialize_hardware (sc);
-
- /*
- * Start driver tasks
- */
- sc->txDaemonTid = rtems_bsdnet_newproc ("SCtx", 4096, wd_txDaemon, sc);
- sc->rxDaemonTid = rtems_bsdnet_newproc ("SCrx", 4096, wd_rxDaemon, sc);
- }
-
- /*
- * Tell the world that we're running.
- */
- ifp->if_flags |= IFF_RUNNING;
-
-}
-
-/*
- * Stop the device
- */
-static void
-wd_stop (struct wd_softc *sc)
-{
- unsigned int tport;
- unsigned char temp;
- struct ifnet *ifp = &sc->arpcom.ac_if;
-
- ifp->if_flags &= ~IFF_RUNNING;
-
- /*
- * Stop the transmitter
- */
- tport=wd_softc[0].port ;
- inport_byte(tport+0x04,temp);
- outport_byte(tport+0x04, temp & 0x7f);
- outport_byte(tport + CMDR, MSK_STP + MSK_RD2);
-
-}
-
-
-/*
- * Show interface statistics
- */
-static void
-wd_stats (struct wd_softc *sc)
-{
- printf (" Rx Interrupts:%-8lu", sc->rxInterrupts);
- printf (" Not First:%-8lu", sc->rxNotFirst);
- printf (" Not Last:%-8lu\n", sc->rxNotLast);
- printf (" Giant:%-8lu", sc->rxGiant);
- printf (" Runt:%-8lu", sc->rxRunt);
- printf (" Non-octet:%-8lu\n", sc->rxNonOctet);
- printf (" Bad CRC:%-8lu", sc->rxBadCRC);
- printf (" Overrun:%-8lu", sc->rxOverrun);
- printf (" Collision:%-8lu\n", sc->rxCollision);
-
- printf (" Tx Interrupts:%-8lu", sc->txInterrupts);
- printf (" Deferred:%-8lu", sc->txDeferred);
- printf (" Missed Hearbeat:%-8lu\n", sc->txHeartbeat);
- printf (" No Carrier:%-8lu", sc->txLostCarrier);
- printf ("Retransmit Limit:%-8lu", sc->txRetryLimit);
- printf (" Late Collision:%-8lu\n", sc->txLateCollision);
- printf (" Underrun:%-8lu", sc->txUnderrun);
- printf (" Raw output wait:%-8lu\n", sc->txRawWait);
-}
-
-/*
- * Driver ioctl handler
- */
-static int
-wd_ioctl (struct ifnet *ifp, int command, caddr_t data)
-{
- struct wd_softc *sc = ifp->if_softc;
- int error = 0;
-
- switch (command) {
- case SIOCGIFADDR:
- case SIOCSIFADDR:
- ether_ioctl (ifp, command, data);
- break;
-
- case SIOCSIFFLAGS:
- switch (ifp->if_flags & (IFF_UP | IFF_RUNNING)) {
- case IFF_RUNNING:
- wd_stop (sc);
- break;
-
- case IFF_UP:
- wd_init (sc);
- break;
-
- case IFF_UP | IFF_RUNNING:
- wd_stop (sc);
- wd_init (sc);
- break;
-
- default:
- break;
- }
- break;
-
- case SIO_RTEMS_SHOW_STATS:
- wd_stats (sc);
- break;
-
- /*
- * FIXME: All sorts of multicast commands need to be added here!
- */
- default:
- error = EINVAL;
- break;
- }
- return error;
-}
-
-/*
- * Attach an WD driver to the system
- */
-int
-rtems_wd_driver_attach (struct rtems_bsdnet_ifconfig *config)
-{
- struct wd_softc *sc;
- struct ifnet *ifp;
- int mtu;
- int i;
-
- /*
- * Find a free driver
- */
- for (i = 0 ; i < NWDDRIVER ; i++) {
- sc = &wd_softc[i];
- ifp = &sc->arpcom.ac_if;
- if (ifp->if_softc == NULL)
- break;
- }
- if (i >= NWDDRIVER) {
- printf ("Too many WD drivers.\n");
- return 0;
- }
-
- /*
- * Process options
- */
- if (config->hardware_address) {
- memcpy (sc->arpcom.ac_enaddr, config->hardware_address,
- ETHER_ADDR_LEN);
- }
- else {
- memset (sc->arpcom.ac_enaddr, 0x08,ETHER_ADDR_LEN);
- }
- if (config->mtu)
- mtu = config->mtu;
- else
- mtu = ETHERMTU;
-
-
- if (config->irno)
- sc->irqInfo.name = config->irno;
- else
- sc->irqInfo.name = 5;
-
- if (config->port)
- sc->port = config->port;
- else
- sc->port = 0x240;
-
- if (config->bpar) {
- sc->bpar = config->bpar;
- sc->base = (unsigned char*) config->bpar;
- }
- else {
- sc->bpar = 0xD0000;
- sc->base = (unsigned char*) 0xD0000;
- }
-
- sc->acceptBroadcast = !config->ignore_broadcast;
-
- /*
- * Set up network interface values
- */
- ifp->if_softc = sc;
- ifp->if_unit = i + 1;
- ifp->if_name = "wd";
- ifp->if_mtu = mtu;
- ifp->if_init = wd_init;
- ifp->if_ioctl = wd_ioctl;
- ifp->if_start = wd_start;
- ifp->if_output = ether_output;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX;
- if (ifp->if_snd.ifq_maxlen == 0)
- ifp->if_snd.ifq_maxlen = ifqmaxlen;
-
- /*
- * init some variables
- */
- overrun = 0;
- resend = 0;
-
- /*
- * Attach the interface
- */
- if_attach (ifp);
- ether_ifattach (ifp);
- return 1;
-};
diff --git a/c/src/lib/libbsp/i386/pc386/start/Makefile.in b/c/src/lib/libbsp/i386/pc386/start/Makefile.in
deleted file mode 100644
index b5ea51fd71..0000000000
--- a/c/src/lib/libbsp/i386/pc386/start/Makefile.in
+++ /dev/null
@@ -1,72 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-RTEMS_GAS_CODE16 = @RTEMS_GAS_CODE16@
-
-PGMS=${ARCH}/start.o ${ARCH}/start16.bin
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start16 start
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-ifeq ($(RTEMS_GAS_CODE16),yes)
-DEFINES += -DNEW_GAS
-endif
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGMS)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-
-LINKCMDS=$(srcdir)/../startup/linkcmds
-
-${ARCH}/start16.o: start16.s
- sed -e 's/\/\/.*$$//' < $< | $(CPP) $(ASMFLAGS) -I. -I$(srcdir) \
- -DASM -DHEADERADDR=$(HEADERADDR) - > $*.i
- $(AS) $(ASFLAGS) -o $@ $*.i
-
-${ARCH}/start16.bin: ${ARCH}/start16.o
- $(LD) -N -T $(LINKCMDS) -Ttext $(START16ADDR) -e start16 -nostdlib \
- --oformat=elf32-i386 -o $(basename $@).obj $(basename $@).o
- $(OBJCOPY) -O binary $(basename $@).obj $@
diff --git a/c/src/lib/libbsp/i386/pc386/start/start.s b/c/src/lib/libbsp/i386/pc386/start/start.s
deleted file mode 100644
index 323aa3d088..0000000000
--- a/c/src/lib/libbsp/i386/pc386/start/start.s
+++ /dev/null
@@ -1,202 +0,0 @@
-/*-------------------------------------------------------------------------+
-| start.s v1.1 - PC386 BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| This file contains the entry point for the application.
-| The name of this entry point is compiler dependent.
-| It jumps to the BSP which is responsible for performing all initialization.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Modified the 20/05/1998 by valette@crf.canon.fr in order to give a working
-| example of eraly stage debugging via the DEBUG_EARLY_START define.
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is based on an earlier generation RTEMS i386 start.s and the
-| following copyright applies:
-|
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1998.
-| * On-Line Applications Research Corporation (OAR).
-| * Copyright assigned to U.S. Government, 1994.
-| *
-| * The license and distribution terms for this file may be
-| * found in the file LICENSE in this distribution or at
-| * http://www.OARcorp.com/rtems/license.html.
-| **************************************************************************
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-/*
- * The most trivial start.s possible. It does not know anything
- * about system it is running on, so it will jump to appropriate
- * place in BSP specific place to do things it knows nothing about
- */
-
-#include "asm.h"
-
-/*----------------------------------------------------------------------------+
-| Size of heap and stack:
-+----------------------------------------------------------------------------*/
-
-.set STACK_SIZE, 0x1000
-
-/*----------------------------------------------------------------------------+
-| CODE section
-+----------------------------------------------------------------------------*/
-
-BEGIN_CODE
-
- PUBLIC (start) # GNU default entry point
-
- EXTERN (boot_card)
- EXTERN (_load_segments)
- EXTERN (_return_to_monitor)
- EXTERN (_IBMPC_initVideo)
- EXTERN (debugPollingGetChar)
- EXTERN (checkCPUtypeSetCr0)
-
-
-/*
- * In case this crashes on your machine and this is not due
- * to video mode set by the loader, you may try to define
- * the following variable:
- */
-/* #define DEBUG_EARLY_START */
-
-SYM (start):
- /*
- * When things are really, REALLY!, bad -- turn on the speaker and
- * lock up. This shows whether or not we make it to a certain
- * location.
- */
-#if 0
- inb $0x61, al
- orb $0x03, al
- outb al, $0x61 # enable the speaker
-speakl: jmp speakl # and SPIN!!!
-#endif
-
- nop
- cli # DISABLE INTERRUPTS!!!
- cld
-#ifdef DEBUG_EARLY_START
- /*
- * Must get video attribute to have a working printk.
- * Note that the following code assume we already have
- * valid segments and a stack. It should be true for
- * any loader starting RTEMS in protected mode (or
- * at least I hope so : -)).
- */
- call _IBMPC_initVideo
- /*
- * try printk and a getchar in polling mode ASAP
- */
- pushl $welcome_msg
- call printk
- addl $4, esp
-
- /* call debugPollingGetChar */
-
-#endif
-
-/*----------------------------------------------------------------------------+
-| Load the segment registers (this is done by the board's BSP) and perform any
-| other board specific initialization procedures, this piece of code
-| does not know anything about
-|
-| NOTE: Upon return, gs will contain the segment descriptor for a segment which
-| maps directly to all of physical memory.
-+----------------------------------------------------------------------------*/
-
- jmp SYM (_load_segments) # load board dependent segments
-
-/*----------------------------------------------------------------------------+
-| Set up the stack
-+----------------------------------------------------------------------------*/
-
- PUBLIC (_establish_stack)
-SYM (_establish_stack):
-
- movl $_end, eax # eax = end of bss/start of heap
- addl $STACK_SIZE, eax # make room for stack
- andl $0xffffffc0, eax # align it on 16 byte boundary
- movl eax, esp # set stack pointer
- movl eax, ebp # set base pointer
-
-/*----------------------------------------------------------------------------+
-| Zero out the BSS segment
-+----------------------------------------------------------------------------*/
-
-SYM (zero_bss):
- cld # make direction flag count up
- movl $ SYM (_end), ecx # find end of .bss
- movl $ SYM (_bss_start), edi # edi = beginning of .bss
- subl edi, ecx # ecx = size of .bss in bytes
- shrl ecx # size of .bss in longs
- shrl ecx
- xorl eax, eax # value to clear out memory
- repne # while ecx != 0
- stosl # clear a long in the bss
-
-/*---------------------------------------------------------------------+
-| Check CPU type. Enable Cache and init coprocessor if needed.
-+---------------------------------------------------------------------*/
- call checkCPUtypeSetCr0
-/*---------------------------------------------------------------------+
-| Transfer control to User's Board Support Package
-+---------------------------------------------------------------------*/
-
- pushl $0 # environp
- pushl $0 # argv
- pushl $0 # argc
- call SYM (boot_card)
- addl $12, esp
-
-/*---------------------------------------------------------------------+
-| Clean up - we do not know anything about it, so we will
-| jump to BSP specific code to do cleanup
-+---------------------------------------------------------------------*/
-
- jmp SYM (_return_to_monitor)
-
-END_CODE
-
-BEGIN_DATA
-
- PUBLIC(_stack_size)
-SYM(_stack_size):
- .long STACK_SIZE
-
-#ifdef DEBUG_EARLY_START
-
- PUBLIC (welcome_msg)
-SYM (welcome_msg) :
- .string "Ready to debug RTEMS ?\nEnter <CR>\n"
-
- PUBLIC (hex_msg)
-SYM (hex_msg) :
- .string "0x%x\n"
-
- PUBLIC (made_it_msg)
-SYM (made_it_msg) :
- .string "made it to %d\n"
-
-#endif
-
-END_DATA
-
-END
-
-
-
-
diff --git a/c/src/lib/libbsp/i386/pc386/start/start16.s b/c/src/lib/libbsp/i386/pc386/start/start16.s
deleted file mode 100644
index 4b12408cd6..0000000000
--- a/c/src/lib/libbsp/i386/pc386/start/start16.s
+++ /dev/null
@@ -1,183 +0,0 @@
-/*-------------------------------------------------------------------------+
-| start16.s v1.0 - PC386 BSP - 1998/04/13
-+--------------------------------------------------------------------------+
-| This file contains the entry point for the application.
-| The name of this entry point is compiler dependent.
-| It jumps to the BSP which is responsible for performing all initialization.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is partly based on (from the Linux source tree):
-| video.S - Copyright (C) 1995, 1996 Martin Mares <mj@k332.feld.cvut.cz>
-+--------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------+
-| Constants
-+----------------------------------------------------------------------------*/
-
-.set PROT_CODE_SEG, 0x08 # offset of code segment descriptor into GDT
-.set PROT_DATA_SEG, 0x10 # offset of code segment descriptor into GDT
-.set CR0_PE, 1 # protected mode flag on CR0 register
-.set HDRSTART, HEADERADDR # address of start of bin2boot header
-.set HDROFF, 0x24 # offset into bin2boot header of start32 addr
-.set STACKOFF, 0x200-0x10 # offset to load into %esp, from start of image
-
- /* #define NEW_GAS */
-/*----------------------------------------------------------------------------+
-| CODE section
-+----------------------------------------------------------------------------*/
-
-.text
-
- .globl _start16 # entry point
- .globl start16
-start16:
-_start16:
-
-.code16
-
- cli # DISABLE INTERRUPTS!!!
-
- movw %cs, %ax #
- movw %ax, %ds # set the rest of real mode registers
- movw %ax, %es #
- movw %ax, %ss #
-
-#if defined(RTEMS_VIDEO_80x50)
-
- /*---------------------------------------------------------------------+
- | Switch VGA video to 80 lines x 50 columns mode. Has to be done before
- | turning protected mode on since it uses BIOS int 10h (video) services.
- +---------------------------------------------------------------------*/
-
- movw $0x0003, %ax # forced set
- int $0x10
- movw $0x1112, %ax # use 8x8 font
- xorb %bl, %bl
- int $0x10
- movw $0x1201, %ax # turn off cursor emulation
- movb $0x34, %bl
- int $0x10
- movb $0x01, %ah # define cursor (scan lines 0 to 7)
- movw $0x0007, %cx
- int $0x10
-
-#endif /* RTEMS_VIDEO_80x50 */
-
- /*---------------------------------------------------------------------+
- | Bare PC machines boot in real mode! We have to turn protected mode on.
- +---------------------------------------------------------------------*/
-#ifdef NEW_GAS
- data32
- addr32
-#endif
- lgdt gdtptr - start16 # load Global Descriptor Table
- movl %cr0, %eax
- orl $CR0_PE, %eax
- movl %eax, %cr0 # turn on protected mode
-
-#ifdef NEW_GAS
- ljmpl $PROT_CODE_SEG, $1f # flush prefetch queue, and reload %cs
-#else
- ljmp $PROT_CODE_SEG, $1f # flush prefetch queue, and reload %cs
-#endif
-.code32
-1:
- /*---------------------------------------------------------------------+
- | load the other segment registers
- +---------------------------------------------------------------------*/
- movl $PROT_DATA_SEG, %eax
- movl %ax, %ds
- movl %ax, %es
- movl %ax, %ss
- movl $start16 + STACKOFF, %esp # set up stack pointer
- addl $start16 + STACKOFF, %ebp # set up stack pointer
-
- /*---------------------------------------------------------------------+
- | we have to enable A20 in order to access memory above 1MByte
- +---------------------------------------------------------------------*/
- call empty_8042
- movb $0xD1, %al # command write
- outb %al, $0x64
- call empty_8042
- movb $0xDF, %al # A20 on
- outb %al, $0x60
- call empty_8042
-
- movl %cs:HDRSTART + HDROFF, %eax #
- pushl %eax # jump to start of 32 bit code
- ret #
-
-/*----------------------------------------------------------------------------+
-| delay
-+------------------------------------------------------------------------------
-| Delay is needed after doing I/O. We do it by writing to a non-existent port.
-+----------------------------------------------------------------------------*/
- .globl _delay
- .globl delay
-delay:
-_delay:
- outb %al, $0xED # about 1uS delay
- ret
-
-/*----------------------------------------------------------------------------+
-| empty_8042
-+------------------------------------------------------------------------------
-| This routine checks that the keyboard command queue is empty (after emptying
-| the output buffers).
-| No timeout is used - if this hangs there is something wrong with the machine,
-| and we probably couldn't proceed anyway.
-+----------------------------------------------------------------------------*/
- .globl _empty_8042
- .globl empty_8042
-empty_8042:
-_empty_8042:
- call delay
- inb $0x64, %al # 8042 status port
- testb $0x01, %al # output buffer?
- jz no_output
- call delay
- in $0x60, %al # read it
- jmp empty_8042
-no_output:
- test $0x02, %al # is input buffer full?
- jnz empty_8042 # yes - loop
- ret
-
-/*----------------------------------------------------------------------------+
-| DATA section
-+----------------------------------------------------------------------------*/
-
-/**************************
-* GLOBAL DESCRIPTOR TABLE *
-**************************/
-
- .p2align 4
-gdtptr:
- /* we use the NULL descriptor to store the GDT pointer - a trick quite
- nifty due to: Robert Collins (rcollins@x86.org) */
- .word gdtlen - 1
- .long gdtptr
- .word 0x0000
-
- /* code segment */
- .word 0xffff, 0
- .byte 0, 0x9f, 0xcf, 0
-
- /* data segment */
- .word 0xffff, 0
- .byte 0, 0x93, 0xcf, 0
-
- .set gdtlen, . - gdtptr # length of GDT
-
diff --git a/c/src/lib/libbsp/i386/pc386/startup/Makefile.in b/c/src/lib/libbsp/i386/pc386/startup/Makefile.in
deleted file mode 100644
index c0da505e2d..0000000000
--- a/c/src/lib/libbsp/i386/pc386/startup/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared:@srcdir@/../../shared/irq:@srcdir@/../../shared/comm:@srcdir@/../../shared/pci
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bsplibc bsppost bspstart exit irq irq_init main sbrk i386-stub i386-stub-glue uart pcibios
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=ldsegs irq_asm
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(srcdir)/linkcmds $(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-
diff --git a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
deleted file mode 100644
index a14ff0521f..0000000000
--- a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*-------------------------------------------------------------------------+
-| This file contains the PC386 BSP startup package. It includes application,
-| board, and monitor specific initialization and configuration. The generic CPU
-| dependent initialization has been performed before this routine is invoked.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is based on:
-| bspstart.c,v 1.8 1996/05/28 13:12:40 joel Exp - go32 BSP
-| With the following copyright notice:
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1998.
-| * On-Line Applications Research Corporation (OAR).
-| * Copyright assigned to U.S. Government, 1994.
-| *
-| * The license and distribution terms for this file may be
-| * found in found in the file LICENSE in this distribution or at
-| * http://www.OARcorp.com/rtems/license.html.
-| **************************************************************************
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-
-#include <bsp.h>
-#include <libcsupport.h>
-#include <rtems/libio.h>
-#include <libcpu/cpuModel.h>
-
-/*-------------------------------------------------------------------------+
-| Global Variables
-+--------------------------------------------------------------------------*/
-extern rtems_unsigned32 _end; /* End of BSS. Defined in 'linkcmds'. */
-/*
- * Size of heap if it is 0 it will be dynamically defined by memory size,
- * otherwise the value should be changed by binary patch
- */
-rtems_unsigned32 _heap_size = 0;
-
-/* Size of stack used during initialization. Defined in 'start.s'. */
-extern rtems_unsigned32 _stack_size;
-
-rtems_unsigned32 rtemsFreeMemStart;
- /* Address of start of free memory - should be updated
- after creating new partitions or regions. */
-
-/* The original BSP configuration table from the application and our copy of it
- with some changes. */
-
-extern rtems_configuration_table Configuration;
- rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table; /* CPU configuration table. */
-char *rtems_progname; /* Program name - from main(). */
-
-/*-------------------------------------------------------------------------+
-| External Prototypes
-+--------------------------------------------------------------------------*/
-extern void rtems_irq_mngt_init(void);
-void bsp_libc_init( void *, unsigned32, int );
-void bsp_postdriver_hook(void);
-
-/*-------------------------------------------------------------------------+
-| Function: bsp_pretasking_hook
-| Description: BSP pretasking hook. Called just before drivers are
-| initialized. Used to setup libc and install any BSP
-| extensions. NOTE: Must not use libc (to do io) from here,
-| since drivers are not yet initialized.
-| Global Variables: None.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void bsp_pretasking_hook(void)
-{
- rtems_unsigned32 topAddr, val;
- int i;
-
-
- if (rtemsFreeMemStart & (CPU_ALIGNMENT - 1)) /* not aligned => align it */
- rtemsFreeMemStart = (rtemsFreeMemStart+CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- if(_heap_size == 0)
- {
- /*
- * We have to dynamically size memory. Memory size can be anything
- * between 2M and 2048M.
- * let us first write
- */
- for(i=2048; i>=2; i--)
- {
- topAddr = i*1024*1024 - 4;
- *(volatile rtems_unsigned32 *)topAddr = topAddr;
- }
-
- for(i=2; i<=2048; i++)
- {
- topAddr = i*1024*1024 - 4;
- val = *(rtems_unsigned32 *)topAddr;
- if(val != topAddr)
- {
- break;
- }
- }
-
- topAddr = (i-1)*1024*1024 - 4;
-
- _heap_size = topAddr - rtemsFreeMemStart;
- }
-
- bsp_libc_init((void *)rtemsFreeMemStart, _heap_size, 0);
- rtemsFreeMemStart += _heap_size; /* HEAP_SIZE in KBytes */
-
-
-#ifdef RTEMS_DEBUG
-
- rtems_debug_enable(RTEMS_DEBUG_ALL_MASK);
-
-#endif /* RTEMS_DEBUG */
-} /* bsp_pretasking_hook */
-
-
-/*-------------------------------------------------------------------------+
-| Function: bsp_start
-| Description: Called before main is invoked.
-| Global Variables: None.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void bsp_start( void )
-{
- /*
- * Calibrate variable for 1ms-loop (see timer.c)
- */
- Calibrate_loop_1ms();
-
- /*
- * Initialize printk channel
- */
-
- _IBMPC_initVideo();
-
- rtemsFreeMemStart = (rtems_unsigned32)&_end + _stack_size;
- /* set the value of start of free memory. */
-
- /* If we don't have command line arguments set default program name. */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.predriver_hook = NULL; /* use system's */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.idle_task = NULL;
- /* do not override system IDLE task */
- Cpu_table.do_zero_of_workspace = TRUE;
- Cpu_table.interrupt_table_segment = get_ds();
- Cpu_table.interrupt_table_offset = (void *)Interrupt_descriptor_table;
- Cpu_table.interrupt_stack_size = 4096;
- Cpu_table.extra_mpci_receive_server_stack = 0;
-
- /* Place RTEMS workspace at beginning of free memory. */
-
- if (rtemsFreeMemStart & (CPU_ALIGNMENT - 1)) /* not aligned => align it */
- rtemsFreeMemStart = (rtemsFreeMemStart+CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- BSP_Configuration.work_space_start = (void *)rtemsFreeMemStart;
- rtemsFreeMemStart += BSP_Configuration.work_space_size;
-
- console_reserve_resources(&BSP_Configuration);
-
- /*
- * Init rtems interrupt management
- */
- rtems_irq_mngt_init();
- /*
- * Init rtems exceptions management
- */
- rtems_exception_init_mngt();
- /*
- * The following information is very useful when debugging.
- */
-
-#if 0
- printk( "work_space_size = 0x%x\n", BSP_Configuration.work_space_size );
- printk( "maximum_extensions = 0x%x\n", BSP_Configuration.maximum_extensions );
- printk( "microseconds_per_tick = 0x%x\n",
- BSP_Configuration.microseconds_per_tick );
- printk( "ticks_per_timeslice = 0x%x\n",
- BSP_Configuration.ticks_per_timeslice );
- printk( "maximum_devices = 0x%x\n", BSP_Configuration.maximum_devices );
- printk( "number_of_device_drivers = 0x%x\n",
- BSP_Configuration.number_of_device_drivers );
- printk( "Device_driver_table = 0x%x\n",
- BSP_Configuration.Device_driver_table );
-
- printk( "_heap_size = 0x%x\n", _heap_size );
- printk( "_stack_size = 0x%x\n", _stack_size );
- printk( "rtemsFreeMemStart = 0x%x\n", rtemsFreeMemStart );
- printk( "work_space_start = 0x%x\n", BSP_Configuration.work_space_start );
- printk( "work_space_size = 0x%x\n", BSP_Configuration.work_space_size );
-#endif
-} /* bsp_start */
diff --git a/c/src/lib/libbsp/i386/pc386/startup/exit.c b/c/src/lib/libbsp/i386/pc386/startup/exit.c
deleted file mode 100644
index c37888f003..0000000000
--- a/c/src/lib/libbsp/i386/pc386/startup/exit.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-------------------------------------------------------------------------+
-| exit.c v1.1 - PC386 BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| Routines to shutdown and reboot the PC.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is based on:
-| exit.c,v 1.2 1995/12/19 20:07:36 joel Exp - go32 BSP
-| With the following copyright notice:
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1998.
-| * On-Line Applications Research Corporation (OAR).
-| * Copyright assigned to U.S. Government, 1994.
-| *
-| * The license and distribution terms for this file may be
-| * found in found in the file LICENSE in this distribution or at
-| * http://www.OARcorp.com/rtems/license.html.
-| **************************************************************************
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-
-#include <stdio.h>
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <uart.h>
-
-void bsp_cleanup(void)
-{
- unsigned char ch;
- static char line[]="EXECUTIVE SHUTDOWN! Any key to reboot...";
- /*
- * AT this point, the console driver is disconnected => we must
- * use polled output/input. This is exactly what printk
- * does.
- */
- printk("\n");
- printk(line);
- ch = BSP_poll_char();
- rtemsReboot();
-}
-
-
-
-
-
-
-
-
diff --git a/c/src/lib/libbsp/i386/pc386/startup/ldsegs.s b/c/src/lib/libbsp/i386/pc386/startup/ldsegs.s
deleted file mode 100644
index 8805128e69..0000000000
--- a/c/src/lib/libbsp/i386/pc386/startup/ldsegs.s
+++ /dev/null
@@ -1,222 +0,0 @@
-/*-------------------------------------------------------------------------+
-| ldsegs.s v1.1 - PC386 BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| This file assists the board independent startup code by loading the proper
-| segment register values. The values loaded are board dependent. In addition
-| it contains code to enable the A20 line and to reprogram the PIC to relocate
-| the IRQ interrupt vectors to 0x20 -> 0x2f.
-| NOTE: No stack has been established when this routine is invoked.
-| It returns by jumping back to bspentry.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is base on:
-| ldsegs.s,v 1.4 1996/04/20 16:48:30 joel Exp - go32 BSP
-| With the following copyright notice:
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1998.
-| * On-Line Applications Research Corporation (OAR).
-| * Copyright assigned to U.S. Government, 1994.
-| *
-| * The license and distribution terms for this file may be
-| * found in found in the file LICENSE in this distribution or at
-| * http://www.OARcorp.com/rtems/license.html.
-| **************************************************************************
-|
-| $Id$
-|
-| Also based on (from the Linux source tree):
-| setup.S - Copyright (C) 1991, 1992 Linus Torvalds
-+--------------------------------------------------------------------------*/
-
-
-#include "asm.h"
-
-/*----------------------------------------------------------------------------+
-| CODE section
-+----------------------------------------------------------------------------*/
-EXTERN (rtems_i8259_masks)
-
-BEGIN_CODE
-
- EXTERN (_establish_stack)
- EXTERN (Timer_exit)
- EXTERN (clockOff)
-
- .p2align 4
-/*----------------------------------------------------------------------------+
-| delay
-+------------------------------------------------------------------------------
-| Delay is needed after doing I/O. We do it by writing to a non-existent port.
-+----------------------------------------------------------------------------*/
-SYM(delay):
- outb al, $0xED # about 1uS delay
- ret
-
-/*-------------------------------------------------------------------------+
-| Function: _load_segments
-| Description: Current environment is standard PC booted by grub.
-| So, there is no value in saving current GDT and IDT
-| settings we have to set it up ourseves. (Naturally
-| it will be not so in case we are booted by some
-| boot monitor, however, then it will be different
-| BSP). After that we have to load board segment registers
-| with apropriate values + reprogram PIC.
-| Global Variables: None.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
- .p2align 4
-
- PUBLIC (_load_segments)
-SYM (_load_segments):
-
- lgdt SYM(gdtdesc)
- lidt SYM(idtdesc)
-
- /* Load CS, flush prefetched queue */
- ljmp $0x8, $next_step
-
-next_step:
- /* Load segment registers */
- movw $0x10, ax
- movw ax, ss
- movw ax, ds
- movw ax, es
- movw ax, fs
- movw ax, gs
-
-/*---------------------------------------------------------------------+
-| Now we have to reprogram the interrupts :-(. We put them right after
-| the intel-reserved hardware interrupts, at int 0x20-0x2F. There they
-| won't mess up anything. Sadly IBM really messed this up with the
-| original PC, and they haven't been able to rectify it afterwards. Thus
-| the bios puts interrupts at 0x08-0x0f, which is used for the internal
-| hardware interrupts as well. We just have to reprogram the 8259's, and
-| it isn't fun.
-+---------------------------------------------------------------------*/
-
- movb $0x11, al /* initialization sequence */
- outb al, $0x20 /* send it to 8259A-1 */
- call SYM(delay)
- outb al, $0xA0 /* and to 8259A-2 */
- call SYM(delay)
-
- movb $0x20, al /* start of hardware int's (0x20) */
- outb al, $0x21
- call SYM(delay)
- movb $0x28, al /* start of hardware int's 2 (0x28) */
- outb al, $0xA1
- call SYM(delay)
-
- movb $0x04, al /* 8259-1 is master */
- outb al, $0x21
- call SYM(delay)
- movb $0x02, al /* 8259-2 is slave */
- outb al, $0xA1
- call SYM(delay)
-
- movb $0x01, al /* 8086 mode for both */
- outb al, $0x21
- call SYM(delay)
- outb al, $0xA1
- call SYM(delay)
-
- movb $0xFF, al /* mask off all interrupts for now */
- outb al, $0xA1
- call SYM(delay)
- movb $0xFB, al /* mask all irq's but irq2 which */
- outb al, $0x21 /* is cascaded */
- call SYM(delay)
-
- movw $0xFFFB, SYM(i8259s_cache) /* set up same values in cache */
-
- jmp SYM (_establish_stack) # return to the bsp entry code
-
-/*-------------------------------------------------------------------------+
-| Function: _return_to_monitor
-| Description: Return to board's monitor (we have none so simply restart).
-| Global Variables: None.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-
- .p2align 4
-
- PUBLIC (_return_to_monitor)
-SYM (_return_to_monitor):
-
- call SYM (Timer_exit)
- call SYM (Clock_exit)
- jmp SYM (start)
-
-/*-------------------------------------------------------------------------+
-| Function: _default_int_handler
-| Description: default interrupt handler
-| Global Variables: None.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
- .p2align 4
-
-/*---------------------------------------------------------------------------+
-| GDT itself
-+--------------------------------------------------------------------------*/
-
- .p2align 4
-
- PUBLIC (_Global_descriptor_table)
-SYM (_Global_descriptor_table):
-
- /* NULL segment */
- .word 0, 0
- .byte 0, 0, 0, 0
-
- /* code segment */
- .word 0xffff, 0
- .byte 0, 0x9e, 0xcf, 0
-
- /* data segment */
- .word 0xffff, 0
- .byte 0, 0x92, 0xcf, 0
-
-
-/*---------------------------------------------------------------------------+
-| Descriptor of GDT
-+--------------------------------------------------------------------------*/
-SYM (gdtdesc):
- .word (3*8 - 1)
- .long SYM (_Global_descriptor_table)
-
-
-/*---------------------------------------------------------------------------+
-| IDT itself
-+---------------------------------------------------------------------------*/
- .p2align 4
-
- PUBLIC(Interrupt_descriptor_table)
-SYM(Interrupt_descriptor_table):
- .rept 256
- .word 0,0,0,0
- .endr
-
-/*---------------------------------------------------------------------------+
-| Descriptor of IDT
-+--------------------------------------------------------------------------*/
-SYM(idtdesc):
- .word (256*8 - 1)
- .long SYM (Interrupt_descriptor_table)
-
-END_CODE
-
-END
diff --git a/c/src/lib/libbsp/i386/pc386/startup/linkcmds b/c/src/lib/libbsp/i386/pc386/startup/linkcmds
deleted file mode 100644
index 5dd7a675a3..0000000000
--- a/c/src/lib/libbsp/i386/pc386/startup/linkcmds
+++ /dev/null
@@ -1,87 +0,0 @@
-/*-------------------------------------------------------------------------+
-| linkcmds v1.1 - PC386 BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| This file contains directives for the GNU linker which are specific to the
-| PC386 bsp.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is based on:
-| linkcmds,v 1.3 1995/12/19 20:06:58 joel Exp - FORCE CPU386 BSP
-| With the following copyright notice:
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1998.
-| * On-Line Applications Research Corporation (OAR).
-| * Copyright assigned to U.S. Government, 1994.
-| *
-| * The license and distribution terms for this file may be
-| * found in found in the file LICENSE in this distribution or at
-| * http://www.OARcorp.com/rtems/license.html.
-| **************************************************************************
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-
-SECTIONS
-{
- .text :
- {
- _text_start = . ;
- *(.text)
- . = ALIGN (16);
-
- *(.eh_frame)
- . = ALIGN (16);
-
- *(.gnu.linkonce.t*)
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
-
- _rodata_start = . ;
- *(.rodata)
- *(.gnu.linkonce.r*)
- _erodata = ALIGN( 0x10 ) ;
-
- _etext = ALIGN( 0x10 ) ;
- }
- .data ADDR( .text ) + SIZEOF( .text ):
- {
- _data_start = . ;
- *(.data)
- *(.gnu.linkonce.d*)
- *(.gcc_except_table)
- _edata = ALIGN( 0x10 ) ;
- }
-
- .bss ADDR( .data ) + SIZEOF( .data ):
- {
- _bss_start = . ;
- *(.bss)
- *(COMMON)
- _end = . ;
- __end = . ;
- }
-}
diff --git a/c/src/lib/libbsp/i386/pc386/startup/sbrk.c b/c/src/lib/libbsp/i386/pc386/startup/sbrk.c
deleted file mode 100644
index 36f0573159..0000000000
--- a/c/src/lib/libbsp/i386/pc386/startup/sbrk.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-------------------------------------------------------------------------+
-| sbrk.c v1.1 - PC386 BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| If the BSP wants to dynamically allocate the memory for the C Library heap
-| (malloc) and/or be able to extend the heap, then this routine must be
-| functional. RTEMS newlib suppport has an implementation of malloc using
-| RTEMS regions => the user can do mallocs.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is based on:
-| sbrk.c,v 1.2 1995/12/19 20:07:38 joel Exp - go32 BSP
-| With the following copyright notice:
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1998.
-| * On-Line Applications Research Corporation (OAR).
-| * Copyright assigned to U.S. Government, 1994.
-| *
-| * The license and distribution terms for this file may be
-| * found in found in the file LICENSE in this distribution or at
-| * http://www.OARcorp.com/rtems/license.html.
-| **************************************************************************
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-
-#include <errno.h>
-#include <sys/types.h>
-
-/*-------------------------------------------------------------------------+
-| Function: sbrk
-| Description: Stub for sbrk.
-| Global Variables: None.
-| Arguments: Not relevant.
-| Returns: Not relevant.
-+--------------------------------------------------------------------------*/
-void *sbrk(size_t incr)
-{
- errno = EINVAL;
- return (void *)NULL;
-} /* sbrk */
diff --git a/c/src/lib/libbsp/i386/pc386/timer/Makefile.in b/c/src/lib/libbsp/i386/pc386/timer/Makefile.in
deleted file mode 100644
index 24809cbed8..0000000000
--- a/c/src/lib/libbsp/i386/pc386/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=timerisr
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i386/pc386/timer/timer.c b/c/src/lib/libbsp/i386/pc386/timer/timer.c
deleted file mode 100644
index 4c83b309dd..0000000000
--- a/c/src/lib/libbsp/i386/pc386/timer/timer.c
+++ /dev/null
@@ -1,394 +0,0 @@
-/*-------------------------------------------------------------------------+
-| timer.c v1.1 - PC386 BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| This file contains the PC386 timer package.
-+--------------------------------------------------------------------------+
-| NOTE: It is important that the timer start/stop overhead be determined
-| when porting or modifying this code.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is base on:
-| timer.c,v 1.7 1995/12/19 20:07:43 joel Exp - go32 BSP
-| With the following copyright notice:
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1998.
-| * On-Line Applications Research Corporation (OAR).
-| * Copyright assigned to U.S. Government, 1994.
-| *
-| * The license and distribution terms for this file may be
-| * found in found in the file LICENSE in this distribution or at
-| * http://www.OARcorp.com/rtems/license.html.
-| **************************************************************************
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-
-#include <stdlib.h>
-
-#include <bsp.h>
-#include <irq.h>
-
-/*-------------------------------------------------------------------------+
-| Constants
-+--------------------------------------------------------------------------*/
-#define AVG_OVERHEAD 0 /* 0.1 microseconds to start/stop timer. */
-#define LEAST_VALID 1 /* Don't trust a value lower than this. */
-#define SLOW_DOWN_IO 0x80 /* io which does nothing */
-
-#define TWO_MS (rtems_unsigned32)(2000) /* TWO_MS = 2000us (sic!) */
-
-#define MSK_NULL_COUNT 0x40 /* bit counter available for reading */
-
-#define CMD_READ_BACK_STATUS 0xE2 /* command read back status */
-/*-------------------------------------------------------------------------+
-| Global Variables
-+--------------------------------------------------------------------------*/
-volatile rtems_unsigned32 Ttimer_val;
- rtems_boolean Timer_driver_Find_average_overhead = TRUE;
- unsigned int loop1ms;
-
-/*-------------------------------------------------------------------------+
-| External Prototypes
-+--------------------------------------------------------------------------*/
-extern void timerisr(void);
- /* timer (int 08h) Interrupt Service Routine (defined in 'timerisr.s') */
-
-/*-------------------------------------------------------------------------+
-| Pentium optimized timer handling.
-+--------------------------------------------------------------------------*/
-#if defined(pentium)
-
-/*-------------------------------------------------------------------------+
-| Function: rdtsc
-| Description: Read the value of PENTIUM on-chip cycle counter.
-| Global Variables: None.
-| Arguments: None.
-| Returns: Value of PENTIUM on-chip cycle counter.
-+--------------------------------------------------------------------------*/
-static inline unsigned long long
-rdtsc(void)
-{
- /* Return the value of the on-chip cycle counter. */
- unsigned long long result;
- asm volatile(".byte 0x0F, 0x31" : "=A" (result));
- return result;
-} /* rdtsc */
-
-
-/*-------------------------------------------------------------------------+
-| Function: Timer_exit
-| Description: Timer cleanup routine at RTEMS exit. NOTE: This routine is
-| not really necessary, since there will be a reset at exit.
-| Global Variables: None.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void
-Timer_exit(void)
-{
-} /* Timer_exit */
-
-
-/*-------------------------------------------------------------------------+
-| Function: Timer_initialize
-| Description: Timer initialization routine.
-| Global Variables: Ttimer_val.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void
-Timer_initialize(void)
-{
- static rtems_boolean First = TRUE;
-
- if (First)
- {
- First = FALSE;
-
- atexit(Timer_exit); /* Try not to hose the system at exit. */
- }
- Ttimer_val = rdtsc(); /* read starting time */
-} /* Timer_initialize */
-
-
-/*-------------------------------------------------------------------------+
-| Function: Read_timer
-| Description: Read hardware timer value.
-| Global Variables: Ttimer_val, Timer_driver_Find_average_overhead.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-rtems_unsigned32
-Read_timer(void)
-{
- register rtems_unsigned32 total;
-
- total = (rtems_unsigned32)(rdtsc() - Ttimer_val);
-
- if (Timer_driver_Find_average_overhead)
- return total;
- else if (total < LEAST_VALID)
- return 0; /* below timer resolution */
- else
- return (total - AVG_OVERHEAD);
-} /* Read_timer */
-
-#else /* pentium */
-
-/*-------------------------------------------------------------------------+
-| Non-Pentium timer handling.
-+--------------------------------------------------------------------------*/
-#define US_PER_ISR 250 /* Number of micro-seconds per timer interruption */
-
-
-/*-------------------------------------------------------------------------+
-| Function: Timer_exit
-| Description: Timer cleanup routine at RTEMS exit. NOTE: This routine is
-| not really necessary, since there will be a reset at exit.
-| Global Variables: None.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-static void
-timerOff(const rtems_raw_irq_connect_data* used)
-{
- /*
- * disable interrrupt at i8259 level
- */
- BSP_irq_disable_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);
- /* reset timer mode to standard (DOS) value */
- outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
- outport_byte(TIMER_CNTR0, 0);
- outport_byte(TIMER_CNTR0, 0);
-} /* Timer_exit */
-
-
-static void
-timerOn(const rtems_raw_irq_connect_data* used)
-{
- /* load timer for US_PER_ISR microsecond period */
- outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
- outport_byte(TIMER_CNTR0, US_TO_TICK(US_PER_ISR) >> 0 & 0xff);
- outport_byte(TIMER_CNTR0, US_TO_TICK(US_PER_ISR) >> 8 & 0xff);
- /*
- * enable interrrupt at i8259 level
- */
- BSP_irq_enable_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);
-}
-
-static int
-timerIsOn(const rtems_raw_irq_connect_data *used)
-{
- return BSP_irq_enabled_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);}
-
-static rtems_raw_irq_connect_data timer_raw_irq_data = {
- BSP_PERIODIC_TIMER + BSP_IRQ_VECTOR_BASE,
- timerisr,
- timerOn,
- timerOff,
- timerIsOn
-};
-
-/*-------------------------------------------------------------------------+
-| Function: Timer_exit
-| Description: Timer cleanup routine at RTEMS exit. NOTE: This routine is
-| not really necessary, since there will be a reset at exit.
-| Global Variables: None.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void
-Timer_exit(void)
-{
- i386_delete_idt_entry (&timer_raw_irq_data);
-} /* Timer_exit */
-
-/*-------------------------------------------------------------------------+
-| Function: Timer_initialize
-| Description: Timer initialization routine.
-| Global Variables: Ttimer_val.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void
-Timer_initialize(void)
-{
- static rtems_boolean First = TRUE;
-
- if (First)
- {
- First = FALSE;
-
- atexit(Timer_exit); /* Try not to hose the system at exit. */
- if (!i386_set_idt_entry (&timer_raw_irq_data)) {
- printk("raw handler connexion failed\n");
- rtems_fatal_error_occurred(1);
- }
- }
- /* wait for ISR to be called at least once */
- Ttimer_val = 0;
- while (Ttimer_val == 0)
- continue;
- Ttimer_val = 0;
-} /* Timer_initialize */
-
-
-/*-------------------------------------------------------------------------+
-| Function: Read_timer
-| Description: Read hardware timer value.
-| Global Variables: Ttimer_val, Timer_driver_Find_average_overhead.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-rtems_unsigned32
-Read_timer(void)
-{
- register rtems_unsigned32 total, clicks;
- register rtems_unsigned8 lsb, msb;
-
- outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_LATCH);
- inport_byte(TIMER_CNTR0, lsb);
- inport_byte(TIMER_CNTR0, msb);
- clicks = (msb << 8) | lsb;
- total = (Ttimer_val * US_PER_ISR) + (US_PER_ISR - TICK_TO_US(clicks));
-
- if (Timer_driver_Find_average_overhead)
- return total;
- else if (total < LEAST_VALID)
- return 0; /* below timer resolution */
- else
- return (total - AVG_OVERHEAD);
-}
-
-#endif /* pentium */
-
-
-/*-------------------------------------------------------------------------+
-| Function: Empty_function
-| Description: Empty function used in time tests.
-| Global Variables: None.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-rtems_status_code Empty_function(void)
-{
- return RTEMS_SUCCESSFUL;
-} /* Empty function */
-
-
-/*-------------------------------------------------------------------------+
-| Function: Set_find_average_overhead
-| Description: Set internal Timer_driver_Find_average_overhead flag value.
-| Global Variables: Timer_driver_Find_average_overhead.
-| Arguments: find_flag - new value of the flag.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void
-Set_find_average_overhead(rtems_boolean find_flag)
-{
- Timer_driver_Find_average_overhead = find_flag;
-} /* Set_find_average_overhead */
-
-/*-------------------------------------------------------------------------+
-| Function: Calibrate_loop_1ms
-| Description: Set loop variable to calibrate a 1ms loop
-| Global Variables: loop1ms
-| Arguments: none
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void
-Calibrate_loop_1ms(void){
- unsigned int i;
- unsigned short loadedValue, offset;
- unsigned int timerValue;
- rtems_interrupt_level level;
- unsigned short lsb, msb;
- unsigned char status;
-
-
- loop1ms = 100 ;
- timerValue = 2000;
- loadedValue = US_TO_TICK(2000);
-
- rtems_interrupt_disable(level);
-
- /*
- * Compute the offset to apply due to read counter register
- */
- outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
- outport_byte(TIMER_CNTR0, loadedValue >> 0 & 0xff);
- outport_byte(TIMER_CNTR0, loadedValue >> 8 & 0xff);
-
- outport_byte(TIMER_MODE, CMD_READ_BACK_STATUS); /* read Status counter 0 */
- inport_byte(TIMER_CNTR0, status);
- while (status & MSK_NULL_COUNT){ /* wait for counter ready */
- outport_byte(TIMER_MODE, CMD_READ_BACK_STATUS);
- inport_byte(TIMER_CNTR0, status);
- }
-
- outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_LATCH);
- inport_byte(TIMER_CNTR0, lsb);
- inport_byte(TIMER_CNTR0, msb);
- offset = loadedValue - (unsigned short)((msb << 8) | lsb);
-
- while (timerValue > 1000){
- loop1ms++;
-
- /* load timer for 2ms+offset period */
- outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
- outport_byte(TIMER_CNTR0, (loadedValue+offset) >> 0 & 0xff);
- outport_byte(TIMER_CNTR0, (loadedValue+offset) >> 8 & 0xff);
-
- outport_byte(TIMER_MODE, CMD_READ_BACK_STATUS); /* read Status counter 0 */
- inport_byte(TIMER_CNTR0, status);
- while (status & MSK_NULL_COUNT) { /* wait for counter ready */
- outport_byte(TIMER_MODE, CMD_READ_BACK_STATUS);
- inport_byte(TIMER_CNTR0, status);
- }
-
- for (i=0; i<loop1ms; i++)
- outport_byte(SLOW_DOWN_IO, 0); /* write is # 1us */
-
- outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_LATCH);
- inport_byte(TIMER_CNTR0, lsb);
- inport_byte(TIMER_CNTR0, msb);
- timerValue = TICK_TO_US((msb << 8) | lsb);
- }
-
- rtems_interrupt_enable(level);
-}
-
-/*-------------------------------------------------------------------------+
-| Function: Wait_X_1ms
-| Description: loop which waits at least timeToWait ms
-| Global Variables: loop1ms
-| Arguments: timeToWait
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void
-Wait_X_ms( unsigned int timeToWait){
-
- unsigned int i, j;
-
- for (j=0; j<timeToWait ; j++)
- for (i=0; i<loop1ms; i++)
- outport_byte(SLOW_DOWN_IO, 0); /* write is # 1us */
-}
-
-
-
-
-
-
diff --git a/c/src/lib/libbsp/i386/pc386/timer/timerisr.s b/c/src/lib/libbsp/i386/pc386/timer/timerisr.s
deleted file mode 100644
index f6670efdc1..0000000000
--- a/c/src/lib/libbsp/i386/pc386/timer/timerisr.s
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-------------------------------------------------------------------------+
-| timerisr.s v1.1 - PC386 BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| This file contains the PC386 timer interrupt handler.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is base on:
-| timerisr.s,v 1.5 1995/12/19 20:07:45 joel Exp - go32 BSP
-| With the following copyright notice:
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1998.
-| * On-Line Applications Research Corporation (OAR).
-| * Copyright assigned to U.S. Government, 1994.
-| *
-| * The license and distribution terms for this file may be
-| * found in found in the file LICENSE in this distribution or at
-| * http://www.OARcorp.com/rtems/license.html.
-| **************************************************************************
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-
-#include "asm.h"
-
-BEGIN_CODE
-
- EXTERN(Ttimer_val)
-
-/*-------------------------------------------------------------------------+
-| Function: rtems_isr timerisr(rtems_vector_number);
-| Description: ISR for the timer. The timer is set up to generate an
-| interrupt at maximum intervals.
-| Global Variables: None.
-| Arguments: standard - see RTEMS documentation.
-| Returns: standard return value - see RTEMS documentation.
-+--------------------------------------------------------------------------*/
- PUBLIC(timerisr)
-SYM (timerisr):
- incl Ttimer_val # another tick
- pushl eax
- movb $0x20, al
- outb al, $0x20 # signal generic End Of Interrupt (EOI) to PIC
- popl eax
- iret
-
-END_CODE
-
-END
-
diff --git a/c/src/lib/libbsp/i386/pc386/times_i486dx b/c/src/lib/libbsp/i386/pc386/times_i486dx
deleted file mode 100644
index 49601b31d0..0000000000
--- a/c/src/lib/libbsp/i386/pc386/times_i486dx
+++ /dev/null
@@ -1,191 +0,0 @@
-#
-# Timing Test Suite Results for the go32 BSP using an i486DX
-#
-# $Id$
-#
-
-Board: PC/AT clone
-CPU: Intel i486DX
-Clock Speed: 33 Mhz
-Memory Configuration: DRAM w/256K cache
-Wait States: unknown
-
-Times Reported in: microseconds
-Timer Source: i8254
-
-Column A: 3.5.1 pre-release
-Column B: 3.5.17 pre-release
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 57 66
- rtems_semaphore_delete 59 61
- rtems_semaphore_obtain: available 9 7
- rtems_semaphore_obtain: not available -- NO_WAIT 8 7
- rtems_semaphore_release: no waiting tasks 9 8
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 39 37
-
- 3 rtems_semaphore_release: task readied -- preempts caller 25 24
-
- 4 rtems_task_restart: blocked task -- preempts caller 124 102
- rtems_task_restart: ready task -- preempts caller 55 111
- rtems_semaphore_release: task readied -- returns to caller 16 15
- rtems_task_create 31 30
- rtems_task_start 19 18
- rtems_task_restart: suspended task -- returns to caller 20 19
- rtems_task_delete: suspended task 28 26
- rtems_task_restart: ready task -- returns to caller 20 19
- rtems_task_restart: blocked task -- returns to caller 28 26
- rtems_task_delete: blocked task 34 28
-
- 5 rtems_task_suspend: calling task 26 23
- rtems_task_resume: task readied -- preempts caller 17 15
-
- 6 rtems_task_restart: calling task 22 19
- rtems_task_suspend: returns to caller 10 8
- rtems_task_resume: task readied -- returns to caller 10 8
- rtems_task_delete: ready task 34 33
-
- 7 rtems_task_restart: suspended task -- preempts caller 37 34
-
- 8 rtems_task_set_priority: obtain current priority 7 5
- rtems_task_set_priority: returns to caller 13 12
- rtems_task_mode: obtain current mode 3 3
- rtems_task_mode: no reschedule 4 4
- rtems_task_mode: reschedule -- returns to caller 20 17
- rtems_task_mode: reschedule -- preempts caller 39 37
- rtems_task_set_note 7 5
- rtems_task_get_note 7 5
- rtems_clock_set 17 16
- rtems_clock_get 2 1
-
- 9 rtems_message_queue_create 117 113
- rtems_message_queue_send: no waiting tasks 22 19
- rtems_message_queue_urgent: no waiting tasks 22 19
- rtems_message_queue_receive: available 18 16
- rtems_message_queue_flush: no messages flushed 15 14
- rtems_message_queue_flush: messages flushed 17 17
- rtems_message_queue_delete 63 63
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 10 8
- rtems_message_queue_receive: not available -- caller blocks 42 40
-
-11 rtems_message_queue_send: task readied -- preempts caller 38 37
-
-12 rtems_message_queue_send: task readied -- returns to caller 27 24
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 38 36
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 26 24
-
-15 rtems_event_receive: obtain current events 0 0
- rtems_event_receive: not available -- NO_WAIT 6 5
- rtems_event_receive: not available -- caller blocks 34 33
- rtems_event_send: no task readied 6 5
- rtems_event_receive: available 21 19
- rtems_event_send: task readied -- returns to caller 19 15
-
-16 rtems_event_send: task readied -- preempts caller 26 24
-
-17 rtems_task_set_priority: preempts caller 36 33
-
-18 rtems_task_delete: calling task 51 52
-
-19 rtems_signal_catch 17 18
- rtems_signal_send: returns to caller 38 39
- rtems_signal_send: signal to self 46 62
- exit ASR overhead: returns to calling task 20 25
- exit ASR overhead: returns to preempting task 29 29
-
-20 rtems_partition_create 65 67
- rtems_region_create 59 54
- rtems_partition_get_buffer: available 39 35
- rtems_partition_get_buffer: not available 18 16
- rtems_partition_return_buffer 36 30
- rtems_partition_delete 32 30
- rtems_region_get_segment: available 22 21
- rtems_region_get_segment: not available -- NO_WAIT 29 25
- rtems_region_return_segment: no waiting tasks 24 22
- rtems_region_get_segment: not available -- caller blocks 83 81
- rtems_region_return_segment: task readied -- preempts caller 85 84
- rtems_region_return_segment: task readied -- returns to caller 39 41
- rtems_region_delete 30 30
- rtems_io_initialize 1 1
- rtems_io_open 0 0
- rtems_io_close 0 0
- rtems_io_read 0 0
- rtems_io_write 0 0
- rtems_io_control 0 1
-
-21 rtems_task_ident 116 114
- rtems_message_queue_ident 113 111
- rtems_semaphore_ident 122 120
- rtems_partition_ident 113 110
- rtems_region_ident 115 111
- rtems_port_ident 113 109
- rtems_timer_ident 113 109
- rtems_rate_monotonic_ident 113 111
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 82 85
- rtems_message_queue_broadcast: no waiting tasks 11 9
- rtems_message_queue_broadcast: task readied -- preempts caller 51 56
-
-23 rtems_timer_create 8 7
- rtems_timer_fire_after: inactive 14 12
- rtems_timer_fire_after: active 13 12
- rtems_timer_cancel: active 8 7
- rtems_timer_cancel: inactive 7 6
- rtems_timer_reset: inactive 11 10
- rtems_timer_reset: active 11 11
- rtems_timer_fire_when: inactive 17 16
- rtems_timer_fire_when: active 17 17
- rtems_timer_delete: active 10 9
- rtems_timer_delete: inactive 9 8
- rtems_task_wake_when 36 34
-
-24 rtems_task_wake_after: yield -- returns to caller 5 3
- rtems_task_wake_after: yields -- preempts caller 22 19
-
-25 rtems_clock_tick 31 31
-
-26 _ISR_Disable 11 12
- _ISR_Flash 9 9
- _ISR_Enable 31 67
- _Thread_Disable_dispatch 11 10
- _Thread_Enable_dispatch 18 18
- _Thread_Set_state 20 22
- _Thread_Disptach (NO FP) 37 41
- context switch: no floating point contexts 29 26
- context switch: self 14 10
- context switch: to another task 12 12
- context switch: restore 1st FP task 54 54
- fp context switch: save idle, restore idle 47 46
- fp context switch: save idle, restore initialized 25 25
- fp context switch: save initialized, restore initialized 24 25
- _Thread_Resume 23 24
- _Thread_Unblock 14 14
- _Thread_Ready 16 24
- _Thread_Get 2 2
- _Semaphore_Get 1 1
- _Thread_Get: invalid id 0 0
-
-27 interrupt entry overhead: returns to interrupted task 25 23
- interrupt exit overhead: returns to interrupted task 14 15
- interrupt entry overhead: returns to nested interrupt 12 12
- interrupt exit overhead: returns to nested interrupt 14 14
- interrupt entry overhead: returns to preempting task 14 16
- interrupt exit overhead: returns to preempting task 42 38
-
-28 rtems_port_create 43 42
- rtems_port_external_to_internal 6 4
- rtems_port_internal_to_external 6 4
- rtems_port_delete 39 33
-
-29 rtems_rate_monotonic_create 48 42
- rtems_rate_monotonic_period: initiate period -- returns to caller 61 65
- rtems_rate_monotonic_period: obtain status 23 21
- rtems_rate_monotonic_cancel 38 35
- rtems_rate_monotonic_delete: inactive 32 32
- rtems_rate_monotonic_delete: active 22 22
- rtems_rate_monotonic_period: conclude periods -- caller blocks 24 19
diff --git a/c/src/lib/libbsp/i386/pc386/times_p5 b/c/src/lib/libbsp/i386/pc386/times_p5
deleted file mode 100644
index 977c4ec482..0000000000
--- a/c/src/lib/libbsp/i386/pc386/times_p5
+++ /dev/null
@@ -1,196 +0,0 @@
-#
-# Timing Test Suite Results for the go32 BSP using a Pentium
-#
-# $Id$
-#
-
-NOTE: To obtain the execution time in microseconds, divide the number of
- cycles by the clock speed. For example, if rtems_semaphore create
- is reported to be 1164 cycles, then at 66 Mhz it takes 17.64
- microseconds or 8.75 microseconds at 133 Mhz.
-
-Board: PC/AT clone
-CPU: Intel Pentium
-Clock Speed: 66 Mhz
-Memory Configuration: DRAM w/512 Kb cache
-Wait States: unknown
-
-Times Reported in: cycles
-Timer Source: on-CPU cycle counter
-
-Column A: 3.5.1 pre-release
-Column Y: unused
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 1164
- rtems_semaphore_delete 976
- rtems_semaphore_obtain: available 300
- rtems_semaphore_obtain: not available -- NO_WAIT 300
- rtems_semaphore_release: no waiting tasks 291
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 1182
-
- 3 rtems_semaphore_release: task readied -- preempts caller 716
-
- 4 rtems_task_restart: blocked task -- preempts caller 2130
- rtems_task_restart: ready task -- preempts caller 1861
- rtems_semaphore_release: task readied -- returns to caller 491
- rtems_task_create 1017
- rtems_task_start 965
- rtems_task_restart: suspended task -- returns to caller 816
- rtems_task_delete: suspended task 926
- rtems_task_restart: ready task -- returns to caller 850
- rtems_task_restart: blocked task -- returns to caller 1076
- rtems_task_delete: blocked task 927
-
- 5 rtems_task_suspend: calling task 714
- rtems_task_resume: task readied -- preempts caller 575
-
- 6 rtems_task_restart: calling task 646
- rtems_task_suspend: returns to caller 309
- rtems_task_resume: task readied -- returns to caller 320
- rtems_task_delete: ready task 994
-
- 7 rtems_task_restart: suspended task -- preempts caller 1025
-
- 8 rtems_task_set_priority: obtain current priority 223
- rtems_task_set_priority: returns to caller 468
- rtems_task_mode: obtain current mode 99
- rtems_task_mode: no reschedule 114
- rtems_task_mode: reschedule -- returns to caller 264
- rtems_task_mode: reschedule -- preempts caller 836
- rtems_task_set_note 236
- rtems_task_get_note 232
- rtems_clock_set 569
- rtems_clock_get 107
-
- 9 rtems_message_queue_create 3287
- rtems_message_queue_send: no waiting tasks 613
- rtems_message_queue_urgent: no waiting tasks 615
- rtems_message_queue_receive: available 534
- rtems_message_queue_flush: no messages flushed 252
- rtems_message_queue_flush: messages flushed 335
- rtems_message_queue_delete 1195
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 333
- rtems_message_queue_receive: not available -- caller blocks 1194
-
-11 rtems_message_queue_send: task readied -- preempts caller 957
-
-12 rtems_message_queue_send: task readied -- returns to caller 700
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 1261
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 697
-
-15 rtems_event_receive: obtain current events 27
- rtems_event_receive: not available -- NO_WAIT 226
- rtems_event_receive: not available -- caller blocks 888
- rtems_event_send: no task readied 221
- rtems_event_receive: available 393
- rtems_event_send: task readied -- returns to caller 496
-
-16 rtems_event_send: task readied -- preempts caller 719
-
-17 rtems_task_set_priority: preempts caller 959
-
-18 rtems_task_delete: calling task 1295
-
-19 rtems_signal_catch 223
- rtems_signal_send: returns to caller 628
- rtems_signal_send: signal to self 821
- exit ASR overhead: returns to calling task 401
- exit ASR overhead: returns to preempting task 482
-
-20 rtems_partition_create 1337
- rtems_region_create 1031
- rtems_partition_get_buffer: available 680
- rtems_partition_get_buffer: not available 303
- rtems_partition_return_buffer 617
- rtems_partition_delete 523
- rtems_region_get_segment: available 458
- rtems_region_get_segment: not available -- NO_WAIT 565
- rtems_region_return_segment: no waiting tasks 388
- rtems_region_get_segment: not available -- caller blocks 1683
- rtems_region_return_segment: task readied -- preempts caller 1476
- rtems_region_return_segment: task readied -- returns to caller 818
- rtems_region_delete 477
- rtems_io_initialize 48
- rtems_io_open 22
- rtems_io_close 22
- rtems_io_read 22
- rtems_io_write 22
- rtems_io_control 23
-
-21 rtems_task_ident 3381
- rtems_message_queue_ident 3328
- rtems_semaphore_ident 3593
- rtems_partition_ident 3286
- rtems_region_ident 3343
- rtems_port_ident 3278
- rtems_timer_ident 3282
- rtems_rate_monotonic_ident 3287
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 1322
- rtems_message_queue_broadcast: no waiting tasks 347
- rtems_message_queue_broadcast: task readied -- preempts caller 1385
-
-23 rtems_timer_create 306
- rtems_timer_fire_after: inactive 475
- rtems_timer_fire_after: active 475
- rtems_timer_cancel: active 277
- rtems_timer_cancel: inactive 251
- rtems_timer_reset: inactive 391
- rtems_timer_reset: active 465
- rtems_timer_fire_when: inactive 577
- rtems_timer_fire_when: active 578
- rtems_timer_delete: active 377
- rtems_timer_delete: inactive 350
- rtems_task_wake_when 1080
-
-24 rtems_task_wake_after: yield -- returns to caller 159
- rtems_task_wake_after: yields -- preempts caller 574
-
-25 rtems_clock_tick 505
-
-26 _ISR_Disable 33
- _ISR_Flash 33
- _ISR_Enable 26
- _Thread_Disable_dispatch 36
- _Thread_Enable_dispatch 240
- _Thread_Set_state 315
- _Thread_Disptach (NO FP) 623
- context switch: no floating point contexts 594
- context switch: self 89
- context switch: to another task 122
- context switch: restore 1st FP task 1043
- fp context switch: save idle, restore idle 978
- fp context switch: save idle, restore initialized 390
- fp context switch: save initialized, restore initialized 392
- _Thread_Resume 238
- _Thread_Unblock 171
- _Thread_Ready 176
- _Thread_Get 71
- _Semaphore_Get 61
- _Thread_Get: invalid id 10
-
-27 interrupt entry overhead: returns to interrupted task 391
- interrupt exit overhead: returns to interrupted task 110
- interrupt entry overhead: returns to nested interrupt 167
- interrupt exit overhead: returns to nested interrupt 120
- interrupt entry overhead: returns to preempting task 193
- interrupt exit overhead: returns to preempting task 961
-
-28 rtems_port_create 668
- rtems_port_external_to_internal 215
- rtems_port_internal_to_external 211
- rtems_port_delete 491
-
-29 rtems_rate_monotonic_create 823
- rtems_rate_monotonic_period: initiate period -- returns to caller 1094
- rtems_rate_monotonic_period: obtain status 345
- rtems_rate_monotonic_cancel 602
- rtems_rate_monotonic_delete: inactive 553
- rtems_rate_monotonic_delete: active 528
- rtems_rate_monotonic_period: conclude periods -- caller blocks 672
diff --git a/c/src/lib/libbsp/i386/pc386/tools/Makefile.in b/c/src/lib/libbsp/i386/pc386/tools/Makefile.in
deleted file mode 100644
index 0924a4afca..0000000000
--- a/c/src/lib/libbsp/i386/pc386/tools/Makefile.in
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
-includedir = @includedir@
-manext = 1
-mandir = @mandir@/man$(manext)
-
-
-VPATH=@srcdir@
-
-
-# we use host compiler in this directory
-USE_HOST_COMPILER=yes
-
-# C source names, if any, go here -- minus the .c
-C_PIECES= bin2boot binpatch
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=$(ARCH)/%.o)
-
-CC_PIECES=
-CC_FILES=$(CC_PIECES:%=%.cc)
-CC_O_FILES=$(CC_PIECES:%=$(ARCH)/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-PGMS=$(ARCH)/bin2boot $(ARCH)/binpatch
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += -g -Wall
-CXXFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS += -g
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(HOST_ARCH)
-CLOBBER_ADDITIONS +=
-
-all: $(ARCH) $(SRCS) $(PGMS)
- $(INSTALL) -m 555 $(PGMS) ${PROJECT_RELEASE}/build-tools
-
-$(ARCH)/bin2boot: $(srcdir)/bin2boot.c
- $(CC) $(LDFLAGS) -o $@ $(srcdir)/bin2boot.c $(LD_LIBS)
-
-$(ARCH)/binpatch: $(srcdir)/binpatch.c
- $(CC) $(LDFLAGS) -o $@ $(srcdir)/binpatch.c $(LD_LIBS)
-
-
diff --git a/c/src/lib/libbsp/i386/pc386/tools/Spec.doc b/c/src/lib/libbsp/i386/pc386/tools/Spec.doc
deleted file mode 100644
index ea66a7eb3d..0000000000
--- a/c/src/lib/libbsp/i386/pc386/tools/Spec.doc
+++ /dev/null
@@ -1,357 +0,0 @@
-#
-# $Id$
-#
-
- 2-28-1995 GK
-
-In order to provide more functionality to the boot rom code I changed
-Jamie's draft a little bit. All my changes have a bar sign (|) in the
-79th column.
-
-Gero Kuhlmann
-
-===============================================================================
-
-
-0. Numbering
-
-This is Draft Net Boot Image Proposal 0.2, February 28, 1995 |
-
-
-1. Preamble - the why
-
-Whilst researching what other boot proms do (at least those implementing
-TCP/IP protocols) it is clear that each 'does their own thing' in
-terms of what they expect in a boot image.
-
-If we could all agree on working toward an open standard, O/S suppliers
-and boot rom suppliers can build their products to this norm, and be confident
-that they will work with each other.
-
-This is a description of how I will implement the boot rom for
-Linux. I believe it to be flexible enough for any OS that will be loaded
-when a PC boots from a network in the TCP/IP environment.
-
-It would be good if this could be turned into some form of standard.
-
-This is very much a first draft. I am inviting comment.
-
-The ideas presented here should be independant of any implementation.
-In the end, where there is a conflict between the final of this draft, and an
-implementation, this description should prevail.
-
-The terms I use are defined at the end.
-
-
-2. The target
-
-The target is to have a PC retrieve a boot image from a network in the TCP/IP
-environment.
-
-The boot may take place from a network adaptor rom, from a boot floppy, or
-from a program in MSDOS.
-
-
-3. Net Boot Process Description.
-
-The net boot process can be started either as a result of the PC
-boot process, or through normal DOS execution of a program. The net boot
-program can reside on a rom, e.g. on an adaptor card, or in ram, either
-as a result of reading off disk or transferred from ram.
-
-The boot process may execute in any mode (e.g. 8086, 80386) it desires.
-When it jumps to the start location in the boot image, it must be in
-8086 mode and be capable of going into any mode supported by the
-underlying processor.
-
-The image cannot be loaded into address spaces below 10000h, or between
-A0000h through FFFFFh, or between 98000h through 9FFFFh. Once the image
-starts executing, all the memory is available to it, so it can relocate
-parts of itself to these areas.
-
-The boot process must be capable of loading the image into all other
-memory locations. Specifically, where the machine supports this, this means
-memory over 100000h.
-
-The net boot process must execute the bootp protocol, followed by
-the tftp protocol, as defined in the relevant rfc's.
-
-The file name used in the tftp protocol must be that given by the bootp
-record.
-
-If less than 512 bytes are loaded, the net boot process attempts to display
-on the screen any ascii data at the start of the image. The net boot
-process then exits in the normal manner. For a boot prom, this will
-allow normal disk booting. For DOS programs, this will mean a normal return
-to DOS.
-
-When the first 512 bytes have been loaded, the boot process checks
-for an initial magic number, which is defined later. If this number
-is present, the net process continues loading under the control
-of the image format. The image, which is described later, tells the
-net boot process where to put this record and all subsequent data.
-
-If no initial magic number is present the net boot process checks for a second
-magic number at offset 510. If the magic number 510 = 55h, 511 = AAh,
-then the net process continues. If this second magic number is not
-present, then the net boot process terminates the tftp protocol, displays
-an error message and exits in the normal manner.
-
-If no initial magic number is present and the second one is, the net boot
-process relocates the 512 bytes to location 7c00h. The net boot process
-continues to load any further image data to 10000h up. This data can overwrite
-the first 512 boot bytes. If the image reaches 98000h, then any further data is
-continued to be loaded above 100000h. When all the data has been loaded, the
-net boot process jumps to location 0:7c00.
-
-When the net boot process calls the image, it places 2 far pointers onto |
-the stack, in standard intel order (e.g. segment:offset representation). |
-The first far pointer which immediately follows the return address on |
-the stack, points to the loaded boot image header. The second far pointer |
-which is placed above the first one, shows to the memory area where the |
-net boot process saved the bootp reply. |
-
-
-4. Image Format with Initial Magic Number.
-
-The first 512 bytes of the image file contain the image header,
-and image loading information records. This contains all the
-information needed by the net boot process as to where data
-is to be loaded.
-
-The magic number (in time-honoured tradition (well why not?)) is:
-
- 0 = 36h
- 1 = 13h
- 2 = 03h
- 3 = 1Bh
-
-Apart from the two magic numbers, all words and double words are in PC
-native endian.
-
-Including the initial magic number the header record is:
-
- +---------------------+
- | |
- | Initial Magic No. | 4 bytes
- +---------------------+
- | |
- | Flags and length | double word
- +---------------------+
- | |
- | Location Address | double word in ds:bx format
- +---------------------+
- | |
- | Execute Address | double word in cs:ip format
- +---------------------+
-
-The Location address is where to place the 512 bytes. The net boot
-process does this before loading the rest of the image. The location
-address cannot be one of the reserved locations mentioned above, but
-must be an address lower than 100000h.
-
-The rest of the image must not overwrite these initial 512 bytes, placed
-at the required location. The writing of data by the net boot process
-into these 512 bytes is deprecated. These 512 bytes must be available for
-the image to interogate once it is loaded and running.
-
-The execute address is the location in cs:ip of the initial instruction
-once the full image has been loaded. This must be lower than 100000h,
-since the initial instructions will be executed in 8086 mode. When the
-jump (actaully a far call) is made to the boot image, the stack contains a
-far return address, with a far pointer parameter above that, pointing
-to the location of this header.
-
-The flags and length field is broken up in the following way:
-
-Bits 0 to 3 (lowest 4 bits) define the length of the non vendor header in
-double words. Currently the value is 4.
-
-Bits 4 to 7 define the length required by the vendor extra information
-in double words. A value of zero indicates no extra vendor information.
-
-Bits 8 to 31 are reserved for future use and must be set to zero.
-
-After this header, and any vendor header, come the image loading information
-records. These specify where data is to be loaded, how long it is, and
-communicates to the loaded image what sort of data it is.
-
-The format of each image loading information record is :
-
-
- +---------------------+
- | Flags, tags and | double word
- | lengths |
- +---------------------+
- | |
- | Load Address | double word
- +---------------------+
- | |
- | Image Length | double word
- +---------------------+
- | |
- | Memory Length | double word
- +---------------------+
-
-Each image loading information record follows the previous, or the header.
-
-The memory length, image length and load address fields are unsigned 32
-numbers. They do not have the segment:offset format used by the 8086.
-
-The flags, tags and lengths field is broken up as follows:
-
-Bits 0 to 3 (lowest 4 bits) are the length of the non vendor part of this
-header in double words. Currently this value is 4.
-
-Bits 4 to 7 indicate the length of any vendor information, in double words.
-
-Bits 8 to 15 are for vendor's tags. The vendor tag is a private number that
-the loaded image can use to determine what sort of image is at this particular
-location.
-
-Bits 16 to 23 are for future expansion and should be set to zero.
-
-Bits 24 to 31 are for flags, which are defined later.
-
-Vendors may place further information after this information record, and
-before the next. Each information record may have a different vendor
-length.
-
-There are two restrictions on vendor information.
-
-One is that the header and all information records that the net boot process
-is to use fall within the first 512 bytes.
-
-The second restriction is that the net boot process must ignore all
-vendor additions. The net boot process may not overwrite vendor supplied
-information, or other undefined data in the initial 512 bytes.
-
-The flags are used to modify the load address field, and to indicate
-that this is the last information record that the net boot process should
-use.
-
-Bit 24 works in conjunction with bit 25 to specify the meaning of the
-load address.
-
- B24 B25
-
- 0 0 load address is an absolute 32 number
-
- 1 0 add the load address to the location one past the last byte
- of the memory area required by the last image loaded.
- If the first image, then add to 512 plus the location
- where the 512 bytes were placed
-
- 0 1 subtract the load address from the one past the
- last writeable location in memory. Thus 1 would
- be the last location one could write in memory.
-
- 1 1 load address is subtracted from the start of
- the last image loaded. If the first image, then
- subtract from the start of where the 512 bytes were
- placed
-
-(For convenience bit 24 is byte 0 of the flag field)
-
-Bit 26 is the end marker for the net boot process. It is set when
-this is the last information record the net boot process should
-look at. More records may be present, but the net boot process will not
-look at them. (Vendors can continue information records out past the 512
-boundary for private use in this manner).
-
-The image length tells the net boot process how many bytes are to be loaded.
-Zero is a valid value. This can be used to mark memory areas such as
-shared memory for interprocessor communication, flash eproms, data in eproms.
-
-The image length can also be different from the memory length. This allows
-decompression programs to fluff up the kernel image. It also allows a file
-system to be larger then the loaded file system image.
-
-Bits 27 through 31 are not defined as yet and must be set to zero until
-they are.
-
-
-6. Boot prom entry points.
-
-I have not defined boot entry points, and means of obtaining them.
-It could be useful to down load part of an image, and have that image
-load more of itself by using handy parts of the net boot program.
-
-This can be considered 'for further study'.
-
-
-7. Example of a boot image.
-
-Here is an example of how the boot image would look for Linux:
-
- 0x1B031336, /* magic number */
- 0x4, /* length of header is 16 bytes, no vendor info */
- 0x90000000, /* location in ds:bx format */
- 0x90000200, /* execute address in cs:ip format */
-
- /* 2048 setup.S bytes */
- 0x4, /* flags, not end, absolute address, 16 bytes this
- record, no vendor info */
- 0x90200, /* load address - note format */
- 0x800, /* 4 8 512 byte blocks for linux */
- 0x800,
-
- /* kernel image */
- 0x4, /* flags, not end, absolute address, 16 bytes this
- record, no vendor info */
- 0x10000, /* load address - note format */
- 0x80000, /* 512K (this could be shorter */
- 0x80000,
-
- /* ramdisk for root file system */
- 0x04000004, /* flags = last, absolute address, 16 bytes this
- record, no vendor info *//
- 0x100000, /* load address - in extended memory */
- 0x80000, /* 512K for instance */
- 0x80000,
-
- /* Then follows linux specific information */
-
-
-8. Terms
-
-When I say 'the net boot process', I mean the act of loading the image into
-memory, setting up any tables, up until the jump to the required location
-in the image.
-
-The net booting program executes the net boot process. The net boot program
-may be a rom, but not neccassarily. It is a set of instructions and data
-residing on the booting machine.
-
-The image, or boot image, consists of the data loaded by the net boot process.
-
-When I say 'the PC boot process', I mean the general PC rom bios boot process,
-the setting up of hardware, the scanning for adaptor roms, the execution
-of adaptor roms, the loading in of the initial boot track. The PC boot
-process will include the net boot process, if one is present.
-
-When I say client, I mean the PC booting up.
-
-When I say 'image host', I mean the host where the boot image is comming from.
-This may not have the same architecture as the client.
-
-The bootp protocol is defined in RFC951 and RFC1084. The tftp protocol
-is defined in RFC783. These are available on many sites.
-See Comer 1991 for details on how to obtain them.
-
-A bootp server is the machine that answers the bootp request. It is not
-neccassarily the image host.
-
-'Can' and 'may' means doesn't have to, but is allowed to and might.
-'Must' means just that. 'Cannot' means must not.
-
-
-9 References
-
-Comer, D.E. 1991, Internetworking with TCP/IP Vol I: Principles, Protocols,
-and Architecture Second Edition, Prentice Hall, Englewood Cliffs, N.J., 1991
-
-Stevens, W.R 1990, Unix Network Programming, Prentice Hall,
-Englewood Cliffs, N.J., 1990
-
-
diff --git a/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c b/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c
deleted file mode 100644
index a47ca2cee3..0000000000
--- a/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c
+++ /dev/null
@@ -1,414 +0,0 @@
-
-/*
- * Simplyfied version of original bin2boot
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <memory.h>
-
-
-static unsigned char buf[512];
-
-static void usage(void)
-{
- printf("usage: bin2boot [-h][-v] <outFile> <headerAddr> \n");
- printf("<imFile1> <imAddr1> <imSize1> [<imFile2> <imAddr2> <imSize2>]\n");
- printf("this function makes image bootable by netboot\n");
- printf("from one or two binary images\n");
- printf("-h - prints this message\n");
- printf("-v - verbose output\n");
- printf("outFile - output file\n");
- printf("headerAddr - address to place header in memory\n");
- printf(" it should be below or equal 0x97e00\n");
- printf("imFile1 - first image\n");
- printf("imAddr1 - its start address, image has to be placed whole\n");
- printf(" below 0x98000 and should not overlap with header\n");
- printf("imSize1 - actual size of compressed image, 0 for uncompressed\n");
- printf("imFile2 - second image\n");
- printf("imAddr2 - its start address\n");
- printf("imSize2 - actual size of compressed image, 0 for uncompressed\n");
-
- return;
-}
-
-
-int main(int argc, char* argv[])
-{
- int c, verbose;
- extern int optind;
- FILE *ofp, *ifp;
- unsigned long headerAddr, addr1, addr2;
- int size1, size2, len1, len2, len, imageCnt, cnt;
- char *ofile, *ifile, *end;
-
- verbose = 0;
-
- /* parse command line options */
- while ((c = getopt(argc, argv, "hv")) >= 0)
- {
- switch (c)
- {
- case 'v':
- verbose = 1;
- break;
- case 'h':
- usage();
- return 0;
- default:
- usage();
- return 1;
- }
- }
-
- if((argc - optind) != 8 && (argc - optind) != 5)
- {
- usage();
- return 1;
- }
-
- ofile = argv[optind];
- ofp = fopen(ofile, "w");
- if(ofp == NULL)
- {
- fprintf(stderr, "unable to open file %s\n", ofile);
- return 1;
- }
-
- /*
- * Layout is very simple first 512 is header shared by all
- * images, then images at 512 bytes border
- */
-
- /* Fill buffer with 0's */
- memset(buf, 0, sizeof(buf));
-
- fwrite(buf, 1, sizeof(buf), ofp);
-
- optind++;
- headerAddr = strtoul(argv[optind], &end, 0);
- if(end == argv[optind])
- {
- fprintf(stderr, "bad headerAddr %s\n", argv[optind]);
- fclose(ofp);
- return 1;
- }
-
- if(headerAddr > 0x97e00)
- {
- fprintf(stderr, "headerAddr is too high 0x%08lx\n", headerAddr);
- fclose(ofp);
- return 1;
- }
-
- /* Copy the first image */
- optind++;
- ifile = argv[optind];
- ifp = fopen(ifile,"r");
- if(ifp == NULL)
- {
- fprintf(stderr, "unable to open output file %s\n", ifile);
- fclose(ofp);
- return 1;
- }
-
- optind++;
- addr1 = strtoul(argv[optind], &end, 0);
- if(end == argv[optind])
- {
- fprintf(stderr, "bad image address %s\n", argv[optind]);
- fclose(ofp);
- return 1;
- }
-
- optind++;
- size1 = strtoul(argv[optind], &end, 0);
- if(end == argv[optind])
- {
- fprintf(stderr, "bad image size %s\n", argv[optind]);
- fclose(ofp);
- return 1;
- }
-
-
- /* Copy first image out and remember its length */
- cnt = 0;
- for(;;)
- {
- len = fread(buf, 1, sizeof(buf), ifp);
-
- if(len != 0)
- {
- fwrite(buf, 1, len, ofp);
- cnt += sizeof(buf);
-
- if(len != sizeof(buf))
- {
- memset(buf, 0, sizeof(buf) - len);
- fwrite(buf, 1, sizeof(buf) - len, ofp);
- break;
- }
-
- }
- else
- {
- break;
- }
- }
-
- fclose(ifp);
-
- len1 = cnt;
-
- if(size1 == 0)
- {
- size1 = cnt;
- }
- else
- {
- memset(buf, 0, sizeof(buf));
-
- while(cnt < size1)
- {
- fwrite(buf, 1, sizeof(buf), ofp);
- cnt += sizeof(buf);
- }
-
- size1 = cnt;
- }
-
-
- /* Let us check agains overlapping */
- if(!(addr1 >= (headerAddr + sizeof(buf)) || (headerAddr >= addr1+size1)))
- {
- /* Areas overlapped */
- printf("area overlapping: \n");
- printf("header address 0x%08lx, its memory size 0x%08x\n",
- headerAddr, sizeof(buf));
- printf("first image address 0x%08lx, its memory size 0x%08x\n",
- addr1, size1);
-
- fclose(ofp);
- return 1;
- }
-
- if((addr1 + size1) > 0x98000)
- {
- fprintf(stderr, "imAddr1 is too high 0x%08lx\n", addr1);
- fclose(ofp);
- return 1;
- }
-
-
- if(optind == (argc - 1))
- {
- imageCnt = 1;
- goto writeHeader;
- }
-
- imageCnt = 2;
-
- /* Copy Second Image */
- optind++;
- ifile = argv[optind];
- ifp = fopen(ifile,"r");
- if(ifp == NULL)
- {
- fprintf(stderr, "unable to open output file %s\n", ifile);
- fclose(ofp);
- return 1;
- }
-
- optind++;
- addr2 = strtoul(argv[optind], &end, 0);
- if(end == argv[optind])
- {
- fprintf(stderr, "bad image address %s\n", argv[optind]);
- fclose(ofp);
- return 1;
- }
-
- optind++;
- size2 = strtoul(argv[optind], &end, 0);
- if(end == argv[optind])
- {
- fprintf(stderr, "bad image size %s\n", argv[optind]);
- fclose(ofp);
- return 1;
- }
-
- /* Copy second image out and remember its length */
- cnt = 0;
- for(;;)
- {
- len = fread(buf, 1, sizeof(buf), ifp);
-
- if(len != 0)
- {
- fwrite(buf, len, 1, ofp);
- cnt += sizeof(buf);
-
- if(len != sizeof(buf))
- {
- memset(buf, 0, sizeof(buf) - len);
- fwrite(buf, 1, sizeof(buf) - len, ofp);
- break;
- }
- }
- else
- {
- break;
- }
- }
-
- fclose(ifp);
-
- len2 = cnt;
-
- if(size2 == 0)
- {
- size2 = cnt;
- }
- else
- {
- memset(buf, 0, sizeof(buf));
-
- while(cnt < size2)
- {
- fwrite(buf, 1, sizeof(buf), ofp);
- cnt += sizeof(buf);
- }
-
- size2 = cnt;
- }
-
- /* Let us check against overlapping */
- if(!((addr2 >= (addr1 + size1) && addr2 >= (headerAddr + sizeof(buf))) ||
- (addr2 < addr1 && addr2 < headerAddr) ||
- (addr1 > headerAddr && addr2 > (headerAddr + sizeof(buf)) &&
- (addr2 + size2) <= addr1) ||
- (addr1 < headerAddr && addr2 > (addr1 + size1) &&
- (addr2 + size2) <= headerAddr)))
-
- {
- /* Areas overlapped */
- printf("area overlapping: \n");
- printf("header address 0x%08lx, its memory size 0x%08x\n",
- headerAddr, sizeof(buf));
- printf("first image address 0x%08lx, its memory size 0x%08x\n",
- addr1, size1);
- printf("second image address 0x%08lx, its memory size 0x%08x\n",
- addr2, size2);
-
- fclose(ofp);
- return 1;
- }
-
-writeHeader:
-
- /* We know everything so it is time to write buffer */
- memset(buf, 0, 0x30);
-
- buf[0x0] = 0x36;
- buf[0x1] = 0x13;
- buf[0x2] = 0x03;
- buf[0x3] = 0x1b;
-
- buf[0x4] = 4;
-
- /* Header address in ds:bx format */
- buf[0x8] = headerAddr & 0xf;
- buf[0x9] = 0;
- buf[0xa] = (headerAddr >> 4) & 0xff;
- buf[0xb] = (headerAddr >> 12) & 0xff;
-
- /*
- * Execute address in cs:ip format, which addr1
- */
- buf[0xc] = addr1 & 0xf;
- buf[0xd] = 0;
- buf[0xe] = (addr1 >> 4) & 0xff;
- buf[0xf] = (addr1 >> 12) & 0xff;
-
- /* Flags, tags and lengths */
- buf[0x10] = 4;
-
- if(imageCnt == 1)
- {
- buf[0x13] = 4;
- }
-
- /* Load address */
- buf[0x14] = addr1 & 0xff;
- buf[0x15] = (addr1 >> 8) & 0xff;
- buf[0x16] = (addr1 >> 16) & 0xff;
- buf[0x17] = (addr1 >> 24) & 0xff;
-
- /* Image Length */
- buf[0x18] = len1 & 0xff;
- buf[0x19] = (len1 >> 8) & 0xff;
- buf[0x1a] = (len1 >> 16) & 0xff;
- buf[0x1b] = (len1 >> 24) & 0xff;
-
- /* Memory Size */
- buf[0x1c] = size1 & 0xff;
- buf[0x1d] = (size1 >> 8) & 0xff;
- buf[0x1e] = (size1 >> 16) & 0xff;
- buf[0x1f] = (size1 >> 24) & 0xff;
-
- if(imageCnt != 1)
- {
-
- /* Flags, tags and lengths */
- buf[0x20] = 4;
-
- buf[0x23] = 4;
-
-
- /* Load address */
- buf[0x24] = addr2 & 0xff;
- buf[0x25] = (addr2 >> 8) & 0xff;
- buf[0x26] = (addr2 >> 16) & 0xff;
- buf[0x27] = (addr2 >> 24) & 0xff;
-
- /* Image Length */
- buf[0x28] = len2 & 0xff;
- buf[0x29] = (len2 >> 8) & 0xff;
- buf[0x2a] = (len2 >> 16) & 0xff;
- buf[0x2b] = (len2 >> 24) & 0xff;
-
- /* Memory Size */
- buf[0x2c] = size2 & 0xff;
- buf[0x2d] = (size2 >> 8) & 0xff;
- buf[0x2e] = (size2 >> 16) & 0xff;
- buf[0x2f] = (size2 >> 24) & 0xff;
- }
-
- rewind(ofp);
-
- fwrite(buf, 1, 0x30, ofp);
-
- fclose(ofp);
-
- if(verbose)
- {
- printf("header address 0x%08lx, its memory size 0x%08x\n",
- headerAddr, sizeof(buf));
- printf("first image address 0x%08lx, its memory size 0x%08x\n",
- addr1, size1);
- printf("second image address 0x%08lx, its memory size 0x%08x\n",
- addr2, size2);
- }
-
- return 0;
-}
-
-
-
-
-
-
-
-
-
diff --git a/c/src/lib/libbsp/i386/pc386/tools/binpatch.c b/c/src/lib/libbsp/i386/pc386/tools/binpatch.c
deleted file mode 100644
index ab0900702a..0000000000
--- a/c/src/lib/libbsp/i386/pc386/tools/binpatch.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * $Id$
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-
-/*
- * This function will patch binary file
- */
-
-
-static char buf[512];
-
-static void
-usage(void)
-{
- printf("usage: binpatch [-h] <ofile> <ifile> <reloc> <off> <byte0> "
- "[<byte1> [<byte2> [<byte3>]]]\n");
- printf("this function patches binary file at specified offset with\n");
- printf("up to 4 bytes provided on command line \n");
- printf("-h - prints this message\n\n");
- printf("<ofile> - output file\n");
- printf("<ifile> - input ifile\n");
- printf("<reloc> - relocation address of image\n");
- printf("<off> - offset of patch, offset in file is at off - reloc\n");
- printf("<byte0> - byte 0 of patch\n");
- printf("<byte1> - byte 1 of patch\n");
- printf("<byte2> - byte 1 of patch\n");
- printf("<byte3> - byte 1 of patch\n");
-
- return;
-}
-
-int
-main(int argc, char **argv)
-{
- int c;
- FILE *ofp, *ifp;
- char patch[4], *end;
- int patchLen, tmp, i, off, cnt, patched, len, reloc;
-
-
- /* parse command line options */
- while ((c = getopt(argc, argv, "h")) >= 0)
- {
- switch (c)
- {
- case 'h':
- usage();
- return 0;
- default:
- usage();
- return 1;
- }
- }
-
- if(argc < 6)
- {
- usage();
- return 1;
- }
-
- /* Let us get offset in file */
- reloc = strtol(argv[3], &end, 0);
- if(end == argv[3] || off < 0)
- {
- fprintf(stderr, "bad reloc value %s\n", argv[3]);
- return 1;
- }
-
- off = strtol(argv[4], &end, 0);
- if(end == argv[4] || off < 0 || off < reloc)
- {
- fprintf(stderr, "bad offset value %s\n", argv[4]);
- return 1;
- }
-
- off -= reloc;
-
- /* Let us get patch */
- patchLen = argc - 5;
-
- for(i=0; i<patchLen; i++)
- {
- tmp = strtol(argv[5+i], &end, 0);
-
- if(end == argv[4+i] || tmp < 0 || tmp > 0xff)
- {
- fprintf(stderr, "bad byte value %s\n", argv[5+i]);
- return 1;
- }
- patch[i] = tmp;
- }
-
- ifp = fopen(argv[2], "r");
- if(ifp == NULL)
- {
- fprintf(stderr, "unable to open file %s\n", argv[2]);
- return 1;
- }
-
- ofp = fopen(argv[1], "w");
- if(ofp == NULL)
- {
- fprintf(stderr, "unable to open file %s\n", argv[1]);
- return 1;
- }
-
- cnt = 0;
- patched = 0;
- for(;;)
- {
- len = fread(buf, 1, sizeof(buf), ifp);
-
- if(len == 0)
- {
- break;
- }
-
- if(cnt <= off && (cnt + len) > off)
- {
- /* Perform patch */
- for(i=0; i<patchLen && (off+i)<(cnt+len); i++)
- {
- buf[off-cnt+i] = patch[i];
- }
- patched = 1;
- }
- else if(cnt > off && cnt < (off + patchLen))
- {
- /* Perform patch */
- for(i=cnt-off; i<patchLen; i++)
- {
- buf[off-cnt+i] = patch[i];
- }
- patched = 1;
- }
-
- fwrite(buf, 1, len, ofp);
-
- cnt += len;
- }
-
- fclose(ifp);
- fclose(ofp);
-
- if(!patched)
- {
- fprintf(stderr, "warning: offset is beyond input file length\n");
- fprintf(stderr, " no patch is performed\n");
- }
-
- return 0;
-}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in b/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in
deleted file mode 100644
index 86462939cf..0000000000
--- a/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# We only build the Network library if HAS_NETWORKING was defined
-NETWORK_yes_V = network
-NETWORK = $(NETWORK_$(HAS_NETWORKING)_V)
-
-BSP_PIECES=startup clock console timer $(NETWORK)
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-# we create here a directory specific to the PC386 BSP to store the BootImage
-# files so they can be easily found
- mkdir -p ${PROJECT_RELEASE}/BootImgs
-
-
-
-
diff --git a/c/src/lib/libbsp/i386/shared/Makefile.in b/c/src/lib/libbsp/i386/shared/Makefile.in
deleted file mode 100644
index cee2697aae..0000000000
--- a/c/src/lib/libbsp/i386/shared/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# Descend into the $(RTEMS_BSP_FAMILY) directory
-SUB_DIRS=irq io comm pci
-
diff --git a/c/src/lib/libbsp/i386/shared/comm/GDB.HOWTO b/c/src/lib/libbsp/i386/shared/comm/GDB.HOWTO
deleted file mode 100644
index 0fdfad02ea..0000000000
--- a/c/src/lib/libbsp/i386/shared/comm/GDB.HOWTO
+++ /dev/null
@@ -1,177 +0,0 @@
-1. Add GDB initilization to your target's code:
-
-a) include file:
-
-#include <uart.h>
-
-b) declare this variable:
-
-extern int BSPConsolePort;
-
-c) To start-up GDB, run this:
-
- /* Init GDB glue */
-
- if(BSPConsolePort != BSP_UART_COM2)
- {
- /*
- * If com2 is not used as console use it for
- * debugging
- */
- i386_stub_glue_init(BSP_UART_COM2);
- }
- else
- {
- /* Otherwise use com1 */
- i386_stub_glue_init(BSP_UART_COM1);
- }
-
- /* Init GDB stub itself */
- set_debug_traps();
-
- /*
- * Init GDB break in capability,
- * has to be called after
- * set_debug_traps
- */
- i386_stub_glue_init_breakin();
-
- /* Put breakpoint in */
- breakpoint();
-
-d) This is all you need to do for the target.
-
-2. Edit cmds: specify path to current directory and device used for debugging
- example of cmds is attached below. Make sure your paths are correct.
-3. type 'make'
-4. Boot o-pc386/<test>.exe on target computer, where <test> has the code from step 1. ( I modified and recompiled base_sp as the <test> )
-5. run 'i396-rtems-gdb --nx --command=./cmds o-pc386/<test>.coff
-
-=========================== example cmds ==============================
-dir /home/cross-19980908/tools/rtems-980923
-dir /home/cross-19980908/tools/rtems-980923/aclocal
-dir /home/cross-19980908/tools/rtems-980923/c
-dir /home/cross-19980908/tools/rtems-980923/c/build-tools
-dir /home/cross-19980908/tools/rtems-980923/c/build-tools/os
-dir /home/cross-19980908/tools/rtems-980923/c/build-tools/os/msdos
-dir /home/cross-19980908/tools/rtems-980923/c/build-tools/scripts
-dir /home/cross-19980908/tools/rtems-980923/c/build-tools/src
-dir /home/cross-19980908/tools/rtems-980923/c/src
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/posix
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/posix/base
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/posix/headers
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/posix/inline
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/posix/macros
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/posix/optman
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/posix/src
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/posix/sys
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/sapi
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/sapi/headers
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/sapi/src
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/sapi/inline
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/sapi/macros
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/sapi/optman
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/rtems
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/rtems/headers
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/rtems/src
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/rtems/inline
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/rtems/macros
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/rtems/optman
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/cpu
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/cpu/a29k
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/cpu/hppa1.1
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/cpu/i386
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/cpu/i960
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/cpu/m68k
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/cpu/mips64orion
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/cpu/no_cpu
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/cpu/powerpc
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/cpu/sh
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/cpu/sparc
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/cpu/unix
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/headers
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/inline
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/macros
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/src
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/tools
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/tools/generic
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/tools/unix
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/score/tools/hppa1.1
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/wrapup
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/wrapup/posix
-dir /home/cross-19980908/tools/rtems-980923/c/src/exec/wrapup/rtems
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/include
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/include/motorola
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/include/rtems++
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/include/sys
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/include/zilog
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libc
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libbsp
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libbsp/i386
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libbsp/i386/pc386
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libbsp/i386/pc386/clock
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libbsp/i386/pc386/console
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libbsp/i386/pc386/include
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libbsp/i386/pc386/start
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libbsp/i386/pc386/startup
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libbsp/i386/pc386/timer
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libbsp/i386/pc386/tools
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libbsp/i386/pc386/wrapup
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libbsp/i386/shared/comm
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libbsp/i386/shared/pci
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/hppa1.1
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/hppa1.1/clock
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/hppa1.1/include
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/hppa1.1/milli
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/hppa1.1/runway
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/hppa1.1/semaphore
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/hppa1.1/timer
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/m68k
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/m68k/m68040
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/m68k/m68040/fpsp
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/mips64orion
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/mips64orion/clock
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/mips64orion/include
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/mips64orion/timer
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/powerpc
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/powerpc/ppc403
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/powerpc/ppc403/clock
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/powerpc/ppc403/console
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/powerpc/ppc403/include
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/powerpc/ppc403/timer
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/powerpc/ppc403/vectors
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/sh
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/sh/sh7032
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/sh/sh7032/clock
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/sh/sh7032/null
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/sh/sh7032/console
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/sh/sh7032/include
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/sh/sh7032/timer
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/sparc
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libcpu/sparc/reg_win
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libnetworking
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libmisc
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libmisc/assoc
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libmisc/cpuuse
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libmisc/error
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libmisc/monitor
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libmisc/rtmonuse
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libmisc/stackchk
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/libmisc/wrapup
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/librtems++
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/start
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/start/a29k
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/start/i960
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/start/m68k
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/start/mips64orion
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/start/sh
-dir /home/cross-19980908/tools/rtems-980923/c/src/lib/wrapup
-dir /home/cross-19980908/tools/rtems-980923/c/src/tests
-dir /home/cross-19980908/tools/rtems-980923/c/src/tests/samples
-dir /home/cross-19980908/tools/rtems-980923/c/src/tests/samples/base_sp
-set remotebaud 38400
-target remote /dev/ttyS1
diff --git a/c/src/lib/libbsp/i386/shared/comm/Makefile.in b/c/src/lib/libbsp/i386/shared/comm/Makefile.in
deleted file mode 100644
index 960dd1f2b4..0000000000
--- a/c/src/lib/libbsp/i386/shared/comm/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/uart.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-preinstall all: $(SRCS)
- $(INSTALL) -m 444 $(SRCS) $(PROJECT_INCLUDE)
-
diff --git a/c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c b/c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c
deleted file mode 100644
index 997237c1c2..0000000000
--- a/c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * This software is Copyright (C) 1998 by T.sqware - all rights limited
- * It is provided in to the public domain "as is", can be freely modified
- * as far as this copyight notice is kept unchanged, but does not imply
- * an endorsement by T.sqware of the product in which it is included.
- *
- * $Id$
- */
-
-#include <rtems/system.h>
-#include <rtems/score/cpu.h>
-#include <bsp.h>
-#include <irq.h>
-#include <uart.h>
-#include <assert.h>
-
-
-int putDebugChar(int ch); /* write a single character */
-int getDebugChar(void); /* read and return a single char */
-
-/* assign an exception handler */
-void exceptionHandler(int, void (*handler)(void));
-
-
-/* Current uart used by gdb stub */
-static int uart_current = 0;
-
-/*
- * Initialize glue code linking i386-stub with the rest of
- * the system
- */
-void
-i386_stub_glue_init(int uart)
-{
- assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
- uart_current = uart;
-
- BSP_uart_init(uart, 38400, 0);
-}
-
-void BSP_uart_on(const rtems_raw_irq_connect_data* used)
-{
- BSP_irq_enable_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);
-}
-
-void BSP_uart_off(const rtems_raw_irq_connect_data* used)
-{
- BSP_irq_disable_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);
-}
-
-int BSP_uart_isOn(const rtems_raw_irq_connect_data* used)
-{
- return BSP_irq_enabled_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);
-}
-
-
-/*
- * In order to have a possibility to break into
- * running program, one has to call this function
- */
-void i386_stub_glue_init_breakin(void)
-{
- rtems_raw_irq_connect_data uart_raw_irq_data;
-
- assert(uart_current == BSP_UART_COM1 || uart_current == BSP_UART_COM2);
-
- if(uart_current == BSP_UART_COM1)
- {
- uart_raw_irq_data.idtIndex = BSP_UART_COM1_IRQ + BSP_IRQ_VECTOR_BASE;
- }
- else
- {
- uart_raw_irq_data.idtIndex = BSP_UART_COM2_IRQ + BSP_IRQ_VECTOR_BASE;
- }
-
- if(!i386_get_current_idt_entry(&uart_raw_irq_data))
- {
- printk("cannot get idt entry\n");
- rtems_fatal_error_occurred(1);
- }
-
- if(!i386_delete_idt_entry(&uart_raw_irq_data))
- {
- printk("cannot delete idt entry\n");
- rtems_fatal_error_occurred(1);
- }
-
- uart_raw_irq_data.on = BSP_uart_on;
- uart_raw_irq_data.off = BSP_uart_off;
- uart_raw_irq_data.isOn= BSP_uart_isOn;
-
- /* Install ISR */
- if(uart_current == BSP_UART_COM1)
- {
- uart_raw_irq_data.idtIndex = BSP_UART_COM1_IRQ + BSP_IRQ_VECTOR_BASE;
- uart_raw_irq_data.hdl = BSP_uart_dbgisr_com1;
- }
- else
- {
- uart_raw_irq_data.idtIndex = BSP_UART_COM2_IRQ + BSP_IRQ_VECTOR_BASE;
- uart_raw_irq_data.hdl = BSP_uart_dbgisr_com2;
- }
-
- if (!i386_set_idt_entry (&uart_raw_irq_data))
- {
- printk("raw exception handler connection failed\n");
- rtems_fatal_error_occurred(1);
- }
-
- /* Enable interrupts */
- BSP_uart_intr_ctrl(uart_current, BSP_UART_INTR_CTRL_GDB);
-
- return;
-}
-
-
-int
-putDebugChar(int ch)
-{
- assert(uart_current == BSP_UART_COM1 || uart_current == BSP_UART_COM2);
-
- BSP_uart_polled_write(uart_current, ch);
-
- return 1;
-}
-
-int getDebugChar(void)
-{
- int val;
-
- assert(uart_current == BSP_UART_COM1 || uart_current == BSP_UART_COM2);
-
- val = BSP_uart_polled_read(uart_current);
-
- return val;
-}
-
-static void nop(){}
-static int isOn() {return 1;}
-
-void exceptionHandler(int vector, void (*handler)(void))
-{
- rtems_raw_irq_connect_data excep_raw_irq_data;
-
- excep_raw_irq_data.idtIndex = vector;
-
- if(!i386_get_current_idt_entry(&excep_raw_irq_data))
- {
- printk("cannot get idt entry\n");
- rtems_fatal_error_occurred(1);
- }
-
- if(!i386_delete_idt_entry(&excep_raw_irq_data))
- {
- printk("cannot delete idt entry\n");
- rtems_fatal_error_occurred(1);
- }
-
- excep_raw_irq_data.on = nop;
- excep_raw_irq_data.off = nop;
- excep_raw_irq_data.isOn = isOn;
- excep_raw_irq_data.hdl = handler;
-
- if (!i386_set_idt_entry (&excep_raw_irq_data)) {
- printk("raw exception handler connection failed\n");
- rtems_fatal_error_occurred(1);
- }
- return;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/c/src/lib/libbsp/i386/shared/comm/i386-stub.c b/c/src/lib/libbsp/i386/shared/comm/i386-stub.c
deleted file mode 100644
index 8764d7b27a..0000000000
--- a/c/src/lib/libbsp/i386/shared/comm/i386-stub.c
+++ /dev/null
@@ -1,989 +0,0 @@
-/*
- * This is the gdb i386 remote debug stub from gdb 4.XX.
- *
- * $Id$
- */
-
-/****************************************************************************
-
- THIS SOFTWARE IS NOT COPYRIGHTED
-
- HP offers the following for use in the public domain. HP makes no
- warranty with regard to the software or it's performance and the
- user accepts the software "AS IS" with all faults.
-
- HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
- TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
- ****************************************************************************/
-
-/****************************************************************************
- * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
- *
- * Module name: remcom.c $
- * Revision: 1.34 $
- * Date: 91/03/09 12:29:49 $
- * Contributor: Lake Stevens Instrument Division$
- *
- * Description: low level support for gdb debugger. $
- *
- * Considerations: only works on target hardware $
- *
- * Written by: Glenn Engel $
- * ModuleState: Experimental $
- *
- * NOTES: See Below $
- *
- * Modified for 386 by Jim Kingdon, Cygnus Support.
- * Modified for RTEMS by Aleksey Romanov, Quality Quorum, Inc.
- *
- * To enable debugger support, two things need to happen. One, a
- * call to set_debug_traps() is necessary in order to allow any breakpoints
- * or error conditions to be properly intercepted and reported to gdb.
- * Two, a breakpoint needs to be generated to begin communication. This
- * is most easily accomplished by a call to breakpoint(). Breakpoint()
- * simulates a breakpoint by executing a trap #1.
- *
- * The external function exceptionHandler() is
- * used to attach a specific handler to a specific 386 vector number.
- * It should use the same privilege level it runs at. It should
- * install it as an interrupt gate so that interrupts are masked
- * while the handler runs.
- * Also, need to assign exceptionHook and oldExceptionHook.
- *
- * Because gdb will sometimes write to the stack area to execute function
- * calls, this program cannot rely on using the supervisor stack so it
- * uses it's own stack area reserved in the int array remcomStack.
- *
- *************
- *
- * The following gdb commands are supported:
- *
- * command function Return value
- *
- * g return the value of the CPU registers hex data or ENN
- * G set the value of the CPU registers OK or ENN
- *
- * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
- * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
- *
- * c Resume at current address SNN ( signal NN)
- * cAA..AA Continue at address AA..AA SNN
- *
- * s Step one instruction SNN
- * sAA..AA Step one instruction from AA..AA SNN
- *
- * k kill
- *
- * ? What was the last sigval ? SNN (signal NN)
- *
- * All commands and responses are sent with a packet which includes a
- * checksum. A packet consists of
- *
- * $<packet info>#<checksum>.
- *
- * where
- * <packet info> :: <characters representing the command or response>
- * <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>>
- *
- * When a packet is received, it is first acknowledged with either '+' or '-'.
- * '+' indicates a successful transfer. '-' indicates a failed transfer.
- *
- * Example:
- *
- * Host: Reply:
- * $m0,10#2a +$00010203040506070809101112131415#42
- *
- ****************************************************************************/
-
-#include <stdio.h>
-#include <string.h>
-
-/************************************************************************
- *
- * external low-level support routines
- */
-extern int putDebugChar (int ch); /* write a single character */
-extern int getDebugChar (void); /* read and return a single char */
-
-/* assign an exception handler */
-extern void exceptionHandler (int, void (*handler) (void));
-
-/************************************************************************/
-/* BUFMAX defines the maximum number of characters in inbound/outbound buffers */
-/* at least NUMREGBYTES*2 are needed for register packets */
-#define BUFMAX 400
-
-static char initialized; /* boolean flag. != 0 means we've been initialized */
-
-int remote_debug;
-/* debug > 0 prints ill-formed commands in valid packets & checksum errors */
-
-void waitabit ();
-
-static const char hexchars[] = "0123456789abcdef";
-
-/* Number of registers. */
-#define NUMREGS 16
-
-/* Number of bytes per register. */
-#define REGBYTES 4
-
-/* Number of bytes of registers. */
-#define NUMREGBYTES (NUMREGS * REGBYTES)
-
-enum regnames
- {
- EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI,
- PC /* also known as eip */ ,
- PS /* also known as eflags */ ,
- CS, SS, DS, ES, FS, GS
- };
-
-/*
- * these should not be static cuz they can be used outside this module
- */
-int registers[NUMREGS];
-
-#define STACKSIZE 10000
-int remcomStack[STACKSIZE / sizeof (int)];
-static int *stackPtr = &remcomStack[STACKSIZE / sizeof (int) - 1];
-
-/*************************** ASSEMBLY CODE MACROS *************************/
-/* */
-
-extern void
- return_to_prog (void);
-
-/* Restore the program's registers (including the stack pointer, which
- means we get the right stack and don't have to worry about popping our
- return address and any stack frames and so on) and return. */
-asm (".text");
-asm (".globl return_to_prog");
-asm ("return_to_prog:");
-asm (" movw registers+44, %ss");
-asm (" movl registers+16, %esp");
-asm (" movl registers+4, %ecx");
-asm (" movl registers+8, %edx");
-asm (" movl registers+12, %ebx");
-asm (" movl registers+20, %ebp");
-asm (" movl registers+24, %esi");
-asm (" movl registers+28, %edi");
-asm (" movw registers+48, %ds");
-asm (" movw registers+52, %es");
-asm (" movw registers+56, %fs");
-asm (" movw registers+60, %gs");
-asm (" movl registers+36, %eax");
-asm (" pushl %eax"); /* saved eflags */
-asm (" movl registers+40, %eax");
-asm (" pushl %eax"); /* saved cs */
-asm (" movl registers+32, %eax");
-asm (" pushl %eax"); /* saved eip */
-asm (" movl registers, %eax");
-/* use iret to restore pc and flags together so
- that trace flag works right. */
-asm (" iret");
-
-#define BREAKPOINT() asm(" int $3");
-
-/* Put the error code here just in case the user cares. */
-int gdb_i386errcode;
-/* Likewise, the vector number here (since GDB only gets the signal
- number through the usual means, and that's not very specific). */
-int gdb_i386vector = -1;
-
-/* GDB stores segment registers in 32-bit words (that's just the way
- m-i386v.h is written). So zero the appropriate areas in registers. */
-#define SAVE_REGISTERS1() \
- asm ("movl %eax, registers"); \
- asm ("movl %ecx, registers+4"); \
- asm ("movl %edx, registers+8"); \
- asm ("movl %ebx, registers+12"); \
- asm ("movl %ebp, registers+20"); \
- asm ("movl %esi, registers+24"); \
- asm ("movl %edi, registers+28"); \
- asm ("movw $0, %ax"); \
- asm ("movw %ds, registers+48"); \
- asm ("movw %ax, registers+50"); \
- asm ("movw %es, registers+52"); \
- asm ("movw %ax, registers+54"); \
- asm ("movw %fs, registers+56"); \
- asm ("movw %ax, registers+58"); \
- asm ("movw %gs, registers+60"); \
- asm ("movw %ax, registers+62");
-#define SAVE_ERRCODE() \
- asm ("popl %ebx"); \
- asm ("movl %ebx, gdb_i386errcode");
-#define SAVE_REGISTERS2() \
- asm ("popl %ebx"); /* old eip */ \
- asm ("movl %ebx, registers+32"); \
- asm ("popl %ebx"); /* old cs */ \
- asm ("movl %ebx, registers+40"); \
- asm ("movw %ax, registers+42"); \
- asm ("popl %ebx"); /* old eflags */ \
- asm ("movl %ebx, registers+36"); \
- /* Now that we've done the pops, we can save the stack pointer."); */ \
- asm ("movw %ss, registers+44"); \
- asm ("movw %ax, registers+46"); \
- asm ("movl %esp, registers+16");
-
-/* See if mem_fault_routine is set, if so just IRET to that address. */
-#define CHECK_FAULT() \
- asm ("cmpl $0, mem_fault_routine"); \
- asm ("jne mem_fault");
-
-asm (".text");
-asm ("mem_fault:");
-/* OK to clobber temp registers; we're just going to end up in set_mem_err. */
-/* Pop error code from the stack and save it. */
-asm (" popl %eax");
-asm (" movl %eax, gdb_i386errcode");
-
-asm (" popl %eax"); /* eip */
-/* We don't want to return there, we want to return to the function
- pointed to by mem_fault_routine instead. */
-asm (" movl mem_fault_routine, %eax");
-asm (" popl %ecx"); /* cs (low 16 bits; junk in hi 16 bits). */
-asm (" popl %edx"); /* eflags */
-
-/* Remove this stack frame; when we do the iret, we will be going to
- the start of a function, so we want the stack to look just like it
- would after a "call" instruction. */
-asm (" leave");
-
-/* Push the stuff that iret wants. */
-asm (" pushl %edx"); /* eflags */
-asm (" pushl %ecx"); /* cs */
-asm (" pushl %eax"); /* eip */
-
-/* Zero mem_fault_routine. */
-asm (" movl $0, %eax");
-asm (" movl %eax, mem_fault_routine");
-
-asm ("iret");
-
-#define CALL_HOOK() asm("call _remcomHandler");
-
-/* This function is called when a i386 exception occurs. It saves
- * all the cpu regs in the registers array, munges the stack a bit,
- * and invokes an exception handler (remcom_handler).
- *
- * stack on entry: stack on exit:
- * old eflags vector number
- * old cs (zero-filled to 32 bits)
- * old eip
- *
- */
-extern void _catchException3 ();
-asm (".text");
-asm (".globl _catchException3");
-asm ("_catchException3:");
-SAVE_REGISTERS1 ();
-SAVE_REGISTERS2 ();
-asm ("pushl $3");
-CALL_HOOK ();
-
-/* Same thing for exception 1. */
-extern void _catchException1 ();
-asm (".text");
-asm (".globl _catchException1");
-asm ("_catchException1:");
-SAVE_REGISTERS1 ();
-SAVE_REGISTERS2 ();
-asm ("pushl $1");
-CALL_HOOK ();
-
-/* Same thing for exception 0. */
-extern void _catchException0 ();
-asm (".text");
-asm (".globl _catchException0");
-asm ("_catchException0:");
-SAVE_REGISTERS1 ();
-SAVE_REGISTERS2 ();
-asm ("pushl $0");
-CALL_HOOK ();
-
-/* Same thing for exception 4. */
-extern void _catchException4 ();
-asm (".text");
-asm (".globl _catchException4");
-asm ("_catchException4:");
-SAVE_REGISTERS1 ();
-SAVE_REGISTERS2 ();
-asm ("pushl $4");
-CALL_HOOK ();
-
-/* Same thing for exception 5. */
-extern void _catchException5 ();
-asm (".text");
-asm (".globl _catchException5");
-asm ("_catchException5:");
-SAVE_REGISTERS1 ();
-SAVE_REGISTERS2 ();
-asm ("pushl $5");
-CALL_HOOK ();
-
-/* Same thing for exception 6. */
-extern void _catchException6 ();
-asm (".text");
-asm (".globl _catchException6");
-asm ("_catchException6:");
-SAVE_REGISTERS1 ();
-SAVE_REGISTERS2 ();
-asm ("pushl $6");
-CALL_HOOK ();
-
-/* Same thing for exception 7. */
-extern void _catchException7 ();
-asm (".text");
-asm (".globl _catchException7");
-asm ("_catchException7:");
-SAVE_REGISTERS1 ();
-SAVE_REGISTERS2 ();
-asm ("pushl $7");
-CALL_HOOK ();
-
-/* Same thing for exception 8. */
-extern void _catchException8 ();
-asm (".text");
-asm (".globl _catchException8");
-asm ("_catchException8:");
-SAVE_REGISTERS1 ();
-SAVE_ERRCODE ();
-SAVE_REGISTERS2 ();
-asm ("pushl $8");
-CALL_HOOK ();
-
-/* Same thing for exception 9. */
-extern void _catchException9 ();
-asm (".text");
-asm (".globl _catchException9");
-asm ("_catchException9:");
-SAVE_REGISTERS1 ();
-SAVE_REGISTERS2 ();
-asm ("pushl $9");
-CALL_HOOK ();
-
-/* Same thing for exception 10. */
-extern void _catchException10 ();
-asm (".text");
-asm (".globl _catchException10");
-asm ("_catchException10:");
-SAVE_REGISTERS1 ();
-SAVE_ERRCODE ();
-SAVE_REGISTERS2 ();
-asm ("pushl $10");
-CALL_HOOK ();
-
-/* Same thing for exception 12. */
-extern void _catchException12 ();
-asm (".text");
-asm (".globl _catchException12");
-asm ("_catchException12:");
-SAVE_REGISTERS1 ();
-SAVE_ERRCODE ();
-SAVE_REGISTERS2 ();
-asm ("pushl $12");
-CALL_HOOK ();
-
-/* Same thing for exception 16. */
-extern void _catchException16 ();
-asm (".text");
-asm (".globl _catchException16");
-asm ("_catchException16:");
-SAVE_REGISTERS1 ();
-SAVE_REGISTERS2 ();
-asm ("pushl $16");
-CALL_HOOK ();
-
-/* For 13, 11, and 14 we have to deal with the CHECK_FAULT stuff. */
-
-/* Same thing for exception 13. */
-extern void _catchException13 ();
-asm (".text");
-asm (".globl _catchException13");
-asm ("_catchException13:");
-CHECK_FAULT ();
-SAVE_REGISTERS1 ();
-SAVE_ERRCODE ();
-SAVE_REGISTERS2 ();
-asm ("pushl $13");
-CALL_HOOK ();
-
-/* Same thing for exception 11. */
-extern void _catchException11 ();
-asm (".text");
-asm (".globl _catchException11");
-asm ("_catchException11:");
-CHECK_FAULT ();
-SAVE_REGISTERS1 ();
-SAVE_ERRCODE ();
-SAVE_REGISTERS2 ();
-asm ("pushl $11");
-CALL_HOOK ();
-
-/* Same thing for exception 14. */
-extern void _catchException14 ();
-asm (".text");
-asm (".globl _catchException14");
-asm ("_catchException14:");
-CHECK_FAULT ();
-SAVE_REGISTERS1 ();
-SAVE_ERRCODE ();
-SAVE_REGISTERS2 ();
-asm ("pushl $14");
-CALL_HOOK ();
-
-/*
- * remcomHandler is a front end for handle_exception. It moves the
- * stack pointer into an area reserved for debugger use.
- */
-asm ("_remcomHandler:");
-asm (" popl %eax"); /* pop off return address */
-asm (" popl %eax"); /* get the exception number */
-asm (" movl stackPtr, %esp"); /* move to remcom stack area */
-asm (" pushl %eax"); /* push exception onto stack */
-asm (" call handle_exception"); /* this never returns */
-
-void
-_returnFromException (void)
-{
- return_to_prog ();
-}
-
-int
-hex (char ch)
-{
- if ((ch >= 'a') && (ch <= 'f'))
- return (ch - 'a' + 10);
- if ((ch >= '0') && (ch <= '9'))
- return (ch - '0');
- if ((ch >= 'A') && (ch <= 'F'))
- return (ch - 'A' + 10);
- return (-1);
-}
-
-
-/* scan for the sequence $<data>#<checksum> */
-void
-getpacket (char *buffer)
-{
- unsigned char checksum;
- unsigned char xmitcsum;
- int i;
- int count;
- char ch;
-
- do
- {
- /* wait around for the start character, ignore all other characters */
- while ((ch = (getDebugChar () & 0x7f)) != '$');
- checksum = 0;
- xmitcsum = -1;
-
- count = 0;
-
- /* now, read until a # or end of buffer is found */
- while (count < BUFMAX)
- {
- ch = getDebugChar () & 0x7f;
- if (ch == '#')
- break;
- checksum = checksum + ch;
- buffer[count] = ch;
- count = count + 1;
- }
- buffer[count] = 0;
-
- if (ch == '#')
- {
- xmitcsum = hex (getDebugChar () & 0x7f) << 4;
- xmitcsum += hex (getDebugChar () & 0x7f);
- if ((remote_debug) && (checksum != xmitcsum))
- {
- fprintf (stderr, "bad checksum. My count = 0x%x, sent=0x%x. buf=%s\n",
- checksum, xmitcsum, buffer);
- }
-
- if (checksum != xmitcsum)
- putDebugChar ('-'); /* failed checksum */
- else
- {
- putDebugChar ('+'); /* successful transfer */
- /* if a sequence char is present, reply the sequence ID */
- if (buffer[2] == ':')
- {
- putDebugChar (buffer[0]);
- putDebugChar (buffer[1]);
- /* remove sequence chars from buffer */
- count = strlen (buffer);
- for (i = 3; i <= count; i++)
- buffer[i - 3] = buffer[i];
- }
- }
- }
- }
- while (checksum != xmitcsum);
-
-}
-
-/* send the packet in buffer. */
-
-
-void
-putpacket (char *buffer)
-{
- unsigned char checksum;
- int count;
- char ch;
-
- /* $<packet info>#<checksum>. */
- do
- {
- putDebugChar ('$');
- checksum = 0;
- count = 0;
-
- while ((ch = buffer[count]))
- {
- if (!putDebugChar (ch))
- return;
- checksum += ch;
- count += 1;
- }
-
- putDebugChar ('#');
- putDebugChar (hexchars[checksum >> 4]);
- putDebugChar (hexchars[checksum % 16]);
-
- }
- while ((getDebugChar () & 0x7f) != '+');
-
-}
-
-char remcomInBuffer[BUFMAX];
-char remcomOutBuffer[BUFMAX];
-static short error;
-
-void
-debug_error (format, parm)
- char *format;
- char *parm;
-{
- if (remote_debug)
- fprintf (stderr, format, parm);
-}
-
-/* Address of a routine to RTE to if we get a memory fault. */
-static void (*volatile mem_fault_routine) (void) = NULL;
-
-/* Indicate to caller of mem2hex or hex2mem that there has been an
- error. */
-static volatile int mem_err = 0;
-
-void
-set_mem_err (void)
-{
- mem_err = 1;
-}
-
-/* These are separate functions so that they are so short and sweet
- that the compiler won't save any registers (if there is a fault
- to mem_fault, they won't get restored, so there better not be any
- saved). */
-int
-get_char (char *addr)
-{
- return *addr;
-}
-
-void
-set_char (char *addr, int val)
-{
- *addr = val;
-}
-
-/* convert the memory pointed to by mem into hex, placing result in buf */
-/* return a pointer to the last char put in buf (null) */
-/* If MAY_FAULT is non-zero, then we should set mem_err in response to
- a fault; if zero treat a fault like any other fault in the stub. */
-char *
-mem2hex (char *mem, char *buf, int count, int may_fault)
-{
- int i;
- unsigned char ch;
-
- if (may_fault)
- mem_fault_routine = set_mem_err;
- for (i = 0; i < count; i++)
- {
- ch = get_char (mem++);
- if (may_fault && mem_err)
- return (buf);
- *buf++ = hexchars[ch >> 4];
- *buf++ = hexchars[ch % 16];
- }
- *buf = 0;
- if (may_fault)
- mem_fault_routine = NULL;
- return (buf);
-}
-
-/* convert the hex array pointed to by buf into binary to be placed in mem */
-/* return a pointer to the character AFTER the last byte written */
-char *
-hex2mem (char *buf, char *mem, int count, int may_fault)
-{
- int i;
- unsigned char ch;
-
- if (may_fault)
- mem_fault_routine = set_mem_err;
- for (i = 0; i < count; i++)
- {
- ch = hex (*buf++) << 4;
- ch = ch + hex (*buf++);
- set_char (mem++, ch);
- if (may_fault && mem_err)
- return (mem);
- }
- if (may_fault)
- mem_fault_routine = NULL;
- return (mem);
-}
-
-/* this function takes the 386 exception vector and attempts to
- translate this number into a unix compatible signal value */
-int
-computeSignal (int exceptionVector)
-{
- int sigval;
- switch (exceptionVector)
- {
- case 0:
- sigval = 8;
- break; /* divide by zero */
- case 1:
- sigval = 5;
- break; /* debug exception */
- case 3:
- sigval = 5;
- break; /* breakpoint */
- case 4:
- sigval = 16;
- break; /* into instruction (overflow) */
- case 5:
- sigval = 16;
- break; /* bound instruction */
- case 6:
- sigval = 4;
- break; /* Invalid opcode */
- case 7:
- sigval = 8;
- break; /* coprocessor not available */
- case 8:
- sigval = 7;
- break; /* double fault */
- case 9:
- sigval = 11;
- break; /* coprocessor segment overrun */
- case 10:
- sigval = 11;
- break; /* Invalid TSS */
- case 11:
- sigval = 11;
- break; /* Segment not present */
- case 12:
- sigval = 11;
- break; /* stack exception */
- case 13:
- sigval = 11;
- break; /* general protection */
- case 14:
- sigval = 11;
- break; /* page fault */
- case 16:
- sigval = 7;
- break; /* coprocessor error */
- default:
- sigval = 7; /* "software generated" */
- }
- return (sigval);
-}
-
-/**********************************************/
-/* WHILE WE FIND NICE HEX CHARS, BUILD AN INT */
-/* RETURN NUMBER OF CHARS PROCESSED */
-/**********************************************/
-int
-hexToInt (char **ptr, int *intValue)
-{
- int numChars = 0;
- int hexValue;
-
- *intValue = 0;
-
- while (**ptr)
- {
- hexValue = hex (**ptr);
- if (hexValue >= 0)
- {
- *intValue = (*intValue << 4) | hexValue;
- numChars++;
- }
- else
- break;
-
- (*ptr)++;
- }
-
- return (numChars);
-}
-
-/*
- * This function does all command procesing for interfacing to gdb.
- */
-void
-handle_exception (int exceptionVector)
-{
- int sigval;
- int addr, length, reg;
- char *ptr;
- int newPC;
-
- gdb_i386vector = exceptionVector;
-
- if (remote_debug)
- printf ("vector=%d, sr=0x%x, pc=0x%x\n",
- exceptionVector,
- registers[PS],
- registers[PC]);
-
- /* Reply to host that an exception has occurred. Always return the
- PC, SP, and FP, since gdb always wants them. */
- ptr = remcomOutBuffer;
- *ptr++ = 'T';
- sigval = computeSignal (exceptionVector);
- *ptr++ = hexchars[sigval >> 4];
- *ptr++ = hexchars[sigval % 16];
-
- *ptr++ = hexchars[ESP];
- *ptr++ = ':';
- mem2hex ((char *) &registers[ESP], ptr, REGBYTES, 0);
- ptr += REGBYTES * 2;
- *ptr++ = ';';
-
- *ptr++ = hexchars[EBP];
- *ptr++ = ':';
- mem2hex ((char *) &registers[EBP], ptr, REGBYTES, 0);
- ptr += REGBYTES * 2;
- *ptr++ = ';';
-
- *ptr++ = hexchars[PC];
- *ptr++ = ':';
- mem2hex ((char *) &registers[PC], ptr, REGBYTES, 0);
- ptr += REGBYTES * 2;
- *ptr++ = ';';
-
- *ptr = '\0';
-
- putpacket (remcomOutBuffer);
-
- while (1 == 1)
- {
- error = 0;
- remcomOutBuffer[0] = 0;
- getpacket (remcomInBuffer);
- switch (remcomInBuffer[0])
- {
- case '?':
- remcomOutBuffer[0] = 'S';
- remcomOutBuffer[1] = hexchars[sigval >> 4];
- remcomOutBuffer[2] = hexchars[sigval % 16];
- remcomOutBuffer[3] = 0;
- break;
- case 'd':
- remote_debug = !(remote_debug); /* toggle debug flag */
- break;
- case 'g': /* return the value of the CPU registers */
- mem2hex ((char *) registers, remcomOutBuffer, NUMREGBYTES, 0);
- break;
- case 'G': /* set the value of the CPU registers - return OK */
- hex2mem (&remcomInBuffer[1], (char *) registers, NUMREGBYTES, 0);
- strcpy (remcomOutBuffer, "OK");
- break;
-
- case 'P': /* Set specific register */
- ptr = &remcomInBuffer[1];
- if (hexToInt (&ptr, &reg)
- && *ptr++ == '=')
- {
- hex2mem (ptr, (char *) &registers[reg], REGBYTES, 0);
- strcpy (remcomOutBuffer, "OK");
- }
- else
- {
- strcpy (remcomOutBuffer, "E01");
- debug_error ("malformed register set command; %s",
- remcomInBuffer);
- }
- break;
-
- /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
- case 'm':
- /* TRY TO READ %x,%x. IF SUCCEED, SET PTR = 0 */
- ptr = &remcomInBuffer[1];
- if (hexToInt (&ptr, &addr))
- if (*(ptr++) == ',')
- if (hexToInt (&ptr, &length))
- {
- ptr = 0;
- mem_err = 0;
- mem2hex ((char *) addr, remcomOutBuffer, length, 1);
- if (mem_err)
- {
- strcpy (remcomOutBuffer, "E03");
- debug_error ("memory fault");
- }
- }
-
- if (ptr)
- {
- strcpy (remcomOutBuffer, "E01");
- debug_error ("malformed read memory command: %s", remcomInBuffer);
- }
- break;
-
- /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
- case 'M':
- /* TRY TO READ '%x,%x:'. IF SUCCEED, SET PTR = 0 */
- ptr = &remcomInBuffer[1];
- if (hexToInt (&ptr, &addr))
- if (*(ptr++) == ',')
- if (hexToInt (&ptr, &length))
- if (*(ptr++) == ':')
- {
- mem_err = 0;
- hex2mem (ptr, (char *) addr, length, 1);
-
- if (mem_err)
- {
- strcpy (remcomOutBuffer, "E03");
- debug_error ("memory fault");
- }
- else
- {
- strcpy (remcomOutBuffer, "OK");
- }
-
- ptr = 0;
- }
- if (ptr)
- {
- strcpy (remcomOutBuffer, "E02");
- debug_error ("malformed write memory command: %s", remcomInBuffer);
- }
- break;
-
- /* cAA..AA Continue at address AA..AA(optional) */
- /* sAA..AA Step one instruction from AA..AA(optional) */
- case 'c':
- case 's':
- /* try to read optional parameter, pc unchanged if no parm */
- ptr = &remcomInBuffer[1];
- if (hexToInt (&ptr, &addr))
- registers[PC] = addr;
-
- newPC = registers[PC];
-
- /* clear the trace bit */
- registers[PS] &= 0xfffffeff;
-
- /* set the trace bit if we're stepping */
- if (remcomInBuffer[0] == 's')
- registers[PS] |= 0x100;
-
- _returnFromException (); /* this is a jump */
-
- break;
-
- /* Detach. */
- case 'D':
- putpacket (remcomOutBuffer);
- registers[PS] &= 0xfffffeff;
- _returnFromException (); /* this is a jump */
-
- break;
-
- /* kill the program */
- case 'k': /* do nothing */
- break;
- } /* switch */
-
- /* reply to the request */
- putpacket (remcomOutBuffer);
- }
-}
-
-/* this function is used to set up exception handlers for tracing and
- breakpoints */
-void
-set_debug_traps (void)
-{
- extern void remcomHandler ();
-
- stackPtr = &remcomStack[STACKSIZE / sizeof (int) - 1];
-
- exceptionHandler (0, _catchException0);
- exceptionHandler (1, _catchException1);
- exceptionHandler (3, _catchException3);
- exceptionHandler (4, _catchException4);
- exceptionHandler (5, _catchException5);
- exceptionHandler (6, _catchException6);
- exceptionHandler (7, _catchException7);
- exceptionHandler (8, _catchException8);
- exceptionHandler (9, _catchException9);
- exceptionHandler (10, _catchException10);
- exceptionHandler (11, _catchException11);
- exceptionHandler (12, _catchException12);
- exceptionHandler (13, _catchException13);
- exceptionHandler (14, _catchException14);
- exceptionHandler (16, _catchException16);
-
- /* In case GDB is started before us, ack any packets (presumably
- "$?#xx") sitting there. */
- putDebugChar ('+');
-
- initialized = 1;
-
-}
-
-/* This function will generate a breakpoint exception. It is used at the
- beginning of a program to sync up with a debugger and can be used
- otherwise as a quick means to stop program execution and "break" into
- the debugger. */
-
-void
-breakpoint (void)
-{
- if (initialized)
- {
- BREAKPOINT ();
- }
- waitabit ();
-}
-
-int waitlimit = 1000000;
-
-void
-waitabit (void)
-{
- int i;
- for (i = 0; i < waitlimit; i++);
-}
-
-
-
-
-
diff --git a/c/src/lib/libbsp/i386/shared/comm/uart.c b/c/src/lib/libbsp/i386/shared/comm/uart.c
deleted file mode 100644
index 5d258d7232..0000000000
--- a/c/src/lib/libbsp/i386/shared/comm/uart.c
+++ /dev/null
@@ -1,935 +0,0 @@
-/*
- * This software is Copyright (C) 1998 by T.sqware - all rights limited
- * It is provided in to the public domain "as is", can be freely modified
- * as far as this copyight notice is kept unchanged, but does not imply
- * an endorsement by T.sqware of the product in which it is included.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <irq.h>
-#include <uart.h>
-#include <rtems/libio.h>
-#include <assert.h>
-
-/*
- * Basic 16552 driver
- */
-
-struct uart_data
-{
- int hwFlow;
- int baud;
-};
-
-static struct uart_data uart_data[2];
-
-/*
- * Macros to read/wirte register of uart, if configuration is
- * different just rewrite these macros
- */
-
-static inline unsigned char
-uread(int uart, unsigned int reg)
-{
- register unsigned char val;
-
- if(uart == 0)
- {
- i386_inport_byte(COM1_BASE_IO+reg, val);
- }
- else
- {
- i386_inport_byte(COM2_BASE_IO+reg, val);
- }
-
- return val;
-}
-
-static inline void
-uwrite(int uart, int reg, unsigned int val)
-{
- if(uart == 0)
- {
- i386_outport_byte(COM1_BASE_IO+reg, val);
- }
- else
- {
- i386_outport_byte(COM2_BASE_IO+reg, val);
- }
-}
-
-#ifdef UARTDEBUG
- static void
-uartError(int uart)
-{
- unsigned char uartStatus, dummy;
-
- uartStatus = uread(uart, LSR);
- dummy = uread(uart, RBR);
-
- if (uartStatus & OE)
- printk("********* Over run Error **********\n");
- if (uartStatus & PE)
- printk("********* Parity Error **********\n");
- if (uartStatus & FE)
- printk("********* Framing Error **********\n");
- if (uartStatus & BI)
- printk("********* Parity Error **********\n");
- if (uartStatus & ERFIFO)
- printk("********* Error receive Fifo **********\n");
-
-}
-#else
-inline void uartError(int uart)
-{
- unsigned char uartStatus;
-
- uartStatus = uread(uart, LSR);
- uartStatus = uread(uart, RBR);
-}
-#endif
-
-/*
- * Uart initialization, it is hardcoded to 8 bit, no parity,
- * one stop bit, FIFO, things to be changed
- * are baud rate and nad hw flow control,
- * and longest rx fifo setting
- */
-void
-BSP_uart_init(int uart, int baud, int hwFlow)
-{
- unsigned char tmp;
-
- /* Sanity check */
- assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
- switch(baud)
- {
- case 50:
- case 75:
- case 110:
- case 134:
- case 300:
- case 600:
- case 1200:
- case 2400:
- case 9600:
- case 19200:
- case 38400:
- case 57600:
- case 115200:
- break;
- default:
- assert(0);
- return;
- }
-
- /* Set DLAB bit to 1 */
- uwrite(uart, LCR, DLAB);
-
- /* Set baud rate */
- uwrite(uart, DLL, (BSPBaseBaud/baud) & 0xff);
- uwrite(uart, DLM, ((BSPBaseBaud/baud) >> 8) & 0xff);
-
- /* 8-bit, no parity , 1 stop */
- uwrite(uart, LCR, CHR_8_BITS);
-
-
- /* Set DTR, RTS and OUT2 high */
- uwrite(uart, MCR, DTR | RTS | OUT_2);
-
- /* Enable FIFO */
- uwrite(uart, FCR, FIFO_EN | XMIT_RESET | RCV_RESET | RECEIVE_FIFO_TRIGGER12);
-
- /* Disable Interrupts */
- uwrite(uart, IER, 0);
-
- /* Read status to clear them */
- tmp = uread(uart, LSR);
- tmp = uread(uart, RBR);
- tmp = uread(uart, MSR);
-
- /* Remember state */
- uart_data[uart].hwFlow = hwFlow;
- uart_data[uart].baud = baud;
- return;
-}
-
-/*
- * Set baud
- */
-void
-BSP_uart_set_baud(int uart, int baud)
-{
- unsigned char mcr, ier;
-
- /* Sanity check */
- assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
- /*
- * This function may be called whenever TERMIOS parameters
- * are changed, so we have to make sire that baud change is
- * indeed required
- */
-
- if(baud == uart_data[uart].baud)
- {
- return;
- }
-
- mcr = uread(uart, MCR);
- ier = uread(uart, IER);
-
- BSP_uart_init(uart, baud, uart_data[uart].hwFlow);
-
- uwrite(uart, MCR, mcr);
- uwrite(uart, IER, ier);
-
- return;
-}
-
-/*
- * Enable/disable interrupts
- */
-void
-BSP_uart_intr_ctrl(int uart, int cmd)
-{
-
- assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
- switch(cmd)
- {
- case BSP_UART_INTR_CTRL_DISABLE:
- uwrite(uart, IER, INTERRUPT_DISABLE);
- break;
- case BSP_UART_INTR_CTRL_ENABLE:
- if(uart_data[uart].hwFlow)
- {
- uwrite(uart, IER,
- (RECEIVE_ENABLE |
- TRANSMIT_ENABLE |
- RECEIVER_LINE_ST_ENABLE |
- MODEM_ENABLE
- )
- );
- }
- else
- {
- uwrite(uart, IER,
- (RECEIVE_ENABLE |
- TRANSMIT_ENABLE |
- RECEIVER_LINE_ST_ENABLE
- )
- );
- }
- break;
- case BSP_UART_INTR_CTRL_TERMIOS:
- if(uart_data[uart].hwFlow)
- {
- uwrite(uart, IER,
- (RECEIVE_ENABLE |
- RECEIVER_LINE_ST_ENABLE |
- MODEM_ENABLE
- )
- );
- }
- else
- {
- uwrite(uart, IER,
- (RECEIVE_ENABLE |
- RECEIVER_LINE_ST_ENABLE
- )
- );
- }
- break;
- case BSP_UART_INTR_CTRL_GDB:
- uwrite(uart, IER, RECEIVE_ENABLE);
- break;
- default:
- assert(0);
- break;
- }
-
- return;
-}
-
-void
-BSP_uart_throttle(int uart)
-{
- unsigned int mcr;
-
- assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
- if(!uart_data[uart].hwFlow)
- {
- /* Should not happen */
- assert(0);
- return;
- }
- mcr = uread (uart, MCR);
- /* RTS down */
- mcr &= ~RTS;
- uwrite(uart, MCR, mcr);
-
- return;
-}
-
-void
-BSP_uart_unthrottle(int uart)
-{
- unsigned int mcr;
-
- assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
- if(!uart_data[uart].hwFlow)
- {
- /* Should not happen */
- assert(0);
- return;
- }
- mcr = uread (uart, MCR);
- /* RTS up */
- mcr |= RTS;
- uwrite(uart, MCR, mcr);
-
- return;
-}
-
-/*
- * Status function, -1 if error
- * detected, 0 if no received chars available,
- * 1 if received char available, 2 if break
- * is detected, it will eat break and error
- * chars. It ignores overruns - we cannot do
- * anything about - it execpt count statistics
- * and we are not counting it.
- */
-int
-BSP_uart_polled_status(int uart)
-{
- unsigned char val;
-
- assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
- val = uread(uart, LSR);
-
- if(val & BI)
- {
- /* BREAK found, eat character */
- uread(uart, RBR);
- return BSP_UART_STATUS_BREAK;
- }
-
- if((val & (DR | OE | FE)) == 1)
- {
- /* No error, character present */
- return BSP_UART_STATUS_CHAR;
- }
-
- if((val & (DR | OE | FE)) == 0)
- {
- /* Nothing */
- return BSP_UART_STATUS_NOCHAR;
- }
-
- /*
- * Framing or parity error
- * eat character
- */
- uread(uart, RBR);
-
- return BSP_UART_STATUS_ERROR;
-}
-
-
-/*
- * Polled mode write function
- */
-void
-BSP_uart_polled_write(int uart, int val)
-{
- unsigned char val1;
-
- /* Sanity check */
- assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
- for(;;)
- {
- if((val1=uread(uart, LSR)) & THRE)
- {
- break;
- }
- }
-
- if(uart_data[uart].hwFlow)
- {
- for(;;)
- {
- if(uread(uart, MSR) & CTS)
- {
- break;
- }
- }
- }
-
- uwrite(uart, THR, val & 0xff);
-
- return;
-}
-
-void
-BSP_output_char_via_serial(int val)
-{
- BSP_uart_polled_write(BSPConsolePort, val);
- if (val == '\n') BSP_uart_polled_write(BSPConsolePort,'\r');
-}
-
-/*
- * Polled mode read function
- */
-int
-BSP_uart_polled_read(int uart)
-{
- unsigned char val;
-
- assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
- for(;;)
- {
- if(uread(uart, LSR) & DR)
- {
- break;
- }
- }
-
- val = uread(uart, RBR);
-
- return (int)(val & 0xff);
-}
-
-unsigned
-BSP_poll_char_via_serial()
-{
- return BSP_uart_polled_read(BSPConsolePort);
-}
-
-
-/* ================ Termios support =================*/
-
-static volatile int termios_stopped_com1 = 0;
-static volatile int termios_tx_active_com1 = 0;
-static void* termios_ttyp_com1 = NULL;
-static char termios_tx_hold_com1 = 0;
-static volatile char termios_tx_hold_valid_com1 = 0;
-
-static volatile int termios_stopped_com2 = 0;
-static volatile int termios_tx_active_com2 = 0;
-static void* termios_ttyp_com2 = NULL;
-static char termios_tx_hold_com2 = 0;
-static volatile char termios_tx_hold_valid_com2 = 0;
-
-/*
- * Set channel parameters
- */
-void
-BSP_uart_termios_set(int uart, void *ttyp)
-{
- unsigned char val;
- assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
-
- if(uart == BSP_UART_COM1)
- {
- if(uart_data[uart].hwFlow)
- {
- val = uread(uart, MSR);
-
- termios_stopped_com1 = (val & CTS) ? 0 : 1;
- }
- else
- {
- termios_stopped_com1 = 0;
- }
- termios_tx_active_com1 = 0;
- termios_ttyp_com1 = ttyp;
- termios_tx_hold_com1 = 0;
- termios_tx_hold_valid_com1 = 0;
- }
- else
- {
- if(uart_data[uart].hwFlow)
- {
- val = uread(uart, MSR);
-
- termios_stopped_com2 = (val & CTS) ? 0 : 1;
- }
- else
- {
- termios_stopped_com2 = 0;
- }
- termios_tx_active_com2 = 0;
- termios_ttyp_com2 = ttyp;
- termios_tx_hold_com2 = 0;
- termios_tx_hold_valid_com2 = 0;
- }
-
- return;
-}
-
-int
-BSP_uart_termios_write_com1(int minor, const char *buf, int len)
-{
- assert(buf != NULL);
-
- if(len <= 0)
- {
- return 0;
- }
-
- /* If there TX buffer is busy - something is royally screwed up */
- assert((uread(BSP_UART_COM1, LSR) & THRE) != 0);
-
- if(termios_stopped_com1)
- {
- /* CTS low */
- termios_tx_hold_com1 = *buf;
- termios_tx_hold_valid_com1 = 1;
- return 0;
- }
-
- /* Write character */
- uwrite(BSP_UART_COM1, THR, *buf & 0xff);
-
- /* Enable interrupts if necessary */
- if(!termios_tx_active_com1 && uart_data[BSP_UART_COM1].hwFlow)
- {
- termios_tx_active_com1 = 1;
- uwrite(BSP_UART_COM1, IER,
- (RECEIVE_ENABLE |
- TRANSMIT_ENABLE |
- RECEIVER_LINE_ST_ENABLE |
- MODEM_ENABLE
- )
- );
- }
- else if(!termios_tx_active_com1)
- {
- termios_tx_active_com1 = 1;
- uwrite(BSP_UART_COM1, IER,
- (RECEIVE_ENABLE |
- TRANSMIT_ENABLE |
- RECEIVER_LINE_ST_ENABLE
- )
- );
- }
-
- return 0;
-}
-
-int
-BSP_uart_termios_write_com2(int minor, const char *buf, int len)
-{
- assert(buf != NULL);
-
- if(len <= 0)
- {
- return 0;
- }
-
-
- /* If there TX buffer is busy - something is royally screwed up */
- assert((uread(BSP_UART_COM2, LSR) & THRE) != 0);
-
- if(termios_stopped_com2)
- {
- /* CTS low */
- termios_tx_hold_com2 = *buf;
- termios_tx_hold_valid_com2 = 1;
- return 0;
- }
-
- /* Write character */
-
- uwrite(BSP_UART_COM2, THR, *buf & 0xff);
-
- /* Enable interrupts if necessary */
- if(!termios_tx_active_com2 && uart_data[BSP_UART_COM2].hwFlow)
- {
- termios_tx_active_com2 = 1;
- uwrite(BSP_UART_COM2, IER,
- (RECEIVE_ENABLE |
- TRANSMIT_ENABLE |
- RECEIVER_LINE_ST_ENABLE |
- MODEM_ENABLE
- )
- );
- }
- else if(!termios_tx_active_com2)
- {
- termios_tx_active_com2 = 1;
- uwrite(BSP_UART_COM2, IER,
- (RECEIVE_ENABLE |
- TRANSMIT_ENABLE |
- RECEIVER_LINE_ST_ENABLE
- )
- );
- }
-
- return 0;
-}
-
-
-void
-BSP_uart_termios_isr_com1(void)
-{
- unsigned char buf[40];
- unsigned char val;
- int off, ret, vect;
-
- off = 0;
-
- for(;;)
- {
- vect = uread(BSP_UART_COM1, IIR) & 0xf;
-
- switch(vect)
- {
- case MODEM_STATUS :
- val = uread(BSP_UART_COM1, MSR);
- if(uart_data[BSP_UART_COM1].hwFlow)
- {
- if(val & CTS)
- {
- /* CTS high */
- termios_stopped_com1 = 0;
- if(termios_tx_hold_valid_com1)
- {
- termios_tx_hold_valid_com1 = 0;
- BSP_uart_termios_write_com1(0, &termios_tx_hold_com1,
- 1);
- }
- }
- else
- {
- /* CTS low */
- termios_stopped_com1 = 1;
- }
- }
- break;
- case NO_MORE_INTR :
- /* No more interrupts */
- if(off != 0)
- {
- /* Update rx buffer */
- rtems_termios_enqueue_raw_characters(termios_ttyp_com1,
- (char *)buf,
- off);
- }
- return;
- case TRANSMITTER_HODING_REGISTER_EMPTY :
- /*
- * TX holding empty: we have to disable these interrupts
- * if there is nothing more to send.
- */
-
- ret = rtems_termios_dequeue_characters(termios_ttyp_com1, 1);
-
- /* If nothing else to send disable interrupts */
- if(ret == 0 && uart_data[BSP_UART_COM1].hwFlow)
- {
- uwrite(BSP_UART_COM1, IER,
- (RECEIVE_ENABLE |
- RECEIVER_LINE_ST_ENABLE |
- MODEM_ENABLE
- )
- );
- termios_tx_active_com1 = 0;
- }
- else if(ret == 0)
- {
- uwrite(BSP_UART_COM1, IER,
- (RECEIVE_ENABLE |
- RECEIVER_LINE_ST_ENABLE
- )
- );
- termios_tx_active_com1 = 0;
- }
- break;
- case RECEIVER_DATA_AVAIL :
- case CHARACTER_TIMEOUT_INDICATION:
- /* RX data ready */
- assert(off < sizeof(buf));
- buf[off++] = uread(BSP_UART_COM1, RBR);
- break;
- case RECEIVER_ERROR:
- /* RX error: eat character */
- uartError(BSP_UART_COM1);
- break;
- default:
- /* Should not happen */
- assert(0);
- return;
- }
- }
-}
-
-void
-BSP_uart_termios_isr_com2()
-{
- unsigned char buf[40];
- unsigned char val;
- int off, ret, vect;
-
- off = 0;
-
- for(;;)
- {
- vect = uread(BSP_UART_COM2, IIR) & 0xf;
-
- switch(vect)
- {
- case MODEM_STATUS :
- val = uread(BSP_UART_COM2, MSR);
- if(uart_data[BSP_UART_COM2].hwFlow)
- {
- if(val & CTS)
- {
- /* CTS high */
- termios_stopped_com2 = 0;
- if(termios_tx_hold_valid_com2)
- {
- termios_tx_hold_valid_com2 = 0;
- BSP_uart_termios_write_com2(0, &termios_tx_hold_com2,
- 1);
- }
- }
- else
- {
- /* CTS low */
- termios_stopped_com2 = 1;
- }
- }
- break;
- case NO_MORE_INTR :
- /* No more interrupts */
- if(off != 0)
- {
- /* Update rx buffer */
- rtems_termios_enqueue_raw_characters(termios_ttyp_com2,
- (char *)buf,
- off);
- }
- return;
- case TRANSMITTER_HODING_REGISTER_EMPTY :
- /*
- * TX holding empty: we have to disable these interrupts
- * if there is nothing more to send.
- */
-
- ret = rtems_termios_dequeue_characters(termios_ttyp_com2, 1);
-
- /* If nothing else to send disable interrupts */
- if(ret == 0 && uart_data[BSP_UART_COM2].hwFlow)
- {
- uwrite(BSP_UART_COM2, IER,
- (RECEIVE_ENABLE |
- RECEIVER_LINE_ST_ENABLE |
- MODEM_ENABLE
- )
- );
- termios_tx_active_com2 = 0;
- }
- else if(ret == 0)
- {
- uwrite(BSP_UART_COM2, IER,
- (RECEIVE_ENABLE |
- RECEIVER_LINE_ST_ENABLE
- )
- );
- termios_tx_active_com2 = 0;
- }
- break;
- case RECEIVER_DATA_AVAIL :
- case CHARACTER_TIMEOUT_INDICATION:
- /* RX data ready */
- assert(off < sizeof(buf));
- buf[off++] = uread(BSP_UART_COM2, RBR);
- break;
- case RECEIVER_ERROR:
- /* RX error: eat character */
- uartError(BSP_UART_COM2);
- break;
- default:
- /* Should not happen */
- assert(0);
- return;
- }
- }
-}
-
-
-/* ================= GDB support ===================*/
-static int sav[4];
-
-/*
- * Interrupt service routine for COM1 - all,
- * it does it check whether ^C is received
- * if yes it will flip TF bit before returning
- * Note: it should be installed as raw interrupt
- * handler
- */
-
-asm (".p2align 4");
-asm (".text");
-asm (".globl BSP_uart_dbgisr_com1");
-asm ("BSP_uart_dbgisr_com1:");
-asm (" movl %eax, sav"); /* Save eax */
-asm (" movl %ebx, sav + 4"); /* Save ebx */
-asm (" movl %edx, sav + 8"); /* Save edx */
-
-asm (" movl $0, %ebx"); /* Clear flag */
-
-/*
- * We know that only receive related interrupts
- * are available, eat chars
- */
-asm ("uart_dbgisr_com1_1:");
-asm (" movw $0x3FD, %dx");
-asm (" inb %dx, %al"); /* Read LSR */
-asm (" andb $1, %al");
-asm (" cmpb $0, %al");
-asm (" je uart_dbgisr_com1_2");
-asm (" movw $0x3F8, %dx");
-asm (" inb %dx, %al"); /* Get input character */
-asm (" cmpb $3, %al");
-asm (" jne uart_dbgisr_com1_1");
-
-/* ^C received, set flag */
-asm (" movl $1, %ebx");
-asm (" jmp uart_dbgisr_com1_1");
-
-/* All chars read */
-asm ("uart_dbgisr_com1_2:");
-
-/* If flag is set we have to tweak TF */
-asm (" cmpl $0, %ebx");
-asm (" je uart_dbgisr_com1_3");
-
-/* Flag is set */
-asm (" movl sav+4, %ebx"); /* Restore ebx */
-asm (" movl sav+8, %edx"); /* Restore edx */
-
-/* Set TF bit */
-asm (" popl %eax"); /* Pop eip */
-asm (" movl %eax, sav + 4"); /* Save it */
-asm (" popl %eax"); /* Pop cs */
-asm (" movl %eax, sav + 8"); /* Save it */
-asm (" popl %eax"); /* Pop flags */
-asm (" orl $0x100, %eax"); /* Modify it */
-asm (" pushl %eax"); /* Push it back */
-asm (" movl sav+8, %eax"); /* Put back cs */
-asm (" pushl %eax");
-asm (" movl sav+4, %eax"); /* Put back eip */
-asm (" pushl %eax");
-
-/* Acknowledge IRQ */
-asm (" movb $0x20, %al");
-asm (" outb %al, $0x20");
-asm (" movl sav, %eax"); /* Restore eax */
-asm (" iret"); /* Done */
-
-/* Flag is not set */
-asm("uart_dbgisr_com1_3:");
-asm (" movl sav+4, %ebx"); /* Restore ebx */
-asm (" movl sav+8, %edx"); /* Restore edx */
-
-/* Acknowledge irq */
-asm (" movb $0x20, %al");
-asm (" outb %al, $0x20");
-asm (" movl sav, %eax"); /* Restore eax */
-asm (" iret"); /* Done */
-
-
-/*
- * Interrupt service routine for COM2 - all,
- * it does it check whether ^C is received
- * if yes it will flip TF bit before returning
- * Note: it has to be installed as raw interrupt
- * handler
- */
-asm (".p2align 4");
-asm (".text");
-asm (".globl BSP_uart_dbgisr_com2");
-asm ("BSP_uart_dbgisr_com2:");
-asm (" movl %eax, sav"); /* Save eax */
-asm (" movl %ebx, sav + 4"); /* Save ebx */
-asm (" movl %edx, sav + 8"); /* Save edx */
-
-asm (" movl $0, %ebx"); /* Clear flag */
-
-/*
- * We know that only receive related interrupts
- * are available, eat chars
- */
-asm ("uart_dbgisr_com2_1:");
-asm (" movw $0x2FD, %dx");
-asm (" inb %dx, %al"); /* Read LSR */
-asm (" andb $1, %al");
-asm (" cmpb $0, %al");
-asm (" je uart_dbgisr_com2_2");
-asm (" movw $0x2F8, %dx");
-asm (" inb %dx, %al"); /* Get input character */
-asm (" cmpb $3, %al");
-asm (" jne uart_dbgisr_com2_1");
-
-/* ^C received, set flag */
-asm (" movl $1, %ebx");
-asm (" jmp uart_dbgisr_com2_1");
-
-/* All chars read */
-asm ("uart_dbgisr_com2_2:");
-
-/* If flag is set we have to tweak TF */
-asm (" cmpl $0, %ebx");
-asm (" je uart_dbgisr_com2_3");
-
-/* Flag is set */
-asm (" movl sav+4, %ebx"); /* Restore ebx */
-asm (" movl sav+8, %edx"); /* Restore edx */
-
-/* Set TF bit */
-asm (" popl %eax"); /* Pop eip */
-asm (" movl %eax, sav + 4"); /* Save it */
-asm (" popl %eax"); /* Pop cs */
-asm (" movl %eax, sav + 8"); /* Save it */
-asm (" popl %eax"); /* Pop flags */
-asm (" orl $0x100, %eax"); /* Modify it */
-asm (" pushl %eax"); /* Push it back */
-asm (" movl sav+8, %eax"); /* Put back cs */
-asm (" pushl %eax");
-asm (" movl sav+4, %eax"); /* Put back eip */
-asm (" pushl %eax");
-
-/* Acknowledge IRQ */
-asm (" movb $0x20, %al");
-asm (" outb %al, $0x20");
-asm (" movl sav, %eax"); /* Restore eax */
-asm (" iret"); /* Done */
-
-/* Flag is not set */
-asm("uart_dbgisr_com2_3:");
-asm (" movl sav+4, %ebx"); /* Restore ebx */
-asm (" movl sav+8, %edx"); /* Restore edx */
-
-/* Acknowledge irq */
-asm (" movb $0x20, %al");
-asm (" outb %al, $0x20");
-asm (" movl sav, %eax"); /* Restore eax */
-asm (" iret"); /* Done */
-
-
-
-
-
-
diff --git a/c/src/lib/libbsp/i386/shared/comm/uart.h b/c/src/lib/libbsp/i386/shared/comm/uart.h
deleted file mode 100644
index e43ac9900c..0000000000
--- a/c/src/lib/libbsp/i386/shared/comm/uart.h
+++ /dev/null
@@ -1,169 +0,0 @@
-
-
-/*
- * This software is Copyright (C) 1998 by T.sqware - all rights limited
- * It is provided in to the public domain "as is", can be freely modified
- * as far as this copyight notice is kept unchanged, but does not imply
- * an endorsement by T.sqware of the product in which it is included.
- */
-
-#ifndef _BSPUART_H
-#define _BSPUART_H
-
-void BSP_uart_init(int uart, int baud, int hwFlow);
-void BSP_uart_set_baud(int aurt, int baud);
-void BSP_uart_intr_ctrl(int uart, int cmd);
-void BSP_uart_throttle(int uart);
-void BSP_uart_unthrottle(int uart);
-int BSP_uart_polled_status(int uart);
-void BSP_uart_polled_write(int uart, int val);
-int BSP_uart_polled_read(int uart);
-void BSP_uart_termios_set(int uart, void *ttyp);
-int BSP_uart_termios_write_com1(int minor, const char *buf, int len);
-int BSP_uart_termios_write_com2(int minor, const char *buf, int len);
-void BSP_uart_termios_isr_com1();
-void BSP_uart_termios_isr_com2();
-void BSP_uart_dbgisr_com1(void);
-void BSP_uart_dbgisr_com2(void);
-extern unsigned BSP_poll_char_via_serial(void);
-extern void BSP_output_char_via_serial(int val);
-extern int BSPConsolePort;
-extern int BSPBaseBaud;
-/*
- * Command values for BSP_uart_intr_ctrl(),
- * values are strange in order to catch errors
- * with assert
- */
-#define BSP_UART_INTR_CTRL_DISABLE (0)
-#define BSP_UART_INTR_CTRL_GDB (0xaa) /* RX only */
-#define BSP_UART_INTR_CTRL_ENABLE (0xbb) /* Normal operations */
-#define BSP_UART_INTR_CTRL_TERMIOS (0xcc) /* RX & line status */
-
-/* Return values for uart_polled_status() */
-#define BSP_UART_STATUS_ERROR (-1) /* No character */
-#define BSP_UART_STATUS_NOCHAR (0) /* No character */
-#define BSP_UART_STATUS_CHAR (1) /* Character present */
-#define BSP_UART_STATUS_BREAK (2) /* Break point is detected */
-
-/* PC UART definitions */
-#define BSP_UART_COM1 (0)
-#define BSP_UART_COM2 (1)
-
-/*
- * Base IO for UART
- */
-
-#define COM1_BASE_IO 0x3F8
-#define COM2_BASE_IO 0x2F8
-
-/*
- * Offsets from base
- */
-
-/* DLAB 0 */
-#define RBR (0) /* Rx Buffer Register (read) */
-#define THR (0) /* Tx Buffer Register (write) */
-#define IER (1) /* Interrupt Enable Register */
-
-/* DLAB X */
-#define IIR (2) /* Interrupt Ident Register (read) */
-#define FCR (2) /* FIFO Control Register (write) */
-#define LCR (3) /* Line Control Register */
-#define MCR (4) /* Modem Control Register */
-#define LSR (5) /* Line Status Register */
-#define MSR (6) /* Modem Status Register */
-#define SCR (7) /* Scratch register */
-
-/* DLAB 1 */
-#define DLL (0) /* Divisor Latch, LSB */
-#define DLM (1) /* Divisor Latch, MSB */
-#define AFR (2) /* Alternate Function register */
-
-/*
- * Interrupt source definition via IIR
- */
-#define MODEM_STATUS 0
-#define NO_MORE_INTR 1
-#define TRANSMITTER_HODING_REGISTER_EMPTY 2
-#define RECEIVER_DATA_AVAIL 4
-#define RECEIVER_ERROR 6
-#define CHARACTER_TIMEOUT_INDICATION 12
-
-/*
- * Bits definition of IER
- */
-#define RECEIVE_ENABLE 0x1
-#define TRANSMIT_ENABLE 0x2
-#define RECEIVER_LINE_ST_ENABLE 0x4
-#define MODEM_ENABLE 0x8
-#define INTERRUPT_DISABLE 0x0
-
-/*
- * Bits definition of the Line Status Register (LSR)
- */
-#define DR 0x01 /* Data Ready */
-#define OE 0x02 /* Overrun Error */
-#define PE 0x04 /* Parity Error */
-#define FE 0x08 /* Framing Error */
-#define BI 0x10 /* Break Interrupt */
-#define THRE 0x20 /* Transmitter Holding Register Empty */
-#define TEMT 0x40 /* Transmitter Empty */
-#define ERFIFO 0x80 /* Error receive Fifo */
-
-/*
- * Bits definition of the MODEM Control Register (MCR)
- */
-#define DTR 0x01 /* Data Terminal Ready */
-#define RTS 0x02 /* Request To Send */
-#define OUT_1 0x04 /* Output 1, (reserved on COMPAQ I/O Board) */
-#define OUT_2 0x08 /* Output 2, Enable Asynchronous Port Interrupts */
-#define LB 0x10 /* Enable Internal Loop Back */
-
-/*
- * Bits definition of the Line Control Register (LCR)
- */
-#define CHR_5_BITS 0
-#define CHR_6_BITS 1
-#define CHR_7_BITS 2
-#define CHR_8_BITS 3
-
-#define WL 0x03 /* Word length mask */
-#define STB 0x04 /* 1 Stop Bit, otherwise 2 Stop Bits */
-#define PEN 0x08 /* Parity Enabled */
-#define EPS 0x10 /* Even Parity Select, otherwise Odd */
-#define SP 0x20 /* Stick Parity */
-#define BCB 0x40 /* Break Control Bit */
-#define DLAB 0x80 /* Enable Divisor Latch Access */
-
-/*
- * Bits definition of the MODEM Status Register (MSR)
- */
-#define DCTS 0x01 /* Delta Clear To Send */
-#define DDSR 0x02 /* Delta Data Set Ready */
-#define TERI 0x04 /* Trailing Edge Ring Indicator */
-#define DDCD 0x08 /* Delta Carrier Detect Indicator */
-#define CTS 0x10 /* Clear To Send (when loop back is active) */
-#define DSR 0x20 /* Data Set Ready (when loop back is active) */
-#define RI 0x40 /* Ring Indicator (when loop back is active) */
-#define DCD 0x80 /* Data Carrier Detect (when loop back is active) */
-
-/*
- * Bits definition of the FIFO Control Register : WD16C552 or NS16550
- */
-
-#define FIFO_CTRL 0x01 /* Set to 1 permit access to other bits */
-#define FIFO_EN 0x01 /* Enable the FIFO */
-#define XMIT_RESET 0x02 /* Transmit FIFO Reset */
-#define RCV_RESET 0x04 /* Receive FIFO Reset */
-#define FCR3 0x08 /* do not understand manual! */
-
-#define RECEIVE_FIFO_TRIGGER1 0x0 /* trigger recieve interrupt after 1 byte */
-#define RECEIVE_FIFO_TRIGGER4 0x40 /* trigger recieve interrupt after 4 byte */
-#define RECEIVE_FIFO_TRIGGER8 0x80 /* trigger recieve interrupt after 8 byte */
-#define RECEIVE_FIFO_TRIGGER12 0xc0 /* trigger recieve interrupt after 12 byte */
-#define TRIG_LEVEL 0xc0 /* Mask for the trigger level */
-
-#endif /* _BSPUART_H */
-
-
-
diff --git a/c/src/lib/libbsp/i386/shared/io/Makefile.in b/c/src/lib/libbsp/i386/shared/io/Makefile.in
deleted file mode 100644
index 01fb16150b..0000000000
--- a/c/src/lib/libbsp/i386/shared/io/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bspIo.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-preinstall all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/i386/shared/io/bspIo.h b/c/src/lib/libbsp/i386/shared/io/bspIo.h
deleted file mode 100644
index 0ff070c4c5..0000000000
--- a/c/src/lib/libbsp/i386/shared/io/bspIo.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* bspIo.h
- *
- * This include file contains declaration of interface that
- * will be provided by the file contained in this directory.
- *
- *
- * COPYRIGHT (c) 1998 valette@crf.canon.fr
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-#ifndef _LIBBSP_I386_SHARED_IO_BSP_IO_H
-#define _LIBBSP_I386_SHARED_IO_BSP_IO_H
-
-/*
- * All the functions declared as extern after this comment
- * MUST be implemented in each BSP. Using this function,
- * this directory contains shared code that export higher level
- * functionnality described after the next command.
- */
-typedef void (*BSP_output_char_function_type) (char c);
-typedef char (*BSP_polling_getchar_function_type) (void);
-
-extern BSP_output_char_function_type BSP_output_char;
-extern BSP_polling_getchar_function_type BSP_poll_char;
-/*
- * All the function declared as extern after this comment
- * are available for each ix86 BSP by compiling and linking
- * the files contained in this directory PROVIDED definition
- * and initialisation of the previous variable are done.
- */
-void printk(char *fmt, ...);
-
-#endif
diff --git a/c/src/lib/libbsp/i386/shared/io/printk.c b/c/src/lib/libbsp/i386/shared/io/printk.c
deleted file mode 100644
index 7555fb6262..0000000000
--- a/c/src/lib/libbsp/i386/shared/io/printk.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*-------------------------------------------------------------------------+
-| printk.c v1.1 - PC386 BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is based on code by: Jose Rufino - IST
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <bspIo.h>
-#include <libcpu/cpu.h>
-
-/*-------------------------------------------------------------------------+
-| Function: printNum
-| Description: print number in a given base.
-| Global Variables: None.
-| Arguments: num - number to print, base - base used to print the number.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-static void
-printNum(long unsigned int num, int base, int sign)
-{
- long unsigned int n;
- int count;
- char toPrint[20];
-
- if ( (sign == 1) && ((long)num < 0) ) {
- BSP_output_char('-');
- num = -num;
- }
-
- count = 0;
- while ((n = num / base) > 0) {
- toPrint[count++] = (num - (n*base));
- num = n ;
- }
- toPrint[count++] = num;
-
- for (n = 0; n < count; n++){
- BSP_output_char("0123456789ABCDEF"[(int)(toPrint[count-(n+1)])]);
- }
-} /* printNum */
-
-
-/*-------------------------------------------------------------------------+
-| Function: printk
-| Description: a simplified version of printf intended for use when the
- console is not yet initialized or in ISR's.
-| Global Variables: None.
-| Arguments: as in printf: fmt - format string, ... - unnamed arguments.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void
-printk(char *fmt, ...)
-{
- va_list ap; /* points to each unnamed argument in turn */
- char c, *str;
- int lflag, base, sign;
- unsigned int level;
-
- _CPU_ISR_Disable(level);
-
- va_start(ap, fmt); /* make ap point to 1st unnamed arg */
- for (; *fmt != '\0'; fmt++)
- {
- lflag = 0;
- base = 0;
- sign = 0;
- if (*fmt == '%')
- {
- if ((c = *++fmt) == 'l')
- {
- lflag = 1;
- c = *++fmt;
- }
- switch (c)
- {
- case 'o': case 'O': base = 8; sign = 0; break;
- case 'd': case 'D': base = 10; sign = 1; break;
- case 'u': case 'U': base = 10; sign = 0; break;
- case 'x': case 'X': base = 16; sign = 0; break;
- case 's':
- for (str = va_arg(ap, char *); *str; str++)
- BSP_output_char(*str);
- break;
- case 'c':
- BSP_output_char(va_arg(ap, char));
- break;
- default:
- BSP_output_char(c);
- break;
- } /* switch*/
-
- if (base)
- printNum(lflag ? va_arg(ap, long int) : (long int)va_arg(ap, int),
- base, sign);
- }
- else
- {
- BSP_output_char(*fmt);
- }
- }
- va_end(ap); /* clean up when done */
- _CPU_ISR_Enable(level);
-
-} /* printk */
-
diff --git a/c/src/lib/libbsp/i386/shared/irq/Makefile.in b/c/src/lib/libbsp/i386/shared/irq/Makefile.in
deleted file mode 100644
index 098852cfa0..0000000000
--- a/c/src/lib/libbsp/i386/shared/irq/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/irq.h $(srcdir)/irq_asm.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-preinstall all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/i386/shared/irq/idt.c b/c/src/lib/libbsp/i386/shared/irq/idt.c
deleted file mode 100644
index 5f44bd0d2b..0000000000
--- a/c/src/lib/libbsp/i386/shared/irq/idt.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * cpu.c - This file contains implementation of C function to
- * Instanciate IDT entries. More detailled information can be found
- * on Intel site and more precisely in the following book :
- *
- * Pentium Processor familly
- * Developper's Manual
- *
- * Volume 3 : Architecture and Programming Manual
- *
- * Copyright (C) 1998 Eric Valette (valette@crf.canon.fr)
- * Canon Centre Recherche France.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <libcpu/cpu.h>
-#include <irq.h>
-
-static rtems_raw_irq_connect_data* raw_irq_table;
-static rtems_raw_irq_connect_data default_raw_irq_entry;
-static interrupt_gate_descriptor default_idt_entry;
-static rtems_raw_irq_global_settings* local_settings;
-
-void create_interrupt_gate_descriptor (interrupt_gate_descriptor* idtEntry,
- rtems_raw_irq_hdl hdl)
-{
- idtEntry->low_offsets_bits = (((unsigned) hdl) & 0xffff);
- idtEntry->segment_selector = i386_get_cs();
- idtEntry->fixed_value_bits = 0;
- idtEntry->gate_type = 0xe;
- idtEntry->privilege = 0;
- idtEntry->present = 1;
- idtEntry->high_offsets_bits = ((((unsigned) hdl) >> 16) & 0xffff);
-}
-
-rtems_raw_irq_hdl get_hdl_from_vector(rtems_vector_offset index)
-{
- rtems_raw_irq_hdl hdl;
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if(index >= limit) {
- return 0;
- }
-
- * ((unsigned int*) &hdl) = (idt_entry_tbl[index].low_offsets_bits |
- (idt_entry_tbl[index].high_offsets_bits << 16));
- return hdl;
-}
-
-int i386_set_idt_entry (const rtems_raw_irq_connect_data* irq)
-{
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
- unsigned int level;
-
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (irq->idtIndex >= limit) {
- return 0;
- }
- /*
- * Check if default handler is actually connected. If not issue an error.
- * You must first get the current handler via i386_get_current_idt_entry
- * and then disconnect it using i386_delete_idt_entry.
- * RATIONALE : to always have the same transition by forcing the user
- * to get the previous handler before accepting to disconnect.
- */
- if (get_hdl_from_vector(irq->idtIndex) != default_raw_irq_entry.hdl) {
- return 0;
- }
-
- _CPU_ISR_Disable(level);
-
- raw_irq_table [irq->idtIndex] = *irq;
- create_interrupt_gate_descriptor (&idt_entry_tbl[irq->idtIndex], irq->hdl);
- irq->on(irq);
-
- _CPU_ISR_Enable(level);
- return 1;
-}
-
-void _CPU_ISR_install_vector (unsigned vector,
- void* hdl,
- void** oldHdl)
-{
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
- interrupt_gate_descriptor new;
- unsigned int level;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (vector >= limit) {
- return;
- }
- _CPU_ISR_Disable(level)
- * ((unsigned int *) oldHdl) = idt_entry_tbl[vector].low_offsets_bits |
- (idt_entry_tbl[vector].high_offsets_bits << 16);
-
- create_interrupt_gate_descriptor(&new, hdl);
- idt_entry_tbl[vector] = new;
-
- _CPU_ISR_Enable(level);
-}
-
-int i386_get_current_idt_entry (rtems_raw_irq_connect_data* irq)
-{
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (irq->idtIndex >= limit) {
- return 0;
- }
- raw_irq_table [irq->idtIndex].hdl = get_hdl_from_vector(irq->idtIndex);
-
- *irq = raw_irq_table [irq->idtIndex];
-
- return 1;
-}
-
-int i386_delete_idt_entry (const rtems_raw_irq_connect_data* irq)
-{
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
- unsigned int level;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (irq->idtIndex >= limit) {
- return 0;
- }
- /*
- * Check if handler passed is actually connected. If not issue an error.
- * You must first get the current handler via i386_get_current_idt_entry
- * and then disconnect it using i386_delete_idt_entry.
- * RATIONALE : to always have the same transition by forcing the user
- * to get the previous handler before accepting to disconnect.
- */
- if (get_hdl_from_vector(irq->idtIndex) != irq->hdl){
- return 0;
- }
- _CPU_ISR_Disable(level);
-
- idt_entry_tbl[irq->idtIndex] = default_idt_entry;
-
- irq->off(irq);
-
- raw_irq_table[irq->idtIndex] = default_raw_irq_entry;
- raw_irq_table[irq->idtIndex].idtIndex = irq->idtIndex;
-
- _CPU_ISR_Enable(level);
-
- return 1;
-}
-
-/*
- * Caution this function assumes the IDTR has been already set.
- */
-int i386_init_idt (rtems_raw_irq_global_settings* config)
-{
- unsigned limit;
- unsigned i;
- unsigned level;
- interrupt_gate_descriptor* idt_entry_tbl;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (config->idtSize != limit) {
- return 0;
- }
- /*
- * store various accelarators
- */
- raw_irq_table = config->rawIrqHdlTbl;
- local_settings = config;
- default_raw_irq_entry = config->defaultRawEntry;
-
- _CPU_ISR_Disable(level);
-
- create_interrupt_gate_descriptor (&default_idt_entry, default_raw_irq_entry.hdl);
-
- for (i=0; i < limit; i++) {
- interrupt_gate_descriptor new;
- create_interrupt_gate_descriptor (&new, raw_irq_table[i].hdl);
- idt_entry_tbl[i] = new;
- if (raw_irq_table[i].hdl != default_raw_irq_entry.hdl) {
- raw_irq_table[i].on(&raw_irq_table[i]);
- }
- else {
- raw_irq_table[i].off(&raw_irq_table[i]);
- }
- }
- _CPU_ISR_Enable(level);
-
- return 1;
-}
-
-int i386_get_idt_config (rtems_raw_irq_global_settings** config)
-{
- *config = local_settings;
- return 1;
-}
-
-/*
- * Caution this function assumes the GDTR has been already set.
- */
-int i386_set_gdt_entry (unsigned short segment_selector, unsigned base,
- unsigned limit)
-{
- unsigned gdt_limit;
- unsigned short tmp_segment = 0;
- unsigned int limit_adjusted;
- segment_descriptors* gdt_entry_tbl;
-
-
- i386_get_info_from_GDTR (&gdt_entry_tbl, &gdt_limit);
-
- if (segment_selector > limit) {
- return 0;
- }
- /*
- * set up limit first
- */
- limit_adjusted = limit;
- if ( limit > 4095 ) {
- gdt_entry_tbl[segment_selector].granularity = 1;
- limit_adjusted /= 4096;
- }
- gdt_entry_tbl[segment_selector].limit_15_0 = limit_adjusted & 0xffff;
- gdt_entry_tbl[segment_selector].limit_19_16 = (limit_adjusted >> 16) & 0xf;
- /*
- * set up base
- */
- gdt_entry_tbl[segment_selector].base_address_15_0 = base & 0xffff;
- gdt_entry_tbl[segment_selector].base_address_23_16 = (base >> 16) & 0xff;
- gdt_entry_tbl[segment_selector].base_address_31_24 = (base >> 24) & 0xff;
- /*
- * set up descriptor type (this may well becomes a parameter if needed)
- */
- gdt_entry_tbl[segment_selector].type = 2; /* Data R/W */
- gdt_entry_tbl[segment_selector].descriptor_type = 1; /* Code or Data */
- gdt_entry_tbl[segment_selector].privilege = 0; /* ring 0 */
- gdt_entry_tbl[segment_selector].present = 1; /* not present */
-
- /*
- * Now, reload all segment registers so the limit takes effect.
- */
-
- asm volatile( "movw %%ds,%0 ; movw %0,%%ds
- movw %%es,%0 ; movw %0,%%es
- movw %%fs,%0 ; movw %0,%%fs
- movw %%gs,%0 ; movw %0,%%gs
- movw %%ss,%0 ; movw %0,%%ss"
- : "=r" (tmp_segment)
- : "0" (tmp_segment)
- );
-
- return 1;
-}
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq.c b/c/src/lib/libbsp/i386/shared/irq/irq.c
deleted file mode 100644
index cd38ec51c4..0000000000
--- a/c/src/lib/libbsp/i386/shared/irq/irq.c
+++ /dev/null
@@ -1,379 +0,0 @@
-/* irq.c
- *
- * This file contains the implementation of the function described in irq.h
- *
- * CopyRight (C) 1998 valette@crf.canon.fr
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <bsp.h>
-#include <irq.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/apiext.h>
-
-/*
- * pointer to the mask representing the additionnal irq vectors
- * that must be disabled when a particular entry is activated.
- * They will be dynamically computed from teh prioruty table given
- * in BSP_rtems_irq_mngt_set();
- * CAUTION : this table is accessed directly by interrupt routine
- * prologue.
- */
-rtems_i8259_masks irq_mask_or_tbl[BSP_IRQ_LINES_NUMBER];
-
-/*
- * Copy of data given via initial BSP_rtems_irq_mngt_set() for
- * the sake of efficiency.
- * CAUTION : this table is accessed directly by interrupt routine
- * prologue.
- */
-rtems_irq_hdl current_irq[BSP_IRQ_LINES_NUMBER];
-/*
- * default handler connected on each irq after bsp initialization
- */
-static rtems_irq_connect_data default_rtems_entry;
-
-/*
- * location used to store initial tables used for interrupt
- * management.
- */
-static rtems_irq_global_settings* internal_config;
-static rtems_irq_connect_data* rtems_hdl_tbl;
-/*-------------------------------------------------------------------------+
-| Cache for 1st and 2nd PIC IRQ line's status (enabled or disabled) register.
-+--------------------------------------------------------------------------*/
-/*
- * lower byte is interrupt mask on the master PIC.
- * while upper bits are interrupt on the slave PIC.
- * This cache is initialized in ldseg.s
- */
-rtems_i8259_masks i8259s_cache;
-
-/*-------------------------------------------------------------------------+
-| Function: BSP_irq_disable_at_i8259s
-| Description: Mask IRQ line in appropriate PIC chip.
-| Global Variables: i8259s_cache
-| Arguments: vector_offset - number of IRQ line to mask.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-int BSP_irq_disable_at_i8259s (const rtems_irq_symbolic_name irqLine)
-{
- unsigned short mask;
- unsigned int level;
-
- if ( ((int)irqLine < BSP_LOWEST_OFFSET) ||
- ((int)irqLine > BSP_MAX_OFFSET )
- )
- return 1;
-
- _CPU_ISR_Disable(level);
-
- mask = 1 << irqLine;
- i8259s_cache |= mask;
-
- if (irqLine < 8)
- {
- outport_byte(PIC_MASTER_IMR_IO_PORT, i8259s_cache & 0xff);
- }
- else
- {
- outport_byte(PIC_SLAVE_IMR_IO_PORT, ((i8259s_cache & 0xff00) > 8));
- }
- _CPU_ISR_Enable (level);
-
- return 0;
-}
-
-/*-------------------------------------------------------------------------+
-| Function: BSP_irq_enable_at_i8259s
-| Description: Unmask IRQ line in appropriate PIC chip.
-| Global Variables: i8259s_cache
-| Arguments: irqLine - number of IRQ line to mask.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-int BSP_irq_enable_at_i8259s (const rtems_irq_symbolic_name irqLine)
-{
- unsigned short mask;
- unsigned int level;
-
- if ( ((int)irqLine < BSP_LOWEST_OFFSET) ||
- ((int)irqLine > BSP_MAX_OFFSET )
- )
- return 1;
-
- _CPU_ISR_Disable(level);
-
- mask = ~(1 << irqLine);
- i8259s_cache &= mask;
-
- if (irqLine < 8)
- {
- outport_byte(PIC_MASTER_IMR_IO_PORT, i8259s_cache & 0xff);
- }
- else
- {
- outport_byte(PIC_SLAVE_IMR_IO_PORT, ((i8259s_cache & 0xff00) > 8));
- }
- _CPU_ISR_Enable (level);
-
- return 0;
-} /* mask_irq */
-
-int BSP_irq_enabled_at_i8259s (const rtems_irq_symbolic_name irqLine)
-{
- unsigned short mask;
-
- if ( ((int)irqLine < BSP_LOWEST_OFFSET) ||
- ((int)irqLine > BSP_MAX_OFFSET )
- )
- return 1;
-
- mask = (1 << irqLine);
- return (~(i8259s_cache & mask));
-}
-
-
-/*-------------------------------------------------------------------------+
-| Function: BSP_irq_ack_at_i8259s
-| Description: Signal generic End Of Interrupt (EOI) to appropriate PIC.
-| Global Variables: None.
-| Arguments: irqLine - number of IRQ line to acknowledge.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-int BSP_irq_ack_at_i8259s (const rtems_irq_symbolic_name irqLine)
-{
- if ( ((int)irqLine < BSP_LOWEST_OFFSET) ||
- ((int)irqLine > BSP_MAX_OFFSET )
- )
- return 1;
-
- if (irqLine >= 8) {
- outport_byte(PIC_SLAVE_COMMAND_IO_PORT, PIC_EOI);
- }
- outport_byte(PIC_MASTER_COMMAND_IO_PORT, PIC_EOI);
-
- return 0;
-
-} /* ackIRQ */
-
-/*
- * ------------------------ RTEMS Irq helper functions ----------------
- */
-
-/*
- * Caution : this function assumes the variable "internal_config"
- * is already set and that the tables it contains are still valid
- * and accessible.
- */
-static void compute_i8259_masks_from_prio ()
-{
- unsigned int i;
- unsigned int j;
- /*
- * Always mask at least current interrupt to prevent re-entrance
- */
- for (i=0; i < internal_config->irqNb; i++) {
- * ((unsigned short*) &irq_mask_or_tbl[i]) = (1 << i);
- for (j = 0; j < internal_config->irqNb; j++) {
- /*
- * Mask interrupts at i8259 level that have a lower priority
- */
- if (internal_config->irqPrioTbl [i] > internal_config->irqPrioTbl [j]) {
- * ((unsigned short*) &irq_mask_or_tbl[i]) |= (1 << j);
- }
- }
- }
-}
-
-/*
- * Caution : this function assumes the variable "internal_config"
- * is already set and that the tables it contains are still valid
- * and accessible.
- */
-static void make_copy_of_handlers ()
-{
- int i;
- for (i=0; i < internal_config->irqNb; i++) {
- current_irq [i] = internal_config->irqHdlTbl[i].hdl;
- }
-}
-
-
-/*
- * This function check that the value given for the irq line
- * is valid.
- */
-
-static int isValidInterrupt(int irq)
-{
- if ( (irq < BSP_LOWEST_OFFSET) || (irq > BSP_MAX_OFFSET))
- return 0;
- return 1;
-}
-
-/*
- * ------------------------ RTEMS Single Irq Handler Mngt Routines ----------------
- */
-
-int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
-{
- unsigned int level;
-
- if (!isValidInterrupt(irq->name)) {
- return 0;
- }
- /*
- * Check if default handler is actually connected. If not issue an error.
- * You must first get the current handler via i386_get_current_idt_entry
- * and then disconnect it using i386_delete_idt_entry.
- * RATIONALE : to always have the same transition by forcing the user
- * to get the previous handler before accepting to disconnect.
- */
- if (rtems_hdl_tbl[irq->name].hdl != default_rtems_entry.hdl) {
- return 0;
- }
- _CPU_ISR_Disable(level);
-
- /*
- * store the data provided by user
- */
- rtems_hdl_tbl[irq->name] = *irq;
- /*
- * update table used directly by rtems interrupt prologue
- */
- current_irq [irq->name] = irq->hdl;
- /*
- * Enable interrupt at PIC level
- */
- BSP_irq_enable_at_i8259s (irq->name);
- /*
- * Enable interrupt on device
- */
- irq->on(irq);
-
- _CPU_ISR_Enable(level);
-
- return 1;
-}
-
-
-int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* irq)
-{
- if (!isValidInterrupt(irq->name)) {
- return 0;
- }
- *irq = rtems_hdl_tbl[irq->name];
- return 1;
-}
-
-int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
-{
- unsigned int level;
-
- if (!isValidInterrupt(irq->name)) {
- return 0;
- }
- /*
- * Check if default handler is actually connected. If not issue an error.
- * You must first get the current handler via i386_get_current_idt_entry
- * and then disconnect it using i386_delete_idt_entry.
- * RATIONALE : to always have the same transition by forcing the user
- * to get the previous handler before accepting to disconnect.
- */
- if (rtems_hdl_tbl[irq->name].hdl != irq->hdl) {
- return 0;
- }
- _CPU_ISR_Disable(level);
-
- /*
- * disable interrupt at PIC level
- */
- BSP_irq_disable_at_i8259s (irq->name);
-
- /*
- * Disable interrupt on device
- */
- irq->off(irq);
-
- /*
- * restore the default irq value
- */
- rtems_hdl_tbl[irq->name] = default_rtems_entry;
-
- current_irq[irq->name] = default_rtems_entry.hdl;
-
- _CPU_ISR_Enable(level);
-
- return 1;
-}
-
-/*
- * ------------------------ RTEMS Global Irq Handler Mngt Routines ----------------
- */
-
-int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config)
-{
- int i;
- unsigned int level;
- /*
- * Store various code accelerators
- */
- internal_config = config;
- default_rtems_entry = config->defaultEntry;
- rtems_hdl_tbl = config->irqHdlTbl;
-
- _CPU_ISR_Disable(level);
- /*
- * set up internal tables used by rtems interrupt prologue
- */
- compute_i8259_masks_from_prio ();
- make_copy_of_handlers ();
-
- for (i=0; i < internal_config->irqNb; i++) {
- if (rtems_hdl_tbl[i].hdl != default_rtems_entry.hdl) {
- BSP_irq_enable_at_i8259s (i);
- rtems_hdl_tbl[i].on(&rtems_hdl_tbl[i]);
- }
- else {
- rtems_hdl_tbl[i].off(&rtems_hdl_tbl[i]);
- BSP_irq_disable_at_i8259s (i);
- }
- }
- /*
- * must disable slave pic anyway
- */
- BSP_irq_enable_at_i8259s (2);
- _CPU_ISR_Enable(level);
- return 1;
-}
-
-int BSP_rtems_irq_mngt_get(rtems_irq_global_settings** config)
-{
- *config = internal_config;
- return 0;
-}
-
-void _ThreadProcessSignalsFromIrq (CPU_Exception_frame* ctx)
-{
- /*
- * Process pending signals that have not already been
- * processed by _Thread_Displatch. This happens quite
- * unfrequently : the ISR must have posted an action
- * to the current running thread.
- */
- if ( _Thread_Do_post_task_switch_extension ||
- _Thread_Executing->do_post_task_switch_extension ) {
- _Thread_Executing->do_post_task_switch_extension = FALSE;
- _API_extensions_Run_postswitch();
- }
- /*
- * I plan to process other thread related events here.
- * This will include DEBUG session requsted from keyboard...
- */
-}
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq.h b/c/src/lib/libbsp/i386/shared/irq/irq.h
deleted file mode 100644
index 8bb6ce6f85..0000000000
--- a/c/src/lib/libbsp/i386/shared/irq/irq.h
+++ /dev/null
@@ -1,261 +0,0 @@
-/* irq.h
- *
- * This include file describe the data structure and the functions implemented
- * by rtems to write interrupt handlers.
- *
- * CopyRight (C) 1998 valette@crf.canon.fr
- *
- * This code is heavilly inspired by the public specification of STREAM V2
- * that can be found at :
- *
- * <http://www.chorus.com/Documentation/index.html> by following
- * the STREAM API Specification Document link.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#ifndef _IRQ_H_
-#define _IRQ_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Include some preprocessor value also used by assember code
- */
-
-#include <irq_asm.h>
-#include <rtems.h>
-/*-------------------------------------------------------------------------+
-| Constants
-+--------------------------------------------------------------------------*/
-
-typedef enum {
- /* Base vector for our IRQ handlers. */
- BSP_IRQ_VECTOR_BASE = BSP_ASM_IRQ_VECTOR_BASE,
- BSP_IRQ_LINES_NUMBER = 16,
- BSP_LOWEST_OFFSET = 0,
- BSP_MAX_OFFSET = BSP_IRQ_LINES_NUMBER - 1,
- /*
- * Interrupt offset in comparison to BSP_ASM_IRQ_VECTOR_BASE
- * NB : 1) Interrupt vector number in IDT = offset + BSP_ASM_IRQ_VECTOR_BASE
- * 2) The same name should be defined on all architecture
- * so that handler connexion can be unchanged.
- */
- BSP_PERIODIC_TIMER = 0,
-
- BSP_KEYBOARD = 1,
-
- BSP_UART_COM2_IRQ = 3,
-
- BSP_UART_COM1_IRQ = 4,
-
- BSP_RT_TIMER1 = 8,
-
- BSP_RT_TIMER3 = 10
-}rtems_irq_symbolic_name;
-
-
-
-
-/*
- * Type definition for RTEMS managed interrupts
- */
-typedef unsigned char rtems_irq_prio;
-typedef unsigned short rtems_i8259_masks;
-
-extern rtems_i8259_masks i8259s_cache;
-
-struct __rtems_irq_connect_data__; /* forward declaratiuon */
-
-typedef void (*rtems_irq_hdl) (void);
-typedef void (*rtems_irq_enable) (const struct __rtems_irq_connect_data__*);
-typedef void (*rtems_irq_disable) (const struct __rtems_irq_connect_data__*);
-typedef int (*rtems_irq_is_enabled) (const struct __rtems_irq_connect_data__*);
-
-typedef struct __rtems_irq_connect_data__ {
- /*
- * IRQ line
- */
- rtems_irq_symbolic_name name;
- /*
- * handler. See comment on handler properties below in function prototype.
- */
- rtems_irq_hdl hdl;
- /*
- * function for enabling interrupts at device level (ONLY!).
- * The BSP code will automatically enable it at i8259s level.
- * RATIONALE : anyway such code has to exist in current driver code.
- * It is usually called immediately AFTER connecting the interrupt handler.
- * RTEMS may well need such a function when restoring normal interrupt
- * processing after a debug session.
- *
- */
- rtems_irq_enable on;
- /*
- * function for disabling interrupts at device level (ONLY!).
- * The code will disable it at i8259s level. RATIONALE : anyway
- * such code has to exist for clean shutdown. It is usually called
- * BEFORE disconnecting the interrupt. RTEMS may well need such
- * a function when disabling normal interrupt processing for
- * a debug session. May well be a NOP function.
- */
- rtems_irq_disable off;
- /*
- * function enabling to know what interrupt may currently occur
- * if someone manipulates the i8259s interrupt mask without care...
- */
- rtems_irq_is_enabled isOn;
-}rtems_irq_connect_data;
-
-typedef struct {
- /*
- * size of all the table fields (*Tbl) described below.
- */
- unsigned int irqNb;
- /*
- * Default handler used when disconnecting interrupts.
- */
- rtems_irq_connect_data defaultEntry;
- /*
- * Table containing initials/current value.
- */
- rtems_irq_connect_data* irqHdlTbl;
- /*
- * actual value of BSP_IRQ_VECTOR_BASE...
- */
- rtems_irq_symbolic_name irqBase;
- /*
- * software priorities associated with interrupts.
- * if irqPrio [i] > intrPrio [j] it means that
- * interrupt handler hdl connected for interrupt name i
- * will not be interrupted by the handler connected for interrupt j
- * The interrupt source will be physically masked at i8259 level.
- */
- rtems_irq_prio* irqPrioTbl;
-}rtems_irq_global_settings;
-
-
-
-
-/*-------------------------------------------------------------------------+
-| Function Prototypes.
-+--------------------------------------------------------------------------*/
-/*
- * ------------------------ Intel 8259 (or emulation) Mngt Routines -------
- */
-
-/*
- * function to disable a particular irq at 8259 level. After calling
- * this function, even if the device asserts the interrupt line it will
- * not be propagated further to the processor
- */
-int BSP_irq_disable_at_i8259s (const rtems_irq_symbolic_name irqLine);
-/*
- * function to enable a particular irq at 8259 level. After calling
- * this function, if the device asserts the interrupt line it will
- * be propagated further to the processor
- */
-int BSP_irq_enable_at_i8259s (const rtems_irq_symbolic_name irqLine);
-/*
- * function to acknoledge a particular irq at 8259 level. After calling
- * this function, if a device asserts an enabled interrupt line it will
- * be propagated further to the processor. Mainly usefull for people
- * writting raw handlers as this is automagically done for rtems managed
- * handlers.
- */
-int BSP_irq_ack_at_i8259s (const rtems_irq_symbolic_name irqLine);
-/*
- * function to check if a particular irq is enabled at 8259 level. After calling
- */
-int BSP_irq_enabled_at_i8259s (const rtems_irq_symbolic_name irqLine);
-/*
- * ------------------------ RTEMS Single Irq Handler Mngt Routines ----------------
- */
-/*
- * function to connect a particular irq handler. This hanlder will NOT be called
- * directly as the result of the corresponding interrupt. Instead, a RTEMS
- * irq prologue will be called that will :
- *
- * 1) save the C scratch registers,
- * 2) switch to a interrupt stack if the interrupt is not nested,
- * 3) store the current i8259s' interrupt masks
- * 4) modify them to disable the current interrupt at 8259 level (and may
- * be others depending on software priorities)
- * 5) aknowledge the i8259s',
- * 6) demask the processor,
- * 7) call the application handler
- *
- * As a result the hdl function provided
- *
- * a) can perfectly be written is C,
- * b) may also well directly call the part of the RTEMS API that can be used
- * from interrupt level,
- * c) It only responsible for handling the jobs that need to be done at
- * the device level including (aknowledging/re-enabling the interrupt at device,
- * level, getting the data,...)
- *
- * When returning from the function, the following will be performed by
- * the RTEMS irq epilogue :
- *
- * 1) masks the interrupts again,
- * 2) restore the original i8259s' interrupt masks
- * 3) switch back on the orinal stack if needed,
- * 4) perform rescheduling when necessary,
- * 5) restore the C scratch registers...
- * 6) restore initial execution flow
- *
- */
-int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*);
-/*
- * function to get the current RTEMS irq handler for ptr->name. It enables to
- * define hanlder chain...
- */
-int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr);
-/*
- * function to get disconnect the RTEMS irq handler for ptr->name.
- * This function checks that the value given is the current one for safety reason.
- * The user can use the previous function to get it.
- */
-int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data*);
-
-/*
- * ------------------------ RTEMS Global Irq Handler Mngt Routines ----------------
- */
-/*
- * (Re) Initialize the RTEMS interrupt management.
- *
- * The result of calling this function will be the same as if each individual
- * handler (config->irqHdlTbl[i].hdl) different from "config->defaultEntry.hdl"
- * has been individualy connected via
- * BSP_install_rtems_irq_handler(&config->irqHdlTbl[i])
- * And each handler currently equal to config->defaultEntry.hdl
- * has been previously disconnected via
- * BSP_remove_rtems_irq_handler (&config->irqHdlTbl[i])
- *
- * This is to say that all information given will be used and not just
- * only the space.
- *
- * CAUTION : the various table address contained in config will be used
- * directly by the interrupt mangement code in order to save
- * data size so they must stay valid after the call => they should
- * not be modified or declared on a stack.
- */
-
-int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config);
-/*
- * (Re) get info on current RTEMS interrupt management.
- */
-int BSP_rtems_irq_mngt_get(rtems_irq_global_settings**);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _IRQ_H_ */
-/* end of include file */
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_asm.h b/c/src/lib/libbsp/i386/shared/irq/irq_asm.h
deleted file mode 100644
index af1289fb8f..0000000000
--- a/c/src/lib/libbsp/i386/shared/irq/irq_asm.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* irq_asm.h
- *
- * This include file has defines to represent some contant used
- * to program and manage the Intel 8259 interrupt controller
- *
- *
- * COPYRIGHT (c) 1998 valette@crf.canon.fr
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-#ifndef __IRQ_ASM_H__
-#define __IRQ_ASM_H__
-
-#define BSP_ASM_IRQ_VECTOR_BASE 0x20
- /* PIC's command and mask registers */
-#define PIC_MASTER_COMMAND_IO_PORT 0x20 /* Master PIC command register */
-#define PIC_SLAVE_COMMAND_IO_PORT 0xa0 /* Slave PIC command register */
-#define PIC_MASTER_IMR_IO_PORT 0x21 /* Master PIC Interrupt Mask Register */
-#define PIC_SLAVE_IMR_IO_PORT 0xa1 /* Slave PIC Interrupt Mask Register */
-
- /* Command for specific EOI (End Of Interrupt): Interrupt acknowledge */
-#define PIC_EOSI 0x60 /* End of Specific Interrupt (EOSI) */
-#define PIC_EOI 0x20 /* Generic End of Interrupt (EOI) */
-
-
-#endif
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_asm.s b/c/src/lib/libbsp/i386/shared/irq/irq_asm.s
deleted file mode 100644
index 4be08ed992..0000000000
--- a/c/src/lib/libbsp/i386/shared/irq/irq_asm.s
+++ /dev/null
@@ -1,250 +0,0 @@
-/* irq.c
- *
- * This file contains the implementation of the function described in irq.h
- *
- * CopyRight (C) 1998 valette@crf.canon.fr
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-#include <irq_asm.h>
-
- BEGIN_CODE
-
-SYM (_ISR_Handler):
- /*
- * Before this was point is reached the vectors unique
- * entry point did the following:
- *
- * 1. saved scratch registers registers eax edx ecx"
- * 2. put the vector number in ecx.
- *
- * BEGINNING OF ESTABLISH SEGMENTS
- *
- * WARNING: If an interrupt can occur when the segments are
- * not correct, then this is where we should establish
- * the segments. In addition to establishing the
- * segments, it may be necessary to establish a stack
- * in the current data area on the outermost interrupt.
- *
- * NOTE: If the previous values of the segment registers are
- * pushed, do not forget to adjust SAVED_REGS.
- *
- * NOTE: Make sure the exit code which restores these
- * when this type of code is needed.
- */
-
- /***** ESTABLISH SEGMENTS CODE GOES HERE ******/
-
- /*
- * END OF ESTABLISH SEGMENTS
- */
-
- /*
- * Now switch stacks if necessary
- */
-
- movw SYM (i8259s_cache), ax # move current i8259 interrupt mask in ax
- pushl eax # push it on the stack
- /*
- * compute the new PIC mask:
- *
- * <new mask> = <old mask> | irq_mask_or_tbl[<intr number aka ecx>]
- */
- movw SYM (irq_mask_or_tbl) (,ecx,2), dx
- orw dx, ax
- /*
- * Install new computed value on the i8259 and update cache
- * accordingly
- */
- movw ax, SYM (i8259s_cache)
- outb $PIC_MASTER_IMR_IO_PORT
- movb ah, al
- outb $PIC_SLAVE_IMR_IO_PORT
-
- /*
- * acknowledge the interrupt
- *
- */
- movb $PIC_EOI, al
- cmpl $7, ecx
- jbe .master
- outb $PIC_SLAVE_COMMAND_IO_PORT
-.master:
- outb $PIC_MASTER_COMMAND_IO_PORT
-
-.check_stack_switch:
- pushl ebp
- movl esp, ebp # ebp = previous stack pointer
- cmpl $0, SYM (_ISR_Nest_level) # is this the outermost interrupt?
- jne nested # No, then continue
- movl SYM (_CPU_Interrupt_stack_high), esp
-
- /*
- * We want to insure that the old stack pointer is on the
- * stack we will be on at the end of the ISR when we restore it.
- * By saving it on every interrupt, all we have to do is pop it
- * near the end of every interrupt.
- */
-
-nested:
- incl SYM (_ISR_Nest_level) # one nest level deeper
- incl SYM (_Thread_Dispatch_disable_level) # disable multitasking
- /*
- * re-enable interrupts at processor level as the current
- * interrupt source is now masked via i8259
- */
- sti
-
- /*
- * ECX is preloaded with the vector number but it is a scratch register
- * so we must save it again.
- */
-
- pushl ecx # push vector number
- mov SYM (current_irq) (,ecx,4),eax
- # eax = Users handler
- call *eax # invoke user ISR
- /*
- * disable interrupts_again
- */
- cli
- popl ecx # ecx = vector number
- /*
- * restore stack
- */
- movl ebp, esp
- popl ebp
-
- /*
- * restore the original i8259 masks
- */
- popl eax
- movw ax, SYM (i8259s_cache)
- outb $PIC_MASTER_IMR_IO_PORT
- movb ah, al
- outb $PIC_SLAVE_IMR_IO_PORT
-
-
- decl SYM (_ISR_Nest_level) # one less ISR nest level
- # If interrupts are nested,
- # then dispatching is disabled
-
- decl SYM (_Thread_Dispatch_disable_level)
- # unnest multitasking
- # Is dispatch disabled
- jne .exit # Yes, then exit
-
- cmpl $0, SYM (_Context_Switch_necessary)
- # Is task switch necessary?
- jne .schedule # Yes, then call the scheduler
-
- cmpl $0, SYM (_ISR_Signals_to_thread_executing)
- # signals sent to Run_thread
- # while in interrupt handler?
- je .exit # No, exit
-
-
-.bframe:
- movl $0, SYM (_ISR_Signals_to_thread_executing)
- /*
- * This code is the less critical path. In order to have a single
- * Thread Context, we take the same frame than the one pushed on
- * exceptions. This makes sense because Signal is a software
- * exception.
- */
- popl edx
- popl ecx
- popl eax
-
- pushl $0 # fake fault code
- pushl $0 # fake exception number
-
- pusha
- pushl esp
- call _ThreadProcessSignalsFromIrq
- addl $4, esp
- popa
- addl $8, esp
- iret
-
-.schedule:
- /*
- * the scratch registers have already been saved and we are already
- * back on the thread system stack. So we can call _Thread_Displatch
- * directly
- */
- call _Thread_Dispatch
- /*
- * fall through exit to restore complete contex (scratch registers
- * eip, CS, Flags).
- */
-.exit:
- /*
- * BEGINNING OF DE-ESTABLISH SEGMENTS
- *
- * NOTE: Make sure there is code here if code is added to
- * load the segment registers.
- *
- */
-
- /******* DE-ESTABLISH SEGMENTS CODE GOES HERE ********/
-
- /*
- * END OF DE-ESTABLISH SEGMENTS
- */
- popl edx
- popl ecx
- popl eax
- iret
-
-
-#define DISTINCT_INTERRUPT_ENTRY(_vector) \
- .p2align 4 ; \
- PUBLIC (rtems_irq_prologue_ ## _vector ) ; \
-SYM (rtems_irq_prologue_ ## _vector ): \
- pushl eax ; \
- pushl ecx ; \
- pushl edx ; \
- movl $ _vector, ecx ; \
- jmp SYM (_ISR_Handler) ;
-
-DISTINCT_INTERRUPT_ENTRY(0)
-DISTINCT_INTERRUPT_ENTRY(1)
-DISTINCT_INTERRUPT_ENTRY(2)
-DISTINCT_INTERRUPT_ENTRY(3)
-DISTINCT_INTERRUPT_ENTRY(4)
-DISTINCT_INTERRUPT_ENTRY(5)
-DISTINCT_INTERRUPT_ENTRY(6)
-DISTINCT_INTERRUPT_ENTRY(7)
-DISTINCT_INTERRUPT_ENTRY(8)
-DISTINCT_INTERRUPT_ENTRY(9)
-DISTINCT_INTERRUPT_ENTRY(10)
-DISTINCT_INTERRUPT_ENTRY(11)
-DISTINCT_INTERRUPT_ENTRY(12)
-DISTINCT_INTERRUPT_ENTRY(13)
-DISTINCT_INTERRUPT_ENTRY(14)
-DISTINCT_INTERRUPT_ENTRY(15)
-
- /*
- * routine used to initialize the IDT by default
- */
-
-PUBLIC (default_raw_idt_handler)
-PUBLIC (raw_idt_notify)
-
-SYM (default_raw_idt_handler):
- pusha
- cld
- call raw_idt_notify
- popa
- iret
-
-END_CODE
-
-END
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_init.c b/c/src/lib/libbsp/i386/shared/irq/irq_init.c
deleted file mode 100644
index 73cdf2e8c1..0000000000
--- a/c/src/lib/libbsp/i386/shared/irq/irq_init.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/* irq_init.c
- *
- * This file contains the implementation of rtems initialization
- * related to interrupt handling.
- *
- * CopyRight (C) 1998 valette@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.
- *
- * $Id$
- */
-
-#include <libcpu/cpu.h>
-#include <irq.h>
-#include <bsp.h>
-#include <bspIo.h>
-
-/*
- * rtems prologue generated in irq_asm.S
- */
-extern void rtems_irq_prologue_0();
-extern void rtems_irq_prologue_1();
-extern void rtems_irq_prologue_2();
-extern void rtems_irq_prologue_3();
-extern void rtems_irq_prologue_4();
-extern void rtems_irq_prologue_5();
-extern void rtems_irq_prologue_6();
-extern void rtems_irq_prologue_7();
-extern void rtems_irq_prologue_8();
-extern void rtems_irq_prologue_9();
-extern void rtems_irq_prologue_10();
-extern void rtems_irq_prologue_11();
-extern void rtems_irq_prologue_12();
-extern void rtems_irq_prologue_13();
-extern void rtems_irq_prologue_14();
-extern void rtems_irq_prologue_15();
-/*
- * default idt vector
- */
-extern void default_raw_idt_handler();
-/*
- * default on/off function
- */
-static void nop_func(){}
-/*
- * default isOn function
- */
-static int not_connected() {return 0;}
-
-
-static rtems_raw_irq_connect_data idtHdl[IDT_SIZE];
-
-/*
- * Table used to store rtems managed interrupt handlers.
- * Borrow the table to store raw handler entries at the beginning.
- * The table will be reinitialized before the call to BSP_rtems_irq_mngt_set().
- */
-static rtems_irq_connect_data rtemsIrq[BSP_IRQ_LINES_NUMBER] = {
- {0,(rtems_irq_hdl)rtems_irq_prologue_0},
- {0,(rtems_irq_hdl)rtems_irq_prologue_1},
- {0,(rtems_irq_hdl)rtems_irq_prologue_2},
- {0,(rtems_irq_hdl)rtems_irq_prologue_3},
- {0,(rtems_irq_hdl)rtems_irq_prologue_4},
- {0,(rtems_irq_hdl)rtems_irq_prologue_5},
- {0,(rtems_irq_hdl)rtems_irq_prologue_6},
- {0,(rtems_irq_hdl)rtems_irq_prologue_7},
- {0,(rtems_irq_hdl)rtems_irq_prologue_8},
- {0,(rtems_irq_hdl)rtems_irq_prologue_9},
- {0,(rtems_irq_hdl)rtems_irq_prologue_10},
- {0,(rtems_irq_hdl)rtems_irq_prologue_11},
- {0,(rtems_irq_hdl)rtems_irq_prologue_12},
- {0,(rtems_irq_hdl)rtems_irq_prologue_13},
- {0,(rtems_irq_hdl)rtems_irq_prologue_14},
- {0,(rtems_irq_hdl)rtems_irq_prologue_15}
-};
-
-static rtems_raw_irq_connect_data defaultRawIrq = {
- /* vectorIdex, hdl , on , off , isOn */
- 0, default_raw_idt_handler ,nop_func , nop_func, not_connected
-};
-
-static rtems_irq_connect_data defaultIrq = {
- /* vectorIdex, hdl , on , off , isOn */
- 0, nop_func , nop_func , nop_func , not_connected
-};
-
-static rtems_irq_prio irqPrioTable[BSP_IRQ_LINES_NUMBER]={
- /*
- * actual rpiorities for interrupt :
- * 0 means that only current interrupt is masked
- * 255 means all other interrupts are masked
- * The second entry has a priority of 255 because
- * it is the slave pic entry and is should always remain
- * unamsked.
- */
- 0,0,
- 255,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-
-
-static interrupt_gate_descriptor idtEntry;
-
-static rtems_irq_global_settings initial_config;
-static rtems_raw_irq_global_settings raw_initial_config;
-
-void raw_idt_notify()
-{
- printk("raw_idt_notify has been called \n");
-}
-
-void rtems_irq_mngt_init()
-{
- int i;
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned int limit;
- unsigned int level;
-
- i386_get_info_from_IDTR(&idt_entry_tbl, &limit);
-
- /* Convert into number of entries */
- limit = (limit + 1)/sizeof(interrupt_gate_descriptor);
-
- if(limit != IDT_SIZE) {
- printk("IDT table size mismatch !!! System locked\n");
- while(1);
- }
-
-
- _CPU_ISR_Disable(level);
-
- /*
- * Init the complete IDT vector table with defaultRawIrq value
- */
- for (i = 0; i < IDT_SIZE ; i++) {
- idtHdl[i] = defaultRawIrq;
- idtHdl[i].idtIndex = i;
- }
-
- raw_initial_config.idtSize = IDT_SIZE;
- raw_initial_config.defaultRawEntry = defaultRawIrq;
- raw_initial_config.rawIrqHdlTbl = idtHdl;
-
- if (!i386_init_idt (&raw_initial_config)) {
- /*
- * put something here that will show the failure...
- */
- printk("Unable to initialize IDT!!! System locked\n");
- while (1);
- }
- /*
- * Patch the entry that will be used by RTEMS for interrupt management
- * with RTEMS prologue.
- */
- for (i = 0; i < BSP_IRQ_LINES_NUMBER; i++) {
- create_interrupt_gate_descriptor(&idtEntry,(rtems_raw_irq_hdl) rtemsIrq[i].hdl);
- idt_entry_tbl[i + BSP_ASM_IRQ_VECTOR_BASE] = idtEntry;
- }
- /*
- * At this point we have completed the initialization of IDT
- * with raw handlers. We must now initialize the higher level
- * interrupt management.
- */
- /*
- * re-init the rtemsIrq table
- */
- for (i = 0; i < BSP_IRQ_LINES_NUMBER; i++) {
- rtemsIrq[i] = defaultIrq;
- rtemsIrq[i].name = i;
- }
- /*
- * Init initial Interrupt management config
- */
- initial_config.irqNb = BSP_IRQ_LINES_NUMBER;
- initial_config.defaultEntry = defaultIrq;
- initial_config.irqHdlTbl = rtemsIrq;
- initial_config.irqBase = BSP_ASM_IRQ_VECTOR_BASE;
- initial_config.irqPrioTbl = irqPrioTable;
-
- if (!BSP_rtems_irq_mngt_set(&initial_config)) {
- /*
- * put something here that will show the failure...
- */
- printk("Unable to initialize RTEMS interrupt Management!!! System locked\n");
- while (1);
- }
-
- /*
- * #define DEBUG
- */
-#ifdef DEBUG
- {
- /*
- * following adresses should be the same
- */
- unsigned tmp;
-
- printk("idt_entry_tbl = %x Interrupt_descriptor_table addr = %x\n",
- idt_entry_tbl, &Interrupt_descriptor_table);
- tmp = (unsigned) get_hdl_from_vector (BSP_ASM_IRQ_VECTOR_BASE + BSP_PERIODIC_TIMER);
- printk("clock isr address from idt = %x should be %x\n",
- tmp, (unsigned) rtems_irq_prologue_0);
- }
- printk("i8259s_cache = %x\n", * (unsigned short*) &i8259s_cache);
- BSP_wait_polled_input();
-#endif
- asm volatile ("sti");
-}
diff --git a/c/src/lib/libbsp/i386/shared/pci/Makefile.in b/c/src/lib/libbsp/i386/shared/pci/Makefile.in
deleted file mode 100644
index 607f26030a..0000000000
--- a/c/src/lib/libbsp/i386/shared/pci/Makefile.in
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/pcibios.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-preinstall all: $(SRCS)
- $(INSTALL) -m 444 $(SRCS) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/i386/shared/pci/pcibios.c b/c/src/lib/libbsp/i386/shared/pci/pcibios.c
deleted file mode 100644
index 483e5df2a9..0000000000
--- a/c/src/lib/libbsp/i386/shared/pci/pcibios.c
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
- * This software is Copyright (C) 1998 by T.sqware - all rights limited
- * It is provided in to the public domain "as is", can be freely modified
- * as far as this copyight notice is kept unchanged, but does not imply
- * an endorsement by T.sqware of the product in which it is included.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <assert.h>
-#include <pcibios.h>
-
-/*
- * This is simpliest possible PCI BIOS, it assumes that addressing
- * is flat and that stack is big enough
- */
-
-
-static int pcibInitialized = 0;
-static unsigned int pcibEntry;
-
-/*
- * Array to pass data between c and asm parts, at the time of
- * writing I am not yet that familiar with extended asm feature
- * of gcc. This code is not on performance path, so we can care
- * relatively little about performance here
- */
-static volatile unsigned int pcibExchg[5];
-
-static int pcib_convert_err(int err);
-
-/*
- * Detects presense of PCI BIOS, returns
- * error code
- */
-int
-pcib_init(void)
-{
- unsigned char *ucp;
- unsigned char sum;
- int i;
-
- pcibInitialized = 0;
-
- /* First, we have to look for BIOS-32 */
- for(ucp=(unsigned char *)0xE0000; ucp < (unsigned char *)0xFFFFF; ucp+=0x10)
- {
- if(memcmp(ucp, "_32_", 4) != 0)
- {
- continue;
- }
-
- /* Got signature, check length */
- if(*(ucp + 9) != 1)
- {
- continue;
- }
-
- /* Verify checksum */
- sum = 0;
- for(i=0; i<16; i++)
- {
- sum += *(ucp+i);
- }
-
- if(sum == 0)
- {
- /* found */
- break;
- }
- }
-
- if(ucp >= (unsigned char *)0xFFFFF)
- {
- /* BIOS-32 not found */
- assert(0);
- return PCIB_ERR_NOTPRESENT;
- }
-
- /* BIOS-32 found, let us find PCI BIOS */
- ucp += 4;
-
- pcibExchg[0] = *(unsigned int *)ucp;
-
- asm (" pusha"); /* Push all registers */
- asm (" movl pcibExchg, %edi"); /* Move entry point to esi */
- asm (" movl $0x49435024, %eax"); /* Move signature to eax */
- asm (" xorl %ebx, %ebx"); /* Zero ebx */
- asm (" pushl %cs");
- asm (" call *%edi"); /* Call entry */
- asm (" movl %eax, pcibExchg");
- asm (" movl %ebx, pcibExchg+4");
- asm (" movl %ecx, pcibExchg+8");
- asm (" movl %edx, pcibExchg+12");
- asm (" popa");
-
- if((pcibExchg[0] & 0xff) != 0)
- {
- /* Not found */
- assert(0);
- return PCIB_ERR_NOTPRESENT;
- }
-
- /* Found PCI entry point */
- pcibEntry = pcibExchg[1] + pcibExchg[3];
-
- /* Let us check whether PCI bios is present */
- pcibExchg[0] = pcibEntry;
-
- asm(" pusha");
- asm(" movl pcibExchg, %edi");
- asm(" movb $0xb1, %ah");
- asm(" movb $0x01, %al");
- asm (" pushl %cs");
- asm(" call *%edi");
- asm(" movl %eax, pcibExchg");
- asm(" movl %ebx, pcibExchg+4");
- asm(" movl %ecx, pcibExchg+8");
- asm(" movl %edx, pcibExchg+12");
- asm(" popa");
-
- if((pcibExchg[0] & 0xff00) != 0)
- {
- /* Not found */
- assert(0);
- return PCIB_ERR_NOTPRESENT;
- }
-
- if(pcibExchg[3] != 0x20494350)
- {
- /* Signature does not match */
- assert(0);
- return PCIB_ERR_NOTPRESENT;
- }
-
- /* Success */
-
- pcibInitialized = 1;
- return PCIB_ERR_SUCCESS;
-}
-
-/*
- * Find specified device and return its signature: combination
- * of bus number, device number and function number
- */
-int
-pcib_find_by_devid(int vendorId, int devId, int idx, int *sig)
-{
- if(!pcibInitialized)
- {
- assert(0);
- return PCIB_ERR_UNINITIALIZED;
- }
-
- pcibExchg[0] = pcibEntry;
- pcibExchg[1] = vendorId;
- pcibExchg[2] = devId;
- pcibExchg[3] = idx;
-
- asm(" pusha");
- asm(" movl pcibExchg, %edi");
- asm(" movb $0xb1, %ah");
- asm(" movb $0x02, %al");
- asm(" movl pcibExchg+4, %edx");
- asm(" movl pcibExchg+8, %ecx");
- asm(" movl pcibExchg+12, %esi");
- asm(" pushl %cs");
- asm(" call *%edi");
- asm(" movl %eax, pcibExchg");
- asm(" movl %ebx, pcibExchg+4");
- asm(" popa");
-
- *sig = pcibExchg[1] & 0xffff;
-
- return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
-}
-
-/*
- * Find specified class code return device signature: combination
- * of bus number, device number and function number
- */
-int
-pcib_find_by_class(int classCode, int idx, int *sig)
-{
- if(!pcibInitialized)
- {
- assert(0);
- return PCIB_ERR_UNINITIALIZED;
- }
-
- pcibExchg[0] = pcibEntry;
- pcibExchg[1] = classCode;
- pcibExchg[2] = idx;
-
- asm(" pusha");
- asm(" movl pcibExchg, %edi");
- asm(" movb $0xb1, %ah");
- asm(" movb $0x03, %al");
- asm(" movl pcibExchg+4, %ecx");
- asm(" movl pcibExchg+8, %esi");
- asm(" pushl %cs");
- asm(" call *%edi");
- asm(" movl %eax, pcibExchg");
- asm(" movl %ebx, pcibExchg+4");
- asm(" popa");
-
- if((pcibExchg[0] & 0xff00) != 0)
- {
- return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
- }
-
- *sig = pcibExchg[1] & 0xffff;
-
- return PCIB_ERR_SUCCESS;
-}
-
-
-
-/*
- * Generate Special Cycle
- */
-int
-pcib_special_cycle(int busNo, int data)
-{
- if(!pcibInitialized)
- {
- assert(0);
- return PCIB_ERR_UNINITIALIZED;
- }
-
- pcibExchg[0] = pcibEntry;
- pcibExchg[1] = busNo << 8;
- pcibExchg[2] = data;
-
- asm(" pusha");
- asm(" movl pcibExchg, %edi");
- asm(" movb $0xb1, %ah");
- asm(" movb $0x06, %al");
- asm(" movl pcibExchg+4, %ebx");
- asm(" movl pcibExchg+8, %edx");
- asm(" pushl %cs");
- asm(" call *%edi");
- asm(" movl %eax, pcibExchg");
- asm(" movl %ebx, pcibExchg+4");
- asm(" popa");
-
- return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
-}
-
-
-/*
- * Read byte from config space
- */
-int
-pcib_conf_read8(int sig, int off, unsigned char *data)
-{
- if(!pcibInitialized)
- {
- assert(0);
- return PCIB_ERR_UNINITIALIZED;
- }
-
- pcibExchg[0] = pcibEntry;
- pcibExchg[1] = sig;
- pcibExchg[2] = off;
-
- asm(" pusha");
- asm(" movl pcibExchg, %esi");
- asm(" movb $0xb1, %ah");
- asm(" movb $0x08, %al");
- asm(" movl pcibExchg+4, %ebx");
- asm(" movl pcibExchg+8, %edi");
- asm(" pushl %cs");
- asm(" call *%esi");
- asm(" movl %eax, pcibExchg");
- asm(" movl %ecx, pcibExchg+4");
- asm(" popa");
-
- if((pcibExchg[0] & 0xff00) != 0)
- {
- return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
- }
-
- *data = (unsigned char)pcibExchg[1] & 0xff;
-
- return PCIB_ERR_SUCCESS;
-}
-
-
-/*
- * Read word from config space
- */
-int
-pcib_conf_read16(int sig, int off, unsigned short *data)
-{
- if(!pcibInitialized)
- {
- assert(0);
- return PCIB_ERR_UNINITIALIZED;
- }
-
- pcibExchg[0] = pcibEntry;
- pcibExchg[1] = sig;
- pcibExchg[2] = off;
-
- asm(" pusha");
- asm(" movl pcibExchg, %esi");
- asm(" movb $0xb1, %ah");
- asm(" movb $0x09, %al");
- asm(" movl pcibExchg+4, %ebx");
- asm(" movl pcibExchg+8, %edi");
- asm(" pushl %cs");
- asm(" call *%esi");
- asm(" movl %eax, pcibExchg");
- asm(" movl %ecx, pcibExchg+4");
- asm(" popa");
-
- if((pcibExchg[0] & 0xff00) != 0)
- {
- return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
- }
-
- *data = (unsigned short)pcibExchg[1] & 0xffff;
-
- return PCIB_ERR_SUCCESS;
-}
-
-
-/*
- * Read dword from config space
- */
-int
-pcib_conf_read32(int sig, int off, unsigned int *data)
-{
- if(!pcibInitialized)
- {
- assert(0);
- return PCIB_ERR_UNINITIALIZED;
- }
-
- pcibExchg[0] = pcibEntry;
- pcibExchg[1] = sig;
- pcibExchg[2] = off;
-
- asm(" pusha");
- asm(" movl pcibExchg, %esi");
- asm(" movb $0xb1, %ah");
- asm(" movb $0x0a, %al");
- asm(" movl pcibExchg+4, %ebx");
- asm(" movl pcibExchg+8, %edi");
- asm(" pushl %cs");
- asm(" call *%esi");
- asm(" movl %eax, pcibExchg");
- asm(" movl %ecx, pcibExchg+4");
- asm(" popa");
-
- if((pcibExchg[0] & 0xff00) != 0)
- {
- return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
- }
-
- *data = (unsigned int)pcibExchg[1];
-
- return PCIB_ERR_SUCCESS;
-}
-
-
-/*
- * Write byte into config space
- */
-int
-pcib_conf_write8(int sig, int off, unsigned int data)
-{
- if(!pcibInitialized)
- {
- assert(0);
- return PCIB_ERR_UNINITIALIZED;
- }
-
- pcibExchg[0] = pcibEntry;
- pcibExchg[1] = sig;
- pcibExchg[2] = off;
- pcibExchg[3] = data & 0xff;
-
- asm(" pusha");
- asm(" movl pcibExchg, %esi");
- asm(" movb $0xb1, %ah");
- asm(" movb $0x0b, %al");
- asm(" movl pcibExchg+4, %ebx");
- asm(" movl pcibExchg+8, %edi");
- asm(" movl pcibExchg+12, %ecx");
- asm(" pushl %cs");
- asm(" call *%esi");
- asm(" movl %eax, pcibExchg");
- asm(" popa");
-
- return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
-}
-
-/*
- * Write word into config space
- */
-int
-pcib_conf_write16(int sig, int off, unsigned int data)
-{
- if(!pcibInitialized)
- {
- assert(0);
- return PCIB_ERR_UNINITIALIZED;
- }
-
- pcibExchg[0] = pcibEntry;
- pcibExchg[1] = sig;
- pcibExchg[2] = off;
- pcibExchg[3] = data & 0xffff;
-
- asm(" pusha");
- asm(" movl pcibExchg, %esi");
- asm(" movb $0xb1, %ah");
- asm(" movb $0x0c, %al");
- asm(" movl pcibExchg+4, %ebx");
- asm(" movl pcibExchg+8, %edi");
- asm(" movl pcibExchg+12, %ecx");
- asm(" pushl %cs");
- asm(" call *%esi");
- asm(" movl %eax, pcibExchg");
- asm(" popa");
-
- return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
-}
-
-
-
-/*
- * Write dword into config space
- */
-int
-pcib_conf_write32(int sig, int off, unsigned int data)
-{
- if(!pcibInitialized)
- {
- assert(0);
- return PCIB_ERR_UNINITIALIZED;
- }
-
- pcibExchg[0] = pcibEntry;
- pcibExchg[1] = sig;
- pcibExchg[2] = off;
- pcibExchg[3] = data;
-
- asm(" pusha");
- asm(" movl pcibExchg, %esi");
- asm(" movb $0xb1, %ah");
- asm(" movb $0x0d, %al");
- asm(" movl pcibExchg+4, %ebx");
- asm(" movl pcibExchg+8, %edi");
- asm(" movl pcibExchg+12, %ecx");
- asm(" pushl %cs");
- asm(" call *%esi");
- asm(" movl %eax, pcibExchg");
- asm(" popa");
-
- return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
-}
-
-
-static int
-pcib_convert_err(int err)
-{
- switch(err & 0xff)
- {
- case 0:
- return PCIB_ERR_SUCCESS;
- case 0x81:
- return PCIB_ERR_NOFUNC;
- case 0x83:
- return PCIB_ERR_BADVENDOR;
- case 0x86:
- return PCIB_ERR_DEVNOTFOUND;
- case 0x87:
- return PCIB_ERR_BADREG;
- default:
- assert(0);
- break;
- }
- return PCIB_ERR_NOFUNC;
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/c/src/lib/libbsp/i386/shared/pci/pcibios.h b/c/src/lib/libbsp/i386/shared/pci/pcibios.h
deleted file mode 100644
index 40bc3c861a..0000000000
--- a/c/src/lib/libbsp/i386/shared/pci/pcibios.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * This software is Copyright (C) 1998 by T.sqware - all rights limited
- * It is provided in to the public domain "as is", can be freely modified
- * as far as this copyight notice is kept unchanged, but does not imply
- * an endorsement by T.sqware of the product in which it is included.
- */
-
-#ifndef _PCIB_H
-#define _PCIB_H
-
-/* Error codes */
-#define PCIB_ERR_SUCCESS (0)
-#define PCIB_ERR_UNINITIALIZED (-1) /* PCI BIOS is not initilized */
-#define PCIB_ERR_NOTPRESENT (-2) /* PCI BIOS not present */
-#define PCIB_ERR_NOFUNC (-3) /* Function not supported */
-#define PCIB_ERR_BADVENDOR (-4) /* Bad Vendor ID */
-#define PCIB_ERR_DEVNOTFOUND (-5) /* Device not found */
-#define PCIB_ERR_BADREG (-6) /* Bad register number */
-
-/*
- * Make device signature from bus number, device numebr and function
- * number
- */
-#define PCIB_DEVSIG_MAKE(b,d,f) ((b<<8)|(d<<3)|(f))
-
-/*
- * Extract valrous part from device signature
- */
-#define PCIB_DEVSIG_BUS(x) (((x)>>8) &0xff)
-#define PCIB_DEVSIG_DEV(x) (((x)>>3) & 0x1f)
-#define PCIB_DEVSIG_FUNC(x) ((x) & 0x7)
-
-int pcib_init(void);
-int pcib_find_by_devid(int vendorId, int devId, int idx, int *sig);
-int pcib_find_by_class(int classCode, int idx, int *sig);
-int pcib_special_cycle(int busNo, int data);
-int pcib_conf_read8(int sig, int off, unsigned char *data);
-int pcib_conf_read16(int sig, int off, unsigned short *data);
-int pcib_conf_read32(int sig, int off, unsigned int *data);
-int pcib_conf_write8(int sig, int off, unsigned int data);
-int pcib_conf_write16(int sig, int off, unsigned int data);
-int pcib_conf_write32(int sig, int off, unsigned int data);
-
-
-#endif /* _PCIB_H */
-
diff --git a/c/src/lib/libbsp/i960/Makefile.in b/c/src/lib/libbsp/i960/Makefile.in
deleted file mode 100644
index f049e9b2e8..0000000000
--- a/c/src/lib/libbsp/i960/Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# Descend into the $(RTEMS_BSP_FAMILY) directory
-SUB_DIRS=$(RTEMS_BSP_FAMILY)
diff --git a/c/src/lib/libbsp/i960/cvme961/Makefile.in b/c/src/lib/libbsp/i960/cvme961/Makefile.in
deleted file mode 100644
index 7a8d6260ed..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include startup clock console shmsupp timer wrapup
diff --git a/c/src/lib/libbsp/i960/cvme961/bsp_specs b/c/src/lib/libbsp/i960/cvme961/bsp_specs
deleted file mode 100644
index 4ee806f718..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start.o%s} \
-%{qrtems_debug: start_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e _start}
-
diff --git a/c/src/lib/libbsp/i960/cvme961/clock/Makefile.in b/c/src/lib/libbsp/i960/cvme961/clock/Makefile.in
deleted file mode 100644
index 59df4f2702..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/clock/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i960/cvme961/clock/ckinit.c b/c/src/lib/libbsp/i960/cvme961/clock/ckinit.c
deleted file mode 100644
index a8703c44a6..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/clock/ckinit.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* Clock_init()
- *
- * This routine initializes the timer on the VIC chip on the CVME961.
- * The tick frequency is 1 millisecond.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#define CLOCK_VECTOR 5
-
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-i960_isr_entry Old_ticker;
-volatile rtems_unsigned32 Clock_driver_ticks;
- /* ticks since initialization */
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-
-/* this is later in the file to avoid it being inlined */
-rtems_isr Clock_isr( rtems_vector_number vector );
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
- volatile unsigned char *victimer;
-
- Clock_driver_ticks = 0;
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- Old_ticker = set_vector( clock_isr, CLOCK_VECTOR, 1 );
- victimer = (volatile unsigned char *) 0xa00000c3;
- *victimer = 0x12;
- *victimer = 0x92; /* 1000 HZ */
- }
-}
-
-void Clock_exit()
-{
- unsigned char *victimer;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- victimer = (unsigned char *) 0xa00000c3;
- *victimer = 0x12;
- i960_mask_intr( 5 );
- /* do not restore old vector */
- }
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- atexit( Clock_exit );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
- /* enable_tracing(); */
- Clock_driver_ticks += 1;
- if ( Clock_isrs == 1 ) {
- rtems_clock_tick();
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
- }
- else
- Clock_isrs -= 1;
- i960_clear_intr( 5 );
-}
-
diff --git a/c/src/lib/libbsp/i960/cvme961/console/Makefile.in b/c/src/lib/libbsp/i960/cvme961/console/Makefile.in
deleted file mode 100644
index fd05ddfedd..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i960/cvme961/console/console.c b/c/src/lib/libbsp/i960/cvme961/console/console.c
deleted file mode 100644
index ef24efd754..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/console/console.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * This file contains the CVME961 console IO package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 C961_INIT
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * NINDY_IO( ... )
- *
- * Interface to NINDY.
- */
-
-#define NINDY_INPUT 0
-#define NINDY_OUTPUT 1
-
-void NINDY_IO();
-
-void ___NINDY_IO_WRAPPER( void ) /* never called */
-{
- asm volatile ( " .text" );
- asm volatile ( " .align 4" );
- asm volatile ( " .globl _NINDY_IO" );
- asm volatile ( "_NINDY_IO:" );
- asm volatile ( " calls 0 /* call console routines */" );
- asm volatile ( " ret" );
-}
-
-/* inbyte
- *
- * This routine reads a character from the console using NINDY.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- * character read from UART
- */
-
-char inbyte( void )
-{
- char ch;
-
- NINDY_IO( NINDY_INPUT, &ch );
- return ch;
-}
-
-
-/* outbyte
- *
- * This routine transmits a character out the console using NINDY.
- *
- * Input parameters:
- * ch - character to be transmitted
- *
- * Output parameters: NONE
- */
-
-void outbyte(
- char ch
-)
-{
- NINDY_IO( NINDY_OUTPUT, ch );
-}
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte();
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r');
- }
- outbyte( buffer[ count ] );
- }
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libbsp/i960/cvme961/include/Makefile.in b/c/src/lib/libbsp/i960/cvme961/include/Makefile.in
deleted file mode 100644
index 8cf95dc7c3..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/include/Makefile.in
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-# If you add equate files, don't forget to uncomment the install line
-# below.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)/cpu
-
-install: all
diff --git a/c/src/lib/libbsp/i960/cvme961/include/bsp.h b/c/src/lib/libbsp/i960/cvme961/include/bsp.h
deleted file mode 100644
index ce55317090..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/include/bsp.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* bsp.h
- *
- * This include file contains some definitions specific to the
- * Cyclone CVME960 and CVME961 boards. These boards are the
- * same except the 960 uses SRAM and the 961 DRAM.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __CVME961_h
-#define __CVME961_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <iosupp.h>
-#include <console.h>
-#include <clockdrv.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Define the interrupt mechanism for Time Test 27
- *
- * NOTE: Following are for i960CA and are board independent
- *
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), 6, 1 )
-
-#define Cause_tm27_intr() i960_cause_intr( 0x62 )
-
-#define Clear_tm27_intr() i960_clear_intr( 6 )
-
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( microseconds ) \
- { register rtems_unsigned32 _delay=(microseconds); \
- register rtems_unsigned32 _tmp = 0; /* initialized to avoid warning */ \
- asm volatile( "0: \
- remo 3,31,%0 ; \
- cmpo 0,%0 ; \
- subo 1,%1,%1 ; \
- cmpobne.t 0,%1,0b " \
- : "=d" (_tmp), "=d" (_delay) \
- : "0" (_tmp), "1" (_delay) ); \
- }
-
-/* Constants */
-
-#define RAM_START 0
-#define RAM_END 0x100000
-
-/* NINDY console I/O requests:
- * CO sends a single character to stdout,
- * CI reads one.
- */
-
-#define NINDY_INPUT 0
-#define NINDY_OUTPUT 1
-
-/*
- * get_prcb
- *
- * Returns the PRCB pointer.
- */
-
-static inline i960ca_PRCB *get_prcb( void )
-{
- register i960ca_PRCB *_prcb = 0;
-
- asm volatile( "calls 5; \
- mov g0,%0" \
- : "=d" (_prcb) \
- : "0" (_prcb) );
- return ( _prcb );
-}
-
-#ifdef C961_INIT
-#undef BSP_EXTERN
-#define BSP_EXTERN
-#else
-#undef BSP_EXTERN
-#define BSP_EXTERN extern
-#endif
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-BSP_EXTERN i960ca_PRCB *Prcb;
-BSP_EXTERN i960ca_control_table *Ctl_tbl;
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-i960_isr_entry set_vector( rtems_isr_entry, unsigned int, unsigned int );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/i960/cvme961/include/coverhd.h b/c/src/lib/libbsp/i960/cvme961/include/coverhd.h
deleted file mode 100644
index 4212277865..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/include/coverhd.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C on this target.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
-#define CALLING_OVERHEAD_TASK_CREATE 0
-#define CALLING_OVERHEAD_TASK_IDENT 0
-#define CALLING_OVERHEAD_TASK_START 0
-#define CALLING_OVERHEAD_TASK_RESTART 0
-#define CALLING_OVERHEAD_TASK_DELETE 0
-#define CALLING_OVERHEAD_TASK_SUSPEND 0
-#define CALLING_OVERHEAD_TASK_RESUME 0
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
-#define CALLING_OVERHEAD_TASK_MODE 0
-#define CALLING_OVERHEAD_TASK_GET_NOTE 0
-#define CALLING_OVERHEAD_TASK_SET_NOTE 0
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 3
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
-#define CALLING_OVERHEAD_CLOCK_GET 3
-#define CALLING_OVERHEAD_CLOCK_SET 3
-#define CALLING_OVERHEAD_CLOCK_TICK 0
-
-#define CALLING_OVERHEAD_TIMER_CREATE 0
-#define CALLING_OVERHEAD_TIMER_IDENT 0
-#define CALLING_OVERHEAD_TIMER_DELETE 0
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 6
-#define CALLING_OVERHEAD_TIMER_RESET 0
-#define CALLING_OVERHEAD_TIMER_CANCEL 0
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
-
-#define CALLING_OVERHEAD_EVENT_SEND 0
-#define CALLING_OVERHEAD_EVENT_RECEIVE 0
-#define CALLING_OVERHEAD_SIGNAL_CATCH 0
-#define CALLING_OVERHEAD_SIGNAL_SEND 0
-#define CALLING_OVERHEAD_PARTITION_CREATE 0
-#define CALLING_OVERHEAD_PARTITION_IDENT 0
-#define CALLING_OVERHEAD_PARTITION_DELETE 0
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
-#define CALLING_OVERHEAD_REGION_CREATE 0
-#define CALLING_OVERHEAD_REGION_IDENT 0
-#define CALLING_OVERHEAD_REGION_DELETE 0
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
-#define CALLING_OVERHEAD_PORT_CREATE 0
-#define CALLING_OVERHEAD_PORT_IDENT 0
-#define CALLING_OVERHEAD_PORT_DELETE 0
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 0
-#define CALLING_OVERHEAD_IO_OPEN 0
-#define CALLING_OVERHEAD_IO_CLOSE 0
-#define CALLING_OVERHEAD_IO_READ 0
-#define CALLING_OVERHEAD_IO_WRITE 0
-#define CALLING_OVERHEAD_IO_CONTROL 0
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/i960/cvme961/shmsupp/Makefile.in b/c/src/lib/libbsp/i960/cvme961/shmsupp/Makefile.in
deleted file mode 100644
index 031a0aa0cd..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/shmsupp/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/shmsupp.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=addrconv getcfg lock mpisr
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/i960/cvme961/shmsupp/addrconv.c b/c/src/lib/libbsp/i960/cvme961/shmsupp/addrconv.c
deleted file mode 100644
index e45dd60128..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/shmsupp/addrconv.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Shm_Convert_address
- *
- * This routine takes into account the peculiar short VME address
- * of the CVME961 board. The CVME961 maps short address space
- * 0xffffxxxx to 0xb400xxxx.
- *
- * Input parameters:
- * address - address to convert
- *
- * Output parameters:
- * returns - converted address
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include "shm.h"
-
-void *Shm_Convert_address(
- void *address
-)
-{
- rtems_unsigned32 workaddr = (rtems_unsigned32) address;
-
- if ( workaddr >= 0xffff0000 )
- workaddr = (workaddr & 0xffff) | 0xb4000000;
- return ( (rtems_unsigned32 *)workaddr );
-}
diff --git a/c/src/lib/libbsp/i960/cvme961/shmsupp/getcfg.c b/c/src/lib/libbsp/i960/cvme961/shmsupp/getcfg.c
deleted file mode 100644
index 4894898c73..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/shmsupp/getcfg.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* void Shm_Get_configuration( localnode, &shmcfg )
- *
- * This routine initializes, if necessary, and returns a pointer
- * to the Shared Memory Configuration Table for the Cyclone CVME961.
- *
- * INPUT PARAMETERS:
- * localnode - local node number
- * shmcfg - address of pointer to SHM Config Table
- *
- * OUTPUT PARAMETERS:
- * *shmcfg - pointer to SHM Config Table
- *
- * NOTES: CVME961 target system has onboard dual-ported memory. This
- * file uses the USE_ONBOARD_RAM macro to determine if this
- * RAM is to be used as the SHM. If so (i.e. USE_ONBOARD_RAM
- * is set to 1), it is assumed that the master node's dual
- * ported memory will be used and that it is configured
- * correctly. The node owning the memory CANNOT access it
- * using a local address. The "if" insures that the MASTER
- * node uses a local address to access the dual-ported memory.
- *
- * The interprocessor interrupt used on the CVME961 is generated
- * by the VIC068. The ICMS capablities of the VIC068 are used
- * to generate interprocessor interrupts for up to eight nodes.
- *
- * The following table illustrates the configuration limitations:
- *
- * BUS MAX
- * MODE ENDIAN NODES
- * ========= ====== =======
- * POLLED LITTLE 2+
- * INTERRUPT LITTLE 2-8
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.h"
-
-#define USE_ONBOARD_RAM 0 /* use onboard (1) or VME RAM */
- /* for SHM communications */
-
-#define INTERRUPT 1 /* CVME961 target supports both */
-#define POLLING 0 /* polling and interrupt modes */
-
-
-shm_config_table BSP_shm_cfgtbl;
-
-void Shm_Get_configuration(
- rtems_unsigned32 localnode,
- shm_config_table **shmcfg
-)
-{
-#if ( USE_ONBOARD_RAM == 1 )
- if ( Shm_RTEMS_MP_Configuration->node == MASTER )
- BSP_shm_cfgtbl.base = (rtems_unsigned32 *)0x00300000;
- else
- BSP_shm_cfgtbl.base = (rtems_unsigned32 *)0x10300000;
-#else
- BSP_shm_cfgtbl.base = (rtems_unsigned32 *)0x20000000;
-#endif
-
- BSP_shm_cfgtbl.length = 1 * MEGABYTE;
- BSP_shm_cfgtbl.format = SHM_LITTLE;
-
- BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt;
-
-#ifdef NEUTRAL_BIG
- BSP_shm_cfgtbl.convert = (void *)CPU_swap_u32;
-#else
- BSP_shm_cfgtbl.convert = NULL_CONVERT;
-#endif
-
-#if (POLLING==1)
- BSP_shm_cfgtbl.poll_intr = POLLED_MODE;
- BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT;
-#else
- BSP_shm_cfgtbl.poll_intr = INTR_MODE;
- BSP_shm_cfgtbl.Intr.address =
- (rtems_unsigned32 *) (0xffff0021|((localnode-1) << 12));
- /* use ICMS0 */
- BSP_shm_cfgtbl.Intr.value = 1;
- BSP_shm_cfgtbl.Intr.length = BYTE;
-#endif
-
- *shmcfg = &BSP_shm_cfgtbl;
-
-}
diff --git a/c/src/lib/libbsp/i960/cvme961/shmsupp/lock.c b/c/src/lib/libbsp/i960/cvme961/shmsupp/lock.c
deleted file mode 100644
index 80e24ac1ec..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/shmsupp/lock.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Shared Memory Lock Routines
- *
- * This shared memory locked queue support routine need to be
- * able to lock the specified locked queue. Interrupts are
- * disabled while the queue is locked to prevent preemption
- * and deadlock when two tasks poll for the same lock.
- * previous level.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-/*
- * Shm_Initialize_lock
- *
- * Initialize the lock for the specified locked queue.
- */
-
-void Shm_Initialize_lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- lq_cb->lock = LQ_UNLOCKED;
-}
-
-/* void _Shm_Lock( &lq_cb )
- *
- * This shared memory locked queue support routine locks the
- * specified locked queue. It disables interrupts to prevent
- * a deadlock condition.
- */
-
-void Shm_Lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level, oldlock;
-
- rtems_interrupt_disable( isr_level );
- Shm_isrstat = isr_level;
- while ( 1 ) {
- atomic_modify( SHM_LOCK_VALUE, &lq_cb->lock, oldlock );
- if ( !(oldlock & SHM_LOCK_VALUE) )
- return;
- delay( 28 ); /* delay 28 microseconds */
- }
-}
-
-/*
- * Shm_Unlock
- *
- * Unlock the lock for the specified locked queue.
- */
-
-void Shm_Unlock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
-
- lq_cb->lock = SHM_UNLOCK_VALUE;
- isr_level = Shm_isrstat;
- rtems_interrupt_enable( isr_level );
-}
-
diff --git a/c/src/lib/libbsp/i960/cvme961/shmsupp/mpisr.c b/c/src/lib/libbsp/i960/cvme961/shmsupp/mpisr.c
deleted file mode 100644
index 5773b45a2a..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/shmsupp/mpisr.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Shm_isr_cvme961()
- *
- * NOTE: This routine is not used when in polling mode. Either
- * this routine OR Shm_clockisr is used in a particular system.
- *
- * There must be sufficient time after the IACK (read at
- * 0xb600000x) for the VIC068 to clear the interrupt request
- * before the interrupt request is cleared from IPND (sf0).
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include "shm.h"
-
-rtems_isr Shm_isr_cvme961(
- rtems_vector_number vector
-)
-{
- rtems_unsigned32 vic_vector;
-
- /* enable_tracing(); */
- vic_vector = (*(volatile rtems_unsigned8 *)0xb6000007);
- /* reset intr by reading */
- /* vector at IPL=3 */
- Shm_Interrupt_count += 1;
- rtems_multiprocessing_announce();
- (*(volatile rtems_unsigned8 *)0xa000005f) = 0; /* clear ICMS0 */
- i960_clear_intr( 6 );
-
-}
-
-/* void _Shm_setvec( )
- *
- * This driver routine sets the SHM interrupt vector to point to the
- * driver's SHM interrupt service routine.
- *
- * NOTE: See pp. 21-22, 36-39 of the CVME961 Manual for more info.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void Shm_setvec()
-{
- rtems_unsigned32 isrlevel;
-
- rtems_interrupt_disable( isrlevel );
- /* set SQSIO4 CTL REG for */
- /* VME slave address */
- (*(rtems_unsigned8 *)0xc00000b0) =
- (Shm_RTEMS_MP_Configuration->node - 1) | 0x10;
- set_vector( Shm_isr_cvme961, 6, 1 );
- /* set ICMS Bector Base Register */
- (*(rtems_unsigned8 *)0xa0000053) = 0x60; /* XINT6 vector is 0x62 */
- /* set ICMS Intr Control Reg */
- (*(rtems_unsigned8 *)0xa0000047) = 0xeb; /* ICMS0 enabled, IPL=0 */
- (*(rtems_unsigned8 *)0xa000005f) = 0; /* clear ICMS0 */
- rtems_interrupt_enable( isrlevel );
-}
diff --git a/c/src/lib/libbsp/i960/cvme961/start/Makefile.in b/c/src/lib/libbsp/i960/cvme961/start/Makefile.in
deleted file mode 100644
index 68dcd2196e..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/start/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-PGM=${ARCH}/start.o
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/i960/cvme961/startup/Makefile.in b/c/src/lib/libbsp/i960/cvme961/startup/Makefile.in
deleted file mode 100644
index aa59a2c153..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/startup/Makefile.in
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/i960/cvme961/startup/bspclean.c b/c/src/lib/libbsp/i960/cvme961/startup/bspclean.c
deleted file mode 100644
index eee90a69b2..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/startup/bspclean.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * This routine is used to return control to the NINDY monitor
- * and is automatically invoked at shutdown.
- *
- * NOTES: DOES NOT RETURN!!!
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "bsp.h"
-
-void bsp_cleanup( void )
-{
- extern void start( void );
-
- register volatile void *start_addr = 0;
-
- asm volatile( "mov 0,g0;"
- "fmark ;"
- "syncf ;"
- ".word 0xfeedface ; "
- "bx (%0)" : "=r" (start_addr) : "0" (start_addr) );
- /* The constant 0xfeedface is a magic word for break which
- * is defined by NINDY. The branch extended restarts the
- * application if the user types "go".
- */
-}
diff --git a/c/src/lib/libbsp/i960/cvme961/startup/bspstart.c b/c/src/lib/libbsp/i960/cvme961/startup/bspstart.c
deleted file mode 100644
index c05d697292..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/startup/bspstart.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- /* set node number in SQSIO4 CTL REG */
-
- *((rtems_unsigned32 *)0xc00000b0) =
- (Configuration.User_multiprocessing_table) ?
- Configuration.User_multiprocessing_table->node : 0;
-
- Prcb = get_prcb();
- Ctl_tbl = Prcb->control_tbl;
-
- /* following configures the data breakpoint (which must be set
- * before this is executed) to break on writes only.
- */
-
- Ctl_tbl->bpcon &= ~0x00cc0000;
- i960_reload_ctl_group( 6 );
-
- /* bit 31 of the Register Cache Control can be set to
- * enable an alternative caching algorithm. It does
- * not appear to help RTEMS.
- */
-
- /* Configure Number of Register Caches */
-
- Prcb->reg_cache_cfg = 8;
- i960_soft_reset( Prcb );
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_stack_size = 4096;
- Cpu_table.Prcb = Prcb;
-
- BSP_Configuration.work_space_start = (void *)
- (RAM_END - BSP_Configuration.work_space_size);
-}
diff --git a/c/src/lib/libbsp/i960/cvme961/startup/exit.c b/c/src/lib/libbsp/i960/cvme961/startup/exit.c
deleted file mode 100644
index fe63ff7d34..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/startup/exit.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* exit
- *
- * This routine is used to return control to the NINDY monitor
- * and is automatically invoked by the STDIO exit() routine.
- *
- * INPUT:
- * status - exit status
- *
- * OUTPUT: NONE
- *
- * NOTES: DOES NOT RETURN!!!
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "bsp.h"
-
-void _exit( )
-{
- asm volatile( "mov 0,g0; \
- fmark ; \
- syncf ; \
- .word 0xfeedface ; \
- bx start" : : );
- /* The constant 0xfeedface is a magic word for break which
- * is defined by NINDY. The branch extended restarts the
- * application if the user types "go".
- */
-}
diff --git a/c/src/lib/libbsp/i960/cvme961/startup/linkcmds b/c/src/lib/libbsp/i960/cvme961/startup/linkcmds
deleted file mode 100644
index e8f13b5956..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/startup/linkcmds
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the Cyclone CVME960/CVME961 boards.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-MEMORY
- {
- ram : org = 0x0, l = 1M
- }
-
-SECTIONS
-{
- .text 0x10000 :
- {
- text_start = . ;
- _text_start = . ;
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- etext = ALIGN( 0x10 ) ;
-/* _etext = .; -- conflicts */
- }
- .data ADDR( .text ) + SIZEOF( .text ):
- {
- data_start = . ;
- _data_start = .;
- *(.data)
- edata = ALIGN( 0x10 ) ;
-/* _edata = .; -- conflicts */
- }
- .bss ADDR( .data ) + SIZEOF( .data ):
- {
- bss_start = . ;
- _bss_start = . ;
- *(.bss)
- *(COMMON)
- end = . ;
- _end = . ;
- }
-}
diff --git a/c/src/lib/libbsp/i960/cvme961/startup/setvec.c b/c/src/lib/libbsp/i960/cvme961/startup/setvec.c
deleted file mode 100644
index f426db9dee..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/startup/setvec.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/* set_vector
- *
- * This routine attempts to perform all "generic" interrupt initialization
- * for the specified XINT line. It is specific to the Cyclone CVME961 in
- * that it knows which interrupts are initialized by the monitor, the
- * characteristics of XINT5 (VIC068 clock tick), and that it assumes the
- * i960 is processing interrupts in dedicated mode. It attempts to map
- * XINTs to interrupt vectors in a fairly straght forward way.
- *
- * XINT USE VECTOR INTR TBL INDEX TRIGGERED
- * ==== ============= ====== ============== =========
- * 0 VMEbus ERROR 0x02 0x03 EDGE
- * 1 DRAM PARITY 0x12 0x13 EDGE
- * 2 Z8530 0x22 0x23 LEVEL
- * 3 SQUALL 0 0x52 0x53 ----
- * 4 Z8536 (SQSIO4) 0x72 0x73 LEVEL
- * 5 TICK 0x32 0x33 EDGE
- * 6 VIC068 0x62 0x63 LEVEL
- * 7 UNUSED 0x42 0x43 LEVEL
- *
- * The interrupt handler is installed in both the cached and memory
- * resident interrupt tables. The appropriate IMAP register is updated to
- * reflect the vector selected by this routine. Global interrupts are
- * enabled. If XINT5 is being installed, places it in trigger mode.
- * Finally, set_vector_support() is invoked to install the new IMAP and
- * ICON, unmask the XINT in IMASK, and lower the i960's interrupt
- * level to 0.
- *
- * INPUT:
- * func - interrupt handler entry point
- * xint - external interrupt line
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-#include <stdio.h>
-
-void print_prcb();
-void print_intr_info();
-void print_ipnd_imsk();
-
-unsigned int Xint_2_Group_Map[8] = { 0, 1, 2, 5, 7, 3, 6, 4 };
-
-i960_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry func, /* isr routine */
- unsigned int xint, /* XINT number */
- unsigned int type /* RTEMS or RAW */
-)
-{
- i960_isr_entry *intr_tbl, *cached_intr_tbl;
- i960_isr_entry saved_intr;
- unsigned int vector, group, nibble;
- unsigned int *imap;
-
- if ( xint > 7 )
- exit( 0x80 );
-
- cached_intr_tbl = (i960_isr_entry *) 0;
- intr_tbl = (i960_isr_entry *) Prcb->intr_tbl;
- group = Xint_2_Group_Map[xint]; /* remap XINT to group */
- vector = (group << 4) + 2; /* direct vector num */
-
- if ( type )
- rtems_interrupt_catch( func, vector, (rtems_isr_entry *) &saved_intr );
- else {
- saved_intr = (i960_isr_entry) intr_tbl[ vector ];
- /* return old vector */
- intr_tbl[ vector + 1 ] = /* normal vector table */
- cached_intr_tbl[ group ] = (i960_isr_entry) func; /* cached vector */
- }
-
- if ( xint <= 3 ) imap = &Ctl_tbl->imap0; /* updating IMAP0 */
- else imap = &Ctl_tbl->imap1; /* updating IMAP1 */
- nibble = (xint % 4) * 4;
- *imap &= ~(0xf << nibble);
- *imap |= group << nibble;
-
- Ctl_tbl->icon &= ~0x00000400; /* enable global interrupts */
- Ctl_tbl->icon |= 0x00004000; /* fast sampling mode */
- switch ( xint ) {
- case 0: Ctl_tbl->icon |= 0x00000004; break;
- case 1: Ctl_tbl->icon |= 0x00000008; break;
- case 2: Ctl_tbl->icon &= ~0x00000010; break;
- case 4: Ctl_tbl->icon &= ~0x00000040; break;
- case 5: Ctl_tbl->icon |= 0x00000080; break;
- case 6: Ctl_tbl->icon &= ~0x00000100; break;
- default: exit( 0x81 ); break; /* unsupported */
- }
-
- if ( xint == 4 ) { /* reprogram MCON for SQSIO4 */
- Ctl_tbl->mcon12 = 0x00002012; /* MCON12 - 0xCxxxxxxx */
- Ctl_tbl->mcon13 = 0x00000000; /* MCON13 - 0xDxxxxxxx */
- i960_reload_ctl_group( 5 ); /* update MCON12-MCON15 */
- }
-
- i960_unmask_intr( xint ); /* update IMSK */
- i960_reload_ctl_group( 1 ); /* update IMAP?/ICON */
- return( saved_intr ); /* return old vector */
-}
-
-void print_prcb()
-{
- printf( "fault_table =0x%p\n", Prcb->fault_tbl );
- printf( "control_tbl =0x%p\n", Prcb->control_tbl );
- printf( "AC mask ov =0x%x\n", Prcb->initial_ac );
- printf( "fltconfig =0x%x\n", Prcb->fault_config );
- printf( "intr tbl =0x%p\n", Prcb->intr_tbl );
- printf( "systable =0x%p\n", Prcb->sys_proc_tbl );
- printf( "reserved =0x%x\n", Prcb->reserved );
- printf( "isr stk =0x%p\n", Prcb->intr_stack );
- printf( "ins cache =0x%x\n", Prcb->ins_cache_cfg );
- printf( "reg cache =0x%x\n", Prcb->reg_cache_cfg );
-}
-
-void print_intr_info()
-{
- printf( "prcb =0x%p\n", Prcb );
- printf( "ctl_tbl =0x%p\n", Ctl_tbl );
- printf( "intr_tbl=0x%p\n", Prcb->intr_tbl );
- printf( "IMAP0 = 0x%x\n", Ctl_tbl->imap0 );
- printf( "IMAP1 = 0x%x\n", Ctl_tbl->imap1 );
- print_ipnd_imsk();
-}
-
-void print_ipnd_imsk()
-{
- printf(" IPEND = 0x%x\n", i960_pend_intrs() );
- printf(" IMASK = 0x%x\n", i960_mask_intrs() );
-}
diff --git a/c/src/lib/libbsp/i960/cvme961/timer/Makefile.in b/c/src/lib/libbsp/i960/cvme961/timer/Makefile.in
deleted file mode 100644
index 24809cbed8..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=timerisr
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/i960/cvme961/timer/timer.c b/c/src/lib/libbsp/i960/cvme961/timer/timer.c
deleted file mode 100644
index b4d6c0e276..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/timer/timer.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Timer_init()
- *
- * This routine initializes the Z8536 timer on the SQSIO4 SQUALL
- * board for the CVME961 board. The timer is setup to provide a
- * tick every 1 millisecond.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: This routine will not work if the optimizer is enabled
- * for most compilers. The multiple writes to the Z8536
- * will be optimized away.
- *
- * It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <zilog/z8536.h>
-
-#define TIMER 0xc00000a0
-
-int Ttimer_val;
-rtems_boolean Timer_driver_Find_average_overhead;
-
-void flush_reg();
-rtems_isr timerisr();
-
-void Timer_initialize()
-{
- set_vector( timerisr, 4, 0 ); /* install ISR */
-
- i960_mask_intr( 5 ); /* disable VIC068 tick */
- flush_reg(); /* timed code starts clean */
- Ttimer_val = 0; /* clear timer ISR count */
- Z8x36_WRITE( TIMER, MASTER_INTR, 0x01 ); /* reset */
- Z8x36_WRITE( TIMER, MASTER_INTR, 0x00 ); /* clear reset */
- Z8x36_WRITE( TIMER, MASTER_CFG, 0x00 ); /* disable everything */
- Z8x36_WRITE( TIMER, CNT_TMR_VECTOR, 0x72 ); /* clear intr vector */
- Z8x36_WRITE( TIMER, MASTER_CFG, 0x20 ); /* clear intr info */
- Z8x36_WRITE( TIMER, MASTER_CFG, 0xe0 ); /* disable interrupts */
- Z8x36_WRITE( TIMER, MASTER_CFG, 0x20 ); /* clear intr info */
- Z8x36_WRITE( TIMER, MASTER_CFG, 0xe0 ); /* disable interrupts */
- Z8x36_WRITE( TIMER, MASTER_INTR, 0xe2 ); /* disable lower chain, */
- /* no vector, set right */
- /* justified addr and */
- /* master int enable */
- Z8x36_WRITE( TIMER, CT1_MODE_SPEC, 0x80 ); /* T1 continuous, and */
- /* cycle/pulse output */
- Z8x36_WRITE( TIMER, CT1_TIME_CONST_MSB, 0x00 );
- Z8x36_WRITE( TIMER, CT1_TIME_CONST_LSB, 0x00 );
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0xc0 ); /* set INTR enable (IE) */
- Z8x36_WRITE( TIMER, MASTER_CFG, 0x40 ); /* enable timer1 */
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0x06 ); /* set trigger command */
- /* (TCB) and gate */
- /* command (GCB) bits */
-}
-
-#define AVG_OVERHEAD 11 /* It typically takes 5.5 microseconds */
- /* (11 countdowns) to start/stop the timer. */
-#define LEAST_VALID 15 /* Don't trust a value lower than this */
-
-int Read_timer()
-{
- rtems_unsigned8 msb, lsb;
- rtems_unsigned32 remaining, total;
-
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0xce ); /* read the counter value */
- Z8x36_READ( TIMER, CT1_CUR_CNT_MSB, msb );
- Z8x36_READ( TIMER, CT1_CUR_CNT_LSB, lsb );
-
- remaining = 0xffff - ((msb << 8) + lsb);
- total = (Ttimer_val * 0x10000) + remaining;
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in one-half microsecond units */
- else {
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
- return (total-AVG_OVERHEAD) >> 1;
- }
-}
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/i960/cvme961/timer/timerisr.s b/c/src/lib/libbsp/i960/cvme961/timer/timerisr.s
deleted file mode 100644
index edce480326..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/timer/timerisr.s
+++ /dev/null
@@ -1,65 +0,0 @@
-/* timer_isr()
- *
- * This routine initializes the Z8536 timer on the SQSIO4 SQUALL
- * board for the CVME961 board. The timer is setup to provide a
- * tick every 0x10000 / 2 milliseconds. This is used to time
- * executing code.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-
-.set PORT_A, 0xc00000a8 # port A
-.set PORT_B, 0xc00000a4 # port B
-.set PORT_C, 0xc00000a0 # port C
-.set CTL_PORT, 0xc00000ac # control port
-
-.set T1CSR, 0x0a # T1 command/status reg
-.set RELOAD, 0x24 # clr IP & IUS,allow countdown
-
-/*
- * Duplicating this symbol is stupid but eliminates
- * toolset variation problems.
- */
- PUBLIC(timerisr)
- PUBLIC(_timerisr)
-SYM (timerisr):
-SYM (_timerisr):
- #ldconst 1,r4
- #modpc 0,r4,r4 # enable tracing
-
- ld _Ttimer_val,r6 # r6 = test timer
-
- ldconst T1CSR,r4 # r4 = T1 control status reg
- stob r4,CTL_PORT # select T1CSR
- ldconst RELOAD,r5 # r5 = reset value
- stob r5,CTL_PORT # reset countdown
- addo 1,r6,r6
- st r6,_Ttimer_val # increment test timer
-loop_til_cleared:
- clrbit 4,sf0,sf0
- bbs 4,sf0,loop_til_cleared
-leaf: ret
-
- .leafproc _flush_reg, flush_reg.lf
- .globl _flush_reg, flush_reg.lf
-_flush_reg:
- lda leaf,g14 # g14 = exit address
-flush_reg.lf:
- flushreg
- mov g14,g0 # g0 = exit address
- ldconst 0,g14 # set g14 for non-leaf
- bx (g0)
diff --git a/c/src/lib/libbsp/i960/cvme961/times b/c/src/lib/libbsp/i960/cvme961/times
deleted file mode 100644
index 2e742dd876..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/times
+++ /dev/null
@@ -1,191 +0,0 @@
-#
-# Timing Test Suite Results for the Cyclone CVME961 BSP
-#
-# $Id$
-#
-
-Board: Cyclone CVME961
-CPU: Intel i960CA
-Clock Speed: 33 Mhz
-Memory Configuration: DRAM w/no cache
-Wait States: 2 wait states
-
-Times Reported in: microseconds
-Timer Source: Z8536 on SQUALL mezzanine module
-
-Column A: 3.5.1 pre-release
-Column B: unused
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 20
- rtems_semaphore_delete 21
- rtems_semaphore_obtain: available 15
- rtems_semaphore_obtain: not available -- NO_WAIT 15
- rtems_semaphore_release: no waiting tasks 16
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 62
-
- 3 rtems_semaphore_release: task readied -- preempts caller 55
-
- 4 rtems_task_restart: blocked task -- preempts caller 77
- rtems_task_restart: ready task -- preempts caller 70
- rtems_semaphore_release: task readied -- returns to caller 25
- rtems_task_create 57
- rtems_task_start 31
- rtems_task_restart: suspended task -- returns to caller 36
- rtems_task_delete: suspended task 47
- rtems_task_restart: ready task -- returns to caller 37
- rtems_task_restart: blocked task -- returns to caller 46
- rtems_task_delete: blocked task 50
-
- 5 rtems_task_suspend: calling task 51
- rtems_task_resume: task readied -- preempts caller 49
-
- 6 rtems_task_restart: calling task 59
- rtems_task_suspend: returns to caller 18
- rtems_task_resume: task readied -- returns to caller 19
- rtems_task_delete: ready task 50
-
- 7 rtems_task_restart: suspended task -- preempts caller 70
-
- 8 rtems_task_set_priority: obtain current priority 12
- rtems_task_set_priority: returns to caller 27
- rtems_task_mode: obtain current mode 5
- rtems_task_mode: no reschedule 5
- rtems_task_mode: reschedule -- returns to caller 8
- rtems_task_mode: reschedule -- preempts caller 39
- rtems_task_set_note 13
- rtems_task_get_note 13
- rtems_clock_set 33
- rtems_clock_get 3
-
- 9 rtems_message_queue_create 110
- rtems_message_queue_send: no waiting tasks 37
- rtems_message_queue_urgent: no waiting tasks 37
- rtems_message_queue_receive: available 31
- rtems_message_queue_flush: no messages flushed 12
- rtems_message_queue_flush: messages flushed 16
- rtems_message_queue_delete 26
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 15
- rtems_message_queue_receive: not available -- caller blocks 62
-
-11 rtems_message_queue_send: task readied -- preempts caller 72
-
-12 rtems_message_queue_send: task readied -- returns to caller 39
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 72
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 39
-
-15 rtems_event_receive: obtain current events 1
- rtems_event_receive: not available -- NO_WAIT 12
- rtems_event_receive: not available -- caller blocks 56
- rtems_event_send: no task readied 12
- rtems_event_receive: available 12
- rtems_event_send: task readied -- returns to caller 24
-
-16 rtems_event_send: task readied -- preempts caller 55
-
-17 rtems_task_set_priority: preempts caller 62
-
-18 rtems_task_delete: calling task 83
-
-19 rtems_signal_catch 9
- rtems_signal_send: returns to caller 15
- rtems_signal_send: signal to self 18
- exit ASR overhead: returns to calling task 22
- exit ASR overhead: returns to preempting task 49
-
-20 rtems_partition_create 35
- rtems_region_create 23
- rtems_partition_get_buffer: available 15
- rtems_partition_get_buffer: not available 13
- rtems_partition_return_buffer 18
- rtems_partition_delete 16
- rtems_region_get_segment: available 22
- rtems_region_get_segment: not available -- NO_WAIT 21
- rtems_region_return_segment: no waiting tasks 19
- rtems_region_get_segment: not available -- caller blocks 64
- rtems_region_return_segment: task readied -- preempts caller 74
- rtems_region_return_segment: task readied -- returns to caller 44
- rtems_region_delete 16
- rtems_io_initialize 2
- rtems_io_open 1
- rtems_io_close 1
- rtems_io_read 1
- rtems_io_write 1
- rtems_io_control 1
-
-21 rtems_task_ident 149
- rtems_message_queue_ident 145
- rtems_semaphore_ident 156
- rtems_partition_ident 145
- rtems_region_ident 148
- rtems_port_ident 145
- rtems_timer_ident 145
- rtems_rate_monotonic_ident 145
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 42
- rtems_message_queue_broadcast: no waiting tasks 17
- rtems_message_queue_broadcast: task readied -- preempts caller 78
-
-23 rtems_timer_create 14
- rtems_timer_fire_after: inactive 22
- rtems_timer_fire_after: active 24
- rtems_timer_cancel: active 15
- rtems_timer_cancel: inactive 13
- rtems_timer_reset: inactive 21
- rtems_timer_reset: active 23
- rtems_timer_fire_when: inactive 34
- rtems_timer_fire_when: active 34
- rtems_timer_delete: active 19
- rtems_timer_delete: inactive 17
- rtems_task_wake_when 69
-
-24 rtems_task_wake_after: yield -- returns to caller 9
- rtems_task_wake_after: yields -- preempts caller 45
-
-25 rtems_clock_tick 4
-
-26 _ISR_Disable 0
- _ISR_Flash 1
- _ISR_Enable 1
- _Thread_Disable_dispatch 0
- _Thread_Enable_dispatch 7
- _Thread_Set_state 11
- _Thread_Disptach (NO FP) 31
- context switch: no floating point contexts 21
- context switch: self 10
- context switch: to another task 10
- context switch: restore 1st FP task 25
- fp context switch: save idle, restore idle 31
- fp context switch: save idle, restore initialized 19
- fp context switch: save initialized, restore initialized 20
- _Thread_Resume 7
- _Thread_Unblock 7
- _Thread_Ready 9
- _Thread_Get 4
- _Semaphore_Get 2
- _Thread_Get: invalid id 0
-
-27 interrupt entry overhead: returns to interrupted task 6
- interrupt exit overhead: returns to interrupted task 6
- interrupt entry overhead: returns to nested interrupt 6
- interrupt exit overhead: returns to nested interrupt 5
- interrupt entry overhead: returns to preempting task 7
- interrupt exit overhead: returns to preempting task 36
-
-28 rtems_port_create 16
- rtems_port_external_to_internal 11
- rtems_port_internal_to_external 11
- rtems_port_delete 16
-
-29 rtems_rate_monotonic_create 15
- rtems_rate_monotonic_period: initiate period -- returns to caller 21
- rtems_rate_monotonic_period: obtain status 13
- rtems_rate_monotonic_cancel 16
- rtems_rate_monotonic_delete: inactive 18
- rtems_rate_monotonic_delete: active 20
- rtems_rate_monotonic_period: conclude periods -- caller blocks 53
diff --git a/c/src/lib/libbsp/i960/cvme961/wrapup/Makefile.in b/c/src/lib/libbsp/i960/cvme961/wrapup/Makefile.in
deleted file mode 100644
index 11ca32d8c7..0000000000
--- a/c/src/lib/libbsp/i960/cvme961/wrapup/Makefile.in
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console shmsupp timer
-GENERIC_PIECES=shmdr
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
-install: all
-
diff --git a/c/src/lib/libbsp/m68k/Makefile.in b/c/src/lib/libbsp/m68k/Makefile.in
deleted file mode 100644
index f049e9b2e8..0000000000
--- a/c/src/lib/libbsp/m68k/Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# Descend into the $(RTEMS_BSP_FAMILY) directory
-SUB_DIRS=$(RTEMS_BSP_FAMILY)
diff --git a/c/src/lib/libbsp/m68k/dmv152/Makefile.in b/c/src/lib/libbsp/m68k/dmv152/Makefile.in
deleted file mode 100644
index ca0590d55a..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include startup clock console spurious timer wrapup
diff --git a/c/src/lib/libbsp/m68k/dmv152/bsp_specs b/c/src/lib/libbsp/m68k/dmv152/bsp_specs
deleted file mode 100644
index 61dac86b53..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start.o%s} \
-%{qrtems_debug: start_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/m68k/dmv152/clock/Makefile.in b/c/src/lib/libbsp/m68k/dmv152/clock/Makefile.in
deleted file mode 100644
index 59df4f2702..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/clock/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/dmv152/clock/ckinit.c b/c/src/lib/libbsp/m68k/dmv152/clock/ckinit.c
deleted file mode 100644
index e58fbca7c1..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/clock/ckinit.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/* Clock_init()
- *
- * This routine initializes the Z80386 1 on the MVME136 board.
- * The tick frequency is 1 millisecond.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-volatile rtems_unsigned32 Clock_driver_ticks;
- /* ticks since initialization */
-rtems_isr_entry Old_ticker;
-
-void Clock_exit( void );
-
-#define CLOCK_VECTOR TIMER_VECTOR
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-/*
- * ISR Handler
- */
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
- Clock_driver_ticks += 1;
-
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0xE2 );
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0x22 );
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0xC6 );
-
- if ( Clock_isrs == 1 ) {
- rtems_clock_tick();
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
- }
- else
- Clock_isrs -= 1;
-}
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
- rtems_unsigned8 data;
-
- Clock_driver_ticks = 0;
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
-
- Z8x36_WRITE( TIMER, MASTER_CFG, 0xd4 );
- Z8x36_READ ( TIMER, MASTER_INTR, data );
- Z8x36_WRITE( TIMER, MASTER_INTR, (data & 0x7E) );
- Z8x36_WRITE( TIMER, CT1_TIME_CONST_MSB, 0x04 );
- Z8x36_WRITE( TIMER, CT1_TIME_CONST_LSB, 0xCE );
- Z8x36_WRITE( TIMER, CT1_MODE_SPEC, 0x83 );
- Z8x36_WRITE( TIMER, CNT_TMR_VECTOR, CLOCK_VECTOR );
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0x20 );
- Z8x36_READ ( TIMER, MASTER_INTR, data );
- Z8x36_WRITE( TIMER, MASTER_INTR, (data & 0xDA) | 0x80 );
-
- /*
- * ACC_IC54 - interrupt 5 will be vectored and mapped to level 6
- */
-
- data = (*(rtems_unsigned8 *)0x0D00000B);
- (*(rtems_unsigned8 *)0x0D00000B) = (data & 0x7F) | 0x60;
-
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0xC6 );
-
- atexit( Clock_exit );
- }
-}
-
-void Clock_exit( void )
-{
- rtems_unsigned8 data;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
-
- Z8x36_READ ( TIMER, MASTER_INTR, data );
- Z8x36_WRITE( TIMER, MASTER_INTR, (data & 0x01) );
- /* do not restore old vector */
-
- }
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libbsp/m68k/dmv152/console/Makefile.in b/c/src/lib/libbsp/m68k/dmv152/console/Makefile.in
deleted file mode 100644
index fd05ddfedd..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/dmv152/console/console.c b/c/src/lib/libbsp/m68k/dmv152/console/console.c
deleted file mode 100644
index 8d9105270d..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/console/console.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * This file contains the TTY driver for the serial ports on the DMV152.
- * The serial ports use a Zilog Z8530.
- *
- * NOTE: This driver uses the termios pseudo driver.
- * This driver is polled only.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <stdlib.h>
-#include <assert.h>
-
-/*
- * console_outbyte_polled
- *
- * This routine transmits a character using polling.
- */
-
-void console_outbyte_polled(
- int port,
- char ch
-)
-{
- rtems_unsigned32 control;
- rtems_unsigned32 data;
- rtems_unsigned8 rr_0;
-
- if ( port == 0 ) {
- control = CONSOLE_CONTROL_A;
- data = CONSOLE_DATA_A;
- } else {
- control = CONSOLE_CONTROL_B;
- data = CONSOLE_DATA_B;
- }
-
- for ( ; ; ) {
- Z8x30_READ_CONTROL( control, RR_0, rr_0 );
- if ( (rr_0 & RR_0_TX_BUFFER_EMPTY) != 0 )
- break;
- }
-
- Z8x30_WRITE_DATA( control, ch );
-}
-
-/*
- * console_inbyte_nonblocking
- *
- * This routine polls for a character.
- */
-
-int console_inbyte_nonblocking(int port)
-{
- rtems_unsigned32 control;
- rtems_unsigned32 data;
- rtems_unsigned8 rr_0;
- char ch;
-
- if ( port == 0 ) {
- control = CONSOLE_CONTROL_A;
- data = CONSOLE_DATA_A;
- } else {
- control = CONSOLE_CONTROL_B;
- data = CONSOLE_DATA_B;
- }
-
- Z8x30_READ_CONTROL( control, RR_0, rr_0 );
- if ( !(rr_0 & RR_0_RX_DATA_AVAILABLE) )
- return -1;
-
- Z8x30_READ_DATA( data, ch );
- return (int) ch;
-}
-
-/*
- * DEBUG_puts
- *
- * This should be safe in the event of an error. It attempts to insure
- * that no TX empty interrupts occur while it is doing polled IO. Then
- * it restores the state of that external interrupt.
- *
- * Input parameters:
- * string - pointer to debug output string
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void DEBUG_puts(
- char *string
-)
-{
- char *s;
-
- /* should disable interrupts here */
- for ( s = string ; *s ; s++ )
- console_outbyte_polled( 0, *s );
-
- console_outbyte_polled( 0, '\r' );
- console_outbyte_polled( 0, '\n' );
- /* should enable interrupts here */
-}
-
-
-/*
- * Console Termios Support Entry Points
- *
- */
-
-int console_write_support (int minor, const char *buf, int len)
-{
- int nwrite = 0;
-
- while (nwrite < len) {
- console_outbyte_polled( minor, *buf++ );
- nwrite++;
- }
- return nwrite;
-}
-
-void console_reserve_resources(
- rtems_configuration_table *configuration
-)
-{
- rtems_termios_reserve_resources( configuration, 2 );
-}
-
-/*
- * Console Device Driver Entry Points
- *
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
- rtems_device_minor_number console_minor;
-
- rtems_termios_initialize();
-
- /*
- * Register Device Names
- */
-
-#if (USE_CHANNEL_A == 1)
- console_minor = 0;
-#elif (USE_CHANNEL_B == 1)
- console_minor = 1;
-#else
-#error "DMV152 Console Driver -- no console port configured!!!"
-#endif
-
- status = rtems_io_register_name( "/dev/console", major, console_minor );
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- status = rtems_io_register_name( "/dev/console_a", major, 0 );
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- status = rtems_io_register_name( "/dev/console_b", major, 1 );
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- /*
- * Initialize Hardware
- */
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_status_code sc;
- static const rtems_termios_callbacks pollCallbacks = {
- NULL, /* firstOpen */
- NULL, /* lastClose */
- console_inbyte_nonblocking, /* pollRead */
- console_write_support, /* write */
- NULL, /* setAttributes */
- NULL, /* stopRemoteTx */
- NULL, /* startRemoteTx */
- 0 /* outputUsesInterrupts */
- };
-
- assert( minor <= 1 );
- if ( minor > 2 )
- return RTEMS_INVALID_NUMBER;
-
- sc = rtems_termios_open (major, minor, arg, &pollCallbacks );
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_close (arg);
-}
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_read (arg);
-}
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_write (arg);
-}
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_ioctl (arg);
-}
-
diff --git a/c/src/lib/libbsp/m68k/dmv152/include/Makefile.in b/c/src/lib/libbsp/m68k/dmv152/include/Makefile.in
deleted file mode 100644
index 7d8581095f..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/m68k/dmv152/include/bsp.h b/c/src/lib/libbsp/m68k/dmv152/include/bsp.h
deleted file mode 100644
index 3553c9c0c9..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/include/bsp.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/* bsp.h
- *
- * This include file contains all DMV152 board IO definitions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __DMV152_h
-#define __DMV152_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <console.h>
-#include <clockdrv.h>
-#include <iosupp.h>
-#include <vmeintr.h>
-#include <zilog/z8530.h>
-#include <zilog/z8536.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Define the interrupt mechanism for Time Test 27
- */
-
-/* use a VMEbus interrupt */
-
-#define MUST_WAIT_FOR_INTERRUPT 1
-
-#define Install_tm27_vector( handler ) \
- { \
- set_vector( (handler), 0x50, 1 ); \
- (*(volatile rtems_unsigned32 *)0x0d800024) = 0x50; /* set IVECT reg */ \
- (*(volatile rtems_unsigned8 *)0x0d00000c) = 0x40; /* set VIE reg */ \
- }
-
-#define Cause_tm27_intr() \
- (*(volatile rtems_unsigned8 *)0x0d000003) = 0x0f /* set VINT */
-
-#define Clear_tm27_intr() /* no operation necessary */
-
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( microseconds ) \
- { register rtems_unsigned32 _delay=(microseconds); \
- register rtems_unsigned32 _tmp=123; \
- asm volatile( "0: \
- nbcd %0 ; \
- nbcd %0 ; \
- dbf %1,0b" \
- : "=d" (_tmp), "=d" (_delay) \
- : "0" (_tmp), "1" (_delay) ); \
- }
-
-/* macros */
-
-#undef Z8x36_STATE0
-#undef Z8x36_WRITE
-#undef Z8x36_READ
-
-#define Z8x36_STATE0 ( z8536 ) \
- { char *garbage; \
- (garbage) = *(VOL8(z8536+0x7)) \
- }
-
-#define Z8x36_WRITE( z8536, reg, data ) \
- *(VOL8(z8536+0x7)) = (reg); \
- *(VOL8(z8536+0x7)) = (data)
-
-#define Z8x36_READ( z8536, reg, data ) \
- *(VOL8(z8536+0x7)) = (reg); \
- (data) = *(VOL8(z8536+0x7))
-
-/*
- * ACC Register Addresses
- */
-
-#define ACC_BASE 0x0D000000
-
-#define ACC_STAT0 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x00))
-#define ACC_STAT1 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x01))
-#define ACC_GENCTL ((volatile rtems_unsigned8 *) (ACC_BASE + 0x02))
-#define ACC_VINT ((volatile rtems_unsigned8 *) (ACC_BASE + 0x03))
-#define ACC_VREQ ((volatile rtems_unsigned8 *) (ACC_BASE + 0x04))
-#define ACC_VARB ((volatile rtems_unsigned8 *) (ACC_BASE + 0x05))
-#define ACC_ID ((volatile rtems_unsigned8 *) (ACC_BASE + 0x06))
-#define ACC_CTL2 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x07))
-#define ACC_7IS ((volatile rtems_unsigned8 *) (ACC_BASE + 0x08))
-#define ACC_LIS ((volatile rtems_unsigned8 *) (ACC_BASE + 0x09))
-#define ACC_7IE ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0A))
-#define ACC_LIE ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0B))
-#define ACC_VIE ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0C))
-#define ACC_IC10 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0D))
-#define ACC_IC32 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0E))
-#define ACC_IC54 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0F))
-
-/* constants */
-
-#define RAM_START 0
-#define RAM_END 0x100000
-
-#define TIMER 0x0c000000
-#define TIMER_VECTOR 0x4D
-
-#define CONSOLE_CONTROL_A 0x0C800005
-#define CONSOLE_DATA_A 0x0C800007
-#define CONSOLE_CONTROL_B 0x0C800001
-#define CONSOLE_DATA_B 0x0C800003
-
-/* Structures */
-
- /* none */
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-extern m68k_isr_entry M68Kvec[]; /* vector table address */
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-m68k_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/dmv152/include/coverhd.h b/c/src/lib/libbsp/m68k/dmv152/include/coverhd.h
deleted file mode 100644
index a05b2744f6..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/include/coverhd.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C on this target.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 2
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 1
-#define CALLING_OVERHEAD_TASK_CREATE 3
-#define CALLING_OVERHEAD_TASK_IDENT 2
-#define CALLING_OVERHEAD_TASK_START 2
-#define CALLING_OVERHEAD_TASK_RESTART 2
-#define CALLING_OVERHEAD_TASK_DELETE 1
-#define CALLING_OVERHEAD_TASK_SUSPEND 1
-#define CALLING_OVERHEAD_TASK_RESUME 2
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 2
-#define CALLING_OVERHEAD_TASK_MODE 2
-#define CALLING_OVERHEAD_TASK_GET_NOTE 2
-#define CALLING_OVERHEAD_TASK_SET_NOTE 2
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 4
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 1
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 2
-#define CALLING_OVERHEAD_CLOCK_GET 4
-#define CALLING_OVERHEAD_CLOCK_SET 4
-#define CALLING_OVERHEAD_CLOCK_TICK 1
-
-#define CALLING_OVERHEAD_TIMER_CREATE 2
-#define CALLING_OVERHEAD_TIMER_IDENT 1
-#define CALLING_OVERHEAD_TIMER_DELETE 2
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 2
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 5
-#define CALLING_OVERHEAD_TIMER_RESET 1
-#define CALLING_OVERHEAD_TIMER_CANCEL 1
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 2
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 1
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 2
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 2
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 2
-
-#define CALLING_OVERHEAD_EVENT_SEND 2
-#define CALLING_OVERHEAD_EVENT_RECEIVE 2
-#define CALLING_OVERHEAD_SIGNAL_CATCH 2
-#define CALLING_OVERHEAD_SIGNAL_SEND 2
-#define CALLING_OVERHEAD_PARTITION_CREATE 3
-#define CALLING_OVERHEAD_PARTITION_IDENT 2
-#define CALLING_OVERHEAD_PARTITION_DELETE 2
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 2
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 2
-#define CALLING_OVERHEAD_REGION_CREATE 3
-#define CALLING_OVERHEAD_REGION_IDENT 2
-#define CALLING_OVERHEAD_REGION_DELETE 1
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 3
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 2
-#define CALLING_OVERHEAD_PORT_CREATE 3
-#define CALLING_OVERHEAD_PORT_IDENT 2
-#define CALLING_OVERHEAD_PORT_DELETE 2
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 2
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 2
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 3
-#define CALLING_OVERHEAD_IO_OPEN 2
-#define CALLING_OVERHEAD_IO_CLOSE 2
-#define CALLING_OVERHEAD_IO_READ 2
-#define CALLING_OVERHEAD_IO_WRITE 2
-#define CALLING_OVERHEAD_IO_CONTROL 2
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 2
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 1
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/dmv152/spurious/Makefile.in b/c/src/lib/libbsp/m68k/dmv152/spurious/Makefile.in
deleted file mode 100644
index 871175f129..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/spurious/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/spurious.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=spinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/dmv152/spurious/spinit.c b/c/src/lib/libbsp/m68k/dmv152/spurious/spinit.c
deleted file mode 100644
index deefb00ebc..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/spurious/spinit.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Spurious_driver
- *
- * This routine installs spurious interrupt handlers for the DMV152.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <stdio.h>
-
-rtems_isr Spurious_Isr(
- rtems_vector_number vector
-)
-{
- void *sp = 0;
-
- asm volatile ( "movea.l %%sp,%0 " : "=a" (sp) : "0" (sp) );
-
- fprintf( stderr, "Vector 0x%x sp=0x%p\n", vector, sp );
-}
-
-rtems_device_driver Spurious_Initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp,
- rtems_id tid,
- rtems_unsigned32 *rval
-)
-{
- rtems_vector_number vector;
-
- for ( vector = 0x40 ; vector <= 0xFF ; vector++ )
- (void) set_vector( Spurious_Isr, vector, 1 );
-
- return 0;
-}
diff --git a/c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in b/c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in
deleted file mode 100644
index a68bcbb938..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec vmeintr
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(srcdir)/linkcmds $(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/m68k/dmv152/startup/bspclean.c b/c/src/lib/libbsp/m68k/dmv152/startup/bspclean.c
deleted file mode 100644
index ef69a6f8f3..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/startup/bspclean.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * This routine performs final cleanup at exit time.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-void bsp_cleanup( void )
-{
-
- VME_interrupt_Disable( 0xff );
-}
diff --git a/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c b/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c
deleted file mode 100644
index 0de6b80078..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- m68k_isr_entry *monitors_vector_table;
- int index;
- void *vbr;
-
- monitors_vector_table = (m68k_isr_entry *)0; /* Monitor Vectors are at 0 */
- m68k_set_vbr( monitors_vector_table );
-
- for ( index=2 ; index<=255 ; index++ )
- M68Kvec[ index ] = monitors_vector_table[ 32 ];
-
- M68Kvec[ 2 ] = monitors_vector_table[ 2 ]; /* bus error vector */
- M68Kvec[ 4 ] = monitors_vector_table[ 4 ]; /* breakpoints vector */
- M68Kvec[ 9 ] = monitors_vector_table[ 9 ]; /* trace vector */
-
- /*
- * Uncommenting this seems to confuse/break the monitor on this board.
- * It probably assumes the vector table is at 0.
- */
-
- /* m68k_set_vbr( &M68Kvec ); */
-
- /*
- * Adjust the VMEbus mode to round-robin.
- */
-
- /*
- * This is only apparent with the shared memory driver which has not
- * yet been supported on this target.
- */
-
- m68k_enable_caching();
-
- /*
- * we only use a hook to get the C library initialized.
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.do_zero_of_workspace = TRUE;
- Cpu_table.interrupt_stack_size = 4096;
-
- m68k_get_vbr( vbr );
- Cpu_table.interrupt_vector_table = vbr;
-
- BSP_Configuration.work_space_start = (void *)
- (RAM_END - BSP_Configuration.work_space_size);
-
- /*
- * Account for the console's resources
- */
-
- console_reserve_resources( &BSP_Configuration );
-
- /* Clock_exit is done as an atexit() function */
-}
diff --git a/c/src/lib/libbsp/m68k/dmv152/startup/linkcmds b/c/src/lib/libbsp/m68k/dmv152/startup/linkcmds
deleted file mode 100644
index 7046b88a20..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/startup/linkcmds
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the DY-4 DMV152/SVME153 boards.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
-
-MEMORY
- {
- ram : org = 0x12800, l = 1M
- }
-
-SECTIONS
-{
- .text 0x12800 :
- {
- text_start = . ;
- _text_start = . ;
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- etext = ALIGN( 0x10 ) ;
- _etext = .;
- }
- .data ADDR( .text ) + SIZEOF( .text ):
- {
- data_start = . ;
- _data_start = . ;
- *(.data)
- edata = ALIGN( 0x10 ) ;
- _edata = .;
- }
- .bss ADDR( .data ) + SIZEOF( .data ):
- {
- bss_start = . ;
- _bss_start = . ;
- *(.bss)
- *(COMMON)
- . += StackSize; /* XXX -- Old gld can't handle this */
- . = ALIGN (16);
- stack_init = .;
- end = . ;
- _end = . ;
- }
-}
diff --git a/c/src/lib/libbsp/m68k/dmv152/startup/vmeintr.c b/c/src/lib/libbsp/m68k/dmv152/startup/vmeintr.c
deleted file mode 100644
index 1ac7eded96..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/startup/vmeintr.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* vmeintr.c
- *
- * VMEbus support routines for the DMV152.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <vmeintr.h>
-
-/*PAGE
- *
- * VME_interrupt_Disable
- *
- */
-
-void VME_interrupt_Disable (
- VME_interrupt_Mask mask /* IN */
-)
-{
- volatile rtems_unsigned8 *VME_interrupt_enable;
- rtems_unsigned8 value;
-
- VME_interrupt_enable = ACC_VIE;
- value = *VME_interrupt_enable;
-
- value &= ~mask; /* turn off interrupts for all levels in mask */
-
- *VME_interrupt_enable = value;
-}
-
-/*PAGE
- *
- * VME_interrupt_Enable
- *
- */
-
-void VME_interrupt_Enable (
- VME_interrupt_Mask mask /* IN */
-)
-{
- volatile rtems_unsigned8 *VME_interrupt_enable;
- rtems_unsigned8 value;
-
- VME_interrupt_enable = ACC_VIE;
- value = *VME_interrupt_enable;
-
- value |= mask; /* turn on interrupts for all levels in mask */
-
- *VME_interrupt_enable = value;
-}
diff --git a/c/src/lib/libbsp/m68k/dmv152/timer/Makefile.in b/c/src/lib/libbsp/m68k/dmv152/timer/Makefile.in
deleted file mode 100644
index 24809cbed8..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=timerisr
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/dmv152/timer/timer.c b/c/src/lib/libbsp/m68k/dmv152/timer/timer.c
deleted file mode 100644
index cacedf71eb..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/timer/timer.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* timer.c
- *
- * NOTE: These routines will not work if the optimizer is enabled
- * for some compilers. The multiple writes to the Z8036
- * may be optimized away.
- *
- * It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-int Ttimer_val;
-rtems_boolean Timer_driver_Find_average_overhead;
-
-rtems_isr timerisr();
-
-void Timer_initialize()
-{
- rtems_unsigned8 data;
-
- (void) set_vector( timerisr, TIMER_VECTOR, 0 ); /* install ISR */
-
- Ttimer_val = 0; /* clear timer ISR count */
- Z8x36_READ ( TIMER, MASTER_INTR, data );
- Z8x36_WRITE( TIMER, MASTER_INTR, (data & 0x01) );
-
- Z8x36_WRITE( TIMER, MASTER_CFG, 0xd4 );
- Z8x36_READ ( TIMER, MASTER_INTR, data );
- Z8x36_WRITE( TIMER, MASTER_INTR, (data & 0x7E) );
- Z8x36_WRITE( TIMER, CT1_TIME_CONST_MSB, 0x00 );
- Z8x36_WRITE( TIMER, CT1_TIME_CONST_LSB, 0x00 );
- Z8x36_WRITE( TIMER, CT1_MODE_SPEC, 0x87 );
- Z8x36_WRITE( TIMER, CNT_TMR_VECTOR, TIMER_VECTOR );
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0x20 );
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0x26 );
- Z8x36_READ ( TIMER, MASTER_INTR, data );
- Z8x36_WRITE( TIMER, MASTER_INTR, (data & 0xDA) | 0x80 );
-
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0xC6 );
-
- /*
- * ACC_IC54 - interrupt 5 will be vectored and mapped to level 6
- */
-
- data = (*(rtems_unsigned8 *)0x0D00000B);
- (*(rtems_unsigned8 *)0x0D00000B) = (data & 0x0F) | 0x60;
-
-}
-
-#define AVG_OVERHEAD 9 /* It typically takes 3.65 microseconds */
- /* (9 countdowns) to start/stop the timer. */
-#define LEAST_VALID 10 /* Don't trust a value lower than this */
-
-int Read_timer()
-{
- rtems_unsigned8 data;
- rtems_unsigned8 msb, lsb;
- rtems_unsigned32 remaining, total;
-
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0xce ); /* read the counter value */
- Z8x36_READ( TIMER, CT1_CUR_CNT_MSB, msb );
- Z8x36_READ( TIMER, CT1_CUR_CNT_LSB, lsb );
-
- remaining = 0x10000 - ((msb << 8) + lsb);
- total = (Ttimer_val * 0x10000) + remaining;
-
- Z8x36_READ ( TIMER, MASTER_INTR, data );
- Z8x36_WRITE( TIMER, MASTER_INTR, (data & 0x01) );
-
- /* do not restore old vector */
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in countdown units */
-
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
-
- /* Clocked at 2.4615 Mhz */
-
- return (int)(((float)(total-AVG_OVERHEAD)) / 2.4615 * 2.0);
-}
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/m68k/dmv152/timer/timerisr.s b/c/src/lib/libbsp/m68k/dmv152/timer/timerisr.s
deleted file mode 100644
index ef0ed8d212..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/timer/timerisr.s
+++ /dev/null
@@ -1,38 +0,0 @@
-/* timer_isr()
- *
- * This routine provides the ISR for the Z8536 timer on the DMV152
- * board. The timer is set up to generate an interrupt at maximum
- * intervals.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-
-BEGIN_CODE
-
-.set TIMER, 0x0c000007 | port A
-.set CT1_CMD_STATUS, 0x0a | command status register
-.set RELOAD, 0x26 | clr IP & IUS,allow countdown
-
- PUBLIC(timerisr)
-SYM (timerisr):
- movb #CT1_CMD_STATUS,TIMER | set pointer to cmd status reg
- movb #RELOAD,TIMER | reload countdown
- addql #1, SYM (Ttimer_val) | increment timer value
- rte
-
-END_CODE
-END
diff --git a/c/src/lib/libbsp/m68k/dmv152/times b/c/src/lib/libbsp/m68k/dmv152/times
deleted file mode 100644
index 6d59b87862..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/times
+++ /dev/null
@@ -1,195 +0,0 @@
-#
-# Timing Test Suite Results for the DY-4 DMV152 BSP
-#
-# NOTE: These times also also applicable to similar configurations of
-# the DY-4 SVME153 which is the commercial grade version of the
-# same board.
-#
-# $Id$
-#
-
-Board: DY-4 DMV152 / DY-4 SVME153
-CPU: Motorola MC68020
-Clock Speed: 20 Mhz
-Memory Configuration: SRAM
-Wait States: 0
-
-Times Reported in: microseconds
-Timer Source: Zilog Z8036 Count Down Timer
-
-Column A: 3.5.1 pre-release
-Column B: unused
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 67
- rtems_semaphore_delete 63
- rtems_semaphore_obtain: available 45
- rtems_semaphore_obtain: not available -- NO_WAIT 44
- rtems_semaphore_release: no waiting tasks 49
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 114
-
- 3 rtems_semaphore_release: task readied -- preempts caller 92
-
- 4 rtems_task_restart: blocked task -- preempts caller 153
- rtems_task_restart: ready task -- preempts caller 145
- rtems_semaphore_release: task readied -- returns to caller 71
- rtems_task_create 154
- rtems_task_start 83
- rtems_task_restart: suspended task -- returns to caller 95
- rtems_task_delete: suspended task 144
- rtems_task_restart: ready task -- returns to caller 98
- rtems_task_restart: blocked task -- returns to caller 128
- rtems_task_delete: blocked task 149
-
- 5 rtems_task_suspend: calling task 76
- rtems_task_resume: task readied -- preempts caller 72
-
- 6 rtems_task_restart: calling task 100
- rtems_task_suspend: returns to caller 49
- rtems_task_resume: task readied -- returns to caller 50
- rtems_task_delete: ready task 150
-
- 7 rtems_task_restart: suspended task -- preempts caller 100
-
- 8 rtems_task_set_priority: obtain current priority 37
- rtems_task_set_priority: returns to caller 69
- rtems_task_mode: obtain current mode 16
- rtems_task_mode: no reschedule 18
- rtems_task_mode: reschedule -- returns to caller 24
- rtems_task_mode: reschedule -- preempts caller 66
- rtems_task_set_note 39
- rtems_task_get_note 39
- rtems_clock_set 90
- rtems_clock_get 3
-
- 9 rtems_message_queue_create 206
- rtems_message_queue_send: no waiting tasks 103
- rtems_message_queue_urgent: no waiting tasks 102
- rtems_message_queue_receive: available 87
- rtems_message_queue_flush: no messages flushed 37
- rtems_message_queue_flush: messages flushed 46
- rtems_message_queue_delete 85
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 52
- rtems_message_queue_receive: not available -- caller blocks 119
-
-11 rtems_message_queue_send: task readied -- preempts caller 128
-
-12 rtems_message_queue_send: task readied -- returns to caller 106
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 128
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 106
-
-15 rtems_event_receive: obtain current events 0
- rtems_event_receive: not available -- NO_WAIT 32
- rtems_event_receive: not available -- caller blocks 91
- rtems_event_send: no task readied 34
- rtems_event_receive: available 37
- rtems_event_send: task readied -- returns to caller 66
-
-16 rtems_event_send: task readied -- preempts caller 89
-
-17 rtems_task_set_priority: preempts caller 109
-
-18 rtems_task_delete: calling task 175
-
-19 rtems_signal_catch 24
- rtems_signal_send: returns to caller 43
- rtems_signal_send: signal to self 50
- exit ASR overhead: returns to calling task 37
- exit ASR overhead: returns to preempting task 64
-
-20 rtems_partition_create 79
- rtems_region_create 72
- rtems_partition_get_buffer: available 43
- rtems_partition_get_buffer: not available 41
- rtems_partition_return_buffer 51
- rtems_partition_delete 47
- rtems_region_get_segment: available 59
- rtems_region_get_segment: not available -- NO_WAIT 55
- rtems_region_return_segment: no waiting tasks 63
- rtems_region_get_segment: not available -- caller blocks 127
- rtems_region_return_segment: task readied -- preempts caller 143
- rtems_region_return_segment: task readied -- returns to caller 121
- rtems_region_delete 47
- rtems_io_initialize 6
- rtems_io_open 3
- rtems_io_close 2
- rtems_io_read 2
- rtems_io_write 2
- rtems_io_control 2
-
-21 rtems_task_ident 352
- rtems_message_queue_ident 343
- rtems_semaphore_ident 369
- rtems_partition_ident 342
- rtems_region_ident 349
- rtems_port_ident 342
- rtems_timer_ident 344
- rtems_rate_monotonic_ident 343
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 114
- rtems_message_queue_broadcast: no waiting tasks 58
- rtems_message_queue_broadcast: task readied -- preempts caller 136
-
-23 rtems_timer_create 36
- rtems_timer_fire_after: inactive 64
- rtems_timer_fire_after: active 68
- rtems_timer_cancel: active 41
- rtems_timer_cancel: inactive 38
- rtems_timer_reset: inactive 59
- rtems_timer_reset: active 63
- rtems_timer_fire_when: inactive 93
- rtems_timer_fire_when: active 93
- rtems_timer_delete: active 54
- rtems_timer_delete: inactive 50
- rtems_task_wake_when 120
-
-24 rtems_task_wake_after: yield -- returns to caller 25
- rtems_task_wake_after: yields -- preempts caller 63
-
-25 rtems_clock_tick 13
-
-26 _ISR_Disable 1
- _ISR_Flash 1
- _ISR_Enable 0
- _Thread_Disable_dispatch 1
- _Thread_Enable_dispatch 20
- _Thread_Set_state 24
- _Thread_Disptach (NO FP) 52
- context switch: no floating point contexts 43
- context switch: self 9
- context switch: to another task 9
- context switch: restore 1st FP task 47
- fp context switch: save idle, restore idle 73
- fp context switch: save idle, restore initialized 60
- fp context switch: save initialized, restore initialized 58
- _Thread_Resume 17
- _Thread_Unblock 17
- _Thread_Ready 22
- _Thread_Get 11
- _Semaphore_Get 10
- _Thread_Get: invalid id 2
-
-27 interrupt entry overhead: returns to interrupted task 10
- interrupt exit overhead: returns to interrupted task 9
- interrupt entry overhead: returns to nested interrupt 9
- interrupt exit overhead: returns to nested interrupt 6
- interrupt entry overhead: returns to preempting task 10
- interrupt exit overhead: returns to preempting task 62
-
-28 rtems_port_create 44
- rtems_port_external_to_internal 34
- rtems_port_internal_to_external 34
- rtems_port_delete 45
-
-29 rtems_rate_monotonic_create 41
- rtems_rate_monotonic_period: initiate period -- returns to caller 61
- rtems_rate_monotonic_period: obtain status 39
- rtems_rate_monotonic_cancel 46
- rtems_rate_monotonic_delete: inactive 55
- rtems_rate_monotonic_delete: active 58
- rtems_rate_monotonic_period: conclude periods -- caller blocks 82
diff --git a/c/src/lib/libbsp/m68k/dmv152/wrapup/Makefile.in b/c/src/lib/libbsp/m68k/dmv152/wrapup/Makefile.in
deleted file mode 100644
index 3ef5e9d4bb..0000000000
--- a/c/src/lib/libbsp/m68k/dmv152/wrapup/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console spurious timer
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/m68k/efi332/Makefile.in b/c/src/lib/libbsp/m68k/efi332/Makefile.in
deleted file mode 100644
index 21c1abc2c8..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include start332 startup clock console spurious timer wrapup
diff --git a/c/src/lib/libbsp/m68k/efi332/README b/c/src/lib/libbsp/m68k/efi332/README
deleted file mode 100644
index 097ce132ad..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/README
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# $Id$
-#
-
-Description: efi68k
-============
-CPU: MC68332 @16MHz
-RAM: 256k max. (supports several configurations)
-ROM: 512k (supports several configurations)
-
- This general purpose controller has been designed by a group of
-Internet subscribes to the mailing list "efi332" (an offshoot of the
-"diy_efi" mailing list). Although efi332 was initially designed for
-automotive research, it is a fairly generalized embedded controller
-when used without the companion EFI I/O board. It is patterned much after
-the the Motorola BCC but cost on the order of $250US. A 4x3 inch
-(approx.) printed circuit board is available (about $14US). For complete
-information see
-
- http://efi332.eng.ohio-state.edu
-TODO:
-=====
-- integrate the interrupt driven stdin/stdout into RTEMS to (a) reduce
- the interrupt priority and (2) to prevent it from blocking. (high
- priority)
-- add a timer driver for the tmtest set.
-- generate include/coverhd.c to perform the tmtest.
-- add separate interrupt stack (low priority... may never happen :).
-
- John S Gwynne
- Gwynne.1@osu.edu
-_______________________________________________________________________________
- T h e O h i o - S t a t e U n i v e r s i t y
- ElectroScience Laboratory, 1320 Kinnear Road, Columbus, Ohio 43212, USA
- Telephone: (614) 292-7981 * Fax: (614) 292-7297
--------------------------------------------------------------------------------
diff --git a/c/src/lib/libbsp/m68k/efi332/bsp_specs b/c/src/lib/libbsp/m68k/efi332/bsp_specs
deleted file mode 100644
index 0e65618e1a..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start332.o%s} \
-%{qrtems_debug: start332_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/m68k/efi332/clock/Makefile.in b/c/src/lib/libbsp/m68k/efi332/clock/Makefile.in
deleted file mode 100644
index 59df4f2702..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/clock/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/efi332/clock/ckinit.c b/c/src/lib/libbsp/m68k/efi332/clock/ckinit.c
deleted file mode 100644
index 38d476683b..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/clock/ckinit.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/* Clock_init()
- *
- * This routine initailizes the periodic interrupt timer on
- * the Motorola 68332.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <efi332.h>
-
-#define CLOCK_VECTOR EFI_PIV
-
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-volatile rtems_unsigned32 Clock_driver_ticks;
- /* ticks since initialization */
-rtems_isr_entry Old_ticker;
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-rtems_isr Clock_isr(rtems_vector_number vector)
-{
- Clock_driver_ticks += 1;
-
- if ( Clock_isrs == 1 ) {
- rtems_clock_tick();
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
- }
- else
- Clock_isrs -= 1;
-}
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
- Clock_driver_ticks = 0;
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
-
- /* enable 1mS interrupts */
- *PITR = (unsigned short int)( SAM(0x09,0,PITM) );/* load counter */
- *PICR = (unsigned short int) /* enable interrupt */
- ( SAM(ISRL_PIT,8,PIRQL) | SAM(CLOCK_VECTOR,0,PIV) );
-
- atexit( Clock_exit );
- }
-}
-
-void Clock_exit( void )
-{
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
-
- /* shutdown the periodic interrupt */
- *PICR = (unsigned short int)
- ( SAM(0,8,PIRQL) | SAM(CLOCK_VECTOR,0,PIV) );
- /* ^^ zero disables interrupt */
-
- /* do not restore old vector */
-
- }
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libbsp/m68k/efi332/console/Makefile.in b/c/src/lib/libbsp/m68k/efi332/console/Makefile.in
deleted file mode 100644
index fd05ddfedd..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/efi332/console/console.c b/c/src/lib/libbsp/m68k/efi332/console/console.c
deleted file mode 100644
index e678836688..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/console/console.c
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- * This file contains the efi332 console IO package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-#include <bsp.h>
-#include <rtems/libio.h>
-
-/* BUFFER_LENGTH must be 2^n for n=1, 2, 3, .... */
-#define BUFFER_LENGTH 256
-#define RTS_STOP_SIZE BUFFER_LENGTH-64
-#define RTS_START_SIZE 16
-
-char xmt_buf[BUFFER_LENGTH];
-char rcv_buf[BUFFER_LENGTH];
-/* in: last entry into the buffer; always on a valid character */
-/* out: points to the next character to be pull from the buffer */
-/* in+1=out => buffer empty */
-/* in+2=out => buffer full */
-struct UART_buf {
- char *offset;
- char *in;
- char *out;
-};
-static volatile struct UART_buf xmt = { xmt_buf, (char *)0, (char *)1};
-static volatile struct UART_buf rcv = { rcv_buf, (char *)0, (char *)1};
-static volatile char _debug_flag = 0;
-
-#define SET_RTS(a) {*PORTF0 = (*PORTF0 & ~0x4) | ( (a)? 0 : 0x4); }
-#define GET_CTS (!(*PORTF0 & 0x2))
-
-/* _catchSCIint, _catchCTSint, and _catchSPURIOUSint are the
- interrupt front-ends */
-extern void _catchSCIint();
-asm(" .text
- .align 2
- .globl _catchSCIint
-_catchSCIint:
- moveml %d0-%d7/%a0-%a6,%sp@- /* save registers */
- jbsr uart_interrupt
- moveml %sp@+,%d0-%d7/%a0-%a6
- rte
- ");
-
-extern void _catchCTSint();
-asm(" .text
- .align 2
- .globl _catchCTSint
-_catchCTSint:
- moveml %d0-%d7/%a0-%a6,%sp@- /* save registers */
- jbsr cts_interrupt
- moveml %sp@+,%d0-%d7/%a0-%a6
- rte
- ");
-
-extern void _catchSPURIOUSint();
-asm(" .text
- .align 2
- .globl _catchSPURIOUSint
-_catchSPURIOUSint:
- moveml %d0-%d7/%a0-%a6,%sp@- /* save registers */
- jbsr spurious_interrupt
- moveml %sp@+,%d0-%d7/%a0-%a6
- rte
- ");
-
-int _spurious_int_counter=0;
-
-/* note: cts uses int1. If it "bounces", a spurious interrupt is generated */
-void spurious_interrupt(void) {
- _spurious_int_counter++; /* there should never be alot of these */
-}
-
-/* _fake_trap_1 will continue the UART interrupt (%sr *still*
- UART_ISR_LEVEL) as a trap #1 to enter the debugger */
-
-/* *****fix me; this is for 68000 w/jsr ram exception table ******* */
-asm(" .text
- .align 2
-_fake_trap_1:
- unlk %a6 /* clear interrupt frame */
- lea %sp@(4),%sp /* remove jbsr instruction */
- moveml %sp@+,%d0-%d7/%a0-%a6 /* pop registers */
- jmp (33*6-12) /* jump exception 1 */
- ");
-
-/* dispatch UART interrupt */
-void xmit_interrupt(void);
-void rcvr_interrupt(void);
-void _fake_trap_1(void);
-
-void uart_interrupt(void) {
- /* receiver status bits are cleared by a SCSR read followed
- by a SCDR read. transmitter status bits are cleared by
- a SCSR read followed by a SCDR write. */
- if ((*SCSR) & (TDRE | TC))
- xmit_interrupt();
-
- if ((*SCSR) & (RDRF))
- rcvr_interrupt();
-
- if (_debug_flag) {
- _debug_flag = 0; /* reset the flag */
- _fake_trap_1(); /* fake a trap #1 */
- }
-}
-
-/* transfer received character to the buffer */
-void rcvr_interrupt(void) {
- register char *a, c;
- register int length;
-
- while((*SCSR) & (RDRF)) {
- if ((c=*SCDR) == 0x1a) /* use ctl-z to reboot */
- reboot();
-/* else if (c == 0x03) { */ /* use ctl-c to enter debugger */
-/* _debug_flag = 1; */
-/* continue; */
-/* } */
-
- *(char *)((int)rcv.offset +(int)
- (a=(char *)(((int)rcv.in+1) & ((int)BUFFER_LENGTH-1)))) = c;
- if ((char *)(((int)rcv.in+2) & ((int)BUFFER_LENGTH-1)) != rcv.out)
- rcv.in=a;
- };
-
- length = (BUFFER_LENGTH -1) & (
- ( ((int)rcv.out <= (int)rcv.in) ? 0 : BUFFER_LENGTH) - (int)rcv.out
- + (int)rcv.in + 1);
- if (length >= RTS_STOP_SIZE)
- SET_RTS(0);
-}
-
-/* tranfer buffered characters to the UART */
-void xmit_interrupt(void) {
- register short int oldsr;
-
- _CPU_ISR_Disable( oldsr ); /* for when outbyte or flush calls */
- while ((*SCSR) & (TDRE)) {
- if ((char *)(((int)xmt.in+1) & ((int)BUFFER_LENGTH-1)) != xmt.out)
- /* xmit buffer not empty */
- if (GET_CTS) {
- /* send next char */
- *SCDR=*(char *)((int)xmt.offset+(int)xmt.out);
- xmt.out= (char *)(((int)xmt.out+1) & ((int)BUFFER_LENGTH-1));
- *SCCR1 = (*SCCR1 & ~(TIE | TCIE)) | (TIE);
- }
- else {
- /* configue CTS interrupt and shutdown xmit interrupts */
- *SCCR1 &= ~(TIE | TCIE);
- *PFPAR |= 0x2;
- break;
- }
- else {
- /* xmit buffer empty; shutdown interrupts */
- *SCCR1 &= ~(TIE | TCIE);
- break;
- }
- }
- _CPU_ISR_Enable( oldsr );
-}
-
-void cts_interrupt(void) {
- register short int oldsr;
-
- _CPU_ISR_Disable( oldsr ); /* for when outbyte calls */
-
- *PFPAR &= ~0x2;
- *SCCR1 = (*SCCR1 & ~(TIE | TCIE)) | (TIE);
-
- _CPU_ISR_Enable( oldsr );
-}
-
-
-
-/* transfer character from the buffer */
-char inbyte(void) {
- register char a;
- register int length;
-
- while ((char *)(((int)rcv.in+1) & ((int)BUFFER_LENGTH-1))== rcv.out);
- a=*(char *)((int)rcv.offset+(int)rcv.out);
- rcv.out= (char *)(((int)rcv.out+1) & ((int)BUFFER_LENGTH-1));
- length = (BUFFER_LENGTH -1) & (
- ( ((int)rcv.out <= (int)rcv.in) ? 0 : BUFFER_LENGTH) - (int)rcv.out
- + (int)rcv.in + 1);
- if (length < RTS_START_SIZE)
- SET_RTS(1);
- return (a);
-}
-
-/* once room is avaliable in the buffer, transfer
- the character into the buffer and enable
- the xmtr interrupt */
-void outbyte(char c) {
- register char *a;
-
- while ((char *)(((int)xmt.in+2) & ((int)BUFFER_LENGTH-1)) == xmt.out);
- *(char *)((int)xmt.offset+(int)
- (a=(char *)(((int)xmt.in+1) & ((int)BUFFER_LENGTH-1))))=c;
- xmt.in=a;
-
- if (!(*SCCR1 & (TIE | TCIE)) && (!(*PFPAR & 0x2)) )
- /* if neither interrupts are running, */
- xmit_interrupt(); /* we need to restart the xmiter */
-}
-
-void _UART_flush(void) {
- /* loop till xmt buffer empty. Works with interrupts disabled */
- while ((char *)(((int)xmt.in+1) & ((int)BUFFER_LENGTH-1)) != xmt.out)
- xmit_interrupt();
- /* loop till UART buffer empty */
- while ( (*SCSR & TC) == 0 );
-}
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-void console_init()
-{
- *QSMCR = ( SAM(QSM_IARB,0,IARB) );
- *QILR = ( SAM(ISRL_QSPI,4,ILQSPI) | SAM(ISRL_SCI,0,ILSCI) );
- *QIVR = ( SAM(EFI_QIVR,0,INTV) );
-
- *SCCR0 = ( (int)( SYS_CLOCK/SCI_BAUD/32.0+0.5 ) & 0x1fff );
- *SCCR1 = ( RIE | TE | RE );
-
- set_vector(_catchSPURIOUSint, EFI_SPINT, 0);
- set_vector(_catchSCIint, EFI_QIVR, 0);
- set_vector(_catchCTSint, EFI_INT1, 0);
-}
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-}
-
-/* is_character_ready
- *
- * This routine returns TRUE if a character is available.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_boolean is_character_ready(
- char *ch
-)
-{
- if ((char *)(((int)rcv.in+1) & ((int)BUFFER_LENGTH-1))== rcv.out)
- return(FALSE);
- else
- return(TRUE);
-}
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte();
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r');
- }
- outbyte( buffer[ count ] );
- }
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libbsp/m68k/efi332/include/Makefile.in b/c/src/lib/libbsp/m68k/efi332/include/Makefile.in
deleted file mode 100644
index 145f554e29..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/efi332.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/m68k/efi332/include/bsp.h b/c/src/lib/libbsp/m68k/efi332/include/bsp.h
deleted file mode 100644
index 1279d32c39..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/include/bsp.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/* bsp.h
- *
- * This include file contains all efi332 board IO definitions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __EFI332_BSP_h
-#define __EFI332_BSP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <clockdrv.h>
-#include <console.h>
-#include <iosupp.h>
-#include <efi332.h>
-#include <sim.h>
-#include <qsm.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Define the interrupt mechanism for Time Test 27
- */
-
-/* XXX - JRS - I want to compile the tmtests */
-
-#define MUST_WAIT_FOR_INTERRUPT 1
-
-#define Install_tm27_vector( handler )
-
-#define Cause_tm27_intr()
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( microseconds ) \
- { register rtems_unsigned32 _delay=(microseconds); \
- register rtems_unsigned32 _tmp=123; \
- asm volatile( "0: \
- nbcd %0 ; \
- nbcd %0 ; \
- dbf %1,0b" \
- : "=d" (_tmp), "=d" (_delay) \
- : "0" (_tmp), "1" (_delay) ); \
- }
-
-/* externals */
-
-extern char _endtext[];
-extern char _sdata[];
-extern char _edata[];
-extern char __bss_start[];
-extern char _end[];
-extern char _copy_data_from_rom[];
-extern char __end_of_ram[];
-
-/* constants */
-
-#define RAM_END ((int)__end_of_ram)
-
-#ifdef __START_C__
-#define STACK_SIZE "#0x800"
-#else
-#define STACK_SIZE 0x800
-#endif
-
-/* macros */
-
-#define RAW_PUTS(str) \
- { register char *ptr = str; \
- while (*ptr) outbyte(*ptr++); \
- }
-
-#define RAW_PUTI(n) { \
- register int i, j; \
- \
- RAW_PUTS("0x"); \
- for (i=28;i>=0;i -= 4) { \
- j = (n>>i) & 0xf; \
- outbyte( (j>9 ? j-10+'a' : j+'0') ); \
- } \
- }
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-extern m68k_isr_entry M68Kvec[]; /* vector table address */
-
-extern int stack_size;
-
-extern int stack_start;
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-m68k_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-void console_init(void);
-
-void Spurious_Initialize(void);
-
-void _UART_flush(void);
-
-void Clock_exit(void);
-
-void outbyte(char);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/efi332/include/coverhd.h b/c/src/lib/libbsp/m68k/efi332/include/coverhd.h
deleted file mode 100644
index 02df403a18..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/include/coverhd.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- * This file should be updated after running the C overhead timing
- * test. Once this update has been performed, the RTEMS Time Test
- * Suite should be rebuilt to account for these overhead times in the
- * timing results.
- *
- * NOTE: If these are all zero, then the times reported include
- * all calling overhead including passing of arguments.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
-#define CALLING_OVERHEAD_TASK_CREATE 0
-#define CALLING_OVERHEAD_TASK_IDENT 0
-#define CALLING_OVERHEAD_TASK_START 0
-#define CALLING_OVERHEAD_TASK_RESTART 0
-#define CALLING_OVERHEAD_TASK_DELETE 0
-#define CALLING_OVERHEAD_TASK_SUSPEND 0
-#define CALLING_OVERHEAD_TASK_RESUME 0
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
-#define CALLING_OVERHEAD_TASK_MODE 0
-#define CALLING_OVERHEAD_TASK_GET_NOTE 0
-#define CALLING_OVERHEAD_TASK_SET_NOTE 0
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 0
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
-#define CALLING_OVERHEAD_CLOCK_GET 0
-#define CALLING_OVERHEAD_CLOCK_SET 0
-#define CALLING_OVERHEAD_CLOCK_TICK 0
-
-#define CALLING_OVERHEAD_TIMER_CREATE 0
-#define CALLING_OVERHEAD_TIMER_IDENT 0
-#define CALLING_OVERHEAD_TIMER_DELETE 0
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 0
-#define CALLING_OVERHEAD_TIMER_RESET 0
-#define CALLING_OVERHEAD_TIMER_CANCEL 0
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
-
-#define CALLING_OVERHEAD_EVENT_SEND 0
-#define CALLING_OVERHEAD_EVENT_RECEIVE 0
-#define CALLING_OVERHEAD_SIGNAL_CATCH 0
-#define CALLING_OVERHEAD_SIGNAL_SEND 0
-#define CALLING_OVERHEAD_PARTITION_CREATE 0
-#define CALLING_OVERHEAD_PARTITION_IDENT 0
-#define CALLING_OVERHEAD_PARTITION_DELETE 0
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
-#define CALLING_OVERHEAD_REGION_CREATE 0
-#define CALLING_OVERHEAD_REGION_IDENT 0
-#define CALLING_OVERHEAD_REGION_DELETE 0
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
-#define CALLING_OVERHEAD_PORT_CREATE 0
-#define CALLING_OVERHEAD_PORT_IDENT 0
-#define CALLING_OVERHEAD_PORT_DELETE 0
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 0
-#define CALLING_OVERHEAD_IO_OPEN 0
-#define CALLING_OVERHEAD_IO_CLOSE 0
-#define CALLING_OVERHEAD_IO_READ 0
-#define CALLING_OVERHEAD_IO_WRITE 0
-#define CALLING_OVERHEAD_IO_CONTROL 0
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
-
-#endif
diff --git a/c/src/lib/libbsp/m68k/efi332/include/efi332.h b/c/src/lib/libbsp/m68k/efi332/include/efi332.h
deleted file mode 100644
index f9a5584c1b..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/include/efi332.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* efi332.h
- *
- * $Id$
- */
-
-#ifndef _EFI332_H_
-#define _EFI332_H_
-
-
-/* SIM_MM (SIM Module Mapping) determines the location of the control
- register block. When MM=0, register addresses range fom 0x7ff000 to
- 0x7FFFFF. When MM=1, register addresses range from 0xfff000 to
- 0xffffff. */
-#define SIM_MM 1
-
-
-/* Interrupt related definitions */
-#define SIM_IARB 15
-#define QSM_IARB 10
-
-#define EFI_PIV 64
-#define ISRL_PIT 4 /* zero disables PIT */
-
-#define EFI_QIVR 66 /* 66=>SCI and 67=>QSPI interrupt */
-#define ISRL_QSPI 0
-
-#define EFI_SPINT 24 /* spurious interrupt */
-#define EFI_INT1 25 /* CTS interrupt */
-#define ISRL_SCI 6
-
-
-
-/* System Clock definitions */
-#define XTAL 32768.0 /* crystal frequency in Hz */
-#define EFI_W 0 /* system clock parameters */
-#define EFI_X 1
-#define EFI_Y 0x38
-#define SYS_CLOCK (XTAL*4.0*(EFI_Y+1)*(1 << (2*EFI_W+EFI_X)))
-#define SCI_BAUD 115200 /* RS232 Baud Rate */
-
-
-/* macros/functions */
-
-/*
- * This prototype really should have the noreturn attribute but
- * that causes a warning since it appears that the routine does
- * return.
- *
- * void reboot(void) __attribute__ ((noreturn));
- */
-
-void reboot(void);
-
-#endif /* _EFI332_H_ */
diff --git a/c/src/lib/libbsp/m68k/efi332/misc/dotests b/c/src/lib/libbsp/m68k/efi332/misc/dotests
deleted file mode 100644
index b9449bffc3..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/misc/dotests
+++ /dev/null
@@ -1,15 +0,0 @@
-#! /bin/bash
-#
-# $Id$
-#
-
-/bin/rm sp* &>/dev/null
-(cd ..; for f in sp*; do cp ${f}/o-efi332/${f}.nxe hold; done)
-
-stty 5:0:800008bf:0:0:0:0:0:0:1:1:0:0:0:0:0:0:0:0:0:0:0:0 </dev/cua0
-/bin/cp /dev/cua0 screen &
-
-for f in sp*; do m68k-bdm-coff-gdb ${f} </dev/null; done
-
-kill -9 `ps -efax | grep "/bin/cp /dev/cua0" | sed "/grep/D; s/ .*$//"`
-/bin/rm sp* &>/dev/null
diff --git a/c/src/lib/libbsp/m68k/efi332/misc/gdbinit68 b/c/src/lib/libbsp/m68k/efi332/misc/gdbinit68
deleted file mode 100644
index 9a104f86d2..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/misc/gdbinit68
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# $Id$
-#
-echo Setting up the environment for efi332 debuging.\n
-
-target bdm /dev/pdbdm0
-bdm_setdelay 405
-bdm_autoreset on
-set remotecache off
-bdm_timetocomeup 0
-bdm_init
-bdm_reset
-set $sfc=5
-set $dfc=5
-r
-q
diff --git a/c/src/lib/libbsp/m68k/efi332/misc/interr.c b/c/src/lib/libbsp/m68k/efi332/misc/interr.c
deleted file mode 100644
index 4edf3347a8..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/misc/interr.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Internal Error Handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/userext.h>
-
-/*PAGE
- *
- * _Internal_error_Occurred
- *
- * This routine will invoke the fatal error handler supplied by the user
- * followed by the the default one provided by the executive. The default
- * error handler assumes no hardware is present to help inform the user
- * of the problem. Halt stores the error code in a known register,
- * disables interrupts, and halts the CPU. If the CPU does not have a
- * halt instruction, it will loop to itself.
- *
- * Input parameters:
- * the_source - what subsystem the error originated in
- * is_internal - if the error was internally generated
- * the_error - fatal error status code
- *
- * Output parameters:
- * As much information as possible is stored in a CPU dependent fashion.
- * See the CPU dependent code for more information.
- *
- * NOTE: The the_error is not necessarily a directive status code.
- */
-
-/*
- * Ugly hack.... _CPU_Fatal_halt() disonnects the bdm. Without this
- * change, the_error is only known only to the cpu :).
- *
- * From "bsp.h" which is not yet available in the arch tree during
- * this phase of install. jsg
- */
-void outbyte(char);
-void bsp_cleanup( void );
-
-#define RAW_PUTS(str) \
- { register char *ptr = str; \
- while (*ptr) outbyte(*ptr++); \
- }
-
-#define RAW_PUTI(n) { \
- register int i, j; \
- \
- RAW_PUTS("0x"); \
- for (i=28;i>=0;i -= 4) { \
- j = (n>>i) & 0xf; \
- outbyte( (j>9 ? j-10+'a' : j+'0') ); \
- } \
- }
-
-void volatile _Internal_error_Occurred(
- Internal_errors_Source the_source,
- boolean is_internal,
- unsigned32 the_error
-)
-{
-
- Internal_errors_What_happened.the_source = the_source;
- Internal_errors_What_happened.is_internal = is_internal;
- Internal_errors_What_happened.the_error = the_error;
-
- _User_extensions_Fatal( the_source, is_internal, the_error );
-
- _System_state_Set( SYSTEM_STATE_FAILED );
-
- /* try to print error message to outbyte */
- RAW_PUTS("\r\nRTEMS: A fatal error has occured.\r\n");
- RAW_PUTS("RTEMS: fatal error ");
- RAW_PUTI( the_error );
- RAW_PUTS(".\r\n");
-
- /* configure peripherals for a safe exit */
- bsp_cleanup();
-
- _CPU_Fatal_halt( the_error );
-
- /* will not return from this routine */
-}
diff --git a/c/src/lib/libbsp/m68k/efi332/spurious/Makefile.in b/c/src/lib/libbsp/m68k/efi332/spurious/Makefile.in
deleted file mode 100644
index 871175f129..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/spurious/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/spurious.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=spinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/efi332/spurious/spinit.c b/c/src/lib/libbsp/m68k/efi332/spurious/spinit.c
deleted file mode 100644
index 8310dab000..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/spurious/spinit.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Spurious_driver
- *
- * This routine installs spurious interrupt handlers for the efi332.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <stdio.h>
-
-const char * const _Spurious_Error_[] = {"Reset","Bus Error","Address Error",
- "Illegal Instruction","Zero Division","CHK, CHK2 Instruction",
- "TRAPcc, TRAPV Instruction","Privilege Violation","Trace",
- "Line 1010 Emulation","Line 1111 Emulation","Hardware Breakpoint",
- "Coprocessor Protocal Violation",
- "Format Error ans Uninitialized Interrupt","Unassigned",
- "Spurious Interrupt","AVec1","AVec2","AVec3","AVec4","AVec5","AVec6",
- "AVec7","Trap Instruction","Debug","Reboot","Reserved Coprocessor",
- "Reserved Unassigned","User Defined"};
-
-rtems_isr Spurious_Isr(
- rtems_vector_number vector
-)
-{
- int sp = 0;
- const char * const VectDescrip[] = {
- _Spurious_Error_[0], _Spurious_Error_[0], _Spurious_Error_[1],
- _Spurious_Error_[2], _Spurious_Error_[3], _Spurious_Error_[4],
- _Spurious_Error_[5], _Spurious_Error_[6], _Spurious_Error_[7],
- _Spurious_Error_[8], _Spurious_Error_[9], _Spurious_Error_[10],
- _Spurious_Error_[11], _Spurious_Error_[12], _Spurious_Error_[13],
- _Spurious_Error_[13], _Spurious_Error_[14], _Spurious_Error_[14],
- _Spurious_Error_[14], _Spurious_Error_[14], _Spurious_Error_[14],
- _Spurious_Error_[14], _Spurious_Error_[14], _Spurious_Error_[14],
- _Spurious_Error_[15], _Spurious_Error_[16], _Spurious_Error_[17],
- _Spurious_Error_[18], _Spurious_Error_[19], _Spurious_Error_[20],
- _Spurious_Error_[21], _Spurious_Error_[22], _Spurious_Error_[23],
- _Spurious_Error_[24], _Spurious_Error_[23], _Spurious_Error_[23],
- _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
- _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
- _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
- _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[25],
- _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
- _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
- _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
- _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[27],
- _Spurious_Error_[27], _Spurious_Error_[27], _Spurious_Error_[27],
- _Spurious_Error_[27], _Spurious_Error_[28]};
-
- asm volatile ( "movea.l %%sp,%0 " : "=a" (sp) : "0" (sp) );
-
- _CPU_ISR_Set_level( 7 );
- _UART_flush();
-
- RAW_PUTS("\n\rRTEMS: Spurious interrupt: ");
- RAW_PUTS((char *)VectDescrip[( (vector>64) ? 64 : vector )]);
- RAW_PUTS("\n\rRTEMS: Vector: ");
- RAW_PUTI(vector);
- RAW_PUTS(" sp: ");
- RAW_PUTI(sp);
- RAW_PUTS("\n\r");
-
- bsp_cleanup();
-
- /* BDM SIGEMT */
- asm(" .word 0x4afa");
-
- for(;;);
-}
-
-void Spurious_Initialize(void)
-{
- rtems_vector_number vector;
-
- for ( vector = 0x0 ; vector <= 0xFF ; vector++ )
- (void) set_vector( Spurious_Isr, vector, 1 );
-}
diff --git a/c/src/lib/libbsp/m68k/efi332/start/Makefile.in b/c/src/lib/libbsp/m68k/efi332/start/Makefile.in
deleted file mode 100644
index 2373aeca0b..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/start/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/start332.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=start332
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/m68k/efi332/start/start.c b/c/src/lib/libbsp/m68k/efi332/start/start.c
deleted file mode 100644
index 05f8d75ce9..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/start/start.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * $Id
- */
-
-#include <efi332.h>
-#include <sim.h>
-#define __START_C__
-#include "bsp.h"
-
-m68k_isr_entry M68Kvec[256];
-m68k_isr_entry vectors[256];
-char * const __argv[]= {"main", ""};
-char * const __env[]= {""};
-
-/*
- * This prototype really should have the noreturn attribute but
- * that causes a warning since it appears that the routine does
- * return.
- *
- * void dumby_start () __attribute__ ((noreturn));
- */
-
-void dumby_start ();
-void dumby_start() {
-void boot_card();
-
- /* We need to by-pass the link instruction since the RAM chip-
- select pins are not yet configured. */
- asm volatile ( ".global start ;
- start:");
-
- /* disable interrupts, load stack pointer */
- asm volatile ( "oriw #0x0700, %sr;
- moveal #M68Kvec, %a0;
- movec %a0, %vbr;
- movel #_end, %d0;
- addl " STACK_SIZE ",%d0;
- movel %d0,%sp;
- link %a6, #0"
- );
-
- /* include in ram_init.S */
- /*
- * Initalize the SIM module.
- * The stack pointer is not usable until the RAM chip select lines
- * are configured. The following code must remain inline.
- */
-
- /* Module Configuration Register */
- /* see section(s) 3.1.3-3.1.6 of the SIM Reference Manual */
- *SIMCR = (unsigned short int)
- (FRZSW | FRZBM | SAM(0,8,SHEN) | (MM*SIM_MM) | SAM(SIM_IARB,0,IARB));
-
- /* Synthesizer Control Register */
- /* see section(s) 4.8 */
- /* end include in ram_init.S */
- *SYNCR = (unsigned short int)
- ( SAM(EFI_W,15,W) | SAM(0x0,14,X) | SAM(EFI_Y,8,Y) | STSIM );
- while (! (*SYNCR & SLOCK)); /* protect from clock overshoot */
- /* include in ram_init.S */
- *SYNCR = (unsigned short int)
- ( SAM(EFI_W,15,W) | SAM(EFI_X,14,X) | SAM(EFI_Y,8,Y) | STSIM );
-
- /* System Protection Control Register */
- /* !!! can only write to once after reset !!! */
- /* see section 3.8.4 of the SIM Reference Manual */
- *SYPCR = (unsigned char)( SAM(0x3,4,SWT) | HME | BME );
-
- /* Periodic Interrupr Control Register */
- /* see section 3.8.2 of the SIM Reference Manual */
- *PICR = (unsigned short int)
- ( SAM(0,8,PIRQL) | SAM(EFI_PIV,0,PIV) );
- /* ^^^ zero disables interrupt, don't enable here or ram_init will
- be wrong. It's enabled below. */
-
- /* Periodic Interrupt Timer Register */
- /* see section 3.8.3 of the SIM Reference Manual */
- *PITR = (unsigned short int)( SAM(0x09,0,PITM) );
- /* 1.098mS interrupt */
-
- /* Port C Data */
- /* load values before enabled */
- *PORTC = (unsigned char) 0x0;
-
- /* Chip-Select Base Address Register */
- /* see section 7 of the SIM Reference Manual */
- *CSBARBT = (unsigned short int)
- (((0x000000 >> 8)&0xfff8) | BS_512K ); /* 512k bytes located at 0x0000 */
- *CSBAR0 = (unsigned short int)
- (((0x000000 >> 8)&0xfff8) | BS_1M ); /* 1M bytes located at 0x0000 */
- *CSBAR1 = (unsigned short int)
- (((0x080000 >> 8)&0xfff8) | BS_256K ); /* 256k bytes located at 0x80000 */
- *CSBAR2 = (unsigned short int)
- (((0x080000 >> 8)&0xfff8) | BS_256K ); /* 256 bytes located at 0x80000 */
- *CSBAR3 = (unsigned short int)
- (0xfff8 | BS_64K); /* AVEC interrupts */
- *CSBAR10 = (unsigned short int)
- (((0x000000 >> 8)&0xfff8) | BS_512K ); /* 512k bytes located at 0x0000 */
-
- /* Chip-Select Options Registers */
- /* see section 7 of the SIM Reference Manual */
- *CSORBT = (unsigned short int)
- ( BothBytes | ReadWrite | SyncAS | WaitStates_13 | UserSupSpace );
- *CSOR0 = (unsigned short int)
- ( BothBytes | ReadOnly | SyncAS | External | UserSupSpace );
- *CSOR1 = (unsigned short int)
- ( LowerByte | ReadWrite | SyncAS | FastTerm | UserSupSpace );
- *CSOR2 = (unsigned short int)
- ( UpperByte | ReadWrite | SyncAS | FastTerm | UserSupSpace );
- *CSOR3 = (unsigned short int)
- ( BothBytes | ReadWrite | SyncAS | CPUSpace | IPLevel_any | AVEC );
- *CSOR10 = (unsigned short int)
- ( BothBytes | ReadOnly | SyncAS | External | UserSupSpace );
-
- /* Chip Select Pin Assignment Register 0 */
- /* see section 7 of the SIM Reference Manual */
- *CSPAR0 = (unsigned short int)(
- SAM(DisOut,CS_5,0x3000) | /* PC2 */
- SAM(DisOut,CS_4,0x0c00) | /* PC1 */
- SAM(DisOut,CS_3,0x0300) | /* AVEC (internally) */
- SAM(CS16bit,CS_2,0x00c0)| /* RAM UDS */
- SAM(CS16bit,CS_1,0x0030)| /* RAM LDS */
- SAM(CS16bit,CS_0,0x000c)| /* W/!R */
- SAM(CS16bit,CSBOOT,0x0003) /* ROM DS */
- );
-
- /* Chip Select Pin Assignment Register 1 */
- /* see section 7 of the SIM Reference Manual */
- *CSPAR1 = (unsigned short int)(
- SAM(CS16bit,CS_10,0x300)| /* ECLK */
- SAM(DisOut,CS_9,0x0c0) | /* PC6 */
- SAM(DisOut,CS_8,0x030) | /* PC5 */
- SAM(DisOut,CS_7,0x00c) | /* PC4 */
- SAM(DisOut,CS_6,0x003) /* PC3 */
- );
-
- /* Port E and F Data Register */
- /* see section 9 of the SIM Reference Manual */
- *PORTE0 = (unsigned char) 0;
- *PORTF0 = (unsigned char) 0;
-
- /* Port E and F Data Direction Register */
- /* see section 9 of the SIM Reference Manual */
- *DDRE = (unsigned char) 0xff;
- *DDRF = (unsigned char) 0xfd;
-
- /* Port E and F Pin Assignment Register */
- /* see section 9 of the SIM Reference Manual */
- *PEPAR = (unsigned char) 0;
- *PFPAR = (unsigned char) 0;
-
- /* end of SIM initalization code */
- /* end include in ram_init.S */
-
-
-
- /*
- * Initialize RAM by copying the .data section out of ROM (if
- * needed) and "zero-ing" the .bss section.
- */
- {
- register char *src = _endtext;
- register char *dst = _sdata;
-
- if (_copy_data_from_rom)
- /* ROM has data at end of text; copy it. */
- while (dst < _edata)
- *dst++ = *src++;
-
- /* Zero bss */
- for (dst = __bss_start; dst< _end; dst++)
- *dst = 0;
- }
-
- /*
- * Initalize the board.
- */
- Spurious_Initialize();
- console_init();
-
- /*
- * Execute main with arguments argv and environment env
- */
- /* main(1, __argv, __env); */
-
- boot_card();
-
- reboot();
-}
-
-void reboot() {asm("trap #15");}
-
diff --git a/c/src/lib/libbsp/m68k/efi332/start332/Makefile.in b/c/src/lib/libbsp/m68k/efi332/start332/Makefile.in
deleted file mode 100644
index 2373aeca0b..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/start332/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/start332.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=start332
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/m68k/efi332/start332/start332.c b/c/src/lib/libbsp/m68k/efi332/start332/start332.c
deleted file mode 100644
index 05f8d75ce9..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/start332/start332.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * $Id
- */
-
-#include <efi332.h>
-#include <sim.h>
-#define __START_C__
-#include "bsp.h"
-
-m68k_isr_entry M68Kvec[256];
-m68k_isr_entry vectors[256];
-char * const __argv[]= {"main", ""};
-char * const __env[]= {""};
-
-/*
- * This prototype really should have the noreturn attribute but
- * that causes a warning since it appears that the routine does
- * return.
- *
- * void dumby_start () __attribute__ ((noreturn));
- */
-
-void dumby_start ();
-void dumby_start() {
-void boot_card();
-
- /* We need to by-pass the link instruction since the RAM chip-
- select pins are not yet configured. */
- asm volatile ( ".global start ;
- start:");
-
- /* disable interrupts, load stack pointer */
- asm volatile ( "oriw #0x0700, %sr;
- moveal #M68Kvec, %a0;
- movec %a0, %vbr;
- movel #_end, %d0;
- addl " STACK_SIZE ",%d0;
- movel %d0,%sp;
- link %a6, #0"
- );
-
- /* include in ram_init.S */
- /*
- * Initalize the SIM module.
- * The stack pointer is not usable until the RAM chip select lines
- * are configured. The following code must remain inline.
- */
-
- /* Module Configuration Register */
- /* see section(s) 3.1.3-3.1.6 of the SIM Reference Manual */
- *SIMCR = (unsigned short int)
- (FRZSW | FRZBM | SAM(0,8,SHEN) | (MM*SIM_MM) | SAM(SIM_IARB,0,IARB));
-
- /* Synthesizer Control Register */
- /* see section(s) 4.8 */
- /* end include in ram_init.S */
- *SYNCR = (unsigned short int)
- ( SAM(EFI_W,15,W) | SAM(0x0,14,X) | SAM(EFI_Y,8,Y) | STSIM );
- while (! (*SYNCR & SLOCK)); /* protect from clock overshoot */
- /* include in ram_init.S */
- *SYNCR = (unsigned short int)
- ( SAM(EFI_W,15,W) | SAM(EFI_X,14,X) | SAM(EFI_Y,8,Y) | STSIM );
-
- /* System Protection Control Register */
- /* !!! can only write to once after reset !!! */
- /* see section 3.8.4 of the SIM Reference Manual */
- *SYPCR = (unsigned char)( SAM(0x3,4,SWT) | HME | BME );
-
- /* Periodic Interrupr Control Register */
- /* see section 3.8.2 of the SIM Reference Manual */
- *PICR = (unsigned short int)
- ( SAM(0,8,PIRQL) | SAM(EFI_PIV,0,PIV) );
- /* ^^^ zero disables interrupt, don't enable here or ram_init will
- be wrong. It's enabled below. */
-
- /* Periodic Interrupt Timer Register */
- /* see section 3.8.3 of the SIM Reference Manual */
- *PITR = (unsigned short int)( SAM(0x09,0,PITM) );
- /* 1.098mS interrupt */
-
- /* Port C Data */
- /* load values before enabled */
- *PORTC = (unsigned char) 0x0;
-
- /* Chip-Select Base Address Register */
- /* see section 7 of the SIM Reference Manual */
- *CSBARBT = (unsigned short int)
- (((0x000000 >> 8)&0xfff8) | BS_512K ); /* 512k bytes located at 0x0000 */
- *CSBAR0 = (unsigned short int)
- (((0x000000 >> 8)&0xfff8) | BS_1M ); /* 1M bytes located at 0x0000 */
- *CSBAR1 = (unsigned short int)
- (((0x080000 >> 8)&0xfff8) | BS_256K ); /* 256k bytes located at 0x80000 */
- *CSBAR2 = (unsigned short int)
- (((0x080000 >> 8)&0xfff8) | BS_256K ); /* 256 bytes located at 0x80000 */
- *CSBAR3 = (unsigned short int)
- (0xfff8 | BS_64K); /* AVEC interrupts */
- *CSBAR10 = (unsigned short int)
- (((0x000000 >> 8)&0xfff8) | BS_512K ); /* 512k bytes located at 0x0000 */
-
- /* Chip-Select Options Registers */
- /* see section 7 of the SIM Reference Manual */
- *CSORBT = (unsigned short int)
- ( BothBytes | ReadWrite | SyncAS | WaitStates_13 | UserSupSpace );
- *CSOR0 = (unsigned short int)
- ( BothBytes | ReadOnly | SyncAS | External | UserSupSpace );
- *CSOR1 = (unsigned short int)
- ( LowerByte | ReadWrite | SyncAS | FastTerm | UserSupSpace );
- *CSOR2 = (unsigned short int)
- ( UpperByte | ReadWrite | SyncAS | FastTerm | UserSupSpace );
- *CSOR3 = (unsigned short int)
- ( BothBytes | ReadWrite | SyncAS | CPUSpace | IPLevel_any | AVEC );
- *CSOR10 = (unsigned short int)
- ( BothBytes | ReadOnly | SyncAS | External | UserSupSpace );
-
- /* Chip Select Pin Assignment Register 0 */
- /* see section 7 of the SIM Reference Manual */
- *CSPAR0 = (unsigned short int)(
- SAM(DisOut,CS_5,0x3000) | /* PC2 */
- SAM(DisOut,CS_4,0x0c00) | /* PC1 */
- SAM(DisOut,CS_3,0x0300) | /* AVEC (internally) */
- SAM(CS16bit,CS_2,0x00c0)| /* RAM UDS */
- SAM(CS16bit,CS_1,0x0030)| /* RAM LDS */
- SAM(CS16bit,CS_0,0x000c)| /* W/!R */
- SAM(CS16bit,CSBOOT,0x0003) /* ROM DS */
- );
-
- /* Chip Select Pin Assignment Register 1 */
- /* see section 7 of the SIM Reference Manual */
- *CSPAR1 = (unsigned short int)(
- SAM(CS16bit,CS_10,0x300)| /* ECLK */
- SAM(DisOut,CS_9,0x0c0) | /* PC6 */
- SAM(DisOut,CS_8,0x030) | /* PC5 */
- SAM(DisOut,CS_7,0x00c) | /* PC4 */
- SAM(DisOut,CS_6,0x003) /* PC3 */
- );
-
- /* Port E and F Data Register */
- /* see section 9 of the SIM Reference Manual */
- *PORTE0 = (unsigned char) 0;
- *PORTF0 = (unsigned char) 0;
-
- /* Port E and F Data Direction Register */
- /* see section 9 of the SIM Reference Manual */
- *DDRE = (unsigned char) 0xff;
- *DDRF = (unsigned char) 0xfd;
-
- /* Port E and F Pin Assignment Register */
- /* see section 9 of the SIM Reference Manual */
- *PEPAR = (unsigned char) 0;
- *PFPAR = (unsigned char) 0;
-
- /* end of SIM initalization code */
- /* end include in ram_init.S */
-
-
-
- /*
- * Initialize RAM by copying the .data section out of ROM (if
- * needed) and "zero-ing" the .bss section.
- */
- {
- register char *src = _endtext;
- register char *dst = _sdata;
-
- if (_copy_data_from_rom)
- /* ROM has data at end of text; copy it. */
- while (dst < _edata)
- *dst++ = *src++;
-
- /* Zero bss */
- for (dst = __bss_start; dst< _end; dst++)
- *dst = 0;
- }
-
- /*
- * Initalize the board.
- */
- Spurious_Initialize();
- console_init();
-
- /*
- * Execute main with arguments argv and environment env
- */
- /* main(1, __argv, __env); */
-
- boot_card();
-
- reboot();
-}
-
-void reboot() {asm("trap #15");}
-
diff --git a/c/src/lib/libbsp/m68k/efi332/startup/Makefile.in b/c/src/lib/libbsp/m68k/efi332/startup/Makefile.in
deleted file mode 100644
index 6cacf17587..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/startup/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bsplibc bsppost bspstart bspclean main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-
diff --git a/c/src/lib/libbsp/m68k/efi332/startup/bspclean.c b/c/src/lib/libbsp/m68k/efi332/startup/bspclean.c
deleted file mode 100644
index 86d2499aa1..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/startup/bspclean.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine cleans up in the sense that it places the board
- * in a safe state and flushes the I/O buffers before exiting.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-void bsp_cleanup(void)
-{
- /* interrupt driven stdio must be flushed */
- _CPU_ISR_Set_level( 7 );
- _UART_flush();
-}
diff --git a/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c b/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c
deleted file mode 100644
index 533684193c..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
-/* extern int end; */
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) BSP_Configuration.work_space_start +
- (rtems_unsigned32) BSP_Configuration.work_space_size;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- if (heap_start > (rtems_unsigned32) RAM_END) {
- /* rtems_fatal_error_occurred can not be used before initalization */
- RAW_PUTS("\n\rRTEMS: Out of memory.\n\r");
- RAW_PUTS("RTEMS: Check RAM_END and the size of the work space.\n\r");
- }
-
- bsp_libc_init((void *) heap_start, (RAM_END - heap_start), 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- void *vbr;
-
- /*
- * we only use a hook to get the C library initialized.
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook;
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
-
- m68k_get_vbr( vbr );
- Cpu_table.interrupt_vector_table = vbr;
-
- BSP_Configuration.work_space_start = (void *)
- (((unsigned int)_end + STACK_SIZE + 0x100) & 0xffffff00);
-
- /* Clock_exit is done as an atexit() function */
-}
-
diff --git a/c/src/lib/libbsp/m68k/efi332/startup/except_vect_332_ROM.S b/c/src/lib/libbsp/m68k/efi332/startup/except_vect_332_ROM.S
deleted file mode 100644
index 0e5e11c085..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/startup/except_vect_332_ROM.S
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * $Id$
- */
-
-/* Exception Vector definitions follow */
-
- /* !!! Warning !!! This table is not tested, and
- the user must make sure it is complete. */
-
- /* If we use TRAP #15 for reboot, note that group 0 and 1 exceptions
- will have priority. */
-
- /* Vector 0: RESET: Initial SSP */
- .long __end_of_ram
- /* Vector 1: RESET: Initial PC */
- .long start
-
- /* default action for undefined vectors is to re-boot */
-
- /* Note group 0 and 1 exception (like trace) have priority
- over other exceptions (like trap #15) that may call this. */
-
- /* Vectors 2-255 */
- .long reboot /* exception vector: 2 */
- .long reboot /* exception vector: 3 */
- .long reboot /* exception vector: 4 */
- .long reboot /* exception vector: 5 */
- .long reboot /* exception vector: 6 */
- .long reboot /* exception vector: 7 */
- .long reboot /* exception vector: 8 */
- .long reboot /* exception vector: 9 */
- .long reboot /* exception vector: 10 */
- .long reboot /* exception vector: 11 */
- .long reboot /* exception vector: 12 */
- .long reboot /* exception vector: 13 */
- .long reboot /* exception vector: 14 */
- .long reboot /* exception vector: 15 */
- .long reboot /* exception vector: 16 */
- .long reboot /* exception vector: 17 */
- .long reboot /* exception vector: 18 */
- .long reboot /* exception vector: 19 */
- .long reboot /* exception vector: 20 */
- .long reboot /* exception vector: 21 */
- .long reboot /* exception vector: 22 */
- .long reboot /* exception vector: 23 */
- .long reboot /* exception vector: 24 */
- .long reboot /* exception vector: 25 */
- .long reboot /* exception vector: 26 */
- .long reboot /* exception vector: 27 */
- .long reboot /* exception vector: 28 */
- .long reboot /* exception vector: 29 */
- .long reboot /* exception vector: 30 */
- .long reboot /* exception vector: 31 */
- .long reboot /* exception vector: 32 */
- .long reboot /* exception vector: 33 */
- .long reboot /* exception vector: 34 */
- .long reboot /* exception vector: 35 */
- .long reboot /* exception vector: 36 */
- .long reboot /* exception vector: 37 */
- .long reboot /* exception vector: 38 */
- .long reboot /* exception vector: 39 */
- .long reboot /* exception vector: 40 */
- .long reboot /* exception vector: 41 */
- .long reboot /* exception vector: 42 */
- .long reboot /* exception vector: 43 */
- .long reboot /* exception vector: 44 */
- .long reboot /* exception vector: 45 */
- .long reboot /* exception vector: 46 */
- .long _reboot /* the reboot trap: 47 */
- .long reboot /* exception vector: 48 */
- .long reboot /* exception vector: 49 */
- .long reboot /* exception vector: 50 */
- .long reboot /* exception vector: 51 */
- .long reboot /* exception vector: 52 */
- .long reboot /* exception vector: 53 */
- .long reboot /* exception vector: 54 */
- .long reboot /* exception vector: 55 */
- .long reboot /* exception vector: 56 */
- .long reboot /* exception vector: 57 */
- .long reboot /* exception vector: 58 */
- .long reboot /* exception vector: 59 */
- .long reboot /* exception vector: 60 */
- .long reboot /* exception vector: 61 */
- .long reboot /* exception vector: 62 */
- .long reboot /* exception vector: 63 */
- .long reboot /* exception vector: 64 */
- .long reboot /* exception vector: 65 */
- .long reboot /* exception vector: 66 */
- .long reboot /* exception vector: 67 */
- .long reboot /* exception vector: 68 */
- .long reboot /* exception vector: 69 */
- .long reboot /* exception vector: 70 */
- .long reboot /* exception vector: 71 */
- .long reboot /* exception vector: 72 */
- .long reboot /* exception vector: 73 */
- .long reboot /* exception vector: 74 */
- .long reboot /* exception vector: 75 */
- .long reboot /* exception vector: 76 */
- .long reboot /* exception vector: 77 */
- .long reboot /* exception vector: 78 */
- .long reboot /* exception vector: 79 */
- .long reboot /* exception vector: 80 */
- .long reboot /* exception vector: 81 */
- .long reboot /* exception vector: 82 */
- .long reboot /* exception vector: 83 */
- .long reboot /* exception vector: 84 */
- .long reboot /* exception vector: 85 */
- .long reboot /* exception vector: 86 */
- .long reboot /* exception vector: 87 */
- .long reboot /* exception vector: 88 */
- .long reboot /* exception vector: 89 */
- .long reboot /* exception vector: 90 */
- .long reboot /* exception vector: 91 */
- .long reboot /* exception vector: 92 */
- .long reboot /* exception vector: 93 */
- .long reboot /* exception vector: 94 */
- .long reboot /* exception vector: 95 */
- .long reboot /* exception vector: 96 */
- .long reboot /* exception vector: 97 */
- .long reboot /* exception vector: 98 */
- .long reboot /* exception vector: 99 */
- .long reboot /* exception vector: 100 */
- .long reboot /* exception vector: 101 */
- .long reboot /* exception vector: 102 */
- .long reboot /* exception vector: 103 */
- .long reboot /* exception vector: 104 */
- .long reboot /* exception vector: 105 */
- .long reboot /* exception vector: 106 */
- .long reboot /* exception vector: 107 */
- .long reboot /* exception vector: 108 */
- .long reboot /* exception vector: 109 */
- .long reboot /* exception vector: 110 */
- .long reboot /* exception vector: 111 */
- .long reboot /* exception vector: 112 */
- .long reboot /* exception vector: 113 */
- .long reboot /* exception vector: 114 */
- .long reboot /* exception vector: 115 */
- .long reboot /* exception vector: 116 */
- .long reboot /* exception vector: 117 */
- .long reboot /* exception vector: 118 */
- .long reboot /* exception vector: 119 */
- .long reboot /* exception vector: 120 */
- .long reboot /* exception vector: 121 */
- .long reboot /* exception vector: 122 */
- .long reboot /* exception vector: 123 */
- .long reboot /* exception vector: 124 */
- .long reboot /* exception vector: 125 */
- .long reboot /* exception vector: 126 */
- .long reboot /* exception vector: 127 */
- .long reboot /* exception vector: 128 */
- .long reboot /* exception vector: 129 */
- .long reboot /* exception vector: 130 */
- .long reboot /* exception vector: 131 */
- .long reboot /* exception vector: 132 */
- .long reboot /* exception vector: 133 */
- .long reboot /* exception vector: 134 */
- .long reboot /* exception vector: 135 */
- .long reboot /* exception vector: 136 */
- .long reboot /* exception vector: 137 */
- .long reboot /* exception vector: 138 */
- .long reboot /* exception vector: 139 */
- .long reboot /* exception vector: 140 */
- .long reboot /* exception vector: 141 */
- .long reboot /* exception vector: 142 */
- .long reboot /* exception vector: 143 */
- .long reboot /* exception vector: 144 */
- .long reboot /* exception vector: 145 */
- .long reboot /* exception vector: 146 */
- .long reboot /* exception vector: 147 */
- .long reboot /* exception vector: 148 */
- .long reboot /* exception vector: 149 */
- .long reboot /* exception vector: 150 */
- .long reboot /* exception vector: 151 */
- .long reboot /* exception vector: 152 */
- .long reboot /* exception vector: 153 */
- .long reboot /* exception vector: 154 */
- .long reboot /* exception vector: 155 */
- .long reboot /* exception vector: 156 */
- .long reboot /* exception vector: 157 */
- .long reboot /* exception vector: 158 */
- .long reboot /* exception vector: 159 */
- .long reboot /* exception vector: 160 */
- .long reboot /* exception vector: 161 */
- .long reboot /* exception vector: 162 */
- .long reboot /* exception vector: 163 */
- .long reboot /* exception vector: 164 */
- .long reboot /* exception vector: 165 */
- .long reboot /* exception vector: 166 */
- .long reboot /* exception vector: 167 */
- .long reboot /* exception vector: 168 */
- .long reboot /* exception vector: 169 */
- .long reboot /* exception vector: 170 */
- .long reboot /* exception vector: 171 */
- .long reboot /* exception vector: 172 */
- .long reboot /* exception vector: 173 */
- .long reboot /* exception vector: 174 */
- .long reboot /* exception vector: 175 */
- .long reboot /* exception vector: 176 */
- .long reboot /* exception vector: 177 */
- .long reboot /* exception vector: 178 */
- .long reboot /* exception vector: 179 */
- .long reboot /* exception vector: 180 */
- .long reboot /* exception vector: 181 */
- .long reboot /* exception vector: 182 */
- .long reboot /* exception vector: 183 */
- .long reboot /* exception vector: 184 */
- .long reboot /* exception vector: 185 */
- .long reboot /* exception vector: 186 */
- .long reboot /* exception vector: 187 */
- .long reboot /* exception vector: 188 */
- .long reboot /* exception vector: 189 */
- .long reboot /* exception vector: 190 */
- .long reboot /* exception vector: 191 */
- .long reboot /* exception vector: 192 */
- .long reboot /* exception vector: 193 */
- .long reboot /* exception vector: 194 */
- .long reboot /* exception vector: 195 */
- .long reboot /* exception vector: 196 */
- .long reboot /* exception vector: 197 */
- .long reboot /* exception vector: 198 */
- .long reboot /* exception vector: 199 */
- .long reboot /* exception vector: 200 */
- .long reboot /* exception vector: 201 */
- .long reboot /* exception vector: 202 */
- .long reboot /* exception vector: 203 */
- .long reboot /* exception vector: 204 */
- .long reboot /* exception vector: 205 */
- .long reboot /* exception vector: 206 */
- .long reboot /* exception vector: 207 */
- .long reboot /* exception vector: 208 */
- .long reboot /* exception vector: 209 */
- .long reboot /* exception vector: 210 */
- .long reboot /* exception vector: 211 */
- .long reboot /* exception vector: 212 */
- .long reboot /* exception vector: 213 */
- .long reboot /* exception vector: 214 */
- .long reboot /* exception vector: 215 */
- .long reboot /* exception vector: 216 */
- .long reboot /* exception vector: 217 */
- .long reboot /* exception vector: 218 */
- .long reboot /* exception vector: 219 */
- .long reboot /* exception vector: 220 */
- .long reboot /* exception vector: 221 */
- .long reboot /* exception vector: 222 */
- .long reboot /* exception vector: 223 */
- .long reboot /* exception vector: 224 */
- .long reboot /* exception vector: 225 */
- .long reboot /* exception vector: 226 */
- .long reboot /* exception vector: 227 */
- .long reboot /* exception vector: 228 */
- .long reboot /* exception vector: 229 */
- .long reboot /* exception vector: 230 */
- .long reboot /* exception vector: 231 */
- .long reboot /* exception vector: 232 */
- .long reboot /* exception vector: 233 */
- .long reboot /* exception vector: 234 */
- .long reboot /* exception vector: 235 */
- .long reboot /* exception vector: 236 */
- .long reboot /* exception vector: 237 */
- .long reboot /* exception vector: 238 */
- .long reboot /* exception vector: 239 */
- .long reboot /* exception vector: 240 */
- .long reboot /* exception vector: 241 */
- .long reboot /* exception vector: 242 */
- .long reboot /* exception vector: 243 */
- .long reboot /* exception vector: 244 */
- .long reboot /* exception vector: 245 */
- .long reboot /* exception vector: 246 */
- .long reboot /* exception vector: 247 */
- .long reboot /* exception vector: 248 */
- .long reboot /* exception vector: 249 */
- .long reboot /* exception vector: 250 */
- .long reboot /* exception vector: 251 */
- .long reboot /* exception vector: 252 */
- .long reboot /* exception vector: 253 */
- .long reboot /* exception vector: 254 */
- .long reboot /* exception vector: 255 */
-
-
-_reboot:
- move #0x2700,%sr /* mask interrupts */
- movea.l (0x0).w,%a7 /* load stack */
- movea.l (0x4).w,%a0 /* jmp to location of reset vector */
- jmp (%a0)
-
-reboot:
- trap #15 /* use trap exception to enter supervisor
- state. Trace mode ( and other group 0
- and 1 exceptions) *could* screw this up if
- not vectored to reboot or did not return. */
diff --git a/c/src/lib/libbsp/m68k/efi332/startup/linkcmds b/c/src/lib/libbsp/m68k/efi332/startup/linkcmds
deleted file mode 100644
index 90a27cb2fe..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/startup/linkcmds
+++ /dev/null
@@ -1,105 +0,0 @@
-/* linkcmds
- *
- * $Id$
- */
-
-OUTPUT_ARCH(m68k)
-__DYNAMIC = 0;
-
-/*
- * The memory map looks like this:
- * +--------------------+ <- low memory
- * | .text |
- * | etext |
- * | ctor list | the ctor and dtor lists are for
- * | dtor list | C++ support
- * | _endtext |
- * +--------------------+
- * | .data | initialized data goes here
- * | _sdata |
- * | _edata |
- * +--------------------+
- * | .bss |
- * | __bss_start | start of bss, cleared by crt0
- * | _end | start of heap, used by sbrk()
- * +--------------------+
- * | heap space |
- * | _ENDHEAP |
- * | stack space |
- * | __stack | top of stack
- * +--------------------+ <- high memory
- */
-
-MEMORY
-{
- ram : ORIGIN = 0x80000, LENGTH = 256K
-}
-
-__end_of_ram = 0xc0000;
-_copy_data_from_rom = 0;
-
-/*
- * stick everything in ram (of course)
- */
-SECTIONS
-{
- .text :
- {
- CREATE_OBJECT_SYMBOLS
- text_start = .;
- _text_start = .;
- *(.text)
- . = ALIGN (16);
- *(.eh_fram)
- . = ALIGN (16);
-
- etext = ALIGN(0x10);
- _etext = .;
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- *(.lit)
- *(.shdata)
- _endtext = .;
- } > ram
- .data :
- {
- data_start = .;
- _data_start = .;
- _sdata = . ;
- *(.data)
- CONSTRUCTORS
- edata = ALIGN(0x10);
- _edata = .;
- } > ram
- .shbss :
- {
- *(.shbss)
- } > ram
- .bss :
- {
- __bss_start = ALIGN(0x8);
- bss_start = .;
- _bss_start = .;
- *(.bss)
- *(COMMON)
- end = .;
- _end = ALIGN(0x8);
- __end = ALIGN(0x8);
- } > ram
- .stab . (NOLOAD) :
- {
- [ .stab ]
- }
- .stabstr . (NOLOAD) :
- {
- [ .stabstr ]
- }
-}
diff --git a/c/src/lib/libbsp/m68k/efi332/startup/linkcmds_ROM b/c/src/lib/libbsp/m68k/efi332/startup/linkcmds_ROM
deleted file mode 100644
index d11708772e..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/startup/linkcmds_ROM
+++ /dev/null
@@ -1,110 +0,0 @@
-/* linkcmds
- *
- * $Id$
- */
-
-OUTPUT_ARCH(m68k)
-STARTUP(except_vect_332_ROM.o)
-__DYNAMIC = 0;
-
-/*
- * ROM:
- * +--------------------+ <- low memory
- * | .text |
- * | etext |
- * | ctor list | the ctor and dtor lists are for
- * | dtor list | C++ support
- * | _endtext |
- * | temporary .data | .data is moved to RAM by crt0
- * | |
- * +--------------------+ <- high memory
- *
- *
- * RAM:
- * +--------------------+ <- low memory
- * | .data | initialized data goes here
- * | _sdata |
- * | _edata |
- * +--------------------+
- * | .bss |
- * | __bss_start | start of bss, cleared by crt0
- * | _end | start of heap, used by sbrk()
- * +--------------------+
- * | heap space |
- * | _ENDHEAP |
- * | stack space |
- * | __stack | top of stack
- * +--------------------+ <- high memory
- */
-
-MEMORY
-{
- rom : ORIGIN = 0x00000, LENGTH = 256K
- ram : ORIGIN = 0x80000, LENGTH = 256K
-}
-
-__end_of_ram = 0xc0000;
-_copy_data_from_rom = 1;
-
-/*
- *
- */
-SECTIONS
-{
- .text :
- {
- CREATE_OBJECT_SYMBOLS
- text_start = .;
- _text_start = .;
- *(.text)
- etext = ALIGN(0x10);
- _etext = .;
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- *(.lit)
- *(.shdata)
- _endtext = .;
- } > rom
- .data :
- AT ( ADDR(.text) + SIZEOF( .text ) )
- {
- data_start = .;
- _data_start = .;
- _sdata = . ;
- *(.data)
- CONSTRUCTORS
- edata = ALIGN(0x10);
- _edata = .;
- } > ram
- .shbss :
- {
- *(.shbss)
- } > ram
- .bss :
- {
- __bss_start = ALIGN(0x8);
- bss_start = .;
- _bss_start = .;
- *(.bss)
- *(COMMON)
- end = .;
- _end = ALIGN(0x8);
- __end = ALIGN(0x8);
- } > ram
- .stab . (NOLOAD) :
- {
- [ .stab ]
- }
- .stabstr . (NOLOAD) :
- {
- [ .stabstr ]
- }
-}
diff --git a/c/src/lib/libbsp/m68k/efi332/timer/Makefile.in b/c/src/lib/libbsp/m68k/efi332/timer/Makefile.in
deleted file mode 100644
index d9e6e84a0c..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/timer/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/efi332/timer/timer.c b/c/src/lib/libbsp/m68k/efi332/timer/timer.c
deleted file mode 100644
index ba00db48f9..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/timer/timer.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Timer_init()
- *
- * This routine initializes a timer in efi68k's DP8570A TCP
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <bsp.h>
-
-rtems_boolean Timer_driver_Find_average_overhead;
-
-extern rtems_isr Clock_isr();
-
-void Timer_initialize( void )
-{
-}
-
-/*
- * The following controls the behavior of Read_timer().
- *
- * FIND_AVG_OVERHEAD * instructs the routine to return the "raw" count.
- *
- * AVG_OVEREHAD is the overhead for starting and stopping the timer. It
- * is usually deducted from the number returned.
- *
- * LEAST_VALID is the lowest number this routine should trust. Numbers
- * below this are "noise" and zero is returned.
- */
-
-#define AVG_OVERHEAD 0 /* It typically takes X.X microseconds */
- /* (Y countdowns) to start/stop the timer. */
- /* This value is in microseconds. */
-#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-
-/*
- * Return timer value in 1/2-microsecond units
- */
-int Read_timer( void )
-{
- rtems_unsigned32 total;
- total = 0;
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in XXX microsecond units */
-
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
-
- return (total - AVG_OVERHEAD);
-}
-
-
-/*
- * Empty function call used in loops to measure basic cost of looping
- * in Timing Test Suite.
- */
-
-rtems_status_code Empty_function(void)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/m68k/efi332/times b/c/src/lib/libbsp/m68k/efi332/times
deleted file mode 100644
index 17ac20f2cf..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/times
+++ /dev/null
@@ -1,193 +0,0 @@
-#
-# Timing Test Suite Results for the EFI332 BSP
-#
-# $Id$
-#
-
-NOTE: This BSP is used submitted and no information is currently available.
-
-Board: EFI332
-CPU: 68332
-Clock Speed: 20 Mhz
-Memory Configuration: SRAM, DRAM, cache, etc
-Wait States:
-
-Times Reported in: cycles, microseconds, etc
-Timer Source: Count Down Timer, on-CPU cycle counter, etc
-
-Column A: unused
-Column B: unused
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 20
- rtems_semaphore_delete 21
- rtems_semaphore_obtain: available 15
- rtems_semaphore_obtain: not available -- NO_WAIT 15
- rtems_semaphore_release: no waiting tasks 16
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 62
-
- 3 rtems_semaphore_release: task readied -- preempts caller 55
-
- 4 rtems_task_restart: blocked task -- preempts caller 77
- rtems_task_restart: ready task -- preempts caller 70
- rtems_semaphore_release: task readied -- returns to caller 25
- rtems_task_create 57
- rtems_task_start 31
- rtems_task_restart: suspended task -- returns to caller 36
- rtems_task_delete: suspended task 47
- rtems_task_restart: ready task -- returns to caller 37
- rtems_task_restart: blocked task -- returns to caller 46
- rtems_task_delete: blocked task 50
-
- 5 rtems_task_suspend: calling task 51
- rtems_task_resume: task readied -- preempts caller 49
-
- 6 rtems_task_restart: calling task 59
- rtems_task_suspend: returns to caller 18
- rtems_task_resume: task readied -- returns to caller 19
- rtems_task_delete: ready task 50
-
- 7 rtems_task_restart: suspended task -- preempts caller 70
-
- 8 rtems_task_set_priority: obtain current priority 12
- rtems_task_set_priority: returns to caller 27
- rtems_task_mode: obtain current mode 5
- rtems_task_mode: no reschedule 5
- rtems_task_mode: reschedule -- returns to caller 8
- rtems_task_mode: reschedule -- preempts caller 39
- rtems_task_set_note 13
- rtems_task_get_note 13
- rtems_clock_set 33
- rtems_clock_get 3
-
- 9 rtems_message_queue_create 110
- rtems_message_queue_send: no waiting tasks 37
- rtems_message_queue_urgent: no waiting tasks 37
- rtems_message_queue_receive: available 31
- rtems_message_queue_flush: no messages flushed 12
- rtems_message_queue_flush: messages flushed 16
- rtems_message_queue_delete 26
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 15
- rtems_message_queue_receive: not available -- caller blocks 62
-
-11 rtems_message_queue_send: task readied -- preempts caller 72
-
-12 rtems_message_queue_send: task readied -- returns to caller 39
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 72
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 39
-
-15 rtems_event_receive: obtain current events 1
- rtems_event_receive: not available -- NO_WAIT 12
- rtems_event_receive: not available -- caller blocks 56
- rtems_event_send: no task readied 12
- rtems_event_receive: available 12
- rtems_event_send: task readied -- returns to caller 24
-
-16 rtems_event_send: task readied -- preempts caller 55
-
-17 rtems_task_set_priority: preempts caller 62
-
-18 rtems_task_delete: calling task 83
-
-19 rtems_signal_catch 9
- rtems_signal_send: returns to caller 15
- rtems_signal_send: signal to self 18
- exit ASR overhead: returns to calling task 22
- exit ASR overhead: returns to preempting task 49
-
-20 rtems_partition_create 35
- rtems_region_create 23
- rtems_partition_get_buffer: available 15
- rtems_partition_get_buffer: not available 13
- rtems_partition_return_buffer 18
- rtems_partition_delete 16
- rtems_region_get_segment: available 22
- rtems_region_get_segment: not available -- NO_WAIT 21
- rtems_region_return_segment: no waiting tasks 19
- rtems_region_get_segment: not available -- caller blocks 64
- rtems_region_return_segment: task readied -- preempts caller 74
- rtems_region_return_segment: task readied -- returns to caller 44
- rtems_region_delete 16
- rtems_io_initialize 2
- rtems_io_open 1
- rtems_io_close 1
- rtems_io_read 1
- rtems_io_write 1
- rtems_io_control 1
-
-21 rtems_task_ident 149
- rtems_message_queue_ident 145
- rtems_semaphore_ident 156
- rtems_partition_ident 145
- rtems_region_ident 148
- rtems_port_ident 145
- rtems_timer_ident 145
- rtems_rate_monotonic_ident 145
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 42
- rtems_message_queue_broadcast: no waiting tasks 17
- rtems_message_queue_broadcast: task readied -- preempts caller 78
-
-23 rtems_timer_create 14
- rtems_timer_fire_after: inactive 22
- rtems_timer_fire_after: active 24
- rtems_timer_cancel: active 15
- rtems_timer_cancel: inactive 13
- rtems_timer_reset: inactive 21
- rtems_timer_reset: active 23
- rtems_timer_fire_when: inactive 34
- rtems_timer_fire_when: active 34
- rtems_timer_delete: active 19
- rtems_timer_delete: inactive 17
- rtems_task_wake_when 69
-
-24 rtems_task_wake_after: yield -- returns to caller 9
- rtems_task_wake_after: yields -- preempts caller 45
-
-25 rtems_clock_tick 4
-
-26 _ISR_Disable 0
- _ISR_Flash 1
- _ISR_Enable 1
- _Thread_Disable_dispatch 0
- _Thread_Enable_dispatch 7
- _Thread_Set_state 11
- _Thread_Disptach (NO FP) 31
- context switch: no floating point contexts 21
- context switch: self 10
- context switch: to another task 10
- context switch: restore 1st FP task 25
- fp context switch: save idle, restore idle 31
- fp context switch: save idle, restore initialized 19
- fp context switch: save initialized, restore initialized 20
- _Thread_Resume 7
- _Thread_Unblock 7
- _Thread_Ready 9
- _Thread_Get 4
- _Semaphore_Get 2
- _Thread_Get: invalid id 0
-
-27 interrupt entry overhead: returns to interrupted task 6
- interrupt exit overhead: returns to interrupted task 6
- interrupt entry overhead: returns to nested interrupt 6
- interrupt exit overhead: returns to nested interrupt 5
- interrupt entry overhead: returns to preempting task 7
- interrupt exit overhead: returns to preempting task 36
-
-28 rtems_port_create 16
- rtems_port_external_to_internal 11
- rtems_port_internal_to_external 11
- rtems_port_delete 16
-
-29 rtems_rate_monotonic_create 15
- rtems_rate_monotonic_period: initiate period -- returns to caller 21
- rtems_rate_monotonic_period: obtain status 13
- rtems_rate_monotonic_cancel 16
- rtems_rate_monotonic_delete: inactive 18
- rtems_rate_monotonic_delete: active 20
- rtems_rate_monotonic_period: conclude periods -- caller blocks 53
diff --git a/c/src/lib/libbsp/m68k/efi332/wrapup/Makefile.in b/c/src/lib/libbsp/m68k/efi332/wrapup/Makefile.in
deleted file mode 100644
index 3ef5e9d4bb..0000000000
--- a/c/src/lib/libbsp/m68k/efi332/wrapup/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console spurious timer
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/m68k/efi68k/Makefile.in b/c/src/lib/libbsp/m68k/efi68k/Makefile.in
deleted file mode 100644
index e283e32211..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include start68k startup clock console spurious timer wrapup
diff --git a/c/src/lib/libbsp/m68k/efi68k/README b/c/src/lib/libbsp/m68k/efi68k/README
deleted file mode 100644
index a4cc364c04..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/README
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# $Id$
-#
-
-Description: efi68k
-============
-CPU: MC68HC000 @16MHz
-RAM: 256k
-ROM: 256k
-
- Based upon a 16MHz 68HC000, efi332 is a minimally configured 4x6
-inch single board computer. It includes the following major
-components: (a) 256k SRAM (km681000l), (b) 256 EPROM (27C010),
-(c) DP8570A (clock/timer/calendar), (d) MAX791 (cpu supervisory chip
-with battery backup switch-over and watch dog timer), and
-(e) NS16550DN (UART). The following interrupt functions have also been
-incorporated: UART, TIMER, Watch Dog, and Low Line voltage (trips at
-4.85V; enough time to save the cpu reg before reset is asserted on
-power down).
- The schematic for efi68k is freely available via e-mail. Send
-"index diy_efi" to majordomo@coulomb.eng.ohio-state.edu. Retrieve the
-files related to 68hc000-1.00 with the "get diy_efi <filename>"
-command. efi68k does not have an available printed circuit board, but
-can be wire-wrapped in about four days. Cost is about $100US.
-
-TODO:
-=====
-- add the "tm27 vector" ... can we use a trap instruction?
-- generate include/coverhd.c to perform the tmtest.
-- the interrupt drive I/O should be integrated into the RTEMS.
-- finish the ROM memory model.
-- add separate interrupt stack (low priority).
-
- John S Gwynne
- Gwynne.1@osu.edu
-_______________________________________________________________________________
- T h e O h i o - S t a t e U n i v e r s i t y
- ElectroScience Laboratory, 1320 Kinnear Road, Columbus, Ohio 43212, USA
- Telephone: (614) 292-7981 * Fax: (614) 292-7297
--------------------------------------------------------------------------------
-
diff --git a/c/src/lib/libbsp/m68k/efi68k/bsp_specs b/c/src/lib/libbsp/m68k/efi68k/bsp_specs
deleted file mode 100644
index 2e248c6d82..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start68k.o%s} \
-%{qrtems_debug: start68k_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/m68k/efi68k/clock/Makefile.in b/c/src/lib/libbsp/m68k/efi68k/clock/Makefile.in
deleted file mode 100644
index 59df4f2702..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/clock/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/efi68k/clock/ckinit.c b/c/src/lib/libbsp/m68k/efi68k/clock/ckinit.c
deleted file mode 100644
index ad9fb97bf5..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/clock/ckinit.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/* Clock_init()
- *
- * This routine initializes the DP8570A periodic interrupt on the
- * efi68k board. The tick frequency is 1 millisecond.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#define CLOCK_VECTOR (TCP_ISR_LEVEL+24)
-
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-volatile rtems_unsigned32 Clock_driver_ticks;
- /* ticks since initialization */
-rtems_isr_entry Old_ticker;
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-
-void per_interrupt(void)
-{
- Clock_driver_ticks += 1;
-
- *MSR = PER;
-
- if ( Clock_isrs == 1 ) {
- rtems_clock_tick();
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
- }
- else
- Clock_isrs -= 1;
-}
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
- unsigned char entry_msr, msr;
-
- entry_msr = *MSR;
- *MSR = 0;
- while ( (msr=*MSR) & INT )
- /* test enabled interrupt bits */
- if (msr & PER)
- per_interrupt();
- else if (msr & T0) {
- *MSR = T0; /* reset interrupt */
- Timer_interrupts++; /* inc wrap around counter */
- }
- else
- /* there has been an error if we reach this point */
- /* default action: reset all the interrupts */
- *MSR = ( PER | AL | T0 | T1 );
- *MSR = entry_msr & (RS | PS);
-}
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
- Clock_driver_ticks = 0;
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
-
- *MSR = RS; /* enable 1mS interrupts */
- *ICR0 |= OME;
-
- atexit( Clock_exit );
- }
-}
-
-void Clock_exit( void )
-{
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
-
- /* shutdown periodic interrupt */
- *MSR = RS;
- *ICR0 &= 0xc0;
- /* do not restore old vector */
-
- }
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/m68k/efi68k/console/Makefile.in b/c/src/lib/libbsp/m68k/efi68k/console/Makefile.in
deleted file mode 100644
index fd05ddfedd..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/efi68k/console/console.c b/c/src/lib/libbsp/m68k/efi68k/console/console.c
deleted file mode 100644
index f89858e569..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/console/console.c
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * This file contains the efi68k console IO package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-#include <bsp.h>
-#include <rtems/libio.h>
-
-
-#define BAUD 38400
-#define CLK_FREQ 8000000.0
-
-/* BUFFER_LENGTH must be 2^n for n=1, 2, 3, .... */
-#define BUFFER_LENGTH 256
-#define RTS_STOP_SIZE BUFFER_LENGTH-64
-#define RTS_START_SIZE 16
-
-char xmt_buf[BUFFER_LENGTH];
-char rcv_buf[BUFFER_LENGTH];
-/* in: last entry into the buffer; always on a valid character */
-/* out: points to the next character to be pull from the buffer */
-/* in+1=out => buffer empty */
-/* in+2=out => buffer full */
-struct UART_buf {
- char *offset;
- char *in;
- char *out;
-};
-static volatile struct UART_buf xmt = { xmt_buf, (char *)0, (char *)1};
-static volatile struct UART_buf rcv = { rcv_buf, (char *)0, (char *)1};
-static volatile char _debug_flag = 0;
-static volatile char _tx_stop = 0;
-
-/* _catchUARTint is the interrupt front-end */
-extern void _catchUARTint();
-asm(" .text
- .align 2
- .globl _catchUARTint
-_catchUARTint:
- lea %sp@(4),%sp /* pop return address */
- moveml %d0-%d7/%a0-%a6,%sp@- /* save registers */
- jbsr uart_interrupt
- moveml %sp@+,%d0-%d7/%a0-%a6
- rte
- ");
-
-/* _fake_trap_1 will continue the UART interrupt (%sr *still*
- UART_ISR_LEVEL) as a trap #1 to enter the debugger */
-asm(" .text
- .align 2
-_fake_trap_1:
- unlk %a6 /* clear interrupt frame */
- lea %sp@(4),%sp /* remove jbsr instruction */
- moveml %sp@+,%d0-%d7/%a0-%a6 /* pop registers */
- jmp (33*6-12+_VBR) /* jump exception 1 */
- ");
-
-/* dispatch UART interrupt */
-void xmit_interrupt(void);
-void rcvr_interrupt(void);
-void modem_status(void);
-void _fake_trap_1(void);
-void uart_interrupt(void) {
- register char a;
-
- a=*IIR & (NIP | IID_MASK); /* read interrupt id register */
- switch (a) {
- case 0x04: case 0x0c:
- rcvr_interrupt();
- break;
- case 0x02:
- xmit_interrupt();
- break;
- case 0x00:
- modem_status();
- break;
- default:
- break;
- }
- if (_debug_flag) {
- _debug_flag = 0; /* reset the flag */
- _fake_trap_1(); /* fake a trap #1 */
- }
-}
-
-/* transfer received character to the buffer */
-void rcvr_interrupt(void) {
- register char *a, c;
- register int length;
-
- while ( (*LSR & DR) != 0) {
- if ((c=*RBR) == 0x1a) /* use ctl-z to reboot */
- reboot();
- else if (c == 0x03) { /* use ctl-c to enter debugger */
- _debug_flag = 1;
- continue;
- }
- *(char *)((int)rcv.offset +(int)
- (a=(char *)(((int)rcv.in+1) & ((int)BUFFER_LENGTH-1)))) = c;
- if ((char *)(((int)rcv.in+2) & ((int)BUFFER_LENGTH-1)) != rcv.out)
- rcv.in=a;
- }
- length = (BUFFER_LENGTH -1) & (
- ( ((int)rcv.out <= (int)rcv.in) ? 0 : BUFFER_LENGTH) - (int)rcv.out
- + (int)rcv.in + 1);
- if (length >= RTS_STOP_SIZE)
- *MCR &= (char) (~RTS);
-}
-
-/* tranfer buffered characters to the UART */
-void xmit_interrupt(void) {
- register short int i, oldsr;
-
- _CPU_ISR_Disable( oldsr ); /* for when outbyte calls */
- if ( (*LSR & THRE) != 0 && _tx_stop == 0 )
- for (i=0;i<16;i++) {
- if ((char *)(((int)xmt.in+1) & ((int)BUFFER_LENGTH-1))== xmt.out)
- break;
- *THR=*(char *)((int)xmt.offset+(int)xmt.out);
- xmt.out= (char *)(((int)xmt.out+1) & ((int)BUFFER_LENGTH-1));
- }
- _CPU_ISR_Enable( oldsr );
-}
-
-void modem_status(void) {
- register char a;
-
- if ( ((a=*MDSR) & DCTS) != 0 )
- if ( (a & CTS) == 0)
- _tx_stop = 1;
- else {
- _tx_stop = 0;
- xmit_interrupt();
- }
-}
-
-/* transfer character from the buffer */
-char inbyte(void) {
- register char a;
- register int length;
-
- while ((char *)(((int)rcv.in+1) & ((int)BUFFER_LENGTH-1))== rcv.out);
- a=*(char *)((int)rcv.offset+(int)rcv.out);
- rcv.out= (char *)(((int)rcv.out+1) & ((int)BUFFER_LENGTH-1));
- length = (BUFFER_LENGTH -1) & (
- ( ((int)rcv.out <= (int)rcv.in) ? 0 : BUFFER_LENGTH) - (int)rcv.out
- + (int)rcv.in + 1);
- if (length < RTS_START_SIZE)
- *MCR |= (char) RTS;
- return (a);
-}
-
-/* once room is avaliable in the buffer, transfer
- the character into the buffer and enable
- the xmtr interrupt */
-void outbyte(char c) {
- register char *a;
-
- while ((char *)(((int)xmt.in+2) & ((int)BUFFER_LENGTH-1)) == xmt.out);
- *(char *)((int)xmt.offset+(int)
- (a=(char *)(((int)xmt.in+1) & ((int)BUFFER_LENGTH-1))))=c;
- xmt.in=a;
-
- if ( (*LSR & THRE) != 0 ) /* if THRE, uart has already interrupted */
- xmit_interrupt(); /* and was ignored. Need to restart. */
-}
-
-void _UART_flush(void) {
- /* loop till xmt buffer empty. Works with interrupts disabled */
- while ((char *)(((int)xmt.in+1) & ((int)BUFFER_LENGTH-1)) != xmt.out)
- xmit_interrupt();
- /* loop till UART buffer empty */
- while ( (*LSR & TEMT) == 0 );
-}
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-void console_init()
-{
- /* set clock divisor */
- *LCR = (char)(DLAB);
- *DLL = (char)((int)(CLK_FREQ/BAUD/16.0+0.5) & 0xFF);
- *DLM = (char)(((int)(CLK_FREQ/BAUD/16.0+0.5) & 0xFF00) >> 8);
-
- /* Line control setup */
- *LCR = (char)(WL_8 | NSB);
-
- /* Interrupt setup */
- *IER = (char) 0x0b; /* enable transmit, receive, modem stat int */
-
- /* FIFO setup */
- *FCR = (char)(FIFO_E | 0xc0);
-
- /* Modem control setup */
- *MCR = (char) RTS;
-
- /* init tx_stop with CTS */
- _tx_stop = ( (*MDSR & CTS) ? 0 : 1);
-
- set_vector(_catchUARTint, UART_ISR_LEVEL+24, 0);
-}
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-
-}
-
-
-/* is_character_ready
- *
- * This routine returns TRUE if a character is available.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_boolean is_character_ready(
- char *ch
-)
-{
- if ((char *)(((int)rcv.in+1) & ((int)BUFFER_LENGTH-1))== rcv.out)
- return(FALSE);
- else
- return(TRUE);
-}
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte();
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r');
- }
- outbyte( buffer[ count ] );
- }
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/m68k/efi68k/include/16550.h b/c/src/lib/libbsp/m68k/efi68k/include/16550.h
deleted file mode 100644
index 5239ff11b4..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/include/16550.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- *-------------------------------------------------------------------
- *
- * 16550 -- header file for National Semiconducor's 16550 UART
- *
- * This file has been created by John S. Gwynne for the efi68k
- * project.
- *
- * 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$
- */
-
-#ifndef _16550_H_
-#define _16550_H_
-
-/* base address is the physical location of register 0 */
-#define UART_BASE_ADDRESS 0x0400001
-
-/* definitions of register addresses and associate bits */
-
-#define RBR (volatile unsigned char * const)(0*2+UART_BASE_ADDRESS)
- /* Receiver Buffer Register (w/DLAB=0)*/
- /* 8-bit data */
-
-#define THR (volatile unsigned char * const)(0*2+UART_BASE_ADDRESS)
- /* Transmitter Holding Register (w/DLAB=0) */
- /* 8-bit data */
-
-#define DLL (volatile unsigned char * const)(0*2+UART_BASE_ADDRESS)
- /* Divisor Latch (LS) (w/DLAB=1) */
- /* LSB of Divisor */
-
-#define DLM (volatile unsigned char * const)(1*2+UART_BASE_ADDRESS)
- /* Divisor Latch (MS) (w/DLAB=1) */
- /* MSB of Divisor */
-
-#define IER (volatile unsigned char * const)(1*2+UART_BASE_ADDRESS)
- /* Interrupt Enable Register (w/DLAB=0) */
-#define ERBFI 0x01 /* Enable Recv Data Available Interrupt */
-#define ETBEI 0x02 /* Enable Trans Holding Reg Empty Inter */
-#define ELSI 0x04 /* Enable Recv Line Status Interrupt */
-#define EDSSI 0x08 /* Enable Modem Status Interrupt */
-
-#define IIR (volatile unsigned char * const)(2*2+UART_BASE_ADDRESS)
- /* Interrupt Ident Register (read only) */
-#define NIP 0x01 /* No Interrupt Pending */
-#define IID_MASK 0x0e /* Interrupt ID mask */
-#define FE_MASK 0xc0 /* FIFO's Enabled */
-
-#define FCR (volatile unsigned char * const)(2*2+UART_BASE_ADDRESS)
- /* FIFO Control Register (write only) */
-#define FIFO_E 0x01 /* FIFO Enable */
-#define RFR 0x02 /* RCVR FIFO Reset */
-#define XFR 0x04 /* XMIT FIFO Reset */
-#define DMAMS 0x08 /* DMA Mode Select */
-#define RCVRTG_MASK 0xC0 /* RCVR Triger MSBit/LSBit */
-
-#define LCR (volatile unsigned char * const)(3*2+UART_BASE_ADDRESS)
- /* Line Control Register */
-#define WLS_MASK 0x03 /* Word Legth Select Mask */
-#define WL_5 0x00 /* 5 bits */
-#define WL_6 0x01 /* 6 bits */
-#define WL_7 0x02 /* 7 bits */
-#define WL_8 0x03 /* 8 bits */
-#define NSB 0x04 /* Number of Stop Bits (set is 2/1.5) */
-#define PEN 0x08 /* Parity Enable */
-#define EPS 0x10 /* Even Parity Select */
-#define STP 0x20 /* Stick Parity */
-#define SETBK 0x40 /* Set Break */
-#define DLAB 0x80 /* Divisor Latch Access Bit */
-
-#define MCR (volatile unsigned char * const)(4*2+UART_BASE_ADDRESS)
- /* Modem Control Register */
-#define DTR 0x01 /* Data Terminal Ready */
-#define RTS 0x02 /* Request to Send */
-#define OUT1 0x04 /* Out 1 */
-#define OUT2 0x08 /* Out 2 */
-#define LOOP 0x10 /* Loop */
-
-#define LSR (volatile unsigned char * const)(5*2+UART_BASE_ADDRESS)
- /* Line Status Register */
-#define DR 0x01 /* Data Ready */
-#define OE 0x02 /* Overrun error */
-#define PE 0x04 /* Parity error */
-#define FE 0x08 /* Framing error */
-#define BI 0x10 /* Break Interrupt */
-#define THRE 0x20 /* Transmitter Holding Register */
-#define TEMT 0x40 /* Transmitter Empty */
-#define RCVFIE 0x80 /* Recv FIFO Error */
-
-#define MDSR (volatile unsigned char * const)(6*2+UART_BASE_ADDRESS)
- /* Modem Status Register */
-#define DCTS 0x01 /* Delta Clear to Send */
-#define DDSR 0x02 /* Delta Data Set Ready */
-#define TERI 0x04 /* Trailing Edge Ring Indicator */
-#define DDCD 0x08 /* Delta Data Carrier Detect */
-#define CTS 0x10 /* Clear to Send */
-#define DSR 0x20 /* Data Set Ready */
-#define RI 0x40 /* Ring Indicator */
-#define DCD 0x80 /* Data Carrier Detect */
-
-#define SCR (volatile unsigned char * const)(7*2+UART_BASE_ADDRESS)
- /* Scratch Register */
- /* 8-bit register */
-#endif
diff --git a/c/src/lib/libbsp/m68k/efi68k/include/DP8570A.h b/c/src/lib/libbsp/m68k/efi68k/include/DP8570A.h
deleted file mode 100644
index 8739a4a793..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/include/DP8570A.h
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- *-------------------------------------------------------------------
- *
- * DP8570A -- header file for National Semiconducor's DP8570A TCP
- *
- * This file has been created by John S. Gwynne for the efi68k
- * project.
- *
- * 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$
- */
-
-#ifndef _DP8570A_H_
-#define _DP8570A_H_
-
-/* base address is the physical location of register 0 */
-#define TCP_BASE_ADDRESS 0x0600001
-
-
-/* definitions of register addresses and associate bits */
-
-/* ********************************************************* */
-/* Control Registers */
-/* ********************************************************* */
-
-/* REMEMBER: if you are in an interrupt routine, you must
- reset RS and PS of MSR to the value they had on entry
- to the ISR before exiting */
-
-#define MSR (volatile unsigned char * const)(0x00*2+TCP_BASE_ADDRESS)
- /* Main Status Register */
-#define INT 0x01 /* Interrupt Status */
-#define PF 0x02 /* Power Fail Interrupt */
-#define PER 0x04 /* Period Interrupt */
-#define AL 0x08 /* Alarm Interrupt */
-#define T0 0x10 /* Timer 0 Interrupt */
-#define T1 0x20 /* Timer 1 Interrupt */
-#define RS 0x40 /* Register Select Bit */
-#define PS 0x80 /* Page Select Bit */
-
-#define T0CR (volatile unsigned char * const)(0x01*2+TCP_BASE_ADDRESS)
- /* Timer 0 Control Register */
-#define T1CR (volatile unsigned char * const)(0x02*2+TCP_BASE_ADDRESS)
- /* Timer 1 Control Register */
-#define TSS 0x01 /* Timer Start/!Stop */
-#define M0 0x02 /* Mode Select */
-#define M1 0x04 /* Mode Select */
-#define C0 0x08 /* Input Clock Select */
-#define C1 0x10 /* Input Clock Select */
-#define C2 0x20 /* Input Clock Select */
-#define RD 0x40 /* Timer Read */
-#define CHG 0x80 /* Count Hold/Gate */
-
-#define PFR (volatile unsigned char * const)(0x03*2+TCP_BASE_ADDRESS)
- /* Periodic Flag Register */
-#define R_1MIN 0x01 /* Minute Flage */
-#define R_10S 0x02 /* 10 Second Flag */
-#define R_1S 0x04 /* Second Flag */
-#define R_100MS 0x08 /* 100 Millisec Flag */
-#define R_10MS 0x10 /* 10 Millisec Flag */
-#define R_1MS 0x20 /* 1 Millisec Flag */
-#define OSF 0x40 /* Oscillator Failed/Single Supply */
-#define TMODE 0x80 /* Test Mode Enable */
-
-#define IRR (volatile unsigned char * const)(0x04*2+TCP_BASE_ADDRESS)
- /* Interrupt Routing Register */
-#define PF_R 0x01 /* Power Fail Route */
-#define PR_R 0x02 /* Periodic Route */
-#define AL_R 0x04 /* Alarm Route */
-#define T0_R 0x08 /* Timer 0 Route */
-#define T1_R 0x10 /* Timer 1 Route */
-#define PFD 0x20 /* PF Delay Enable */
-#define LBF 0x40 /* Low Battery Flag */
-#define TMSE 0x80 /* Time Save Enable */
-
-#define RTMR (volatile unsigned char * const)(0x01*2+TCP_BASE_ADDRESS)
- /* Real Time Mode Register */
-#define LY0 0x01 /* Leap Year LSB */
-#define LY1 0x02 /* Leap Year MSB */
-#define H12 0x04 /* 12/!24 Hour Mode */
-#define CSS 0x08 /* Clock Start/!Stop */
-#define IPF 0x10 /* Interrupt PF Operation */
-#define TPF 0x20 /* Timer PF Operation */
-#define XT0 0x40 /* Crystal Frequency LSB */
-#define XT1 0x80 /* Crystal Frequency MSB */
-
-#define OMR (volatile unsigned char * const)(0x02*2+TCP_BASE_ADDRESS)
- /* Output Mode Register */
-#define TH 0x01 /* T1 Active Hi/!Low */
-#define TP 0x02 /* T1 Push Pull/!Open Drain */
-#define IH 0x04 /* INTR Active Hi/!Low */
-#define IP 0x08 /* INTR Push Pull/!Open Drain */
-#define MH 0x10 /* MFO Active Hi/!Low */
-#define MP 0x20 /* MFO Push Pull/!Open Drain */
-#define MT 0x40 /* MFO Pin as Timer 0 */
-#define MO 0x80 /* MFO Pin as Oscillator */
-
-#define ICR0 (volatile unsigned char * const)(0x03*2+TCP_BASE_ADDRESS)
- /* Interrupt control Register 0 */
-#define ME 0x01 /* Minutes Enable */
-#define TSE 0x02 /* 10 Second Enable */
-#define SE 0x04 /* Seconds Enable */
-#define HME 0x08 /* 100 Millisec Enable */
-#define TME 0x10 /* 10 Millisec Enable */
-#define OME 0x20 /* Millisec Enable */
-#define T0E 0x40 /* Timer 0 Enable */
-#define T1E 0x80 /* Timer 1 Enable */
-
-#define ICR1 (volatile unsigned char * const)(0x04*2+TCP_BASE_ADDRESS)
- /* Interrupt control Register 1 */
-#define SCE 0x01 /* Second Compare Enable */
-#define MNE 0x02 /* Minute Compare Enable */
-#define HRE 0x04 /* Hour Compare Enable */
-#define DOME 0x08 /* Day of Month Compare Enable */
-#define MOE 0x10 /* Month Compare Enable */
-#define DOWE 0x20 /* Day of Week Compare Enable */
-#define ALE 0x40 /* Alarm Interrupt Enable */
-#define PFE 0x80 /* Power Fail Interrupt Enable */
-
-
-
-/* ********************************************************* */
-/* Counters: Clock and Calendar (data is stored in BCD) */
-/* ********************************************************* */
-#define HOFS (volatile unsigned char * const)(0x05*2+TCP_BASE_ADDRESS)
- /* Hundredth of Seconds */
-#define SEC (volatile unsigned char * const)(0x06*2+TCP_BASE_ADDRESS)
- /* Seconds */
-#define MIN (volatile unsigned char * const)(0x07*2+TCP_BASE_ADDRESS)
- /* Minutes */
-#define HRS (volatile unsigned char * const)(0x08*2+TCP_BASE_ADDRESS)
- /* Hours */
-#define DOM (volatile unsigned char * const)(0x09*2+TCP_BASE_ADDRESS)
- /* Day of Month */
-#define MON (volatile unsigned char * const)(0x0a*2+TCP_BASE_ADDRESS)
- /* Month */
-#define YR (volatile unsigned char * const)(0x0b*2+TCP_BASE_ADDRESS)
- /* Year */
-#define JD_LSB (volatile unsigned char * const)(0x0c*2+TCP_BASE_ADDRESS)
- /* Julian Date (LSB) */
-#define JD_MSM (volatile unsigned char * const)(0x0d*2+TCP_BASE_ADDRESS)
- /* Julian Date (MSB) */
-#define DOW (volatile unsigned char * const)(0x0e*2+TCP_BASE_ADDRESS)
- /* Day of week */
-
-
-/* ********************************************************* */
-/* Timer Data Registers */
-/* ********************************************************* */
-#define T0_LSB (volatile unsigned char * const)(0x0f*2+TCP_BASE_ADDRESS)
- /* Timer 0 LSB */
-#define T0_MSB (volatile unsigned char * const)(0x10*2+TCP_BASE_ADDRESS)
- /* Timer 0 MSB */
-#define T1_LSB (volatile unsigned char * const)(0x11*2+TCP_BASE_ADDRESS)
- /* Timer 1 LSB */
-#define T1_MSB (volatile unsigned char * const)(0x12*2+TCP_BASE_ADDRESS)
- /* Timer 1 MSB */
-
-
-/* ********************************************************* */
-/* Timer Compare RAM */
-/* ********************************************************* */
-#define TC_SEC (volatile unsigned char * const)(0x13*2+TCP_BASE_ADDRESS)
- /* Seconds Compare RAM */
-#define TC_MIN (volatile unsigned char * const)(0x14*2+TCP_BASE_ADDRESS)
- /* Minutes Compare RAM */
-#define TC_HRS (volatile unsigned char * const)(0x15*2+TCP_BASE_ADDRESS)
- /* Hours Compare RAM */
-#define TC_DOM (volatile unsigned char * const)(0x16*2+TCP_BASE_ADDRESS)
- /* Day of Month Compare RAM */
-#define TC_MON (volatile unsigned char * const)(0x17*2+TCP_BASE_ADDRESS)
- /* Month Compare RAM */
-#define TC_DOW (volatile unsigned char * const)(0x18*2+TCP_BASE_ADDRESS)
- /* Day of Week Compare RAM */
-
-
-/* ********************************************************* */
-/* Time Save RAM */
-/* ********************************************************* */
-#define S_SEC (volatile unsigned char * const)(0x19*2+TCP_BASE_ADDRESS)
- /* Seconds Save RAM */
-#define S_MIN (volatile unsigned char * const)(0x1a*2+TCP_BASE_ADDRESS)
- /* Minutes Save RAM */
-#define S_HRS (volatile unsigned char * const)(0x1b*2+TCP_BASE_ADDRESS)
- /* Hours Save RAM */
-#define S_DOM (volatile unsigned char * const)(0x1c*2+TCP_BASE_ADDRESS)
- /* Day of Month Save RAM */
-#define S_MON (volatile unsigned char * const)(0x1d*2+TCP_BASE_ADDRESS)
- /* Month Save RAM */
-
-
-/* ********************************************************* */
-/* Miscellaneous Registers */
-/* ********************************************************* */
- /* rem: 0x1e is general purpose RAM */
-#define TMR (volatile unsigned char * const)(0x1F*2+TCP_BASE_ADDRESS)
- /* RAM/Test Mode Register */
-
-
-
-/* ********************************************************* */
-/* RAM allocation */
-/* ********************************************************* */
-#define RAM_OSC_FAIL (volatile unsigned char * const)(0x01*2+TCP_BASE_ADDRESS)
- /* 1: osc. failed time lost */
-#define RAM_POWERUP (volatile unsigned char * const)(0x02*2+TCP_BASE_ADDRESS)
- /* 1: power was removed and the applied
- before last TCP init */
-#define RAM_LOWBAT (volatile unsigned char * const)(0x03*2+TCP_BASE_ADDRESS)
- /* 1: battery voltage is low (2.2V) */
- /* not valid in single supply mode */
-#define RAM_SINGLE_SUP (volatile unsigned char * const)(0x04*2+TCP_BASE_ADDRESS)
- /* 1: single supply mode */
- /* note: single supply mode will be
- selected when no backup battery is
- present and/or the first time the
- system is booted after the loss of
- backup battery voltage. */
-#define RAM_TCP_FAILURE (volatile unsigned char * const)(0x05*2+TCP_BASE_ADDRESS)
- /* 1: TCP failed to start oscillating */
-
-
-/* ********************************************************* */
-/* TCP data structures */
-/* ********************************************************* */
-
-struct clock_counters {
- unsigned char hofs;
- unsigned char d0; /* the dx's are place holders since */
- unsigned char sec; /* the TCP is addressable only on */
- unsigned char d1; /* odd addresses. */
- unsigned char min;
- unsigned char d2;
- unsigned char hrs;
- unsigned char d3;
- unsigned char dom;
- unsigned char d4;
- unsigned char mon;
- unsigned char d5;
- unsigned char yr;
- unsigned char d6;
- unsigned char jd0;
- unsigned char d7;
- unsigned char jd1;
- unsigned char d8;
- unsigned char dow;
-};
-
-extern struct clock_ram * const tcp_power_up;
-
-struct clock_ram {
- unsigned char sec;
- unsigned char d0; /* the dx's are place holders since */
- unsigned char min; /* the TCP is addressable only on */
- unsigned char d1; /* odd addresses. */
- unsigned char hrs;
- unsigned char d2;
- unsigned char dom;
- unsigned char d3;
- unsigned char mon;
-};
-
-extern struct clock_ram * const tcp_power_up;
-extern struct clock_ram * const tcp_power_down;
-extern struct clock_counters * const tcp_clock;
-extern struct clock_ram * const tcp_save_ram;
-
-void tcp_init(void);
-
-#endif /* _DP8570A_H_ */
diff --git a/c/src/lib/libbsp/m68k/efi68k/include/Makefile.in b/c/src/lib/libbsp/m68k/efi68k/include/Makefile.in
deleted file mode 100644
index e58a318be3..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/include/Makefile.in
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/efi68k.h $(srcdir)/16550.h \
- $(srcdir)/DP8570A.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/m68k/efi68k/include/bsp.h b/c/src/lib/libbsp/m68k/efi68k/include/bsp.h
deleted file mode 100644
index de2ea0461b..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/include/bsp.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/* bsp.h
- *
- * This include file contains all efi68k board IO definitions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __EFI68K_BSP_h
-#define __EFI68K_BSP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <clockdrv.h>
-#include <console.h>
-#include <iosupp.h>
-#include <efi68k.h>
-#include <DP8570A.h>
-#include <16550.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Define the interrupt mechanism for Time Test 27
- */
-
-/* XXX - JRS - I want to compile the tmtests */
-
-#define MUST_WAIT_FOR_INTERRUPT 1
-
-#define Install_tm27_vector( handler )
-
-#define Cause_tm27_intr()
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( microseconds ) \
- { register rtems_unsigned32 _delay=(microseconds); \
- register rtems_unsigned32 _tmp=123; \
- asm volatile( "0: \
- nbcd %0 ; \
- nbcd %0 ; \
- dbf %1,0b" \
- : "=d" (_tmp), "=d" (_delay) \
- : "0" (_tmp), "1" (_delay) ); \
- }
-
-/* externals */
-
-extern char _endtext[];
-extern char _sdata[];
-extern char _edata[];
-extern char __bss_start[];
-extern char _end[];
-extern char _copy_data_from_rom[];
-extern char __end_of_ram[];
-
-/* constants */
-
-#define RAM_END ((int)__end_of_ram)
-
-#ifdef __START_C__
-#define STACK_SIZE "#0x800"
-#else
-#define STACK_SIZE 0x800
-#endif
-
-/* macros */
-
-#define RAW_PUTS(str) \
- { register char *ptr = str; \
- while (*ptr) outbyte(*ptr++); \
- }
-
-#define RAW_PUTI(n) { \
- register int i, j; \
- \
- RAW_PUTS("0x"); \
- for (i=28;i>=0;i -= 4) { \
- j = (n>>i) & 0xf; \
- outbyte( (j>9 ? j-10+'a' : j+'0') ); \
- } \
- }
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-extern m68k_isr_entry M68Kvec[]; /* vector table address */
-
-extern int stack_size;
-
-extern int stack_start;
-
-extern rtems_unsigned32 Timer_interrupts;
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-m68k_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-void console_init(void);
-
-void watch_dog_init(void);
-
-void tcp_init(void);
-
-void Spurious_Initialize(void);
-
-void _UART_flush(void);
-
-void Clock_exit(void);
-
-void outbyte(char);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/efi68k/include/coverhd.h b/c/src/lib/libbsp/m68k/efi68k/include/coverhd.h
deleted file mode 100644
index 02df403a18..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/include/coverhd.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- * This file should be updated after running the C overhead timing
- * test. Once this update has been performed, the RTEMS Time Test
- * Suite should be rebuilt to account for these overhead times in the
- * timing results.
- *
- * NOTE: If these are all zero, then the times reported include
- * all calling overhead including passing of arguments.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
-#define CALLING_OVERHEAD_TASK_CREATE 0
-#define CALLING_OVERHEAD_TASK_IDENT 0
-#define CALLING_OVERHEAD_TASK_START 0
-#define CALLING_OVERHEAD_TASK_RESTART 0
-#define CALLING_OVERHEAD_TASK_DELETE 0
-#define CALLING_OVERHEAD_TASK_SUSPEND 0
-#define CALLING_OVERHEAD_TASK_RESUME 0
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
-#define CALLING_OVERHEAD_TASK_MODE 0
-#define CALLING_OVERHEAD_TASK_GET_NOTE 0
-#define CALLING_OVERHEAD_TASK_SET_NOTE 0
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 0
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
-#define CALLING_OVERHEAD_CLOCK_GET 0
-#define CALLING_OVERHEAD_CLOCK_SET 0
-#define CALLING_OVERHEAD_CLOCK_TICK 0
-
-#define CALLING_OVERHEAD_TIMER_CREATE 0
-#define CALLING_OVERHEAD_TIMER_IDENT 0
-#define CALLING_OVERHEAD_TIMER_DELETE 0
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 0
-#define CALLING_OVERHEAD_TIMER_RESET 0
-#define CALLING_OVERHEAD_TIMER_CANCEL 0
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
-
-#define CALLING_OVERHEAD_EVENT_SEND 0
-#define CALLING_OVERHEAD_EVENT_RECEIVE 0
-#define CALLING_OVERHEAD_SIGNAL_CATCH 0
-#define CALLING_OVERHEAD_SIGNAL_SEND 0
-#define CALLING_OVERHEAD_PARTITION_CREATE 0
-#define CALLING_OVERHEAD_PARTITION_IDENT 0
-#define CALLING_OVERHEAD_PARTITION_DELETE 0
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
-#define CALLING_OVERHEAD_REGION_CREATE 0
-#define CALLING_OVERHEAD_REGION_IDENT 0
-#define CALLING_OVERHEAD_REGION_DELETE 0
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
-#define CALLING_OVERHEAD_PORT_CREATE 0
-#define CALLING_OVERHEAD_PORT_IDENT 0
-#define CALLING_OVERHEAD_PORT_DELETE 0
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 0
-#define CALLING_OVERHEAD_IO_OPEN 0
-#define CALLING_OVERHEAD_IO_CLOSE 0
-#define CALLING_OVERHEAD_IO_READ 0
-#define CALLING_OVERHEAD_IO_WRITE 0
-#define CALLING_OVERHEAD_IO_CONTROL 0
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
-
-#endif
diff --git a/c/src/lib/libbsp/m68k/efi68k/include/efi68k.h b/c/src/lib/libbsp/m68k/efi68k/include/efi68k.h
deleted file mode 100644
index 6aa16ce3c0..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/include/efi68k.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* efi68k.h
- *
- * $Id$
- */
-
-#ifndef _EFI68k_H_
-#define _EFI68k_H_
-
-
-/* interrupt levels */
-#define WD_ISR_LEVEL 1
-#define TCP_ISR_LEVEL 4
-#define UART_ISR_LEVEL 6
-#define INTR7 7
-
-
-/* macro/function definitions */
-#if 0
-/*
- * This prototype really should have the noreturn attribute but
- * that causes a warning since it appears that the routine does
- * return.
- *
- * void dumby_start () __attribute__ ((noreturn));
- */
-
-static void reboot(void);
-__inline__ static void reboot() {asm("trap #15");}
-#else
-#define reboot() do {asm("trap #15");} while(0)
-#endif
-
-
-#endif /* _EFI68k_H_ */
diff --git a/c/src/lib/libbsp/m68k/efi68k/spurious/Makefile.in b/c/src/lib/libbsp/m68k/efi68k/spurious/Makefile.in
deleted file mode 100644
index 871175f129..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/spurious/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/spurious.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=spinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/efi68k/spurious/spinit.c b/c/src/lib/libbsp/m68k/efi68k/spurious/spinit.c
deleted file mode 100644
index d3d622d399..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/spurious/spinit.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Spurious_driver
- *
- * This routine installs spurious interrupt handlers for the efi68k.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <stdio.h>
-
-const char * const _Spurious_Error_[] = {"Reset","Bus Error","Address Error",
- "Illegal Instruction","Zero Division","CHK, CHK2 Instruction",
- "TRAPcc, TRAPV Instruction","Privilege Violation","Trace",
- "Line 1010 Emulation","Line 1111 Emulation","Hardware Breakpoint",
- "Coprocessor Protocal Violation",
- "Format Error ans Uninitialized Interrupt","Unassigned",
- "Spurious Interrupt","AVec1","AVec2","AVec3","AVec4","AVec5","AVec6",
- "AVec7","Trap Instruction","Debug","Reboot","Reserved Coprocessor",
- "Reserved Unassigned","User Defined"};
-
-rtems_isr Spurious_Isr(
- rtems_vector_number vector
-)
-{
- int sp = 0;
- const char * const VectDescrip[] = {
- _Spurious_Error_[0], _Spurious_Error_[0], _Spurious_Error_[1],
- _Spurious_Error_[2], _Spurious_Error_[3], _Spurious_Error_[4],
- _Spurious_Error_[5], _Spurious_Error_[6], _Spurious_Error_[7],
- _Spurious_Error_[8], _Spurious_Error_[9], _Spurious_Error_[10],
- _Spurious_Error_[11], _Spurious_Error_[12], _Spurious_Error_[13],
- _Spurious_Error_[13], _Spurious_Error_[14], _Spurious_Error_[14],
- _Spurious_Error_[14], _Spurious_Error_[14], _Spurious_Error_[14],
- _Spurious_Error_[14], _Spurious_Error_[14], _Spurious_Error_[14],
- _Spurious_Error_[15], _Spurious_Error_[16], _Spurious_Error_[17],
- _Spurious_Error_[18], _Spurious_Error_[19], _Spurious_Error_[20],
- _Spurious_Error_[21], _Spurious_Error_[22], _Spurious_Error_[23],
- _Spurious_Error_[24], _Spurious_Error_[23], _Spurious_Error_[23],
- _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
- _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
- _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
- _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[25],
- _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
- _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
- _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
- _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[27],
- _Spurious_Error_[27], _Spurious_Error_[27], _Spurious_Error_[27],
- _Spurious_Error_[27], _Spurious_Error_[28]};
-
- asm volatile ( "movea.l %%sp,%0 " : "=a" (sp) : "0" (sp) );
-
- _CPU_ISR_Set_level( 7 );
- _UART_flush();
-
- RAW_PUTS("\n\rRTEMS: Spurious interrupt: ");
- RAW_PUTS((char *)VectDescrip[( (vector>64) ? 64 : vector )]);
- RAW_PUTS("\n\rRTEMS: Vector: ");
- RAW_PUTI(vector);
- RAW_PUTS(" sp: ");
- RAW_PUTI(sp);
- RAW_PUTS("\n\r");
-
- bsp_cleanup();
-
- for(;;);
-}
-
-void Spurious_Initialize(void)
-{
- rtems_vector_number vector;
-
- for ( vector = 0x0 ; vector <= 0xFF ; vector++ )
- (void) set_vector( Spurious_Isr, vector, 1 );
-}
diff --git a/c/src/lib/libbsp/m68k/efi68k/start/Makefile.in b/c/src/lib/libbsp/m68k/efi68k/start/Makefile.in
deleted file mode 100644
index ddd45a4c24..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/start/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/start68k.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=start68k
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/m68k/efi68k/start/start.c b/c/src/lib/libbsp/m68k/efi68k/start/start.c
deleted file mode 100644
index f63381c57f..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/start/start.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * $Id$
- */
-
-#include <efi68k.h>
-#define __START_C__
-#include "bsp.h"
-
-m68k_isr_entry M68Kvec[256];
-m68k_isr_entry vectors[256];
-char * const __argv[]= {"main", ""};
-char * const __env[]= {""};
-
-/*
- * This prototype really should have the noreturn attribute but
- * that causes a warning since it appears that the routine does
- * return.
- *
- * void dumby_start () __attribute__ ((noreturn));
- */
-
-void dumby_start ();
-void dumby_start() {
-void boot_card();
-
- /* We need to by-pass the link instruction since the RAM chip-
- select pins are not yet configured. */
- asm volatile ( ".global start ;
- start:");
-
- /* disable interrupts, load stack pointer */
- asm volatile ( "oriw #0x0700, %sr;
- movel #_end, %d0;
- addl " STACK_SIZE ",%d0;
- movel %d0,%sp;
- link %a6, #0"
- );
- /*
- * Initialize RAM by copying the .data section out of ROM (if
- * needed) and "zero-ing" the .bss section.
- */
- {
- register char *src = _endtext;
- register char *dst = _sdata;
-
- if (_copy_data_from_rom)
- /* ROM has data at end of text; copy it. */
- while (dst < _edata)
- *dst++ = *src++;
-
- /* Zero bss */
- for (dst = __bss_start; dst< _end; dst++)
- *dst = 0;
- }
-
- /*
- * Initalize the board.
- */
- Spurious_Initialize();
- console_init();
- watch_dog_init();
- tcp_init();
-
- /*
- * Execute main with arguments argv and environment env
- */
- /* main(1, __argv, __env); */
- boot_card();
-
- reboot();
-}
diff --git a/c/src/lib/libbsp/m68k/efi68k/start68k/Makefile.in b/c/src/lib/libbsp/m68k/efi68k/start68k/Makefile.in
deleted file mode 100644
index ddd45a4c24..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/start68k/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/start68k.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=start68k
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/m68k/efi68k/start68k/start68k.c b/c/src/lib/libbsp/m68k/efi68k/start68k/start68k.c
deleted file mode 100644
index f63381c57f..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/start68k/start68k.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * $Id$
- */
-
-#include <efi68k.h>
-#define __START_C__
-#include "bsp.h"
-
-m68k_isr_entry M68Kvec[256];
-m68k_isr_entry vectors[256];
-char * const __argv[]= {"main", ""};
-char * const __env[]= {""};
-
-/*
- * This prototype really should have the noreturn attribute but
- * that causes a warning since it appears that the routine does
- * return.
- *
- * void dumby_start () __attribute__ ((noreturn));
- */
-
-void dumby_start ();
-void dumby_start() {
-void boot_card();
-
- /* We need to by-pass the link instruction since the RAM chip-
- select pins are not yet configured. */
- asm volatile ( ".global start ;
- start:");
-
- /* disable interrupts, load stack pointer */
- asm volatile ( "oriw #0x0700, %sr;
- movel #_end, %d0;
- addl " STACK_SIZE ",%d0;
- movel %d0,%sp;
- link %a6, #0"
- );
- /*
- * Initialize RAM by copying the .data section out of ROM (if
- * needed) and "zero-ing" the .bss section.
- */
- {
- register char *src = _endtext;
- register char *dst = _sdata;
-
- if (_copy_data_from_rom)
- /* ROM has data at end of text; copy it. */
- while (dst < _edata)
- *dst++ = *src++;
-
- /* Zero bss */
- for (dst = __bss_start; dst< _end; dst++)
- *dst = 0;
- }
-
- /*
- * Initalize the board.
- */
- Spurious_Initialize();
- console_init();
- watch_dog_init();
- tcp_init();
-
- /*
- * Execute main with arguments argv and environment env
- */
- /* main(1, __argv, __env); */
- boot_card();
-
- reboot();
-}
diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in b/c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in
deleted file mode 100644
index 5925adedb4..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bsplibc bsppost bspstart bspclean efi68k_tcp efi68k_wd main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-
diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/bspclean.c b/c/src/lib/libbsp/m68k/efi68k/startup/bspclean.c
deleted file mode 100644
index 86d2499aa1..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/startup/bspclean.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine cleans up in the sense that it places the board
- * in a safe state and flushes the I/O buffers before exiting.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-void bsp_cleanup(void)
-{
- /* interrupt driven stdio must be flushed */
- _CPU_ISR_Set_level( 7 );
- _UART_flush();
-}
diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c b/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c
deleted file mode 100644
index 4b89a87499..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-rtems_unsigned32 Timer_interrupts;
-
-extern void set_debug_traps(void);
-extern void breakpoint(void);
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
-/* extern int end; */
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) BSP_Configuration.work_space_start +
- (rtems_unsigned32) BSP_Configuration.work_space_size;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- if (heap_start > (rtems_unsigned32) RAM_END) {
- /* rtems_fatal_error_occurred can not be used before initalization */
- RAW_PUTS("\n\rRTEMS: Out of memory.\n\r");
- RAW_PUTS("RTEMS: Check RAM_END and the size of the work space.\n\r");
- }
-
- bsp_libc_init((void *) heap_start, (RAM_END - heap_start), 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- void *vbr;
-
-/* set_debug_traps(); */
-/* breakpoint(); */
-
- /*
- * we only use a hook to get the C library initialized.
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook;
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
-
- m68k_get_vbr( vbr );
- Cpu_table.interrupt_vector_table = vbr;
-
- BSP_Configuration.work_space_start = (void *)
- (((unsigned int)_end + STACK_SIZE + 0x100) & 0xffffff00);
-
- /* Clock_exit is done as an atexit() function */
-}
-
diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/efi68k_tcp.c b/c/src/lib/libbsp/m68k/efi68k/startup/efi68k_tcp.c
deleted file mode 100644
index 6173f6d706..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/startup/efi68k_tcp.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- *-------------------------------------------------------------------
- *
- * This file contains the subroutines necessary to initalize
- * the DP8750A TCP on the efi68k board.
- *
- * This file has been created by John S. Gwynne for the efi68k
- * project.
- *
- * 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 <bsp.h>
-
-/* define tcp struct pointers */
-struct clock_ram * const tcp_power_up =
- (struct clock_ram * const)(0x16*2+TCP_BASE_ADDRESS);
-
-struct clock_ram * const tcp_power_down =
- (struct clock_ram * const)(0x1b*2+TCP_BASE_ADDRESS);
-
-struct clock_counters * const tcp_clock =
- (struct clock_counters * const)(0x05*2+TCP_BASE_ADDRESS);
-
-struct clock_ram * const tcp_save_ram =
- (struct clock_ram * const)(0x19*2+TCP_BASE_ADDRESS);
-
-#define X_DELAY 300 /* time-out delay for crystal start */
-#define X1_DELAY 100000
-
-void tcp_delay(int count)
-{
- int i;
- /* change latter to use a counter !!! */
- for (i=0;i<count/4;i++);
-}
-
-void tcp_init()
-{
- unsigned char low_bat, osc_fail, power_up;
- unsigned char mon, dom, hrs, min, sec;
- int i, count;
-
- /* delay about 60us to ensure TCP is not locked-out */
- tcp_delay(80);
-
- /* set normal supply mode and reset test mode bit */
- *MSR = 0;
- *PFR = 0;
-
- /* save oscillator failure condition */
- *MSR = 0; /* set RS and PS to zero */
- osc_fail = (*PFR & OSF ? 1 : 0);
- *MSR = PS;
- *RAM_OSC_FAIL = *RAM_OSC_FAIL || osc_fail;
-
- *MSR = PS;
- if (*RAM_OSC_FAIL) {
- power_up = 1;
- *MSR = PS;
- *RAM_POWERUP = power_up;
- /* clear time counters and power up & down ram */
- *MSR = 0;
- tcp_clock->hofs = 0;
- tcp_clock->sec = 0;
- tcp_clock->min = 0;
- tcp_clock->hrs = 0;
- tcp_clock->dom = 1;
- tcp_clock->mon = 1;
- tcp_clock->yr = 0x95;
- tcp_clock->jd0 = 0x01;
- tcp_clock->jd1 = 0;
- tcp_clock->dow = 1;
- *MSR = PS;
- tcp_power_up->sec = 0;
- tcp_power_up->min = 0;
- tcp_power_up->hrs = 0;
- tcp_power_up->dom = 0;
- tcp_power_up->mon = 0;
- tcp_power_down->sec = 0;
- tcp_power_down->min = 0;
- tcp_power_down->hrs = 0;
- tcp_power_down->dom = 0;
- tcp_power_down->mon = 0;
- } else {
- /* save for power-up test */
- *MSR = 0;
- power_up = (*IRR & TMSE ? 0 : 1);
- *MSR = PS;
- *RAM_POWERUP = power_up;
-
- /* update tcp_power_up and tcp_power_down on power up */
- if (power_up) {
- *MSR = 0;
- do {
- *PFR;
- sec = tcp_clock->sec;
- min = tcp_clock->min;
- hrs = tcp_clock->hrs;
- dom = tcp_clock->dom;
- mon = tcp_clock->mon;
- } while (*PFR & R_1S);
- *MSR = PS;
- tcp_power_up->sec = sec;
- tcp_power_up->min = min;
- tcp_power_up->hrs = hrs;
- tcp_power_up->dom = dom;
- tcp_power_up->mon = ( (((mon>>4)*10)+(mon&0xf))>12 ? 0 : mon );
- *MSR = 0; /* save ram is not running */
- sec = tcp_save_ram->sec;
- min = tcp_save_ram->min;
- hrs = tcp_save_ram->hrs;
- dom = tcp_save_ram->dom;
- mon = tcp_save_ram->mon;
- *MSR = PS;
- tcp_power_down->sec = sec;
- tcp_power_down->min = min;
- tcp_power_down->hrs = hrs;
- tcp_power_down->dom = dom;
- tcp_power_down->mon = ( (((mon>>4)*10)+(mon&0xf))>12 ? 0 : mon );
- }
- }
-
- /* load interrupt routing reg. PF must be enabled to test
- for low battery, but I route it to MFO to avoid any
- potential problems */
- *MSR = 0;
- *IRR = PF_R | TMSE;
-
- /* initialize the output mode register */
- *MSR = RS;
- *OMR = IP | MP | MO; /* INTR active low and push/pull */
-
- /* initialize interrupt control reg 0 */
- *MSR = RS;
- *ICR0 = 0; /* disable all interrupts */
-
- /* initialize interrupt control reg 1 */
- *MSR = RS;
- *ICR1 = PFE; /* this also enables the low battery
- detection circuit. */
-
- /* I had trouble getting the tcp to be completely
- flexible to supply modes (i.e., automatically
- selecting single or normal battery backup modes based
- on inputs at power-up. If single supply mode is
- selected, the low battery detect is disabled and the
- low battery detect in normal mode does not seem to
- detect when no battery is present at all. If normal
- mode is selected and no battery is present, the
- crystal will stop, but only if reset after
- power-up. It would seem that after a power-up reset,
- with no battery, the chip may automaticlly switch to
- single supply mode which disables the low battery
- detection circuit.) The following software tests
- works for all permiatations of low batt, reset,
- power-on reset, battery, no battery, battery on after
- Vcc,.... *except* for battery switched on for the
- first time before power up in which case the chip
- will still be in single suppy mode till restarted (a
- second call to tcp_init such as when the time is set
- or a reboot.) The timer/clock itself should always
- be completely functional regardless of the supply
- mode. */
-
-
- /* initialize the real time mode register */
- /* note: write mode bits *before* CSS, then set CSS */
- *MSR = 0; /* clear roll-over */
- *PFR;
- count=1;
- for (i=0;i<X_DELAY;i++) { /* loop till xtal starts */
- *MSR = RS;
- *RTMR = (*RTMR & (LY0 | LY1 )) | CSS;
- *MSR = 0;
- if (*PFR & R_1MS)
- if (!(count--)) break;
- }
- if (i>=X_DELAY) {
- {
- /* xtal didn't start; try single supply mode */
- *MSR = 0; /* single supply */
- *PFR = OSF;
- *MSR = 0; /* clear roll-over */
- *PFR;
- count=1;
- for (i=0;i<X1_DELAY;i++) { /* loop till xtal starts */
- *MSR = RS;
- *RTMR = (*RTMR & (LY0 | LY1 )) | CSS;
- *MSR = 0;
- if (*PFR & R_1MS)
- if (!(count--)) break;
- }
- if (i>=X1_DELAY) {
- /* xtal didn't start; fail tcp */
- *MSR = PS;
- *RAM_TCP_FAILURE = 1;
- *MSR = PS;
- *RAM_SINGLE_SUP=1;
- } else {
- *MSR = PS;
- *RAM_TCP_FAILURE = 0;
- *MSR = PS;
- *RAM_SINGLE_SUP=1;
- }
- }
- } else {
- *MSR = PS;
- *RAM_TCP_FAILURE = 0;
- *MSR = PS;
- *RAM_SINGLE_SUP=0;
- }
-
- /* wait for low battery detection circuit to stabalize */
- tcp_delay(1000);
-
- /* battery test */
- *MSR = 0;
- low_bat = (*IRR & LBF ? 1 : 0 );
- *MSR = PS;
- *RAM_LOWBAT = low_bat & !(*RAM_SINGLE_SUP);
-
- /* reset pending interrupts */
- *MSR = ( PER | AL | T0 | T1 );
-
- /* resync the time save ram with the clock */
- tcp_save_ram->sec = 0;
- tcp_save_ram->min = 0;
- tcp_save_ram->hrs = 0;
- tcp_save_ram->dom = 0;
- tcp_save_ram->mon = 0;
-}
diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/efi68k_wd.c b/c/src/lib/libbsp/m68k/efi68k/startup/efi68k_wd.c
deleted file mode 100644
index 78c3d1e00a..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/startup/efi68k_wd.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *-------------------------------------------------------------------
- *
- * This file contains the subroutines necessary to initalize
- * and maintain the MAX791 based watchdog timer used on efi68k
- *
- * This file has been created by John S. Gwynne for the efi68k
- * project.
- *
- * 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 <bsp.h>
-
-void wd_interrupt(void) {
- /* toggle WDI of the MAX791. A more sophisticated routine
- can be inserted into the exception table after booting. */
-
- /* 3 changes guaranty a pulse independent of initial state */
- *MCR |= OUT1;
- *MCR &= ~OUT1;
- *MCR |= OUT1;
-}
-
-/* _catchWDint is the interrupt front-end */
-extern void _catchWDint();
-asm(" .text
- .align 2
- .globl _catchWDint
-_catchWDint:
- lea %sp@(4),%sp /* pop return address */
- moveml %d0-%d7/%a0-%a6,%sp@- /* save registers */
- jbsr wd_interrupt
- moveml %sp@+,%d0-%d7/%a0-%a6
- rte
- ");
-
-void watch_dog_init(void) {
- set_vector(_catchWDint, WD_ISR_LEVEL+24, 0);
-}
diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/linkcmds b/c/src/lib/libbsp/m68k/efi68k/startup/linkcmds
deleted file mode 100644
index 5fabd9d11b..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/startup/linkcmds
+++ /dev/null
@@ -1,113 +0,0 @@
-/* linkcmds
- *
- * $Id$
- */
-
-OUTPUT_ARCH(m68k)
-__DYNAMIC = 0;
-
-/*
- * The memory map looks like this:
- * +--------------------+ <- low memory
- * | .text |
- * | etext |
- * | ctor list | the ctor and dtor lists are for
- * | dtor list | C++ support
- * | _endtext |
- * +--------------------+
- * | .data | initialized data goes here
- * | _sdata |
- * | _edata |
- * +--------------------+
- * | .bss |
- * | __bss_start | start of bss, cleared by crt0
- * | _end | start of heap, used by sbrk()
- * +--------------------+
- * | heap space |
- * | _ENDHEAP |
- * | stack space |
- * | __stack | top of stack
- * +--------------------+ <- high memory
- */
-
-
-/*
- * User modifiable values:
- *
- * _VBR location of VBR table
- */
-
-MEMORY
-{
- ram : ORIGIN = 0x203000, LENGTH = 256K
-}
-
-_VBR = 0x200000; /* location of the VBR table (in RAM) */
-__end_of_ram = 0x240000;
-_copy_data_from_rom = 0;
-
-/*
- * stick everything in ram (of course)
- */
-SECTIONS
-{
- .text :
- {
- CREATE_OBJECT_SYMBOLS
- text_start = .;
- _text_start = .;
- *(.text)
- . = ALIGN (16);
- *(.eh_fram)
- . = ALIGN (16);
-
- etext = ALIGN(0x10);
- _etext = .;
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- *(.lit)
- *(.shdata)
- _endtext = .;
- } > ram
- .data :
- {
- data_start = .;
- _data_start = .;
- _sdata = . ;
- *(.data)
- CONSTRUCTORS
- edata = ALIGN(0x10);
- _edata = .;
- } > ram
- .shbss :
- {
- *(.shbss)
- } > ram
- .bss :
- {
- __bss_start = ALIGN(0x8);
- bss_start = .;
- _bss_start = .;
- *(.bss)
- *(COMMON)
- end = .;
- _end = ALIGN(0x8);
- __end = ALIGN(0x8);
- } > ram
- .stab . (NOLOAD) :
- {
- [ .stab ]
- }
- .stabstr . (NOLOAD) :
- {
- [ .stabstr ]
- }
-}
diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/m68k-stub.c b/c/src/lib/libbsp/m68k/efi68k/startup/m68k-stub.c
deleted file mode 100644
index a37cd2dc83..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/startup/m68k-stub.c
+++ /dev/null
@@ -1,782 +0,0 @@
-/* m68k-stub.c
- *
- * $Id$
- */
-
-#include <efi68k.h>
-#include <rtems.h>
-
-m68k_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-
-void (*exceptionHook)() = 0;
-
-void outbyte(char c);
-char putDebugChar( char c)
-{
- outbyte(c);
- return c;
-}
-
-char inbyte(void);
-char getDebugChar(void)
-{
- return inbyte();
-}
-
-void flush_i_cache(void)
-{
- return;
-}
-
-void *memset(void *p, int c, int n)
-{
- register int i;
- void *s=p;
-
- for (i=0;i<n;i++) *((char *)p)++=(char)c;
- return s;
-}
-
-char *db_strcpy(char *s, const char *t)
-{
- char *save=s;
- while((*s++ = *t++) != '\0');
- return save;
-}
-
-int db_strlen(const char *s)
-{
- int n;
-
- for (n=0; *s!='\0'; s++) n++;
- return n;
-}
-
-/************************************************************************
- *
- * external low-level support routines
- */
-typedef void (*ExceptionHook)(int); /* pointer to function with int parm */
-typedef void (*Function)(); /* pointer to a function */
-
-/* extern Function exceptionHandler(); */ /* assign an exception handler */
-extern ExceptionHook exceptionHook; /* hook variable for errors/exceptions */
-/* extern void exceptionHandler(int vect, void (*function)()); */
-
-/************************/
-/* FORWARD DECLARATIONS */
-/************************/
-static void initializeRemcomErrorFrame();
-
-/************************************************************************/
-/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
-/* at least NUMREGBYTES*2 are needed for register packets */
-#define BUFMAX 400
-
-static char initialized; /* boolean flag. != 0 means we've been initialized */
-
-int remote_debug;
-/* debug > 0 prints ill-formed commands in valid packets & checksum errors */
-
-static const char hexchars[]="0123456789abcdef";
-
-/* there are 180 bytes of registers on a 68020 w/68881 */
-/* many of the fpa registers are 12 byte (96 bit) registers */
-#define NUMREGBYTES 180
-enum regnames {D0,D1,D2,D3,D4,D5,D6,D7,
- A0,A1,A2,A3,A4,A5,A6,A7,
- PS,PC,
- FP0,FP1,FP2,FP3,FP4,FP5,FP6,FP7,
- FPCONTROL,FPSTATUS,FPIADDR
- };
-
-
-
-typedef struct FrameStruct
-{
- struct FrameStruct *previous;
- int exceptionPC; /* pc value when this frame created */
- int exceptionVector; /* cpu vector causing exception */
- short frameSize; /* size of cpu frame in words */
- short sr; /* for 68000, this not always sr */
- int pc;
- short format;
- int fsaveHeader;
- int morejunk[0]; /* exception frame, fp save... */
-} Frame;
-
-#define FRAMESIZE 10
-int gdbFrameStack[FRAMESIZE];
-static Frame *lastFrame;
-
-/*
- * these should not be static cuz they can be used outside this module
- */
-int registers[NUMREGBYTES/4];
-int superStack;
-
-#define STACKSIZE 600
-int remcomStack[STACKSIZE/sizeof(int)];
-static int* stackPtr = &remcomStack[STACKSIZE/sizeof(int) - 1];
-
-static ExceptionHook oldExceptionHook;
-
-#define SAVE_FP_REGS()
-#define RESTORE_FP_REGS()
-
-void return_to_super();
-void return_to_user();
-
-asm("
-.text
-.align 2
-.globl return_to_super
-return_to_super:
- oriw #0x0700,%sr
- movel registers+60,%sp /* get new stack pointer */
- movel lastFrame,%a0 /* get last frame info */
- bra return_to_any
-
-.globl return_to_user
-return_to_user:
- oriw #0x0700,%sr
- movel registers+60,%a0 /* get usp */
- movel %a0,%usp /* set usp */
- movel superStack,%sp /* get original stack pointer */
-
-return_to_any:
- movel lastFrame,%a0 /* get last frame info */
- movel %a0@+,lastFrame /* link in previous frame */
- addql #8,%a0 /* skip over pc, vector#*/
- movew %a0@+,%d0 /* get # of words in cpu frame */
- addw %d0,%a0 /* point to end of data */
- addw %d0,%a0 /* point to end of data */
- movel %a0,%a1
-#
-# copy the stack frame
- subql #1,%d0
-copyUserLoop:
- movew %a1@-,%sp@-
- dbf %d0,copyUserLoop
-");
- RESTORE_FP_REGS()
- asm(" moveml registers,%d0-%d7/%a0-%a6");
- asm(" rte"); /* pop and go! */
-
-#define DISABLE_INTERRUPTS() asm(" oriw #0x0700,%sr");
-#define BREAKPOINT() asm(" trap #1");
-
-/* this function is called immediately when a level 7 interrupt occurs */
-/* if the previous interrupt level was 7 then we're already servicing */
-/* this interrupt and an rte is in order to return to the debugger. */
-/* For the 68000, the offset for sr is 6 due to the jsr return address */
-asm("
-.text
-.align 2
-.globl _debug_level7
-_debug_level7:
- movew %d0,%sp@-");
-asm(" movew %sp@(6),%d0");
-
-asm(" andiw #0x700,%d0
- cmpiw #0x700,%d0
- beq already7
- movew %sp@+,%d0
- bra _catchException
-already7:
- movew %sp@+,%d0");
-asm(" lea %sp@(4),%sp"); /* pull off 68000 return address */
-
-asm(" rte");
-
-extern void _catchException ();
-
-/* This function is called when an exception occurs. It translates the
- * return address found on the stack into an exception vector # which
- * is then handled by either handle_exception or a system handler.
- * _catchException provides a front end for both.
- *
- * stack on entry: stack on exit:
- * Program counter MSWord exception # MSWord
- * Program counter LSWord exception # MSWord
- * Status Register
- * Return Address MSWord
- * Return Address LSWord
- */
-
-asm("
-.text
-.align 2
-.globl _catchException
-_catchException:
-");
-DISABLE_INTERRUPTS();
-asm("
- moveml %d0-%d7/%a0-%a6,registers /* save registers */
- movel lastFrame,%a0 /* last frame pointer */
-
- move.b #64,(0x00600001)
- move.b (0x00600007),%d0
- andib #-64,%d0
- move.b %d0,(0x00600007)
-
-");
-SAVE_FP_REGS();
-asm("
- lea registers,%a5 /* get address of registers */
- movel %sp@+,%d2 /* pop return address */
- addq.l #6,%d2
- sub.l #0x200000,%d2
- divs #6,%d2
-/* addl #1530,%d2 */ /* convert return addr to */
-/* divs #6,%d2 */ /* exception number */
- extl %d2
-
- moveql #3,%d3 /* assume a three word frame */
-
- cmpiw #3,%d2 /* bus error or address error ? */
- bgt normal /* if >3 then normal error */
- movel %sp@+,%a0@- /* copy error info to frame buff*/
- movel %sp@+,%a0@- /* these are never used */
- moveql #7,%d3 /* this is a 7 word frame */
-
-normal:
- movew %sp@+,%d1 /* pop status register */
- movel %sp@+,%a4 /* pop program counter */
- movew %d1,%a5@(66) /* save sr */
- movel %a4,%a5@(68) /* save pc in _regisers[] */
- movel %a4,%a0@- /* copy pc to frame buffer */
- movew %d1,%a0@- /* copy sr to frame buffer */
-
- movel %sp,superStack /* save supervisor sp */
-
- andiw #0x2000,%d1 /* were we in supervisor mode ? */
- beq userMode
- movel %a7,%a5@(60) /* save a7 */
- bra saveDone
-userMode:
- movel %usp,%a1 /* save user stack pointer */
- movel %a1,%a5@(60) /* save user stack pointer */
-saveDone:
-
- movew %d3,%a0@- /* push frame size in words */
- movel %d2,%a0@- /* push vector number */
- movel %a4,%a0@- /* push exception pc */
-
-#
-# save old frame link and set the new value
- movel lastFrame,%a1 /* last frame pointer */
- movel %a1,%a0@- /* save pointer to prev frame */
- movel %a0,lastFrame
-
- movel %d2,%sp@- /* push exception num */
- movel exceptionHook,%a0 /* get address of handler */
- jbsr %a0@ /* and call it */
- clrl %sp@ /* replace exception num parm with frame ptr*/
- jbsr _returnFromException /* jbsr, but never returns */
-");
-
-
-/*
- * remcomHandler is a front end for handle_exception. It moves the
- * stack pointer into an area reserved for debugger use in case the
- * breakpoint happened in supervisor mode.
- */
-asm("remcomHandler:");
-asm(" addl #4,%sp"); /* pop off return address */
-asm(" movel %sp@+,%d0"); /* get the exception number */
-asm(" movel stackPtr,%sp"); /* move to remcom stack area */
-asm(" movel %d0,%sp@-"); /* push exception onto stack */
-asm(" andiw #0xf8ff,%sr");
-asm(" jbsr handle_exception"); /* this never returns */
-asm(" rts"); /* return */
-
-void _returnFromException( Frame *frame )
-{
- /* if no passed in frame, use the last one */
- if (! frame)
- {
- frame = lastFrame;
- frame->frameSize = 4;
- frame->format = 0;
- frame->fsaveHeader = -1; /* restore regs, but we dont have fsave info*/
- }
-
-
- /* a 68000 cannot use the internal info pushed onto a bus error
- * or address error frame when doing an RTE so don't put this info
- * onto the stack or the stack will creep every time this happens.
- */
- frame->frameSize=3;
-
-
- /* throw away any frames in the list after this frame */
- lastFrame = frame;
-
- frame->sr = registers[(int) PS];
- frame->pc = registers[(int) PC];
-
- if (registers[(int) PS] & 0x2000)
- {
- /* return to supervisor mode... */
- return_to_super();
- }
- else
- { /* return to user mode */
- return_to_user();
- }
-}
-
-int hex(ch)
-char ch;
-{
- if ((ch >= 'a') && (ch <= 'f')) return (ch-'a'+10);
- if ((ch >= '0') && (ch <= '9')) return (ch-'0');
- if ((ch >= 'A') && (ch <= 'F')) return (ch-'A'+10);
- return (-1);
-}
-
-
-/* scan for the sequence $<data>#<checksum> */
-void getpacket(buffer)
-char * buffer;
-{
- unsigned char checksum;
- unsigned char xmitcsum;
- int i;
- int count;
- char ch;
-
- do {
- /* wait around for the start character, ignore all other characters */
- while ((ch = getDebugChar()) != '$');
- checksum = 0;
- xmitcsum = -1;
-
- count = 0;
-
- /* now, read until a # or end of buffer is found */
- while (count < BUFMAX) {
- ch = getDebugChar();
- if (ch == '#') break;
- checksum = checksum + ch;
- buffer[count] = ch;
- count = count + 1;
- }
- buffer[count] = 0;
-
- if (ch == '#') {
- xmitcsum = hex(getDebugChar()) << 4;
- xmitcsum += hex(getDebugChar());
-
- if (checksum != xmitcsum) putDebugChar('-'); /* failed checksum */
- else {
- putDebugChar('+'); /* successful transfer */
- /* if a sequence char is present, reply the sequence ID */
- if (buffer[2] == ':') {
- putDebugChar( buffer[0] );
- putDebugChar( buffer[1] );
- /* remove sequence chars from buffer */
- count = db_strlen(buffer);
- for (i=3; i <= count; i++) buffer[i-3] = buffer[i];
- }
- }
- }
- } while (checksum != xmitcsum);
-
-}
-
-/* send the packet in buffer. The host get's one chance to read it.
- This routine does not wait for a positive acknowledge. */
-
-
-void putpacket(buffer)
-char * buffer;
-{
- unsigned char checksum;
- int count;
- char ch;
-
- /* $<packet info>#<checksum>. */
- do {
- putDebugChar('$');
- checksum = 0;
- count = 0;
-
- while ((ch=buffer[count])) {
- if (! putDebugChar(ch)) return;
- checksum += ch;
- count += 1;
- }
-
- putDebugChar('#');
- putDebugChar(hexchars[checksum >> 4]);
- putDebugChar(hexchars[checksum % 16]);
-
- } while (1 == 0); /* (getDebugChar() != '+'); */
-
-}
-
-char remcomInBuffer[BUFMAX];
-char remcomOutBuffer[BUFMAX];
-static short error;
-
-
-void debug_error(format, parm)
-char * format;
-char * parm;
-{
- return;
-}
-
-/* convert the memory pointed to by mem into hex, placing result in buf */
-/* return a pointer to the last char put in buf (null) */
-char* mem2hex(mem, buf, count)
-char* mem;
-char* buf;
-int count;
-{
- int i;
- unsigned char ch;
- for (i=0;i<count;i++) {
- ch = *mem++;
- *buf++ = hexchars[ch >> 4];
- *buf++ = hexchars[ch % 16];
- }
- *buf = 0;
- return(buf);
-}
-
-/* convert the hex array pointed to by buf into binary to be placed in mem */
-/* return a pointer to the character AFTER the last byte written */
-char* hex2mem(buf, mem, count)
-char* buf;
-char* mem;
-int count;
-{
- int i;
- unsigned char ch;
- for (i=0;i<count;i++) {
- ch = hex(*buf++) << 4;
- ch = ch + hex(*buf++);
- *mem++ = ch;
- }
- return(mem);
-}
-
-/* this function takes the 68000 exception number and attempts to
- translate this number into a unix compatible signal value */
-int computeSignal( exceptionVector )
-int exceptionVector;
-{
- int sigval;
- switch (exceptionVector) {
- case 2 : sigval = 10; break; /* bus error */
- case 3 : sigval = 10; break; /* address error */
- case 4 : sigval = 4; break; /* illegal instruction */
- case 5 : sigval = 8; break; /* zero divide */
- case 6 : sigval = 8; break; /* chk instruction */
- case 7 : sigval = 8; break; /* trapv instruction */
- case 8 : sigval = 11; break; /* privilege violation */
- case 9 : sigval = 5; break; /* trace trap */
- case 10: sigval = 4; break; /* line 1010 emulator */
- case 11: sigval = 4; break; /* line 1111 emulator */
-
- /* Coprocessor protocol violation. Using a standard MMU or FPU
- this cannot be triggered by software. Call it a SIGBUS. */
- case 13: sigval = 10; break;
-
- case 31: sigval = 2; break; /* interrupt */
- case 33: sigval = 5; break; /* breakpoint */
-
- /* This is a trap #8 instruction. Apparently it is someone's software
- convention for some sort of SIGFPE condition. Whose? How many
- people are being screwed by having this code the way it is?
- Is there a clean solution? */
- case 40: sigval = 8; break; /* floating point err */
-
- case 48: sigval = 8; break; /* floating point err */
- case 49: sigval = 8; break; /* floating point err */
- case 50: sigval = 8; break; /* zero divide */
- case 51: sigval = 8; break; /* underflow */
- case 52: sigval = 8; break; /* operand error */
- case 53: sigval = 8; break; /* overflow */
- case 54: sigval = 8; break; /* NAN */
- default:
- sigval = 7; /* "software generated"*/
- }
- return (sigval);
-}
-
-/**********************************************/
-/* WHILE WE FIND NICE HEX CHARS, BUILD AN INT */
-/* RETURN NUMBER OF CHARS PROCESSED */
-/**********************************************/
-int hexToInt(char **ptr, int *intValue)
-{
- int numChars = 0;
- int hexValue;
-
- *intValue = 0;
-
- while (**ptr)
- {
- hexValue = hex(**ptr);
- if (hexValue >=0)
- {
- *intValue = (*intValue <<4) | hexValue;
- numChars ++;
- }
- else
- break;
-
- (*ptr)++;
- }
-
- return (numChars);
-}
-
-/*
- * This function does all command procesing for interfacing to gdb.
- */
-void handle_exception(int exceptionVector)
-{
- int sigval;
- int addr, length;
- char * ptr;
- int newPC;
- Frame *frame;
-
- /* reply to host that an exception has occurred */
- sigval = computeSignal( exceptionVector );
- remcomOutBuffer[0] = 'S';
- remcomOutBuffer[1] = hexchars[sigval >> 4];
- remcomOutBuffer[2] = hexchars[sigval % 16];
- remcomOutBuffer[3] = 0;
-
- putpacket(remcomOutBuffer);
-
- while (1==1) {
- error = 0;
- remcomOutBuffer[0] = 0;
- getpacket(remcomInBuffer);
- switch (remcomInBuffer[0]) {
- case '?' : remcomOutBuffer[0] = 'S';
- remcomOutBuffer[1] = hexchars[sigval >> 4];
- remcomOutBuffer[2] = hexchars[sigval % 16];
- remcomOutBuffer[3] = 0;
- break;
- case 'd' : remote_debug = !(remote_debug); /* toggle debug flag */
- break;
- case 'g' : /* return the value of the CPU registers */
- mem2hex((char*) registers, remcomOutBuffer, NUMREGBYTES);
- break;
- case 'G' : /* set the value of the CPU registers - return OK */
- hex2mem(&remcomInBuffer[1], (char*) registers, NUMREGBYTES);
- db_strcpy(remcomOutBuffer,"OK");
- break;
-
- /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
- case 'm' :
- /* TRY TO READ %x,%x. IF SUCCEED, SET PTR = 0 */
- ptr = &remcomInBuffer[1];
- if (hexToInt(&ptr,&addr))
- if (*(ptr++) == ',')
- if (hexToInt(&ptr,&length))
- {
- ptr = 0;
- mem2hex((char*) addr, remcomOutBuffer, length);
- }
-
- if (ptr)
- {
- db_strcpy(remcomOutBuffer,"E01");
- debug_error("malformed read memory command: %s",remcomInBuffer);
- }
- break;
-
- /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
- case 'M' :
- /* TRY TO READ '%x,%x:'. IF SUCCEED, SET PTR = 0 */
- ptr = &remcomInBuffer[1];
- if (hexToInt(&ptr,&addr))
- if (*(ptr++) == ',')
- if (hexToInt(&ptr,&length))
- if (*(ptr++) == ':')
- {
- hex2mem(ptr, (char*) addr, length);
- ptr = 0;
- db_strcpy(remcomOutBuffer,"OK");
- }
- if (ptr)
- {
- db_strcpy(remcomOutBuffer,"E02");
- debug_error("malformed write memory command: %s",remcomInBuffer);
- }
- break;
-
- /* cAA..AA Continue at address AA..AA(optional) */
- /* sAA..AA Step one instruction from AA..AA(optional) */
- case 'c' :
- case 's' :
- /* try to read optional parameter, pc unchanged if no parm */
- ptr = &remcomInBuffer[1];
- if (hexToInt(&ptr,&addr))
- registers[ PC ] = addr;
-
- newPC = registers[ PC];
-
- /* clear the trace bit */
- registers[ PS ] &= 0x7fff;
-
- /* set the trace bit if we're stepping */
- if (remcomInBuffer[0] == 's') registers[ PS ] |= 0x8000;
-
- /*
- * look for newPC in the linked list of exception frames.
- * if it is found, use the old frame it. otherwise,
- * fake up a dummy frame in returnFromException().
- */
- frame = lastFrame;
- while (frame)
- {
- if (frame->exceptionPC == newPC) break; /* bingo! a match */
- /*
- * for a breakpoint instruction, the saved pc may
- * be off by two due to re-executing the instruction
- * replaced by the trap instruction. Check for this.
- */
- if ((frame->exceptionVector == 33) &&
- (frame->exceptionPC == (newPC+2))) break;
- if (frame == frame->previous)
- {
- frame = 0; /* no match found */
- break;
- }
- frame = frame->previous;
- }
-
- /*
- * If we found a match for the PC AND we are not returning
- * as a result of a breakpoint (33),
- * trace exception (9), nmi (31), jmp to
- * the old exception handler as if this code never ran.
- */
- if (frame)
- {
- if ((frame->exceptionVector != 9) &&
- (frame->exceptionVector != 31) &&
- (frame->exceptionVector != 33))
- {
- /*
- * invoke the previous handler.
- */
- if (oldExceptionHook)
- (*oldExceptionHook) (frame->exceptionVector);
- newPC = registers[ PC ]; /* pc may have changed */
- if (newPC != frame->exceptionPC)
- {
- /* re-use the last frame, we're skipping it (longjump?)*/
- frame = (Frame *) 0;
- _returnFromException( frame ); /* this is a jump */
- }
- }
- }
-
- /* if we couldn't find a frame, create one */
- if (frame == 0)
- {
- frame = lastFrame -1 ;
-
- /* by using a bunch of print commands with breakpoints,
- it's possible for the frame stack to creep down. If it creeps
- too far, give up and reset it to the top. Normal use should
- not see this happen.
- */
- if ((unsigned int) (frame-2) < (unsigned int) &gdbFrameStack)
- {
- initializeRemcomErrorFrame();
- frame = lastFrame;
- }
- frame->previous = lastFrame;
- lastFrame = frame;
- frame = 0; /* null so _return... will properly initialize it */
- }
-
- _returnFromException( frame ); /* this is a jump */
-
- break;
-
- /* kill the program */
- case 'k' : /* do nothing */
- break;
- } /* switch */
-
- /* reply to the request */
- putpacket(remcomOutBuffer);
- }
-}
-
-
-void
-initializeRemcomErrorFrame()
-{
- lastFrame = ((Frame *) &gdbFrameStack[FRAMESIZE-1]) - 1;
- lastFrame->previous = lastFrame;
-}
-
-/* this function is used to set up exception handlers for tracing and
- breakpoints */
-void set_debug_traps()
-{
- extern void _debug_level7();
- extern void remcomHandler();
- int exception;
-
- initializeRemcomErrorFrame();
- stackPtr = &remcomStack[STACKSIZE/sizeof(int) - 1];
-
- for (exception = 2; exception <= 23; exception++)
- set_vector(_catchException,exception,0);
-
- /* level 7 interrupt */
- set_vector(_debug_level7,31,0);
-
- /* breakpoint exception (trap #1) */
- set_vector(_catchException,33,0);
-
- /* This is a trap #8 instruction. Apparently it is someone's software
- convention for some sort of SIGFPE condition. Whose? How many
- people are being screwed by having this code the way it is?
- Is there a clean solution? */
- set_vector(_catchException,40,0);
-
- /* 48 to 54 are floating point coprocessor errors */
- for (exception = 48; exception <= 54; exception++)
- set_vector(_catchException,exception,0);
-
- if (oldExceptionHook != remcomHandler)
- {
- oldExceptionHook = exceptionHook;
- exceptionHook = remcomHandler;
- }
-
- initialized = 1;
-
-}
-
-/* This function will generate a breakpoint exception. It is used at the
- beginning of a program to sync up with a debugger and can be used
- otherwise as a quick means to stop program execution and "break" into
- the debugger. */
-
-void breakpoint()
-{
- if (initialized) BREAKPOINT();
-}
-
diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/setvec.c b/c/src/lib/libbsp/m68k/efi68k/startup/setvec.c
deleted file mode 100644
index 0721b10215..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/startup/setvec.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on the efi68k.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-m68k_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- int *p;
- m68k_isr_entry previous_isr;
-
- if ( type )
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
- else {
- p = (int *)(vector*6-12+2+(int)_VBR);
- previous_isr = (m68k_isr_entry) *p; /* return old ISR */
- *p = (int) handler; /* install new ISR */
- }
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/m68k/efi68k/timer/Makefile.in b/c/src/lib/libbsp/m68k/efi68k/timer/Makefile.in
deleted file mode 100644
index d9e6e84a0c..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/timer/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/efi68k/timer/timer.c b/c/src/lib/libbsp/m68k/efi68k/timer/timer.c
deleted file mode 100644
index 6d4c57942a..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/timer/timer.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* Timer_init()
- *
- * This routine initializes a timer in efi68k's DP8570A TCP
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <bsp.h>
-
-rtems_boolean Timer_driver_Find_average_overhead;
-
-extern rtems_isr Clock_isr();
-
-void Timer_initialize( void )
-{
- /* stop counter */
- *MSR = 0;
- *T0CR = 0;
-
- /*
- * Make sure isr is installed
- */
-
- set_vector( Clock_isr, TCP_ISR_LEVEL+24, 1);
-
- /* clear timer ISR count */
- Timer_interrupts = 0;
-
- /* load count (count down timer) */
- *MSR = 0;
- *T0_MSB = 0xff;
- *T0_LSB = 0xff;
-
- /* clear old interrupts */
- *MSR = T0;
-
- /* enable timer 0 interrupt */
- *MSR = RS;
- *ICR0 |= T0E;
-
- /*
- TSS = 1 starts the timer (timer resets on start)
- M1/0 = 0/1 rate generator
- C2/1/0 = 0/0/0 external clock (8MHz) (1/8 usec resolution)
- RD = 0 read data (latchs count)
- CHG = 0 hold
- */
- *MSR = 0;
- *T0CR = (TSS | M0);
-}
-
-/*
- * The following controls the behavior of Read_timer().
- *
- * FIND_AVG_OVERHEAD * instructs the routine to return the "raw" count.
- *
- * AVG_OVEREHAD is the overhead for starting and stopping the timer. It
- * is usually deducted from the number returned.
- *
- * LEAST_VALID is the lowest number this routine should trust. Numbers
- * below this are "noise" and zero is returned.
- */
-
-#define AVG_OVERHEAD 0 /* It typically takes X.X microseconds */
- /* (Y countdowns) to start/stop the timer. */
- /* This value is in microseconds. */
-#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-
-/*
- * Return timer value in 1/2-microsecond units
- */
-int Read_timer( void )
-{
- rtems_unsigned16 clicks;
- rtems_unsigned32 total;
- rtems_unsigned32 msb, lsb;
-
-
- /*
- * Read the timer and see how many clicks it has been since counter
- * rolled over.
- */
-
- *MSR = 0;
- *T0CR |= RD;
- /* must read MSB first */
- msb = *T0_MSB;
- lsb = *T0_LSB;
- clicks = 0xffff - ((msb << 8) | lsb);
-
- /*
- * Total is calculated by taking into account the number of timer overflow
- * interrupts since the timer was initialized and clicks since the last
- * interrupts.
- */
-
- total = (Timer_interrupts * 0x10000 + clicks + 4)/8; /* in micoseconds */
- /* ^^^ round to nearest int */
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in XXX microsecond units */
-
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
-
- return (total - AVG_OVERHEAD);
-}
-
-
-/*
- * Empty function call used in loops to measure basic cost of looping
- * in Timing Test Suite.
- */
-
-rtems_status_code Empty_function(void)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/m68k/efi68k/times b/c/src/lib/libbsp/m68k/efi68k/times
deleted file mode 100644
index f13320d065..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/times
+++ /dev/null
@@ -1,193 +0,0 @@
-#
-# Timing Test Suite Results for the EFI68k BSP
-#
-# $Id$
-#
-
-NOTE: This BSP is used submitted and no information is currently available.
-
-Board: EFI68k
-CPU: Motorola MC68HC000
-Clock Speed: 16 Mhz
-Memory Configuration: SRAM, DRAM, cache, etc
-Wait States:
-
-Times Reported in: cycles, microseconds, etc
-Timer Source: Count Down Timer, on-CPU cycle counter, etc
-
-Column A: unused
-Column B: unused
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 20
- rtems_semaphore_delete 21
- rtems_semaphore_obtain: available 15
- rtems_semaphore_obtain: not available -- NO_WAIT 15
- rtems_semaphore_release: no waiting tasks 16
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 62
-
- 3 rtems_semaphore_release: task readied -- preempts caller 55
-
- 4 rtems_task_restart: blocked task -- preempts caller 77
- rtems_task_restart: ready task -- preempts caller 70
- rtems_semaphore_release: task readied -- returns to caller 25
- rtems_task_create 57
- rtems_task_start 31
- rtems_task_restart: suspended task -- returns to caller 36
- rtems_task_delete: suspended task 47
- rtems_task_restart: ready task -- returns to caller 37
- rtems_task_restart: blocked task -- returns to caller 46
- rtems_task_delete: blocked task 50
-
- 5 rtems_task_suspend: calling task 51
- rtems_task_resume: task readied -- preempts caller 49
-
- 6 rtems_task_restart: calling task 59
- rtems_task_suspend: returns to caller 18
- rtems_task_resume: task readied -- returns to caller 19
- rtems_task_delete: ready task 50
-
- 7 rtems_task_restart: suspended task -- preempts caller 70
-
- 8 rtems_task_set_priority: obtain current priority 12
- rtems_task_set_priority: returns to caller 27
- rtems_task_mode: obtain current mode 5
- rtems_task_mode: no reschedule 5
- rtems_task_mode: reschedule -- returns to caller 8
- rtems_task_mode: reschedule -- preempts caller 39
- rtems_task_set_note 13
- rtems_task_get_note 13
- rtems_clock_set 33
- rtems_clock_get 3
-
- 9 rtems_message_queue_create 110
- rtems_message_queue_send: no waiting tasks 37
- rtems_message_queue_urgent: no waiting tasks 37
- rtems_message_queue_receive: available 31
- rtems_message_queue_flush: no messages flushed 12
- rtems_message_queue_flush: messages flushed 16
- rtems_message_queue_delete 26
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 15
- rtems_message_queue_receive: not available -- caller blocks 62
-
-11 rtems_message_queue_send: task readied -- preempts caller 72
-
-12 rtems_message_queue_send: task readied -- returns to caller 39
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 72
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 39
-
-15 rtems_event_receive: obtain current events 1
- rtems_event_receive: not available -- NO_WAIT 12
- rtems_event_receive: not available -- caller blocks 56
- rtems_event_send: no task readied 12
- rtems_event_receive: available 12
- rtems_event_send: task readied -- returns to caller 24
-
-16 rtems_event_send: task readied -- preempts caller 55
-
-17 rtems_task_set_priority: preempts caller 62
-
-18 rtems_task_delete: calling task 83
-
-19 rtems_signal_catch 9
- rtems_signal_send: returns to caller 15
- rtems_signal_send: signal to self 18
- exit ASR overhead: returns to calling task 22
- exit ASR overhead: returns to preempting task 49
-
-20 rtems_partition_create 35
- rtems_region_create 23
- rtems_partition_get_buffer: available 15
- rtems_partition_get_buffer: not available 13
- rtems_partition_return_buffer 18
- rtems_partition_delete 16
- rtems_region_get_segment: available 22
- rtems_region_get_segment: not available -- NO_WAIT 21
- rtems_region_return_segment: no waiting tasks 19
- rtems_region_get_segment: not available -- caller blocks 64
- rtems_region_return_segment: task readied -- preempts caller 74
- rtems_region_return_segment: task readied -- returns to caller 44
- rtems_region_delete 16
- rtems_io_initialize 2
- rtems_io_open 1
- rtems_io_close 1
- rtems_io_read 1
- rtems_io_write 1
- rtems_io_control 1
-
-21 rtems_task_ident 149
- rtems_message_queue_ident 145
- rtems_semaphore_ident 156
- rtems_partition_ident 145
- rtems_region_ident 148
- rtems_port_ident 145
- rtems_timer_ident 145
- rtems_rate_monotonic_ident 145
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 42
- rtems_message_queue_broadcast: no waiting tasks 17
- rtems_message_queue_broadcast: task readied -- preempts caller 78
-
-23 rtems_timer_create 14
- rtems_timer_fire_after: inactive 22
- rtems_timer_fire_after: active 24
- rtems_timer_cancel: active 15
- rtems_timer_cancel: inactive 13
- rtems_timer_reset: inactive 21
- rtems_timer_reset: active 23
- rtems_timer_fire_when: inactive 34
- rtems_timer_fire_when: active 34
- rtems_timer_delete: active 19
- rtems_timer_delete: inactive 17
- rtems_task_wake_when 69
-
-24 rtems_task_wake_after: yield -- returns to caller 9
- rtems_task_wake_after: yields -- preempts caller 45
-
-25 rtems_clock_tick 4
-
-26 _ISR_Disable 0
- _ISR_Flash 1
- _ISR_Enable 1
- _Thread_Disable_dispatch 0
- _Thread_Enable_dispatch 7
- _Thread_Set_state 11
- _Thread_Disptach (NO FP) 31
- context switch: no floating point contexts 21
- context switch: self 10
- context switch: to another task 10
- context switch: restore 1st FP task 25
- fp context switch: save idle, restore idle 31
- fp context switch: save idle, restore initialized 19
- fp context switch: save initialized, restore initialized 20
- _Thread_Resume 7
- _Thread_Unblock 7
- _Thread_Ready 9
- _Thread_Get 4
- _Semaphore_Get 2
- _Thread_Get: invalid id 0
-
-27 interrupt entry overhead: returns to interrupted task 6
- interrupt exit overhead: returns to interrupted task 6
- interrupt entry overhead: returns to nested interrupt 6
- interrupt exit overhead: returns to nested interrupt 5
- interrupt entry overhead: returns to preempting task 7
- interrupt exit overhead: returns to preempting task 36
-
-28 rtems_port_create 16
- rtems_port_external_to_internal 11
- rtems_port_internal_to_external 11
- rtems_port_delete 16
-
-29 rtems_rate_monotonic_create 15
- rtems_rate_monotonic_period: initiate period -- returns to caller 21
- rtems_rate_monotonic_period: obtain status 13
- rtems_rate_monotonic_cancel 16
- rtems_rate_monotonic_delete: inactive 18
- rtems_rate_monotonic_delete: active 20
- rtems_rate_monotonic_period: conclude periods -- caller blocks 53
diff --git a/c/src/lib/libbsp/m68k/efi68k/wrapup/Makefile.in b/c/src/lib/libbsp/m68k/efi68k/wrapup/Makefile.in
deleted file mode 100644
index 3ef5e9d4bb..0000000000
--- a/c/src/lib/libbsp/m68k/efi68k/wrapup/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console spurious timer
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/m68k/gen68302/Makefile.in b/c/src/lib/libbsp/m68k/gen68302/Makefile.in
deleted file mode 100644
index e53f5417f5..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SRCS=README
-
-all: $(SRCS)
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include start302 startup clock console timer wrapup
diff --git a/c/src/lib/libbsp/m68k/gen68302/README b/c/src/lib/libbsp/m68k/gen68302/README
deleted file mode 100644
index 0261083479..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/README
+++ /dev/null
@@ -1,154 +0,0 @@
-#
-# $Id$
-#
-
-BSP NAME: gen68302
-BOARD: proprietary (see below for relevant information)
-BUS: none
-CPU FAMILY: MC68000
-COPROCESSORS: 68302 communications co-processor
-MODE: not applicable
-
-DEBUG MONITOR: none
-
-PERIPHERALS
-===========
-TIMERS: two 68302 timers, one 68302 watchdog timer
- RESOLUTION: ?
-SERIAL PORTS: three 68302 SCCs
-REAL-TIME CLOCK:
-DMA: built-in 68302, not used
-VIDEO: none
-SCSI: none
-NETWORKING: none
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: 68302 (TIMER1)
-IOSUPP DRIVER: 68302 SCC2
-SHMSUPP: none
-TIMER DRIVER: 68302 TIMER2
-
-STDIO
-=====
-PORT: ?
-ELECTRICAL: EIA-232
-BAUD: 9600
-BITS PER CHARACTER: 8
-PARITY: None
-STOP BITS: 1
-
-NOTES
-=====
-
-Board description
------------------
-clock rate: 16 MHz
-bus width: 16 bits
-ROM: 128 kbyte (flash, 0 wait states, chip select 0)
-RAM: 256 kbyte (static, 0 wait states, chip select 1)
-
-The 68302's built-in DRAM refresh controller circuitry is neither used
-nor configured at startup.
-
-Host System
------------
-HP 9000/715, HP-UX 9.05
-gcc-2.6.3
-binutils-2.5.2
-
-
-Verification
-------------
-The 1-ms clock ISR rate was verified with an in-circuit emulator.
-
-Single processor tests:
-Multi-processort tests: not applicable
-Timing tests: see results in c/src/tests/tmtests/times
-
-Note: The board has 256 kbyte RAM, so the timing tests would not run
-with the standard executive RAM size configuration of 256 K.
-Modifying the conftbl.h files to specify 160 kbyte for workspace
-seemed to work.
-
-* Porting
-
-** Mod c/src/tests/tmtests/*/conftbl.h
-
-Modified to use 160 kbyte for executive RAM size.
-
-** Add c/make/custom/gen68302.cfg
-
-Based on m68k_no_bsp.cfg. Turned off multiprocessor support. Had to
-use a BSP-specific compiler configuration file in order to link the
-proper startup file.
-
-** Mod c/make/compilers/gcc-m68000.cfg
-
-Added "-m68000" to the AS macro so that non-68000 instructions are
-neither generated nor allowed (remember that the GNU assembler
-supports pseudo-assembler instructions (e.g. jbsr) that will be
-"intelligently" assembled.) Added "m68000/" before libgcc.a so that
-non-68000 instructions aren't included.
-
-** Add c/make/compilers/gcc-gen68302.cfg
-
-Based on modified gcc-m68000.cfg.
-
-Changed make-exe define to produce IEEE-695 output files for loading
-into the emulator.
-
-The board has no debug monitor, so I had to create a 68302-specific
-startup file (c/src/lib/libbsp/m68k/gen68302/start302/start302.s) to
-override the c/src/lib/start/m68k/start.s. START_FILE entry was
-modified to causes start302.s to be linked first (in lieu of start.s).
-
-** Mod c/src/exec/cpu/m68k/cpu.h
-
-Turned off software and hardware interrupt stack support. Added
-support in _CPU_Bitfield_Find_first_bit() and
-_CPU_Priority_Bits_index() to replace the bfffo instruction.
-
-TODO: add software-maintained interrupt stack.
-
-TODO: optimize things so that subtracting _priority from 15 isn't
-required in _CPU_Priority_Bits_index().
-
-** Mod c/src/exec/cpu/m68k/cpu.c
-
-Added the log base 2 table (__log2table) that's required by the BFFFO
-replacement in cpu.h.
-
-** Mod c/src/exec/cpu/m68k/cpu_asm.s
-
-Added _ISR_Exit that's currently used in TBD.... Added ifdef wrapper
-around ISR exit code that accessed the format nibble. Added some code
-to restore the status register and call _Thread_Dispatch.
-
-TODO: add software-maintained interrupt stack.
-
-** Mod c/src/exec/cpu/m68k/m68k.h
-
-Changed "typedef char signed8" to "typedef signed char signed8".
-
-** Add c/src/lib/libbsp/m68k/gen68302/...
-*** clock/
-
-TODO: Add set_vector support. Figure out what to do with Clock_exit().
-TODO: Pre-compute (BSP_Configuration.microseconds_per_tick/1000) so that
-it doesn't have to be re-computed on each Clock_isr().
-
-*** console/
-
-These files assume SCC2, but it shouldn't be too difficult to re-write
-these to use any of the other SCCs.
-
-*** include/
-*** start302/
-
-This contains the start302.s file that does some fairly tricky memory
-re-mapping so that RAM ends up at 0 and ROM ends up at 0xc00000.
-
-*** startup/
-*** timer/
-*** wrapup/
diff --git a/c/src/lib/libbsp/m68k/gen68302/bsp_specs b/c/src/lib/libbsp/m68k/gen68302/bsp_specs
deleted file mode 100644
index 110e993dc5..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start302.o%s} \
-%{qrtems_debug: start302_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/m68k/gen68302/clock/Makefile.in b/c/src/lib/libbsp/m68k/gen68302/clock/Makefile.in
deleted file mode 100644
index 59df4f2702..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/clock/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/gen68302/clock/ckinit.c b/c/src/lib/libbsp/m68k/gen68302/clock/ckinit.c
deleted file mode 100644
index d3c1d324f1..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/clock/ckinit.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/* Clock_init()
- *
- * This routine initializes Timer 1 for an MC68302.
- * The tick frequency is 1 millisecond.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdlib.h> /* for atexit() */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include "m68302.h"
-
-#define CLOCK_VECTOR 137
-
-#define TMR1_VAL ( RBIT_TMR_RST /* software reset the timer */\
- | RBIT_TMR_ICLK_MASTER16 /* master clock divided by 16 */\
- | RBIT_TMR_FRR /* restart timer after ref reached */\
- | RBIT_TMR_ORI) /* enable interrupt when ref reached */
-#define TRR1_VAL 1000 /* 1000 ticks @ 16MHz/16
- * = 1 millisecond tick.
- */
-
-/*
- * Clock_driver_ticks is a monotonically increasing counter of the
- * number of clock ticks since the driver was initialized.
- */
-volatile rtems_unsigned32 Clock_driver_ticks;
-
-/*
- * Clock_isrs is the number of clock ISRs until the next invocation of
- * the RTEMS clock tick routine. The clock tick device driver
- * gets an interrupt once a millisecond and counts down until the
- * length of time between the user configured microseconds per tick
- * has passed.
- */
-rtems_unsigned32 Clock_isrs;
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-/*
- * ISR Handler
- */
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
- Clock_driver_ticks += 1;
-
- m302.reg.isr = RBIT_ISR_TIMER1; /* clear in-service bit */
- m302.reg.ter1 = (RBIT_TER_REF | RBIT_TER_CAP); /* clear timer intr request */
-
- if ( Clock_isrs == 1 ) {
- rtems_clock_tick();
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
- }
- else
- Clock_isrs -= 1;
-}
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
-
- Clock_driver_ticks = 0;
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- set_vector( clock_isr, CLOCK_VECTOR, 1 );
-
- m302.reg.trr1 = TRR1_VAL; /* set timer reference register */
- m302.reg.tmr1 = TMR1_VAL; /* set timer mode register & enable */
- /*
- * Enable TIMER1 interrupts only.
- */
- m302.reg.imr = RBIT_IMR_TIMER1; /* set 68302 int-mask to allow ints */
-
- atexit( Clock_exit );
- }
-}
-
-void Clock_exit( void )
-{
- if ( BSP_Configuration.ticks_per_timeslice ) {
- /* TODO: figure out what to do here */
- /* do not restore old vector */
- }
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr( CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libbsp/m68k/gen68302/console/Makefile.in b/c/src/lib/libbsp/m68k/gen68302/console/Makefile.in
deleted file mode 100644
index fd05ddfedd..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/gen68302/console/console.c b/c/src/lib/libbsp/m68k/gen68302/console/console.c
deleted file mode 100644
index be399e1b76..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/console/console.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Initialize the MC68302 SCC2 for console IO board support package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 GEN68302_INIT
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include "m68302.h"
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
- volatile m302_dualPortRAM_t *p = &m302;
-
- p->reg.pacnt |= 0x0003; /* enable RXD2 and TXD2 signals */
- /*
- * TODO: Check assembly code. I think gcc's volatile semantics force
- * this to not use a CLR.
- */
- p->reg.simode = 0; /* NMSI mode */
-
- p->reg.scc[1].scon = 0x00d8; /* 9600 baud */
- p->reg.scc[1].scm = 0x01b1;
-
- p->scc2.parm.rfcr = 0x50; /* Rx buffers in supervisor data */
- p->scc2.parm.tfcr = 0x50; /* Tx buffers in supervisor data */
- p->scc2.parm.mrblr = 0x0001; /* Max Rx buffer length is 1 byte */
-
- p->scc2.prot.uart.max_idl = 0x0000; /* 0 = maximum timeout value */
- p->scc2.prot.uart.brkcr = 0x0001; /* send 1 break char on STOP TX cmd */
- p->scc2.prot.uart.parec = 0x0000; /* reset parity error counter */
- p->scc2.prot.uart.frmec = 0x0000; /* reset framing error counter */
- p->scc2.prot.uart.nosec = 0x0000; /* reset noise error counter */
- p->scc2.prot.uart.brkec = 0x0000; /* reset break condition counter */
-
- p->scc2.prot.uart.character[0] = 0x0003; /* use <ctrl>c as control char */
- p->scc2.prot.uart.character[1] = 0x8000; /* set end of cntrl char table */
-
- p->scc2.bd.rx[0].status = 0xA000; /* RxBD0 empty, wrap, no intr */
- p->scc2.bd.rx[0].length = 0x0000;
- p->scc2.bd.rx[0].buffer =
- (rtems_unsigned8 *) &m302.scc2.bd.rx[1]; /* RxBD1 is Rx buffer */
-
- p->reg.scc[1].dsr = 0x7000; /* set full-length last stop bit */
-
- p->scc2.bd.tx[0].status = 0x3000; /* TxBD0 not ready, wrap, intr */
- p->scc2.bd.tx[0].length = 0x0001;
- p->scc2.bd.tx[0].buffer =
- (rtems_unsigned8 *) &m302.scc2.bd.tx[1]; /* TxBD1 is Tx buffer */
-
- p->reg.scc[1].scce = 0xFF; /* clear all SCC event flags */
- p->reg.scc[1].sccm = 0x03; /* enable only Tx & Rx interrupts */
- p->reg.scc[1].scm = 0x01BD;
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-
-}
-
-/* is_character_ready
- *
- * Check to see if a character is available on the MC68302's SCC2. If so,
- * then return a TRUE (along with the character). Otherwise return FALSE.
- *
- * Input parameters: pointer to location in which to return character
- *
- * Output parameters: character (if available)
- *
- * Return values: TRUE - character available
- * FALSE - no character available
- */
-
-rtems_boolean is_character_ready(
- char *ch /* -> character */
-)
-{
-#define RXS (m302.scc2.bd.rx[0].status)
-#define RXD (* ((volatile char *) m302.scc2.bd.rx[0].buffer))
-
- for (;;) {
- if (RXS & RBIT_HDLC_EMPTY_BIT)
- return FALSE;
-
- *ch = RXD;
- RXS = RBIT_HDLC_EMPTY_BIT | RBIT_HDLC_WRAP_BIT;
- if ( *ch >= ' ' && *ch <= '~' )
- return TRUE;
- }
-}
-
-
-/* inbyte
- *
- * Receive a character from the MC68302's SCC2.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: character read
- */
-
-char inbyte( void )
-{
- char ch;
-
-#define RXS (m302.scc2.bd.rx[0].status)
-#define RXD (* ((volatile char *) m302.scc2.bd.rx[0].buffer))
-
- do {
- while (RXS & RBIT_HDLC_EMPTY_BIT)
- /* Wait until character received */ ;
-
- ch = RXD;
- RXS = RBIT_HDLC_EMPTY_BIT | RBIT_HDLC_WRAP_BIT;
-
- if (ch == '\r' || ch == '\n')
- break;
- } while (ch < ' ' || ch > '~');
-
- return ch;
-}
-
-
-/* outbyte
- *
- * Transmit a character out on the MC68302's SCC2.
- * It may support XON/XOFF flow control.
- *
- * Input parameters:
- * ch - character to be transmitted
- *
- * Output parameters: NONE
- */
-
-void outbyte(
- char ch
-)
-{
-#define TXS (m302.scc2.bd.tx[0].status)
-#define TXD (* ((volatile char *) m302.scc2.bd.tx[0].buffer))
-
-#define RXS (m302.scc2.bd.rx[0].status)
-#define RXD (* ((volatile char *) m302.scc2.bd.rx[0].buffer))
-
- while (TXS & RBIT_HDLC_READY_BIT)
- /* Wait until okay to transmit */ ;
-
- /*
- * Check for flow control requests and process.
- */
- while ( ! (RXS & RBIT_HDLC_EMPTY_BIT)) {
- if (RXD == XOFF)
- do {
- RXS = RBIT_HDLC_EMPTY_BIT | RBIT_HDLC_WRAP_BIT;
- while (RXS & RBIT_HDLC_EMPTY_BIT)
- /* Wait until character received */ ;
- } while (RXD != XON);
- RXS = RBIT_HDLC_EMPTY_BIT | RBIT_HDLC_WRAP_BIT;
- }
-
- TXD = ch;
- TXS = RBIT_HDLC_READY_BIT | RBIT_HDLC_WRAP_BIT;
- if (ch == '\n')
- outbyte('\r');
-}
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte();
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r');
- }
- outbyte( buffer[ count ] );
- }
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/m68k/gen68302/include/Makefile.in b/c/src/lib/libbsp/m68k/gen68302/include/Makefile.in
deleted file mode 100644
index 7d8581095f..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/m68k/gen68302/include/bsp.h b/c/src/lib/libbsp/m68k/gen68302/include/bsp.h
deleted file mode 100644
index 8c97c0891a..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/include/bsp.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* bsp.h
- *
- * This include file contains all board IO definitions.
- *
- * XXX : put yours in here
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __GEN68302_BSP_h
-#define __GEN68302_BSP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <console.h>
-#include <iosupp.h>
-#include <clockdrv.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Stuff for Time Test 27
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), 0, 1 )
-
-#define Cause_tm27_intr()
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( microseconds ) \
- { register rtems_unsigned32 _delay=(microseconds); \
- register rtems_unsigned32 _tmp=123; \
- asm volatile( "0: \
- nbcd %0 ; \
- nbcd %0 ; \
- dbf %1,0b" \
- : "=d" (_tmp), "=d" (_delay) \
- : "0" (_tmp), "1" (_delay) ); \
- }
-
-/* Constants */
-
-#define RAM_START 0
-#define RAM_END 0x040000
-
-/* Structures */
-
-#ifdef GEN68302_INIT
-#undef EXTERN
-#define EXTERN
-#else
-#undef EXTERN
-#define EXTERN extern
-#endif
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-extern m68k_isr_entry M68Kvec[]; /* vector table address */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-m68k_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/gen68302/include/coverhd.h b/c/src/lib/libbsp/m68k/gen68302/include/coverhd.h
deleted file mode 100644
index ba73b40ff5..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/include/coverhd.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- * This file should be updated after running the C overhead timing
- * test. Once this update has been performed, the RTEMS Time Test
- * Suite should be rebuilt to account for these overhead times in the
- * timing results.
- *
- * NOTE: If these are all zero, then the times reported include
- * all calling overhead including passing of arguments.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 14
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 11
-#define CALLING_OVERHEAD_TASK_CREATE 22
-#define CALLING_OVERHEAD_TASK_IDENT 17
-#define CALLING_OVERHEAD_TASK_START 18
-#define CALLING_OVERHEAD_TASK_RESTART 15
-#define CALLING_OVERHEAD_TASK_DELETE 12
-#define CALLING_OVERHEAD_TASK_SUSPEND 12
-#define CALLING_OVERHEAD_TASK_RESUME 12
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 16
-#define CALLING_OVERHEAD_TASK_MODE 15
-#define CALLING_OVERHEAD_TASK_GET_NOTE 16
-#define CALLING_OVERHEAD_TASK_SET_NOTE 16
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 31
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 11
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 17
-#define CALLING_OVERHEAD_CLOCK_GET 32
-#define CALLING_OVERHEAD_CLOCK_SET 31
-#define CALLING_OVERHEAD_CLOCK_TICK 8
-
-#define CALLING_OVERHEAD_TIMER_CREATE 13
-#define CALLING_OVERHEAD_TIMER_IDENT 12
-#define CALLING_OVERHEAD_TIMER_DELETE 14
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 19
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 39
-#define CALLING_OVERHEAD_TIMER_RESET 12
-#define CALLING_OVERHEAD_TIMER_CANCEL 12
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 18
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 12
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 17
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 17
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 12
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 18
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 17
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 12
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 14
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 14
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 17
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 19
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 14
-
-#define CALLING_OVERHEAD_EVENT_SEND 15
-#define CALLING_OVERHEAD_EVENT_RECEIVE 18
-#define CALLING_OVERHEAD_SIGNAL_CATCH 14
-#define CALLING_OVERHEAD_SIGNAL_SEND 14
-#define CALLING_OVERHEAD_PARTITION_CREATE 23
-#define CALLING_OVERHEAD_PARTITION_IDENT 17
-#define CALLING_OVERHEAD_PARTITION_DELETE 12
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 15
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 15
-#define CALLING_OVERHEAD_REGION_CREATE 23
-#define CALLING_OVERHEAD_REGION_IDENT 14
-#define CALLING_OVERHEAD_REGION_DELETE 12
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 21
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 15
-#define CALLING_OVERHEAD_PORT_CREATE 20
-#define CALLING_OVERHEAD_PORT_IDENT 14
-#define CALLING_OVERHEAD_PORT_DELETE 12
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 18
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 18
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 18
-#define CALLING_OVERHEAD_IO_OPEN 18
-#define CALLING_OVERHEAD_IO_CLOSE 18
-#define CALLING_OVERHEAD_IO_READ 18
-#define CALLING_OVERHEAD_IO_WRITE 18
-#define CALLING_OVERHEAD_IO_CONTROL 18
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 11
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 13
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 14
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 12
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 12
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 14
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 8
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/gen68302/start/Makefile.in b/c/src/lib/libbsp/m68k/gen68302/start/Makefile.in
deleted file mode 100644
index d96348b19d..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/start/Makefile.in
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/start302.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start302
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
diff --git a/c/src/lib/libbsp/m68k/gen68302/start/start302.s b/c/src/lib/libbsp/m68k/gen68302/start/start302.s
deleted file mode 100644
index 2a7c652c87..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/start/start302.s
+++ /dev/null
@@ -1,267 +0,0 @@
-/* entry.s
- *
- * This file contains the entry point for the application.
- * The name of this entry point is compiler dependent.
- * It jumps to the BSP which is responsible for performing
- * all initialization.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-
- .set BAR, 0xF2 | Base Address Register location
- .set SCR, 0xF4 | System Control Register location
- .set BAR_VAL, 0x0f7f | BAR value
- .set SCR_VAL, 0x00080f00 | SCR value
- .set GIMR_VAL, 0x8780 |Global Interrupt Mode Register. (MUST BE WRITTEN).
- .set BaseAddr,(BAR_VAL&0x0fff)<<12 | MC68302 internal base address
-
- .set oSYSRAM, 0x000 | 576 bytes of internal system RAM
-
- .set oGIMR, 0x812
-
- .set oCS0_Base, 0x830 | 16 bits, Chip Sel 0 Base Reg
- .set oCS0_Option, 0x832 | 16 bits, Chip Sel 0 Option Reg
- .set oCS1_Base, 0x834 | 16 bits, Chip Sel 1 Base Reg
- .set oCS1_Option, 0x836 | 16 bits, Chip Sel 1 Option Reg
- .set oCS2_Base, 0x838 | 16 bits, Chip Sel 2 Base Reg
- .set oCS2_Option, 0x83a | 16 bits, Chip Sel 2 Option Reg
- .set oCS3_Base, 0x83c | 16 bits, Chip Sel 3 Base Reg
- .set oCS3_Option, 0x83e | 16 bits, Chip Sel 3 Option Reg
-
- .set tmpSRAM_BASE, 0x400000 | start of temporary SRAM
- .set FLASH_BASE, 0xc00000 | start of FLASH''s normal location
-
-
-BEGIN_CODE
- PUBLIC (M68Kvec) | Vector Table
-SYM (M68Kvec): | standard location for vectors
-V___ISSP: .long 0x00001000 |00 0 Reset: Initial SSP
-V____IPC: .long SYM(start)-V___ISSP |04 1 Reset: Initial PC
-V_BUSERR: .long Bad-V___ISSP |08 2 Bus Error
-V_ADRERR: .long Bad-V___ISSP |0c 3 Address Error
- .space 240 | reserve space for reset of vectors
-
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
-SYM (lowintstack):
- .space 4092 | reserve for interrupt stack
-SYM (hiintstack):
- .space 4 | end of interrupt stack
-#endif
-
- PUBLIC (start) | Default entry point for GNU
-SYM (start):
- move.w #0x2700,sr | Disable all interrupts
- move.w #BAR_VAL,BAR | Set Base Address Register
- move.l #SCR_VAL,SCR | Set System Control Register
- lea BaseAddr,a5
- move.w #GIMR_VAL,a5@(oGIMR) | Set Global Interrupt Mode Register
-
-|
-| Set up chip select registers for the remapping process.
-|
-
-|
-| 0 X x x x x
-| 0 000 0 0-- - --- ---- ---- ----
-| x xxx x xxx x xx
-|
- move.w #0xc001,a5@(oCS0_Base) | Expand CS0 to full size (FLASH)
- move.w #0x1f82,a5@(oCS0_Option) | 000000-03ffff, R, 0 WS
-
-|
-| X x x x x x
-| 0 100 0 0-- - --- ---- ---- ----
-| x xxx x xxx x xx
-|
- move.w #0xa801,a5@(oCS1_Base) | Set up and enable CS1 (SRAM)
- move.w #0x1f80,a5@(oCS1_Option) | 400000-43ffff, RW, 0 WS
-
-|
-| Copy the initial boot FLASH area to the temporary SRAM location.
-|
- moveq #0,d0
- movea.l d0,a0 | a0 -> start of FLASH
- lea tmpSRAM_BASE,a1 | a1 -> start of tmp SRAM
-| moveq #(endPreBoot-V___ISSP)/4,d0 | # longs to copy
- moveq #127,d0
-cpy_flash: move.l (a0)+,(a1)+ | copy
- subq.l #1,d0
- bne cpy_flash
-
-|
-| Copy remap code to 68302''s internal system RAM.
-|
- movea.w #begRemap-V___ISSP,a0 | a0 -> remap code
- lea a5@(oSYSRAM),a1 | a1 -> internal system RAM
-| moveq #(endRemap-begRemap)/2-1,d0 | d0 = # words to copy
- moveq #11,d0
-cpy_remap: move.w (a0)+,(a1)+ | copy
- dbra d0,cpy_remap
-
-|
-| Jump to the remap code in the 68302''s internal system RAM.
-|
- jmp a5@(oSYSRAM) | (effectively a jmp begRemap)
-
-|
-| This remap code, when executed from the 68302''s internal system RAM
-| will 1) remap CS1 so that SRAM is at 0
-| 2) remap CS0 so that FLASH is at FLASH_BASE
-| and 3) jump to executable code in the remapped FLASH.
-|
-begRemap: move.w #0xa001,a5@(oCS1_Base) | Move CS1 (SRAM)
- move.w #0xd801,a5@(oCS0_Base) | Move CS0 (FLASH)
- lea FLASH_BASE,a0
- jmp a0@(endRemap-V___ISSP.w) | Jump back to FLASH
-endRemap:
-|
-| Now set up the remaining chip select registers.
-|
-
-|
-| 4 0 x x x x
-| 1 000 1 111 0 000 0--- ---- ----
-| x xxx x xxx x xx
-|
- move.w #0xb1e1,a5@(oCS2_Base) | Set up and enable CS2 (dpRAM)
- move.w #0x1ff0,a5@(oCS2_Option) | 8f0000-8f07ff, RW, 0 WS
-
-|
-| 8 X x x x x
-| 1 000 0 0-- - --- ---- ---- ----
-| x xxx x xxx x xx
-|
- move.w #0xd001,a5@(oCS3_Base) | Set up and enable CS3 (IO)
- move.w #0x1f80,a5@(oCS3_Option) | 800000-83ffff, RW, 0 WS
-
-endPreBoot:
-
- move.b #0x30,0x800001 | set status LED amber
-
- .set oPIOB_Ctrl, 0x824
- .set oPIOB_DDR, 0x826
- .set oPIOB_Data, 0x828
-
- .set oPIOA_Ctrl, 0x81e
- .set oPIOA_DDR, 0x820
- .set oPIOA_Data, 0x822
-
- move.w #0x0ff8,a5@(oPIOB_Data) | Make output follow resistors.
- move.w #0x00ff,a5@(oPIOB_DDR) | Set up PB7-PB0 for output.
- move.w #0x0080,a5@(oPIOB_Ctrl) | Set up WDOG* as dedicated
- | peripheral pins.
-
- move.w #0x1fff,a5@(oPIOA_Data) | Make output follow resistors.
- move.w #0xea2a,a5@(oPIOA_DDR) | Set up PA15-PA0 for in/output.
- move.w #0x0003,a5@(oPIOA_Ctrl) | Set up TXD2/RXD2 as dedicated
- | peripheral pins.
-
-|
-| Place "Bad" in all vectors from 010 thru 0ec. Vectors 0f0 and 0f4
-| are not set because they are the 68302''s BAR and SCR.
-|
- movea.w #0x010,a0
- moveq #(0x0f0-0x010)/4-1,d0
- move.l #Bad,d1
-cpy_Bad: move.l d1,(a0)+
- dbra d0,cpy_Bad
-
- .set vbase, 0x0200
-
- lea vbase,a0
- moveq #31,d0
-cpy_Bad1: move.l d1,(a0)+
- dbra d0,cpy_Bad1
-
-|
-| Fill in special locations to configure OS
-|
- move.l #Bad,0x008 | Bus Error
- move.l #Bad,0x00c | Address Error
- move.l #Bad,0x024 | Trace
-| move.l #KE_IRET,$0b4 | pSOS+ RET_I Call
-
-| move.l #_cnsl_isr,vbase+0x028 | SCC2
- move.l #timerisr,vbase+0x018 | Timer ISR
-
- |
- | zero out uninitialized data area
- |
-zerobss:
- moveal # SYM (end),a0 | find end of .bss
- moveal # SYM (bss_start),a1 | find beginning of .bss
- moveq #0,d0
-
-loop: movel d0,a1@+ | to zero out uninitialized
- cmpal a0,a1
- jlt loop | loop until _end reached
-
- movel # SYM (end),d0 | d0 = end of bss/start of heap
- addl # SYM (heap_size),d0 | d0 = end of heap
- movel d0, SYM (stack_start) | Save for brk() routine
- addl # SYM (stack_size),d0 | make room for stack
- andl #0xffffffc0,d0 | align it on 16 byte boundary
- movw #0x3700,sr | SUPV MODE,INTERRUPTS OFF!!!
- movel d0,a7 | set master stack pointer
- movel d0,a6 | set base pointer
-
- /*
- * RTEMS should maintain a separate interrupt stack on CPUs
- * without one in hardware. This is currently not supported
- * on versions of the m68k without a HW intr stack.
- */
-
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
- lea SYM (hiintstack),a0 | a0 = high end of intr stack
- movec a0,isp | set interrupt stack
-#endif
-
- move.l #0,a7@- | environp
- move.l #0,a7@- | argv
- move.l #0,a7@- | argc
- jsr SYM (boot_card)
-
- nop
-Bad: bra Bad
-
- nop
-END_CODE
-
-
-BEGIN_DATA
-
- PUBLIC (start_frame)
-SYM (start_frame):
- .space 4,0
-
- PUBLIC (stack_start)
-SYM (stack_start):
- .space 4,0
-END_DATA
-
-BEGIN_BSS
-
- PUBLIC (environ)
- .align 2
-SYM (environ):
- .long 0
-
- PUBLIC (heap_size)
- .set SYM (heap_size),0x2000
-
- PUBLIC (stack_size)
- .set SYM (stack_size),0x1000
-
-
-END_DATA
-END
diff --git a/c/src/lib/libbsp/m68k/gen68302/start302/Makefile.in b/c/src/lib/libbsp/m68k/gen68302/start302/Makefile.in
deleted file mode 100644
index d96348b19d..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/start302/Makefile.in
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/start302.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start302
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
diff --git a/c/src/lib/libbsp/m68k/gen68302/start302/start302.s b/c/src/lib/libbsp/m68k/gen68302/start302/start302.s
deleted file mode 100644
index 2a7c652c87..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/start302/start302.s
+++ /dev/null
@@ -1,267 +0,0 @@
-/* entry.s
- *
- * This file contains the entry point for the application.
- * The name of this entry point is compiler dependent.
- * It jumps to the BSP which is responsible for performing
- * all initialization.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-
- .set BAR, 0xF2 | Base Address Register location
- .set SCR, 0xF4 | System Control Register location
- .set BAR_VAL, 0x0f7f | BAR value
- .set SCR_VAL, 0x00080f00 | SCR value
- .set GIMR_VAL, 0x8780 |Global Interrupt Mode Register. (MUST BE WRITTEN).
- .set BaseAddr,(BAR_VAL&0x0fff)<<12 | MC68302 internal base address
-
- .set oSYSRAM, 0x000 | 576 bytes of internal system RAM
-
- .set oGIMR, 0x812
-
- .set oCS0_Base, 0x830 | 16 bits, Chip Sel 0 Base Reg
- .set oCS0_Option, 0x832 | 16 bits, Chip Sel 0 Option Reg
- .set oCS1_Base, 0x834 | 16 bits, Chip Sel 1 Base Reg
- .set oCS1_Option, 0x836 | 16 bits, Chip Sel 1 Option Reg
- .set oCS2_Base, 0x838 | 16 bits, Chip Sel 2 Base Reg
- .set oCS2_Option, 0x83a | 16 bits, Chip Sel 2 Option Reg
- .set oCS3_Base, 0x83c | 16 bits, Chip Sel 3 Base Reg
- .set oCS3_Option, 0x83e | 16 bits, Chip Sel 3 Option Reg
-
- .set tmpSRAM_BASE, 0x400000 | start of temporary SRAM
- .set FLASH_BASE, 0xc00000 | start of FLASH''s normal location
-
-
-BEGIN_CODE
- PUBLIC (M68Kvec) | Vector Table
-SYM (M68Kvec): | standard location for vectors
-V___ISSP: .long 0x00001000 |00 0 Reset: Initial SSP
-V____IPC: .long SYM(start)-V___ISSP |04 1 Reset: Initial PC
-V_BUSERR: .long Bad-V___ISSP |08 2 Bus Error
-V_ADRERR: .long Bad-V___ISSP |0c 3 Address Error
- .space 240 | reserve space for reset of vectors
-
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
-SYM (lowintstack):
- .space 4092 | reserve for interrupt stack
-SYM (hiintstack):
- .space 4 | end of interrupt stack
-#endif
-
- PUBLIC (start) | Default entry point for GNU
-SYM (start):
- move.w #0x2700,sr | Disable all interrupts
- move.w #BAR_VAL,BAR | Set Base Address Register
- move.l #SCR_VAL,SCR | Set System Control Register
- lea BaseAddr,a5
- move.w #GIMR_VAL,a5@(oGIMR) | Set Global Interrupt Mode Register
-
-|
-| Set up chip select registers for the remapping process.
-|
-
-|
-| 0 X x x x x
-| 0 000 0 0-- - --- ---- ---- ----
-| x xxx x xxx x xx
-|
- move.w #0xc001,a5@(oCS0_Base) | Expand CS0 to full size (FLASH)
- move.w #0x1f82,a5@(oCS0_Option) | 000000-03ffff, R, 0 WS
-
-|
-| X x x x x x
-| 0 100 0 0-- - --- ---- ---- ----
-| x xxx x xxx x xx
-|
- move.w #0xa801,a5@(oCS1_Base) | Set up and enable CS1 (SRAM)
- move.w #0x1f80,a5@(oCS1_Option) | 400000-43ffff, RW, 0 WS
-
-|
-| Copy the initial boot FLASH area to the temporary SRAM location.
-|
- moveq #0,d0
- movea.l d0,a0 | a0 -> start of FLASH
- lea tmpSRAM_BASE,a1 | a1 -> start of tmp SRAM
-| moveq #(endPreBoot-V___ISSP)/4,d0 | # longs to copy
- moveq #127,d0
-cpy_flash: move.l (a0)+,(a1)+ | copy
- subq.l #1,d0
- bne cpy_flash
-
-|
-| Copy remap code to 68302''s internal system RAM.
-|
- movea.w #begRemap-V___ISSP,a0 | a0 -> remap code
- lea a5@(oSYSRAM),a1 | a1 -> internal system RAM
-| moveq #(endRemap-begRemap)/2-1,d0 | d0 = # words to copy
- moveq #11,d0
-cpy_remap: move.w (a0)+,(a1)+ | copy
- dbra d0,cpy_remap
-
-|
-| Jump to the remap code in the 68302''s internal system RAM.
-|
- jmp a5@(oSYSRAM) | (effectively a jmp begRemap)
-
-|
-| This remap code, when executed from the 68302''s internal system RAM
-| will 1) remap CS1 so that SRAM is at 0
-| 2) remap CS0 so that FLASH is at FLASH_BASE
-| and 3) jump to executable code in the remapped FLASH.
-|
-begRemap: move.w #0xa001,a5@(oCS1_Base) | Move CS1 (SRAM)
- move.w #0xd801,a5@(oCS0_Base) | Move CS0 (FLASH)
- lea FLASH_BASE,a0
- jmp a0@(endRemap-V___ISSP.w) | Jump back to FLASH
-endRemap:
-|
-| Now set up the remaining chip select registers.
-|
-
-|
-| 4 0 x x x x
-| 1 000 1 111 0 000 0--- ---- ----
-| x xxx x xxx x xx
-|
- move.w #0xb1e1,a5@(oCS2_Base) | Set up and enable CS2 (dpRAM)
- move.w #0x1ff0,a5@(oCS2_Option) | 8f0000-8f07ff, RW, 0 WS
-
-|
-| 8 X x x x x
-| 1 000 0 0-- - --- ---- ---- ----
-| x xxx x xxx x xx
-|
- move.w #0xd001,a5@(oCS3_Base) | Set up and enable CS3 (IO)
- move.w #0x1f80,a5@(oCS3_Option) | 800000-83ffff, RW, 0 WS
-
-endPreBoot:
-
- move.b #0x30,0x800001 | set status LED amber
-
- .set oPIOB_Ctrl, 0x824
- .set oPIOB_DDR, 0x826
- .set oPIOB_Data, 0x828
-
- .set oPIOA_Ctrl, 0x81e
- .set oPIOA_DDR, 0x820
- .set oPIOA_Data, 0x822
-
- move.w #0x0ff8,a5@(oPIOB_Data) | Make output follow resistors.
- move.w #0x00ff,a5@(oPIOB_DDR) | Set up PB7-PB0 for output.
- move.w #0x0080,a5@(oPIOB_Ctrl) | Set up WDOG* as dedicated
- | peripheral pins.
-
- move.w #0x1fff,a5@(oPIOA_Data) | Make output follow resistors.
- move.w #0xea2a,a5@(oPIOA_DDR) | Set up PA15-PA0 for in/output.
- move.w #0x0003,a5@(oPIOA_Ctrl) | Set up TXD2/RXD2 as dedicated
- | peripheral pins.
-
-|
-| Place "Bad" in all vectors from 010 thru 0ec. Vectors 0f0 and 0f4
-| are not set because they are the 68302''s BAR and SCR.
-|
- movea.w #0x010,a0
- moveq #(0x0f0-0x010)/4-1,d0
- move.l #Bad,d1
-cpy_Bad: move.l d1,(a0)+
- dbra d0,cpy_Bad
-
- .set vbase, 0x0200
-
- lea vbase,a0
- moveq #31,d0
-cpy_Bad1: move.l d1,(a0)+
- dbra d0,cpy_Bad1
-
-|
-| Fill in special locations to configure OS
-|
- move.l #Bad,0x008 | Bus Error
- move.l #Bad,0x00c | Address Error
- move.l #Bad,0x024 | Trace
-| move.l #KE_IRET,$0b4 | pSOS+ RET_I Call
-
-| move.l #_cnsl_isr,vbase+0x028 | SCC2
- move.l #timerisr,vbase+0x018 | Timer ISR
-
- |
- | zero out uninitialized data area
- |
-zerobss:
- moveal # SYM (end),a0 | find end of .bss
- moveal # SYM (bss_start),a1 | find beginning of .bss
- moveq #0,d0
-
-loop: movel d0,a1@+ | to zero out uninitialized
- cmpal a0,a1
- jlt loop | loop until _end reached
-
- movel # SYM (end),d0 | d0 = end of bss/start of heap
- addl # SYM (heap_size),d0 | d0 = end of heap
- movel d0, SYM (stack_start) | Save for brk() routine
- addl # SYM (stack_size),d0 | make room for stack
- andl #0xffffffc0,d0 | align it on 16 byte boundary
- movw #0x3700,sr | SUPV MODE,INTERRUPTS OFF!!!
- movel d0,a7 | set master stack pointer
- movel d0,a6 | set base pointer
-
- /*
- * RTEMS should maintain a separate interrupt stack on CPUs
- * without one in hardware. This is currently not supported
- * on versions of the m68k without a HW intr stack.
- */
-
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
- lea SYM (hiintstack),a0 | a0 = high end of intr stack
- movec a0,isp | set interrupt stack
-#endif
-
- move.l #0,a7@- | environp
- move.l #0,a7@- | argv
- move.l #0,a7@- | argc
- jsr SYM (boot_card)
-
- nop
-Bad: bra Bad
-
- nop
-END_CODE
-
-
-BEGIN_DATA
-
- PUBLIC (start_frame)
-SYM (start_frame):
- .space 4,0
-
- PUBLIC (stack_start)
-SYM (stack_start):
- .space 4,0
-END_DATA
-
-BEGIN_BSS
-
- PUBLIC (environ)
- .align 2
-SYM (environ):
- .long 0
-
- PUBLIC (heap_size)
- .set SYM (heap_size),0x2000
-
- PUBLIC (stack_size)
- .set SYM (stack_size),0x1000
-
-
-END_DATA
-END
diff --git a/c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in b/c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in
deleted file mode 100644
index 71bc5a0634..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-
diff --git a/c/src/lib/libbsp/m68k/gen68302/startup/bspclean.c b/c/src/lib/libbsp/m68k/gen68302/startup/bspclean.c
deleted file mode 100644
index fbcd753e97..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/startup/bspclean.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine normally is part of start.s and usually returns
- * control to a monitor.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-void bsp_cleanup( void )
-{
-}
diff --git a/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c b/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c
deleted file mode 100644
index aa71c6faab..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
-
- /*
- * Allocate the memory for the RTEMS Work Space. This can come from
- * a variety of places: hard coded address, malloc'ed from outside
- * RTEMS world (e.g. simulator or primitive memory manager), or (as
- * typically done by stock BSPs) by subtracting the required amount
- * of work space from the last physical address on the CPU board.
- */
-#if 0
- Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/;
-#endif
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
-
- BSP_Configuration.work_space_start = (void *)
- (RAM_END - BSP_Configuration.work_space_size);
-
- /*
- * initialize the CPU table for this BSP
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_stack_size = 4096;
-}
diff --git a/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds b/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds
deleted file mode 100644
index 031323546d..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the Generic MC68302 board.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-MEMORY
- {
- ram : org = 0x0000, l = 16M
- }
-
-m302 = 0xf7f000;
-_VBR = 0x000000; /* location of the VBR table (in RAM) */
-
-SECTIONS
-{
- .text 0xc00000 :
- {
- text_start = . ;
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- etext = ALIGN( 0x10 ) ;
- }
- .data 0x010000 :
- {
- data_start = . ;
- *(.data)
- edata = ALIGN( 0x10 ) ;
- }
- .bss ADDR( .data ) + SIZEOF( .data ):
- {
- bss_start = . ;
- *(.bss)
- *(COMMON)
- end = . ;
- _end = . ;
- }
-}
diff --git a/c/src/lib/libbsp/m68k/gen68302/timer/Makefile.in b/c/src/lib/libbsp/m68k/gen68302/timer/Makefile.in
deleted file mode 100644
index 24809cbed8..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=timerisr
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/gen68302/timer/timer.c b/c/src/lib/libbsp/m68k/gen68302/timer/timer.c
deleted file mode 100644
index d8e410ad85..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/timer/timer.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/* Timer_init()
- *
- * This routine initializes TIMER 2 for an MC68302.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include "m68302.h"
-
-
-#define TMR2_VAL 0x071b /* Timer mode register
- * (section 3.5.2.1 in 68302 manual)
- * 15-8: "7" prescaler divide by 8 (x+1)
- * 7-6: 00 dis. intr. on capture event
- * 5: 0 active-low pulse
- * 4: 1 intr. on reaching reference
- * 3: 1 restart counter on reference
- * 2-1: 01 master clock input source
- * 0: 1 enable timer
- */
-#define TRR2_VAL 2000 /* Timer reference register
- * (section 3.5.2.2 in 68302 manual)
- * 2000 ticks @ (16MHz/1)/8 = 1-ms count
- */
-
-rtems_unsigned32 Timer_interrupts;
-
-rtems_boolean Timer_driver_Find_average_overhead;
-
-rtems_isr timerisr();
-
-void Timer_initialize( void )
-{
- m302.reg.tmr2 = 0; /* disable timer */
-
- Timer_interrupts = 0; /* clear timer ISR count */
-
- m302.reg.trr2 = TRR2_VAL; /* set timer reference register */
- m302.reg.tmr2 = TMR2_VAL; /* set timer mode register */
- m302.reg.imr |= RBIT_IMR_TIMER2; /* set 68302 int-mask to allow ints */
-}
-
-/*
- * The following controls the behavior of Read_timer().
- *
- * FIND_AVG_OVERHEAD * instructs the routine to return the "raw" count.
- *
- * AVG_OVEREHAD is the overhead for starting and stopping the timer. It
- * is usually deducted from the number returned.
- *
- * LEAST_VALID is the lowest number this routine should trust. Numbers
- * below this are "noise" and zero is returned.
- */
-
-#define AVG_OVERHEAD 0 /* It typically takes X.X microseconds */
- /* (Y countdowns) to start/stop the timer. */
- /* This value is in microseconds. */
-#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-
-/*
- * Return timer value in 1/2-microsecond units
- */
-int Read_timer( void )
-{
- rtems_unsigned16 clicks;
- rtems_unsigned32 total;
-
- /*
- * Read the timer and see how many clicks it has been since counter
- * rolled over.
- */
-
- clicks = m302.reg.tcn2;
-
- /*
- * Total is calculated by taking into account the number of timer overflow
- * interrupts since the timer was initialized and clicks since the last
- * interrupts.
- */
-
- total = (Timer_interrupts * TRR2_VAL) + clicks;
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in XXX microsecond units */
-
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
-
- /*
- * Convert 1/2-microsecond count into microseconds
- */
-
- return (total - AVG_OVERHEAD) >> 1;
-}
-
-
-/*
- * Empty function call used in loops to measure basic cost of looping
- * in Timing Test Suite.
- */
-
-rtems_status_code Empty_function(void)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/m68k/gen68302/timer/timerisr.s b/c/src/lib/libbsp/m68k/gen68302/timer/timerisr.s
deleted file mode 100644
index c804b9dfa6..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/timer/timerisr.s
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Handle 68302 TIMER2 interrupts.
- *
- * All code in this routine is pure overhead which can perturb the
- * accuracy of RTEMS' timing test suite.
- *
- * See also: Read_timer()
- *
- * To reduce overhead this is best to be the "rawest" hardware interupt
- * handler you can write. This should be the only interrupt which can
- * occur during the measured time period.
- *
- * An external counter, Timer_interrupts, is incremented.
- *
- * $Id$
- */
-
-#include "asm.h"
-
-BEGIN_CODE
- PUBLIC(timerisr)
-SYM(timerisr):
- move.w #0x0040,SYM(m302)+2072 | clear interrupt in-service bit
- move.b #3,SYM(m302)+2137 | clear timer interrupt event register
- addq.l #1,SYM(Timer_interrupts) | increment timer value
- rte
-END_CODE
-END
diff --git a/c/src/lib/libbsp/m68k/gen68302/times b/c/src/lib/libbsp/m68k/gen68302/times
deleted file mode 100644
index dcb4aec1bd..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/times
+++ /dev/null
@@ -1,193 +0,0 @@
-#
-# Timing Test Suite Results for the generic 68302 BSP
-#
-# $Id$
-#
-
-NOTE: This BSP is used submitted and no information is currently available.
-
-Board: gen68302
-CPU: Motorola 68302
-Clock Speed: 16 Mhz
-Memory Configuration: SRAM, DRAM, cache, etc
-Wait States:
-
-Times Reported in: cycles, microseconds, etc
-Timer Source: Count Down Timer, on-CPU cycle counter, etc
-
-Column A: unused
-Column B: unused
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 20
- rtems_semaphore_delete 21
- rtems_semaphore_obtain: available 15
- rtems_semaphore_obtain: not available -- NO_WAIT 15
- rtems_semaphore_release: no waiting tasks 16
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 62
-
- 3 rtems_semaphore_release: task readied -- preempts caller 55
-
- 4 rtems_task_restart: blocked task -- preempts caller 77
- rtems_task_restart: ready task -- preempts caller 70
- rtems_semaphore_release: task readied -- returns to caller 25
- rtems_task_create 57
- rtems_task_start 31
- rtems_task_restart: suspended task -- returns to caller 36
- rtems_task_delete: suspended task 47
- rtems_task_restart: ready task -- returns to caller 37
- rtems_task_restart: blocked task -- returns to caller 46
- rtems_task_delete: blocked task 50
-
- 5 rtems_task_suspend: calling task 51
- rtems_task_resume: task readied -- preempts caller 49
-
- 6 rtems_task_restart: calling task 59
- rtems_task_suspend: returns to caller 18
- rtems_task_resume: task readied -- returns to caller 19
- rtems_task_delete: ready task 50
-
- 7 rtems_task_restart: suspended task -- preempts caller 70
-
- 8 rtems_task_set_priority: obtain current priority 12
- rtems_task_set_priority: returns to caller 27
- rtems_task_mode: obtain current mode 5
- rtems_task_mode: no reschedule 5
- rtems_task_mode: reschedule -- returns to caller 8
- rtems_task_mode: reschedule -- preempts caller 39
- rtems_task_set_note 13
- rtems_task_get_note 13
- rtems_clock_set 33
- rtems_clock_get 3
-
- 9 rtems_message_queue_create 110
- rtems_message_queue_send: no waiting tasks 37
- rtems_message_queue_urgent: no waiting tasks 37
- rtems_message_queue_receive: available 31
- rtems_message_queue_flush: no messages flushed 12
- rtems_message_queue_flush: messages flushed 16
- rtems_message_queue_delete 26
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 15
- rtems_message_queue_receive: not available -- caller blocks 62
-
-11 rtems_message_queue_send: task readied -- preempts caller 72
-
-12 rtems_message_queue_send: task readied -- returns to caller 39
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 72
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 39
-
-15 rtems_event_receive: obtain current events 1
- rtems_event_receive: not available -- NO_WAIT 12
- rtems_event_receive: not available -- caller blocks 56
- rtems_event_send: no task readied 12
- rtems_event_receive: available 12
- rtems_event_send: task readied -- returns to caller 24
-
-16 rtems_event_send: task readied -- preempts caller 55
-
-17 rtems_task_set_priority: preempts caller 62
-
-18 rtems_task_delete: calling task 83
-
-19 rtems_signal_catch 9
- rtems_signal_send: returns to caller 15
- rtems_signal_send: signal to self 18
- exit ASR overhead: returns to calling task 22
- exit ASR overhead: returns to preempting task 49
-
-20 rtems_partition_create 35
- rtems_region_create 23
- rtems_partition_get_buffer: available 15
- rtems_partition_get_buffer: not available 13
- rtems_partition_return_buffer 18
- rtems_partition_delete 16
- rtems_region_get_segment: available 22
- rtems_region_get_segment: not available -- NO_WAIT 21
- rtems_region_return_segment: no waiting tasks 19
- rtems_region_get_segment: not available -- caller blocks 64
- rtems_region_return_segment: task readied -- preempts caller 74
- rtems_region_return_segment: task readied -- returns to caller 44
- rtems_region_delete 16
- rtems_io_initialize 2
- rtems_io_open 1
- rtems_io_close 1
- rtems_io_read 1
- rtems_io_write 1
- rtems_io_control 1
-
-21 rtems_task_ident 149
- rtems_message_queue_ident 145
- rtems_semaphore_ident 156
- rtems_partition_ident 145
- rtems_region_ident 148
- rtems_port_ident 145
- rtems_timer_ident 145
- rtems_rate_monotonic_ident 145
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 42
- rtems_message_queue_broadcast: no waiting tasks 17
- rtems_message_queue_broadcast: task readied -- preempts caller 78
-
-23 rtems_timer_create 14
- rtems_timer_fire_after: inactive 22
- rtems_timer_fire_after: active 24
- rtems_timer_cancel: active 15
- rtems_timer_cancel: inactive 13
- rtems_timer_reset: inactive 21
- rtems_timer_reset: active 23
- rtems_timer_fire_when: inactive 34
- rtems_timer_fire_when: active 34
- rtems_timer_delete: active 19
- rtems_timer_delete: inactive 17
- rtems_task_wake_when 69
-
-24 rtems_task_wake_after: yield -- returns to caller 9
- rtems_task_wake_after: yields -- preempts caller 45
-
-25 rtems_clock_tick 4
-
-26 _ISR_Disable 0
- _ISR_Flash 1
- _ISR_Enable 1
- _Thread_Disable_dispatch 0
- _Thread_Enable_dispatch 7
- _Thread_Set_state 11
- _Thread_Disptach (NO FP) 31
- context switch: no floating point contexts 21
- context switch: self 10
- context switch: to another task 10
- context switch: restore 1st FP task 25
- fp context switch: save idle, restore idle 31
- fp context switch: save idle, restore initialized 19
- fp context switch: save initialized, restore initialized 20
- _Thread_Resume 7
- _Thread_Unblock 7
- _Thread_Ready 9
- _Thread_Get 4
- _Semaphore_Get 2
- _Thread_Get: invalid id 0
-
-27 interrupt entry overhead: returns to interrupted task 6
- interrupt exit overhead: returns to interrupted task 6
- interrupt entry overhead: returns to nested interrupt 6
- interrupt exit overhead: returns to nested interrupt 5
- interrupt entry overhead: returns to preempting task 7
- interrupt exit overhead: returns to preempting task 36
-
-28 rtems_port_create 16
- rtems_port_external_to_internal 11
- rtems_port_internal_to_external 11
- rtems_port_delete 16
-
-29 rtems_rate_monotonic_create 15
- rtems_rate_monotonic_period: initiate period -- returns to caller 21
- rtems_rate_monotonic_period: obtain status 13
- rtems_rate_monotonic_cancel 16
- rtems_rate_monotonic_delete: inactive 18
- rtems_rate_monotonic_delete: active 20
- rtems_rate_monotonic_period: conclude periods -- caller blocks 53
diff --git a/c/src/lib/libbsp/m68k/gen68302/wrapup/Makefile.in b/c/src/lib/libbsp/m68k/gen68302/wrapup/Makefile.in
deleted file mode 100644
index a42a827299..0000000000
--- a/c/src/lib/libbsp/m68k/gen68302/wrapup/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console timer
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/m68k/gen68340/Makefile.in b/c/src/lib/libbsp/m68k/gen68340/Makefile.in
deleted file mode 100644
index 84ff98ed54..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SRCS=README
-
-all: $(SRCS)
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include start340 startup clock console timer wrapup
diff --git a/c/src/lib/libbsp/m68k/gen68340/README b/c/src/lib/libbsp/m68k/gen68340/README
deleted file mode 100644
index 3f24bb09a7..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/README
+++ /dev/null
@@ -1,86 +0,0 @@
-#
-# $Id$
-#
-
-#
-# This package requires a version of GCC that supports the `-mcpu32' option.
-#
-
-#
-# Please send any comments, improvements, or bug reports to:
-# Geoffroy Montel
-# g_montel@yahoo.com
-#
-
-#
-# This board support package works both MC68340 and MC68349 systems.
-#
-# Special console features:
-# - support of polled and interrupts mode (both MC68340 and MC68349)
-# - support of FIFO FULL mode (only for MC68340, the MC68349 doesn't have any timer, so
-# you may write your own timer driver if you have an external one)
-#
-# The type of the board is automatically recognised in the initialization sequence.
-#
-# WARNING: there's still no network driver!
-# I hope it will come in the next RTEMS version!
-#
-
-BSP NAME: gen68340
-BOARD: Generic 68360 as described in Motorola MC68340 User's Manual
-BOARD: Home made MC68340 board
-BOARD: Home made MC68349 board
-BUS: none
-CPU FAMILY: Motorola CPU32
-COPROCESSORS: none
-MODE: not applicable
-
-DEBUG MONITOR: none (Hardware provides BDM)
-DEBUG SETUP: EST Vision Ice
-
-PERIPHERALS
-===========
-TIMERS: two timers
- RESOLUTION: one microsecond
-SERIAL PORTS: 2 channel on the UART
-REAL-TIME CLOCK: yes
-DMA: yes
-VIDEO: none
-SCSI: none
-NETWORKING: Ethernet on SCC1.
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER:
-IOSUPP DRIVER:
-SHMSUPP: none
-TIMER DRIVER: Timer 1 for timing test suites
- Timer 2 for console's FIFO FULL mode
-STDIO
-=====
-PORT: 1
-ELECTRICAL:
-BAUD: 9600
-BITS PER CHARACTER: 8
-PARITY: None
-STOP BITS: 1
-
-NOTES
-=====
-
-Board description
------------------
-clock rate: 25 MHz
-bus width: 16-bit PROM, 32-bit DRAM
-ROM: To 1 MByte, 60 nsec (0 wait states), chip select 0
-RAM: 1 to 16 MByte DRAM SIMM, 60 nsec (0 wait states), parity or nonparity
-
-Host System
------------
-Cygwin 32
-
-Verification (Standalone 68360)
--------------------------------
-Single processor tests: Passed
-Multi-processort tests: not applicable
-
diff --git a/c/src/lib/libbsp/m68k/gen68340/bsp_specs b/c/src/lib/libbsp/m68k/gen68340/bsp_specs
deleted file mode 100644
index f58166bccc..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start340.o%s} \
-%{qrtems_debug: start340_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/m68k/gen68340/clock/Makefile.in b/c/src/lib/libbsp/m68k/gen68340/clock/Makefile.in
deleted file mode 100644
index 59df4f2702..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/clock/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/gen68340/clock/ckinit.c b/c/src/lib/libbsp/m68k/gen68340/clock/ckinit.c
deleted file mode 100644
index 3a69bbf243..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/clock/ckinit.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * This routine initializes the MC68340/349 Periodic Interval Timer
- *
- * Based on the `gen68360' board support package, and covered by the
- * original distribution terms.
- *
- * Geoffroy Montel
- * France Telecom - CNET/DSM/TAM/CAT
- * 4, rue du Clos Courtel
- * 35512 CESSON-SEVIGNE
- * FRANCE
- *
- * e-mail: g_montel@yahoo.com
- *
- * $Id$
- */
-
-/*
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- */
-
-#include <stdlib.h> /* for atexit() */
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <m68340.h>
-
-#define CLOCK_VECTOR 120 /* clock isr routine vector in the vbr */
-#define CLOCK_IRQ_LEVEL 6 /* clock isr level */
-
-/*
- * Clock_driver_ticks is a monotonically increasing counter of the
- * number of clock ticks since the driver was initialized.
- */
-volatile rtems_unsigned32 Clock_driver_ticks;
-
-/*
- * These are set by clock driver during its init
- */
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-/*
- * Periodic interval timer interrupt handler
- */
-
-/******************************************************
- Name: Clock_isr
- Input parameters: irq vector
- Output parameters: none
- Description: update # of clock ticks
- *****************************************************/
-rtems_isr
-Clock_isr (rtems_vector_number vector)
-{
- /*
- * Announce the clock tick
- */
- Clock_driver_ticks++;
- rtems_clock_tick();
-}
-
-/******************************************************
- Name: clock_exit
- Input parameters: -
- Output parameters: -
- Description: turn off periodic time at shutdown
- *****************************************************/
-void
-Clock_exit (void)
-{
- if (BSP_Configuration.ticks_per_timeslice ) {
- /*
- * Turn off periodic interval timer
- */
- SIMPITR = 0;
- }
-}
-
-/******************************************************
- Name: Install_clock
- Input parameters: the Clock Interrupt Subroutine
- Output parameters: -
- Description: initialize the periodic interval ticker
- called by Clock_Initialize
- *****************************************************/
-static void
-Install_clock (rtems_isr_entry clock_isr)
-{
- unsigned32 pitr_tmp;
-
- Clock_driver_ticks = 0;
- if ( BSP_Configuration.ticks_per_timeslice ) {
-
- set_vector (clock_isr, CLOCK_VECTOR, 1);
-
- /* sets the Periodic Interrupt Control Register PICR */
- /* voir a quoi correspond exactement le Clock Vector */
-
- SIMPICR = ( CLOCK_IRQ_LEVEL << 8 ) | ( CLOCK_VECTOR );
-
- /* sets the PITR count value */
- /* this assumes a 32.765 kHz crystal */
-
- /* find out whether prescaler should be enabled or not */
- if ( BSP_Configuration.microseconds_per_tick <= 31128 ) {
- pitr_tmp = ( BSP_Configuration.microseconds_per_tick * 8192 ) / 1000000 ;
- }
- else {
- pitr_tmp = ( BSP_Configuration.microseconds_per_tick / 1000000 ) * 16;
- /* enable it */
- pitr_tmp |= 0x100;
- }
-
- SIMPITR = (unsigned char) pitr_tmp;
-
- atexit (Clock_exit);
- }
-}
-
-/******************************************************
- Name: Clock_initialize
- Input parameters: major & minor numbers
- Output parameters: -
- Description: main entry for clock initialization
- calls the bsp dependant routine
- *****************************************************/
-rtems_device_driver
-Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock (Clock_isr);
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-/******************************************************
- Name: Clock_control
- Input parameters: major & minor number
- Output parameters:
- Description:
- *****************************************************/
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args) {
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
- if (args->command == rtems_build_name('I', 'S', 'R', ' ')) {
- Clock_isr( CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
- }
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/m68k/gen68340/console/Makefile.in b/c/src/lib/libbsp/m68k/gen68340/console/Makefile.in
deleted file mode 100644
index 62a52b15e6..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/console/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console m340uart
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=Modif_cpu_asm
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/gen68340/console/Modif_cpu_asm.s b/c/src/lib/libbsp/m68k/gen68340/console/Modif_cpu_asm.s
deleted file mode 100644
index 0da5865fb3..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/console/Modif_cpu_asm.s
+++ /dev/null
@@ -1,184 +0,0 @@
-/* cpu_asm.s
- *
- * This file contains all assembly code for the MC68020 implementation
- * of RTEMS.
- *
- * ATTENTION: Modified for benchmarks
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <asm.h>
-
- .text
-
-/*PAGE
- * void _Debug_ISR_Handler_Console()
- *
- * This routine provides the RTEMS interrupt management.
- *
- * NOTE:
- * Upon entry, the master stack will contain an interrupt stack frame
- * back to the interrupted thread and the interrupt stack will contain
- * a throwaway interrupt stack frame. If dispatching is enabled, this
- * is the outer most interrupt, and (a context switch is necessary or
- * the current thread has signals), then set up the master stack to
- * transfer control to the interrupt dispatcher.
- * NOTE:
- * USED TO MESURE THE TIME SPENT IN THE INTERRUPT SUBROUTINE
- * CS5 - CS8 are linked to an oscilloscope so that you can mesure
- * RTEMS overhead (BTW it's very short :) )
- */
-
-/*
- * With this approach, lower priority interrupts may
- * execute twice if a higher priority interrupt is
- * acknowledged before _Thread_Dispatch_disable is
- * increamented and the higher priority interrupt
- * preforms a context switch after executing. The lower
- * priority intterrupt will execute (1) at the end of the
- * higher priority interrupt in the new context if
- * permitted by the new interrupt level mask, and (2) when
- * the original context regains the cpu.
- */
-
-#if ( M68K_HAS_VBR == 1)
-.set SR_OFFSET, 0 | Status register offset
-.set PC_OFFSET, 2 | Program Counter offset
-.set FVO_OFFSET, 6 | Format/vector offset
-#else
-.set SR_OFFSET, 2 | Status register offset
-.set PC_OFFSET, 4 | Program Counter offset
-.set FVO_OFFSET, 0 | Format/vector offset placed in the stack
-#endif /* M68K_HAS_VBR */
-
-.set SAVED, 16 | space for saved registers
-
- .align 4
- .global SYM (_Debug_ISR_Handler_Console)
-
-SYM (_Debug_ISR_Handler_Console):
-
- |
- tst.w 0x14000000 | ALLUME CS5
- |
-
- addql #1,SYM (_Thread_Dispatch_disable_level) | disable multitasking
- moveml d0-d1/a0-a1,a7@- | save d0-d1,a0-a1
- movew a7@(SAVED+FVO_OFFSET),d0 | d0 = F/VO
- andl #0x0fff,d0 | d0 = vector offset in vbr
-
-
-#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 )
- movew sr,d1 | Save status register
- oriw #0x700,sr | Disable interrupts
- tstl SYM (_ISR_Nest_level) | Interrupting an interrupt handler?
- bne 1f | Yes, just skip over stack switch code
- movel SYM(_CPU_Interrupt_stack_high),a0 | End of interrupt stack
- movel a7,a0@- | Save task stack pointer
- movel a0,a7 | Switch to interrupt stack
-1:
- addql #1,SYM(_ISR_Nest_level) | one nest level deeper
- movew d1,sr | Restore status register
-#else
- addql #1,SYM (_ISR_Nest_level) | one nest level deeper
-#endif /* CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 */
-
-#if ( M68K_HAS_PREINDEXING == 1 )
- movel @( SYM (_ISR_Vector_table),d0:w:1),a0| fetch the ISR
-#else
- movel # SYM (_ISR_Vector_table),a0 | a0 = base of RTEMS table
- addal d0,a0 | a0 = address of vector
- movel (a0),a0 | a0 = address of user routine
-#endif
-
- lsrl #2,d0 | d0 = vector number
- movel d0,a7@- | push vector number
-
- |
- tst.w 0x18000000 | ALLUME CS6
- |
-
- jbsr a0@ | invoke the user ISR
-
- |
- tst.w 0x18000000 | ALLUME CS6
- |
-
- addql #4,a7 | remove vector number
-
-#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 )
- movew sr,d0 | Save status register
- oriw #0x700,sr | Disable interrupts
- subql #1,SYM(_ISR_Nest_level) | Reduce interrupt-nesting count
- bne 1f | Skip if return to interrupt
- movel (a7),a7 | Restore task stack pointer
-1:
- movew d0,sr | Restore status register
-#else
- subql #1,SYM (_ISR_Nest_level) | one less nest level
-#endif /* CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 */
-
- subql #1,SYM (_Thread_Dispatch_disable_level)
- | unnest multitasking
- bne Debug_exit | If dispatch disabled, Debug_exit
-
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
- movew #0xf000,d0 | isolate format nibble
- andw a7@(SAVED+FVO_OFFSET),d0 | get F/VO
- cmpiw #0x1000,d0 | is it a throwaway isf?
- bne Debug_exit | NOT outer level, so branch
-#endif
-
- tstl SYM (_Context_Switch_necessary)
- | Is thread switch necessary?
- bne bframe | Yes, invoke dispatcher
-
- tstl SYM (_ISR_Signals_to_thread_executing)
- | signals sent to Run_thread
- | while in interrupt handler?
- beq Debug_exit | No, then Debug_exit
-
-
-bframe: clrl SYM (_ISR_Signals_to_thread_executing)
- | If sent, will be processed
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
- movec msp,a0 | a0 = master stack pointer
- movew #0,a0@- | push format word
- movel # SYM (_ISR_Dispatch),a0@- | push return addr
- | filter out the trace bit to stop single step debugging breaking
- movew a0@(6+SR_OFFSET),d0
- andw #0x7FFF,d0
- movew d0,a0@- | push thread sr
- movec a0,msp | set master stack pointer
-#else
-
- | filter out the trace bit to stop single step debugging breaking
- movew a7@(16+SR_OFFSET),d0
- andw #0x7FFF,d0
- movew d0,sr
- jsr SYM (_Thread_Dispatch)
-#endif
-
-Debug_exit: moveml a7@+,d0-d1/a0-a1 | restore d0-d1,a0-a1
-#if ( M68K_HAS_VBR == 0 )
- addql #2,a7 | pop format/id
-#endif /* M68K_HAS_VBR */
-
- |
- tst.w 0x1C000000 | ALLUME CS7
- |
-
- rte | return to thread
- | OR _Isr_dispatch
-
-
diff --git a/c/src/lib/libbsp/m68k/gen68340/console/console.c b/c/src/lib/libbsp/m68k/gen68340/console/console.c
deleted file mode 100644
index bfbcac1170..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/console/console.c
+++ /dev/null
@@ -1,711 +0,0 @@
-/*
- * 68340/68349 console serial I/O.
- *
- * Author:
- * Geoffroy Montel
- * France Telecom - CNET/DSM/TAM/CAT
- * 4, rue du Clos Courtel
- * 35512 CESSON-SEVIGNE
- * FRANCE
- *
- * e-mail: g_montel@yahoo.com
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- *
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <termios.h>
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <m68340.h>
-#include <m340uart.h>
-#include <m340timer.h>
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#define CONSOLE_VECTOR 121
-#define CONSOLE_IRQ_LEVEL 3
-#define CONSOLE_INTERRUPT_ARBITRATION 2
-
-static void *ttypA; /* to remember which tty has been opened on channel A
- used when interrupts are enabled */
-
-static void *ttypB; /* to remember which tty has been opened on channel B
- used when interrupts are enabled */
-
-unsigned char DUIER_mirror = 0 ; /* reflects the state of IER register, which is Write Only */
-unsigned char Error_Status_A = 0; /* error status on Channel A */
-unsigned char Error_Status_B = 0; /* error status on Channel A */
-
-/*
- * Device-specific routines
- */
-
-#define USE_INTERRUPTS_A (m340_uart_config[UART_CHANNEL_A].mode==UART_INTERRUPTS)
-#define USE_INTERRUPTS_B (m340_uart_config[UART_CHANNEL_B].mode==UART_INTERRUPTS)
-#define CHANNEL_ENABLED_A m340_uart_config[UART_CHANNEL_A].enable
-#define CHANNEL_ENABLED_B m340_uart_config[UART_CHANNEL_B].enable
-
-#define set_DUIER(a) DUIER_mirror |= (a); DUIER = DUIER_mirror
-#define unset_DUIER(a) DUIER_mirror &= ~(a); DUIER = DUIER_mirror
-
-#define Enable_Interrupts_Tx_A if (USE_INTERRUPTS_A) set_DUIER(m340_TxRDYA)
-#define Disable_Interrupts_Tx_A if (USE_INTERRUPTS_A) unset_DUIER(m340_TxRDYA)
-
-#define Enable_Interrupts_Tx_B if (USE_INTERRUPTS_B) set_DUIER(m340_TxRDYB)
-#define Disable_Interrupts_Tx_B if (USE_INTERRUPTS_B) unset_DUIER(m340_TxRDYB)
-
-/******************************************************
- Name: InterruptHandler
- Input parameters: vector number
- Output parameters: -
- Description: UART ISR Routine, called by _RTEMS_ISR
- *****************************************************/
-rtems_isr
-InterruptHandler (rtems_vector_number v)
-{
- char ch;
-
- /*****************************************************************************
- ** CHANNEL A **
- *****************************************************************************/
-
- /* check Received Break*/
- if (DUSRA & m340_RB) {
- Error_Status_A |= m340_RB;
- /* reset error status */
- DUCRA = m340_Reset_Error_Status;
- }
-
- /* buffer received ? */
- if (DUSRA & m340_Rx_RDY) {
- do {
- /* error encountered? */
- if (DUSRA & (m340_OE | m340_PE | m340_FE | m340_RB)) {
- Error_Status_A |= DUSRA;
- /* reset error status */
- DUCRA = m340_Reset_Error_Status;
- /* all the characters in the queue may not be good */
- while (DUSRA & m340_Rx_RDY)
- /* push them in a trash */
- ch = DURBA;
- }
- else {
- /* this is necessary, otherwise it blocks when FIFO is full */
- ch = DURBA;
- rtems_termios_enqueue_raw_characters(ttypA,&ch,1);
- }
- } while (DUSRA & m340_Rx_RDY);
- Restart_Fifo_Full_A_Timer(); /* only if necessary (pointer to a fake function if
- not in FIFO full mode) */
- }
-
- else /* if no character has been received */
- Restart_Check_A_Timer(); /* same remark */
-
- /* ready to accept a character ? */
- if (DUISR & DUIER_mirror & m340_TxRDYA) {
- Disable_Interrupts_Tx_A;
- /* one character has been transmitted */
- rtems_termios_dequeue_characters(ttypA,1);
- }
-
- /*****************************************************************************
- ** CHANNEL B **
- *****************************************************************************/
-
- /* check Received Break*/
- if (DUSRB & m340_RB) {
- Error_Status_B |= m340_RB;
- /* reset error status */
- DUCRB = m340_Reset_Error_Status;
- }
-
- /* buffer received ? */
- if (DUSRB & m340_Rx_RDY) {
- do {
- if (DUSRB & (m340_OE | m340_PE | m340_FE | m340_RB)) {
- Error_Status_B |= DUSRB;
- /* reset error status */
- DUCRB = m340_Reset_Error_Status;
- /* all the characters in the queue may not be good */
- while (DUSRB & m340_Rx_RDY)
- /* push them in a trash */
- ch = DURBB;
- }
- else {
- ch = DURBB;
- rtems_termios_enqueue_raw_characters(ttypB,&ch,1);
- }
-
- } while (DUSRB & m340_Rx_RDY);
- Restart_Fifo_Full_B_Timer();
- }
- else /* if no character has been received */
- Restart_Check_B_Timer();
-
- /* ready to accept a character ? */
- if (DUISR & DUIER_mirror & m340_TxRDYB) {
- Disable_Interrupts_Tx_B;
- /* one character has been transmitted */
- rtems_termios_dequeue_characters(ttypB,1);
- }
-}
-
-/******************************************************
- Name: InterruptWrite
- Input parameters: minor = channel, pointer to buffer,
- and length of buffer to transmit
- Output parameters: -
- Description: write the first character of buf only
- may be called by either console_write
- or rtems_termios_enqueue_raw_characters
- *****************************************************/
-static int
-InterruptWrite (int minor, const char *buf, int len)
-{
- if (minor==UART_CHANNEL_A) {
- if (len>0) (char)DUTBA=*buf;
- Enable_Interrupts_Tx_A;
- }
- else if (minor==UART_CHANNEL_B) {
- if (len>0) (char)DUTBB=*buf;
- Enable_Interrupts_Tx_B;
- }
- return 0;
-}
-
-/******************************************************
- Name: dbug_out_char
- Input parameters: channel, character to emit
- Output parameters: -
- Description: wait for the UART to be ready to emit
- a character and send it
- *****************************************************/
-void dbug_out_char( int minor, int ch )
-{
- if (minor==UART_CHANNEL_A) {
- while (!(DUSRA & m340_Tx_RDY)) continue;
- DUTBA=ch;
- }
- else if (minor==UART_CHANNEL_B) {
- while (!(DUSRB & m340_Tx_RDY)) continue;
- DUTBB=ch;
- }
-}
-
-/******************************************************
- Name: dbug_in_char
- Input parameters: -
- Output parameters: received character
- Description: return the character in the UART
- *****************************************************/
-int dbug_in_char( int minor )
-{
- if (minor==UART_CHANNEL_A) {
- return DURBA;
- }
- else if (minor==UART_CHANNEL_B) {
- return DURBB;
- }
- return 0;
-}
-
-/******************************************************
- Name: dbug_char_present
- Input parameters: channel #
- Output parameters: TRUE or FALSE
- Description: return whether there's a character
- in the receive buffer
- *****************************************************/
-int dbug_char_present( int minor )
-{
- if (minor==UART_CHANNEL_A) {
- return (DUSRA & m340_Rx_RDY);
- }
- else if (minor==UART_CHANNEL_B) {
- return (DUSRB & m340_Rx_RDY);
- }
- return 0;
-}
-
-/******************************************************
- Name: dbugInitialise
- Input parameters: -
- Output parameters: -
- Description: Init the UART
- *****************************************************/
-static void
-dbugInitialise ()
-{
- t_baud_speed_table uart_config; /* configuration of UARTS */
-
- /*
- * Reset Receiver
- */
- DUCRA = m340_Reset_Receiver;
- DUCRB = m340_Reset_Receiver;
-
- /*
- * Reset Transmitter
- */
- DUCRA = m340_Reset_Transmitter;
- DUCRB = m340_Reset_Transmitter;
-
- /*
- * Enable serial module for normal operation, ignore FREEZE, select the crystal clock,
- * supervisor/user serial registers unrestricted
- * interrupt arbitration at priority CONSOLE_INTERRUPT_ARBITRATION
- * WARNING : 8 bits access only on this UART!
- */
- DUMCRH = 0x00;
- DUMCRL = CONSOLE_INTERRUPT_ARBITRATION;
-
- /*
- * Interrupt level register
- */
- DUILR = CONSOLE_IRQ_LEVEL;
-
- /* sets the IVR */
- DUIVR = CONSOLE_VECTOR;
-
- /* search for a correct m340 uart configuration */
- uart_config = Find_Right_m340_UART_Config(m340_uart_config[UART_CHANNEL_A].rx_baudrate,
- m340_uart_config[UART_CHANNEL_A].tx_baudrate,
- CHANNEL_ENABLED_A,
- m340_uart_config[UART_CHANNEL_B].rx_baudrate,
- m340_uart_config[UART_CHANNEL_B].tx_baudrate,
- CHANNEL_ENABLED_B);
-
- /*****************************************************************************
- ** CHANNEL A **
- *****************************************************************************/
- if (CHANNEL_ENABLED_A) {
-
- if (USE_INTERRUPTS_A) {
- rtems_isr_entry old_handler;
- rtems_status_code sc;
-
- extern void _Debug_ISR_Handler_Console(void);
-
- sc = rtems_interrupt_catch (InterruptHandler,
- CONSOLE_VECTOR,
- &old_handler);
-
- /* uncomment this if you want to pass control to your own ISR handler
- it may be usefull to do so to check for performances with an oscilloscope */
- /*
- {
- proc_ptr ignored;
- _CPU_ISR_install_raw_handler( CONSOLE_VECTOR, _Debug_ISR_Handler_Console, &ignored );
- }
- */
-
- /*
- * Interrupt Enable Register
- * Enable Interrupts on Channel A Receiver Ready
- */
- set_DUIER(m340_RxRDYA);
- }
- else {
- /*
- * Disable Interrupts on channel A
- */
- unset_DUIER(m340_RxRDYA&m340_TxRDYA);
- }
-
- /*
- * Change set of baud speeds
- * disable input control
- */
- /* no good uart configuration ? */
- if (uart_config.nb<1) rtems_fatal_error_occurred (-1);
-
- if (uart_config.baud_speed_table[UART_CHANNEL_A].set==1)
- DUACR = m340_BRG_Set1;
- else
- DUACR = m340_BRG_Set2;
-
- /*
- * make OPCR an auxiliary function serving the communication channels
- */
- DUOPCR = m340_OPCR_Aux;
-
- /* poll the XTAL_RDY bit until it is cleared to ensure that an unstable crystal
- input is not applied to the baud rate generator */
- while (DUISR & m340_XTAL_RDY) continue;
-
- /*
- * Serial Channel Baud Speed
- */
- DUCSRA = (uart_config.baud_speed_table[UART_CHANNEL_A].rcs << 4)
- | (uart_config.baud_speed_table[UART_CHANNEL_A].tcs);
-
- /*
- * Serial Channel Configuration
- */
- DUMR1A = m340_uart_config[UART_CHANNEL_A].parity_mode
- | m340_uart_config[UART_CHANNEL_A].bits_per_char
- | m340_RxRTS;
-
- if (m340_uart_config[UART_CHANNEL_A].rx_mode==UART_FIFO_FULL) DUMR1A |= m340_R_F | m340_ERR;
-
- /*
- * Serial Channel Configuration 2
- */
- DUMR2A |= m340_normal;
-
- /*
- * Enable Channel A: transmitter and receiver
- */
- DUCRA = m340_Transmitter_Enable | m340_Receiver_Enable;
- } /* channel A enabled */
-
- /*****************************************************************************
- ** CHANNEL B **
- *****************************************************************************/
- if (CHANNEL_ENABLED_B) {
-
- /* we mustn't set the console vector twice! */
- if ((USE_INTERRUPTS_B && !(CHANNEL_ENABLED_A))
- || (USE_INTERRUPTS_B && CHANNEL_ENABLED_A && !USE_INTERRUPTS_A)) {
- rtems_isr_entry old_handler;
- rtems_status_code sc;
-
- extern void _Debug_ISR_Handler_Console(void);
-
- sc = rtems_interrupt_catch (InterruptHandler,
- CONSOLE_VECTOR,
- &old_handler);
-
- /* uncomment this if you want to pass control to your own ISR handler
- it may be usefull to do so to check for performances with an oscilloscope */
- /*
- {
- proc_ptr ignored;
- _CPU_ISR_install_raw_handler( CONSOLE_VECTOR, _Debug_ISR_Handler_Console, &ignored );
- }
- */
-
- /*
- * Interrupt Enable Register
- * Enable Interrupts on Channel A Receiver Ready
- */
- set_DUIER(m340_RxRDYB);
- }
- else {
- /*
- * Disable Interrupts on channel B
- */
- unset_DUIER(m340_RxRDYB&m340_TxRDYB);
- }
-
- /*
- * Change set of baud speeds
- * disable input control
- */
-
- /* no good uart configuration ? */
- if (uart_config.nb<2) rtems_fatal_error_occurred (-1);
-
- /* don't set DUACR twice! */
- if (!CHANNEL_ENABLED_A)
- if (uart_config.baud_speed_table[UART_CHANNEL_B].set==1) DUACR = m340_BRG_Set1;
- else DUACR = m340_BRG_Set2;
-
- /*
- * make OPCR an auxiliary function serving the communication channels
- */
- if (!CHANNEL_ENABLED_A) DUOPCR = m340_OPCR_Aux;
-
- /* poll the XTAL_RDY bit until it is cleared to ensure that an unstable crystal
- input is not applied to the baud rate generator */
- while (DUISR & m340_XTAL_RDY) continue;
-
- /*
- * Serial Channel Baud Speed
- */
- DUCSRB = (uart_config.baud_speed_table[UART_CHANNEL_B].rcs << 4)
- | (uart_config.baud_speed_table[UART_CHANNEL_B].tcs);
-
- /*
- * Serial Channel Configuration
- */
- DUMR1B = m340_uart_config[UART_CHANNEL_B].parity_mode
- | m340_uart_config[UART_CHANNEL_B].bits_per_char
- | m340_RxRTS;
-
- if (m340_uart_config[UART_CHANNEL_B].rx_mode==UART_FIFO_FULL) DUMR1B |= m340_R_F | m340_ERR;
-
- /*
- * Serial Channel Configuration 2
- */
- DUMR2B |= m340_normal;
-
- /*
- * Enable Channel A: transmitter and receiver
- */
- DUCRB = m340_Transmitter_Enable | m340_Receiver_Enable;
- } /* channel B enabled */
-}
-
-/******************************************************
- Name: SetAttributes
- Input parameters: termios structure, channel
- Output parameters: -
- Description: return whether there's a character
- in the receive buffer
- TO DO: add the channel # to check for!!
- *****************************************************/
-static int
-SetAttributes (int minor, const struct termios *t)
-{
- rtems_interrupt_level level;
- float ispeed, ospeed;
- int isp, osp;
-
- /* output speed */
- if (t->c_cflag & CBAUDEX)
- osp = (t->c_cflag & CBAUD) + CBAUD + 1;
- else
- osp = t->c_cflag & CBAUD;
-
- /* input speed */
- isp = (t->c_cflag / (CIBAUD / CBAUD)) & CBAUD;
-
- /* convert it */
- ispeed = termios_baud_rates_equivalence(isp);
- ospeed = termios_baud_rates_equivalence(osp);
-
- if (ispeed || ospeed) {
- /* update config table */
- m340_uart_config[UART_CHANNEL_A].rx_baudrate = ((minor==UART_CHANNEL_A)&&(ispeed!=0)) ? ispeed : m340_uart_config[UART_CHANNEL_A].rx_baudrate;
- m340_uart_config[UART_CHANNEL_A].tx_baudrate = ((minor==UART_CHANNEL_A)&&(ospeed!=0)) ? ospeed : m340_uart_config[UART_CHANNEL_A].tx_baudrate;
- m340_uart_config[UART_CHANNEL_B].rx_baudrate = ((minor==UART_CHANNEL_B)&&(ispeed!=0)) ? ispeed : m340_uart_config[UART_CHANNEL_B].rx_baudrate;
- m340_uart_config[UART_CHANNEL_B].tx_baudrate = ((minor==UART_CHANNEL_B)&&(ospeed!=0)) ? ospeed : m340_uart_config[UART_CHANNEL_B].tx_baudrate;
- }
-
- /* change parity */
- if (t->c_cflag & PARENB) {
- if (t->c_cflag & PARODD) m340_uart_config[minor].parity_mode = m340_Odd_Parity;
- else m340_uart_config[minor].parity_mode = m340_Even_Parity;
- }
-
- /* change bits per character */
- if (t->c_cflag & CSIZE) {
- switch (t->c_cflag & CSIZE) {
- default: break;
- case CS5: m340_uart_config[minor].bits_per_char = m340_5bpc; break;
- case CS6: m340_uart_config[minor].bits_per_char = m340_6bpc; break;
- case CS7: m340_uart_config[minor].bits_per_char = m340_7bpc; break;
- case CS8: m340_uart_config[minor].bits_per_char = m340_8bpc; break;
- }
- }
-
- /* if serial module configuration has been changed */
- if (t->c_cflag & (CBAUD | CIBAUD | CSIZE | PARENB)) {
- rtems_interrupt_disable(level);
- /* reinit the UART */
- dbugInitialise();
- rtems_interrupt_enable (level);
- }
-
- return 0;
-}
-
-/******************************************************
- Name: console_reserve_resources
- Input parameters: -
- Output parameters: -
- Description: Reserve resources consumed by this driver
- *****************************************************/
-void console_reserve_resources(
- rtems_configuration_table *configuration
-)
-{
- rtems_termios_reserve_resources (configuration, 1);
-}
-
-/******************************************************
- Name: console_initialize
- Input parameters: MAJOR # of console_driver,
- minor is always 0,
- args are always NULL
- Output parameters: -
- Description: Reserve resources consumed by this driver
- TODO: We should pass m340_uart_config table in arg
- *****************************************************/
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
- int i;
-
- /*
- * Set up TERMIOS
- */
- rtems_termios_initialize ();
-
- /*
- * Do device-specific initialization
- */
- Init_UART_Table();
- dbugInitialise ();
- Fifo_Full_Timer_initialize();
-
- /*
- * Register the devices
- */
- for (i=0; i<UART_NUMBER_OF_CHANNELS; i++) {
- if (m340_uart_config[i].enable) {
- status = rtems_io_register_name (m340_uart_config[i].name, major, i);
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (status);
- }
- }
-
- return RTEMS_SUCCESSFUL;
-}
-
-/******************************************************
- Name: console_open
- Input parameters: channel #, arg
- Output parameters: -
- Description: open the device
- *****************************************************/
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_status_code sc = 0;
-
- static const rtems_termios_callbacks intrCallbacks = {
- NULL, /* firstOpen */
- NULL, /* lastClose */
- NULL, /* pollRead */
- InterruptWrite, /* write */
- SetAttributes, /* setAttributes */
- NULL, /* stopRemoteTx */
- NULL, /* startRemoteTx */
- 1 /* outputUsesInterrupts */
- };
-
- static const rtems_termios_callbacks pollCallbacks = {
- NULL, /* firstOpen */
- NULL, /* lastClose */
- dbugRead, /* pollRead */
- dbugWrite, /* write */
- SetAttributes, /* setAttributes */
- NULL, /* stopRemoteTx */
- NULL, /* startRemoteTx */
- 0 /* outputUsesInterrupts */
- };
-
- if (minor==UART_CHANNEL_A) {
- if (USE_INTERRUPTS_A) {
- rtems_libio_open_close_args_t *args = arg;
-
- sc |= rtems_termios_open (major, minor, arg, &intrCallbacks);
- ttypA = args->iop->data1;
- }
- else {
- sc |= rtems_termios_open (major, minor, arg, &pollCallbacks);
- }
- }
-
- else if (minor==UART_CHANNEL_B) {
- if (USE_INTERRUPTS_B) {
- rtems_libio_open_close_args_t *args = arg;
-
- sc |= rtems_termios_open (major, minor, arg, &intrCallbacks);
- ttypB = args->iop->data1;
- }
- else {
- sc |= rtems_termios_open (major, minor, arg, &pollCallbacks);
- }
- }
-
- else return RTEMS_INVALID_NUMBER;
-
- return sc;
-}
-
-/******************************************************
- Name: console_close
- Input parameters: channel #, termios args
- Output parameters: -
- Description: close the device
- *****************************************************/
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_close (arg);
-}
-
-/******************************************************
- Name: console_read
- Input parameters: channel #, termios args
- Output parameters: -
- Description: read the device
- *****************************************************/
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_read (arg);
-}
-
-/******************************************************
- Name: console_write
- Input parameters: channel #, termios args
- Output parameters: -
- Description: write to the device
- *****************************************************/
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_write (arg);
-}
-
-/******************************************************
- Name: console_control
- Input parameters: channel #, termios args
- Output parameters: -
- Description: Handle ioctl request
- *****************************************************/
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_ioctl_args_t *args = arg;
-
- if (args->command == RTEMS_IO_SET_ATTRIBUTES)
- SetAttributes (minor, (struct termios *)args->buffer);
-
- return rtems_termios_ioctl (arg);
-}
diff --git a/c/src/lib/libbsp/m68k/gen68340/console/m340uart.c b/c/src/lib/libbsp/m68k/gen68340/console/m340uart.c
deleted file mode 100644
index a293f6c83c..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/console/m340uart.c
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
- * M68340/349 uart management tools
- *
- * Author:
- * Geoffroy Montel
- * France Telecom - CNET/DSM/TAM/CAT
- * 4, rue du Clos Courtel
- * 35512 CESSON-SEVIGNE
- * FRANCE
- *
- * e-mail: g_montel@yahoo.com
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- *
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <termios.h>
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <m68340.h>
-#include <m340uart.h>
-#include <stdarg.h>
-
-/* this table shows compatible speed configurations for the MC68340:
- the first row shows baud rates for baud speed set 1
- the second row shows baud rates for baud speed set 2
- look at Motorola's MC68340 Integrated Processor User's Manual
- page 7-30 for more infos */
-
-float m340_Baud_Rates_Table[16][2] = {\
- { 50, 75 }, \
- { 110, 110 }, \
- { 134.5, 134.5 }, \
- { 200, 150 }, \
- { 300, 300 }, \
- { 600, 600 }, \
- { 1200, 1200 }, \
- { 1050, 2000 }, \
- { 2400, 2400 }, \
- { 4800, 4800 }, \
- { 7200, 1800 }, \
- { 9600, 9600 }, \
- { 38400, 19200 }, \
- { 76800, 38400 }, \
- { SCLK/16, SCLK/16}, \
- { SCLK, SCLK }, \
-};
-
-/* config on both 340 channels */
-uart_channel_config m340_uart_config[UART_NUMBER_OF_CHANNELS];
-
-/*
- * Init UART table
- */
-
-#define NOT_IMPLEMENTED_YET 0
-
-/******************************************************
- Name: Init_UART_Table
- Input parameters: -
- Output parameters: -
- Description: Init the m340_uart_config
- THIS SHOULD NOT BE HERE!
- Its aim was to let the user configure
- UARTs for each application.
- As we can't pass args to the console
- driver initialisation routine at the
- moment, this was not done.
- ATTENTION: TERMIOS init presupposes that the channel
- baud rates is 9600/9600.
- -> risks when using IOCTL
- *****************************************************/
-void Init_UART_Table(void)
-{
- m340_uart_config[UART_CHANNEL_A].enable = TRUE;
- strcpy(m340_uart_config[UART_CHANNEL_A].name, UART_CONSOLE_NAME);
- m340_uart_config[UART_CHANNEL_A].parity_mode = m340_No_Parity;
- m340_uart_config[UART_CHANNEL_A].bits_per_char = m340_8bpc;
- m340_uart_config[UART_CHANNEL_A].rx_baudrate = 9600;
- m340_uart_config[UART_CHANNEL_A].tx_baudrate = 9600;
- m340_uart_config[UART_CHANNEL_A].rx_mode = UART_CRR;
- m340_uart_config[UART_CHANNEL_A].mode = UART_POLLING;
-
- m340_uart_config[UART_CHANNEL_A].termios.enable = TRUE;
- m340_uart_config[UART_CHANNEL_A].termios.rx_buffer_size = NOT_IMPLEMENTED_YET;
- m340_uart_config[UART_CHANNEL_A].termios.tx_buffer_size = NOT_IMPLEMENTED_YET;
-
- m340_uart_config[UART_CHANNEL_B].enable = FALSE;
- strcpy(m340_uart_config[UART_CHANNEL_B].name, UART_RAW_IO_NAME);
- m340_uart_config[UART_CHANNEL_B].parity_mode = m340_No_Parity;
- m340_uart_config[UART_CHANNEL_B].bits_per_char = m340_8bpc;
- m340_uart_config[UART_CHANNEL_B].rx_baudrate = 38400;
- m340_uart_config[UART_CHANNEL_B].tx_baudrate = 38400;
- m340_uart_config[UART_CHANNEL_B].rx_mode = UART_CRR;
- m340_uart_config[UART_CHANNEL_B].mode = UART_INTERRUPTS;
-
- m340_uart_config[UART_CHANNEL_B].termios.enable = TRUE;
- m340_uart_config[UART_CHANNEL_B].termios.rx_buffer_size = NOT_IMPLEMENTED_YET;
- m340_uart_config[UART_CHANNEL_B].termios.tx_buffer_size = NOT_IMPLEMENTED_YET;
-}
-
-/******************************************************
- Name: Find_Right_m340_UART_Channel_Config
- Input parameters: Send/Receive baud rates for a
- given channel
- Output parameters: UART compatible configs for this
- channel
- Description: returns which uart configurations fit
- Receiver Baud Rate and Transmitter Baud
- Rate for a given channel
- For instance, according to the
- m340_Baud_Rates_Table:
- - Output Speed = 50, Input Speed = 75
- is not a correct config, because
- 50 bauds implies set 1 and 75 bauds
- implies set 2
- - Output Speed = 9600, Input Speed = 9600
- two correct configs for this:
- RCS=11, TCS=11, Set=1 or 2
- *****************************************************/
-t_baud_speed_table
-Find_Right_m340_UART_Channel_Config(float ReceiverBaudRate, float TransmitterBaudRate)
-{
- t_baud_speed_table return_value;
-
- struct {
- int cs;
- int set;
- } Receiver[2], Transmitter[2];
-
- int Receiver_nb_of_config = 0;
- int Transmitter_nb_of_config = 0;
-
- int i,j;
-
- /* Receiver and Transmitter baud rates must be compatible, ie in the same set */
-
- /* search for configurations for ReceiverBaudRate - there can't be more than two (only two sets) */
- for (i=0;i<16;i++)
- for (j=0;j<2;j++)
- if (m340_Baud_Rates_Table[i][j]==ReceiverBaudRate) {
- Receiver[Receiver_nb_of_config].cs=i;
- Receiver[Receiver_nb_of_config].set=j;
- Receiver_nb_of_config++;
- }
-
- /* search for configurations for TransmitterBaudRate - there can't be more than two (only two sets) */
- for (i=0;i<16;i++)
- for (j=0;j<2;j++)
- if (m340_Baud_Rates_Table[i][j]==TransmitterBaudRate) {
- Transmitter[Transmitter_nb_of_config].cs=i;
- Transmitter[Transmitter_nb_of_config].set=j;
- Transmitter_nb_of_config++;
- }
-
- /* now check if there's a compatible config */
- return_value.nb=0;
-
- for (i=0; i<Receiver_nb_of_config; i++)
- for (j=0;j<Transmitter_nb_of_config;j++)
- if (Receiver[i].set == Transmitter[j].set) {
- return_value.baud_speed_table[return_value.nb].set = Receiver[i].set + 1; /* we want set 1 or set 2, not 0 or 1 */
- return_value.baud_speed_table[return_value.nb].rcs = Receiver[i].cs;
- return_value.baud_speed_table[return_value.nb].tcs = Transmitter[j].cs;
- return_value.nb++;
- }
-
- return return_value;
-}
-
-/******************************************************
- Name: Find_Right_m340_UART_Config
- Input parameters: Send/Receive baud rates for both
- channels
- Output parameters: UART compatible configs for
- BOTH channels
- Description: returns which uart configurations fit
- Receiver Baud Rate and Transmitter Baud
- Rate for both channels
- For instance, if we want 9600/38400 on
- channel A and 9600/19200 on channel B,
- this is not a good m340 uart config
- (channel A needs set 1 and channel B
- needs set 2)
- *****************************************************/
-t_baud_speed_table
-Find_Right_m340_UART_Config(float ChannelA_ReceiverBaudRate, float ChannelA_TransmitterBaudRate, rtems_unsigned8 enableA,
- float ChannelB_ReceiverBaudRate, float ChannelB_TransmitterBaudRate, rtems_unsigned8 enableB)
-{
- t_baud_speed_table tableA, tableB;
- t_baud_speed_table return_value, tmp;
- int i,j;
-
- return_value.nb=0;
-
- if (enableA && enableB) {
- tableA = Find_Right_m340_UART_Channel_Config(ChannelA_ReceiverBaudRate, ChannelA_TransmitterBaudRate);
- tableB = Find_Right_m340_UART_Channel_Config(ChannelB_ReceiverBaudRate, ChannelB_TransmitterBaudRate);
-
- for (i=0;i<tableA.nb;i++)
- for (j=0;j<tableB.nb;j++)
- if (tableA.baud_speed_table[i].set==tableB.baud_speed_table[j].set) {
- return_value.baud_speed_table[UART_CHANNEL_A].set=tableA.baud_speed_table[i].set;
- return_value.baud_speed_table[UART_CHANNEL_A].rcs=tableA.baud_speed_table[i].rcs;
- return_value.baud_speed_table[UART_CHANNEL_A].tcs=tableA.baud_speed_table[i].tcs;
- return_value.baud_speed_table[UART_CHANNEL_B].set=tableB.baud_speed_table[j].set;
- return_value.baud_speed_table[UART_CHANNEL_B].rcs=tableB.baud_speed_table[j].rcs;
- return_value.baud_speed_table[UART_CHANNEL_B].tcs=tableB.baud_speed_table[j].tcs;
- return_value.nb=2;
- break;
- }
- return return_value;
- }
-
- if (enableA) {
- return_value = Find_Right_m340_UART_Channel_Config(ChannelA_ReceiverBaudRate, ChannelA_TransmitterBaudRate);
- return return_value;
- }
-
- if (enableB) {
- tmp = Find_Right_m340_UART_Channel_Config(ChannelB_ReceiverBaudRate, ChannelB_TransmitterBaudRate);
- if (tmp.nb!=0) {
- return_value.nb = 2;
- return_value.baud_speed_table[1].set = tmp.baud_speed_table[0].set;
- return_value.baud_speed_table[1].rcs = tmp.baud_speed_table[0].rcs;
- return_value.baud_speed_table[1].tcs = tmp.baud_speed_table[0].tcs;
- }
- }
- return return_value;
-}
-
-/******************************************************
- Name: termios_baud_rates_equivalence
- Input parameters: Termios coded speed
- Output parameters: explicit speed
- Description: ioctl calls return termios coded speed
- we need to know real speed in order
- to use the functions above
- *****************************************************/
-float termios_baud_rates_equivalence ( int speed )
-{
- switch (speed) {
- default: return 0; break;
- case B50: return 50; break;
- case B75: return 75; break;
- case B110: return 110; break;
- case B134: return 134; break;
- case B150: return 150; break;
- case B200: return 200; break;
- case B300: return 300; break;
- case B600: return 600; break;
- case B1200: return 1200; break;
- case B1800: return 1800; break;
- case B2400: return 2400; break;
- case B4800: return 4800; break;
- case B9600: return 9600; break;
- case B19200: return 19200; break;
- case B38400: return 38400; break;
- case B57600: return 57600; break;
- case B115200: return 115200; break;
- case B230400: return 230400; break;
- case B460800: return 460800; break;
- }
- return 0;
-}
-
-/****************************************************************************************************/
-
-/*
- * very low level fmted output
- */
-
-extern void dbug_out_char( int minor, int ch );
-extern int dbug_in_char( int minor );
-extern int dbug_char_present( int minor );
-
-/******************************************************
- Name: dbugRead
- Input parameters: channel
- Output parameters: char read
- Description: polled read
- *****************************************************/
-int dbugRead (int minor)
-{
- if (dbug_char_present(minor) == 0)
- return -1;
- return dbug_in_char(minor);
-}
-
-/******************************************************
- Name: dbugWrite
- Input parameters: channel, buffer and its length
- Output parameters: always successfull
- Description: polled write
- *****************************************************/
-int dbugWrite (int minor, const char *buf, int len)
-{
- static char txBuf;
-
- while (len--) {
- txBuf = *buf++;
- dbug_out_char( minor, (int)txBuf );
- }
- return 0;
-}
-
-static void fmt_num( int minor, unsigned long, unsigned );
-static void fmt_str( int minor, const char* );
-
-/******************************************************
- Name: RAW_GETC
- Input parameters: channel, buffer and its length
- Output parameters:
- Description: a light blocking "getc"
- *****************************************************/
-char RAW_GETC(int minor)
-{
- while (!dbug_char_present(minor)) continue;
- return dbug_in_char(minor);
-}
-
-/******************************************************
- Name: RAW_FMT
- Input parameters: channel, buffer and its length
- Output parameters: always successfull
- Description: a light polled "printf"
- useful when there's a serious pb and
- there are no more interrupts
- *****************************************************/
-void RAW_FMT( int minor, const char* fmt, ... )
-{
- int ch;
- va_list va;
-
- va_start( va, fmt );
-
- while( (ch = *fmt++) )
- if( ch != '%' || (ch = *fmt++) == '%' )
- {
- if( ch == '\n' )
- dbug_out_char( minor, '\r' );
- dbug_out_char( minor, ch );
- }
- else switch( ch )
- {
- case 'c':
- dbug_out_char( minor, va_arg( va, int ) );
- continue;
- case 's':
- fmt_str( minor, va_arg( va, char* ) );
- continue;
- case 'd':
- ch = va_arg( va, int );
- if( ch >= 0 )
- fmt_num( minor, ch, 10 );
- else
- {
- dbug_out_char( minor, '-' );
- fmt_num( minor, -ch, 10 );
- }
- continue;
- case 'u':
- fmt_num( minor, va_arg( va, unsigned ), 10 );
- continue;
- case 'o':
- fmt_num( minor, va_arg( va, unsigned ), 8 );
- continue;
- case 'x':
- case 'p':
- fmt_num( minor, va_arg( va, unsigned ), 16 );
- continue;
- default: continue;
- return;
- }
- va_end( va );
-}
-
-static void fmt_num( int minor, unsigned long num, unsigned base )
-{
- char buf[33];
- int ib = sizeof(buf);
-
- buf[--ib] = 0;
- do
- {
- buf[--ib] = "0123456789ABCDEF"[num%base];
- num /= base;
- }
- while( num != 0 );
-
- fmt_str( minor, buf+ib );
-}
-
-static void fmt_str( int minor, const char* str )
-{
- if( str )
- while( *str )
- dbug_out_char( minor, *str++ );
-}
-
-
diff --git a/c/src/lib/libbsp/m68k/gen68340/include/Makefile.in b/c/src/lib/libbsp/m68k/gen68340/include/Makefile.in
deleted file mode 100644
index 1fa4362fab..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h $(srcdir)/m340uart.h $(srcdir)/m340timer.h $(srcdir)/m68340.h $(srcdir)/m68340.inc $(srcdir)/m68349.inc
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/m68k/gen68340/include/bsp.h b/c/src/lib/libbsp/m68k/gen68340/include/bsp.h
deleted file mode 100644
index dc747e46c0..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/include/bsp.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Board Support Package for `Generic' Motorola MC68340
- *
- * Based on the `gen68360' board support package, and covered by the
- * original distribution terms.
- *
- * $Id$
- */
-
-/* bsp.h
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and 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 __GEN68340_BSP_h
-#define __GEN68340_BSP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <console.h>
-#include <iosupp.h>
-#include <clockdrv.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Stuff for Time Test 27
- * Don't bother with hardware -- just use a software-interrupt
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), 34, 1 )
-
-#define Cause_tm27_intr() /* asm volatile ("trap #2"); */
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( microseconds ) \
- { register rtems_unsigned32 _delay=(microseconds); \
- register rtems_unsigned32 _tmp=123; \
- asm volatile( "0: \
- nbcd %0 ; \
- nbcd %0 ; \
- dbf %1,0b" \
- : "=d" (_tmp), "=d" (_delay) \
- : "0" (_tmp), "1" (_delay) ); \
- }
-
-/* Constants */
-
-/* Structures */
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/*
- * How many libio files we want
- */
-
-#define BSP_LIBIO_MAX_FDS 20
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-extern m68k_isr_entry M68Kvec[]; /* vector table address */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-m68k_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-/*
- * Values assigned by link editor
- */
-extern void *_RomBase, *_RamBase;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/gen68340/include/coverhd.h b/c/src/lib/libbsp/m68k/gen68340/include/coverhd.h
deleted file mode 100644
index 756b344568..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/include/coverhd.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * This file was machine-generated from the tmoverhd.exe output
- *
- * $Id$
- */
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 4
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 4
-#define CALLING_OVERHEAD_TASK_CREATE 8
-#define CALLING_OVERHEAD_TASK_IDENT 6
-#define CALLING_OVERHEAD_TASK_START 6
-#define CALLING_OVERHEAD_TASK_RESTART 5
-#define CALLING_OVERHEAD_TASK_DELETE 4
-#define CALLING_OVERHEAD_TASK_SUSPEND 4
-#define CALLING_OVERHEAD_TASK_RESUME 4
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 6
-#define CALLING_OVERHEAD_TASK_MODE 6
-#define CALLING_OVERHEAD_TASK_GET_NOTE 6
-#define CALLING_OVERHEAD_TASK_SET_NOTE 6
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 12
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 4
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 6
-#define CALLING_OVERHEAD_CLOCK_GET 12
-#define CALLING_OVERHEAD_CLOCK_SET 12
-#define CALLING_OVERHEAD_CLOCK_TICK 3
-#define CALLING_OVERHEAD_TIMER_CREATE 5
-#define CALLING_OVERHEAD_TIMER_DELETE 4
-#define CALLING_OVERHEAD_TIMER_IDENT 5
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 6
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 14
-#define CALLING_OVERHEAD_TIMER_RESET 4
-#define CALLING_OVERHEAD_TIMER_CANCEL 4
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 7
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 4
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 6
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 6
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 6
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 6
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 5
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 5
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 5
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 6
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 6
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 5
-#define CALLING_OVERHEAD_EVENT_SEND 6
-#define CALLING_OVERHEAD_EVENT_RECEIVE 6
-#define CALLING_OVERHEAD_SIGNAL_CATCH 5
-#define CALLING_OVERHEAD_SIGNAL_SEND 5
-#define CALLING_OVERHEAD_PARTITION_CREATE 8
-#define CALLING_OVERHEAD_PARTITION_IDENT 6
-#define CALLING_OVERHEAD_PARTITION_DELETE 5
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 6
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 6
-#define CALLING_OVERHEAD_REGION_CREATE 8
-#define CALLING_OVERHEAD_REGION_IDENT 5
-#define CALLING_OVERHEAD_REGION_DELETE 4
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 7
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 6
-#define CALLING_OVERHEAD_PORT_CREATE 7
-#define CALLING_OVERHEAD_PORT_IDENT 5
-#define CALLING_OVERHEAD_PORT_DELETE 5
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 6
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 6
-#define CALLING_OVERHEAD_IO_INITIALIZE 6
-#define CALLING_OVERHEAD_IO_OPEN 6
-#define CALLING_OVERHEAD_IO_CLOSE 6
-#define CALLING_OVERHEAD_IO_READ 6
-#define CALLING_OVERHEAD_IO_WRITE 6
-#define CALLING_OVERHEAD_IO_CONTROL 6
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 5
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 5
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 5
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 5
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 3
diff --git a/c/src/lib/libbsp/m68k/gen68340/include/m340timer.h b/c/src/lib/libbsp/m68k/gen68340/include/m340timer.h
deleted file mode 100644
index 3ed1f2df0e..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/include/m340timer.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Header file for timer driver
- * defines for accessing M68340 timer registers
- *
- * Author:
- * Geoffroy Montel
- * France Telecom - CNET/DSM/TAM/CAT
- * 4, rue du Clos Courtel
- * 35512 CESSON-SEVIGNE
- * FRANCE
- *
- * e-mail: g_montel@yahoo.com
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __m340timer_H__
-#define __m340timer_H__
-
-extern void Fifo_Full_Timer_initialize (void);
-
-extern void (*Restart_Fifo_Full_A_Timer)();
-extern void (*Restart_Check_A_Timer)();
-extern void (*Restart_Fifo_Full_B_Timer)();
-extern void (*Restart_Check_B_Timer)();
-
-/* CR */
-#define m340_SWR (1<<15)
-#define m340_Polling_Mode (0<<12)
-#define m340_TC_Enabled (1<<12)
-#define m340_TG_Enabled (2<<12)
-#define m340_TG_TC_Enabled (3<<12)
-#define m340_TO_Enabled (4<<12)
-#define m340_TO_TC_Enabled (5<<12)
-#define m340_TG_TG_Enabled (6<<12)
-#define m340_TO_TG_TG_Enabled (7<<12)
-#define m340_TGE (1<<11)
-#define m340_PSE (1<<10)
-#define m340_CPE (1<<9)
-#define m340_CLK (1<<8)
-#define m340_Divide_by_2 (1<<5)
-#define m340_Divide_by_4 (2<<5)
-#define m340_Divide_by_8 (3<<5)
-#define m340_Divide_by_16 (4<<5)
-#define m340_Divide_by_32 (5<<5)
-#define m340_Divide_by_64 (6<<5)
-#define m340_Divide_by_128 (7<<5)
-#define m340_Divide_by_256 (0<<5)
-#define m340_ICOC (0<<2)
-#define m340_SWG (1<<2)
-#define m340_VDCSWG (2<<2)
-#define m340_VWSSPG (3<<2)
-#define m340_PWM (4<<2)
-#define m340_PM (5<<2)
-#define m340_EC (6<<2)
-#define m340_TB (7<<2)
-#define m340_Disabled 0
-#define m340_Toggle_Mode 1
-#define m340_Zero_Mode 2
-#define m340_One_Mode 3
-
-/* SR */
-#define m340_IRQ (1<<15)
-#define m340_TO (1<<14)
-#define m340_TG (1<<13)
-#define m340_TC (1<<12)
-#define m340_TGL (1<<11)
-#define m340_ON (1<<10)
-#define m340_OUT (1<<9)
-#define m340_COM (1<<8)
-
-
-#endif
diff --git a/c/src/lib/libbsp/m68k/gen68340/include/m340uart.h b/c/src/lib/libbsp/m68k/gen68340/include/m340uart.h
deleted file mode 100644
index 3c3cf3eb17..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/include/m340uart.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Header file for console driver
- * defines for accessing M68340/68349 UART registers
- *
- * Author:
- * Geoffroy Montel
- * France Telecom - CNET/DSM/TAM/CAT
- * 4, rue du Clos Courtel
- * 35512 CESSON-SEVIGNE
- * FRANCE
- *
- * e-mail: g_montel@yahoo.com
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __m340uart_H__
-#define __m340uart_H__
-
-/* UART initialisation */
-#define UART_CHANNEL_A 0
-#define UART_CHANNEL_B 1
-#define UART_NUMBER_OF_CHANNELS 2
-#define UART_CONSOLE_NAME "/dev/console"
-#define UART_RAW_IO_NAME "/dev/tty1"
-#define UART_FIFO_FULL 0
-#define UART_CRR 1
-#define UART_INTERRUPTS 0
-#define UART_POLLING 1
-#define UART_TERMIOS_CONSOLE 0
-#define UART_TERMIOS_RAW 1
-#define UART_TERMIOS_MIN_DEFAULT 1
-#define UART_TERMIOS_TIME_DEFAULT 0
-
-void Init_UART_Table(void);
-
-typedef struct {
- rtems_unsigned8 enable;
- rtems_unsigned16 rx_buffer_size; /* NOT IMPLEMENTED */
- rtems_unsigned16 tx_buffer_size; /* NOT IMPLEMENTED */
- } uart_termios_config;
-
-typedef struct { /* for one channel */
- rtems_unsigned8 enable; /* use this channel */
- char name[64]; /* use UART_CONSOLE_NAME for console purpose */
- rtems_unsigned8 parity_mode; /* parity mode, see MR1 section for defines */
- rtems_unsigned8 bits_per_char; /* bits per character, see MR1 section for defines */
- float rx_baudrate; /* Rx baudrate */
- float tx_baudrate; /* Tx baudrate */
- rtems_unsigned8 rx_mode; /* FIFO Full (UART_FIFO_FULL) or ChannelReceiverReady (UART_CRR) */
- rtems_unsigned8 mode; /* use interrupts (UART_INTERRUPTS) or polling (UART_POLLING) */
- uart_termios_config termios;
- } uart_channel_config;
-
-extern uart_channel_config m340_uart_config[UART_NUMBER_OF_CHANNELS];
-
-typedef struct {
- int set; /* number of the m340 baud speed set */
- int rcs; /* RCS for the needed baud set */
- int tcs; /* TCS for the needed baud set */
- } t_baud_speed;
-
-typedef struct {
- t_baud_speed baud_speed_table[2];
- short nb;
- } t_baud_speed_table;
-
-extern t_baud_speed_table
-Find_Right_m340_UART_Config(float ChannelA_ReceiverBaudRate, float ChannelA_TransmitterBaudRate, rtems_unsigned8 enableA,
- float ChannelB_ReceiverBaudRate, float ChannelB_TransmitterBaudRate, rtems_unsigned8 enableB);
-
-extern rtems_isr InterruptHandler (rtems_vector_number v);
-
-extern float termios_baud_rates_equivalence ( int speed ) ;
-extern int dbugRead (int minor);
-extern int dbugWrite (int minor, const char *buf, int len);
-
-extern float m340_Baud_Rates_Table[16][2];
-
-/* SR */
-#define m340_Rx_RDY 1
-#define m340_FFULL (1<<1)
-#define m340_Tx_RDY (1<<2)
-#define m340_TxEMP (1<<3)
-#define m340_OE (1<<4)
-#define m340_PE (1<<5)
-#define m340_FE (1<<6)
-#define m340_RB (1<<7)
-
-/* IER */
-#define m340_TxRDYA 1
-#define m340_RxRDYA (1<<1)
-#define m340_TxRxRDYA 0x3
-#define m340_TxRDYB (1<<4)
-#define m340_RxRDYB (1<<5)
-#define m340_TxRxRDYB 0x30
-
-/* CR */
-#define m340_Reset_Error_Status 0x40
-#define m340_Reset_Receiver 0x20
-#define m340_Reset_Transmitter 0x30
-#define m340_Transmitter_Enable (1<<2)
-#define m340_Receiver_Enable 1
-#define m340_Transmitter_Disable (2<<2)
-#define m340_Receiver_Disable 2
-
-/* ACR */
-#define m340_BRG_Set1 0
-#define m340_BRG_Set2 (1<<7)
-
-/* OPCR */
-#define m340_OPCR_Gal 0x0
-#define m340_OPCR_Aux 0xFF
-
-/* ISR */
-#define m340_COS (1<<7)
-#define m340_DBB (1<<6)
-#define m340_XTAL_RDY (1<<3)
-#define m340_DBA (1<<2)
-
-/* MR1 */
-#define m340_RxRTS (1<<7)
-#define m340_R_F (1<<6) /* character or block mode */
-#define m340_ERR (1<<5)
-#define m340_RxRTX (1<<7)
-#define m340_Even_Parity 0
-#define m340_Odd_Parity (1<<2)
-#define m340_Low_Parity (2<<2)
-#define m340_High_Parity (3<<2)
-#define m340_No_Parity (4<<2)
-#define m340_Data_Character (6<<2)
-#define m340_Address_Character (7<<2)
-#define m340_5bpc 0x0
-#define m340_6bpc 0x1
-#define m340_7bpc 0x2
-#define m340_8bpc 0x3
-
-/* MR2 */
-#define m340_normal (0<<6)
-#define m340_automatic_echo (1<<6)
-#define m340_local_loopback (2<<6)
-#define m340_remote_loopback (3<<6)
-#define m340_TxRTS (1<<5)
-#define m340_TxCTS (1<<4)
-
-/* Baud rates for Transmitter/Receiver */
-#define SCLK 1 /* put your own SCLK value here */
-
-#endif
diff --git a/c/src/lib/libbsp/m68k/gen68340/include/m68340.h b/c/src/lib/libbsp/m68k/gen68340/include/m68340.h
deleted file mode 100644
index 87b626ed87..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/include/m68340.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/**********************************************************************
- * MC68340 C Header File *
- * *
- * Developed by : Motorola *
- * High Performance Embedded Systems Division *
- * Austin, TX *
- * Rectified by : Geoffroy Montel
- * g_montel@yahoo.com *
- * *
- **********************************************************************/
-
-typedef volatile unsigned char * portb; /* 8-bit port */
-typedef volatile unsigned short * portw; /* 16-bit port */
-typedef volatile unsigned int * portl; /* 32-bit port */
-
-#define MBASE 0xEFFFF000 /* Module Base Address */
- /* not EFFFF000 due to a 68349
- hardware incompatibility */
-
-#define MBAR (*(portb) 0x0003FF00) /* Module Base Addr Reg */
-#define MBAR1 (*(portb) 0x0003FF00) /* Module Base Addr Reg 1 (MSW) */
-#define MBAR2 (*(portb) 0x0003FF02) /* Module Base Addr Reg 2 (LSW) */
-
-/* System Integration Module */
-
-#define SIMMCR (*(portw) (MBASE+0x0000)) /* SIM Module Config Reg */
-#define SIMSYNCR (*(portw) (MBASE+0x0004)) /* SIM Clock Synth Cont Reg */
-#define SIMAVR (*(portb) (MBASE+0x0006)) /* SIM Autovector Reg */
-#define SIMRSR (*(portb) (MBASE+0x0007)) /* SIM Reset Status Reg */
-#define SIMPORTA (*(portb) (MBASE+0x0011)) /* SIM Port A Data Reg */
-#define SIMDDRA (*(portb) (MBASE+0x0013)) /* SIM Port A Data Dir Reg */
-#define SIMPPRA1 (*(portb) (MBASE+0x0015)) /* SIM Port A Pin Asm 1 Reg */
-#define SIMPPRA2 (*(portb) (MBASE+0x0017)) /* SIM Port A Pin Asm 2 Reg */
-#define SIMPORTB (*(portb) (MBASE+0x0019)) /* SIM Port B Data Reg */
-#define SIMPORTB1 (*(portb) (MBASE+0x001B)) /* SIM Port B Data Reg */
-#define SIMDDRB (*(portb) (MBASE+0x001D)) /* SIM Port B Data Dir Reg */
-#define SIMPPARB (*(portb) (MBASE+0x001F)) /* SIM Port B Pin Asm Reg */
-#define SIMSWIV (*(portb) (MBASE+0x0020)) /* SIM SW Interrupt Vector */
-#define SIMSYPCR (*(portb) (MBASE+0x0021)) /* SIM System Prot Cont Reg */
-#define SIMPICR (*(portw) (MBASE+0x0022)) /* SIM Period Intr Cont Reg */
-#define SIMPITR (*(portw) (MBASE+0x0024)) /* SIM Period Intr Tmg Reg */
-#define SIMSWSR (*(portb) (MBASE+0x0027)) /* SIM Software Service Reg */
-
-#define SIMCS0AM (*(portl) (MBASE+0x0040)) /* SIM Chp Sel 0 Addr Msk */
-#define SIMCS0AM1 (*(portw) (MBASE+0x0040)) /* SIM Chp Sel 0 Addr Msk 1 */
-#define SIMCS0AM2 (*(portw) (MBASE+0x0042)) /* SIM Chp Sel 0 Addr Msk 2 */
-#define SIMCS0BA (*(portl) (MBASE+0x0044)) /* SIM Chp Sel 0 Base Addr */
-#define SIMCS0BA1 (*(portw) (MBASE+0x0044)) /* SIM Chp Sel 0 Bas Addr 1 */
-#define SIMCS0BA2 (*(portw) (MBASE+0x0046)) /* SIM Chp Sel 0 Bas Addr 2 */
-#define SIMCS1AM (*(portl) (MBASE+0x0048)) /* SIM Chp Sel 1 Adress Msk */
-#define SIMCS1AM1 (*(portw) (MBASE+0x0048)) /* SIM Chp Sel 1 Addr Msk 1 */
-#define SIMCS1AM2 (*(portw) (MBASE+0x004A)) /* SIM Chp Sel 1 Addr Msk 2 */
-#define SIMCS1BA (*(portl) (MBASE+0x004C)) /* SIM Chp Sel 1 Base Addr */
-#define SIMCS1BA1 (*(portw) (MBASE+0x004C)) /* SIM Chp Sel 1 Bas Addr 1 */
-#define SIMCS1BA2 (*(portw) (MBASE+0x004E)) /* SIM Chp Sel 1 Bas Addr 2 */
-#define SIMCS2AM (*(portl) (MBASE+0x0050)) /* SIM Chp Sel 2 Addr Msk */
-#define SIMCS2AM1 (*(portw) (MBASE+0x0050)) /* SIM Chp Sel 2 Addr Msk 1 */
-#define SIMCS2AM2 (*(portw) (MBASE+0x0052)) /* SIM Chp Sel 2 Addr Msk 2 */
-#define SIMCS2BA (*(portl) (MBASE+0x0054)) /* SIM Chp Sel 2 Base Addr */
-#define SIMCS2BA1 (*(portw) (MBASE+0x0054)) /* SIM Chp Sel 2 Bas Addr 1 */
-#define SIMCS2BA2 (*(portw) (MBASE+0x0056)) /* SIM Chp Sel 2 Bas Addr 2 */
-#define SIMCS3AM (*(portl) (MBASE+0x0058)) /* SIM Chp Sel 3 Addr Msk */
-#define SIMCS3AM1 (*(portw) (MBASE+0x0058)) /* SIM Chp Sel 3 Addr Msk 1 */
-#define SIMCS3AM2 (*(portw) (MBASE+0x005A)) /* SIM Chp Sel 3 Addr Msk 2 */
-#define SIMCS3BA (*(portl) (MBASE+0x005C)) /* SIM Chp Sel 3 Base Addr */
-#define SIMCS3BA1 (*(portw) (MBASE+0x005C)) /* SIM Chp Sel 3 Bas Addr 1 */
-#define SIMCS3BA2 (*(portw) (MBASE+0x005E)) /* SIM Chp Sel 3 Bas Addr 2 */
-
-/* Dynamic Memory Access (DMA) Module */
-
-#define DMAMCR1 (*(portw) (MBASE+0x0780)) /* DMA Module Config Reg 1 */
-#define DMAINTR1 (*(portw) (MBASE+0x0784)) /* DMA Interrupt Reg 1 */
-#define DMACCR1 (*(portw) (MBASE+0x0788)) /* DMA Channel Cont Reg 1 */
-#define DMACSR1 (*(portb) (MBASE+0x078A)) /* DMA Channel Status Reg 1 */
-#define DMAFCR1 (*(portb) (MBASE+0x078B)) /* DMA Function Code Reg 1 */
-#define DMASAR1 (*(portl) (MBASE+0x078C)) /* DMA DMA Src Addr Reg 1 */
-#define DMADAR1 (*(portl) (MBASE+0x0790)) /* DMA Dest Addr Reg 1 */
-#define DMABTC1 (*(portb) (MBASE+0x079l)) /* DMA Byte Trans Cnt Reg 1 */
-
-#define DMAMCR2 (*(portw) (MBASE+0x07A0)) /* DMA Module Config Reg 2 */
-#define DMAINTR2 (*(portw) (MBASE+0x07A4)) /* DMA Interrupt Reg 2 */
-#define DMACCR2 (*(portw) (MBASE+0x07A8)) /* DMA Channel Cont Reg 2 */
-#define DMACSR2 (*(portb) (MBASE+0x07AA)) /* DMA Channel Status Reg 2 */
-#define DMAFCR2 (*(portb) (MBASE+0x07AB)) /* DMA Function Code Reg 1 */
-#define DMASAR2 (*(portl) (MBASE+0x07AC)) /* DMA Source Addr Reg 2 */
-#define DMADAR2 (*(portl) (MBASE+0x07B0)) /* DMA Dest Addr Reg 2 */
-#define DMABTC2 (*(portb) (MBASE+0x07B4)) /* DMA Byte Trans Cnt Reg 2 */
-
-/* Dual Serial Module */
-
-#define DUMCRH (*(portb) (MBASE+0x0700)) /* DUART Module Config Reg */
-#define DUMCRL (*(portb) (MBASE+0x0701)) /* DUART Module Config Reg */
-#define DUILR (*(portb) (MBASE+0x0704)) /* DUART Interrupt Level */
-#define DUIVR (*(portb) (MBASE+0x0705)) /* DUART Interrupt Vector */
-#define DUMR1A (*(portb) (MBASE+0x0710)) /* DUART Mode Reg 1A */
-#define DUSRA (*(portb) (MBASE+0x0711)) /* DUART Status Reg A */
-#define DUCSRA (*(portb) (MBASE+0x0711)) /* DUART Clock Sel Reg A */
-#define DUCRA (*(portb) (MBASE+0x0712)) /* DUART Command Reg A */
-#define DURBA (*(portb) (MBASE+0x0713)) /* DUART Receiver Buffer A */
-#define DUTBA (*(portb) (MBASE+0x0713)) /* DUART Transmitter Buff A */
-#define DUIPCR (*(portb) (MBASE+0x0714)) /* DUART Input Port Chg Reg */
-#define DUACR (*(portb) (MBASE+0x0714)) /* DUART Auxiliary Cont Reg */
-#define DUISR (*(portb) (MBASE+0x0715)) /* DUART Interrupt Stat Reg */
-#define DUIER (*(portb) (MBASE+0x0715)) /* DUART Interrupt Enb Reg */
-
-#define DUMR1B (*(portb) (MBASE+0x0718)) /* DUART Mode Reg 1B */
-#define DUSRB (*(portb) (MBASE+0x0719)) /* DUART Status Reg B */
-#define DUCSRB (*(portb) (MBASE+0x0719)) /* DUART Clock Sel Reg B */
-#define DUCRB (*(portb) (MBASE+0x071A)) /* DUART Command Reg B */
-#define DURBB (*(portb) (MBASE+0x071B)) /* DUART Receiver Buffer B */
-#define DUTBB (*(portb) (MBASE+0x071B)) /* DUART Transmitter Buff B */
-#define DUIP (*(portb) (MBASE+0x071D)) /* DUART Input Port Reg */
-#define DUOPCR (*(portb) (MBASE+0x071D)) /* DUART Outp Port Cnt Reg */
-#define DUOPBS (*(portb) (MBASE+0x071E)) /* DUART Outp Port Bit Set */
-#define DUOPBR (*(portb) (MBASE+0x071F)) /* DUART Outp Port Bit Rst */
-#define DUMR2A (*(portb) (MBASE+0x0720)) /* DUART Mode Reg 2A */
-#define DUMR2B (*(portb) (MBASE+0x0721)) /* DUART Mode Reg 2B */
-
-/* Dual Timer Module */
-
-#define TMCR1 (*(portw) (MBASE+0x0600)) /* Timer Module Config Reg 1 */
-#define TIR1 (*(portw) (MBASE+0x0604)) /* Timer Interrupt Reg 1 */
-#define TCR1 (*(portw) (MBASE+0x0606)) /* Timer Control Reg 1 */
-#define TSR1 (*(portw) (MBASE+0x0608)) /* Timer Status Reg 1 */
-#define TCNTR1 (*(portw) (MBASE+0x060A)) /* Timer Counter Reg 1 */
-#define WPREL11 (*(portw) (MBASE+0x060C)) /* Timer Preload 1 Reg 1 */
-#define WPREL21 (*(portw) (MBASE+0x060E)) /* Timer Preload 2 Reg 1 */
-#define TCOM1 (*(portw) (MBASE+0x0610)) /* Timer Compare Reg 1 */
-
-#define TMCR2 (*(portw) (MBASE+0x0640)) /* Timer Module Config Reg 2 */
-#define TIR2 (*(portw) (MBASE+0x0644)) /* Timer Interrupt Reg 2 */
-#define TCR2 (*(portw) (MBASE+0x0646)) /* Timer Control Reg 2 */
-#define TSR2 (*(portw) (MBASE+0x0648)) /* Timer Status Reg 2 */
-#define TCNTR2 (*(portw) (MBASE+0x064A)) /* Timer Counter Reg 2 */
-#define WPREL12 (*(portw) (MBASE+0x064C)) /* Timer Preload 1 Reg 2 */
-#define WPREL22 (*(portw) (MBASE+0x064E)) /* Timer Preload 2 Reg 2 */
-#define TCOM2 (*(portw) (MBASE+0x0650)) /* Timer Compare Reg 2 */
-
-
-
diff --git a/c/src/lib/libbsp/m68k/gen68340/include/m68340.inc b/c/src/lib/libbsp/m68k/gen68340/include/m68340.inc
deleted file mode 100644
index 5c1ba36799..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/include/m68340.inc
+++ /dev/null
@@ -1,148 +0,0 @@
-/*----------------------------------------------------------------------------
-* file name: M68340.INC JC RAHUEL CNET/DSM/TAM/CAT
-*
-* MC68340 BCC Board Support Package
-*
-* date: 1/12/1993
-*
-* Copyright 1989, Ready Systems FRANCE
-*
-* Supports: VRTX32 and RTscope
-*
-* Related Board: MOTOROLA BCC M68340
-*
-* Description: EQUATES FOR 68340 DEVICES
-*
-* Changes:
-* - Geoffroy Montel (g_montel@yahoo.com) :
-* changed EQU syntax for GNU as
-*
-*----------------------------------------------------------------------------*/
-
-/************************************************
- * ATTENTION: must match defs. in C header file *
- ************************************************/
-
-/* -- SIM equates -- system integration module */
-.equ BASE_REG, 0x3FF00
-.equ BASE_SIM, 0xEFFFF000
-.equ SIM_MCR, 0x000 /* module configuration register */
-.equ SIM_SYNCR, 0x004 /* clock synthesizer control register */
-.equ SIM_AVR, 0x006 /* autovector register */
-.equ SIM_RSR, 0x007 /* reset status register */
-
-/* -- Port A -- */
-.equ SIM_PORTA, 0x011 /* port A data */
-.equ SIM_DDRA, 0x013 /* port A direction data */
-.equ SIM_PPRA1, 0x015 /* Port A pin assignement 1 */
-.equ SIM_PPRA2, 0x017 /* Port A pin assignement 2 */
-
-/* -- Port B -- */
-.equ SIM_PORTB, 0x019 /* port B data */
-.equ SIM_PORTB1, 0x01B /* port B data auxiliary */
-.equ SIM_DDRB, 0x01D /* port B direction data */
-.equ SIM_PPRB, 0x01F /* Port B pin assignement */
-.equ SIM_SWIV, 0x020 /* SW interrupt vector */
-.equ SIM_SYPCR, 0x021 /* System protection control register */
-.equ SIM_PICR, 0x022 /* Periodic interrupt control register */
-.equ SIM_PITR, 0x024 /* Periodic interrupt timing register */
-.equ SIM_SWSR, 0x027 /* Sofware service */
-
-/* -- Chip select -- */
-.equ SIM_MASKH0, 0x040 /* mask register CS0 */
-.equ SIM_MASKL0, 0x042 /* mask register CS0 */
-.equ SIM_ADDRH0, 0x044 /* base address CS0 */
-.equ SIM_ADDRL0, 0x046 /* base address CS0 */
-.equ SIM_MASKH1, 0x048 /* mask register CS1 */
-.equ SIM_MASKL1, 0x04A /* mask register CS1 */
-.equ SIM_ADDRH1, 0x04C /* base address CS1 */
-.equ SIM_ADDRL1, 0x04E /* base address CS1 */
-.equ SIM_MASKH2, 0x050 /* mask register CS2 */
-.equ SIM_MASKL2, 0x052 /* mask register CS2 */
-.equ SIM_ADDRH2, 0x054 /* base address CS2 */
-.equ SIM_ADDRL2, 0x056 /* base address CS2 */
-.equ SIM_MASKH3, 0x058 /* mask register CS3 */
-.equ SIM_MASKL3, 0x05A /* mask register CS3 */
-.equ SIM_ADDRH3, 0x05C /* base address CS3 */
-.equ SIM_ADDRL3, 0x05E /* base address CS3 */
-
-/* -- TIMERS equates -- */
-
-/* __ TIMER 0 */
-.equ TIM_MCR0, 0x600 /* Module configuration register */
-.equ TIM_IR0, 0x604 /* interrupt register */
-.equ TIM_CR0, 0x606 /* controle register */
-.equ TIM_SR0, 0x608 /* Status/prescaler register */
-.equ TIM_CNTR0, 0x60A /* counter register */
-.equ TIM_PREL10, 0x60C /* Preload register 1 */
-.equ TIM_PREL20, 0x60E /* Preload register 2 */
-.equ TIM_COM0, 0x610 /* Compare register */
-
-/* __ TIMER 1 */
-
-.equ TIM_MCR1, 0x640 /* Module configuration register */
-.equ TIM_IR1, 0x644 /* interrupt register */
-.equ TIM_CR1, 0x646 /* controle register */
-.equ TIM_SR1, 0x648 /* Status/prescaler register */
-.equ TIM_CNTR1, 0x64A /* counter register */
-.equ TIM_PREL11, 0x64C /* Preload register 1 */
-.equ TIM_PREL21, 0x64E /* Preload register 2 */
-.equ TIM_COM1, 0x650 /* Compare register */
-
-/* -- U.A.R.T. equates -- */
-
-.equ UA_MCRH, 0x700 /* module configuration register */
-.equ UA_MCRL, 0x701 /* module configuration register */
-.equ UA_ILR, 0x704 /* Interrupt level */
-.equ UA_IVR, 0x705 /* Interrupt vector */
-.equ UA_MR1A, 0x710 /* Mode register 1 A */
-.equ UA_MR2A, 0x720 /* Mode register 2 A*/
-.equ UA_CSRA, 0x711 /* Clock_select register A */
-.equ UA_SRA, 0x711 /* status register A */
-.equ UA_CRA, 0x712 /* command register A */
-.equ UA_RBA, 0x713 /* receive buffer A */
-.equ UA_TBA, 0x713 /* transmit buffer A */
-.equ UA_IPCR, 0x714 /* input port change register */
-.equ UA_ACR, 0x714 /* auxiliary control register */
-.equ UA_ISR, 0x715 /* interrupt status register */
-.equ UA_IER, 0x715 /* interrupt enable register */
-.equ UA_MR1B, 0x718 /* Mode register 1 B */
-.equ UA_MR2B, 0x721 /* Mode register 2 B */
-.equ UA_CSRB, 0x719 /* Clock_select register B */
-.equ UA_SRB, 0x719 /* status register B */
-.equ UA_CRB, 0x71A /* command register A */
-.equ UA_RBB, 0x71B /* receive buffer A */
-.equ UA_TBB, 0x71B /* transmit buffer A */
-.equ UA_IP, 0x71D /* Input port register */
-.equ UA_OPCR, 0x71D /* output port control register */
-.equ UA_OPS, 0x71E /* output port bit set */
-.equ UA_OPR, 0x71F /* output port bit reset */
-.equ TX_A_EN, 0x01 /* Tx A irq enable */
-.equ TX_B_EN, 0x10 /* Tx B irq enable */
-.equ TX_A_DIS, 0xFE /* Tx A irq enable */
-.equ TX_B_DIS, 0xEF /* Tx B irq enable */
-.equ TX_AB_DIS, 0x22
-
-/* -- DMA equates -- */
-.equ DMA_MCR0, 0x780 /* module configuration register */
-.equ DMA_IR0, 0x784 /* Interrupt register */
-.equ DMA_CCR0, 0x788 /* Channel control register */
-.equ DMA_CSR0, 0x78A /* Channel status register */
-.equ DMA_FCR0, 0x78B /* Function code register */
-.equ DMA_SARH0, 0x78C /* Source adresse register */
-.equ DMA_SARL0, 0x78E /* Source adresse register */
-.equ DMA_DARH0, 0x790 /* destination adresse register */
-.equ DMA_DARL0, 0x792 /* destination adresse register */
-.equ DMA_BTCH0, 0x794 /* byte transfer register */
-.equ DMA_BTCL0, 0x796 /* byte transfer register */
-.equ DMA_MCR1, 0x7A0 /* module configuration register */
-.equ DMA_IR1, 0x7A4 /* Interrupt register */
-.equ DMA_CCR1, 0x7A8 /* Channel control register */
-.equ DMA_CSR1, 0x7AA /* Channel status register */
-.equ DMA_FCR1, 0x7AB /* Function code register */
-.equ DMA_SARH1, 0x7AC /* Source adresse register */
-.equ DMA_SARL1, 0x7AE /* Source adresse register */
-.equ DMA_DARH1, 0x7B0 /* destination adresse register */
-.equ DMA_DARL1, 0x7B2 /* destination adresse register */
-.equ DMA_BTCH1, 0x7B4 /* byte transfer register */
-.equ DMA_BTCL1, 0x7B6 /* byte transfer register */
diff --git a/c/src/lib/libbsp/m68k/gen68340/include/m68349.inc b/c/src/lib/libbsp/m68k/gen68340/include/m68349.inc
deleted file mode 100644
index df609f5ab7..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/include/m68349.inc
+++ /dev/null
@@ -1,410 +0,0 @@
-/*----------------------------------------------------------------------------
- * file name: M68349.INC P. CADIC CNET/DSM/TAM/CAT
- *
- * MC68349 BCC Board Support Package
- *
- * date: 31/07/97
- *
- * Description: EQUATES FOR 68349 DEVICES
- *
- * Modifications:
- * - adapted for GNU CC by G.Montel 26/05/98
- *----------------------------------------------------------------------------*/
-
-| -- SIM equates --
-
-.equ BASE_REG, 0x3FF00
-.equ BASE_SIM, 0xEFFFF000 | pour correction du bug 68349 sur IACK
-
-.equ SIM_MCR, 0x000 | module configuration register
-.equ SIM_IDR, 0x002 | processor identification register
-.equ SIM_SYNCR, 0x004 | clock synthesizer control register
-.equ SIM_AVR, 0x006 | autovector register
-.equ SIM_RSR, 0x007 | reset status register
-
-| -- Port A
-.equ SIM_PORTA, 0x011 | port A data
-.equ SIM_DDRA, 0x013 | port A direction data
-.equ SIM_PPRA1, 0x015 | Port A pin assignement 1
-.equ SIM_PPRA2, 0x017 | Port A pin assignement 2
-
-| -- Port B
-.equ SIM_PORTB, 0x019 | port B data
-.equ SIM_PORTB1, 0x01B | port B data auxiliary
-.equ SIM_DDRB, 0x01D | port B direction data
-.equ SIM_PPRB, 0x01F | Port B pin assignement
-
-.equ SIM_SWIV, 0x020 | SW interrupt vector
-.equ SIM_SYPCR, 0x021 | System protection control register
-.equ SIM_PICR, 0x022 | Periodic interrupt control register
-.equ SIM_PITR, 0x024 | Periodic interrupt timing register
-.equ SIM_SWSR, 0x027 | Sofware service
-
-| -- Chip select
-.equ SIM_MASKH0, 0x040 | mask register CS0
-.equ SIM_MASKL0, 0x042 | mask register CS0
-.equ SIM_ADDRH0, 0x044 | base address CS0
-.equ SIM_ADDRL0, 0x046 | base address CS0
-
-.equ SIM_MASKH1, 0x048 | mask register CS1
-.equ SIM_MASKL1, 0x04A | mask register CS1
-.equ SIM_ADDRH1, 0x04C | base address CS1
-.equ SIM_ADDRL1, 0x04E | base address CS1
-
-.equ SIM_MASKH2, 0x050 | mask register CS2
-.equ SIM_MASKL2, 0x052 | mask register CS2
-.equ SIM_ADDRH2, 0x054 | base address CS2
-.equ SIM_ADDRL2, 0x056 | base address CS2
-
-.equ SIM_MASKH3, 0x058 | mask register CS3
-.equ SIM_MASKL3, 0x05A | mask register CS3
-.equ SIM_ADDRH3, 0x05C | base address CS3
-.equ SIM_ADDRL3, 0x05E | base address CS3
-
-| -- TIMERS equates --
-
-| __ TIMER 0
-
-.equ TIM_MCR0, 0x600 | Module configuration register
-.equ TIM_IR0, 0x604 | interrupt register
-.equ TIM_CR0, 0x606 | controle register
-.equ TIM_SR0, 0x608 | Status/prescaler register
-.equ TIM_CNTR0, 0x60A | counter register
-.equ TIM_PREL10, 0x60C | Preload register 1
-.equ TIM_PREL20, 0x60E | Preload register 2
-.equ TIM_COM0, 0x610 | Compare register
-
-| __ TIMER 1
-
-.equ TIM_MCR1, 0x640 | Module configuration register
-.equ TIM_IR1, 0x644 | interrupt register
-.equ TIM_CR1, 0x646 | controle register
-.equ TIM_SR1, 0x648 | Status/prescaler register
-.equ TIM_CNTR1, 0x64A | counter register
-.equ TIM_PREL11, 0x64C | Preload register 1
-.equ TIM_PREL21, 0x64E | Preload register 2
-.equ TIM_COM1, 0x650 | Compare register
-
-| -- U.A.R.T. equates --
-
-.equ UA_MCRH, 0x700 | module configuration register
-.equ UA_MCRL, 0x701 | module configuration register
-.equ UA_ILR, 0x704 | Interrupt level
-.equ UA_IVR, 0x705 | Interrupt vector
-
-.equ UA_MR1A, 0x710 | Mode register 1 A
-.equ UA_MR2A, 0x720 | Mode register 2 A
-.equ UA_CSRA, 0x711 | Clock_select regiter A
-.equ UA_SRA, 0x711 | status register A
-.equ UA_CRA, 0x712 | command register A
-.equ UA_RBA, 0x713 | receive buffer A
-.equ UA_TBA, 0x713 | transmit buffer A
-
-.equ UA_IPCR, 0x714 | input port change register
-.equ UA_ACR, 0x714 | auxiliary control register
-.equ UA_ISR, 0x715 | interrupt status register
-.equ UA_IER, 0x715 | interrupt enable register
-
-.equ UA_MR1B, 0x718 | Mode register 1 B
-.equ UA_MR2B, 0x721 | Mode register 2 B
-.equ UA_CSRB, 0x719 | Clock_select regiter B
-.equ UA_SRB, 0x719 | status register B
-.equ UA_CRB, 0x71A | command register A
-.equ UA_RBB, 0x71B | receive buffer A
-.equ UA_TBB, 0x71B | transmit buffer A
-
-.equ UA_IP, 0x71D | Input port register
-.equ UA_OPCR, 0x71D | output port control register
-.equ UA_OPS, 0x71E | output port bit set
-.equ UA_OPR, 0x71F | output port bit reset
-.equ TX_A_EN, 0x01 | Tx A irq enable
-.equ TX_B_EN, 0x10 | Tx B irq enable
-.equ TX_A_DIS, 0xFE | Tx A irq enable
-.equ TX_B_DIS, 0xEF | Tx B irq enable
-.equ TX_AB_DIS, 0x22
-
-
-| -- DMA equates
-.equ DMA_MCR0, 0x780 | module configuration register
-.equ DMA_IR0, 0x784 | Interrupt register
-.equ DMA_CCR0, 0x788 | Channel control register
-.equ DMA_CSR0, 0x78A | Channel status register
-.equ DMA_FCR0, 0x78B | Function code register
-.equ DMA_SARH0, 0x78C | Source adresse register
-.equ DMA_SARL0, 0x78E | Source adresse register
-.equ DMA_DARH0, 0x790 | destination adresse register
-.equ DMA_DARL0, 0x792 | destination adresse register
-.equ DMA_BTCH0, 0x794 | byte transfer register
-.equ DMA_BTCL0, 0x796 | byte transfer register
-
-.equ DMA_MCR1, 0x7A0 | module configuration register
-.equ DMA_IR1, 0x7A4 | Interrupt register
-.equ DMA_CCR1, 0x7A8 | Channel control register
-.equ DMA_CSR1, 0x7AA | Channel status register
-.equ DMA_FCR1, 0x7AB | Function code register
-.equ DMA_SARH1, 0x7AC | Source adresse register
-.equ DMA_SARL1, 0x7AE | Source adresse register
-.equ DMA_DARH1, 0x7B0 | destination adresse register
-.equ DMA_DARL1, 0x7B2 | destination adresse register
-.equ DMA_BTCH1, 0x7B4 | byte transfer register
-.equ DMA_BTCL1, 0x7B6 | byte transfer register
-
-| -- cache equates
-.equ CACHE_MCR, 0xFC0 | cache config reg. (long)
-
-| -- quad data memory module (QDMM) equates
-.equ QDMM_MCR, 0xC00 | QDMM config reg (long)
-.equ QDMM_QBAR0, 0xC10 | QDMM base 0 (long)
-.equ QDMM_QBAR1, 0xC14 | QDMM base 1 (long)
-.equ QDMM_QBAR2, 0xC18 | QDMM base 2 (long)
-.equ QDMM_QBAR3, 0xC1C | QDMM base 3 (long)
-
-
-
-|-----------------------------------------------------
-| AST68349 internal registers
-|-----------------------------------------------------
-.equ EPLD_SPACE, 3 | "reserved user" space
-.equ CPU_SPACE, 7 | "CPU" space
-
-||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-| GLUE EPLD
-||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-
-.equ GLUE_EPLD, 0xB0000000
-
-|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| configuration of /CS0 :
-|
-| 7 6 5 4 3 2 1 0
-| +---+---+---+---+---+---+---+---+
-| |ena|val|wid| ws|b31|b30|b29|b28|
-| +---+---+---+---+---+---+---+---+
-|
-| b[31..28] : base address for decoding /CS[3..0]
-| the decoding is as follow :
-|
-| +----------+------------+------+
-| | a[31..28] | a[27..26] | /CS |
-| +-----------+-----------+------+
-| | b[31..28] | 00 | /CS0 | each /CS decodes 64 Mbytes
-| | b[31..28] | 01 | /CS1 |
-| | b[31..28] | 10 | /CS2 |
-| | b[31..28] | 11 | /CS3 |
-| +-----------------------+------+
-|
-| after /RESET, /CS0 is validated for every cycle, until programmed
-|
-| ws : number of wait-states : 0 => 0 ws
-| 1 => external /dsackx
-| wid : width of chip-select : 0 => 16 bits
-| 1 => 32 bits
-| ena : enable chip-select : 0 => disabled
-| 1 => enabled
-|
-| val : automatic validation. set after reset
-| cleared when /CS0 is configured
-|
-.equ REG_CS0, 0
-
-
-|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| configuration of /CS1 to /CS3:
-|
-| 7 6 5 4 3 2 1 0
-| +---+---+---+---+---+---+---+---+
-| |ena| x |wid| ws| x | x | x | x |
-| +---+---+---+---+---+---+---+---+
-|
-| ws : number of wait-states : 0 => 0 ws
-| 1 => external /dsackx
-| wid : width of chip-select : 0 => 16 bits
-| 1 => 32 bits
-| ena : enable chip-select : 0 => disabled
-| 1 => enabled
-.equ REG_CS1, 1
-.equ REG_CS2, 2
-.equ REG_CS3, 3
-
-|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| I2C register
-|
-| 7 6 5 4 3 2 1 0
-| +---+---+---+---+---+---+---+----+
-| | x | x | x | x | x | x |clk|data|
-| +---+---+---+---+---+---+---+----+
-| bidirecionnal pin, open drain output.
-| set bit to 1 to read external state of pin
-|
-.equ REG_I2C, 4
-
-|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| PDCS register
-|
-| 7 6 5 4 3 2 1 0
-| +---+---+---+---+---+---+---+---+
-| |s12|s11|s14|pd5|pd4|pd3|pd2|pd1|
-| +---+---+---+---+---+---+---+---+
-| pd[5..1] : value read on the DRAM module
-| S12, S11 and S14 : "user reserved" configuration switch
-|
-.equ REG_PDCS, 5
-
-|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| timer1 register
-|
-| 7 6 5 4 3 2 1 0
-| +---+---+---+---+---+---+---+---+
-| |ena| x | x | x | x | x | d1| d0|
-| +---+---+---+---+---+---+---+---+
-|
-| the timer clock is the 1000Hz clock of the ASTECC platform
-| the timer is reloaded on each write to the register, or if the input
-| TIN1 is set to 0.
-| on overflow, the open drain output TOUT1 is set to 0
-| the timer must be disabled to return TOUT1 to the inactive state
-|
-.equ REG_TIMER1, 6
-
-|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| timer2 register
-|
-| 7 6 5 4 3 2 1 0
-| +---+---+---+---+---+---+---+---+
-| |ena| x | x | x | x | x | d1| d0|
-| +---+---+---+---+---+---+---+---+
-| the timer clock is the 1000Hz clock of the ASTECC platform
-| the timer is reloaded on each write to the register, or if the input
-| TIN2 is set to 0.
-| on overflow, the open drain output TOUT2 is set to 0
-| the timer must be disabled to return TOUT2 to the inactive state
-|
-.equ REG_TIMER2, 7
-
-|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| baudrate generator register
-|
-| 7 6 5 4 3 2 1 0
-| +---+---+---+---+---+---+---+---+
-| | x | x | x | x | x | d2| d1| d0|
-| +---+---+---+---+---+---+---+---+
-|
-| d[2..0] : divider of a 3.6864 Mhz clock
-|
-| d[2..0] : 0 1 2 3 4 5 6 7
-| divides by : 2 4 6 8 10 12 14 16
-| SCLK (Mhz) : 1.8432 0.9216 0.6144 0.4608 x 0.3072 x 0.2304
-| baudrate : 115200 57600 38400 28800 x 19200 x 14400
-|
-.equ REG_BAUDRATE, 8
-
-|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| IO register
-|
-| 7 6 5 4 3 2 1 0
-| +---+---+---+---+---+---+---+---+
-| | x | x | x |io4|io3|io2|io1|io0|
-| +---+---+---+---+---+---+---+---+
-|
-| io[4..0] : data written to port
-|
-| maximum current load is about 5 mA per pin
-|
-.equ REG_IO, 9
-
-|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| IO port
-|
-| 7 6 5 4 3 2 1 0
-| +---+---+---+---+---+---+---+---+
-| | x | x | x |io4|io3|io2|io1|io0|
-| +---+---+---+---+---+---+---+---+
-|
-| io[4..0] : data read from port
-|
-.equ REG_IO_PORT, 10
-
-|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| IO direction register
-|
-| 7 6 5 4 3 2 1 0
-| +---+---+---+---+---+---+---+---+
-| | x | x | x | x | x |dr2|dr1|dr0|
-| +---+---+---+---+---+---+---+---+
-|
-| dr0 : 0 => io port 0 is configured as input (default after /RESET)
-| 1 => io port 0 is configured as output
-|
-| dr1 : 0 => io port 1 is configured as input (default after /RESET)
-| 1 => io port 1 is configured as output
-|
-| dr2 : 0 => io ports 2 to 4 are configured as input (default after /RESET)
-| 1 => io ports 2 to 4 are configured as output
-|
-.equ REG_DIR_IO, 11
-
-
-
-
-||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-| DRAM EPLD
-||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-
-.equ DRAM_EPLD, 0xA0000000
-
-|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| number of wait-state for DRAM
-|
-| 7 6 5 4 3 2 1 0
-| +---+---+---+---+---+---+---+---+
-| | x | x | x | x | x | x |ws1|ws0|
-| +---+---+---+---+---+---+---+---+
-|
-| ws[1..0] : 0 1 2 3
-| wait states : 0 1 2 3
-|
-.equ REG_WS, 0
-
-|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| configuration of refresh for DRAM
-|
-| 7 6 5 4 3 2 1 0
-| +---+---+---+---+---+---+---+---+
-| |ena| x | x | x | x | x |rf1|rf0|
-| +---+---+---+---+---+---+---+---+
-|
-| rf[1..0] : 0 1 2 3
-| refresh : 5µs 10µs 15µs 20µs
-|
-| ena == 0 : refresh disabled
-| ena == 1 : refresh enabled
-|
-.equ REG_REFRESH, 1
-
-|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| configuration of DRAM module size
-|
-| 7 6 5 4 3 2 1 0
-| +---+---+---+---+---+---+---+---+
-| | x | x | x | x | x |sz2|sz1|sz0|
-| +---+---+---+---+---+---+---+---+
-|
-| sz[2..0] : 0 1 2 3 4 5 6 7
-| size (Mbytes): 4 8 16 32 64 128 0 0
-|
-.equ REG_CONFIG, 2
-
-|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| bus width of /CS0 during reset bw[1..0] : 0 1 2 3
-| bus width : 32 16 8 ext. /dsackx
-|
-| state of CS_SWITCH : sel == 0 => CPU chip_selects (/CS[3..0])
-| : sel == 1 => EPLD chip_selects (/CS[3..0])
-|
-| 7 6 5 4 3 2 1 0
-| +---+---+---+---+---+---+---+---+
-| |bw1|bw0| x | x | x | x | x |sel|
-| +---+---+---+---+---+---+---+---+
-|
-.equ REG_BUSWIDTH, 3
-
diff --git a/c/src/lib/libbsp/m68k/gen68340/start/Makefile.in b/c/src/lib/libbsp/m68k/gen68340/start/Makefile.in
deleted file mode 100644
index ce91b95e3b..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/start/Makefile.in
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/start340.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start340
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
diff --git a/c/src/lib/libbsp/m68k/gen68340/start/start340.s b/c/src/lib/libbsp/m68k/gen68340/start/start340.s
deleted file mode 100644
index 58ea0c92d0..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/start/start340.s
+++ /dev/null
@@ -1,874 +0,0 @@
-/*
- * This file contains the entry point for the application.
- * The name of this entry point is compiler dependent.
- * It jumps to the BSP which is responsible for performing
- * all initialization.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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.
- *
- * Based on the `gen68360' board support package, and covered by the
- * original distribution terms.
- *
- * Geoffroy Montel
- * France Telecom - CNET/DSM/TAM/CAT
- * 4, rue du Clos Courtel
- * 35512 CESSON-SEVIGNE
- * FRANCE
- *
- * e-mail: g_montel@yahoo.com
- *
- * $Id$
- */
-
-#include "asm.h"
-#include <m68349.inc>
-
-#define _OLD_ASTECC 1 /* old addresses for AST68340 only, undefine for AST68349 */
-
-BEGIN_CODE
- /*
- * Step 1: Decide on Reset Stack Pointer and Initial Program Counter
- */
-Entry:
- .long SYM(m340)+1024 | 0: Initial SSP
- .long start | 1: Initial PC
- .long SYM(_uhoh) | 2: Bus error
- .long SYM(_uhoh) | 3: Address error
- .long SYM(_uhoh) | 4: Illegal instruction
- .long SYM(_uhoh) | 5: Zero division
- .long SYM(_uhoh) | 6: CHK, CHK2 instruction
- .long SYM(_uhoh) | 7: TRAPcc, TRAPV instructions
- .long SYM(_uhoh) | 8: Privilege violation
- .long SYM(_uhoh) | 9: Trace
- .long SYM(_uhoh) | 10: Line 1010 emulator
- .long SYM(_uhoh) | 11: Line 1111 emulator
- .long SYM(_uhoh) | 12: Hardware breakpoint
- .long SYM(_uhoh) | 13: Reserved for coprocessor violation
- .long SYM(_uhoh) | 14: Format error
- .long SYM(_uhoh) | 15: Uninitialized interrupt
- .long SYM(_uhoh) | 16: Unassigned, reserved
- .long SYM(_uhoh) | 17:
- .long SYM(_uhoh) | 18:
- .long SYM(_uhoh) | 19:
- .long SYM(_uhoh) | 20:
- .long SYM(_uhoh) | 21:
- .long SYM(_uhoh) | 22:
- .long SYM(_uhoh) | 23:
- .long SYM(_spuriousInterrupt) | 24: Spurious interrupt
- .long SYM(_uhoh) | 25: Level 1 interrupt autovector
- .long SYM(_uhoh) | 26: Level 2 interrupt autovector
- .long SYM(_uhoh) | 27: Level 3 interrupt autovector
- .long SYM(_uhoh) | 28: Level 4 interrupt autovector
- .long SYM(_uhoh) | 29: Level 5 interrupt autovector
- .long SYM(_uhoh) | 30: Level 6 interrupt autovector
- .long SYM(_uhoh) | 31: Level 7 interrupt autovector
- .long SYM(_uhoh) | 32: Trap instruction (0-15)
- .long SYM(_uhoh) | 33:
- .long SYM(_uhoh) | 34:
- .long SYM(_uhoh) | 35:
- .long SYM(_uhoh) | 36:
- .long SYM(_uhoh) | 37:
- .long SYM(_uhoh) | 38:
- .long SYM(_uhoh) | 39:
- .long SYM(_uhoh) | 40:
- .long SYM(_uhoh) | 41:
- .long SYM(_uhoh) | 42:
- .long SYM(_uhoh) | 43:
- .long SYM(_uhoh) | 44:
- .long SYM(_uhoh) | 45:
- .long SYM(_uhoh) | 46:
- .long SYM(_uhoh) | 47:
- .long SYM(_uhoh) | 48: Reserved for coprocessor
- .long SYM(_uhoh) | 49:
- .long SYM(_uhoh) | 50:
- .long SYM(_uhoh) | 51:
- .long SYM(_uhoh) | 52:
- .long SYM(_uhoh) | 53:
- .long SYM(_uhoh) | 54:
- .long SYM(_uhoh) | 55:
- .long SYM(_uhoh) | 56:
- .long SYM(_uhoh) | 57:
- .long SYM(_uhoh) | 58:
- .long SYM(_uhoh) | 59: Unassigned, reserved
- .long SYM(_uhoh) | 60:
- .long SYM(_uhoh) | 61:
- .long SYM(_uhoh) | 62:
- .long SYM(_uhoh) | 63:
- .long SYM(_uhoh) | 64: User defined vectors (192)
- .long SYM(_uhoh) | 65:
- .long SYM(_uhoh) | 66:
- .long SYM(_uhoh) | 67:
- .long SYM(_uhoh) | 68:
- .long SYM(_uhoh) | 69:
- .long SYM(_uhoh) | 70:
- .long SYM(_uhoh) | 71:
- .long SYM(_uhoh) | 72:
- .long SYM(_uhoh) | 73:
- .long SYM(_uhoh) | 74:
- .long SYM(_uhoh) | 75:
- .long SYM(_uhoh) | 76:
- .long SYM(_uhoh) | 77:
- .long SYM(_uhoh) | 78:
- .long SYM(_uhoh) | 79:
- .long SYM(_uhoh) | 80:
- .long SYM(_uhoh) | 81:
- .long SYM(_uhoh) | 82:
- .long SYM(_uhoh) | 83:
- .long SYM(_uhoh) | 84:
- .long SYM(_uhoh) | 85:
- .long SYM(_uhoh) | 86:
- .long SYM(_uhoh) | 87:
- .long SYM(_uhoh) | 88:
- .long SYM(_uhoh) | 89:
- .long SYM(_uhoh) | 90:
- .long SYM(_uhoh) | 91:
- .long SYM(_uhoh) | 92:
- .long SYM(_uhoh) | 93:
- .long SYM(_uhoh) | 94:
- .long SYM(_uhoh) | 95:
- .long SYM(_uhoh) | 96:
- .long SYM(_uhoh) | 97:
- .long SYM(_uhoh) | 98:
- .long SYM(_uhoh) | 99:
- .long SYM(_uhoh) | 100:
- .long SYM(_uhoh) | 101:
- .long SYM(_uhoh) | 102:
- .long SYM(_uhoh) | 103:
- .long SYM(_uhoh) | 104:
- .long SYM(_uhoh) | 105:
- .long SYM(_uhoh) | 106:
- .long SYM(_uhoh) | 107:
- .long SYM(_uhoh) | 108:
- .long SYM(_uhoh) | 109:
- .long SYM(_uhoh) | 110:
- .long SYM(_uhoh) | 111:
- .long SYM(_uhoh) | 112:
- .long SYM(_uhoh) | 113:
- .long SYM(_uhoh) | 114:
- .long SYM(_uhoh) | 115:
- .long SYM(_uhoh) | 116:
- .long SYM(_uhoh) | 117:
- .long SYM(_uhoh) | 118:
- .long SYM(_uhoh) | 119:
- .long SYM(_uhoh) | 120:
- .long SYM(_uhoh) | 121:
- .long SYM(_uhoh) | 122:
- .long SYM(_uhoh) | 123:
- .long SYM(_uhoh) | 124:
- .long SYM(_uhoh) | 125:
- .long SYM(_uhoh) | 126:
- .long SYM(_uhoh) | 127:
- .long SYM(_uhoh) | 128:
- .long SYM(_uhoh) | 129:
- .long SYM(_uhoh) | 130:
- .long SYM(_uhoh) | 131:
- .long SYM(_uhoh) | 132:
- .long SYM(_uhoh) | 133:
- .long SYM(_uhoh) | 134:
- .long SYM(_uhoh) | 135:
- .long SYM(_uhoh) | 136:
- .long SYM(_uhoh) | 137:
- .long SYM(_uhoh) | 138:
- .long SYM(_uhoh) | 139:
- .long SYM(_uhoh) | 140:
- .long SYM(_uhoh) | 141:
- .long SYM(_uhoh) | 142:
- .long SYM(_uhoh) | 143:
- .long SYM(_uhoh) | 144:
- .long SYM(_uhoh) | 145:
- .long SYM(_uhoh) | 146:
- .long SYM(_uhoh) | 147:
- .long SYM(_uhoh) | 148:
- .long SYM(_uhoh) | 149:
- .long SYM(_uhoh) | 150:
- .long SYM(_uhoh) | 151:
- .long SYM(_uhoh) | 152:
- .long SYM(_uhoh) | 153:
- .long SYM(_uhoh) | 154:
- .long SYM(_uhoh) | 155:
- .long SYM(_uhoh) | 156:
- .long SYM(_uhoh) | 157:
- .long SYM(_uhoh) | 158:
- .long SYM(_uhoh) | 159:
- .long SYM(_uhoh) | 160:
- .long SYM(_uhoh) | 161:
- .long SYM(_uhoh) | 162:
- .long SYM(_uhoh) | 163:
- .long SYM(_uhoh) | 164:
- .long SYM(_uhoh) | 165:
- .long SYM(_uhoh) | 166:
- .long SYM(_uhoh) | 167:
- .long SYM(_uhoh) | 168:
- .long SYM(_uhoh) | 169:
- .long SYM(_uhoh) | 170:
- .long SYM(_uhoh) | 171:
- .long SYM(_uhoh) | 172:
- .long SYM(_uhoh) | 173:
- .long SYM(_uhoh) | 174:
- .long SYM(_uhoh) | 175:
- .long SYM(_uhoh) | 176:
- .long SYM(_uhoh) | 177:
- .long SYM(_uhoh) | 178:
- .long SYM(_uhoh) | 179:
- .long SYM(_uhoh) | 180:
- .long SYM(_uhoh) | 181:
- .long SYM(_uhoh) | 182:
- .long SYM(_uhoh) | 183:
- .long SYM(_uhoh) | 184:
- .long SYM(_uhoh) | 185:
- .long SYM(_uhoh) | 186:
- .long SYM(_uhoh) | 187:
- .long SYM(_uhoh) | 188:
- .long SYM(_uhoh) | 189:
- .long SYM(_uhoh) | 190:
- .long SYM(_uhoh) | 191:
- .long SYM(_uhoh) | 192:
- .long SYM(_uhoh) | 193:
- .long SYM(_uhoh) | 194:
- .long SYM(_uhoh) | 195:
- .long SYM(_uhoh) | 196:
- .long SYM(_uhoh) | 197:
- .long SYM(_uhoh) | 198:
- .long SYM(_uhoh) | 199:
- .long SYM(_uhoh) | 200:
- .long SYM(_uhoh) | 201:
- .long SYM(_uhoh) | 202:
- .long SYM(_uhoh) | 203:
- .long SYM(_uhoh) | 204:
- .long SYM(_uhoh) | 205:
- .long SYM(_uhoh) | 206:
- .long SYM(_uhoh) | 207:
- .long SYM(_uhoh) | 208:
- .long SYM(_uhoh) | 209:
- .long SYM(_uhoh) | 210:
- .long SYM(_uhoh) | 211:
- .long SYM(_uhoh) | 212:
- .long SYM(_uhoh) | 213:
- .long SYM(_uhoh) | 214:
- .long SYM(_uhoh) | 215:
- .long SYM(_uhoh) | 216:
- .long SYM(_uhoh) | 217:
- .long SYM(_uhoh) | 218:
- .long SYM(_uhoh) | 219:
- .long SYM(_uhoh) | 220:
- .long SYM(_uhoh) | 221:
- .long SYM(_uhoh) | 222:
- .long SYM(_uhoh) | 223:
- .long SYM(_uhoh) | 224:
- .long SYM(_uhoh) | 225:
- .long SYM(_uhoh) | 226:
- .long SYM(_uhoh) | 227:
- .long SYM(_uhoh) | 228:
- .long SYM(_uhoh) | 229:
- .long SYM(_uhoh) | 230:
- .long SYM(_uhoh) | 231:
- .long SYM(_uhoh) | 232:
- .long SYM(_uhoh) | 233:
- .long SYM(_uhoh) | 234:
- .long SYM(_uhoh) | 235:
- .long SYM(_uhoh) | 236:
- .long SYM(_uhoh) | 237:
- .long SYM(_uhoh) | 238:
- .long SYM(_uhoh) | 239:
- .long SYM(_uhoh) | 240:
- .long SYM(_uhoh) | 241:
- .long SYM(_uhoh) | 242:
- .long SYM(_uhoh) | 243:
- .long SYM(_uhoh) | 244:
- .long SYM(_uhoh) | 245:
- .long SYM(_uhoh) | 246:
- .long SYM(_uhoh) | 247:
- .long SYM(_uhoh) | 248:
- .long SYM(_uhoh) | 249:
- .long SYM(_uhoh) | 250:
- .long SYM(_uhoh) | 251:
- .long SYM(_uhoh) | 252:
- .long SYM(_uhoh) | 253:
- .long SYM(_uhoh) | 254:
- .long SYM(_uhoh) | 255:
-
-/*
- * Default trap handler
- * With an oscilloscope you can see AS* stop
- */
- PUBLIC (_uhoh)
-SYM(_uhoh): nop | Leave spot for breakpoint
-/* stop #0x2700 | Stop with interrupts disabled */
- move.w #0x2700,sr
- move.w (a7),_boot_panic_registers+4 | SR
- move.l 2(a7),_boot_panic_registers | PC
- move.w 6(a7),_boot_panic_registers+6 | format & vector
- movem.l d0-d7/a0-a7, _boot_panic_registers+8
- movec sfc, d0
- movem.l d0, _boot_panic_registers+72
- movec dfc, d0
- movem.l d0, _boot_panic_registers+76
- movec vbr, d0
- movem.l d0, _boot_panic_registers+80
- jmp SYM(_dbug_dumpanic)
- bra.s _crt0_cold_start
-
-/*
- * Log, but otherwise ignore, spurious interrupts
- */
- PUBLIC (_spuriousInterrupt)
-SYM(_spuriousInterrupt):
- addql #1,SYM(_M68kSpuriousInterruptCount)
- rte
-
-/*
- * Place the low-order 3 octets of the board's ethernet address at
- * a `well-known' fixed location relative to the startup location.
- */
- .align 2
- .word 0 | Padding
-ethernet_address_buffer:
- .word 0x08F3 | Default address
- .word 0xDEAD
- .word 0xCAFE
-
-BEGIN_DATA
-
-/* equates */
-
-.equ _CPU340, 0x0
-.equ _CPU349, 0x31
-
-#ifdef _OLD_ASTECC /* old addresses for AST68340 only */
-.equ _EPLD_CS_BASE, 0x1
-.equ _PROM_Start, 0x01000000 /* CS0 */
-.equ _FLEX_Start, 0x08000000 /* CS2 */
-.equ _I2C_Start, 0x0c000000 /* CS3 */
-
-.equ _BCCram_Start, 0x00000000 /* CS1 64 Kbytes */
-.equ _BCCram_Size, 0x00010000 /* CS1 64 Kbytes */
-
-.equ _ExtRam_Start, 0x10000000 /* SRAM */
-.equ _ExtRam_Size, 0x00400000 /* 4 Mbytes */
-
-.equ _FastRam_Start, 0x00000000 /* overlap /CS1 for the first 4 Kbytes */
-.equ _FastRam_Size, 0x00001000 /* 4 Kbytes */
-
-#else /* new addresses for AST68349 and 68340 */
-
-.equ _EPLD_CS_BASE, 0x5
-.equ _PROM_Start, 0x50000000 /* CS0 */
-.equ _FLEX_Start, 0x08000000 /* CS2 */
-.equ _I2C_Start, 0x0c000000 /* CS3 */
-
-.equ _BCCram_Start, 0x00000000 /* CS1 64 Kbytes */
-.equ _BCCram_Size, 0x00010000 /* CS1 64 Kbytes */
-
-.equ _ExtRam_Start, 0x80000000 /* DRAM */
-.equ _ExtRam_Size, 0x00400000 /* 4 Mbytes */
-
-.equ _FastRam_Start, 0x00000000 /* overlap /CS1 for the first 4 Kbytes */
-.equ _FastRam_Size, 0x00001000 /* 4 Kbytes */
-#endif
-
-.equ _SPEED349, 0xD680 /* 24 Mhz */
-.equ _SPEED340, 0xD700 /* 25 Mhz */
-/* .equ _SPEED340, 0xCE00 16 Mhz */
-
-#define crt0_boot_type d0 /* cold/warm start (must be D0) */
-#define crt0_temp d1
-#define crt0_cpu_type d2
-#define crt0_csswitch d3
-#define crt0_buswidth d4
-#define crt0_pdcs d5
-#define crt0_spare6 d6
-#define crt0_spare7 d7
-#define crt0_sim_base a0
-#define crt0_glue a1
-#define crt0_dram a2
-#define crt0_ptr3 a3
-#define crt0_ptr4 a4
-#define crt0_ptr5 a5
-#define crt0_ptr6 a6
-
-/* -- PDCS buffer equates -- */
-.equ pdcs_mask, 0x1F /* DRAM configuration */
-.equ pdcs_sw12, 7 /* switch 12 */
-.equ pdcs_sw11, 6 /* switch 11 */
-.equ pdcs_sw14, 5 /* switch 14 */
-
-.equ bit_cache, pdcs_sw12 /* enable cache if on */
-.equ bit_meminit, pdcs_sw11 /* init memory if on */
-
-/* -- Initialization stack and vars -- */
-
-_AsteccBusWidth: ds.b 1
-_AsteccCsSwitch: ds.b 1
-_AsteccCpuName: ds.l 1
-
-.align 4
-
-_crt0_init_stack:
- ds.l 500
-_crt0_init_stktop:
-
-/* -- Initialization code -- */
-BEGIN_CODE
-
-.align 4
- dc.l _crt0_init_stktop /* reset SP */
- dc.l _crt0_cold_start /* reset PC */
- dc.l _crt0_warm_start
-
- .ascii "BOOT XHM68K/Spectra for ASTECC 68349 and 68340 boards"
- dc.w 0
-.align 4
-
-.globl start
-start:
-
-_crt0_cold_start:
- moveq.l #0,crt0_boot_type | signal cold reset
- bra.s _crt0_common_start
-
-_crt0_warm_start:
- moveq.l #1,crt0_boot_type | signal warm reset
-
-_crt0_common_start:
- move.w #0x2700,sr | disable interrupts and switch to interrupt mode
- movea.l #_crt0_init_stktop,sp | set up initialization stack
-
- move.l #Entry,crt0_temp | VBR initialization
- movec.l crt0_temp,vbr |
- moveq.l #0x07,crt0_temp
- movec.l crt0_temp,dfc | prepare access in CPU space
- move.l #(BASE_SIM+0x111),crt0_temp | mask CPU, RESERVED USER SPACES
- moves.l crt0_temp,BASE_REG | base initialization (must be MOVES, PCC-130795)
-
- movea.l #BASE_SIM,crt0_sim_base
-
- /* -- disable Bus Monitor -- */
- move.b #0,SIM_SYPCR(crt0_sim_base) | system protection control register
-
- /* -- enable A31-A24 -- */
- clr.b SIM_PPRA1(crt0_sim_base)
-
- /* -- show cycles, user acces to SIM, 4 /CS & 4 /IT -- */
- move.w #0x427F,SIM_MCR(crt0_sim_base)
-
- /* -- enable /IRQ3, 5, 6, 7 -- */
- move.b #0xE8,SIM_PPRB(crt0_sim_base)
-
- /* -- enable autovector on /IRQ7 -- */
- move.b #0x80,SIM_AVR(crt0_sim_base)
-
- /* -- test CPU type -- */
- cmp.b #_CPU349,SIM_IDR(crt0_sim_base)
- bne cpu_is_68340
-
-/*-------------------------------------------------------------------------------------------*/
-cpu_is_68349:
-
- /* -- set cpu clock -- */
- move.w #_SPEED349,SIM_SYNCR(crt0_sim_base) | clock
-
-sync_wait349:
- btst.b #3,(SIM_SYNCR+1)(crt0_sim_base)
- beq sync_wait349
-
- /* to allow access to the EPLD internal registers, it is necessary
- to disable the global chip-select /CS0 (which decodes every external
- cycles). To do that, we initialize the 68349 internal RAM,
- copy a part of the initialization code in it, and jump there.
- from that moment, /CS0 is not used, therefore it can be initialized
- with its default value. Its width may be incorrect, but it will be
- adjusted later. The goal is to avoid any conflict with
- the accesses to the EPLD registers.
- When this is done, we read the RESET parameters (boot prom width
- and chip-select switch) and proceed with the initialization
- when all is done, we jump back to the boot prom now
- decoded with a properly configured /CS0 */
-
- /*-------------------------------------*/
- /* -- configure internal SRAM banks -- */
-
- move.l #0x00000000,QDMM_MCR(crt0_sim_base)
- move.l #_FastRam_Start+0x0005,QDMM_QBAR0(crt0_sim_base)
- move.l #_FastRam_Start+0x0405,QDMM_QBAR1(crt0_sim_base)
- move.l #_FastRam_Start+0x0805,QDMM_QBAR2(crt0_sim_base)
- move.l #_FastRam_Start+0x0c05,QDMM_QBAR3(crt0_sim_base)
-
- /*--------------------------------------------------------*/
- /* -- copy to address of the 68349 initialization code -- */
-
- lea.l _copy_start(%pc),crt0_ptr3
- lea.l _copy_end(%pc),crt0_ptr4
- move.l crt0_ptr4,crt0_temp
- sub.l crt0_ptr3,crt0_temp
- add.l #3,crt0_temp | adjust to next long word
- lsr.l #2,crt0_temp
-
- move.l #_FastRam_Start,crt0_ptr4
-_copy_loop:
- move.l (crt0_ptr3)+,(crt0_ptr4)+
- subq.l #1,crt0_temp
- bne.s _copy_loop
- bra.l _FastRam_Start | jump to code in internal RAM
-
- /*------------------------------------*/
- /* -- start of initialization code -- */
-
-_copy_start:
- bra.l _begin_68349_init
-
- /*----------------------------------------------------------*/
- /* Astecc 68349 board : chip-select initialization values */
-
-_table_csepld:
- dc.b (_EPLD_CS_BASE&0x0F)+0x80 | 16 bits, 0ws
- dc.b 0x80 | 16 bits, 0 ws
- dc.b 0x90 | 16 bits, ext /dsack
- dc.b 0x90 | 16 bits, ext /dsack
-
-_table_cs349:
- dc.l 0x003FFFF4 | Mask CS0 (4Mbytes PROM, 32bits, 1WS)
- dc.l (_PROM_Start&0xFFFFFF00)+0x00000003 | Base CS0
- dc.l 0x003FFFF1 | MASK CS1 (4Mbytes RAM, 16bits, 0WS)
- dc.l (_BCCram_Start&0xFFFFFF00)+0x00000003 | Base CS1
- dc.l 0x000000FF | MASK CS2 (FLEX, ext DTACK, 256 bytes)
- dc.l (_FLEX_Start&0xFFFFFF00)+0x00000003 | Base CS2
- dc.l 0x000000FF | Mask CS3 (I2C, ext DTACK, 256 bytes)
- dc.l (_I2C_Start&0xFFFFFF00)+0x00000003 | Base CS3
-
- /*-------------------------------------------------*/
-_begin_68349_init:
-
- /*-------------------------------------------------*/
- /* 68349 chip select initialization
-
- at this stage, the width of /CS0 may be incorrect
- it will be corrected later
- */
-
-_cs68349_init:
- lea.l SIM_MASKH0(crt0_sim_base),crt0_ptr4
- lea.l _table_cs349(%pc),crt0_ptr3
-
- moveq.l #0x07,crt0_temp
-_cs349_init2:
- move.l (crt0_ptr3)+,(crt0_ptr4)+
- dbra crt0_temp,_cs349_init2
-
- /*-----------------------------------------------*/
- /* -- prepare access to the internal registers --*/
- moveq.l #EPLD_SPACE,crt0_temp
- movec.l crt0_temp,dfc
- movec.l crt0_temp,sfc
- move.l #GLUE_EPLD,crt0_glue
- move.l #DRAM_EPLD,crt0_dram
-
- /*-------------------------------------------*/
- /* EPLD generated /CS[3..0] must be disabled */
-
-_csepld_clear:
- move.l crt0_glue,crt0_ptr4
- move.w #3,crt0_spare6
- clr.b crt0_temp
-
-_csepld_clear1:
- moves.b crt0_temp,(crt0_ptr4)+
- dbra crt0_spare6,_csepld_clear1
-
- /*---------------------------------------------------------*/
- /* -- get width of boot PROM, and active chip-select set --*/
- moves.b REG_BUSWIDTH(crt0_dram),crt0_csswitch
- move.b crt0_csswitch,crt0_buswidth
-
- /* state of CS_SWITCH : sel == 0 => CPU chip_selects (/CS[3..0])
- : sel == 1 => EPLD chip_selects (/CS[3..0]) */
- and.b #1,crt0_csswitch
-
- /* bus width of /CS0 during reset bw[1..0] : 0 1 2 3
- bus width : 32 16 8 ext./dsackx */
- rol.b #2,crt0_buswidth
- and.b #3,crt0_buswidth
-
- /*----------------------------------------------------*/
- /* -- configure chip select 0 with boot prom width -- */
- lea.l SIM_MASKH0(crt0_sim_base),crt0_ptr4
- lea.l _table_cs349(%pc),crt0_ptr3
- move.l (crt0_ptr3)+,crt0_temp
- and.b #0xFC,crt0_temp | clear PS0 & PS1
- or.b crt0_buswidth,crt0_temp | set boot PROM bus width
- move.l crt0_temp,(crt0_ptr4)+
-
- /*------------------------*/
- /* -- read PDCS buffer -- */
- moves.b REG_PDCS(crt0_glue),crt0_pdcs
-/* move.b #0x3F,crt0_pdcs pour test */
-
-
- /*---------------------------------------*/
- /* -- EPLD chip-select initialization -- */
- /*---------------------------------------*/
- btst.b #0,crt0_csswitch
- beq _cs_init_end
-
- /*--------------------------------------------*/
- /* 68349 generated /CS[3..0] must be disabled */
- lea.l SIM_MASKH0(crt0_sim_base),crt0_ptr4
- lea.l _table_cs349(%pc),crt0_ptr3
- moveq.l #0x03,crt0_temp
-_cs349_clear:
- move.l (crt0_ptr3)+,(crt0_ptr4)+
- move.l (crt0_ptr3)+,crt0_spare6
- and.b #0xFE,crt0_spare6 | disable chip-select
- move.l crt0_spare6,(crt0_ptr4)+
- dbra crt0_temp,_cs349_clear
-
- /*---------------------------------------------*/
- /* EPLD generated /CS[3..0] must be configured */
-_csepld_init:
- move.l crt0_glue,crt0_ptr4
- lea.l _table_csepld(%pc),crt0_ptr3
-
- move.b (crt0_ptr3)+,crt0_temp
- or.b #0x20,crt0_temp | default width is 32 bits
- tst.b crt0_buswidth | is boot PROM bus width 32 bits ?
- beq _csepld1 | if not
- and.b #0xDF,crt0_temp | set width to 16 bits
-_csepld1:
- moves.b crt0_temp,(crt0_ptr4)+
-
- moveq.l #0x02,crt0_spare6
-_csepld2:
- move.b (crt0_ptr3)+,crt0_temp
- moves.b crt0_temp,(crt0_ptr4)+
- dbra crt0_spare6,_csepld2
-
-_cs_init_end:
-
- /*--------------------------------------*/
- /* -- DRAM controller initialization -- */
-_dram_init:
- move.w #15,crt0_temp
- move.l #_ExtRam_Start,crt0_ptr3
-
-_dram_init1:
- clr.l (crt0_ptr3)+ | must access DRAM
- dbra crt0_temp,_dram_init1 | prior to init refresh
-
-_dram_init2:
- move.b #3,crt0_temp
- moves.b crt0_temp,REG_WS(crt0_dram) | set 3 wait-states
-
- move.b #0x81,crt0_temp
- moves.b crt0_temp,REG_REFRESH(crt0_dram) | refresh every 10µs
-
- move.b #0,crt0_temp
- moves.b crt0_temp,REG_CONFIG(crt0_dram) | default size = 4Mbytes
-
- /*-----------------------*/
- /* -- configure cache -- */
-_init_cache:
- move.l #0x000001E0,CACHE_MCR(crt0_sim_base)
- btst.b #bit_cache,crt0_pdcs
- bne _init_cache_end
- or.l #0x00000001,CACHE_MCR(crt0_sim_base)
-
-_init_cache_end:
-
- /*-----------------------------*/
- /* -- timers initialization -- */
-
- clr.b crt0_temp
- moves.b crt0_temp,REG_TIMER1(crt0_glue) | disable timer 1
- moves.b crt0_temp,REG_TIMER2(crt0_glue) | disable timer 2
-
- /*--------------------------*/
- /* -- I2C initialization -- */
- move.b #3,crt0_temp
- moves.b crt0_temp,REG_I2C(crt0_glue) | tri-states I2C ports
-
- /*-----------------------------------------*/
- /* -- baudrate generator initialization -- */
- move.b #2,crt0_temp
- moves.b crt0_temp,REG_BAUDRATE(crt0_glue) | baudrate = 38400
-
- /*-------------------------------*/
- /* -- IO port initialization -- */
- clr.b crt0_temp
- moves.b crt0_temp,REG_IO(crt0_glue) | set port as input
-
- /* -- */
-
- move.l #68349,crt0_cpu_type
-
-
- /* -- jump back to PROM -- */
-
- jmp.l (_fill_test) | must be absolute long
-
-_copy_end:
-
-/*-------------------------------------------------
- initialization code for the 68340 board
- -------------------------------------------------*/
-
- /* Astecc 68340 board : chip-select initialization values */
-_table_cs340:
- dc.l 0x003FFFF0 /* Mask CS0 (4Mbytes PROM, 32bits, 0WS) */
- dc.l ((_PROM_Start&0xFFFFFF00)+0x00000003) /* Base CS0 */
- dc.l 0x0000FFFD /* MASK CS1 (RAMBCC340, 0WS, FTE) */
- dc.l ((_BCCram_Start&0xFFFFFF00)+0x00000003) /* Base CS1 */
- dc.l 0x000000FF /* MASK CS2 (FLEX, ext DTACK, 256 bytes) */
- dc.l ((_FLEX_Start&0xFFFFFF00)+0x00000003) /* Base CS2 */
- dc.l 0x000000FF /* Mask CS3 (I2C, ext DTACK, 256 bytes) */
- dc.l ((_I2C_Start&0xFFFFFF00)+0x00000003) /* Base CS3 */
-
-cpu_is_68340:
-
- /* -- set cpu clock -- */
- move.w #_SPEED340,SIM_SYNCR(crt0_sim_base) | clock
-sync_wait340:
- btst.b #3,(SIM_SYNCR+1)(crt0_sim_base)
- beq sync_wait340
-
- /* -- chip select initialization -- */
- lea.l SIM_MASKH0(crt0_sim_base),crt0_ptr4
- lea.l _table_cs340(%pc),crt0_ptr3
- moveq.l #0x07,crt0_temp
-_b_cs340:
- move.l (crt0_ptr3)+,crt0_ptr5
- move.l crt0_ptr5,(crt0_ptr4)+ | pour test
- dbra crt0_temp,_b_cs340
-
- move.l #68340,crt0_cpu_type
- move.b #0,crt0_csswitch | CPU
- move.b #1,crt0_buswidth | 16 bits
-
-
- /*-------------------------------------------------
- fill RAM if COLDSTART
- -------------------------------------------------*/
-_fill_test:
-
- tst.l crt0_boot_type
- bne _dont_fill
-
- cmp.b #_CPU349,SIM_IDR(crt0_sim_base)
- bne _fill
- btst.b #bit_meminit,crt0_pdcs
- bne _dont_fill
-
- /* fill main memory */
-_fill:
- move.l #_crt0_init_stack,crt0_ptr3 | skip Astecc vars
- move.l #_ExtRam_Start,crt0_temp
- sub.l #_crt0_init_stack,crt0_temp
- add.l #_ExtRam_Size,crt0_temp | get size
- lsr.l #2,crt0_temp | ajust for long word
-_fill_loop:
- clr.l (crt0_ptr3)+
- subq.l #1,crt0_temp
- bne _fill_loop
-
- cmp.b #_CPU349,SIM_IDR(crt0_sim_base)
- bne _fill_bccram
-
- /* fill QDMM memory */
- movea.l #_FastRam_Start,crt0_ptr3 | get start
- move.l #_FastRam_Size,crt0_temp | get size
- lsr.l #2,crt0_temp | ajust for long word
-
-_QDMMfill_loop:
- clr.l (crt0_ptr3)+
- subq.l #1,crt0_temp
- bne _QDMMfill_loop
- bra _dont_fill
-
- /* fill BCC memory */
-_fill_bccram:
- movea.l #_BCCram_Start,crt0_ptr3 | get start
- move.l #_BCCram_Size,crt0_temp | get size
- lsr.l #2,crt0_temp | ajust for long word
-_BCCfill_loop:
- clr.l (crt0_ptr3)+
- subq.l #1,crt0_temp
- bne _BCCfill_loop
-
- *-------------------------------------------------*/
-_dont_fill:
- move.b crt0_csswitch,_AsteccCsSwitch
- move.b crt0_buswidth,_AsteccBusWidth
- move.l crt0_cpu_type,_AsteccCpuName
-
- jmp SYM(_Init68340) | Start C code (which never returns)
-
-/*
- * Copy DATA segment, clear BSS segment, set up real stack,
- * initialize heap, start C program.
- * Assume that DATA and BSS sizes are multiples of 4.
- */
- PUBLIC (_CopyDataClearBSSAndStart)
-SYM(_CopyDataClearBSSAndStart):
- lea copy_start,a0 | Get start of DATA in RAM
- lea SYM(etext),a2 | Get start of DATA in ROM
- cmpl a0,a2 | Are they the same?
- beq.s NOCOPY | Yes, no copy necessary
- lea copy_end,a1 | Get end of DATA in RAM
- bra.s COPYLOOPTEST | Branch into copy loop
-COPYLOOP:
- movel a2@+,a0@+ | Copy word from ROM to RAM
-COPYLOOPTEST:
- cmpl a1,a0 | Done?
- bcs.s COPYLOOP | No, skip
-NOCOPY:
-
- lea clear_start,a0 | Get start of BSS
- lea clear_end,a1 | Get end of BSS
- clrl d0 | Value to set
- bra.s ZEROLOOPTEST | Branch into clear loop
-ZEROLOOP:
- movel d0,a0@+ | Clear a word
-ZEROLOOPTEST:
- cmpl a1,a0 | Done?
- bcs.s ZEROLOOP | No, skip
-
- movel #stack_init,a7 | set master stack pointer
- movel d0,a7@- | environp
- movel d0,a7@- | argv
- movel d0,a7@- | argc
- jsr SYM(boot_card) | Call C main
-
- PUBLIC (_mainDone)
-SYM(_mainDone):
- nop | Leave spot for breakpoint
- movew #1,a7 | Force a double bus error
- movel d0,a7@- | This should cause a RESET
-/* stop #0x2700 | Stop with interrupts disabled */
- move.w #0x2700,sr
- bra.s SYM(_mainDone) | Stuck forever
-
- .align 2
- PUBLIC (_HeapSize)
-SYM (_HeapSize):
- .long HeapSize
- PUBLIC (_StackSize)
-SYM (_StackSize):
- .long StackSize
-END_CODE
-
-BEGIN_DATA_DCL
- .align 2
- PUBLIC (environ)
-SYM (environ):
- .long 0
- PUBLIC (_M68kSpuriousInterruptCount)
-SYM (_M68kSpuriousInterruptCount):
- .long 0
-END_DATA_DCL
-
-END
-
diff --git a/c/src/lib/libbsp/m68k/gen68340/start/startfor340only.s b/c/src/lib/libbsp/m68k/gen68340/start/startfor340only.s
deleted file mode 100644
index 930694f02e..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/start/startfor340only.s
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
- * This file contains the entry point for the application.
- * The name of this entry point is compiler dependent.
- * It jumps to the BSP which is responsible for performing
- * all initialization.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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.
- *
- * Based on the `gen68360' board support package, and covered by the
- * original distribution terms.
- *
- * Geoffroy Montel
- * France Telecom - CNET/DSM/TAM/CAT
- * 4, rue du Clos Courtel
- * 35512 CESSON-SEVIGNE
- * FRANCE
- *
- * e-mail: g_montel@yahoo.com
- *
- * $Id$
- */
-
-#include "asm.h"
-#include <m68340.inc>
-
-BEGIN_CODE
- /*
- * Step 1: Decide on Reset Stack Pointer and Initial Program Counter
- */
-Entry:
- .long SYM(m340)+1024 | 0: Initial SSP
- .long start | 1: Initial PC
- .long SYM(_uhoh) | 2: Bus error
- .long SYM(_uhoh) | 3: Address error
- .long SYM(_uhoh) | 4: Illegal instruction
- .long SYM(_uhoh) | 5: Zero division
- .long SYM(_uhoh) | 6: CHK, CHK2 instruction
- .long SYM(_uhoh) | 7: TRAPcc, TRAPV instructions
- .long SYM(_uhoh) | 8: Privilege violation
- .long SYM(_uhoh) | 9: Trace
- .long SYM(_uhoh) | 10: Line 1010 emulator
- .long SYM(_uhoh) | 11: Line 1111 emulator
- .long SYM(_uhoh) | 12: Hardware breakpoint
- .long SYM(_uhoh) | 13: Reserved for coprocessor violation
- .long SYM(_uhoh) | 14: Format error
- .long SYM(_uhoh) | 15: Uninitialized interrupt
- .long SYM(_uhoh) | 16: Unassigned, reserved
- .long SYM(_uhoh) | 17:
- .long SYM(_uhoh) | 18:
- .long SYM(_uhoh) | 19:
- .long SYM(_uhoh) | 20:
- .long SYM(_uhoh) | 21:
- .long SYM(_uhoh) | 22:
- .long SYM(_uhoh) | 23:
- .long SYM(_spuriousInterrupt) | 24: Spurious interrupt
- .long SYM(_uhoh) | 25: Level 1 interrupt autovector
- .long SYM(_uhoh) | 26: Level 2 interrupt autovector
- .long SYM(_uhoh) | 27: Level 3 interrupt autovector
- .long SYM(_uhoh) | 28: Level 4 interrupt autovector
- .long SYM(_uhoh) | 29: Level 5 interrupt autovector
- .long SYM(_uhoh) | 30: Level 6 interrupt autovector
- .long SYM(_uhoh) | 31: Level 7 interrupt autovector
- .long SYM(_uhoh) | 32: Trap instruction (0-15)
- .long SYM(_uhoh) | 33:
- .long SYM(_uhoh) | 34:
- .long SYM(_uhoh) | 35:
- .long SYM(_uhoh) | 36:
- .long SYM(_uhoh) | 37:
- .long SYM(_uhoh) | 38:
- .long SYM(_uhoh) | 39:
- .long SYM(_uhoh) | 40:
- .long SYM(_uhoh) | 41:
- .long SYM(_uhoh) | 42:
- .long SYM(_uhoh) | 43:
- .long SYM(_uhoh) | 44:
- .long SYM(_uhoh) | 45:
- .long SYM(_uhoh) | 46:
- .long SYM(_uhoh) | 47:
- .long SYM(_uhoh) | 48: Reserved for coprocessor
- .long SYM(_uhoh) | 49:
- .long SYM(_uhoh) | 50:
- .long SYM(_uhoh) | 51:
- .long SYM(_uhoh) | 52:
- .long SYM(_uhoh) | 53:
- .long SYM(_uhoh) | 54:
- .long SYM(_uhoh) | 55:
- .long SYM(_uhoh) | 56:
- .long SYM(_uhoh) | 57:
- .long SYM(_uhoh) | 58:
- .long SYM(_uhoh) | 59: Unassigned, reserved
- .long SYM(_uhoh) | 60:
- .long SYM(_uhoh) | 61:
- .long SYM(_uhoh) | 62:
- .long SYM(_uhoh) | 63:
- .long SYM(_uhoh) | 64: User defined vectors (192)
- .long SYM(_uhoh) | 65:
- .long SYM(_uhoh) | 66:
- .long SYM(_uhoh) | 67:
- .long SYM(_uhoh) | 68:
- .long SYM(_uhoh) | 69:
- .long SYM(_uhoh) | 70:
- .long SYM(_uhoh) | 71:
- .long SYM(_uhoh) | 72:
- .long SYM(_uhoh) | 73:
- .long SYM(_uhoh) | 74:
- .long SYM(_uhoh) | 75:
- .long SYM(_uhoh) | 76:
- .long SYM(_uhoh) | 77:
- .long SYM(_uhoh) | 78:
- .long SYM(_uhoh) | 79:
- .long SYM(_uhoh) | 80:
- .long SYM(_uhoh) | 81:
- .long SYM(_uhoh) | 82:
- .long SYM(_uhoh) | 83:
- .long SYM(_uhoh) | 84:
- .long SYM(_uhoh) | 85:
- .long SYM(_uhoh) | 86:
- .long SYM(_uhoh) | 87:
- .long SYM(_uhoh) | 88:
- .long SYM(_uhoh) | 89:
- .long SYM(_uhoh) | 90:
- .long SYM(_uhoh) | 91:
- .long SYM(_uhoh) | 92:
- .long SYM(_uhoh) | 93:
- .long SYM(_uhoh) | 94:
- .long SYM(_uhoh) | 95:
- .long SYM(_uhoh) | 96:
- .long SYM(_uhoh) | 97:
- .long SYM(_uhoh) | 98:
- .long SYM(_uhoh) | 99:
- .long SYM(_uhoh) | 100:
- .long SYM(_uhoh) | 101:
- .long SYM(_uhoh) | 102:
- .long SYM(_uhoh) | 103:
- .long SYM(_uhoh) | 104:
- .long SYM(_uhoh) | 105:
- .long SYM(_uhoh) | 106:
- .long SYM(_uhoh) | 107:
- .long SYM(_uhoh) | 108:
- .long SYM(_uhoh) | 109:
- .long SYM(_uhoh) | 110:
- .long SYM(_uhoh) | 111:
- .long SYM(_uhoh) | 112:
- .long SYM(_uhoh) | 113:
- .long SYM(_uhoh) | 114:
- .long SYM(_uhoh) | 115:
- .long SYM(_uhoh) | 116:
- .long SYM(_uhoh) | 117:
- .long SYM(_uhoh) | 118:
- .long SYM(_uhoh) | 119:
- .long SYM(_uhoh) | 120:
- .long SYM(_uhoh) | 121:
- .long SYM(_uhoh) | 122:
- .long SYM(_uhoh) | 123:
- .long SYM(_uhoh) | 124:
- .long SYM(_uhoh) | 125:
- .long SYM(_uhoh) | 126:
- .long SYM(_uhoh) | 127:
- .long SYM(_uhoh) | 128:
- .long SYM(_uhoh) | 129:
- .long SYM(_uhoh) | 130:
- .long SYM(_uhoh) | 131:
- .long SYM(_uhoh) | 132:
- .long SYM(_uhoh) | 133:
- .long SYM(_uhoh) | 134:
- .long SYM(_uhoh) | 135:
- .long SYM(_uhoh) | 136:
- .long SYM(_uhoh) | 137:
- .long SYM(_uhoh) | 138:
- .long SYM(_uhoh) | 139:
- .long SYM(_uhoh) | 140:
- .long SYM(_uhoh) | 141:
- .long SYM(_uhoh) | 142:
- .long SYM(_uhoh) | 143:
- .long SYM(_uhoh) | 144:
- .long SYM(_uhoh) | 145:
- .long SYM(_uhoh) | 146:
- .long SYM(_uhoh) | 147:
- .long SYM(_uhoh) | 148:
- .long SYM(_uhoh) | 149:
- .long SYM(_uhoh) | 150:
- .long SYM(_uhoh) | 151:
- .long SYM(_uhoh) | 152:
- .long SYM(_uhoh) | 153:
- .long SYM(_uhoh) | 154:
- .long SYM(_uhoh) | 155:
- .long SYM(_uhoh) | 156:
- .long SYM(_uhoh) | 157:
- .long SYM(_uhoh) | 158:
- .long SYM(_uhoh) | 159:
- .long SYM(_uhoh) | 160:
- .long SYM(_uhoh) | 161:
- .long SYM(_uhoh) | 162:
- .long SYM(_uhoh) | 163:
- .long SYM(_uhoh) | 164:
- .long SYM(_uhoh) | 165:
- .long SYM(_uhoh) | 166:
- .long SYM(_uhoh) | 167:
- .long SYM(_uhoh) | 168:
- .long SYM(_uhoh) | 169:
- .long SYM(_uhoh) | 170:
- .long SYM(_uhoh) | 171:
- .long SYM(_uhoh) | 172:
- .long SYM(_uhoh) | 173:
- .long SYM(_uhoh) | 174:
- .long SYM(_uhoh) | 175:
- .long SYM(_uhoh) | 176:
- .long SYM(_uhoh) | 177:
- .long SYM(_uhoh) | 178:
- .long SYM(_uhoh) | 179:
- .long SYM(_uhoh) | 180:
- .long SYM(_uhoh) | 181:
- .long SYM(_uhoh) | 182:
- .long SYM(_uhoh) | 183:
- .long SYM(_uhoh) | 184:
- .long SYM(_uhoh) | 185:
- .long SYM(_uhoh) | 186:
- .long SYM(_uhoh) | 187:
- .long SYM(_uhoh) | 188:
- .long SYM(_uhoh) | 189:
- .long SYM(_uhoh) | 190:
- .long SYM(_uhoh) | 191:
- .long SYM(_uhoh) | 192:
- .long SYM(_uhoh) | 193:
- .long SYM(_uhoh) | 194:
- .long SYM(_uhoh) | 195:
- .long SYM(_uhoh) | 196:
- .long SYM(_uhoh) | 197:
- .long SYM(_uhoh) | 198:
- .long SYM(_uhoh) | 199:
- .long SYM(_uhoh) | 200:
- .long SYM(_uhoh) | 201:
- .long SYM(_uhoh) | 202:
- .long SYM(_uhoh) | 203:
- .long SYM(_uhoh) | 204:
- .long SYM(_uhoh) | 205:
- .long SYM(_uhoh) | 206:
- .long SYM(_uhoh) | 207:
- .long SYM(_uhoh) | 208:
- .long SYM(_uhoh) | 209:
- .long SYM(_uhoh) | 210:
- .long SYM(_uhoh) | 211:
- .long SYM(_uhoh) | 212:
- .long SYM(_uhoh) | 213:
- .long SYM(_uhoh) | 214:
- .long SYM(_uhoh) | 215:
- .long SYM(_uhoh) | 216:
- .long SYM(_uhoh) | 217:
- .long SYM(_uhoh) | 218:
- .long SYM(_uhoh) | 219:
- .long SYM(_uhoh) | 220:
- .long SYM(_uhoh) | 221:
- .long SYM(_uhoh) | 222:
- .long SYM(_uhoh) | 223:
- .long SYM(_uhoh) | 224:
- .long SYM(_uhoh) | 225:
- .long SYM(_uhoh) | 226:
- .long SYM(_uhoh) | 227:
- .long SYM(_uhoh) | 228:
- .long SYM(_uhoh) | 229:
- .long SYM(_uhoh) | 230:
- .long SYM(_uhoh) | 231:
- .long SYM(_uhoh) | 232:
- .long SYM(_uhoh) | 233:
- .long SYM(_uhoh) | 234:
- .long SYM(_uhoh) | 235:
- .long SYM(_uhoh) | 236:
- .long SYM(_uhoh) | 237:
- .long SYM(_uhoh) | 238:
- .long SYM(_uhoh) | 239:
- .long SYM(_uhoh) | 240:
- .long SYM(_uhoh) | 241:
- .long SYM(_uhoh) | 242:
- .long SYM(_uhoh) | 243:
- .long SYM(_uhoh) | 244:
- .long SYM(_uhoh) | 245:
- .long SYM(_uhoh) | 246:
- .long SYM(_uhoh) | 247:
- .long SYM(_uhoh) | 248:
- .long SYM(_uhoh) | 249:
- .long SYM(_uhoh) | 250:
- .long SYM(_uhoh) | 251:
- .long SYM(_uhoh) | 252:
- .long SYM(_uhoh) | 253:
- .long SYM(_uhoh) | 254:
- .long SYM(_uhoh) | 255:
-
-/*
- * Default trap handler
- * With an oscilloscope you can see AS* stop
- */
- PUBLIC (_uhoh)
-SYM(_uhoh): nop | Leave spot for breakpoint
- stop #0x2700 | Stop with interrupts disabled
- bra.s SYM(_uhoh) | Stuck forever
-
-/*
- * Log, but otherwise ignore, spurious interrupts
- */
- PUBLIC (_spuriousInterrupt)
-SYM(_spuriousInterrupt):
- addql #1,SYM(_M68kSpuriousInterruptCount)
- rte
-
-/*
- * Place the low-order 3 octets of the board's ethernet address at
- * a `well-known' fixed location relative to the startup location.
- */
- .align 2
- .word 0 | Padding
-ethernet_address_buffer:
- .word 0x08F3 | Default address
- .word 0xDEAD
- .word 0xCAFE
-
-/* -- equates -- */
-.equ _PROM_Start, 0x01000000 /* CS0 */
-.equ _BCCram_Start, 0x00000000 /* CS1 */
-.equ _FLEX_Start, 0x08000000 /* CS2 */
-.equ _I2C_Start, 0x02000000 /* CS3 */
-.equ _EXTram_Start, 0x10000000 /* CS4 */
-.equ _EXTram_Size, 0x000400000 /* 4 Mbytes */
-.equ _SPEED, 0xD780 /* 25 Mhz CPU349 */
-/* .equ _SPEED, 0xD700 25 Mhz */
-/* .equ _SPEED, 0xCE00 16 Mhz */
-
-BEGIN_DATA
-
-_crt0_init_stack:
- ds.l 0x1000
-_crt0_init_stktop:
-
-
-BEGIN_CODE
- dc.l _crt0_init_stktop /* reset SP */
- dc.l _crt0_cold_start /* reset PC */
- dc.l _crt0_warm_start
-
- .ascii "RTEMS"
- dc.w 0
-
-.align 2
-
-_table_cs:
- /* carte Astecc - 68340 */
- dc.l 0x003FFFF0 /* Mask CS0 (4Mbytes PROM, 32bits, 0WS) */
-/* dc.l 0x003FFFFD Mask CS0 (4Mbytes PROM, 16bits, 3WS) */
- dc.l ((_PROM_Start&0xFFFFFF00)+0x00000003) /* Base CS0 */
-/* dc.l 0x0000FFF1 MASK CS1 (RAMBCC340, 0WS, FTE) */
- dc.l 0x0000FFFD /* MASK CS1 (RAMBCC340, 0WS, FTE) */
-/* dc.l ((_BCCram_Start&0xFFFFFF00)+0x00000007) Base CS1 */
- dc.l ((_BCCram_Start&0xFFFFFF00)+0x00000003) /* Base CS1 */
- dc.l 0x000000FF /* MASK CS2 (FLEX, ext DTACK, 256 bytes) */
- dc.l ((_FLEX_Start&0xFFFFFF00)+0x00000003) /* Base CS2 */
- dc.l 0x000000FF /* Mask CS3 (I2C, ext DTACK, 256 bytes) */
- dc.l ((_I2C_Start&0xFFFFFF00)+0x00000003) /* Base CS3 */
-
-/*
- * Initial PC
- */
-.globl start
-start:
-
-_crt0_cold_start:
- moveq.l #0,d0 /* signal cold reset */
- bra.s _crt0_common_start
-
-_crt0_warm_start:
- moveq.l #1,d0 /* signal warm reset */
-
-_crt0_common_start:
- move.w #0x2700,sr /* disable interrupts and switch to interrupt mode */
- movea.l #_crt0_init_stktop,sp /* set up initialization stack */
-
- lea Entry,a0 /* Get base of vector table */
- movec a0,vbr /* Set up the VBR */
-
- moveq.l #0x07,d1
- movec.l d1,dfc /* prepare access in CPU space */
- move.l #(BASE_SIM+1),d1
- moves.l d1,BASE_REG /* base initialization (must be MOVES, PCC-130795) */
- moveq.l #0x05,d1
- movec.l d1,dfc
-
- movea.l #BASE_SIM,a0
-
- /* -- disable Bus Monitor -- */
- move.b #0,SIM_SYPCR(a0) /* system protection control register */
-
- /* -- set frequency to 25.16 Mhz -- */
- move.w #_SPEED,SIM_SYNCR(a0) /* clock */
-
-sync_wait:
- btst.b #3,(SIM_SYNCR+1)(a0)
- beq sync_wait
-
- /* -- enable A31-A24 -- */
- clr.b SIM_PPRA1(a0)
-
- /* -- show cycles, user acces to SIM, 4 /CS & 4 /IT -- */
- move.w #0x427F,SIM_MCR(a0)
-
- /* -- chip select initialization -- */
- lea.l SIM_MASKH0(a0),a2
- lea.l _table_cs(%pc),a1
-
- moveq.l #0x07,d1
-
-_b_cs:
- move.l (a1)+, (a2)+
- dbra d1,_b_cs
-
- /* fill RAM if COLDSTART */
- tst.l d0
- bne _dont_fill
-
- movea.l #_EXTram_Start,a0 /* get start */
- move.l #_EXTram_Size,d1 /* get size */
- lsr.l #2,d1 /* ajust for long word */
-
-_fill_loop:
- clr.l (a0)+
- subq.l #1,d1
- bne _fill_loop
-
-_dont_fill:
- jmp SYM(_Init68340) | Start C code (which never returns)
-
-/*
- * Copy DATA segment, clear BSS segment, set up real stack,
- * initialize heap, start C program.
- * Assume that DATA and BSS sizes are multiples of 4.
- */
- PUBLIC (_CopyDataClearBSSAndStart)
-SYM(_CopyDataClearBSSAndStart):
- lea copy_start,a0 | Get start of DATA in RAM
- lea SYM(etext),a2 | Get start of DATA in ROM
- cmpl a0,a2 | Are they the same?
- beq.s NOCOPY | Yes, no copy necessary
- lea copy_end,a1 | Get end of DATA in RAM
- bra.s COPYLOOPTEST | Branch into copy loop
-COPYLOOP:
- movel a2@+,a0@+ | Copy word from ROM to RAM
-COPYLOOPTEST:
- cmpl a1,a0 | Done?
- bcs.s COPYLOOP | No, skip
-NOCOPY:
-
- lea clear_start,a0 | Get start of BSS
- lea clear_end,a1 | Get end of BSS
- clrl d0 | Value to set
- bra.s ZEROLOOPTEST | Branch into clear loop
-ZEROLOOP:
- movel d0,a0@+ | Clear a word
-ZEROLOOPTEST:
- cmpl a1,a0 | Done?
- bcs.s ZEROLOOP | No, skip
-
- movel #stack_init,a7 | set master stack pointer
- movel d0,a7@- | environp
- movel d0,a7@- | argv
- movel d0,a7@- | argc
- jsr SYM(boot_card) | Call C main
-
- PUBLIC (_mainDone)
-SYM(_mainDone):
- nop | Leave spot for breakpoint
- movew #1,a7 | Force a double bus error
- movel d0,a7@- | This should cause a RESET
- stop #0x2700 | Stop with interrupts disabled
- bra.s SYM(_mainDone) | Stuck forever
-
- .align 2
- PUBLIC (_HeapSize)
-SYM (_HeapSize):
- .long HeapSize
- PUBLIC (_StackSize)
-SYM (_StackSize):
- .long StackSize
-END_CODE
-
-BEGIN_DATA_DCL
- .align 2
- PUBLIC (environ)
-SYM (environ):
- .long 0
- PUBLIC (_M68kSpuriousInterruptCount)
-SYM (_M68kSpuriousInterruptCount):
- .long 0
-END_DATA_DCL
-
-END
-
diff --git a/c/src/lib/libbsp/m68k/gen68340/start340/Makefile.in b/c/src/lib/libbsp/m68k/gen68340/start340/Makefile.in
deleted file mode 100644
index ce91b95e3b..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/start340/Makefile.in
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/start340.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start340
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
diff --git a/c/src/lib/libbsp/m68k/gen68340/start340/start340.s b/c/src/lib/libbsp/m68k/gen68340/start340/start340.s
deleted file mode 100644
index 58ea0c92d0..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/start340/start340.s
+++ /dev/null
@@ -1,874 +0,0 @@
-/*
- * This file contains the entry point for the application.
- * The name of this entry point is compiler dependent.
- * It jumps to the BSP which is responsible for performing
- * all initialization.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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.
- *
- * Based on the `gen68360' board support package, and covered by the
- * original distribution terms.
- *
- * Geoffroy Montel
- * France Telecom - CNET/DSM/TAM/CAT
- * 4, rue du Clos Courtel
- * 35512 CESSON-SEVIGNE
- * FRANCE
- *
- * e-mail: g_montel@yahoo.com
- *
- * $Id$
- */
-
-#include "asm.h"
-#include <m68349.inc>
-
-#define _OLD_ASTECC 1 /* old addresses for AST68340 only, undefine for AST68349 */
-
-BEGIN_CODE
- /*
- * Step 1: Decide on Reset Stack Pointer and Initial Program Counter
- */
-Entry:
- .long SYM(m340)+1024 | 0: Initial SSP
- .long start | 1: Initial PC
- .long SYM(_uhoh) | 2: Bus error
- .long SYM(_uhoh) | 3: Address error
- .long SYM(_uhoh) | 4: Illegal instruction
- .long SYM(_uhoh) | 5: Zero division
- .long SYM(_uhoh) | 6: CHK, CHK2 instruction
- .long SYM(_uhoh) | 7: TRAPcc, TRAPV instructions
- .long SYM(_uhoh) | 8: Privilege violation
- .long SYM(_uhoh) | 9: Trace
- .long SYM(_uhoh) | 10: Line 1010 emulator
- .long SYM(_uhoh) | 11: Line 1111 emulator
- .long SYM(_uhoh) | 12: Hardware breakpoint
- .long SYM(_uhoh) | 13: Reserved for coprocessor violation
- .long SYM(_uhoh) | 14: Format error
- .long SYM(_uhoh) | 15: Uninitialized interrupt
- .long SYM(_uhoh) | 16: Unassigned, reserved
- .long SYM(_uhoh) | 17:
- .long SYM(_uhoh) | 18:
- .long SYM(_uhoh) | 19:
- .long SYM(_uhoh) | 20:
- .long SYM(_uhoh) | 21:
- .long SYM(_uhoh) | 22:
- .long SYM(_uhoh) | 23:
- .long SYM(_spuriousInterrupt) | 24: Spurious interrupt
- .long SYM(_uhoh) | 25: Level 1 interrupt autovector
- .long SYM(_uhoh) | 26: Level 2 interrupt autovector
- .long SYM(_uhoh) | 27: Level 3 interrupt autovector
- .long SYM(_uhoh) | 28: Level 4 interrupt autovector
- .long SYM(_uhoh) | 29: Level 5 interrupt autovector
- .long SYM(_uhoh) | 30: Level 6 interrupt autovector
- .long SYM(_uhoh) | 31: Level 7 interrupt autovector
- .long SYM(_uhoh) | 32: Trap instruction (0-15)
- .long SYM(_uhoh) | 33:
- .long SYM(_uhoh) | 34:
- .long SYM(_uhoh) | 35:
- .long SYM(_uhoh) | 36:
- .long SYM(_uhoh) | 37:
- .long SYM(_uhoh) | 38:
- .long SYM(_uhoh) | 39:
- .long SYM(_uhoh) | 40:
- .long SYM(_uhoh) | 41:
- .long SYM(_uhoh) | 42:
- .long SYM(_uhoh) | 43:
- .long SYM(_uhoh) | 44:
- .long SYM(_uhoh) | 45:
- .long SYM(_uhoh) | 46:
- .long SYM(_uhoh) | 47:
- .long SYM(_uhoh) | 48: Reserved for coprocessor
- .long SYM(_uhoh) | 49:
- .long SYM(_uhoh) | 50:
- .long SYM(_uhoh) | 51:
- .long SYM(_uhoh) | 52:
- .long SYM(_uhoh) | 53:
- .long SYM(_uhoh) | 54:
- .long SYM(_uhoh) | 55:
- .long SYM(_uhoh) | 56:
- .long SYM(_uhoh) | 57:
- .long SYM(_uhoh) | 58:
- .long SYM(_uhoh) | 59: Unassigned, reserved
- .long SYM(_uhoh) | 60:
- .long SYM(_uhoh) | 61:
- .long SYM(_uhoh) | 62:
- .long SYM(_uhoh) | 63:
- .long SYM(_uhoh) | 64: User defined vectors (192)
- .long SYM(_uhoh) | 65:
- .long SYM(_uhoh) | 66:
- .long SYM(_uhoh) | 67:
- .long SYM(_uhoh) | 68:
- .long SYM(_uhoh) | 69:
- .long SYM(_uhoh) | 70:
- .long SYM(_uhoh) | 71:
- .long SYM(_uhoh) | 72:
- .long SYM(_uhoh) | 73:
- .long SYM(_uhoh) | 74:
- .long SYM(_uhoh) | 75:
- .long SYM(_uhoh) | 76:
- .long SYM(_uhoh) | 77:
- .long SYM(_uhoh) | 78:
- .long SYM(_uhoh) | 79:
- .long SYM(_uhoh) | 80:
- .long SYM(_uhoh) | 81:
- .long SYM(_uhoh) | 82:
- .long SYM(_uhoh) | 83:
- .long SYM(_uhoh) | 84:
- .long SYM(_uhoh) | 85:
- .long SYM(_uhoh) | 86:
- .long SYM(_uhoh) | 87:
- .long SYM(_uhoh) | 88:
- .long SYM(_uhoh) | 89:
- .long SYM(_uhoh) | 90:
- .long SYM(_uhoh) | 91:
- .long SYM(_uhoh) | 92:
- .long SYM(_uhoh) | 93:
- .long SYM(_uhoh) | 94:
- .long SYM(_uhoh) | 95:
- .long SYM(_uhoh) | 96:
- .long SYM(_uhoh) | 97:
- .long SYM(_uhoh) | 98:
- .long SYM(_uhoh) | 99:
- .long SYM(_uhoh) | 100:
- .long SYM(_uhoh) | 101:
- .long SYM(_uhoh) | 102:
- .long SYM(_uhoh) | 103:
- .long SYM(_uhoh) | 104:
- .long SYM(_uhoh) | 105:
- .long SYM(_uhoh) | 106:
- .long SYM(_uhoh) | 107:
- .long SYM(_uhoh) | 108:
- .long SYM(_uhoh) | 109:
- .long SYM(_uhoh) | 110:
- .long SYM(_uhoh) | 111:
- .long SYM(_uhoh) | 112:
- .long SYM(_uhoh) | 113:
- .long SYM(_uhoh) | 114:
- .long SYM(_uhoh) | 115:
- .long SYM(_uhoh) | 116:
- .long SYM(_uhoh) | 117:
- .long SYM(_uhoh) | 118:
- .long SYM(_uhoh) | 119:
- .long SYM(_uhoh) | 120:
- .long SYM(_uhoh) | 121:
- .long SYM(_uhoh) | 122:
- .long SYM(_uhoh) | 123:
- .long SYM(_uhoh) | 124:
- .long SYM(_uhoh) | 125:
- .long SYM(_uhoh) | 126:
- .long SYM(_uhoh) | 127:
- .long SYM(_uhoh) | 128:
- .long SYM(_uhoh) | 129:
- .long SYM(_uhoh) | 130:
- .long SYM(_uhoh) | 131:
- .long SYM(_uhoh) | 132:
- .long SYM(_uhoh) | 133:
- .long SYM(_uhoh) | 134:
- .long SYM(_uhoh) | 135:
- .long SYM(_uhoh) | 136:
- .long SYM(_uhoh) | 137:
- .long SYM(_uhoh) | 138:
- .long SYM(_uhoh) | 139:
- .long SYM(_uhoh) | 140:
- .long SYM(_uhoh) | 141:
- .long SYM(_uhoh) | 142:
- .long SYM(_uhoh) | 143:
- .long SYM(_uhoh) | 144:
- .long SYM(_uhoh) | 145:
- .long SYM(_uhoh) | 146:
- .long SYM(_uhoh) | 147:
- .long SYM(_uhoh) | 148:
- .long SYM(_uhoh) | 149:
- .long SYM(_uhoh) | 150:
- .long SYM(_uhoh) | 151:
- .long SYM(_uhoh) | 152:
- .long SYM(_uhoh) | 153:
- .long SYM(_uhoh) | 154:
- .long SYM(_uhoh) | 155:
- .long SYM(_uhoh) | 156:
- .long SYM(_uhoh) | 157:
- .long SYM(_uhoh) | 158:
- .long SYM(_uhoh) | 159:
- .long SYM(_uhoh) | 160:
- .long SYM(_uhoh) | 161:
- .long SYM(_uhoh) | 162:
- .long SYM(_uhoh) | 163:
- .long SYM(_uhoh) | 164:
- .long SYM(_uhoh) | 165:
- .long SYM(_uhoh) | 166:
- .long SYM(_uhoh) | 167:
- .long SYM(_uhoh) | 168:
- .long SYM(_uhoh) | 169:
- .long SYM(_uhoh) | 170:
- .long SYM(_uhoh) | 171:
- .long SYM(_uhoh) | 172:
- .long SYM(_uhoh) | 173:
- .long SYM(_uhoh) | 174:
- .long SYM(_uhoh) | 175:
- .long SYM(_uhoh) | 176:
- .long SYM(_uhoh) | 177:
- .long SYM(_uhoh) | 178:
- .long SYM(_uhoh) | 179:
- .long SYM(_uhoh) | 180:
- .long SYM(_uhoh) | 181:
- .long SYM(_uhoh) | 182:
- .long SYM(_uhoh) | 183:
- .long SYM(_uhoh) | 184:
- .long SYM(_uhoh) | 185:
- .long SYM(_uhoh) | 186:
- .long SYM(_uhoh) | 187:
- .long SYM(_uhoh) | 188:
- .long SYM(_uhoh) | 189:
- .long SYM(_uhoh) | 190:
- .long SYM(_uhoh) | 191:
- .long SYM(_uhoh) | 192:
- .long SYM(_uhoh) | 193:
- .long SYM(_uhoh) | 194:
- .long SYM(_uhoh) | 195:
- .long SYM(_uhoh) | 196:
- .long SYM(_uhoh) | 197:
- .long SYM(_uhoh) | 198:
- .long SYM(_uhoh) | 199:
- .long SYM(_uhoh) | 200:
- .long SYM(_uhoh) | 201:
- .long SYM(_uhoh) | 202:
- .long SYM(_uhoh) | 203:
- .long SYM(_uhoh) | 204:
- .long SYM(_uhoh) | 205:
- .long SYM(_uhoh) | 206:
- .long SYM(_uhoh) | 207:
- .long SYM(_uhoh) | 208:
- .long SYM(_uhoh) | 209:
- .long SYM(_uhoh) | 210:
- .long SYM(_uhoh) | 211:
- .long SYM(_uhoh) | 212:
- .long SYM(_uhoh) | 213:
- .long SYM(_uhoh) | 214:
- .long SYM(_uhoh) | 215:
- .long SYM(_uhoh) | 216:
- .long SYM(_uhoh) | 217:
- .long SYM(_uhoh) | 218:
- .long SYM(_uhoh) | 219:
- .long SYM(_uhoh) | 220:
- .long SYM(_uhoh) | 221:
- .long SYM(_uhoh) | 222:
- .long SYM(_uhoh) | 223:
- .long SYM(_uhoh) | 224:
- .long SYM(_uhoh) | 225:
- .long SYM(_uhoh) | 226:
- .long SYM(_uhoh) | 227:
- .long SYM(_uhoh) | 228:
- .long SYM(_uhoh) | 229:
- .long SYM(_uhoh) | 230:
- .long SYM(_uhoh) | 231:
- .long SYM(_uhoh) | 232:
- .long SYM(_uhoh) | 233:
- .long SYM(_uhoh) | 234:
- .long SYM(_uhoh) | 235:
- .long SYM(_uhoh) | 236:
- .long SYM(_uhoh) | 237:
- .long SYM(_uhoh) | 238:
- .long SYM(_uhoh) | 239:
- .long SYM(_uhoh) | 240:
- .long SYM(_uhoh) | 241:
- .long SYM(_uhoh) | 242:
- .long SYM(_uhoh) | 243:
- .long SYM(_uhoh) | 244:
- .long SYM(_uhoh) | 245:
- .long SYM(_uhoh) | 246:
- .long SYM(_uhoh) | 247:
- .long SYM(_uhoh) | 248:
- .long SYM(_uhoh) | 249:
- .long SYM(_uhoh) | 250:
- .long SYM(_uhoh) | 251:
- .long SYM(_uhoh) | 252:
- .long SYM(_uhoh) | 253:
- .long SYM(_uhoh) | 254:
- .long SYM(_uhoh) | 255:
-
-/*
- * Default trap handler
- * With an oscilloscope you can see AS* stop
- */
- PUBLIC (_uhoh)
-SYM(_uhoh): nop | Leave spot for breakpoint
-/* stop #0x2700 | Stop with interrupts disabled */
- move.w #0x2700,sr
- move.w (a7),_boot_panic_registers+4 | SR
- move.l 2(a7),_boot_panic_registers | PC
- move.w 6(a7),_boot_panic_registers+6 | format & vector
- movem.l d0-d7/a0-a7, _boot_panic_registers+8
- movec sfc, d0
- movem.l d0, _boot_panic_registers+72
- movec dfc, d0
- movem.l d0, _boot_panic_registers+76
- movec vbr, d0
- movem.l d0, _boot_panic_registers+80
- jmp SYM(_dbug_dumpanic)
- bra.s _crt0_cold_start
-
-/*
- * Log, but otherwise ignore, spurious interrupts
- */
- PUBLIC (_spuriousInterrupt)
-SYM(_spuriousInterrupt):
- addql #1,SYM(_M68kSpuriousInterruptCount)
- rte
-
-/*
- * Place the low-order 3 octets of the board's ethernet address at
- * a `well-known' fixed location relative to the startup location.
- */
- .align 2
- .word 0 | Padding
-ethernet_address_buffer:
- .word 0x08F3 | Default address
- .word 0xDEAD
- .word 0xCAFE
-
-BEGIN_DATA
-
-/* equates */
-
-.equ _CPU340, 0x0
-.equ _CPU349, 0x31
-
-#ifdef _OLD_ASTECC /* old addresses for AST68340 only */
-.equ _EPLD_CS_BASE, 0x1
-.equ _PROM_Start, 0x01000000 /* CS0 */
-.equ _FLEX_Start, 0x08000000 /* CS2 */
-.equ _I2C_Start, 0x0c000000 /* CS3 */
-
-.equ _BCCram_Start, 0x00000000 /* CS1 64 Kbytes */
-.equ _BCCram_Size, 0x00010000 /* CS1 64 Kbytes */
-
-.equ _ExtRam_Start, 0x10000000 /* SRAM */
-.equ _ExtRam_Size, 0x00400000 /* 4 Mbytes */
-
-.equ _FastRam_Start, 0x00000000 /* overlap /CS1 for the first 4 Kbytes */
-.equ _FastRam_Size, 0x00001000 /* 4 Kbytes */
-
-#else /* new addresses for AST68349 and 68340 */
-
-.equ _EPLD_CS_BASE, 0x5
-.equ _PROM_Start, 0x50000000 /* CS0 */
-.equ _FLEX_Start, 0x08000000 /* CS2 */
-.equ _I2C_Start, 0x0c000000 /* CS3 */
-
-.equ _BCCram_Start, 0x00000000 /* CS1 64 Kbytes */
-.equ _BCCram_Size, 0x00010000 /* CS1 64 Kbytes */
-
-.equ _ExtRam_Start, 0x80000000 /* DRAM */
-.equ _ExtRam_Size, 0x00400000 /* 4 Mbytes */
-
-.equ _FastRam_Start, 0x00000000 /* overlap /CS1 for the first 4 Kbytes */
-.equ _FastRam_Size, 0x00001000 /* 4 Kbytes */
-#endif
-
-.equ _SPEED349, 0xD680 /* 24 Mhz */
-.equ _SPEED340, 0xD700 /* 25 Mhz */
-/* .equ _SPEED340, 0xCE00 16 Mhz */
-
-#define crt0_boot_type d0 /* cold/warm start (must be D0) */
-#define crt0_temp d1
-#define crt0_cpu_type d2
-#define crt0_csswitch d3
-#define crt0_buswidth d4
-#define crt0_pdcs d5
-#define crt0_spare6 d6
-#define crt0_spare7 d7
-#define crt0_sim_base a0
-#define crt0_glue a1
-#define crt0_dram a2
-#define crt0_ptr3 a3
-#define crt0_ptr4 a4
-#define crt0_ptr5 a5
-#define crt0_ptr6 a6
-
-/* -- PDCS buffer equates -- */
-.equ pdcs_mask, 0x1F /* DRAM configuration */
-.equ pdcs_sw12, 7 /* switch 12 */
-.equ pdcs_sw11, 6 /* switch 11 */
-.equ pdcs_sw14, 5 /* switch 14 */
-
-.equ bit_cache, pdcs_sw12 /* enable cache if on */
-.equ bit_meminit, pdcs_sw11 /* init memory if on */
-
-/* -- Initialization stack and vars -- */
-
-_AsteccBusWidth: ds.b 1
-_AsteccCsSwitch: ds.b 1
-_AsteccCpuName: ds.l 1
-
-.align 4
-
-_crt0_init_stack:
- ds.l 500
-_crt0_init_stktop:
-
-/* -- Initialization code -- */
-BEGIN_CODE
-
-.align 4
- dc.l _crt0_init_stktop /* reset SP */
- dc.l _crt0_cold_start /* reset PC */
- dc.l _crt0_warm_start
-
- .ascii "BOOT XHM68K/Spectra for ASTECC 68349 and 68340 boards"
- dc.w 0
-.align 4
-
-.globl start
-start:
-
-_crt0_cold_start:
- moveq.l #0,crt0_boot_type | signal cold reset
- bra.s _crt0_common_start
-
-_crt0_warm_start:
- moveq.l #1,crt0_boot_type | signal warm reset
-
-_crt0_common_start:
- move.w #0x2700,sr | disable interrupts and switch to interrupt mode
- movea.l #_crt0_init_stktop,sp | set up initialization stack
-
- move.l #Entry,crt0_temp | VBR initialization
- movec.l crt0_temp,vbr |
- moveq.l #0x07,crt0_temp
- movec.l crt0_temp,dfc | prepare access in CPU space
- move.l #(BASE_SIM+0x111),crt0_temp | mask CPU, RESERVED USER SPACES
- moves.l crt0_temp,BASE_REG | base initialization (must be MOVES, PCC-130795)
-
- movea.l #BASE_SIM,crt0_sim_base
-
- /* -- disable Bus Monitor -- */
- move.b #0,SIM_SYPCR(crt0_sim_base) | system protection control register
-
- /* -- enable A31-A24 -- */
- clr.b SIM_PPRA1(crt0_sim_base)
-
- /* -- show cycles, user acces to SIM, 4 /CS & 4 /IT -- */
- move.w #0x427F,SIM_MCR(crt0_sim_base)
-
- /* -- enable /IRQ3, 5, 6, 7 -- */
- move.b #0xE8,SIM_PPRB(crt0_sim_base)
-
- /* -- enable autovector on /IRQ7 -- */
- move.b #0x80,SIM_AVR(crt0_sim_base)
-
- /* -- test CPU type -- */
- cmp.b #_CPU349,SIM_IDR(crt0_sim_base)
- bne cpu_is_68340
-
-/*-------------------------------------------------------------------------------------------*/
-cpu_is_68349:
-
- /* -- set cpu clock -- */
- move.w #_SPEED349,SIM_SYNCR(crt0_sim_base) | clock
-
-sync_wait349:
- btst.b #3,(SIM_SYNCR+1)(crt0_sim_base)
- beq sync_wait349
-
- /* to allow access to the EPLD internal registers, it is necessary
- to disable the global chip-select /CS0 (which decodes every external
- cycles). To do that, we initialize the 68349 internal RAM,
- copy a part of the initialization code in it, and jump there.
- from that moment, /CS0 is not used, therefore it can be initialized
- with its default value. Its width may be incorrect, but it will be
- adjusted later. The goal is to avoid any conflict with
- the accesses to the EPLD registers.
- When this is done, we read the RESET parameters (boot prom width
- and chip-select switch) and proceed with the initialization
- when all is done, we jump back to the boot prom now
- decoded with a properly configured /CS0 */
-
- /*-------------------------------------*/
- /* -- configure internal SRAM banks -- */
-
- move.l #0x00000000,QDMM_MCR(crt0_sim_base)
- move.l #_FastRam_Start+0x0005,QDMM_QBAR0(crt0_sim_base)
- move.l #_FastRam_Start+0x0405,QDMM_QBAR1(crt0_sim_base)
- move.l #_FastRam_Start+0x0805,QDMM_QBAR2(crt0_sim_base)
- move.l #_FastRam_Start+0x0c05,QDMM_QBAR3(crt0_sim_base)
-
- /*--------------------------------------------------------*/
- /* -- copy to address of the 68349 initialization code -- */
-
- lea.l _copy_start(%pc),crt0_ptr3
- lea.l _copy_end(%pc),crt0_ptr4
- move.l crt0_ptr4,crt0_temp
- sub.l crt0_ptr3,crt0_temp
- add.l #3,crt0_temp | adjust to next long word
- lsr.l #2,crt0_temp
-
- move.l #_FastRam_Start,crt0_ptr4
-_copy_loop:
- move.l (crt0_ptr3)+,(crt0_ptr4)+
- subq.l #1,crt0_temp
- bne.s _copy_loop
- bra.l _FastRam_Start | jump to code in internal RAM
-
- /*------------------------------------*/
- /* -- start of initialization code -- */
-
-_copy_start:
- bra.l _begin_68349_init
-
- /*----------------------------------------------------------*/
- /* Astecc 68349 board : chip-select initialization values */
-
-_table_csepld:
- dc.b (_EPLD_CS_BASE&0x0F)+0x80 | 16 bits, 0ws
- dc.b 0x80 | 16 bits, 0 ws
- dc.b 0x90 | 16 bits, ext /dsack
- dc.b 0x90 | 16 bits, ext /dsack
-
-_table_cs349:
- dc.l 0x003FFFF4 | Mask CS0 (4Mbytes PROM, 32bits, 1WS)
- dc.l (_PROM_Start&0xFFFFFF00)+0x00000003 | Base CS0
- dc.l 0x003FFFF1 | MASK CS1 (4Mbytes RAM, 16bits, 0WS)
- dc.l (_BCCram_Start&0xFFFFFF00)+0x00000003 | Base CS1
- dc.l 0x000000FF | MASK CS2 (FLEX, ext DTACK, 256 bytes)
- dc.l (_FLEX_Start&0xFFFFFF00)+0x00000003 | Base CS2
- dc.l 0x000000FF | Mask CS3 (I2C, ext DTACK, 256 bytes)
- dc.l (_I2C_Start&0xFFFFFF00)+0x00000003 | Base CS3
-
- /*-------------------------------------------------*/
-_begin_68349_init:
-
- /*-------------------------------------------------*/
- /* 68349 chip select initialization
-
- at this stage, the width of /CS0 may be incorrect
- it will be corrected later
- */
-
-_cs68349_init:
- lea.l SIM_MASKH0(crt0_sim_base),crt0_ptr4
- lea.l _table_cs349(%pc),crt0_ptr3
-
- moveq.l #0x07,crt0_temp
-_cs349_init2:
- move.l (crt0_ptr3)+,(crt0_ptr4)+
- dbra crt0_temp,_cs349_init2
-
- /*-----------------------------------------------*/
- /* -- prepare access to the internal registers --*/
- moveq.l #EPLD_SPACE,crt0_temp
- movec.l crt0_temp,dfc
- movec.l crt0_temp,sfc
- move.l #GLUE_EPLD,crt0_glue
- move.l #DRAM_EPLD,crt0_dram
-
- /*-------------------------------------------*/
- /* EPLD generated /CS[3..0] must be disabled */
-
-_csepld_clear:
- move.l crt0_glue,crt0_ptr4
- move.w #3,crt0_spare6
- clr.b crt0_temp
-
-_csepld_clear1:
- moves.b crt0_temp,(crt0_ptr4)+
- dbra crt0_spare6,_csepld_clear1
-
- /*---------------------------------------------------------*/
- /* -- get width of boot PROM, and active chip-select set --*/
- moves.b REG_BUSWIDTH(crt0_dram),crt0_csswitch
- move.b crt0_csswitch,crt0_buswidth
-
- /* state of CS_SWITCH : sel == 0 => CPU chip_selects (/CS[3..0])
- : sel == 1 => EPLD chip_selects (/CS[3..0]) */
- and.b #1,crt0_csswitch
-
- /* bus width of /CS0 during reset bw[1..0] : 0 1 2 3
- bus width : 32 16 8 ext./dsackx */
- rol.b #2,crt0_buswidth
- and.b #3,crt0_buswidth
-
- /*----------------------------------------------------*/
- /* -- configure chip select 0 with boot prom width -- */
- lea.l SIM_MASKH0(crt0_sim_base),crt0_ptr4
- lea.l _table_cs349(%pc),crt0_ptr3
- move.l (crt0_ptr3)+,crt0_temp
- and.b #0xFC,crt0_temp | clear PS0 & PS1
- or.b crt0_buswidth,crt0_temp | set boot PROM bus width
- move.l crt0_temp,(crt0_ptr4)+
-
- /*------------------------*/
- /* -- read PDCS buffer -- */
- moves.b REG_PDCS(crt0_glue),crt0_pdcs
-/* move.b #0x3F,crt0_pdcs pour test */
-
-
- /*---------------------------------------*/
- /* -- EPLD chip-select initialization -- */
- /*---------------------------------------*/
- btst.b #0,crt0_csswitch
- beq _cs_init_end
-
- /*--------------------------------------------*/
- /* 68349 generated /CS[3..0] must be disabled */
- lea.l SIM_MASKH0(crt0_sim_base),crt0_ptr4
- lea.l _table_cs349(%pc),crt0_ptr3
- moveq.l #0x03,crt0_temp
-_cs349_clear:
- move.l (crt0_ptr3)+,(crt0_ptr4)+
- move.l (crt0_ptr3)+,crt0_spare6
- and.b #0xFE,crt0_spare6 | disable chip-select
- move.l crt0_spare6,(crt0_ptr4)+
- dbra crt0_temp,_cs349_clear
-
- /*---------------------------------------------*/
- /* EPLD generated /CS[3..0] must be configured */
-_csepld_init:
- move.l crt0_glue,crt0_ptr4
- lea.l _table_csepld(%pc),crt0_ptr3
-
- move.b (crt0_ptr3)+,crt0_temp
- or.b #0x20,crt0_temp | default width is 32 bits
- tst.b crt0_buswidth | is boot PROM bus width 32 bits ?
- beq _csepld1 | if not
- and.b #0xDF,crt0_temp | set width to 16 bits
-_csepld1:
- moves.b crt0_temp,(crt0_ptr4)+
-
- moveq.l #0x02,crt0_spare6
-_csepld2:
- move.b (crt0_ptr3)+,crt0_temp
- moves.b crt0_temp,(crt0_ptr4)+
- dbra crt0_spare6,_csepld2
-
-_cs_init_end:
-
- /*--------------------------------------*/
- /* -- DRAM controller initialization -- */
-_dram_init:
- move.w #15,crt0_temp
- move.l #_ExtRam_Start,crt0_ptr3
-
-_dram_init1:
- clr.l (crt0_ptr3)+ | must access DRAM
- dbra crt0_temp,_dram_init1 | prior to init refresh
-
-_dram_init2:
- move.b #3,crt0_temp
- moves.b crt0_temp,REG_WS(crt0_dram) | set 3 wait-states
-
- move.b #0x81,crt0_temp
- moves.b crt0_temp,REG_REFRESH(crt0_dram) | refresh every 10µs
-
- move.b #0,crt0_temp
- moves.b crt0_temp,REG_CONFIG(crt0_dram) | default size = 4Mbytes
-
- /*-----------------------*/
- /* -- configure cache -- */
-_init_cache:
- move.l #0x000001E0,CACHE_MCR(crt0_sim_base)
- btst.b #bit_cache,crt0_pdcs
- bne _init_cache_end
- or.l #0x00000001,CACHE_MCR(crt0_sim_base)
-
-_init_cache_end:
-
- /*-----------------------------*/
- /* -- timers initialization -- */
-
- clr.b crt0_temp
- moves.b crt0_temp,REG_TIMER1(crt0_glue) | disable timer 1
- moves.b crt0_temp,REG_TIMER2(crt0_glue) | disable timer 2
-
- /*--------------------------*/
- /* -- I2C initialization -- */
- move.b #3,crt0_temp
- moves.b crt0_temp,REG_I2C(crt0_glue) | tri-states I2C ports
-
- /*-----------------------------------------*/
- /* -- baudrate generator initialization -- */
- move.b #2,crt0_temp
- moves.b crt0_temp,REG_BAUDRATE(crt0_glue) | baudrate = 38400
-
- /*-------------------------------*/
- /* -- IO port initialization -- */
- clr.b crt0_temp
- moves.b crt0_temp,REG_IO(crt0_glue) | set port as input
-
- /* -- */
-
- move.l #68349,crt0_cpu_type
-
-
- /* -- jump back to PROM -- */
-
- jmp.l (_fill_test) | must be absolute long
-
-_copy_end:
-
-/*-------------------------------------------------
- initialization code for the 68340 board
- -------------------------------------------------*/
-
- /* Astecc 68340 board : chip-select initialization values */
-_table_cs340:
- dc.l 0x003FFFF0 /* Mask CS0 (4Mbytes PROM, 32bits, 0WS) */
- dc.l ((_PROM_Start&0xFFFFFF00)+0x00000003) /* Base CS0 */
- dc.l 0x0000FFFD /* MASK CS1 (RAMBCC340, 0WS, FTE) */
- dc.l ((_BCCram_Start&0xFFFFFF00)+0x00000003) /* Base CS1 */
- dc.l 0x000000FF /* MASK CS2 (FLEX, ext DTACK, 256 bytes) */
- dc.l ((_FLEX_Start&0xFFFFFF00)+0x00000003) /* Base CS2 */
- dc.l 0x000000FF /* Mask CS3 (I2C, ext DTACK, 256 bytes) */
- dc.l ((_I2C_Start&0xFFFFFF00)+0x00000003) /* Base CS3 */
-
-cpu_is_68340:
-
- /* -- set cpu clock -- */
- move.w #_SPEED340,SIM_SYNCR(crt0_sim_base) | clock
-sync_wait340:
- btst.b #3,(SIM_SYNCR+1)(crt0_sim_base)
- beq sync_wait340
-
- /* -- chip select initialization -- */
- lea.l SIM_MASKH0(crt0_sim_base),crt0_ptr4
- lea.l _table_cs340(%pc),crt0_ptr3
- moveq.l #0x07,crt0_temp
-_b_cs340:
- move.l (crt0_ptr3)+,crt0_ptr5
- move.l crt0_ptr5,(crt0_ptr4)+ | pour test
- dbra crt0_temp,_b_cs340
-
- move.l #68340,crt0_cpu_type
- move.b #0,crt0_csswitch | CPU
- move.b #1,crt0_buswidth | 16 bits
-
-
- /*-------------------------------------------------
- fill RAM if COLDSTART
- -------------------------------------------------*/
-_fill_test:
-
- tst.l crt0_boot_type
- bne _dont_fill
-
- cmp.b #_CPU349,SIM_IDR(crt0_sim_base)
- bne _fill
- btst.b #bit_meminit,crt0_pdcs
- bne _dont_fill
-
- /* fill main memory */
-_fill:
- move.l #_crt0_init_stack,crt0_ptr3 | skip Astecc vars
- move.l #_ExtRam_Start,crt0_temp
- sub.l #_crt0_init_stack,crt0_temp
- add.l #_ExtRam_Size,crt0_temp | get size
- lsr.l #2,crt0_temp | ajust for long word
-_fill_loop:
- clr.l (crt0_ptr3)+
- subq.l #1,crt0_temp
- bne _fill_loop
-
- cmp.b #_CPU349,SIM_IDR(crt0_sim_base)
- bne _fill_bccram
-
- /* fill QDMM memory */
- movea.l #_FastRam_Start,crt0_ptr3 | get start
- move.l #_FastRam_Size,crt0_temp | get size
- lsr.l #2,crt0_temp | ajust for long word
-
-_QDMMfill_loop:
- clr.l (crt0_ptr3)+
- subq.l #1,crt0_temp
- bne _QDMMfill_loop
- bra _dont_fill
-
- /* fill BCC memory */
-_fill_bccram:
- movea.l #_BCCram_Start,crt0_ptr3 | get start
- move.l #_BCCram_Size,crt0_temp | get size
- lsr.l #2,crt0_temp | ajust for long word
-_BCCfill_loop:
- clr.l (crt0_ptr3)+
- subq.l #1,crt0_temp
- bne _BCCfill_loop
-
- *-------------------------------------------------*/
-_dont_fill:
- move.b crt0_csswitch,_AsteccCsSwitch
- move.b crt0_buswidth,_AsteccBusWidth
- move.l crt0_cpu_type,_AsteccCpuName
-
- jmp SYM(_Init68340) | Start C code (which never returns)
-
-/*
- * Copy DATA segment, clear BSS segment, set up real stack,
- * initialize heap, start C program.
- * Assume that DATA and BSS sizes are multiples of 4.
- */
- PUBLIC (_CopyDataClearBSSAndStart)
-SYM(_CopyDataClearBSSAndStart):
- lea copy_start,a0 | Get start of DATA in RAM
- lea SYM(etext),a2 | Get start of DATA in ROM
- cmpl a0,a2 | Are they the same?
- beq.s NOCOPY | Yes, no copy necessary
- lea copy_end,a1 | Get end of DATA in RAM
- bra.s COPYLOOPTEST | Branch into copy loop
-COPYLOOP:
- movel a2@+,a0@+ | Copy word from ROM to RAM
-COPYLOOPTEST:
- cmpl a1,a0 | Done?
- bcs.s COPYLOOP | No, skip
-NOCOPY:
-
- lea clear_start,a0 | Get start of BSS
- lea clear_end,a1 | Get end of BSS
- clrl d0 | Value to set
- bra.s ZEROLOOPTEST | Branch into clear loop
-ZEROLOOP:
- movel d0,a0@+ | Clear a word
-ZEROLOOPTEST:
- cmpl a1,a0 | Done?
- bcs.s ZEROLOOP | No, skip
-
- movel #stack_init,a7 | set master stack pointer
- movel d0,a7@- | environp
- movel d0,a7@- | argv
- movel d0,a7@- | argc
- jsr SYM(boot_card) | Call C main
-
- PUBLIC (_mainDone)
-SYM(_mainDone):
- nop | Leave spot for breakpoint
- movew #1,a7 | Force a double bus error
- movel d0,a7@- | This should cause a RESET
-/* stop #0x2700 | Stop with interrupts disabled */
- move.w #0x2700,sr
- bra.s SYM(_mainDone) | Stuck forever
-
- .align 2
- PUBLIC (_HeapSize)
-SYM (_HeapSize):
- .long HeapSize
- PUBLIC (_StackSize)
-SYM (_StackSize):
- .long StackSize
-END_CODE
-
-BEGIN_DATA_DCL
- .align 2
- PUBLIC (environ)
-SYM (environ):
- .long 0
- PUBLIC (_M68kSpuriousInterruptCount)
-SYM (_M68kSpuriousInterruptCount):
- .long 0
-END_DATA_DCL
-
-END
-
diff --git a/c/src/lib/libbsp/m68k/gen68340/start340/startfor340only.s b/c/src/lib/libbsp/m68k/gen68340/start340/startfor340only.s
deleted file mode 100644
index 930694f02e..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/start340/startfor340only.s
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
- * This file contains the entry point for the application.
- * The name of this entry point is compiler dependent.
- * It jumps to the BSP which is responsible for performing
- * all initialization.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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.
- *
- * Based on the `gen68360' board support package, and covered by the
- * original distribution terms.
- *
- * Geoffroy Montel
- * France Telecom - CNET/DSM/TAM/CAT
- * 4, rue du Clos Courtel
- * 35512 CESSON-SEVIGNE
- * FRANCE
- *
- * e-mail: g_montel@yahoo.com
- *
- * $Id$
- */
-
-#include "asm.h"
-#include <m68340.inc>
-
-BEGIN_CODE
- /*
- * Step 1: Decide on Reset Stack Pointer and Initial Program Counter
- */
-Entry:
- .long SYM(m340)+1024 | 0: Initial SSP
- .long start | 1: Initial PC
- .long SYM(_uhoh) | 2: Bus error
- .long SYM(_uhoh) | 3: Address error
- .long SYM(_uhoh) | 4: Illegal instruction
- .long SYM(_uhoh) | 5: Zero division
- .long SYM(_uhoh) | 6: CHK, CHK2 instruction
- .long SYM(_uhoh) | 7: TRAPcc, TRAPV instructions
- .long SYM(_uhoh) | 8: Privilege violation
- .long SYM(_uhoh) | 9: Trace
- .long SYM(_uhoh) | 10: Line 1010 emulator
- .long SYM(_uhoh) | 11: Line 1111 emulator
- .long SYM(_uhoh) | 12: Hardware breakpoint
- .long SYM(_uhoh) | 13: Reserved for coprocessor violation
- .long SYM(_uhoh) | 14: Format error
- .long SYM(_uhoh) | 15: Uninitialized interrupt
- .long SYM(_uhoh) | 16: Unassigned, reserved
- .long SYM(_uhoh) | 17:
- .long SYM(_uhoh) | 18:
- .long SYM(_uhoh) | 19:
- .long SYM(_uhoh) | 20:
- .long SYM(_uhoh) | 21:
- .long SYM(_uhoh) | 22:
- .long SYM(_uhoh) | 23:
- .long SYM(_spuriousInterrupt) | 24: Spurious interrupt
- .long SYM(_uhoh) | 25: Level 1 interrupt autovector
- .long SYM(_uhoh) | 26: Level 2 interrupt autovector
- .long SYM(_uhoh) | 27: Level 3 interrupt autovector
- .long SYM(_uhoh) | 28: Level 4 interrupt autovector
- .long SYM(_uhoh) | 29: Level 5 interrupt autovector
- .long SYM(_uhoh) | 30: Level 6 interrupt autovector
- .long SYM(_uhoh) | 31: Level 7 interrupt autovector
- .long SYM(_uhoh) | 32: Trap instruction (0-15)
- .long SYM(_uhoh) | 33:
- .long SYM(_uhoh) | 34:
- .long SYM(_uhoh) | 35:
- .long SYM(_uhoh) | 36:
- .long SYM(_uhoh) | 37:
- .long SYM(_uhoh) | 38:
- .long SYM(_uhoh) | 39:
- .long SYM(_uhoh) | 40:
- .long SYM(_uhoh) | 41:
- .long SYM(_uhoh) | 42:
- .long SYM(_uhoh) | 43:
- .long SYM(_uhoh) | 44:
- .long SYM(_uhoh) | 45:
- .long SYM(_uhoh) | 46:
- .long SYM(_uhoh) | 47:
- .long SYM(_uhoh) | 48: Reserved for coprocessor
- .long SYM(_uhoh) | 49:
- .long SYM(_uhoh) | 50:
- .long SYM(_uhoh) | 51:
- .long SYM(_uhoh) | 52:
- .long SYM(_uhoh) | 53:
- .long SYM(_uhoh) | 54:
- .long SYM(_uhoh) | 55:
- .long SYM(_uhoh) | 56:
- .long SYM(_uhoh) | 57:
- .long SYM(_uhoh) | 58:
- .long SYM(_uhoh) | 59: Unassigned, reserved
- .long SYM(_uhoh) | 60:
- .long SYM(_uhoh) | 61:
- .long SYM(_uhoh) | 62:
- .long SYM(_uhoh) | 63:
- .long SYM(_uhoh) | 64: User defined vectors (192)
- .long SYM(_uhoh) | 65:
- .long SYM(_uhoh) | 66:
- .long SYM(_uhoh) | 67:
- .long SYM(_uhoh) | 68:
- .long SYM(_uhoh) | 69:
- .long SYM(_uhoh) | 70:
- .long SYM(_uhoh) | 71:
- .long SYM(_uhoh) | 72:
- .long SYM(_uhoh) | 73:
- .long SYM(_uhoh) | 74:
- .long SYM(_uhoh) | 75:
- .long SYM(_uhoh) | 76:
- .long SYM(_uhoh) | 77:
- .long SYM(_uhoh) | 78:
- .long SYM(_uhoh) | 79:
- .long SYM(_uhoh) | 80:
- .long SYM(_uhoh) | 81:
- .long SYM(_uhoh) | 82:
- .long SYM(_uhoh) | 83:
- .long SYM(_uhoh) | 84:
- .long SYM(_uhoh) | 85:
- .long SYM(_uhoh) | 86:
- .long SYM(_uhoh) | 87:
- .long SYM(_uhoh) | 88:
- .long SYM(_uhoh) | 89:
- .long SYM(_uhoh) | 90:
- .long SYM(_uhoh) | 91:
- .long SYM(_uhoh) | 92:
- .long SYM(_uhoh) | 93:
- .long SYM(_uhoh) | 94:
- .long SYM(_uhoh) | 95:
- .long SYM(_uhoh) | 96:
- .long SYM(_uhoh) | 97:
- .long SYM(_uhoh) | 98:
- .long SYM(_uhoh) | 99:
- .long SYM(_uhoh) | 100:
- .long SYM(_uhoh) | 101:
- .long SYM(_uhoh) | 102:
- .long SYM(_uhoh) | 103:
- .long SYM(_uhoh) | 104:
- .long SYM(_uhoh) | 105:
- .long SYM(_uhoh) | 106:
- .long SYM(_uhoh) | 107:
- .long SYM(_uhoh) | 108:
- .long SYM(_uhoh) | 109:
- .long SYM(_uhoh) | 110:
- .long SYM(_uhoh) | 111:
- .long SYM(_uhoh) | 112:
- .long SYM(_uhoh) | 113:
- .long SYM(_uhoh) | 114:
- .long SYM(_uhoh) | 115:
- .long SYM(_uhoh) | 116:
- .long SYM(_uhoh) | 117:
- .long SYM(_uhoh) | 118:
- .long SYM(_uhoh) | 119:
- .long SYM(_uhoh) | 120:
- .long SYM(_uhoh) | 121:
- .long SYM(_uhoh) | 122:
- .long SYM(_uhoh) | 123:
- .long SYM(_uhoh) | 124:
- .long SYM(_uhoh) | 125:
- .long SYM(_uhoh) | 126:
- .long SYM(_uhoh) | 127:
- .long SYM(_uhoh) | 128:
- .long SYM(_uhoh) | 129:
- .long SYM(_uhoh) | 130:
- .long SYM(_uhoh) | 131:
- .long SYM(_uhoh) | 132:
- .long SYM(_uhoh) | 133:
- .long SYM(_uhoh) | 134:
- .long SYM(_uhoh) | 135:
- .long SYM(_uhoh) | 136:
- .long SYM(_uhoh) | 137:
- .long SYM(_uhoh) | 138:
- .long SYM(_uhoh) | 139:
- .long SYM(_uhoh) | 140:
- .long SYM(_uhoh) | 141:
- .long SYM(_uhoh) | 142:
- .long SYM(_uhoh) | 143:
- .long SYM(_uhoh) | 144:
- .long SYM(_uhoh) | 145:
- .long SYM(_uhoh) | 146:
- .long SYM(_uhoh) | 147:
- .long SYM(_uhoh) | 148:
- .long SYM(_uhoh) | 149:
- .long SYM(_uhoh) | 150:
- .long SYM(_uhoh) | 151:
- .long SYM(_uhoh) | 152:
- .long SYM(_uhoh) | 153:
- .long SYM(_uhoh) | 154:
- .long SYM(_uhoh) | 155:
- .long SYM(_uhoh) | 156:
- .long SYM(_uhoh) | 157:
- .long SYM(_uhoh) | 158:
- .long SYM(_uhoh) | 159:
- .long SYM(_uhoh) | 160:
- .long SYM(_uhoh) | 161:
- .long SYM(_uhoh) | 162:
- .long SYM(_uhoh) | 163:
- .long SYM(_uhoh) | 164:
- .long SYM(_uhoh) | 165:
- .long SYM(_uhoh) | 166:
- .long SYM(_uhoh) | 167:
- .long SYM(_uhoh) | 168:
- .long SYM(_uhoh) | 169:
- .long SYM(_uhoh) | 170:
- .long SYM(_uhoh) | 171:
- .long SYM(_uhoh) | 172:
- .long SYM(_uhoh) | 173:
- .long SYM(_uhoh) | 174:
- .long SYM(_uhoh) | 175:
- .long SYM(_uhoh) | 176:
- .long SYM(_uhoh) | 177:
- .long SYM(_uhoh) | 178:
- .long SYM(_uhoh) | 179:
- .long SYM(_uhoh) | 180:
- .long SYM(_uhoh) | 181:
- .long SYM(_uhoh) | 182:
- .long SYM(_uhoh) | 183:
- .long SYM(_uhoh) | 184:
- .long SYM(_uhoh) | 185:
- .long SYM(_uhoh) | 186:
- .long SYM(_uhoh) | 187:
- .long SYM(_uhoh) | 188:
- .long SYM(_uhoh) | 189:
- .long SYM(_uhoh) | 190:
- .long SYM(_uhoh) | 191:
- .long SYM(_uhoh) | 192:
- .long SYM(_uhoh) | 193:
- .long SYM(_uhoh) | 194:
- .long SYM(_uhoh) | 195:
- .long SYM(_uhoh) | 196:
- .long SYM(_uhoh) | 197:
- .long SYM(_uhoh) | 198:
- .long SYM(_uhoh) | 199:
- .long SYM(_uhoh) | 200:
- .long SYM(_uhoh) | 201:
- .long SYM(_uhoh) | 202:
- .long SYM(_uhoh) | 203:
- .long SYM(_uhoh) | 204:
- .long SYM(_uhoh) | 205:
- .long SYM(_uhoh) | 206:
- .long SYM(_uhoh) | 207:
- .long SYM(_uhoh) | 208:
- .long SYM(_uhoh) | 209:
- .long SYM(_uhoh) | 210:
- .long SYM(_uhoh) | 211:
- .long SYM(_uhoh) | 212:
- .long SYM(_uhoh) | 213:
- .long SYM(_uhoh) | 214:
- .long SYM(_uhoh) | 215:
- .long SYM(_uhoh) | 216:
- .long SYM(_uhoh) | 217:
- .long SYM(_uhoh) | 218:
- .long SYM(_uhoh) | 219:
- .long SYM(_uhoh) | 220:
- .long SYM(_uhoh) | 221:
- .long SYM(_uhoh) | 222:
- .long SYM(_uhoh) | 223:
- .long SYM(_uhoh) | 224:
- .long SYM(_uhoh) | 225:
- .long SYM(_uhoh) | 226:
- .long SYM(_uhoh) | 227:
- .long SYM(_uhoh) | 228:
- .long SYM(_uhoh) | 229:
- .long SYM(_uhoh) | 230:
- .long SYM(_uhoh) | 231:
- .long SYM(_uhoh) | 232:
- .long SYM(_uhoh) | 233:
- .long SYM(_uhoh) | 234:
- .long SYM(_uhoh) | 235:
- .long SYM(_uhoh) | 236:
- .long SYM(_uhoh) | 237:
- .long SYM(_uhoh) | 238:
- .long SYM(_uhoh) | 239:
- .long SYM(_uhoh) | 240:
- .long SYM(_uhoh) | 241:
- .long SYM(_uhoh) | 242:
- .long SYM(_uhoh) | 243:
- .long SYM(_uhoh) | 244:
- .long SYM(_uhoh) | 245:
- .long SYM(_uhoh) | 246:
- .long SYM(_uhoh) | 247:
- .long SYM(_uhoh) | 248:
- .long SYM(_uhoh) | 249:
- .long SYM(_uhoh) | 250:
- .long SYM(_uhoh) | 251:
- .long SYM(_uhoh) | 252:
- .long SYM(_uhoh) | 253:
- .long SYM(_uhoh) | 254:
- .long SYM(_uhoh) | 255:
-
-/*
- * Default trap handler
- * With an oscilloscope you can see AS* stop
- */
- PUBLIC (_uhoh)
-SYM(_uhoh): nop | Leave spot for breakpoint
- stop #0x2700 | Stop with interrupts disabled
- bra.s SYM(_uhoh) | Stuck forever
-
-/*
- * Log, but otherwise ignore, spurious interrupts
- */
- PUBLIC (_spuriousInterrupt)
-SYM(_spuriousInterrupt):
- addql #1,SYM(_M68kSpuriousInterruptCount)
- rte
-
-/*
- * Place the low-order 3 octets of the board's ethernet address at
- * a `well-known' fixed location relative to the startup location.
- */
- .align 2
- .word 0 | Padding
-ethernet_address_buffer:
- .word 0x08F3 | Default address
- .word 0xDEAD
- .word 0xCAFE
-
-/* -- equates -- */
-.equ _PROM_Start, 0x01000000 /* CS0 */
-.equ _BCCram_Start, 0x00000000 /* CS1 */
-.equ _FLEX_Start, 0x08000000 /* CS2 */
-.equ _I2C_Start, 0x02000000 /* CS3 */
-.equ _EXTram_Start, 0x10000000 /* CS4 */
-.equ _EXTram_Size, 0x000400000 /* 4 Mbytes */
-.equ _SPEED, 0xD780 /* 25 Mhz CPU349 */
-/* .equ _SPEED, 0xD700 25 Mhz */
-/* .equ _SPEED, 0xCE00 16 Mhz */
-
-BEGIN_DATA
-
-_crt0_init_stack:
- ds.l 0x1000
-_crt0_init_stktop:
-
-
-BEGIN_CODE
- dc.l _crt0_init_stktop /* reset SP */
- dc.l _crt0_cold_start /* reset PC */
- dc.l _crt0_warm_start
-
- .ascii "RTEMS"
- dc.w 0
-
-.align 2
-
-_table_cs:
- /* carte Astecc - 68340 */
- dc.l 0x003FFFF0 /* Mask CS0 (4Mbytes PROM, 32bits, 0WS) */
-/* dc.l 0x003FFFFD Mask CS0 (4Mbytes PROM, 16bits, 3WS) */
- dc.l ((_PROM_Start&0xFFFFFF00)+0x00000003) /* Base CS0 */
-/* dc.l 0x0000FFF1 MASK CS1 (RAMBCC340, 0WS, FTE) */
- dc.l 0x0000FFFD /* MASK CS1 (RAMBCC340, 0WS, FTE) */
-/* dc.l ((_BCCram_Start&0xFFFFFF00)+0x00000007) Base CS1 */
- dc.l ((_BCCram_Start&0xFFFFFF00)+0x00000003) /* Base CS1 */
- dc.l 0x000000FF /* MASK CS2 (FLEX, ext DTACK, 256 bytes) */
- dc.l ((_FLEX_Start&0xFFFFFF00)+0x00000003) /* Base CS2 */
- dc.l 0x000000FF /* Mask CS3 (I2C, ext DTACK, 256 bytes) */
- dc.l ((_I2C_Start&0xFFFFFF00)+0x00000003) /* Base CS3 */
-
-/*
- * Initial PC
- */
-.globl start
-start:
-
-_crt0_cold_start:
- moveq.l #0,d0 /* signal cold reset */
- bra.s _crt0_common_start
-
-_crt0_warm_start:
- moveq.l #1,d0 /* signal warm reset */
-
-_crt0_common_start:
- move.w #0x2700,sr /* disable interrupts and switch to interrupt mode */
- movea.l #_crt0_init_stktop,sp /* set up initialization stack */
-
- lea Entry,a0 /* Get base of vector table */
- movec a0,vbr /* Set up the VBR */
-
- moveq.l #0x07,d1
- movec.l d1,dfc /* prepare access in CPU space */
- move.l #(BASE_SIM+1),d1
- moves.l d1,BASE_REG /* base initialization (must be MOVES, PCC-130795) */
- moveq.l #0x05,d1
- movec.l d1,dfc
-
- movea.l #BASE_SIM,a0
-
- /* -- disable Bus Monitor -- */
- move.b #0,SIM_SYPCR(a0) /* system protection control register */
-
- /* -- set frequency to 25.16 Mhz -- */
- move.w #_SPEED,SIM_SYNCR(a0) /* clock */
-
-sync_wait:
- btst.b #3,(SIM_SYNCR+1)(a0)
- beq sync_wait
-
- /* -- enable A31-A24 -- */
- clr.b SIM_PPRA1(a0)
-
- /* -- show cycles, user acces to SIM, 4 /CS & 4 /IT -- */
- move.w #0x427F,SIM_MCR(a0)
-
- /* -- chip select initialization -- */
- lea.l SIM_MASKH0(a0),a2
- lea.l _table_cs(%pc),a1
-
- moveq.l #0x07,d1
-
-_b_cs:
- move.l (a1)+, (a2)+
- dbra d1,_b_cs
-
- /* fill RAM if COLDSTART */
- tst.l d0
- bne _dont_fill
-
- movea.l #_EXTram_Start,a0 /* get start */
- move.l #_EXTram_Size,d1 /* get size */
- lsr.l #2,d1 /* ajust for long word */
-
-_fill_loop:
- clr.l (a0)+
- subq.l #1,d1
- bne _fill_loop
-
-_dont_fill:
- jmp SYM(_Init68340) | Start C code (which never returns)
-
-/*
- * Copy DATA segment, clear BSS segment, set up real stack,
- * initialize heap, start C program.
- * Assume that DATA and BSS sizes are multiples of 4.
- */
- PUBLIC (_CopyDataClearBSSAndStart)
-SYM(_CopyDataClearBSSAndStart):
- lea copy_start,a0 | Get start of DATA in RAM
- lea SYM(etext),a2 | Get start of DATA in ROM
- cmpl a0,a2 | Are they the same?
- beq.s NOCOPY | Yes, no copy necessary
- lea copy_end,a1 | Get end of DATA in RAM
- bra.s COPYLOOPTEST | Branch into copy loop
-COPYLOOP:
- movel a2@+,a0@+ | Copy word from ROM to RAM
-COPYLOOPTEST:
- cmpl a1,a0 | Done?
- bcs.s COPYLOOP | No, skip
-NOCOPY:
-
- lea clear_start,a0 | Get start of BSS
- lea clear_end,a1 | Get end of BSS
- clrl d0 | Value to set
- bra.s ZEROLOOPTEST | Branch into clear loop
-ZEROLOOP:
- movel d0,a0@+ | Clear a word
-ZEROLOOPTEST:
- cmpl a1,a0 | Done?
- bcs.s ZEROLOOP | No, skip
-
- movel #stack_init,a7 | set master stack pointer
- movel d0,a7@- | environp
- movel d0,a7@- | argv
- movel d0,a7@- | argc
- jsr SYM(boot_card) | Call C main
-
- PUBLIC (_mainDone)
-SYM(_mainDone):
- nop | Leave spot for breakpoint
- movew #1,a7 | Force a double bus error
- movel d0,a7@- | This should cause a RESET
- stop #0x2700 | Stop with interrupts disabled
- bra.s SYM(_mainDone) | Stuck forever
-
- .align 2
- PUBLIC (_HeapSize)
-SYM (_HeapSize):
- .long HeapSize
- PUBLIC (_StackSize)
-SYM (_StackSize):
- .long StackSize
-END_CODE
-
-BEGIN_DATA_DCL
- .align 2
- PUBLIC (environ)
-SYM (environ):
- .long 0
- PUBLIC (_M68kSpuriousInterruptCount)
-SYM (_M68kSpuriousInterruptCount):
- .long 0
-END_DATA_DCL
-
-END
-
diff --git a/c/src/lib/libbsp/m68k/gen68340/startup/Makefile.in b/c/src/lib/libbsp/m68k/gen68340/startup/Makefile.in
deleted file mode 100644
index c2e43aab72..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/startup/Makefile.in
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart init68340 main sbrk setvec dumpanic
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(srcdir)/linkcmds \
- $(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-
diff --git a/c/src/lib/libbsp/m68k/gen68340/startup/bspclean.c b/c/src/lib/libbsp/m68k/gen68340/startup/bspclean.c
deleted file mode 100644
index 66f6531b84..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/startup/bspclean.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine normally is part of start.s and usually returns
- * control to a monitor.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-void bsp_cleanup( void )
-{
- /* Cause double bus fault to force reset? */
-}
diff --git a/c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c b/c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c
deleted file mode 100644
index cb8945a5fc..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/* bsp_start()
- *
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/* Initialize whatever libc we are using
- * called from postdriver hook
- */
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern void *_HeapStart;
- extern rtems_unsigned32 _HeapSize;
-
- bsp_libc_init(&_HeapStart, _HeapSize, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- extern void *_WorkspaceBase;
-
- /*
- * Allocate the memory for the RTEMS Work Space. This can come from
- * a variety of places: hard coded address, malloc'ed from outside
- * RTEMS world (e.g. simulator or primitive memory manager), or (as
- * typically done by stock BSPs) by subtracting the required amount
- * of work space from the last physical address on the CPU board.
- */
-#if 0
- Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/;
-#endif
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
-
- BSP_Configuration.work_space_start = (void *)&_WorkspaceBase;
-
- /*
- * Account for the console's resources
- */
-
- console_reserve_resources( &BSP_Configuration );
-
- /*
- * initialize the CPU table for this BSP
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.do_zero_of_workspace = TRUE;
- Cpu_table.interrupt_stack_size = 4096;
-}
diff --git a/c/src/lib/libbsp/m68k/gen68340/startup/dumpanic.c b/c/src/lib/libbsp/m68k/gen68340/startup/dumpanic.c
deleted file mode 100644
index 8323b533df..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/startup/dumpanic.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * M68340/349 registers and stack dump if an exception is raised
- *
- * Author:
- * Pascal Cadic
- * France Telecom - CNET/DSM/TAM/CAT
- * 4, rue du Clos Courtel
- * 35512 CESSON-SEVIGNE
- * FRANCE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- *
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdio.h>
-
-const char *exceptionName[] =
- {
- "INITIAL STACK POINTER",
- "INITIAL PROGRAM COUNTER",
- "BUS ERROR",
- "ADDRESS ERROR",
- "ILLEGAL INSTRUCTION",
- "DIVISION BY ZERO",
- "CHK, CHK2",
- "TRAPcc, TRAPv",
- "PRIVILEGE VIOLATION",
- "TRACE",
- "LINE A EMULATOR",
- "LINE F EMULATOR",
- "HARDWARE BREAK",
- "COPROCESSOR PROTOCOL VIOLATION",
- "FORMAT ERROR",
- "UNINITIALIZED INTERRUPT",
- "RESERVED 16",
- "RESERVED 17",
- "RESERVED 18",
- "RESERVED 19",
- "RESERVED 20",
- "RESERVED 21",
- "RESERVED 22",
- "RESERVED 23",
- "SPURIOUS INTERRUPT",
- "LEVEL 1 AUTOVECTOR",
- "LEVEL 2 AUTOVECTOR",
- "LEVEL 3 AUTOVECTOR",
- "LEVEL 4 AUTOVECTOR",
- "LEVEL 5 AUTOVECTOR",
- "LEVEL 6 AUTOVECTOR",
- "LEVEL 7 AUTOVECTOR",
- "TRAP 1",
- "TRAP 2",
- "TRAP 3",
- "TRAP 4",
- "TRAP 5",
- "TRAP 6",
- "TRAP 7",
- "TRAP 8",
- "TRAP 9",
- "TRAP 10",
- "TRAP 11",
- "TRAP 12",
- "TRAP 13",
- "TRAP 14",
- "TRAP 15",
- "VECTOR 48",
- "VECTOR 49",
- "VECTOR 50",
- "VECTOR 51",
- "VECTOR 52",
- "VECTOR 53",
- "VECTOR 54",
- "VECTOR 55",
- "VECTOR 56",
- "VECTOR 57",
- "VECTOR 58",
- "VECTOR 59",
- "VECTOR 60",
- "VECTOR 61",
- "VECTOR 62",
- "VECTOR 63",
- };
-
-typedef struct {
- unsigned long pc;
- unsigned short sr;
- unsigned short format_id;
- unsigned long d0, d1, d2, d3, d4, d5, d6, d7;
- unsigned long a0, a1, a2, a3, a4, a5, a6, a7;
- unsigned long sfc, dfc, vbr;
-} boot_panic_registers_t;
-
-boot_panic_registers_t _boot_panic_registers;
-
-extern void RAW_FMT( int minor, const char* fmt, ... );
-extern char RAW_GETC(int minor);
-
-/******************************************************
- Name: _dbug_dump
- Input parameters: sr, pc, stack pointer,
- size to display
- Output parameters: -
- Description: display the supervisor stack
- *****************************************************/
-void _dbug_dump(unsigned short sr, void* pc, unsigned short *stack, int size)
-{
-int i;
-
- RAW_FMT(0,"%x : %x \t%x",0,sr,(unsigned short)(((unsigned)pc)>>16));
- for (i=2; i<size; i++) {
- if ((i%8)==0) RAW_FMT(0,"\n%x :",i/8);
- RAW_FMT(0," %x\t",stack[i-2]);
- }
- RAW_FMT(0,"\n");
-}
-
-/******************************************************
- Name: _dbug_dump
- Input parameters: -
- Output parameters: -
- Description: display microcontroler state. Registers
- values are stored in _boot_panic_registers
- which is filled in _uhoh ASM routine
- *****************************************************/
-void _dbug_dumpanic(void)
-{
- int c;
- void *faultedAddr, *pc;
- unsigned short vector, status;
- unsigned char frametype, *stack;
- #define ESCAPE 27
-
- stack = (unsigned char*)(_boot_panic_registers.a7);
- do {
- status = _boot_panic_registers.sr;
- pc = (void*)_boot_panic_registers.pc;
- faultedAddr = *(void**)(stack+4);
- vector = (_boot_panic_registers.format_id&0x0FFF)>>2;
- frametype = (_boot_panic_registers.format_id&0xF000)>>12;
-
- RAW_FMT(0,"\n---------------------------------------------\n");
- if (vector<64)
- RAW_FMT(0,"%s",exceptionName[vector]);
- else {
- RAW_FMT(0,"RESERVED USER");
- }
- RAW_FMT(0," exception (vector %x, type %x)\n",vector,frametype);
- RAW_FMT(0,"---------------------------------------------\n");
- RAW_FMT(0,"PC : 0x%x ",pc);
- RAW_FMT(0,"A7 : 0x%x ",_boot_panic_registers.a7);
- RAW_FMT(0,"SR : 0x%x\n",status);
- if (frametype==0x0c) {
- RAW_FMT(0,"\nfaulted address = 0x%x\n",faultedAddr);
- }
- RAW_FMT(0,"---------------------------------------------\n");
- RAW_FMT(0," panic regs\n");
- RAW_FMT(0,"---------------------------------------------\n");
- RAW_FMT(0,"D[0..3] : %x \t%x \t%x \t%x\n",
- _boot_panic_registers.d0,_boot_panic_registers.d1,
- _boot_panic_registers.d2,_boot_panic_registers.d3);
- RAW_FMT(0,"D[4..7] : %x \t%x \t%x \t%x\n",
- _boot_panic_registers.d4,_boot_panic_registers.d5,
- _boot_panic_registers.d6,_boot_panic_registers.d7);
- RAW_FMT(0,"A[0..3] : %x \t%x \t%x \t%x\n",
- _boot_panic_registers.a0,_boot_panic_registers.a1,
- _boot_panic_registers.a2,_boot_panic_registers.a3);
- RAW_FMT(0,"A[4..7] : %x \t%x \t%x \t%x\n",
- _boot_panic_registers.a4,_boot_panic_registers.a5,
- _boot_panic_registers.a6,_boot_panic_registers.a7);
-
- RAW_FMT(0," SFC : %x",_boot_panic_registers.sfc);
- RAW_FMT(0," DFC : %x\n",_boot_panic_registers.dfc);
- RAW_FMT(0," VBR : %x\n",_boot_panic_registers.vbr);
- RAW_FMT(0,"---------------------------------------------\n");
- RAW_FMT(0," panic stack\n");
- RAW_FMT(0,"---------------------------------------------\n");
- _dbug_dump(status, pc, (unsigned short*)stack,64*2);
-
- RAW_FMT(0,"---------------------------------------------\n");
- RAW_FMT(0,"press escape to reboot\n");
- } while ((c=RAW_GETC(0))!=ESCAPE); /* cgets ne marche pas si les IT sont bloquées */
-}
-
-
-
diff --git a/c/src/lib/libbsp/m68k/gen68340/startup/init68340.c b/c/src/lib/libbsp/m68k/gen68340/startup/init68340.c
deleted file mode 100644
index 96caf9e585..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/startup/init68340.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * MC68340/349 support routines
- *
- * Geoffroy Montel
- * France Telecom - CNET/DSM/TAM/CAT
- * 4, rue du Clos Courtel
- * 35512 CESSON-SEVIGNE
- * FRANCE
- *
- * e-mail: g_montel@yahoo.com
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-
-/*
- * Initialize MC68340
- */
-void _Init68340 (void)
-{
- extern void _CopyDataClearBSSAndStart (void);
- m68k_isr_entry *vbr;
- int i;
-
- /*
- * Copy the exception vector table to system RAM
- */
- m68k_get_vbr (vbr);
- for (i = 0; i < 256; ++i)
- M68Kvec[i] = vbr[i];
- m68k_set_vbr (M68Kvec);
-
- /*
- * Copy data, clear BSS, switch stacks and call main()
- */
- _CopyDataClearBSSAndStart ();
-}
diff --git a/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds b/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds
deleted file mode 100644
index 4dbfa37084..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * This file contains GNU linker directives for a generic MC68340/349 board.
- * Variations in hardware type and dynamic memory size can be made
- * by overriding some values with linker command-line arguments.
- *
- * ATTENTION: RAM and ROM placement must accord those in start340.S!!
- * (next time I'll use some shared variables :) )
- *
- * Geoffroy Montel
- * France Telecom - CNET/DSM/TAM/CAT
- * 4, rue du Clos Courtel
- * 35512 CESSON-SEVIGNE
- * FRANCE
- *
- * e-mail: g_montel@yahoo.com
- *
- * $Id$
- */
-
-/*
- * a.out format doesn't handle prom images very well
- */
-OUTPUT_FORMAT(coff-m68k)
-
-/*
- * Declare some sizes.
- * XXX: The assignment of ". += XyzSize;" fails in older gld's if the
- * number used there is not constant. If this happens to you, edit
- * the lines marked XXX below to use a constant value.
- */
-RamSize = DEFINED(RamSize) ? RamSize : 4M;
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
-
-/*
- * Declare on-board memory.
- * It would be nice if the ram length could be given as
- * LENGTH=RamSize, but gld doesn't allow non-constant
- * values in the LENGTH expression.
- */
-MEMORY {
- ram : ORIGIN = 0x10000000, LENGTH = 4M
- rom : ORIGIN = 0x01000000, LENGTH = 4M
-/* dpram : ORIGIN = 0xFE000000, LENGTH = 8k */
-}
-
-/*
- * Declare low-order three octets of Ethernet address.
- */
-ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;
-
-/*
- * Load objects
- */
-SECTIONS {
- /*
- * Hardware variations
- */
- _RamSize = RamSize;
- __RamSize = RamSize;
-
- /*
- * Boot PROM
- */
- rom : {
- _RomBase = .;
- __RomBase = .;
- } >rom
-
- /*
- * Dynamic RAM
- */
- ram : {
- _RamBase = .;
- __RamBase = .;
- } >ram
-
- /*
- * Text, data and bss segments
- */
- .text : {
- CREATE_OBJECT_SYMBOLS
- *(.text)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
-
- etext = .;
- _etext = .;
- } >rom
-
- .eh_fram : {
- . = ALIGN (16);
- *(.eh_fram)
- } >ram
-
- .gcc_exc : {
- . = ALIGN (16);
- *(.gcc_exc)
- } >ram
-
- /*
- * On-chip memory/peripherals
- *
- */
- dpram : {
- m340 = .;
- _m340 = .;
- . += (8 * 1024);
- } >ram
-
- .data : {
- copy_start = .;
- *(.data)
- . = ALIGN (16);
- _edata = .;
- copy_end = .;
- } >ram
-
- .bss : {
- M68Kvec = .;
- _M68Kvec = .;
- . += (256 * 4);
- clear_start = .;
- *(.bss)
- *(COMMON)
- . = ALIGN (16);
- _end = .;
-
- _HeapStart = .;
- __HeapStart = .;
- . += HeapSize; /* XXX -- Old gld can't handle this */
- . += StackSize; /* XXX -- Old gld can't handle this */
- /* . += 0x10000; */ /* HeapSize for old gld */
- /* . += 0x1000; */ /* StackSize for old gld */
- . = ALIGN (16);
- stack_init = .;
- clear_end = .;
-
- _WorkspaceBase = .;
- __WorkspaceBase = .;
- } >ram
-}
diff --git a/c/src/lib/libbsp/m68k/gen68340/timer/Makefile.in b/c/src/lib/libbsp/m68k/gen68340/timer/Makefile.in
deleted file mode 100644
index d9e6e84a0c..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/timer/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/gen68340/timer/timer.c b/c/src/lib/libbsp/m68k/gen68340/timer/timer.c
deleted file mode 100644
index a6baa5d003..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/timer/timer.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Timer_init()
- *
- * ATTENTION: AS MC68349 has no built-in Timer, the following code doesn't work
- * in a MC68349. You can't use FIFO full mode for the moment, but
- * it should be easy to fix this by using an external timer
- *
- * Use TIMER 1 for TIMEOUT when using FIFO FULL mode in UART driver
- * Use TIMER 2 for timing test suites
- *
- * Geoffroy Montel
- * France Telecom - CNET/DSM/TAM/CAT
- * 4, rue du Clos Courtel
- * 35512 CESSON-SEVIGNE
- * FRANCE
- *
- * e-mail: g_montel@yahoo.com
- *
- * $Id$
- */
-
-/*
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <m340uart.h>
-#include <m340timer.h>
-#include <m68340.h>
-
-#define TIMER1_VECTOR 122
-#define TIMER1_IRQ_LEVEL 5
-#define TIMER1_INTERRUPT_ARBITRATION 5
-
-#define TIMER2_VECTOR 123
-#define TIMER2_IRQ_LEVEL 4
-#define TIMER2_INTERRUPT_ARBITRATION 4
-
-#define CLOCK_SPEED 25 /* in Mhz */
-
-#define max(a,b) (((a)>(b)) ? (a) : (b))
-
-void (*Restart_Fifo_Full_A_Timer)();
-void (*Restart_Check_A_Timer)();
-void (*Restart_Fifo_Full_B_Timer)();
-void (*Restart_Check_B_Timer)();
-
-int preload = 0;
-
-/******************************************************
- Name: __Restart_Fifo_Full_Timer
- Input parameters: -
- Output parameters: -
- Description: when a character is received, sets
- the TIMER to raise an interrupt at
- TIMEOUT.
- It's necessary to prevent from not
- getting n-1 characters (with n the
- Uart Fifo size)
- *****************************************************/
-void __Restart_Fifo_Full_Timer (void)
-{
- TSR1 |= m340_TO;
- TCR1 &= ~m340_CPE;
- WPREL11 = preload;
- TCR1 |= m340_CPE;
-}
-
-/******************************************************
- Name: __Restart_Fifo_Full_Timer
- Input parameters: -
- Output parameters: -
- Description: when no character has been received
- recently, check now and then if whether
- a there's a character in the FIFO
- *****************************************************/
-void __Restart_Check_Timer (void)
-{
- TSR1 |= m340_TO;
- TCR1 &= ~m340_CPE;
- WPREL11 = 0xFFFF;
- TCR1 |= m340_CPE;
-}
-
-/******************************************************
- Name: __do_nothing
- Input parameters: -
- Output parameters: -
- Description: we always restart the fifo full timer
- with a call to Restart_*_Timer
- if we do not use FIFO full, Restart_*_Timer
- are set to do __do_nothing
- *****************************************************/
-void __do_nothing (void)
-{
-}
-
-#define Fifo_Full_on_A (m340_uart_config[UART_CHANNEL_A].rx_mode==UART_FIFO_FULL && m340_uart_config[UART_CHANNEL_A].enable && m340_uart_config[UART_CHANNEL_A].mode==UART_INTERRUPTS)
-#define Fifo_Full_on_B (m340_uart_config[UART_CHANNEL_B].rx_mode==UART_FIFO_FULL && m340_uart_config[UART_CHANNEL_B].enable && m340_uart_config[UART_CHANNEL_B].mode==UART_INTERRUPTS)
-
-/******************************************************
- Name: Fifo_Full_Timer_initialize
- Input parameters: -
- Output parameters: -
- Description: initialize Timer 1 for FIFO full mode
- *****************************************************/
-void Fifo_Full_Timer_initialize (void)
-{
- float max_baud_rate;
- int prescaler_output_tap = -1;
- int nb_of_clock_ticks = 0;
-
- /*
- * USE TIMER 1 for UART FIFO FULL mode
- */
-
- if ( Fifo_Full_on_A || Fifo_Full_on_B )
- {
- /* Disable the timer */
- TCR1 &= ~m340_SWR;
-
- /* Reset the interrupts */
- TSR1 &= ~(m340_TO | m340_TG | m340_TC);
-
- /* Init the stop bit for normal operation, ignore FREEZE, user privileges,
- set interrupt arbitration */
- TMCR1 = TIMER1_INTERRUPT_ARBITRATION;
-
- /* interrupt priority level and interrupt vector */
- TIR1 = TIMER1_VECTOR | (TIMER1_IRQ_LEVEL << 8);
-
- /* compute prescaler */
- if ( Fifo_Full_on_A && Fifo_Full_on_B)
- max_baud_rate = max(m340_uart_config[UART_CHANNEL_A].rx_baudrate, m340_uart_config[UART_CHANNEL_B].rx_baudrate);
- else if ( Fifo_Full_on_A )
- max_baud_rate = m340_uart_config[UART_CHANNEL_A].rx_baudrate;
- else max_baud_rate = m340_uart_config[UART_CHANNEL_B].rx_baudrate;
-
- /* find out config */
- nb_of_clock_ticks = (10/max_baud_rate)*(CLOCK_SPEED*1000000)*1.2;
- if (nb_of_clock_ticks < 0xFFFF) {
- preload = nb_of_clock_ticks;
- prescaler_output_tap = -1;
- } else if (nb_of_clock_ticks/2 < 0xFFFF) {
- preload = nb_of_clock_ticks/2;
- prescaler_output_tap = m340_Divide_by_2;
- } else if (nb_of_clock_ticks/4 < 0xFFFF) {
- preload = nb_of_clock_ticks/4;
- prescaler_output_tap = m340_Divide_by_4;
- } else if (nb_of_clock_ticks/8 < 0xFFFF) {
- preload = nb_of_clock_ticks/8;
- prescaler_output_tap = m340_Divide_by_16;
- } else if (nb_of_clock_ticks/16 < 0xFFFF) {
- preload = nb_of_clock_ticks/16;
- prescaler_output_tap = m340_Divide_by_16;
- } else if (nb_of_clock_ticks/32 < 0xFFFF) {
- preload = nb_of_clock_ticks/32;
- prescaler_output_tap = m340_Divide_by_32;
- } else if (nb_of_clock_ticks/64 < 0xFFFF) {
- preload = nb_of_clock_ticks/64;
- prescaler_output_tap = m340_Divide_by_64;
- } else if (nb_of_clock_ticks/128 < 0xFFFF) {
- preload = nb_of_clock_ticks/128;
- prescaler_output_tap = m340_Divide_by_128;
- } else if (nb_of_clock_ticks/256 < 0xFFFF) {
- preload = nb_of_clock_ticks/256;
- prescaler_output_tap = m340_Divide_by_256;
- }
-
- /* Input Capture/Output Compare (ICOC) */
- TCR1 = m340_SWR | m340_TO_Enabled | m340_ICOC;
- if (prescaler_output_tap!=-1) TCR1 |= prescaler_output_tap | m340_PSE;
-
- /* install interrupt vector */
- {
- rtems_isr_entry old_handler;
- rtems_status_code sc;
-
- extern void _Debug_ISR_Handler_Console(void);
-
- sc = rtems_interrupt_catch (InterruptHandler,
- TIMER1_VECTOR,
- &old_handler);
-
- /* uncomment this if you want to pass control to your own ISR handler
- it may be usefull to do so to check for performances with an oscilloscope */
- /*
- {
- proc_ptr ignored;
- _CPU_ISR_install_raw_handler( TIMER1_VECTOR, _Debug_ISR_Handler_Console, &ignored );
- }
- */
- }
- } /* fifo full mode on a uart */
-
- /* install routines */
- Restart_Check_A_Timer = Fifo_Full_on_A ? __Restart_Check_Timer : __do_nothing;
- Restart_Fifo_Full_A_Timer = Fifo_Full_on_A ? __Restart_Fifo_Full_Timer : __do_nothing;
- Restart_Check_B_Timer = Fifo_Full_on_B ? __Restart_Check_Timer : __do_nothing;
- Restart_Fifo_Full_B_Timer = Fifo_Full_on_B ? __Restart_Fifo_Full_Timer : __do_nothing;
- /* start checking timer */
- Restart_Check_A_Timer();
- Restart_Check_B_Timer();
-}
-
-/******************************************************
- Name: Timer_initialize
- Input parameters: -
- Output parameters: -
- Description: init Timer for timing test suites
- *****************************************************/
-void Timer_initialize (void)
-{
- /* Disable the timer */
- TCR2 &= ~m340_SWR;
-
- /* Reset the interrupts */
- TSR2 &= ~(m340_TO | m340_TG | m340_TC);
-
- /* Init the stop bit for normal operation, ignore FREEZE, user privileges,
- set interrupt arbitration */
- TMCR1 = TIMER2_INTERRUPT_ARBITRATION;
-
- /* interrupt priority level and interrupt vector */
- TIR1 = TIMER2_VECTOR | (TIMER2_IRQ_LEVEL << 8);
-
- /* Init the stop bit for normal operation, ignore FREEZE, user privileges,
- set interrupt arbitration */
- TMCR2 = TIMER2_INTERRUPT_ARBITRATION;
-
- /* Preload register 1 */
- WPREL21 = 0xFFFF;
-
- /* Input Capture/Output Compare (ICOC) */
- TCR2 = m340_SWR | m340_ICOC | m340_PSE | m340_Divide_by_16 | m340_CPE;
-}
-
-/******************************************************
- Name: Read_timer
- Input parameters: -
- Output parameters: -
- Description: Return timer value in microsecond units
- *****************************************************/
-int
-Read_timer (void)
-{
- /* there's CLOCK_SPEED / 16 micro seconds between two timer register decrement */
- return (((0xFFFF - TCNTR2) * CLOCK_SPEED) / 16);
-}
-
-/******************************************************
- Name: Empty_function
- Input parameters: -
- Output parameters: -
- Description: Empty function call used in loops to
- measure basic cost of looping
- in Timing Test Suite.
- *****************************************************/
-rtems_status_code
-Empty_function (void)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/******************************************************
- Name: Set_find_average_overhead
- Input parameters: -
- Output parameters: -
- Description: -
- *****************************************************/
-void
-Set_find_average_overhead(rtems_boolean find_flag)
-{
-}
diff --git a/c/src/lib/libbsp/m68k/gen68340/wrapup/Makefile.in b/c/src/lib/libbsp/m68k/gen68340/wrapup/Makefile.in
deleted file mode 100644
index f519cb6db7..0000000000
--- a/c/src/lib/libbsp/m68k/gen68340/wrapup/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console timer
-CPU_PIECES=
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(CPU_PIECES), \
- ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(piece).rel) \
- $(wildcard \
- ../../../../libcpu/$(RTEMS_CPU)/$(RTEMS_CPU_MODEL)/fpsp/$(ARCH)/fpsp.rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/m68k/gen68360/Makefile.in b/c/src/lib/libbsp/m68k/gen68360/Makefile.in
deleted file mode 100644
index b06c1fc69c..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/Makefile.in
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SRCS=README
-
-# We only build the networking device driver if HAS_NETWORKING was defined
-NETWORKING_DRIVER_yes_V = network
-NETWORKING_DRIVER = $(NETWORKING_DRIVER_$(HAS_NETWORKING)_V)
-
-all: $(SRCS)
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include start360 startup clock console timer \
- $(NETWORKING_DRIVER) wrapup
diff --git a/c/src/lib/libbsp/m68k/gen68360/README b/c/src/lib/libbsp/m68k/gen68360/README
deleted file mode 100644
index 7938e70895..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/README
+++ /dev/null
@@ -1,301 +0,0 @@
-#
-# $Id$
-#
-
-#
-# This package requires a version of GCC that supports the `-mcpu32' option.
-#
-
-#
-# Please send any comments, improvements, or bug reports to:
-# W. Eric Norum
-# Saskatchewan Accelerator Laboratory
-# 107 North Road
-# University of Saskatchewan
-# Saskatoon, Saskatchewan, CANADA
-# S7N 5C6
-# eric@skatter.usask.ca
-#
-
-#
-# This board support package works with several different versions of
-# MC68360 systems. See the conditional-compile tests in startup/init68360.c
-# for examples.
-#
-# Decisions made at compile time include:
-# - If the CPU is a member of the 68040 family, the BSP is
-# compiled for a generic 68040/68360 system as described
-# in Chapter 9 of the MC68360 User's Manual. This version
-# can be used with the Arnewsh SBC360 card.
-# - If the preprocessor symbol M68360_ATLAS_HSB is defined,
-# the BSP is compiled for an Atlas HSB card.
-# - Otherwise, the BSP is compiled for a generic 68360 system
-# as described in Chapter 9 of the MC68360 User's Manual. This
-# version works with the Atlas ACE360 card.
-#
-# Decisions to be made a link-edit time are:
-# - The size of the memory allocator heap. The default value is
-# 64 kbytes. If the network package is used the heap
-# should be at least 256 kbytes. If your network is large, or
-# busy, the heap should be even larger.
-# To choose a heap size of 256 kbytes,
-# CFLAGS_LD += -Wl,--defsym -Wl,HeapSize=0x40000
-
-BSP NAME: gen68360 or gen68360_040
-BOARD: Generic 68360 as described in Motorola MC68360 User's Manual
-BOARD: Atlas Computer Equipment Inc. High Speed Bridge (HSB)
-BOARD: Atlas Computer Equipment Inc. Advanced Communication Engine (ACE)
-BOARD: Arnewsh SBC360 68040/68360 card
-BUS: none
-CPU FAMILY: Motorola CPU32+, Motorola 68040
-COPROCESSORS: none
-MODE: not applicable
-
-DEBUG MONITOR: none (Hardware provides BDM)
-
-PERIPHERALS
-===========
-TIMERS: PIT, Watchdog, 4 general purpose, 16 RISC
- RESOLUTION: one microsecond
-SERIAL PORTS: 4 SCC, 2 SMC, 1 SPI
-REAL-TIME CLOCK:
-DMA: Each serial port, 2 general purpose
-VIDEO: none
-SCSI: none
-NETWORKING: Ethernet on SCC1.
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: Programmable Interval Timer
-IOSUPP DRIVER: Serial Management Controller 1
-SHMSUPP: none
-TIMER DRIVER: Timer 1
-
-STDIO
-=====
-PORT: SMC1
-ELECTRICAL: EIA-232 (if board supplies level shifter)
-BAUD: 9600
-BITS PER CHARACTER: 8
-PARITY: None
-STOP BITS: 1
-
-NOTES
-=====
-
-Board description
------------------
-clock rate: 25 MHz
-bus width: 8-bit PROM, 32-bit DRAM
-ROM: To 1 MByte, 180 nsec (3 wait states), chip select 0
-RAM: 4 or 16 MBytes of 60 nsec parity DRAM (1Mx36) to RAS1*/CAS1*
-
-Host System
------------
-OPENSTEP 4.2 (Intel and Motorola), Solaris 2.5, Linux 2.0.29
-
-Verification (Standalone 68360)
--------------------------------
-Single processor tests: Passed
-Multi-processort tests: not applicable
-Timing tests:
- Context Switch
-
- context switch: self 10
- context switch: to another task 11
- context switch: no floating point contexts 40
- fp context switch: restore 1st FP task 41
- fp context switch: save initialized, restore initialized 14
- fp context switch: save idle, restore initialized 14
- fp context switch: save idle, restore idle 43
-
- Task Manager
-
- rtems_task_create 133
- rtems_task_ident 351
- rtems_task_start 77
- rtems_task_restart: calling task 93
- rtems_task_restart: suspended task -- returns to caller 90
- rtems_task_restart: blocked task -- returns to caller 120
- rtems_task_restart: ready task -- returns to caller 92
- rtems_task_restart: suspended task -- preempts caller 121
- rtems_task_restart: blocked task -- preempts caller 143
- rtems_task_restart: ready task -- preempts caller 138
- rtems_task_delete: calling task 158
- rtems_task_delete: suspended task 129
- rtems_task_delete: blocked task 134
- rtems_task_delete: ready task 136
- rtems_task_suspend: calling task 71
- rtems_task_suspend: returns to caller 47
- rtems_task_resume: task readied -- returns to caller 48
- rtems_task_resume: task readied -- preempts caller 67
- rtems_task_set_priority: obtain current priority 36
- rtems_task_set_priority: returns to caller 65
- rtems_task_set_priority: preempts caller 102
- rtems_task_mode: obtain current mode 13
- rtems_task_mode: no reschedule 15
- rtems_task_mode: reschedule -- returns to caller 22
- rtems_task_mode: reschedule -- preempts caller 61
- rtems_task_get_note 38
- rtems_task_set_note 37
- rtems_task_wake_after: yield -- returns to caller 22
- rtems_task_wake_after: yields -- preempts caller 56
- rtems_task_wake_when 110
-
- Interrupt Manager
-
- interrupt entry overhead: returns to nested interrupt 8
- interrupt entry overhead: returns to interrupted task 8
- interrupt entry overhead: returns to preempting task 8
- interrupt exit overhead: returns to nested interrupt 7
- interrupt exit overhead: returns to interrupted task 8
- interrupt exit overhead: returns to preempting task 52
-
- Clock Manager
-
- rtems_clock_set 82
- rtems_clock_get 2
- rtems_clock_tick 15
-
- Timer Manager
-
- rtems_timer_create 33
- rtems_timer_ident 343
- rtems_timer_delete: inactive 47
- rtems_timer_delete: active 50
- rtems_timer_fire_after: inactive 59
- rtems_timer_fire_after: active 63
- rtems_timer_fire_when: inactive 83
- rtems_timer_fire_when: active 83
- rtems_timer_reset: inactive 55
- rtems_timer_reset: active 58
- rtems_timer_cancel: inactive 35
- rtems_timer_cancel: active 38
-
- Semaphore Manager
-
- rtems_semaphore_create 62
- rtems_semaphore_ident 368
- rtems_semaphore_delete 61
- rtems_semaphore_obtain: available 42
- rtems_semaphore_obtain: not available -- NO_WAIT 42
- rtems_semaphore_obtain: not available -- caller blocks 105
- rtems_semaphore_release: no waiting tasks 46
- rtems_semaphore_release: task readied -- returns to caller 64
- rtems_semaphore_release: task readied -- preempts caller 84
-
- Message Queue Manager
-
- rtems_message_queue_create 240
- rtems_message_queue_ident 342
- rtems_message_queue_delete 79
- rtems_message_queue_send: no waiting tasks 93
- rtems_message_queue_send: task readied -- returns to caller 96
- rtems_message_queue_send: task readied -- preempts caller 116
- rtems_message_queue_urgent: no waiting tasks 93
- rtems_message_queue_urgent: task readied -- returns to caller 97
- rtems_message_queue_urgent: task readied -- preempts caller 117
- rtems_message_queue_broadcast: no waiting tasks 54
- rtems_message_queue_broadcast: task readied -- returns to caller 106
- rtems_message_queue_broadcast: task readied -- preempts caller 126
- rtems_message_queue_receive: available 79
- rtems_message_queue_receive: not available -- NO_WAIT 48
- rtems_message_queue_receive: not available -- caller blocks 111
- rtems_message_queue_flush: no messages flushed 35
- rtems_message_queue_flush: messages flushed 44
-
- Event Manager
-
- rtems_event_send: no task readied 30
- rtems_event_send: task readied -- returns to caller 59
- rtems_event_send: task readied -- preempts caller 81
- rtems_event_receive: obtain current events 1
- rtems_event_receive: available 34
- rtems_event_receive: not available -- NO_WAIT 31
- rtems_event_receive: not available -- caller blocks 84
-
- Signal Manager
-
- rtems_signal_catch 24
- rtems_signal_send: returns to caller 42
- rtems_signal_send: signal to self 47
- exit ASR overhead: returns to calling task 33
- exit ASR overhead: returns to preempting task 58
-
- Partition Manager
-
- rtems_partition_create 78
- rtems_partition_ident 342
- rtems_partition_delete 46
- rtems_partition_get_buffer: available 40
- rtems_partition_get_buffer: not available 39
- rtems_partition_return_buffer 47
-
- Region Manager
-
- rtems_region_create 65
- rtems_region_ident 349
- rtems_region_delete 45
- rtems_region_get_segment: available 55
- rtems_region_get_segment: not available -- NO_WAIT 52
- rtems_region_get_segment: not available -- caller blocks 119
- rtems_region_return_segment: no waiting tasks 57
- rtems_region_return_segment: task readied -- returns to caller 106
- rtems_region_return_segment: task readied -- preempts caller 127
-
- Dual-Ported Memory Manager
-
- rtems_port_create 40
- rtems_port_ident 342
- rtems_port_delete 44
- rtems_port_internal_to_external 32
- rtems_port_external_to_internal 32
-
- IO Manager
-
- rtems_io_initialize 4
- rtems_io_open 1
- rtems_io_close 1
- rtems_io_read 1
- rtems_io_write 1
- rtems_io_control 1
-
- Rate Monotonic Manager
-
- rtems_rate_monotonic_create 39
- rtems_rate_monotonic_ident 343
- rtems_rate_monotonic_cancel 43
- rtems_rate_monotonic_delete: active 54
- rtems_rate_monotonic_delete: inactive 52
- rtems_rate_monotonic_period: obtain status 37
- rtems_rate_monotonic_period: initiate period -- returns to caller 58
- rtems_rate_monotonic_period: conclude periods -- caller blocks 75
-
-Network tests:
- TCP throughput (as measured by ttcp):
- Receive: 1081 kbytes/sec
- Transmit: 953 kbytes/sec
-
-Porting
--------
-This board support package is written for a 68360 system similar to that
-described in chapter 9 of the Motorola MC68360 Quad Integrated Communication
-Processor Users' Manual. The salient features of this hardware are:
-
- 25 MHz external clock
- DRAM address multiplexing provided by 68360
- 8-bit 180nsec PROM to CS0*
- 4 MBytes of 60 nsec parity DRAM (1Mx36) to RAS1*/CAS1*
- Console serial port on SMC1
- Ethernet interface on SCC1
-
-The board support package has been tested with:
- A home-built 68360 board
- An ACE360A and an HSB board produced by:
- Atlas Computer Equipment
- 703 Colina Lane
- Santa Barbara, CA 93103
- A 68040/68360 board (SBC360) produced by:
- Arnewsh Inc.
- P.O. Box 270352
- Fort Collins, CO 80527-0352
diff --git a/c/src/lib/libbsp/m68k/gen68360/bsp_specs b/c/src/lib/libbsp/m68k/gen68360/bsp_specs
deleted file mode 100644
index 8d99d81446..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start360.o%s} \
-%{qrtems_debug: start360_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/m68k/gen68360/clock/Makefile.in b/c/src/lib/libbsp/m68k/gen68360/clock/Makefile.in
deleted file mode 100644
index 59df4f2702..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/clock/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/gen68360/clock/ckinit.c b/c/src/lib/libbsp/m68k/gen68360/clock/ckinit.c
deleted file mode 100644
index eb30e01b70..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/clock/ckinit.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * This routine initializes the MC68360 Periodic Interval Timer
- *
- * The PIT has rather poor resolution, but it is easy to set up
- * and requires no housekeeping once it is going.
- *
- * Based on the `gen68302' board support package, and covered by the
- * original distribution terms.
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-/*
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- */
-
-#include <stdlib.h> /* for atexit() */
-#include <bsp.h>
-#include <rtems/libio.h>
-#include "m68360.h"
-
-#define CLOCK_VECTOR 120
-#define CLOCK_IRQ_LEVEL 6
-
-/*
- * Clock_driver_ticks is a monotonically increasing counter of the
- * number of clock ticks since the driver was initialized.
- */
-volatile rtems_unsigned32 Clock_driver_ticks;
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-char M360DefaultWatchdogFeeder = 1;
-
-/*
- * Periodic interval timer interrupt handler
- */
-
-rtems_isr
-Clock_isr (rtems_vector_number vector)
-{
- /*
- * Perform a dummy read of DPRAM.
- * This works around a bug in Rev. B of the 68360
- */
- m360.dpram0[0];
-
- /*
- * Feed the watchdog
- * Application code can override this by
- * setting M360DefaultWatchdogFeeder to zero.
- */
- if (M360DefaultWatchdogFeeder) {
- m360.swsr = 0x55;
- m360.swsr = 0xAA;
- }
-
- /*
- * Announce the clock tick
- */
- Clock_driver_ticks++;
- rtems_clock_tick();
-}
-
-void
-Clock_exit (void)
-{
- if (BSP_Configuration.ticks_per_timeslice ) {
- /*
- * Turn off periodic interval timer
- */
- m360.pitr &= ~0xFF;
- }
-}
-
-static void
-Install_clock (rtems_isr_entry clock_isr)
-{
- Clock_driver_ticks = 0;
- if ( BSP_Configuration.ticks_per_timeslice ) {
- int pitr;
-
- /*
- * Choose periodic interval timer register value
- * For a 25 MHz external clock the basic clock rate is
- * 40 nsec * 128 * 4 = 20.48 usec/tick
- */
- pitr = ((BSP_Configuration.microseconds_per_tick * 100) + 1023) / 2048;
- if (pitr >= 256) {
- pitr = (pitr + 255) / 512;
- if (pitr >= 256)
- pitr = 255;
- else if (pitr == 0)
- pitr = 1;
- pitr |= 0x100;
- }
- else if (pitr == 0) {
- pitr = 1;
- }
- m360.pitr &= ~0x1FF;
- m360.picr = (CLOCK_IRQ_LEVEL << 8) | CLOCK_VECTOR;
- set_vector (clock_isr, CLOCK_VECTOR, 1);
- m360.pitr |= pitr;
- atexit (Clock_exit);
- }
-}
-
-rtems_device_driver
-Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock (Clock_isr);
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args) {
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
- if (args->command == rtems_build_name('I', 'S', 'R', ' ')) {
- Clock_isr( CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
- }
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/m68k/gen68360/console/Makefile.in b/c/src/lib/libbsp/m68k/gen68360/console/Makefile.in
deleted file mode 100644
index fd05ddfedd..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/gen68360/console/console.c b/c/src/lib/libbsp/m68k/gen68360/console/console.c
deleted file mode 100644
index 63031ccbd6..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/console/console.c
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- * SMC1 raw console serial I/O.
- *
- * This driver is an example of `POLLING' or `INTERRUPT' I/O.
- *
- * To run with interrupt-driven I/O, ensure m360_smc1_interrupt
- * is set before calling the initialization routine.
- *
- * Author:
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- *
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <termios.h>
-#include <bsp.h>
-#include <rtems/libio.h>
-#include "m68360.h"
-
-/*
- * Declare clock speed -- may be overwritten by downloader or debugger
- */
-int m360_clock_rate = 25000000;
-
-/*
- * Interrupt-driven input buffer
- */
-#define RXBUFSIZE 16
-
-/*
- * Interrupt-driven callback
- */
-static int m360_smc1_interrupt = 1;
-static void *smc1ttyp;
-
-/*
- * I/O buffers and pointers to buffer descriptors
- */
-static volatile char rxBuf[RXBUFSIZE];
-static volatile m360BufferDescriptor_t *smcRxBd, *smcTxBd;
-
-/*
- * Device-specific routines
- */
-
-/*
- * Compute baud-rate-generator configuration register value
- */
-static int
-smc1BRGC (int baud)
-{
- int divisor;
- int div16 = 0;
-
- divisor = ((m360_clock_rate / 16) + (baud / 2)) / baud;
- if (divisor > 4096) {
- div16 = 1;
- divisor = (divisor + 8) / 16;
- }
- return M360_BRG_EN | M360_BRG_EXTC_BRGCLK | ((divisor - 1) << 1) | div16;
-}
-
-/*
- * Hardware-dependent portion of tcsetattr().
- */
-static int
-smc1SetAttributes (int minor, const struct termios *t)
-{
- int baud;
-
- switch (t->c_cflag & CBAUD) {
- default: baud = -1; break;
- case B50: baud = 50; break;
- case B75: baud = 75; break;
- case B110: baud = 110; break;
- case B134: baud = 134; break;
- case B150: baud = 150; break;
- case B200: baud = 200; break;
- case B300: baud = 300; break;
- case B600: baud = 600; break;
- case B1200: baud = 1200; break;
- case B1800: baud = 1800; break;
- case B2400: baud = 2400; break;
- case B4800: baud = 4800; break;
- case B9600: baud = 9600; break;
- case B19200: baud = 19200; break;
- case B38400: baud = 38400; break;
- case B57600: baud = 57600; break;
- case B115200: baud = 115200; break;
- case B230400: baud = 230400; break;
- case B460800: baud = 460800; break;
- }
- if (baud > 0)
- m360.brgc1 = smc1BRGC (baud);
- return 0;
-}
-
-/*
- * Interrupt handler
- */
-static rtems_isr
-smc1InterruptHandler (rtems_vector_number v)
-{
- /*
- * Buffer received?
- */
- if (m360.smc1.smce & 0x1) {
- m360.smc1.smce = 0x1;
- while ((smcRxBd->status & M360_BD_EMPTY) == 0) {
- rtems_termios_enqueue_raw_characters (smc1ttyp,
- (char *)smcRxBd->buffer,
- smcRxBd->length);
- smcRxBd->status = M360_BD_EMPTY | M360_BD_WRAP | M360_BD_INTERRUPT;
- }
- }
-
- /*
- * Buffer transmitted?
- */
- if (m360.smc1.smce & 0x2) {
- m360.smc1.smce = 0x2;
- if ((smcTxBd->status & M360_BD_READY) == 0)
- rtems_termios_dequeue_characters (smc1ttyp, smcTxBd->length);
- }
- m360.cisr = 1UL << 4; /* Clear SMC1 interrupt-in-service bit */
-}
-
-static void
-smc1Initialize (void)
-{
- /*
- * Allocate buffer descriptors
- */
- smcRxBd = M360AllocateBufferDescriptors (1);
- smcTxBd = M360AllocateBufferDescriptors (1);
-
- /*
- * Configure port B pins to enable SMTXD1 and SMRXD1 pins
- */
- m360.pbpar |= 0xC0;
- m360.pbdir &= ~0xC0;
- m360.pbodr &= ~0xC0;
-
- /*
- * Set up BRG1 (9,600 baud)
- */
- m360.brgc1 = M360_BRG_RST;
- m360.brgc1 = smc1BRGC (9600);
-
- /*
- * Put SMC1 in NMSI mode, connect SMC1 to BRG1
- */
- m360.simode |= M360_SI_SMC1_BRG1;
-
- /*
- * Set up SMC1 parameter RAM common to all protocols
- */
- m360.smc1p.rbase = (char *)smcRxBd - (char *)&m360;
- m360.smc1p.tbase = (char *)smcTxBd - (char *)&m360;
- m360.smc1p.rfcr = M360_RFCR_MOT | M360_RFCR_DMA_SPACE;
- m360.smc1p.tfcr = M360_TFCR_MOT | M360_TFCR_DMA_SPACE;
- if (m360_smc1_interrupt)
- m360.smc1p.mrblr = RXBUFSIZE;
- else
- m360.smc1p.mrblr = 1;
-
- /*
- * Set up SMC1 parameter RAM UART-specific parameters
- */
- m360.smc1p.un.uart.max_idl = 10;
- m360.smc1p.un.uart.brklen = 0;
- m360.smc1p.un.uart.brkec = 0;
- m360.smc1p.un.uart.brkcr = 0;
-
- /*
- * Set up the Receive Buffer Descriptor
- */
- smcRxBd->status = M360_BD_EMPTY | M360_BD_WRAP | M360_BD_INTERRUPT;
- smcRxBd->length = 0;
- smcRxBd->buffer = rxBuf;
-
- /*
- * Setup the Transmit Buffer Descriptor
- */
- smcTxBd->status = M360_BD_WRAP;
-
- /*
- * Set up SMC1 general and protocol-specific mode registers
- */
- m360.smc1.smce = ~0; /* Clear any pending events */
- m360.smc1.smcm = 0; /* Mask all interrupt/event sources */
- m360.smc1.smcmr = M360_SMCMR_CLEN(9) | M360_SMCMR_SM_UART;
-
- /*
- * Send "Init parameters" command
- */
- M360ExecuteRISC (M360_CR_OP_INIT_RX_TX | M360_CR_CHAN_SMC1);
-
- /*
- * Enable receiver and transmitter
- */
- m360.smc1.smcmr |= M360_SMCMR_TEN | M360_SMCMR_REN;
-
- if (m360_smc1_interrupt) {
- rtems_isr_entry old_handler;
- rtems_status_code sc;
-
- sc = rtems_interrupt_catch (smc1InterruptHandler,
- (m360.cicr & 0xE0) | 0x04,
- &old_handler);
- m360.smc1.smcm = 3; /* Enable SMC1 TX and RX interrupts */
- m360.cimr |= 1UL << 4; /* Enable SMC1 interrupts */
- }
-}
-
-static int
-smc1PollRead (int minor)
-{
- unsigned char c;
-
- if (smcRxBd->status & M360_BD_EMPTY)
- return -1;
- c = rxBuf[0];
- smcRxBd->status = M360_BD_EMPTY | M360_BD_WRAP;
- return c;
-}
-
-/*
- * Device-dependent write routine
- * Interrupt-driven devices:
- * Begin transmission of as many characters as possible (minimum is 1).
- * Polling devices:
- * Transmit all characters.
- */
-static int
-smc1InterruptWrite (int minor, const char *buf, int len)
-{
- smcTxBd->buffer = (char *)buf;
- smcTxBd->length = len;
- smcTxBd->status = M360_BD_READY | M360_BD_WRAP | M360_BD_INTERRUPT;
- return 0;
-}
-
-static int
-smc1PollWrite (int minor, const char *buf, int len)
-{
- while (len--) {
- static char txBuf;
- while (smcTxBd->status & M360_BD_READY)
- continue;
- txBuf = *buf++;
- smcTxBd->buffer = &txBuf;
- smcTxBd->length = 1;
- smcTxBd->status = M360_BD_READY | M360_BD_WRAP;
- }
- return 0;
-}
-
-/*
- ***************
- * BOILERPLATE *
- ***************
- */
-
-/*
- * Reserve resources consumed by this driver
- */
-void console_reserve_resources(
- rtems_configuration_table *configuration
-)
-{
- rtems_termios_reserve_resources (configuration, 1);
-}
-
-/*
- * Initialize and register the device
- */
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- /*
- * Set up TERMIOS
- */
- rtems_termios_initialize ();
-
- /*
- * Do device-specific initialization
- */
- smc1Initialize ();
-
- /*
- * Register the device
- */
- status = rtems_io_register_name ("/dev/console", major, 0);
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (status);
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Open the device
- */
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_status_code sc;
- static const rtems_termios_callbacks intrCallbacks = {
- NULL, /* firstOpen */
- NULL, /* lastClose */
- NULL, /* pollRead */
- smc1InterruptWrite, /* write */
- smc1SetAttributes, /* setAttributes */
- NULL, /* stopRemoteTx */
- NULL, /* startRemoteTx */
- 1 /* outputUsesInterrupts */
- };
- static const rtems_termios_callbacks pollCallbacks = {
- NULL, /* firstOpen */
- NULL, /* lastClose */
- smc1PollRead, /* pollRead */
- smc1PollWrite, /* write */
- smc1SetAttributes, /* setAttributes */
- NULL, /* stopRemoteTx */
- NULL, /* startRemoteTx */
- 0 /* outputUsesInterrupts */
- };
-
- if (m360_smc1_interrupt) {
- rtems_libio_open_close_args_t *args = arg;
-
- sc = rtems_termios_open (major, minor, arg, &intrCallbacks);
- smc1ttyp = args->iop->data1;
- }
- else {
- sc = rtems_termios_open (major, minor, arg, &pollCallbacks);
- }
- return sc;
-}
-
-/*
- * Close the device
- */
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_close (arg);
-}
-
-/*
- * Read from the device
- */
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_read (arg);
-}
-
-/*
- * Write to the device
- */
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_write (arg);
-}
-
-/*
- * Handle ioctl request.
- */
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_ioctl (arg);
-}
diff --git a/c/src/lib/libbsp/m68k/gen68360/include/Makefile.in b/c/src/lib/libbsp/m68k/gen68360/include/Makefile.in
deleted file mode 100644
index 7d8581095f..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/m68k/gen68360/include/bsp.h b/c/src/lib/libbsp/m68k/gen68360/include/bsp.h
deleted file mode 100644
index 885fdd117d..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/include/bsp.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Board Support Package for `Generic' Motorola MC68360
- *
- * Based on the `gen68302' board support package, and covered by the
- * original distribution terms.
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-/* bsp.h
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and 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 __GEN68360_BSP_h
-#define __GEN68360_BSP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <console.h>
-#include <iosupp.h>
-#include <clockdrv.h>
-
-/*
- * Network driver configuration
- */
-struct rtems_bsdnet_ifconfig;
-extern int rtems_scc1_driver_attach (struct rtems_bsdnet_ifconfig *config);
-#define RTEMS_BSP_NETWORK_DRIVER_NAME "scc1"
-#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_scc1_driver_attach
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Stuff for Time Test 27
- * Don't bother with hardware -- just use a software-interrupt
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), 34, 1 )
-
-#define Cause_tm27_intr() asm volatile ("trap #2");
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( microseconds ) \
- { register rtems_unsigned32 _delay=(microseconds); \
- register rtems_unsigned32 _tmp=123; \
- asm volatile( "0: \
- nbcd %0 ; \
- nbcd %0 ; \
- dbf %1,0b" \
- : "=d" (_tmp), "=d" (_delay) \
- : "0" (_tmp), "1" (_delay) ); \
- }
-
-/* Constants */
-
-/* Structures */
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-extern m68k_isr_entry M68Kvec[]; /* vector table address */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-void M360ExecuteRISC( rtems_unsigned16 command );
-void *M360AllocateBufferDescriptors( int count );
-void *M360AllocateRiscTimers( int count );
-extern char M360DefaultWatchdogFeeder;
-
-m68k_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-/*
- * Values assigned by link editor
- */
-extern void *_RomBase, *_RamBase;
-
-/*
- * Definitions for Atlas Computer Equipment Inc. High Speed Bridge (HSB)
- */
-#define ATLASHSB_ESR 0x20010000L
-#define ATLASHSB_USICR 0x20010001L
-#define ATLASHSB_DSRR 0x20010002L
-#define ATLASHSB_LED4 0x20010004L
-#define ATLASHSB_ROM_U6 0xFF080000L /* U6 flash ROM socket */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/gen68360/include/coverhd.h b/c/src/lib/libbsp/m68k/gen68360/include/coverhd.h
deleted file mode 100644
index 020543466f..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/include/coverhd.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * This file was machine-generated from the tmoverhd.exe output
- *
- * $Id$
- */
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 2
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 2
-#define CALLING_OVERHEAD_TASK_CREATE 3
-#define CALLING_OVERHEAD_TASK_IDENT 3
-#define CALLING_OVERHEAD_TASK_START 3
-#define CALLING_OVERHEAD_TASK_RESTART 2
-#define CALLING_OVERHEAD_TASK_DELETE 2
-#define CALLING_OVERHEAD_TASK_SUSPEND 2
-#define CALLING_OVERHEAD_TASK_RESUME 2
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 3
-#define CALLING_OVERHEAD_TASK_MODE 3
-#define CALLING_OVERHEAD_TASK_GET_NOTE 3
-#define CALLING_OVERHEAD_TASK_SET_NOTE 3
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 5
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 2
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 3
-#define CALLING_OVERHEAD_CLOCK_GET 6
-#define CALLING_OVERHEAD_CLOCK_SET 5
-#define CALLING_OVERHEAD_CLOCK_TICK 1
-#define CALLING_OVERHEAD_TIMER_CREATE 2
-#define CALLING_OVERHEAD_TIMER_DELETE 2
-#define CALLING_OVERHEAD_TIMER_IDENT 2
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 3
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 7
-#define CALLING_OVERHEAD_TIMER_RESET 2
-#define CALLING_OVERHEAD_TIMER_CANCEL 2
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 3
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 2
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 3
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 3
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 3
-#define CALLING_OVERHEAD_EVENT_SEND 3
-#define CALLING_OVERHEAD_EVENT_RECEIVE 3
-#define CALLING_OVERHEAD_SIGNAL_CATCH 2
-#define CALLING_OVERHEAD_SIGNAL_SEND 3
-#define CALLING_OVERHEAD_PARTITION_CREATE 4
-#define CALLING_OVERHEAD_PARTITION_IDENT 3
-#define CALLING_OVERHEAD_PARTITION_DELETE 2
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 3
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 3
-#define CALLING_OVERHEAD_REGION_CREATE 4
-#define CALLING_OVERHEAD_REGION_IDENT 2
-#define CALLING_OVERHEAD_REGION_DELETE 2
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 3
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 3
-#define CALLING_OVERHEAD_PORT_CREATE 4
-#define CALLING_OVERHEAD_PORT_IDENT 2
-#define CALLING_OVERHEAD_PORT_DELETE 2
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 3
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 3
-#define CALLING_OVERHEAD_IO_INITIALIZE 3
-#define CALLING_OVERHEAD_IO_OPEN 3
-#define CALLING_OVERHEAD_IO_CLOSE 3
-#define CALLING_OVERHEAD_IO_READ 3
-#define CALLING_OVERHEAD_IO_WRITE 3
-#define CALLING_OVERHEAD_IO_CONTROL 3
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 2
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 1
diff --git a/c/src/lib/libbsp/m68k/gen68360/network/Makefile.in b/c/src/lib/libbsp/m68k/gen68360/network/Makefile.in
deleted file mode 100644
index 59728b648d..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/network/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/network.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=network
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \
- -DDIAGNOSTIC -DBOOTP_COMPAT
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/gen68360/network/network.c b/c/src/lib/libbsp/m68k/gen68360/network/network.c
deleted file mode 100644
index bc10e220b4..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/network/network.c
+++ /dev/null
@@ -1,950 +0,0 @@
-/*
- * RTEMS driver for M68360 SCC1 Ethernet
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-#include <bsp.h>
-#include <m68360.h>
-#include <stdio.h>
-#include <rtems/error.h>
-#include <rtems/rtems_bsdnet.h>
-
-#include <sys/param.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/sockio.h>
-
-#include <net/if.h>
-
-#include <netinet/in.h>
-#include <netinet/if_ether.h>
-
-/*
- * Number of SCCs supported by this driver
- */
-#define NSCCDRIVER 1
-
-/*
- * Default number of buffer descriptors set aside for this driver.
- * The number of transmit buffer descriptors has to be quite large
- * since a single frame often uses four or more buffer descriptors.
- */
-#define RX_BUF_COUNT 15
-#define TX_BUF_COUNT 4
-#define TX_BD_PER_BUF 4
-
-/*
- * RTEMS event used by interrupt handler to signal driver tasks.
- * This must not be any of the events used by the network task synchronization.
- */
-#define INTERRUPT_EVENT RTEMS_EVENT_1
-
-/*
- * RTEMS event used to start transmit daemon.
- * This must not be the same as INTERRUPT_EVENT.
- */
-#define START_TRANSMIT_EVENT RTEMS_EVENT_2
-
-/*
- * Receive buffer size -- Allow for a full ethernet packet including CRC
- */
-#define RBUF_SIZE 1520
-
-#if (MCLBYTES < RBUF_SIZE)
-# error "Driver must have MCLBYTES > RBUF_SIZE"
-#endif
-
-/*
- * Per-device data
- */
-struct scc_softc {
- struct arpcom arpcom;
- struct mbuf **rxMbuf;
- struct mbuf **txMbuf;
- int acceptBroadcast;
- int rxBdCount;
- int txBdCount;
- int txBdHead;
- int txBdTail;
- int txBdActiveCount;
- m360BufferDescriptor_t *rxBdBase;
- m360BufferDescriptor_t *txBdBase;
- rtems_id rxDaemonTid;
- rtems_id txDaemonTid;
-
- /*
- * Statistics
- */
- unsigned long rxInterrupts;
- unsigned long rxNotFirst;
- unsigned long rxNotLast;
- unsigned long rxGiant;
- unsigned long rxNonOctet;
- unsigned long rxRunt;
- unsigned long rxBadCRC;
- unsigned long rxOverrun;
- unsigned long rxCollision;
-
- unsigned long txInterrupts;
- unsigned long txDeferred;
- unsigned long txHeartbeat;
- unsigned long txLateCollision;
- unsigned long txRetryLimit;
- unsigned long txUnderrun;
- unsigned long txLostCarrier;
- unsigned long txRawWait;
-};
-static struct scc_softc scc_softc[NSCCDRIVER];
-
-/*
- * SCC1 interrupt handler
- */
-static rtems_isr
-m360Enet_interrupt_handler (rtems_vector_number v)
-{
- /*
- * Frame received?
- */
- if ((m360.scc1.sccm & 0x8) && (m360.scc1.scce & 0x8)) {
- m360.scc1.scce = 0x8;
- m360.scc1.sccm &= ~0x8;
- scc_softc[0].rxInterrupts++;
- rtems_event_send (scc_softc[0].rxDaemonTid, INTERRUPT_EVENT);
- }
-
- /*
- * Buffer transmitted or transmitter error?
- */
- if ((m360.scc1.sccm & 0x12) && (m360.scc1.scce & 0x12)) {
- m360.scc1.scce = 0x12;
- m360.scc1.sccm &= ~0x12;
- scc_softc[0].txInterrupts++;
- rtems_event_send (scc_softc[0].txDaemonTid, INTERRUPT_EVENT);
- }
- m360.cisr = 1UL << 30; /* Clear SCC1 interrupt-in-service bit */
-}
-
-/*
- * Initialize the ethernet hardware
- */
-static void
-m360Enet_initialize_hardware (struct scc_softc *sc)
-{
- int i;
- unsigned char *hwaddr;
- rtems_status_code status;
- rtems_isr_entry old_handler;
-
- /*
- * Configure port A CLK1, CLK2, TXD1 and RXD1 pins
- */
- m360.papar |= 0x303;
- m360.padir &= ~0x303;
- m360.paodr &= ~0x303;
-
- /*
- * Configure port C CTS1* and CD1* pins
- */
- m360.pcpar &= ~0x30;
- m360.pcdir &= ~0x30;
- m360.pcso |= 0x30;
-
- /*
- * Connect CLK1 and CLK2 to SCC1
- */
- m360.sicr &= ~0xFF;
- m360.sicr |= (5 << 3) | 4;
-
- /*
- * Allocate mbuf pointers
- */
- sc->rxMbuf = malloc (sc->rxBdCount * sizeof *sc->rxMbuf, M_MBUF, M_NOWAIT);
- sc->txMbuf = malloc (sc->txBdCount * sizeof *sc->txMbuf, M_MBUF, M_NOWAIT);
- if (!sc->rxMbuf || !sc->txMbuf)
- rtems_panic ("No memory for mbuf pointers");
-
- /*
- * Set receiver and transmitter buffer descriptor bases
- */
- sc->rxBdBase = M360AllocateBufferDescriptors(sc->rxBdCount);
- sc->txBdBase = M360AllocateBufferDescriptors(sc->txBdCount);
- m360.scc1p.rbase = (char *)sc->rxBdBase - (char *)&m360;
- m360.scc1p.tbase = (char *)sc->txBdBase - (char *)&m360;
-
- /*
- * Send "Init parameters" command
- */
- M360ExecuteRISC (M360_CR_OP_INIT_RX_TX | M360_CR_CHAN_SCC1);
-
- /*
- * Set receive and transmit function codes
- */
- m360.scc1p.rfcr = M360_RFCR_MOT | M360_RFCR_DMA_SPACE;
- m360.scc1p.tfcr = M360_TFCR_MOT | M360_TFCR_DMA_SPACE;
-
- /*
- * Set maximum receive buffer length
- */
- m360.scc1p.mrblr = RBUF_SIZE;
-
- /*
- * Set CRC parameters
- */
- m360.scc1p.un.ethernet.c_pres = 0xFFFFFFFF;
- m360.scc1p.un.ethernet.c_mask = 0xDEBB20E3;
-
- /*
- * Clear diagnostic counters
- */
- m360.scc1p.un.ethernet.crcec = 0;
- m360.scc1p.un.ethernet.alec = 0;
- m360.scc1p.un.ethernet.disfc = 0;
-
- /*
- * Set pad value
- */
- m360.scc1p.un.ethernet.pads = 0x8888;
-
- /*
- * Set retry limit
- */
- m360.scc1p.un.ethernet.ret_lim = 15;
-
- /*
- * Set maximum and minimum frame length
- */
- m360.scc1p.un.ethernet.mflr = 1518;
- m360.scc1p.un.ethernet.minflr = 64;
- m360.scc1p.un.ethernet.maxd1 = RBUF_SIZE;
- m360.scc1p.un.ethernet.maxd2 = RBUF_SIZE;
-
- /*
- * Clear group address hash table
- */
- m360.scc1p.un.ethernet.gaddr1 = 0;
- m360.scc1p.un.ethernet.gaddr2 = 0;
- m360.scc1p.un.ethernet.gaddr3 = 0;
- m360.scc1p.un.ethernet.gaddr4 = 0;
-
- /*
- * Set our physical address
- */
- hwaddr = sc->arpcom.ac_enaddr;
- m360.scc1p.un.ethernet.paddr_h = (hwaddr[5] << 8) | hwaddr[4];
- m360.scc1p.un.ethernet.paddr_m = (hwaddr[3] << 8) | hwaddr[2];
- m360.scc1p.un.ethernet.paddr_l = (hwaddr[1] << 8) | hwaddr[0];
-
- /*
- * Aggressive retry
- */
- m360.scc1p.un.ethernet.p_per = 0;
-
- /*
- * Clear individual address hash table
- */
- m360.scc1p.un.ethernet.iaddr1 = 0;
- m360.scc1p.un.ethernet.iaddr2 = 0;
- m360.scc1p.un.ethernet.iaddr3 = 0;
- m360.scc1p.un.ethernet.iaddr4 = 0;
-
- /*
- * Set up receive buffer descriptors
- */
- for (i = 0 ; i < sc->rxBdCount ; i++)
- (sc->rxBdBase + i)->status = 0;
-
- /*
- * Set up transmit buffer descriptors
- */
- for (i = 0 ; i < sc->txBdCount ; i++) {
- (sc->txBdBase + i)->status = 0;
- sc->txMbuf[i] = NULL;
- }
- sc->txBdHead = sc->txBdTail = 0;
- sc->txBdActiveCount = 0;
-
- /*
- * Clear any outstanding events
- */
- m360.scc1.scce = 0xFFFF;
-
- /*
- * Set up interrupts
- */
- status = rtems_interrupt_catch (m360Enet_interrupt_handler,
- (m360.cicr & 0xE0) | 0x1E,
- &old_handler);
- if (status != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't attach M360 SCC1 interrupt handler: %s\n",
- rtems_status_text (status));
- m360.scc1.sccm = 0; /* No interrupts unmasked till necessary */
- m360.cimr |= (1UL << 30); /* Enable SCC1 interrupt */
-
- /*
- * Set up General SCC Mode Register
- * Ethernet configuration
- */
- m360.scc1.gsmr_h = 0x0;
- m360.scc1.gsmr_l = 0x1088000c;
-
- /*
- * Set up data synchronization register
- * Ethernet synchronization pattern
- */
- m360.scc1.dsr = 0xd555;
-
- /*
- * Set up protocol-specific mode register
- * Heartbeat check
- * No force collision
- * Discard short frames
- * Individual address mode
- * Ethernet CRC
- * Not promisuous
- * Ignore/accept broadcast packets as specified
- * Normal backoff timer
- * No loopback
- * No input sample at end of frame
- * 64-byte limit for late collision
- * Wait 22 bits before looking for start of frame delimiter
- * Disable full-duplex operation
- */
- m360.scc1.psmr = 0x880A | (sc->acceptBroadcast ? 0 : 0x100);
-
- /*
- * Enable the TENA (RTS1*) pin
- */
-#if (defined (M68360_ATLAS_HSB))
- m360.pbpar |= 0x1000;
- m360.pbdir |= 0x1000;
-#else
- m360.pcpar |= 0x1;
- m360.pcdir &= ~0x1;
-#endif
-}
-
-/*
- * Soak up buffer descriptors that have been sent
- * Note that a buffer descriptor can't be retired as soon as it becomes
- * ready. The MC68360 Errata (May 96) says that, "If an Ethernet frame is
- * made up of multiple buffers, the user should not reuse the first buffer
- * descriptor until the last buffer descriptor of the frame has had its
- * ready bit cleared by the CPM".
- */
-static void
-m360Enet_retire_tx_bd (struct scc_softc *sc)
-{
- rtems_unsigned16 status;
- int i;
- int nRetired;
- struct mbuf *m, *n;
-
- i = sc->txBdTail;
- nRetired = 0;
- while ((sc->txBdActiveCount != 0)
- && (((status = (sc->txBdBase + i)->status) & M360_BD_READY) == 0)) {
- /*
- * See if anything went wrong
- */
- if (status & (M360_BD_DEFER |
- M360_BD_HEARTBEAT |
- M360_BD_LATE_COLLISION |
- M360_BD_RETRY_LIMIT |
- M360_BD_UNDERRUN |
- M360_BD_CARRIER_LOST)) {
- /*
- * Check for errors which stop the transmitter.
- */
- if (status & (M360_BD_LATE_COLLISION |
- M360_BD_RETRY_LIMIT |
- M360_BD_UNDERRUN)) {
- if (status & M360_BD_LATE_COLLISION)
- scc_softc[0].txLateCollision++;
- if (status & M360_BD_RETRY_LIMIT)
- scc_softc[0].txRetryLimit++;
- if (status & M360_BD_UNDERRUN)
- scc_softc[0].txUnderrun++;
-
- /*
- * Restart the transmitter
- */
- M360ExecuteRISC (M360_CR_OP_RESTART_TX | M360_CR_CHAN_SCC1);
- }
- if (status & M360_BD_DEFER)
- scc_softc[0].txDeferred++;
- if (status & M360_BD_HEARTBEAT)
- scc_softc[0].txHeartbeat++;
- if (status & M360_BD_CARRIER_LOST)
- scc_softc[0].txLostCarrier++;
- }
- nRetired++;
- if (status & M360_BD_LAST) {
- /*
- * A full frame has been transmitted.
- * Free all the associated buffer descriptors.
- */
- sc->txBdActiveCount -= nRetired;
- while (nRetired) {
- nRetired--;
- m = sc->txMbuf[sc->txBdTail];
- MFREE (m, n);
- if (++sc->txBdTail == sc->txBdCount)
- sc->txBdTail = 0;
- }
- }
- if (++i == sc->txBdCount)
- i = 0;
- }
-}
-
-/*
- * SCC reader task
- */
-static void
-scc_rxDaemon (void *arg)
-{
- struct scc_softc *sc = (struct scc_softc *)arg;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- struct mbuf *m;
- rtems_unsigned16 status;
- m360BufferDescriptor_t *rxBd;
- int rxBdIndex;
-
- /*
- * Allocate space for incoming packets and start reception
- */
- for (rxBdIndex = 0 ; ;) {
- rxBd = sc->rxBdBase + rxBdIndex;
- MGETHDR (m, M_WAIT, MT_DATA);
- MCLGET (m, M_WAIT);
- m->m_pkthdr.rcvif = ifp;
- sc->rxMbuf[rxBdIndex] = m;
- rxBd->buffer = mtod (m, void *);
- rxBd->status = M360_BD_EMPTY | M360_BD_INTERRUPT;
- if (++rxBdIndex == sc->rxBdCount) {
- rxBd->status |= M360_BD_WRAP;
- break;
- }
- }
-
- /*
- * Input packet handling loop
- */
- rxBdIndex = 0;
- for (;;) {
- rxBd = sc->rxBdBase + rxBdIndex;
-
- /*
- * Wait for packet if there's not one ready
- */
- if ((status = rxBd->status) & M360_BD_EMPTY) {
- /*
- * Clear old events
- */
- m360.scc1.scce = 0x8;
-
- /*
- * Wait for packet
- * Note that the buffer descriptor is checked
- * *before* the event wait -- this catches the
- * possibility that a packet arrived between the
- * `if' above, and the clearing of the event register.
- */
- while ((status = rxBd->status) & M360_BD_EMPTY) {
- rtems_event_set events;
-
- /*
- * Unmask RXF (Full frame received) event
- */
- m360.scc1.sccm |= 0x8;
-
- rtems_bsdnet_event_receive (INTERRUPT_EVENT,
- RTEMS_WAIT|RTEMS_EVENT_ANY,
- RTEMS_NO_TIMEOUT,
- &events);
- }
- }
-
- /*
- * Check that packet is valid
- */
- if ((status & (M360_BD_LAST |
- M360_BD_FIRST_IN_FRAME |
- M360_BD_LONG |
- M360_BD_NONALIGNED |
- M360_BD_SHORT |
- M360_BD_CRC_ERROR |
- M360_BD_OVERRUN |
- M360_BD_COLLISION)) ==
- (M360_BD_LAST |
- M360_BD_FIRST_IN_FRAME)) {
- /*
- * Pass the packet up the chain.
- * FIXME: Packet filtering hook could be done here.
- */
- struct ether_header *eh;
-
- m = sc->rxMbuf[rxBdIndex];
- m->m_len = m->m_pkthdr.len = rxBd->length -
- sizeof(rtems_unsigned32) -
- sizeof(struct ether_header);
- eh = mtod (m, struct ether_header *);
- m->m_data += sizeof(struct ether_header);
- ether_input (ifp, eh, m);
-
- /*
- * Allocate a new mbuf
- */
- MGETHDR (m, M_WAIT, MT_DATA);
- MCLGET (m, M_WAIT);
- m->m_pkthdr.rcvif = ifp;
- sc->rxMbuf[rxBdIndex] = m;
- rxBd->buffer = mtod (m, void *);
- }
- else {
- /*
- * Something went wrong with the reception
- */
- if (!(status & M360_BD_LAST))
- sc->rxNotLast++;
- if (!(status & M360_BD_FIRST_IN_FRAME))
- sc->rxNotFirst++;
- if (status & M360_BD_LONG)
- sc->rxGiant++;
- if (status & M360_BD_NONALIGNED)
- sc->rxNonOctet++;
- if (status & M360_BD_SHORT)
- sc->rxRunt++;
- if (status & M360_BD_CRC_ERROR)
- sc->rxBadCRC++;
- if (status & M360_BD_OVERRUN)
- sc->rxOverrun++;
- if (status & M360_BD_COLLISION)
- sc->rxCollision++;
- }
-
- /*
- * Reenable the buffer descriptor
- */
- rxBd->status = (status & (M360_BD_WRAP | M360_BD_INTERRUPT)) | M360_BD_EMPTY;
-
- /*
- * Move to next buffer descriptor
- */
- if (++rxBdIndex == sc->rxBdCount)
- rxBdIndex = 0;
- }
-}
-
-static void
-sendpacket (struct ifnet *ifp, struct mbuf *m)
-{
- struct scc_softc *sc = ifp->if_softc;
- volatile m360BufferDescriptor_t *firstTxBd, *txBd;
- struct mbuf *l = NULL;
- rtems_unsigned16 status;
- int nAdded;
-
- /*
- * Free up buffer descriptors
- */
- m360Enet_retire_tx_bd (sc);
-
- /*
- * Set up the transmit buffer descriptors.
- * No need to pad out short packets since the
- * hardware takes care of that automatically.
- * No need to copy the packet to a contiguous buffer
- * since the hardware is capable of scatter/gather DMA.
- */
- nAdded = 0;
- txBd = firstTxBd = sc->txBdBase + sc->txBdHead;
- for (;;) {
- /*
- * Wait for buffer descriptor to become available.
- */
- if ((sc->txBdActiveCount + nAdded) == sc->txBdCount) {
- /*
- * Clear old events
- */
- m360.scc1.scce = 0x12;
-
- /*
- * Wait for buffer descriptor to become available.
- * Note that the buffer descriptors are checked
- * *before* * entering the wait loop -- this catches
- * the possibility that a buffer descriptor became
- * available between the `if' above, and the clearing
- * of the event register.
- * This is to catch the case where the transmitter
- * stops in the middle of a frame -- and only the
- * last buffer descriptor in a frame can generate
- * an interrupt.
- */
- m360Enet_retire_tx_bd (sc);
- while ((sc->txBdActiveCount + nAdded) == sc->txBdCount) {
- rtems_event_set events;
-
- /*
- * Unmask TXB (buffer transmitted) and
- * TXE (transmitter error) events.
- */
- m360.scc1.sccm |= 0x12;
- rtems_bsdnet_event_receive (INTERRUPT_EVENT,
- RTEMS_WAIT|RTEMS_EVENT_ANY,
- RTEMS_NO_TIMEOUT,
- &events);
- m360Enet_retire_tx_bd (sc);
- }
- }
-
- /*
- * Don't set the READY flag till the
- * whole packet has been readied.
- */
- status = nAdded ? M360_BD_READY : 0;
-
- /*
- * FIXME: Why not deal with empty mbufs at at higher level?
- * The IP fragmentation routine in ip_output
- * can produce packet fragments with zero length.
- * I think that ip_output should be changed to get
- * rid of these zero-length mbufs, but for now,
- * I'll deal with them here.
- */
- if (m->m_len) {
- /*
- * Fill in the buffer descriptor
- */
- txBd->buffer = mtod (m, void *);
- txBd->length = m->m_len;
- sc->txMbuf[sc->txBdHead] = m;
- nAdded++;
- if (++sc->txBdHead == sc->txBdCount) {
- status |= M360_BD_WRAP;
- sc->txBdHead = 0;
- }
- l = m;
- m = m->m_next;
- }
- else {
- /*
- * Just toss empty mbufs
- */
- struct mbuf *n;
- MFREE (m, n);
- m = n;
- if (l != NULL)
- l->m_next = m;
- }
-
- /*
- * Set the transmit buffer status.
- * Break out of the loop if this mbuf is the last in the frame.
- */
- if (m == NULL) {
- if (nAdded) {
- status |= M360_BD_PAD | M360_BD_LAST | M360_BD_TX_CRC | M360_BD_INTERRUPT;
- txBd->status = status;
- firstTxBd->status |= M360_BD_READY;
- sc->txBdActiveCount += nAdded;
- }
- break;
- }
- txBd->status = status;
- txBd = sc->txBdBase + sc->txBdHead;
- }
-}
-
-/*
- * Driver transmit daemon
- */
-void
-scc_txDaemon (void *arg)
-{
- struct scc_softc *sc = (struct scc_softc *)arg;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- struct mbuf *m;
- rtems_event_set events;
-
- for (;;) {
- /*
- * Wait for packet
- */
- rtems_bsdnet_event_receive (START_TRANSMIT_EVENT, RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Send packets till queue is empty
- */
- for (;;) {
- /*
- * Get the next mbuf chain to transmit.
- */
- IF_DEQUEUE(&ifp->if_snd, m);
- if (!m)
- break;
- sendpacket (ifp, m);
- }
- ifp->if_flags &= ~IFF_OACTIVE;
- }
-}
-
-/*
- * Send packet (caller provides header).
- */
-static void
-scc_start (struct ifnet *ifp)
-{
- struct scc_softc *sc = ifp->if_softc;
-
- rtems_event_send (sc->txDaemonTid, START_TRANSMIT_EVENT);
- ifp->if_flags |= IFF_OACTIVE;
-}
-
-/*
- * Initialize and start the device
- */
-static void
-scc_init (void *arg)
-{
- struct scc_softc *sc = arg;
- struct ifnet *ifp = &sc->arpcom.ac_if;
-
- if (sc->txDaemonTid == 0) {
-
- /*
- * Set up SCC hardware
- */
- m360Enet_initialize_hardware (sc);
-
- /*
- * Start driver tasks
- */
- sc->txDaemonTid = rtems_bsdnet_newproc ("SCtx", 4096, scc_txDaemon, sc);
- sc->rxDaemonTid = rtems_bsdnet_newproc ("SCrx", 4096, scc_rxDaemon, sc);
-
- }
-
- /*
- * Set flags appropriately
- */
- if (ifp->if_flags & IFF_PROMISC)
- m360.scc1.psmr |= 0x200;
- else
- m360.scc1.psmr &= ~0x200;
-
- /*
- * Tell the world that we're running.
- */
- ifp->if_flags |= IFF_RUNNING;
-
- /*
- * Enable receiver and transmitter
- */
- m360.scc1.gsmr_l |= 0x30;
-}
-
-/*
- * Stop the device
- */
-static void
-scc_stop (struct scc_softc *sc)
-{
- struct ifnet *ifp = &sc->arpcom.ac_if;
-
- ifp->if_flags &= ~IFF_RUNNING;
-
- /*
- * Shut down receiver and transmitter
- */
- m360.scc1.gsmr_l &= ~0x30;
-}
-
-
-/*
- * Show interface statistics
- */
-static void
-scc_stats (struct scc_softc *sc)
-{
- printf (" Rx Interrupts:%-8lu", sc->rxInterrupts);
- printf (" Not First:%-8lu", sc->rxNotFirst);
- printf (" Not Last:%-8lu\n", sc->rxNotLast);
- printf (" Giant:%-8lu", sc->rxGiant);
- printf (" Runt:%-8lu", sc->rxRunt);
- printf (" Non-octet:%-8lu\n", sc->rxNonOctet);
- printf (" Bad CRC:%-8lu", sc->rxBadCRC);
- printf (" Overrun:%-8lu", sc->rxOverrun);
- printf (" Collision:%-8lu\n", sc->rxCollision);
- printf (" Discarded:%-8lu\n", (unsigned long)m360.scc1p.un.ethernet.disfc);
-
- printf (" Tx Interrupts:%-8lu", sc->txInterrupts);
- printf (" Deferred:%-8lu", sc->txDeferred);
- printf (" Missed Hearbeat:%-8lu\n", sc->txHeartbeat);
- printf (" No Carrier:%-8lu", sc->txLostCarrier);
- printf ("Retransmit Limit:%-8lu", sc->txRetryLimit);
- printf (" Late Collision:%-8lu\n", sc->txLateCollision);
- printf (" Underrun:%-8lu", sc->txUnderrun);
- printf (" Raw output wait:%-8lu\n", sc->txRawWait);
-}
-
-/*
- * Driver ioctl handler
- */
-static int
-scc_ioctl (struct ifnet *ifp, int command, caddr_t data)
-{
- struct scc_softc *sc = ifp->if_softc;
- int error = 0;
-
- switch (command) {
- case SIOCGIFADDR:
- case SIOCSIFADDR:
- ether_ioctl (ifp, command, data);
- break;
-
- case SIOCSIFFLAGS:
- switch (ifp->if_flags & (IFF_UP | IFF_RUNNING)) {
- case IFF_RUNNING:
- scc_stop (sc);
- break;
-
- case IFF_UP:
- scc_init (sc);
- break;
-
- case IFF_UP | IFF_RUNNING:
- scc_stop (sc);
- scc_init (sc);
- break;
-
- default:
- break;
- }
- break;
-
- case SIO_RTEMS_SHOW_STATS:
- scc_stats (sc);
- break;
-
- /*
- * FIXME: All sorts of multicast commands need to be added here!
- */
- default:
- error = EINVAL;
- break;
- }
- return error;
-}
-
-/*
- * Attach an SCC driver to the system
- */
-int
-rtems_scc1_driver_attach (struct rtems_bsdnet_ifconfig *config)
-{
- struct scc_softc *sc;
- struct ifnet *ifp;
- int mtu;
- int i;
-
- /*
- * Find a free driver
- */
- for (i = 0 ; i < NSCCDRIVER ; i++) {
- sc = &scc_softc[i];
- ifp = &sc->arpcom.ac_if;
- if (ifp->if_softc == NULL)
- break;
- }
- if (i >= NSCCDRIVER) {
- printf ("Too many SCC drivers.\n");
- return 0;
- }
-
- /*
- * Process options
- */
- if (config->hardware_address) {
- memcpy (sc->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN);
- }
- else {
- /*
- * The first 4 bytes of the bootstrap prom
- * contain the value loaded into the stack
- * pointer as part of the CPU32's hardware
- * reset exception handler. The following
- * 4 bytes contain the value loaded into the
- * program counter. The boards' Ethernet
- * address is stored in the six bytes
- * immediately preceding this initial
- * program counter value.
- *
- * See start360/start360.s.
- */
- extern void *_RomBase; /* From linkcmds */
- const unsigned long *ExceptionVectors;
- const unsigned char *entryPoint;
-
- /*
- * Sanity check -- assume entry point must be
- * within 1 MByte of beginning of boot ROM.
- */
- ExceptionVectors = (const unsigned long *)&_RomBase;
- entryPoint = (const unsigned char *)ExceptionVectors[1];
- if (((unsigned long)entryPoint - (unsigned long)ExceptionVectors)
- >= (1 * 1024 * 1024)) {
- printf ("Warning -- Ethernet address can not be found in bootstrap PROM.\n");
- sc->arpcom.ac_enaddr[0] = 0x08;
- sc->arpcom.ac_enaddr[1] = 0xF3;
- sc->arpcom.ac_enaddr[2] = 0x3E;
- sc->arpcom.ac_enaddr[3] = 0xC2;
- sc->arpcom.ac_enaddr[4] = 0x7E;
- sc->arpcom.ac_enaddr[5] = 0x38;
- }
- else {
- memcpy (sc->arpcom.ac_enaddr, entryPoint - ETHER_ADDR_LEN, ETHER_ADDR_LEN);
- }
- }
- if (config->mtu)
- mtu = config->mtu;
- else
- mtu = ETHERMTU;
- if (config->rbuf_count)
- sc->rxBdCount = config->rbuf_count;
- else
- sc->rxBdCount = RX_BUF_COUNT;
- if (config->xbuf_count)
- sc->txBdCount = config->xbuf_count;
- else
- sc->txBdCount = TX_BUF_COUNT * TX_BD_PER_BUF;
- sc->acceptBroadcast = !config->ignore_broadcast;
-
- /*
- * Set up network interface values
- */
- ifp->if_softc = sc;
- ifp->if_unit = i + 1;
- ifp->if_name = "scc";
- ifp->if_mtu = mtu;
- ifp->if_init = scc_init;
- ifp->if_ioctl = scc_ioctl;
- ifp->if_start = scc_start;
- ifp->if_output = ether_output;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX;
- if (ifp->if_snd.ifq_maxlen == 0)
- ifp->if_snd.ifq_maxlen = ifqmaxlen;
-
- /*
- * Attach the interface
- */
- if_attach (ifp);
- ether_ifattach (ifp);
- return 1;
-};
diff --git a/c/src/lib/libbsp/m68k/gen68360/start/Makefile.in b/c/src/lib/libbsp/m68k/gen68360/start/Makefile.in
deleted file mode 100644
index 4d339f46fc..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/start/Makefile.in
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/start360.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start360
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
diff --git a/c/src/lib/libbsp/m68k/gen68360/start/start360.s b/c/src/lib/libbsp/m68k/gen68360/start/start360.s
deleted file mode 100644
index 2c979e294f..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/start/start360.s
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- *
- * This file contains the entry point for the application.
- * The name of this entry point is compiler dependent.
- * It jumps to the BSP which is responsible for performing
- * all initialization.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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.
- *
- * Based on the `gen68302' board support package, and covered by the
- * original distribution terms.
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-#include "asm.h"
-
-BEGIN_CODE
- /*
- * Step 1: Decide on Reset Stack Pointer and Initial Program Counter
- */
-Entry:
- .long SYM(m360)+1024 | 0: Initial SSP
- .long start | 1: Initial PC
- .long SYM(_uhoh) | 2: Bus error
- .long SYM(_uhoh) | 3: Address error
- .long SYM(_uhoh) | 4: Illegal instruction
- .long SYM(_uhoh) | 5: Zero division
- .long SYM(_uhoh) | 6: CHK, CHK2 instruction
- .long SYM(_uhoh) | 7: TRAPcc, TRAPV instructions
- .long SYM(_uhoh) | 8: Privilege violation
- .long SYM(_uhoh) | 9: Trace
- .long SYM(_uhoh) | 10: Line 1010 emulator
- .long SYM(_uhoh) | 11: Line 1111 emulator
- .long SYM(_uhoh) | 12: Hardware breakpoint
- .long SYM(_uhoh) | 13: Reserved for coprocessor violation
- .long SYM(_uhoh) | 14: Format error
- .long SYM(_uhoh) | 15: Uninitialized interrupt
- .long SYM(_uhoh) | 16: Unassigned, reserved
- .long SYM(_uhoh) | 17:
- .long SYM(_uhoh) | 18:
- .long SYM(_uhoh) | 19:
- .long SYM(_uhoh) | 20:
- .long SYM(_uhoh) | 21:
- .long SYM(_uhoh) | 22:
- .long SYM(_uhoh) | 23:
- .long SYM(_spuriousInterrupt) | 24: Spurious interrupt
- .long SYM(_uhoh) | 25: Level 1 interrupt autovector
- .long SYM(_uhoh) | 26: Level 2 interrupt autovector
- .long SYM(_uhoh) | 27: Level 3 interrupt autovector
- .long SYM(_uhoh) | 28: Level 4 interrupt autovector
- .long SYM(_uhoh) | 29: Level 5 interrupt autovector
- .long SYM(_uhoh) | 30: Level 6 interrupt autovector
- .long SYM(_uhoh) | 31: Level 7 interrupt autovector
- .long SYM(_uhoh) | 32: Trap instruction (0-15)
- .long SYM(_uhoh) | 33:
- .long SYM(_uhoh) | 34:
- .long SYM(_uhoh) | 35:
- .long SYM(_uhoh) | 36:
- .long SYM(_uhoh) | 37:
- .long SYM(_uhoh) | 38:
- .long SYM(_uhoh) | 39:
- .long SYM(_uhoh) | 40:
- .long SYM(_uhoh) | 41:
- .long SYM(_uhoh) | 42:
- .long SYM(_uhoh) | 43:
- .long SYM(_uhoh) | 44:
- .long SYM(_uhoh) | 45:
- .long SYM(_uhoh) | 46:
- .long SYM(_uhoh) | 47:
- .long SYM(_uhoh) | 48: Reserved for coprocessor
- .long SYM(_uhoh) | 49:
- .long SYM(_uhoh) | 50:
- .long SYM(_uhoh) | 51:
- .long SYM(_uhoh) | 52:
- .long SYM(_uhoh) | 53:
- .long SYM(_uhoh) | 54:
- .long SYM(_uhoh) | 55:
- .long SYM(_uhoh) | 56:
- .long SYM(_uhoh) | 57:
- .long SYM(_uhoh) | 58:
- .long SYM(_uhoh) | 59: Unassigned, reserved
- .long SYM(_uhoh) | 60:
- .long SYM(_uhoh) | 61:
- .long SYM(_uhoh) | 62:
- .long SYM(_uhoh) | 63:
- .long SYM(_uhoh) | 64: User defined vectors (192)
- .long SYM(_uhoh) | 65:
- .long SYM(_uhoh) | 66:
- .long SYM(_uhoh) | 67:
- .long SYM(_uhoh) | 68:
- .long SYM(_uhoh) | 69:
- .long SYM(_uhoh) | 70:
- .long SYM(_uhoh) | 71:
- .long SYM(_uhoh) | 72:
- .long SYM(_uhoh) | 73:
- .long SYM(_uhoh) | 74:
- .long SYM(_uhoh) | 75:
- .long SYM(_uhoh) | 76:
- .long SYM(_uhoh) | 77:
- .long SYM(_uhoh) | 78:
- .long SYM(_uhoh) | 79:
- .long SYM(_uhoh) | 80:
- .long SYM(_uhoh) | 81:
- .long SYM(_uhoh) | 82:
- .long SYM(_uhoh) | 83:
- .long SYM(_uhoh) | 84:
- .long SYM(_uhoh) | 85:
- .long SYM(_uhoh) | 86:
- .long SYM(_uhoh) | 87:
- .long SYM(_uhoh) | 88:
- .long SYM(_uhoh) | 89:
- .long SYM(_uhoh) | 90:
- .long SYM(_uhoh) | 91:
- .long SYM(_uhoh) | 92:
- .long SYM(_uhoh) | 93:
- .long SYM(_uhoh) | 94:
- .long SYM(_uhoh) | 95:
- .long SYM(_uhoh) | 96:
- .long SYM(_uhoh) | 97:
- .long SYM(_uhoh) | 98:
- .long SYM(_uhoh) | 99:
- .long SYM(_uhoh) | 100:
- .long SYM(_uhoh) | 101:
- .long SYM(_uhoh) | 102:
- .long SYM(_uhoh) | 103:
- .long SYM(_uhoh) | 104:
- .long SYM(_uhoh) | 105:
- .long SYM(_uhoh) | 106:
- .long SYM(_uhoh) | 107:
- .long SYM(_uhoh) | 108:
- .long SYM(_uhoh) | 109:
- .long SYM(_uhoh) | 110:
- .long SYM(_uhoh) | 111:
- .long SYM(_uhoh) | 112:
- .long SYM(_uhoh) | 113:
- .long SYM(_uhoh) | 114:
- .long SYM(_uhoh) | 115:
- .long SYM(_uhoh) | 116:
- .long SYM(_uhoh) | 117:
- .long SYM(_uhoh) | 118:
- .long SYM(_uhoh) | 119:
- .long SYM(_uhoh) | 120:
- .long SYM(_uhoh) | 121:
- .long SYM(_uhoh) | 122:
- .long SYM(_uhoh) | 123:
- .long SYM(_uhoh) | 124:
- .long SYM(_uhoh) | 125:
- .long SYM(_uhoh) | 126:
- .long SYM(_uhoh) | 127:
- .long SYM(_uhoh) | 128:
- .long SYM(_uhoh) | 129:
- .long SYM(_uhoh) | 130:
- .long SYM(_uhoh) | 131:
- .long SYM(_uhoh) | 132:
- .long SYM(_uhoh) | 133:
- .long SYM(_uhoh) | 134:
- .long SYM(_uhoh) | 135:
- .long SYM(_uhoh) | 136:
- .long SYM(_uhoh) | 137:
- .long SYM(_uhoh) | 138:
- .long SYM(_uhoh) | 139:
- .long SYM(_uhoh) | 140:
- .long SYM(_uhoh) | 141:
- .long SYM(_uhoh) | 142:
- .long SYM(_uhoh) | 143:
- .long SYM(_uhoh) | 144:
- .long SYM(_uhoh) | 145:
- .long SYM(_uhoh) | 146:
- .long SYM(_uhoh) | 147:
- .long SYM(_uhoh) | 148:
- .long SYM(_uhoh) | 149:
- .long SYM(_uhoh) | 150:
- .long SYM(_uhoh) | 151:
- .long SYM(_uhoh) | 152:
- .long SYM(_uhoh) | 153:
- .long SYM(_uhoh) | 154:
- .long SYM(_uhoh) | 155:
- .long SYM(_uhoh) | 156:
- .long SYM(_uhoh) | 157:
- .long SYM(_uhoh) | 158:
- .long SYM(_uhoh) | 159:
- .long SYM(_uhoh) | 160:
- .long SYM(_uhoh) | 161:
- .long SYM(_uhoh) | 162:
- .long SYM(_uhoh) | 163:
- .long SYM(_uhoh) | 164:
- .long SYM(_uhoh) | 165:
- .long SYM(_uhoh) | 166:
- .long SYM(_uhoh) | 167:
- .long SYM(_uhoh) | 168:
- .long SYM(_uhoh) | 169:
- .long SYM(_uhoh) | 170:
- .long SYM(_uhoh) | 171:
- .long SYM(_uhoh) | 172:
- .long SYM(_uhoh) | 173:
- .long SYM(_uhoh) | 174:
- .long SYM(_uhoh) | 175:
- .long SYM(_uhoh) | 176:
- .long SYM(_uhoh) | 177:
- .long SYM(_uhoh) | 178:
- .long SYM(_uhoh) | 179:
- .long SYM(_uhoh) | 180:
- .long SYM(_uhoh) | 181:
- .long SYM(_uhoh) | 182:
- .long SYM(_uhoh) | 183:
- .long SYM(_uhoh) | 184:
- .long SYM(_uhoh) | 185:
- .long SYM(_uhoh) | 186:
- .long SYM(_uhoh) | 187:
- .long SYM(_uhoh) | 188:
- .long SYM(_uhoh) | 189:
- .long SYM(_uhoh) | 190:
- .long SYM(_uhoh) | 191:
- .long SYM(_uhoh) | 192:
- .long SYM(_uhoh) | 193:
- .long SYM(_uhoh) | 194:
- .long SYM(_uhoh) | 195:
- .long SYM(_uhoh) | 196:
- .long SYM(_uhoh) | 197:
- .long SYM(_uhoh) | 198:
- .long SYM(_uhoh) | 199:
- .long SYM(_uhoh) | 200:
- .long SYM(_uhoh) | 201:
- .long SYM(_uhoh) | 202:
- .long SYM(_uhoh) | 203:
- .long SYM(_uhoh) | 204:
- .long SYM(_uhoh) | 205:
- .long SYM(_uhoh) | 206:
- .long SYM(_uhoh) | 207:
- .long SYM(_uhoh) | 208:
- .long SYM(_uhoh) | 209:
- .long SYM(_uhoh) | 210:
- .long SYM(_uhoh) | 211:
- .long SYM(_uhoh) | 212:
- .long SYM(_uhoh) | 213:
- .long SYM(_uhoh) | 214:
- .long SYM(_uhoh) | 215:
- .long SYM(_uhoh) | 216:
- .long SYM(_uhoh) | 217:
- .long SYM(_uhoh) | 218:
- .long SYM(_uhoh) | 219:
- .long SYM(_uhoh) | 220:
- .long SYM(_uhoh) | 221:
- .long SYM(_uhoh) | 222:
- .long SYM(_uhoh) | 223:
- .long SYM(_uhoh) | 224:
- .long SYM(_uhoh) | 225:
- .long SYM(_uhoh) | 226:
- .long SYM(_uhoh) | 227:
- .long SYM(_uhoh) | 228:
- .long SYM(_uhoh) | 229:
- .long SYM(_uhoh) | 230:
- .long SYM(_uhoh) | 231:
- .long SYM(_uhoh) | 232:
- .long SYM(_uhoh) | 233:
- .long SYM(_uhoh) | 234:
- .long SYM(_uhoh) | 235:
- .long SYM(_uhoh) | 236:
- .long SYM(_uhoh) | 237:
- .long SYM(_uhoh) | 238:
- .long SYM(_uhoh) | 239:
- .long SYM(_uhoh) | 240:
- .long SYM(_uhoh) | 241:
- .long SYM(_uhoh) | 242:
- .long SYM(_uhoh) | 243:
- .long SYM(_uhoh) | 244:
- .long SYM(_uhoh) | 245:
- .long SYM(_uhoh) | 246:
- .long SYM(_uhoh) | 247:
- .long SYM(_uhoh) | 248:
- .long SYM(_uhoh) | 249:
- .long SYM(_uhoh) | 250:
- .long SYM(_uhoh) | 251:
- .long SYM(_uhoh) | 252:
- .long SYM(_uhoh) | 253:
- .long SYM(_uhoh) | 254:
- .long SYM(_uhoh) | 255:
-
-/*
- * Default trap handler
- * With an oscilloscope you can see AS* stop
- */
- PUBLIC (_uhoh)
-SYM(_uhoh): nop | Leave spot for breakpoint
- stop #0x2700 | Stop with interrupts disabled
- bra.s SYM(_uhoh) | Stuck forever
-
-/*
- * Log, but otherwise ignore, spurious interrupts
- */
- PUBLIC (_spuriousInterrupt)
-SYM(_spuriousInterrupt):
- addql #1,SYM(_M68kSpuriousInterruptCount)
- rte
-
-/*
- * Place the low-order 3 octets of the board's ethernet address at
- * a `well-known' fixed location relative to the startup location.
- */
- .align 2
- .word 0 | Padding
-ethernet_address_buffer:
- .word 0x08F3 | Default address
- .word 0xDEAD
- .word 0xCAFE
-
-/*
- * Initial PC
- */
-.globl start
-start:
- /*
- * Step 2: Stay in Supervisor Mode
- */
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
- oriw #0x3000,sr | Switch to Master Stack Pointer
- lea SYM(m360)+1024-64,a7 | Put stack in dual-port ram
- | a little below the interrupt stack
-#endif
-
- /*
- * Step 3: Write the VBR
- */
- lea Entry,a0 | Get base of vector table
- movec a0,vbr | Set up the VBR
-
- /*
- * Step 4: Write the MBAR
- */
- movec dfc,d1 | Save destination register
- moveq #7,d0 | CPU-space funcction code
- movec d0,dfc | Set destination function code register
- movel #SYM(m360)+0x101,d0 | MBAR value (mask CPU space accesses)
- movesl d0,0x3FF00 | Set MBAR
- movec d1,dfc | Restore destination register
-
- /*
- * Step 5: Verify a dual-port RAM location
- */
- lea SYM(m360),a0 | Point a0 to first DPRAM location
- moveb #0x33,d0 | Set the test value
- moveb d0,a0@ | Set the memory location
- cmpb a0@,d0 | Does it read back?
- bne SYM(_uhoh) | If not, bad news!
- notb d0 | Flip bits
- moveb d0,a0@ | Set the memory location
- cmpb a0@,d0 | Does it read back?
- bne SYM(_uhoh) | If not, bad news!
-
- /*
- * Remaining steps are handled by C code
- */
- jmp SYM(_Init68360) | Start C code (which never returns)
-
-/*
- * Copy DATA segment, clear BSS segment, set up real stack,
- * initialize heap, start C program.
- * Assume that DATA and BSS sizes are multiples of 4.
- */
- PUBLIC (_CopyDataClearBSSAndStart)
-SYM(_CopyDataClearBSSAndStart):
- lea copy_start,a0 | Get start of DATA in RAM
- lea SYM(etext),a2 | Get start of DATA in ROM
- cmpl a0,a2 | Are they the same?
- beq.s NOCOPY | Yes, no copy necessary
- lea copy_end,a1 | Get end of DATA in RAM
- bra.s COPYLOOPTEST | Branch into copy loop
-COPYLOOP:
- movel a2@+,a0@+ | Copy word from ROM to RAM
-COPYLOOPTEST:
- cmpl a1,a0 | Done?
- bcs.s COPYLOOP | No, skip
-NOCOPY:
-
- lea clear_start,a0 | Get start of BSS
- lea clear_end,a1 | Get end of BSS
- clrl d0 | Value to set
- bra.s ZEROLOOPTEST | Branch into clear loop
-ZEROLOOP:
- movel d0,a0@+ | Clear a word
-ZEROLOOPTEST:
- cmpl a1,a0 | Done?
- bcs.s ZEROLOOP | No, skip
-
- movel #stack_init,a7 | set master stack pointer
- movel d0,a7@- | environp
- movel d0,a7@- | argv
- movel d0,a7@- | argc
- jsr SYM(boot_card) | Call C main
-
- PUBLIC (_mainDone)
-SYM(_mainDone):
- nop | Leave spot for breakpoint
- movew #1,a7 | Force a double bus error
- movel d0,a7@- | This should cause a RESET
- stop #0x2700 | Stop with interrupts disabled
- bra.s SYM(_mainDone) | Stuck forever
-
- .align 2
- PUBLIC (_HeapSize)
-SYM (_HeapSize):
- .long HeapSize
- PUBLIC (_StackSize)
-SYM (_StackSize):
- .long StackSize
-END_CODE
-
-BEGIN_DATA_DCL
- .align 2
- PUBLIC (environ)
-SYM (environ):
- .long 0
- PUBLIC (_M68kSpuriousInterruptCount)
-SYM (_M68kSpuriousInterruptCount):
- .long 0
-END_DATA_DCL
-
-END
-
diff --git a/c/src/lib/libbsp/m68k/gen68360/start360/Makefile.in b/c/src/lib/libbsp/m68k/gen68360/start360/Makefile.in
deleted file mode 100644
index 4d339f46fc..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/start360/Makefile.in
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/start360.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start360
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
diff --git a/c/src/lib/libbsp/m68k/gen68360/start360/start360.s b/c/src/lib/libbsp/m68k/gen68360/start360/start360.s
deleted file mode 100644
index 2c979e294f..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/start360/start360.s
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- *
- * This file contains the entry point for the application.
- * The name of this entry point is compiler dependent.
- * It jumps to the BSP which is responsible for performing
- * all initialization.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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.
- *
- * Based on the `gen68302' board support package, and covered by the
- * original distribution terms.
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-#include "asm.h"
-
-BEGIN_CODE
- /*
- * Step 1: Decide on Reset Stack Pointer and Initial Program Counter
- */
-Entry:
- .long SYM(m360)+1024 | 0: Initial SSP
- .long start | 1: Initial PC
- .long SYM(_uhoh) | 2: Bus error
- .long SYM(_uhoh) | 3: Address error
- .long SYM(_uhoh) | 4: Illegal instruction
- .long SYM(_uhoh) | 5: Zero division
- .long SYM(_uhoh) | 6: CHK, CHK2 instruction
- .long SYM(_uhoh) | 7: TRAPcc, TRAPV instructions
- .long SYM(_uhoh) | 8: Privilege violation
- .long SYM(_uhoh) | 9: Trace
- .long SYM(_uhoh) | 10: Line 1010 emulator
- .long SYM(_uhoh) | 11: Line 1111 emulator
- .long SYM(_uhoh) | 12: Hardware breakpoint
- .long SYM(_uhoh) | 13: Reserved for coprocessor violation
- .long SYM(_uhoh) | 14: Format error
- .long SYM(_uhoh) | 15: Uninitialized interrupt
- .long SYM(_uhoh) | 16: Unassigned, reserved
- .long SYM(_uhoh) | 17:
- .long SYM(_uhoh) | 18:
- .long SYM(_uhoh) | 19:
- .long SYM(_uhoh) | 20:
- .long SYM(_uhoh) | 21:
- .long SYM(_uhoh) | 22:
- .long SYM(_uhoh) | 23:
- .long SYM(_spuriousInterrupt) | 24: Spurious interrupt
- .long SYM(_uhoh) | 25: Level 1 interrupt autovector
- .long SYM(_uhoh) | 26: Level 2 interrupt autovector
- .long SYM(_uhoh) | 27: Level 3 interrupt autovector
- .long SYM(_uhoh) | 28: Level 4 interrupt autovector
- .long SYM(_uhoh) | 29: Level 5 interrupt autovector
- .long SYM(_uhoh) | 30: Level 6 interrupt autovector
- .long SYM(_uhoh) | 31: Level 7 interrupt autovector
- .long SYM(_uhoh) | 32: Trap instruction (0-15)
- .long SYM(_uhoh) | 33:
- .long SYM(_uhoh) | 34:
- .long SYM(_uhoh) | 35:
- .long SYM(_uhoh) | 36:
- .long SYM(_uhoh) | 37:
- .long SYM(_uhoh) | 38:
- .long SYM(_uhoh) | 39:
- .long SYM(_uhoh) | 40:
- .long SYM(_uhoh) | 41:
- .long SYM(_uhoh) | 42:
- .long SYM(_uhoh) | 43:
- .long SYM(_uhoh) | 44:
- .long SYM(_uhoh) | 45:
- .long SYM(_uhoh) | 46:
- .long SYM(_uhoh) | 47:
- .long SYM(_uhoh) | 48: Reserved for coprocessor
- .long SYM(_uhoh) | 49:
- .long SYM(_uhoh) | 50:
- .long SYM(_uhoh) | 51:
- .long SYM(_uhoh) | 52:
- .long SYM(_uhoh) | 53:
- .long SYM(_uhoh) | 54:
- .long SYM(_uhoh) | 55:
- .long SYM(_uhoh) | 56:
- .long SYM(_uhoh) | 57:
- .long SYM(_uhoh) | 58:
- .long SYM(_uhoh) | 59: Unassigned, reserved
- .long SYM(_uhoh) | 60:
- .long SYM(_uhoh) | 61:
- .long SYM(_uhoh) | 62:
- .long SYM(_uhoh) | 63:
- .long SYM(_uhoh) | 64: User defined vectors (192)
- .long SYM(_uhoh) | 65:
- .long SYM(_uhoh) | 66:
- .long SYM(_uhoh) | 67:
- .long SYM(_uhoh) | 68:
- .long SYM(_uhoh) | 69:
- .long SYM(_uhoh) | 70:
- .long SYM(_uhoh) | 71:
- .long SYM(_uhoh) | 72:
- .long SYM(_uhoh) | 73:
- .long SYM(_uhoh) | 74:
- .long SYM(_uhoh) | 75:
- .long SYM(_uhoh) | 76:
- .long SYM(_uhoh) | 77:
- .long SYM(_uhoh) | 78:
- .long SYM(_uhoh) | 79:
- .long SYM(_uhoh) | 80:
- .long SYM(_uhoh) | 81:
- .long SYM(_uhoh) | 82:
- .long SYM(_uhoh) | 83:
- .long SYM(_uhoh) | 84:
- .long SYM(_uhoh) | 85:
- .long SYM(_uhoh) | 86:
- .long SYM(_uhoh) | 87:
- .long SYM(_uhoh) | 88:
- .long SYM(_uhoh) | 89:
- .long SYM(_uhoh) | 90:
- .long SYM(_uhoh) | 91:
- .long SYM(_uhoh) | 92:
- .long SYM(_uhoh) | 93:
- .long SYM(_uhoh) | 94:
- .long SYM(_uhoh) | 95:
- .long SYM(_uhoh) | 96:
- .long SYM(_uhoh) | 97:
- .long SYM(_uhoh) | 98:
- .long SYM(_uhoh) | 99:
- .long SYM(_uhoh) | 100:
- .long SYM(_uhoh) | 101:
- .long SYM(_uhoh) | 102:
- .long SYM(_uhoh) | 103:
- .long SYM(_uhoh) | 104:
- .long SYM(_uhoh) | 105:
- .long SYM(_uhoh) | 106:
- .long SYM(_uhoh) | 107:
- .long SYM(_uhoh) | 108:
- .long SYM(_uhoh) | 109:
- .long SYM(_uhoh) | 110:
- .long SYM(_uhoh) | 111:
- .long SYM(_uhoh) | 112:
- .long SYM(_uhoh) | 113:
- .long SYM(_uhoh) | 114:
- .long SYM(_uhoh) | 115:
- .long SYM(_uhoh) | 116:
- .long SYM(_uhoh) | 117:
- .long SYM(_uhoh) | 118:
- .long SYM(_uhoh) | 119:
- .long SYM(_uhoh) | 120:
- .long SYM(_uhoh) | 121:
- .long SYM(_uhoh) | 122:
- .long SYM(_uhoh) | 123:
- .long SYM(_uhoh) | 124:
- .long SYM(_uhoh) | 125:
- .long SYM(_uhoh) | 126:
- .long SYM(_uhoh) | 127:
- .long SYM(_uhoh) | 128:
- .long SYM(_uhoh) | 129:
- .long SYM(_uhoh) | 130:
- .long SYM(_uhoh) | 131:
- .long SYM(_uhoh) | 132:
- .long SYM(_uhoh) | 133:
- .long SYM(_uhoh) | 134:
- .long SYM(_uhoh) | 135:
- .long SYM(_uhoh) | 136:
- .long SYM(_uhoh) | 137:
- .long SYM(_uhoh) | 138:
- .long SYM(_uhoh) | 139:
- .long SYM(_uhoh) | 140:
- .long SYM(_uhoh) | 141:
- .long SYM(_uhoh) | 142:
- .long SYM(_uhoh) | 143:
- .long SYM(_uhoh) | 144:
- .long SYM(_uhoh) | 145:
- .long SYM(_uhoh) | 146:
- .long SYM(_uhoh) | 147:
- .long SYM(_uhoh) | 148:
- .long SYM(_uhoh) | 149:
- .long SYM(_uhoh) | 150:
- .long SYM(_uhoh) | 151:
- .long SYM(_uhoh) | 152:
- .long SYM(_uhoh) | 153:
- .long SYM(_uhoh) | 154:
- .long SYM(_uhoh) | 155:
- .long SYM(_uhoh) | 156:
- .long SYM(_uhoh) | 157:
- .long SYM(_uhoh) | 158:
- .long SYM(_uhoh) | 159:
- .long SYM(_uhoh) | 160:
- .long SYM(_uhoh) | 161:
- .long SYM(_uhoh) | 162:
- .long SYM(_uhoh) | 163:
- .long SYM(_uhoh) | 164:
- .long SYM(_uhoh) | 165:
- .long SYM(_uhoh) | 166:
- .long SYM(_uhoh) | 167:
- .long SYM(_uhoh) | 168:
- .long SYM(_uhoh) | 169:
- .long SYM(_uhoh) | 170:
- .long SYM(_uhoh) | 171:
- .long SYM(_uhoh) | 172:
- .long SYM(_uhoh) | 173:
- .long SYM(_uhoh) | 174:
- .long SYM(_uhoh) | 175:
- .long SYM(_uhoh) | 176:
- .long SYM(_uhoh) | 177:
- .long SYM(_uhoh) | 178:
- .long SYM(_uhoh) | 179:
- .long SYM(_uhoh) | 180:
- .long SYM(_uhoh) | 181:
- .long SYM(_uhoh) | 182:
- .long SYM(_uhoh) | 183:
- .long SYM(_uhoh) | 184:
- .long SYM(_uhoh) | 185:
- .long SYM(_uhoh) | 186:
- .long SYM(_uhoh) | 187:
- .long SYM(_uhoh) | 188:
- .long SYM(_uhoh) | 189:
- .long SYM(_uhoh) | 190:
- .long SYM(_uhoh) | 191:
- .long SYM(_uhoh) | 192:
- .long SYM(_uhoh) | 193:
- .long SYM(_uhoh) | 194:
- .long SYM(_uhoh) | 195:
- .long SYM(_uhoh) | 196:
- .long SYM(_uhoh) | 197:
- .long SYM(_uhoh) | 198:
- .long SYM(_uhoh) | 199:
- .long SYM(_uhoh) | 200:
- .long SYM(_uhoh) | 201:
- .long SYM(_uhoh) | 202:
- .long SYM(_uhoh) | 203:
- .long SYM(_uhoh) | 204:
- .long SYM(_uhoh) | 205:
- .long SYM(_uhoh) | 206:
- .long SYM(_uhoh) | 207:
- .long SYM(_uhoh) | 208:
- .long SYM(_uhoh) | 209:
- .long SYM(_uhoh) | 210:
- .long SYM(_uhoh) | 211:
- .long SYM(_uhoh) | 212:
- .long SYM(_uhoh) | 213:
- .long SYM(_uhoh) | 214:
- .long SYM(_uhoh) | 215:
- .long SYM(_uhoh) | 216:
- .long SYM(_uhoh) | 217:
- .long SYM(_uhoh) | 218:
- .long SYM(_uhoh) | 219:
- .long SYM(_uhoh) | 220:
- .long SYM(_uhoh) | 221:
- .long SYM(_uhoh) | 222:
- .long SYM(_uhoh) | 223:
- .long SYM(_uhoh) | 224:
- .long SYM(_uhoh) | 225:
- .long SYM(_uhoh) | 226:
- .long SYM(_uhoh) | 227:
- .long SYM(_uhoh) | 228:
- .long SYM(_uhoh) | 229:
- .long SYM(_uhoh) | 230:
- .long SYM(_uhoh) | 231:
- .long SYM(_uhoh) | 232:
- .long SYM(_uhoh) | 233:
- .long SYM(_uhoh) | 234:
- .long SYM(_uhoh) | 235:
- .long SYM(_uhoh) | 236:
- .long SYM(_uhoh) | 237:
- .long SYM(_uhoh) | 238:
- .long SYM(_uhoh) | 239:
- .long SYM(_uhoh) | 240:
- .long SYM(_uhoh) | 241:
- .long SYM(_uhoh) | 242:
- .long SYM(_uhoh) | 243:
- .long SYM(_uhoh) | 244:
- .long SYM(_uhoh) | 245:
- .long SYM(_uhoh) | 246:
- .long SYM(_uhoh) | 247:
- .long SYM(_uhoh) | 248:
- .long SYM(_uhoh) | 249:
- .long SYM(_uhoh) | 250:
- .long SYM(_uhoh) | 251:
- .long SYM(_uhoh) | 252:
- .long SYM(_uhoh) | 253:
- .long SYM(_uhoh) | 254:
- .long SYM(_uhoh) | 255:
-
-/*
- * Default trap handler
- * With an oscilloscope you can see AS* stop
- */
- PUBLIC (_uhoh)
-SYM(_uhoh): nop | Leave spot for breakpoint
- stop #0x2700 | Stop with interrupts disabled
- bra.s SYM(_uhoh) | Stuck forever
-
-/*
- * Log, but otherwise ignore, spurious interrupts
- */
- PUBLIC (_spuriousInterrupt)
-SYM(_spuriousInterrupt):
- addql #1,SYM(_M68kSpuriousInterruptCount)
- rte
-
-/*
- * Place the low-order 3 octets of the board's ethernet address at
- * a `well-known' fixed location relative to the startup location.
- */
- .align 2
- .word 0 | Padding
-ethernet_address_buffer:
- .word 0x08F3 | Default address
- .word 0xDEAD
- .word 0xCAFE
-
-/*
- * Initial PC
- */
-.globl start
-start:
- /*
- * Step 2: Stay in Supervisor Mode
- */
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
- oriw #0x3000,sr | Switch to Master Stack Pointer
- lea SYM(m360)+1024-64,a7 | Put stack in dual-port ram
- | a little below the interrupt stack
-#endif
-
- /*
- * Step 3: Write the VBR
- */
- lea Entry,a0 | Get base of vector table
- movec a0,vbr | Set up the VBR
-
- /*
- * Step 4: Write the MBAR
- */
- movec dfc,d1 | Save destination register
- moveq #7,d0 | CPU-space funcction code
- movec d0,dfc | Set destination function code register
- movel #SYM(m360)+0x101,d0 | MBAR value (mask CPU space accesses)
- movesl d0,0x3FF00 | Set MBAR
- movec d1,dfc | Restore destination register
-
- /*
- * Step 5: Verify a dual-port RAM location
- */
- lea SYM(m360),a0 | Point a0 to first DPRAM location
- moveb #0x33,d0 | Set the test value
- moveb d0,a0@ | Set the memory location
- cmpb a0@,d0 | Does it read back?
- bne SYM(_uhoh) | If not, bad news!
- notb d0 | Flip bits
- moveb d0,a0@ | Set the memory location
- cmpb a0@,d0 | Does it read back?
- bne SYM(_uhoh) | If not, bad news!
-
- /*
- * Remaining steps are handled by C code
- */
- jmp SYM(_Init68360) | Start C code (which never returns)
-
-/*
- * Copy DATA segment, clear BSS segment, set up real stack,
- * initialize heap, start C program.
- * Assume that DATA and BSS sizes are multiples of 4.
- */
- PUBLIC (_CopyDataClearBSSAndStart)
-SYM(_CopyDataClearBSSAndStart):
- lea copy_start,a0 | Get start of DATA in RAM
- lea SYM(etext),a2 | Get start of DATA in ROM
- cmpl a0,a2 | Are they the same?
- beq.s NOCOPY | Yes, no copy necessary
- lea copy_end,a1 | Get end of DATA in RAM
- bra.s COPYLOOPTEST | Branch into copy loop
-COPYLOOP:
- movel a2@+,a0@+ | Copy word from ROM to RAM
-COPYLOOPTEST:
- cmpl a1,a0 | Done?
- bcs.s COPYLOOP | No, skip
-NOCOPY:
-
- lea clear_start,a0 | Get start of BSS
- lea clear_end,a1 | Get end of BSS
- clrl d0 | Value to set
- bra.s ZEROLOOPTEST | Branch into clear loop
-ZEROLOOP:
- movel d0,a0@+ | Clear a word
-ZEROLOOPTEST:
- cmpl a1,a0 | Done?
- bcs.s ZEROLOOP | No, skip
-
- movel #stack_init,a7 | set master stack pointer
- movel d0,a7@- | environp
- movel d0,a7@- | argv
- movel d0,a7@- | argc
- jsr SYM(boot_card) | Call C main
-
- PUBLIC (_mainDone)
-SYM(_mainDone):
- nop | Leave spot for breakpoint
- movew #1,a7 | Force a double bus error
- movel d0,a7@- | This should cause a RESET
- stop #0x2700 | Stop with interrupts disabled
- bra.s SYM(_mainDone) | Stuck forever
-
- .align 2
- PUBLIC (_HeapSize)
-SYM (_HeapSize):
- .long HeapSize
- PUBLIC (_StackSize)
-SYM (_StackSize):
- .long StackSize
-END_CODE
-
-BEGIN_DATA_DCL
- .align 2
- PUBLIC (environ)
-SYM (environ):
- .long 0
- PUBLIC (_M68kSpuriousInterruptCount)
-SYM (_M68kSpuriousInterruptCount):
- .long 0
-END_DATA_DCL
-
-END
-
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/Makefile.in b/c/src/lib/libbsp/m68k/gen68360/startup/Makefile.in
deleted file mode 100644
index bebda1d445..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/startup/Makefile.in
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=alloc360 bspclean bsplibc bsppost bspstart init68360 main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(srcdir)/linkcmds $(srcdir)/linkcmds.prom $(srcdir)/linkcmds.bootp \
- $(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds $(srcdir)/linkcmds.prom ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/alloc360.c b/c/src/lib/libbsp/m68k/gen68360/startup/alloc360.c
deleted file mode 100644
index 99bfb3352e..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/startup/alloc360.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * MC68360 buffer descriptor allocation routines
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <m68360.h>
-#include <rtems/error.h>
-
-/*
- * Allocation order:
- * - Dual-Port RAM section 1
- * - Dual-Port RAM section 3
- * - Dual-Port RAM section 0
- * - Dual-Port RAM section 2
- */
-static struct {
- char *base;
- unsigned int size;
- unsigned int used;
-} bdregions[] = {
- { (char *)&m360.dpram1[0], sizeof m360.dpram1, 0 },
- { (char *)&m360.dpram3[0], sizeof m360.dpram3, 0 },
- { (char *)&m360.dpram0[0], sizeof m360.dpram0, 0 },
- { (char *)&m360.dpram2[0], sizeof m360.dpram2, 0 },
-};
-
-/*
- * Send a command to the CPM RISC processer
- */
-void *
-M360AllocateBufferDescriptors (int count)
-{
- unsigned int i;
- ISR_Level level;
- void *bdp = NULL;
- unsigned int want = count * sizeof(m360BufferDescriptor_t);
-
- /*
- * Running with interrupts disabled is usually considered bad
- * form, but this routine is probably being run as part of an
- * initialization sequence so the effect shouldn't be too severe.
- */
- _ISR_Disable (level);
- for (i = 0 ; i < sizeof(bdregions) / sizeof(bdregions[0]) ; i++) {
- /*
- * Verify that the region exists.
- * This test is necessary since some chips have
- * less dual-port RAM.
- */
- if (bdregions[i].used == 0) {
- volatile unsigned char *cp = bdregions[i].base;
- *cp = 0xAA;
- if (*cp != 0xAA) {
- bdregions[i].used = bdregions[i].size;
- continue;
- }
- *cp = 0x55;
- if (*cp != 0x55) {
- bdregions[i].used = bdregions[i].size;
- continue;
- }
- *cp = 0x0;
- }
- if (bdregions[i].size - bdregions[i].used >= want) {
- bdp = bdregions[i].base + bdregions[i].used;
- bdregions[i].used += want;
- break;
- }
- }
- _ISR_Enable (level);
- if (bdp == NULL)
- rtems_panic ("Can't allocate %d buffer descriptor(s).\n", count);
- return bdp;
-}
-
-void *
-M360AllocateRiscTimers (int count)
-{
- /*
- * Convert the count to the number of buffer descriptors
- * of equal or larger size. This ensures that all buffer
- * descriptors are allocated with appropriate alignment.
- */
- return M360AllocateBufferDescriptors (((count * 4) +
- sizeof(m360BufferDescriptor_t) - 1) /
- sizeof(m360BufferDescriptor_t));
-}
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/bspclean.c b/c/src/lib/libbsp/m68k/gen68360/startup/bspclean.c
deleted file mode 100644
index 66f6531b84..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/startup/bspclean.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine normally is part of start.s and usually returns
- * control to a monitor.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-void bsp_cleanup( void )
-{
- /* Cause double bus fault to force reset? */
-}
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c b/c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c
deleted file mode 100644
index f0e5f427d4..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern void *_HeapStart;
- extern rtems_unsigned32 _HeapSize;
-
- bsp_libc_init(&_HeapStart, _HeapSize, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- extern void *_WorkspaceBase;
-
- /*
- * Allocate the memory for the RTEMS Work Space. This can come from
- * a variety of places: hard coded address, malloc'ed from outside
- * RTEMS world (e.g. simulator or primitive memory manager), or (as
- * typically done by stock BSPs) by subtracting the required amount
- * of work space from the last physical address on the CPU board.
- */
-#if 0
- Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/;
-#endif
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
-
- BSP_Configuration.work_space_start = (void *)&_WorkspaceBase;
-
- /*
- * Account for the console's resources
- */
-
- console_reserve_resources( &BSP_Configuration );
-
- /*
- * initialize the CPU table for this BSP
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.do_zero_of_workspace = TRUE;
- Cpu_table.interrupt_stack_size = 4096;
-}
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/init68360.c b/c/src/lib/libbsp/m68k/gen68360/startup/init68360.c
deleted file mode 100644
index a104951db0..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/startup/init68360.c
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
- * MC68360 support routines
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <m68360.h>
-
-/*
- * Send a command to the CPM RISC processer
- */
-
-void M360ExecuteRISC(rtems_unsigned16 command)
-{
- rtems_unsigned16 sr;
-
- m68k_disable_interrupts (sr);
- while (m360.cr & M360_CR_FLG)
- continue;
- m360.cr = command | M360_CR_FLG;
- m68k_enable_interrupts (sr);
-}
-
-/*
- * Initialize MC68360
- */
-void _Init68360 (void)
-{
- int i;
- m68k_isr_entry *vbr;
- extern void _CopyDataClearBSSAndStart (void);
-
-#if (defined (__mc68040__))
- /*
- *******************************************
- * Motorola 68040 and companion-mode 68360 *
- *******************************************
- */
-
- /*
- * Step 6: Is this a power-up reset?
- * For now we just ignore this and do *all* the steps
- * Someday we might want to:
- * if (Hard, Loss of Clock, Power-up)
- * Do all steps
- * else if (Double bus fault, watchdog or soft reset)
- * Skip to step 12
- * else (must be a reset command)
- * Skip to step 14
- */
-
- /*
- * Step 7: Deal with clock synthesizer
- * HARDWARE:
- * Change if you're not using an external 25 MHz oscillator.
- */
- m360.clkocr = 0x83; /* No more writes, full-power CLKO2 */
- m360.pllcr = 0xD000; /* PLL, no writes, no prescale,
- no LPSTOP slowdown, PLL X1 */
- m360.cdvcr = 0x8000; /* No more writes, no clock division */
-
- /*
- * Step 8: Initialize system protection
- * Enable watchdog
- * Watchdog causes system reset
- * Next-to-slowest watchdog timeout (21 seconds with 25 MHz oscillator)
- * Enable double bus fault monitor
- * Enable bus monitor for external cycles
- * 1024 clocks for external timeout
- */
- m360.sypcr = 0xEC;
-
- /*
- * Step 9: Clear parameter RAM and reset communication processor module
- */
- for (i = 0 ; i < 192 ; i += sizeof (long)) {
- *((long *)((char *)&m360 + 0xC00 + i)) = 0;
- *((long *)((char *)&m360 + 0xD00 + i)) = 0;
- *((long *)((char *)&m360 + 0xE00 + i)) = 0;
- *((long *)((char *)&m360 + 0xF00 + i)) = 0;
- }
- M360ExecuteRISC (M360_CR_RST);
-
- /*
- * Step 10: Write PEPAR
- * SINTOUT standard M68000 family interrupt level encoding
- * CF1MODE=10 (BCLRO* output)
- * No RAS1* double drive
- * A31 - A28
- * AMUX output
- * CAS2* - CAS3*
- * CAS0* - CAS1*
- * CS7*
- * AVEC*
- */
- m360.pepar = 0x3440;
-
- /*
- * Step 11: Remap Chip Select 0 (CS0*), set up GMR
- */
- /*
- * 512 addresses per DRAM page (256K DRAM chips)
- * 70 nsec DRAM
- * 180 nsec ROM (3 wait states)
- */
- m360.gmr = M360_GMR_RCNT(23) | M360_GMR_RFEN |
- M360_GMR_RCYC(0) | M360_GMR_PGS(1) |
- M360_GMR_DPS_32BIT | M360_GMR_NCS |
- M360_GMR_TSS40;
- m360.memc[0].br = (unsigned long)&_RomBase | M360_MEMC_BR_WP |
- M360_MEMC_BR_V;
- m360.memc[0].or = M360_MEMC_OR_WAITS(3) | M360_MEMC_OR_1MB |
- M360_MEMC_OR_32BIT;
-
- /*
- * Step 12: Initialize the system RAM
- */
- /*
- * Set up option/base registers
- * 1M DRAM
- * 70 nsec DRAM
- * Enable burst mode
- * No parity checking
- * Wait for chips to power up
- * Perform 8 read cycles
- */
- m360.memc[1].or = M360_MEMC_OR_TCYC(0) |
- M360_MEMC_OR_1MB |
- M360_MEMC_OR_DRAM;
- m360.memc[1].br = (unsigned long)&_RamBase |
- M360_MEMC_BR_BACK40 |
- M360_MEMC_BR_V;
- for (i = 0; i < 50000; i++)
- continue;
- for (i = 0; i < 8; ++i)
- *((volatile unsigned long *)(unsigned long)&_RamBase);
-
- /*
- * Step 13: Copy the exception vector table to system RAM
- */
- m68k_get_vbr (vbr);
- for (i = 0; i < 256; ++i)
- M68Kvec[i] = vbr[i];
- m68k_set_vbr (M68Kvec);
-
- /*
- * Step 14: More system initialization
- * SDCR (Serial DMA configuration register)
- * Enable SDMA during FREEZE
- * Give SDMA priority over all interrupt handlers
- * Set DMA arbiration level to 4
- * CICR (CPM interrupt configuration register):
- * SCC1 requests at SCCa position
- * SCC2 requests at SCCb position
- * SCC3 requests at SCCc position
- * SCC4 requests at SCCd position
- * Interrupt request level 4
- * Maintain original priority order
- * Vector base 128
- * SCCs priority grouped at top of table
- */
- m360.sdcr = M360_SDMA_SISM_7 | M360_SDMA_SAID_4;
- m360.cicr = (3 << 22) | (2 << 20) | (1 << 18) | (0 << 16) |
- (4 << 13) | (0x1F << 8) | (128);
-
- /*
- * Step 15: Set module configuration register
- * Bus request MC68040 Arbitration ID 3
- * Bus asynchronous timing mode (work around bug in Rev. B)
- * Arbitration asynchronous timing mode
- * Disable timers during FREEZE
- * Disable bus monitor during FREEZE
- * BCLRO* arbitration level 3
- * No show cycles
- * User/supervisor access
- * Bus clear in arbitration ID level 3
- * SIM60 interrupt sources higher priority than CPM
- */
- m360.mcr = 0x6000EC3F;
-
-#elif (defined (M68360_ATLAS_HSB))
- /*
- ******************************************
- * Standalone Motorola 68360 -- ATLAS HSB *
- ******************************************
- */
-
- /*
- * Step 6: Is this a power-up reset?
- * For now we just ignore this and do *all* the steps
- * Someday we might want to:
- * if (Hard, Loss of Clock, Power-up)
- * Do all steps
- * else if (Double bus fault, watchdog or soft reset)
- * Skip to step 12
- * else (must be a CPU32+ reset command)
- * Skip to step 14
- */
-
- /*
- * Step 7: Deal with clock synthesizer
- * HARDWARE:
- * Change if you're not using an external 25 MHz oscillator.
- */
- m360.clkocr = 0x8F; /* No more writes, no clock outputs */
- m360.pllcr = 0xD000; /* PLL, no writes, no prescale,
- no LPSTOP slowdown, PLL X1 */
- m360.cdvcr = 0x8000; /* No more writes, no clock division */
-
- /*
- * Step 8: Initialize system protection
- * Enable watchdog
- * Watchdog causes system reset
- * Next-to-slowest watchdog timeout (21 seconds with 25 MHz oscillator)
- * Enable double bus fault monitor
- * Enable bus monitor for external cycles
- * 1024 clocks for external timeout
- */
- m360.sypcr = 0xEC;
-
- /*
- * Step 9: Clear parameter RAM and reset communication processor module
- */
- for (i = 0 ; i < 192 ; i += sizeof (long)) {
- *((long *)((char *)&m360 + 0xC00 + i)) = 0;
- *((long *)((char *)&m360 + 0xD00 + i)) = 0;
- *((long *)((char *)&m360 + 0xE00 + i)) = 0;
- *((long *)((char *)&m360 + 0xF00 + i)) = 0;
- }
- M360ExecuteRISC (M360_CR_RST);
-
- /*
- * Step 10: Write PEPAR
- * SINTOUT not used (CPU32+ mode)
- * CF1MODE=00 (CONFIG1 input)
- * RAS1* double drive
- * WE0* - WE3*
- * OE* output
- * CAS2* - CAS3*
- * CAS0* - CAS1*
- * CS7*
- * AVEC*
- * HARDWARE:
- * Change if you are using a different memory configuration
- * (static RAM, external address multiplexing, etc).
- */
- m360.pepar = 0x0180;
-
- /*
- * Step 11: Remap Chip Select 0 (CS0*), set up GMR
- */
- m360.gmr = M360_GMR_RCNT(12) | M360_GMR_RFEN |
- M360_GMR_RCYC(0) | M360_GMR_PGS(1) |
- M360_GMR_DPS_32BIT | M360_GMR_DWQ |
- M360_GMR_GAMX;
- m360.memc[0].br = (unsigned long)&_RomBase | M360_MEMC_BR_WP |
- M360_MEMC_BR_V;
- m360.memc[0].or = M360_MEMC_OR_WAITS(3) | M360_MEMC_OR_1MB |
- M360_MEMC_OR_8BIT;
-
- /*
- * Step 12: Initialize the system RAM
- */
- /* first bank 1MByte DRAM */
- m360.memc[1].or = M360_MEMC_OR_TCYC(2) | M360_MEMC_OR_1MB |
- M360_MEMC_OR_PGME | M360_MEMC_OR_DRAM;
- m360.memc[1].br = (unsigned long)&_RamBase | M360_MEMC_BR_V;
-
- /* second bank 1MByte DRAM */
- m360.memc[2].or = M360_MEMC_OR_TCYC(2) | M360_MEMC_OR_1MB |
- M360_MEMC_OR_PGME | M360_MEMC_OR_DRAM;
- m360.memc[2].br = ((unsigned long)&_RamBase + 0x100000) |
- M360_MEMC_BR_V;
-
- /* flash rom socket U6 on CS5 */
- m360.memc[5].br = (unsigned long)ATLASHSB_ROM_U6 | M360_MEMC_BR_WP |
- M360_MEMC_BR_V;
- m360.memc[5].or = M360_MEMC_OR_WAITS(2) | M360_MEMC_OR_512KB |
- M360_MEMC_OR_8BIT;
-
- /* CSRs on CS7 */
- m360.memc[7].or = M360_MEMC_OR_TCYC(4) | M360_MEMC_OR_64KB |
- M360_MEMC_OR_8BIT;
- m360.memc[7].br = ATLASHSB_ESR | 0x01;
- for (i = 0; i < 50000; i++)
- continue;
- for (i = 0; i < 8; ++i)
- *((volatile unsigned long *)(unsigned long)&_RamBase);
-
- /*
- * Step 13: Copy the exception vector table to system RAM
- */
- m68k_get_vbr (vbr);
- for (i = 0; i < 256; ++i)
- M68Kvec[i] = vbr[i];
- m68k_set_vbr (M68Kvec);
-
- /*
- * Step 14: More system initialization
- * SDCR (Serial DMA configuration register)
- * Enable SDMA during FREEZE
- * Give SDMA priority over all interrupt handlers
- * Set DMA arbiration level to 4
- * CICR (CPM interrupt configuration register):
- * SCC1 requests at SCCa position
- * SCC2 requests at SCCb position
- * SCC3 requests at SCCc position
- * SCC4 requests at SCCd position
- * Interrupt request level 4
- * Maintain original priority order
- * Vector base 128
- * SCCs priority grouped at top of table
- */
- m360.sdcr = M360_SDMA_SISM_7 | M360_SDMA_SAID_4;
- m360.cicr = (3 << 22) | (2 << 20) | (1 << 18) | (0 << 16) |
- (4 << 13) | (0x1F << 8) | (128);
-
- /*
- * Step 15: Set module configuration register
- * Disable timers during FREEZE
- * Enable bus monitor during FREEZE
- * BCLRO* arbitration level 3
- * No show cycles
- * User/supervisor access
- * Bus clear interrupt service level 7
- * SIM60 interrupt sources higher priority than CPM
- */
- m360.mcr = 0x4C7F;
-
-#else
- /*
- ***************************************************
- * Generic Standalone Motorola 68360 *
- * As described in MC68360 User's Manual *
- * Atlas ACE360 *
- ***************************************************
- */
-
- /*
- * Step 6: Is this a power-up reset?
- * For now we just ignore this and do *all* the steps
- * Someday we might want to:
- * if (Hard, Loss of Clock, Power-up)
- * Do all steps
- * else if (Double bus fault, watchdog or soft reset)
- * Skip to step 12
- * else (must be a CPU32+ reset command)
- * Skip to step 14
- */
-
- /*
- * Step 7: Deal with clock synthesizer
- * HARDWARE:
- * Change if you're not using an external 25 MHz oscillator.
- */
- m360.clkocr = 0x8F; /* No more writes, no clock outputs */
- m360.pllcr = 0xD000; /* PLL, no writes, no prescale,
- no LPSTOP slowdown, PLL X1 */
- m360.cdvcr = 0x8000; /* No more writes, no clock division */
-
- /*
- * Step 8: Initialize system protection
- * Enable watchdog
- * Watchdog causes system reset
- * Next-to-slowest watchdog timeout (21 seconds with 25 MHz oscillator)
- * Enable double bus fault monitor
- * Enable bus monitor for external cycles
- * 1024 clocks for external timeout
- */
- m360.sypcr = 0xEC;
-
- /*
- * Step 9: Clear parameter RAM and reset communication processor module
- */
- for (i = 0 ; i < 192 ; i += sizeof (long)) {
- *((long *)((char *)&m360 + 0xC00 + i)) = 0;
- *((long *)((char *)&m360 + 0xD00 + i)) = 0;
- *((long *)((char *)&m360 + 0xE00 + i)) = 0;
- *((long *)((char *)&m360 + 0xF00 + i)) = 0;
- }
- M360ExecuteRISC (M360_CR_RST);
-
- /*
- * Step 10: Write PEPAR
- * SINTOUT not used (CPU32+ mode)
- * CF1MODE=00 (CONFIG1 input)
- * RAS1* double drive
- * WE0* - WE3*
- * OE* output
- * CAS2* - CAS3*
- * CAS0* - CAS1*
- * CS7*
- * AVEC*
- * HARDWARE:
- * Change if you are using a different memory configuration
- * (static RAM, external address multiplexing, etc).
- */
- m360.pepar = 0x0180;
-
- /*
- * Step 11: Remap Chip Select 0 (CS0*), set up GMR
- * 32-bit DRAM
- * Internal DRAM address multiplexing
- * 60 nsec DRAM
- * 180 nsec ROM (3 wait states)
- * 15.36 usec DRAM refresh interval
- * The DRAM page size selection is not modified since this
- * startup code may be running in a bootstrap PROM or in
- * a program downloaded by the bootstrap PROM.
- */
- m360.gmr = (m360.gmr & 0x001C0000) | M360_GMR_RCNT(23) |
- M360_GMR_RFEN | M360_GMR_RCYC(0) |
- M360_GMR_DPS_32BIT | M360_GMR_NCS |
- M360_GMR_GAMX;
- m360.memc[0].br = (unsigned long)&_RomBase | M360_MEMC_BR_WP |
- M360_MEMC_BR_V;
- m360.memc[0].or = M360_MEMC_OR_WAITS(3) | M360_MEMC_OR_1MB |
- M360_MEMC_OR_8BIT;
-
- /*
- * Step 12: Initialize the system RAM
- * Do this only if the DRAM has not already been set up
- */
- if ((m360.memc[1].br & M360_MEMC_BR_V) == 0) {
- /*
- * Set up GMR DRAM page size, option and base registers
- * Assume 16Mbytes of DRAM
- * 60 nsec DRAM
- */
- m360.gmr = (m360.gmr & ~0x001C0000) | M360_GMR_PGS(5);
- m360.memc[1].or = M360_MEMC_OR_TCYC(0) |
- M360_MEMC_OR_16MB |
- M360_MEMC_OR_DRAM;
- m360.memc[1].br = (unsigned long)&_RamBase | M360_MEMC_BR_V;
-
- /*
- * Wait for chips to power up
- * Perform 8 read cycles
- */
- for (i = 0; i < 50000; i++)
- continue;
- for (i = 0; i < 8; ++i)
- *((volatile unsigned long *)(unsigned long)&_RamBase);
-
- /*
- * Determine memory size (1, 4, or 16 Mbytes)
- * Set GMR DRAM page size appropriately.
- * The OR is left at 16 Mbytes. The bootstrap PROM places its
- * .data and .bss segments at the top of the 16 Mbyte space.
- * A 1 Mbyte or 4 Mbyte DRAM will show up several times in
- * the memory map, but will work with the same bootstrap PROM.
- */
- *(volatile char *)&_RamBase = 0;
- *((volatile char *)&_RamBase+0x00C01800) = 1;
- if (*(volatile char *)&_RamBase) {
- m360.gmr = (m360.gmr & ~0x001C0000) | M360_GMR_PGS(1);
- }
- else {
- *((volatile char *)&_RamBase+0x00801000) = 1;
- if (*(volatile char *)&_RamBase) {
- m360.gmr = (m360.gmr & ~0x001C0000) | M360_GMR_PGS(3);
- }
- }
-
- /*
- * Enable parity checking
- */
- m360.memc[1].br |= M360_MEMC_BR_PAREN;
- }
-
- /*
- * Step 13: Copy the exception vector table to system RAM
- */
- m68k_get_vbr (vbr);
- for (i = 0; i < 256; ++i)
- M68Kvec[i] = vbr[i];
- m68k_set_vbr (M68Kvec);
-
- /*
- * Step 14: More system initialization
- * SDCR (Serial DMA configuration register)
- * Enable SDMA during FREEZE
- * Give SDMA priority over all interrupt handlers
- * Set DMA arbiration level to 4
- * CICR (CPM interrupt configuration register):
- * SCC1 requests at SCCa position
- * SCC2 requests at SCCb position
- * SCC3 requests at SCCc position
- * SCC4 requests at SCCd position
- * Interrupt request level 4
- * Maintain original priority order
- * Vector base 128
- * SCCs priority grouped at top of table
- */
- m360.sdcr = M360_SDMA_SISM_7 | M360_SDMA_SAID_4;
- m360.cicr = (3 << 22) | (2 << 20) | (1 << 18) | (0 << 16) |
- (4 << 13) | (0x1F << 8) | (128);
-
- /*
- * Step 15: Set module configuration register
- * Disable timers during FREEZE
- * Enable bus monitor during FREEZE
- * BCLRO* arbitration level 3
- * No show cycles
- * User/supervisor access
- * Bus clear interrupt service level 7
- * SIM60 interrupt sources higher priority than CPM
- */
- m360.mcr = 0x4C7F;
-#endif
-
- /*
- * Copy data, clear BSS, switch stacks and call main()
- */
- _CopyDataClearBSSAndStart ();
-}
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds
deleted file mode 100644
index 132eafa35d..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * This file contains GNU linker directives for a generic MC68360 board.
- * Variations in memory size and allocation can be made by
- * overriding some values with linker command-line arguments.
- *
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-/*
- * Declare some sizes.
- * XXX: The assignment of ". += XyzSize;" fails in older gld's if the
- * number used there is not constant. If this happens to you, edit
- * the lines marked XXX below to use a constant value.
- */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
-
-/*
- * Declare on-board memory.
- */
-MEMORY {
- ram : ORIGIN = 0x00000000, LENGTH = 64M
- rom : ORIGIN = 0x0F000000, LENGTH = 1M
- dpram : ORIGIN = 0x0E000000, LENGTH = 8k
-}
-
-/*
- * Load objects
- */
-SECTIONS {
- /*
- * Boot PROM
- */
- rom : {
- _RomBase = .;
- __RomBase = .;
- } >rom
-
- /*
- * Dynamic RAM
- */
- ram : {
- _RamBase = .;
- __RamBase = .;
- } >ram
-
- /*
- * Text, data and bss segments
- */
- .text : {
- CREATE_OBJECT_SYMBOLS
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
-
- etext = .;
- _etext = .;
- } >ram
- .data : {
- copy_start = .;
- *(.data)
- . = ALIGN (16);
- _edata = .;
- copy_end = .;
- } >ram
- .bss : {
- M68Kvec = .;
- _M68Kvec = .;
- . += (256 * 4);
- clear_start = .;
- *(.bss)
- *(COMMON)
- . = ALIGN (16);
- _end = .;
-
- _HeapStart = .;
- __HeapStart = .;
- . += HeapSize; /* XXX -- Old gld can't handle this */
- . += StackSize; /* XXX -- Old gld can't handle this */
- /* . += 0x10000; */ /* HeapSize for old gld */
- /* . += 0x1000; */ /* StackSize for old gld */
- . = ALIGN (16);
- stack_init = .;
- clear_end = .;
-
- _WorkspaceBase = .;
- __WorkspaceBase = .;
- } >ram
-
- /*
- * On-chip memory/peripherals
- */
- dpram : {
- m360 = .;
- _m360 = .;
- . += (8 * 1024);
-
- } >dpram
-}
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp
deleted file mode 100644
index 273d997877..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * This file contains GNU linker directives for a generic MC68360 board.
- * Variations in hardware type and dynamic memory size can be made
- * by overriding some values with linker command-line arguments.
- *
- * These linker directives are for producing a PROM version.
- * The data segment is placed at the end of the text segment in the PROM.
- * The start-up code takes care of copying this region to RAM.
- *
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-/*
- * Declare some sizes.
- * XXX: The assignment of ". += XyzSize;" fails in older gld's if the
- * number used there is not constant. If this happens to you, edit
- * the lines marked XXX below to use a constant value.
- */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
-
-/*
- * Declare on-board memory.
- */
-MEMORY {
- ram : ORIGIN = 0x00000000, LENGTH = 64M
- myram : ORIGIN = 16M-400k, LENGTH = 400k
- rom : ORIGIN = 0x0F000000, LENGTH = 1M
- dpram : ORIGIN = 0x0E000000, LENGTH = 8k
-}
-
-/*
- * Load objects
- */
-SECTIONS {
- /*
- * Boot PROM
- */
- rom : {
- _RomBase = .;
- __RomBase = .;
- } >rom
-
- /*
- * Dynamic RAM
- */
- ram : {
- _RamBase = .;
- __RamBase = .;
- } >ram
-
- /*
- * Text, data and bss segments
- */
- .text : AT (0x00000000) {
- CREATE_OBJECT_SYMBOLS
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
-
- etext = .;
- _etext = .;
- } >rom
- .data : AT(SIZEOF(.text)) {
- copy_start = .;
- *(.data)
- . = ALIGN (16);
- _edata = .;
- copy_end = .;
- } >myram
- .bss : {
- M68Kvec = .;
- _M68Kvec = .;
- . += (256 * 4);
- clear_start = .;
- *(.bss)
- *(COMMON)
- . = ALIGN (16);
- _end = .;
-
- _HeapStart = .;
- __HeapStart = .;
- . += HeapSize; /* XXX -- Old gld can't handle this */
- . += StackSize; /* XXX -- Old gld can't handle this */
- /* . += 0x10000; */ /* HeapSize for old gld */
- /* . += 0x1000; */ /* StackSize for old gld */
- . = ALIGN (16);
- stack_init = .;
- clear_end = .;
-
- _WorkspaceBase = .;
- __WorkspaceBase = .;
- } >myram
-
- /*
- * On-chip memory/peripherals
- */
- dpram : {
- m360 = .;
- _m360 = .;
- . += (8 * 1024);
-
- } >dpram
-}
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom
deleted file mode 100644
index d459f5e922..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * This file contains GNU linker directives for a generic MC68360 board.
- * Variations in hardware type and dynamic memory size can be made
- * by overriding some values with linker command-line arguments.
- *
- * These linker directives are for producing a PROM version.
- * The data segment is placed at the end of the text segment in the PROM.
- * The start-up code takes care of copying this region to RAM.
- *
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-/*
- * Declare some sizes.
- * XXX: The assignment of ". += XyzSize;" fails in older gld's if the
- * number used there is not constant. If this happens to you, edit
- * the lines marked XXX below to use a constant value.
- */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
-
-/*
- * Declare on-board memory.
- */
-MEMORY {
- ram : ORIGIN = 0x00000000, LENGTH = 64M
- rom : ORIGIN = 0x0F000000, LENGTH = 1M
- dpram : ORIGIN = 0x0E000000, LENGTH = 8k
-}
-
-/*
- * Load objects
- */
-SECTIONS {
- /*
- * Boot PROM
- */
- rom : {
- _RomBase = .;
- __RomBase = .;
- } >rom
-
- /*
- * Dynamic RAM
- */
- ram : {
- _RamBase = .;
- __RamBase = .;
- } >ram
-
- /*
- * Text, data and bss segments
- */
- .text : AT (0x00000000) {
- CREATE_OBJECT_SYMBOLS
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
-
- etext = .;
- _etext = .;
- } >rom
- .data : AT(SIZEOF(.text)) {
- copy_start = .;
- *(.data)
- . = ALIGN (16);
- _edata = .;
- copy_end = .;
- } >ram
- .bss : {
- M68Kvec = .;
- _M68Kvec = .;
- . += (256 * 4);
- clear_start = .;
- *(.bss)
- *(COMMON)
- . = ALIGN (16);
- _end = .;
-
- _HeapStart = .;
- __HeapStart = .;
- . += HeapSize; /* XXX -- Old gld can't handle this */
- . += StackSize; /* XXX -- Old gld can't handle this */
- /* . += 0x10000; */ /* HeapSize for old gld */
- /* . += 0x1000; */ /* StackSize for old gld */
- . = ALIGN (16);
- stack_init = .;
- clear_end = .;
-
- _WorkspaceBase = .;
- __WorkspaceBase = .;
- } >ram
-
- /*
- * On-chip memory/peripherals
- */
- dpram : {
- m360 = .;
- _m360 = .;
- . += (8 * 1024);
-
- } >dpram
-}
diff --git a/c/src/lib/libbsp/m68k/gen68360/timer/Makefile.in b/c/src/lib/libbsp/m68k/gen68360/timer/Makefile.in
deleted file mode 100644
index d9e6e84a0c..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/timer/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/gen68360/timer/timer.c b/c/src/lib/libbsp/m68k/gen68360/timer/timer.c
deleted file mode 100644
index c42dd60b96..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/timer/timer.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Timer_init()
- *
- * Use TIMER 1 and TIMER 2 for Timing Test Suite
- *
- * The hardware on the MC68360 makes these routines very simple.
- *
- * Based on the `gen68302' board support package, and covered by the
- * original distribution terms.
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-/*
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include "m68360.h"
-
-void
-Timer_initialize (void)
-{
- /*
- * Reset timers 1 and 2
- */
- m360.tgcr &= ~0x00FF;
- m360.tcn1 = 0;
- m360.tcn2 = 0;
- m360.ter1 = 0xFFFF;
- m360.ter2 = 0xFFFF;
-
- /*
- * Cascade timers 1 and 2
- */
- m360.tgcr |= 0x0080;
-
- /*
- * Configure timers 1 and 2 to a single 32-bit, 1 MHz timer.
- * HARDWARE:
- * Change the `25' to match your processor clock
- */
- m360.tmr2 = ((25-1) << 8) | 0x2;
- m360.tmr1 = 0;
-
- /*
- * Start the timers
- */
- m360.tgcr |= 0x0011;
-}
-
-/*
- * Return timer value in microsecond units
- */
-int
-Read_timer (void)
-{
- return *(rtems_unsigned32 *)&m360.tcn1;
-}
-
-/*
- * Empty function call used in loops to measure basic cost of looping
- * in Timing Test Suite.
- */
-rtems_status_code
-Empty_function (void)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void
-Set_find_average_overhead(rtems_boolean find_flag)
-{
-}
diff --git a/c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile.in b/c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile.in
deleted file mode 100644
index c7523cd10f..0000000000
--- a/c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile.in
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# We only build the networking device driver if HAS_NETWORKING was defined
-NETWORKING_DRIVER_yes_V = network
-NETWORKING_DRIVER = $(NETWORKING_DRIVER_$(HAS_NETWORKING)_V)
-
-BSP_PIECES=startup clock console timer $(NETWORKING_DRIVER)
-CPU_PIECES=
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(CPU_PIECES), \
- ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(piece).rel) \
- $(wildcard \
- ../../../../libcpu/$(RTEMS_CPU)/$(RTEMS_CPU_MODEL)/fpsp/$(ARCH)/fpsp.rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/m68k/idp/Makefile.in b/c/src/lib/libbsp/m68k/idp/Makefile.in
deleted file mode 100644
index 0a2d61ae80..0000000000
--- a/c/src/lib/libbsp/m68k/idp/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include startup clock console timer wrapup
diff --git a/c/src/lib/libbsp/m68k/idp/README b/c/src/lib/libbsp/m68k/idp/README
deleted file mode 100644
index f02ced80b9..0000000000
--- a/c/src/lib/libbsp/m68k/idp/README
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# $Id$
-#
-
-This board support package has not been tested with multiprocessor
-or the timing support. The uniprocessor IDP package was tested though
-with a fairly large application (although bugs may exist). The
-$RTEMS_ROOT/src/tests/Makefile should therefore have the samples and
-the tests directories compiled first with the tmtests (timing) and
-multiprocessor directories optional.
-
-Let me know if you have any problems or bug fixes. Bug fixes are greatly
-appreciated. I do not work for RTEMS or am a member of the RTEMS support
-group in any way, however. I am just one of many that appreciate
-"free" software and enjoy contributing when possible :). You can do it too!
-
- -- doug mcbride
- mcbride@rodin.colorado.edu
-
-==============================================================
-Notes: Make sure that -msoft-float is defined when compiling in the
-newlib-beta-rtems/newlib/msoft-float directory subtree. You also probably
-want to add the following line to line 413 of
-newlib-beta-rtems/newlib/msoft-float/libc/stdio/vfprintf.c:
-
-#define INTEGER_ONLY
-
-That allows you to pass most of the paranoia test in the samples
-directory of RTEMS although you can't see the floating point values actually
-printed (software floating point tends to make that difficult anyway).
-In order to pass the whole paranoia test (with one flaw), however, I had to
-comment out the following line in milestone 140 (why?):
-
-/* printf ("Testing X^((X + 1) / (X - 1)) vs. exp(2) = %.17e as X -> 1.\n",
- Exp2); */
diff --git a/c/src/lib/libbsp/m68k/idp/bsp_specs b/c/src/lib/libbsp/m68k/idp/bsp_specs
deleted file mode 100644
index 61dac86b53..0000000000
--- a/c/src/lib/libbsp/m68k/idp/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start.o%s} \
-%{qrtems_debug: start_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/m68k/idp/clock/Makefile.in b/c/src/lib/libbsp/m68k/idp/clock/Makefile.in
deleted file mode 100644
index 284cab93fb..0000000000
--- a/c/src/lib/libbsp/m68k/idp/clock/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/idp/clock/ckinit.c b/c/src/lib/libbsp/m68k/idp/clock/ckinit.c
deleted file mode 100644
index 16c0337fd5..0000000000
--- a/c/src/lib/libbsp/m68k/idp/clock/ckinit.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/* Clock_init()
- *
- *
- * This is modified by Doug McBride to get it to work for the MC68EC040
- * IDP board. The below comments are kept to show that some prior work
- * was done in the area and the modifications performed was application
- * specific for the IDP board to port it to.
- *
- * This routine initializes the mc68230 on the MC68EC040 board.
- * The tick frequency is 40 milliseconds.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-volatile rtems_unsigned32 Clock_driver_ticks;
- /* ticks since initialization */
-rtems_isr_entry Old_ticker;
-
-extern rtems_configuration_table Configuration;
-extern void led_putnum();
-void Disable_clock();
-
-#define CLOCK_VECTOR 0x4D
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-
-/*
- * ISR Handler
- *
- *
- * ((1ms * 6.5 MHz) / 2^5) = 203.125) where 6.5 MHz is the clock rate of the
- * MC68230, 2^5 is the prescaler factor, and 1ms is the common interrupt
- * interval for the Clock_isr routine.
- * Therefore, 203 (decimal) is the number to program into the CPRH-L registers
- * of the MC68230 for countdown. However, I have found that 193 instead of
- * 203 provides greater accuracy -- why? The crystal should be more accurate
- * than that
- */
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
- Clock_driver_ticks += 1;
- /* acknowledge interrupt
- TSR = 1; */
- MC68230_WRITE (TSR, 1);
-
- if ( Clock_isrs == 1 ) {
- rtems_clock_tick();
- /* Cast to an integer so that 68EC040 IDP which doesn't have an FPU doesn't
- have a heart attack -- if you use newlib1.6 or greater and get
- libgcc.a for gcc with software floating point support, this is not
- a problem */
- Clock_isrs =
- (int)(BSP_Configuration.microseconds_per_tick / 1000);
- }
- else
- Clock_isrs -= 1;
-}
-
-void Disable_clock()
-{
- /* Disable timer */
- MC68230_WRITE (TCR, 0x00);
-}
-
-void Install_clock( clock_isr )
-rtems_isr_entry clock_isr;
-{
- Clock_driver_ticks = 0;
- Clock_isrs = (int)(Configuration.microseconds_per_tick / 1000);
-
- if ( Configuration.ticks_per_timeslice ) {
-/* led_putnum('c'); * for debugging purposes */
- Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
-
- /* Disable timer for initialization */
- MC68230_WRITE (TCR, 0x00);
-
- /* some PI/T initialization stuff here -- see comment in the ckisr.c
- file in this directory to understand why I use the values that I do */
- /* Set up the interrupt vector on the MC68230 chip:
- TIVR = CLOCK_VECTOR; */
- MC68230_WRITE (TIVR, CLOCK_VECTOR);
-
- /* Set CPRH through CPRL to 193 (not 203) decimal for countdown--see ckisr.c
- CPRH = 0x00;
- CPRM = 0x00;
- CPRL = 0xC1; */
- MC68230_WRITE (CPRH, 0x00);
- MC68230_WRITE (CPRM, 0x00);
- MC68230_WRITE (CPRL, 0xC1);
-
- /* Enable timer and use it as an external periodic interrupt generator
- TCR = 0xA1; */
-/* led_putnum('a'); * for debugging purposes */
- MC68230_WRITE (TCR, 0xA1);
-
- /*
- * Schedule the clock cleanup routine to execute if the application exits.
- */
- atexit( Clock_exit );
- }
-}
-
-/* The following was added for debugging purposes */
-void Clock_exit( void )
-{
- rtems_unsigned8 data;
-
- if ( Configuration.ticks_per_timeslice ) {
-
- /* disable timer
- data = TCR;
- TCR = (data & 0xFE); */
- MC68230_READ (TCR, data);
- MC68230_WRITE (TCR, (data & 0xFE));
-
- /* do not restore old vector */
- }
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libbsp/m68k/idp/console/Makefile.in b/c/src/lib/libbsp/m68k/idp/console/Makefile.in
deleted file mode 100644
index 1990e445b1..0000000000
--- a/c/src/lib/libbsp/m68k/idp/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console leds mc68ec duart
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/idp/console/console.c b/c/src/lib/libbsp/m68k/idp/console/console.c
deleted file mode 100644
index 3e67d70e61..0000000000
--- a/c/src/lib/libbsp/m68k/idp/console/console.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * This file contains the Motorola IDP console IO package.
- *
- * Written by Doug McBride, Colorado Space Grant College
- * Based off of the board support packages of RTEMS
- *
- * Updated to RTEMS 3.2.0 by Joel Sherrill.
- *
- * $Id$
- */
-
-#define MIDP_INIT
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <ringbuf.h>
-
-Ring_buffer_t Console_Buffer[ 2 ];
-
-rtems_isr C_Receive_ISR(rtems_vector_number vector);
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- Ring_buffer_Initialize( &Console_Buffer[ 0 ] );
- Ring_buffer_Initialize( &Console_Buffer[ 1 ] );
-
- init_pit();
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- status = rtems_io_register_name(
- "/dev/tty00",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- status = rtems_io_register_name(
- "/dev/tty01",
- major,
- (rtems_device_minor_number) 1
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-}
-
-
-/* is_character_ready
- *
- * This routine returns TRUE if a character is available.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_boolean is_character_ready(
- char *ch,
- int port
-)
-{
- if ( Ring_buffer_Is_empty( &Console_Buffer[ port ] ) )
- return FALSE;
-
- Ring_buffer_Remove_character( &Console_Buffer[ port ], *ch );
- return TRUE;
-}
-
-/* quick_char_check
- *
- * This routine returns TRUE if a character is available.
- * It is different from above because it does not disturb the ring buffer
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_boolean quick_char_check(
- int port
-)
-{
- if ( Ring_buffer_Is_empty( &Console_Buffer[ port ] ) )
- return FALSE;
-
- return TRUE;
-}
-
-/* inbyte
- *
- * This routine reads a character from the UART through a buffer.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- * character read from UART
- */
-
-char inbyte(
- int port
-)
-{
- unsigned char tmp_char;
-
- /* If you come into this routine without checking is_character_ready() first
- and you want nonblocking code, then it's your own fault */
-
- while ( !is_character_ready( &tmp_char, port ) );
-
- return tmp_char;
-}
-
-
-/* outbyte
- *
- * This routine transmits a character out the M68681. It supports
- * XON/XOFF flow control.
- *
- * Input parameters:
- * ch - character to be transmitted
- *
- * Output parameters: NONE
- */
-
-void outbyte(
- char ch,
- int port
-)
-{
- switch ( port ) {
- case 0:
- transmit_char( ch );
- break;
- case 1:
- transmit_char_portb( ch );
- break;
- }
-
-}
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- if ( minor > 1 )
- return RTEMS_INVALID_NUMBER;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte( minor );
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- if ( minor > 1 )
- return RTEMS_INVALID_NUMBER;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r', minor );
- }
- outbyte( buffer[ count ], minor );
- }
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/m68k/idp/console/duart.c b/c/src/lib/libbsp/m68k/idp/console/duart.c
deleted file mode 100644
index cc90adf3c3..0000000000
--- a/c/src/lib/libbsp/m68k/idp/console/duart.c
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * $Id$
- */
-
-/*#########################################################
-#
-# This code is a modified version of what you will find at the
-# end of the IDP User's manual. The original code is copyrighted
-# by Motorola and Motorola Semiconductor Products as well as
-# Motorola Software products group.
-#
-# Modifications to the original IDP code by Doug McBride, Colorado
-# Space Grant College. Modifications include a means of accessing
-# port B of the duart as well as port A as well as modifications for
-# buffering and RTEMS support. Modifications are provided
-# as is and may not be correct.
-#
-# Rob Savoye provided the format for the mc68681 header file
-#
-# Joel Sherrill provided inspiration for recoding my original assembly
-# for this file into C (a good idea)
-#
-##########################################################*/
-
-#include <bsp.h>
-#include <ringbuf.h>
-
-rtems_isr C_Receive_ISR(rtems_vector_number vector);
-extern Ring_buffer_t Console_Buffer[];
-
-extern unsigned char inbuf[];
-extern unsigned char inbuf_portb[];
-extern unsigned tail;
-extern unsigned tail_portb;
-unsigned char Pit_initialized = 0;
-
-/*#####################################################################
-# The volatile routine to initialize the duart -- port a and port b
-######################################################################*/
-volatile void init_pit()
-{
- /*
- * ports A & B while configuring PIT by:
- *
- * + disable Interrupt Mask Register
- * + disable port A transmitter
- * + disable port A receiver
- * + disable port B transmitter
- * + disable port B receiver
- */
-
- MC68681_WRITE(DUART_ADDR, MC68681_INTERRUPT_MASK_REG, 0x00);
- MC68681_WRITE(DUART_ADDR, MC68681_COMMAND_REG_A ,MC68681_MODE_REG_DISABLE_TX);
- MC68681_WRITE(DUART_ADDR, MC68681_COMMAND_REG_A, MC68681_MODE_REG_DISABLE_RX);
- MC68681_WRITE(DUART_ADDR, MC68681_COMMAND_REG_B, MC68681_MODE_REG_DISABLE_TX);
- MC68681_WRITE(DUART_ADDR, MC68681_COMMAND_REG_B, MC68681_MODE_REG_DISABLE_RX);
-
- /*
- * install ISR for ports A and B
- */
- set_vector(C_Receive_ISR, (VECT+H3VECT), 1);
-
- /*
- * initialize pit
- *
- * set mode to 0 -- disable all ports
- * set up pirq and piack
- * all pins on port b are input
- * submode 1x, h3 interrupt enabled
- * setup pivr
- * turn on all ports
- */
- MC68230_WRITE(PGCR, 0x00);
- MC68230_WRITE(PSRR, 0x18);
- MC68230_WRITE(PBDDR, 0x00);
- MC68230_WRITE(PBCR, 0x82);
- MC68230_WRITE(PIVR, VECT);
- MC68230_WRITE(PGCR, 0x20);
-
- /*
- * For some reason, the reset of receiver/transmitter only works for
- * the first time around -- it garbles the output otherwise
- * (e.g., sp21)
- */
- if (!Pit_initialized)
- {
- /*
- * initialize the duart registers on port b
- * WARNING:OPTIMIZER MAY ONLY EXECUTE THIRD STATEMENT IF NOT VOLATILE
- *
- * reset tx, channel b
- * reset rx, channel b
- * reset mr pointer, ch
- */
- MC68681_WRITE(DUART_ADDR, MC68681_COMMAND_REG_B, MC68681_MODE_REG_RESET_TX);
- MC68681_WRITE(DUART_ADDR, MC68681_COMMAND_REG_B, MC68681_MODE_REG_RESET_RX);
- MC68681_WRITE(DUART_ADDR, MC68681_COMMAND_REG_B, MC68681_MODE_REG_RESET_MR_PTR);
-
- /*
- * initialize the duart registers on port a
- * WARNING:OPTIMIZER MAY ONLY EXECUTE THIRD STATEMENT IF NOT VOLATILE
- *
- * reset tx, channel a
- * reset rx, channel a
- * reset mr pointer, ch
- */
- MC68681_WRITE(DUART_ADDR, MC68681_COMMAND_REG_A, MC68681_MODE_REG_RESET_TX);
- MC68681_WRITE(DUART_ADDR, MC68681_COMMAND_REG_A, MC68681_MODE_REG_RESET_RX);
- MC68681_WRITE(DUART_ADDR, MC68681_COMMAND_REG_A, MC68681_MODE_REG_RESET_MR_PTR);
-
- Pit_initialized = 1;
- }
-
- /*
- * Init the general registers of the duart
- *
- * init ivr
- * init imr
- * init acr
- * init ctur
- * init ctlr
- * init opcr
- * init cts
- */
- MC68681_WRITE(DUART_ADDR, MC68681_INTERRUPT_VECTOR_REG,
- MC68681_INTERRUPT_VECTOR_INIT);
- MC68681_WRITE(DUART_ADDR, MC68681_INTERRUPT_MASK_REG,
- MC68681_IR_RX_READY_A | MC68681_IR_RX_READY_B);
- MC68681_WRITE(DUART_ADDR, MC68681_AUX_CTRL_REG, MC68681_CLEAR);
- MC68681_WRITE(DUART_ADDR, MC68681_COUNTER_TIMER_UPPER_REG, 0x00);
- MC68681_WRITE(DUART_ADDR, MC68681_COUNTER_TIMER_LOWER_REG, 0x02);
- MC68681_WRITE(DUART_ADDR, MC68681_OUTPUT_PORT_CONFIG_REG, MC68681_CLEAR);
- MC68681_WRITE(DUART_ADDR, MC68681_OUTPUT_PORT_SET_REG, 0x01);
-
- /*
- * init the actual serial port for port a
- *
- * Set Baud Rate to 9600
- * Set Stop bit length of 1
- * enable Transmit and receive
- */
- MC68681_WRITE(DUART_ADDR, MC68681_CLOCK_SELECT_REG_A, MC68681_BAUD_RATE_MASK_9600);
- MC68681_WRITE(DUART_ADDR, MC68681_MODE_REG_1A,
- (MC68681_8BIT_CHARS | MC68681_NO_PARITY));
- MC68681_WRITE(DUART_ADDR, MC68681_MODE_REG_2A,MC68681_STOP_BIT_LENGTH_1);
- MC68681_WRITE(DUART_ADDR, MC68681_COMMAND_REG_A,
- (MC68681_MODE_REG_ENABLE_TX | MC68681_MODE_REG_ENABLE_RX));
-
- /*
- * init the actual serial port for port b
- * init csrb -- 9600 baud
- */
- MC68681_WRITE(DUART_ADDR, MC68681_CLOCK_SELECT_REG_B, MC68681_BAUD_RATE_MASK_9600);
-
-
-#define EIGHT_BITS_NO_PARITY
-#ifdef EIGHT_BITS_NO_PARITY
- /*
- * Set 8 Bit characters with no parity
- */
- MC68681_WRITE(DUART_ADDR, MC68681_MODE_REG_1B,
- (MC68681_NO_PARITY | MC68681_8BIT_CHARS) );
-#else
- /*
- * Set 7 Bit Characters with parity
- */
- MC68681_WRITE(DUART_ADDR, MC68681_MODE_REG_1B,
- (MC68681_WITH_PARITY | MC68681_7BIT_CHARS) );
-#endif
-
-
- /*
- * Set Stop Bit length to 1
- * Disable Recieve and transmit on B
- */
- MC68681_WRITE(DUART_ADDR, MC68681_MODE_REG_2B,MC68681_STOP_BIT_LENGTH_1);
- MC68681_WRITE(DUART_ADDR, MC68681_COMMAND_REG_B,
- (MC68681_MODE_REG_ENABLE_TX | MC68681_MODE_REG_ENABLE_RX) );
-}
-
-/*#####################################################################
-# interrupt handler for receive of character from duart on ports A & B
-#####################################################################*/
-rtems_isr C_Receive_ISR(rtems_vector_number vector)
-{
- volatile unsigned char *_addr;
-
- /*
- * Clear pit interrupt.
- */
- _addr = (unsigned char *) (PIT_ADDR + PITSR);
- *_addr = 0x04;
-
- /*
- * check port A first for input
- * extract rcvrdy on port B
- * set ptr to recieve buffer and read character into ring buffer
- */
- _addr = (unsigned char *) (DUART_ADDR + MC68681_STATUS_REG_A);
- if (*_addr & MC68681_RX_READY) /* extract rcvrdy on port A */
- {
- _addr = (unsigned char *) (DUART_ADDR + MC68681_RECEIVE_BUFFER_A);
- Ring_buffer_Add_character( &Console_Buffer[ 0 ], *_addr );
- }
-
- /*
- * If not on port A, let's check port B
- * extract rcvrdy on port B
- * set ptr to recieve buffer and read character into ring buffer
- */
- else
- {
- _addr = (unsigned char *) (DUART_ADDR + MC68681_STATUS_REG_B);
- if (*_addr & MC68681_RX_READY) /* extract rcvrdy on port B */
- {
- _addr = (unsigned char *) (DUART_ADDR + MC68681_RECEIVE_BUFFER_B);
- Ring_buffer_Add_character( &Console_Buffer[ 1 ], *_addr );
- }
-
- /*
- * if not ready on port A or port B, must be an error
- * if error, get out so that fifo is undisturbed
- */
- }
-}
-
-/*#####################################################################
-# This is the routine that actually transmits a character one at a time
-# This routine transmits on port A of the IDP board
-#####################################################################*/
-void transmit_char(char ch)
-{
- volatile unsigned char *_addr;
-
- /*
- * Get SRA (extract txrdy)
- */
- _addr = (unsigned char *) (DUART_ADDR + MC68681_STATUS_REG_A);
- while (!(*_addr & MC68681_TX_READY))
- {
- }
-
- /*
- * transmit character over port A
- */
- MC68681_WRITE(DUART_ADDR, MC68681_TRANSMIT_BUFFER_A, ch);
-}
-
-
-/*#####################################################################
-# This is the routine that actually transmits a character one at a time
-# This routine transmits on port B of the IDP board
-#####################################################################*/
-void transmit_char_portb(char ch)
-{
- volatile unsigned char *_addr;
-
- /*
- * Get SRB (extract txrdy)
- */
- _addr = (unsigned char *) (DUART_ADDR + MC68681_STATUS_REG_B);
- while (!(*_addr & MC68681_TX_READY))
- {
- }
-
- /*
- * transmit character over port B
- */
- MC68681_WRITE(DUART_ADDR, MC68681_TRANSMIT_BUFFER_B, ch);
-}
diff --git a/c/src/lib/libbsp/m68k/idp/console/leds.c b/c/src/lib/libbsp/m68k/idp/console/leds.c
deleted file mode 100644
index b7b7722008..0000000000
--- a/c/src/lib/libbsp/m68k/idp/console/leds.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * leds.c -- control the led's on a Motorola mc68ec0x0 board.
- * Written by rob@cygnus.com (Rob Savoye)
- *
- * $Id$
- */
-#include "leds.h"
-
-void zylons();
-void led_putnum();
-void clear_leds();
-
-/*
- * led_putnum -- print a hex number on the LED. the value of num must be a char with
- * the ascii value. ie... number 0 is '0', a is 'a', ' ' (null) clears
- * the led display.
- * Setting the bit to 0 turns it on, 1 turns it off.
- * the LED's are controlled by setting the right bit mask in the base
- * address.
- * The bits are:
- * [d.p | g | f | e | d | c | b | a ] is the byte.
- *
- * The locations are:
- *
- * a
- * -----
- * f | | b
- * | g |
- * -----
- * | |
- * e | | c
- * -----
- * d . d.p (decimal point)
- */
-void
-led_putnum ( num )
-char num;
-{
- static unsigned char *leds = (unsigned char *)LED_ADDR;
- static unsigned char num_bits [18] = {
- 0xff, /* clear all */
- 0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8, 0x80, 0x98, /* numbers 0-9 */
- 0x98, 0x20, 0x3, 0x27, 0x21, 0x4, 0xe /* letters a-f */
- };
-
- if (num >= '0' && num <= '9')
- num = (num - '0') + 1;
-
- if (num >= 'a' && num <= 'f')
- num = (num - 'a') + 12;
-
- if (num == ' ')
- num = 0;
-
- *leds = num_bits[(int)num];
-}
-
-/* This procedure added by Doug McBride, Colorado Space Grant College --
- Probably should be a macro instead */
-void
-clear_leds ( )
-{
- static unsigned char *leds = (unsigned char *)LED_ADDR;
- *leds = 0xFF;
-}
-
-/*
- * zylons -- draw a rotating pattern. NOTE: this function never returns.
- */
-void
-zylons()
-{
- unsigned char *leds = (unsigned char *)LED_ADDR;
- unsigned char curled = 0xfe;
- void delay( int );
-
- while (1)
- {
- *leds = curled;
- curled = (curled >> 1) | (curled << 7);
- delay ( 8000 );
- }
-}
diff --git a/c/src/lib/libbsp/m68k/idp/console/mc68ec.c b/c/src/lib/libbsp/m68k/idp/console/mc68ec.c
deleted file mode 100644
index fd837981d2..0000000000
--- a/c/src/lib/libbsp/m68k/idp/console/mc68ec.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * mc68ec.c -- Low level support for the Motorola mc68ec0x0 board.
- * Written by rob@cygnus.com (Rob Savoye)
- *
- * $Id$
- */
-
-#include "leds.h"
-
-/*
- * delay -- delay execution. This is an ugly hack. It should
- * use the timer, but I'm waiting for docs. (sigh)
- */
-void delay(num)
-int num;
-{
- while (num--)
- {
- asm ("nop");
- }
-}
diff --git a/c/src/lib/libbsp/m68k/idp/include/Makefile.in b/c/src/lib/libbsp/m68k/idp/include/Makefile.in
deleted file mode 100644
index 730a0de2ba..0000000000
--- a/c/src/lib/libbsp/m68k/idp/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h $(srcdir)/leds.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/m68k/idp/include/README b/c/src/lib/libbsp/m68k/idp/include/README
deleted file mode 100644
index 940cadb13d..0000000000
--- a/c/src/lib/libbsp/m68k/idp/include/README
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-
-The following files really should be made generic and allowed to
-be shared between BSPs:
-
- mc68230.h
- mc68681.h
- ringbuf.h
-
-However at the moment the BSP is not tested under 3.2.0 so it is
-dangerous to do so.
diff --git a/c/src/lib/libbsp/m68k/idp/include/bsp.h b/c/src/lib/libbsp/m68k/idp/include/bsp.h
deleted file mode 100644
index 25dcfd5def..0000000000
--- a/c/src/lib/libbsp/m68k/idp/include/bsp.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* bsp.h
- *
- * This include file contains all Motorola 680x0 IDP board IO definitions.
- *
- * $Id$
- */
-
-#ifndef __IDP_BSP_H
-#define __IDP_BSP_H
-
-#include <rtems.h>
-#include <console.h>
-#include <clockdrv.h>
-#include <motorola/mc68230.h>
-#include <motorola/mc68681.h>
-
-#define DUART_ADDR 0xb00003 /* base address of the MC68681 DUART */
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Define the interrupt mechanism for Time Test 27
- *
- * NOTE: tm27 apparently not supported.
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler )
-
-#define Cause_tm27_intr()
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/* Constants */
-
-#define RAM_START 0
-#define RAM_END 0x200000
-
-#ifdef MIDP_INIT
-#undef EXTERN
-#define EXTERN
-#else
-#undef EXTERN
-#define EXTERN extern
-#endif
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-extern m68k_isr_entry M68Kvec[]; /* vector table address */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-m68k_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-void init_pit( void );
-
-void transmit_char( char ch );
-
-void transmit_char_portb( char ch );
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/idp/include/coverhd.h b/c/src/lib/libbsp/m68k/idp/include/coverhd.h
deleted file mode 100644
index 02df403a18..0000000000
--- a/c/src/lib/libbsp/m68k/idp/include/coverhd.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- * This file should be updated after running the C overhead timing
- * test. Once this update has been performed, the RTEMS Time Test
- * Suite should be rebuilt to account for these overhead times in the
- * timing results.
- *
- * NOTE: If these are all zero, then the times reported include
- * all calling overhead including passing of arguments.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
-#define CALLING_OVERHEAD_TASK_CREATE 0
-#define CALLING_OVERHEAD_TASK_IDENT 0
-#define CALLING_OVERHEAD_TASK_START 0
-#define CALLING_OVERHEAD_TASK_RESTART 0
-#define CALLING_OVERHEAD_TASK_DELETE 0
-#define CALLING_OVERHEAD_TASK_SUSPEND 0
-#define CALLING_OVERHEAD_TASK_RESUME 0
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
-#define CALLING_OVERHEAD_TASK_MODE 0
-#define CALLING_OVERHEAD_TASK_GET_NOTE 0
-#define CALLING_OVERHEAD_TASK_SET_NOTE 0
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 0
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
-#define CALLING_OVERHEAD_CLOCK_GET 0
-#define CALLING_OVERHEAD_CLOCK_SET 0
-#define CALLING_OVERHEAD_CLOCK_TICK 0
-
-#define CALLING_OVERHEAD_TIMER_CREATE 0
-#define CALLING_OVERHEAD_TIMER_IDENT 0
-#define CALLING_OVERHEAD_TIMER_DELETE 0
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 0
-#define CALLING_OVERHEAD_TIMER_RESET 0
-#define CALLING_OVERHEAD_TIMER_CANCEL 0
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
-
-#define CALLING_OVERHEAD_EVENT_SEND 0
-#define CALLING_OVERHEAD_EVENT_RECEIVE 0
-#define CALLING_OVERHEAD_SIGNAL_CATCH 0
-#define CALLING_OVERHEAD_SIGNAL_SEND 0
-#define CALLING_OVERHEAD_PARTITION_CREATE 0
-#define CALLING_OVERHEAD_PARTITION_IDENT 0
-#define CALLING_OVERHEAD_PARTITION_DELETE 0
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
-#define CALLING_OVERHEAD_REGION_CREATE 0
-#define CALLING_OVERHEAD_REGION_IDENT 0
-#define CALLING_OVERHEAD_REGION_DELETE 0
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
-#define CALLING_OVERHEAD_PORT_CREATE 0
-#define CALLING_OVERHEAD_PORT_IDENT 0
-#define CALLING_OVERHEAD_PORT_DELETE 0
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 0
-#define CALLING_OVERHEAD_IO_OPEN 0
-#define CALLING_OVERHEAD_IO_CLOSE 0
-#define CALLING_OVERHEAD_IO_READ 0
-#define CALLING_OVERHEAD_IO_WRITE 0
-#define CALLING_OVERHEAD_IO_CONTROL 0
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
-
-#endif
diff --git a/c/src/lib/libbsp/m68k/idp/include/leds.h b/c/src/lib/libbsp/m68k/idp/include/leds.h
deleted file mode 100644
index f2c3257dd4..0000000000
--- a/c/src/lib/libbsp/m68k/idp/include/leds.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * leds.c -- control the led's on a Motorola mc68ec0x0 board.
- * Written by rob@cygnus.com (Rob Savoye)
- *
- * $Id$
- */
-
-#ifndef __LEDS_H__
-#define __LEDS_H__
-
-#define LED_ADDR 0xd00003
-#define LED_0 ~0x1
-#define LED_1 ~0x2
-#define LED_2 ~0x4
-#define LED_3 ~0x8
-#define LED_4 ~0x10
-#define LED_5 ~0x20
-#define LED_6 ~0x40
-#define LED_7 ~0x80
-#define LEDS_OFF 0xff
-#define LEDS_ON 0x0
-
-#define FUDGE(x) ((x >= 0xa && x <= 0xf) ? (x + 'a') & 0x7f : (x + '0') & 0x7f)
-
-extern void led_putnum( char );
-
-#endif /* __LEDS_H__ */
diff --git a/c/src/lib/libbsp/m68k/idp/startup/Makefile.in b/c/src/lib/libbsp/m68k/idp/startup/Makefile.in
deleted file mode 100644
index ae12a4c04b..0000000000
--- a/c/src/lib/libbsp/m68k/idp/startup/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-
diff --git a/c/src/lib/libbsp/m68k/idp/startup/bspstart.c b/c/src/lib/libbsp/m68k/idp/startup/bspstart.c
deleted file mode 100644
index 858de3fbfb..0000000000
--- a/c/src/lib/libbsp/m68k/idp/startup/bspstart.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-unsigned char *duart_base;
-extern struct duart_regs duart_info;
-
-#define DELAY 5000
-
-void led_putnum();
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- /* Create 64 KByte memory region for RTEMS executive */
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- m68k_isr_entry *monitors_vector_table;
- int index;
-
- duart_base = (unsigned char *)DUART_ADDR;
-
- /*
- * Set the VBR here to the monitor's default.
- */
-
- monitors_vector_table = (m68k_isr_entry *)0;
- /* This is where you set vector base register = 0 */
- m68k_set_vbr( monitors_vector_table );
-
- /* The vector interrupt table for the 680x0 is in appendix B-2
- of the M68000 Family Programmer's reference table */
- for ( index=2 ; index<=255 ; index++ )
- M68Kvec[ index ] = monitors_vector_table[ 32 ];
-
-
- M68Kvec[ 2 ] = monitors_vector_table[ 2 ]; /* bus error vector */
- M68Kvec[ 4 ] = monitors_vector_table[ 4 ]; /* breakpoints vector */
- M68Kvec[ 9 ] = monitors_vector_table[ 9 ]; /* trace vector */
-
- /*
- * Set the VBR here if you do not want to use the monitor's vector table.
- */
-
- m68k_set_vbr( &M68Kvec );
-
- m68k_enable_caching();
-
- /*
- * we only use a hook to get the C library initialized.
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec;
- Cpu_table.interrupt_stack_size = 4096;
-
- BSP_Configuration.work_space_start = (void *)
- (RAM_END - BSP_Configuration.work_space_size);
-
-/* led_putnum('e'); * for debugging purposes only */
-
- /* Clock_exit is done as an atexit() function */
-}
diff --git a/c/src/lib/libbsp/m68k/idp/startup/linkcmds b/c/src/lib/libbsp/m68k/idp/startup/linkcmds
deleted file mode 100644
index d35d1d17ac..0000000000
--- a/c/src/lib/libbsp/m68k/idp/startup/linkcmds
+++ /dev/null
@@ -1,70 +0,0 @@
-/* This file is a derivation of that found with the newlib-1.6 distribution
- * for the idp.ld file. That file, it appears, was originally written by
- * Rob Savoye. Other ideas came from Joel Sherrill for the RTEMS linkcmds
- * file (this is basically a mixture of the two).
- *
- * $Id$
- */
-
-/*
- * Setup the memory map of the MC68ec0x0 Board (IDP)
- * stack grows up towards high memory. This works for
- * both the rom68k and the mon68k monitors.
- */
-
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
-
-MEMORY
-{
- ram : org = 0x10000, l = 2M
-}
-
-SECTIONS
-{
- .text 0x10000:
- {
- text_start = . ;
- _text_start = . ;
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- etext = ALIGN( 0x10 ) ;
- _etext = .;
- }
- .data ADDR( .text ) + SIZEOF( .text ):
- {
- data_start = . ;
- _data_start = .;
- *(.data)
- edata = ALIGN( 0x10 ) ;
- _edata = .;
- }
- .bss ADDR( .data ) + SIZEOF( .data ):
- {
- bss_start = . ;
- _bss_start = . ;
- *(.bss)
- *(COMMON)
- . += StackSize; /* XXX -- Old gld can't handle this */
- . = ALIGN (16);
- stack_init = .;
- end = . ;
- _end = . ;
- }
-}
diff --git a/c/src/lib/libbsp/m68k/idp/timer/Makefile.in b/c/src/lib/libbsp/m68k/idp/timer/Makefile.in
deleted file mode 100644
index 0c8ec3ccaa..0000000000
--- a/c/src/lib/libbsp/m68k/idp/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=timerisr
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/idp/timer/timer.c b/c/src/lib/libbsp/m68k/idp/timer/timer.c
deleted file mode 100644
index d000cbc46d..0000000000
--- a/c/src/lib/libbsp/m68k/idp/timer/timer.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Timer_init()
- *
- * This routine initializes the MC68230 timer on the Motorola IDP board.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: This routine will not work if the optimizer is enabled
- * for some compilers. The multiple writes to the MC68230
- * may be optimized away.
- *
- * It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * Code Modified for the MC68230 by Doug McBride, Colorado Space Grant College
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <motorola/mc68230.h>
-
-#define TIMER_VECTOR 0x4D
-
-int Ttimer_val;
-rtems_boolean Timer_driver_Find_average_overhead;
-
-rtems_isr timerisr();
-
-void Timer_initialize()
-{
- (void) set_vector( timerisr, TIMER_VECTOR, 0 ); /* install ISR */
-
- Ttimer_val = 0; /* clear timer ISR count */
-
- /* some PI/T initialization stuff here */
- /* Set up the interrupt vector on the MC68230 chip:
- TIVR = TIMER_VECTOR; */
- MC68230_WRITE (TIVR, TIMER_VECTOR);
-
- /* Set CPRH through CPRL to maximum count to reduce interrupt overhead
- CPRH = 0xFF;
- CPRM = 0xFF;
- CPRL = 0xFF; */
- MC68230_WRITE (CPRH, 0xFF);
- MC68230_WRITE (CPRM, 0xFF);
- MC68230_WRITE (CPRL, 0xFF);
-
- /* Enable timer and use it as an external periodic interrupt generator
- TCR = 0xA1; */
- MC68230_WRITE (TCR, 0xA1);
-
-}
-
-#define AVG_OVERHEAD 9 /* may not be right -- do this later */
-#define LEAST_VALID 10 /* Don't trust a value lower than this */
-
-int Read_timer()
-{
- rtems_unsigned8 data;
- rtems_unsigned8 msb, osb, lsb;
- rtems_unsigned32 remaining, total;
-
- /* Disable timer so that timer can be read
- data = TCR;
- TCR = (data & 0xFE); */
- MC68230_READ (TCR, data);
- MC68230_WRITE (TCR, (data & 0xFE));
-
- /* Read the counter value
- msb = CNTRH;
- osb = CNTRM;
- lsb = CNTRL; */
- MC68230_READ (CNTRH, msb);
- MC68230_READ (CNTRM, osb);
- MC68230_READ (CNTRL, lsb);
-
- /* Calculate the time so far */
- remaining = 0x1000000 - ((msb << 16) + (osb << 8) + lsb);
- total = (Ttimer_val * 0x1000000) + remaining;
-
- /* Enable timer so that timer can continue
- TCR = 0xA1; */
- MC68230_WRITE (TCR, 0xA1);
-
- /* do not restore old vector */
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in countdown units */
-
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
-
- /* Clocked at 6.5 Mhz */
- /* Avoid floating point problems, be lazy, and return the total minus
- the average overhead */
- return (total - AVG_OVERHEAD);
-}
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/m68k/idp/timer/timerisr.s b/c/src/lib/libbsp/m68k/idp/timer/timerisr.s
deleted file mode 100644
index 74461f3714..0000000000
--- a/c/src/lib/libbsp/m68k/idp/timer/timerisr.s
+++ /dev/null
@@ -1,38 +0,0 @@
-/* timer_isr()
- *
- * This routine provides the ISR for the MC68230 timer on the Motorola
- * IDP board. The timer is set up to generate an interrupt at maximum
- * intervals.
- *
- * Code modified by Doug McBride, Colorado Space Grant College
- * countdown should be loaded automatically
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-
-BEGIN_CODE
-
-.set TSR, 0x00c0106B | base address of PIT register "TSR"
-
- PUBLIC (timerisr)
-SYM (timerisr):
- movb #1,TSR | acknowledge interrupt
- addql #1, SYM (Ttimer_val) | increment timer value
- rte
-
-END_CODE
-END
diff --git a/c/src/lib/libbsp/m68k/idp/times b/c/src/lib/libbsp/m68k/idp/times
deleted file mode 100644
index 92864585f3..0000000000
--- a/c/src/lib/libbsp/m68k/idp/times
+++ /dev/null
@@ -1,193 +0,0 @@
-#
-# Timing Test Suite Results for the Motorola IDP BSP
-#
-# $Id$
-#
-
-NOTE: This BSP is used submitted and no information is currently available.
-
-Board: IDP
-CPU:
-Clock Speed:
-Memory Configuration: SRAM, DRAM, cache, etc
-Wait States:
-
-Times Reported in: cycles, microseconds, etc
-Timer Source: Count Down Timer, on-CPU cycle counter, etc
-
-Column A: unused
-Column B: unused
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 20
- rtems_semaphore_delete 21
- rtems_semaphore_obtain: available 15
- rtems_semaphore_obtain: not available -- NO_WAIT 15
- rtems_semaphore_release: no waiting tasks 16
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 62
-
- 3 rtems_semaphore_release: task readied -- preempts caller 55
-
- 4 rtems_task_restart: blocked task -- preempts caller 77
- rtems_task_restart: ready task -- preempts caller 70
- rtems_semaphore_release: task readied -- returns to caller 25
- rtems_task_create 57
- rtems_task_start 31
- rtems_task_restart: suspended task -- returns to caller 36
- rtems_task_delete: suspended task 47
- rtems_task_restart: ready task -- returns to caller 37
- rtems_task_restart: blocked task -- returns to caller 46
- rtems_task_delete: blocked task 50
-
- 5 rtems_task_suspend: calling task 51
- rtems_task_resume: task readied -- preempts caller 49
-
- 6 rtems_task_restart: calling task 59
- rtems_task_suspend: returns to caller 18
- rtems_task_resume: task readied -- returns to caller 19
- rtems_task_delete: ready task 50
-
- 7 rtems_task_restart: suspended task -- preempts caller 70
-
- 8 rtems_task_set_priority: obtain current priority 12
- rtems_task_set_priority: returns to caller 27
- rtems_task_mode: obtain current mode 5
- rtems_task_mode: no reschedule 5
- rtems_task_mode: reschedule -- returns to caller 8
- rtems_task_mode: reschedule -- preempts caller 39
- rtems_task_set_note 13
- rtems_task_get_note 13
- rtems_clock_set 33
- rtems_clock_get 3
-
- 9 rtems_message_queue_create 110
- rtems_message_queue_send: no waiting tasks 37
- rtems_message_queue_urgent: no waiting tasks 37
- rtems_message_queue_receive: available 31
- rtems_message_queue_flush: no messages flushed 12
- rtems_message_queue_flush: messages flushed 16
- rtems_message_queue_delete 26
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 15
- rtems_message_queue_receive: not available -- caller blocks 62
-
-11 rtems_message_queue_send: task readied -- preempts caller 72
-
-12 rtems_message_queue_send: task readied -- returns to caller 39
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 72
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 39
-
-15 rtems_event_receive: obtain current events 1
- rtems_event_receive: not available -- NO_WAIT 12
- rtems_event_receive: not available -- caller blocks 56
- rtems_event_send: no task readied 12
- rtems_event_receive: available 12
- rtems_event_send: task readied -- returns to caller 24
-
-16 rtems_event_send: task readied -- preempts caller 55
-
-17 rtems_task_set_priority: preempts caller 62
-
-18 rtems_task_delete: calling task 83
-
-19 rtems_signal_catch 9
- rtems_signal_send: returns to caller 15
- rtems_signal_send: signal to self 18
- exit ASR overhead: returns to calling task 22
- exit ASR overhead: returns to preempting task 49
-
-20 rtems_partition_create 35
- rtems_region_create 23
- rtems_partition_get_buffer: available 15
- rtems_partition_get_buffer: not available 13
- rtems_partition_return_buffer 18
- rtems_partition_delete 16
- rtems_region_get_segment: available 22
- rtems_region_get_segment: not available -- NO_WAIT 21
- rtems_region_return_segment: no waiting tasks 19
- rtems_region_get_segment: not available -- caller blocks 64
- rtems_region_return_segment: task readied -- preempts caller 74
- rtems_region_return_segment: task readied -- returns to caller 44
- rtems_region_delete 16
- rtems_io_initialize 2
- rtems_io_open 1
- rtems_io_close 1
- rtems_io_read 1
- rtems_io_write 1
- rtems_io_control 1
-
-21 rtems_task_ident 149
- rtems_message_queue_ident 145
- rtems_semaphore_ident 156
- rtems_partition_ident 145
- rtems_region_ident 148
- rtems_port_ident 145
- rtems_timer_ident 145
- rtems_rate_monotonic_ident 145
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 42
- rtems_message_queue_broadcast: no waiting tasks 17
- rtems_message_queue_broadcast: task readied -- preempts caller 78
-
-23 rtems_timer_create 14
- rtems_timer_fire_after: inactive 22
- rtems_timer_fire_after: active 24
- rtems_timer_cancel: active 15
- rtems_timer_cancel: inactive 13
- rtems_timer_reset: inactive 21
- rtems_timer_reset: active 23
- rtems_timer_fire_when: inactive 34
- rtems_timer_fire_when: active 34
- rtems_timer_delete: active 19
- rtems_timer_delete: inactive 17
- rtems_task_wake_when 69
-
-24 rtems_task_wake_after: yield -- returns to caller 9
- rtems_task_wake_after: yields -- preempts caller 45
-
-25 rtems_clock_tick 4
-
-26 _ISR_Disable 0
- _ISR_Flash 1
- _ISR_Enable 1
- _Thread_Disable_dispatch 0
- _Thread_Enable_dispatch 7
- _Thread_Set_state 11
- _Thread_Disptach (NO FP) 31
- context switch: no floating point contexts 21
- context switch: self 10
- context switch: to another task 10
- context switch: restore 1st FP task 25
- fp context switch: save idle, restore idle 31
- fp context switch: save idle, restore initialized 19
- fp context switch: save initialized, restore initialized 20
- _Thread_Resume 7
- _Thread_Unblock 7
- _Thread_Ready 9
- _Thread_Get 4
- _Semaphore_Get 2
- _Thread_Get: invalid id 0
-
-27 interrupt entry overhead: returns to interrupted task 6
- interrupt exit overhead: returns to interrupted task 6
- interrupt entry overhead: returns to nested interrupt 6
- interrupt exit overhead: returns to nested interrupt 5
- interrupt entry overhead: returns to preempting task 7
- interrupt exit overhead: returns to preempting task 36
-
-28 rtems_port_create 16
- rtems_port_external_to_internal 11
- rtems_port_internal_to_external 11
- rtems_port_delete 16
-
-29 rtems_rate_monotonic_create 15
- rtems_rate_monotonic_period: initiate period -- returns to caller 21
- rtems_rate_monotonic_period: obtain status 13
- rtems_rate_monotonic_cancel 16
- rtems_rate_monotonic_delete: inactive 18
- rtems_rate_monotonic_delete: active 20
- rtems_rate_monotonic_period: conclude periods -- caller blocks 53
diff --git a/c/src/lib/libbsp/m68k/idp/wrapup/Makefile.in b/c/src/lib/libbsp/m68k/idp/wrapup/Makefile.in
deleted file mode 100644
index 72cc6fe051..0000000000
--- a/c/src/lib/libbsp/m68k/idp/wrapup/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console timer
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/m68k/mvme136/Makefile.in b/c/src/lib/libbsp/m68k/mvme136/Makefile.in
deleted file mode 100644
index 7a8d6260ed..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include startup clock console shmsupp timer wrapup
diff --git a/c/src/lib/libbsp/m68k/mvme136/bsp_specs b/c/src/lib/libbsp/m68k/mvme136/bsp_specs
deleted file mode 100644
index 61dac86b53..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start.o%s} \
-%{qrtems_debug: start_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/m68k/mvme136/clock/Makefile.in b/c/src/lib/libbsp/m68k/mvme136/clock/Makefile.in
deleted file mode 100644
index d882f1d00f..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/clock/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/mvme136/clock/ckinit.c b/c/src/lib/libbsp/m68k/mvme136/clock/ckinit.c
deleted file mode 100644
index 9337b44717..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/clock/ckinit.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/* Clock_init()
- *
- * This routine initializes the Z80386 1 on the MVME136 board.
- * The tick frequency is 1 millisecond.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <zilog/z8036.h>
-
-#define MICRVAL 0xe2 /* disable lower chain, no vec */
- /* set right justified addr */
- /* and master int enable */
-#define MCCRVAL 0xc4 /* enable T1 and port B */
- /* timers independent */
-#define MS_COUNT 0x07d0 /* T1's countdown constant (1 ms) */
-#define T1MSRVAL 0x80 /* T1 cont. cycle/pulse output */
-#define T1CSRVAL 0xc6 /* enable interrupt, allow and */
- /* and trigger countdown */
-
-#define TIMER 0xfffb0000
-#define RELOAD 0x24 /* clr IP & IUS,allow countdown */
-
-#define CLOCK_VECTOR 66
-
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-
-volatile rtems_unsigned32 Clock_driver_ticks; /* ticks since initialization */
-
-rtems_isr_entry Old_ticker;
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-/*
- * ISR Handler
- */
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
- Clock_driver_ticks += 1;
- ((volatile struct z8036_map *) TIMER)->CT1_CMD_STATUS = RELOAD;
-
- if ( Clock_isrs == 1 ) {
- rtems_clock_tick();
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
- }
- else
- Clock_isrs -= 1;
-}
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
- volatile struct z8036_map *timer;
-
- Clock_driver_ticks = 0;
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
- timer = (struct z8036_map *) 0xfffb0000;
- timer->MASTER_INTR = MICRVAL;
- timer->CT1_MODE_SPEC = T1MSRVAL;
-
- *((rtems_unsigned16 *)0xfffb0016) = MS_COUNT; /* write countdown value */
-
- /*
- * timer->CT1_TIME_CONST_MSB = (MS_COUNT >> 8);
- * timer->CT1_TIME_CONST_LSB = (MS_COUNT & 0xff);
- */
-
- timer->MASTER_CFG = MCCRVAL;
- timer->CT1_CMD_STATUS = T1CSRVAL;
-
- /*
- * Enable interrupt via VME interrupt mask register
- */
- (*(rtems_unsigned8 *)0xfffb0038) &= 0xfd;
-
- atexit( Clock_exit );
- }
-
-}
-
-void Clock_exit( void )
-{
- volatile struct z8036_map *timer;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- timer = (struct z8036_map *) 0xfffb0000;
- timer->MASTER_INTR = 0x62;
- timer->CT1_MODE_SPEC = 0x00;
- timer->MASTER_CFG = 0xf4;
- timer->CT1_CMD_STATUS = 0x00;
- /* do not restore old vector */
- }
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/m68k/mvme136/console/Makefile.in b/c/src/lib/libbsp/m68k/mvme136/console/Makefile.in
deleted file mode 100644
index fd05ddfedd..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/mvme136/console/console.c b/c/src/lib/libbsp/m68k/mvme136/console/console.c
deleted file mode 100644
index 0ffe05e490..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/console/console.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * This file contains the MVME136 console IO package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 M136_INIT
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- _Write_m681 = ( struct w_m681_info * ) M681ADDR;
- _Read_m681 = ( struct r_m681_info * ) M681ADDR;
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-}
-
-
-/* is_character_ready
- *
- * This routine returns TRUE if a character is available.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_boolean is_character_ready(
- char *ch
-)
-{
- if ( !(_Read_m681->srb & RXRDYB) )
- return(FALSE);
-
- *ch = _Read_m681->rbb;
- return(TRUE);
-}
-
-/* inbyte
- *
- * This routine reads a character from the UART.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- * character read from UART
- */
-
-char inbyte( void )
-{
- while ( !(_Read_m681->srb & RXRDYB) );
- return _Read_m681->rbb;
-}
-
-
-/* outbyte
- *
- * This routine transmits a character out the M68681. It supports
- * XON/XOFF flow control.
- *
- * Input parameters:
- * ch - character to be transmitted
- *
- * Output parameters: NONE
- */
-
-void outbyte(
- char ch
-)
-{
- while ( ! (_Read_m681->srb & TXRDYB) ) ;
- while ( _Read_m681->srb & RXRDYB ) /* must be an XOFF */
- if ( _Read_m681->rbb == XOFF )
- do {
- while ( ! (_Read_m681->srb & RXRDYB) ) ;
- } while ( _Read_m681->rbb != XON );
-
- _Write_m681->tbb = ch;
- if ( ch == '\n' )
- outbyte( CR );
-}
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte();
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r');
- }
- outbyte( buffer[ count ] );
- }
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/m68k/mvme136/include/Makefile.in b/c/src/lib/libbsp/m68k/mvme136/include/Makefile.in
deleted file mode 100644
index 7d8581095f..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/m68k/mvme136/include/bsp.h b/c/src/lib/libbsp/m68k/mvme136/include/bsp.h
deleted file mode 100644
index e88bf90c4c..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/include/bsp.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/* bsp.h
- *
- * This include file contains all MVME136 board IO definitions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MVME136_h
-#define __MVME136_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <clockdrv.h>
-#include <console.h>
-#include <iosupp.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Define the interrupt mechanism for Time Test 27
- *
- * NOTE: Use the MPCSR vector for the MVME136
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), 75, 1 )
-
-#define Cause_tm27_intr() (*(volatile rtems_unsigned8 *)0xfffb006b) = 0x80
-
-#define Clear_tm27_intr() (*(volatile rtems_unsigned8 *)0xfffb006b) = 0x00
-
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( microseconds ) \
- { register rtems_unsigned32 _delay=(microseconds); \
- register rtems_unsigned32 _tmp=123; \
- asm volatile( "0: \
- nbcd %0 ; \
- nbcd %0 ; \
- dbf %1,0b" \
- : "=d" (_tmp), "=d" (_delay) \
- : "0" (_tmp), "1" (_delay) ); \
- }
-
-/* Constants */
-
-#define RAM_START 0
-#define RAM_END 0x100000
-
-#define M681ADDR 0xfffb0040 /* address of the M68681 chip */
-#define RXRDYB 0x01 /* status reg recv ready mask */
-#define TXRDYB 0x04 /* status reg trans ready mask */
-#define PARITYERR 0x20 /* status reg parity error mask */
-#define FRAMEERR 0x40 /* status reg frame error mask */
-
-
-#define FOREVER 1 /* infinite loop */
-
-/* Structures */
-
-struct r_m681_info {
- char fill1[ 5 ]; /* channel A regs ( not used ) */
- char isr; /* interrupt status reg */
- char fill2[ 2 ]; /* counter regs (not used) */
- char mr1mr2b; /* MR1B and MR2B regs */
- char srb; /* status reg channel B */
- char fill3; /* do not access */
- char rbb; /* receive buffer channel B */
- char ivr; /* interrupt vector register */
-};
-
-struct w_m681_info {
- char fill1[ 4 ]; /* channel A regs (not used) */
- char acr; /* auxillary control reg */
- char imr; /* interrupt mask reg */
- char fill2[ 2 ]; /* counter regs (not used) */
- char mr1mr2b; /* MR1B and MR2B regs */
- char csrb; /* clock select reg */
- char crb; /* command reg */
- char tbb; /* transmit buffer channel B */
- char ivr; /* interrupt vector register */
-};
-
-#ifdef M136_INIT
-#undef EXTERN
-#define EXTERN
-#else
-#undef EXTERN
-#define EXTERN extern
-#endif
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-/* M68681 DUART chip register variables */
-
-EXTERN volatile struct r_m681_info *_Read_m681; /* M68681 read registers */
-EXTERN volatile struct w_m681_info *_Write_m681; /* M68681 write registers */
-
-extern m68k_isr_entry M68Kvec[]; /* vector table address */
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-m68k_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/mvme136/include/coverhd.h b/c/src/lib/libbsp/m68k/mvme136/include/coverhd.h
deleted file mode 100644
index 45a66b551d..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/include/coverhd.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C on this target.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 2
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 1
-#define CALLING_OVERHEAD_TASK_CREATE 3
-#define CALLING_OVERHEAD_TASK_IDENT 2
-#define CALLING_OVERHEAD_TASK_START 2
-#define CALLING_OVERHEAD_TASK_RESTART 2
-#define CALLING_OVERHEAD_TASK_DELETE 1
-#define CALLING_OVERHEAD_TASK_SUSPEND 1
-#define CALLING_OVERHEAD_TASK_RESUME 2
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 2
-#define CALLING_OVERHEAD_TASK_MODE 2
-#define CALLING_OVERHEAD_TASK_GET_NOTE 2
-#define CALLING_OVERHEAD_TASK_SET_NOTE 2
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 4
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 1
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 2
-#define CALLING_OVERHEAD_CLOCK_GET 5
-#define CALLING_OVERHEAD_CLOCK_SET 4
-#define CALLING_OVERHEAD_CLOCK_TICK 1
-
-#define CALLING_OVERHEAD_TIMER_CREATE 2
-#define CALLING_OVERHEAD_TIMER_IDENT 1
-#define CALLING_OVERHEAD_TIMER_DELETE 2
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 2
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 5
-#define CALLING_OVERHEAD_TIMER_RESET 1
-#define CALLING_OVERHEAD_TIMER_CANCEL 1
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 3
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 1
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 2
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 2
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 2
-
-#define CALLING_OVERHEAD_EVENT_SEND 2
-#define CALLING_OVERHEAD_EVENT_RECEIVE 2
-#define CALLING_OVERHEAD_SIGNAL_CATCH 2
-#define CALLING_OVERHEAD_SIGNAL_SEND 2
-#define CALLING_OVERHEAD_PARTITION_CREATE 3
-#define CALLING_OVERHEAD_PARTITION_IDENT 2
-#define CALLING_OVERHEAD_PARTITION_DELETE 1
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 2
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 2
-#define CALLING_OVERHEAD_REGION_CREATE 3
-#define CALLING_OVERHEAD_REGION_IDENT 2
-#define CALLING_OVERHEAD_REGION_DELETE 2
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 3
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 2
-#define CALLING_OVERHEAD_PORT_CREATE 3
-#define CALLING_OVERHEAD_PORT_IDENT 2
-#define CALLING_OVERHEAD_PORT_DELETE 1
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 2
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 2
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 2
-#define CALLING_OVERHEAD_IO_OPEN 2
-#define CALLING_OVERHEAD_IO_CLOSE 3
-#define CALLING_OVERHEAD_IO_READ 2
-#define CALLING_OVERHEAD_IO_WRITE 2
-#define CALLING_OVERHEAD_IO_CONTROL 2
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 2
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 1
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/mvme136/shmsupp/Makefile.in b/c/src/lib/libbsp/m68k/mvme136/shmsupp/Makefile.in
deleted file mode 100644
index 031a0aa0cd..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/shmsupp/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/shmsupp.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=addrconv getcfg lock mpisr
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/m68k/mvme136/shmsupp/addrconv.c b/c/src/lib/libbsp/m68k/mvme136/shmsupp/addrconv.c
deleted file mode 100644
index 540df871fc..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/shmsupp/addrconv.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Shm_Convert_address
- *
- * This MVME136 has a "normal" view of the VME address space.
- * No address range conversion is required.
- *
- * Input parameters:
- * address - address to convert
- *
- * Output parameters:
- * returns - converted address
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-void *Shm_Convert_address(
- void *address
-)
-{
- return ( address );
-}
diff --git a/c/src/lib/libbsp/m68k/mvme136/shmsupp/getcfg.c b/c/src/lib/libbsp/m68k/mvme136/shmsupp/getcfg.c
deleted file mode 100644
index c410ee34fc..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/shmsupp/getcfg.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* void Shm_Get_configuration( localnode, &shmcfg )
- *
- * This routine initializes, if necessary, and returns a pointer
- * to the Shared Memory Configuration Table for the Cyclone CVME961.
- *
- * INPUT PARAMETERS:
- * localnode - local node number
- * shmcfg - address of pointer to SHM Config Table
- *
- * OUTPUT PARAMETERS:
- * *shmcfg - pointer to SHM Config Table
- *
- * NOTES: The MPCSR interrupt on the MVME136 is used as an interprocessor
- * interrupt. The capablities of the MPCSR are used to generate
- * interprocessor interrupts for up to eight nodes.
- *
- * The following table illustrates the configuration limitations:
- *
- * BUS MAX
- * MODE ENDIAN NODES
- * ========= ====== =======
- * POLLED LITTLE 2+
- * INTERRUPT LITTLE 2-8
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.h"
-
-#define INTERRUPT 1 /* MVME136 target supports both */
-#define POLLING 0 /* polling and interrupt modes */
-
-shm_config_table BSP_shm_cfgtbl;
-
-rtems_unsigned32 *BSP_int_address()
-{
- rtems_unsigned32 id, offset;
-
- id = (rtems_unsigned32) *(rtems_unsigned8 *)0xfffb0061;
- offset = ((id & 0x1f) << 5) | ((id & 0xe0) << 8);
- offset |= 0xffff000b;
- return( (rtems_unsigned32 * ) offset );
-}
-
-void Shm_Get_configuration(
- rtems_unsigned32 localnode,
- shm_config_table **shmcfg
-)
-{
- BSP_shm_cfgtbl.base = (rtems_unsigned32 *)0x20000000;
- BSP_shm_cfgtbl.length = 1 * MEGABYTE;
- BSP_shm_cfgtbl.format = SHM_BIG;
-
- BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt;
-
-#ifdef NEUTRAL_BIG
- BSP_shm_cfgtbl.convert = NULL_CONVERT;
-#else
- BSP_shm_cfgtbl.convert = CPU_swap_u32;
-#endif
-
-#if (POLLING==1)
- BSP_shm_cfgtbl.poll_intr = POLLED_MODE;
- BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT;
-#else
- BSP_shm_cfgtbl.poll_intr = INTR_MODE;
- BSP_shm_cfgtbl.Intr.address = BSP_int_address();
- BSP_shm_cfgtbl.Intr.value = 0x80;
- BSP_shm_cfgtbl.Intr.length = BYTE;
-#endif
-
- *shmcfg = &BSP_shm_cfgtbl;
-
-}
diff --git a/c/src/lib/libbsp/m68k/mvme136/shmsupp/lock.c b/c/src/lib/libbsp/m68k/mvme136/shmsupp/lock.c
deleted file mode 100644
index b1517c7ee2..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/shmsupp/lock.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Shared Memory Lock Routines
- *
- * This shared memory locked queue support routine need to be
- * able to lock the specified locked queue. Interrupts are
- * disabled while the queue is locked to prevent preemption
- * and deadlock when two tasks poll for the same lock.
- * previous level.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-/*
- * Shm_Initialize_lock
- *
- * Initialize the lock for the specified locked queue.
- */
-
-void Shm_Initialize_lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- lq_cb->lock = LQ_UNLOCKED;
-}
-
-/* void _Shm_Lock( &lq_cb )
- *
- * This shared memory locked queue support routine locks the
- * specified locked queue. It disables interrupts to prevent
- * a deadlock condition.
- */
-
-void Shm_Lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
- rtems_unsigned32 *lockptr = (rtems_unsigned32 *)&lq_cb->lock;
-
- rtems_interrupt_disable( isr_level );
- Shm_isrstat = isr_level;
- asm volatile( "lockit:" : : );
- asm volatile( "tas %0@" : "=a" (lockptr) : "0" (lockptr) );
- asm volatile( "bne lockit" : : );
-/* should delay */
-}
-
-/*
- * Shm_Unlock
- *
- * Unlock the lock for the specified locked queue.
- */
-
-void Shm_Unlock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
-
- lq_cb->lock = SHM_UNLOCK_VALUE;
- isr_level = Shm_isrstat;
- rtems_interrupt_enable( isr_level );
-}
-
diff --git a/c/src/lib/libbsp/m68k/mvme136/shmsupp/mpisr.c b/c/src/lib/libbsp/m68k/mvme136/shmsupp/mpisr.c
deleted file mode 100644
index 6b735098b7..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/shmsupp/mpisr.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Shm_isr_mvme136()
- *
- * NOTE: This routine is not used when in polling mode. Either
- * this routine OR Shm_clockisr is used in a particular system.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-rtems_isr Shm_isr_mvme136()
-{
- Shm_Interrupt_count += 1;
- rtems_multiprocessing_announce();
- (*(volatile rtems_unsigned8 *)0xfffb006b) = 0; /* clear MPCSR intr */
-}
-
-/* void _Shm_setvec( )
- *
- * This driver routine sets the SHM interrupt vector to point to the
- * driver's SHM interrupt service routine.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void Shm_setvec()
-{
- /* may need to disable intr */
- set_vector( Shm_isr_mvme136, 75, 1 );
-}
diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in b/c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in
deleted file mode 100644
index c4f1163cf9..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(srcdir)/linkcmds $(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-
diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/bspclean.c b/c/src/lib/libbsp/m68k/mvme136/startup/bspclean.c
deleted file mode 100644
index 76ad05b209..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/startup/bspclean.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * This routine returns control to 135Bug.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <clockdrv.h>
-#include <zilog/z8036.h>
-
-void bsp_return_to_monitor_trap()
-{
- extern void start( void );
-
- register volatile void *start_addr;
-
- m68k_set_vbr( 0 ); /* restore 135Bug vectors */
- asm volatile( "trap #15" ); /* trap to 135Bug */
- asm volatile( ".short 0x63" ); /* return to 135Bug (.RETURN) */
- /* restart program */
- start_addr = start;
-
- asm volatile ( "jmp %0@" : "=a" (start_addr) : "0" (start_addr) );
-}
-
-#define TIMER 0xfffb0000
-
-void bsp_cleanup( void )
-{
- Z8x36_WRITE( TIMER, MASTER_INTR, 0x62 ); /* redo timer */
- Z8x36_WRITE( TIMER, CT1_MODE_SPEC, 0x00 );
- Z8x36_WRITE( TIMER, MASTER_CFG, 0xf4 );
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0x00 );
-
- M68Kvec[ 45 ] = bsp_return_to_monitor_trap; /* install handler */
- asm volatile( "trap #13" ); /* insures SUPV mode */
-}
diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c
deleted file mode 100644
index b7890f4598..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-#include <zilog/z8036.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- m68k_isr_entry *monitors_vector_table;
- int index;
-
- monitors_vector_table = (m68k_isr_entry *)0; /* 135Bug Vectors are at 0 */
- m68k_set_vbr( monitors_vector_table );
-
- for ( index=2 ; index<=255 ; index++ )
- M68Kvec[ index ] = monitors_vector_table[ 32 ];
-
- M68Kvec[ 2 ] = monitors_vector_table[ 2 ]; /* bus error vector */
- M68Kvec[ 4 ] = monitors_vector_table[ 4 ]; /* breakpoints vector */
- M68Kvec[ 9 ] = monitors_vector_table[ 9 ]; /* trace vector */
- M68Kvec[ 47 ] = monitors_vector_table[ 47 ]; /* system call vector */
-
- m68k_set_vbr( &M68Kvec );
-
- (*(rtems_unsigned8 *)0xfffb0067) = 0x7f; /* make VME access round-robin */
-
- m68k_enable_caching();
-
- /*
- * we only use a hook to get the C library initialized.
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec;
- Cpu_table.interrupt_stack_size = 4096;
-
- BSP_Configuration.work_space_start = (void *)
- (RAM_END - BSP_Configuration.work_space_size);
-
-}
diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds
deleted file mode 100644
index eb88a08bfe..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the Motorola MVME136/MVME135 boards.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
-MEMORY
- {
- ram : org = 0x3000, l = 1M
- }
-
-SECTIONS
-{
- .text 0x3000 :
- {
- text_start = . ;
- _text_start = . ;
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- etext = ALIGN( 0x10 ) ;
- _etext = .;
- }
- .data ADDR( .text ) + SIZEOF( .text ):
- {
- data_start = . ;
- _data_start = .;
- *(.data)
- edata = ALIGN( 0x10 ) ;
- _edata = .;
- }
- .bss ADDR( .data ) + SIZEOF( .data ):
- {
- bss_start = . ;
- _bss_start = . ;
- *(.bss)
- *(COMMON)
- . += StackSize; /* XXX -- Old gld can't handle this */
- . = ALIGN (16);
- stack_init = .;
- end = . ;
- _end = . ;
- }
-}
diff --git a/c/src/lib/libbsp/m68k/mvme136/timer/Makefile.in b/c/src/lib/libbsp/m68k/mvme136/timer/Makefile.in
deleted file mode 100644
index 24809cbed8..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=timerisr
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/mvme136/timer/timer.c b/c/src/lib/libbsp/m68k/mvme136/timer/timer.c
deleted file mode 100644
index c3c66f1d37..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/timer/timer.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Timer_init()
- *
- * This routine initializes the Z8036 timer on the MVME136 board.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: This routine will not work if the optimizer is enabled
- * for some compilers. The multiple writes to the Z8036
- * may be optimized away.
- *
- * It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <bsp.h>
-#include <zilog/z8036.h>
-
-#define TIMER 0xfffb0000 /* address of Z8036 on MVME136 */
-
-int Ttimer_val;
-rtems_boolean Timer_driver_Find_average_overhead;
-
-rtems_isr timerisr();
-
-void Timer_initialize()
-{
- (void) set_vector( timerisr, 66, 0 ); /* install ISR */
-
- Ttimer_val = 0; /* clear timer ISR count */
- Z8x36_WRITE( TIMER, MASTER_INTR, 0x01 ); /* reset */
- Z8x36_WRITE( TIMER, MASTER_INTR, 0x00 ); /* clear reset */
- Z8x36_WRITE( TIMER, MASTER_INTR, 0xe2 ); /* disable lower chain, no vec */
- /* set right justified addr */
- /* and master int enable */
- Z8x36_WRITE( TIMER, CT1_MODE_SPEC, 0x80 ); /* T1 continuous, and */
- /* cycle/pulse output */
-
- *((rtems_unsigned16 *)0xfffb0016) = 0x0000; /* write countdown value */
-/*
- Z8x36_WRITE( TIMER, CT1_TIME_CONST_MSB, 0x00 );
- Z8x36_WRITE( TIMER, CT1_TIME_CONST_LSB, 0x00 );
-*/
- Z8x36_WRITE( TIMER, MASTER_CFG, 0xc4 ); /* enable timer1 */
-
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0xc6 ); /* set INTR enable (IE), */
- /* trigger command */
- /* (TCB) and gate */
- /* command (GCB) bits */
- *((rtems_unsigned8 *)0xfffb0038) &= 0xfd; /* enable timer INTR on */
- /* VME controller */
-}
-
-#define AVG_OVERHEAD 6 /* It typically takes 3.0 microseconds */
- /* (6 countdowns) to start/stop the timer. */
-#define LEAST_VALID 10 /* Don't trust a value lower than this */
-
-int Read_timer()
-{
-/*
- rtems_unsigned8 msb, lsb;
-*/
- rtems_unsigned32 remaining, total;
-
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0xce ); /* read the counter value */
-remaining = 0xffff - *((rtems_unsigned16 *) 0xfffb0010);
-/*
- Z8x36_READ( TIMER, CT1_CUR_CNT_MSB, msb );
- Z8x36_READ( TIMER, CT1_CUR_CNT_LSB, lsb );
-
- remaining = 0xffff - ((msb << 8) + lsb);
-*/
- total = (Ttimer_val * 0x10000) + remaining;
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in one-half microsecond units */
-
- else {
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
- return (total-AVG_OVERHEAD) >> 1;
- }
-}
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/m68k/mvme136/timer/timerisr.s b/c/src/lib/libbsp/m68k/mvme136/timer/timerisr.s
deleted file mode 100644
index 63ee63bd8e..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/timer/timerisr.s
+++ /dev/null
@@ -1,39 +0,0 @@
-/* timer_isr()
- *
- * This routine provides the ISR for the Z8036 timer on the MVME136
- * board. The timer is set up to generate an interrupt at maximum
- * intervals.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-
-BEGIN_CODE
-
-.set CT1_CMD_STATUS, 0xfffb000a | port A
-.set RELOAD, 0x24 | clr IP & IUS,allow countdown
-
- PUBLIC (timerisr)
-SYM (timerisr):
- movl a0,a7@- | save a0
- movl #CT1_CMD_STATUS,a0 | a0 = addr of cmd status reg
- movb #RELOAD,a0@ | reload countdown
- addql #1, SYM (Ttimer_val) | increment timer value
- movl a7@+,a0 | save a0
- rte
-
-END_CODE
-END
diff --git a/c/src/lib/libbsp/m68k/mvme136/times b/c/src/lib/libbsp/m68k/mvme136/times
deleted file mode 100644
index b5b2109554..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/times
+++ /dev/null
@@ -1,191 +0,0 @@
-#
-# Timing Test Suite Results for the Motorola MVME136 BSP
-#
-# $Id$
-#
-
-Board: Motorola MVME136
-CPU: Motorola MC68020 + MC68881 FPU
-Clock Speed: 20 Mhz
-Memory Configuration: DRAM w/no cache
-Wait States: 1 wait state
-
-Times Reported in: microseconds
-Timer Source: Zilog Z8036
-
-Column A: 3.5.1 pre-release
-Column B: 3.5.17 pre-release
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 67 60
- rtems_semaphore_delete 64 58
- rtems_semaphore_obtain: available 46 38
- rtems_semaphore_obtain: not available -- NO_WAIT 45 38
- rtems_semaphore_release: no waiting tasks 51 44
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 113 109
-
- 3 rtems_semaphore_release: task readied -- preempts caller 94 87
-
- 4 rtems_task_restart: blocked task -- preempts caller 152 149
- rtems_task_restart: ready task -- preempts caller 145 142
- rtems_semaphore_release: task readied -- returns to caller 71 66
- rtems_task_create 154 148
- rtems_task_start 82 76
- rtems_task_restart: suspended task -- returns to caller 94 89
- rtems_task_delete: suspended task 145 138
- rtems_task_restart: ready task -- returns to caller 97 92
- rtems_task_restart: blocked task -- returns to caller 128 124
- rtems_task_delete: blocked task 149 143
-
- 5 rtems_task_suspend: calling task 77 71
- rtems_task_resume: task readied -- preempts caller 74 67
-
- 6 rtems_task_restart: calling task 101 95
- rtems_task_suspend: returns to caller 50 43
- rtems_task_resume: task readied -- returns to caller 50 45
- rtems_task_delete: ready task 151 144
-
- 7 rtems_task_restart: suspended task -- preempts caller 130 125
-
- 8 rtems_task_set_priority: obtain current priority 38 31
- rtems_task_set_priority: returns to caller 71 64
- rtems_task_mode: obtain current mode 16 14
- rtems_task_mode: no reschedule 18 16
- rtems_task_mode: reschedule -- returns to caller 24 23
- rtems_task_mode: reschedule -- preempts caller 68 60
- rtems_task_set_note 39 33
- rtems_task_get_note 40 33
- rtems_clock_set 93 86
- rtems_clock_get 1 1
-
- 9 rtems_message_queue_create 207 200
- rtems_message_queue_send: no waiting tasks 103 97
- rtems_message_queue_urgent: no waiting tasks 103 96
- rtems_message_queue_receive: available 87 79
- rtems_message_queue_flush: no messages flushed 36 29
- rtems_message_queue_flush: messages flushed 46 39
- rtems_message_queue_delete 85 80
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 51 43
- rtems_message_queue_receive: not available -- caller blocks 115 114
-
-11 rtems_message_queue_send: task readied -- preempts caller 129 123
-
-12 rtems_message_queue_send: task readied -- returns to caller 107 101
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 130 123
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 107 101
-
-15 rtems_event_receive: obtain current events 0 1
- rtems_event_receive: not available -- NO_WAIT 33 23
- rtems_event_receive: not available -- caller blocks 92 84
- rtems_event_send: no task readied 34 24
- rtems_event_receive: available 36 28
- rtems_event_send: task readied -- returns to caller 67 60
-
-16 rtems_event_send: task readied -- preempts caller 90 84
-
-17 rtems_task_set_priority: preempts caller 110 106
-
-18 rtems_task_delete: calling task 175 170
-
-19 rtems_signal_catch 23 15
- rtems_signal_send: returns to caller 43 37
- rtems_signal_send: signal to self 52 55
- exit ASR overhead: returns to calling task 37 37
- exit ASR overhead: returns to preempting task 65 54
-
-20 rtems_partition_create 77 70
- rtems_region_create 70 63
- rtems_partition_get_buffer: available 42 35
- rtems_partition_get_buffer: not available 40 33
- rtems_partition_return_buffer 50 43
- rtems_partition_delete 47 42
- rtems_region_get_segment: available 58 52
- rtems_region_get_segment: not available -- NO_WAIT 55 49
- rtems_region_return_segment: no waiting tasks 60 54
- rtems_region_get_segment: not available -- caller blocks 126 123
- rtems_region_return_segment: task readied -- preempts caller 143 136
- rtems_region_return_segment: task readied -- returns to caller 120 114
- rtems_region_delete 45 39
- rtems_io_initialize 6 4
- rtems_io_open 2 2
- rtems_io_close 1 1
- rtems_io_read 1 2
- rtems_io_write 1 3
- rtems_io_control 2 2
-
-21 rtems_task_ident 353 350
- rtems_message_queue_ident 344 341
- rtems_semaphore_ident 369 367
- rtems_partition_ident 344 341
- rtems_region_ident 350 348
- rtems_port_ident 343 340
- rtems_timer_ident 345 343
- rtems_rate_monotonic_ident 344 341
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 115 111
- rtems_message_queue_broadcast: no waiting tasks 60 53
- rtems_message_queue_broadcast: task readied -- preempts caller 138 133
-
-23 rtems_timer_create 37 28
- rtems_timer_fire_after: inactive 66 58
- rtems_timer_fire_after: active 70 61
- rtems_timer_cancel: active 42 34
- rtems_timer_cancel: inactive 39 31
- rtems_timer_reset: inactive 60 54
- rtems_timer_reset: active 65 58
- rtems_timer_fire_when: inactive 96 88
- rtems_timer_fire_when: active 96 88
- rtems_timer_delete: active 55 47
- rtems_timer_delete: inactive 51 47
- rtems_task_wake_when 125 117
-
-24 rtems_task_wake_after: yield -- returns to caller 26 16
- rtems_task_wake_after: yields -- preempts caller 65 56
-
-25 rtems_clock_tick 14 17
-
-26 _ISR_Disable 0 0
- _ISR_Flash 0 0
- _ISR_Enable 0 0
- _Thread_Disable_dispatch 0 0
- _Thread_Enable_dispatch 19 11
- _Thread_Set_state 24 24
- _Thread_Disptach (NO FP) 50 43
- context switch: no floating point contexts 41 35
- context switch: self 9 9
- context switch: to another task 9 10
- context switch: restore 1st FP task 46 39
- fp context switch: save idle, restore idle 75 68
- fp context switch: save idle, restore initialized 66 66
- fp context switch: save initialized, restore initialized 65 66
- _Thread_Resume 18 19
- _Thread_Unblock 18 19
- _Thread_Ready 22 21
- _Thread_Get 12 14
- _Semaphore_Get 10 10
- _Thread_Get: invalid id 2 2
-
-27 interrupt entry overhead: returns to interrupted task 9 9
- interrupt exit overhead: returns to interrupted task 8 8
- interrupt entry overhead: returns to nested interrupt 14 12
- interrupt exit overhead: returns to nested interrupt 0 0
- interrupt entry overhead: returns to preempting task 8 9
- interrupt exit overhead: returns to preempting task 62 54
-
-28 rtems_port_create 44 35
- rtems_port_external_to_internal 35 27
- rtems_port_internal_to_external 34 26
- rtems_port_delete 46 39
-
-29 rtems_rate_monotonic_create 40 32
- rtems_rate_monotonic_period: initiate period -- returns to caller 60 54
- rtems_rate_monotonic_period: obtain status 38 31
- rtems_rate_monotonic_cancel 46 39
- rtems_rate_monotonic_delete: inactive 54 48
- rtems_rate_monotonic_delete: active 57 51
- rtems_rate_monotonic_period: conclude periods -- caller blocks 83 74
diff --git a/c/src/lib/libbsp/m68k/mvme136/wrapup/Makefile.in b/c/src/lib/libbsp/m68k/mvme136/wrapup/Makefile.in
deleted file mode 100644
index 4dc4ea5208..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/wrapup/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console shmsupp timer
-GENERIC_PIECES=shmdr
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/m68k/mvme147/Makefile.in b/c/src/lib/libbsp/m68k/mvme147/Makefile.in
deleted file mode 100644
index 0a2d61ae80..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include startup clock console timer wrapup
diff --git a/c/src/lib/libbsp/m68k/mvme147/README b/c/src/lib/libbsp/m68k/mvme147/README
deleted file mode 100644
index b7952ad9cb..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/README
+++ /dev/null
@@ -1,86 +0,0 @@
-#
-# $Id$
-#
-
-Notes about the MVME147 bsp
-
-MVME147 port for TNI - Telecom Bretagne
-by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
-May 1996
-
-
-This bsp is essentially based on the mvme136 bsp.
-
-Summary of the modifications that were made:
-
- * include
-
- - bsp.h
- Peripheral Channel Controller memory mapping
- Z8530 memory mapping
-
- * startup
-
- - bspstart.c
- main () setup for VME roundrobin mode
- setup for the PCC interrupt vector base
- - bspclean.c
- bsp_cleanup () disable timer 1 & 2 interruptions
- - linkcmds set the RAM start (0x5000) and size (4Meg - 0x5000)
- - setvec.c unchanged
- - sbrk.c unchanged
-
- * console
-
- - console.c taken from the dmv152 bsp (Zilog Z8530)
- with no modification
-
- * clock
-
- - ckinit.c entirely rewritten for the PCC tick timer 2
-
- * timer
-
- - timerisr.s and timer.c
- entirely rewritten for the PCC tick timer 1
- now gives results un 6.25 us units (mininum timer delay,
- suprising big grain)
-
- * times
-
- - updated results for the mvme147 (beware of the 6.25 us grain)
-
- * Makefiles
-
- - compilation of shmsupp simply removed
-
-
-To be done:
-
- * add VMEchip memory mapping to include/bsp.h
-
- * update the overheads in coverhead.h
-
- * add support for serila ports 2,3 and 4.
-
-Other notes:
-
- * There is no MP support (no more shmsupp) because I have no
- experience of the VME bus. The mvme136 shared memory support
- does not seem applicable on the VMEchip of the mvme147, so
- I don't know where to start. Suggestions are welcome.
-
- * All the timing tests and sp tests have been run except tmoverhd.
- The test hangs during the pause (where the task should be suspended
- until a return). Maybe the rtems_initialize_executive is no more
- reentrant with this bsp.
-
-Future work:
-
- * Add gdb serial remote support.
-
- * Shared memory support (I don't really need it, but I can do
- it if it's simple).
-
- * Message passing on VME bus, with Ada 95 annex E (distributed
- systems) in mind.
diff --git a/c/src/lib/libbsp/m68k/mvme147/bsp_specs b/c/src/lib/libbsp/m68k/mvme147/bsp_specs
deleted file mode 100644
index 61dac86b53..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start.o%s} \
-%{qrtems_debug: start_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/m68k/mvme147/clock/Makefile.in b/c/src/lib/libbsp/m68k/mvme147/clock/Makefile.in
deleted file mode 100644
index d882f1d00f..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/clock/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/mvme147/clock/ckinit.c b/c/src/lib/libbsp/m68k/mvme147/clock/ckinit.c
deleted file mode 100644
index aa277e264d..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/clock/ckinit.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* Clock_init()
- *
- * This routine initializes the Tick Timer 2 on the MVME147 board.
- * The tick frequency is 1 millisecond.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * MVME147 port for TNI - Telecom Bretagne
- * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
- * May 1996
- *
- * $Id$
- */
-
-#include <stdlib.h>
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#define MS_COUNT 65376 /* 1ms */
-/* MS_COUNT = 0x10000 - 1e-3/6.25e-6 */
-#define CLOCK_INT_LEVEL 6 /* T2's interrupt level */
-
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-volatile rtems_unsigned32 Clock_driver_ticks; /* ticks since initialization */
-rtems_isr_entry Old_ticker;
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-
-/*
- * ISR Handler
- */
-
-rtems_isr Clock_isr(rtems_vector_number vector)
-{
- Clock_driver_ticks += 1;
- pcc->timer2_int_control |= 0x80; /* Acknowledge interr. */
-
- if (Clock_isrs == 1) {
- rtems_clock_tick();
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
- }
- else
- Clock_isrs -= 1;
-}
-
-void Install_clock(rtems_isr_entry clock_isr )
-{
-
- Clock_driver_ticks = 0;
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- Old_ticker =
- (rtems_isr_entry) set_vector( clock_isr, TIMER_2_VECTOR, 1 );
-
- pcc->timer2_int_control = 0x00; /* Disable T2 Interr. */
- pcc->timer2_preload = MS_COUNT;
- /* write preload value */
- pcc->timer2_control = 0x07; /* clear T2 overflow counter, enable counter */
- pcc->timer2_int_control = CLOCK_INT_LEVEL|0x08;
- /* Enable Timer 2 and set its int. level */
-
- atexit( Clock_exit );
- }
-}
-
-void Clock_exit( void )
-{
- if ( BSP_Configuration.ticks_per_timeslice ) {
- pcc->timer2_int_control = 0x00; /* Disable T2 Interr. */
- }
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(TIMER_2_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, TIMER_2_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libbsp/m68k/mvme147/console/Makefile.in b/c/src/lib/libbsp/m68k/mvme147/console/Makefile.in
deleted file mode 100644
index fd05ddfedd..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/mvme147/console/console.c b/c/src/lib/libbsp/m68k/mvme147/console/console.c
deleted file mode 100644
index 8500a1b24b..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/console/console.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * This file contains the MVME147 console IO package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * MVME147 port for TNI - Telecom Bretagne
- * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
- * May 1996
- *
- * This file was taken from the DMV152 bsp
- *
- * $Id$
- */
-
-#define M147_INIT
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <zilog/z8530.h>
-
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-}
-
-/* is_character_ready
- *
- * This routine returns TRUE if a character is available.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_boolean is_character_ready(
- char *ch
-)
-{
- rtems_unsigned8 rr_0;
-
- for ( ; ; ) {
- Z8x30_READ_CONTROL( CONSOLE_CONTROL, RR_0, rr_0 );
- if ( !(rr_0 & RR_0_RX_DATA_AVAILABLE) )
- return( FALSE );
-
- Z8x30_READ_DATA( CONSOLE_DATA, *ch );
- return( TRUE );
- }
-}
-
-/* inbyte
- *
- * This routine reads a character from the SCC.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- * character read from SCC
- */
-
-char inbyte( void )
-{
- rtems_unsigned8 rr_0;
- char ch;
-
- for ( ; ; ) {
- Z8x30_READ_CONTROL( CONSOLE_CONTROL, RR_0, rr_0 );
- if ( (rr_0 & RR_0_RX_DATA_AVAILABLE) != 0 )
- break;
- }
-
- Z8x30_READ_DATA( CONSOLE_DATA, ch );
- return ( ch );
-}
-
-/* outbyte
- *
- * This routine transmits a character out the SCC. It supports
- * XON/XOFF flow control.
- *
- * Input parameters:
- * ch - character to be transmitted
- *
- * Output parameters: NONE
- */
-
-void outbyte(
- char ch
-)
-{
- rtems_unsigned8 rr_0;
- char flow_control;
-
- for ( ; ; ) {
- Z8x30_READ_CONTROL( CONSOLE_CONTROL, RR_0, rr_0 );
- if ( (rr_0 & RR_0_TX_BUFFER_EMPTY) != 0 )
- break;
- }
-
- for ( ; ; ) {
- Z8x30_READ_CONTROL( CONSOLE_CONTROL, RR_0, rr_0 );
- if ( (rr_0 & RR_0_RX_DATA_AVAILABLE) == 0 )
- break;
-
- Z8x30_READ_DATA( CONSOLE_DATA, flow_control );
-
- if ( flow_control == XOFF )
- do {
- do {
- Z8x30_READ_CONTROL( CONSOLE_CONTROL, RR_0, rr_0 );
- } while ( (rr_0 & RR_0_RX_DATA_AVAILABLE) == 0 );
- Z8x30_READ_DATA( CONSOLE_DATA, flow_control );
- } while ( flow_control != XON );
- }
-
- Z8x30_WRITE_DATA( CONSOLE_DATA, ch );
-}
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte();
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r');
- }
- outbyte( buffer[ count ] );
- }
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libbsp/m68k/mvme147/include/Makefile.in b/c/src/lib/libbsp/m68k/mvme147/include/Makefile.in
deleted file mode 100644
index 7d8581095f..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/m68k/mvme147/include/bsp.h b/c/src/lib/libbsp/m68k/mvme147/include/bsp.h
deleted file mode 100644
index 3868406a97..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/include/bsp.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/* bsp.h
- *
- * This include file contains all MVME147 board IO definitions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * MVME147 port for TNI - Telecom Bretagne
- * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
- * May 1996
- *
- * $Id$
- */
-
-#ifndef __MVME147_h
-#define __MVME147_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <clockdrv.h>
-#include <console.h>
-#include <iosupp.h>
-
-/* Constants */
-
-#define RAM_START 0x00005000
-#define RAM_END 0x00400000
-
- /* MVME 147 Peripheral controller chip
- see MVME147/D1, 3.4 */
-
-struct pcc_map {
- /* 32 bit registers */
- rtems_unsigned32 dma_table_address; /* 0xfffe1000 */
- rtems_unsigned32 dma_data_address; /* 0xfffe1004 */
- rtems_unsigned32 dma_bytecount; /* 0xfffe1008 */
- rtems_unsigned32 dma_data_holding; /* 0xfffe100c */
-
- /* 16 bit registers */
- rtems_unsigned16 timer1_preload; /* 0xfffe1010 */
- rtems_unsigned16 timer1_count; /* 0xfffe1012 */
- rtems_unsigned16 timer2_preload; /* 0xfffe1014 */
- rtems_unsigned16 timer2_count; /* 0xfffe1016 */
-
- /* 8 bit registers */
- rtems_unsigned8 timer1_int_control; /* 0xfffe1018 */
- rtems_unsigned8 timer1_control; /* 0xfffe1019 */
- rtems_unsigned8 timer2_int_control; /* 0xfffe101a */
- rtems_unsigned8 timer2_control; /* 0xfffe101b */
-
- rtems_unsigned8 acfail_int_control; /* 0xfffe101c */
- rtems_unsigned8 watchdog_control; /* 0xfffe101d */
-
- rtems_unsigned8 printer_int_control; /* 0xfffe101e */
- rtems_unsigned8 printer_control; /* 0xfffe102f */
-
- rtems_unsigned8 dma_int_control; /* 0xfffe1020 */
- rtems_unsigned8 dma_control; /* 0xfffe1021 */
- rtems_unsigned8 bus_error_int_control; /* 0xfffe1022 */
- rtems_unsigned8 dma_status; /* 0xfffe1023 */
- rtems_unsigned8 abort_int_control; /* 0xfffe1024 */
- rtems_unsigned8 table_address_function_code; /* 0xfffe1025 */
- rtems_unsigned8 serial_port_int_control; /* 0xfffe1026 */
- rtems_unsigned8 general_purpose_control; /* 0xfffe1027 */
- rtems_unsigned8 lan_int_control; /* 0xfffe1028 */
- rtems_unsigned8 general_purpose_status; /* 0xfffe1029 */
- rtems_unsigned8 scsi_port_int_control; /* 0xfffe102a */
- rtems_unsigned8 slave_base_address; /* 0xfffe102b */
- rtems_unsigned8 software_int_1_control; /* 0xfffe102c */
- rtems_unsigned8 int_base_vector; /* 0xfffe102d */
- rtems_unsigned8 software_int_2_control; /* 0xfffe102e */
- rtems_unsigned8 revision_level; /* 0xfffe102f */
-};
-
-#define pcc ((volatile struct pcc_map * const) 0xfffe1000)
-
-#define z8530 0xfffe3001
-
-
-/* interrupt vectors - see MVME146/D1 4.14 */
-#define PCC_BASE_VECTOR 0x40 /* First user int */
-#define SCC_VECTOR PCC_BASE_VECTOR+3
-#define TIMER_1_VECTOR PCC_BASE_VECTOR+8
-#define TIMER_2_VECTOR PCC_BASE_VECTOR+9
-#define SOFT_1_VECTOR PCC_BASE_VECTOR+10
-#define SOFT_2_VECTOR PCC_BASE_VECTOR+11
-
-#define USE_CHANNEL_A 1 /* 1 = use channel A for console */
-#define USE_CHANNEL_B 0 /* 1 = use channel B for console */
-
-#if (USE_CHANNEL_A == 1)
-#define CONSOLE_CONTROL 0xfffe3002
-#define CONSOLE_DATA 0xfffe3003
-#elif (USE_CHANNEL_B == 1)
-#define CONSOLE_CONTROL 0xfffe3000
-#define CONSOLE_DATA 0xfffe3001
-#endif
-
-
-
-#define FOREVER 1 /* infinite loop */
-
-#ifdef M147_INIT
-#undef EXTERN
-#define EXTERN
-#else
-#undef EXTERN
-#define EXTERN extern
-#endif
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Define the interrupt mechanism for Time Test 27
- *
- * NOTE: Use the MPCSR vector for the MVME147
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), \
- SOFT_1_VECTOR, 1 )
-
-#define Cause_tm27_intr() pcc->software_int_1_control = 0x0c
- /* generate level 4 sotware int. */
-
-#define Clear_tm27_intr() pcc->software_int_1_control = 0x00
-
-#define Lower_tm27_intr()
-
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-extern m68k_isr_entry M68Kvec[]; /* vector table address */
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-m68k_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/lib/libbsp/m68k/mvme147/include/coverhd.h b/c/src/lib/libbsp/m68k/mvme147/include/coverhd.h
deleted file mode 100644
index 45a66b551d..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/include/coverhd.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C on this target.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 2
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 1
-#define CALLING_OVERHEAD_TASK_CREATE 3
-#define CALLING_OVERHEAD_TASK_IDENT 2
-#define CALLING_OVERHEAD_TASK_START 2
-#define CALLING_OVERHEAD_TASK_RESTART 2
-#define CALLING_OVERHEAD_TASK_DELETE 1
-#define CALLING_OVERHEAD_TASK_SUSPEND 1
-#define CALLING_OVERHEAD_TASK_RESUME 2
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 2
-#define CALLING_OVERHEAD_TASK_MODE 2
-#define CALLING_OVERHEAD_TASK_GET_NOTE 2
-#define CALLING_OVERHEAD_TASK_SET_NOTE 2
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 4
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 1
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 2
-#define CALLING_OVERHEAD_CLOCK_GET 5
-#define CALLING_OVERHEAD_CLOCK_SET 4
-#define CALLING_OVERHEAD_CLOCK_TICK 1
-
-#define CALLING_OVERHEAD_TIMER_CREATE 2
-#define CALLING_OVERHEAD_TIMER_IDENT 1
-#define CALLING_OVERHEAD_TIMER_DELETE 2
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 2
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 5
-#define CALLING_OVERHEAD_TIMER_RESET 1
-#define CALLING_OVERHEAD_TIMER_CANCEL 1
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 3
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 1
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 2
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 2
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 2
-
-#define CALLING_OVERHEAD_EVENT_SEND 2
-#define CALLING_OVERHEAD_EVENT_RECEIVE 2
-#define CALLING_OVERHEAD_SIGNAL_CATCH 2
-#define CALLING_OVERHEAD_SIGNAL_SEND 2
-#define CALLING_OVERHEAD_PARTITION_CREATE 3
-#define CALLING_OVERHEAD_PARTITION_IDENT 2
-#define CALLING_OVERHEAD_PARTITION_DELETE 1
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 2
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 2
-#define CALLING_OVERHEAD_REGION_CREATE 3
-#define CALLING_OVERHEAD_REGION_IDENT 2
-#define CALLING_OVERHEAD_REGION_DELETE 2
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 3
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 2
-#define CALLING_OVERHEAD_PORT_CREATE 3
-#define CALLING_OVERHEAD_PORT_IDENT 2
-#define CALLING_OVERHEAD_PORT_DELETE 1
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 2
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 2
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 2
-#define CALLING_OVERHEAD_IO_OPEN 2
-#define CALLING_OVERHEAD_IO_CLOSE 3
-#define CALLING_OVERHEAD_IO_READ 2
-#define CALLING_OVERHEAD_IO_WRITE 2
-#define CALLING_OVERHEAD_IO_CONTROL 2
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 2
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 1
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in b/c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in
deleted file mode 100644
index c4f1163cf9..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(srcdir)/linkcmds $(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-
diff --git a/c/src/lib/libbsp/m68k/mvme147/startup/bspclean.c b/c/src/lib/libbsp/m68k/mvme147/startup/bspclean.c
deleted file mode 100644
index 1be56c4de6..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/startup/bspclean.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * This routine returns control to 147Bug.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * MVME147 port for TNI - Telecom Bretagne
- * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
- * May 1996
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <clockdrv.h>
-
-void bsp_return_to_monitor_trap()
-{
- extern void start( void );
-
- register volatile void *start_addr;
-
- m68k_set_vbr( 0 ); /* restore 147Bug vectors */
- asm volatile( "trap #15" ); /* trap to 147Bug */
- asm volatile( ".short 0x63" ); /* return to 147Bug (.RETURN) */
- /* restart program */
- start_addr = start;
-
- asm volatile ( "jmp %0@" : "=a" (start_addr) : "0" (start_addr) );
-}
-
-void bsp_cleanup( void )
-{
- pcc->timer1_int_control = 0; /* Disable Timer 1 */
- pcc->timer2_int_control = 0; /* Disable Timer 2 */
-
- M68Kvec[ 45 ] = bsp_return_to_monitor_trap; /* install handler */
- asm volatile( "trap #13" ); /* insures SUPV mode */
-}
diff --git a/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c
deleted file mode 100644
index 2fd917d6f0..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * MVME147 port for TNI - Telecom Bretagne
- * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
- * May 1996
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- m68k_isr_entry *monitors_vector_table;
- int index;
-
- monitors_vector_table = (m68k_isr_entry *)0; /* 135Bug Vectors are at 0 */
- m68k_set_vbr( monitors_vector_table );
-
- for ( index=2 ; index<=255 ; index++ )
- M68Kvec[ index ] = monitors_vector_table[ 32 ];
-
- M68Kvec[ 2 ] = monitors_vector_table[ 2 ]; /* bus error vector */
- M68Kvec[ 4 ] = monitors_vector_table[ 4 ]; /* breakpoints vector */
- M68Kvec[ 9 ] = monitors_vector_table[ 9 ]; /* trace vector */
- M68Kvec[ 47 ] = monitors_vector_table[ 47 ]; /* system call vector */
-
- m68k_set_vbr( &M68Kvec );
-
- pcc->int_base_vector = PCC_BASE_VECTOR; /* Set the PCC int vectors base */
-
- (*(rtems_unsigned8 *)0xfffe2001) = 0x08;
- /* make VME access round-robin */
-
- m68k_enable_caching();
-
- /*
- * we only use a hook to get the C library initialized.
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec;
- Cpu_table.interrupt_stack_size = 4096;
-
- BSP_Configuration.work_space_start = (void *)
- (RAM_END - BSP_Configuration.work_space_size);
-
-}
diff --git a/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds
deleted file mode 100644
index 4749021258..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the Motorola MVME147 boards.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * MVME147 port for TNI - Telecom Bretagne
- * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
- * May 1996
- *
- * $Id$
- */
-
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
-
-MEMORY
- {
- ram : org = 0x5000, l = 0x3fafff
- }
-
-SECTIONS
-{
- .text 0x5000 :
- {
- text_start = . ;
- _text_start = . ;
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- etext = ALIGN( 0x10 ) ;
- _etext = .;
- }
- .data ADDR( .text ) + SIZEOF( .text ):
- {
- data_start = . ;
- _data_start = .;
- *(.data)
- edata = ALIGN( 0x10 ) ;
- _edata = .;
- }
- .bss ADDR( .data ) + SIZEOF( .data ):
- {
- bss_start = . ;
- _bss_start = . ;
- *(.bss)
- *(COMMON)
- . += StackSize; /* XXX -- Old gld can't handle this */
- . = ALIGN (16);
- stack_init = .;
- end = . ;
- _end = . ;
- }
-}
diff --git a/c/src/lib/libbsp/m68k/mvme147/timer/Makefile.in b/c/src/lib/libbsp/m68k/mvme147/timer/Makefile.in
deleted file mode 100644
index 24809cbed8..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=timerisr
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/mvme147/timer/timer.c b/c/src/lib/libbsp/m68k/mvme147/timer/timer.c
deleted file mode 100644
index 0f6e63595d..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/timer/timer.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Timer_init()
- *
- * This routine initializes the PCC timer on the MVME147 board.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * MVME147 port for TNI - Telecom Bretagne
- * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
- * May 1996
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#define TIMER_INT_LEVEL 6
-
-#define COUNTDOWN_VALUE 0
-/* Allows 0.4096 second delay betwin ints */
-/* Each tick is 6.25 us */
-
-int Ttimer_val;
-rtems_boolean Timer_driver_Find_average_overhead;
-
-rtems_isr timerisr();
-
-void Timer_initialize()
-{
- (void) set_vector(timerisr, TIMER_1_VECTOR, 0); /* install ISR */
-
- Ttimer_val = 0; /* clear timer ISR count */
- pcc->timer1_int_control = 0x00; /* Disable T1 Interr. */
- pcc->timer1_preload = COUNTDOWN_VALUE;
- /* write countdown preload value */
- pcc->timer1_control = 0x00; /* load preload value */
- pcc->timer1_control = 0x07; /* clear T1 overflow counter, enable counter */
- pcc->timer1_int_control = TIMER_INT_LEVEL|0x08;
- /* Enable Timer 1 and set its int. level */
-
-}
-
-#define AVG_OVERHEAD 0 /* No need to start/stop the timer to read
- its value on the MVME147 PCC: reads are not
- synchronized whith the counter updates*/
-#define LEAST_VALID 10 /* Don't trust a value lower than this */
-
-int Read_timer()
-{
- rtems_unsigned32 total;
- rtems_unsigned16 counter_value;
-
- counter_value = pcc->timer1_count; /* read the counter value */
-
- total = ((Ttimer_val * 0x10000) + counter_value); /* in 6.25 us units */
- /* DC note : just look at the assembly generated
- to see gcc's impressive optimization ! */
- return total;
-
-}
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/m68k/mvme147/timer/timerisr.s b/c/src/lib/libbsp/m68k/mvme147/timer/timerisr.s
deleted file mode 100644
index 7debd13849..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/timer/timerisr.s
+++ /dev/null
@@ -1,28 +0,0 @@
-/* timer_isr()
- *
- * This routine provides the ISR for the PCC timer on the MVME147
- * board. The timer is set up to generate an interrupt at maximum
- * intervals.
- *
- * MVME147 port for TNI - Telecom Bretagne
- * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
- * May 1996
- *
- * $Id$
- */
-
-#include "asm.h"
-
-BEGIN_CODE
-
-.set T1_CONTROL_REGISTER, 0xfffe1018 | timer 1 control register
-
- PUBLIC (timerisr)
-SYM (timerisr):
- orb #0x80, T1_CONTROL_REGISTER | clear T1 int status bit
- addql #1, SYM (Ttimer_val) | increment timer value
-end_timerisr:
- rte
-
-END_CODE
-END
diff --git a/c/src/lib/libbsp/m68k/mvme147/times b/c/src/lib/libbsp/m68k/mvme147/times
deleted file mode 100644
index d1bae93265..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/times
+++ /dev/null
@@ -1,194 +0,0 @@
-#
-# Timing Test Suite Results for the Motorola MVME147 BSP
-#
-# MVME147 port for TNI - Telecom Bretagne
-# by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
-# May 1996
-#
-# $Id$
-#
-
-Board: Motorola MVME147S
-CPU: Motorola MC68030 + MC68882 FPU
-Clock Speed: 20 Mhz
-Memory Configuration: DRAM w/no cache
-Wait States: ? wait state
-
-Times Reported in: microseconds (6.25 us grain)
-Timer Source: MVME147 Peripheral Channel Controller tick timer
-
-Column A: 3.5.1 pre-release
-
-# DESCRIPTION A
-== ================================================================= ====
- 1 rtems_semaphore_create 69
- rtems_semaphore_delete 69
- rtems_semaphore_obtain: available 44
- rtems_semaphore_obtain: not available -- NO_WAIT 44
- rtems_semaphore_release: no waiting tasks 56
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 125
-
- 3 rtems_semaphore_release: task readied -- preempts caller 106
-
- 4 rtems_task_restart: blocked task -- preempts caller 181
- rtems_task_restart: ready task -- preempts caller 169
- rtems_semaphore_release: task readied -- returns to caller 81
- rtems_task_create 169
- rtems_task_start 87
- rtems_task_restart: suspended task -- returns to caller 106
- rtems_task_delete: suspended task 169
- rtems_task_restart: ready task -- returns to caller 112
- rtems_task_restart: blocked task -- returns to caller 150
- rtems_task_delete: blocked task 175
-
- 5 rtems_task_suspend: calling task 87
- rtems_task_resume: task readied -- preempts caller 75
-
- 6 rtems_task_restart: calling task 112
- rtems_task_suspend: returns to caller 56
- rtems_task_resume: task readied -- returns to caller 50
- rtems_task_delete: ready task 169
-
- 7 rtems_task_restart: suspended task -- preempts caller 143
-
- 8 rtems_task_set_priority: obtain current priority 37
- rtems_task_set_priority: returns to caller 75
- rtems_task_mode: obtain current mode 6
- rtems_task_mode: no reschedule 6
- rtems_task_mode: reschedule -- returns to caller 19
- rtems_task_mode: reschedule -- preempts caller 75
- rtems_task_set_note 37
- rtems_task_get_note 37
- rtems_clock_set 87
- rtems_clock_get 0
-
- 9 rtems_message_queue_create 225
- rtems_message_queue_send: no waiting tasks 112
- rtems_message_queue_urgent: no waiting tasks 112
- rtems_message_queue_receive: available 87
- rtems_message_queue_flush: no messages flushed 37
- rtems_message_queue_flush: messages flushed 50
- rtems_message_queue_delete 106
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 44
- rtems_message_queue_receive: not available -- caller blocks 125
-
-11 rtems_message_queue_send: task readied -- preempts caller 144
-
-12 rtems_message_queue_send: task readied -- returns to caller 119
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 144
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 119
-
-15 rtems_event_receive: obtain current events 0
- rtems_event_receive: not available -- NO_WAIT 25
- rtems_event_receive: not available -- caller blocks 100
- rtems_event_send: no task readied 31
- rtems_event_receive: available 37
- rtems_event_send: task readied -- returns to caller 69
-
-16 rtems_event_send: task readied -- preempts caller 100
-
-17 rtems_task_set_priority: preempts caller 125
-
-18 rtems_task_delete: calling task 200
-
-19 rtems_signal_catch 19
- rtems_signal_send: returns to caller 50
- rtems_signal_send: signal to self 56
- exit ASR overhead: returns to calling task 44
- exit ASR overhead: returns to preempting task 75
-
-20 rtems_partition_create 81
- rtems_region_create 75
- rtems_partition_get_buffer: available 44
- rtems_partition_get_buffer: not available 44
- rtems_partition_return_buffer 56
- rtems_partition_delete 62
- rtems_region_get_segment: available 56
- rtems_region_get_segment: not available -- NO_WAIT 56
- rtems_region_return_segment: no waiting tasks 69
- rtems_region_get_segment: not available -- caller blocks 144
- rtems_region_return_segment: task readied -- preempts caller 169
- rtems_region_return_segment: task readied -- returns to caller 137
- rtems_region_delete 56
- rtems_io_initialize 0
- rtems_io_open 0
- rtems_io_close 0
- rtems_io_read 0
- rtems_io_write 0
- rtems_io_control 0
-
-21 rtems_task_ident 375
- rtems_message_queue_ident 362
- rtems_semaphore_ident 394
- rtems_partition_ident 362
- rtems_region_ident 369
- rtems_port_ident 362
- rtems_timer_ident 369
- rtems_rate_monotonic_ident 362
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 131
- rtems_message_queue_broadcast: no waiting tasks 62
- rtems_message_queue_broadcast: task readied -- preempts caller 156
-
-23 rtems_timer_create 31
- rtems_timer_fire_after: inactive 69
- rtems_timer_fire_after: active 69
- rtems_timer_cancel: active 44
- rtems_timer_cancel: inactive 37
- rtems_timer_reset: inactive 69
- rtems_timer_reset: active 69
- rtems_timer_fire_when: inactive 87
- rtems_timer_fire_when: active 87
- rtems_timer_delete: active 56
- rtems_timer_delete: inactive 50
- rtems_task_wake_when 125
-
-24 rtems_task_wake_after: yield -- returns to caller 19
- rtems_task_wake_after: yields -- preempts caller 69
-
-25 rtems_clock_tick 19
-
-26 _ISR_Disable 6
- _ISR_Flash 6
- _ISR_Enable 6
- _Thread_Disable_dispatch 6
- _Thread_Enable_dispatch 25
- _Thread_Set_state 31
- _Thread_Disptach (NO FP) 62
- context switch: no floating point contexts 50
- context switch: self 12
- context switch: to another task 12
- context switch: restore 1st FP task 56
- fp context switch: save idle, restore idle 87
- fp context switch: save idle, restore initialized 75
- fp context switch: save initialized, restore initialized 75
- _Thread_Resume 25
- _Thread_Unblock 25
- _Thread_Ready 31
- _Thread_Get 12
- _Semaphore_Get 6
- _Thread_Get: invalid id 0
-
-27 interrupt entry overhead: returns to interrupted task 12
- interrupt exit overhead: returns to interrupted task 12
- interrupt entry overhead: returns to nested interrupt 19
- interrupt exit overhead: returns to nested interrupt 6
- interrupt entry overhead: returns to preempting task 12
- interrupt exit overhead: returns to preempting task 81
-
-28 rtems_port_create 37
- rtems_port_external_to_internal 31
- rtems_port_internal_to_external 31
- rtems_port_delete 56
-
-29 rtems_rate_monotonic_create 44
- rtems_rate_monotonic_period: initiate period -- returns to caller 62
- rtems_rate_monotonic_period: obtain status 37
- rtems_rate_monotonic_cancel 56
- rtems_rate_monotonic_delete: inactive 62
- rtems_rate_monotonic_delete: active 69
- rtems_rate_monotonic_period: conclude periods -- caller blocks 87
diff --git a/c/src/lib/libbsp/m68k/mvme147/wrapup/Makefile.in b/c/src/lib/libbsp/m68k/mvme147/wrapup/Makefile.in
deleted file mode 100644
index 33d990d882..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147/wrapup/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console timer # shmsupp
-GENERIC_PIECES=# shmdr
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/m68k/mvme147s/Makefile.in b/c/src/lib/libbsp/m68k/mvme147s/Makefile.in
deleted file mode 100644
index c1ea214afa..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/Makefile.in
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include startup clock console timer shmsupp wrapup
-
diff --git a/c/src/lib/libbsp/m68k/mvme147s/README b/c/src/lib/libbsp/m68k/mvme147s/README
deleted file mode 100644
index 132f214777..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/README
+++ /dev/null
@@ -1,92 +0,0 @@
-#
-# $Id$
-#
-
-Notes about the MVME147S bsp
-
-MVME147 port for TNI - Telecom Bretagne
-by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
-May 1996
-
-
-This bsp is essentially based on the mvme136 bsp,
-and is only an extention of the MVME147 bsp. There
-are slight differences in the VMEchips used in the MVME147S and
-the MVME147 that should prevent the shmsupport and the startup
-code from running on a MVME147.
-
-Summary of the modifications that were made:
-
- * include
-
- - bsp.h
- Peripheral Channel Controller memory mapping
- Z8530 memory mapping
- VMEchip memory mapping
-
- * startup
-
- - bspstart.c
- main () setup for VME roundrobin mode
- setup for the PCC interrupt vector base
- setup of the VME shared memory
- - bspclean.c
- bsp_cleanup () disable timer 1 & 2 interruptions
- - linkcmds set the RAM start (0x7000) and size (4Meg - 0x7000)
- - setvec.c unchanged
- - sbrk.c unchanged
-
- * console
-
- - console.c taken from the dmv152 bsp (Zilog Z8530)
- with no modification
-
- * clock
-
- - ckinit.c entirely rewritten for the PCC tick timer 2
-
- * timer
-
- - timerisr.s and timer.c
- entirely rewritten for the PCC tick timer 1
- now gives results un 6.25 us units (mininum timer delay,
- suprising big grain)
-
- * times
-
- - updated results for the mvme147 (beware of the 6.25 us grain)
-
- * shmsupp :
- Specific to the S version of the MVME147
- Only tested with 2 boards, in interrupt mode.
- Uses the top 128k of the VME system controller board RAM
- as the shared space.
-
- - mpisr.c : uses the SIGLP interruption
-
- - Makefile : unchanged
-
- - getcfg.c : rewritten
-
- - lock.c unchanged
-
- - addrconv.c unchanged
-
- * Makefiles
-
- - unchanged
-
-
-To be done:
-
- * update the overheads in coverhead.h
-
- * add support for serial ports 2,3 and 4.
-
-Other notes:
-
- * All the timing tests and sp tests have been run except tmoverhd.
- The test hangs during the pause (where the task should be suspended
- until a return). Maybe the rtems_initialize_executive is no more
- reentrant with this bsp.
-
diff --git a/c/src/lib/libbsp/m68k/mvme147s/bsp_specs b/c/src/lib/libbsp/m68k/mvme147s/bsp_specs
deleted file mode 100644
index 61dac86b53..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start.o%s} \
-%{qrtems_debug: start_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/m68k/mvme147s/clock/Makefile.in b/c/src/lib/libbsp/m68k/mvme147s/clock/Makefile.in
deleted file mode 100644
index 14cead6a85..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/clock/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../mvme147/clock
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/mvme147s/console/Makefile.in b/c/src/lib/libbsp/m68k/mvme147s/console/Makefile.in
deleted file mode 100644
index 77c95fbbc0..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../mvme147/console
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/mvme147s/include/Makefile.in b/c/src/lib/libbsp/m68k/mvme147s/include/Makefile.in
deleted file mode 100644
index 7d8581095f..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/m68k/mvme147s/include/bsp.h b/c/src/lib/libbsp/m68k/mvme147s/include/bsp.h
deleted file mode 100644
index be58a3c445..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/include/bsp.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/* bsp.h
- *
- * This include file contains all MVME147 board IO definitions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * MVME147 port for TNI - Telecom Bretagne
- * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
- * May 1996
- *
- * $Id$
- */
-
-#ifndef __MVME147_h
-#define __MVME147_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <clockdrv.h>
-#include <console.h>
-#include <iosupp.h>
-
-/* Constants */
-
-#define RAM_START 0x00007000
-#define RAM_END 0x003e0000
-#define DRAM_END 0x00400000
- /* We leave 128k for the shared memory */
-
- /* MVME 147 Peripheral controller chip
- see MVME147/D1, 3.4 */
-
-struct pcc_map {
- /* 32 bit registers */
- rtems_unsigned32 dma_table_address; /* 0xfffe1000 */
- rtems_unsigned32 dma_data_address; /* 0xfffe1004 */
- rtems_unsigned32 dma_bytecount; /* 0xfffe1008 */
- rtems_unsigned32 dma_data_holding; /* 0xfffe100c */
-
- /* 16 bit registers */
- rtems_unsigned16 timer1_preload; /* 0xfffe1010 */
- rtems_unsigned16 timer1_count; /* 0xfffe1012 */
- rtems_unsigned16 timer2_preload; /* 0xfffe1014 */
- rtems_unsigned16 timer2_count; /* 0xfffe1016 */
-
- /* 8 bit registers */
- rtems_unsigned8 timer1_int_control; /* 0xfffe1018 */
- rtems_unsigned8 timer1_control; /* 0xfffe1019 */
- rtems_unsigned8 timer2_int_control; /* 0xfffe101a */
- rtems_unsigned8 timer2_control; /* 0xfffe101b */
-
- rtems_unsigned8 acfail_int_control; /* 0xfffe101c */
- rtems_unsigned8 watchdog_control; /* 0xfffe101d */
-
- rtems_unsigned8 printer_int_control; /* 0xfffe101e */
- rtems_unsigned8 printer_control; /* 0xfffe102f */
-
- rtems_unsigned8 dma_int_control; /* 0xfffe1020 */
- rtems_unsigned8 dma_control; /* 0xfffe1021 */
- rtems_unsigned8 bus_error_int_control; /* 0xfffe1022 */
- rtems_unsigned8 dma_status; /* 0xfffe1023 */
- rtems_unsigned8 abort_int_control; /* 0xfffe1024 */
- rtems_unsigned8 table_address_function_code; /* 0xfffe1025 */
- rtems_unsigned8 serial_port_int_control; /* 0xfffe1026 */
- rtems_unsigned8 general_purpose_control; /* 0xfffe1027 */
- rtems_unsigned8 lan_int_control; /* 0xfffe1028 */
- rtems_unsigned8 general_purpose_status; /* 0xfffe1029 */
- rtems_unsigned8 scsi_port_int_control; /* 0xfffe102a */
- rtems_unsigned8 slave_base_address; /* 0xfffe102b */
- rtems_unsigned8 software_int_1_control; /* 0xfffe102c */
- rtems_unsigned8 int_base_vector; /* 0xfffe102d */
- rtems_unsigned8 software_int_2_control; /* 0xfffe102e */
- rtems_unsigned8 revision_level; /* 0xfffe102f */
-};
-
-#define pcc ((volatile struct pcc_map * const) 0xfffe1000)
-
-/* VME chip configuration registers */
-
-struct vme_lcsr_map {
- rtems_unsigned8 unused_1;
- rtems_unsigned8 system_controller; /* 0xfffe2001 */
- rtems_unsigned8 unused_2;
- rtems_unsigned8 vme_bus_requester; /* 0xfffe2003 */
- rtems_unsigned8 unused_3;
- rtems_unsigned8 master_configuration; /* 0xfffe2005 */
- rtems_unsigned8 unused_4;
- rtems_unsigned8 slave_configuration; /* 0xfffe2007 */
- rtems_unsigned8 unused_5;
- rtems_unsigned8 timer_configuration; /* 0xfffe2009 */
- rtems_unsigned8 unused_6;
- rtems_unsigned8 slave_address_modifier; /* 0xfffe200b */
- rtems_unsigned8 unused_7;
- rtems_unsigned8 master_address_modifier; /* 0xfffe200d */
- rtems_unsigned8 unused_8;
- rtems_unsigned8 interrupt_handler_mask; /* 0xfffe200f */
- rtems_unsigned8 unused_9;
- rtems_unsigned8 utility_interrupt_mask; /* 0xfffe2011 */
- rtems_unsigned8 unused_10;
- rtems_unsigned8 utility_interrupt_vector; /* 0xfffe2013 */
- rtems_unsigned8 unused_11;
- rtems_unsigned8 interrupt_request; /* 0xfffe2015 */
- rtems_unsigned8 unused_12;
- rtems_unsigned8 vme_bus_status_id; /* 0xfffe2017 */
- rtems_unsigned8 unused_13;
- rtems_unsigned8 bus_error_status; /* 0xfffe2019 */
- rtems_unsigned8 unused_14;
- rtems_unsigned8 gcsr_base_address; /* 0xfffe201b */
-};
-
-#define vme_lcsr ((volatile struct vme_lcsr_map * const) 0xfffe2000)
-
-
-struct vme_gcsr_map {
- rtems_unsigned8 unused_1;
- rtems_unsigned8 global_0; /* 0xfffe2021 */
- rtems_unsigned8 unused_2;
- rtems_unsigned8 global_1; /* 0xfffe2023 */
- rtems_unsigned8 unused_3;
- rtems_unsigned8 board_identification; /* 0xfffe2025 */
- rtems_unsigned8 unused_4;
- rtems_unsigned8 general_purpose_0; /* 0xfffe2027 */
- rtems_unsigned8 unused_5;
- rtems_unsigned8 general_purpose_1; /* 0xfffe2029 */
- rtems_unsigned8 unused_6;
- rtems_unsigned8 general_purpose_2; /* 0xfffe202b */
- rtems_unsigned8 unused_7;
- rtems_unsigned8 general_purpose_3; /* 0xfffe202d */
- rtems_unsigned8 unused_8;
- rtems_unsigned8 general_purpose_4; /* 0xfffe202f */
-};
-
-#define vme_gcsr ((volatile struct vme_gcsr_map * const) 0xfffe2020)
-
-
-
-#define z8530 0xfffe3001
-
-
-/* interrupt vectors - see MVME147/D1 4.14 */
-#define PCC_BASE_VECTOR 0x40 /* First user int */
-#define SCC_VECTOR PCC_BASE_VECTOR+3
-#define TIMER_1_VECTOR PCC_BASE_VECTOR+8
-#define TIMER_2_VECTOR PCC_BASE_VECTOR+9
-#define SOFT_1_VECTOR PCC_BASE_VECTOR+10
-#define SOFT_2_VECTOR PCC_BASE_VECTOR+11
-
-#define VME_BASE_VECTOR 0x50
-#define VME_SIGLP_VECTOR VME_BASE_VECTOR+1
-
-#define USE_CHANNEL_A 1 /* 1 = use channel A for console */
-#define USE_CHANNEL_B 0 /* 1 = use channel B for console */
-
-#if (USE_CHANNEL_A == 1)
-#define CONSOLE_CONTROL 0xfffe3002
-#define CONSOLE_DATA 0xfffe3003
-#elif (USE_CHANNEL_B == 1)
-#define CONSOLE_CONTROL 0xfffe3000
-#define CONSOLE_DATA 0xfffe3001
-#endif
-
-
-
-#define FOREVER 1 /* infinite loop */
-
-#ifdef M147_INIT
-#undef EXTERN
-#define EXTERN
-#else
-#undef EXTERN
-#define EXTERN extern
-#endif
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Define the interrupt mechanism for Time Test 27
- *
- * NOTE: Use the MPCSR vector for the MVME147
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), \
- SOFT_1_VECTOR, 1 )
-
-#define Cause_tm27_intr() pcc->software_int_1_control = 0x0c
- /* generate level 4 sotware int. */
-
-#define Clear_tm27_intr() pcc->software_int_1_control = 0x00
-
-#define Lower_tm27_intr()
-
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-extern m68k_isr_entry M68Kvec[]; /* vector table address */
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-m68k_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/c/src/lib/libbsp/m68k/mvme147s/include/coverhd.h b/c/src/lib/libbsp/m68k/mvme147s/include/coverhd.h
deleted file mode 100644
index 45a66b551d..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/include/coverhd.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C on this target.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 2
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 1
-#define CALLING_OVERHEAD_TASK_CREATE 3
-#define CALLING_OVERHEAD_TASK_IDENT 2
-#define CALLING_OVERHEAD_TASK_START 2
-#define CALLING_OVERHEAD_TASK_RESTART 2
-#define CALLING_OVERHEAD_TASK_DELETE 1
-#define CALLING_OVERHEAD_TASK_SUSPEND 1
-#define CALLING_OVERHEAD_TASK_RESUME 2
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 2
-#define CALLING_OVERHEAD_TASK_MODE 2
-#define CALLING_OVERHEAD_TASK_GET_NOTE 2
-#define CALLING_OVERHEAD_TASK_SET_NOTE 2
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 4
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 1
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 2
-#define CALLING_OVERHEAD_CLOCK_GET 5
-#define CALLING_OVERHEAD_CLOCK_SET 4
-#define CALLING_OVERHEAD_CLOCK_TICK 1
-
-#define CALLING_OVERHEAD_TIMER_CREATE 2
-#define CALLING_OVERHEAD_TIMER_IDENT 1
-#define CALLING_OVERHEAD_TIMER_DELETE 2
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 2
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 5
-#define CALLING_OVERHEAD_TIMER_RESET 1
-#define CALLING_OVERHEAD_TIMER_CANCEL 1
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 3
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 1
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 2
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 2
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 2
-
-#define CALLING_OVERHEAD_EVENT_SEND 2
-#define CALLING_OVERHEAD_EVENT_RECEIVE 2
-#define CALLING_OVERHEAD_SIGNAL_CATCH 2
-#define CALLING_OVERHEAD_SIGNAL_SEND 2
-#define CALLING_OVERHEAD_PARTITION_CREATE 3
-#define CALLING_OVERHEAD_PARTITION_IDENT 2
-#define CALLING_OVERHEAD_PARTITION_DELETE 1
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 2
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 2
-#define CALLING_OVERHEAD_REGION_CREATE 3
-#define CALLING_OVERHEAD_REGION_IDENT 2
-#define CALLING_OVERHEAD_REGION_DELETE 2
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 3
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 2
-#define CALLING_OVERHEAD_PORT_CREATE 3
-#define CALLING_OVERHEAD_PORT_IDENT 2
-#define CALLING_OVERHEAD_PORT_DELETE 1
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 2
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 2
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 2
-#define CALLING_OVERHEAD_IO_OPEN 2
-#define CALLING_OVERHEAD_IO_CLOSE 3
-#define CALLING_OVERHEAD_IO_READ 2
-#define CALLING_OVERHEAD_IO_WRITE 2
-#define CALLING_OVERHEAD_IO_CONTROL 2
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 2
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 1
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/mvme147s/shmsupp/Makefile.in b/c/src/lib/libbsp/m68k/mvme147s/shmsupp/Makefile.in
deleted file mode 100644
index 9e3fb34ccf..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/shmsupp/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/shmsupp.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=addrconv getcfg lock mpisr
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/m68k/mvme147s/shmsupp/addrconv.c b/c/src/lib/libbsp/m68k/mvme147s/shmsupp/addrconv.c
deleted file mode 100644
index 16b5360595..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/shmsupp/addrconv.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Shm_Convert_address
- *
- * This MVME147 has a "normal" view of the VME address space.
- * No address range conversion is required.
- *
- * Input parameters:
- * address - address to convert
- *
- * Output parameters:
- * returns - converted address
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * MVME147 port for TNI - Telecom Bretagne
- * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
- * June 1996
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <shm.h>
-
-void *Shm_Convert_address(
- void *address
-)
-{
- return ( address );
-}
diff --git a/c/src/lib/libbsp/m68k/mvme147s/shmsupp/getcfg.c b/c/src/lib/libbsp/m68k/mvme147s/shmsupp/getcfg.c
deleted file mode 100644
index 456426460e..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/shmsupp/getcfg.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* void Shm_Get_configuration( localnode, &shmcfg )
- *
- * This routine initializes, if necessary, and returns a pointer
- * to the Shared Memory Configuration Table for the MVME147.
- *
- * INPUT PARAMETERS:
- * localnode - local node number
- * shmcfg - address of pointer to SHM Config Table
- *
- * OUTPUT PARAMETERS:
- * *shmcfg - pointer to SHM Config Table
- *
- * NOTES: The SIGLP interrupt on the MVME147 is used as an interprocessor
- * interrupt.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * MVME147 port for TNI - Telecom Bretagne
- * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
- * June 1996
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems.h>
-#include "shm.h"
-
-#define INTERRUPT 1 /* MVME147 target supports both */
-#define POLLING 0 /* polling and interrupt modes */
-
-shm_config_table BSP_shm_cfgtbl;
-
-rtems_unsigned32 *BSP_int_address()
-{
- rtems_unsigned32 id, offset;
-
- id = (rtems_unsigned32) vme_lcsr->gcsr_base_address;
- offset = (id << 4) & 0xF0;
- offset |= 0xffff0003; /* points to GCSR global 1 */
- return( (rtems_unsigned32 * ) offset );
-}
-
-void Shm_Get_configuration(
- rtems_unsigned32 localnode,
- shm_config_table **shmcfg
-)
-{
- /* A shared mem space has bee left between RAM_END and DRAM_END
- on the first node*/
- if (localnode == 1)
- BSP_shm_cfgtbl.base = (vol_u32 *) RAM_END;
- else
- BSP_shm_cfgtbl.base = (vol_u32 *) (DRAM_END + RAM_END);
-
- BSP_shm_cfgtbl.length = DRAM_END - RAM_END;
- BSP_shm_cfgtbl.format = SHM_BIG;
-
- BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt;
-
-#ifdef NEUTRAL_BIG
- BSP_shm_cfgtbl.convert = NULL_CONVERT;
-#else
- BSP_shm_cfgtbl.convert = CPU_swap_u32;
-#endif
-
-#if (POLLING==1)
- BSP_shm_cfgtbl.poll_intr = POLLED_MODE;
- BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT;
-#else
- BSP_shm_cfgtbl.poll_intr = INTR_MODE;
- BSP_shm_cfgtbl.Intr.address = BSP_int_address(); /* GCSR global 1 */
- BSP_shm_cfgtbl.Intr.value = 0x01; /* SIGLP */
- BSP_shm_cfgtbl.Intr.length = BYTE;
-#endif
-
- *shmcfg = &BSP_shm_cfgtbl;
-
-}
diff --git a/c/src/lib/libbsp/m68k/mvme147s/shmsupp/lock.c b/c/src/lib/libbsp/m68k/mvme147s/shmsupp/lock.c
deleted file mode 100644
index b1517c7ee2..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/shmsupp/lock.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Shared Memory Lock Routines
- *
- * This shared memory locked queue support routine need to be
- * able to lock the specified locked queue. Interrupts are
- * disabled while the queue is locked to prevent preemption
- * and deadlock when two tasks poll for the same lock.
- * previous level.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-/*
- * Shm_Initialize_lock
- *
- * Initialize the lock for the specified locked queue.
- */
-
-void Shm_Initialize_lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- lq_cb->lock = LQ_UNLOCKED;
-}
-
-/* void _Shm_Lock( &lq_cb )
- *
- * This shared memory locked queue support routine locks the
- * specified locked queue. It disables interrupts to prevent
- * a deadlock condition.
- */
-
-void Shm_Lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
- rtems_unsigned32 *lockptr = (rtems_unsigned32 *)&lq_cb->lock;
-
- rtems_interrupt_disable( isr_level );
- Shm_isrstat = isr_level;
- asm volatile( "lockit:" : : );
- asm volatile( "tas %0@" : "=a" (lockptr) : "0" (lockptr) );
- asm volatile( "bne lockit" : : );
-/* should delay */
-}
-
-/*
- * Shm_Unlock
- *
- * Unlock the lock for the specified locked queue.
- */
-
-void Shm_Unlock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
-
- lq_cb->lock = SHM_UNLOCK_VALUE;
- isr_level = Shm_isrstat;
- rtems_interrupt_enable( isr_level );
-}
-
diff --git a/c/src/lib/libbsp/m68k/mvme147s/shmsupp/mpisr.c b/c/src/lib/libbsp/m68k/mvme147s/shmsupp/mpisr.c
deleted file mode 100644
index 75ec1ff81d..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/shmsupp/mpisr.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Shm_isr_mvme147()
- *
- * NOTE: This routine is not used when in polling mode. Either
- * this routine OR Shm_clockisr is used in a particular system.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * MVME147 port for TNI - Telecom Bretagne
- * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
- * June 1996
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <shm.h>
-
-rtems_isr Shm_isr_mvme147()
-{
- Shm_Interrupt_count += 1;
- rtems_multiprocessing_announce();
- vme_gcsr->global_1 = 1; /* clear SIGLP intr */
-}
-
-/* void _Shm_setvec( )
- *
- * This driver routine sets the SHM interrupt vector to point to the
- * driver's SHM interrupt service routine.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void Shm_setvec()
-{
- /* may need to disable intr */
- set_vector( Shm_isr_mvme147, VME_SIGLP_VECTOR, 1 );
-}
diff --git a/c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in b/c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in
deleted file mode 100644
index 9f66729ad2..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../mvme147/startup:@srcdir@/../../shared:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(srcdir)/linkcmds $(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
diff --git a/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c
deleted file mode 100644
index 85e6d8fb2a..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * MVME147 port for TNI - Telecom Bretagne
- * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
- * May 1996
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- m68k_isr_entry *monitors_vector_table;
- int index;
- rtems_unsigned8 node_number;
-
- monitors_vector_table = (m68k_isr_entry *)0; /* 147Bug Vectors are at 0 */
- m68k_set_vbr( monitors_vector_table );
-
- for ( index=2 ; index<=255 ; index++ )
- M68Kvec[ index ] = monitors_vector_table[ 32 ];
-
- M68Kvec[ 2 ] = monitors_vector_table[ 2 ]; /* bus error vector */
- M68Kvec[ 4 ] = monitors_vector_table[ 4 ]; /* breakpoints vector */
- M68Kvec[ 9 ] = monitors_vector_table[ 9 ]; /* trace vector */
- M68Kvec[ 47 ] = monitors_vector_table[ 47 ]; /* system call vector */
-
- m68k_set_vbr( &M68Kvec );
-
- pcc->int_base_vector = PCC_BASE_VECTOR & 0xF0;
- /* Set the PCC int vectors base */
-
- /* VME shared memory configuration */
- /* Only the first node shares its top 128k DRAM */
-
- vme_lcsr->utility_interrupt_vector = VME_BASE_VECTOR & 0xF8;
- /* Set VMEchip base interrupt vector */
- vme_lcsr->utility_interrupt_mask |= 0x02;
- /* Enable SIGLP interruption (see shm support) */
- pcc->general_purpose_control &= 0x10;
- /* Enable VME master interruptions */
-
- if (vme_lcsr->system_controller & 0x01) {
- /* the board is system controller */
- vme_lcsr->system_controller = 0x08;
- /* Make VME access round-robin */
- }
-
-
- node_number =
- (rtems_unsigned8)
- (Configuration.User_multiprocessing_table->node - 1) & 0xF;
- /* Get and store node ID, first node_number = 0 */
- vme_gcsr->board_identification = node_number;
-
- vme_lcsr->gcsr_base_address = node_number;
- /* Setup the base address of this board's gcsr */
- vme_lcsr->timer_configuration = 0x6a;
- /* Enable VME time outs, maximum periods */
-
- if (node_number == 0) {
- pcc->slave_base_address = 0x01;
- /* Set local DRAM base address on the VME bus to the DRAM size */
-
- vme_lcsr->vme_bus_requester = 0x80;
- while (! (vme_lcsr->vme_bus_requester & 0x40));
- /* Get VMEbus mastership */
- vme_lcsr->slave_address_modifier = 0xfb;
- /* Share everything */
- vme_lcsr->slave_configuration = 0x80;
- /* Share local DRAM */
- vme_lcsr->vme_bus_requester = 0x0;
- /* release bus */
- } else {
- pcc->slave_base_address = 0;
- /* Set local DRAM base address on the VME bus to 0 */
-
- vme_lcsr->vme_bus_requester = 0x80;
- while (! (vme_lcsr->vme_bus_requester & 0x40));
- /* Get VMEbus mastership */
- vme_lcsr->slave_address_modifier = 0x08;
- /* Share only the short adress range */
- vme_lcsr->slave_configuration = 0;
- /* Don't share local DRAM */
- vme_lcsr->vme_bus_requester = 0x0;
- /* release bus */
- }
-
- vme_lcsr->master_address_modifier = 0;
- /* Automatically set the address modifier */
- vme_lcsr->master_configuration = 1;
- /* Disable D32 transfers : they don't work on my VMEbus rack */
-
- m68k_enable_caching();
-
- /*
- * we only use a hook to get the C library initialized.
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec;
- Cpu_table.interrupt_stack_size = 4096;
-
- BSP_Configuration.work_space_start = (void *)
- (RAM_END - BSP_Configuration.work_space_size);
-
-}
diff --git a/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds
deleted file mode 100644
index 15c1ecf8e8..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the Motorola MVME147 boards.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * MVME147 port for TNI - Telecom Bretagne
- * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
- * May 1996
- *
- * $Id$
- */
-
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
-
-MEMORY
- {
- ram : org = 0x7000, l = 0x3d8fff
- }
-
-SECTIONS
-{
- .text 0x7000 :
- {
- text_start = . ;
- _text_start = . ;
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- etext = ALIGN( 0x10 ) ;
- _etext = .;
- }
- .data ADDR( .text ) + SIZEOF( .text ):
- {
- data_start = . ;
- _data_start = .;
- *(.data)
- edata = ALIGN( 0x10 ) ;
- _edata = .;
- }
- .bss ADDR( .data ) + SIZEOF( .data ):
- {
- bss_start = . ;
- _bss_start = . ;
- *(.bss)
- *(COMMON)
- . += StackSize; /* XXX -- Old gld can't handle this */
- . = ALIGN (16);
- stack_init = .;
- end = . ;
- _end = . ;
- }
-}
diff --git a/c/src/lib/libbsp/m68k/mvme147s/timer/Makefile.in b/c/src/lib/libbsp/m68k/mvme147s/timer/Makefile.in
deleted file mode 100644
index c12e535ace..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../mvme147/timer
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=timerisr
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(S_FILES) $(H_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/mvme147s/times b/c/src/lib/libbsp/m68k/mvme147s/times
deleted file mode 100644
index d1bae93265..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/times
+++ /dev/null
@@ -1,194 +0,0 @@
-#
-# Timing Test Suite Results for the Motorola MVME147 BSP
-#
-# MVME147 port for TNI - Telecom Bretagne
-# by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr)
-# May 1996
-#
-# $Id$
-#
-
-Board: Motorola MVME147S
-CPU: Motorola MC68030 + MC68882 FPU
-Clock Speed: 20 Mhz
-Memory Configuration: DRAM w/no cache
-Wait States: ? wait state
-
-Times Reported in: microseconds (6.25 us grain)
-Timer Source: MVME147 Peripheral Channel Controller tick timer
-
-Column A: 3.5.1 pre-release
-
-# DESCRIPTION A
-== ================================================================= ====
- 1 rtems_semaphore_create 69
- rtems_semaphore_delete 69
- rtems_semaphore_obtain: available 44
- rtems_semaphore_obtain: not available -- NO_WAIT 44
- rtems_semaphore_release: no waiting tasks 56
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 125
-
- 3 rtems_semaphore_release: task readied -- preempts caller 106
-
- 4 rtems_task_restart: blocked task -- preempts caller 181
- rtems_task_restart: ready task -- preempts caller 169
- rtems_semaphore_release: task readied -- returns to caller 81
- rtems_task_create 169
- rtems_task_start 87
- rtems_task_restart: suspended task -- returns to caller 106
- rtems_task_delete: suspended task 169
- rtems_task_restart: ready task -- returns to caller 112
- rtems_task_restart: blocked task -- returns to caller 150
- rtems_task_delete: blocked task 175
-
- 5 rtems_task_suspend: calling task 87
- rtems_task_resume: task readied -- preempts caller 75
-
- 6 rtems_task_restart: calling task 112
- rtems_task_suspend: returns to caller 56
- rtems_task_resume: task readied -- returns to caller 50
- rtems_task_delete: ready task 169
-
- 7 rtems_task_restart: suspended task -- preempts caller 143
-
- 8 rtems_task_set_priority: obtain current priority 37
- rtems_task_set_priority: returns to caller 75
- rtems_task_mode: obtain current mode 6
- rtems_task_mode: no reschedule 6
- rtems_task_mode: reschedule -- returns to caller 19
- rtems_task_mode: reschedule -- preempts caller 75
- rtems_task_set_note 37
- rtems_task_get_note 37
- rtems_clock_set 87
- rtems_clock_get 0
-
- 9 rtems_message_queue_create 225
- rtems_message_queue_send: no waiting tasks 112
- rtems_message_queue_urgent: no waiting tasks 112
- rtems_message_queue_receive: available 87
- rtems_message_queue_flush: no messages flushed 37
- rtems_message_queue_flush: messages flushed 50
- rtems_message_queue_delete 106
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 44
- rtems_message_queue_receive: not available -- caller blocks 125
-
-11 rtems_message_queue_send: task readied -- preempts caller 144
-
-12 rtems_message_queue_send: task readied -- returns to caller 119
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 144
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 119
-
-15 rtems_event_receive: obtain current events 0
- rtems_event_receive: not available -- NO_WAIT 25
- rtems_event_receive: not available -- caller blocks 100
- rtems_event_send: no task readied 31
- rtems_event_receive: available 37
- rtems_event_send: task readied -- returns to caller 69
-
-16 rtems_event_send: task readied -- preempts caller 100
-
-17 rtems_task_set_priority: preempts caller 125
-
-18 rtems_task_delete: calling task 200
-
-19 rtems_signal_catch 19
- rtems_signal_send: returns to caller 50
- rtems_signal_send: signal to self 56
- exit ASR overhead: returns to calling task 44
- exit ASR overhead: returns to preempting task 75
-
-20 rtems_partition_create 81
- rtems_region_create 75
- rtems_partition_get_buffer: available 44
- rtems_partition_get_buffer: not available 44
- rtems_partition_return_buffer 56
- rtems_partition_delete 62
- rtems_region_get_segment: available 56
- rtems_region_get_segment: not available -- NO_WAIT 56
- rtems_region_return_segment: no waiting tasks 69
- rtems_region_get_segment: not available -- caller blocks 144
- rtems_region_return_segment: task readied -- preempts caller 169
- rtems_region_return_segment: task readied -- returns to caller 137
- rtems_region_delete 56
- rtems_io_initialize 0
- rtems_io_open 0
- rtems_io_close 0
- rtems_io_read 0
- rtems_io_write 0
- rtems_io_control 0
-
-21 rtems_task_ident 375
- rtems_message_queue_ident 362
- rtems_semaphore_ident 394
- rtems_partition_ident 362
- rtems_region_ident 369
- rtems_port_ident 362
- rtems_timer_ident 369
- rtems_rate_monotonic_ident 362
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 131
- rtems_message_queue_broadcast: no waiting tasks 62
- rtems_message_queue_broadcast: task readied -- preempts caller 156
-
-23 rtems_timer_create 31
- rtems_timer_fire_after: inactive 69
- rtems_timer_fire_after: active 69
- rtems_timer_cancel: active 44
- rtems_timer_cancel: inactive 37
- rtems_timer_reset: inactive 69
- rtems_timer_reset: active 69
- rtems_timer_fire_when: inactive 87
- rtems_timer_fire_when: active 87
- rtems_timer_delete: active 56
- rtems_timer_delete: inactive 50
- rtems_task_wake_when 125
-
-24 rtems_task_wake_after: yield -- returns to caller 19
- rtems_task_wake_after: yields -- preempts caller 69
-
-25 rtems_clock_tick 19
-
-26 _ISR_Disable 6
- _ISR_Flash 6
- _ISR_Enable 6
- _Thread_Disable_dispatch 6
- _Thread_Enable_dispatch 25
- _Thread_Set_state 31
- _Thread_Disptach (NO FP) 62
- context switch: no floating point contexts 50
- context switch: self 12
- context switch: to another task 12
- context switch: restore 1st FP task 56
- fp context switch: save idle, restore idle 87
- fp context switch: save idle, restore initialized 75
- fp context switch: save initialized, restore initialized 75
- _Thread_Resume 25
- _Thread_Unblock 25
- _Thread_Ready 31
- _Thread_Get 12
- _Semaphore_Get 6
- _Thread_Get: invalid id 0
-
-27 interrupt entry overhead: returns to interrupted task 12
- interrupt exit overhead: returns to interrupted task 12
- interrupt entry overhead: returns to nested interrupt 19
- interrupt exit overhead: returns to nested interrupt 6
- interrupt entry overhead: returns to preempting task 12
- interrupt exit overhead: returns to preempting task 81
-
-28 rtems_port_create 37
- rtems_port_external_to_internal 31
- rtems_port_internal_to_external 31
- rtems_port_delete 56
-
-29 rtems_rate_monotonic_create 44
- rtems_rate_monotonic_period: initiate period -- returns to caller 62
- rtems_rate_monotonic_period: obtain status 37
- rtems_rate_monotonic_cancel 56
- rtems_rate_monotonic_delete: inactive 62
- rtems_rate_monotonic_delete: active 69
- rtems_rate_monotonic_period: conclude periods -- caller blocks 87
diff --git a/c/src/lib/libbsp/m68k/mvme147s/wrapup/Makefile.in b/c/src/lib/libbsp/m68k/mvme147s/wrapup/Makefile.in
deleted file mode 100644
index 8c70b9398f..0000000000
--- a/c/src/lib/libbsp/m68k/mvme147s/wrapup/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console timer shmsupp
-GENERIC_PIECES=shmdr
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/m68k/mvme162/Makefile.in b/c/src/lib/libbsp/m68k/mvme162/Makefile.in
deleted file mode 100644
index ab75c5dafa..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/Makefile.in
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SRCS=README
-
-# consolex is a predecessor of the termios and libchip concepts.
-# It is no longer being compiled into the source.
-# The MVME162 has 2 z8530's to yield four serial ports.
-# The application can access these by referencing the consolex driver
-# with "CONSOLEX_DRIVER_TABLE_ENTRY" in the driver table definition,
-# in place of "CONSOLE_DRIVER_TABLE_ENTRY". See consolex/cTest.c for
-# an example.
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-#
-# XXXX add tools
-SUB_DIRS=include startup clock console timer tod wrapup
diff --git a/c/src/lib/libbsp/m68k/mvme162/README b/c/src/lib/libbsp/m68k/mvme162/README
deleted file mode 100644
index 18c56d602d..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/README
+++ /dev/null
@@ -1,163 +0,0 @@
---
--- EISCAT Scientific Association. M.Savitski
---
--- This material is a part of the MVME162 Board Support Package
--- for the RTEMS executive. Its licensing policies are those of the
--- RTEMS distribution.
---
--- Updated by Joel Sherrill (jsherril@redstone.army.mil) after
--- inclusion in the standard release.
---
--- $Id$
---
-
-MVME162 Models
---------------
-
-MVME162 model uses 68040.
-
-MVME162FX model uses XXX.
-
-MVME162LX model uses 68LC040.
-
-Do all models have 2 ZCC chips for a total of 4 serial ports?
-
-Extended Console Driver
------------------------
-This BSP includes an extended console driver which supports all 4 serial
-ports on the MVME162LX model. It was submitted by Katsutoshi Shibuya
-<shibuya@mxb.meshnet.or.jp>.
-
-The application can choose this driver by using "CONSOLEX_DRIVER_TABLE_ENTRY"
-in the driver table definition, in place of "CONSOLE_DRIVER_TABLE_ENTRY".
-See consolex/cTest.c for an example and consolex/README for more information.
-
-This driver is only built for the mvme162lx bsp model.
-
-MVME162FX and DMA on the IP bus
--------------------------------
-
-From Eric Vaitl <eric@viasat.com>:
-
-If you have any customers that will be using the 162FX, tell them to
-be careful. The main difference between the 162 and the 162FX is DMA
-on the IP bus. I spent over a month trying to write a DMA HDLC driver
-for GreenSprings IP-MP and couldn't get it to work. I talked to some
-people at GreenSprings, and they agreed that there really is no way to
-get DMA to work unless you know the size of the packets in advance.
-Once the IP2 chip DMA controller is given the character count and
-enabled, it doesn't accept further commands until all of the
-characters have arrived. The only way to terminate a DMA transfer
-prematurely is by raising DMAEND* during the last read. None of the IP
-modules that I know of are currently able to do that. GreenSprings is
-working on the problem, but nothing is going to available for a few
-months.
-
-Installation
-------------
-Nothing unique to the MVME162. It has been incorporated into the
-standard release.
-
-Port Description
-----------------
-This section describes the initial port effort. There have been
-additions and modifications to the bsp since this was done.
-Interestingly, this was the first bsp submitted to the RTEMS project
-and the submission offer came out of the blue with no prior
-communication with the author. :)
-
-The port was done using already existing ports to the M68020 boards,
-DMV152 and MVME136.
-
-The initial host development system was SUN/Solaris 2.3, and
-the cross-development environment consisted of Free Software
-Foundation (FSF)'s GNU C compiler (version 2.6), GNU Assembler
-(version 2.3) and GNU binary utilities binutils version 2.5.2,
-built with m68k as a target. The recent/latest versions of other
-GNU programs (flex, make, etc) were also used at the build stage.
-
-In all subdirectories of the RTEMS distribution tree, the directories
-mvme136 were duplicated as mvme162.
-
-Essential modifications are detailed below:
-
-- the MVME162-specific hardware registers were described in bsp.h
-
-- timer and clock routines were made to use the MVME162's Tick Timers 1
-and 2, respectively
-
-- shared memory support was replaced by stubs for the time being
-
-- console IO was lifted entirely from the DMV152 support code, thanks
-to the fact that Z8530 SCC used in DMV152 is upwards compatible with
-the Z85230 SCC of the MVME162. (Only the memory mapping of the SCC
-registers had to be changed.)
-
-- symbols in several *.s files were prepended with underscores to
-comply with the xgcc configuration used (it prepends underscores to all
-symbols defined in c code)
-
-- linkcmds file was modified to place the linked code into the memory
-configured for the board in use
-
-- bspstart.c was modified as follows:
-
- monitors_vector_table = (m68k_isr *)0xFFE00000;
-
-was made to point to the power-up location of MVME162 interrupt vector
-table.
-
-- The shutdown is a temporary solution. To exit cleanly, it has to disable
-all enabled interrupts and restore the board to its power-up status.
-Presently this is not done satisfactorily, as a result, the board needs
-a hardware reset from the external VMEbus master or from the front
-panel to ensure correct operation for subsequent downloads.
-
-Host System
------------
-The VMEbus master used to externally control and download the MVME162
-is a FORCE CPU-2CE board running Solaris 2.3. A simple program to load
-s-records and start/reset the MVME162 was written. The code is in the
-file tools/sload.c
-
-This code depends on the external VMEbus master's vme driver and is
-provided as an example, without the Makefile. The bulk of the program
-which parses the s-records is courtesy of Kym Newbery,
-(8918927y@lux.levels.unisa.edu.au).
-
-In general, apart from x-gcc, the tools most often used while building
-RTEMS for MVME162 were: find, grep, diff, and, of course
-
-MVME162 Embedded Controller Programmer's Reference Guide,
-Motorola, MVME162PG/D1.
-
-Thanks
-------
-- to On-Line Applications Research Corporation (OAR) for developing
-RTEMS and making it available on a Technology Transfer basis;
-- to Joel Sherril, the leader of the RTEMS development group for
-stimulating and helpful discussions;
-- to Kym Newbery (8918927y@lux.levels.unisa.edu.au) for his s-record
-parser;
-- to Gerd Truschinski (gt@first.gmd.de) for creating and running the
-crossgcc mailing list
-- to FSF and Cygnus Support for great free software;
-
-What's new
-----------
- - 28.07.95 BSP adjusted to rtems-3.2.0.
- - Now console driver uses interrupts on receive (ring buffer
- code lifted with thanks from the IDP BSP next door (../idp))
- - both front-panel serial interfaces are supported
- - serious bug in timer interrupts fixed
- - interrupt test tm27 now supported
-
-+----------------------------------+-------------------------------+
-| Dr. Mikhail (Misha) Savitski | Voice : +46-980-79162 |
-| Software Systems Engineer | Fax : +46-980-79161 |
-| EISCAT Svalbard Radar Project | E-mail: mms@eiscathq.irf.se |
-| EISCAT Scientific Association |----------- /\_/\ -----------|
-| Box 812 S-98128 Kiruna, Sweden | EIS { o o } CAT |
-+----------------------------------+-------oQQQ--(>I<)--QQQo-------+
-
-
diff --git a/c/src/lib/libbsp/m68k/mvme162/bsp_specs b/c/src/lib/libbsp/m68k/mvme162/bsp_specs
deleted file mode 100644
index 2ee8ccda4d..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/bsp_specs
+++ /dev/null
@@ -1,26 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start.o%s} \
-%{qrtems_debug: start_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/m68k/mvme162/clock/Makefile.in b/c/src/lib/libbsp/m68k/mvme162/clock/Makefile.in
deleted file mode 100644
index d882f1d00f..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/clock/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/mvme162/clock/ckinit.c b/c/src/lib/libbsp/m68k/mvme162/clock/ckinit.c
deleted file mode 100644
index ef1e7b0b68..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/clock/ckinit.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/* Clock_init()
- *
- * This routine initializes the Tick Timer 2 on the MVME162 board.
- * The tick frequency is 1 millisecond.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Modifications of respective RTEMS file: COPYRIGHT (c) 1994.
- * EISCAT Scientific Association. M.Savitski
- *
- * This material is a part of the MVME162 Board Support Package
- * for the RTEMS executive. Its licensing policies are those of the
- * RTEMS above.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#define MS_COUNT 1000 /* T2's countdown constant (1 ms) */
-#define CLOCK_INT_LEVEL 6 /* T2's interrupt level */
-
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-volatile rtems_unsigned32 Clock_driver_ticks; /* ticks since initialization */
-rtems_isr_entry Old_ticker;
-
-void Clock_exit( void );
-
-#define CLOCK_VECTOR (VBR0 * 0x10 + 0x9)
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-
-/*
- * ISR Handler
- */
-
-rtems_isr Clock_isr(rtems_vector_number vector)
-{
- Clock_driver_ticks += 1;
- lcsr->timer_cnt_2 = 0; /* clear counter */
- lcsr->intr_clear |= 0x02000000;
-
- if ( Clock_isrs == 1 ) {
- rtems_clock_tick();
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
- }
- else
- Clock_isrs -= 1;
-}
-
-void Install_clock(rtems_isr_entry clock_isr )
-{
-
- Clock_driver_ticks = 0;
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- Old_ticker =
- (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
- lcsr->vector_base |= MASK_INT; /* unmask VMEchip2 interrupts */
- lcsr->to_ctl = 0xE7; /* prescaler to 1 MHz (see Appendix A1) */
- lcsr->timer_cmp_2 = MS_COUNT;
- lcsr->timer_cnt_2 = 0; /* clear counter */
- lcsr->board_ctl |= 0x700; /* increment, reset-on-compare, and */
- /* clear-overflow-cnt */
-
- lcsr->intr_level[0] |= CLOCK_INT_LEVEL * 0x10; /* set int level */
- lcsr->intr_ena |= 0x02000000; /* enable tick timer 2 interrupt */
-
- atexit( Clock_exit );
- }
-}
-
-void Clock_exit( void )
-{
-/* Dummy for now. See other m68k BSP's for code examples */
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libbsp/m68k/mvme162/console/Makefile.in b/c/src/lib/libbsp/m68k/mvme162/console/Makefile.in
deleted file mode 100644
index fd05ddfedd..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/mvme162/console/console.c b/c/src/lib/libbsp/m68k/mvme162/console/console.c
deleted file mode 100644
index ab700fe613..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/console/console.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * This file contains the MVME162 console IO package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Modifications of respective RTEMS file: COPYRIGHT (c) 1994.
- * EISCAT Scientific Association. M.Savitski
- *
- * This material is a part of the MVME162 Board Support Package
- * for the RTEMS executive. Its licensing policies are those of the
- * RTEMS above.
- *
- * $Id$
- */
-
-#define M162_INIT
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <ringbuf.h>
-
-Ring_buffer_t Console_Buffer[2];
-
-/*
- * Interrupt handler for receiver interrupts
- */
-
-rtems_isr C_Receive_ISR(rtems_vector_number vector)
-{
- register int ipend, port;
-
- ZWRITE0(1, 0x38); /* reset highest IUS */
-
- ipend = ZREAD(1, 3); /* read int pending from A side */
-
- if (ipend == 0x04) port = 0; /* channel B intr pending */
- else if (ipend == 0x20) port = 1; /* channel A intr pending */
- else return;
-
- Ring_buffer_Add_character(&Console_Buffer[port], ZREADD(port));
-
- if (ZREAD(port, 1) & 0x70) { /* check error stat */
- ZWRITE0(port, 0x30); /* reset error */
- }
-}
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- int i;
- rtems_status_code status;
-
- /*
- * Initialise receiver interrupts on both ports
- */
-
- for (i = 0; i <= 1; i++) {
- Ring_buffer_Initialize( &Console_Buffer[i] );
- ZWRITE(i, 2, SCC_VECTOR);
- ZWRITE(i, 10, 0);
- ZWRITE(i, 1, 0x10); /* int on all Rx chars or special condition */
- ZWRITE(i, 9, 8); /* master interrupt enable */
- }
-
- set_vector(C_Receive_ISR, SCC_VECTOR, 1); /* install ISR for ports A and B */
-
- mcchip->vector_base = 0;
- mcchip->gen_control = 2; /* MIEN */
- mcchip->SCC_int_ctl = 0x13; /* SCC IEN, IPL3 */
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 1
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- status = rtems_io_register_name(
- "/dev/tty00",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- status = rtems_io_register_name(
- "/dev/tty01",
- major,
- (rtems_device_minor_number) 1
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Non-blocking char input
- */
-
-rtems_boolean char_ready(int port, char *ch)
-{
- if ( Ring_buffer_Is_empty( &Console_Buffer[port] ) )
- return FALSE;
-
- Ring_buffer_Remove_character( &Console_Buffer[port], *ch );
-
- return TRUE;
-}
-
-/*
- * Block on char input
- */
-
-char inbyte(int port)
-{
- unsigned char tmp_char;
-
- while ( !char_ready(port, &tmp_char) );
- return tmp_char;
-}
-
-/*
- * This routine transmits a character out the SCC. It no longer supports
- * XON/XOFF flow control.
- */
-
-void outbyte(char ch, int port)
-{
- while (1) {
- if (ZREAD0(port) & TX_BUFFER_EMPTY) break;
- }
- ZWRITED(port, ch);
-}
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- if ( minor > 1 )
- return RTEMS_INVALID_NUMBER;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte( minor );
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- if ( minor > 1 )
- return RTEMS_INVALID_NUMBER;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r', minor );
- }
- outbyte( buffer[ count ], minor );
- }
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/m68k/mvme162/consolex/Makefile.in b/c/src/lib/libbsp/m68k/mvme162/consolex/Makefile.in
deleted file mode 100644
index 0c6f80fe05..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/consolex/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/consolex.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=consolex
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=consolex.h
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/m68k/mvme162/consolex/README b/c/src/lib/libbsp/m68k/mvme162/consolex/README
deleted file mode 100644
index 719ed245eb..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/consolex/README
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# $Id$
-#
-
-This driver was submitted by Katsutoshi Shibuya <shibuya@mxb.meshnet.or.jp>.
-
-Configuration
--------------
-The application can choose this driver by using "CONSOLEX_DRIVER_TABLE_ENTRY"
-in the driver table definition, in place of "CONSOLE_DRIVER_TABLE_ENTRY".
-See consolex/cTest.c for an example and consolex/README for more information.
-
-Programmatic Usage
-------------------
-
-- You can open 9 devices; console tty00, tty01, tty02, tty03,
- rtty00, rtty01, rtty02, rtty03
- tty00, rtty00 and console correspond to port#1 of MVME162LX,
- tty01 and rtty01 correspond to port#2, and so on.
-- tty0x are "cooked" devices. They support following flags on termios
- definition;
- ISTRIP, INLCR, IGNCR, ICRNL, IUCLC, OLCUC, ONLCR, OCRNL, ICANON, ECHO,
- CBAUD, B38400, B19200, B9600, CSIZE, CS8, CS7, PARENB, PARODD, CSTOPB,
-- rtty0x are "raw" devices. They support following flags on termios
- definition;
- CBAUD, B38400, B19200, B9600, CSIZE, CS8, CS7, PARENB, PARODD, CSTOPB,
-- The default parameter is;
- B38400, CS8, ICRNL, ONLCR, ICANON, ECHO
- (but all flags except B38400 and CS8 will be ignored on raw device.)
-- All devices support O_NDELAY (non blocking read/write) mode operation.
- (Non-blocking cooked mode output is valid, but will not work fine.)
- (Non-blocking cooked mode input with ECHO flag may be blocked while sending
- echoed character.)
-- All devices support hardware flow control by CTS/RTS.
- (There is no way to disable it. There are no supports for soft flow control.)
-- The application can use tcgetattr or ioctl to obtain the parameters of the
- device into struct termios.
-- The application can use tcsetattr or ioctl to set the parameters of the
- device within the struct temios. The action argument (2nd arg) of the
- tcsetattr must be TCSANOW.
-- On opening the device, the driver activate DTR line. On closing the device,
- the driver deactivate DTR line.
- If 2 or more device opening occures at the same time on the same port, only
- the first open procedure activates DTR line, and only the last close
- procedure deactivate it.
-- There are no device locking mechanisms. Application can open same device
- several times.
- But 2 simultanious reading operation on the same port will cause unexpected
- result.
-
-Porting Notes
--------------
-- This code can be used for any Zilog SCC based board.
- Change the time constant parameters and SCC register base addresses.
-
-- This code is well separated into "device depended part" and "device
- independed part".
- They can use device independed part for any other board. The device
- independed part requires following functions;
-
- void SCCInitialize();
- Initialize hardware.
- rtems_boolean SCCGetOne(int port, char *ch);
- Get one character from port. If no character is in the receiver buffer,
- this function returns FALSE, otherwise TRUE.
- char SCCGetOneBlocked(int port);
- Get one character from port. If no character is in the receiver buffer,
- wait it passing the CPU to the other task.
- rtems_boolean SCCSendOne(int port, char ch);
- Send one character via port. If the transmitter is not ready, this function
- returns FALSE, otherwise TRUE.
- void SCCSendOneBlocked(int port, char ch);
- Send one character via port. Wait until the transmitter is ready, passing
- the CPU to the other task.
- unsigned32 SCCSetAttributes(int port, struct termios *tm);
- Set device attribute according to the information in the struct termios.
- c_cflags parameter (baud, parity, stopbits and code size) will be checked.
- On the successful completion, this function should return 0.
- unsigned32 SCCGetAttributes(int port, struct termios *tm);
- Get device attribute according into the struct termios.
- c_cflags parameter (baud, parity, stopbits and code size) will be set.
- On the successful completion, this function should return 0.
- void SCCSetDTR(port);
- Activate DTR line.
- void SCCResetDTR(port);
- Deactivate DTR line.
- void SCCSetRTS(port);
- Activate RTS line.
- void SCCResetRTS(port);
- Deactivate RTS line.
- int SCCGetCTS(port);
- Return non zero when CTS line is activated.
-
-- If you don't want console port, undefine "CONSOLEPORT".
-
-- This code does not use ESCC feature; i.e. does not read register #4/#5/#14
-
diff --git a/c/src/lib/libbsp/m68k/mvme162/consolex/cTest.c b/c/src/lib/libbsp/m68k/mvme162/consolex/cTest.c
deleted file mode 100644
index cbfb6449b5..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/consolex/cTest.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Test program for consolex.
- *
- * NOTE: This program must be put together as an executable. :)
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <rtems/libio.h>
-#include <consolex.h>
-
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <termios.h>
-
-#if ! defined(O_NDELAY)
-# if defined(solaris2)
-# define O_NDELAY O_NONBLOCK
-# elif defined(RTEMS_NEWLIB)
-# define O_NDELAY _FNBIO
-# endif
-#endif
-
-rtems_driver_address_table Device_drivers[] = {
- CONSOLEX_DRIVER_TABLE_ENTRY
-};
-
-rtems_task Init(rtems_task_argument arg)
-{
- char buf[128];
- int fd;
- struct termios t;
-
- printf("Console test.\n");
-
- if((fd = open("/dev/tty00",O_RDWR)) < 0){
- printf("Can't open device.\n");
- return;
- }
- tcgetattr(fd,&t);
- t.c_cflag = B9600|CS8;
- tcsetattr(fd,TCSANOW,&t);
- printf("iflag=%07o, oflag=%07o, cflag=%07o, lflag=%07o\n",
- t.c_iflag,t.c_oflag,t.c_cflag,t.c_lflag);
-
- do{
- write(fd,"Your name? ",11);
- read(fd,buf,sizeof(buf));
- write(fd,"Hi ",3);
- write(fd,buf,strlen(buf));
- }while(*buf != '!');
-
- close(fd);
-
- printf("Done.\n");
-
- exit(0);
-}
-
-#define CONFIGURE_INIT
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-#define CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
-#include <confdefs.h>
diff --git a/c/src/lib/libbsp/m68k/mvme162/consolex/consolex.c b/c/src/lib/libbsp/m68k/mvme162/consolex/consolex.c
deleted file mode 100644
index 95ee91342b..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/consolex/consolex.c
+++ /dev/null
@@ -1,798 +0,0 @@
-/*
- * This file contains the MVME162LX extended console IO package.
- *
- * This file was created originally by
- * On-Line Applications Research Corporation (OAR)
- * and modified by:
- *
- * Katsutoshi Shibuya - BU-Denken Co.,Ltd. - Sapporo, JAPAN
- *
- * featuring support of:
- *
- * - Multi-SCC chip handling
- * - Non-blocking I/O (O_NDELAY flag in libc)
- * - Raw mode device (no CR/LF detection)
- * - RTS/CTS flow control
- *
- * REMARKS: This routine requires multiple interrupt vectors
- * from SCC_VECTOR (normaly 0x40)
- * to SCC_VECTOR+(number of SCC chips)
- *
- * The original copyright follows;
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Modifications of respective RTEMS file: COPYRIGHT (c) 1994.
- * EISCAT Scientific Association. M.Savitski
- *
- * This material is a part of the MVME162 Board Support Package
- * for the RTEMS executive. Its licensing policies are those of the
- * RTEMS above.
- *
- * $Id$
- */
-
-#define M162_INIT
-
-#include "consolex.h"
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#define NPORTS 4 /* Number of ports */
-#define DEVICEPREFIX "tty"
-#define RAWDEVICEPREFIX "rtty"
-#define CONSOLEPORT 0 /* port# of console:
- undef this if you do not want /dev/console */
-#define READRETRY 1 /* Maximum retry count for read one char */
-#define WRITERETRY 8 /* Maximum retry count for write one char */
-
-#define PORTFROM 0 /* for debug */
-
-static unsigned char opencount[NPORTS];
-
-/***********************************************************************
- Ring buffer for device
- ***********************************************************************/
-
-#define QUEUE_LENGTH 128 /* Must be 2^n number */
-
-typedef struct {
- char buffer[QUEUE_LENGTH];
- volatile int head;
- volatile int tail;
-} ReceiverBuffer;
-
-#define ReceiverBufferInitialize( _buffer ) \
- do { \
- (_buffer)->head = (_buffer)->tail = 0; \
- } while ( 0 )
-
-#define ReceiverBufferIsEmpty( _buffer ) \
- ( (_buffer)->tail == (_buffer)->head )
-
-#define ReceiverBufferIsNearEmpty( _buffer ) \
- ( (_buffer)->tail == (((_buffer)->head + 3) & (QUEUE_LENGTH-1)) )
-
-#define ReceiverBufferIsFull( _buffer ) \
- ( (_buffer)->head == (((_buffer)->tail + 1) & (QUEUE_LENGTH-1)) )
-
-#define ReceiverBufferIsNearFull( _buffer ) \
- ( (_buffer)->head == (((_buffer)->tail + 3) & (QUEUE_LENGTH-1)) )
-
-#define ReceiverBufferAdd( _buffer, _ch ) \
- do { \
- rtems_unsigned32 isrlevel; \
- \
- rtems_interrupt_disable( isrlevel ); \
- (_buffer)->tail = ((_buffer)->tail+1) & (QUEUE_LENGTH-1); \
- (_buffer)->buffer[ (_buffer)->tail ] = (_ch); \
- rtems_interrupt_enable( isrlevel ); \
- } while ( 0 )
-
-#define ReceiverBufferRemove( _buffer, _ch ) \
- do { \
- rtems_unsigned32 isrlevel; \
- \
- rtems_interrupt_disable( isrlevel ); \
- (_buffer)->head = ((_buffer)->head+1) & (QUEUE_LENGTH-1); \
- (_ch) = (_buffer)->buffer[ (_buffer)->head ]; \
- rtems_interrupt_enable( isrlevel ); \
- } while ( 0 )
-
-
-/***********************************************************************
- DEVICE DEPENDED PART
- ***********************************************************************/
-
-
-/* Time constant parameters
- CAUTION: These parameters are for MVME162LX-213 board.
- */
-
-#define TC38400 0x0006
-#define TC19200 0x000e
-#define TC9600 0x001e
-
-/* Re-defining SCC register control macros
- to support Multi SCC chips */
-
-#undef scc
-#if defined(mvme162lx)
-static scc_regs *scc[NPORTS] = {
- ((scc_regs * const) 0xFFF45004),
- ((scc_regs * const) 0xFFF45000),
- ((scc_regs * const) 0xFFF45804),
- ((scc_regs * const) 0xFFF45800)
-};
-#else
-/* XXX fix me */
-#warning "MVME162 BSP -- unknown address for SCC's"
-static scc_regs *scc[NPORTS] = {
- ((scc_regs * const) 0xFFF45004),
- ((scc_regs * const) 0xFFF45000),
- ((scc_regs * const) 0xFFF45804),
- ((scc_regs * const) 0xFFF45800)
-};
-#endif
-
-#undef ZWRITE0
-#define ZWRITE0(port, v) (scc[port]->csr = (unsigned char)(v))
-#undef ZREAD0
-#define ZREAD0(port) (scc[port]->csr)
-
-#undef ZREAD
-#define ZREAD(port, n) (ZWRITE0(port, n), (scc[port]->csr))
-#undef ZREADD
-#define ZREADD(port) (scc[port]->csr=0x08, scc[port]->csr )
-
-#undef ZWRITE
-#define ZWRITE(port, n, v) (ZWRITE0(port, n), ZWRITE0(port, v))
-#undef ZWRITED
-#define ZWRITED(port, v) (scc[port]->csr = 0x08, \
- scc[port]->csr = (unsigned char)(v))
-
-static ReceiverBuffer receiverBuffer[NPORTS];
-
-/*
- * Control flags (DTR/DCD/RTS/CTS)
- */
-
-static unsigned char wr4[NPORTS];
-static unsigned char wr5[NPORTS];
-#define SCCSetDTR(port) ZWRITE(port, 5, (wr5[port] |= 0x80))
-#define SCCResetDTR(port) ZWRITE(port, 5, (wr5[port] &= ~0x80))
-#define SCCSetRTS(port) ZWRITE(port, 5, (wr5[port] |= 0x02))
-#define SCCResetRTS(port) ZWRITE(port,5, (wr5[port] &= ~0x02))
-#define SCCGetDCD(port) (ZREAD0(port)&0x08)
-#define SCCGetCTS(port) (ZREAD0(port)&0x20)
-
-
-/*
- * Interrupt handler for receiver interrupts
- */
-
-static rtems_isr SCCReceiverISR(rtems_vector_number vector)
-{
- register int ipend, port;
-
- port = (vector-SCC_VECTOR)*2;
- ZWRITE0(port, 0x38); /* reset highest IUS */
-
- ipend = ZREAD(port, 3); /* read int pending from A side */
-
- if(ipend == 0x04)
- port++; /* channel B intr pending */
- else if(ipend == 0x20)
- ; /* channel A intr pending */
- else
- return;
-
- ReceiverBufferAdd(&receiverBuffer[port], ZREADD(port));
-
- if(ZREAD(port,1) & 0x70){ /* check error stat */
- ZWRITE0(port, 0x30); /* reset error */
- }
-
- if(ReceiverBufferIsNearFull(&receiverBuffer[port]))
- SCCResetRTS(port);
-}
-
-/*
- * Initialize
- */
-
-void SCCInitialize()
-{
- int i;
-
- for(i = PORTFROM; i < NPORTS; i+=2)
- ZWRITE(i, 9,0xc0); /* Reset SCC Chip */
-
- for(i = PORTFROM; i < NPORTS; i++){
- ReceiverBufferInitialize(&(receiverBuffer[i]));
- wr4[i] = 0x44;
- ZWRITE(i, 4, wr4[i]); /* x16 clock, 1 stop, parity none */
- ZWRITE(i, 1, 0); /* disable interrupts */
- ZWRITE(i, 2, SCC_VECTOR+(i/2));
- ZWRITE(i, 3, 0xc1); /* receiver enable, 8bits */
- wr5[i] = 0x68;
- ZWRITE(i, 5, wr5[i]); /* transmitter enable, 8bits, DTR&RTS off */
- ZWRITE(i,14, 0); /* stop baudrate gen. */
- ZWRITE(i,11,0x50); /* use baurate gen. */
- ZWRITE(i,15, 1); /* Select WR7' */
- ZWRITE(i, 7, 0); /* Disable all special interrupts */
- ZWRITE(i,10, 0);
- ZWRITE(i, 1, 0x10); /* int on all Rx chars or special condition */
- set_vector(SCCReceiverISR, SCC_VECTOR+(i/2), 1); /* install ISR */
- ZWRITE(i, 9, 8); /* master interrupt enable */
- ZWRITE(i,12,TC38400&0xff); /* set 38400 baud */
- ZWRITE(i,13,TC38400>>8);
- ZWRITE(i,14, 3); /* start baudrate gen. */
- /* CAUTION: If your SCC use XTAL on RTxC,
- write 1 */
- }
- mcchip->vector_base = 0;
- mcchip->gen_control = 2; /* MIEN */
- mcchip->SCC_int_ctl = 0x13; /* SCC IEN, IPL3 */
-}
-
-/*
- * Non-blocking char input
- */
-
-rtems_boolean SCCGetOne(int port, char *ch)
-{
- int retry = READRETRY;
- while(ReceiverBufferIsEmpty(&receiverBuffer[port]))
- if(--retry <= 0)
- return FALSE;
-
- ReceiverBufferRemove(&receiverBuffer[port],*ch);
-
- if(ReceiverBufferIsNearEmpty(&receiverBuffer[port]))
- SCCSetRTS(port);
- return TRUE;
-}
-
-/*
- * Blocking char input
- */
-
-char SCCGetOneBlocked(int port)
-{
- unsigned char tmp_char;
-
- while (!SCCGetOne(port, &tmp_char))
- rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
- return tmp_char;
-}
-
-/*
- * Non-blocking char input
- * No longer supports XON/XOFF flow control.
- */
-
-rtems_boolean SCCSendOne(int port, char ch)
-{
- int retry = WRITERETRY;
-
- if(!SCCGetCTS(port))
- return FALSE;
- while(!(ZREAD0(port) & TX_BUFFER_EMPTY))
- if(--retry <= 0)
- return FALSE;
- ZWRITED(port, ch);
- return TRUE;
-}
-
-
-/*
- * Blocking char output
- * No longer supports XON/XOFF flow control.
- */
-
-void SCCSendOneBlocked(int port, char ch)
-{
- while(!SCCSendOne(port, ch))
- rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
-}
-
-/*
- * Set parameters for transmission
- */
-
-unsigned32 SCCSetAttributes(int port, struct termios *t)
-{
- unsigned char wr3;
-
- ZWRITE(port,1,0); /* Disable interrupt */
- ZWRITE(port,3,0); /* Disable receiver */
- /* Baud */
- switch(t->c_cflag & CBAUD){
- case B38400:
- ZWRITE(port,12,TC38400&0xff);
- ZWRITE(port,13,TC38400>>8);
- break;
- case B19200:
- ZWRITE(port,12,TC19200&0xff);
- ZWRITE(port,13,TC19200>>8);
- break;
- case B9600:
- ZWRITE(port,12,TC9600&0xff);
- ZWRITE(port,13,TC9600>>8);
- break;
- }
-
- /* Code size */
- wr5[port] &= 0x8f;
- wr3 = 0; /* receiver control */
- switch(t->c_cflag & CSIZE){
- case CS8:
- wr5[port] |= 0x60;
- wr3 |= 0xc0;
- break;
- case CS7:
- wr5[port] |= 0x20;
- wr3 |= 0x40;
- break;
- }
-
- /* Parity */
- wr4[port] &= 0xf0;
- if(t->c_cflag & PARENB)
- wr4[port] |= 0x01;
- if(!(t->c_cflag & PARODD))
- wr4[port] |= 0x02;
- /* ZWRITE(port,4,wr4[port]);*/
-
- /* Stop bits */
- /* wr4[port] = ZREAD(port,4) & 0xfc;*/
- if(t->c_cflag & CSTOPB)
- wr4[port] |= 0x0c;
- else
- wr4[port] |= 0x04;
-
- ZWRITE(port,4,wr4[port]); /* TxRx parameters */
- ZWRITE(port,5,wr5[port]); /* Transmission parameters */
- ZWRITE(port,3,wr3|0x01); /* Enable receiver */
- ZWRITE(port,1,0x10); /* Enable interrupt */
-
- return 0;
-}
-
-/*
- * Get parameters for transmission
- */
-
-unsigned32 SCCGetAttributes(int port, struct termios *t)
-{
- unsigned32 b;
-
- t->c_cflag = 0;
-
- /* Baud */
- b = ZREAD(port,13);
- b <<= 8;
- b |= ZREAD(port,12);
- switch(b){
- case TC38400:
- t->c_cflag |= B38400;
- break;
- case TC19200:
- t->c_cflag |= B19200;
- break;
- case TC9600:
- t->c_cflag |= B9600;
- break;
- }
-
- /* Code size */
- /* wr = ZREAD(port,5);*/
- t->c_cflag &= ~CSIZE;
- switch(wr5[port]&0x60){
- case 0x60:
- t->c_cflag |= CS8;
- break;
- case 0x20:
- t->c_cflag |= CS7;
- break;
- }
-
- /* Parity */
- /* wr = ZREAD(port,4);*/
- if(wr4[port] & 0x01)
- t->c_cflag |= PARENB;
- else
- t->c_cflag &= ~PARENB;
- if(wr4[port] & 0x02)
- t->c_cflag &= ~PARODD;
- else
- t->c_cflag |= PARODD;
-
- /* Stop bits */
- /* wr = ZREAD(port,4);*/
- if((wr4[port]&0xc0) == 0xc0)
- t->c_cflag |= CSTOPB;
- else
- t->c_cflag &= ~CSTOPB;
-
- return 0;
-}
-
-/***********************************************************************
- DEVICE INDEPENDED PART
- ***********************************************************************/
-
-#define LOCAL_ISTRIP 0x0001
-#define LOCAL_INLCR 0x0002
-#define LOCAL_IGNCR 0x0004
-#define LOCAL_ICRNL 0x0008
-#define LOCAL_IUCLC 0x0010
-#define LOCAL_OLCUC 0x0020
-#define LOCAL_ONLCR 0x0040
-#define LOCAL_OCRNL 0x0080
-#define LOCAL_ICANON 0x0100
-#define LOCAL_ECHO 0x0200
-
-/*
- * Device initialize entry point
- */
-
-rtems_device_driver consolex_initialize(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- rtems_status_code status;
- char devname[16];
- int i;
-
- SCCInitialize();
-
-#ifdef CONSOLEPORT
- status = rtems_io_register_name("/dev/console",major,
- (rtems_device_minor_number) CONSOLEPORT);
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-#endif
-
- for(i = PORTFROM; i < NPORTS; i++){
- /* Register cooked ttys */
- sprintf(devname,"/dev/%s%02d",DEVICEPREFIX,i);
- status = rtems_io_register_name(strdup(devname),major,
- (rtems_device_minor_number) i);
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
- /* Register raw ttys */
- sprintf(devname,"/dev/%s%02d",RAWDEVICEPREFIX,i);
- status = rtems_io_register_name(strdup(devname),major,
- (rtems_device_minor_number) i+NPORTS);
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
- }
-
- for(i = 0; i < NPORTS; i++){
- opencount[i] = 0;
- }
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Open entry point
- */
-
-rtems_device_driver consolex_open(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- rtems_libio_open_close_args_t *openargs = (rtems_libio_open_close_args_t *) arg;
- if(minor >= NPORTS)
- minor -= NPORTS;
- if(minor >= NPORTS)
- return RTEMS_INVALID_NUMBER;
-
- if(opencount[minor]++ == 0){
- /* first open */
- SCCSetDTR(minor);
- SCCSetRTS(minor);
- }
- openargs->iop->data0 = LOCAL_ICRNL|LOCAL_ONLCR|LOCAL_ICANON|LOCAL_ECHO;
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver consolex_close(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- if(minor >= NPORTS)
- minor -= NPORTS;
- if(minor >= NPORTS)
- return RTEMS_INVALID_NUMBER;
-
- if(--(opencount[minor]) == 0){
- /* closed all */
- SCCResetRTS(minor);
- SCCResetDTR(minor);
- }
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port.
- */
-
-rtems_device_driver consolex_read_raw(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) arg;
- char *buffer;
- int count;
-
- if(minor >= NPORTS)
- return RTEMS_INVALID_NUMBER;
-
- buffer = rw_args->buffer;
- count = rw_args->count;
-
- if(rw_args->flags & LIBIO_FLAGS_NO_DELAY){
- /* Non blocking read */
- while(count){
- if(!SCCGetOne(minor,buffer))
- break;
- buffer++;
- count--;
- }
- }else{
- /* Blocking read */
- while(count){
- *buffer = SCCGetOneBlocked(minor);
- buffer++;
- count--;
- }
- }
-
- rw_args->bytes_moved = rw_args->count-count;
- return count ? RTEMS_UNSATISFIED : RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver consolex_read(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) arg;
- char *buffer;
- int count;
- unsigned32 mode;
-
- if(minor >= NPORTS)
- return consolex_read_raw(major,minor-NPORTS,arg);
-
- buffer = rw_args->buffer;
- count = rw_args->count;
- mode = rw_args->iop->data0;
-
- /* Cooked read */
- while(count){
- if(rw_args->flags & LIBIO_FLAGS_NO_DELAY){
- /* Non blocking read */
- if(!SCCGetOne(minor,buffer))
- break;
- }else{
- /* Blocking read */
- *buffer = SCCGetOneBlocked(minor);
- }
- if((mode&LOCAL_ICANON) && (*buffer == '\b')){
- if(buffer > (char *)(rw_args->buffer)){
- buffer--;
- count++;
- if(mode&LOCAL_ECHO){
- SCCSendOneBlocked(minor,'\b');
- SCCSendOneBlocked(minor,' ');
- SCCSendOneBlocked(minor,'\b');
- }
- }
- continue;
- }
- if((mode&LOCAL_IGNCR) && (*buffer == '\r'))
- continue;
- if((mode&LOCAL_INLCR) && (*buffer == '\n'))
- *buffer = '\r';
- if((mode&LOCAL_ICRNL) && (*buffer == '\r'))
- *buffer = '\n';
- if((mode&LOCAL_IUCLC) && isupper((int)*buffer))
- *buffer = tolower(*buffer);
- if(mode&LOCAL_ISTRIP)
- *buffer &= 0x7f;
- if(mode&LOCAL_ECHO){
- /* Caution: Echo back is blocking output */
- SCCSendOneBlocked(minor,*buffer);
- }
- if((mode&LOCAL_ICANON) && (*buffer == '\n')){
- buffer++;
- count--;
- if(count)
- *buffer = 0;
- if((mode&LOCAL_ECHO)&&(mode&LOCAL_ONLCR))
- SCCSendOneBlocked(minor,'\r');
- break; /* finish reading */
- }
- buffer++;
- count--;
- }
- rw_args->bytes_moved = rw_args->count-count;
- return count ? RTEMS_UNSATISFIED : RTEMS_SUCCESSFUL;
-}
-
-/*
- * write bytes to the serial port.
- */
-
-rtems_device_driver consolex_write_raw(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg)
-{
- rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) arg;
- char *buffer;
- int count;
-
- if(minor >= NPORTS)
- return RTEMS_INVALID_NUMBER;
-
- buffer = rw_args->buffer;
- count = rw_args->count;
-
- if(rw_args->flags & LIBIO_FLAGS_NO_DELAY){
- /* Non blocking write */
- while(count){
- if(!SCCSendOne(minor,*buffer))
- break;
- buffer++;
- count--;
- }
- }else{
- /* Blocking write */
- while(count){
- SCCSendOneBlocked(minor,*buffer);
- buffer++;
- count--;
- }
- }
-
- rw_args->bytes_moved = rw_args->count-count;
- return count ? RTEMS_UNSATISFIED : RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver consolex_write(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg)
-{
- rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) arg;
- char *buffer;
- int count;
- char ch;
- unsigned32 mode;
-
- if(minor >= NPORTS)
- return consolex_write_raw(major,minor-NPORTS,arg);
-
- buffer = rw_args->buffer;
- count = rw_args->count;
- mode = rw_args->iop->data0;
-
- /* Cooked write */
- while(count){
- ch = *buffer;
- if((mode&LOCAL_ONLCR) && (ch == '\n')){ /* Output CRLF */
- if(rw_args->flags & LIBIO_FLAGS_NO_DELAY){
- /* Non blocking write */
- if(!SCCSendOne(minor,'\r'))
- break;
- }else{
- SCCSendOneBlocked(minor,'\r');
- }
- }
- if((mode&LOCAL_OCRNL) && (ch == '\r'))
- ch = '\n';
- if((mode&OLCUC) && (islower((int)ch)))
- ch = toupper(ch);
- if(rw_args->flags & LIBIO_FLAGS_NO_DELAY){
- /* Non blocking write */
- if(!SCCSendOne(minor,ch))
- break;
- }else{
- SCCSendOneBlocked(minor,ch);
- }
- buffer++;
- count--;
- }
-
- rw_args->bytes_moved = rw_args->count-count;
- return count ? RTEMS_UNSATISFIED : RTEMS_SUCCESSFUL;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver consolex_control(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg)
-{
- rtems_libio_ioctl_args_t *ioarg = (rtems_libio_ioctl_args_t *)arg;
- struct termios *tm = ioarg->buffer;
- unsigned32 *mode = &(ioarg->iop->data0);
-
- if(minor >= NPORTS)
- minor -= NPORTS;
- if(minor >= NPORTS)
- return RTEMS_INVALID_NUMBER;
-
- switch(ioarg->command){
- case RTEMS_IO_GET_ATTRIBUTES:
- tm->c_iflag = tm->c_oflag = tm->c_cflag = tm->c_lflag = 0;
- if(*mode & LOCAL_ISTRIP)
- tm->c_iflag |= ISTRIP;
- if(*mode & LOCAL_INLCR)
- tm->c_iflag |= INLCR;
- if(*mode & LOCAL_IGNCR)
- tm->c_iflag |= IGNCR;
- if(*mode & LOCAL_ICRNL)
- tm->c_iflag |= ICRNL;
- if(*mode & LOCAL_IUCLC)
- tm->c_iflag |= IUCLC;
- if(*mode & LOCAL_OLCUC)
- tm->c_oflag |= OLCUC;
- if(*mode & LOCAL_ONLCR)
- tm->c_oflag |= ONLCR;
- if(*mode & LOCAL_OCRNL)
- tm->c_oflag |= OCRNL;
- if(*mode & LOCAL_ICANON)
- tm->c_lflag |= ICANON;
- if(*mode & LOCAL_ECHO)
- tm->c_lflag |= ECHO;
- ioarg->ioctl_return = SCCGetAttributes(minor,tm);
- break;
- case RTEMS_IO_SET_ATTRIBUTES:
- *mode = 0;
- if(tm->c_iflag & ISTRIP)
- *mode |= LOCAL_ISTRIP;
- if(tm->c_iflag & INLCR)
- *mode |= LOCAL_INLCR;
- if(tm->c_iflag & IGNCR)
- *mode |= LOCAL_IGNCR;
- if(tm->c_iflag & ICRNL)
- *mode |= LOCAL_ICRNL;
- if(tm->c_iflag & IUCLC)
- *mode |= LOCAL_IUCLC;
- if(tm->c_oflag & OLCUC)
- *mode |= LOCAL_OLCUC;
- if(tm->c_oflag & ONLCR)
- *mode |= LOCAL_ONLCR;
- if(tm->c_oflag & OCRNL)
- *mode |= LOCAL_OCRNL;
- if(tm->c_lflag & ICANON)
- *mode |= LOCAL_ICANON;
- if(tm->c_lflag & ECHO)
- *mode |= LOCAL_ECHO;
- ioarg->ioctl_return = SCCSetAttributes(minor,tm);
- break;
- default:
- return RTEMS_NOT_DEFINED;
- }
-
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/m68k/mvme162/consolex/consolex.h b/c/src/lib/libbsp/m68k/mvme162/consolex/consolex.h
deleted file mode 100644
index bada58d189..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/consolex/consolex.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* consolex.h
- *
- * This file describes the Extended Console Device Driver
- * This driver provides support for the standard C Library.
- *
- * This file was created originally by
- * On-Line Applications Research Corporation (OAR)
- * and modified by:
- *
- * Katsutoshi Shibuya - BU-Denken Co.,Ltd. - Sapporo, JAPAN
- *
- * featuring support of:
- *
- * - Multi-SCC chip handling
- * - Non-blocking I/O (O_NDELAY flag in libc)
- * - Raw mode device (no CR/LF detection)
- * - RTS/CTS flow control
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _CONSOLEX_DRIVER_h
-#define _CONSOLEX_DRIVER_h
-
-#include <rtems.h>
-#include <termios.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CONSOLEX_DRIVER_TABLE_ENTRY \
- { consolex_initialize, consolex_open, consolex_close, \
- consolex_read, consolex_write, consolex_control }
-
-rtems_device_driver consolex_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver consolex_open(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver consolex_close(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver consolex_read(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver consolex_write(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver consolex_control(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-/* Low level IO functions */
-void SCCInitialize();
-rtems_boolean SCCGetOne(int port, char *ch);
-char SCCGetOneBlocked(int port);
-rtems_boolean SCCSendOne(int port, char ch);
-void SCCSendOneBlocked(int port, char ch);
-unsigned32 SCCSetAttributes(int port, struct termios *t);
-unsigned32 SCCGetAttributes(int port, struct termios *t);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/mvme162/include/Makefile.in b/c/src/lib/libbsp/m68k/mvme162/include/Makefile.in
deleted file mode 100644
index 4481844fc4..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/include/Makefile.in
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h $(srcdir)/page_table.h \
- $(srcdir)/tod.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/m68k/mvme162/include/bsp.h b/c/src/lib/libbsp/m68k/mvme162/include/bsp.h
deleted file mode 100644
index b28aa4c73f..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/include/bsp.h
+++ /dev/null
@@ -1,294 +0,0 @@
-/* bsp.h
- *
- * This include file contains all MVME162fx board IO definitions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Modifications of respective RTEMS file: COPYRIGHT (c) 1994.
- * EISCAT Scientific Association. M.Savitski
- *
- * This material is a part of the MVME162 Board Support Package
- * for the RTEMS executive. Its licensing policies are those of the
- * RTEMS above.
- *
- * $Id$
- */
-
-#ifndef __MVME162_h
-#define __MVME162_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <clockdrv.h>
-#include <console.h>
-#include <iosupp.h>
-
-/*
- * Following defines must reflect the setup of the particular MVME162
- */
-
-#define GROUP_BASE_ADDRESS 0x0000F200
-#define BOARD_BASE_ADDRESS 0xFFFF0000
-
-/* Base for local interrupters' vectors (with enable bit set) */
-
-#define MASK_INT 0x00800000
-#define VBR0 0x6
-#define VBR1 0x7
-
-/* RAM limits */
-
-#define RAM_START 0x00100000
-#define RAM_END 0x00200000
-
-/*
- * ----------------------------------
- */
-
-typedef volatile struct {
- unsigned long slave_adr[2];
- unsigned long slave_trn[2];
- unsigned long slave_ctl;
- unsigned long mastr_adr[4];
- unsigned long mastr_trn;
- unsigned long mastr_att;
- unsigned long mastr_ctl;
- unsigned long dma_ctl_1;
- unsigned long dma_ctl_2;
- unsigned long dma_loc_cnt;
- unsigned long dma_vme_cnt;
- unsigned long dma_byte_cnt;
- unsigned long dma_adr_cnt;
- unsigned long dma_status;
- unsigned long to_ctl;
- unsigned long timer_cmp_1;
- unsigned long timer_cnt_1;
- unsigned long timer_cmp_2;
- unsigned long timer_cnt_2;
- unsigned long board_ctl;
- unsigned long prescaler_cnt;
- unsigned long intr_stat;
- unsigned long intr_ena;
- unsigned long intr_soft_set;
- unsigned long intr_clear;
- unsigned long intr_level[4];
- unsigned long vector_base;
-} lcsr_regs;
-
-#define lcsr ((lcsr_regs * const) 0xFFF40000)
-
-typedef volatile struct {
-
- unsigned char chipID;
- unsigned char chipREV;
- unsigned char gen_control;
- unsigned char vector_base;
-
- unsigned long timer_cmp_1;
- unsigned long timer_cnt_1;
- unsigned long timer_cmp_2;
- unsigned long timer_cnt_2;
-
- unsigned char LSB_prescaler_count;
- unsigned char prescaler_clock_adjust;
- unsigned char time_ctl_2;
- unsigned char time_ctl_1;
-
- unsigned char time_int_ctl_4;
- unsigned char time_int_ctl_3;
- unsigned char time_int_ctl_2;
- unsigned char time_int_ctl_1;
-
- unsigned char dram_err_int_ctl;
- unsigned char SCC_int_ctl;
- unsigned char time_ctl_4;
- unsigned char time_ctl_3;
-
- unsigned short DRAM_space_base;
- unsigned short SRAM_space_base;
-
- unsigned char DRAM_size;
- unsigned char DRAM_SRAM_opt;
- unsigned char SRAM_size;
- unsigned char reserved;
-
- unsigned char LANC_error;
- unsigned char reserved1;
- unsigned char LANC_int_ctl;
- unsigned char LANC_berr_ctl;
-
- unsigned char SCSI_error;
- unsigned char general_inputs;
- unsigned char MVME_162_version;
- unsigned char SCSI_int_ctl;
-
- unsigned long timer_cmp_3;
- unsigned long timer_cnt_3;
- unsigned long timer_cmp_4;
- unsigned long timer_cnt_4;
-
- unsigned char bus_clk;
- unsigned char PROM_acc_time_ctl;
- unsigned char FLASH_acc_time_ctl;
- unsigned char ABORT_int_ctl;
-
- unsigned char RESET_ctl;
- unsigned char watchdog_timer_ctl;
- unsigned char acc_watchdog_time_base_sel;
- unsigned char reserved2;
-
- unsigned char DRAM_ctl;
- unsigned char reserved4;
- unsigned char MPU_status;
- unsigned char reserved3;
-
- unsigned long prescaler_count;
-
-} mcchip_regs;
-
-#define mcchip ((mcchip_regs * const) 0xFFF42000)
-
-/*----------------------------------------------------------------*/
-
-/*
- * SCC Z8523(0) defines and macros
- * -------------------------------
- * Prototypes for the low-level serial io are also included here,
- * because such stuff is bsp-specific (yet). The function bodies
- * are in console.c
- *
- * NOTE from Eric Vaitl <evaitl@viasat.com>:
- *
- * I dropped RTEMS into a 162FX today (the MVME162-513). The 162FX has a
- * bug in the MC2 chip (revision 1) such that the SCC data register is
- * not accessible, it has to be accessed indirectly through the SCC
- * control register.
- */
-
-enum {portB, portA};
-
-rtems_boolean char_ready(int port, char *ch);
-char char_wait(int port);
-void char_put(int port, char ch);
-
-#define TX_BUFFER_EMPTY 0x04
-#define RX_DATA_AVAILABLE 0x01
-#define SCC_VECTOR 0x40
-
-typedef volatile struct {
- unsigned char pad1;
- volatile unsigned char csr;
- unsigned char pad2;
- volatile unsigned char buf;
-} scc_regs;
-
-#define scc ((scc_regs * const) 0xFFF45000)
-
-#define ZWRITE0(port, v) (scc[port].csr = (unsigned char)(v))
-#define ZREAD0(port) (scc[port].csr)
-
-#define ZREAD(port, n) (ZWRITE0(port, n), (scc[port].csr))
-#define ZREADD(port) (scc[port].csr=0x08, scc[port].csr )
-
-#define ZWRITE(port, n, v) (ZWRITE0(port, n), ZWRITE0(port, v))
-#define ZWRITED(port, v) (scc[port].csr = 0x08, \
- scc[port].csr = (unsigned char)(v))
-/*----------------------------------------------------------------*/
-
-/*
- * The following registers are located in the VMEbus short
- * IO space and respond to address modifier codes $29 and $2D.
- * On FORCE CPU use address gcsr_vme and device /dev/vme16d32.
-*/
-typedef volatile struct {
- unsigned char chip_revision;
- unsigned char chip_id;
- unsigned char lmsig;
- unsigned char board_scr;
- unsigned short gpr[6];
-} gcsr_regs;
-
-#define gcsr_vme ((gcsr_regs * const) (GROUP_BASE_ADDRESS + BOARD_BASE_ADDRESS))
-#define gcsr ((gcsr_regs * const) 0xFFF40100)
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Define the interrupt mechanism for Time Test 27
- *
- * NOTE: We use software interrupt 0
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) \
- set_vector( (handler), VBR1 * 0x10 + 0x8, 1 ); \
- lcsr->intr_level[2] |= 3; \
- lcsr->intr_ena |= 0x100;
-
-#define Cause_tm27_intr() lcsr->intr_soft_set |= 0x100
-
-#define Clear_tm27_intr() lcsr->intr_clear |= 0x100
-
-#define Lower_tm27_intr()
-
-#ifdef M162_INIT
-#undef EXTERN
-#define EXTERN
-#else
-#undef EXTERN
-#define EXTERN extern
-#endif
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-extern m68k_isr_entry M68Kvec[]; /* vector table address */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-m68k_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/mvme162/include/coverhd.h b/c/src/lib/libbsp/m68k/mvme162/include/coverhd.h
deleted file mode 100644
index a05b2744f6..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/include/coverhd.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C on this target.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 2
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 1
-#define CALLING_OVERHEAD_TASK_CREATE 3
-#define CALLING_OVERHEAD_TASK_IDENT 2
-#define CALLING_OVERHEAD_TASK_START 2
-#define CALLING_OVERHEAD_TASK_RESTART 2
-#define CALLING_OVERHEAD_TASK_DELETE 1
-#define CALLING_OVERHEAD_TASK_SUSPEND 1
-#define CALLING_OVERHEAD_TASK_RESUME 2
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 2
-#define CALLING_OVERHEAD_TASK_MODE 2
-#define CALLING_OVERHEAD_TASK_GET_NOTE 2
-#define CALLING_OVERHEAD_TASK_SET_NOTE 2
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 4
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 1
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 2
-#define CALLING_OVERHEAD_CLOCK_GET 4
-#define CALLING_OVERHEAD_CLOCK_SET 4
-#define CALLING_OVERHEAD_CLOCK_TICK 1
-
-#define CALLING_OVERHEAD_TIMER_CREATE 2
-#define CALLING_OVERHEAD_TIMER_IDENT 1
-#define CALLING_OVERHEAD_TIMER_DELETE 2
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 2
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 5
-#define CALLING_OVERHEAD_TIMER_RESET 1
-#define CALLING_OVERHEAD_TIMER_CANCEL 1
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 2
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 1
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 2
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 2
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 2
-
-#define CALLING_OVERHEAD_EVENT_SEND 2
-#define CALLING_OVERHEAD_EVENT_RECEIVE 2
-#define CALLING_OVERHEAD_SIGNAL_CATCH 2
-#define CALLING_OVERHEAD_SIGNAL_SEND 2
-#define CALLING_OVERHEAD_PARTITION_CREATE 3
-#define CALLING_OVERHEAD_PARTITION_IDENT 2
-#define CALLING_OVERHEAD_PARTITION_DELETE 2
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 2
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 2
-#define CALLING_OVERHEAD_REGION_CREATE 3
-#define CALLING_OVERHEAD_REGION_IDENT 2
-#define CALLING_OVERHEAD_REGION_DELETE 1
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 3
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 2
-#define CALLING_OVERHEAD_PORT_CREATE 3
-#define CALLING_OVERHEAD_PORT_IDENT 2
-#define CALLING_OVERHEAD_PORT_DELETE 2
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 2
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 2
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 3
-#define CALLING_OVERHEAD_IO_OPEN 2
-#define CALLING_OVERHEAD_IO_CLOSE 2
-#define CALLING_OVERHEAD_IO_READ 2
-#define CALLING_OVERHEAD_IO_WRITE 2
-#define CALLING_OVERHEAD_IO_CONTROL 2
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 2
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 2
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 1
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/mvme162/include/page_table.h b/c/src/lib/libbsp/m68k/mvme162/include/page_table.h
deleted file mode 100644
index a5685245f2..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/include/page_table.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * $Id$
- *
- * This file was submitted by Eric Vaitl <vaitl@viasat.com> and
- * supports page table initialization.
- *
- * $Log$
- * Revision 1.1 1995/12/19 19:22:36 joel
- * file lost in crash and re-added
- *
- * Revision 1.1 1995/12/05 15:29:19 joel
- * added.. submitted by Eric Vaitl <vaitl@viasat.com>
- *
- * Revision 1.2 1995/10/27 21:00:33 vaitl
- * Modified page table routines so application code can map
- * VME space.
- *
- * Revision 1.1 1995/10/25 17:16:06 vaitl
- * Working on page table. Caching partially set up, but can't currently
- * set tc register.
- *
- */
-
-#ifndef PAGE_TABLE_H
-#define PAGE_TABLE_H
-
-extern void page_table_teardown(void);
-extern void page_table_init(void);
-extern int page_table_map(void *addr, unsigned long size, int cache_type);
-
-enum {
- CACHE_WRITE_THROUGH,
- CACHE_COPYBACK,
- CACHE_NONE_SERIALIZED,
- CACHE_NONE
-};
-enum {
- PTM_SUCCESS,
- PTM_BAD_ADDR,
- PTM_BAD_SIZE,
- PTM_BAD_CACHE,
- PTM_NO_TABLE_SPACE
-};
-
-#endif
diff --git a/c/src/lib/libbsp/m68k/mvme162/include/tod.h b/c/src/lib/libbsp/m68k/mvme162/include/tod.h
deleted file mode 100644
index 4839e39df2..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/include/tod.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Real Time Clock (MK48T08) for RTEMS on MVME162
- *
- * Author:
- * COPYRIGHT (C) 1997
- * by Katsutoshi Shibuya - BU Denken Co.,Ltd. - Sapporo - JAPAN
- * ALL RIGHTS RESERVED
- *
- * The license and 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 material is a part of the MVME162 Board Support Package
- * for the RTEMS executive. Its licensing policies are those of the
- * RTEMS above.
- *
- * $Id$
- */
-
-
-#ifndef TOD_H
-#define TOD_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern void setRealTimeToRTEMS();
-/* Read real time from RTC and set it to RTEMS' clock manager */
-
-extern void setRealTimeFromRTEMS();
-/* Read time from RTEMS' clock manager and set it to RTC */
-
-extern int checkRealTime();
-/* Return the difference between RTC and RTEMS' clock manager time in minutes.
- If the difference is greater than 1 day, this returns 9999. */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in b/c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in
deleted file mode 100644
index b84caf0d2e..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main page_table sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-
diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c b/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c
deleted file mode 100644
index 78faa3cc8d..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This routine returns control to 162Bug.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- *
- * Modifications of respective RTEMS file: COPYRIGHT (c) 1994.
- * EISCAT Scientific Association. M.Savitski
- *
- * This material is a part of the MVME162 Board Support Package
- * for the RTEMS executive. Its licensing policies are those of the
- * RTEMS above.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <zilog/z8036.h>
-#include <page_table.h>
-
-void bsp_return_to_monitor_trap()
-{
- extern void start( void );
-
- page_table_teardown();
-
- lcsr->intr_ena = 0; /* disable interrupts */
-#if defined(mvme162lx)
- m68k_set_vbr(0x00000000); /* restore 162Bug vectors */
-#else
- m68k_set_vbr(0xFFE00000); /* restore 162Bug vectors */
-#endif
-
- asm volatile( "trap #15" ); /* trap to 162Bug */
- asm volatile( ".short 0x63" ); /* return to 162Bug (.RETURN) */
- /* restart program */
- /*
- * This does not work on the 162....
- */
-#if 0
- { register volatile void *start_addr;
-
- start_addr = start;
-
- asm volatile ( "jmp %0@" : "=a" (start_addr) : "0" (start_addr) );
- }
-#endif
-}
-
-void bsp_cleanup( void )
-{
- M68Kvec[ 45 ] = bsp_return_to_monitor_trap; /* install handler */
- asm volatile( "trap #13" ); /* insures SUPV mode */
-}
diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c
deleted file mode 100644
index 4c5c359ebb..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Modifications of respective RTEMS file: COPYRIGHT (c) 1994.
- * EISCAT Scientific Association. M.Savitski
- *
- * This material is a part of the MVME162 Board Support Package
- * for the RTEMS executive. Its licensing policies are those of the
- * RTEMS above.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <page_table.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- m68k_isr_entry *monitors_vector_table;
- int index;
-
- /*
- * 162Bug Vectors are at 0xFFE00000
- * 162Bug Vectors on LX are at 0x00000000
- */
-
-#if defined(mvme162lx)
- monitors_vector_table = (m68k_isr_entry *)0x00000000;
-#else
- monitors_vector_table = (m68k_isr_entry *)0xFFE00000;
-#endif
-
- m68k_set_vbr( monitors_vector_table );
-
- for ( index=2 ; index<=255 ; index++ )
- M68Kvec[ index ] = monitors_vector_table[ 32 ];
-
- M68Kvec[ 2 ] = monitors_vector_table[ 2 ]; /* bus error vector */
- M68Kvec[ 4 ] = monitors_vector_table[ 4 ]; /* breakpoints vector */
- M68Kvec[ 9 ] = monitors_vector_table[ 9 ]; /* trace vector */
- M68Kvec[ 47 ] = monitors_vector_table[ 47 ]; /* system call vector */
-
- m68k_set_vbr( &M68Kvec );
-
- /*
- * You may wish to make the VME arbitration round-robin here, currently
- * we leave it as it is.
- */
-
- /* set the Interrupt Base Vectors */
-
- lcsr->vector_base = (VBR0 << 28) | (VBR1 << 24);
-
- page_table_init();
-
- /*
- * we only use a hook to get the C library initialized.
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec;
- Cpu_table.interrupt_stack_size = 4096;
-
- BSP_Configuration.work_space_start = (void *)
- (RAM_END - BSP_Configuration.work_space_size);
-}
diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds
deleted file mode 100644
index 27bea7d764..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the Motorola MVME162 board.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Modifications of respective RTEMS file: COPYRIGHT (c) 1994.
- * EISCAT Scientific Association. M.Savitski
- *
- * This material is a part of the MVME162 Board Support Package
- * for the RTEMS executive. Its licensing policies are those of the
- * RTEMS above.
- *
- * $Id$
- */
-
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
-
-MEMORY
- {
- ram : org = 0x100000, l = 1M
- }
-
-SECTIONS
-{
- .text 0x100000 :
- {
- text_start = . ;
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- etext = ALIGN( 0x10 ) ;
- }
- .data ADDR( .text ) + SIZEOF( .text ):
- {
- data_start = . ;
- *(.data)
- edata = ALIGN( 0x10 ) ;
- }
- .bss ADDR( .data ) + SIZEOF( .data ):
- {
- bss_start = . ;
- *(.bss)
- *(COMMON)
- . += StackSize; /* XXX -- Old gld can't handle this */
- . = ALIGN (16);
- stack_init = .;
- end = . ;
- _end = . ;
- }
-}
diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/page_table.c b/c/src/lib/libbsp/m68k/mvme162/startup/page_table.c
deleted file mode 100644
index a1ad5c135b..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/startup/page_table.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * $Id$
- *
- * This file was submitted by Eric Vaitl <vaitl@viasat.com>.
- * The manipulation of the page table has a very positive impact on
- * the performance of the MVME162.
- *
- * The following history is included verbatim from the submitter.
- *
- * Revision 1.8 1995/11/18 00:07:25 vaitl
- * Modified asm statements to get rid of the register hard-codes.
- *
- * Revision 1.7 1995/10/27 21:00:32 vaitl
- * Modified page table routines so application code can map
- * VME space.
- *
- * Revision 1.6 1995/10/26 17:40:01 vaitl
- * Two cache changes after reading the mvme162 users manual.
- *
- * 1) The users manual says that the MPU can act as a source for the
- * VME2 chip, so I made the VME accessable memory copy-back instead
- * of write through. I have't changed the comments yet. If this
- * causes problems, I'll change it back.
- *
- * 2) The 162 book also says that IO space should be serialized as well as
- * non-cacheable. I flipped the appropriate dttr0 and ittr0 registers. I
- * don't think this is really necessary because we don't recover from any
- * exceptions. If it slows down IO addresses too much, I'll change it back
- * and see what happens.
- *
- * Revision 1.5 1995/10/25 19:32:38 vaitl
- * Got it. Three problems:
- * 1) Must cpusha instead of cinva.
- * 2) On page descriptors the PDT field of 1 or 3 is resident. On pointer
- * descriptors resident is 2 or 3. I was using 2 for everything.
- * Changed it to 3 for everything.
- * 3) Forgot to do a pflusha.
- *
- * Revision 1.4 1995/10/25 17:47:11 vaitl
- * Still working on it.
- *
- * Revision 1.3 1995/10/25 17:16:05 vaitl
- * Working on page table. Caching partially set up, but can't currently
- * set tc register.
- *
- */
-
-#include <string.h>
-#include <page_table.h>
-
-/* All page table must fit between BASE_TABLE_ADDR and
- MAX_TABLE_ADDR. */
-
-#define BASE_TABLE_ADDR 0x10000
-#define MAX_TABLE_ADDR 0x20000
-#define ROOT_TABLE_SIZE 512
-#define POINTER_TABLE_SIZE 512
-#define PAGE_TABLE_SIZE 256
-
-static unsigned long *root_table;
-static unsigned long *next_avail;
-
-/* Returns a zeroed out table. */
-static unsigned long *table_alloc(int size){
- unsigned long *addr=next_avail;
- if(((unsigned long)next_avail + size) > MAX_TABLE_ADDR){
- return 0;
- }
- bzero((void *)addr,size);
- next_avail =(unsigned long *)((unsigned long)next_avail + size);
- return addr;
-}
-
-
-
-/*
- void page_table_init();
-
- This should transparently map the first 4 Meg of ram. Caching is
- turned off from 0x00000000 to 0x00020000 (this region is used by
- 162Bug and contains the page tables). From 0x00020000 to 0x00400000
- we are using copy back caching. DTTR0 and ITTR0 are set up to
- directly translate from 0x80000000-0xffffffff with caching turned
- off and serialized. Addresses between 0x400000 and 0x80000000 are
- illegal.
-*/
-void page_table_init(){
-
- /* put everything in a known state */
- page_table_teardown();
-
- root_table=table_alloc(ROOT_TABLE_SIZE);
-
- /* First set up TTR.
- base address = 0x80000000
- address mask = 0x7f
- Ignore FC2 for match.
- Noncachable.
- Not write protected.*/
- asm volatile ("movec %0,%%dtt0
- movec %0,%%itt0"
- :: "d" (0x807fc040));
-
- /* Point urp and srp at root page table. */
- asm volatile ("movec %0,%%urp
- movec %0,%%srp"
- :: "d" (BASE_TABLE_ADDR));
-
- page_table_map((void *)0,0x20000, CACHE_NONE);
- page_table_map((void *)0x20000,0x400000-0x20000,CACHE_COPYBACK);
-
- /* Turn on paging with a 4 k page size.*/
- asm volatile ("movec %0,%%tc"
- :: "d" (0x8000));
-
- /* Turn on the cache. */
- asm volatile ("movec %0,%%cacr"
- :: "d" (0x80008000));
-}
-
-void page_table_teardown(){
- next_avail=(unsigned long *)BASE_TABLE_ADDR;
- /* Turn off paging. Turn off the cache. Flush the cache. Tear down
- the transparent translations. */
- asm volatile ("movec %0,%%tc
- movec %0,%%cacr
- cpusha %%bc
- movec %0,%%dtt0
- movec %0,%%itt0
- movec %0,%%dtt1
- movec %0,%%itt1"
- :: "d" (0) );
-}
-
-/* Identity maps addr to addr+size with caching cache_type. */
-int page_table_map(void *addr, unsigned long size, int cache_type){
- unsigned long *pointer_table;
- unsigned long *page_table;
- unsigned long root_index, pointer_index, page_index;
- /* addr must be a multiple of 4k */
- if((unsigned long)addr & 0xfff){
- return PTM_BAD_ADDR;
- }
- /* size must also be a multiple of 4k */
- if(size & 0xfff){
- return PTM_BAD_SIZE;
- }
- /* check for valid cache type */
- if( (cache_type>CACHE_NONE) || (cache_type<CACHE_WRITE_THROUGH)){
- return PTM_BAD_CACHE;
- }
-
- while(size){
- root_index=(unsigned long)addr;
- root_index >>= 25;
- root_index &= 0x7f;
-
- if(root_table[root_index]){
- pointer_table =
- (unsigned long *) (root_table[root_index] & 0xfffffe00);
- }else{
- if(!(pointer_table=table_alloc(POINTER_TABLE_SIZE))){
- return PTM_NO_TABLE_SPACE;
- }
- root_table[root_index]=((unsigned long)pointer_table) + 0x03;
- }
-
- pointer_index=(unsigned long)addr;
- pointer_index >>=18;
- pointer_index &= 0x7f;
-
- if(pointer_table[pointer_index]){
- page_table =
- (unsigned long *) (pointer_table[pointer_index] &
- 0xffffff00);
- }else{
- if(!(page_table=table_alloc(PAGE_TABLE_SIZE))){
- return PTM_NO_TABLE_SPACE;
- }
- pointer_table[pointer_index]=
- ((unsigned long)page_table) + 0x03;
- }
-
- page_index=(unsigned long)addr;
- page_index >>=12;
- page_index &= 0x3f;
-
- page_table[page_index] =
- ((unsigned long) addr & 0xfffff000) + 0x03 + (cache_type << 5);
-
- size -= 4096;
- addr = (void *) ((unsigned long)addr + 4096);
- }
-
- /* Flush the ATC. Push and invalidate the cache. */
- asm volatile ("pflusha
- cpusha %bc");
-
- return PTM_SUCCESS;
-}
-
-
diff --git a/c/src/lib/libbsp/m68k/mvme162/timer/Makefile.in b/c/src/lib/libbsp/m68k/mvme162/timer/Makefile.in
deleted file mode 100644
index 24809cbed8..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=timerisr
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/mvme162/timer/timer.c b/c/src/lib/libbsp/m68k/mvme162/timer/timer.c
deleted file mode 100644
index e11a6a034a..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/timer/timer.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Timer_init()
- *
- * This routine initializes the Tick Timer 1 on the MVME162 board.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: This routine will not work if the optimizer is enabled
- * for some compilers. The multiple writes
- * may be optimized away.
- *
- * It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Modifications of respective RTEMS file: COPYRIGHT (c) 1994.
- * EISCAT Scientific Association. M.Savitski
- *
- * This material is a part of the MVME162 Board Support Package
- * for the RTEMS executive. Its licensing policies are those of the
- * RTEMS above.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-
-/* Periodic tick interval */
-#define TICK_INTERVAL 0x10000U
-#define TIMER_INT_LEVEL 6
-
-rtems_unsigned32 Ttimer_val;
-rtems_boolean Timer_driver_Find_average_overhead;
-
-rtems_isr timerisr();
-
-void Timer_initialize()
-{
- (void) set_vector( timerisr, VBR0 * 0x10 + 0x8, 0 );
-
- Ttimer_val = 0; /* clear timer ISR count */
- lcsr->vector_base |= MASK_INT; /* unmask VMEchip2 interrupts */
- lcsr->intr_clear |= 0x01000000; /* clear pending interrupt */
- lcsr->to_ctl = 0xE7; /* prescaler to 1 MHz (see Appendix A1) */
- lcsr->timer_cmp_1 = TICK_INTERVAL;
- lcsr->timer_cnt_1 = 0; /* clear counter */
- lcsr->board_ctl |= 7; /* increment, reset-on-compare, */
- /* and clear-overflow-cnt */
-
- lcsr->intr_level[0] |= TIMER_INT_LEVEL; /* set int level */
- lcsr->intr_ena |= 0x01000000; /* enable tick timer 1 interrupt */
-}
-
-#define AVG_OVERHEAD 3U /* It typically takes 3.0 microseconds */
- /* (3 countdowns) to start/stop the timer. */
-#define LEAST_VALID 10U /* Don't trust a value lower than this */
-
-int Read_timer()
-{
- rtems_unsigned32 total;
-
- total = (Ttimer_val * TICK_INTERVAL) + lcsr->timer_cnt_1;
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in one-half microsecond units */
-
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
-
- return (total-AVG_OVERHEAD) >> 1;
-}
-
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/m68k/mvme162/timer/timerisr.s b/c/src/lib/libbsp/m68k/mvme162/timer/timerisr.s
deleted file mode 100644
index 9380fac0f0..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/timer/timerisr.s
+++ /dev/null
@@ -1,47 +0,0 @@
-/* timer_isr()
- *
- * This routine provides the ISR for the Z8036 timer on the MVME136
- * board. The timer is set up to generate an interrupt at maximum
- * intervals.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Modifications of respective RTEMS file: COPYRIGHT (c) 1994.
- * EISCAT Scientific Association. M.Savitski
- *
- * This material is a part of the MVME162 Board Support Package
- * for the RTEMS executive. Its licensing policies are those of the
- * RTEMS above.
- *
- * $Id$
- */
-
-#include "asm.h"
-
-BEGIN_CODE
-
-.set INTR_CLEAR_REG, 0xfff40074 | interrupt clear register
-.set RELOAD, 0x01000000 | clear tick 1 interrupt
-
- PUBLIC (Ttimer_val)
- PUBLIC (timerisr)
-SYM (timerisr):
- move.l a0, -(a7) | save a0
- movea.l #INTR_CLEAR_REG, a0 | a0 = addr of cmd status reg
- ori.l #RELOAD, (a0) | reload countdown
- addq.l #1, SYM (Ttimer_val) | increment timer value
- move.l (a7)+, a0 | restore a0
- rte
-
-END_CODE
-END
diff --git a/c/src/lib/libbsp/m68k/mvme162/times b/c/src/lib/libbsp/m68k/mvme162/times
deleted file mode 100644
index 7f37dc4176..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/times
+++ /dev/null
@@ -1,193 +0,0 @@
-#
-# Timing Test Suite Results for the Motorola MVME162 BSP
-#
-# $Id$
-#
-
-NOTE: This BSP is used submitted and no information is currently available.
-
-Board: Motorola MVME162
-CPU: Motorola MC68040
-Clock Speed:
-Memory Configuration: SRAM, DRAM, cache, etc
-Wait States:
-
-Times Reported in: cycles, microseconds, etc
-Timer Source: Count Down Timer, on-CPU cycle counter, etc
-
-Column A: unused
-Column B: unused
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 20
- rtems_semaphore_delete 21
- rtems_semaphore_obtain: available 15
- rtems_semaphore_obtain: not available -- NO_WAIT 15
- rtems_semaphore_release: no waiting tasks 16
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 62
-
- 3 rtems_semaphore_release: task readied -- preempts caller 55
-
- 4 rtems_task_restart: blocked task -- preempts caller 77
- rtems_task_restart: ready task -- preempts caller 70
- rtems_semaphore_release: task readied -- returns to caller 25
- rtems_task_create 57
- rtems_task_start 31
- rtems_task_restart: suspended task -- returns to caller 36
- rtems_task_delete: suspended task 47
- rtems_task_restart: ready task -- returns to caller 37
- rtems_task_restart: blocked task -- returns to caller 46
- rtems_task_delete: blocked task 50
-
- 5 rtems_task_suspend: calling task 51
- rtems_task_resume: task readied -- preempts caller 49
-
- 6 rtems_task_restart: calling task 59
- rtems_task_suspend: returns to caller 18
- rtems_task_resume: task readied -- returns to caller 19
- rtems_task_delete: ready task 50
-
- 7 rtems_task_restart: suspended task -- preempts caller 70
-
- 8 rtems_task_set_priority: obtain current priority 12
- rtems_task_set_priority: returns to caller 27
- rtems_task_mode: obtain current mode 5
- rtems_task_mode: no reschedule 5
- rtems_task_mode: reschedule -- returns to caller 8
- rtems_task_mode: reschedule -- preempts caller 39
- rtems_task_set_note 13
- rtems_task_get_note 13
- rtems_clock_set 33
- rtems_clock_get 3
-
- 9 rtems_message_queue_create 110
- rtems_message_queue_send: no waiting tasks 37
- rtems_message_queue_urgent: no waiting tasks 37
- rtems_message_queue_receive: available 31
- rtems_message_queue_flush: no messages flushed 12
- rtems_message_queue_flush: messages flushed 16
- rtems_message_queue_delete 26
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 15
- rtems_message_queue_receive: not available -- caller blocks 62
-
-11 rtems_message_queue_send: task readied -- preempts caller 72
-
-12 rtems_message_queue_send: task readied -- returns to caller 39
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 72
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 39
-
-15 rtems_event_receive: obtain current events 1
- rtems_event_receive: not available -- NO_WAIT 12
- rtems_event_receive: not available -- caller blocks 56
- rtems_event_send: no task readied 12
- rtems_event_receive: available 12
- rtems_event_send: task readied -- returns to caller 24
-
-16 rtems_event_send: task readied -- preempts caller 55
-
-17 rtems_task_set_priority: preempts caller 62
-
-18 rtems_task_delete: calling task 83
-
-19 rtems_signal_catch 9
- rtems_signal_send: returns to caller 15
- rtems_signal_send: signal to self 18
- exit ASR overhead: returns to calling task 22
- exit ASR overhead: returns to preempting task 49
-
-20 rtems_partition_create 35
- rtems_region_create 23
- rtems_partition_get_buffer: available 15
- rtems_partition_get_buffer: not available 13
- rtems_partition_return_buffer 18
- rtems_partition_delete 16
- rtems_region_get_segment: available 22
- rtems_region_get_segment: not available -- NO_WAIT 21
- rtems_region_return_segment: no waiting tasks 19
- rtems_region_get_segment: not available -- caller blocks 64
- rtems_region_return_segment: task readied -- preempts caller 74
- rtems_region_return_segment: task readied -- returns to caller 44
- rtems_region_delete 16
- rtems_io_initialize 2
- rtems_io_open 1
- rtems_io_close 1
- rtems_io_read 1
- rtems_io_write 1
- rtems_io_control 1
-
-21 rtems_task_ident 149
- rtems_message_queue_ident 145
- rtems_semaphore_ident 156
- rtems_partition_ident 145
- rtems_region_ident 148
- rtems_port_ident 145
- rtems_timer_ident 145
- rtems_rate_monotonic_ident 145
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 42
- rtems_message_queue_broadcast: no waiting tasks 17
- rtems_message_queue_broadcast: task readied -- preempts caller 78
-
-23 rtems_timer_create 14
- rtems_timer_fire_after: inactive 22
- rtems_timer_fire_after: active 24
- rtems_timer_cancel: active 15
- rtems_timer_cancel: inactive 13
- rtems_timer_reset: inactive 21
- rtems_timer_reset: active 23
- rtems_timer_fire_when: inactive 34
- rtems_timer_fire_when: active 34
- rtems_timer_delete: active 19
- rtems_timer_delete: inactive 17
- rtems_task_wake_when 69
-
-24 rtems_task_wake_after: yield -- returns to caller 9
- rtems_task_wake_after: yields -- preempts caller 45
-
-25 rtems_clock_tick 4
-
-26 _ISR_Disable 0
- _ISR_Flash 1
- _ISR_Enable 1
- _Thread_Disable_dispatch 0
- _Thread_Enable_dispatch 7
- _Thread_Set_state 11
- _Thread_Disptach (NO FP) 31
- context switch: no floating point contexts 21
- context switch: self 10
- context switch: to another task 10
- context switch: restore 1st FP task 25
- fp context switch: save idle, restore idle 31
- fp context switch: save idle, restore initialized 19
- fp context switch: save initialized, restore initialized 20
- _Thread_Resume 7
- _Thread_Unblock 7
- _Thread_Ready 9
- _Thread_Get 4
- _Semaphore_Get 2
- _Thread_Get: invalid id 0
-
-27 interrupt entry overhead: returns to interrupted task 6
- interrupt exit overhead: returns to interrupted task 6
- interrupt entry overhead: returns to nested interrupt 6
- interrupt exit overhead: returns to nested interrupt 5
- interrupt entry overhead: returns to preempting task 7
- interrupt exit overhead: returns to preempting task 36
-
-28 rtems_port_create 16
- rtems_port_external_to_internal 11
- rtems_port_internal_to_external 11
- rtems_port_delete 16
-
-29 rtems_rate_monotonic_create 15
- rtems_rate_monotonic_period: initiate period -- returns to caller 21
- rtems_rate_monotonic_period: obtain status 13
- rtems_rate_monotonic_cancel 16
- rtems_rate_monotonic_delete: inactive 18
- rtems_rate_monotonic_delete: active 20
- rtems_rate_monotonic_period: conclude periods -- caller blocks 53
diff --git a/c/src/lib/libbsp/m68k/mvme162/tod/Makefile.in b/c/src/lib/libbsp/m68k/mvme162/tod/Makefile.in
deleted file mode 100644
index 964508d2ab..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/tod/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/tod.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=tod
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/mvme162/tod/tod.c b/c/src/lib/libbsp/m68k/mvme162/tod/tod.c
deleted file mode 100644
index 67efadaf53..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/tod/tod.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Real Time Clock (MK48T08) for RTEMS on MVME162
- *
- * Author:
- * COPYRIGHT (C) 1997
- * by Katsutoshi Shibuya - BU Denken Co.,Ltd. - Sapporo - JAPAN
- * ALL RIGHTS RESERVED
- *
- * The license and 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 material is a part of the MVME162 Board Support Package
- * for the RTEMS executive. Its licensing policies are those of the
- * RTEMS above.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <tod.h>
-
-#define tod ((volatile unsigned char *)0xfffc1ff8)
-
-static int getTod(int n, unsigned char mask)
-{
- unsigned char x;
-
- x = tod[n]&mask;
- return (x>>4)*10+(x&0x0f);
-}
-
-static void setTod(int n, unsigned char d)
-{
- tod[n] = ((d/10)<<4)+(d%10);
-}
-
-void setRealTimeToRTEMS()
-{
- rtems_time_of_day t;
-
- tod[0] |= 0x40; /* Stop read register */
- t.year = 1900+getTod(7,0xff);
- t.month = getTod(6,0x1f);
- t.day = getTod(5,0x3f);
- t.hour = getTod(3,0x3f);
- t.minute = getTod(2,0x7f);
- t.second = getTod(1,0x7f);
- t.ticks = 0;
- tod[0] &= 0x3f; /* Release read register */
-
- rtems_clock_set(&t);
-}
-
-void setRealTimeFromRTEMS()
-{
- rtems_time_of_day t;
-
- rtems_clock_get(RTEMS_CLOCK_GET_TOD,&t);
- t.year -= 1900;
-
- tod[0] |= 0x80; /* Stop write register */
- setTod(7,t.year);
- setTod(6,t.month);
- setTod(5,t.day);
- setTod(4,1); /* I don't know which day of week is */
- setTod(3,t.hour);
- setTod(2,t.minute);
- setTod(1,t.second);
- tod[0] &= 0x3f; /* Write these parameters */
-}
-
-int checkRealTime()
-{
- rtems_time_of_day t;
- int d;
-
- tod[0] |= 0x40; /* Stop read register */
- rtems_clock_get(RTEMS_CLOCK_GET_TOD,&t);
- if((t.year != 1900+getTod(7,0xff))
- || (t.month != getTod(6,0x1f))
- || (t.day != getTod(5,0x3f)))
- d = 9999;
- else
- d = (t.hour-getTod(3,0x3f))*3600
- + (t.minute-getTod(3,0x7f))*60
- + (t.second - getTod(1,0x7f));
- tod[1] &= 0x3f;
- return d;
-}
diff --git a/c/src/lib/libbsp/m68k/mvme162/tools/Makefile.in b/c/src/lib/libbsp/m68k/mvme162/tools/Makefile.in
deleted file mode 100644
index afd7a71b9a..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/tools/Makefile.in
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# we use host compiler here for genoffsets. Hopefully it has same alignment!!
-USE_HOST_COMPILER=yes
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=sload
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-PGMS=${ARCH}/sload
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here.
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGMS)
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-install: all
- $(INSTALL) -m 555 ${PGMS} ${PROJECT_RELEASE}/bin
diff --git a/c/src/lib/libbsp/m68k/mvme162/tools/sload.c b/c/src/lib/libbsp/m68k/mvme162/tools/sload.c
deleted file mode 100644
index 1fe0ecd421..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/tools/sload.c
+++ /dev/null
@@ -1,511 +0,0 @@
-/*
- *
- * Copyright (c) 1994 by EISCAT Scientific Association.
- * All Rights Reserved.
- * M.Savitski
- *
- * S-record code - courtesy of Kym Newbery
- * 8918927y@lux.levels.unisa.edu.au
- *
- * Loading S-records into the VMEbus memory.
- *
- * Loads an executable in s-record format into the MVME dual-ported
- * memory and directs the MVME CPU to start execution.
- * VMEbus access is done via the FORCE CPU-2CE vmeplus driver in
- * read/write mode for loading and in mmap mode for accessing MVME registers.
- * See mvme162.h for #define's dependent on the MVME162 setup.
- *
- * $Id$
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-
-#include <sys/types.h>
-#include <sys/fcntl.h>
-#include <sys/resource.h>
-#include <unistd.h>
-#include <sys/vme.h>
-#include <sys/mman.h>
-
-#include "../include/bsp.h"
-
-#define FALSE 0
-#define TRUE 1
-
-#define DATA19 0
-#define DATA28 1
-#define DATA37 3
-#define HEADER 4
-#define TERMINATOR 5
-#define NONE 6
-
-unsigned int ahdtoi(unsigned char digit);
-int issrec(char *str);
-int validrec(char *str);
-void hdr2str(char *sstr, char *pstr);
-unsigned long getaddr(char *str);
-unsigned int datasize(char *str);
-void usage (void);
-int MVMEControl(u_long entry, int reset, int go);
-
-unsigned int ahdtoi(unsigned char digit)
-/* converts a hexadecimal char to an integer
- *
- * entry : digit = character to convert
- * : 0..15 = result
- * : -1 = char is not a digit
- */
-{
-/* check digit */
- if (!isxdigit(digit))
- return(-1);
-
- switch (toupper(digit)) {
- case 'A' : return(0xA);
- case 'B' : return(0xB);
- case 'C' : return(0xC);
- case 'D' : return(0xD);
- case 'E' : return(0xE);
- case 'F' : return(0xF);
- default : return(digit - 0x30);
- }
-}
-
-int issrec(char *str)
-/* attempts to identify the type of Srecord string passed
- *
- * entry : str = pointer to null terminated string
- * returns : 0,1,2,3,5,7,8,9 for S0..S9 except S6 & S4
- * : -1 = invalid header or header not found
- * : -2 = invalid header number
- */
-{
-/* Check first character for S */
- if ((isupper(str[0]) && (str[0] == 'S')) || (islower(str[0]) && (str[0] == 's')))
- {
- /* check for valid header number */
- switch (str[1]) {
- case '0' : return 0; /* header record */
- case '1' : return 1; /* data record, 2byte addr */
- case '2' : return 2; /* " " , 3byte addr */
- case '3' : return 3; /* " " , 4byte addr */
- case '5' : return 5; /* number of S1,S2,S3 blocks */
- case '7' : return 7; /* S3 terminator */
- case '8' : return 8; /* S2 terminator */
- case '9' : return 9; /* S1 terminator */
- default : return -2; /* all others are invalid */
- }
- }
- return(-1);
-}
-
-int validrec(char *str)
-/* Tests for a valid srecord. tests checksum & for nondigit characters
- * doesn't rely on any other srecord routines.
- *
- * entry : str = pointer to null terminated string
- * returns : -1 = srecord contains invalid characters
- * : -2 = srecord checksum is invalid
- * : -3 = srecord record length is invalid
- * : 0 = srecord is valid
- */
-{
- int cn = 1, rlen=0;
- int mchksum=0, rchksum=0;
-
-/* first check if there are any non-digit characters except S */
- while (str[cn]!=0)
- if (!isxdigit(str[cn++]))
- return(-1);
-
-/* test number of data bytes */
- rlen = ahdtoi(str[2])* 0x10 + ahdtoi(str[3]);
- if (((strlen(str)-4)/2U) != rlen) return(-3);
-
-/* get checksum from string */
- rchksum = ahdtoi(str[rlen*2+2])*0x10 + ahdtoi(str[rlen*2+3]); /* string chksum */
-
-/* now calculate my own checksum */
- for (cn=2; cn <= rlen*2; )
- mchksum += ahdtoi(str[cn++])*0x10 + ahdtoi(str[cn++]);
- mchksum = ~mchksum & 0xFF;
- if (mchksum != rchksum) return(-2); /* return -2 in not equal */
-
-/* return OK if we didn't fail any of these tests */
- return(0);
-}
-
-void hdr2str(char *sstr, char *pstr)
-/* converts header record (S0) string into a plain string
- *
- * entry : sstr = pointer to S0 string record
- * exit : pstr = pointer to string long enough to hold string
- * (caller must allocate enough space for string)
- */
-{
- int rlen, cn, pn=0;
-
- rlen = ahdtoi(sstr[2])*0x10 + ahdtoi(sstr[3]);
- for (cn=8; cn <= rlen*2; )
- pstr[pn++] = ahdtoi(sstr[cn++])*0x10 + ahdtoi(sstr[cn++]);
- pstr[pn]=0;
-}
-
-unsigned long getaddr(char *str)
-/* returns the address of the srecord in str. assumes record is valid.
- *
- * entry : str = pointer to srecord string
- * exit : address of data, word or long.
- */
-{
- unsigned long addr=0;
-
- switch (issrec(str)) {
- case 0 :
- case 1 :
- case 5 :
- case 9 : addr = ahdtoi(str[4])*0x1000 + ahdtoi(str[5])*0x100
- + ahdtoi(str[6])*0x10 + ahdtoi(str[7]);
- return(addr);
- case 2 :
- case 8 : addr = ahdtoi(str[4])*0x100000 + ahdtoi(str[5])*0x10000
- + ahdtoi(str[6])*0x1000 + ahdtoi(str[7])*0x100
- + ahdtoi(str[8])*0x10 + ahdtoi(str[9]);
- return(addr);
- case 3 :
- case 7 : addr = ahdtoi(str[4])*0x10000000 + ahdtoi(str[5])*0x1000000
- + ahdtoi(str[6])*0x100000 + ahdtoi(str[7])*0x10000
- + ahdtoi(str[8])*0x1000 + ahdtoi(str[9])*0x100
- + ahdtoi(str[10])*0x10 + ahdtoi(str[11]);
- return(addr);
- default : return(-1);
- }
-}
-
-unsigned int datasize(char *str)
-/*
- * returns the number of data bytes in the srecord. assumes record is valid.
- *
- * entry : str = pointer to srecord string
- * exit : number of bytes of data in the data field.
- */
-{
- unsigned int size=0;
-
- switch (issrec(str)) {
- case 0 :
- case 1 :
- case 5 :
- case 7 :
- case 8 :
- case 9 : size = ahdtoi(str[2])*0x10 + ahdtoi(str[3]);
- return(size-3);
- case 2 : size = ahdtoi(str[2])*0x10 + ahdtoi(str[3]);
- return(size-4);
- case 3 : size = ahdtoi(str[2])*0x10 + ahdtoi(str[3]);
- return(size-5);
- default : return(-1);
- }
-}
-
-void usage (void)
-/*
- * prints correct usage on stdout
- */
-{
- printf("\nUSAGE : sload [-v][-g][-r] [file]\n");
- printf(" file is an s-record file\n");
- printf(" -v for verbose summary of s-records loaded\n");
- printf(" -g to start execution\n");
- printf(" -r to reset MVME162\n\n");
-}
-
-int MVMEControl(u_long entry, int reset, int go)
-/* Controls MVME-162 from other VME master:
- * if entry != 0, loads it as start address
- * if go != 0, starts program execution from entry
- * if reset != 0, resets mvme162's local bus
- * Depends upon #define'ed GROUP_BASE_ADDRESS and BOARD_BASE_ADDRESS
- * which in turn are set by the 162-BUG's ENV command.
- */
-{
- int vme;
- char vmedev[32] = "/dev/vme16d32"; /* d32 is important !!! */
- u_long pagesize;
- struct gcsr *gcsr_map;
-
- pagesize = sysconf(_SC_PAGESIZE); /* mmap likes to be page-aligned */
-
- if ((vme = open(vmedev, O_RDWR)) == -1) {
- perror("open");
- fprintf(stderr, "Cannot open vme as %s to access GCSR\n", vmedev);
- return 1;
- }
-
-/* "MAP_SHARED" is important here */
- gcsr_map = (struct gcsr *) mmap(0, 0x1000, PROT_WRITE|PROT_READ, MAP_SHARED,
- vme, (u_long)gcsr_vme / pagesize * pagesize);
- if (gcsr_map == (struct gcsr *) - 1) {
- perror("mmap");
- fprintf(stderr, "Cannot mmap() to remote bus address 0x%08X\n",
- (u_long)gcsr_vme / pagesize * pagesize);
- return 1;
- }
-
-/*
- * use GCSR to start execution in MVME162
- * adjust pointer to compensate for page alignement
- */
- gcsr_map = (struct gcsr *)((u_long)gcsr_map + (u_long)gcsr_vme % pagesize);
-
- if (reset) { /* reset the local bus... */
- gcsr_map->board_scr |= 0x80;
- }
- if (entry) { /* ...load start address... */
- gcsr_map->gpr[0] = entry >> 16U;
- gcsr_map->gpr[1] = entry & 0x0000FFFF;
- }
- if (go) { /* ... and kick it in the ass! */
- gcsr_map->lmsig = 0x1;
- }
-}
-
-/*=================================================================== */
-main(int argc, char *argv[])
-{
- char inpstr[256];
- u_char image[256];
- char hdrstr[64];
- int i, j, k, result, size, line=0, lastrec=0;
- long addr, tsize=0, naddr=0, blksize=0, blknum=1;
- FILE *in;
- char infile[256] = "";
- char vmedev[32] = "/dev/vme32d32"; /* Assume "/dev/vme32d32" */
- int vme, verbose = 0, go = 0, reset = 0, havefile = 0;
-
-/* Parse the command line */
-
- --argc;
-
- while (argv++, argc--) {
- if (**argv != '-') {
- strcpy(infile, *argv);
- havefile = 1;
- } else if (!strcmp(*argv, "-v")) {
- verbose = 1;
- } else if (!strcmp(*argv, "-g")) {
- go = 1;
- } else if (!strcmp(*argv, "-r")) {
- reset = 1;
-/* } else if (!strcmp(*argv, "-vme32")) { */
-/* strcpy(vmedev, "/dev/vme32d32"); */
-/* } else if (!strcmp(*argv, "-vme24")) { */
-/* strcpy(vmedev, "/dev/vme24d32"); */
-/* } else if (!strcmp(*argv, "-vme16")) { */
-/* strcpy(vmedev, "/dev/vme16d32"); */
- } else if (!strcmp(*argv, "-")) {
- usage();
- exit(0);
- } else {
- usage();
- exit(0);
- }
- }
-
- if (!havefile) {
- if (!reset && !go) {
- usage();
- }
- else {
- MVMEControl(0, reset, go);
- }
- exit(0);
- }
-
- if ((in = fopen(infile, "r")) == NULL) {
- perror("open");
- fprintf(stderr, "Cannot open input file %s\n", infile);
- exit(1);
- }
-
- if ((vme = open(vmedev, O_RDWR)) == -1) {
- fprintf(stderr, "Cannot open vme as %s\n", vmedev);
- }
-
- while (fscanf(in, "%s", &inpstr) != EOF) {
- line++;
- if (validrec(inpstr) == 0) {
- switch (issrec(inpstr)) {
- case 0 :
- hdr2str(inpstr, hdrstr);
- if (verbose) printf("HEADER string = `%s'\n", hdrstr);
- lastrec=HEADER;
- break;
- case 1 :
- addr = getaddr(inpstr);
- size = datasize(inpstr);
- if (blksize == 0) {
- blksize+=size;
- naddr=addr+size;
- if (verbose) printf("DATA\tS19\t$%04lX", addr);
- lastrec=DATA19;
- }
- else if ((blksize!=0) && (addr==naddr)) {
- blksize+=size;
- naddr=addr+size;
- }
- else {
- if (verbose) printf("\t$%04lX\t%lu", naddr-1, blksize);
- if (verbose) printf("\t%d\n", blknum);
- blknum+=1;
- naddr=addr+size;
- blksize=size;
- if (verbose) printf("DATA\tS19\t$%04lX", addr);
- lastrec=DATA19;
- }
- tsize += size;
- if (vme == -1) break;
- for (i = 0, j = 8, k = size; k-- > 0; i += 1, j += 2) {
- image[i] = ahdtoi(inpstr[j])*0x10 + ahdtoi(inpstr[j+1]);
- }
- if (lseek(vme, addr, SEEK_SET) == -1) {
- fprintf(stderr, "lseek() to vme address %08X failed\n", addr);
- }
- else {
- if (write(vme, (u_char *)image, size) != size) {
- fprintf(stderr, "Write to vme address %08X failed\n", addr);
- }
- }
- break;
- case 2 :
- addr = getaddr(inpstr);
- size = datasize(inpstr);
- if (blksize == 0) {
- blksize+=size;
- naddr=addr+size;
- if (verbose) printf("DATA\tS28\t$%06lX",addr);
- lastrec=DATA28;
- }
- else if ((blksize!=0) && (addr==naddr)) {
- blksize+=size;
- naddr=addr+size;
- }
- else {
- if (verbose) printf("\t$%06lX\t%lu",naddr-1,blksize);
- if (verbose) printf("\t%d\n",blknum);
- blknum+=1;
- naddr=addr+size;
- blksize=size;
- if (verbose) printf("DATA\tS28\t$%06lX",addr);
- lastrec=DATA28;
- }
- tsize += size;
- if (vme == -1) break;
- for (i = 0, j = 10, k = size; k-- > 0; i += 1, j += 2) {
- image[i] = ahdtoi(inpstr[j])*0x10 + ahdtoi(inpstr[j+1]);
- }
- if (lseek(vme, addr, SEEK_SET) == -1) {
- fprintf(stderr, "lseek() to vme address %08X failed\n", addr);
- }
- else {
- if (write(vme, (u_char *)image, size) != size) {
- fprintf(stderr, "Write to vme address %08X failed\n", addr);
- }
- }
- break;
- case 3 :
- addr = getaddr(inpstr);
- size = datasize(inpstr);
- if (blksize == 0) {
- blksize+=size;
- naddr=addr+size;
- if (verbose) printf("DATA\tS37\t$%08lX",addr);
- lastrec=DATA37;
- }
- else if ((blksize!=0) && (addr==naddr)) {
- blksize+=size;
- naddr=addr+size;
- }
- else {
- if (verbose) printf("\t$%08lX\t%lu",naddr-1,blksize);
- if (verbose) printf("\t%d\n",blknum);
- blknum+=1;
- naddr=addr+size;
- blksize=size;
- if (verbose) printf("DATA\tS37\t$%08lX",addr);
- lastrec=DATA37;
- }
- tsize += size;
- if (vme == -1) break;
- for (i = 0, j = 12, k = size; k-- > 0; i += 1, j += 2) {
- image[i] = ahdtoi(inpstr[j])*0x10 + ahdtoi(inpstr[j+1]);
- }
- if (lseek(vme, addr, SEEK_SET) == -1) {
- fprintf(stderr, "lseek() to vme address %08X failed\n", addr);
- }
- else {
- if (write(vme, (u_char *)image, size) != size) {
- fprintf(stderr, "Write to vme address %08X failed\n", addr);
- }
- }
- break;
- case 7 :
- if (lastrec==DATA19){if (verbose) printf("\t$%04lX\t%lu",naddr-1,blksize);}
- if (lastrec==DATA28){if (verbose) printf("\t$%06lX\t%lu",naddr-1,blksize);}
- if (lastrec==DATA37){if (verbose) printf("\t$%08lX\t%lu",naddr-1,blksize);}
- if (verbose) printf("\t%d\n",blknum);
- addr = getaddr(inpstr);
- if (verbose) printf("TERM\tS37");
- printf("\nExecution address = $%08lX\n", addr);
- lastrec=TERMINATOR;
- break;
- case 8 :
- if (lastrec==DATA19){if (verbose) printf("\t$%04lX\t%lu",naddr-1,blksize);}
- if (lastrec==DATA28){if (verbose) printf("\t$%06lX\t%lu",naddr-1,blksize);}
- if (lastrec==DATA37){if (verbose) printf("\t$%08lX\t%lu",naddr-1,blksize);}
- if (verbose) printf("\t%d\n",blknum);
- addr = getaddr(inpstr);
- if (verbose) printf("TERM\tS28");
- printf("\nExecution address = $%06lX\n", addr);
- lastrec=TERMINATOR;
- break;
- case 9 :
- if (lastrec==DATA19){if (verbose) printf("\t$%04lX\t%lu",naddr-1,blksize);}
- if (lastrec==DATA28){if (verbose) printf("\t$%06lX\t%lu",naddr-1,blksize);}
- if (lastrec==DATA37){if (verbose) printf("\t$%08lX\t%lu",naddr-1,blksize);}
- if (verbose) printf("\t%d\n",blknum);
- addr = getaddr(inpstr);
- if (verbose) printf("TERM\tS19");
- printf("\nExecution address = $%04lX\n", addr);
- lastrec=TERMINATOR;
- break;
- }
- }
- else {
- printf("\nError on line %d. ",line);
- switch (validrec(inpstr)) {
- case -1 : {printf("SRecord contains invalid characters.\n"); break; }
- case -2 : {printf("SRecord checksum is invalid.\n"); break;}
- case -3 : {printf("SRecord length is invalid.\n"); break;}
- }
- exit(1);
- }
- }
-
- if ((lastrec==DATA19) || (lastrec==DATA28) || (lastrec==DATA37)) {
- if (lastrec==DATA19){if (verbose) printf("\t$%04lX\t%lu",naddr-1,blksize);}
- if (lastrec==DATA28){if (verbose) printf("\t$%06lX\t%lu",naddr-1,blksize);}
- if (lastrec==DATA37){if (verbose) printf("\t$%08lX\t%lu",naddr-1,blksize);}
- if (verbose) printf("\t%d\n",blknum);
- printf("ERROR: terminator record not found.\n");
- }
- else {
- for (i = 0x000FFFF; i-- > 0;) ; /* mystique delay... */
- MVMEControl(addr, reset, go);
- }
- if (verbose) printf("total data size = %lu bytes\n", tsize);
-}
diff --git a/c/src/lib/libbsp/m68k/mvme162/wrapup/Makefile.in b/c/src/lib/libbsp/m68k/mvme162/wrapup/Makefile.in
deleted file mode 100644
index 45d702bda3..0000000000
--- a/c/src/lib/libbsp/m68k/mvme162/wrapup/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console timer tod
-CPU_PIECES=
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(wildcard ../consolex/$(ARCH)/consolex.rel) \
- $(foreach piece, $(CPU_PIECES), \
- ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(piece).rel) \
- $(wildcard \
- ../../../../libcpu/$(RTEMS_CPU)/$(RTEMS_CPU_MODEL)/fpsp/$(ARCH)/fpsp.rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/Makefile.in b/c/src/lib/libbsp/m68k/ods68302/Makefile.in
deleted file mode 100644
index e53f5417f5..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SRCS=README
-
-all: $(SRCS)
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include start302 startup clock console timer wrapup
diff --git a/c/src/lib/libbsp/m68k/ods68302/README b/c/src/lib/libbsp/m68k/ods68302/README
deleted file mode 100644
index 59e36b0953..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/README
+++ /dev/null
@@ -1,81 +0,0 @@
-#
-# $Id$
-#
-
-BSP NAME: ods68302
-BOARD: proprietary (see below for relevant information)
-BUS: none
-CPU FAMILY: MC68000
-COPROCESSORS: 68302 communications co-processor
-MODE: not applicable
-
-DEBUG MONITOR: gdb
-
-PERIPHERALS
-===========
-TIMERS: two 68302 timers, one 68302 watchdog timer
- RESOLUTION: ?
-SERIAL PORTS: three 68302 SCCs
-REAL-TIME CLOCK:
-DMA: built-in 68302, not used
-VIDEO: none
-SCSI: none
-NETWORKING: none
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: 68302 (TIMER1)
-IOSUPP DRIVER: 68302 SCC2
-SHMSUPP: none
-TIMER DRIVER: 68302 TIMER2
-
-STDIO
-=====
-PORT: SCC3 for ROM build, SCC1 for DEGUB build
-ELECTRICAL: EIA-232
-BAUD: 9600
-BITS PER CHARACTER: 8
-PARITY: None
-STOP BITS: 1
-
-DEBUG MONITOR
-=============
-PORT: SCC3
-ELECTRICAL: EIA-232
-BAUD: 57600
-BITS PER CHARACTER: 8
-PARITY: None
-STOP BITS: 1
-
-NOTES
-=====
-
-This BSP is based on the gen68302. The main differences are C code for
-boot parameters, the gdb monitor, and variant support.
-
-The boot code which changes is written in C and the parameters used to
-control the configuration of the chip select registers and parallel
-ports are held in variant specific header files. These file also
-control the other hardware specific definitions such the processor
-freqency.
-
-The gdb monitor currently uses two serial ports. One for the debugger
-and one for stdio. This is costly in terms of the 68302 processor.
-
-The build configuration contains the memory map. The bsp code does not
-contain any memory map parameters. That is the ods68302.cfg contains
-the link addresses.
-
-To build a version to download via gdb use the command line parameters
-to make or "RTEMS_DEBUGGER=yes". This will change the memory map to
-place the code, and data above the RAM used by the gdb stub.
-
-TODO
-====
-
-1) Lower the set size of the gdb monitor. This can be made to be about
-10K or RAM. The code is about 14K.
-
-2) Add the production memory test code. This will be C and asm
-code. The asm will be a faster version of the C.
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/bsp_specs b/c/src/lib/libbsp/m68k/ods68302/bsp_specs
deleted file mode 100644
index 110e993dc5..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start302.o%s} \
-%{qrtems_debug: start302_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/clock/Makefile.in b/c/src/lib/libbsp/m68k/ods68302/clock/Makefile.in
deleted file mode 100644
index 59df4f2702..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/clock/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/ods68302/clock/ckinit.c b/c/src/lib/libbsp/m68k/ods68302/clock/ckinit.c
deleted file mode 100644
index d3c1d324f1..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/clock/ckinit.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/* Clock_init()
- *
- * This routine initializes Timer 1 for an MC68302.
- * The tick frequency is 1 millisecond.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdlib.h> /* for atexit() */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include "m68302.h"
-
-#define CLOCK_VECTOR 137
-
-#define TMR1_VAL ( RBIT_TMR_RST /* software reset the timer */\
- | RBIT_TMR_ICLK_MASTER16 /* master clock divided by 16 */\
- | RBIT_TMR_FRR /* restart timer after ref reached */\
- | RBIT_TMR_ORI) /* enable interrupt when ref reached */
-#define TRR1_VAL 1000 /* 1000 ticks @ 16MHz/16
- * = 1 millisecond tick.
- */
-
-/*
- * Clock_driver_ticks is a monotonically increasing counter of the
- * number of clock ticks since the driver was initialized.
- */
-volatile rtems_unsigned32 Clock_driver_ticks;
-
-/*
- * Clock_isrs is the number of clock ISRs until the next invocation of
- * the RTEMS clock tick routine. The clock tick device driver
- * gets an interrupt once a millisecond and counts down until the
- * length of time between the user configured microseconds per tick
- * has passed.
- */
-rtems_unsigned32 Clock_isrs;
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-/*
- * ISR Handler
- */
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
- Clock_driver_ticks += 1;
-
- m302.reg.isr = RBIT_ISR_TIMER1; /* clear in-service bit */
- m302.reg.ter1 = (RBIT_TER_REF | RBIT_TER_CAP); /* clear timer intr request */
-
- if ( Clock_isrs == 1 ) {
- rtems_clock_tick();
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
- }
- else
- Clock_isrs -= 1;
-}
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
-
- Clock_driver_ticks = 0;
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- set_vector( clock_isr, CLOCK_VECTOR, 1 );
-
- m302.reg.trr1 = TRR1_VAL; /* set timer reference register */
- m302.reg.tmr1 = TMR1_VAL; /* set timer mode register & enable */
- /*
- * Enable TIMER1 interrupts only.
- */
- m302.reg.imr = RBIT_IMR_TIMER1; /* set 68302 int-mask to allow ints */
-
- atexit( Clock_exit );
- }
-}
-
-void Clock_exit( void )
-{
- if ( BSP_Configuration.ticks_per_timeslice ) {
- /* TODO: figure out what to do here */
- /* do not restore old vector */
- }
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr( CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/console/Makefile.in b/c/src/lib/libbsp/m68k/ods68302/console/Makefile.in
deleted file mode 100644
index fd05ddfedd..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/ods68302/console/console.c b/c/src/lib/libbsp/m68k/ods68302/console/console.c
deleted file mode 100644
index 7fede9cf38..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/console/console.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Initialize the MC68302 SCC2 for console IO board support package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 GEN68302_INIT
-
-#include <debugport.h>
-#include <bsp.h>
-#include <rtems/libio.h>
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
-/* debug_port_initialise(); */
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-
-}
-
-/* is_character_ready
- *
- * Check to see if a character is available on the MC68302's SCC2. If so,
- * then return a TRUE (along with the character). Otherwise return FALSE.
- *
- * Input parameters: pointer to location in which to return character
- *
- * Output parameters: character (if available)
- *
- * Return values: TRUE - character available
- * FALSE - no character available
- */
-
-rtems_boolean is_character_ready(
- char *ch /* -> character */
-)
-{
- if (debug_port_status(0))
- {
- *ch = debug_port_in();
- return TRUE;
- }
- return FALSE;
-}
-
-
-/* inbyte
- *
- * Receive a character from the MC68302's SCC2.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: character read
- */
-
-char inbyte( void )
-{
- char ch;
-
- while (!is_character_ready(&ch));
-
- return ch;
-}
-
-
-/* outbyte
- *
- * Transmit a character out on the MC68302's SCC2.
- * It may support XON/XOFF flow control.
- *
- * Input parameters:
- * ch - character to be transmitted
- *
- * Output parameters: NONE
- */
-
-void outbyte(
- char ch
-)
-{
- debug_port_out(ch);
-}
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte();
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r');
- }
- outbyte( buffer[ count ] );
- }
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/m68k/ods68302/include/Makefile.in b/c/src/lib/libbsp/m68k/ods68302/include/Makefile.in
deleted file mode 100644
index 8184e09eab..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/include/Makefile.in
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bare.h $(srcdir)/bsp.h \
- $(srcdir)/coverhd.h $(srcdir)/crc.h \
- $(srcdir)/debugport.h \
- $(srcdir)/m68302scc.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/m68k/ods68302/include/bare.h b/c/src/lib/libbsp/m68k/ods68302/include/bare.h
deleted file mode 100644
index 7632b27ded..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/include/bare.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/*****************************************************************************/
-/*
- $Id$
-
- Card Definition for a bare board.
-
- This is an example file which actually builds a BSP for a 68302 card
- called an MVF (Multi-Voice-Frequency). The card is one of a range
- which run in a 100Mbit voice/video/data switch used for high end
- applications such as Air Traffic Control. The transport is
- FDDI-2. Yes it alive and well and working in real systems.
-
- Chip selects are programmed as required. Three are controlled in the
- boot code. They are RAM, ROM, and peripherals. You can optionally
- configure the other two chip selects.
-
- SYSTEM_CLOCK - You must defined this. It is used for setting the
- baud rate.
-
- CSEL_ROM, CSEL_RAM - Must be defined, and made to be a single number
- with brackets.
-
- ROM_WAIT_STATES, RAM_WAIT_STATES - Must be defined. This sets the
- speed for the ROM and RAM.
-
- ROM and RAM size is passed on the command line. The makefile holds
- them. This allows a single place to defined it. The makefile allows
- them to be passed to the linker.
-
- CSEL_1, CSEL_2 - If defined the other macros needed to define the
- chip select must be defined. If not defined they are not programmed
- and registers are left in the reset state.
-
- Card Specific Devices - The MVF card uses a chip select to address a
- range of peripherials (CSEL_2). These include front panel leds, and
- 4 digit diagnostic display device. Put what ever you need.
-
- LED_CONTROL - If defined the boot code will set leds as it goes.
-
- UPDATE_DISPLAY - A four digit display device will also be updated to
- show the boot state.
-
- CARD_PA, CARD_PB - The default configuration, data direction and
- data must be specified.
-
- This file allows a range of common parameters which vary from one
- variant of card to another to placed in a central file.
-
-*/
-/*****************************************************************************/
-
-#ifndef _BARE_H_
-#define _BARE_H_
-
-#if __cplusplus
-extern "C"
-{
-#endif
-
-/* name of the card */
-#define CARD_ID "m68302-odsbare"
-
-/* speed of the processor */
-#define SYSTEM_CLOCK (15360000)
-
-#define SCR_DEFAULT (RBIT_SCR_IPA | RBIT_SCR_HWT | RBIT_SCR_WPV | RBIT_SCR_ADC | \
- RBIT_SCR_HWDEN | RBIT_SCR_HWDCN1 | RBIT_SCR_EMWS)
-
-/* define the chip selects */
-#define CSEL_ROM 0 /* token pasted so no brackets */
-#define ROM_WAIT_STATES (OR_DTACK_1) /* 100nsec at 16MHz */
-#define CSEL_RAM 3
-#define RAM_WAIT_STATES (OR_DTACK_0) /* 70nsec at 16MHz */
-
-/* The remaining chip selects are called 1 and 2 */
-/*
-#define CSEL_1 1
-#define CSEL_1_BASE (0x00?00000)
-#define CSEL_1_SIZE (0x00?00000)
-#define CSEL_1_WAIT_STATES (OR_DTACK_1)
-*/
-#define CSEL_2 2
-#define CSEL_2_BASE (0x00800000)
-#define CSEL_2_SIZE (0x00040000)
-#define CSEL_2_WAIT_STATES (OR_DTACK_EXT)
-
-/*
- * Need to define a watchdog period
- */
-#define WATCHDOG_TIMEOUT_PERIOD (3000 * 2)
-
-/*
- * Console and debug port allocation, 0=SCC1, 2=SCC3
- */
-
-#define CONSOLE_PORT 1
-#define CONSOLE_BAUD SCC_9600
-#define DEBUG_PORT 2
-#define DEBUG_BAUD SCC_57600
-
-/* ----
- Parallel Port Configuration, and default data directions
-
- PORT BITS - NAME , WHO , DEFAULT WHAT
- ------------------------------------------------------------
- PPA:: 1: 0 - Serial , PERIPHERAL, -
- PPA:: 7: 2 - MVF_PPA:7:2 , IO , INPUTS
- PPA:: 9: 8 - Serial , PERIPHERAL, -
- PPA::15:10 - MVF_PPB:15:10 , IO , INPUTS
-
- PPB:: 1: 0 - Setup , IO , INPUTS
- PPB:: 3: 2 - SYNC_HIGHWAY_1:2 , IO , INPUTS
- - SYNC_HIGHWAY_2:3 , IO , INPUTS
- PPB:: 4: 4 - HARDWARE_RESET:4 , IO , OUTPUT
- PPB:: 6: 5 - SOFTWARE_OVERRIDE_1:6, IO , OUTPUT
- - SOFTWARE_OVERRIDE_2:5, IO , OUTPUT
- PPB:: 7: 7 - Watchdog , PERIPHERAL, -
- PPB::11: 8 - Interrupt , PERIPHERAL, -
- PPB::15:12 - Not implemented on the 68302
-
- 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
- ------------------------------------------------------
- PACNT 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 = 0x0303
- PBCNT - - - - - - - - 1 0 0 0 0 0 0 0 = 0x0080
-
- PADDR 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 = 0x0000
- PBDDR 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 = 0x0070
-
- PADAT 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 = 0x0000
-
- */
-#define CARD_PA_CONFIGURATION 0x0303
-#define CARD_PB_CONFIGURATION 0x0080
-
-#define CARD_PA_DEFAULT_DIRECTIONS 0x0000
-#define CARD_PB_DEFAULT_DIRECTIONS 0x0070
-
-#define CARD_PA_DEFAULT_DATA 0x0000
-#define CARD_PB_DEFAULT_DATA (HARDWARE_RESET_DISABLE | \
- SOFTWARE_OVERRIDE_1_DISABLE | \
- SOFTWARE_OVERRIDE_2_DISABLE)
-
-/* these are specific to the card and are not required */
-#define HARDWARE_RESET_ENABLE 0x0000
-#define HARDWARE_RESET_DISABLE 0x0010
-
-#define SOFTWARE_OVERRIDE_1_ENABLE 0x0000
-#define SOFTWARE_OVERRIDE_1_DISABLE 0x0040
-#define SOFTWARE_OVERRIDE_2_ENABLE 0x0000
-#define SOFTWARE_OVERRIDE_2_DISABLE 0x0020
-
-/*
- * Card Specific Devices, these are not required. Add what ever you
- * like here.
- */
-
-/* Write */
-#define WRITE_REGISTER_8(address, data) \
- *((rtems_unsigned8 *) (address)) = ((rtems_unsigned8) (data))
-#define WRITE_REGISTER_16(address, data) \
- *((rtems_unsigned16 *) (address)) = ((rtems_unsigned16) (data))
-#define WRITE_REGISTER_32(address, data) \
- *((rtems_unsigned32 *) (address)) = ((rtems_unsigned32) (data))
-/* Read */
-#define READ_REGISTER_8(address, data) data = *((rtems_unsigned8 *) (address))
-#define READ_REGISTER_16(address, data) data = *((rtems_unsigned16 *) (address))
-#define READ_REGISTER_32(address, data) data = *((rtems_unsigned32 *) (address))
-
-/* CS2 : Peripherials */
-#define PERIPHERIALS_BASE (CSEL_2_BASE)
-
-#define STATUS_REGISTER_BASE (PERIPHERIALS_BASE + 0x00000000)
-
-#define PERIPHERIALS_SIZE (0x00040000)
-
-#define LEDS_BASE (PERIPHERIALS_BASE + 0x00004000)
-#define MSC_BASE (PERIPHERIALS_BASE + 0x00008000)
-#define SPARE_1_BASE (PERIPHERIALS_BASE + 0x0000C000)
-#define DISPLAY_BASE (PERIPHERIALS_BASE + 0x00010000)
-#define PIO_INT_BASE (PERIPHERIALS_BASE + 0x00014000)
-#define UART_BASE (PERIPHERIALS_BASE + 0x00018000)
-#define PIA_BASE (PERIPHERIALS_BASE + 0x0001C000)
-
-#define LED_1 0x0002
-#define LED_1_GREEN 0xFFFD
-#define LED_1_RED 0xFFFF
-#define LED_1_OFF 0xFFFC
-
-#define LED_2 0x0001
-#define LED_2_GREEN 0xFFFE
-#define LED_2_RED 0xFFFF
-#define LED_2_OFF 0xFFFC
-
-#define LED_3 0x0000
-#define LED_3_GREEN 0xFFFC
-#define LED_3_RED 0xFFFC
-#define LED_3_OFF 0xFFFC
-
-#define LED_4 0x0000
-#define LED_4_GREEN 0xFFFC
-#define LED_4_RED 0xFFFC
-#define LED_4_OFF 0xFFFC
-
-#define LED_5 0x0000
-#define LED_5_GREEN 0xFFFC
-#define LED_5_RED 0xFFFC
-#define LED_5_OFF 0xFFFC
-
-#define LED_6 0x0000
-#define LED_6_GREEN 0xFFFC
-#define LED_6_RED 0xFFFC
-#define LED_6_OFF 0xFFFC
-
-#define LED_7 0x0000
-#define LED_7_GREEN 0xFFFC
-#define LED_7_RED 0xFFFC
-#define LED_7_OFF 0xFFFC
-
-#define LED_8 0x0000
-#define LED_8_GREEN 0xFFFC
-#define LED_8_RED 0xFFFC
-#define LED_8_OFF 0xFFFC
-
-#define MAKE_LED(L1, L2, L3, L4) ((L1 & LED_1) | (L2 & LED_2) | (L3 & LED_3) | (L4 & LED_4))
-
-#define LED_CONTROL(L1, L2, L3, L4, L5, L6, L7, L8) \
- WRITE_REGISTER_16(LEDS_BASE, MAKE_LED(L1, L2, L3, L4))
-
- /* update the display, needs a long word */
-#define UPDATE_DISPLAY(LongWordPtr) \
- ( WRITE_REGISTER_16(DISPLAY_BASE, *(((rtems_unsigned8 *) LongWordPtr) + 3)), \
- WRITE_REGISTER_16(DISPLAY_BASE + 2, *(((rtems_unsigned8 *) LongWordPtr) + 2)), \
- WRITE_REGISTER_16(DISPLAY_BASE + 4, *(((rtems_unsigned8 *) LongWordPtr) + 1)), \
- WRITE_REGISTER_16(DISPLAY_BASE + 6, *((rtems_unsigned8 *) LongWordPtr)) )
-
-/* make a better test, say switches */
-#if defined(GDB_MONITOR_ACTIVE)
-#define GDB_RUN_MONITOR() (1 == 1)
-#else
-#define GDB_RUN_MONITOR() (1 == 0)
-#endif
-
-#if __cplusplus
-}
-#endif
-#endif
diff --git a/c/src/lib/libbsp/m68k/ods68302/include/bsp.h b/c/src/lib/libbsp/m68k/ods68302/include/bsp.h
deleted file mode 100644
index 11b9f4cbd7..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/include/bsp.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/* bsp.h
- *
- * This include file contains all board IO definitions.
- *
- * XXX : put yours in here
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __GEN68302_BSP_h
-#define __GEN68302_BSP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <console.h>
-#include <iosupp.h>
-#include <clockdrv.h>
-#include <m68302.h>
-
-#if defined(VARIANT)
-
-#define __bsp_cat(x, y) x ## y
-#define __bsp_xcat(x, y) __bsp_cat(x, y)
-#define __bsp_str(s) #s
-#define __bsp_xstr(s) __bsp_str(s)
-
-#define __BSP_HEADER_FILE__ __bsp_xcat(VARIANT, .h)
-#define __BSP_HEADER_FILE_STR__ __bsp_xstr(__BSP_HEADER_FILE__)
-
-#include __BSP_HEADER_FILE_STR__
-#endif
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Stuff for Time Test 27
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), 0, 1 )
-
-#define Cause_tm27_intr()
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( microseconds ) \
- { register rtems_unsigned32 _delay=(microseconds); \
- register rtems_unsigned32 _tmp=123; \
- asm volatile( "0: \
- nbcd %0 ; \
- nbcd %0 ; \
- dbf %1,0b" \
- : "=d" (_tmp), "=d" (_delay) \
- : "0" (_tmp), "1" (_delay) ); \
- }
-
-/* Constants */
-
-#define RAM_START RAM_BASE
-#define RAM_END (RAM_BASE + RAM_SIZE)
-
-/* Structures */
-
-#ifdef GEN68302_INIT
-#undef EXTERN
-#define EXTERN
-#else
-#undef EXTERN
-#define EXTERN extern
-#endif
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-extern m68k_isr_entry M68Kvec[]; /* vector table address */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-m68k_isr_entry set_vector(
- rtems_isr_entry handler,
- rtems_vector_number vector,
- int type
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/ods68302/include/coverhd.h b/c/src/lib/libbsp/m68k/ods68302/include/coverhd.h
deleted file mode 100644
index 8614943c56..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/include/coverhd.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- * This file should be updated after running the C overhead timing
- * test. Once this update has been performed, the RTEMS Time Test
- * Suite should be rebuilt to account for these overhead times in the
- * timing results.
- *
- * NOTE: If these are all zero, then the times reported include all
- * all calling overhead including passing of arguments.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 14
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 11
-#define CALLING_OVERHEAD_TASK_CREATE 22
-#define CALLING_OVERHEAD_TASK_IDENT 17
-#define CALLING_OVERHEAD_TASK_START 18
-#define CALLING_OVERHEAD_TASK_RESTART 15
-#define CALLING_OVERHEAD_TASK_DELETE 12
-#define CALLING_OVERHEAD_TASK_SUSPEND 12
-#define CALLING_OVERHEAD_TASK_RESUME 12
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 16
-#define CALLING_OVERHEAD_TASK_MODE 15
-#define CALLING_OVERHEAD_TASK_GET_NOTE 16
-#define CALLING_OVERHEAD_TASK_SET_NOTE 16
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 31
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 11
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 17
-#define CALLING_OVERHEAD_CLOCK_GET 32
-#define CALLING_OVERHEAD_CLOCK_SET 31
-#define CALLING_OVERHEAD_CLOCK_TICK 8
-
-#define CALLING_OVERHEAD_TIMER_CREATE 13
-#define CALLING_OVERHEAD_TIMER_IDENT 12
-#define CALLING_OVERHEAD_TIMER_DELETE 14
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 19
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 39
-#define CALLING_OVERHEAD_TIMER_RESET 12
-#define CALLING_OVERHEAD_TIMER_CANCEL 12
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 18
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 12
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 17
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 17
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 12
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 18
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 17
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 12
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 14
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 14
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 17
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 19
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 14
-
-#define CALLING_OVERHEAD_EVENT_SEND 15
-#define CALLING_OVERHEAD_EVENT_RECEIVE 18
-#define CALLING_OVERHEAD_SIGNAL_CATCH 14
-#define CALLING_OVERHEAD_SIGNAL_SEND 14
-#define CALLING_OVERHEAD_PARTITION_CREATE 23
-#define CALLING_OVERHEAD_PARTITION_IDENT 17
-#define CALLING_OVERHEAD_PARTITION_DELETE 12
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 15
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 15
-#define CALLING_OVERHEAD_REGION_CREATE 23
-#define CALLING_OVERHEAD_REGION_IDENT 14
-#define CALLING_OVERHEAD_REGION_DELETE 12
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 21
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 15
-#define CALLING_OVERHEAD_PORT_CREATE 20
-#define CALLING_OVERHEAD_PORT_IDENT 14
-#define CALLING_OVERHEAD_PORT_DELETE 12
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 18
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 18
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 18
-#define CALLING_OVERHEAD_IO_OPEN 18
-#define CALLING_OVERHEAD_IO_CLOSE 18
-#define CALLING_OVERHEAD_IO_READ 18
-#define CALLING_OVERHEAD_IO_WRITE 18
-#define CALLING_OVERHEAD_IO_CONTROL 18
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 11
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 13
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 14
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 12
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 12
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 14
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 8
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/m68k/ods68302/include/crc.h b/c/src/lib/libbsp/m68k/ods68302/include/crc.h
deleted file mode 100644
index 6d307599f0..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/include/crc.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*****************************************************************************/
-/*
- $Id$
-
- CRC 16 Calculate Interface
-
-*/
-/*****************************************************************************/
-
-#ifndef _CRC_H_
-#define _CRC_H_
-
- /* ----
- F U N C T I O N S
- */
-#if __cplusplus
-extern "C"
-{
-#endif
-
-rtems_unsigned16 calc_crc(void *data, rtems_unsigned32 count);
-
-#if __cplusplus
-}
-#endif
-#endif
diff --git a/c/src/lib/libbsp/m68k/ods68302/include/debugport.h b/c/src/lib/libbsp/m68k/ods68302/include/debugport.h
deleted file mode 100644
index a54756e514..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/include/debugport.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*****************************************************************************/
-/*
- $Id$
-
- Debug Port Support
-
-*/
-/*****************************************************************************/
-
-#if !defined(_DEBUGPORT_H_)
- #define _DEBUGPORT_H_
-
-#if __cplusplus
-extern "C"
-{
-#endif
-
- /* normall automatic, only need when re-initialising */
- void debug_port_initialise(void);
-
- unsigned char debug_port_status(const unsigned char status);
- unsigned char debug_port_in(void);
- void debug_port_out(const unsigned char character);
-
- void debug_port_write(const char *buffer);
- void debug_port_write_buffer(const char *buffer, unsigned int size);
-
- void debug_port_write_hex_uint(const unsigned int value);
- void debug_port_write_hex_ulong(const unsigned long value);
-
- /*
- * special banner message for CPU specific boot code,
- * initialises the debug port
- */
- void debug_port_banner(void);
- void debug_port_printf(const char *format, ...);
-
-#if __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/lib/libbsp/m68k/ods68302/include/m68302scc.h b/c/src/lib/libbsp/m68k/ods68302/include/m68302scc.h
deleted file mode 100644
index d6eb37ccda..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/include/m68302scc.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*****************************************************************************/
-/*
- $Id$
-
- M68302 Scc Polled Uart Support
-
- */
-/*****************************************************************************/
-
-#if !defined(_M68302SCC_H_)
-#define _M68302SCC_H_
-
-#if __cplusplus
-extern "C"
-{
-#endif
-
-#define SCC_4800 (0)
-#define SCC_9600 (1)
-#define SCC_19200 (2)
-#define SCC_38400 (3)
-#define SCC_57600 (4)
-#define SCC_115700 (5)
-
-void scc_initialise(int channel, int baud_rate, int lf_translate);
-unsigned char scc_status(int channel, const unsigned char status);
-unsigned char scc_in(int channel);
-void scc_out(int channel, const unsigned char character);
-
-#if __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/lib/libbsp/m68k/ods68302/start/Makefile.in b/c/src/lib/libbsp/m68k/ods68302/start/Makefile.in
deleted file mode 100644
index a6d3ba2c08..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/start/Makefile.in
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/start302.o
-
-ifeq ($(RTEMS_DEBUGGER),yes)
-RESET_SRC = debugreset
-else
-RESET_SRC = reset
-CFLAGS += -DGDB_MONITOR_ACTIVE
-endif
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=cpuboot
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=$(RESET_SRC)
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(S_O_FILES) $(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/start/cpuboot.c b/c/src/lib/libbsp/m68k/ods68302/start/cpuboot.c
deleted file mode 100644
index fd8a4146de..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/start/cpuboot.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*****************************************************************************/
-/*
- Boot the CPU.
-
- Occurs in 3 phases for a 68302.
-
- Phase 1.
-
- Called as soon as able after reset. The BAR has been programed, and
- a small stack exists in the DPRAM. All interrupts are masked, and
- the processor is running in supervisor mode. No other hardware or
- chip selects are active.
-
- This phase programs the chip select registers, the parallel ports
- are set into default configurations, and basic registers cleared or
- reset. The leds are programmed to show the end of phase 1.
-
- Phase 2.
-
- This is a piece of code which is copied to DPRAM and executed. It
- should not do any more thann is currently present. The return to ROM
- is managed by modifing the return address. Again leds show the status.
-
- Phase 3.
-
- This code executes with a valid C environment. That is the data
- section has been intialised and the bss section set to 0. This phase
- performs any special card initialisation and then calls boot card.
-
- $Id$
-
-*/
-/*****************************************************************************/
-
-#include <bsp.h>
-#include <m68302.h>
-#include <debugport.h>
-#include <crc.h>
-
-/*
- Open the address, reset all registers
- */
-
-void boot_phase_1()
-{
- M302_SCR = SCR_DEFAULT;
-
- WRITE_OR(CSEL_ROM, ROM_SIZE, ROM_WAIT_STATES, OR_MASK_RW, OR_MASK_FC);
- WRITE_BR(CSEL_ROM, RAM_BASE, BR_READ_ONLY, BR_FC_NULL, BR_ENABLED);
- WRITE_OR(CSEL_RAM, RAM_SIZE, RAM_WAIT_STATES, OR_MASK_RW, OR_MASK_FC);
- WRITE_BR(CSEL_RAM, ROM_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
-
-#if defined(CSEL_1)
- WRITE_OR(CSEL_1, CSEL_1_SIZE, CSEL_1_WAIT_STATES, OR_MASK_RW, OR_MASK_FC);
- WRITE_BR(CSEL_1, CSEL_1_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
-#endif
-
-#if defined(CSEL_2)
- WRITE_OR(CSEL_2, CSEL_2_SIZE, CSEL_2_WAIT_STATES, OR_MASK_RW, OR_MASK_FC);
- WRITE_BR(CSEL_2, CSEL_2_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
-#endif
-
- m302.reg.gimr = m302.reg.ipr = m302.reg.imr = m302.reg.isr = 0;
-
- m302.reg.simode = 0;
-
- m302.reg.pacnt = CARD_PA_CONFIGURATION;
- m302.reg.paddr = CARD_PA_DEFAULT_DIRECTIONS;
- m302.reg.padat = CARD_PA_DEFAULT_DATA;
-
- m302.reg.pbcnt = CARD_PB_CONFIGURATION;
- m302.reg.pbddr = CARD_PB_DEFAULT_DIRECTIONS;
- m302.reg.pbdat = CARD_PB_DEFAULT_DATA;
-
- m302.reg.wrr = WATCHDOG_TIMEOUT_PERIOD | WATCHDOG_ENABLE;
-
-#if defined(LED_CONTROL)
- LED_CONTROL(LED_1_RED, LED_2_OFF, LED_3_OFF, LED_4_OFF,
- LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF);
-#endif
-}
-
-/*
- Swap the chip select mapping for ROM and RAM
- */
-
-void boot_phase_2(void)
-{
- rtems_unsigned32 stack;
-
-#if defined(LED_CONTROL)
- LED_CONTROL(LED_1_RED, LED_2_RED, LED_3_OFF, LED_4_OFF,
- LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF);
-#endif
-
- WRITE_BR(CSEL_ROM, ROM_BASE, BR_READ_ONLY, BR_FC_NULL, BR_ENABLED);
- WRITE_BR(CSEL_RAM, RAM_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
-
-#if defined(LED_CONTROL)
- LED_CONTROL(LED_1_GREEN, LED_2_RED, LED_3_OFF, LED_4_OFF,
- LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF);
-#endif
-
- /* seems to want 2, looked at assember code output */
- *(&stack + 2) |= ROM_BASE;
-}
-
-/*
- Any pre-main initialisation, the C environment is setup, how-ever C++
- static constructors have not been called, and RTEMS is not initialised.
- */
-
-void boot_card();
-void set_debug_traps();
-void breakpoint();
-
-void boot_phase_3(void)
-{
- if (GDB_RUN_MONITOR())
- {
- set_debug_traps();
- breakpoint();
- }
-
- debug_port_banner();
-
- /* FIXME : add RAM and ROM checks */
-
- /* boot the bsp, what ever this means */
- boot_card();
-
- WATCHDOG_TRIGGER();
-}
diff --git a/c/src/lib/libbsp/m68k/ods68302/start/debugreset.S b/c/src/lib/libbsp/m68k/ods68302/start/debugreset.S
deleted file mode 100644
index 74049191c4..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/start/debugreset.S
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * $Id$
- *
- * Re-written the gen68302 start-up code.
- *
- * Uses gas syntax only, removed the OAR asm.h.
- *
- * Supplies a complete vector table in ROM.
- *
- * Manages all vectors with seperate handlers to trap unhandled
- * execptions.
- *
- * Uses the target specific header file to get the runtime
- * configuration
- *
- * COPYRIGHT (c) 1996
- * Objective Design Systems Pty Ltd (ODS)
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * This material may be reproduced by or for the U.S. Government pursuant
- * to the copyright license under the clause at DFARS 252.227-7013. This
- * notice must appear in all copies of this file and its derivatives.
- *
- */
-
-|
-| Entry from debugger
-|
- .sect .text
-
-|
-| Start
-|
-| Entered from a hardware reset.
-|
-
- .global start | Default entry point for GNU
-start:
-
- move.w #0x2700,%sr | Disable all interrupts
-
- |
- | zero out uninitialized data area
- |
-
-zerobss:
- moveal #end,%a0 | find end of .bss
- moveal #bss_start,%a1 | find beginning of .bss
- moveq #0,%d0
-
-zerobss_loop:
-
- movel %d0,%a1@+ | to zero out uninitialized
- cmpal %a0,%a1
- jlt zerobss_loop | loop until _end reached
-
- movel #end,%d0 | d0 = end of bss/start of heap
- addl #heap_size,%d0 | d0 = end of heap
-
- movel %d0,stack_start | Save for brk() routine
- addl #stack_size,%d0 | make room for stack
- andl #0xffffffc0,%d0 | align it on 16 byte boundary
-
- movw #0x3700,%sr | SUPV MODE,INTERRUPTS OFF!!!
- movel %d0,%a7 | set master stack pointer
- movel %d0,%a6 | set base pointer
-
- jsr boot_phase_3
-
-|
-| Initialised data
-|
-
- .sect .data
-
- .global start_frame
-
-start_frame:
- .space 4,0
-
- .global stack_start
-
-stack_start:
- .space 4,0
-
-|
-| Uninitialised data
-|
-
- .sect .bss
-
- .global environ
- .align 2
-
-environ:
- .long 0
-
- .global heap_size
- .set heap_size,0x2000
-
- .global stack_size
- .set stack_size,0x1000
-
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/start/reset.S b/c/src/lib/libbsp/m68k/ods68302/start/reset.S
deleted file mode 100644
index 71d1071243..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/start/reset.S
+++ /dev/null
@@ -1,881 +0,0 @@
-/*
- * $Id$
- *
- * Re-written the gen68302 start-up code.
- *
- * Uses gas syntax only, removed the OAR asm.h.
- *
- * Supplies a complete vector table in ROM.
- *
- * Manages all vectors with seperate handlers to trap unhandled
- * execptions.
- *
- * Uses the target specific header file to get the runtime
- * configuration
- *
- * COPYRIGHT (c) 1996
- * Objective Design Systems Pty Ltd (ODS)
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * This material may be reproduced by or for the U.S. Government pursuant
- * to the copyright license under the clause at DFARS 252.227-7013. This
- * notice must appear in all copies of this file and its derivatives.
- *
- */
-
-|
-| some basic defined, this is that is required
-|
-#define MC68302_BAR 0x000000F2
-#define MC68302_BAR_FC_CFC 0x0000
-#define MC68302_SYS_RAM_SIZE 0x240
-
-|
-| Boot boot code in a special section, ld postions
-|
-| Initial stack pointer is in the dual ported RAM
-|
- .sect .text
-
- .global M68Kvec | Vector Table
-
-M68Kvec: | standard location for vectors
-
-|
-| Make relative, can have the code positioned any where
-|
-
-V___ISSP: .long MC68302_BASE + MC68302_SYS_RAM_SIZE
-V____IPC: .long start - V___ISSP
-
-|
-| Create the rest of the vector table to point to the unhandled expection
-| handler
-|
-| Lots of macros, how-ever it creates a simple ROM vector table
-|
-
-exception_handler = unhandled_exception - V___ISSP
-#define MAKE_EXCEPTION_VECTOR(n) V___##n: .long (exception_handler + (n * 8))
-
-MAKE_EXCEPTION_VECTOR(2)
-MAKE_EXCEPTION_VECTOR(3)
-MAKE_EXCEPTION_VECTOR(4)
-MAKE_EXCEPTION_VECTOR(5)
-MAKE_EXCEPTION_VECTOR(6)
-MAKE_EXCEPTION_VECTOR(7)
-MAKE_EXCEPTION_VECTOR(8)
-MAKE_EXCEPTION_VECTOR(9)
-
-MAKE_EXCEPTION_VECTOR(10)
-MAKE_EXCEPTION_VECTOR(11)
-MAKE_EXCEPTION_VECTOR(12)
-MAKE_EXCEPTION_VECTOR(13)
-MAKE_EXCEPTION_VECTOR(14)
-MAKE_EXCEPTION_VECTOR(15)
-MAKE_EXCEPTION_VECTOR(16)
-MAKE_EXCEPTION_VECTOR(17)
-MAKE_EXCEPTION_VECTOR(18)
-MAKE_EXCEPTION_VECTOR(19)
-
-MAKE_EXCEPTION_VECTOR(20)
-MAKE_EXCEPTION_VECTOR(21)
-MAKE_EXCEPTION_VECTOR(22)
-MAKE_EXCEPTION_VECTOR(23)
-MAKE_EXCEPTION_VECTOR(24)
-MAKE_EXCEPTION_VECTOR(25)
-MAKE_EXCEPTION_VECTOR(26)
-MAKE_EXCEPTION_VECTOR(27)
-MAKE_EXCEPTION_VECTOR(28)
-MAKE_EXCEPTION_VECTOR(29)
-
-MAKE_EXCEPTION_VECTOR(30)
-MAKE_EXCEPTION_VECTOR(31)
-MAKE_EXCEPTION_VECTOR(32)
-MAKE_EXCEPTION_VECTOR(33)
-MAKE_EXCEPTION_VECTOR(34)
-MAKE_EXCEPTION_VECTOR(35)
-MAKE_EXCEPTION_VECTOR(36)
-MAKE_EXCEPTION_VECTOR(37)
-MAKE_EXCEPTION_VECTOR(38)
-MAKE_EXCEPTION_VECTOR(39)
-
-MAKE_EXCEPTION_VECTOR(40)
-MAKE_EXCEPTION_VECTOR(41)
-MAKE_EXCEPTION_VECTOR(42)
-MAKE_EXCEPTION_VECTOR(43)
-MAKE_EXCEPTION_VECTOR(44)
-MAKE_EXCEPTION_VECTOR(45)
-MAKE_EXCEPTION_VECTOR(46)
-MAKE_EXCEPTION_VECTOR(47)
-MAKE_EXCEPTION_VECTOR(48)
-MAKE_EXCEPTION_VECTOR(49)
-
-MAKE_EXCEPTION_VECTOR(50)
-MAKE_EXCEPTION_VECTOR(51)
-MAKE_EXCEPTION_VECTOR(52)
-MAKE_EXCEPTION_VECTOR(53)
-MAKE_EXCEPTION_VECTOR(54)
-MAKE_EXCEPTION_VECTOR(55)
-MAKE_EXCEPTION_VECTOR(56)
-MAKE_EXCEPTION_VECTOR(57)
-MAKE_EXCEPTION_VECTOR(58)
-MAKE_EXCEPTION_VECTOR(59)
-
-MAKE_EXCEPTION_VECTOR(60)
-MAKE_EXCEPTION_VECTOR(61)
-MAKE_EXCEPTION_VECTOR(62)
-MAKE_EXCEPTION_VECTOR(63)
-MAKE_EXCEPTION_VECTOR(64)
-MAKE_EXCEPTION_VECTOR(65)
-MAKE_EXCEPTION_VECTOR(66)
-MAKE_EXCEPTION_VECTOR(67)
-MAKE_EXCEPTION_VECTOR(68)
-MAKE_EXCEPTION_VECTOR(69)
-
-MAKE_EXCEPTION_VECTOR(70)
-MAKE_EXCEPTION_VECTOR(71)
-MAKE_EXCEPTION_VECTOR(72)
-MAKE_EXCEPTION_VECTOR(73)
-MAKE_EXCEPTION_VECTOR(74)
-MAKE_EXCEPTION_VECTOR(75)
-MAKE_EXCEPTION_VECTOR(76)
-MAKE_EXCEPTION_VECTOR(77)
-MAKE_EXCEPTION_VECTOR(78)
-MAKE_EXCEPTION_VECTOR(79)
-
-MAKE_EXCEPTION_VECTOR(80)
-MAKE_EXCEPTION_VECTOR(81)
-MAKE_EXCEPTION_VECTOR(82)
-MAKE_EXCEPTION_VECTOR(83)
-MAKE_EXCEPTION_VECTOR(84)
-MAKE_EXCEPTION_VECTOR(85)
-MAKE_EXCEPTION_VECTOR(86)
-MAKE_EXCEPTION_VECTOR(87)
-MAKE_EXCEPTION_VECTOR(88)
-MAKE_EXCEPTION_VECTOR(89)
-
-MAKE_EXCEPTION_VECTOR(90)
-MAKE_EXCEPTION_VECTOR(91)
-MAKE_EXCEPTION_VECTOR(92)
-MAKE_EXCEPTION_VECTOR(93)
-MAKE_EXCEPTION_VECTOR(94)
-MAKE_EXCEPTION_VECTOR(95)
-MAKE_EXCEPTION_VECTOR(96)
-MAKE_EXCEPTION_VECTOR(97)
-MAKE_EXCEPTION_VECTOR(98)
-MAKE_EXCEPTION_VECTOR(99)
-
-MAKE_EXCEPTION_VECTOR(100)
-MAKE_EXCEPTION_VECTOR(101)
-MAKE_EXCEPTION_VECTOR(102)
-MAKE_EXCEPTION_VECTOR(103)
-MAKE_EXCEPTION_VECTOR(104)
-MAKE_EXCEPTION_VECTOR(105)
-MAKE_EXCEPTION_VECTOR(106)
-MAKE_EXCEPTION_VECTOR(107)
-MAKE_EXCEPTION_VECTOR(108)
-MAKE_EXCEPTION_VECTOR(109)
-
-MAKE_EXCEPTION_VECTOR(110)
-MAKE_EXCEPTION_VECTOR(111)
-MAKE_EXCEPTION_VECTOR(112)
-MAKE_EXCEPTION_VECTOR(113)
-MAKE_EXCEPTION_VECTOR(114)
-MAKE_EXCEPTION_VECTOR(115)
-MAKE_EXCEPTION_VECTOR(116)
-MAKE_EXCEPTION_VECTOR(117)
-MAKE_EXCEPTION_VECTOR(118)
-MAKE_EXCEPTION_VECTOR(119)
-
-MAKE_EXCEPTION_VECTOR(120)
-MAKE_EXCEPTION_VECTOR(121)
-MAKE_EXCEPTION_VECTOR(122)
-MAKE_EXCEPTION_VECTOR(123)
-MAKE_EXCEPTION_VECTOR(124)
-MAKE_EXCEPTION_VECTOR(125)
-MAKE_EXCEPTION_VECTOR(126)
-MAKE_EXCEPTION_VECTOR(127)
-MAKE_EXCEPTION_VECTOR(128)
-MAKE_EXCEPTION_VECTOR(129)
-
-MAKE_EXCEPTION_VECTOR(130)
-MAKE_EXCEPTION_VECTOR(131)
-MAKE_EXCEPTION_VECTOR(132)
-MAKE_EXCEPTION_VECTOR(133)
-MAKE_EXCEPTION_VECTOR(134)
-MAKE_EXCEPTION_VECTOR(135)
-MAKE_EXCEPTION_VECTOR(136)
-MAKE_EXCEPTION_VECTOR(137)
-MAKE_EXCEPTION_VECTOR(138)
-MAKE_EXCEPTION_VECTOR(139)
-
-MAKE_EXCEPTION_VECTOR(140)
-MAKE_EXCEPTION_VECTOR(141)
-MAKE_EXCEPTION_VECTOR(142)
-MAKE_EXCEPTION_VECTOR(143)
-MAKE_EXCEPTION_VECTOR(144)
-MAKE_EXCEPTION_VECTOR(145)
-MAKE_EXCEPTION_VECTOR(146)
-MAKE_EXCEPTION_VECTOR(147)
-MAKE_EXCEPTION_VECTOR(148)
-MAKE_EXCEPTION_VECTOR(149)
-
-MAKE_EXCEPTION_VECTOR(150)
-MAKE_EXCEPTION_VECTOR(151)
-MAKE_EXCEPTION_VECTOR(152)
-MAKE_EXCEPTION_VECTOR(153)
-MAKE_EXCEPTION_VECTOR(154)
-MAKE_EXCEPTION_VECTOR(155)
-MAKE_EXCEPTION_VECTOR(156)
-MAKE_EXCEPTION_VECTOR(157)
-MAKE_EXCEPTION_VECTOR(158)
-MAKE_EXCEPTION_VECTOR(159)
-
-MAKE_EXCEPTION_VECTOR(160)
-MAKE_EXCEPTION_VECTOR(161)
-MAKE_EXCEPTION_VECTOR(162)
-MAKE_EXCEPTION_VECTOR(163)
-MAKE_EXCEPTION_VECTOR(164)
-MAKE_EXCEPTION_VECTOR(165)
-MAKE_EXCEPTION_VECTOR(166)
-MAKE_EXCEPTION_VECTOR(167)
-MAKE_EXCEPTION_VECTOR(168)
-MAKE_EXCEPTION_VECTOR(169)
-
-MAKE_EXCEPTION_VECTOR(170)
-MAKE_EXCEPTION_VECTOR(171)
-MAKE_EXCEPTION_VECTOR(172)
-MAKE_EXCEPTION_VECTOR(173)
-MAKE_EXCEPTION_VECTOR(174)
-MAKE_EXCEPTION_VECTOR(175)
-MAKE_EXCEPTION_VECTOR(176)
-MAKE_EXCEPTION_VECTOR(177)
-MAKE_EXCEPTION_VECTOR(178)
-MAKE_EXCEPTION_VECTOR(179)
-
-MAKE_EXCEPTION_VECTOR(180)
-MAKE_EXCEPTION_VECTOR(181)
-MAKE_EXCEPTION_VECTOR(182)
-MAKE_EXCEPTION_VECTOR(183)
-MAKE_EXCEPTION_VECTOR(184)
-MAKE_EXCEPTION_VECTOR(185)
-MAKE_EXCEPTION_VECTOR(186)
-MAKE_EXCEPTION_VECTOR(187)
-MAKE_EXCEPTION_VECTOR(188)
-MAKE_EXCEPTION_VECTOR(189)
-
-MAKE_EXCEPTION_VECTOR(190)
-MAKE_EXCEPTION_VECTOR(191)
-MAKE_EXCEPTION_VECTOR(192)
-MAKE_EXCEPTION_VECTOR(193)
-MAKE_EXCEPTION_VECTOR(194)
-MAKE_EXCEPTION_VECTOR(195)
-MAKE_EXCEPTION_VECTOR(196)
-MAKE_EXCEPTION_VECTOR(197)
-MAKE_EXCEPTION_VECTOR(198)
-MAKE_EXCEPTION_VECTOR(199)
-
-MAKE_EXCEPTION_VECTOR(200)
-MAKE_EXCEPTION_VECTOR(201)
-MAKE_EXCEPTION_VECTOR(202)
-MAKE_EXCEPTION_VECTOR(203)
-MAKE_EXCEPTION_VECTOR(204)
-MAKE_EXCEPTION_VECTOR(205)
-MAKE_EXCEPTION_VECTOR(206)
-MAKE_EXCEPTION_VECTOR(207)
-MAKE_EXCEPTION_VECTOR(208)
-MAKE_EXCEPTION_VECTOR(209)
-
-MAKE_EXCEPTION_VECTOR(210)
-MAKE_EXCEPTION_VECTOR(211)
-MAKE_EXCEPTION_VECTOR(212)
-MAKE_EXCEPTION_VECTOR(213)
-MAKE_EXCEPTION_VECTOR(214)
-MAKE_EXCEPTION_VECTOR(215)
-MAKE_EXCEPTION_VECTOR(216)
-MAKE_EXCEPTION_VECTOR(217)
-MAKE_EXCEPTION_VECTOR(218)
-MAKE_EXCEPTION_VECTOR(219)
-
-MAKE_EXCEPTION_VECTOR(220)
-MAKE_EXCEPTION_VECTOR(221)
-MAKE_EXCEPTION_VECTOR(222)
-MAKE_EXCEPTION_VECTOR(223)
-MAKE_EXCEPTION_VECTOR(224)
-MAKE_EXCEPTION_VECTOR(225)
-MAKE_EXCEPTION_VECTOR(226)
-MAKE_EXCEPTION_VECTOR(227)
-MAKE_EXCEPTION_VECTOR(228)
-MAKE_EXCEPTION_VECTOR(229)
-
-MAKE_EXCEPTION_VECTOR(230)
-MAKE_EXCEPTION_VECTOR(231)
-MAKE_EXCEPTION_VECTOR(232)
-MAKE_EXCEPTION_VECTOR(233)
-MAKE_EXCEPTION_VECTOR(234)
-MAKE_EXCEPTION_VECTOR(235)
-MAKE_EXCEPTION_VECTOR(236)
-MAKE_EXCEPTION_VECTOR(237)
-MAKE_EXCEPTION_VECTOR(238)
-MAKE_EXCEPTION_VECTOR(239)
-
-MAKE_EXCEPTION_VECTOR(240)
-MAKE_EXCEPTION_VECTOR(241)
-MAKE_EXCEPTION_VECTOR(242)
-MAKE_EXCEPTION_VECTOR(243)
-MAKE_EXCEPTION_VECTOR(244)
-MAKE_EXCEPTION_VECTOR(245)
-MAKE_EXCEPTION_VECTOR(246)
-MAKE_EXCEPTION_VECTOR(247)
-MAKE_EXCEPTION_VECTOR(248)
-MAKE_EXCEPTION_VECTOR(249)
-
-MAKE_EXCEPTION_VECTOR(250)
-MAKE_EXCEPTION_VECTOR(251)
-MAKE_EXCEPTION_VECTOR(252)
-MAKE_EXCEPTION_VECTOR(253)
-MAKE_EXCEPTION_VECTOR(254)
-MAKE_EXCEPTION_VECTOR(255)
-
-|
-| Start
-|
-| Entered from a hardware reset.
-|
-
- .global start | Default entry point for GNU
-start:
-
- move.w #0x2700,%sr | Disable all interrupts
-
- |
- | Program the BAR, give us a stack !!
- |
-
- moveq #0,%d0
- move.w #(MC68302_BASE >> 12),%d0
- or.w #(MC68302_BAR_FC_CFC << 12),%d0
- move.l #MC68302_BAR,%a0
- move.w %d0,%a0@(0)
-
- |
- | watch for sign extended maths with the linker on (boot_phase_1-V___ISSP)
- | manage the address with code, limited address of 2K at reset for CS0
- |
-
- move.l #boot_phase_1,%d0
- and.l #0x1FFF,%d0
- move.l %d0,%a0
- jsr %a0@(0) | programs all basic 302 registers
-
- |
- | Map to the 68302 registers
- |
-
- move.l #MC68302_BASE,%a5
-
- |
- | Make a vector table in RAM
- |
-
- move.l #RAM_BASE,%a0 | a0 -> rom vector table
- moveal #ROM_BASE,%a1 | d1 -> start of tmp SRAM
-
- move.l #255,%d0
-
-copy_vec_table:
-
- move.l (%a0)+,%d1
- or.l #ROM_BASE,%d1
- move.l %d1,(%a1)+
- subq.l #1,%d0
- bne copy_vec_table
-
-#if defined(SYSTEM_TABLE_ANCHOR_OFFSET)
- |
- | Clear the system table
- |
-
- move.l #SYSTEM_TABLE_ANCHOR_OFFSET,%a0
- move.l #0,(%a0)
-#endif
-
- |
- | Copy the chip select swap code to DPRAM and run it
- |
-
- move.l #boot_phase_2,%d0
- and.l #(ROM_SIZE - 1),%d0
- move.l %d0,%a0 | a0 -> remap code
- lea %a5@(0),%a1 | a1 -> internal system RAM
-
- move.l #boot_phase_3,%d0
- and.l #(ROM_SIZE - 1),%d0
- sub.l %a0,%d0
-
-copy_remap:
- move.b (%a0)+,(%a1)+ | copy
- dbra %d0,copy_remap
-
- |
- | Jump to the remap code in the 68302''s internal system RAM.
- |
-
- jsr %a5@(0) | execute the swap code
-
- |
- | Map to the 68302 registers
- |
-
- move.l #MC68302_BASE,%a5
-
- |
- | Copy initialized data area from ROM to RAM
- |
-
-copy_data:
- moveal #etext,%a0 | find the end of .text
- moveal #data_start,%a1 | find the beginning of .data
- moveal #edata,%a2 | find the end of .data
-
-copy_data_loop:
-
- movel %a0@+,%a1@+ | copy the data
- cmpal %a2,%a1
- jlt copy_data_loop | loop until edata reached
-
- |
- | zero out uninitialized data area
- |
-
-zerobss:
- moveal #end,%a0 | find end of .bss
- moveal #bss_start,%a1 | find beginning of .bss
- moveq #0,%d0
-
-zerobss_loop:
-
- movel %d0,%a1@+ | to zero out uninitialized
- cmpal %a0,%a1
- jlt zerobss_loop | loop until _end reached
-
- movel #end,%d0 | d0 = end of bss/start of heap
- addl #heap_size,%d0 | d0 = end of heap
-
- movel %d0,stack_start | Save for brk() routine
- addl #stack_size,%d0 | make room for stack
- andl #0xffffffc0,%d0 | align it on 16 byte boundary
-
- movw #0x3700,%sr | SUPV MODE,INTERRUPTS OFF!!!
- movel %d0,%a7 | set master stack pointer
- movel %d0,%a6 | set base pointer
-
- jsr boot_phase_3
-
-|
-| Create an unhandled exception jump table. The table has an entry for
-| each vector in the vector table. The entry pushes the vector number onto
-| the stack and then calls a common exception handler using PIC.
-|
-| The macros are to create the labels and format vectors.
-|
-
-#define cat(x, y) x ## y
-#define FORMAT_ID(n) (n << 2)
-#define EXCEPTION_HANDLER(h, n) EH__##n: move.w cat(h, FORMAT_ID(n)),-(%sp) ; \
- bra common_exception_handler
-
-unhandled_exception:
-
-EXCEPTION_HANDLER(#, 0)
-EXCEPTION_HANDLER(#, 1)
-EXCEPTION_HANDLER(#, 2)
-EXCEPTION_HANDLER(#, 3)
-EXCEPTION_HANDLER(#, 4)
-EXCEPTION_HANDLER(#, 5)
-EXCEPTION_HANDLER(#, 6)
-EXCEPTION_HANDLER(#, 7)
-EXCEPTION_HANDLER(#, 8)
-EXCEPTION_HANDLER(#, 9)
-
-EXCEPTION_HANDLER(#, 10)
-EXCEPTION_HANDLER(#, 11)
-EXCEPTION_HANDLER(#, 12)
-EXCEPTION_HANDLER(#, 13)
-EXCEPTION_HANDLER(#, 14)
-EXCEPTION_HANDLER(#, 15)
-EXCEPTION_HANDLER(#, 16)
-EXCEPTION_HANDLER(#, 17)
-EXCEPTION_HANDLER(#, 18)
-EXCEPTION_HANDLER(#, 19)
-
-EXCEPTION_HANDLER(#, 20)
-EXCEPTION_HANDLER(#, 21)
-EXCEPTION_HANDLER(#, 22)
-EXCEPTION_HANDLER(#, 23)
-EXCEPTION_HANDLER(#, 24)
-EXCEPTION_HANDLER(#, 25)
-EXCEPTION_HANDLER(#, 26)
-EXCEPTION_HANDLER(#, 27)
-EXCEPTION_HANDLER(#, 28)
-EXCEPTION_HANDLER(#, 29)
-
-EXCEPTION_HANDLER(#, 30)
-EXCEPTION_HANDLER(#, 31)
-EXCEPTION_HANDLER(#, 32)
-EXCEPTION_HANDLER(#, 33)
-EXCEPTION_HANDLER(#, 34)
-EXCEPTION_HANDLER(#, 35)
-EXCEPTION_HANDLER(#, 36)
-EXCEPTION_HANDLER(#, 37)
-EXCEPTION_HANDLER(#, 38)
-EXCEPTION_HANDLER(#, 39)
-
-EXCEPTION_HANDLER(#, 40)
-EXCEPTION_HANDLER(#, 41)
-EXCEPTION_HANDLER(#, 42)
-EXCEPTION_HANDLER(#, 43)
-EXCEPTION_HANDLER(#, 44)
-EXCEPTION_HANDLER(#, 45)
-EXCEPTION_HANDLER(#, 46)
-EXCEPTION_HANDLER(#, 47)
-EXCEPTION_HANDLER(#, 48)
-EXCEPTION_HANDLER(#, 49)
-
-EXCEPTION_HANDLER(#, 50)
-EXCEPTION_HANDLER(#, 51)
-EXCEPTION_HANDLER(#, 52)
-EXCEPTION_HANDLER(#, 53)
-EXCEPTION_HANDLER(#, 54)
-EXCEPTION_HANDLER(#, 55)
-EXCEPTION_HANDLER(#, 56)
-EXCEPTION_HANDLER(#, 57)
-EXCEPTION_HANDLER(#, 58)
-EXCEPTION_HANDLER(#, 59)
-
-EXCEPTION_HANDLER(#, 60)
-EXCEPTION_HANDLER(#, 61)
-EXCEPTION_HANDLER(#, 62)
-EXCEPTION_HANDLER(#, 63)
-EXCEPTION_HANDLER(#, 64)
-EXCEPTION_HANDLER(#, 65)
-EXCEPTION_HANDLER(#, 66)
-EXCEPTION_HANDLER(#, 67)
-EXCEPTION_HANDLER(#, 68)
-EXCEPTION_HANDLER(#, 69)
-
-EXCEPTION_HANDLER(#, 70)
-EXCEPTION_HANDLER(#, 71)
-EXCEPTION_HANDLER(#, 72)
-EXCEPTION_HANDLER(#, 73)
-EXCEPTION_HANDLER(#, 74)
-EXCEPTION_HANDLER(#, 75)
-EXCEPTION_HANDLER(#, 76)
-EXCEPTION_HANDLER(#, 77)
-EXCEPTION_HANDLER(#, 78)
-EXCEPTION_HANDLER(#, 79)
-
-EXCEPTION_HANDLER(#, 80)
-EXCEPTION_HANDLER(#, 81)
-EXCEPTION_HANDLER(#, 82)
-EXCEPTION_HANDLER(#, 83)
-EXCEPTION_HANDLER(#, 84)
-EXCEPTION_HANDLER(#, 85)
-EXCEPTION_HANDLER(#, 86)
-EXCEPTION_HANDLER(#, 87)
-EXCEPTION_HANDLER(#, 88)
-EXCEPTION_HANDLER(#, 89)
-
-EXCEPTION_HANDLER(#, 90)
-EXCEPTION_HANDLER(#, 91)
-EXCEPTION_HANDLER(#, 92)
-EXCEPTION_HANDLER(#, 93)
-EXCEPTION_HANDLER(#, 94)
-EXCEPTION_HANDLER(#, 95)
-EXCEPTION_HANDLER(#, 96)
-EXCEPTION_HANDLER(#, 97)
-EXCEPTION_HANDLER(#, 98)
-EXCEPTION_HANDLER(#, 99)
-
-EXCEPTION_HANDLER(#, 100)
-EXCEPTION_HANDLER(#, 101)
-EXCEPTION_HANDLER(#, 102)
-EXCEPTION_HANDLER(#, 103)
-EXCEPTION_HANDLER(#, 104)
-EXCEPTION_HANDLER(#, 105)
-EXCEPTION_HANDLER(#, 106)
-EXCEPTION_HANDLER(#, 107)
-EXCEPTION_HANDLER(#, 108)
-EXCEPTION_HANDLER(#, 109)
-
-EXCEPTION_HANDLER(#, 110)
-EXCEPTION_HANDLER(#, 111)
-EXCEPTION_HANDLER(#, 112)
-EXCEPTION_HANDLER(#, 113)
-EXCEPTION_HANDLER(#, 114)
-EXCEPTION_HANDLER(#, 115)
-EXCEPTION_HANDLER(#, 116)
-EXCEPTION_HANDLER(#, 117)
-EXCEPTION_HANDLER(#, 118)
-EXCEPTION_HANDLER(#, 119)
-
-EXCEPTION_HANDLER(#, 120)
-EXCEPTION_HANDLER(#, 121)
-EXCEPTION_HANDLER(#, 122)
-EXCEPTION_HANDLER(#, 123)
-EXCEPTION_HANDLER(#, 124)
-EXCEPTION_HANDLER(#, 125)
-EXCEPTION_HANDLER(#, 126)
-EXCEPTION_HANDLER(#, 127)
-EXCEPTION_HANDLER(#, 128)
-EXCEPTION_HANDLER(#, 129)
-
-EXCEPTION_HANDLER(#, 130)
-EXCEPTION_HANDLER(#, 131)
-EXCEPTION_HANDLER(#, 132)
-EXCEPTION_HANDLER(#, 133)
-EXCEPTION_HANDLER(#, 134)
-EXCEPTION_HANDLER(#, 135)
-EXCEPTION_HANDLER(#, 136)
-EXCEPTION_HANDLER(#, 137)
-EXCEPTION_HANDLER(#, 138)
-EXCEPTION_HANDLER(#, 139)
-
-EXCEPTION_HANDLER(#, 140)
-EXCEPTION_HANDLER(#, 141)
-EXCEPTION_HANDLER(#, 142)
-EXCEPTION_HANDLER(#, 143)
-EXCEPTION_HANDLER(#, 144)
-EXCEPTION_HANDLER(#, 145)
-EXCEPTION_HANDLER(#, 146)
-EXCEPTION_HANDLER(#, 147)
-EXCEPTION_HANDLER(#, 148)
-EXCEPTION_HANDLER(#, 149)
-
-EXCEPTION_HANDLER(#, 150)
-EXCEPTION_HANDLER(#, 151)
-EXCEPTION_HANDLER(#, 152)
-EXCEPTION_HANDLER(#, 153)
-EXCEPTION_HANDLER(#, 154)
-EXCEPTION_HANDLER(#, 155)
-EXCEPTION_HANDLER(#, 156)
-EXCEPTION_HANDLER(#, 157)
-EXCEPTION_HANDLER(#, 158)
-EXCEPTION_HANDLER(#, 159)
-
-EXCEPTION_HANDLER(#, 160)
-EXCEPTION_HANDLER(#, 161)
-EXCEPTION_HANDLER(#, 162)
-EXCEPTION_HANDLER(#, 163)
-EXCEPTION_HANDLER(#, 164)
-EXCEPTION_HANDLER(#, 165)
-EXCEPTION_HANDLER(#, 166)
-EXCEPTION_HANDLER(#, 167)
-EXCEPTION_HANDLER(#, 168)
-EXCEPTION_HANDLER(#, 169)
-
-EXCEPTION_HANDLER(#, 170)
-EXCEPTION_HANDLER(#, 171)
-EXCEPTION_HANDLER(#, 172)
-EXCEPTION_HANDLER(#, 173)
-EXCEPTION_HANDLER(#, 174)
-EXCEPTION_HANDLER(#, 175)
-EXCEPTION_HANDLER(#, 176)
-EXCEPTION_HANDLER(#, 177)
-EXCEPTION_HANDLER(#, 178)
-EXCEPTION_HANDLER(#, 179)
-
-EXCEPTION_HANDLER(#, 180)
-EXCEPTION_HANDLER(#, 181)
-EXCEPTION_HANDLER(#, 182)
-EXCEPTION_HANDLER(#, 183)
-EXCEPTION_HANDLER(#, 184)
-EXCEPTION_HANDLER(#, 185)
-EXCEPTION_HANDLER(#, 186)
-EXCEPTION_HANDLER(#, 187)
-EXCEPTION_HANDLER(#, 188)
-EXCEPTION_HANDLER(#, 189)
-
-EXCEPTION_HANDLER(#, 190)
-EXCEPTION_HANDLER(#, 191)
-EXCEPTION_HANDLER(#, 192)
-EXCEPTION_HANDLER(#, 193)
-EXCEPTION_HANDLER(#, 194)
-EXCEPTION_HANDLER(#, 195)
-EXCEPTION_HANDLER(#, 196)
-EXCEPTION_HANDLER(#, 197)
-EXCEPTION_HANDLER(#, 198)
-EXCEPTION_HANDLER(#, 199)
-
-EXCEPTION_HANDLER(#, 200)
-EXCEPTION_HANDLER(#, 201)
-EXCEPTION_HANDLER(#, 202)
-EXCEPTION_HANDLER(#, 203)
-EXCEPTION_HANDLER(#, 204)
-EXCEPTION_HANDLER(#, 205)
-EXCEPTION_HANDLER(#, 206)
-EXCEPTION_HANDLER(#, 207)
-EXCEPTION_HANDLER(#, 208)
-EXCEPTION_HANDLER(#, 209)
-
-EXCEPTION_HANDLER(#, 210)
-EXCEPTION_HANDLER(#, 211)
-EXCEPTION_HANDLER(#, 212)
-EXCEPTION_HANDLER(#, 213)
-EXCEPTION_HANDLER(#, 214)
-EXCEPTION_HANDLER(#, 215)
-EXCEPTION_HANDLER(#, 216)
-EXCEPTION_HANDLER(#, 217)
-EXCEPTION_HANDLER(#, 218)
-EXCEPTION_HANDLER(#, 219)
-
-EXCEPTION_HANDLER(#, 220)
-EXCEPTION_HANDLER(#, 221)
-EXCEPTION_HANDLER(#, 222)
-EXCEPTION_HANDLER(#, 223)
-EXCEPTION_HANDLER(#, 224)
-EXCEPTION_HANDLER(#, 225)
-EXCEPTION_HANDLER(#, 226)
-EXCEPTION_HANDLER(#, 227)
-EXCEPTION_HANDLER(#, 228)
-EXCEPTION_HANDLER(#, 229)
-
-EXCEPTION_HANDLER(#, 230)
-EXCEPTION_HANDLER(#, 231)
-EXCEPTION_HANDLER(#, 232)
-EXCEPTION_HANDLER(#, 233)
-EXCEPTION_HANDLER(#, 234)
-EXCEPTION_HANDLER(#, 235)
-EXCEPTION_HANDLER(#, 236)
-EXCEPTION_HANDLER(#, 237)
-EXCEPTION_HANDLER(#, 238)
-EXCEPTION_HANDLER(#, 239)
-
-EXCEPTION_HANDLER(#, 240)
-EXCEPTION_HANDLER(#, 241)
-EXCEPTION_HANDLER(#, 242)
-EXCEPTION_HANDLER(#, 243)
-EXCEPTION_HANDLER(#, 244)
-EXCEPTION_HANDLER(#, 245)
-EXCEPTION_HANDLER(#, 246)
-EXCEPTION_HANDLER(#, 247)
-EXCEPTION_HANDLER(#, 248)
-EXCEPTION_HANDLER(#, 249)
-
-EXCEPTION_HANDLER(#, 250)
-EXCEPTION_HANDLER(#, 251)
-EXCEPTION_HANDLER(#, 252)
-EXCEPTION_HANDLER(#, 253)
-EXCEPTION_HANDLER(#, 254)
-EXCEPTION_HANDLER(#, 255)
-
-
-common_exception_handler:
-
- |
- | Need to put the format/vector above the PC and status register
- |
-
- move.l %d0,-(%sp) | free a register
- move.w 4(%sp),%d0 | get the format/vector id
-
- |
- | If a bus error or address error then trash the extra
- | data saved on the stack
- |
-
- cmp.w #0x0008,%d0
- beq ceh_10
-
- cmp.w #0x000C,%d0
- beq ceh_10
-
- bra ceh_20
-
-ceh_10:
-
- move.w %d0,12(%sp) | need to move the format/id
- move.l (%sp)+,%d0 | recover d0
- addq #8,%sp | trash the stack
- move.l %d0,-(%sp) | free a register, again
- move.w 4(%sp),%d0 | get the format/vector id
-
-ceh_20:
-
- move.w 6(%sp),4(%sp)
- move.w 8(%sp),6(%sp)
- move.w 10(%sp),8(%sp)
- move.w %d0,10(%sp) | put the format/vector id
- move.l (%sp)+,%d0
-
- |
- | Save all the registers, pass control to a dump trace routine
- |
-
- movem.l %d0-%d7/%a0-%a7,%sp@-
-
- |
- | check to see if ROM is mapped to zero
- |
-
- move.l #trace_exception,%d1 | get the linked address
- and.l #(ROM_SIZE - 1),%d1 | obtain the offset into the ROM
- lea.l %pc@(0),%a0 | were are we currently
- move.l %a0,%d0 | need to use a data register
- and.l #~(ROM_SIZE - 1),%d0 | keep the top part of the address
- or.l %d1,%d0 | apply it to the trace exception offset
- move.l %d0,%a0 | need an address register for jumping
- jsr %a0@(0)
-
-ceh_30:
- jmp ceh_30
-|
-| The RAM based vector table
-|
-
- .sect .vtable
-
- .global vector_table
-
-vector_table:
- .space (256 * 4),0
-
-|
-| Initialised data
-|
-
- .sect .data
-
- .global start_frame
-
-start_frame:
- .space 4,0
-
- .global stack_start
-
-stack_start:
- .space 4,0
-
-|
-| Uninitialised data
-|
-
- .sect .bss
-
- .global environ
- .align 2
-
-environ:
- .long 0
-
- .global heap_size
- .set heap_size,0x2000
-
- .global stack_size
- .set stack_size,0x1000
-
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/start302/Makefile.in b/c/src/lib/libbsp/m68k/ods68302/start302/Makefile.in
deleted file mode 100644
index a6d3ba2c08..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/start302/Makefile.in
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/start302.o
-
-ifeq ($(RTEMS_DEBUGGER),yes)
-RESET_SRC = debugreset
-else
-RESET_SRC = reset
-CFLAGS += -DGDB_MONITOR_ACTIVE
-endif
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=cpuboot
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=$(RESET_SRC)
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(S_O_FILES) $(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/start302/cpuboot.c b/c/src/lib/libbsp/m68k/ods68302/start302/cpuboot.c
deleted file mode 100644
index fd8a4146de..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/start302/cpuboot.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*****************************************************************************/
-/*
- Boot the CPU.
-
- Occurs in 3 phases for a 68302.
-
- Phase 1.
-
- Called as soon as able after reset. The BAR has been programed, and
- a small stack exists in the DPRAM. All interrupts are masked, and
- the processor is running in supervisor mode. No other hardware or
- chip selects are active.
-
- This phase programs the chip select registers, the parallel ports
- are set into default configurations, and basic registers cleared or
- reset. The leds are programmed to show the end of phase 1.
-
- Phase 2.
-
- This is a piece of code which is copied to DPRAM and executed. It
- should not do any more thann is currently present. The return to ROM
- is managed by modifing the return address. Again leds show the status.
-
- Phase 3.
-
- This code executes with a valid C environment. That is the data
- section has been intialised and the bss section set to 0. This phase
- performs any special card initialisation and then calls boot card.
-
- $Id$
-
-*/
-/*****************************************************************************/
-
-#include <bsp.h>
-#include <m68302.h>
-#include <debugport.h>
-#include <crc.h>
-
-/*
- Open the address, reset all registers
- */
-
-void boot_phase_1()
-{
- M302_SCR = SCR_DEFAULT;
-
- WRITE_OR(CSEL_ROM, ROM_SIZE, ROM_WAIT_STATES, OR_MASK_RW, OR_MASK_FC);
- WRITE_BR(CSEL_ROM, RAM_BASE, BR_READ_ONLY, BR_FC_NULL, BR_ENABLED);
- WRITE_OR(CSEL_RAM, RAM_SIZE, RAM_WAIT_STATES, OR_MASK_RW, OR_MASK_FC);
- WRITE_BR(CSEL_RAM, ROM_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
-
-#if defined(CSEL_1)
- WRITE_OR(CSEL_1, CSEL_1_SIZE, CSEL_1_WAIT_STATES, OR_MASK_RW, OR_MASK_FC);
- WRITE_BR(CSEL_1, CSEL_1_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
-#endif
-
-#if defined(CSEL_2)
- WRITE_OR(CSEL_2, CSEL_2_SIZE, CSEL_2_WAIT_STATES, OR_MASK_RW, OR_MASK_FC);
- WRITE_BR(CSEL_2, CSEL_2_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
-#endif
-
- m302.reg.gimr = m302.reg.ipr = m302.reg.imr = m302.reg.isr = 0;
-
- m302.reg.simode = 0;
-
- m302.reg.pacnt = CARD_PA_CONFIGURATION;
- m302.reg.paddr = CARD_PA_DEFAULT_DIRECTIONS;
- m302.reg.padat = CARD_PA_DEFAULT_DATA;
-
- m302.reg.pbcnt = CARD_PB_CONFIGURATION;
- m302.reg.pbddr = CARD_PB_DEFAULT_DIRECTIONS;
- m302.reg.pbdat = CARD_PB_DEFAULT_DATA;
-
- m302.reg.wrr = WATCHDOG_TIMEOUT_PERIOD | WATCHDOG_ENABLE;
-
-#if defined(LED_CONTROL)
- LED_CONTROL(LED_1_RED, LED_2_OFF, LED_3_OFF, LED_4_OFF,
- LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF);
-#endif
-}
-
-/*
- Swap the chip select mapping for ROM and RAM
- */
-
-void boot_phase_2(void)
-{
- rtems_unsigned32 stack;
-
-#if defined(LED_CONTROL)
- LED_CONTROL(LED_1_RED, LED_2_RED, LED_3_OFF, LED_4_OFF,
- LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF);
-#endif
-
- WRITE_BR(CSEL_ROM, ROM_BASE, BR_READ_ONLY, BR_FC_NULL, BR_ENABLED);
- WRITE_BR(CSEL_RAM, RAM_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
-
-#if defined(LED_CONTROL)
- LED_CONTROL(LED_1_GREEN, LED_2_RED, LED_3_OFF, LED_4_OFF,
- LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF);
-#endif
-
- /* seems to want 2, looked at assember code output */
- *(&stack + 2) |= ROM_BASE;
-}
-
-/*
- Any pre-main initialisation, the C environment is setup, how-ever C++
- static constructors have not been called, and RTEMS is not initialised.
- */
-
-void boot_card();
-void set_debug_traps();
-void breakpoint();
-
-void boot_phase_3(void)
-{
- if (GDB_RUN_MONITOR())
- {
- set_debug_traps();
- breakpoint();
- }
-
- debug_port_banner();
-
- /* FIXME : add RAM and ROM checks */
-
- /* boot the bsp, what ever this means */
- boot_card();
-
- WATCHDOG_TRIGGER();
-}
diff --git a/c/src/lib/libbsp/m68k/ods68302/start302/debugreset.S b/c/src/lib/libbsp/m68k/ods68302/start302/debugreset.S
deleted file mode 100644
index 74049191c4..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/start302/debugreset.S
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * $Id$
- *
- * Re-written the gen68302 start-up code.
- *
- * Uses gas syntax only, removed the OAR asm.h.
- *
- * Supplies a complete vector table in ROM.
- *
- * Manages all vectors with seperate handlers to trap unhandled
- * execptions.
- *
- * Uses the target specific header file to get the runtime
- * configuration
- *
- * COPYRIGHT (c) 1996
- * Objective Design Systems Pty Ltd (ODS)
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * This material may be reproduced by or for the U.S. Government pursuant
- * to the copyright license under the clause at DFARS 252.227-7013. This
- * notice must appear in all copies of this file and its derivatives.
- *
- */
-
-|
-| Entry from debugger
-|
- .sect .text
-
-|
-| Start
-|
-| Entered from a hardware reset.
-|
-
- .global start | Default entry point for GNU
-start:
-
- move.w #0x2700,%sr | Disable all interrupts
-
- |
- | zero out uninitialized data area
- |
-
-zerobss:
- moveal #end,%a0 | find end of .bss
- moveal #bss_start,%a1 | find beginning of .bss
- moveq #0,%d0
-
-zerobss_loop:
-
- movel %d0,%a1@+ | to zero out uninitialized
- cmpal %a0,%a1
- jlt zerobss_loop | loop until _end reached
-
- movel #end,%d0 | d0 = end of bss/start of heap
- addl #heap_size,%d0 | d0 = end of heap
-
- movel %d0,stack_start | Save for brk() routine
- addl #stack_size,%d0 | make room for stack
- andl #0xffffffc0,%d0 | align it on 16 byte boundary
-
- movw #0x3700,%sr | SUPV MODE,INTERRUPTS OFF!!!
- movel %d0,%a7 | set master stack pointer
- movel %d0,%a6 | set base pointer
-
- jsr boot_phase_3
-
-|
-| Initialised data
-|
-
- .sect .data
-
- .global start_frame
-
-start_frame:
- .space 4,0
-
- .global stack_start
-
-stack_start:
- .space 4,0
-
-|
-| Uninitialised data
-|
-
- .sect .bss
-
- .global environ
- .align 2
-
-environ:
- .long 0
-
- .global heap_size
- .set heap_size,0x2000
-
- .global stack_size
- .set stack_size,0x1000
-
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/start302/reset.S b/c/src/lib/libbsp/m68k/ods68302/start302/reset.S
deleted file mode 100644
index 71d1071243..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/start302/reset.S
+++ /dev/null
@@ -1,881 +0,0 @@
-/*
- * $Id$
- *
- * Re-written the gen68302 start-up code.
- *
- * Uses gas syntax only, removed the OAR asm.h.
- *
- * Supplies a complete vector table in ROM.
- *
- * Manages all vectors with seperate handlers to trap unhandled
- * execptions.
- *
- * Uses the target specific header file to get the runtime
- * configuration
- *
- * COPYRIGHT (c) 1996
- * Objective Design Systems Pty Ltd (ODS)
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * This material may be reproduced by or for the U.S. Government pursuant
- * to the copyright license under the clause at DFARS 252.227-7013. This
- * notice must appear in all copies of this file and its derivatives.
- *
- */
-
-|
-| some basic defined, this is that is required
-|
-#define MC68302_BAR 0x000000F2
-#define MC68302_BAR_FC_CFC 0x0000
-#define MC68302_SYS_RAM_SIZE 0x240
-
-|
-| Boot boot code in a special section, ld postions
-|
-| Initial stack pointer is in the dual ported RAM
-|
- .sect .text
-
- .global M68Kvec | Vector Table
-
-M68Kvec: | standard location for vectors
-
-|
-| Make relative, can have the code positioned any where
-|
-
-V___ISSP: .long MC68302_BASE + MC68302_SYS_RAM_SIZE
-V____IPC: .long start - V___ISSP
-
-|
-| Create the rest of the vector table to point to the unhandled expection
-| handler
-|
-| Lots of macros, how-ever it creates a simple ROM vector table
-|
-
-exception_handler = unhandled_exception - V___ISSP
-#define MAKE_EXCEPTION_VECTOR(n) V___##n: .long (exception_handler + (n * 8))
-
-MAKE_EXCEPTION_VECTOR(2)
-MAKE_EXCEPTION_VECTOR(3)
-MAKE_EXCEPTION_VECTOR(4)
-MAKE_EXCEPTION_VECTOR(5)
-MAKE_EXCEPTION_VECTOR(6)
-MAKE_EXCEPTION_VECTOR(7)
-MAKE_EXCEPTION_VECTOR(8)
-MAKE_EXCEPTION_VECTOR(9)
-
-MAKE_EXCEPTION_VECTOR(10)
-MAKE_EXCEPTION_VECTOR(11)
-MAKE_EXCEPTION_VECTOR(12)
-MAKE_EXCEPTION_VECTOR(13)
-MAKE_EXCEPTION_VECTOR(14)
-MAKE_EXCEPTION_VECTOR(15)
-MAKE_EXCEPTION_VECTOR(16)
-MAKE_EXCEPTION_VECTOR(17)
-MAKE_EXCEPTION_VECTOR(18)
-MAKE_EXCEPTION_VECTOR(19)
-
-MAKE_EXCEPTION_VECTOR(20)
-MAKE_EXCEPTION_VECTOR(21)
-MAKE_EXCEPTION_VECTOR(22)
-MAKE_EXCEPTION_VECTOR(23)
-MAKE_EXCEPTION_VECTOR(24)
-MAKE_EXCEPTION_VECTOR(25)
-MAKE_EXCEPTION_VECTOR(26)
-MAKE_EXCEPTION_VECTOR(27)
-MAKE_EXCEPTION_VECTOR(28)
-MAKE_EXCEPTION_VECTOR(29)
-
-MAKE_EXCEPTION_VECTOR(30)
-MAKE_EXCEPTION_VECTOR(31)
-MAKE_EXCEPTION_VECTOR(32)
-MAKE_EXCEPTION_VECTOR(33)
-MAKE_EXCEPTION_VECTOR(34)
-MAKE_EXCEPTION_VECTOR(35)
-MAKE_EXCEPTION_VECTOR(36)
-MAKE_EXCEPTION_VECTOR(37)
-MAKE_EXCEPTION_VECTOR(38)
-MAKE_EXCEPTION_VECTOR(39)
-
-MAKE_EXCEPTION_VECTOR(40)
-MAKE_EXCEPTION_VECTOR(41)
-MAKE_EXCEPTION_VECTOR(42)
-MAKE_EXCEPTION_VECTOR(43)
-MAKE_EXCEPTION_VECTOR(44)
-MAKE_EXCEPTION_VECTOR(45)
-MAKE_EXCEPTION_VECTOR(46)
-MAKE_EXCEPTION_VECTOR(47)
-MAKE_EXCEPTION_VECTOR(48)
-MAKE_EXCEPTION_VECTOR(49)
-
-MAKE_EXCEPTION_VECTOR(50)
-MAKE_EXCEPTION_VECTOR(51)
-MAKE_EXCEPTION_VECTOR(52)
-MAKE_EXCEPTION_VECTOR(53)
-MAKE_EXCEPTION_VECTOR(54)
-MAKE_EXCEPTION_VECTOR(55)
-MAKE_EXCEPTION_VECTOR(56)
-MAKE_EXCEPTION_VECTOR(57)
-MAKE_EXCEPTION_VECTOR(58)
-MAKE_EXCEPTION_VECTOR(59)
-
-MAKE_EXCEPTION_VECTOR(60)
-MAKE_EXCEPTION_VECTOR(61)
-MAKE_EXCEPTION_VECTOR(62)
-MAKE_EXCEPTION_VECTOR(63)
-MAKE_EXCEPTION_VECTOR(64)
-MAKE_EXCEPTION_VECTOR(65)
-MAKE_EXCEPTION_VECTOR(66)
-MAKE_EXCEPTION_VECTOR(67)
-MAKE_EXCEPTION_VECTOR(68)
-MAKE_EXCEPTION_VECTOR(69)
-
-MAKE_EXCEPTION_VECTOR(70)
-MAKE_EXCEPTION_VECTOR(71)
-MAKE_EXCEPTION_VECTOR(72)
-MAKE_EXCEPTION_VECTOR(73)
-MAKE_EXCEPTION_VECTOR(74)
-MAKE_EXCEPTION_VECTOR(75)
-MAKE_EXCEPTION_VECTOR(76)
-MAKE_EXCEPTION_VECTOR(77)
-MAKE_EXCEPTION_VECTOR(78)
-MAKE_EXCEPTION_VECTOR(79)
-
-MAKE_EXCEPTION_VECTOR(80)
-MAKE_EXCEPTION_VECTOR(81)
-MAKE_EXCEPTION_VECTOR(82)
-MAKE_EXCEPTION_VECTOR(83)
-MAKE_EXCEPTION_VECTOR(84)
-MAKE_EXCEPTION_VECTOR(85)
-MAKE_EXCEPTION_VECTOR(86)
-MAKE_EXCEPTION_VECTOR(87)
-MAKE_EXCEPTION_VECTOR(88)
-MAKE_EXCEPTION_VECTOR(89)
-
-MAKE_EXCEPTION_VECTOR(90)
-MAKE_EXCEPTION_VECTOR(91)
-MAKE_EXCEPTION_VECTOR(92)
-MAKE_EXCEPTION_VECTOR(93)
-MAKE_EXCEPTION_VECTOR(94)
-MAKE_EXCEPTION_VECTOR(95)
-MAKE_EXCEPTION_VECTOR(96)
-MAKE_EXCEPTION_VECTOR(97)
-MAKE_EXCEPTION_VECTOR(98)
-MAKE_EXCEPTION_VECTOR(99)
-
-MAKE_EXCEPTION_VECTOR(100)
-MAKE_EXCEPTION_VECTOR(101)
-MAKE_EXCEPTION_VECTOR(102)
-MAKE_EXCEPTION_VECTOR(103)
-MAKE_EXCEPTION_VECTOR(104)
-MAKE_EXCEPTION_VECTOR(105)
-MAKE_EXCEPTION_VECTOR(106)
-MAKE_EXCEPTION_VECTOR(107)
-MAKE_EXCEPTION_VECTOR(108)
-MAKE_EXCEPTION_VECTOR(109)
-
-MAKE_EXCEPTION_VECTOR(110)
-MAKE_EXCEPTION_VECTOR(111)
-MAKE_EXCEPTION_VECTOR(112)
-MAKE_EXCEPTION_VECTOR(113)
-MAKE_EXCEPTION_VECTOR(114)
-MAKE_EXCEPTION_VECTOR(115)
-MAKE_EXCEPTION_VECTOR(116)
-MAKE_EXCEPTION_VECTOR(117)
-MAKE_EXCEPTION_VECTOR(118)
-MAKE_EXCEPTION_VECTOR(119)
-
-MAKE_EXCEPTION_VECTOR(120)
-MAKE_EXCEPTION_VECTOR(121)
-MAKE_EXCEPTION_VECTOR(122)
-MAKE_EXCEPTION_VECTOR(123)
-MAKE_EXCEPTION_VECTOR(124)
-MAKE_EXCEPTION_VECTOR(125)
-MAKE_EXCEPTION_VECTOR(126)
-MAKE_EXCEPTION_VECTOR(127)
-MAKE_EXCEPTION_VECTOR(128)
-MAKE_EXCEPTION_VECTOR(129)
-
-MAKE_EXCEPTION_VECTOR(130)
-MAKE_EXCEPTION_VECTOR(131)
-MAKE_EXCEPTION_VECTOR(132)
-MAKE_EXCEPTION_VECTOR(133)
-MAKE_EXCEPTION_VECTOR(134)
-MAKE_EXCEPTION_VECTOR(135)
-MAKE_EXCEPTION_VECTOR(136)
-MAKE_EXCEPTION_VECTOR(137)
-MAKE_EXCEPTION_VECTOR(138)
-MAKE_EXCEPTION_VECTOR(139)
-
-MAKE_EXCEPTION_VECTOR(140)
-MAKE_EXCEPTION_VECTOR(141)
-MAKE_EXCEPTION_VECTOR(142)
-MAKE_EXCEPTION_VECTOR(143)
-MAKE_EXCEPTION_VECTOR(144)
-MAKE_EXCEPTION_VECTOR(145)
-MAKE_EXCEPTION_VECTOR(146)
-MAKE_EXCEPTION_VECTOR(147)
-MAKE_EXCEPTION_VECTOR(148)
-MAKE_EXCEPTION_VECTOR(149)
-
-MAKE_EXCEPTION_VECTOR(150)
-MAKE_EXCEPTION_VECTOR(151)
-MAKE_EXCEPTION_VECTOR(152)
-MAKE_EXCEPTION_VECTOR(153)
-MAKE_EXCEPTION_VECTOR(154)
-MAKE_EXCEPTION_VECTOR(155)
-MAKE_EXCEPTION_VECTOR(156)
-MAKE_EXCEPTION_VECTOR(157)
-MAKE_EXCEPTION_VECTOR(158)
-MAKE_EXCEPTION_VECTOR(159)
-
-MAKE_EXCEPTION_VECTOR(160)
-MAKE_EXCEPTION_VECTOR(161)
-MAKE_EXCEPTION_VECTOR(162)
-MAKE_EXCEPTION_VECTOR(163)
-MAKE_EXCEPTION_VECTOR(164)
-MAKE_EXCEPTION_VECTOR(165)
-MAKE_EXCEPTION_VECTOR(166)
-MAKE_EXCEPTION_VECTOR(167)
-MAKE_EXCEPTION_VECTOR(168)
-MAKE_EXCEPTION_VECTOR(169)
-
-MAKE_EXCEPTION_VECTOR(170)
-MAKE_EXCEPTION_VECTOR(171)
-MAKE_EXCEPTION_VECTOR(172)
-MAKE_EXCEPTION_VECTOR(173)
-MAKE_EXCEPTION_VECTOR(174)
-MAKE_EXCEPTION_VECTOR(175)
-MAKE_EXCEPTION_VECTOR(176)
-MAKE_EXCEPTION_VECTOR(177)
-MAKE_EXCEPTION_VECTOR(178)
-MAKE_EXCEPTION_VECTOR(179)
-
-MAKE_EXCEPTION_VECTOR(180)
-MAKE_EXCEPTION_VECTOR(181)
-MAKE_EXCEPTION_VECTOR(182)
-MAKE_EXCEPTION_VECTOR(183)
-MAKE_EXCEPTION_VECTOR(184)
-MAKE_EXCEPTION_VECTOR(185)
-MAKE_EXCEPTION_VECTOR(186)
-MAKE_EXCEPTION_VECTOR(187)
-MAKE_EXCEPTION_VECTOR(188)
-MAKE_EXCEPTION_VECTOR(189)
-
-MAKE_EXCEPTION_VECTOR(190)
-MAKE_EXCEPTION_VECTOR(191)
-MAKE_EXCEPTION_VECTOR(192)
-MAKE_EXCEPTION_VECTOR(193)
-MAKE_EXCEPTION_VECTOR(194)
-MAKE_EXCEPTION_VECTOR(195)
-MAKE_EXCEPTION_VECTOR(196)
-MAKE_EXCEPTION_VECTOR(197)
-MAKE_EXCEPTION_VECTOR(198)
-MAKE_EXCEPTION_VECTOR(199)
-
-MAKE_EXCEPTION_VECTOR(200)
-MAKE_EXCEPTION_VECTOR(201)
-MAKE_EXCEPTION_VECTOR(202)
-MAKE_EXCEPTION_VECTOR(203)
-MAKE_EXCEPTION_VECTOR(204)
-MAKE_EXCEPTION_VECTOR(205)
-MAKE_EXCEPTION_VECTOR(206)
-MAKE_EXCEPTION_VECTOR(207)
-MAKE_EXCEPTION_VECTOR(208)
-MAKE_EXCEPTION_VECTOR(209)
-
-MAKE_EXCEPTION_VECTOR(210)
-MAKE_EXCEPTION_VECTOR(211)
-MAKE_EXCEPTION_VECTOR(212)
-MAKE_EXCEPTION_VECTOR(213)
-MAKE_EXCEPTION_VECTOR(214)
-MAKE_EXCEPTION_VECTOR(215)
-MAKE_EXCEPTION_VECTOR(216)
-MAKE_EXCEPTION_VECTOR(217)
-MAKE_EXCEPTION_VECTOR(218)
-MAKE_EXCEPTION_VECTOR(219)
-
-MAKE_EXCEPTION_VECTOR(220)
-MAKE_EXCEPTION_VECTOR(221)
-MAKE_EXCEPTION_VECTOR(222)
-MAKE_EXCEPTION_VECTOR(223)
-MAKE_EXCEPTION_VECTOR(224)
-MAKE_EXCEPTION_VECTOR(225)
-MAKE_EXCEPTION_VECTOR(226)
-MAKE_EXCEPTION_VECTOR(227)
-MAKE_EXCEPTION_VECTOR(228)
-MAKE_EXCEPTION_VECTOR(229)
-
-MAKE_EXCEPTION_VECTOR(230)
-MAKE_EXCEPTION_VECTOR(231)
-MAKE_EXCEPTION_VECTOR(232)
-MAKE_EXCEPTION_VECTOR(233)
-MAKE_EXCEPTION_VECTOR(234)
-MAKE_EXCEPTION_VECTOR(235)
-MAKE_EXCEPTION_VECTOR(236)
-MAKE_EXCEPTION_VECTOR(237)
-MAKE_EXCEPTION_VECTOR(238)
-MAKE_EXCEPTION_VECTOR(239)
-
-MAKE_EXCEPTION_VECTOR(240)
-MAKE_EXCEPTION_VECTOR(241)
-MAKE_EXCEPTION_VECTOR(242)
-MAKE_EXCEPTION_VECTOR(243)
-MAKE_EXCEPTION_VECTOR(244)
-MAKE_EXCEPTION_VECTOR(245)
-MAKE_EXCEPTION_VECTOR(246)
-MAKE_EXCEPTION_VECTOR(247)
-MAKE_EXCEPTION_VECTOR(248)
-MAKE_EXCEPTION_VECTOR(249)
-
-MAKE_EXCEPTION_VECTOR(250)
-MAKE_EXCEPTION_VECTOR(251)
-MAKE_EXCEPTION_VECTOR(252)
-MAKE_EXCEPTION_VECTOR(253)
-MAKE_EXCEPTION_VECTOR(254)
-MAKE_EXCEPTION_VECTOR(255)
-
-|
-| Start
-|
-| Entered from a hardware reset.
-|
-
- .global start | Default entry point for GNU
-start:
-
- move.w #0x2700,%sr | Disable all interrupts
-
- |
- | Program the BAR, give us a stack !!
- |
-
- moveq #0,%d0
- move.w #(MC68302_BASE >> 12),%d0
- or.w #(MC68302_BAR_FC_CFC << 12),%d0
- move.l #MC68302_BAR,%a0
- move.w %d0,%a0@(0)
-
- |
- | watch for sign extended maths with the linker on (boot_phase_1-V___ISSP)
- | manage the address with code, limited address of 2K at reset for CS0
- |
-
- move.l #boot_phase_1,%d0
- and.l #0x1FFF,%d0
- move.l %d0,%a0
- jsr %a0@(0) | programs all basic 302 registers
-
- |
- | Map to the 68302 registers
- |
-
- move.l #MC68302_BASE,%a5
-
- |
- | Make a vector table in RAM
- |
-
- move.l #RAM_BASE,%a0 | a0 -> rom vector table
- moveal #ROM_BASE,%a1 | d1 -> start of tmp SRAM
-
- move.l #255,%d0
-
-copy_vec_table:
-
- move.l (%a0)+,%d1
- or.l #ROM_BASE,%d1
- move.l %d1,(%a1)+
- subq.l #1,%d0
- bne copy_vec_table
-
-#if defined(SYSTEM_TABLE_ANCHOR_OFFSET)
- |
- | Clear the system table
- |
-
- move.l #SYSTEM_TABLE_ANCHOR_OFFSET,%a0
- move.l #0,(%a0)
-#endif
-
- |
- | Copy the chip select swap code to DPRAM and run it
- |
-
- move.l #boot_phase_2,%d0
- and.l #(ROM_SIZE - 1),%d0
- move.l %d0,%a0 | a0 -> remap code
- lea %a5@(0),%a1 | a1 -> internal system RAM
-
- move.l #boot_phase_3,%d0
- and.l #(ROM_SIZE - 1),%d0
- sub.l %a0,%d0
-
-copy_remap:
- move.b (%a0)+,(%a1)+ | copy
- dbra %d0,copy_remap
-
- |
- | Jump to the remap code in the 68302''s internal system RAM.
- |
-
- jsr %a5@(0) | execute the swap code
-
- |
- | Map to the 68302 registers
- |
-
- move.l #MC68302_BASE,%a5
-
- |
- | Copy initialized data area from ROM to RAM
- |
-
-copy_data:
- moveal #etext,%a0 | find the end of .text
- moveal #data_start,%a1 | find the beginning of .data
- moveal #edata,%a2 | find the end of .data
-
-copy_data_loop:
-
- movel %a0@+,%a1@+ | copy the data
- cmpal %a2,%a1
- jlt copy_data_loop | loop until edata reached
-
- |
- | zero out uninitialized data area
- |
-
-zerobss:
- moveal #end,%a0 | find end of .bss
- moveal #bss_start,%a1 | find beginning of .bss
- moveq #0,%d0
-
-zerobss_loop:
-
- movel %d0,%a1@+ | to zero out uninitialized
- cmpal %a0,%a1
- jlt zerobss_loop | loop until _end reached
-
- movel #end,%d0 | d0 = end of bss/start of heap
- addl #heap_size,%d0 | d0 = end of heap
-
- movel %d0,stack_start | Save for brk() routine
- addl #stack_size,%d0 | make room for stack
- andl #0xffffffc0,%d0 | align it on 16 byte boundary
-
- movw #0x3700,%sr | SUPV MODE,INTERRUPTS OFF!!!
- movel %d0,%a7 | set master stack pointer
- movel %d0,%a6 | set base pointer
-
- jsr boot_phase_3
-
-|
-| Create an unhandled exception jump table. The table has an entry for
-| each vector in the vector table. The entry pushes the vector number onto
-| the stack and then calls a common exception handler using PIC.
-|
-| The macros are to create the labels and format vectors.
-|
-
-#define cat(x, y) x ## y
-#define FORMAT_ID(n) (n << 2)
-#define EXCEPTION_HANDLER(h, n) EH__##n: move.w cat(h, FORMAT_ID(n)),-(%sp) ; \
- bra common_exception_handler
-
-unhandled_exception:
-
-EXCEPTION_HANDLER(#, 0)
-EXCEPTION_HANDLER(#, 1)
-EXCEPTION_HANDLER(#, 2)
-EXCEPTION_HANDLER(#, 3)
-EXCEPTION_HANDLER(#, 4)
-EXCEPTION_HANDLER(#, 5)
-EXCEPTION_HANDLER(#, 6)
-EXCEPTION_HANDLER(#, 7)
-EXCEPTION_HANDLER(#, 8)
-EXCEPTION_HANDLER(#, 9)
-
-EXCEPTION_HANDLER(#, 10)
-EXCEPTION_HANDLER(#, 11)
-EXCEPTION_HANDLER(#, 12)
-EXCEPTION_HANDLER(#, 13)
-EXCEPTION_HANDLER(#, 14)
-EXCEPTION_HANDLER(#, 15)
-EXCEPTION_HANDLER(#, 16)
-EXCEPTION_HANDLER(#, 17)
-EXCEPTION_HANDLER(#, 18)
-EXCEPTION_HANDLER(#, 19)
-
-EXCEPTION_HANDLER(#, 20)
-EXCEPTION_HANDLER(#, 21)
-EXCEPTION_HANDLER(#, 22)
-EXCEPTION_HANDLER(#, 23)
-EXCEPTION_HANDLER(#, 24)
-EXCEPTION_HANDLER(#, 25)
-EXCEPTION_HANDLER(#, 26)
-EXCEPTION_HANDLER(#, 27)
-EXCEPTION_HANDLER(#, 28)
-EXCEPTION_HANDLER(#, 29)
-
-EXCEPTION_HANDLER(#, 30)
-EXCEPTION_HANDLER(#, 31)
-EXCEPTION_HANDLER(#, 32)
-EXCEPTION_HANDLER(#, 33)
-EXCEPTION_HANDLER(#, 34)
-EXCEPTION_HANDLER(#, 35)
-EXCEPTION_HANDLER(#, 36)
-EXCEPTION_HANDLER(#, 37)
-EXCEPTION_HANDLER(#, 38)
-EXCEPTION_HANDLER(#, 39)
-
-EXCEPTION_HANDLER(#, 40)
-EXCEPTION_HANDLER(#, 41)
-EXCEPTION_HANDLER(#, 42)
-EXCEPTION_HANDLER(#, 43)
-EXCEPTION_HANDLER(#, 44)
-EXCEPTION_HANDLER(#, 45)
-EXCEPTION_HANDLER(#, 46)
-EXCEPTION_HANDLER(#, 47)
-EXCEPTION_HANDLER(#, 48)
-EXCEPTION_HANDLER(#, 49)
-
-EXCEPTION_HANDLER(#, 50)
-EXCEPTION_HANDLER(#, 51)
-EXCEPTION_HANDLER(#, 52)
-EXCEPTION_HANDLER(#, 53)
-EXCEPTION_HANDLER(#, 54)
-EXCEPTION_HANDLER(#, 55)
-EXCEPTION_HANDLER(#, 56)
-EXCEPTION_HANDLER(#, 57)
-EXCEPTION_HANDLER(#, 58)
-EXCEPTION_HANDLER(#, 59)
-
-EXCEPTION_HANDLER(#, 60)
-EXCEPTION_HANDLER(#, 61)
-EXCEPTION_HANDLER(#, 62)
-EXCEPTION_HANDLER(#, 63)
-EXCEPTION_HANDLER(#, 64)
-EXCEPTION_HANDLER(#, 65)
-EXCEPTION_HANDLER(#, 66)
-EXCEPTION_HANDLER(#, 67)
-EXCEPTION_HANDLER(#, 68)
-EXCEPTION_HANDLER(#, 69)
-
-EXCEPTION_HANDLER(#, 70)
-EXCEPTION_HANDLER(#, 71)
-EXCEPTION_HANDLER(#, 72)
-EXCEPTION_HANDLER(#, 73)
-EXCEPTION_HANDLER(#, 74)
-EXCEPTION_HANDLER(#, 75)
-EXCEPTION_HANDLER(#, 76)
-EXCEPTION_HANDLER(#, 77)
-EXCEPTION_HANDLER(#, 78)
-EXCEPTION_HANDLER(#, 79)
-
-EXCEPTION_HANDLER(#, 80)
-EXCEPTION_HANDLER(#, 81)
-EXCEPTION_HANDLER(#, 82)
-EXCEPTION_HANDLER(#, 83)
-EXCEPTION_HANDLER(#, 84)
-EXCEPTION_HANDLER(#, 85)
-EXCEPTION_HANDLER(#, 86)
-EXCEPTION_HANDLER(#, 87)
-EXCEPTION_HANDLER(#, 88)
-EXCEPTION_HANDLER(#, 89)
-
-EXCEPTION_HANDLER(#, 90)
-EXCEPTION_HANDLER(#, 91)
-EXCEPTION_HANDLER(#, 92)
-EXCEPTION_HANDLER(#, 93)
-EXCEPTION_HANDLER(#, 94)
-EXCEPTION_HANDLER(#, 95)
-EXCEPTION_HANDLER(#, 96)
-EXCEPTION_HANDLER(#, 97)
-EXCEPTION_HANDLER(#, 98)
-EXCEPTION_HANDLER(#, 99)
-
-EXCEPTION_HANDLER(#, 100)
-EXCEPTION_HANDLER(#, 101)
-EXCEPTION_HANDLER(#, 102)
-EXCEPTION_HANDLER(#, 103)
-EXCEPTION_HANDLER(#, 104)
-EXCEPTION_HANDLER(#, 105)
-EXCEPTION_HANDLER(#, 106)
-EXCEPTION_HANDLER(#, 107)
-EXCEPTION_HANDLER(#, 108)
-EXCEPTION_HANDLER(#, 109)
-
-EXCEPTION_HANDLER(#, 110)
-EXCEPTION_HANDLER(#, 111)
-EXCEPTION_HANDLER(#, 112)
-EXCEPTION_HANDLER(#, 113)
-EXCEPTION_HANDLER(#, 114)
-EXCEPTION_HANDLER(#, 115)
-EXCEPTION_HANDLER(#, 116)
-EXCEPTION_HANDLER(#, 117)
-EXCEPTION_HANDLER(#, 118)
-EXCEPTION_HANDLER(#, 119)
-
-EXCEPTION_HANDLER(#, 120)
-EXCEPTION_HANDLER(#, 121)
-EXCEPTION_HANDLER(#, 122)
-EXCEPTION_HANDLER(#, 123)
-EXCEPTION_HANDLER(#, 124)
-EXCEPTION_HANDLER(#, 125)
-EXCEPTION_HANDLER(#, 126)
-EXCEPTION_HANDLER(#, 127)
-EXCEPTION_HANDLER(#, 128)
-EXCEPTION_HANDLER(#, 129)
-
-EXCEPTION_HANDLER(#, 130)
-EXCEPTION_HANDLER(#, 131)
-EXCEPTION_HANDLER(#, 132)
-EXCEPTION_HANDLER(#, 133)
-EXCEPTION_HANDLER(#, 134)
-EXCEPTION_HANDLER(#, 135)
-EXCEPTION_HANDLER(#, 136)
-EXCEPTION_HANDLER(#, 137)
-EXCEPTION_HANDLER(#, 138)
-EXCEPTION_HANDLER(#, 139)
-
-EXCEPTION_HANDLER(#, 140)
-EXCEPTION_HANDLER(#, 141)
-EXCEPTION_HANDLER(#, 142)
-EXCEPTION_HANDLER(#, 143)
-EXCEPTION_HANDLER(#, 144)
-EXCEPTION_HANDLER(#, 145)
-EXCEPTION_HANDLER(#, 146)
-EXCEPTION_HANDLER(#, 147)
-EXCEPTION_HANDLER(#, 148)
-EXCEPTION_HANDLER(#, 149)
-
-EXCEPTION_HANDLER(#, 150)
-EXCEPTION_HANDLER(#, 151)
-EXCEPTION_HANDLER(#, 152)
-EXCEPTION_HANDLER(#, 153)
-EXCEPTION_HANDLER(#, 154)
-EXCEPTION_HANDLER(#, 155)
-EXCEPTION_HANDLER(#, 156)
-EXCEPTION_HANDLER(#, 157)
-EXCEPTION_HANDLER(#, 158)
-EXCEPTION_HANDLER(#, 159)
-
-EXCEPTION_HANDLER(#, 160)
-EXCEPTION_HANDLER(#, 161)
-EXCEPTION_HANDLER(#, 162)
-EXCEPTION_HANDLER(#, 163)
-EXCEPTION_HANDLER(#, 164)
-EXCEPTION_HANDLER(#, 165)
-EXCEPTION_HANDLER(#, 166)
-EXCEPTION_HANDLER(#, 167)
-EXCEPTION_HANDLER(#, 168)
-EXCEPTION_HANDLER(#, 169)
-
-EXCEPTION_HANDLER(#, 170)
-EXCEPTION_HANDLER(#, 171)
-EXCEPTION_HANDLER(#, 172)
-EXCEPTION_HANDLER(#, 173)
-EXCEPTION_HANDLER(#, 174)
-EXCEPTION_HANDLER(#, 175)
-EXCEPTION_HANDLER(#, 176)
-EXCEPTION_HANDLER(#, 177)
-EXCEPTION_HANDLER(#, 178)
-EXCEPTION_HANDLER(#, 179)
-
-EXCEPTION_HANDLER(#, 180)
-EXCEPTION_HANDLER(#, 181)
-EXCEPTION_HANDLER(#, 182)
-EXCEPTION_HANDLER(#, 183)
-EXCEPTION_HANDLER(#, 184)
-EXCEPTION_HANDLER(#, 185)
-EXCEPTION_HANDLER(#, 186)
-EXCEPTION_HANDLER(#, 187)
-EXCEPTION_HANDLER(#, 188)
-EXCEPTION_HANDLER(#, 189)
-
-EXCEPTION_HANDLER(#, 190)
-EXCEPTION_HANDLER(#, 191)
-EXCEPTION_HANDLER(#, 192)
-EXCEPTION_HANDLER(#, 193)
-EXCEPTION_HANDLER(#, 194)
-EXCEPTION_HANDLER(#, 195)
-EXCEPTION_HANDLER(#, 196)
-EXCEPTION_HANDLER(#, 197)
-EXCEPTION_HANDLER(#, 198)
-EXCEPTION_HANDLER(#, 199)
-
-EXCEPTION_HANDLER(#, 200)
-EXCEPTION_HANDLER(#, 201)
-EXCEPTION_HANDLER(#, 202)
-EXCEPTION_HANDLER(#, 203)
-EXCEPTION_HANDLER(#, 204)
-EXCEPTION_HANDLER(#, 205)
-EXCEPTION_HANDLER(#, 206)
-EXCEPTION_HANDLER(#, 207)
-EXCEPTION_HANDLER(#, 208)
-EXCEPTION_HANDLER(#, 209)
-
-EXCEPTION_HANDLER(#, 210)
-EXCEPTION_HANDLER(#, 211)
-EXCEPTION_HANDLER(#, 212)
-EXCEPTION_HANDLER(#, 213)
-EXCEPTION_HANDLER(#, 214)
-EXCEPTION_HANDLER(#, 215)
-EXCEPTION_HANDLER(#, 216)
-EXCEPTION_HANDLER(#, 217)
-EXCEPTION_HANDLER(#, 218)
-EXCEPTION_HANDLER(#, 219)
-
-EXCEPTION_HANDLER(#, 220)
-EXCEPTION_HANDLER(#, 221)
-EXCEPTION_HANDLER(#, 222)
-EXCEPTION_HANDLER(#, 223)
-EXCEPTION_HANDLER(#, 224)
-EXCEPTION_HANDLER(#, 225)
-EXCEPTION_HANDLER(#, 226)
-EXCEPTION_HANDLER(#, 227)
-EXCEPTION_HANDLER(#, 228)
-EXCEPTION_HANDLER(#, 229)
-
-EXCEPTION_HANDLER(#, 230)
-EXCEPTION_HANDLER(#, 231)
-EXCEPTION_HANDLER(#, 232)
-EXCEPTION_HANDLER(#, 233)
-EXCEPTION_HANDLER(#, 234)
-EXCEPTION_HANDLER(#, 235)
-EXCEPTION_HANDLER(#, 236)
-EXCEPTION_HANDLER(#, 237)
-EXCEPTION_HANDLER(#, 238)
-EXCEPTION_HANDLER(#, 239)
-
-EXCEPTION_HANDLER(#, 240)
-EXCEPTION_HANDLER(#, 241)
-EXCEPTION_HANDLER(#, 242)
-EXCEPTION_HANDLER(#, 243)
-EXCEPTION_HANDLER(#, 244)
-EXCEPTION_HANDLER(#, 245)
-EXCEPTION_HANDLER(#, 246)
-EXCEPTION_HANDLER(#, 247)
-EXCEPTION_HANDLER(#, 248)
-EXCEPTION_HANDLER(#, 249)
-
-EXCEPTION_HANDLER(#, 250)
-EXCEPTION_HANDLER(#, 251)
-EXCEPTION_HANDLER(#, 252)
-EXCEPTION_HANDLER(#, 253)
-EXCEPTION_HANDLER(#, 254)
-EXCEPTION_HANDLER(#, 255)
-
-
-common_exception_handler:
-
- |
- | Need to put the format/vector above the PC and status register
- |
-
- move.l %d0,-(%sp) | free a register
- move.w 4(%sp),%d0 | get the format/vector id
-
- |
- | If a bus error or address error then trash the extra
- | data saved on the stack
- |
-
- cmp.w #0x0008,%d0
- beq ceh_10
-
- cmp.w #0x000C,%d0
- beq ceh_10
-
- bra ceh_20
-
-ceh_10:
-
- move.w %d0,12(%sp) | need to move the format/id
- move.l (%sp)+,%d0 | recover d0
- addq #8,%sp | trash the stack
- move.l %d0,-(%sp) | free a register, again
- move.w 4(%sp),%d0 | get the format/vector id
-
-ceh_20:
-
- move.w 6(%sp),4(%sp)
- move.w 8(%sp),6(%sp)
- move.w 10(%sp),8(%sp)
- move.w %d0,10(%sp) | put the format/vector id
- move.l (%sp)+,%d0
-
- |
- | Save all the registers, pass control to a dump trace routine
- |
-
- movem.l %d0-%d7/%a0-%a7,%sp@-
-
- |
- | check to see if ROM is mapped to zero
- |
-
- move.l #trace_exception,%d1 | get the linked address
- and.l #(ROM_SIZE - 1),%d1 | obtain the offset into the ROM
- lea.l %pc@(0),%a0 | were are we currently
- move.l %a0,%d0 | need to use a data register
- and.l #~(ROM_SIZE - 1),%d0 | keep the top part of the address
- or.l %d1,%d0 | apply it to the trace exception offset
- move.l %d0,%a0 | need an address register for jumping
- jsr %a0@(0)
-
-ceh_30:
- jmp ceh_30
-|
-| The RAM based vector table
-|
-
- .sect .vtable
-
- .global vector_table
-
-vector_table:
- .space (256 * 4),0
-
-|
-| Initialised data
-|
-
- .sect .data
-
- .global start_frame
-
-start_frame:
- .space 4,0
-
- .global stack_start
-
-stack_start:
- .space 4,0
-
-|
-| Uninitialised data
-|
-
- .sect .bss
-
- .global environ
- .align 2
-
-environ:
- .long 0
-
- .global heap_size
- .set heap_size,0x2000
-
- .global stack_size
- .set stack_size,0x1000
-
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in b/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in
deleted file mode 100644
index 26fa0b954a..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=crc debugport gdb-hooks main m68302scc m68k-stub memcheck trace \
- bsplibc bsppost bspstart bspclean sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES) $(srcdir)/rom $(srcdir)/debugger
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-$(srcdir)/rom:
-
-$(srcdir)/debugger:
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds $(srcdir)/rom $(srcdir)/debugger ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/bspclean.c b/c/src/lib/libbsp/m68k/ods68302/startup/bspclean.c
deleted file mode 100644
index fbcd753e97..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/bspclean.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine normally is part of start.s and usually returns
- * control to a monitor.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-void bsp_cleanup( void )
-{
-}
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c b/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c
deleted file mode 100644
index a1f9e1dc3c..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-rtems_interrupt_level bsp_isr_level;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- /*
- * Allocate the memory for the RTEMS Work Space. This can come from
- * a variety of places: hard coded address, malloc'ed from outside
- * RTEMS world (e.g. simulator or primitive memory manager), or (as
- * typically done by stock BSPs) by subtracting the required amount
- * of work space from the last physical address on the CPU board.
- */
-#if 0
- Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/;
-#endif
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
-
- BSP_Configuration.work_space_start = (void *)
- (RAM_END - BSP_Configuration.work_space_size);
-
- /*
- * initialize the CPU table for this BSP
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_stack_size = 4096;
-}
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c b/c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c
deleted file mode 100644
index fd8a4146de..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*****************************************************************************/
-/*
- Boot the CPU.
-
- Occurs in 3 phases for a 68302.
-
- Phase 1.
-
- Called as soon as able after reset. The BAR has been programed, and
- a small stack exists in the DPRAM. All interrupts are masked, and
- the processor is running in supervisor mode. No other hardware or
- chip selects are active.
-
- This phase programs the chip select registers, the parallel ports
- are set into default configurations, and basic registers cleared or
- reset. The leds are programmed to show the end of phase 1.
-
- Phase 2.
-
- This is a piece of code which is copied to DPRAM and executed. It
- should not do any more thann is currently present. The return to ROM
- is managed by modifing the return address. Again leds show the status.
-
- Phase 3.
-
- This code executes with a valid C environment. That is the data
- section has been intialised and the bss section set to 0. This phase
- performs any special card initialisation and then calls boot card.
-
- $Id$
-
-*/
-/*****************************************************************************/
-
-#include <bsp.h>
-#include <m68302.h>
-#include <debugport.h>
-#include <crc.h>
-
-/*
- Open the address, reset all registers
- */
-
-void boot_phase_1()
-{
- M302_SCR = SCR_DEFAULT;
-
- WRITE_OR(CSEL_ROM, ROM_SIZE, ROM_WAIT_STATES, OR_MASK_RW, OR_MASK_FC);
- WRITE_BR(CSEL_ROM, RAM_BASE, BR_READ_ONLY, BR_FC_NULL, BR_ENABLED);
- WRITE_OR(CSEL_RAM, RAM_SIZE, RAM_WAIT_STATES, OR_MASK_RW, OR_MASK_FC);
- WRITE_BR(CSEL_RAM, ROM_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
-
-#if defined(CSEL_1)
- WRITE_OR(CSEL_1, CSEL_1_SIZE, CSEL_1_WAIT_STATES, OR_MASK_RW, OR_MASK_FC);
- WRITE_BR(CSEL_1, CSEL_1_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
-#endif
-
-#if defined(CSEL_2)
- WRITE_OR(CSEL_2, CSEL_2_SIZE, CSEL_2_WAIT_STATES, OR_MASK_RW, OR_MASK_FC);
- WRITE_BR(CSEL_2, CSEL_2_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
-#endif
-
- m302.reg.gimr = m302.reg.ipr = m302.reg.imr = m302.reg.isr = 0;
-
- m302.reg.simode = 0;
-
- m302.reg.pacnt = CARD_PA_CONFIGURATION;
- m302.reg.paddr = CARD_PA_DEFAULT_DIRECTIONS;
- m302.reg.padat = CARD_PA_DEFAULT_DATA;
-
- m302.reg.pbcnt = CARD_PB_CONFIGURATION;
- m302.reg.pbddr = CARD_PB_DEFAULT_DIRECTIONS;
- m302.reg.pbdat = CARD_PB_DEFAULT_DATA;
-
- m302.reg.wrr = WATCHDOG_TIMEOUT_PERIOD | WATCHDOG_ENABLE;
-
-#if defined(LED_CONTROL)
- LED_CONTROL(LED_1_RED, LED_2_OFF, LED_3_OFF, LED_4_OFF,
- LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF);
-#endif
-}
-
-/*
- Swap the chip select mapping for ROM and RAM
- */
-
-void boot_phase_2(void)
-{
- rtems_unsigned32 stack;
-
-#if defined(LED_CONTROL)
- LED_CONTROL(LED_1_RED, LED_2_RED, LED_3_OFF, LED_4_OFF,
- LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF);
-#endif
-
- WRITE_BR(CSEL_ROM, ROM_BASE, BR_READ_ONLY, BR_FC_NULL, BR_ENABLED);
- WRITE_BR(CSEL_RAM, RAM_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
-
-#if defined(LED_CONTROL)
- LED_CONTROL(LED_1_GREEN, LED_2_RED, LED_3_OFF, LED_4_OFF,
- LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF);
-#endif
-
- /* seems to want 2, looked at assember code output */
- *(&stack + 2) |= ROM_BASE;
-}
-
-/*
- Any pre-main initialisation, the C environment is setup, how-ever C++
- static constructors have not been called, and RTEMS is not initialised.
- */
-
-void boot_card();
-void set_debug_traps();
-void breakpoint();
-
-void boot_phase_3(void)
-{
- if (GDB_RUN_MONITOR())
- {
- set_debug_traps();
- breakpoint();
- }
-
- debug_port_banner();
-
- /* FIXME : add RAM and ROM checks */
-
- /* boot the bsp, what ever this means */
- boot_card();
-
- WATCHDOG_TRIGGER();
-}
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/crc.c b/c/src/lib/libbsp/m68k/ods68302/startup/crc.c
deleted file mode 100644
index b589ccd2ba..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/crc.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*****************************************************************************/
-/*
- $Id$
-
- CRC 16 Calculation
-
- This module calculates the CRC-16.
-
- */
-/*****************************************************************************/
-
-#include "bsp.h"
-#include "m68302.h"
-#include "crc.h"
-
- /* ----
- C O N S T A N T S
-
- */
-
-static const rtems_unsigned16 factor[] =
- {
- 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241,
- 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440,
- 0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40,
- 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841,
- 0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40,
- 0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41,
- 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641,
- 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040,
- 0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240,
- 0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441,
- 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41,
- 0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840,
- 0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41,
- 0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40,
- 0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640,
- 0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041,
- 0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240,
- 0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441,
- 0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41,
- 0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840,
- 0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41,
- 0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40,
- 0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640,
- 0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041,
- 0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241,
- 0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440,
- 0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40,
- 0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841,
- 0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40,
- 0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41,
- 0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641,
- 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040
- };
-
-/*
- MACRO : calculates a CRC byte wise
- */
-
-#define NEW_CRC(byte, crc) factor[(byte) ^ ((crc) & 0xFF)] ^ (((crc) >> 8) & 0xFF)
-
-/* ----
- CalcCRC
-
- Calculates the CRC value of a block of memory
-*/
-
-rtems_unsigned16 calc_crc(void* vdata, /* pointer to memory block */
- rtems_unsigned32 count) /* length of block in bytes */
-{
- register rtems_unsigned8 *data = vdata;
- register rtems_unsigned16 crc;
- register rtems_unsigned32 byte;
-
- /* initialise to either 0x0 or 0xffff depending on the
- CRC implementation */
-
- crc = 0;
-
- for (byte = count; byte > 0; byte--)
- {
- WATCHDOG_TOGGLE();
- crc = NEW_CRC(*data++, crc);
- }
-
- return crc;
-}
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/debugger b/c/src/lib/libbsp/m68k/ods68302/startup/debugger
deleted file mode 100644
index 6009868468..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/debugger
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * $Id$
- *
- * MC68302 Linker command file
- *
- */
-
-SECTIONS
-{
- .text . :
- {
- text_start = .;
- *(.text)
- etext = .;
- . = ALIGN(4);
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- . = ALIGN(4);
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- }
-
- .vtable (ADDR(.text) + SIZEOF(.text)) :
- {
- vtable_start = .;
- *(.vtable)
- evtable = .;
- }
- .data (ADDR(.vtable) + SIZEOF(.vtable)) :
- {
- data_start = .;
- *(.data)
- edata = .;
- }
- .bss (ADDR(.data) + SIZEOF(.data)) :
- {
- bss_start = .;
- *(.bss)
- *(COMMON)
- end = . ;
- _end = . ;
- }
-}
-
-m302 = MC68302_BASE;
-_VBR = 0; /* location of the VBR table (in RAM) */
-
-ENTRY(start);
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/debugport.c b/c/src/lib/libbsp/m68k/ods68302/startup/debugport.c
deleted file mode 100644
index b4616152a3..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/debugport.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*****************************************************************************/
-/*
- High Level Debug Port Functions
-
- $Id$
-
- */
-/*****************************************************************************/
-
-#include <stdio.h>
-#include <stdarg.h>
-
-#include "debugport.h"
-#include "m68302scc.h"
-#include "bsp.h"
-
-static int initialised;
-
-void debug_port_initialise(void)
-{
- scc_initialise(CONSOLE_PORT, CONSOLE_BAUD, FALSE);
-#if defined(DEBUG_PORT)
- scc_initialise(DEBUG_PORT, DEBUG_BAUD, FALSE);
-#endif
-}
-
-unsigned char debug_port_status(const unsigned char status)
-{
- if (!initialised)
- {
- initialised = 1;
- debug_port_initialise();
- }
-
- return scc_status(CONSOLE_PORT, status);
-}
-
-unsigned char debug_port_in(void)
-{
- if (!initialised)
- {
- initialised = 1;
- debug_port_initialise();
- }
-
- return scc_in(CONSOLE_PORT);
-}
-
-void debug_port_out(const unsigned char character)
-{
- if (!initialised)
- {
- initialised = 1;
- debug_port_initialise();
- }
-
- scc_out(CONSOLE_PORT, character);
-}
-
-void debug_port_write(const char *buffer)
-{
- while (*buffer != '\0')
- {
- debug_port_out(*buffer++);
- }
-}
-
-void debug_port_write_buffer(const char *buffer, unsigned int size)
-{
- unsigned int count;
- for (count = 0; count < size; count++)
- {
- debug_port_out(buffer[count]);
- }
-}
-
-void debug_port_write_hex_uint(const unsigned int value)
-{
- unsigned int bits = sizeof(value) * 8;
- unsigned char c;
-
- do
- {
- bits -= 4;
- c = (unsigned char) ((value >> bits) & 0x0F);
- if (c < 10)
- {
- c += '0';
- }
- else
- {
- c += 'a' - 10;
- }
- debug_port_out((char) c);
- }
- while (bits);
-}
-
-void debug_port_write_hex_ulong(const unsigned long value)
-{
- unsigned int bits = sizeof(value) * 8;
- unsigned char c;
-
- do
- {
- bits -= 4;
- c = (unsigned char) ((value >> bits) & 0x0F);
- if (c < 10)
- {
- c += '0';
- }
- else
- {
- c += 'a' - 10;
- }
- debug_port_out((char) c);
- }
- while (bits);
-}
-
-#define BUFFER_SIZE (256)
-static char buffer[BUFFER_SIZE];
-
-void debug_port_printf(const char *format, ...)
-{
- va_list args;
- int written;
-
- /* gain access to the argument list */
- va_start(args, format);
-
- /* set the trap */
- buffer[BUFFER_SIZE - 2] = '\xAA';
- buffer[BUFFER_SIZE - 1] = '\x55';
-
- /* format the string and send to stdout */
- written = vsprintf(buffer, format, args);
-
- /* try an trap format buffer overflows */
- if ((buffer[BUFFER_SIZE - 2] != '\xAA') ||
- (buffer[BUFFER_SIZE - 1] != '\x55'))
- {
- debug_port_write("debug port buffer overflow, halting...");
- DISABLE_WATCHDOG();
- while (1 == 1);
- }
-
- /* see if an error occurred, if not flush the output buffer */
- if (written != -1)
- {
- debug_port_write_buffer(buffer, written);
- }
-}
-
-void debug_port_banner(void)
-{
-#define CARD_LABEL "ods68302-" #VARIANT
-
- debug_port_write("\n\n\r");
- debug_port_write(_Copyright_Notice);
- debug_port_write("\n\r " CARD_ID "\n\r");
-}
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c b/c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c
deleted file mode 100644
index 64d220219f..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*****************************************************************************/
-/*
- $Id$
-
- Hooks for GDB
-
- */
-/*****************************************************************************/
-
-
-#include <bsp.h>
-#include <m68302.h>
-#include <m68302scc.h>
-
-static int initialised = 0;
-
-void putDebugChar(char ch)
-{
- if (!initialised)
- {
- scc_initialise(DEBUG_PORT, DEBUG_BAUD, 0);
- initialised = 1;
- }
-
- scc_out(DEBUG_PORT, ch);
-}
-
-char getDebugChar(void)
-{
- if (!initialised)
- {
- scc_initialise(DEBUG_PORT, DEBUG_BAUD, 0);
- initialised = 1;
- }
-
- while (!scc_status(DEBUG_PORT, 0));
-
- return scc_in(DEBUG_PORT);
-}
-
-/*
- * Need to create yet another jump table for gdb this time
- */
-
-void (*exceptionHook)(unsigned int) = 0;
-
-typedef struct {
- rtems_unsigned16 move_a7; /* move #FORMAT_ID,%a7@- */
- rtems_unsigned16 format_id;
- rtems_unsigned16 jmp; /* jmp _ISR_Handlers */
- rtems_unsigned32 isr_handler;
-} GDB_HANDLER_ENTRY;
-
-#if !defined(M68K_MOVE_A7)
-#define M68K_MOVE_A7 0x3F3C
-#endif
-
-#if !defined(M68K_JMP)
-#define M68K_JMP 0x4EF9
-#endif
-
-/* points to jsr-exception-table in targets wo/ VBR register */
-static GDB_HANDLER_ENTRY gdb_jump_table[256];
-
-void exceptionHandler(unsigned int vector, void *handler)
-{
- rtems_unsigned32 *interrupt_table = 0;
-
- gdb_jump_table[vector].move_a7 = M68K_MOVE_A7;
- gdb_jump_table[vector].format_id = vector;
- gdb_jump_table[vector].jmp = M68K_JMP;
- gdb_jump_table[vector].isr_handler = (rtems_unsigned32) handler;
-
- interrupt_table[vector] = (rtems_unsigned32) &gdb_jump_table[vector];
-}
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds b/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds
deleted file mode 100644
index 8a9be68783..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * $Id$
- *
- * MC68302 Linker command file
- *
- */
-
-SECTIONS
-{
- .text . :
- {
- text_start = .;
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- etext = .;
- . = ALIGN(4);
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- . = ALIGN(4);
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- }
-
- .vtable 0 :
- {
- vtable_start = .;
- *(.vtable)
- evtable = .;
- }
-
- .data (ADDR(.vtable) + SIZEOF(.vtable)) :
- AT (ADDR(.text) + SIZEOF(.text))
- {
- data_start = .;
- *(.data)
- edata = .;
- }
- .bss (ADDR(.data) + SIZEOF(.data)) :
- {
- bss_start = .;
- *(.bss)
- *(COMMON)
- end = . ;
- _end = . ;
- }
-}
-
-m302 = MC68302_BASE;
-_VBR = ADDR(.vtable); /* location of the VBR table (in RAM) */
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/m68302scc.c b/c/src/lib/libbsp/m68k/ods68302/startup/m68302scc.c
deleted file mode 100644
index 77d7867a21..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/m68302scc.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*****************************************************************************/
-/*
- $Id$
-
- M68302 SCC Polled Driver
-
- */
-/*****************************************************************************/
-
-
-#include <bsp.h>
-#include <m68302.h>
-#include <m68302scc.h>
-
-#define M68302_SCC_COUNT (3)
-
-static volatile m302_SCC_t *scc[M68302_SCC_COUNT] = { 0, 0, 0 };
-static volatile m302_SCC_Registers_t *scc_reg[M68302_SCC_COUNT] = { 0, 0, 0 };
-static int scc_translate[M68302_SCC_COUNT] = { 0, 0, 0 };
-
-static const rtems_unsigned16 baud_clocks[] =
-{
- (SYSTEM_CLOCK / ( 4800 * 16)),
- (SYSTEM_CLOCK / ( 9600 * 16)),
- (SYSTEM_CLOCK / ( 19200 * 16)),
- (SYSTEM_CLOCK / ( 38400 * 16)),
- (SYSTEM_CLOCK / ( 57600 * 16)),
- (SYSTEM_CLOCK / (115700 * 16))
-};
-
-void scc_initialise(int channel, int baud, int translate)
-{
- rtems_unsigned16 scon;
-
- if (channel < M68302_SCC_COUNT)
- {
- scc[channel] = &m302.scc1 + channel;
- scc_reg[channel] = &m302.reg.scc[channel];
- scc_translate[channel] = translate;
-
- scon = (baud_clocks[baud] & 0xF800) == 0 ? 0 : 1;
- scon |= (((baud_clocks[baud] / (1 + scon * 3)) - 1) << 1) & 0x0FFE;
-
- scc_reg[channel]->scon = scon;
- scc_reg[channel]->scm = 0x0171;
-
- scc[channel]->bd.tx[0].status = 0x2000;
- scc[channel]->bd.tx[0].length = 0;
- scc[channel]->bd.tx[0].buffer =
- (rtems_unsigned8*) &(scc[channel]->bd.tx[1].buffer);
-
- scc[channel]->bd.rx[0].status = 0x2000;
- scc[channel]->bd.rx[0].length = 0;
- scc[channel]->bd.rx[0].buffer =
- (rtems_unsigned8*) &(scc[channel]->bd.rx[1].buffer);
-
- scc[channel]->parm.rfcr = 0x50;
- scc[channel]->parm.tfcr = 0x50;
-
- scc[channel]->parm.mrblr = 0x0001;
- scc[channel]->prot.uart.max_idl = 0x0004;
- scc[channel]->prot.uart.brkcr = 1;
- scc[channel]->prot.uart.parec = 0;
- scc[channel]->prot.uart.frmec = 0;
- scc[channel]->prot.uart.nosec = 0;
- scc[channel]->prot.uart.brkec = 0;
- scc[channel]->prot.uart.uaddr1 = 0;
- scc[channel]->prot.uart.uaddr2 = 0;
- scc[channel]->prot.uart.character[0] = 0x0003;
- scc[channel]->prot.uart.character[1] = 0x8000;
-
- scc_reg[channel]->scce = 0xFF;
- scc_reg[channel]->sccm = 0x15;
-
- scc_reg[channel]->scm = 0x17d;
- }
-}
-
-unsigned char scc_status(int channel, unsigned char status)
-{
- rtems_unsigned16 rx_status;
-
- m302.reg.wcn = 0;
-
- if ((channel < M68302_SCC_COUNT) && scc[channel])
- {
- rx_status = scc[channel]->bd.rx[0].status;
-
- if ((rx_status & 0x8000) == 0)
- {
- if (rx_status & 0x003B)
- {
- return 2;
- }
- if (status == 0)
- {
- return 1;
- }
- }
- }
-
- return 0;
-}
-
-unsigned char scc_in(int channel)
-{
- m302.reg.wcn = 0;
-
- if ((channel < M68302_SCC_COUNT) && scc[channel])
- {
- if ((scc[channel]->bd.rx[0].status & 0x8000) == 0)
- {
- unsigned char c;
-
- c = *(scc[channel]->bd.rx[0].buffer);
-
- scc[channel]->bd.rx[0].status = 0xa000;
-
- return c;
- }
- }
-
- return 0;
-}
-
-void scc_out(int channel, unsigned char character)
-{
- if ((channel < M68302_SCC_COUNT) && scc[channel])
- {
- do
- {
- m302.reg.wcn = 0;
- }
- while (scc[channel]->bd.tx[0].status & 0x8000);
-
- *(scc[channel]->bd.tx[0].buffer) = character;
-
- scc[channel]->bd.tx[0].length = 1;
- scc[channel]->bd.tx[0].status = 0xa000;
-
- if (scc_translate[channel])
- {
- if (character == '\n')
- {
- scc_out(channel, '\r');
- }
- }
- }
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c b/c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c
deleted file mode 100644
index 11e14a3efb..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c
+++ /dev/null
@@ -1,1086 +0,0 @@
-/****************************************************************************
-
- THIS SOFTWARE IS NOT COPYRIGHTED
-
- HP offers the following for use in the public domain. HP makes no
- warranty with regard to the software or it's performance and the
- user accepts the software "AS IS" with all faults.
-
- HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
- TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
-****************************************************************************/
-
-/****************************************************************************
- * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
- *
- * Module name: remcom.c $
- * Revision: 1.34 $
- * Date: 91/03/09 12:29:49 $
- * Contributor: Lake Stevens Instrument Division$
- *
- * Description: low level support for gdb debugger. $
- *
- * Considerations: only works on target hardware $
- *
- * Written by: Glenn Engel $
- * ModuleState: Experimental $
- *
- * NOTES: See Below $
- *
- * To enable debugger support, two things need to happen. One, a
- * call to set_debug_traps() is necessary in order to allow any breakpoints
- * or error conditions to be properly intercepted and reported to gdb.
- * Two, a breakpoint needs to be generated to begin communication. This
- * is most easily accomplished by a call to breakpoint(). Breakpoint()
- * simulates a breakpoint by executing a trap #1. The breakpoint instruction
- * is hardwired to trap #1 because not to do so is a compatibility problem--
- * there either should be a standard breakpoint instruction, or the protocol
- * should be extended to provide some means to communicate which breakpoint
- * instruction is in use (or have the stub insert the breakpoint).
- *
- * Some explanation is probably necessary to explain how exceptions are
- * handled. When an exception is encountered the 68000 pushes the current
- * program counter and status register onto the supervisor stack and then
- * transfers execution to a location specified in it's vector table.
- * The handlers for the exception vectors are hardwired to jmp to an address
- * given by the relation: (exception - 256) * 6. These are decending
- * addresses starting from -6, -12, -18, ... By allowing 6 bytes for
- * each entry, a jsr, jmp, bsr, ... can be used to enter the exception
- * handler. Using a jsr to handle an exception has an added benefit of
- * allowing a single handler to service several exceptions and use the
- * return address as the key differentiation. The vector number can be
- * computed from the return address by [ exception = (addr + 1530) / 6 ].
- * The sole purpose of the routine _catchException is to compute the
- * exception number and push it on the stack in place of the return address.
- * The external function exceptionHandler() is
- * used to attach a specific handler to a specific m68k exception.
- * For 68020 machines, the ability to have a return address around just
- * so the vector can be determined is not necessary because the '020 pushes an
- * extra word onto the stack containing the vector offset
- *
- * Because gdb will sometimes write to the stack area to execute function
- * calls, this program cannot rely on using the supervisor stack so it
- * uses it's own stack area reserved in the int array remcomStack.
- *
- *************
- *
- * The following gdb commands are supported:
- *
- * command function Return value
- *
- * g return the value of the CPU registers hex data or ENN
- * G set the value of the CPU registers OK or ENN
- *
- * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
- * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
- *
- * c Resume at current address SNN ( signal NN)
- * cAA..AA Continue at address AA..AA SNN
- *
- * s Step one instruction SNN
- * sAA..AA Step one instruction from AA..AA SNN
- *
- * k kill
- *
- * ? What was the last sigval ? SNN (signal NN)
- *
- * All commands and responses are sent with a packet which includes a
- * checksum. A packet consists of
- *
- * $<packet info>#<checksum>.
- *
- * where
- * <packet info> :: <characters representing the command or response>
- * <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>>
- *
- * When a packet is received, it is first acknowledged with either '+' or '-'.
- * '+' indicates a successful transfer. '-' indicates a failed transfer.
- *
- * Example:
- *
- * Host: Reply:
- * $m0,10#2a +$00010203040506070809101112131415#42
- *
- * $Id$
- *
- ****************************************************************************/
-
-#include <stdio.h>
-#include <string.h>
-#include <setjmp.h>
-
-#include <bsp.h>
-#include <debugport.h>
-
-/************************************************************************
- *
- * external low-level support routines
- */
-typedef void (*ExceptionHook)(int); /* pointer to function with int parm */
-typedef void (*Function)(void); /* pointer to a function */
-
-/* assign an exception handler */
-Function exceptionHandler(int vector, Function handler);
-extern ExceptionHook exceptionHook; /* hook variable for errors/exceptions */
-
-int putDebugChar(char ch);
-char getDebugChar(void);
-
-/************************/
-/* FORWARD DECLARATIONS */
-/************************/
-static int hex(char ch);
-static void getpacket(char *buffer);
-static void putpacket(char *buffer);
-static char* mem2hex(char *mem, char *buf, int count);
-static char* hex2mem(char *buf, char *mem, int count);
-static void handle_buserror(void);
-static int computeSignal(int exceptionVector);
-static int hexToInt(char **ptr, int *intValue);
- void handle_exception(int exceptionVector);
-static void initializeRemcomErrorFrame(void);
-
-void set_debug_traps(void);
-void breakpoint(void);
-
-/************************************************************************/
-/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
-/* at least NUMREGBYTES*2 are needed for register packets */
-#define BUFMAX 400
-
-static char initialized; /* boolean flag. != 0 means we've been initialized */
-
-int remote_debug;
-/* debug > 0 prints ill-formed commands in valid packets & checksum errors */
-
-static const char hexchars[]="0123456789abcdef";
-
-/* there are 180 bytes of registers on a 68020 w/68881 */
-/* many of the fpa registers are 12 byte (96 bit) registers */
-#define NUMREGBYTES 180
-enum regnames {D0,D1,D2,D3,D4,D5,D6,D7,
- A0,A1,A2,A3,A4,A5,A6,A7,
- PS,PC,
- FP0,FP1,FP2,FP3,FP4,FP5,FP6,FP7,
- FPCONTROL,FPSTATUS,FPIADDR
- };
-
-
-/* We keep a whole frame cache here. "Why?", I hear you cry, "doesn't
- GDB handle that sort of thing?" Well, yes, I believe the only
- reason for this cache is to save and restore floating point state
- (fsave/frestore). A cleaner way to do this would be to make the
- fsave data part of the registers which GDB deals with like any
- other registers. This should not be a performance problem if the
- ability to read individual registers is added to the protocol. */
-
-typedef struct FrameStruct
-{
- struct FrameStruct *previous;
- int exceptionPC; /* pc value when this frame created */
- int exceptionVector; /* cpu vector causing exception */
- short frameSize; /* size of cpu frame in words */
- short sr; /* for 68000, this not always sr */
- int pc;
- short format;
- int fsaveHeader;
- int morejunk[0]; /* exception frame, fp save... */
-} Frame;
-
-#define FRAMESIZE 500
-int gdbFrameStack[FRAMESIZE];
-static Frame *lastFrame;
-
-/*
- * these should not be static cuz they can be used outside this module
- */
-int registers[NUMREGBYTES/4];
-int superStack;
-
-#define STACKSIZE 10000
-int remcomStack[STACKSIZE/sizeof(int)];
-static int* stackPtr = &remcomStack[STACKSIZE/sizeof(int) - 1];
-
-/*
- * In many cases, the system will want to continue exception processing
- * when a continue command is given.
- * oldExceptionHook is a function to invoke in this case.
- */
-
-static ExceptionHook oldExceptionHook;
-
-#if defined(__mc68020__)
-/* the size of the exception stack on the 68020 varies with the type of
- * exception. The following table is the number of WORDS used
- * for each exception format.
- */
-const short exceptionSize[] = { 4,4,6,4,4,4,4,4,29,10,16,46,12,4,4,4 };
-#endif
-
-#if defined(__mc68332__)
-static const short exceptionSize[] = { 4,4,6,4,4,4,4,4,4,4,4,4,16,4,4,4 };
-#endif
-
-/************* jump buffer used for setjmp/longjmp **************************/
-jmp_buf remcomEnv;
-
-/*************************** ASSEMBLY CODE MACROS *************************/
-/* */
-
-#if defined(__HAVE_68881__)
-
-/* do an fsave, then remember the address to begin a restore from */
-#define SAVE_FP_REGS() \
- asm(" fsave %a0@-"); \
- asm(" fmovemx %fp0-%fp7,registers+72"); \
- asm(" fmoveml %fpcr/%fpsr/%fpi,registers+168");
-
-#define RESTORE_FP_REGS() \
-asm(" \n\
- fmoveml registers+168,%fpcr/%fpsr/%fpi \n\
- fmovemx registers+72,%fp0-%fp7 \n\
- cmpl #-1,%a0@ | skip frestore flag set ? \n\
- beq skip_frestore \n\
- frestore %a0@+ \n\
-skip_frestore: \n\
-");
-
-#else
-
-#define SAVE_FP_REGS()
-#define RESTORE_FP_REGS()
-
-#endif /* __HAVE_68881__ */
-
-void return_to_super(void);
-void return_to_user(void);
-
-asm("
- .text
-
- .globl return_to_super
- .align 4
-return_to_super:
- movel registers+60,%sp /* get new stack pointer */
- movel lastFrame,%a0 /* get last frame info */
- bra return_to_any
-
- .globl return_to_user
- .align 4
-
-return_to_user:
- movel registers+60,%a0 /* get usp */
- movel %a0,%usp /* set usp */
- movel superStack,%sp /* get original stack pointer */
-
-return_to_any:
- movel lastFrame,%a0 /* get last frame info */
- movel %a0@+,lastFrame /* link in previous frame */
- addql #8,%a0 /* skip over pc, vector#*/
- movew %a0@+,%d0 /* get # of words in cpu frame */
- addw %d0,%a0 /* point to end of data */
- addw %d0,%a0 /* point to end of data */
- movel %a0,%a1
-#
-# copy the stack frame
- subql #1,%d0
-
-copyUserLoop:
- movew %a1@-,%sp@-
- dbf %d0,copyUserLoop
-");
- RESTORE_FP_REGS()
-asm("
- moveml registers,%d0-%d7/%a0-%a6
- rte /* pop and go! */
-");
-
-#define DISABLE_INTERRUPTS() asm(" oriw #0x0700,%sr");
-#define BREAKPOINT() asm(" trap #1");
-
-/* this function is called immediately when a level 7 interrupt occurs */
-/* if the previous interrupt level was 7 then we're already servicing */
-/* this interrupt and an rte is in order to return to the debugger. */
-/* For the 68000, the offset for sr is 6 due to the jsr return address */
-asm("
- .text
- .globl _debug_level7
- .align 4
-
-_debug_level7:
- movew %d0,%sp@-
-");
-
-#if defined(__mc68020__) || defined(__mc68332__)
-asm("
- movew %sp@(2),%d0
-");
-#else
-asm("
- movew %sp@(6),%d0
-");
-#endif
-asm("
- andiw #0x700,%d0
- cmpiw #0x700,%d0
- beq _already7
- movew %sp@+,%d0
- bra _catchException
-_already7:
- movew %sp@+,%d0
-");
-#if defined (__mc68000__) && !defined(__mc68020__)
-asm("
- lea %sp@(4),%sp"); /* pull off 68000 return address */
-#endif
-asm("
- rte
-");
-
-extern void _catchException(void);
-
-#if defined(__mc68020__) || defined(__mc68332__)
-/* This function is called when a 68020 exception occurs. It saves
- * all the cpu and fpcp regs in the _registers array, creates a frame on a
- * linked list of frames which has the cpu and fpcp stack frames needed
- * to properly restore the context of these processors, and invokes
- * an exception handler (remcom_handler).
- *
- * stack on entry: stack on exit:
- * N bytes of junk exception # MSWord
- * Exception Format Word exception # MSWord
- * Program counter LSWord
- * Program counter MSWord
- * Status Register
- *
- *
- */
-asm("
- .text
-
- .globl _catchException
- .align 4
-_catchException:
-");
-
-DISABLE_INTERRUPTS();
-
-asm("
- moveml %d0-%d7/%a0-%a6,registers /* save registers */
- movel lastFrame,%a0 /* last frame pointer */
-");
-SAVE_FP_REGS();
-asm("
- lea registers,%a5 /* get address of registers */
- movew %sp@,%d1 /* get status register */
- movew %d1,%a5@(66) /* save sr */
- movel %sp@(2),%a4 /* save pc in %a4 for later use */
- movel %a4,%a5@(68) /* save pc in _regisers[] */
-
-#
-# figure out how many bytes in the stack frame
-#
- movew %sp@(6),%d0 /* get '020 exception format */
- movew %d0,%d2 /* make a copy of format word */
- andiw #0xf000,%d0 /* mask off format type */
- rolw #5,%d0 /* rotate into the low byte *2 */
- lea exceptionSize,%a1
- addw %d0,%a1 /* index into the table */
- movew %a1@,%d0 /* get number of words in frame */
- movew %d0,%d3 /* save it */
- subw %d0,%a0 /* adjust save pointer */
- subw %d0,%a0 /* adjust save pointer(bytes) */
- movel %a0,%a1 /* copy save pointer */
- subql #1,%d0 /* predecrement loop counter */
-#
-# copy the frame
-#
-saveFrameLoop:
- movew %sp@+,%a1@+
- dbf %d0,saveFrameLoop
-#
-# now that the stack has been clenaed,
-# save the %a7 in use at time of exception
-
- movel %sp,superStack /* save supervisor %sp */
- andiw #0x2000,%d1 /* were we in supervisor mode ? */
- beq userMode
- movel %a7,%a5@(60) /* save %a7 */
- bra a7saveDone
-userMode:
- movel %usp,%a1
- movel %a1,%a5@(60) /* save user stack pointer */
-a7saveDone:
-
-#
-# save size of frame
- movew %d3,%a0@-
-
-#
-# compute exception number
- andl #0xfff,%d2 /* mask off vector offset */
- lsrw #2,%d2 /* divide by 4 to get vect num */
- movel %d2,%a0@- /* save it */
-#
-# save pc causing exception
- movel %a4,%a0@-
-#
-# save old frame link and set the new value
- movel lastFrame,%a1 /* last frame pointer */
- movel %a1,%a0@- /* save pointer to prev frame */
- movel %a0,lastFrame
-
- movel %d2,%sp@- /* push exception num */
- movel exceptionHook,%a0 /* get address of handler */
- jbsr %a0@ /* and call it */
- clrl %sp@ /* replace exception num parm with frame ptr */
- jbsr _returnFromException /* jbsr, but never returns */
-
-");
-
-#else /* mc68000 */
-
-/* This function is called when an exception occurs. It translates the
- * return address found on the stack into an exception vector # which
- * is then handled by either handle_exception or a system handler.
- * _catchException provides a front end for both.
- *
- * stack on entry: stack on exit:
- * Program counter MSWord exception # MSWord
- * Program counter LSWord exception # MSWord
- * Status Register
- * Return Address MSWord
- * Return Address LSWord
- */
-asm("
- .text
- .globl _catchException
- .align 4
-_catchException:
-");
-DISABLE_INTERRUPTS();
-asm("
- moveml %d0-%d7/%a0-%a6,registers /* save registers */
- movel lastFrame,%a0 /* last frame pointer */
-");
-
-SAVE_FP_REGS();
-asm("
- moveq.l #0,%d2
- movew %sp@+,%d2
- lea registers,%a5 /* get address of registers */
-
- moveql #3,%d3 /* assume a three word frame */
-
- cmpiw #3,%d2 /* bus error or address error ? */
- bgt normal /* if >3 then normal error */
- movel %sp@+,%a0@- /* copy error info to frame buff*/
- movel %sp@+,%a0@- /* these are never used */
- moveql #7,%d3 /* this is a 7 word frame */
-
-normal:
- movew %sp@+,%d1 /* pop status register */
- movel %sp@+,%a4 /* pop program counter */
-
- cmpiw #33,%d2 /* trap #1, breakpoint ? */
- bne not_breakpoint
-
- subql #2,%a4 /* trap leaves the pc after the trap */
-
-not_breakpoint:
- movew %d1,%a5@(66) /* save sr */
- movel %a4,%a5@(68) /* save pc in _regisers[] */
- movel %a4,%a0@- /* copy pc to frame buffer */
- movew %d1,%a0@- /* copy sr to frame buffer */
-
- movel %sp,superStack /* save supervisor %sp */
-
- andiw #0x2000,%d1 /* were we in supervisor mode ? */
- beq userMode
- movel %a7,%a5@(60) /* save %a7 */
- bra saveDone
-userMode:
- movel %usp,%a1 /* save user stack pointer */
- movel %a1,%a5@(60) /* save user stack pointer */
-saveDone:
-
- movew %d3,%a0@- /* push frame size in words */
- movel %d2,%a0@- /* push vector number */
- movel %a4,%a0@- /* push exception pc */
-
-#
-# save old frame link and set the new value
-#
- movel lastFrame,%a1 /* last frame pointer */
- movel %a1,%a0@- /* save pointer to prev frame */
- movel %a0,lastFrame
-
- movel %d2,%sp@- /* push exception num */
- movel exceptionHook,%a0 /* get address of handler */
-
- jbsr %a0@ /* and call it */
- clrl %sp@ /* replace exception num parm with frame ptr */
- jbsr _returnFromException /* jbsr, but never returns */
-");
-#endif
-
-
-/*
- * remcomHandler is a front end for handle_exception. It moves the
- * stack pointer into an area reserved for debugger use in case the
- * breakpoint happened in supervisor mode.
- */
-asm("remcomHandler:");
-asm(" addl #4,%sp"); /* pop off return address */
-asm(" movel %sp@+,%d0"); /* get the exception number */
-asm(" movel stackPtr,%sp"); /* move to remcom stack area */
-asm(" movel %d0,%sp@-"); /* push exception onto stack */
-asm(" jbsr handle_exception"); /* this never returns */
-asm(" rts"); /* return */
-
-void _returnFromException(Frame *frame)
-{
- /* if no passed in frame, use the last one */
- if (! frame)
- {
- frame = lastFrame;
- frame->frameSize = 4;
- frame->format = 0;
- frame->fsaveHeader = -1; /* restore regs, but we dont have fsave info*/
- }
-
-#if defined(__mc68000__) && !defined(__mc68020__)
- /* a 68000 cannot use the internal info pushed onto a bus error
- * or address error frame when doing an RTE so don't put this info
- * onto the stack or the stack will creep every time this happens.
- */
- frame->frameSize=3;
-#endif
-
- /* throw away any frames in the list after this frame */
- lastFrame = frame;
-
- frame->sr = registers[(int) PS];
- frame->pc = registers[(int) PC];
-
- if (registers[(int) PS] & 0x2000)
- {
- /* return to supervisor mode... */
- return_to_super();
- }
- else
- { /* return to user mode */
- return_to_user();
- }
-}
-
-int hex(char ch)
-{
- if ((ch >= 'a') && (ch <= 'f')) return (ch-'a'+10);
- if ((ch >= '0') && (ch <= '9')) return (ch-'0');
- if ((ch >= 'A') && (ch <= 'F')) return (ch-'A'+10);
- return (-1);
-}
-
-/* scan for the sequence $<data>#<checksum> */
-void getpacket(char *buffer)
-{
- unsigned char checksum;
- unsigned char xmitcsum;
- int i;
- int count;
- char ch;
-
- do {
- /* wait around for the start character, ignore all other characters */
- while ((ch = (getDebugChar() & 0x7f)) != '$');
- checksum = 0;
- xmitcsum = -1;
-
- count = 0;
-
- /* now, read until a # or end of buffer is found */
- while (count < BUFMAX) {
- ch = getDebugChar() & 0x7f;
- if (ch == '#') break;
- checksum = checksum + ch;
- buffer[count] = ch;
- count = count + 1;
- }
- buffer[count] = 0;
-
- if (ch == '#') {
- xmitcsum = hex(getDebugChar() & 0x7f) << 4;
- xmitcsum += hex(getDebugChar() & 0x7f);
- if ((remote_debug ) && (checksum != xmitcsum)) {
- debug_port_printf ("bad checksum. My count = 0x%x, sent=0x%x. buf=%s\n",
- checksum,xmitcsum,buffer);
- }
-
- if (checksum != xmitcsum) putDebugChar('-'); /* failed checksum */
- else {
- putDebugChar('+'); /* successful transfer */
- /* if a sequence char is present, reply the sequence ID */
- if (buffer[2] == ':') {
- putDebugChar( buffer[0] );
- putDebugChar( buffer[1] );
- /* remove sequence chars from buffer */
- count = strlen(buffer);
- for (i=3; i <= count; i++) buffer[i-3] = buffer[i];
- }
- }
- }
- } while (checksum != xmitcsum);
-}
-
-/* send the packet in buffer. The host get's one chance to read it.
- This routine does not wait for a positive acknowledge. */
-
-
-void
-putpacket(char *buffer)
-{
- unsigned char checksum;
- int count;
- char ch;
-
- /* $<packet info>#<checksum>. */
- do {
- putDebugChar('$');
- checksum = 0;
- count = 0;
-
- while ((ch=buffer[count])) {
- if (! putDebugChar(ch)) return;
- checksum += ch;
- count += 1;
- }
-
- putDebugChar('#');
- putDebugChar(hexchars[checksum >> 4]);
- putDebugChar(hexchars[checksum % 16]);
-
- } while (1 == 0); /* (getDebugChar() != '+'); */
-
-}
-
-char remcomInBuffer[BUFMAX];
-char remcomOutBuffer[BUFMAX];
-static short error;
-
-/* convert the memory pointed to by mem into hex, placing result in buf */
-/* return a pointer to the last char put in buf (null) */
-char *mem2hex(char *mem, char *buf, int count)
-{
- int i;
- unsigned char ch;
-
- if (remote_debug)
- debug_port_printf("mem=0x%x, count=0x%x\n", mem, count);
-
- for (i=0;i<count;i++) {
- ch = *mem++;
- *buf++ = hexchars[ch >> 4];
- *buf++ = hexchars[ch % 16];
- }
- *buf = 0;
- return(buf);
-}
-
-/* convert the hex array pointed to by buf into binary to be placed in mem */
-/* return a pointer to the character AFTER the last byte written */
-char *hex2mem(char *buf, char *mem, int count)
-{
- int i;
- unsigned char ch;
-
- if (remote_debug)
- debug_port_printf("mem=0x%x, count=0x%x\n", mem, count);
-
- for (i=0;i<count;i++) {
- ch = hex(*buf++) << 4;
- ch = ch + hex(*buf++);
- *mem++ = ch;
- }
- return(mem);
-}
-
-/* a bus error has occurred, perform a longjmp
- to return execution and allow handling of the error */
-
-void handle_buserror()
-{
- longjmp(remcomEnv,1);
-}
-
-/* this function takes the 68000 exception number and attempts to
- translate this number into a unix compatible signal value */
-int computeSignal(int exceptionVector)
-{
- int sigval;
- switch (exceptionVector) {
- case 2 : sigval = 10; break; /* bus error */
- case 3 : sigval = 10; break; /* address error */
- case 4 : sigval = 4; break; /* illegal instruction */
- case 5 : sigval = 8; break; /* zero divide */
- case 6 : sigval = 8; break; /* chk instruction */
- case 7 : sigval = 8; break; /* trapv instruction */
- case 8 : sigval = 11; break; /* privilege violation */
- case 9 : sigval = 5; break; /* trace trap */
- case 10: sigval = 4; break; /* line 1010 emulator */
- case 11: sigval = 4; break; /* line 1111 emulator */
-
- /* Coprocessor protocol violation. Using a standard MMU or FPU
- this cannot be triggered by software. Call it a SIGBUS. */
- case 13: sigval = 10; break;
-
- case 31: sigval = 2; break; /* interrupt */
- case 33: sigval = 5; break; /* breakpoint */
-
- /* This is a trap #8 instruction. Apparently it is someone's software
- convention for some sort of SIGFPE condition. Whose? How many
- people are being screwed by having this code the way it is?
- Is there a clean solution? */
- case 40: sigval = 8; break; /* floating point err */
-
- case 48: sigval = 8; break; /* floating point err */
- case 49: sigval = 8; break; /* floating point err */
- case 50: sigval = 8; break; /* zero divide */
- case 51: sigval = 8; break; /* underflow */
- case 52: sigval = 8; break; /* operand error */
- case 53: sigval = 8; break; /* overflow */
- case 54: sigval = 8; break; /* NAN */
- default:
- sigval = 7; /* "software generated"*/
- }
- return (sigval);
-}
-
-/**********************************************/
-/* WHILE WE FIND NICE HEX CHARS, BUILD AN INT */
-/* RETURN NUMBER OF CHARS PROCESSED */
-/**********************************************/
-int hexToInt(char **ptr, int *intValue)
-{
- int numChars = 0;
- int hexValue;
-
- *intValue = 0;
-
- while (**ptr)
- {
- hexValue = hex(**ptr);
- if (hexValue >=0)
- {
- *intValue = (*intValue <<4) | hexValue;
- numChars ++;
- }
- else
- break;
-
- (*ptr)++;
- }
-
- return (numChars);
-}
-
-/*
- * This function does all command procesing for interfacing to gdb.
- */
-void handle_exception(int exceptionVector)
-{
- int sigval;
- int addr, length;
- char * ptr;
- int newPC;
- Frame *frame;
-
- if (remote_debug)
- printf("vector=%d, sr=0x%x, pc=0x%x\n",
- exceptionVector,
- registers[ PS ],
- registers[ PC ]);
-
- /* reply to host that an exception has occurred */
- sigval = computeSignal( exceptionVector );
- remcomOutBuffer[0] = 'S';
- remcomOutBuffer[1] = hexchars[sigval >> 4];
- remcomOutBuffer[2] = hexchars[sigval % 16];
- remcomOutBuffer[3] = 0;
-
- putpacket(remcomOutBuffer);
-
- while (1==1) {
- error = 0;
- remcomOutBuffer[0] = 0;
- getpacket(remcomInBuffer);
- switch (remcomInBuffer[0]) {
- case '?' : remcomOutBuffer[0] = 'S';
- remcomOutBuffer[1] = hexchars[sigval >> 4];
- remcomOutBuffer[2] = hexchars[sigval % 16];
- remcomOutBuffer[3] = 0;
- break;
- case 'd' :
- remote_debug = !(remote_debug); /* toggle debug flag */
- debug_port_printf("debug mode ");
- if (remote_debug)
- {
- debug_port_printf("on\n");
- }
- else
- {
- debug_port_printf("off\n");
- }
- break;
- case 'g' : /* return the value of the CPU registers */
- mem2hex((char*) registers, remcomOutBuffer, NUMREGBYTES);
- break;
- case 'G' : /* set the value of the CPU registers - return OK */
- hex2mem(&remcomInBuffer[1], (char*) registers, NUMREGBYTES);
- strcpy(remcomOutBuffer,"OK");
- break;
-
- /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
- case 'm' :
- if (setjmp(remcomEnv) == 0)
- {
- exceptionHandler(2,handle_buserror);
-
- /* TRY TO READ %x,%x. IF SUCCEED, SET PTR = 0 */
- ptr = &remcomInBuffer[1];
- if (hexToInt(&ptr,&addr))
- if (*(ptr++) == ',')
- if (hexToInt(&ptr,&length))
- {
- ptr = 0;
- mem2hex((char*) addr, remcomOutBuffer, length);
- }
-
- if (ptr)
- {
- strcpy(remcomOutBuffer,"E01");
- if (remote_debug)
- printf("malformed read memory command: %s",remcomInBuffer);
- }
- }
- else {
- exceptionHandler(2,_catchException);
- strcpy(remcomOutBuffer,"E03");
- if (remote_debug)
- printf("bus error");
- }
-
- /* restore handler for bus error */
- exceptionHandler(2,_catchException);
- break;
-
- /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
- case 'M' :
- if (setjmp(remcomEnv) == 0) {
- exceptionHandler(2,handle_buserror);
-
- /* TRY TO READ '%x,%x:'. IF SUCCEED, SET PTR = 0 */
- ptr = &remcomInBuffer[1];
- if (hexToInt(&ptr,&addr))
- if (*(ptr++) == ',')
- if (hexToInt(&ptr,&length))
- if (*(ptr++) == ':')
- {
- hex2mem(ptr, (char*) addr, length);
- ptr = 0;
- strcpy(remcomOutBuffer,"OK");
- }
- if (ptr)
- {
- strcpy(remcomOutBuffer,"E02");
- if (remote_debug)
- printf("malformed write memory command: %s",remcomInBuffer);
- }
- }
- else {
- exceptionHandler(2,_catchException);
- strcpy(remcomOutBuffer,"E03");
- if (remote_debug)
- printf("bus error");
- }
-
- /* restore handler for bus error */
- exceptionHandler(2,_catchException);
- break;
-
- /* cAA..AA Continue at address AA..AA(optional) */
- /* sAA..AA Step one instruction from AA..AA(optional) */
- case 'c' :
- case 's' :
- /* try to read optional parameter, pc unchanged if no parm */
- ptr = &remcomInBuffer[1];
- if (hexToInt(&ptr,&addr))
- registers[ PC ] = addr;
-
- newPC = registers[ PC];
-
- /* clear the trace bit */
- registers[ PS ] &= 0x7fff;
-
- /* set the trace bit if we're stepping */
- if (remcomInBuffer[0] == 's') registers[ PS ] |= 0x8000;
-
- /*
- * look for newPC in the linked list of exception frames.
- * if it is found, use the old frame it. otherwise,
- * fake up a dummy frame in returnFromException().
- */
- if (remote_debug) debug_port_printf("new pc = 0x%x\n",newPC);
-
- frame = lastFrame;
- while (frame)
- {
- if (remote_debug)
- debug_port_printf("frame at 0x%x has pc=0x%x, except#=%d\n",
- frame,frame->exceptionPC,
- (unsigned int) frame->exceptionVector);
- if (frame->exceptionPC == newPC) break; /* bingo! a match */
- /*
- * for a breakpoint instruction, the saved pc may
- * be off by two due to re-executing the instruction
- * replaced by the trap instruction. Check for this.
- */
- if ((frame->exceptionVector == 33) &&
- (frame->exceptionPC == newPC)) break;
- if (frame == frame->previous)
- {
- frame = 0; /* no match found */
- break;
- }
- frame = frame->previous;
- }
-
- /*
- * If we found a match for the PC AND we are not returning
- * as a result of a breakpoint (33),
- * trace exception (9), nmi (31), jmp to
- * the old exception handler as if this code never ran.
- */
- if (frame)
- {
- if ((frame->exceptionVector != 9) &&
- (frame->exceptionVector != 31) &&
- (frame->exceptionVector != 33))
- {
- /*
- * invoke the previous handler.
- */
- if (oldExceptionHook)
- (*oldExceptionHook) (frame->exceptionVector);
- newPC = registers[ PC ]; /* pc may have changed */
- if (newPC != frame->exceptionPC)
- {
- if (remote_debug)
- debug_port_printf("frame at 0x%x has pc=0x%x, except#=%d\n",
- frame,frame->exceptionPC,
- (unsigned int) frame->exceptionVector);
- /* re-use the last frame, we're skipping it (longjump?)*/
- frame = (Frame *) 0;
- _returnFromException( frame ); /* this is a jump */
- }
- }
- }
-
- /* if we couldn't find a frame, create one */
- if (frame == 0)
- {
- frame = lastFrame -1 ;
-
- /* by using a bunch of print commands with breakpoints,
- it's possible for the frame stack to creep down. If it creeps
- too far, give up and reset it to the top. Normal use should
- not see this happen.
- */
- if ((unsigned int) (frame-2) < (unsigned int) &gdbFrameStack)
- {
- initializeRemcomErrorFrame();
- frame = lastFrame;
- }
- frame->previous = lastFrame;
- lastFrame = frame;
- frame = 0; /* null so _return... will properly initialize it */
- }
-
- _returnFromException( frame ); /* this is a jump */
-
- break;
-
- /* kill the program */
- case 'k' :
- /* reset the board */
- WATCHDOG_TRIGGER();
- while (1 == 1);
- break;
-
- } /* switch */
-
- /* reply to the request */
- putpacket(remcomOutBuffer);
- }
-}
-
-
-void initializeRemcomErrorFrame()
-{
- lastFrame = ((Frame *) &gdbFrameStack[FRAMESIZE-1]) - 1;
- lastFrame->previous = lastFrame;
-}
-
-/* this function is used to set up exception handlers for tracing and
- breakpoints */
-void set_debug_traps()
-{
- extern void _debug_level7(void);
- extern void remcomHandler(void);
-
- int exception;
-
- initializeRemcomErrorFrame();
- stackPtr = &remcomStack[STACKSIZE/sizeof(int) - 1];
-
- registers[ PC ] = 0x400;
- registers[ PS ] = 0x2700;
-
- for (exception = 2; exception <= 30; exception++)
- exceptionHandler(exception,_catchException);
-
- /* level 7 interrupt */
- exceptionHandler(31,_debug_level7);
-
- for (exception = 32; exception <= 47; exception++)
- exceptionHandler(exception,_catchException);
-
- /* exclude the unassigned, reserved vector locations */
-
- for (exception = 64; exception <= 255; exception++)
- exceptionHandler(exception,_catchException);
-
- if (oldExceptionHook != (ExceptionHook) remcomHandler)
- {
- oldExceptionHook = exceptionHook;
- exceptionHook = (ExceptionHook) remcomHandler;
- }
-
- initialized = 1;
-
-#if defined(UPDATE_DISPLAY)
- UPDATE_DISPLAY("gdb ");
-#endif
-}
-
-/* This function will generate a breakpoint exception. It is used at the
- beginning of a program to sync up with a debugger and can be used
- otherwise as a quick means to stop program execution and "break" into
- the debugger. */
-
-void breakpoint()
-{
- if (initialized) BREAKPOINT();
-}
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c b/c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c
deleted file mode 100644
index 4341a88e37..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*****************************************************************************/
-/*
- $Id$
-
- Memory check routines.
-
- The production test is a destrucive full test.
- The boot test is a minimal, non-desctructive.
- The partial memory test performs a scetion at a time, and gets
- called in a repeated fashion to completely check the memory,
-
- */
-/*****************************************************************************/
-
-void
-production_memory_test()
-{
-}
-
-void
-boot_memory_test()
-{
-}
-
-void
-reset_partial_memory_test()
-{
-}
-
-void
-partial_memory_test()
-{
-}
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/rom b/c/src/lib/libbsp/m68k/ods68302/startup/rom
deleted file mode 100644
index a8533e08b0..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/rom
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * $Id$
- *
- * MC68302 Linker command file
- *
- */
-
-SECTIONS
-{
- .text . :
- {
- text_start = .;
- *(.text)
- etext = .;
- . = ALIGN(4);
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- . = ALIGN(4);
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- }
-
- .vtable 0 :
- {
- vtable_start = .;
- *(.vtable)
- evtable = .;
- }
-
- .data (ADDR(.vtable) + SIZEOF(.vtable)) :
- AT (ADDR(.text) + SIZEOF(.text))
- {
- data_start = .;
- *(.data)
- edata = .;
- }
- .bss (ADDR(.data) + SIZEOF(.data)) :
- {
- bss_start = .;
- *(.bss)
- *(COMMON)
- end = . ;
- _end = . ;
- }
-}
-
-m302 = MC68302_BASE;
-_VBR = 0; /* location of the VBR table (in RAM) */
-
-
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/trace.c b/c/src/lib/libbsp/m68k/ods68302/startup/trace.c
deleted file mode 100644
index a712c0bb52..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/startup/trace.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*****************************************************************************/
-/*
- $Id$
-
- Trace Exception dumps a back trace to the debug serial port
-
- */
-/*****************************************************************************/
-
-#include <bsp.h>
-#include <debugport.h>
-
-#if 0
-/* FIXME : could get the string to print when in the BSP */
-static const char *exception_names[] =
-{
- "RESET STACK TOP",
- "RESET",
- "BUS ERROR",
- "ADDRESS ERROR",
- "ILLEGAL OPCODE",
- "ZERO DIVIDE",
- "CHK",
- "OVERFLOW",
- "PRIVILEGE",
- "TRACE",
- "LINE 1010 EMULATOR",
- "LINE 1111 EMULATOR",
- "UNASSIGNED 12",
- "UNASSIGNED 13",
- "FORMAT ERROR",
- "UNINITIALISED INTERRUPT",
- "UNASSIGNED 16",
- "NODE ANCHOR",
- "SYSTEM ANCHOR",
- "UNASSIGNED 19",
- "UNASSIGNED 20",
- "UNASSIGNED 21",
- "UNASSIGNED 22",
- "UNASSIGNED 23",
- "SPURIOUS HANDLER",
- "LEVEL 1",
- "LEVEL 2",
- "LEVEL 3",
- "LEVEL 4",
- "LEVEL 5",
- "LEVEL 6",
- "LEVEL 7",
- "TRAP 0",
- "TRAP 1",
- "TRAP 2",
- "TRAP 3",
- "TRAP 4",
- "TRAP 5",
- "TRAP 6",
- "TRAP 7",
- "TRAP 8",
- "TRAP 9",
- "TRAP 10",
- "TRAP 11",
- "TRAP 12",
- "TRAP 13",
- "TRAP 14",
- "TRAP 15"
-};
-#endif
-
-void trace_exception(unsigned long d0,
- unsigned long d1,
- unsigned long d2,
- unsigned long d3,
- unsigned long d4,
- unsigned long d5,
- unsigned long d6,
- unsigned long d7,
- unsigned long a0,
- unsigned long a1,
- unsigned long a2,
- unsigned long a3,
- unsigned long a4,
- unsigned long a5,
- unsigned long a6,
- unsigned long a7,
- unsigned long sr_pch,
- unsigned long pcl_format)
-{
- unsigned int sr = sr_pch >> 16;
- unsigned long pc = (sr_pch << 16) | (pcl_format >> 16);
- unsigned int format = pcl_format & 0xFFFF;
- unsigned int index;
- unsigned char ch;
-
- asm volatile(" orw #0x0700,%sr");
-
- debug_port_banner();
-
- debug_port_write("unhandled exception=");
- debug_port_write_hex_uint(format >> 2);
- debug_port_write("\n");
-
- debug_port_write("sr=");
- debug_port_write_hex_uint(sr);
- debug_port_write(", pc=");
- debug_port_write_hex_ulong(pc);
- debug_port_write("\n");
-
- for (index = 0; index < 16; index++)
- {
- if (index == 8)
- {
- debug_port_write("\n\r");
- }
- if (index < 8)
- {
- debug_port_out('d');
- debug_port_out('0' + index);
- }
- else
- {
- debug_port_out('a');
- debug_port_out('0' + index - 8);
- }
- debug_port_out('=');
- debug_port_write_hex_ulong(*(((unsigned long*) &d0) + index));
- debug_port_out(' ');
- }
-
- for (index = 0; index < (16 * 10); index++)
- {
- if ((index % 16) == 0)
- {
- debug_port_write("\n");
- debug_port_write_hex_ulong((unsigned long) (((char*) &index) + index));
- debug_port_write(" : ");
- }
- else
- {
- debug_port_out(' ');
- }
-
- ch = (*(((char*) &index) + index) >> 4) & 0x0F;
-
- if (ch < 10)
- {
- ch += '0';
- }
- else
- {
- ch += 'a' - 10;
- }
-
- debug_port_out((char) ch);
-
- ch = *(((char*) &index) + index) & 0x0F;
-
- if (ch < 10)
- {
- ch += '0';
- }
- else
- {
- ch += 'a' - 10;
- }
- debug_port_out((char) ch);
- }
-
- debug_port_write("\nhalting cpu...");
-
-#if defined(UPDATE_DISPLAY)
- UPDATE_DISPLAY("HALT");
-#endif
-
- WATCHDOG_TRIGGER();
- while (1 == 1);
-}
diff --git a/c/src/lib/libbsp/m68k/ods68302/timer/Makefile.in b/c/src/lib/libbsp/m68k/ods68302/timer/Makefile.in
deleted file mode 100644
index 24809cbed8..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=timerisr
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/m68k/ods68302/timer/timer.c b/c/src/lib/libbsp/m68k/ods68302/timer/timer.c
deleted file mode 100644
index d8e410ad85..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/timer/timer.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/* Timer_init()
- *
- * This routine initializes TIMER 2 for an MC68302.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include "m68302.h"
-
-
-#define TMR2_VAL 0x071b /* Timer mode register
- * (section 3.5.2.1 in 68302 manual)
- * 15-8: "7" prescaler divide by 8 (x+1)
- * 7-6: 00 dis. intr. on capture event
- * 5: 0 active-low pulse
- * 4: 1 intr. on reaching reference
- * 3: 1 restart counter on reference
- * 2-1: 01 master clock input source
- * 0: 1 enable timer
- */
-#define TRR2_VAL 2000 /* Timer reference register
- * (section 3.5.2.2 in 68302 manual)
- * 2000 ticks @ (16MHz/1)/8 = 1-ms count
- */
-
-rtems_unsigned32 Timer_interrupts;
-
-rtems_boolean Timer_driver_Find_average_overhead;
-
-rtems_isr timerisr();
-
-void Timer_initialize( void )
-{
- m302.reg.tmr2 = 0; /* disable timer */
-
- Timer_interrupts = 0; /* clear timer ISR count */
-
- m302.reg.trr2 = TRR2_VAL; /* set timer reference register */
- m302.reg.tmr2 = TMR2_VAL; /* set timer mode register */
- m302.reg.imr |= RBIT_IMR_TIMER2; /* set 68302 int-mask to allow ints */
-}
-
-/*
- * The following controls the behavior of Read_timer().
- *
- * FIND_AVG_OVERHEAD * instructs the routine to return the "raw" count.
- *
- * AVG_OVEREHAD is the overhead for starting and stopping the timer. It
- * is usually deducted from the number returned.
- *
- * LEAST_VALID is the lowest number this routine should trust. Numbers
- * below this are "noise" and zero is returned.
- */
-
-#define AVG_OVERHEAD 0 /* It typically takes X.X microseconds */
- /* (Y countdowns) to start/stop the timer. */
- /* This value is in microseconds. */
-#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-
-/*
- * Return timer value in 1/2-microsecond units
- */
-int Read_timer( void )
-{
- rtems_unsigned16 clicks;
- rtems_unsigned32 total;
-
- /*
- * Read the timer and see how many clicks it has been since counter
- * rolled over.
- */
-
- clicks = m302.reg.tcn2;
-
- /*
- * Total is calculated by taking into account the number of timer overflow
- * interrupts since the timer was initialized and clicks since the last
- * interrupts.
- */
-
- total = (Timer_interrupts * TRR2_VAL) + clicks;
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in XXX microsecond units */
-
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
-
- /*
- * Convert 1/2-microsecond count into microseconds
- */
-
- return (total - AVG_OVERHEAD) >> 1;
-}
-
-
-/*
- * Empty function call used in loops to measure basic cost of looping
- * in Timing Test Suite.
- */
-
-rtems_status_code Empty_function(void)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/m68k/ods68302/timer/timerisr.s b/c/src/lib/libbsp/m68k/ods68302/timer/timerisr.s
deleted file mode 100644
index c804b9dfa6..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/timer/timerisr.s
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Handle 68302 TIMER2 interrupts.
- *
- * All code in this routine is pure overhead which can perturb the
- * accuracy of RTEMS' timing test suite.
- *
- * See also: Read_timer()
- *
- * To reduce overhead this is best to be the "rawest" hardware interupt
- * handler you can write. This should be the only interrupt which can
- * occur during the measured time period.
- *
- * An external counter, Timer_interrupts, is incremented.
- *
- * $Id$
- */
-
-#include "asm.h"
-
-BEGIN_CODE
- PUBLIC(timerisr)
-SYM(timerisr):
- move.w #0x0040,SYM(m302)+2072 | clear interrupt in-service bit
- move.b #3,SYM(m302)+2137 | clear timer interrupt event register
- addq.l #1,SYM(Timer_interrupts) | increment timer value
- rte
-END_CODE
-END
diff --git a/c/src/lib/libbsp/m68k/ods68302/wrapup/Makefile.in b/c/src/lib/libbsp/m68k/ods68302/wrapup/Makefile.in
deleted file mode 100644
index a42a827299..0000000000
--- a/c/src/lib/libbsp/m68k/ods68302/wrapup/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console timer
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/m68k/shared/setvec.c b/c/src/lib/libbsp/m68k/shared/setvec.c
deleted file mode 100644
index baf7fdb385..0000000000
--- a/c/src/lib/libbsp/m68k/shared/setvec.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * This routine installs an interrupt vector using the basic
- * RTEMS mechanisms. This implementation should be suitable for
- * most m68k based boards. However, if the board has an unusual
- * interrupt controller or most somehow manipulate board specific
- * hardware to enable/disable, mask, prioritize, etc an interrupt
- * source, then this routine should be customized to support that.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-m68k_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- m68k_isr_entry previous_isr;
-
- if ( type )
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
- else {
- _CPU_ISR_install_raw_handler( vector, handler, (void *)&previous_isr );
- }
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/mips/README b/c/src/lib/libbsp/mips/README
deleted file mode 100644
index 7f16e33d39..0000000000
--- a/c/src/lib/libbsp/mips/README
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# $Id$
-#
-
-The MIPS bsp are now called p4600 and p4650, referring to which cpu they use.
-The same bsp sub-directory can be used, the cpu is selected by the bsp
-specific makefiles (p4600.cfg and p4650.cfg).
diff --git a/c/src/lib/libbsp/mips/p4000/README b/c/src/lib/libbsp/mips/p4000/README
deleted file mode 100644
index 361366d01d..0000000000
--- a/c/src/lib/libbsp/mips/p4000/README
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# $Id$
-#
-# @(#)README 08/20/96 1.2
-#
-
-BSP NAME: p4000
-BOARD: Algorithmics P4000 SBC
-BUS: N/A
-CPU FAMILY: mips
-CPU: IDT 4650
-COPROCESSORS: N/A
-MODE: 32 bit mode
-
-DEBUG MONITOR: IDT/SIM
-
-PERIPHERALS
-===========
-TIMERS: 4650 internal
- RESOLUTION: half of internal clock frequency
-SERIAL PORTS: IDT/SIM controlled
-REAL-TIME CLOCK: none
-DMA: none
-VIDEO: none
-SCSI: none
-NETWORKING: none
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: 4650 internal
-IOSUPP DRIVER: N/A
-SHMSUPP: N/A
-TIMER DRIVER: 4650 internal
-TTY DRIVER: uses IDT/SIM
-
-STDIO
-=====
-PORT: Console port 0
-ELECTRICAL: RS-232
-BAUD: 9600
-BITS PER CHARACTER: 8
-PARITY: None
-STOP BITS: 1
-
-NOTES
-=====
-
diff --git a/c/src/lib/libbsp/mips/p4000/bsp_specs b/c/src/lib/libbsp/mips/p4000/bsp_specs
deleted file mode 100644
index 3f488f47b6..0000000000
--- a/c/src/lib/libbsp/mips/p4000/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: idt_csu.o%s} \
-%{qrtems_debug: idt_csu_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/mips/p4000/console/console.c b/c/src/lib/libbsp/mips/p4000/console/console.c
deleted file mode 100644
index c862c91cfa..0000000000
--- a/c/src/lib/libbsp/mips/p4000/console/console.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * This file contains the IDT 4650 console IO package.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/lib/libbsp/no_cpu/no_bsp/console/console.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)console.c 08/20/96 1.6\n";
- */
-
-
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <ctype.h>
-
-char idtsim_getchar( void );
-void idtsim_putchar( char c );
-void mips_leddisplay( char a, char b, char c, char d );
-
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-}
-
-
-/* is_character_ready
- *
- * This routine returns TRUE if a character is available.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_boolean is_character_ready(
- char *ch
-)
-{
- *ch = '\0'; /* return NULL for no particular reason */
- return(TRUE);
-}
-
-/* inbyte
- *
- * This routine reads a character from the SOURCE.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- * character read from SOURCE
- */
-
-char inbyte( void )
-{
- /*
- * If polling, wait until a character is available.
- */
-
- return idtsim_getchar();
-}
-
-/* outbyte
- *
- * This routine transmits a character out the SOURCE. It may support
- * XON/XOFF flow control.
- *
- * Input parameters:
- * ch - character to be transmitted
- *
- * Output parameters: NONE
- */
-
-void outbyte(
- char ch
-)
-{
-#define NUM_LEDS 4
- static unsigned int cur_led = 0;
- static unsigned char led_chars[NUM_LEDS];
-
- /*
- * If polling, wait for the transmitter to be ready.
- * Check for flow control requests and process.
- * Then output the character.
- */
-
- idtsim_putchar( ch );
-
- /* print out first four alpha numeric characters in a line */
- if ( ch == '\n' )
- {
- mips_leddisplay( led_chars[0], led_chars[1], led_chars[2], led_chars[3] );
- cur_led = 0;
- }
- else if ( isalnum( (unsigned char) ch ) && cur_led < NUM_LEDS )
- {
- led_chars[cur_led++] = ch;
- }
-
-}
-
-
-#if 0
-static int console_fd = -1;
-#endif
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
-#if 0
- int console_fd = open("tty0", 2); /* open for read/write */
-#endif
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
-#if 0
- if ( console_fd )
- close( console_fd );
-#endif
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte();
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r');
- }
- outbyte( buffer[ count ] );
- }
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/mips/p4000/console/led.S b/c/src/lib/libbsp/mips/p4000/console/led.S
deleted file mode 100644
index e62b82e041..0000000000
--- a/c/src/lib/libbsp/mips/p4000/console/led.S
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtmon.h>
-#include <rtems/score/idtcpu.h>
-
-
-FRAME(mips_leddisplay,sp,0,ra)
- j ra
- nop
-ENDFRAME(mips_leddisplay)
-
-FRAME(sbddisplay,sp,0,ra)
- j ra
-ENDFRAME(sbddisplay)
-
-
-FRAME(sbdblank,sp,0,ra)
- j ra
-ENDFRAME(sbdblank)
-
diff --git a/c/src/lib/libbsp/mips/p4000/include/bsp.h b/c/src/lib/libbsp/mips/p4000/include/bsp.h
deleted file mode 100644
index da700b8dba..0000000000
--- a/c/src/lib/libbsp/mips/p4000/include/bsp.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* bsp.h
- *
- * This include file contains all board IO definitions.
- *
- * XXX : put yours in here
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-/* @(#)bsp.h 03/15/96 1.1 */
-
-#ifndef __P4000_BSP_h
-#define __P4000_BSP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <console.h>
-#include <clockdrv.h>
-
-extern void WriteDisplay( char * string );
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Stuff for Time Test 27
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), 0, 1 )
-
-#define Cause_tm27_intr()
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-extern unsigned32 mips_get_timer( void );
-
-#define CPU_CLOCK_RATE_MHZ (50)
-#define CLOCKS_PER_MICROSECOND ( CPU_CLOCK_RATE_MHZ ) /* equivalent to CPU clock speed in MHz */
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- *
- * NOTE: This macro generates a warning like "integer constant out
- * of range" which is safe to ignore. In 64 bit mode, unsigned32
- * types are actually 64 bits long so that comparisons between
- * unsigned32 types and pointers are valid. The warning is caused
- * by code in the delay macro that is necessary for 64 bit mode.
- */
-
-#define delay( microseconds ) \
- { \
- unsigned32 _end_clock = mips_get_timer() + microseconds * CLOCKS_PER_MICROSECOND; \
- _end_clock %= 0x100000000; /* make sure result is 32 bits */ \
- \
- /* handle timer overflow, if necessary */ \
- while ( _end_clock < mips_get_timer() ); \
- \
- while ( _end_clock > mips_get_timer() ); \
- }
-
-/* Constants */
-
-#define RAM_START 0
-#define RAM_END 0x100000
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* miscellaneous stuff assumed to exist */
-
-mips_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/mips/p4000/include/coverhd.h b/c/src/lib/libbsp/mips/p4000/include/coverhd.h
deleted file mode 100644
index aca390463b..0000000000
--- a/c/src/lib/libbsp/mips/p4000/include/coverhd.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- * This file should be updated after running the C overhead timing
- * test. Once this update has been performed, the RTEMS Time Test
- * Suite should be rebuilt to account for these overhead times in the
- * timing results.
- *
- * NOTE: If these are all zero, then the times reported include
- * all calling overhead including passing of arguments.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-/* @(#)coverhd.h 04/08/96 1.3 */
-
-#ifndef __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 5
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 4
-#define CALLING_OVERHEAD_TASK_CREATE 6
-#define CALLING_OVERHEAD_TASK_IDENT 4
-#define CALLING_OVERHEAD_TASK_START 5
-#define CALLING_OVERHEAD_TASK_RESTART 4
-#define CALLING_OVERHEAD_TASK_DELETE 4
-#define CALLING_OVERHEAD_TASK_SUSPEND 4
-#define CALLING_OVERHEAD_TASK_RESUME 4
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 5
-#define CALLING_OVERHEAD_TASK_MODE 4
-#define CALLING_OVERHEAD_TASK_GET_NOTE 5
-#define CALLING_OVERHEAD_TASK_SET_NOTE 5
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 9
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 4
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 5
-#define CALLING_OVERHEAD_CLOCK_GET 9
-#define CALLING_OVERHEAD_CLOCK_SET 8
-#define CALLING_OVERHEAD_CLOCK_TICK 3
-
-#define CALLING_OVERHEAD_TIMER_CREATE 4
-#define CALLING_OVERHEAD_TIMER_IDENT 4
-#define CALLING_OVERHEAD_TIMER_DELETE 4
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 6
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 10
-#define CALLING_OVERHEAD_TIMER_RESET 4
-#define CALLING_OVERHEAD_TIMER_CANCEL 4
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 5
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 4
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 4
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 5
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 5
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 5
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 5
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 4
-
-#define CALLING_OVERHEAD_EVENT_SEND 4
-#define CALLING_OVERHEAD_EVENT_RECEIVE 5
-#define CALLING_OVERHEAD_SIGNAL_CATCH 5
-#define CALLING_OVERHEAD_SIGNAL_SEND 4
-#define CALLING_OVERHEAD_PARTITION_CREATE 6
-#define CALLING_OVERHEAD_PARTITION_IDENT 4
-#define CALLING_OVERHEAD_PARTITION_DELETE 4
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 4
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 4
-#define CALLING_OVERHEAD_REGION_CREATE 6
-#define CALLING_OVERHEAD_REGION_IDENT 4
-#define CALLING_OVERHEAD_REGION_DELETE 4
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 5
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 4
-#define CALLING_OVERHEAD_PORT_CREATE 6
-#define CALLING_OVERHEAD_PORT_IDENT 4
-#define CALLING_OVERHEAD_PORT_DELETE 4
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 4
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 4
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 5
-#define CALLING_OVERHEAD_IO_OPEN 5
-#define CALLING_OVERHEAD_IO_CLOSE 5
-#define CALLING_OVERHEAD_IO_READ 5
-#define CALLING_OVERHEAD_IO_WRITE 5
-#define CALLING_OVERHEAD_IO_CONTROL 5
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 4
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 3
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/mips/p4000/liblnk/lnklib.S b/c/src/lib/libbsp/mips/p4000/liblnk/lnklib.S
deleted file mode 100644
index ae2509ce3c..0000000000
--- a/c/src/lib/libbsp/mips/p4000/liblnk/lnklib.S
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtcpu.h>
-
-#define FRAME(name,frm_reg,offset,ret_reg) \
- .globl name; \
- .ent name; \
-name:; \
- .frame frm_reg,offset,ret_reg
-
-#define ENDFRAME(name) \
- .end name
-
-#define PROM_LINK(name,entry) \
- .globl name; \
- .ent name; \
-name: la $2,+entry; \
- j $2; \
- .end name
-
-#define PROM_ENTRY(x) (0xbfc00000+((x)*8))
-
-#define PROM_RESET PROM_ENTRY(0)
-#define PROM_NOT_IMP PROM_ENTRY(1)
-#define PROM_RESTART PROM_ENTRY(2)
-#define PROM_REINIT PROM_ENTRY(3)
-#define PROM_GETCHAR PROM_ENTRY(11)
-#define PROM_PUTCHAR PROM_ENTRY(12)
-#define PROM_SHOWCHAR PROM_ENTRY(13)
-#define PROM_PRINTF PROM_ENTRY(16)
-#define PROM_RETURN PROM_ENTRY(17)
-
-#define PROM_RGETS PROM_ENTRY(25)
-#define PROM_FLUSHCACHE PROM_ENTRY(28)
-#define PROM_CLEARCACHE PROM_ENTRY(29)
-#define PROM_SETJMP PROM_ENTRY(30)
-#define PROM_LONGJMP PROM_ENTRY(31)
-
- .text
-
-PROM_LINK(idtsim_putchar, PROM_PUTCHAR)
-PROM_LINK(idtsim_getchar, PROM_GETCHAR)
-PROM_LINK(idtsim_showchar, PROM_SHOWCHAR)
-PROM_LINK(idtsim__exit, PROM_RETURN)
-PROM_LINK(idtsim_reinit, PROM_REINIT)
-PROM_LINK(idtsim_restart, PROM_RESTART)
-PROM_LINK(idtsim_reset, PROM_RESET)
-PROM_LINK(idtsim_promexit, PROM_RETURN)
-PROM_LINK(idtsim_setjmp, PROM_SETJMP)
-PROM_LINK(idtsim_longjmp, PROM_LONGJMP)
-
-FRAME(idtsim_init_sbrk,sp,0,ra)
- j ra
-ENDFRAME(idtsim_init_sbrk)
-
-FRAME(idtsim_init_file,sp,0,ra)
- j ra
-ENDFRAME(idtsim_init_file)
-
diff --git a/c/src/lib/libbsp/mips/p4000/start/start.S b/c/src/lib/libbsp/mips/p4000/start/start.S
deleted file mode 100644
index 8dc31c8999..0000000000
--- a/c/src/lib/libbsp/mips/p4000/start/start.S
+++ /dev/null
@@ -1,299 +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$
-*/
-
-/*************************************************************************
-**
-** Copyright 1991-95 Integrated Device Technology, Inc.
-** All Rights Reserved
-**
-** idt_csu.S -- IDT stand alone startup code
-**
-**************************************************************************/
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtcpu.h>
-#include <rtems/score/idtmon.h>
-
-
-.extern _fbss,4 /* this is defined by the linker */
-.extern end,4 /* this is defined by the linker */
-
-.lcomm sim_mem_cfg_struct,12
-
- .text
-
-
-#define TMP_STKSIZE 1024
-
-/**************************************************************************
-**
-** start - Typicl standalone start up code required for R3000/R4000
-**
-**
-** 1) Initialize the STATUS Register
-** a) Clear parity error bit
-** b) Set co_processor 1 usable bit ON
-** c) Clear all IntMask Enables
-** d) Set kernel/disabled mode
-** 2) Initialize Cause Register
-** a) clear software interrupt bits
-** 3) Determine FPU installed or not
-** if not, clear CoProcessor 1 usable bit
-** 4) Clear bss area
-** 5) MUST allocate temporary stack until memory size determined
-** It MUST be uncached to prevent overwriting when caches are cleared
-** 6) Install exception handlers
-** 7) Determine memory and cache sizes
-** 8) Establish permanent stack (cached or uncached as defined by bss)
-** 9) Flush Instruction and Data caches
-** 10) If there is a Translation Lookaside Buffer, Clear the TLB
-** 11) Execute initialization code if the IDT/c library is to be used
-**
-** 12) Jump to user's "main()"
-** 13) Jump to promexit
-**
-** IDT/C 5.x defines _R3000, IDT/C 6.x defines _R4000 internally.
-** This is used to mark code specific to R3xxx or R4xxx processors.
-** IDT/C 6.x defines __mips to be the ISA level for which we're
-** generating code. This is used to make sure the stack etc. is
-** double word aligned, when using -mips3 (default) or -mips2,
-** when compiling with IDT/C6.x
-**
-***************************************************************************/
-
-FRAME(start,sp,0,ra)
-
- .set noreorder
-#ifdef _R3000
- li v0,SR_PE|SR_CU1 /* reset parity error and set */
- /* cp1 usable */
-#endif
-#ifdef _R4000
-#if __mips==3 || defined(R4650)
- li v0,SR_CU1|SR_DE|SR_FR /* initally clear ERL, enable FPA 64bit regs*/
- /* 4650: Need fr to be set anyway */
-#else
- li v0,SR_CU1|SR_DE /* initally clear ERL, enable FPA 32bit regs*/
-#endif mips3
-#endif
-
- mtc0 v0,C0_SR /* clr IntMsks/ kernel/disabled mode */
- nop
- mtc0 zero,C0_CAUSE /* clear software interrupts */
- nop
-
-#ifdef _R4000
- li v0,CFG_C_NONCOHERENT # initialise default cache mode
- mtc0 v0,C0_CONFIG
-#endif
-
-/*
-** check to see if an fpu is really plugged in
-*/
- li t3,0xaaaa5555 /* put a's and 5's in t3 */
- mtc1 t3,fp0 /* try to write them into fp0 */
- mtc1 zero,fp1 /* try to write zero in fp */
- mfc1 t0,fp0
- mfc1 t1,fp1
- nop
- bne t0,t3,1f /* branch if no match */
- nop
- bne t1,zero,1f /* double check for positive id */
- nop
- /* We have a FPU. clear fcsr */
- ctc1 zero, fcr31
- j 2f /* status register already correct */
- nop
-1:
-#ifdef _R3000
- li v0, SR_PE /* reset parity error/NO cp1 usable */
-#endif
-
-#ifdef _R4000
- li v0,SR_DE /* clear ERL and disable FPA */
-#endif
-
- mtc0 v0, C0_SR /* reset status register */
-2:
- la gp, _gp
-
- la v0,_fbss /* clear bss before using it */
- la v1,end /* end of bss */
-3: sw zero,0(v0)
- bltu v0,v1,3b
- add v0,4
-
-
-/************************************************************************
-**
-** Temporary Stack - needed to handle stack saves until
-** memory size is determined and permanent stack set
-**
-** MUST be uncached to avoid confusion at cache
-** switching during memory sizing
-**
-*************************************************************************/
-#if __mips==3
- /* For MIPS 3, we need to be sure that the stack is aligned on a
- * double word boundary.
- */
- andi t0, v0, 0x7
- beqz t0, 11f /* Last three bits Zero, already aligned */
- nop
- add v0, 4
-11:
-#endif
-
- or v0, K1BASE /* switch to uncached */
- add v1, v0, TMP_STKSIZE /* end of bss + length of tmp stack */
- sub v1, v1, (4*4) /* overhead */
- move sp, v1 /* set sp to top of stack */
-4: sw zero, 0(v0)
- bltu v0, v1, 4b /* clear out temp stack */
- add v0, 4
-
- jal init_exc_vecs /* install exception handlers */
- nop /* MUST do before memory probes */
-
- la v0, 5f
- li v1, K1BASE /* force into uncached space */
- or v0, v1 /* during memory/cache probes */
- j v0
- nop
-5:
- la a0, sim_mem_cfg_struct
- jal sim_mem_cfg /* Make SIM call to get mem size */
- nop
- la a0, sim_mem_cfg_struct
- lw a0, 0(a0) /* Get memory size from struct */
-#ifdef _R3000
- jal config_Icache
- nop
- jal config_Dcache /* determine size of D & I caches */
- nop
-#endif
-#ifdef _R4000
- jal config_cache /* determine size of D & I caches */
- nop
-#endif
-
- move v0, a0 /* mem_size */
-
-#if __mips==3
- /* For MIPS 3, we need to be sure that the stack (and hence v0
- * here) is aligned on a double word boundary.
- */
- andi t0, v0, 0x7
- beqz t0, 12f /* Last three bits Zero, already aligned */
- nop
- subu v0, 4 /* mem_size was not aligned on doubleword bdry????*/
-12:
-#endif
-
-
-
-/**************************************************************************
-**
-** Permanent Stack - now know top of memory, put permanent stack there
-**
-***************************************************************************/
-
- la t2, _fbss /* cache mode as linked */
- and t2, 0xF0000000 /* isolate segment */
- la t1, 6f
- j t1 /* back to original cache mode */
- nop
-6:
- or v0, t2 /* stack back to original cache mode */
- addiu v0,v0,-16 /* overhead */
- move sp, v0 /* now replace count w top of memory */
- move v1, v0
- subu v1, P_STACKSIZE /* clear requested stack size */
-
-7: sw zero, 0(v1) /* clear P_STACKSIZE stack */
- bltu v1,v0,7b
- add v1, 4
- .set reorder
-
-#ifdef _R3000
- jal flush_Icache
- jal flush_Dcache /* flush Data & Instruction caches */
-#endif
-#ifdef _R4000
- jal flush_cache_nowrite /* flush Data & Instruction caches */
-#endif
-
-
-
-/**************************************************************************
-**
-** If this chip supports a Translation Lookaside Buffer, clear it
-**
-***************************************************************************/
-
- .set noreorder
- mfc0 t1, C0_SR /* look at Status Register */
- nop
- .set reorder
-#ifdef _R3000
- li t2, SR_TS /* TLB Shutdown bit */
- and t1,t2 /* TLB Shutdown if 1 */
- bnez t1, 8f /* skip clearing if no TLB */
-#endif
-
-#ifndef R4650
- jal init_tlb /* clear the tlb */
-#endif
-
-
-/************************************************************************
-**
-** Initialization required if using IDT/c or libc.a, standard C Lib
-**
-** can SKIP if not necessary for application
-**
-************************************************************************/
-8:
-
- jal idtsim_init_sbrk
- jal idtsim_init_file
-/*********************** END I/O initialization **********************/
-
-
- jal main
-
- jal idtsim_promexit
-
-ENDFRAME(start)
-
-
- .globl sim_mem_cfg
-sim_mem_cfg:
- .set noat
- .set noreorder
- li AT, (0xbfc00000+((55)*8))
- jr AT
- nop
- .set at
- .set reorder
diff --git a/c/src/lib/libbsp/mips/p4000/startup/bspclean.c b/c/src/lib/libbsp/mips/p4000/startup/bspclean.c
deleted file mode 100644
index 5382c8491c..0000000000
--- a/c/src/lib/libbsp/mips/p4000/startup/bspclean.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine normally is part of start.s and usually returns
- * control to a monitor.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)bspclean.c 03/15/96 1.1\n";
- */
-
-
-
-#include <rtems.h>
-#include <bsp.h>
-
-void idtsim__exit();
-
-void bsp_cleanup( void )
-{
- idtsim__exit();
-}
diff --git a/c/src/lib/libbsp/mips/p4000/startup/bspstart.c b/c/src/lib/libbsp/mips/p4000/startup/bspstart.c
deleted file mode 100644
index bdd0c3074d..0000000000
--- a/c/src/lib/libbsp/mips/p4000/startup/bspstart.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)bspstart.c 06/11/96 1.2\n";
- */
-
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-#define LIBC_HEAP_SIZE (64 * 1024)
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, LIBC_HEAP_SIZE, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-extern int end; /* defined by linker */
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- /*
- * Allocate the memory for the RTEMS Work Space. This can come from
- * a variety of places: hard coded address, malloc'ed from outside
- * RTEMS world (e.g. simulator or primitive memory manager), or (as
- * typically done by stock BSPs) by subtracting the required amount
- * of work space from the last physical address on the CPU board.
- */
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
-
- BSP_Configuration.work_space_start =
- (void *)((unsigned64)((&end) + LIBC_HEAP_SIZE + 0x2000) & ~0x7);
-
- /*
- * initialize the CPU table for this BSP
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_stack_size = 4096;
-}
diff --git a/c/src/lib/libbsp/mips/p4000/startup/ghlinkcmds b/c/src/lib/libbsp/mips/p4000/startup/ghlinkcmds
deleted file mode 100644
index 34cdbab802..0000000000
--- a/c/src/lib/libbsp/mips/p4000/startup/ghlinkcmds
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# $Id$
-#
-
--map
--sec
-{
- .text 0x80010000 :
- .data align(16) :
- .rodata :
- .fini :
-# .sdata :
- .symtab :
- .strtab :
- .debug :
-# .sbss :
- .bss align(8) :
- .init 0xbfc00000 :
-}
diff --git a/c/src/lib/libbsp/mips/p4000/startup/idtmem.S b/c/src/lib/libbsp/mips/p4000/startup/idtmem.S
deleted file mode 100644
index 70a7096877..0000000000
--- a/c/src/lib/libbsp/mips/p4000/startup/idtmem.S
+++ /dev/null
@@ -1,938 +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$
-
-*/
-
-/************************************************************************
-**
-** idtmem.s - memory and cache functions
-**
-** Copyright 1991 Integrated Device Technology, Inc.
-** All Rights Reserved
-**
-**************************************************************************/
-
-/*
- * 950313: Ketan fixed bugs in mfc0/mtc0 hazards, and removed hack
- * to set mem_size.
- */
-
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtcpu.h>
-#include <rtems/score/idtmon.h>
-
- .data
-mem_size:
- .word 0
-dcache_size:
- .word 0
-icache_size:
-#if defined(CPU_R3000)
- .word MINCACHE
-#endif
-#if defined(CPU_R4000)
- .word 0
-#endif
-
-#if defined(CPU_R4000)
- .data
-scache_size:
- .word 0
-icache_linesize:
- .word 0
-dcache_linesize:
- .word 0
-scache_linesize:
- .word 0
-#endif
-
-
- .text
-
-#if defined (CPU_R3000)
-#define CONFIGFRM ((2*4)+4)
-
-/*************************************************************************
-**
-** Config_Dcache() -- determine size of Data cache
-**
-**************************************************************************/
-
-FRAME(config_Dcache,sp, CONFIGFRM, ra)
- .set noreorder
- subu sp,CONFIGFRM
- sw ra,CONFIGFRM-4(sp) /* save return address */
- sw s0,4*4(sp) /* save s0 in first regsave slot */
- mfc0 s0,C0_SR /* save SR */
- nop
- mtc0 zero,C0_SR /* disable interrupts */
- .set reorder
- jal _size_cache /* returns Data cache size in v0 */
- sw v0, dcache_size /* save it */
- and s0, ~SR_PE /* do not clear PE */
- .set noreorder
- mtc0 s0,C0_SR /* restore SR */
- nop
- .set reorder
- lw s0, 4*4(sp) /* restore s0 */
- lw ra,CONFIGFRM-4(sp) /* restore ra */
- addu sp,CONFIGFRM /* pop stack */
- j ra
-ENDFRAME(config_Dcache)
-
-
-/*************************************************************************
-**
-** Config_Icache() -- determine size of Instruction cache
-** MUST be run in uncached mode/handled in idt_csu.s
-**
-**************************************************************************/
-
-FRAME(config_Icache,sp, CONFIGFRM, ra)
- .set noreorder
- subu sp,CONFIGFRM
- sw ra,CONFIGFRM-4(sp) /* save return address */
- sw s0,4*4(sp) /* save s0 in first regsave slot */
- mfc0 s0,C0_SR /* save SR */
- nop
- mtc0 zero, C0_SR /* disable interrupts */
- li v0,SR_SWC /* swap caches/disable ints */
- mtc0 v0,C0_SR
- nop
- .set reorder
- jal _size_cache /* returns instruction cache size */
- .set noreorder
- mtc0 zero,C0_SR /* swap back caches */
- nop
- and s0,~SR_PE /* do not inadvertantly clear PE */
- mtc0 s0,C0_SR /* restore SR */
- nop
- .set reorder
- sw v0, icache_size /* save it AFTER caches back */
- lw s0,4*4(sp) /* restore s0 */
- lw ra,CONFIGFRM-4(sp) /* restore ra */
- addu sp,CONFIGFRM /* pop stack */
- j ra
-ENDFRAME(config_Icache)
-
-/************************************************************************
-**
-** _size_cache()
-** returns cache size in v0
-**
-************************************************************************/
-
-FRAME(_size_cache,sp,0,ra)
- .set noreorder
- mfc0 t0,C0_SR /* save current sr */
- nop
- and t0,~SR_PE /* do not inadvertently clear PE */
- or v0,t0,SR_ISC /* isolate cache */
- mtc0 v0,C0_SR
- /*
- * First check if there is a cache there at all
- */
- move v0,zero
- li v1,0xa5a5a5a5 /* distinctive pattern */
- sw v1,K0BASE /* try to write into cache */
- lw t1,K0BASE /* try to read from cache */
- nop
- mfc0 t2,C0_SR
- nop
- .set reorder
- and t2,SR_CM
- bne t2,zero,3f /* cache miss, must be no cache */
- bne v1,t1,3f /* data not equal -> no cache */
- /*
- * Clear cache size boundries to known state.
- */
- li v0,MINCACHE
-1:
- sw zero,K0BASE(v0)
- sll v0,1
- ble v0,MAXCACHE,1b
-
- li v0,-1
- sw v0,K0BASE(zero) /* store marker in cache */
- li v0,MINCACHE /* MIN cache size */
-
-2: lw v1,K0BASE(v0) /* Look for marker */
- bne v1,zero,3f /* found marker */
- sll v0,1 /* cache size * 2 */
- ble v0,MAXCACHE,2b /* keep looking */
- move v0,zero /* must be no cache */
- .set noreorder
-3: mtc0 t0,C0_SR /* restore sr */
- j ra
- nop
-ENDFRAME(_size_cache)
- .set reorder
-
-
-#define FLUSHFRM (2*4)
-
-/***************************************************************************
-**
-** flush_Dcache() - flush entire Data cache
-**
-****************************************************************************/
-FRAME(flush_Dcache,sp,FLUSHFRM,ra)
- lw t2, dcache_size
- .set noreorder
- mfc0 t3,C0_SR /* save SR */
- nop
- and t3,~SR_PE /* dont inadvertently clear PE */
- beq t2,zero,_Dflush_done /* no D cache, get out! */
- nop
- li v0, SR_ISC /* isolate cache */
- mtc0 v0, C0_SR
- nop
- .set reorder
- li t0,K0BASE /* set loop registers */
- or t1,t0,t2
-
-2: sb zero,0(t0)
- sb zero,4(t0)
- sb zero,8(t0)
- sb zero,12(t0)
- sb zero,16(t0)
- sb zero,20(t0)
- sb zero,24(t0)
- addu t0,32
- sb zero,-4(t0)
- bne t0,t1,2b
-
- .set noreorder
-_Dflush_done:
- mtc0 t3,C0_SR /* restore Status Register */
- .set reorder
- j ra
-ENDFRAME(flush_Dcache)
-
-
-/***************************************************************************
-**
-** flush_Icache() - flush entire Instruction cache
-**
-** NOTE: Icache can only be flushed/cleared when uncached
-** Code forces into uncached memory regardless of calling mode
-**
-****************************************************************************/
-FRAME(flush_Icache,sp,FLUSHFRM,ra)
- lw t1,icache_size
- .set noreorder
- mfc0 t3,C0_SR /* save SR */
- nop
- la v0,1f
- li v1,K1BASE
- or v0,v1
- j v0 /* force into non-cached space */
- nop
-1:
- and t3,~SR_PE /* dont inadvertently clear PE */
- beq t1,zero,_Iflush_done /* no i-cache get out */
- nop
- li v0,SR_ISC|SR_SWC /* disable intr, isolate and swap */
- mtc0 v0,C0_SR
- li t0,K0BASE
- .set reorder
- or t1,t0,t1
-
-1: sb zero,0(t0)
- sb zero,4(t0)
- sb zero,8(t0)
- sb zero,12(t0)
- sb zero,16(t0)
- sb zero,20(t0)
- sb zero,24(t0)
- addu t0,32
- sb zero,-4(t0)
- bne t0,t1,1b
- .set noreorder
-_Iflush_done:
- mtc0 t3,C0_SR /* un-isolate, enable interrupts */
- .set reorder
- j ra
-ENDFRAME(flush_Icache)
-
-/**************************************************************************
-**
-** clear_Dcache(base_addr, byte_count) - flush portion of Data cache
-**
-** a0 = base address of portion to be cleared
-** a1 = byte count of length
-**
-***************************************************************************/
-FRAME(clear_Dcache,sp,0,ra)
-
- lw t2, dcache_size /* Data cache size */
- .set noreorder
- mfc0 t3,C0_SR /* save SR */
- nop
- and t3,~SR_PE /* dont inadvertently clear PE */
- nop
- nop
- .set reorder
- /*
- * flush data cache
- */
-
- .set noreorder
- nop
- li v0,SR_ISC /* isolate data cache */
- mtc0 v0,C0_SR
- .set reorder
- bltu t2,a1,1f /* cache is smaller than region */
- move t2,a1
-1: addu t2,a0 /* ending address + 1 */
- move t0,a0
-
-1: sb zero,0(t0)
- sb zero,4(t0)
- sb zero,8(t0)
- sb zero,12(t0)
- sb zero,16(t0)
- sb zero,20(t0)
- sb zero,24(t0)
- addu t0,32
- sb zero,-4(t0)
- bltu t0,t2,1b
-
- .set noreorder
- mtc0 t3,C0_SR /* un-isolate, enable interrupts */
- nop
- .set reorder
- j ra
-ENDFRAME(clear_Dcache)
-
-
-/**************************************************************************
-**
-** clear_Icache(base_addr, byte_count) - flush portion of Instruction cache
-**
-** a0 = base address of portion to be cleared
-** a1 = byte count of length
-**
-** NOTE: Icache can only be flushed/cleared when uncached
-** Code forces into uncached memory regardless of calling mode
-**
-***************************************************************************/
-FRAME(clear_Icache,sp,0,ra)
-
- lw t1, icache_size /* Instruction cache size */
- /*
- * flush text cache
- */
- .set noreorder
- mfc0 t3,C0_SR /* save SR */
- nop
- la v0,1f
- li v1,K1BASE
- or v0,v1
- j v0 /* force into non-cached space */
- nop
-1:
- and t3,~SR_PE /* dont inadvertently clear PE */
- nop
- nop
- li v0,SR_ISC|SR_SWC /* disable intr, isolate and swap */
- mtc0 v0,C0_SR
- .set reorder
- bltu t1,a1,1f /* cache is smaller than region */
- move t1,a1
-1: addu t1,a0 /* ending address + 1 */
- move t0,a0
-
- sb zero,0(t0)
- sb zero,4(t0)
- sb zero,8(t0)
- sb zero,12(t0)
- sb zero,16(t0)
- sb zero,20(t0)
- sb zero,24(t0)
- addu t0,32
- sb zero,-4(t0)
- bltu t0,t1,1b
- .set noreorder
- mtc0 t3,C0_SR /* un-isolate, enable interrupts */
- nop
- nop
- nop /* allow time for caches to swap */
- .set reorder
- j ra
-ENDFRAME(clear_Icache)
-
-
-/**************************************************************************
-**
-** get_mem_conf - get memory configuration
-**
-***************************************************************************/
-
-
-FRAME(get_mem_conf,sp,0,ra)
-
- lw t6, mem_size
- sw t6, 0(a0)
- lw t7, icache_size
- sw t7, 4(a0)
- lw t8, dcache_size
- sw t8, 8(a0)
- j ra
-
-ENDFRAME(get_mem_conf)
-#endif /* defined CPU_R3000 */
-
-#if defined(CPU_R4000)
-#define LEAF(label) FRAME(label,sp,0,ra)
-#define XLEAF(label) \
- .globl label ; \
-label:
-#define END(label) ENDFRAME(label)
-
-/*
- * cacheop macro to automate cache operations
- * first some helpers...
- */
-#define _mincache(size, maxsize) \
- bltu size,maxsize,8f ; \
- move size,maxsize ; \
-8:
-
-#define _align(tmp, minaddr, maxaddr, linesize) \
- subu tmp,linesize,1 ; \
- not tmp ; \
- and minaddr,tmp ; \
- addu maxaddr,-1 ; \
- and maxaddr,tmp
-
-/* This is a bit of a hack really because it relies on minaddr=a0 */
-#define _doop1(op1) \
- cache op1,0(a0)
-
-#define _doop2(op1, op2) \
- cache op1,0(a0) ; \
- cache op2,0(a0)
-
-/* specials for cache initialisation */
-#define _doop1lw1(op1) \
- cache op1,0(a0) ; \
- lw zero,0(a0) ; \
- cache op1,0(a0)
-
-#define _doop121(op1,op2) \
- cache op1,0(a0) ; \
- nop; \
- cache op2,0(a0) ; \
- nop; \
- cache op1,0(a0)
-
-#define _oploopn(minaddr, maxaddr, linesize, tag, ops) \
- .set noreorder ; \
-7: _doop##tag##ops ; \
- bne minaddr,maxaddr,7b ; \
- addu minaddr,linesize ; \
- .set reorder
-
-/* finally the cache operation macros */
-#define icacheopn(kva, n, cache_size, cache_linesize, tag, ops) \
- _mincache(n, cache_size); \
- blez n,9f ; \
- addu n,kva ; \
- _align(t1, kva, n, cache_linesize) ; \
- _oploopn(kva, n, cache_linesize, tag, ops) ; \
-9:
-
-#define vcacheopn(kva, n, cache_size, cache_linesize, tag, ops) \
- blez n,9f ; \
- addu n,kva ; \
- _align(t1, kva, n, cache_linesize) ; \
- _oploopn(kva, n, cache_linesize, tag, ops) ; \
-9:
-
-#define icacheop(kva, n, cache_size, cache_linesize, op) \
- icacheopn(kva, n, cache_size, cache_linesize, 1, (op))
-
-#define vcacheop(kva, n, cache_size, cache_linesize, op) \
- vcacheopn(kva, n, cache_size, cache_linesize, 1, (op))
-
- .text
-
-/*
- * static void _size_cache() R4000
- *
- * Internal routine to determine cache sizes by looking at R4000 config
- * register. Sizes are returned in registers, as follows:
- * t2 icache size
- * t3 dcache size
- * t6 scache size
- * t4 icache line size
- * t5 dcache line size
- * t7 scache line size
- */
-LEAF(_size_cache)
- mfc0 t0,C0_CONFIG
-
- and t1,t0,CFG_ICMASK
- srl t1,CFG_ICSHIFT
- li t2,0x1000
- sll t2,t1
-
- and t1,t0,CFG_DCMASK
- srl t1,CFG_DCSHIFT
- li t3,0x1000
- sll t3,t1
-
- li t4,32
- and t1,t0,CFG_IB
- bnez t1,1f
- li t4,16
-1:
-
- li t5,32
- and t1,t0,CFG_DB
- bnez t1,1f
- li t5,16
-1:
-
- move t6,zero # default to no scache
- move t7,zero #
-
- and t1,t0,CFG_C_UNCACHED # test config register
- bnez t1,1f # no scache if uncached/non-coherent
-
- li t6,0x100000 # assume 1Mb scache <<-NOTE
- and t1,t0,CFG_SBMASK
- srl t1,CFG_SBSHIFT
- li t7,16
- sll t7,t1
-1: j ra
-END(_size_cache)
-
-
-/*
- * void config_cache() R4000
- *
- * Work out size of I, D & S caches, assuming they are already initialised.
- */
-LEAF(config_cache)
- lw t0,icache_size
- bgtz t0,8f # already known?
- move v0,ra
- bal _size_cache
- move ra,v0
-
- sw t2,icache_size
- sw t3,dcache_size
- sw t6,scache_size
- sw t4,icache_linesize
- sw t5,dcache_linesize
- sw t7,scache_linesize
-8: j ra
-END(config_cache)
-
-
-/*
- * void _init_cache() R4000
- */
-LEAF(_init_cache)
- /*
- * First work out the sizes
- */
- move v0,ra
- bal _size_cache
- move ra,v0
-
- /*
- * The caches may be in an indeterminate state,
- * so we force good parity into them by doing an
- * invalidate, load/fill, invalidate for each line.
- */
-
- /* disable all i/u and cache exceptions */
- mfc0 v0,C0_SR
- and v1,v0,~SR_IE
- or v1,SR_DE
- mtc0 v1,C0_SR
-
- mtc0 zero,C0_TAGLO
- mtc0 zero,C0_TAGHI
-
- /* assume bottom of RAM will generate good parity for the cache */
- li a0,PHYS_TO_K0(0)
- move a2,t2 # icache_size
- move a3,t4 # icache_linesize
- move a1,a2
- icacheopn(a0,a1,a2,a3,121,(Index_Store_Tag_I,Fill_I))
-
- li a0,PHYS_TO_K0(0)
- move a2,t3 # dcache_size
- move a3,t5 # dcache_linesize
- move a1,a2
- icacheopn(a0,a1,a2,a3,1lw1,(Index_Store_Tag_D))
-
- /* assume unified I & D in scache <<-NOTE */
- blez t6,1f
- li a0,PHYS_TO_K0(0)
- move a2,t6
- move a3,t7
- move a1,a2
- icacheopn(a0,a1,a2,a3,1lw1,(Index_Store_Tag_SD))
-
-1: mtc0 v0,C0_SR
- j ra
-END(_init_cache)
-
-
-/*
- * void flush_cache (void) R4000
- *
- * Flush and invalidate all caches
- */
-LEAF(flush_cache)
- /* secondary cacheops do all the work if present */
- lw a2,scache_size
- blez a2,1f
- lw a3,scache_linesize
- li a0,PHYS_TO_K0(0)
- move a1,a2
- icacheop(a0,a1,a2,a3,Index_Writeback_Inv_SD)
- b 2f
-
-1:
- lw a2,icache_size
- blez a2,2f
- lw a3,icache_linesize
- li a0,PHYS_TO_K0(0)
- move a1,a2
- icacheop(a0,a1,a2,a3,Index_Invalidate_I)
-
- lw a2,dcache_size
- lw a3,dcache_linesize
- li a0,PHYS_TO_K0(0)
- move a1,a2
- icacheop(a0,a1,a2,a3,Index_Writeback_Inv_D)
-
-2: j ra
-END(flush_cache)
-
-/*
- * void flush_cache_nowrite (void) R4000
- *
- * Invalidate all caches
- */
-LEAF(flush_cache_nowrite)
- mfc0 v0,C0_SR
- and v1,v0,~SR_IE
- mtc0 v1,C0_SR
-
- mtc0 zero,C0_TAGLO
- mtc0 zero,C0_TAGHI
-
- lw a2,icache_size
- blez a2,2f
- lw a3,icache_linesize
- li a0,PHYS_TO_K0(0)
- move a1,a2
- icacheop(a0,a1,a2,a3,Index_Invalidate_I)
-
- lw a2,dcache_size
- lw a3,dcache_linesize
- li a0,PHYS_TO_K0(0)
- move a1,a2
- icacheop(a0,a1,a2,a3,Index_Store_Tag_D)
-
- lw a2,scache_size
- blez a2,2f
- lw a3,scache_linesize
- li a0,PHYS_TO_K0(0)
- move a1,a2
- icacheop(a0,a1,a2,a3,Index_Store_Tag_SD)
-
-2: mtc0 v0,C0_SR
- j ra
-END(flush_cache_nowrite)
-
-/*
- * void clean_cache (unsigned kva, size_t n) R4000
- *
- * Writeback and invalidate address range in all caches
- */
-LEAF(clean_cache)
-XLEAF(clear_cache)
-
- /* secondary cacheops do all the work (if fitted) */
- lw a2,scache_size
- blez a2,1f
- lw a3,scache_linesize
- vcacheop(a0,a1,a2,a3,Hit_Writeback_Inv_SD)
- b 2f
-
-1: lw a2,icache_size
- blez a2,2f
- lw a3,icache_linesize
- /* save kva & n for subsequent loop */
- move t8,a0
- move t9,a1
- vcacheop(a0,a1,a2,a3,Hit_Invalidate_I)
-
- lw a2,dcache_size
- lw a3,dcache_linesize
- /* restore kva & n */
- move a0,t8
- move a1,t9
- vcacheop(a0,a1,a2,a3,Hit_Writeback_Inv_D)
-
-2: j ra
-END(clean_cache)
-
-/*
- * void clean_dcache (unsigned kva, size_t n) R4000
- *
- * Writeback and invalidate address range in primary data cache
- */
-LEAF(clean_dcache)
- lw a2,dcache_size
- blez a2,2f
- lw a3,dcache_linesize
-
- vcacheop(a0,a1,a2,a3,Hit_Writeback_Inv_D)
-
-2: j ra
-END(clean_dcache)
-
-/*
- * void clean_dcache_indexed (unsigned kva, size_t n) R4000
- *
- * Writeback and invalidate indexed range in primary data cache
- */
-LEAF(clean_dcache_indexed)
- lw a2,dcache_size
- blez a2,2f
- lw a3,dcache_linesize
-
-#ifdef CPU_ORION
- srl a2,1 # do one set (half cache) at a time
- move t8,a0 # save kva & n
- move t9,a1
- icacheop(a0,a1,a2,a3,Index_Writeback_Inv_D)
-
- addu a0,t8,a2 # do next set
- move a1,t9 # restore n
-#endif
- icacheop(a0,a1,a2,a3,Index_Writeback_Inv_D)
-
-2: j ra
-END(clean_dcache_indexed)
-
-/*
- * void clean_dcache_nowrite (unsigned kva, size_t n) R4000
- *
- * Invalidate an address range in primary data cache
- */
-LEAF(clean_dcache_nowrite)
- lw a2,dcache_size
- blez a2,2f
- lw a3,dcache_linesize
-
- vcacheop(a0,a1,a2,a3,Hit_Invalidate_D)
-
-2: j ra
-END(clean_dcache_nowrite)
-
-/*
- * void clean_dcache_nowrite_indexed (unsigned kva, size_t n) R4000
- *
- * Invalidate indexed range in primary data cache
- */
-LEAF(clean_dcache_nowrite_indexed)
- mfc0 v0,C0_SR
- and v1,v0,~SR_IE
- mtc0 v1,C0_SR
-
- mtc0 zero,C0_TAGLO
- mtc0 zero,C0_TAGHI
-
- lw a2,dcache_size
- blez a2,2f
- lw a3,dcache_linesize
-
-#ifdef CPU_ORION
- srl a2,1 # do one set (half cache) at a time
- move t8,a0 # save kva & n
- move t9,a1
- icacheop(a0,a1,a2,a3,Index_Store_Tag_D)
-
- addu a0,t8,a2 # do next set
- move a1,t9 # restore n
-#endif
- icacheop(a0,a1,a2,a3,Index_Store_Tag_D)
-
-2: mtc0 v0,C0_SR
- j ra
-END(clean_dcache_nowrite_indexed)
-
-/*
- * void clean_icache (unsigned kva, size_t n) R4000
- *
- * Invalidate address range in primary instruction cache
- */
-LEAF(clean_icache)
- lw a2,icache_size
- blez a2,2f
- lw a3,icache_linesize
-
- vcacheop(a0,a1,a2,a3,Hit_Invalidate_I)
-
-2: j ra
-END(clean_icache)
-
-/*
- * void clean_icache_indexed (unsigned kva, size_t n) R4000
- *
- * Invalidate indexed range in primary instruction cache
- */
-LEAF(clean_icache_indexed)
- lw a2,icache_size
- blez a2,2f
- lw a3,icache_linesize
-
-#ifdef CPU_ORION
- srl a2,1 # do one set (half cache) at a time
- move t8,a0 # save kva & n
- move t9,a1
- icacheop(a0,a1,a2,a3,Index_Invalidate_I)
-
- addu a0,t8,a2 # do next set
- move a1,t9 # restore n
-#endif
- icacheop(a0,a1,a2,a3,Index_Invalidate_I)
-
-2: j ra
-END(clean_icache_indexed)
-
-
-
-/*
- * void clean_scache (unsigned kva, size_t n) R4000
- *
- * Writeback and invalidate address range in secondary cache
- */
-LEAF(clean_scache)
- lw a2,scache_size
- blez a2,2f
- lw a3,scache_linesize
- vcacheop(a0,a1,a2,a3,Hit_Writeback_Inv_SD)
-
-2: j ra
-END(clean_scache)
-
-/*
- * void clean_scache_indexed (unsigned kva, size_t n) R4000
- *
- * Writeback and invalidate indexed range in secondary cache
- */
-LEAF(clean_scache_indexed)
- lw a2,scache_size
- blez a2,2f
- lw a3,scache_linesize
-
- icacheop(a0,a1,a2,a3,Index_Writeback_Inv_SD)
-
-2: j ra
-END(clean_scache_indexed)
-
-/*
- * void clean_scache_nowrite (unsigned kva, size_t n) R4000
- *
- * Invalidate an address range in secondary cache
- */
-LEAF(clean_scache_nowrite)
- lw a2,scache_size
- blez a2,2f
- lw a3,scache_linesize
-
- vcacheop(a0,a1,a2,a3,Hit_Invalidate_SD)
-
-2: j ra
-END(clean_scache_nowrite)
-
-/*
- * void clean_scache_nowrite_indexed (unsigned kva, size_t n) R4000
- *
- * Invalidate indexed range in secondary cache
- */
-LEAF(clean_scache_nowrite_indexed)
- mfc0 v0,C0_SR
- and v1,v0,~SR_IE
- mtc0 v1,C0_SR
-
- mtc0 zero,C0_TAGLO
- mtc0 zero,C0_TAGHI
-
- lw a2,scache_size
- blez a2,2f
- lw a3,scache_linesize
-
- icacheop(a0,a1,a2,a3,Index_Store_Tag_SD)
-
-2: mtc0 v0,C0_SR
- j ra
-END(clean_scache_nowrite_indexed)
-
-/**************************************************************************
-**
-** get_mem_conf - get memory configuration R4000
-**
-***************************************************************************/
-
-
-FRAME(get_mem_conf,sp,0,ra)
-
- lw t6, mem_size
- sw t6, 0(a0)
- lw t7, icache_size
- sw t7, 4(a0)
- lw t8, dcache_size
- sw t8, 8(a0)
- lw t7, scache_size
- sw t7, 12(a0)
- j ra
-
-ENDFRAME(get_mem_conf)
-
-#endif /* defined(CPU_R4000) */
-
-/*
- * void set_mem_size (mem_size)
- *
- * config_memory()'s memory size gets written into mem_size here.
- * Now we don't need to call config_cache() with memory size - New to IDTC6.0
- */
-FRAME(set_memory_size,sp,0,ra)
- sw a0, mem_size
- j ra
-ENDFRAME(set_memory_size)
-
-
diff --git a/c/src/lib/libbsp/mips/p4000/startup/idttlb.S b/c/src/lib/libbsp/mips/p4000/startup/idttlb.S
deleted file mode 100644
index 4aad7b1416..0000000000
--- a/c/src/lib/libbsp/mips/p4000/startup/idttlb.S
+++ /dev/null
@@ -1,390 +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$
-*/
-
-
-/*
-** idttlb.s - fetch the registers associated with and the contents
-** of the tlb.
-**
-*/
-/* 950308: Ketan patched a few tlb functions that would not have worked.*/
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtcpu.h>
-#include <rtems/score/idtmon.h>
-
-
- .text
-
-#if defined(CPU_R3000)
-/*
-** ret_tlblo -- returns the 'entrylo' contents for the TLB
-** 'c' callable - as ret_tlblo(index) - where index is the
-** tlb entry to return the lo value for - if called from assembly
-** language then index should be in register a0.
-*/
-FRAME(ret_tlblo,sp,0,ra)
- .set noreorder
- mfc0 t0,C0_SR # save sr
- nop
- and t0,~SR_PE # dont inadvertantly clear PE
- mtc0 zero,C0_SR # clear interrupts
- mfc0 t1,C0_TLBHI # save pid
- sll a0,TLBINX_INXSHIFT # position index
- mtc0 a0,C0_INX # write to index register
- nop
- tlbr # put tlb entry in entrylo and hi
- nop
- mfc0 v0,C0_TLBLO # get the requested entry lo
- mtc0 t1,C0_TLBHI # restore pid
- mtc0 t0,C0_SR # restore status register
- j ra
- nop
- .set reorder
-ENDFRAME(ret_tlblo)
-#endif
-#if defined(CPU_R4000)
-/*
-** ret_tlblo[01] -- returns the 'entrylo' contents for the TLB
-** 'c' callable - as ret_tlblo(index) - where index is the
-** tlb entry to return the lo value for - if called from assembly
-** language then index should be in register a0.
-*/
-FRAME(ret_tlblo0,sp,0,ra)
- mfc0 t0,C0_SR # save sr
- mtc0 zero,C0_SR # clear interrupts
- mfc0 t1,C0_TLBHI # save pid
- mtc0 a0,C0_INX # write to index register
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- tlbr # put tlb entry in entrylo and hi
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- mfc0 v0,C0_TLBLO0 # get the requested entry lo
- mtc0 t1,C0_TLBHI # restore pid
- mtc0 t0,C0_SR # restore status register
- j ra
-ENDFRAME(ret_tlblo0)
-
-FRAME(ret_tlblo1,sp,0,ra)
- mfc0 t0,C0_SR # save sr
- mtc0 zero,C0_SR # clear interrupts
- mfc0 t1,C0_TLBHI # save pid
- mtc0 a0,C0_INX # write to index register
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- tlbr # put tlb entry in entrylo and hi
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- mfc0 v0,C0_TLBLO1 # get the requested entry lo
- mtc0 t1,C0_TLBHI # restore pid
- mtc0 t0,C0_SR # restore status register
- j ra
-ENDFRAME(ret_tlblo1)
-
-/*
-** ret_pagemask(index) -- return pagemask contents of tlb entry "index"
-*/
-FRAME(ret_pagemask,sp,0,ra)
- mfc0 t0,C0_SR # save sr
- mtc0 zero,C0_SR # disable interrupts
- mfc0 t1,C0_TLBHI # save current pid
- mtc0 a0,C0_INX # drop it in C0 register
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- tlbr # read entry to entry hi/lo
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- mfc0 v0,C0_PAGEMASK # to return value
- mtc0 t1,C0_TLBHI # restore current pid
- mtc0 t0,C0_SR # restore sr
- j ra
-ENDFRAME(ret_pagemask)
-
-/*
-** ret_tlbwired(void) -- return wired register
-*/
-FRAME(ret_tlbwired,sp,0,ra)
- mfc0 v0,C0_WIRED
- j ra
-ENDFRAME(ret_tlbwired)
-#endif
-
-/*
-** ret_tlbhi -- return the tlb entry high content for tlb entry
-** index
-*/
-FRAME(ret_tlbhi,sp,0,ra)
-#if defined(CPU_R3000)
- .set noreorder
- mfc0 t0,C0_SR # save sr
- nop
- and t0,~SR_PE
- mtc0 zero,C0_SR # disable interrupts
- mfc0 t1,C0_TLBHI # save current pid
- sll a0,TLBINX_INXSHIFT # position index
- mtc0 a0,C0_INX # drop it in C0 register
- nop
- tlbr # read entry to entry hi/lo
- nop
- mfc0 v0,C0_TLBHI # to return value
- mtc0 t1,C0_TLBHI # restore current pid
- mtc0 t0,C0_SR # restore sr
- j ra
- nop
- .set reorder
-#endif
-#if defined(CPU_R4000)
- mfc0 t0,C0_SR # save sr
- mtc0 zero,C0_SR # disable interrupts
- mfc0 t1,C0_TLBHI # save current pid
- mtc0 a0,C0_INX # drop it in C0 register
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- tlbr # read entry to entry hi/lo0/lo1/mask
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- mfc0 v0,C0_TLBHI # to return value
- mtc0 t1,C0_TLBHI # restore current pid
- mtc0 t0,C0_SR # restore sr
- j ra
-#endif
-ENDFRAME(ret_tlbhi)
-
-/*
-** ret_tlbpid() -- return tlb pid contained in the current entry hi
-*/
-FRAME(ret_tlbpid,sp,0,ra)
-#if defined(CPU_R3000)
- .set noreorder
- mfc0 v0,C0_TLBHI # fetch tlb high
- nop
- and v0,TLBHI_PIDMASK # isolate and position
- srl v0,TLBHI_PIDSHIFT
- j ra
- nop
- .set reorder
-#endif
-#if defined(CPU_R4000)
- mfc0 v0,C0_TLBHI # to return value
- nop
- and v0,TLBHI_PIDMASK
- j ra
-#endif
-ENDFRAME(ret_tlbpid)
-
-/*
-** tlbprobe(address, pid) -- probe the tlb to see if address is currently
-** mapped
-** a0 = vpn - virtual page numbers are 0=0 1=0x1000, 2=0x2000...
-** virtual page numbers for the r3000 are in
-** entry hi bits 31-12
-** a1 = pid - this is a process id ranging from 0 to 63
-** this process id is shifted left 6 bits and or'ed into
-** the entry hi register
-** returns an index value (0-63) if successful -1 -f not
-*/
-FRAME(tlbprobe,sp,0,ra)
-#if defined(CPU_R3000)
- .set noreorder
- mfc0 t0,C0_SR /* fetch status reg */
- and a0,TLBHI_VPNMASK /* isolate just the vpn */
- and t0,~SR_PE /* don't inadvertantly clear pe */
- mtc0 zero,C0_SR
- mfc0 t1,C0_TLBHI
- sll a1,TLBHI_PIDSHIFT /* possition the pid */
- and a1,TLBHI_PIDMASK
- or a0,a1 /* build entry hi value */
- mtc0 a0,C0_TLBHI
- nop
- tlbp /* do the probe */
- nop
- mfc0 v1,C0_INX
- li v0,-1
- bltz v1,1f
- nop
- sra v0,v1,TLBINX_INXSHIFT /* get index positioned for return */
-1:
- mtc0 t1,C0_TLBHI /* restore tlb hi */
- mtc0 t0,C0_SR /* restore the status reg */
- j ra
- nop
- .set reorder
-#endif
-#if defined(CPU_R4000)
- mfc0 t0,C0_SR # save sr
- mtc0 zero,C0_SR # disable interrupts
- mfc0 t1,C0_TLBHI # save current pid
- and a0,TLBHI_VPN2MASK # construct tlbhi for probe
- and a1,TLBHI_PIDMASK
- or a0,a1
- mtc0 a0,C0_TLBHI
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- tlbp # probe entry to entry hi/lo0/lo1/mask
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- mfc0 v1,C0_INX
- li v0,-1
- bltz v1,1f
- move v0,v1
-1: mtc0 t1,C0_TLBHI # restore current pid
- mtc0 t0,C0_SR # restore sr
- j ra
-#endif
-ENDFRAME(tlbprobe)
-
-/*
-** resettlb(index) Invalidate the TLB entry specified by index
-*/
-FRAME(resettlb,sp,0,ra)
-#if defined(CPU_R3000)
- .set noreorder
- mfc0 t0,C0_TLBHI # fetch the current hi
- mfc0 v0,C0_SR # fetch the status reg.
- li t2,K0BASE&TLBHI_VPNMASK
- and v0,~SR_PE # dont inadvertantly clear PE
- mtc0 zero,C0_SR
- mtc0 t2,C0_TLBHI # set up tlbhi
- mtc0 zero,C0_TLBLO
- sll a0,TLBINX_INXSHIFT
- mtc0 a0,C0_INX
- nop
- tlbwi # do actual invalidate
- nop
- mtc0 t0,C0_TLBHI
- mtc0 v0,C0_SR
- j ra
- nop
- .set reorder
-#endif
-#if defined(CPU_R4000)
- li t2,K0BASE&TLBHI_VPN2MASK
- mfc0 t0,C0_TLBHI # save current TLBHI
- mfc0 v0,C0_SR # save SR and disable interrupts
- mtc0 zero,C0_SR
- mtc0 t2,C0_TLBHI # invalidate entry
- mtc0 zero,C0_TLBLO0
- mtc0 zero,C0_TLBLO1
- mtc0 a0,C0_INX
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- tlbwi
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- mtc0 t0,C0_TLBHI
- mtc0 v0,C0_SR
- j ra
-#endif
-ENDFRAME(resettlb)
-
-#if defined(CPU_R3000)
-/*
-** Setup TLB entry
-**
-** map_tlb(index, tlbhi, phypage)
-** a0 = TLB entry index
-** a1 = virtual page number and PID
-** a2 = physical page
-*/
-FRAME(map_tlb,sp,0,ra)
- .set noreorder
- sll a0,TLBINX_INXSHIFT
- mfc0 v0,C0_SR # fetch the current status
- mfc0 a3,C0_TLBHI # save the current hi
- and v0,~SR_PE # dont inadvertantly clear parity
-
- mtc0 zero,C0_SR
- mtc0 a1,C0_TLBHI # set the hi entry
- mtc0 a2,C0_TLBLO # set the lo entry
- mtc0 a0,C0_INX # load the index
- nop
- tlbwi # put the hi/lo in tlb entry indexed
- nop
- mtc0 a3,C0_TLBHI # put back the tlb hi reg
- mtc0 v0,C0_SR # restore the status register
- j ra
- nop
- .set reorder
-ENDFRAME(map_tlb)
- #endif
-#if defined(CPU_R4000)
-/*
-** Setup R4000 TLB entry
-**
-** map_tlb4000(mask_index, tlbhi, pte_even, pte_odd)
-** a0 = TLB entry index and page mask
-** a1 = virtual page number and PID
-** a2 = pte -- contents of even pte
-** a3 = pte -- contents of odd pte
-*/
-FRAME(map_tlb4000,sp,0,ra)
- and t2,a0,TLBPGMASK_MASK
- and a0,TLBINX_INXMASK
- mfc0 t1,C0_TLBHI # save current TLBPID
- mfc0 v0,C0_SR # save SR and disable interrupts
- mtc0 zero,C0_SR
- mtc0 t2,C0_PAGEMASK # set
- mtc0 a1,C0_TLBHI # set VPN and TLBPID
- mtc0 a2,C0_TLBLO0 # set PPN and access bits
- mtc0 a3,C0_TLBLO1 # set PPN and access bits
- mtc0 a0,C0_INX # set INDEX to wired entry
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- tlbwi # drop it in
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- mtc0 t1,C0_TLBHI # restore TLBPID
- mtc0 v0,C0_SR # restore SR
- j ra
-ENDFRAME(map_tlb4000)
-#endif
-
-
-/*
-** Set current TLBPID. This assumes PID is positioned correctly in reg.
-** a0.
-*/
-FRAME(set_tlbpid,sp,0,ra)
- .set noreorder
- mtc0 a0,C0_TLBHI
- j ra
- nop
- .set reorder
-ENDFRAME(set_tlbpid)
-
diff --git a/c/src/lib/libbsp/mips/p4000/startup/inittlb.c b/c/src/lib/libbsp/mips/p4000/startup/inittlb.c
deleted file mode 100644
index e61f0043be..0000000000
--- a/c/src/lib/libbsp/mips/p4000/startup/inittlb.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems/score/idtcpu.h>
-
-extern void resettlb( int i );
-
-void init_tlb(void)
-{
- int i;
-
- for (i = 0; i < N_TLB_ENTRIES; i++ )
- resettlb(i);
-}
-
diff --git a/c/src/lib/libbsp/mips/p4000/startup/linkcmds b/c/src/lib/libbsp/mips/p4000/startup/linkcmds
deleted file mode 100644
index 47e0ba1162..0000000000
--- a/c/src/lib/libbsp/mips/p4000/startup/linkcmds
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * $Id$
- */
-
-OUTPUT_FORMAT("elf32-bigmips")
-OUTPUT_ARCH(mips)
-/* Do we need any of these for elf?
- __DYNAMIC = 0; */
-_DYNAMIC_LINK = 0;
-SECTIONS
-{
- /* Read-only sections, merged into text segment: */
- .text 0x80030000 : /* */
-/* .text 0xa0020000 : /* */
-/* .text 0x00020000 : /* */
- {
- _ftext = . ;
- *(.text)
- CREATE_OBJECT_SYMBOLS
- _etext = .;
- }
- .init ALIGN(8) : { *(.init) } =0
- .fini ALIGN(8) : { *(.fini) } =0
- .ctors ALIGN(8) : { *(.ctors) }
- .dtors ALIGN(8) : { *(.dtors) }
- .rodata ALIGN(8) : { *(.rodata) *(.gnu.linkonce.r*) }
- .rodata1 ALIGN(8) :
- {
- *(.rodata1)
- . = ALIGN(8);
- }
- .reginfo . : { *(.reginfo) }
- /* also: .hash .dynsym .dynstr .plt(if r/o) .rel.got */
- /* Read-write section, merged into data segment: */
- .data ALIGN(16) :
- {
- _fdata = . ;
- *(.data)
- CONSTRUCTORS
- }
- .data1 ALIGN(8) : { *(.data1) }
- _gp = . + 0x8000;
- .lit8 . : { *(.lit8) }
- .lit4 . : { *(.lit4) }
- /* also (before uninitialized portion): .dynamic .got .plt(if r/w)
- (or does .dynamic go into its own segment?) */
- /* We want the small data sections together, so single-instruction offsets
- can access them all, and initialized data all before uninitialized, so
- we can shorten the on-disk segment size. */
- .sdata ALIGN(8) : { *(.sdata) }
- _edata = .;
- __bss_start = ALIGN(8);
- _fbss = .;
- .sbss ALIGN(8) : { *(.sbss) *(.scommon) }
- .bss ALIGN(8) :
- {
- *(.bss)
- *(COMMON)
- _end = . ;
- end = . ;
- }
- /* Debug sections. These should never be loadable, but they must have
- zero addresses for the debuggers to work correctly. */
- .line 0 : { *(.line) }
- .debug 0 : { *(.debug) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
-
diff --git a/c/src/lib/libbsp/mips/p4000/startup/setvec.c b/c/src/lib/libbsp/mips/p4000/startup/setvec.c
deleted file mode 100644
index 1142eb64de..0000000000
--- a/c/src/lib/libbsp/mips/p4000/startup/setvec.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on the target Board/CPU.
- * This routine is allowed to be as board dependent as necessary.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)setvec.c 04/25/96 1.2\n";
- */
-
-
-#include <rtems.h>
-#include <bsp.h>
-
-mips_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- mips_isr_entry previous_isr;
-
- if ( type )
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
- else {
- /* XXX: install non-RTEMS ISR as "raw" interupt */
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
- }
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/mips/p4000/times b/c/src/lib/libbsp/mips/p4000/times
deleted file mode 100644
index 58574229e1..0000000000
--- a/c/src/lib/libbsp/mips/p4000/times
+++ /dev/null
@@ -1,200 +0,0 @@
-#
-# Timing Test Suite Results for the NO_BSP
-#
-# NOTE: This is just a template. The times are irrelevant since this BSP
-# can only be compiled -- not executed.
-#
-# $Id$
-#
-# @(#)times 08/01/96 1.4
-
-NOTE: To obtain the execution time in microseconds, divide the number of
- cycles by the clock speed. For example, if rtems_semaphore create
- is reported to be 1164 cycles, then at 66 Mhz it takes 17.64
- microseconds or 8.75 microseconds at 133 Mhz.
-
-Board: Algorithmics P4000i
-CPU: IDT 4650
-Clock Speed: 100MHz
-Memory Configuration: SRAM, DRAM, cache, etc
-Wait States:
-
-Times Reported in: cycles
-Timer Source: on-CPU cycle counter
-
-Column A:RTEMS compiled with 64 bit pointers and 64 bit unsigned32 types
-Column B:RTEMS compiled with 32 bit pointers and 32 bit unsigned32 types
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 788 759
- rtems_semaphore_delete 903 945
- rtems_semaphore_obtain: available 119 119
- rtems_semaphore_obtain: not available -- NO_WAIT 118 118
- rtems_semaphore_release: no waiting tasks 127 127
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 842 840
-
- 3 rtems_semaphore_release: task readied -- preempts caller 777 751
-
- 4 rtems_task_restart: blocked task -- preempts caller 1611 1595
- rtems_task_restart: ready task -- preempts caller 1253 1395
- rtems_semaphore_release: task readied -- returns to caller 365 345
- rtems_task_create 798 797
- rtems_task_start 464 460
- rtems_task_restart: suspended task -- returns to caller 517 517
- rtems_task_delete: suspended task 529 595
- rtems_task_restart: ready task -- returns to caller 527 525
- rtems_task_restart: blocked task -- returns to caller 707 684
- rtems_task_delete: blocked task 609 675
-
- 5 rtems_task_suspend: calling task 549 549
- rtems_task_resume: task readied -- preempts caller 702 699
-
- 6 rtems_task_restart: calling task 291 291
- rtems_task_suspend: returns to caller 195 194
- rtems_task_resume: task readied -- returns to caller 198 198
- rtems_task_delete: ready task 734 736
-
- 7 rtems_task_restart: suspended task -- preempts caller 1049 990
-
- 8 rtems_task_set_priority: obtain current priority 94 94
- rtems_task_set_priority: returns to caller 418 355
- rtems_task_mode: obtain current mode 44 43
- rtems_task_mode: no reschedule 0 49
- rtems_task_mode: reschedule -- returns to caller 0 232
- rtems_task_mode: reschedule -- preempts caller 0 687
- rtems_task_set_note 0 101
- rtems_task_get_note 0 103
- rtems_clock_set 0 237
- rtems_clock_get 0 16
-
- 9 rtems_message_queue_create 3583 3432
- rtems_message_queue_send: no waiting tasks 252 252
- rtems_message_queue_urgent: no waiting tasks 252 252
- rtems_message_queue_receive: available 207 207
- rtems_message_queue_flush: no messages flushed 95 96
- rtems_message_queue_flush: messages flushed 110 110
- rtems_message_queue_delete 1044 1111
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 132 131
- rtems_message_queue_receive: not available -- caller blocks 884 892
-
-11 rtems_message_queue_send: task readied -- preempts caller 397 817
-
-12 rtems_message_queue_send: task readied -- returns to caller 397 397
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 816 817
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 397 398
-
-15 rtems_event_receive: obtain current events 5 5
- rtems_event_receive: not available -- NO_WAIT 99 99
- rtems_event_receive: not available -- caller blocks 689 689
- rtems_event_send: no task readied 123 123
- rtems_event_receive: available 326 349
- rtems_event_send: task readied -- returns to caller 333 429
-
-16 rtems_event_send: task readied -- preempts caller 843 838
-
-17 rtems_task_set_priority: preempts caller 1002 991
-
-18 rtems_task_delete: calling task 1171 1157
-
-19 rtems_signal_catch 0 1306
- rtems_signal_send: returns to caller 0 1019
- rtems_signal_send: signal to self 0 496
- exit ASR overhead: returns to calling task 0 120
- exit ASR overhead: returns to preempting task 0 73
-
-20 rtems_partition_create 1293 1306
- rtems_region_create 1010 1019
- rtems_partition_get_buffer: available 481 496
- rtems_partition_get_buffer: not available 120 120
- rtems_partition_return_buffer 587 460
- rtems_partition_delete 379 320
- rtems_region_get_segment: available 179 179
- rtems_region_get_segment: not available -- NO_WAIT 349 293
- rtems_region_return_segment: no waiting tasks 335 322
- rtems_region_get_segment: not available -- caller blocks 1603 1496
- rtems_region_return_segment: task readied -- preempts caller 1616 1533
- rtems_region_return_segment: task readied -- returns to caller 940 939
- rtems_region_delete 301 348
- rtems_io_initialize 9 10
- rtems_io_open 6 6
- rtems_io_close 6 6
- rtems_io_read 6 6
- rtems_io_write 6 5
- rtems_io_control 6 6
-
-21 rtems_task_ident 1057 1058
- rtems_message_queue_ident 963 963
- rtems_semaphore_ident 1137 1136
- rtems_partition_ident 962 961
- rtems_region_ident 923 924
- rtems_port_ident 918 917
- rtems_timer_ident 942 941
- rtems_rate_monotonic_ident 924 925
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 1084 1095
- rtems_message_queue_broadcast: no waiting tasks 147 148
- rtems_message_queue_broadcast: task readied -- preempts caller 1305 1268
-
-23 rtems_timer_create 202 201
- rtems_timer_fire_after: inactive 261 261
- rtems_timer_fire_after: active 271 269
- rtems_timer_cancel: active 142 141
- rtems_timer_cancel: inactive 122 124
- rtems_timer_reset: inactive 222 222
- rtems_timer_reset: active 246 245
- rtems_timer_fire_when: inactive 312 311
- rtems_timer_fire_when: active 358 358
- rtems_timer_delete: active 263 263
- rtems_timer_delete: inactive 247 247
- rtems_task_wake_when 833 831
-
-24 rtems_task_wake_after: yield -- returns to caller 99 98
- rtems_task_wake_after: yields -- preempts caller 479 478
-
-25 rtems_clock_tick 313 318
-
-26 _ISR_Disable 64 57
- _ISR_Flash 51 36
- _ISR_Enable 31 18
- _Thread_Disable_dispatch 53 37
- _Thread_Enable_dispatch 260 233
- _Thread_Set_state 446 463
- _Thread_Disptach (NO FP) 839 801
- context switch: no floating point contexts 673 653
- context switch: self 156 162
- context switch: to another task 84 70
- context switch: restore 1st FP task 1030 1013
- fp context switch: save idle, restore idle 969 948
- fp context switch: save idle, restore initialized 275 267
- fp context switch: save initialized, restore initialized 319 292
- _Thread_Resume 512 480
- _Thread_Unblock 121 139
- _Thread_Ready 199 203
- _Thread_Get 27 27
- _Semaphore_Get 20 21
- _Thread_Get: invalid id 5 5
-
-27 interrupt entry overhead: returns to interrupted task 0 0
- interrupt exit overhead: returns to interrupted task 27 41
- interrupt entry overhead: returns to nested interrupt 0 0
- interrupt exit overhead: returns to nested interrupt 0 0
- interrupt entry overhead: returns to preempting task 0 0
- interrupt exit overhead: returns to preempting task 0 0
-
-28 rtems_port_create 574 560
- rtems_port_external_to_internal 87 87
- rtems_port_internal_to_external 86 86
- rtems_port_delete 395 353
-
-29 rtems_rate_monotonic_create 621 633
- rtems_rate_monotonic_period: initiate period -- returns to caller 773 694
- rtems_rate_monotonic_period: obtain status 295 284
- rtems_rate_monotonic_cancel 408 451
- rtems_rate_monotonic_delete: inactive 453 471
- rtems_rate_monotonic_delete: active 332 336
- rtems_rate_monotonic_period: conclude periods -- caller blocks 664 686
diff --git a/c/src/lib/libbsp/mips64orion/Makefile.in b/c/src/lib/libbsp/mips64orion/Makefile.in
deleted file mode 100644
index f049e9b2e8..0000000000
--- a/c/src/lib/libbsp/mips64orion/Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# Descend into the $(RTEMS_BSP_FAMILY) directory
-SUB_DIRS=$(RTEMS_BSP_FAMILY)
diff --git a/c/src/lib/libbsp/mips64orion/README b/c/src/lib/libbsp/mips64orion/README
deleted file mode 100644
index 7f16e33d39..0000000000
--- a/c/src/lib/libbsp/mips64orion/README
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# $Id$
-#
-
-The MIPS bsp are now called p4600 and p4650, referring to which cpu they use.
-The same bsp sub-directory can be used, the cpu is selected by the bsp
-specific makefiles (p4600.cfg and p4650.cfg).
diff --git a/c/src/lib/libbsp/mips64orion/p4000/Makefile.in b/c/src/lib/libbsp/mips64orion/p4000/Makefile.in
deleted file mode 100644
index d888592a37..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SRCS=README
-
-all: $(SRCS)
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include startup console liblnk wrapup
diff --git a/c/src/lib/libbsp/mips64orion/p4000/README b/c/src/lib/libbsp/mips64orion/p4000/README
deleted file mode 100644
index 361366d01d..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/README
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# $Id$
-#
-# @(#)README 08/20/96 1.2
-#
-
-BSP NAME: p4000
-BOARD: Algorithmics P4000 SBC
-BUS: N/A
-CPU FAMILY: mips
-CPU: IDT 4650
-COPROCESSORS: N/A
-MODE: 32 bit mode
-
-DEBUG MONITOR: IDT/SIM
-
-PERIPHERALS
-===========
-TIMERS: 4650 internal
- RESOLUTION: half of internal clock frequency
-SERIAL PORTS: IDT/SIM controlled
-REAL-TIME CLOCK: none
-DMA: none
-VIDEO: none
-SCSI: none
-NETWORKING: none
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: 4650 internal
-IOSUPP DRIVER: N/A
-SHMSUPP: N/A
-TIMER DRIVER: 4650 internal
-TTY DRIVER: uses IDT/SIM
-
-STDIO
-=====
-PORT: Console port 0
-ELECTRICAL: RS-232
-BAUD: 9600
-BITS PER CHARACTER: 8
-PARITY: None
-STOP BITS: 1
-
-NOTES
-=====
-
diff --git a/c/src/lib/libbsp/mips64orion/p4000/bsp_specs b/c/src/lib/libbsp/mips64orion/p4000/bsp_specs
deleted file mode 100644
index 3f488f47b6..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: idt_csu.o%s} \
-%{qrtems_debug: idt_csu_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/mips64orion/p4000/console/Makefile.in b/c/src/lib/libbsp/mips64orion/p4000/console/Makefile.in
deleted file mode 100644
index e8817eb290..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/console/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=led
-S_FILES=$(S_PIECES:%=%.S)
-S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/mips64orion/p4000/console/console.c b/c/src/lib/libbsp/mips64orion/p4000/console/console.c
deleted file mode 100644
index c862c91cfa..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/console/console.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * This file contains the IDT 4650 console IO package.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/lib/libbsp/no_cpu/no_bsp/console/console.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)console.c 08/20/96 1.6\n";
- */
-
-
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <ctype.h>
-
-char idtsim_getchar( void );
-void idtsim_putchar( char c );
-void mips_leddisplay( char a, char b, char c, char d );
-
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-}
-
-
-/* is_character_ready
- *
- * This routine returns TRUE if a character is available.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_boolean is_character_ready(
- char *ch
-)
-{
- *ch = '\0'; /* return NULL for no particular reason */
- return(TRUE);
-}
-
-/* inbyte
- *
- * This routine reads a character from the SOURCE.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- * character read from SOURCE
- */
-
-char inbyte( void )
-{
- /*
- * If polling, wait until a character is available.
- */
-
- return idtsim_getchar();
-}
-
-/* outbyte
- *
- * This routine transmits a character out the SOURCE. It may support
- * XON/XOFF flow control.
- *
- * Input parameters:
- * ch - character to be transmitted
- *
- * Output parameters: NONE
- */
-
-void outbyte(
- char ch
-)
-{
-#define NUM_LEDS 4
- static unsigned int cur_led = 0;
- static unsigned char led_chars[NUM_LEDS];
-
- /*
- * If polling, wait for the transmitter to be ready.
- * Check for flow control requests and process.
- * Then output the character.
- */
-
- idtsim_putchar( ch );
-
- /* print out first four alpha numeric characters in a line */
- if ( ch == '\n' )
- {
- mips_leddisplay( led_chars[0], led_chars[1], led_chars[2], led_chars[3] );
- cur_led = 0;
- }
- else if ( isalnum( (unsigned char) ch ) && cur_led < NUM_LEDS )
- {
- led_chars[cur_led++] = ch;
- }
-
-}
-
-
-#if 0
-static int console_fd = -1;
-#endif
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
-#if 0
- int console_fd = open("tty0", 2); /* open for read/write */
-#endif
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
-#if 0
- if ( console_fd )
- close( console_fd );
-#endif
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte();
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r');
- }
- outbyte( buffer[ count ] );
- }
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/mips64orion/p4000/console/led.S b/c/src/lib/libbsp/mips64orion/p4000/console/led.S
deleted file mode 100644
index e62b82e041..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/console/led.S
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtmon.h>
-#include <rtems/score/idtcpu.h>
-
-
-FRAME(mips_leddisplay,sp,0,ra)
- j ra
- nop
-ENDFRAME(mips_leddisplay)
-
-FRAME(sbddisplay,sp,0,ra)
- j ra
-ENDFRAME(sbddisplay)
-
-
-FRAME(sbdblank,sp,0,ra)
- j ra
-ENDFRAME(sbdblank)
-
diff --git a/c/src/lib/libbsp/mips64orion/p4000/include/Makefile.in b/c/src/lib/libbsp/mips64orion/p4000/include/Makefile.in
deleted file mode 100644
index 7d8581095f..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/mips64orion/p4000/include/bsp.h b/c/src/lib/libbsp/mips64orion/p4000/include/bsp.h
deleted file mode 100644
index da700b8dba..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/include/bsp.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* bsp.h
- *
- * This include file contains all board IO definitions.
- *
- * XXX : put yours in here
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-/* @(#)bsp.h 03/15/96 1.1 */
-
-#ifndef __P4000_BSP_h
-#define __P4000_BSP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <console.h>
-#include <clockdrv.h>
-
-extern void WriteDisplay( char * string );
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Stuff for Time Test 27
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), 0, 1 )
-
-#define Cause_tm27_intr()
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-extern unsigned32 mips_get_timer( void );
-
-#define CPU_CLOCK_RATE_MHZ (50)
-#define CLOCKS_PER_MICROSECOND ( CPU_CLOCK_RATE_MHZ ) /* equivalent to CPU clock speed in MHz */
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- *
- * NOTE: This macro generates a warning like "integer constant out
- * of range" which is safe to ignore. In 64 bit mode, unsigned32
- * types are actually 64 bits long so that comparisons between
- * unsigned32 types and pointers are valid. The warning is caused
- * by code in the delay macro that is necessary for 64 bit mode.
- */
-
-#define delay( microseconds ) \
- { \
- unsigned32 _end_clock = mips_get_timer() + microseconds * CLOCKS_PER_MICROSECOND; \
- _end_clock %= 0x100000000; /* make sure result is 32 bits */ \
- \
- /* handle timer overflow, if necessary */ \
- while ( _end_clock < mips_get_timer() ); \
- \
- while ( _end_clock > mips_get_timer() ); \
- }
-
-/* Constants */
-
-#define RAM_START 0
-#define RAM_END 0x100000
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* miscellaneous stuff assumed to exist */
-
-mips_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/mips64orion/p4000/include/coverhd.h b/c/src/lib/libbsp/mips64orion/p4000/include/coverhd.h
deleted file mode 100644
index aca390463b..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/include/coverhd.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- * This file should be updated after running the C overhead timing
- * test. Once this update has been performed, the RTEMS Time Test
- * Suite should be rebuilt to account for these overhead times in the
- * timing results.
- *
- * NOTE: If these are all zero, then the times reported include
- * all calling overhead including passing of arguments.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-/* @(#)coverhd.h 04/08/96 1.3 */
-
-#ifndef __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 5
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 4
-#define CALLING_OVERHEAD_TASK_CREATE 6
-#define CALLING_OVERHEAD_TASK_IDENT 4
-#define CALLING_OVERHEAD_TASK_START 5
-#define CALLING_OVERHEAD_TASK_RESTART 4
-#define CALLING_OVERHEAD_TASK_DELETE 4
-#define CALLING_OVERHEAD_TASK_SUSPEND 4
-#define CALLING_OVERHEAD_TASK_RESUME 4
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 5
-#define CALLING_OVERHEAD_TASK_MODE 4
-#define CALLING_OVERHEAD_TASK_GET_NOTE 5
-#define CALLING_OVERHEAD_TASK_SET_NOTE 5
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 9
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 4
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 5
-#define CALLING_OVERHEAD_CLOCK_GET 9
-#define CALLING_OVERHEAD_CLOCK_SET 8
-#define CALLING_OVERHEAD_CLOCK_TICK 3
-
-#define CALLING_OVERHEAD_TIMER_CREATE 4
-#define CALLING_OVERHEAD_TIMER_IDENT 4
-#define CALLING_OVERHEAD_TIMER_DELETE 4
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 6
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 10
-#define CALLING_OVERHEAD_TIMER_RESET 4
-#define CALLING_OVERHEAD_TIMER_CANCEL 4
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 5
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 4
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 4
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 5
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 5
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 5
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 5
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 4
-
-#define CALLING_OVERHEAD_EVENT_SEND 4
-#define CALLING_OVERHEAD_EVENT_RECEIVE 5
-#define CALLING_OVERHEAD_SIGNAL_CATCH 5
-#define CALLING_OVERHEAD_SIGNAL_SEND 4
-#define CALLING_OVERHEAD_PARTITION_CREATE 6
-#define CALLING_OVERHEAD_PARTITION_IDENT 4
-#define CALLING_OVERHEAD_PARTITION_DELETE 4
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 4
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 4
-#define CALLING_OVERHEAD_REGION_CREATE 6
-#define CALLING_OVERHEAD_REGION_IDENT 4
-#define CALLING_OVERHEAD_REGION_DELETE 4
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 5
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 4
-#define CALLING_OVERHEAD_PORT_CREATE 6
-#define CALLING_OVERHEAD_PORT_IDENT 4
-#define CALLING_OVERHEAD_PORT_DELETE 4
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 4
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 4
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 5
-#define CALLING_OVERHEAD_IO_OPEN 5
-#define CALLING_OVERHEAD_IO_CLOSE 5
-#define CALLING_OVERHEAD_IO_READ 5
-#define CALLING_OVERHEAD_IO_WRITE 5
-#define CALLING_OVERHEAD_IO_CONTROL 5
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 4
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 3
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/mips64orion/p4000/liblnk/Makefile.in b/c/src/lib/libbsp/mips64orion/p4000/liblnk/Makefile.in
deleted file mode 100644
index c50b8c5884..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/liblnk/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/liblnk.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=lnklib
-S_FILES=$(S_PIECES:%=%.S)
-S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/mips64orion/p4000/liblnk/lnklib.S b/c/src/lib/libbsp/mips64orion/p4000/liblnk/lnklib.S
deleted file mode 100644
index ae2509ce3c..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/liblnk/lnklib.S
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtcpu.h>
-
-#define FRAME(name,frm_reg,offset,ret_reg) \
- .globl name; \
- .ent name; \
-name:; \
- .frame frm_reg,offset,ret_reg
-
-#define ENDFRAME(name) \
- .end name
-
-#define PROM_LINK(name,entry) \
- .globl name; \
- .ent name; \
-name: la $2,+entry; \
- j $2; \
- .end name
-
-#define PROM_ENTRY(x) (0xbfc00000+((x)*8))
-
-#define PROM_RESET PROM_ENTRY(0)
-#define PROM_NOT_IMP PROM_ENTRY(1)
-#define PROM_RESTART PROM_ENTRY(2)
-#define PROM_REINIT PROM_ENTRY(3)
-#define PROM_GETCHAR PROM_ENTRY(11)
-#define PROM_PUTCHAR PROM_ENTRY(12)
-#define PROM_SHOWCHAR PROM_ENTRY(13)
-#define PROM_PRINTF PROM_ENTRY(16)
-#define PROM_RETURN PROM_ENTRY(17)
-
-#define PROM_RGETS PROM_ENTRY(25)
-#define PROM_FLUSHCACHE PROM_ENTRY(28)
-#define PROM_CLEARCACHE PROM_ENTRY(29)
-#define PROM_SETJMP PROM_ENTRY(30)
-#define PROM_LONGJMP PROM_ENTRY(31)
-
- .text
-
-PROM_LINK(idtsim_putchar, PROM_PUTCHAR)
-PROM_LINK(idtsim_getchar, PROM_GETCHAR)
-PROM_LINK(idtsim_showchar, PROM_SHOWCHAR)
-PROM_LINK(idtsim__exit, PROM_RETURN)
-PROM_LINK(idtsim_reinit, PROM_REINIT)
-PROM_LINK(idtsim_restart, PROM_RESTART)
-PROM_LINK(idtsim_reset, PROM_RESET)
-PROM_LINK(idtsim_promexit, PROM_RETURN)
-PROM_LINK(idtsim_setjmp, PROM_SETJMP)
-PROM_LINK(idtsim_longjmp, PROM_LONGJMP)
-
-FRAME(idtsim_init_sbrk,sp,0,ra)
- j ra
-ENDFRAME(idtsim_init_sbrk)
-
-FRAME(idtsim_init_file,sp,0,ra)
- j ra
-ENDFRAME(idtsim_init_file)
-
diff --git a/c/src/lib/libbsp/mips64orion/p4000/start/Makefile.in b/c/src/lib/libbsp/mips64orion/p4000/start/Makefile.in
deleted file mode 100644
index 046969120a..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/start/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=idt_csu
-S_FILES=$(S_PIECES:%=%.S)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-PGM=${ARCH}/idt_csu.o
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/mips64orion/p4000/start/start.S b/c/src/lib/libbsp/mips64orion/p4000/start/start.S
deleted file mode 100644
index 8dc31c8999..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/start/start.S
+++ /dev/null
@@ -1,299 +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$
-*/
-
-/*************************************************************************
-**
-** Copyright 1991-95 Integrated Device Technology, Inc.
-** All Rights Reserved
-**
-** idt_csu.S -- IDT stand alone startup code
-**
-**************************************************************************/
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtcpu.h>
-#include <rtems/score/idtmon.h>
-
-
-.extern _fbss,4 /* this is defined by the linker */
-.extern end,4 /* this is defined by the linker */
-
-.lcomm sim_mem_cfg_struct,12
-
- .text
-
-
-#define TMP_STKSIZE 1024
-
-/**************************************************************************
-**
-** start - Typicl standalone start up code required for R3000/R4000
-**
-**
-** 1) Initialize the STATUS Register
-** a) Clear parity error bit
-** b) Set co_processor 1 usable bit ON
-** c) Clear all IntMask Enables
-** d) Set kernel/disabled mode
-** 2) Initialize Cause Register
-** a) clear software interrupt bits
-** 3) Determine FPU installed or not
-** if not, clear CoProcessor 1 usable bit
-** 4) Clear bss area
-** 5) MUST allocate temporary stack until memory size determined
-** It MUST be uncached to prevent overwriting when caches are cleared
-** 6) Install exception handlers
-** 7) Determine memory and cache sizes
-** 8) Establish permanent stack (cached or uncached as defined by bss)
-** 9) Flush Instruction and Data caches
-** 10) If there is a Translation Lookaside Buffer, Clear the TLB
-** 11) Execute initialization code if the IDT/c library is to be used
-**
-** 12) Jump to user's "main()"
-** 13) Jump to promexit
-**
-** IDT/C 5.x defines _R3000, IDT/C 6.x defines _R4000 internally.
-** This is used to mark code specific to R3xxx or R4xxx processors.
-** IDT/C 6.x defines __mips to be the ISA level for which we're
-** generating code. This is used to make sure the stack etc. is
-** double word aligned, when using -mips3 (default) or -mips2,
-** when compiling with IDT/C6.x
-**
-***************************************************************************/
-
-FRAME(start,sp,0,ra)
-
- .set noreorder
-#ifdef _R3000
- li v0,SR_PE|SR_CU1 /* reset parity error and set */
- /* cp1 usable */
-#endif
-#ifdef _R4000
-#if __mips==3 || defined(R4650)
- li v0,SR_CU1|SR_DE|SR_FR /* initally clear ERL, enable FPA 64bit regs*/
- /* 4650: Need fr to be set anyway */
-#else
- li v0,SR_CU1|SR_DE /* initally clear ERL, enable FPA 32bit regs*/
-#endif mips3
-#endif
-
- mtc0 v0,C0_SR /* clr IntMsks/ kernel/disabled mode */
- nop
- mtc0 zero,C0_CAUSE /* clear software interrupts */
- nop
-
-#ifdef _R4000
- li v0,CFG_C_NONCOHERENT # initialise default cache mode
- mtc0 v0,C0_CONFIG
-#endif
-
-/*
-** check to see if an fpu is really plugged in
-*/
- li t3,0xaaaa5555 /* put a's and 5's in t3 */
- mtc1 t3,fp0 /* try to write them into fp0 */
- mtc1 zero,fp1 /* try to write zero in fp */
- mfc1 t0,fp0
- mfc1 t1,fp1
- nop
- bne t0,t3,1f /* branch if no match */
- nop
- bne t1,zero,1f /* double check for positive id */
- nop
- /* We have a FPU. clear fcsr */
- ctc1 zero, fcr31
- j 2f /* status register already correct */
- nop
-1:
-#ifdef _R3000
- li v0, SR_PE /* reset parity error/NO cp1 usable */
-#endif
-
-#ifdef _R4000
- li v0,SR_DE /* clear ERL and disable FPA */
-#endif
-
- mtc0 v0, C0_SR /* reset status register */
-2:
- la gp, _gp
-
- la v0,_fbss /* clear bss before using it */
- la v1,end /* end of bss */
-3: sw zero,0(v0)
- bltu v0,v1,3b
- add v0,4
-
-
-/************************************************************************
-**
-** Temporary Stack - needed to handle stack saves until
-** memory size is determined and permanent stack set
-**
-** MUST be uncached to avoid confusion at cache
-** switching during memory sizing
-**
-*************************************************************************/
-#if __mips==3
- /* For MIPS 3, we need to be sure that the stack is aligned on a
- * double word boundary.
- */
- andi t0, v0, 0x7
- beqz t0, 11f /* Last three bits Zero, already aligned */
- nop
- add v0, 4
-11:
-#endif
-
- or v0, K1BASE /* switch to uncached */
- add v1, v0, TMP_STKSIZE /* end of bss + length of tmp stack */
- sub v1, v1, (4*4) /* overhead */
- move sp, v1 /* set sp to top of stack */
-4: sw zero, 0(v0)
- bltu v0, v1, 4b /* clear out temp stack */
- add v0, 4
-
- jal init_exc_vecs /* install exception handlers */
- nop /* MUST do before memory probes */
-
- la v0, 5f
- li v1, K1BASE /* force into uncached space */
- or v0, v1 /* during memory/cache probes */
- j v0
- nop
-5:
- la a0, sim_mem_cfg_struct
- jal sim_mem_cfg /* Make SIM call to get mem size */
- nop
- la a0, sim_mem_cfg_struct
- lw a0, 0(a0) /* Get memory size from struct */
-#ifdef _R3000
- jal config_Icache
- nop
- jal config_Dcache /* determine size of D & I caches */
- nop
-#endif
-#ifdef _R4000
- jal config_cache /* determine size of D & I caches */
- nop
-#endif
-
- move v0, a0 /* mem_size */
-
-#if __mips==3
- /* For MIPS 3, we need to be sure that the stack (and hence v0
- * here) is aligned on a double word boundary.
- */
- andi t0, v0, 0x7
- beqz t0, 12f /* Last three bits Zero, already aligned */
- nop
- subu v0, 4 /* mem_size was not aligned on doubleword bdry????*/
-12:
-#endif
-
-
-
-/**************************************************************************
-**
-** Permanent Stack - now know top of memory, put permanent stack there
-**
-***************************************************************************/
-
- la t2, _fbss /* cache mode as linked */
- and t2, 0xF0000000 /* isolate segment */
- la t1, 6f
- j t1 /* back to original cache mode */
- nop
-6:
- or v0, t2 /* stack back to original cache mode */
- addiu v0,v0,-16 /* overhead */
- move sp, v0 /* now replace count w top of memory */
- move v1, v0
- subu v1, P_STACKSIZE /* clear requested stack size */
-
-7: sw zero, 0(v1) /* clear P_STACKSIZE stack */
- bltu v1,v0,7b
- add v1, 4
- .set reorder
-
-#ifdef _R3000
- jal flush_Icache
- jal flush_Dcache /* flush Data & Instruction caches */
-#endif
-#ifdef _R4000
- jal flush_cache_nowrite /* flush Data & Instruction caches */
-#endif
-
-
-
-/**************************************************************************
-**
-** If this chip supports a Translation Lookaside Buffer, clear it
-**
-***************************************************************************/
-
- .set noreorder
- mfc0 t1, C0_SR /* look at Status Register */
- nop
- .set reorder
-#ifdef _R3000
- li t2, SR_TS /* TLB Shutdown bit */
- and t1,t2 /* TLB Shutdown if 1 */
- bnez t1, 8f /* skip clearing if no TLB */
-#endif
-
-#ifndef R4650
- jal init_tlb /* clear the tlb */
-#endif
-
-
-/************************************************************************
-**
-** Initialization required if using IDT/c or libc.a, standard C Lib
-**
-** can SKIP if not necessary for application
-**
-************************************************************************/
-8:
-
- jal idtsim_init_sbrk
- jal idtsim_init_file
-/*********************** END I/O initialization **********************/
-
-
- jal main
-
- jal idtsim_promexit
-
-ENDFRAME(start)
-
-
- .globl sim_mem_cfg
-sim_mem_cfg:
- .set noat
- .set noreorder
- li AT, (0xbfc00000+((55)*8))
- jr AT
- nop
- .set at
- .set reorder
diff --git a/c/src/lib/libbsp/mips64orion/p4000/startup/Makefile.in b/c/src/lib/libbsp/mips64orion/p4000/startup/Makefile.in
deleted file mode 100644
index 5a09532841..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/startup/Makefile.in
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec inittlb
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=idtmem idttlb
-S_FILES=$(S_PIECES:%=%.S)
-S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
-
-SRCS=ghlinkcmds linkcmds $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/ghlinkcmds $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-
-
-
diff --git a/c/src/lib/libbsp/mips64orion/p4000/startup/bspclean.c b/c/src/lib/libbsp/mips64orion/p4000/startup/bspclean.c
deleted file mode 100644
index 5382c8491c..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/startup/bspclean.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine normally is part of start.s and usually returns
- * control to a monitor.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)bspclean.c 03/15/96 1.1\n";
- */
-
-
-
-#include <rtems.h>
-#include <bsp.h>
-
-void idtsim__exit();
-
-void bsp_cleanup( void )
-{
- idtsim__exit();
-}
diff --git a/c/src/lib/libbsp/mips64orion/p4000/startup/bspstart.c b/c/src/lib/libbsp/mips64orion/p4000/startup/bspstart.c
deleted file mode 100644
index bdd0c3074d..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/startup/bspstart.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)bspstart.c 06/11/96 1.2\n";
- */
-
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-#define LIBC_HEAP_SIZE (64 * 1024)
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, LIBC_HEAP_SIZE, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-extern int end; /* defined by linker */
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- /*
- * Allocate the memory for the RTEMS Work Space. This can come from
- * a variety of places: hard coded address, malloc'ed from outside
- * RTEMS world (e.g. simulator or primitive memory manager), or (as
- * typically done by stock BSPs) by subtracting the required amount
- * of work space from the last physical address on the CPU board.
- */
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
-
- BSP_Configuration.work_space_start =
- (void *)((unsigned64)((&end) + LIBC_HEAP_SIZE + 0x2000) & ~0x7);
-
- /*
- * initialize the CPU table for this BSP
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_stack_size = 4096;
-}
diff --git a/c/src/lib/libbsp/mips64orion/p4000/startup/ghlinkcmds b/c/src/lib/libbsp/mips64orion/p4000/startup/ghlinkcmds
deleted file mode 100644
index 34cdbab802..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/startup/ghlinkcmds
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# $Id$
-#
-
--map
--sec
-{
- .text 0x80010000 :
- .data align(16) :
- .rodata :
- .fini :
-# .sdata :
- .symtab :
- .strtab :
- .debug :
-# .sbss :
- .bss align(8) :
- .init 0xbfc00000 :
-}
diff --git a/c/src/lib/libbsp/mips64orion/p4000/startup/idtmem.S b/c/src/lib/libbsp/mips64orion/p4000/startup/idtmem.S
deleted file mode 100644
index 70a7096877..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/startup/idtmem.S
+++ /dev/null
@@ -1,938 +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$
-
-*/
-
-/************************************************************************
-**
-** idtmem.s - memory and cache functions
-**
-** Copyright 1991 Integrated Device Technology, Inc.
-** All Rights Reserved
-**
-**************************************************************************/
-
-/*
- * 950313: Ketan fixed bugs in mfc0/mtc0 hazards, and removed hack
- * to set mem_size.
- */
-
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtcpu.h>
-#include <rtems/score/idtmon.h>
-
- .data
-mem_size:
- .word 0
-dcache_size:
- .word 0
-icache_size:
-#if defined(CPU_R3000)
- .word MINCACHE
-#endif
-#if defined(CPU_R4000)
- .word 0
-#endif
-
-#if defined(CPU_R4000)
- .data
-scache_size:
- .word 0
-icache_linesize:
- .word 0
-dcache_linesize:
- .word 0
-scache_linesize:
- .word 0
-#endif
-
-
- .text
-
-#if defined (CPU_R3000)
-#define CONFIGFRM ((2*4)+4)
-
-/*************************************************************************
-**
-** Config_Dcache() -- determine size of Data cache
-**
-**************************************************************************/
-
-FRAME(config_Dcache,sp, CONFIGFRM, ra)
- .set noreorder
- subu sp,CONFIGFRM
- sw ra,CONFIGFRM-4(sp) /* save return address */
- sw s0,4*4(sp) /* save s0 in first regsave slot */
- mfc0 s0,C0_SR /* save SR */
- nop
- mtc0 zero,C0_SR /* disable interrupts */
- .set reorder
- jal _size_cache /* returns Data cache size in v0 */
- sw v0, dcache_size /* save it */
- and s0, ~SR_PE /* do not clear PE */
- .set noreorder
- mtc0 s0,C0_SR /* restore SR */
- nop
- .set reorder
- lw s0, 4*4(sp) /* restore s0 */
- lw ra,CONFIGFRM-4(sp) /* restore ra */
- addu sp,CONFIGFRM /* pop stack */
- j ra
-ENDFRAME(config_Dcache)
-
-
-/*************************************************************************
-**
-** Config_Icache() -- determine size of Instruction cache
-** MUST be run in uncached mode/handled in idt_csu.s
-**
-**************************************************************************/
-
-FRAME(config_Icache,sp, CONFIGFRM, ra)
- .set noreorder
- subu sp,CONFIGFRM
- sw ra,CONFIGFRM-4(sp) /* save return address */
- sw s0,4*4(sp) /* save s0 in first regsave slot */
- mfc0 s0,C0_SR /* save SR */
- nop
- mtc0 zero, C0_SR /* disable interrupts */
- li v0,SR_SWC /* swap caches/disable ints */
- mtc0 v0,C0_SR
- nop
- .set reorder
- jal _size_cache /* returns instruction cache size */
- .set noreorder
- mtc0 zero,C0_SR /* swap back caches */
- nop
- and s0,~SR_PE /* do not inadvertantly clear PE */
- mtc0 s0,C0_SR /* restore SR */
- nop
- .set reorder
- sw v0, icache_size /* save it AFTER caches back */
- lw s0,4*4(sp) /* restore s0 */
- lw ra,CONFIGFRM-4(sp) /* restore ra */
- addu sp,CONFIGFRM /* pop stack */
- j ra
-ENDFRAME(config_Icache)
-
-/************************************************************************
-**
-** _size_cache()
-** returns cache size in v0
-**
-************************************************************************/
-
-FRAME(_size_cache,sp,0,ra)
- .set noreorder
- mfc0 t0,C0_SR /* save current sr */
- nop
- and t0,~SR_PE /* do not inadvertently clear PE */
- or v0,t0,SR_ISC /* isolate cache */
- mtc0 v0,C0_SR
- /*
- * First check if there is a cache there at all
- */
- move v0,zero
- li v1,0xa5a5a5a5 /* distinctive pattern */
- sw v1,K0BASE /* try to write into cache */
- lw t1,K0BASE /* try to read from cache */
- nop
- mfc0 t2,C0_SR
- nop
- .set reorder
- and t2,SR_CM
- bne t2,zero,3f /* cache miss, must be no cache */
- bne v1,t1,3f /* data not equal -> no cache */
- /*
- * Clear cache size boundries to known state.
- */
- li v0,MINCACHE
-1:
- sw zero,K0BASE(v0)
- sll v0,1
- ble v0,MAXCACHE,1b
-
- li v0,-1
- sw v0,K0BASE(zero) /* store marker in cache */
- li v0,MINCACHE /* MIN cache size */
-
-2: lw v1,K0BASE(v0) /* Look for marker */
- bne v1,zero,3f /* found marker */
- sll v0,1 /* cache size * 2 */
- ble v0,MAXCACHE,2b /* keep looking */
- move v0,zero /* must be no cache */
- .set noreorder
-3: mtc0 t0,C0_SR /* restore sr */
- j ra
- nop
-ENDFRAME(_size_cache)
- .set reorder
-
-
-#define FLUSHFRM (2*4)
-
-/***************************************************************************
-**
-** flush_Dcache() - flush entire Data cache
-**
-****************************************************************************/
-FRAME(flush_Dcache,sp,FLUSHFRM,ra)
- lw t2, dcache_size
- .set noreorder
- mfc0 t3,C0_SR /* save SR */
- nop
- and t3,~SR_PE /* dont inadvertently clear PE */
- beq t2,zero,_Dflush_done /* no D cache, get out! */
- nop
- li v0, SR_ISC /* isolate cache */
- mtc0 v0, C0_SR
- nop
- .set reorder
- li t0,K0BASE /* set loop registers */
- or t1,t0,t2
-
-2: sb zero,0(t0)
- sb zero,4(t0)
- sb zero,8(t0)
- sb zero,12(t0)
- sb zero,16(t0)
- sb zero,20(t0)
- sb zero,24(t0)
- addu t0,32
- sb zero,-4(t0)
- bne t0,t1,2b
-
- .set noreorder
-_Dflush_done:
- mtc0 t3,C0_SR /* restore Status Register */
- .set reorder
- j ra
-ENDFRAME(flush_Dcache)
-
-
-/***************************************************************************
-**
-** flush_Icache() - flush entire Instruction cache
-**
-** NOTE: Icache can only be flushed/cleared when uncached
-** Code forces into uncached memory regardless of calling mode
-**
-****************************************************************************/
-FRAME(flush_Icache,sp,FLUSHFRM,ra)
- lw t1,icache_size
- .set noreorder
- mfc0 t3,C0_SR /* save SR */
- nop
- la v0,1f
- li v1,K1BASE
- or v0,v1
- j v0 /* force into non-cached space */
- nop
-1:
- and t3,~SR_PE /* dont inadvertently clear PE */
- beq t1,zero,_Iflush_done /* no i-cache get out */
- nop
- li v0,SR_ISC|SR_SWC /* disable intr, isolate and swap */
- mtc0 v0,C0_SR
- li t0,K0BASE
- .set reorder
- or t1,t0,t1
-
-1: sb zero,0(t0)
- sb zero,4(t0)
- sb zero,8(t0)
- sb zero,12(t0)
- sb zero,16(t0)
- sb zero,20(t0)
- sb zero,24(t0)
- addu t0,32
- sb zero,-4(t0)
- bne t0,t1,1b
- .set noreorder
-_Iflush_done:
- mtc0 t3,C0_SR /* un-isolate, enable interrupts */
- .set reorder
- j ra
-ENDFRAME(flush_Icache)
-
-/**************************************************************************
-**
-** clear_Dcache(base_addr, byte_count) - flush portion of Data cache
-**
-** a0 = base address of portion to be cleared
-** a1 = byte count of length
-**
-***************************************************************************/
-FRAME(clear_Dcache,sp,0,ra)
-
- lw t2, dcache_size /* Data cache size */
- .set noreorder
- mfc0 t3,C0_SR /* save SR */
- nop
- and t3,~SR_PE /* dont inadvertently clear PE */
- nop
- nop
- .set reorder
- /*
- * flush data cache
- */
-
- .set noreorder
- nop
- li v0,SR_ISC /* isolate data cache */
- mtc0 v0,C0_SR
- .set reorder
- bltu t2,a1,1f /* cache is smaller than region */
- move t2,a1
-1: addu t2,a0 /* ending address + 1 */
- move t0,a0
-
-1: sb zero,0(t0)
- sb zero,4(t0)
- sb zero,8(t0)
- sb zero,12(t0)
- sb zero,16(t0)
- sb zero,20(t0)
- sb zero,24(t0)
- addu t0,32
- sb zero,-4(t0)
- bltu t0,t2,1b
-
- .set noreorder
- mtc0 t3,C0_SR /* un-isolate, enable interrupts */
- nop
- .set reorder
- j ra
-ENDFRAME(clear_Dcache)
-
-
-/**************************************************************************
-**
-** clear_Icache(base_addr, byte_count) - flush portion of Instruction cache
-**
-** a0 = base address of portion to be cleared
-** a1 = byte count of length
-**
-** NOTE: Icache can only be flushed/cleared when uncached
-** Code forces into uncached memory regardless of calling mode
-**
-***************************************************************************/
-FRAME(clear_Icache,sp,0,ra)
-
- lw t1, icache_size /* Instruction cache size */
- /*
- * flush text cache
- */
- .set noreorder
- mfc0 t3,C0_SR /* save SR */
- nop
- la v0,1f
- li v1,K1BASE
- or v0,v1
- j v0 /* force into non-cached space */
- nop
-1:
- and t3,~SR_PE /* dont inadvertently clear PE */
- nop
- nop
- li v0,SR_ISC|SR_SWC /* disable intr, isolate and swap */
- mtc0 v0,C0_SR
- .set reorder
- bltu t1,a1,1f /* cache is smaller than region */
- move t1,a1
-1: addu t1,a0 /* ending address + 1 */
- move t0,a0
-
- sb zero,0(t0)
- sb zero,4(t0)
- sb zero,8(t0)
- sb zero,12(t0)
- sb zero,16(t0)
- sb zero,20(t0)
- sb zero,24(t0)
- addu t0,32
- sb zero,-4(t0)
- bltu t0,t1,1b
- .set noreorder
- mtc0 t3,C0_SR /* un-isolate, enable interrupts */
- nop
- nop
- nop /* allow time for caches to swap */
- .set reorder
- j ra
-ENDFRAME(clear_Icache)
-
-
-/**************************************************************************
-**
-** get_mem_conf - get memory configuration
-**
-***************************************************************************/
-
-
-FRAME(get_mem_conf,sp,0,ra)
-
- lw t6, mem_size
- sw t6, 0(a0)
- lw t7, icache_size
- sw t7, 4(a0)
- lw t8, dcache_size
- sw t8, 8(a0)
- j ra
-
-ENDFRAME(get_mem_conf)
-#endif /* defined CPU_R3000 */
-
-#if defined(CPU_R4000)
-#define LEAF(label) FRAME(label,sp,0,ra)
-#define XLEAF(label) \
- .globl label ; \
-label:
-#define END(label) ENDFRAME(label)
-
-/*
- * cacheop macro to automate cache operations
- * first some helpers...
- */
-#define _mincache(size, maxsize) \
- bltu size,maxsize,8f ; \
- move size,maxsize ; \
-8:
-
-#define _align(tmp, minaddr, maxaddr, linesize) \
- subu tmp,linesize,1 ; \
- not tmp ; \
- and minaddr,tmp ; \
- addu maxaddr,-1 ; \
- and maxaddr,tmp
-
-/* This is a bit of a hack really because it relies on minaddr=a0 */
-#define _doop1(op1) \
- cache op1,0(a0)
-
-#define _doop2(op1, op2) \
- cache op1,0(a0) ; \
- cache op2,0(a0)
-
-/* specials for cache initialisation */
-#define _doop1lw1(op1) \
- cache op1,0(a0) ; \
- lw zero,0(a0) ; \
- cache op1,0(a0)
-
-#define _doop121(op1,op2) \
- cache op1,0(a0) ; \
- nop; \
- cache op2,0(a0) ; \
- nop; \
- cache op1,0(a0)
-
-#define _oploopn(minaddr, maxaddr, linesize, tag, ops) \
- .set noreorder ; \
-7: _doop##tag##ops ; \
- bne minaddr,maxaddr,7b ; \
- addu minaddr,linesize ; \
- .set reorder
-
-/* finally the cache operation macros */
-#define icacheopn(kva, n, cache_size, cache_linesize, tag, ops) \
- _mincache(n, cache_size); \
- blez n,9f ; \
- addu n,kva ; \
- _align(t1, kva, n, cache_linesize) ; \
- _oploopn(kva, n, cache_linesize, tag, ops) ; \
-9:
-
-#define vcacheopn(kva, n, cache_size, cache_linesize, tag, ops) \
- blez n,9f ; \
- addu n,kva ; \
- _align(t1, kva, n, cache_linesize) ; \
- _oploopn(kva, n, cache_linesize, tag, ops) ; \
-9:
-
-#define icacheop(kva, n, cache_size, cache_linesize, op) \
- icacheopn(kva, n, cache_size, cache_linesize, 1, (op))
-
-#define vcacheop(kva, n, cache_size, cache_linesize, op) \
- vcacheopn(kva, n, cache_size, cache_linesize, 1, (op))
-
- .text
-
-/*
- * static void _size_cache() R4000
- *
- * Internal routine to determine cache sizes by looking at R4000 config
- * register. Sizes are returned in registers, as follows:
- * t2 icache size
- * t3 dcache size
- * t6 scache size
- * t4 icache line size
- * t5 dcache line size
- * t7 scache line size
- */
-LEAF(_size_cache)
- mfc0 t0,C0_CONFIG
-
- and t1,t0,CFG_ICMASK
- srl t1,CFG_ICSHIFT
- li t2,0x1000
- sll t2,t1
-
- and t1,t0,CFG_DCMASK
- srl t1,CFG_DCSHIFT
- li t3,0x1000
- sll t3,t1
-
- li t4,32
- and t1,t0,CFG_IB
- bnez t1,1f
- li t4,16
-1:
-
- li t5,32
- and t1,t0,CFG_DB
- bnez t1,1f
- li t5,16
-1:
-
- move t6,zero # default to no scache
- move t7,zero #
-
- and t1,t0,CFG_C_UNCACHED # test config register
- bnez t1,1f # no scache if uncached/non-coherent
-
- li t6,0x100000 # assume 1Mb scache <<-NOTE
- and t1,t0,CFG_SBMASK
- srl t1,CFG_SBSHIFT
- li t7,16
- sll t7,t1
-1: j ra
-END(_size_cache)
-
-
-/*
- * void config_cache() R4000
- *
- * Work out size of I, D & S caches, assuming they are already initialised.
- */
-LEAF(config_cache)
- lw t0,icache_size
- bgtz t0,8f # already known?
- move v0,ra
- bal _size_cache
- move ra,v0
-
- sw t2,icache_size
- sw t3,dcache_size
- sw t6,scache_size
- sw t4,icache_linesize
- sw t5,dcache_linesize
- sw t7,scache_linesize
-8: j ra
-END(config_cache)
-
-
-/*
- * void _init_cache() R4000
- */
-LEAF(_init_cache)
- /*
- * First work out the sizes
- */
- move v0,ra
- bal _size_cache
- move ra,v0
-
- /*
- * The caches may be in an indeterminate state,
- * so we force good parity into them by doing an
- * invalidate, load/fill, invalidate for each line.
- */
-
- /* disable all i/u and cache exceptions */
- mfc0 v0,C0_SR
- and v1,v0,~SR_IE
- or v1,SR_DE
- mtc0 v1,C0_SR
-
- mtc0 zero,C0_TAGLO
- mtc0 zero,C0_TAGHI
-
- /* assume bottom of RAM will generate good parity for the cache */
- li a0,PHYS_TO_K0(0)
- move a2,t2 # icache_size
- move a3,t4 # icache_linesize
- move a1,a2
- icacheopn(a0,a1,a2,a3,121,(Index_Store_Tag_I,Fill_I))
-
- li a0,PHYS_TO_K0(0)
- move a2,t3 # dcache_size
- move a3,t5 # dcache_linesize
- move a1,a2
- icacheopn(a0,a1,a2,a3,1lw1,(Index_Store_Tag_D))
-
- /* assume unified I & D in scache <<-NOTE */
- blez t6,1f
- li a0,PHYS_TO_K0(0)
- move a2,t6
- move a3,t7
- move a1,a2
- icacheopn(a0,a1,a2,a3,1lw1,(Index_Store_Tag_SD))
-
-1: mtc0 v0,C0_SR
- j ra
-END(_init_cache)
-
-
-/*
- * void flush_cache (void) R4000
- *
- * Flush and invalidate all caches
- */
-LEAF(flush_cache)
- /* secondary cacheops do all the work if present */
- lw a2,scache_size
- blez a2,1f
- lw a3,scache_linesize
- li a0,PHYS_TO_K0(0)
- move a1,a2
- icacheop(a0,a1,a2,a3,Index_Writeback_Inv_SD)
- b 2f
-
-1:
- lw a2,icache_size
- blez a2,2f
- lw a3,icache_linesize
- li a0,PHYS_TO_K0(0)
- move a1,a2
- icacheop(a0,a1,a2,a3,Index_Invalidate_I)
-
- lw a2,dcache_size
- lw a3,dcache_linesize
- li a0,PHYS_TO_K0(0)
- move a1,a2
- icacheop(a0,a1,a2,a3,Index_Writeback_Inv_D)
-
-2: j ra
-END(flush_cache)
-
-/*
- * void flush_cache_nowrite (void) R4000
- *
- * Invalidate all caches
- */
-LEAF(flush_cache_nowrite)
- mfc0 v0,C0_SR
- and v1,v0,~SR_IE
- mtc0 v1,C0_SR
-
- mtc0 zero,C0_TAGLO
- mtc0 zero,C0_TAGHI
-
- lw a2,icache_size
- blez a2,2f
- lw a3,icache_linesize
- li a0,PHYS_TO_K0(0)
- move a1,a2
- icacheop(a0,a1,a2,a3,Index_Invalidate_I)
-
- lw a2,dcache_size
- lw a3,dcache_linesize
- li a0,PHYS_TO_K0(0)
- move a1,a2
- icacheop(a0,a1,a2,a3,Index_Store_Tag_D)
-
- lw a2,scache_size
- blez a2,2f
- lw a3,scache_linesize
- li a0,PHYS_TO_K0(0)
- move a1,a2
- icacheop(a0,a1,a2,a3,Index_Store_Tag_SD)
-
-2: mtc0 v0,C0_SR
- j ra
-END(flush_cache_nowrite)
-
-/*
- * void clean_cache (unsigned kva, size_t n) R4000
- *
- * Writeback and invalidate address range in all caches
- */
-LEAF(clean_cache)
-XLEAF(clear_cache)
-
- /* secondary cacheops do all the work (if fitted) */
- lw a2,scache_size
- blez a2,1f
- lw a3,scache_linesize
- vcacheop(a0,a1,a2,a3,Hit_Writeback_Inv_SD)
- b 2f
-
-1: lw a2,icache_size
- blez a2,2f
- lw a3,icache_linesize
- /* save kva & n for subsequent loop */
- move t8,a0
- move t9,a1
- vcacheop(a0,a1,a2,a3,Hit_Invalidate_I)
-
- lw a2,dcache_size
- lw a3,dcache_linesize
- /* restore kva & n */
- move a0,t8
- move a1,t9
- vcacheop(a0,a1,a2,a3,Hit_Writeback_Inv_D)
-
-2: j ra
-END(clean_cache)
-
-/*
- * void clean_dcache (unsigned kva, size_t n) R4000
- *
- * Writeback and invalidate address range in primary data cache
- */
-LEAF(clean_dcache)
- lw a2,dcache_size
- blez a2,2f
- lw a3,dcache_linesize
-
- vcacheop(a0,a1,a2,a3,Hit_Writeback_Inv_D)
-
-2: j ra
-END(clean_dcache)
-
-/*
- * void clean_dcache_indexed (unsigned kva, size_t n) R4000
- *
- * Writeback and invalidate indexed range in primary data cache
- */
-LEAF(clean_dcache_indexed)
- lw a2,dcache_size
- blez a2,2f
- lw a3,dcache_linesize
-
-#ifdef CPU_ORION
- srl a2,1 # do one set (half cache) at a time
- move t8,a0 # save kva & n
- move t9,a1
- icacheop(a0,a1,a2,a3,Index_Writeback_Inv_D)
-
- addu a0,t8,a2 # do next set
- move a1,t9 # restore n
-#endif
- icacheop(a0,a1,a2,a3,Index_Writeback_Inv_D)
-
-2: j ra
-END(clean_dcache_indexed)
-
-/*
- * void clean_dcache_nowrite (unsigned kva, size_t n) R4000
- *
- * Invalidate an address range in primary data cache
- */
-LEAF(clean_dcache_nowrite)
- lw a2,dcache_size
- blez a2,2f
- lw a3,dcache_linesize
-
- vcacheop(a0,a1,a2,a3,Hit_Invalidate_D)
-
-2: j ra
-END(clean_dcache_nowrite)
-
-/*
- * void clean_dcache_nowrite_indexed (unsigned kva, size_t n) R4000
- *
- * Invalidate indexed range in primary data cache
- */
-LEAF(clean_dcache_nowrite_indexed)
- mfc0 v0,C0_SR
- and v1,v0,~SR_IE
- mtc0 v1,C0_SR
-
- mtc0 zero,C0_TAGLO
- mtc0 zero,C0_TAGHI
-
- lw a2,dcache_size
- blez a2,2f
- lw a3,dcache_linesize
-
-#ifdef CPU_ORION
- srl a2,1 # do one set (half cache) at a time
- move t8,a0 # save kva & n
- move t9,a1
- icacheop(a0,a1,a2,a3,Index_Store_Tag_D)
-
- addu a0,t8,a2 # do next set
- move a1,t9 # restore n
-#endif
- icacheop(a0,a1,a2,a3,Index_Store_Tag_D)
-
-2: mtc0 v0,C0_SR
- j ra
-END(clean_dcache_nowrite_indexed)
-
-/*
- * void clean_icache (unsigned kva, size_t n) R4000
- *
- * Invalidate address range in primary instruction cache
- */
-LEAF(clean_icache)
- lw a2,icache_size
- blez a2,2f
- lw a3,icache_linesize
-
- vcacheop(a0,a1,a2,a3,Hit_Invalidate_I)
-
-2: j ra
-END(clean_icache)
-
-/*
- * void clean_icache_indexed (unsigned kva, size_t n) R4000
- *
- * Invalidate indexed range in primary instruction cache
- */
-LEAF(clean_icache_indexed)
- lw a2,icache_size
- blez a2,2f
- lw a3,icache_linesize
-
-#ifdef CPU_ORION
- srl a2,1 # do one set (half cache) at a time
- move t8,a0 # save kva & n
- move t9,a1
- icacheop(a0,a1,a2,a3,Index_Invalidate_I)
-
- addu a0,t8,a2 # do next set
- move a1,t9 # restore n
-#endif
- icacheop(a0,a1,a2,a3,Index_Invalidate_I)
-
-2: j ra
-END(clean_icache_indexed)
-
-
-
-/*
- * void clean_scache (unsigned kva, size_t n) R4000
- *
- * Writeback and invalidate address range in secondary cache
- */
-LEAF(clean_scache)
- lw a2,scache_size
- blez a2,2f
- lw a3,scache_linesize
- vcacheop(a0,a1,a2,a3,Hit_Writeback_Inv_SD)
-
-2: j ra
-END(clean_scache)
-
-/*
- * void clean_scache_indexed (unsigned kva, size_t n) R4000
- *
- * Writeback and invalidate indexed range in secondary cache
- */
-LEAF(clean_scache_indexed)
- lw a2,scache_size
- blez a2,2f
- lw a3,scache_linesize
-
- icacheop(a0,a1,a2,a3,Index_Writeback_Inv_SD)
-
-2: j ra
-END(clean_scache_indexed)
-
-/*
- * void clean_scache_nowrite (unsigned kva, size_t n) R4000
- *
- * Invalidate an address range in secondary cache
- */
-LEAF(clean_scache_nowrite)
- lw a2,scache_size
- blez a2,2f
- lw a3,scache_linesize
-
- vcacheop(a0,a1,a2,a3,Hit_Invalidate_SD)
-
-2: j ra
-END(clean_scache_nowrite)
-
-/*
- * void clean_scache_nowrite_indexed (unsigned kva, size_t n) R4000
- *
- * Invalidate indexed range in secondary cache
- */
-LEAF(clean_scache_nowrite_indexed)
- mfc0 v0,C0_SR
- and v1,v0,~SR_IE
- mtc0 v1,C0_SR
-
- mtc0 zero,C0_TAGLO
- mtc0 zero,C0_TAGHI
-
- lw a2,scache_size
- blez a2,2f
- lw a3,scache_linesize
-
- icacheop(a0,a1,a2,a3,Index_Store_Tag_SD)
-
-2: mtc0 v0,C0_SR
- j ra
-END(clean_scache_nowrite_indexed)
-
-/**************************************************************************
-**
-** get_mem_conf - get memory configuration R4000
-**
-***************************************************************************/
-
-
-FRAME(get_mem_conf,sp,0,ra)
-
- lw t6, mem_size
- sw t6, 0(a0)
- lw t7, icache_size
- sw t7, 4(a0)
- lw t8, dcache_size
- sw t8, 8(a0)
- lw t7, scache_size
- sw t7, 12(a0)
- j ra
-
-ENDFRAME(get_mem_conf)
-
-#endif /* defined(CPU_R4000) */
-
-/*
- * void set_mem_size (mem_size)
- *
- * config_memory()'s memory size gets written into mem_size here.
- * Now we don't need to call config_cache() with memory size - New to IDTC6.0
- */
-FRAME(set_memory_size,sp,0,ra)
- sw a0, mem_size
- j ra
-ENDFRAME(set_memory_size)
-
-
diff --git a/c/src/lib/libbsp/mips64orion/p4000/startup/idttlb.S b/c/src/lib/libbsp/mips64orion/p4000/startup/idttlb.S
deleted file mode 100644
index 4aad7b1416..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/startup/idttlb.S
+++ /dev/null
@@ -1,390 +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$
-*/
-
-
-/*
-** idttlb.s - fetch the registers associated with and the contents
-** of the tlb.
-**
-*/
-/* 950308: Ketan patched a few tlb functions that would not have worked.*/
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtcpu.h>
-#include <rtems/score/idtmon.h>
-
-
- .text
-
-#if defined(CPU_R3000)
-/*
-** ret_tlblo -- returns the 'entrylo' contents for the TLB
-** 'c' callable - as ret_tlblo(index) - where index is the
-** tlb entry to return the lo value for - if called from assembly
-** language then index should be in register a0.
-*/
-FRAME(ret_tlblo,sp,0,ra)
- .set noreorder
- mfc0 t0,C0_SR # save sr
- nop
- and t0,~SR_PE # dont inadvertantly clear PE
- mtc0 zero,C0_SR # clear interrupts
- mfc0 t1,C0_TLBHI # save pid
- sll a0,TLBINX_INXSHIFT # position index
- mtc0 a0,C0_INX # write to index register
- nop
- tlbr # put tlb entry in entrylo and hi
- nop
- mfc0 v0,C0_TLBLO # get the requested entry lo
- mtc0 t1,C0_TLBHI # restore pid
- mtc0 t0,C0_SR # restore status register
- j ra
- nop
- .set reorder
-ENDFRAME(ret_tlblo)
-#endif
-#if defined(CPU_R4000)
-/*
-** ret_tlblo[01] -- returns the 'entrylo' contents for the TLB
-** 'c' callable - as ret_tlblo(index) - where index is the
-** tlb entry to return the lo value for - if called from assembly
-** language then index should be in register a0.
-*/
-FRAME(ret_tlblo0,sp,0,ra)
- mfc0 t0,C0_SR # save sr
- mtc0 zero,C0_SR # clear interrupts
- mfc0 t1,C0_TLBHI # save pid
- mtc0 a0,C0_INX # write to index register
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- tlbr # put tlb entry in entrylo and hi
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- mfc0 v0,C0_TLBLO0 # get the requested entry lo
- mtc0 t1,C0_TLBHI # restore pid
- mtc0 t0,C0_SR # restore status register
- j ra
-ENDFRAME(ret_tlblo0)
-
-FRAME(ret_tlblo1,sp,0,ra)
- mfc0 t0,C0_SR # save sr
- mtc0 zero,C0_SR # clear interrupts
- mfc0 t1,C0_TLBHI # save pid
- mtc0 a0,C0_INX # write to index register
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- tlbr # put tlb entry in entrylo and hi
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- mfc0 v0,C0_TLBLO1 # get the requested entry lo
- mtc0 t1,C0_TLBHI # restore pid
- mtc0 t0,C0_SR # restore status register
- j ra
-ENDFRAME(ret_tlblo1)
-
-/*
-** ret_pagemask(index) -- return pagemask contents of tlb entry "index"
-*/
-FRAME(ret_pagemask,sp,0,ra)
- mfc0 t0,C0_SR # save sr
- mtc0 zero,C0_SR # disable interrupts
- mfc0 t1,C0_TLBHI # save current pid
- mtc0 a0,C0_INX # drop it in C0 register
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- tlbr # read entry to entry hi/lo
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- mfc0 v0,C0_PAGEMASK # to return value
- mtc0 t1,C0_TLBHI # restore current pid
- mtc0 t0,C0_SR # restore sr
- j ra
-ENDFRAME(ret_pagemask)
-
-/*
-** ret_tlbwired(void) -- return wired register
-*/
-FRAME(ret_tlbwired,sp,0,ra)
- mfc0 v0,C0_WIRED
- j ra
-ENDFRAME(ret_tlbwired)
-#endif
-
-/*
-** ret_tlbhi -- return the tlb entry high content for tlb entry
-** index
-*/
-FRAME(ret_tlbhi,sp,0,ra)
-#if defined(CPU_R3000)
- .set noreorder
- mfc0 t0,C0_SR # save sr
- nop
- and t0,~SR_PE
- mtc0 zero,C0_SR # disable interrupts
- mfc0 t1,C0_TLBHI # save current pid
- sll a0,TLBINX_INXSHIFT # position index
- mtc0 a0,C0_INX # drop it in C0 register
- nop
- tlbr # read entry to entry hi/lo
- nop
- mfc0 v0,C0_TLBHI # to return value
- mtc0 t1,C0_TLBHI # restore current pid
- mtc0 t0,C0_SR # restore sr
- j ra
- nop
- .set reorder
-#endif
-#if defined(CPU_R4000)
- mfc0 t0,C0_SR # save sr
- mtc0 zero,C0_SR # disable interrupts
- mfc0 t1,C0_TLBHI # save current pid
- mtc0 a0,C0_INX # drop it in C0 register
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- tlbr # read entry to entry hi/lo0/lo1/mask
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- mfc0 v0,C0_TLBHI # to return value
- mtc0 t1,C0_TLBHI # restore current pid
- mtc0 t0,C0_SR # restore sr
- j ra
-#endif
-ENDFRAME(ret_tlbhi)
-
-/*
-** ret_tlbpid() -- return tlb pid contained in the current entry hi
-*/
-FRAME(ret_tlbpid,sp,0,ra)
-#if defined(CPU_R3000)
- .set noreorder
- mfc0 v0,C0_TLBHI # fetch tlb high
- nop
- and v0,TLBHI_PIDMASK # isolate and position
- srl v0,TLBHI_PIDSHIFT
- j ra
- nop
- .set reorder
-#endif
-#if defined(CPU_R4000)
- mfc0 v0,C0_TLBHI # to return value
- nop
- and v0,TLBHI_PIDMASK
- j ra
-#endif
-ENDFRAME(ret_tlbpid)
-
-/*
-** tlbprobe(address, pid) -- probe the tlb to see if address is currently
-** mapped
-** a0 = vpn - virtual page numbers are 0=0 1=0x1000, 2=0x2000...
-** virtual page numbers for the r3000 are in
-** entry hi bits 31-12
-** a1 = pid - this is a process id ranging from 0 to 63
-** this process id is shifted left 6 bits and or'ed into
-** the entry hi register
-** returns an index value (0-63) if successful -1 -f not
-*/
-FRAME(tlbprobe,sp,0,ra)
-#if defined(CPU_R3000)
- .set noreorder
- mfc0 t0,C0_SR /* fetch status reg */
- and a0,TLBHI_VPNMASK /* isolate just the vpn */
- and t0,~SR_PE /* don't inadvertantly clear pe */
- mtc0 zero,C0_SR
- mfc0 t1,C0_TLBHI
- sll a1,TLBHI_PIDSHIFT /* possition the pid */
- and a1,TLBHI_PIDMASK
- or a0,a1 /* build entry hi value */
- mtc0 a0,C0_TLBHI
- nop
- tlbp /* do the probe */
- nop
- mfc0 v1,C0_INX
- li v0,-1
- bltz v1,1f
- nop
- sra v0,v1,TLBINX_INXSHIFT /* get index positioned for return */
-1:
- mtc0 t1,C0_TLBHI /* restore tlb hi */
- mtc0 t0,C0_SR /* restore the status reg */
- j ra
- nop
- .set reorder
-#endif
-#if defined(CPU_R4000)
- mfc0 t0,C0_SR # save sr
- mtc0 zero,C0_SR # disable interrupts
- mfc0 t1,C0_TLBHI # save current pid
- and a0,TLBHI_VPN2MASK # construct tlbhi for probe
- and a1,TLBHI_PIDMASK
- or a0,a1
- mtc0 a0,C0_TLBHI
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- tlbp # probe entry to entry hi/lo0/lo1/mask
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- mfc0 v1,C0_INX
- li v0,-1
- bltz v1,1f
- move v0,v1
-1: mtc0 t1,C0_TLBHI # restore current pid
- mtc0 t0,C0_SR # restore sr
- j ra
-#endif
-ENDFRAME(tlbprobe)
-
-/*
-** resettlb(index) Invalidate the TLB entry specified by index
-*/
-FRAME(resettlb,sp,0,ra)
-#if defined(CPU_R3000)
- .set noreorder
- mfc0 t0,C0_TLBHI # fetch the current hi
- mfc0 v0,C0_SR # fetch the status reg.
- li t2,K0BASE&TLBHI_VPNMASK
- and v0,~SR_PE # dont inadvertantly clear PE
- mtc0 zero,C0_SR
- mtc0 t2,C0_TLBHI # set up tlbhi
- mtc0 zero,C0_TLBLO
- sll a0,TLBINX_INXSHIFT
- mtc0 a0,C0_INX
- nop
- tlbwi # do actual invalidate
- nop
- mtc0 t0,C0_TLBHI
- mtc0 v0,C0_SR
- j ra
- nop
- .set reorder
-#endif
-#if defined(CPU_R4000)
- li t2,K0BASE&TLBHI_VPN2MASK
- mfc0 t0,C0_TLBHI # save current TLBHI
- mfc0 v0,C0_SR # save SR and disable interrupts
- mtc0 zero,C0_SR
- mtc0 t2,C0_TLBHI # invalidate entry
- mtc0 zero,C0_TLBLO0
- mtc0 zero,C0_TLBLO1
- mtc0 a0,C0_INX
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- tlbwi
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- mtc0 t0,C0_TLBHI
- mtc0 v0,C0_SR
- j ra
-#endif
-ENDFRAME(resettlb)
-
-#if defined(CPU_R3000)
-/*
-** Setup TLB entry
-**
-** map_tlb(index, tlbhi, phypage)
-** a0 = TLB entry index
-** a1 = virtual page number and PID
-** a2 = physical page
-*/
-FRAME(map_tlb,sp,0,ra)
- .set noreorder
- sll a0,TLBINX_INXSHIFT
- mfc0 v0,C0_SR # fetch the current status
- mfc0 a3,C0_TLBHI # save the current hi
- and v0,~SR_PE # dont inadvertantly clear parity
-
- mtc0 zero,C0_SR
- mtc0 a1,C0_TLBHI # set the hi entry
- mtc0 a2,C0_TLBLO # set the lo entry
- mtc0 a0,C0_INX # load the index
- nop
- tlbwi # put the hi/lo in tlb entry indexed
- nop
- mtc0 a3,C0_TLBHI # put back the tlb hi reg
- mtc0 v0,C0_SR # restore the status register
- j ra
- nop
- .set reorder
-ENDFRAME(map_tlb)
- #endif
-#if defined(CPU_R4000)
-/*
-** Setup R4000 TLB entry
-**
-** map_tlb4000(mask_index, tlbhi, pte_even, pte_odd)
-** a0 = TLB entry index and page mask
-** a1 = virtual page number and PID
-** a2 = pte -- contents of even pte
-** a3 = pte -- contents of odd pte
-*/
-FRAME(map_tlb4000,sp,0,ra)
- and t2,a0,TLBPGMASK_MASK
- and a0,TLBINX_INXMASK
- mfc0 t1,C0_TLBHI # save current TLBPID
- mfc0 v0,C0_SR # save SR and disable interrupts
- mtc0 zero,C0_SR
- mtc0 t2,C0_PAGEMASK # set
- mtc0 a1,C0_TLBHI # set VPN and TLBPID
- mtc0 a2,C0_TLBLO0 # set PPN and access bits
- mtc0 a3,C0_TLBLO1 # set PPN and access bits
- mtc0 a0,C0_INX # set INDEX to wired entry
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- tlbwi # drop it in
- .set noreorder
- nop; nop; nop; nop; nop; nop; nop; nop
- .set reorder
- mtc0 t1,C0_TLBHI # restore TLBPID
- mtc0 v0,C0_SR # restore SR
- j ra
-ENDFRAME(map_tlb4000)
-#endif
-
-
-/*
-** Set current TLBPID. This assumes PID is positioned correctly in reg.
-** a0.
-*/
-FRAME(set_tlbpid,sp,0,ra)
- .set noreorder
- mtc0 a0,C0_TLBHI
- j ra
- nop
- .set reorder
-ENDFRAME(set_tlbpid)
-
diff --git a/c/src/lib/libbsp/mips64orion/p4000/startup/inittlb.c b/c/src/lib/libbsp/mips64orion/p4000/startup/inittlb.c
deleted file mode 100644
index e61f0043be..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/startup/inittlb.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems/score/idtcpu.h>
-
-extern void resettlb( int i );
-
-void init_tlb(void)
-{
- int i;
-
- for (i = 0; i < N_TLB_ENTRIES; i++ )
- resettlb(i);
-}
-
diff --git a/c/src/lib/libbsp/mips64orion/p4000/startup/linkcmds b/c/src/lib/libbsp/mips64orion/p4000/startup/linkcmds
deleted file mode 100644
index 47e0ba1162..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/startup/linkcmds
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * $Id$
- */
-
-OUTPUT_FORMAT("elf32-bigmips")
-OUTPUT_ARCH(mips)
-/* Do we need any of these for elf?
- __DYNAMIC = 0; */
-_DYNAMIC_LINK = 0;
-SECTIONS
-{
- /* Read-only sections, merged into text segment: */
- .text 0x80030000 : /* */
-/* .text 0xa0020000 : /* */
-/* .text 0x00020000 : /* */
- {
- _ftext = . ;
- *(.text)
- CREATE_OBJECT_SYMBOLS
- _etext = .;
- }
- .init ALIGN(8) : { *(.init) } =0
- .fini ALIGN(8) : { *(.fini) } =0
- .ctors ALIGN(8) : { *(.ctors) }
- .dtors ALIGN(8) : { *(.dtors) }
- .rodata ALIGN(8) : { *(.rodata) *(.gnu.linkonce.r*) }
- .rodata1 ALIGN(8) :
- {
- *(.rodata1)
- . = ALIGN(8);
- }
- .reginfo . : { *(.reginfo) }
- /* also: .hash .dynsym .dynstr .plt(if r/o) .rel.got */
- /* Read-write section, merged into data segment: */
- .data ALIGN(16) :
- {
- _fdata = . ;
- *(.data)
- CONSTRUCTORS
- }
- .data1 ALIGN(8) : { *(.data1) }
- _gp = . + 0x8000;
- .lit8 . : { *(.lit8) }
- .lit4 . : { *(.lit4) }
- /* also (before uninitialized portion): .dynamic .got .plt(if r/w)
- (or does .dynamic go into its own segment?) */
- /* We want the small data sections together, so single-instruction offsets
- can access them all, and initialized data all before uninitialized, so
- we can shorten the on-disk segment size. */
- .sdata ALIGN(8) : { *(.sdata) }
- _edata = .;
- __bss_start = ALIGN(8);
- _fbss = .;
- .sbss ALIGN(8) : { *(.sbss) *(.scommon) }
- .bss ALIGN(8) :
- {
- *(.bss)
- *(COMMON)
- _end = . ;
- end = . ;
- }
- /* Debug sections. These should never be loadable, but they must have
- zero addresses for the debuggers to work correctly. */
- .line 0 : { *(.line) }
- .debug 0 : { *(.debug) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
-
diff --git a/c/src/lib/libbsp/mips64orion/p4000/startup/setvec.c b/c/src/lib/libbsp/mips64orion/p4000/startup/setvec.c
deleted file mode 100644
index 1142eb64de..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/startup/setvec.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on the target Board/CPU.
- * This routine is allowed to be as board dependent as necessary.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)setvec.c 04/25/96 1.2\n";
- */
-
-
-#include <rtems.h>
-#include <bsp.h>
-
-mips_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- mips_isr_entry previous_isr;
-
- if ( type )
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
- else {
- /* XXX: install non-RTEMS ISR as "raw" interupt */
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
- }
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/mips64orion/p4000/times b/c/src/lib/libbsp/mips64orion/p4000/times
deleted file mode 100644
index 58574229e1..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/times
+++ /dev/null
@@ -1,200 +0,0 @@
-#
-# Timing Test Suite Results for the NO_BSP
-#
-# NOTE: This is just a template. The times are irrelevant since this BSP
-# can only be compiled -- not executed.
-#
-# $Id$
-#
-# @(#)times 08/01/96 1.4
-
-NOTE: To obtain the execution time in microseconds, divide the number of
- cycles by the clock speed. For example, if rtems_semaphore create
- is reported to be 1164 cycles, then at 66 Mhz it takes 17.64
- microseconds or 8.75 microseconds at 133 Mhz.
-
-Board: Algorithmics P4000i
-CPU: IDT 4650
-Clock Speed: 100MHz
-Memory Configuration: SRAM, DRAM, cache, etc
-Wait States:
-
-Times Reported in: cycles
-Timer Source: on-CPU cycle counter
-
-Column A:RTEMS compiled with 64 bit pointers and 64 bit unsigned32 types
-Column B:RTEMS compiled with 32 bit pointers and 32 bit unsigned32 types
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 788 759
- rtems_semaphore_delete 903 945
- rtems_semaphore_obtain: available 119 119
- rtems_semaphore_obtain: not available -- NO_WAIT 118 118
- rtems_semaphore_release: no waiting tasks 127 127
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 842 840
-
- 3 rtems_semaphore_release: task readied -- preempts caller 777 751
-
- 4 rtems_task_restart: blocked task -- preempts caller 1611 1595
- rtems_task_restart: ready task -- preempts caller 1253 1395
- rtems_semaphore_release: task readied -- returns to caller 365 345
- rtems_task_create 798 797
- rtems_task_start 464 460
- rtems_task_restart: suspended task -- returns to caller 517 517
- rtems_task_delete: suspended task 529 595
- rtems_task_restart: ready task -- returns to caller 527 525
- rtems_task_restart: blocked task -- returns to caller 707 684
- rtems_task_delete: blocked task 609 675
-
- 5 rtems_task_suspend: calling task 549 549
- rtems_task_resume: task readied -- preempts caller 702 699
-
- 6 rtems_task_restart: calling task 291 291
- rtems_task_suspend: returns to caller 195 194
- rtems_task_resume: task readied -- returns to caller 198 198
- rtems_task_delete: ready task 734 736
-
- 7 rtems_task_restart: suspended task -- preempts caller 1049 990
-
- 8 rtems_task_set_priority: obtain current priority 94 94
- rtems_task_set_priority: returns to caller 418 355
- rtems_task_mode: obtain current mode 44 43
- rtems_task_mode: no reschedule 0 49
- rtems_task_mode: reschedule -- returns to caller 0 232
- rtems_task_mode: reschedule -- preempts caller 0 687
- rtems_task_set_note 0 101
- rtems_task_get_note 0 103
- rtems_clock_set 0 237
- rtems_clock_get 0 16
-
- 9 rtems_message_queue_create 3583 3432
- rtems_message_queue_send: no waiting tasks 252 252
- rtems_message_queue_urgent: no waiting tasks 252 252
- rtems_message_queue_receive: available 207 207
- rtems_message_queue_flush: no messages flushed 95 96
- rtems_message_queue_flush: messages flushed 110 110
- rtems_message_queue_delete 1044 1111
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 132 131
- rtems_message_queue_receive: not available -- caller blocks 884 892
-
-11 rtems_message_queue_send: task readied -- preempts caller 397 817
-
-12 rtems_message_queue_send: task readied -- returns to caller 397 397
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 816 817
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 397 398
-
-15 rtems_event_receive: obtain current events 5 5
- rtems_event_receive: not available -- NO_WAIT 99 99
- rtems_event_receive: not available -- caller blocks 689 689
- rtems_event_send: no task readied 123 123
- rtems_event_receive: available 326 349
- rtems_event_send: task readied -- returns to caller 333 429
-
-16 rtems_event_send: task readied -- preempts caller 843 838
-
-17 rtems_task_set_priority: preempts caller 1002 991
-
-18 rtems_task_delete: calling task 1171 1157
-
-19 rtems_signal_catch 0 1306
- rtems_signal_send: returns to caller 0 1019
- rtems_signal_send: signal to self 0 496
- exit ASR overhead: returns to calling task 0 120
- exit ASR overhead: returns to preempting task 0 73
-
-20 rtems_partition_create 1293 1306
- rtems_region_create 1010 1019
- rtems_partition_get_buffer: available 481 496
- rtems_partition_get_buffer: not available 120 120
- rtems_partition_return_buffer 587 460
- rtems_partition_delete 379 320
- rtems_region_get_segment: available 179 179
- rtems_region_get_segment: not available -- NO_WAIT 349 293
- rtems_region_return_segment: no waiting tasks 335 322
- rtems_region_get_segment: not available -- caller blocks 1603 1496
- rtems_region_return_segment: task readied -- preempts caller 1616 1533
- rtems_region_return_segment: task readied -- returns to caller 940 939
- rtems_region_delete 301 348
- rtems_io_initialize 9 10
- rtems_io_open 6 6
- rtems_io_close 6 6
- rtems_io_read 6 6
- rtems_io_write 6 5
- rtems_io_control 6 6
-
-21 rtems_task_ident 1057 1058
- rtems_message_queue_ident 963 963
- rtems_semaphore_ident 1137 1136
- rtems_partition_ident 962 961
- rtems_region_ident 923 924
- rtems_port_ident 918 917
- rtems_timer_ident 942 941
- rtems_rate_monotonic_ident 924 925
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 1084 1095
- rtems_message_queue_broadcast: no waiting tasks 147 148
- rtems_message_queue_broadcast: task readied -- preempts caller 1305 1268
-
-23 rtems_timer_create 202 201
- rtems_timer_fire_after: inactive 261 261
- rtems_timer_fire_after: active 271 269
- rtems_timer_cancel: active 142 141
- rtems_timer_cancel: inactive 122 124
- rtems_timer_reset: inactive 222 222
- rtems_timer_reset: active 246 245
- rtems_timer_fire_when: inactive 312 311
- rtems_timer_fire_when: active 358 358
- rtems_timer_delete: active 263 263
- rtems_timer_delete: inactive 247 247
- rtems_task_wake_when 833 831
-
-24 rtems_task_wake_after: yield -- returns to caller 99 98
- rtems_task_wake_after: yields -- preempts caller 479 478
-
-25 rtems_clock_tick 313 318
-
-26 _ISR_Disable 64 57
- _ISR_Flash 51 36
- _ISR_Enable 31 18
- _Thread_Disable_dispatch 53 37
- _Thread_Enable_dispatch 260 233
- _Thread_Set_state 446 463
- _Thread_Disptach (NO FP) 839 801
- context switch: no floating point contexts 673 653
- context switch: self 156 162
- context switch: to another task 84 70
- context switch: restore 1st FP task 1030 1013
- fp context switch: save idle, restore idle 969 948
- fp context switch: save idle, restore initialized 275 267
- fp context switch: save initialized, restore initialized 319 292
- _Thread_Resume 512 480
- _Thread_Unblock 121 139
- _Thread_Ready 199 203
- _Thread_Get 27 27
- _Semaphore_Get 20 21
- _Thread_Get: invalid id 5 5
-
-27 interrupt entry overhead: returns to interrupted task 0 0
- interrupt exit overhead: returns to interrupted task 27 41
- interrupt entry overhead: returns to nested interrupt 0 0
- interrupt exit overhead: returns to nested interrupt 0 0
- interrupt entry overhead: returns to preempting task 0 0
- interrupt exit overhead: returns to preempting task 0 0
-
-28 rtems_port_create 574 560
- rtems_port_external_to_internal 87 87
- rtems_port_internal_to_external 86 86
- rtems_port_delete 395 353
-
-29 rtems_rate_monotonic_create 621 633
- rtems_rate_monotonic_period: initiate period -- returns to caller 773 694
- rtems_rate_monotonic_period: obtain status 295 284
- rtems_rate_monotonic_cancel 408 451
- rtems_rate_monotonic_delete: inactive 453 471
- rtems_rate_monotonic_delete: active 332 336
- rtems_rate_monotonic_period: conclude periods -- caller blocks 664 686
diff --git a/c/src/lib/libbsp/mips64orion/p4000/wrapup/Makefile.in b/c/src/lib/libbsp/mips64orion/p4000/wrapup/Makefile.in
deleted file mode 100644
index 2b2834341f..0000000000
--- a/c/src/lib/libbsp/mips64orion/p4000/wrapup/Makefile.in
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup console liblnk
-CPU_PIECES=clock timer
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(CPU_PIECES), ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
-install: all
-
diff --git a/c/src/lib/libbsp/no_cpu/Makefile.in b/c/src/lib/libbsp/no_cpu/Makefile.in
deleted file mode 100644
index f049e9b2e8..0000000000
--- a/c/src/lib/libbsp/no_cpu/Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# Descend into the $(RTEMS_BSP_FAMILY) directory
-SUB_DIRS=$(RTEMS_BSP_FAMILY)
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/Makefile.in b/c/src/lib/libbsp/no_cpu/no_bsp/Makefile.in
deleted file mode 100644
index 1a32c77d85..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SRCS=README
-
-all: $(SRCS)
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include startup clock console shmsupp timer wrapup
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/README b/c/src/lib/libbsp/no_cpu/no_bsp/README
deleted file mode 100644
index 8ed80e29f8..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/README
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# $Id$
-#
-# This is a sample hardware description file for a BSP. This comment
-# block does not have to appear in a real one. The intention of this
-# file is to provide a central place to look when searching for
-# information about a board when starting a new BSP. For example,
-# you may want to find an existing timer driver for the chip you are
-# using on your board. It is easier to grep for the chip name in
-# all of the HARDWARE files than to peruse the source tree. Hopefully,
-# making the HARDDWARE files accurate will also alleviate the common
-# problem of not knowing anything about a board based on its BSP
-# name.
-#
-# NOTE: If you have a class of peripheral chip on board which
-# is not in this list please add it to this file so
-# others will also use the same name.
-#
-# Timer resolution is the way it is configured in this BSP.
-# On a counting timer, this is the length of time which
-# corresponds to 1 count.
-#
-
-BSP NAME: fastsbc1
-BOARD: Fasssst Computers, Fast SBC-1
-BUS: SchoolBus
-CPU FAMILY: i386
-CPU: Intel Hexium
-COPROCESSORS: Witch Hex87
-MODE: 32 bit mode
-
-DEBUG MONITOR: HexBug
-
-PERIPHERALS
-===========
-TIMERS: Intel i8254
- RESOLUTION: .0001 microseconds
-SERIAL PORTS: Zilog Z8530 (with 2 ports)
-REAL-TIME CLOCK: RTC-4
-DMA: Intel i8259
-VIDEO: none
-SCSI: none
-NETWORKING: none
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: RTC-4
-IOSUPP DRIVER: Zilog Z8530 port A
-SHMSUPP: polled and interrupts
-TIMER DRIVER: Intel i8254
-TTY DRIVER: stub only
-
-STDIO
-=====
-PORT: Console port 0
-ELECTRICAL: RS-232
-BAUD: 9600
-BITS PER CHARACTER: 8
-PARITY: None
-STOP BITS: 1
-
-NOTES
-=====
-
-(1) 900 Mhz and 950 Mhz versions.
-
-(2) 1 Gb or 2 Gb RAM.
-
-(3) PC compatible if HexBug not enabled.
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/clock/Makefile.in b/c/src/lib/libbsp/no_cpu/no_bsp/clock/Makefile.in
deleted file mode 100644
index 48b1c93ac7..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/clock/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c b/c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c
deleted file mode 100644
index b3ab22bb58..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/* ckinit.c
- *
- * This file provides a template for the clock device driver initialization.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <bsp.h>
-
-void Clock_exit( void );
-rtems_isr Clock_isr( rtems_vector_number vector );
-
-
-/*
- * The interrupt vector number associated with the clock tick device
- * driver.
- */
-
-#define CLOCK_VECTOR 4
-
-/*
- * Clock_driver_ticks is a monotonically increasing counter of the
- * number of clock ticks since the driver was initialized.
- */
-
-volatile rtems_unsigned32 Clock_driver_ticks;
-
-/*
- * Clock_isrs is the number of clock ISRs until the next invocation of
- * the RTEMS clock tick routine. The clock tick device driver
- * gets an interrupt once a millisecond and counts down until the
- * length of time between the user configured microseconds per tick
- * has passed.
- */
-
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-/*
- * The previous ISR on this clock tick interrupt vector.
- */
-
-rtems_isr_entry Old_ticker;
-
-void Clock_exit( void );
-
-
-/*
- * Isr Handler
- */
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
-/*
- * bump the number of clock driver ticks since initialization
- *
- * determine if it is time to announce the passing of tick as configured
- * to RTEMS through the rtems_clock_tick directive
- *
- * perform any timer dependent tasks
- */
-}
-
-/*
- * Install_clock
- *
- * Install a clock tick handler and reprograms the chip. This
- * is used to initially establish the clock tick.
- */
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
- /*
- * Initialize the clock tick device driver variables
- */
-
- Clock_driver_ticks = 0;
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
-
- /*
- * If ticks_per_timeslice is configured as non-zero, then the user
- * wants a clock tick.
- */
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
- /*
- * Hardware specific initialize goes here
- */
-
- /* XXX */
- }
-
- /*
- * Schedule the clock cleanup routine to execute if the application exits.
- */
-
- atexit( Clock_exit );
-}
-
-/*
- * Clean up before the application exits
- */
-
-void Clock_exit( void )
-{
- if ( BSP_Configuration.ticks_per_timeslice ) {
-
- /* XXX: turn off the timer interrupts */
-
- /* XXX: If necessary, restore the old vector */
- }
-}
-
-/*
- * Clock_initialize
- *
- * Device driver entry point for clock tick driver initialization.
- */
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/console/Makefile.in b/c/src/lib/libbsp/no_cpu/no_bsp/console/Makefile.in
deleted file mode 100644
index b73d23df40..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/console/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/console/console.c b/c/src/lib/libbsp/no_cpu/no_bsp/console/console.c
deleted file mode 100644
index 656cc1a831..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/console/console.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * This file contains the template for a console IO package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 NO_BSP_INIT
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-}
-
-
-/* is_character_ready
- *
- * This routine returns TRUE if a character is available.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_boolean is_character_ready(
- char *ch
-)
-{
- *ch = '\0'; /* return NULL for no particular reason */
- return(TRUE);
-}
-
-/* inbyte
- *
- * This routine reads a character from the SOURCE.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- * character read from SOURCE
- */
-
-char inbyte( void )
-{
- /*
- * If polling, wait until a character is available.
- */
-
- return '\0';
-}
-
-/* outbyte
- *
- * This routine transmits a character out the SOURCE. It may support
- * XON/XOFF flow control.
- *
- * Input parameters:
- * ch - character to be transmitted
- *
- * Output parameters: NONE
- */
-
-void outbyte(
- char ch
-)
-{
- /*
- * If polling, wait for the transmitter to be ready.
- * Check for flow control requests and process.
- * Then output the character.
- */
-
- /*
- * Carriage Return/New line translation.
- */
-
- if ( ch == '\n' )
- outbyte( '\r' );
-}
-
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte();
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r');
- }
- outbyte( buffer[ count ] );
- }
-
- rw_args->bytes_moved = maximum;
- return 0;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/include/Makefile.in b/c/src/lib/libbsp/no_cpu/no_bsp/include/Makefile.in
deleted file mode 100644
index 7d8581095f..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h b/c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h
deleted file mode 100644
index 7bdef2de3f..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* bsp.h
- *
- * This include file contains all board IO definitions.
- *
- * XXX : put yours in here
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __NO_BSP_h
-#define __NO_BSP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <console.h>
-#include <clockdrv.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Stuff for Time Test 27
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), 0, 1 )
-
-#define Cause_tm27_intr()
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define delay( microseconds ) \
- { \
- }
-
-/* Constants */
-
-#define RAM_START 0
-#define RAM_END 0x100000
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* functions */
-
-void bsp_cleanup( void );
-
-no_cpu_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/include/coverhd.h b/c/src/lib/libbsp/no_cpu/no_bsp/include/coverhd.h
deleted file mode 100644
index fedd788455..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/include/coverhd.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- * This file should be updated after running the C overhead timing
- * test. Once this update has been performed, the RTEMS Time Test
- * Suite should be rebuilt to account for these overhead times in the
- * timing results.
- *
- * NOTE: If these are all zero, then the times reported include
- * all calling overhead including passing of arguments.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
-#define CALLING_OVERHEAD_TASK_CREATE 0
-#define CALLING_OVERHEAD_TASK_IDENT 0
-#define CALLING_OVERHEAD_TASK_START 0
-#define CALLING_OVERHEAD_TASK_RESTART 0
-#define CALLING_OVERHEAD_TASK_DELETE 0
-#define CALLING_OVERHEAD_TASK_SUSPEND 0
-#define CALLING_OVERHEAD_TASK_RESUME 0
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
-#define CALLING_OVERHEAD_TASK_MODE 0
-#define CALLING_OVERHEAD_TASK_GET_NOTE 0
-#define CALLING_OVERHEAD_TASK_SET_NOTE 0
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 0
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
-#define CALLING_OVERHEAD_CLOCK_GET 0
-#define CALLING_OVERHEAD_CLOCK_SET 0
-#define CALLING_OVERHEAD_CLOCK_TICK 0
-
-#define CALLING_OVERHEAD_TIMER_CREATE 0
-#define CALLING_OVERHEAD_TIMER_IDENT 0
-#define CALLING_OVERHEAD_TIMER_DELETE 0
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 0
-#define CALLING_OVERHEAD_TIMER_RESET 0
-#define CALLING_OVERHEAD_TIMER_CANCEL 0
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
-
-#define CALLING_OVERHEAD_EVENT_SEND 0
-#define CALLING_OVERHEAD_EVENT_RECEIVE 0
-#define CALLING_OVERHEAD_SIGNAL_CATCH 0
-#define CALLING_OVERHEAD_SIGNAL_SEND 0
-#define CALLING_OVERHEAD_PARTITION_CREATE 0
-#define CALLING_OVERHEAD_PARTITION_IDENT 0
-#define CALLING_OVERHEAD_PARTITION_DELETE 0
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
-#define CALLING_OVERHEAD_REGION_CREATE 0
-#define CALLING_OVERHEAD_REGION_IDENT 0
-#define CALLING_OVERHEAD_REGION_DELETE 0
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
-#define CALLING_OVERHEAD_PORT_CREATE 0
-#define CALLING_OVERHEAD_PORT_IDENT 0
-#define CALLING_OVERHEAD_PORT_DELETE 0
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 0
-#define CALLING_OVERHEAD_IO_OPEN 0
-#define CALLING_OVERHEAD_IO_CLOSE 0
-#define CALLING_OVERHEAD_IO_READ 0
-#define CALLING_OVERHEAD_IO_WRITE 0
-#define CALLING_OVERHEAD_IO_CONTROL 0
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/Makefile.in b/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/Makefile.in
deleted file mode 100644
index b4967b93cb..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/shmsupp.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=addrconv getcfg lock mpisr
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/addrconv.c b/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/addrconv.c
deleted file mode 100644
index 95b44d95fd..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/addrconv.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Shm_Convert_address
- *
- * No address range conversion is required.
- *
- * Input parameters:
- * address - address to convert
- *
- * Output parameters:
- * returns - converted address
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-void *Shm_Convert_address(
- void *address
-)
-{
- return ( address );
-}
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/getcfg.c b/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/getcfg.c
deleted file mode 100644
index 587345df83..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/getcfg.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* void Shm_Get_configuration( localnode, &shmcfg )
- *
- * This routine initializes, if necessary, and returns a pointer
- * to the Shared Memory Configuration Table for the XXX target.
- *
- * INPUT PARAMETERS:
- * localnode - local node number
- * shmcfg - address of pointer to SHM Config Table
- *
- * OUTPUT PARAMETERS:
- * *shmcfg - pointer to SHM Config Table
- *
-XXX: FIX THE COMMENTS BELOW WHEN THE CPU IS KNOWN
- * NOTES: The XYZ does not have an interprocessor interrupt.
- *
- * The following table illustrates the configuration limitations:
- *
- * BUS MAX
- * MODE ENDIAN NODES
- * ========= ====== =======
- * POLLED BIG 2+
- * INTERRUPT **** NOT SUPPORTED ****
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-/*
- * configured if currently polling of interrupt driven
- */
-
-#define INTERRUPT 0 /* XXX: */
-#define POLLING 1 /* XXX: fix me -- is polling ONLY!!! */
-
-
-shm_config_table BSP_shm_cfgtbl;
-
-void Shm_Get_configuration(
- rtems_unsigned32 localnode,
- shm_config_table **shmcfg
-)
-{
- BSP_shm_cfgtbl.base = 0x0;
- BSP_shm_cfgtbl.length = 1 * MEGABYTE;
- BSP_shm_cfgtbl.format = SHM_BIG;
-
- /*
- * Override cause_intr or shm_isr if your target has
- * special requirements.
- */
-
- BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt;
-
-#ifdef NEUTRAL_BIG
- BSP_shm_cfgtbl.convert = NULL_CONVERT;
-#else
- BSP_shm_cfgtbl.convert = CPU_swap_u32;
-#endif
-
- BSP_shm_cfgtbl.poll_intr = POLLED_MODE;
- BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT;
-
- *shmcfg = &BSP_shm_cfgtbl;
-}
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/lock.c b/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/lock.c
deleted file mode 100644
index 7101bbd4e0..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/lock.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Shared Memory Lock Routines
- *
- * This shared memory locked queue support routine need to be
- * able to lock the specified locked queue. Interrupts are
- * disabled while the queue is locked to prevent preemption
- * and deadlock when two tasks poll for the same lock.
- * previous level.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-/*
- * Shm_Initialize_lock
- *
- * Initialize the lock for the specified locked queue.
- */
-
-void Shm_Initialize_lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- lq_cb->lock = LQ_UNLOCKED;
-}
-
-/* void _Shm_Lock( &lq_cb )
- *
- * This shared memory locked queue support routine locks the
- * specified locked queue. It disables interrupts to prevent
- * a deadlock condition.
- */
-
-void Shm_Lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
- rtems_unsigned32 *lockptr = (rtems_unsigned32 *) &lq_cb->lock;
- rtems_unsigned32 lock_value;
-
- lock_value = 0x80000000;
- rtems_interrupt_disable( isr_level );
-
- Shm_isrstat = isr_level;
- while ( lock_value ) {
- asm volatile( ""
- : "=r" (lockptr), "=r" (lock_value)
- : "0" (lockptr), "1" (lock_value)
- );
- /*
- * If not available, then may want to delay to reduce load on lock.
- */
-
- if ( lock_value )
- delay( 10 ); /* approximately 10 microseconds */
- }
-}
-
-/*
- * Shm_Unlock
- *
- * Unlock the lock for the specified locked queue.
- */
-
-void Shm_Unlock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
-
- lq_cb->lock = SHM_UNLOCK_VALUE;
- isr_level = Shm_isrstat;
- rtems_interrupt_enable( isr_level );
-}
-
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/mpisr.c b/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/mpisr.c
deleted file mode 100644
index 1911d89d67..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/mpisr.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Shm_isr_nobsp()
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-#include <shm.h>
-
-rtems_isr Shm_isr_nobsp( void )
-{
- /*
- * If this routine has to do anything other than the mpisr.c
- * found in the generic driver, then copy the contents of the generic
- * mpisr.c and augment it to satisfy this particular board. Typically,
- * you need to have a board specific mpisr.c when the interrupt
- * must be cleared.
- *
- * If the generic mpisr.c satisifies your requirements, then
- * remove this routine from your target's shmsupp/mpisb.c file.
- * Then simply install the generic Shm_isr in the Shm_setvec
- * routine below.
- */
-}
-
-/* Shm_setvec
- *
- * This driver routine sets the SHM interrupt vector to point to the
- * driver's SHM interrupt service routine.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void Shm_setvec( void )
-{
- /* XXX: FIX ME!!! */
-}
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/startup/Makefile.in b/c/src/lib/libbsp/no_cpu/no_bsp/startup/Makefile.in
deleted file mode 100644
index 73bea20865..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/startup/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=linkcmds $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
- $(INSTALL) linkcmds ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspclean.c b/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspclean.c
deleted file mode 100644
index fbcd753e97..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspclean.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine normally is part of start.s and usually returns
- * control to a monitor.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-void bsp_cleanup( void )
-{
-}
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c b/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c
deleted file mode 100644
index a902b4a478..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- /*
- * Allocate the memory for the RTEMS Work Space. This can come from
- * a variety of places: hard coded address, malloc'ed from outside
- * RTEMS world (e.g. simulator or primitive memory manager), or (as
- * typically done by stock BSPs) by subtracting the required amount
- * of work space from the last physical address on the CPU board.
- */
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
-
- BSP_Configuration.work_space_start = (void *) 0;
-
- /*
- * initialize the CPU table for this BSP
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_stack_size = 4096;
-}
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/startup/linkcmds b/c/src/lib/libbsp/no_cpu/no_bsp/startup/linkcmds
deleted file mode 100644
index 7a70a029b8..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/startup/linkcmds
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the NO_CPU NO_BSP BOARD.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-MEMORY
- {
- ram : org = 0x0, l = 1M
- }
-
-SECTIONS
-{
- .text 0x0 :
- {
- text_start = . ;
- _text_start = . ;
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- _etext = ALIGN( 0x10 ) ;
- }
- .data ADDR( .text ) + SIZEOF( .text ):
- {
- data_start = . ;
- _data_start = . ;
- *(.data)
- _edata = ALIGN( 0x10 ) ;
- }
- .bss ADDR( .data ) + SIZEOF( .data ):
- {
- bss_start = . ;
- _bss_start = . ;
- *(.bss)
- *(COMMON)
- end = . ;
- __end = . ;
- }
-}
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/startup/main.c b/c/src/lib/libbsp/no_cpu/no_bsp/startup/main.c
deleted file mode 100644
index e664f387b3..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/startup/main.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* main()
- *
- * This is the entry point for the application. It calls
- * the bsp_start routine to the actual dirty work.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-int main(
- int argc,
- char **argv,
- char **environp
-)
-{
- extern void bsp_start( int, char**, char ** );
-
- bsp_start( argc, argv, environp );
-
- /*
- * May be able to return to the "crt/start.s" code but also
- * may not be able to. Do something here which is board dependent.
- */
-
- rtems_fatal_error_occurred( 0 );
-
- return 0; /* just to satisfy the native compiler */
-}
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/startup/setvec.c b/c/src/lib/libbsp/no_cpu/no_bsp/startup/setvec.c
deleted file mode 100644
index 26fcb06160..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/startup/setvec.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on the target Board/CPU.
- * This routine is allowed to be as board dependent as necessary.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-no_cpu_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- no_cpu_isr_entry previous_isr;
-
- if ( type )
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
- else {
- /* XXX: install non-RTEMS ISR as "raw" interupt */
- }
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/timer/Makefile.in b/c/src/lib/libbsp/no_cpu/no_bsp/timer/Makefile.in
deleted file mode 100644
index 076b7f4e77..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/timer/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# NOTE: timerisr is normally an assembly file!!!
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer timerisr
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/timer/timer.c b/c/src/lib/libbsp/no_cpu/no_bsp/timer/timer.c
deleted file mode 100644
index 2c1b437273..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/timer/timer.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* timer.c
- *
- * This file manages the benchmark timer used by the RTEMS Timing Test
- * Suite. Each measured time period is demarcated by calls to
- * Timer_initialize() and Read_timer(). Read_timer() usually returns
- * the number of microseconds since Timer_initialize() exitted.
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-rtems_unsigned32 Timer_interrupts;
-rtems_boolean Timer_driver_Find_average_overhead;
-
-void Timer_initialize( void )
-{
-
- /*
- * Timer has never overflowed. This may not be necessary on some
- * implemenations of timer but ....
- */
-
- Timer_interrupts = 0;
-
- /*
- * Somehow start the timer
- */
-}
-
-/*
- * The following controls the behavior of Read_timer().
- *
- * AVG_OVEREHAD is the overhead for starting and stopping the timer. It
- * is usually deducted from the number returned.
- *
- * LEAST_VALID is the lowest number this routine should trust. Numbers
- * below this are "noise" and zero is returned.
- */
-
-#define AVG_OVERHEAD 0 /* It typically takes X.X microseconds */
- /* (Y countdowns) to start/stop the timer. */
- /* This value is in microseconds. */
-#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-
-int Read_timer( void )
-{
- rtems_unsigned32 clicks;
- rtems_unsigned32 total;
-
- /*
- * Read the timer and see how many clicks it has been since we started.
- */
-
- clicks = 0; /* XXX: read some HW here */
-
- /*
- * Total is calculated by taking into account the number of timer overflow
- * interrupts since the timer was initialized and clicks since the last
- * interrupts.
- */
-
- total = clicks * 0;
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in XXX microsecond units */
- else {
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
- /*
- * Somehow convert total into microseconds
- */
- return (total - AVG_OVERHEAD);
- }
-}
-
-/*
- * Empty function call used in loops to measure basic cost of looping
- * in Timing Test Suite.
- */
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
-
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/timer/timerisr.c b/c/src/lib/libbsp/no_cpu/no_bsp/timer/timerisr.c
deleted file mode 100644
index 8fff98b22a..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/timer/timerisr.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* timerisr.s
- *
- * If required this ISR is used to bump a count of interval "overflow"
- * interrupts which have occurred since the timer was started. The
- * number of overflows is taken into account in the Read_timer()
- * routine if necessary.
- *
- * To reduce overhead this is best to be the "rawest" hardware interupt
- * handler you can write. This should be the only interrupt which can
- * occur during the measured time period.
- *
- * NOTE: This file is USUALLY in assembly and is LEAN AND MEAN.
- * Any code in this isr is pure overhead which can perturb
- * the accuracy of the Timing Test Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-extern rtems_unsigned32 _Timer_interrupts;
-
-void timerisr( void )
-{
- /*
- * _Timer_interrupts += TIMER_BETWEEN_OVERFLOWS (usually in microseconds)
- * return from interrupt
- */
-}
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/times b/c/src/lib/libbsp/no_cpu/no_bsp/times
deleted file mode 100644
index 2ac0b9ee22..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/times
+++ /dev/null
@@ -1,194 +0,0 @@
-#
-# Timing Test Suite Results for the NO_BSP
-#
-# NOTE: This is just a template. The times are irrelevant since this BSP
-# can only be compiled -- not executed.
-#
-# $Id$
-#
-
-Board:
-CPU: include coprocessor if applicable
-Clock Speed:
-Memory Configuration: SRAM, DRAM, cache, etc
-Wait States:
-
-Times Reported in: cycles, microseconds, etc
-Timer Source: Count Down Timer, on-CPU cycle counter, etc
-
-Column X:
-Column Y:
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 20
- rtems_semaphore_delete 21
- rtems_semaphore_obtain: available 15
- rtems_semaphore_obtain: not available -- NO_WAIT 15
- rtems_semaphore_release: no waiting tasks 16
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 62
-
- 3 rtems_semaphore_release: task readied -- preempts caller 55
-
- 4 rtems_task_restart: blocked task -- preempts caller 77
- rtems_task_restart: ready task -- preempts caller 70
- rtems_semaphore_release: task readied -- returns to caller 25
- rtems_task_create 57
- rtems_task_start 31
- rtems_task_restart: suspended task -- returns to caller 36
- rtems_task_delete: suspended task 47
- rtems_task_restart: ready task -- returns to caller 37
- rtems_task_restart: blocked task -- returns to caller 46
- rtems_task_delete: blocked task 50
-
- 5 rtems_task_suspend: calling task 51
- rtems_task_resume: task readied -- preempts caller 49
-
- 6 rtems_task_restart: calling task 59
- rtems_task_suspend: returns to caller 18
- rtems_task_resume: task readied -- returns to caller 19
- rtems_task_delete: ready task 50
-
- 7 rtems_task_restart: suspended task -- preempts caller 70
-
- 8 rtems_task_set_priority: obtain current priority 12
- rtems_task_set_priority: returns to caller 27
- rtems_task_mode: obtain current mode 5
- rtems_task_mode: no reschedule 5
- rtems_task_mode: reschedule -- returns to caller 8
- rtems_task_mode: reschedule -- preempts caller 39
- rtems_task_set_note 13
- rtems_task_get_note 13
- rtems_clock_set 33
- rtems_clock_get 3
-
- 9 rtems_message_queue_create 110
- rtems_message_queue_send: no waiting tasks 37
- rtems_message_queue_urgent: no waiting tasks 37
- rtems_message_queue_receive: available 31
- rtems_message_queue_flush: no messages flushed 12
- rtems_message_queue_flush: messages flushed 16
- rtems_message_queue_delete 26
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 15
- rtems_message_queue_receive: not available -- caller blocks 62
-
-11 rtems_message_queue_send: task readied -- preempts caller 72
-
-12 rtems_message_queue_send: task readied -- returns to caller 39
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 72
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 39
-
-15 rtems_event_receive: obtain current events 1
- rtems_event_receive: not available -- NO_WAIT 12
- rtems_event_receive: not available -- caller blocks 56
- rtems_event_send: no task readied 12
- rtems_event_receive: available 12
- rtems_event_send: task readied -- returns to caller 24
-
-16 rtems_event_send: task readied -- preempts caller 55
-
-17 rtems_task_set_priority: preempts caller 62
-
-18 rtems_task_delete: calling task 83
-
-19 rtems_signal_catch 9
- rtems_signal_send: returns to caller 15
- rtems_signal_send: signal to self 18
- exit ASR overhead: returns to calling task 22
- exit ASR overhead: returns to preempting task 49
-
-20 rtems_partition_create 35
- rtems_region_create 23
- rtems_partition_get_buffer: available 15
- rtems_partition_get_buffer: not available 13
- rtems_partition_return_buffer 18
- rtems_partition_delete 16
- rtems_region_get_segment: available 22
- rtems_region_get_segment: not available -- NO_WAIT 21
- rtems_region_return_segment: no waiting tasks 19
- rtems_region_get_segment: not available -- caller blocks 64
- rtems_region_return_segment: task readied -- preempts caller 74
- rtems_region_return_segment: task readied -- returns to caller 44
- rtems_region_delete 16
- rtems_io_initialize 2
- rtems_io_open 1
- rtems_io_close 1
- rtems_io_read 1
- rtems_io_write 1
- rtems_io_control 1
-
-21 rtems_task_ident 149
- rtems_message_queue_ident 145
- rtems_semaphore_ident 156
- rtems_partition_ident 145
- rtems_region_ident 148
- rtems_port_ident 145
- rtems_timer_ident 145
- rtems_rate_monotonic_ident 145
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 42
- rtems_message_queue_broadcast: no waiting tasks 17
- rtems_message_queue_broadcast: task readied -- preempts caller 78
-
-23 rtems_timer_create 14
- rtems_timer_fire_after: inactive 22
- rtems_timer_fire_after: active 24
- rtems_timer_cancel: active 15
- rtems_timer_cancel: inactive 13
- rtems_timer_reset: inactive 21
- rtems_timer_reset: active 23
- rtems_timer_fire_when: inactive 34
- rtems_timer_fire_when: active 34
- rtems_timer_delete: active 19
- rtems_timer_delete: inactive 17
- rtems_task_wake_when 69
-
-24 rtems_task_wake_after: yield -- returns to caller 9
- rtems_task_wake_after: yields -- preempts caller 45
-
-25 rtems_clock_tick 4
-
-26 _ISR_Disable 0
- _ISR_Flash 1
- _ISR_Enable 1
- _Thread_Disable_dispatch 0
- _Thread_Enable_dispatch 7
- _Thread_Set_state 11
- _Thread_Disptach (NO FP) 31
- context switch: no floating point contexts 21
- context switch: self 10
- context switch: to another task 10
- context switch: restore 1st FP task 25
- fp context switch: save idle, restore idle 31
- fp context switch: save idle, restore initialized 19
- fp context switch: save initialized, restore initialized 20
- _Thread_Resume 7
- _Thread_Unblock 7
- _Thread_Ready 9
- _Thread_Get 4
- _Semaphore_Get 2
- _Thread_Get: invalid id 0
-
-27 interrupt entry overhead: returns to interrupted task 6
- interrupt exit overhead: returns to interrupted task 6
- interrupt entry overhead: returns to nested interrupt 6
- interrupt exit overhead: returns to nested interrupt 5
- interrupt entry overhead: returns to preempting task 7
- interrupt exit overhead: returns to preempting task 36
-
-28 rtems_port_create 16
- rtems_port_external_to_internal 11
- rtems_port_internal_to_external 11
- rtems_port_delete 16
-
-29 rtems_rate_monotonic_create 15
- rtems_rate_monotonic_period: initiate period -- returns to caller 21
- rtems_rate_monotonic_period: obtain status 13
- rtems_rate_monotonic_cancel 16
- rtems_rate_monotonic_delete: inactive 18
- rtems_rate_monotonic_delete: active 20
- rtems_rate_monotonic_period: conclude periods -- caller blocks 53
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/wrapup/Makefile.in b/c/src/lib/libbsp/no_cpu/no_bsp/wrapup/Makefile.in
deleted file mode 100644
index 4dc4ea5208..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/wrapup/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console shmsupp timer
-GENERIC_PIECES=shmdr
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/powerpc/Makefile.in b/c/src/lib/libbsp/powerpc/Makefile.in
deleted file mode 100644
index f049e9b2e8..0000000000
--- a/c/src/lib/libbsp/powerpc/Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# Descend into the $(RTEMS_BSP_FAMILY) directory
-SUB_DIRS=$(RTEMS_BSP_FAMILY)
diff --git a/c/src/lib/libbsp/powerpc/dmv177/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/Makefile.in
deleted file mode 100644
index 3e5ccf3e06..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/Makefile.in
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SRCS=README
-
-# We only build the networking device driver if HAS_NETWORKING was defined
-NETWORKING_DRIVER_yes_V = sonic
-NETWORKING_DRIVER = $(NETWORKING_DRIVER_$(HAS_NETWORKING)_V)
-
-all: $(SRCS)
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include clock console startup start timer \
- scv64 tod $(NETWORKING_DRIVER) wrapup
diff --git a/c/src/lib/libbsp/powerpc/dmv177/QUIRKS b/c/src/lib/libbsp/powerpc/dmv177/QUIRKS
deleted file mode 100644
index e1d95e6427..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/QUIRKS
+++ /dev/null
@@ -1,74 +0,0 @@
-#
-# Quirks in the DY-4 DMV177
-#
-# $Id$
-#
-
-JTAG and Caching
-================
-If data or code caching is enabled on certain revisions of the PPC603e,
-then the JTAG emulator interface become disfunctional. You can not
-debug using the emulator on these chip revisions. On certain revisions,
-it is so bad that when code caching is enabled, you can not even
-download code reliably to the board.
-
-Caching and Peripherals
-=======================
-When caching is enabled, care must be exercised to insure that all
-peripheral addresses are still uncached.
-
-Exar 88681 Clock
-================
-This board uses a different clock for the Exar 88681 DUART than is
-documented in the Exar manual or the original MC68681 manual. This
-resulted in the need for the the mc68681 libchip driver to support
-BSP specific baud rate tables and the development of a DMV177
-specific baud rate table.
-
-In the end, this all works but you have a very limited range of
-useful baud rates on the 88681 ports compared to what would have
-been supported had DY-4 just followed the Exar or Motorola manual.
-
-
-SCC Addresses
-=============
-The full set of SCC addresses is not documented in the DY-4 manual
-and they are not ordered as one would expect. Normally the four
-SCC registers are ordered Control A, Data A, Control B, and Data B.
-DY-4 orders them with B first.
-
-This required extra time to debug.
-
-
-SCV64 and the Foundation Firmware
-=================================
-DY-4 technical support did not offer code to determine which interrupt
-sources were pending at the SCV64. They recommended calling into the
-Foundation Firmware ROM monitor to figure this out. The Foundation
-Firmware did not recognize enough interrupts on this board to be useful.
-
-In the end, we gave up on their technical support's recommendation
-and directly manipulated the SVC64. This is what we wanted to do in
-the first place but we got no information from them to aid in this.
-Luckily, the manual does document enough of DY-4's mapping of the specific
-interrupt sources to make this work.
-
-
-Z85C30 SCC Clock Speed
-======================
-
-The Z85C30 SCC can be factory configured for 10 Mhz or 2.4616 Mhz. Code
-had to be added to dynamically determine which clock was installed.
-
-The board we had used a 10 Mhz clock. No testing was done with a 2.4616 Mhz
-clock.
-
-
-P2 Octopus Cable
-================
-
-DY-4's P2 breakout is large and a bit unwieldy. It was difficult to
-fight into the VME cage we used. The SCSI connector comes off the
-side and is very stiff thus making it difficult to route around
-anything in the back of the cage. We gave up on trying to use
-it in the first few slots of OAR's cage.
diff --git a/c/src/lib/libbsp/powerpc/dmv177/README b/c/src/lib/libbsp/powerpc/dmv177/README
deleted file mode 100644
index 0f00873225..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/README
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-BSP NAME: dmv177
-BOARD: DY-4 DMV177
-BUS: VMEBus
-CPU FAMILY: powerpc
-CPU: PowerPC 603e
-COPROCESSORS: N/A
-MODE: 32 bit mode
-
-DEBUG MONITOR: DY-4 General Purpose Monitor (GPM)
-
-PERIPHERALS
-===========
-TIMERS: PPC internal Timebase register
- RESOLUTION: ???
-SERIAL PORTS: 2 RS-232 provided by a Exar 88681
- 2 RS-422 provided by a Zilog Z8530
-REAL-TIME CLOCK: PPC internal Decrementer register
-DMA: none
-RTC: Harris ICM7170
-VIDEO: none
-SCSI: QLogic FAS216 SCSI-2 (unsupported)
-NETWORKING: National Semiconductor SONIC DP83932B (Ethernet)
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: PPC internal
-SHMSUPP: N/A
-TIMER DRIVER: PPC internal
-CONSOLE DRIVER: Uses libchip drivers for Exar 88681 and Zilog Z8530.
-
-STDIO
-=====
-
-These are the default settings.
-
-PORT: Console port 0
-ELECTRICAL: RS-232
-BAUD: 9600
-BITS PER CHARACTER: 8
-PARITY: N
-STOP BITS: 1
-
-Notes
-=====
-The console and real-time clock drivers use the libchip library.
diff --git a/c/src/lib/libbsp/powerpc/dmv177/README.net b/c/src/lib/libbsp/powerpc/dmv177/README.net
deleted file mode 100644
index b3ff231340..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/README.net
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# $Id$
-#
-
-Setting the Ethernet Hardware Address
-=====================================
-
-The hardware Ethernet address is not set at the factory. It is the
-responsibility of the end-user to insure that it is set properly.
-This file describes the standard procedure recommended by DY-4
-technical support for setting this address. This procedure is
-similar to that followed by VxWorks as documented in DY-4
-Document Number #807885.
-
-The hardware Ethernet address and OS configuration information
-must be stored in the SEEPROM non-volatile memory of the
-SVME/DMV-176/177. The Foundation Firmware (FFW) reserves the
-first 256 bytes of the SEEPROM for its own use and the remaining
-remaining 256 bytes are available for OS specific information.
-
-Three bytes in the Serial EEPROM are used for the lowest three bytes
-of the hardware Ethernet address These should be set to the serial
-number of your SVME/DMV-176/177 card to ensure a unique Ethernet
-address on your network. The three high bytes are hard coded in the
-BSP and represent the vendor-specific Ethernet codes (0x00, 0x80, 0x7F).
-Together these six bytes form the target's Ethernet address.
-
-Address is of the form ...
-
-NOTE: The serial number is found on the packaging (box) that the
-board came in OR it is also located on the solder side of the board and
-looks something like SERNO:XXXXXX. It can not be determined dynamically
-by software.
-
-Prior to using the Ethernet controller on the SVME/DMV-176/177 for the
-first time, the Ethernet address bytes must be programmed into the
-Serial EEPROM on the target card. The 'emm' (EEPROM Memory Modification)
-command in the General Purpose Monitor (GPM) can be used to do this.
-
-In this example we will assume that the serial number of the target card
-is 123456.
-
-
-
diff --git a/c/src/lib/libbsp/powerpc/dmv177/STATUS b/c/src/lib/libbsp/powerpc/dmv177/STATUS
deleted file mode 100644
index 394412421e..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/STATUS
+++ /dev/null
@@ -1,82 +0,0 @@
-#
-# This is a status file for the update effort.
-#
-
-make/custom
-===========
-dmv17x.cfg
-
-TOP
-===
-README
-Makefile.in
-bsp_specs
-
-clock
-=====
-clock.c
-Makefile.in
-
-console
-=======
-Changed console from
- duart.c
- console.c
-To
- consolebsp.h
- console.c
- 85c30.c
- tbl85c30.c
-
-Note: Check the number of serial ports and modify
- tbl85c30.c values to indicate the correct values.
-
-Makefile.in - Modified with new file names.
-
-timer
-=======
-timer.c
-Makefile.in
-
-include
-=======
-chain.h
-dmv170.h
-bsp.h
-Makefile
-Makefile.in
-coverhd.h
-
-network
-=======
-Eric's problem
-
-startup
-=======
-device-tree - remove
-linkcmds
-setvec.c - Modified to acount for general purpose vector.
-sbrk.c - Ok
-rtems-ctor.cc - Ok
-bspclean.s - Ok
-vmeintr.c
-Makefile.in - Added genpvec.c
-bspstart.c - Modified with changes from vista bsp.
-
-Added:
-genpvec.c
-
-Note: Need to add routine which connects the general purpose interupt with the
- various interupt handlers. genpvec.c uses this routine and may need
- to be modified.
-wrapup
-=======
-wrapup/Makefile.in
-
-vectors
-=======
-
-start
-=======
-start/Makefile.in
-start/start.s - Made modifications based upon Score603e mods.
diff --git a/c/src/lib/libbsp/powerpc/dmv177/bsp_specs b/c/src/lib/libbsp/powerpc/dmv177/bsp_specs
deleted file mode 100644
index ab5a8ddbeb..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group ecrtn%O%s \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: ecrti%O%s \
-%{!qrtems_debug: start.o%s} \
-%{qrtems_debug: start_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -Qy -dp -Bstatic -T linkcmds%s -e _start -u __vectors}
-
diff --git a/c/src/lib/libbsp/powerpc/dmv177/cable.doc b/c/src/lib/libbsp/powerpc/dmv177/cable.doc
deleted file mode 100644
index e77fbd9a95..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/cable.doc
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# Cable information for the DY-4 DMV177
-#
-# $Id$
-#
-
-Background
-==========
-
-All serial cables described in this file were built using RJ-45 ribbon
-cables which were plugged into DB-25 or DB-9 adapters wired as described.
-Matching the colors of the wires in the shell is the easiest way to
-make sure the cable is built properly.
-
-The board is configured as follows:
-
- - An MC68681 is the first two serial ports. These are RS-232 and may
- be accessed via the front panel or the P2. The front panel connector
- has both A and B serial ports on a single connector. DY-4 part number
- "OBYC3ASSY901132-000 Rev-" brings these ports out to two DB-25
- female connectors.
-
- - The MC68681 serial ports are also accessible on the P2 connector.
- DY-4 part number "OBYC3ASSY901080-004 Rev A" brings these out
- to DB-9 female connectors. These were not used in this effort.
-
- - A Z85C30 is used for the third and fourth serial ports. These are
- RS-422 and may only be accessed via the P2 connector. These are
- brought out to DB-25 male connectors. An RS-422 to RS-232 converter
- was used to interface with these serial ports.
-
-References
-==========
-
- - Linux Serial FAQ
- - http://ahmed.egypt.com/electronics/serial
- - DY-4 Documentation
-
-RS-422 Converter
-================
-
-An RS-422 to RS-232 converter from B&B Electronics was used to
-adapt the RS-422 signals so they could be used with a normal
-RS-232 serial port. Here is the information required to purchase
-one of these:
-
- RS-232/RS-422 Converter: Model 422LCON
- Power Supply: Model 422PS
-
- B&B Electronics Manufacturing Company
- 707 Dayton Road
- PO Box 1040
- Ottawa, IL 61350
- Voice: (815) 433-5100
- FAX: (815)434-7094
-
-
-Front Panel RS-232 Connection to a PC
-=====================================
-
- Board's DB-25 PC's DB-9 Color in
- Channel A COM1 Shell
- ============= ============ =========
- RX on pin 2 TX on pin 2 Red
- TX on pin 3 RX on pin 3 Blue
- GND on pin 7 GND on pin 5 Black
- DTR on pin 20 DTR on pin 4 Brown
-
- No other signals are used.
-
-RS-422 Connection to a PC
-=========================
-
-This requires two cables with the converter connecting them.
-
-P2 RS-422 to the RS-422/RS-232 Converter
-========================================
-
- Board's Converter's Color in
- DB-25 RS-422 DB-25 Shell
- =============== ============== ========
- TXD_A on pin 2 RDA on pin 5 Red
- TXD_B on pin 14 RDB on pin 17 Blue
- RX_A on pin 3 TDA on pin 2 Brown
- RX_B on pin 16 TDB on pin 14 Green
- GND on pin 7 GND on pin 7 Black
-
-
- Converter's PC's DB-9 Color in
- RS-232 DB-25 COM1 Shell
- =============== ============== ========
- TX on pin 2 TX on pin 2 Blue
- RX on pin 3 RX on pin 3 Red
- GND on pin 5 GND on pin 5 Black
- DTR on pin 4 DTR on pin 4 Brown
-
- No other signals
diff --git a/c/src/lib/libbsp/powerpc/dmv177/clock/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/clock/Makefile.in
deleted file mode 100644
index 7c2cfc0772..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/clock/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=clock
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/powerpc/dmv177/clock/clock.c b/c/src/lib/libbsp/powerpc/dmv177/clock/clock.c
deleted file mode 100644
index 75490a3382..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/clock/clock.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Clock Tick Device Driver
- *
- * This routine utilizes the Decrementer Register common to the PPC family.
- *
- * The tick frequency is directly programmed to the configured number of
- * microseconds per tick.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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 <stdlib.h>
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-extern rtems_cpu_table Cpu_table;
-
-/*
- * The Real Time Clock Counter Timer uses this trap type.
- */
-
-#define CLOCK_VECTOR PPC_IRQ_DECREMENTER
-
-/*
- * Clock ticks since initialization
- */
-
-volatile rtems_unsigned32 Clock_driver_ticks;
-
-/*
- * This is the value programmed into the count down timer.
- */
-
-rtems_unsigned32 Clock_Decrementer_value;
-
-/*
- * This is the value of the old isr routine.
- */
-rtems_isr_entry Old_ticker;
-
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-/*PAGE
- *
- * Clock_isr
- *
- * This is the clock tick interrupt handler.
- *
- * Input parameters:
- * vector - vector number
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- *
- */
-
-rtems_isr Clock_isr(
- rtems_vector_number vector,
- CPU_Interrupt_frame *frame
-)
-{
- /*
- * Set the decrementer.
- */
-
- PPC_Set_decrementer( Clock_Decrementer_value );
-
- /*
- * The driver has seen another tick.
- */
-
- Clock_driver_ticks += 1;
-
- /*
- * Real Time Clock counter/timer is set to automatically reload.
- */
-
- rtems_clock_tick();
-}
-
-/*PAGE
- *
- * Install_clock
- *
- * This routine actually performs the hardware initialization for the clock.
- *
- * Input parameters:
- * clock_isr - clock interrupt service routine entry point
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- *
- */
-
-extern int CLOCK_SPEED;
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
- Clock_driver_ticks = 0;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
-
- PPC_Set_decrementer( Clock_Decrementer_value );
-
- atexit( Clock_exit );
- }
-}
-
-/*PAGE
- *
- * Clock_exit
- *
- * This routine allows the clock driver to exit by masking the interrupt and
- * disabling the clock's counter.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- *
- */
-
-void Clock_exit( void )
-{
- if ( BSP_Configuration.ticks_per_timeslice ) {
-
- /* nothing to do */;
-
- /* do not restore old vector */
- }
-}
-
-/*PAGE
- *
- * Clock_initialize
- *
- * This routine initializes the clock driver.
- *
- * Input parameters:
- * major - clock device major number
- * minor - clock device minor number
- * parg - pointer to optional device driver arguments
- *
- * Output parameters: NONE
- *
- * Return values:
- * rtems_device_driver status code
- */
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Clock_Decrementer_value = Cpu_table.clicks_per_usec *
- BSP_Configuration.microseconds_per_tick;
-
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-/* PAGE
- *
- * Clock_control
- *
- * This routine is the clock device driver control entry point.
- *
- * Input parameters:
- * major - clock device major number
- * minor - clock device minor number
- * parg - pointer to optional device driver arguments
- *
- * Output parameters: NONE
- *
- * Return values:
- * rtems_device_driver status code
- */
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr( CLOCK_VECTOR, pargp );
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
-
-
-
-
-
diff --git a/c/src/lib/libbsp/powerpc/dmv177/console/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/console/Makefile.in
deleted file mode 100644
index 261eb79a82..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=config console debugio
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/powerpc/dmv177/console/config.c b/c/src/lib/libbsp/powerpc/dmv177/console/config.c
deleted file mode 100644
index e3a0eb073f..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/console/config.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * This file contains the TTY driver table for the DY-4 DMV177.
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#include <libchip/serial.h>
-#include <libchip/mc68681.h>
-#include <libchip/z85c30.h>
-
-/*
- * Configuration specific probe routines
- *
- *
- * NOTE: There are no DMV177 specific configuration routines. These
- * routines could be written to dynamically determine which serial
- * ports are on a board. Debugging this would require access to
- * multiple board models.
- */
-
-/* NONE CURRENTLY PROVIDED */
-
-/*
- * The following table configures the console drivers used in this BSP.
- *
- * The first entry which, when probed, is available, will be named /dev/console,
- * all others being given the name indicated.
- */
-
-mc68681_baud_t
- dmv177_mc68681_baud_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = {
- { /* ACR[7] = 0, X = 0 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- MC68681_BAUD_NOT_VALID, /* B50 */
- 0x01, /* B75 */
- MC68681_BAUD_NOT_VALID, /* B110 */
- 0x03, /* B134 */
- MC68681_BAUD_NOT_VALID, /* B150 */
- 0x04, /* B200 */
- MC68681_BAUD_NOT_VALID, /* B300 */
- MC68681_BAUD_NOT_VALID, /* B600 */
- MC68681_BAUD_NOT_VALID, /* B1200 */
- MC68681_BAUD_NOT_VALID, /* B1800 */
- MC68681_BAUD_NOT_VALID, /* B2400 */
- 0x0A, /* B4800 */
- MC68681_BAUD_NOT_VALID, /* B9600 */
- MC68681_BAUD_NOT_VALID, /* B19200 */
- MC68681_BAUD_NOT_VALID, /* B38400 */
- MC68681_BAUD_NOT_VALID, /* B57600 */
- MC68681_BAUD_NOT_VALID, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
- { /* ACR[7] = 1, X = 0 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- 0x00, /* B50 */
- 0x01, /* B75 */
- MC68681_BAUD_NOT_VALID, /* B110 */
- MC68681_BAUD_NOT_VALID, /* B134 */
- MC68681_BAUD_NOT_VALID, /* B150 */
- 0x04, /* B200 */
- MC68681_BAUD_NOT_VALID, /* B300 */
- MC68681_BAUD_NOT_VALID, /* B600 */
- 0x0A, /* B1200 */
- MC68681_BAUD_NOT_VALID, /* B1800 */
- MC68681_BAUD_NOT_VALID, /* B2400 */
- MC68681_BAUD_NOT_VALID, /* B4800 */
- MC68681_BAUD_NOT_VALID, /* B9600 */
- MC68681_BAUD_NOT_VALID, /* B19200 */
- MC68681_BAUD_NOT_VALID, /* B38400 */
- MC68681_BAUD_NOT_VALID, /* B57600 */
- MC68681_BAUD_NOT_VALID, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
- { /* ACR[7] = 0, X = 1 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- 0x00, /* B50 */
- 0x01, /* B75 */
- MC68681_BAUD_NOT_VALID, /* B110 */
- MC68681_BAUD_NOT_VALID, /* B134 */
- MC68681_BAUD_NOT_VALID, /* B150 */
- MC68681_BAUD_NOT_VALID, /* B200 */
- MC68681_BAUD_NOT_VALID, /* B300 */
- MC68681_BAUD_NOT_VALID, /* B600 */
- MC68681_BAUD_NOT_VALID, /* B1200 */
- MC68681_BAUD_NOT_VALID, /* B1800 */
- 0x04, /* B2400 */
- MC68681_BAUD_NOT_VALID, /* B4800 */
- 0x05, /* B9600 */
- 0x06, /* B19200 */
- 0x07, /* B38400 */
- MC68681_BAUD_NOT_VALID, /* B57600 */
- MC68681_BAUD_NOT_VALID, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
- { /* ACR[7] = 1, X = 1 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- MC68681_BAUD_NOT_VALID, /* B50 */
- 0x01, /* B75 */
- MC68681_BAUD_NOT_VALID, /* B110 */
- 0x03, /* B134 */
- MC68681_BAUD_NOT_VALID, /* B150 */
- MC68681_BAUD_NOT_VALID, /* B200 */
- MC68681_BAUD_NOT_VALID, /* B300 */
- MC68681_BAUD_NOT_VALID, /* B600 */
- MC68681_BAUD_NOT_VALID, /* B1200 */
- MC68681_BAUD_NOT_VALID, /* B1800 */
- 0x04, /* B2400 */
- 0x0A, /* B4800 */
- 0x05, /* B9600 */
- 0x06, /* B19200 */
- 0x07, /* B38400 */
- MC68681_BAUD_NOT_VALID, /* B57600 */
- MC68681_BAUD_NOT_VALID, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
-};
-
-#define MC68681_PORT_CONFIG \
- (MC68681_DATA_BAUD_RATE_SET_1|MC68681_XBRG_ENABLED)
-
-/*
- * Based on BSP configuration information decide whether to do polling IO
- * or interrupt driven IO.
- */
-
-#if (CONSOLE_USE_INTERRUPTS)
-#define MC68681_FUNCTIONS &mc68681_fns
-#define Z85C30_FUNCTIONS &z85c30_fns
-#else
-#define MC68681_FUNCTIONS &mc68681_fns_polled
-#define Z85C30_FUNCTIONS &z85c30_fns_polled
-#endif
-
-boolean dmv177_z85c30_probe(int minor);
-boolean dmv177_mc68681_probe(int minor);
-
-console_tbl Console_Port_Tbl[] = {
- {
- "/dev/com0", /* sDeviceName */
- SERIAL_MC68681, /* deviceType */
- MC68681_FUNCTIONS, /* pDeviceFns */
- dmv177_mc68681_probe, /* deviceProbe */
- NULL, /* pDeviceFlow */
- 16, /* ulMargin */
- 8, /* ulHysteresis */
- (void *)9600, /* baud rate */ /* pDeviceParams */
- MC68681_ADDR, /* ulCtrlPort1 */
- MC68681_PORT1_ADDR, /* ulCtrlPort2 */
- MC68681_PORT_CONFIG, /* ulDataPort */
- mc68681_get_register_8, /* getRegister */
- mc68681_set_register_8, /* setRegister */
- NULL, /* unused */ /* getData */
- NULL, /* unused */ /* setData */
- (unsigned32)dmv177_mc68681_baud_table, /* ulClock */
- DMV170_DUART_IRQ /* ulIntVector */
- },
- {
- "/dev/com1", /* sDeviceName */
- SERIAL_MC68681, /* deviceType */
- MC68681_FUNCTIONS, /* pDeviceFns */
- dmv177_mc68681_probe, /* deviceProbe */
- NULL, /* pDeviceFlow */
- 16, /* ulMargin */
- 8, /* ulHysteresis */
- (void *)9600, /* baud rate */ /* pDeviceParams */
- MC68681_ADDR, /* ulCtrlPort1 */
- MC68681_PORT2_ADDR, /* ulCtrlPort2 */
- MC68681_PORT_CONFIG, /* ulDataPort */
- mc68681_get_register_8, /* getRegister */
- mc68681_set_register_8, /* setRegister */
- NULL, /* unused */ /* getData */
- NULL, /* unused */ /* setData */
- (unsigned32)dmv177_mc68681_baud_table, /* ulClock */
- DMV170_DUART_IRQ /* ulIntVector */
- },
- {
- "/dev/com3", /* sDeviceName */
- SERIAL_Z85C30, /* deviceType */
- Z85C30_FUNCTIONS, /* pDeviceFns */
- dmv177_z85c30_probe, /* deviceProbe */
- NULL, /* pDeviceFlow */
- 16, /* ulMargin */
- 8, /* ulHysteresis */
- (void *)9600, /* baud rate */ /* pDeviceParams */
- Z85C30_CTRL_A, /* ulCtrlPort1 */
- Z85C30_CTRL_A, /* ulCtrlPort2 */
- 0, /* ulDataPort */
- z85c30_get_register, /* getRegister */
- z85c30_set_register, /* setRegister */
- NULL, /* getData */
- NULL, /* setData */
- 0, /* filled in by probe */ /* ulClock */
- DMV170_SCC_IRQ /* ulIntVector */
- },
- {
- "/dev/com4", /* sDeviceName */
- SERIAL_Z85C30, /* deviceType */
- Z85C30_FUNCTIONS, /* pDeviceFns */
- dmv177_z85c30_probe, /* deviceProbe */
- NULL, /* pDeviceFlow */
- 16, /* ulMargin */
- 8, /* ulHysteresis */
- (void *)9600, /* baud rate */ /* pDeviceParams */
- Z85C30_CTRL_B, /* ulCtrlPort1 */
- Z85C30_CTRL_A, /* ulCtrlPort2 */
- 0, /* ulDataPort */
- z85c30_get_register, /* getRegister */
- z85c30_set_register, /* setRegister */
- NULL, /* getData */
- NULL, /* setData */
- 0, /* filled in by probe */ /* ulClock */
- DMV170_SCC_IRQ /* ulIntVector */
- }
-};
-
-/*
- * Declare some information used by the console driver
- */
-
-#define NUM_CONSOLE_PORTS (sizeof(Console_Port_Tbl)/sizeof(console_tbl))
-
-unsigned long Console_Port_Count = NUM_CONSOLE_PORTS;
-
-console_data Console_Port_Data[NUM_CONSOLE_PORTS];
-
-rtems_device_minor_number Console_Port_Minor;
-
-/*
- * Hopefully, by checking the card resource register, this BSP
- * will be able to operate on the DMV171, DMV176, or DMV177.
- */
-
-boolean dmv177_z85c30_probe(int minor)
-{
- volatile unsigned32 *dma_control_status_reg;
- volatile unsigned16 *card_resource_reg;
- unsigned16 v;
-
- card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG;
-
- v = *card_resource_reg & DMV170_SCC_INST_MASK;
-
- if ( v != DMV170_SCC_INSTALLED )
- return FALSE;
-
- /*
- * Figure out the clock speed of the Z85C30 SCC
- */
-
- dma_control_status_reg = (volatile unsigned32 *)DMV170_DMA_CONTROL_STATUS_REG;
-
- if ( *dma_control_status_reg & DMV170_SCC_10MHZ )
- Console_Port_Tbl[minor].ulClock = Z85C30_CLOCK_10;
- else
- Console_Port_Tbl[minor].ulClock = Z85C30_CLOCK_2;
-
- return TRUE;
-}
-
-boolean dmv177_mc68681_probe(int minor)
-{
- volatile unsigned16 *card_resource_reg;
- unsigned16 v;
-
- card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG;
-
- v = *card_resource_reg & DMV170_DUART_INST_MASK;
-
- if ( v == DMV170_DUART_INSTALLED )
- return TRUE;
-
- return FALSE;
-}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c b/c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c
deleted file mode 100644
index e3a0eb073f..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * This file contains the TTY driver table for the DY-4 DMV177.
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#include <libchip/serial.h>
-#include <libchip/mc68681.h>
-#include <libchip/z85c30.h>
-
-/*
- * Configuration specific probe routines
- *
- *
- * NOTE: There are no DMV177 specific configuration routines. These
- * routines could be written to dynamically determine which serial
- * ports are on a board. Debugging this would require access to
- * multiple board models.
- */
-
-/* NONE CURRENTLY PROVIDED */
-
-/*
- * The following table configures the console drivers used in this BSP.
- *
- * The first entry which, when probed, is available, will be named /dev/console,
- * all others being given the name indicated.
- */
-
-mc68681_baud_t
- dmv177_mc68681_baud_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = {
- { /* ACR[7] = 0, X = 0 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- MC68681_BAUD_NOT_VALID, /* B50 */
- 0x01, /* B75 */
- MC68681_BAUD_NOT_VALID, /* B110 */
- 0x03, /* B134 */
- MC68681_BAUD_NOT_VALID, /* B150 */
- 0x04, /* B200 */
- MC68681_BAUD_NOT_VALID, /* B300 */
- MC68681_BAUD_NOT_VALID, /* B600 */
- MC68681_BAUD_NOT_VALID, /* B1200 */
- MC68681_BAUD_NOT_VALID, /* B1800 */
- MC68681_BAUD_NOT_VALID, /* B2400 */
- 0x0A, /* B4800 */
- MC68681_BAUD_NOT_VALID, /* B9600 */
- MC68681_BAUD_NOT_VALID, /* B19200 */
- MC68681_BAUD_NOT_VALID, /* B38400 */
- MC68681_BAUD_NOT_VALID, /* B57600 */
- MC68681_BAUD_NOT_VALID, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
- { /* ACR[7] = 1, X = 0 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- 0x00, /* B50 */
- 0x01, /* B75 */
- MC68681_BAUD_NOT_VALID, /* B110 */
- MC68681_BAUD_NOT_VALID, /* B134 */
- MC68681_BAUD_NOT_VALID, /* B150 */
- 0x04, /* B200 */
- MC68681_BAUD_NOT_VALID, /* B300 */
- MC68681_BAUD_NOT_VALID, /* B600 */
- 0x0A, /* B1200 */
- MC68681_BAUD_NOT_VALID, /* B1800 */
- MC68681_BAUD_NOT_VALID, /* B2400 */
- MC68681_BAUD_NOT_VALID, /* B4800 */
- MC68681_BAUD_NOT_VALID, /* B9600 */
- MC68681_BAUD_NOT_VALID, /* B19200 */
- MC68681_BAUD_NOT_VALID, /* B38400 */
- MC68681_BAUD_NOT_VALID, /* B57600 */
- MC68681_BAUD_NOT_VALID, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
- { /* ACR[7] = 0, X = 1 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- 0x00, /* B50 */
- 0x01, /* B75 */
- MC68681_BAUD_NOT_VALID, /* B110 */
- MC68681_BAUD_NOT_VALID, /* B134 */
- MC68681_BAUD_NOT_VALID, /* B150 */
- MC68681_BAUD_NOT_VALID, /* B200 */
- MC68681_BAUD_NOT_VALID, /* B300 */
- MC68681_BAUD_NOT_VALID, /* B600 */
- MC68681_BAUD_NOT_VALID, /* B1200 */
- MC68681_BAUD_NOT_VALID, /* B1800 */
- 0x04, /* B2400 */
- MC68681_BAUD_NOT_VALID, /* B4800 */
- 0x05, /* B9600 */
- 0x06, /* B19200 */
- 0x07, /* B38400 */
- MC68681_BAUD_NOT_VALID, /* B57600 */
- MC68681_BAUD_NOT_VALID, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
- { /* ACR[7] = 1, X = 1 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- MC68681_BAUD_NOT_VALID, /* B50 */
- 0x01, /* B75 */
- MC68681_BAUD_NOT_VALID, /* B110 */
- 0x03, /* B134 */
- MC68681_BAUD_NOT_VALID, /* B150 */
- MC68681_BAUD_NOT_VALID, /* B200 */
- MC68681_BAUD_NOT_VALID, /* B300 */
- MC68681_BAUD_NOT_VALID, /* B600 */
- MC68681_BAUD_NOT_VALID, /* B1200 */
- MC68681_BAUD_NOT_VALID, /* B1800 */
- 0x04, /* B2400 */
- 0x0A, /* B4800 */
- 0x05, /* B9600 */
- 0x06, /* B19200 */
- 0x07, /* B38400 */
- MC68681_BAUD_NOT_VALID, /* B57600 */
- MC68681_BAUD_NOT_VALID, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
-};
-
-#define MC68681_PORT_CONFIG \
- (MC68681_DATA_BAUD_RATE_SET_1|MC68681_XBRG_ENABLED)
-
-/*
- * Based on BSP configuration information decide whether to do polling IO
- * or interrupt driven IO.
- */
-
-#if (CONSOLE_USE_INTERRUPTS)
-#define MC68681_FUNCTIONS &mc68681_fns
-#define Z85C30_FUNCTIONS &z85c30_fns
-#else
-#define MC68681_FUNCTIONS &mc68681_fns_polled
-#define Z85C30_FUNCTIONS &z85c30_fns_polled
-#endif
-
-boolean dmv177_z85c30_probe(int minor);
-boolean dmv177_mc68681_probe(int minor);
-
-console_tbl Console_Port_Tbl[] = {
- {
- "/dev/com0", /* sDeviceName */
- SERIAL_MC68681, /* deviceType */
- MC68681_FUNCTIONS, /* pDeviceFns */
- dmv177_mc68681_probe, /* deviceProbe */
- NULL, /* pDeviceFlow */
- 16, /* ulMargin */
- 8, /* ulHysteresis */
- (void *)9600, /* baud rate */ /* pDeviceParams */
- MC68681_ADDR, /* ulCtrlPort1 */
- MC68681_PORT1_ADDR, /* ulCtrlPort2 */
- MC68681_PORT_CONFIG, /* ulDataPort */
- mc68681_get_register_8, /* getRegister */
- mc68681_set_register_8, /* setRegister */
- NULL, /* unused */ /* getData */
- NULL, /* unused */ /* setData */
- (unsigned32)dmv177_mc68681_baud_table, /* ulClock */
- DMV170_DUART_IRQ /* ulIntVector */
- },
- {
- "/dev/com1", /* sDeviceName */
- SERIAL_MC68681, /* deviceType */
- MC68681_FUNCTIONS, /* pDeviceFns */
- dmv177_mc68681_probe, /* deviceProbe */
- NULL, /* pDeviceFlow */
- 16, /* ulMargin */
- 8, /* ulHysteresis */
- (void *)9600, /* baud rate */ /* pDeviceParams */
- MC68681_ADDR, /* ulCtrlPort1 */
- MC68681_PORT2_ADDR, /* ulCtrlPort2 */
- MC68681_PORT_CONFIG, /* ulDataPort */
- mc68681_get_register_8, /* getRegister */
- mc68681_set_register_8, /* setRegister */
- NULL, /* unused */ /* getData */
- NULL, /* unused */ /* setData */
- (unsigned32)dmv177_mc68681_baud_table, /* ulClock */
- DMV170_DUART_IRQ /* ulIntVector */
- },
- {
- "/dev/com3", /* sDeviceName */
- SERIAL_Z85C30, /* deviceType */
- Z85C30_FUNCTIONS, /* pDeviceFns */
- dmv177_z85c30_probe, /* deviceProbe */
- NULL, /* pDeviceFlow */
- 16, /* ulMargin */
- 8, /* ulHysteresis */
- (void *)9600, /* baud rate */ /* pDeviceParams */
- Z85C30_CTRL_A, /* ulCtrlPort1 */
- Z85C30_CTRL_A, /* ulCtrlPort2 */
- 0, /* ulDataPort */
- z85c30_get_register, /* getRegister */
- z85c30_set_register, /* setRegister */
- NULL, /* getData */
- NULL, /* setData */
- 0, /* filled in by probe */ /* ulClock */
- DMV170_SCC_IRQ /* ulIntVector */
- },
- {
- "/dev/com4", /* sDeviceName */
- SERIAL_Z85C30, /* deviceType */
- Z85C30_FUNCTIONS, /* pDeviceFns */
- dmv177_z85c30_probe, /* deviceProbe */
- NULL, /* pDeviceFlow */
- 16, /* ulMargin */
- 8, /* ulHysteresis */
- (void *)9600, /* baud rate */ /* pDeviceParams */
- Z85C30_CTRL_B, /* ulCtrlPort1 */
- Z85C30_CTRL_A, /* ulCtrlPort2 */
- 0, /* ulDataPort */
- z85c30_get_register, /* getRegister */
- z85c30_set_register, /* setRegister */
- NULL, /* getData */
- NULL, /* setData */
- 0, /* filled in by probe */ /* ulClock */
- DMV170_SCC_IRQ /* ulIntVector */
- }
-};
-
-/*
- * Declare some information used by the console driver
- */
-
-#define NUM_CONSOLE_PORTS (sizeof(Console_Port_Tbl)/sizeof(console_tbl))
-
-unsigned long Console_Port_Count = NUM_CONSOLE_PORTS;
-
-console_data Console_Port_Data[NUM_CONSOLE_PORTS];
-
-rtems_device_minor_number Console_Port_Minor;
-
-/*
- * Hopefully, by checking the card resource register, this BSP
- * will be able to operate on the DMV171, DMV176, or DMV177.
- */
-
-boolean dmv177_z85c30_probe(int minor)
-{
- volatile unsigned32 *dma_control_status_reg;
- volatile unsigned16 *card_resource_reg;
- unsigned16 v;
-
- card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG;
-
- v = *card_resource_reg & DMV170_SCC_INST_MASK;
-
- if ( v != DMV170_SCC_INSTALLED )
- return FALSE;
-
- /*
- * Figure out the clock speed of the Z85C30 SCC
- */
-
- dma_control_status_reg = (volatile unsigned32 *)DMV170_DMA_CONTROL_STATUS_REG;
-
- if ( *dma_control_status_reg & DMV170_SCC_10MHZ )
- Console_Port_Tbl[minor].ulClock = Z85C30_CLOCK_10;
- else
- Console_Port_Tbl[minor].ulClock = Z85C30_CLOCK_2;
-
- return TRUE;
-}
-
-boolean dmv177_mc68681_probe(int minor)
-{
- volatile unsigned16 *card_resource_reg;
- unsigned16 v;
-
- card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG;
-
- v = *card_resource_reg & DMV170_DUART_INST_MASK;
-
- if ( v == DMV170_DUART_INSTALLED )
- return TRUE;
-
- return FALSE;
-}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/console/debugio.c b/c/src/lib/libbsp/powerpc/dmv177/console/debugio.c
deleted file mode 100644
index d23df205a3..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/console/debugio.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * This file contains the debug IO support.
- *
- * COPYRIGHT (c) 1998 by Radstone Technology
- *
- *
- * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
- * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
- *
- * You are hereby granted permission to use, copy, modify, and distribute
- * this file, provided that this notice, plus the above copyright notice
- * and disclaimer, appears in all copies. Radstone Technology will provide
- * no support for this code.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <termios.h>
-
-#include <libchip/serial.h>
-
-/*
- * Load configuration table
- */
-
-extern console_data Console_Port_Data[];
-extern rtems_device_minor_number Console_Port_Minor;
-
-/* PAGE
- *
- * DEBUG_puts
- *
- * This should be safe in the event of an error. It attempts to ensure
- * that no TX empty interrupts occur while it is doing polled IO. Then
- * it restores the state of that external interrupt.
- *
- * Input parameters:
- * string - pointer to debug output string
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void DEBUG_puts(
- char *string
-)
-{
- char *s;
- unsigned32 Irql;
-
- rtems_interrupt_disable(Irql);
-
- for ( s = string ; *s ; s++ ) {
- Console_Port_Tbl[Console_Port_Minor].pDeviceFns->
- deviceWritePolled(Console_Port_Minor, *s);
- }
-
- rtems_interrupt_enable(Irql);
-}
-
-/* PAGE
- *
- * DEBUG_puth
- *
- * This should be safe in the event of an error. It attempts to ensure
- * that no TX empty interrupts occur while it is doing polled IO. Then
- * it restores the state of that external interrupt.
- *
- * Input parameters:
- * ulHexNum - value to display
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void DEBUG_puth(
- unsigned32 ulHexNum
-)
-{
- unsigned long i,d;
- unsigned32 Irql;
- void (*poll)(int minor, char cChar);
-
- poll = Console_Port_Tbl[Console_Port_Minor].pDeviceFns->deviceWritePolled;
-
- rtems_interrupt_disable(Irql);
-
- (*poll)(Console_Port_Minor, '0');
- (*poll)(Console_Port_Minor, 'x');
-
- for ( i=32 ; i ; ) {
- i -= 4;
- d = (ulHexNum>>i)&0xf;
- (*poll)(Console_Port_Minor, (d<=9) ? d+'0' : d+'a'-0xa);
- }
- rtems_interrupt_enable(Irql);
-}
-
diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in
deleted file mode 100644
index a711b3e1de..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h \
- $(srcdir)/dmv170.h $(srcdir)/../../../shared/tod.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-# If you add equate files, don't forget to uncomment the install line
-# below.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/bsp.h b/c/src/lib/libbsp/powerpc/dmv177/include/bsp.h
deleted file mode 100644
index f99211f8d3..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/include/bsp.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/* bsp.h
- *
- * This include file contains all DY-4 DMV170 board IO definitions.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * This material may be reproduced by or for the U.S. Government pursuant
- * to the copyright license under the clause at DFARS 252.227-7013. This
- * notice must appear in all copies of this file and its derivatives.
- *
- * $Id$
- */
-
-#ifndef __DMV170_BSP_h
-#define __DMV170_BSP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef ASM
-/* Definition of where to store registers in alignment handler */
-#define ALIGN_REGS 0x0140
-
-#else
-#include <rtems.h>
-#include <console.h>
-#include <clockdrv.h>
-#include <console.h>
-#include <iosupp.h>
-
-#include <dmv170.h>
-
-#if 0
-#define Enable_Debug() \
- DMV170_WRITE( 0xffffbd0c, 0 )
-
-#define Debug_Entry( num ) \
- DMV170_WRITE( 0xffffbd06, num )
-#else
-#define Enable_Debug()
-#define Debug_Entry( num )
-#endif
-
-/*
- * The following macro calculates the Baud constant. For the Z8530 chip.
- */
-#define Z8530_Baud( _frequency, _clock_by, _baud_rate ) \
- ( (_frequency /( _clock_by * 2 * _baud_rate)) - 2)
-
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-
-/*
- * Stuff for Time Test 27
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 1
-
-#define Install_tm27_vector( _handler ) \
- set_vector( (_handler), PPC_IRQ_DECREMENTER, 1 )
-
-#define Cause_tm27_intr() \
- do { \
- unsigned32 _clicks = 1; \
- asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
- } while (0)
-
-#define Clear_tm27_intr() \
- do { \
- unsigned32 _clicks = 0xffffffff; \
- unsigned32 _msr = 0; \
- _ISR_Set_level( 0 ); \
- asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
- _msr &= ~0x8000; \
- asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
- asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
- } while (0)
-
-#define Lower_tm27_intr() \
- do { \
- unsigned32 _msr = 0; \
- _ISR_Set_level( 0 ); \
- asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
- _msr |= 0x8002; \
- asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
- } while (0)
-
-/* Constants */
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-
-/*
- * Information placed in the linkcmds file.
- */
-
-extern int RAM_START;
-extern int RAM_END;
-extern int RAM_SIZE;
-
-extern int PROM_START;
-extern int PROM_END;
-extern int PROM_SIZE;
-
-extern int CLOCK_SPEED;
-
-extern int end; /* last address in the program */
-
-/*
- * How many libio files we want
- */
-
-#define BSP_LIBIO_MAX_FDS 20
-
-/* functions */
-
-/*
- * genvec.c
- */
-rtems_isr_entry set_EE_vector(
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector /* vector number */
-);
-void initialize_external_exception_vector ();
-
-/*
- * console.c
- */
-void DEBUG_puts( char *string );
-
-void BSP_fatal_return( void );
-
-
-
-void bsp_start( void );
-
-void bsp_cleanup( void );
-
-rtems_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-);
-
-void BSP_fatal_return( void );
-
-void bsp_spurious_initialize( void );
-
-extern rtems_configuration_table BSP_Configuration; /* owned by BSP */
-
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
-extern rtems_unsigned32 bsp_isr_level;
-
-extern int CPU_PPC_CLICKS_PER_MS;
-
-#endif /* ASM */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h b/c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h
deleted file mode 100644
index 451d13b706..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- * This file should be updated after running the C overhead timing
- * test. Once this update has been performed, the RTEMS Time Test
- * Suite should be rebuilt to account for these overhead times in the
- * timing results.
- *
- * NOTE: If these are all zero, then the times reported include
- * calling overhead including passing of arguments.
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * This material may be reproduced by or for the U.S. Government pursuant
- * to the copyright license under the clause at DFARS 252.227-7013. This
- * notice must appear in all copies of this file and its derivatives.
- *
- * $Id$
- */
-
-/*
- *
- * Units are 100ns.
- *
- * These numbers are of questionable use, as they are developed by calling
- * the routine many times, thus getting its entry veneer into the (small)
- * cache on the 403GA. This in general is not true of the RTEMS timing
- * tests, which usually call a routine only once, thus having no cache loaded
- * advantage.
- *
- * Whether the directive times are useful after deducting the function call
- * overhead is also questionable. The user is more interested generally
- * in the total cost of a directive, not the cost if the procedure call
- * is inlined! (In general this is not true).
- *
- * Andrew Bray 18/08/1995
- *
- */
-
-#ifndef __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
-#define CALLING_OVERHEAD_TASK_CREATE 0
-#define CALLING_OVERHEAD_TASK_IDENT 0
-#define CALLING_OVERHEAD_TASK_START 0
-#define CALLING_OVERHEAD_TASK_RESTART 0
-#define CALLING_OVERHEAD_TASK_DELETE 0
-#define CALLING_OVERHEAD_TASK_SUSPEND 0
-#define CALLING_OVERHEAD_TASK_RESUME 0
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
-#define CALLING_OVERHEAD_TASK_MODE 0
-#define CALLING_OVERHEAD_TASK_GET_NOTE 0
-#define CALLING_OVERHEAD_TASK_SET_NOTE 0
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 0
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
-#define CALLING_OVERHEAD_CLOCK_GET 0
-#define CALLING_OVERHEAD_CLOCK_SET 0
-#define CALLING_OVERHEAD_CLOCK_TICK 0
-
-#define CALLING_OVERHEAD_TIMER_CREATE 0
-#define CALLING_OVERHEAD_TIMER_IDENT 0
-#define CALLING_OVERHEAD_TIMER_DELETE 0
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 0
-#define CALLING_OVERHEAD_TIMER_RESET 0
-#define CALLING_OVERHEAD_TIMER_CANCEL 0
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
-
-#define CALLING_OVERHEAD_EVENT_SEND 0
-#define CALLING_OVERHEAD_EVENT_RECEIVE 0
-#define CALLING_OVERHEAD_SIGNAL_CATCH 0
-#define CALLING_OVERHEAD_SIGNAL_SEND 0
-#define CALLING_OVERHEAD_PARTITION_CREATE 0
-#define CALLING_OVERHEAD_PARTITION_IDENT 0
-#define CALLING_OVERHEAD_PARTITION_DELETE 0
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
-#define CALLING_OVERHEAD_REGION_CREATE 0
-#define CALLING_OVERHEAD_REGION_IDENT 0
-#define CALLING_OVERHEAD_REGION_DELETE 0
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
-#define CALLING_OVERHEAD_PORT_CREATE 0
-#define CALLING_OVERHEAD_PORT_IDENT 0
-#define CALLING_OVERHEAD_PORT_DELETE 0
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 0
-#define CALLING_OVERHEAD_IO_OPEN 0
-#define CALLING_OVERHEAD_IO_CLOSE 0
-#define CALLING_OVERHEAD_IO_READ 0
-#define CALLING_OVERHEAD_IO_WRITE 0
-#define CALLING_OVERHEAD_IO_CONTROL 0
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h b/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h
deleted file mode 100644
index b676dafe0c..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h
+++ /dev/null
@@ -1,290 +0,0 @@
-/* dmv170.h
- *
- * This include file contains information pertaining to the DMV170.
- *
- * NOTE: Other than where absolutely required, this version currently
- * supports only the peripherals and bits used by the basic board
- * support package. This includes at least significant pieces of
- * the following items:
- *
- * + UART Channels A and B
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-#ifndef _INCLUDE_DMV170_h
-#define _INCLUDE_DMV170_h
-
-
-/*
- * DY-4 uses a non-standard clock for the Exar 88681.
- */
-
-#undef MC68681_BAUD_RATE_MASK_9600
-#define MC68681_BAUD_RATE_MASK_9600
-
-#define DMV17x_MC68681_BAUD_RATE_MASK_9600
-
-#if 0
-#define MC68681_OFFSET_MULTIPLIER 8
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Note: Move address defs to the linker files. XXX */
-
-/* Real Time Clock Base Address */
-#define DMV170_RTC_ADDRESS 0xf2c00000
-
-/* base address of the DUART (68681) */
-#define MC68681_ADDR 0xf2800000
-#define MC68681_PORT1_ADDR 0xf2800000
-#define MC68681_PORT2_ADDR 0xf2800040
-
-/*
- * SONIC Information
- */
-
-#define DMV170_SONIC_ADDR 0xf3000000
-
-#define SONIC_BASE_ADDRESS DMV170_SONIC_ADDR
-#define SONIC_VECTOR DMV170_ETHERNET_IRQ
-
-/* base address for the SCC (85C30) */
-#define Z85C30_ADDR 0xfb000010
-#define Z85C30_CTRL_A 0xfb000010
-#define Z85C30_DATA_A 0xfb000018
-#define Z85C30_CTRL_B 0xfb000000
-#define Z85C30_DATA_B 0xfb000008
-#define Z85C30_CLOCK_10 (10485760) /* 10 Mhz */
-#define Z85C30_CLOCK_2 (2581175) /* 2.4616 Mhz */
-
-/* base address for the SCV64 */
-#define DMV170_SCV64_BASE_ADDRESS 0xf2000000
-
-#define DMV170_LOCAL_CONTROL_STATUS_REG 0xf2400000
-#define DMV170_TIMER0_COUNT_INTERVAL_REG 0xf2400008
-#define DMV170_TIMER1_COUNT_INTERVAL_REG 0xf2400010
-#define DMV170_TIMER2_COUNT_INTERVAL_REG 0xf2400018
-#define DMV170_TIMER_CONTROL_REG 0xf2400020
-#define DMV170_CARD_RESORCE_REG 0xf2400040
-
-#define DMV170_WRITE( _reg, _data ) \
- *((volatile rtems_unsigned16 *)(_reg)) = (_data)
-
-#define DMV170_READ( _reg, _data ) \
- (_data) = *((volatile rtems_unsigned16 *)(_reg))
-
-/*
- * The following defines the bits in the DMA Control and Status Register
- */
-
-/* XXX fill in the other bits */
-
-#define DMV170_DMA_CONTROL_STATUS_REG 0xfc000090
-
-#define DMV170_SCC_10MHZ 0x00010000
-
-/*
- * The following defines the bits in the Local Control and Status Register.
- */
-#define DMV170_IPLx_MASK 0x0007
-#define DMV170_MAXPACK_SENSE_MASK 0x0008
-#define DMV170_MAXPACK_NOT_INSTALLED 0x0008
-#define DMV170_MAXPACK_INSTALLED 0x0000
-
-#define DMV170_MAXPACK_RESET_MASK 0x0010
-#define DMV170_MAXPACK_RESET_NEGATE 0x0010
-#define DMV170_MAXPACK_RESET_ASSERT 0x0000
-#define DMV170_EEPROM_READ_WRITE_MASK 0x0020
-#define DMV170_EEPROM_READ 0x0020
-#define DMV170_EEPROM_WRITE 0x0000
-#define DMV170_EEPROM_CLOCK_CTRL_MASK 0x0040
-#define DMV170_EEPROM_CLOCK_ASSERT 0x0040
-#define DMV170_EEPROM_CLOCK_NEGATE 0x0000
-#define DMV170_EEPROM_DATA_MASK 0x0080
-#define DMV170_EEPROM_DATA_HIGH 0x0080
-#define DMV170_EEPROM_DATA_LOW 0x0000
-
-/* Bits 8-10: 68040 Transfer Modifer Codes represent the Transfer
- * Modifier to be used on MAXPack Accesses.
- *
- * Bit 11 : 68040 Transfer Type (TT) 0:TT are both low 1:TT are both high
- */
-
-#define DMV170_USER_LINK0_STATUS_MASK 0x1000
-#define DMV170_USER_LINK0_OPEN 0x1000
-#define DMV170_USER_LINK0_INSTALLED 0x0000
-#define DMV170_LOWER_STATUS_LED_CONTROL_MASK 0x2000
-#define DMV170_LOWER_STATUS_LED_IS_OFF 0x2000
-#define DMV170_LOWER_STATUS_LED_IS_ON 0x0000
-#ifdef DMV176
- /* The following are not available for the DMV171 */
-#define DMV170_RAM_TYPE_MASK 0x4000
-#define DMV170_RAM_TYPE_IS_DRAM 0x4000
-#define DMV170_RAM_TYPE_IS_SRAM 0x0000
-#define DMV170_IACK_VECTOR_AUTOVECTOR_MASK 0x8000
-#define DMV170_IACK_VECTOR_AUTOVECTOR_IS_VECTOR 0x8000
-#define DMV170_IACK_VECTOR_AUTOVECTOR_IS_NOT_VECTOR 0x0000
-#endif
-
-/*
- * The following defines the bits in the Timer Control Register.
- */
-
-#define DMV170_TIMER0_ENABLE_MASK 0x0001
-#define DMV170_TIMER0_IS_ENABLED 0x0001
-#define DMV170_TIMER0_IS_DISABLED 0x0000
-#define DMV170_TIMER1_ENABLE_MASK 0x0002
-#define DMV170_TIMER1_IS_ENABLED 0x0002
-#define DMV170_TIMER1_IS_DISABLED 0x0000
-#define DMV170_TIMER2_ENABLE_MASK 0x0004
-#define DMV170_TIMER2_IS_ENABLED 0x0004
-#define DMV170_TIMER2_IS_DISABLED 0x0000
-#define DMV170_TIMER1_CLOCK_MASK 0x0008
-#define DMV170_TIMER1_CLOCK_AT_TIMER0 0x0008
-#define DMV170_TIMER1_CLOCK_AT_1MHZ 0x0000
-
-#define DMV170_TIMER2_CLOCK_MASK 0x0010
-#define DMV170_TIMER2_CLOCK_AT_TIMER0 0x0010
-#define DMV170_TIMER2_CLOCK_AT_1MHZ 0x0000
-#define DMV170_TIMER0_INTERRUPT_MASK 0x0020
-#define DMV170_TIMER0_INTERRUPT_ENABLE 0x0020
-#define DMV170_TIMER0_INTERRUPT_CLEAR 0x0000
-#define DMV170_TIMER1_INTERRUPT_MASK 0x0040
-#define DMV170_TIMER1_INTERRUPT_ENABLE 0x0040
-#define DMV170_TIMER1_INTERRUPT_CLEAR 0x0000
-#define DMV170_TIMER2_INTERRUPT_MASK 0x0080
-#define DMV170_TIMER2_INTERRUPT_ENABLE 0x0080
-#define DMV170_TIMER2_INTERRUPT_CLEAR 0x0000
-
-/*
- * The Following define the bits for the Card Resource Register.
- */
-
-#define DMV170_DUART_INTERRUPT_MASK 0x0001 /* DUART Interrupt Sense Bit */
-#define DMV170_DUART_INTERRUPT_NEGATE 0x0001
-#define DMV170_DUART_INTERRUPT_ASSERT 0x0000
-#define DMV170_SONIC_INTERRUPT_MASK 0x0002 /* SONIC Interrupt Sense Bit */
-#define DMV170_SONIC_INTERRUPT_NEGATE 0x0002
-#define DMV170_SONIC_INTERRUPT_ASSERT 0x0000
-#define DMV170_SCSI_INTERRUPT_MASK 0x0004 /* SCSI Interrupt Sense Bit */
-#define DMV170_SCSI_INTERRUPT_NEGATE 0x0004
-#define DMV170_SCSI_INTERRUPT_ASSERT 0x0000
-#define DMV170_SCC_INTERRUPT_MASK 0x0008 /* SCC Interrupt Sense Bit */
-#define DMV170_SCC_INTERRUPT_NEGATE 0x0008
-#define DMV170_SCC_INTERRUPT_ASSERT 0x0000
-#define DMV170_SNOOP_ENABLE_MASK 0x0010 /* CPU Snoop Enable Bit */
-#define DMV170_SNOOP_DISABLE 0x0010
-#define DMV170_SNOOP_ENABLE 0x0000
-#define DMV170_SONIC_RESET_MASK 0x0020 /* SONIC RESET Control */
-#define DMV170_SONIC_RESET_CLEAR 0x0020
-#define DMV170_SONIC_RESET_HOLD 0x0000
-#define DMV170_NV64_WE_MASK 0x0040 /* 64-bit Non-Volital Memory */
-#define DMV170_NV64_WRITE_ENABLE 0x0040 /* Write Enable */
-#define DMV170_NV64_WRITE_DISABLE 0x0000
-#define DMV170_BOOT_NV16_MASK 0x0080 /* BOOT Device Type */
-#define DMV170_BOOT_64_BIT 0x0080
-#define DMV170_BOOT_16_BIT 0x0000
-#define DMV170_DUART_INST_MASK 0x0100 /* DUART Sense Bit */
-#define DMV170_DUART_INSTALLED 0x0100
-#define DMV170_DUART_NOT_INSTALLED 0x0000
-#define DMV170_SONIC_INST_MASK 0x0200 /* SONIC Sense Bit */
-#define DMV170_SONIC_INSTALLED 0x0200
-#define DMV170_SONIC_NOT_INSTALLED 0x0000
-#define DMV170_16M_NV64_MASK 0x0400 /* 16 Mb of 64bit Flash Sense */
-#define DMV170_16Mb_FLASH_INSTALLED 0x0400
-#define DMV170_8Mb_FLASH_INSTALLED 0x0000
-#define DMV170_SCC_INST_MASK 0x0800 /* SCC Sense Bit */
-#define DMV170_SCC_INSTALLED 0x0800
-#define DMV170_SCC_NOT_INSTALLED 0x0000
-#define DMV170_RTC_INST_MASK 0x1000 /* RTC Sense Bit */
-#define DMV170_RTC_INSTALLED 0x1000
-#define DMV170_RTC_NOT_INSTALLED 0x0000
-#define DMV170_NV64_INST_MASK 0x2000 /* 64bit Non-Volital Mem Sense*/
-
-#define DMV170_64_BIT_NON_VOLITAL_MEM_INSTALLED 0x2000
-#define DMV170_64_BIT_NON_VOLITAL_MEM_NOT_INSTALLED 0x0000
-
-
-/*
- * DUART Baud Rate Definitions.
- */
-
-#define DMV170_DUART_9621 MC68681_BAUD_RATE_MASK_600 /* close to 9600 */
-
-#define DMV170_RTC_FREQUENCY 0x0000
-
-
-/*
- * CPU General Purpose Interrupt definations (PPC_IRQ_EXTERNAL).
- * Note: For the interrupt level read the lower 3 bits of the
- * Local Control and Status Register.
- */
-
-#define DMV170_IRQ_FIRST ( PPC_IRQ_LAST + 1 )
-
-#define DMV170_LIRQ0 ( DMV170_IRQ_FIRST + 0 )
-#define DMV170_LIRQ1 ( DMV170_IRQ_FIRST + 1 )
-#define DMV170_LIRQ2 ( DMV170_IRQ_FIRST + 2 )
-#define DMV170_LIRQ3 ( DMV170_IRQ_FIRST + 3 )
-#define DMV170_LIRQ4 ( DMV170_IRQ_FIRST + 4 )
-#define DMV170_LIRQ5 ( DMV170_IRQ_FIRST + 5 )
-#define DMV170_L7IACF ( DMV170_IRQ_FIRST + 6 )
-#define DMV170_L7ISYS ( DMV170_IRQ_FIRST + 7 )
-#define DMV170_L7IMNI ( DMV170_IRQ_FIRST + 8 )
-#define DMV170_BIMODE ( DMV170_IRQ_FIRST + 9 )
-
-#define DMV170_DUART_IRQ DMV170_LIRQ5
-#define DMV170_ETHERNET_IRQ DMV170_LIRQ5
-#define DMV170_SCSI_IRQ DMV170_LIRQ5
-#define DMV170_SCC_IRQ DMV170_LIRQ5
-#define DMV170_MEZZANINE_IRQ_0 DMV170_LIRQ4
-#define DMV170_TICK_IRQ DMV170_LIRQ3
-#define DMV170_LOCATION_MON_IRQ DMV170_LIRQ2
-#define DMV170_SCV64_IRQ DMV170_LIRQ1
-#define DMV170_RTC_IRQ DMV170_LIRQ0
-
-#define DMV170_ACFAIL_IRQ DMV170_L7IACF
-#define DMV170_SYSFAIL_IRQ DMV170_L7ISYS
-#define DMV170_WATCHDOG_IRQ DMV170_L7IMNI
-#define DMV170_BI_IRQ DMV170_BIMODE
-#define DMV170_RAM_PARITY_IRQ ( DMV170_IRQ_FIRST + 10)
-#define DMV170_DARF_BUS_ERROR_IRQ ( DMV170_IRQ_FIRST + 11)
-#define DMV170_PERIPHERAL_IRQ ( DMV170_IRQ_FIRST + 12)
-
-#define MAX_BOARD_IRQS DMV170_PERIPHERAL_IRQ
-
-#define SCV64_Is_IRQ0( _status ) (_status&0x01)
-#define SCV64_Is_IRQ1( _status ) (_status&0x02)
-#define SCV64_Is_IRQ2( _status ) (_status&0x04)
-#define SCV64_Is_IRQ3( _status ) (_status&0x08)
-#define SCV64_Is_IRQ4( _status ) (_status&0x10)
-#define SCV64_Is_IRQ5( _status ) (_status&0x20)
-
-
-/*
- * scv64.c
- */
-
-void SCV64_Generate_DUART_Interrupts();
-rtems_unsigned32 SCV64_Get_Interrupt();
-rtems_unsigned32 SCV64_Get_Interrupt_Enable();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_INCLUDE_DMV170_h */
-/* end of include file */
-
diff --git a/c/src/lib/libbsp/powerpc/dmv177/scv64/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/scv64/Makefile.in
deleted file mode 100644
index 14961659b3..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/scv64/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/scv64.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=$(SCV64_PIECES)
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-SCV64_PIECES=scv64
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
-
-
diff --git a/c/src/lib/libbsp/powerpc/dmv177/scv64/scv64.c b/c/src/lib/libbsp/powerpc/dmv177/scv64/scv64.c
deleted file mode 100644
index 850618ad0e..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/scv64/scv64.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/* scv64.c
- *
- * This set of routines control the scv64 chip on the DMV177 board.
- *
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-
-typedef struct {
- /* DARF Registers */
- volatile rtems_unsigned32 DMALAR; /* 0x00 */
- volatile rtems_unsigned32 DMAVAR; /* 0x04 */
- volatile rtems_unsigned32 DMATC; /* 0x08 */
- volatile rtems_unsigned32 DCSR; /* 0x0c */
- volatile rtems_unsigned32 VMEBAR; /* 0x10 */
- volatile rtems_unsigned32 RXDATA; /* 0x14 */
- volatile rtems_unsigned32 RXADDR; /* 0x18 */
- volatile rtems_unsigned32 RXCTL; /* 0x1c */
- volatile rtems_unsigned32 BUSSEL; /* 0x20 */
- volatile rtems_unsigned32 IVECT; /* 0x24 */
- volatile rtems_unsigned32 APBR; /* 0x28 */
- volatile rtems_unsigned32 TXDATA; /* 0x2c */
- volatile rtems_unsigned32 TXADDR; /* 0x30 */
- volatile rtems_unsigned32 TXCTL; /* 0x34 */
- volatile rtems_unsigned32 LMFIFO; /* 0x38 */
- volatile rtems_unsigned32 MODE; /* 0x3c */
- volatile rtems_unsigned32 SA64BAR; /* 0x40 */
- volatile rtems_unsigned32 MA64BAR; /* 0x44 */
- volatile rtems_unsigned32 LAG; /* 0x48 */
- volatile rtems_unsigned32 DMAVTC; /* 0x4c */
-
- /* Reserved */
- volatile rtems_unsigned32 reserved_50_7F[12];
-
- /* ACC Registers */
- volatile rtems_unsigned8 STAT0_pad[3]; /* 0x80 */
- volatile rtems_unsigned8 STAT0;
- volatile rtems_unsigned8 STAT1_pad[3]; /* 0x84 */
- volatile rtems_unsigned8 STAT1;
- volatile rtems_unsigned8 GENCTL_pad[3]; /* 0x88 */
- volatile rtems_unsigned8 GENCTL;
- volatile rtems_unsigned8 VINT_pad[3]; /* 0x8c */
- volatile rtems_unsigned8 VINT;
- volatile rtems_unsigned8 VREQ_pad[3]; /* 0x90 */
- volatile rtems_unsigned8 VREQ;
- volatile rtems_unsigned8 VARB_pad[3]; /* 0x94 */
- volatile rtems_unsigned8 VARB;
- volatile rtems_unsigned8 ID_pad[3]; /* 0x98 */
- volatile rtems_unsigned8 ID;
- volatile rtems_unsigned8 NA_pad[3]; /* 0x9c */
- volatile rtems_unsigned8 NA;
- volatile rtems_unsigned8 _7IS_pad[3]; /* 0xa0 */
- volatile rtems_unsigned8 _7IS;
- volatile rtems_unsigned8 LIS_pad[3]; /* 0xa4 */
- volatile rtems_unsigned8 LIS;
- volatile rtems_unsigned8 UIE_pad[3]; /* 0xa8 */
- volatile rtems_unsigned8 UIE;
- volatile rtems_unsigned8 LIE_pad[3]; /* 0xac */
- volatile rtems_unsigned8 LIE;
- volatile rtems_unsigned8 VIE_pad[3]; /* 0xb0 */
- volatile rtems_unsigned8 VIE;
- volatile rtems_unsigned8 IC10_pad[3]; /* 0xb4 */
- volatile rtems_unsigned8 IC10;
- volatile rtems_unsigned8 IC32_pad[3]; /* 0xb8 */
- volatile rtems_unsigned8 IC32;
- volatile rtems_unsigned8 IC54_pad[3]; /* 0xbc */
- volatile rtems_unsigned8 IC54;
- /* Utility Registers */
- volatile rtems_unsigned32 MISC;
- volatile rtems_unsigned32 delay_line[3];
- volatile rtems_unsigned32 MBOX0;
- volatile rtems_unsigned32 MBOX1;
- volatile rtems_unsigned32 MBOX2;
- volatile rtems_unsigned32 MBOX3;
-} SCV64_Registers;
-
-/*
- * LIE Register
- */
-#define LOCAL_INTERRUPT_ENABLE_0 0x01
-#define LOCAL_INTERRUPT_ENABLE_1 0x02
-#define LOCAL_INTERRUPT_ENABLE_2 0x04
-#define LOCAL_INTERRUPT_ENABLE_3 0x08
-#define LOCAL_INTERRUPT_ENABLE_4 0x10
-#define LOCAL_INTERRUPT_ENABLE_5 0x20
-
-/*
- * IC54 Register
- */
-#define AUTOVECTOR_5 0x80
-
-
-/*
- * Set the registers pointer to the base address of the SCV64
- */
-SCV64_Registers *SCV64 = (void *)DMV170_SCV64_BASE_ADDRESS;
-
-/*PAGE
- *
- * SCV64_Initialize
- *
- * This routine initializes the SCV64.
- */
-void SCV64_Initialize() {
- SCV64->LIE = 0;
-}
-
-/*PAGE
- *
- * SCV64_Generate_DUART_Interrupts
- *
- * This sets the SCV64 to generate duart interrupts for
- * the DMV177 board.
- */
-void SCV64_Generate_DUART_Interrupts() {
-
- rtems_unsigned8 data;
-
- /*
- * Set Local Interrupt 5 enable
- */
- data = SCV64->LIE;
- data |= LOCAL_INTERRUPT_ENABLE_5;
- SCV64->LIE = data;
-
- /*
- * Set Autovector.
- */
- data = SCV64->IC54;
- data |= AUTOVECTOR_5;
- SCV64->IC54 = data;
-}
-
-/*PAGE
- *
- * SCV64_Get_Interrupt
- *
- * This routine returns the SCV64 status register.
- */
-rtems_unsigned32 SCV64_Get_Interrupt()
-{
- rtems_unsigned8 data;
-
- /*
- * Put the LIS data into the lower byte of the result
- */
- data = SCV64->LIS;
-
- return data;
-}
-
-/*PAGE
- *
- * SCV64_Get_Interrupt_Enable
- *
- * This routine returns the interrupt enable mask.
- */
-rtems_unsigned32 SCV64_Get_Interrupt_Enable()
-{
- /*
- * Return the set of interrupts enabled.
- */
- return SCV64->LIE;
-}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/sonic/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/sonic/Makefile.in
deleted file mode 100644
index 35cd5ff209..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/sonic/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/sonic.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=sonic
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \
- -DDIAGNOSTIC -DBOOTP_COMPAT
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.c b/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.c
deleted file mode 100644
index 651025ee71..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.c
+++ /dev/null
@@ -1,1599 +0,0 @@
-void break_when_you_get_here();
-/*
- *******************************************************************
- *******************************************************************
- ** **
- ** RTEMS NETWORK DRIVER FOR NATIONAL DP83932 `SONIC' **
- ** SYSTEMS-ORIENTED NETWORK INTERFACE CONTROLLER **
- ** **
- *******************************************************************
- *******************************************************************
- */
-
-/*
- * $Revision$ $Date$ $Author$
- * $State$
- * $Id$
- */
-
-/*
- * References:
- * 1) DP83932C-20/25/33 MHz SONIC(TM) Systems-Oriented Network Interface
- * Controller data sheet. TL/F/10492, RRD-B30M105, National Semiconductor,
- * 1995.
- *
- * 2) Software Driver Programmer's Guide for the DP83932 SONIC(TM),
- * Application Note 746, Wesley Lee and Mike Lui, TL/F/11140,
- * RRD-B30M75, National Semiconductor, March, 1991.
- *
- * 3) SVME/DMV-171 Single Board Computer Documentation Package, #805905,
- * DY 4 Systems Inc., Kanata, Ontario, September, 1996.
- */
-
-#include <rtems/rtems_bsdnet.h>
-#include "sonic.h"
-
-#include <stdio.h>
-
-#include <errno.h>
-#include <rtems/error.h>
-
-#include <sys/param.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/sockio.h>
-#include <sys/sockio.h>
-
-#include <net/if.h>
-
-#include <netinet/in.h>
-#include <netinet/if_ether.h>
-
-/*
- * Debug levels
- *
- */
-
-#define SONIC_DEBUG_NONE 0x0000
-#define SONIC_DEBUG_ALL 0xFFFF
-#define SONIC_DEBUG_PRINT_REGISTERS 0x0001
-#define SONIC_DEBUG_MEMORY 0x0002
-#define SONIC_DEBUG_MEMORY_ALLOCATE 0x0004
-#define SONIC_DEBUG_FRAGMENTS 0x0008
-#define SONIC_DEBUG_CAM 0x0008
-#define SONIC_DEBUG_DESCRIPTORS 0x0010
-#define SONIC_DEBUG_ERRORS 0x0020
-
-#define SONIC_DEBUG (SONIC_DEBUG_ERRORS)
-
-/* (SONIC_DEBUG_MEMORY|SONIC_DEBUG_DESCRIPTORS) */
-
-/* SONIC_DEBUG_ALL */
-
-
-/*
- * XXX
- */
-
-#include <dmv170.h>
-
-/*
- * Use the top line if you want more symbols.
- */
-
-#define SONIC_STATIC
-/* #define SONIC_STATIC static */
-
-/*
- * Number of devices supported by this driver
- */
-#ifndef NSONIC
-# define NSONIC 1
-#endif
-
-/*
- * Default location of device registers
- */
-#ifndef SONIC_BASE_ADDRESS
-# define SONIC_BASE_ADDRESS 0xF3000000
-# warning "Using default SONIC_BASE_ADDRESS."
-#endif
-
-/*
- * Default interrupt vector
- */
-#ifndef SONIC_VECTOR
-# define SONIC_VECTOR 1
-# warning "Using default SONIC_VECTOR."
-#endif
-
-/*
- * Default device configuration register values
- * Conservative, generic values.
- * DCR:
- * No extended bus mode
- * Unlatched bus retry
- * Programmable outputs unused
- * Asynchronous bus mode
- * User definable pins unused
- * No wait states (access time controlled by DTACK*)
- * 32-bit DMA
- * Empty/Fill DMA mode
- * Maximum Transmit/Receive FIFO
- * DC2:
- * Extended programmable outputs unused
- * Normal HOLD request
- * Packet compress output unused
- * No reject on CAM match
- */
-#define SONIC_DCR \
- (DCR_DW32 | DCR_WAIT0 | DCR_PO0 | DCR_PO1 | DCR_RFT4 | DCR_TFT8)
-#ifndef SONIC_DCR
-# define SONIC_DCR (DCR_DW32 | DCR_TFT28)
-#endif
-#ifndef SONIC_DC2
-# define SONIC_DC2 (0)
-#endif
-
-/*
- * Default sizes of transmit and receive descriptor areas
- */
-#define RDA_COUNT 20
-#define TDA_COUNT 100
-
-/*
- *
- * As suggested by National Application Note 746, make the
- * receive resource area bigger than the receive descriptor area.
- */
-#define RRA_EXTRA_COUNT 0
-
-/*
- * RTEMS event used by interrupt handler to signal daemons.
- */
-#define INTERRUPT_EVENT RTEMS_EVENT_1
-
-/*
- * RTEMS event used to start transmit daemon.
- * This must not be the same as INTERRUPT_EVENT.
- */
-#define START_TRANSMIT_EVENT RTEMS_EVENT_2
-
-/*
- * Largest Ethernet frame.
- */
-#define MAXIMUM_FRAME_SIZE 1518
-
-/*
- * Receive buffer size.
- * Allow for a pointer, plus a full ethernet frame (including Frame
- * Check Sequence) rounded up to a 4-byte boundary.
- */
-#define RBUF_SIZE ((sizeof (void *) + (MAXIMUM_FRAME_SIZE) + 3) & ~3)
-#define RBUF_WC ((((MAXIMUM_FRAME_SIZE) + 3) & ~3) / 2)
-
-/*
- * Macros for manipulating 32-bit pointers as 16-bit fragments
- */
-#define LSW(p) ((rtems_unsigned16)((rtems_unsigned32)(p)))
-#define MSW(p) ((rtems_unsigned16)((rtems_unsigned32)(p) >> 16))
-#define PTR(m,l) ((void*)(((rtems_unsigned16)(m)<<16)|(rtems_unsigned16)(l)))
-
-/*
- * Hardware-specific storage
- */
-struct sonic_softc {
- /*
- * Connection to networking code
- * This entry *must* be the first in the sonic_softc structure.
- */
- struct arpcom arpcom;
-
- /*
- * Default location of device registers
- * ===CACHE===
- * This area must be non-cacheable, guarded.
- */
- void *sonic;
-
- /*
- * Interrupt vector
- */
- rtems_vector_number vector;
-
- /*
- * Indicates configuration
- */
- int acceptBroadcast;
-
- /*
- * Task waiting for interrupts
- */
- rtems_id rxDaemonTid;
- rtems_id txDaemonTid;
-
- /*
- * Receive resource area
- */
- int rdaCount;
- ReceiveResourcePointer_t rsa;
- ReceiveResourcePointer_t rea;
- CamDescriptorPointer_t cdp;
- ReceiveDescriptorPointer_t rda;
- ReceiveDescriptorPointer_t rdp_last;
-
- /*
- * Transmit descriptors
- */
- int tdaCount;
- TransmitDescriptorPointer_t tdaHead; /* Last filled */
- TransmitDescriptorPointer_t tdaTail; /* Next to retire */
- int tdaActiveCount;
-
- /*
- * Statistics
- */
- unsigned long Interrupts;
- unsigned long rxInterrupts;
- unsigned long rxMissed;
- unsigned long rxGiant;
- unsigned long rxNonOctet;
- unsigned long rxBadCRC;
- unsigned long rxCollision;
-
- unsigned long txInterrupts;
- unsigned long txSingleCollision;
- unsigned long txMultipleCollision;
- unsigned long txCollision;
- unsigned long txDeferred;
- unsigned long txUnderrun;
- unsigned long txLateCollision;
- unsigned long txExcessiveCollision;
- unsigned long txExcessiveDeferral;
- unsigned long txLostCarrier;
- unsigned long txRawWait;
-};
-SONIC_STATIC struct sonic_softc sonic_softc[NSONIC];
-
-/*
- ******************************************************************
- * *
- * Support Routines *
- * *
- ******************************************************************
- */
-
-void sonic_write_register(
- void *base,
- unsigned32 regno,
- unsigned32 value
-);
-
-unsigned32 sonic_read_register(
- void *base,
- unsigned32 regno
-);
-
-void sonic_enable_interrupts(
- void *rp,
- unsigned32 mask
-)
-{
- rtems_interrupt_level level;
-
- rtems_interrupt_disable( level );
- sonic_write_register(
- rp,
- SONIC_REG_IMR,
- sonic_read_register(rp, SONIC_REG_IMR) | mask
- );
- rtems_interrupt_enable( level );
-}
-
-/*
- * Allocate non-cacheable memory on a single 64k page.
- * Very simple minded -- just keeps trying till the memory is on a single page.
- */
-SONIC_STATIC void * sonic_allocate(unsigned int nbytes)
-{
- void *p;
- unsigned long a1, a2;
-
- for (;;) {
- /*
- * ===CACHE===
- * Change malloc to malloc_noncacheable_guarded.
- */
- p = malloc( nbytes, M_MBUF, M_NOWAIT );
- memset (p, '\0', nbytes);
- if (p == NULL)
- rtems_panic ("No memory!");
- a1 = (unsigned long)p;
- a2 = a1 + nbytes - 1;
- if ((a1 >> 16) == (a2 >> 16))
- break;
- }
-#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY_ALLOCATE)
- printf( "sonic_allocate %d bytes at %p\n", nbytes, p );
-#endif
- return p;
-}
-
-/*
- * Shut down the interface.
- */
-
-SONIC_STATIC void sonic_stop (struct sonic_softc *sc)
-{
- void *rp = sc->sonic;
- struct ifnet *ifp = &sc->arpcom.ac_if;
-
- ifp->if_flags &= ~IFF_RUNNING;
-
- /*
- * Stop the transmitter and receiver.
- */
- sonic_write_register( rp, SONIC_REG_CR, CR_HTX | CR_RXDIS );
-}
-
-/*
- * Show interface statistics
- */
-SONIC_STATIC void sonic_stats (struct sonic_softc *sc)
-{
- printf (" Total Interrupts:%-8lu", sc->Interrupts);
- printf (" Rx Interrupts:%-8lu", sc->rxInterrupts);
- printf (" Giant:%-8lu", sc->rxGiant);
- printf (" Non-octet:%-8lu\n", sc->rxNonOctet);
- printf (" Bad CRC:%-8lu", sc->rxBadCRC);
- printf (" Collision:%-8lu", sc->rxCollision);
- printf (" Missed:%-8lu\n", sc->rxMissed);
-
- printf ( " Tx Interrupts:%-8lu", sc->txInterrupts);
- printf ( " Deferred:%-8lu", sc->txDeferred);
- printf (" Lost Carrier:%-8lu\n", sc->txLostCarrier);
- printf ( "Single Collisions:%-8lu", sc->txSingleCollision);
- printf ( "Multiple Collisions:%-8lu", sc->txMultipleCollision);
- printf ("Excessive Collisions:%-8lu\n", sc->txExcessiveCollision);
- printf ( " Total Collisions:%-8lu", sc->txCollision);
- printf ( " Late Collision:%-8lu", sc->txLateCollision);
- printf (" Underrun:%-8lu\n", sc->txUnderrun);
- printf ( " Raw output wait:%-8lu\n", sc->txRawWait);
-}
-
-/*
- ******************************************************************
- * *
- * Interrupt Handler *
- * *
- ******************************************************************
- */
-
-SONIC_STATIC rtems_isr sonic_interrupt_handler (rtems_vector_number v)
-{
- struct sonic_softc *sc = sonic_softc;
- void *rp;
-
-#if (NSONIC > 1)
- /*
- * Find the device which requires service
- */
- for (;;) {
- if (sc->vector == v)
- break;
- if (++sc == &sonic[NSONIC])
- return; /* Spurious interrupt? */
- }
-#endif /* NSONIC > 1 */
-
- /*
- * Get pointer to SONIC registers
- */
- rp = sc->sonic;
-
- sc->Interrupts++;
-
- /*
- * Packet received or receive buffer area exceeded?
- */
- if ((sonic_read_register( rp, SONIC_REG_IMR ) & (IMR_PRXEN | IMR_RBAEEN)) &&
- (sonic_read_register( rp, SONIC_REG_ISR ) & (ISR_PKTRX | ISR_RBAE))) {
- sonic_write_register(
- rp,
- SONIC_REG_IMR,
- sonic_read_register( rp, SONIC_REG_IMR) & ~(IMR_PRXEN | IMR_RBAEEN)
- );
- sc->rxInterrupts++;
- rtems_event_send (sc->rxDaemonTid, INTERRUPT_EVENT);
- }
-
- /*
- * Packet started, transmitter done or transmitter error?
- */
- if ((sonic_read_register( rp, SONIC_REG_IMR ) & (IMR_PINTEN | IMR_PTXEN | IMR_TXEREN))
- && (sonic_read_register( rp, SONIC_REG_ISR ) & (ISR_PINT | ISR_TXDN | ISR_TXER))) {
- sonic_write_register(
- rp,
- SONIC_REG_IMR,
- sonic_read_register( rp, SONIC_REG_IMR) &
- ~(IMR_PINTEN | IMR_PTXEN | IMR_TXEREN)
- );
- sc->txInterrupts++;
- rtems_event_send (sc->txDaemonTid, INTERRUPT_EVENT);
- }
-}
-
-/*
- ******************************************************************
- * *
- * Transmitter Routines *
- * *
- ******************************************************************
- */
-
-/*
- * Soak up transmit descriptors that have been sent.
- */
-
-SONIC_STATIC void sonic_retire_tda (struct sonic_softc *sc)
-{
- rtems_unsigned16 status;
- unsigned int collisions;
- struct mbuf *m, *n;
-
- /*
- * Repeat for all completed transmit descriptors.
- */
- while ((sc->tdaActiveCount != 0)
- && ((status = sc->tdaTail->status) != 0)) {
-
-#if (SONIC_DEBUG & SONIC_DEBUG_DESCRIPTORS)
- printf( "retire TDA %p (0x%04x)\n", sc->tdaTail, status );
-#endif
-
-#if (SONIC_DEBUG & SONIC_DEBUG_ERRORS)
- if ( status != 0x0001 )
- printf( "ERROR: retire TDA %p (0x%04x)\n", sc->tdaTail, status );
-#endif
-
- /*
- * Check for errors which stop the transmitter.
- */
- if (status & (TDA_STATUS_EXD |
- TDA_STATUS_EXC |
- TDA_STATUS_FU |
- TDA_STATUS_BCM)) {
- /*
- * Restart the transmitter if there are
- * packets waiting to go.
- */
- rtems_unsigned16 link;
- link = *(sc->tdaTail->linkp);
-
- if ((link & TDA_LINK_EOL) == 0) {
- void *rp = sc->sonic;
-
- sonic_write_register( rp, SONIC_REG_CTDA, link );
- sonic_write_register( rp, SONIC_REG_CR, CR_TXP );
- }
- }
-
- /*
- * Update network statistics
- */
- collisions = (status & TDA_STATUS_COLLISION_MASK) >> TDA_STATUS_COLLISION_SHIFT;
- if (collisions) {
- if (collisions == 1)
- sc->txSingleCollision++;
- else
- sc->txMultipleCollision++;
- sc->txCollision += collisions;
- }
- if (status & TDA_STATUS_EXC)
- sc->txExcessiveCollision++;
- if (status & TDA_STATUS_OWC)
- sc->txLateCollision++;
- if (status & TDA_STATUS_EXD)
- sc->txExcessiveDeferral++;
- if (status & TDA_STATUS_DEF)
- sc->txDeferred++;
- if (status & TDA_STATUS_FU)
- sc->txUnderrun++;
- if (status & TDA_STATUS_CRSL)
- sc->txLostCarrier++;
-
- /*
- * Free the packet and reset a couple of fields
- */
- sc->tdaActiveCount--;
- m = (struct mbuf *)&sc->tdaTail->mbufp;
- MFREE(m, n);
-
- sc->tdaTail->frag[0].frag_link = LSW(sc->tdaTail->link_pad);
- sc->tdaTail->frag_count = 0;
-
- /*
- * Move to the next transmit descriptor
- */
- sc->tdaTail = sc->tdaTail->next;
-#if (SONIC_DEBUG & SONIC_DEBUG_DESCRIPTORS)
- printf( "next TDA %p\n", sc->tdaTail );
-#endif
- }
-}
-
-/*
- * Send packet
- */
-SONIC_STATIC void sonic_sendpacket (struct ifnet *ifp, struct mbuf *m)
-{
- struct sonic_softc *sc = ifp->if_softc;
- void *rp = sc->sonic;
- struct mbuf *l = NULL;
- TransmitDescriptorPointer_t tdp;
- volatile struct TransmitDescriptorFragLink *fp;
- unsigned int packetSize;
- int i;
- static char padBuf[64];
-
- /*
- * Free up transmit descriptors.
- */
- sonic_retire_tda (sc);
-
- /*
- * Wait for transmit descriptor to become available.
- */
- if (sc->tdaActiveCount == sc->tdaCount) {
-#if (SONIC_DEBUG & SONIC_DEBUG_FRAGMENTS)
- puts( "Wait for more TDAs" );
-#endif
- /*
- * Clear old events.
- */
- sonic_write_register( rp, SONIC_REG_ISR, ISR_PINT | ISR_TXDN | ISR_TXER );
-
- /*
- * Wait for transmit descriptor to become available.
- * Note that the transmit descriptors are checked
- * *before* * entering the wait loop -- this catches
- * the possibility that a transmit descriptor became
- * available between the `if' the started this block,
- * and the clearing of the interrupt status register.
- */
- sonic_retire_tda (sc);
- while (sc->tdaActiveCount == sc->tdaCount) {
- rtems_event_set events;
- /*
- * Enable transmitter interrupts.
- */
- sonic_enable_interrupts( rp, (IMR_PINTEN | IMR_PTXEN | IMR_TXEREN) );
-
- /*
- * Wait for interrupt
- */
- rtems_bsdnet_event_receive (INTERRUPT_EVENT,
- RTEMS_WAIT|RTEMS_EVENT_ANY,
- RTEMS_NO_TIMEOUT,
- &events);
- sonic_write_register( rp, SONIC_REG_ISR, ISR_PINT | ISR_TXDN | ISR_TXER );
- sonic_retire_tda (sc);
- }
- }
-
- /*
- * Fill in the transmit descriptor fragment descriptors.
- * ===CACHE===
- * If data cache is operating in write-back mode, flush cached
- * data to memory.
- */
- tdp = sc->tdaHead->next;
- tdp->mbufp = m;
- packetSize = 0;
- fp = tdp->frag;
- for (i = 0 ; i < MAXIMUM_FRAGS_PER_DESCRIPTOR ; i++, fp++) {
- /*
- * Throw away empty mbufs
- */
- if (m->m_len) {
- void *p = mtod (m, void *);
- fp->frag_lsw = LSW(p);
- fp->frag_msw = MSW(p);
- fp->frag_size = m->m_len;
- packetSize += m->m_len;
- l = m;
- m = m->m_next;
-#if (SONIC_DEBUG & SONIC_DEBUG_FRAGMENTS)
- printf( "fp %p 0x%04x%04x %d\n",
- fp, fp->frag_msw, fp->frag_lsw, fp->frag_size );
-#endif
- }
- else {
- struct mbuf *n;
- MFREE (m, n);
- m = n;
- if (l != NULL)
- l->m_next = m;
- }
- /*
- * Break out of the loop if this mbuf is the last in the frame.
- */
- if (m == NULL)
- break;
- }
-
- /*
- * Pad short packets.
- */
- if ((packetSize < 64) && (i < MAXIMUM_FRAGS_PER_DESCRIPTOR)) {
- int padSize = 64 - packetSize;
- fp++;
- fp->frag_lsw = LSW(padBuf);
- fp->frag_msw = MSW(padBuf);
- fp->frag_size = padSize;
-#if (SONIC_DEBUG & SONIC_DEBUG_FRAGMENTS)
- printf( "PAD fp %p 0x%04x%04x %d\n",
- fp, fp->frag_msw, fp->frag_lsw, fp->frag_size );
-#endif
- packetSize += padSize;
- i++;
- }
-
- /*
- * Fill Transmit Descriptor
- */
- tdp->pkt_size = packetSize;
- tdp->frag_count = i + 1;
- tdp->status = 0;
-
- /*
- * Chain onto list and start transmission.
- */
-
- tdp->linkp = &(fp+1)->frag_link;
- *tdp->linkp = LSW(tdp->next) | TDA_LINK_EOL;
- if ( sc->tdaHead->frag_count )
- *sc->tdaHead->linkp &= ~TDA_LINK_EOL;
- sc->tdaActiveCount++;
- sc->tdaHead = tdp;
-
- sonic_enable_interrupts( rp, (IMR_PINTEN | IMR_PTXEN | IMR_TXEREN) );
- sonic_write_register( rp, SONIC_REG_CR, CR_TXP );
-}
-
-/*
- * Driver transmit daemon
- */
-SONIC_STATIC void sonic_txDaemon (void *arg)
-{
- struct sonic_softc *sc = (struct sonic_softc *)arg;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- struct mbuf *m;
- rtems_event_set events;
-
- for (;;) {
- /*
- * Wait for packet
- */
- rtems_bsdnet_event_receive (
- START_TRANSMIT_EVENT,
- RTEMS_EVENT_ANY | RTEMS_WAIT,
- RTEMS_NO_TIMEOUT,
- &events
- );
-
- /*
- * Send packets till queue is empty
- */
- for (;;) {
- /*
- * Get the next mbuf chain to transmit.
- */
- IF_DEQUEUE(&ifp->if_snd, m);
- if (!m)
- break;
- sonic_sendpacket (ifp, m);
- }
- ifp->if_flags &= ~IFF_OACTIVE;
- }
-}
-
-/*
- ******************************************************************
- * *
- * Receiver Routines *
- * *
- ******************************************************************
- */
-
-/*
- * Wait for SONIC to hand over a Receive Descriptor.
- */
-
-SONIC_STATIC void sonic_rda_wait(
- struct sonic_softc *sc,
- ReceiveDescriptorPointer_t rdp
-)
-{
- int i;
- void *rp = sc->sonic;
- rtems_event_set events;
-
- /*
- * Wait for Receive Descriptor.
- * The order of the tests is very important.
- * The RDA is checked after RBAE is detected. This ensures that
- * the driver processes all RDA entries before reusing the RRA
- * entry holding the giant packet.
- * The event wait is done after the RDA and RBAE checks. This
- * catches the possibility that a Receive Descriptor became ready
- * between the call to this function and the clearing of the
- * interrupt status register bit.
- */
- for (;;) {
- /*
- * Has a giant packet arrived?
- * The National DP83932C data sheet is very vague on what
- * happens under this condition. The description of the
- * Interrupt Status Register (Section 4.3.6) states,
- * ``Reception is aborted and the SONIC fetches the next
- * available resource descriptors in the RRA. The buffer
- * space is not re-used and an RDA is not setup for the
- * truncated packet.''
- * I take ``Reception is aborted'' to mean that the RXEN
- * bit in the Command Register is cleared and must be set
- * by the driver to begin reception again.
- * Unfortunately, an alternative interpretation could be
- * that only reception of the current packet is aborted.
- * This would be more difficult to recover from....
- */
- if (sonic_read_register( rp, SONIC_REG_ISR ) & ISR_RBAE) {
-
-#if (SONIC_DEBUG & SONIC_DEBUG_ERRORS)
- printf( "ERROR: looks like a giant packet -- RBAE\n" );
-#endif
-
- /*
- * One more check to soak up any Receive Descriptors
- * that may already have been handed back to the driver.
- */
- if (rdp->in_use == RDA_IN_USE) {
-#if (SONIC_DEBUG & SONIC_DEBUG_ERRORS)
- printf( "ERROR: nope just an RBAE\n" );
-#endif
- break;
- }
-
- /*
- * Check my interpretation of the SONIC manual.
- */
- if (sonic_read_register( rp, SONIC_REG_CR ) & CR_RXEN)
- rtems_panic ("SONIC RBAE/RXEN");
-
- /*
- * Update statistics
- */
- sc->rxGiant++;
-
- /*
- * Reuse receive buffer.
- * Again, the manual is subject to interpretation. The
- * RRP register is described as, `the lower address of
- * the next descriptor the SONIC will read.''
- * Since, acording to the ISR/RBAE notes, the SONIC has
- * ``fetched the next available resource descriptor in
- * the RRA'', I interpret this to mean that that the
- * driver has to move the RRP back *two* entries to
- * reuse the receive buffer holding the giant packet.
- */
- for (i = 0 ; i < 2 ; i++) {
- if (sonic_read_register( rp, SONIC_REG_RRP ) ==
- sonic_read_register( rp, SONIC_REG_RSA ))
- sonic_write_register(
- rp,
- SONIC_REG_RRP,
- sonic_read_register( rp, SONIC_REG_REA )
- );
- sonic_write_register(
- rp,
- SONIC_REG_RRP,
- sonic_read_register(rp, SONIC_REG_RRP) - sizeof(ReceiveResource_t)
- );
- }
-
- /*
- * Restart reception
- */
- sonic_write_register( rp, SONIC_REG_ISR, ISR_RBAE );
- sonic_write_register( rp, SONIC_REG_CR, CR_RXEN );
- }
-
- /*
- * Clear old packet-received events.
- */
- sonic_write_register( rp, SONIC_REG_ISR, ISR_PKTRX );
-
- /*
- * Has Receive Descriptor become available?
- */
- if (rdp->in_use == RDA_IN_USE)
- break;
-
- /*
- * Enable interrupts.
- */
- sonic_enable_interrupts( rp, (IMR_PRXEN | IMR_RBAEEN) );
-
- /*
- * Wait for interrupt.
- */
- rtems_bsdnet_event_receive(
- INTERRUPT_EVENT,
- RTEMS_WAIT|RTEMS_EVENT_ANY,
- RTEMS_NO_TIMEOUT,
- &events
- );
- }
-#if (SONIC_DEBUG & SONIC_DEBUG_DESCRIPTORS)
- printf( "RDA %p\n", rdp );
-#endif
-
-#if (SONIC_DEBUG & SONIC_DEBUG_ERRORS)
- if (rdp->status & 0x000E)
- printf( "ERROR: RDA %p (0x%04x)\n", rdp, rdp->status );
-#endif
-
-}
-
-/*
- * SONIC reader task
- */
-SONIC_STATIC void sonic_rxDaemon (void *arg)
-{
- struct sonic_softc *sc = (struct sonic_softc *)arg;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- void *rp = sc->sonic;
- struct mbuf *m;
- rtems_unsigned16 status;
- ReceiveDescriptorPointer_t rdp;
- ReceiveResourcePointer_t rwp, rea;
- rtems_unsigned16 newMissedTally, oldMissedTally;
-
- rwp = sc->rsa;
- rea = sc->rea;
- rdp = sc->rda;
-
- /*
- * Start the receiver
- */
- oldMissedTally = sonic_read_register( rp, SONIC_REG_MPT );
- sonic_write_register( rp, SONIC_REG_CR, CR_RRRA );
- sonic_write_register( rp, SONIC_REG_CR, CR_RXEN );
-
- /*
- * Input packet handling loop
- */
- for (;;) {
- /*
- * Wait till SONIC supplies a Receive Descriptor.
- */
- if (rdp->in_use == RDA_FREE) {
- sonic_rda_wait (sc, rdp);
- }
-
-#if (SONIC_DEBUG & SONIC_DEBUG_DESCRIPTORS)
- printf( "Incoming packet %p status=0x%04x\n", rdp, rdp->status );
-#endif
-
- /*
- * Check that packet is valid
- */
- status = rdp->status;
- if (status & RDA_STATUS_PRX) {
- struct mbuf **mp;
- struct ether_header *eh;
- void *p;
-
- /*
- * Get the mbuf pointer
- */
- p = PTR(rdp->pkt_msw, rdp->pkt_lsw);
- mp = (struct mbuf **)p - 1;
- m = *mp;
-
- /*
- * Pass the packet up the chain.
- * The mbuf count is reduced to remove
- * the frame check sequence at the end
- * of the packet.
- * ===CACHE===
- * Invalidate cache entries for this memory.
- */
- m->m_len = m->m_pkthdr.len = rdp->byte_count -
- sizeof(rtems_unsigned32) -
- sizeof(struct ether_header);
- eh = mtod (m, struct ether_header *);
- m->m_data += sizeof(struct ether_header);
- ether_input (ifp, eh, m);
-
- /*
- * Sanity check that Receive Resource Area is
- * still in sync with Receive Descriptor Area
- * The buffer reported in the Receive Descriptor
- * should be the same as the buffer in the Receive
- * Resource we are about to reuse.
- */
-/* XXX figure out whether this is valid or not */
-#if 0
- if ((LSW(p) != rwp->buff_ptr_lsw)
- || (MSW(p) != rwp->buff_ptr_msw))
- rtems_panic ("SONIC RDA/RRA");
-#endif
-
- /*
- * Allocate a new mbuf.
- */
- MGETHDR (m, M_WAIT, MT_DATA);
- MCLGET (m, M_WAIT);
- m->m_pkthdr.rcvif = ifp;
- mp = mtod (m, struct mbuf **);
- m->m_data += sizeof *mp;
- *mp = m;
- p = mtod (m, void *);
-
- /*
- * Reuse Receive Resource.
- */
- rwp->buff_ptr_lsw = LSW(p);
- rwp->buff_ptr_msw = MSW(p);
- rwp++;
- if (rwp == rea) {
-#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY)
- printf( "Wrapping RWP from %p to %p\n", rwp, sc->rsa );
-#endif
- rwp = sc->rsa;
- }
- sonic_write_register( rp, SONIC_REG_RWP , LSW(rwp) );
-
- /*
- * Tell the SONIC to reread the RRA.
- */
- if (sonic_read_register( rp, SONIC_REG_ISR ) & ISR_RBE)
- sonic_write_register( rp, SONIC_REG_ISR, ISR_RBE );
- }
- else {
- if (status & RDA_STATUS_COL)
- sc->rxCollision++;
- if (status & RDA_STATUS_FAER)
- sc->rxNonOctet++;
- else if (status & RDA_STATUS_CRCR)
- sc->rxBadCRC++;
- }
-
- /*
- * Count missed packets
- */
- newMissedTally = sonic_read_register( rp, SONIC_REG_MPT );
- if (newMissedTally != oldMissedTally) {
- sc->rxMissed += (newMissedTally - oldMissedTally) & 0xFFFF;
- newMissedTally = oldMissedTally;
- }
-
- /*
- * Move to next receive descriptor
- */
- rdp->in_use = RDA_FREE;
- rdp = rdp->next;
- rdp->link &= ~RDA_LINK_EOL;
- }
-}
-
-/*
- ******************************************************************
- * *
- * Initialization Routines *
- * *
- ******************************************************************
- */
-
-/*
- * Initialize the SONIC hardware
- */
-SONIC_STATIC void sonic_initialize_hardware(struct sonic_softc *sc)
-{
- void *rp = sc->sonic;
- int i;
- unsigned char *hwaddr;
- rtems_isr_entry old_handler;
- TransmitDescriptorPointer_t tdp;
- ReceiveDescriptorPointer_t ordp, rdp;
- ReceiveResourcePointer_t rwp;
- struct mbuf *m;
- void *p;
- CamDescriptorPointer_t cdp;
-
- /*
- * The Revision B SONIC has a horrible bug known as the "Zero
- * Length Packet bug". The initial board used to develop this
- * driver had a newer revision of the SONIC so there was no reason
- * to check for this. If you have the Revision B SONIC chip, then
- * you need to add some code to the RX path to handle this weirdness.
- */
-
- if ( sonic_read_register( rp, SONIC_REG_SR ) < SONIC_REVISION_C ) {
- rtems_fatal_error_occurred( 0x0BADF00D ); /* don't eat this part :) */
- }
-
- /*
- * Set up circular linked list in Transmit Descriptor Area.
- * Use the PINT bit in the transmit configuration field to
- * request an interrupt on every other transmitted packet.
- *
- * NOTE: sonic_allocate() zeroes all of the memory allocated.
- */
-
- sc->tdaActiveCount = 0;
- sc->tdaTail = sonic_allocate(sc->tdaCount * sizeof *tdp);
-#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY)
- printf( "tdaTail = %p\n", sc->tdaTail );
-#endif
- tdp = sc->tdaTail;
- for (i = 0 ; i < sc->tdaCount ; i++) {
- /*
- * status, pkt_config, pkt_size, and all fragment fields
- * are set to zero by sonic_allocate.
- */
-
-/* XXX not used by the BSD drivers
- if (i & 1)
- tdp->pkt_config = TDA_CONFIG_PINT;
-*/
-
- tdp->frag_count = 0;
- tdp->frag[0].frag_link = LSW(tdp + 1);
- tdp->link_pad = LSW(tdp + 1) | TDA_LINK_EOL;
- tdp->linkp = &((tdp + 1)->frag[0].frag_link);
- tdp->next = (TransmitDescriptor_t *)(tdp + 1);
- tdp++;
- }
- tdp--;
- sc->tdaHead = tdp;
- tdp->link_pad = LSW(sc->tdaTail) | TDA_LINK_EOL;
- tdp->next = (TransmitDescriptor_t *)sc->tdaTail;
- tdp->linkp = &sc->tdaTail->frag[0].frag_link;
-
- /*
- * Set up circular linked list in Receive Descriptor Area.
- * Leaves sc->rda pointing at the `beginning' of the list.
- *
- * NOTE: The RDA and CDP must have the same MSW for their addresses.
- */
-
- sc->rda = sonic_allocate(
- (sc->rdaCount * sizeof(ReceiveDescriptor_t)) +
- sizeof(CamDescriptor_t) );
- sc->cdp = (CamDescriptorPointer_t) ((unsigned char *)sc->rda +
- (sc->rdaCount * sizeof(ReceiveDescriptor_t)));
-#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY)
- printf( "rda area = %p\n", sc->rda );
- printf( "cdp area = %p\n", sc->cdp );
-#endif
-
- ordp = rdp = sc->rda;
- for (i = 0 ; i < sc->rdaCount ; i++) {
- /*
- * status, byte_count, pkt_ptr0, pkt_ptr1, and seq_no are set
- * to zero by sonic_allocate.
- */
- rdp->link = LSW(rdp + 1);
- rdp->in_use = RDA_FREE;
- rdp->next = (ReceiveDescriptor_t *)(rdp + 1);
- ordp = rdp;
- rdp++;
- }
- /*
- * Link the last desriptor to the 1st one and mark it as the end
- * of the list.
- */
- ordp->next = sc->rda;
- ordp->link = LSW(sc->rda) | RDA_LINK_EOL;
- sc->rdp_last = rdp;
-
- /*
- * Allocate the receive resource area.
- * In accordance with National Application Note 746, make the
- * receive resource area bigger than the receive descriptor area.
- * This has the useful side effect of making the receive resource
- * area big enough to hold the CAM descriptor area.
- */
-
- sc->rsa = sonic_allocate((sc->rdaCount + RRA_EXTRA_COUNT) * sizeof *sc->rsa);
-#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY)
- printf( "rsa area = %p\n", sc->rsa );
-#endif
-
- /*
- * Set up list in Receive Resource Area.
- * Allocate space for incoming packets.
- */
-
- rwp = sc->rsa;
- for (i = 0 ; i < (sc->rdaCount + RRA_EXTRA_COUNT) ; i++, rwp++) {
- struct mbuf **mp;
-
- /*
- * Allocate memory for buffer.
- * Place a pointer to the mbuf at the beginning of the buffer
- * so we can find the mbuf when the SONIC returns the buffer
- * to the driver.
- */
-
- MGETHDR (m, M_WAIT, MT_DATA);
- MCLGET (m, M_WAIT);
- m->m_pkthdr.rcvif = &sc->arpcom.ac_if;
- mp = mtod (m, struct mbuf **);
-
- m->m_data += sizeof *mp;
- *mp = m;
- p = mtod (m, void *);
-
- /*
- * Set up RRA entry
- */
- rwp->buff_ptr_lsw = LSW(p);
- rwp->buff_ptr_msw = MSW(p);
- rwp->buff_wc_lsw = RBUF_WC;
- rwp->buff_wc_msw = 0;
- }
- sc->rea = rwp;
-#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY)
- printf( "rea area = %p\n", sc->rea );
-#endif
-
-
- /*
- * Issue a software reset.
- */
- sonic_write_register( rp, SONIC_REG_CR, CR_RST | CR_STP | CR_RXDIS | CR_HTX );
-
- /*
- * Set up data configuration registers.
- */
- sonic_write_register( rp, SONIC_REG_DCR, SONIC_DCR );
- sonic_write_register( rp, SONIC_REG_DCR2, SONIC_DC2 );
-
- sonic_write_register( rp, SONIC_REG_CR, CR_STP | CR_RXDIS | CR_HTX );
-
- /*
- * Mask all interrupts
- */
- sonic_write_register( rp, SONIC_REG_IMR, 0x3fff );
-
- /*
- * Clear outstanding interrupts.
- */
- sonic_write_register( rp, SONIC_REG_ISR, 0x7FFF );
-
- /*
- * Clear the tally counters
- */
-
- sonic_write_register( rp, SONIC_REG_CRCT, 0xFFFF );
- sonic_write_register( rp, SONIC_REG_FAET, 0xFFFF );
- sonic_write_register( rp, SONIC_REG_MPT, 0xFFFF );
- sonic_write_register( rp, SONIC_REG_RSC, 0 );
-
- /*
- * Set the Receiver mode
- *
- * Enable/disable reception of broadcast packets
- */
-
- if (sc->acceptBroadcast)
- sonic_write_register( rp, SONIC_REG_RCR, RCR_BRD );
- else
- sonic_write_register( rp, SONIC_REG_RCR, 0 );
-
- /*
- * Set up Resource Area pointers
- */
-
- sonic_write_register( rp, SONIC_REG_URRA, MSW(sc->rsa) );
- sonic_write_register( rp, SONIC_REG_RSA, LSW(sc->rsa) );
-
- sonic_write_register( rp, SONIC_REG_REA, LSW(sc->rea) );
-
- sonic_write_register( rp, SONIC_REG_RRP, LSW(sc->rsa) );
- sonic_write_register( rp, SONIC_REG_RWP, LSW(sc->rsa) ); /* XXX was rea */
-
- sonic_write_register( rp, SONIC_REG_URDA, MSW(sc->rda) );
- sonic_write_register( rp, SONIC_REG_CRDA, LSW(sc->rda) );
-
- sonic_write_register( rp, SONIC_REG_UTDA, MSW(sc->tdaTail) );
- sonic_write_register( rp, SONIC_REG_CTDA, LSW(sc->tdaTail) );
-
- /*
- * Set End Of Buffer Count register to the value recommended
- * in Note 1 of Section 3.4.4.4 of the SONIC data sheet.
- */
-
- sonic_write_register( rp, SONIC_REG_EOBC, RBUF_WC - 2 );
-
- /*
- * Issue the load RRA command
- */
-
- sonic_write_register( rp, SONIC_REG_CR, CR_RRRA );
- while (sonic_read_register( rp, SONIC_REG_CR ) & CR_RRRA)
- continue;
-
- /*
- * Remove device reset
- */
-
- sonic_write_register( rp, SONIC_REG_CR, 0 );
-
- /*
- * Set up the SONIC CAM with our hardware address.
- */
-
- hwaddr = sc->arpcom.ac_enaddr;
- cdp = sc->cdp;
-
-#if (SONIC_DEBUG & SONIC_DEBUG_CAM)
- printf( "hwaddr: %2x:%2x:%2x:%2x:%2x:%2x\n",
- hwaddr[0], hwaddr[1], hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5] );
-#endif
-
- cdp->cep = 0; /* Fill first and only entry in CAM */
- cdp->cap0 = hwaddr[1] << 8 | hwaddr[0];
- cdp->cap1 = hwaddr[3] << 8 | hwaddr[2];
- cdp->cap2 = hwaddr[5] << 8 | hwaddr[4];
- cdp->ce = 0x0001; /* Enable first entry in CAM */
-
- sonic_write_register( rp, SONIC_REG_CDC, 1 ); /* 1 entry in CDA */
- sonic_write_register( rp, SONIC_REG_CDP, LSW(cdp) );
- sonic_write_register( rp, SONIC_REG_CR, CR_LCAM ); /* Load the CAM */
-
- while (sonic_read_register( rp, SONIC_REG_CR ) & CR_LCAM)
- continue;
-
- /*
- * Verify that CAM was properly loaded.
- */
-
- sonic_write_register( rp, SONIC_REG_CR, CR_RST | CR_STP | CR_RXDIS | CR_HTX );
-
-#if (SONIC_DEBUG & SONIC_DEBUG_CAM)
- sonic_write_register( rp, SONIC_REG_CEP, 0 ); /* Select first entry in CAM */
- printf ("Loaded Ethernet address into SONIC CAM.\n"
- " Wrote %04x%04x%04x - %#x\n"
- " Read %04x%04x%04x - %#x\n",
- cdp->cap2, cdp->cap1, cdp->cap0, cdp->ce,
- sonic_read_register( rp, SONIC_REG_CAP2 ),
- sonic_read_register( rp, SONIC_REG_CAP1 ),
- sonic_read_register( rp, SONIC_REG_CAP0 ),
- sonic_read_register( rp, SONIC_REG_CE ));
-#endif
-
- sonic_write_register( rp, SONIC_REG_CEP, 0 ); /* Select first entry in CAM */
- if ((sonic_read_register( rp, SONIC_REG_CAP2 ) != cdp->cap2)
- || (sonic_read_register( rp, SONIC_REG_CAP1 ) != cdp->cap1)
- || (sonic_read_register( rp, SONIC_REG_CAP0 ) != cdp->cap0)
- || (sonic_read_register( rp, SONIC_REG_CE ) != cdp->ce)) {
- printf ("Failed to load Ethernet address into SONIC CAM.\n"
- " Wrote %04x%04x%04x - %#x\n"
- " Read %04x%04x%04x - %#x\n",
- cdp->cap2, cdp->cap1, cdp->cap0, cdp->ce,
- sonic_read_register( rp, SONIC_REG_CAP2 ),
- sonic_read_register( rp, SONIC_REG_CAP1 ),
- sonic_read_register( rp, SONIC_REG_CAP0 ),
- sonic_read_register( rp, SONIC_REG_CE ));
- rtems_panic ("SONIC LCAM");
- }
-
- sonic_write_register(rp, SONIC_REG_CR, CR_TXP | CR_RXEN | CR_STP);
-
- /*
- * Attach SONIC interrupt handler
- */
- sonic_write_register( rp, SONIC_REG_IMR, 0 );
- old_handler = set_vector(sonic_interrupt_handler, sc->vector, 0);
-
- /*
- * Remainder of hardware initialization is
- * done by the receive and transmit daemons.
- */
-}
-
-/*
- * Send packet (caller provides header).
- */
-
-SONIC_STATIC void sonic_start(struct ifnet *ifp)
-{
- struct sonic_softc *sc = ifp->if_softc;
-
- rtems_event_send(sc->txDaemonTid, START_TRANSMIT_EVENT);
- ifp->if_flags |= IFF_OACTIVE;
-}
-
-/*
- * Initialize and start the device
- */
-
-SONIC_STATIC void sonic_init (void *arg)
-{
- struct sonic_softc *sc = arg;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- void *rp = sc->sonic;
- int rcr;
-
- if (sc->txDaemonTid == 0) {
-
- /*
- * Set up SONIC hardware
- */
- sonic_initialize_hardware (sc);
-
- /*
- * Start driver tasks
- */
- sc->txDaemonTid = rtems_bsdnet_newproc ("SNtx", 4096, sonic_txDaemon, sc);
- sc->rxDaemonTid = rtems_bsdnet_newproc ("SNrx", 4096, sonic_rxDaemon, sc);
- }
-
- /*
- * Set flags appropriately
- */
- rcr = sonic_read_register( rp, SONIC_REG_RCR );
- if (ifp->if_flags & IFF_PROMISC)
- rcr |= RCR_PRO;
- else
- rcr &= ~RCR_PRO;
- sonic_write_register( rp, SONIC_REG_RCR, rcr);
-
- /*
- * Tell the world that we're running.
- */
- ifp->if_flags |= IFF_RUNNING;
-
- /*
- * Enable receiver and transmitter
- */
- sonic_write_register(rp, SONIC_REG_CR, CR_TXP | CR_RXEN);
-}
-
-/*
- * Driver ioctl handler
- */
-static int
-sonic_ioctl (struct ifnet *ifp, int command, caddr_t data)
-{
- struct sonic_softc *sc = ifp->if_softc;
- int error = 0;
-
- switch (command) {
- case SIOCGIFADDR:
- case SIOCSIFADDR:
- ether_ioctl (ifp, command, data);
- break;
-
- case SIOCSIFFLAGS:
- switch (ifp->if_flags & (IFF_UP | IFF_RUNNING)) {
- case IFF_RUNNING:
- sonic_stop (sc);
- break;
-
- case IFF_UP:
- sonic_init (sc);
- break;
-
- case IFF_UP | IFF_RUNNING:
- sonic_stop (sc);
- sonic_init (sc);
- break;
-
- default:
- break;
- }
- break;
-
- case SIO_RTEMS_SHOW_STATS:
- sonic_stats (sc);
- break;
-
- /*
- * FIXME: All sorts of multicast commands need to be added here!
- */
- default:
- error = EINVAL;
- break;
- }
- return error;
-}
-
-/*
- * Attach an SONIC driver to the system
- * This is the only `extern' function in the driver.
- */
-int
-rtems_sonic_driver_attach (struct rtems_bsdnet_ifconfig *config)
-{
- struct sonic_softc *sc;
- struct ifnet *ifp;
- int mtu;
- int i;
-
- /*
- * Find an unused entry
- */
- i = 0;
- sc = sonic_softc;
- for (;;) {
- if (sc == &sonic_softc[NSONIC]) {
- printf ("No more SONIC devices.\n");
- return 0;
- }
- ifp = &sc->arpcom.ac_if;
- if (ifp->if_softc == NULL)
- break;
- sc++;
- i++;
- }
-
- /*
- * zero out the control structure
- */
-
- memset( sc, 0, sizeof(*sc) );
-
-
- /*
- * Process options
- */
- if (config->hardware_address) {
- memcpy (sc->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN);
- }
- else {
- memset (sc->arpcom.ac_enaddr, 0x08, ETHER_ADDR_LEN);
- }
- if (config->mtu)
- mtu = config->mtu;
- else
- mtu = ETHERMTU;
- if (config->rbuf_count)
- sc->rdaCount = config->rbuf_count;
- else
- sc->rdaCount = RDA_COUNT;
- if (config->xbuf_count)
- sc->tdaCount = config->xbuf_count;
- else
- sc->tdaCount = TDA_COUNT;
- sc->acceptBroadcast = !config->ignore_broadcast;
-
- /*
- * Set up network interface values
- */
- ifp->if_softc = sc;
- ifp->if_unit = i + 1;
- ifp->if_name = "sonic";
- ifp->if_mtu = mtu;
- ifp->if_init = sonic_init;
- ifp->if_ioctl = sonic_ioctl;
- ifp->if_start = sonic_start;
- ifp->if_output = ether_output;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX;
- if (ifp->if_snd.ifq_maxlen == 0)
- ifp->if_snd.ifq_maxlen = ifqmaxlen;
-
- /*
- * Attach the interface
- */
- if_attach (ifp);
- ether_ifattach (ifp);
- return 1;
-}
-
-#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS)
-#include <stdio.h>
-
-char SONIC_Reg_name[64][6]= {
- "CR", /* 0x00 */
- "DCR", /* 0x01 */
- "RCR", /* 0x02 */
- "TCR", /* 0x03 */
- "IMR", /* 0x04 */
- "ISR", /* 0x05 */
- "UTDA", /* 0x06 */
- "CTDA", /* 0x07 */
- "0x08", /* 0x08 */
- "0x09", /* 0x09 */
- "0x0A", /* 0x0A */
- "0x0B", /* 0x0B */
- "0x0C", /* 0x0C */
- "URDA", /* 0x0D */
- "CRDA", /* 0x0E */
- "0x0F", /* 0x0F */
- "0x10", /* 0x10 */
- "0x11", /* 0x11 */
- "0x12", /* 0x12 */
- "EOBC", /* 0x13 */
- "URRA", /* 0x14 */
- "RSA", /* 0x15 */
- "REA", /* 0x16 */
- "RRP", /* 0x17 */
- "RWP", /* 0x18 */
- "0x19", /* 0x19 */
- "0x1A", /* 0x1A */
- "0x1B", /* 0x1B */
- "0x1C", /* 0x1C */
- "0x0D", /* 0x1D */
- "0x1E", /* 0x1E */
- "0x1F", /* 0x1F */
- "0x20", /* 0x20 */
- "CEP", /* 0x21 */
- "CAP2", /* 0x22 */
- "CAP1", /* 0x23 */
- "CAP0", /* 0x24 */
- "CE", /* 0x25 */
- "CDP", /* 0x26 */
- "CDC", /* 0x27 */
- "SR", /* 0x28 */
- "WT0", /* 0x29 */
- "WT1", /* 0x2A */
- "RSC", /* 0x2B */
- "CRCT", /* 0x2C */
- "FAET", /* 0x2D */
- "MPT", /* 0x2E */
- "MDT", /* 0x2F */
- "0x30", /* 0x30 */
- "0x31", /* 0x31 */
- "0x32", /* 0x32 */
- "0x33", /* 0x33 */
- "0x34", /* 0x34 */
- "0x35", /* 0x35 */
- "0x36", /* 0x36 */
- "0x37", /* 0x37 */
- "0x38", /* 0x38 */
- "0x39", /* 0x39 */
- "0x3A", /* 0x3A */
- "0x3B", /* 0x3B */
- "0x3C", /* 0x3C */
- "0x3D", /* 0x3D */
- "0x3E", /* 0x3E */
- "DCR2" /* 0x3F */
-};
-#endif
-void sonic_write_register(
- void *base,
- unsigned32 regno,
- unsigned32 value
-)
-{
- volatile unsigned32 *p = base;
-
-#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS)
- printf( "%p Write 0x%04x to %s (0x%02x)\n",
- &p[regno], value, SONIC_Reg_name[regno], regno );
- fflush( stdout );
-#endif
- p[regno] = value;
-}
-
-unsigned32 sonic_read_register(
- void *base,
- unsigned32 regno
-)
-{
- volatile unsigned32 *p = base;
- unsigned32 value;
-
- value = p[regno];
-#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS)
- printf( "%p Read 0x%04x from %s (0x%02x)\n",
- &p[regno], value, SONIC_Reg_name[regno], regno );
- fflush( stdout );
-#endif
- return value;
-}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.h b/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.h
deleted file mode 100644
index 64aa1718f1..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.h
+++ /dev/null
@@ -1,372 +0,0 @@
-/*
- *******************************************************************
- *******************************************************************
- ** **
- ** DECLARATIONS FOR NATIONAL DP83932 `SONIC' **
- ** SYSTEMS-ORIENTED NETWORK INTERFACE CONTROLLER **
- ** **
- *******************************************************************
- *******************************************************************
- */
-
-/*
- * $Revision$ $Date$ $Author$
- * $State$
- * $Id$
- */
-
-#ifndef _SONIC_DP83932_
-#define _SONIC_DP83932_
-
-#include <bsp.h>
-
-/*
- ******************************************************************
- * *
- * Device Registers *
- * *
- ******************************************************************
- */
-#define SONIC_REG_CR 0x00 /* Command */
-#define SONIC_REG_DCR 0x01 /* Data configuration */
-#define SONIC_REG_RCR 0x02 /* Receive control */
-#define SONIC_REG_TCR 0x03 /* Transmit control */
-#define SONIC_REG_IMR 0x04 /* Interrupt mask */
-#define SONIC_REG_ISR 0x05 /* Interrupt status */
-#define SONIC_REG_UTDA 0x06 /* Upper transmit descriptor address */
-#define SONIC_REG_CTDA 0x07 /* Current transmit descriptor address */
-#define SONIC_REG_URDA 0x0D /* Upper receive descriptor address */
-#define SONIC_REG_CRDA 0x0E /* Current receive descriptor address */
-#define SONIC_REG_EOBC 0x13 /* End of buffer word count */
-#define SONIC_REG_URRA 0x14 /* Upper receive resource */
-#define SONIC_REG_RSA 0x15 /* Resource start address */
-#define SONIC_REG_REA 0x16 /* Resource end address */
-#define SONIC_REG_RRP 0x17 /* Resouce read pointer */
-#define SONIC_REG_RWP 0x18 /* Resouce write pointer */
-#define SONIC_REG_CEP 0x21 /* CAM entry pointer */
-#define SONIC_REG_CAP2 0x22 /* CAM address port 2 */
-#define SONIC_REG_CAP1 0x23 /* CAM address port 1 */
-#define SONIC_REG_CAP0 0x24 /* CAM address port 0 */
-#define SONIC_REG_CE 0x25 /* CAM enable */
-#define SONIC_REG_CDP 0x26 /* CAM descriptor pointer */
-#define SONIC_REG_CDC 0x27 /* CAM descriptor count */
-#define SONIC_REG_SR 0x28 /* Silicon revision */
-#define SONIC_REG_WT0 0x29 /* Watchdog timer 0 */
-#define SONIC_REG_WT1 0x2A /* Watchdog timer 1 */
-#define SONIC_REG_RSC 0x2B /* Receive sequence counter */
-#define SONIC_REG_CRCT 0x2C /* CRC error tally */
-#define SONIC_REG_FAET 0x2D /* FAE tally */
-#define SONIC_REG_MPT 0x2E /* Missed packet tally */
-#define SONIC_REG_MDT 0x2F /* TX Maximum Deferral */
-#define SONIC_REG_DCR2 0x3F /* Data configuration 2 */
-
-/*
- * Command register
- */
-#define CR_LCAM 0x0200
-#define CR_RRRA 0x0100
-#define CR_RST 0x0080
-#define CR_ST 0x0020
-#define CR_STP 0x0010
-#define CR_RXEN 0x0008
-#define CR_RXDIS 0x0004
-#define CR_TXP 0x0002
-#define CR_HTX 0x0001
-
-/*
- * Data configuration register
- */
-#define DCR_EXBUS 0x8000
-#define DCR_LBR 0x2000
-#define DCR_PO1 0x1000
-#define DCR_PO0 0x0800
-#define DCR_SBUS 0x0400
-#define DCR_USR1 0x0200
-#define DCR_USR0 0x0100
-#define DCR_WC1 0x0080
-#define DCR_WC0 0x0040
-#define DCR_DW 0x0020
-#define DCR_BMS 0x0010
-#define DCR_RFT1 0x0008
-#define DCR_RFT0 0x0004
-#define DCR_TFT1 0x0002
-#define DCR_TFT0 0x0001
-
-/* data configuration register aliases */
-#define DCR_SYNC DCR_SBUS /* synchronous (memory cycle 2 clocks) */
-#define DCR_ASYNC 0 /* asynchronous (memory cycle 3 clocks) */
-
-#define DCR_WAIT0 0 /* 0 wait states added */
-#define DCR_WAIT1 DCR_WC0 /* 1 wait state added */
-#define DCR_WAIT2 DCR_WC1 /* 2 wait states added */
-#define DCR_WAIT3 (DCR_WC1|DCR_WC0) /* 3 wait states added */
-
-#define DCR_DW16 0 /* use 16-bit DMA accesses */
-#define DCR_DW32 DCR_DW /* use 32-bit DMA accesses */
-
-#define DCR_DMAEF 0 /* DMA until TX/RX FIFO has emptied/filled */
-#define DCR_DMABLOCK DCR_BMS /* DMA until RX/TX threshold crossed */
-
-#define DCR_RFT4 0 /* receive threshold 4 bytes */
-#define DCR_RFT8 DCR_RFT0 /* receive threshold 8 bytes */
-#define DCR_RFT16 DCR_RFT1 /* receive threshold 16 bytes */
-#define DCR_RFT24 (DCR_RFT1|DCR_RFT0) /* receive threshold 24 bytes */
-
-#define DCR_TFT8 0 /* transmit threshold 8 bytes */
-#define DCR_TFT16 DCR_TFT0 /* transmit threshold 16 bytes */
-#define DCR_TFT24 DCR_TFT1 /* transmit threshold 24 bytes */
-#define DCR_TFT28 (DCR_TFT1|DCR_TFT0) /* transmit threshold 28 bytes */
-
-/*
- * Receive control register
- */
-#define RCR_ERR 0x8000
-#define RCR_RNT 0x4000
-#define RCR_BRD 0x2000
-#define RCR_PRO 0x1000
-#define RCR_AMC 0x0800
-#define RCR_LB1 0x0400
-#define RCR_LB0 0x0200
-#define RCR_MC 0x0100
-#define RCR_BC 0x0080
-#define RCR_LPKT 0x0040
-#define RCR_CRS 0x0020
-#define RCR_COL 0x0010
-#define RCR_CRCR 0x0008
-#define RCR_FAER 0x0004
-#define RCR_LBK 0x0002
-#define RCR_PRX 0x0001
-
-/*
- * Transmit control register
- */
-#define TCR_PINT 0x8000
-#define TCR_POWC 0x4000
-#define TCR_CRCI 0x2000
-#define TCR_EXDIS 0x1000
-#define TCR_EXD 0x0400
-#define TCR_DEF 0x0200
-#define TCR_NCRS 0x0100
-#define TCR_CRSL 0x0080
-#define TCR_EXC 0x0040
-#define TCR_OWC 0x0020
-#define TCR_PMB 0x0008
-#define TCR_FU 0x0004
-#define TCR_BCM 0x0002
-#define TCR_PTX 0x0001
-
-/*
- * Interrupt mask register
- */
-#define IMR_BREN 0x4000
-#define IMR_HBLEN 0x2000
-#define IMR_LCDEN 0x1000
-#define IMR_PINTEN 0x0800
-#define IMR_PRXEN 0x0400
-#define IMR_PTXEN 0x0200
-#define IMR_TXEREN 0x0100
-#define IMR_TCEN 0x0080
-#define IMR_RDEEN 0x0040
-#define IMR_RBEEN 0x0020
-#define IMR_RBAEEN 0x0010
-#define IMR_CRCEN 0x0008
-#define IMR_FAEEN 0x0004
-#define IMR_MPEN 0x0002
-#define IMR_RFOEN 0x0001
-
-/*
- * Interrupt status register
- */
-#define ISR_BR 0x4000
-#define ISR_HBL 0x2000
-#define ISR_LCD 0x1000
-#define ISR_PINT 0x0800
-#define ISR_PKTRX 0x0400
-#define ISR_TXDN 0x0200
-#define ISR_TXER 0x0100
-#define ISR_TC 0x0080
-#define ISR_RDE 0x0040
-#define ISR_RBE 0x0020
-#define ISR_RBAE 0x0010
-#define ISR_CRC 0x0008
-#define ISR_FAE 0x0004
-#define ISR_MP 0x0002
-#define ISR_RFO 0x0001
-
-/*
- * Data configuration register 2
- */
-#define DCR2_EXPO3 0x8000
-#define DCR2_EXPO2 0x4000
-#define DCR2_EXPO1 0x2000
-#define DCR2_EXPO0 0x1000
-#define DCR2_PH 0x0010
-#define DCR2_PCM 0x0004
-#define DCR2_PCNM 0x0002
-#define DCR2_RJCM 0x0001
-
-/*
- * Known values for the Silicon Revision Register
- */
-
-#define SONIC_REVISION_B 4
-#define SONIC_REVISION_C 6
-
-/*
- ******************************************************************
- * *
- * Transmit Buffer Management *
- * *
- ******************************************************************
- */
-
-/*
- * Transmit descriptor area entry.
- * There is one transmit descriptor for each packet to be transmitted.
- * Statically reserve space for up to MAXIMUM_FRAGS_PER_PACKET fragments
- * per descriptor.
- */
-#define MAXIMUM_FRAGS_PER_DESCRIPTOR 6
-struct TransmitDescriptor {
- rtems_unsigned32 status;
- rtems_unsigned32 pkt_config;
- rtems_unsigned32 pkt_size;
- rtems_unsigned32 frag_count;
-
- /*
- * Packet fragment pointers
- */
- struct TransmitDescriptorFragLink {
- rtems_unsigned32 frag_lsw; /* LSW of fragment address */
-#define frag_link frag_lsw
- rtems_unsigned32 frag_msw; /* MSW of fragment address */
- rtems_unsigned32 frag_size;
- } frag[MAXIMUM_FRAGS_PER_DESCRIPTOR];
-
- /*
- * Space for link if all fragment pointers are used.
- */
- rtems_unsigned32 link_pad;
-
- /*
- * Extra RTEMS stuff
- */
- struct TransmitDescriptor *next; /* Circularly-linked list */
- struct mbuf *mbufp; /* First mbuf in packet */
- volatile rtems_unsigned32 *linkp; /* Pointer to un[xxx].link */
-};
-typedef struct TransmitDescriptor TransmitDescriptor_t;
-typedef volatile TransmitDescriptor_t *TransmitDescriptorPointer_t;
-
-/*
- * Transmit Configuration.
- * For standard Ethernet transmission, all bits in the transmit
- * configuration field are set to 0.
- */
-#define TDA_CONFIG_PINT 0x8000
-#define TDA_CONFIG_POWC 0x4000
-#define TDA_CONFIG_CRCI 0x2000
-#define TDA_CONFIG_EXDIS 0x1000
-
-/*
- * Transmit status
- */
-#define TDA_STATUS_COLLISION_MASK 0xF800
-#define TDA_STATUS_COLLISION_SHIFT 11
-#define TDA_STATUS_EXD 0x0400
-#define TDA_STATUS_DEF 0x0200
-#define TDA_STATUS_NCRS 0x0100
-#define TDA_STATUS_CRSL 0x0080
-#define TDA_STATUS_EXC 0x0040
-#define TDA_STATUS_OWC 0x0020
-#define TDA_STATUS_PMB 0x0008
-#define TDA_STATUS_FU 0x0004
-#define TDA_STATUS_BCM 0x0002
-#define TDA_STATUS_PTX 0x0001
-
-#define TDA_LINK_EOL 0x0001
-#define TDA_LINK_EOL_MASK 0xFFFE
-
-
-
-/*
- ******************************************************************
- * *
- * Receive Buffer Management *
- * *
- ******************************************************************
- */
-
-/*
- * Receive resource area entry.
- * There is one receive resource entry for each receive buffer area (RBA).
- * This driver allows only one packet per receive buffer area, so one
- * receive resource entry corresponds to one correctly-received packet.
- */
-struct ReceiveResource {
- rtems_unsigned32 buff_ptr_lsw; /* LSW of RBA address */
- rtems_unsigned32 buff_ptr_msw; /* MSW of RBA address */
- rtems_unsigned32 buff_wc_lsw; /* LSW of RBA size (16-bit words) */
- rtems_unsigned32 buff_wc_msw; /* MSW of RBA size (16-bit words) */
-};
-typedef struct ReceiveResource ReceiveResource_t;
-typedef volatile ReceiveResource_t *ReceiveResourcePointer_t;
-
-/*
- * Receive descriptor area entry.
- * There is one receive descriptor for each packet received.
- */
-struct ReceiveDescriptor {
- rtems_unsigned32 status;
- rtems_unsigned32 byte_count;
- rtems_unsigned32 pkt_lsw; /* LSW of packet address */
- rtems_unsigned32 pkt_msw; /* MSW of packet address */
- rtems_unsigned32 seq_no;
- rtems_unsigned32 link;
- rtems_unsigned32 in_use;
-
- /*
- * Extra RTEMS stuff
- */
- volatile struct ReceiveDescriptor *next; /* Circularly-linked list */
-};
-typedef struct ReceiveDescriptor ReceiveDescriptor_t;
-typedef volatile ReceiveDescriptor_t *ReceiveDescriptorPointer_t;
-
-typedef struct {
- rtems_unsigned32 cep; /* CAM Entry Pointer */
- rtems_unsigned32 cap0; /* CAM Address Port 0 xx-xx-xx-xx-YY-YY */
- rtems_unsigned32 cap1; /* CAM Address Port 1 xx-xx-YY-YY-xxxx */
- rtems_unsigned32 cap2; /* CAM Address Port 2 YY-YY-xx-xx-xx-xx */
- rtems_unsigned32 ce;
-} CamDescriptor_t;
-
-typedef volatile CamDescriptor_t *CamDescriptorPointer_t;
-
-/*
- * Receive status
- */
-#define RDA_STATUS_ERR 0x8800
-#define RDA_STATUS_RNT 0x4000
-#define RDA_STATUS_BRD 0x2000
-#define RDA_STATUS_PRO 0x1000
-#define RDA_STATUS_AMC 0x0800
-#define RDA_STATUS_LB1 0x0400
-#define RDA_STATUS_LB0 0x0200
-#define RDA_STATUS_MC 0x0100
-#define RDA_STATUS_BC 0x0080
-#define RDA_STATUS_LPKT 0x0040
-#define RDA_STATUS_CRS 0x0020
-#define RDA_STATUS_COL 0x0010
-#define RDA_STATUS_CRCR 0x0008
-#define RDA_STATUS_FAER 0x0004
-#define RDA_STATUS_LBK 0x0002
-#define RDA_STATUS_PRX 0x0001
-
-#define RDA_LINK_EOL 0x0001
-#define RDA_LINK_EOL_MASK 0xFFFE
-#define RDA_IN_USE 0x0000 /* SONIC has finished with the packet */
- /* and the driver can process it */
-#define RDA_FREE 0xFFFF /* SONIC can use it */
-
-#endif /* _SONIC_DP83932_ */
diff --git a/c/src/lib/libbsp/powerpc/dmv177/start/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/start/Makefile.in
deleted file mode 100644
index cb7d9c07ec..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/start/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/start.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/powerpc/dmv177/start/start.s b/c/src/lib/libbsp/powerpc/dmv177/start/start.s
deleted file mode 100644
index f8e4e4e614..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/start/start.s
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * This is based on the mvme-crt0.S file from libgloss/rs6000.
- * crt0.S -- startup file for PowerPC systems.
- *
- * Copyright (c) 1995 Cygnus Support
- *
- * The authors hereby grant permission to use, copy, modify, distribute,
- * and license this software and its documentation for any purpose, provided
- * that existing copyright notices are retained in all copies and that this
- * notice is included verbatim in any distributions. No written agreement,
- * license, or royalty fee is required for any of the authorized uses.
- * Modifications to this software may be copyrighted by their authors
- * and need not follow the licensing terms described here, provided that
- * the new terms are clearly indicated on the first page of each file where
- * they apply.
- *
- * $Id$
- */
-
-#include <rtems/score/targopts.h>
-#include "ppc-asm.h"
-
- .file "start.s"
- .section ".got2","aw"
- .align 2
-
-.LCTOC1 = .+32768
-
- .extern FUNC_NAME(atexit)
- .globl FUNC_NAME(__atexit)
- .section ".sdata","aw"
- .align 2
-FUNC_NAME(__atexit): /* tell C's eabi-ctor's we have an atexit function */
- .long FUNC_NAME(atexit)@fixup /* and that it is to register __do_global_dtors */
-
- .section ".fixup","aw"
- .align 2
- .long FUNC_NAME(__atexit)
-
- .section ".got2","aw"
-.Ltable = .-.LCTOC1
- .long .LCTOC1 /* address we think .LCTOC1 is loaded at */
-
-.Lbss_start = .-.LCTOC1
- .long __bss_start
-
-.Lend = .-.LCTOC1
- .long _end
-
-.Lstack = .-.LCTOC1 /* stack address if set by user */
- .long __stack
-
- .text
-.Lptr:
- .long .LCTOC1-.Laddr
-
- .globl _start
- .type _start,@function
-_start:
- lis r5,0
- mr r4,r5
- ori r4,r4,0x0000 /* 0x2030 */
- mtmsr r4
-
-/* Add special purpose register initialization based upon the console driver
- * initialization of these registers XXXXX
- */
-
- bl .Laddr /* get current address */
-
-.Laddr:
- mflr r4 /* real address of .Laddr */
- lwz r5,(.Lptr-.Laddr)(r4) /* linker generated address of .LCTOC1 */
- add r5,r5,r4 /* correct to real pointer */
- lwz r4,.Ltable(r5) /* get linker's idea of where .Laddr is */
- subf r4,r4,r5 /* calculate difference between where linked and current */
-
- /* clear bss */
- lwz r6,.Lbss_start(r5) /* calculate beginning of the BSS */
- lwz r7,.Lend(r5) /* calculate end of the BSS */
- add r6,r6,r4 /* adjust pointers */
- add r7,r7,r4
-
- cmplw 1,r6,r7
- bc 4,4,.Ldone
-
- subf r8,r6,r7 /* number of bytes to zero */
- srwi r9,r8,2 /* number of words to zero */
- mtctr r9
- li r0,0 /* zero to clear memory */
- addi r6,r6,-4 /* adjust so we can use stwu */
-.Lloop:
- stwu r0,4(r6) /* zero bss */
- bdnz .Lloop
-
-.Ldone:
-
- lwz r0,.Lstack(r5) /* stack address or 0 */
- cmplwi 1,r0,0 /* equal to 0? */
- bc 12,6,.Lnostack /* use default stack if == 0 */
- mr sp,r0 /* use user defined stack */
-
-.Lnostack:
- /* set up initial stack frame */
- addi sp,sp,-4 /* make sure we don't overwrite debug mem */
- lis r0,0
- stw r0,0(sp) /* clear back chain */
- stwu sp,-56(sp) /* push another stack frame */
-
- /* Let her rip */
- bl FUNC_NAME(boot_card)
-
- /* return value from boot_card is argument to exit */
- /* bl FUNC_NAME(exit) */
- trap
-.Lstart:
- .size _start,.Lstart-_start
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in
deleted file mode 100644
index 0877918685..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec genpvec vmeintr
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=linkcmds $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(INSTALLED_O_FILES) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c b/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c
deleted file mode 100644
index 5e354f9387..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-void bsp_cleanup( void )
-{
-#if 0
- asm volatile( "li 10,99" ); /* 0x63 */
- asm volatile( "sc" );
-#endif
-}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c b/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c
deleted file mode 100644
index 07a5bf1473..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/* bspstart.c
- *
- * This set of routines starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before any of these are invoked.
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-rtems_cpu_table Cpu_table;
-rtems_unsigned32 bsp_isr_level;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*PAGE
- *
- * bsp_pretasking_hook
- *
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
- rtems_unsigned32 heap_size;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- heap_size = BSP_Configuration.work_space_start - (void *)&end;
- heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
-
- bsp_libc_init((void *) heap_start, heap_size, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/* PAGE
- *
- * bsp_predriver_hook
- *
- * Initialization before drivers are setup.
- */
-
-void bsp_predriver_hook(void)
-{
- initialize_external_exception_vector();
-}
-
-/*PAGE
- *
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- unsigned char *work_space_start;
- unsigned int msr_value = 0x2030;
-
- /*
- * Set BSP to initial value. Note: This value is a guess
- * check how the real board comes up. This is critical to
- * getting the source to work with the debugger.
- */
-
- _CPU_MSR_SET( msr_value );
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
-
- work_space_start =
- (unsigned char *)&RAM_END - BSP_Configuration.work_space_size;
-
- if ( work_space_start <= (unsigned char *)&end ) {
- DEBUG_puts( "bspstart: Not enough RAM!!!\n" );
- bsp_cleanup();
- }
-
- BSP_Configuration.work_space_start = work_space_start;
-
- /*
- * Account for the console's resources
- */
-
- console_reserve_resources( &BSP_Configuration );
-
- /*
- * initialize the CPU table for this BSP
- */
-
- Cpu_table.exceptions_in_RAM = TRUE;
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.predriver_hook = bsp_predriver_hook;
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- /* Cpu_table.clicks_per_usec = 66666667 / 4000000; */
- Cpu_table.clicks_per_usec = 66666667 / 4000000 / 2;
-
- Cpu_table.do_zero_of_workspace = TRUE;
- Cpu_table.interrupt_stack_size = (12 * 1024);
-}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c b/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c
deleted file mode 100644
index 2faa40ed9a..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/* genpvec.c
- *
- * These routines handle the external exception. Multiple ISRs occur off
- * of this one interrupt. This method will allow multiple ISRs to be
- * called using the same IRQ index. However, removing the ISR routines is
- * presently not supported.
- *
- * The external exception vector numbers begin with DMV170_IRQ_FIRST.
- * DMV170_IRQ_FIRST is defined to be one greater than the last processor
- * interrupt.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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 <bsp.h>
-#include "chain.h"
-#include <assert.h>
-
-#define NUM_LIRQ_HANDLERS 20
-#define NUM_LIRQ ( MAX_BOARD_IRQS - PPC_IRQ_LAST )
-
-/*
- * Structure to for one of possible multiple interrupt handlers for
- * a given interrupt.
- */
-typedef struct
-{
- Chain_Node Node;
- rtems_isr_entry handler; /* isr routine */
- rtems_vector_number vector; /* vector number */
-} EE_ISR_Type;
-
-/*
- * Note: The following will not work if we add a method to remove
- * handlers at a later time.
- */
-EE_ISR_Type ISR_Nodes [NUM_LIRQ_HANDLERS];
-rtems_unsigned16 Nodes_Used;
-Chain_Control ISR_Array [NUM_LIRQ];
-
-/*PAGE
- *
- * external_exception_ISR
- *
- * This interrupt service routine is called for an External Exception.
- *
- * Input parameters:
- * vector - vector number representing the external exception vector.
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_isr external_exception_ISR (
- rtems_vector_number vector /* IN */
-)
-{
- rtems_unsigned16 index;
- rtems_boolean is_active=FALSE;
- rtems_unsigned32 scv64_status;
- rtems_vector_number chained_vector;
- Chain_Node *node;
- EE_ISR_Type *ee_isr;
-
-
- /*
- * Get all active interrupts.
- */
- scv64_status = SCV64_Get_Interrupt();
- scv64_status &= SCV64_Get_Interrupt_Enable();
-
- /*
- * Process any set interrupts.
- */
- for (index = 0; index <= 5; index++) {
- switch(index) {
- case 0:
- is_active = SCV64_Is_IRQ0( scv64_status );
- break;
- case 1:
- is_active = SCV64_Is_IRQ1( scv64_status );
- break;
- case 2:
- is_active = SCV64_Is_IRQ2( scv64_status );
- break;
- case 3:
- is_active = SCV64_Is_IRQ3( scv64_status );
- break;
- case 4:
- is_active = SCV64_Is_IRQ4( scv64_status );
- break;
- case 5:
- is_active = SCV64_Is_IRQ5( scv64_status );
- break;
- }
-
- if (is_active) {
- /*
- * Read vector.
- */
- node = ISR_Array[ index ].first;
- while ( !_Chain_Is_tail( &ISR_Array[ index ], node ) ) {
- ee_isr = (EE_ISR_Type *) node;
- (*ee_isr->handler)( ee_isr->vector );
- node = node->next;
- }
- }
- }
-}
-
-
-/*PAGE
- *
- * initialize_external_exception_vector
- *
- * This routine initializes the external exception vector
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void initialize_external_exception_vector ()
-{
- int i;
- rtems_isr_entry previous_isr;
- rtems_status_code status;
-
- Nodes_Used = 0;
-
- /*
- * Initialize the SCV64 chip
- */
- SCV64_Initialize();
-
- for (i=0; i <NUM_LIRQ; i++)
- Chain_Initialize_empty( &ISR_Array[i] );
-
- /*
- * Install external_exception_ISR () as the handler for
- * the General Purpose Interrupt.
- */
-
- status = rtems_interrupt_catch( external_exception_ISR,
- PPC_IRQ_EXTERNAL , (rtems_isr_entry *) &previous_isr );
-
-}
-
-/*PAGE
- *
- * set_EE_vector
- *
- * This routine installs one of multiple ISRs for the general purpose
- * inerrupt.
- *
- * Input parameters:
- * handler - handler to call at exception
- * vector - vector number associated with this handler.
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_isr_entry set_EE_vector(
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector /* vector number */
-)
-{
- rtems_unsigned16 vec_idx = vector - DMV170_IRQ_FIRST;
- rtems_unsigned32 index;
-
- /*
- * Verify that all of the nodes have not been used.
- */
- assert (Nodes_Used < NUM_LIRQ_HANDLERS);
-
- /*
- * If we have already installed this handler for this vector, then
- * just reset it.
- */
-
- for ( index=0 ; index <= Nodes_Used ; index++ ) {
- if ( ISR_Nodes[index].vector == vector &&
- ISR_Nodes[index].handler == handler )
- return 0;
- }
-
- /*
- * Increment the number of nedes used and set the index for the node
- * array.
- */
-
- Nodes_Used++;
- index = Nodes_Used - 1;
-
- /*
- * Write the values of the handler and the vector to this node.
- */
- ISR_Nodes[index].handler = handler;
- ISR_Nodes[index].vector = vector;
-
- /*
- * Connect this node to the chain at the location of the
- * vector index.
- */
- Chain_Append( &ISR_Array[vec_idx], &ISR_Nodes[index].Node );
-
- /*
- * Enable the LIRQ interrupt.
- */
- SCV64_Generate_DUART_Interrupts();
-
- /*
- * No interrupt service routine was removed so return 0
- */
- return 0;
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds b/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds
deleted file mode 100644
index 52e379d8a4..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds
+++ /dev/null
@@ -1,183 +0,0 @@
-OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
- "elf32-powerpc")
-OUTPUT_ARCH(powerpc)
-ENTRY(_start)
-
-/*
- * Number of Decrementer countdowns per millisecond
- *
- * Calculated by: (66.67 Mhz * 1000) / 4 cycles per click
- *
-
-PROVIDE(CPU_PPC_CLICKS_PER_MS = 16667);
-*/
-
-MEMORY
- {
- RAM : ORIGIN = 0x41000, LENGTH = 32M
- EPROM : ORIGIN = 0xFFF00000, LENGTH = 0x20000
- }
-
-SECTIONS
-{
- /* Read-only sections, merged into text segment: */
- /* . = 0x40000 + SIZEOF_HEADERS; */
- /* . = 0x1000000;*/
- . = 0x41000;
- .interp : { *(.interp) }
- .hash : { *(.hash) }
- .dynsym : { *(.dynsym) }
- .dynstr : { *(.dynstr) }
- .rela.text : { *(.rela.text) }
- .rela.data : { *(.rela.data) }
- .rela.rodata : { *(.rela.rodata) }
- .rela.got : { *(.rela.got) }
- .rela.got1 : { *(.rela.got1) }
- .rela.got2 : { *(.rela.got2) }
- .rela.ctors : { *(.rela.ctors) }
- .rela.dtors : { *(.rela.dtors) }
- .rela.init : { *(.rela.init) }
- .rela.fini : { *(.rela.fini) }
- .rela.bss : { *(.rela.bss) }
- .rela.plt : { *(.rela.plt) }
- .rela.sdata : { *(.rela.sdata2) }
- .rela.sbss : { *(.rela.sbss2) }
- .rela.sdata2 : { *(.rela.sdata2) }
- .rela.sbss2 : { *(.rela.sbss2) }
- .plt : { *(.plt) }
- .text :
- {
- *(.text)
- *(.descriptors)
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
- } >RAM
- .init : { *(.init) } >RAM
- .fini : { *(.fini) } >RAM
- .rodata : { *(.rodata) } >RAM
- .rodata1 : { *(.rodata1) } >RAM
- _etext = .;
- PROVIDE (etext = .);
- PROVIDE (__SDATA2_START__ = .);
- .sdata2 : { *(.sdata2) } >RAM
- .sbss2 : { *(.sbss2) } >RAM
- PROVIDE (__SBSS2_END__ = .);
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. It would
- be more correct to do this:
- . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
- The current expression does not correctly handle the case of a
- text segment ending precisely at the end of a page; it causes the
- data segment to skip a page. The above expression does not have
- this problem, but it will currently (2/95) cause BFD to allocate
- a single segment, combining both text and data, for this case.
- This will prevent the text segment from being shared among
- multiple executions of the program; I think that is more
- important than losing a page of the virtual address space (note
- that no actual memory is lost; the page which is skipped can not
- be referenced). */
- . = ALIGN(8) + 0x40000;
- PROVIDE (sdata = .);
- .data :
- {
- *(.data)
- CONSTRUCTORS
- } >RAM
- PROVIDE (__EXCEPT_START__ = .);
- .gcc_except_table : { *(.gcc_except_table) } >RAM
- PROVIDE (__EXCEPT_END__ = .);
-
- .data1 : { *(.data1) } >RAM
- .got1 : { *(.got1) } >RAM
- .dynamic : { *(.dynamic) } >RAM
- /* Put .ctors and .dtors next to the .got2 section, so that the pointers
- get relocated with -mrelocatable. Also put in the .fixup pointers.
- The current compiler no longer needs this, but keep it around for 2.7.2 */
- PROVIDE (_GOT2_START_ = .);
- PROVIDE (__GOT2_START__ = .);
- .got2 : { *(.got2) } >RAM
- PROVIDE (_GOT2_END_ = .);
- PROVIDE (__GOT2_END__ = .);
-
- PROVIDE (__CTOR_LIST__ = .);
- .ctors : { *(.ctors) } >RAM
- PROVIDE (__CTOR_END__ = .);
-
- PROVIDE (__DTOR_LIST__ = .);
- .dtors : { *(.dtors) } >RAM
- PROVIDE (__DTOR_END__ = .);
-
- PROVIDE (_FIXUP_START_ = .);
- PROVIDE (__FIXUP_START__ = .);
- .fixup : { *(.fixup) } >RAM
- PROVIDE (_FIXUP_END_ = .);
- PROVIDE (__FIXUP_END__ = .);
-
- PROVIDE (_GOT2_END_ = .);
- PROVIDE (_GOT_START_ = .);
- s.got = .;
- .got : { *(.got) } >RAM
- .got.plt : { *(.got.plt) } >RAM
- PROVIDE (_GOT_END_ = .);
- PROVIDE (__GOT_END__ = .);
-
- /* We want the small data sections together, so single-instruction offsets
- can access them all, and initialized data all before uninitialized, so
- we can shorten the on-disk segment size. */
- PROVIDE (__SDATA_START__ = .);
- .sdata : { *(.sdata) } >RAM
- _edata = .;
- PROVIDE (edata = .);
-
- PROVIDE (RAM_END = 4M);
- .sbss :
- {
- PROVIDE (__sbss_start = .);
- *(.sbss)
- *(.scommon)
- PROVIDE (__sbss_end = .);
- } >RAM
- PROVIDE (__SBSS_END__ = .);
- .bss :
- {
- PROVIDE (__bss_start = .);
- *(.dynbss)
- *(.bss)
- *(COMMON)
- } >RAM
- . = ALIGN(8) + 0x8000;
- PROVIDE (__stack = .);
- _end = . ;
- PROVIDE (end = .);
-
- /* These are needed for ELF backends which have not yet been
- converted to the new style linker. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- /* DWARF debug sections.
- Symbols in the DWARF debugging sections are relative to the beginning
- of the section so we begin them at 0. */
- /* DWARF 1 */
- .debug 0 : { *(.debug) }
- .line 0 : { *(.line) }
- /* GNU DWARF 1 extensions */
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- /* DWARF 1.1 and DWARF 2 */
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- /* DWARF 2 */
- .debug_info 0 : { *(.debug_info) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_line 0 : { *(.debug_line) }
- .debug_frame 0 : { *(.debug_frame) }
- .debug_str 0 : { *(.debug_str) }
- .debug_loc 0 : { *(.debug_loc) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
- /* SGI/MIPS DWARF 2 extensions */
- .debug_weaknames 0 : { *(.debug_weaknames) }
- .debug_funcnames 0 : { *(.debug_funcnames) }
- .debug_typenames 0 : { *(.debug_typenames) }
- .debug_varnames 0 : { *(.debug_varnames) }
- /* These must appear regardless of . */
-}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c b/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c
deleted file mode 100644
index cf385569d0..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on the target Board/CPU.
- * This routine is allowed to be as board dependent as necessary.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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 <rtems.h>
-#include <bsp.h>
-
-/*PAGE
- *
- * set_vector
- *
- * This routine installs an interrupt handler for vector.
- */
-
-rtems_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- rtems_isr_entry previous_isr;
- rtems_status_code status;
-
- /*
- * vectors greater than PPC603e_IRQ_LAST are handled by the General purpose
- * interupt handler.
- */
- if ( vector > PPC_IRQ_LAST ) {
- set_EE_vector ( handler, vector );
- }
- else {
- status = rtems_interrupt_catch(
- handler, vector, (rtems_isr_entry *) &previous_isr );
- }
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c b/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c
deleted file mode 100644
index 212d7eb938..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/* vmeintr.c
- *
- * VMEbus support routines for the DMV170.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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 <rtems.h>
-#include <bsp.h>
-#include <vmeintr.h>
-
-/* PAGE
- *
- * VME_interrupt_Disable
- *
- * This routine disables vme interupts
- *
- * Input parameters:
- * mask - interupt mask
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void VME_interrupt_Disable (
- VME_interrupt_Mask mask /* IN */
-)
-{
- volatile rtems_unsigned8 *VME_interrupt_enable;
- rtems_unsigned8 value;
-
-#if 0
- VME_interrupt_enable = ACC_VIE;
-#else
- VME_interrupt_enable = 0;
-#endif
- value = *VME_interrupt_enable;
-
- value &= ~mask; /* turn off interrupts for all levels in mask */
-
- *VME_interrupt_enable = value;
-}
-
-/* PAGE
- *
- * VME_interrupt_Enable
- *
- * This routine enables vme interupts
- *
- * Input parameters:
- * mask - interupt mask
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-void VME_interrupt_Enable (
- VME_interrupt_Mask mask /* IN */
-)
-{
- volatile rtems_unsigned8 *VME_interrupt_enable;
- rtems_unsigned8 value;
-
-#if 0
- VME_interrupt_enable = ACC_VIE;
-#else
- VME_interrupt_enable = 0;
-#endif
- value = *VME_interrupt_enable;
-
- value |= mask; /* turn on interrupts for all levels in mask */
-
- *VME_interrupt_enable = value;
-}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/timer/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/timer/Makefile.in
deleted file mode 100644
index 16665e4de9..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/powerpc/dmv177/timer/timer.c b/c/src/lib/libbsp/powerpc/dmv177/timer/timer.c
deleted file mode 100644
index 674e2cf5a8..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/timer/timer.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/* timer.c
- *
- * This file implements a benchmark timer using the General Purpose Timer on
- * the MEC.
- *
- * The license and distribution terms for this file are in
- * the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <assert.h>
-
-#include <bsp.h>
-
-rtems_unsigned64 Timer_driver_Start_time;
-
-rtems_boolean Timer_driver_Find_average_overhead;
-
-/*PAGE
- *
- * Timer_initialize
- *
- * This routine initializes the timer.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- *
- */
-
-void Timer_initialize()
-{
- /*
- * Timer runs long and accurate enough not to require an interrupt.
- */
-
-
- Timer_driver_Start_time = PPC_Get_timebase_register();
-
-
-}
-
-#define AVG_OVERHEAD 24 /* It typically takes 24 instructions */
- /* to start/stop the timer. */
-#define LEAST_VALID 1 /* Don't trust a value lower than this */
-
-/* PAGE
- *
- * Read_timer
- *
- * This routine reads the timer.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: timer in ms units
- *
- */
-
-int Read_timer()
-{
- rtems_unsigned64 clicks;
- rtems_unsigned64 total64;
- rtems_unsigned32 total;
-
- /* approximately CLOCK_SPEED clicks per microsecond */
-
- clicks = PPC_Get_timebase_register();
-
- assert( clicks > Timer_driver_Start_time );
-
- total64 = clicks - Timer_driver_Start_time;
-
- assert( total64 <= 0xffffffff ); /* fits into a unsigned32 */
-
- total = (rtems_unsigned32) total64;
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in one microsecond units */
-
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
-
- return total - AVG_OVERHEAD;
-}
-
-/* PAGE
- *
- * Empty_function
- *
- * This routine is called during the idle loop.
- *
- * Input parameters: NONE
- *
- * Output parameters:
- * status code of successful
- *
- * Return values: NONE
- *
- */
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/* PAGE
- *
- * Set_find_average_overhead
- *
- * This routine sets a global boolean to the value passed in.
- *
- * Input parameters:
- * find_flag - flag to indicate to find the average overhead.
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- *
- */
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/times b/c/src/lib/libbsp/powerpc/dmv177/times
deleted file mode 100644
index 2a18eae92a..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/times
+++ /dev/null
@@ -1,191 +0,0 @@
-#
-# Timing Test Suite Results for the DY-4 DMV177
-#
-# $Id$
-#
-
-Board: DY-4 DMV177
-CPU: PPC 603e
-Clock Speed: 100 Mhz
-Memory Configuration: 32 Mbyte DRAM
-Wait States: XXX
-
-Times Reported in: cycles
-Timer Source: on-CPU General Purpose Count Down Timer
-
-Column A: 4.0.0-lmco
-Column B: unused
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 571
- rtems_semaphore_delete 575
- rtems_semaphore_obtain: available 414
- rtems_semaphore_obtain: not available -- NO_WAIT 414
- rtems_semaphore_release: no waiting tasks 501
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 1254
-
- 3 rtems_semaphore_release: task readied -- preempts caller 982
-
- 4 rtems_task_restart: blocked task -- preempts caller 1640
- rtems_task_restart: ready task -- preempts caller 1601
- rtems_semaphore_release: task readied -- returns to caller 636
- rtems_task_create 2301
- rtems_task_start 794
- rtems_task_restart: suspended task -- returns to caller 906
- rtems_task_delete: suspended task 1555
- rtems_task_restart: ready task -- returns to caller 928
- rtems_task_restart: blocked task -- returns to caller 1102
- rtems_task_delete: blocked task 1609
-
- 5 rtems_task_suspend: calling task 960
- rtems_task_resume: task readied -- preempts caller 803
-
- 6 rtems_task_restart: calling task 1137
- rtems_task_suspend: returns to caller 433
- rtems_task_resume: task readied -- returns to caller 451
- rtems_task_delete: ready task 1620
-
- 7 rtems_task_restart: suspended task -- preempts caller 1483
-
- 8 rtems_task_set_priority: obtain current priority 368
- rtems_task_set_priority: returns to caller 633
- rtems_task_mode: obtain current mode 184
- rtems_task_mode: no reschedule 213
- rtems_task_mode: reschedule -- returns to caller 247
- rtems_task_mode: reschedule -- preempts caller 919
- rtems_task_set_note 383
- rtems_task_get_note 382
- rtems_clock_set 792
- rtems_clock_get 78
-
- 9 rtems_message_queue_create 2270
- rtems_message_queue_send: no waiting tasks 923
- rtems_message_queue_urgent: no waiting tasks 919
- rtems_message_queue_receive: available 755
- rtems_message_queue_flush: no messages flushed 369
- rtems_message_queue_flush: messages flushed 431
- rtems_message_queue_delete 708
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 467
- rtems_message_queue_receive: not available -- caller blocks 1283
-
-11 rtems_message_queue_send: task readied -- preempts caller 1322
-
-12 rtems_message_queue_send: task readied -- returns to caller 955
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 1322
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 955
-
-15 rtems_event_receive: obtain current events 43
- rtems_event_receive: not available -- NO_WAIT 331
- rtems_event_receive: not available -- caller blocks 1043
- rtems_event_send: no task readied 354
- rtems_event_receive: available 357
- rtems_event_send: task readied -- returns to caller 571
-
-16 rtems_event_send: task readied -- preempts caller 946
-
-17 rtems_task_set_priority: preempts caller 1211
-
-18 rtems_task_delete: calling task 2117
-
-19 rtems_signal_catch 267
- rtems_signal_send: returns to caller 408
- rtems_signal_send: signal to self 607
- exit ASR overhead: returns to calling task 464
- exit ASR overhead: returns to preempting task 752
-
-20 rtems_partition_create 762
- rtems_region_create 614
- rtems_partition_get_buffer: available 394
- rtems_partition_get_buffer: not available 376
- rtems_partition_return_buffer 420
- rtems_partition_delete 426
- rtems_region_get_segment: available 515
- rtems_region_get_segment: not available -- NO_WAIT 472
- rtems_region_return_segment: no waiting tasks 544
- rtems_region_get_segment: not available -- caller blocks 1345
- rtems_region_return_segment: task readied -- preempts caller 1296
- rtems_region_return_segment: task readied -- returns to caller 935
- rtems_region_delete 425
- rtems_io_initialize 52
- rtems_io_open 42
- rtems_io_close 44
- rtems_io_read 42
- rtems_io_write 44
- rtems_io_control 42
-
-21 rtems_task_ident 2900
- rtems_message_queue_ident 2828
- rtems_semaphore_ident 3243
- rtems_partition_ident 2828
- rtems_region_ident 2878
- rtems_port_ident 2828
- rtems_timer_ident 2828
- rtems_rate_monotonic_ident 2826
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 1079
- rtems_message_queue_broadcast: no waiting tasks 589
- rtems_message_queue_broadcast: task readied -- preempts caller 1435
-
-23 rtems_timer_create 357
- rtems_timer_fire_after: inactive 607
- rtems_timer_fire_after: active 646
- rtems_timer_cancel: active 378
- rtems_timer_cancel: inactive 339
- rtems_timer_reset: inactive 552
- rtems_timer_reset: active 591
- rtems_timer_fire_when: inactive 766
- rtems_timer_fire_when: active 764
- rtems_timer_delete: active 471
- rtems_timer_delete: inactive 432
- rtems_task_wake_when 1275
-
-24 rtems_task_wake_after: yield -- returns to caller 245
- rtems_task_wake_after: yields -- preempts caller 851
-
-25 rtems_clock_tick 214
-
-26 _ISR_Disable 24
- _ISR_Flash 21
- _ISR_Enable 19
- _Thread_Disable_dispatch 27
- _Thread_Enable_dispatch 211
- _Thread_Set_state 177
- _Thread_Disptach (NO FP) 761
- context switch: no floating point contexts 585
- context switch: self 230
- context switch: to another task 236
- context switch: restore 1st FP task 730
- fp context switch: save idle, restore idle 478
- fp context switch: save idle, restore initialized 828
- fp context switch: save initialized, restore initialized 478
- _Thread_Resume 143
- _Thread_Unblock 143
- _Thread_Ready 147
- _Thread_Get 93
- _Semaphore_Get 77
- _Thread_Get: invalid id 20
-
-27 interrupt entry overhead: returns to interrupted task 206
- interrupt exit overhead: returns to interrupted task 213
- interrupt entry overhead: returns to nested interrupt 201
- interrupt exit overhead: returns to nested interrupt 186
- interrupt entry overhead: returns to preempting task 202
- interrupt exit overhead: returns to preempting task 857
-
-28 rtems_port_create 428
- rtems_port_external_to_internal 339
- rtems_port_internal_to_external 339
- rtems_port_delete 421
-
-29 rtems_rate_monotonic_create 388
- rtems_rate_monotonic_period: initiate period -- returns to caller 556
- rtems_rate_monotonic_period: obtain status 377
- rtems_rate_monotonic_cancel 427
- rtems_rate_monotonic_delete: inactive 465
- rtems_rate_monotonic_delete: active 519
- rtems_rate_monotonic_period: conclude periods -- caller blocks 843
diff --git a/c/src/lib/libbsp/powerpc/dmv177/tod/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/tod/Makefile.in
deleted file mode 100644
index f2af5cc8fb..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/tod/Makefile.in
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/tod.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=config tod
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-# First and second generation use different RTC chips :(
-TOD_PIECES=tod
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/powerpc/dmv177/tod/config.c b/c/src/lib/libbsp/powerpc/dmv177/tod/config.c
deleted file mode 100644
index aa44aa66bf..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/tod/config.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * This file contains the RTC driver table for the DY-4 DMV177.
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#include <libchip/rtc.h>
-#include <libchip/icm7170.h>
-
-/*
- * Configuration specific probe routines
- *
- * NOTE: There are no DMV177 specific configuration routines. These
- * routines could be written to dynamically determine what type
- * of real-time clock is on this board. This would be useful for
- * a BSP supporting multiple board models.
- */
-
-/* NONE CURRENTLY PROVIDED */
-
-/*
- * The following table configures the RTC drivers used in this BSP.
- *
- * The first entry which, when probed, is available, will be named /dev/rtc,
- * all others being given the name indicated.
- */
-
-boolean dmv177_icm7170_probe(int minor);
-
-rtc_tbl RTC_Table[] = {
- {
- "/dev/rtc0", /* sDeviceName */
- RTC_ICM7170, /* deviceType */
- &icm7170_fns, /* pDeviceFns */
- dmv177_icm7170_probe, /* deviceProbe */
- (void *) ICM7170_AT_1_MHZ, /* pDeviceParams */
- DMV170_RTC_ADDRESS, /* ulCtrlPort1 */
- NULL, /* ulDataPort */
- icm7170_get_register_8, /* getRegister */
- icm7170_set_register_8, /* setRegister */
- }
-};
-
-/*
- * Declare some information used by the RTC driver
- */
-
-#define NUM_RTCS (sizeof(RTC_Table)/sizeof(rtc_tbl))
-
-unsigned long RTC_Count = NUM_RTCS;
-
-rtems_device_minor_number RTC_Minor;
-
-/*
- * Hopefully, by checking the card resource register, this BSP
- * will be able to operate on the DMV171, DMV176, or DMV177.
- */
-
-boolean dmv177_icm7170_probe(int minor)
-{
- volatile unsigned16 *card_resource_reg;
- unsigned16 v;
-
- card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG;
-
- v = *card_resource_reg & DMV170_RTC_INST_MASK;
-
- if ( v == DMV170_RTC_INSTALLED )
- return TRUE;
-
- return FALSE;
-}
-
diff --git a/c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c b/c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c
deleted file mode 100644
index aa44aa66bf..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * This file contains the RTC driver table for the DY-4 DMV177.
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#include <libchip/rtc.h>
-#include <libchip/icm7170.h>
-
-/*
- * Configuration specific probe routines
- *
- * NOTE: There are no DMV177 specific configuration routines. These
- * routines could be written to dynamically determine what type
- * of real-time clock is on this board. This would be useful for
- * a BSP supporting multiple board models.
- */
-
-/* NONE CURRENTLY PROVIDED */
-
-/*
- * The following table configures the RTC drivers used in this BSP.
- *
- * The first entry which, when probed, is available, will be named /dev/rtc,
- * all others being given the name indicated.
- */
-
-boolean dmv177_icm7170_probe(int minor);
-
-rtc_tbl RTC_Table[] = {
- {
- "/dev/rtc0", /* sDeviceName */
- RTC_ICM7170, /* deviceType */
- &icm7170_fns, /* pDeviceFns */
- dmv177_icm7170_probe, /* deviceProbe */
- (void *) ICM7170_AT_1_MHZ, /* pDeviceParams */
- DMV170_RTC_ADDRESS, /* ulCtrlPort1 */
- NULL, /* ulDataPort */
- icm7170_get_register_8, /* getRegister */
- icm7170_set_register_8, /* setRegister */
- }
-};
-
-/*
- * Declare some information used by the RTC driver
- */
-
-#define NUM_RTCS (sizeof(RTC_Table)/sizeof(rtc_tbl))
-
-unsigned long RTC_Count = NUM_RTCS;
-
-rtems_device_minor_number RTC_Minor;
-
-/*
- * Hopefully, by checking the card resource register, this BSP
- * will be able to operate on the DMV171, DMV176, or DMV177.
- */
-
-boolean dmv177_icm7170_probe(int minor)
-{
- volatile unsigned16 *card_resource_reg;
- unsigned16 v;
-
- card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG;
-
- v = *card_resource_reg & DMV170_RTC_INST_MASK;
-
- if ( v == DMV170_RTC_INSTALLED )
- return TRUE;
-
- return FALSE;
-}
-
diff --git a/c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in
deleted file mode 100644
index 7119536c6a..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# We only build the networking device driver if HAS_NETWORKING was defined
-NETWORKING_DRIVER_yes_V = sonic
-NETWORKING_DRIVER = $(NETWORKING_DRIVER_$(HAS_NETWORKING)_V)
-
-# pieces specific to this BSP
-BSP_PIECES=startup clock console scv64 timer tod $(NETWORKING_DRIVER)
-
-# pieces to pick up out of libcpu/$(RTEMS_CPU)
-CPU_PIECES=
-
-# shared pieces
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(CPU_PIECES), \
- ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), \
- ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/powerpc/helas403/Makefile.in b/c/src/lib/libbsp/powerpc/helas403/Makefile.in
deleted file mode 100644
index 99994ff82d..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SRCS=README
-
-all: $(SRCS)
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include dlentry flashentry startup wrapup
diff --git a/c/src/lib/libbsp/powerpc/helas403/README b/c/src/lib/libbsp/powerpc/helas403/README
deleted file mode 100644
index 38523385b4..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/README
+++ /dev/null
@@ -1,106 +0,0 @@
-#
-# $Id$
-#
-
-BSP NAME: helas403
-BOARD: IMD, helas-ppc
-BUS: N/A
-CPU FAMILY: ppc
-CPU: PowerPC 403GA
-COPROCESSORS: N/A
-MODE: 32 bit mode
-
-DEBUG MONITOR: Modified Motorola FBUG
-
-PERIPHERALS
-===========
-TIMERS: 403GA internal
- RESOLUTION: .04 microseconds
-SERIAL PORTS: 403GA internal
-REAL-TIME CLOCK: 403GA internal
-DMA: 403GA internal
-VIDEO: none
-SCSI: none
-NETWORKING: none
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: 403GA internal
-IOSUPP DRIVER: N/A
-SHMSUPP: N/A
-TIMER DRIVER: 403GA internal
-TTY DRIVER: 403GA internal
-
-STDIO
-=====
-PORT: Console port 0
-ELECTRICAL: RS-232
-BAUD: 9600
-BITS PER CHARACTER: 8
-PARITY: None
-STOP BITS: 1
-
-Notes
-=====
-
-Board description
------------------
-clock rate: 25 MHz
-bus width: 8-bit PROM, 32-bit DRAM
-ROM: Up to 512KByte (Am29F040), 90 nsec chip select 0
-RAM: 4 to 32 MByte DRAM SIMM (autodetect), 70 nsec,
- no parity, at CS7 or CS6+CS7 (for two-bank-SIMMs)
-
-
-helas403 only supports single processor operations.
-
-Porting
--------
-This board support package is written for a typical PPC403GA
-system. The rough features of this board are described above.
-
-This BSP contains files for two startup methods:
-- Direct start from Flash after powerup (with code run out of flash):
- This is the default configuration, it uses the files
- flashentry/flashentry.s
- startup/linkcmds
-
- Please note, that this configuration is good to startup the system,
-but it will not gain maximum performance due to slow Flash access (8
-bit wide only)
-
-- Start after software download into DRAM:
- This configuration will use:
- dlentry/dlentry.s
- startup/linkcmds.dl
-
-If you want to use the download configuration, it is sufficient to
-rename the file "startup/linkcmds.dl" to "startup/linkcmds", it will
-automatically reference the dlentry.s as entry code. (Renaming is not
-quite elegant, a more sophisticated solution will follow in future,
-any hints welcome ;-)
-
-For adapting this BSP to other boards, the following files should be
-modified:
-
-- c/src/lib/libbsp/powerpc/helas403/flashentry/flashentry.s
- for the memory controller configuration and other basic stuff
-
-- c/src/lib/libbsp/powerpc/helas403/startup/linkcmds[.dl]
- for the memory layout required
-
-- c/src/lib/libbsp/powerpc/helas403/startup/bspstart.c
- for adaption of BSP_Configuration. here you can select
- the clock source for the timers and the serial interface
- (system clock or external clock pin), the clock rates, initial
- baud rate and other stuff
-
-- c/src/lib/libbsp/powerpc/helas403/include/bsp.h
- some BSP-related constants
-
-The actual drivers are placed in
-- c/src/lib/libcpu/powerpc/ppc403/*
- well, they should be generic, so there _should_ be no reason
- to mess around there (but who knows...)
-
-
diff --git a/c/src/lib/libbsp/powerpc/helas403/bsp_specs b/c/src/lib/libbsp/powerpc/helas403/bsp_specs
deleted file mode 100644
index c08f0a293b..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: ecrti%O%s --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: } \
-%{qrtems_debug: }}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -u __vectors -u flash_entry -N }
-
diff --git a/c/src/lib/libbsp/powerpc/helas403/bsp_specs.dl b/c/src/lib/libbsp/powerpc/helas403/bsp_specs.dl
deleted file mode 100644
index 24804479a0..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/bsp_specs.dl
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: ecrti%O%s --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: } \
-%{qrtems_debug: }}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -u __vectors -u download_entry -N }
-
diff --git a/c/src/lib/libbsp/powerpc/helas403/dlentry/Makefile.in b/c/src/lib/libbsp/powerpc/helas403/dlentry/Makefile.in
deleted file mode 100644
index dc40c405f6..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/dlentry/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/dlentry.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=dlentry
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/powerpc/helas403/dlentry/dlentry.s b/c/src/lib/libbsp/powerpc/helas403/dlentry/dlentry.s
deleted file mode 100644
index 3944d2bc47..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/dlentry/dlentry.s
+++ /dev/null
@@ -1,144 +0,0 @@
-/* dlentry.s
- *
- * This file contains the entry code for RTEMS programs starting
- * after download to RAM
- *
- * Author: Thomas Doerfler <td@imd.m.isar.de>
- * IMD Ingenieurbuero fuer Microcomputertechnik
- *
- * COPYRIGHT (c) 1998 by IMD
- *
- * Changes from IMD are covered by the original distributions terms.
- * This file has been derived from the papyrus BSP:
- *
- * This file contains the entry veneer for RTEMS programs
- * downloaded to Papyrus.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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$
- */
-
-#include "asm.h"
-
-/*
- * The helas403 ELF link scripts support three special sections:
- * .entry The actual entry point
- * .vectors The section containing the interrupt entry veneers.
- */
-
-/*
- * Downloaded code loads the vectors separately to 0x00000100,
- * so .entry can be over 256 bytes.
- *
- * The other sections are linked in the following order:
- * .entry
- * .text
- * .data
- * .bss
- * see linker command file for section placement
- *
- * The initial stack is set to stack.end
- *
- * All the entry veneer has to do is to clear the BSS.
- */
-
-/*
- * GDB likes to have debugging information for the entry veneer.
- * Here was some DWARF information. IMD removed it, because we
- * could not check, whether it was still correct. Sorry.
-
- */
-
-#if PPC_ASM == PPC_ASM_ELF
- .section .entry
-#else
- .csect .text[PR]
-#endif
-
- PUBLIC_VAR (download_entry)
-SYM(download_entry):
- bl .startup
-base_addr:
-
-/*---------------------------------------------------------------------------
- * Parameters from linker
- *--------------------------------------------------------------------------*/
-toc_pointer:
-#if PPC_ASM == PPC_ASM_ELF
- .long s.got
-#else
- .long TOC[tc0]
-#endif
-bss_length:
- .long bss.size
-bss_addr:
- .long bss.start
-stack_top:
- .long stack.end
-/*---------------------------------------------------------------------------
- * Reset_entry.
- *--------------------------------------------------------------------------*/
-.startup:
- /* Get start address, stack grows down from here... */
- mflr r1
-
- /* Assume Bank regs set up..., cache etc. */
- bl bssclr
-
- .extern SYM(__vectors)
-
- lis r2,__vectors@h /* set EVPR exc. vector prefix */
- mtspr evpr,r2
-
- /*-------------------------------------------------------------------
- * C_setup.
- *------------------------------------------------------------------*/
- lwz r2,toc_pointer-base_addr(r1) /* set r2 to toc */
- lwz r1,stack_top-base_addr(r1) /* set r1 to stack_top */
-
- addi r1,r1,-56-4 /* start stack at text_addr - 56 */
- addi r3,r0,0x0 /* clear r3 */
- stw r3, 0(r1) /* Clear stack chain */
- stw r3, 4(r1)
- stw r3, 8(r1)
- stw r3, 12(r1)
- .extern SYM (boot_card)
- b SYM (boot_card) /* call the first C routine */
-
-/*---------------------------------------------------------------------------
- * bssclr.
- *--------------------------------------------------------------------------*/
-bssclr:
- /*-------------------------------------------------------------------
- * Data move finished, zero out bss.
- *------------------------------------------------------------------*/
- lwz r2,bss_addr-base_addr(r1) /* start of bss set by loader */
- lwz r3,bss_length-base_addr(r1) /* bss length */
- rlwinm. r3,r3,30,0x3FFFFFFF /* form length/4 */
- beqlr /* no bss */
- mtctr r3 /* set ctr reg */
- xor r6,r6,r6 /* r6 = 0 */
-clear_bss:
- stswi r6,r2,0x4 /* store r6 */
- addi r2,r2,0x4 /* update r2 */
- bdnz clear_bss /* decrement counter and loop */
- blr /* return */
-.L_text_e:
-
-#if PPC_ABI == PPC_ABI_POWEROPEN
- DESCRIPTOR (startup)
-#endif
diff --git a/c/src/lib/libbsp/powerpc/helas403/flashentry/Makefile.in b/c/src/lib/libbsp/powerpc/helas403/flashentry/Makefile.in
deleted file mode 100644
index 683f996472..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/flashentry/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/flashentry.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=flashentry
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/powerpc/helas403/flashentry/flashentry.s b/c/src/lib/libbsp/powerpc/helas403/flashentry/flashentry.s
deleted file mode 100644
index 133e64e650..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/flashentry/flashentry.s
+++ /dev/null
@@ -1,469 +0,0 @@
-/* flashentry.s
- *
- * This file contains the entry code for RTEMS programs starting
- * directly from Flash.
- *
- * Author: Thomas Doerfler <td@imd.m.isar.de>
- * IMD Ingenieurbuero fuer Microcomputertechnik
- *
- * COPYRIGHT (c) 1998 by IMD
- *
- * Changes from IMD are covered by the original distributions terms.
- * This file has been derived from the papyrus BSP:
- *
- * This file contains the entry veneer for RTEMS programs
- * stored in Papyrus' flash ROM.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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$
- */
-
-#include "asm.h"
-#include <rtems/score/ppc.h>
-
-/*----------------------------------------------------------------------------
- * Reset_entry.
- *---------------------------------------------------------------------------*/
-#if PPC_ASM == PPC_ASM_ELF
- .section .reset,"ax",@progbits
- /* this section MUST be located at absolute address 0xFFFFFFFC
- or last word of EPROM */
-#else
- .csect .text[PR]
-#endif
-
- ba flash_entry /* this is the first instruction after reset */
-
- .previous
-
-/*----------------------------------------------------------------------------
- * ROM Vector area.
- *---------------------------------------------------------------------------*/
-#if PPC_ASM == PPC_ASM_ELF
- .section .entry,"ax",@progbits
-#else
- .csect .text[PR]
-#endif
- PUBLIC_VAR (flash_entry)
-SYM (flash_entry):
- bl .startup /* call startup, link reg points to base_addr */
-base_addr:
-/*----------------------------------------------------------------------------
- * Parameters from linker
- *---------------------------------------------------------------------------*/
-toc_pointer:
-#if PPC_ASM == PPC_ASM_ELF
- .long s.got
-#else
- .long TOC[tc0]
-#endif
-text_length:
- .long text.size
-text_addr:
- .long text.start
-copy_src:
- .long copy.src
-copy_length:
- .long copy.size
-copy_dest:
- .long copy.dest
-bss_length:
- .long bss.size
-bss_addr:
- .long bss.start
-stack_top:
- .long stack.end
-
-/*----------------------------------------------------------------------------
- * from Reset_entry.
- *---------------------------------------------------------------------------*/
-.startup:
- /* Get start address, r1 points to label base_addr */
- mflr r1
-
- /* Set up Bank regs, cache etc. */
- /* set up bank register BR0 for Flash-EPROM:
- * NOTE: bank size should stay 1MByte, this is standard size
- * after RESET
- * base addr = Fffxxxxx -> 0b11111111........................
- * bank size = 1 MByte -> 0b........000..................... (std)
- * bank use = readonly -> 0b...........01...................
- * seq. fill = targ frst-> 0b.............0..................
- * burst mode= enable -> 0b..............1.................
- * bus width = 8 bit -> 0b...............00...............
- * ready pin = disable -> 0b.................0..............
- * first wait= 2 clocks -> 0b..................0010..........
- * burst wait= 2 clocks -> 0b......................10........
- * CSon time = 0 clocks -> 0b........................0.......
- * OEon time = 0 clocks -> 0b.........................0......
- * WBon time = 1 clocks -> 0b..........................1.....
- * WBoff time= 0 clocks -> 0b...........................0....
- * Hold time = 1 clocks -> 0b............................001.
- * ram type = SRAM(ign)-> 0b...............................1
- * value 0b11111111000010100000101000100011
- * 0x F F 0 A 0 A 2 3
- */
- lis r2,0xFF0A
- ori r2,r2,0x0A23
-
- mtdcr br0,r2 /* write to DCR BR0 */
-
-
- /*--------------------------------------------------------------------
- * test various RAM configurations (from big to small per bank)
- *------------------------------------------------------------------*/
- /*--------------------------------------------------------------------
- * test RAM config 16 MByte (1x4Mx32Bit)
- *------------------------------------------------------------------*/
- /* set up bank register BR7 for DRAM:
- * base addr = 000xxxxx -> 0b00000000........................
- * bank size = 16MByte -> 0b........100.....................
- * bank use = readwrite-> 0b...........11...................
- * seq. fill = targ.frst-> 0b.............0..................
- * early RAS = disabled -> 0b..............0.................
- * bus width = 32bit -> 0b...............10...............
- * adr mux = internal -> 0b.................0..............
- * RAS to CAS= 2 clocks -> 0b..................1.............
- * Alt. Rfrsh= normal -> 0b...................0............
- * page mode = enabled -> 0b....................1...........
- * first wait= 1 clocks -> 0b.....................01.........
- * burst wait= 1 clocks -> 0b.......................01.......
- * precharge = 1 clocks -> 0b.........................0......
- * RAS Rfrsh = 2 clocks -> 0b..........................1.....
- * Rfrsh Itvl= 512 clks -> 0b...........................1000.
- * ram type = DRAM -> 0b...............................0
- * value 0b00000000100110010010101010110000
- * 0x 0 0 9 9 2 A B 0
- */
- lis r2,0x0099
- ori r2,r2,0x2AB0
- mtdcr br7,r2 /* write to DCR BR7*/
-
- lis r2,0x0000 /* start address = 0x00000000 */
- lis r3,0x0100 /* size 16 MB = 0x01000000 */
- bl ramacc /* test memory accessibility */
- cmpi 0,0,r4,0 /* memory ok? else test smaller size */
- bne ramcfgt18
-
- /*--------------------------------------------------------------------
- * test RAM config 32 MByte (2x4Mx32Bit)
- *------------------------------------------------------------------*/
- /* set up bank register BR7 like above
- * set up bank register BR6 for DRAM:
- * base addr = 010xxxxx -> 0b00010000........................
- * bank size = 16MByte -> 0b........100..................... (for now)
- * bank use = readwrite-> 0b...........11...................
- * seq. fill = targ.frst-> 0b.............0..................
- * early RAS = disabled -> 0b..............0.................
- * bus width = 32bit -> 0b...............10...............
- * adr mux = internal -> 0b.................0..............
- * RAS to CAS= 2 clocks -> 0b..................1.............
- * Alt. Rfrsh= normal -> 0b...................0............
- * page mode = enabled -> 0b....................1...........
- * first wait= 1 clocks -> 0b.....................01.........
- * burst wait= 1 clocks -> 0b.......................01.......
- * precharge = 1 clocks -> 0b.........................0......
- * RAS Rfrsh = 2 clocks -> 0b..........................1.....
- * Rfrsh Itvl= 512 clks -> 0b...........................1000.
- * ram type = DRAM -> 0b...............................0
- * value 0b00010000100110010010101010110000
- * 0x 1 0 9 9 2 A B 0
- */
- lis r2,0x1099
- ori r2,r2,0x2AB0
- mtdcr br6,r2 /* write to DCR BR6*/
-
- lis r2,0x0100 /* start address = 0x01000000 */
- lis r3,0x0100 /* size 16 MB = 0x01000000 */
- bl ramacc /* test memory accessibility */
- cmpi 0,0,r4,0 /* memory ok? else test smaller size */
- beq ramcfgok /* ok, we found configuration... +/
-
- lis r2,0x0000 /* disable BR6, config not ok */
- mtdcr br6,r2 /* write to DCR BR6*/
- b ramcfgok /* and finish configuration */
-
-ramcfgt18:
- /*--------------------------------------------------------------------
- * test RAM config 8 MByte (1x2Mx32Bit)
- *------------------------------------------------------------------*/
- /* set up bank register BR7 for DRAM:
- * base addr = 000xxxxx -> 0b00000000........................
- * bank size = 8MByte -> 0b........011.....................
- * bank use = readwrite-> 0b...........11...................
- * seq. fill = targ.frst-> 0b.............0..................
- * early RAS = disabled -> 0b..............0.................
- * bus width = 32bit -> 0b...............10...............
- * adr mux = internal -> 0b.................0..............
- * RAS to CAS= 2 clocks -> 0b..................1.............
- * Alt. Rfrsh= normal -> 0b...................0............
- * page mode = enabled -> 0b....................1...........
- * first wait= 1 clocks -> 0b.....................01.........
- * burst wait= 1 clocks -> 0b.......................01.......
- * precharge = 1 clocks -> 0b.........................0......
- * RAS Rfrsh = 2 clocks -> 0b..........................1.....
- * Rfrsh Itvl= 512 clks -> 0b...........................1000.
- * ram type = DRAM -> 0b...............................0
- * value 0b00000000011110010010101010110000
- * 0x 0 0 7 9 2 A B 0
- */
- lis r2,0x0079
- ori r2,r2,0x2AB0
- mtdcr br7,r2 /* write to DCR BR7 */
-
- lis r2,0x0000 /* start address = 0x00000000 */
- lis r3,0x0080 /* size 8 MB = 0x00800000 */
- bl ramacc /* test memory accessibility */
- cmpi 0,0,r4,0 /* memory ok? else test smaller size */
- bne ramcfgt14
-
- /*--------------------------------------------------------------------
- * test RAM config 16 MByte (2x2Mx32Bit)
- *------------------------------------------------------------------*/
- /* set up bank register BR7 like above
- * set up bank register BR6 for DRAM:
- * base addr = 008xxxxx -> 0b00001000........................
- * bank size = 08MByte -> 0b........011..................... (for now)
- * bank use = readwrite-> 0b...........11...................
- * seq. fill = targ.frst-> 0b.............0..................
- * early RAS = disabled -> 0b..............0.................
- * bus width = 32bit -> 0b...............10...............
- * adr mux = internal -> 0b.................0..............
- * RAS to CAS= 2 clocks -> 0b..................1.............
- * Alt. Rfrsh= normal -> 0b...................0............
- * page mode = enabled -> 0b....................1...........
- * first wait= 1 clocks -> 0b.....................01.........
- * burst wait= 1 clocks -> 0b.......................01.......
- * precharge = 1 clocks -> 0b.........................0......
- * RAS Rfrsh = 2 clocks -> 0b..........................1.....
- * Rfrsh Itvl= 512 clks -> 0b...........................1000.
- * ram type = DRAM -> 0b...............................0
- * value 0b00001000011110010010101010110000
- * 0x 0 8 7 9 2 A B 0
- */
- lis r2,0x0879
- ori r2,r2,0x2AB0
- mtdcr br6,r2 /* write to DCR BR6*/
-
- lis r2,0x0080 /* start address = 0x00800000 */
- lis r3,0x0080 /* size 8 MB = 0x00800000 */
- bl ramacc /* test memory accessibility */
- cmpi 0,0,r4,0 /* memory ok? else test smaller size */
- beq ramcfgok /* ok, we found configuration... +/
-
- lis r2,0x0000 /* disable BR6, config not ok */
- mtdcr br6,r2 /* write to DCR BR6*/
- b ramcfgok /* and finish configuration */
-
-ramcfgt14:
- /*--------------------------------------------------------------------
- * test RAM config 4 MByte (1x1Mx32Bit)
- *------------------------------------------------------------------*/
- /* set up bank register BR7 for DRAM:
- * base addr = 000xxxxx -> 0b00000000........................
- * bank size = 4MByte -> 0b........010.....................
- * bank use = readwrite-> 0b...........11...................
- * seq. fill = targ.frst-> 0b.............0..................
- * early RAS = disabled -> 0b..............0.................
- * bus width = 32bit -> 0b...............10...............
- * adr mux = internal -> 0b.................0..............
- * RAS to CAS= 2 clocks -> 0b..................1.............
- * Alt. Rfrsh= normal -> 0b...................0............
- * page mode = enabled -> 0b....................1...........
- * first wait= 1 clocks -> 0b.....................01.........
- * burst wait= 1 clocks -> 0b.......................01.......
- * precharge = 1 clocks -> 0b.........................0......
- * RAS Rfrsh = 2 clocks -> 0b..........................1.....
- * Rfrsh Itvl= 512 clks -> 0b...........................1000.
- * ram type = DRAM -> 0b...............................0
- * value 0b00000000010110010010101010110000
- * 0x 0 0 5 9 2 A B 0
- */
- /*
- * FIXME: this is the minimum size supported, should test and
- * report error, when failed
- */
- lis r2,0x0059
- ori r2,r2,0x2AB0
- mtdcr br7,r2 /* write to DCR BR7*/
-
- /*--------------------------------------------------------------------
- * test RAM config 8 MByte (2x1Mx32Bit)
- *------------------------------------------------------------------*/
- /* set up bank register BR7 like above
- * set up bank register BR6 for DRAM:
- * base addr = 004xxxxx -> 0b00000100........................
- * bank size = 4MByte -> 0b........010..................... (for now)
- * bank use = readwrite-> 0b...........11...................
- * seq. fill = targ.frst-> 0b.............0..................
- * early RAS = disabled -> 0b..............0.................
- * bus width = 32bit -> 0b...............10...............
- * adr mux = internal -> 0b.................0..............
- * RAS to CAS= 2 clocks -> 0b..................1.............
- * Alt. Rfrsh= normal -> 0b...................0............
- * page mode = enabled -> 0b....................1...........
- * first wait= 1 clocks -> 0b.....................01.........
- * burst wait= 1 clocks -> 0b.......................01.......
- * precharge = 1 clocks -> 0b.........................0......
- * RAS Rfrsh = 2 clocks -> 0b..........................1.....
- * Rfrsh Itvl= 512 clks -> 0b...........................1000.
- * ram type = DRAM -> 0b...............................0
- * value 0b00000100010110010010101010110000
- * 0x 0 4 5 9 2 A B 0
- */
- lis r2,0x0459
- ori r2,r2,0x2AB0
- mtdcr br6,r2 /* write to DCR BR6*/
-
- lis r2,0x0040 /* start address = 0x00400000 */
- lis r3,0x0040 /* size 4 MB = 0x00400000 */
- bl ramacc /* test memory accessibility */
- cmpi 0,0,r4,0 /* memory ok? else test smaller size */
- beq ramcfgok /* ok, we found configuration... +/
-
- lis r2,0x0000 /* disable BR6, config not ok */
- mtdcr br6,r2 /* write to DCR BR6*/
- b ramcfgok /* and finish configuration */
-
-ramcfgok:
- /*--------------------------------------------------------------------
- * init the DRAM where STACK+ DATA+ BBS will be placed. If this is OK
- * we will return here.
- *-------------------------------------------------------------------*/
- bl rom2ram
-
- /* clear caches */
- addi r2,0,PPC_I_CACHE/PPC_CACHE_ALIGNMENT
- mtctr r2 /* count the loops needed... */
- xor r2,r2,r2 /* start at adr zero */
-icinvlp:
- iccci 0,r2
- addi r2,r2,PPC_CACHE_ALIGNMENT
- bdnz icinvlp
-
- addi r2,r0,PPC_D_CACHE/PPC_CACHE_ALIGNMENT
- mtctr r2 /* count the loops needed... */
- xor r2,r2,r2 /* start at adr 0 */
-dcinvlp:
- dccci 0,r2
- addi r2,r2,PPC_CACHE_ALIGNMENT
- bdnz dcinvlp
- /*--------------------------------------------------------------------
- * Enable two 128MB cachable regions.
- * FEPROM is cachable at 0xFFF00000..0xFFFFFFFF
- * DRAM is cachable at 0x00000000..0x00FFFFFF
- * FEPROM is noncachable at 0x7FF00000..0x7FFFFFFF
- * DRAM is noncachable at 0x80000000..0x80FFFFFF
- *-------------------------------------------------------------------*/
- addis r2,r0,0x8000
- addi r2,r2,0x0001
-
- mtspr iccr, r2 /* ICCR */
- mtspr dccr, r2 /* DCCR */
-
- .extern SYM(__vectors)
-
- lis r2,__vectors@h /* set EVPR exc. vector prefix */
- mtspr evpr,r2
-
- lis r2,0x0000
- ori r2,r2,0x0000
- mtmsr r2 /* set default msr */
- lis r2,0x0000 /* do not allow critical IRQ */
- ori r2,r2,0x0000
- mtdcr exier, r2 /* disable all external IRQs */
-
- addi r2,r0,-1 /* r2 = 0xffffffff */
- mtdcr exisr, r2 /* clear all pendingdisable IRQs */
-
- /*--------------------------------------------------------------------
- * C_setup.
- *-------------------------------------------------------------------*/
-
- lwz r2,toc_pointer-base_addr(r1) /* set r2 to toc */
- lwz r1,stack_top-base_addr(r1) /* set r1 to stack_top */
-
- addi r1,r1,-56 /* start stack at data_addr - 56 */
- addi r3,r0,0x0 /* clear r3 */
- stw r3, 0(r1) /* Clear stack chain */
- stw r3, 4(r1)
- stw r3, 8(r1)
- stw r3, 12(r1)
- .extern SYM (boot_card)
- b SYM (boot_card) /* call the first C routine */
-
-/*----------------------------------------------------------------------------
- * Rom2ram.
- *---------------------------------------------------------------------------*/
-rom2ram:
- lwz r2,copy_dest-base_addr(r1) /* start of data set by loader */
- lwz r3,copy_length-base_addr(r1) /* data length */
- rlwinm r3,r3,30,0x3FFFFFFF /* form length/4 */
- mtctr r3 /* set ctr reg */
- /*--------------------------------------------------------------------
- * Calculate offset of data in image.
- *-------------------------------------------------------------------*/
- lwz r4,copy_src-base_addr(r1) /* get start of copy area */
-move_data:
- lswi r6,r4,0x4 /* load r6 */
- stswi r6,r2,0x4 /* store r6 */
- addi r4,r4,0x4 /* update r4 */
- addi r2,r2,0x4 /* update r2 */
- bdnz move_data /* decrement counter and loop */
- /*--------------------------------------------------------------------
- * Data move finished, zero out bss.
- *-------------------------------------------------------------------*/
- lwz r2,bss_addr-base_addr(r1) /* start of bss set by loader */
- lwz r3,bss_length-base_addr(r1) /* bss length */
- rlwinm. r3,r3,30,0x3FFFFFFF /* form length/4 */
- beqlr /* no bss */
- mtctr r3 /* set ctr reg */
- xor r6,r6,r6 /* r6 = 0 */
-clear_bss:
- stswi r6,r2,0x4 /* store r6 */
- addi r2,r2,0x4 /* update r2 */
- bdnz clear_bss /* decrement counter and loop */
- blr /* return */
-
-/*----------------------------------------------------------------------------
- * ramacc test accessibility of RAM
- * input: r2 = start address, r3 = length (in byte)
- * output: r4 = 0 -> ok, !=0 -> fail
- *---------------------------------------------------------------------------*/
-ramacc:
- xor r4,r4,r4 /* r4 = 0 */
- stw r4,0(r2) /* init ram at start address */
- addi r4,r0,0x04 /* set start shift */
-ramaccf1:
- cmp 0,0,r4,r3 /* compare with length */
- bge ramaccfx /* r4 >= r3? then finished */
- add r5,r4,r2 /* get next address to fill */
- stw r4,0(r5) /* store new pattern */
- add r4,r4,r4 /* r4 = r4*2 */
- b ramaccf1 /* and then next loop */
-
-ramaccfx:
- lwz r4,0(r2) /* get memory at start adr */
- blr
-
-
-#if PPC_ABI == PPC_ABI_POWEROPEN
- DESCRIPTOR (startup)
-#endif
-
-
-
diff --git a/c/src/lib/libbsp/powerpc/helas403/include/Makefile.in b/c/src/lib/libbsp/powerpc/helas403/include/Makefile.in
deleted file mode 100644
index 096f514e64..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/include/Makefile.in
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
-
-install: all
diff --git a/c/src/lib/libbsp/powerpc/helas403/include/bsp.h b/c/src/lib/libbsp/powerpc/helas403/include/bsp.h
deleted file mode 100644
index 3b9e1b1227..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/include/bsp.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* bsp.h
- *
- * This include file contains all HELAS-403 board IO definitions.
- *
- * Author: Thomas Doerfler <td@imd.m.isar.de>
- * IMD Ingenieurbuero fuer Microcomputertechnik
- *
- * COPYRIGHT (c) 1998 by IMD
- *
- * Changes from IMD are covered by the original distributions terms.
- * This file has been derived from the papyrus BSP.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/lib/libbsp/no_cpu/no_bsp/include/bsp.h
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __HELAS403_h
-#define __HELAS403_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef ASM
-/* Definition of where to store registers in alignment handler */
-#define ALIGN_REGS 0x0140
-
-#else
-#include <rtems.h>
-#include <console.h>
-#include <clockdrv.h>
-#include <console.h>
-#include <iosupp.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-
-/*
- * Stuff for Time Test 27
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), PPC_IRQ_SCALL, 1 )
-
-#define Cause_tm27_intr() asm volatile ("sc")
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/* Constants */
-
-#define RAM_START 0
-#define RAM_END 0x00800000
-
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration; /* owned by BSP */
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* functions */
-
-rtems_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-);
-#endif /* ASM */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/powerpc/helas403/include/coverhd.h b/c/src/lib/libbsp/powerpc/helas403/include/coverhd.h
deleted file mode 100644
index fce47a9df6..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/include/coverhd.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- * This file should be updated after running the C overhead timing
- * test. Once this update has been performed, the RTEMS Time Test
- * Suite should be rebuilt to account for these overhead times in the
- * timing results.
- *
- * NOTE: If these are all zero, then the times reported include
- * all calling overhead including passing of arguments.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Updated for a 25MHz Papyrus by Andrew Bray <andy@i-cubed.co.uk>
- *
- * Units are 100ns.
- *
- * These numbers are of questionable use, as they are developed by calling
- * the routine many times, thus getting its entry veneer into the (small)
- * cache on the 403GA. This in general is not true of the RTEMS timing
- * tests, which usually call a routine only once, thus having no cache loaded
- * advantage.
- *
- * Whether the directive times are useful after deducting the function call
- * overhead is also questionable. The user is more interested generally
- * in the total cost of a directive, not the cost if the procedure call
- * is inlined! (In general this is not true).
- *
- * Andrew Bray 18/08/1995
- *
- */
-
-#ifndef __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 1
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 1
-#define CALLING_OVERHEAD_TASK_CREATE 3
-#define CALLING_OVERHEAD_TASK_IDENT 1
-#define CALLING_OVERHEAD_TASK_START 1
-#define CALLING_OVERHEAD_TASK_RESTART 1
-#define CALLING_OVERHEAD_TASK_DELETE 1
-#define CALLING_OVERHEAD_TASK_SUSPEND 1
-#define CALLING_OVERHEAD_TASK_RESUME 1
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 1
-#define CALLING_OVERHEAD_TASK_MODE 1
-#define CALLING_OVERHEAD_TASK_GET_NOTE 1
-#define CALLING_OVERHEAD_TASK_SET_NOTE 1
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 4
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 1
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 1
-#define CALLING_OVERHEAD_CLOCK_GET 4
-#define CALLING_OVERHEAD_CLOCK_SET 3
-#define CALLING_OVERHEAD_CLOCK_TICK 1
-
-#define CALLING_OVERHEAD_TIMER_CREATE 1
-#define CALLING_OVERHEAD_TIMER_IDENT 1
-#define CALLING_OVERHEAD_TIMER_DELETE 1
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 2
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 5
-#define CALLING_OVERHEAD_TIMER_RESET 1
-#define CALLING_OVERHEAD_TIMER_CANCEL 1
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 2
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 1
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 1
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 1
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 1
-
-#define CALLING_OVERHEAD_EVENT_SEND 1
-#define CALLING_OVERHEAD_EVENT_RECEIVE 2
-#define CALLING_OVERHEAD_SIGNAL_CATCH 1
-#define CALLING_OVERHEAD_SIGNAL_SEND 1
-#define CALLING_OVERHEAD_PARTITION_CREATE 3
-#define CALLING_OVERHEAD_PARTITION_IDENT 1
-#define CALLING_OVERHEAD_PARTITION_DELETE 1
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 1
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 1
-#define CALLING_OVERHEAD_REGION_CREATE 3
-#define CALLING_OVERHEAD_REGION_IDENT 1
-#define CALLING_OVERHEAD_REGION_DELETE 1
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 2
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 1
-#define CALLING_OVERHEAD_PORT_CREATE 2
-#define CALLING_OVERHEAD_PORT_IDENT 1
-#define CALLING_OVERHEAD_PORT_DELETE 1
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 1
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 2
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 2
-#define CALLING_OVERHEAD_IO_OPEN 2
-#define CALLING_OVERHEAD_IO_CLOSE 2
-#define CALLING_OVERHEAD_IO_READ 2
-#define CALLING_OVERHEAD_IO_WRITE 2
-#define CALLING_OVERHEAD_IO_CONTROL 2
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 1
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 1
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/powerpc/helas403/startup/Makefile.in b/c/src/lib/libbsp/powerpc/helas403/startup/Makefile.in
deleted file mode 100644
index aa59a2c153..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/startup/Makefile.in
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/powerpc/helas403/startup/bspclean.c b/c/src/lib/libbsp/powerpc/helas403/startup/bspclean.c
deleted file mode 100644
index e18aa7d381..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/startup/bspclean.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine normally is part of start.s and usually returns
- * control to a monitor.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/lib/libbsp/no_cpu/no_bsp/startup/bspclean.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-void bsp_cleanup( void )
-{
- rtems_fatal_error_occurred(0);
-}
diff --git a/c/src/lib/libbsp/powerpc/helas403/startup/bspstart.c b/c/src/lib/libbsp/powerpc/helas403/startup/bspstart.c
deleted file mode 100644
index b095ba6595..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/startup/bspstart.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/* bsp_start()
- *
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * Author: Thomas Doerfler <td@imd.m.isar.de>
- * IMD Ingenieurbuero fuer Microcomputertechnik
- *
- * COPYRIGHT (c) 1998 by IMD
- *
- * Changes from IMD are covered by the original distributions terms.
- * This file has been derived from the papyrus BSP:
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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.
- *
- * Modifications for spooling console driver and control of memory layout
- * with linker command file by
- * Thomas Doerfler <td@imd.m.isar.de>
- * for these modifications:
- * COPYRIGHT (c) 1997 by IMD, Puchheim, Germany.
- *
- * 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. IMD makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c:
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * This material may be reproduced by or for the U.S. Government pursuant
- * to the copyright license under the clause at DFARS 252.227-7013. This
- * notice must appear in all copies of this file and its derivatives.
- *
- * $Id$
- */
-
-
-#include <bsp.h>
-#include <ictrl.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-#include <fcntl.h>
-
-#ifdef STACK_CHECKER_ON
-#include <stackchk.h>
-#endif
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-void *bsp_ram_end = (void *)RAM_END; /* first addr behind avail. ram area */
-
-/* Initialize whatever libc we are using
- * called from postdriver hook
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- *
- * bsp_predriver_hook
- *
- * Before drivers are setup.
- */
-
-void bsp_predriver_hook(void)
-{
- rtems_status_code status;
- /* init the PPC403GA external interrupt controller handler... */
- status = ictrl_init();
-}
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int _end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &_end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- /*
- * Allocate the memory for the RTEMS Work Space. This can come from
- * a variety of places: hard coded address, malloc'ed from outside
- * RTEMS world (e.g. simulator or primitive memory manager), or (as
- * typically done by stock BSPs) by subtracting the required amount
- * of work space from the last physical address on the CPU board.
- */
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
- /* FIXME: this should be modified. work_space_size cannot be valid
- * now, since console_reserve_resources will modify something...
- */
- /* FIME: plan usage of RAM better:
- - make top of ram dynamic,
- - take out some part for persistant log
- - make rest of ram to heap...
- -remove RAM_END from bsp.h, this cannot be valid...
- or must be a function call
- */
- BSP_Configuration.work_space_start = (void *)
- ((char *)(bsp_ram_end)) - BSP_Configuration.work_space_size;
-
- /*
- * Account for the console's resources
- */
-
- console_reserve_resources( &BSP_Configuration );
-
- /*
- * initialize the CPU table for this BSP
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.predriver_hook = bsp_predriver_hook;
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_stack_size = 4 * 1024;
-
- Cpu_table.clicks_per_usec = 25;
- Cpu_table.serial_per_sec = 25000000;
- Cpu_table.serial_external_clock = 0;
- Cpu_table.timer_internal_clock = 1;
- Cpu_table.serial_xon_xoff = 0;
- Cpu_table.serial_cts_rts = 1;
- Cpu_table.serial_rate = 9600;
- Cpu_table.timer_average_overhead = 2;
- Cpu_table.timer_least_valid = 3;
- Cpu_table.exceptions_in_RAM = TRUE;
-}
diff --git a/c/src/lib/libbsp/powerpc/helas403/startup/linkcmds b/c/src/lib/libbsp/powerpc/helas403/startup/linkcmds
deleted file mode 100644
index b2feeaacb0..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/startup/linkcmds
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the helas-403
- * This file is intended to be used together with flashentry.s
- * it will generate a ROM that can be started directly after powerup reset
- * $Id$
- */
-
-OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
- "elf32-powerpc")
-OUTPUT_ARCH(powerpc)
- SEARCH_DIR(/usr/local/powerpc-rtems/lib);
-
-ENTRY(flash_entry)
-
-MEMORY
- {
- RAM : ORIGIN = 0, LENGTH = 8M
- FLASH : ORIGIN = 0xFFF00000, LENGTH = 512K
- }
-
- /* DIRTY TRICK: repeat addresses here, so we can work with them... */
- flash.start = 0xFFF00000;
- flash.size = 512K;
-
-SECTIONS
-{
- .entry :
- {
- *(.entry)
- } > FLASH /* this is ROM for flash_entry */
- .text :
- {
- text.start = . ;
- *(.entry2)
- *(.text)
- *(.rodata)
- *(.rodata1)
- *(.descriptors)
- *(rom_ver)
- etext = ALIGN(0x10);
- _etext = .;
-
-
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
-
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
-
- *(.lit)
- *(.shdata)
- *(.init)
- *(.fini)
- . = ALIGN(0x10);
- _endtext = .;
- text.end = .;
- copy.src = .;
- copy.tmptop.txt = .;
- } > FLASH /* this is ROM for flash_entry */
-
- text.size = text.end - text.start;
-
- /* R/W Data */
- /* place vectors to start at offset 0x100... */
- /* IMPORTANT: sections ".fill" and ".vectors" must be the first in RAM!!*/
- .fill 0x00010000 :
- {
- . = . + 0x0100;
- } > RAM
-
- .vectors : AT (copy.src)
- {
- copy.dest = .;
- *(.vectors)
- . = ALIGN(0x10);
- copy.tmptop.vec = .;
- } > RAM
-
- .data : AT (copy.tmptop.vec - copy.dest + copy.src)
- {
- *(.data)
- *(.data1)
- PROVIDE (__SDATA_START__ = .);
- *(.sdata)
- . = ALIGN(0x10);
- copy.tmptop.dat = .;
- } > RAM
-
- PROVIDE (__EXCEPT_START__ = .);
- .gcc_except_table : AT (copy.tmptop.dat - copy.dest + copy.src)
- {
- *(.gcc_except_table)
- . = ALIGN(0x10);
- copy.tmptop.exc = .;
- } >RAM
- PROVIDE (__EXCEPT_END__ = .);
-
- __GOT_START__ = .;
- .got : AT (copy.tmptop.exc - copy.dest + copy.src)
- {
- s.got = .;
- *(.got.plt) *(.got)
- . = ALIGN(0x10);
- copy.tmptop.got = .;
- } > RAM
- __GOT_END__ = .;
-
- .got1 : AT (copy.tmptop.got - copy.dest + copy.src)
- {
- *(.got1)
- . = ALIGN(0x10);
- copy.tmptop.gt1 = .;
- } >RAM
-
- PROVIDE (__GOT2_START__ = .);
- PROVIDE (_GOT2_START_ = .);
- .got2 : AT (copy.tmptop.gt1 - copy.dest + copy.src)
- {
- *(.got2)
- . = ALIGN(0x10);
- copy.tmptop.gt2 = .;
- } >RAM
- PROVIDE (__GOT2_END__ = .);
- PROVIDE (_GOT2_END_ = .);
-
- PROVIDE (__FIXUP_START__ = .);
- PROVIDE (_FIXUP_START_ = .);
- .fixup : AT (copy.tmptop.gt2 - copy.dest + copy.src)
- {
- *(.fixup)
- . = ALIGN(0x10);
- copy.tmptop.fix = .;
- } >RAM
- PROVIDE (_FIXUP_END_ = .);
- PROVIDE (__FIXUP_END__ = .);
-
- PROVIDE (__SDATA2_START__ = .);
- .sdata2 : AT (copy.tmptop.fix - copy.dest + copy.src)
- {
- *(.sdata2)
- . = ALIGN(0x10);
- copy.tmptop.sda = .;
- } >RAM
-
- copy.size = copy.tmptop.sda - copy.dest;
-
- .sbss2 :
- {
- *(.sbss2)
- } >RAM
- PROVIDE (__SBSS2_END__ = .);
-
- __SBSS_START__ = .;
- .bss :
- {
- bss.start = .;
- *(.bss) *(.sbss) *(COMMON)
- bss.end = ALIGN(4);
- } > RAM
- __SBSS_END__ = .;
-
- bss.size = bss.end - bss.start;
-
- /* reserve 16KByte for stack... */
- stack.end = bss.end + 16K;
- PROVIDE(_end = stack.end);
-
- .line 0 : { *(.line) }
- .debug 0 : { *(.debug) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_aregion 0 : { *(.debug_aregion) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
-
- /*
- * place reset instruction into last word of FLASH
- * NOTE: after reset, PPC403 starts executing from address
- * 0xFFFFFFFC
- * The reset section is placed in ROM at 0xF7FFFFFC instead,
- * but a mirror of this address exists at 0xFFFFFFFC due to
- * the initial memory controller setup
- */
- .reset flash.start - 4 + flash.size :
- {
- *(.reset)
- } > FLASH
-}
-
-
diff --git a/c/src/lib/libbsp/powerpc/helas403/startup/linkcmds.dl b/c/src/lib/libbsp/powerpc/helas403/startup/linkcmds.dl
deleted file mode 100644
index 8e2128eebc..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/startup/linkcmds.dl
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the helas403
- * This file is intended to be used together with dlentry.s
- * it will generate downloadable code
- *
- * $Id$
- */
-
-OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
- "elf32-powerpc")
-OUTPUT_ARCH(powerpc)
- SEARCH_DIR(/usr/local/powerpc-rtems/lib);
-
-ENTRY(download_entry)
-
-MEMORY
- {
- RAM : ORIGIN = 0, LENGTH = 8M
- FLASH : ORIGIN = 0xFFF00000, LENGTH = 512K
- }
-
-SECTIONS
-{
- .vectors : 0x00010100
- {
- *(.vectors)
- } > RAM
-
- .text :
- {
- text.start = . ;
- *(.entry)
- *(.entry2)
- *(.text)
- *(.rodata)
- *(.rodata1)
- *(.descriptors)
- *(rom_ver)
- etext = ALIGN(0x10);
- _etext = .;
-
-
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
-
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
-
- *(.lit)
- *(.shdata)
- *(.init)
- *(.fini)
- _endtext = ALIGN(0x10);
- text.end = .;
- } > RAM
-
- text.size = text.end - text.start;
-
- /* R/W Data */
- .data :
- {
- *(.data)
- *(.data1)
- PROVIDE (__SDATA_START__ = .);
- *(.sdata)
- } > RAM
-
- PROVIDE (__EXCEPT_START__ = .);
- .gcc_except_table :
- {
- *(.gcc_except_table)
- } >RAM
- PROVIDE (__EXCEPT_END__ = .);
-
- __GOT_START__ = .;
- .got :
- {
- s.got = .;
- *(.got.plt) *(.got)
- } > RAM
- __GOT_END__ = .;
-
- .got1 :
- {
- *(.got1)
- } >RAM
-
- PROVIDE (__GOT2_START__ = .);
- PROVIDE (_GOT2_START_ = .);
- .got2 :
- {
- *(.got2)
- } >RAM
- PROVIDE (__GOT2_END__ = .);
- PROVIDE (_GOT2_END_ = .);
-
- PROVIDE (__FIXUP_START__ = .);
- PROVIDE (_FIXUP_START_ = .);
- .fixup : { *(.fixup) } >RAM
- PROVIDE (_FIXUP_END_ = .);
- PROVIDE (__FIXUP_END__ = .);
-
- PROVIDE (__SDATA2_START__ = .);
- .sdata2 : { *(.sdata2) } >RAM
- .sbss2 : { *(.sbss2) } >RAM
- PROVIDE (__SBSS2_END__ = .);
-
- .sbss2 : { *(.sbss2) } >RAM
- PROVIDE (__SBSS2_END__ = .);
-
- __SBSS_START__ = .;
- .bss :
- {
- bss.start = .;
- *(.bss) *(.sbss) *(COMMON)
- bss.end = ALIGN(4);
- } > RAM
- __SBSS_END__ = .;
-
- bss.size = bss.end - bss.start;
- PROVIDE(_end = bss.end);
-
- .line 0 : { *(.line) }
- .debug 0 : { *(.debug) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_aregion 0 : { *(.debug_aregion) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
-}
-
-
diff --git a/c/src/lib/libbsp/powerpc/helas403/startup/setvec.c b/c/src/lib/libbsp/powerpc/helas403/startup/setvec.c
deleted file mode 100644
index 0f6a676236..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/startup/setvec.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on the target Board/CPU.
- * This routine is allowed to be as board dependent as necessary.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/lib/libbsp/no_cpu/no_bsp/startup/setvec.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-rtems_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- rtems_isr_entry previous_isr;
-
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
-
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/powerpc/helas403/times b/c/src/lib/libbsp/powerpc/helas403/times
deleted file mode 100644
index da260853bf..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/times
+++ /dev/null
@@ -1,197 +0,0 @@
-#
-# Timing Test Suite Results for the Papyrus BSP
-#
-# NOTE: The Papyrus is a proprietary PPC403 based board. But it is the
-# only BSP currently available for the PowerPC family.
-#
-# $Id$
-#
-
-NOTE: This BSP is user submitted and no timing information
- is currently avaiable.
-
-Board: Papyrus
-CPU: IBM 403GA
-Clock Speed: 33 Mhz
-Memory Configuration: SRAM, DRAM, cache, etc
-Wait States:
-
-Times Reported in: cycles, microseconds, etc
-Timer Source: Count Down Timer, on-CPU cycle counter, etc
-
-Column A: unused
-Column B: unused
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 20
- rtems_semaphore_delete 21
- rtems_semaphore_obtain: available 15
- rtems_semaphore_obtain: not available -- NO_WAIT 15
- rtems_semaphore_release: no waiting tasks 16
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 62
-
- 3 rtems_semaphore_release: task readied -- preempts caller 55
-
- 4 rtems_task_restart: blocked task -- preempts caller 77
- rtems_task_restart: ready task -- preempts caller 70
- rtems_semaphore_release: task readied -- returns to caller 25
- rtems_task_create 57
- rtems_task_start 31
- rtems_task_restart: suspended task -- returns to caller 36
- rtems_task_delete: suspended task 47
- rtems_task_restart: ready task -- returns to caller 37
- rtems_task_restart: blocked task -- returns to caller 46
- rtems_task_delete: blocked task 50
-
- 5 rtems_task_suspend: calling task 51
- rtems_task_resume: task readied -- preempts caller 49
-
- 6 rtems_task_restart: calling task 59
- rtems_task_suspend: returns to caller 18
- rtems_task_resume: task readied -- returns to caller 19
- rtems_task_delete: ready task 50
-
- 7 rtems_task_restart: suspended task -- preempts caller 70
-
- 8 rtems_task_set_priority: obtain current priority 12
- rtems_task_set_priority: returns to caller 27
- rtems_task_mode: obtain current mode 5
- rtems_task_mode: no reschedule 5
- rtems_task_mode: reschedule -- returns to caller 8
- rtems_task_mode: reschedule -- preempts caller 39
- rtems_task_set_note 13
- rtems_task_get_note 13
- rtems_clock_set 33
- rtems_clock_get 3
-
- 9 rtems_message_queue_create 110
- rtems_message_queue_send: no waiting tasks 37
- rtems_message_queue_urgent: no waiting tasks 37
- rtems_message_queue_receive: available 31
- rtems_message_queue_flush: no messages flushed 12
- rtems_message_queue_flush: messages flushed 16
- rtems_message_queue_delete 26
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 15
- rtems_message_queue_receive: not available -- caller blocks 62
-
-11 rtems_message_queue_send: task readied -- preempts caller 72
-
-12 rtems_message_queue_send: task readied -- returns to caller 39
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 72
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 39
-
-15 rtems_event_receive: obtain current events 1
- rtems_event_receive: not available -- NO_WAIT 12
- rtems_event_receive: not available -- caller blocks 56
- rtems_event_send: no task readied 12
- rtems_event_receive: available 12
- rtems_event_send: task readied -- returns to caller 24
-
-16 rtems_event_send: task readied -- preempts caller 55
-
-17 rtems_task_set_priority: preempts caller 62
-
-18 rtems_task_delete: calling task 83
-
-19 rtems_signal_catch 9
- rtems_signal_send: returns to caller 15
- rtems_signal_send: signal to self 18
- exit ASR overhead: returns to calling task 22
- exit ASR overhead: returns to preempting task 49
-
-20 rtems_partition_create 35
- rtems_region_create 23
- rtems_partition_get_buffer: available 15
- rtems_partition_get_buffer: not available 13
- rtems_partition_return_buffer 18
- rtems_partition_delete 16
- rtems_region_get_segment: available 22
- rtems_region_get_segment: not available -- NO_WAIT 21
- rtems_region_return_segment: no waiting tasks 19
- rtems_region_get_segment: not available -- caller blocks 64
- rtems_region_return_segment: task readied -- preempts caller 74
- rtems_region_return_segment: task readied -- returns to caller 44
- rtems_region_delete 16
- rtems_io_initialize 2
- rtems_io_open 1
- rtems_io_close 1
- rtems_io_read 1
- rtems_io_write 1
- rtems_io_control 1
-
-21 rtems_task_ident 149
- rtems_message_queue_ident 145
- rtems_semaphore_ident 156
- rtems_partition_ident 145
- rtems_region_ident 148
- rtems_port_ident 145
- rtems_timer_ident 145
- rtems_rate_monotonic_ident 145
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 42
- rtems_message_queue_broadcast: no waiting tasks 17
- rtems_message_queue_broadcast: task readied -- preempts caller 78
-
-23 rtems_timer_create 14
- rtems_timer_fire_after: inactive 22
- rtems_timer_fire_after: active 24
- rtems_timer_cancel: active 15
- rtems_timer_cancel: inactive 13
- rtems_timer_reset: inactive 21
- rtems_timer_reset: active 23
- rtems_timer_fire_when: inactive 34
- rtems_timer_fire_when: active 34
- rtems_timer_delete: active 19
- rtems_timer_delete: inactive 17
- rtems_task_wake_when 69
-
-24 rtems_task_wake_after: yield -- returns to caller 9
- rtems_task_wake_after: yields -- preempts caller 45
-
-25 rtems_clock_tick 4
-
-26 _ISR_Disable 0
- _ISR_Flash 1
- _ISR_Enable 1
- _Thread_Disable_dispatch 0
- _Thread_Enable_dispatch 7
- _Thread_Set_state 11
- _Thread_Disptach (NO FP) 31
- context switch: no floating point contexts 21
- context switch: self 10
- context switch: to another task 10
- context switch: restore 1st FP task 25
- fp context switch: save idle, restore idle 31
- fp context switch: save idle, restore initialized 19
- fp context switch: save initialized, restore initialized 20
- _Thread_Resume 7
- _Thread_Unblock 7
- _Thread_Ready 9
- _Thread_Get 4
- _Semaphore_Get 2
- _Thread_Get: invalid id 0
-
-27 interrupt entry overhead: returns to interrupted task 6
- interrupt exit overhead: returns to interrupted task 6
- interrupt entry overhead: returns to nested interrupt 6
- interrupt exit overhead: returns to nested interrupt 5
- interrupt entry overhead: returns to preempting task 7
- interrupt exit overhead: returns to preempting task 36
-
-28 rtems_port_create 16
- rtems_port_external_to_internal 11
- rtems_port_internal_to_external 11
- rtems_port_delete 16
-
-29 rtems_rate_monotonic_create 15
- rtems_rate_monotonic_period: initiate period -- returns to caller 21
- rtems_rate_monotonic_period: obtain status 13
- rtems_rate_monotonic_cancel 16
- rtems_rate_monotonic_delete: inactive 18
- rtems_rate_monotonic_delete: active 20
- rtems_rate_monotonic_period: conclude periods -- caller blocks 53
diff --git a/c/src/lib/libbsp/powerpc/helas403/wrapup/Makefile.in b/c/src/lib/libbsp/powerpc/helas403/wrapup/Makefile.in
deleted file mode 100644
index e931cd14df..0000000000
--- a/c/src/lib/libbsp/powerpc/helas403/wrapup/Makefile.in
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup dlentry flashentry
-# pieces to pick up out of libcpu/ppc
-CPU_PIECES=ppc403/clock ppc403/timer ppc403/console ppc403/vectors ppc403/ictrl
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(CPU_PIECES), \
- ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(notdir $(piece)).rel) \
- $(foreach piece, $(GENERIC_PIECES), \
- ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
-install: all
-
diff --git a/c/src/lib/libbsp/powerpc/papyrus/Makefile.in b/c/src/lib/libbsp/powerpc/papyrus/Makefile.in
deleted file mode 100644
index 99994ff82d..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SRCS=README
-
-all: $(SRCS)
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include dlentry flashentry startup wrapup
diff --git a/c/src/lib/libbsp/powerpc/papyrus/README b/c/src/lib/libbsp/powerpc/papyrus/README
deleted file mode 100644
index 9d3e20b592..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/README
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# $Id$
-#
-
-BSP NAME: papyrus
-BOARD: i cubed, papyrus development board
-BUS: N/A
-CPU FAMILY: ppc
-CPU: PowerPC 403GA
-COPROCESSORS: N/A
-MODE: 32 bit mode
-
-DEBUG MONITOR: Modified IBM OpenBios
-
-PERIPHERALS
-===========
-TIMERS: 403GA internal
- RESOLUTION: .1 microseconds
-SERIAL PORTS: 403GA internal with extra lines
-REAL-TIME CLOCK: 403GA internal
-DMA: 403GA internal
-VIDEO: Laser Printer
-SCSI: none
-NETWORKING: AMD PCNet32
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: 403GA internal
-IOSUPP DRIVER: N/A
-SHMSUPP: N/A
-TIMER DRIVER: 403GA internal
-TTY DRIVER: 403GA internal
-
-STDIO
-=====
-PORT: Console port 0
-ELECTRICAL: RS-232
-BAUD: 9600
-BITS PER CHARACTER: 8
-PARITY: None
-STOP BITS: 1
-
-Notes
-=====
-
-Papyrus only supports single processor operations.
-
-The code under c/src/lib/libbsp/ppc/papyrus only really supports
-the PowerOpen ABI with an ELF assembler.
-
diff --git a/c/src/lib/libbsp/powerpc/papyrus/bsp_specs b/c/src/lib/libbsp/powerpc/papyrus/bsp_specs
deleted file mode 100644
index 24804479a0..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: ecrti%O%s --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: } \
-%{qrtems_debug: }}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -u __vectors -u download_entry -N }
-
diff --git a/c/src/lib/libbsp/powerpc/papyrus/dlentry/Makefile.in b/c/src/lib/libbsp/powerpc/papyrus/dlentry/Makefile.in
deleted file mode 100644
index dc40c405f6..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/dlentry/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/dlentry.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=dlentry
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/powerpc/papyrus/dlentry/dlentry.s b/c/src/lib/libbsp/powerpc/papyrus/dlentry/dlentry.s
deleted file mode 100644
index b1e1f3a11b..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/dlentry/dlentry.s
+++ /dev/null
@@ -1,251 +0,0 @@
-/* dlentry.s 1.0 - 95/08/08
- *
- * This file contains the entry veneer for RTEMS programs
- * downloaded to Papyrus.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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$
- */
-
-#include "asm.h"
-
-/*
- * The Papyrus ELF link scripts support three special sections:
- * .entry The actual entry point, this must contain less
- * than 256 bytes of code/data to fit below the
- * .vectors section. This always preceeds any other
- * code or data.
- * .vectors The section containing the interrupt entry veneers.
- * .entry2 Any code overflowing from .entry
- * .descriptors The PowerOpen function indirection blocks.
- */
-
-/*
- * Downloaded code loads the vectors separately to 0x00000100,
- * so .entry can be over 256 bytes.
- *
- * The other sections are linked in the following order:
- * .entry
- * .entry2
- * .text
- * .descriptors
- * .data
- * .bss
- * usually starting from 0x00020000.
- *
- * The initial stack is set to run BELOW the code base address.
- *
- * All the entry veneer has to do is to clear the BSS.
- */
-
-/*
- * GDB likes to have debugging information for the entry veneer.
- * Here is some DWARF information.
- */
-
-#if PPC_ASM == PPC_ASM_ELF
- .section .entry,"ax",@progbits
-.L_text_b:
-.L_LC1:
- .previous
-
-.section .debug_sfnames
-.L_sfnames_b:
- .byte "/home/andy/powerpc/rtems-3.2.0/c/src/lib/libcpu/ppc/ppc403/dlentry/"
- .byte 0
-.L_F0:
- .byte "dlentry.s"
- .byte 0
- .previous
-
-.section .line
-.L_line_b:
- .4byte .L_line_e-.L_line_b
- .4byte .L_text_b
-.L_LE1:
-.L_line_last:
- .4byte 0x0
- .2byte 0xffff
- .4byte .L_text_e-.L_text_b
-.L_line_e:
- .previous
-
-.section .debug_srcinfo
-.L_srcinfo_b:
- .4byte .L_line_b
- .4byte .L_sfnames_b
- .4byte .L_text_b
- .4byte .L_text_e
- .4byte 0xffffffff
- .4byte .L_LE1-.L_line_b
- .4byte .L_F0-.L_sfnames_b
- .4byte .L_line_last-.L_line_b
- .4byte 0xffffffff
- .previous
-
-.section .debug_pubnames
- .4byte .L_debug_b
- .4byte .L_P0
- .byte "download_entry"
- .byte 0
- .4byte 0x0
- .byte 0
- .previous
-
-.section .debug_aranges
- .4byte .L_debug_b
- .4byte .L_text_b
- .4byte .L_text_e-.L_text_b
- .4byte 0
- .4byte 0
- .4byte 0
- .4byte 0
- .4byte 0
- .4byte 0
- .4byte 0x0
- .4byte 0x0
- .previous
-
-.section .debug
-.L_debug_b:
-.L_D1:
- .4byte .L_D1_e-.L_D1
- .2byte 0x11 /* TAG_compile_unit */
- .2byte 0x12 /* AT_sibling */
- .4byte .L_D2
- .2byte 0x38 /* AT_name */
- .byte "dlentry.s"
- .byte 0
- .2byte 0x258 /* AT_producer */
- .byte "GAS 2.5.2"
- .byte 0
- .2byte 0x111 /* AT_low_pc */
- .4byte .L_text_b
- .2byte 0x121 /* AT_high_pc */
- .4byte .L_text_e
- .2byte 0x106 /* AT_stmt_list */
- .4byte .L_line_b
- .2byte 0x1b8 /* AT_comp_dir */
- .byte "/home/andy/powerpc/rtems-3.2.0/c/src/lib/libcpu/ppc/ppc403/dlentry/"
- .byte 0
- .2byte 0x8006 /* AT_sf_names */
- .4byte .L_sfnames_b
- .2byte 0x8016 /* AT_src_info */
- .4byte .L_srcinfo_b
-.L_D1_e:
-.L_P0:
-.L_D3:
- .4byte .L_D3_e-.L_D3
- .2byte 0x6 /* TAG_global_subroutine */
- .2byte 0x12 /* AT_sibling */
- .4byte .L_D4
- .2byte 0x38 /* AT_name */
- .byte "download_entry"
- .byte 0
- .2byte 0x278 /* AT_prototyped */
- .byte 0
- .2byte 0x111 /* AT_low_pc */
- .4byte .L_text_b
- .2byte 0x121 /* AT_high_pc */
- .4byte .L_text_e
- .2byte 0x8041 /* AT_body_begin */
- .4byte .L_text_b
- .2byte 0x8051 /* AT_body_end */
- .4byte .L_text_e
-.L_D3_e:
-
-.L_D4:
- .4byte .L_D4_e-.L_D4
- .align 2
-.L_D4_e:
-.L_D2:
- .previous
-#endif
-
-/*-------------------------------------------------------------------------------
- * ROM Vector area.
- *------------------------------------------------------------------------------*/
-#if PPC_ASM == PPC_ASM_ELF
- .section .entry
-#else
- .csect .text[PR]
-#endif
-
- PUBLIC_VAR (download_entry)
-SYM(download_entry):
- bl .startup
-base_addr:
-
-/*-------------------------------------------------------------------------------
- * Parameters from linker
- *------------------------------------------------------------------------------*/
-toc_pointer:
-#if PPC_ASM == PPC_ASM_ELF
- .long s.got
-#else
- .long TOC[tc0]
-#endif
-bss_length:
- .long bss.size
-bss_addr:
- .long bss.start
-/*-------------------------------------------------------------------------------
- * Reset_entry.
- *------------------------------------------------------------------------------*/
-.startup:
- /* Get start address, stack grows down from here... */
- mflr r1
-
- /* Assume Bank regs set up..., cache etc. */
- bl bssclr
-
- /*-----------------------------------------------------------------------
- * C_setup.
- *----------------------------------------------------------------------*/
- lwz r2,toc_pointer-base_addr(r1) /* set r2 to toc */
- addi r1,r1,-56-4 /* start stack at text_addr - 56 */
- addi r3,r0,0x0 /* clear r3 */
- stw r3, 0(r1) /* Clear stack chain */
- stw r3, 4(r1)
- stw r3, 8(r1)
- stw r3, 12(r1)
- .extern SYM (boot_card)
- b SYM (boot_card) /* call the first C routine */
-
-/*-------------------------------------------------------------------------------
- * bssclr.
- *------------------------------------------------------------------------------*/
-bssclr:
- /*-----------------------------------------------------------------------
- * Data move finished, zero out bss.
- *----------------------------------------------------------------------*/
- lwz r2,bss_addr-base_addr(r1) /* start of bss set by loader */
- lwz r3,bss_length-base_addr(r1) /* bss length */
- rlwinm. r3,r3,30,0x3FFFFFFF /* form length/4 */
- beqlr /* no bss */
- mtctr r3 /* set ctr reg */
- xor r6,r6,r6 /* r6 = 0 */
-clear_bss:
- stswi r6,r2,0x4 /* store r6 */
- addi r3,r2,0x4 /* update r2 */
- bdnz clear_bss /* decrement counter and loop */
- blr /* return */
-.L_text_e:
-
-#if PPC_ABI == PPC_ABI_POWEROPEN
- DESCRIPTOR (startup)
-#endif
diff --git a/c/src/lib/libbsp/powerpc/papyrus/flashentry/Makefile.in b/c/src/lib/libbsp/powerpc/papyrus/flashentry/Makefile.in
deleted file mode 100644
index 683f996472..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/flashentry/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/flashentry.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=flashentry
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/powerpc/papyrus/flashentry/flashentry.s b/c/src/lib/libbsp/powerpc/papyrus/flashentry/flashentry.s
deleted file mode 100644
index 857caa729d..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/flashentry/flashentry.s
+++ /dev/null
@@ -1,289 +0,0 @@
-/* dlentry.s 1.0 - 95/08/08
- *
- * This file contains the entry veneer for RTEMS programs
- * stored in Papyrus' flash ROM.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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$
- */
-
-#include "asm.h"
-
-/*
- * The Papyrus ELF link scripts support three special sections:
- * .entry The actual entry point, this must contain less
- * than 256 bytes of code/data to fit below the
- * .vectors section. This always preceeds any other
- * code or data.
- * .vectors The section containing the interrupt entry veneers.
- * .entry2 Any code overflowing from .entry
- * .descriptors The PowerOpen function indirection blocks.
- */
-
-/*
- * Flash sections are linked in the following order:
- * .entry
- * .vectors
- * .entry2
- * .text
- * .descriptors
- * .data
- * .bss
- * usually starting from 0xFFF00000.
- *
- * The initial stack is set to run BELOW the final location of
- * the initialised data.
- *
- * All the entry veneer has to do is to copy the initialised data
- * to its final location and clear the BSS.
- */
-
-/*
- * GDB likes to have debugging information for the entry veneer.
- * Here is some DWARF information.
- */
-
-#if PPC_ASM == PPC_ASM_ELF
- .section .entry,"ax",@progbits
-.L_text_b:
-.L_LC1:
- .previous
-
-.section .debug_sfnames
-.L_sfnames_b:
- .byte "/home/andy/powerpc/rtems-3.2.0/c/src/lib/libcpu/ppc/ppc403/flashentry/"
- .byte 0
-.L_F0:
- .byte "flashentry.s"
- .byte 0
- .previous
-
-.section .line
-.L_line_b:
- .4byte .L_line_e-.L_line_b
- .4byte .L_text_b
-.L_LE1:
-.L_line_last:
- .4byte 0x0
- .2byte 0xffff
- .4byte .L_text_e-.L_text_b
-.L_line_e:
- .previous
-
-.section .debug_srcinfo
-.L_srcinfo_b:
- .4byte .L_line_b
- .4byte .L_sfnames_b
- .4byte .L_text_b
- .4byte .L_text_e
- .4byte 0xffffffff
- .4byte .L_LE1-.L_line_b
- .4byte .L_F0-.L_sfnames_b
- .4byte .L_line_last-.L_line_b
- .4byte 0xffffffff
- .previous
-
-.section .debug_pubnames
- .4byte .L_debug_b
- .4byte .L_P0
- .byte "flash_entry"
- .byte 0
- .4byte 0x0
- .byte 0
- .previous
-
-.section .debug_aranges
- .4byte .L_debug_b
- .4byte .L_text_b
- .4byte .L_text_e-.L_text_b
- .4byte 0
- .4byte 0
- .4byte 0
- .4byte 0
- .4byte 0
- .4byte 0
- .4byte 0x0
- .4byte 0x0
- .previous
-
-.section .debug
-.L_debug_b:
-.L_D1:
- .4byte .L_D1_e-.L_D1
- .2byte 0x11 /* TAG_compile_unit */
- .2byte 0x12 /* AT_sibling */
- .4byte .L_D2
- .2byte 0x38 /* AT_name */
- .byte "flashentry.s"
- .byte 0
- .2byte 0x258 /* AT_producer */
- .byte "GAS 2.5.2"
- .byte 0
- .2byte 0x111 /* AT_low_pc */
- .4byte .L_text_b
- .2byte 0x121 /* AT_high_pc */
- .4byte .L_text_e
- .2byte 0x106 /* AT_stmt_list */
- .4byte .L_line_b
- .2byte 0x1b8 /* AT_comp_dir */
- .byte "/home/andy/powerpc/rtems-3.2.0/c/src/lib/libcpu/ppc/ppc403/dlentry/"
- .byte 0
- .2byte 0x8006 /* AT_sf_names */
- .4byte .L_sfnames_b
- .2byte 0x8016 /* AT_src_info */
- .4byte .L_srcinfo_b
-.L_D1_e:
-.L_P0:
-.L_D3:
- .4byte .L_D3_e-.L_D3
- .2byte 0x6 /* TAG_global_subroutine */
- .2byte 0x12 /* AT_sibling */
- .4byte .L_D4
- .2byte 0x38 /* AT_name */
- .byte "flash_entry"
- .byte 0
- .2byte 0x278 /* AT_prototyped */
- .byte 0
- .2byte 0x111 /* AT_low_pc */
- .4byte .L_text_b
- .2byte 0x121 /* AT_high_pc */
- .4byte .L_text_e
- .2byte 0x8041 /* AT_body_begin */
- .4byte .L_text_b
- .2byte 0x8051 /* AT_body_end */
- .4byte .L_text_e
-.L_D3_e:
-
-.L_D4:
- .4byte .L_D4_e-.L_D4
- .align 2
-.L_D4_e:
-.L_D2:
- .previous
-#endif
-
-/*-------------------------------------------------------------------------------
- * ROM Vector area.
- *------------------------------------------------------------------------------*/
-#if PPC_ASM == PPC_ASM_ELF
- .section .entry
-#else
- .csect .text[PR]
-#endif
- PUBLIC_VAR (flash_entry)
-SYM (flash_entry):
- bl .startup
-base_addr:
-
-/*-------------------------------------------------------------------------------
- * Parameters from linker
- *------------------------------------------------------------------------------*/
-toc_pointer:
-#if PPC_ASM == PPC_ASM_ELF
- .long s.got
-#else
- .long TOC[tc0]
-#endif
-text_length:
- .long t.size
-text_addr:
- .long t.start
-data_length:
- .long copy.size
-data_addr:
- .long copy.dest
-bss_length:
- .long bss.size
-bss_addr:
- .long bss.start
-
-/*-------------------------------------------------------------------------------
- * Reset_entry.
- *------------------------------------------------------------------------------*/
-.startup:
- /* Get start address */
- mflr r1
-
- /* Assume Bank regs set up..., cache etc. */
-
- /*-----------------------------------------------------------------------
- * Check the DRAM where STACK+ DATA+ BBS will be placed. If this is OK
- * we will return here.
- *----------------------------------------------------------------------*/
- bl rom2ram
- /*-----------------------------------------------------------------------
- * Enable two 128MB cachable regions.
- *----------------------------------------------------------------------*/
- addis r2,r0,0x8000
- addi r2,r2,0x0001
-
- mtspr 0x3fb, r2 /* ICCR */
- mtspr 0x3fa, r2 /* DCCR */
-
- /*-----------------------------------------------------------------------
- * C_setup.
- *----------------------------------------------------------------------*/
- lwz r2,toc_pointer-base_addr(r1) /* set r2 to toc */
- lwz r1,data_addr-base_addr(r1) /* set r1 to data_addr */
- addi r1,r1,-56 /* start stack at data_addr - 56 */
- addi r3,r0,0x0 /* clear r3 */
- stw r3, 0(r1) /* Clear stack chain */
- stw r3, 4(r1)
- stw r3, 8(r1)
- stw r3, 12(r1)
- .extern SYM (boot_card)
- b SYM (boot_card) /* call the first C routine */
-
-/*-------------------------------------------------------------------------------
- * Rom2ram.
- *------------------------------------------------------------------------------*/
-rom2ram:
- lwz r2,data_addr-base_addr(r1) /* start of data set by loader */
- lwz r3,data_length-base_addr(r1) /* data length */
- rlwinm r3,r3,30,0x3FFFFFFF /* form length/4 */
- mtctr r3 /* set ctr reg */
- /*-----------------------------------------------------------------------
- * Calculate offset of data in image.
- *----------------------------------------------------------------------*/
- lwz r5,text_length-base_addr(r1) /* get text length */
- lwz r4,text_addr-base_addr(r1) /* get text length */
- add r4,r4,r5 /* r4 = data pointer */
-move_data:
- lswi r6,r4,0x4 /* load r6 */
- stswi r6,r2,0x4 /* store r6 */
- addi r4,r4,0x4 /* update r4 */
- addi r2,r2,0x4 /* update r2 */
- bdnz move_data /* decrement counter and loop */
- /*-----------------------------------------------------------------------
- * Data move finished, zero out bss.
- *----------------------------------------------------------------------*/
- lwz r2,bss_addr-base_addr(r1) /* start of bss set by loader */
- lwz r3,bss_length-base_addr(r1) /* bss length */
- rlwinm. r3,r3,30,0x3FFFFFFF /* form length/4 */
- beqlr /* no bss */
- mtctr r3 /* set ctr reg */
- xor r6,r6,r6 /* r6 = 0 */
-clear_bss:
- stswi r6,r2,0x4 /* store r6 */
- addi r3,r2,0x4 /* update r2 */
- bdnz clear_bss /* decrement counter and loop */
- blr /* return */
-.L_text_e:
-
-#if PPC_ABI == PPC_ABI_POWEROPEN
- DESCRIPTOR (startup)
-#endif
diff --git a/c/src/lib/libbsp/powerpc/papyrus/include/Makefile.in b/c/src/lib/libbsp/powerpc/papyrus/include/Makefile.in
deleted file mode 100644
index 096f514e64..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/include/Makefile.in
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
-
-install: all
diff --git a/c/src/lib/libbsp/powerpc/papyrus/include/bsp.h b/c/src/lib/libbsp/powerpc/papyrus/include/bsp.h
deleted file mode 100644
index d66328b924..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/include/bsp.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* bsp.h
- *
- * This include file contains all Papyrus board IO definitions.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/lib/libbsp/no_cpu/no_bsp/include/bsp.h
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PAPYRUS_h
-#define __PAPYRUS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef ASM
-/* Definition of where to store registers in alignment handler */
-#define ALIGN_REGS 0x0140
-
-#else
-#include <rtems.h>
-#include <console.h>
-#include <clockdrv.h>
-#include <console.h>
-#include <iosupp.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-
-/*
- * Stuff for Time Test 27
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) set_vector( (handler), PPC_IRQ_SCALL, 1 )
-
-#define Cause_tm27_intr() asm volatile ("sc")
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/* Constants */
-
-#define RAM_START 0
-#define RAM_END 0x00200000
-
-
-/* Some useful LED debugging bits */
-/* LED numbers are from 0-2 */
-#define __led_base ((volatile int *)0x7F200000)
-
-/* Turn a LED on */
-#define led_on(n) (__led_base[n] = 0)
-
-/* Turn a LED off */
-#define led_off(n) (__led_base[n] = 1)
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration; /* owned by BSP */
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* functions */
-
-rtems_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-);
-#endif /* ASM */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/powerpc/papyrus/include/coverhd.h b/c/src/lib/libbsp/powerpc/papyrus/include/coverhd.h
deleted file mode 100644
index fce47a9df6..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/include/coverhd.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- * This file should be updated after running the C overhead timing
- * test. Once this update has been performed, the RTEMS Time Test
- * Suite should be rebuilt to account for these overhead times in the
- * timing results.
- *
- * NOTE: If these are all zero, then the times reported include
- * all calling overhead including passing of arguments.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Updated for a 25MHz Papyrus by Andrew Bray <andy@i-cubed.co.uk>
- *
- * Units are 100ns.
- *
- * These numbers are of questionable use, as they are developed by calling
- * the routine many times, thus getting its entry veneer into the (small)
- * cache on the 403GA. This in general is not true of the RTEMS timing
- * tests, which usually call a routine only once, thus having no cache loaded
- * advantage.
- *
- * Whether the directive times are useful after deducting the function call
- * overhead is also questionable. The user is more interested generally
- * in the total cost of a directive, not the cost if the procedure call
- * is inlined! (In general this is not true).
- *
- * Andrew Bray 18/08/1995
- *
- */
-
-#ifndef __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 1
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 1
-#define CALLING_OVERHEAD_TASK_CREATE 3
-#define CALLING_OVERHEAD_TASK_IDENT 1
-#define CALLING_OVERHEAD_TASK_START 1
-#define CALLING_OVERHEAD_TASK_RESTART 1
-#define CALLING_OVERHEAD_TASK_DELETE 1
-#define CALLING_OVERHEAD_TASK_SUSPEND 1
-#define CALLING_OVERHEAD_TASK_RESUME 1
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 1
-#define CALLING_OVERHEAD_TASK_MODE 1
-#define CALLING_OVERHEAD_TASK_GET_NOTE 1
-#define CALLING_OVERHEAD_TASK_SET_NOTE 1
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 4
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 1
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 1
-#define CALLING_OVERHEAD_CLOCK_GET 4
-#define CALLING_OVERHEAD_CLOCK_SET 3
-#define CALLING_OVERHEAD_CLOCK_TICK 1
-
-#define CALLING_OVERHEAD_TIMER_CREATE 1
-#define CALLING_OVERHEAD_TIMER_IDENT 1
-#define CALLING_OVERHEAD_TIMER_DELETE 1
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 2
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 5
-#define CALLING_OVERHEAD_TIMER_RESET 1
-#define CALLING_OVERHEAD_TIMER_CANCEL 1
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 2
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 1
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 1
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 1
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 1
-
-#define CALLING_OVERHEAD_EVENT_SEND 1
-#define CALLING_OVERHEAD_EVENT_RECEIVE 2
-#define CALLING_OVERHEAD_SIGNAL_CATCH 1
-#define CALLING_OVERHEAD_SIGNAL_SEND 1
-#define CALLING_OVERHEAD_PARTITION_CREATE 3
-#define CALLING_OVERHEAD_PARTITION_IDENT 1
-#define CALLING_OVERHEAD_PARTITION_DELETE 1
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 1
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 1
-#define CALLING_OVERHEAD_REGION_CREATE 3
-#define CALLING_OVERHEAD_REGION_IDENT 1
-#define CALLING_OVERHEAD_REGION_DELETE 1
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 2
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 1
-#define CALLING_OVERHEAD_PORT_CREATE 2
-#define CALLING_OVERHEAD_PORT_IDENT 1
-#define CALLING_OVERHEAD_PORT_DELETE 1
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 1
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 2
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 2
-#define CALLING_OVERHEAD_IO_OPEN 2
-#define CALLING_OVERHEAD_IO_CLOSE 2
-#define CALLING_OVERHEAD_IO_READ 2
-#define CALLING_OVERHEAD_IO_WRITE 2
-#define CALLING_OVERHEAD_IO_CONTROL 2
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 1
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 1
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/powerpc/papyrus/startup/Makefile.in b/c/src/lib/libbsp/powerpc/papyrus/startup/Makefile.in
deleted file mode 100644
index aa59a2c153..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/startup/Makefile.in
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/powerpc/papyrus/startup/bspclean.c b/c/src/lib/libbsp/powerpc/papyrus/startup/bspclean.c
deleted file mode 100644
index e18aa7d381..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/startup/bspclean.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine normally is part of start.s and usually returns
- * control to a monitor.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/lib/libbsp/no_cpu/no_bsp/startup/bspclean.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-void bsp_cleanup( void )
-{
- rtems_fatal_error_occurred(0);
-}
diff --git a/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c b/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c
deleted file mode 100644
index 245b26de96..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- *
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int _end;
- rtems_unsigned32 heap_start;
-
- heap_start = (rtems_unsigned32) &_end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- /*
- * Allocate the memory for the RTEMS Work Space. This can come from
- * a variety of places: hard coded address, malloc'ed from outside
- * RTEMS world (e.g. simulator or primitive memory manager), or (as
- * typically done by stock BSPs) by subtracting the required amount
- * of work space from the last physical address on the CPU board.
- */
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
-
- BSP_Configuration.work_space_start = (void *)
- RAM_END - BSP_Configuration.work_space_size;
-
- /*
- * initialize the CPU table for this BSP
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_stack_size = 4 * 1024;
-
- Cpu_table.clicks_per_usec = 10;
- Cpu_table.serial_per_sec = 10000000;
- Cpu_table.serial_external_clock = 1;
- Cpu_table.serial_xon_xoff = 0;
- Cpu_table.serial_cts_rts = 1;
- Cpu_table.serial_rate = 9600;
- Cpu_table.timer_average_overhead = 2;
- Cpu_table.timer_least_valid = 3;
-}
diff --git a/c/src/lib/libbsp/powerpc/papyrus/startup/linkcmds b/c/src/lib/libbsp/powerpc/papyrus/startup/linkcmds
deleted file mode 100644
index e772050e38..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/startup/linkcmds
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the Papyrus.
- *
- * $Id$
- */
-
-OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
- "elf32-powerpc")
-OUTPUT_ARCH(powerpc)
- SEARCH_DIR(/usr/local/powerpc-rtems/lib);
-
-ENTRY(download_entry)
-
-MEMORY
- {
- RAM : ORIGIN = 0, LENGTH = 4M
- FLASH : ORIGIN = 0xFF000000, LENGTH = 0x80000
- EPROM : ORIGIN = 0xFFFE0000, LENGTH = 0x20000
- }
-
-/* Do we need any of these for elf?
- __DYNAMIC = 0; */
-
-SECTIONS
-{
- .vectors 0x0100 :
- {
- *(.vectors)
- }
-
- .text 0x20000 :
- {
- *(.entry)
- *(.entry2)
- *(.text)
- *(.rodata)
- *(.gnu.linkonce.r*)
- *(.rodata1)
- *(.descriptors)
- *(rom_ver)
- etext = ALIGN(0x10);
- _etext = .;
-
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
-
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
-
- *(.lit)
- *(.shdata)
- *(.init)
- *(.fini)
- _endtext = .;
- } > RAM
-
- /* R/W Data */
- .data :
- {
- *(.data)
- *(.data1)
- PROVIDE (__SDATA_START__ = .);
- *(.sdata)
- } > RAM
-
- PROVIDE (__EXCEPT_START__ = .);
- .gcc_except_table : { *(.gcc_except_table) } >RAM
- PROVIDE (__EXCEPT_END__ = .);
- __GOT_START__ = .;
- .got :
- {
- s.got = .;
- *(.got.plt) *(.got)
- } > RAM
- __GOT_END__ = .;
-
- .got1 : { *(.got1) } >RAM
- PROVIDE (__GOT2_START__ = .);
- PROVIDE (_GOT2_START_ = .);
- .got2 : { *(.got2) } >RAM
- PROVIDE (__GOT2_END__ = .);
- PROVIDE (_GOT2_END_ = .);
-
- PROVIDE (__FIXUP_START__ = .);
- PROVIDE (_FIXUP_START_ = .);
- .fixup : { *(.fixup) } >RAM
- PROVIDE (_FIXUP_END_ = .);
- PROVIDE (__FIXUP_END__ = .);
-
- PROVIDE (__SDATA2_START__ = .);
- .sdata2 : { *(.sdata2) } >RAM
- .sbss2 : { *(.sbss2) } >RAM
- PROVIDE (__SBSS2_END__ = .);
-
- .sbss2 : { *(.sbss2) } >RAM
- PROVIDE (__SBSS2_END__ = .);
-
- __SBSS_START__ = .;
- .bss :
- {
- bss.start = .;
- *(.bss) *(.sbss) *(COMMON)
- bss.end = ALIGN(4);
- } > RAM
- __SBSS_END__ = .;
-
- bss.size = bss.end - bss.start;
- PROVIDE(_end = bss.end);
-
- .line 0 : { *(.line) }
- .debug 0 : { *(.debug) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_aregion 0 : { *(.debug_aregion) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
-}
-
-
diff --git a/c/src/lib/libbsp/powerpc/papyrus/startup/setvec.c b/c/src/lib/libbsp/powerpc/papyrus/startup/setvec.c
deleted file mode 100644
index 0f6a676236..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/startup/setvec.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on the target Board/CPU.
- * This routine is allowed to be as board dependent as necessary.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/lib/libbsp/no_cpu/no_bsp/startup/setvec.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-rtems_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- rtems_isr_entry previous_isr;
-
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
-
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/powerpc/papyrus/times b/c/src/lib/libbsp/powerpc/papyrus/times
deleted file mode 100644
index da260853bf..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/times
+++ /dev/null
@@ -1,197 +0,0 @@
-#
-# Timing Test Suite Results for the Papyrus BSP
-#
-# NOTE: The Papyrus is a proprietary PPC403 based board. But it is the
-# only BSP currently available for the PowerPC family.
-#
-# $Id$
-#
-
-NOTE: This BSP is user submitted and no timing information
- is currently avaiable.
-
-Board: Papyrus
-CPU: IBM 403GA
-Clock Speed: 33 Mhz
-Memory Configuration: SRAM, DRAM, cache, etc
-Wait States:
-
-Times Reported in: cycles, microseconds, etc
-Timer Source: Count Down Timer, on-CPU cycle counter, etc
-
-Column A: unused
-Column B: unused
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 20
- rtems_semaphore_delete 21
- rtems_semaphore_obtain: available 15
- rtems_semaphore_obtain: not available -- NO_WAIT 15
- rtems_semaphore_release: no waiting tasks 16
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 62
-
- 3 rtems_semaphore_release: task readied -- preempts caller 55
-
- 4 rtems_task_restart: blocked task -- preempts caller 77
- rtems_task_restart: ready task -- preempts caller 70
- rtems_semaphore_release: task readied -- returns to caller 25
- rtems_task_create 57
- rtems_task_start 31
- rtems_task_restart: suspended task -- returns to caller 36
- rtems_task_delete: suspended task 47
- rtems_task_restart: ready task -- returns to caller 37
- rtems_task_restart: blocked task -- returns to caller 46
- rtems_task_delete: blocked task 50
-
- 5 rtems_task_suspend: calling task 51
- rtems_task_resume: task readied -- preempts caller 49
-
- 6 rtems_task_restart: calling task 59
- rtems_task_suspend: returns to caller 18
- rtems_task_resume: task readied -- returns to caller 19
- rtems_task_delete: ready task 50
-
- 7 rtems_task_restart: suspended task -- preempts caller 70
-
- 8 rtems_task_set_priority: obtain current priority 12
- rtems_task_set_priority: returns to caller 27
- rtems_task_mode: obtain current mode 5
- rtems_task_mode: no reschedule 5
- rtems_task_mode: reschedule -- returns to caller 8
- rtems_task_mode: reschedule -- preempts caller 39
- rtems_task_set_note 13
- rtems_task_get_note 13
- rtems_clock_set 33
- rtems_clock_get 3
-
- 9 rtems_message_queue_create 110
- rtems_message_queue_send: no waiting tasks 37
- rtems_message_queue_urgent: no waiting tasks 37
- rtems_message_queue_receive: available 31
- rtems_message_queue_flush: no messages flushed 12
- rtems_message_queue_flush: messages flushed 16
- rtems_message_queue_delete 26
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 15
- rtems_message_queue_receive: not available -- caller blocks 62
-
-11 rtems_message_queue_send: task readied -- preempts caller 72
-
-12 rtems_message_queue_send: task readied -- returns to caller 39
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 72
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 39
-
-15 rtems_event_receive: obtain current events 1
- rtems_event_receive: not available -- NO_WAIT 12
- rtems_event_receive: not available -- caller blocks 56
- rtems_event_send: no task readied 12
- rtems_event_receive: available 12
- rtems_event_send: task readied -- returns to caller 24
-
-16 rtems_event_send: task readied -- preempts caller 55
-
-17 rtems_task_set_priority: preempts caller 62
-
-18 rtems_task_delete: calling task 83
-
-19 rtems_signal_catch 9
- rtems_signal_send: returns to caller 15
- rtems_signal_send: signal to self 18
- exit ASR overhead: returns to calling task 22
- exit ASR overhead: returns to preempting task 49
-
-20 rtems_partition_create 35
- rtems_region_create 23
- rtems_partition_get_buffer: available 15
- rtems_partition_get_buffer: not available 13
- rtems_partition_return_buffer 18
- rtems_partition_delete 16
- rtems_region_get_segment: available 22
- rtems_region_get_segment: not available -- NO_WAIT 21
- rtems_region_return_segment: no waiting tasks 19
- rtems_region_get_segment: not available -- caller blocks 64
- rtems_region_return_segment: task readied -- preempts caller 74
- rtems_region_return_segment: task readied -- returns to caller 44
- rtems_region_delete 16
- rtems_io_initialize 2
- rtems_io_open 1
- rtems_io_close 1
- rtems_io_read 1
- rtems_io_write 1
- rtems_io_control 1
-
-21 rtems_task_ident 149
- rtems_message_queue_ident 145
- rtems_semaphore_ident 156
- rtems_partition_ident 145
- rtems_region_ident 148
- rtems_port_ident 145
- rtems_timer_ident 145
- rtems_rate_monotonic_ident 145
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 42
- rtems_message_queue_broadcast: no waiting tasks 17
- rtems_message_queue_broadcast: task readied -- preempts caller 78
-
-23 rtems_timer_create 14
- rtems_timer_fire_after: inactive 22
- rtems_timer_fire_after: active 24
- rtems_timer_cancel: active 15
- rtems_timer_cancel: inactive 13
- rtems_timer_reset: inactive 21
- rtems_timer_reset: active 23
- rtems_timer_fire_when: inactive 34
- rtems_timer_fire_when: active 34
- rtems_timer_delete: active 19
- rtems_timer_delete: inactive 17
- rtems_task_wake_when 69
-
-24 rtems_task_wake_after: yield -- returns to caller 9
- rtems_task_wake_after: yields -- preempts caller 45
-
-25 rtems_clock_tick 4
-
-26 _ISR_Disable 0
- _ISR_Flash 1
- _ISR_Enable 1
- _Thread_Disable_dispatch 0
- _Thread_Enable_dispatch 7
- _Thread_Set_state 11
- _Thread_Disptach (NO FP) 31
- context switch: no floating point contexts 21
- context switch: self 10
- context switch: to another task 10
- context switch: restore 1st FP task 25
- fp context switch: save idle, restore idle 31
- fp context switch: save idle, restore initialized 19
- fp context switch: save initialized, restore initialized 20
- _Thread_Resume 7
- _Thread_Unblock 7
- _Thread_Ready 9
- _Thread_Get 4
- _Semaphore_Get 2
- _Thread_Get: invalid id 0
-
-27 interrupt entry overhead: returns to interrupted task 6
- interrupt exit overhead: returns to interrupted task 6
- interrupt entry overhead: returns to nested interrupt 6
- interrupt exit overhead: returns to nested interrupt 5
- interrupt entry overhead: returns to preempting task 7
- interrupt exit overhead: returns to preempting task 36
-
-28 rtems_port_create 16
- rtems_port_external_to_internal 11
- rtems_port_internal_to_external 11
- rtems_port_delete 16
-
-29 rtems_rate_monotonic_create 15
- rtems_rate_monotonic_period: initiate period -- returns to caller 21
- rtems_rate_monotonic_period: obtain status 13
- rtems_rate_monotonic_cancel 16
- rtems_rate_monotonic_delete: inactive 18
- rtems_rate_monotonic_delete: active 20
- rtems_rate_monotonic_period: conclude periods -- caller blocks 53
diff --git a/c/src/lib/libbsp/powerpc/papyrus/wrapup/Makefile.in b/c/src/lib/libbsp/powerpc/papyrus/wrapup/Makefile.in
deleted file mode 100644
index d477b3e23d..0000000000
--- a/c/src/lib/libbsp/powerpc/papyrus/wrapup/Makefile.in
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup dlentry flashentry
-# pieces to pick up out of libcpu/ppc
-CPU_PIECES=ppc403/clock ppc403/timer ppc403/console \
- ppc403/vectors ppc403/ictrl
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(CPU_PIECES), \
- ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(notdir $(piece)).rel) \
- $(foreach piece, $(GENERIC_PIECES), \
- ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
-install: all
-
diff --git a/c/src/lib/libbsp/powerpc/psim/Makefile.in b/c/src/lib/libbsp/powerpc/psim/Makefile.in
deleted file mode 100644
index 1228e79b41..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/Makefile.in
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SRCS=README
-
-all: $(SRCS)
-
-# shmsupp augments shmdr -- the portable shared memory MPCI layer
-# We only build it if HAS_MP was defined
-MP_DRIVERS_yes_V = shmsupp
-MP_DRIVERS = $(MP_DRIVERS_$(HAS_MP)_V)
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include clock console startup startsim $(MP_DRIVERS) \
- timer vectors wrapup tools
diff --git a/c/src/lib/libbsp/powerpc/psim/README b/c/src/lib/libbsp/powerpc/psim/README
deleted file mode 100644
index d0d6d5fa57..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/README
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-
-BSP NAME: psim
-BOARD: PowerPC Simulator
-BUS: N/A
-CPU FAMILY: ppc
-CPU: PowerPC 603, 603e, 604
-COPROCESSORS: N/A
-MODE: 32 bit mode
-
-DEBUG MONITOR: BUG mode (emulates Motorola debug monitor)
-
-PERIPHERALS
-===========
-TIMERS: PPC internal Timebase register
- RESOLUTION: ???
-SERIAL PORTS: simulated via bug
-REAL-TIME CLOCK: PPC internal Decrementer register
-DMA: none
-VIDEO: none
-SCSI: none
-NETWORKING: none
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: PPC internal
-IOSUPP DRIVER: N/A
-SHMSUPP: N/A
-TIMER DRIVER: PPC internal
-TTY DRIVER: PPC internal
-
-STDIO
-=====
-PORT: Console port 0
-ELECTRICAL: na
-BAUD: na
-BITS PER CHARACTER: na
-PARITY: na
-STOP BITS: na
-
-Notes
-=====
-
-Based on papyrus bsp which only really supports
-the PowerOpen ABI with an ELF assembler.
-
-For the multiprocessing tests to run, you must have a modified version of
-the PowerPC Simulator psim which supports an area of UNIX shared memory
-and UNIX semaphore mapped into the PowerPC address space.
-
diff --git a/c/src/lib/libbsp/powerpc/psim/bsp_specs b/c/src/lib/libbsp/powerpc/psim/bsp_specs
deleted file mode 100644
index a28e9237f5..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group ecrtn%O%s \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: ecrti%O%s \
-%{!qrtems_debug: startsim.o%s} \
-%{qrtems_debug: startsim_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -Qy -dp -Bstatic -T linkcmds%s -e _start -u __vectors}
-
diff --git a/c/src/lib/libbsp/powerpc/psim/clock/Makefile.in b/c/src/lib/libbsp/powerpc/psim/clock/Makefile.in
deleted file mode 100644
index be0a454963..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/clock/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=clock
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/powerpc/psim/clock/clock.c b/c/src/lib/libbsp/powerpc/psim/clock/clock.c
deleted file mode 100644
index 282820fafe..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/clock/clock.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Clock Tick Device Driver
- *
- * This routine utilizes the Decrementer Register common to the PPC family.
- *
- * The tick frequency is directly programmed to the configured number of
- * microseconds per tick.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-/*
- * The Real Time Clock Counter Timer uses this trap type.
- */
-
-#define CLOCK_VECTOR PPC_IRQ_DECREMENTER
-
-/*
- * Clock ticks since initialization
- */
-
-volatile rtems_unsigned32 Clock_driver_ticks;
-
-/*
- * This is the value programmed into the count down timer. It
- * is artificially lowered when PSIM_FAST_IDLE is defined to
- * cut down how long we spend in the idle task while executing on
- * the simulator.
- */
-
-extern rtems_unsigned32 CPU_PPC_CLICKS_PER_TICK;
-
-rtems_isr_entry Old_ticker;
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-/*
- * Clock_isr
- *
- * This is the clock tick interrupt handler.
- *
- * Input parameters:
- * vector - vector number
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- *
- */
-
-#define PPC_Set_decrementer( _clicks ) \
- do { \
- asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
- } while (0)
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
- /*
- * Whether or not we we are in "fast idle" mode, the value for clicks
- * per tick must be programmed. If we are using "fast idle" mode for
- * a simulator, then the clicks per tick value is lowered to decrease
- * the amount of time spent executing the idle task while using the
- * an instruction simulator like psim.
- */
-
-
- PPC_Set_decrementer( CPU_PPC_CLICKS_PER_TICK );
-
- /*
- * The driver has seen another tick.
- */
-
- Clock_driver_ticks += 1;
-
- /*
- * Real Time Clock counter/timer is set to automatically reload.
- */
-
- rtems_clock_tick();
-}
-
-/*
- * Install_clock
- *
- * This routine actually performs the hardware initialization for the clock.
- *
- * Input parameters:
- * clock_isr - clock interrupt service routine entry point
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- *
- */
-
-extern int CLOCK_SPEED;
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
- Clock_driver_ticks = 0;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
-
- PPC_Set_decrementer( CPU_PPC_CLICKS_PER_TICK );
-
- atexit( Clock_exit );
- }
-
-}
-
-/*
- * Clock_exit
- *
- * This routine allows the clock driver to exit by masking the interrupt and
- * disabling the clock's counter.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- *
- */
-
-void Clock_exit( void )
-{
- if ( BSP_Configuration.ticks_per_timeslice ) {
-
- /* nothing to do */;
-
- /* do not restore old vector */
- }
-}
-
-/*
- * Clock_initialize
- *
- * This routine initializes the clock driver.
- *
- * Input parameters:
- * major - clock device major number
- * minor - clock device minor number
- * parg - pointer to optional device driver arguments
- *
- * Output parameters: NONE
- *
- * Return values:
- * rtems_device_driver status code
- */
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Clock_control
- *
- * This routine is the clock device driver control entry point.
- *
- * Input parameters:
- * major - clock device major number
- * minor - clock device minor number
- * parg - pointer to optional device driver arguments
- *
- * Output parameters: NONE
- *
- * Return values:
- * rtems_device_driver status code
- */
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/powerpc/psim/console/Makefile.in b/c/src/lib/libbsp/powerpc/psim/console/Makefile.in
deleted file mode 100644
index 125410e1c6..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/console/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=consupp
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/powerpc/psim/console/console.c b/c/src/lib/libbsp/powerpc/psim/console/console.c
deleted file mode 100644
index 161ead99a2..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/console/console.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * This file contains the hardware specific portions of the TTY driver
- * for the serial ports on the erc32.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <stdlib.h>
-#include <assert.h>
-
-/* external prototypes for monitor interface routines */
-
-void outbyte( char );
-char inbyte( void );
-
-/*
- * console_outbyte_polled
- *
- * This routine transmits a character using polling.
- */
-
-void console_outbyte_polled(
- int port,
- char ch
-)
-{
- outbyte( ch );
-}
-
-/*
- * console_inbyte_nonblocking
- *
- * This routine polls for a character.
- */
-
-int console_inbyte_nonblocking(
- int port
-)
-{
- char c;
-
- c = inbyte();
- if (!c)
- return -1;
- return c;
-}
-
-/*
- * DEBUG_puts
- *
- * This should be safe in the event of an error. It attempts to insure
- * that no TX empty interrupts occur while it is doing polled IO. Then
- * it restores the state of that external interrupt.
- *
- * Input parameters:
- * string - pointer to debug output string
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void DEBUG_puts(
- char *string
-)
-{
- char *s;
-
- /* XXX should disable interrupts around this if interrupt driven */
-
- for ( s = string ; *s ; s++ )
- console_outbyte_polled( 0, *s );
-
- console_outbyte_polled( 0, '\r' );
- console_outbyte_polled( 0, '\n' );
-}
-
-
-/*
- * Console Termios Support Entry Points
- *
- */
-
-int console_write_support (
- int minor,
- const char *bufarg,
- int len
-)
-{
- int nwrite = 0;
- const char *buf = bufarg;
-
- while (nwrite < len) {
- console_outbyte_polled( minor, *buf++ );
- nwrite++;
- }
- return nwrite;
-}
-
-/*
- * Console Device Driver Entry Points
- *
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- rtems_termios_initialize();
-
- /*
- * Register Device Names
- */
-
- status = rtems_io_register_name( "/dev/console", major, 0 );
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_status_code sc;
- static const rtems_termios_callbacks pollCallbacks = {
- NULL, /* firstOpen */
- NULL, /* lastClose */
- console_inbyte_nonblocking, /* pollRead */
- console_write_support, /* write */
- NULL, /* setAttributes */
- NULL, /* stopRemoteTx */
- NULL, /* startRemoteTx */
- 0 /* outputUsesInterrupts */
- };
-
-
- assert( minor <= 1 );
- if ( minor > 2 )
- return RTEMS_INVALID_NUMBER;
-
- sc = rtems_termios_open (major, minor, arg, &pollCallbacks );
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_close (arg);
-}
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_read (arg);
-}
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_write (arg);
-}
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_ioctl (arg);
-}
-
-void console_reserve_resources(
- rtems_configuration_table *configuration
-)
-{
- rtems_termios_reserve_resources( configuration, 1 );
-}
diff --git a/c/src/lib/libbsp/powerpc/psim/console/consupp.s b/c/src/lib/libbsp/powerpc/psim/console/consupp.s
deleted file mode 100644
index bb9e834fc6..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/console/consupp.s
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Adapted from the mvme-inbyte.S and mvme-outbyte.S files in libgloss.
- * These should work on all targets using the ppcbug monitor.
- *
- * Copyright (c) 1995 Cygnus Support
- *
- * The authors hereby grant permission to use, copy, modify, distribute,
- * and license this software and its documentation for any purpose, provided
- * that existing copyright notices are retained in all copies and that this
- * notice is included verbatim in any distributions. No written agreement,
- * license, or royalty fee is required for any of the authorized uses.
- * Modifications to this software may be copyrighted by their authors
- * and need not follow the licensing terms described here, provided that
- * the new terms are clearly indicated on the first page of each file where
- * they apply.
- */
-
-#include "ppc-asm.h"
-
- .file "support.s"
- .text
-FUNC_START(outbyte)
- li r10,0x20
- sc
- blr
-FUNC_END(outbyte)
-
- .text
-FUNC_START(inbyte)
- li r10,0x0
- sc
- blr
-FUNC_END(inbyte)
diff --git a/c/src/lib/libbsp/powerpc/psim/include/Makefile.in b/c/src/lib/libbsp/powerpc/psim/include/Makefile.in
deleted file mode 100644
index 93ed75d4a2..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/include/Makefile.in
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-# If you add equate files, don't forget to uncomment the install line
-# below.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/powerpc/psim/include/bsp.h b/c/src/lib/libbsp/powerpc/psim/include/bsp.h
deleted file mode 100644
index b166159bbe..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/include/bsp.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/* bsp.h
- *
- * This include file contains all Papyrus board IO definitions.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/lib/libbsp/no_cpu/no_bsp/include/bsp.h
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#ifndef __PAPYRUS_h
-#define __PAPYRUS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef ASM
-/* Definition of where to store registers in alignment handler */
-#define ALIGN_REGS 0x0140
-
-#else
-#include <rtems.h>
-#include <console.h>
-#include <clockdrv.h>
-#include <console.h>
-#include <iosupp.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-
-/*
- * Stuff for Time Test 27
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 1
-
-#define Install_tm27_vector( _handler ) \
- set_vector( (_handler), PPC_IRQ_DECREMENTER, 1 )
-
-#define Cause_tm27_intr() \
- do { \
- unsigned32 _clicks = 1; \
- asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
- } while (0)
-
-
-#define Clear_tm27_intr() \
- do { \
- unsigned32 _clicks = 0xffffffff; \
- asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
- } while (0)
-
-#define Lower_tm27_intr() \
- do { \
- unsigned32 _msr = 0; \
- _ISR_Set_level( 0 ); \
- asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
- _msr |= 0x8002; \
- asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
- } while (0)
-
-/* Constants */
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-
-/*
- * Information placed in the linkcmds file.
- */
-
-extern int RAM_START;
-extern int RAM_END;
-extern int RAM_SIZE;
-
-extern int PROM_START;
-extern int PROM_END;
-extern int PROM_SIZE;
-
-extern int CLOCK_SPEED;
-
-extern int end; /* last address in the program */
-
-/* functions */
-
-void bsp_start( void );
-
-void bsp_cleanup( void );
-
-rtems_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-);
-
-void DEBUG_puts( char *string );
-
-void BSP_fatal_return( void );
-
-void bsp_spurious_initialize( void );
-
-extern rtems_configuration_table BSP_Configuration; /* owned by BSP */
-
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
-extern rtems_unsigned32 bsp_isr_level;
-
-#endif /* ASM */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/powerpc/psim/include/coverhd.h b/c/src/lib/libbsp/powerpc/psim/include/coverhd.h
deleted file mode 100644
index cc279ea56f..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/include/coverhd.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- * This file should be updated after running the C overhead timing
- * test. Once this update has been performed, the RTEMS Time Test
- * Suite should be rebuilt to account for these overhead times in the
- * timing results.
- *
- * NOTE: If these are all zero, then the times reported include
- * all calling overhead including passing of arguments.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Updated for a 25MHz Papyrus by Andrew Bray <andy@i-cubed.co.uk>
- *
- * Units are 100ns.
- *
- * These numbers are of questionable use, as they are developed by calling
- * the routine many times, thus getting its entry veneer into the (small)
- * cache on the 403GA. This in general is not true of the RTEMS timing
- * tests, which usually call a routine only once, thus having no cache loaded
- * advantage.
- *
- * Whether the directive times are useful after deducting the function call
- * overhead is also questionable. The user is more interested generally
- * in the total cost of a directive, not the cost if the procedure call
- * is inlined! (In general this is not true).
- *
- * Andrew Bray 18/08/1995
- *
- */
-
-#ifndef __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 1
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 1
-#define CALLING_OVERHEAD_TASK_CREATE 3
-#define CALLING_OVERHEAD_TASK_IDENT 1
-#define CALLING_OVERHEAD_TASK_START 1
-#define CALLING_OVERHEAD_TASK_RESTART 1
-#define CALLING_OVERHEAD_TASK_DELETE 1
-#define CALLING_OVERHEAD_TASK_SUSPEND 1
-#define CALLING_OVERHEAD_TASK_RESUME 1
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 1
-#define CALLING_OVERHEAD_TASK_MODE 1
-#define CALLING_OVERHEAD_TASK_GET_NOTE 1
-#define CALLING_OVERHEAD_TASK_SET_NOTE 1
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 4
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 1
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 1
-#define CALLING_OVERHEAD_CLOCK_GET 4
-#define CALLING_OVERHEAD_CLOCK_SET 3
-#define CALLING_OVERHEAD_CLOCK_TICK 1
-
-#define CALLING_OVERHEAD_TIMER_CREATE 1
-#define CALLING_OVERHEAD_TIMER_IDENT 1
-#define CALLING_OVERHEAD_TIMER_DELETE 1
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 2
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 5
-#define CALLING_OVERHEAD_TIMER_RESET 1
-#define CALLING_OVERHEAD_TIMER_CANCEL 1
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 2
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 1
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 1
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 1
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 1
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 2
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 1
-
-#define CALLING_OVERHEAD_EVENT_SEND 1
-#define CALLING_OVERHEAD_EVENT_RECEIVE 2
-#define CALLING_OVERHEAD_SIGNAL_CATCH 1
-#define CALLING_OVERHEAD_SIGNAL_SEND 1
-#define CALLING_OVERHEAD_PARTITION_CREATE 3
-#define CALLING_OVERHEAD_PARTITION_IDENT 1
-#define CALLING_OVERHEAD_PARTITION_DELETE 1
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 1
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 1
-#define CALLING_OVERHEAD_REGION_CREATE 3
-#define CALLING_OVERHEAD_REGION_IDENT 1
-#define CALLING_OVERHEAD_REGION_DELETE 1
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 2
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 1
-#define CALLING_OVERHEAD_PORT_CREATE 2
-#define CALLING_OVERHEAD_PORT_IDENT 1
-#define CALLING_OVERHEAD_PORT_DELETE 1
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 1
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 2
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 2
-#define CALLING_OVERHEAD_IO_OPEN 2
-#define CALLING_OVERHEAD_IO_CLOSE 2
-#define CALLING_OVERHEAD_IO_READ 2
-#define CALLING_OVERHEAD_IO_WRITE 2
-#define CALLING_OVERHEAD_IO_CONTROL 2
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 1
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 1
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 1
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/powerpc/psim/shmsupp/Makefile.in b/c/src/lib/libbsp/powerpc/psim/shmsupp/Makefile.in
deleted file mode 100644
index 031a0aa0cd..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/shmsupp/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/shmsupp.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=addrconv getcfg lock mpisr
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/powerpc/psim/shmsupp/README b/c/src/lib/libbsp/powerpc/psim/shmsupp/README
deleted file mode 100644
index f355851c74..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/shmsupp/README
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# $Id$
-#
-
-This shared memory driver support code works with a modified version
-of the PowerPC Simulator. The modifications are not yet merged
-into the mainsteam distribution.
diff --git a/c/src/lib/libbsp/powerpc/psim/shmsupp/addrconv.c b/c/src/lib/libbsp/powerpc/psim/shmsupp/addrconv.c
deleted file mode 100644
index 05c0b6f6c1..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/shmsupp/addrconv.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Shm_Convert_address
- *
- * No address range conversion is required.
- *
- * Input parameters:
- * address - address to convert
- *
- * Output parameters:
- * returns - converted address
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <shm.h>
-
-void *Shm_Convert_address(
- void *address
-)
-{
- return ( address );
-}
diff --git a/c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c b/c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c
deleted file mode 100644
index fa37ceb7fa..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* void Shm_Get_configuration( localnode, &shmcfg )
- *
- * This routine initializes, if necessary, and returns a pointer
- * to the Shared Memory Configuration Table for the PowerPC PSIM.
- *
- * INPUT PARAMETERS:
- * localnode - local node number
- * shmcfg - address of pointer to SHM Config Table
- *
- * OUTPUT PARAMETERS:
- * *shmcfg - pointer to SHM Config Table
- *
- * NOTES: No interrupt support.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include "shm.h"
-
-#define INTERRUPT 0 /* PSIM target supports only */
-#define POLLING 1 /* polling mode. */
-
-shm_config_table BSP_shm_cfgtbl;
-
-void Shm_Get_configuration(
- rtems_unsigned32 localnode,
- shm_config_table **shmcfg
-)
-{
- BSP_shm_cfgtbl.base = (rtems_unsigned32 *)0xc0000000;
- BSP_shm_cfgtbl.length = 64 * 1024;
- BSP_shm_cfgtbl.format = SHM_BIG;
-
- BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt;
-
-#ifdef NEUTRAL_BIG
- BSP_shm_cfgtbl.convert = NULL_CONVERT;
-#else
- BSP_shm_cfgtbl.convert = CPU_swap_u32;
-#endif
-
-#if (POLLING==1)
- BSP_shm_cfgtbl.poll_intr = POLLED_MODE;
- BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT;
-#else
- BSP_shm_cfgtbl.poll_intr = INTR_MODE;
- BSP_shm_cfgtbl.Intr.address = 0;
- BSP_shm_cfgtbl.Intr.value = 0;
- BSP_shm_cfgtbl.Intr.length = BYTE;
-#endif
-
- *shmcfg = &BSP_shm_cfgtbl;
-
-}
diff --git a/c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c b/c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c
deleted file mode 100644
index 56a1087e53..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Shared Memory Lock Routines
- *
- * This shared memory locked queue support routine need to be
- * able to lock the specified locked queue. Interrupts are
- * disabled while the queue is locked to prevent preemption
- * and deadlock when two tasks poll for the same lock.
- * previous level.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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 <rtems.h>
-#include <bsp.h>
-#include <shm.h>
-
-typedef volatile unsigned int volint;
-
-/*
- * Shm_Initialize_lock
- *
- * Initialize the lock for the specified locked queue.
- */
-
-void Shm_Initialize_lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- /* nothing required -- done implicitly by device tree */
-}
-
-/* void _Shm_Lock( &lq_cb )
- *
- * This shared memory locked queue support routine locks the
- * specified locked queue. It disables interrupts to prevent
- * a deadlock condition.
- */
-
-void Shm_Lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- volint *p = (volint *)0xc0010000;
-
- (void) p[1];
-}
-
-/*
- * Shm_Unlock
- *
- * Unlock the lock for the specified locked queue.
- */
-
-void Shm_Unlock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- volint *p = (volint *)0xc0010000;
-
- (void) p[2];
-}
-
diff --git a/c/src/lib/libbsp/powerpc/psim/shmsupp/mpisr.c b/c/src/lib/libbsp/powerpc/psim/shmsupp/mpisr.c
deleted file mode 100644
index e31dd2c615..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/shmsupp/mpisr.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * NOTE: This routine is not used when in polling mode. Either
- * this routine OR Shm_clockisr is used in a particular system.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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 <rtems.h>
-#include <bsp.h>
-#include <shm.h>
-
-
-/* void _Shm_setvec( )
- *
- * This driver routine sets the SHM interrupt vector to point to the
- * driver's SHM interrupt service routine.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void Shm_setvec()
-{
- /* not supported */
-}
diff --git a/c/src/lib/libbsp/powerpc/psim/start/Makefile.in b/c/src/lib/libbsp/powerpc/psim/start/Makefile.in
deleted file mode 100644
index 35377e94f1..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/start/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/startsim.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=startsim
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/powerpc/psim/start/startsim.s b/c/src/lib/libbsp/powerpc/psim/start/startsim.s
deleted file mode 100644
index f94a3ca330..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/start/startsim.s
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * This is based on the mvme-crt0.S file from libgloss/rs6000.
- * crt0.S -- startup file for PowerPC systems.
- *
- * Copyright (c) 1995 Cygnus Support
- *
- * The authors hereby grant permission to use, copy, modify, distribute,
- * and license this software and its documentation for any purpose, provided
- * that existing copyright notices are retained in all copies and that this
- * notice is included verbatim in any distributions. No written agreement,
- * license, or royalty fee is required for any of the authorized uses.
- * Modifications to this software may be copyrighted by their authors
- * and need not follow the licensing terms described here, provided that
- * the new terms are clearly indicated on the first page of each file where
- * they apply.
- *
- * $Id$
- */
-
-#include "ppc-asm.h"
-
- .file "startsim.s"
- .section ".got2","aw"
- .align 2
-
-.LCTOC1 = .+32768
-
- .extern FUNC_NAME(atexit)
- .globl FUNC_NAME(__atexit)
- .section ".sdata","aw"
- .align 2
-FUNC_NAME(__atexit): /* tell C's eabi-ctor's we have an atexit function */
- .long FUNC_NAME(atexit)@fixup /* and that it is to register __do_global_dtors */
-
- .section ".fixup","aw"
- .align 2
- .long FUNC_NAME(__atexit)
-
- .section ".got2","aw"
-.Ltable = .-.LCTOC1
- .long .LCTOC1 /* address we think .LCTOC1 is loaded at */
-
-.Lbss_start = .-.LCTOC1
- .long __bss_start
-
-.Lend = .-.LCTOC1
- .long _end
-
-.Lstack = .-.LCTOC1 /* stack address if set by user */
- .long __stack
-
- .text
-.Lptr:
- .long .LCTOC1-.Laddr
-
- .globl _start
- .type _start,@function
-_start:
- bl .Laddr /* get current address */
-.Laddr:
- mflr r4 /* real address of .Laddr */
- lwz r5,(.Lptr-.Laddr)(r4) /* linker generated address of .LCTOC1 */
- add r5,r5,r4 /* correct to real pointer */
- lwz r4,.Ltable(r5) /* get linker's idea of where .Laddr is */
- subf r4,r4,r5 /* calculate difference between where linked and current */
-
- /* clear bss */
- lwz r6,.Lbss_start(r5) /* calculate beginning of the BSS */
- lwz r7,.Lend(r5) /* calculate end of the BSS */
- add r6,r6,r4 /* adjust pointers */
- add r7,r7,r4
-
- cmplw 1,r6,r7
- bc 4,4,.Ldone
-
- subf r8,r6,r7 /* number of bytes to zero */
- srwi r9,r8,2 /* number of words to zero */
- mtctr r9
- li r0,0 /* zero to clear memory */
- addi r6,r6,-4 /* adjust so we can use stwu */
-.Lloop:
- stwu r0,4(r6) /* zero bss */
- bdnz .Lloop
-
-.Ldone:
-
- lwz r0,.Lstack(r5) /* stack address or 0 */
- cmplwi 1,r0,0 /* equal to 0? */
- bc 12,6,.Lnostack /* use default stack if == 0 */
- mr sp,r0 /* use user defined stack */
-
-.Lnostack:
- /* set up initial stack frame */
- addi sp,sp,-4 /* make sure we don't overwrite debug mem */
- lis r0,0
- stw r0,0(sp) /* clear back chain */
- stwu sp,-56(sp) /* push another stack frame */
-
- /* Let her rip */
- bl FUNC_NAME(boot_card)
-
- /* return value from boot_card is argument to exit */
- bl FUNC_NAME(exit)
- trap
-.Lstart:
- .size _start,.Lstart-_start
diff --git a/c/src/lib/libbsp/powerpc/psim/startsim/Makefile.in b/c/src/lib/libbsp/powerpc/psim/startsim/Makefile.in
deleted file mode 100644
index 35377e94f1..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/startsim/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/startsim.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=startsim
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/powerpc/psim/startsim/startsim.s b/c/src/lib/libbsp/powerpc/psim/startsim/startsim.s
deleted file mode 100644
index f94a3ca330..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/startsim/startsim.s
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * This is based on the mvme-crt0.S file from libgloss/rs6000.
- * crt0.S -- startup file for PowerPC systems.
- *
- * Copyright (c) 1995 Cygnus Support
- *
- * The authors hereby grant permission to use, copy, modify, distribute,
- * and license this software and its documentation for any purpose, provided
- * that existing copyright notices are retained in all copies and that this
- * notice is included verbatim in any distributions. No written agreement,
- * license, or royalty fee is required for any of the authorized uses.
- * Modifications to this software may be copyrighted by their authors
- * and need not follow the licensing terms described here, provided that
- * the new terms are clearly indicated on the first page of each file where
- * they apply.
- *
- * $Id$
- */
-
-#include "ppc-asm.h"
-
- .file "startsim.s"
- .section ".got2","aw"
- .align 2
-
-.LCTOC1 = .+32768
-
- .extern FUNC_NAME(atexit)
- .globl FUNC_NAME(__atexit)
- .section ".sdata","aw"
- .align 2
-FUNC_NAME(__atexit): /* tell C's eabi-ctor's we have an atexit function */
- .long FUNC_NAME(atexit)@fixup /* and that it is to register __do_global_dtors */
-
- .section ".fixup","aw"
- .align 2
- .long FUNC_NAME(__atexit)
-
- .section ".got2","aw"
-.Ltable = .-.LCTOC1
- .long .LCTOC1 /* address we think .LCTOC1 is loaded at */
-
-.Lbss_start = .-.LCTOC1
- .long __bss_start
-
-.Lend = .-.LCTOC1
- .long _end
-
-.Lstack = .-.LCTOC1 /* stack address if set by user */
- .long __stack
-
- .text
-.Lptr:
- .long .LCTOC1-.Laddr
-
- .globl _start
- .type _start,@function
-_start:
- bl .Laddr /* get current address */
-.Laddr:
- mflr r4 /* real address of .Laddr */
- lwz r5,(.Lptr-.Laddr)(r4) /* linker generated address of .LCTOC1 */
- add r5,r5,r4 /* correct to real pointer */
- lwz r4,.Ltable(r5) /* get linker's idea of where .Laddr is */
- subf r4,r4,r5 /* calculate difference between where linked and current */
-
- /* clear bss */
- lwz r6,.Lbss_start(r5) /* calculate beginning of the BSS */
- lwz r7,.Lend(r5) /* calculate end of the BSS */
- add r6,r6,r4 /* adjust pointers */
- add r7,r7,r4
-
- cmplw 1,r6,r7
- bc 4,4,.Ldone
-
- subf r8,r6,r7 /* number of bytes to zero */
- srwi r9,r8,2 /* number of words to zero */
- mtctr r9
- li r0,0 /* zero to clear memory */
- addi r6,r6,-4 /* adjust so we can use stwu */
-.Lloop:
- stwu r0,4(r6) /* zero bss */
- bdnz .Lloop
-
-.Ldone:
-
- lwz r0,.Lstack(r5) /* stack address or 0 */
- cmplwi 1,r0,0 /* equal to 0? */
- bc 12,6,.Lnostack /* use default stack if == 0 */
- mr sp,r0 /* use user defined stack */
-
-.Lnostack:
- /* set up initial stack frame */
- addi sp,sp,-4 /* make sure we don't overwrite debug mem */
- lis r0,0
- stw r0,0(sp) /* clear back chain */
- stwu sp,-56(sp) /* push another stack frame */
-
- /* Let her rip */
- bl FUNC_NAME(boot_card)
-
- /* return value from boot_card is argument to exit */
- bl FUNC_NAME(exit)
- trap
-.Lstart:
- .size _start,.Lstart-_start
diff --git a/c/src/lib/libbsp/powerpc/psim/startup/Makefile.in b/c/src/lib/libbsp/powerpc/psim/startup/Makefile.in
deleted file mode 100644
index 8ae332fa12..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/startup/Makefile.in
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=linkcmds device-tree $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
- $(INSTALL) $(srcdir)/device-tree ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/powerpc/psim/startup/bspclean.c b/c/src/lib/libbsp/powerpc/psim/startup/bspclean.c
deleted file mode 100644
index fce38e7b3a..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/startup/bspclean.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-void bsp_cleanup( void )
-{
- asm volatile( "li 10,99" ); /* 0x63 */
- asm volatile( "sc" );
-}
diff --git a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
deleted file mode 100644
index d898fd00d8..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * This set of routines starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before any of these are invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-#include <fcntl.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-rtems_unsigned32 bsp_isr_level;
-
-/*
- * Tells us where to put the workspace in case remote debugger is present.
- */
-
-#if 0
-extern rtems_unsigned32 rdb_start;
-#endif
-
-/*
- * Amount to increment itimer by each pass
- * It is a variable instead of a #define to allow the 'looptest'
- * script to bump it without recompiling rtems
- *
- * NOTE: This is based on the PA-RISC simulator. I don't know if we
- * can actually pull this trick on the PPC simulator.
- */
-
-rtems_unsigned32 CPU_PPC_CLICKS_PER_TICK;
-
-#if PSIM_FAST_IDLE
-
-/*
- * Many of the tests are very slow on the simulator because they have
- * have 5 second delays hardwired in.
- *
- * Try to speed those tests up by speeding up the clock when in the idle task.
- *
- * NOTE: At the current setting, 5 second delays in the tests take
- * approximately 5 seconds of wall time.
- */
-
-rtems_extension fast_idle_switch_hook(
- rtems_tcb *current_task,
- rtems_tcb *heir_task
-)
-{
- static rtems_unsigned32 normal_clock = ~0;
- static rtems_unsigned32 fast_clock;
-
- /* init our params on first call */
- if (normal_clock == (rtems_unsigned32) ~0)
- {
- normal_clock = CPU_PPC_CLICKS_PER_TICK;
- fast_clock = 10000;
-#if 0
- fast_clock = CPU_PPC_CLICKS_PER_TICK / 0x10 ;
-#endif
- if (fast_clock == 0) /* handle pathological case */
- fast_clock++;
- }
-
- /*
- * Run the clock faster when idle is in place.
- */
-
- if (heir_task == _Thread_Idle)
- CPU_PPC_CLICKS_PER_TICK = fast_clock;
- else if (current_task == _Thread_Idle)
- CPU_PPC_CLICKS_PER_TICK = normal_clock;
-}
-
-#endif
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * bsp_pretasking_hook
- *
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
- rtems_unsigned32 heap_size;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- heap_size = BSP_Configuration.work_space_start - (void *)&end;
- heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
-
- bsp_libc_init((void *) heap_start, heap_size, 0);
-
-#if PSIM_FAST_IDLE
- /*
- * Install the fast idle task switch extension
- *
- * On MP systems, might not want to do this; it confuses at least
- * one test (mp06) on the PA-RISC simulator
- */
-
-#if 0
- if (BSP_Configuration.User_multiprocessing_table == 0)
-#endif
- {
- rtems_extensions_table fast_idle_extension;
- rtems_id extension_id;
- rtems_status_code rc;
-
- memset(&fast_idle_extension, 0, sizeof(fast_idle_extension));
-
- fast_idle_extension.thread_switch = fast_idle_switch_hook;
-
- rc = rtems_extension_create(
- rtems_build_name('F', 'D', 'L', 'E'),
- &fast_idle_extension,
- &extension_id
- );
- if (rc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(rc);
- }
-#endif
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- unsigned char *work_space_start;
-
-#if 0
- /*
- * Set MSR to show vectors at 0 XXX
- */
- _CPU_MSR_Value( msr_value );
- msr_value &= ~PPC_MSR_EP;
- _CPU_MSR_SET( msr_value );
-#endif
-
- /*
- * Set up our hooks
- * Make sure libc_init is done before drivers initialized so that
- * they can use atexit()
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
-
- /*
- * Is this true?
- *
- * PSIM does zero out memory BUT only when IT begins execution. Thus
- * if we want to have a clean slate in the workspace each time we
- * begin execution of OUR application, then we must zero the workspace.
- *
- * It is true that it takes simulated time to clear the memory.
- */
-
- Cpu_table.do_zero_of_workspace = FALSE;
-
- Cpu_table.interrupt_stack_size = (12 * 1024);
-
- /*
- * The monitor likes the exception table to be at 0x0.
- */
-
- Cpu_table.exceptions_in_RAM = TRUE;
-
-/*
-#if defined(RTEMS_POSIX_API)
- BSP_Configuration.work_space_size *= 3;
-#endif
-*/
-
- BSP_Configuration.work_space_size += 1024;
-
-#if 0
- work_space_start =
- (unsigned char *)rdb_start - BSP_Configuration.work_space_size;
-#endif
-
- work_space_start =
- (unsigned char *)&RAM_END - BSP_Configuration.work_space_size;
-
- if ( work_space_start <= (unsigned char *)&end ) {
- DEBUG_puts( "bspstart: Not enough RAM!!!\n" );
- bsp_cleanup();
- }
-
- BSP_Configuration.work_space_start = work_space_start;
-
- /*
- * Account for the console's resources
- */
-
- console_reserve_resources( &BSP_Configuration );
-
-#if PSIM_FAST_IDLE
- /*
- * Add 1 extension for fast idle
- */
-
- BSP_Configuration.maximum_extensions++;
-#endif
-
- /*
- * Set the "clicks per tick" for the simulator
- * used by XXX/clock/clock.c to schedule interrupts
- *
- * NOTE: On psim, each click of the decrementer register corresponds
- * to 1 instruction. By setting this to 100, we are indicating
- * that we are assuming it can execute 100 instructions per
- * microsecond. This corresponds to sustaining 1 instruction
- * per cycle at 100 Mhz. Whether this is a good guess or not
- * is anyone's guess.
- */
-
- {
- extern int PSIM_INSTRUCTIONS_PER_MICROSECOND;
-
- CPU_PPC_CLICKS_PER_TICK = BSP_Configuration.microseconds_per_tick *
- (int) &PSIM_INSTRUCTIONS_PER_MICROSECOND;
- }
-}
diff --git a/c/src/lib/libbsp/powerpc/psim/startup/device-tree b/c/src/lib/libbsp/powerpc/psim/startup/device-tree
deleted file mode 100644
index 29873839e5..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/startup/device-tree
+++ /dev/null
@@ -1,3 +0,0 @@
-#/openprom/init/register/pc 0
-#/openprom/options/smp 2
-/openprom/options/oea-memory-size 4194304
diff --git a/c/src/lib/libbsp/powerpc/psim/startup/linkcmds b/c/src/lib/libbsp/powerpc/psim/startup/linkcmds
deleted file mode 100644
index 61b61bf5c0..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/startup/linkcmds
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
- "elf32-powerpc")
-OUTPUT_ARCH(powerpc)
-ENTRY(_start)
- /*SEARCH_DIR(/usr1/gnu/cross/powerpc-unknown-eabi//powerpc-unknown-eabi/lib); */
-/* Do we need any of these for elf?
- __DYNAMIC = 0; */
-PROVIDE (PSIM_INSTRUCTIONS_PER_MICROSECOND = 100);
-MEMORY
- {
- RAM : ORIGIN = 0, LENGTH = 4M
- EPROM : ORIGIN = 0xFFF00000, LENGTH = 0x20000
- }
-
-SECTIONS
-{
- .vectors 0xFFF00100 :
- {
- *(.vectors)
- } >EPROM
-
- /* Read-only sections, merged into text segment: */
- /* . = 0x40000 + SIZEOF_HEADERS; */
- . = 0x4000;
- .interp : { *(.interp) }
- .hash : { *(.hash) }
- .dynsym : { *(.dynsym) }
- .dynstr : { *(.dynstr) }
- .rela.text : { *(.rela.text) }
- .rela.data : { *(.rela.data) }
- .rela.rodata : { *(.rela.rodata) }
- .rela.got : { *(.rela.got) }
- .rela.got1 : { *(.rela.got1) }
- .rela.got2 : { *(.rela.got2) }
- .rela.ctors : { *(.rela.ctors) }
- .rela.dtors : { *(.rela.dtors) }
- .rela.init : { *(.rela.init) }
- .rela.fini : { *(.rela.fini) }
- .rela.bss : { *(.rela.bss) }
- .rela.plt : { *(.rela.plt) }
- .rela.sdata : { *(.rela.sdata2) }
- .rela.sbss : { *(.rela.sbss2) }
- .rela.sdata2 : { *(.rela.sdata2) }
- .rela.sbss2 : { *(.rela.sbss2) }
- .plt : { *(.plt) }
- .text :
- {
- *(.text)
- *(.descriptors)
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
- } >RAM
- .init : { *(.init) } >RAM
- .fini : { *(.fini) } >RAM
- .rodata : { *(.rodata) *(.gnu.linkonce.r*) } >RAM
- .rodata1 : { *(.rodata1) } >RAM
- _etext = .;
- PROVIDE (etext = .);
- PROVIDE (__SDATA2_START__ = .);
- .sdata2 : { *(.sdata2) } >RAM
- .sbss2 : { *(.sbss2) } >RAM
- PROVIDE (__SBSS2_END__ = .);
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. It would
- be more correct to do this:
- . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
- The current expression does not correctly handle the case of a
- text segment ending precisely at the end of a page; it causes the
- data segment to skip a page. The above expression does not have
- this problem, but it will currently (2/95) cause BFD to allocate
- a single segment, combining both text and data, for this case.
- This will prevent the text segment from being shared among
- multiple executions of the program; I think that is more
- important than losing a page of the virtual address space (note
- that no actual memory is lost; the page which is skipped can not
- be referenced). */
- . = ALIGN(8) + 0x40000;
- .data :
- {
- *(.data)
- CONSTRUCTORS
- } >RAM
- PROVIDE (__EXCEPT_START__ = .);
- .gcc_except_table : { *(.gcc_except_table) } >RAM
- PROVIDE (__EXCEPT_END__ = .);
-
- .data1 : { *(.data1) } >RAM
- .got1 : { *(.got1) } >RAM
- .dynamic : { *(.dynamic) } >RAM
- /* Put .ctors and .dtors next to the .got2 section, so that the pointers
- get relocated with -mrelocatable. Also put in the .fixup pointers.
- The current compiler no longer needs this, but keep it around for 2.7.2 */
- PROVIDE (__GOT2_START__ = .);
- PROVIDE (_GOT2_START_ = .);
- .got2 : { *(.got2) } >RAM
- PROVIDE (__GOT2_END__ = .);
- PROVIDE (_GOT2_END_ = .);
-
- PROVIDE (__CTOR_LIST__ = .);
- .ctors : { *(.ctors) } >RAM
- PROVIDE (__CTOR_END__ = .);
-
- PROVIDE (__DTOR_LIST__ = .);
- .dtors : { *(.dtors) } >RAM
- PROVIDE (__DTOR_END__ = .);
-
- PROVIDE (__FIXUP_START__ = .);
- PROVIDE (_FIXUP_START_ = .);
- .fixup : { *(.fixup) } >RAM
- PROVIDE (_FIXUP_END_ = .);
- PROVIDE (__FIXUP_END__ = .);
-
- PROVIDE (__GOT_START__ = .);
- PROVIDE (_GOT_START_ = .);
- s.got = .;
- .got : { *(.got) } >RAM
- .got.plt : { *(.got.plt) } >RAM
- PROVIDE (_GOT_END_ = .);
- PROVIDE (__GOT_END__ = .);
-
- /* We want the small data sections together, so single-instruction offsets
- can access them all, and initialized data all before uninitialized, so
- we can shorten the on-disk segment size. */
- PROVIDE (__SDATA_START__ = .);
- .sdata : { *(.sdata) } >RAM
- _edata = .;
- PROVIDE (edata = .);
-
- PROVIDE (RAM_END = 0x3f0000);
- .sbss :
- {
- PROVIDE (__sbss_start = .);
- *(.sbss)
- *(.scommon)
- PROVIDE (__sbss_end = .);
- } >RAM
- PROVIDE (__SBSS_END__ = .);
-
- .bss :
- {
- PROVIDE (__bss_start = .);
- *(.dynbss)
- *(.bss)
- *(COMMON)
- } >RAM
- . = ALIGN(8) + 0x8000;
- PROVIDE(__stack = .);
- _end = . ;
- PROVIDE (end = .);
-
- /* These are needed for ELF backends which have not yet been
- converted to the new style linker. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- /* DWARF debug sections.
- Symbols in the DWARF debugging sections are relative to the beginning
- of the section so we begin them at 0. */
- /* DWARF 1 */
- .debug 0 : { *(.debug) }
- .line 0 : { *(.line) }
- /* GNU DWARF 1 extensions */
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- /* DWARF 1.1 and DWARF 2 */
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- /* DWARF 2 */
- .debug_info 0 : { *(.debug_info) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_line 0 : { *(.debug_line) }
- .debug_frame 0 : { *(.debug_frame) }
- .debug_str 0 : { *(.debug_str) }
- .debug_loc 0 : { *(.debug_loc) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
- /* SGI/MIPS DWARF 2 extensions */
- .debug_weaknames 0 : { *(.debug_weaknames) }
- .debug_funcnames 0 : { *(.debug_funcnames) }
- .debug_typenames 0 : { *(.debug_typenames) }
- .debug_varnames 0 : { *(.debug_varnames) }
- /* These must appear regardless of . */
-}
diff --git a/c/src/lib/libbsp/powerpc/psim/startup/setvec.c b/c/src/lib/libbsp/powerpc/psim/startup/setvec.c
deleted file mode 100644
index dcdd94c665..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/startup/setvec.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on the target Board/CPU.
- * This routine is allowed to be as board dependent as necessary.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/lib/libbsp/no_cpu/no_bsp/startup/setvec.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-
-rtems_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- rtems_isr_entry previous_isr;
-
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
-
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/powerpc/psim/timer/Makefile.in b/c/src/lib/libbsp/powerpc/psim/timer/Makefile.in
deleted file mode 100644
index 16665e4de9..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/powerpc/psim/timer/timer.c b/c/src/lib/libbsp/powerpc/psim/timer/timer.c
deleted file mode 100644
index 8140108c21..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/timer/timer.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* timer.c
- *
- * This file implements a benchmark timer using the General Purpose Timer on
- * the MEC.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#include <assert.h>
-
-#include <bsp.h>
-
-rtems_unsigned64 Timer_driver_Start_time;
-
-rtems_boolean Timer_driver_Find_average_overhead;
-
-void Timer_initialize()
-{
- /*
- * Timer runs long and accurate enough not to require an interrupt.
- */
-
-
- Timer_driver_Start_time = PPC_Get_timebase_register();
-
-
-}
-
-#define AVG_OVERHEAD 24 /* It typically takes 24 instructions */
- /* to start/stop the timer. */
-#define LEAST_VALID 1 /* Don't trust a value lower than this */
- /* psim can count instructions. :) */
-
-int Read_timer()
-{
- rtems_unsigned64 clicks;
- rtems_unsigned64 total64;
- rtems_unsigned32 total;
-
- /* approximately CLOCK_SPEED clicks per microsecond */
-
- clicks = PPC_Get_timebase_register();
-
- assert( clicks > Timer_driver_Start_time );
-
- total64 = clicks - Timer_driver_Start_time;
-
- assert( total64 <= 0xffffffff ); /* fits into a unsigned32 */
-
- total = (rtems_unsigned32) total64;
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in one microsecond units */
-
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
-
- return total - AVG_OVERHEAD;
-}
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/powerpc/psim/tools/Makefile.in b/c/src/lib/libbsp/powerpc/psim/tools/Makefile.in
deleted file mode 100644
index 5e5b785fc9..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/tools/Makefile.in
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-DESTDIR=$(PROJECT_RELEASE)/tests
-
-PGMS=runtest psim
-
-INSTALLED=$(PGMS:%=$(DESTDIR)/%)
-
-all: $(DESTDIR) $(PGMS) install
-
-install: $(INSTALLED)
- rm -f $(DESTDIR)/psim-gdb
- cp $(DESTDIR)/psim $(DESTDIR)/psim-gdb
-
-# Install the program
-$(DESTDIR)/%: %
- $(make-script)
-
-
diff --git a/c/src/lib/libbsp/powerpc/psim/tools/psim b/c/src/lib/libbsp/powerpc/psim/tools/psim
deleted file mode 100755
index 593148fd08..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/tools/psim
+++ /dev/null
@@ -1,52 +0,0 @@
-#! /bin/sh
-#
-# Shell script to ease invocation of the powerpc simulator
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and distribution terms for this file may be
-# found in found in the file LICENSE in this distribution or at
-# http://www.OARcorp.com/rtems/license.html.
-#
-# $Id$
-#
-
-TREE_FILE=psim_tree.${LOGNAME}
-GDB_FILE=gdb_tree.${LOGNAME}
-
-# GDB_DEBUG="-t sem-device"
-# RUN_DEBUG="-t sem_device"
-
-# Build this user's device tree file
-echo "/#address-cells 2" > ${TREE_FILE}
-echo "/openprom/options/oea-memory-size 4194304" >> ${TREE_FILE}
-# These require the semaphore and shared memory device models.
-# echo "/shm@0xc0000000/reg 0xc0000000 0x10000" >> ${TREE_FILE}
-# echo "/shm@0xc0000000/key ${RTEMS_SHM_KEY}" >> ${TREE_FILE}
-# echo "/sem@0xc0010000/reg 0xc0010000 12" >> ${TREE_FILE}
-# echo "/sem@0xc0010000/key ${RTEMS_SHM_SEMAPHORE_KEY}" >> ${TREE_FILE}
-# echo "/sem@0xc0010000/value -1" >> ${TREE_FILE}
-#
-# Build this user's gdb script
-echo "tar sim -f ${TREE_FILE} ${GDB_DEBUG}" > ${GDB_FILE}
-echo "load" >> ${GDB_FILE}
-echo "b _Internal_error_Occurred" >> ${GDB_FILE}
-echo "b rtems_fatal_error_occurred" >> ${GDB_FILE}
-echo "b __assert" >> ${GDB_FILE}
-
-RUN=powerpc-rtems-run
-GDB=powerpc-rtems-gdb
-
-case $0 in
- *gdb*)
- ${GDB} -x ${GDB_FILE} $*
- ;;
- *)
- # ${RUN} -f ${TREE_FILE} $*
- ${RUN} -f ${TREE_FILE} ${RUN_DEBUG} $*
- ;;
-esac
-exit $?
-
diff --git a/c/src/lib/libbsp/powerpc/psim/tools/runtest b/c/src/lib/libbsp/powerpc/psim/tools/runtest
deleted file mode 100755
index a173b53c2f..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/tools/runtest
+++ /dev/null
@@ -1,286 +0,0 @@
-#!/bin/sh -p
-#
-# Run rtems tests on the powerpc simulator
-# This program generates a simulator script to run each test
-# Typically the test is then run, although it can be generated
-# and left as a file using -s
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and distribution terms for this file may be
-# found in found in the file LICENSE in this distribution or at
-# http://www.OARcorp.com/rtems/license.html.
-#
-# $Id$
-#
-
-# progname=`basename $0`
-progname=${0##*/} # fast basename hack for ksh, bash
-
-USAGE=\
-"usage: $progname [ -opts ] test [ test ... ]
- -o options -- specify options to be passed to simulator
- -v -- verbose
- -d -- generate device tree file (as 'test'.device) and exit
- -l logdir -- specify log directory (default is 'logdir')
-
- Specify test as 'test' or 'test.exe'.
- All multiprocessing tests *must* be specified simply as 'mp01', etc.
-"
-
-# export everything
-set -a
-
-# log an error to stderr
-prerr()
-{
- echo "$*" >&2
-}
-
-fatal() {
- [ "$1" ] && prerr $*
- prerr "$USAGE"
- exit 1
-}
-
-warn() {
- [ "$1" ] && prerr $*
-}
-
-# print args, 1 per line
-ml_echo()
-{
- for l
- do
- echo "$l"
- done
-}
-
-# run at normal and signalled exit
-test_exit()
-{
- exit_code=$1
-
- rm -f ${logfile}.tmp*
- [ "$sim_pid" ] && kill -9 $sim_pid
-
- exit $exit_code
-}
-
-#
-# process the options
-#
-# defaults for getopt vars
-#
-# max_run_time is defaulted to 5 minutes
-#
-
-verbose=""
-extra_options=""
-device_and_exit=""
-stdio_setup="yes"
-run_to_completion="yes"
-logdir=log
-update_on_tick="no"
-max_run_time=$((5 * 60))
-using_print_buffer="yes"
-#simulator=/usr1/rtems/work/ada/4.00/ppc_src/b-gdb/sim/ppc/run
-simulator=powerpc-rtems-run
-instruction_limit=1000000000
-sizeof_ram=4194304
-
-while getopts vdl:o:s: OPT
-do
- case "$OPT" in
- v)
- verbose="yes";;
- d)
- device_and_exit="yes"
- run_to_completion="no"
- stdio_setup="no";;
- l)
- logdir="$OPTARG";;
- o)
- extra_options="$OPTARG";;
- r)
- sizeof_ram="$OPTARG";;
- s)
- simulator="$OPTARG";;
- *)
- fatal;;
- esac
-done
-
-let $((shiftcount = $OPTIND - 1))
-shift $shiftcount
-
-args=$*
-
-#
-# Check some parameters
-#
-
-# JRS CHANGE
-# if [ ! -x ${simulator} ] ; then
-# fatal "${simulator} is not executable"
-# fi;
-
-#
-# Run the tests
-#
-
-tests="$args"
-if [ ! "$tests" ]
-then
- set -- `echo *.exe`
- tests="$*"
-fi
-
-[ -d $logdir ] ||
- mkdir $logdir || fatal "could not create log directory ($logdir)"
-
-# where the tmp files go
-trap "test_exit" 1 2 3 13 14 15
-
-for tfile in $tests
-do
-
- tname=`basename $tfile .exe`
- cpus="1"
- TEST_TYPE="single"
-
- case $tname in
- # size is no longer interactive.
- monitor*| termios*)
- if [ $run_to_completion = "yes" ]
- then
- warn "Skipping $tname; it is interactive"
- continue
- fi
- ;;
- *-node2*)
- warn "Skipping $tname; 'runtest' runs both nodes when for *-node1"
- continue;;
- *-node1*)
- warn "Running both nodes associated with $tname"
- tname=`echo $tname | sed 's/-node.*//'`
- TEST_TYPE="mp"
- ;;
- stackchk*|spfatal*|malloctest*)
- continue
- ;;
- esac
-
- if [ $TEST_TYPE = "mp" ]
- then
- cpus="1 2"
-
- logfile1=$logdir/${tname}_1
- logfile2=$logdir/${tname}_2
- infofile1=$logfile1.info
- infofile2=$logfile2.info
-
- rm -f ${logfile1} ${logfile2}
-
- date=`date`
- echo "Starting $tname at $date"
-
- ${simulator} $extra_options -c ${instruction_limit} \
- -o "/#address-cells 2" \
- -o "/openprom/options/oea-memory-size ${sizeof_ram}" \
- -o "/shm@0xc0000000/reg 0xc0000000 0x10000" \
- -o "/shm@0xc0000000/key 0x1234" \
- -o "/sem@0xc0010000/reg 0xc0010000 12" \
- -o "/sem@0xc0010000/key 0x1234" \
- -o "/sem@0xc0010000/value 1" ${tname}-node1.exe | \
- sed -e 's/ //' -e '/^$/d' > ${logfile1} &
-
- ${simulator} $extra_options -c ${instruction_limit} \
- -o "/#address-cells 2" \
- -o "/openprom/options/oea-memory-size ${sizeof_ram}" \
- -o "/shm@0xc0000000/reg 0xc0000000 0x10000" \
- -o "/shm@0xc0000000/key 0x1234" \
- -o "/sem@0xc0010000/reg 0xc0010000 12" \
- -o "/sem@0xc0010000/key 0x1234" \
- -o "/sem@0xc0010000/value -1" ${tname}-node2.exe | \
- sed -e 's/ //' -e '/^$/d' > ${logfile2} &
-
- wait
-
- fi
-
- if [ $TEST_TYPE = "single" ]
- then
- logfile=$logdir/${tname}_1
- infofile=$logfile.info
-
- rm -f ${logfile}.tmp*
-
- date=`date`
- echo "Starting $tname at $date"
-
- # Generate a device file to get the work done.
- # The device file must do the following:
- #
- # arrange for more memory (2 Mb)
-
- if [ "$device_and_exit" = "yes" ]
- then
- fatal "Cannot currently generate device files"
- fi
-
- # Spin off the simulator in the background
- # -c sets an instruction limit
-
- # Don't need to make sure it won't run forever... since there is
- # an instruction count limit
-
- #powerpc-rtems-run $extra_options -c ${instruction_limit} \
- # -f ${devicefile} $tfile | sed -e 's/ //' -e '/^$/d' > ${logfile}
-
- ${simulator} $extra_options -c ${instruction_limit} \
- -o "/#address-cells 2" \
- -o "/openprom/options/oea-memory-size ${sizeof_ram}" \
- $tfile | sed -e 's/ //' -e '/^$/d' > ${logfile}
- fi
-
- # Create the info files
- for cpu in $cpus
- do
- {
- echo "$date"
- echo "Test run on: `uname -n`"
- echo "Host Information:"
- echo `uname -a`
- echo
-
- #sed -e 's/ //' < ${logdir}/${tname}_${cpu}
- cat ${logdir}/${tname}_${cpu}
-
- if [ "$ran_too_long" = "yes" ]
- then
- echo "Test did NOT finish normally; killed after $max_run_time seconds"
- fi
-
- echo
- date;
- } > ${logdir}/${tname}_${cpu}.info
- done
-
- if [ "$cpus" = "1" ]
- then
- mv ${infofile} $logdir/${tname}.info
- mv ${logfile} $logdir/${tname}
- fi
-
-done
-
-echo "Tests completed at " `date`
-test_exit 0
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
-
diff --git a/c/src/lib/libbsp/powerpc/psim/vectors/Makefile.in b/c/src/lib/libbsp/powerpc/psim/vectors/Makefile.in
deleted file mode 100644
index 031b7ca193..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/vectors/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/vectors.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=align_h vectors
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/powerpc/psim/vectors/README b/c/src/lib/libbsp/powerpc/psim/vectors/README
deleted file mode 100644
index 4081ae2525..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/vectors/README
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# $Id$
-#
-
-The location of the vectors file object is critical.
-
-From the comments at the head of vectors.s:
-
- The issue with this file is getting it loaded at the right place.
- The first vector MUST be at address 0x????0100.
- How this is achieved is dependant on the tool chain.
-
- However the basic mechanism for ELF assemblers is to create a
- section called ".vectors", which will be loaded to an address
- between 0x????0000 and 0x????0100 (inclusive) via a link script.
-
- The basic mechanism for XCOFF assemblers is to place it in the
- normal text section, and arrange for this file to be located
- at an appropriate position on the linker command line.
-
- The variable 'PPC_VECTOR_FILE_BASE' must be defined to be the
- offset from 0x????0000 to the first location in the file. This
- will usually be 0x0000 or 0x0100.
-
-Andrew Bray 18/8/1995
diff --git a/c/src/lib/libbsp/powerpc/psim/vectors/align_h.s b/c/src/lib/libbsp/powerpc/psim/vectors/align_h.s
deleted file mode 100644
index d16298343d..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/vectors/align_h.s
+++ /dev/null
@@ -1,434 +0,0 @@
-/* align_h.s 1.1 - 95/12/04
- *
- * This file contains the assembly code for the PowerPC 403
- * alignment exception handler for RTEMS.
- *
- * Based upon IBM provided code with the following release:
- *
- * This source code has been made available to you by IBM on an AS-IS
- * basis. Anyone receiving this source is licensed under IBM
- * 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 IBM patents or
- * patent applications is to be implied by the copyright license.
- *
- * Any user of this software should understand that IBM 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 IBM copyright notice, this paragraph, and the
- * preceding two paragraphs in the transferred software.
- *
- * COPYRIGHT I B M CORPORATION 1995
- * LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
- *
- * Modifications:
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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$
- */
-
-#include "asm.h"
-#include "bsp.h"
-
-.set CACHE_SIZE,16 # cache line size of 32 bytes
-.set CACHE_SIZE_L2,4 # cache line size, log 2
-
-.set Open_gpr0,0
-.set Open_gpr1,4
-.set Open_gpr2,8
-.set Open_gpr3,12
-.set Open_gpr4,16
-.set Open_gpr5,20
-.set Open_gpr6,24
-.set Open_gpr7,28
-.set Open_gpr8,32
-.set Open_gpr9,36
-.set Open_gpr10,40
-.set Open_gpr11,44
-.set Open_gpr12,48
-.set Open_gpr13,52
-.set Open_gpr14,56
-.set Open_gpr15,60
-.set Open_gpr16,64
-.set Open_gpr17,68
-.set Open_gpr18,72
-.set Open_gpr19,76
-.set Open_gpr20,80
-.set Open_gpr21,84
-.set Open_gpr22,88
-.set Open_gpr23,92
-.set Open_gpr24,96
-.set Open_gpr25,100
-.set Open_gpr26,104
-.set Open_gpr27,108
-.set Open_gpr28,112
-.set Open_gpr29,116
-.set Open_gpr30,120
-.set Open_gpr31,124
-.set Open_xer,128
-.set Open_lr,132
-.set Open_ctr,136
-.set Open_cr,140
-.set Open_srr2,144
-.set Open_srr3,148
-.set Open_srr0,152
-.set Open_srr1,156
-
-
-/*
- * This code makes several assumptions for processing efficiency
- * * General purpose registers are continuous in the image, beginning with
- * Open_gpr0
- * * Hash table is highly dependent on opcodes - opcode changes *will*
- * require rework of the instruction decode mechanism.
- */
-
- .text
- .globl align_h
-
- .align CACHE_SIZE_L2
-align_h:
- /*-----------------------------------------------------------------------
- * Store GPRs in Open Reg save area
- * Set up r2 as base reg, r1 pointing to Open Reg save area
- *----------------------------------------------------------------------*/
- stmw r0,ALIGN_REGS(r0)
- li r1,ALIGN_REGS
- /*-----------------------------------------------------------------------
- * Store special purpose registers in reg save area
- *----------------------------------------------------------------------*/
- mfxer r7
- mflr r8
- mfcr r9
- mfctr r10
- stw r7,Open_xer(r1)
- stw r8,Open_lr(r1)
- stw r9,Open_cr(r1)
- stw r10,Open_ctr(r1)
- mfspr r7, srr2 /* SRR 2 */
- mfspr r8, srr3 /* SRR 3 */
- mfspr r9, srr0 /* SRR 0 */
- mfspr r10, srr1 /* SRR 1 */
- stw r7,Open_srr2(r1)
- stw r8,Open_srr3(r1)
- stw r9,Open_srr0(r1)
- stw r10,Open_srr1(r1)
-
-/* Set up common registers */
- mfspr r5, dear /* DEAR: R5 is data exception address */
- lwz r9,Open_srr0(r1) /* get faulting instruction */
- addi r7,r9,4 /* bump instruction */
- stw r7,Open_srr0(r1) /* restore to image */
- lwz r9, 0(r9) /* retrieve actual instruction */
- rlwinm r6,r9,18,25,29 /* r6 is RA * 4 field from instruction */
- rlwinm r7,r9,6,26,31 /* r7 is primary opcode */
- bl ref_point /* establish addressibility */
-ref_point:
- mflr r11 /* r11 is the anchor point for ref_point */
- addi r10, r7, -31 /* r10 = r7 - 31 */
- rlwinm r10,r10,2,2,31 /* r10 *= 4 */
- add r10, r10, r11 /* r10 += anchor point */
- lwz r10, primary_jt-ref_point(r10)
- mtlr r10
- rlwinm r8,r9,13,25,29 /* r8 is RD * 4 */
- la r7,Open_gpr0(r1) /* r7 is address of GPR 0 in list */
- blr
-primary_jt:
- .long xform
- .long lwz
- .long lwzu
- .long 0
- .long 0
- .long stw
- .long stwu
- .long 0
- .long 0
- .long lhz
- .long lhzu
- .long lha
- .long lhau
- .long sth
- .long sthu
- .long lmw
- .long stmw
-/*
- * handlers
- */
-/*
- * xform instructions require an additional decode. Fortunately, a relatively
- * simple hash step breaks the instructions out with no collisions
- */
-xform:
- rlwinm r7,r9,31,22,31 /* r7 is secondary opcode */
- rlwinm r10,r7,27,5,31 /* r10 = r7 >> 5 */
- add r10,r7,r10 /* r10 = r7 + r10 */
- rlwinm r10,r10,2,25,29 /* r10 = (r10 & 0x1F) * 4 */
- add r10,r10,r11 /* r10 += anchor point */
- lwz r10, secondary_ht-ref_point(r10)
- mtlr r10
- la r7,Open_gpr0(r1) /* r7 is address of GPR 0 in list */
- rlwinm r8,r9,13,25,29 /* r8 is RD * 4 */
- blrl
-
-secondary_ht:
- .long lhzux /* b 0 0x137 */
- .long lhax /* b 1 0x157 */
- .long lhaux /* b 2 0x177 */
- .long sthx /* b 3 0x197 */
- .long sthux /* b 4 0x1b7 */
- .long 0 /* b 5 */
- .long lwbrx /* b 6 0x216 */
- .long 0 /* b 7 */
- .long 0 /* b 8 */
- .long 0 /* b 9 */
- .long stwbrx /* b A 0x296 */
- .long 0 /* b B */
- .long 0 /* b C */
- .long 0 /* b D */
- .long lhbrx /* b E 0x316 */
- .long 0 /* b F */
- .long 0 /* b 10 */
- .long 0 /* b 11 */
- .long sthbrx /* b 12 0x396 */
- .long 0 /* b 13 */
- .long lwarx /* b 14 0x014 */
- .long dcbz /* b 15 0x3f6 */
- .long 0 /* b 16 */
- .long lwzx /* b 17 0x017 */
- .long lwzux /* b 18 0x037 */
- .long 0 /* b 19 */
- .long stwcx /* b 1A 0x096 */
- .long stwx /* b 1B 0x097 */
- .long stwux /* b 1C 0x0B7 */
- .long 0 /* b 1D */
- .long 0 /* b 1E */
- .long lhzx /* b 1F 0x117 */
-
-/*
- * for all handlers
- * r4 - Addressability to interrupt context
- * r5 - DEAR address (faulting data address)
- * r6 - RA field * 4
- * r7 - Address of GPR 0 in image
- * r8 - RD field * 4
- * r9 - Failing instruction
- */
-
-/* Load halfword algebraic with update */
-lhau:
-/* Load halfword algebraic with update indexed */
-lhaux:
- stwx r5,r7,r6 /* update RA with effective addr */
-
-/* Load halfword algebraic */
-lha:
-/* Load halfword algebraic indexed */
-lhax:
- lswi r10,r5,2 /* load two bytes into r10 */
- srawi r10,r10,16 /* shift right 2 bytes, extending sign */
- stwx r10,r7,r8 /* update reg image */
- b align_complete /* return */
-
-/* Load Half Word Byte-Reversed Indexed */
-lhbrx:
- lswi r10,r5,2 /* load two bytes from DEAR into r10 */
- rlwinm r10,r10,0,0,15 /* mask off lower 2 bytes */
- stwbrx r10,r7,r8 /* store reversed in reg image */
- b align_complete /* return */
-
-/* Load Half Word and Zero with Update */
-lhzu:
-/* Load Half Word and Zero with Update Indexed */
-lhzux:
- stwx r5,r7,r6 /* update RA with effective addr */
-
-/* Load Half Word and Zero */
-lhz:
-/* Load Half Word and Zero Indexed */
-lhzx:
- lswi r10,r5,2 /* load two bytes from DEAR into r10 */
- rlwinm r10,r10,16,16,31 /* shift right 2 bytes, with zero fill */
- stwx r10,r7,r8 /* update reg image */
- b align_complete /* return */
-
-/*
- * Load Multiple Word
- */
-lmw:
- lwzx r9,r6,r7 /* R9 contains saved value of RA */
- addi r10,r7,32*4 /* r10 points to r31 in image + 4 */
- rlwinm r8,r8,30,2,31 /* r8 >>= 2 (recovers RT) */
- subfic r8,r8,32 /* r8 is reg count to load */
- mtctr r8 /* load counter */
- addi r8,r8,-1 /* r8-- */
- rlwinm r8,r8,2,2,31 /* r8 *= 4 */
- add r5,r5,r8 /* update DEAR to point to last reg */
-lwmloop:
- lswi r11,r5,4 /* load r11 with 4 bytes from DEAR */
- stwu r11,-4(r10) /* load image and decrement pointer */
- addi r5,r5,-4 /* decrement effective address */
- bdnz lwmloop
- stwx r9,r6,r7 /* restore RA (in case it was trashed) */
- b align_complete /* return */
-
-/*
- * Load Word and Reserve Indexed
- */
-lwarx:
- lswi r10,r5,4 /* load four bytes from DEAR into r10 */
- stwx r10,r7,r8 /* update reg image */
- rlwinm r5,r5,0,0,29 /* Word align address */
- lwarx r10,0,r5 /* Set reservation */
- b align_complete /* return */
-
-/*
- * Load Word Byte-Reversed Indexed
- */
-lwbrx:
- lswi r10,r5,4 /* load four bytes from DEAR into r10 */
- stwbrx r10,r7,r8 /* store reversed in reg image */
- b align_complete /* return */
-
-/* Load Word and Zero with Update */
-lwzu:
-/* Load Word and Zero with Update Indexed */
-lwzux:
- stwx r5,r7,r6 /* update RA with effective addr */
-
-/* Load Word and Zero */
-lwz:
-/* Load Word and Zero Indexed */
-lwzx:
- lswi r10,r5,4 /* load four bytes from DEAR into r10 */
- stwx r10,r7,r8 /* update reg image */
- b align_complete /* return */
-
-/* Store instructions */
-
-/* */
-/* Store Half Word and Update */
-sthu:
-/* Store Half Word and Update Indexed */
-sthux:
- stwx r5,r7,r6 /* Update RA with effective address */
-
-/* Store Half Word */
-sth:
-/* Store Half Word Indexed */
-sthx:
- lwzx r10,r8,r7 /* retrieve source register value */
- rlwinm r10,r10,16,0,15 /* move two bytes to high end of reg */
- stswi r10,r5,2 /* store bytes to DEAR address */
- b align_complete /* return */
-
-/* */
-/* Store Half Word Byte-Reversed Indexed */
-sthbrx:
- lwbrx r10,r8,r7 /* retrieve src reg value byte reversed */
- stswi r10,r5,2 /* move two bytes to DEAR address */
- b align_complete /* return */
-
-/* */
-/* Store Multiple Word */
-stmw:
- addi r10,r7,32*4 /* r10 points to r31 in image + 4 */
- rlwinm r8,r8,30,2,31 /* r8 >>= 2 (recovers RT) */
- subfic r8,r8,32 /* r8 is reg count to load */
- mtctr r8 /* load counter */
- addi r8,r8,-1 /* r8-- */
- rlwinm r8,r8,2,2,31 /* r8 *= 4 */
- add r5,r5,r8 /* update DEAR to point to last reg */
-stmloop:
- lwzu r11,-4(r10) /* get register value */
- stswi r11,r5,4 /* output to DEAR address */
- addi r5,r5,-4 /* decrement effective address */
- bdnz stmloop
- b align_complete /* return */
-
-/* */
-/* Store Word and Update */
-stwu:
-/* Store Word and Update Indexed */
-stwux:
- stwx r5,r7,r6 /* Update RA with effective address */
-
-/* Store Word */
-stw:
-/* Store Word Indexed */
-stwx:
- lwzx r10,r8,r7 /* retrieve source register value */
- stswi r10,r5,4 /* store bytes to DEAR address */
- b align_complete /* return */
-
-/* */
-/* Store Word Byte-Reversed Indexed */
-stwbrx:
- lwbrx r10,r8,r7 /* retrieve src reg value byte reversed */
- stswi r10,r5,4 /* move two bytes to DEAR address */
- b align_complete /* return */
-
-/* */
-/* Store Word Conditional Indexed */
-stwcx:
- rlwinm r10,r5,0,0,29 /* r10 = word aligned DEAR */
- lwz r11,0(r10) /* save original value of store */
- stwcx. r11,r0,r10 /* attempt store to address */
- bne stwcx_moveon /* store failed, move on */
- stw r11,0(r10) /* repair damage */
- lwzx r9,r7,r8 /* get register value */
- stswi r10,r5,4 /* store bytes to DEAR address */
-stwcx_moveon:
- mfcr r11 /* get condition reg */
- lwz r9,Open_cr(r1) /* get condition reg image */
- rlwimi r9,r11,0,0,2 /* insert 3 CR bits into cr image */
- lwz r11,Open_xer(r1) /* get XER reg */
- rlwimi r9,r11,29,2,2 /* insert XER SO bit into cr image */
- stw r9,Open_cr(r1) /* store cr image */
- b align_complete /* return */
-
-/* */
-/* Data Cache Block Zero */
-dcbz:
- rlwinm r5,r5,0,0,31-CACHE_SIZE_L2
- /* get address to nearest Cache line */
- addi r5,r5,-4 /* adjust by a word */
- addi r10,r0,CACHE_SIZE/4 /* set counter value */
- mtctr r10
- addi r11,r0,0 /* r11 = 0 */
-dcbz_loop:
- stwu r11,4(r5) /* store a word and update EA */
- bdnz dcbz_loop
- b align_complete /* return */
-
-align_complete:
- /*-----------------------------------------------------------------------
- * Restore regs and return from the interrupt
- *----------------------------------------------------------------------*/
- lmw r24,Open_xer+ALIGN_REGS(r0)
- mtxer r24
- mtlr r25
- mtctr r26
- mtcrf 0xFF, r27
- mtspr srr2, r28 /* SRR 2 */
- mtspr srr3, r29 /* SRR 3 */
- mtspr srr0, r30 /* SRR 0 */
- mtspr srr1, r31 /* SRR 1 */
- lmw r1,Open_gpr1+ALIGN_REGS(r0)
- lwz r0,Open_gpr0+ALIGN_REGS(r0)
- rfi
diff --git a/c/src/lib/libbsp/powerpc/psim/vectors/vectors.s b/c/src/lib/libbsp/powerpc/psim/vectors/vectors.s
deleted file mode 100644
index 448e9117e2..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/vectors/vectors.s
+++ /dev/null
@@ -1,123 +0,0 @@
-/* vectors.s 1.1 - 95/12/04
- *
- * This file contains the assembly code for the PowerPC
- * interrupt vectors for RTEMS.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * The issue with this file is getting it loaded at the right place.
- * The first vector MUST be at address 0x????0100.
- * How this is achieved is dependant on the tool chain.
- *
- * However the basic mechanism for ELF assemblers is to create a
- * section called ".vectors", which will be loaded to an address
- * between 0x????0000 and 0x????0100 (inclusive) via a link script.
- *
- * The basic mechanism for XCOFF assemblers is to place it in the
- * normal text section, and arrange for this file to be located
- * at an appropriate position on the linker command line.
- *
- * The variable 'PPC_VECTOR_FILE_BASE' must be defined to be the
- * offset from 0x????0000 to the first location in the file. This
- * will usually be 0x0000 or 0x0100.
- */
-
-#include "asm.h"
-
-#ifndef PPC_VECTOR_FILE_BASE
-#error "PPC_VECTOR_FILE_BASE is not defined."
-#endif
-
- /* Where this file will be loaded */
- .set file_base, PPC_VECTOR_FILE_BASE
-
- /* Offset to store reg 0 */
-
- .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)
-
- /* Vector offsets */
- .set begin_vector,0xFFF00000
- .set crit_vector,0xFFF00100
- .set mach_vector,0xFFF00200
- .set prot_vector,0xFFF00300
- .set ext_vector,0xFFF00500
- .set align_vector,0xFFF00600
- .set prog_vector,0xFFF00700
- .set dec_vector,0xFFF00900
- .set sys_vector,0xFFF00C00
- .set pit_vector,0xFFF01000
- .set fit_vector,0xFFF01010
- .set wadt_vector,0xFFF01020
- .set debug_vector,0xFFF02000
-
-/* Go to the right section */
-#if PPC_ASM == PPC_ASM_ELF
- .section .vectors,"awx",@progbits
-#elif PPC_ASM == PPC_ASM_XCOFF
- .csect .text[PR]
-#endif
-
- PUBLIC_VAR (__vectors)
-SYM (__vectors):
-
-/* Decrementer interrupt */
- .org dec_vector - file_base
-#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, PPC_IRQ_DECREMENTER
- b PROC (_ISR_Handler)
-
diff --git a/c/src/lib/libbsp/powerpc/psim/wrapup/Makefile.in b/c/src/lib/libbsp/powerpc/psim/wrapup/Makefile.in
deleted file mode 100644
index bae5c6a1ba..0000000000
--- a/c/src/lib/libbsp/powerpc/psim/wrapup/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console timer vectors
-# pieces to pick up out of libcpu/ppc
-CPU_PIECES=
-GENERIC_PIECES=
-
-ifeq ($(HAS_MP),yes)
-GENERIC_PIECES += shmdr
-BSP_PIECES += shmsupp
-endif
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(CPU_PIECES), \
- ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), \
- ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/sh/Makefile.in b/c/src/lib/libbsp/sh/Makefile.in
deleted file mode 100644
index 3479cee62d..0000000000
--- a/c/src/lib/libbsp/sh/Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH=@srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# Descend into the $(RTEMS_BSP_FAMILY) directory
-SUB_DIRS=$(RTEMS_BSP_FAMILY)
diff --git a/c/src/lib/libbsp/sh/gensh1/Makefile.in b/c/src/lib/libbsp/sh/gensh1/Makefile.in
deleted file mode 100644
index 3caf2c69c5..0000000000
--- a/c/src/lib/libbsp/sh/gensh1/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH=@srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include \
- startup \
- scitab \
- wrapup
-
diff --git a/c/src/lib/libbsp/sh/gensh1/README b/c/src/lib/libbsp/sh/gensh1/README
deleted file mode 100644
index c75ad9927e..0000000000
--- a/c/src/lib/libbsp/sh/gensh1/README
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# $Id$
-#
-# Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-#
-
-BSP NAME: generic SH1 (gensh1)
-BOARD: n/a
-BUS: n/a
-CPU FAMILY: Hitachi SH
-CPU: SH 7032
-COPROCESSORS: none
-MODE: n/a
-
-DEBUG MONITOR: gdb
-
-PERIPHERALS
-===========
-TIMERS: on-chip
- RESOLUTION: cf. Hitachi SH 703X Hardware Manual (Phi/4)
-SERIAL PORTS: on-chip (with 2 ports)
-REAL-TIME CLOCK: none
-DMA: not used
-VIDEO: none
-SCSI: none
-NETWORKING: none
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: on-chip timer
-IOSUPP DRIVER: default
-SHMSUPP: default
-TIMER DRIVER: on-chip timer
-TTY DRIVER: /dev/null (stub)
-
-STDIO
-=====
-PORT: /dev/null (stub)
-ELECTRICAL: n/a
-BAUD: n/a
-BITS PER CHARACTER: n/a
-PARITY: n/a
-STOP BITS: n/a
-
-NOTES
-=====
-
-(1) Only stub console driver available at the moment.
- Driver for the on-chip serial devices (sci) will be available soon.
-
diff --git a/c/src/lib/libbsp/sh/gensh1/bsp_specs b/c/src/lib/libbsp/sh/gensh1/bsp_specs
deleted file mode 100644
index 9436cdcd72..0000000000
--- a/c/src/lib/libbsp/sh/gensh1/bsp_specs
+++ /dev/null
@@ -1,22 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} \
-%{qrtems: --start-group %{!qrtems_debug: -lrtemsall } %{qrtems_debug: -lrtemsall_g} \
- -lc -lgcc --end-group \
- %{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} \
-%{qrtems: %{qrtems_debug: start_g.o%s} %{!qrtems_debug: start.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e _start}
-
diff --git a/c/src/lib/libbsp/sh/gensh1/include/Makefile.in b/c/src/lib/libbsp/sh/gensh1/include/Makefile.in
deleted file mode 100644
index e632fca2f1..0000000000
--- a/c/src/lib/libbsp/sh/gensh1/include/Makefile.in
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH=@srcdir@
-RTEMS_ROOT=@top_srcdir@
-PROJECT_ROOT=@PROJECT_ROOT@
-
-H_FILES = \
- $(srcdir)/bsp.h \
- $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: preinstall
-
-preinstall: $(SRCS)
- @INSTALL@ $(INSTINCFLAGS) $(H_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/sh/gensh1/include/bsp.h b/c/src/lib/libbsp/sh/gensh1/include/bsp.h
deleted file mode 100644
index 8f676d07fe..0000000000
--- a/c/src/lib/libbsp/sh/gensh1/include/bsp.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * This include file contains all board IO definitions.
- *
- * generic sh1
- *
- * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __gensh1_h
-#define __gensh1_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CPU_CONSOLE_DEVNAME "/dev/null"
-
-
-#include <rtems.h>
-#include <clockdrv.h>
-#include <sh/null.h>
-#include <console.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Stuff for Time Test 27
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector( handler ) \
-{ \
- rtems_isr_entry ignored ; \
- rtems_interrupt_catch( (handler), 0, &ignored ) ; \
-}
-
-#define Cause_tm27_intr()
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/* Constants */
-
-#define MHZ 20
-
-/*
- * Defined in the linker script 'linkcmds'
- */
-
-extern unsigned32 HeapStart ;
-extern unsigned32 HeapEnd ;
-extern unsigned32 WorkSpaceStart ;
-extern unsigned32 WorkSpaceEnd ;
-
-extern void *CPU_Interrupt_stack_low ;
-extern void *CPU_Interrupt_stack_high ;
-
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-extern void bsp_cleanup( void );
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * We redefine CONSOLE_DRIVER_TABLE_ENTRY to redirect /dev/console
- */
-#if defined(CONSOLE_DRIVER_TABLE_ENTRY)
-#warning Overwriting CONSOLE_DRIVER_TABLE_ENTRY
-#undef CONSOLE_DRIVER_TABLE_ENTRY
-#endif
-
-#define CONSOLE_DRIVER_TABLE_ENTRY \
- DEVNULL_DRIVER_TABLE_ENTRY, \
- { console_initialize, console_open, console_close, \
- console_read, console_write, console_control }
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/*
- * FIXME: Should this go to libcpu/sh/sh7032 ?
- */
-#if 0
-/* functions */
-sh_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/sh/gensh1/include/coverhd.h b/c/src/lib/libbsp/sh/gensh1/include/coverhd.h
deleted file mode 100644
index 570d21d0cb..0000000000
--- a/c/src/lib/libbsp/sh/gensh1/include/coverhd.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- * This file should be updated after running the C overhead timing
- * test. Once this update has been performed, the RTEMS Time Test
- * Suite should be rebuilt to account for these overhead times in the
- * timing results.
- *
- * NOTE: If these are all zero, then the times reported include all
- * all calling overhead including passing of arguments.
- *
- *
- * These are the figures tmoverhd.exe reported with egcs-980205 -O3
- * on a Diesner OktagonSH/Amos-2.1 board with SH7032/20MHz
- *
- * These results are assumed to be applicable to most SH7032/20MHz boards
- *
- * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 4
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 4
-#define CALLING_OVERHEAD_TASK_CREATE 9
-#define CALLING_OVERHEAD_TASK_IDENT 6
-#define CALLING_OVERHEAD_TASK_START 5
-#define CALLING_OVERHEAD_TASK_RESTART 5
-#define CALLING_OVERHEAD_TASK_DELETE 4
-#define CALLING_OVERHEAD_TASK_SUSPEND 4
-#define CALLING_OVERHEAD_TASK_RESUME 4
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 5
-#define CALLING_OVERHEAD_TASK_MODE 5
-#define CALLING_OVERHEAD_TASK_GET_NOTE 5
-#define CALLING_OVERHEAD_TASK_SET_NOTE 5
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 14
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 4
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 5
-#define CALLING_OVERHEAD_CLOCK_GET 16
-#define CALLING_OVERHEAD_CLOCK_SET 14
-#define CALLING_OVERHEAD_CLOCK_TICK 3
-
-#define CALLING_OVERHEAD_TIMER_CREATE 4
-#define CALLING_OVERHEAD_TIMER_IDENT 4
-#define CALLING_OVERHEAD_TIMER_DELETE 4
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 6
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 20
-#define CALLING_OVERHEAD_TIMER_RESET 4
-#define CALLING_OVERHEAD_TIMER_CANCEL 4
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 7
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 5
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 4
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 5
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 5
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 5
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 5
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 5
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 5
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 6
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 5
-
-#define CALLING_OVERHEAD_EVENT_SEND 6
-#define CALLING_OVERHEAD_EVENT_RECEIVE 5
-#define CALLING_OVERHEAD_SIGNAL_CATCH 4
-#define CALLING_OVERHEAD_SIGNAL_SEND 4
-#define CALLING_OVERHEAD_PARTITION_CREATE 9
-#define CALLING_OVERHEAD_PARTITION_IDENT 5
-#define CALLING_OVERHEAD_PARTITION_DELETE 4
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 6
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 6
-#define CALLING_OVERHEAD_REGION_CREATE 9
-#define CALLING_OVERHEAD_REGION_IDENT 5
-#define CALLING_OVERHEAD_REGION_DELETE 4
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 9
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 5
-#define CALLING_OVERHEAD_PORT_CREATE 9
-#define CALLING_OVERHEAD_PORT_IDENT 4
-#define CALLING_OVERHEAD_PORT_DELETE 4
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 7
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 8
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 5
-#define CALLING_OVERHEAD_IO_OPEN 5
-#define CALLING_OVERHEAD_IO_CLOSE 5
-#define CALLING_OVERHEAD_IO_READ 5
-#define CALLING_OVERHEAD_IO_WRITE 5
-#define CALLING_OVERHEAD_IO_CONTROL 5
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 4
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 4
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 3
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/sh/gensh1/scitab/Makefile.in b/c/src/lib/libbsp/sh/gensh1/scitab/Makefile.in
deleted file mode 100644
index 18c68db138..0000000000
--- a/c/src/lib/libbsp/sh/gensh1/scitab/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH=@srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=$(ARCH)/scitab.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=scitab
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(PGM): $(SRCS) ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-scitab.c: $(SHGEN)
- $(SHGEN) -M $(MHZ) sci > $@
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/sh/gensh1/start/Makefile.in b/c/src/lib/libbsp/sh/gensh1/start/Makefile.in
deleted file mode 100644
index b5d382a468..0000000000
--- a/c/src/lib/libbsp/sh/gensh1/start/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH=@srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/start.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-# force optimization, unless start.o will not work
-# CFLAGS_PROFILE=
-# CFLAGS_DEBUG=-O3
-# CFLAGS_OPTIMIZE=-O3
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/sh/gensh1/startup/Makefile.in b/c/src/lib/libbsp/sh/gensh1/startup/Makefile.in
deleted file mode 100644
index 08adccc862..0000000000
--- a/c/src/lib/libbsp/sh/gensh1/startup/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH=@srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bsplibc bsppost bspstart bspclean sbrk main
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=linkcmds $(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
diff --git a/c/src/lib/libbsp/sh/gensh1/startup/bspclean.c b/c/src/lib/libbsp/sh/gensh1/startup/bspclean.c
deleted file mode 100644
index 23b5bee4ac..0000000000
--- a/c/src/lib/libbsp/sh/gensh1/startup/bspclean.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine normally is part of start.s and usually returns
- * control to a monitor.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; If not, write to the Free Software Foundation,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- * COPYRIGHT (c) 1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-void bsp_cleanup( void )
-{
- rtems_fatal_error_occurred(0);
-}
diff --git a/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c b/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c
deleted file mode 100644
index e9e72c3830..0000000000
--- a/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- bsp_libc_init(&HeapStart, sizeof(unsigned32) * (&HeapEnd - &HeapStart), 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start(void)
-{
- /*
- For real boards you need to setup the hardware
- and need to copy the vector table from rom to ram.
-
- Depending on the board this can ether be done from inside the rom
- startup code, rtems startup code or here.
- */
-
- /*
- * Allocate the memory for the RTEMS Work Space. This can come from
- * a variety of places: hard coded address, malloc'ed from outside
- * RTEMS world (e.g. simulator or primitive memory manager), or (as
- * typically done by stock BSPs) by subtracting the required amount
- * of work space from the last physical address on the CPU board.
- */
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
-
- BSP_Configuration.work_space_start = (void *) &WorkSpaceStart ;
- BSP_Configuration.work_space_size =
- (unsigned32) &WorkSpaceEnd -
- (unsigned32) &WorkSpaceStart ;
-
- /*
- * initialize the CPU table for this BSP
- */
-
-#if ( CPU_ALLOCATE_INTERRUPT_STACK == FALSE )
- _CPU_Interrupt_stack_low = &CPU_Interrupt_stack_low ;
- _CPU_Interrupt_stack_high = &CPU_Interrupt_stack_high ;
-
- /* This isn't used anywhere */
- Cpu_table.interrupt_stack_size =
- (unsigned32) (&CPU_Interrupt_stack_high) -
- (unsigned32) (&CPU_Interrupt_stack_low) ;
-#endif
-
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
-
-#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
- Cpu_table.interrupt_stack_size = 4096;
-#endif
-
-}
diff --git a/c/src/lib/libbsp/sh/gensh1/startup/linkcmds b/c/src/lib/libbsp/sh/gensh1/startup/linkcmds
deleted file mode 100644
index e20551efe7..0000000000
--- a/c/src/lib/libbsp/sh/gensh1/startup/linkcmds
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * This is an adapted linker script from egcs-1.0.1
- *
- * Memory layout for an SH 7032 with main memory in area 2
- * This memory layout it very similar to that used for Hitachi's
- * EVB with CMON in rom
- *
- * NOTE: The ram start address may vary, all other start addresses are fixed
- * Not suiteable for gdb's simulator
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-OUTPUT_FORMAT("coff-sh")
-OUTPUT_ARCH(sh)
-ENTRY(_start)
-
-MEMORY
-{
- rom : o = 0x00000000, l = 128k
- onchip_peri : o = 0x05000000, l = 512
- ram : o = 0x0A040000, l = 256k
-
- onchip_ram : o = 0x0f000000, l = 8k
-}
-
-SECTIONS
-{
- /* boot vector table */
- .monvects 0x00000000 (NOLOAD): {
- _monvects = . ;
- } > rom
-
- /* monitor play area */
- .monram 0x0A040000 (NOLOAD) :
- {
- _ramstart = .;
- } > ram
-
- /* monitor vector table */
- .vects 0x0A042000 (NOLOAD) : {
- _vectab = . ;
- *(.vects);
- }
-
- /* Read-only sections, merged into text segment: */
-
- . = 0x0a044000 ;
- .interp : { *(.interp) }
- .hash : { *(.hash) }
- .dynsym : { *(.dynsym) }
- .dynstr : { *(.dynstr) }
- .gnu.version : { *(.gnu.version) }
- .gnu.version_d : { *(.gnu.version_d) }
- .gnu.version_r : { *(.gnu.version_r) }
- .rel.text :
- { *(.rel.text) *(.rel.gnu.linkonce.t*) }
- .rela.text :
- { *(.rela.text) *(.rela.gnu.linkonce.t*) }
- .rel.data :
- { *(.rel.data) *(.rel.gnu.linkonce.d*) }
- .rela.data :
- { *(.rela.data) *(.rela.gnu.linkonce.d*) }
- .rel.rodata :
- { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
- .rela.rodata :
- { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
- .rel.got : { *(.rel.got) }
- .rela.got : { *(.rela.got) }
- .rel.ctors : { *(.rel.ctors) }
- .rela.ctors : { *(.rela.ctors) }
- .rel.dtors : { *(.rel.dtors) }
- .rela.dtors : { *(.rela.dtors) }
- .rel.init : { *(.rel.init) }
- .rela.init : { *(.rela.init) }
- .rel.fini : { *(.rel.fini) }
- .rela.fini : { *(.rela.fini) }
- .rel.bss : { *(.rel.bss) }
- .rela.bss : { *(.rela.bss) }
- .rel.plt : { *(.rel.plt) }
- .rela.plt : { *(.rela.plt) }
- .init : { *(.init) } =0
- .plt : { *(.plt) }
- .text . :
- {
- *(.text)
- *(.stub)
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
- *(.gnu.linkonce.t*)
- } > ram
- _etext = .;
- PROVIDE (etext = .);
- .fini . : { *(.fini) } =0
- .rodata . : { *(.rodata) *(.gnu.linkonce.r*) }
- .rodata1 . : { *(.rodata1) }
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. */
- . = ALIGN(128) + (. & (128 - 1));
- .data . :
- {
- *(.data)
- *(.gnu.linkonce.d*)
- CONSTRUCTORS
- } > ram
- .data1 . : { *(.data1) }
- .ctors . :
- {
- ___ctors = .;
- *(.ctors)
- ___ctors_end = .;
- }
- .dtors . :
- {
- ___dtors = .;
- *(.dtors)
- ___dtors_end = .;
- }
- .got . : { *(.got.plt) *(.got) }
- .dynamic . : { *(.dynamic) }
- /* We want the small data sections together, so single-instruction offsets
- can access them all, and initialized data all before uninitialized, so
- we can shorten the on-disk segment size. */
- .sdata . : { *(.sdata) }
- _edata = .;
- PROVIDE (edata = .);
- __bss_start = .;
- .sbss . : { *(.sbss) *(.scommon) }
- .bss . :
- {
- *(.dynbss)
- *(.bss)
- *(COMMON)
- } > ram
- _end = . ;
- PROVIDE (end = .);
-
- _HeapStart = . ;
- . = . + 1024 * 20 ;
- PROVIDE( _HeapEnd = . );
-
- _WorkSpaceStart = . ;
- . = 0x0a080000 ;
- PROVIDE(_WorkSpaceEnd = .);
-
- _CPU_Interrupt_stack_low = 0x0f000000 ;
- _CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ;
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- /* DWARF debug sections.
- Symbols in the DWARF debugging sections are relative to the beginning
- of the section so we begin them at 0. */
- /* DWARF 1 */
- .debug 0 : { *(.debug) }
- .line 0 : { *(.line) }
- /* GNU DWARF 1 extensions */
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- /* DWARF 1.1 and DWARF 2 */
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- /* DWARF 2 */
- .debug_info 0 : { *(.debug_info) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_line 0 : { *(.debug_line) }
- .debug_frame 0 : { *(.debug_frame) }
- .debug_str 0 : { *(.debug_str) }
- .debug_loc 0 : { *(.debug_loc) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
- /* SGI/MIPS DWARF 2 extensions */
- .debug_weaknames 0 : { *(.debug_weaknames) }
- .debug_funcnames 0 : { *(.debug_funcnames) }
- .debug_typenames 0 : { *(.debug_typenames) }
- .debug_varnames 0 : { *(.debug_varnames) }
-
- .stack 0x0f001ff0 : { _stack = .; *(.stack) } > onchip_ram
- /* These must appear regardless of . */
-}
diff --git a/c/src/lib/libbsp/sh/gensh1/times b/c/src/lib/libbsp/sh/gensh1/times
deleted file mode 100644
index 8820913932..0000000000
--- a/c/src/lib/libbsp/sh/gensh1/times
+++ /dev/null
@@ -1,195 +0,0 @@
-#
-# Timing Test Suite Results for the generic sh1
-#
-# NOTE: Due to memory shortage the timing test suite could not yet be run.
-#
-# Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-#
-# $Id$
-#
-
-Board: Diesner OktagonSH/AMOS-2.1
-CPU: Hitachi SH 7032
-Clock Speed: 20MHz
-Memory Configuration: 8k on-chip ram, 256k external RAM in Area 4
-Wait States:
-
-Times Reported in: cycles, microseconds, etc
-Timer Source: Count Down Timer, on-CPU cycle counter, etc
-
-Column A:
-Column B:
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create X
- rtems_semaphore_delete X
- rtems_semaphore_obtain: available X
- rtems_semaphore_obtain: not available -- NO_WAIT X
- rtems_semaphore_release: no waiting tasks X
-
- 2 rtems_semaphore_obtain: not available -- caller blocks X
-
- 3 rtems_semaphore_release: task readied -- preempts caller X
-
- 4 rtems_task_restart: blocked task -- preempts caller X
- rtems_task_restart: ready task -- preempts caller X
- rtems_semaphore_release: task readied -- returns to caller X
- rtems_task_create X
- rtems_task_start X
- rtems_task_restart: suspended task -- returns to caller X
- rtems_task_delete: suspended task X
- rtems_task_restart: ready task -- returns to caller X
- rtems_task_restart: blocked task -- returns to caller X
- rtems_task_delete: blocked task X
-
- 5 rtems_task_suspend: calling task X
- rtems_task_resume: task readied -- preempts caller X
-
- 6 rtems_task_restart: calling task X
- rtems_task_suspend: returns to caller X
- rtems_task_resume: task readied -- returns to caller X
- rtems_task_delete: ready task X
-
- 7 rtems_task_restart: suspended task -- preempts caller X
-
- 8 rtems_task_set_priority: obtain current priority X
- rtems_task_set_priority: returns to caller X
- rtems_task_mode: obtain current mode X
- rtems_task_mode: no reschedule X
- rtems_task_mode: reschedule -- returns to caller X
- rtems_task_mode: reschedule -- preempts caller X
- rtems_task_set_note X
- rtems_task_get_note X
- rtems_clock_set X
- rtems_clock_get X
-
- 9 rtems_message_queue_create X
- rtems_message_queue_send: no waiting tasks X
- rtems_message_queue_urgent: no waiting tasks X
- rtems_message_queue_receive: available X
- rtems_message_queue_flush: no messages flushed X
- rtems_message_queue_flush: messages flushed X
- rtems_message_queue_delete X
-
-10 rtems_message_queue_receive: not available -- NO_WAIT X
- rtems_message_queue_receive: not available -- caller blocks X
-
-11 rtems_message_queue_send: task readied -- preempts caller X
-
-12 rtems_message_queue_send: task readied -- returns to caller X
-
-13 rtems_message_queue_urgent: task readied -- preempts caller X
-
-14 rtems_message_queue_urgent: task readied -- returns to caller X
-
-15 rtems_event_receive: obtain current events X
- rtems_event_receive: not available -- NO_WAIT X
- rtems_event_receive: not available -- caller blocks X
- rtems_event_send: no task readied X
- rtems_event_receive: available X
- rtems_event_send: task readied -- returns to caller X
-
-16 rtems_event_send: task readied -- preempts caller X
-
-17 rtems_task_set_priority: preempts caller X
-
-18 rtems_task_delete: calling task X
-
-19 rtems_signal_catch X
- rtems_signal_send: returns to caller X
- rtems_signal_send: signal to self X
- exit ASR overhead: returns to calling task X
- exit ASR overhead: returns to preempting task X
-
-20 rtems_partition_create X
- rtems_region_create X
- rtems_partition_get_buffer: available X
- rtems_partition_get_buffer: not available X
- rtems_partition_return_buffer X
- rtems_partition_delete X
- rtems_region_get_segment: available X
- rtems_region_get_segment: not available -- NO_WAIT X
- rtems_region_return_segment: no waiting tasks X
- rtems_region_get_segment: not available -- caller blocks X
- rtems_region_return_segment: task readied -- preempts caller X
- rtems_region_return_segment: task readied -- returns to caller X
- rtems_region_delete X
- rtems_io_initialize X
- rtems_io_open X
- rtems_io_close X
- rtems_io_read X
- rtems_io_write X
- rtems_io_control X
-
-21 rtems_task_ident X
- rtems_message_queue_ident X
- rtems_semaphore_ident X
- rtems_partition_ident X
- rtems_region_ident X
- rtems_port_ident X
- rtems_timer_ident X
- rtems_rate_monotonic_ident X
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller X
- rtems_message_queue_broadcast: no waiting tasks X
- rtems_message_queue_broadcast: task readied -- preempts caller X
-
-23 rtems_timer_create X
- rtems_timer_fire_after: inactive X
- rtems_timer_fire_after: active X
- rtems_timer_cancel: active X
- rtems_timer_cancel: inactive X
- rtems_timer_reset: inactive X
- rtems_timer_reset: active X
- rtems_timer_fire_when: inactive X
- rtems_timer_fire_when: active X
- rtems_timer_delete: active X
- rtems_timer_delete: inactive X
- rtems_task_wake_when X
-
-24 rtems_task_wake_after: yield -- returns to caller X
- rtems_task_wake_after: yields -- preempts caller X
-
-25 rtems_clock_tick X
-
-26 _ISR_Disable X
- _ISR_Flash X
- _ISR_Enable X
- _Thread_Disable_dispatch X
- _Thread_Enable_dispatch X
- _Thread_Set_state X
- _Thread_Disptach (NO FP) X
- context switch: no floating point contexts X
- context switch: self X
- context switch: to another task X
- context switch: restore 1st FP task X
- fp context switch: save idle, restore idle X
- fp context switch: save idle, restore initialized X
- fp context switch: save initialized, restore initialized X
- _Thread_Resume X
- _Thread_Unblock X
- _Thread_Ready X
- _Thread_Get X
- _Semaphore_Get X
- _Thread_Get: invalid id X
-
-27 interrupt entry overhead: returns to interrupted task X
- interrupt exit overhead: returns to interrupted task X
- interrupt entry overhead: returns to nested interrupt X
- interrupt exit overhead: returns to nested interrupt X
- interrupt entry overhead: returns to preempting task X
- interrupt exit overhead: returns to preempting task X
-
-28 rtems_port_create X
- rtems_port_external_to_internal X
- rtems_port_internal_to_external X
- rtems_port_delete X
-
-29 rtems_rate_monotonic_create X
- rtems_rate_monotonic_period: initiate period -- returns to caller X
- rtems_rate_monotonic_period: obtain status X
- rtems_rate_monotonic_cancel X
- rtems_rate_monotonic_delete: inactive X
- rtems_rate_monotonic_delete: active X
- rtems_rate_monotonic_period: conclude periods -- caller blocks X
diff --git a/c/src/lib/libbsp/sh/gensh1/wrapup/Makefile.in b/c/src/lib/libbsp/sh/gensh1/wrapup/Makefile.in
deleted file mode 100644
index 4d2ce1b1bd..0000000000
--- a/c/src/lib/libbsp/sh/gensh1/wrapup/Makefile.in
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# $Id$
-#
-# build and install libbsp
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH=@srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup scitab
-GENERIC_PIECES=
-
-# pieces to pick up out of libcpu/sh
-CPU_PIECES=\
- sh7032/null \
- sh7032/clock \
- sh7032/console \
- sh7032/timer
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(CPU_PIECES), \
- ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(notdir $(piece)).rel) \
- $(foreach piece, $(GENERIC_PIECES), ../../../../$(piece)/$(ARCH)/$(piece).rel)
-
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
-install: all
diff --git a/c/src/lib/libbsp/sh/shared/setvec.c b/c/src/lib/libbsp/sh/shared/setvec.c
deleted file mode 100644
index e6c778b6a3..0000000000
--- a/c/src/lib/libbsp/sh/shared/setvec.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* set_vector
- *
- * NOTE: This function is considered OBSOLETE and may vanish soon.
- * Calls to set_vector should be replaced by calls to
- * rtems_interrupt_catch or _CPU_ISR_install_raw_handler.
- *
- * This routine installs an interrupt vector on the target Board/CPU.
- * This routine is allowed to be as board dependent as necessary.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <bsp.h>
-
-sh_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- sh_isr_entry previous_isr;
-
- if ( type )
- rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
- else {
- _CPU_ISR_install_raw_handler( vector, handler, (proc_ptr*) &previous_isr );
- }
-
- return previous_isr;
-}
diff --git a/c/src/lib/libbsp/shared/bspclean.c b/c/src/lib/libbsp/shared/bspclean.c
deleted file mode 100644
index 8b95cf4f16..0000000000
--- a/c/src/lib/libbsp/shared/bspclean.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * This is a dummy bsp_cleanup routine.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-void bsp_cleanup( void )
-{
-}
diff --git a/c/src/lib/libbsp/shared/bsplibc.c b/c/src/lib/libbsp/shared/bsplibc.c
deleted file mode 100644
index 164e33a016..0000000000
--- a/c/src/lib/libbsp/shared/bsplibc.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <libcsupport.h>
-
-extern rtems_configuration_table BSP_Configuration;
-
-void bsp_libc_init(
- void *heap_start,
- unsigned32 heap_size,
- int use_sbrk
-)
-{
- RTEMS_Malloc_Initialize( heap_start, heap_size, use_sbrk);
-
- /*
- * Init the RTEMS libio facility to provide UNIX-like system
- * calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
- * Uses malloc() to get area for the iops, so must be after malloc init
- */
-
- rtems_libio_init();
-
- /*
- * Set up for the libc handling.
- */
-
- if (BSP_Configuration.ticks_per_timeslice > 0)
- libc_init(1); /* reentrant if possible */
- else
- libc_init(0); /* non-reentrant */
-}
diff --git a/c/src/lib/libbsp/shared/bsppost.c b/c/src/lib/libbsp/shared/bsppost.c
deleted file mode 100644
index d3d14786ce..0000000000
--- a/c/src/lib/libbsp/shared/bsppost.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * This is a basic BSP post driver hook.
- *
- * After drivers are setup, register some "filenames"
- * and open stdin, stdout, stderr files
- *
- * Newlib will automatically associate the files with these
- * (it hardcodes the numbers)
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <fcntl.h>
-
-void
-bsp_postdriver_hook(void)
-{
- int stdin_fd, stdout_fd, stderr_fd;
- int error_code;
-
- error_code = 'S' << 24 | 'T' << 16;
-
- if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
-
- if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
-
- if ((stderr_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
-
- if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
- rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
-}
-
diff --git a/c/src/lib/libbsp/shared/console.c b/c/src/lib/libbsp/shared/console.c
deleted file mode 100644
index 60ced47ddf..0000000000
--- a/c/src/lib/libbsp/shared/console.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * This file contains the TTY driver for the PPCn_60x
- *
- * This driver uses the termios pseudo driver.
- *
- * COPYRIGHT (c) 1998 by Radstone Technology
- *
- *
- * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
- * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
- *
- * You are hereby granted permission to use, copy, modify, and distribute
- * this file, provided that this notice, plus the above copyright notice
- * and disclaimer, appears in all copies. Radstone Technology will provide
- * no support for this code.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <termios.h>
-
-#include <libchip/serial.h>
-
-/*
- * Configuration Information
- */
-
-extern console_data Console_Port_Data[];
-extern unsigned long Console_Port_Count;
-extern rtems_device_minor_number Console_Port_Minor;
-
-/*PAGE
- *
- * console_open
- *
- * open a port as a termios console.
- *
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_status_code status;
- rtems_libio_open_close_args_t *args = arg;
- rtems_libio_ioctl_args_t IoctlArgs;
- struct termios Termios;
- rtems_termios_callbacks Callbacks;
- console_tbl *cptr;
-
- /*
- * Verify the port number is valid.
- */
- if ( minor > Console_Port_Count ) {
- return RTEMS_INVALID_NUMBER;
- }
-
- /*
- * Open the port as a termios console driver.
- */
-
- cptr = &Console_Port_Tbl[minor];
- Callbacks.firstOpen = cptr->pDeviceFns->deviceFirstOpen;
- Callbacks.lastClose = cptr->pDeviceFns->deviceLastClose;
- Callbacks.pollRead = cptr->pDeviceFns->deviceRead;
- Callbacks.write = cptr->pDeviceFns->deviceWrite;
- Callbacks.setAttributes = cptr->pDeviceFns->deviceSetAttributes;
- Callbacks.stopRemoteTx = cptr->pDeviceFlow->deviceStopRemoteTx;
- Callbacks.startRemoteTx = cptr->pDeviceFlow->deviceStartRemoteTx;
- Callbacks.outputUsesInterrupts = cptr->pDeviceFns->deviceOutputUsesInterrupts;
-
- /* XXX what about
- * Console_Port_Tbl[minor].ulMargin,
- * Console_Port_Tbl[minor].ulHysteresis);
- */
-
- status = rtems_termios_open ( major, minor, arg, &Callbacks );
- Console_Port_Data[minor].termios_data = args->iop->data1;
-
- if (minor!=Console_Port_Minor) {
- /*
- * If this is not the console we do not want ECHO and
- * so forth
- */
- IoctlArgs.iop=args->iop;
- IoctlArgs.command=RTEMS_IO_GET_ATTRIBUTES;
- IoctlArgs.buffer=&Termios;
- rtems_termios_ioctl(&IoctlArgs);
- Termios.c_lflag=ICANON;
- IoctlArgs.command=RTEMS_IO_SET_ATTRIBUTES;
- rtems_termios_ioctl(&IoctlArgs);
- }
-
- if ( (args->iop->flags&LIBIO_FLAGS_READ) &&
- Console_Port_Tbl[minor].pDeviceFlow &&
- Console_Port_Tbl[minor].pDeviceFlow->deviceStartRemoteTx) {
- Console_Port_Tbl[minor].pDeviceFlow->deviceStartRemoteTx(minor);
- }
-
- return status;
-}
-
-/*PAGE
- *
- * console_reserve_resources
- *
- * This routine uses the termios driver to reserve resources.
- */
-
-void console_reserve_resources(
- rtems_configuration_table *configuration
-)
-{
- rtems_termios_reserve_resources( configuration, 4 );
-}
-
-
-/*PAGE
- *
- * console_close
- *
- * This routine closes a port that has been opened as console.
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_open_close_args_t *args = arg;
-
- if ( (args->iop->flags&LIBIO_FLAGS_READ) &&
- Console_Port_Tbl[minor].pDeviceFlow &&
- Console_Port_Tbl[minor].pDeviceFlow->deviceStopRemoteTx) {
- Console_Port_Tbl[minor].pDeviceFlow->deviceStopRemoteTx(minor);
- }
-
- return rtems_termios_close (arg);
-}
-
-/*PAGE
- *
- * console_read
- *
- * This routine uses the termios driver to read a character.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_read (arg);
-}
-
-/*PAGE
- *
- * console_write
- *
- * this routine uses the termios driver to write a character.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_write (arg);
-}
-
-/*PAGE
- *
- * console_control
- *
- * this routine uses the termios driver to process io
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_ioctl (arg);
-}
-
-/*PAGE
- *
- * console_initialize
- *
- * Routine called to initialize the console device driver.
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor_arg,
- void *arg
-)
-{
- rtems_status_code status;
- rtems_device_minor_number minor;
-
- /*
- * initialize the termio interface.
- */
-
- rtems_termios_initialize();
-
- for (minor=0; minor < Console_Port_Count ; minor++) {
- /*
- * First perform the configuration dependent probe, then the
- * device dependent probe
- */
-
- if ((!Console_Port_Tbl[minor].deviceProbe ||
- Console_Port_Tbl[minor].deviceProbe(minor)) &&
- Console_Port_Tbl[minor].pDeviceFns->deviceProbe(minor)) {
- /*
- * Use this device for the console
- */
- break;
- }
- }
- if ( minor == Console_Port_Count ) {
- /*
- * Failed to find a working device
- */
- rtems_fatal_error_occurred(RTEMS_IO_ERROR);
- }
-
- Console_Port_Minor=minor;
-
- /*
- * Register Device Names
- */
- status = rtems_io_register_name("/dev/console", major, Console_Port_Minor );
- if (status != RTEMS_SUCCESSFUL) {
- rtems_fatal_error_occurred(status);
- }
- Console_Port_Tbl[minor].pDeviceFns->deviceInitialize(Console_Port_Minor);
-
- for (minor++;minor<Console_Port_Count;minor++) {
- /*
- * First perform the configuration dependent probe, then the
- * device dependent probe
- */
-
- if ( (!Console_Port_Tbl[minor].deviceProbe ||
- Console_Port_Tbl[minor].deviceProbe(minor)) &&
- Console_Port_Tbl[minor].pDeviceFns->deviceProbe(minor)) {
- status = rtems_io_register_name(
- Console_Port_Tbl[minor].sDeviceName,
- major,
- minor );
- if (status != RTEMS_SUCCESSFUL) {
- rtems_fatal_error_occurred(status);
- }
-
- /*
- * Initialize the hardware device.
- */
-
- Console_Port_Tbl[minor].pDeviceFns->deviceInitialize(minor);
-
- }
- }
-
- return RTEMS_SUCCESSFUL;
-}
-
-
-
diff --git a/c/src/lib/libbsp/shared/main.c b/c/src/lib/libbsp/shared/main.c
deleted file mode 100644
index 5a49524cba..0000000000
--- a/c/src/lib/libbsp/shared/main.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * A simple main which can be used on any embedded target.
- *
- * This style of initialization insures that the C++ global
- * constructors are executed after RTEMS is initialized.
- *
- * Thanks to Chris Johns <cjohns@plessey.com.au> for this idea.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-char *rtems_progname;
-
-extern void bsp_start( void );
-extern void bsp_cleanup( void );
-
-extern rtems_configuration_table Configuration;
-extern rtems_configuration_table BSP_Configuration;
-extern rtems_cpu_table Cpu_table;
-
-rtems_interrupt_level bsp_isr_level;
-
-int main(int argc, char **argv)
-{
-
- if ((argc > 0) && argv && argv[0])
- rtems_progname = argv[0];
- else
- rtems_progname = "RTEMS";
-
- rtems_initialize_executive_late( bsp_isr_level );
-
- return 0;
-}
-
-int boot_card(int argc, char **argv)
-{
- int status;
-
- /*
- * Set default values for the CPU Table fields all ports must have.
- * These values can be overridden in bsp_start() but they are
- * right most of the time.
- */
-
- Cpu_table.pretasking_hook = NULL;
- Cpu_table.predriver_hook = NULL;
- Cpu_table.postdriver_hook = NULL;
- Cpu_table.idle_task = NULL;
- Cpu_table.do_zero_of_workspace = TRUE;
- Cpu_table.interrupt_stack_size = RTEMS_MINIMUM_STACK_SIZE;
- Cpu_table.extra_mpci_receive_server_stack = 0;
- Cpu_table.stack_allocate_hook = NULL;
- Cpu_table.stack_free_hook = NULL;
-
-
- /*
- * Copy the configuration table so we and the BSP wants to change it.
- */
-
- BSP_Configuration = Configuration;
-
- /*
- * The atexit hook will be before the static destructor list's entry
- * point.
- */
-
- bsp_start();
-
- /*
- * Initialize RTEMS but do NOT start multitasking.
- */
-
- bsp_isr_level =
- rtems_initialize_executive_early( &BSP_Configuration, &Cpu_table );
-
- /*
- * Call main() and get the global constructors invoked if there
- * are any.
- */
-
- status = main(argc, argv);
-
- /*
- * Perform any BSP specific shutdown actions.
- */
-
- bsp_cleanup();
-
- /*
- * Now return to the start code.
- */
-
- return status;
-}
-
diff --git a/c/src/lib/libbsp/shared/sbrk.c b/c/src/lib/libbsp/shared/sbrk.c
deleted file mode 100644
index b1be6e4548..0000000000
--- a/c/src/lib/libbsp/shared/sbrk.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * sbrk.c
- *
- * If the BSP wants to dynamically allocate the memory for the
- * C Library heap (malloc) and/or be able to extend the heap,
- * then this routine must be functional. This is the default
- * implementation which raises an error.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#include <signal.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-void * sbrk(size_t incr)
-{
- errno = ENOMEM;
- return (void *)-1;
-}
-
diff --git a/c/src/lib/libbsp/shared/tod.c b/c/src/lib/libbsp/shared/tod.c
deleted file mode 100644
index b43c7c1c04..0000000000
--- a/c/src/lib/libbsp/shared/tod.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Real Time Clock Driver Wrapper for Libchip
- *
- * The license and distribution terms 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.h>
-#include <libchip/rtc.h>
-
-/*
- * Configuration Information
- */
-
-extern unsigned long RTC_Count;
-extern rtems_device_minor_number RTC_Minor;
-
-int RTC_Present;
-
-/*
- * rtc_initialize
- *
- * Initialize the RTC driver
- */
-
-rtems_device_driver rtc_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor_arg,
- void *arg
-)
-{
- rtems_device_minor_number minor;
- rtems_status_code status;
-
- for (minor=0; minor < RTC_Count ; minor++) {
- /*
- * First perform the configuration dependent probe, then the
- * device dependent probe
- */
-
- if (RTC_Table[minor].deviceProbe && RTC_Table[minor].deviceProbe(minor)) {
- /*
- * Use this device as the primary RTC
- */
- RTC_Minor = minor;
- RTC_Present = 1;
- break;
- }
- }
-
- if ( !RTC_Present ) {
- /*
- * Failed to find an RTC -- this is not a fatal error.
- */
-
- return RTEMS_INVALID_NUMBER;
- }
-
- /*
- * Register and initialize the primary RTC's
- */
-
- status = rtems_io_register_name( "/dev/rtc", major, RTC_Minor );
- if (status != RTEMS_SUCCESSFUL) {
- rtems_fatal_error_occurred(status);
- }
-
- RTC_Table[minor].pDeviceFns->deviceInitialize( RTC_Minor );
-
- /*
- * Now initialize any secondary RTC's
- */
-
- for ( minor++ ; minor<RTC_Count ; minor++) {
- /*
- * First perform the configuration dependent probe, then the
- * device dependent probe
- */
-
- if (RTC_Table[minor].deviceProbe && RTC_Table[minor].deviceProbe(minor)) {
- status = rtems_io_register_name(
- RTC_Table[minor].sDeviceName,
- major,
- minor );
- if (status != RTEMS_SUCCESSFUL) {
- rtems_fatal_error_occurred(status);
- }
-
- /*
- * Initialize the hardware device.
- */
-
- RTC_Table[minor].pDeviceFns->deviceInitialize(minor);
-
- }
- }
-
- return RTEMS_SUCCESSFUL;
-}
-
-
-/*PAGE
- *
- * This routine copies the time from the real time clock to RTEMS
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void setRealTimeToRTEMS()
-{
- rtems_time_of_day rtc_tod;
-
- if (!RTC_Present)
- return;
-
- RTC_Table[RTC_Minor].pDeviceFns->deviceGetTime(RTC_Minor, &rtc_tod);
- rtems_clock_set( &rtc_tod );
-}
-
-/*PAGE
- *
- * setRealTimeFromRTEMS
- *
- * This routine copies the time from RTEMS to the real time clock
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void setRealTimeFromRTEMS()
-{
- rtems_time_of_day rtems_tod;
-
- if (!RTC_Present)
- return;
-
- rtems_clock_get( RTEMS_CLOCK_GET_TOD, &rtems_tod );
- RTC_Table[RTC_Minor].pDeviceFns->deviceSetTime(RTC_Minor, &rtems_tod);
-}
-
-/*PAGE
- *
- * getRealTime
- *
- * This routine reads the current time from the RTC.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void getRealTime(
- rtems_time_of_day *tod
-)
-{
-
- if (!RTC_Present)
- return;
-
- RTC_Table[RTC_Minor].pDeviceFns->deviceGetTime(RTC_Minor, tod);
-}
-
-/*PAGE
- *
- * setRealTime
- *
- * This routine sets the RTC.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-/* XXX this routine should be part of the public RTEMS interface */
-rtems_boolean _TOD_Validate( rtems_time_of_day *tod );
-
-int setRealTime(
- rtems_time_of_day *tod
-)
-{
-
- if (!RTC_Present)
- return -1;
-
- if ( !_TOD_Validate(tod) )
- return -1;
-
- RTC_Table[RTC_Minor].pDeviceFns->deviceSetTime(RTC_Minor, tod);
- return 0;
-}
-
-
-/*PAGE
- *
- * checkRealTime
- *
- * This routine reads the returns the variance betweent the real time and
- * rtems time.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- * int The differance between the real time clock and rtems time.
- */
-
-/* XXX this routine should be part of the public RTEMS interface */
-unsigned32 _TOD_To_seconds( rtems_time_of_day *tod );
-
-int checkRealTime()
-{
- rtems_time_of_day rtems_tod;
- rtems_time_of_day rtc_tod;
- unsigned32 rtems_time;
- unsigned32 rtc_time;
-
- if (!RTC_Present)
- return -1;
-
- rtems_clock_get( RTEMS_CLOCK_GET_TOD, &rtems_tod );
- RTC_Table[RTC_Minor].pDeviceFns->deviceGetTime(RTC_Minor, &rtc_tod);
-
- rtems_time = _TOD_To_seconds( &rtems_tod );
- rtc_time = _TOD_To_seconds( &rtc_tod );
-
- return rtems_time - rtc_time;
-}
-
diff --git a/c/src/lib/libbsp/shared/tod.h b/c/src/lib/libbsp/shared/tod.h
deleted file mode 100644
index 725211e082..0000000000
--- a/c/src/lib/libbsp/shared/tod.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Real Time Clock (MK48T08) for RTEMS on Score603e
- *
- * Based on MVME162 TOD by:
- * COPYRIGHT (C) 1997
- * by Katsutoshi Shibuya - BU Denken Co.,Ltd. - Sapporo - JAPAN
- * ALL RIGHTS RESERVED
- *
- * The license and distribution 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 TOD_H
-#define TOD_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Set the RTC.
- */
-
-int setRealTime(
- rtems_time_of_day *tod
-);
-
-/*
- * Get the time from the RTC.
- */
-
-void getRealTime(
- rtems_time_of_day *tod
-);
-
-/*
- * Read real time from RTC and set it to RTEMS' clock manager
- */
-
-void setRealTimeToRTEMS();
-
-/*
- * Read time from RTEMS' clock manager and set it to RTC
- */
-
-void setRealTimeFromRTEMS();
-
-/*
- * Return the difference between RTC and RTEMS' clock manager time in minutes.
- * If the difference is greater than 1 day, this returns 9999.
- */
-
-int checkRealTime();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/lib/libbsp/shmdr/Makefile.in b/c/src/lib/libbsp/shmdr/Makefile.in
deleted file mode 100644
index 2518bf1737..0000000000
--- a/c/src/lib/libbsp/shmdr/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/shmdr.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=addlq cnvpkt getlq dump fatal getpkt init initlq intr mpisr \
- poll receive retpkt send setckvec
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_PIECES=shm mpci
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: preinstall ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 644 $(PGM) ${PROJECT_RELEASE}/lib
-
-# the .rel file built here will be put into libbsp.a by
-# ../$(RTEMS_BSP_FAMILY)/wrapup/Makefile
-
-preinstall:
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/shmdr/README b/c/src/lib/libbsp/shmdr/README
deleted file mode 100644
index 5ed9e861b0..0000000000
--- a/c/src/lib/libbsp/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/lib/libbsp/shmdr/addlq.c b/c/src/lib/libbsp/shmdr/addlq.c
deleted file mode 100644
index 2eace43e4d..0000000000
--- a/c/src/lib/libbsp/shmdr/addlq.c
+++ /dev/null
@@ -1,43 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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/lib/libbsp/shmdr/cnvpkt.c b/c/src/lib/libbsp/shmdr/cnvpkt.c
deleted file mode 100644
index 4a9a4006db..0000000000
--- a/c/src/lib/libbsp/shmdr/cnvpkt.c
+++ /dev/null
@@ -1,42 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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/lib/libbsp/shmdr/dump.c b/c/src/lib/libbsp/shmdr/dump.c
deleted file mode 100644
index 6cd4e2129f..0000000000
--- a/c/src/lib/libbsp/shmdr/dump.c
+++ /dev/null
@@ -1,51 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <stdio.h>
-
-#include "shm.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/lib/libbsp/shmdr/fatal.c b/c/src/lib/libbsp/shmdr/fatal.c
deleted file mode 100644
index b0558c92f0..0000000000
--- a/c/src/lib/libbsp/shmdr/fatal.c
+++ /dev/null
@@ -1,39 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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/lib/libbsp/shmdr/getlq.c b/c/src/lib/libbsp/shmdr/getlq.c
deleted file mode 100644
index 7b525b2d92..0000000000
--- a/c/src/lib/libbsp/shmdr/getlq.c
+++ /dev/null
@@ -1,48 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <shm.h>
-
-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/lib/libbsp/shmdr/getpkt.c b/c/src/lib/libbsp/shmdr/getpkt.c
deleted file mode 100644
index 03971ea022..0000000000
--- a/c/src/lib/libbsp/shmdr/getpkt.c
+++ /dev/null
@@ -1,36 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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/lib/libbsp/shmdr/init.c b/c/src/lib/libbsp/shmdr/init.c
deleted file mode 100644
index 4e1df20be0..0000000000
--- a/c/src/lib/libbsp/shmdr/init.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/* Shm_Initialization
- *
- * This routine is the shared memory communications initerface
- * driver initialization routine.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <rtems.h>
-#include <shm.h>
-
-#include <string.h> /* memset() */
-#include <stdlib.h> /* malloc() */
-#include <assert.h>
-
-/*
- * 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 ; i<Shm_Maximum_envelopes ; i++ ) {
- Shm_Envelopes[ i ].index = Shm_Convert(i);
- Shm_Free_envelope( &Shm_Envelopes[ i ] );
- }
-
- /*
- * 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;
-
- /*
- * 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/lib/libbsp/shmdr/initlq.c b/c/src/lib/libbsp/shmdr/initlq.c
deleted file mode 100644
index f876d4b43d..0000000000
--- a/c/src/lib/libbsp/shmdr/initlq.c
+++ /dev/null
@@ -1,35 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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/lib/libbsp/shmdr/intr.c b/c/src/lib/libbsp/shmdr/intr.c
deleted file mode 100644
index 1483cd3afe..0000000000
--- a/c/src/lib/libbsp/shmdr/intr.c
+++ /dev/null
@@ -1,58 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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/lib/libbsp/shmdr/mpci.h b/c/src/lib/libbsp/shmdr/mpci.h
deleted file mode 100644
index 5e08cc4ec4..0000000000
--- a/c/src/lib/libbsp/shmdr/mpci.h
+++ /dev/null
@@ -1,59 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <shm.h>
-
-#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.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/lib/libbsp/shmdr/mpisr.c b/c/src/lib/libbsp/shmdr/mpisr.c
deleted file mode 100644
index 573a4ebd21..0000000000
--- a/c/src/lib/libbsp/shmdr/mpisr.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* _Shm_isr()
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.h"
-
-rtems_isr Shm_isr(
- rtems_vector_number vector
-)
-{
- Shm_Interrupt_count += 1;
- rtems_multiprocessing_announce();
-}
diff --git a/c/src/lib/libbsp/shmdr/poll.c b/c/src/lib/libbsp/shmdr/poll.c
deleted file mode 100644
index 22dc116435..0000000000
--- a/c/src/lib/libbsp/shmdr/poll.c
+++ /dev/null
@@ -1,53 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/libio.h>
-
-#include "shm.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/lib/libbsp/shmdr/receive.c b/c/src/lib/libbsp/shmdr/receive.c
deleted file mode 100644
index 98fd23b29d..0000000000
--- a/c/src/lib/libbsp/shmdr/receive.c
+++ /dev/null
@@ -1,44 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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/lib/libbsp/shmdr/retpkt.c b/c/src/lib/libbsp/shmdr/retpkt.c
deleted file mode 100644
index d14b6e26e1..0000000000
--- a/c/src/lib/libbsp/shmdr/retpkt.c
+++ /dev/null
@@ -1,32 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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/lib/libbsp/shmdr/send.c b/c/src/lib/libbsp/shmdr/send.c
deleted file mode 100644
index f26445cb42..0000000000
--- a/c/src/lib/libbsp/shmdr/send.c
+++ /dev/null
@@ -1,61 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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/lib/libbsp/shmdr/setckvec.c b/c/src/lib/libbsp/shmdr/setckvec.c
deleted file mode 100644
index 1e56e5737b..0000000000
--- a/c/src/lib/libbsp/shmdr/setckvec.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <rtems/libio.h>
-
-#include "shm.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/lib/libbsp/shmdr/shm.h b/c/src/lib/libbsp/shmdr/shm.h
deleted file mode 100644
index 8875525983..0000000000
--- a/c/src/lib/libbsp/shmdr/shm.h
+++ /dev/null
@@ -1,542 +0,0 @@
-/* shm.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <clockdrv.h>
-
-#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(no_cpu) /* for this values are irrelevant */
-#define SHM_LOCK_VALUE 1
-#define SHM_UNLOCK_VALUE 0
-#else
-#error "shm.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/c/src/lib/libbsp/shmdr/shm_driver.h b/c/src/lib/libbsp/shmdr/shm_driver.h
deleted file mode 100644
index 8875525983..0000000000
--- a/c/src/lib/libbsp/shmdr/shm_driver.h
+++ /dev/null
@@ -1,542 +0,0 @@
-/* shm.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <clockdrv.h>
-
-#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(no_cpu) /* for this values are irrelevant */
-#define SHM_LOCK_VALUE 1
-#define SHM_UNLOCK_VALUE 0
-#else
-#error "shm.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/c/src/lib/libbsp/sparc/Makefile.in b/c/src/lib/libbsp/sparc/Makefile.in
deleted file mode 100644
index f049e9b2e8..0000000000
--- a/c/src/lib/libbsp/sparc/Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# Descend into the $(RTEMS_BSP_FAMILY) directory
-SUB_DIRS=$(RTEMS_BSP_FAMILY)
diff --git a/c/src/lib/libbsp/sparc/erc32/Makefile.in b/c/src/lib/libbsp/sparc/erc32/Makefile.in
deleted file mode 100644
index 4fc7c7fb90..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/Makefile.in
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-# NOTE: we pick up HPPA clock and timer from libcpu/hppa
-SUB_DIRS=startsis include startup console clock timer wrapup tools
diff --git a/c/src/lib/libbsp/sparc/erc32/README b/c/src/lib/libbsp/sparc/erc32/README
deleted file mode 100644
index 93f19bb383..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/README
+++ /dev/null
@@ -1,80 +0,0 @@
-#
-# Description of SIS as related to this BSP
-#
-# $Id$
-#
-
-BSP NAME: sis
-BOARD: any based on the European Space Agency's ERC32
-BUS: N/A
-CPU FAMILY: sparc
-CPU: ERC32 (SPARC V7 + on-CPU peripherals)
- based on Cypress 601/602
-COPROCESSORS: on-chip 602 compatible FPU
-MODE: 32 bit mode
-
-DEBUG MONITOR: none
-
-PERIPHERALS
-===========
-TIMERS:
- NAME: General Purpose Timer
- RESOLUTION: 50 nanoseconds - 12.8 microseconds
- NAME: Real Time Clock Timer
- RESOLUTION: 50 nanoseconds - 3.2768 milliseconds
- NAME: Watchdog Timer
- RESOLUTION: XXX
-SERIAL PORTS: 2 using on-chip UART
-REAL-TIME CLOCK: none
-DMA: on-chip
-VIDEO: none
-SCSI: none
-NETWORKING: none
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: ERC32 internal Real Time Clock Timer
-IOSUPP DRIVER: N/A
-SHMSUPP: N/A
-TIMER DRIVER: ERC32 internal General Purpose Timer
-CONSOLE DRIVER: ERC32 internal UART
-
-STDIO
-=====
-PORT: Channel A
-ELECTRICAL: na since using simulator
-BAUD: na
-BITS PER CHARACTER: na
-PARITY: na
-STOP BITS: na
-
-Notes
-=====
-
-ERC32 BSP only supports single processor operations.
-
-A nice feature of this BSP is that the RAM and PROM size are set in the
-linkcmds file and the startup code programs the Memory Configuration
-Register based on those sizes.
-
-The Watchdog Timer is disabled.
-
-This code was developed and tested entirely using the SPARC Instruction
-Simulator (SIS) for the ERC32. All tests were known to run correctly
-against sis v1.7.
-
-
-Memory Map
-==========
-
-0x00000000 - 0x00000000 + _PROM_SIZE code and initialized data
-0x01f80000 on chip peripherals
-0x00000000 - 0x02000000 + _RAM_SIZE destination for initialized data
- BSS (i.e. unitialized data)
- C Heap (i.e. malloc area)
- RTEMS Workspace
-
-The C heap is assigned all memory between the end of the BSS and the
-RTEMS Workspace. The size of the RTEMS Workspace is based on that
-specified in the application's configuration table.
-
diff --git a/c/src/lib/libbsp/sparc/erc32/bsp_specs b/c/src/lib/libbsp/sparc/erc32/bsp_specs
deleted file mode 100644
index 51f7ff15ac..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/bsp_specs
+++ /dev/null
@@ -1,23 +0,0 @@
-%rename cpp old_cpp
-%rename lib old_lib
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
-
-*lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group \
-%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
--lc -lgcc --end-group \
-%{!qnolinkcmds: -T linkcmds%s}}
-
-*startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: startsis.o%s} \
-%{qrtems_debug: startsis_g.o%s}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
-
diff --git a/c/src/lib/libbsp/sparc/erc32/clock/Makefile.in b/c/src/lib/libbsp/sparc/erc32/clock/Makefile.in
deleted file mode 100644
index e40e10fb1a..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/clock/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/sparc/erc32/clock/ckinit.c b/c/src/lib/libbsp/sparc/erc32/clock/ckinit.c
deleted file mode 100644
index 302335bde1..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/clock/ckinit.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Clock Tick Device Driver
- *
- * This routine initializes the Real Time Clock Counter Timer which is
- * part of the MEC on the ERC32 CPU.
- *
- * The tick frequency is directly programmed to the configured number of
- * microseconds per tick.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-/*
- * The Real Time Clock Counter Timer uses this trap type.
- */
-
-#define CLOCK_VECTOR ERC32_TRAP_TYPE( ERC32_INTERRUPT_REAL_TIME_CLOCK )
-
-/*
- * Clock ticks since initialization
- */
-
-volatile rtems_unsigned32 Clock_driver_ticks;
-
-/*
- * This is the value programmed into the count down timer. It
- * is artificially lowered when SIMSPARC_FAST_IDLE is defined to
- * cut down how long we spend in the idle task while executing on
- * the simulator.
- */
-
-extern rtems_unsigned32 CPU_SPARC_CLICKS_PER_TICK;
-
-rtems_isr_entry Old_ticker;
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-/*
- * Clock_isr
- *
- * This is the clock tick interrupt handler.
- *
- * Input parameters:
- * vector - vector number
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- *
- */
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
- /*
- * If we are in "fast idle" mode, then the value for clicks per tick
- * is lowered to decrease the amount of time spent executing the idle
- * task while using the SPARC Instruction Simulator.
- */
-
-#if SIMSPARC_FAST_IDLE
- ERC32_MEC.Real_Time_Clock_Counter = CPU_SPARC_CLICKS_PER_TICK;
- ERC32_MEC_Set_Real_Time_Clock_Timer_Control(
- ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING |
- ERC32_MEC_TIMER_COUNTER_LOAD_COUNTER
- );
-#endif
-
- /*
- * The driver has seen another tick.
- */
-
- Clock_driver_ticks += 1;
-
- /*
- * Real Time Clock counter/timer is set to automatically reload.
- */
-
- rtems_clock_tick();
-}
-
-/*
- * Install_clock
- *
- * This routine actually performs the hardware initialization for the clock.
- *
- * Input parameters:
- * clock_isr - clock interrupt service routine entry point
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- *
- */
-
-extern int CLOCK_SPEED;
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
- Clock_driver_ticks = 0;
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
-
- /* approximately 1 us per countdown */
- ERC32_MEC.Real_Time_Clock_Scalar = CLOCK_SPEED - 1;
- ERC32_MEC.Real_Time_Clock_Counter = CPU_SPARC_CLICKS_PER_TICK;
-
- ERC32_MEC_Set_Real_Time_Clock_Timer_Control(
- ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING |
- ERC32_MEC_TIMER_COUNTER_LOAD_SCALER |
- ERC32_MEC_TIMER_COUNTER_LOAD_COUNTER
- );
-
- ERC32_MEC_Set_Real_Time_Clock_Timer_Control(
- ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING |
- ERC32_MEC_TIMER_COUNTER_RELOAD_AT_ZERO
- );
-
- atexit( Clock_exit );
- }
-
-}
-
-/*
- * Clock_exit
- *
- * This routine allows the clock driver to exit by masking the interrupt and
- * disabling the clock's counter.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- *
- */
-
-void Clock_exit( void )
-{
- if ( BSP_Configuration.ticks_per_timeslice ) {
- ERC32_Mask_interrupt( ERC32_INTERRUPT_REAL_TIME_CLOCK );
-
- ERC32_MEC_Set_Real_Time_Clock_Timer_Control(
- ERC32_MEC_TIMER_COUNTER_DISABLE_COUNTING
- );
-
- /* do not restore old vector */
- }
-}
-
-/*
- * Clock_initialize
- *
- * This routine initializes the clock driver.
- *
- * Input parameters:
- * major - clock device major number
- * minor - clock device minor number
- * parg - pointer to optional device driver arguments
- *
- * Output parameters: NONE
- *
- * Return values:
- * rtems_device_driver status code
- */
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Clock_control
- *
- * This routine is the clock device driver control entry point.
- *
- * Input parameters:
- * major - clock device major number
- * minor - clock device minor number
- * parg - pointer to optional device driver arguments
- *
- * Output parameters: NONE
- *
- * Return values:
- * rtems_device_driver status code
- */
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/sparc/erc32/console/Makefile.in b/c/src/lib/libbsp/sparc/erc32/console/Makefile.in
deleted file mode 100644
index b73d23df40..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/console/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/sparc/erc32/console/console.c b/c/src/lib/libbsp/sparc/erc32/console/console.c
deleted file mode 100644
index af1be91fa4..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/console/console.c
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
- * This file contains the TTY driver for the serial ports on the erc32.
- *
- * This driver uses the termios pseudo driver.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <stdlib.h>
-#include <assert.h>
-
-/*
- * Should we use a polled or interrupt drived console?
- *
- * NOTE: This is defined in the custom/erc32.cfg file.
- *
- * WARNING: In sis 1.6, it did not appear that the UART interrupts
- * worked in a desirable fashion. Immediately upon writing
- * a character into the TX buffer, an interrupt was generated.
- * This did not allow enough time for the program to put more
- * characters in the buffer. So every character resulted in
- * "priming" the transmitter. This effectively results in
- * in a polled console with a useless interrupt per character
- * on output. It is reasonable to assume that input does not
- * share this problem although it was not investigated.
- *
- */
-
-/*
- * console_outbyte_polled
- *
- * This routine transmits a character using polling.
- */
-
-void console_outbyte_polled(
- int port,
- char ch
-)
-{
- if ( port == 0 ) {
- while ( (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEA) == 0 );
- ERC32_MEC.UART_Channel_A = (int) ch;
- return;
- }
-
- while ( (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEB) == 0 );
- ERC32_MEC.UART_Channel_B = (int) ch;
-}
-
-/*
- * console_inbyte_nonblocking
- *
- * This routine polls for a character.
- */
-
-int console_inbyte_nonblocking( int port )
-{
- int UStat;
-
- UStat = ERC32_MEC.UART_Status;
-
- switch (port) {
-
- case 0:
- if (UStat & ERC32_MEC_UART_STATUS_ERRA) {
- ERC32_MEC.UART_Status = ERC32_MEC_UART_STATUS_CLRA;
- ERC32_MEC.Control = ERC32_MEC.Control;
- }
-
- if ((UStat & ERC32_MEC_UART_STATUS_DRA) == 0)
- return -1;
- return (int) ERC32_MEC.UART_Channel_A;
- return 1;
-
- case 1:
- if (UStat & ERC32_MEC_UART_STATUS_ERRB) {
- ERC32_MEC.UART_Status = ERC32_MEC_UART_STATUS_CLRB;
- ERC32_MEC.Control = ERC32_MEC.Control;
- }
-
- if ((UStat & ERC32_MEC_UART_STATUS_DRB) == 0)
- return -1;
- return (int) ERC32_MEC.UART_Channel_B;
-
- default:
- assert( 0 );
- }
-
- return -1;
-}
-
-/*
- * Interrupt driven console IO
- */
-
-#if (CONSOLE_USE_INTERRUPTS)
-
-/*
- * Buffers between task and ISRs
- */
-
-#include <ringbuf.h>
-
-Ring_buffer_t TX_Buffer[ 2 ];
-boolean Is_TX_active[ 2 ];
-
-void *console_termios_data[ 2 ];
-
-/*
- * console_isr_a
- *
- * This routine is the console interrupt handler for Channel A.
- *
- * Input parameters:
- * vector - vector number
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-rtems_isr console_isr_a(
- rtems_vector_number vector
-)
-{
- char ch;
- int UStat;
-
- if ( (UStat = ERC32_MEC.UART_Status) & ERC32_MEC_UART_STATUS_DRA ) {
- if (UStat & ERC32_MEC_UART_STATUS_ERRA) {
- ERC32_MEC.UART_Status = ERC32_MEC_UART_STATUS_CLRA;
- ERC32_MEC.Control = ERC32_MEC.Control;
- }
- ch = ERC32_MEC.UART_Channel_A;
-
- rtems_termios_enqueue_raw_characters( console_termios_data[ 0 ], &ch, 1 );
- }
-
- if ( ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEA ) {
- if ( !Ring_buffer_Is_empty( &TX_Buffer[ 0 ] ) ) {
- Ring_buffer_Remove_character( &TX_Buffer[ 0 ], ch );
- ERC32_MEC.UART_Channel_A = (unsigned32) ch;
- } else
- Is_TX_active[ 0 ] = FALSE;
- }
-
- ERC32_Clear_interrupt( ERC32_INTERRUPT_UART_A_RX_TX );
-}
-
-/*
- * console_isr_b
- *
- * This routine is the console interrupt handler for Channel B.
- *
- * Input parameters:
- * vector - vector number
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-rtems_isr console_isr_b(
- rtems_vector_number vector
-)
-{
- char ch;
- int UStat;
-
- if ( (UStat = ERC32_MEC.UART_Status) & ERC32_MEC_UART_STATUS_DRB ) {
- if (UStat & ERC32_MEC_UART_STATUS_ERRB) {
- ERC32_MEC.UART_Status = ERC32_MEC_UART_STATUS_CLRB;
- ERC32_MEC.Control = ERC32_MEC.Control;
- }
- ch = ERC32_MEC.UART_Channel_B;
- rtems_termios_enqueue_raw_characters( console_termios_data[ 1 ], &ch, 1 );
-
- }
-
- if ( ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEB ) {
- if ( !Ring_buffer_Is_empty( &TX_Buffer[ 1 ] ) ) {
- Ring_buffer_Remove_character( &TX_Buffer[ 1 ], ch );
- ERC32_MEC.UART_Channel_B = (unsigned32) ch;
- } else
- Is_TX_active[ 1 ] = FALSE;
- }
-
- ERC32_Clear_interrupt( ERC32_INTERRUPT_UART_B_RX_TX );
-}
-
-/*
- * console_exit
- *
- * This routine allows the console to exit by masking its associated interrupt
- * vectors.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void console_exit()
-{
- rtems_unsigned32 port;
- rtems_unsigned32 ch;
-
- /*
- * Although the interrupts for the UART are unmasked, the PIL is set to
- * disable all external interrupts. So we might as well do this first.
- */
-
- ERC32_Mask_interrupt( ERC32_INTERRUPT_UART_A_RX_TX );
- ERC32_Mask_interrupt( ERC32_INTERRUPT_UART_B_RX_TX );
-
- for ( port=0 ; port <= 1 ; port++ ) {
- while ( !Ring_buffer_Is_empty( &TX_Buffer[ port ] ) ) {
- Ring_buffer_Remove_character( &TX_Buffer[ port ], ch );
- console_outbyte_polled( port, ch );
- }
- }
-
- /*
- * Now wait for all the data to actually get out ... the send register
- * should be empty.
- */
-
- while ( (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEA) !=
- ERC32_MEC_UART_STATUS_THEA );
-
- while ( (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEB) !=
- ERC32_MEC_UART_STATUS_THEB );
-
-}
-
-#define CONSOLE_UART_A_TRAP ERC32_TRAP_TYPE( ERC32_INTERRUPT_UART_A_RX_TX )
-#define CONSOLE_UART_B_TRAP ERC32_TRAP_TYPE( ERC32_INTERRUPT_UART_B_RX_TX )
-
-/*
- * console_initialize_interrupts
- *
- * This routine initializes the console's receive and transmit
- * ring buffers and loads the appropriate vectors to handle the interrupts.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-#ifdef RDB_BREAK_IN
- extern unsigned32 trap_table[];
-#endif
-
-void console_initialize_interrupts( void )
-{
- Ring_buffer_Initialize( &TX_Buffer[ 0 ] );
- Ring_buffer_Initialize( &TX_Buffer[ 1 ] );
-
- Is_TX_active[ 0 ] = FALSE;
- Is_TX_active[ 1 ] = FALSE;
-
- atexit( console_exit );
-
- set_vector( console_isr_a, CONSOLE_UART_A_TRAP, 1 );
-#ifdef RDB_BREAK_IN
- if (trap_table[0x150/4] == 0x91d02000)
-#endif
- set_vector( console_isr_b, CONSOLE_UART_B_TRAP, 1 );
-}
-
-/*
- * console_outbyte_interrupt
- *
- * This routine transmits a character out.
- *
- * Input parameters:
- * port - port to transmit character to
- * ch - character to be transmitted
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void console_outbyte_interrupt(
- int port,
- char ch
-)
-{
- /*
- * If this is the first character then we need to prime the pump
- */
-
- if ( Is_TX_active[ port ] == FALSE ) {
- Is_TX_active[ port ] = TRUE;
- console_outbyte_polled( port, ch );
- return;
- }
-
- while ( Ring_buffer_Is_full( &TX_Buffer[ port ] ) );
-
- Ring_buffer_Add_character( &TX_Buffer[ port ], ch );
-}
-
-#endif /* CONSOLE_USE_INTERRUPTS */
-
-/*
- * DEBUG_puts
- *
- * This should be safe in the event of an error. It attempts to insure
- * that no TX empty interrupts occur while it is doing polled IO. Then
- * it restores the state of that external interrupt.
- *
- * Input parameters:
- * string - pointer to debug output string
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void DEBUG_puts(
- char *string
-)
-{
- char *s;
- unsigned32 old_level;
-
- ERC32_Disable_interrupt( ERC32_INTERRUPT_UART_A_RX_TX, old_level );
- for ( s = string ; *s ; s++ )
- console_outbyte_polled( 0, *s );
-
- console_outbyte_polled( 0, '\r' );
- console_outbyte_polled( 0, '\n' );
- ERC32_Restore_interrupt( ERC32_INTERRUPT_UART_A_RX_TX, old_level );
-}
-
-
-/*
- * Console Termios Support Entry Points
- *
- */
-
-int console_write_support (int minor, const char *buf, int len)
-{
- int nwrite = 0;
-
- while (nwrite < len) {
-#if (CONSOLE_USE_INTERRUPTS)
- console_outbyte_interrupt( minor, *buf++ );
-#else
- console_outbyte_polled( minor, *buf++ );
-#endif
- nwrite++;
- }
- return nwrite;
-}
-
-void console_reserve_resources(
- rtems_configuration_table *configuration
-)
-{
- rtems_termios_reserve_resources( configuration, 2 );
-}
-
-/*
- * Console Device Driver Entry Points
- *
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- rtems_termios_initialize();
-
- /*
- * Register Device Names
- */
-
- status = rtems_io_register_name( "/dev/console", major, 0 );
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- status = rtems_io_register_name( "/dev/console_b", major, 1 );
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- /*
- * Initialize Hardware
- */
-
-#if (CONSOLE_USE_INTERRUPTS)
- console_initialize_interrupts();
-#endif
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_status_code sc;
-#if (CONSOLE_USE_INTERRUPTS)
- rtems_libio_open_close_args_t *args = arg;
- static const rtems_termios_callbacks intrCallbacks = {
- NULL, /* firstOpen */
- NULL, /* lastClose */
- NULL, /* pollRead */
- console_write_support, /* write */
- NULL, /* setAttributes */
- NULL, /* stopRemoteTx */
- NULL, /* startRemoteTx */
- 0 /* outputUsesInterrupts */
- };
-#else
- static const rtems_termios_callbacks pollCallbacks = {
- NULL, /* firstOpen */
- NULL, /* lastClose */
- console_inbyte_nonblocking, /* pollRead */
- console_write_support, /* write */
- NULL, /* setAttributes */
- NULL, /* stopRemoteTx */
- NULL, /* startRemoteTx */
- 0 /* outputUsesInterrupts */
- };
-#endif
-
- assert( minor <= 1 );
- if ( minor > 2 )
- return RTEMS_INVALID_NUMBER;
-
-#if (CONSOLE_USE_INTERRUPTS)
- sc = rtems_termios_open (major, minor, arg, &intrCallbacks);
-
- console_termios_data[ minor ] = args->iop->data1;
-#else
- sc = rtems_termios_open (major, minor, arg, &pollCallbacks);
-#endif
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_close (arg);
-}
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_read (arg);
-}
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_write (arg);
-}
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_ioctl (arg);
-}
-
diff --git a/c/src/lib/libbsp/sparc/erc32/include/Makefile.in b/c/src/lib/libbsp/sparc/erc32/include/Makefile.in
deleted file mode 100644
index 93ed75d4a2..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/include/Makefile.in
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-# If you add equate files, don't forget to uncomment the install line
-# below.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/sparc/erc32/include/bsp.h b/c/src/lib/libbsp/sparc/erc32/include/bsp.h
deleted file mode 100644
index f6c3a46586..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/include/bsp.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/* bsp.h
- *
- * This include file contains all SPARC simulator definitions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#ifndef __SIS_h
-#define __SIS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <clockdrv.h>
-#include <console.h>
-#include <iosupp.h>
-#include <erc32.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 3 /* 3 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Define the interrupt mechanism for Time Test 27
- *
- * NOTE: Since the interrupt code for the SPARC supports both synchronous
- * and asynchronous trap handlers, support for testing with both
- * is included.
- */
-
-#define SIS_USE_SYNCHRONOUS_TRAP 0
-
-/*
- * The synchronous trap is an arbitrarily chosen software trap.
- */
-
-#if (SIS_USE_SYNCHRONOUS_TRAP == 1)
-
-#define TEST_VECTOR SPARC_SYNCHRONOUS_TRAP( 0x90 )
-
-#define MUST_WAIT_FOR_INTERRUPT 1
-
-#define Install_tm27_vector( handler ) \
- set_vector( (handler), TEST_VECTOR, 1 );
-
-#define Cause_tm27_intr() \
- asm volatile( "ta 0x10; nop " );
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr()
-
-/*
- * The asynchronous trap is an arbitrarily chosen ERC32 interrupt source.
- */
-
-#else /* use a regular asynchronous trap */
-
-#define TEST_INTERRUPT_SOURCE ERC32_INTERRUPT_EXTERNAL_1
-#define TEST_VECTOR ERC32_TRAP_TYPE( TEST_INTERRUPT_SOURCE )
-
-#define MUST_WAIT_FOR_INTERRUPT 1
-
-#define Install_tm27_vector( handler ) \
- set_vector( (handler), TEST_VECTOR, 1 );
-
-#define Cause_tm27_intr() \
- do { \
- ERC32_Force_interrupt( TEST_INTERRUPT_SOURCE ); \
- nop(); \
- nop(); \
- nop(); \
- } while (0)
-
-#define Clear_tm27_intr() \
- ERC32_Clear_interrupt( TEST_INTERRUPT_SOURCE )
-
-#define Lower_tm27_intr()
-
-#endif
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-extern void Clock_delay(rtems_unsigned32 microseconds);
-
-#define delay( microseconds ) Clock_delay(microseconds)
-
-/* Constants */
-
-/*
- * Information placed in the linkcmds file.
- */
-
-extern int RAM_START;
-extern int RAM_END;
-extern int RAM_SIZE;
-
-extern int PROM_START;
-extern int PROM_END;
-extern int PROM_SIZE;
-
-extern int CLOCK_SPEED;
-
-extern int end; /* last address in the program */
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-
-/* miscellaneous stuff assumed to exist */
-
-void bsp_cleanup( void );
-
-void bsp_start( void );
-
-rtems_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-);
-
-void DEBUG_puts( char *string );
-
-void BSP_fatal_return( void );
-
-void bsp_spurious_initialize( void );
-
-extern rtems_configuration_table BSP_Configuration; /* owned by BSP */
-
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/sparc/erc32/include/coverhd.h b/c/src/lib/libbsp/sparc/erc32/include/coverhd.h
deleted file mode 100644
index 4d91fec2fe..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/include/coverhd.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C for this target.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#ifndef __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
-#define CALLING_OVERHEAD_TASK_CREATE 0
-#define CALLING_OVERHEAD_TASK_IDENT 0
-#define CALLING_OVERHEAD_TASK_START 0
-#define CALLING_OVERHEAD_TASK_RESTART 0
-#define CALLING_OVERHEAD_TASK_DELETE 0
-#define CALLING_OVERHEAD_TASK_SUSPEND 0
-#define CALLING_OVERHEAD_TASK_RESUME 0
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
-#define CALLING_OVERHEAD_TASK_MODE 0
-#define CALLING_OVERHEAD_TASK_GET_NOTE 0
-#define CALLING_OVERHEAD_TASK_SET_NOTE 0
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 0
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
-#define CALLING_OVERHEAD_CLOCK_GET 0
-#define CALLING_OVERHEAD_CLOCK_SET 0
-#define CALLING_OVERHEAD_CLOCK_TICK 0
-
-#define CALLING_OVERHEAD_TIMER_CREATE 0
-#define CALLING_OVERHEAD_TIMER_IDENT 0
-#define CALLING_OVERHEAD_TIMER_DELETE 0
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 0
-#define CALLING_OVERHEAD_TIMER_RESET 0
-#define CALLING_OVERHEAD_TIMER_CANCEL 0
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
-
-#define CALLING_OVERHEAD_EVENT_SEND 0
-#define CALLING_OVERHEAD_EVENT_RECEIVE 0
-#define CALLING_OVERHEAD_SIGNAL_CATCH 0
-#define CALLING_OVERHEAD_SIGNAL_SEND 0
-#define CALLING_OVERHEAD_PARTITION_CREATE 0
-#define CALLING_OVERHEAD_PARTITION_IDENT 0
-#define CALLING_OVERHEAD_PARTITION_DELETE 0
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
-#define CALLING_OVERHEAD_REGION_CREATE 0
-#define CALLING_OVERHEAD_REGION_IDENT 0
-#define CALLING_OVERHEAD_REGION_DELETE 0
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
-#define CALLING_OVERHEAD_PORT_CREATE 0
-#define CALLING_OVERHEAD_PORT_IDENT 0
-#define CALLING_OVERHEAD_PORT_DELETE 0
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 0
-#define CALLING_OVERHEAD_IO_OPEN 0
-#define CALLING_OVERHEAD_IO_CLOSE 0
-#define CALLING_OVERHEAD_IO_READ 0
-#define CALLING_OVERHEAD_IO_WRITE 0
-#define CALLING_OVERHEAD_IO_CONTROL 0
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/sparc/erc32/start/Makefile.in b/c/src/lib/libbsp/sparc/erc32/start/Makefile.in
deleted file mode 100644
index dbc9cea9e3..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/start/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/startsis.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=startsis
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/sparc/erc32/start/startsis.s b/c/src/lib/libbsp/sparc/erc32/start/startsis.s
deleted file mode 100644
index 6097c4ab36..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/start/startsis.s
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * startsis.s
- *
- * Start code for the ERC32.
- *
- * This is based on the file srt0.s provided with the binary
- * distribution of the SPARC Instruction Simulator (SIS) found
- * at ftp://ftp.estec.esa.nl/pub/ws/wsd/erc32.
- *
- * $Id$
- */
-
-#include <asm.h>
-#include <erc32.h>
-
-/*
- * Unexpected trap will halt the processor by forcing it to error state
- */
-
-#define BAD_TRAP \
- ta 0; \
- nop; \
- nop; \
- nop;
-
-/*
- * Software trap. Treat as BAD_TRAP for the time being...
- */
-
-#define SOFT_TRAP BAD_TRAP
-
-
- .seg "text"
- PUBLIC(start)
- .global start
-
-SYM(start):
-start:
-
-/*
- * The trap table has to be the first code in a boot PROM. But because
- * the Memory Configuration comes up thinking we only have 4K of PROM, we
- * cannot have a full trap table and still have room left over to
- * reprogram the Memory Configuration register correctly. This file
- * uses an abbreviated trap which has every entry which might be used
- * before RTEMS installs its own trap table.
- */
-
-
- PUBLIC(trap_table)
-SYM(trap_table):
-
- RTRAP( 0, SYM(hard_reset) ); ! 00 reset trap
- BAD_TRAP; ! 01 instruction access
- ! exception
- BAD_TRAP; ! 02 illegal instruction
- BAD_TRAP; ! 03 privileged instruction
- BAD_TRAP; ! 04 fp disabled
- TRAP( 5, SYM(window_overflow_trap_handler) ); ! 05 window overflow
- TRAP( 6, SYM(window_underflow_trap_handler) );! 06 window underflow
- BAD_TRAP; ! 07 memory address not aligned
- BAD_TRAP; ! 08 fp exception
- BAD_TRAP; ! 09 data access exception
- BAD_TRAP; ! 0A tag overflow
- BAD_TRAP; ! 0B undefined
- BAD_TRAP; ! 0C undefined
- BAD_TRAP; ! 0D undefined
- BAD_TRAP; ! 0E undefined
- BAD_TRAP; ! 0F undefined
- BAD_TRAP; ! 10 undefined
-
- /*
- * ERC32 defined traps
- */
-
- BAD_TRAP; ! 11 masked errors
- BAD_TRAP; ! 12 external 1
- BAD_TRAP; ! 13 external 2
- BAD_TRAP; ! 14 UART A RX/TX
- BAD_TRAP; ! 15 UART B RX/TX
- BAD_TRAP; ! 16 correctable memory error
- BAD_TRAP; ! 17 UART error
- BAD_TRAP; ! 18 DMA access error
- BAD_TRAP; ! 19 DMA timeout
- BAD_TRAP; ! 1A external 3
- BAD_TRAP; ! 1B external 4
- BAD_TRAP; ! 1C general purpose timer
- BAD_TRAP; ! 1D real time clock
- BAD_TRAP; ! 1E external 5
- BAD_TRAP; ! 1F watchdog timeout
-
-
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 20 - 23 undefined
- BAD_TRAP; ! 24 cp_disabled
- BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 25 - 27 undefined
- BAD_TRAP; ! 28 cp_exception
- BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 29 - 2B undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 2C - 2F undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 30 - 33 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 34 - 37 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 38 - 3B undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 3C - 3F undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 40 - 43 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 44 - 47 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 48 - 4B undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 4C - 4F undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 50 - 53 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 54 - 57 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 58 - 5B undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 5C - 5F undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 60 - 63 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 64 - 67 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 68 - 6B undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 6C - 6F undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 70 - 73 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 74 - 77 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 78 - 7B undefined
-
-/*
- This is a sad patch to make sure that we know where the
- MEC timer control register mirror is so we can stop the timers
- from an external debugger. It is needed because the control
- register is write-only. Trap 0x7C cannot occure in ERC32...
-
- We also use this location to store the last location of the
- usable RAM in order not to overwrite the remote debugger with
- the RTEMS work-space area.
-
-*/
-
- .global __ERC32_MEC_Timer_Control_Mirror, _rdb_start, _CLOCK_SPEED
-
-_rdb_start:
-__ERC32_MEC_Timer_Control_Mirror:
-
- BAD_TRAP; BAD_TRAP; ! 7C - 7D undefined
-
-_CLOCK_SPEED:
- BAD_TRAP; BAD_TRAP; ! BAD_TRAP; BAD_TRAP; ! 7E - 7F undefined
-
- /*
- * Software traps
- *
- * NOTE: At the risk of being redundant... this is not a full
- * table. The setjmp on the SPARC requires a window flush trap
- * handler and RTEMS will preserve the entries that were
- * installed before.
- */
-
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 80 - 82
- TRAP( 0x83, SYM(window_flush_trap_handler) ); ! 83 flush windows SW trap
-
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 84 - 87
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 88 - 8B
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 8C - 8F
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 90 - 93
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 94 - 97
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 98 - 9B
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 9C - 9F
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! A0 - A3
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! A4 - A7
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! A8 - AB
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! AC - AF
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! B0 - B3
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! B4 - B7
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! B8 - BB
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! BC - BF
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! C0 - C3
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! C4 - C7
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! C8 - CB
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! CC - CF
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! D0 - D3
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! D4 - D7
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! D8 - DB
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! DC - DF
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! E0 - E3
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! E4 - E7
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! E8 - EB
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! EC - EF
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! F0 - F3
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! F4 - F7
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! F8 - FB
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! FC - FF
-
-/*
- * This is the hard reset code.
- */
-
-#define PSR_INIT 0x10c0 /* Disable traps, set s and ps */
-#define WIM_INIT 2
-#define STACK_SIZE 16 * 1024
-
- PUBLIC(hard_reset)
-SYM(hard_reset):
-
- set _trap_table, %g1 ! Initialize TBR
- mov %g1, %tbr
-
- set (SYM(rdb_start)), %g6 ! End of work-space area
- st %sp, [%g6]
-
-
-/* Check if MEC is initialised. If not, this means that we are
- running on the simulator. Initiate some of the parameters
- that are done by the boot-prom otherwise.
-*/
-
- set SYM(ERC32_MEC), %g3 ! g3 = base address of peripherals
- ld [%g3], %g2
- set 0xfe080000, %g1
- andcc %g1, %g2, %g0
- bne 1f
- set 0x00101000, %g1 ! 2M ROM, 4M RAM
- ! set the Memory Configuration
- st %g1, [ %g3 + ERC32_MEC_MEMORY_CONFIGURATION_OFFSET ]
-
- set SYM(RAM_END), %sp ! End of work-space area
- st %sp, [%g6]
-
- set _CLOCK_SPEED, %g6 ! Use 14 MHz in simulator
- set 14, %g1
- st %g1, [%g6]
-
-/* Common initialisation */
-1:
- set WIM_INIT, %g1 ! Initialize WIM
- mov %g1, %wim
-
- set PSR_INIT, %g1
- wr %g1, 0x20, %psr ! enable traps
-
- nop
- nop
- nop
-
- sethi %hi(stack_space + STACK_SIZE), %g1
- or %g1,%lo(stack_space + STACK_SIZE),%g1
- ! g1 = top of stack
- mov %g1, %sp ! Set stack pointer
- mov %sp, %fp ! Set frame pointer
- nop
-
- /*
- * Copy the initialized data to RAM
- *
- * FROM: _endtext
- * TO: _data_start
- * LENGTH: (__bss_start - _data_start) bytes
- */
-
-
- sethi %hi(_endtext),%g2
- or %g2,%lo(_endtext),%g2 ! g2 = start of initialized data in ROM
-
- sethi %hi(_data_start),%g3
- or %g3,%lo(_data_start),%g3 ! g3 = start of initialized data in RAM
-
- sethi %hi(__bss_start),%g4
- or %g4,%lo(__bss_start),%g4 ! g4 = end of initialized data in RAM
-
- cmp %g2, %g3
- be 1f
- nop
-
-copy_data:
- ldd [ %g2 ], %g6
- std %g6 , [ %g3 ] ! copy this double word
- add %g3, 8, %g3 ! bump the destination pointer
- add %g2, 8, %g2 ! bump the source pointer
- cmp %g3, %g4 ! Is the pointer past the end of dest?
- bl copy_data
- nop
-
- /* clear the bss */
-1:
-
- sethi %hi(_edata),%g2
- or %g2,%lo(_edata),%g2 ! g2 = start of bss
- sethi %hi(_end),%g3
- or %g3,%lo(_end),%g3 ! g3 = end of bss
- mov %g0,%g1 ! so std has two zeros
-zerobss:
- std %g0,[%g2]
- add %g2,8,%g2
- cmp %g2,%g3
- bleu,a zerobss
- nop
-
- mov %0, %o2 ! environ
- mov %0, %o1 ! argv
- mov %0, %o0 ! argc
- call SYM(boot_card)
- sub %sp, 0x60, %sp ! room for boot_card to save args
- nop
-
- PUBLIC(BSP_fatal_return)
-SYM(BSP_fatal_return):
- ta 0 ! Halt if _main returns ...
- nop
-
- /*
- * There does not seem to be a way to get this aligned AND
- * in the BSS.
- */
-
- .align 32
- .comm stack_space, STACK_SIZE
-
-/* end of file */
diff --git a/c/src/lib/libbsp/sparc/erc32/startsis/Makefile.in b/c/src/lib/libbsp/sparc/erc32/startsis/Makefile.in
deleted file mode 100644
index dbc9cea9e3..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/startsis/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/startsis.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=startsis
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/sparc/erc32/startsis/startsis.s b/c/src/lib/libbsp/sparc/erc32/startsis/startsis.s
deleted file mode 100644
index 6097c4ab36..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/startsis/startsis.s
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * startsis.s
- *
- * Start code for the ERC32.
- *
- * This is based on the file srt0.s provided with the binary
- * distribution of the SPARC Instruction Simulator (SIS) found
- * at ftp://ftp.estec.esa.nl/pub/ws/wsd/erc32.
- *
- * $Id$
- */
-
-#include <asm.h>
-#include <erc32.h>
-
-/*
- * Unexpected trap will halt the processor by forcing it to error state
- */
-
-#define BAD_TRAP \
- ta 0; \
- nop; \
- nop; \
- nop;
-
-/*
- * Software trap. Treat as BAD_TRAP for the time being...
- */
-
-#define SOFT_TRAP BAD_TRAP
-
-
- .seg "text"
- PUBLIC(start)
- .global start
-
-SYM(start):
-start:
-
-/*
- * The trap table has to be the first code in a boot PROM. But because
- * the Memory Configuration comes up thinking we only have 4K of PROM, we
- * cannot have a full trap table and still have room left over to
- * reprogram the Memory Configuration register correctly. This file
- * uses an abbreviated trap which has every entry which might be used
- * before RTEMS installs its own trap table.
- */
-
-
- PUBLIC(trap_table)
-SYM(trap_table):
-
- RTRAP( 0, SYM(hard_reset) ); ! 00 reset trap
- BAD_TRAP; ! 01 instruction access
- ! exception
- BAD_TRAP; ! 02 illegal instruction
- BAD_TRAP; ! 03 privileged instruction
- BAD_TRAP; ! 04 fp disabled
- TRAP( 5, SYM(window_overflow_trap_handler) ); ! 05 window overflow
- TRAP( 6, SYM(window_underflow_trap_handler) );! 06 window underflow
- BAD_TRAP; ! 07 memory address not aligned
- BAD_TRAP; ! 08 fp exception
- BAD_TRAP; ! 09 data access exception
- BAD_TRAP; ! 0A tag overflow
- BAD_TRAP; ! 0B undefined
- BAD_TRAP; ! 0C undefined
- BAD_TRAP; ! 0D undefined
- BAD_TRAP; ! 0E undefined
- BAD_TRAP; ! 0F undefined
- BAD_TRAP; ! 10 undefined
-
- /*
- * ERC32 defined traps
- */
-
- BAD_TRAP; ! 11 masked errors
- BAD_TRAP; ! 12 external 1
- BAD_TRAP; ! 13 external 2
- BAD_TRAP; ! 14 UART A RX/TX
- BAD_TRAP; ! 15 UART B RX/TX
- BAD_TRAP; ! 16 correctable memory error
- BAD_TRAP; ! 17 UART error
- BAD_TRAP; ! 18 DMA access error
- BAD_TRAP; ! 19 DMA timeout
- BAD_TRAP; ! 1A external 3
- BAD_TRAP; ! 1B external 4
- BAD_TRAP; ! 1C general purpose timer
- BAD_TRAP; ! 1D real time clock
- BAD_TRAP; ! 1E external 5
- BAD_TRAP; ! 1F watchdog timeout
-
-
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 20 - 23 undefined
- BAD_TRAP; ! 24 cp_disabled
- BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 25 - 27 undefined
- BAD_TRAP; ! 28 cp_exception
- BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 29 - 2B undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 2C - 2F undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 30 - 33 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 34 - 37 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 38 - 3B undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 3C - 3F undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 40 - 43 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 44 - 47 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 48 - 4B undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 4C - 4F undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 50 - 53 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 54 - 57 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 58 - 5B undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 5C - 5F undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 60 - 63 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 64 - 67 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 68 - 6B undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 6C - 6F undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 70 - 73 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 74 - 77 undefined
- BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 78 - 7B undefined
-
-/*
- This is a sad patch to make sure that we know where the
- MEC timer control register mirror is so we can stop the timers
- from an external debugger. It is needed because the control
- register is write-only. Trap 0x7C cannot occure in ERC32...
-
- We also use this location to store the last location of the
- usable RAM in order not to overwrite the remote debugger with
- the RTEMS work-space area.
-
-*/
-
- .global __ERC32_MEC_Timer_Control_Mirror, _rdb_start, _CLOCK_SPEED
-
-_rdb_start:
-__ERC32_MEC_Timer_Control_Mirror:
-
- BAD_TRAP; BAD_TRAP; ! 7C - 7D undefined
-
-_CLOCK_SPEED:
- BAD_TRAP; BAD_TRAP; ! BAD_TRAP; BAD_TRAP; ! 7E - 7F undefined
-
- /*
- * Software traps
- *
- * NOTE: At the risk of being redundant... this is not a full
- * table. The setjmp on the SPARC requires a window flush trap
- * handler and RTEMS will preserve the entries that were
- * installed before.
- */
-
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 80 - 82
- TRAP( 0x83, SYM(window_flush_trap_handler) ); ! 83 flush windows SW trap
-
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 84 - 87
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 88 - 8B
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 8C - 8F
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 90 - 93
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 94 - 97
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 98 - 9B
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 9C - 9F
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! A0 - A3
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! A4 - A7
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! A8 - AB
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! AC - AF
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! B0 - B3
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! B4 - B7
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! B8 - BB
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! BC - BF
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! C0 - C3
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! C4 - C7
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! C8 - CB
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! CC - CF
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! D0 - D3
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! D4 - D7
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! D8 - DB
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! DC - DF
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! E0 - E3
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! E4 - E7
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! E8 - EB
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! EC - EF
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! F0 - F3
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! F4 - F7
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! F8 - FB
- SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! FC - FF
-
-/*
- * This is the hard reset code.
- */
-
-#define PSR_INIT 0x10c0 /* Disable traps, set s and ps */
-#define WIM_INIT 2
-#define STACK_SIZE 16 * 1024
-
- PUBLIC(hard_reset)
-SYM(hard_reset):
-
- set _trap_table, %g1 ! Initialize TBR
- mov %g1, %tbr
-
- set (SYM(rdb_start)), %g6 ! End of work-space area
- st %sp, [%g6]
-
-
-/* Check if MEC is initialised. If not, this means that we are
- running on the simulator. Initiate some of the parameters
- that are done by the boot-prom otherwise.
-*/
-
- set SYM(ERC32_MEC), %g3 ! g3 = base address of peripherals
- ld [%g3], %g2
- set 0xfe080000, %g1
- andcc %g1, %g2, %g0
- bne 1f
- set 0x00101000, %g1 ! 2M ROM, 4M RAM
- ! set the Memory Configuration
- st %g1, [ %g3 + ERC32_MEC_MEMORY_CONFIGURATION_OFFSET ]
-
- set SYM(RAM_END), %sp ! End of work-space area
- st %sp, [%g6]
-
- set _CLOCK_SPEED, %g6 ! Use 14 MHz in simulator
- set 14, %g1
- st %g1, [%g6]
-
-/* Common initialisation */
-1:
- set WIM_INIT, %g1 ! Initialize WIM
- mov %g1, %wim
-
- set PSR_INIT, %g1
- wr %g1, 0x20, %psr ! enable traps
-
- nop
- nop
- nop
-
- sethi %hi(stack_space + STACK_SIZE), %g1
- or %g1,%lo(stack_space + STACK_SIZE),%g1
- ! g1 = top of stack
- mov %g1, %sp ! Set stack pointer
- mov %sp, %fp ! Set frame pointer
- nop
-
- /*
- * Copy the initialized data to RAM
- *
- * FROM: _endtext
- * TO: _data_start
- * LENGTH: (__bss_start - _data_start) bytes
- */
-
-
- sethi %hi(_endtext),%g2
- or %g2,%lo(_endtext),%g2 ! g2 = start of initialized data in ROM
-
- sethi %hi(_data_start),%g3
- or %g3,%lo(_data_start),%g3 ! g3 = start of initialized data in RAM
-
- sethi %hi(__bss_start),%g4
- or %g4,%lo(__bss_start),%g4 ! g4 = end of initialized data in RAM
-
- cmp %g2, %g3
- be 1f
- nop
-
-copy_data:
- ldd [ %g2 ], %g6
- std %g6 , [ %g3 ] ! copy this double word
- add %g3, 8, %g3 ! bump the destination pointer
- add %g2, 8, %g2 ! bump the source pointer
- cmp %g3, %g4 ! Is the pointer past the end of dest?
- bl copy_data
- nop
-
- /* clear the bss */
-1:
-
- sethi %hi(_edata),%g2
- or %g2,%lo(_edata),%g2 ! g2 = start of bss
- sethi %hi(_end),%g3
- or %g3,%lo(_end),%g3 ! g3 = end of bss
- mov %g0,%g1 ! so std has two zeros
-zerobss:
- std %g0,[%g2]
- add %g2,8,%g2
- cmp %g2,%g3
- bleu,a zerobss
- nop
-
- mov %0, %o2 ! environ
- mov %0, %o1 ! argv
- mov %0, %o0 ! argc
- call SYM(boot_card)
- sub %sp, 0x60, %sp ! room for boot_card to save args
- nop
-
- PUBLIC(BSP_fatal_return)
-SYM(BSP_fatal_return):
- ta 0 ! Halt if _main returns ...
- nop
-
- /*
- * There does not seem to be a way to get this aligned AND
- * in the BSS.
- */
-
- .align 32
- .comm stack_space, STACK_SIZE
-
-/* end of file */
diff --git a/c/src/lib/libbsp/sparc/erc32/startup/Makefile.in b/c/src/lib/libbsp/sparc/erc32/startup/Makefile.in
deleted file mode 100644
index 1ef823537b..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/startup/Makefile.in
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec spurious
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.S)
-S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
-
-SRCS=linkcmds $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/sparc/erc32/startup/bspclean.c b/c/src/lib/libbsp/sparc/erc32/startup/bspclean.c
deleted file mode 100644
index be9a577fc2..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/startup/bspclean.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* bspclean.c
- *
- * This file contains cleanup code executed when the application exits.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-/*
- * The app has "exited" (rtems_shutdown_executive returns control to main)
- */
-
-void bsp_cleanup( void )
-{
- /*
- * "halt" by trapping to the simulator command line.
- */
-
-
- asm volatile( "ta 0" );
-}
diff --git a/c/src/lib/libbsp/sparc/erc32/startup/bspstart.c b/c/src/lib/libbsp/sparc/erc32/startup/bspstart.c
deleted file mode 100644
index 0219dfeccc..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/startup/bspstart.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * This set of routines starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before any of these are invoked.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <libcsupport.h>
-
-#include <string.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-/*
- * Tells us where to put the workspace in case remote debugger is present.
- */
-
-extern rtems_unsigned32 rdb_start;
-
-/*
- * Amount to increment itimer by each pass
- * It is a variable instead of a #define to allow the 'looptest'
- * script to bump it without recompiling rtems
- *
- * NOTE: This is based on the PA-RISC simulator. I don't know if we
- * can actually pull this trick on the SPARC simulator.
- */
-
-rtems_unsigned32 CPU_SPARC_CLICKS_PER_TICK;
-
-#if SIMSPARC_FAST_IDLE
-
-/*
- * Many of the tests are very slow on the simulator because they have
- * have 5 second delays hardwired in.
- *
- * Try to speed those tests up by speeding up the clock when in the idle task.
- *
- * NOTE: At the current setting, 5 second delays in the tests take
- * approximately 5 seconds of wall time.
- */
-
-rtems_extension fast_idle_switch_hook(
- rtems_tcb *current_task,
- rtems_tcb *heir_task
-)
-{
- static rtems_unsigned32 normal_clock = ~0;
- static rtems_unsigned32 fast_clock;
-
- /* init our params on first call */
- if (normal_clock == ~0)
- {
- normal_clock = CPU_SPARC_CLICKS_PER_TICK;
- fast_clock = CPU_SPARC_CLICKS_PER_TICK / 0x08;
- if (fast_clock == 0) /* handle pathological case */
- fast_clock++;
- }
-
- /*
- * Run the clock faster when idle is in place.
- */
-
- if (heir_task == _Thread_Idle)
- CPU_SPARC_CLICKS_PER_TICK = fast_clock;
- else if (current_task == _Thread_Idle)
- CPU_SPARC_CLICKS_PER_TICK = normal_clock;
-}
-
-#endif
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * bsp_pretasking_hook
- *
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- rtems_unsigned32 heap_start;
- rtems_unsigned32 heap_size;
-
- heap_start = (rtems_unsigned32) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- heap_size = BSP_Configuration.work_space_start - (void *)&end;
- heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
-
- bsp_libc_init((void *) heap_start, heap_size, 0);
-
-
-#if SIMSPARC_FAST_IDLE
- /*
- * Install the fast idle task switch extension
- *
- * On MP systems, might not want to do this; it confuses at least
- * one test (mp06) on the PA-RISC simulator
- */
-
-#if 0
- if (BSP_Configuration.User_multiprocessing_table == 0)
-#endif
- {
- rtems_extensions_table fast_idle_extension;
- rtems_id extension_id;
- rtems_status_code rc;
-
- memset(&fast_idle_extension, 0, sizeof(fast_idle_extension));
-
- fast_idle_extension.thread_switch = fast_idle_switch_hook;
-
- rc = rtems_extension_create(
- rtems_build_name('F', 'D', 'L', 'E'),
- &fast_idle_extension,
- &extension_id
- );
- if (rc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(rc);
- }
-#endif
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- unsigned char *work_space_start;
-
- /* Check if MEC is initialised */
-
- if (!(ERC32_MEC.Control & 0xfe080000)) {
-
- /*
- * DISABLE THE HARDWARE WATCHDOG!!!
- */
-
- ERC32_MEC.Watchdog_Trap_Door_Set = 0; /* value is irrelevant */
-
- /*
- * Reduce the number of wait states to 0 for all memory areas.
- */
-
- ERC32_MEC.Wait_State_Configuration = 0;
-
- }
-
- /*
- * Set up our hooks
- * Make sure libc_init is done before drivers initialized so that
- * they can use atexit()
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
-
- /*
- * SIS does zero out memory BUT only when IT begins execution. Thus
- * if we want to have a clean slate in the workspace each time we
- * begin execution of OUR application, then we must zero the workspace.
- */
- Cpu_table.do_zero_of_workspace = TRUE;
-
- /*
- * This should be enough interrupt stack.
- */
-
- Cpu_table.interrupt_stack_size = (24 * 1024);
-
-/*
-#if defined(RTEMS_POSIX_API)
- BSP_Configuration.work_space_size *= 3;
-#endif
-*/
-
- work_space_start =
- (unsigned char *)rdb_start - BSP_Configuration.work_space_size;
-
- if ( work_space_start <= (unsigned char *)&end ) {
- DEBUG_puts( "bspstart: Not enough RAM!!!\n" );
- BSP_fatal_return();
- }
-
- BSP_Configuration.work_space_start = work_space_start;
-
- /*
- * Account for the console's resources
- */
-
- console_reserve_resources( &BSP_Configuration );
-
-#if SIMSPARC_FAST_IDLE
- /*
- * Add 1 extension for fast idle
- */
-
- BSP_Configuration.maximum_extensions++;
-#endif
-
- /*
- * Add 1 extension for MPCI_fatal
- */
-
- if (BSP_Configuration.User_multiprocessing_table)
- BSP_Configuration.maximum_extensions++;
-
- /*
- * Set the "clicks per tick" for the simulator
- * used by XXX/clock/clock.c to schedule interrupts
- */
-
- CPU_SPARC_CLICKS_PER_TICK = BSP_Configuration.microseconds_per_tick;
-}
diff --git a/c/src/lib/libbsp/sparc/erc32/startup/linkcmds b/c/src/lib/libbsp/sparc/erc32/startup/linkcmds
deleted file mode 100644
index d1f39fa47d..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/startup/linkcmds
+++ /dev/null
@@ -1,158 +0,0 @@
-/* linkcmds
- *
- * $Id$
- */
-
-OUTPUT_ARCH(sparc)
-__DYNAMIC = 0;
-
-/*
- * The memory map looks like this:
- * +--------------------+ <- low memory
- * | .text |
- * | etext |
- * | ctor list | the ctor and dtor lists are for
- * | dtor list | C++ support
- * | _endtext |
- * +--------------------+
- * | .data | initialized data goes here
- * | _sdata |
- * | _edata |
- * +--------------------+
- * | .bss |
- * | __bss_start | start of bss, cleared by crt0
- * | _end | start of heap, used by sbrk()
- * +--------------------+
- * | heap space |
- * | _ENDHEAP |
- * | stack space |
- * | __stack | top of stack
- * +--------------------+ <- high memory
- */
-
-
-/*
- * User modifiable values:
- *
- * _CLOCK_SPEED in Mhz (used to program the counter/timers)
- *
- * _PROM_SIZE size of PROM (permissible values are 4K, 8K, 16K
- * 32K, 64K, 128K, 256K, and 512K)
- * _RAM_SIZE size of RAM (permissible values are 256K, 512K,
- * 1MB, 2Mb, 4Mb, 8Mb, 16Mb, and 32Mb)
- *
- * MAKE SURE THESE MATCH THE MEMORY DESCRIPTION SECTION!!!
- */
-
-/*
-_CLOCK_SPEED = 10;
-*/
-
-_PROM_SIZE = 512K;
-_RAM_SIZE = 2M;
-
-_RAM_START = 0x02000000;
-_RAM_END = _RAM_START + _RAM_SIZE;
-
-_PROM_START = 0x00000000;
-_PROM_END = _PROM_START + _PROM_SIZE;
-
-/*
- * Base address of the on-CPU peripherals
- */
-
-_ERC32_MEC = 0x01f80000;
-
-MEMORY
-{
- rom : ORIGIN = 0x00000000, LENGTH = 512K
- ram : ORIGIN = 0x02000000, LENGTH = 2M
-}
-
-/*
- * stick everything in ram (of course)
- */
-SECTIONS
-{
- .text :
- {
- CREATE_OBJECT_SYMBOLS
- text_start = .;
- _text_start = .;
- *(.text)
- . = ALIGN (16);
-
- *(.eh_fram)
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- etext = ALIGN(0x10);
- _etext = .;
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- *(.lit)
- *(.shdata)
- _endtext = .;
- } > ram
- .dynamic : { *(.dynamic) } >ram
- .got : { *(.got) } >ram
- .plt : { *(.plt) } >ram
- .hash : { *(.hash) } >ram
- .dynrel : { *(.dynrel) } >ram
- .dynsym : { *(.dynsym) } >ram
- .dynstr : { *(.dynstr) } >ram
- .hash : { *(.hash) } >ram
- .data :
- {
- data_start = .;
- _data_start = .;
- _sdata = . ;
- *(.data)
- CONSTRUCTORS
- edata = ALIGN(0x10);
- _edata = .;
- } > ram
- .shbss :
- {
- *(.shbss)
- } > ram
- .bss :
- {
- __bss_start = ALIGN(0x8);
- _bss_start = .;
- bss_start = .;
- *(.bss)
- *(COMMON)
- end = .;
- _end = ALIGN(0x8);
- __end = ALIGN(0x8);
- } > ram
- .stab . (NOLOAD) :
- {
- [ .stab ]
- }
- .stabstr . (NOLOAD) :
- {
- [ .stabstr ]
- }
-}
diff --git a/c/src/lib/libbsp/sparc/erc32/startup/setvec.c b/c/src/lib/libbsp/sparc/erc32/startup/setvec.c
deleted file mode 100644
index 2590ce41fa..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/startup/setvec.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on the SPARC simulator.
- *
- * INPUT PARAMETERS:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * OUTPUT PARAMETERS: NONE
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-rtems_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- rtems_isr_entry previous_isr;
- unsigned32 real_trap;
- unsigned32 source;
-
- if ( type )
- rtems_interrupt_catch( handler, vector, &previous_isr );
- else
- _CPU_ISR_install_raw_handler( vector, handler, (void *)&previous_isr );
-
- real_trap = SPARC_REAL_TRAP_NUMBER( vector );
-
- if ( ERC32_Is_MEC_Trap( real_trap ) ) {
-
- source = ERC32_TRAP_SOURCE( real_trap );
-
- ERC32_Clear_interrupt( source );
- ERC32_Unmask_interrupt( source );
- }
-
- return previous_isr;
-}
-
diff --git a/c/src/lib/libbsp/sparc/erc32/startup/spurious.c b/c/src/lib/libbsp/sparc/erc32/startup/spurious.c
deleted file mode 100644
index fa1a704079..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/startup/spurious.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * ERC32 Spurious Trap Handler
- *
- * This is just enough of a trap handler to let us know what
- * the likely source of the trap was.
- *
- * Developed as part of the port of RTEMS to the ERC32 implementation
- * of the SPARC by On-Line Applications Research Corporation (OAR)
- * under contract to the European Space Agency (ESA).
- *
- * COPYRIGHT (c) 1995. European Space Agency.
- *
- * This terms of the RTEMS license apply to this file.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#include <string.h>
-
-static const char digits[16] = "0123456789abcdef";
-
-/*
- * bsp_spurious_handler
- *
- * Print a message on the debug console and then die
- */
-
-rtems_isr bsp_spurious_handler(
- rtems_vector_number trap
-)
-{
- char line[ 80 ];
- int length;
- rtems_unsigned32 real_trap;
-
- DEBUG_puts( "Spurious Trap" );
-
- real_trap = SPARC_REAL_TRAP_NUMBER(trap);
-
- switch (real_trap) {
-
- /*
- * First the ones defined by the basic architecture
- */
-
- case 0x00:
- DEBUG_puts( "reset" );
- break;
- case 0x01:
- DEBUG_puts( "instruction access exception" );
- break;
- case 0x02:
- DEBUG_puts( "illegal instruction" );
- break;
- case 0x03:
- DEBUG_puts( "privileged instruction" );
- break;
- case 0x04:
- DEBUG_puts( "fp disabled" );
- break;
- case 0x07:
- DEBUG_puts( "memory address not aligned" );
- break;
- case 0x08:
- DEBUG_puts( "fp exception" );
- break;
- case 0x09:
- DEBUG_puts( "data access exception" );
- break;
- case 0x0A:
- DEBUG_puts( "tag overflow" );
- break;
-
- /*
- * Then the ones defined by the ERC32 in particular
- */
-
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_MASKED_ERRORS ):
- DEBUG_puts( "ERC32_INTERRUPT_MASKED_ERRORS" );
- break;
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_1 ):
- DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_1" );
- break;
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_2 ):
- DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_2" );
- break;
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_UART_A_RX_TX ):
- DEBUG_puts( "ERC32_INTERRUPT_UART_A_RX_TX" );
- break;
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_UART_B_RX_TX ):
- DEBUG_puts( "ERC32_INTERRUPT_UART_A_RX_TX" );
- break;
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_CORRECTABLE_MEMORY_ERROR ):
- DEBUG_puts( "ERC32_INTERRUPT_CORRECTABLE_MEMORY_ERROR" );
- break;
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_UART_ERROR ):
- DEBUG_puts( "ERC32_INTERRUPT_UART_ERROR" );
- break;
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_DMA_ACCESS_ERROR ):
- DEBUG_puts( "ERC32_INTERRUPT_DMA_ACCESS_ERROR" );
- break;
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_DMA_TIMEOUT ):
- DEBUG_puts( "ERC32_INTERRUPT_DMA_TIMEOUT" );
- break;
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_3 ):
- DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_3" );
- break;
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_4 ):
- DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_4" );
- break;
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_GENERAL_PURPOSE_TIMER ):
- DEBUG_puts( "ERC32_INTERRUPT_GENERAL_PURPOSE_TIMER" );
- break;
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_REAL_TIME_CLOCK ):
- DEBUG_puts( "ERC32_INTERRUPT_REAL_TIME_CLOCK" );
- break;
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_5 ):
- DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_5" );
- break;
- case ERC32_TRAP_TYPE( ERC32_INTERRUPT_WATCHDOG_TIMEOUT ):
- DEBUG_puts( "ERC32_INTERRUPT_WATCHDOG_TIMEOUT" );
- break;
-
- default:
- strcpy( line, "Number 0x " );
- length = strlen ( line );
- line[ length - 2 ] = digits[ real_trap >> 4 ];
- line[ length - 1 ] = digits[ real_trap & 0xf ];
- DEBUG_puts( line );
- break;
- }
-
- /*
- * What else can we do but stop ...
- */
-
- asm volatile( "ta 0x0" );
-}
-
-/*
- * bsp_spurious_initialize
- *
- * Install the spurious handler for most traps.
- */
-
-void bsp_spurious_initialize()
-{
- rtems_unsigned32 trap;
-
- for ( trap=0 ; trap<256 ; trap++ ) {
-
- /*
- * Skip window overflow, underflow, and flush as well as software
- * trap 0 which we will use as a shutdown.
- */
-
- if ( trap == 5 || trap == 6 || trap == 0x83 || trap == 0x80)
- continue;
-
- set_vector( bsp_spurious_handler, SPARC_SYNCHRONOUS_TRAP( trap ), 1 );
- }
-}
diff --git a/c/src/lib/libbsp/sparc/erc32/timer/Makefile.in b/c/src/lib/libbsp/sparc/erc32/timer/Makefile.in
deleted file mode 100644
index 16665e4de9..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/timer/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/sparc/erc32/timer/timer.c b/c/src/lib/libbsp/sparc/erc32/timer/timer.c
deleted file mode 100644
index 0c372134d4..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/timer/timer.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* timer.c
- *
- * This file implements a benchmark timer using the General Purpose Timer on
- * the MEC.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-
-#include <bsp.h>
-
-rtems_boolean Timer_driver_Find_average_overhead;
-
-rtems_boolean Timer_driver_Is_initialized = FALSE;
-
-void Timer_initialize()
-{
- /*
- * Timer runs long and accurate enough not to require an interrupt.
- */
-
- if ( Timer_driver_Is_initialized == FALSE ) {
-
- /* approximately 1 us per countdown */
- ERC32_MEC.General_Purpose_Timer_Scalar = CLOCK_SPEED - 1;
- ERC32_MEC.General_Purpose_Timer_Counter = 0xffffffff;
-
- } else {
- Timer_driver_Is_initialized = TRUE;
- }
-
- ERC32_MEC_Set_General_Purpose_Timer_Control(
- ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING |
- ERC32_MEC_TIMER_COUNTER_LOAD_COUNTER
- );
-
- ERC32_MEC_Set_General_Purpose_Timer_Control(
- ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING
- );
-
-}
-
-#define AVG_OVERHEAD 3 /* It typically takes 3.0 microseconds */
- /* to start/stop the timer. */
-#define LEAST_VALID 2 /* Don't trust a value lower than this */
-
-int Read_timer()
-{
- rtems_unsigned32 total;
-
- total = ERC32_MEC.General_Purpose_Timer_Counter;
-
- total = 0xffffffff - total;
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in one microsecond units */
-
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
-
- return total - AVG_OVERHEAD;
-}
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/sparc/erc32/times b/c/src/lib/libbsp/sparc/erc32/times
deleted file mode 100644
index 1b04728a25..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/times
+++ /dev/null
@@ -1,193 +0,0 @@
-#
-# Timing Test Suite Results for the SPARC Instruction Simulator BSP
-#
-# NOTE: The ERC32 is derived from the Cypress 601/602 chip set.
-#
-# $Id$
-#
-
-Board: SPARC Instruction Simulator v1.8
-CPU: include coprocessor if applicable
-Clock Speed: 15 Mhz
-Memory Configuration:
-Wait States: 0
-
-Times Reported in: microseconds
-Timer Source: on-CPU General Purpose Count Down Timer
-
-Column A: 3.5.1 pre-release
-Column B: unused
-
-# DESCRIPTION A B
-== ================================================================= ==== ====
- 1 rtems_semaphore_create 20
- rtems_semaphore_delete 21
- rtems_semaphore_obtain: available 15
- rtems_semaphore_obtain: not available -- NO_WAIT 15
- rtems_semaphore_release: no waiting tasks 16
-
- 2 rtems_semaphore_obtain: not available -- caller blocks 62
-
- 3 rtems_semaphore_release: task readied -- preempts caller 55
-
- 4 rtems_task_restart: blocked task -- preempts caller 77
- rtems_task_restart: ready task -- preempts caller 70
- rtems_semaphore_release: task readied -- returns to caller 25
- rtems_task_create 57
- rtems_task_start 31
- rtems_task_restart: suspended task -- returns to caller 36
- rtems_task_delete: suspended task 47
- rtems_task_restart: ready task -- returns to caller 37
- rtems_task_restart: blocked task -- returns to caller 46
- rtems_task_delete: blocked task 50
-
- 5 rtems_task_suspend: calling task 51
- rtems_task_resume: task readied -- preempts caller 49
-
- 6 rtems_task_restart: calling task 59
- rtems_task_suspend: returns to caller 18
- rtems_task_resume: task readied -- returns to caller 19
- rtems_task_delete: ready task 50
-
- 7 rtems_task_restart: suspended task -- preempts caller 70
-
- 8 rtems_task_set_priority: obtain current priority 12
- rtems_task_set_priority: returns to caller 27
- rtems_task_mode: obtain current mode 5
- rtems_task_mode: no reschedule 5
- rtems_task_mode: reschedule -- returns to caller 8
- rtems_task_mode: reschedule -- preempts caller 39
- rtems_task_set_note 13
- rtems_task_get_note 13
- rtems_clock_set 33
- rtems_clock_get 3
-
- 9 rtems_message_queue_create 110
- rtems_message_queue_send: no waiting tasks 37
- rtems_message_queue_urgent: no waiting tasks 37
- rtems_message_queue_receive: available 31
- rtems_message_queue_flush: no messages flushed 12
- rtems_message_queue_flush: messages flushed 16
- rtems_message_queue_delete 26
-
-10 rtems_message_queue_receive: not available -- NO_WAIT 15
- rtems_message_queue_receive: not available -- caller blocks 62
-
-11 rtems_message_queue_send: task readied -- preempts caller 72
-
-12 rtems_message_queue_send: task readied -- returns to caller 39
-
-13 rtems_message_queue_urgent: task readied -- preempts caller 72
-
-14 rtems_message_queue_urgent: task readied -- returns to caller 39
-
-15 rtems_event_receive: obtain current events 1
- rtems_event_receive: not available -- NO_WAIT 12
- rtems_event_receive: not available -- caller blocks 56
- rtems_event_send: no task readied 12
- rtems_event_receive: available 12
- rtems_event_send: task readied -- returns to caller 24
-
-16 rtems_event_send: task readied -- preempts caller 55
-
-17 rtems_task_set_priority: preempts caller 62
-
-18 rtems_task_delete: calling task 83
-
-19 rtems_signal_catch 9
- rtems_signal_send: returns to caller 15
- rtems_signal_send: signal to self 18
- exit ASR overhead: returns to calling task 22
- exit ASR overhead: returns to preempting task 49
-
-20 rtems_partition_create 35
- rtems_region_create 23
- rtems_partition_get_buffer: available 15
- rtems_partition_get_buffer: not available 13
- rtems_partition_return_buffer 18
- rtems_partition_delete 16
- rtems_region_get_segment: available 22
- rtems_region_get_segment: not available -- NO_WAIT 21
- rtems_region_return_segment: no waiting tasks 19
- rtems_region_get_segment: not available -- caller blocks 64
- rtems_region_return_segment: task readied -- preempts caller 74
- rtems_region_return_segment: task readied -- returns to caller 44
- rtems_region_delete 16
- rtems_io_initialize 2
- rtems_io_open 1
- rtems_io_close 1
- rtems_io_read 1
- rtems_io_write 1
- rtems_io_control 1
-
-21 rtems_task_ident 149
- rtems_message_queue_ident 145
- rtems_semaphore_ident 156
- rtems_partition_ident 145
- rtems_region_ident 148
- rtems_port_ident 145
- rtems_timer_ident 145
- rtems_rate_monotonic_ident 145
-
-22 rtems_message_queue_broadcast: task readied -- returns to caller 42
- rtems_message_queue_broadcast: no waiting tasks 17
- rtems_message_queue_broadcast: task readied -- preempts caller 78
-
-23 rtems_timer_create 14
- rtems_timer_fire_after: inactive 22
- rtems_timer_fire_after: active 24
- rtems_timer_cancel: active 15
- rtems_timer_cancel: inactive 13
- rtems_timer_reset: inactive 21
- rtems_timer_reset: active 23
- rtems_timer_fire_when: inactive 34
- rtems_timer_fire_when: active 34
- rtems_timer_delete: active 19
- rtems_timer_delete: inactive 17
- rtems_task_wake_when 69
-
-24 rtems_task_wake_after: yield -- returns to caller 9
- rtems_task_wake_after: yields -- preempts caller 45
-
-25 rtems_clock_tick 4
-
-26 _ISR_Disable 0
- _ISR_Flash 1
- _ISR_Enable 1
- _Thread_Disable_dispatch 0
- _Thread_Enable_dispatch 7
- _Thread_Set_state 11
- _Thread_Disptach (NO FP) 31
- context switch: no floating point contexts 21
- context switch: self 10
- context switch: to another task 10
- context switch: restore 1st FP task 25
- fp context switch: save idle, restore idle 31
- fp context switch: save idle, restore initialized 19
- fp context switch: save initialized, restore initialized 20
- _Thread_Resume 7
- _Thread_Unblock 7
- _Thread_Ready 9
- _Thread_Get 4
- _Semaphore_Get 2
- _Thread_Get: invalid id 0
-
-27 interrupt entry overhead: returns to interrupted task 6
- interrupt exit overhead: returns to interrupted task 6
- interrupt entry overhead: returns to nested interrupt 6
- interrupt exit overhead: returns to nested interrupt 5
- interrupt entry overhead: returns to preempting task 7
- interrupt exit overhead: returns to preempting task 36
-
-28 rtems_port_create 16
- rtems_port_external_to_internal 11
- rtems_port_internal_to_external 11
- rtems_port_delete 16
-
-29 rtems_rate_monotonic_create 15
- rtems_rate_monotonic_period: initiate period -- returns to caller 21
- rtems_rate_monotonic_period: obtain status 13
- rtems_rate_monotonic_cancel 16
- rtems_rate_monotonic_delete: inactive 18
- rtems_rate_monotonic_delete: active 20
- rtems_rate_monotonic_period: conclude periods -- caller blocks 53
diff --git a/c/src/lib/libbsp/sparc/erc32/tools/Makefile.in b/c/src/lib/libbsp/sparc/erc32/tools/Makefile.in
deleted file mode 100644
index d6126b1eb8..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/tools/Makefile.in
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-include $(RTEMS_ROOT)/make/rtems.cfg
-
-DESTDIR=$(PROJECT_RELEASE)/tests
-
-BUILD_PGMS = runtest
-PGMS = $(BUILD_PGMS)
-
-CLEAN_ADDITIONS += $(BUILD_PGMS)
-
-INSTALLED_PGMS=$(PGMS:%=$(DESTDIR)/%)
-
-all: $(DESTDIR) $(PGMS) install
-
-$(DESTDIR):
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-$(INSTALLED_PGMS): $(PGMS)
- @INSTALL@ $(INSTBINFLAGS) $^ $(DESTDIR)
-
-install: $(DESTDIR) $(INSTALLED_PGMS)
diff --git a/c/src/lib/libbsp/sparc/erc32/tools/runtest.in b/c/src/lib/libbsp/sparc/erc32/tools/runtest.in
deleted file mode 100644
index f45517e951..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/tools/runtest.in
+++ /dev/null
@@ -1,307 +0,0 @@
-#!@KSH@ -p
-#
-# $Id$
-#
-# Run rtems tests on the hppa simulator
-# This program generates a simulator script to run each test
-# Typically the test is then run, although it can be generated
-# and left as a file using -s
-#
-
-# progname=`basename $0`
-progname=${0##*/} # fast basename hack for ksh, bash
-
-USAGE=\
-"usage: $progname [ -opts ] test [ test ... ]
- -o options -- specify options to be passed to simulator
- -v -- verbose
- -s -- generate script file (as 'test'.ss) and exit
- -l logdir -- specify log directory (default is 'logdir')
-
- Specify test as 'test' or 'test.exe'.
- All multiprocessing tests *must* be specified simply as 'mp01', etc.
-"
-
-# export everything
-set -a
-
-# log an error to stderr
-prerr()
-{
- echo "$*" >&2
-}
-
-fatal() {
- [ "$1" ] && prerr $*
- prerr "$USAGE"
- exit 1
-}
-
-warn() {
- [ "$1" ] && prerr $*
-}
-
-# print args, 1 per line
-ml_echo()
-{
- for l
- do
- echo "$l"
- done
-}
-
-# run at normal and signalled exit
-test_exit()
-{
- exit_code=$1
-
- rm -f ${statfile}* ${scriptfile}* ${logfile}.tmp*
- [ "$sim_pid" ] && kill -9 $sim_pid
-
- exit $exit_code
-}
-
-#
-# process the options
-#
-# defaults for getopt vars
-#
-# max_run_time is defaulted to 5 minutes
-#
-
-verbose=""
-extra_options=""
-script_and_exit=""
-stdio_setup="yes"
-run_to_completion="yes"
-logdir=log
-update_on_tick="no"
-max_run_time=$((5 * 60))
-using_print_buffer="yes"
-
-while getopts vhr12o:c:sl:t OPT
-do
- case "$OPT" in
- v)
- verbose="yes";;
- s)
- script_and_exit="yes"
- run_to_completion="no"
- stdio_setup="no";;
- l)
- logdir="$OPTARG";;
- o)
- extra_options="$OPTARG";;
- *)
- fatal;;
- esac
-done
-
-let $((shiftcount = $OPTIND - 1))
-shift $shiftcount
-
-args=$*
-
-#
-# Run the tests
-#
-
-tests="$args"
-if [ ! "$tests" ]
-then
- set -- `echo *.exe`
- tests="$*"
-fi
-
-[ -d $logdir ] ||
- mkdir $logdir || fatal "could not create log directory ($logdir)"
-
-cpus=1
-
-# where the tmp files go
-statfile=/tmp/stats$$
-scriptfile=/tmp/script$$
-
-trap "test_exit" 1 2 3 13 14 15
-
-for tfile in $tests
-do
-
- tname=`basename $tfile .exe`
- TEST_TYPE="single"
-
- case $tname in
- monitor)
- if [ $run_to_completion = "yes" ]
- then
- warn "Skipping $tname; it is interactive"
- continue
- fi
- ;;
- *-node2*)
- fatal "MP tests not supported"
- warn "Skipping $tname; 'runtest' runs both nodes when for *-node1"
- continue;;
- *-node1*)
- fatal "MP tests not supported"
- warn "Running both nodes associated with $tname"
- tname=`echo $tname | sed 's/-node.*//'`
- TEST_TYPE="mp"
- ;;
- stackchk*|spfatal*|malloctest*|termio*)
- warn "Skipping $tname; it locks up or takes a VERY long time to run"
- continue
- ;;
- esac
-
- # Change the title bar to indicate which test we are running
- # The simulator screen doesn't provide any indication
-
- logfile=$logdir/$tname
- infofile=$logfile.info
-
- rm -f ${statfile}* ${scriptfile}* ${logfile}.tmp*
-
- date=`date`
- echo "Starting $tname at $date"
-
- # Generate a script file to get the work done.
- # The script file must do the following:
- #
- # load the program (programs if MP test)
- # arrange for capture of output
- # run the program
- # produce statistics
-
- {
- case $TEST_TYPE in
- "mp")
- fatal "MP tests not supported"
- ;;
-
- # All other tests (single-processor)
- *)
- echo "load $tfile"
- echo "go 0x02000000"
- echo "perf"
- echo "quit"
- ;;
- esac
-
- } > ${scriptfile}
-
- if [ "$script_and_exit" = "yes" ]
- then
- mv ${scriptfile} $tname.ss
- warn "script left in $tname.ss"
- test_exit 0
- fi
-
- # Spin off the simulator in the background
- sparc-rtems-sis $extra_options -c ${scriptfile} >${logfile}.tmp &
- sim_pid=$!
-
- # Make sure it won't run forever...
- {
- time_run=0
- while [ $time_run -lt $max_run_time ]
- do
- # sleep 10s at a time waiting for job to finish or timer to expire
- # if job has exited, then we exit, too.
- sleep 10
- if kill -0 $sim_pid 2>/dev/null
- then
- time_run=$((time_run + 10))
- else
- exit 0
- fi
- done
-
- kill -2 $sim_pid 2>/dev/null
- { sleep 5; kill -9 $sim_pid 2>/dev/null; } &
- } &
-
- wait $sim_pid
- status=$?
- if [ $status -ne 0 ]
- then
- ran_too_long="yes"
- else
- ran_too_long="no"
- fi
-
- sim_pid=""
-
- # fix up the printf output from the test
- case $TEST_TYPE in
- mp)
- fatal "MP not supported"
- ;;
- *)
- output_it=1
- sed -e '1,12d' \
- -e 's/ //' -e '/^$/d' < ${logfile}.tmp |
- while read line
- do
- if [ $output_it -eq 1 ] ; then
- if [ "$line" = "sis> perf" ] ; then
- output_it=0
- else
- echo "$line"
- fi
- fi
- done > ${logfile}_1
- ;;
- esac
-
- # Create the info files
- for cpu in $cpus
- do
- {
- echo "$date"
- echo "Test run on: `uname -n` ( `uname -a` )"
-
- output_it=0
- sed -e 's/ //' < ${logfile}.tmp |
- while read line
- do
- if [ $output_it -eq 1 ] ; then
- if [ "$line" = "sis> quit" ] ; then
- output_it=0
- else
- echo "$line"
- fi
- else
- if [ "$line" = "sis> perf" ] ; then
- output_it=1
- fi
- fi
- done
-
-
- if [ "$ran_too_long" = "yes" ]
- then
- echo "Test did NOT finish normally; killed after $max_run_time seconds"
- fi
-
- echo
- date;
- } > ${infofile}_$cpu
- done
-
- rm -f ${logfile}.tmp*
-
- if [ "$cpus" = "1" ]
- then
- mv ${infofile}_1 ${infofile}
- mv ${logfile}_1 ${logfile}
- fi
-
-done
-
-test_exit 0
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
-
diff --git a/c/src/lib/libbsp/sparc/erc32/wrapup/Makefile.in b/c/src/lib/libbsp/sparc/erc32/wrapup/Makefile.in
deleted file mode 100644
index 134655b109..0000000000
--- a/c/src/lib/libbsp/sparc/erc32/wrapup/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup console clock timer
-# pieces to pick up out of libcpu/sparc
-CPU_PIECES=reg_win
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(CPU_PIECES), \
- ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), \
- ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libbsp/unix/Makefile.in b/c/src/lib/libbsp/unix/Makefile.in
deleted file mode 100644
index f049e9b2e8..0000000000
--- a/c/src/lib/libbsp/unix/Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# Descend into the $(RTEMS_BSP_FAMILY) directory
-SUB_DIRS=$(RTEMS_BSP_FAMILY)
diff --git a/c/src/lib/libbsp/unix/posix/Makefile.in b/c/src/lib/libbsp/unix/posix/Makefile.in
deleted file mode 100644
index 856f926a51..0000000000
--- a/c/src/lib/libbsp/unix/posix/Makefile.in
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SRCS=README
-
-# MP_PARTS are the pieces of the BSP required in a MP environment
-# We only build them if HAS_MP was defined
-
-MP_PARTS_yes_V = shmsupp
-MP_PARTS = $(MP_PARTS_$(HAS_MP)_V)
-
-all: $(SRCS)
-
-# wrapup is the one that actually builds and installs the library
-# from the individual .rel files built in other directories
-SUB_DIRS=include startup clock console timer $(MP_PARTS) wrapup tools
diff --git a/c/src/lib/libbsp/unix/posix/README b/c/src/lib/libbsp/unix/posix/README
deleted file mode 100644
index 0bf0782737..0000000000
--- a/c/src/lib/libbsp/unix/posix/README
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# $Id$
-#
-
-
-This is a "generic" BSP for a modern UNIX system which is enough
-System V and POSIX compliant to support at least the following:
-
- + semaphores
- + itimers
- + mmap
- + shared memory
-
-At the moment, this BSP is known to work with the following UNIXes:
-
- + HP-UX 9.0.x
- + Solaris 2.x
- + Linux 1.1.x (single processor only -- mmap is broken)
diff --git a/c/src/lib/libbsp/unix/posix/bsp_specs b/c/src/lib/libbsp/unix/posix/bsp_specs
deleted file mode 100644
index a303e58bdb..0000000000
--- a/c/src/lib/libbsp/unix/posix/bsp_specs
+++ /dev/null
@@ -1,8 +0,0 @@
-%rename lib old_lib
-
-*lib:
-%{!qrtems: %(old_lib)} \
-%{qrtems: %{!qrtems_debug: -lrtemsall } \
-%{qrtems_debug: -lrtemsall_g} \
-%(old_lib)}
-
diff --git a/c/src/lib/libbsp/unix/posix/clock/Makefile.in b/c/src/lib/libbsp/unix/posix/clock/Makefile.in
deleted file mode 100644
index 516b5900b1..0000000000
--- a/c/src/lib/libbsp/unix/posix/clock/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=clock
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by
-# ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/unix/posix/clock/clock.c b/c/src/lib/libbsp/unix/posix/clock/clock.c
deleted file mode 100644
index 1db7ea8a92..0000000000
--- a/c/src/lib/libbsp/unix/posix/clock/clock.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Clock
- *
- * This routine generates clock ticks using standard POSIX services.
- * The tick frequency is specified by the bsp.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <stdlib.h>
-
-void Clock_exit(void);
-
-volatile rtems_unsigned32 Clock_driver_ticks;
-
-rtems_unsigned32 Clock_driver_vector;
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-void Install_clock(rtems_isr_entry clock_isr)
-{
- Clock_driver_ticks = 0;
-
- (void) set_vector( clock_isr, Clock_driver_vector, 1 );
-
- _CPU_Start_clock( BSP_Configuration.microseconds_per_tick );
-
- atexit(Clock_exit);
-}
-
-void Clock_isr(int vector)
-{
- Clock_driver_ticks++;
- rtems_clock_tick();
-}
-
-/*
- * Called via atexit()
- * Remove the clock signal
- */
-
-void Clock_exit(void)
-{
- _CPU_Stop_clock();
-
- (void) set_vector( 0, Clock_driver_vector, 1 );
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Clock_driver_vector = _CPU_Get_clock_vector();
-
- Install_clock((rtems_isr_entry) Clock_isr);
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(Clock_driver_vector);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- (void) set_vector( args->buffer, Clock_driver_vector, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/unix/posix/console/Makefile.in b/c/src/lib/libbsp/unix/posix/console/Makefile.in
deleted file mode 100644
index fd05ddfedd..0000000000
--- a/c/src/lib/libbsp/unix/posix/console/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/unix/posix/console/console.c b/c/src/lib/libbsp/unix/posix/console/console.c
deleted file mode 100644
index e3075286b0..0000000000
--- a/c/src/lib/libbsp/unix/posix/console/console.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Console IO Support Routines
- *
- * These provide UNIX-like read and write calls for the C library.
- *
- * NOTE: For the most part, this is just a space holder.
- *
- * COPYRIGHT (c) 1994 by Division Incorporated
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#include <unistd.h>
-#include <errno.h>
-
-rtems_device_driver
-console_initialize(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return 0;
-}
-
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return -1;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libbsp/unix/posix/include/Makefile.in b/c/src/lib/libbsp/unix/posix/include/Makefile.in
deleted file mode 100644
index 7d8581095f..0000000000
--- a/c/src/lib/libbsp/unix/posix/include/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h
-
-#
-# Equate files are for including from assembly preprocessed by
-# gm4 or gasp. No examples are provided except for those for
-# other CPUs. The best way to generate them would be to
-# provide a program which generates the constants used based
-# on the C equivalents.
-#
-
-EQ_FILES =
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libbsp/unix/posix/include/bsp.h b/c/src/lib/libbsp/unix/posix/include/bsp.h
deleted file mode 100644
index 923a9abf17..0000000000
--- a/c/src/lib/libbsp/unix/posix/include/bsp.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* bsp.h
- *
- * This include file contains all POSIX BSP definitions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __POSIX_BSP_h
-#define __POSIX_BSP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems.h>
-#include <clockdrv.h>
-#include <console.h>
-#include <iosupp.h>
-
-/*
- * Define the time limits for RTEMS Test Suite test durations.
- * Long test and short test duration limits are provided. These
- * values are in seconds and need to be converted to ticks for the
- * application.
- *
- */
-
-#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
-#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
-
-/*
- * Stuff for Time Test 27
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 1
-
-#define Install_tm27_vector( handler ) \
- set_vector( (handler), 16, 1 )
-
-#define Cause_tm27_intr() \
- raise( 16 )
-
-#define Clear_tm27_intr()
-
-#define Lower_tm27_intr() \
- _ISR_Set_level( 0 );
-
-#define RAM_START 0
-#define RAM_END 0x100000
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration;
-
-/*
- * Device Driver Table Entries
- */
-
-/*
- * NOTE: Use the standard Console driver entry
- */
-
-/*
- * NOTE: Use the standard Clock driver entry
- */
-
-/* functions */
-
-rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int);
-void bsp_start( void );
-void bsp_cleanup( void );
-
-/* miscellaneous stuff assumed to exist */
-
-extern rtems_configuration_table BSP_Configuration; /* owned by BSP */
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
-extern int rtems_argc;
-extern char **rtems_argv;
-
-extern rtems_unsigned32 bsp_isr_level;
-
-extern char *rtems_progname; /* UNIX executable name */
-
-extern int cpu_number;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/unix/posix/include/coverhd.h b/c/src/lib/libbsp/unix/posix/include/coverhd.h
deleted file mode 100644
index 4e43bd186b..0000000000
--- a/c/src/lib/libbsp/unix/posix/include/coverhd.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
- * RTEMS execution time from that used to call the directive.
- *
- * NOTE: If these are all zero, then the times reported include
- * all calling overhead including passing of arguments.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
-#define CALLING_OVERHEAD_TASK_CREATE 0
-#define CALLING_OVERHEAD_TASK_IDENT 0
-#define CALLING_OVERHEAD_TASK_START 0
-#define CALLING_OVERHEAD_TASK_RESTART 0
-#define CALLING_OVERHEAD_TASK_DELETE 0
-#define CALLING_OVERHEAD_TASK_SUSPEND 0
-#define CALLING_OVERHEAD_TASK_RESUME 0
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
-#define CALLING_OVERHEAD_TASK_MODE 0
-#define CALLING_OVERHEAD_TASK_GET_NOTE 0
-#define CALLING_OVERHEAD_TASK_SET_NOTE 0
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 0
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
-#define CALLING_OVERHEAD_CLOCK_GET 0
-#define CALLING_OVERHEAD_CLOCK_SET 0
-#define CALLING_OVERHEAD_CLOCK_TICK 0
-
-#define CALLING_OVERHEAD_TIMER_CREATE 0
-#define CALLING_OVERHEAD_TIMER_IDENT 0
-#define CALLING_OVERHEAD_TIMER_DELETE 0
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 0
-#define CALLING_OVERHEAD_TIMER_RESET 0
-#define CALLING_OVERHEAD_TIMER_CANCEL 0
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
-
-#define CALLING_OVERHEAD_EVENT_SEND 0
-#define CALLING_OVERHEAD_EVENT_RECEIVE 0
-#define CALLING_OVERHEAD_SIGNAL_CATCH 0
-#define CALLING_OVERHEAD_SIGNAL_SEND 0
-#define CALLING_OVERHEAD_PARTITION_CREATE 0
-#define CALLING_OVERHEAD_PARTITION_IDENT 0
-#define CALLING_OVERHEAD_PARTITION_DELETE 0
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
-#define CALLING_OVERHEAD_REGION_CREATE 0
-#define CALLING_OVERHEAD_REGION_IDENT 0
-#define CALLING_OVERHEAD_REGION_DELETE 0
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
-#define CALLING_OVERHEAD_PORT_CREATE 0
-#define CALLING_OVERHEAD_PORT_IDENT 0
-#define CALLING_OVERHEAD_PORT_DELETE 0
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 0
-#define CALLING_OVERHEAD_IO_OPEN 0
-#define CALLING_OVERHEAD_IO_CLOSE 0
-#define CALLING_OVERHEAD_IO_READ 0
-#define CALLING_OVERHEAD_IO_WRITE 0
-#define CALLING_OVERHEAD_IO_CONTROL 0
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/Makefile.in b/c/src/lib/libbsp/unix/posix/shmsupp/Makefile.in
deleted file mode 100644
index 8825079da7..0000000000
--- a/c/src/lib/libbsp/unix/posix/shmsupp/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/shmsupp.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=addrconv getcfg intr lock mpisr
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
-
diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/README b/c/src/lib/libbsp/unix/posix/shmsupp/README
deleted file mode 100644
index 93d6fcbe8c..0000000000
--- a/c/src/lib/libbsp/unix/posix/shmsupp/README
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# $Id$
-#
-
-This directory contains the SHM driver support files for
-System V/POSIX derived UNIX flavors.
-
-WARNING: The interrupt support in this directory currently will
- only work in a homogeneous system.
diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/addrconv.c b/c/src/lib/libbsp/unix/posix/shmsupp/addrconv.c
deleted file mode 100644
index f334654410..0000000000
--- a/c/src/lib/libbsp/unix/posix/shmsupp/addrconv.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* addrconv.v
- *
- * No address range conversion is required.
- *
- * Input parameters:
- * addr - address to convert
- *
- * Output parameters:
- * returns - converted address
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <shm.h>
-
-void *Shm_Convert_address(
- void *addr
-)
-{
- return ( addr );
-}
diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c b/c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c
deleted file mode 100644
index 8759a0ce27..0000000000
--- a/c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* void Shm_get_config( localnode, &shmcfg )
- *
- * This routine initializes, if necessary, and returns a pointer
- * to the Shared Memory Configuration Table for the UNIX
- * simulator.
- *
- * INPUT PARAMETERS:
- * localnode - local node number
- * shmcfg - address of pointer to SHM Config Table
- *
- * OUTPUT PARAMETERS:
- * *shmcfg - pointer to SHM Config Table
- *
- * NOTES: This driver is capable of supporting a practically unlimited
- * number of nodes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <shm.h>
-#include <sys/types.h> /* pid_t */
-
-shm_config_table BSP_shm_cfgtbl;
-
-int semid;
-
-void Shm_Cause_interrupt_unix(
- rtems_unsigned32 node
-);
-
-void Shm_Get_configuration(
- rtems_unsigned32 localnode,
- shm_config_table **shmcfg
-)
-{
- _CPU_SHM_Init(
- Shm_Maximum_nodes,
- Shm_Is_master_node(),
- (void **)&BSP_shm_cfgtbl.base,
- (unsigned32 *)&BSP_shm_cfgtbl.length
- );
-
- BSP_shm_cfgtbl.format = SHM_BIG;
-
- BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt_unix;
-
-#ifdef NEUTRAL_BIG
- BSP_shm_cfgtbl.convert = NULL_CONVERT;
-#else
- BSP_shm_cfgtbl.convert = CPU_swap_u32;
-#endif
-
- if ( _CPU_SHM_Get_vector() ) {
- BSP_shm_cfgtbl.poll_intr = INTR_MODE;
- BSP_shm_cfgtbl.Intr.address = (vol_u32 *) _CPU_Get_pid(); /* process id */
- BSP_shm_cfgtbl.Intr.value = _CPU_SHM_Get_vector(); /* signal to send */
- BSP_shm_cfgtbl.Intr.length = LONG;
- } else {
- BSP_shm_cfgtbl.poll_intr = POLLED_MODE;
- BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT;
- BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT;
- }
-
- *shmcfg = &BSP_shm_cfgtbl;
-}
diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/intr.c b/c/src/lib/libbsp/unix/posix/shmsupp/intr.c
deleted file mode 100644
index 2e5f014bf6..0000000000
--- a/c/src/lib/libbsp/unix/posix/shmsupp/intr.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* void Shm_interrupt_unix( node )
- *
- * This routine is the shared memory driver routine which
- * generates interrupts to other CPUs.
- *
- * Input parameters:
- * node - destination of this packet (0 = broadcast)
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <shm.h>
-#include <sys/types.h> /* pid_t */
-
-void Shm_Cause_interrupt_unix(
- rtems_unsigned32 node
-)
-{
- Shm_Interrupt_information *intr;
- intr = &Shm_Interrupt_table[node];
-
- _CPU_SHM_Send_interrupt( (pid_t) intr->address, intr->value );
-}
diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/lock.c b/c/src/lib/libbsp/unix/posix/shmsupp/lock.c
deleted file mode 100644
index 5805a2d3c0..0000000000
--- a/c/src/lib/libbsp/unix/posix/shmsupp/lock.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Shared Memory Lock Routines
- *
- * This shared memory locked queue support routine need to be
- * able to lock the specified locked queue. Interrupts are
- * disabled while the queue is locked to prevent preemption
- * and deadlock when two tasks poll for the same lock.
- * previous level.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <shm.h>
-
-/*
- * Shm_Initialize_lock
- *
- * Initialize the lock for the specified locked queue.
- */
-
-void Shm_Initialize_lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- lq_cb->lock = lq_cb - Shm_Locked_queues;
-}
-
-/* Shm_Lock( &lq_cb )
- *
- * This shared memory locked queue support routine locks the
- * specified locked queue. It disables interrupts to prevent
- * a deadlock condition.
- */
-
-void Shm_Lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
-
- rtems_interrupt_disable( isr_level );
-
- Shm_isrstat = isr_level;
-
- _CPU_SHM_Lock( lq_cb->lock );
-}
-
-/*
- * Shm_Unlock
- *
- * Unlock the lock for the specified locked queue.
- */
-
-void Shm_Unlock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- rtems_unsigned32 isr_level;
-
- _CPU_SHM_Unlock( lq_cb->lock );
-
- isr_level = Shm_isrstat;
- rtems_interrupt_enable( isr_level );
-}
diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/mpisr.c b/c/src/lib/libbsp/unix/posix/shmsupp/mpisr.c
deleted file mode 100644
index 2cfcc4def9..0000000000
--- a/c/src/lib/libbsp/unix/posix/shmsupp/mpisr.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Shm_setvec
- *
- * This driver routine sets the SHM interrupt vector to point to the
- * driver's SHM interrupt service routine.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <shm.h>
-
-void Shm_setvec( void )
-{
- int vector;
-
- vector = _CPU_SHM_Get_vector();
-
- if ( vector )
- set_vector( Shm_isr, vector, 1 );
-}
diff --git a/c/src/lib/libbsp/unix/posix/startup/Makefile.in b/c/src/lib/libbsp/unix/posix/startup/Makefile.in
deleted file mode 100644
index 6b7d344e56..0000000000
--- a/c/src/lib/libbsp/unix/posix/startup/Makefile.in
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/../../../shared
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/startup.rel
-NO_CTOR_LIB=${ARCH}/libno-ctor.a
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bsplibc bspstart setvec $(C_MAIN)
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-CC_PIECES=$(CXX_MAIN)
-CC_FILES=$(CC_PIECES:%=%.cc)
-CC_O_FILES=$(CC_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) no-ctor.c
-OBJS=$(C_O_FILES)
-
-# We install the RTEMS constructor as a separate .o
-# so it can be easily place correctly by the compiler config file.
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-ifeq ($(RTEMS_HAS_CPLUSPLUS),yes)
-NO_CTOR_LIB=${ARCH}/libno-ctor.a
-INSTALLED_O_FILES=$(ARCH)/rtems-ctor.o
-CXX_MAIN=rtems-ctor
-C_MAIN=
-else
-CXX_MAIN=
-C_MAIN=main
-endif
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(LIBC_DEFINES)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-${NO_CTOR_LIB}: $(ARCH)/no-ctor.o
- $(RM) $@
- $(AR) -cvr $@ $(ARCH)/no-ctor.o
-
-all: ${ARCH} $(SRCS) $(INSTALLED_O_FILES) $(PGM) ${NO_CTOR_LIB}
- $(INSTALL_VARIANT) $(INSTALLED_O_FILES) ${PROJECT_RELEASE}/lib
- $(INSTALL_VARIANT) $(NO_CTOR_LIB) ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/unix/posix/startup/bspclean.c b/c/src/lib/libbsp/unix/posix/startup/bspclean.c
deleted file mode 100644
index 7f2d556ae1..0000000000
--- a/c/src/lib/libbsp/unix/posix/startup/bspclean.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* bsp_cleanup()
- *
- * This routine normally is part of start.s and returns
- * control to a monitor but on the UNIX simulator
- * we do that directly from main.c.
- *
- * INPUT: NONE
- *
- * OUTPUT: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#include <stdio.h>
-
-/*
- * The app has "exited" (called rtems_shutdown_executive)
- */
-
-void bsp_cleanup( void )
-{
- /*
- * Invoke any fatal error extension and "halt"
- * By definition, rtems_fatal_error_occurred does not return.
- */
-
- fflush(stdout);
- fflush(stderr);
-
- rtems_fatal_error_occurred(0);
-}
diff --git a/c/src/lib/libbsp/unix/posix/startup/bspstart.c b/c/src/lib/libbsp/unix/posix/startup/bspstart.c
deleted file mode 100644
index 71d85409ca..0000000000
--- a/c/src/lib/libbsp/unix/posix/startup/bspstart.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * Called by RTEMS::RTEMS constructor in startup-ctor.cc
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-/* for sbrk prototype in linux */
-#if defined(__linux__)
-#define __USE_MISC
-#endif
-#include <unistd.h>
-
-#include <bsp.h>
-#include <libcsupport.h>
-
-#include <rtems/libio.h>
-
-extern rtems_configuration_table Configuration;
-
-/*
- * A copy of the configuration table from the application
- * with some changes applied to it.
- */
-
-rtems_configuration_table BSP_Configuration;
-rtems_multiprocessing_table BSP_Multiprocessing;
-rtems_cpu_table Cpu_table;
-rtems_unsigned32 bsp_isr_level;
-rtems_unsigned32 Heap_size;
-int rtems_argc;
-char **rtems_argv;
-
-/*
- * May be overridden by RTEMS_WORKSPACE_SIZE and RTEMS_HEAPSPACE_SIZE
- * environment variables; see below.
- */
-
-#define DEFAULT_WORKSPACE_SIZE (WORKSPACE_MB * (1024 * 1024))
-#define DEFAULT_HEAPSPACE_SIZE (HEAPSPACE_MB * (1024 * 1024))
-
-/*
- * Amount to increment itimer by each pass
- * It is a variable instead of a #define to allow the 'looptest'
- * script to bump it without recompiling rtems
- */
-
-rtems_unsigned32 CPU_CLICKS_PER_TICK;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, unsigned32, int );
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- */
-
-void bsp_pretasking_hook(void)
-{
- void *heap_start;
-
- if (getenv("RTEMS_HEAPSPACE_SIZE"))
- Heap_size = strtol(getenv("RTEMS_HEAPSPACE_SIZE"), 0, 0);
- else
- Heap_size = DEFAULT_HEAPSPACE_SIZE;
-
- heap_start = 0;
-
- bsp_libc_init((void *)heap_start, Heap_size, 1024 * 1024);
-
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-
- /*
- * Dump malloc stats on exit...
- */
-#if defined(RTEMS_DEBUG)
- atexit(malloc_dump);
-#endif
-}
-
-/*
- * DO NOT Use the shared bsp_postdriver_hook() implementation
- */
-
-void bsp_postdriver_hook(void)
-{
- return;
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start(void)
-{
- unsigned32 workspace_ptr;
-
- /*
- * Copy the table (normally done in shared main).
- */
-
- BSP_Configuration = Configuration;
-
- /*
- * If the node number is -1 then the application better provide
- * it through environment variables RTEMS_NODE.
- * Ditto for RTEMS_MAXIMUM_NODES
- */
-
- if (BSP_Configuration.User_multiprocessing_table) {
- char *p;
-
- /* make a copy for possible editing */
- BSP_Multiprocessing = *BSP_Configuration.User_multiprocessing_table;
- BSP_Configuration.User_multiprocessing_table = &BSP_Multiprocessing;
-
- if (BSP_Multiprocessing.node == -1)
- {
- p = getenv("RTEMS_NODE");
- BSP_Multiprocessing.node = p ? atoi(p) : 1;
- }
-
- /* If needed provide maximum_nodes also */
- if (BSP_Multiprocessing.maximum_nodes == -1)
- {
- p = getenv("RTEMS_MAXIMUM_NODES");
- BSP_Multiprocessing.maximum_nodes = p ? atoi(p) : 1;
- }
- }
-
- /*
- * Set cpu_number to accurately reflect our cpu number
- */
-
- if (BSP_Configuration.User_multiprocessing_table)
- cpu_number = BSP_Configuration.User_multiprocessing_table->node - 1;
- else
- cpu_number = 0;
-
- if (getenv("RTEMS_WORKSPACE_SIZE"))
- BSP_Configuration.work_space_size =
- strtol(getenv("RTEMS_WORKSPACE_SIZE"), 0, 0);
- else
- BSP_Configuration.work_space_size = DEFAULT_WORKSPACE_SIZE;
-
- /*
- * Allocate workspace memory, ensuring it is properly aligned
- */
-
- workspace_ptr =
- (unsigned32) sbrk(BSP_Configuration.work_space_size + CPU_ALIGNMENT);
- workspace_ptr += CPU_ALIGNMENT - 1;
- workspace_ptr &= ~(CPU_ALIGNMENT - 1);
-
- BSP_Configuration.work_space_start = (void *) workspace_ptr;
-
- /*
- * Set up our hooks
- * Make sure libc_init is done before drivers init'd so that
- * they can use atexit()
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
-
- Cpu_table.predriver_hook = NULL;
-
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
-
- Cpu_table.idle_task = NULL; /* do not override system IDLE task */
-
- /*
- * Don't zero out the workspace since it is in the BSS under UNIX.
- */
-
- Cpu_table.do_zero_of_workspace = FALSE;
-
- /*
- * XXX; interrupt stack not currently used, so this doesn't matter
- */
-
- Cpu_table.interrupt_stack_size = (12 * 1024);
-
- Cpu_table.extra_mpci_receive_server_stack = 0;
-
- /*
- * Add 1 extension for MPCI_fatal
- */
-
- if (BSP_Configuration.User_multiprocessing_table)
- BSP_Configuration.maximum_extensions++;
-
- CPU_CLICKS_PER_TICK = 1;
-
- /*
- * Start most of RTEMS
- * main() will start the rest
- */
-
- bsp_isr_level = rtems_initialize_executive_early(
- &BSP_Configuration,
- &Cpu_table
- );
-}
diff --git a/c/src/lib/libbsp/unix/posix/startup/exit.c b/c/src/lib/libbsp/unix/posix/startup/exit.c
deleted file mode 100644
index 520c3f1313..0000000000
--- a/c/src/lib/libbsp/unix/posix/startup/exit.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * exit
- *
- * This routine returns control to "the pre-RTEMS environment".
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <clockdrv.h>
-
-void _exit( void )
-{
- /* Clock or Timer cleanup is run by at_exit() */
-
- Io_cleanup();
-
- bsp_cleanup();
-}
diff --git a/c/src/lib/libbsp/unix/posix/startup/main.c b/c/src/lib/libbsp/unix/posix/startup/main.c
deleted file mode 100644
index 520cd36b04..0000000000
--- a/c/src/lib/libbsp/unix/posix/startup/main.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Description:
- * This file exists solely to (try to) ensure RTEMS is initialized.
- * It is not to be used in systems which want C++ support.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-/*
- * RTEMS program name
- * Probably not used by anyone, but it is nice to have it.
- * Actually the UNIX version of CPU_INVOKE_DEBUGGER will probably
- * need to use it
- */
-
-char *rtems_progname;
-
-int main(
- int argc,
- char **argv
-)
-{
- rtems_argc = argc;
- rtems_argv = argv;
-
- bsp_start();
-
- if ((argc > 0) && argv && argv[0])
- rtems_progname = argv[0];
- else
- rtems_progname = "RTEMS";
-
- /*
- * Start multitasking
- */
-
- rtems_initialize_executive_late( bsp_isr_level );
-
- /*
- * Returns when multitasking is stopped
- * This allows our destructors to get run normally
- */
-
- fflush( stdout );
- fflush( stderr );
-
- bsp_cleanup();
-
- return 0;
-}
diff --git a/c/src/lib/libbsp/unix/posix/startup/no-ctor.c b/c/src/lib/libbsp/unix/posix/startup/no-ctor.c
deleted file mode 100644
index 349ad2b1dd..0000000000
--- a/c/src/lib/libbsp/unix/posix/startup/no-ctor.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * rtems, floss, libc are always compiled with GNU compilers
- * application code may be compiled with some other C++ compiler
- * that has a different global constructor technique.
- *
- * For the simple case, where the app has no global constructors or
- * is compiled by g++, we provide this empty routine
- * In order to get both g++ constructors (RTEMS::RTEMS, for example)
- * and application constructors run, we provide this routine.
- *
- * $Id$
- */
-
-void invoke_non_gnu_constructors(void)
-{
-}
diff --git a/c/src/lib/libbsp/unix/posix/startup/rtems-ctor.cc b/c/src/lib/libbsp/unix/posix/startup/rtems-ctor.cc
deleted file mode 100644
index 56f3a98580..0000000000
--- a/c/src/lib/libbsp/unix/posix/startup/rtems-ctor.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * rtems-ctor.cc
- *
- * Description:
- * This file exists solely to (try to) ensure RTEMS is initialized
- * before any global constructors are run.
- *
- * The problem:
- * Global constructors might reasonably expect that new() will
- * work, but since new() uses malloc() which uses RTEMS regions,
- * it can not be called until after initialize_executive().
- *
- * Global constructors are called in GNU systems one of 2 ways:
- *
- * an "invisible" call to __main() inserted by compiler
- * This __main() calls __do_global_ctors() which
- * walks thru the table and calls all global
- * constructors.
- *
- * or -
- * A special section is put into the linked binary. The
- * system startup code knows to run the constructors in
- * this special section before calling main().
- *
- * By making RTEMS initialization a constructor, we avoid having
- * too much about all this. All we have to guarantee is that
- * this constructor is the first one run.
- *
- *
- * So for the first case above, this is what happens
- *
- * host crt0
- * main()
- * __main()
- * __do_global_ctors()
- * bsp_start()
- * init_executive_early()
- * <<any other constructors>>
- *
- * init_executive_late()
- * bsp_cleanup()
- *
- * TODO:
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-/*
- * RTEMS program name
- * Probably not used by anyone, but it is nice to have it.
- * Actually the UNIX version of CPU_INVOKE_DEBUGGER will probably
- * need to use it
- */
-
-char *rtems_progname;
-
-class RTEMS {
- public:
- RTEMS();
- ~RTEMS();
-};
-
-RTEMS rtems_constructor;
-
-RTEMS::RTEMS()
-{
- bsp_start();
-}
-
-RTEMS::~RTEMS()
-{
- bsp_cleanup();
-}
-
-extern "C" {
- extern void invoke_non_gnu_constructors(void);
-
- int
- main(int argc,
- char **argv,
- char ** /* environp is unused */)
- {
- rtems_argc = argc;
- rtems_argv = argv;
-
- if ((argc > 0) && argv && argv[0])
- rtems_progname = argv[0];
- else
- rtems_progname = "RTEMS";
-
- /*
- * run any non-gnu constructors we may need
- */
-
- invoke_non_gnu_constructors();
-
- /*
- * Start multitasking
- */
-
- rtems_initialize_executive_late( bsp_isr_level );
-
- /*
- * Returns when multitasking is stopped
- * This allows our destructors to get run normally
- */
-
- fflush( stdout );
- fflush( stderr );
- return 0;
- }
-}
diff --git a/c/src/lib/libbsp/unix/posix/startup/setvec.c b/c/src/lib/libbsp/unix/posix/startup/setvec.c
deleted file mode 100644
index 750fe7c574..0000000000
--- a/c/src/lib/libbsp/unix/posix/startup/setvec.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on UNIX.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-rtems_isr_entry
-set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- rtems_isr_entry rtems_isr_ptr = 0;
- proc_ptr raw_isr_ptr;
-
- if ( type ) {
- rtems_interrupt_catch( handler, vector, &rtems_isr_ptr );
- return rtems_isr_ptr;
- } else {
- _CPU_ISR_install_vector( vector, (proc_ptr) handler, &raw_isr_ptr );
- return raw_isr_ptr;
- }
-
-}
-
-
diff --git a/c/src/lib/libbsp/unix/posix/timer/Makefile.in b/c/src/lib/libbsp/unix/posix/timer/Makefile.in
deleted file mode 100644
index 5901ba1f1b..0000000000
--- a/c/src/lib/libbsp/unix/posix/timer/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by
-# ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libbsp/unix/posix/timer/timer.c b/c/src/lib/libbsp/unix/posix/timer/timer.c
deleted file mode 100644
index 065989293d..0000000000
--- a/c/src/lib/libbsp/unix/posix/timer/timer.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* timer.c
- *
- * This file manages the interval timer on the PA-RISC.
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <time.h>
-#include <sys/time.h>
-
-struct timeval Timer_start;
-struct timeval Timer_stop;
-struct timezone Time_zone;
-
-rtems_boolean Timer_driver_Find_average_overhead;
-
-void Timer_initialize()
-{
- gettimeofday( &Timer_start, &Time_zone );
-}
-
-#define AVG_OVERHEAD 0 /* It typically takes xxx microseconds */
- /* (XX countdowns) to start/stop the timer. */
-#define LEAST_VALID 10 /* Don't trust a value lower than this */
-
-int Read_timer()
-{
- int total;
-
- gettimeofday( &Timer_stop, &Time_zone );
-
- if ( Timer_stop.tv_sec == Timer_start.tv_sec )
- total = Timer_stop.tv_usec - Timer_start.tv_usec;
- else {
- total = 1000000 - Timer_start.tv_usec;
- total += (Timer_stop.tv_sec - Timer_start.tv_sec - 1) * 1000000;
- total += Timer_stop.tv_usec;
- }
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in countdown units */
- else {
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
- return total - AVG_OVERHEAD;
- }
-}
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/unix/posix/times b/c/src/lib/libbsp/unix/posix/times
deleted file mode 100644
index 28811e37ba..0000000000
--- a/c/src/lib/libbsp/unix/posix/times
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Timing Test Suite Results for the UNIX Simulator BSP
-#
-# $Id$
-#
-
-The times when running on the UNIX simulator are irrelevant. They vary based
-on a variety of factors including host OS, host configuration, and system load.
-The intent of the UNIX simulator is to provide a testing and prototyping
-environment not to compete with the "normal" embedded role of RTEMS.
diff --git a/c/src/lib/libbsp/unix/posix/tools/Makefile.in b/c/src/lib/libbsp/unix/posix/tools/Makefile.in
deleted file mode 100644
index f455ef46d4..0000000000
--- a/c/src/lib/libbsp/unix/posix/tools/Makefile.in
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-include $(RTEMS_ROOT)/make/rtems.cfg
-
-DESTDIR=$(PROJECT_RELEASE)/tests
-
-# We use the generic difftest
-BUILD_PGMS=runtest looptest
-ifneq (@PERL@,)
-BUILD_PGMS+=semdump shmdump
-endif
-
-PGMS = $(BUILD_PGMS)
-
-CLEAN_ADDITIONS += $(BUILD_PGMS)
-
-INSTALLED_PGMS=$(PGMS:%=$(DESTDIR)/%)
-
-all: $(DESTDIR) $(PGMS) install
-
-$(DESTDIR):
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-$(INSTALLED_PGMS): $(PGMS)
- @INSTALL@ $(INSTBINFLAGS) $^ $(DESTDIR)
-
-install: $(DESTDIR) $(INSTALLED_PGMS)
diff --git a/c/src/lib/libbsp/unix/posix/tools/looptest.in b/c/src/lib/libbsp/unix/posix/tools/looptest.in
deleted file mode 100644
index 0f6965fe2b..0000000000
--- a/c/src/lib/libbsp/unix/posix/tools/looptest.in
+++ /dev/null
@@ -1,93 +0,0 @@
-#!@KSH@ -p
-#
-# $Id$
-#
-
-# progname=`basename $0`
-progname=${0##*/} # fast basename hack for ksh, bash
-
-# must be uppercase hex; dc is feeble minded
-clicks_per_tick="1"
-# default is 0x3
-hexbump=1
-iterations=10
-
-USAGE=\
-"usage: $progname [ -opts ] file [ file ... ]
- -o options -- specify options to be passed to runtest
- -c clicks -- specify (hex) value for clicks / tick (default $clicks_per_tick)
- -n iterations -- num times to loop thru specified tests (default $iterations)
- -b hexbump -- increment clicks-per-ticks this much each loop (default $hexbump)
- -v -- verbose"
-
-# 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=""
-extra_options=""
-
-while getopts vo:c:n:b: OPT
-do
- case "$OPT" in
- v)
- verbose="yes";;
- o)
- extra_options="$OPTARG";;
- c)
- clicks_per_ticks="$OPTARG";;
- n)
- iterations="$OPTARG";;
- b)
- hexbump="$OPTARG";;
- *)
- fatal;;
- esac
-done
-((shiftcount = $OPTIND - 1))
-shift $shiftcount
-
-args=$*
-
-#
-# Run the tests
-# After each run, rename 'log' to log.$clicks_per_tick
-#
-
-tests="$args"
-
-while [ $iterations -gt 0 ]
-do
- ./runtest $extra_options -c $clicks_per_tick $tests
- rm -rf log.$clicks_per_tick.OLD
- [ -d log.$clicks_per_tick ] && mv log.$clicks_per_tick log.$clicks_per_tick.OLD
- mv log log.$clicks_per_tick
-
- ((iterations = $iterations - 1))
- clicks_per_tick=`echo 16 o 16 i $clicks_per_tick $hexbump + p q | dc`
-done
-
-exit 0
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
-
diff --git a/c/src/lib/libbsp/unix/posix/tools/runtest.in b/c/src/lib/libbsp/unix/posix/tools/runtest.in
deleted file mode 100644
index 2d08f2f033..0000000000
--- a/c/src/lib/libbsp/unix/posix/tools/runtest.in
+++ /dev/null
@@ -1,255 +0,0 @@
-#!@KSH@ -p
-#
-# Run rtems tests on a POSIX-ish UNIX
-#
-# $Id$
-#
-
-trap "test_exit 1" 1 2 3 13 14 15
-
-trap "test_exit 1" 1 2 3 13 14 15
-
-# progname=`basename $0`
-progname=${0##*/} # fast basename hack for ksh, bash
-
-USAGE=\
-"usage: $progname [ -opts ] test [ test ... ]
- -c clicks -- specify (hex) value for clicks / tick
- -v -- verbose
- -l logdir -- specify log directory (default is 'logdir')
-
- Specify test as 'test' or 'test.exe'.
- All multiprocessing tests *must* be specified simply as 'mp01', etc.
-"
-
-# export everything
-set -a
-
-# log an error to stderr
-prerr()
-{
- echo "$*" >&2
-}
-
-fatal() {
- [ "$1" ] && prerr $*
- prerr "$USAGE"
- exit 1
-}
-
-warn() {
- [ "$1" ] && prerr $*
-}
-
-# print args, 1 per line
-ml_echo()
-{
- for l
- do
- echo "$l"
- done
-}
-
-killem()
-{
- kill -9 $pid $pid1 $pid2 2> /dev/null
-}
-
-
-killem()
-{
- kill -9 $pid $pid1 $pid2 2> /dev/null
-}
-
-
-test_exit()
-{
- exit_code=$1
-
- killem
-
- killem
-
- rm -f ${logfile}.tmp*
-
- exit $exit_code
-}
-
-#
-# process the options
-#
-# defaults for getopt vars
-#
-
-verbose=""
-extra_options=""
-clicks_per_tick=""
-logdir=log
-# how long can we run; rtems tests might run 300 seconds
-max_run_time=400
-run_to_completion="yes"
-
-while getopts vo:c:l: OPT
-do
- case "$OPT" in
- v)
- verbose="yes";;
- l)
- logdir="$OPTARG";;
- o)
- extra_options="$OPTARG";;
- c)
- clicks_per_tick="$OPTARG";;
- *)
- fatal;;
- esac
-done
-
-let $((shiftcount = $OPTIND - 1))
-shift $shiftcount
-
-args=$*
-
-#
-# Run the tests
-#
-
-tests="$args"
-if [ ! "$tests" ]
-then
- set -- `echo *.exe`
- tests="$*"
-fi
-
-[ -d $logdir ] || mkdir $logdir || fatal "could not create log directory ($logdir)"
-
-for tfile in $tests
-do
-
- tname=`echo $tfile | sed -e 's/\.exe$//'`
- tname=`basename $tname`
-
- TEST_TYPE="single"
-
- case $tname in
- monitor)
- if [ $run_to_completion = "yes" ]
- then
- warn "Skipping $tname; it is interactive"
- continue
- fi
- ;;
- *-node2*)
- warn "Skipping $tname; 'runtest' runs both nodes when for *-node1"
- continue;;
- *-node1*)
- tname=`echo $tname | sed 's/-node.*//'`
- warn "Running both nodes associated with $tname"
- TEST_TYPE="mp"
- ;;
- stackchk*|spfatal*|malloctest*|termio*)
- warn "Skipping $tname; it locks up or takes a VERY long time to run"
- continue
- ;;
- esac
-
- if [ $TEST_TYPE = "mp" ]
- then
- logfile1=$logdir/${tname}_1
- infofile1=$logfile1.info
- logfile2=$logdir/${tname}_2
- infofile2=$logfile2.info
-
- rm -f ${logfile1}
- rm -f ${logfile2}
-
- date=`date`
- echo "Starting $tname at $date"
-
- ./${tname}-node1.exe > $logfile1 2>&1 &
- pid1=$!
- ./${tname}-node2.exe > $logfile2 2>&1 &
- pid2=$!
-
- # Wait for both cpu's to complete, ensuring they don't run forever...
- time_run=0
- while [ $time_run -lt $max_run_time ]
- do
- # sleep 5s at a time waiting for jobs to finish or timer to expire
- # if job has exited, then we exit, too.
- sleep 5
- kill -0 $pid1 2> /dev/null
- running1=$?
- kill -0 $pid2 2> /dev/null
- running2=$?
- if [ $running1 -eq 0 ] && [ $running2 -eq 0 ] # both still running
- then
- time_run=$((time_run + 5))
- if [ $time_run -ge $max_run_time ]
- then
- echo "$tname ran too long; killing it"
- ran_too_long="yes"
- fi
- else
- ran_too_long="no"
- # if one is still running, have to kill them
- if [ $running1 -ne $running2 ]
- then
- sleep 10 # give other node a chance to gracefully die
- fi
- break
- fi
- done
-
- # make sure they are gone
- kill -9 $pid1 2> /dev/null
- kill -9 $pid2 2> /dev/null
- fi
-
- if [ $TEST_TYPE = "single" ]
- then
- logfile=$logdir/$tname
- infofile=$logfile.info
-
- rm -f ${logfile}
-
- date=`date`
- echo "Starting $tname.exe at $date"
-
- ./$tname.exe > $logfile 2>&1 &
- pid=$!
-
- # Make sure it won't run forever...
- time_run=0
- while [ $time_run -lt $max_run_time ]
- do
- # sleep 5s at a time waiting for job to finish or timer to expire
- # if job has exited, then we exit, too.
- sleep 5
- kill -0 $pid 2> /dev/null
- running=$?
- if [ $running -eq 0 ]
- then
- time_run=$((time_run + 5))
- if [ $time_run -ge $max_run_time ]
- then
- kill -9 $pid 2> /dev/null
- ran_too_long="yes"
- fi
- else
- ran_too_long="no"
- break
- fi
- done
- fi
-
- pid=""
-
-done
-
-test_exit 0
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
-
diff --git a/c/src/lib/libbsp/unix/posix/tools/semdump.in b/c/src/lib/libbsp/unix/posix/tools/semdump.in
deleted file mode 100644
index 53710a629e..0000000000
--- a/c/src/lib/libbsp/unix/posix/tools/semdump.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#!@PERL@
-#
-# $Id$
-#
-eval "exec @PERL@ -S $0 $*"
- if $running_under_some_shell;
-
-# dump semaphore array values tony@divnc.com
-
-require 'sys/sem.ph';
-require 'getopts.pl';
-&Getopts("vhi:k:"); # verbose, help, id, key
-
-if ($opt_h || ($opt_i && $opt_k))
-{
- print STDERR <<NO_MORE_HELP;
-semdump
-
- Dump info about specified semaphore.
-
-Usage: $0 [-v] { -i semid | -k semkey }
-
- -v -- possibly more verbose
- -i semid -- semaphore id
- -k semkey -- semaphore key
- -h -- help
-
- anything else == this help message
-NO_MORE_HELP
- exit 1;
-}
-
-$verbose = $opt_v;
-$id = $opt_i;
-$key = $opt_k;
-
-if ($key)
-{
- $key = oct($key) if $key =~ /^0/;
- die "Could not convert key to id; $!" unless $id = semget($key, 1, 0);
-}
-
-# I don't know to find out how many sem's are attached to the id
-# so just keep reading them until we get an error.
-
-printf("KEY: 0x%X (%d) ", $key, $key) if $key;
-print "ID: $id\n";
-
-semlist:
-for ($semnum=0; $semnum < 10; $semnum++)
-{
- $val = semctl($id, $semnum, &GETVAL, 0);
- $val || ($val = -1);
-
- last semlist if ($val == -1);
-
- printf " %d: %d\n", $semnum, $val;
-}
-
diff --git a/c/src/lib/libbsp/unix/posix/tools/shmdump.in b/c/src/lib/libbsp/unix/posix/tools/shmdump.in
deleted file mode 100644
index fa965702ca..0000000000
--- a/c/src/lib/libbsp/unix/posix/tools/shmdump.in
+++ /dev/null
@@ -1,134 +0,0 @@
-#!@PERL@
-#
-# $Id$
-#
-eval "exec @PERL@ -S $0 $*"
- if $running_under_some_shell;
-
-# dump shared memory segment tony@divnc.com
-
-require 'sys/shm.ph';
-require 'getopts.pl';
-&Getopts("vhi:k:f:l:b:w"); # verbose, help, id, key, first, length, word, base
-
-if ($opt_h || ($opt_i && $opt_k))
-{
- print STDERR <<NO_MORE_HELP;
-shmdump
-
- Dump contents of specifed shared memory segment.
-
-Usage: $0 [options]
-
- -h -- help
- -v -- possibly more verbose
- -i shmid -- shm id
- -k shmkey -- shm key
- -f first -- start of partial dump
- -l length -- length of partial dump
- -w -- dump as 4byte words instead of bytes
- -b base -- use 'base' as base address for output
-
- anything else == this help message
-NO_MORE_HELP
- exit 1;
-}
-
-$verbose = $opt_v;
-$id = $opt_i;
-$key = $opt_k;
-$offset = $opt_f;
-$print_length = $opt_l;
-$base = $opt_b;
-$word_dump = $opt_w;
-
-if ($key)
-{
- # ensure key is an integer
- $key = oct($key) if $key =~ /^0/;
- die "Could not convert key to id; $!" unless $id = shmget($key, 1, 0);
-}
-
-# ensure integerhood in case of leading '0x'
-$base = oct($base) if $base =~ /^0/;
-$offset = oct($offset) if $offset =~ /^0/;
-$print_length = oct($print_length) if $print_length =~ /^0/;
-
-if ( ! shmctl($id, &IPC_STAT, $shmid_ds))
-{
- die "shmctl(2) for id $id failed -- (I was trying to get size): $!";
-}
-
-# Pick the length out.
-# It is at byte offset 0x30 on hpux9 and probably hpux10
-# Also get the key if we don't have it already. Don't need it tho...
-$length = unpack("I", substr($shmid_ds, 0x30, 4));
-$key = unpack("I", substr($shmid_ds, 0x14, 4)) if ! $key;
-
-# poke around looking for length and key
-# print "I guess: length: $length, key: $key\n";
-# print "****$shmid_ds****\n"; die "";
-
-# make sure offset and print length make sense
-$print_length = $length if ! $print_length;
-if (($offset + $print_length) > $length)
-{
- die "offset ($offset) and length ($print_length) go beyond end of segment ($length bytes)";
-}
-
-printf("KEY: 0x%X (%d) ", $key, $key) if ($key);
-printf "ID: $id\n";
-printf " %d bytes (0x%X), %d words, logical base is 0x%X\n",
- $length, $length, $length / 4, $base;
-if ($offset || ($print_length != $length))
-{
- printf " printing %X (%d) bytes starting at offset 0x%X (%d)\n",
- $print_length, $print_length, $offset, $offset;
-}
-printf "\n";
-
-if ( ! shmread($id, $shm_data, $offset, $print_length))
-{
- die "could not attach and read from shmid $id: $!";
-}
-
-# the dump code below derived from "Real Perl Programs" example "xdump"
-# from Camel book
-
-$base += $offset;
-$offset = 0;
-for ($len = $print_length; $len >= 16; )
-{
- $data = substr($shm_data, $offset, 16);
-
- @array = unpack('N4', $data);
- $data =~ tr/\0-\37\177-\377/./;
- printf "%8.8lX %8.8lX %8.8lX %8.8lX %8.8lX |%s|\n",
- $base, @array, $data;
-
- $offset += 16;
- $base += 16;
- $len -= 16;
-}
-
-# Now finish up the end a byte at a time
-
-if ($len)
-{
- $data = substr($shm_data, $offset, $len);
- @array = unpack('C*', $data);
- for (@array)
- {
- $_ = sprintf('%2.2X', $_);
- }
-
- push(@array, ' ') while $len++ < 16;
-
- $data =~ tr/\0-\37\177-\377/./;
- $data =~ s/[^ -~]/./g;
-
- printf "%8.8lX ", $base;
- printf "%s%s%s%s %s%s%s%s %s%s%s%s %s%s%s%s |%-16s|\n",
- @array, $data;
-}
-
diff --git a/c/src/lib/libbsp/unix/posix/wrapup/Makefile.in b/c/src/lib/libbsp/unix/posix/wrapup/Makefile.in
deleted file mode 100644
index f2e05eeff6..0000000000
--- a/c/src/lib/libbsp/unix/posix/wrapup/Makefile.in
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# MP_XXX_PARTS are the pieces of the BSP required in a MP environment
-# We only build them if HAS_MP was defined
-
-MP_BSP_PARTS_yes_V = shmsupp
-MP_BSP_PARTS = $(MP_BSP_PARTS_$(HAS_MP)_V)
-
-MP_GENERIC_PARTS_yes_V = shmdr
-MP_GENERIC_PARTS = $(MP_GENERIC_PARTS_$(HAS_MP)_V)
-
-
-
-BSP_PIECES=startup clock console $(MP_BSP_PARTS) timer
-# pieces to pick up out of libcpu/unix
-CPU_PIECES=
-GENERIC_PIECES=$(MP_GENERIC_PARTS)
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(CPU_PIECES), \
- ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(piece).rel) \
- $(foreach piece, $(GENERIC_PIECES), \
- ../../../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libbsp.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libc/Makefile.in b/c/src/lib/libc/Makefile.in
deleted file mode 100644
index c9fbf72795..0000000000
--- a/c/src/lib/libc/Makefile.in
+++ /dev/null
@@ -1,73 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=libcsupport.a
-LIB=${ARCH}/${LIBNAME}
-
-# define TARGET_PIECES later based on RTEMS_CPU definition
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES=__times _execve malloc syscalls \
- no_libc support libio hosterr tcattr tcdrain \
- cfiospeed termios $(TARGET_PIECES)
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/libcsupport.h
-SYS_H_FILES=
-RTEMS_H_FILES=$(srcdir)/libio.h
-PRIVATE_H_FILES=$(srcdir)/internal.h
-
-INSTALLED_H_FILES=$(srcdir)/libio.h $(srcdir)/libcsupport.h
-SRCS=$(C_FILES) $(H_FILES) $(SYS_H_FILES) $(RTEMS_H_FILES) $(PRIVATE_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-ifeq ($(RTEMS_CPU),unix)
-TARGET_PIECES=unixlibc
-else
-TARGET_PIECES=__brk __gettod newlibc newlibif newlibifr \
- getdents readdir opendir closedir rewinddir scandir seekdir telldir
-endif
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(LIBC_DEFINES)
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} preinstall $(LIB)
- $(INSTALL_VARIANT) -m 644 ${LIB} ${PROJECT_RELEASE}/lib
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
-
-# Install the library, appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-preinstall:
- $(INSTALL) -m 444 ${RTEMS_H_FILES} $(PROJECT_INCLUDE)/rtems
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(SYS_H_FILES) $(PROJECT_INCLUDE)/sys
-
-
diff --git a/c/src/lib/libc/README b/c/src/lib/libc/README
deleted file mode 100644
index ee7a90501e..0000000000
--- a/c/src/lib/libc/README
+++ /dev/null
@@ -1,37 +0,0 @@
---
--- $Id$
---
-
-Overview of newlib support (newlib is from CYGNUS)
- Each task can have its own libc state including:
- open stdio files
- strtok
- multi precision arithmetic state
- etc.
-
- This is implemented by a reentrancy data structure for each task.
-
- When a task is "started" (in RTEMS sense) the reentrancy structure
- is allocated. Its address is stored in notepad[NOTEPAD_LAST].
-
- When task is switched to, the value of global variable _impure_ptr
- is changed to the value of the new tasks reentrancy structure.
-
- When a task is deleted
- atexit() processing (for that task) happens
- task's stdio buffers are flushed
-
- When exit(3) is called
- calling task's atexit processing done
- global libc state atexit processing done
- (this will include any atexit routines installed by drivers)
- executive is shutdown
- causes a context switch back to bsp land
-
-
-NOTE:
- libc extension are installed by bsp_libc_init()
- iff we are using clock interrupts.
- This hack is necessary to allow the tmtests to avoid
- timing the extensions.
-
diff --git a/c/src/lib/libc/__brk.c b/c/src/lib/libc/__brk.c
deleted file mode 100644
index 4dab22c729..0000000000
--- a/c/src/lib/libc/__brk.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#if !defined(RTEMS_UNIX)
-
-/*
- * RTEMS "Broken" __brk/__sbrk Implementation
- *
- * NOTE: sbrk is BSP provided.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#include <signal.h>
-#include <errno.h>
-#include <sys/types.h>
-#ifdef RTEMS_NEWLIB
-#include <reent.h>
-#endif
-#include <unistd.h>
-
-/* we use RTEMS for memory management. We don't need sbrk */
-
-void * __sbrk(int incr)
-{
- errno = EINVAL;
- return (void *)0;
-}
-
-int __brk( const void *endds )
-{
- errno = EINVAL;
- return -1;
-}
-
-#endif
diff --git a/c/src/lib/libc/__gettod.c b/c/src/lib/libc/__gettod.c
deleted file mode 100644
index dc83c47ce4..0000000000
--- a/c/src/lib/libc/__gettod.c
+++ /dev/null
@@ -1,118 +0,0 @@
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-
-#include <rtems.h>
-
-#if !defined(RTEMS_UNIX)
-/*
- * RTEMS gettimeofday Implementation
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#ifdef RTEMS_NEWLIB
-#include <sys/reent.h>
-#endif
-
-#include <sys/time.h>
-#include <time.h>
-
-#include <errno.h>
-#include <assert.h>
-
-/*
- * Seconds from January 1, 1970 to January 1, 1988. Used to account for
- * differences between POSIX API and RTEMS core.
- */
-
-#define POSIX_TIME_SECONDS_1970_THROUGH_1988 \
- (((1987 - 1970 + 1) * TOD_SECONDS_PER_NON_LEAP_YEAR) + \
- (4 * TOD_SECONDS_PER_DAY))
-
-/*
- * NOTE: The solaris gettimeofday does not have a second parameter.
- */
-
-int gettimeofday(
- struct timeval *tp,
- struct timezone *tzp
-)
-{
- rtems_interrupt_level level;
- rtems_unsigned32 seconds;
- rtems_unsigned32 microseconds;
-
- if ( !tp ) {
- errno = EFAULT;
- return -1;
- }
-
- /*
- * POSIX does not seem to allow for not having a TOD so we just
- * grab the time of day.
- *
- * NOTE: XXX this routine should really be in the executive proper.
- */
-
- rtems_interrupt_disable(level);
- seconds = _TOD_Seconds_since_epoch;
- microseconds = _TOD_Current.ticks;
- rtems_interrupt_enable(level);
-
- tp->tv_sec = seconds + POSIX_TIME_SECONDS_1970_THROUGH_1988;
- tp->tv_usec = microseconds * _TOD_Microseconds_per_tick;
-
- /*
- * newlib does not have timezone and daylight savings time
- * yet. When it does this needs to be fixed.
- */
-
-#if 0
- if ( tzp ) {
- tzp->tz_minuteswest = 0; /* at UTC */
- tzp->tz_dsttime = 0; /* no daylight savings */
- tzp->minuteswest = timezone / 60; /* from seconds to minutes */
- tzp->dsttime = daylight;
- }
-#endif
- return 0;
-}
-
-#if defined(RTEMS_NEWLIB)
-
-/*
- * "Reentrant" version
- */
-
-int _gettimeofday_r(
- struct _reent *ignored_reentrancy_stuff,
- struct timeval *tp,
- struct timezone *tzp
-)
-{
- return gettimeofday( tp, tzp );
-}
-
-/*
- * "System call" version
- */
-
-int _gettimeofday(
- struct timeval *tp,
- struct timezone *tzp
-)
-{
- return gettimeofday( tp, tzp );
-}
-
-#endif /* defined(RTEMS_NEWLIB) */
-
-#endif
diff --git a/c/src/lib/libc/__times.c b/c/src/lib/libc/__times.c
deleted file mode 100644
index 635bf8e062..0000000000
--- a/c/src/lib/libc/__times.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * RTEMS _times Implementation
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#include <sys/times.h>
-#include <time.h>
-#include <sys/time.h>
-#include <errno.h>
-#include <assert.h>
-
-clock_t _times(
- struct tms *ptms
-)
-{
- rtems_status_code status;
- rtems_interval ticks_since_boot;
-
- if ( !ptms ) {
- errno = EFAULT;
- return -1;
- }
-
- /* "POSIX" does not seem to allow for not having a TOD */
- status = rtems_clock_get(
- RTEMS_CLOCK_GET_TICKS_SINCE_BOOT,
- &ticks_since_boot
- );
- if ( status != RTEMS_SUCCESSFUL ) {
- assert( 0 );
- return -1;
- }
-
- /*
- * RTEMS has no notion of system versus user time and does
- * not (as of 3.2.0) keep track of CPU usage on a per task basis.
- */
-
- ptms->tms_utime = ticks_since_boot;
- ptms->tms_stime = 0;
- ptms->tms_cutime = 0;
- ptms->tms_cstime = 0;
-
- return 0;
-}
-
-clock_t times(
- struct tms *ptms
-)
-{
- return _times( ptms );
-}
-
-#if defined(RTEMS_NEWLIB)
-clock_t _times_r(
- struct _reent *ptr,
- struct tms *ptms
-)
-{
- return _times(ptms);
-}
-#endif
diff --git a/c/src/lib/libc/_execve.c b/c/src/lib/libc/_execve.c
deleted file mode 100644
index d1ad365b57..0000000000
--- a/c/src/lib/libc/_execve.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <rtems.h>
-
-#if defined(RTEMS_NEWLIB)
-/*
- * RTEMS Dummy _execveImplementation
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <unistd.h>
-#include <errno.h>
-
-int _execve(
- const char *path,
- char *const argv[],
- char *const environ[]
-)
-{
- errno = ENOSYS;
- return -1;
-}
-#endif
diff --git a/c/src/lib/libc/assoc.c b/c/src/lib/libc/assoc.c
deleted file mode 100644
index 74387a8c5b..0000000000
--- a/c/src/lib/libc/assoc.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * assoc.c
- * rtems assoc routines
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include "assoc.h"
-
-#include <stdio.h> /* sprintf */
-#include <string.h> /* strcat, strcmp */
-
-#define STREQ(a,b) (strcmp((a), (b)) == 0)
-#define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME))
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (strcmp(ap->name, name) == 0)
- return ap;
-
- return default_ap;
-}
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (ap->local_value == local_value)
- return ap;
-
- return default_ap;
-}
-
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (ap->remote_value == remote_value)
- return ap;
-
- return default_ap;
-}
-
-
-/*
- * Get values
- */
-
-unsigned32
-rtems_assoc_remote_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_local(ap, local_value);
- if (nap)
- return nap->remote_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_local_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_remote(ap, remote_value);
- if (nap)
- return nap->local_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_remote_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_name(ap, name);
- if (nap)
- return nap->remote_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_local_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_name(ap, name);
- if (nap)
- return nap->local_value;
-
- return 0;
-}
-
-/*
- * what to return if a value is not found
- * this is not reentrant, but it really shouldn't be invoked anyway
- */
-
-const char *
-rtems_assoc_name_bad(
- unsigned32 bad_value
-)
-{
-#ifdef RTEMS_DEBUG
- static char bad_buffer[32];
-
- sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
-#else
- static char bad_buffer[32] = "<assoc.c: BAD NAME>";
-#endif
- return bad_buffer;
-}
-
-
-const char *
-rtems_assoc_name_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_local(ap, local_value);
- if (nap)
- return nap->name;
-
- return rtems_assoc_name_bad(local_value);
-}
-
-const char *
-rtems_assoc_name_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_remote(ap, remote_value);
- if (nap)
- return nap->name;
-
- return rtems_assoc_name_bad(remote_value);
-}
-
-/*
- * Bitfield functions assume just 1 bit set in each of remote and local
- * entries; they do not check for this.
- */
-
-unsigned32 rtems_assoc_remote_by_local_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- unsigned32 b;
- unsigned32 remote_value = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & local_value)
- remote_value |= rtems_assoc_remote_by_local(ap, b);
-
- return remote_value;
-}
-
-
-unsigned32 rtems_assoc_local_by_remote_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- unsigned32 b;
- unsigned32 local_value = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & remote_value)
- local_value |= rtems_assoc_local_by_remote(ap, b);
-
- return local_value;
-}
-
-char *
-rtems_assoc_name_by_remote_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 value,
- char *buffer
- )
-{
- unsigned32 b;
-
- *buffer = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (*buffer)
- strcat(buffer, " ");
- strcat(buffer, rtems_assoc_name_by_remote(ap, b));
- }
-
- return buffer;
-}
-
-char *
-rtems_assoc_name_by_local_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 value,
- char *buffer
- )
-{
- unsigned32 b;
-
- *buffer = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (*buffer)
- strcat(buffer, " ");
- strcat(buffer, rtems_assoc_name_by_local(ap, b));
- }
-
- return buffer;
-}
diff --git a/c/src/lib/libc/assoc.h b/c/src/lib/libc/assoc.h
deleted file mode 100644
index 1982d654ac..0000000000
--- a/c/src/lib/libc/assoc.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Rtems associativity routines. Mainly used to convert a value from
- * one space to another (eg: our errno's to host errno's and v.v)
- *
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_ASSOC_H
-#define _INCLUDE_ASSOC_H
-
-typedef struct {
- const char *name;
- unsigned32 local_value;
- unsigned32 remote_value;
-} rtems_assoc_t;
-
-/*
- * Flag/marker for optional default value in each table
- */
-
-#define RTEMS_ASSOC_DEFAULT_NAME "(default)"
-
-const rtems_assoc_t *rtems_assoc_ptr_by_name(const rtems_assoc_t *, const char *);
-const rtems_assoc_t *rtems_assoc_ptr_by_value(const rtems_assoc_t *, unsigned32);
-const rtems_assoc_t *rtems_assoc_ptr_by_remote(const rtems_assoc_t *, unsigned32);
-
-unsigned32 rtems_assoc_remote_by_local(const rtems_assoc_t *, unsigned32);
-unsigned32 rtems_assoc_local_by_remote(const rtems_assoc_t *, unsigned32);
-unsigned32 rtems_assoc_remote_by_name(const rtems_assoc_t *, const char *);
-unsigned32 rtems_assoc_local_by_name(const rtems_assoc_t *, const char *);
-const char *rtems_assoc_name_by_local(const rtems_assoc_t *, unsigned32);
-const char *rtems_assoc_name_by_remote(const rtems_assoc_t *, unsigned32);
-
-unsigned32 rtems_assoc_remote_by_local_bitfield(const rtems_assoc_t *, unsigned32);
-char *rtems_assoc_name_by_local_bitfield(const rtems_assoc_t *, unsigned32, char *);
-char *rtems_assoc_name_by_remote_bitfield(const rtems_assoc_t *, unsigned32, char *);
-unsigned32 rtems_assoc_local_by_remote_bitfield(const rtems_assoc_t *, unsigned32);
-
-
-#endif /* ! _INCLUDE_ASSOC_H */
diff --git a/c/src/lib/libc/cfiospeed.c b/c/src/lib/libc/cfiospeed.c
deleted file mode 100644
index c2f40d3892..0000000000
--- a/c/src/lib/libc/cfiospeed.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This file contains the RTEMS implementation of the POSIX API
- * routines cfgetispeed, cfgetospeed, cfsetispeed and cfsetospeed.
- *
- * $Id$
- *
- */
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-
-#include "internal.h"
-#include "libio.h"
-
-speed_t
-cfgetospeed(const struct termios *tp)
-{
- return tp->c_cflag & CBAUD;
-}
-
-int
-cfsetospeed(struct termios *tp, speed_t speed)
-{
- if (speed & ~CBAUD) {
- errno = EINVAL;
- return -1;
- }
- tp->c_cflag = (tp->c_cflag & ~CBAUD) | speed;
- return 0;
-}
-
-speed_t
-cfgetispeed(const struct termios *tp)
-{
- return (tp->c_cflag / (CIBAUD / CBAUD)) & CBAUD;
-}
-
-int
-cfsetispeed(struct termios *tp, speed_t speed)
-{
- if (speed & ~CBAUD) {
- errno = EINVAL;
- return -1;
- }
- tp->c_cflag = (tp->c_cflag & ~CIBAUD) | (speed * (CIBAUD / CBAUD));
- return 0;
-}
-
-#endif
diff --git a/c/src/lib/libc/closedir.c b/c/src/lib/libc/closedir.c
deleted file mode 100644
index 5edb3499e6..0000000000
--- a/c/src/lib/libc/closedir.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * closedir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-
-#include <sys/types.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-
-int closedir(
- register DIR *dirp
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/lib/libc/error.c b/c/src/lib/libc/error.c
deleted file mode 100644
index dd32fb8b66..0000000000
--- a/c/src/lib/libc/error.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * report errors and panics to RTEMS' stderr.
- * Currently just used by RTEMS monitor.
- *
- * $Id$
- */
-
-
-/*
- * These routines provide general purpose error reporting.
- * rtems_error reports an error to stderr and allows use of
- * printf style formatting. A newline is appended to all messages.
- *
- * error_flag can be specified as any of the following:
- *
- * RTEMS_ERROR_ERRNO -- include errno text in output
- * RTEMS_ERROR_PANIC -- halts local system after output
- * RTEMS_ERROR_ABORT -- abort after output
- *
- * It can also include a rtems_status value which can be OR'd
- * with the above flags. *
- *
- * EXAMPLE
- * #include <rtems.h>
- * #include <rtems/error.h>
- * rtems_error(0, "stray interrupt %d", intr);
- *
- * EXAMPLE
- * if ((status = rtems_task_create(...)) != RTEMS_SUCCCESSFUL)
- * {
- * rtems_error(status | RTEMS_ERROR_ABORT,
- * "could not create task");
- * }
- *
- * EXAMPLE
- * if ((fd = open(pathname, O_RDNLY)) < 0)
- * {
- * rtems_error(RTEMS_ERROR_ERRNO, "open of '%s' failed", pathname);
- * goto failed;
- * }
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-
-#include "error.h"
-#include <rtems/assoc.h>
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h> /* _exit() */
-
-/* bug in hpux <errno.h>: no prototypes unless you are C++ */
-#ifdef hpux9
-char *strerror(int);
-#endif
-
-extern char *rtems_progname;
-int rtems_panic_in_progress;
-
-rtems_assoc_t rtems_status_assoc[] = {
- { "successful completion", RTEMS_SUCCESSFUL, },
- { "returned from a thread", RTEMS_TASK_EXITTED, },
- { "multiprocessing not configured", RTEMS_MP_NOT_CONFIGURED, },
- { "invalid object name", RTEMS_INVALID_NAME, },
- { "invalid object id", RTEMS_INVALID_ID, },
- { "too many", RTEMS_TOO_MANY, },
- { "timed out waiting", RTEMS_TIMEOUT, },
- { "object deleted while waiting", RTEMS_OBJECT_WAS_DELETED, },
- { "specified size was invalid", RTEMS_INVALID_SIZE, },
- { "address specified is invalid", RTEMS_INVALID_ADDRESS, },
- { "number was invalid", RTEMS_INVALID_NUMBER, },
- { "item has not been initialized", RTEMS_NOT_DEFINED, },
- { "resources still outstanding", RTEMS_RESOURCE_IN_USE, },
- { "request not satisfied", RTEMS_UNSATISFIED, },
- { "thread is in wrong state", RTEMS_INCORRECT_STATE, },
- { "thread already in state", RTEMS_ALREADY_SUSPENDED, },
- { "illegal on calling thread", RTEMS_ILLEGAL_ON_SELF, },
- { "illegal for remote object", RTEMS_ILLEGAL_ON_REMOTE_OBJECT, },
- { "called from wrong environment", RTEMS_CALLED_FROM_ISR, },
- { "invalid thread priority", RTEMS_INVALID_PRIORITY, },
- { "invalid date/time", RTEMS_INVALID_CLOCK, },
- { "invalid node id", RTEMS_INVALID_NODE, },
- { "directive not configured", RTEMS_NOT_CONFIGURED, },
- { "not owner of resource", RTEMS_NOT_OWNER_OF_RESOURCE , },
- { "directive not implemented", RTEMS_NOT_IMPLEMENTED, },
- { "RTEMS inconsistency detected", RTEMS_INTERNAL_ERROR, },
- { "could not get enough memory", RTEMS_NO_MEMORY, },
- { "internal multiprocessing only", THREAD_STATUS_PROXY_BLOCKING, },
- { 0, 0, 0 },
-};
-
-
-const char *
-rtems_status_text(
- rtems_status_code status
-)
-{
- return rtems_assoc_name_by_local(rtems_status_assoc, status);
-}
-
-
-static int rtems_verror(
- unsigned32 error_flag,
- const char *printf_format,
- va_list arglist
-)
-{
- int local_errno = 0;
- int chars_written = 0;
- rtems_status_code status;
-
- if (error_flag & RTEMS_ERROR_PANIC)
- {
- if (rtems_panic_in_progress++)
- _Thread_Disable_dispatch(); /* disable task switches */
-
- /* don't aggravate things */
- if (rtems_panic_in_progress > 2)
- return 0;
- }
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- status = error_flag & ~RTEMS_ERROR_MASK;
- if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
- local_errno = errno;
-
- if (_System_state_Is_multiprocessing)
- fprintf(stderr, "[%d] ", _Configuration_MP_table->node);
-
- if (rtems_progname && *rtems_progname)
- chars_written += fprintf(stderr, "%s: ", rtems_progname);
- chars_written += vfprintf(stderr, printf_format, arglist);
-
- if (status)
- chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status));
-
- if (local_errno)
- {
- if ((local_errno > 0) && *strerror(local_errno))
- chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
- else
- chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
- }
-
- chars_written += fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (RTEMS_ERROR_PANIC | RTEMS_ERROR_ABORT))
- {
- if (error_flag & RTEMS_ERROR_PANIC)
- {
- rtems_error(0, "fatal error, exiting");
- _exit(local_errno);
- }
- else
- {
- rtems_error(0, "fatal error, aborting");
- abort();
- }
- }
- return chars_written;
-}
-
-
-/*
- * Report an error.
- * error_flag is as above; printf_format is a normal
- * printf(3) format string, with its concommitant arguments.
- *
- * Returns the number of characters written.
- */
-
-int rtems_error(
- int error_flag,
- const char *printf_format,
- ...
- )
-{
- va_list arglist;
- int chars_written;
-
- va_start(arglist, printf_format);
- chars_written = rtems_verror(error_flag, printf_format, arglist);
- va_end(arglist);
-
- return chars_written;
-}
-
-/*
- * rtems_panic is shorthand for rtems_error(RTEMS_ERROR_PANIC, ...)
- */
-
-void rtems_panic(
- const char *printf_format,
- ...
- )
-{
- va_list arglist;
-
- va_start(arglist, printf_format);
- (void) rtems_verror(RTEMS_ERROR_PANIC, printf_format, arglist);
- va_end(arglist);
-}
diff --git a/c/src/lib/libc/error.h b/c/src/lib/libc/error.h
deleted file mode 100644
index a0698afb5d..0000000000
--- a/c/src/lib/libc/error.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Defines and externs for rtems error reporting
- *
- * $Id$
- */
-
-#ifndef __RTEMS_ERROR_h
-#define __RTEMS_ERROR_h
-
-/*
- * rtems_error() and rtems_panic() support
- */
-
-#define RTEMS_ERROR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define RTEMS_ERROR_PANIC (RTEMS_ERROR_ERRNO / 2) /* err fatal; no return */
-#define RTEMS_ERROR_ABORT (RTEMS_ERROR_ERRNO / 4) /* err is fatal; panic */
-
-#define RTEMS_ERROR_MASK (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | \
- RTEMS_ERROR_PANIC) /* all */
-
-const char *rtems_status_text(rtems_status_code);
-int rtems_error(int error_code, const char *printf_format, ...);
-#ifdef __GNUC__
-void rtems_panic(const char *printf_format, ...);
-/*
- * We should be able to use this attribute but gcc complains that
- * rtems_panic does in fact return. :(
- *
- * __attribute__ ((__noreturn__));
- */
-#else
-void rtems_panic(const char *printf_format, ...);
-#endif
-
-extern int rtems_panic_in_progress;
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libc/getdents.c b/c/src/lib/libc/getdents.c
deleted file mode 100644
index 9b16d82409..0000000000
--- a/c/src/lib/libc/getdents.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Just enough to make newlib return an error.
- *
- * $Id$
- */
-
-int getdents(
- int fd,
- void *buf,
- int len
-)
-{
- return -1;
-}
diff --git a/c/src/lib/libc/hosterr.c b/c/src/lib/libc/hosterr.c
deleted file mode 100644
index a55e4a7e84..0000000000
--- a/c/src/lib/libc/hosterr.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Routines to access a host errno
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <errno.h>
-
-int host_errno(void);
-
-/*
- * copy host errno, if any to thread aware errno, if any
- */
-
-void fix_syscall_errno(void)
-{
- errno = host_errno();
-}
-
-/*
- * Get the host system errno, if any
- * When using newlib (or possibly other libc's) on top of UNIX
- * the errno returned by system calls may be unavailable due
- * to trickery of making errno thread aware.
- * This provides a kludge of getting at it.
- */
-
-#undef errno
-extern int errno;
-int host_errno(void)
-{
- return errno;
-}
-
diff --git a/c/src/lib/libc/internal.h b/c/src/lib/libc/internal.h
deleted file mode 100644
index 75b9f29633..0000000000
--- a/c/src/lib/libc/internal.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* internal.h
- *
- * This include file contains internal information
- * for the RTEMS C library support which is needed across
- * files.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INTERNAL_LIBC_h
-#define __INTERNAL_LIBC_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void MY_task_set_note(
- rtems_tcb *tcb,
- rtems_unsigned32 notepad,
- rtems_unsigned32 note
-);
-
-rtems_unsigned32 MY_task_get_note(
- rtems_tcb *tcb,
- rtems_unsigned32 notepad
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libc/libcsupport.h b/c/src/lib/libc/libcsupport.h
deleted file mode 100644
index d007784526..0000000000
--- a/c/src/lib/libc/libcsupport.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* libcsupport.h
- *
- * This include file contains the information regarding the
- * RTEMS specific support for the standard C library.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __LIBC_SUPPORT_h
-#define __LIBC_SUPPORT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <sys/types.h>
-
-void RTEMS_Malloc_Initialize(
- void *start,
- size_t length,
- size_t sbrk_amount
-);
-
-extern void malloc_dump(void);
-extern void malloc_walk(size_t source, size_t printf_enabled);
-extern void libc_init(int reentrant);
-extern int host_errno(void);
-extern void fix_syscall_errno(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libc/libio.c b/c/src/lib/libc/libio.c
deleted file mode 100644
index 12682c1190..0000000000
--- a/c/src/lib/libc/libio.c
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
- * Provide UNIX/POSIX-like io system calls for RTEMS using the
- * RTEMS IO manager
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/assoc.h> /* assoc.h not included by rtems.h */
-
-#include <stdio.h> /* O_RDONLY, et.al. */
-#include <fcntl.h> /* O_RDONLY, et.al. */
-#include <assert.h>
-
-#if ! defined(O_NDELAY)
-# if defined(solaris2)
-# define O_NDELAY O_NONBLOCK
-# elif defined(RTEMS_NEWLIB)
-# define O_NDELAY _FNBIO
-# endif
-#endif
-
-
-#include <errno.h>
-#include <string.h> /* strcmp */
-#include <unistd.h>
-#include <stdlib.h> /* calloc() */
-
-#include "libio.h" /* libio.h not pulled in by rtems */
-
-/*
- * Semaphore to protect the io table
- */
-
-Objects_Id rtems_libio_semaphore;
-
-#define RTEMS_LIBIO_SEM rtems_build_name('L', 'B', 'I', 'O')
-#define RTEMS_LIBIO_IOP_SEM(n) rtems_build_name('L', 'B', 'I', n)
-
-extern unsigned32 rtems_libio_number_iops;
-rtems_libio_t *rtems_libio_iops;
-rtems_libio_t *rtems_libio_last_iop;
-
-#define rtems_libio_iop(fd) ((((unsigned32)(fd)) < rtems_libio_number_iops) ? \
- &rtems_libio_iops[fd] : 0)
-
-#define rtems_libio_check_fd(fd) \
- do { \
- if ((unsigned32) (fd) >= rtems_libio_number_iops) \
- { \
- errno = EBADF; \
- return -1; \
- } \
- } while (0)
-
-#define rtems_libio_check_buffer(buffer) \
- do { \
- if ((buffer) == 0) \
- { \
- errno = EINVAL; \
- return -1; \
- } \
- } while (0)
-
-#define rtems_libio_check_count(count) \
- do { \
- if ((count) == 0) \
- { \
- return 0; \
- } \
- } while (0)
-
-#define rtems_libio_check_permissions(iop, flag) \
- do { \
- if (((iop)->flags & (flag)) == 0) \
- { \
- errno = EINVAL; \
- return -1; \
- } \
- } while (0)
-
-/*
- * External I/O handlers
- *
- * Space for all possible handlers is preallocated
- * to speed up dispatch to external handlers.
- */
-
-static rtems_libio_handler_t handlers[15];
-
-void
-rtems_register_libio_handler(
- int handler_flag,
- const rtems_libio_handler_t *handler
-)
-{
- int handler_index = rtems_file_descriptor_type_index(handler_flag);
-
- if ((handler_index < 0) || (handler_index >= 15))
- rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER );
- handlers[handler_index] = *handler;
-}
-
-/*
- * Called by bsp startup code to init the libio area.
- */
-
-void
-rtems_libio_init(void)
-{
- rtems_status_code rc;
-
- if (rtems_libio_number_iops > 0)
- {
- rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops,
- sizeof(rtems_libio_t));
- if (rtems_libio_iops == NULL)
- rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
-
- rtems_libio_last_iop = rtems_libio_iops + (rtems_libio_number_iops - 1);
- }
-
- rc = rtems_semaphore_create(
- RTEMS_LIBIO_SEM,
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &rtems_libio_semaphore
- );
- if (rc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(rc);
-}
-
-/*
- * Convert RTEMS status to a UNIX errno
- */
-
-rtems_assoc_t errno_assoc[] = {
- { "OK", RTEMS_SUCCESSFUL, 0 },
- { "BUSY", RTEMS_RESOURCE_IN_USE, EBUSY },
- { "INVALID NAME", RTEMS_INVALID_NAME, EINVAL },
- { "NOT IMPLEMENTED", RTEMS_NOT_IMPLEMENTED, ENOSYS },
- { "TIMEOUT", RTEMS_TIMEOUT, ETIMEDOUT },
- { "NO MEMORY", RTEMS_NO_MEMORY, ENOMEM },
- { "NO DEVICE", RTEMS_UNSATISFIED, ENODEV },
- { "INVALID NUMBER", RTEMS_INVALID_NUMBER, EBADF},
- { "NOT RESOURCE OWNER", RTEMS_NOT_OWNER_OF_RESOURCE, EPERM},
- { "IO ERROR", RTEMS_IO_ERROR, EIO},
- { 0, 0, 0 },
-};
-
-static unsigned32
-rtems_libio_errno(rtems_status_code code)
-{
- int rc;
-
- if ((rc = rtems_assoc_remote_by_local(errno_assoc, (unsigned32) code)))
- {
- errno = rc;
- return -1;
- }
- return -1;
-}
-
-/*
- * Convert UNIX fnctl(2) flags to ones that RTEMS drivers understand
- */
-
-rtems_assoc_t access_modes_assoc[] = {
- { "READ", LIBIO_FLAGS_READ, O_RDONLY },
- { "WRITE", LIBIO_FLAGS_WRITE, O_WRONLY },
- { "READ/WRITE", LIBIO_FLAGS_READ_WRITE, O_RDWR },
- { 0, 0, 0 },
-};
-
-rtems_assoc_t status_flags_assoc[] = {
- { "NO DELAY", LIBIO_FLAGS_NO_DELAY, O_NDELAY },
- { "APPEND", LIBIO_FLAGS_APPEND, O_APPEND },
- { "CREATE", LIBIO_FLAGS_CREATE, O_CREAT },
- { 0, 0, 0 },
-};
-
-static unsigned32
-rtems_libio_fcntl_flags(unsigned32 fcntl_flags)
-{
- unsigned32 flags = 0;
- unsigned32 access_modes;
-
- /*
- * Access mode is a small integer
- */
-
- access_modes = fcntl_flags & O_ACCMODE;
- fcntl_flags &= ~O_ACCMODE;
- flags = rtems_assoc_local_by_remote(access_modes_assoc, access_modes);
-
- /*
- * Everything else is single bits
- */
-
- flags |= rtems_assoc_local_by_remote_bitfield(status_flags_assoc, fcntl_flags);
- return flags;
-}
-
-
-static rtems_libio_t *
-rtems_libio_allocate(void)
-{
- rtems_libio_t *iop;
- rtems_status_code rc;
-
- rtems_semaphore_obtain(rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-
- for (iop = rtems_libio_iops; iop <= rtems_libio_last_iop; iop++)
- if ((iop->flags & LIBIO_FLAGS_OPEN) == 0)
- {
- /*
- * Got one; create a semaphore for it
- */
-
- rc = rtems_semaphore_create(
- RTEMS_LIBIO_IOP_SEM(iop - rtems_libio_iops),
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &iop->sem
- );
- if (rc != RTEMS_SUCCESSFUL)
- goto failed;
-
- iop->flags = LIBIO_FLAGS_OPEN;
- goto done;
- }
-
-failed:
- iop = 0;
-
-done:
- rtems_semaphore_release(rtems_libio_semaphore);
- return iop;
-}
-
-static void
-rtems_libio_free(rtems_libio_t *iop)
-{
- rtems_semaphore_obtain(rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-
- if (iop->sem)
- rtems_semaphore_delete(iop->sem);
- (void) memset(iop, 0, sizeof(*iop));
-
- rtems_semaphore_release(rtems_libio_semaphore);
-}
-
-int
-__rtems_open(
- const char *pathname,
- unsigned32 flag,
- unsigned32 mode)
-{
- rtems_status_code rc;
- rtems_libio_t *iop = 0;
- rtems_driver_name_t *np;
- rtems_libio_open_close_args_t args;
-
- /*
- * Additional external I/O handlers would be supported by
- * adding code to pick apart the pathname appropriately.
- * The networking code does not require changes here since
- * network file descriptors are obtained using socket(), not
- * open().
- */
-
- if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL)
- goto done;
-
- iop = rtems_libio_allocate();
- if (iop == 0)
- {
- rc = RTEMS_TOO_MANY;
- goto done;
- }
-
- iop->driver = np;
- iop->pathname = (char *) pathname;
- iop->flags |= rtems_libio_fcntl_flags(flag);
-
- args.iop = iop;
- args.flags = iop->flags;
- args.mode = mode;
-
- rc = rtems_io_open(np->major, np->minor, (void *) &args);
-
-done:
-
- if (rc != RTEMS_SUCCESSFUL)
- {
- if (iop)
- rtems_libio_free(iop);
- return rtems_libio_errno(rc);
- }
-
- return iop - rtems_libio_iops;
-}
-
-int
-__rtems_close(
- int fd
- )
-{
- rtems_status_code rc;
- rtems_driver_name_t *np;
- rtems_libio_t *iop;
- rtems_libio_open_close_args_t args;
- int status;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].close;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- status = (*fp)(fd);
- return status;
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
-
- np = iop->driver;
-
- args.iop = iop;
- args.flags = 0;
- args.mode = 0;
-
- rc = rtems_io_close(np->major, np->minor, (void *) &args);
-
- rtems_libio_free(iop);
-
- if (rc != RTEMS_SUCCESSFUL)
- return rtems_libio_errno(rc);
- return 0;
-}
-
-int
-__rtems_read(
- int fd,
- void * buffer,
- unsigned32 count
- )
-{
- rtems_status_code rc;
- rtems_driver_name_t *np;
- rtems_libio_t *iop;
- rtems_libio_rw_args_t args;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd, void *buffer, unsigned32 count);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].read;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- return (*fp)(fd, buffer, count);
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
- rtems_libio_check_buffer(buffer);
- rtems_libio_check_count(count);
- rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ);
-
- np = iop->driver;
-
- args.iop = iop;
- args.offset = iop->offset;
- args.buffer = buffer;
- args.count = count;
- args.flags = iop->flags;
- args.bytes_moved = 0;
-
- rc = rtems_io_read(np->major, np->minor, (void *) &args);
-
- iop->offset += args.bytes_moved;
-
- if (rc != RTEMS_SUCCESSFUL)
- return rtems_libio_errno(rc);
-
- return args.bytes_moved;
-}
-
-int
-__rtems_write(
- int fd,
- const void *buffer,
- unsigned32 count
- )
-{
- rtems_status_code rc;
- rtems_driver_name_t *np;
- rtems_libio_t *iop;
- rtems_libio_rw_args_t args;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd, const void *buffer, unsigned32 count);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].write;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- return (*fp)(fd, buffer, count);
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
- rtems_libio_check_buffer(buffer);
- rtems_libio_check_count(count);
- rtems_libio_check_permissions(iop, LIBIO_FLAGS_WRITE);
-
- np = iop->driver;
-
- args.iop = iop;
- args.offset = iop->offset;
- args.buffer = (void *) buffer;
- args.count = count;
- args.flags = iop->flags;
- args.bytes_moved = 0;
-
- rc = rtems_io_write(np->major, np->minor, (void *) &args);
-
- iop->offset += args.bytes_moved;
-
- if (rc != RTEMS_SUCCESSFUL)
- return rtems_libio_errno(rc);
-
- return args.bytes_moved;
-}
-
-int
-__rtems_ioctl(
- int fd,
- unsigned32 command,
- void * buffer)
-{
- rtems_status_code rc;
- rtems_driver_name_t *np;
- rtems_libio_t *iop;
- rtems_libio_ioctl_args_t args;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd, unsigned32 command, void *buffer);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].ioctl;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- return (*fp)(fd, command, buffer);
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
-
- np = iop->driver;
-
- args.iop = iop;
- args.command = command;
- args.buffer = buffer;
-
- rc = rtems_io_control(np->major, np->minor, (void *) &args);
-
- if (rc != RTEMS_SUCCESSFUL)
- return rtems_libio_errno(rc);
-
- return args.ioctl_return;
-}
-
-/*
- * internal only??
- */
-
-
-int
-__rtems_lseek(
- int fd,
- rtems_libio_offset_t offset,
- int whence
- )
-{
- rtems_libio_t *iop;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd, rtems_libio_offset_t offset, int whence);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].lseek;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- return (*fp)(fd, offset, whence);
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
-
- switch (whence)
- {
- case SEEK_SET:
- iop->offset = offset;
- break;
-
- case SEEK_CUR:
- iop->offset += offset;
- break;
-
- case SEEK_END:
- iop->offset = iop->size - offset;
- break;
-
- default:
- errno = EINVAL;
- return -1;
- }
- return 0;
-}
diff --git a/c/src/lib/libc/libio.h b/c/src/lib/libc/libio.h
deleted file mode 100644
index dcdda85aec..0000000000
--- a/c/src/lib/libc/libio.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * General purpose communication channel for RTEMS to allow UNIX/POSIX
- * system call behavior on top of RTEMS IO devices.
- *
- * TODO
- * stat(2)
- * unlink(2)
- * rename(2)
- *
- * $Id$
- */
-
-#ifndef _RTEMS_LIBIO_H
-#define _RTEMS_LIBIO_H
-
-#include <sys/stat.h>
-
-typedef unsigned32 rtems_libio_offset_t;
-
-/*
- * An open file data structure, indexed by 'fd'
- * TODO:
- * should really have a separate per/file data structure that this
- * points to (eg: size, offset, driver, pathname should be in that)
- */
-
-typedef struct {
- rtems_driver_name_t *driver;
- rtems_libio_offset_t size; /* size of file */
- rtems_libio_offset_t offset; /* current offset into the file */
- unsigned32 flags;
- char *pathname; /* opened pathname */
- Objects_Id sem;
- unsigned32 data0; /* private to "driver" */
- void *data1; /* ... */
-} rtems_libio_t;
-
-
-/*
- * param block for read/write
- * Note: it must include 'offset' instead of using iop's offset since
- * we can have multiple outstanding i/o's on a device.
- */
-
-typedef struct {
- rtems_libio_t *iop;
- rtems_libio_offset_t offset;
- unsigned8 *buffer;
- unsigned32 count;
- unsigned32 flags;
- unsigned32 bytes_moved;
-} rtems_libio_rw_args_t;
-
-/*
- * param block for open/close
- */
-
-typedef struct {
- rtems_libio_t *iop;
- unsigned32 flags;
- unsigned32 mode;
-} rtems_libio_open_close_args_t;
-
-/*
- * param block for ioctl
- */
-
-typedef struct {
- rtems_libio_t *iop;
- unsigned32 command;
- void *buffer;
- unsigned32 ioctl_return;
-} rtems_libio_ioctl_args_t;
-
-
-/*
- * Values for 'flag'
- */
-
-#define LIBIO_FLAGS_NO_DELAY 0x0001 /* return immediately if no data */
-#define LIBIO_FLAGS_READ 0x0002 /* reading */
-#define LIBIO_FLAGS_WRITE 0x0004 /* writing */
-#define LIBIO_FLAGS_LINE_BUFFERED 0x0008 /* line buffered io (^h, ^u, etc) */
-#define LIBIO_FLAGS_OPEN 0x0100 /* device is open */
-#define LIBIO_FLAGS_APPEND 0x0200 /* all writes append */
-#define LIBIO_FLAGS_CREATE 0x0400 /* create file */
-
-#define LIBIO_FLAGS_READ_WRITE (LIBIO_FLAGS_READ | LIBIO_FLAGS_WRITE)
-
-void rtems_libio_init(void);
-
-int __rtems_open(const char *pathname, unsigned32 flag, unsigned32 mode);
-int __rtems_close(int fd);
-int __rtems_read(int fd, void *buffer, unsigned32 count);
-int __rtems_write(int fd, const void *buffer, unsigned32 count);
-int __rtems_ioctl(int fd, unsigned32 command, void *buffer);
-int __rtems_lseek(int fd, rtems_libio_offset_t offset, int whence);
-int __rtems_fstat(int _fd, struct stat* _sbuf);
-
-/*
- * External I/O handlers
- */
-typedef struct {
- int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode);
- int (*close)(int fd);
- int (*read)(int fd, void *buffer, unsigned32 count);
- int (*write)(int fd, const void *buffer, unsigned32 count);
- int (*ioctl)(int fd, unsigned32 command, void *buffer);
- int (*lseek)(int fd, rtems_libio_offset_t offset, int whence);
-} rtems_libio_handler_t;
-
-void rtems_register_libio_handler(int handler_flag,
- const rtems_libio_handler_t *handler);
-
-#define RTEMS_FILE_DESCRIPTOR_TYPE_FILE 0x0000
-#define RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET 0x1000
-#define rtems_make_file_descriptor(fd,flags) ((fd)|(flags))
-#define rtems_file_descriptor_base(fd) ((fd) & 0x0FFF)
-#define rtems_file_descriptor_type(fd) ((fd) & 0xF000)
-#define rtems_file_descriptor_type_index(fd) ((((fd) & 0xF000) >> 12) - 1)
-
-/*
- * IOCTL values
- */
-
-#define RTEMS_IO_GET_ATTRIBUTES 1
-#define RTEMS_IO_SET_ATTRIBUTES 2
-#define RTEMS_IO_TCDRAIN 3
-
-/*
- * Callbacks from TERMIOS routines to device-dependent code
- */
-#include <termios.h>
-typedef struct rtems_termios_callbacks {
- int (*firstOpen)(int major, int minor, void *arg);
- int (*lastClose)(int major, int minor, void *arg);
- int (*pollRead)(int minor);
- int (*write)(int minor, const char *buf, int len);
- int (*setAttributes)(int minor, const struct termios *t);
- int (*stopRemoteTx)(int minor);
- int (*startRemoteTx)(int minor);
- int outputUsesInterrupts;
-} rtems_termios_callbacks;
-
-/*
- * Device-independent TERMIOS routines
- */
-void rtems_termios_initialize (void);
-rtems_status_code rtems_termios_open (
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg,
- const rtems_termios_callbacks *callbacks
- );
-rtems_status_code rtems_termios_close (void *arg);
-rtems_status_code rtems_termios_read (void *arg);
-rtems_status_code rtems_termios_write (void *arg);
-rtems_status_code rtems_termios_ioctl (void *arg);
-int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len);
-int rtems_termios_dequeue_characters (void *ttyp, int len);
-void rtems_termios_reserve_resources(
- rtems_configuration_table *configuration,
- rtems_unsigned32 number_of_devices
-);
-
-#endif /* _RTEMS_LIBIO_H */
diff --git a/c/src/lib/libc/malloc.c b/c/src/lib/libc/malloc.c
deleted file mode 100644
index fac38585a7..0000000000
--- a/c/src/lib/libc/malloc.c
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * RTEMS Malloc Family Implementation
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include "libcsupport.h"
-#ifdef RTEMS_NEWLIB
-#include <sys/reent.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <assert.h>
-#include <errno.h>
-#include <string.h>
-
-/* for sbrk prototype in linux */
-#if defined(__linux__)
-#define __USE_MISC
-#endif
-#include <unistd.h> /* sbrk(2) */
-
-rtems_id RTEMS_Malloc_Heap;
-size_t RTEMS_Malloc_Sbrk_amount;
-
-extern rtems_cpu_table Cpu_table;
-#ifdef RTEMS_DEBUG
-#define MALLOC_STATS
-#define MALLOC_DIRTY
-#endif
-
-#ifdef MALLOC_STATS
-#define MSBUMP(f,n) rtems_malloc_stats.f += (n)
-
-struct {
- unsigned32 space_available; /* current size of malloc area */
- unsigned32 malloc_calls; /* # calls to malloc */
- unsigned32 free_calls;
- unsigned32 realloc_calls;
- unsigned32 calloc_calls;
- unsigned32 max_depth; /* most ever malloc'd at 1 time */
- unsigned64 lifetime_allocated;
- unsigned64 lifetime_freed;
-} rtems_malloc_stats;
-
-#else /* No rtems_malloc_stats */
-#define MSBUMP(f,n)
-#endif
-
-void RTEMS_Malloc_Initialize(
- void *start,
- size_t length,
- size_t sbrk_amount
-)
-{
- rtems_status_code status;
- void *starting_address;
- rtems_unsigned32 old_address;
- rtems_unsigned32 u32_address;
-
- /*
- * If the starting address is 0 then we are to attempt to
- * get length worth of memory using sbrk. Make sure we
- * align the address that we get back.
- */
-
- starting_address = start;
- RTEMS_Malloc_Sbrk_amount = sbrk_amount;
-
- if (!starting_address) {
- u32_address = (unsigned int)sbrk(length);
-
- if (u32_address == (rtems_unsigned32) -1) {
- rtems_fatal_error_occurred( RTEMS_NO_MEMORY );
- /* DOES NOT RETURN!!! */
- }
-
- if (u32_address & (CPU_ALIGNMENT-1)) {
- old_address = u32_address;
- u32_address = (u32_address + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- /*
- * adjust the length by whatever we aligned by
- */
-
- length -= u32_address - old_address;
- }
-
- starting_address = (void *)u32_address;
- }
-
- /*
- * If the BSP is not clearing out the workspace, then it is most likely
- * not clearing out the initial memory for the heap. There is no
- * standard supporting zeroing out the heap memory. But much code
- * with UNIX history seems to assume that memory malloc'ed during
- * initialization (before any free's) is zero'ed. This is true most
- * of the time under UNIX because zero'ing memory when it is first
- * given to a process eliminates the chance of a process seeing data
- * left over from another process. This would be a security violation.
- */
-
- if ( Cpu_table.do_zero_of_workspace )
- memset( starting_address, 0, length );
-
- /*
- * Unfortunately we cannot use assert if this fails because if this
- * has failed we do not have a heap and if we do not have a heap
- * STDIO cannot work because there will be no buffers.
- */
-
- status = rtems_region_create(
- rtems_build_name( 'H', 'E', 'A', 'P' ),
- starting_address,
- length,
- CPU_ALIGNMENT,
- RTEMS_DEFAULT_ATTRIBUTES,
- &RTEMS_Malloc_Heap
- );
- if ( status != RTEMS_SUCCESSFUL )
- rtems_fatal_error_occurred( status );
-
-#ifdef MALLOC_STATS
- /* zero all the stats */
- (void) memset(&rtems_malloc_stats, 0, sizeof(rtems_malloc_stats));
-#endif
-
- MSBUMP(space_available, length);
-}
-
-#ifdef RTEMS_NEWLIB
-void *malloc(
- size_t size
-)
-{
- void *return_this;
- void *starting_address;
- rtems_unsigned32 the_size;
- rtems_unsigned32 sbrk_amount;
- rtems_status_code status;
-
- MSBUMP(malloc_calls, 1);
-
- if ( !size )
- return (void *) 0;
-
- /*
- * Try to give a segment in the current region if there is not
- * enough space then try to grow the region using rtems_region_extend().
- * If this fails then return a NULL pointer.
- */
-
- status = rtems_region_get_segment(
- RTEMS_Malloc_Heap,
- size,
- RTEMS_NO_WAIT,
- RTEMS_NO_TIMEOUT,
- &return_this
- );
-
- if ( status != RTEMS_SUCCESSFUL ) {
- /*
- * Round to the "requested sbrk amount" so hopefully we won't have
- * to grow again for a while. This effectively does sbrk() calls
- * in "page" amounts.
- */
-
- sbrk_amount = RTEMS_Malloc_Sbrk_amount;
-
- if ( sbrk_amount == 0 )
- return (void *) 0;
-
- the_size = ((size + sbrk_amount) / sbrk_amount * sbrk_amount);
-
- if (((rtems_unsigned32)starting_address = (void *)sbrk(the_size))
- == (rtems_unsigned32) -1)
- return (void *) 0;
-
- status = rtems_region_extend(
- RTEMS_Malloc_Heap,
- starting_address,
- the_size
- );
- if ( status != RTEMS_SUCCESSFUL ) {
- sbrk(-the_size);
- errno = ENOMEM;
- return (void *) 0;
- }
-
- MSBUMP(space_available, the_size);
-
- status = rtems_region_get_segment(
- RTEMS_Malloc_Heap,
- size,
- RTEMS_NO_WAIT,
- RTEMS_NO_TIMEOUT,
- &return_this
- );
- if ( status != RTEMS_SUCCESSFUL ) {
- errno = ENOMEM;
- return (void *) 0;
- }
- }
-
-#ifdef MALLOC_STATS
- if (return_this)
- {
- unsigned32 actual_size;
- unsigned32 current_depth;
- status = rtems_region_get_segment_size(RTEMS_Malloc_Heap, return_this, &actual_size);
- MSBUMP(lifetime_allocated, actual_size);
- current_depth = rtems_malloc_stats.lifetime_allocated - rtems_malloc_stats.lifetime_freed;
- if (current_depth > rtems_malloc_stats.max_depth)
- rtems_malloc_stats.max_depth = current_depth;
- }
-#endif
-
-#ifdef MALLOC_DIRTY
- (void) memset(return_this, 0xCF, size);
-#endif
-
- return return_this;
-}
-
-void *calloc(
- size_t nelem,
- size_t elsize
-)
-{
- register char *cptr;
- int length;
-
- MSBUMP(calloc_calls, 1);
-
- length = nelem * elsize;
- cptr = malloc( length );
- if ( cptr )
- memset( cptr, '\0', length );
-
- MSBUMP(malloc_calls, -1); /* subtract off the malloc */
-
- return cptr;
-}
-
-void *realloc(
- void *ptr,
- size_t size
-)
-{
- rtems_unsigned32 old_size;
- rtems_status_code status;
- char *new_area;
-
- MSBUMP(realloc_calls, 1);
-
- if ( !ptr )
- return malloc( size );
-
- if ( !size ) {
- free( ptr );
- return (void *) 0;
- }
-
- new_area = malloc( size );
-
- MSBUMP(malloc_calls, -1); /* subtract off the malloc */
-
- if ( !new_area ) {
- free( ptr );
- return (void *) 0;
- }
-
- status = rtems_region_get_segment_size( RTEMS_Malloc_Heap, ptr, &old_size );
- if ( status != RTEMS_SUCCESSFUL ) {
- errno = EINVAL;
- return (void *) 0;
- }
-
- memcpy( new_area, ptr, (size < old_size) ? size : old_size );
- free( ptr );
-
- return new_area;
-
-}
-
-void free(
- void *ptr
-)
-{
- rtems_status_code status;
-
- MSBUMP(free_calls, 1);
-
- if ( !ptr )
- return;
-
-#ifdef MALLOC_STATS
- {
- unsigned32 size;
- status = rtems_region_get_segment_size( RTEMS_Malloc_Heap, ptr, &size );
- if ( status == RTEMS_SUCCESSFUL ) {
- MSBUMP(lifetime_freed, size);
- }
- }
-#endif
-
- status = rtems_region_return_segment( RTEMS_Malloc_Heap, ptr );
- if ( status != RTEMS_SUCCESSFUL ) {
- errno = EINVAL;
- assert( 0 );
- }
-}
-/* end if RTEMS_NEWLIB */
-#endif
-
-#ifdef MALLOC_STATS
-/*
- * Dump the malloc statistics
- * May be called via atexit() (installable by our bsp) or
- * at any time by user
- */
-
-void malloc_dump(void)
-{
- unsigned32 allocated = rtems_malloc_stats.lifetime_allocated - rtems_malloc_stats.lifetime_freed;
-
- printf("Malloc stats\n");
- printf(" avail:%uk allocated:%uk (%d%%) max:%uk (%d%%) lifetime:%Luk freed:%Luk\n",
- (unsigned int) rtems_malloc_stats.space_available / 1024,
- (unsigned int) allocated / 1024,
- /* avoid float! */
- (allocated * 100) / rtems_malloc_stats.space_available,
- (unsigned int) rtems_malloc_stats.max_depth / 1024,
- (rtems_malloc_stats.max_depth * 100) / rtems_malloc_stats.space_available,
- (unsigned64) rtems_malloc_stats.lifetime_allocated / 1024,
- (unsigned64) rtems_malloc_stats.lifetime_freed / 1024);
- printf(" Call counts: malloc:%d free:%d realloc:%d calloc:%d\n",
- rtems_malloc_stats.malloc_calls,
- rtems_malloc_stats.free_calls,
- rtems_malloc_stats.realloc_calls,
- rtems_malloc_stats.calloc_calls);
-}
-
-
-void malloc_walk(size_t source, size_t printf_enabled)
-{
- register Region_Control *the_region;
- Objects_Locations location;
-
- the_region = _Region_Get( RTEMS_Malloc_Heap, &location );
- if ( location == OBJECTS_LOCAL )
- {
- _Heap_Walk( &the_region->Memory, source, printf_enabled );
- _Thread_Enable_dispatch();
- }
-}
-
-#else
-
-void malloc_dump(void)
-{
- return;
-}
-
-void malloc_walk(size_t source, size_t printf_enabled)
-{
- return;
-}
-
-#endif
-
-/*
- * "Reentrant" versions of the above routines implemented above.
- */
-
-#ifdef RTEMS_NEWLIB
-void *_malloc_r(
- struct _reent *ignored,
- size_t size
-)
-{
- return malloc( size );
-}
-
-void *_calloc_r(
- struct _reent *ignored,
- size_t nelem,
- size_t elsize
-)
-{
- return calloc( nelem, elsize );
-}
-
-void *_realloc_r(
- struct _reent *ignored,
- void *ptr,
- size_t size
-)
-{
- return realloc( ptr, size );
-}
-
-void _free_r(
- struct _reent *ignored,
- void *ptr
-)
-{
- free( ptr );
-}
-#endif
-
diff --git a/c/src/lib/libc/newlibc.c b/c/src/lib/libc/newlibc.c
deleted file mode 100644
index a6acc1c8d7..0000000000
--- a/c/src/lib/libc/newlibc.c
+++ /dev/null
@@ -1,429 +0,0 @@
-
-/*
- * COPYRIGHT (c) 1994 by Division Incorporated
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Description:
- * Implementation of hooks for the CYGNUS newlib libc
- * These hooks set things up so that:
- * '_REENT' is switched at task switch time.
- *
- *
- * TODO:
- *
- * NOTE:
- *
- * $Id$
- *
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-
-#if defined(RTEMS_NEWLIB)
-#include <libcsupport.h>
-#include <stdlib.h> /* for free() */
-#include <string.h> /* for memset() */
-
-#include <sys/reent.h> /* for extern of _REENT (aka _impure_ptr) */
-#include <errno.h>
-
-/*
- * NOTE:
- * There is some problem with doing this on the hpux version
- * of the UNIX simulator (symptom is printf core dumps), so
- * we just don't for now.
- * Not sure if this is a problem with hpux, newlib, or something else.
- */
-
-#if defined(RTEMS_UNIX) && !defined(hpux)
-#define NEED_SETVBUF
-#endif
-
-#ifdef NEED_SETVBUF
-#include <stdio.h>
-#endif
-
-#include "internal.h"
-
-#define LIBC_NOTEPAD RTEMS_NOTEPAD_LAST
-
-
-int libc_reentrant; /* do we think we are reentrant? */
-struct _reent libc_global_reent = _REENT_INIT(libc_global_reent);
-
-/*
- * CYGNUS newlib routine that does atexit() processing and flushes
- * stdio streams
- * undocumented
- */
-
-extern void _wrapup_reent(struct _reent *);
-extern void _reclaim_reent(struct _reent *);
-
-#include <stdio.h>
-
-void
-libc_wrapup(void)
-{
- /*
- * In case RTEMS is already down, don't do this. It could be
- * dangerous.
- */
-
- if (!_System_state_Is_up(_System_state_Get()))
- return;
-
- _wrapup_reent(0);
- if (_REENT != &libc_global_reent)
- {
- _wrapup_reent(&libc_global_reent);
-#if 0
- /* don't reclaim this one, just in case we do printfs */
- /* on our way out to ROM */
- _reclaim_reent(&libc_global_reent);
-#endif
- _REENT = &libc_global_reent;
- }
-
- /*
- * Try to drain output buffers.
- *
- * Should this be changed to do *all* file streams?
- * _fwalk (_REENT, fclose);
- */
- fclose (stdin);
- fclose (stdout);
- fclose (stderr);
-}
-
-
-rtems_boolean
-libc_create_hook(rtems_tcb *current_task,
- rtems_tcb *creating_task)
-{
- MY_task_set_note(creating_task, LIBC_NOTEPAD, 0);
- return TRUE;
-}
-
-/*
- * Called for all user TASKS (system tasks are MPCI Receive Server and IDLE)
- */
-
-rtems_extension
-libc_start_hook(rtems_tcb *current_task,
- rtems_tcb *starting_task)
-{
- struct _reent *ptr;
-
- /* NOTE: our malloc is reentrant without a reent ptr since
- * it is based on region manager
- */
-
- ptr = (struct _reent *) calloc(1, sizeof(struct _reent));
-
- if (!ptr)
- rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
-
-#ifdef __GNUC__
- /* GCC extension: structure constants */
- *ptr = (struct _reent) _REENT_INIT((*ptr));
-#else
- /*
- * Warning: THIS IS VERY DEPENDENT ON NEWLIB!!! WRITTEN FOR 1.7.0
- */
- ptr->_errno=0;
- ptr->_stdin=&ptr->__sf[0];
- ptr->_stdout=&ptr->__sf[1];
- ptr->_stderr=&ptr->__sf[2];
- ptr->_scanpoint=0;
- ptr->_asctime[0]=0;
- ptr->_next=1;
- ptr->__sdidinit=0;
-#endif
-
- MY_task_set_note(starting_task, LIBC_NOTEPAD, (rtems_unsigned32) ptr);
-}
-
-/*
- * Called for all user TASKS (system tasks are MPCI Receive Server and IDLE)
- */
-
-#ifdef NEED_SETVBUF
-rtems_extension
-libc_begin_hook(rtems_tcb *current_task)
-{
- setvbuf( stdout, NULL, _IOLBF, BUFSIZ );
-}
-#endif
-
-rtems_extension
-libc_switch_hook(rtems_tcb *current_task,
- rtems_tcb *heir_task)
-{
- rtems_unsigned32 impure_value;
-
- /* XXX We can't use rtems_task_set_note() here since SYSI task has a
- * tid of 0, which is treated specially (optimized, actually)
- * by rtems_task_set_note
- *
- * NOTE: The above comment is no longer true and we need to use
- * the extension data areas added about the same time.
- */
-
- /*
- * Don't touch the outgoing task if it has been deleted.
- */
-
- if ( !_States_Is_transient( current_task->current_state ) ) {
- impure_value = (rtems_unsigned32) _REENT;
- MY_task_set_note(current_task, LIBC_NOTEPAD, impure_value);
- }
-
- _REENT = (struct _reent *) MY_task_get_note(heir_task, LIBC_NOTEPAD);
-
-}
-
-/*
- * Function: libc_delete_hook
- * Created: 94/12/10
- *
- * Description:
- * Called when a task is deleted.
- * Must restore the new lib reentrancy state for the new current
- * task.
- *
- * Parameters:
- *
- *
- * Returns:
- *
- *
- * Side Effects:
- *
- * Notes:
- *
- *
- * Deficiencies/ToDo:
- *
- *
- */
-rtems_extension
-libc_delete_hook(rtems_tcb *current_task,
- rtems_tcb *deleted_task)
-{
- struct _reent *ptr;
-
- /*
- * The reentrancy structure was allocated by newlib using malloc()
- */
-
- if (current_task == deleted_task)
- {
- ptr = _REENT;
- }
- else
- {
- ptr = (struct _reent *) MY_task_get_note(deleted_task, LIBC_NOTEPAD);
- }
-
- /* if (ptr) */
- if (ptr && ptr != &libc_global_reent)
- {
- _wrapup_reent(ptr);
- _reclaim_reent(ptr);
- free(ptr);
- }
-
- MY_task_set_note(deleted_task, LIBC_NOTEPAD, 0);
-
- /*
- * Require the switch back to another task to install its own
- */
-
- if (current_task == deleted_task)
- {
- _REENT = 0;
- }
-}
-
-/*
- * Function: libc_init
- * Created: 94/12/10
- *
- * Description:
- * Init libc for CYGNUS newlib
- * Set up _REENT to use our global libc_global_reent.
- * (newlib provides a global of its own, but we prefer our
- * own name for it)
- *
- * If reentrancy is desired (which it should be), then
- * we install the task extension hooks to maintain the
- * newlib reentrancy global variable _REENT on task
- * create, delete, switch, exit, etc.
- *
- * Parameters:
- * reentrant non-zero if reentrant library desired.
- *
- * Returns:
- *
- * Side Effects:
- * installs libc extensions if reentrant.
- *
- * Notes:
- *
- *
- * Deficiencies/ToDo:
- *
- */
-
-void
-libc_init(int reentrant)
-{
- rtems_extensions_table libc_extension;
- rtems_id extension_id;
- rtems_status_code rc;
-
- _REENT = &libc_global_reent;
-
- if (reentrant)
- {
- memset(&libc_extension, 0, sizeof(libc_extension));
-
- libc_extension.thread_create = libc_create_hook;
- libc_extension.thread_start = libc_start_hook;
-#ifdef NEED_SETVBUF
- libc_extension.thread_begin = libc_begin_hook;
-#endif
- libc_extension.thread_switch = libc_switch_hook;
- libc_extension.thread_delete = libc_delete_hook;
-
- rc = rtems_extension_create(rtems_build_name('L', 'I', 'B', 'C'),
- &libc_extension, &extension_id);
- if (rc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(rc);
-
- libc_reentrant = reentrant;
- }
-}
-
-#if 0
-/*
- * Routines required by the gnat runtime.
- */
-
-int get_errno()
-{
- return errno;
-}
-#endif
-
-/*
- * Function: _exit
- * Created: 94/12/10
- *
- * Description:
- * Called from exit() after it does atexit() processing and stdio fflush's
- *
- * called from bottom of exit() to really delete the task.
- * If we are using reentrant libc, then let the delete extension
- * do all the work, otherwise if a shutdown is in progress,
- * then just do it.
- *
- * Parameters:
- * exit status
- *
- * Returns:
- * does not return
- *
- * Side Effects:
- *
- * Notes:
- *
- *
- * Deficiencies/ToDo:
- *
- *
- */
-
-#include <stdio.h>
-
-/* #if !defined(RTEMS_UNIX) && !defined(__GO32__) && !defined(_AM29K) */
-#if !defined(RTEMS_UNIX) && !defined(_AM29K)
-void _exit(int status)
-{
- libc_wrapup(); /* Why? XXX */
- rtems_shutdown_executive(status);
-}
-#else
-
-void exit(int status)
-{
- libc_wrapup();
- rtems_shutdown_executive(status);
-}
-#endif
-
-
-/*
- * These are directly supported (and completely correct) in the posix api.
- */
-
-pid_t __getpid(void)
-{
- return getpid();
-}
-
-/* #if !defined(RTEMS_POSIX_API) || defined(__GO32__) */
-#if !defined(RTEMS_POSIX_API)
-pid_t getpid(void)
-{
- return (0);
-}
-#endif
-
-/* #if !defined(RTEMS_POSIX_API) || defined(__GO32__) */
-#if !defined(RTEMS_POSIX_API)
-int kill( pid_t pid, int sig )
-{
- return 0;
-}
-#endif
-
-int __kill( pid_t pid, int sig )
-{
- return 0;
-}
-
-#if !defined(RTEMS_POSIX_API)
-unsigned int sleep(
- unsigned int seconds
-)
-{
- rtems_status_code status;
- rtems_interval ticks_per_second;
- rtems_interval ticks;
-
- status = rtems_clock_get(
- RTEMS_CLOCK_GET_TICKS_PER_SECOND,
- &ticks_per_second
- );
-
- ticks = seconds * ticks_per_second;
-
- status = rtems_task_wake_after( ticks );
-
- /*
- * Returns the "unslept" amount of time. In RTEMS signals are not
- * interruptable, so tasks really sleep all of the requested time.
- */
-
- return 0;
-}
-#endif
-
-
-#endif
diff --git a/c/src/lib/libc/newlibif.c b/c/src/lib/libc/newlibif.c
deleted file mode 100644
index 8b995fed92..0000000000
--- a/c/src/lib/libc/newlibif.c
+++ /dev/null
@@ -1,93 +0,0 @@
-
-/*
- * This file contains the glue which maps newlib system calls onto their
- * RTEMS implementations. This formerly was in the file
- * libgloss/rtems/iface.c which was installed as rtems.o. Merging this
- * into the RTEMS source tree minimizes the files which must be linked
- * to build an rtems application.
- *
- * $Id$
- *
- */
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <reent.h>
-
-#include <termios.h>
-
-#include "internal.h"
-#include "libio.h"
-
-int
-read(int fd,
- char *buf,
- int nbytes)
-{
- return __rtems_read(fd, buf, nbytes);
-}
-
-int
-write(int fd,
- char *buf,
- int nbytes)
-{
- return __rtems_write(fd, buf, nbytes);
-}
-
-int
-open(char *buf,
- int flags,
- int mode)
-{
- return __rtems_open(buf, flags, mode);
-}
-
-int
-close(int fd)
-{
- return __rtems_close(fd);
-}
-
-/*
- * lseek -- move read/write pointer. Since a serial port
- * is non-seekable, we return an error.
- */
-off_t
-lseek(int fd,
- off_t offset,
- int whence)
-{
- return __rtems_lseek(fd, offset, whence);
-}
-
-/*
- * fstat -- get status of a file. Since we have no file
- * system, we just return an error.
- */
-int
-fstat(int fd,
- struct stat *buf)
-{
- return __rtems_fstat(fd, buf);
-}
-
-/*
- * getpid and kill are provided directly by rtems
- */
-
-/*
- * ioctl -- IO control
- */
-
-int
-ioctl(int fd, int request, void *argp)
-{
- return __rtems_ioctl(fd,request,argp);
-}
-
-#endif
diff --git a/c/src/lib/libc/newlibifr.c b/c/src/lib/libc/newlibifr.c
deleted file mode 100644
index 5d870c91a6..0000000000
--- a/c/src/lib/libc/newlibifr.c
+++ /dev/null
@@ -1,103 +0,0 @@
-
-/*
- * This file contains the glue which maps newlib system calls onto their
- * RTEMS implementations. This formerly was in the file
- * libgloss/rtems/iface.c which was installed as rtems.o. Merging this
- * into the RTEMS source tree minimizes the files which must be linked
- * to build an rtems application.
- *
- * $Id$
- *
- */
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <reent.h>
-
-#include <termios.h>
-
-#include "internal.h"
-#include "libio.h"
-
-_ssize_t _read_r(
- struct _reent *ptr,
- int fd,
- void *buf,
- size_t nbytes
-)
-{
- return __rtems_read(fd, buf, nbytes);
-}
-
-long _write_r(
- struct _reent *ptr,
- int fd,
- const void *buf,
- size_t nbytes
-)
-{
- return __rtems_write(fd, buf, nbytes);
-}
-
-int _open_r(
- struct _reent *ptr,
- const char *buf,
- int flags,
- int mode
-)
-{
- return __rtems_open(buf, flags, mode);
-}
-
-int _close_r(
- struct _reent *ptr,
- int fd
-)
-{
- return __rtems_close(fd);
-}
-
-off_t _lseek_r(
- struct _reent *ptr,
- int fd,
- off_t offset,
- int whence
-)
-{
- return __rtems_lseek(fd, offset, whence);
-}
-
-int _stat_r(
- struct _reent *ptr,
- const char *path,
- struct stat *buf
-)
-{
- return stat(path, buf);
-}
-
-int _fstat_r(
- struct _reent *ptr,
- int fd,
- struct stat *buf
-)
-{
- return __rtems_fstat(fd, buf);
-}
-
-pid_t _getpid_r(struct _reent *ptr)
-{
- pid_t __getpid();
- return __getpid();
-}
-
-int _kill_r( struct _reent *ptr, pid_t pid, int sig )
-{
- int __kill();
- return __kill(pid, sig);
-}
-#endif
diff --git a/c/src/lib/libc/no_libc.c b/c/src/lib/libc/no_libc.c
deleted file mode 100644
index 5a58ba761c..0000000000
--- a/c/src/lib/libc/no_libc.c
+++ /dev/null
@@ -1,55 +0,0 @@
-
-/* no_libc.h
- *
- * This file contains stubs for the reentrancy hooks when
- * an unknown C library is used.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#if !defined(RTEMS_NEWLIB) && !defined(RTEMS_UNIX)
-
-#include "libcsupport.h"
-#include "internal.h"
-
-#include <stdlib.h> /* for free() */
-
-void
-libc_init(int reentrant)
-{
-}
-
-void libc_suspend_main(void)
-{
-}
-
-
-void libc_global_exit(rtems_unsigned32 code)
-{
-}
-
-void _exit(int status)
-{
-}
-
-#else
-
-/* remove ANSI errors.
- * A program must contain at least one external-declaration
- * (X3.159-1989 p.82,L3).
- */
-void no_libc_dummy_function( void )
-{
-}
-
-#endif
diff --git a/c/src/lib/libc/opendir.c b/c/src/lib/libc/opendir.c
deleted file mode 100644
index e303eb28e5..0000000000
--- a/c/src/lib/libc/opendir.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * opendir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <dirent.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-DIR *opendir(
- const char *name
-)
-{
- return NULL;
-}
diff --git a/c/src/lib/libc/readdir.c b/c/src/lib/libc/readdir.c
deleted file mode 100644
index d592a62b99..0000000000
--- a/c/src/lib/libc/readdir.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * readdir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <dirent.h>
-
-struct dirent *readdir(
- register DIR *dirp
-)
-{
- return NULL;
-}
diff --git a/c/src/lib/libc/rewinddir.c b/c/src/lib/libc/rewinddir.c
deleted file mode 100644
index c85e6fd4d0..0000000000
--- a/c/src/lib/libc/rewinddir.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * rewinddir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <assert.h>
-#include <dirent.h>
-#include <stdio.h>
-#include <errno.h>
-#include <unistd.h>
-
-void rewinddir(
- DIR *dirp
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/lib/libc/scandir.c b/c/src/lib/libc/scandir.c
deleted file mode 100644
index 380415dd97..0000000000
--- a/c/src/lib/libc/scandir.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * scandir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-int scandir(
- const char *dirname,
- struct dirent ***namelist,
- int (*select)(struct dirent *),
- int (*dcomp)(const void *, const void *)
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/lib/libc/seekdir.c b/c/src/lib/libc/seekdir.c
deleted file mode 100644
index e591adbb9f..0000000000
--- a/c/src/lib/libc/seekdir.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * seekdir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <sys/param.h>
-#include <assert.h>
-#include <dirent.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
-
-void seekdir(
- DIR *dirp,
- long loc
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/lib/libc/support.c b/c/src/lib/libc/support.c
deleted file mode 100644
index 85e6bb363f..0000000000
--- a/c/src/lib/libc/support.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Routines to Access Internal RTEMS Resources
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-void MY_task_set_note(
- Thread_Control *the_thread,
- unsigned32 notepad,
- unsigned32 note
-)
-{
- RTEMS_API_Control *api;
-
- api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
-
- if ( api )
- api->Notepads[ notepad ] = note;
-}
-
-
-unsigned32 MY_task_get_note(
- Thread_Control *the_thread,
- unsigned32 notepad
-)
-{
- RTEMS_API_Control *api;
-
- api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
-
- return api->Notepads[ notepad ];
-}
-
-void *MY_CPU_Context_FP_start(
- void *base,
- unsigned32 offset
-)
-{
- return _CPU_Context_Fp_start( base, offset );
-}
-
diff --git a/c/src/lib/libc/syscalls.c b/c/src/lib/libc/syscalls.c
deleted file mode 100644
index e97034ddba..0000000000
--- a/c/src/lib/libc/syscalls.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * RTEMS Fake System Calls
- *
- * This file contains "fake" versions of the system call routines
- * which are reference by many libc implementations. Once a routine
- * has been implemented in terms of RTEMS services, it should be
- * taken out of this file.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- *
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <assert.h>
-#include <errno.h>
-#include <string.h>
-#include <stdio.h> /* only for puts */
-
-#include <rtems.h>
-#include <rtems/libio.h>
-
-#ifdef RTEMS_NEWLIB
-
-int __rtems_fstat(int _fd, struct stat* _sbuf)
-{
-#ifdef HAVE_BLKSIZE
- _sbuf->st_blksize = 0;
-#endif
-
- /*
- * For now assume stdin/stdout/stderr are always a TTY line
- *
- * From Eric Norum:
- *
- * The `fix' is not complete. It still doesn't properly handle
- * file descriptors for any files/devices other than the console
- * serial lines.....
- */
- if (_fd <= 2) {
- _sbuf->st_mode = S_IFCHR;
- } else {
- switch (rtems_file_descriptor_type (_fd)) {
- case RTEMS_FILE_DESCRIPTOR_TYPE_FILE:
- _sbuf->st_mode = S_IFREG;
- break;
-
- case RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET:
-#if !defined(__GO32__)
- _sbuf->st_mode = S_IFSOCK;
- break;
-#endif
-
- default:
- puts( "__rtems_fstat -- unknown file descriptor type" );
- assert( 0 );
- }
- }
- return 0;
-}
-
-#if !defined(RTEMS_UNIX)
-int stat( const char *path, struct stat *buf )
-{
- if ( strncmp( "/dev/", path, 5 ) ) {
- return -1;
- }
- return __rtems_fstat( 0, buf );
-}
-
-int link( const char *existing, const char *new )
-{
- /* always fail */
- return -1;
-}
-
-int unlink( const char *path )
-{
- /* always fail */
- return -1;
-}
-
-char *getcwd( char *_buf, size_t _size)
-{
-/* assert( FALSE ); */
- errno = ENOSYS;
- return 0;
-}
-#endif
-
-#endif
diff --git a/c/src/lib/libc/tcattr.c b/c/src/lib/libc/tcattr.c
deleted file mode 100644
index aaa5ff6e6e..0000000000
--- a/c/src/lib/libc/tcattr.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * This file contains the RTEMS implementation of the POSIX API
- * routines tcgetattr and tcsetattr.
- *
- * $Id$
- *
- */
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-
-#include "internal.h"
-#include "libio.h"
-
-/*
- * tcgetattr/tcsetattr -- get/set attributes of a device.
- *
- * submitted by K.Shibuya
- */
-
-int
-tcgetattr(int fd, struct termios *tp)
-{
- return __rtems_ioctl(fd,RTEMS_IO_GET_ATTRIBUTES,tp);
-}
-
-int
-tcsetattr(int fd, int opt, struct termios *tp)
-{
- if(opt != TCSANOW)
- return -1;
- return __rtems_ioctl(fd,RTEMS_IO_SET_ATTRIBUTES,tp);
-}
-
-#endif
diff --git a/c/src/lib/libc/tcdrain.c b/c/src/lib/libc/tcdrain.c
deleted file mode 100644
index 585871cc90..0000000000
--- a/c/src/lib/libc/tcdrain.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file contains the RTEMS implementation of the POSIX API
- * routines tcdrain.
- *
- * $Id$
- *
- */
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-
-#include "internal.h"
-#include "libio.h"
-
-int
-tcdrain(int fd)
-{
- return __rtems_ioctl(fd,RTEMS_IO_TCDRAIN,0);
-}
-
-#endif
diff --git a/c/src/lib/libc/telldir.c b/c/src/lib/libc/telldir.c
deleted file mode 100644
index eee8d925ec..0000000000
--- a/c/src/lib/libc/telldir.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * telldir() - XXX
- *
- * $Id$
- */
-
-#include <sys/param.h>
-#include <assert.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <rtems.h>
-#include "libio.h"
-
-long telldir(
- DIR *dirp
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/c/src/lib/libc/termios.c b/c/src/lib/libc/termios.c
deleted file mode 100644
index c2a43c7707..0000000000
--- a/c/src/lib/libc/termios.c
+++ /dev/null
@@ -1,935 +0,0 @@
-/*
- * TERMIOS serial line support
- *
- * Author:
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * The license and distribution terms 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.h>
-#include <rtems/libio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <termios.h>
-#include <unistd.h>
-
-/*
- * FreeBSD does not support a full POSIX termios so we have to help it out
- */
-
-
-#if defined(__FreeBSD__)
-#define XTABS 0
-#define ONLRET 0
-#define ONOCR 0
-#define TABDLY 0
-#define OLCUC 0
-#define ILCUC 0
-#define OCRNL 0
-#define IUCLC 0
-#endif
-
-/*
- * The size of the cooked buffer
- */
-#define CBUFSIZE 256
-
-/*
- * The sizes of the raw message buffers.
- * On most architectures it is quite a bit more
- * efficient if these are powers of two.
- */
-#define RAW_INPUT_BUFFER_SIZE 128
-#define RAW_OUTPUT_BUFFER_SIZE 64
-
-/*
- * Variables associated with each termios instance.
- * One structure for each hardware I/O device.
- */
-struct rtems_termios_tty {
- /*
- * Linked-list of active TERMIOS devices
- */
- struct rtems_termios_tty *forw;
- struct rtems_termios_tty *back;
-
- /*
- * How many times has this device been opened
- */
- int refcount;
-
- /*
- * This device
- */
- rtems_device_major_number major;
- rtems_device_major_number minor;
-
- /*
- * Mutual-exclusion semaphores
- */
- rtems_id isem;
- rtems_id osem;
-
- /*
- * The canonical (cooked) character buffer
- */
- char cbuf[CBUFSIZE];
- int ccount;
- int cindex;
-
- /*
- * Keep track of cursor (printhead) position
- */
- int column;
- int read_start_column;
-
- /*
- * The ioctl settings
- */
- struct termios termios;
- rtems_interval vtimeTicks;
-
- /*
- * Raw input character buffer
- */
- volatile char rawInBuf[RAW_INPUT_BUFFER_SIZE];
- volatile unsigned int rawInBufHead;
- volatile unsigned int rawInBufTail;
- rtems_id rawInBufSemaphore;
- rtems_unsigned32 rawInBufSemaphoreOptions;
- rtems_interval rawInBufSemaphoreTimeout;
- rtems_interval rawInBufSemaphoreFirstTimeout;
- unsigned int rawInBufDropped; /* Statistics */
-
- /*
- * Raw output character buffer
- */
- volatile char rawOutBuf[RAW_OUTPUT_BUFFER_SIZE];
- volatile unsigned int rawOutBufHead;
- volatile unsigned int rawOutBufTail;
- rtems_id rawOutBufSemaphore;
- enum {rob_idle, rob_busy, rob_wait } rawOutBufState;
-
- /*
- * Callbacks to device-specific routines
- */
- rtems_termios_callbacks device;
-};
-
-static struct rtems_termios_tty *ttyHead, *ttyTail;
-static rtems_id ttyMutex;
-
-/*
- * Reserve enough resources to open every physical device once.
- */
-
-static int first_time; /* assumed to be zeroed by BSS initialization */
-
-void
-rtems_termios_reserve_resources (
- rtems_configuration_table *configuration,
- rtems_unsigned32 number_of_devices
- )
-{
- rtems_api_configuration_table *rtems_config;
-
- if (!configuration)
- rtems_fatal_error_occurred (0xFFF0F001);
- rtems_config = configuration->RTEMS_api_configuration;
- if (!rtems_config)
- rtems_fatal_error_occurred (0xFFF0F002);
- if (!first_time)
- rtems_config->maximum_semaphores += 1;
- first_time = 1;
- rtems_config->maximum_semaphores += (4 * number_of_devices);
-}
-
-void
-rtems_termios_initialize (void)
-{
- rtems_status_code sc;
-
- /*
- * Create the mutex semaphore for the tty list
- */
- if (!ttyMutex) {
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'm', 'i'),
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &ttyMutex);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- }
-}
-
-/*
- * Open a termios device
- */
-rtems_status_code
-rtems_termios_open (
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg,
- const rtems_termios_callbacks *callbacks
- )
-{
- rtems_status_code sc;
- rtems_libio_open_close_args_t *args = arg;
- struct rtems_termios_tty *tty;
-
- /*
- * See if the device has already been opened
- */
- sc = rtems_semaphore_obtain (ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- for (tty = ttyHead ; tty != NULL ; tty = tty->forw) {
- if ((tty->major == major) && (tty->minor == minor))
- break;
- }
- if (tty == NULL) {
- static char c = 'a';
-
- /*
- * Create a new device
- */
- tty = calloc (1, sizeof (struct rtems_termios_tty));
- if (tty == NULL) {
- rtems_semaphore_release (ttyMutex);
- return RTEMS_NO_MEMORY;
- }
- tty->forw = ttyHead;
- ttyHead = tty;
- if (ttyTail == NULL)
- ttyTail = tty;
-
- tty->minor = minor;
- tty->major = major;
-
- /*
- * Set up mutex semaphores
- */
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'i', c),
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &tty->isem);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'o', c),
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &tty->osem);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'x', c),
- 0,
- RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &tty->rawOutBufSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- tty->rawOutBufState = rob_idle;
-
- /*
- * Set callbacks
- */
- tty->device = *callbacks;
- if (!tty->device.pollRead) {
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'r', c),
- 0,
- RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &tty->rawInBufSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- }
-
- /*
- * Set default parameters
- */
- tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
- tty->termios.c_oflag = OPOST | ONLCR | XTABS;
- tty->termios.c_cflag = B9600 | CS8 | CREAD;
- tty->termios.c_lflag = ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
- tty->termios.c_cc[VINTR] = '\003';
- tty->termios.c_cc[VQUIT] = '\034';
- tty->termios.c_cc[VERASE] = '\177';
- tty->termios.c_cc[VKILL] = '\025';
- tty->termios.c_cc[VEOF] = '\004';
- tty->termios.c_cc[VEOL] = '\000';
- tty->termios.c_cc[VEOL2] = '\000';
- tty->termios.c_cc[VSTART] = '\021';
- tty->termios.c_cc[VSTOP] = '\023';
- tty->termios.c_cc[VSUSP] = '\032';
- tty->termios.c_cc[VREPRINT] = '\022';
- tty->termios.c_cc[VDISCARD] = '\017';
- tty->termios.c_cc[VWERASE] = '\027';
- tty->termios.c_cc[VLNEXT] = '\026';
-
- /*
- * Bump name characer
- */
- if (c++ == 'z')
- c = 'a';
- }
- args->iop->data1 = tty;
- if (!tty->refcount++ && tty->device.firstOpen)
- (*tty->device.firstOpen)(major, minor, arg);
- rtems_semaphore_release (ttyMutex);
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Drain output queue
- */
-static void
-drainOutput (struct rtems_termios_tty *tty)
-{
- rtems_interrupt_level level;
- rtems_status_code sc;
-
- if (tty->device.outputUsesInterrupts) {
- rtems_interrupt_disable (level);
- while (tty->rawOutBufTail != tty->rawOutBufHead) {
- tty->rawOutBufState = rob_wait;
- rtems_interrupt_enable (level);
- sc = rtems_semaphore_obtain (tty->rawOutBufSemaphore,
- RTEMS_WAIT,
- RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- rtems_interrupt_disable (level);
- }
- rtems_interrupt_enable (level);
- }
-}
-
-rtems_status_code
-rtems_termios_close (void *arg)
-{
- rtems_libio_open_close_args_t *args = arg;
- struct rtems_termios_tty *tty = args->iop->data1;
- rtems_status_code sc;
-
- sc = rtems_semaphore_obtain (ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- if (--tty->refcount == 0) {
- drainOutput (tty);
- if (tty->device.lastClose)
- (*tty->device.lastClose)(tty->major, tty->minor, arg);
- if (tty->forw == NULL)
- ttyTail = tty->back;
- else
- tty->forw->back = tty->back;
- if (tty->back == NULL)
- ttyHead = tty->forw;
- else
- tty->back->forw = tty->forw;
- rtems_semaphore_delete (tty->isem);
- rtems_semaphore_delete (tty->osem);
- rtems_semaphore_delete (tty->rawOutBufSemaphore);
- if (!tty->device.pollRead)
- rtems_semaphore_delete (tty->rawInBufSemaphore);
- free (tty);
- }
- rtems_semaphore_release (ttyMutex);
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_status_code
-rtems_termios_ioctl (void *arg)
-{
- rtems_libio_ioctl_args_t *args = arg;
- struct rtems_termios_tty *tty = args->iop->data1;
- rtems_status_code sc;
-
- args->ioctl_return = 0;
- sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL) {
- args->ioctl_return = sc;
- return sc;
- }
- switch (args->command) {
- default:
- sc = RTEMS_INVALID_NUMBER;
- break;
-
- case RTEMS_IO_GET_ATTRIBUTES:
- *(struct termios *)args->buffer = tty->termios;
- break;
-
- case RTEMS_IO_SET_ATTRIBUTES:
- tty->termios = *(struct termios *)args->buffer;
- if (tty->termios.c_lflag & ICANON) {
- tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
- tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
- tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
- }
- else {
- rtems_interval ticksPerSecond;
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond);
- tty->vtimeTicks = tty->termios.c_cc[VTIME] * ticksPerSecond / 10;
- if (tty->termios.c_cc[VTIME]) {
- tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
- tty->rawInBufSemaphoreTimeout = tty->vtimeTicks;
- if (tty->termios.c_cc[VMIN])
- tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
- else
- tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
- }
- else {
- if (tty->termios.c_cc[VMIN]) {
- tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
- tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
- tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
- }
- else {
- tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
- }
- }
- }
- if (tty->device.setAttributes)
- (*tty->device.setAttributes)(tty->minor, &tty->termios);
- break;
-
- case RTEMS_IO_TCDRAIN:
- drainOutput (tty);
- break;
- }
- rtems_semaphore_release (tty->osem);
- args->ioctl_return = sc;
- return sc;
-}
-
-/*
- * Send characters to device-specific code
- */
-static void
-osend (const char *buf, int len, struct rtems_termios_tty *tty)
-{
- unsigned int newHead;
- rtems_interrupt_level level;
- rtems_status_code sc;
-
- if (!tty->device.outputUsesInterrupts) {
- (*tty->device.write)(tty->minor, buf, len);
- return;
- }
- newHead = tty->rawOutBufHead;
- while (len) {
- /*
- * Performance improvement could be made here.
- * Copy multiple bytes to raw buffer:
- * if (len > 1) && (space to buffer end, or tail > 1)
- * ncopy = MIN (len, space to buffer end or tail)
- * memcpy (raw buffer, buf, ncopy)
- * buf += ncopy
- * len -= ncopy
- *
- * To minimize latency, the memcpy should be done
- * with interrupts enabled.
- */
- newHead = (newHead + 1) % RAW_OUTPUT_BUFFER_SIZE;
- rtems_interrupt_disable (level);
- while (newHead == tty->rawOutBufTail) {
- tty->rawOutBufState = rob_wait;
- rtems_interrupt_enable (level);
- sc = rtems_semaphore_obtain (tty->rawOutBufSemaphore,
- RTEMS_WAIT,
- RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- rtems_interrupt_disable (level);
- }
- tty->rawOutBuf[tty->rawOutBufHead] = *buf++;
- tty->rawOutBufHead = newHead;
- if (tty->rawOutBufState == rob_idle) {
- (*tty->device.write)(tty->minor,
- (char *)&tty->rawOutBuf[tty->rawOutBufTail], 1);
- tty->rawOutBufState = rob_busy;
- }
- rtems_interrupt_enable (level);
- len--;
- }
-}
-
-/*
- * Handle output processing
- */
-static void
-oproc (unsigned char c, struct rtems_termios_tty *tty)
-{
- int i;
-
- if (tty->termios.c_oflag & OPOST) {
- switch (c) {
- case '\n':
- if (tty->termios.c_oflag & ONLRET)
- tty->column = 0;
- if (tty->termios.c_oflag & ONLCR) {
- osend ("\r", 1, tty);
- tty->column = 0;
- }
- break;
-
- case '\r':
- if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0))
- return;
- if (tty->termios.c_oflag & OCRNL) {
- c = '\n';
- if (tty->termios.c_oflag & ONLRET)
- tty->column = 0;
- break;
- }
- tty->column = 0;
- break;
-
- case '\t':
- i = 8 - (tty->column & 7);
- if ((tty->termios.c_oflag & TABDLY) == XTABS) {
- tty->column += i;
- osend ( " ", i, tty);
- return;
- }
- tty->column += i;
- break;
-
- case '\b':
- if (tty->column > 0)
- tty->column--;
- break;
-
- default:
- if (tty->termios.c_oflag & OLCUC)
- c = toupper(c);
- if (!iscntrl(c))
- tty->column++;
- break;
- }
- }
- osend (&c, 1, tty);
-}
-
-rtems_status_code
-rtems_termios_write (void *arg)
-{
- rtems_libio_rw_args_t *args = arg;
- struct rtems_termios_tty *tty = args->iop->data1;
- rtems_status_code sc;
-
- sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- if (tty->termios.c_oflag & OPOST) {
- unsigned32 count = args->count;
- unsigned8 *buffer = args->buffer;
- while (count--)
- oproc (*buffer++, tty);
- args->bytes_moved = args->count;
- }
- else {
- osend (args->buffer, args->count, tty);
- args->bytes_moved = args->count;
- }
- rtems_semaphore_release (tty->osem);
- return sc;
-}
-
-/*
- * Echo a typed character
- */
-static void
-echo (unsigned char c, struct rtems_termios_tty *tty)
-{
- if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) {
- char echobuf[2];
-
- echobuf[0] = '^';
- echobuf[1] = c ^ 0x40;
- osend (echobuf, 2, tty);
- tty->column += 2;
- }
- else {
- oproc (c, tty);
- }
-}
-
-/*
- * Erase a character or line
- * FIXME: Needs support for WERASE and ECHOPRT.
- * FIXME: Some of the tests should check for IEXTEN, too.
- */
-static void
-erase (struct rtems_termios_tty *tty, int lineFlag)
-{
- if (tty->ccount == 0)
- return;
- if (lineFlag) {
- if (!(tty->termios.c_lflag & ECHO)) {
- tty->ccount = 0;
- return;
- }
- if (!(tty->termios.c_lflag & ECHOE)) {
- tty->ccount = 0;
- echo (tty->termios.c_cc[VKILL], tty);
- if (tty->termios.c_lflag & ECHOK)
- echo ('\n', tty);
- return;
- }
- }
- while (tty->ccount) {
- unsigned char c = tty->cbuf[--tty->ccount];
-
- if (tty->termios.c_lflag & ECHO) {
- if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
- echo (tty->termios.c_cc[VERASE], tty);
- }
- else if (c == '\t') {
- int col = tty->read_start_column;
- int i = 0;
-
- /*
- * Find the character before the tab
- */
- while (i != tty->ccount) {
- c = tty->cbuf[i++];
- if (c == '\t') {
- col = (col | 7) + 1;
- }
- else if (iscntrl (c)) {
- if (tty->termios.c_lflag & ECHOCTL)
- col += 2;
- }
- else {
- col++;
- }
- }
-
- /*
- * Back up over the tab
- */
- while (tty->column > col) {
- osend ("\b", 1, tty);
- tty->column--;
- }
- }
- else {
- if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) {
- osend ("\b \b", 3, tty);
- if (tty->column)
- tty->column--;
- }
- if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) {
- osend ("\b \b", 3, tty);
- if (tty->column)
- tty->column--;
- }
- }
- }
- if (!lineFlag)
- break;
- }
-}
-
-/*
- * Process a single input character
- */
-static int
-iproc (unsigned char c, struct rtems_termios_tty *tty)
-{
- if (tty->termios.c_iflag & ISTRIP)
- c &= 0x7f;
- if (tty->termios.c_iflag & IUCLC)
- c = tolower (c);
- if (c == '\r') {
- if (tty->termios.c_iflag & IGNCR)
- return 0;
- if (tty->termios.c_iflag & ICRNL)
- c = '\n';
- }
- else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
- c = '\r';
- }
- if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
- if (c == tty->termios.c_cc[VERASE]) {
- erase (tty, 0);
- return 0;
- }
- else if (c == tty->termios.c_cc[VKILL]) {
- erase (tty, 1);
- return 0;
- }
- else if (c == tty->termios.c_cc[VEOF]) {
- return 1;
- }
- else if (c == '\n') {
- if (tty->termios.c_lflag & (ECHO | ECHONL))
- echo (c, tty);
- tty->cbuf[tty->ccount++] = c;
- return 1;
- }
- else if ((c == tty->termios.c_cc[VEOL])
- || (c == tty->termios.c_cc[VEOL2])) {
- if (tty->termios.c_lflag & ECHO)
- echo (c, tty);
- tty->cbuf[tty->ccount++] = c;
- return 1;
- }
- }
-
- /*
- * FIXME: Should do IMAXBEL handling somehow
- */
- if (tty->ccount < (CBUFSIZE-1)) {
- if (tty->termios.c_lflag & ECHO)
- echo (c, tty);
- tty->cbuf[tty->ccount++] = c;
- }
- return 0;
-}
-
-/*
- * Process input character, with semaphore.
- */
-static int
-siproc (unsigned char c, struct rtems_termios_tty *tty)
-{
- int i;
-
- /*
- * Obtain output semaphore if character will be echoed
- */
- if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) {
- rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- i = iproc (c, tty);
- rtems_semaphore_release (tty->osem);
- }
- else {
- i = iproc (c, tty);
- }
- return i;
-}
-
-/*
- * Fill the input buffer by polling the device
- */
-static rtems_status_code
-fillBufferPoll (struct rtems_termios_tty *tty)
-{
- int n;
-
- if (tty->termios.c_lflag & ICANON) {
- for (;;) {
- n = (*tty->device.pollRead)(tty->minor);
- if (n < 0) {
- rtems_task_wake_after (1);
- }
- else {
- if (siproc (n, tty))
- break;
- }
- }
- }
- else {
- rtems_interval then, now;
- if (!tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then);
- for (;;) {
- n = (*tty->device.pollRead)(tty->minor);
- if (n < 0) {
- if (tty->termios.c_cc[VMIN]) {
- if (tty->termios.c_cc[VTIME] && tty->ccount) {
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- if ((now - then) > tty->vtimeTicks) {
- break;
- }
- }
- }
- else {
- if (!tty->termios.c_cc[VTIME])
- break;
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- if ((now - then) > tty->vtimeTicks) {
- break;
- }
- }
- rtems_task_wake_after (1);
- }
- else {
- siproc (n, tty);
- if (tty->ccount >= tty->termios.c_cc[VMIN])
- break;
- if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then);
- }
- }
- }
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Fill the input buffer from the raw input queue
- */
-static rtems_status_code
-fillBufferQueue (struct rtems_termios_tty *tty)
-{
- rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout;
- rtems_status_code sc;
-
- for (;;) {
- /*
- * Process characters read from raw queue
- */
- while (tty->rawInBufHead != tty->rawInBufTail) {
- unsigned char c;
- unsigned int newHead;
-
- newHead = (tty->rawInBufHead + 1) % RAW_INPUT_BUFFER_SIZE;
- c = tty->rawInBuf[newHead];
- tty->rawInBufHead = newHead;
- if (tty->termios.c_lflag & ICANON) {
- if (siproc (c, tty))
- return RTEMS_SUCCESSFUL;
- }
- else {
- siproc (c, tty);
- if (tty->ccount >= tty->termios.c_cc[VMIN])
- return RTEMS_SUCCESSFUL;
- }
- timeout = tty->rawInBufSemaphoreTimeout;
- }
-
- /*
- * Wait for characters
- */
- sc = rtems_semaphore_obtain (tty->rawInBufSemaphore,
- tty->rawInBufSemaphoreOptions,
- timeout);
- if (sc != RTEMS_SUCCESSFUL)
- break;
- }
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_status_code
-rtems_termios_read (void *arg)
-{
- rtems_libio_rw_args_t *args = arg;
- struct rtems_termios_tty *tty = args->iop->data1;
- unsigned32 count = args->count;
- unsigned8 *buffer = args->buffer;
- rtems_status_code sc;
-
- sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- if (tty->cindex == tty->ccount) {
- tty->cindex = tty->ccount = 0;
- tty->read_start_column = tty->column;
- if (tty->device.pollRead)
- sc = fillBufferPoll (tty);
- else
- sc = fillBufferQueue (tty);
- if (sc != RTEMS_SUCCESSFUL)
- tty->cindex = tty->ccount = 0;
- }
- while (count && (tty->cindex < tty->ccount)) {
- *buffer++ = tty->cbuf[tty->cindex++];
- count--;
- }
- args->bytes_moved = args->count - count;
- rtems_semaphore_release (tty->isem);
- return sc;
-}
-
-/*
- * Place characters on raw queue.
- * NOTE: This routine runs in the context of the
- * device receive interrupt handler.
- * Returns the number of characters dropped because of overlow.
- */
-int
-rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len)
-{
- struct rtems_termios_tty *tty = ttyp;
- unsigned int newTail;
-
- while (len) {
- newTail = (tty->rawInBufTail + 1) % RAW_INPUT_BUFFER_SIZE;
- if (newTail == tty->rawInBufHead) {
- tty->rawInBufDropped += len;
- break;
- }
- tty->rawInBuf[newTail] = *buf++;
- len--;
- tty->rawInBufTail = newTail;
- }
- rtems_semaphore_release (tty->rawInBufSemaphore);
- return len;
-}
-
-/*
- * Characters have been transmitted
- * NOTE: This routine runs in the context of the
- * device transmit interrupt handler.
- * The second argument is the number of characters transmitted so far.
- * This value will always be 1 for devices which generate an interrupt
- * for each transmitted character.
- * It returns number of characters left to transmit
- */
-int
-rtems_termios_dequeue_characters (void *ttyp, int len)
-{
- struct rtems_termios_tty *tty = ttyp;
- unsigned int newTail;
- int nToSend;
-
- if (tty->rawOutBufState == rob_wait)
- rtems_semaphore_release (tty->rawOutBufSemaphore);
- if ( tty->rawOutBufHead == tty->rawOutBufTail )
- return 0;
- newTail = (tty->rawOutBufTail + len) % RAW_OUTPUT_BUFFER_SIZE;
- if (newTail == tty->rawOutBufHead) {
- /*
- * Buffer empty
- */
- tty->rawOutBufState = rob_idle;
- nToSend = 0;
- }
- else {
- /*
- * Buffer not empty, start tranmitter
- */
- if (newTail > tty->rawOutBufHead)
- nToSend = RAW_OUTPUT_BUFFER_SIZE - newTail;
- else
- nToSend = tty->rawOutBufHead - newTail;
- (*tty->device.write)(tty->minor, (char *)&tty->rawOutBuf[newTail], nToSend);
- tty->rawOutBufState = rob_busy;
- }
- tty->rawOutBufTail = newTail;
-
- return nToSend;
-}
-
-
diff --git a/c/src/lib/libc/unixlibc.c b/c/src/lib/libc/unixlibc.c
deleted file mode 100644
index 3e757e313d..0000000000
--- a/c/src/lib/libc/unixlibc.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-
-#if defined(RTEMS_UNIXLIB)
-
-void libc_init(int reentrant)
-{
-}
-
-#else
-
-/* remove ANSI errors.
- * A program must contain at least one external-declaration
- * (X3.159-1989 p.82,L3).
- */
-void unixlibc_dummy_function( void )
-{
-}
-
-#endif
diff --git a/c/src/lib/libc/utsname.c b/c/src/lib/libc/utsname.c
deleted file mode 100644
index 7fba3d610f..0000000000
--- a/c/src/lib/libc/utsname.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * $Id$
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <sys/utsname.h>
-
-#include <rtems/system.h>
-#include <rtems/score/system.h>
-#include <rtems/score/object.h>
-
-/*PAGE
- *
- * 4.4.1 Get System Name, P1003.1b-1993, p. 90
- */
-
-int uname(
- struct utsname *name
-)
-{
- /* XXX: Here is what Solaris returns...
- sysname = SunOS
- nodename = node_name
- release = 5.3
- version = Generic_101318-12
- machine = sun4m
- */
-
- strcpy( name->sysname, "RTEMS" );
-
- sprintf( name->nodename, "Node %d\n", _Objects_Local_node );
-
- /* XXX release string is in BAD format for this routine!!! */
- strcpy( name->release, "3.2.0" );
-
- /* XXX does this have any meaning for RTEMS */
-
- strcpy( name->release, "" );
-
- sprintf( name->machine, "%s/%s", CPU_NAME, CPU_MODEL_NAME );
-
- return 0;
-}
-
-/*PAGE
- *
- * 4.5.2 Get Process Times, P1003.1b-1993, p. 92
- */
-
-clock_t times(
- struct tms *buffer
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
diff --git a/c/src/lib/libchip/Makefile.in b/c/src/lib/libchip/Makefile.in
deleted file mode 100644
index a5144ec02d..0000000000
--- a/c/src/lib/libchip/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=rtc serial
diff --git a/c/src/lib/libchip/rtc/Makefile.in b/c/src/lib/libchip/rtc/Makefile.in
deleted file mode 100644
index 724a1af380..0000000000
--- a/c/src/lib/libchip/rtc/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=librtcio.a
-LIB=${ARCH}/${LIBNAME}
-
-C_PIECES=\
- rtcprobe \
- icm7170 icm7170_reg icm7170_reg2 icm7170_reg4 icm7170_reg8 \
- m48t08 m48t08_reg m48t08_reg2 m48t08_reg4 m48t08_reg8
-
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-INSTALLED_H_FILES=$(srcdir)/rtc.h \
- $(srcdir)/icm7170.h $(srcdir)/m48t08.h
-
-SRCS=$(C_FILES) $(H_FILES) $(SYS_H_FILES) $(RTEMS_H_FILES) $(PRIVATE_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(LIBC_DEFINES)
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} preinstall $(LIB)
- $(INSTALL_VARIANT) -m 644 ${LIB} ${PROJECT_RELEASE}/lib
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
-
-# Install the library, appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-preinstall:
- $(INSTALL) -m 444 $(INSTALLED_H_FILES) $(PROJECT_INCLUDE)/libchip
-
-
diff --git a/c/src/lib/libchip/rtc/README.ds1643 b/c/src/lib/libchip/rtc/README.ds1643
deleted file mode 100644
index 4fab5b62c6..0000000000
--- a/c/src/lib/libchip/rtc/README.ds1643
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# $Id$
-#
-
-The Mostek M48T08 is compatible with the Dallas Semiconductor DS1643. Please
-use that driver.
-
diff --git a/c/src/lib/libchip/rtc/README.icm7170 b/c/src/lib/libchip/rtc/README.icm7170
deleted file mode 100644
index de2199339d..0000000000
--- a/c/src/lib/libchip/rtc/README.icm7170
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-
-
-Configuration Table Use
-=======================
-
-sDeviceName
-
- The name of this device.
-
-deviceType
-
- This field must be RTC_ICM7170.
-
-pDeviceFns
-
- The device interface control table. This must be icm7170_fns.
-
-deviceProbe
-
- This is the address of the routine which probes to see if the device
- is present.
-
-pDeviceParams
-
- This field specifies the clock frequency. It may be one of the
- following:
- ICM7170_AT_32_KHZ
- ICM7170_AT_1_MHZ
- ICM7170_AT_2_MHZ
- ICM7170_AT_4_MHZ
-
-ulCtrlPort1
-
- This field is the base address of the RTC area of the chip.
-
-ulCtrlPort2
-
- This field is ignored.
-
-ulDataPort
-
- This field is ignored.
-
-
-getRegister
-setRegister
-
- These follow standard conventions.
-
diff --git a/c/src/lib/libchip/rtc/README.m48t08 b/c/src/lib/libchip/rtc/README.m48t08
deleted file mode 100644
index d792d7957e..0000000000
--- a/c/src/lib/libchip/rtc/README.m48t08
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# $Id$
-#
-
-
-Configuration Table Use
-=======================
-
-sDeviceName
-
- The name of this device.
-
-deviceType
-
- This field must be RTC_M48T08.
-
-pDeviceFns
-
- The device interface control table. This must be m48t08_fns.
-
-deviceProbe
-
- This is the address of the routine which probes to see if the device
- is present.
-
-pDeviceParams
-
- This is ignored and should be NULL.
-
-ulCtrlPort1
-
- This field is the base address of the RTC area of the chip. The
- NVRAM portion of the chip is ignored.
-
-ulCtrlPort2
-
- This field is ignored.
-
-ulDataPort
-
- This field is ignored.
-
-
-getRegister
-setRegister
-
- These follow standard conventions.
-
diff --git a/c/src/lib/libchip/rtc/README.m48t18 b/c/src/lib/libchip/rtc/README.m48t18
deleted file mode 100644
index 85fe918f23..0000000000
--- a/c/src/lib/libchip/rtc/README.m48t18
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# $Id$
-#
-
-This is supported by the m48t08 driver.
diff --git a/c/src/lib/libchip/rtc/STATUS b/c/src/lib/libchip/rtc/STATUS
deleted file mode 100644
index e95a924ae9..0000000000
--- a/c/src/lib/libchip/rtc/STATUS
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# $Id$
-#
-
-General
-=======
-
-+ It would be nice to utilize the interrupt capabilities of some
- RTC parts. This could be used to trigger checking the software
- clock against the hardware clock.
-
-+ The periodic capability of most RTCs is not suitable for use
- as a general purpose flexible clock tick source. For example,
- many RTCs generate only a handful of periods with 100 Hz being the
- most frequent.
-
-+ The tick field is not set on get. Anything smaller than a second
- is ignored on set and get operations.
-
-+ Day of week is ignored since RTEMS does not set it internally.
-
-+ There is no attempt in RTEMS to know about time zones.
-
-Harris ICM7170
-==============
-
-+ Tested on a DMV177.
-
-+ Interrupt capabilities are ignored.
-
-Mostek 48T08
-============
-
-+ Untested.
-
-+ NVRAM is ignored.
-
diff --git a/c/src/lib/libchip/rtc/icm7170.c b/c/src/lib/libchip/rtc/icm7170.c
deleted file mode 100644
index f3cf513d2e..0000000000
--- a/c/src/lib/libchip/rtc/icm7170.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * This file interfaces with the real-time clock found in
- * a Harris ICM7170
- *
- * Year 2K Notes:
- *
- * This chip only uses a two digit field to store the year. This
- * code uses the RTEMS Epoch as a pivot year. This lets us map the
- * two digit year field as follows:
- *
- * + two digit years 0-87 are mapped to 2000-2087.
- * + two digit years 88-99 are mapped to 1988-1999.
- *
- * This is less than the time span supported by RTEMS.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <libchip/rtc.h>
-#include <libchip/icm7170.h>
-
-/*
- * Control register bits
- */
-
-/* XXX */
-
-/*
- * icm7170_initialize
- */
-
-void icm7170_initialize(
- int minor
-)
-{
- unsigned32 icm7170;
- setRegister_f setReg;
- unsigned32 clock;
-
- icm7170 = RTC_Table[ minor ].ulCtrlPort1;
- setReg = RTC_Table[ minor ].setRegister;
-
- /*
- * Initialize the RTC with the proper clock frequency
- */
-
- clock = (unsigned32) RTC_Table[ minor ].pDeviceParams;
- (*setReg)( icm7170, ICM7170_CONTROL, 0x0c | clock );
-}
-
-/*
- * icm7170_get_time
- */
-
-int icm7170_get_time(
- int minor,
- rtems_time_of_day *time
-)
-{
- unsigned32 icm7170;
- getRegister_f getReg;
- setRegister_f setReg;
- unsigned32 year;
-
- icm7170 = RTC_Table[ minor ].ulCtrlPort1;
- getReg = RTC_Table[ minor ].getRegister;
- setReg = RTC_Table[ minor ].setRegister;
-
- /*
- * Put the RTC into read mode
- */
-
- (void) (*getReg)( icm7170, ICM7170_COUNTER_HUNDREDTHS );
-
- /*
- * Now get the time
- */
-
-
- year = (*getReg)( icm7170, ICM7170_YEAR );
- if ( year < 88 )
- year += 2000;
- else
- year += 1900;
-
- time->year = year;
- time->month = (*getReg)( icm7170, ICM7170_MONTH );
- time->day = (*getReg)( icm7170, ICM7170_DATE );
- time->hour = (*getReg)( icm7170, ICM7170_HOUR );
- time->minute = (*getReg)( icm7170, ICM7170_MINUTE );
- time->second = (*getReg)( icm7170, ICM7170_SECOND );
-
- time->ticks = 0;
-
- /*
- * Put the RTC back into normal mode.
- */
-
- (void) (*getReg)( icm7170, ICM7170_COUNTER_HUNDREDTHS );
-
- return 0;
-}
-
-/*
- * icm7170_set_time
- */
-
-int icm7170_set_time(
- int minor,
- rtems_time_of_day *time
-)
-{
- unsigned32 icm7170;
- getRegister_f getReg;
- setRegister_f setReg;
- unsigned32 year;
- unsigned32 clock;
-
- icm7170 = RTC_Table[ minor ].ulCtrlPort1;
- getReg = RTC_Table[ minor ].getRegister;
- setReg = RTC_Table[ minor ].setRegister;
- clock = (unsigned32) RTC_Table[ minor ].pDeviceParams;
-
- year = time->year;
-
- if ( year >= 2088 )
- rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER );
-
- if ( year >= 2000 )
- year -= 2000;
- else
- year -= 1900;
-
- (*setReg)( icm7170, ICM7170_CONTROL, 0x04 | clock );
-
- (*setReg)( icm7170, ICM7170_YEAR, year );
- (*setReg)( icm7170, ICM7170_MONTH, time->month );
- (*setReg)( icm7170, ICM7170_DATE, time->day );
- (*setReg)( icm7170, ICM7170_HOUR, time->hour );
- (*setReg)( icm7170, ICM7170_MINUTE, time->minute );
- (*setReg)( icm7170, ICM7170_SECOND, time->second );
-
- /*
- * This is not really right.
- */
-
- (*setReg)( icm7170, ICM7170_DAY_OF_WEEK, 1 );
-
- /*
- * Put the RTC back into normal mode.
- */
-
- (*setReg)( icm7170, ICM7170_CONTROL, 0x0c | clock );
-
- return 0;
-}
-
-/*
- * Driver function table
- */
-
-rtc_fns icm7170_fns = {
- icm7170_initialize,
- icm7170_get_time,
- icm7170_set_time
-};
-
diff --git a/c/src/lib/libchip/rtc/icm7170.h b/c/src/lib/libchip/rtc/icm7170.h
deleted file mode 100644
index 5bf9fd065c..0000000000
--- a/c/src/lib/libchip/rtc/icm7170.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * This file contains the definitions for the following real-time clocks:
- *
- * + Harris Semiconduction ICM7170
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __LIBCHIP_ICM7170_h
-#define __LIBCHIP_ICM7170_h
-
-/*
- * Register indices
- */
-
-#define ICM7170_CONTROL 0x11
-
-
-#define ICM7170_COUNTER_HUNDREDTHS 0x00
-#define ICM7170_HOUR 0x01
-#define ICM7170_MINUTE 0x02
-#define ICM7170_SECOND 0x03
-#define ICM7170_MONTH 0x04
-#define ICM7170_DATE 0x05
-#define ICM7170_YEAR 0x06
-#define ICM7170_DAY_OF_WEEK 0x07
-
-/*
- * Configuration information in the parameters field
- */
-
-#define ICM7170_AT_32_KHZ 0x00
-#define ICM7170_AT_1_MHZ 0x01
-#define ICM7170_AT_2_MHZ 0x02
-#define ICM7170_AT_4_MHZ 0x03
-
-/*
- * Driver function table
- */
-
-extern rtc_fns icm7170_fns;
-
-/*
- * Default register access routines
- */
-
-unsigned32 icm7170_get_register( /* registers are at 1 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void icm7170_set_register(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-unsigned32 icm7170_get_register_2( /* registers are at 2 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void icm7170_set_register_2(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-unsigned32 icm7170_get_register_4( /* registers are at 4 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void icm7170_set_register_4(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-unsigned32 icm7170_get_register_8( /* registers are at 8 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void icm7170_set_register_8(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libchip/rtc/icm7170_reg.c b/c/src/lib/libchip/rtc/icm7170_reg.c
deleted file mode 100644
index b6961824b6..0000000000
--- a/c/src/lib/libchip/rtc/icm7170_reg.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the icm7170 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are only byte-aligned (no address gaps)
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#ifndef _ICM7170_MULTIPLIER
-#define _ICM7170_MULTIPLIER 1
-#define _ICM7170_NAME(_X) _X
-#define _ICM7170_TYPE unsigned8
-#endif
-
-#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
- (_ICM7170_TYPE *)((_base) + ((_reg) * _ICM7170_MULTIPLIER ))
-
-/*
- * ICM7170 Get Register Routine
- */
-
-unsigned32 _ICM7170_NAME(icm7170_get_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum
-)
-{
- _ICM7170_TYPE *port;
-
- port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
-
- return *port;
-}
-
-/*
- * ICM7170 Set Register Routine
- */
-
-void _ICM7170_NAME(icm7170_set_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-)
-{
- _ICM7170_TYPE *port;
-
- port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
-
- *port = ucData;
-}
diff --git a/c/src/lib/libchip/rtc/icm7170_reg2.c b/c/src/lib/libchip/rtc/icm7170_reg2.c
deleted file mode 100644
index bab92697bf..0000000000
--- a/c/src/lib/libchip/rtc/icm7170_reg2.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the icm7170 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 16-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _ICM7170_MULTIPLIER 2
-#define _ICM7170_NAME(_X) _X##_2
-#define _ICM7170_TYPE unsigned8
-
-#include "icm7170_reg.c"
-
diff --git a/c/src/lib/libchip/rtc/icm7170_reg4.c b/c/src/lib/libchip/rtc/icm7170_reg4.c
deleted file mode 100644
index 896e0cbc0b..0000000000
--- a/c/src/lib/libchip/rtc/icm7170_reg4.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the icm7170 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 32-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _ICM7170_MULTIPLIER 4
-#define _ICM7170_NAME(_X) _X##_4
-#define _ICM7170_TYPE unsigned8
-
-#include "icm7170_reg.c"
-
diff --git a/c/src/lib/libchip/rtc/icm7170_reg8.c b/c/src/lib/libchip/rtc/icm7170_reg8.c
deleted file mode 100644
index d2ed2844ac..0000000000
--- a/c/src/lib/libchip/rtc/icm7170_reg8.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the icm7170 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 64-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _ICM7170_MULTIPLIER 8
-#define _ICM7170_NAME(_X) _X##_8
-#define _ICM7170_TYPE unsigned8
-
-#include "icm7170_reg.c"
-
diff --git a/c/src/lib/libchip/rtc/m48t08.c b/c/src/lib/libchip/rtc/m48t08.c
deleted file mode 100644
index b3d0dcb0de..0000000000
--- a/c/src/lib/libchip/rtc/m48t08.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * This file interfaces with the real-time clock found in
- * a Mostek M48T08 or M48T18 or compatibles.
- *
- * Year 2K Notes:
- *
- * This chip only uses a two digit field to store the year. This
- * code uses the RTEMS Epoch as a pivot year. This lets us map the
- * two digit year field as follows:
- *
- * + two digit years 0-87 are mapped to 2000-2087.
- * + two digit years 88-99 are mapped to 1988-1999.
- *
- * This is less than the time span supported by RTEMS.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <libchip/rtc.h>
-#include <libchip/m48t08.h>
-
-/*
- * Control register bits
- */
-
-#define M48T08_CONTROL_WRITE 0x80
-#define M48T08_CONTROL_READ 0x40
-#define M48T08_CONTROL_SIGN 0x20
-
-/*
- * m48t08_initialize
- */
-
-void m48t08_initialize(
- int minor
-)
-{
-}
-
-/*
- * m48t08_get_time
- */
-
-#define From_BCD( _x ) ((((_x) >> 4) * 10) + ((_x) & 0x0F))
-#define To_BCD( _x ) ((((_x) / 10) << 4) + ((_x) % 10))
-
-int m48t08_get_time(
- int minor,
- rtems_time_of_day *time
-)
-{
- unsigned32 m48t08;
- getRegister_f getReg;
- setRegister_f setReg;
- unsigned8 controlReg;
- unsigned32 value1;
- unsigned32 value2;
-
- m48t08 = RTC_Table[ minor ].ulCtrlPort1;
- getReg = RTC_Table[ minor ].getRegister;
- setReg = RTC_Table[ minor ].setRegister;
-
- /*
- * Put the RTC into read mode
- */
-
- controlReg = (*getReg)( m48t08, M48T08_CONTROL );
- (*setReg)( m48t08, M48T08_CONTROL, controlReg | M48T08_CONTROL_READ );
-
- value1 = (*getReg)( m48t08, M48T08_YEAR );
- value2 = From_BCD( value1 );
- if ( value2 < 88 )
- time->year = 2000 + value2;
- else
- time->year = 1900 + value2;
-
- value1 = (*getReg)( m48t08, M48T08_MONTH );
- time->month = From_BCD( value1 );
-
- value1 = (*getReg)( m48t08, M48T08_DATE );
- time->day = From_BCD( value1 );
-
- value1 = (*getReg)( m48t08, M48T08_HOUR );
- time->hour = From_BCD( value1 );
-
- value1 = (*getReg)( m48t08, M48T08_MINUTE );
- time->minute = From_BCD( value1 );
-
- value1 = (*getReg)( m48t08, M48T08_SECOND );
- time->second = From_BCD( value1 );
-
- time->ticks = 0;
-
- /*
- * Put the RTC back into normal mode.
- */
-
- (*setReg)( m48t08, M48T08_CONTROL, controlReg );
-
- return 0;
-}
-
-/*
- * m48t08_set_time
- */
-
-int m48t08_set_time(
- int minor,
- rtems_time_of_day *time
-)
-{
- unsigned32 m48t08;
- getRegister_f getReg;
- setRegister_f setReg;
- unsigned8 controlReg;
-
- m48t08 = RTC_Table[ minor ].ulCtrlPort1;
- getReg = RTC_Table[ minor ].getRegister;
- setReg = RTC_Table[ minor ].setRegister;
-
- /*
- * Put the RTC into read mode
- */
-
- controlReg = (*getReg)( m48t08, M48T08_CONTROL );
- (*setReg)( m48t08, M48T08_CONTROL, controlReg | M48T08_CONTROL_WRITE );
-
- if ( time->year >= 2088 )
- rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER );
-
- (*setReg)( m48t08, M48T08_YEAR, To_BCD(time->year % 100) );
- (*setReg)( m48t08, M48T08_MONTH, To_BCD(time->month) );
- (*setReg)( m48t08, M48T08_DATE, To_BCD(time->day) );
- (*setReg)( m48t08, M48T08_HOUR, To_BCD(time->hour) );
- (*setReg)( m48t08, M48T08_MINUTE, To_BCD(time->minute) );
- (*setReg)( m48t08, M48T08_SECOND, To_BCD(time->second) );
-
- /*
- * Put the RTC back into normal mode.
- */
-
- (*setReg)( m48t08, M48T08_CONTROL, controlReg );
-
- return 0;
-}
-
-/*
- * Driver function table
- */
-
-rtc_fns m48t08_fns = {
- m48t08_initialize,
- m48t08_get_time,
- m48t08_set_time
-};
-
diff --git a/c/src/lib/libchip/rtc/m48t08.h b/c/src/lib/libchip/rtc/m48t08.h
deleted file mode 100644
index 7d27215e1e..0000000000
--- a/c/src/lib/libchip/rtc/m48t08.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * This file contains the definitions for the following real-time clocks:
- *
- * + Mostek M48T08
- * + Mostek M48T18
- * + Dallas Semiconductor DS1643
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __LIBCHIP_M48T08_h
-#define __LIBCHIP_M48T08_h
-
-/*
- * Register indices
- */
-
-#define M48T08_CONTROL 0
-#define M48T08_SECOND 1
-#define M48T08_MINUTE 2
-#define M48T08_HOUR 3
-#define M48T08_DAY_OF_WEEK 4
-#define M48T08_DATE 5
-#define M48T08_MONTH 6
-#define M48T08_YEAR 7
-
-/*
- * Driver function table
- */
-
-extern rtc_fns m48t08_fns;
-
-/*
- * Default register access routines
- */
-
-unsigned32 m48t08_get_register( /* registers are at 1 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void m48t08_set_register(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-unsigned32 m48t08_get_register_2( /* registers are at 2 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void m48t08_set_register_2(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-unsigned32 m48t08_get_register_4( /* registers are at 4 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void m48t08_set_register_4(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-unsigned32 m48t08_get_register_8( /* registers are at 8 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void m48t08_set_register_8(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libchip/rtc/m48t08_reg.c b/c/src/lib/libchip/rtc/m48t08_reg.c
deleted file mode 100644
index abb37c628c..0000000000
--- a/c/src/lib/libchip/rtc/m48t08_reg.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the m48t08 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are only byte-aligned (no address gaps)
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#ifndef _M48T08_MULTIPLIER
-#define _M48T08_MULTIPLIER 1
-#define _M48T08_NAME(_X) _X
-#define _M48T08_TYPE unsigned8
-#endif
-
-#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
- (_M48T08_TYPE *)((_base) + ((_reg) * _M48T08_MULTIPLIER ))
-
-/*
- * M48T08 Get Register Routine
- */
-
-unsigned32 _M48T08_NAME(m48t08_get_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum
-)
-{
- _M48T08_TYPE *port;
-
- port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
-
- return *port;
-}
-
-/*
- * M48T08 Set Register Routine
- */
-
-void _M48T08_NAME(m48t08_set_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-)
-{
- _M48T08_TYPE *port;
-
- port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
-
- *port = ucData;
-}
diff --git a/c/src/lib/libchip/rtc/m48t08_reg2.c b/c/src/lib/libchip/rtc/m48t08_reg2.c
deleted file mode 100644
index a6f294a3f7..0000000000
--- a/c/src/lib/libchip/rtc/m48t08_reg2.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the m48t08 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 16-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _M48T08_MULTIPLIER 2
-#define _M48T08_NAME(_X) _X##_2
-#define _M48T08_TYPE unsigned8
-
-#include "m48t08_reg.c"
-
diff --git a/c/src/lib/libchip/rtc/m48t08_reg4.c b/c/src/lib/libchip/rtc/m48t08_reg4.c
deleted file mode 100644
index a84b988a34..0000000000
--- a/c/src/lib/libchip/rtc/m48t08_reg4.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the m48t08 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 32-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _M48T08_MULTIPLIER 4
-#define _M48T08_NAME(_X) _X##_4
-#define _M48T08_TYPE unsigned8
-
-#include "m48t08_reg.c"
-
diff --git a/c/src/lib/libchip/rtc/m48t08_reg8.c b/c/src/lib/libchip/rtc/m48t08_reg8.c
deleted file mode 100644
index dcc2a9b39b..0000000000
--- a/c/src/lib/libchip/rtc/m48t08_reg8.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the m48t08 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 64-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _M48T08_MULTIPLIER 8
-#define _M48T08_NAME(_X) _X##_8
-#define _M48T08_TYPE unsigned8
-
-#include "m48t08_reg.c"
-
diff --git a/c/src/lib/libchip/rtc/rtc.h b/c/src/lib/libchip/rtc/rtc.h
deleted file mode 100644
index 94b42e3f34..0000000000
--- a/c/src/lib/libchip/rtc/rtc.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * This file contains the Real-Time Clock definitions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __LIBCHIP_RTC_h
-#define __LIBCHIP_RTC_h
-
-/*
- * Types for get and set register routines
- */
-
-typedef unsigned32 (*getRegister_f)(unsigned32 port, unsigned8 register);
-typedef void (*setRegister_f)(
- unsigned32 port, unsigned8 reg, unsigned32 value);
-
-typedef struct _rtc_fns {
- void (*deviceInitialize)(int minor);
- int (*deviceGetTime)(int minor, rtems_time_of_day *time);
- int (*deviceSetTime)(int minor, rtems_time_of_day *time);
-} rtc_fns;
-
-typedef enum {
- RTC_M48T08, /* SGS-Thomsom M48T08 or M48T18 */
- RTC_ICM7170, /* Harris ICM-7170 */
- RTC_CUSTOM /* BSP specific driver */
-} rtc_devs;
-
-/*
- * Each field is interpreted thus:
- *
- * sDeviceName This is the name of the device.
- *
- * deviceType This indicates the chip type.
- *
- * pDeviceFns This is a pointer to the set of driver routines to use.
- *
- * pDeviceParams This contains either device specific data or a pointer to a
- * device specific information table.
- *
- * ulCtrlPort1 This is the primary control port number for the device.
- *
- * ulCtrlPort2 This is the secondary control port number.
- *
- * ulDataPort This is the port number for the data port of the device
- *
- * getRegister This is the routine used to read register values.
- *
- * setRegister This is the routine used to write register values.
- */
-
-typedef struct _rtc_tbl {
- char *sDeviceName;
- rtc_devs deviceType;
- rtc_fns *pDeviceFns;
- boolean (*deviceProbe)(int minor);
- void *pDeviceParams;
- unsigned32 ulCtrlPort1;
- unsigned32 ulDataPort;
- getRegister_f getRegister;
- setRegister_f setRegister;
-} rtc_tbl;
-
-extern rtc_tbl RTC_Table[];
-extern unsigned long RTC_Count;
-
-
-boolean rtc_probe( int minor );
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libchip/rtc/rtcprobe.c b/c/src/lib/libchip/rtc/rtcprobe.c
deleted file mode 100644
index 6aaad89486..0000000000
--- a/c/src/lib/libchip/rtc/rtcprobe.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains the default Real-Time Clock probe routine.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <libchip/rtc.h>
-
-
-boolean rtc_probe(
- int minor
-)
-{
- return TRUE;
-}
diff --git a/c/src/lib/libchip/serial/Makefile.in b/c/src/lib/libchip/serial/Makefile.in
deleted file mode 100644
index d9c78faf97..0000000000
--- a/c/src/lib/libchip/serial/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=libserialio.a
-LIB=${ARCH}/${LIBNAME}
-
-C_PIECES=\
- mc68681 mc68681_baud mc68681_reg mc68681_reg2 mc68681_reg4 mc68681_reg8 \
- ns16550 \
- z85c30 z85c30_reg \
- serprobe termios_baud2index termios_baud2num
-
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-INSTALLED_H_FILES=$(srcdir)/mc68681.h $(srcdir)/ns16550.h $(srcdir)/z85c30.h \
- $(srcdir)/serial.h
-SRCS=$(C_FILES) $(H_FILES) $(SYS_H_FILES) $(RTEMS_H_FILES) $(PRIVATE_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(LIBC_DEFINES)
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} preinstall $(LIB)
- $(INSTALL_VARIANT) -m 644 ${LIB} ${PROJECT_RELEASE}/lib
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
-
-# Install the library, appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-preinstall:
- $(INSTALL) -m 444 $(INSTALLED_H_FILES) $(PROJECT_INCLUDE)/libchip
-
-
diff --git a/c/src/lib/libchip/serial/README b/c/src/lib/libchip/serial/README
deleted file mode 100644
index 3a1013b45b..0000000000
--- a/c/src/lib/libchip/serial/README
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# $Id$
-#
-
-This is the serial controller portion of the libchip library. This
-directory contains the source code for reusable console driver
-support code. Each individual driver is configured using the
-console_tbl data structure. This structure is defined and explained
-in the console.h file.
-
-The reusable chip drivers do not directly access the serial controller.
-They access the registers on the controller via a set of up to four
-functions which are provided by the BSP. These functins set and get
-general registers and data buffers. Some chips can access the data
-buffers as general registers and thus the driver may not require
-those interface routines.
-
diff --git a/c/src/lib/libchip/serial/README.mc68681 b/c/src/lib/libchip/serial/README.mc68681
deleted file mode 100644
index 240faf759b..0000000000
--- a/c/src/lib/libchip/serial/README.mc68681
+++ /dev/null
@@ -1,87 +0,0 @@
-#
-# $Id$
-#
-
-Configuration Table Use
-=======================
-
-sDeviceName
-
- The name of this device.
-
-deviceType
-
- This field must be SERIAL_MC68681.
-
-pDeviceFns
-
- The device interface control table. This may be:
- + mc68681_fns for interrupt driven IO
- + mc68681_fns_polled for polled IO
-
-deviceProbe
-
- This is the address of the routine which probes to see if the device
- is present.
-
-pDeviceFlow
-
- This field is ignored as hardware flow control is not currently supported.
-
-ulMargin
-
- This is currently unused.
-
-ulHysteresis
-
- This is currently unused.
-
-pDeviceParams
-
- This is set to the default settings.
-
-ulCtrlPort1
-
- This field is the base address of the entire DUART.
-
-ulCtrlPort2
-
- This field is the base address of the port specific registers.
-
-ulDataPort
-
- This field is bit mapped as follows:
- bit 0: baud rate set a or b
- bit 1-2: BRG selection ("Select Extend bit")
-
- Note: If both ports on single DUART are not configured for the same
- baud rate set, then unexpected results will occur.
-
- Note: On the Exar 88c681, if a standard clock of 3.6864 Mhz is used
- and the "Select Extend bit" is 0 (disabled), then the default
- MC68681 baud rate table is selected.
-
-getRegister
-setRegister
-
- These follow standard conventions.
-
-getData
-setData
-
- These are unused since the TX and RX data registers can be accessed
- as regular registers.
-
-ulClock
-
- This is a pointer to a baud rate mapping table. If set to
- mc68681_baud_rate_table, then the CSR/ACR/X bit mappings shown
- in the 68681 and 88681 manuals are used. Otherwise, the board
- specific baud rate mapping is used.
-
- NULL is not a valid value.
-
-ulIntVector
-
- This is the interrupt vector number associated with this chip.
-
diff --git a/c/src/lib/libchip/serial/README.ns16550 b/c/src/lib/libchip/serial/README.ns16550
deleted file mode 100644
index 2956173b1b..0000000000
--- a/c/src/lib/libchip/serial/README.ns16550
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# $Id$
-#
-
-This driver needs to be debugged before this is written.
diff --git a/c/src/lib/libchip/serial/README.xr88681 b/c/src/lib/libchip/serial/README.xr88681
deleted file mode 100644
index 37364aaec6..0000000000
--- a/c/src/lib/libchip/serial/README.xr88681
+++ /dev/null
@@ -1,6 +0,0 @@
-#
-# $Id$
-#
-
-The Exar XR88681 is an enhanced version of the Motorola MC68681 and is
-supported by the mc68681 driver.
diff --git a/c/src/lib/libchip/serial/README.z85c30 b/c/src/lib/libchip/serial/README.z85c30
deleted file mode 100644
index 4442b5ef40..0000000000
--- a/c/src/lib/libchip/serial/README.z85c30
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# $Id$
-#
-
-Configuration Table Use
-=======================
-
-sDeviceName
-
- The name of this device.
-
-deviceType
-
- This field must be SERIAL_Z85C30.
-
-pDeviceFns
-
- The device interface control table. This may be:
- + z85c30_fns for interrupt driven IO
- + z85c30_fns_polled for polled IO
-
-deviceProbe
-
- This is the address of the routine which probes to see if the device
- is present.
-
-pDeviceFlow
-
- This field is set to one of the following values:
- + NULL for no hardware flow control
- + z85c30_flow_RTSCTS for RTS/CTS based flow control
- + z85c30_flow_DTRCTS for DTR/CTS based flow control
-
-ulMargin
-
- This is currently unused.
-
-ulHysteresis
-
- This is currently unused.
-
-pDeviceParams
-
- This is set to the default settings.
-
-ulCtrlPort1
-
- This field is the address of the control register for this port.
-
-ulCtrlPort2
-
- This field is the address of the control register for chip.
-
-ulDataPort
-
- This field is the address of the data register for this port.
-
-getRegister
-setRegister
-
- These follow standard conventions.
-
-getData
-setData
-
- These follow standard conventions.
-
-ulClock
-
- This is the clock speed of the baud rate clock.
- NULL, then the CSR/ACR/X bit mappings shown in the 68681 and 88681
- manuals are used. Otherwise, the board specific baud rate mapping
- is used.
-
-ulIntVector
-
- This is the interrupt vector number associated with this chip.
-
diff --git a/c/src/lib/libchip/serial/STATUS b/c/src/lib/libchip/serial/STATUS
deleted file mode 100644
index 6eb7fa4171..0000000000
--- a/c/src/lib/libchip/serial/STATUS
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# $Id$
-#
-
-General
-=======
-
-+ Hardware flow control is not currently supported. Some of the chip
- drivers (in particular the z8530) have support for hardware flow control
- but this has not been tested in the libchip context. There will need
- to be a way to totally disabled hardware flow control which is not
- currently in this.
-
-+ "ulClockSpeed" configuration item field to become a pointer to a table
- of chip specific information. For example, the z8530 should specify
- clock speed and clock divisor setting.
-
-+ A termios structure should be included to specify the initial settings.
- Right now all drivers default to 9600, 8N1.
-
-+ Need to switch to passing pointers rather than a minor number to
- functions which are strictly internal to each chip driver. This
- should be a performance win.
-
-+ Need a test which prompts you for termios settings and tests them. Until
- this happens, testing for the variety of settings possible will be limited.
- This test should be able to test any serial port while prompts come to the
- console.
-
-MC68681
-=======
-
-+ Works interrupt and polled.
-
-+ Hardware flow control not included.
-
-NS16650
-=======
-
-+ Not tested in libchip context. Based on Radstone PPC2 driver which worked
- well.
-
-+ Interrupt code has been reworked to not use ring buffer and may be broken
- as it has not been tested since this was done.
-
-+ ns16550_set-attributes function is untested.
-
-+ Hardware flow control included but is currently disabled in ISR.
-
-Z85C30
-======
-
-+ Works polled and interrupt.
-
-+ Hardware flow control included but is currently disabled in ISR.
-
-+ Needs to support mode where more specific vectors are generated.
-
diff --git a/c/src/lib/libchip/serial/mc68681.c b/c/src/lib/libchip/serial/mc68681.c
deleted file mode 100644
index a917f5aa46..0000000000
--- a/c/src/lib/libchip/serial/mc68681.c
+++ /dev/null
@@ -1,756 +0,0 @@
-/*
- * This file contains the termios TTY driver for the Motorola MC68681.
- *
- * This part is available from a number of secondary sources.
- * In particular, we know about the following:
- *
- * + Exar 88c681 and 68c681
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <rtems/libio.h>
-#include <stdlib.h>
-
-#include <libchip/serial.h>
-#include <libchip/mc68681.h>
-#include "sersupp.h"
-#include "mc68681_p.h"
-
-/*
- * Flow control is only supported when using interrupts
- */
-
-console_fns mc68681_fns =
-{
- libchip_serial_default_probe, /* deviceProbe */
- mc68681_open, /* deviceFirstOpen */
- NULL, /* deviceLastClose */
- NULL, /* deviceRead */
- mc68681_write_support_int, /* deviceWrite */
- mc68681_initialize_interrupts, /* deviceInitialize */
- mc68681_write_polled, /* deviceWritePolled */
- mc68681_set_attributes, /* deviceSetAttributes */
- TRUE /* deviceOutputUsesInterrupts */
-};
-
-console_fns mc68681_fns_polled =
-{
- libchip_serial_default_probe, /* deviceProbe */
- mc68681_open, /* deviceFirstOpen */
- mc68681_close, /* deviceLastClose */
- mc68681_inbyte_nonblocking_polled, /* deviceRead */
- mc68681_write_support_polled, /* deviceWrite */
- mc68681_init, /* deviceInitialize */
- mc68681_write_polled, /* deviceWritePolled */
- mc68681_set_attributes, /* deviceSetAttributes */
- FALSE, /* deviceOutputUsesInterrupts */
-};
-
-extern void set_vector( rtems_isr_entry, rtems_vector_number, int );
-
-/*
- * Console Device Driver Entry Points
- */
-
-/*
- * mc68681_baud_rate
- *
- * This routine returns the proper ACR bit and baud rate field values
- * based on the requested baud rate. The baud rate set to be used
- * must be configured by the user.
- */
-
-MC68681_STATIC int mc68681_baud_rate(
- int minor,
- int baud,
- unsigned int *baud_mask_p,
- unsigned int *acr_bit_p,
- unsigned int *command
-);
-
-/*
- * mc68681_set_attributes
- *
- * This function sets the DUART channel to reflect the requested termios
- * port settings.
- */
-
-MC68681_STATIC int mc68681_set_attributes(
- int minor,
- const struct termios *t
-)
-{
- unsigned32 pMC68681_port;
- unsigned32 pMC68681;
- unsigned int mode1;
- unsigned int mode2;
- unsigned int baud_mask;
- unsigned int acr_bit;
- unsigned int cmd;
- setRegister_f setReg;
- rtems_interrupt_level Irql;
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Set the baud rate
- */
-
- if (mc68681_baud_rate( minor, t->c_cflag, &baud_mask, &acr_bit, &cmd ) == -1)
- return -1;
-
- baud_mask |= baud_mask << 4;
- acr_bit <<= 7;
-
- /*
- * Parity
- */
-
- mode1 = 0;
- mode2 = 0;
-
- if (t->c_cflag & PARENB) {
- if (t->c_cflag & PARODD)
- mode1 |= 0x04;
- else
- mode1 |= 0x04;
- } else {
- mode1 |= 0x10;
- }
-
- /*
- * Character Size
- */
-
- if (t->c_cflag & CSIZE) {
- switch (t->c_cflag & CSIZE) {
- case CS5: break;
- case CS6: mode1 |= 0x01; break;
- case CS7: mode1 |= 0x02; break;
- case CS8: mode1 |= 0x03; break;
- }
- } else {
- mode1 |= 0x03; /* default to 9600,8,N,1 */
- }
-
- /*
- * Stop Bits
- */
-
- if (t->c_cflag & CSTOPB) {
- mode2 |= 0x07; /* 2 stop bits */
- } else {
- if ((t->c_cflag & CSIZE) == CS5) /* CS5 and 2 stop bits not supported */
- return -1;
- mode2 |= 0x0F; /* 1 stop bit */
- }
-
- rtems_interrupt_disable(Irql);
- (*setReg)( pMC68681, MC68681_AUX_CTRL_REG, acr_bit );
- (*setReg)( pMC68681_port, MC68681_CLOCK_SELECT, baud_mask );
- if ( cmd ) {
- (*setReg)( pMC68681_port, MC68681_COMMAND, cmd ); /* RX */
- (*setReg)( pMC68681_port, MC68681_COMMAND, cmd | 0x20 ); /* TX */
- }
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_RESET_MR_PTR );
- (*setReg)( pMC68681_port, MC68681_MODE, mode1 );
- (*setReg)( pMC68681_port, MC68681_MODE, mode2 );
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * mc68681_initialize_context
- *
- * This function sets the default values of the per port context structure.
- */
-
-MC68681_STATIC void mc68681_initialize_context(
- int minor,
- mc68681_context *pmc68681Context
-)
-{
- int port;
- unsigned int pMC68681;
- unsigned int pMC68681_port;
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
-
- pmc68681Context->mate = -1;
-
- for (port=0 ; port<Console_Port_Count ; port++ ) {
- if ( Console_Port_Tbl[port].ulCtrlPort1 == pMC68681 &&
- Console_Port_Tbl[port].ulCtrlPort2 != pMC68681_port ) {
- pmc68681Context->mate = port;
- pmc68681Context->imr = 0;
- break;
- }
- }
-
-}
-
-/*
- * mc68681_init
- *
- * This function initializes the DUART to a quiecsent state.
- */
-
-MC68681_STATIC void mc68681_init(int minor)
-{
- unsigned32 pMC68681_port;
- unsigned32 pMC68681;
- mc68681_context *pmc68681Context;
- setRegister_f setReg;
- getRegister_f getReg;
-
- pmc68681Context = (mc68681_context *) malloc(sizeof(mc68681_context));
-
- Console_Port_Data[minor].pDeviceContext = (void *)pmc68681Context;
-
- mc68681_initialize_context( minor, pmc68681Context );
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- setReg = Console_Port_Tbl[minor].setRegister;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- /*
- * Reset everything and leave this port disabled.
- */
-
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_RESET_RX );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_RESET_TX );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_RESET_ERROR );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_RESET_BREAK );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_STOP_BREAK );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_DISABLE_TX );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_DISABLE_RX );
-
-
- (*setReg)( pMC68681_port, MC68681_MODE_REG_1A, 0x00 );
- (*setReg)( pMC68681_port, MC68681_MODE_REG_2A, 0x02 );
-
- /*
- * Disable interrupts on RX and TX for this port
- */
-
- mc68681_enable_interrupts( minor, MC68681_IMR_DISABLE_ALL );
-}
-
-/*
- * mc68681_open
- *
- * This function opens a port for communication.
- *
- * Default state is 9600 baud, 8 bits, No parity, and 1 stop bit.
- */
-
-MC68681_STATIC int mc68681_open(
- int major,
- int minor,
- void *arg
-)
-{
- unsigned32 pMC68681;
- unsigned32 pMC68681_port;
- unsigned int baud;
- unsigned int acr;
- unsigned int vector;
- unsigned int command;
- rtems_interrupt_level Irql;
- setRegister_f setReg;
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- setReg = Console_Port_Tbl[minor].setRegister;
- vector = Console_Port_Tbl[minor].ulIntVector;
-
- /* XXX default baud rate should be from configuration table */
-
- (void) mc68681_baud_rate( minor, B9600, &baud, &acr, &command );
-
- /*
- * Set the DUART channel to a default useable state
- */
-
- rtems_interrupt_disable(Irql);
- (*setReg)( pMC68681, MC68681_AUX_CTRL_REG, acr );
- (*setReg)( pMC68681_port, MC68681_CLOCK_SELECT, baud );
- if ( command ) {
- (*setReg)( pMC68681_port, MC68681_COMMAND, command ); /* RX */
- (*setReg)( pMC68681_port, MC68681_COMMAND, command | 0x20 ); /* TX */
- }
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_RESET_MR_PTR );
- (*setReg)( pMC68681_port, MC68681_MODE, 0x13 );
- (*setReg)( pMC68681_port, MC68681_MODE, 0x07 );
- rtems_interrupt_enable(Irql);
-
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_ENABLE_TX );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_ENABLE_RX );
-
- (*setReg)( pMC68681, MC68681_INTERRUPT_VECTOR_REG, vector );
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * mc68681_close
- *
- * This function shuts down the requested port.
- */
-
-MC68681_STATIC int mc68681_close(
- int major,
- int minor,
- void *arg
-)
-{
- unsigned32 pMC68681;
- unsigned32 pMC68681_port;
- setRegister_f setReg;
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Disable interrupts from this channel and then disable it totally.
- */
-
-#if 0
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_DISABLE_TX );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_DISABLE_RX );
-#endif
-
- return(RTEMS_SUCCESSFUL);
-}
-
-/*
- * mc68681_write_polled
- *
- * This routine polls out the requested character.
- */
-
-MC68681_STATIC void mc68681_write_polled(
- int minor,
- char cChar
-)
-{
- unsigned32 pMC68681_port;
- unsigned char ucLineStatus;
- int iTimeout;
- getRegister_f getReg;
- setRegister_f setReg;
-
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- getReg = Console_Port_Tbl[minor].getRegister;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * wait for transmitter holding register to be empty
- */
- iTimeout = 1000;
- ucLineStatus = (*getReg)(pMC68681_port, MC68681_STATUS);
- while ((ucLineStatus & (MC68681_TX_READY|MC68681_TX_EMPTY)) == 0) {
-
- if ((ucLineStatus & 0xF0))
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_RESET_ERROR );
-
- /*
- * Yield while we wait
- */
-
-#if 0
- if(_System_state_Is_up(_System_state_Get())) {
- rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
- }
-#endif
- ucLineStatus = (*getReg)(pMC68681_port, MC68681_STATUS);
- if(!--iTimeout) {
- break;
- }
- }
-
- /*
- * transmit character
- */
-
- (*setReg)(pMC68681_port, MC68681_TX_BUFFER, cChar);
-}
-
-/*
- * mc68681_isr
- *
- * This is the single interrupt entry point which parcels interrupts
- * out to the various ports.
- */
-
-MC68681_STATIC rtems_isr mc68681_isr(
- rtems_vector_number vector
-)
-{
- int minor;
-
- for(minor=0 ; minor<Console_Port_Count ; minor++) {
- if(Console_Port_Tbl[minor].ulIntVector == vector &&
- Console_Port_Tbl[minor].deviceType == SERIAL_MC68681 ) {
- mc68681_process(minor);
- }
- }
-}
-
-/*
- * mc68681_initialize_interrupts
- *
- * This routine initializes the console's receive and transmit
- * ring buffers and loads the appropriate vectors to handle the interrupts.
- */
-
-MC68681_STATIC void mc68681_initialize_interrupts(int minor)
-{
- mc68681_init(minor);
-
- Console_Port_Data[minor].bActive = FALSE;
-
- set_vector(mc68681_isr, Console_Port_Tbl[minor].ulIntVector, 1);
-
- mc68681_enable_interrupts(minor,MC68681_IMR_ENABLE_ALL_EXCEPT_TX);
-}
-
-/*
- * mc68681_write_support_int
- *
- * Console Termios output entry point when using interrupt driven output.
- */
-
-MC68681_STATIC int mc68681_write_support_int(
- int minor,
- const char *buf,
- int len
-)
-{
- unsigned32 Irql;
- unsigned32 pMC68681_port;
- setRegister_f setReg;
-
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * We are using interrupt driven output and termios only sends us
- * one character at a time.
- */
-
- if ( !len )
- return 0;
-
- /*
- * Put the character out and enable interrupts if necessary.
- */
-
- rtems_interrupt_disable(Irql);
- if ( Console_Port_Data[minor].bActive == FALSE ) {
- Console_Port_Data[minor].bActive = TRUE;
- mc68681_enable_interrupts(minor, MC68681_IMR_ENABLE_ALL);
- }
- (*setReg)(pMC68681_port, MC68681_TX_BUFFER, *buf);
- rtems_interrupt_enable(Irql);
-
- return 1;
-}
-
-/*
- * mc68681_write_support_polled
- *
- * Console Termios output entry point when using polled output.
- *
- */
-
-MC68681_STATIC int mc68681_write_support_polled(
- int minor,
- const char *buf,
- int len
-)
-{
- int nwrite = 0;
-
- /*
- * poll each byte in the string out of the port.
- */
- while (nwrite < len) {
- /*
- * transmit character
- */
- mc68681_write_polled(minor, *buf++);
- nwrite++;
- }
-
- /*
- * return the number of bytes written.
- */
- return nwrite;
-}
-
-/*
- * mc68681_inbyte_nonblocking_polled
- *
- * Console Termios polling input entry point.
- */
-
-MC68681_STATIC int mc68681_inbyte_nonblocking_polled(
- int minor
-)
-{
- unsigned32 pMC68681_port;
- unsigned char ucLineStatus;
- unsigned char cChar;
- getRegister_f getReg;
-
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- ucLineStatus = (*getReg)(pMC68681_port, MC68681_STATUS);
- if(ucLineStatus & MC68681_RX_READY) {
- cChar = (*getReg)(pMC68681_port, MC68681_RX_BUFFER);
- return (int)cChar;
- } else {
- return -1;
- }
-}
-
-/*
- * mc68681_baud_rate
- */
-
-MC68681_STATIC int mc68681_baud_rate(
- int minor,
- int baud,
- unsigned int *baud_mask_p,
- unsigned int *acr_bit_p,
- unsigned int *command
-)
-{
- unsigned int baud_mask;
- unsigned int acr_bit;
- int status;
- int is_extended;
- int baud_requested;
- mc68681_baud_table_t *baud_tbl;
-
- baud_mask = 0;
- acr_bit = 0;
- status = 0;
-
- if ( !(Console_Port_Tbl[minor].ulDataPort & MC68681_DATA_BAUD_RATE_SET_1) )
- acr_bit = 1;
-
- is_extended = 0;
-
- switch (Console_Port_Tbl[minor].ulDataPort & MC68681_XBRG_MASK) {
- case MC68681_XBRG_IGNORED:
- *command = 0x00;
- break;
- case MC68681_XBRG_ENABLED:
- *command = 0x80;
- is_extended = 1;
- break;
- case MC68681_XBRG_DISABLED:
- *command = 0x90;
- break;
- }
-
- baud_requested = baud & CBAUD;
- if (!baud_requested)
- baud_requested = B9600; /* default to 9600 baud */
-
- baud_requested = termios_baud_to_index( baud_requested );
-
- baud_tbl = (mc68681_baud_table_t *) Console_Port_Tbl[minor].ulClock;
- if (!baud_tbl)
- rtems_fatal_error_occurred(RTEMS_INVALID_ADDRESS);
-
- if ( is_extended )
- baud_mask = (unsigned int)baud_tbl[ acr_bit + 2 ][ baud_requested ];
- else
- baud_mask = baud_tbl[ acr_bit ][ baud_requested ];
-
- if ( baud_mask == MC68681_BAUD_NOT_VALID )
- status = -1;
-
- /*
- * upper nibble is receiver and lower nibble is transmitter
- */
-
- *baud_mask_p = (baud_mask << 4) | baud_mask;
- *acr_bit_p = acr_bit;
- return status;
-}
-
-/*
- * mc68681_process
- *
- * This routine is the per port console interrupt handler.
- */
-
-MC68681_STATIC void mc68681_process(
- int minor
-)
-{
- unsigned32 pMC68681;
- unsigned32 pMC68681_port;
- volatile unsigned8 ucLineStatus;
- unsigned char cChar;
- getRegister_f getReg;
- setRegister_f setReg;
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- getReg = Console_Port_Tbl[minor].getRegister;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Deal with any received characters
- */
- while(TRUE) {
- ucLineStatus = (*getReg)(pMC68681_port, MC68681_STATUS);
- if(!(ucLineStatus & MC68681_RX_READY)) {
- break;
- }
- /*
- * If there is a RX error, then dump all the data.
- */
- if ( ucLineStatus & MC68681_RX_ERRORS ) {
- do {
- cChar = (*getReg)(pMC68681_port, MC68681_RX_BUFFER);
- ucLineStatus = (*getReg)(pMC68681_port, MC68681_STATUS);
- } while ( ucLineStatus & MC68681_RX_READY );
- continue;
- }
- cChar = (*getReg)(pMC68681_port, MC68681_RX_BUFFER);
- rtems_termios_enqueue_raw_characters(
- Console_Port_Data[minor].termios_data,
- &cChar,
- 1
- );
- }
-
- /*
- * Deal with the transmitter
- */
-
- ucLineStatus = (*getReg)(pMC68681, MC68681_INTERRUPT_STATUS_REG);
- if (pMC68681 != pMC68681_port)
- ucLineStatus >>= 4;
-
- if(ucLineStatus & MC68681_IR_TX_READY) {
- if (rtems_termios_dequeue_characters(
- Console_Port_Data[minor].termios_data, 1)) {
- Console_Port_Data[minor].bActive = FALSE;
- mc68681_enable_interrupts(minor, MC68681_IMR_ENABLE_ALL_EXCEPT_TX);
- }
- }
-
-}
-
-/*
- * mc68681_build_imr
- *
- * This function returns the value for the interrupt mask register for this
- * DUART. Since this is a shared register, we must look at the other port
- * on this chip to determine whether or not it is using interrupts.
- */
-
-MC68681_STATIC unsigned int mc68681_build_imr(
- int minor,
- int enable_flag
-)
-{
- int mate;
- int is_a;
- unsigned int mask;
- unsigned int mate_mask;
- unsigned int pMC68681;
- unsigned int pMC68681_port;
- mc68681_context *pmc68681Context;
- mc68681_context *mateContext;
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- pmc68681Context = (mc68681_context *) Console_Port_Data[minor].pDeviceContext;
- mate = pmc68681Context->mate;
-
- mask = 0;
- mate_mask = 0;
-
- is_a = (pMC68681 == pMC68681_port);
-
- /*
- * If there is a mate for this port, get its IMR mask.
- */
-
- if ( mate != -1 ) {
- mateContext = Console_Port_Data[mate].pDeviceContext;
-
- if (mateContext)
- mate_mask = mateContext->imr;
- }
-
- /*
- * Calculate this port's IMR mask and save it in the context area.
- */
-
- if ( Console_Port_Tbl[minor].pDeviceFns->deviceOutputUsesInterrupts )
- mask = enable_flag;
-
- pmc68681Context->imr = mask;
-
- /*
- * Now return the full IMR value
- */
-
- if (is_a)
- return (mate_mask << 4) | mask;
-
- return (mask << 4) | mate_mask;
-}
-
-/*
- * mc68681_enable_interrupts
- *
- * This function enables specific interrupt sources on the DUART.
- */
-
-MC68681_STATIC void mc68681_enable_interrupts(
- int minor,
- int imr_mask
-)
-{
- unsigned32 pMC68681;
- setRegister_f setReg;
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Enable interrupts on RX and TX -- not break
- */
-
- (*setReg)(
- pMC68681,
- MC68681_INTERRUPT_MASK_REG,
- mc68681_build_imr(minor, imr_mask)
- );
-}
diff --git a/c/src/lib/libchip/serial/mc68681.h b/c/src/lib/libchip/serial/mc68681.h
deleted file mode 100644
index 57713e3eff..0000000000
--- a/c/src/lib/libchip/serial/mc68681.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _MC68681_H_
-#define _MC68681_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * These are just used in the interface between this driver and
- * the read/write register routines when accessing the first
- * control port.
- */
-
-#define MC68681_STATUS 1
-#define MC68681_RX_BUFFER 3
-
-#define MC68681_MODE 0
-#define MC68681_CLOCK_SELECT 1
-#define MC68681_COMMAND 2
-#define MC68681_TX_BUFFER 3
-
-/*
- * Data Port bit map configuration
- *
- * D0 : Baud Rate Set Selection
- * D1 - D2 : Extended Baud Rate Setting
- */
-
-#define MC68681_DATA_BAUD_RATE_SET_1 0 /* ACR[7] = 0 */
-#define MC68681_DATA_BAUD_RATE_SET_2 1 /* ACR[7] = 1 */
-
-#define MC68681_XBRG_IGNORED (0 << 1)
-#define MC68681_XBRG_ENABLED (1 << 1)
-#define MC68681_XBRG_DISABLED (2 << 1)
-#define MC68681_XBRG_MASK (3 << 1)
-
-/*
- * Custom baud rate table information
- */
-
-typedef unsigned char mc68681_baud_t;
-typedef mc68681_baud_t mc68681_baud_table_t[RTEMS_TERMIOS_NUMBER_BAUD_RATES];
-
-#define MC68681_BAUD_NOT_VALID 0xFF
-
-extern mc68681_baud_t
- mc68681_baud_rate_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES];
-
-
-/*
- * Driver function table
- */
-
-extern console_fns mc68681_fns;
-extern console_fns mc68681_fns_polled;
-
-/*
- * Default register access routines
- */
-
-unsigned8 mc68681_get_register( /* registers are at 1 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void mc68681_set_register(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned8 ucData
-);
-
-unsigned8 mc68681_get_register_2( /* registers are at 2 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void mc68681_set_register_2(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned8 ucData
-);
-
-unsigned8 mc68681_get_register_4( /* registers are at 4 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void mc68681_set_register_4(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned8 ucData
-);
-
-unsigned8 mc68681_get_register_8( /* registers are at 8 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void mc68681_set_register_8(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned8 ucData
-);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _MC68681_H_ */
diff --git a/c/src/lib/libchip/serial/mc68681_baud.c b/c/src/lib/libchip/serial/mc68681_baud.c
deleted file mode 100644
index d91774e501..0000000000
--- a/c/src/lib/libchip/serial/mc68681_baud.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * MC68681 Default Baud Rate Table
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <libchip/serial.h>
-#include <libchip/mc68681.h>
-
-/* major index of 0 : ACR[7] = 0, X = 0 -- 68c681 only has these */
-/* major index of 1 : ACR[7] = 1, X = 0 -- 68c681 only has these */
-/* major index of 2 : ACR[7] = 0, X = 1 */
-/* major index of 3 : ACR[7] = 1, X = 1 */
-
-/* mc68681_baud_table_t mc68681_baud_rate_table[4] = { */
-mc68681_baud_t mc68681_baud_rate_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = {
- { /* ACR[7] = 0, X = 0 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- 0x00, /* B50 */
- MC68681_BAUD_NOT_VALID, /* B75 */
- 0x01, /* B110 */
- 0x02, /* B134 */
- MC68681_BAUD_NOT_VALID, /* B150 */
- 0x03, /* B200 */
- 0x04, /* B300 */
- 0x05, /* B600 */
- 0x06, /* B1200 */
- MC68681_BAUD_NOT_VALID, /* B1800 */
- 0x08, /* B2400 */
- 0x09, /* B4800 */
- 0x0B, /* B9600 */
- MC68681_BAUD_NOT_VALID, /* B19200 */
- 0x0C, /* B38400 */
- MC68681_BAUD_NOT_VALID, /* B57600 */
- MC68681_BAUD_NOT_VALID, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
- { /* ACR[7] = 1, X = 0 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- MC68681_BAUD_NOT_VALID, /* B50 */
- 0x00, /* B75 */
- 0x01, /* B110 */
- 0x02, /* B134 */
- 0x03, /* B150 */
- MC68681_BAUD_NOT_VALID, /* B200 */
- 0x04, /* B300 */
- 0x05, /* B600 */
- 0x06, /* B1200 */
- 0x0A, /* B1800 */
- 0x08, /* B2400 */
- 0x09, /* B4800 */
- 0x0B, /* B9600 */
- 0x0C, /* B19200 */
- MC68681_BAUD_NOT_VALID, /* B38400 */
- MC68681_BAUD_NOT_VALID, /* B57600 */
- MC68681_BAUD_NOT_VALID, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
- { /* ACR[7] = 0, X = 1 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- MC68681_BAUD_NOT_VALID, /* B50 */
- 0x00, /* B75 */
- 0x01, /* B110 */
- 0x02, /* B134 */
- 0x03, /* B150 */
- MC68681_BAUD_NOT_VALID, /* B200 */
- MC68681_BAUD_NOT_VALID, /* B300 */
- MC68681_BAUD_NOT_VALID, /* B600 */
- MC68681_BAUD_NOT_VALID, /* B1200 */
- 0x0A, /* B1800 */
- MC68681_BAUD_NOT_VALID, /* B2400 */
- 0x08, /* B4800 */
- 0x0B, /* B9600 */
- 0x0C, /* B19200 */
- MC68681_BAUD_NOT_VALID, /* B38400 */
- 0x07, /* B57600 */
- 0x08, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
- { /* ACR[7] = 1, X = 1 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- 0x00, /* B50 */
- MC68681_BAUD_NOT_VALID, /* B75 */
- 0x01, /* B110 */
- 0x02, /* B134 */
- MC68681_BAUD_NOT_VALID, /* B150 */
- 0x03, /* B200 */
- MC68681_BAUD_NOT_VALID, /* B300 */
- MC68681_BAUD_NOT_VALID, /* B600 */
- MC68681_BAUD_NOT_VALID, /* B1200 */
- MC68681_BAUD_NOT_VALID, /* B1800 */
- MC68681_BAUD_NOT_VALID, /* B2400 */
- 0x09, /* B4800 */
- 0x0B, /* B9600 */
- MC68681_BAUD_NOT_VALID, /* B19200 */
- 0x0C, /* B38400 */
- 0x07, /* B57600 */
- 0x08, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
-};
-
diff --git a/c/src/lib/libchip/serial/mc68681_p.h b/c/src/lib/libchip/serial/mc68681_p.h
deleted file mode 100644
index 471b0ae42e..0000000000
--- a/c/src/lib/libchip/serial/mc68681_p.h
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _MC68681_P_H_
-#define _MC68681_P_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Define MC68681_STATIC to nothing while debugging so the entry points
- * will show up in the symbol table.
- */
-
-#define MC68681_STATIC
-
-/* #define MC68681_STATIC static */
-
-/*
- * mc68681 register offsets Read/Write Addresses
- */
-
-#define MC68681_MODE_REG_1A 0 /* MR1A-MR Prior to Read */
-#define MC68681_MODE_REG_2A 0 /* MR2A-MR After Read */
-
-#define MC68681_COUNT_MODE_CURRENT_MSB 6 /* CTU */
-#define MC68681_COUNTER_TIMER_UPPER_REG 6 /* CTU */
-#define MC68681_COUNT_MODE_CURRENT_LSB 7 /* CTL */
-#define MC68681_COUNTER_TIMER_LOWER_REG 7 /* CTL */
-#define MC68681_INTERRUPT_VECTOR_REG 12 /* IVR */
-
-#define MC68681_MODE_REG_1B 8 /* MR1B-MR Prior to Read */
-#define MC68681_MODE_REG_2B 8 /* MR2BA-MR After Read */
-
-/*
- * mc68681 register offsets Read Only Addresses
- */
-
-#define MC68681_STATUS_REG_A 1 /* SRA */
-#define MC68681_MASK_ISR_REG 2 /* MISR */
-#define MC68681_RECEIVE_BUFFER_A 3 /* RHRA */
-#define MC68681_INPUT_PORT_CHANGE_REG 4 /* IPCR */
-#define MC68681_INTERRUPT_STATUS_REG 5 /* ISR */
-#define MC68681_STATUS_REG_B 9 /* SRB */
-#define MC68681_RECEIVE_BUFFER_B 11 /* RHRB */
-#define MC68681_INPUT_PORT 13 /* IP */
-#define MC68681_START_COUNT_CMD 14 /* SCC */
-#define MC68681_STOP_COUNT_CMD 15 /* STC */
-
-/*
- * mc68681 register offsets Write Only Addresses
- */
-
-#define MC68681_CLOCK_SELECT_REG_A 1 /* CSRA */
-#define MC68681_COMMAND_REG_A 2 /* CRA */
-#define MC68681_TRANSMIT_BUFFER_A 3 /* THRA */
-#define MC68681_AUX_CTRL_REG 4 /* ACR */
-#define MC68681_INTERRUPT_MASK_REG 5 /* IMR */
-#define MC68681_CLOCK_SELECT_REG_B 9 /* CSRB */
-#define MC68681_COMMAND_REG_B 10 /* CRB */
-#define MC68681_TRANSMIT_BUFFER_B 11 /* THRB */
-#define MC68681_OUTPUT_PORT_CONFIG_REG 13 /* OPCR */
-#define MC68681_OUTPUT_PORT_SET_REG 14 /* SOPBC */
-#define MC68681_OUTPUT_PORT_RESET_BITS 15 /* COPBC */
-
-/*
- * DUART Command Register Definitions:
- *
- * MC68681_COMMAND_REG_A,MC68681_COMMAND_REG_B
- */
-
-#define MC68681_MODE_REG_ENABLE_RX 0x01
-#define MC68681_MODE_REG_DISABLE_RX 0x02
-#define MC68681_MODE_REG_ENABLE_TX 0x04
-#define MC68681_MODE_REG_DISABLE_TX 0x08
-#define MC68681_MODE_REG_RESET_MR_PTR 0x10
-#define MC68681_MODE_REG_RESET_RX 0x20
-#define MC68681_MODE_REG_RESET_TX 0x30
-#define MC68681_MODE_REG_RESET_ERROR 0x40
-#define MC68681_MODE_REG_RESET_BREAK 0x50
-#define MC68681_MODE_REG_START_BREAK 0x60
-#define MC68681_MODE_REG_STOP_BREAK 0x70
-#define MC68681_MODE_REG_SET_RX_BRG 0x80
-#define MC68681_MODE_REG_CLEAR_RX_BRG 0x90
-#define MC68681_MODE_REG_SET_TX_BRG 0xa0
-#define MC68681_MODE_REG_CLEAR_TX_BRG 0xb0
-#define MC68681_MODE_REG_SET_STANDBY 0xc0
-#define MC68681_MODE_REG_SET_ACTIVE 0xd0
-
-/*
- * Mode Register Definitions
- *
- * MC68681_MODE_REG_1A
- * MC68681_MODE_REG_1B
- */
-
-#define MC68681_5BIT_CHARS 0x00
-#define MC68681_6BIT_CHARS 0x01
-#define MC68681_7BIT_CHARS 0x02
-#define MC68681_8BIT_CHARS 0x03
-
-#define MC68681_ODD_PARITY 0x00
-#define MC68681_EVEN_PARITY 0x04
-
-#define MC68681_WITH_PARITY 0x00
-#define MC68681_FORCE_PARITY 0x08
-#define MC68681_NO_PARITY 0x10
-#define MC68681_MULTI_DROP 0x18
-
-#define MC68681_ERR_MODE_CHAR 0x00
-#define MC68681_ERR_MODE_BLOCK 0x20
-
-#define MC68681_RX_INTR_RX_READY 0x00
-#define MC68681_RX_INTR_FFULL 0x40
-
-#define MC68681_NO_RX_RTS_CTL 0x00
-#define MC68681_RX_RTS_CTRL 0x80
-
-/*
- * Mode Register Definitions
- *
- * MC68681_MODE_REG_2A
- * MC68681_MODE_REG_2B
- */
-
-#define MC68681_STOP_BIT_LENGTH__563 0x00
-#define MC68681_STOP_BIT_LENGTH__625 0x01
-#define MC68681_STOP_BIT_LENGTH__688 0x02
-#define MC68681_STOP_BIT_LENGTH__75 0x03
-#define MC68681_STOP_BIT_LENGTH__813 0x04
-#define MC68681_STOP_BIT_LENGTH__875 0x05
-#define MC68681_STOP_BIT_LENGTH__938 0x06
-#define MC68681_STOP_BIT_LENGTH_1 0x07
-#define MC68681_STOP_BIT_LENGTH_1_563 0x08
-#define MC68681_STOP_BIT_LENGTH_1_625 0x09
-#define MC68681_STOP_BIT_LENGTH_1_688 0x0a
-#define MC68681_STOP_BIT_LENGTH_1_75 0x0b
-#define MC68681_STOP_BIT_LENGTH_1_813 0x0c
-#define MC68681_STOP_BIT_LENGTH_1_875 0x0d
-#define MC68681_STOP_BIT_LENGTH_1_938 0x0e
-#define MC68681_STOP_BIT_LENGTH_2 0x0f
-
-#define MC68681_CTS_ENABLE_TX 0x10
-#define MC68681_TX_RTS_CTRL 0x20
-
-#define MC68681_CHANNEL_MODE_NORMAL 0x00
-#define MC68681_CHANNEL_MODE_ECHO 0x40
-#define MC68681_CHANNEL_MODE_LOCAL_LOOP 0x80
-#define MC68681_CHANNEL_MODE_REMOTE_LOOP 0xc0
-
-/*
- * Status Register Definitions
- *
- * MC68681_STATUS_REG_A, MC68681_STATUS_REG_B
- */
-
-#define MC68681_RX_READY 0x01
-#define MC68681_FFULL 0x02
-#define MC68681_TX_READY 0x04
-#define MC68681_TX_EMPTY 0x08
-#define MC68681_OVERRUN_ERROR 0x10
-#define MC68681_PARITY_ERROR 0x20
-#define MC68681_FRAMING_ERROR 0x40
-#define MC68681_RECEIVED_BREAK 0x80
-
-#define MC68681_RX_ERRORS \
- (MC68681_OVERRUN_ERROR|MC68681_PARITY_ERROR| \
- MC68681_FRAMING_ERROR|MC68681_RECEIVED_BREAK)
-
-/*
- * Interupt Status Register Definitions.
- *
- * MC68681_INTERRUPT_STATUS_REG
- */
-
-/*
- * Interupt Mask Register Definitions
- *
- * MC68681_INTERRUPT_MASK_REG
- */
-
-/* These are passed to mc68681_build_imr */
-#define MC68681_IR_TX_READY 0x01
-#define MC68681_IR_RX_READY 0x02
-#define MC68681_IR_BREAK 0x04
-#define MC68681_IMR_ENABLE_ALL 0x07
-#define MC68681_IMR_DISABLE_ALL 0x00
-#define MC68681_IMR_ENABLE_ALL_EXCEPT_TX 0x06
-
-#define MC68681_IR_TX_READY_A 0x01
-#define MC68681_IR_RX_READY_A 0x02
-#define MC68681_IR_BREAK_A 0x04
-#define MC68681_IR_COUNTER_READY 0x08
-#define MC68681_IR_TX_READY_B 0x10
-#define MC68681_IR_RX_READY_B 0x20
-#define MC68681_IR_BREAK_B 0x40
-#define MC68681_IR_INPUT_PORT_CHANGE 0x80
-
-/*
- * Status Register Definitions.
- *
- * MC68681_STATUS_REG_A,MC68681_STATUS_REG_B
- */
-
-#define MC68681_STATUS_RXRDY 0x01
-#define MC68681_STATUS_FFULL 0x02
-#define MC68681_STATUS_TXRDY 0x04
-#define MC68681_STATUS_TXEMT 0x08
-#define MC68681_STATUS_OVERRUN_ERROR 0x10
-#define MC68681_STATUS_PARITY_ERROR 0x20
-#define MC68681_STATUS_FRAMING_ERROR 0x40
-#define MC68681_STATUS_RECEIVED_BREAK 0x80
-
-/*
- * Definitions for the Interrupt Vector Register:
- *
- * MC68681_INTERRUPT_VECTOR_REG
- */
-
-#define MC68681_INTERRUPT_VECTOR_INIT 0x0f
-
-/*
- * Definitions for the Auxiliary Control Register
- *
- * MC68681_AUX_CTRL_REG
- */
-
-#define MC68681_AUX_BRG_SET1 0x00
-#define MC68681_AUX_BRG_SET2 0x80
-
-/*
- * Per chip context control
- */
-
-typedef struct _mc68681_context
-{
- int mate;
- unsigned char imr;
-} mc68681_context;
-
-/*
- * Driver functions
- */
-MC68681_STATIC boolean mc68681_probe(int minor);
-
-MC68681_STATIC int mc68681_set_attributes(
- int minor,
- const struct termios *t
-);
-
-MC68681_STATIC void mc68681_init(int minor);
-
-MC68681_STATIC int mc68681_open(
- int major,
- int minor,
- void * arg
-);
-
-MC68681_STATIC int mc68681_close(
- int major,
- int minor,
- void * arg
-);
-
-MC68681_STATIC void mc68681_write_polled(
- int minor,
- char cChar
-);
-
-MC68681_STATIC void mc68681_initialize_interrupts(int minor);
-
-MC68681_STATIC int mc68681_write_support_int(
- int minor,
- const char *buf,
- int len
-);
-
-MC68681_STATIC int mc68681_write_support_polled(
- int minor,
- const char *buf,
- int len
- );
-
-MC68681_STATIC int mc68681_inbyte_nonblocking_polled(
- int minor
-);
-
-MC68681_STATIC unsigned int mc68681_build_imr(
- int minor,
- int enable_flag
-);
-
-MC68681_STATIC void mc68681_process(
- int minor
-);
-
-MC68681_STATIC void mc68681_enable_interrupts(
- int minor,
- int imr_mask
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _MC68681_P_H_ */
diff --git a/c/src/lib/libchip/serial/mc68681_reg.c b/c/src/lib/libchip/serial/mc68681_reg.c
deleted file mode 100644
index 115bafdfe8..0000000000
--- a/c/src/lib/libchip/serial/mc68681_reg.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the mc68681 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are only byte-aligned (no address gaps)
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#ifndef _MC68681_MULTIPLIER
-#define _MC68681_MULTIPLIER 1
-#define _MC68681_NAME(_X) _X
-#define _MC68681_TYPE unsigned8
-#endif
-
-#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
- (_MC68681_TYPE *)((_base) + ((_reg) * _MC68681_MULTIPLIER ))
-
-/*
- * MC68681 Get Register Routine
- */
-
-unsigned8 _MC68681_NAME(mc68681_get_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum
-)
-{
- _MC68681_TYPE *port;
-
- port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
-
- return *port;
-}
-
-/*
- * MC68681 Set Register Routine
- */
-
-void _MC68681_NAME(mc68681_set_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned8 ucData
-)
-{
- _MC68681_TYPE *port;
-
- port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
-
- *port = ucData;
-}
diff --git a/c/src/lib/libchip/serial/mc68681_reg2.c b/c/src/lib/libchip/serial/mc68681_reg2.c
deleted file mode 100644
index f786ab5df5..0000000000
--- a/c/src/lib/libchip/serial/mc68681_reg2.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the mc68681 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 16-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _MC68681_MULTIPLIER 2
-#define _MC68681_NAME(_X) _X##_2
-#define _MC68681_TYPE unsigned8
-
-#include "mc68681_reg.c"
-
diff --git a/c/src/lib/libchip/serial/mc68681_reg4.c b/c/src/lib/libchip/serial/mc68681_reg4.c
deleted file mode 100644
index 075a9b2564..0000000000
--- a/c/src/lib/libchip/serial/mc68681_reg4.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the mc68681 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 32-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _MC68681_MULTIPLIER 4
-#define _MC68681_NAME(_X) _X##_4
-#define _MC68681_TYPE unsigned8
-
-#include "mc68681_reg.c"
-
diff --git a/c/src/lib/libchip/serial/mc68681_reg8.c b/c/src/lib/libchip/serial/mc68681_reg8.c
deleted file mode 100644
index b83ccd2b46..0000000000
--- a/c/src/lib/libchip/serial/mc68681_reg8.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the mc68681 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 64-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _MC68681_MULTIPLIER 8
-#define _MC68681_NAME(_X) _X##_8
-#define _MC68681_TYPE unsigned8
-
-#include "mc68681_reg.c"
-
diff --git a/c/src/lib/libchip/serial/ns16550.c b/c/src/lib/libchip/serial/ns16550.c
deleted file mode 100644
index 918e87bf8c..0000000000
--- a/c/src/lib/libchip/serial/ns16550.c
+++ /dev/null
@@ -1,660 +0,0 @@
-/*
- * This file contains the TTY driver for the National Semiconductor NS16550.
- *
- * This part is widely cloned and second sourced. It is found in a number
- * of "Super IO" controllers.
- *
- * COPYRIGHT (c) 1998 by Radstone Technology
- *
- *
- * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
- * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
- *
- * You are hereby granted permission to use, copy, modify, and distribute
- * this file, provided that this notice, plus the above copyright notice
- * and disclaimer, appears in all copies. Radstone Technology will provide
- * no support for this code.
- *
- * This driver uses the termios pseudo driver.
- */
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <stdlib.h>
-#include <ringbuf.h>
-
-#include <libchip/serial.h>
-#include "ns16550_p.h"
-#include "sersupp.h"
-
-/*
- * Flow control is only supported when using interrupts
- */
-
-console_flow ns16550_flow_RTSCTS = {
- ns16550_negate_RTS, /* deviceStopRemoteTx */
- ns16550_assert_RTS /* deviceStartRemoteTx */
-};
-
-console_flow ns16550_flow_DTRCTS = {
- ns16550_negate_DTR, /* deviceStopRemoteTx */
- ns16550_assert_DTR /* deviceStartRemoteTx */
-};
-
-console_fns ns16550_fns = {
- libchip_serial_default_probe, /* deviceProbe */
- ns16550_open, /* deviceFirstOpen */
- NULL, /* deviceLastClose */
- NULL, /* deviceRead */
- ns16550_write_support_int, /* deviceWrite */
- ns16550_initialize_interrupts, /* deviceInitialize */
- ns16550_write_polled, /* deviceWritePolled */
- ns16550_set_attributes, /* deviceSetAttributes */
- TRUE /* deviceOutputUsesInterrupts */
-};
-
-console_fns ns16550_fns_polled = {
- libchip_serial_default_probe, /* deviceProbe */
- ns16550_open, /* deviceFirstOpen */
- ns16550_close, /* deviceLastClose */
- ns16550_inbyte_nonblocking_polled, /* deviceRead */
- ns16550_write_support_polled, /* deviceWrite */
- ns16550_init, /* deviceInitialize */
- ns16550_write_polled, /* deviceWritePolled */
- ns16550_set_attributes, /* deviceSetAttributes */
- FALSE /* deviceOutputUsesInterrupts */
-};
-
-extern void set_vector( rtems_isr_entry, rtems_vector_number, int );
-
-/*
- * ns16550_init
- */
-
-NS16550_STATIC void ns16550_init(int minor)
-{
- unsigned32 pNS16550;
- unsigned8 ucTrash;
- unsigned8 ucDataByte;
- unsigned32 ulBaudDivisor;
- ns16550_context *pns16550Context;
- setRegister_f setReg;
- getRegister_f getReg;
-
- pns16550Context=(ns16550_context *)malloc(sizeof(ns16550_context));
-
- Console_Port_Data[minor].pDeviceContext=(void *)pns16550Context;
- pns16550Context->ucModemCtrl=SP_MODEM_IRQ;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- /* Clear the divisor latch, clear all interrupt enables,
- * and reset and
- * disable the FIFO's.
- */
-
- (*setReg)(pNS16550, NS16550_LINE_CONTROL, 0x0);
- ns16550_enable_interrupts(minor, NS16550_DISABLE_ALL_INTR);
-
- /* Set the divisor latch and set the baud rate. */
-
- ulBaudDivisor=NS16550_Baud((unsigned32)Console_Port_Tbl[minor].pDeviceParams);
- ucDataByte = SP_LINE_DLAB;
- (*setReg)(pNS16550, NS16550_LINE_CONTROL, ucDataByte);
-
- /* XXX */
- (*setReg)(pNS16550, NS16550_TRANSMIT_BUFFER, ulBaudDivisor&0xff);
- (*setReg)(pNS16550, NS16550_INTERRUPT_ENABLE, (ulBaudDivisor>>8)&0xff);
-
- /* Clear the divisor latch and set the character size to eight bits */
- /* with one stop bit and no parity checking. */
- ucDataByte = EIGHT_BITS;
- (*setReg)(pNS16550, NS16550_LINE_CONTROL, ucDataByte);
-
- /* Enable and reset transmit and receive FIFOs. TJA */
- ucDataByte = SP_FIFO_ENABLE;
- (*setReg)(pNS16550, NS16550_FIFO_CONTROL, ucDataByte);
-
- ucDataByte = SP_FIFO_ENABLE | SP_FIFO_RXRST | SP_FIFO_TXRST;
- (*setReg)(pNS16550, NS16550_FIFO_CONTROL, ucDataByte);
-
- ns16550_enable_interrupts(minor, NS16550_DISABLE_ALL_INTR);
-
- /* Set data terminal ready. */
- /* And open interrupt tristate line */
- (*setReg)(pNS16550, NS16550_MODEM_CONTROL,pns16550Context->ucModemCtrl);
-
- ucTrash = (*getReg)(pNS16550, NS16550_LINE_STATUS );
- ucTrash = (*getReg)(pNS16550, NS16550_RECEIVE_BUFFER );
-}
-
-/*
- * ns16550_open
- */
-
-NS16550_STATIC int ns16550_open(
- int major,
- int minor,
- void * arg
-)
-{
- /*
- * Assert DTR
- */
-
- if(Console_Port_Tbl[minor].pDeviceFlow != &ns16550_flow_DTRCTS) {
- ns16550_assert_DTR(minor);
- }
-
- return(RTEMS_SUCCESSFUL);
-}
-
-/*
- * ns16550_close
- */
-
-NS16550_STATIC int ns16550_close(
- int major,
- int minor,
- void * arg
-)
-{
- /*
- * Negate DTR
- */
- if(Console_Port_Tbl[minor].pDeviceFlow != &ns16550_flow_DTRCTS) {
- ns16550_negate_DTR(minor);
- }
-
- return(RTEMS_SUCCESSFUL);
-}
-
-/*
- * ns16550_write_polled
- */
-
-NS16550_STATIC void ns16550_write_polled(
- int minor,
- char cChar
-)
-{
- unsigned32 pNS16550;
- unsigned char ucLineStatus;
- int iTimeout;
- getRegister_f getReg;
- setRegister_f setReg;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- getReg = Console_Port_Tbl[minor].getRegister;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * wait for transmitter holding register to be empty
- */
- iTimeout=1000;
- ucLineStatus = (*getReg)(pNS16550, NS16550_LINE_STATUS);
- while ((ucLineStatus & SP_LSR_THOLD) == 0) {
- /*
- * Yield while we wait
- */
-#if 0
- if(_System_state_Is_up(_System_state_Get())) {
- rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
- }
-#endif
- ucLineStatus = (*getReg)(pNS16550, NS16550_LINE_STATUS);
- if(!--iTimeout) {
- break;
- }
- }
-
- /*
- * transmit character
- */
- (*setReg)(pNS16550, NS16550_TRANSMIT_BUFFER, cChar);
-}
-
-/*
- * These routines provide control of the RTS and DTR lines
- */
-
-/*
- * ns16550_assert_RTS
- */
-
-NS16550_STATIC int ns16550_assert_RTS(int minor)
-{
- unsigned32 pNS16550;
- unsigned32 Irql;
- ns16550_context *pns16550Context;
- setRegister_f setReg;
-
- pns16550Context=(ns16550_context *) Console_Port_Data[minor].pDeviceContext;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Assert RTS
- */
- rtems_interrupt_disable(Irql);
- pns16550Context->ucModemCtrl|=SP_MODEM_RTS;
- (*setReg)(pNS16550, NS16550_MODEM_CONTROL, pns16550Context->ucModemCtrl);
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * ns16550_negate_RTS
- */
-
-NS16550_STATIC int ns16550_negate_RTS(int minor)
-{
- unsigned32 pNS16550;
- unsigned32 Irql;
- ns16550_context *pns16550Context;
- setRegister_f setReg;
-
- pns16550Context=(ns16550_context *) Console_Port_Data[minor].pDeviceContext;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Negate RTS
- */
- rtems_interrupt_disable(Irql);
- pns16550Context->ucModemCtrl&=~SP_MODEM_RTS;
- (*setReg)(pNS16550, NS16550_MODEM_CONTROL, pns16550Context->ucModemCtrl);
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * These flow control routines utilise a connection from the local DTR
- * line to the remote CTS line
- */
-
-/*
- * ns16550_assert_DTR
- */
-
-NS16550_STATIC int ns16550_assert_DTR(int minor)
-{
- unsigned32 pNS16550;
- unsigned32 Irql;
- ns16550_context *pns16550Context;
- setRegister_f setReg;
-
- pns16550Context=(ns16550_context *) Console_Port_Data[minor].pDeviceContext;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Assert DTR
- */
- rtems_interrupt_disable(Irql);
- pns16550Context->ucModemCtrl|=SP_MODEM_DTR;
- (*setReg)(pNS16550, NS16550_MODEM_CONTROL, pns16550Context->ucModemCtrl);
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * ns16550_negate_DTR
- */
-
-NS16550_STATIC int ns16550_negate_DTR(int minor)
-{
- unsigned32 pNS16550;
- unsigned32 Irql;
- ns16550_context *pns16550Context;
- setRegister_f setReg;
-
- pns16550Context=(ns16550_context *) Console_Port_Data[minor].pDeviceContext;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Negate DTR
- */
- rtems_interrupt_disable(Irql);
- pns16550Context->ucModemCtrl&=~SP_MODEM_DTR;
- (*setReg)(pNS16550, NS16550_MODEM_CONTROL,pns16550Context->ucModemCtrl);
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * ns16550_set_attributes
- *
- * This function sets the channel to reflect the requested termios
- * port settings.
- */
-
-NS16550_STATIC int ns16550_set_attributes(
- int minor,
- const struct termios *t
-)
-{
- unsigned32 pNS16550;
- unsigned32 ulBaudDivisor;
- unsigned8 ucLineControl;
- unsigned32 baud_requested;
- setRegister_f setReg;
- getRegister_f getReg;
- unsigned32 Irql;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- /*
- * Calculate the baud rate divisor
- */
-
- baud_requested = t->c_cflag & CBAUD;
- if (!baud_requested)
- baud_requested = B9600; /* default to 9600 baud */
-
- ulBaudDivisor = termios_baud_to_number(baud_requested);
-
- ucLineControl = 0;
-
- /*
- * Parity
- */
-
- if (t->c_cflag & PARENB) {
- ucLineControl |= SP_LINE_PAR;
- if (!(t->c_cflag & PARODD))
- ucLineControl |= SP_LINE_ODD;
- }
-
- /*
- * Character Size
- */
-
- if (t->c_cflag & CSIZE) {
- switch (t->c_cflag & CSIZE) {
- case CS5: ucLineControl |= FIVE_BITS; break;
- case CS6: ucLineControl |= SIX_BITS; break;
- case CS7: ucLineControl |= SEVEN_BITS; break;
- case CS8: ucLineControl |= EIGHT_BITS; break;
- }
- } else {
- ucLineControl |= EIGHT_BITS; /* default to 9600,8,N,1 */
- }
-
- /*
- * Stop Bits
- */
-
- if (t->c_cflag & CSTOPB) {
- ucLineControl |= SP_LINE_STOP; /* 2 stop bits */
- } else {
- ; /* 1 stop bit */
- }
-
- /*
- * Now actually set the chip
- */
-
- rtems_interrupt_disable(Irql);
-
- /*
- * Set the baud rate
- */
-
- (*setReg)(pNS16550, NS16550_LINE_CONTROL, SP_LINE_DLAB);
- /* XXX are these registers right? */
- (*setReg)(pNS16550, NS16550_TRANSMIT_BUFFER, ulBaudDivisor&0xff);
- (*setReg)(pNS16550, NS16550_INTERRUPT_ENABLE, (ulBaudDivisor>>8)&0xff);
-
- /*
- * Now write the line control
- */
- (*setReg)(pNS16550, NS16550_LINE_CONTROL, ucLineControl );
-
- rtems_interrupt_enable(Irql);
-
-}
-
-/*
- * ns16550_process
- *
- * This routine is the console interrupt handler for A port.
- */
-
-NS16550_STATIC void ns16550_process(
- int minor
-)
-{
- unsigned32 pNS16550;
- volatile unsigned8 ucLineStatus;
- volatile unsigned8 ucInterruptId;
- unsigned char cChar;
- getRegister_f getReg;
- setRegister_f setReg;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- getReg = Console_Port_Tbl[minor].getRegister;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- do {
- /*
- * Deal with any received characters
- */
- while(TRUE) {
- ucLineStatus = (*getReg)(pNS16550, NS16550_LINE_STATUS);
- if(~ucLineStatus & SP_LSR_RDY) {
- break;
- }
- cChar = (*getReg)(pNS16550, NS16550_RECEIVE_BUFFER);
- rtems_termios_enqueue_raw_characters(
- Console_Port_Data[minor].termios_data,
- &cChar,
- 1
- );
- }
-
- /*
- * TX all the characters we can
- */
-
- while(TRUE) {
- ucLineStatus = (*getReg)(pNS16550, NS16550_LINE_STATUS);
- if(~ucLineStatus & SP_LSR_THOLD) {
- /*
- * We'll get another interrupt when
- * the transmitter holding reg. becomes
- * free again
- */
- break;
- }
-
-#if 0
- /* XXX flow control not completely supported in libchip */
-
- if(Console_Port_Tbl[minor].pDeviceFlow != &ns16550_flow_RTSCTS) {
- ns16550_negate_RTS(minor);
- }
-#endif
-
- rtems_termios_dequeue_characters(Console_Port_Data[minor].termios_data, 1);
- if (rtems_termios_dequeue_characters(
- Console_Port_Data[minor].termios_data, 1)) {
- if (Console_Port_Tbl[minor].pDeviceFlow != &ns16550_flow_RTSCTS) {
- ns16550_negate_RTS(minor);
- }
- Console_Port_Data[minor].bActive = FALSE;
- ns16550_enable_interrupts(minor, NS16550_ENABLE_ALL_INTR_EXCEPT_TX);
- break;
- }
-
- ucInterruptId = (*getReg)(pNS16550, NS16550_INTERRUPT_ID);
- }
- } while((ucInterruptId&0xf)!=0x1);
-}
-
-/*
- * ns16550_isr
- */
-
-NS16550_STATIC rtems_isr ns16550_isr(
- rtems_vector_number vector
-)
-{
- int minor;
-
- for(minor=0;minor<Console_Port_Count;minor++) {
- if(Console_Port_Tbl[minor].ulIntVector == vector &&
- Console_Port_Tbl[minor].deviceType == SERIAL_NS16550 ) {
- ns16550_process(minor);
- }
- }
-}
-
-/*
- * ns16550_enable_interrupts
- *
- * This routine initializes the port to have the specified interrupts masked.
- */
-
-NS16550_STATIC void ns16550_enable_interrupts(
- int minor,
- int mask
-)
-{
- unsigned32 pNS16550;
- setRegister_f setReg;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- (*setReg)(pNS16550, NS16550_INTERRUPT_ENABLE, mask);
-}
-
-/*
- * ns16550_initialize_interrupts
- *
- * This routine initializes the port to operate in interrupt driver mode.
- */
-
-NS16550_STATIC void ns16550_initialize_interrupts(int minor)
-{
- ns16550_init(minor);
-
- Console_Port_Data[minor].bActive = FALSE;
-
- set_vector(ns16550_isr, Console_Port_Tbl[minor].ulIntVector, 1);
-
- ns16550_enable_interrupts(minor, NS16550_ENABLE_ALL_INTR);
-}
-
-/*
- * ns16550_write_support_int
- *
- * Console Termios output entry point.
- */
-
-NS16550_STATIC int ns16550_write_support_int(
- int minor,
- const char *buf,
- int len
-)
-{
- unsigned32 Irql;
- unsigned32 pNS16550;
- setRegister_f setReg;
-
- setReg = Console_Port_Tbl[minor].setRegister;
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
-
- /*
- * We are using interrupt driven output and termios only sends us
- * one character at a time.
- */
-
- if ( !len )
- return 0;
-
- if(Console_Port_Tbl[minor].pDeviceFlow != &ns16550_flow_RTSCTS) {
- ns16550_assert_RTS(minor);
- }
-
- rtems_interrupt_disable(Irql);
- if ( Console_Port_Data[minor].bActive == FALSE) {
- Console_Port_Data[minor].bActive = TRUE;
- ns16550_enable_interrupts(minor, NS16550_ENABLE_ALL_INTR);
- }
- (*setReg)(pNS16550, NS16550_TRANSMIT_BUFFER, *buf);
- rtems_interrupt_enable(Irql);
-
- return 1;
-}
-
-/*
- * ns16550_write_support_polled
- *
- * Console Termios output entry point.
- *
- */
-
-NS16550_STATIC int ns16550_write_support_polled(
- int minor,
- const char *buf,
- int len
-)
-{
- int nwrite = 0;
-
- /*
- * poll each byte in the string out of the port.
- */
- while (nwrite < len) {
- /*
- * transmit character
- */
- ns16550_write_polled(minor, *buf++);
- nwrite++;
- }
-
- /*
- * return the number of bytes written.
- */
- return nwrite;
-}
-
-/*
- * ns16550_inbyte_nonblocking_polled
- *
- * Console Termios polling input entry point.
- */
-
-NS16550_STATIC int ns16550_inbyte_nonblocking_polled(
- int minor
-)
-{
- unsigned32 pNS16550;
- unsigned char ucLineStatus;
- char cChar;
- getRegister_f getReg;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- ucLineStatus = (*getReg)(pNS16550, NS16550_LINE_STATUS);
- if(ucLineStatus & SP_LSR_RDY) {
- cChar = (*getReg)(pNS16550, NS16550_RECEIVE_BUFFER);
- return (int)cChar;
- } else {
- return -1;
- }
-}
diff --git a/c/src/lib/libchip/serial/ns16550.h b/c/src/lib/libchip/serial/ns16550.h
deleted file mode 100644
index cb01d20a85..0000000000
--- a/c/src/lib/libchip/serial/ns16550.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * COPYRIGHT (c) 1998 by Radstone Technology
- *
- *
- * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
- * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
- *
- * You are hereby granted permission to use, copy, modify, and distribute
- * this file, provided that this notice, plus the above copyright notice
- * and disclaimer, appears in all copies. Radstone Technology will provide
- * no support for this code.
- *
- */
-
-#ifndef _NS16550_H_
-#define _NS16550_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Driver function table
- */
-
-extern console_fns ns16550_fns;
-extern console_fns ns16550_fns_polled;
-
-/*
- * Flow control function tables
- */
-
-extern console_flow ns16550_flow_RTSCTS;
-extern console_flow ns16550_flow_DTRCTS;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _NS16550_H_ */
diff --git a/c/src/lib/libchip/serial/ns16550_p.h b/c/src/lib/libchip/serial/ns16550_p.h
deleted file mode 100644
index 27c3502a0d..0000000000
--- a/c/src/lib/libchip/serial/ns16550_p.h
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * COPYRIGHT (c) 1998 by Radstone Technology
- *
- *
- * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
- * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
- *
- * You are hereby granted permission to use, copy, modify, and distribute
- * this file, provided that this notice, plus the above copyright notice
- * and disclaimer, appears in all copies. Radstone Technology will provide
- * no support for this code.
- *
- * $Id$
- */
-
-#ifndef _NS16550_P_H_
-#define _NS16550_P_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Define NS16550_STATIC to nothing while debugging so the entry points
- * will show up in the symbol table.
- */
-
-#define NS16550_STATIC
-
-/* #define NS16550_STATIC static */
-
-/*
- * Define serial port read registers structure.
- */
-
-typedef volatile struct _SP_READ_REGISTERS {
- unsigned char ReceiveBuffer;
- unsigned char InterruptEnable;
- unsigned char InterruptId;
- unsigned char LineControl;
- unsigned char ModemControl;
- unsigned char LineStatus;
- unsigned char ModemStatus;
- unsigned char ScratchPad;
-} SP_READ_REGISTERS, *PSP_READ_REGISTERS;
-
-#define NS16550_RECEIVE_BUFFER 0
-#define NS16550_INTERRUPT_ENABLE 1
-#define NS16550_INTERRUPT_ID 2
-#define NS16550_LINE_CONTROL 3
-#define NS16550_MODEM_CONTROL 4
-#define NS16550_LINE_STATUS 5
-#define NS16550_MODEM_STATUS 6
-#define NS16550_SCRATCH_PAD 7
-
-/*
- * Define serial port write registers structure.
- */
-
-typedef volatile struct _SP_WRITE_REGISTERS {
- unsigned char TransmitBuffer;
- unsigned char InterruptEnable;
- unsigned char FifoControl;
- unsigned char LineControl;
- unsigned char ModemControl;
- unsigned char Reserved1;
- unsigned char ModemStatus;
- unsigned char ScratchPad;
-} SP_WRITE_REGISTERS, *PSP_WRITE_REGISTERS;
-
-#define NS16550_TRANSMIT_BUFFER 0
-#define NS16550_FIFO_CONTROL 2
-
-/*
- * Define serial port interrupt enable register structure.
- */
-
-#define SP_INT_RX_ENABLE 0x01
-#define SP_INT_TX_ENABLE 0x02
-#define SP_INT_LS_ENABLE 0x04
-#define SP_INT_MS_ENABLE 0x08
-
-#define NS16550_ENABLE_ALL_INTR (SP_INT_RX_ENABLE | SP_INT_TX_ENABLE)
-#define NS16550_DISABLE_ALL_INTR 0x00
-#define NS16550_ENABLE_ALL_INTR_EXCEPT_TX (SP_INT_RX_ENABLE)
-
-/*
- * Define serial port interrupt id register structure.
- */
-
-typedef struct _SP_INTERRUPT_ID {
- unsigned char InterruptPending : 1;
- unsigned char Identification : 3;
- unsigned char Reserved1 : 2;
- unsigned char FifoEnabled : 2;
-} SP_INTERRUPT_ID, *PSP_INTERRUPT_ID;
-
-/*
- * Define serial port fifo control register structure.
- */
-
-#define SP_FIFO_ENABLE 0x01
-#define SP_FIFO_RXRST 0x02
-#define SP_FIFO_TXRST 0x04
-#define SP_FIFO_DMA 0x08
-#define SP_FIFO_RXLEVEL 0xc0
-
-/*
- * Define serial port line control register structure.
- */
-
-#define SP_LINE_SIZE 0x03
-#define SP_LINE_STOP 0x04
-#define SP_LINE_PAR 0x08
-#define SP_LINE_ODD 0x10
-#define SP_LINE_STICK 0x20
-#define SP_LINE_BREAK 0x40
-#define SP_LINE_DLAB 0x80
-
-/*
- * Line status register character size definitions.
- */
-
-#define FIVE_BITS 0x0 /* five bits per character */
-#define SIX_BITS 0x1 /* six bits per character */
-#define SEVEN_BITS 0x2 /* seven bits per character */
-#define EIGHT_BITS 0x3 /* eight bits per character */
-
-/*
- * Line speed divisor definition.
- */
-
-#define NS16550_Baud(baud_rate) (115200/baud_rate)
-
-/*
- * Define serial port modem control register structure.
- */
-
-#define SP_MODEM_DTR 0x01
-#define SP_MODEM_RTS 0x02
-#define SP_MODEM_IRQ 0x08
-#define SP_MODEM_LOOP 0x10
-#define SP_MODEM_DIV4 0x80
-
-/*
- * Define serial port line status register structure.
- */
-
-#define SP_LSR_RDY 0x01
-#define SP_LSR_EOVRUN 0x02
-#define SP_LSR_EPAR 0x04
-#define SP_LSR_EFRAME 0x08
-#define SP_LSR_BREAK 0x10
-#define SP_LSR_THOLD 0x20
-#define SP_LSR_TX 0x40
-#define SP_LSR_EFIFO 0x80
-
-typedef struct _ns16550_context
-{
- unsigned8 ucModemCtrl;
-} ns16550_context;
-
-/*
- * Driver functions
- */
-
-NS16550_STATIC boolean ns16550_probe(int minor);
-
-NS16550_STATIC void ns16550_init(int minor);
-
-NS16550_STATIC int ns16550_open(
- int major,
- int minor,
- void * arg
-);
-
-NS16550_STATIC int ns16550_close(
- int major,
- int minor,
- void * arg
-);
-
-NS16550_STATIC void ns16550_write_polled(
- int minor,
- char cChar
-);
-
-NS16550_STATIC int ns16550_assert_RTS(
- int minor
-);
-
-NS16550_STATIC int ns16550_negate_RTS(
- int minor
-);
-
-NS16550_STATIC int ns16550_assert_DTR(
- int minor
-);
-
-NS16550_STATIC int ns16550_negate_DTR(
- int minor
-);
-
-NS16550_STATIC void ns16550_initialize_interrupts(int minor);
-
-NS16550_STATIC int ns16550_write_support_int(
- int minor,
- const char *buf,
- int len
-);
-
-NS16550_STATIC int ns16550_write_support_polled(
- int minor,
- const char *buf,
- int len
- );
-
-NS16550_STATIC int ns16550_inbyte_nonblocking_polled(
- int minor
-);
-
-NS16550_STATIC void ns16550_enable_interrupts(
- int minor,
- int mask
-);
-
-NS16550_STATIC int ns16550_set_attributes(
- int minor,
- const struct termios *t
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _NS16550_P_H_ */
diff --git a/c/src/lib/libchip/serial/serial.h b/c/src/lib/libchip/serial/serial.h
deleted file mode 100644
index aa0e7f58aa..0000000000
--- a/c/src/lib/libchip/serial/serial.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * This file contains the TTY driver table definition
- *
- * This driver uses the termios pseudo driver.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __LIBCHIP_SERIAL_h
-#define __LIBCHIP_SERIAL_h
-
-#include <termios.h>
-
-/*
- * Types for get and set register routines
- */
-
-typedef unsigned8 (*getRegister_f)(unsigned32 port, unsigned8 register);
-typedef void (*setRegister_f)(
- unsigned32 port, unsigned8 reg, unsigned8 value);
-typedef unsigned8 (*getData_f)(unsigned32 port);
-typedef void (*setData_f)(unsigned32 port, unsigned8 value);
-
-typedef struct _console_fns {
- boolean (*deviceProbe)(int minor);
- int (*deviceFirstOpen)(int major, int minor, void *arg);
- int (*deviceLastClose)(int major, int minor, void *arg);
- int (*deviceRead)(int minor);
- int (*deviceWrite)(int minor, const char *buf, int len);
- void (*deviceInitialize)(int minor);
- void (*deviceWritePolled)(int minor, char cChar);
- int (*deviceSetAttributes)(int minor, const struct termios *t);
- int deviceOutputUsesInterrupts;
-} console_fns;
-
-typedef struct _console_flow {
- int (*deviceStopRemoteTx)(int minor);
- int (*deviceStartRemoteTx)(int minor);
-} console_flow;
-
-typedef enum {
- SERIAL_MC68681, /* Motorola MC68681 or Exar 88681 */
- SERIAL_NS16550, /* National Semiconductor NS16550 */
- SERIAL_Z85C30, /* Zilog Z85C30 */
- SERIAL_CUSTOM /* BSP specific driver */
-} console_devs;
-
-/*
- * Each field is interpreted thus:
- *
- * sDeviceName This is the name of the device.
- *
- * deviceType This indicates the chip type. It is especially important when
- * multiple devices share the same interrupt vector and must be
- * distinguished.
- *
- * pDeviceFns This is a pointer to the set of driver routines to use.
- *
- * pDeviceFlow This is a pointer to the set of flow control routines to
- * use. Serial device drivers will typically supply RTSCTS
- * and DTRCTS handshake routines for DCE to DCE communication,
- * however for DCE to DTE communication, no such routines
- * should be necessary as RTS will be driven automatically
- * when the transmitter is active.
- *
- * ulMargin The high water mark in the input buffer is set to the buffer
- * size less ulMargin. Once this level is reached, the driver's
- * flow control routine used to stop the remote transmitter will
- * be called. This figure should be greater than or equal to
- * the number of stages of FIFO between the transmitter and
- * receiver.
- *
- * NOTE: At the current time, this parameter is hard coded
- * in termios and this number is ignored.
- *
- * ulHysteresis After the high water mark specified by ulMargin has been
- * reached, the driver's routine to re-start the remote
- * transmitter will be called once the level in the input
- * buffer has fallen by ulHysteresis bytes.
- *
- * NOTE: At the current time, this parameter is hard coded
- * in termios and this number is ignored.
- *
- * pDeviceParams This contains either device specific data or a pointer to a
- * device specific structure containing additional information
- * not provided in this table.
- *
- * ulCtrlPort1 This is the primary control port number for the device. This
- * may be used to specify different instances of the same device
- * type.
- *
- * ulCtrlPort2 This is the secondary control port number, of use when a given
- * device has more than one available channel.
- *
- * ulDataPort This is the port number for the data port of the device
- *
- * getRegister This is the routine used to read register values.
- *
- * setRegister This is the routine used to write register values.
- *
- * getData This is the routine used to read the data register (RX).
- *
- * setData This is the routine used to write the data register (TX).
- *
- * ulClock This is the baud rate clock speed.
- *
- * ulIntVector This encodes the interrupt vector of the device.
- */
-
-typedef struct _console_tbl {
- char *sDeviceName;
- console_devs deviceType;
- console_fns *pDeviceFns;
- boolean (*deviceProbe)(int minor);
- console_flow *pDeviceFlow;
- unsigned32 ulMargin;
- unsigned32 ulHysteresis;
- void *pDeviceParams;
- unsigned32 ulCtrlPort1;
- unsigned32 ulCtrlPort2;
- unsigned32 ulDataPort;
- getRegister_f getRegister;
- setRegister_f setRegister;
- getData_f getData;
- setData_f setData;
- unsigned32 ulClock;
- unsigned int ulIntVector;
-} console_tbl;
-
-typedef struct _console_data {
- void *termios_data;
- volatile boolean bActive;
- /*
- * This field may be used for any purpose required by the driver
- */
- void *pDeviceContext;
-} console_data;
-
-extern console_tbl Console_Port_Tbl[];
-extern console_data Console_Port_Data[];
-extern unsigned long Console_Port_Count;
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libchip/serial/serprobe.c b/c/src/lib/libchip/serial/serprobe.c
deleted file mode 100644
index b76bbebe3c..0000000000
--- a/c/src/lib/libchip/serial/serprobe.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-#include <libchip/serial.h>
-#include "sersupp.h"
-
-boolean libchip_serial_default_probe(int minor)
-{
- /*
- * If the configuration dependent probe has located the device then
- * assume it is there
- */
-
- return TRUE;
-}
-
-
-
diff --git a/c/src/lib/libchip/serial/sersupp.h b/c/src/lib/libchip/serial/sersupp.h
deleted file mode 100644
index a996d53c7c..0000000000
--- a/c/src/lib/libchip/serial/sersupp.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef __LIBCHIP_SERIAL_SUPPORT_h
-#define __LIBCHIP_SERIAL_SUPPORT_h
-
-int termios_baud_to_index(
- int termios_baud
-);
-
-int termios_baud_to_number(
- int termios_baud
-);
-
-boolean libchip_serial_default_probe(
- int minor
-);
-
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libchip/serial/termios_baud2index.c b/c/src/lib/libchip/serial/termios_baud2index.c
deleted file mode 100644
index b4bf3623a2..0000000000
--- a/c/src/lib/libchip/serial/termios_baud2index.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/termios.h>
-
-int termios_baud_to_index(
- int termios_baud
-)
-{
- int baud_index;
-
- switch (termios_baud) {
- case B0: baud_index = 0; break;
- case B50: baud_index = 1; break;
- case B75: baud_index = 2; break;
- case B110: baud_index = 3; break;
- case B134: baud_index = 4; break;
- case B150: baud_index = 5; break;
- case B200: baud_index = 6; break;
- case B300: baud_index = 7; break;
- case B600: baud_index = 8; break;
- case B1200: baud_index = 9; break;
- case B1800: baud_index = 10; break;
- case B2400: baud_index = 11; break;
- case B4800: baud_index = 12; break;
- case B9600: baud_index = 13; break;
- case B19200: baud_index = 14; break;
- case B38400: baud_index = 15; break;
- case B57600: baud_index = 16; break;
- case B115200: baud_index = 17; break;
- case B230400: baud_index = 18; break;
- case B460800: baud_index = 19; break;
- default: baud_index = -1; break;
- }
-
- return baud_index;
-}
-
diff --git a/c/src/lib/libchip/serial/termios_baud2num.c b/c/src/lib/libchip/serial/termios_baud2num.c
deleted file mode 100644
index 9c2ddc047e..0000000000
--- a/c/src/lib/libchip/serial/termios_baud2num.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/termios.h>
-
-int termios_baud_to_number(
- int termios_baud
-)
-{
- int baud;
-
- switch (termios_baud) {
- case B0: baud = 0; break;
- case B50: baud = 50; break;
- case B75: baud = 75; break;
- case B110: baud = 110; break;
- case B134: baud = 135; break;
- case B150: baud = 150; break;
- case B200: baud = 200; break;
- case B300: baud = 300; break;
- case B600: baud = 600; break;
- case B1200: baud = 1200; break;
- case B1800: baud = 1800; break;
- case B2400: baud = 2400; break;
- case B4800: baud = 4800; break;
- case B9600: baud = 9600; break;
- case B19200: baud = 19200; break;
- case B38400: baud = 38400; break;
- case B57600: baud = 57600; break;
- case B115200: baud = 115200; break;
- case B230400: baud = 230400; break;
- case B460800: baud = 460800; break;
- default: baud = -1; break;
- }
-
- return baud;
-}
-
diff --git a/c/src/lib/libchip/serial/z85c30.c b/c/src/lib/libchip/serial/z85c30.c
deleted file mode 100644
index b158887618..0000000000
--- a/c/src/lib/libchip/serial/z85c30.c
+++ /dev/null
@@ -1,889 +0,0 @@
-/*
- * This file contains the console driver chip level routines for the
- * Zilog z85c30 chip.
- *
- * The Zilog Z8530 is also available as:
- *
- * + Intel 82530
- * + AMD ???
- *
- * COPYRIGHT (c) 1998 by Radstone Technology
- *
- *
- * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
- * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
- *
- * You are hereby granted permission to use, copy, modify, and distribute
- * this file, provided that this notice, plus the above copyright notice
- * and disclaimer, appears in all copies. Radstone Technology will provide
- * no support for this code.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <rtems/libio.h>
-#include <stdlib.h>
-
-#include <libchip/serial.h>
-#include "z85c30_p.h"
-#include "sersupp.h"
-
-/*
- * Flow control is only supported when using interrupts
- */
-
-console_flow z85c30_flow_RTSCTS = {
- z85c30_negate_RTS, /* deviceStopRemoteTx */
- z85c30_assert_RTS /* deviceStartRemoteTx */
-};
-
-console_flow z85c30_flow_DTRCTS = {
- z85c30_negate_DTR, /* deviceStopRemoteTx */
- z85c30_assert_DTR /* deviceStartRemoteTx */
-};
-
-/*
- * Exported driver function table
- */
-
-console_fns z85c30_fns = {
- libchip_serial_default_probe, /* deviceProbe */
- z85c30_open, /* deviceFirstOpen */
- NULL, /* deviceLastClose */
- NULL, /* deviceRead */
- z85c30_write_support_int, /* deviceWrite */
- z85c30_initialize_interrupts, /* deviceInitialize */
- z85c30_write_polled, /* deviceWritePolled */
- NULL, /* deviceSetAttributes */
- TRUE /* deviceOutputUsesInterrupts */
-};
-
-console_fns z85c30_fns_polled = {
- libchip_serial_default_probe, /* deviceProbe */
- z85c30_open, /* deviceFirstOpen */
- z85c30_close, /* deviceLastClose */
- z85c30_inbyte_nonblocking_polled, /* deviceRead */
- z85c30_write_support_polled, /* deviceWrite */
- z85c30_init, /* deviceInitialize */
- z85c30_write_polled, /* deviceWritePolled */
- NULL, /* deviceSetAttributes */
- FALSE /* deviceOutputUsesInterrupts */
-};
-
-extern void set_vector( rtems_isr_entry, rtems_vector_number, int );
-
-/*
- * z85c30_initialize_port
- *
- * initialize a z85c30 Port
- */
-
-Z85C30_STATIC void z85c30_initialize_port(
- int minor
-)
-{
- unsigned32 ulCtrlPort;
- unsigned32 ulBaudDivisor;
- setRegister_f setReg;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Using register 4
- * Set up the clock rate is 16 times the data
- * rate, 8 bit sync char, 1 stop bit, no parity
- */
-
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR4, SCC_WR4_1_STOP | SCC_WR4_16_CLOCK );
-
- /*
- * Set up for 8 bits/character on receive with
- * receiver disable via register 3
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR3, SCC_WR3_RX_8_BITS );
-
- /*
- * Set up for 8 bits/character on transmit
- * with transmitter disable via register 5
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR5, SCC_WR5_TX_8_BITS );
-
- /*
- * Clear misc control bits
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR10, 0x00 );
-
- /*
- * Setup the source of the receive and xmit
- * clock as BRG output and the transmit clock
- * as the output source for TRxC pin via register 11
- */
- (*setReg)(
- ulCtrlPort,
- SCC_WR0_SEL_WR11,
- SCC_WR11_OUT_BR_GEN | SCC_WR11_TRXC_OI |
- SCC_WR11_TX_BR_GEN | SCC_WR11_RX_BR_GEN
- );
-
- ulBaudDivisor = Z85C30_Baud(
- (unsigned32) Console_Port_Tbl[minor].ulClock,
- (unsigned32) Console_Port_Tbl[minor].pDeviceParams
- );
-
- /*
- * Setup the lower 8 bits time constants=1E.
- * If the time constans=1E, then the desire
- * baud rate will be equilvalent to 9600, via register 12.
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR12, ulBaudDivisor & 0xff );
-
- /*
- * using register 13
- * Setup the upper 8 bits time constant
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR13, (ulBaudDivisor>>8) & 0xff );
-
- /*
- * Enable the baud rate generator enable with clock from the
- * SCC's PCLK input via register 14.
- */
- (*setReg)(
- ulCtrlPort,
- SCC_WR0_SEL_WR14,
- SCC_WR14_BR_EN | SCC_WR14_BR_SRC | SCC_WR14_NULL
- );
-
- /*
- * We are only interested in CTS state changes
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR15, SCC_WR15_CTS_IE );
-
- /*
- * Reset errors
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_RST_INT );
-
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_ERR_RST );
-
- /*
- * Enable the receiver via register 3
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR3, SCC_WR3_RX_8_BITS | SCC_WR3_RX_EN );
-
- /*
- * Enable the transmitter pins set via register 5.
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR5, SCC_WR5_TX_8_BITS | SCC_WR5_TX_EN );
-
- /*
- * Disable interrupts
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR1, 0 );
-
- /*
- * Reset TX CRC
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_RST_TX_CRC );
-
- /*
- * Reset interrupts
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_RST_INT );
-}
-
-/*
- * z85c30_open
- */
-
-Z85C30_STATIC int z85c30_open(
- int major,
- int minor,
- void *arg
-)
-{
-
- z85c30_initialize_port(minor);
-
- /*
- * Assert DTR
- */
-
- if (Console_Port_Tbl[minor].pDeviceFlow !=&z85c30_flow_DTRCTS) {
- z85c30_assert_DTR(minor);
- }
-
- return(RTEMS_SUCCESSFUL);
-}
-
-/*
- * z85c30_close
- */
-
-Z85C30_STATIC int z85c30_close(
- int major,
- int minor,
- void *arg
-)
-{
- /*
- * Negate DTR
- */
-
- if (Console_Port_Tbl[minor].pDeviceFlow !=&z85c30_flow_DTRCTS) {
- z85c30_negate_DTR(minor);
- }
-
- return(RTEMS_SUCCESSFUL);
-}
-
-/*
- * z85c30_init
- */
-
-Z85C30_STATIC void z85c30_init(int minor)
-{
- unsigned32 ulCtrlPort;
- unsigned8 dummy;
- z85c30_context *pz85c30Context;
- setRegister_f setReg;
- getRegister_f getReg;
-
- setReg = Console_Port_Tbl[minor].setRegister;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- pz85c30Context = (z85c30_context *)malloc(sizeof(z85c30_context));
-
- Console_Port_Data[minor].pDeviceContext = (void *)pz85c30Context;
-
- pz85c30Context->ucModemCtrl = SCC_WR5_TX_8_BITS | SCC_WR5_TX_EN;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- if ( ulCtrlPort == Console_Port_Tbl[minor].ulCtrlPort2 ) {
- /*
- * This is channel A
- */
- /*
- * Ensure port state machine is reset
- */
- dummy = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD0);
-
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR9, SCC_WR9_CH_A_RST);
-
- } else {
- /*
- * This is channel B
- */
- /*
- * Ensure port state machine is reset
- */
- dummy = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD0);
-
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR9, SCC_WR9_CH_B_RST);
- }
-}
-
-/*
- * These routines provide control of the RTS and DTR lines
- */
-
-/*
- * z85c30_assert_RTS
- */
-
-Z85C30_STATIC int z85c30_assert_RTS(int minor)
-{
- rtems_interrupt_level Irql;
- z85c30_context *pz85c30Context;
- setRegister_f setReg;
-
- setReg = Console_Port_Tbl[minor].setRegister;
-
- pz85c30Context = (z85c30_context *) Console_Port_Data[minor].pDeviceContext;
-
- /*
- * Assert RTS
- */
-
- rtems_interrupt_disable(Irql);
- pz85c30Context->ucModemCtrl|=SCC_WR5_RTS;
- (*setReg)(
- Console_Port_Tbl[minor].ulCtrlPort1,
- SCC_WR0_SEL_WR5,
- pz85c30Context->ucModemCtrl
- );
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * z85c30_negate_RTS
- */
-
-Z85C30_STATIC int z85c30_negate_RTS(int minor)
-{
- rtems_interrupt_level Irql;
- z85c30_context *pz85c30Context;
- setRegister_f setReg;
-
- setReg = Console_Port_Tbl[minor].setRegister;
-
- pz85c30Context = (z85c30_context *) Console_Port_Data[minor].pDeviceContext;
-
- /*
- * Negate RTS
- */
-
- rtems_interrupt_disable(Irql);
- pz85c30Context->ucModemCtrl&=~SCC_WR5_RTS;
- (*setReg)(
- Console_Port_Tbl[minor].ulCtrlPort1,
- SCC_WR0_SEL_WR5,
- pz85c30Context->ucModemCtrl
- );
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * These flow control routines utilise a connection from the local DTR
- * line to the remote CTS line
- */
-
-/*
- * z85c30_assert_DTR
- */
-
-Z85C30_STATIC int z85c30_assert_DTR(int minor)
-{
- rtems_interrupt_level Irql;
- z85c30_context *pz85c30Context;
- setRegister_f setReg;
-
- setReg = Console_Port_Tbl[minor].setRegister;
-
- pz85c30Context = (z85c30_context *) Console_Port_Data[minor].pDeviceContext;
-
- /*
- * Assert DTR
- */
-
- rtems_interrupt_disable(Irql);
- pz85c30Context->ucModemCtrl|=SCC_WR5_DTR;
- (*setReg)(
- Console_Port_Tbl[minor].ulCtrlPort1,
- SCC_WR0_SEL_WR5,
- pz85c30Context->ucModemCtrl
- );
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * z85c30_negate_DTR
- */
-
-Z85C30_STATIC int z85c30_negate_DTR(int minor)
-{
- rtems_interrupt_level Irql;
- z85c30_context *pz85c30Context;
- setRegister_f setReg;
-
- setReg = Console_Port_Tbl[minor].setRegister;
-
- pz85c30Context = (z85c30_context *) Console_Port_Data[minor].pDeviceContext;
-
- /*
- * Negate DTR
- */
-
- rtems_interrupt_disable(Irql);
- pz85c30Context->ucModemCtrl&=~SCC_WR5_DTR;
- (*setReg)(
- Console_Port_Tbl[minor].ulCtrlPort1,
- SCC_WR0_SEL_WR5,
- pz85c30Context->ucModemCtrl
- );
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * z85c30_set_attributes
- *
- * This function sets the SCC channel to reflect the requested termios
- * port settings.
- */
-
-Z85C30_STATIC int z85c30_set_attributes(
- int minor,
- const struct termios *t
-)
-{
- unsigned32 ulCtrlPort;
- unsigned32 ulBaudDivisor;
- unsigned32 wr3;
- unsigned32 wr4;
- unsigned32 wr5;
- int baud_requested;
- setRegister_f setReg;
- rtems_interrupt_level Irql;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Calculate the baud rate divisor
- */
-
- baud_requested = t->c_cflag & CBAUD;
- if (!baud_requested)
- baud_requested = B9600; /* default to 9600 baud */
-
- ulBaudDivisor = Z85C30_Baud(
- (unsigned32) Console_Port_Tbl[minor].ulClock,
- (unsigned32) termios_baud_to_number( baud_requested )
- );
-
- wr3 = SCC_WR3_RX_EN;
- wr4 = SCC_WR4_16_CLOCK;
- wr5 = SCC_WR5_TX_EN;
-
- /*
- * Parity
- */
-
- if (t->c_cflag & PARENB) {
- wr4 |= SCC_WR4_PAR_EN;
- if (!(t->c_cflag & PARODD))
- wr4 |= SCC_WR4_PAR_EVEN;
- }
-
- /*
- * Character Size
- */
-
- if (t->c_cflag & CSIZE) {
- switch (t->c_cflag & CSIZE) {
- case CS5: break;
- case CS6: wr3 |= SCC_WR3_RX_6_BITS; wr5 |= SCC_WR5_TX_6_BITS; break;
- case CS7: wr3 |= SCC_WR3_RX_7_BITS; wr5 |= SCC_WR5_TX_7_BITS; break;
- case CS8: wr3 |= SCC_WR3_RX_8_BITS; wr5 |= SCC_WR5_TX_8_BITS; break;
- }
- } else {
- wr3 |= SCC_WR3_RX_8_BITS; /* default to 9600,8,N,1 */
- wr5 |= SCC_WR5_TX_8_BITS; /* default to 9600,8,N,1 */
- }
-
- /*
- * Stop Bits
- */
-
- if (t->c_cflag & CSTOPB) {
- wr4 |= SCC_WR4_2_STOP; /* 2 stop bits */
- } else {
- wr4 |= SCC_WR4_1_STOP; /* 1 stop bits */
- }
-
- /*
- * Now actually set the chip
- */
-
- rtems_interrupt_disable(Irql);
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR4, wr4 );
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR3, wr3 );
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR5, wr5 );
-
- /*
- * Setup the lower 8 bits time constants=1E.
- * If the time constans=1E, then the desire
- * baud rate will be equilvalent to 9600, via register 12.
- */
-
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR12, ulBaudDivisor & 0xff );
-
- /*
- * using register 13
- * Setup the upper 8 bits time constant
- */
-
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR13, (ulBaudDivisor>>8) & 0xff );
-
- rtems_interrupt_enable(Irql);
-
- return 0;
-}
-
-/*
- * z85c30_process
- *
- * This is the per port ISR handler.
- */
-
-Z85C30_STATIC void z85c30_process(
- int minor,
- unsigned8 ucIntPend
-)
-{
- unsigned32 ulCtrlPort;
- volatile unsigned8 z85c30_status;
- unsigned char cChar;
- setRegister_f setReg;
- getRegister_f getReg;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- /*
- * Deal with any received characters
- */
-
- while (ucIntPend&SCC_RR3_B_RX_IP)
- {
- z85c30_status = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD0);
- if (!Z85C30_Status_Is_RX_character_available(z85c30_status)) {
- break;
- }
-
- /*
- * Return the character read.
- */
-
- cChar = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD8);
-
- rtems_termios_enqueue_raw_characters(
- Console_Port_Data[minor].termios_data,
- &cChar,
- 1
- );
- }
-
- /*
- * There could be a race condition here if there is not yet a TX
- * interrupt pending but the buffer is empty. This condition has
- * been seen before on other z8530 drivers but has not been seen
- * with this one. The typical solution is to use "vector includes
- * status" or to only look at the interrupts actually pending
- * in RR3.
- */
-
- while (TRUE) {
- z85c30_status = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD0);
- if (!Z85C30_Status_Is_TX_buffer_empty(z85c30_status)) {
- /*
- * We'll get another interrupt when
- * the transmitter holding reg. becomes
- * free again and we are clear to send
- */
- break;
- }
-
-#if 0
- if (!Z85C30_Status_Is_CTS_asserted(z85c30_status)) {
- /*
- * We can't transmit yet
- */
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_RST_TX_INT);
- /*
- * The next state change of CTS will wake us up
- */
- break;
- }
-#endif
-
- rtems_termios_dequeue_characters(Console_Port_Data[minor].termios_data, 1);
- if (rtems_termios_dequeue_characters(
- Console_Port_Data[minor].termios_data, 1)) {
- if (Console_Port_Tbl[minor].pDeviceFlow != &z85c30_flow_RTSCTS) {
- z85c30_negate_RTS(minor);
- }
- Console_Port_Data[minor].bActive = FALSE;
- z85c30_enable_interrupts(minor, SCC_ENABLE_ALL_INTR_EXCEPT_TX);
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_RST_TX_INT);
- break;
- }
-
- }
-
- if (ucIntPend & SCC_RR3_B_EXT_IP) {
- /*
- * Clear the external status interrupt
- */
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_RST_INT);
- z85c30_status = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD0);
- }
-
- /*
- * Reset interrupts
- */
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_RST_HI_IUS);
-}
-
-/*
- * z85c30_isr
- *
- * This is the ISR handler for each Z8530.
- */
-
-Z85C30_STATIC rtems_isr z85c30_isr(
- rtems_vector_number vector
-)
-{
- int minor;
- unsigned32 ulCtrlPort;
- volatile unsigned8 ucIntPend;
- volatile unsigned8 ucIntPendPort;
- getRegister_f getReg;
-
- for (minor=0;minor<Console_Port_Count;minor++) {
- if(Console_Port_Tbl[minor].ulIntVector == vector &&
- Console_Port_Tbl[minor].deviceType == SERIAL_Z85C30 ) {
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort2;
- getReg = Console_Port_Tbl[minor].getRegister;
- do {
- ucIntPend = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD3);
-
- /*
- * If this is channel A select channel A status
- */
-
- if (ulCtrlPort == Console_Port_Tbl[minor].ulCtrlPort1) {
- ucIntPendPort = ucIntPend>>3;
- ucIntPendPort = ucIntPendPort&=7;
- } else {
- ucIntPendPort = ucIntPend &= 7;
- }
-
- if (ucIntPendPort) {
- z85c30_process(minor, ucIntPendPort);
- }
- } while (ucIntPendPort);
- }
- }
-}
-
-/*
- * z85c30_enable_interrupts
- *
- * This routine enables the specified interrupts for this minor.
- */
-
-Z85C30_STATIC void z85c30_enable_interrupts(
- int minor,
- int interrupt_mask
-)
-{
- unsigned32 ulCtrlPort;
- setRegister_f setReg;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR1, interrupt_mask);
-}
-
-/*
- * z85c30_initialize_interrupts
- *
- * This routine initializes the port to use interrupts.
- */
-
-Z85C30_STATIC void z85c30_initialize_interrupts(
- int minor
-)
-{
- unsigned32 ulCtrlPort1;
- unsigned32 ulCtrlPort2;
- setRegister_f setReg;
-
- ulCtrlPort1 = Console_Port_Tbl[minor].ulCtrlPort1;
- ulCtrlPort2 = Console_Port_Tbl[minor].ulCtrlPort2;
- setReg = Console_Port_Tbl[minor].setRegister;
-
-
- z85c30_init(minor);
-
- Console_Port_Data[minor].bActive=FALSE;
-
- z85c30_initialize_port( minor );
-
- if (Console_Port_Tbl[minor].pDeviceFlow != &z85c30_flow_RTSCTS) {
- z85c30_negate_RTS(minor);
- }
-
- set_vector(z85c30_isr, Console_Port_Tbl[minor].ulIntVector, 1);
-
- z85c30_enable_interrupts(minor, SCC_ENABLE_ALL_INTR_EXCEPT_TX);
-
- (*setReg)(ulCtrlPort1, SCC_WR0_SEL_WR2, 0); /* XXX vector */
- (*setReg)(ulCtrlPort1, SCC_WR0_SEL_WR9, SCC_WR9_MIE);
-
- /*
- * Reset interrupts
- */
-
- (*setReg)(ulCtrlPort1, SCC_WR0_SEL_WR0, SCC_WR0_RST_INT);
-}
-
-/*
- * z85c30_write_support_int
- *
- * Console Termios output entry point.
- *
- */
-
-Z85C30_STATIC int z85c30_write_support_int(
- int minor,
- const char *buf,
- int len)
-{
- unsigned32 Irql;
- unsigned32 ulCtrlPort;
- setRegister_f setReg;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * We are using interrupt driven output and termios only sends us
- * one character at a time.
- */
-
- if ( !len )
- return 0;
-
- /*
- * Put the character out and enable interrupts if necessary.
- */
-
- if (Console_Port_Tbl[minor].pDeviceFlow != &z85c30_flow_RTSCTS) {
- z85c30_assert_RTS(minor);
- }
- rtems_interrupt_disable(Irql);
- if ( Console_Port_Data[minor].bActive == FALSE) {
- Console_Port_Data[minor].bActive = TRUE;
- z85c30_enable_interrupts(minor, SCC_ENABLE_ALL_INTR);
- }
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR8, *buf);
- rtems_interrupt_enable(Irql);
-
- return 1;
-}
-
-/*
- * z85c30_inbyte_nonblocking_polled
- *
- * This routine polls for a character.
- */
-
-Z85C30_STATIC int z85c30_inbyte_nonblocking_polled(
- int minor
-)
-{
- volatile unsigned8 z85c30_status;
- unsigned32 ulCtrlPort;
- getRegister_f getReg;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- /*
- * return -1 if a character is not available.
- */
- z85c30_status = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD0);
- if (!Z85C30_Status_Is_RX_character_available(z85c30_status)) {
- return -1;
- }
-
- /*
- * Return the character read.
- */
-
- return (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD8);
-}
-
-/*
- * z85c30_write_support_polled
- *
- * Console Termios output entry point.
- *
- */
-
-Z85C30_STATIC int z85c30_write_support_polled(
- int minor,
- const char *buf,
- int len)
-{
- int nwrite=0;
-
- /*
- * poll each byte in the string out of the port.
- */
- while (nwrite < len) {
- z85c30_write_polled(minor, *buf++);
- nwrite++;
- }
-
- /*
- * return the number of bytes written.
- */
- return nwrite;
-}
-
-/*
- * z85c30_write_polled
- *
- * This routine transmits a character using polling.
- */
-
-Z85C30_STATIC void z85c30_write_polled(
- int minor,
- char cChar
-)
-{
- volatile unsigned8 z85c30_status;
- unsigned32 ulCtrlPort;
- getRegister_f getReg;
- setRegister_f setReg;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- getReg = Console_Port_Tbl[minor].getRegister;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Wait for the Transmit buffer to indicate that it is empty.
- */
-
- z85c30_status = (*getReg)( ulCtrlPort, SCC_WR0_SEL_RD0 );
-
- while (!Z85C30_Status_Is_TX_buffer_empty(z85c30_status)) {
- /*
- * Yield while we wait
- */
-#if 0
- if (_System_state_Is_up(_System_state_Get())) {
- rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
- }
-#endif
- z85c30_status = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD0);
- }
-
- /*
- * Write the character.
- */
-
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR8, cChar );
-}
-
diff --git a/c/src/lib/libchip/serial/z85c30.h b/c/src/lib/libchip/serial/z85c30.h
deleted file mode 100644
index f1beeef5e0..0000000000
--- a/c/src/lib/libchip/serial/z85c30.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * This include file contains all console driver definitions for the
- * Zilog z85c30.
- *
- * COPYRIGHT (c) 1998 by Radstone Technology
- *
- *
- * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
- * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
- *
- * You are hereby granted permission to use, copy, modify, and distribute
- * this file, provided that this notice, plus the above copyright notice
- * and disclaimer, appears in all copies. Radstone Technology will provide
- * no support for this code.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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:
- */
-
-#ifndef __Z85C30_H
-#define __Z85C30_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Driver function table
- */
-
-extern console_fns z85c30_fns;
-extern console_fns z85c30_fns_polled;
-
-/*
- * Flow control function tables
- */
-
-extern console_flow z85c30_flow_RTSCTS;
-extern console_flow z85c30_flow_DTRCTS;
-
-/*
- * Default register access routines
- */
-
-unsigned8 z85c30_get_register( /* registers are byte-wide */
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum
-);
-
-void z85c30_set_register(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned8 ucData
-);
-
-unsigned8 z85c30_get_data(
- unsigned32 ulDataPort
-);
-
-void z85c30_set_data(
- unsigned32 ulDataPort,
- unsigned8 ucData
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/lib/libchip/serial/z85c30_p.h b/c/src/lib/libchip/serial/z85c30_p.h
deleted file mode 100644
index 0076fbeaef..0000000000
--- a/c/src/lib/libchip/serial/z85c30_p.h
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * This include file contains all private driver definitions for the
- * Zilog z85c30.
- *
- * COPYRIGHT (c) 1998 by Radstone Technology
- *
- *
- * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
- * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
- *
- * You are hereby granted permission to use, copy, modify, and distribute
- * this file, provided that this notice, plus the above copyright notice
- * and disclaimer, appears in all copies. Radstone Technology will provide
- * no support for this code.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-#ifndef __Z85C30_P_H
-#define __Z85C30_P_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Define Z85C30_STATIC to nothing while debugging so the entry points
- * will show up in the symbol table.
- */
-
-#define Z85C30_STATIC
-
-/* #define Z85C30_STATIC static */
-
-/* bit values for write register 0 */
-/* command register */
-
-#define SCC_WR0_SEL_WR0 0x00
-#define SCC_WR0_SEL_WR1 0x01
-#define SCC_WR0_SEL_WR2 0x02
-#define SCC_WR0_SEL_WR3 0x03
-#define SCC_WR0_SEL_WR4 0x04
-#define SCC_WR0_SEL_WR5 0x05
-#define SCC_WR0_SEL_WR6 0x06
-#define SCC_WR0_SEL_WR7 0x07
-#define SCC_WR0_SEL_WR8 0x08
-#define SCC_WR0_SEL_WR9 0x09
-#define SCC_WR0_SEL_WR10 0x0a
-#define SCC_WR0_SEL_WR11 0x0b
-#define SCC_WR0_SEL_WR12 0x0c
-#define SCC_WR0_SEL_WR13 0x0d
-#define SCC_WR0_SEL_WR14 0x0e
-#define SCC_WR0_SEL_WR15 0x0f
-#define SCC_WR0_SEL_RD0 0x00
-#define SCC_WR0_SEL_RD1 0x01
-#define SCC_WR0_SEL_RD2 0x02
-#define SCC_WR0_SEL_RD3 0x03
-#define SCC_WR0_SEL_RD4 0x04
-#define SCC_WR0_SEL_RD5 0x05
-#define SCC_WR0_SEL_RD6 0x06
-#define SCC_WR0_SEL_RD7 0x07
-#define SCC_WR0_SEL_RD8 0x08
-#define SCC_WR0_SEL_RD9 0x09
-#define SCC_WR0_SEL_RD10 0x0a
-#define SCC_WR0_SEL_RD11 0x0b
-#define SCC_WR0_SEL_RD12 0x0c
-#define SCC_WR0_SEL_RD13 0x0d
-#define SCC_WR0_SEL_RD14 0x0e
-#define SCC_WR0_SEL_RD15 0x0f
-#define SCC_WR0_NULL_CODE 0x00
-#define SCC_WR0_RST_INT 0x10
-#define SCC_WR0_SEND_ABORT 0x18
-#define SCC_WR0_EN_INT_RX 0x20
-#define SCC_WR0_RST_TX_INT 0x28
-#define SCC_WR0_ERR_RST 0x30
-#define SCC_WR0_RST_HI_IUS 0x38
-#define SCC_WR0_RST_RX_CRC 0x40
-#define SCC_WR0_RST_TX_CRC 0x80
-#define SCC_WR0_RST_TX_UND 0xc0
-
-/* write register 2 */
-/* interrupt vector */
-
-/* bit values for write register 1 */
-/* tx/rx interrupt and data transfer mode definition */
-
-#define SCC_WR1_EXT_INT_EN 0x01
-#define SCC_WR1_TX_INT_EN 0x02
-#define SCC_WR1_PARITY 0x04
-#define SCC_WR1_RX_INT_DIS 0x00
-#define SCC_WR1_RX_INT_FIR 0x08
-#define SCC_WR1_INT_ALL_RX 0x10
-#define SCC_WR1_RX_INT_SPE 0x18
-#define SCC_WR1_RDMA_RECTR 0x20
-#define SCC_WR1_RDMA_FUNC 0x40
-#define SCC_WR1_RDMA_EN 0x80
-
-#define SCC_ENABLE_ALL_INTR \
- (SCC_WR1_EXT_INT_EN | SCC_WR1_TX_INT_EN | SCC_WR1_INT_ALL_RX)
-
-#define SCC_DISABLE_ALL_INTR 0x00
-
-#define SCC_ENABLE_ALL_INTR_EXCEPT_TX \
- (SCC_WR1_EXT_INT_EN | SCC_WR1_INT_ALL_RX)
-
-/* bit values for write register 3 */
-/* receive parameters and control */
-
-#define SCC_WR3_RX_EN 0x01
-#define SCC_WR3_SYNC_CHAR 0x02
-#define SCC_WR3_ADR_SEARCH 0x04
-#define SCC_WR3_RX_CRC_EN 0x08
-#define SCC_WR3_ENTER_HUNT 0x10
-#define SCC_WR3_AUTO_EN 0x20
-#define SCC_WR3_RX_5_BITS 0x00
-#define SCC_WR3_RX_7_BITS 0x40
-#define SCC_WR3_RX_6_BITS 0x80
-#define SCC_WR3_RX_8_BITS 0xc0
-
-/* bit values for write register 4 */
-/* tx/rx misc parameters and modes */
-
-#define SCC_WR4_PAR_EN 0x01
-#define SCC_WR4_PAR_EVEN 0x02
-#define SCC_WR4_SYNC_EN 0x00
-#define SCC_WR4_1_STOP 0x04
-#define SCC_WR4_2_STOP 0x0c
-#define SCC_WR4_8_SYNC 0x00
-#define SCC_WR4_16_SYNC 0x10
-#define SCC_WR4_SDLC 0x20
-#define SCC_WR4_EXT_SYNC 0x30
-#define SCC_WR4_1_CLOCK 0x00
-#define SCC_WR4_16_CLOCK 0x40
-#define SCC_WR4_32_CLOCK 0x80
-#define SCC_WR4_64_CLOCK 0xc0
-
-/* bit values for write register 5 */
-/* transmit parameter and controls */
-
-#define SCC_WR5_TX_CRC_EN 0x01
-#define SCC_WR5_RTS 0x02
-#define SCC_WR5_SDLC 0x04
-#define SCC_WR5_TX_EN 0x08
-#define SCC_WR5_SEND_BRK 0x10
-
-#define SCC_WR5_TX_5_BITS 0x00
-#define SCC_WR5_TX_7_BITS 0x20
-#define SCC_WR5_TX_6_BITS 0x40
-#define SCC_WR5_TX_8_BITS 0x60
-#define SCC_WR5_DTR 0x80
-
-/* write register 6 */
-/* sync chars or sdlc address field */
-
-/* write register 7 */
-/* sync char or sdlc flag */
-
-/* write register 8 */
-/* transmit buffer */
-
-/* bit values for write register 9 */
-/* master interrupt control */
-
-#define SCC_WR9_VIS 0x01
-#define SCC_WR9_NV 0x02
-#define SCC_WR9_DLC 0x04
-#define SCC_WR9_MIE 0x08
-#define SCC_WR9_STATUS_HI 0x10
-#define SCC_WR9_NO_RST 0x00
-#define SCC_WR9_CH_B_RST 0x40
-#define SCC_WR9_CH_A_RST 0x80
-#define SCC_WR9_HDWR_RST 0xc0
-
-/* bit values for write register 10 */
-/* misc tx/rx control bits */
-
-#define SCC_WR10_6_BIT_SYNC 0x01
-#define SCC_WR10_LOOP_MODE 0x02
-#define SCC_WR10_ABORT_UND 0x04
-#define SCC_WR10_MARK_IDLE 0x08
-#define SCC_WR10_ACT_POLL 0x10
-#define SCC_WR10_NRZ 0x00
-#define SCC_WR10_NRZI 0x20
-#define SCC_WR10_FM1 0x40
-#define SCC_WR10_FM0 0x60
-#define SCC_WR10_CRC_PRESET 0x80
-
-/* bit values for write register 11 */
-/* clock mode control */
-
-#define SCC_WR11_OUT_XTAL 0x00
-#define SCC_WR11_OUT_TX_CLK 0x01
-#define SCC_WR11_OUT_BR_GEN 0x02
-#define SCC_WR11_OUT_DPLL 0x03
-#define SCC_WR11_TRXC_OI 0x04
-#define SCC_WR11_TX_RTXC 0x00
-#define SCC_WR11_TX_TRXC 0x08
-#define SCC_WR11_TX_BR_GEN 0x10
-#define SCC_WR11_TX_DPLL 0x18
-#define SCC_WR11_RX_RTXC 0x00
-#define SCC_WR11_RX_TRXC 0x20
-#define SCC_WR11_RX_BR_GEN 0x40
-#define SCC_WR11_RX_DPLL 0x60
-#define SCC_WR11_RTXC_XTAL 0x80
-
-/* write register 12 */
-/* lower byte of baud rate generator time constant */
-
-/* write register 13 */
-/* upper byte of baud rate generator time constant */
-
-/* bit values for write register 14 */
-/* misc control bits */
-
-#define SCC_WR14_BR_EN 0x01
-#define SCC_WR14_BR_SRC 0x02
-#define SCC_WR14_DTR_FUNC 0x04
-#define SCC_WR14_AUTO_ECHO 0x08
-#define SCC_WR14_LCL_LOOP 0x10
-#define SCC_WR14_NULL 0x00
-#define SCC_WR14_SEARCH 0x20
-#define SCC_WR14_RST_CLK 0x40
-#define SCC_WR14_DIS_DPLL 0x60
-#define SCC_WR14_SRC_BR 0x80
-#define SCC_WR14_SRC_RTXC 0xa0
-#define SCC_WR14_FM_MODE 0xc0
-#define SCC_WR14_NRZI 0xe0
-
-/* bit values for write register 15 */
-/* external/status interrupt control */
-
-#define SCC_WR15_ZERO_CNT 0x02
-#define SCC_WR15_CD_IE 0x08
-#define SCC_WR15_SYNC_IE 0x10
-#define SCC_WR15_CTS_IE 0x20
-#define SCC_WR15_TX_UND_IE 0x40
-#define SCC_WR15_BREAK_IE 0x80
-
-/* bit values for read register 0 */
-/* tx/rx buffer status and external status */
-
-#define SCC_RR0_RX_AVAIL 0x01
-#define SCC_RR0_ZERO_CNT 0x02
-#define SCC_RR0_TX_EMPTY 0x04
-#define SCC_RR0_CD 0x08
-#define SCC_RR0_SYNC 0x10
-#define SCC_RR0_CTS 0x20
-#define SCC_RR0_TX_UND 0x40
-#define SCC_RR0_BREAK 0x80
-
-/* bit values for read register 1 */
-
-#define SCC_RR1_ALL_SENT 0x01
-#define SCC_RR1_RES_CD_2 0x02
-#define SCC_RR1_RES_CD_1 0x01
-#define SCC_RR1_RES_CD_0 0x08
-#define SCC_RR1_PAR_ERR 0x10
-#define SCC_RR1_RX_OV_ERR 0x20
-#define SCC_RR1_CRC_ERR 0x40
-#define SCC_RR1_END_FRAME 0x80
-
-/* read register 2 */
-/* interrupt vector */
-
-/* bit values for read register 3 */
-/* interrupt pending register */
-
-#define SCC_RR3_B_EXT_IP 0x01
-#define SCC_RR3_B_TX_IP 0x02
-#define SCC_RR3_B_RX_IP 0x04
-#define SCC_RR3_A_EXT_IP 0x08
-#define SCC_RR3_A_TX_IP 0x10
-#define SCC_RR3_A_RX_IP 0x20
-
-/* read register 8 */
-/* receive data register */
-
-/* bit values for read register 10 */
-/* misc status bits */
-
-#define SCC_RR10_ON_LOOP 0x02
-#define SCC_RR10_LOOP_SEND 0x10
-#define SCC_RR10_2_CLK_MIS 0x40
-#define SCC_RR10_1_CLK_MIS 0x80
-
-/* read register 12 */
-/* lower byte of time constant */
-
-/* read register 13 */
-/* upper byte of time constant */
-
-/* bit values for read register 15 */
-/* external/status ie bits */
-
-#define SCC_RR15_ZERO_CNT 0x02
-#define SCC_RR15_CD_IE 0x08
-#define SCC_RR15_SYNC_IE 0x10
-#define SCC_RR15_CTS_IE 0x20
-#define SCC_RR15_TX_UND_IE 0x40
-#define SCC_RR15_BREAK_IE 0x80
-
-typedef struct _z85c30_context
-{
- unsigned8 ucModemCtrl;
-} z85c30_context;
-
-/*
- * The following macro calculates the Baud constant. For the Z85C30 chip.
- *
- * Note: baud constant = ((clock frequency / Clock_X) / (2 * Baud Rate)) - 2
- * eg ((10,000,000 / 16) / (2 * Baud Rate)) - 2
- */
-
-#define Z85C30_Baud( _clock, _baud_rate ) \
- ( ((_clock) /( 16 * 2 * _baud_rate)) - 2)
-
-#define Z85C30_Status_Is_RX_character_available(_status) \
- ((_status) & SCC_RR0_RX_AVAIL)
-
-#define Z85C30_Status_Is_TX_buffer_empty(_status) \
- ((_status) & SCC_RR0_TX_EMPTY)
-
-#define Z85C30_Status_Is_CTS_asserted(_status) \
- ((_status) & SCC_RR0_CTS)
-
-#define Z85C30_Status_Is_break_abort(_status) \
- ((_status) & SCC_RR0_BREAK)
-
-/*
- * Private routines
- */
-
-Z85C30_STATIC void z85c30_init(int minor);
-
-Z85C30_STATIC int z85c30_set_attributes(
- int minor,
- const struct termios *t
-);
-
-Z85C30_STATIC int z85c30_open(
- int major,
- int minor,
- void * arg
-);
-
-Z85C30_STATIC int z85c30_close(
- int major,
- int minor,
- void * arg
-);
-
-Z85C30_STATIC void z85c30_write_polled(
- int minor,
- char cChar
-);
-
-Z85C30_STATIC int z85c30_assert_RTS(
- int minor
-);
-
-Z85C30_STATIC int z85c30_negate_RTS(
- int minor
-);
-
-Z85C30_STATIC int z85c30_assert_DTR(
- int minor
-);
-
-Z85C30_STATIC int z85c30_negate_DTR(
- int minor
-);
-
-Z85C30_STATIC void z85c30_initialize_interrupts(int minor);
-
-Z85C30_STATIC int z85c30_write_support_int(
- int minor,
- const char *buf,
- int len
-);
-
-Z85C30_STATIC int z85c30_write_support_polled(
- int minor,
- const char *buf,
- int len
-);
-
-Z85C30_STATIC int z85c30_inbyte_nonblocking_polled(
- int minor
-);
-
-Z85C30_STATIC void z85c30_enable_interrupts(
- int minor,
- int interrupt_mask
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/lib/libchip/serial/z85c30_reg.c b/c/src/lib/libchip/serial/z85c30_reg.c
deleted file mode 100644
index 889dad4530..0000000000
--- a/c/src/lib/libchip/serial/z85c30_reg.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the z85c30 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#ifndef _Z85C30_MULTIPLIER
-#define _Z85C30_MULTIPLIER 1
-#define _Z85C30_NAME(_X) _X
-#define _Z85C30_TYPE unsigned8
-#endif
-
-/*
- * Z85C30 Get Register Routine
- */
-
-unsigned8 _Z85C30_NAME(z85c30_get_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum
-)
-{
- _Z85C30_TYPE *port;
- unsigned8 data;
- rtems_interrupt_level level;
-
- port = (_Z85C30_TYPE *)ulCtrlPort;
-
- rtems_interrupt_disable(level);
-
- if(ucRegNum) {
- *port = ucRegNum;
- }
- data = *port;
- rtems_interrupt_enable(level);
-
- return data;
-}
-
-/*
- * Z85C30 Set Register Routine
- */
-
-void _Z85C30_NAME(z85c30_set_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned8 ucData
-)
-{
- _Z85C30_TYPE *port;
- rtems_interrupt_level level;
-
- port = (_Z85C30_TYPE *)ulCtrlPort;
-
- rtems_interrupt_disable(level);
- if(ucRegNum) {
- *port = ucRegNum;
- }
- *port = ucData;
- rtems_interrupt_enable(level);
-}
diff --git a/c/src/lib/libcpu/Makefile.in b/c/src/lib/libcpu/Makefile.in
deleted file mode 100644
index 5c974036b3..0000000000
--- a/c/src/lib/libcpu/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=$(wildcard $(RTEMS_CPU))
diff --git a/c/src/lib/libcpu/README b/c/src/lib/libcpu/README
deleted file mode 100644
index e7e293660c..0000000000
--- a/c/src/lib/libcpu/README
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-This is the README file for libcpu.
-
-This directory contains reusable libraries which are CPU dependent but not
-target board dependent. For example, the HPPA has an on chip interval timer
-which may be used by all HPPA bsp's.
-
-Another example might be the Intel i960CA has on-chip DMA which could be
-supported in a library and placed in lib/libcpu/i960. This level of support
-will make it easier for others developing embedded applications on a given
-CPU.
diff --git a/c/src/lib/libcpu/hppa1.1/Makefile.in b/c/src/lib/libcpu/hppa1.1/Makefile.in
deleted file mode 100644
index 278bc4ebe5..0000000000
--- a/c/src/lib/libcpu/hppa1.1/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=include milli runway clock timer semaphore
diff --git a/c/src/lib/libcpu/hppa1.1/clock/Makefile.in b/c/src/lib/libcpu/hppa1.1/clock/Makefile.in
deleted file mode 100644
index 7b299d4ef0..0000000000
--- a/c/src/lib/libcpu/hppa1.1/clock/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=clock
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by
-# libbsp/hppa/BSP/wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/hppa1.1/clock/clock.c b/c/src/lib/libcpu/hppa1.1/clock/clock.c
deleted file mode 100644
index 1dcfa665ec..0000000000
--- a/c/src/lib/libcpu/hppa1.1/clock/clock.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/* Clock
- *
- * This routine initializes the interval timer on the
- * PA-RISC CPU. The tick frequency is specified by the bsp.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <rtems/libio.h>
-
-/* should get this from bsp.h, but it is not installed yet */
-rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int);
-extern rtems_configuration_table BSP_Configuration;
-
-#include <stdlib.h> /* for atexit() */
-
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
-typedef unsigned long long hppa_click_count_t;
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-/*
- * CPU_HPPA_CLICKS_PER_TICK is either a #define or an rtems_unsigned32
- * allocated and set by bsp_start()
- */
-
-#ifndef CPU_HPPA_CLICKS_PER_TICK
-extern rtems_unsigned32 CPU_HPPA_CLICKS_PER_TICK;
-#endif
-
-volatile rtems_unsigned32 Clock_driver_ticks;
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-
-rtems_unsigned32 most_recent_itimer_value;
-
-rtems_unsigned64 Clock_clicks; /* running total of cycles */
-
-rtems_unsigned32 Clock_clicks_interrupt;
-
-void Clock_exit(void);
-
-void
-ReInstall_clock(rtems_isr_entry new_clock_isr)
-{
- rtems_unsigned32 isrlevel = 0;
-
- rtems_interrupt_disable(isrlevel);
- (void) set_vector(
- new_clock_isr,
- HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER,
- 1
- );
- rtems_interrupt_enable(isrlevel);
-}
-
-/*
- * read itimer and update Clock_clicks as appropriate
- */
-
-rtems_unsigned32
-Clock_read_itimer()
-{
- rtems_unsigned32 isrlevel;
- rtems_unsigned32 itimer_value;
- rtems_unsigned32 wrap_count;
- rtems_unsigned32 recent_count;
-
- rtems_interrupt_disable(isrlevel);
-
- wrap_count = (Clock_clicks & 0xFFFFFFFF00000000ULL) >> 32;
- recent_count = (rtems_unsigned32) Clock_clicks;
-
- itimer_value = get_itimer();
-
- if (itimer_value < recent_count)
- wrap_count++;
- Clock_clicks = (((rtems_unsigned64) wrap_count) << 32) + itimer_value;
-
- rtems_interrupt_enable(isrlevel);
-
- return itimer_value;
-}
-
-
-void Install_clock(rtems_isr_entry clock_isr)
-{
- Clock_driver_ticks = 0;
- Clock_clicks_interrupt = 0;
- Clock_clicks = 0;
-
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
-
- if (BSP_Configuration.ticks_per_timeslice)
- {
- /*
- * initialize the interval here
- * First tick is set to right amount of time in the future
- * Future ticks will be incremented over last value set
- * in order to provide consistent clicks in the face of
- * interrupt overhead
- */
-
- Clock_clicks_interrupt = Clock_read_itimer() + CPU_HPPA_CLICKS_PER_TICK;
- set_itimer((rtems_unsigned32) Clock_clicks_interrupt);
-
- (void) set_vector(clock_isr, HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER, 1);
- }
- atexit(Clock_exit);
-}
-
-rtems_isr
-Clock_isr(rtems_vector_number vector)
-{
- rtems_unsigned32 clicks_til_next_interrupt;
- rtems_unsigned32 itimer_value;
-
- /*
- * setup for next interrupt; making sure the new value is reasonably
- * in the future.... in case we lost out on an interrupt somehow
- */
-
- itimer_value = Clock_read_itimer();
- Clock_clicks_interrupt += CPU_HPPA_CLICKS_PER_TICK;
-
- /*
- * how far away is next interrupt *really*
- * It may be a long time; this subtraction works even if
- * Clock_clicks_interrupt < Clock_clicks_low_order via
- * the miracle of unsigned math.
- */
- clicks_til_next_interrupt = Clock_clicks_interrupt - itimer_value;
-
- /*
- * If it is too soon then bump it up.
- * This should only happen if CPU_HPPA_CLICKS_PER_TICK is too small.
- * But setting it low is useful for debug, so...
- */
-
- if (clicks_til_next_interrupt < 400)
- {
- Clock_clicks_interrupt = itimer_value + 1000;
- /* XXX: count these! this should be rare */
- }
-
- /*
- * If it is too late, that means we missed the interrupt somehow.
- * Rather than wait 35-50s for a wrap, we just fudge it here.
- */
-
- if (clicks_til_next_interrupt > CPU_HPPA_CLICKS_PER_TICK)
- {
- Clock_clicks_interrupt = itimer_value + 1000;
- /* XXX: count these! this should never happen :-) */
- }
-
- set_itimer((rtems_unsigned32) Clock_clicks_interrupt);
-
- Clock_driver_ticks++;
-
- if (Clock_isrs == 1)
- {
- rtems_clock_tick();
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 10000;
- if (Clock_isrs == 0)
- Clock_isrs = 1;
- }
- else
- Clock_isrs--;
-}
-
-/*
- * Called via atexit()
- * Remove the clock interrupt handler by setting handler to NULL
- */
-
-void
-Clock_exit(void)
-{
- if ( BSP_Configuration.ticks_per_timeslice )
- {
- (void) set_vector(0, HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER, 1);
- }
-}
-
-/*
- * spin delay for specified number of microseconds
- * used by RTEMS delay macro
- */
-
-void
-Clock_delay(rtems_unsigned32 microseconds)
-{
- rtems_unsigned64 future_time;
-
- (void) Clock_read_itimer();
- future_time = Clock_clicks +
- ((rtems_unsigned64) microseconds) *
- Cpu_table.itimer_clicks_per_microsecond;
-
- for (;;)
- {
- (void) Clock_read_itimer();
- if (future_time <= Clock_clicks)
- break;
- }
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock(Clock_isr);
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- ReInstall_clock(args->buffer);
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libcpu/hppa1.1/include/Makefile.in b/c/src/lib/libcpu/hppa1.1/include/Makefile.in
deleted file mode 100644
index 77ba3a4092..0000000000
--- a/c/src/lib/libcpu/hppa1.1/include/Makefile.in
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# $Id$
-#
-# Install any include files needed by libcpu.
-# Mainly this just means bsp.h which would normally be installed
-# after libcpu is built.
-# This is a bit of a hack.
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-all: FORCEIT
- cd ../../../libbsp/$(RTEMS_CPU)/$(RTEMS_BSP)/include; $(MAKE) all
-
-
diff --git a/c/src/lib/libcpu/hppa1.1/milli/Makefile.in b/c/src/lib/libcpu/hppa1.1/milli/Makefile.in
deleted file mode 100644
index 52124d0a59..0000000000
--- a/c/src/lib/libcpu/hppa1.1/milli/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/milli.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=milli
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by
-# libbsp/hppa/BSP/wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/hppa1.1/milli/milli.s b/c/src/lib/libcpu/hppa1.1/milli/milli.s
deleted file mode 100644
index ec1041036c..0000000000
--- a/c/src/lib/libcpu/hppa1.1/milli/milli.s
+++ /dev/null
@@ -1,2001 +0,0 @@
-;
-; (c) Copyright 1986 HEWLETT-PACKARD COMPANY
-;
-; 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 Hewlett-Packard Company not be
-; used in advertising or publicity pertaining to distribution
-; of the software without specific, written prior permission.
-; Hewlett-Packard Company makes no representations about the
-; suitability of this software for any purpose.
-;
-
-; Standard Hardware Register Definitions for Use with Assembler
-; version A.08.06
-; - fr16-31 added at Utah
-;
-; $Id$
-;
-;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-; Hardware General Registers
-r0: .equ 0
-
-r1: .equ 1
-
-r2: .equ 2
-
-r3: .equ 3
-
-r4: .equ 4
-
-r5: .equ 5
-
-r6: .equ 6
-
-r7: .equ 7
-
-r8: .equ 8
-
-r9: .equ 9
-
-r10: .equ 10
-
-r11: .equ 11
-
-r12: .equ 12
-
-r13: .equ 13
-
-r14: .equ 14
-
-r15: .equ 15
-
-r16: .equ 16
-
-r17: .equ 17
-
-r18: .equ 18
-
-r19: .equ 19
-
-r20: .equ 20
-
-r21: .equ 21
-
-r22: .equ 22
-
-r23: .equ 23
-
-r24: .equ 24
-
-r25: .equ 25
-
-r26: .equ 26
-
-r27: .equ 27
-
-r28: .equ 28
-
-r29: .equ 29
-
-r30: .equ 30
-
-r31: .equ 31
-
-; Hardware Space Registers
-sr0: .equ 0
-
-sr1: .equ 1
-
-sr2: .equ 2
-
-sr3: .equ 3
-
-sr4: .equ 4
-
-sr5: .equ 5
-
-sr6: .equ 6
-
-sr7: .equ 7
-
-; Hardware Floating Point Registers
-fr0: .equ 0
-
-fr1: .equ 1
-
-fr2: .equ 2
-
-fr3: .equ 3
-
-fr4: .equ 4
-
-fr5: .equ 5
-
-fr6: .equ 6
-
-fr7: .equ 7
-
-fr8: .equ 8
-
-fr9: .equ 9
-
-fr10: .equ 10
-
-fr11: .equ 11
-
-fr12: .equ 12
-
-fr13: .equ 13
-
-fr14: .equ 14
-
-fr15: .equ 15
-
-fr16: .equ 16
-
-fr17: .equ 17
-
-fr18: .equ 18
-
-fr19: .equ 19
-
-fr20: .equ 20
-
-fr21: .equ 21
-
-fr22: .equ 22
-
-fr23: .equ 23
-
-fr24: .equ 24
-
-fr25: .equ 25
-
-fr26: .equ 26
-
-fr27: .equ 27
-
-fr28: .equ 28
-
-fr29: .equ 29
-
-fr30: .equ 30
-
-fr31: .equ 31
-
-; Hardware Control Registers
-cr0: .equ 0
-
-rctr: .equ 0 ; Recovery Counter Register
-
-
-cr8: .equ 8 ; Protection ID 1
-
-pidr1: .equ 8
-
-
-cr9: .equ 9 ; Protection ID 2
-
-pidr2: .equ 9
-
-
-cr10: .equ 10
-
-ccr: .equ 10 ; Coprocessor Confiquration Register
-
-
-cr11: .equ 11
-
-sar: .equ 11 ; Shift Amount Register
-
-
-cr12: .equ 12
-
-pidr3: .equ 12 ; Protection ID 3
-
-
-cr13: .equ 13
-
-pidr4: .equ 13 ; Protection ID 4
-
-
-cr14: .equ 14
-
-iva: .equ 14 ; Interrupt Vector Address
-
-
-cr15: .equ 15
-
-eiem: .equ 15 ; External Interrupt Enable Mask
-
-
-cr16: .equ 16
-
-itmr: .equ 16 ; Interval Timer
-
-
-cr17: .equ 17
-
-pcsq: .equ 17 ; Program Counter Space queue
-
-
-cr18: .equ 18
-
-pcoq: .equ 18 ; Program Counter Offset queue
-
-
-cr19: .equ 19
-
-iir: .equ 19 ; Interruption Instruction Register
-
-
-cr20: .equ 20
-
-isr: .equ 20 ; Interruption Space Register
-
-
-cr21: .equ 21
-
-ior: .equ 21 ; Interruption Offset Register
-
-
-cr22: .equ 22
-
-ipsw: .equ 22 ; Interrpution Processor Status Word
-
-
-cr23: .equ 23
-
-eirr: .equ 23 ; External Interrupt Request
-
-
-cr24: .equ 24
-
-ppda: .equ 24 ; Physcial Page Directory Address
-
-tr0: .equ 24 ; Temporary register 0
-
-
-cr25: .equ 25
-
-hta: .equ 25 ; Hash Table Address
-
-tr1: .equ 25 ; Temporary register 1
-
-
-cr26: .equ 26
-
-tr2: .equ 26 ; Temporary register 2
-
-
-cr27: .equ 27
-
-tr3: .equ 27 ; Temporary register 3
-
-
-cr28: .equ 28
-
-tr4: .equ 28 ; Temporary register 4
-
-
-cr29: .equ 29
-
-tr5: .equ 29 ; Temporary register 5
-
-
-cr30: .equ 30
-
-tr6: .equ 30 ; Temporary register 6
-
-
-cr31: .equ 31
-
-tr7: .equ 31 ; Temporary register 7
-
-;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-; Procedure Call Convention ~
-; Register Definitions for Use with Assembler ~
-; version A.08.06
-;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-; Software Architecture General Registers
-rp: .equ r2 ; return pointer
-
-mrp: .equ r31 ; millicode return pointer
-
-ret0: .equ r28 ; return value
-
-ret1: .equ r29 ; return value (high part of double)
-
-sl: .equ r29 ; static link
-
-sp: .equ r30 ; stack pointer
-
-dp: .equ r27 ; data pointer
-
-arg0: .equ r26 ; argument
-
-arg1: .equ r25 ; argument or high part of double argument
-
-arg2: .equ r24 ; argument
-
-arg3: .equ r23 ; argument or high part of double argument
-
-;_____________________________________________________________________________
-; Software Architecture Space Registers
-; sr0 ; return link form BLE
-sret: .equ sr1 ; return value
-
-sarg: .equ sr1 ; argument
-
-; sr4 ; PC SPACE tracker
-; sr5 ; process private data
-;_____________________________________________________________________________
-; Software Architecture Pseudo Registers
-previous_sp: .equ 64 ; old stack pointer (locates previous frame)
-
-;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-; Standard space and subspace definitions. version A.08.06
-; These are generally suitable for programs on HP_UX and HPE.
-; Statements commented out are used when building such things as operating
-; system kernels.
-;;;;;;;;;;;;;;;;
- .SPACE $TEXT$, SPNUM=0,SORT=8
- .subspa $MILLICODE$, QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=8
- .subspa $LIT$, QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=16
- .subspa $CODE$, QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=24
-; Additional code subspaces should have ALIGN=8 for an interspace BV
-; and should have SORT=24.
-;
-; For an incomplete executable (program bound to shared libraries),
-; sort keys $GLOBAL$ -1 and $GLOBAL$ -2 are reserved for the $DLT$
-; and $PLT$ subspaces respectively.
-;;;;;;;;;;;;;;;
- .SPACE $PRIVATE$, SPNUM=1,PRIVATE,SORT=16
- .subspa $GLOBAL$, QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=40
- .import $global$
- .subspa $DATA$, QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=16
- .subspa $BSS$, QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=82,ZERO
-
- .SPACE $TEXT$
- .SUBSPA $MILLICODE$
-
- .align 8
- .EXPORT $$remI,millicode
-; .IMPORT cerror
-$$remI:
- .PROC
- .CALLINFO millicode
- .ENTRY
- addit,= 0,arg1,r0
- add,>= r0,arg0,ret1
- sub r0,ret1,ret1
- sub r0,arg1,r1
- ds r0,r1,r0
- or r0,r0,r1
- add ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- ds r1,arg1,r1
- addc ret1,ret1,ret1
- movb,>=,n r1,ret1,remI300
- add,< arg1,r0,r0
- add,tr r1,arg1,ret1
- sub r1,arg1,ret1
-remI300: add,>= arg0,r0,r0
-
- sub r0,ret1,ret1
- bv r0(r31)
- nop
- .EXIT
- .PROCEND
-
-bit1: .equ 1
-
-bit30: .equ 30
-bit31: .equ 31
-
-len2: .equ 2
-
-len4: .equ 4
-
-
-$$dyncall:
- .proc
- .callinfo NO_CALLS
- .entry
- .export $$dyncall,MILLICODE
-
- bb,>=,n 22,bit30,noshlibs
-
- depi 0,bit31,len2,22
- ldw 4(22),19
- ldw 0(22),22
-noshlibs:
- ldsid (22),r1
- mtsp r1,sr0
- be 0(sr0,r22)
- stw rp,-24(sp)
- .exit
- .procend
-
-temp: .EQU r1
-
-retreg: .EQU ret1 ; r29
-
-
- .export $$divU,millicode
- .import $$divU_3,millicode
- .import $$divU_5,millicode
- .import $$divU_6,millicode
- .import $$divU_7,millicode
- .import $$divU_9,millicode
- .import $$divU_10,millicode
- .import $$divU_12,millicode
- .import $$divU_14,millicode
- .import $$divU_15,millicode
-$$divU:
- .proc
- .callinfo millicode
- .entry
-; The subtract is not nullified since it does no harm and can be used
-; by the two cases that branch back to "normal".
- comib,>= 15,arg1,special_divisor
- sub r0,arg1,temp ; clear carry, negate the divisor
- ds r0,temp,r0 ; set V-bit to 1
-normal:
- add arg0,arg0,retreg ; shift msb bit into carry
- ds r0,arg1,temp ; 1st divide step, if no carry
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 2nd divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 3rd divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 4th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 5th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 6th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 7th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 8th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 9th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 10th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 11th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 12th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 13th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 14th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 15th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 16th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 17th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 18th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 19th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 20th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 21st divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 22nd divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 23rd divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 24th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 25th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 26th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 27th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 28th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 29th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 30th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 31st divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 32nd divide step,
- bv 0(r31)
- addc retreg,retreg,retreg ; shift last retreg bit into retreg
-;_____________________________________________________________________________
-; handle the cases where divisor is a small constant or has high bit on
-special_divisor:
- comib,> 0,arg1,big_divisor
- nop
- blr arg1,r0
- nop
-zero_divisor: ; this label is here to provide external visibility
-
- addit,= 0,arg1,0 ; trap for zero dvr
- nop
- bv 0(r31) ; divisor == 1
- copy arg0,retreg
- bv 0(r31) ; divisor == 2
- extru arg0,30,31,retreg
- b,n $$divU_3 ; divisor == 3
- nop
- bv 0(r31) ; divisor == 4
- extru arg0,29,30,retreg
- b,n $$divU_5 ; divisor == 5
- nop
- b,n $$divU_6 ; divisor == 6
- nop
- b,n $$divU_7 ; divisor == 7
- nop
- bv 0(r31) ; divisor == 8
- extru arg0,28,29,retreg
- b,n $$divU_9 ; divisor == 9
- nop
- b,n $$divU_10 ; divisor == 10
- nop
- b normal ; divisor == 11
- ds r0,temp,r0 ; set V-bit to 1
- b,n $$divU_12 ; divisor == 12
- nop
- b normal ; divisor == 13
- ds r0,temp,r0 ; set V-bit to 1
- b,n $$divU_14 ; divisor == 14
- nop
- b,n $$divU_15 ; divisor == 15
- nop
-;_____________________________________________________________________________
-; Handle the case where the high bit is on in the divisor.
-; Compute: if( dividend>=divisor) quotient=1; else quotient=0;
-; Note: dividend>==divisor iff dividend-divisor does not borrow
-; and not borrow iff carry
-big_divisor:
- sub arg0,arg1,r0
- bv 0(r31)
- addc r0,r0,retreg
- .exit
- .procend
- .end
-
-t2: .EQU r1
-
-; x2 .EQU arg0 ; r26
-t1: .EQU arg1 ; r25
-
-; x1 .EQU ret1 ; r29
-;_____________________________________________________________________________
-
-$$divide_by_constant:
- .PROC
- .CALLINFO millicode
- .entry
-
-
- .export $$divide_by_constant,millicode
-; Provides a "nice" label for the code covered by the unwind descriptor
-; for things like gprof.
-
-
-
-
-
-
-
-
-
-$$divI_2:
- .EXPORT $$divI_2,MILLICODE
- COMCLR,>= arg0,0,0
- ADDI 1,arg0,arg0
- bv 0(r31)
- EXTRS arg0,30,31,ret1
-
-
-
-$$divI_4:
- .EXPORT $$divI_4,MILLICODE
- COMCLR,>= arg0,0,0
- ADDI 3,arg0,arg0
- bv 0(r31)
- EXTRS arg0,29,30,ret1
-
-
-
-$$divI_8:
- .EXPORT $$divI_8,MILLICODE
- COMCLR,>= arg0,0,0
- ADDI 7,arg0,arg0
- bv 0(r31)
- EXTRS arg0,28,29,ret1
-
-
-$$divI_16:
- .EXPORT $$divI_16,MILLICODE
- COMCLR,>= arg0,0,0
- ADDI 15,arg0,arg0
- bv 0(r31)
- EXTRS arg0,27,28,ret1
-
-
-
-
-
-
-
-
-
-
-
-$$divI_3:
- .EXPORT $$divI_3,MILLICODE
- COMB,<,N arg0,0,$neg3
-
- ADDI 1,arg0,arg0
- EXTRU arg0,1,2,ret1
- SH2ADD arg0,arg0,arg0
- B $pos
- ADDC ret1,0,ret1
-
-$neg3:
- SUBI 1,arg0,arg0
- EXTRU arg0,1,2,ret1
- SH2ADD arg0,arg0,arg0
- B $neg
- ADDC ret1,0,ret1
-
-$$divU_3:
- .EXPORT $$divU_3,MILLICODE
- ADDI 1,arg0,arg0
- ADDC 0,0,ret1
- SHD ret1,arg0,30,t1
- SH2ADD arg0,arg0,arg0
- B $pos
- ADDC ret1,t1,ret1
-
-
-
-$$divI_5:
- .EXPORT $$divI_5,MILLICODE
- COMB,<,N arg0,0,$neg5
- ADDI 3,arg0,t1
- SH1ADD arg0,t1,arg0
- B $pos
- ADDC 0,0,ret1
-
-$neg5:
- SUB 0,arg0,arg0
- ADDI 1,arg0,arg0
- SHD 0,arg0,31,ret1
- SH1ADD arg0,arg0,arg0
- B $neg
- ADDC ret1,0,ret1
-
-$$divU_5:
- .EXPORT $$divU_5,MILLICODE
- ADDI 1,arg0,arg0
- ADDC 0,0,ret1
- SHD ret1,arg0,31,t1
- SH1ADD arg0,arg0,arg0
- B $pos
- ADDC t1,ret1,ret1
-
-
-$$divI_6:
- .EXPORT $$divI_6,MILLICODE
- COMB,<,N arg0,0,$neg6
- EXTRU arg0,30,31,arg0
- ADDI 5,arg0,t1
- SH2ADD arg0,t1,arg0
- B $pos
- ADDC 0,0,ret1
-
-$neg6:
- SUBI 2,arg0,arg0
-
-
- EXTRU arg0,30,31,arg0
- SHD 0,arg0,30,ret1
- SH2ADD arg0,arg0,arg0
- B $neg
- ADDC ret1,0,ret1
-
-$$divU_6:
- .EXPORT $$divU_6,MILLICODE
- EXTRU arg0,30,31,arg0
- ADDI 1,arg0,arg0
- SHD 0,arg0,30,ret1
- SH2ADD arg0,arg0,arg0
- B $pos
- ADDC ret1,0,ret1
-
-
-$$divU_10:
- .EXPORT $$divU_10,MILLICODE
- EXTRU arg0,30,31,arg0
- ADDI 3,arg0,t1
- SH1ADD arg0,t1,arg0
- ADDC 0,0,ret1
-$pos:
- SHD ret1,arg0,28,t1
- SHD arg0,0,28,t2
- ADD arg0,t2,arg0
- ADDC ret1,t1,ret1
-$pos_for_17:
- SHD ret1,arg0,24,t1
- SHD arg0,0,24,t2
- ADD arg0,t2,arg0
- ADDC ret1,t1,ret1
-
- SHD ret1,arg0,16,t1
- SHD arg0,0,16,t2
- ADD arg0,t2,arg0
- bv 0(r31)
- ADDC ret1,t1,ret1
-
-$$divI_10:
- .EXPORT $$divI_10,MILLICODE
- COMB,< arg0,0,$neg10
- COPY 0,ret1
- EXTRU arg0,30,31,arg0
- ADDIB,TR 1,arg0,$pos
- SH1ADD arg0,arg0,arg0
-
-$neg10:
- SUBI 2,arg0,arg0
-
-
- EXTRU arg0,30,31,arg0
- SH1ADD arg0,arg0,arg0
-$neg:
- SHD ret1,arg0,28,t1
- SHD arg0,0,28,t2
- ADD arg0,t2,arg0
- ADDC ret1,t1,ret1
-$neg_for_17:
- SHD ret1,arg0,24,t1
- SHD arg0,0,24,t2
- ADD arg0,t2,arg0
- ADDC ret1,t1,ret1
-
- SHD ret1,arg0,16,t1
- SHD arg0,0,16,t2
- ADD arg0,t2,arg0
- ADDC ret1,t1,ret1
- bv 0(r31)
- SUB 0,ret1,ret1
-
-
-$$divI_12:
- .EXPORT $$divI_12,MILLICODE
- COMB,< arg0,0,$neg12
- COPY 0,ret1
- EXTRU arg0,29,30,arg0
- ADDIB,TR 1,arg0,$pos
- SH2ADD arg0,arg0,arg0
-
-$neg12:
- SUBI 4,arg0,arg0
-
-
- EXTRU arg0,29,30,arg0
- B $neg
- SH2ADD arg0,arg0,arg0
-
-$$divU_12:
- .EXPORT $$divU_12,MILLICODE
- EXTRU arg0,29,30,arg0
- ADDI 5,arg0,t1
- SH2ADD arg0,t1,arg0
- B $pos
- ADDC 0,0,ret1
-
-
-$$divI_15:
- .EXPORT $$divI_15,MILLICODE
- COMB,< arg0,0,$neg15
- COPY 0,ret1
- ADDIB,TR 1,arg0,$pos+4
- SHD ret1,arg0,28,t1
-
-$neg15:
- B $neg
- SUBI 1,arg0,arg0
-
-$$divU_15:
- .EXPORT $$divU_15,MILLICODE
- ADDI 1,arg0,arg0
- B $pos
- ADDC 0,0,ret1
-
-
-$$divI_17:
- .EXPORT $$divI_17,MILLICODE
- COMB,<,N arg0,0,$neg17
- ADDI 1,arg0,arg0
- SHD 0,arg0,28,t1
- SHD arg0,0,28,t2
- SUB t2,arg0,arg0
- B $pos_for_17
- SUBB t1,0,ret1
-
-$neg17:
- SUBI 1,arg0,arg0
- SHD 0,arg0,28,t1
- SHD arg0,0,28,t2
- SUB t2,arg0,arg0
- B $neg_for_17
- SUBB t1,0,ret1
-
-$$divU_17:
- .EXPORT $$divU_17,MILLICODE
- ADDI 1,arg0,arg0
- ADDC 0,0,ret1
- SHD ret1,arg0,28,t1
-$u17:
- SHD arg0,0,28,t2
- SUB t2,arg0,arg0
- B $pos_for_17
- SUBB t1,ret1,ret1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-$$divI_7:
- .EXPORT $$divI_7,MILLICODE
- COMB,<,N arg0,0,$neg7
-$7:
- ADDI 1,arg0,arg0
- SHD 0,arg0,29,ret1
- SH3ADD arg0,arg0,arg0
- ADDC ret1,0,ret1
-$pos7:
- SHD ret1,arg0,26,t1
- SHD arg0,0,26,t2
- ADD arg0,t2,arg0
- ADDC ret1,t1,ret1
-
- SHD ret1,arg0,20,t1
- SHD arg0,0,20,t2
- ADD arg0,t2,arg0
- ADDC ret1,t1,t1
-
-
-
- COPY 0,ret1
- SHD,= t1,arg0,24,t1
-$1:
- ADDB,TR t1,ret1,$2
- EXTRU arg0,31,24,arg0
-
- bv,n 0(r31)
-
-$2:
- ADDB,TR t1,arg0,$1
- EXTRU,= arg0,7,8,t1
-
-$neg7:
- SUBI 1,arg0,arg0
-$8:
- SHD 0,arg0,29,ret1
- SH3ADD arg0,arg0,arg0
- ADDC ret1,0,ret1
-
-$neg7_shift:
- SHD ret1,arg0,26,t1
- SHD arg0,0,26,t2
- ADD arg0,t2,arg0
- ADDC ret1,t1,ret1
-
- SHD ret1,arg0,20,t1
- SHD arg0,0,20,t2
- ADD arg0,t2,arg0
- ADDC ret1,t1,t1
-
-
-
- COPY 0,ret1
- SHD,= t1,arg0,24,t1
-$3:
- ADDB,TR t1,ret1,$4
- EXTRU arg0,31,24,arg0
-
- bv 0(r31)
- SUB 0,ret1,ret1
-
-$4:
- ADDB,TR t1,arg0,$3
- EXTRU,= arg0,7,8,t1
-
-$$divU_7:
- .EXPORT $$divU_7,MILLICODE
- ADDI 1,arg0,arg0
- ADDC 0,0,ret1
- SHD ret1,arg0,29,t1
- SH3ADD arg0,arg0,arg0
- B $pos7
- ADDC t1,ret1,ret1
-
-
-$$divI_9:
- .EXPORT $$divI_9,MILLICODE
- COMB,<,N arg0,0,$neg9
- ADDI 1,arg0,arg0
- SHD 0,arg0,29,t1
- SHD arg0,0,29,t2
- SUB t2,arg0,arg0
- B $pos7
- SUBB t1,0,ret1
-
-$neg9:
- SUBI 1,arg0,arg0
- SHD 0,arg0,29,t1
- SHD arg0,0,29,t2
- SUB t2,arg0,arg0
- B $neg7_shift
- SUBB t1,0,ret1
-
-$$divU_9:
- .EXPORT $$divU_9,MILLICODE
- ADDI 1,arg0,arg0
- ADDC 0,0,ret1
- SHD ret1,arg0,29,t1
- SHD arg0,0,29,t2
- SUB t2,arg0,arg0
- B $pos7
- SUBB t1,ret1,ret1
-
-
-$$divI_14:
- .EXPORT $$divI_14,MILLICODE
- COMB,<,N arg0,0,$neg14
-$$divU_14:
- .EXPORT $$divU_14,MILLICODE
- B $7
- EXTRU arg0,30,31,arg0
-
-$neg14:
- SUBI 2,arg0,arg0
- B $8
- EXTRU arg0,30,31,arg0
-
- .exit
- .PROCEND
- .END
-
-rmndr: .EQU ret1 ; r29
-
-
- .export $$remU,millicode
-$$remU:
- .proc
- .callinfo millicode
- .entry
-
- comib,>=,n 0,arg1,special_case
- sub r0,arg1,rmndr ; clear carry, negate the divisor
- ds r0,rmndr,r0 ; set V-bit to 1
- add arg0,arg0,temp ; shift msb bit into carry
- ds r0,arg1,rmndr ; 1st divide step, if no carry
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 2nd divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 3rd divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 4th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 5th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 6th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 7th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 8th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 9th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 10th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 11th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 12th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 13th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 14th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 15th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 16th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 17th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 18th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 19th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 20th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 21st divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 22nd divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 23rd divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 24th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 25th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 26th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 27th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 28th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 29th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 30th divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 31st divide step
- addc temp,temp,temp ; shift temp with/into carry
- ds rmndr,arg1,rmndr ; 32nd divide step,
- comiclr,<= 0,rmndr,r0
- add rmndr,arg1,rmndr ; correction
-; .exit
- bv,n 0(r31)
- nop
-; Putting >= on the last DS and deleting COMICLR does not work!
-;_____________________________________________________________________________
-special_case:
- addit,= 0,arg1,r0 ; trap on div by zero
- sub,>>= arg0,arg1,rmndr
- copy arg0,rmndr
- bv,n 0(r31)
- nop
- .exit
- .procend
- .end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-; Use bv 0(r31) and bv,n 0(r31) instead.
-; #define return bv 0(%mrp)
-; #define return_n bv,n 0(%mrp)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- .subspa $MILLICODE$
- .align 16
-$$mulI:
-
- .proc
- .callinfo millicode
- .entry
- .export $$mulI, millicode
- combt,<<= %r25,%r26,l4 ; swap args if unsigned %r25>%r26
- copy 0,%r29 ; zero out the result
- xor %r26,%r25,%r26 ; swap %r26 & %r25 using the
- xor %r26,%r25,%r25 ; old xor trick
- xor %r26,%r25,%r26
-l4: combt,<= 0,%r26,l3 ; if %r26>=0 then proceed like unsigned
-
- zdep %r25,30,8,%r1 ; %r1 = (%r25&0xff)<<1 *********
- sub,> 0,%r25,%r1 ; otherwise negate both and
- combt,<=,n %r26,%r1,l2 ; swap back if |%r26|<|%r25|
- sub 0,%r26,%r25
- movb,tr,n %r1,%r26,l2 ; 10th inst.
-
-l0: add %r29,%r1,%r29 ; add in this partial product
-
-l1: zdep %r26,23,24,%r26 ; %r26 <<= 8 ******************
-
-l2: zdep %r25,30,8,%r1 ; %r1 = (%r25&0xff)<<1 *********
-
-l3: blr %r1,0 ; case on these 8 bits ******
-
- extru %r25,23,24,%r25 ; %r25 >>= 8 ******************
-
-;16 insts before this.
-; %r26 <<= 8 **************************
-x0: comb,<> %r25,0,l2 ! zdep %r26,23,24,%r26 ! bv,n 0(r31) ! nop
-
-x1: comb,<> %r25,0,l1 ! add %r29,%r26,%r29 ! bv,n 0(r31) ! nop
-
-x2: comb,<> %r25,0,l1 ! sh1add %r26,%r29,%r29 ! bv,n 0(r31) ! nop
-
-x3: comb,<> %r25,0,l0 ! sh1add %r26,%r26,%r1 ! bv 0(r31) ! add %r29,%r1,%r29
-
-x4: comb,<> %r25,0,l1 ! sh2add %r26,%r29,%r29 ! bv,n 0(r31) ! nop
-
-x5: comb,<> %r25,0,l0 ! sh2add %r26,%r26,%r1 ! bv 0(r31) ! add %r29,%r1,%r29
-
-x6: sh1add %r26,%r26,%r1 ! comb,<> %r25,0,l1 ! sh1add %r1,%r29,%r29 ! bv,n 0(r31)
-
-x7: sh1add %r26,%r26,%r1 ! comb,<> %r25,0,l0 ! sh2add %r26,%r29,%r29 ! b,n ret_t0
-
-x8: comb,<> %r25,0,l1 ! sh3add %r26,%r29,%r29 ! bv,n 0(r31) ! nop
-
-x9: comb,<> %r25,0,l0 ! sh3add %r26,%r26,%r1 ! bv 0(r31) ! add %r29,%r1,%r29
-
-x10: sh2add %r26,%r26,%r1 ! comb,<> %r25,0,l1 ! sh1add %r1,%r29,%r29 ! bv,n 0(r31)
-
-x11: sh1add %r26,%r26,%r1 ! comb,<> %r25,0,l0 ! sh3add %r26,%r29,%r29 ! b,n ret_t0
-
-x12: sh1add %r26,%r26,%r1 ! comb,<> %r25,0,l1 ! sh2add %r1,%r29,%r29 ! bv,n 0(r31)
-
-x13: sh2add %r26,%r26,%r1 ! comb,<> %r25,0,l0 ! sh3add %r26,%r29,%r29 ! b,n ret_t0
-
-x14: sh1add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x15: sh2add %r26,%r26,%r1 ! comb,<> %r25,0,l0 ! sh1add %r1,%r1,%r1 ! b,n ret_t0
-
-x16: zdep %r26,27,28,%r1 ! comb,<> %r25,0,l1 ! add %r29,%r1,%r29 ! bv,n 0(r31)
-
-x17: sh3add %r26,%r26,%r1 ! comb,<> %r25,0,l0 ! sh3add %r26,%r1,%r1 ! b,n ret_t0
-
-x18: sh3add %r26,%r26,%r1 ! comb,<> %r25,0,l1 ! sh1add %r1,%r29,%r29 ! bv,n 0(r31)
-
-x19: sh3add %r26,%r26,%r1 ! comb,<> %r25,0,l0 ! sh1add %r1,%r26,%r1 ! b,n ret_t0
-
-x20: sh2add %r26,%r26,%r1 ! comb,<> %r25,0,l1 ! sh2add %r1,%r29,%r29 ! bv,n 0(r31)
-
-x21: sh2add %r26,%r26,%r1 ! comb,<> %r25,0,l0 ! sh2add %r1,%r26,%r1 ! b,n ret_t0
-
-x22: sh2add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x23: sh2add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r26,%r1
-
-x24: sh1add %r26,%r26,%r1 ! comb,<> %r25,0,l1 ! sh3add %r1,%r29,%r29 ! bv,n 0(r31)
-
-x25: sh2add %r26,%r26,%r1 ! comb,<> %r25,0,l0 ! sh2add %r1,%r1,%r1 ! b,n ret_t0
-
-x26: sh1add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x27: sh1add %r26,%r26,%r1 ! comb,<> %r25,0,l0 ! sh3add %r1,%r1,%r1 ! b,n ret_t0
-
-x28: sh1add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x29: sh1add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_t0 ! sh2add %r1,%r26,%r1
-
-x30: sh2add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x31: zdep %r26,26,27,%r1 ! comb,<> %r25,0,l0 ! sub %r1,%r26,%r1 ! b,n ret_t0
-
-x32: zdep %r26,26,27,%r1 ! comb,<> %r25,0,l1 ! add %r29,%r1,%r29 ! bv,n 0(r31)
-
-x33: sh3add %r26,0,%r1 ! comb,<> %r25,0,l0 ! sh2add %r1,%r26,%r1 ! b,n ret_t0
-
-x34: zdep %r26,27,28,%r1 ! add %r1,%r26,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x35: sh3add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_t0 ! sh3add %r26,%r1,%r1
-
-x36: sh3add %r26,%r26,%r1 ! comb,<> %r25,0,l1 ! sh2add %r1,%r29,%r29 ! bv,n 0(r31)
-
-x37: sh3add %r26,%r26,%r1 ! comb,<> %r25,0,l0 ! sh2add %r1,%r26,%r1 ! b,n ret_t0
-
-x38: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x39: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r26,%r1
-
-x40: sh2add %r26,%r26,%r1 ! comb,<> %r25,0,l1 ! sh3add %r1,%r29,%r29 ! bv,n 0(r31)
-
-x41: sh2add %r26,%r26,%r1 ! comb,<> %r25,0,l0 ! sh3add %r1,%r26,%r1 ! b,n ret_t0
-
-x42: sh2add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x43: sh2add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r26,%r1
-
-x44: sh2add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x45: sh3add %r26,%r26,%r1 ! comb,<> %r25,0,l0 ! sh2add %r1,%r1,%r1 ! b,n ret_t0
-
-x46: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_t0 ! add %r1,%r26,%r1
-
-x47: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_t0 ! sh1add %r26,%r1,%r1
-
-x48: sh1add %r26,%r26,%r1 ! comb,<> %r25,0,l0 ! zdep %r1,27,28,%r1 ! b,n ret_t0
-
-x49: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_t0 ! sh2add %r26,%r1,%r1
-
-x50: sh2add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x51: sh3add %r26,%r26,%r1 ! sh3add %r26,%r1,%r1 ! b e_t0 ! sh1add %r1,%r1,%r1
-
-x52: sh1add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x53: sh1add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0 ! sh2add %r1,%r26,%r1
-
-x54: sh3add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x55: sh3add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_t0 ! sh1add %r1,%r26,%r1
-
-x56: sh1add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_shift ! sh3add %r1,%r29,%r29
-
-x57: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r1,%r1
-
-x58: sh1add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_2t0 ! sh2add %r1,%r26,%r1
-
-x59: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_t02a0 ! sh1add %r1,%r1,%r1
-
-x60: sh2add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x61: sh2add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_t0 ! sh2add %r1,%r26,%r1
-
-x62: zdep %r26,26,27,%r1 ! sub %r1,%r26,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x63: zdep %r26,25,26,%r1 ! comb,<> %r25,0,l0 ! sub %r1,%r26,%r1 ! b,n ret_t0
-
-x64: zdep %r26,25,26,%r1 ! comb,<> %r25,0,l1 ! add %r29,%r1,%r29 ! bv,n 0(r31)
-
-x65: sh3add %r26,0,%r1 ! comb,<> %r25,0,l0 ! sh3add %r1,%r26,%r1 ! b,n ret_t0
-
-x66: zdep %r26,26,27,%r1 ! add %r1,%r26,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x67: sh3add %r26,0,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r26,%r1
-
-x68: sh3add %r26,0,%r1 ! sh1add %r1,%r26,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x69: sh3add %r26,0,%r1 ! sh1add %r1,%r26,%r1 ! b e_t0 ! sh2add %r1,%r26,%r1
-
-x70: zdep %r26,25,26,%r1 ! sh2add %r26,%r1,%r1 ! b e_t0 ! sh1add %r26,%r1,%r1
-
-x71: sh3add %r26,%r26,%r1 ! sh3add %r1,0,%r1 ! b e_t0 ! sub %r1,%r26,%r1
-
-x72: sh3add %r26,%r26,%r1 ! comb,<> %r25,0,l1 ! sh3add %r1,%r29,%r29 ! bv,n 0(r31)
-
-x73: sh3add %r26,%r26,%r1 ! sh3add %r1,%r26,%r1 ! b e_shift ! add %r29,%r1,%r29
-
-x74: sh3add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x75: sh3add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r26,%r1
-
-x76: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x77: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_t0 ! sh2add %r1,%r26,%r1
-
-x78: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_2t0 ! sh1add %r1,%r26,%r1
-
-x79: zdep %r26,27,28,%r1 ! sh2add %r1,%r1,%r1 ! b e_t0 ! sub %r1,%r26,%r1
-
-x80: zdep %r26,27,28,%r1 ! sh2add %r1,%r1,%r1 ! b e_shift ! add %r29,%r1,%r29
-
-x81: sh3add %r26,%r26,%r1 ! sh3add %r1,%r1,%r1 ! b e_shift ! add %r29,%r1,%r29
-
-x82: sh2add %r26,%r26,%r1 ! sh3add %r1,%r26,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x83: sh2add %r26,%r26,%r1 ! sh3add %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r26,%r1
-
-x84: sh2add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x85: sh3add %r26,0,%r1 ! sh1add %r1,%r26,%r1 ! b e_t0 ! sh2add %r1,%r1,%r1
-
-x86: sh2add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_2t0 ! sh1add %r1,%r26,%r1
-
-x87: sh3add %r26,%r26,%r1 ! sh3add %r1,%r1,%r1 ! b e_t02a0 ! sh2add %r26,%r1,%r1
-
-x88: sh2add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_shift ! sh3add %r1,%r29,%r29
-
-x89: sh2add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_t0 ! sh3add %r1,%r26,%r1
-
-x90: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x91: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_t0 ! sh1add %r1,%r26,%r1
-
-x92: sh2add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_4t0 ! sh1add %r1,%r26,%r1
-
-x93: zdep %r26,26,27,%r1 ! sub %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r1,%r1
-
-x94: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_2t0 ! sh1add %r26,%r1,%r1
-
-x95: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_t0 ! sh2add %r1,%r1,%r1
-
-x96: sh3add %r26,0,%r1 ! sh1add %r1,%r1,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x97: sh3add %r26,0,%r1 ! sh1add %r1,%r1,%r1 ! b e_t0 ! sh2add %r1,%r26,%r1
-
-x98: zdep %r26,26,27,%r1 ! sh1add %r1,%r1,%r1 ! b e_t0 ! sh1add %r26,%r1,%r1
-
-x99: sh3add %r26,0,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r1,%r1
-
-x100: sh2add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x101: sh2add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_t0 ! sh2add %r1,%r26,%r1
-
-x102: zdep %r26,26,27,%r1 ! sh1add %r26,%r1,%r1 ! b e_t0 ! sh1add %r1,%r1,%r1
-
-x103: sh2add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_t02a0 ! sh2add %r1,%r26,%r1
-
-x104: sh1add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_shift ! sh3add %r1,%r29,%r29
-
-x105: sh2add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0 ! sh2add %r1,%r1,%r1
-
-x106: sh1add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_2t0 ! sh2add %r1,%r26,%r1
-
-x107: sh3add %r26,%r26,%r1 ! sh2add %r26,%r1,%r1 ! b e_t02a0 ! sh3add %r1,%r26,%r1
-
-x108: sh3add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x109: sh3add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_t0 ! sh2add %r1,%r26,%r1
-
-x110: sh3add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_2t0 ! sh1add %r1,%r26,%r1
-
-x111: sh3add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r1,%r1
-
-x112: sh1add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_t0 ! zdep %r1,27,28,%r1
-
-x113: sh3add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_t02a0 ! sh1add %r1,%r1,%r1
-
-x114: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_2t0 ! sh1add %r1,%r1,%r1
-
-x115: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_2t0a0 ! sh1add %r1,%r1,%r1
-
-x116: sh1add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_4t0 ! sh2add %r1,%r26,%r1
-
-x117: sh1add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0 ! sh3add %r1,%r1,%r1
-
-x118: sh1add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0a0 ! sh3add %r1,%r1,%r1
-
-x119: sh1add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_t02a0 ! sh3add %r1,%r1,%r1
-
-x120: sh2add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_shift ! sh3add %r1,%r29,%r29
-
-x121: sh2add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_t0 ! sh3add %r1,%r26,%r1
-
-x122: sh2add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_2t0 ! sh2add %r1,%r26,%r1
-
-x123: sh2add %r26,%r26,%r1 ! sh3add %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r1,%r1
-
-x124: zdep %r26,26,27,%r1 ! sub %r1,%r26,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x125: sh2add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_t0 ! sh2add %r1,%r1,%r1
-
-x126: zdep %r26,25,26,%r1 ! sub %r1,%r26,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x127: zdep %r26,24,25,%r1 ! comb,<> %r25,0,l0 ! sub %r1,%r26,%r1 ! b,n ret_t0
-
-x128: zdep %r26,24,25,%r1 ! comb,<> %r25,0,l1 ! add %r29,%r1,%r29 ! bv,n 0(r31)
-
-x129: zdep %r26,24,25,%r1 ! comb,<> %r25,0,l0 ! add %r1,%r26,%r1 ! b,n ret_t0
-
-x130: zdep %r26,25,26,%r1 ! add %r1,%r26,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x131: sh3add %r26,0,%r1 ! sh3add %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r26,%r1
-
-x132: sh3add %r26,0,%r1 ! sh2add %r1,%r26,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x133: sh3add %r26,0,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0 ! sh2add %r1,%r26,%r1
-
-x134: sh3add %r26,0,%r1 ! sh2add %r1,%r26,%r1 ! b e_2t0 ! sh1add %r1,%r26,%r1
-
-x135: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_t0 ! sh1add %r1,%r1,%r1
-
-x136: sh3add %r26,0,%r1 ! sh1add %r1,%r26,%r1 ! b e_shift ! sh3add %r1,%r29,%r29
-
-x137: sh3add %r26,0,%r1 ! sh1add %r1,%r26,%r1 ! b e_t0 ! sh3add %r1,%r26,%r1
-
-x138: sh3add %r26,0,%r1 ! sh1add %r1,%r26,%r1 ! b e_2t0 ! sh2add %r1,%r26,%r1
-
-x139: sh3add %r26,0,%r1 ! sh1add %r1,%r26,%r1 ! b e_2t0a0 ! sh2add %r1,%r26,%r1
-
-x140: sh1add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_4t0 ! sh2add %r1,%r1,%r1
-
-x141: sh3add %r26,0,%r1 ! sh1add %r1,%r26,%r1 ! b e_4t0a0 ! sh1add %r1,%r26,%r1
-
-x142: sh3add %r26,%r26,%r1 ! sh3add %r1,0,%r1 ! b e_2t0 ! sub %r1,%r26,%r1
-
-x143: zdep %r26,27,28,%r1 ! sh3add %r1,%r1,%r1 ! b e_t0 ! sub %r1,%r26,%r1
-
-x144: sh3add %r26,%r26,%r1 ! sh3add %r1,0,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x145: sh3add %r26,%r26,%r1 ! sh3add %r1,0,%r1 ! b e_t0 ! sh1add %r1,%r26,%r1
-
-x146: sh3add %r26,%r26,%r1 ! sh3add %r1,%r26,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x147: sh3add %r26,%r26,%r1 ! sh3add %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r26,%r1
-
-x148: sh3add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x149: sh3add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0 ! sh2add %r1,%r26,%r1
-
-x150: sh3add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_2t0 ! sh1add %r1,%r26,%r1
-
-x151: sh3add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_2t0a0 ! sh1add %r1,%r26,%r1
-
-x152: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_shift ! sh3add %r1,%r29,%r29
-
-x153: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_t0 ! sh3add %r1,%r26,%r1
-
-x154: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_2t0 ! sh2add %r1,%r26,%r1
-
-x155: zdep %r26,26,27,%r1 ! sub %r1,%r26,%r1 ! b e_t0 ! sh2add %r1,%r1,%r1
-
-x156: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_4t0 ! sh1add %r1,%r26,%r1
-
-x157: zdep %r26,26,27,%r1 ! sub %r1,%r26,%r1 ! b e_t02a0 ! sh2add %r1,%r1,%r1
-
-x158: zdep %r26,27,28,%r1 ! sh2add %r1,%r1,%r1 ! b e_2t0 ! sub %r1,%r26,%r1
-
-x159: zdep %r26,26,27,%r1 ! sh2add %r1,%r1,%r1 ! b e_t0 ! sub %r1,%r26,%r1
-
-x160: sh2add %r26,%r26,%r1 ! sh2add %r1,0,%r1 ! b e_shift ! sh3add %r1,%r29,%r29
-
-x161: sh3add %r26,0,%r1 ! sh2add %r1,%r1,%r1 ! b e_t0 ! sh2add %r1,%r26,%r1
-
-x162: sh3add %r26,%r26,%r1 ! sh3add %r1,%r1,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x163: sh3add %r26,%r26,%r1 ! sh3add %r1,%r1,%r1 ! b e_t0 ! sh1add %r1,%r26,%r1
-
-x164: sh2add %r26,%r26,%r1 ! sh3add %r1,%r26,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x165: sh3add %r26,0,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0 ! sh2add %r1,%r1,%r1
-
-x166: sh2add %r26,%r26,%r1 ! sh3add %r1,%r26,%r1 ! b e_2t0 ! sh1add %r1,%r26,%r1
-
-x167: sh2add %r26,%r26,%r1 ! sh3add %r1,%r26,%r1 ! b e_2t0a0 ! sh1add %r1,%r26,%r1
-
-x168: sh2add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_shift ! sh3add %r1,%r29,%r29
-
-x169: sh2add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0 ! sh3add %r1,%r26,%r1
-
-x170: zdep %r26,26,27,%r1 ! sh1add %r26,%r1,%r1 ! b e_t0 ! sh2add %r1,%r1,%r1
-
-x171: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_t0 ! sh3add %r1,%r1,%r1
-
-x172: sh2add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_4t0 ! sh1add %r1,%r26,%r1
-
-x173: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_t02a0 ! sh3add %r1,%r1,%r1
-
-x174: zdep %r26,26,27,%r1 ! sh1add %r26,%r1,%r1 ! b e_t04a0 ! sh2add %r1,%r1,%r1
-
-x175: sh3add %r26,0,%r1 ! sh1add %r1,%r26,%r1 ! b e_5t0 ! sh1add %r1,%r26,%r1
-
-x176: sh2add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_8t0 ! add %r1,%r26,%r1
-
-x177: sh2add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_8t0a0 ! add %r1,%r26,%r1
-
-x178: sh2add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_2t0 ! sh3add %r1,%r26,%r1
-
-x179: sh2add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_2t0a0 ! sh3add %r1,%r26,%r1
-
-x180: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x181: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_t0 ! sh2add %r1,%r26,%r1
-
-x182: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_2t0 ! sh1add %r1,%r26,%r1
-
-x183: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_2t0a0 ! sh1add %r1,%r26,%r1
-
-x184: sh2add %r26,%r26,%r1 ! sh3add %r1,%r1,%r1 ! b e_4t0 ! add %r1,%r26,%r1
-
-x185: sh3add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0 ! sh2add %r1,%r1,%r1
-
-x186: zdep %r26,26,27,%r1 ! sub %r1,%r26,%r1 ! b e_2t0 ! sh1add %r1,%r1,%r1
-
-x187: sh3add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_t02a0 ! sh2add %r1,%r1,%r1
-
-x188: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_4t0 ! sh1add %r26,%r1,%r1
-
-x189: sh2add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_t0 ! sh3add %r1,%r1,%r1
-
-x190: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_2t0 ! sh2add %r1,%r1,%r1
-
-x191: zdep %r26,25,26,%r1 ! sh1add %r1,%r1,%r1 ! b e_t0 ! sub %r1,%r26,%r1
-
-x192: sh3add %r26,0,%r1 ! sh1add %r1,%r1,%r1 ! b e_shift ! sh3add %r1,%r29,%r29
-
-x193: sh3add %r26,0,%r1 ! sh1add %r1,%r1,%r1 ! b e_t0 ! sh3add %r1,%r26,%r1
-
-x194: sh3add %r26,0,%r1 ! sh1add %r1,%r1,%r1 ! b e_2t0 ! sh2add %r1,%r26,%r1
-
-x195: sh3add %r26,0,%r1 ! sh3add %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r1,%r1
-
-x196: sh3add %r26,0,%r1 ! sh1add %r1,%r1,%r1 ! b e_4t0 ! sh1add %r1,%r26,%r1
-
-x197: sh3add %r26,0,%r1 ! sh1add %r1,%r1,%r1 ! b e_4t0a0 ! sh1add %r1,%r26,%r1
-
-x198: zdep %r26,25,26,%r1 ! sh1add %r26,%r1,%r1 ! b e_t0 ! sh1add %r1,%r1,%r1
-
-x199: sh3add %r26,0,%r1 ! sh2add %r1,%r26,%r1 ! b e_2t0a0 ! sh1add %r1,%r1,%r1
-
-x200: sh2add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_shift ! sh3add %r1,%r29,%r29
-
-x201: sh2add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_t0 ! sh3add %r1,%r26,%r1
-
-x202: sh2add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_2t0 ! sh2add %r1,%r26,%r1
-
-x203: sh2add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_2t0a0 ! sh2add %r1,%r26,%r1
-
-x204: sh3add %r26,0,%r1 ! sh1add %r1,%r26,%r1 ! b e_4t0 ! sh1add %r1,%r1,%r1
-
-x205: sh2add %r26,%r26,%r1 ! sh3add %r1,%r26,%r1 ! b e_t0 ! sh2add %r1,%r1,%r1
-
-x206: zdep %r26,25,26,%r1 ! sh2add %r26,%r1,%r1 ! b e_t02a0 ! sh1add %r1,%r1,%r1
-
-x207: sh3add %r26,0,%r1 ! sh1add %r1,%r26,%r1 ! b e_3t0 ! sh2add %r1,%r26,%r1
-
-x208: sh2add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_8t0 ! add %r1,%r26,%r1
-
-x209: sh2add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_8t0a0 ! add %r1,%r26,%r1
-
-x210: sh2add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_2t0 ! sh2add %r1,%r1,%r1
-
-x211: sh2add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_2t0a0 ! sh2add %r1,%r1,%r1
-
-x212: sh1add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_4t0 ! sh2add %r1,%r26,%r1
-
-x213: sh1add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_4t0a0 ! sh2add %r1,%r26,%r1
-
-x214: sh3add %r26,%r26,%r1 ! sh2add %r26,%r1,%r1 ! b e2t04a0 ! sh3add %r1,%r26,%r1
-
-x215: sh2add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_5t0 ! sh1add %r1,%r26,%r1
-
-x216: sh3add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_shift ! sh3add %r1,%r29,%r29
-
-x217: sh3add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_t0 ! sh3add %r1,%r26,%r1
-
-x218: sh3add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_2t0 ! sh2add %r1,%r26,%r1
-
-x219: sh3add %r26,%r26,%r1 ! sh3add %r1,%r26,%r1 ! b e_t0 ! sh1add %r1,%r1,%r1
-
-x220: sh1add %r26,%r26,%r1 ! sh3add %r1,%r1,%r1 ! b e_4t0 ! sh1add %r1,%r26,%r1
-
-x221: sh1add %r26,%r26,%r1 ! sh3add %r1,%r1,%r1 ! b e_4t0a0 ! sh1add %r1,%r26,%r1
-
-x222: sh3add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_2t0 ! sh1add %r1,%r1,%r1
-
-x223: sh3add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_2t0a0 ! sh1add %r1,%r1,%r1
-
-x224: sh3add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_8t0 ! add %r1,%r26,%r1
-
-x225: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_t0 ! sh2add %r1,%r1,%r1
-
-x226: sh1add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_t02a0 ! zdep %r1,26,27,%r1
-
-x227: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_t02a0 ! sh2add %r1,%r1,%r1
-
-x228: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_4t0 ! sh1add %r1,%r1,%r1
-
-x229: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_4t0a0 ! sh1add %r1,%r1,%r1
-
-x230: sh3add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_5t0 ! add %r1,%r26,%r1
-
-x231: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_3t0 ! sh2add %r1,%r26,%r1
-
-x232: sh1add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_8t0 ! sh2add %r1,%r26,%r1
-
-x233: sh1add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e_8t0a0 ! sh2add %r1,%r26,%r1
-
-x234: sh1add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_2t0 ! sh3add %r1,%r1,%r1
-
-x235: sh1add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e_2t0a0 ! sh3add %r1,%r1,%r1
-
-x236: sh3add %r26,%r26,%r1 ! sh1add %r1,%r26,%r1 ! b e4t08a0 ! sh1add %r1,%r1,%r1
-
-x237: zdep %r26,27,28,%r1 ! sh2add %r1,%r1,%r1 ! b e_3t0 ! sub %r1,%r26,%r1
-
-x238: sh1add %r26,%r26,%r1 ! sh2add %r1,%r26,%r1 ! b e2t04a0 ! sh3add %r1,%r1,%r1
-
-x239: zdep %r26,27,28,%r1 ! sh2add %r1,%r1,%r1 ! b e_t0ma0 ! sh1add %r1,%r1,%r1
-
-x240: sh3add %r26,%r26,%r1 ! add %r1,%r26,%r1 ! b e_8t0 ! sh1add %r1,%r1,%r1
-
-x241: sh3add %r26,%r26,%r1 ! add %r1,%r26,%r1 ! b e_8t0a0 ! sh1add %r1,%r1,%r1
-
-x242: sh2add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_2t0 ! sh3add %r1,%r26,%r1
-
-x243: sh3add %r26,%r26,%r1 ! sh3add %r1,%r1,%r1 ! b e_t0 ! sh1add %r1,%r1,%r1
-
-x244: sh2add %r26,%r26,%r1 ! sh1add %r1,%r1,%r1 ! b e_4t0 ! sh2add %r1,%r26,%r1
-
-x245: sh3add %r26,0,%r1 ! sh1add %r1,%r1,%r1 ! b e_5t0 ! sh1add %r1,%r26,%r1
-
-x246: sh2add %r26,%r26,%r1 ! sh3add %r1,%r26,%r1 ! b e_2t0 ! sh1add %r1,%r1,%r1
-
-x247: sh2add %r26,%r26,%r1 ! sh3add %r1,%r26,%r1 ! b e_2t0a0 ! sh1add %r1,%r1,%r1
-
-x248: zdep %r26,26,27,%r1 ! sub %r1,%r26,%r1 ! b e_shift ! sh3add %r1,%r29,%r29
-
-x249: zdep %r26,26,27,%r1 ! sub %r1,%r26,%r1 ! b e_t0 ! sh3add %r1,%r26,%r1
-
-x250: sh2add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_2t0 ! sh2add %r1,%r1,%r1
-
-x251: sh2add %r26,%r26,%r1 ! sh2add %r1,%r1,%r1 ! b e_2t0a0 ! sh2add %r1,%r1,%r1
-
-x252: zdep %r26,25,26,%r1 ! sub %r1,%r26,%r1 ! b e_shift ! sh2add %r1,%r29,%r29
-
-x253: zdep %r26,25,26,%r1 ! sub %r1,%r26,%r1 ! b e_t0 ! sh2add %r1,%r26,%r1
-
-x254: zdep %r26,24,25,%r1 ! sub %r1,%r26,%r1 ! b e_shift ! sh1add %r1,%r29,%r29
-
-x255: zdep %r26,23,24,%r1 ! comb,<> %r25,0,l0 ! sub %r1,%r26,%r1 ! b,n ret_t0
-
-;1040 insts before this.
-ret_t0: bv 0(r31)
-
-e_t0: add %r29,%r1,%r29
-
-e_shift: comb,<> %r25,0,l2
-
- zdep %r26,23,24,%r26 ; %r26 <<= 8 ***********
- bv,n 0(r31)
-e_t0ma0: comb,<> %r25,0,l0
-
- sub %r1,%r26,%r1
- bv 0(r31)
- add %r29,%r1,%r29
-e_t0a0: comb,<> %r25,0,l0
-
- add %r1,%r26,%r1
- bv 0(r31)
- add %r29,%r1,%r29
-e_t02a0: comb,<> %r25,0,l0
-
- sh1add %r26,%r1,%r1
- bv 0(r31)
- add %r29,%r1,%r29
-e_t04a0: comb,<> %r25,0,l0
-
- sh2add %r26,%r1,%r1
- bv 0(r31)
- add %r29,%r1,%r29
-e_2t0: comb,<> %r25,0,l1
-
- sh1add %r1,%r29,%r29
- bv,n 0(r31)
-e_2t0a0: comb,<> %r25,0,l0
-
- sh1add %r1,%r26,%r1
- bv 0(r31)
- add %r29,%r1,%r29
-e2t04a0: sh1add %r26,%r1,%r1
-
- comb,<> %r25,0,l1
- sh1add %r1,%r29,%r29
- bv,n 0(r31)
-e_3t0: comb,<> %r25,0,l0
-
- sh1add %r1,%r1,%r1
- bv 0(r31)
- add %r29,%r1,%r29
-e_4t0: comb,<> %r25,0,l1
-
- sh2add %r1,%r29,%r29
- bv,n 0(r31)
-e_4t0a0: comb,<> %r25,0,l0
-
- sh2add %r1,%r26,%r1
- bv 0(r31)
- add %r29,%r1,%r29
-e4t08a0: sh1add %r26,%r1,%r1
-
- comb,<> %r25,0,l1
- sh2add %r1,%r29,%r29
- bv,n 0(r31)
-e_5t0: comb,<> %r25,0,l0
-
- sh2add %r1,%r1,%r1
- bv 0(r31)
- add %r29,%r1,%r29
-e_8t0: comb,<> %r25,0,l1
-
- sh3add %r1,%r29,%r29
- bv,n 0(r31)
-e_8t0a0: comb,<> %r25,0,l0
-
- sh3add %r1,%r26,%r1
- bv 0(r31)
- add %r29,%r1,%r29
-
- .exit
- .procend
- .end
-
- .import $$divI_2,millicode
- .import $$divI_3,millicode
- .import $$divI_4,millicode
- .import $$divI_5,millicode
- .import $$divI_6,millicode
- .import $$divI_7,millicode
- .import $$divI_8,millicode
- .import $$divI_9,millicode
- .import $$divI_10,millicode
- .import $$divI_12,millicode
- .import $$divI_14,millicode
- .import $$divI_15,millicode
- .export $$divI,millicode
- .export $$divoI,millicode
-$$divoI:
- .proc
- .callinfo millicode
- .entry
- comib,=,n -1,arg1,negative1 ; when divisor == -1
-$$divI:
- comib,>>=,n 15,arg1,small_divisor
- add,>= 0,arg0,retreg ; move dividend, if retreg < 0,
-normal1:
- sub 0,retreg,retreg ; make it positive
- sub 0,arg1,temp ; clear carry,
- ; negate the divisor
- ds 0,temp,0 ; set V-bit to the comple-
- ; ment of the divisor sign
- add retreg,retreg,retreg ; shift msb bit into carry
- ds r0,arg1,temp ; 1st divide step, if no carry
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 2nd divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 3rd divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 4th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 5th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 6th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 7th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 8th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 9th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 10th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 11th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 12th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 13th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 14th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 15th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 16th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 17th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 18th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 19th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 20th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 21st divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 22nd divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 23rd divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 24th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 25th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 26th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 27th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 28th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 29th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 30th divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 31st divide step
- addc retreg,retreg,retreg ; shift retreg with/into carry
- ds temp,arg1,temp ; 32nd divide step,
- addc retreg,retreg,retreg ; shift last retreg bit into retreg
- xor,>= arg0,arg1,0 ; get correct sign of quotient
- sub 0,retreg,retreg ; based on operand signs
- bv,n 0(r31)
- nop
-;______________________________________________________________________
-small_divisor:
- blr,n arg1,r0
- nop
-; table for divisor == 0,1, ... ,15
- addit,= 0,arg1,r0 ; trap if divisor == 0
- nop
- bv 0(r31) ; divisor == 1
- copy arg0,retreg
- b,n $$divI_2 ; divisor == 2
- nop
- b,n $$divI_3 ; divisor == 3
- nop
- b,n $$divI_4 ; divisor == 4
- nop
- b,n $$divI_5 ; divisor == 5
- nop
- b,n $$divI_6 ; divisor == 6
- nop
- b,n $$divI_7 ; divisor == 7
- nop
- b,n $$divI_8 ; divisor == 8
- nop
- b,n $$divI_9 ; divisor == 9
- nop
- b,n $$divI_10 ; divisor == 10
- nop
- b normal1 ; divisor == 11
- add,>= 0,arg0,retreg
- b,n $$divI_12 ; divisor == 12
- nop
- b normal1 ; divisor == 13
- add,>= 0,arg0,retreg
- b,n $$divI_14 ; divisor == 14
- nop
- b,n $$divI_15 ; divisor == 15
- nop
-;______________________________________________________________________
-negative1:
- sub 0,arg0,retreg ; result is negation of dividend
- bv 0(r31)
- addo arg0,arg1,r0 ; trap iff dividend==0x80000000 && divisor==-1
- .exit
- .procend
-
- .subspa $LIT$
-___hp_free_copyright:
- .export ___hp_free_copyright,data
- .align 4
- .string "(c) Copyright 1986 HEWLETT-PACKARD COMPANY\x0aTo anyone who acknowledges that this file is provided \"AS IS\"\x0awithout any express or implied warranty:\x0a permission to use, copy, modify, and distribute this file\x0afor any purpose is hereby granted without fee, provided that\x0athe above copyright notice and this notice appears in all\x0acopies, and that the name of Hewlett-Packard Company not be\x0aused in advertising or publicity pertaining to distribution\x0aof the software without specific, written prior permission.\x0aHewlett-Packard Company makes no representations about the\x0asuitability of this software for any purpose.\x0a\x00"
- .align 4
- .end
diff --git a/c/src/lib/libcpu/hppa1.1/runway/Makefile.in b/c/src/lib/libcpu/hppa1.1/runway/Makefile.in
deleted file mode 100644
index 30d2871ec6..0000000000
--- a/c/src/lib/libcpu/hppa1.1/runway/Makefile.in
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_PIECES = runway
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-SRCS=$(H_FILES) $(EQ_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libcpu/hppa1.1/runway/runway.h b/c/src/lib/libcpu/hppa1.1/runway/runway.h
deleted file mode 100644
index 41aafe26ef..0000000000
--- a/c/src/lib/libcpu/hppa1.1/runway/runway.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * File: $RCSfile$
- * Project: PixelFlow
- * Created: 94/11/29
- * RespEngr: tony bennett
- * Revision: $Revision$
- * Last Mod: $Date$
- *
- * Description:
- * definitions specific to the runway bus
- *
- * TODO:
- * Add lots more.
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_RUNWAY_H
-#define _INCLUDE_RUNWAY_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define HPPA_RUNWAY_PROC_HPA_BASE ((void *) 0xFFFA0000)
-
-/* given a processor number, where is its HPA? */
-#define HPPA_RUNWAY_HPA(cpu) \
- ((rtems_unsigned32) (HPPA_RUNWAY_PROC_HPA_BASE + ((cpu) * 0x2000)))
-
-#define HPPA_RUNWAY_REG_IO_EIR_OFFSET 0x000
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! _INCLUDE_RUNWAY_H */
diff --git a/c/src/lib/libcpu/hppa1.1/semaphore/Makefile.in b/c/src/lib/libcpu/hppa1.1/semaphore/Makefile.in
deleted file mode 100644
index 309e9a93af..0000000000
--- a/c/src/lib/libcpu/hppa1.1/semaphore/Makefile.in
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/semaphore.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=semaphore
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_PIECES=semaphore
-H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-# Add your list of files to delete here.
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libcpu/hppa1.1/semaphore/semaphore.c b/c/src/lib/libcpu/hppa1.1/semaphore/semaphore.c
deleted file mode 100644
index 3819736d03..0000000000
--- a/c/src/lib/libcpu/hppa1.1/semaphore/semaphore.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Description:
- * HPPA fast spinlock semaphores based on LDCWX instruction.
- * These semaphores are not known to RTEMS.
- *
- * TODO:
- * Put node number in high 16 bits of flag??
- * XXX: Need h_s_deallocate
- *
- * COPYRIGHT (c) 1994 by Division Incorporated
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#include "semaphore.h"
-
-/*
- * Report fatal semaphore error
- */
-
-#define SEM_FATAL_ERROR(sp) rtems_fatal_error_occurred((rtems_unsigned32) sp)
-
-#define SEM_CHECK(sp) do { \
- if (((sp) == 0) || (int) (sp) & 0xf) \
- { \
- SEM_FATAL_ERROR(sp); \
- } \
- } while (0)
-
-/*
- * Init a semaphore to be free
- */
-
-#define SEM_FREE_INIT(sp) \
- do { \
- (sp)->lock = 1; \
- (sp)->flags = 0; \
- (sp)->owner_tcb = 0; \
- } while (0)
-
-/*
- * Grab a semaphore recording its owner.
- */
-
-#define SEM_MARK_GRABBED(sp) \
- do { \
- (sp)->owner_tcb = _Thread_Executing; \
- } while (0)
-
-/*
- * Mark the semaphore busy
- */
-
-#define SEM_MARK_BUSY(sp) ((sp)->flags |= HPPA_SEM_IN_USE)
-
-/*
- * Is a semaphore available?
- */
-
-#define SEM_IS_AVAILABLE(sp) ((sp)->owner_tcb == 0)
-
-/*
- * The pool control semaphore is the first in the pool
- */
-
-#define SEM_CONTROL (&hppa_semaphore_pool[0])
-#define SEM_FIRST (&hppa_semaphore_pool[1])
-
-#define SEM_PRIVATE(cookie) rtems_interrupt_disable(cookie)
-
-#define SEM_PUBLIC(cookie) rtems_interrupt_enable(cookie)
-
-
-/*
- * Control variables for the pool
- */
-
-hppa_semaphore_t *hppa_semaphore_pool; /* ptr to first */
-int hppa_semaphores;
-int hppa_semaphores_available;
-
-void
-hppa_semaphore_pool_initialize(void *pool_base,
- int pool_size)
-{
- hppa_semaphore_t *sp;
- int align_factor;
- rtems_unsigned32 isr_level;
-
- /*
- * round pool_base up to be a multiple of SEM_ALIGN
- */
-
- align_factor = SEM_ALIGN - (((int) pool_base) & (SEM_ALIGN-1));
- if (align_factor != SEM_ALIGN)
- {
- pool_base += align_factor;
- pool_size -= align_factor;
- }
-
- /*
- * How many can the pool hold?
- * Assumes the semaphores are SEM_ALIGN bytes each
- */
-
- if (sizeof(hppa_semaphore_t) != SEM_ALIGN)
- rtems_fatal_error_occurred(RTEMS_INVALID_SIZE);
-
- pool_size &= ~(SEM_ALIGN - 1);
-
- SEM_PRIVATE(isr_level);
-
- hppa_semaphore_pool = pool_base;
- hppa_semaphores = pool_size / SEM_ALIGN;
-
- /*
- * If we are node0, then init all in the pool
- */
-
- if (cpu_number == 0)
- {
- /*
- * Tell other cpus we are not done, jic
- */
- SEM_CONTROL->user = rtems_build_name('!', 'D', 'N', 'E');
-
- for (sp=SEM_FIRST; sp < &hppa_semaphore_pool[hppa_semaphores]; sp++)
- SEM_FREE_INIT(sp);
- SEM_FREE_INIT(SEM_CONTROL);
- }
-
- /*
- * Tell other cpus we are done, or wait for it to be done if on another cpu
- */
-
- if (cpu_number == 0)
- SEM_CONTROL->user = rtems_build_name('D', 'O', 'N', 'E');
- else
- while (SEM_CONTROL->user != rtems_build_name('D', 'O', 'N', 'E'))
- ;
-
- hppa_semaphores_available = hppa_semaphores;
-
- SEM_PUBLIC(isr_level);
-}
-
-/*
- * Function: hppa_semaphore_acquire
- * Created: 94/11/29
- * RespEngr: tony bennett
- *
- * Description:
- * Acquire a semaphore. Will spin on the semaphore unless
- * 'flag' says not to.
- *
- * Parameters:
- *
- *
- * Returns:
- * 0 -- if did not acquire
- * non-zero -- if acquired semaphore
- * (actually this is the spin count)
- *
- * Notes:
- * There is no requirement that the semaphore be within the pool
- *
- * Deficiencies/ToDo:
- *
- */
-
-
-rtems_unsigned32
-hppa_semaphore_acquire(hppa_semaphore_t *sp,
- int flag)
-{
- rtems_unsigned32 lock_value;
- rtems_unsigned32 spin_count = 1;
-
- SEM_CHECK(sp);
-
- for (;;)
- {
- HPPA_ASM_LDCWS(0, 0, sp, lock_value);
-
- if (lock_value) /* we now own the lock */
- {
- SEM_MARK_GRABBED(sp);
- return spin_count ? spin_count : ~0; /* jic */
- }
-
- if (flag & HPPA_SEM_NO_SPIN)
- return 0;
-
- spin_count++;
- }
-}
-
-void
-hppa_semaphore_release(hppa_semaphore_t *sp)
-{
- SEM_CHECK(sp);
-
- if (sp->owner_tcb != _Thread_Executing)
- SEM_FATAL_ERROR("owner mismatch");
-
- sp->lock = 1;
-}
-
-
-/*
- * Function: hppa_semaphore_allocate
- * Created: 94/11/29
- * RespEngr: tony bennett
- *
- * Description:
- * Get a pointer to a semaphore.
- *
- * Parameters:
- * which -- if 0, then allocate a free semaphore from the pool
- * if non-zero, then return pointer to that one, even
- * if it is already busy.
- *
- * Returns:
- * successful -- pointer to semaphore
- * NULL otherwise
- *
- * Notes:
- *
- *
- * Deficiencies/ToDo:
- *
- *
- */
-
-hppa_semaphore_t *
-hppa_semaphore_allocate(rtems_unsigned32 which,
- int flag)
-{
- hppa_semaphore_t *sp = 0;
-
- /*
- * grab the control semaphore
- */
-
- if (hppa_semaphore_acquire(SEM_CONTROL, 0) == 0)
- SEM_FATAL_ERROR("could not grab control semaphore");
-
- /*
- * Find a free one and init it
- */
-
- if (which)
- {
- if (which >= hppa_semaphores)
- SEM_FATAL_ERROR("requested non-existent semaphore");
- sp = &hppa_semaphore_pool[which];
-
- /*
- * if it is "free", then mark it claimed now.
- * If it is not free then we are done.
- */
-
- if (SEM_IS_AVAILABLE(sp))
- goto allmine;
- }
- else for (sp = SEM_FIRST;
- sp < &hppa_semaphore_pool[hppa_semaphores];
- sp++)
- {
- if (SEM_IS_AVAILABLE(sp))
- {
-allmine: SEM_FREE_INIT(sp);
- SEM_MARK_BUSY(sp);
- if ( ! (flag & HPPA_SEM_INITIALLY_FREE))
- SEM_MARK_GRABBED(sp);
- break;
- }
- }
-
- /*
- * Free up the control semaphore
- */
-
- hppa_semaphore_release(SEM_CONTROL);
-
- return sp;
-}
-
diff --git a/c/src/lib/libcpu/hppa1.1/semaphore/semaphore.h b/c/src/lib/libcpu/hppa1.1/semaphore/semaphore.h
deleted file mode 100644
index 0ff4d13767..0000000000
--- a/c/src/lib/libcpu/hppa1.1/semaphore/semaphore.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Description:
- * HPPA fast spinlock semaphores based on LDCWX instruction.
- * These semaphores are not known to RTEMS.
- *
- * TODO:
- *
- * COPYRIGHT (c) 1994,95 by Division Incorporated
- *
- * The license and distribution 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 _INCLUDE_SEMAPHORE_H
-#define _INCLUDE_SEMAPHORE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This structure has hardware requirements.
- * LDCWX opcode requires 16byte alignment for the lock
- * 'lock' must be first member of structure.
- */
-
-#define SEM_ALIGN 16
-
-typedef volatile struct {
-
- rtems_unsigned32 lock __attribute__ ((aligned (SEM_ALIGN)));
-
- rtems_unsigned32 flags;
-
- void *owner_tcb; /* for debug/commentary only */
-
- rtems_unsigned32 user; /* for use by user */
-
-} hppa_semaphore_t;
-
-/*
- * Values for flags
- */
-
-#define HPPA_SEM_IN_USE 0x0001 /* semaphore owned by somebody */
-#define HPPA_SEM_NO_SPIN 0x0002 /* don't spin if unavailable */
-#define HPPA_SEM_INITIALLY_FREE 0x0004 /* init it to be free */
-
-/*
- * Caller specifiable flags
- */
-
-#define HPPA_SEM_CALLER_FLAGS (HPPA_SEM_NO_SPIN | HPPA_SEM_INITIALLY_FREE)
-
-void hppa_semaphore_pool_initialize(void *pool_base, int pool_size);
-
-rtems_unsigned32 hppa_semaphore_acquire(hppa_semaphore_t *sp, int flag);
-
-void hppa_semaphore_release(hppa_semaphore_t *sp);
-
-hppa_semaphore_t *hppa_semaphore_allocate(rtems_unsigned32 which, int flag);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! _INCLUDE_SEMAPHORE_H */
diff --git a/c/src/lib/libcpu/hppa1.1/timer/Makefile.in b/c/src/lib/libcpu/hppa1.1/timer/Makefile.in
deleted file mode 100644
index 2c423f2a5a..0000000000
--- a/c/src/lib/libcpu/hppa1.1/timer/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by
-# libbsp/hppa/BSP/wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/hppa1.1/timer/timer.c b/c/src/lib/libcpu/hppa1.1/timer/timer.c
deleted file mode 100644
index 4b900ed96b..0000000000
--- a/c/src/lib/libcpu/hppa1.1/timer/timer.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* timer.c
- *
- * This file manages the interval timer on the PA-RISC.
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-volatile rtems_unsigned32 Timer_starting;
-rtems_boolean Timer_driver_Find_average_overhead;
-
-void Timer_initialize()
-{
- Timer_starting = get_itimer();
- set_eiem(0x80000000);
-}
-
-#define AVG_OVERHEAD 0 /* It typically takes 3.0 microseconds */
- /* (6 countdowns) to start/stop the timer. */
-#define LEAST_VALID 1 /* Don't trust a value lower than this */
-
-int Read_timer()
-{
- rtems_unsigned32 clicks;
- rtems_unsigned32 total;
-
- clicks = get_itimer();
-
- total = clicks - Timer_starting;
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in XXX microsecond units */
-
- else {
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
- return (total - AVG_OVERHEAD);
- }
-}
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libcpu/i386/Makefile.in b/c/src/lib/libcpu/i386/Makefile.in
deleted file mode 100644
index 3d339e036b..0000000000
--- a/c/src/lib/libcpu/i386/Makefile.in
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=cpu displayCpu
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/cpu.h $(srcdir)/registers.h $(srcdir)/cpuModel.h
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=cpu_asm cpuModel
-S_FILES=$(S_PIECES:%=%.S)
-S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-LIB=${ARCH}/libcpuspec.a
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${LIB}: ${SRCS} ${OBJS}
- $(make-library)
-
-preinstall :
- $(MKDIR) $(PROJECT_INCLUDE)/libcpu
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/libcpu
-
-all: ${ARCH} $(SRCS) preinstall $(OBJ) $(LIB)
- cd wrapup; $(MAKE)
-
-# the .rel file built here will be put into libcpu.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/i386/cpu.c b/c/src/lib/libcpu/i386/cpu.c
deleted file mode 100644
index 5f44bd0d2b..0000000000
--- a/c/src/lib/libcpu/i386/cpu.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * cpu.c - This file contains implementation of C function to
- * Instanciate IDT entries. More detailled information can be found
- * on Intel site and more precisely in the following book :
- *
- * Pentium Processor familly
- * Developper's Manual
- *
- * Volume 3 : Architecture and Programming Manual
- *
- * Copyright (C) 1998 Eric Valette (valette@crf.canon.fr)
- * Canon Centre Recherche France.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <libcpu/cpu.h>
-#include <irq.h>
-
-static rtems_raw_irq_connect_data* raw_irq_table;
-static rtems_raw_irq_connect_data default_raw_irq_entry;
-static interrupt_gate_descriptor default_idt_entry;
-static rtems_raw_irq_global_settings* local_settings;
-
-void create_interrupt_gate_descriptor (interrupt_gate_descriptor* idtEntry,
- rtems_raw_irq_hdl hdl)
-{
- idtEntry->low_offsets_bits = (((unsigned) hdl) & 0xffff);
- idtEntry->segment_selector = i386_get_cs();
- idtEntry->fixed_value_bits = 0;
- idtEntry->gate_type = 0xe;
- idtEntry->privilege = 0;
- idtEntry->present = 1;
- idtEntry->high_offsets_bits = ((((unsigned) hdl) >> 16) & 0xffff);
-}
-
-rtems_raw_irq_hdl get_hdl_from_vector(rtems_vector_offset index)
-{
- rtems_raw_irq_hdl hdl;
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if(index >= limit) {
- return 0;
- }
-
- * ((unsigned int*) &hdl) = (idt_entry_tbl[index].low_offsets_bits |
- (idt_entry_tbl[index].high_offsets_bits << 16));
- return hdl;
-}
-
-int i386_set_idt_entry (const rtems_raw_irq_connect_data* irq)
-{
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
- unsigned int level;
-
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (irq->idtIndex >= limit) {
- return 0;
- }
- /*
- * Check if default handler is actually connected. If not issue an error.
- * You must first get the current handler via i386_get_current_idt_entry
- * and then disconnect it using i386_delete_idt_entry.
- * RATIONALE : to always have the same transition by forcing the user
- * to get the previous handler before accepting to disconnect.
- */
- if (get_hdl_from_vector(irq->idtIndex) != default_raw_irq_entry.hdl) {
- return 0;
- }
-
- _CPU_ISR_Disable(level);
-
- raw_irq_table [irq->idtIndex] = *irq;
- create_interrupt_gate_descriptor (&idt_entry_tbl[irq->idtIndex], irq->hdl);
- irq->on(irq);
-
- _CPU_ISR_Enable(level);
- return 1;
-}
-
-void _CPU_ISR_install_vector (unsigned vector,
- void* hdl,
- void** oldHdl)
-{
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
- interrupt_gate_descriptor new;
- unsigned int level;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (vector >= limit) {
- return;
- }
- _CPU_ISR_Disable(level)
- * ((unsigned int *) oldHdl) = idt_entry_tbl[vector].low_offsets_bits |
- (idt_entry_tbl[vector].high_offsets_bits << 16);
-
- create_interrupt_gate_descriptor(&new, hdl);
- idt_entry_tbl[vector] = new;
-
- _CPU_ISR_Enable(level);
-}
-
-int i386_get_current_idt_entry (rtems_raw_irq_connect_data* irq)
-{
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (irq->idtIndex >= limit) {
- return 0;
- }
- raw_irq_table [irq->idtIndex].hdl = get_hdl_from_vector(irq->idtIndex);
-
- *irq = raw_irq_table [irq->idtIndex];
-
- return 1;
-}
-
-int i386_delete_idt_entry (const rtems_raw_irq_connect_data* irq)
-{
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
- unsigned int level;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (irq->idtIndex >= limit) {
- return 0;
- }
- /*
- * Check if handler passed is actually connected. If not issue an error.
- * You must first get the current handler via i386_get_current_idt_entry
- * and then disconnect it using i386_delete_idt_entry.
- * RATIONALE : to always have the same transition by forcing the user
- * to get the previous handler before accepting to disconnect.
- */
- if (get_hdl_from_vector(irq->idtIndex) != irq->hdl){
- return 0;
- }
- _CPU_ISR_Disable(level);
-
- idt_entry_tbl[irq->idtIndex] = default_idt_entry;
-
- irq->off(irq);
-
- raw_irq_table[irq->idtIndex] = default_raw_irq_entry;
- raw_irq_table[irq->idtIndex].idtIndex = irq->idtIndex;
-
- _CPU_ISR_Enable(level);
-
- return 1;
-}
-
-/*
- * Caution this function assumes the IDTR has been already set.
- */
-int i386_init_idt (rtems_raw_irq_global_settings* config)
-{
- unsigned limit;
- unsigned i;
- unsigned level;
- interrupt_gate_descriptor* idt_entry_tbl;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (config->idtSize != limit) {
- return 0;
- }
- /*
- * store various accelarators
- */
- raw_irq_table = config->rawIrqHdlTbl;
- local_settings = config;
- default_raw_irq_entry = config->defaultRawEntry;
-
- _CPU_ISR_Disable(level);
-
- create_interrupt_gate_descriptor (&default_idt_entry, default_raw_irq_entry.hdl);
-
- for (i=0; i < limit; i++) {
- interrupt_gate_descriptor new;
- create_interrupt_gate_descriptor (&new, raw_irq_table[i].hdl);
- idt_entry_tbl[i] = new;
- if (raw_irq_table[i].hdl != default_raw_irq_entry.hdl) {
- raw_irq_table[i].on(&raw_irq_table[i]);
- }
- else {
- raw_irq_table[i].off(&raw_irq_table[i]);
- }
- }
- _CPU_ISR_Enable(level);
-
- return 1;
-}
-
-int i386_get_idt_config (rtems_raw_irq_global_settings** config)
-{
- *config = local_settings;
- return 1;
-}
-
-/*
- * Caution this function assumes the GDTR has been already set.
- */
-int i386_set_gdt_entry (unsigned short segment_selector, unsigned base,
- unsigned limit)
-{
- unsigned gdt_limit;
- unsigned short tmp_segment = 0;
- unsigned int limit_adjusted;
- segment_descriptors* gdt_entry_tbl;
-
-
- i386_get_info_from_GDTR (&gdt_entry_tbl, &gdt_limit);
-
- if (segment_selector > limit) {
- return 0;
- }
- /*
- * set up limit first
- */
- limit_adjusted = limit;
- if ( limit > 4095 ) {
- gdt_entry_tbl[segment_selector].granularity = 1;
- limit_adjusted /= 4096;
- }
- gdt_entry_tbl[segment_selector].limit_15_0 = limit_adjusted & 0xffff;
- gdt_entry_tbl[segment_selector].limit_19_16 = (limit_adjusted >> 16) & 0xf;
- /*
- * set up base
- */
- gdt_entry_tbl[segment_selector].base_address_15_0 = base & 0xffff;
- gdt_entry_tbl[segment_selector].base_address_23_16 = (base >> 16) & 0xff;
- gdt_entry_tbl[segment_selector].base_address_31_24 = (base >> 24) & 0xff;
- /*
- * set up descriptor type (this may well becomes a parameter if needed)
- */
- gdt_entry_tbl[segment_selector].type = 2; /* Data R/W */
- gdt_entry_tbl[segment_selector].descriptor_type = 1; /* Code or Data */
- gdt_entry_tbl[segment_selector].privilege = 0; /* ring 0 */
- gdt_entry_tbl[segment_selector].present = 1; /* not present */
-
- /*
- * Now, reload all segment registers so the limit takes effect.
- */
-
- asm volatile( "movw %%ds,%0 ; movw %0,%%ds
- movw %%es,%0 ; movw %0,%%es
- movw %%fs,%0 ; movw %0,%%fs
- movw %%gs,%0 ; movw %0,%%gs
- movw %%ss,%0 ; movw %0,%%ss"
- : "=r" (tmp_segment)
- : "0" (tmp_segment)
- );
-
- return 1;
-}
diff --git a/c/src/lib/libcpu/i386/cpu.h b/c/src/lib/libcpu/i386/cpu.h
deleted file mode 100644
index be25929a0e..0000000000
--- a/c/src/lib/libcpu/i386/cpu.h
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- * cpu.h - This file contains definitions for data structure related
- * to Intel system programming. More information can be found
- * on Intel site and more precisely in the following book :
- *
- * Pentium Processor familly
- * Developper's Manual
- *
- * Volume 3 : Architecture and Programming Manual
- *
- * Copyright (C) 1998 Eric Valette (valette@crf.canon.fr)
- * Canon Centre Recherche France.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#ifndef _LIBCPU_i386_CPU_H
-#define _LIBCPU_i386_CPU_H
-
-#include <libcpu/registers.h>
-
-
-#ifndef ASM
-
-/*
- * Interrupt Level Macros
- */
-
-#define i386_disable_interrupts( _level ) \
- { \
- _level = 0; /* avoids warnings */ \
- asm volatile ( "pushf ; \
- cli ; \
- pop %0" \
- : "=r" ((_level)) : "0" ((_level)) \
- ); \
- }
-
-#define i386_enable_interrupts( _level ) \
- { \
- asm volatile ( "push %0 ; \
- popf" \
- : "=r" ((_level)) : "0" ((_level)) \
- ); \
- }
-
-#define i386_flash_interrupts( _level ) \
- { \
- asm volatile ( "push %0 ; \
- popf ; \
- cli" \
- : "=r" ((_level)) : "0" ((_level)) \
- ); \
- }
-
-#define i386_get_interrupt_level( _level ) \
- do { \
- register unsigned32 _eflags = 0; \
- \
- asm volatile ( "pushf ; \
- pop %0" \
- : "=r" ((_eflags)) : "0" ((_eflags)) \
- ); \
- \
- _level = (_eflags & EFLAGS_INTR_ENABLE) ? 0 : 1; \
- } while (0)
-
-#define _CPU_ISR_Disable( _level ) i386_disable_interrupts( _level )
-#define _CPU_ISR_Enable( _level ) i386_enable_interrupts( _level )
-
-/*
- * Segment Access Routines
- *
- * NOTE: Unfortunately, these are still static inlines even when the
- * "macro" implementation of the generic code is used.
- */
-
-static inline unsigned short i386_get_cs()
-{
- register unsigned short segment = 0;
-
- asm volatile ( "movw %%cs,%0" : "=r" (segment) : "0" (segment) );
-
- return segment;
-}
-
-static inline unsigned short i386_get_ds()
-{
- register unsigned short segment = 0;
-
- asm volatile ( "movw %%ds,%0" : "=r" (segment) : "0" (segment) );
-
- return segment;
-}
-
-static inline unsigned short i386_get_es()
-{
- register unsigned short segment = 0;
-
- asm volatile ( "movw %%es,%0" : "=r" (segment) : "0" (segment) );
-
- return segment;
-}
-
-static inline unsigned short i386_get_ss()
-{
- register unsigned short segment = 0;
-
- asm volatile ( "movw %%ss,%0" : "=r" (segment) : "0" (segment) );
-
- return segment;
-}
-
-static inline unsigned short i386_get_fs()
-{
- register unsigned short segment = 0;
-
- asm volatile ( "movw %%fs,%0" : "=r" (segment) : "0" (segment) );
-
- return segment;
-}
-
-static inline unsigned short i386_get_gs()
-{
- register unsigned short segment = 0;
-
- asm volatile ( "movw %%gs,%0" : "=r" (segment) : "0" (segment) );
-
- return segment;
-}
-
-/*
- * IO Port Access Routines
- */
-
-#define i386_outport_byte( _port, _value ) \
- { register unsigned short __port = _port; \
- register unsigned char __value = _value; \
- \
- asm volatile ( "outb %0,%1" : "=a" (__value), "=d" (__port) \
- : "0" (__value), "1" (__port) \
- ); \
- }
-
-#define i386_outport_word( _port, _value ) \
- { register unsigned short __port = _port; \
- register unsigned short __value = _value; \
- \
- asm volatile ( "outw %0,%1" : "=a" (__value), "=d" (__port) \
- : "0" (__value), "1" (__port) \
- ); \
- }
-
-#define i386_outport_long( _port, _value ) \
- { register unsigned short __port = _port; \
- register unsigned int __value = _value; \
- \
- asm volatile ( "outl %0,%1" : "=a" (__value), "=d" (__port) \
- : "0" (__value), "1" (__port) \
- ); \
- }
-
-#define i386_inport_byte( _port, _value ) \
- { register unsigned short __port = _port; \
- register unsigned char __value = 0; \
- \
- asm volatile ( "inb %1,%0" : "=a" (__value), "=d" (__port) \
- : "0" (__value), "1" (__port) \
- ); \
- _value = __value; \
- }
-
-#define i386_inport_word( _port, _value ) \
- { register unsigned short __port = _port; \
- register unsigned short __value = 0; \
- \
- asm volatile ( "inw %1,%0" : "=a" (__value), "=d" (__port) \
- : "0" (__value), "1" (__port) \
- ); \
- _value = __value; \
- }
-
-#define i386_inport_long( _port, _value ) \
- { register unsigned short __port = _port; \
- register unsigned int __value = 0; \
- \
- asm volatile ( "inl %1,%0" : "=a" (__value), "=d" (__port) \
- : "0" (__value), "1" (__port) \
- ); \
- _value = __value; \
- }
-
-/*
- * Type definition for raw interrupts.
- */
-
-typedef unsigned char rtems_vector_offset;
-
-struct __rtems_raw_irq_connect_data__;
-
-typedef void (*rtems_raw_irq_hdl) (void);
-typedef void (*rtems_raw_irq_enable) (const struct __rtems_raw_irq_connect_data__*);
-typedef void (*rtems_raw_irq_disable) (const struct __rtems_raw_irq_connect_data__*);
-typedef int (*rtems_raw_irq_is_enabled) (const struct __rtems_raw_irq_connect_data__*);
-
-typedef struct __rtems_raw_irq_connect_data__{
- /*
- * IDT vector offset (IRQ line + PC386_IRQ_VECTOR_BASE)
- */
- rtems_vector_offset idtIndex;
- /*
- * IDT raw handler. See comment on handler properties below in function prototype.
- */
- rtems_raw_irq_hdl hdl;
- /*
- * function for enabling raw interrupts. In order to be consistent
- * with the fact that the raw connexion can defined in the
- * libcpu library, this library should have no knowledge of
- * board specific hardware to manage interrupts and thus the
- * "on" routine must enable the irq both at device and PIC level.
- *
- */
- rtems_raw_irq_enable on;
- /*
- * function for disabling raw interrupts. In order to be consistent
- * with the fact that the raw connexion can defined in the
- * libcpu library, this library should have no knowledge of
- * board specific hardware to manage interrupts and thus the
- * "on" routine must disable the irq both at device and PIC level.
- *
- */
- rtems_raw_irq_disable off;
- /*
- * function enabling to know what interrupt may currently occur
- */
- rtems_raw_irq_is_enabled isOn;
-}rtems_raw_irq_connect_data;
-
-typedef struct {
- /*
- * size of all the table fields (*Tbl) described below.
- */
- unsigned int idtSize;
- /*
- * Default handler used when disconnecting interrupts.
- */
- rtems_raw_irq_connect_data defaultRawEntry;
- /*
- * Table containing initials/current value.
- */
- rtems_raw_irq_connect_data* rawIrqHdlTbl;
-}rtems_raw_irq_global_settings;
-
-/*
- * See page 14.9 Figure 14-2.
- *
- */
-typedef struct {
- unsigned int low_offsets_bits : 16;
- unsigned int segment_selector : 16;
- unsigned int fixed_value_bits : 8;
- unsigned int gate_type : 5;
- unsigned int privilege : 2;
- unsigned int present : 1;
- unsigned int high_offsets_bits: 16;
-}interrupt_gate_descriptor;
-
-
-/*
- * C callable function enabling to create a interrupt_gate_descriptor
- */
-void create_interrupt_gate_descriptor (interrupt_gate_descriptor*, rtems_raw_irq_hdl);
-
-/*
- * C callable function enabling to get handler currently connected to a vector
- *
- */
-rtems_raw_irq_hdl get_hdl_from_vector(rtems_vector_offset);
-
-/*
- * C callable function enabling to get easilly usable info from
- * the actual value of IDT register.
- */
-extern void i386_get_info_from_IDTR (interrupt_gate_descriptor** table,
- unsigned* limit);
-/*
- * C callable function enabling to change the value of IDT register. Must be called
- * with interrupts masked at processor level!!!.
- */
-extern void i386_set_IDTR (interrupt_gate_descriptor* table,
- unsigned limit);
-
-/*
- * C callable function enabling to set up one raw idt entry
- */
-extern int i386_set_idt_entry (const rtems_raw_irq_connect_data*);
-
-/*
- * C callable function enabling to get one current raw idt entry
- */
-extern int i386_get_current_idt_entry (rtems_raw_irq_connect_data*);
-
-/*
- * C callable function enabling to remove one current raw idt entry
- */
-extern int i386_delete_idt_entry (const rtems_raw_irq_connect_data*);
-
-/*
- * C callable function enabling to init idt.
- *
- * CAUTION : this function assumes that the IDTR register
- * has been already set.
- */
-extern int i386_init_idt (rtems_raw_irq_global_settings* config);
-
-/*
- * C callable function enabling to get actual idt configuration
- */
-extern int i386_get_idt_config (rtems_raw_irq_global_settings** config);
-
-
-/*
- * See page 11.12 Figure 11-8.
- *
- */
-
-typedef struct {
- unsigned int limit_15_0 : 16;
- unsigned int base_address_15_0 : 16;
- unsigned int base_address_23_16 : 8;
- unsigned int type : 4;
- unsigned int descriptor_type : 1;
- unsigned int privilege : 2;
- unsigned int present : 1;
- unsigned int limit_19_16 : 4;
- unsigned int available : 1;
- unsigned int fixed_value_bits : 1;
- unsigned int operation_size : 1;
- unsigned int granularity : 1;
- unsigned int base_address_31_24 : 8;
-}segment_descriptors;
-
-/*
- * C callable function enabling to get easilly usable info from
- * the actual value of GDT register.
- */
-extern void i386_get_info_from_GDTR (segment_descriptors** table,
- unsigned* limit);
-/*
- * C callable function enabling to change the value of GDT register. Must be called
- * with interrupts masked at processor level!!!.
- */
-extern void i386_set_GDTR (segment_descriptors*,
- unsigned limit);
-
-/*
- * C callable function enabling to set up one raw interrupt handler
- */
-extern int i386_set_gdt_entry (unsigned short segment_selector, unsigned base,
- unsigned limit);
-
-# endif /* ASM */
-
-#endif
diff --git a/c/src/lib/libcpu/i386/cpuModel.S b/c/src/lib/libcpu/i386/cpuModel.S
deleted file mode 100644
index aaace8af9f..0000000000
--- a/c/src/lib/libcpu/i386/cpuModel.S
+++ /dev/null
@@ -1,255 +0,0 @@
-/* cpuModel.S
- *
- * This file contains all assembly code for the Intel Cpu identification.
- * It is based on linux cpu detection code.
- *
- * Intel also provides public similar code in the book
- * called :
- *
- * Pentium Processor Family
- * Developer Family
- * Volume 3 : Architecture and Programming Manual
- *
- * At the following place :
- *
- * Chapter 5 : Feature determination
- * Chapter 25: CPUID instruction
- *
- * COPYRIGHT (c) 1998 valette@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.
- *
- * $Id$
- */
-
-#include <asm.h>
-#include <libcpu/registers.h>
-
-BEGIN_CODE
- PUBLIC(checkCPUtypeSetCr0);
-/*
- * check Processor type: 386, 486, 6x86(L) or CPUID capable processor
- */
-
-SYM (checkCPUtypeSetCr0):
- /*
- * Assume 386 for now
- */
- movl $3, SYM (x86)
- /*
- * Start using the EFAGS AC bit determination method described in
- * the book mentionned above page 5.1. If this bit can be set we
- * have a 486 or above.
- */
- pushfl /* save EFLAGS */
-
- pushfl /* Get EFLAGS in EAX */
- popl eax
-
- movl eax,ecx /* save original EFLAGS in ECX */
- xorl $EFLAGS_ALIGN_CHECK,eax /* flip AC bit in EAX */
- pushl eax /* set EAX as EFLAGS */
- popfl
- pushfl /* Get new EFLAGS in EAX */
- popl eax
-
- xorl ecx,eax /* check if AC bit changed */
- andl $EFLAGS_ALIGN_CHECK,eax
- je is386 /* If not : we have a 386 */
- /*
- * Assume 486 for now
- */
- movl $4,SYM (x86)
- movl ecx,eax /* Restore orig EFLAGS in EAX */
- xorl $EFLAGS_ID,eax /* flip ID flag */
- pushl eax /* set EAX as EFLAGS */
- popfl
- pushfl /* Get new EFLAGS in EAX */
- popl eax
-
- xorl ecx,eax /* check if ID bit changed */
- andl $EFLAGS_ID,eax
-
- /*
- * if we are on a straight 486DX,
- * SX, or 487SX we can't change it
- * OTOH 6x86MXs and MIIs check OK
- * Also if we are on a Cyrix 6x86(L)
- */
- je is486x
-
-isnew:
- /*
- * restore original EFLAGS
- */
- popfl
- incl SYM(have_cpuid) /* we have CPUID instruction */
-
- /* use it to get :
- * processor type,
- * processor model,
- * processor mask,
- * by using it with EAX = 1
- */
- movl $1, eax
- cpuid
-
- movb al, cl /* save reg for future use */
-
- andb $0x0f,ah /* mask processor family */
- movb ah,SYM (x86) /* put result in x86 var */
-
- andb $0xf0, al /* get model */
- shrb $4, al
- movb al,SYM (x86_model) /* store it in x86_model */
-
- andb $0x0f, cl /* get mask revision */
- movb cl,SYM (x86_mask) /* store it in x86_mask */
-
- movl edx,SYM(x86_capability) /* store feature flags in x86_capability */
-
- /* get vendor info by using CPUID with EXA = 0 */
- xorl eax, eax
- cpuid
-
- /*
- * store results contained in ebx, edx, ecx in
- * x86_vendor_id variable.
- */
- movl ebx,SYM(x86_vendor_id)
- movl edx,SYM(x86_vendor_id)+4
- movl ecx,SYM(x86_vendor_id)+8
-
- movl cr0,eax /* 486+ */
- andl $(CR0_PAGING | CR0_PROTECTION_ENABLE | CR0_EXTENSION_TYPE), eax
- orl $(CR0_ALIGMENT_MASK | CR0_WRITE_PROTECT | CR0_NUMERIC_ERROR | CR0_MONITOR_COPROC),eax
- jmp 2f
-
-/* Now we test if we have a Cyrix 6x86(L). We didn't test before to avoid
- * clobbering the new BX chipset used with the Pentium II, which has a register
- * at the same addresses as those used to access the Cyrix special configuration
- * registers (CCRs).
- */
- /*
- * A Cyrix/IBM 6x86(L) preserves flags after dividing 5 by 2
- * (and it _must_ be 5 divided by 2) while other CPUs change
- * them in undefined ways. We need to know this since we may
- * need to enable the CPUID instruction at least.
- * We couldn't use this test before since the PPro and PII behave
- * like Cyrix chips in this respect.
- */
-is486x: xor ax,ax
- sahf
- movb $5,ax
- movb $2,bx
- div bl
- lahf
- cmpb $2,ah
- jne ncyrix
- /*
- * N.B. The pattern of accesses to 0x22 and 0x23 is *essential*
- * so do not try to "optimize" it! For the same reason we
- * do all this with interrupts off.
- */
-#define setCx86(reg, val) \
- movb reg,ax; \
- outb ax,$0x22; \
- movb val,ax; \
- outb ax,$0x23
-
-#define getCx86(reg) \
- movb reg,ax; \
- outb ax,$0x22; \
- inb $0x23,ax
-
- cli
- getCx86($0xc3) /* get CCR3 */
- movb ax,cx /* Save old value */
- movb ax,bx
- andb $0x0f,bx /* Enable access to all config registers */
- orb $0x10,bx /* by setting bit 4 */
- setCx86($0xc3,bx)
-
- getCx86($0xe8) /* now we can get CCR4 */
- orb $0x80,ax /* and set bit 7 (CPUIDEN) */
- movb ax,bx /* to enable CPUID execution */
- setCx86($0xe8,bx)
-
- getCx86($0xfe) /* DIR0 : let's check this is a 6x86(L) */
- andb $0xf0,ax /* should be 3xh */
- cmpb $0x30,ax
- jne n6x86
- getCx86($0xe9) /* CCR5 : we reset the SLOP bit */
- andb $0xfd,ax /* so that udelay calculation */
- movb ax,bx /* is correct on 6x86(L) CPUs */
- setCx86($0xe9,bx)
- setCx86($0xc3,cx) /* Restore old CCR3 */
- sti
- jmp isnew /* We enabled CPUID now */
-
-n6x86: setCx86($0xc3,cx) /* Restore old CCR3 */
- sti
-ncyrix: /* restore original EFLAGS */
- popfl
- movl cr0,eax /* 486 */
- andl $(CR0_PAGING | CR0_EXTENSION_TYPE | CR0_PROTECTION_ENABLE),eax /* Save PG,PE,ET */
- orl $(CR0_ALIGMENT_MASK | CR0_WRITE_PROTECT | CR0_NUMERIC_ERROR | CR0_MONITOR_COPROC),eax /* set AM, WP, NE and MP */
- jmp 2f
-is386: /* restore original EFLAGS */
- popfl
- movl cr0,eax /* 386 */
- andl $(CR0_PAGING | CR0_EXTENSION_TYPE | CR0_PROTECTION_ENABLE),eax /* Save PG,PE,ET */
- orl $CR0_MONITOR_COPROC,eax /* set MP */
-2: movl eax,cr0
- call check_x87
- ret
-
-
-/*
- * We depend on ET to be correct. This checks for 287/387.
- */
-check_x87:
- movb $0,SYM(hard_math)
- clts
- fninit
- fstsw ax
- cmpb $0,al
- je 1f
- movl cr0,eax /* no coprocessor: have to set bits */
- xorl $4,eax /* set EM */
- movl eax,cr0
- ret
- .align 16
-1: movb $1,SYM(hard_math)
- .byte 0xDB,0xE4 /* fsetpm for 287, ignored by 387 */
- ret
-
-END_CODE
-
-BEGIN_DATA
- PUBLIC(x86)
- PUBLIC(have_cpuid)
- PUBLIC(x86_model)
- PUBLIC(x86_mask)
- PUBLIC(x86_capability)
- PUBLIC(x86_vendor_id)
- PUBLIC(hard_math)
-
-SYM(x86):
- .byte 0
-SYM(have_cpuid):
- .long 0
-SYM(x86_model):
- .byte 0
-SYM(x86_mask):
- .byte 0
-SYM(x86_capability):
- .long 0
-SYM(x86_vendor_id):
- .zero 13
-SYM(hard_math):
- .byte 0
-END_DATA
-
diff --git a/c/src/lib/libcpu/i386/cpuModel.h b/c/src/lib/libcpu/i386/cpuModel.h
deleted file mode 100644
index a3e3bd201e..0000000000
--- a/c/src/lib/libcpu/i386/cpuModel.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* cpuModel.h
- *
- * This file contains declaration for variables and code
- * that may be used to get the Intel Cpu identification
- * that has been performed by checkCPUtypeSetCr0 function.
- *
- * COPYRIGHT (c) 1998 valette@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.
- *
- * $Id$
- */
-
-/*
- * Tell us the machine setup..
- */
-#include <stdio.h>
-#include <libcpu/cpu.h>
-#include <string.h>
-
-extern char hard_math; /* flotting point coprocessor present indicator */
-extern char x86; /* type of cpu (3 = 386, 4 =486, ...) */
-extern char x86_model;
-extern char x86_mask;
-extern int x86_capability;
-extern char x86_vendor_id[13];
-extern int have_cpuid;
-extern unsigned char Cx86_step; /* cyrix processor identification */
-
-extern void printCpuInfo(); /* Display this information on console in ascii form */
diff --git a/c/src/lib/libcpu/i386/cpu_asm.S b/c/src/lib/libcpu/i386/cpu_asm.S
deleted file mode 100644
index 38dc7318ae..0000000000
--- a/c/src/lib/libcpu/i386/cpu_asm.S
+++ /dev/null
@@ -1,117 +0,0 @@
-/* cpu_asm.S
- *
- * This file contains all assembly code for the Intel i386 IDT
- * manipulation.
- *
- * COPYRIGHT (c) 1998 valette@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.
- *
- * $Id$
- */
-
-#include <asm.h>
-
-BEGIN_CODE
-/*
- * C callable function enabling to get easilly usable info from
- * the actual value of IDT register.
- *
-extern void i386_get_info_from_IDTR (interrupt_gate_descriptor** table,
- unsigned* limit);
- */
-PUBLIC (i386_get_info_from_IDTR)
-PUBLIC (i386_set_IDTR)
-PUBLIC (i386_get_info_from_GDTR)
-PUBLIC (i386_set_GDTR)
-
-SYM (i386_get_info_from_IDTR):
- movl 4(esp), ecx /* get location where table address */
- /* must be stored */
- movl 8(esp), edx /* get location table size must be stored */
-
- subl $6, esp /* let room to prepare 48 bit IDTR */
-
- sidt (esp) /* get 48 bit IDTR value */
-
- movl 2(esp), eax /* get base */
- movl eax, (ecx)
-
- movzwl (esp), eax /* get limit */
- movl eax, (edx)
-
- addl $6, esp /* restore %esp */
- ret
-
-/*
- * C callable function enabling to change the value of IDT register. Must be called
- * with inmterrupt masked at processor level!!!.
- *
-extern void i386_set_IDTR (interrupt_gate_descriptor* table,
- unsigned limit);
- */
-SYM (i386_set_IDTR):
-
- leal 4(esp), edx /* load in edx address of input */
- /* parameter "table" */
-
- movl (edx), eax /* load base into eax */
- movl 4(edx), ecx /* load limit into ecx */
-
- movw cx, (edx) /* prepare 48 bit pointer */
- movl eax, 2(edx)
-
- lidt (edx)
-
- ret
-/*
- *
- * C callable function enabling to get easilly usable info from
- * the actual value of GDT register.
-extern void i386_get_info_from_GDTR (segment_descriptors** table,
- unsigned* limit);
- */
-
-SYM (i386_get_info_from_GDTR):
- movl 4(esp), ecx /* get location where table address */
- /* must be stored */
- movl 8(esp), edx /* get location table size must be stored */
-
- subl $6, esp /* let room to prepare 48 bit GDTR */
-
- sgdt (esp) /* get 48 bit GDTR value */
-
- movl 2(esp), eax /* get base */
- movl eax, (ecx)
-
- movzwl (esp), eax /* get limit */
- movl eax, (edx)
-
- addl $6, esp /* restore %esp */
- ret
-
-/*
- * C callable function enabling to change the value of GDT register.
- * Must be called with interrupts masked at processor level!!!.
- * extern void i386_set_GDTR (segment_descriptors*, unsigned limit);
- */
-SYM (i386_set_GDTR):
-
- leal 4(esp), edx /* load in edx address of input */
- /* parameter "table" */
-
- movl (edx), eax /* load base into eax */
- movl 4(edx), ecx /* load limit into ecx */
-
- movw cx, (edx) /* prepare 48 bit pointer */
- movl eax, 2(edx)
-
- lgdt (edx)
-
- ret
-
-END_CODE
-
-END
diff --git a/c/src/lib/libcpu/i386/displayCpu.c b/c/src/lib/libcpu/i386/displayCpu.c
deleted file mode 100644
index d7630e76b5..0000000000
--- a/c/src/lib/libcpu/i386/displayCpu.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/* displayCpu.c
- *
- * This file contains code for displaying the Intel Cpu identification
- * that has been performed by checkCPUtypeSetCr0 function.
- *
- * COPYRIGHT (c) 1998 valette@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.
- *
- * $Id$
- */
-
-/*
- * Tell us the machine setup..
- */
-#include <stdio.h>
-#include <libcpu/cpu.h>
-#include <string.h>
-#include <libcpu/cpuModel.h>
-#include <bspIo.h>
-
-unsigned char Cx86_step = 0;
-static const char *Cx86_type[] = {
- "unknown", "1.3", "1.4", "1.5", "1.6", "2.4", "2.5", "2.6", "2.7 or 3.7", "4.2"
- };
-
-static const char * i486model(unsigned int nr)
-{
- static const char *model[] = {
- "0","DX","SX","DX/2","4","SX/2","6","DX/2-WB","DX/4","DX/4-WB",
- "10","11","12","13","Am5x86-WT","Am5x86-WB"
- };
- if (nr < sizeof(model)/sizeof(char *))
- return model[nr];
- return NULL;
-}
-
-static const char * i586model(unsigned int nr)
-{
- static const char *model[] = {
- "0", "Pentium 60/66","Pentium 75+","OverDrive PODP5V83",
- "Pentium MMX", NULL, NULL, "Mobile Pentium 75+",
- "Mobile Pentium MMX"
- };
- if (nr < sizeof(model)/sizeof(char *))
- return model[nr];
- return NULL;
-}
-
-static const char * Cx86model(void)
-{
- unsigned char nr6x86 = 0;
- static const char *model[] = {
- "unknown", "6x86", "6x86L", "6x86MX", "MII"
- };
- switch (x86) {
- case 5:
- nr6x86 = ((x86_capability & (1 << 8)) ? 2 : 1); /* cx8 flag only on 6x86L */
- break;
- case 6:
- nr6x86 = 3;
- break;
- default:
- nr6x86 = 0;
- }
-
- /* We must get the stepping number by reading DIR1 */
- i386_outport_byte(0x22,0xff) ; i386_inport_byte(0x23, x86_mask);
- switch (x86_mask) {
- case 0x03:
- Cx86_step = 1; /* 6x86MX Rev 1.3 */
- break;
- case 0x04:
- Cx86_step = 2; /* 6x86MX Rev 1.4 */
- break;
- case 0x05:
- Cx86_step = 3; /* 6x86MX Rev 1.5 */
- break;
- case 0x06:
- Cx86_step = 4; /* 6x86MX Rev 1.6 */
- break;
- case 0x14:
- Cx86_step = 5; /* 6x86 Rev 2.4 */
- break;
- case 0x15:
- Cx86_step = 6; /* 6x86 Rev 2.5 */
- break;
- case 0x16:
- Cx86_step = 7; /* 6x86 Rev 2.6 */
- break;
- case 0x17:
- Cx86_step = 8; /* 6x86 Rev 2.7 or 3.7 */
- break;
- case 0x22:
- Cx86_step = 9; /* 6x86L Rev 4.2 */
- break;
- default:
- Cx86_step = 0;
- }
- return model[nr6x86];
-}
-
-static const char * i686model(unsigned int nr)
-{
- static const char *model[] = {
- "PPro A-step", "Pentium Pro"
- };
- if (nr < sizeof(model)/sizeof(char *))
- return model[nr];
- return NULL;
-}
-
-struct cpu_model_info {
- int x86;
- char *model_names[16];
-};
-
-static struct cpu_model_info amd_models[] = {
- { 4,
- { NULL, NULL, NULL, "DX/2", NULL, NULL, NULL, "DX/2-WB", "DX/4",
- "DX/4-WB", NULL, NULL, NULL, NULL, "Am5x86-WT", "Am5x86-WB" }},
- { 5,
- { "K5/SSA5 (PR-75, PR-90, PR-100)", "K5 (PR-120, PR-133)",
- "K5 (PR-166)", "K5 (PR-200)", NULL, NULL,
- "K6 (166 - 266)", "K6 (166 - 300)", "K6-2 (200 - 450)",
- "K6-3D-Plus (200 - 450)", NULL, NULL, NULL, NULL, NULL, NULL }},
-};
-
-static const char * AMDmodel(void)
-{
- const char *p=NULL;
- int i;
-
- if (x86_model < 16)
- for (i=0; i<sizeof(amd_models)/sizeof(struct cpu_model_info); i++)
- if (amd_models[i].x86 == x86) {
- p = amd_models[i].model_names[(int)x86_model];
- break;
- }
- return p;
-}
-
-static const char * getmodel(int x86, int model)
-{
- const char *p = NULL;
- static char nbuf[12];
- if (strncmp(x86_vendor_id, "Cyrix", 5) == 0)
- p = Cx86model();
- else if(strcmp(x86_vendor_id, "AuthenticAMD")==0)
- p = AMDmodel();
- else {
- switch (x86) {
- case 4:
- p = i486model(model);
- break;
- case 5:
- p = i586model(model);
- break;
- case 6:
- p = i686model(model);
- break;
- }
- }
- if (p)
- return p;
-
- sprintf(nbuf, "%d", model);
- return nbuf;
-}
-
-void printCpuInfo()
-{
- int i;
- static const char *x86_cap_flags[] = {
- "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
- "cx8", "apic", "10", "11", "mtrr", "pge", "mca", "cmov",
- "16", "17", "18", "19", "20", "21", "22", "mmx",
- "24", "25", "26", "27", "28", "29", "30", "31"
- };
-
- printk("cpu\t\t\t: %c86\n", x86+'0');
- printk("model\t\t: %s\n",
- have_cpuid ? getmodel(x86, x86_model) : "unknown");
- if (x86_vendor_id [0] == '\0')
- strcpy(x86_vendor_id, "unknown");
- printk("vendor_id\t: %s\n", x86_vendor_id);
-
- if (x86_mask)
- if (strncmp(x86_vendor_id, "Cyrix", 5) != 0) {
- printk("stepping\t: %d\n", x86_mask);
- }
- else { /* we have a Cyrix */
- printk("stepping\t: %s\n", Cx86_type[Cx86_step]);
- }
- else
- printk("stepping\t: unknown\n");
-
- printk("fpu\t\t\t: %s\n", (hard_math ? "yes" : "no"));
- printk("cpuid\t\t: %s\n", (have_cpuid ? "yes" : "no"));
- printk("flags\t\t:");
- for ( i = 0 ; i < 32 ; i++ ) {
- if ( x86_capability & (1 << i) ) {
- printk(" %s", x86_cap_flags[i]);
- }
- }
- printk("\n");
-}
diff --git a/c/src/lib/libcpu/i386/idt.c b/c/src/lib/libcpu/i386/idt.c
deleted file mode 100644
index 5f44bd0d2b..0000000000
--- a/c/src/lib/libcpu/i386/idt.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * cpu.c - This file contains implementation of C function to
- * Instanciate IDT entries. More detailled information can be found
- * on Intel site and more precisely in the following book :
- *
- * Pentium Processor familly
- * Developper's Manual
- *
- * Volume 3 : Architecture and Programming Manual
- *
- * Copyright (C) 1998 Eric Valette (valette@crf.canon.fr)
- * Canon Centre Recherche France.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <libcpu/cpu.h>
-#include <irq.h>
-
-static rtems_raw_irq_connect_data* raw_irq_table;
-static rtems_raw_irq_connect_data default_raw_irq_entry;
-static interrupt_gate_descriptor default_idt_entry;
-static rtems_raw_irq_global_settings* local_settings;
-
-void create_interrupt_gate_descriptor (interrupt_gate_descriptor* idtEntry,
- rtems_raw_irq_hdl hdl)
-{
- idtEntry->low_offsets_bits = (((unsigned) hdl) & 0xffff);
- idtEntry->segment_selector = i386_get_cs();
- idtEntry->fixed_value_bits = 0;
- idtEntry->gate_type = 0xe;
- idtEntry->privilege = 0;
- idtEntry->present = 1;
- idtEntry->high_offsets_bits = ((((unsigned) hdl) >> 16) & 0xffff);
-}
-
-rtems_raw_irq_hdl get_hdl_from_vector(rtems_vector_offset index)
-{
- rtems_raw_irq_hdl hdl;
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if(index >= limit) {
- return 0;
- }
-
- * ((unsigned int*) &hdl) = (idt_entry_tbl[index].low_offsets_bits |
- (idt_entry_tbl[index].high_offsets_bits << 16));
- return hdl;
-}
-
-int i386_set_idt_entry (const rtems_raw_irq_connect_data* irq)
-{
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
- unsigned int level;
-
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (irq->idtIndex >= limit) {
- return 0;
- }
- /*
- * Check if default handler is actually connected. If not issue an error.
- * You must first get the current handler via i386_get_current_idt_entry
- * and then disconnect it using i386_delete_idt_entry.
- * RATIONALE : to always have the same transition by forcing the user
- * to get the previous handler before accepting to disconnect.
- */
- if (get_hdl_from_vector(irq->idtIndex) != default_raw_irq_entry.hdl) {
- return 0;
- }
-
- _CPU_ISR_Disable(level);
-
- raw_irq_table [irq->idtIndex] = *irq;
- create_interrupt_gate_descriptor (&idt_entry_tbl[irq->idtIndex], irq->hdl);
- irq->on(irq);
-
- _CPU_ISR_Enable(level);
- return 1;
-}
-
-void _CPU_ISR_install_vector (unsigned vector,
- void* hdl,
- void** oldHdl)
-{
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
- interrupt_gate_descriptor new;
- unsigned int level;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (vector >= limit) {
- return;
- }
- _CPU_ISR_Disable(level)
- * ((unsigned int *) oldHdl) = idt_entry_tbl[vector].low_offsets_bits |
- (idt_entry_tbl[vector].high_offsets_bits << 16);
-
- create_interrupt_gate_descriptor(&new, hdl);
- idt_entry_tbl[vector] = new;
-
- _CPU_ISR_Enable(level);
-}
-
-int i386_get_current_idt_entry (rtems_raw_irq_connect_data* irq)
-{
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (irq->idtIndex >= limit) {
- return 0;
- }
- raw_irq_table [irq->idtIndex].hdl = get_hdl_from_vector(irq->idtIndex);
-
- *irq = raw_irq_table [irq->idtIndex];
-
- return 1;
-}
-
-int i386_delete_idt_entry (const rtems_raw_irq_connect_data* irq)
-{
- interrupt_gate_descriptor* idt_entry_tbl;
- unsigned limit;
- unsigned int level;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (irq->idtIndex >= limit) {
- return 0;
- }
- /*
- * Check if handler passed is actually connected. If not issue an error.
- * You must first get the current handler via i386_get_current_idt_entry
- * and then disconnect it using i386_delete_idt_entry.
- * RATIONALE : to always have the same transition by forcing the user
- * to get the previous handler before accepting to disconnect.
- */
- if (get_hdl_from_vector(irq->idtIndex) != irq->hdl){
- return 0;
- }
- _CPU_ISR_Disable(level);
-
- idt_entry_tbl[irq->idtIndex] = default_idt_entry;
-
- irq->off(irq);
-
- raw_irq_table[irq->idtIndex] = default_raw_irq_entry;
- raw_irq_table[irq->idtIndex].idtIndex = irq->idtIndex;
-
- _CPU_ISR_Enable(level);
-
- return 1;
-}
-
-/*
- * Caution this function assumes the IDTR has been already set.
- */
-int i386_init_idt (rtems_raw_irq_global_settings* config)
-{
- unsigned limit;
- unsigned i;
- unsigned level;
- interrupt_gate_descriptor* idt_entry_tbl;
-
- i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
- /* Convert limit into number of entries */
- limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
-
- if (config->idtSize != limit) {
- return 0;
- }
- /*
- * store various accelarators
- */
- raw_irq_table = config->rawIrqHdlTbl;
- local_settings = config;
- default_raw_irq_entry = config->defaultRawEntry;
-
- _CPU_ISR_Disable(level);
-
- create_interrupt_gate_descriptor (&default_idt_entry, default_raw_irq_entry.hdl);
-
- for (i=0; i < limit; i++) {
- interrupt_gate_descriptor new;
- create_interrupt_gate_descriptor (&new, raw_irq_table[i].hdl);
- idt_entry_tbl[i] = new;
- if (raw_irq_table[i].hdl != default_raw_irq_entry.hdl) {
- raw_irq_table[i].on(&raw_irq_table[i]);
- }
- else {
- raw_irq_table[i].off(&raw_irq_table[i]);
- }
- }
- _CPU_ISR_Enable(level);
-
- return 1;
-}
-
-int i386_get_idt_config (rtems_raw_irq_global_settings** config)
-{
- *config = local_settings;
- return 1;
-}
-
-/*
- * Caution this function assumes the GDTR has been already set.
- */
-int i386_set_gdt_entry (unsigned short segment_selector, unsigned base,
- unsigned limit)
-{
- unsigned gdt_limit;
- unsigned short tmp_segment = 0;
- unsigned int limit_adjusted;
- segment_descriptors* gdt_entry_tbl;
-
-
- i386_get_info_from_GDTR (&gdt_entry_tbl, &gdt_limit);
-
- if (segment_selector > limit) {
- return 0;
- }
- /*
- * set up limit first
- */
- limit_adjusted = limit;
- if ( limit > 4095 ) {
- gdt_entry_tbl[segment_selector].granularity = 1;
- limit_adjusted /= 4096;
- }
- gdt_entry_tbl[segment_selector].limit_15_0 = limit_adjusted & 0xffff;
- gdt_entry_tbl[segment_selector].limit_19_16 = (limit_adjusted >> 16) & 0xf;
- /*
- * set up base
- */
- gdt_entry_tbl[segment_selector].base_address_15_0 = base & 0xffff;
- gdt_entry_tbl[segment_selector].base_address_23_16 = (base >> 16) & 0xff;
- gdt_entry_tbl[segment_selector].base_address_31_24 = (base >> 24) & 0xff;
- /*
- * set up descriptor type (this may well becomes a parameter if needed)
- */
- gdt_entry_tbl[segment_selector].type = 2; /* Data R/W */
- gdt_entry_tbl[segment_selector].descriptor_type = 1; /* Code or Data */
- gdt_entry_tbl[segment_selector].privilege = 0; /* ring 0 */
- gdt_entry_tbl[segment_selector].present = 1; /* not present */
-
- /*
- * Now, reload all segment registers so the limit takes effect.
- */
-
- asm volatile( "movw %%ds,%0 ; movw %0,%%ds
- movw %%es,%0 ; movw %0,%%es
- movw %%fs,%0 ; movw %0,%%fs
- movw %%gs,%0 ; movw %0,%%gs
- movw %%ss,%0 ; movw %0,%%ss"
- : "=r" (tmp_segment)
- : "0" (tmp_segment)
- );
-
- return 1;
-}
diff --git a/c/src/lib/libcpu/i386/registers.h b/c/src/lib/libcpu/i386/registers.h
deleted file mode 100644
index 142516ca94..0000000000
--- a/c/src/lib/libcpu/i386/registers.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/* registers.h
- *
- * This file contains definition and constants related to Intel Cpu
- *
- * COPYRIGHT (c) 1998 valette@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.
- *
- * $Id$
- */
-
-#ifndef _LIBCPU_i386_REGISTERS_H
-#define _LIBCPU_i386_REGISTERS_H
-
-/*
- * definition related to EFLAGS
- */
-#define EFLAGS_CARRY 0x1
-#define EFLAGS_PARITY 0x4
-
-#define EFLAGS_AUX_CARRY 0x10
-#define EFLAGS_ZERO 0x40
-#define EFLAGS_SIGN 0x80
-
-#define EFLAGS_TRAP 0x100
-#define EFLAGS_INTR_ENABLE 0x200
-#define EFLAGS_DIRECTION 0x400
-#define EFLAGS_OVERFLOW 0x800
-
-#define EFLAGS_IOPL_MASK 0x3000
-#define EFLAGS_NESTED_TASK 0x8000
-
-#define EFLAGS_RESUME 0x10000
-#define EFLAGS_VIRTUAL_MODE 0x20000
-#define EFLAGS_ALIGN_CHECK 0x40000
-#define EFLAGS_VIRTUAL_INTR 0x80000
-
-#define EFLAGS_VIRTUAL_INTR_PEND 0x100000
-#define EFLAGS_ID 0x200000
-
-/*
- * definitions related to CR0
- */
-#define CR0_PROTECTION_ENABLE 0x1
-#define CR0_MONITOR_COPROC 0x2
-#define CR0_COPROC_SOFT_EMUL 0x4
-#define CR0_FLOATING_INSTR_EXCEPTION 0x8
-
-#define CR0_EXTENSION_TYPE 0x10
-#define CR0_NUMERIC_ERROR 0x20
-
-#define CR0_WRITE_PROTECT 0x10000
-#define CR0_ALIGMENT_MASK 0x40000
-
-#define CR0_NO_WRITE_THROUGH 0x20000000
-#define CR0_PAGE_LEVEL_CACHE_DISABLE 0x40000000
-#define CR0_PAGING 0x80000000
-
-#ifndef ASM
-
-/*
- * definition of eflags registers has a bit field structure
- */
-typedef struct {
- /*
- * fist byte : bits 0->7
- */
- unsigned int carry : 1;
- unsigned int : 1;
- unsigned int parity : 1;
- unsigned int : 1;
-
- unsigned int auxiliary_carry : 1;
- unsigned int : 1;
- unsigned int zero : 1; /* result is zero */
- unsigned int sign : 1; /* result is less than zero */
- /*
- * Second byte : bits 7->15
- */
- unsigned int trap : 1;
- unsigned int intr_enable : 1; /* set => intr on */
- unsigned int direction : 1; /* set => autodecrement */
- unsigned int overflow : 1;
-
- unsigned int IO_privilege : 2;
- unsigned int nested_task : 1;
- unsigned int : 1;
- /*
- * Third byte : bits 15->23
- */
- unsigned int resume : 1;
- unsigned int virtual_mode : 1;
- unsigned int aligment_check : 1;
- unsigned int virtual_intr : 1;
-
- unsigned int virtual_intr_pending : 1;
- unsigned int id : 1;
- unsigned int : 2;
-
- /*
- * fourth byte : bits 24->31 : UNUSED
- */
- unsigned int : 8;
-}eflags_bits;
-
-typedef union {
- eflags_bits eflags;
- unsigned int i;
-}eflags;
-/*
- * definition of eflags registers has a bit field structure
- */
-typedef struct {
- /*
- * fist byte : bits 0->7
- */
- unsigned int protection_enable : 1;
- unsigned int monitor_coproc : 1;
- unsigned int coproc_soft_emul : 1;
- unsigned int floating_instr_except : 1;
-
- unsigned int extension_type : 1;
- unsigned int numeric_error : 1;
- unsigned int : 2;
- /*
- * second byte 8->15 : UNUSED
- */
- unsigned int : 8;
- /*
- * third byte 16->23
- */
- unsigned int write_protect : 1;
- unsigned int : 1;
- unsigned int aligment_mask : 1;
- unsigned int : 1;
-
- unsigned int : 4;
- /*
- * fourth byte 24->31
- */
- unsigned int : 4;
-
- unsigned int : 1;
- unsigned int no_write_through : 1;
- unsigned int page_level_cache_disable : 1;
- unsigned int paging : 1;
-}cr0_bits;
-
-typedef union {
- cr0_bits cr0;
- unsigned int i;
-}cr0;
-
-#endif
-
-#endif
-
diff --git a/c/src/lib/libcpu/i386/wrapup/Makefile.in b/c/src/lib/libcpu/i386/wrapup/Makefile.in
deleted file mode 100644
index c7406ebe0d..0000000000
--- a/c/src/lib/libcpu/i386/wrapup/Makefile.in
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-BSP_PIECES=startup clock console timer
-GENERIC_PIECES=
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=../$(ARCH)/libcpuspec.a
-LIB=$(ARCH)/libcpu.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- @ list_of_o_files=""; \
- for i in ${OBJS}; \
- do \
- DIRNAME=`dirname ${OBJS}` ; \
- temp=`$(AR) t $$i`; \
- echo $$temp ;\
- echo $$DIRNAME ;\
- for j in $$temp; \
- do \
- list_of_o_files="$$list_of_o_files $$DIRNAME/$$j"; \
- done ;\
- echo $$list_of_o_files ;\
- done ;\
- $(RM) $@ ;\
- $(AR) $(ARFLAGS) $@ $$list_of_o_files ;\
- $(MKLIB) $@
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-# we create here a directory specific to the PC386 BSP to store the BootImage
-# files so they can be easily found
- mkdir -p ${PROJECT_RELEASE}/BootImgs
diff --git a/c/src/lib/libcpu/m68k/Makefile.in b/c/src/lib/libcpu/m68k/Makefile.in
deleted file mode 100644
index be2ceb4dee..0000000000
--- a/c/src/lib/libcpu/m68k/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=$(wildcard $(RTEMS_CPU_MODEL))
diff --git a/c/src/lib/libcpu/m68k/m68040/Makefile.in b/c/src/lib/libcpu/m68k/m68040/Makefile.in
deleted file mode 100644
index c173328542..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=fpsp
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/Makefile.in b/c/src/lib/libcpu/m68k/m68040/fpsp/Makefile.in
deleted file mode 100644
index 961f004886..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/Makefile.in
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/fpsp.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=rtems_fpsp
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES= bindec binstr bugfix decbin do_func gen_except get_op kernel_ex \
- res_func round rtems_skel sacos sasin satan satanh scale scosh setox \
- sgetem sint slog2 slogn smovecr srem_mod ssin ssinh stan stanh sto_res \
- stwotox tbldo util x_bsun x_fline x_operr x_ovfl x_snan x_store x_unfl \
- x_unimp x_unsupp
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by
-# libbsp/hppa/BSP/wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/README b/c/src/lib/libcpu/m68k/m68040/fpsp/README
deleted file mode 100644
index 9952cc270e..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/README
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# $Id$
-#
-
-M68040FPSP -- Motorola 68040 floating point support package
------------------------------------------------------------
-
-Modified for RTEMS by Eric Norum (eric@skatter.usask.ca)
-
-To include these routines in your application call
-
- M68KFPSPInstallExceptionHandlers ();
-
-before performing any floating point operations.
-
-Acknowledgement
----------------
-
-This code can be obtain from the Motorola Engineer's Toolbox WWW page
-at http://www.mot.com/SPS/HPESD/tools/freeware/040fpsp.html. Here is
-the description from that page:
-
- The MC68040 contains a subset of the floating-point hardware that is
- implemented in the MC68881/882 devices and as such provides reduced yet
- high performance on-chip floating-point support. Those applications that
- require full compatibility with earlier members of the M68000 family
- will need to provide emulation support fo r the un-implemented MC68040
- floating-point instructions. The M68040FPSP provides complete emulation
- of the floating-point functionality available in the MC68881/882.
-
- The M68040FPSP is offered in source code form to allow integration into
- existing systems to support either a kernel or library version of
- floating-point support. The M68040FPSP operates in conjunction with the
- on-chip MC68040 features to provide fast and full emulation. The kernel
- version allows full emulation via a trap mechanism to allow full binary
- compatibility and is fully reentrant. The library version is used to
- eliminate the trap overhead in situation where re-compilation is
- possible or desired.
-
-From this page one may download the original source code. Inline with
-the first sentence of the second paragraph, we have integrated it with
-RTEMS.
-
-
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/bindec.s b/c/src/lib/libcpu/m68k/m68040/fpsp/bindec.s
deleted file mode 100644
index 1a2aa5603a..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/bindec.s
+++ /dev/null
@@ -1,922 +0,0 @@
-//
-// $Id$
-//
-// bindec.sa 3.4 1/3/91
-//
-// bindec
-//
-// Description:
-// Converts an input in extended precision format
-// to bcd format.
-//
-// Input:
-// a0 points to the input extended precision value
-// value in memory; d0 contains the k-factor sign-extended
-// to 32-bits. The input may be either normalized,
-// unnormalized, or denormalized.
-//
-// Output: result in the FP_SCR1 space on the stack.
-//
-// Saves and Modifies: D2-D7,A2,FP2
-//
-// Algorithm:
-//
-// A1. Set RM and size ext; Set SIGMA = sign of input.
-// The k-factor is saved for use in d7. Clear the
-// BINDEC_FLG for separating normalized/denormalized
-// input. If input is unnormalized or denormalized,
-// normalize it.
-//
-// A2. Set X = abs(input).
-//
-// A3. Compute ILOG.
-// ILOG is the log base 10 of the input value. It is
-// approximated by adding e + 0.f when the original
-// value is viewed as 2^^e * 1.f in extended precision.
-// This value is stored in d6.
-//
-// A4. Clr INEX bit.
-// The operation in A3 above may have set INEX2.
-//
-// A5. Set ICTR = 0;
-// ICTR is a flag used in A13. It must be set before the
-// loop entry A6.
-//
-// A6. Calculate LEN.
-// LEN is the number of digits to be displayed. The
-// k-factor can dictate either the total number of digits,
-// if it is a positive number, or the number of digits
-// after the decimal point which are to be included as
-// significant. See the 68882 manual for examples.
-// If LEN is computed to be greater than 17, set OPERR in
-// USER_FPSR. LEN is stored in d4.
-//
-// A7. Calculate SCALE.
-// SCALE is equal to 10^ISCALE, where ISCALE is the number
-// of decimal places needed to insure LEN integer digits
-// in the output before conversion to bcd. LAMBDA is the
-// sign of ISCALE, used in A9. Fp1 contains
-// 10^^(abs(ISCALE)) using a rounding mode which is a
-// function of the original rounding mode and the signs
-// of ISCALE and X. A table is given in the code.
-//
-// A8. Clr INEX; Force RZ.
-// The operation in A3 above may have set INEX2.
-// RZ mode is forced for the scaling operation to insure
-// only one rounding error. The grs bits are collected in
-// the INEX flag for use in A10.
-//
-// A9. Scale X -> Y.
-// The mantissa is scaled to the desired number of
-// significant digits. The excess digits are collected
-// in INEX2.
-//
-// A10. Or in INEX.
-// If INEX is set, round error occurred. This is
-// compensated for by 'or-ing' in the INEX2 flag to
-// the lsb of Y.
-//
-// A11. Restore original FPCR; set size ext.
-// Perform FINT operation in the user's rounding mode.
-// Keep the size to extended.
-//
-// A12. Calculate YINT = FINT(Y) according to user's rounding
-// mode. The FPSP routine sintd0 is used. The output
-// is in fp0.
-//
-// A13. Check for LEN digits.
-// If the int operation results in more than LEN digits,
-// or less than LEN -1 digits, adjust ILOG and repeat from
-// A6. This test occurs only on the first pass. If the
-// result is exactly 10^LEN, decrement ILOG and divide
-// the mantissa by 10.
-//
-// A14. Convert the mantissa to bcd.
-// The binstr routine is used to convert the LEN digit
-// mantissa to bcd in memory. The input to binstr is
-// to be a fraction; i.e. (mantissa)/10^LEN and adjusted
-// such that the decimal point is to the left of bit 63.
-// The bcd digits are stored in the correct position in
-// the final string area in memory.
-//
-// A15. Convert the exponent to bcd.
-// As in A14 above, the exp is converted to bcd and the
-// digits are stored in the final string.
-// Test the length of the final exponent string. If the
-// length is 4, set operr.
-//
-// A16. Write sign bits to final string.
-//
-// Implementation Notes:
-//
-// The registers are used as follows:
-//
-// d0: scratch; LEN input to binstr
-// d1: scratch
-// d2: upper 32-bits of mantissa for binstr
-// d3: scratch;lower 32-bits of mantissa for binstr
-// d4: LEN
-// d5: LAMBDA/ICTR
-// d6: ILOG
-// d7: k-factor
-// a0: ptr for original operand/final result
-// a1: scratch pointer
-// a2: pointer to FP_X; abs(original value) in ext
-// fp0: scratch
-// fp1: scratch
-// fp2: scratch
-// F_SCR1:
-// F_SCR2:
-// L_SCR1:
-// L_SCR2:
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//BINDEC idnt 2,1 | Motorola 040 Floating Point Software Package
-
-#include "fpsp.defs"
-
- |section 8
-
-// Constants in extended precision
-LOG2: .long 0x3FFD0000,0x9A209A84,0xFBCFF798,0x00000000
-LOG2UP1: .long 0x3FFD0000,0x9A209A84,0xFBCFF799,0x00000000
-
-// Constants in single precision
-FONE: .long 0x3F800000,0x00000000,0x00000000,0x00000000
-FTWO: .long 0x40000000,0x00000000,0x00000000,0x00000000
-FTEN: .long 0x41200000,0x00000000,0x00000000,0x00000000
-F4933: .long 0x459A2800,0x00000000,0x00000000,0x00000000
-
-RBDTBL: .byte 0,0,0,0
- .byte 3,3,2,2
- .byte 3,2,2,3
- .byte 2,3,3,2
-
- |xref binstr
- |xref sintdo
- |xref ptenrn,ptenrm,ptenrp
-
- .global bindec
- .global sc_mul
-bindec:
- moveml %d2-%d7/%a2,-(%a7)
- fmovemx %fp0-%fp2,-(%a7)
-
-// A1. Set RM and size ext. Set SIGMA = sign input;
-// The k-factor is saved for use in d7. Clear BINDEC_FLG for
-// separating normalized/denormalized input. If the input
-// is a denormalized number, set the BINDEC_FLG memory word
-// to signal denorm. If the input is unnormalized, normalize
-// the input and test for denormalized result.
-//
- fmovel #rm_mode,%FPCR //set RM and ext
- movel (%a0),L_SCR2(%a6) //save exponent for sign check
- movel %d0,%d7 //move k-factor to d7
- clrb BINDEC_FLG(%a6) //clr norm/denorm flag
- movew STAG(%a6),%d0 //get stag
- andiw #0xe000,%d0 //isolate stag bits
- beq A2_str //if zero, input is norm
-//
-// Normalize the denorm
-//
-un_de_norm:
- movew (%a0),%d0
- andiw #0x7fff,%d0 //strip sign of normalized exp
- movel 4(%a0),%d1
- movel 8(%a0),%d2
-norm_loop:
- subw #1,%d0
- lsll #1,%d2
- roxll #1,%d1
- tstl %d1
- bges norm_loop
-//
-// Test if the normalized input is denormalized
-//
- tstw %d0
- bgts pos_exp //if greater than zero, it is a norm
- st BINDEC_FLG(%a6) //set flag for denorm
-pos_exp:
- andiw #0x7fff,%d0 //strip sign of normalized exp
- movew %d0,(%a0)
- movel %d1,4(%a0)
- movel %d2,8(%a0)
-
-// A2. Set X = abs(input).
-//
-A2_str:
- movel (%a0),FP_SCR2(%a6) // move input to work space
- movel 4(%a0),FP_SCR2+4(%a6) // move input to work space
- movel 8(%a0),FP_SCR2+8(%a6) // move input to work space
- andil #0x7fffffff,FP_SCR2(%a6) //create abs(X)
-
-// A3. Compute ILOG.
-// ILOG is the log base 10 of the input value. It is approx-
-// imated by adding e + 0.f when the original value is viewed
-// as 2^^e * 1.f in extended precision. This value is stored
-// in d6.
-//
-// Register usage:
-// Input/Output
-// d0: k-factor/exponent
-// d2: x/x
-// d3: x/x
-// d4: x/x
-// d5: x/x
-// d6: x/ILOG
-// d7: k-factor/Unchanged
-// a0: ptr for original operand/final result
-// a1: x/x
-// a2: x/x
-// fp0: x/float(ILOG)
-// fp1: x/x
-// fp2: x/x
-// F_SCR1:x/x
-// F_SCR2:Abs(X)/Abs(X) with $3fff exponent
-// L_SCR1:x/x
-// L_SCR2:first word of X packed/Unchanged
-
- tstb BINDEC_FLG(%a6) //check for denorm
- beqs A3_cont //if clr, continue with norm
- movel #-4933,%d6 //force ILOG = -4933
- bras A4_str
-A3_cont:
- movew FP_SCR2(%a6),%d0 //move exp to d0
- movew #0x3fff,FP_SCR2(%a6) //replace exponent with 0x3fff
- fmovex FP_SCR2(%a6),%fp0 //now fp0 has 1.f
- subw #0x3fff,%d0 //strip off bias
- faddw %d0,%fp0 //add in exp
- fsubs FONE,%fp0 //subtract off 1.0
- fbge pos_res //if pos, branch
- fmulx LOG2UP1,%fp0 //if neg, mul by LOG2UP1
- fmovel %fp0,%d6 //put ILOG in d6 as a lword
- bras A4_str //go move out ILOG
-pos_res:
- fmulx LOG2,%fp0 //if pos, mul by LOG2
- fmovel %fp0,%d6 //put ILOG in d6 as a lword
-
-
-// A4. Clr INEX bit.
-// The operation in A3 above may have set INEX2.
-
-A4_str:
- fmovel #0,%FPSR //zero all of fpsr - nothing needed
-
-
-// A5. Set ICTR = 0;
-// ICTR is a flag used in A13. It must be set before the
-// loop entry A6. The lower word of d5 is used for ICTR.
-
- clrw %d5 //clear ICTR
-
-
-// A6. Calculate LEN.
-// LEN is the number of digits to be displayed. The k-factor
-// can dictate either the total number of digits, if it is
-// a positive number, or the number of digits after the
-// original decimal point which are to be included as
-// significant. See the 68882 manual for examples.
-// If LEN is computed to be greater than 17, set OPERR in
-// USER_FPSR. LEN is stored in d4.
-//
-// Register usage:
-// Input/Output
-// d0: exponent/Unchanged
-// d2: x/x/scratch
-// d3: x/x
-// d4: exc picture/LEN
-// d5: ICTR/Unchanged
-// d6: ILOG/Unchanged
-// d7: k-factor/Unchanged
-// a0: ptr for original operand/final result
-// a1: x/x
-// a2: x/x
-// fp0: float(ILOG)/Unchanged
-// fp1: x/x
-// fp2: x/x
-// F_SCR1:x/x
-// F_SCR2:Abs(X) with $3fff exponent/Unchanged
-// L_SCR1:x/x
-// L_SCR2:first word of X packed/Unchanged
-
-A6_str:
- tstl %d7 //branch on sign of k
- bles k_neg //if k <= 0, LEN = ILOG + 1 - k
- movel %d7,%d4 //if k > 0, LEN = k
- bras len_ck //skip to LEN check
-k_neg:
- movel %d6,%d4 //first load ILOG to d4
- subl %d7,%d4 //subtract off k
- addql #1,%d4 //add in the 1
-len_ck:
- tstl %d4 //LEN check: branch on sign of LEN
- bles LEN_ng //if neg, set LEN = 1
- cmpl #17,%d4 //test if LEN > 17
- bles A7_str //if not, forget it
- movel #17,%d4 //set max LEN = 17
- tstl %d7 //if negative, never set OPERR
- bles A7_str //if positive, continue
- orl #opaop_mask,USER_FPSR(%a6) //set OPERR & AIOP in USER_FPSR
- bras A7_str //finished here
-LEN_ng:
- moveql #1,%d4 //min LEN is 1
-
-
-// A7. Calculate SCALE.
-// SCALE is equal to 10^ISCALE, where ISCALE is the number
-// of decimal places needed to insure LEN integer digits
-// in the output before conversion to bcd. LAMBDA is the sign
-// of ISCALE, used in A9. Fp1 contains 10^^(abs(ISCALE)) using
-// the rounding mode as given in the following table (see
-// Coonen, p. 7.23 as ref.; however, the SCALE variable is
-// of opposite sign in bindec.sa from Coonen).
-//
-// Initial USE
-// FPCR[6:5] LAMBDA SIGN(X) FPCR[6:5]
-// ----------------------------------------------
-// RN 00 0 0 00/0 RN
-// RN 00 0 1 00/0 RN
-// RN 00 1 0 00/0 RN
-// RN 00 1 1 00/0 RN
-// RZ 01 0 0 11/3 RP
-// RZ 01 0 1 11/3 RP
-// RZ 01 1 0 10/2 RM
-// RZ 01 1 1 10/2 RM
-// RM 10 0 0 11/3 RP
-// RM 10 0 1 10/2 RM
-// RM 10 1 0 10/2 RM
-// RM 10 1 1 11/3 RP
-// RP 11 0 0 10/2 RM
-// RP 11 0 1 11/3 RP
-// RP 11 1 0 11/3 RP
-// RP 11 1 1 10/2 RM
-//
-// Register usage:
-// Input/Output
-// d0: exponent/scratch - final is 0
-// d2: x/0 or 24 for A9
-// d3: x/scratch - offset ptr into PTENRM array
-// d4: LEN/Unchanged
-// d5: 0/ICTR:LAMBDA
-// d6: ILOG/ILOG or k if ((k<=0)&(ILOG<k))
-// d7: k-factor/Unchanged
-// a0: ptr for original operand/final result
-// a1: x/ptr to PTENRM array
-// a2: x/x
-// fp0: float(ILOG)/Unchanged
-// fp1: x/10^ISCALE
-// fp2: x/x
-// F_SCR1:x/x
-// F_SCR2:Abs(X) with $3fff exponent/Unchanged
-// L_SCR1:x/x
-// L_SCR2:first word of X packed/Unchanged
-
-A7_str:
- tstl %d7 //test sign of k
- bgts k_pos //if pos and > 0, skip this
- cmpl %d6,%d7 //test k - ILOG
- blts k_pos //if ILOG >= k, skip this
- movel %d7,%d6 //if ((k<0) & (ILOG < k)) ILOG = k
-k_pos:
- movel %d6,%d0 //calc ILOG + 1 - LEN in d0
- addql #1,%d0 //add the 1
- subl %d4,%d0 //sub off LEN
- swap %d5 //use upper word of d5 for LAMBDA
- clrw %d5 //set it zero initially
- clrw %d2 //set up d2 for very small case
- tstl %d0 //test sign of ISCALE
- bges iscale //if pos, skip next inst
- addqw #1,%d5 //if neg, set LAMBDA true
- cmpl #0xffffecd4,%d0 //test iscale <= -4908
- bgts no_inf //if false, skip rest
- addil #24,%d0 //add in 24 to iscale
- movel #24,%d2 //put 24 in d2 for A9
-no_inf:
- negl %d0 //and take abs of ISCALE
-iscale:
- fmoves FONE,%fp1 //init fp1 to 1
- bfextu USER_FPCR(%a6){#26:#2},%d1 //get initial rmode bits
- lslw #1,%d1 //put them in bits 2:1
- addw %d5,%d1 //add in LAMBDA
- lslw #1,%d1 //put them in bits 3:1
- tstl L_SCR2(%a6) //test sign of original x
- bges x_pos //if pos, don't set bit 0
- addql #1,%d1 //if neg, set bit 0
-x_pos:
- leal RBDTBL,%a2 //load rbdtbl base
- moveb (%a2,%d1),%d3 //load d3 with new rmode
- lsll #4,%d3 //put bits in proper position
- fmovel %d3,%fpcr //load bits into fpu
- lsrl #4,%d3 //put bits in proper position
- tstb %d3 //decode new rmode for pten table
- bnes not_rn //if zero, it is RN
- leal PTENRN,%a1 //load a1 with RN table base
- bras rmode //exit decode
-not_rn:
- lsrb #1,%d3 //get lsb in carry
- bccs not_rp //if carry clear, it is RM
- leal PTENRP,%a1 //load a1 with RP table base
- bras rmode //exit decode
-not_rp:
- leal PTENRM,%a1 //load a1 with RM table base
-rmode:
- clrl %d3 //clr table index
-e_loop:
- lsrl #1,%d0 //shift next bit into carry
- bccs e_next //if zero, skip the mul
- fmulx (%a1,%d3),%fp1 //mul by 10**(d3_bit_no)
-e_next:
- addl #12,%d3 //inc d3 to next pwrten table entry
- tstl %d0 //test if ISCALE is zero
- bnes e_loop //if not, loop
-
-
-// A8. Clr INEX; Force RZ.
-// The operation in A3 above may have set INEX2.
-// RZ mode is forced for the scaling operation to insure
-// only one rounding error. The grs bits are collected in
-// the INEX flag for use in A10.
-//
-// Register usage:
-// Input/Output
-
- fmovel #0,%FPSR //clr INEX
- fmovel #rz_mode,%FPCR //set RZ rounding mode
-
-
-// A9. Scale X -> Y.
-// The mantissa is scaled to the desired number of significant
-// digits. The excess digits are collected in INEX2. If mul,
-// Check d2 for excess 10 exponential value. If not zero,
-// the iscale value would have caused the pwrten calculation
-// to overflow. Only a negative iscale can cause this, so
-// multiply by 10^(d2), which is now only allowed to be 24,
-// with a multiply by 10^8 and 10^16, which is exact since
-// 10^24 is exact. If the input was denormalized, we must
-// create a busy stack frame with the mul command and the
-// two operands, and allow the fpu to complete the multiply.
-//
-// Register usage:
-// Input/Output
-// d0: FPCR with RZ mode/Unchanged
-// d2: 0 or 24/unchanged
-// d3: x/x
-// d4: LEN/Unchanged
-// d5: ICTR:LAMBDA
-// d6: ILOG/Unchanged
-// d7: k-factor/Unchanged
-// a0: ptr for original operand/final result
-// a1: ptr to PTENRM array/Unchanged
-// a2: x/x
-// fp0: float(ILOG)/X adjusted for SCALE (Y)
-// fp1: 10^ISCALE/Unchanged
-// fp2: x/x
-// F_SCR1:x/x
-// F_SCR2:Abs(X) with $3fff exponent/Unchanged
-// L_SCR1:x/x
-// L_SCR2:first word of X packed/Unchanged
-
-A9_str:
- fmovex (%a0),%fp0 //load X from memory
- fabsx %fp0 //use abs(X)
- tstw %d5 //LAMBDA is in lower word of d5
- bnes sc_mul //if neg (LAMBDA = 1), scale by mul
- fdivx %fp1,%fp0 //calculate X / SCALE -> Y to fp0
- bras A10_st //branch to A10
-
-sc_mul:
- tstb BINDEC_FLG(%a6) //check for denorm
- beqs A9_norm //if norm, continue with mul
- fmovemx %fp1-%fp1,-(%a7) //load ETEMP with 10^ISCALE
- movel 8(%a0),-(%a7) //load FPTEMP with input arg
- movel 4(%a0),-(%a7)
- movel (%a0),-(%a7)
- movel #18,%d3 //load count for busy stack
-A9_loop:
- clrl -(%a7) //clear lword on stack
- dbf %d3,A9_loop
- moveb VER_TMP(%a6),(%a7) //write current version number
- moveb #BUSY_SIZE-4,1(%a7) //write current busy size
- moveb #0x10,0x44(%a7) //set fcefpte[15] bit
- movew #0x0023,0x40(%a7) //load cmdreg1b with mul command
- moveb #0xfe,0x8(%a7) //load all 1s to cu savepc
- frestore (%a7)+ //restore frame to fpu for completion
- fmulx 36(%a1),%fp0 //multiply fp0 by 10^8
- fmulx 48(%a1),%fp0 //multiply fp0 by 10^16
- bras A10_st
-A9_norm:
- tstw %d2 //test for small exp case
- beqs A9_con //if zero, continue as normal
- fmulx 36(%a1),%fp0 //multiply fp0 by 10^8
- fmulx 48(%a1),%fp0 //multiply fp0 by 10^16
-A9_con:
- fmulx %fp1,%fp0 //calculate X * SCALE -> Y to fp0
-
-
-// A10. Or in INEX.
-// If INEX is set, round error occurred. This is compensated
-// for by 'or-ing' in the INEX2 flag to the lsb of Y.
-//
-// Register usage:
-// Input/Output
-// d0: FPCR with RZ mode/FPSR with INEX2 isolated
-// d2: x/x
-// d3: x/x
-// d4: LEN/Unchanged
-// d5: ICTR:LAMBDA
-// d6: ILOG/Unchanged
-// d7: k-factor/Unchanged
-// a0: ptr for original operand/final result
-// a1: ptr to PTENxx array/Unchanged
-// a2: x/ptr to FP_SCR2(a6)
-// fp0: Y/Y with lsb adjusted
-// fp1: 10^ISCALE/Unchanged
-// fp2: x/x
-
-A10_st:
- fmovel %FPSR,%d0 //get FPSR
- fmovex %fp0,FP_SCR2(%a6) //move Y to memory
- leal FP_SCR2(%a6),%a2 //load a2 with ptr to FP_SCR2
- btstl #9,%d0 //check if INEX2 set
- beqs A11_st //if clear, skip rest
- oril #1,8(%a2) //or in 1 to lsb of mantissa
- fmovex FP_SCR2(%a6),%fp0 //write adjusted Y back to fpu
-
-
-// A11. Restore original FPCR; set size ext.
-// Perform FINT operation in the user's rounding mode. Keep
-// the size to extended. The sintdo entry point in the sint
-// routine expects the FPCR value to be in USER_FPCR for
-// mode and precision. The original FPCR is saved in L_SCR1.
-
-A11_st:
- movel USER_FPCR(%a6),L_SCR1(%a6) //save it for later
- andil #0x00000030,USER_FPCR(%a6) //set size to ext,
-// ;block exceptions
-
-
-// A12. Calculate YINT = FINT(Y) according to user's rounding mode.
-// The FPSP routine sintd0 is used. The output is in fp0.
-//
-// Register usage:
-// Input/Output
-// d0: FPSR with AINEX cleared/FPCR with size set to ext
-// d2: x/x/scratch
-// d3: x/x
-// d4: LEN/Unchanged
-// d5: ICTR:LAMBDA/Unchanged
-// d6: ILOG/Unchanged
-// d7: k-factor/Unchanged
-// a0: ptr for original operand/src ptr for sintdo
-// a1: ptr to PTENxx array/Unchanged
-// a2: ptr to FP_SCR2(a6)/Unchanged
-// a6: temp pointer to FP_SCR2(a6) - orig value saved and restored
-// fp0: Y/YINT
-// fp1: 10^ISCALE/Unchanged
-// fp2: x/x
-// F_SCR1:x/x
-// F_SCR2:Y adjusted for inex/Y with original exponent
-// L_SCR1:x/original USER_FPCR
-// L_SCR2:first word of X packed/Unchanged
-
-A12_st:
- moveml %d0-%d1/%a0-%a1,-(%a7) //save regs used by sintd0
- movel L_SCR1(%a6),-(%a7)
- movel L_SCR2(%a6),-(%a7)
- leal FP_SCR2(%a6),%a0 //a0 is ptr to F_SCR2(a6)
- fmovex %fp0,(%a0) //move Y to memory at FP_SCR2(a6)
- tstl L_SCR2(%a6) //test sign of original operand
- bges do_fint //if pos, use Y
- orl #0x80000000,(%a0) //if neg, use -Y
-do_fint:
- movel USER_FPSR(%a6),-(%a7)
- bsr sintdo //sint routine returns int in fp0
- moveb (%a7),USER_FPSR(%a6)
- addl #4,%a7
- movel (%a7)+,L_SCR2(%a6)
- movel (%a7)+,L_SCR1(%a6)
- moveml (%a7)+,%d0-%d1/%a0-%a1 //restore regs used by sint
- movel L_SCR2(%a6),FP_SCR2(%a6) //restore original exponent
- movel L_SCR1(%a6),USER_FPCR(%a6) //restore user's FPCR
-
-
-// A13. Check for LEN digits.
-// If the int operation results in more than LEN digits,
-// or less than LEN -1 digits, adjust ILOG and repeat from
-// A6. This test occurs only on the first pass. If the
-// result is exactly 10^LEN, decrement ILOG and divide
-// the mantissa by 10. The calculation of 10^LEN cannot
-// be inexact, since all powers of ten upto 10^27 are exact
-// in extended precision, so the use of a previous power-of-ten
-// table will introduce no error.
-//
-//
-// Register usage:
-// Input/Output
-// d0: FPCR with size set to ext/scratch final = 0
-// d2: x/x
-// d3: x/scratch final = x
-// d4: LEN/LEN adjusted
-// d5: ICTR:LAMBDA/LAMBDA:ICTR
-// d6: ILOG/ILOG adjusted
-// d7: k-factor/Unchanged
-// a0: pointer into memory for packed bcd string formation
-// a1: ptr to PTENxx array/Unchanged
-// a2: ptr to FP_SCR2(a6)/Unchanged
-// fp0: int portion of Y/abs(YINT) adjusted
-// fp1: 10^ISCALE/Unchanged
-// fp2: x/10^LEN
-// F_SCR1:x/x
-// F_SCR2:Y with original exponent/Unchanged
-// L_SCR1:original USER_FPCR/Unchanged
-// L_SCR2:first word of X packed/Unchanged
-
-A13_st:
- swap %d5 //put ICTR in lower word of d5
- tstw %d5 //check if ICTR = 0
- bne not_zr //if non-zero, go to second test
-//
-// Compute 10^(LEN-1)
-//
- fmoves FONE,%fp2 //init fp2 to 1.0
- movel %d4,%d0 //put LEN in d0
- subql #1,%d0 //d0 = LEN -1
- clrl %d3 //clr table index
-l_loop:
- lsrl #1,%d0 //shift next bit into carry
- bccs l_next //if zero, skip the mul
- fmulx (%a1,%d3),%fp2 //mul by 10**(d3_bit_no)
-l_next:
- addl #12,%d3 //inc d3 to next pwrten table entry
- tstl %d0 //test if LEN is zero
- bnes l_loop //if not, loop
-//
-// 10^LEN-1 is computed for this test and A14. If the input was
-// denormalized, check only the case in which YINT > 10^LEN.
-//
- tstb BINDEC_FLG(%a6) //check if input was norm
- beqs A13_con //if norm, continue with checking
- fabsx %fp0 //take abs of YINT
- bra test_2
-//
-// Compare abs(YINT) to 10^(LEN-1) and 10^LEN
-//
-A13_con:
- fabsx %fp0 //take abs of YINT
- fcmpx %fp2,%fp0 //compare abs(YINT) with 10^(LEN-1)
- fbge test_2 //if greater, do next test
- subql #1,%d6 //subtract 1 from ILOG
- movew #1,%d5 //set ICTR
- fmovel #rm_mode,%FPCR //set rmode to RM
- fmuls FTEN,%fp2 //compute 10^LEN
- bra A6_str //return to A6 and recompute YINT
-test_2:
- fmuls FTEN,%fp2 //compute 10^LEN
- fcmpx %fp2,%fp0 //compare abs(YINT) with 10^LEN
- fblt A14_st //if less, all is ok, go to A14
- fbgt fix_ex //if greater, fix and redo
- fdivs FTEN,%fp0 //if equal, divide by 10
- addql #1,%d6 // and inc ILOG
- bras A14_st // and continue elsewhere
-fix_ex:
- addql #1,%d6 //increment ILOG by 1
- movew #1,%d5 //set ICTR
- fmovel #rm_mode,%FPCR //set rmode to RM
- bra A6_str //return to A6 and recompute YINT
-//
-// Since ICTR <> 0, we have already been through one adjustment,
-// and shouldn't have another; this is to check if abs(YINT) = 10^LEN
-// 10^LEN is again computed using whatever table is in a1 since the
-// value calculated cannot be inexact.
-//
-not_zr:
- fmoves FONE,%fp2 //init fp2 to 1.0
- movel %d4,%d0 //put LEN in d0
- clrl %d3 //clr table index
-z_loop:
- lsrl #1,%d0 //shift next bit into carry
- bccs z_next //if zero, skip the mul
- fmulx (%a1,%d3),%fp2 //mul by 10**(d3_bit_no)
-z_next:
- addl #12,%d3 //inc d3 to next pwrten table entry
- tstl %d0 //test if LEN is zero
- bnes z_loop //if not, loop
- fabsx %fp0 //get abs(YINT)
- fcmpx %fp2,%fp0 //check if abs(YINT) = 10^LEN
- fbne A14_st //if not, skip this
- fdivs FTEN,%fp0 //divide abs(YINT) by 10
- addql #1,%d6 //and inc ILOG by 1
- addql #1,%d4 // and inc LEN
- fmuls FTEN,%fp2 // if LEN++, the get 10^^LEN
-
-
-// A14. Convert the mantissa to bcd.
-// The binstr routine is used to convert the LEN digit
-// mantissa to bcd in memory. The input to binstr is
-// to be a fraction; i.e. (mantissa)/10^LEN and adjusted
-// such that the decimal point is to the left of bit 63.
-// The bcd digits are stored in the correct position in
-// the final string area in memory.
-//
-//
-// Register usage:
-// Input/Output
-// d0: x/LEN call to binstr - final is 0
-// d1: x/0
-// d2: x/ms 32-bits of mant of abs(YINT)
-// d3: x/ls 32-bits of mant of abs(YINT)
-// d4: LEN/Unchanged
-// d5: ICTR:LAMBDA/LAMBDA:ICTR
-// d6: ILOG
-// d7: k-factor/Unchanged
-// a0: pointer into memory for packed bcd string formation
-// /ptr to first mantissa byte in result string
-// a1: ptr to PTENxx array/Unchanged
-// a2: ptr to FP_SCR2(a6)/Unchanged
-// fp0: int portion of Y/abs(YINT) adjusted
-// fp1: 10^ISCALE/Unchanged
-// fp2: 10^LEN/Unchanged
-// F_SCR1:x/Work area for final result
-// F_SCR2:Y with original exponent/Unchanged
-// L_SCR1:original USER_FPCR/Unchanged
-// L_SCR2:first word of X packed/Unchanged
-
-A14_st:
- fmovel #rz_mode,%FPCR //force rz for conversion
- fdivx %fp2,%fp0 //divide abs(YINT) by 10^LEN
- leal FP_SCR1(%a6),%a0
- fmovex %fp0,(%a0) //move abs(YINT)/10^LEN to memory
- movel 4(%a0),%d2 //move 2nd word of FP_RES to d2
- movel 8(%a0),%d3 //move 3rd word of FP_RES to d3
- clrl 4(%a0) //zero word 2 of FP_RES
- clrl 8(%a0) //zero word 3 of FP_RES
- movel (%a0),%d0 //move exponent to d0
- swap %d0 //put exponent in lower word
- beqs no_sft //if zero, don't shift
- subil #0x3ffd,%d0 //sub bias less 2 to make fract
- tstl %d0 //check if > 1
- bgts no_sft //if so, don't shift
- negl %d0 //make exp positive
-m_loop:
- lsrl #1,%d2 //shift d2:d3 right, add 0s
- roxrl #1,%d3 //the number of places
- dbf %d0,m_loop //given in d0
-no_sft:
- tstl %d2 //check for mantissa of zero
- bnes no_zr //if not, go on
- tstl %d3 //continue zero check
- beqs zer_m //if zero, go directly to binstr
-no_zr:
- clrl %d1 //put zero in d1 for addx
- addil #0x00000080,%d3 //inc at bit 7
- addxl %d1,%d2 //continue inc
- andil #0xffffff80,%d3 //strip off lsb not used by 882
-zer_m:
- movel %d4,%d0 //put LEN in d0 for binstr call
- addql #3,%a0 //a0 points to M16 byte in result
- bsr binstr //call binstr to convert mant
-
-
-// A15. Convert the exponent to bcd.
-// As in A14 above, the exp is converted to bcd and the
-// digits are stored in the final string.
-//
-// Digits are stored in L_SCR1(a6) on return from BINDEC as:
-//
-// 32 16 15 0
-// -----------------------------------------
-// | 0 | e3 | e2 | e1 | e4 | X | X | X |
-// -----------------------------------------
-//
-// And are moved into their proper places in FP_SCR1. If digit e4
-// is non-zero, OPERR is signaled. In all cases, all 4 digits are
-// written as specified in the 881/882 manual for packed decimal.
-//
-// Register usage:
-// Input/Output
-// d0: x/LEN call to binstr - final is 0
-// d1: x/scratch (0);shift count for final exponent packing
-// d2: x/ms 32-bits of exp fraction/scratch
-// d3: x/ls 32-bits of exp fraction
-// d4: LEN/Unchanged
-// d5: ICTR:LAMBDA/LAMBDA:ICTR
-// d6: ILOG
-// d7: k-factor/Unchanged
-// a0: ptr to result string/ptr to L_SCR1(a6)
-// a1: ptr to PTENxx array/Unchanged
-// a2: ptr to FP_SCR2(a6)/Unchanged
-// fp0: abs(YINT) adjusted/float(ILOG)
-// fp1: 10^ISCALE/Unchanged
-// fp2: 10^LEN/Unchanged
-// F_SCR1:Work area for final result/BCD result
-// F_SCR2:Y with original exponent/ILOG/10^4
-// L_SCR1:original USER_FPCR/Exponent digits on return from binstr
-// L_SCR2:first word of X packed/Unchanged
-
-A15_st:
- tstb BINDEC_FLG(%a6) //check for denorm
- beqs not_denorm
- ftstx %fp0 //test for zero
- fbeq den_zero //if zero, use k-factor or 4933
- fmovel %d6,%fp0 //float ILOG
- fabsx %fp0 //get abs of ILOG
- bras convrt
-den_zero:
- tstl %d7 //check sign of the k-factor
- blts use_ilog //if negative, use ILOG
- fmoves F4933,%fp0 //force exponent to 4933
- bras convrt //do it
-use_ilog:
- fmovel %d6,%fp0 //float ILOG
- fabsx %fp0 //get abs of ILOG
- bras convrt
-not_denorm:
- ftstx %fp0 //test for zero
- fbne not_zero //if zero, force exponent
- fmoves FONE,%fp0 //force exponent to 1
- bras convrt //do it
-not_zero:
- fmovel %d6,%fp0 //float ILOG
- fabsx %fp0 //get abs of ILOG
-convrt:
- fdivx 24(%a1),%fp0 //compute ILOG/10^4
- fmovex %fp0,FP_SCR2(%a6) //store fp0 in memory
- movel 4(%a2),%d2 //move word 2 to d2
- movel 8(%a2),%d3 //move word 3 to d3
- movew (%a2),%d0 //move exp to d0
- beqs x_loop_fin //if zero, skip the shift
- subiw #0x3ffd,%d0 //subtract off bias
- negw %d0 //make exp positive
-x_loop:
- lsrl #1,%d2 //shift d2:d3 right
- roxrl #1,%d3 //the number of places
- dbf %d0,x_loop //given in d0
-x_loop_fin:
- clrl %d1 //put zero in d1 for addx
- addil #0x00000080,%d3 //inc at bit 6
- addxl %d1,%d2 //continue inc
- andil #0xffffff80,%d3 //strip off lsb not used by 882
- movel #4,%d0 //put 4 in d0 for binstr call
- leal L_SCR1(%a6),%a0 //a0 is ptr to L_SCR1 for exp digits
- bsr binstr //call binstr to convert exp
- movel L_SCR1(%a6),%d0 //load L_SCR1 lword to d0
- movel #12,%d1 //use d1 for shift count
- lsrl %d1,%d0 //shift d0 right by 12
- bfins %d0,FP_SCR1(%a6){#4:#12} //put e3:e2:e1 in FP_SCR1
- lsrl %d1,%d0 //shift d0 right by 12
- bfins %d0,FP_SCR1(%a6){#16:#4} //put e4 in FP_SCR1
- tstb %d0 //check if e4 is zero
- beqs A16_st //if zero, skip rest
- orl #opaop_mask,USER_FPSR(%a6) //set OPERR & AIOP in USER_FPSR
-
-
-// A16. Write sign bits to final string.
-// Sigma is bit 31 of initial value; RHO is bit 31 of d6 (ILOG).
-//
-// Register usage:
-// Input/Output
-// d0: x/scratch - final is x
-// d2: x/x
-// d3: x/x
-// d4: LEN/Unchanged
-// d5: ICTR:LAMBDA/LAMBDA:ICTR
-// d6: ILOG/ILOG adjusted
-// d7: k-factor/Unchanged
-// a0: ptr to L_SCR1(a6)/Unchanged
-// a1: ptr to PTENxx array/Unchanged
-// a2: ptr to FP_SCR2(a6)/Unchanged
-// fp0: float(ILOG)/Unchanged
-// fp1: 10^ISCALE/Unchanged
-// fp2: 10^LEN/Unchanged
-// F_SCR1:BCD result with correct signs
-// F_SCR2:ILOG/10^4
-// L_SCR1:Exponent digits on return from binstr
-// L_SCR2:first word of X packed/Unchanged
-
-A16_st:
- clrl %d0 //clr d0 for collection of signs
- andib #0x0f,FP_SCR1(%a6) //clear first nibble of FP_SCR1
- tstl L_SCR2(%a6) //check sign of original mantissa
- bges mant_p //if pos, don't set SM
- moveql #2,%d0 //move 2 in to d0 for SM
-mant_p:
- tstl %d6 //check sign of ILOG
- bges wr_sgn //if pos, don't set SE
- addql #1,%d0 //set bit 0 in d0 for SE
-wr_sgn:
- bfins %d0,FP_SCR1(%a6){#0:#2} //insert SM and SE into FP_SCR1
-
-// Clean up and restore all registers used.
-
- fmovel #0,%FPSR //clear possible inex2/ainex bits
- fmovemx (%a7)+,%fp0-%fp2
- moveml (%a7)+,%d2-%d7/%a2
- rts
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/binstr.s b/c/src/lib/libcpu/m68k/m68040/fpsp/binstr.s
deleted file mode 100644
index 96f2592995..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/binstr.s
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// $Id$
-//
-// binstr.sa 3.3 12/19/90
-//
-// Description: Converts a 64-bit binary integer to bcd.
-//
-// Input: 64-bit binary integer in d2:d3, desired length (LEN) in
-// d0, and a pointer to start in memory for bcd characters
-// in d0. (This pointer must point to byte 4 of the first
-// lword of the packed decimal memory string.)
-//
-// Output: LEN bcd digits representing the 64-bit integer.
-//
-// Algorithm:
-// The 64-bit binary is assumed to have a decimal point before
-// bit 63. The fraction is multiplied by 10 using a mul by 2
-// shift and a mul by 8 shift. The bits shifted out of the
-// msb form a decimal digit. This process is iterated until
-// LEN digits are formed.
-//
-// A1. Init d7 to 1. D7 is the byte digit counter, and if 1, the
-// digit formed will be assumed the least significant. This is
-// to force the first byte formed to have a 0 in the upper 4 bits.
-//
-// A2. Beginning of the loop:
-// Copy the fraction in d2:d3 to d4:d5.
-//
-// A3. Multiply the fraction in d2:d3 by 8 using bit-field
-// extracts and shifts. The three msbs from d2 will go into
-// d1.
-//
-// A4. Multiply the fraction in d4:d5 by 2 using shifts. The msb
-// will be collected by the carry.
-//
-// A5. Add using the carry the 64-bit quantities in d2:d3 and d4:d5
-// into d2:d3. D1 will contain the bcd digit formed.
-//
-// A6. Test d7. If zero, the digit formed is the ms digit. If non-
-// zero, it is the ls digit. Put the digit in its place in the
-// upper word of d0. If it is the ls digit, write the word
-// from d0 to memory.
-//
-// A7. Decrement d6 (LEN counter) and repeat the loop until zero.
-//
-// Implementation Notes:
-//
-// The registers are used as follows:
-//
-// d0: LEN counter
-// d1: temp used to form the digit
-// d2: upper 32-bits of fraction for mul by 8
-// d3: lower 32-bits of fraction for mul by 8
-// d4: upper 32-bits of fraction for mul by 2
-// d5: lower 32-bits of fraction for mul by 2
-// d6: temp for bit-field extracts
-// d7: byte digit formation word;digit count {0,1}
-// a0: pointer into memory for packed bcd string formation
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//BINSTR idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- .global binstr
-binstr:
- moveml %d0-%d7,-(%a7)
-//
-// A1: Init d7
-//
- moveql #1,%d7 //init d7 for second digit
- subql #1,%d0 //for dbf d0 would have LEN+1 passes
-//
-// A2. Copy d2:d3 to d4:d5. Start loop.
-//
-loop:
- movel %d2,%d4 //copy the fraction before muls
- movel %d3,%d5 //to d4:d5
-//
-// A3. Multiply d2:d3 by 8; extract msbs into d1.
-//
- bfextu %d2{#0:#3},%d1 //copy 3 msbs of d2 into d1
- asll #3,%d2 //shift d2 left by 3 places
- bfextu %d3{#0:#3},%d6 //copy 3 msbs of d3 into d6
- asll #3,%d3 //shift d3 left by 3 places
- orl %d6,%d2 //or in msbs from d3 into d2
-//
-// A4. Multiply d4:d5 by 2; add carry out to d1.
-//
- asll #1,%d5 //mul d5 by 2
- roxll #1,%d4 //mul d4 by 2
- swap %d6 //put 0 in d6 lower word
- addxw %d6,%d1 //add in extend from mul by 2
-//
-// A5. Add mul by 8 to mul by 2. D1 contains the digit formed.
-//
- addl %d5,%d3 //add lower 32 bits
- nop //ERRATA ; FIX #13 (Rev. 1.2 6/6/90)
- addxl %d4,%d2 //add with extend upper 32 bits
- nop //ERRATA ; FIX #13 (Rev. 1.2 6/6/90)
- addxw %d6,%d1 //add in extend from add to d1
- swap %d6 //with d6 = 0; put 0 in upper word
-//
-// A6. Test d7 and branch.
-//
- tstw %d7 //if zero, store digit & to loop
- beqs first_d //if non-zero, form byte & write
-sec_d:
- swap %d7 //bring first digit to word d7b
- aslw #4,%d7 //first digit in upper 4 bits d7b
- addw %d1,%d7 //add in ls digit to d7b
- moveb %d7,(%a0)+ //store d7b byte in memory
- swap %d7 //put LEN counter in word d7a
- clrw %d7 //set d7a to signal no digits done
- dbf %d0,loop //do loop some more!
- bras end_bstr //finished, so exit
-first_d:
- swap %d7 //put digit word in d7b
- movew %d1,%d7 //put new digit in d7b
- swap %d7 //put LEN counter in word d7a
- addqw #1,%d7 //set d7a to signal first digit done
- dbf %d0,loop //do loop some more!
- swap %d7 //put last digit in string
- lslw #4,%d7 //move it to upper 4 bits
- moveb %d7,(%a0)+ //store it in memory string
-//
-// Clean up and return with result in fp0.
-//
-end_bstr:
- moveml (%a7)+,%d0-%d7
- rts
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/bugfix.s b/c/src/lib/libcpu/m68k/m68040/fpsp/bugfix.s
deleted file mode 100644
index 6c615934a3..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/bugfix.s
+++ /dev/null
@@ -1,497 +0,0 @@
-//
-// $Id$
-//
-// bugfix.sa 3.2 1/31/91
-//
-// This file contains workarounds for bugs in the 040
-// relating to the Floating-Point Software Package (FPSP)
-//
-// Fixes for bugs: 1238
-//
-// Bug: 1238
-//
-//
-// /* The following dirty_bit clear should be left in
-// * the handler permanently to improve throughput.
-// * The dirty_bits are located at bits [23:16] in
-// * longword $08 in the busy frame $4x60. Bit 16
-// * corresponds to FP0, bit 17 corresponds to FP1,
-// * and so on.
-// */
-// if (E3_exception_just_serviced) {
-// dirty_bit[cmdreg3b[9:7]] = 0;
-// }
-//
-// if (fsave_format_version != $40) {goto NOFIX}
-//
-// if !(E3_exception_just_serviced) {goto NOFIX}
-// if (cupc == 0000000) {goto NOFIX}
-// if ((cmdreg1b[15:13] != 000) &&
-// (cmdreg1b[15:10] != 010001)) {goto NOFIX}
-// if (((cmdreg1b[15:13] != 000) || ((cmdreg1b[12:10] != cmdreg2b[9:7]) &&
-// (cmdreg1b[12:10] != cmdreg3b[9:7])) ) &&
-// ((cmdreg1b[ 9: 7] != cmdreg2b[9:7]) &&
-// (cmdreg1b[ 9: 7] != cmdreg3b[9:7])) ) {goto NOFIX}
-//
-// /* Note: for 6d43b or 8d43b, you may want to add the following code
-// * to get better coverage. (If you do not insert this code, the part
-// * won't lock up; it will simply get the wrong answer.)
-// * Do NOT insert this code for 10d43b or later parts.
-// *
-// * if (fpiarcu == integer stack return address) {
-// * cupc = 0000000;
-// * goto NOFIX;
-// * }
-// */
-//
-// if (cmdreg1b[15:13] != 000) {goto FIX_OPCLASS2}
-// FIX_OPCLASS0:
-// if (((cmdreg1b[12:10] == cmdreg2b[9:7]) ||
-// (cmdreg1b[ 9: 7] == cmdreg2b[9:7])) &&
-// (cmdreg1b[12:10] != cmdreg3b[9:7]) &&
-// (cmdreg1b[ 9: 7] != cmdreg3b[9:7])) { /* xu conflict only */
-// /* We execute the following code if there is an
-// xu conflict and NOT an nu conflict */
-//
-// /* first save some values on the fsave frame */
-// stag_temp = STAG[fsave_frame];
-// cmdreg1b_temp = CMDREG1B[fsave_frame];
-// dtag_temp = DTAG[fsave_frame];
-// ete15_temp = ETE15[fsave_frame];
-//
-// CUPC[fsave_frame] = 0000000;
-// FRESTORE
-// FSAVE
-//
-// /* If the xu instruction is exceptional, we punt.
-// * Otherwise, we would have to include OVFL/UNFL handler
-// * code here to get the correct answer.
-// */
-// if (fsave_frame_format == $4060) {goto KILL_PROCESS}
-//
-// fsave_frame = /* build a long frame of all zeros */
-// fsave_frame_format = $4060; /* label it as long frame */
-//
-// /* load it with the temps we saved */
-// STAG[fsave_frame] = stag_temp;
-// CMDREG1B[fsave_frame] = cmdreg1b_temp;
-// DTAG[fsave_frame] = dtag_temp;
-// ETE15[fsave_frame] = ete15_temp;
-//
-// /* Make sure that the cmdreg3b dest reg is not going to
-// * be destroyed by a FMOVEM at the end of all this code.
-// * If it is, you should move the current value of the reg
-// * onto the stack so that the reg will loaded with that value.
-// */
-//
-// /* All done. Proceed with the code below */
-// }
-//
-// etemp = FP_reg_[cmdreg1b[12:10]];
-// ete15 = ~ete14;
-// cmdreg1b[15:10] = 010010;
-// clear(bug_flag_procIDxxxx);
-// FRESTORE and return;
-//
-//
-// FIX_OPCLASS2:
-// if ((cmdreg1b[9:7] == cmdreg2b[9:7]) &&
-// (cmdreg1b[9:7] != cmdreg3b[9:7])) { /* xu conflict only */
-// /* We execute the following code if there is an
-// xu conflict and NOT an nu conflict */
-//
-// /* first save some values on the fsave frame */
-// stag_temp = STAG[fsave_frame];
-// cmdreg1b_temp = CMDREG1B[fsave_frame];
-// dtag_temp = DTAG[fsave_frame];
-// ete15_temp = ETE15[fsave_frame];
-// etemp_temp = ETEMP[fsave_frame];
-//
-// CUPC[fsave_frame] = 0000000;
-// FRESTORE
-// FSAVE
-//
-//
-// /* If the xu instruction is exceptional, we punt.
-// * Otherwise, we would have to include OVFL/UNFL handler
-// * code here to get the correct answer.
-// */
-// if (fsave_frame_format == $4060) {goto KILL_PROCESS}
-//
-// fsave_frame = /* build a long frame of all zeros */
-// fsave_frame_format = $4060; /* label it as long frame */
-//
-// /* load it with the temps we saved */
-// STAG[fsave_frame] = stag_temp;
-// CMDREG1B[fsave_frame] = cmdreg1b_temp;
-// DTAG[fsave_frame] = dtag_temp;
-// ETE15[fsave_frame] = ete15_temp;
-// ETEMP[fsave_frame] = etemp_temp;
-//
-// /* Make sure that the cmdreg3b dest reg is not going to
-// * be destroyed by a FMOVEM at the end of all this code.
-// * If it is, you should move the current value of the reg
-// * onto the stack so that the reg will loaded with that value.
-// */
-//
-// /* All done. Proceed with the code below */
-// }
-//
-// if (etemp_exponent == min_sgl) etemp_exponent = min_dbl;
-// if (etemp_exponent == max_sgl) etemp_exponent = max_dbl;
-// cmdreg1b[15:10] = 010101;
-// clear(bug_flag_procIDxxxx);
-// FRESTORE and return;
-//
-//
-// NOFIX:
-// clear(bug_flag_procIDxxxx);
-// FRESTORE and return;
-//
-
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//BUGFIX idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref fpsp_fmt_error
-
- .global b1238_fix
-b1238_fix:
-//
-// This code is entered only on completion of the handling of an
-// nu-generated ovfl, unfl, or inex exception. If the version
-// number of the fsave is not $40, this handler is not necessary.
-// Simply branch to fix_done and exit normally.
-//
- cmpib #VER_40,4(%a7)
- bne fix_done
-//
-// Test for cu_savepc equal to zero. If not, this is not a bug
-// #1238 case.
-//
- moveb CU_SAVEPC(%a6),%d0
- andib #0xFE,%d0
- beq fix_done //if zero, this is not bug #1238
-
-//
-// Test the register conflict aspect. If opclass0, check for
-// cu src equal to xu dest or equal to nu dest. If so, go to
-// op0. Else, or if opclass2, check for cu dest equal to
-// xu dest or equal to nu dest. If so, go to tst_opcl. Else,
-// exit, it is not the bug case.
-//
-// Check for opclass 0. If not, go and check for opclass 2 and sgl.
-//
- movew CMDREG1B(%a6),%d0
- andiw #0xE000,%d0 //strip all but opclass
- bne op2sgl //not opclass 0, check op2
-//
-// Check for cu and nu register conflict. If one exists, this takes
-// priority over a cu and xu conflict.
-//
- bfextu CMDREG1B(%a6){#3:#3},%d0 //get 1st src
- bfextu CMDREG3B(%a6){#6:#3},%d1 //get 3rd dest
- cmpb %d0,%d1
- beqs op0 //if equal, continue bugfix
-//
-// Check for cu dest equal to nu dest. If so, go and fix the
-// bug condition. Otherwise, exit.
-//
- bfextu CMDREG1B(%a6){#6:#3},%d0 //get 1st dest
- cmpb %d0,%d1 //cmp 1st dest with 3rd dest
- beqs op0 //if equal, continue bugfix
-//
-// Check for cu and xu register conflict.
-//
- bfextu CMDREG2B(%a6){#6:#3},%d1 //get 2nd dest
- cmpb %d0,%d1 //cmp 1st dest with 2nd dest
- beqs op0_xu //if equal, continue bugfix
- bfextu CMDREG1B(%a6){#3:#3},%d0 //get 1st src
- cmpb %d0,%d1 //cmp 1st src with 2nd dest
- beq op0_xu
- bne fix_done //if the reg checks fail, exit
-//
-// We have the opclass 0 situation.
-//
-op0:
- bfextu CMDREG1B(%a6){#3:#3},%d0 //get source register no
- movel #7,%d1
- subl %d0,%d1
- clrl %d0
- bsetl %d1,%d0
- fmovemx %d0,ETEMP(%a6) //load source to ETEMP
-
- moveb #0x12,%d0
- bfins %d0,CMDREG1B(%a6){#0:#6} //opclass 2, extended
-//
-// Set ETEMP exponent bit 15 as the opposite of ete14
-//
- btst #6,ETEMP_EX(%a6) //check etemp exponent bit 14
- beq setete15
- bclr #etemp15_bit,STAG(%a6)
- bra finish
-setete15:
- bset #etemp15_bit,STAG(%a6)
- bra finish
-
-//
-// We have the case in which a conflict exists between the cu src or
-// dest and the dest of the xu. We must clear the instruction in
-// the cu and restore the state, allowing the instruction in the
-// xu to complete. Remember, the instruction in the nu
-// was exceptional, and was completed by the appropriate handler.
-// If the result of the xu instruction is not exceptional, we can
-// restore the instruction from the cu to the frame and continue
-// processing the original exception. If the result is also
-// exceptional, we choose to kill the process.
-//
-// Items saved from the stack:
-//
-// $3c stag - L_SCR1
-// $40 cmdreg1b - L_SCR2
-// $44 dtag - L_SCR3
-//
-// The cu savepc is set to zero, and the frame is restored to the
-// fpu.
-//
-op0_xu:
- movel STAG(%a6),L_SCR1(%a6)
- movel CMDREG1B(%a6),L_SCR2(%a6)
- movel DTAG(%a6),L_SCR3(%a6)
- andil #0xe0000000,L_SCR3(%a6)
- moveb #0,CU_SAVEPC(%a6)
- movel (%a7)+,%d1 //save return address from bsr
- frestore (%a7)+
- fsave -(%a7)
-//
-// Check if the instruction which just completed was exceptional.
-//
- cmpw #0x4060,(%a7)
- beq op0_xb
-//
-// It is necessary to isolate the result of the instruction in the
-// xu if it is to fp0 - fp3 and write that value to the USER_FPn
-// locations on the stack. The correct destination register is in
-// cmdreg2b.
-//
- bfextu CMDREG2B(%a6){#6:#3},%d0 //get dest register no
- cmpil #3,%d0
- bgts op0_xi
- beqs op0_fp3
- cmpil #1,%d0
- blts op0_fp0
- beqs op0_fp1
-op0_fp2:
- fmovemx %fp2-%fp2,USER_FP2(%a6)
- bras op0_xi
-op0_fp1:
- fmovemx %fp1-%fp1,USER_FP1(%a6)
- bras op0_xi
-op0_fp0:
- fmovemx %fp0-%fp0,USER_FP0(%a6)
- bras op0_xi
-op0_fp3:
- fmovemx %fp3-%fp3,USER_FP3(%a6)
-//
-// The frame returned is idle. We must build a busy frame to hold
-// the cu state information and setup etemp.
-//
-op0_xi:
- movel #22,%d0 //clear 23 lwords
- clrl (%a7)
-op0_loop:
- clrl -(%a7)
- dbf %d0,op0_loop
- movel #0x40600000,-(%a7)
- movel L_SCR1(%a6),STAG(%a6)
- movel L_SCR2(%a6),CMDREG1B(%a6)
- movel L_SCR3(%a6),DTAG(%a6)
- moveb #0x6,CU_SAVEPC(%a6)
- movel %d1,-(%a7) //return bsr return address
- bfextu CMDREG1B(%a6){#3:#3},%d0 //get source register no
- movel #7,%d1
- subl %d0,%d1
- clrl %d0
- bsetl %d1,%d0
- fmovemx %d0,ETEMP(%a6) //load source to ETEMP
-
- moveb #0x12,%d0
- bfins %d0,CMDREG1B(%a6){#0:#6} //opclass 2, extended
-//
-// Set ETEMP exponent bit 15 as the opposite of ete14
-//
- btst #6,ETEMP_EX(%a6) //check etemp exponent bit 14
- beq op0_sete15
- bclr #etemp15_bit,STAG(%a6)
- bra finish
-op0_sete15:
- bset #etemp15_bit,STAG(%a6)
- bra finish
-
-//
-// The frame returned is busy. It is not possible to reconstruct
-// the code sequence to allow completion. We will jump to
-// fpsp_fmt_error and allow the kernel to kill the process.
-//
-op0_xb:
- jmp fpsp_fmt_error
-
-//
-// Check for opclass 2 and single size. If not both, exit.
-//
-op2sgl:
- movew CMDREG1B(%a6),%d0
- andiw #0xFC00,%d0 //strip all but opclass and size
- cmpiw #0x4400,%d0 //test for opclass 2 and size=sgl
- bne fix_done //if not, it is not bug 1238
-//
-// Check for cu dest equal to nu dest or equal to xu dest, with
-// a cu and nu conflict taking priority an nu conflict. If either,
-// go and fix the bug condition. Otherwise, exit.
-//
- bfextu CMDREG1B(%a6){#6:#3},%d0 //get 1st dest
- bfextu CMDREG3B(%a6){#6:#3},%d1 //get 3rd dest
- cmpb %d0,%d1 //cmp 1st dest with 3rd dest
- beq op2_com //if equal, continue bugfix
- bfextu CMDREG2B(%a6){#6:#3},%d1 //get 2nd dest
- cmpb %d0,%d1 //cmp 1st dest with 2nd dest
- bne fix_done //if the reg checks fail, exit
-//
-// We have the case in which a conflict exists between the cu src or
-// dest and the dest of the xu. We must clear the instruction in
-// the cu and restore the state, allowing the instruction in the
-// xu to complete. Remember, the instruction in the nu
-// was exceptional, and was completed by the appropriate handler.
-// If the result of the xu instruction is not exceptional, we can
-// restore the instruction from the cu to the frame and continue
-// processing the original exception. If the result is also
-// exceptional, we choose to kill the process.
-//
-// Items saved from the stack:
-//
-// $3c stag - L_SCR1
-// $40 cmdreg1b - L_SCR2
-// $44 dtag - L_SCR3
-// etemp - FP_SCR2
-//
-// The cu savepc is set to zero, and the frame is restored to the
-// fpu.
-//
-op2_xu:
- movel STAG(%a6),L_SCR1(%a6)
- movel CMDREG1B(%a6),L_SCR2(%a6)
- movel DTAG(%a6),L_SCR3(%a6)
- andil #0xe0000000,L_SCR3(%a6)
- moveb #0,CU_SAVEPC(%a6)
- movel ETEMP(%a6),FP_SCR2(%a6)
- movel ETEMP_HI(%a6),FP_SCR2+4(%a6)
- movel ETEMP_LO(%a6),FP_SCR2+8(%a6)
- movel (%a7)+,%d1 //save return address from bsr
- frestore (%a7)+
- fsave -(%a7)
-//
-// Check if the instruction which just completed was exceptional.
-//
- cmpw #0x4060,(%a7)
- beq op2_xb
-//
-// It is necessary to isolate the result of the instruction in the
-// xu if it is to fp0 - fp3 and write that value to the USER_FPn
-// locations on the stack. The correct destination register is in
-// cmdreg2b.
-//
- bfextu CMDREG2B(%a6){#6:#3},%d0 //get dest register no
- cmpil #3,%d0
- bgts op2_xi
- beqs op2_fp3
- cmpil #1,%d0
- blts op2_fp0
- beqs op2_fp1
-op2_fp2:
- fmovemx %fp2-%fp2,USER_FP2(%a6)
- bras op2_xi
-op2_fp1:
- fmovemx %fp1-%fp1,USER_FP1(%a6)
- bras op2_xi
-op2_fp0:
- fmovemx %fp0-%fp0,USER_FP0(%a6)
- bras op2_xi
-op2_fp3:
- fmovemx %fp3-%fp3,USER_FP3(%a6)
-//
-// The frame returned is idle. We must build a busy frame to hold
-// the cu state information and fix up etemp.
-//
-op2_xi:
- movel #22,%d0 //clear 23 lwords
- clrl (%a7)
-op2_loop:
- clrl -(%a7)
- dbf %d0,op2_loop
- movel #0x40600000,-(%a7)
- movel L_SCR1(%a6),STAG(%a6)
- movel L_SCR2(%a6),CMDREG1B(%a6)
- movel L_SCR3(%a6),DTAG(%a6)
- moveb #0x6,CU_SAVEPC(%a6)
- movel FP_SCR2(%a6),ETEMP(%a6)
- movel FP_SCR2+4(%a6),ETEMP_HI(%a6)
- movel FP_SCR2+8(%a6),ETEMP_LO(%a6)
- movel %d1,-(%a7)
- bra op2_com
-
-//
-// We have the opclass 2 single source situation.
-//
-op2_com:
- moveb #0x15,%d0
- bfins %d0,CMDREG1B(%a6){#0:#6} //opclass 2, double
-
- cmpw #0x407F,ETEMP_EX(%a6) //single +max
- bnes case2
- movew #0x43FF,ETEMP_EX(%a6) //to double +max
- bra finish
-case2:
- cmpw #0xC07F,ETEMP_EX(%a6) //single -max
- bnes case3
- movew #0xC3FF,ETEMP_EX(%a6) //to double -max
- bra finish
-case3:
- cmpw #0x3F80,ETEMP_EX(%a6) //single +min
- bnes case4
- movew #0x3C00,ETEMP_EX(%a6) //to double +min
- bra finish
-case4:
- cmpw #0xBF80,ETEMP_EX(%a6) //single -min
- bne fix_done
- movew #0xBC00,ETEMP_EX(%a6) //to double -min
- bra finish
-//
-// The frame returned is busy. It is not possible to reconstruct
-// the code sequence to allow completion. fpsp_fmt_error causes
-// an fline illegal instruction to be executed.
-//
-// You should replace the jump to fpsp_fmt_error with a jump
-// to the entry point used to kill a process.
-//
-op2_xb:
- jmp fpsp_fmt_error
-
-//
-// Enter here if the case is not of the situations affected by
-// bug #1238, or if the fix is completed, and exit.
-//
-finish:
-fix_done:
- rts
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/decbin.s b/c/src/lib/libcpu/m68k/m68040/fpsp/decbin.s
deleted file mode 100644
index 734c1b6961..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/decbin.s
+++ /dev/null
@@ -1,508 +0,0 @@
-//
-// $Id$
-//
-// decbin.sa 3.3 12/19/90
-//
-// Description: Converts normalized packed bcd value pointed to by
-// register A6 to extended-precision value in FP0.
-//
-// Input: Normalized packed bcd value in ETEMP(a6).
-//
-// Output: Exact floating-point representation of the packed bcd value.
-//
-// Saves and Modifies: D2-D5
-//
-// Speed: The program decbin takes ??? cycles to execute.
-//
-// Object Size:
-//
-// External Reference(s): None.
-//
-// Algorithm:
-// Expected is a normal bcd (i.e. non-exceptional; all inf, zero,
-// and NaN operands are dispatched without entering this routine)
-// value in 68881/882 format at location ETEMP(A6).
-//
-// A1. Convert the bcd exponent to binary by successive adds and muls.
-// Set the sign according to SE. Subtract 16 to compensate
-// for the mantissa which is to be interpreted as 17 integer
-// digits, rather than 1 integer and 16 fraction digits.
-// Note: this operation can never overflow.
-//
-// A2. Convert the bcd mantissa to binary by successive
-// adds and muls in FP0. Set the sign according to SM.
-// The mantissa digits will be converted with the decimal point
-// assumed following the least-significant digit.
-// Note: this operation can never overflow.
-//
-// A3. Count the number of leading/trailing zeros in the
-// bcd string. If SE is positive, count the leading zeros;
-// if negative, count the trailing zeros. Set the adjusted
-// exponent equal to the exponent from A1 and the zero count
-// added if SM = 1 and subtracted if SM = 0. Scale the
-// mantissa the equivalent of forcing in the bcd value:
-//
-// SM = 0 a non-zero digit in the integer position
-// SM = 1 a non-zero digit in Mant0, lsd of the fraction
-//
-// this will insure that any value, regardless of its
-// representation (ex. 0.1E2, 1E1, 10E0, 100E-1), is converted
-// consistently.
-//
-// A4. Calculate the factor 10^exp in FP1 using a table of
-// 10^(2^n) values. To reduce the error in forming factors
-// greater than 10^27, a directed rounding scheme is used with
-// tables rounded to RN, RM, and RP, according to the table
-// in the comments of the pwrten section.
-//
-// A5. Form the final binary number by scaling the mantissa by
-// the exponent factor. This is done by multiplying the
-// mantissa in FP0 by the factor in FP1 if the adjusted
-// exponent sign is positive, and dividing FP0 by FP1 if
-// it is negative.
-//
-// Clean up and return. Check if the final mul or div resulted
-// in an inex2 exception. If so, set inex1 in the fpsr and
-// check if the inex1 exception is enabled. If so, set d7 upper
-// word to $0100. This will signal unimp.sa that an enabled inex1
-// exception occurred. Unimp will fix the stack.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//DECBIN idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
-//
-// PTENRN, PTENRM, and PTENRP are arrays of powers of 10 rounded
-// to nearest, minus, and plus, respectively. The tables include
-// 10**{1,2,4,8,16,32,64,128,256,512,1024,2048,4096}. No rounding
-// is required until the power is greater than 27, however, all
-// tables include the first 5 for ease of indexing.
-//
- |xref PTENRN
- |xref PTENRM
- |xref PTENRP
-
-RTABLE: .byte 0,0,0,0
- .byte 2,3,2,3
- .byte 2,3,3,2
- .byte 3,2,2,3
-
- .global decbin
- .global calc_e
- .global pwrten
- .global calc_m
- .global norm
- .global ap_st_z
- .global ap_st_n
-//
- .set FNIBS,7
- .set FSTRT,0
-//
- .set ESTRT,4
- .set EDIGITS,2 //
-//
-// Constants in single precision
-FZERO: .long 0x00000000
-FONE: .long 0x3F800000
-FTEN: .long 0x41200000
-
- .set TEN,10
-
-//
-decbin:
- | fmovel #0,FPCR ;clr real fpcr
- moveml %d2-%d5,-(%a7)
-//
-// Calculate exponent:
-// 1. Copy bcd value in memory for use as a working copy.
-// 2. Calculate absolute value of exponent in d1 by mul and add.
-// 3. Correct for exponent sign.
-// 4. Subtract 16 to compensate for interpreting the mant as all integer digits.
-// (i.e., all digits assumed left of the decimal point.)
-//
-// Register usage:
-//
-// calc_e:
-// (*) d0: temp digit storage
-// (*) d1: accumulator for binary exponent
-// (*) d2: digit count
-// (*) d3: offset pointer
-// ( ) d4: first word of bcd
-// ( ) a0: pointer to working bcd value
-// ( ) a6: pointer to original bcd value
-// (*) FP_SCR1: working copy of original bcd value
-// (*) L_SCR1: copy of original exponent word
-//
-calc_e:
- movel #EDIGITS,%d2 //# of nibbles (digits) in fraction part
- moveql #ESTRT,%d3 //counter to pick up digits
- leal FP_SCR1(%a6),%a0 //load tmp bcd storage address
- movel ETEMP(%a6),(%a0) //save input bcd value
- movel ETEMP_HI(%a6),4(%a0) //save words 2 and 3
- movel ETEMP_LO(%a6),8(%a0) //and work with these
- movel (%a0),%d4 //get first word of bcd
- clrl %d1 //zero d1 for accumulator
-e_gd:
- mulul #TEN,%d1 //mul partial product by one digit place
- bfextu %d4{%d3:#4},%d0 //get the digit and zero extend into d0
- addl %d0,%d1 //d1 = d1 + d0
- addqb #4,%d3 //advance d3 to the next digit
- dbf %d2,e_gd //if we have used all 3 digits, exit loop
- btst #30,%d4 //get SE
- beqs e_pos //don't negate if pos
- negl %d1 //negate before subtracting
-e_pos:
- subl #16,%d1 //sub to compensate for shift of mant
- bges e_save //if still pos, do not neg
- negl %d1 //now negative, make pos and set SE
- orl #0x40000000,%d4 //set SE in d4,
- orl #0x40000000,(%a0) //and in working bcd
-e_save:
- movel %d1,L_SCR1(%a6) //save exp in memory
-//
-//
-// Calculate mantissa:
-// 1. Calculate absolute value of mantissa in fp0 by mul and add.
-// 2. Correct for mantissa sign.
-// (i.e., all digits assumed left of the decimal point.)
-//
-// Register usage:
-//
-// calc_m:
-// (*) d0: temp digit storage
-// (*) d1: lword counter
-// (*) d2: digit count
-// (*) d3: offset pointer
-// ( ) d4: words 2 and 3 of bcd
-// ( ) a0: pointer to working bcd value
-// ( ) a6: pointer to original bcd value
-// (*) fp0: mantissa accumulator
-// ( ) FP_SCR1: working copy of original bcd value
-// ( ) L_SCR1: copy of original exponent word
-//
-calc_m:
- moveql #1,%d1 //word counter, init to 1
- fmoves FZERO,%fp0 //accumulator
-//
-//
-// Since the packed number has a long word between the first & second parts,
-// get the integer digit then skip down & get the rest of the
-// mantissa. We will unroll the loop once.
-//
- bfextu (%a0){#28:#4},%d0 //integer part is ls digit in long word
- faddb %d0,%fp0 //add digit to sum in fp0
-//
-//
-// Get the rest of the mantissa.
-//
-loadlw:
- movel (%a0,%d1.L*4),%d4 //load mantissa longword into d4
- moveql #FSTRT,%d3 //counter to pick up digits
- moveql #FNIBS,%d2 //reset number of digits per a0 ptr
-md2b:
- fmuls FTEN,%fp0 //fp0 = fp0 * 10
- bfextu %d4{%d3:#4},%d0 //get the digit and zero extend
- faddb %d0,%fp0 //fp0 = fp0 + digit
-//
-//
-// If all the digits (8) in that long word have been converted (d2=0),
-// then inc d1 (=2) to point to the next long word and reset d3 to 0
-// to initialize the digit offset, and set d2 to 7 for the digit count;
-// else continue with this long word.
-//
- addqb #4,%d3 //advance d3 to the next digit
- dbf %d2,md2b //check for last digit in this lw
-nextlw:
- addql #1,%d1 //inc lw pointer in mantissa
- cmpl #2,%d1 //test for last lw
- ble loadlw //if not, get last one
-
-//
-// Check the sign of the mant and make the value in fp0 the same sign.
-//
-m_sign:
- btst #31,(%a0) //test sign of the mantissa
- beqs ap_st_z //if clear, go to append/strip zeros
- fnegx %fp0 //if set, negate fp0
-
-//
-// Append/strip zeros:
-//
-// For adjusted exponents which have an absolute value greater than 27*,
-// this routine calculates the amount needed to normalize the mantissa
-// for the adjusted exponent. That number is subtracted from the exp
-// if the exp was positive, and added if it was negative. The purpose
-// of this is to reduce the value of the exponent and the possibility
-// of error in calculation of pwrten.
-//
-// 1. Branch on the sign of the adjusted exponent.
-// 2p.(positive exp)
-// 2. Check M16 and the digits in lwords 2 and 3 in descending order.
-// 3. Add one for each zero encountered until a non-zero digit.
-// 4. Subtract the count from the exp.
-// 5. Check if the exp has crossed zero in #3 above; make the exp abs
-// and set SE.
-// 6. Multiply the mantissa by 10**count.
-// 2n.(negative exp)
-// 2. Check the digits in lwords 3 and 2 in descending order.
-// 3. Add one for each zero encountered until a non-zero digit.
-// 4. Add the count to the exp.
-// 5. Check if the exp has crossed zero in #3 above; clear SE.
-// 6. Divide the mantissa by 10**count.
-//
-// *Why 27? If the adjusted exponent is within -28 < expA < 28, than
-// any adjustment due to append/strip zeros will drive the resultant
-// exponent towards zero. Since all pwrten constants with a power
-// of 27 or less are exact, there is no need to use this routine to
-// attempt to lessen the resultant exponent.
-//
-// Register usage:
-//
-// ap_st_z:
-// (*) d0: temp digit storage
-// (*) d1: zero count
-// (*) d2: digit count
-// (*) d3: offset pointer
-// ( ) d4: first word of bcd
-// (*) d5: lword counter
-// ( ) a0: pointer to working bcd value
-// ( ) FP_SCR1: working copy of original bcd value
-// ( ) L_SCR1: copy of original exponent word
-//
-//
-// First check the absolute value of the exponent to see if this
-// routine is necessary. If so, then check the sign of the exponent
-// and do append (+) or strip (-) zeros accordingly.
-// This section handles a positive adjusted exponent.
-//
-ap_st_z:
- movel L_SCR1(%a6),%d1 //load expA for range test
- cmpl #27,%d1 //test is with 27
- ble pwrten //if abs(expA) <28, skip ap/st zeros
- btst #30,(%a0) //check sign of exp
- bnes ap_st_n //if neg, go to neg side
- clrl %d1 //zero count reg
- movel (%a0),%d4 //load lword 1 to d4
- bfextu %d4{#28:#4},%d0 //get M16 in d0
- bnes ap_p_fx //if M16 is non-zero, go fix exp
- addql #1,%d1 //inc zero count
- moveql #1,%d5 //init lword counter
- movel (%a0,%d5.L*4),%d4 //get lword 2 to d4
- bnes ap_p_cl //if lw 2 is zero, skip it
- addql #8,%d1 //and inc count by 8
- addql #1,%d5 //inc lword counter
- movel (%a0,%d5.L*4),%d4 //get lword 3 to d4
-ap_p_cl:
- clrl %d3 //init offset reg
- moveql #7,%d2 //init digit counter
-ap_p_gd:
- bfextu %d4{%d3:#4},%d0 //get digit
- bnes ap_p_fx //if non-zero, go to fix exp
- addql #4,%d3 //point to next digit
- addql #1,%d1 //inc digit counter
- dbf %d2,ap_p_gd //get next digit
-ap_p_fx:
- movel %d1,%d0 //copy counter to d2
- movel L_SCR1(%a6),%d1 //get adjusted exp from memory
- subl %d0,%d1 //subtract count from exp
- bges ap_p_fm //if still pos, go to pwrten
- negl %d1 //now its neg; get abs
- movel (%a0),%d4 //load lword 1 to d4
- orl #0x40000000,%d4 // and set SE in d4
- orl #0x40000000,(%a0) // and in memory
-//
-// Calculate the mantissa multiplier to compensate for the striping of
-// zeros from the mantissa.
-//
-ap_p_fm:
- movel #PTENRN,%a1 //get address of power-of-ten table
- clrl %d3 //init table index
- fmoves FONE,%fp1 //init fp1 to 1
- moveql #3,%d2 //init d2 to count bits in counter
-ap_p_el:
- asrl #1,%d0 //shift lsb into carry
- bccs ap_p_en //if 1, mul fp1 by pwrten factor
- fmulx (%a1,%d3),%fp1 //mul by 10**(d3_bit_no)
-ap_p_en:
- addl #12,%d3 //inc d3 to next rtable entry
- tstl %d0 //check if d0 is zero
- bnes ap_p_el //if not, get next bit
- fmulx %fp1,%fp0 //mul mantissa by 10**(no_bits_shifted)
- bras pwrten //go calc pwrten
-//
-// This section handles a negative adjusted exponent.
-//
-ap_st_n:
- clrl %d1 //clr counter
- moveql #2,%d5 //set up d5 to point to lword 3
- movel (%a0,%d5.L*4),%d4 //get lword 3
- bnes ap_n_cl //if not zero, check digits
- subl #1,%d5 //dec d5 to point to lword 2
- addql #8,%d1 //inc counter by 8
- movel (%a0,%d5.L*4),%d4 //get lword 2
-ap_n_cl:
- movel #28,%d3 //point to last digit
- moveql #7,%d2 //init digit counter
-ap_n_gd:
- bfextu %d4{%d3:#4},%d0 //get digit
- bnes ap_n_fx //if non-zero, go to exp fix
- subql #4,%d3 //point to previous digit
- addql #1,%d1 //inc digit counter
- dbf %d2,ap_n_gd //get next digit
-ap_n_fx:
- movel %d1,%d0 //copy counter to d0
- movel L_SCR1(%a6),%d1 //get adjusted exp from memory
- subl %d0,%d1 //subtract count from exp
- bgts ap_n_fm //if still pos, go fix mantissa
- negl %d1 //take abs of exp and clr SE
- movel (%a0),%d4 //load lword 1 to d4
- andl #0xbfffffff,%d4 // and clr SE in d4
- andl #0xbfffffff,(%a0) // and in memory
-//
-// Calculate the mantissa multiplier to compensate for the appending of
-// zeros to the mantissa.
-//
-ap_n_fm:
- movel #PTENRN,%a1 //get address of power-of-ten table
- clrl %d3 //init table index
- fmoves FONE,%fp1 //init fp1 to 1
- moveql #3,%d2 //init d2 to count bits in counter
-ap_n_el:
- asrl #1,%d0 //shift lsb into carry
- bccs ap_n_en //if 1, mul fp1 by pwrten factor
- fmulx (%a1,%d3),%fp1 //mul by 10**(d3_bit_no)
-ap_n_en:
- addl #12,%d3 //inc d3 to next rtable entry
- tstl %d0 //check if d0 is zero
- bnes ap_n_el //if not, get next bit
- fdivx %fp1,%fp0 //div mantissa by 10**(no_bits_shifted)
-//
-//
-// Calculate power-of-ten factor from adjusted and shifted exponent.
-//
-// Register usage:
-//
-// pwrten:
-// (*) d0: temp
-// ( ) d1: exponent
-// (*) d2: {FPCR[6:5],SM,SE} as index in RTABLE; temp
-// (*) d3: FPCR work copy
-// ( ) d4: first word of bcd
-// (*) a1: RTABLE pointer
-// calc_p:
-// (*) d0: temp
-// ( ) d1: exponent
-// (*) d3: PWRTxx table index
-// ( ) a0: pointer to working copy of bcd
-// (*) a1: PWRTxx pointer
-// (*) fp1: power-of-ten accumulator
-//
-// Pwrten calculates the exponent factor in the selected rounding mode
-// according to the following table:
-//
-// Sign of Mant Sign of Exp Rounding Mode PWRTEN Rounding Mode
-//
-// ANY ANY RN RN
-//
-// + + RP RP
-// - + RP RM
-// + - RP RM
-// - - RP RP
-//
-// + + RM RM
-// - + RM RP
-// + - RM RP
-// - - RM RM
-//
-// + + RZ RM
-// - + RZ RM
-// + - RZ RP
-// - - RZ RP
-//
-//
-pwrten:
- movel USER_FPCR(%a6),%d3 //get user's FPCR
- bfextu %d3{#26:#2},%d2 //isolate rounding mode bits
- movel (%a0),%d4 //reload 1st bcd word to d4
- asll #2,%d2 //format d2 to be
- bfextu %d4{#0:#2},%d0 // {FPCR[6],FPCR[5],SM,SE}
- addl %d0,%d2 //in d2 as index into RTABLE
- leal RTABLE,%a1 //load rtable base
- moveb (%a1,%d2),%d0 //load new rounding bits from table
- clrl %d3 //clear d3 to force no exc and extended
- bfins %d0,%d3{#26:#2} //stuff new rounding bits in FPCR
- fmovel %d3,%FPCR //write new FPCR
- asrl #1,%d0 //write correct PTENxx table
- bccs not_rp //to a1
- leal PTENRP,%a1 //it is RP
- bras calc_p //go to init section
-not_rp:
- asrl #1,%d0 //keep checking
- bccs not_rm
- leal PTENRM,%a1 //it is RM
- bras calc_p //go to init section
-not_rm:
- leal PTENRN,%a1 //it is RN
-calc_p:
- movel %d1,%d0 //copy exp to d0;use d0
- bpls no_neg //if exp is negative,
- negl %d0 //invert it
- orl #0x40000000,(%a0) //and set SE bit
-no_neg:
- clrl %d3 //table index
- fmoves FONE,%fp1 //init fp1 to 1
-e_loop:
- asrl #1,%d0 //shift next bit into carry
- bccs e_next //if zero, skip the mul
- fmulx (%a1,%d3),%fp1 //mul by 10**(d3_bit_no)
-e_next:
- addl #12,%d3 //inc d3 to next rtable entry
- tstl %d0 //check if d0 is zero
- bnes e_loop //not zero, continue shifting
-//
-//
-// Check the sign of the adjusted exp and make the value in fp0 the
-// same sign. If the exp was pos then multiply fp1*fp0;
-// else divide fp0/fp1.
-//
-// Register Usage:
-// norm:
-// ( ) a0: pointer to working bcd value
-// (*) fp0: mantissa accumulator
-// ( ) fp1: scaling factor - 10**(abs(exp))
-//
-norm:
- btst #30,(%a0) //test the sign of the exponent
- beqs mul //if clear, go to multiply
-div:
- fdivx %fp1,%fp0 //exp is negative, so divide mant by exp
- bras end_dec
-mul:
- fmulx %fp1,%fp0 //exp is positive, so multiply by exp
-//
-//
-// Clean up and return with result in fp0.
-//
-// If the final mul/div in decbin incurred an inex exception,
-// it will be inex2, but will be reported as inex1 by get_op.
-//
-end_dec:
- fmovel %FPSR,%d0 //get status register
- bclrl #inex2_bit+8,%d0 //test for inex2 and clear it
- fmovel %d0,%FPSR //return status reg w/o inex2
- beqs no_exc //skip this if no exc
- orl #inx1a_mask,USER_FPSR(%a6) //set inex1/ainex
-no_exc:
- moveml (%a7)+,%d2-%d5
- rts
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/do_func.s b/c/src/lib/libcpu/m68k/m68040/fpsp/do_func.s
deleted file mode 100644
index fb7668f7f4..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/do_func.s
+++ /dev/null
@@ -1,561 +0,0 @@
-//
-// $Id$
-//
-// do_func.sa 3.4 2/18/91
-//
-// Do_func performs the unimplemented operation. The operation
-// to be performed is determined from the lower 7 bits of the
-// extension word (except in the case of fmovecr and fsincos).
-// The opcode and tag bits form an index into a jump table in
-// tbldo.sa. Cases of zero, infinity and NaN are handled in
-// do_func by forcing the default result. Normalized and
-// denormalized (there are no unnormalized numbers at this
-// point) are passed onto the emulation code.
-//
-// CMDREG1B and STAG are extracted from the fsave frame
-// and combined to form the table index. The function called
-// will start with a0 pointing to the ETEMP operand. Dyadic
-// functions can find FPTEMP at -12(a0).
-//
-// Called functions return their result in fp0. Sincos returns
-// sin(x) in fp0 and cos(x) in fp1.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-DO_FUNC: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref t_dz2
- |xref t_operr
- |xref t_inx2
- |xref t_resdnrm
- |xref dst_nan
- |xref src_nan
- |xref nrm_set
- |xref sto_cos
-
- |xref tblpre
- |xref slognp1,slogn,slog10,slog2
- |xref slognd,slog10d,slog2d
- |xref smod,srem
- |xref sscale
- |xref smovcr
-
-PONE: .long 0x3fff0000,0x80000000,0x00000000 //+1
-MONE: .long 0xbfff0000,0x80000000,0x00000000 //-1
-PZERO: .long 0x00000000,0x00000000,0x00000000 //+0
-MZERO: .long 0x80000000,0x00000000,0x00000000 //-0
-PINF: .long 0x7fff0000,0x00000000,0x00000000 //+inf
-MINF: .long 0xffff0000,0x00000000,0x00000000 //-inf
-QNAN: .long 0x7fff0000,0xffffffff,0xffffffff //non-signaling nan
-PPIBY2: .long 0x3FFF0000,0xC90FDAA2,0x2168C235 //+PI/2
-MPIBY2: .long 0xbFFF0000,0xC90FDAA2,0x2168C235 //-PI/2
-
- .global do_func
-do_func:
- clrb CU_ONLY(%a6)
-//
-// Check for fmovecr. It does not follow the format of fp gen
-// unimplemented instructions. The test is on the upper 6 bits;
-// if they are $17, the inst is fmovecr. Call entry smovcr
-// directly.
-//
- bfextu CMDREG1B(%a6){#0:#6},%d0 //get opclass and src fields
- cmpil #0x17,%d0 //if op class and size fields are $17,
-// ;it is FMOVECR; if not, continue
- bnes not_fmovecr
- jmp smovcr //fmovecr; jmp directly to emulation
-
-not_fmovecr:
- movew CMDREG1B(%a6),%d0
- andl #0x7F,%d0
- cmpil #0x38,%d0 //if the extension is >= $38,
- bges serror //it is illegal
- bfextu STAG(%a6){#0:#3},%d1
- lsll #3,%d0 //make room for STAG
- addl %d1,%d0 //combine for final index into table
- leal tblpre,%a1 //start of monster jump table
- movel (%a1,%d0.w*4),%a1 //real target address
- leal ETEMP(%a6),%a0 //a0 is pointer to src op
- movel USER_FPCR(%a6),%d1
- andl #0xFF,%d1 // discard all but rounding mode/prec
- fmovel #0,%fpcr
- jmp (%a1)
-//
-// ERROR
-//
- .global serror
-serror:
- st STORE_FLG(%a6)
- rts
-//
-// These routines load forced values into fp0. They are called
-// by index into tbldo.
-//
-// Load a signed zero to fp0 and set inex2/ainex
-//
- .global snzrinx
-snzrinx:
- btstb #sign_bit,LOCAL_EX(%a0) //get sign of source operand
- bnes ld_mzinx //if negative, branch
- bsr ld_pzero //bsr so we can return and set inx
- bra t_inx2 //now, set the inx for the next inst
-ld_mzinx:
- bsr ld_mzero //if neg, load neg zero, return here
- bra t_inx2 //now, set the inx for the next inst
-//
-// Load a signed zero to fp0; do not set inex2/ainex
-//
- .global szero
-szero:
- btstb #sign_bit,LOCAL_EX(%a0) //get sign of source operand
- bne ld_mzero //if neg, load neg zero
- bra ld_pzero //load positive zero
-//
-// Load a signed infinity to fp0; do not set inex2/ainex
-//
- .global sinf
-sinf:
- btstb #sign_bit,LOCAL_EX(%a0) //get sign of source operand
- bne ld_minf //if negative branch
- bra ld_pinf
-//
-// Load a signed one to fp0; do not set inex2/ainex
-//
- .global sone
-sone:
- btstb #sign_bit,LOCAL_EX(%a0) //check sign of source
- bne ld_mone
- bra ld_pone
-//
-// Load a signed pi/2 to fp0; do not set inex2/ainex
-//
- .global spi_2
-spi_2:
- btstb #sign_bit,LOCAL_EX(%a0) //check sign of source
- bne ld_mpi2
- bra ld_ppi2
-//
-// Load either a +0 or +inf for plus/minus operand
-//
- .global szr_inf
-szr_inf:
- btstb #sign_bit,LOCAL_EX(%a0) //check sign of source
- bne ld_pzero
- bra ld_pinf
-//
-// Result is either an operr or +inf for plus/minus operand
-// [Used by slogn, slognp1, slog10, and slog2]
-//
- .global sopr_inf
-sopr_inf:
- btstb #sign_bit,LOCAL_EX(%a0) //check sign of source
- bne t_operr
- bra ld_pinf
-//
-// FLOGNP1
-//
- .global sslognp1
-sslognp1:
- fmovemx (%a0),%fp0-%fp0
- fcmpb #-1,%fp0
- fbgt slognp1
- fbeq t_dz2 //if = -1, divide by zero exception
- fmovel #0,%FPSR //clr N flag
- bra t_operr //take care of operands < -1
-//
-// FETOXM1
-//
- .global setoxm1i
-setoxm1i:
- btstb #sign_bit,LOCAL_EX(%a0) //check sign of source
- bne ld_mone
- bra ld_pinf
-//
-// FLOGN
-//
-// Test for 1.0 as an input argument, returning +zero. Also check
-// the sign and return operr if negative.
-//
- .global sslogn
-sslogn:
- btstb #sign_bit,LOCAL_EX(%a0)
- bne t_operr //take care of operands < 0
- cmpiw #0x3fff,LOCAL_EX(%a0) //test for 1.0 input
- bne slogn
- cmpil #0x80000000,LOCAL_HI(%a0)
- bne slogn
- tstl LOCAL_LO(%a0)
- bne slogn
- fmovex PZERO,%fp0
- rts
-
- .global sslognd
-sslognd:
- btstb #sign_bit,LOCAL_EX(%a0)
- beq slognd
- bra t_operr //take care of operands < 0
-
-//
-// FLOG10
-//
- .global sslog10
-sslog10:
- btstb #sign_bit,LOCAL_EX(%a0)
- bne t_operr //take care of operands < 0
- cmpiw #0x3fff,LOCAL_EX(%a0) //test for 1.0 input
- bne slog10
- cmpil #0x80000000,LOCAL_HI(%a0)
- bne slog10
- tstl LOCAL_LO(%a0)
- bne slog10
- fmovex PZERO,%fp0
- rts
-
- .global sslog10d
-sslog10d:
- btstb #sign_bit,LOCAL_EX(%a0)
- beq slog10d
- bra t_operr //take care of operands < 0
-
-//
-// FLOG2
-//
- .global sslog2
-sslog2:
- btstb #sign_bit,LOCAL_EX(%a0)
- bne t_operr //take care of operands < 0
- cmpiw #0x3fff,LOCAL_EX(%a0) //test for 1.0 input
- bne slog2
- cmpil #0x80000000,LOCAL_HI(%a0)
- bne slog2
- tstl LOCAL_LO(%a0)
- bne slog2
- fmovex PZERO,%fp0
- rts
-
- .global sslog2d
-sslog2d:
- btstb #sign_bit,LOCAL_EX(%a0)
- beq slog2d
- bra t_operr //take care of operands < 0
-
-//
-// FMOD
-//
-pmodt:
-// ;$21 fmod
-// ;dtag,stag
- .long smod // 00,00 norm,norm = normal
- .long smod_oper // 00,01 norm,zero = nan with operr
- .long smod_fpn // 00,10 norm,inf = fpn
- .long smod_snan // 00,11 norm,nan = nan
- .long smod_zro // 01,00 zero,norm = +-zero
- .long smod_oper // 01,01 zero,zero = nan with operr
- .long smod_zro // 01,10 zero,inf = +-zero
- .long smod_snan // 01,11 zero,nan = nan
- .long smod_oper // 10,00 inf,norm = nan with operr
- .long smod_oper // 10,01 inf,zero = nan with operr
- .long smod_oper // 10,10 inf,inf = nan with operr
- .long smod_snan // 10,11 inf,nan = nan
- .long smod_dnan // 11,00 nan,norm = nan
- .long smod_dnan // 11,01 nan,zero = nan
- .long smod_dnan // 11,10 nan,inf = nan
- .long smod_dnan // 11,11 nan,nan = nan
-
- .global pmod
-pmod:
- clrb FPSR_QBYTE(%a6) // clear quotient field
- bfextu STAG(%a6){#0:#3},%d0 //stag = d0
- bfextu DTAG(%a6){#0:#3},%d1 //dtag = d1
-
-//
-// Alias extended denorms to norms for the jump table.
-//
- bclrl #2,%d0
- bclrl #2,%d1
-
- lslb #2,%d1
- orb %d0,%d1 //d1{3:2} = dtag, d1{1:0} = stag
-// ;Tag values:
-// ;00 = norm or denorm
-// ;01 = zero
-// ;10 = inf
-// ;11 = nan
- lea pmodt,%a1
- movel (%a1,%d1.w*4),%a1
- jmp (%a1)
-
-smod_snan:
- bra src_nan
-smod_dnan:
- bra dst_nan
-smod_oper:
- bra t_operr
-smod_zro:
- moveb ETEMP(%a6),%d1 //get sign of src op
- moveb FPTEMP(%a6),%d0 //get sign of dst op
- eorb %d0,%d1 //get exor of sign bits
- btstl #7,%d1 //test for sign
- beqs smod_zsn //if clr, do not set sign big
- bsetb #q_sn_bit,FPSR_QBYTE(%a6) //set q-byte sign bit
-smod_zsn:
- btstl #7,%d0 //test if + or -
- beq ld_pzero //if pos then load +0
- bra ld_mzero //else neg load -0
-
-smod_fpn:
- moveb ETEMP(%a6),%d1 //get sign of src op
- moveb FPTEMP(%a6),%d0 //get sign of dst op
- eorb %d0,%d1 //get exor of sign bits
- btstl #7,%d1 //test for sign
- beqs smod_fsn //if clr, do not set sign big
- bsetb #q_sn_bit,FPSR_QBYTE(%a6) //set q-byte sign bit
-smod_fsn:
- tstb DTAG(%a6) //filter out denormal destination case
- bpls smod_nrm //
- leal FPTEMP(%a6),%a0 //a0<- addr(FPTEMP)
- bra t_resdnrm //force UNFL(but exact) result
-smod_nrm:
- fmovel USER_FPCR(%a6),%fpcr //use user's rmode and precision
- fmovex FPTEMP(%a6),%fp0 //return dest to fp0
- rts
-
-//
-// FREM
-//
-premt:
-// ;$25 frem
-// ;dtag,stag
- .long srem // 00,00 norm,norm = normal
- .long srem_oper // 00,01 norm,zero = nan with operr
- .long srem_fpn // 00,10 norm,inf = fpn
- .long srem_snan // 00,11 norm,nan = nan
- .long srem_zro // 01,00 zero,norm = +-zero
- .long srem_oper // 01,01 zero,zero = nan with operr
- .long srem_zro // 01,10 zero,inf = +-zero
- .long srem_snan // 01,11 zero,nan = nan
- .long srem_oper // 10,00 inf,norm = nan with operr
- .long srem_oper // 10,01 inf,zero = nan with operr
- .long srem_oper // 10,10 inf,inf = nan with operr
- .long srem_snan // 10,11 inf,nan = nan
- .long srem_dnan // 11,00 nan,norm = nan
- .long srem_dnan // 11,01 nan,zero = nan
- .long srem_dnan // 11,10 nan,inf = nan
- .long srem_dnan // 11,11 nan,nan = nan
-
- .global prem
-prem:
- clrb FPSR_QBYTE(%a6) //clear quotient field
- bfextu STAG(%a6){#0:#3},%d0 //stag = d0
- bfextu DTAG(%a6){#0:#3},%d1 //dtag = d1
-//
-// Alias extended denorms to norms for the jump table.
-//
- bclr #2,%d0
- bclr #2,%d1
-
- lslb #2,%d1
- orb %d0,%d1 //d1{3:2} = dtag, d1{1:0} = stag
-// ;Tag values:
-// ;00 = norm or denorm
-// ;01 = zero
-// ;10 = inf
-// ;11 = nan
- lea premt,%a1
- movel (%a1,%d1.w*4),%a1
- jmp (%a1)
-
-srem_snan:
- bra src_nan
-srem_dnan:
- bra dst_nan
-srem_oper:
- bra t_operr
-srem_zro:
- moveb ETEMP(%a6),%d1 //get sign of src op
- moveb FPTEMP(%a6),%d0 //get sign of dst op
- eorb %d0,%d1 //get exor of sign bits
- btstl #7,%d1 //test for sign
- beqs srem_zsn //if clr, do not set sign big
- bsetb #q_sn_bit,FPSR_QBYTE(%a6) //set q-byte sign bit
-srem_zsn:
- btstl #7,%d0 //test if + or -
- beq ld_pzero //if pos then load +0
- bra ld_mzero //else neg load -0
-
-srem_fpn:
- moveb ETEMP(%a6),%d1 //get sign of src op
- moveb FPTEMP(%a6),%d0 //get sign of dst op
- eorb %d0,%d1 //get exor of sign bits
- btstl #7,%d1 //test for sign
- beqs srem_fsn //if clr, do not set sign big
- bsetb #q_sn_bit,FPSR_QBYTE(%a6) //set q-byte sign bit
-srem_fsn:
- tstb DTAG(%a6) //filter out denormal destination case
- bpls srem_nrm //
- leal FPTEMP(%a6),%a0 //a0<- addr(FPTEMP)
- bra t_resdnrm //force UNFL(but exact) result
-srem_nrm:
- fmovel USER_FPCR(%a6),%fpcr //use user's rmode and precision
- fmovex FPTEMP(%a6),%fp0 //return dest to fp0
- rts
-//
-// FSCALE
-//
-pscalet:
-// ;$26 fscale
-// ;dtag,stag
- .long sscale // 00,00 norm,norm = result
- .long sscale // 00,01 norm,zero = fpn
- .long scl_opr // 00,10 norm,inf = nan with operr
- .long scl_snan // 00,11 norm,nan = nan
- .long scl_zro // 01,00 zero,norm = +-zero
- .long scl_zro // 01,01 zero,zero = +-zero
- .long scl_opr // 01,10 zero,inf = nan with operr
- .long scl_snan // 01,11 zero,nan = nan
- .long scl_inf // 10,00 inf,norm = +-inf
- .long scl_inf // 10,01 inf,zero = +-inf
- .long scl_opr // 10,10 inf,inf = nan with operr
- .long scl_snan // 10,11 inf,nan = nan
- .long scl_dnan // 11,00 nan,norm = nan
- .long scl_dnan // 11,01 nan,zero = nan
- .long scl_dnan // 11,10 nan,inf = nan
- .long scl_dnan // 11,11 nan,nan = nan
-
- .global pscale
-pscale:
- bfextu STAG(%a6){#0:#3},%d0 //stag in d0
- bfextu DTAG(%a6){#0:#3},%d1 //dtag in d1
- bclrl #2,%d0 //alias denorm into norm
- bclrl #2,%d1 //alias denorm into norm
- lslb #2,%d1
- orb %d0,%d1 //d1{4:2} = dtag, d1{1:0} = stag
-// ;dtag values stag values:
-// ;000 = norm 00 = norm
-// ;001 = zero 01 = zero
-// ;010 = inf 10 = inf
-// ;011 = nan 11 = nan
-// ;100 = dnrm
-//
-//
- leal pscalet,%a1 //load start of jump table
- movel (%a1,%d1.w*4),%a1 //load a1 with label depending on tag
- jmp (%a1) //go to the routine
-
-scl_opr:
- bra t_operr
-
-scl_dnan:
- bra dst_nan
-
-scl_zro:
- btstb #sign_bit,FPTEMP_EX(%a6) //test if + or -
- beq ld_pzero //if pos then load +0
- bra ld_mzero //if neg then load -0
-scl_inf:
- btstb #sign_bit,FPTEMP_EX(%a6) //test if + or -
- beq ld_pinf //if pos then load +inf
- bra ld_minf //else neg load -inf
-scl_snan:
- bra src_nan
-//
-// FSINCOS
-//
- .global ssincosz
-ssincosz:
- btstb #sign_bit,ETEMP(%a6) //get sign
- beqs sincosp
- fmovex MZERO,%fp0
- bras sincoscom
-sincosp:
- fmovex PZERO,%fp0
-sincoscom:
- fmovemx PONE,%fp1-%fp1 //do not allow FPSR to be affected
- bra sto_cos //store cosine result
-
- .global ssincosi
-ssincosi:
- fmovex QNAN,%fp1 //load NAN
- bsr sto_cos //store cosine result
- fmovex QNAN,%fp0 //load NAN
- bra t_operr
-
- .global ssincosnan
-ssincosnan:
- movel ETEMP_EX(%a6),FP_SCR1(%a6)
- movel ETEMP_HI(%a6),FP_SCR1+4(%a6)
- movel ETEMP_LO(%a6),FP_SCR1+8(%a6)
- bsetb #signan_bit,FP_SCR1+4(%a6)
- fmovemx FP_SCR1(%a6),%fp1-%fp1
- bsr sto_cos
- bra src_nan
-//
-// This code forces default values for the zero, inf, and nan cases
-// in the transcendentals code. The CC bits must be set in the
-// stacked FPSR to be correctly reported.
-//
-//**Returns +PI/2
- .global ld_ppi2
-ld_ppi2:
- fmovex PPIBY2,%fp0 //load +pi/2
- bra t_inx2 //set inex2 exc
-
-//**Returns -PI/2
- .global ld_mpi2
-ld_mpi2:
- fmovex MPIBY2,%fp0 //load -pi/2
- orl #neg_mask,USER_FPSR(%a6) //set N bit
- bra t_inx2 //set inex2 exc
-
-//**Returns +inf
- .global ld_pinf
-ld_pinf:
- fmovex PINF,%fp0 //load +inf
- orl #inf_mask,USER_FPSR(%a6) //set I bit
- rts
-
-//**Returns -inf
- .global ld_minf
-ld_minf:
- fmovex MINF,%fp0 //load -inf
- orl #neg_mask+inf_mask,USER_FPSR(%a6) //set N and I bits
- rts
-
-//**Returns +1
- .global ld_pone
-ld_pone:
- fmovex PONE,%fp0 //load +1
- rts
-
-//**Returns -1
- .global ld_mone
-ld_mone:
- fmovex MONE,%fp0 //load -1
- orl #neg_mask,USER_FPSR(%a6) //set N bit
- rts
-
-//**Returns +0
- .global ld_pzero
-ld_pzero:
- fmovex PZERO,%fp0 //load +0
- orl #z_mask,USER_FPSR(%a6) //set Z bit
- rts
-
-//**Returns -0
- .global ld_mzero
-ld_mzero:
- fmovex MZERO,%fp0 //load -0
- orl #neg_mask+z_mask,USER_FPSR(%a6) //set N and Z bits
- rts
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/fpsp.defs b/c/src/lib/libcpu/m68k/m68040/fpsp/fpsp.defs
deleted file mode 100644
index 672a83c548..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/fpsp.defs
+++ /dev/null
@@ -1,349 +0,0 @@
-|
-| $Id$
-|
-| fpsp.h 3.3 3.3
-|
-| Copyright (C) Motorola, Inc. 1990
-| All Rights Reserved
-|
-| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-| The copyright notice above does not evidence any
-| actual or intended publication of such source code.
-
-| fpsp.h --- stack frame offsets during FPSP exception handling
-|
-| These equates are used to access the exception frame, the fsave
-| frame and any local variables needed by the FPSP package.
-|
-| All FPSP handlers begin by executing:
-|
-| link a6,#-LOCAL_SIZE
-| fsave -(a7)
-| movem.l d0-d1/a0-a1,USER_DA(a6)
-| fmovem.x fp0-fp3,USER_FP0(a6)
-| fmove.l fpsr/fpcr/fpiar,USER_FPSR(a6)
-|
-| After initialization, the stack looks like this:
-|
-| A7 ---> +-------------------------------+
-| | |
-| | FPU fsave area |
-| | |
-| +-------------------------------+
-| | |
-| | FPSP Local Variables |
-| | including |
-| | saved registers |
-| | |
-| +-------------------------------+
-| A6 ---> | Saved A6 |
-| +-------------------------------+
-| | |
-| | Exception Frame |
-| | |
-| | |
-|
-| Positive offsets from A6 refer to the exception frame. Negative
-| offsets refer to the Local Variable area and the fsave area.
-| The fsave frame is also accessible 'from the top' via A7.
-|
-| On exit, the handlers execute:
-|
-| movem.l USER_DA(a6),d0-d1/a0-a1
-| fmovem.x USER_FP0(a6),fp0-fp3
-| fmove.l USER_FPSR(a6),fpsr/fpcr/fpiar
-| frestore (a7)+
-| unlk a6
-|
-| and then either 'bra fpsp_done' if the exception was completely
-| handled by the package, or 'bra real_xxxx' which is an external
-| label to a routine that will process a real exception of the
-| type that was generated. Some handlers may omit the 'frestore'
-| if the FPU state after the exception is idle.
-|
-| Sometimes the exception handler will transform the fsave area
-| because it needs to report an exception back to the user. This
-| can happen if the package is entered for an unimplemented float
-| instruction that generates (say) an underflow. Alternatively,
-| a second fsave frame can be pushed onto the stack and the
-| handler exit code will reload the new frame and discard the old.
-|
-| The registers d0, d1, a0, a1 and fp0-fp3 are always saved and
-| restored from the 'local variable' area and can be used as
-| temporaries. If a routine needs to change any
-| of these registers, it should modify the saved copy and let
-| the handler exit code restore the value.
-|
-|----------------------------------------------------------------------
-|
-| Local Variables on the stack
-|
- .set LOCAL_SIZE,192 | bytes needed for local variables
- .set LV,-LOCAL_SIZE | convenient base value
-|
- .set USER_DA,LV+0 | save space for D0-D1,A0-A1
- .set USER_D0,LV+0 | saved user D0
- .set USER_D1,LV+4 | saved user D1
- .set USER_A0,LV+8 | saved user A0
- .set USER_A1,LV+12 | saved user A1
- .set USER_FP0,LV+16 | saved user FP0
- .set USER_FP1,LV+28 | saved user FP1
- .set USER_FP2,LV+40 | saved user FP2
- .set USER_FP3,LV+52 | saved user FP3
- .set USER_FPCR,LV+64 | saved user FPCR
- .set FPCR_ENABLE,USER_FPCR+2 | FPCR exception enable
- .set FPCR_MODE,USER_FPCR+3 | FPCR rounding mode control
- .set USER_FPSR,LV+68 | saved user FPSR
- .set FPSR_CC,USER_FPSR+0 | FPSR condition code
- .set FPSR_QBYTE,USER_FPSR+1 | FPSR quotient
- .set FPSR_EXCEPT,USER_FPSR+2 | FPSR exception
- .set FPSR_AEXCEPT,USER_FPSR+3 | FPSR accrued exception
- .set USER_FPIAR,LV+72 | saved user FPIAR
- .set FP_SCR1,LV+76 | room for a temporary float value
- .set FP_SCR2,LV+92 | room for a temporary float value
- .set L_SCR1,LV+108 | room for a temporary long value
- .set L_SCR2,LV+112 | room for a temporary long value
- .set STORE_FLG,LV+116
- .set BINDEC_FLG,LV+117 | used in bindec
- .set DNRM_FLG,LV+118 | used in res_func
- .set RES_FLG,LV+119 | used in res_func
- .set DY_MO_FLG,LV+120 | dyadic/monadic flag
- .set UFLG_TMP,LV+121 | temporary for uflag errata
- .set CU_ONLY,LV+122 | cu-only flag
- .set VER_TMP,LV+123 | temp holding for version number
- .set L_SCR3,LV+124 | room for a temporary long value
- .set FP_SCR3,LV+128 | room for a temporary float value
- .set FP_SCR4,LV+144 | room for a temporary float value
- .set FP_SCR5,LV+160 | room for a temporary float value
- .set FP_SCR6,LV+176
-|
-|NEXT equ LV+192 ;need to increase LOCAL_SIZE
-|
-|--------------------------------------------------------------------------
-|
-| fsave offsets and bit definitions
-|
-| Offsets are defined from the end of an fsave because the last 10
-| words of a busy frame are the same as the unimplemented frame.
-|
- .set CU_SAVEPC,LV-92 | micro-pc for CU (1 byte)
- .set FPR_DIRTY_BITS,LV-91 | fpr dirty bits
-|
- .set WBTEMP,LV-76 | write back temp (12 bytes)
- .set WBTEMP_EX,WBTEMP | wbtemp sign and exponent (2 bytes)
- .set WBTEMP_HI,WBTEMP+4 | wbtemp mantissa [63:32] (4 bytes)
- .set WBTEMP_LO,WBTEMP+8 | wbtemp mantissa [31:00] (4 bytes)
-|
- .set WBTEMP_SGN,WBTEMP+2 | used to store sign
-|
- .set FPSR_SHADOW,LV-64 | fpsr shadow reg
-|
- .set FPIARCU,LV-60 | Instr. addr. reg. for CU (4 bytes)
-|
- .set CMDREG2B,LV-52 | cmd reg for machine 2
- .set CMDREG3B,LV-48 | cmd reg for E3 exceptions (2 bytes)
-|
- .set NMNEXC,LV-44 | NMNEXC (unsup,snan bits only)
- .set nmn_unsup_bit,1
- .set nmn_snan_bit,0
-|
- .set NMCEXC,LV-43 | NMNEXC & NMCEXC
- .set nmn_operr_bit,7
- .set nmn_ovfl_bit,6
- .set nmn_unfl_bit,5
- .set nmc_unsup_bit,4
- .set nmc_snan_bit,3
- .set nmc_operr_bit,2
- .set nmc_ovfl_bit,1
- .set nmc_unfl_bit,0
-|
- .set STAG,LV-40 | source tag (1 byte)
- .set WBTEMP_GRS,LV-40 | alias wbtemp guard, round, sticky
- .set guard_bit,1 | guard bit is bit number 1
- .set round_bit,0 | round bit is bit number 0
- .set stag_mask,0xE0 | upper 3 bits are source tag type
- .set denorm_bit,7 | bit determins if denorm or unnorm
- .set etemp15_bit,4 | etemp exponent bit #15
- .set wbtemp66_bit,2 | wbtemp mantissa bit #66
- .set wbtemp1_bit,1 | wbtemp mantissa bit #1
- .set wbtemp0_bit,0 | wbtemp mantissa bit #0
-|
- .set STICKY,LV-39 | holds sticky bit
- .set sticky_bit,7
-|
- .set CMDREG1B,LV-36 | cmd reg for E1 exceptions (2 bytes)
- .set kfact_bit,12 | distinguishes static/dynamic k-factor
-| ;on packed move outs. NOTE: this
-| ;equate only works when CMDREG1B is in
-| ;a register.
-|
- .set CMDWORD,LV-35 | command word in cmd1b
- .set direction_bit,5 | bit 0 in opclass
- .set size_bit2,12 | bit 2 in size field
-|
- .set DTAG,LV-32 | dest tag (1 byte)
- .set dtag_mask,0xE0 | upper 3 bits are dest type tag
- .set fptemp15_bit,4 | fptemp exponent bit #15
-|
- .set WB_BYTE,LV-31 | holds WBTE15 bit (1 byte)
- .set wbtemp15_bit,4 | wbtemp exponent bit #15
-|
- .set E_BYTE,LV-28 | holds E1 and E3 bits (1 byte)
- .set E1,2 | which bit is E1 flag
- .set E3,1 | which bit is E3 flag
- .set SFLAG,0 | which bit is S flag
-|
- .set T_BYTE,LV-27 | holds T and U bits (1 byte)
- .set XFLAG,7 | which bit is X flag
- .set UFLAG,5 | which bit is U flag
- .set TFLAG,4 | which bit is T flag
-|
- .set FPTEMP,LV-24 | fptemp (12 bytes)
- .set FPTEMP_EX,FPTEMP | fptemp sign and exponent (2 bytes)
- .set FPTEMP_HI,FPTEMP+4 | fptemp mantissa [63:32] (4 bytes)
- .set FPTEMP_LO,FPTEMP+8 | fptemp mantissa [31:00] (4 bytes)
-|
- .set FPTEMP_SGN,FPTEMP+2 | used to store sign
-|
- .set ETEMP,LV-12 | etemp (12 bytes)
- .set ETEMP_EX,ETEMP | etemp sign and exponent (2 bytes)
- .set ETEMP_HI,ETEMP+4 | etemp mantissa [63:32] (4 bytes)
- .set ETEMP_LO,ETEMP+8 | etemp mantissa [31:00] (4 bytes)
-|
- .set ETEMP_SGN,ETEMP+2 | used to store sign
-|
- .set EXC_SR,4 | exception frame status register
- .set EXC_PC,6 | exception frame program counter
- .set EXC_VEC,10 | exception frame vector (format+vector#)
- .set EXC_EA,12 | exception frame effective address
-|
-|--------------------------------------------------------------------------
-|
-| FPSR/FPCR bits
-|
- .set neg_bit,3 | negative result
- .set z_bit,2 | zero result
- .set inf_bit,1 | infinity result
- .set nan_bit,0 | not-a-number result
-|
- .set q_sn_bit,7 | sign bit of quotient byte
-|
- .set bsun_bit,7 | branch on unordered
- .set snan_bit,6 | signalling nan
- .set operr_bit,5 | operand error
- .set ovfl_bit,4 | overflow
- .set unfl_bit,3 | underflow
- .set dz_bit,2 | divide by zero
- .set inex2_bit,1 | inexact result 2
- .set inex1_bit,0 | inexact result 1
-|
- .set aiop_bit,7 | accrued illegal operation
- .set aovfl_bit,6 | accrued overflow
- .set aunfl_bit,5 | accrued underflow
- .set adz_bit,4 | accrued divide by zero
- .set ainex_bit,3 | accrued inexact
-|
-| FPSR individual bit masks
-|
- .set neg_mask,0x08000000
- .set z_mask,0x04000000
- .set inf_mask,0x02000000
- .set nan_mask,0x01000000
-|
- .set bsun_mask,0x00008000
- .set snan_mask,0x00004000
- .set operr_mask,0x00002000
- .set ovfl_mask,0x00001000
- .set unfl_mask,0x00000800
- .set dz_mask,0x00000400
- .set inex2_mask,0x00000200
- .set inex1_mask,0x00000100
-|
- .set aiop_mask,0x00000080 | accrued illegal operation
- .set aovfl_mask,0x00000040 | accrued overflow
- .set aunfl_mask,0x00000020 | accrued underflow
- .set adz_mask,0x00000010 | accrued divide by zero
- .set ainex_mask,0x00000008 | accrued inexact
-|
-| FPSR combinations used in the FPSP
-|
- .set dzinf_mask,inf_mask+dz_mask+adz_mask
- .set opnan_mask,nan_mask+operr_mask+aiop_mask
- .set nzi_mask,0x01ffffff | clears N, Z, and I
- .set unfinx_mask,unfl_mask+inex2_mask+aunfl_mask+ainex_mask
- .set unf2inx_mask,unfl_mask+inex2_mask+ainex_mask
- .set ovfinx_mask,ovfl_mask+inex2_mask+aovfl_mask+ainex_mask
- .set inx1a_mask,inex1_mask+ainex_mask
- .set inx2a_mask,inex2_mask+ainex_mask
- .set snaniop_mask,nan_mask+snan_mask+aiop_mask
- .set naniop_mask,nan_mask+aiop_mask
- .set neginf_mask,neg_mask+inf_mask
- .set infaiop_mask,inf_mask+aiop_mask
- .set negz_mask,neg_mask+z_mask
- .set opaop_mask,operr_mask+aiop_mask
- .set unfl_inx_mask,unfl_mask+aunfl_mask+ainex_mask
- .set ovfl_inx_mask,ovfl_mask+aovfl_mask+ainex_mask
-|
-|--------------------------------------------------------------------------
-|
-| FPCR rounding modes
-|
- .set x_mode,0x00 | round to extended
- .set s_mode,0x40 | round to single
- .set d_mode,0x80 | round to double
-|
- .set rn_mode,0x00 | round nearest
- .set rz_mode,0x10 | round to zero
- .set rm_mode,0x20 | round to minus infinity
- .set rp_mode,0x30 | round to plus infinity
-|
-|--------------------------------------------------------------------------
-|
-| Miscellaneous equates
-|
- .set signan_bit,6 | signalling nan bit in mantissa
- .set sign_bit,7
-|
- .set rnd_stky_bit,29 | round/sticky bit of mantissa
-| this can only be used if in a data register
- .set sx_mask,0x01800000 | set s and x bits in word $48
-|
- .set LOCAL_EX,0
- .set LOCAL_SGN,2
- .set LOCAL_HI,4
- .set LOCAL_LO,8
- .set LOCAL_GRS,12 | valid ONLY for FP_SCR1, FP_SCR2
-|
-|
- .set norm_tag,0x00 | tag bits in {7:5} position
- .set zero_tag,0x20
- .set inf_tag,0x40
- .set nan_tag,0x60
- .set dnrm_tag,0x80
-|
-| fsave sizes and formats
-|
- .set VER_4,0x40 | fpsp compatible version numbers
-| are in the $40s {$40-$4f}
- .set VER_40,0x40 | original version number
- .set VER_41,0x41 | revision version number
-|
- .set BUSY_SIZE,100 | size of busy frame
- .set BUSY_FRAME,LV-BUSY_SIZE | start of busy frame
-|
- .set UNIMP_40_SIZE,44 | size of orig unimp frame
- .set UNIMP_41_SIZE,52 | size of rev unimp frame
-|
- .set IDLE_SIZE,4 | size of idle frame
- .set IDLE_FRAME,LV-IDLE_SIZE | start of idle frame
-|
-| exception vectors
-|
- .set TRACE_VEC,0x2024 | trace trap
- .set FLINE_VEC,0x002C | 'real' F-line
- .set UNIMP_VEC,0x202C | unimplemented
- .set INEX_VEC,0x00C4
-|
- .set dbl_thresh,0x3C01
- .set sgl_thresh,0x3F81
-|
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/gen_except.s b/c/src/lib/libcpu/m68k/m68040/fpsp/gen_except.s
deleted file mode 100644
index 7bb073d657..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/gen_except.s
+++ /dev/null
@@ -1,470 +0,0 @@
-//
-// $Id$
-//
-// gen_except.sa 3.7 1/16/92
-//
-// gen_except --- FPSP routine to detect reportable exceptions
-//
-// This routine compares the exception enable byte of the
-// user_fpcr on the stack with the exception status byte
-// of the user_fpsr.
-//
-// Any routine which may report an exceptions must load
-// the stack frame in memory with the exceptional operand(s).
-//
-// Priority for exceptions is:
-//
-// Highest: bsun
-// snan
-// operr
-// ovfl
-// unfl
-// dz
-// inex2
-// Lowest: inex1
-//
-// Note: The IEEE standard specifies that inex2 is to be
-// reported if ovfl occurs and the ovfl enable bit is not
-// set but the inex2 enable bit is.
-//
-//
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-GEN_EXCEPT: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref real_trace
- |xref fpsp_done
- |xref fpsp_fmt_error
-
-exc_tbl:
- .long bsun_exc
- .long commonE1
- .long commonE1
- .long ovfl_unfl
- .long ovfl_unfl
- .long commonE1
- .long commonE3
- .long commonE3
- .long no_match
-
- .global gen_except
-gen_except:
- cmpib #IDLE_SIZE-4,1(%a7) //test for idle frame
- beq do_check //go handle idle frame
- cmpib #UNIMP_40_SIZE-4,1(%a7) //test for orig unimp frame
- beqs unimp_x //go handle unimp frame
- cmpib #UNIMP_41_SIZE-4,1(%a7) //test for rev unimp frame
- beqs unimp_x //go handle unimp frame
- cmpib #BUSY_SIZE-4,1(%a7) //if size <> $60, fmt error
- bnel fpsp_fmt_error
- leal BUSY_SIZE+LOCAL_SIZE(%a7),%a1 //init a1 so fpsp.h
-// ;equates will work
-// Fix up the new busy frame with entries from the unimp frame
-//
- movel ETEMP_EX(%a6),ETEMP_EX(%a1) //copy etemp from unimp
- movel ETEMP_HI(%a6),ETEMP_HI(%a1) //frame to busy frame
- movel ETEMP_LO(%a6),ETEMP_LO(%a1)
- movel CMDREG1B(%a6),CMDREG1B(%a1) //set inst in frame to unimp
- movel CMDREG1B(%a6),%d0 //fix cmd1b to make it
- andl #0x03c30000,%d0 //work for cmd3b
- bfextu CMDREG1B(%a6){#13:#1},%d1 //extract bit 2
- lsll #5,%d1
- swap %d1
- orl %d1,%d0 //put it in the right place
- bfextu CMDREG1B(%a6){#10:#3},%d1 //extract bit 3,4,5
- lsll #2,%d1
- swap %d1
- orl %d1,%d0 //put them in the right place
- movel %d0,CMDREG3B(%a1) //in the busy frame
-//
-// Or in the FPSR from the emulation with the USER_FPSR on the stack.
-//
- fmovel %FPSR,%d0
- orl %d0,USER_FPSR(%a6)
- movel USER_FPSR(%a6),FPSR_SHADOW(%a1) //set exc bits
- orl #sx_mask,E_BYTE(%a1)
- bra do_clean
-
-//
-// Frame is an unimp frame possible resulting from an fmove <ea>,fp0
-// that caused an exception
-//
-// a1 is modified to point into the new frame allowing fpsp equates
-// to be valid.
-//
-unimp_x:
- cmpib #UNIMP_40_SIZE-4,1(%a7) //test for orig unimp frame
- bnes test_rev
- leal UNIMP_40_SIZE+LOCAL_SIZE(%a7),%a1
- bras unimp_con
-test_rev:
- cmpib #UNIMP_41_SIZE-4,1(%a7) //test for rev unimp frame
- bnel fpsp_fmt_error //if not $28 or $30
- leal UNIMP_41_SIZE+LOCAL_SIZE(%a7),%a1
-
-unimp_con:
-//
-// Fix up the new unimp frame with entries from the old unimp frame
-//
- movel CMDREG1B(%a6),CMDREG1B(%a1) //set inst in frame to unimp
-//
-// Or in the FPSR from the emulation with the USER_FPSR on the stack.
-//
- fmovel %FPSR,%d0
- orl %d0,USER_FPSR(%a6)
- bra do_clean
-
-//
-// Frame is idle, so check for exceptions reported through
-// USER_FPSR and set the unimp frame accordingly.
-// A7 must be incremented to the point before the
-// idle fsave vector to the unimp vector.
-//
-
-do_check:
- addl #4,%a7 //point A7 back to unimp frame
-//
-// Or in the FPSR from the emulation with the USER_FPSR on the stack.
-//
- fmovel %FPSR,%d0
- orl %d0,USER_FPSR(%a6)
-//
-// On a busy frame, we must clear the nmnexc bits.
-//
- cmpib #BUSY_SIZE-4,1(%a7) //check frame type
- bnes check_fr //if busy, clr nmnexc
- clrw NMNEXC(%a6) //clr nmnexc & nmcexc
- btstb #5,CMDREG1B(%a6) //test for fmove out
- bnes frame_com
- movel USER_FPSR(%a6),FPSR_SHADOW(%a6) //set exc bits
- orl #sx_mask,E_BYTE(%a6)
- bras frame_com
-check_fr:
- cmpb #UNIMP_40_SIZE-4,1(%a7)
- beqs frame_com
- clrw NMNEXC(%a6)
-frame_com:
- moveb FPCR_ENABLE(%a6),%d0 //get fpcr enable byte
- andb FPSR_EXCEPT(%a6),%d0 //and in the fpsr exc byte
- bfffo %d0{#24:#8},%d1 //test for first set bit
- leal exc_tbl,%a0 //load jmp table address
- subib #24,%d1 //normalize bit offset to 0-8
- movel (%a0,%d1.w*4),%a0 //load routine address based
-// ;based on first enabled exc
- jmp (%a0) //jump to routine
-//
-// Bsun is not possible in unimp or unsupp
-//
-bsun_exc:
- bra do_clean
-//
-// The typical work to be done to the unimp frame to report an
-// exception is to set the E1/E3 byte and clr the U flag.
-// commonE1 does this for E1 exceptions, which are snan,
-// operr, and dz. commonE3 does this for E3 exceptions, which
-// are inex2 and inex1, and also clears the E1 exception bit
-// left over from the unimp exception.
-//
-commonE1:
- bsetb #E1,E_BYTE(%a6) //set E1 flag
- bra commonE //go clean and exit
-
-commonE3:
- tstb UFLG_TMP(%a6) //test flag for unsup/unimp state
- bnes unsE3
-uniE3:
- bsetb #E3,E_BYTE(%a6) //set E3 flag
- bclrb #E1,E_BYTE(%a6) //clr E1 from unimp
- bra commonE
-
-unsE3:
- tstb RES_FLG(%a6)
- bnes unsE3_0
-unsE3_1:
- bsetb #E3,E_BYTE(%a6) //set E3 flag
-unsE3_0:
- bclrb #E1,E_BYTE(%a6) //clr E1 flag
- movel CMDREG1B(%a6),%d0
- andl #0x03c30000,%d0 //work for cmd3b
- bfextu CMDREG1B(%a6){#13:#1},%d1 //extract bit 2
- lsll #5,%d1
- swap %d1
- orl %d1,%d0 //put it in the right place
- bfextu CMDREG1B(%a6){#10:#3},%d1 //extract bit 3,4,5
- lsll #2,%d1
- swap %d1
- orl %d1,%d0 //put them in the right place
- movel %d0,CMDREG3B(%a6) //in the busy frame
-
-commonE:
- bclrb #UFLAG,T_BYTE(%a6) //clr U flag from unimp
- bra do_clean //go clean and exit
-//
-// No bits in the enable byte match existing exceptions. Check for
-// the case of the ovfl exc without the ovfl enabled, but with
-// inex2 enabled.
-//
-no_match:
- btstb #inex2_bit,FPCR_ENABLE(%a6) //check for ovfl/inex2 case
- beqs no_exc //if clear, exit
- btstb #ovfl_bit,FPSR_EXCEPT(%a6) //now check ovfl
- beqs no_exc //if clear, exit
- bras ovfl_unfl //go to unfl_ovfl to determine if
-// ;it is an unsupp or unimp exc
-
-// No exceptions are to be reported. If the instruction was
-// unimplemented, no FPU restore is necessary. If it was
-// unsupported, we must perform the restore.
-no_exc:
- tstb UFLG_TMP(%a6) //test flag for unsupp/unimp state
- beqs uni_no_exc
-uns_no_exc:
- tstb RES_FLG(%a6) //check if frestore is needed
- bne do_clean //if clear, no frestore needed
-uni_no_exc:
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- unlk %a6
- bra finish_up
-//
-// Unsupported Data Type Handler:
-// Ovfl:
-// An fmoveout that results in an overflow is reported this way.
-// Unfl:
-// An fmoveout that results in an underflow is reported this way.
-//
-// Unimplemented Instruction Handler:
-// Ovfl:
-// Only scosh, setox, ssinh, stwotox, and scale can set overflow in
-// this manner.
-// Unfl:
-// Stwotox, setox, and scale can set underflow in this manner.
-// Any of the other Library Routines such that f(x)=x in which
-// x is an extended denorm can report an underflow exception.
-// It is the responsibility of the exception-causing exception
-// to make sure that WBTEMP is correct.
-//
-// The exceptional operand is in FP_SCR1.
-//
-ovfl_unfl:
- tstb UFLG_TMP(%a6) //test flag for unsupp/unimp state
- beqs ofuf_con
-//
-// The caller was from an unsupported data type trap. Test if the
-// caller set CU_ONLY. If so, the exceptional operand is expected in
-// FPTEMP, rather than WBTEMP.
-//
- tstb CU_ONLY(%a6) //test if inst is cu-only
- beq unsE3
-// move.w #$fe,CU_SAVEPC(%a6)
- clrb CU_SAVEPC(%a6)
- bsetb #E1,E_BYTE(%a6) //set E1 exception flag
- movew ETEMP_EX(%a6),FPTEMP_EX(%a6)
- movel ETEMP_HI(%a6),FPTEMP_HI(%a6)
- movel ETEMP_LO(%a6),FPTEMP_LO(%a6)
- bsetb #fptemp15_bit,DTAG(%a6) //set fpte15
- bclrb #UFLAG,T_BYTE(%a6) //clr U flag from unimp
- bra do_clean //go clean and exit
-
-ofuf_con:
- moveb (%a7),VER_TMP(%a6) //save version number
- cmpib #BUSY_SIZE-4,1(%a7) //check for busy frame
- beqs busy_fr //if unimp, grow to busy
- cmpib #VER_40,(%a7) //test for orig unimp frame
- bnes try_41 //if not, test for rev frame
- moveql #13,%d0 //need to zero 14 lwords
- bras ofuf_fin
-try_41:
- cmpib #VER_41,(%a7) //test for rev unimp frame
- bnel fpsp_fmt_error //if neither, exit with error
- moveql #11,%d0 //need to zero 12 lwords
-
-ofuf_fin:
- clrl (%a7)
-loop1:
- clrl -(%a7) //clear and dec a7
- dbra %d0,loop1
- moveb VER_TMP(%a6),(%a7)
- moveb #BUSY_SIZE-4,1(%a7) //write busy fmt word.
-busy_fr:
- movel FP_SCR1(%a6),WBTEMP_EX(%a6) //write
- movel FP_SCR1+4(%a6),WBTEMP_HI(%a6) //exceptional op to
- movel FP_SCR1+8(%a6),WBTEMP_LO(%a6) //wbtemp
- bsetb #E3,E_BYTE(%a6) //set E3 flag
- bclrb #E1,E_BYTE(%a6) //make sure E1 is clear
- bclrb #UFLAG,T_BYTE(%a6) //clr U flag
- movel USER_FPSR(%a6),FPSR_SHADOW(%a6)
- orl #sx_mask,E_BYTE(%a6)
- movel CMDREG1B(%a6),%d0 //fix cmd1b to make it
- andl #0x03c30000,%d0 //work for cmd3b
- bfextu CMDREG1B(%a6){#13:#1},%d1 //extract bit 2
- lsll #5,%d1
- swap %d1
- orl %d1,%d0 //put it in the right place
- bfextu CMDREG1B(%a6){#10:#3},%d1 //extract bit 3,4,5
- lsll #2,%d1
- swap %d1
- orl %d1,%d0 //put them in the right place
- movel %d0,CMDREG3B(%a6) //in the busy frame
-
-//
-// Check if the frame to be restored is busy or unimp.
-//** NOTE *** Bug fix for errata (0d43b #3)
-// If the frame is unimp, we must create a busy frame to
-// fix the bug with the nmnexc bits in cases in which they
-// are set by a previous instruction and not cleared by
-// the save. The frame will be unimp only if the final
-// instruction in an emulation routine caused the exception
-// by doing an fmove <ea>,fp0. The exception operand, in
-// internal format, is in fptemp.
-//
-do_clean:
- cmpib #UNIMP_40_SIZE-4,1(%a7)
- bnes do_con
- moveql #13,%d0 //in orig, need to zero 14 lwords
- bras do_build
-do_con:
- cmpib #UNIMP_41_SIZE-4,1(%a7)
- bnes do_restore //frame must be busy
- moveql #11,%d0 //in rev, need to zero 12 lwords
-
-do_build:
- moveb (%a7),VER_TMP(%a6)
- clrl (%a7)
-loop2:
- clrl -(%a7) //clear and dec a7
- dbra %d0,loop2
-//
-// Use a1 as pointer into new frame. a6 is not correct if an unimp or
-// busy frame was created as the result of an exception on the final
-// instruction of an emulation routine.
-//
-// We need to set the nmcexc bits if the exception is E1. Otherwise,
-// the exc taken will be inex2.
-//
- leal BUSY_SIZE+LOCAL_SIZE(%a7),%a1 //init a1 for new frame
- moveb VER_TMP(%a6),(%a7) //write busy fmt word
- moveb #BUSY_SIZE-4,1(%a7)
- movel FP_SCR1(%a6),WBTEMP_EX(%a1) //write
- movel FP_SCR1+4(%a6),WBTEMP_HI(%a1) //exceptional op to
- movel FP_SCR1+8(%a6),WBTEMP_LO(%a1) //wbtemp
-// btst.b #E1,E_BYTE(%a1)
-// beq.b do_restore
- bfextu USER_FPSR(%a6){#17:#4},%d0 //get snan/operr/ovfl/unfl bits
- bfins %d0,NMCEXC(%a1){#4:#4} //and insert them in nmcexc
- movel USER_FPSR(%a6),FPSR_SHADOW(%a1) //set exc bits
- orl #sx_mask,E_BYTE(%a1)
-
-do_restore:
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- frestore (%a7)+
- tstb RES_FLG(%a6) //RES_FLG indicates a "continuation" frame
- beq cont
- bsr bug1384
-cont:
- unlk %a6
-//
-// If trace mode enabled, then go to trace handler. This handler
-// cannot have any fp instructions. If there are fp inst's and an
-// exception has been restored into the machine then the exception
-// will occur upon execution of the fp inst. This is not desirable
-// in the kernel (supervisor mode). See MC68040 manual Section 9.3.8.
-//
-finish_up:
- btstb #7,(%a7) //test T1 in SR
- bnes g_trace
- btstb #6,(%a7) //test T0 in SR
- bnes g_trace
- bral fpsp_done
-//
-// Change integer stack to look like trace stack
-// The address of the instruction that caused the
-// exception is already in the integer stack (is
-// the same as the saved friar)
-//
-// If the current frame is already a 6-word stack then all
-// that needs to be done is to change the vector# to TRACE.
-// If the frame is only a 4-word stack (meaning we got here
-// on an Unsupported data type exception), then we need to grow
-// the stack an extra 2 words and get the FPIAR from the FPU.
-//
-g_trace:
- bftst EXC_VEC-4(%sp){#0:#4}
- bne g_easy
-
- subw #4,%sp // make room
- movel 4(%sp),(%sp)
- movel 8(%sp),4(%sp)
- subw #BUSY_SIZE,%sp
- fsave (%sp)
- fmovel %fpiar,BUSY_SIZE+EXC_EA-4(%sp)
- frestore (%sp)
- addw #BUSY_SIZE,%sp
-
-g_easy:
- movew #TRACE_VEC,EXC_VEC-4(%a7)
- bral real_trace
-//
-// This is a work-around for hardware bug 1384.
-//
-bug1384:
- link %a5,#0
- fsave -(%sp)
- cmpib #0x41,(%sp) // check for correct frame
- beq frame_41
- bgt nofix // if more advanced mask, do nada
-
-frame_40:
- tstb 1(%sp) // check to see if idle
- bne notidle
-idle40:
- clrl (%sp) // get rid of old fsave frame
- movel %d1,USER_D1(%a6) // save d1
- movew #8,%d1 // place unimp frame instead
-loop40: clrl -(%sp)
- dbra %d1,loop40
- movel USER_D1(%a6),%d1 // restore d1
- movel #0x40280000,-(%sp)
- frestore (%sp)+
- unlk %a5
- rts
-
-frame_41:
- tstb 1(%sp) // check to see if idle
- bne notidle
-idle41:
- clrl (%sp) // get rid of old fsave frame
- movel %d1,USER_D1(%a6) // save d1
- movew #10,%d1 // place unimp frame instead
-loop41: clrl -(%sp)
- dbra %d1,loop41
- movel USER_D1(%a6),%d1 // restore d1
- movel #0x41300000,-(%sp)
- frestore (%sp)+
- unlk %a5
- rts
-
-notidle:
- bclrb #etemp15_bit,-40(%a5)
- frestore (%sp)+
- unlk %a5
- rts
-
-nofix:
- frestore (%sp)+
- unlk %a5
- rts
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/get_op.s b/c/src/lib/libcpu/m68k/m68040/fpsp/get_op.s
deleted file mode 100644
index 1ecfa7e957..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/get_op.s
+++ /dev/null
@@ -1,678 +0,0 @@
-//
-// $Id$
-//
-// get_op.sa 3.6 5/19/92
-//
-// get_op.sa 3.5 4/26/91
-//
-// Description: This routine is called by the unsupported format/data
-// type exception handler ('unsupp' - vector 55) and the unimplemented
-// instruction exception handler ('unimp' - vector 11). 'get_op'
-// determines the opclass (0, 2, or 3) and branches to the
-// opclass handler routine. See 68881/2 User's Manual table 4-11
-// for a description of the opclasses.
-//
-// For UNSUPPORTED data/format (exception vector 55) and for
-// UNIMPLEMENTED instructions (exception vector 11) the following
-// applies:
-//
-// - For unnormalized numbers (opclass 0, 2, or 3) the
-// number(s) is normalized and the operand type tag is updated.
-//
-// - For a packed number (opclass 2) the number is unpacked and the
-// operand type tag is updated.
-//
-// - For denormalized numbers (opclass 0 or 2) the number(s) is not
-// changed but passed to the next module. The next module for
-// unimp is do_func, the next module for unsupp is res_func.
-//
-// For UNSUPPORTED data/format (exception vector 55) only the
-// following applies:
-//
-// - If there is a move out with a packed number (opclass 3) the
-// number is packed and written to user memory. For the other
-// opclasses the number(s) are written back to the fsave stack
-// and the instruction is then restored back into the '040. The
-// '040 is then able to complete the instruction.
-//
-// For example:
-// fadd.x fpm,fpn where the fpm contains an unnormalized number.
-// The '040 takes an unsupported data trap and gets to this
-// routine. The number is normalized, put back on the stack and
-// then an frestore is done to restore the instruction back into
-// the '040. The '040 then re-executes the fadd.x fpm,fpn with
-// a normalized number in the source and the instruction is
-// successful.
-//
-// Next consider if in the process of normalizing the un-
-// normalized number it becomes a denormalized number. The
-// routine which converts the unnorm to a norm (called mk_norm)
-// detects this and tags the number as a denorm. The routine
-// res_func sees the denorm tag and converts the denorm to a
-// norm. The instruction is then restored back into the '040
-// which re_executes the instruction.
-//
-//
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-GET_OP: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- .global PIRN,PIRZRM,PIRP
- .global SMALRN,SMALRZRM,SMALRP
- .global BIGRN,BIGRZRM,BIGRP
-
-PIRN:
- .long 0x40000000,0xc90fdaa2,0x2168c235 //pi
-PIRZRM:
- .long 0x40000000,0xc90fdaa2,0x2168c234 //pi
-PIRP:
- .long 0x40000000,0xc90fdaa2,0x2168c235 //pi
-
-//round to nearest
-SMALRN:
- .long 0x3ffd0000,0x9a209a84,0xfbcff798 //log10(2)
- .long 0x40000000,0xadf85458,0xa2bb4a9a //e
- .long 0x3fff0000,0xb8aa3b29,0x5c17f0bc //log2(e)
- .long 0x3ffd0000,0xde5bd8a9,0x37287195 //log10(e)
- .long 0x00000000,0x00000000,0x00000000 //0.0
-// round to zero;round to negative infinity
-SMALRZRM:
- .long 0x3ffd0000,0x9a209a84,0xfbcff798 //log10(2)
- .long 0x40000000,0xadf85458,0xa2bb4a9a //e
- .long 0x3fff0000,0xb8aa3b29,0x5c17f0bb //log2(e)
- .long 0x3ffd0000,0xde5bd8a9,0x37287195 //log10(e)
- .long 0x00000000,0x00000000,0x00000000 //0.0
-// round to positive infinity
-SMALRP:
- .long 0x3ffd0000,0x9a209a84,0xfbcff799 //log10(2)
- .long 0x40000000,0xadf85458,0xa2bb4a9b //e
- .long 0x3fff0000,0xb8aa3b29,0x5c17f0bc //log2(e)
- .long 0x3ffd0000,0xde5bd8a9,0x37287195 //log10(e)
- .long 0x00000000,0x00000000,0x00000000 //0.0
-
-//round to nearest
-BIGRN:
- .long 0x3ffe0000,0xb17217f7,0xd1cf79ac //ln(2)
- .long 0x40000000,0x935d8ddd,0xaaa8ac17 //ln(10)
- .long 0x3fff0000,0x80000000,0x00000000 //10 ^ 0
-
- .global PTENRN
-PTENRN:
- .long 0x40020000,0xA0000000,0x00000000 //10 ^ 1
- .long 0x40050000,0xC8000000,0x00000000 //10 ^ 2
- .long 0x400C0000,0x9C400000,0x00000000 //10 ^ 4
- .long 0x40190000,0xBEBC2000,0x00000000 //10 ^ 8
- .long 0x40340000,0x8E1BC9BF,0x04000000 //10 ^ 16
- .long 0x40690000,0x9DC5ADA8,0x2B70B59E //10 ^ 32
- .long 0x40D30000,0xC2781F49,0xFFCFA6D5 //10 ^ 64
- .long 0x41A80000,0x93BA47C9,0x80E98CE0 //10 ^ 128
- .long 0x43510000,0xAA7EEBFB,0x9DF9DE8E //10 ^ 256
- .long 0x46A30000,0xE319A0AE,0xA60E91C7 //10 ^ 512
- .long 0x4D480000,0xC9767586,0x81750C17 //10 ^ 1024
- .long 0x5A920000,0x9E8B3B5D,0xC53D5DE5 //10 ^ 2048
- .long 0x75250000,0xC4605202,0x8A20979B //10 ^ 4096
-//round to minus infinity
-BIGRZRM:
- .long 0x3ffe0000,0xb17217f7,0xd1cf79ab //ln(2)
- .long 0x40000000,0x935d8ddd,0xaaa8ac16 //ln(10)
- .long 0x3fff0000,0x80000000,0x00000000 //10 ^ 0
-
- .global PTENRM
-PTENRM:
- .long 0x40020000,0xA0000000,0x00000000 //10 ^ 1
- .long 0x40050000,0xC8000000,0x00000000 //10 ^ 2
- .long 0x400C0000,0x9C400000,0x00000000 //10 ^ 4
- .long 0x40190000,0xBEBC2000,0x00000000 //10 ^ 8
- .long 0x40340000,0x8E1BC9BF,0x04000000 //10 ^ 16
- .long 0x40690000,0x9DC5ADA8,0x2B70B59D //10 ^ 32
- .long 0x40D30000,0xC2781F49,0xFFCFA6D5 //10 ^ 64
- .long 0x41A80000,0x93BA47C9,0x80E98CDF //10 ^ 128
- .long 0x43510000,0xAA7EEBFB,0x9DF9DE8D //10 ^ 256
- .long 0x46A30000,0xE319A0AE,0xA60E91C6 //10 ^ 512
- .long 0x4D480000,0xC9767586,0x81750C17 //10 ^ 1024
- .long 0x5A920000,0x9E8B3B5D,0xC53D5DE5 //10 ^ 2048
- .long 0x75250000,0xC4605202,0x8A20979A //10 ^ 4096
-//round to positive infinity
-BIGRP:
- .long 0x3ffe0000,0xb17217f7,0xd1cf79ac //ln(2)
- .long 0x40000000,0x935d8ddd,0xaaa8ac17 //ln(10)
- .long 0x3fff0000,0x80000000,0x00000000 //10 ^ 0
-
- .global PTENRP
-PTENRP:
- .long 0x40020000,0xA0000000,0x00000000 //10 ^ 1
- .long 0x40050000,0xC8000000,0x00000000 //10 ^ 2
- .long 0x400C0000,0x9C400000,0x00000000 //10 ^ 4
- .long 0x40190000,0xBEBC2000,0x00000000 //10 ^ 8
- .long 0x40340000,0x8E1BC9BF,0x04000000 //10 ^ 16
- .long 0x40690000,0x9DC5ADA8,0x2B70B59E //10 ^ 32
- .long 0x40D30000,0xC2781F49,0xFFCFA6D6 //10 ^ 64
- .long 0x41A80000,0x93BA47C9,0x80E98CE0 //10 ^ 128
- .long 0x43510000,0xAA7EEBFB,0x9DF9DE8E //10 ^ 256
- .long 0x46A30000,0xE319A0AE,0xA60E91C7 //10 ^ 512
- .long 0x4D480000,0xC9767586,0x81750C18 //10 ^ 1024
- .long 0x5A920000,0x9E8B3B5D,0xC53D5DE6 //10 ^ 2048
- .long 0x75250000,0xC4605202,0x8A20979B //10 ^ 4096
-
- |xref nrm_zero
- |xref decbin
- |xref round
-
- .global get_op
- .global uns_getop
- .global uni_getop
-get_op:
- clrb DY_MO_FLG(%a6)
- tstb UFLG_TMP(%a6) //test flag for unsupp/unimp state
- beqs uni_getop
-
-uns_getop:
- btstb #direction_bit,CMDREG1B(%a6)
- bne opclass3 //branch if a fmove out (any kind)
- btstb #6,CMDREG1B(%a6)
- beqs uns_notpacked
-
- bfextu CMDREG1B(%a6){#3:#3},%d0
- cmpb #3,%d0
- beq pack_source //check for a packed src op, branch if so
-uns_notpacked:
- bsr chk_dy_mo //set the dyadic/monadic flag
- tstb DY_MO_FLG(%a6)
- beqs src_op_ck //if monadic, go check src op
-// ;else, check dst op (fall through)
-
- btstb #7,DTAG(%a6)
- beqs src_op_ck //if dst op is norm, check src op
- bras dst_ex_dnrm //else, handle destination unnorm/dnrm
-
-uni_getop:
- bfextu CMDREG1B(%a6){#0:#6},%d0 //get opclass and src fields
- cmpil #0x17,%d0 //if op class and size fields are $17,
-// ;it is FMOVECR; if not, continue
-//
-// If the instruction is fmovecr, exit get_op. It is handled
-// in do_func and smovecr.sa.
-//
- bne not_fmovecr //handle fmovecr as an unimplemented inst
- rts
-
-not_fmovecr:
- btstb #E1,E_BYTE(%a6) //if set, there is a packed operand
- bne pack_source //check for packed src op, branch if so
-
-// The following lines of are coded to optimize on normalized operands
- moveb STAG(%a6),%d0
- orb DTAG(%a6),%d0 //check if either of STAG/DTAG msb set
- bmis dest_op_ck //if so, some op needs to be fixed
- rts
-
-dest_op_ck:
- btstb #7,DTAG(%a6) //check for unsupported data types in
- beqs src_op_ck //the destination, if not, check src op
- bsr chk_dy_mo //set dyadic/monadic flag
- tstb DY_MO_FLG(%a6) //
- beqs src_op_ck //if monadic, check src op
-//
-// At this point, destination has an extended denorm or unnorm.
-//
-dst_ex_dnrm:
- movew FPTEMP_EX(%a6),%d0 //get destination exponent
- andiw #0x7fff,%d0 //mask sign, check if exp = 0000
- beqs src_op_ck //if denorm then check source op.
-// ;denorms are taken care of in res_func
-// ;(unsupp) or do_func (unimp)
-// ;else unnorm fall through
- leal FPTEMP(%a6),%a0 //point a0 to dop - used in mk_norm
- bsr mk_norm //go normalize - mk_norm returns:
-// ;L_SCR1{7:5} = operand tag
-// ; (000 = norm, 100 = denorm)
-// ;L_SCR1{4} = fpte15 or ete15
-// ; 0 = exp > $3fff
-// ; 1 = exp <= $3fff
-// ;and puts the normalized num back
-// ;on the fsave stack
-//
- moveb L_SCR1(%a6),DTAG(%a6) //write the new tag & fpte15
-// ;to the fsave stack and fall
-// ;through to check source operand
-//
-src_op_ck:
- btstb #7,STAG(%a6)
- beq end_getop //check for unsupported data types on the
-// ;source operand
- btstb #5,STAG(%a6)
- bnes src_sd_dnrm //if bit 5 set, handle sgl/dbl denorms
-//
-// At this point only unnorms or extended denorms are possible.
-//
-src_ex_dnrm:
- movew ETEMP_EX(%a6),%d0 //get source exponent
- andiw #0x7fff,%d0 //mask sign, check if exp = 0000
- beq end_getop //if denorm then exit, denorms are
-// ;handled in do_func
- leal ETEMP(%a6),%a0 //point a0 to sop - used in mk_norm
- bsr mk_norm //go normalize - mk_norm returns:
-// ;L_SCR1{7:5} = operand tag
-// ; (000 = norm, 100 = denorm)
-// ;L_SCR1{4} = fpte15 or ete15
-// ; 0 = exp > $3fff
-// ; 1 = exp <= $3fff
-// ;and puts the normalized num back
-// ;on the fsave stack
-//
- moveb L_SCR1(%a6),STAG(%a6) //write the new tag & ete15
- rts //end_getop
-
-//
-// At this point, only single or double denorms are possible.
-// If the inst is not fmove, normalize the source. If it is,
-// do nothing to the input.
-//
-src_sd_dnrm:
- btstb #4,CMDREG1B(%a6) //differentiate between sgl/dbl denorm
- bnes is_double
-is_single:
- movew #0x3f81,%d1 //write bias for sgl denorm
- bras common //goto the common code
-is_double:
- movew #0x3c01,%d1 //write the bias for a dbl denorm
-common:
- btstb #sign_bit,ETEMP_EX(%a6) //grab sign bit of mantissa
- beqs pos
- bset #15,%d1 //set sign bit because it is negative
-pos:
- movew %d1,ETEMP_EX(%a6)
-// ;put exponent on stack
-
- movew CMDREG1B(%a6),%d1
- andw #0xe3ff,%d1 //clear out source specifier
- orw #0x0800,%d1 //set source specifier to extended prec
- movew %d1,CMDREG1B(%a6) //write back to the command word in stack
-// ;this is needed to fix unsupp data stack
- leal ETEMP(%a6),%a0 //point a0 to sop
-
- bsr mk_norm //convert sgl/dbl denorm to norm
- moveb L_SCR1(%a6),STAG(%a6) //put tag into source tag reg - d0
- rts //end_getop
-//
-// At this point, the source is definitely packed, whether
-// instruction is dyadic or monadic is still unknown
-//
-pack_source:
- movel FPTEMP_LO(%a6),ETEMP(%a6) //write ms part of packed
-// ;number to etemp slot
- bsr chk_dy_mo //set dyadic/monadic flag
- bsr unpack
-
- tstb DY_MO_FLG(%a6)
- beqs end_getop //if monadic, exit
-// ;else, fix FPTEMP
-pack_dya:
- bfextu CMDREG1B(%a6){#6:#3},%d0 //extract dest fp reg
- movel #7,%d1
- subl %d0,%d1
- clrl %d0
- bsetl %d1,%d0 //set up d0 as a dynamic register mask
- fmovemx %d0,FPTEMP(%a6) //write to FPTEMP
-
- btstb #7,DTAG(%a6) //check dest tag for unnorm or denorm
- bne dst_ex_dnrm //else, handle the unnorm or ext denorm
-//
-// Dest is not denormalized. Check for norm, and set fpte15
-// accordingly.
-//
- moveb DTAG(%a6),%d0
- andib #0xf0,%d0 //strip to only dtag:fpte15
- tstb %d0 //check for normalized value
- bnes end_getop //if inf/nan/zero leave get_op
- movew FPTEMP_EX(%a6),%d0
- andiw #0x7fff,%d0
- cmpiw #0x3fff,%d0 //check if fpte15 needs setting
- bges end_getop //if >= $3fff, leave fpte15=0
- orb #0x10,DTAG(%a6)
- bras end_getop
-
-//
-// At this point, it is either an fmoveout packed, unnorm or denorm
-//
-opclass3:
- clrb DY_MO_FLG(%a6) //set dyadic/monadic flag to monadic
- bfextu CMDREG1B(%a6){#4:#2},%d0
- cmpib #3,%d0
- bne src_ex_dnrm //if not equal, must be unnorm or denorm
-// ;else it is a packed move out
-// ;exit
-end_getop:
- rts
-
-//
-// Sets the DY_MO_FLG correctly. This is used only on if it is an
-// unsupported data type exception. Set if dyadic.
-//
-chk_dy_mo:
- movew CMDREG1B(%a6),%d0
- btstl #5,%d0 //testing extension command word
- beqs set_mon //if bit 5 = 0 then monadic
- btstl #4,%d0 //know that bit 5 = 1
- beqs set_dya //if bit 4 = 0 then dyadic
- andiw #0x007f,%d0 //get rid of all but extension bits {6:0}
- cmpiw #0x0038,%d0 //if extension = $38 then fcmp (dyadic)
- bnes set_mon
-set_dya:
- st DY_MO_FLG(%a6) //set the inst flag type to dyadic
- rts
-set_mon:
- clrb DY_MO_FLG(%a6) //set the inst flag type to monadic
- rts
-//
-// MK_NORM
-//
-// Normalizes unnormalized numbers, sets tag to norm or denorm, sets unfl
-// exception if denorm.
-//
-// CASE opclass 0x0 unsupp
-// mk_norm till msb set
-// set tag = norm
-//
-// CASE opclass 0x0 unimp
-// mk_norm till msb set or exp = 0
-// if integer bit = 0
-// tag = denorm
-// else
-// tag = norm
-//
-// CASE opclass 011 unsupp
-// mk_norm till msb set or exp = 0
-// if integer bit = 0
-// tag = denorm
-// set unfl_nmcexe = 1
-// else
-// tag = norm
-//
-// if exp <= $3fff
-// set ete15 or fpte15 = 1
-// else set ete15 or fpte15 = 0
-
-// input:
-// a0 = points to operand to be normalized
-// output:
-// L_SCR1{7:5} = operand tag (000 = norm, 100 = denorm)
-// L_SCR1{4} = fpte15 or ete15 (0 = exp > $3fff, 1 = exp <=$3fff)
-// the normalized operand is placed back on the fsave stack
-mk_norm:
- clrl L_SCR1(%a6)
- bclrb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0) //transform into internal extended format
-
- cmpib #0x2c,1+EXC_VEC(%a6) //check if unimp
- bnes uns_data //branch if unsupp
- bsr uni_inst //call if unimp (opclass 0x0)
- bras reload
-uns_data:
- btstb #direction_bit,CMDREG1B(%a6) //check transfer direction
- bnes bit_set //branch if set (opclass 011)
- bsr uns_opx //call if opclass 0x0
- bras reload
-bit_set:
- bsr uns_op3 //opclass 011
-reload:
- cmpw #0x3fff,LOCAL_EX(%a0) //if exp > $3fff
- bgts end_mk // fpte15/ete15 already set to 0
- bsetb #4,L_SCR1(%a6) //else set fpte15/ete15 to 1
-// ;calling routine actually sets the
-// ;value on the stack (along with the
-// ;tag), since this routine doesn't
-// ;know if it should set ete15 or fpte15
-// ;ie, it doesn't know if this is the
-// ;src op or dest op.
-end_mk:
- bfclr LOCAL_SGN(%a0){#0:#8}
- beqs end_mk_pos
- bsetb #sign_bit,LOCAL_EX(%a0) //convert back to IEEE format
-end_mk_pos:
- rts
-//
-// CASE opclass 011 unsupp
-//
-uns_op3:
- bsr nrm_zero //normalize till msb = 1 or exp = zero
- btstb #7,LOCAL_HI(%a0) //if msb = 1
- bnes no_unfl //then branch
-set_unfl:
- orw #dnrm_tag,L_SCR1(%a6) //set denorm tag
- bsetb #unfl_bit,FPSR_EXCEPT(%a6) //set unfl exception bit
-no_unfl:
- rts
-//
-// CASE opclass 0x0 unsupp
-//
-uns_opx:
- bsr nrm_zero //normalize the number
- btstb #7,LOCAL_HI(%a0) //check if integer bit (j-bit) is set
- beqs uns_den //if clear then now have a denorm
-uns_nrm:
- orb #norm_tag,L_SCR1(%a6) //set tag to norm
- rts
-uns_den:
- orb #dnrm_tag,L_SCR1(%a6) //set tag to denorm
- rts
-//
-// CASE opclass 0x0 unimp
-//
-uni_inst:
- bsr nrm_zero
- btstb #7,LOCAL_HI(%a0) //check if integer bit (j-bit) is set
- beqs uni_den //if clear then now have a denorm
-uni_nrm:
- orb #norm_tag,L_SCR1(%a6) //set tag to norm
- rts
-uni_den:
- orb #dnrm_tag,L_SCR1(%a6) //set tag to denorm
- rts
-
-//
-// Decimal to binary conversion
-//
-// Special cases of inf and NaNs are completed outside of decbin.
-// If the input is an snan, the snan bit is not set.
-//
-// input:
-// ETEMP(a6) - points to packed decimal string in memory
-// output:
-// fp0 - contains packed string converted to extended precision
-// ETEMP - same as fp0
-unpack:
- movew CMDREG1B(%a6),%d0 //examine command word, looking for fmove's
- andw #0x3b,%d0
- beq move_unpack //special handling for fmove: must set FPSR_CC
-
- movew ETEMP(%a6),%d0 //get word with inf information
- bfextu %d0{#20:#12},%d1 //get exponent into d1
- cmpiw #0x0fff,%d1 //test for inf or NaN
- bnes try_zero //if not equal, it is not special
- bfextu %d0{#17:#3},%d1 //get SE and y bits into d1
- cmpiw #7,%d1 //SE and y bits must be on for special
- bnes try_zero //if not on, it is not special
-//input is of the special cases of inf and NaN
- tstl ETEMP_HI(%a6) //check ms mantissa
- bnes fix_nan //if non-zero, it is a NaN
- tstl ETEMP_LO(%a6) //check ls mantissa
- bnes fix_nan //if non-zero, it is a NaN
- bra finish //special already on stack
-fix_nan:
- btstb #signan_bit,ETEMP_HI(%a6) //test for snan
- bne finish
- orl #snaniop_mask,USER_FPSR(%a6) //always set snan if it is so
- bra finish
-try_zero:
- movew ETEMP_EX+2(%a6),%d0 //get word 4
- andiw #0x000f,%d0 //clear all but last ni(y)bble
- tstw %d0 //check for zero.
- bne not_spec
- tstl ETEMP_HI(%a6) //check words 3 and 2
- bne not_spec
- tstl ETEMP_LO(%a6) //check words 1 and 0
- bne not_spec
- tstl ETEMP(%a6) //test sign of the zero
- bges pos_zero
- movel #0x80000000,ETEMP(%a6) //write neg zero to etemp
- clrl ETEMP_HI(%a6)
- clrl ETEMP_LO(%a6)
- bra finish
-pos_zero:
- clrl ETEMP(%a6)
- clrl ETEMP_HI(%a6)
- clrl ETEMP_LO(%a6)
- bra finish
-
-not_spec:
- fmovemx %fp0-%fp1,-(%a7) //save fp0 - decbin returns in it
- bsr decbin
- fmovex %fp0,ETEMP(%a6) //put the unpacked sop in the fsave stack
- fmovemx (%a7)+,%fp0-%fp1
- fmovel #0,%FPSR //clr fpsr from decbin
- bra finish
-
-//
-// Special handling for packed move in: Same results as all other
-// packed cases, but we must set the FPSR condition codes properly.
-//
-move_unpack:
- movew ETEMP(%a6),%d0 //get word with inf information
- bfextu %d0{#20:#12},%d1 //get exponent into d1
- cmpiw #0x0fff,%d1 //test for inf or NaN
- bnes mtry_zero //if not equal, it is not special
- bfextu %d0{#17:#3},%d1 //get SE and y bits into d1
- cmpiw #7,%d1 //SE and y bits must be on for special
- bnes mtry_zero //if not on, it is not special
-//input is of the special cases of inf and NaN
- tstl ETEMP_HI(%a6) //check ms mantissa
- bnes mfix_nan //if non-zero, it is a NaN
- tstl ETEMP_LO(%a6) //check ls mantissa
- bnes mfix_nan //if non-zero, it is a NaN
-//input is inf
- orl #inf_mask,USER_FPSR(%a6) //set I bit
- tstl ETEMP(%a6) //check sign
- bge finish
- orl #neg_mask,USER_FPSR(%a6) //set N bit
- bra finish //special already on stack
-mfix_nan:
- orl #nan_mask,USER_FPSR(%a6) //set NaN bit
- moveb #nan_tag,STAG(%a6) //set stag to NaN
- btstb #signan_bit,ETEMP_HI(%a6) //test for snan
- bnes mn_snan
- orl #snaniop_mask,USER_FPSR(%a6) //set snan bit
- btstb #snan_bit,FPCR_ENABLE(%a6) //test for snan enabled
- bnes mn_snan
- bsetb #signan_bit,ETEMP_HI(%a6) //force snans to qnans
-mn_snan:
- tstl ETEMP(%a6) //check for sign
- bge finish //if clr, go on
- orl #neg_mask,USER_FPSR(%a6) //set N bit
- bra finish
-
-mtry_zero:
- movew ETEMP_EX+2(%a6),%d0 //get word 4
- andiw #0x000f,%d0 //clear all but last ni(y)bble
- tstw %d0 //check for zero.
- bnes mnot_spec
- tstl ETEMP_HI(%a6) //check words 3 and 2
- bnes mnot_spec
- tstl ETEMP_LO(%a6) //check words 1 and 0
- bnes mnot_spec
- tstl ETEMP(%a6) //test sign of the zero
- bges mpos_zero
- orl #neg_mask+z_mask,USER_FPSR(%a6) //set N and Z
- movel #0x80000000,ETEMP(%a6) //write neg zero to etemp
- clrl ETEMP_HI(%a6)
- clrl ETEMP_LO(%a6)
- bras finish
-mpos_zero:
- orl #z_mask,USER_FPSR(%a6) //set Z
- clrl ETEMP(%a6)
- clrl ETEMP_HI(%a6)
- clrl ETEMP_LO(%a6)
- bras finish
-
-mnot_spec:
- fmovemx %fp0-%fp1,-(%a7) //save fp0 ,fp1 - decbin returns in fp0
- bsr decbin
- fmovex %fp0,ETEMP(%a6)
-// ;put the unpacked sop in the fsave stack
- fmovemx (%a7)+,%fp0-%fp1
-
-finish:
- movew CMDREG1B(%a6),%d0 //get the command word
- andw #0xfbff,%d0 //change the source specifier field to
-// ;extended (was packed).
- movew %d0,CMDREG1B(%a6) //write command word back to fsave stack
-// ;we need to do this so the 040 will
-// ;re-execute the inst. without taking
-// ;another packed trap.
-
-fix_stag:
-//Converted result is now in etemp on fsave stack, now set the source
-//tag (stag)
-// if (ete =$7fff) then INF or NAN
-// if (etemp = $x.0----0) then
-// stag = INF
-// else
-// stag = NAN
-// else
-// if (ete = $0000) then
-// stag = ZERO
-// else
-// stag = NORM
-//
-// Note also that the etemp_15 bit (just right of the stag) must
-// be set accordingly.
-//
- movew ETEMP_EX(%a6),%d1
- andiw #0x7fff,%d1 //strip sign
- cmpw #0x7fff,%d1
- bnes z_or_nrm
- movel ETEMP_HI(%a6),%d1
- bnes is_nan
- movel ETEMP_LO(%a6),%d1
- bnes is_nan
-is_inf:
- moveb #0x40,STAG(%a6)
- movel #0x40,%d0
- rts
-is_nan:
- moveb #0x60,STAG(%a6)
- movel #0x60,%d0
- rts
-z_or_nrm:
- tstw %d1
- bnes is_nrm
-is_zro:
-// For a zero, set etemp_15
- moveb #0x30,STAG(%a6)
- movel #0x20,%d0
- rts
-is_nrm:
-// For a norm, check if the exp <= $3fff; if so, set etemp_15
- cmpiw #0x3fff,%d1
- bles set_bit15
- moveb #0,STAG(%a6)
- bras end_is_nrm
-set_bit15:
- moveb #0x10,STAG(%a6)
-end_is_nrm:
- movel #0,%d0
-end_fix:
- rts
-
-end_get:
- rts
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/kernel_ex.s b/c/src/lib/libcpu/m68k/m68040/fpsp/kernel_ex.s
deleted file mode 100644
index c4fd6812af..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/kernel_ex.s
+++ /dev/null
@@ -1,496 +0,0 @@
-//
-// $Id$
-//
-// kernel_ex.sa 3.3 12/19/90
-//
-// This file contains routines to force exception status in the
-// fpu for exceptional cases detected or reported within the
-// transcendental functions. Typically, the t_xx routine will
-// set the appropriate bits in the USER_FPSR word on the stack.
-// The bits are tested in gen_except.sa to determine if an exceptional
-// situation needs to be created on return from the FPSP.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-KERNEL_EX: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
-mns_inf: .long 0xffff0000,0x00000000,0x00000000
-pls_inf: .long 0x7fff0000,0x00000000,0x00000000
-nan: .long 0x7fff0000,0xffffffff,0xffffffff
-huge: .long 0x7ffe0000,0xffffffff,0xffffffff
-
- |xref ovf_r_k
- |xref unf_sub
- |xref nrm_set
-
- .global t_dz
- .global t_dz2
- .global t_operr
- .global t_unfl
- .global t_ovfl
- .global t_ovfl2
- .global t_inx2
- .global t_frcinx
- .global t_extdnrm
- .global t_resdnrm
- .global dst_nan
- .global src_nan
-//
-// DZ exception
-//
-//
-// if dz trap disabled
-// store properly signed inf (use sign of etemp) into fp0
-// set FPSR exception status dz bit, condition code
-// inf bit, and accrued dz bit
-// return
-// frestore the frame into the machine (done by unimp_hd)
-//
-// else dz trap enabled
-// set exception status bit & accrued bits in FPSR
-// set flag to disable sto_res from corrupting fp register
-// return
-// frestore the frame into the machine (done by unimp_hd)
-//
-// t_dz2 is used by monadic functions such as flogn (from do_func).
-// t_dz is used by monadic functions such as satanh (from the
-// transcendental function).
-//
-t_dz2:
- bsetb #neg_bit,FPSR_CC(%a6) //set neg bit in FPSR
- fmovel #0,%FPSR //clr status bits (Z set)
- btstb #dz_bit,FPCR_ENABLE(%a6) //test FPCR for dz exc enabled
- bnes dz_ena_end
- bras m_inf //flogx always returns -inf
-t_dz:
- fmovel #0,%FPSR //clr status bits (Z set)
- btstb #dz_bit,FPCR_ENABLE(%a6) //test FPCR for dz exc enabled
- bnes dz_ena
-//
-// dz disabled
-//
- btstb #sign_bit,ETEMP_EX(%a6) //check sign for neg or pos
- beqs p_inf //branch if pos sign
-
-m_inf:
- fmovemx mns_inf,%fp0-%fp0 //load -inf
- bsetb #neg_bit,FPSR_CC(%a6) //set neg bit in FPSR
- bras set_fpsr
-p_inf:
- fmovemx pls_inf,%fp0-%fp0 //load +inf
-set_fpsr:
- orl #dzinf_mask,USER_FPSR(%a6) //set I,DZ,ADZ
- rts
-//
-// dz enabled
-//
-dz_ena:
- btstb #sign_bit,ETEMP_EX(%a6) //check sign for neg or pos
- beqs dz_ena_end
- bsetb #neg_bit,FPSR_CC(%a6) //set neg bit in FPSR
-dz_ena_end:
- orl #dzinf_mask,USER_FPSR(%a6) //set I,DZ,ADZ
- st STORE_FLG(%a6)
- rts
-//
-// OPERR exception
-//
-// if (operr trap disabled)
-// set FPSR exception status operr bit, condition code
-// nan bit; Store default NAN into fp0
-// frestore the frame into the machine (done by unimp_hd)
-//
-// else (operr trap enabled)
-// set FPSR exception status operr bit, accrued operr bit
-// set flag to disable sto_res from corrupting fp register
-// frestore the frame into the machine (done by unimp_hd)
-//
-t_operr:
- orl #opnan_mask,USER_FPSR(%a6) //set NaN, OPERR, AIOP
-
- btstb #operr_bit,FPCR_ENABLE(%a6) //test FPCR for operr enabled
- bnes op_ena
-
- fmovemx nan,%fp0-%fp0 //load default nan
- rts
-op_ena:
- st STORE_FLG(%a6) //do not corrupt destination
- rts
-
-//
-// t_unfl --- UNFL exception
-//
-// This entry point is used by all routines requiring unfl, inex2,
-// aunfl, and ainex to be set on exit.
-//
-// On entry, a0 points to the exceptional operand. The final exceptional
-// operand is built in FP_SCR1 and only the sign from the original operand
-// is used.
-//
-t_unfl:
- clrl FP_SCR1(%a6) //set exceptional operand to zero
- clrl FP_SCR1+4(%a6)
- clrl FP_SCR1+8(%a6)
- tstb (%a0) //extract sign from caller's exop
- bpls unfl_signok
- bset #sign_bit,FP_SCR1(%a6)
-unfl_signok:
- leal FP_SCR1(%a6),%a0
- orl #unfinx_mask,USER_FPSR(%a6)
-// ;set UNFL, INEX2, AUNFL, AINEX
-unfl_con:
- btstb #unfl_bit,FPCR_ENABLE(%a6)
- beqs unfl_dis
-
-unfl_ena:
- bfclr STAG(%a6){#5:#3} //clear wbtm66,wbtm1,wbtm0
- bsetb #wbtemp15_bit,WB_BYTE(%a6) //set wbtemp15
- bsetb #sticky_bit,STICKY(%a6) //set sticky bit
-
- bclrb #E1,E_BYTE(%a6)
-
-unfl_dis:
- bfextu FPCR_MODE(%a6){#0:#2},%d0 //get round precision
-
- bclrb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0) //convert to internal ext format
-
- bsr unf_sub //returns IEEE result at a0
-// ;and sets FPSR_CC accordingly
-
- bfclr LOCAL_SGN(%a0){#0:#8} //convert back to IEEE ext format
- beqs unfl_fin
-
- bsetb #sign_bit,LOCAL_EX(%a0)
- bsetb #sign_bit,FP_SCR1(%a6) //set sign bit of exc operand
-
-unfl_fin:
- fmovemx (%a0),%fp0-%fp0 //store result in fp0
- rts
-
-
-//
-// t_ovfl2 --- OVFL exception (without inex2 returned)
-//
-// This entry is used by scale to force catastrophic overflow. The
-// ovfl, aovfl, and ainex bits are set, but not the inex2 bit.
-//
-t_ovfl2:
- orl #ovfl_inx_mask,USER_FPSR(%a6)
- movel ETEMP(%a6),FP_SCR1(%a6)
- movel ETEMP_HI(%a6),FP_SCR1+4(%a6)
- movel ETEMP_LO(%a6),FP_SCR1+8(%a6)
-//
-// Check for single or double round precision. If single, check if
-// the lower 40 bits of ETEMP are zero; if not, set inex2. If double,
-// check if the lower 21 bits are zero; if not, set inex2.
-//
- moveb FPCR_MODE(%a6),%d0
- andib #0xc0,%d0
- beq t_work //if extended, finish ovfl processing
- cmpib #0x40,%d0 //test for single
- bnes t_dbl
-t_sgl:
- tstb ETEMP_LO(%a6)
- bnes t_setinx2
- movel ETEMP_HI(%a6),%d0
- andil #0xff,%d0 //look at only lower 8 bits
- bnes t_setinx2
- bra t_work
-t_dbl:
- movel ETEMP_LO(%a6),%d0
- andil #0x7ff,%d0 //look at only lower 11 bits
- beq t_work
-t_setinx2:
- orl #inex2_mask,USER_FPSR(%a6)
- bras t_work
-//
-// t_ovfl --- OVFL exception
-//
-//** Note: the exc operand is returned in ETEMP.
-//
-t_ovfl:
- orl #ovfinx_mask,USER_FPSR(%a6)
-t_work:
- btstb #ovfl_bit,FPCR_ENABLE(%a6) //test FPCR for ovfl enabled
- beqs ovf_dis
-
-ovf_ena:
- clrl FP_SCR1(%a6) //set exceptional operand
- clrl FP_SCR1+4(%a6)
- clrl FP_SCR1+8(%a6)
-
- bfclr STAG(%a6){#5:#3} //clear wbtm66,wbtm1,wbtm0
- bclrb #wbtemp15_bit,WB_BYTE(%a6) //clear wbtemp15
- bsetb #sticky_bit,STICKY(%a6) //set sticky bit
-
- bclrb #E1,E_BYTE(%a6)
-// ;fall through to disabled case
-
-// For disabled overflow call 'ovf_r_k'. This routine loads the
-// correct result based on the rounding precision, destination
-// format, rounding mode and sign.
-//
-ovf_dis:
- bsr ovf_r_k //returns unsigned ETEMP_EX
-// ;and sets FPSR_CC accordingly.
- bfclr ETEMP_SGN(%a6){#0:#8} //fix sign
- beqs ovf_pos
- bsetb #sign_bit,ETEMP_EX(%a6)
- bsetb #sign_bit,FP_SCR1(%a6) //set exceptional operand sign
-ovf_pos:
- fmovemx ETEMP(%a6),%fp0-%fp0 //move the result to fp0
- rts
-
-
-//
-// INEX2 exception
-//
-// The inex2 and ainex bits are set.
-//
-t_inx2:
- orl #inx2a_mask,USER_FPSR(%a6) //set INEX2, AINEX
- rts
-
-//
-// Force Inex2
-//
-// This routine is called by the transcendental routines to force
-// the inex2 exception bits set in the FPSR. If the underflow bit
-// is set, but the underflow trap was not taken, the aunfl bit in
-// the FPSR must be set.
-//
-t_frcinx:
- orl #inx2a_mask,USER_FPSR(%a6) //set INEX2, AINEX
- btstb #unfl_bit,FPSR_EXCEPT(%a6) //test for unfl bit set
- beqs no_uacc1 //if clear, do not set aunfl
- bsetb #aunfl_bit,FPSR_AEXCEPT(%a6)
-no_uacc1:
- rts
-
-//
-// DST_NAN
-//
-// Determine if the destination nan is signalling or non-signalling,
-// and set the FPSR bits accordingly. See the MC68040 User's Manual
-// section 3.2.2.5 NOT-A-NUMBERS.
-//
-dst_nan:
- btstb #sign_bit,FPTEMP_EX(%a6) //test sign of nan
- beqs dst_pos //if clr, it was positive
- bsetb #neg_bit,FPSR_CC(%a6) //set N bit
-dst_pos:
- btstb #signan_bit,FPTEMP_HI(%a6) //check if signalling
- beqs dst_snan //branch if signalling
-
- fmovel %d1,%fpcr //restore user's rmode/prec
- fmovex FPTEMP(%a6),%fp0 //return the non-signalling nan
-//
-// Check the source nan. If it is signalling, snan will be reported.
-//
- moveb STAG(%a6),%d0
- andib #0xe0,%d0
- cmpib #0x60,%d0
- bnes no_snan
- btstb #signan_bit,ETEMP_HI(%a6) //check if signalling
- bnes no_snan
- orl #snaniop_mask,USER_FPSR(%a6) //set NAN, SNAN, AIOP
-no_snan:
- rts
-
-dst_snan:
- btstb #snan_bit,FPCR_ENABLE(%a6) //check if trap enabled
- beqs dst_dis //branch if disabled
-
- orb #nan_tag,DTAG(%a6) //set up dtag for nan
- st STORE_FLG(%a6) //do not store a result
- orl #snaniop_mask,USER_FPSR(%a6) //set NAN, SNAN, AIOP
- rts
-
-dst_dis:
- bsetb #signan_bit,FPTEMP_HI(%a6) //set SNAN bit in sop
- fmovel %d1,%fpcr //restore user's rmode/prec
- fmovex FPTEMP(%a6),%fp0 //load non-sign. nan
- orl #snaniop_mask,USER_FPSR(%a6) //set NAN, SNAN, AIOP
- rts
-
-//
-// SRC_NAN
-//
-// Determine if the source nan is signalling or non-signalling,
-// and set the FPSR bits accordingly. See the MC68040 User's Manual
-// section 3.2.2.5 NOT-A-NUMBERS.
-//
-src_nan:
- btstb #sign_bit,ETEMP_EX(%a6) //test sign of nan
- beqs src_pos //if clr, it was positive
- bsetb #neg_bit,FPSR_CC(%a6) //set N bit
-src_pos:
- btstb #signan_bit,ETEMP_HI(%a6) //check if signalling
- beqs src_snan //branch if signalling
- fmovel %d1,%fpcr //restore user's rmode/prec
- fmovex ETEMP(%a6),%fp0 //return the non-signalling nan
- rts
-
-src_snan:
- btstb #snan_bit,FPCR_ENABLE(%a6) //check if trap enabled
- beqs src_dis //branch if disabled
- bsetb #signan_bit,ETEMP_HI(%a6) //set SNAN bit in sop
- orb #norm_tag,DTAG(%a6) //set up dtag for norm
- orb #nan_tag,STAG(%a6) //set up stag for nan
- st STORE_FLG(%a6) //do not store a result
- orl #snaniop_mask,USER_FPSR(%a6) //set NAN, SNAN, AIOP
- rts
-
-src_dis:
- bsetb #signan_bit,ETEMP_HI(%a6) //set SNAN bit in sop
- fmovel %d1,%fpcr //restore user's rmode/prec
- fmovex ETEMP(%a6),%fp0 //load non-sign. nan
- orl #snaniop_mask,USER_FPSR(%a6) //set NAN, SNAN, AIOP
- rts
-
-//
-// For all functions that have a denormalized input and that f(x)=x,
-// this is the entry point
-//
-t_extdnrm:
- orl #unfinx_mask,USER_FPSR(%a6)
-// ;set UNFL, INEX2, AUNFL, AINEX
- bras xdnrm_con
-//
-// Entry point for scale with extended denorm. The function does
-// not set inex2, aunfl, or ainex.
-//
-t_resdnrm:
- orl #unfl_mask,USER_FPSR(%a6)
-
-xdnrm_con:
- btstb #unfl_bit,FPCR_ENABLE(%a6)
- beqs xdnrm_dis
-
-//
-// If exceptions are enabled, the additional task of setting up WBTEMP
-// is needed so that when the underflow exception handler is entered,
-// the user perceives no difference between what the 040 provides vs.
-// what the FPSP provides.
-//
-xdnrm_ena:
- movel %a0,-(%a7)
-
- movel LOCAL_EX(%a0),FP_SCR1(%a6)
- movel LOCAL_HI(%a0),FP_SCR1+4(%a6)
- movel LOCAL_LO(%a0),FP_SCR1+8(%a6)
-
- lea FP_SCR1(%a6),%a0
-
- bclrb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0) //convert to internal ext format
- tstw LOCAL_EX(%a0) //check if input is denorm
- beqs xdnrm_dn //if so, skip nrm_set
- bsr nrm_set //normalize the result (exponent
-// ;will be negative
-xdnrm_dn:
- bclrb #sign_bit,LOCAL_EX(%a0) //take off false sign
- bfclr LOCAL_SGN(%a0){#0:#8} //change back to IEEE ext format
- beqs xdep
- bsetb #sign_bit,LOCAL_EX(%a0)
-xdep:
- bfclr STAG(%a6){#5:#3} //clear wbtm66,wbtm1,wbtm0
- bsetb #wbtemp15_bit,WB_BYTE(%a6) //set wbtemp15
- bclrb #sticky_bit,STICKY(%a6) //clear sticky bit
- bclrb #E1,E_BYTE(%a6)
- movel (%a7)+,%a0
-xdnrm_dis:
- bfextu FPCR_MODE(%a6){#0:#2},%d0 //get round precision
- bnes not_ext //if not round extended, store
-// ;IEEE defaults
-is_ext:
- btstb #sign_bit,LOCAL_EX(%a0)
- beqs xdnrm_store
-
- bsetb #neg_bit,FPSR_CC(%a6) //set N bit in FPSR_CC
-
- bras xdnrm_store
-
-not_ext:
- bclrb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0) //convert to internal ext format
- bsr unf_sub //returns IEEE result pointed by
-// ;a0; sets FPSR_CC accordingly
- bfclr LOCAL_SGN(%a0){#0:#8} //convert back to IEEE ext format
- beqs xdnrm_store
- bsetb #sign_bit,LOCAL_EX(%a0)
-xdnrm_store:
- fmovemx (%a0),%fp0-%fp0 //store result in fp0
- rts
-
-//
-// This subroutine is used for dyadic operations that use an extended
-// denorm within the kernel. The approach used is to capture the frame,
-// fix/restore.
-//
- .global t_avoid_unsupp
-t_avoid_unsupp:
- link %a2,#-LOCAL_SIZE //so that a2 fpsp.h negative
-// ;offsets may be used
- fsave -(%a7)
- tstb 1(%a7) //check if idle, exit if so
- beq idle_end
- btstb #E1,E_BYTE(%a2) //check for an E1 exception if
-// ;enabled, there is an unsupp
- beq end_avun //else, exit
- btstb #7,DTAG(%a2) //check for denorm destination
- beqs src_den //else, must be a source denorm
-//
-// handle destination denorm
-//
- lea FPTEMP(%a2),%a0
- btstb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0) //convert to internal ext format
- bclrb #7,DTAG(%a2) //set DTAG to norm
- bsr nrm_set //normalize result, exponent
-// ;will become negative
- bclrb #sign_bit,LOCAL_EX(%a0) //get rid of fake sign
- bfclr LOCAL_SGN(%a0){#0:#8} //convert back to IEEE ext format
- beqs ck_src_den //check if source is also denorm
- bsetb #sign_bit,LOCAL_EX(%a0)
-ck_src_den:
- btstb #7,STAG(%a2)
- beqs end_avun
-src_den:
- lea ETEMP(%a2),%a0
- btstb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0) //convert to internal ext format
- bclrb #7,STAG(%a2) //set STAG to norm
- bsr nrm_set //normalize result, exponent
-// ;will become negative
- bclrb #sign_bit,LOCAL_EX(%a0) //get rid of fake sign
- bfclr LOCAL_SGN(%a0){#0:#8} //convert back to IEEE ext format
- beqs den_com
- bsetb #sign_bit,LOCAL_EX(%a0)
-den_com:
- moveb #0xfe,CU_SAVEPC(%a2) //set continue frame
- clrw NMNEXC(%a2) //clear NMNEXC
- bclrb #E1,E_BYTE(%a2)
-// fmove.l %FPSR,FPSR_SHADOW(%a2)
-// bset.b #SFLAG,E_BYTE(%a2)
-// bset.b #XFLAG,T_BYTE(%a2)
-end_avun:
- frestore (%a7)+
- unlk %a2
- rts
-idle_end:
- addl #4,%a7
- unlk %a2
- rts
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/res_func.s b/c/src/lib/libcpu/m68k/m68040/fpsp/res_func.s
deleted file mode 100644
index 2f6b22870a..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/res_func.s
+++ /dev/null
@@ -1,2042 +0,0 @@
-//
-// $Id$
-//
-// res_func.sa 3.9 7/29/91
-//
-// Normalizes denormalized numbers if necessary and updates the
-// stack frame. The function is then restored back into the
-// machine and the 040 completes the operation. This routine
-// is only used by the unsupported data type/format handler.
-// (Exception vector 55).
-//
-// For packed move out (fmove.p fpm,<ea>) the operation is
-// completed here; data is packed and moved to user memory.
-// The stack is restored to the 040 only in the case of a
-// reportable exception in the conversion.
-//
-//
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-RES_FUNC: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
-sp_bnds: .short 0x3f81,0x407e
- .short 0x3f6a,0x0000
-dp_bnds: .short 0x3c01,0x43fe
- .short 0x3bcd,0x0000
-
- |xref mem_write
- |xref bindec
- |xref get_fline
- |xref round
- |xref denorm
- |xref dest_ext
- |xref dest_dbl
- |xref dest_sgl
- |xref unf_sub
- |xref nrm_set
- |xref dnrm_lp
- |xref ovf_res
- |xref reg_dest
- |xref t_ovfl
- |xref t_unfl
-
- .global res_func
- .global p_move
-
-res_func:
- clrb DNRM_FLG(%a6)
- clrb RES_FLG(%a6)
- clrb CU_ONLY(%a6)
- tstb DY_MO_FLG(%a6)
- beqs monadic
-dyadic:
- btstb #7,DTAG(%a6) //if dop = norm=000, zero=001,
-// ;inf=010 or nan=011
- beqs monadic //then branch
-// ;else denorm
-// HANDLE DESTINATION DENORM HERE
-// ;set dtag to norm
-// ;write the tag & fpte15 to the fstack
- leal FPTEMP(%a6),%a0
-
- bclrb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0)
-
- bsr nrm_set //normalize number (exp will go negative)
- bclrb #sign_bit,LOCAL_EX(%a0) //get rid of false sign
- bfclr LOCAL_SGN(%a0){#0:#8} //change back to IEEE ext format
- beqs dpos
- bsetb #sign_bit,LOCAL_EX(%a0)
-dpos:
- bfclr DTAG(%a6){#0:#4} //set tag to normalized, FPTE15 = 0
- bsetb #4,DTAG(%a6) //set FPTE15
- orb #0x0f,DNRM_FLG(%a6)
-monadic:
- leal ETEMP(%a6),%a0
- btstb #direction_bit,CMDREG1B(%a6) //check direction
- bne opclass3 //it is a mv out
-//
-// At this point, only opclass 0 and 2 possible
-//
- btstb #7,STAG(%a6) //if sop = norm=000, zero=001,
-// ;inf=010 or nan=011
- bne mon_dnrm //else denorm
- tstb DY_MO_FLG(%a6) //all cases of dyadic instructions would
- bne normal //require normalization of denorm
-
-// At this point:
-// monadic instructions: fabs = $18 fneg = $1a ftst = $3a
-// fmove = $00 fsmove = $40 fdmove = $44
-// fsqrt = $05* fssqrt = $41 fdsqrt = $45
-// (*fsqrt reencoded to $05)
-//
- movew CMDREG1B(%a6),%d0 //get command register
- andil #0x7f,%d0 //strip to only command word
-//
-// At this point, fabs, fneg, fsmove, fdmove, ftst, fsqrt, fssqrt, and
-// fdsqrt are possible.
-// For cases fabs, fneg, fsmove, and fdmove goto spos (do not normalize)
-// For cases fsqrt, fssqrt, and fdsqrt goto nrm_src (do normalize)
-//
- btstl #0,%d0
- bne normal //weed out fsqrt instructions
-//
-// cu_norm handles fmove in instructions with normalized inputs.
-// The routine round is used to correctly round the input for the
-// destination precision and mode.
-//
-cu_norm:
- st CU_ONLY(%a6) //set cu-only inst flag
- movew CMDREG1B(%a6),%d0
- andib #0x3b,%d0 //isolate bits to select inst
- tstb %d0
- beql cu_nmove //if zero, it is an fmove
- cmpib #0x18,%d0
- beql cu_nabs //if $18, it is fabs
- cmpib #0x1a,%d0
- beql cu_nneg //if $1a, it is fneg
-//
-// Inst is ftst. Check the source operand and set the cc's accordingly.
-// No write is done, so simply rts.
-//
-cu_ntst:
- movew LOCAL_EX(%a0),%d0
- bclrl #15,%d0
- sne LOCAL_SGN(%a0)
- beqs cu_ntpo
- orl #neg_mask,USER_FPSR(%a6) //set N
-cu_ntpo:
- cmpiw #0x7fff,%d0 //test for inf/nan
- bnes cu_ntcz
- tstl LOCAL_HI(%a0)
- bnes cu_ntn
- tstl LOCAL_LO(%a0)
- bnes cu_ntn
- orl #inf_mask,USER_FPSR(%a6)
- rts
-cu_ntn:
- orl #nan_mask,USER_FPSR(%a6)
- movel ETEMP_EX(%a6),FPTEMP_EX(%a6) //set up fptemp sign for
-// ;snan handler
-
- rts
-cu_ntcz:
- tstl LOCAL_HI(%a0)
- bnel cu_ntsx
- tstl LOCAL_LO(%a0)
- bnel cu_ntsx
- orl #z_mask,USER_FPSR(%a6)
-cu_ntsx:
- rts
-//
-// Inst is fabs. Execute the absolute value function on the input.
-// Branch to the fmove code. If the operand is NaN, do nothing.
-//
-cu_nabs:
- moveb STAG(%a6),%d0
- btstl #5,%d0 //test for NaN or zero
- bne wr_etemp //if either, simply write it
- bclrb #7,LOCAL_EX(%a0) //do abs
- bras cu_nmove //fmove code will finish
-//
-// Inst is fneg. Execute the negate value function on the input.
-// Fall though to the fmove code. If the operand is NaN, do nothing.
-//
-cu_nneg:
- moveb STAG(%a6),%d0
- btstl #5,%d0 //test for NaN or zero
- bne wr_etemp //if either, simply write it
- bchgb #7,LOCAL_EX(%a0) //do neg
-//
-// Inst is fmove. This code also handles all result writes.
-// If bit 2 is set, round is forced to double. If it is clear,
-// and bit 6 is set, round is forced to single. If both are clear,
-// the round precision is found in the fpcr. If the rounding precision
-// is double or single, round the result before the write.
-//
-cu_nmove:
- moveb STAG(%a6),%d0
- andib #0xe0,%d0 //isolate stag bits
- bne wr_etemp //if not norm, simply write it
- btstb #2,CMDREG1B+1(%a6) //check for rd
- bne cu_nmrd
- btstb #6,CMDREG1B+1(%a6) //check for rs
- bne cu_nmrs
-//
-// The move or operation is not with forced precision. Test for
-// nan or inf as the input; if so, simply write it to FPn. Use the
-// FPCR_MODE byte to get rounding on norms and zeros.
-//
-cu_nmnr:
- bfextu FPCR_MODE(%a6){#0:#2},%d0
- tstb %d0 //check for extended
- beq cu_wrexn //if so, just write result
- cmpib #1,%d0 //check for single
- beq cu_nmrs //fall through to double
-//
-// The move is fdmove or round precision is double.
-//
-cu_nmrd:
- movel #2,%d0 //set up the size for denorm
- movew LOCAL_EX(%a0),%d1 //compare exponent to double threshold
- andw #0x7fff,%d1
- cmpw #0x3c01,%d1
- bls cu_nunfl
- bfextu FPCR_MODE(%a6){#2:#2},%d1 //get rmode
- orl #0x00020000,%d1 //or in rprec (double)
- clrl %d0 //clear g,r,s for round
- bclrb #sign_bit,LOCAL_EX(%a0) //convert to internal format
- sne LOCAL_SGN(%a0)
- bsrl round
- bfclr LOCAL_SGN(%a0){#0:#8}
- beqs cu_nmrdc
- bsetb #sign_bit,LOCAL_EX(%a0)
-cu_nmrdc:
- movew LOCAL_EX(%a0),%d1 //check for overflow
- andw #0x7fff,%d1
- cmpw #0x43ff,%d1
- bge cu_novfl //take care of overflow case
- bra cu_wrexn
-//
-// The move is fsmove or round precision is single.
-//
-cu_nmrs:
- movel #1,%d0
- movew LOCAL_EX(%a0),%d1
- andw #0x7fff,%d1
- cmpw #0x3f81,%d1
- bls cu_nunfl
- bfextu FPCR_MODE(%a6){#2:#2},%d1
- orl #0x00010000,%d1
- clrl %d0
- bclrb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0)
- bsrl round
- bfclr LOCAL_SGN(%a0){#0:#8}
- beqs cu_nmrsc
- bsetb #sign_bit,LOCAL_EX(%a0)
-cu_nmrsc:
- movew LOCAL_EX(%a0),%d1
- andw #0x7FFF,%d1
- cmpw #0x407f,%d1
- blt cu_wrexn
-//
-// The operand is above precision boundaries. Use t_ovfl to
-// generate the correct value.
-//
-cu_novfl:
- bsr t_ovfl
- bra cu_wrexn
-//
-// The operand is below precision boundaries. Use denorm to
-// generate the correct value.
-//
-cu_nunfl:
- bclrb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0)
- bsr denorm
- bfclr LOCAL_SGN(%a0){#0:#8} //change back to IEEE ext format
- beqs cu_nucont
- bsetb #sign_bit,LOCAL_EX(%a0)
-cu_nucont:
- bfextu FPCR_MODE(%a6){#2:#2},%d1
- btstb #2,CMDREG1B+1(%a6) //check for rd
- bne inst_d
- btstb #6,CMDREG1B+1(%a6) //check for rs
- bne inst_s
- swap %d1
- moveb FPCR_MODE(%a6),%d1
- lsrb #6,%d1
- swap %d1
- bra inst_sd
-inst_d:
- orl #0x00020000,%d1
- bra inst_sd
-inst_s:
- orl #0x00010000,%d1
-inst_sd:
- bclrb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0)
- bsrl round
- bfclr LOCAL_SGN(%a0){#0:#8}
- beqs cu_nuflp
- bsetb #sign_bit,LOCAL_EX(%a0)
-cu_nuflp:
- btstb #inex2_bit,FPSR_EXCEPT(%a6)
- beqs cu_nuninx
- orl #aunfl_mask,USER_FPSR(%a6) //if the round was inex, set AUNFL
-cu_nuninx:
- tstl LOCAL_HI(%a0) //test for zero
- bnes cu_nunzro
- tstl LOCAL_LO(%a0)
- bnes cu_nunzro
-//
-// The mantissa is zero from the denorm loop. Check sign and rmode
-// to see if rounding should have occurred which would leave the lsb.
-//
- movel USER_FPCR(%a6),%d0
- andil #0x30,%d0 //isolate rmode
- cmpil #0x20,%d0
- blts cu_nzro
- bnes cu_nrp
-cu_nrm:
- tstw LOCAL_EX(%a0) //if positive, set lsb
- bges cu_nzro
- btstb #7,FPCR_MODE(%a6) //check for double
- beqs cu_nincs
- bras cu_nincd
-cu_nrp:
- tstw LOCAL_EX(%a0) //if positive, set lsb
- blts cu_nzro
- btstb #7,FPCR_MODE(%a6) //check for double
- beqs cu_nincs
-cu_nincd:
- orl #0x800,LOCAL_LO(%a0) //inc for double
- bra cu_nunzro
-cu_nincs:
- orl #0x100,LOCAL_HI(%a0) //inc for single
- bra cu_nunzro
-cu_nzro:
- orl #z_mask,USER_FPSR(%a6)
- moveb STAG(%a6),%d0
- andib #0xe0,%d0
- cmpib #0x40,%d0 //check if input was tagged zero
- beqs cu_numv
-cu_nunzro:
- orl #unfl_mask,USER_FPSR(%a6) //set unfl
-cu_numv:
- movel (%a0),ETEMP(%a6)
- movel 4(%a0),ETEMP_HI(%a6)
- movel 8(%a0),ETEMP_LO(%a6)
-//
-// Write the result to memory, setting the fpsr cc bits. NaN and Inf
-// bypass cu_wrexn.
-//
-cu_wrexn:
- tstw LOCAL_EX(%a0) //test for zero
- beqs cu_wrzero
- cmpw #0x8000,LOCAL_EX(%a0) //test for zero
- bnes cu_wreon
-cu_wrzero:
- orl #z_mask,USER_FPSR(%a6) //set Z bit
-cu_wreon:
- tstw LOCAL_EX(%a0)
- bpl wr_etemp
- orl #neg_mask,USER_FPSR(%a6)
- bra wr_etemp
-
-//
-// HANDLE SOURCE DENORM HERE
-//
-// ;clear denorm stag to norm
-// ;write the new tag & ete15 to the fstack
-mon_dnrm:
-//
-// At this point, check for the cases in which normalizing the
-// denorm produces incorrect results.
-//
- tstb DY_MO_FLG(%a6) //all cases of dyadic instructions would
- bnes nrm_src //require normalization of denorm
-
-// At this point:
-// monadic instructions: fabs = $18 fneg = $1a ftst = $3a
-// fmove = $00 fsmove = $40 fdmove = $44
-// fsqrt = $05* fssqrt = $41 fdsqrt = $45
-// (*fsqrt reencoded to $05)
-//
- movew CMDREG1B(%a6),%d0 //get command register
- andil #0x7f,%d0 //strip to only command word
-//
-// At this point, fabs, fneg, fsmove, fdmove, ftst, fsqrt, fssqrt, and
-// fdsqrt are possible.
-// For cases fabs, fneg, fsmove, and fdmove goto spos (do not normalize)
-// For cases fsqrt, fssqrt, and fdsqrt goto nrm_src (do normalize)
-//
- btstl #0,%d0
- bnes nrm_src //weed out fsqrt instructions
- st CU_ONLY(%a6) //set cu-only inst flag
- bra cu_dnrm //fmove, fabs, fneg, ftst
-// ;cases go to cu_dnrm
-nrm_src:
- bclrb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0)
- bsr nrm_set //normalize number (exponent will go
-// ; negative)
- bclrb #sign_bit,LOCAL_EX(%a0) //get rid of false sign
-
- bfclr LOCAL_SGN(%a0){#0:#8} //change back to IEEE ext format
- beqs spos
- bsetb #sign_bit,LOCAL_EX(%a0)
-spos:
- bfclr STAG(%a6){#0:#4} //set tag to normalized, FPTE15 = 0
- bsetb #4,STAG(%a6) //set ETE15
- orb #0xf0,DNRM_FLG(%a6)
-normal:
- tstb DNRM_FLG(%a6) //check if any of the ops were denorms
- bne ck_wrap //if so, check if it is a potential
-// ;wrap-around case
-fix_stk:
- moveb #0xfe,CU_SAVEPC(%a6)
- bclrb #E1,E_BYTE(%a6)
-
- clrw NMNEXC(%a6)
-
- st RES_FLG(%a6) //indicate that a restore is needed
- rts
-
-//
-// cu_dnrm handles all cu-only instructions (fmove, fabs, fneg, and
-// ftst) completely in software without an frestore to the 040.
-//
-cu_dnrm:
- st CU_ONLY(%a6)
- movew CMDREG1B(%a6),%d0
- andib #0x3b,%d0 //isolate bits to select inst
- tstb %d0
- beql cu_dmove //if zero, it is an fmove
- cmpib #0x18,%d0
- beql cu_dabs //if $18, it is fabs
- cmpib #0x1a,%d0
- beql cu_dneg //if $1a, it is fneg
-//
-// Inst is ftst. Check the source operand and set the cc's accordingly.
-// No write is done, so simply rts.
-//
-cu_dtst:
- movew LOCAL_EX(%a0),%d0
- bclrl #15,%d0
- sne LOCAL_SGN(%a0)
- beqs cu_dtpo
- orl #neg_mask,USER_FPSR(%a6) //set N
-cu_dtpo:
- cmpiw #0x7fff,%d0 //test for inf/nan
- bnes cu_dtcz
- tstl LOCAL_HI(%a0)
- bnes cu_dtn
- tstl LOCAL_LO(%a0)
- bnes cu_dtn
- orl #inf_mask,USER_FPSR(%a6)
- rts
-cu_dtn:
- orl #nan_mask,USER_FPSR(%a6)
- movel ETEMP_EX(%a6),FPTEMP_EX(%a6) //set up fptemp sign for
-// ;snan handler
- rts
-cu_dtcz:
- tstl LOCAL_HI(%a0)
- bnel cu_dtsx
- tstl LOCAL_LO(%a0)
- bnel cu_dtsx
- orl #z_mask,USER_FPSR(%a6)
-cu_dtsx:
- rts
-//
-// Inst is fabs. Execute the absolute value function on the input.
-// Branch to the fmove code.
-//
-cu_dabs:
- bclrb #7,LOCAL_EX(%a0) //do abs
- bras cu_dmove //fmove code will finish
-//
-// Inst is fneg. Execute the negate value function on the input.
-// Fall though to the fmove code.
-//
-cu_dneg:
- bchgb #7,LOCAL_EX(%a0) //do neg
-//
-// Inst is fmove. This code also handles all result writes.
-// If bit 2 is set, round is forced to double. If it is clear,
-// and bit 6 is set, round is forced to single. If both are clear,
-// the round precision is found in the fpcr. If the rounding precision
-// is double or single, the result is zero, and the mode is checked
-// to determine if the lsb of the result should be set.
-//
-cu_dmove:
- btstb #2,CMDREG1B+1(%a6) //check for rd
- bne cu_dmrd
- btstb #6,CMDREG1B+1(%a6) //check for rs
- bne cu_dmrs
-//
-// The move or operation is not with forced precision. Use the
-// FPCR_MODE byte to get rounding.
-//
-cu_dmnr:
- bfextu FPCR_MODE(%a6){#0:#2},%d0
- tstb %d0 //check for extended
- beq cu_wrexd //if so, just write result
- cmpib #1,%d0 //check for single
- beq cu_dmrs //fall through to double
-//
-// The move is fdmove or round precision is double. Result is zero.
-// Check rmode for rp or rm and set lsb accordingly.
-//
-cu_dmrd:
- bfextu FPCR_MODE(%a6){#2:#2},%d1 //get rmode
- tstw LOCAL_EX(%a0) //check sign
- blts cu_dmdn
- cmpib #3,%d1 //check for rp
- bne cu_dpd //load double pos zero
- bra cu_dpdr //load double pos zero w/lsb
-cu_dmdn:
- cmpib #2,%d1 //check for rm
- bne cu_dnd //load double neg zero
- bra cu_dndr //load double neg zero w/lsb
-//
-// The move is fsmove or round precision is single. Result is zero.
-// Check for rp or rm and set lsb accordingly.
-//
-cu_dmrs:
- bfextu FPCR_MODE(%a6){#2:#2},%d1 //get rmode
- tstw LOCAL_EX(%a0) //check sign
- blts cu_dmsn
- cmpib #3,%d1 //check for rp
- bne cu_spd //load single pos zero
- bra cu_spdr //load single pos zero w/lsb
-cu_dmsn:
- cmpib #2,%d1 //check for rm
- bne cu_snd //load single neg zero
- bra cu_sndr //load single neg zero w/lsb
-//
-// The precision is extended, so the result in etemp is correct.
-// Simply set unfl (not inex2 or aunfl) and write the result to
-// the correct fp register.
-cu_wrexd:
- orl #unfl_mask,USER_FPSR(%a6)
- tstw LOCAL_EX(%a0)
- beq wr_etemp
- orl #neg_mask,USER_FPSR(%a6)
- bra wr_etemp
-//
-// These routines write +/- zero in double format. The routines
-// cu_dpdr and cu_dndr set the double lsb.
-//
-cu_dpd:
- movel #0x3c010000,LOCAL_EX(%a0) //force pos double zero
- clrl LOCAL_HI(%a0)
- clrl LOCAL_LO(%a0)
- orl #z_mask,USER_FPSR(%a6)
- orl #unfinx_mask,USER_FPSR(%a6)
- bra wr_etemp
-cu_dpdr:
- movel #0x3c010000,LOCAL_EX(%a0) //force pos double zero
- clrl LOCAL_HI(%a0)
- movel #0x800,LOCAL_LO(%a0) //with lsb set
- orl #unfinx_mask,USER_FPSR(%a6)
- bra wr_etemp
-cu_dnd:
- movel #0xbc010000,LOCAL_EX(%a0) //force pos double zero
- clrl LOCAL_HI(%a0)
- clrl LOCAL_LO(%a0)
- orl #z_mask,USER_FPSR(%a6)
- orl #neg_mask,USER_FPSR(%a6)
- orl #unfinx_mask,USER_FPSR(%a6)
- bra wr_etemp
-cu_dndr:
- movel #0xbc010000,LOCAL_EX(%a0) //force pos double zero
- clrl LOCAL_HI(%a0)
- movel #0x800,LOCAL_LO(%a0) //with lsb set
- orl #neg_mask,USER_FPSR(%a6)
- orl #unfinx_mask,USER_FPSR(%a6)
- bra wr_etemp
-//
-// These routines write +/- zero in single format. The routines
-// cu_dpdr and cu_dndr set the single lsb.
-//
-cu_spd:
- movel #0x3f810000,LOCAL_EX(%a0) //force pos single zero
- clrl LOCAL_HI(%a0)
- clrl LOCAL_LO(%a0)
- orl #z_mask,USER_FPSR(%a6)
- orl #unfinx_mask,USER_FPSR(%a6)
- bra wr_etemp
-cu_spdr:
- movel #0x3f810000,LOCAL_EX(%a0) //force pos single zero
- movel #0x100,LOCAL_HI(%a0) //with lsb set
- clrl LOCAL_LO(%a0)
- orl #unfinx_mask,USER_FPSR(%a6)
- bra wr_etemp
-cu_snd:
- movel #0xbf810000,LOCAL_EX(%a0) //force pos single zero
- clrl LOCAL_HI(%a0)
- clrl LOCAL_LO(%a0)
- orl #z_mask,USER_FPSR(%a6)
- orl #neg_mask,USER_FPSR(%a6)
- orl #unfinx_mask,USER_FPSR(%a6)
- bra wr_etemp
-cu_sndr:
- movel #0xbf810000,LOCAL_EX(%a0) //force pos single zero
- movel #0x100,LOCAL_HI(%a0) //with lsb set
- clrl LOCAL_LO(%a0)
- orl #neg_mask,USER_FPSR(%a6)
- orl #unfinx_mask,USER_FPSR(%a6)
- bra wr_etemp
-
-//
-// This code checks for 16-bit overflow conditions on dyadic
-// operations which are not restorable into the floating-point
-// unit and must be completed in software. Basically, this
-// condition exists with a very large norm and a denorm. One
-// of the operands must be denormalized to enter this code.
-//
-// Flags used:
-// DY_MO_FLG contains 0 for monadic op, $ff for dyadic
-// DNRM_FLG contains $00 for neither op denormalized
-// $0f for the destination op denormalized
-// $f0 for the source op denormalized
-// $ff for both ops denormalized
-//
-// The wrap-around condition occurs for add, sub, div, and cmp
-// when
-//
-// abs(dest_exp - src_exp) >= $8000
-//
-// and for mul when
-//
-// (dest_exp + src_exp) < $0
-//
-// we must process the operation here if this case is true.
-//
-// The rts following the frcfpn routine is the exit from res_func
-// for this condition. The restore flag (RES_FLG) is left clear.
-// No frestore is done unless an exception is to be reported.
-//
-// For fadd:
-// if(sign_of(dest) != sign_of(src))
-// replace exponent of src with $3fff (keep sign)
-// use fpu to perform dest+new_src (user's rmode and X)
-// clr sticky
-// else
-// set sticky
-// call round with user's precision and mode
-// move result to fpn and wbtemp
-//
-// For fsub:
-// if(sign_of(dest) == sign_of(src))
-// replace exponent of src with $3fff (keep sign)
-// use fpu to perform dest+new_src (user's rmode and X)
-// clr sticky
-// else
-// set sticky
-// call round with user's precision and mode
-// move result to fpn and wbtemp
-//
-// For fdiv/fsgldiv:
-// if(both operands are denorm)
-// restore_to_fpu;
-// if(dest is norm)
-// force_ovf;
-// else(dest is denorm)
-// force_unf:
-//
-// For fcmp:
-// if(dest is norm)
-// N = sign_of(dest);
-// else(dest is denorm)
-// N = sign_of(src);
-//
-// For fmul:
-// if(both operands are denorm)
-// force_unf;
-// if((dest_exp + src_exp) < 0)
-// force_unf:
-// else
-// restore_to_fpu;
-//
-// local equates:
- .set addcode,0x22
- .set subcode,0x28
- .set mulcode,0x23
- .set divcode,0x20
- .set cmpcode,0x38
-ck_wrap:
- | tstb DY_MO_FLG(%a6) ;check for fsqrt
- beq fix_stk //if zero, it is fsqrt
- movew CMDREG1B(%a6),%d0
- andiw #0x3b,%d0 //strip to command bits
- cmpiw #addcode,%d0
- beq wrap_add
- cmpiw #subcode,%d0
- beq wrap_sub
- cmpiw #mulcode,%d0
- beq wrap_mul
- cmpiw #cmpcode,%d0
- beq wrap_cmp
-//
-// Inst is fdiv.
-//
-wrap_div:
- cmpb #0xff,DNRM_FLG(%a6) //if both ops denorm,
- beq fix_stk //restore to fpu
-//
-// One of the ops is denormalized. Test for wrap condition
-// and force the result.
-//
- cmpb #0x0f,DNRM_FLG(%a6) //check for dest denorm
- bnes div_srcd
-div_destd:
- bsrl ckinf_ns
- bne fix_stk
- bfextu ETEMP_EX(%a6){#1:#15},%d0 //get src exp (always pos)
- bfexts FPTEMP_EX(%a6){#1:#15},%d1 //get dest exp (always neg)
- subl %d1,%d0 //subtract dest from src
- cmpl #0x7fff,%d0
- blt fix_stk //if less, not wrap case
- clrb WBTEMP_SGN(%a6)
- movew ETEMP_EX(%a6),%d0 //find the sign of the result
- movew FPTEMP_EX(%a6),%d1
- eorw %d1,%d0
- andiw #0x8000,%d0
- beq force_unf
- st WBTEMP_SGN(%a6)
- bra force_unf
-
-ckinf_ns:
- moveb STAG(%a6),%d0 //check source tag for inf or nan
- bra ck_in_com
-ckinf_nd:
- moveb DTAG(%a6),%d0 //check destination tag for inf or nan
-ck_in_com:
- andib #0x60,%d0 //isolate tag bits
- cmpb #0x40,%d0 //is it inf?
- beq nan_or_inf //not wrap case
- cmpb #0x60,%d0 //is it nan?
- beq nan_or_inf //yes, not wrap case?
- cmpb #0x20,%d0 //is it a zero?
- beq nan_or_inf //yes
- clrl %d0
- rts //then ; it is either a zero of norm,
-// ;check wrap case
-nan_or_inf:
- moveql #-1,%d0
- rts
-
-
-
-div_srcd:
- bsrl ckinf_nd
- bne fix_stk
- bfextu FPTEMP_EX(%a6){#1:#15},%d0 //get dest exp (always pos)
- bfexts ETEMP_EX(%a6){#1:#15},%d1 //get src exp (always neg)
- subl %d1,%d0 //subtract src from dest
- cmpl #0x8000,%d0
- blt fix_stk //if less, not wrap case
- clrb WBTEMP_SGN(%a6)
- movew ETEMP_EX(%a6),%d0 //find the sign of the result
- movew FPTEMP_EX(%a6),%d1
- eorw %d1,%d0
- andiw #0x8000,%d0
- beqs force_ovf
- st WBTEMP_SGN(%a6)
-//
-// This code handles the case of the instruction resulting in
-// an overflow condition.
-//
-force_ovf:
- bclrb #E1,E_BYTE(%a6)
- orl #ovfl_inx_mask,USER_FPSR(%a6)
- clrw NMNEXC(%a6)
- leal WBTEMP(%a6),%a0 //point a0 to memory location
- movew CMDREG1B(%a6),%d0
- btstl #6,%d0 //test for forced precision
- beqs frcovf_fpcr
- btstl #2,%d0 //check for double
- bnes frcovf_dbl
- movel #0x1,%d0 //inst is forced single
- bras frcovf_rnd
-frcovf_dbl:
- movel #0x2,%d0 //inst is forced double
- bras frcovf_rnd
-frcovf_fpcr:
- bfextu FPCR_MODE(%a6){#0:#2},%d0 //inst not forced - use fpcr prec
-frcovf_rnd:
-
-// The 881/882 does not set inex2 for the following case, so the
-// line is commented out to be compatible with 881/882
-// tst.b %d0
-// beq.b frcovf_x
-// or.l #inex2_mask,USER_FPSR(%a6) ;if prec is s or d, set inex2
-
-//frcovf_x:
- bsrl ovf_res //get correct result based on
-// ;round precision/mode. This
-// ;sets FPSR_CC correctly
-// ;returns in external format
- bfclr WBTEMP_SGN(%a6){#0:#8}
- beq frcfpn
- bsetb #sign_bit,WBTEMP_EX(%a6)
- bra frcfpn
-//
-// Inst is fadd.
-//
-wrap_add:
- cmpb #0xff,DNRM_FLG(%a6) //if both ops denorm,
- beq fix_stk //restore to fpu
-//
-// One of the ops is denormalized. Test for wrap condition
-// and complete the instruction.
-//
- cmpb #0x0f,DNRM_FLG(%a6) //check for dest denorm
- bnes add_srcd
-add_destd:
- bsrl ckinf_ns
- bne fix_stk
- bfextu ETEMP_EX(%a6){#1:#15},%d0 //get src exp (always pos)
- bfexts FPTEMP_EX(%a6){#1:#15},%d1 //get dest exp (always neg)
- subl %d1,%d0 //subtract dest from src
- cmpl #0x8000,%d0
- blt fix_stk //if less, not wrap case
- bra add_wrap
-add_srcd:
- bsrl ckinf_nd
- bne fix_stk
- bfextu FPTEMP_EX(%a6){#1:#15},%d0 //get dest exp (always pos)
- bfexts ETEMP_EX(%a6){#1:#15},%d1 //get src exp (always neg)
- subl %d1,%d0 //subtract src from dest
- cmpl #0x8000,%d0
- blt fix_stk //if less, not wrap case
-//
-// Check the signs of the operands. If they are unlike, the fpu
-// can be used to add the norm and 1.0 with the sign of the
-// denorm and it will correctly generate the result in extended
-// precision. We can then call round with no sticky and the result
-// will be correct for the user's rounding mode and precision. If
-// the signs are the same, we call round with the sticky bit set
-// and the result will be correct for the user's rounding mode and
-// precision.
-//
-add_wrap:
- movew ETEMP_EX(%a6),%d0
- movew FPTEMP_EX(%a6),%d1
- eorw %d1,%d0
- andiw #0x8000,%d0
- beq add_same
-//
-// The signs are unlike.
-//
- cmpb #0x0f,DNRM_FLG(%a6) //is dest the denorm?
- bnes add_u_srcd
- movew FPTEMP_EX(%a6),%d0
- andiw #0x8000,%d0
- orw #0x3fff,%d0 //force the exponent to +/- 1
- movew %d0,FPTEMP_EX(%a6) //in the denorm
- movel USER_FPCR(%a6),%d0
- andil #0x30,%d0
- fmovel %d0,%fpcr //set up users rmode and X
- fmovex ETEMP(%a6),%fp0
- faddx FPTEMP(%a6),%fp0
- leal WBTEMP(%a6),%a0 //point a0 to wbtemp in frame
- fmovel %fpsr,%d1
- orl %d1,USER_FPSR(%a6) //capture cc's and inex from fadd
- fmovex %fp0,WBTEMP(%a6) //write result to memory
- lsrl #4,%d0 //put rmode in lower 2 bits
- movel USER_FPCR(%a6),%d1
- andil #0xc0,%d1
- lsrl #6,%d1 //put precision in upper word
- swap %d1
- orl %d0,%d1 //set up for round call
- clrl %d0 //force sticky to zero
- bclrb #sign_bit,WBTEMP_EX(%a6)
- sne WBTEMP_SGN(%a6)
- bsrl round //round result to users rmode & prec
- bfclr WBTEMP_SGN(%a6){#0:#8} //convert back to IEEE ext format
- beq frcfpnr
- bsetb #sign_bit,WBTEMP_EX(%a6)
- bra frcfpnr
-add_u_srcd:
- movew ETEMP_EX(%a6),%d0
- andiw #0x8000,%d0
- orw #0x3fff,%d0 //force the exponent to +/- 1
- movew %d0,ETEMP_EX(%a6) //in the denorm
- movel USER_FPCR(%a6),%d0
- andil #0x30,%d0
- fmovel %d0,%fpcr //set up users rmode and X
- fmovex ETEMP(%a6),%fp0
- faddx FPTEMP(%a6),%fp0
- fmovel %fpsr,%d1
- orl %d1,USER_FPSR(%a6) //capture cc's and inex from fadd
- leal WBTEMP(%a6),%a0 //point a0 to wbtemp in frame
- fmovex %fp0,WBTEMP(%a6) //write result to memory
- lsrl #4,%d0 //put rmode in lower 2 bits
- movel USER_FPCR(%a6),%d1
- andil #0xc0,%d1
- lsrl #6,%d1 //put precision in upper word
- swap %d1
- orl %d0,%d1 //set up for round call
- clrl %d0 //force sticky to zero
- bclrb #sign_bit,WBTEMP_EX(%a6)
- sne WBTEMP_SGN(%a6) //use internal format for round
- bsrl round //round result to users rmode & prec
- bfclr WBTEMP_SGN(%a6){#0:#8} //convert back to IEEE ext format
- beq frcfpnr
- bsetb #sign_bit,WBTEMP_EX(%a6)
- bra frcfpnr
-//
-// Signs are alike:
-//
-add_same:
- cmpb #0x0f,DNRM_FLG(%a6) //is dest the denorm?
- bnes add_s_srcd
-add_s_destd:
- leal ETEMP(%a6),%a0
- movel USER_FPCR(%a6),%d0
- andil #0x30,%d0
- lsrl #4,%d0 //put rmode in lower 2 bits
- movel USER_FPCR(%a6),%d1
- andil #0xc0,%d1
- lsrl #6,%d1 //put precision in upper word
- swap %d1
- orl %d0,%d1 //set up for round call
- movel #0x20000000,%d0 //set sticky for round
- bclrb #sign_bit,ETEMP_EX(%a6)
- sne ETEMP_SGN(%a6)
- bsrl round //round result to users rmode & prec
- bfclr ETEMP_SGN(%a6){#0:#8} //convert back to IEEE ext format
- beqs add_s_dclr
- bsetb #sign_bit,ETEMP_EX(%a6)
-add_s_dclr:
- leal WBTEMP(%a6),%a0
- movel ETEMP(%a6),(%a0) //write result to wbtemp
- movel ETEMP_HI(%a6),4(%a0)
- movel ETEMP_LO(%a6),8(%a0)
- tstw ETEMP_EX(%a6)
- bgt add_ckovf
- orl #neg_mask,USER_FPSR(%a6)
- bra add_ckovf
-add_s_srcd:
- leal FPTEMP(%a6),%a0
- movel USER_FPCR(%a6),%d0
- andil #0x30,%d0
- lsrl #4,%d0 //put rmode in lower 2 bits
- movel USER_FPCR(%a6),%d1
- andil #0xc0,%d1
- lsrl #6,%d1 //put precision in upper word
- swap %d1
- orl %d0,%d1 //set up for round call
- movel #0x20000000,%d0 //set sticky for round
- bclrb #sign_bit,FPTEMP_EX(%a6)
- sne FPTEMP_SGN(%a6)
- bsrl round //round result to users rmode & prec
- bfclr FPTEMP_SGN(%a6){#0:#8} //convert back to IEEE ext format
- beqs add_s_sclr
- bsetb #sign_bit,FPTEMP_EX(%a6)
-add_s_sclr:
- leal WBTEMP(%a6),%a0
- movel FPTEMP(%a6),(%a0) //write result to wbtemp
- movel FPTEMP_HI(%a6),4(%a0)
- movel FPTEMP_LO(%a6),8(%a0)
- tstw FPTEMP_EX(%a6)
- bgt add_ckovf
- orl #neg_mask,USER_FPSR(%a6)
-add_ckovf:
- movew WBTEMP_EX(%a6),%d0
- andiw #0x7fff,%d0
- cmpiw #0x7fff,%d0
- bne frcfpnr
-//
-// The result has overflowed to $7fff exponent. Set I, ovfl,
-// and aovfl, and clr the mantissa (incorrectly set by the
-// round routine.)
-//
- orl #inf_mask+ovfl_inx_mask,USER_FPSR(%a6)
- clrl 4(%a0)
- bra frcfpnr
-//
-// Inst is fsub.
-//
-wrap_sub:
- cmpb #0xff,DNRM_FLG(%a6) //if both ops denorm,
- beq fix_stk //restore to fpu
-//
-// One of the ops is denormalized. Test for wrap condition
-// and complete the instruction.
-//
- cmpb #0x0f,DNRM_FLG(%a6) //check for dest denorm
- bnes sub_srcd
-sub_destd:
- bsrl ckinf_ns
- bne fix_stk
- bfextu ETEMP_EX(%a6){#1:#15},%d0 //get src exp (always pos)
- bfexts FPTEMP_EX(%a6){#1:#15},%d1 //get dest exp (always neg)
- subl %d1,%d0 //subtract src from dest
- cmpl #0x8000,%d0
- blt fix_stk //if less, not wrap case
- bra sub_wrap
-sub_srcd:
- bsrl ckinf_nd
- bne fix_stk
- bfextu FPTEMP_EX(%a6){#1:#15},%d0 //get dest exp (always pos)
- bfexts ETEMP_EX(%a6){#1:#15},%d1 //get src exp (always neg)
- subl %d1,%d0 //subtract dest from src
- cmpl #0x8000,%d0
- blt fix_stk //if less, not wrap case
-//
-// Check the signs of the operands. If they are alike, the fpu
-// can be used to subtract from the norm 1.0 with the sign of the
-// denorm and it will correctly generate the result in extended
-// precision. We can then call round with no sticky and the result
-// will be correct for the user's rounding mode and precision. If
-// the signs are unlike, we call round with the sticky bit set
-// and the result will be correct for the user's rounding mode and
-// precision.
-//
-sub_wrap:
- movew ETEMP_EX(%a6),%d0
- movew FPTEMP_EX(%a6),%d1
- eorw %d1,%d0
- andiw #0x8000,%d0
- bne sub_diff
-//
-// The signs are alike.
-//
- cmpb #0x0f,DNRM_FLG(%a6) //is dest the denorm?
- bnes sub_u_srcd
- movew FPTEMP_EX(%a6),%d0
- andiw #0x8000,%d0
- orw #0x3fff,%d0 //force the exponent to +/- 1
- movew %d0,FPTEMP_EX(%a6) //in the denorm
- movel USER_FPCR(%a6),%d0
- andil #0x30,%d0
- fmovel %d0,%fpcr //set up users rmode and X
- fmovex FPTEMP(%a6),%fp0
- fsubx ETEMP(%a6),%fp0
- fmovel %fpsr,%d1
- orl %d1,USER_FPSR(%a6) //capture cc's and inex from fadd
- leal WBTEMP(%a6),%a0 //point a0 to wbtemp in frame
- fmovex %fp0,WBTEMP(%a6) //write result to memory
- lsrl #4,%d0 //put rmode in lower 2 bits
- movel USER_FPCR(%a6),%d1
- andil #0xc0,%d1
- lsrl #6,%d1 //put precision in upper word
- swap %d1
- orl %d0,%d1 //set up for round call
- clrl %d0 //force sticky to zero
- bclrb #sign_bit,WBTEMP_EX(%a6)
- sne WBTEMP_SGN(%a6)
- bsrl round //round result to users rmode & prec
- bfclr WBTEMP_SGN(%a6){#0:#8} //convert back to IEEE ext format
- beq frcfpnr
- bsetb #sign_bit,WBTEMP_EX(%a6)
- bra frcfpnr
-sub_u_srcd:
- movew ETEMP_EX(%a6),%d0
- andiw #0x8000,%d0
- orw #0x3fff,%d0 //force the exponent to +/- 1
- movew %d0,ETEMP_EX(%a6) //in the denorm
- movel USER_FPCR(%a6),%d0
- andil #0x30,%d0
- fmovel %d0,%fpcr //set up users rmode and X
- fmovex FPTEMP(%a6),%fp0
- fsubx ETEMP(%a6),%fp0
- fmovel %fpsr,%d1
- orl %d1,USER_FPSR(%a6) //capture cc's and inex from fadd
- leal WBTEMP(%a6),%a0 //point a0 to wbtemp in frame
- fmovex %fp0,WBTEMP(%a6) //write result to memory
- lsrl #4,%d0 //put rmode in lower 2 bits
- movel USER_FPCR(%a6),%d1
- andil #0xc0,%d1
- lsrl #6,%d1 //put precision in upper word
- swap %d1
- orl %d0,%d1 //set up for round call
- clrl %d0 //force sticky to zero
- bclrb #sign_bit,WBTEMP_EX(%a6)
- sne WBTEMP_SGN(%a6)
- bsrl round //round result to users rmode & prec
- bfclr WBTEMP_SGN(%a6){#0:#8} //convert back to IEEE ext format
- beq frcfpnr
- bsetb #sign_bit,WBTEMP_EX(%a6)
- bra frcfpnr
-//
-// Signs are unlike:
-//
-sub_diff:
- cmpb #0x0f,DNRM_FLG(%a6) //is dest the denorm?
- bnes sub_s_srcd
-sub_s_destd:
- leal ETEMP(%a6),%a0
- movel USER_FPCR(%a6),%d0
- andil #0x30,%d0
- lsrl #4,%d0 //put rmode in lower 2 bits
- movel USER_FPCR(%a6),%d1
- andil #0xc0,%d1
- lsrl #6,%d1 //put precision in upper word
- swap %d1
- orl %d0,%d1 //set up for round call
- movel #0x20000000,%d0 //set sticky for round
-//
-// Since the dest is the denorm, the sign is the opposite of the
-// norm sign.
-//
- eoriw #0x8000,ETEMP_EX(%a6) //flip sign on result
- tstw ETEMP_EX(%a6)
- bgts sub_s_dwr
- orl #neg_mask,USER_FPSR(%a6)
-sub_s_dwr:
- bclrb #sign_bit,ETEMP_EX(%a6)
- sne ETEMP_SGN(%a6)
- bsrl round //round result to users rmode & prec
- bfclr ETEMP_SGN(%a6){#0:#8} //convert back to IEEE ext format
- beqs sub_s_dclr
- bsetb #sign_bit,ETEMP_EX(%a6)
-sub_s_dclr:
- leal WBTEMP(%a6),%a0
- movel ETEMP(%a6),(%a0) //write result to wbtemp
- movel ETEMP_HI(%a6),4(%a0)
- movel ETEMP_LO(%a6),8(%a0)
- bra sub_ckovf
-sub_s_srcd:
- leal FPTEMP(%a6),%a0
- movel USER_FPCR(%a6),%d0
- andil #0x30,%d0
- lsrl #4,%d0 //put rmode in lower 2 bits
- movel USER_FPCR(%a6),%d1
- andil #0xc0,%d1
- lsrl #6,%d1 //put precision in upper word
- swap %d1
- orl %d0,%d1 //set up for round call
- movel #0x20000000,%d0 //set sticky for round
- bclrb #sign_bit,FPTEMP_EX(%a6)
- sne FPTEMP_SGN(%a6)
- bsrl round //round result to users rmode & prec
- bfclr FPTEMP_SGN(%a6){#0:#8} //convert back to IEEE ext format
- beqs sub_s_sclr
- bsetb #sign_bit,FPTEMP_EX(%a6)
-sub_s_sclr:
- leal WBTEMP(%a6),%a0
- movel FPTEMP(%a6),(%a0) //write result to wbtemp
- movel FPTEMP_HI(%a6),4(%a0)
- movel FPTEMP_LO(%a6),8(%a0)
- tstw FPTEMP_EX(%a6)
- bgt sub_ckovf
- orl #neg_mask,USER_FPSR(%a6)
-sub_ckovf:
- movew WBTEMP_EX(%a6),%d0
- andiw #0x7fff,%d0
- cmpiw #0x7fff,%d0
- bne frcfpnr
-//
-// The result has overflowed to $7fff exponent. Set I, ovfl,
-// and aovfl, and clr the mantissa (incorrectly set by the
-// round routine.)
-//
- orl #inf_mask+ovfl_inx_mask,USER_FPSR(%a6)
- clrl 4(%a0)
- bra frcfpnr
-//
-// Inst is fcmp.
-//
-wrap_cmp:
- cmpb #0xff,DNRM_FLG(%a6) //if both ops denorm,
- beq fix_stk //restore to fpu
-//
-// One of the ops is denormalized. Test for wrap condition
-// and complete the instruction.
-//
- cmpb #0x0f,DNRM_FLG(%a6) //check for dest denorm
- bnes cmp_srcd
-cmp_destd:
- bsrl ckinf_ns
- bne fix_stk
- bfextu ETEMP_EX(%a6){#1:#15},%d0 //get src exp (always pos)
- bfexts FPTEMP_EX(%a6){#1:#15},%d1 //get dest exp (always neg)
- subl %d1,%d0 //subtract dest from src
- cmpl #0x8000,%d0
- blt fix_stk //if less, not wrap case
- tstw ETEMP_EX(%a6) //set N to ~sign_of(src)
- bge cmp_setn
- rts
-cmp_srcd:
- bsrl ckinf_nd
- bne fix_stk
- bfextu FPTEMP_EX(%a6){#1:#15},%d0 //get dest exp (always pos)
- bfexts ETEMP_EX(%a6){#1:#15},%d1 //get src exp (always neg)
- subl %d1,%d0 //subtract src from dest
- cmpl #0x8000,%d0
- blt fix_stk //if less, not wrap case
- tstw FPTEMP_EX(%a6) //set N to sign_of(dest)
- blt cmp_setn
- rts
-cmp_setn:
- orl #neg_mask,USER_FPSR(%a6)
- rts
-
-//
-// Inst is fmul.
-//
-wrap_mul:
- cmpb #0xff,DNRM_FLG(%a6) //if both ops denorm,
- beq force_unf //force an underflow (really!)
-//
-// One of the ops is denormalized. Test for wrap condition
-// and complete the instruction.
-//
- cmpb #0x0f,DNRM_FLG(%a6) //check for dest denorm
- bnes mul_srcd
-mul_destd:
- bsrl ckinf_ns
- bne fix_stk
- bfextu ETEMP_EX(%a6){#1:#15},%d0 //get src exp (always pos)
- bfexts FPTEMP_EX(%a6){#1:#15},%d1 //get dest exp (always neg)
- addl %d1,%d0 //subtract dest from src
- bgt fix_stk
- bra force_unf
-mul_srcd:
- bsrl ckinf_nd
- bne fix_stk
- bfextu FPTEMP_EX(%a6){#1:#15},%d0 //get dest exp (always pos)
- bfexts ETEMP_EX(%a6){#1:#15},%d1 //get src exp (always neg)
- addl %d1,%d0 //subtract src from dest
- bgt fix_stk
-
-//
-// This code handles the case of the instruction resulting in
-// an underflow condition.
-//
-force_unf:
- bclrb #E1,E_BYTE(%a6)
- orl #unfinx_mask,USER_FPSR(%a6)
- clrw NMNEXC(%a6)
- clrb WBTEMP_SGN(%a6)
- movew ETEMP_EX(%a6),%d0 //find the sign of the result
- movew FPTEMP_EX(%a6),%d1
- eorw %d1,%d0
- andiw #0x8000,%d0
- beqs frcunfcont
- st WBTEMP_SGN(%a6)
-frcunfcont:
- lea WBTEMP(%a6),%a0 //point a0 to memory location
- movew CMDREG1B(%a6),%d0
- btstl #6,%d0 //test for forced precision
- beqs frcunf_fpcr
- btstl #2,%d0 //check for double
- bnes frcunf_dbl
- movel #0x1,%d0 //inst is forced single
- bras frcunf_rnd
-frcunf_dbl:
- movel #0x2,%d0 //inst is forced double
- bras frcunf_rnd
-frcunf_fpcr:
- bfextu FPCR_MODE(%a6){#0:#2},%d0 //inst not forced - use fpcr prec
-frcunf_rnd:
- bsrl unf_sub //get correct result based on
-// ;round precision/mode. This
-// ;sets FPSR_CC correctly
- bfclr WBTEMP_SGN(%a6){#0:#8} //convert back to IEEE ext format
- beqs frcfpn
- bsetb #sign_bit,WBTEMP_EX(%a6)
- bra frcfpn
-
-//
-// Write the result to the user's fpn. All results must be HUGE to be
-// written; otherwise the results would have overflowed or underflowed.
-// If the rounding precision is single or double, the ovf_res routine
-// is needed to correctly supply the max value.
-//
-frcfpnr:
- movew CMDREG1B(%a6),%d0
- btstl #6,%d0 //test for forced precision
- beqs frcfpn_fpcr
- btstl #2,%d0 //check for double
- bnes frcfpn_dbl
- movel #0x1,%d0 //inst is forced single
- bras frcfpn_rnd
-frcfpn_dbl:
- movel #0x2,%d0 //inst is forced double
- bras frcfpn_rnd
-frcfpn_fpcr:
- bfextu FPCR_MODE(%a6){#0:#2},%d0 //inst not forced - use fpcr prec
- tstb %d0
- beqs frcfpn //if extended, write what you got
-frcfpn_rnd:
- bclrb #sign_bit,WBTEMP_EX(%a6)
- sne WBTEMP_SGN(%a6)
- bsrl ovf_res //get correct result based on
-// ;round precision/mode. This
-// ;sets FPSR_CC correctly
- bfclr WBTEMP_SGN(%a6){#0:#8} //convert back to IEEE ext format
- beqs frcfpn_clr
- bsetb #sign_bit,WBTEMP_EX(%a6)
-frcfpn_clr:
- orl #ovfinx_mask,USER_FPSR(%a6)
-//
-// Perform the write.
-//
-frcfpn:
- bfextu CMDREG1B(%a6){#6:#3},%d0 //extract fp destination register
- cmpib #3,%d0
- bles frc0123 //check if dest is fp0-fp3
- movel #7,%d1
- subl %d0,%d1
- clrl %d0
- bsetl %d1,%d0
- fmovemx WBTEMP(%a6),%d0
- rts
-frc0123:
- cmpib #0,%d0
- beqs frc0_dst
- cmpib #1,%d0
- beqs frc1_dst
- cmpib #2,%d0
- beqs frc2_dst
-frc3_dst:
- movel WBTEMP_EX(%a6),USER_FP3(%a6)
- movel WBTEMP_HI(%a6),USER_FP3+4(%a6)
- movel WBTEMP_LO(%a6),USER_FP3+8(%a6)
- rts
-frc2_dst:
- movel WBTEMP_EX(%a6),USER_FP2(%a6)
- movel WBTEMP_HI(%a6),USER_FP2+4(%a6)
- movel WBTEMP_LO(%a6),USER_FP2+8(%a6)
- rts
-frc1_dst:
- movel WBTEMP_EX(%a6),USER_FP1(%a6)
- movel WBTEMP_HI(%a6),USER_FP1+4(%a6)
- movel WBTEMP_LO(%a6),USER_FP1+8(%a6)
- rts
-frc0_dst:
- movel WBTEMP_EX(%a6),USER_FP0(%a6)
- movel WBTEMP_HI(%a6),USER_FP0+4(%a6)
- movel WBTEMP_LO(%a6),USER_FP0+8(%a6)
- rts
-
-//
-// Write etemp to fpn.
-// A check is made on enabled and signalled snan exceptions,
-// and the destination is not overwritten if this condition exists.
-// This code is designed to make fmoveins of unsupported data types
-// faster.
-//
-wr_etemp:
- btstb #snan_bit,FPSR_EXCEPT(%a6) //if snan is set, and
- beqs fmoveinc //enabled, force restore
- btstb #snan_bit,FPCR_ENABLE(%a6) //and don't overwrite
- beqs fmoveinc //the dest
- movel ETEMP_EX(%a6),FPTEMP_EX(%a6) //set up fptemp sign for
-// ;snan handler
- tstb ETEMP(%a6) //check for negative
- blts snan_neg
- rts
-snan_neg:
- orl #neg_bit,USER_FPSR(%a6) //snan is negative; set N
- rts
-fmoveinc:
- clrw NMNEXC(%a6)
- bclrb #E1,E_BYTE(%a6)
- moveb STAG(%a6),%d0 //check if stag is inf
- andib #0xe0,%d0
- cmpib #0x40,%d0
- bnes fminc_cnan
- orl #inf_mask,USER_FPSR(%a6) //if inf, nothing yet has set I
- tstw LOCAL_EX(%a0) //check sign
- bges fminc_con
- orl #neg_mask,USER_FPSR(%a6)
- bra fminc_con
-fminc_cnan:
- cmpib #0x60,%d0 //check if stag is NaN
- bnes fminc_czero
- orl #nan_mask,USER_FPSR(%a6) //if nan, nothing yet has set NaN
- movel ETEMP_EX(%a6),FPTEMP_EX(%a6) //set up fptemp sign for
-// ;snan handler
- tstw LOCAL_EX(%a0) //check sign
- bges fminc_con
- orl #neg_mask,USER_FPSR(%a6)
- bra fminc_con
-fminc_czero:
- cmpib #0x20,%d0 //check if zero
- bnes fminc_con
- orl #z_mask,USER_FPSR(%a6) //if zero, set Z
- tstw LOCAL_EX(%a0) //check sign
- bges fminc_con
- orl #neg_mask,USER_FPSR(%a6)
-fminc_con:
- bfextu CMDREG1B(%a6){#6:#3},%d0 //extract fp destination register
- cmpib #3,%d0
- bles fp0123 //check if dest is fp0-fp3
- movel #7,%d1
- subl %d0,%d1
- clrl %d0
- bsetl %d1,%d0
- fmovemx ETEMP(%a6),%d0
- rts
-
-fp0123:
- cmpib #0,%d0
- beqs fp0_dst
- cmpib #1,%d0
- beqs fp1_dst
- cmpib #2,%d0
- beqs fp2_dst
-fp3_dst:
- movel ETEMP_EX(%a6),USER_FP3(%a6)
- movel ETEMP_HI(%a6),USER_FP3+4(%a6)
- movel ETEMP_LO(%a6),USER_FP3+8(%a6)
- rts
-fp2_dst:
- movel ETEMP_EX(%a6),USER_FP2(%a6)
- movel ETEMP_HI(%a6),USER_FP2+4(%a6)
- movel ETEMP_LO(%a6),USER_FP2+8(%a6)
- rts
-fp1_dst:
- movel ETEMP_EX(%a6),USER_FP1(%a6)
- movel ETEMP_HI(%a6),USER_FP1+4(%a6)
- movel ETEMP_LO(%a6),USER_FP1+8(%a6)
- rts
-fp0_dst:
- movel ETEMP_EX(%a6),USER_FP0(%a6)
- movel ETEMP_HI(%a6),USER_FP0+4(%a6)
- movel ETEMP_LO(%a6),USER_FP0+8(%a6)
- rts
-
-opclass3:
- st CU_ONLY(%a6)
- movew CMDREG1B(%a6),%d0 //check if packed moveout
- andiw #0x0c00,%d0 //isolate last 2 bits of size field
- cmpiw #0x0c00,%d0 //if size is 011 or 111, it is packed
- beq pack_out //else it is norm or denorm
- bra mv_out
-
-
-//
-// MOVE OUT
-//
-
-mv_tbl:
- .long li
- .long sgp
- .long xp
- .long mvout_end //should never be taken
- .long wi
- .long dp
- .long bi
- .long mvout_end //should never be taken
-mv_out:
- bfextu CMDREG1B(%a6){#3:#3},%d1 //put source specifier in d1
- leal mv_tbl,%a0
- movel %a0@(%d1:l:4),%a0
- jmp (%a0)
-
-//
-// This exit is for move-out to memory. The aunfl bit is
-// set if the result is inex and unfl is signalled.
-//
-mvout_end:
- btstb #inex2_bit,FPSR_EXCEPT(%a6)
- beqs no_aufl
- btstb #unfl_bit,FPSR_EXCEPT(%a6)
- beqs no_aufl
- bsetb #aunfl_bit,FPSR_AEXCEPT(%a6)
-no_aufl:
- clrw NMNEXC(%a6)
- bclrb #E1,E_BYTE(%a6)
- fmovel #0,%FPSR //clear any cc bits from res_func
-//
-// Return ETEMP to extended format from internal extended format so
-// that gen_except will have a correctly signed value for ovfl/unfl
-// handlers.
-//
- bfclr ETEMP_SGN(%a6){#0:#8}
- beqs mvout_con
- bsetb #sign_bit,ETEMP_EX(%a6)
-mvout_con:
- rts
-//
-// This exit is for move-out to int register. The aunfl bit is
-// not set in any case for this move.
-//
-mvouti_end:
- clrw NMNEXC(%a6)
- bclrb #E1,E_BYTE(%a6)
- fmovel #0,%FPSR //clear any cc bits from res_func
-//
-// Return ETEMP to extended format from internal extended format so
-// that gen_except will have a correctly signed value for ovfl/unfl
-// handlers.
-//
- bfclr ETEMP_SGN(%a6){#0:#8}
- beqs mvouti_con
- bsetb #sign_bit,ETEMP_EX(%a6)
-mvouti_con:
- rts
-//
-// li is used to handle a long integer source specifier
-//
-
-li:
- moveql #4,%d0 //set byte count
-
- btstb #7,STAG(%a6) //check for extended denorm
- bne int_dnrm //if so, branch
-
- fmovemx ETEMP(%a6),%fp0-%fp0
- fcmpd #0x41dfffffffc00000,%fp0
-// 41dfffffffc00000 in dbl prec = 401d0000fffffffe00000000 in ext prec
- fbge lo_plrg
- fcmpd #0xc1e0000000000000,%fp0
-// c1e0000000000000 in dbl prec = c01e00008000000000000000 in ext prec
- fble lo_nlrg
-//
-// at this point, the answer is between the largest pos and neg values
-//
- movel USER_FPCR(%a6),%d1 //use user's rounding mode
- andil #0x30,%d1
- fmovel %d1,%fpcr
- fmovel %fp0,L_SCR1(%a6) //let the 040 perform conversion
- fmovel %fpsr,%d1
- orl %d1,USER_FPSR(%a6) //capture inex2/ainex if set
- bra int_wrt
-
-
-lo_plrg:
- movel #0x7fffffff,L_SCR1(%a6) //answer is largest positive int
- fbeq int_wrt //exact answer
- fcmpd #0x41dfffffffe00000,%fp0
-// 41dfffffffe00000 in dbl prec = 401d0000ffffffff00000000 in ext prec
- fbge int_operr //set operr
- bra int_inx //set inexact
-
-lo_nlrg:
- movel #0x80000000,L_SCR1(%a6)
- fbeq int_wrt //exact answer
- fcmpd #0xc1e0000000100000,%fp0
-// c1e0000000100000 in dbl prec = c01e00008000000080000000 in ext prec
- fblt int_operr //set operr
- bra int_inx //set inexact
-
-//
-// wi is used to handle a word integer source specifier
-//
-
-wi:
- moveql #2,%d0 //set byte count
-
- btstb #7,STAG(%a6) //check for extended denorm
- bne int_dnrm //branch if so
-
- fmovemx ETEMP(%a6),%fp0-%fp0
- fcmps #0x46fffe00,%fp0
-// 46fffe00 in sgl prec = 400d0000fffe000000000000 in ext prec
- fbge wo_plrg
- fcmps #0xc7000000,%fp0
-// c7000000 in sgl prec = c00e00008000000000000000 in ext prec
- fble wo_nlrg
-
-//
-// at this point, the answer is between the largest pos and neg values
-//
- movel USER_FPCR(%a6),%d1 //use user's rounding mode
- andil #0x30,%d1
- fmovel %d1,%fpcr
- fmovew %fp0,L_SCR1(%a6) //let the 040 perform conversion
- fmovel %fpsr,%d1
- orl %d1,USER_FPSR(%a6) //capture inex2/ainex if set
- bra int_wrt
-
-wo_plrg:
- movew #0x7fff,L_SCR1(%a6) //answer is largest positive int
- fbeq int_wrt //exact answer
- fcmps #0x46ffff00,%fp0
-// 46ffff00 in sgl prec = 400d0000ffff000000000000 in ext prec
- fbge int_operr //set operr
- bra int_inx //set inexact
-
-wo_nlrg:
- movew #0x8000,L_SCR1(%a6)
- fbeq int_wrt //exact answer
- fcmps #0xc7000080,%fp0
-// c7000080 in sgl prec = c00e00008000800000000000 in ext prec
- fblt int_operr //set operr
- bra int_inx //set inexact
-
-//
-// bi is used to handle a byte integer source specifier
-//
-
-bi:
- moveql #1,%d0 //set byte count
-
- btstb #7,STAG(%a6) //check for extended denorm
- bne int_dnrm //branch if so
-
- fmovemx ETEMP(%a6),%fp0-%fp0
- fcmps #0x42fe0000,%fp0
-// 42fe0000 in sgl prec = 40050000fe00000000000000 in ext prec
- fbge by_plrg
- fcmps #0xc3000000,%fp0
-// c3000000 in sgl prec = c00600008000000000000000 in ext prec
- fble by_nlrg
-
-//
-// at this point, the answer is between the largest pos and neg values
-//
- movel USER_FPCR(%a6),%d1 //use user's rounding mode
- andil #0x30,%d1
- fmovel %d1,%fpcr
- fmoveb %fp0,L_SCR1(%a6) //let the 040 perform conversion
- fmovel %fpsr,%d1
- orl %d1,USER_FPSR(%a6) //capture inex2/ainex if set
- bra int_wrt
-
-by_plrg:
- moveb #0x7f,L_SCR1(%a6) //answer is largest positive int
- fbeq int_wrt //exact answer
- fcmps #0x42ff0000,%fp0
-// 42ff0000 in sgl prec = 40050000ff00000000000000 in ext prec
- fbge int_operr //set operr
- bra int_inx //set inexact
-
-by_nlrg:
- moveb #0x80,L_SCR1(%a6)
- fbeq int_wrt //exact answer
- fcmps #0xc3008000,%fp0
-// c3008000 in sgl prec = c00600008080000000000000 in ext prec
- fblt int_operr //set operr
- bra int_inx //set inexact
-
-//
-// Common integer routines
-//
-// int_drnrm---account for possible nonzero result for round up with positive
-// operand and round down for negative answer. In the first case (result = 1)
-// byte-width (store in d0) of result must be honored. In the second case,
-// -1 in L_SCR1(a6) will cover all contingencies (FMOVE.B/W/L out).
-
-int_dnrm:
- movel #0,L_SCR1(%a6) // initialize result to 0
- bfextu FPCR_MODE(%a6){#2:#2},%d1 // d1 is the rounding mode
- cmpb #2,%d1
- bmis int_inx // if RN or RZ, done
- bnes int_rp // if RP, continue below
- tstw ETEMP(%a6) // RM: store -1 in L_SCR1 if src is negative
- bpls int_inx // otherwise result is 0
- movel #-1,L_SCR1(%a6)
- bras int_inx
-int_rp:
- tstw ETEMP(%a6) // RP: store +1 of proper width in L_SCR1 if
-// ; source is greater than 0
- bmis int_inx // otherwise, result is 0
- lea L_SCR1(%a6),%a1 // a1 is address of L_SCR1
- addal %d0,%a1 // offset by destination width -1
- subal #1,%a1
- bsetb #0,(%a1) // set low bit at a1 address
-int_inx:
- oril #inx2a_mask,USER_FPSR(%a6)
- bras int_wrt
-int_operr:
- fmovemx %fp0-%fp0,FPTEMP(%a6) //FPTEMP must contain the extended
-// ;precision source that needs to be
-// ;converted to integer this is required
-// ;if the operr exception is enabled.
-// ;set operr/aiop (no inex2 on int ovfl)
-
- oril #opaop_mask,USER_FPSR(%a6)
-// ;fall through to perform int_wrt
-int_wrt:
- movel EXC_EA(%a6),%a1 //load destination address
- tstl %a1 //check to see if it is a dest register
- beqs wrt_dn //write data register
- lea L_SCR1(%a6),%a0 //point to supervisor source address
- bsrl mem_write
- bra mvouti_end
-
-wrt_dn:
- movel %d0,-(%sp) //d0 currently contains the size to write
- bsrl get_fline //get_fline returns Dn in d0
- andiw #0x7,%d0 //isolate register
- movel (%sp)+,%d1 //get size
- cmpil #4,%d1 //most frequent case
- beqs sz_long
- cmpil #2,%d1
- bnes sz_con
- orl #8,%d0 //add 'word' size to register#
- bras sz_con
-sz_long:
- orl #0x10,%d0 //add 'long' size to register#
-sz_con:
- movel %d0,%d1 //reg_dest expects size:reg in d1
- bsrl reg_dest //load proper data register
- bra mvouti_end
-xp:
- lea ETEMP(%a6),%a0
- bclrb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0)
- btstb #7,STAG(%a6) //check for extended denorm
- bne xdnrm
- clrl %d0
- bras do_fp //do normal case
-sgp:
- lea ETEMP(%a6),%a0
- bclrb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0)
- btstb #7,STAG(%a6) //check for extended denorm
- bne sp_catas //branch if so
- movew LOCAL_EX(%a0),%d0
- lea sp_bnds,%a1
- cmpw (%a1),%d0
- blt sp_under
- cmpw 2(%a1),%d0
- bgt sp_over
- movel #1,%d0 //set destination format to single
- bras do_fp //do normal case
-dp:
- lea ETEMP(%a6),%a0
- bclrb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0)
-
- btstb #7,STAG(%a6) //check for extended denorm
- bne dp_catas //branch if so
-
- movew LOCAL_EX(%a0),%d0
- lea dp_bnds,%a1
-
- cmpw (%a1),%d0
- blt dp_under
- cmpw 2(%a1),%d0
- bgt dp_over
-
- movel #2,%d0 //set destination format to double
-// ;fall through to do_fp
-//
-do_fp:
- bfextu FPCR_MODE(%a6){#2:#2},%d1 //rnd mode in d1
- swap %d0 //rnd prec in upper word
- addl %d0,%d1 //d1 has PREC/MODE info
-
- clrl %d0 //clear g,r,s
-
- bsrl round //round
-
- movel %a0,%a1
- movel EXC_EA(%a6),%a0
-
- bfextu CMDREG1B(%a6){#3:#3},%d1 //extract destination format
-// ;at this point only the dest
-// ;formats sgl, dbl, ext are
-// ;possible
- cmpb #2,%d1
- bgts ddbl //double=5, extended=2, single=1
- bnes dsgl
-// ;fall through to dext
-dext:
- bsrl dest_ext
- bra mvout_end
-dsgl:
- bsrl dest_sgl
- bra mvout_end
-ddbl:
- bsrl dest_dbl
- bra mvout_end
-
-//
-// Handle possible denorm or catastrophic underflow cases here
-//
-xdnrm:
- bsr set_xop //initialize WBTEMP
- bsetb #wbtemp15_bit,WB_BYTE(%a6) //set wbtemp15
-
- movel %a0,%a1
- movel EXC_EA(%a6),%a0 //a0 has the destination pointer
- bsrl dest_ext //store to memory
- bsetb #unfl_bit,FPSR_EXCEPT(%a6)
- bra mvout_end
-
-sp_under:
- bsetb #etemp15_bit,STAG(%a6)
-
- cmpw 4(%a1),%d0
- blts sp_catas //catastrophic underflow case
-
- movel #1,%d0 //load in round precision
- movel #sgl_thresh,%d1 //load in single denorm threshold
- bsrl dpspdnrm //expects d1 to have the proper
-// ;denorm threshold
- bsrl dest_sgl //stores value to destination
- bsetb #unfl_bit,FPSR_EXCEPT(%a6)
- bra mvout_end //exit
-
-dp_under:
- bsetb #etemp15_bit,STAG(%a6)
-
- cmpw 4(%a1),%d0
- blts dp_catas //catastrophic underflow case
-
- movel #dbl_thresh,%d1 //load in double precision threshold
- movel #2,%d0
- bsrl dpspdnrm //expects d1 to have proper
-// ;denorm threshold
-// ;expects d0 to have round precision
- bsrl dest_dbl //store value to destination
- bsetb #unfl_bit,FPSR_EXCEPT(%a6)
- bra mvout_end //exit
-
-//
-// Handle catastrophic underflow cases here
-//
-sp_catas:
-// Temp fix for z bit set in unf_sub
- movel USER_FPSR(%a6),-(%a7)
-
- movel #1,%d0 //set round precision to sgl
-
- bsrl unf_sub //a0 points to result
-
- movel (%a7)+,USER_FPSR(%a6)
-
- movel #1,%d0
- subw %d0,LOCAL_EX(%a0) //account for difference between
-// ;denorm/norm bias
-
- movel %a0,%a1 //a1 has the operand input
- movel EXC_EA(%a6),%a0 //a0 has the destination pointer
-
- bsrl dest_sgl //store the result
- oril #unfinx_mask,USER_FPSR(%a6)
- bra mvout_end
-
-dp_catas:
-// Temp fix for z bit set in unf_sub
- movel USER_FPSR(%a6),-(%a7)
-
- movel #2,%d0 //set round precision to dbl
- bsrl unf_sub //a0 points to result
-
- movel (%a7)+,USER_FPSR(%a6)
-
- movel #1,%d0
- subw %d0,LOCAL_EX(%a0) //account for difference between
-// ;denorm/norm bias
-
- movel %a0,%a1 //a1 has the operand input
- movel EXC_EA(%a6),%a0 //a0 has the destination pointer
-
- bsrl dest_dbl //store the result
- oril #unfinx_mask,USER_FPSR(%a6)
- bra mvout_end
-
-//
-// Handle catastrophic overflow cases here
-//
-sp_over:
-// Temp fix for z bit set in unf_sub
- movel USER_FPSR(%a6),-(%a7)
-
- movel #1,%d0
- leal FP_SCR1(%a6),%a0 //use FP_SCR1 for creating result
- movel ETEMP_EX(%a6),(%a0)
- movel ETEMP_HI(%a6),4(%a0)
- movel ETEMP_LO(%a6),8(%a0)
- bsrl ovf_res
-
- movel (%a7)+,USER_FPSR(%a6)
-
- movel %a0,%a1
- movel EXC_EA(%a6),%a0
- bsrl dest_sgl
- orl #ovfinx_mask,USER_FPSR(%a6)
- bra mvout_end
-
-dp_over:
-// Temp fix for z bit set in ovf_res
- movel USER_FPSR(%a6),-(%a7)
-
- movel #2,%d0
- leal FP_SCR1(%a6),%a0 //use FP_SCR1 for creating result
- movel ETEMP_EX(%a6),(%a0)
- movel ETEMP_HI(%a6),4(%a0)
- movel ETEMP_LO(%a6),8(%a0)
- bsrl ovf_res
-
- movel (%a7)+,USER_FPSR(%a6)
-
- movel %a0,%a1
- movel EXC_EA(%a6),%a0
- bsrl dest_dbl
- orl #ovfinx_mask,USER_FPSR(%a6)
- bra mvout_end
-
-//
-// DPSPDNRM
-//
-// This subroutine takes an extended normalized number and denormalizes
-// it to the given round precision. This subroutine also decrements
-// the input operand's exponent by 1 to account for the fact that
-// dest_sgl or dest_dbl expects a normalized number's bias.
-//
-// Input: a0 points to a normalized number in internal extended format
-// d0 is the round precision (=1 for sgl; =2 for dbl)
-// d1 is the the single precision or double precision
-// denorm threshold
-//
-// Output: (In the format for dest_sgl or dest_dbl)
-// a0 points to the destination
-// a1 points to the operand
-//
-// Exceptions: Reports inexact 2 exception by setting USER_FPSR bits
-//
-dpspdnrm:
- movel %d0,-(%a7) //save round precision
- clrl %d0 //clear initial g,r,s
- bsrl dnrm_lp //careful with d0, it's needed by round
-
- bfextu FPCR_MODE(%a6){#2:#2},%d1 //get rounding mode
- swap %d1
- movew 2(%a7),%d1 //set rounding precision
- swap %d1 //at this point d1 has PREC/MODE info
- bsrl round //round result, sets the inex bit in
-// ;USER_FPSR if needed
-
- movew #1,%d0
- subw %d0,LOCAL_EX(%a0) //account for difference in denorm
-// ;vs norm bias
-
- movel %a0,%a1 //a1 has the operand input
- movel EXC_EA(%a6),%a0 //a0 has the destination pointer
- addw #4,%a7 //pop stack
- rts
-//
-// SET_XOP initialized WBTEMP with the value pointed to by a0
-// input: a0 points to input operand in the internal extended format
-//
-set_xop:
- movel LOCAL_EX(%a0),WBTEMP_EX(%a6)
- movel LOCAL_HI(%a0),WBTEMP_HI(%a6)
- movel LOCAL_LO(%a0),WBTEMP_LO(%a6)
- bfclr WBTEMP_SGN(%a6){#0:#8}
- beqs sxop
- bsetb #sign_bit,WBTEMP_EX(%a6)
-sxop:
- bfclr STAG(%a6){#5:#4} //clear wbtm66,wbtm1,wbtm0,sbit
- rts
-//
-// P_MOVE
-//
-p_movet:
- .long p_move
- .long p_movez
- .long p_movei
- .long p_moven
- .long p_move
-p_regd:
- .long p_dyd0
- .long p_dyd1
- .long p_dyd2
- .long p_dyd3
- .long p_dyd4
- .long p_dyd5
- .long p_dyd6
- .long p_dyd7
-
-pack_out:
- leal p_movet,%a0 //load jmp table address
- movew STAG(%a6),%d0 //get source tag
- bfextu %d0{#16:#3},%d0 //isolate source bits
- movel (%a0,%d0.w*4),%a0 //load a0 with routine label for tag
- jmp (%a0) //go to the routine
-
-p_write:
- movel #0x0c,%d0 //get byte count
- movel EXC_EA(%a6),%a1 //get the destination address
- bsr mem_write //write the user's destination
- moveb #0,CU_SAVEPC(%a6) //set the cu save pc to all 0's
-
-//
-// Also note that the dtag must be set to norm here - this is because
-// the 040 uses the dtag to execute the correct microcode.
-//
- bfclr DTAG(%a6){#0:#3} //set dtag to norm
-
- rts
-
-// Notes on handling of special case (zero, inf, and nan) inputs:
-// 1. Operr is not signalled if the k-factor is greater than 18.
-// 2. Per the manual, status bits are not set.
-//
-
-p_move:
- movew CMDREG1B(%a6),%d0
- btstl #kfact_bit,%d0 //test for dynamic k-factor
- beqs statick //if clear, k-factor is static
-dynamick:
- bfextu %d0{#25:#3},%d0 //isolate register for dynamic k-factor
- lea p_regd,%a0
- movel %a0@(%d0:l:4),%a0
- jmp (%a0)
-statick:
- andiw #0x007f,%d0 //get k-factor
- bfexts %d0{#25:#7},%d0 //sign extend d0 for bindec
- leal ETEMP(%a6),%a0 //a0 will point to the packed decimal
- bsrl bindec //perform the convert; data at a6
- leal FP_SCR1(%a6),%a0 //load a0 with result address
- bral p_write
-p_movez:
- leal ETEMP(%a6),%a0 //a0 will point to the packed decimal
- clrw 2(%a0) //clear lower word of exp
- clrl 4(%a0) //load second lword of ZERO
- clrl 8(%a0) //load third lword of ZERO
- bra p_write //go write results
-p_movei:
- fmovel #0,%FPSR //clear aiop
- leal ETEMP(%a6),%a0 //a0 will point to the packed decimal
- clrw 2(%a0) //clear lower word of exp
- bra p_write //go write the result
-p_moven:
- leal ETEMP(%a6),%a0 //a0 will point to the packed decimal
- clrw 2(%a0) //clear lower word of exp
- bra p_write //go write the result
-
-//
-// Routines to read the dynamic k-factor from Dn.
-//
-p_dyd0:
- movel USER_D0(%a6),%d0
- bras statick
-p_dyd1:
- movel USER_D1(%a6),%d0
- bras statick
-p_dyd2:
- movel %d2,%d0
- bras statick
-p_dyd3:
- movel %d3,%d0
- bras statick
-p_dyd4:
- movel %d4,%d0
- bras statick
-p_dyd5:
- movel %d5,%d0
- bras statick
-p_dyd6:
- movel %d6,%d0
- bra statick
-p_dyd7:
- movel %d7,%d0
- bra statick
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/round.s b/c/src/lib/libcpu/m68k/m68040/fpsp/round.s
deleted file mode 100644
index 3acce6e285..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/round.s
+++ /dev/null
@@ -1,651 +0,0 @@
-//
-// $Id$
-//
-// round.sa 3.4 7/29/91
-//
-// handle rounding and normalization tasks
-//
-//
-//
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//ROUND idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
-//
-// round --- round result according to precision/mode
-//
-// a0 points to the input operand in the internal extended format
-// d1(high word) contains rounding precision:
-// ext = $0000xxxx
-// sgl = $0001xxxx
-// dbl = $0002xxxx
-// d1(low word) contains rounding mode:
-// RN = $xxxx0000
-// RZ = $xxxx0001
-// RM = $xxxx0010
-// RP = $xxxx0011
-// d0{31:29} contains the g,r,s bits (extended)
-//
-// On return the value pointed to by a0 is correctly rounded,
-// a0 is preserved and the g-r-s bits in d0 are cleared.
-// The result is not typed - the tag field is invalid. The
-// result is still in the internal extended format.
-//
-// The INEX bit of USER_FPSR will be set if the rounded result was
-// inexact (i.e. if any of the g-r-s bits were set).
-//
-
- .global round
-round:
-// If g=r=s=0 then result is exact and round is done, else set
-// the inex flag in status reg and continue.
-//
- bsrs ext_grs //this subroutine looks at the
-// :rounding precision and sets
-// ;the appropriate g-r-s bits.
- tstl %d0 //if grs are zero, go force
- bne rnd_cont //lower bits to zero for size
-
- swap %d1 //set up d1.w for round prec.
- bra truncate
-
-rnd_cont:
-//
-// Use rounding mode as an index into a jump table for these modes.
-//
- orl #inx2a_mask,USER_FPSR(%a6) //set inex2/ainex
- lea mode_tab,%a1
- movel (%a1,%d1.w*4),%a1
- jmp (%a1)
-//
-// Jump table indexed by rounding mode in d1.w. All following assumes
-// grs != 0.
-//
-mode_tab:
- .long rnd_near
- .long rnd_zero
- .long rnd_mnus
- .long rnd_plus
-//
-// ROUND PLUS INFINITY
-//
-// If sign of fp number = 0 (positive), then add 1 to l.
-//
-rnd_plus:
- swap %d1 //set up d1 for round prec.
- tstb LOCAL_SGN(%a0) //check for sign
- bmi truncate //if positive then truncate
- movel #0xffffffff,%d0 //force g,r,s to be all f's
- lea add_to_l,%a1
- movel (%a1,%d1.w*4),%a1
- jmp (%a1)
-//
-// ROUND MINUS INFINITY
-//
-// If sign of fp number = 1 (negative), then add 1 to l.
-//
-rnd_mnus:
- swap %d1 //set up d1 for round prec.
- tstb LOCAL_SGN(%a0) //check for sign
- bpl truncate //if negative then truncate
- movel #0xffffffff,%d0 //force g,r,s to be all f's
- lea add_to_l,%a1
- movel (%a1,%d1.w*4),%a1
- jmp (%a1)
-//
-// ROUND ZERO
-//
-// Always truncate.
-rnd_zero:
- swap %d1 //set up d1 for round prec.
- bra truncate
-//
-//
-// ROUND NEAREST
-//
-// If (g=1), then add 1 to l and if (r=s=0), then clear l
-// Note that this will round to even in case of a tie.
-//
-rnd_near:
- swap %d1 //set up d1 for round prec.
- asll #1,%d0 //shift g-bit to c-bit
- bcc truncate //if (g=1) then
- lea add_to_l,%a1
- movel (%a1,%d1.w*4),%a1
- jmp (%a1)
-
-//
-// ext_grs --- extract guard, round and sticky bits
-//
-// Input: d1 = PREC:ROUND
-// Output: d0{31:29}= guard, round, sticky
-//
-// The ext_grs extract the guard/round/sticky bits according to the
-// selected rounding precision. It is called by the round subroutine
-// only. All registers except d0 are kept intact. d0 becomes an
-// updated guard,round,sticky in d0{31:29}
-//
-// Notes: the ext_grs uses the round PREC, and therefore has to swap d1
-// prior to usage, and needs to restore d1 to original.
-//
-ext_grs:
- swap %d1 //have d1.w point to round precision
- cmpiw #0,%d1
- bnes sgl_or_dbl
- bras end_ext_grs
-
-sgl_or_dbl:
- moveml %d2/%d3,-(%a7) //make some temp registers
- cmpiw #1,%d1
- bnes grs_dbl
-grs_sgl:
- bfextu LOCAL_HI(%a0){#24:#2},%d3 //sgl prec. g-r are 2 bits right
- movel #30,%d2 //of the sgl prec. limits
- lsll %d2,%d3 //shift g-r bits to MSB of d3
- movel LOCAL_HI(%a0),%d2 //get word 2 for s-bit test
- andil #0x0000003f,%d2 //s bit is the or of all other
- bnes st_stky //bits to the right of g-r
- tstl LOCAL_LO(%a0) //test lower mantissa
- bnes st_stky //if any are set, set sticky
- tstl %d0 //test original g,r,s
- bnes st_stky //if any are set, set sticky
- bras end_sd //if words 3 and 4 are clr, exit
-grs_dbl:
- bfextu LOCAL_LO(%a0){#21:#2},%d3 //dbl-prec. g-r are 2 bits right
- movel #30,%d2 //of the dbl prec. limits
- lsll %d2,%d3 //shift g-r bits to the MSB of d3
- movel LOCAL_LO(%a0),%d2 //get lower mantissa for s-bit test
- andil #0x000001ff,%d2 //s bit is the or-ing of all
- bnes st_stky //other bits to the right of g-r
- tstl %d0 //test word original g,r,s
- bnes st_stky //if any are set, set sticky
- bras end_sd //if clear, exit
-st_stky:
- bset #rnd_stky_bit,%d3
-end_sd:
- movel %d3,%d0 //return grs to d0
- moveml (%a7)+,%d2/%d3 //restore scratch registers
-end_ext_grs:
- swap %d1 //restore d1 to original
- rts
-
-//******************* Local Equates
- .set ad_1_sgl,0x00000100 // constant to add 1 to l-bit in sgl prec
- .set ad_1_dbl,0x00000800 // constant to add 1 to l-bit in dbl prec
-
-
-//Jump table for adding 1 to the l-bit indexed by rnd prec
-
-add_to_l:
- .long add_ext
- .long add_sgl
- .long add_dbl
- .long add_dbl
-//
-// ADD SINGLE
-//
-add_sgl:
- addl #ad_1_sgl,LOCAL_HI(%a0)
- bccs scc_clr //no mantissa overflow
- roxrw LOCAL_HI(%a0) //shift v-bit back in
- roxrw LOCAL_HI+2(%a0) //shift v-bit back in
- addw #0x1,LOCAL_EX(%a0) //and incr exponent
-scc_clr:
- tstl %d0 //test for rs = 0
- bnes sgl_done
- andiw #0xfe00,LOCAL_HI+2(%a0) //clear the l-bit
-sgl_done:
- andil #0xffffff00,LOCAL_HI(%a0) //truncate bits beyond sgl limit
- clrl LOCAL_LO(%a0) //clear d2
- rts
-
-//
-// ADD EXTENDED
-//
-add_ext:
- addql #1,LOCAL_LO(%a0) //add 1 to l-bit
- bccs xcc_clr //test for carry out
- addql #1,LOCAL_HI(%a0) //propagate carry
- bccs xcc_clr
- roxrw LOCAL_HI(%a0) //mant is 0 so restore v-bit
- roxrw LOCAL_HI+2(%a0) //mant is 0 so restore v-bit
- roxrw LOCAL_LO(%a0)
- roxrw LOCAL_LO+2(%a0)
- addw #0x1,LOCAL_EX(%a0) //and inc exp
-xcc_clr:
- tstl %d0 //test rs = 0
- bnes add_ext_done
- andib #0xfe,LOCAL_LO+3(%a0) //clear the l bit
-add_ext_done:
- rts
-//
-// ADD DOUBLE
-//
-add_dbl:
- addl #ad_1_dbl,LOCAL_LO(%a0)
- bccs dcc_clr
- addql #1,LOCAL_HI(%a0) //propagate carry
- bccs dcc_clr
- roxrw LOCAL_HI(%a0) //mant is 0 so restore v-bit
- roxrw LOCAL_HI+2(%a0) //mant is 0 so restore v-bit
- roxrw LOCAL_LO(%a0)
- roxrw LOCAL_LO+2(%a0)
- addw #0x1,LOCAL_EX(%a0) //incr exponent
-dcc_clr:
- tstl %d0 //test for rs = 0
- bnes dbl_done
- andiw #0xf000,LOCAL_LO+2(%a0) //clear the l-bit
-
-dbl_done:
- andil #0xfffff800,LOCAL_LO(%a0) //truncate bits beyond dbl limit
- rts
-
-error:
- rts
-//
-// Truncate all other bits
-//
-trunct:
- .long end_rnd
- .long sgl_done
- .long dbl_done
- .long dbl_done
-
-truncate:
- lea trunct,%a1
- movel (%a1,%d1.w*4),%a1
- jmp (%a1)
-
-end_rnd:
- rts
-
-//
-// NORMALIZE
-//
-// These routines (nrm_zero & nrm_set) normalize the unnorm. This
-// is done by shifting the mantissa left while decrementing the
-// exponent.
-//
-// NRM_SET shifts and decrements until there is a 1 set in the integer
-// bit of the mantissa (msb in d1).
-//
-// NRM_ZERO shifts and decrements until there is a 1 set in the integer
-// bit of the mantissa (msb in d1) unless this would mean the exponent
-// would go less than 0. In that case the number becomes a denorm - the
-// exponent (d0) is set to 0 and the mantissa (d1 & d2) is not
-// normalized.
-//
-// Note that both routines have been optimized (for the worst case) and
-// therefore do not have the easy to follow decrement/shift loop.
-//
-// NRM_ZERO
-//
-// Distance to first 1 bit in mantissa = X
-// Distance to 0 from exponent = Y
-// If X < Y
-// Then
-// nrm_set
-// Else
-// shift mantissa by Y
-// set exponent = 0
-//
-//input:
-// FP_SCR1 = exponent, ms mantissa part, ls mantissa part
-//output:
-// L_SCR1{4} = fpte15 or ete15 bit
-//
- .global nrm_zero
-nrm_zero:
- movew LOCAL_EX(%a0),%d0
- cmpw #64,%d0 //see if exp > 64
- bmis d0_less
- bsr nrm_set //exp > 64 so exp won't exceed 0
- rts
-d0_less:
- moveml %d2/%d3/%d5/%d6,-(%a7)
- movel LOCAL_HI(%a0),%d1
- movel LOCAL_LO(%a0),%d2
-
- bfffo %d1{#0:#32},%d3 //get the distance to the first 1
-// ;in ms mant
- beqs ms_clr //branch if no bits were set
- cmpw %d3,%d0 //of X>Y
- bmis greater //then exp will go past 0 (neg) if
-// ;it is just shifted
- bsr nrm_set //else exp won't go past 0
- moveml (%a7)+,%d2/%d3/%d5/%d6
- rts
-greater:
- movel %d2,%d6 //save ls mant in d6
- lsll %d0,%d2 //shift ls mant by count
- lsll %d0,%d1 //shift ms mant by count
- movel #32,%d5
- subl %d0,%d5 //make op a denorm by shifting bits
- lsrl %d5,%d6 //by the number in the exp, then
-// ;set exp = 0.
- orl %d6,%d1 //shift the ls mant bits into the ms mant
- movel #0,%d0 //same as if decremented exp to 0
-// ;while shifting
- movew %d0,LOCAL_EX(%a0)
- movel %d1,LOCAL_HI(%a0)
- movel %d2,LOCAL_LO(%a0)
- moveml (%a7)+,%d2/%d3/%d5/%d6
- rts
-ms_clr:
- bfffo %d2{#0:#32},%d3 //check if any bits set in ls mant
- beqs all_clr //branch if none set
- addw #32,%d3
- cmpw %d3,%d0 //if X>Y
- bmis greater //then branch
- bsr nrm_set //else exp won't go past 0
- moveml (%a7)+,%d2/%d3/%d5/%d6
- rts
-all_clr:
- movew #0,LOCAL_EX(%a0) //no mantissa bits set. Set exp = 0.
- moveml (%a7)+,%d2/%d3/%d5/%d6
- rts
-//
-// NRM_SET
-//
- .global nrm_set
-nrm_set:
- movel %d7,-(%a7)
- bfffo LOCAL_HI(%a0){#0:#32},%d7 //find first 1 in ms mant to d7)
- beqs lower //branch if ms mant is all 0's
-
- movel %d6,-(%a7)
-
- subw %d7,LOCAL_EX(%a0) //sub exponent by count
- movel LOCAL_HI(%a0),%d0 //d0 has ms mant
- movel LOCAL_LO(%a0),%d1 //d1 has ls mant
-
- lsll %d7,%d0 //shift first 1 to j bit position
- movel %d1,%d6 //copy ls mant into d6
- lsll %d7,%d6 //shift ls mant by count
- movel %d6,LOCAL_LO(%a0) //store ls mant into memory
- moveql #32,%d6
- subl %d7,%d6 //continue shift
- lsrl %d6,%d1 //shift off all bits but those that will
-// ;be shifted into ms mant
- orl %d1,%d0 //shift the ls mant bits into the ms mant
- movel %d0,LOCAL_HI(%a0) //store ms mant into memory
- moveml (%a7)+,%d7/%d6 //restore registers
- rts
-
-//
-// We get here if ms mant was = 0, and we assume ls mant has bits
-// set (otherwise this would have been tagged a zero not a denorm).
-//
-lower:
- movew LOCAL_EX(%a0),%d0 //d0 has exponent
- movel LOCAL_LO(%a0),%d1 //d1 has ls mant
- subw #32,%d0 //account for ms mant being all zeros
- bfffo %d1{#0:#32},%d7 //find first 1 in ls mant to d7)
- subw %d7,%d0 //subtract shift count from exp
- lsll %d7,%d1 //shift first 1 to integer bit in ms mant
- movew %d0,LOCAL_EX(%a0) //store ms mant
- movel %d1,LOCAL_HI(%a0) //store exp
- clrl LOCAL_LO(%a0) //clear ls mant
- movel (%a7)+,%d7
- rts
-//
-// denorm --- denormalize an intermediate result
-//
-// Used by underflow.
-//
-// Input:
-// a0 points to the operand to be denormalized
-// (in the internal extended format)
-//
-// d0: rounding precision
-// Output:
-// a0 points to the denormalized result
-// (in the internal extended format)
-//
-// d0 is guard,round,sticky
-//
-// d0 comes into this routine with the rounding precision. It
-// is then loaded with the denormalized exponent threshold for the
-// rounding precision.
-//
-
- .global denorm
-denorm:
- btstb #6,LOCAL_EX(%a0) //check for exponents between $7fff-$4000
- beqs no_sgn_ext
- bsetb #7,LOCAL_EX(%a0) //sign extend if it is so
-no_sgn_ext:
-
- cmpib #0,%d0 //if 0 then extended precision
- bnes not_ext //else branch
-
- clrl %d1 //load d1 with ext threshold
- clrl %d0 //clear the sticky flag
- bsr dnrm_lp //denormalize the number
- tstb %d1 //check for inex
- beq no_inex //if clr, no inex
- bras dnrm_inex //if set, set inex
-
-not_ext:
- cmpil #1,%d0 //if 1 then single precision
- beqs load_sgl //else must be 2, double prec
-
-load_dbl:
- movew #dbl_thresh,%d1 //put copy of threshold in d1
- movel %d1,%d0 //copy d1 into d0
- subw LOCAL_EX(%a0),%d0 //diff = threshold - exp
- cmpw #67,%d0 //if diff > 67 (mant + grs bits)
- bpls chk_stky //then branch (all bits would be
-// ; shifted off in denorm routine)
- clrl %d0 //else clear the sticky flag
- bsr dnrm_lp //denormalize the number
- tstb %d1 //check flag
- beqs no_inex //if clr, no inex
- bras dnrm_inex //if set, set inex
-
-load_sgl:
- movew #sgl_thresh,%d1 //put copy of threshold in d1
- movel %d1,%d0 //copy d1 into d0
- subw LOCAL_EX(%a0),%d0 //diff = threshold - exp
- cmpw #67,%d0 //if diff > 67 (mant + grs bits)
- bpls chk_stky //then branch (all bits would be
-// ; shifted off in denorm routine)
- clrl %d0 //else clear the sticky flag
- bsr dnrm_lp //denormalize the number
- tstb %d1 //check flag
- beqs no_inex //if clr, no inex
- bras dnrm_inex //if set, set inex
-
-chk_stky:
- tstl LOCAL_HI(%a0) //check for any bits set
- bnes set_stky
- tstl LOCAL_LO(%a0) //check for any bits set
- bnes set_stky
- bras clr_mant
-set_stky:
- orl #inx2a_mask,USER_FPSR(%a6) //set inex2/ainex
- movel #0x20000000,%d0 //set sticky bit in return value
-clr_mant:
- movew %d1,LOCAL_EX(%a0) //load exp with threshold
- movel #0,LOCAL_HI(%a0) //set d1 = 0 (ms mantissa)
- movel #0,LOCAL_LO(%a0) //set d2 = 0 (ms mantissa)
- rts
-dnrm_inex:
- orl #inx2a_mask,USER_FPSR(%a6) //set inex2/ainex
-no_inex:
- rts
-
-//
-// dnrm_lp --- normalize exponent/mantissa to specified threshold
-//
-// Input:
-// a0 points to the operand to be denormalized
-// d0{31:29} initial guard,round,sticky
-// d1{15:0} denormalization threshold
-// Output:
-// a0 points to the denormalized operand
-// d0{31:29} final guard,round,sticky
-// d1.b inexact flag: all ones means inexact result
-//
-// The LOCAL_LO and LOCAL_GRS parts of the value are copied to FP_SCR2
-// so that bfext can be used to extract the new low part of the mantissa.
-// Dnrm_lp can be called with a0 pointing to ETEMP or WBTEMP and there
-// is no LOCAL_GRS scratch word following it on the fsave frame.
-//
- .global dnrm_lp
-dnrm_lp:
- movel %d2,-(%sp) //save d2 for temp use
- btstb #E3,E_BYTE(%a6) //test for type E3 exception
- beqs not_E3 //not type E3 exception
- bfextu WBTEMP_GRS(%a6){#6:#3},%d2 //extract guard,round, sticky bit
- movel #29,%d0
- lsll %d0,%d2 //shift g,r,s to their positions
- movel %d2,%d0
-not_E3:
- movel (%sp)+,%d2 //restore d2
- movel LOCAL_LO(%a0),FP_SCR2+LOCAL_LO(%a6)
- movel %d0,FP_SCR2+LOCAL_GRS(%a6)
- movel %d1,%d0 //copy the denorm threshold
- subw LOCAL_EX(%a0),%d1 //d1 = threshold - uns exponent
- bles no_lp //d1 <= 0
- cmpw #32,%d1
- blts case_1 //0 = d1 < 32
- cmpw #64,%d1
- blts case_2 //32 <= d1 < 64
- bra case_3 //d1 >= 64
-//
-// No normalization necessary
-//
-no_lp:
- clrb %d1 //set no inex2 reported
- movel FP_SCR2+LOCAL_GRS(%a6),%d0 //restore original g,r,s
- rts
-//
-// case (0<d1<32)
-//
-case_1:
- movel %d2,-(%sp)
- movew %d0,LOCAL_EX(%a0) //exponent = denorm threshold
- movel #32,%d0
- subw %d1,%d0 //d0 = 32 - d1
- bfextu LOCAL_EX(%a0){%d0:#32},%d2
- bfextu %d2{%d1:%d0},%d2 //d2 = new LOCAL_HI
- bfextu LOCAL_HI(%a0){%d0:#32},%d1 //d1 = new LOCAL_LO
- bfextu FP_SCR2+LOCAL_LO(%a6){%d0:#32},%d0 //d0 = new G,R,S
- movel %d2,LOCAL_HI(%a0) //store new LOCAL_HI
- movel %d1,LOCAL_LO(%a0) //store new LOCAL_LO
- clrb %d1
- bftst %d0{#2:#30}
- beqs c1nstky
- bsetl #rnd_stky_bit,%d0
- st %d1
-c1nstky:
- movel FP_SCR2+LOCAL_GRS(%a6),%d2 //restore original g,r,s
- andil #0xe0000000,%d2 //clear all but G,R,S
- tstl %d2 //test if original G,R,S are clear
- beqs grs_clear
- orl #0x20000000,%d0 //set sticky bit in d0
-grs_clear:
- andil #0xe0000000,%d0 //clear all but G,R,S
- movel (%sp)+,%d2
- rts
-//
-// case (32<=d1<64)
-//
-case_2:
- movel %d2,-(%sp)
- movew %d0,LOCAL_EX(%a0) //unsigned exponent = threshold
- subw #32,%d1 //d1 now between 0 and 32
- movel #32,%d0
- subw %d1,%d0 //d0 = 32 - d1
- bfextu LOCAL_EX(%a0){%d0:#32},%d2
- bfextu %d2{%d1:%d0},%d2 //d2 = new LOCAL_LO
- bfextu LOCAL_HI(%a0){%d0:#32},%d1 //d1 = new G,R,S
- bftst %d1{#2:#30}
- bnes c2_sstky //bra if sticky bit to be set
- bftst FP_SCR2+LOCAL_LO(%a6){%d0:#32}
- bnes c2_sstky //bra if sticky bit to be set
- movel %d1,%d0
- clrb %d1
- bras end_c2
-c2_sstky:
- movel %d1,%d0
- bsetl #rnd_stky_bit,%d0
- st %d1
-end_c2:
- clrl LOCAL_HI(%a0) //store LOCAL_HI = 0
- movel %d2,LOCAL_LO(%a0) //store LOCAL_LO
- movel FP_SCR2+LOCAL_GRS(%a6),%d2 //restore original g,r,s
- andil #0xe0000000,%d2 //clear all but G,R,S
- tstl %d2 //test if original G,R,S are clear
- beqs clear_grs
- orl #0x20000000,%d0 //set sticky bit in d0
-clear_grs:
- andil #0xe0000000,%d0 //get rid of all but G,R,S
- movel (%sp)+,%d2
- rts
-//
-// d1 >= 64 Force the exponent to be the denorm threshold with the
-// correct sign.
-//
-case_3:
- movew %d0,LOCAL_EX(%a0)
- tstw LOCAL_SGN(%a0)
- bges c3con
-c3neg:
- orl #0x80000000,LOCAL_EX(%a0)
-c3con:
- cmpw #64,%d1
- beqs sixty_four
- cmpw #65,%d1
- beqs sixty_five
-//
-// Shift value is out of range. Set d1 for inex2 flag and
-// return a zero with the given threshold.
-//
- clrl LOCAL_HI(%a0)
- clrl LOCAL_LO(%a0)
- movel #0x20000000,%d0
- st %d1
- rts
-
-sixty_four:
- movel LOCAL_HI(%a0),%d0
- bfextu %d0{#2:#30},%d1
- andil #0xc0000000,%d0
- bras c3com
-
-sixty_five:
- movel LOCAL_HI(%a0),%d0
- bfextu %d0{#1:#31},%d1
- andil #0x80000000,%d0
- lsrl #1,%d0 //shift high bit into R bit
-
-c3com:
- tstl %d1
- bnes c3ssticky
- tstl LOCAL_LO(%a0)
- bnes c3ssticky
- tstb FP_SCR2+LOCAL_GRS(%a6)
- bnes c3ssticky
- clrb %d1
- bras c3end
-
-c3ssticky:
- bsetl #rnd_stky_bit,%d0
- st %d1
-c3end:
- clrl LOCAL_HI(%a0)
- clrl LOCAL_LO(%a0)
- rts
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/rtems_fpsp.c b/c/src/lib/libcpu/m68k/m68040/fpsp/rtems_fpsp.c
deleted file mode 100644
index fefce81bc9..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/rtems_fpsp.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems/system.h>
-/*
-#include <rtems/score/isr.h>
-*/
-
-/*
- * User exception handlers
- */
-proc_ptr M68040FPSPUserExceptionHandlers[9];
-
-/*
- * Intercept requests to install an exception handler.
- * FPSP exceptions get special treatment.
- */
-static int
-FPSP_install_raw_handler (unsigned32 vector, proc_ptr new_handler, proc_ptr *old_handler)
-{
- int fpspVector;
-
- switch (vector) {
- default: return 0; /* Non-FPSP vector */
- case 11: fpspVector = 0; break; /* F-line */
- case 48: fpspVector = 1; break; /* BSUN */
- case 49: fpspVector = 2; break; /* INEXACT */
- case 50: fpspVector = 3; break; /* DIVIDE-BY-ZERO */
- case 51: fpspVector = 4; break; /* UNDERFLOW */
- case 52: fpspVector = 5; break; /* OPERAND ERROR */
- case 53: fpspVector = 6; break; /* OVERFLOW */
- case 54: fpspVector = 7; break; /* SIGNALLING NAN */
- case 55: fpspVector = 8; break; /* UNIMPLEMENTED DATA TYPE */
- }
- *old_handler = M68040FPSPUserExceptionHandlers[fpspVector];
- M68040FPSPUserExceptionHandlers[fpspVector] = new_handler;
- return 1;
-}
-
-/*
- * Attach floating point exception vectors to M68040FPSP entry points
- *
- * NOTE: Uses M68K rather than M68040 in the name so all CPUs having
- * an FPSP can share the same code in RTEMS proper.
- */
-void
-M68KFPSPInstallExceptionHandlers (void)
-{
- extern void _fpspEntry_fline();
- extern void _fpspEntry_bsun();
- extern void _fpspEntry_inex();
- extern void _fpspEntry_dz();
- extern void _fpspEntry_unfl();
- extern void _fpspEntry_ovfl();
- extern void _fpspEntry_operr();
- extern void _fpspEntry_snan();
- extern void _fpspEntry_unsupp();
- static struct {
- int vector_number;
- void (*handler)();
- } fpspHandlers[] = {
- { 11, _fpspEntry_fline },
- { 48, _fpspEntry_bsun },
- { 49, _fpspEntry_inex },
- { 50, _fpspEntry_dz },
- { 51, _fpspEntry_unfl },
- { 52, _fpspEntry_operr },
- { 53, _fpspEntry_ovfl },
- { 54, _fpspEntry_snan },
- { 55, _fpspEntry_unsupp },
- };
- int i;
- proc_ptr oldHandler;
-
- for (i = 0 ; i < sizeof fpspHandlers / sizeof fpspHandlers[0] ; i++) {
- _CPU_ISR_install_raw_handler(fpspHandlers[i].vector_number, fpspHandlers[i].handler, &oldHandler);
- M68040FPSPUserExceptionHandlers[i] = oldHandler;
- }
- _FPSP_install_raw_handler = FPSP_install_raw_handler;
-}
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/rtems_skel.s b/c/src/lib/libcpu/m68k/m68040/fpsp/rtems_skel.s
deleted file mode 100644
index 1c5d1cdc7f..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/rtems_skel.s
+++ /dev/null
@@ -1,399 +0,0 @@
-//
-// $Id$
-//
-// skeleton.sa 3.2 4/26/91
-//
-// This file contains code that is system dependent and will
-// need to be modified to install the FPSP.
-//
-// Each entry point for exception 'xxxx' begins with a 'jmp fpsp_xxxx'.
-// Put any target system specific handling that must be done immediately
-// before the jump instruction. If there no handling necessary, then
-// the 'fpsp_xxxx' handler entry point should be placed in the exception
-// table so that the 'jmp' can be eliminated. If the FPSP determines that the
-// exception is one that must be reported then there will be a
-// return from the package by a 'jmp real_xxxx'. At that point
-// the machine state will be identical to the state before
-// the FPSP was entered. In particular, whatever condition
-// that caused the exception will still be pending when the FPSP
-// package returns. Thus, there will be system specific code
-// to handle the exception.
-//
-// If the exception was completely handled by the package, then
-// the return will be via a 'jmp fpsp_done'. Unless there is
-// OS specific work to be done (such as handling a context switch or
-// interrupt) the user program can be resumed via 'rte'.
-//
-// In the following skeleton code, some typical 'real_xxxx' handling
-// code is shown. This code may need to be moved to an appropriate
-// place in the target system, or rewritten.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-// $Id$
-
-//
-// Modified for Linux-1.3.x by Jes Sorensen (jds@kom.auc.dk)
-// Modified for RTEMS 4.0.0 by Eric Norum (eric@skatter.usask.ca)
-//
-
-#include <asm.h>
-
-//SKELETON idnt 2,1 | Motorola 040 Floating Point Software Package
-
-#include "fpsp.defs"
-
-//
-// Divide by Zero exception
-//
-// All dz exceptions are 'real', hence no fpsp_dz entry point.
-//
- .global SYM(_fpspEntry_dz)
-SYM(_fpspEntry_dz):
- link a6,#-LOCAL_SIZE
- fsave -(sp)
- bclrb #E1,E_BYTE(a6)
- frestore (sp)+
- unlk a6
- jmp ([SYM(M68040FPSPUserExceptionHandlers)+3*4],%za0)
-
-//
-// Inexact exception
-//
-// All inexact exceptions are real, but the 'real' handler
-// will probably want to clear the pending exception.
-// The provided code will clear the E3 exception (if pending),
-// otherwise clear the E1 exception. The frestore is not really
-// necessary for E1 exceptions.
-//
-// Code following the 'inex' label is to handle bug #1232. In this
-// bug, if an E1 snan, ovfl, or unfl occurred, and the process was
-// swapped out before taking the exception, the exception taken on
-// return was inex, rather than the correct exception. The snan, ovfl,
-// and unfl exception to be taken must not have been enabled. The
-// fix is to check for E1, and the existence of one of snan, ovfl,
-// or unfl bits set in the fpsr. If any of these are set, branch
-// to the appropriate handler for the exception in the fpsr. Note
-// that this fix is only for d43b parts, and is skipped if the
-// version number is not $40.
-//
-//
- .global SYM(_fpspEntry_inex)
- .global real_inex
-SYM(_fpspEntry_inex):
- link a6,#-LOCAL_SIZE
- fsave -(sp)
- cmpib #VER_40,(sp) //test version number
- bnes not_fmt40
- fmovel fpsr,-(sp)
- btstb #E1,E_BYTE(a6) //test for E1 set
- beqs not_b1232
- btstb #snan_bit,2(sp) //test for snan
- beq inex_ckofl
- addl #4,sp
- frestore (sp)+
- unlk a6
- bra snan
-inex_ckofl:
- btstb #ovfl_bit,2(sp) //test for ovfl
- beq inex_ckufl
- addl #4,sp
- frestore (sp)+
- unlk a6
- bra SYM(_fpspEntry_ovfl)
-inex_ckufl:
- btstb #unfl_bit,2(sp) //test for unfl
- beq not_b1232
- addl #4,sp
- frestore (sp)+
- unlk a6
- bra SYM(_fpspEntry_unfl)
-
-//
-// We do not have the bug 1232 case. Clean up the stack and call
-// real_inex.
-//
-not_b1232:
- addl #4,sp
- frestore (sp)+
- unlk a6
-
-real_inex:
- link a6,#-LOCAL_SIZE
- fsave -(sp)
-not_fmt40:
- bclrb #E3,E_BYTE(a6) //clear and test E3 flag
- beqs inex_cke1
-//
-// Clear dirty bit on dest resister in the frame before branching
-// to b1238_fix.
-//
- moveml d0/d1,USER_DA(a6)
- bfextu CMDREG1B(a6){#6:#3},d0 //get dest reg no
- bclrb d0,FPR_DIRTY_BITS(a6) //clr dest dirty bit
- bsrl b1238_fix //test for bug1238 case
- moveml USER_DA(a6),d0/d1
- bras inex_done
-inex_cke1:
- bclrb #E1,E_BYTE(a6)
-inex_done:
- frestore (sp)+
- unlk a6
- jmp ([SYM(M68040FPSPUserExceptionHandlers)+2*4],%za0)
-
-//
-// Overflow exception
-//
- .global SYM(_fpspEntry_ovfl)
- .global real_ovfl
-SYM(_fpspEntry_ovfl):
- jmp fpsp_ovfl
-real_ovfl:
- link a6,#-LOCAL_SIZE
- fsave -(sp)
- bclrb #E3,E_BYTE(a6) //clear and test E3 flag
- bnes ovfl_done
- bclrb #E1,E_BYTE(a6)
-ovfl_done:
- frestore (sp)+
- unlk a6
- jmp ([SYM(M68040FPSPUserExceptionHandlers)+6*4],%za0)
-
-//
-// Underflow exception
-//
- .global SYM(_fpspEntry_unfl)
- .global real_unfl
-SYM(_fpspEntry_unfl):
- jmp fpsp_unfl
-real_unfl:
- link a6,#-LOCAL_SIZE
- fsave -(sp)
- bclrb #E3,E_BYTE(a6) //clear and test E3 flag
- bnes unfl_done
- bclrb #E1,E_BYTE(a6)
-unfl_done:
- frestore (sp)+
- unlk a6
- jmp ([SYM(M68040FPSPUserExceptionHandlers)+4*4],%za0)
-
-//
-// Signalling NAN exception
-//
- .global SYM(_fpspEntry_snan)
- .global real_snan
-SYM(_fpspEntry_snan):
-snan:
- jmp fpsp_snan
-real_snan:
- link a6,#-LOCAL_SIZE
- fsave -(sp)
- bclrb #E1,E_BYTE(a6) //snan is always an E1 exception
- frestore (sp)+
- unlk a6
- jmp ([SYM(M68040FPSPUserExceptionHandlers)+7*4],%za0)
-
-//
-// Operand Error exception
-//
- .global SYM(_fpspEntry_operr)
- .global real_operr
-SYM(_fpspEntry_operr):
- jmp fpsp_operr
-real_operr:
- link a6,#-LOCAL_SIZE
- fsave -(sp)
- bclrb #E1,E_BYTE(a6) //operr is always an E1 exception
- frestore (sp)+
- unlk a6
- jmp ([SYM(M68040FPSPUserExceptionHandlers)+5*4],%za0)
-
-//
-// BSUN exception
-//
-// This sample handler simply clears the nan bit in the FPSR.
-//
- .global SYM(_fpspEntry_bsun)
- .global real_bsun
-SYM(_fpspEntry_bsun):
- jmp fpsp_bsun
-real_bsun:
- link a6,#-LOCAL_SIZE
- fsave -(sp)
- bclrb #E1,E_BYTE(a6) //bsun is always an E1 exception
- fmovel fpsr,-(sp)
- bclrb #nan_bit,(sp)
- fmovel (sp)+,fpsr
- frestore (sp)+
- unlk a6
- jmp ([SYM(M68040FPSPUserExceptionHandlers)+1*4],%za0)
-
-//
-// F-line exception
-//
-// A 'real' F-line exception is one that the FPSP is not supposed to
-// handle. E.g. an instruction with a co-processor ID that is not 1.
-//
- .global SYM(_fpspEntry_fline)
- .global real_fline
-SYM(_fpspEntry_fline):
- jmp fpsp_fline
-real_fline:
- jmp ([SYM(M68040FPSPUserExceptionHandlers)+0*4],%za0)
-
-//
-// Unsupported data type exception
-//
- .global SYM(_fpspEntry_unsupp)
- .global real_unsupp
-SYM(_fpspEntry_unsupp):
- jmp fpsp_unsupp
-real_unsupp:
- link a6,#-LOCAL_SIZE
- fsave -(sp)
- bclrb #E1,E_BYTE(a6) //unsupp is always an E1 exception
- frestore (sp)+
- unlk a6
- jmp ([SYM(M68040FPSPUserExceptionHandlers)+8*4],%za0)
-
-//
-// Trace exception
-//
- .global real_trace
-real_trace:
- trap #10
-
-//
-// fpsp_fmt_error --- exit point for frame format error
-//
-// The fpu stack frame does not match the frames existing
-// or planned at the time of this writing. The fpsp is
-// unable to handle frame sizes not in the following
-// version:size pairs:
-//
-// {4060, 4160} - busy frame
-// {4028, 4130} - unimp frame
-// {4000, 4100} - idle frame
-//
- .global fpsp_fmt_error
-fpsp_fmt_error:
- trap #11
-
-//
-// fpsp_done --- FPSP exit point
-//
-// The exception has been handled by the package and we are ready
-// to return to user mode, but there may be OS specific code
-// to execute before we do. If there is, do it now.
-//
-// For now, the RTEMS does not bother looking at the
-// possibility that it is time to reschedule....
-//
-
- .global fpsp_done
-fpsp_done:
- rte
-
-//
-// mem_write --- write to user or supervisor address space
-//
-// Writes to memory while in supervisor mode.
-//
-// a0 - supervisor source address
-// a1 - user/supervisor destination address
-// d0 - number of bytes to write (maximum count is 12)
-//
- .global mem_write
-mem_write:
- btstb #5,EXC_SR(a6) //check for supervisor state
- beqs user_write
-super_write:
- moveb (a0)+,(a1)+
- subql #1,d0
- bnes super_write
- rts
-user_write:
- movel d1,-(sp) //preserve d1 just in case
- movel d0,-(sp)
- movel a1,-(sp)
- movel a0,-(sp)
- jsr copyout
- addw #12,sp
- movel (sp)+,d1
- rts
-//
-// mem_read --- read from user or supervisor address space
-//
-// Reads from memory while in supervisor mode.
-//
-// The FPSP calls mem_read to read the original F-line instruction in order
-// to extract the data register number when the 'Dn' addressing mode is
-// used.
-//
-//Input:
-// a0 - user/supervisor source address
-// a1 - supervisor destination address
-// d0 - number of bytes to read (maximum count is 12)
-//
-// Like mem_write, mem_read always reads with a supervisor
-// destination address on the supervisor stack. Also like mem_write,
-// the EXC_SR is checked and a simple memory copy is done if reading
-// from supervisor space is indicated.
-//
- .global mem_read
-mem_read:
- btstb #5,EXC_SR(a6) //check for supervisor state
- beqs user_read
-super_read:
- moveb (a0)+,(a1)+
- subql #1,d0
- bnes super_read
- rts
-user_read:
- movel d1,-(sp) //preserve d1 just in case
- movel d0,-(sp)
- movel a1,-(sp)
- movel a0,-(sp)
- jsr copyin
- addw #12,sp
- movel (sp)+,d1
- rts
-
-//
-// Use these routines if your kernel does not have copyout/copyin equivalents.
-// Assumes that D0/D1/A0/A1 are scratch registers. copyout overwrites DFC,
-// and copyin overwrites SFC.
-//
-copyout:
- movel 4(sp),a0 // source
- movel 8(sp),a1 // destination
- movel 12(sp),d0 // count
- subl #1,d0 // dec count by 1 for dbra
- movel #1,d1
- movec d1,dfc // set dfc for user data space
-moreout:
- moveb (a0)+,d1 // fetch supervisor byte
- movesb d1,(a1)+ // write user byte
- dbf d0,moreout
- rts
-
-copyin:
- movel 4(sp),a0 // source
- movel 8(sp),a1 // destination
- movel 12(sp),d0 // count
- subl #1,d0 // dec count by 1 for dbra
- movel #1,d1
- movec d1,sfc // set sfc for user space
-morein:
- movesb (a0)+,d1 // fetch user byte
- moveb d1,(a1)+ // write supervisor byte
- dbf d0,morein
- rts
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/sacos.s b/c/src/lib/libcpu/m68k/m68040/fpsp/sacos.s
deleted file mode 100644
index f4f2c10252..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/sacos.s
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// $Id$
-//
-// sacos.sa 3.3 12/19/90
-//
-// Description: The entry point sAcos computes the inverse cosine of
-// an input argument; sAcosd does the same except for denormalized
-// input.
-//
-// Input: Double-extended number X in location pointed to
-// by address register a0.
-//
-// Output: The value arccos(X) returned in floating-point register Fp0.
-//
-// Accuracy and Monotonicity: The returned result is within 3 ulps in
-// 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-// result is subsequently rounded to double precision. The
-// result is provably monotonic in double precision.
-//
-// Speed: The program sCOS takes approximately 310 cycles.
-//
-// Algorithm:
-//
-// ACOS
-// 1. If |X| >= 1, go to 3.
-//
-// 2. (|X| < 1) Calculate acos(X) by
-// z := (1-X) / (1+X)
-// acos(X) = 2 * atan( sqrt(z) ).
-// Exit.
-//
-// 3. If |X| > 1, go to 5.
-//
-// 4. (|X| = 1) If X > 0, return 0. Otherwise, return Pi. Exit.
-//
-// 5. (|X| > 1) Generate an invalid operation by 0 * infinity.
-// Exit.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//SACOS idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-PI: .long 0x40000000,0xC90FDAA2,0x2168C235,0x00000000
-PIBY2: .long 0x3FFF0000,0xC90FDAA2,0x2168C235,0x00000000
-
- |xref t_operr
- |xref t_frcinx
- |xref satan
-
- .global sacosd
-sacosd:
-//--ACOS(X) = PI/2 FOR DENORMALIZED X
- fmovel %d1,%fpcr // ...load user's rounding mode/precision
- fmovex PIBY2,%fp0
- bra t_frcinx
-
- .global sacos
-sacos:
- fmovex (%a0),%fp0 // ...LOAD INPUT
-
- movel (%a0),%d0 // ...pack exponent with upper 16 fraction
- movew 4(%a0),%d0
- andil #0x7FFFFFFF,%d0
- cmpil #0x3FFF8000,%d0
- bges ACOSBIG
-
-//--THIS IS THE USUAL CASE, |X| < 1
-//--ACOS(X) = 2 * ATAN( SQRT( (1-X)/(1+X) ) )
-
- fmoves #0x3F800000,%fp1
- faddx %fp0,%fp1 // ...1+X
- fnegx %fp0 // ... -X
- fadds #0x3F800000,%fp0 // ...1-X
- fdivx %fp1,%fp0 // ...(1-X)/(1+X)
- fsqrtx %fp0 // ...SQRT((1-X)/(1+X))
- fmovemx %fp0-%fp0,(%a0) // ...overwrite input
- movel %d1,-(%sp) //save original users fpcr
- clrl %d1
- bsr satan // ...ATAN(SQRT([1-X]/[1+X]))
- fmovel (%sp)+,%fpcr //restore users exceptions
- faddx %fp0,%fp0 // ...2 * ATAN( STUFF )
- bra t_frcinx
-
-ACOSBIG:
- fabsx %fp0
- fcmps #0x3F800000,%fp0
- fbgt t_operr //cause an operr exception
-
-//--|X| = 1, ACOS(X) = 0 OR PI
- movel (%a0),%d0 // ...pack exponent with upper 16 fraction
- movew 4(%a0),%d0
- cmpl #0,%d0 //D0 has original exponent+fraction
- bgts ACOSP1
-
-//--X = -1
-//Returns PI and inexact exception
- fmovex PI,%fp0
- fmovel %d1,%FPCR
- fadds #0x00800000,%fp0 //cause an inexact exception to be put
-// ;into the 040 - will not trap until next
-// ;fp inst.
- bra t_frcinx
-
-ACOSP1:
- fmovel %d1,%FPCR
- fmoves #0x00000000,%fp0
- rts //Facos ; of +1 is exact
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/sasin.s b/c/src/lib/libcpu/m68k/m68040/fpsp/sasin.s
deleted file mode 100644
index 44de0ae440..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/sasin.s
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// $Id$
-//
-// sasin.sa 3.3 12/19/90
-//
-// Description: The entry point sAsin computes the inverse sine of
-// an input argument; sAsind does the same except for denormalized
-// input.
-//
-// Input: Double-extended number X in location pointed to
-// by address register a0.
-//
-// Output: The value arcsin(X) returned in floating-point register Fp0.
-//
-// Accuracy and Monotonicity: The returned result is within 3 ulps in
-// 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-// result is subsequently rounded to double precision. The
-// result is provably monotonic in double precision.
-//
-// Speed: The program sASIN takes approximately 310 cycles.
-//
-// Algorithm:
-//
-// ASIN
-// 1. If |X| >= 1, go to 3.
-//
-// 2. (|X| < 1) Calculate asin(X) by
-// z := sqrt( [1-X][1+X] )
-// asin(X) = atan( x / z ).
-// Exit.
-//
-// 3. If |X| > 1, go to 5.
-//
-// 4. (|X| = 1) sgn := sign(X), return asin(X) := sgn * Pi/2. Exit.
-//
-// 5. (|X| > 1) Generate an invalid operation by 0 * infinity.
-// Exit.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//SASIN idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-PIBY2: .long 0x3FFF0000,0xC90FDAA2,0x2168C235,0x00000000
-
- |xref t_operr
- |xref t_frcinx
- |xref t_extdnrm
- |xref satan
-
- .global sasind
-sasind:
-//--ASIN(X) = X FOR DENORMALIZED X
-
- bra t_extdnrm
-
- .global sasin
-sasin:
- fmovex (%a0),%fp0 // ...LOAD INPUT
-
- movel (%a0),%d0
- movew 4(%a0),%d0
- andil #0x7FFFFFFF,%d0
- cmpil #0x3FFF8000,%d0
- bges asinbig
-
-//--THIS IS THE USUAL CASE, |X| < 1
-//--ASIN(X) = ATAN( X / SQRT( (1-X)(1+X) ) )
-
- fmoves #0x3F800000,%fp1
- fsubx %fp0,%fp1 // ...1-X
- fmovemx %fp2-%fp2,-(%a7)
- fmoves #0x3F800000,%fp2
- faddx %fp0,%fp2 // ...1+X
- fmulx %fp2,%fp1 // ...(1+X)(1-X)
- fmovemx (%a7)+,%fp2-%fp2
- fsqrtx %fp1 // ...SQRT([1-X][1+X])
- fdivx %fp1,%fp0 // ...X/SQRT([1-X][1+X])
- fmovemx %fp0-%fp0,(%a0)
- bsr satan
- bra t_frcinx
-
-asinbig:
- fabsx %fp0 // ...|X|
- fcmps #0x3F800000,%fp0
- fbgt t_operr //cause an operr exception
-
-//--|X| = 1, ASIN(X) = +- PI/2.
-
- fmovex PIBY2,%fp0
- movel (%a0),%d0
- andil #0x80000000,%d0 // ...SIGN BIT OF X
- oril #0x3F800000,%d0 // ...+-1 IN SGL FORMAT
- movel %d0,-(%sp) // ...push SIGN(X) IN SGL-FMT
- fmovel %d1,%FPCR
- fmuls (%sp)+,%fp0
- bra t_frcinx
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/satan.s b/c/src/lib/libcpu/m68k/m68040/fpsp/satan.s
deleted file mode 100644
index 68733dc482..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/satan.s
+++ /dev/null
@@ -1,480 +0,0 @@
-//
-// $Id$
-//
-// satan.sa 3.3 12/19/90
-//
-// The entry point satan computes the arctangent of an
-// input value. satand does the same except the input value is a
-// denormalized number.
-//
-// Input: Double-extended value in memory location pointed to by address
-// register a0.
-//
-// Output: Arctan(X) returned in floating-point register Fp0.
-//
-// Accuracy and Monotonicity: The returned result is within 2 ulps in
-// 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-// result is subsequently rounded to double precision. The
-// result is provably monotonic in double precision.
-//
-// Speed: The program satan takes approximately 160 cycles for input
-// argument X such that 1/16 < |X| < 16. For the other arguments,
-// the program will run no worse than 10% slower.
-//
-// Algorithm:
-// Step 1. If |X| >= 16 or |X| < 1/16, go to Step 5.
-//
-// Step 2. Let X = sgn * 2**k * 1.xxxxxxxx...x. Note that k = -4, -3,..., or 3.
-// Define F = sgn * 2**k * 1.xxxx1, i.e. the first 5 significant bits
-// of X with a bit-1 attached at the 6-th bit position. Define u
-// to be u = (X-F) / (1 + X*F).
-//
-// Step 3. Approximate arctan(u) by a polynomial poly.
-//
-// Step 4. Return arctan(F) + poly, arctan(F) is fetched from a table of values
-// calculated beforehand. Exit.
-//
-// Step 5. If |X| >= 16, go to Step 7.
-//
-// Step 6. Approximate arctan(X) by an odd polynomial in X. Exit.
-//
-// Step 7. Define X' = -1/X. Approximate arctan(X') by an odd polynomial in X'.
-// Arctan(X) = sign(X)*Pi/2 + arctan(X'). Exit.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//satan idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
-BOUNDS1: .long 0x3FFB8000,0x4002FFFF
-
-ONE: .long 0x3F800000
-
- .long 0x00000000
-
-ATANA3: .long 0xBFF6687E,0x314987D8
-ATANA2: .long 0x4002AC69,0x34A26DB3
-
-ATANA1: .long 0xBFC2476F,0x4E1DA28E
-ATANB6: .long 0x3FB34444,0x7F876989
-
-ATANB5: .long 0xBFB744EE,0x7FAF45DB
-ATANB4: .long 0x3FBC71C6,0x46940220
-
-ATANB3: .long 0xBFC24924,0x921872F9
-ATANB2: .long 0x3FC99999,0x99998FA9
-
-ATANB1: .long 0xBFD55555,0x55555555
-ATANC5: .long 0xBFB70BF3,0x98539E6A
-
-ATANC4: .long 0x3FBC7187,0x962D1D7D
-ATANC3: .long 0xBFC24924,0x827107B8
-
-ATANC2: .long 0x3FC99999,0x9996263E
-ATANC1: .long 0xBFD55555,0x55555536
-
-PPIBY2: .long 0x3FFF0000,0xC90FDAA2,0x2168C235,0x00000000
-NPIBY2: .long 0xBFFF0000,0xC90FDAA2,0x2168C235,0x00000000
-PTINY: .long 0x00010000,0x80000000,0x00000000,0x00000000
-NTINY: .long 0x80010000,0x80000000,0x00000000,0x00000000
-
-ATANTBL:
- .long 0x3FFB0000,0x83D152C5,0x060B7A51,0x00000000
- .long 0x3FFB0000,0x8BC85445,0x65498B8B,0x00000000
- .long 0x3FFB0000,0x93BE4060,0x17626B0D,0x00000000
- .long 0x3FFB0000,0x9BB3078D,0x35AEC202,0x00000000
- .long 0x3FFB0000,0xA3A69A52,0x5DDCE7DE,0x00000000
- .long 0x3FFB0000,0xAB98E943,0x62765619,0x00000000
- .long 0x3FFB0000,0xB389E502,0xF9C59862,0x00000000
- .long 0x3FFB0000,0xBB797E43,0x6B09E6FB,0x00000000
- .long 0x3FFB0000,0xC367A5C7,0x39E5F446,0x00000000
- .long 0x3FFB0000,0xCB544C61,0xCFF7D5C6,0x00000000
- .long 0x3FFB0000,0xD33F62F8,0x2488533E,0x00000000
- .long 0x3FFB0000,0xDB28DA81,0x62404C77,0x00000000
- .long 0x3FFB0000,0xE310A407,0x8AD34F18,0x00000000
- .long 0x3FFB0000,0xEAF6B0A8,0x188EE1EB,0x00000000
- .long 0x3FFB0000,0xF2DAF194,0x9DBE79D5,0x00000000
- .long 0x3FFB0000,0xFABD5813,0x61D47E3E,0x00000000
- .long 0x3FFC0000,0x8346AC21,0x0959ECC4,0x00000000
- .long 0x3FFC0000,0x8B232A08,0x304282D8,0x00000000
- .long 0x3FFC0000,0x92FB70B8,0xD29AE2F9,0x00000000
- .long 0x3FFC0000,0x9ACF476F,0x5CCD1CB4,0x00000000
- .long 0x3FFC0000,0xA29E7630,0x4954F23F,0x00000000
- .long 0x3FFC0000,0xAA68C5D0,0x8AB85230,0x00000000
- .long 0x3FFC0000,0xB22DFFFD,0x9D539F83,0x00000000
- .long 0x3FFC0000,0xB9EDEF45,0x3E900EA5,0x00000000
- .long 0x3FFC0000,0xC1A85F1C,0xC75E3EA5,0x00000000
- .long 0x3FFC0000,0xC95D1BE8,0x28138DE6,0x00000000
- .long 0x3FFC0000,0xD10BF300,0x840D2DE4,0x00000000
- .long 0x3FFC0000,0xD8B4B2BA,0x6BC05E7A,0x00000000
- .long 0x3FFC0000,0xE0572A6B,0xB42335F6,0x00000000
- .long 0x3FFC0000,0xE7F32A70,0xEA9CAA8F,0x00000000
- .long 0x3FFC0000,0xEF888432,0x64ECEFAA,0x00000000
- .long 0x3FFC0000,0xF7170A28,0xECC06666,0x00000000
- .long 0x3FFD0000,0x812FD288,0x332DAD32,0x00000000
- .long 0x3FFD0000,0x88A8D1B1,0x218E4D64,0x00000000
- .long 0x3FFD0000,0x9012AB3F,0x23E4AEE8,0x00000000
- .long 0x3FFD0000,0x976CC3D4,0x11E7F1B9,0x00000000
- .long 0x3FFD0000,0x9EB68949,0x3889A227,0x00000000
- .long 0x3FFD0000,0xA5EF72C3,0x4487361B,0x00000000
- .long 0x3FFD0000,0xAD1700BA,0xF07A7227,0x00000000
- .long 0x3FFD0000,0xB42CBCFA,0xFD37EFB7,0x00000000
- .long 0x3FFD0000,0xBB303A94,0x0BA80F89,0x00000000
- .long 0x3FFD0000,0xC22115C6,0xFCAEBBAF,0x00000000
- .long 0x3FFD0000,0xC8FEF3E6,0x86331221,0x00000000
- .long 0x3FFD0000,0xCFC98330,0xB4000C70,0x00000000
- .long 0x3FFD0000,0xD6807AA1,0x102C5BF9,0x00000000
- .long 0x3FFD0000,0xDD2399BC,0x31252AA3,0x00000000
- .long 0x3FFD0000,0xE3B2A855,0x6B8FC517,0x00000000
- .long 0x3FFD0000,0xEA2D764F,0x64315989,0x00000000
- .long 0x3FFD0000,0xF3BF5BF8,0xBAD1A21D,0x00000000
- .long 0x3FFE0000,0x801CE39E,0x0D205C9A,0x00000000
- .long 0x3FFE0000,0x8630A2DA,0xDA1ED066,0x00000000
- .long 0x3FFE0000,0x8C1AD445,0xF3E09B8C,0x00000000
- .long 0x3FFE0000,0x91DB8F16,0x64F350E2,0x00000000
- .long 0x3FFE0000,0x97731420,0x365E538C,0x00000000
- .long 0x3FFE0000,0x9CE1C8E6,0xA0B8CDBA,0x00000000
- .long 0x3FFE0000,0xA22832DB,0xCADAAE09,0x00000000
- .long 0x3FFE0000,0xA746F2DD,0xB7602294,0x00000000
- .long 0x3FFE0000,0xAC3EC0FB,0x997DD6A2,0x00000000
- .long 0x3FFE0000,0xB110688A,0xEBDC6F6A,0x00000000
- .long 0x3FFE0000,0xB5BCC490,0x59ECC4B0,0x00000000
- .long 0x3FFE0000,0xBA44BC7D,0xD470782F,0x00000000
- .long 0x3FFE0000,0xBEA94144,0xFD049AAC,0x00000000
- .long 0x3FFE0000,0xC2EB4ABB,0x661628B6,0x00000000
- .long 0x3FFE0000,0xC70BD54C,0xE602EE14,0x00000000
- .long 0x3FFE0000,0xCD000549,0xADEC7159,0x00000000
- .long 0x3FFE0000,0xD48457D2,0xD8EA4EA3,0x00000000
- .long 0x3FFE0000,0xDB948DA7,0x12DECE3B,0x00000000
- .long 0x3FFE0000,0xE23855F9,0x69E8096A,0x00000000
- .long 0x3FFE0000,0xE8771129,0xC4353259,0x00000000
- .long 0x3FFE0000,0xEE57C16E,0x0D379C0D,0x00000000
- .long 0x3FFE0000,0xF3E10211,0xA87C3779,0x00000000
- .long 0x3FFE0000,0xF919039D,0x758B8D41,0x00000000
- .long 0x3FFE0000,0xFE058B8F,0x64935FB3,0x00000000
- .long 0x3FFF0000,0x8155FB49,0x7B685D04,0x00000000
- .long 0x3FFF0000,0x83889E35,0x49D108E1,0x00000000
- .long 0x3FFF0000,0x859CFA76,0x511D724B,0x00000000
- .long 0x3FFF0000,0x87952ECF,0xFF8131E7,0x00000000
- .long 0x3FFF0000,0x89732FD1,0x9557641B,0x00000000
- .long 0x3FFF0000,0x8B38CAD1,0x01932A35,0x00000000
- .long 0x3FFF0000,0x8CE7A8D8,0x301EE6B5,0x00000000
- .long 0x3FFF0000,0x8F46A39E,0x2EAE5281,0x00000000
- .long 0x3FFF0000,0x922DA7D7,0x91888487,0x00000000
- .long 0x3FFF0000,0x94D19FCB,0xDEDF5241,0x00000000
- .long 0x3FFF0000,0x973AB944,0x19D2A08B,0x00000000
- .long 0x3FFF0000,0x996FF00E,0x08E10B96,0x00000000
- .long 0x3FFF0000,0x9B773F95,0x12321DA7,0x00000000
- .long 0x3FFF0000,0x9D55CC32,0x0F935624,0x00000000
- .long 0x3FFF0000,0x9F100575,0x006CC571,0x00000000
- .long 0x3FFF0000,0xA0A9C290,0xD97CC06C,0x00000000
- .long 0x3FFF0000,0xA22659EB,0xEBC0630A,0x00000000
- .long 0x3FFF0000,0xA388B4AF,0xF6EF0EC9,0x00000000
- .long 0x3FFF0000,0xA4D35F10,0x61D292C4,0x00000000
- .long 0x3FFF0000,0xA60895DC,0xFBE3187E,0x00000000
- .long 0x3FFF0000,0xA72A51DC,0x7367BEAC,0x00000000
- .long 0x3FFF0000,0xA83A5153,0x0956168F,0x00000000
- .long 0x3FFF0000,0xA93A2007,0x7539546E,0x00000000
- .long 0x3FFF0000,0xAA9E7245,0x023B2605,0x00000000
- .long 0x3FFF0000,0xAC4C84BA,0x6FE4D58F,0x00000000
- .long 0x3FFF0000,0xADCE4A4A,0x606B9712,0x00000000
- .long 0x3FFF0000,0xAF2A2DCD,0x8D263C9C,0x00000000
- .long 0x3FFF0000,0xB0656F81,0xF22265C7,0x00000000
- .long 0x3FFF0000,0xB1846515,0x0F71496A,0x00000000
- .long 0x3FFF0000,0xB28AAA15,0x6F9ADA35,0x00000000
- .long 0x3FFF0000,0xB37B44FF,0x3766B895,0x00000000
- .long 0x3FFF0000,0xB458C3DC,0xE9630433,0x00000000
- .long 0x3FFF0000,0xB525529D,0x562246BD,0x00000000
- .long 0x3FFF0000,0xB5E2CCA9,0x5F9D88CC,0x00000000
- .long 0x3FFF0000,0xB692CADA,0x7ACA1ADA,0x00000000
- .long 0x3FFF0000,0xB736AEA7,0xA6925838,0x00000000
- .long 0x3FFF0000,0xB7CFAB28,0x7E9F7B36,0x00000000
- .long 0x3FFF0000,0xB85ECC66,0xCB219835,0x00000000
- .long 0x3FFF0000,0xB8E4FD5A,0x20A593DA,0x00000000
- .long 0x3FFF0000,0xB99F41F6,0x4AFF9BB5,0x00000000
- .long 0x3FFF0000,0xBA7F1E17,0x842BBE7B,0x00000000
- .long 0x3FFF0000,0xBB471285,0x7637E17D,0x00000000
- .long 0x3FFF0000,0xBBFABE8A,0x4788DF6F,0x00000000
- .long 0x3FFF0000,0xBC9D0FAD,0x2B689D79,0x00000000
- .long 0x3FFF0000,0xBD306A39,0x471ECD86,0x00000000
- .long 0x3FFF0000,0xBDB6C731,0x856AF18A,0x00000000
- .long 0x3FFF0000,0xBE31CAC5,0x02E80D70,0x00000000
- .long 0x3FFF0000,0xBEA2D55C,0xE33194E2,0x00000000
- .long 0x3FFF0000,0xBF0B10B7,0xC03128F0,0x00000000
- .long 0x3FFF0000,0xBF6B7A18,0xDACB778D,0x00000000
- .long 0x3FFF0000,0xBFC4EA46,0x63FA18F6,0x00000000
- .long 0x3FFF0000,0xC0181BDE,0x8B89A454,0x00000000
- .long 0x3FFF0000,0xC065B066,0xCFBF6439,0x00000000
- .long 0x3FFF0000,0xC0AE345F,0x56340AE6,0x00000000
- .long 0x3FFF0000,0xC0F22291,0x9CB9E6A7,0x00000000
-
- .set X,FP_SCR1
- .set XDCARE,X+2
- .set XFRAC,X+4
- .set XFRACLO,X+8
-
- .set ATANF,FP_SCR2
- .set ATANFHI,ATANF+4
- .set ATANFLO,ATANF+8
-
-
- | xref t_frcinx
- |xref t_extdnrm
-
- .global satand
-satand:
-//--ENTRY POINT FOR ATAN(X) FOR DENORMALIZED ARGUMENT
-
- bra t_extdnrm
-
- .global satan
-satan:
-//--ENTRY POINT FOR ATAN(X), HERE X IS FINITE, NON-ZERO, AND NOT NAN'S
-
- fmovex (%a0),%fp0 // ...LOAD INPUT
-
- movel (%a0),%d0
- movew 4(%a0),%d0
- fmovex %fp0,X(%a6)
- andil #0x7FFFFFFF,%d0
-
- cmpil #0x3FFB8000,%d0 // ...|X| >= 1/16?
- bges ATANOK1
- bra ATANSM
-
-ATANOK1:
- cmpil #0x4002FFFF,%d0 // ...|X| < 16 ?
- bles ATANMAIN
- bra ATANBIG
-
-
-//--THE MOST LIKELY CASE, |X| IN [1/16, 16). WE USE TABLE TECHNIQUE
-//--THE IDEA IS ATAN(X) = ATAN(F) + ATAN( [X-F] / [1+XF] ).
-//--SO IF F IS CHOSEN TO BE CLOSE TO X AND ATAN(F) IS STORED IN
-//--A TABLE, ALL WE NEED IS TO APPROXIMATE ATAN(U) WHERE
-//--U = (X-F)/(1+XF) IS SMALL (REMEMBER F IS CLOSE TO X). IT IS
-//--TRUE THAT A DIVIDE IS NOW NEEDED, BUT THE APPROXIMATION FOR
-//--ATAN(U) IS A VERY SHORT POLYNOMIAL AND THE INDEXING TO
-//--FETCH F AND SAVING OF REGISTERS CAN BE ALL HIDED UNDER THE
-//--DIVIDE. IN THE END THIS METHOD IS MUCH FASTER THAN A TRADITIONAL
-//--ONE. NOTE ALSO THAT THE TRADITIONAL SCHEME THAT APPROXIMATE
-//--ATAN(X) DIRECTLY WILL NEED TO USE A RATIONAL APPROXIMATION
-//--(DIVISION NEEDED) ANYWAY BECAUSE A POLYNOMIAL APPROXIMATION
-//--WILL INVOLVE A VERY LONG POLYNOMIAL.
-
-//--NOW WE SEE X AS +-2^K * 1.BBBBBBB....B <- 1. + 63 BITS
-//--WE CHOSE F TO BE +-2^K * 1.BBBB1
-//--THAT IS IT MATCHES THE EXPONENT AND FIRST 5 BITS OF X, THE
-//--SIXTH BITS IS SET TO BE 1. SINCE K = -4, -3, ..., 3, THERE
-//--ARE ONLY 8 TIMES 16 = 2^7 = 128 |F|'S. SINCE ATAN(-|F|) IS
-//-- -ATAN(|F|), WE NEED TO STORE ONLY ATAN(|F|).
-
-ATANMAIN:
-
- movew #0x0000,XDCARE(%a6) // ...CLEAN UP X JUST IN CASE
- andil #0xF8000000,XFRAC(%a6) // ...FIRST 5 BITS
- oril #0x04000000,XFRAC(%a6) // ...SET 6-TH BIT TO 1
- movel #0x00000000,XFRACLO(%a6) // ...LOCATION OF X IS NOW F
-
- fmovex %fp0,%fp1 // ...FP1 IS X
- fmulx X(%a6),%fp1 // ...FP1 IS X*F, NOTE THAT X*F > 0
- fsubx X(%a6),%fp0 // ...FP0 IS X-F
- fadds #0x3F800000,%fp1 // ...FP1 IS 1 + X*F
- fdivx %fp1,%fp0 // ...FP0 IS U = (X-F)/(1+X*F)
-
-//--WHILE THE DIVISION IS TAKING ITS TIME, WE FETCH ATAN(|F|)
-//--CREATE ATAN(F) AND STORE IT IN ATANF, AND
-//--SAVE REGISTERS FP2.
-
- movel %d2,-(%a7) // ...SAVE d2 TEMPORARILY
- movel %d0,%d2 // ...THE EXPO AND 16 BITS OF X
- andil #0x00007800,%d0 // ...4 VARYING BITS OF F'S FRACTION
- andil #0x7FFF0000,%d2 // ...EXPONENT OF F
- subil #0x3FFB0000,%d2 // ...K+4
- asrl #1,%d2
- addl %d2,%d0 // ...THE 7 BITS IDENTIFYING F
- asrl #7,%d0 // ...INDEX INTO TBL OF ATAN(|F|)
- lea ATANTBL,%a1
- addal %d0,%a1 // ...ADDRESS OF ATAN(|F|)
- movel (%a1)+,ATANF(%a6)
- movel (%a1)+,ATANFHI(%a6)
- movel (%a1)+,ATANFLO(%a6) // ...ATANF IS NOW ATAN(|F|)
- movel X(%a6),%d0 // ...LOAD SIGN AND EXPO. AGAIN
- andil #0x80000000,%d0 // ...SIGN(F)
- orl %d0,ATANF(%a6) // ...ATANF IS NOW SIGN(F)*ATAN(|F|)
- movel (%a7)+,%d2 // ...RESTORE d2
-
-//--THAT'S ALL I HAVE TO DO FOR NOW,
-//--BUT ALAS, THE DIVIDE IS STILL CRANKING!
-
-//--U IN FP0, WE ARE NOW READY TO COMPUTE ATAN(U) AS
-//--U + A1*U*V*(A2 + V*(A3 + V)), V = U*U
-//--THE POLYNOMIAL MAY LOOK STRANGE, BUT IS NEVERTHELESS CORRECT.
-//--THE NATURAL FORM IS U + U*V*(A1 + V*(A2 + V*A3))
-//--WHAT WE HAVE HERE IS MERELY A1 = A3, A2 = A1/A3, A3 = A2/A3.
-//--THE REASON FOR THIS REARRANGEMENT IS TO MAKE THE INDEPENDENT
-//--PARTS A1*U*V AND (A2 + ... STUFF) MORE LOAD-BALANCED
-
-
- fmovex %fp0,%fp1
- fmulx %fp1,%fp1
- fmoved ATANA3,%fp2
- faddx %fp1,%fp2 // ...A3+V
- fmulx %fp1,%fp2 // ...V*(A3+V)
- fmulx %fp0,%fp1 // ...U*V
- faddd ATANA2,%fp2 // ...A2+V*(A3+V)
- fmuld ATANA1,%fp1 // ...A1*U*V
- fmulx %fp2,%fp1 // ...A1*U*V*(A2+V*(A3+V))
-
- faddx %fp1,%fp0 // ...ATAN(U), FP1 RELEASED
- fmovel %d1,%FPCR //restore users exceptions
- faddx ATANF(%a6),%fp0 // ...ATAN(X)
- bra t_frcinx
-
-ATANBORS:
-//--|X| IS IN d0 IN COMPACT FORM. FP1, d0 SAVED.
-//--FP0 IS X AND |X| <= 1/16 OR |X| >= 16.
- cmpil #0x3FFF8000,%d0
- bgt ATANBIG // ...I.E. |X| >= 16
-
-ATANSM:
-//--|X| <= 1/16
-//--IF |X| < 2^(-40), RETURN X AS ANSWER. OTHERWISE, APPROXIMATE
-//--ATAN(X) BY X + X*Y*(B1+Y*(B2+Y*(B3+Y*(B4+Y*(B5+Y*B6)))))
-//--WHICH IS X + X*Y*( [B1+Z*(B3+Z*B5)] + [Y*(B2+Z*(B4+Z*B6)] )
-//--WHERE Y = X*X, AND Z = Y*Y.
-
- cmpil #0x3FD78000,%d0
- blt ATANTINY
-//--COMPUTE POLYNOMIAL
- fmulx %fp0,%fp0 // ...FP0 IS Y = X*X
-
-
- movew #0x0000,XDCARE(%a6)
-
- fmovex %fp0,%fp1
- fmulx %fp1,%fp1 // ...FP1 IS Z = Y*Y
-
- fmoved ATANB6,%fp2
- fmoved ATANB5,%fp3
-
- fmulx %fp1,%fp2 // ...Z*B6
- fmulx %fp1,%fp3 // ...Z*B5
-
- faddd ATANB4,%fp2 // ...B4+Z*B6
- faddd ATANB3,%fp3 // ...B3+Z*B5
-
- fmulx %fp1,%fp2 // ...Z*(B4+Z*B6)
- fmulx %fp3,%fp1 // ...Z*(B3+Z*B5)
-
- faddd ATANB2,%fp2 // ...B2+Z*(B4+Z*B6)
- faddd ATANB1,%fp1 // ...B1+Z*(B3+Z*B5)
-
- fmulx %fp0,%fp2 // ...Y*(B2+Z*(B4+Z*B6))
- fmulx X(%a6),%fp0 // ...X*Y
-
- faddx %fp2,%fp1 // ...[B1+Z*(B3+Z*B5)]+[Y*(B2+Z*(B4+Z*B6))]
-
-
- fmulx %fp1,%fp0 // ...X*Y*([B1+Z*(B3+Z*B5)]+[Y*(B2+Z*(B4+Z*B6))])
-
- fmovel %d1,%FPCR //restore users exceptions
- faddx X(%a6),%fp0
-
- bra t_frcinx
-
-ATANTINY:
-//--|X| < 2^(-40), ATAN(X) = X
- movew #0x0000,XDCARE(%a6)
-
- fmovel %d1,%FPCR //restore users exceptions
- fmovex X(%a6),%fp0 //last inst - possible exception set
-
- bra t_frcinx
-
-ATANBIG:
-//--IF |X| > 2^(100), RETURN SIGN(X)*(PI/2 - TINY). OTHERWISE,
-//--RETURN SIGN(X)*PI/2 + ATAN(-1/X).
- cmpil #0x40638000,%d0
- bgt ATANHUGE
-
-//--APPROXIMATE ATAN(-1/X) BY
-//--X'+X'*Y*(C1+Y*(C2+Y*(C3+Y*(C4+Y*C5)))), X' = -1/X, Y = X'*X'
-//--THIS CAN BE RE-WRITTEN AS
-//--X'+X'*Y*( [C1+Z*(C3+Z*C5)] + [Y*(C2+Z*C4)] ), Z = Y*Y.
-
- fmoves #0xBF800000,%fp1 // ...LOAD -1
- fdivx %fp0,%fp1 // ...FP1 IS -1/X
-
-
-//--DIVIDE IS STILL CRANKING
-
- fmovex %fp1,%fp0 // ...FP0 IS X'
- fmulx %fp0,%fp0 // ...FP0 IS Y = X'*X'
- fmovex %fp1,X(%a6) // ...X IS REALLY X'
-
- fmovex %fp0,%fp1
- fmulx %fp1,%fp1 // ...FP1 IS Z = Y*Y
-
- fmoved ATANC5,%fp3
- fmoved ATANC4,%fp2
-
- fmulx %fp1,%fp3 // ...Z*C5
- fmulx %fp1,%fp2 // ...Z*B4
-
- faddd ATANC3,%fp3 // ...C3+Z*C5
- faddd ATANC2,%fp2 // ...C2+Z*C4
-
- fmulx %fp3,%fp1 // ...Z*(C3+Z*C5), FP3 RELEASED
- fmulx %fp0,%fp2 // ...Y*(C2+Z*C4)
-
- faddd ATANC1,%fp1 // ...C1+Z*(C3+Z*C5)
- fmulx X(%a6),%fp0 // ...X'*Y
-
- faddx %fp2,%fp1 // ...[Y*(C2+Z*C4)]+[C1+Z*(C3+Z*C5)]
-
-
- fmulx %fp1,%fp0 // ...X'*Y*([B1+Z*(B3+Z*B5)]
-// ... +[Y*(B2+Z*(B4+Z*B6))])
- faddx X(%a6),%fp0
-
- fmovel %d1,%FPCR //restore users exceptions
-
- btstb #7,(%a0)
- beqs pos_big
-
-neg_big:
- faddx NPIBY2,%fp0
- bra t_frcinx
-
-pos_big:
- faddx PPIBY2,%fp0
- bra t_frcinx
-
-ATANHUGE:
-//--RETURN SIGN(X)*(PIBY2 - TINY) = SIGN(X)*PIBY2 - SIGN(X)*TINY
- btstb #7,(%a0)
- beqs pos_huge
-
-neg_huge:
- fmovex NPIBY2,%fp0
- fmovel %d1,%fpcr
- fsubx NTINY,%fp0
- bra t_frcinx
-
-pos_huge:
- fmovex PPIBY2,%fp0
- fmovel %d1,%fpcr
- fsubx PTINY,%fp0
- bra t_frcinx
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/satanh.s b/c/src/lib/libcpu/m68k/m68040/fpsp/satanh.s
deleted file mode 100644
index 592dfe7d1d..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/satanh.s
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// $Id$
-//
-// satanh.sa 3.3 12/19/90
-//
-// The entry point satanh computes the inverse
-// hyperbolic tangent of
-// an input argument; satanhd does the same except for denormalized
-// input.
-//
-// Input: Double-extended number X in location pointed to
-// by address register a0.
-//
-// Output: The value arctanh(X) returned in floating-point register Fp0.
-//
-// Accuracy and Monotonicity: The returned result is within 3 ulps in
-// 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-// result is subsequently rounded to double precision. The
-// result is provably monotonic in double precision.
-//
-// Speed: The program satanh takes approximately 270 cycles.
-//
-// Algorithm:
-//
-// ATANH
-// 1. If |X| >= 1, go to 3.
-//
-// 2. (|X| < 1) Calculate atanh(X) by
-// sgn := sign(X)
-// y := |X|
-// z := 2y/(1-y)
-// atanh(X) := sgn * (1/2) * logp1(z)
-// Exit.
-//
-// 3. If |X| > 1, go to 5.
-//
-// 4. (|X| = 1) Generate infinity with an appropriate sign and
-// divide-by-zero by
-// sgn := sign(X)
-// atan(X) := sgn / (+0).
-// Exit.
-//
-// 5. (|X| > 1) Generate an invalid operation by 0 * infinity.
-// Exit.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//satanh idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
- |xref t_dz
- |xref t_operr
- |xref t_frcinx
- |xref t_extdnrm
- |xref slognp1
-
- .global satanhd
-satanhd:
-//--ATANH(X) = X FOR DENORMALIZED X
-
- bra t_extdnrm
-
- .global satanh
-satanh:
- movel (%a0),%d0
- movew 4(%a0),%d0
- andil #0x7FFFFFFF,%d0
- cmpil #0x3FFF8000,%d0
- bges ATANHBIG
-
-//--THIS IS THE USUAL CASE, |X| < 1
-//--Y = |X|, Z = 2Y/(1-Y), ATANH(X) = SIGN(X) * (1/2) * LOG1P(Z).
-
- fabsx (%a0),%fp0 // ...Y = |X|
- fmovex %fp0,%fp1
- fnegx %fp1 // ...-Y
- faddx %fp0,%fp0 // ...2Y
- fadds #0x3F800000,%fp1 // ...1-Y
- fdivx %fp1,%fp0 // ...2Y/(1-Y)
- movel (%a0),%d0
- andil #0x80000000,%d0
- oril #0x3F000000,%d0 // ...SIGN(X)*HALF
- movel %d0,-(%sp)
-
- fmovemx %fp0-%fp0,(%a0) // ...overwrite input
- movel %d1,-(%sp)
- clrl %d1
- bsr slognp1 // ...LOG1P(Z)
- fmovel (%sp)+,%fpcr
- fmuls (%sp)+,%fp0
- bra t_frcinx
-
-ATANHBIG:
- fabsx (%a0),%fp0 // ...|X|
- fcmps #0x3F800000,%fp0
- fbgt t_operr
- bra t_dz
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/scale.s b/c/src/lib/libcpu/m68k/m68040/fpsp/scale.s
deleted file mode 100644
index 4a5129d19c..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/scale.s
+++ /dev/null
@@ -1,373 +0,0 @@
-//
-// $Id$
-//
-// scale.sa 3.3 7/30/91
-//
-// The entry point sSCALE computes the destination operand
-// scaled by the source operand. If the absolute value of
-// the source operand is (>= 2^14) an overflow or underflow
-// is returned.
-//
-// The entry point sscale is called from do_func to emulate
-// the fscale unimplemented instruction.
-//
-// Input: Double-extended destination operand in FPTEMP,
-// double-extended source operand in ETEMP.
-//
-// Output: The function returns scale(X,Y) to fp0.
-//
-// Modifies: fp0.
-//
-// Algorithm:
-//
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//SCALE idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref t_ovfl2
- |xref t_unfl
- |xref round
- |xref t_resdnrm
-
-SRC_BNDS: .short 0x3fff,0x400c
-
-//
-// This entry point is used by the unimplemented instruction exception
-// handler.
-//
-//
-//
-// FSCALE
-//
- .global sscale
-sscale:
- fmovel #0,%fpcr //clr user enabled exc
- clrl %d1
- movew FPTEMP(%a6),%d1 //get dest exponent
- smi L_SCR1(%a6) //use L_SCR1 to hold sign
- andil #0x7fff,%d1 //strip sign
- movew ETEMP(%a6),%d0 //check src bounds
- andiw #0x7fff,%d0 //clr sign bit
- cmp2w SRC_BNDS,%d0
- bccs src_in
- cmpiw #0x400c,%d0 //test for too large
- bge src_out
-//
-// The source input is below 1, so we check for denormalized numbers
-// and set unfl.
-//
-src_small:
- moveb DTAG(%a6),%d0
- andib #0xe0,%d0
- tstb %d0
- beqs no_denorm
- st STORE_FLG(%a6) //dest already contains result
- orl #unfl_mask,USER_FPSR(%a6) //set UNFL
-den_done:
- leal FPTEMP(%a6),%a0
- bra t_resdnrm
-no_denorm:
- fmovel USER_FPCR(%a6),%FPCR
- fmovex FPTEMP(%a6),%fp0 //simply return dest
- rts
-
-
-//
-// Source is within 2^14 range. To perform the int operation,
-// move it to d0.
-//
-src_in:
- fmovex ETEMP(%a6),%fp0 //move in src for int
- fmovel #rz_mode,%fpcr //force rz for src conversion
- fmovel %fp0,%d0 //int src to d0
- fmovel #0,%FPSR //clr status from above
- tstw ETEMP(%a6) //check src sign
- blt src_neg
-//
-// Source is positive. Add the src to the dest exponent.
-// The result can be denormalized, if src = 0, or overflow,
-// if the result of the add sets a bit in the upper word.
-//
-src_pos:
- tstw %d1 //check for denorm
- beq dst_dnrm
- addl %d0,%d1 //add src to dest exp
- beqs denorm //if zero, result is denorm
- cmpil #0x7fff,%d1 //test for overflow
- bges ovfl
- tstb L_SCR1(%a6)
- beqs spos_pos
- orw #0x8000,%d1
-spos_pos:
- movew %d1,FPTEMP(%a6) //result in FPTEMP
- fmovel USER_FPCR(%a6),%FPCR
- fmovex FPTEMP(%a6),%fp0 //write result to fp0
- rts
-ovfl:
- tstb L_SCR1(%a6)
- beqs sovl_pos
- orw #0x8000,%d1
-sovl_pos:
- movew FPTEMP(%a6),ETEMP(%a6) //result in ETEMP
- movel FPTEMP_HI(%a6),ETEMP_HI(%a6)
- movel FPTEMP_LO(%a6),ETEMP_LO(%a6)
- bra t_ovfl2
-
-denorm:
- tstb L_SCR1(%a6)
- beqs den_pos
- orw #0x8000,%d1
-den_pos:
- tstl FPTEMP_HI(%a6) //check j bit
- blts nden_exit //if set, not denorm
- movew %d1,ETEMP(%a6) //input expected in ETEMP
- movel FPTEMP_HI(%a6),ETEMP_HI(%a6)
- movel FPTEMP_LO(%a6),ETEMP_LO(%a6)
- orl #unfl_bit,USER_FPSR(%a6) //set unfl
- leal ETEMP(%a6),%a0
- bra t_resdnrm
-nden_exit:
- movew %d1,FPTEMP(%a6) //result in FPTEMP
- fmovel USER_FPCR(%a6),%FPCR
- fmovex FPTEMP(%a6),%fp0 //write result to fp0
- rts
-
-//
-// Source is negative. Add the src to the dest exponent.
-// (The result exponent will be reduced). The result can be
-// denormalized.
-//
-src_neg:
- addl %d0,%d1 //add src to dest
- beqs denorm //if zero, result is denorm
- blts fix_dnrm //if negative, result is
-// ;needing denormalization
- tstb L_SCR1(%a6)
- beqs sneg_pos
- orw #0x8000,%d1
-sneg_pos:
- movew %d1,FPTEMP(%a6) //result in FPTEMP
- fmovel USER_FPCR(%a6),%FPCR
- fmovex FPTEMP(%a6),%fp0 //write result to fp0
- rts
-
-
-//
-// The result exponent is below denorm value. Test for catastrophic
-// underflow and force zero if true. If not, try to shift the
-// mantissa right until a zero exponent exists.
-//
-fix_dnrm:
- cmpiw #0xffc0,%d1 //lower bound for normalization
- blt fix_unfl //if lower, catastrophic unfl
- movew %d1,%d0 //use d0 for exp
- movel %d2,-(%a7) //free d2 for norm
- movel FPTEMP_HI(%a6),%d1
- movel FPTEMP_LO(%a6),%d2
- clrl L_SCR2(%a6)
-fix_loop:
- addw #1,%d0 //drive d0 to 0
- lsrl #1,%d1 //while shifting the
- roxrl #1,%d2 //mantissa to the right
- bccs no_carry
- st L_SCR2(%a6) //use L_SCR2 to capture inex
-no_carry:
- tstw %d0 //it is finished when
- blts fix_loop //d0 is zero or the mantissa
- tstb L_SCR2(%a6)
- beqs tst_zero
- orl #unfl_inx_mask,USER_FPSR(%a6)
-// ;set unfl, aunfl, ainex
-//
-// Test for zero. If zero, simply use fmove to return +/- zero
-// to the fpu.
-//
-tst_zero:
- clrw FPTEMP_EX(%a6)
- tstb L_SCR1(%a6) //test for sign
- beqs tst_con
- orw #0x8000,FPTEMP_EX(%a6) //set sign bit
-tst_con:
- movel %d1,FPTEMP_HI(%a6)
- movel %d2,FPTEMP_LO(%a6)
- movel (%a7)+,%d2
- tstl %d1
- bnes not_zero
- tstl FPTEMP_LO(%a6)
- bnes not_zero
-//
-// Result is zero. Check for rounding mode to set lsb. If the
-// mode is rp, and the zero is positive, return smallest denorm.
-// If the mode is rm, and the zero is negative, return smallest
-// negative denorm.
-//
- btstb #5,FPCR_MODE(%a6) //test if rm or rp
- beqs no_dir
- btstb #4,FPCR_MODE(%a6) //check which one
- beqs zer_rm
-zer_rp:
- tstb L_SCR1(%a6) //check sign
- bnes no_dir //if set, neg op, no inc
- movel #1,FPTEMP_LO(%a6) //set lsb
- bras sm_dnrm
-zer_rm:
- tstb L_SCR1(%a6) //check sign
- beqs no_dir //if clr, neg op, no inc
- movel #1,FPTEMP_LO(%a6) //set lsb
- orl #neg_mask,USER_FPSR(%a6) //set N
- bras sm_dnrm
-no_dir:
- fmovel USER_FPCR(%a6),%FPCR
- fmovex FPTEMP(%a6),%fp0 //use fmove to set cc's
- rts
-
-//
-// The rounding mode changed the zero to a smallest denorm. Call
-// t_resdnrm with exceptional operand in ETEMP.
-//
-sm_dnrm:
- movel FPTEMP_EX(%a6),ETEMP_EX(%a6)
- movel FPTEMP_HI(%a6),ETEMP_HI(%a6)
- movel FPTEMP_LO(%a6),ETEMP_LO(%a6)
- leal ETEMP(%a6),%a0
- bra t_resdnrm
-
-//
-// Result is still denormalized.
-//
-not_zero:
- orl #unfl_mask,USER_FPSR(%a6) //set unfl
- tstb L_SCR1(%a6) //check for sign
- beqs fix_exit
- orl #neg_mask,USER_FPSR(%a6) //set N
-fix_exit:
- bras sm_dnrm
-
-
-//
-// The result has underflowed to zero. Return zero and set
-// unfl, aunfl, and ainex.
-//
-fix_unfl:
- orl #unfl_inx_mask,USER_FPSR(%a6)
- btstb #5,FPCR_MODE(%a6) //test if rm or rp
- beqs no_dir2
- btstb #4,FPCR_MODE(%a6) //check which one
- beqs zer_rm2
-zer_rp2:
- tstb L_SCR1(%a6) //check sign
- bnes no_dir2 //if set, neg op, no inc
- clrl FPTEMP_EX(%a6)
- clrl FPTEMP_HI(%a6)
- movel #1,FPTEMP_LO(%a6) //set lsb
- bras sm_dnrm //return smallest denorm
-zer_rm2:
- tstb L_SCR1(%a6) //check sign
- beqs no_dir2 //if clr, neg op, no inc
- movew #0x8000,FPTEMP_EX(%a6)
- clrl FPTEMP_HI(%a6)
- movel #1,FPTEMP_LO(%a6) //set lsb
- orl #neg_mask,USER_FPSR(%a6) //set N
- bra sm_dnrm //return smallest denorm
-
-no_dir2:
- tstb L_SCR1(%a6)
- bges pos_zero
-neg_zero:
- clrl FP_SCR1(%a6) //clear the exceptional operand
- clrl FP_SCR1+4(%a6) //for gen_except.
- clrl FP_SCR1+8(%a6)
- fmoves #0x80000000,%fp0
- rts
-pos_zero:
- clrl FP_SCR1(%a6) //clear the exceptional operand
- clrl FP_SCR1+4(%a6) //for gen_except.
- clrl FP_SCR1+8(%a6)
- fmoves #0x00000000,%fp0
- rts
-
-//
-// The destination is a denormalized number. It must be handled
-// by first shifting the bits in the mantissa until it is normalized,
-// then adding the remainder of the source to the exponent.
-//
-dst_dnrm:
- moveml %d2/%d3,-(%a7)
- movew FPTEMP_EX(%a6),%d1
- movel FPTEMP_HI(%a6),%d2
- movel FPTEMP_LO(%a6),%d3
-dst_loop:
- tstl %d2 //test for normalized result
- blts dst_norm //exit loop if so
- tstl %d0 //otherwise, test shift count
- beqs dst_fin //if zero, shifting is done
- subil #1,%d0 //dec src
- lsll #1,%d3
- roxll #1,%d2
- bras dst_loop
-//
-// Destination became normalized. Simply add the remaining
-// portion of the src to the exponent.
-//
-dst_norm:
- addw %d0,%d1 //dst is normalized; add src
- tstb L_SCR1(%a6)
- beqs dnrm_pos
- orl #0x8000,%d1
-dnrm_pos:
- movemw %d1,FPTEMP_EX(%a6)
- moveml %d2,FPTEMP_HI(%a6)
- moveml %d3,FPTEMP_LO(%a6)
- fmovel USER_FPCR(%a6),%FPCR
- fmovex FPTEMP(%a6),%fp0
- moveml (%a7)+,%d2/%d3
- rts
-
-//
-// Destination remained denormalized. Call t_excdnrm with
-// exceptional operand in ETEMP.
-//
-dst_fin:
- tstb L_SCR1(%a6) //check for sign
- beqs dst_exit
- orl #neg_mask,USER_FPSR(%a6) //set N
- orl #0x8000,%d1
-dst_exit:
- movemw %d1,ETEMP_EX(%a6)
- moveml %d2,ETEMP_HI(%a6)
- moveml %d3,ETEMP_LO(%a6)
- orl #unfl_mask,USER_FPSR(%a6) //set unfl
- moveml (%a7)+,%d2/%d3
- leal ETEMP(%a6),%a0
- bra t_resdnrm
-
-//
-// Source is outside of 2^14 range. Test the sign and branch
-// to the appropriate exception handler.
-//
-src_out:
- tstb L_SCR1(%a6)
- beqs scro_pos
- orl #0x8000,%d1
-scro_pos:
- movel FPTEMP_HI(%a6),ETEMP_HI(%a6)
- movel FPTEMP_LO(%a6),ETEMP_LO(%a6)
- tstw ETEMP(%a6)
- blts res_neg
-res_pos:
- movew %d1,ETEMP(%a6) //result in ETEMP
- bra t_ovfl2
-res_neg:
- movew %d1,ETEMP(%a6) //result in ETEMP
- leal ETEMP(%a6),%a0
- bra t_unfl
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/scosh.s b/c/src/lib/libcpu/m68k/m68040/fpsp/scosh.s
deleted file mode 100644
index 92e53918c0..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/scosh.s
+++ /dev/null
@@ -1,134 +0,0 @@
-//
-// $Id$
-//
-// scosh.sa 3.1 12/10/90
-//
-// The entry point sCosh computes the hyperbolic cosine of
-// an input argument; sCoshd does the same except for denormalized
-// input.
-//
-// Input: Double-extended number X in location pointed to
-// by address register a0.
-//
-// Output: The value cosh(X) returned in floating-point register Fp0.
-//
-// Accuracy and Monotonicity: The returned result is within 3 ulps in
-// 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-// result is subsequently rounded to double precision. The
-// result is provably monotonic in double precision.
-//
-// Speed: The program sCOSH takes approximately 250 cycles.
-//
-// Algorithm:
-//
-// COSH
-// 1. If |X| > 16380 log2, go to 3.
-//
-// 2. (|X| <= 16380 log2) Cosh(X) is obtained by the formulae
-// y = |X|, z = exp(Y), and
-// cosh(X) = (1/2)*( z + 1/z ).
-// Exit.
-//
-// 3. (|X| > 16380 log2). If |X| > 16480 log2, go to 5.
-//
-// 4. (16380 log2 < |X| <= 16480 log2)
-// cosh(X) = sign(X) * exp(|X|)/2.
-// However, invoking exp(|X|) may cause premature overflow.
-// Thus, we calculate sinh(X) as follows:
-// Y := |X|
-// Fact := 2**(16380)
-// Y' := Y - 16381 log2
-// cosh(X) := Fact * exp(Y').
-// Exit.
-//
-// 5. (|X| > 16480 log2) sinh(X) must overflow. Return
-// Huge*Huge to generate overflow and an infinity with
-// the appropriate sign. Huge is the largest finite number in
-// extended format. Exit.
-//
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//SCOSH idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
- |xref t_ovfl
- |xref t_frcinx
- |xref setox
-
-T1: .long 0x40C62D38,0xD3D64634 // ... 16381 LOG2 LEAD
-T2: .long 0x3D6F90AE,0xB1E75CC7 // ... 16381 LOG2 TRAIL
-
-TWO16380: .long 0x7FFB0000,0x80000000,0x00000000,0x00000000
-
- .global scoshd
-scoshd:
-//--COSH(X) = 1 FOR DENORMALIZED X
-
- fmoves #0x3F800000,%fp0
-
- fmovel %d1,%FPCR
- fadds #0x00800000,%fp0
- bra t_frcinx
-
- .global scosh
-scosh:
- fmovex (%a0),%fp0 // ...LOAD INPUT
-
- movel (%a0),%d0
- movew 4(%a0),%d0
- andil #0x7FFFFFFF,%d0
- cmpil #0x400CB167,%d0
- bgts COSHBIG
-
-//--THIS IS THE USUAL CASE, |X| < 16380 LOG2
-//--COSH(X) = (1/2) * ( EXP(X) + 1/EXP(X) )
-
- fabsx %fp0 // ...|X|
-
- movel %d1,-(%sp)
- clrl %d1
- fmovemx %fp0-%fp0,(%a0) //pass parameter to setox
- bsr setox // ...FP0 IS EXP(|X|)
- fmuls #0x3F000000,%fp0 // ...(1/2)EXP(|X|)
- movel (%sp)+,%d1
-
- fmoves #0x3E800000,%fp1 // ...(1/4)
- fdivx %fp0,%fp1 // ...1/(2 EXP(|X|))
-
- fmovel %d1,%FPCR
- faddx %fp1,%fp0
-
- bra t_frcinx
-
-COSHBIG:
- cmpil #0x400CB2B3,%d0
- bgts COSHHUGE
-
- fabsx %fp0
- fsubd T1(%pc),%fp0 // ...(|X|-16381LOG2_LEAD)
- fsubd T2(%pc),%fp0 // ...|X| - 16381 LOG2, ACCURATE
-
- movel %d1,-(%sp)
- clrl %d1
- fmovemx %fp0-%fp0,(%a0)
- bsr setox
- fmovel (%sp)+,%fpcr
-
- fmulx TWO16380(%pc),%fp0
- bra t_frcinx
-
-COSHHUGE:
- fmovel #0,%fpsr //clr N bit if set by source
- bclrb #7,(%a0) //always return positive value
- fmovemx (%a0),%fp0-%fp0
- bra t_ovfl
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/setox.s b/c/src/lib/libcpu/m68k/m68040/fpsp/setox.s
deleted file mode 100644
index 43e01bc25a..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/setox.s
+++ /dev/null
@@ -1,867 +0,0 @@
-//
-// $Id$
-//
-// setox.sa 3.1 12/10/90
-//
-// The entry point setox computes the exponential of a value.
-// setoxd does the same except the input value is a denormalized
-// number. setoxm1 computes exp(X)-1, and setoxm1d computes
-// exp(X)-1 for denormalized X.
-//
-// INPUT
-// -----
-// Double-extended value in memory location pointed to by address
-// register a0.
-//
-// OUTPUT
-// ------
-// exp(X) or exp(X)-1 returned in floating-point register fp0.
-//
-// ACCURACY and MONOTONICITY
-// -------------------------
-// The returned result is within 0.85 ulps in 64 significant bit, i.e.
-// within 0.5001 ulp to 53 bits if the result is subsequently rounded
-// to double precision. The result is provably monotonic in double
-// precision.
-//
-// SPEED
-// -----
-// Two timings are measured, both in the copy-back mode. The
-// first one is measured when the function is invoked the first time
-// (so the instructions and data are not in cache), and the
-// second one is measured when the function is reinvoked at the same
-// input argument.
-//
-// The program setox takes approximately 210/190 cycles for input
-// argument X whose magnitude is less than 16380 log2, which
-// is the usual situation. For the less common arguments,
-// depending on their values, the program may run faster or slower --
-// but no worse than 10% slower even in the extreme cases.
-//
-// The program setoxm1 takes approximately ???/??? cycles for input
-// argument X, 0.25 <= |X| < 70log2. For |X| < 0.25, it takes
-// approximately ???/??? cycles. For the less common arguments,
-// depending on their values, the program may run faster or slower --
-// but no worse than 10% slower even in the extreme cases.
-//
-// ALGORITHM and IMPLEMENTATION NOTES
-// ----------------------------------
-//
-// setoxd
-// ------
-// Step 1. Set ans := 1.0
-//
-// Step 2. Return ans := ans + sign(X)*2^(-126). Exit.
-// Notes: This will always generate one exception -- inexact.
-//
-//
-// setox
-// -----
-//
-// Step 1. Filter out extreme cases of input argument.
-// 1.1 If |X| >= 2^(-65), go to Step 1.3.
-// 1.2 Go to Step 7.
-// 1.3 If |X| < 16380 log(2), go to Step 2.
-// 1.4 Go to Step 8.
-// Notes: The usual case should take the branches 1.1 -> 1.3 -> 2.
-// To avoid the use of floating-point comparisons, a
-// compact representation of |X| is used. This format is a
-// 32-bit integer, the upper (more significant) 16 bits are
-// the sign and biased exponent field of |X|; the lower 16
-// bits are the 16 most significant fraction (including the
-// explicit bit) bits of |X|. Consequently, the comparisons
-// in Steps 1.1 and 1.3 can be performed by integer comparison.
-// Note also that the constant 16380 log(2) used in Step 1.3
-// is also in the compact form. Thus taking the branch
-// to Step 2 guarantees |X| < 16380 log(2). There is no harm
-// to have a small number of cases where |X| is less than,
-// but close to, 16380 log(2) and the branch to Step 9 is
-// taken.
-//
-// Step 2. Calculate N = round-to-nearest-int( X * 64/log2 ).
-// 2.1 Set AdjFlag := 0 (indicates the branch 1.3 -> 2 was taken)
-// 2.2 N := round-to-nearest-integer( X * 64/log2 ).
-// 2.3 Calculate J = N mod 64; so J = 0,1,2,..., or 63.
-// 2.4 Calculate M = (N - J)/64; so N = 64M + J.
-// 2.5 Calculate the address of the stored value of 2^(J/64).
-// 2.6 Create the value Scale = 2^M.
-// Notes: The calculation in 2.2 is really performed by
-//
-// Z := X * constant
-// N := round-to-nearest-integer(Z)
-//
-// where
-//
-// constant := single-precision( 64/log 2 ).
-//
-// Using a single-precision constant avoids memory access.
-// Another effect of using a single-precision "constant" is
-// that the calculated value Z is
-//
-// Z = X*(64/log2)*(1+eps), |eps| <= 2^(-24).
-//
-// This error has to be considered later in Steps 3 and 4.
-//
-// Step 3. Calculate X - N*log2/64.
-// 3.1 R := X + N*L1, where L1 := single-precision(-log2/64).
-// 3.2 R := R + N*L2, L2 := extended-precision(-log2/64 - L1).
-// Notes: a) The way L1 and L2 are chosen ensures L1+L2 approximate
-// the value -log2/64 to 88 bits of accuracy.
-// b) N*L1 is exact because N is no longer than 22 bits and
-// L1 is no longer than 24 bits.
-// c) The calculation X+N*L1 is also exact due to cancellation.
-// Thus, R is practically X+N(L1+L2) to full 64 bits.
-// d) It is important to estimate how large can |R| be after
-// Step 3.2.
-//
-// N = rnd-to-int( X*64/log2 (1+eps) ), |eps|<=2^(-24)
-// X*64/log2 (1+eps) = N + f, |f| <= 0.5
-// X*64/log2 - N = f - eps*X 64/log2
-// X - N*log2/64 = f*log2/64 - eps*X
-//
-//
-// Now |X| <= 16446 log2, thus
-//
-// |X - N*log2/64| <= (0.5 + 16446/2^(18))*log2/64
-// <= 0.57 log2/64.
-// This bound will be used in Step 4.
-//
-// Step 4. Approximate exp(R)-1 by a polynomial
-// p = R + R*R*(A1 + R*(A2 + R*(A3 + R*(A4 + R*A5))))
-// Notes: a) In order to reduce memory access, the coefficients are
-// made as "short" as possible: A1 (which is 1/2), A4 and A5
-// are single precision; A2 and A3 are double precision.
-// b) Even with the restrictions above,
-// |p - (exp(R)-1)| < 2^(-68.8) for all |R| <= 0.0062.
-// Note that 0.0062 is slightly bigger than 0.57 log2/64.
-// c) To fully utilize the pipeline, p is separated into
-// two independent pieces of roughly equal complexities
-// p = [ R + R*S*(A2 + S*A4) ] +
-// [ S*(A1 + S*(A3 + S*A5)) ]
-// where S = R*R.
-//
-// Step 5. Compute 2^(J/64)*exp(R) = 2^(J/64)*(1+p) by
-// ans := T + ( T*p + t)
-// where T and t are the stored values for 2^(J/64).
-// Notes: 2^(J/64) is stored as T and t where T+t approximates
-// 2^(J/64) to roughly 85 bits; T is in extended precision
-// and t is in single precision. Note also that T is rounded
-// to 62 bits so that the last two bits of T are zero. The
-// reason for such a special form is that T-1, T-2, and T-8
-// will all be exact --- a property that will give much
-// more accurate computation of the function EXPM1.
-//
-// Step 6. Reconstruction of exp(X)
-// exp(X) = 2^M * 2^(J/64) * exp(R).
-// 6.1 If AdjFlag = 0, go to 6.3
-// 6.2 ans := ans * AdjScale
-// 6.3 Restore the user FPCR
-// 6.4 Return ans := ans * Scale. Exit.
-// Notes: If AdjFlag = 0, we have X = Mlog2 + Jlog2/64 + R,
-// |M| <= 16380, and Scale = 2^M. Moreover, exp(X) will
-// neither overflow nor underflow. If AdjFlag = 1, that
-// means that
-// X = (M1+M)log2 + Jlog2/64 + R, |M1+M| >= 16380.
-// Hence, exp(X) may overflow or underflow or neither.
-// When that is the case, AdjScale = 2^(M1) where M1 is
-// approximately M. Thus 6.2 will never cause over/underflow.
-// Possible exception in 6.4 is overflow or underflow.
-// The inexact exception is not generated in 6.4. Although
-// one can argue that the inexact flag should always be
-// raised, to simulate that exception cost to much than the
-// flag is worth in practical uses.
-//
-// Step 7. Return 1 + X.
-// 7.1 ans := X
-// 7.2 Restore user FPCR.
-// 7.3 Return ans := 1 + ans. Exit
-// Notes: For non-zero X, the inexact exception will always be
-// raised by 7.3. That is the only exception raised by 7.3.
-// Note also that we use the FMOVEM instruction to move X
-// in Step 7.1 to avoid unnecessary trapping. (Although
-// the FMOVEM may not seem relevant since X is normalized,
-// the precaution will be useful in the library version of
-// this code where the separate entry for denormalized inputs
-// will be done away with.)
-//
-// Step 8. Handle exp(X) where |X| >= 16380log2.
-// 8.1 If |X| > 16480 log2, go to Step 9.
-// (mimic 2.2 - 2.6)
-// 8.2 N := round-to-integer( X * 64/log2 )
-// 8.3 Calculate J = N mod 64, J = 0,1,...,63
-// 8.4 K := (N-J)/64, M1 := truncate(K/2), M = K-M1, AdjFlag := 1.
-// 8.5 Calculate the address of the stored value 2^(J/64).
-// 8.6 Create the values Scale = 2^M, AdjScale = 2^M1.
-// 8.7 Go to Step 3.
-// Notes: Refer to notes for 2.2 - 2.6.
-//
-// Step 9. Handle exp(X), |X| > 16480 log2.
-// 9.1 If X < 0, go to 9.3
-// 9.2 ans := Huge, go to 9.4
-// 9.3 ans := Tiny.
-// 9.4 Restore user FPCR.
-// 9.5 Return ans := ans * ans. Exit.
-// Notes: Exp(X) will surely overflow or underflow, depending on
-// X's sign. "Huge" and "Tiny" are respectively large/tiny
-// extended-precision numbers whose square over/underflow
-// with an inexact result. Thus, 9.5 always raises the
-// inexact together with either overflow or underflow.
-//
-//
-// setoxm1d
-// --------
-//
-// Step 1. Set ans := 0
-//
-// Step 2. Return ans := X + ans. Exit.
-// Notes: This will return X with the appropriate rounding
-// precision prescribed by the user FPCR.
-//
-// setoxm1
-// -------
-//
-// Step 1. Check |X|
-// 1.1 If |X| >= 1/4, go to Step 1.3.
-// 1.2 Go to Step 7.
-// 1.3 If |X| < 70 log(2), go to Step 2.
-// 1.4 Go to Step 10.
-// Notes: The usual case should take the branches 1.1 -> 1.3 -> 2.
-// However, it is conceivable |X| can be small very often
-// because EXPM1 is intended to evaluate exp(X)-1 accurately
-// when |X| is small. For further details on the comparisons,
-// see the notes on Step 1 of setox.
-//
-// Step 2. Calculate N = round-to-nearest-int( X * 64/log2 ).
-// 2.1 N := round-to-nearest-integer( X * 64/log2 ).
-// 2.2 Calculate J = N mod 64; so J = 0,1,2,..., or 63.
-// 2.3 Calculate M = (N - J)/64; so N = 64M + J.
-// 2.4 Calculate the address of the stored value of 2^(J/64).
-// 2.5 Create the values Sc = 2^M and OnebySc := -2^(-M).
-// Notes: See the notes on Step 2 of setox.
-//
-// Step 3. Calculate X - N*log2/64.
-// 3.1 R := X + N*L1, where L1 := single-precision(-log2/64).
-// 3.2 R := R + N*L2, L2 := extended-precision(-log2/64 - L1).
-// Notes: Applying the analysis of Step 3 of setox in this case
-// shows that |R| <= 0.0055 (note that |X| <= 70 log2 in
-// this case).
-//
-// Step 4. Approximate exp(R)-1 by a polynomial
-// p = R+R*R*(A1+R*(A2+R*(A3+R*(A4+R*(A5+R*A6)))))
-// Notes: a) In order to reduce memory access, the coefficients are
-// made as "short" as possible: A1 (which is 1/2), A5 and A6
-// are single precision; A2, A3 and A4 are double precision.
-// b) Even with the restriction above,
-// |p - (exp(R)-1)| < |R| * 2^(-72.7)
-// for all |R| <= 0.0055.
-// c) To fully utilize the pipeline, p is separated into
-// two independent pieces of roughly equal complexity
-// p = [ R*S*(A2 + S*(A4 + S*A6)) ] +
-// [ R + S*(A1 + S*(A3 + S*A5)) ]
-// where S = R*R.
-//
-// Step 5. Compute 2^(J/64)*p by
-// p := T*p
-// where T and t are the stored values for 2^(J/64).
-// Notes: 2^(J/64) is stored as T and t where T+t approximates
-// 2^(J/64) to roughly 85 bits; T is in extended precision
-// and t is in single precision. Note also that T is rounded
-// to 62 bits so that the last two bits of T are zero. The
-// reason for such a special form is that T-1, T-2, and T-8
-// will all be exact --- a property that will be exploited
-// in Step 6 below. The total relative error in p is no
-// bigger than 2^(-67.7) compared to the final result.
-//
-// Step 6. Reconstruction of exp(X)-1
-// exp(X)-1 = 2^M * ( 2^(J/64) + p - 2^(-M) ).
-// 6.1 If M <= 63, go to Step 6.3.
-// 6.2 ans := T + (p + (t + OnebySc)). Go to 6.6
-// 6.3 If M >= -3, go to 6.5.
-// 6.4 ans := (T + (p + t)) + OnebySc. Go to 6.6
-// 6.5 ans := (T + OnebySc) + (p + t).
-// 6.6 Restore user FPCR.
-// 6.7 Return ans := Sc * ans. Exit.
-// Notes: The various arrangements of the expressions give accurate
-// evaluations.
-//
-// Step 7. exp(X)-1 for |X| < 1/4.
-// 7.1 If |X| >= 2^(-65), go to Step 9.
-// 7.2 Go to Step 8.
-//
-// Step 8. Calculate exp(X)-1, |X| < 2^(-65).
-// 8.1 If |X| < 2^(-16312), goto 8.3
-// 8.2 Restore FPCR; return ans := X - 2^(-16382). Exit.
-// 8.3 X := X * 2^(140).
-// 8.4 Restore FPCR; ans := ans - 2^(-16382).
-// Return ans := ans*2^(140). Exit
-// Notes: The idea is to return "X - tiny" under the user
-// precision and rounding modes. To avoid unnecessary
-// inefficiency, we stay away from denormalized numbers the
-// best we can. For |X| >= 2^(-16312), the straightforward
-// 8.2 generates the inexact exception as the case warrants.
-//
-// Step 9. Calculate exp(X)-1, |X| < 1/4, by a polynomial
-// p = X + X*X*(B1 + X*(B2 + ... + X*B12))
-// Notes: a) In order to reduce memory access, the coefficients are
-// made as "short" as possible: B1 (which is 1/2), B9 to B12
-// are single precision; B3 to B8 are double precision; and
-// B2 is double extended.
-// b) Even with the restriction above,
-// |p - (exp(X)-1)| < |X| 2^(-70.6)
-// for all |X| <= 0.251.
-// Note that 0.251 is slightly bigger than 1/4.
-// c) To fully preserve accuracy, the polynomial is computed
-// as X + ( S*B1 + Q ) where S = X*X and
-// Q = X*S*(B2 + X*(B3 + ... + X*B12))
-// d) To fully utilize the pipeline, Q is separated into
-// two independent pieces of roughly equal complexity
-// Q = [ X*S*(B2 + S*(B4 + ... + S*B12)) ] +
-// [ S*S*(B3 + S*(B5 + ... + S*B11)) ]
-//
-// Step 10. Calculate exp(X)-1 for |X| >= 70 log 2.
-// 10.1 If X >= 70log2 , exp(X) - 1 = exp(X) for all practical
-// purposes. Therefore, go to Step 1 of setox.
-// 10.2 If X <= -70log2, exp(X) - 1 = -1 for all practical purposes.
-// ans := -1
-// Restore user FPCR
-// Return ans := ans + 2^(-126). Exit.
-// Notes: 10.2 will always create an inexact and return -1 + tiny
-// in the user rounding precision and mode.
-//
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//setox idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
-L2: .long 0x3FDC0000,0x82E30865,0x4361C4C6,0x00000000
-
-EXPA3: .long 0x3FA55555,0x55554431
-EXPA2: .long 0x3FC55555,0x55554018
-
-HUGE: .long 0x7FFE0000,0xFFFFFFFF,0xFFFFFFFF,0x00000000
-TINY: .long 0x00010000,0xFFFFFFFF,0xFFFFFFFF,0x00000000
-
-EM1A4: .long 0x3F811111,0x11174385
-EM1A3: .long 0x3FA55555,0x55554F5A
-
-EM1A2: .long 0x3FC55555,0x55555555,0x00000000,0x00000000
-
-EM1B8: .long 0x3EC71DE3,0xA5774682
-EM1B7: .long 0x3EFA01A0,0x19D7CB68
-
-EM1B6: .long 0x3F2A01A0,0x1A019DF3
-EM1B5: .long 0x3F56C16C,0x16C170E2
-
-EM1B4: .long 0x3F811111,0x11111111
-EM1B3: .long 0x3FA55555,0x55555555
-
-EM1B2: .long 0x3FFC0000,0xAAAAAAAA,0xAAAAAAAB
- .long 0x00000000
-
-TWO140: .long 0x48B00000,0x00000000
-TWON140: .long 0x37300000,0x00000000
-
-EXPTBL:
- .long 0x3FFF0000,0x80000000,0x00000000,0x00000000
- .long 0x3FFF0000,0x8164D1F3,0xBC030774,0x9F841A9B
- .long 0x3FFF0000,0x82CD8698,0xAC2BA1D8,0x9FC1D5B9
- .long 0x3FFF0000,0x843A28C3,0xACDE4048,0xA0728369
- .long 0x3FFF0000,0x85AAC367,0xCC487B14,0x1FC5C95C
- .long 0x3FFF0000,0x871F6196,0x9E8D1010,0x1EE85C9F
- .long 0x3FFF0000,0x88980E80,0x92DA8528,0x9FA20729
- .long 0x3FFF0000,0x8A14D575,0x496EFD9C,0xA07BF9AF
- .long 0x3FFF0000,0x8B95C1E3,0xEA8BD6E8,0xA0020DCF
- .long 0x3FFF0000,0x8D1ADF5B,0x7E5BA9E4,0x205A63DA
- .long 0x3FFF0000,0x8EA4398B,0x45CD53C0,0x1EB70051
- .long 0x3FFF0000,0x9031DC43,0x1466B1DC,0x1F6EB029
- .long 0x3FFF0000,0x91C3D373,0xAB11C338,0xA0781494
- .long 0x3FFF0000,0x935A2B2F,0x13E6E92C,0x9EB319B0
- .long 0x3FFF0000,0x94F4EFA8,0xFEF70960,0x2017457D
- .long 0x3FFF0000,0x96942D37,0x20185A00,0x1F11D537
- .long 0x3FFF0000,0x9837F051,0x8DB8A970,0x9FB952DD
- .long 0x3FFF0000,0x99E04593,0x20B7FA64,0x1FE43087
- .long 0x3FFF0000,0x9B8D39B9,0xD54E5538,0x1FA2A818
- .long 0x3FFF0000,0x9D3ED9A7,0x2CFFB750,0x1FDE494D
- .long 0x3FFF0000,0x9EF53260,0x91A111AC,0x20504890
- .long 0x3FFF0000,0xA0B0510F,0xB9714FC4,0xA073691C
- .long 0x3FFF0000,0xA2704303,0x0C496818,0x1F9B7A05
- .long 0x3FFF0000,0xA43515AE,0x09E680A0,0xA0797126
- .long 0x3FFF0000,0xA5FED6A9,0xB15138EC,0xA071A140
- .long 0x3FFF0000,0xA7CD93B4,0xE9653568,0x204F62DA
- .long 0x3FFF0000,0xA9A15AB4,0xEA7C0EF8,0x1F283C4A
- .long 0x3FFF0000,0xAB7A39B5,0xA93ED338,0x9F9A7FDC
- .long 0x3FFF0000,0xAD583EEA,0x42A14AC8,0xA05B3FAC
- .long 0x3FFF0000,0xAF3B78AD,0x690A4374,0x1FDF2610
- .long 0x3FFF0000,0xB123F581,0xD2AC2590,0x9F705F90
- .long 0x3FFF0000,0xB311C412,0xA9112488,0x201F678A
- .long 0x3FFF0000,0xB504F333,0xF9DE6484,0x1F32FB13
- .long 0x3FFF0000,0xB6FD91E3,0x28D17790,0x20038B30
- .long 0x3FFF0000,0xB8FBAF47,0x62FB9EE8,0x200DC3CC
- .long 0x3FFF0000,0xBAFF5AB2,0x133E45FC,0x9F8B2AE6
- .long 0x3FFF0000,0xBD08A39F,0x580C36C0,0xA02BBF70
- .long 0x3FFF0000,0xBF1799B6,0x7A731084,0xA00BF518
- .long 0x3FFF0000,0xC12C4CCA,0x66709458,0xA041DD41
- .long 0x3FFF0000,0xC346CCDA,0x24976408,0x9FDF137B
- .long 0x3FFF0000,0xC5672A11,0x5506DADC,0x201F1568
- .long 0x3FFF0000,0xC78D74C8,0xABB9B15C,0x1FC13A2E
- .long 0x3FFF0000,0xC9B9BD86,0x6E2F27A4,0xA03F8F03
- .long 0x3FFF0000,0xCBEC14FE,0xF2727C5C,0x1FF4907D
- .long 0x3FFF0000,0xCE248C15,0x1F8480E4,0x9E6E53E4
- .long 0x3FFF0000,0xD06333DA,0xEF2B2594,0x1FD6D45C
- .long 0x3FFF0000,0xD2A81D91,0xF12AE45C,0xA076EDB9
- .long 0x3FFF0000,0xD4F35AAB,0xCFEDFA20,0x9FA6DE21
- .long 0x3FFF0000,0xD744FCCA,0xD69D6AF4,0x1EE69A2F
- .long 0x3FFF0000,0xD99D15C2,0x78AFD7B4,0x207F439F
- .long 0x3FFF0000,0xDBFBB797,0xDAF23754,0x201EC207
- .long 0x3FFF0000,0xDE60F482,0x5E0E9124,0x9E8BE175
- .long 0x3FFF0000,0xE0CCDEEC,0x2A94E110,0x20032C4B
- .long 0x3FFF0000,0xE33F8972,0xBE8A5A50,0x2004DFF5
- .long 0x3FFF0000,0xE5B906E7,0x7C8348A8,0x1E72F47A
- .long 0x3FFF0000,0xE8396A50,0x3C4BDC68,0x1F722F22
- .long 0x3FFF0000,0xEAC0C6E7,0xDD243930,0xA017E945
- .long 0x3FFF0000,0xED4F301E,0xD9942B84,0x1F401A5B
- .long 0x3FFF0000,0xEFE4B99B,0xDCDAF5CC,0x9FB9A9E3
- .long 0x3FFF0000,0xF281773C,0x59FFB138,0x20744C05
- .long 0x3FFF0000,0xF5257D15,0x2486CC2C,0x1F773A19
- .long 0x3FFF0000,0xF7D0DF73,0x0AD13BB8,0x1FFE90D5
- .long 0x3FFF0000,0xFA83B2DB,0x722A033C,0xA041ED22
- .long 0x3FFF0000,0xFD3E0C0C,0xF486C174,0x1F853F3A
-
- .set ADJFLAG,L_SCR2
- .set SCALE,FP_SCR1
- .set ADJSCALE,FP_SCR2
- .set SC,FP_SCR3
- .set ONEBYSC,FP_SCR4
-
- | xref t_frcinx
- |xref t_extdnrm
- |xref t_unfl
- |xref t_ovfl
-
- .global setoxd
-setoxd:
-//--entry point for EXP(X), X is denormalized
- movel (%a0),%d0
- andil #0x80000000,%d0
- oril #0x00800000,%d0 // ...sign(X)*2^(-126)
- movel %d0,-(%sp)
- fmoves #0x3F800000,%fp0
- fmovel %d1,%fpcr
- fadds (%sp)+,%fp0
- bra t_frcinx
-
- .global setox
-setox:
-//--entry point for EXP(X), here X is finite, non-zero, and not NaN's
-
-//--Step 1.
- movel (%a0),%d0 // ...load part of input X
- andil #0x7FFF0000,%d0 // ...biased expo. of X
- cmpil #0x3FBE0000,%d0 // ...2^(-65)
- bges EXPC1 // ...normal case
- bra EXPSM
-
-EXPC1:
-//--The case |X| >= 2^(-65)
- movew 4(%a0),%d0 // ...expo. and partial sig. of |X|
- cmpil #0x400CB167,%d0 // ...16380 log2 trunc. 16 bits
- blts EXPMAIN // ...normal case
- bra EXPBIG
-
-EXPMAIN:
-//--Step 2.
-//--This is the normal branch: 2^(-65) <= |X| < 16380 log2.
- fmovex (%a0),%fp0 // ...load input from (a0)
-
- fmovex %fp0,%fp1
- fmuls #0x42B8AA3B,%fp0 // ...64/log2 * X
- fmovemx %fp2-%fp2/%fp3,-(%a7) // ...save fp2
- movel #0,ADJFLAG(%a6)
- fmovel %fp0,%d0 // ...N = int( X * 64/log2 )
- lea EXPTBL,%a1
- fmovel %d0,%fp0 // ...convert to floating-format
-
- movel %d0,L_SCR1(%a6) // ...save N temporarily
- andil #0x3F,%d0 // ...D0 is J = N mod 64
- lsll #4,%d0
- addal %d0,%a1 // ...address of 2^(J/64)
- movel L_SCR1(%a6),%d0
- asrl #6,%d0 // ...D0 is M
- addiw #0x3FFF,%d0 // ...biased expo. of 2^(M)
- movew L2,L_SCR1(%a6) // ...prefetch L2, no need in CB
-
-EXPCONT1:
-//--Step 3.
-//--fp1,fp2 saved on the stack. fp0 is N, fp1 is X,
-//--a0 points to 2^(J/64), D0 is biased expo. of 2^(M)
- fmovex %fp0,%fp2
- fmuls #0xBC317218,%fp0 // ...N * L1, L1 = lead(-log2/64)
- fmulx L2,%fp2 // ...N * L2, L1+L2 = -log2/64
- faddx %fp1,%fp0 // ...X + N*L1
- faddx %fp2,%fp0 // ...fp0 is R, reduced arg.
-// MOVE.W #$3FA5,EXPA3 ...load EXPA3 in cache
-
-//--Step 4.
-//--WE NOW COMPUTE EXP(R)-1 BY A POLYNOMIAL
-//-- R + R*R*(A1 + R*(A2 + R*(A3 + R*(A4 + R*A5))))
-//--TO FULLY UTILIZE THE PIPELINE, WE COMPUTE S = R*R
-//--[R+R*S*(A2+S*A4)] + [S*(A1+S*(A3+S*A5))]
-
- fmovex %fp0,%fp1
- fmulx %fp1,%fp1 // ...fp1 IS S = R*R
-
- fmoves #0x3AB60B70,%fp2 // ...fp2 IS A5
-// MOVE.W #0,2(%a1) ...load 2^(J/64) in cache
-
- fmulx %fp1,%fp2 // ...fp2 IS S*A5
- fmovex %fp1,%fp3
- fmuls #0x3C088895,%fp3 // ...fp3 IS S*A4
-
- faddd EXPA3,%fp2 // ...fp2 IS A3+S*A5
- faddd EXPA2,%fp3 // ...fp3 IS A2+S*A4
-
- fmulx %fp1,%fp2 // ...fp2 IS S*(A3+S*A5)
- movew %d0,SCALE(%a6) // ...SCALE is 2^(M) in extended
- clrw SCALE+2(%a6)
- movel #0x80000000,SCALE+4(%a6)
- clrl SCALE+8(%a6)
-
- fmulx %fp1,%fp3 // ...fp3 IS S*(A2+S*A4)
-
- fadds #0x3F000000,%fp2 // ...fp2 IS A1+S*(A3+S*A5)
- fmulx %fp0,%fp3 // ...fp3 IS R*S*(A2+S*A4)
-
- fmulx %fp1,%fp2 // ...fp2 IS S*(A1+S*(A3+S*A5))
- faddx %fp3,%fp0 // ...fp0 IS R+R*S*(A2+S*A4),
-// ...fp3 released
-
- fmovex (%a1)+,%fp1 // ...fp1 is lead. pt. of 2^(J/64)
- faddx %fp2,%fp0 // ...fp0 is EXP(R) - 1
-// ...fp2 released
-
-//--Step 5
-//--final reconstruction process
-//--EXP(X) = 2^M * ( 2^(J/64) + 2^(J/64)*(EXP(R)-1) )
-
- fmulx %fp1,%fp0 // ...2^(J/64)*(Exp(R)-1)
- fmovemx (%a7)+,%fp2-%fp2/%fp3 // ...fp2 restored
- fadds (%a1),%fp0 // ...accurate 2^(J/64)
-
- faddx %fp1,%fp0 // ...2^(J/64) + 2^(J/64)*...
- movel ADJFLAG(%a6),%d0
-
-//--Step 6
- tstl %d0
- beqs NORMAL
-ADJUST:
- fmulx ADJSCALE(%a6),%fp0
-NORMAL:
- fmovel %d1,%FPCR // ...restore user FPCR
- fmulx SCALE(%a6),%fp0 // ...multiply 2^(M)
- bra t_frcinx
-
-EXPSM:
-//--Step 7
- fmovemx (%a0),%fp0-%fp0 // ...in case X is denormalized
- fmovel %d1,%FPCR
- fadds #0x3F800000,%fp0 // ...1+X in user mode
- bra t_frcinx
-
-EXPBIG:
-//--Step 8
- cmpil #0x400CB27C,%d0 // ...16480 log2
- bgts EXP2BIG
-//--Steps 8.2 -- 8.6
- fmovex (%a0),%fp0 // ...load input from (a0)
-
- fmovex %fp0,%fp1
- fmuls #0x42B8AA3B,%fp0 // ...64/log2 * X
- fmovemx %fp2-%fp2/%fp3,-(%a7) // ...save fp2
- movel #1,ADJFLAG(%a6)
- fmovel %fp0,%d0 // ...N = int( X * 64/log2 )
- lea EXPTBL,%a1
- fmovel %d0,%fp0 // ...convert to floating-format
- movel %d0,L_SCR1(%a6) // ...save N temporarily
- andil #0x3F,%d0 // ...D0 is J = N mod 64
- lsll #4,%d0
- addal %d0,%a1 // ...address of 2^(J/64)
- movel L_SCR1(%a6),%d0
- asrl #6,%d0 // ...D0 is K
- movel %d0,L_SCR1(%a6) // ...save K temporarily
- asrl #1,%d0 // ...D0 is M1
- subl %d0,L_SCR1(%a6) // ...a1 is M
- addiw #0x3FFF,%d0 // ...biased expo. of 2^(M1)
- movew %d0,ADJSCALE(%a6) // ...ADJSCALE := 2^(M1)
- clrw ADJSCALE+2(%a6)
- movel #0x80000000,ADJSCALE+4(%a6)
- clrl ADJSCALE+8(%a6)
- movel L_SCR1(%a6),%d0 // ...D0 is M
- addiw #0x3FFF,%d0 // ...biased expo. of 2^(M)
- bra EXPCONT1 // ...go back to Step 3
-
-EXP2BIG:
-//--Step 9
- fmovel %d1,%FPCR
- movel (%a0),%d0
- bclrb #sign_bit,(%a0) // ...setox always returns positive
- cmpil #0,%d0
- blt t_unfl
- bra t_ovfl
-
- .global setoxm1d
-setoxm1d:
-//--entry point for EXPM1(X), here X is denormalized
-//--Step 0.
- bra t_extdnrm
-
-
- .global setoxm1
-setoxm1:
-//--entry point for EXPM1(X), here X is finite, non-zero, non-NaN
-
-//--Step 1.
-//--Step 1.1
- movel (%a0),%d0 // ...load part of input X
- andil #0x7FFF0000,%d0 // ...biased expo. of X
- cmpil #0x3FFD0000,%d0 // ...1/4
- bges EM1CON1 // ...|X| >= 1/4
- bra EM1SM
-
-EM1CON1:
-//--Step 1.3
-//--The case |X| >= 1/4
- movew 4(%a0),%d0 // ...expo. and partial sig. of |X|
- cmpil #0x4004C215,%d0 // ...70log2 rounded up to 16 bits
- bles EM1MAIN // ...1/4 <= |X| <= 70log2
- bra EM1BIG
-
-EM1MAIN:
-//--Step 2.
-//--This is the case: 1/4 <= |X| <= 70 log2.
- fmovex (%a0),%fp0 // ...load input from (a0)
-
- fmovex %fp0,%fp1
- fmuls #0x42B8AA3B,%fp0 // ...64/log2 * X
- fmovemx %fp2-%fp2/%fp3,-(%a7) // ...save fp2
-// MOVE.W #$3F81,EM1A4 ...prefetch in CB mode
- fmovel %fp0,%d0 // ...N = int( X * 64/log2 )
- lea EXPTBL,%a1
- fmovel %d0,%fp0 // ...convert to floating-format
-
- movel %d0,L_SCR1(%a6) // ...save N temporarily
- andil #0x3F,%d0 // ...D0 is J = N mod 64
- lsll #4,%d0
- addal %d0,%a1 // ...address of 2^(J/64)
- movel L_SCR1(%a6),%d0
- asrl #6,%d0 // ...D0 is M
- movel %d0,L_SCR1(%a6) // ...save a copy of M
-// MOVE.W #$3FDC,L2 ...prefetch L2 in CB mode
-
-//--Step 3.
-//--fp1,fp2 saved on the stack. fp0 is N, fp1 is X,
-//--a0 points to 2^(J/64), D0 and a1 both contain M
- fmovex %fp0,%fp2
- fmuls #0xBC317218,%fp0 // ...N * L1, L1 = lead(-log2/64)
- fmulx L2,%fp2 // ...N * L2, L1+L2 = -log2/64
- faddx %fp1,%fp0 // ...X + N*L1
- faddx %fp2,%fp0 // ...fp0 is R, reduced arg.
-// MOVE.W #$3FC5,EM1A2 ...load EM1A2 in cache
- addiw #0x3FFF,%d0 // ...D0 is biased expo. of 2^M
-
-//--Step 4.
-//--WE NOW COMPUTE EXP(R)-1 BY A POLYNOMIAL
-//-- R + R*R*(A1 + R*(A2 + R*(A3 + R*(A4 + R*(A5 + R*A6)))))
-//--TO FULLY UTILIZE THE PIPELINE, WE COMPUTE S = R*R
-//--[R*S*(A2+S*(A4+S*A6))] + [R+S*(A1+S*(A3+S*A5))]
-
- fmovex %fp0,%fp1
- fmulx %fp1,%fp1 // ...fp1 IS S = R*R
-
- fmoves #0x3950097B,%fp2 // ...fp2 IS a6
-// MOVE.W #0,2(%a1) ...load 2^(J/64) in cache
-
- fmulx %fp1,%fp2 // ...fp2 IS S*A6
- fmovex %fp1,%fp3
- fmuls #0x3AB60B6A,%fp3 // ...fp3 IS S*A5
-
- faddd EM1A4,%fp2 // ...fp2 IS A4+S*A6
- faddd EM1A3,%fp3 // ...fp3 IS A3+S*A5
- movew %d0,SC(%a6) // ...SC is 2^(M) in extended
- clrw SC+2(%a6)
- movel #0x80000000,SC+4(%a6)
- clrl SC+8(%a6)
-
- fmulx %fp1,%fp2 // ...fp2 IS S*(A4+S*A6)
- movel L_SCR1(%a6),%d0 // ...D0 is M
- negw %d0 // ...D0 is -M
- fmulx %fp1,%fp3 // ...fp3 IS S*(A3+S*A5)
- addiw #0x3FFF,%d0 // ...biased expo. of 2^(-M)
- faddd EM1A2,%fp2 // ...fp2 IS A2+S*(A4+S*A6)
- fadds #0x3F000000,%fp3 // ...fp3 IS A1+S*(A3+S*A5)
-
- fmulx %fp1,%fp2 // ...fp2 IS S*(A2+S*(A4+S*A6))
- oriw #0x8000,%d0 // ...signed/expo. of -2^(-M)
- movew %d0,ONEBYSC(%a6) // ...OnebySc is -2^(-M)
- clrw ONEBYSC+2(%a6)
- movel #0x80000000,ONEBYSC+4(%a6)
- clrl ONEBYSC+8(%a6)
- fmulx %fp3,%fp1 // ...fp1 IS S*(A1+S*(A3+S*A5))
-// ...fp3 released
-
- fmulx %fp0,%fp2 // ...fp2 IS R*S*(A2+S*(A4+S*A6))
- faddx %fp1,%fp0 // ...fp0 IS R+S*(A1+S*(A3+S*A5))
-// ...fp1 released
-
- faddx %fp2,%fp0 // ...fp0 IS EXP(R)-1
-// ...fp2 released
- fmovemx (%a7)+,%fp2-%fp2/%fp3 // ...fp2 restored
-
-//--Step 5
-//--Compute 2^(J/64)*p
-
- fmulx (%a1),%fp0 // ...2^(J/64)*(Exp(R)-1)
-
-//--Step 6
-//--Step 6.1
- movel L_SCR1(%a6),%d0 // ...retrieve M
- cmpil #63,%d0
- bles MLE63
-//--Step 6.2 M >= 64
- fmoves 12(%a1),%fp1 // ...fp1 is t
- faddx ONEBYSC(%a6),%fp1 // ...fp1 is t+OnebySc
- faddx %fp1,%fp0 // ...p+(t+OnebySc), fp1 released
- faddx (%a1),%fp0 // ...T+(p+(t+OnebySc))
- bras EM1SCALE
-MLE63:
-//--Step 6.3 M <= 63
- cmpil #-3,%d0
- bges MGEN3
-MLTN3:
-//--Step 6.4 M <= -4
- fadds 12(%a1),%fp0 // ...p+t
- faddx (%a1),%fp0 // ...T+(p+t)
- faddx ONEBYSC(%a6),%fp0 // ...OnebySc + (T+(p+t))
- bras EM1SCALE
-MGEN3:
-//--Step 6.5 -3 <= M <= 63
- fmovex (%a1)+,%fp1 // ...fp1 is T
- fadds (%a1),%fp0 // ...fp0 is p+t
- faddx ONEBYSC(%a6),%fp1 // ...fp1 is T+OnebySc
- faddx %fp1,%fp0 // ...(T+OnebySc)+(p+t)
-
-EM1SCALE:
-//--Step 6.6
- fmovel %d1,%FPCR
- fmulx SC(%a6),%fp0
-
- bra t_frcinx
-
-EM1SM:
-//--Step 7 |X| < 1/4.
- cmpil #0x3FBE0000,%d0 // ...2^(-65)
- bges EM1POLY
-
-EM1TINY:
-//--Step 8 |X| < 2^(-65)
- cmpil #0x00330000,%d0 // ...2^(-16312)
- blts EM12TINY
-//--Step 8.2
- movel #0x80010000,SC(%a6) // ...SC is -2^(-16382)
- movel #0x80000000,SC+4(%a6)
- clrl SC+8(%a6)
- fmovex (%a0),%fp0
- fmovel %d1,%FPCR
- faddx SC(%a6),%fp0
-
- bra t_frcinx
-
-EM12TINY:
-//--Step 8.3
- fmovex (%a0),%fp0
- fmuld TWO140,%fp0
- movel #0x80010000,SC(%a6)
- movel #0x80000000,SC+4(%a6)
- clrl SC+8(%a6)
- faddx SC(%a6),%fp0
- fmovel %d1,%FPCR
- fmuld TWON140,%fp0
-
- bra t_frcinx
-
-EM1POLY:
-//--Step 9 exp(X)-1 by a simple polynomial
- fmovex (%a0),%fp0 // ...fp0 is X
- fmulx %fp0,%fp0 // ...fp0 is S := X*X
- fmovemx %fp2-%fp2/%fp3,-(%a7) // ...save fp2
- fmoves #0x2F30CAA8,%fp1 // ...fp1 is B12
- fmulx %fp0,%fp1 // ...fp1 is S*B12
- fmoves #0x310F8290,%fp2 // ...fp2 is B11
- fadds #0x32D73220,%fp1 // ...fp1 is B10+S*B12
-
- fmulx %fp0,%fp2 // ...fp2 is S*B11
- fmulx %fp0,%fp1 // ...fp1 is S*(B10 + ...
-
- fadds #0x3493F281,%fp2 // ...fp2 is B9+S*...
- faddd EM1B8,%fp1 // ...fp1 is B8+S*...
-
- fmulx %fp0,%fp2 // ...fp2 is S*(B9+...
- fmulx %fp0,%fp1 // ...fp1 is S*(B8+...
-
- faddd EM1B7,%fp2 // ...fp2 is B7+S*...
- faddd EM1B6,%fp1 // ...fp1 is B6+S*...
-
- fmulx %fp0,%fp2 // ...fp2 is S*(B7+...
- fmulx %fp0,%fp1 // ...fp1 is S*(B6+...
-
- faddd EM1B5,%fp2 // ...fp2 is B5+S*...
- faddd EM1B4,%fp1 // ...fp1 is B4+S*...
-
- fmulx %fp0,%fp2 // ...fp2 is S*(B5+...
- fmulx %fp0,%fp1 // ...fp1 is S*(B4+...
-
- faddd EM1B3,%fp2 // ...fp2 is B3+S*...
- faddx EM1B2,%fp1 // ...fp1 is B2+S*...
-
- fmulx %fp0,%fp2 // ...fp2 is S*(B3+...
- fmulx %fp0,%fp1 // ...fp1 is S*(B2+...
-
- fmulx %fp0,%fp2 // ...fp2 is S*S*(B3+...)
- fmulx (%a0),%fp1 // ...fp1 is X*S*(B2...
-
- fmuls #0x3F000000,%fp0 // ...fp0 is S*B1
- faddx %fp2,%fp1 // ...fp1 is Q
-// ...fp2 released
-
- fmovemx (%a7)+,%fp2-%fp2/%fp3 // ...fp2 restored
-
- faddx %fp1,%fp0 // ...fp0 is S*B1+Q
-// ...fp1 released
-
- fmovel %d1,%FPCR
- faddx (%a0),%fp0
-
- bra t_frcinx
-
-EM1BIG:
-//--Step 10 |X| > 70 log2
- movel (%a0),%d0
- cmpil #0,%d0
- bgt EXPC1
-//--Step 10.2
- fmoves #0xBF800000,%fp0 // ...fp0 is -1
- fmovel %d1,%FPCR
- fadds #0x00800000,%fp0 // ...-1 + 2^(-126)
-
- bra t_frcinx
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/sgetem.s b/c/src/lib/libcpu/m68k/m68040/fpsp/sgetem.s
deleted file mode 100644
index d1e8a49c41..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/sgetem.s
+++ /dev/null
@@ -1,143 +0,0 @@
-//
-// $Id$
-//
-// sgetem.sa 3.1 12/10/90
-//
-// The entry point sGETEXP returns the exponent portion
-// of the input argument. The exponent bias is removed
-// and the exponent value is returned as an extended
-// precision number in fp0. sGETEXPD handles denormalized
-// numbers.
-//
-// The entry point sGETMAN extracts the mantissa of the
-// input argument. The mantissa is converted to an
-// extended precision number and returned in fp0. The
-// range of the result is [1.0 - 2.0).
-//
-//
-// Input: Double-extended number X in the ETEMP space in
-// the floating-point save stack.
-//
-// Output: The functions return exp(X) or man(X) in fp0.
-//
-// Modified: fp0.
-//
-//
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//SGETEM idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref nrm_set
-
-//
-// This entry point is used by the unimplemented instruction exception
-// handler. It points a0 to the input operand.
-//
-//
-//
-// SGETEXP
-//
-
- .global sgetexp
-sgetexp:
- movew LOCAL_EX(%a0),%d0 //get the exponent
- bclrl #15,%d0 //clear the sign bit
- subw #0x3fff,%d0 //subtract off the bias
- fmovew %d0,%fp0 //move the exp to fp0
- rts
-
- .global sgetexpd
-sgetexpd:
- bclrb #sign_bit,LOCAL_EX(%a0)
- bsr nrm_set //normalize (exp will go negative)
- movew LOCAL_EX(%a0),%d0 //load resulting exponent into d0
- subw #0x3fff,%d0 //subtract off the bias
- fmovew %d0,%fp0 //move the exp to fp0
- rts
-//
-//
-// This entry point is used by the unimplemented instruction exception
-// handler. It points a0 to the input operand.
-//
-//
-//
-// SGETMAN
-//
-//
-// For normalized numbers, leave the mantissa alone, simply load
-// with an exponent of +/- $3fff.
-//
- .global sgetman
-sgetman:
- movel USER_FPCR(%a6),%d0
- andil #0xffffff00,%d0 //clear rounding precision and mode
- fmovel %d0,%fpcr //this fpcr setting is used by the 882
- movew LOCAL_EX(%a0),%d0 //get the exp (really just want sign bit)
- orw #0x7fff,%d0 //clear old exp
- bclrl #14,%d0 //make it the new exp +-3fff
- movew %d0,LOCAL_EX(%a0) //move the sign & exp back to fsave stack
- fmovex (%a0),%fp0 //put new value back in fp0
- rts
-
-//
-// For denormalized numbers, shift the mantissa until the j-bit = 1,
-// then load the exponent with +/1 $3fff.
-//
- .global sgetmand
-sgetmand:
- movel LOCAL_HI(%a0),%d0 //load ms mant in d0
- movel LOCAL_LO(%a0),%d1 //load ls mant in d1
- bsr shft //shift mantissa bits till msbit is set
- movel %d0,LOCAL_HI(%a0) //put ms mant back on stack
- movel %d1,LOCAL_LO(%a0) //put ls mant back on stack
- bras sgetman
-
-//
-// SHFT
-//
-// Shifts the mantissa bits until msbit is set.
-// input:
-// ms mantissa part in d0
-// ls mantissa part in d1
-// output:
-// shifted bits in d0 and d1
-shft:
- tstl %d0 //if any bits set in ms mant
- bnes upper //then branch
-// ;else no bits set in ms mant
- tstl %d1 //test if any bits set in ls mant
- bnes cont //if set then continue
- bras shft_end //else return
-cont:
- movel %d3,-(%a7) //save d3
- exg %d0,%d1 //shift ls mant to ms mant
- bfffo %d0{#0:#32},%d3 //find first 1 in ls mant to d0
- lsll %d3,%d0 //shift first 1 to integer bit in ms mant
- movel (%a7)+,%d3 //restore d3
- bras shft_end
-upper:
-
- moveml %d3/%d5/%d6,-(%a7) //save registers
- bfffo %d0{#0:#32},%d3 //find first 1 in ls mant to d0
- lsll %d3,%d0 //shift ms mant until j-bit is set
- movel %d1,%d6 //save ls mant in d6
- lsll %d3,%d1 //shift ls mant by count
- movel #32,%d5
- subl %d3,%d5 //sub 32 from shift for ls mant
- lsrl %d5,%d6 //shift off all bits but those that will
-// ;be shifted into ms mant
- orl %d6,%d0 //shift the ls mant bits into the ms mant
- moveml (%a7)+,%d3/%d5/%d6 //restore registers
-shft_end:
- rts
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/sint.s b/c/src/lib/libcpu/m68k/m68040/fpsp/sint.s
deleted file mode 100644
index a9ddacb98a..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/sint.s
+++ /dev/null
@@ -1,249 +0,0 @@
-//
-// $Id$
-//
-// sint.sa 3.1 12/10/90
-//
-// The entry point sINT computes the rounded integer
-// equivalent of the input argument, sINTRZ computes
-// the integer rounded to zero of the input argument.
-//
-// Entry points sint and sintrz are called from do_func
-// to emulate the fint and fintrz unimplemented instructions,
-// respectively. Entry point sintdo is used by bindec.
-//
-// Input: (Entry points sint and sintrz) Double-extended
-// number X in the ETEMP space in the floating-point
-// save stack.
-// (Entry point sintdo) Double-extended number X in
-// location pointed to by the address register a0.
-// (Entry point sintd) Double-extended denormalized
-// number X in the ETEMP space in the floating-point
-// save stack.
-//
-// Output: The function returns int(X) or intrz(X) in fp0.
-//
-// Modifies: fp0.
-//
-// Algorithm: (sint and sintrz)
-//
-// 1. If exp(X) >= 63, return X.
-// If exp(X) < 0, return +/- 0 or +/- 1, according to
-// the rounding mode.
-//
-// 2. (X is in range) set rsc = 63 - exp(X). Unnormalize the
-// result to the exponent $403e.
-//
-// 3. Round the result in the mode given in USER_FPCR. For
-// sintrz, force round-to-zero mode.
-//
-// 4. Normalize the rounded result; store in fp0.
-//
-// For the denormalized cases, force the correct result
-// for the given sign and rounding mode.
-//
-// Sign(X)
-// RMODE + -
-// ----- --------
-// RN +0 -0
-// RZ +0 -0
-// RM +0 -1
-// RP +1 -0
-//
-//
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//SINT idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref dnrm_lp
- |xref nrm_set
- |xref round
- |xref t_inx2
- |xref ld_pone
- |xref ld_mone
- |xref ld_pzero
- |xref ld_mzero
- |xref snzrinx
-
-//
-// FINT
-//
- .global sint
-sint:
- bfextu FPCR_MODE(%a6){#2:#2},%d1 //use user's mode for rounding
-// ;implicitly has extend precision
-// ;in upper word.
- movel %d1,L_SCR1(%a6) //save mode bits
- bras sintexc
-
-//
-// FINT with extended denorm inputs.
-//
- .global sintd
-sintd:
- btstb #5,FPCR_MODE(%a6)
- beq snzrinx //if round nearest or round zero, +/- 0
- btstb #4,FPCR_MODE(%a6)
- beqs rnd_mns
-rnd_pls:
- btstb #sign_bit,LOCAL_EX(%a0)
- bnes sintmz
- bsr ld_pone //if round plus inf and pos, answer is +1
- bra t_inx2
-rnd_mns:
- btstb #sign_bit,LOCAL_EX(%a0)
- beqs sintpz
- bsr ld_mone //if round mns inf and neg, answer is -1
- bra t_inx2
-sintpz:
- bsr ld_pzero
- bra t_inx2
-sintmz:
- bsr ld_mzero
- bra t_inx2
-
-//
-// FINTRZ
-//
- .global sintrz
-sintrz:
- movel #1,L_SCR1(%a6) //use rz mode for rounding
-// ;implicitly has extend precision
-// ;in upper word.
- bras sintexc
-//
-// SINTDO
-//
-// Input: a0 points to an IEEE extended format operand
-// Output: fp0 has the result
-//
-// Exceptions:
-//
-// If the subroutine results in an inexact operation, the inx2 and
-// ainx bits in the USER_FPSR are set.
-//
-//
- .global sintdo
-sintdo:
- bfextu FPCR_MODE(%a6){#2:#2},%d1 //use user's mode for rounding
-// ;implicitly has ext precision
-// ;in upper word.
- movel %d1,L_SCR1(%a6) //save mode bits
-//
-// Real work of sint is in sintexc
-//
-sintexc:
- bclrb #sign_bit,LOCAL_EX(%a0) //convert to internal extended
-// ;format
- sne LOCAL_SGN(%a0)
- cmpw #0x403e,LOCAL_EX(%a0) //check if (unbiased) exp > 63
- bgts out_rnge //branch if exp < 63
- cmpw #0x3ffd,LOCAL_EX(%a0) //check if (unbiased) exp < 0
- bgt in_rnge //if 63 >= exp > 0, do calc
-//
-// Input is less than zero. Restore sign, and check for directed
-// rounding modes. L_SCR1 contains the rmode in the lower byte.
-//
-un_rnge:
- btstb #1,L_SCR1+3(%a6) //check for rn and rz
- beqs un_rnrz
- tstb LOCAL_SGN(%a0) //check for sign
- bnes un_rmrp_neg
-//
-// Sign is +. If rp, load +1.0, if rm, load +0.0
-//
- cmpib #3,L_SCR1+3(%a6) //check for rp
- beqs un_ldpone //if rp, load +1.0
- bsr ld_pzero //if rm, load +0.0
- bra t_inx2
-un_ldpone:
- bsr ld_pone
- bra t_inx2
-//
-// Sign is -. If rm, load -1.0, if rp, load -0.0
-//
-un_rmrp_neg:
- cmpib #2,L_SCR1+3(%a6) //check for rm
- beqs un_ldmone //if rm, load -1.0
- bsr ld_mzero //if rp, load -0.0
- bra t_inx2
-un_ldmone:
- bsr ld_mone
- bra t_inx2
-//
-// Rmode is rn or rz; return signed zero
-//
-un_rnrz:
- tstb LOCAL_SGN(%a0) //check for sign
- bnes un_rnrz_neg
- bsr ld_pzero
- bra t_inx2
-un_rnrz_neg:
- bsr ld_mzero
- bra t_inx2
-
-//
-// Input is greater than 2^63. All bits are significant. Return
-// the input.
-//
-out_rnge:
- bfclr LOCAL_SGN(%a0){#0:#8} //change back to IEEE ext format
- beqs intps
- bsetb #sign_bit,LOCAL_EX(%a0)
-intps:
- fmovel %fpcr,-(%sp)
- fmovel #0,%fpcr
- fmovex LOCAL_EX(%a0),%fp0 //if exp > 63
-// ;then return X to the user
-// ;there are no fraction bits
- fmovel (%sp)+,%fpcr
- rts
-
-in_rnge:
-// ;shift off fraction bits
- clrl %d0 //clear d0 - initial g,r,s for
-// ;dnrm_lp
- movel #0x403e,%d1 //set threshold for dnrm_lp
-// ;assumes a0 points to operand
- bsr dnrm_lp
-// ;returns unnormalized number
-// ;pointed by a0
-// ;output d0 supplies g,r,s
-// ;used by round
- movel L_SCR1(%a6),%d1 //use selected rounding mode
-//
-//
- bsr round //round the unnorm based on users
-// ;input a0 ptr to ext X
-// ; d0 g,r,s bits
-// ; d1 PREC/MODE info
-// ;output a0 ptr to rounded result
-// ;inexact flag set in USER_FPSR
-// ;if initial grs set
-//
-// normalize the rounded result and store value in fp0
-//
- bsr nrm_set //normalize the unnorm
-// ;Input: a0 points to operand to
-// ;be normalized
-// ;Output: a0 points to normalized
-// ;result
- bfclr LOCAL_SGN(%a0){#0:#8}
- beqs nrmrndp
- bsetb #sign_bit,LOCAL_EX(%a0) //return to IEEE extended format
-nrmrndp:
- fmovel %fpcr,-(%sp)
- fmovel #0,%fpcr
- fmovex LOCAL_EX(%a0),%fp0 //move result to fp0
- fmovel (%sp)+,%fpcr
- rts
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/slog2.s b/c/src/lib/libcpu/m68k/m68040/fpsp/slog2.s
deleted file mode 100644
index 42c70092fa..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/slog2.s
+++ /dev/null
@@ -1,190 +0,0 @@
-//
-// $Id$
-//
-// slog2.sa 3.1 12/10/90
-//
-// The entry point slog10 computes the base-10
-// logarithm of an input argument X.
-// slog10d does the same except the input value is a
-// denormalized number.
-// sLog2 and sLog2d are the base-2 analogues.
-//
-// INPUT: Double-extended value in memory location pointed to
-// by address register a0.
-//
-// OUTPUT: log_10(X) or log_2(X) returned in floating-point
-// register fp0.
-//
-// ACCURACY and MONOTONICITY: The returned result is within 1.7
-// ulps in 64 significant bit, i.e. within 0.5003 ulp
-// to 53 bits if the result is subsequently rounded
-// to double precision. The result is provably monotonic
-// in double precision.
-//
-// SPEED: Two timings are measured, both in the copy-back mode.
-// The first one is measured when the function is invoked
-// the first time (so the instructions and data are not
-// in cache), and the second one is measured when the
-// function is reinvoked at the same input argument.
-//
-// ALGORITHM and IMPLEMENTATION NOTES:
-//
-// slog10d:
-//
-// Step 0. If X < 0, create a NaN and raise the invalid operation
-// flag. Otherwise, save FPCR in D1; set FpCR to default.
-// Notes: Default means round-to-nearest mode, no floating-point
-// traps, and precision control = double extended.
-//
-// Step 1. Call slognd to obtain Y = log(X), the natural log of X.
-// Notes: Even if X is denormalized, log(X) is always normalized.
-//
-// Step 2. Compute log_10(X) = log(X) * (1/log(10)).
-// 2.1 Restore the user FPCR
-// 2.2 Return ans := Y * INV_L10.
-//
-//
-// slog10:
-//
-// Step 0. If X < 0, create a NaN and raise the invalid operation
-// flag. Otherwise, save FPCR in D1; set FpCR to default.
-// Notes: Default means round-to-nearest mode, no floating-point
-// traps, and precision control = double extended.
-//
-// Step 1. Call sLogN to obtain Y = log(X), the natural log of X.
-//
-// Step 2. Compute log_10(X) = log(X) * (1/log(10)).
-// 2.1 Restore the user FPCR
-// 2.2 Return ans := Y * INV_L10.
-//
-//
-// sLog2d:
-//
-// Step 0. If X < 0, create a NaN and raise the invalid operation
-// flag. Otherwise, save FPCR in D1; set FpCR to default.
-// Notes: Default means round-to-nearest mode, no floating-point
-// traps, and precision control = double extended.
-//
-// Step 1. Call slognd to obtain Y = log(X), the natural log of X.
-// Notes: Even if X is denormalized, log(X) is always normalized.
-//
-// Step 2. Compute log_10(X) = log(X) * (1/log(2)).
-// 2.1 Restore the user FPCR
-// 2.2 Return ans := Y * INV_L2.
-//
-//
-// sLog2:
-//
-// Step 0. If X < 0, create a NaN and raise the invalid operation
-// flag. Otherwise, save FPCR in D1; set FpCR to default.
-// Notes: Default means round-to-nearest mode, no floating-point
-// traps, and precision control = double extended.
-//
-// Step 1. If X is not an integer power of two, i.e., X != 2^k,
-// go to Step 3.
-//
-// Step 2. Return k.
-// 2.1 Get integer k, X = 2^k.
-// 2.2 Restore the user FPCR.
-// 2.3 Return ans := convert-to-double-extended(k).
-//
-// Step 3. Call sLogN to obtain Y = log(X), the natural log of X.
-//
-// Step 4. Compute log_2(X) = log(X) * (1/log(2)).
-// 4.1 Restore the user FPCR
-// 4.2 Return ans := Y * INV_L2.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//SLOG2 idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
- |xref t_frcinx
- |xref t_operr
- |xref slogn
- |xref slognd
-
-INV_L10: .long 0x3FFD0000,0xDE5BD8A9,0x37287195,0x00000000
-
-INV_L2: .long 0x3FFF0000,0xB8AA3B29,0x5C17F0BC,0x00000000
-
- .global slog10d
-slog10d:
-//--entry point for Log10(X), X is denormalized
- movel (%a0),%d0
- blt invalid
- movel %d1,-(%sp)
- clrl %d1
- bsr slognd // ...log(X), X denorm.
- fmovel (%sp)+,%fpcr
- fmulx INV_L10,%fp0
- bra t_frcinx
-
- .global slog10
-slog10:
-//--entry point for Log10(X), X is normalized
-
- movel (%a0),%d0
- blt invalid
- movel %d1,-(%sp)
- clrl %d1
- bsr slogn // ...log(X), X normal.
- fmovel (%sp)+,%fpcr
- fmulx INV_L10,%fp0
- bra t_frcinx
-
-
- .global slog2d
-slog2d:
-//--entry point for Log2(X), X is denormalized
-
- movel (%a0),%d0
- blt invalid
- movel %d1,-(%sp)
- clrl %d1
- bsr slognd // ...log(X), X denorm.
- fmovel (%sp)+,%fpcr
- fmulx INV_L2,%fp0
- bra t_frcinx
-
- .global slog2
-slog2:
-//--entry point for Log2(X), X is normalized
- movel (%a0),%d0
- blt invalid
-
- movel 8(%a0),%d0
- bnes continue // ...X is not 2^k
-
- movel 4(%a0),%d0
- andl #0x7FFFFFFF,%d0
- tstl %d0
- bnes continue
-
-//--X = 2^k.
- movew (%a0),%d0
- andl #0x00007FFF,%d0
- subl #0x3FFF,%d0
- fmovel %d1,%fpcr
- fmovel %d0,%fp0
- bra t_frcinx
-
-continue:
- movel %d1,-(%sp)
- clrl %d1
- bsr slogn // ...log(X), X normal.
- fmovel (%sp)+,%fpcr
- fmulx INV_L2,%fp0
- bra t_frcinx
-
-invalid:
- bra t_operr
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/slogn.s b/c/src/lib/libcpu/m68k/m68040/fpsp/slogn.s
deleted file mode 100644
index b208a603b7..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/slogn.s
+++ /dev/null
@@ -1,594 +0,0 @@
-//
-// $Id$
-//
-// slogn.sa 3.1 12/10/90
-//
-// slogn computes the natural logarithm of an
-// input value. slognd does the same except the input value is a
-// denormalized number. slognp1 computes log(1+X), and slognp1d
-// computes log(1+X) for denormalized X.
-//
-// Input: Double-extended value in memory location pointed to by address
-// register a0.
-//
-// Output: log(X) or log(1+X) returned in floating-point register Fp0.
-//
-// Accuracy and Monotonicity: The returned result is within 2 ulps in
-// 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-// result is subsequently rounded to double precision. The
-// result is provably monotonic in double precision.
-//
-// Speed: The program slogn takes approximately 190 cycles for input
-// argument X such that |X-1| >= 1/16, which is the the usual
-// situation. For those arguments, slognp1 takes approximately
-// 210 cycles. For the less common arguments, the program will
-// run no worse than 10% slower.
-//
-// Algorithm:
-// LOGN:
-// Step 1. If |X-1| < 1/16, approximate log(X) by an odd polynomial in
-// u, where u = 2(X-1)/(X+1). Otherwise, move on to Step 2.
-//
-// Step 2. X = 2**k * Y where 1 <= Y < 2. Define F to be the first seven
-// significant bits of Y plus 2**(-7), i.e. F = 1.xxxxxx1 in base
-// 2 where the six "x" match those of Y. Note that |Y-F| <= 2**(-7).
-//
-// Step 3. Define u = (Y-F)/F. Approximate log(1+u) by a polynomial in u,
-// log(1+u) = poly.
-//
-// Step 4. Reconstruct log(X) = log( 2**k * Y ) = k*log(2) + log(F) + log(1+u)
-// by k*log(2) + (log(F) + poly). The values of log(F) are calculated
-// beforehand and stored in the program.
-//
-// lognp1:
-// Step 1: If |X| < 1/16, approximate log(1+X) by an odd polynomial in
-// u where u = 2X/(2+X). Otherwise, move on to Step 2.
-//
-// Step 2: Let 1+X = 2**k * Y, where 1 <= Y < 2. Define F as done in Step 2
-// of the algorithm for LOGN and compute log(1+X) as
-// k*log(2) + log(F) + poly where poly approximates log(1+u),
-// u = (Y-F)/F.
-//
-// Implementation Notes:
-// Note 1. There are 64 different possible values for F, thus 64 log(F)'s
-// need to be tabulated. Moreover, the values of 1/F are also
-// tabulated so that the division in (Y-F)/F can be performed by a
-// multiplication.
-//
-// Note 2. In Step 2 of lognp1, in order to preserved accuracy, the value
-// Y-F has to be calculated carefully when 1/2 <= X < 3/2.
-//
-// Note 3. To fully exploit the pipeline, polynomials are usually separated
-// into two parts evaluated independently before being added up.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//slogn idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
-BOUNDS1: .long 0x3FFEF07D,0x3FFF8841
-BOUNDS2: .long 0x3FFE8000,0x3FFFC000
-
-LOGOF2: .long 0x3FFE0000,0xB17217F7,0xD1CF79AC,0x00000000
-
-one: .long 0x3F800000
-zero: .long 0x00000000
-infty: .long 0x7F800000
-negone: .long 0xBF800000
-
-LOGA6: .long 0x3FC2499A,0xB5E4040B
-LOGA5: .long 0xBFC555B5,0x848CB7DB
-
-LOGA4: .long 0x3FC99999,0x987D8730
-LOGA3: .long 0xBFCFFFFF,0xFF6F7E97
-
-LOGA2: .long 0x3FD55555,0x555555a4
-LOGA1: .long 0xBFE00000,0x00000008
-
-LOGB5: .long 0x3F175496,0xADD7DAD6
-LOGB4: .long 0x3F3C71C2,0xFE80C7E0
-
-LOGB3: .long 0x3F624924,0x928BCCFF
-LOGB2: .long 0x3F899999,0x999995EC
-
-LOGB1: .long 0x3FB55555,0x55555555
-TWO: .long 0x40000000,0x00000000
-
-LTHOLD: .long 0x3f990000,0x80000000,0x00000000,0x00000000
-
-LOGTBL:
- .long 0x3FFE0000,0xFE03F80F,0xE03F80FE,0x00000000
- .long 0x3FF70000,0xFF015358,0x833C47E2,0x00000000
- .long 0x3FFE0000,0xFA232CF2,0x52138AC0,0x00000000
- .long 0x3FF90000,0xBDC8D83E,0xAD88D549,0x00000000
- .long 0x3FFE0000,0xF6603D98,0x0F6603DA,0x00000000
- .long 0x3FFA0000,0x9CF43DCF,0xF5EAFD48,0x00000000
- .long 0x3FFE0000,0xF2B9D648,0x0F2B9D65,0x00000000
- .long 0x3FFA0000,0xDA16EB88,0xCB8DF614,0x00000000
- .long 0x3FFE0000,0xEF2EB71F,0xC4345238,0x00000000
- .long 0x3FFB0000,0x8B29B775,0x1BD70743,0x00000000
- .long 0x3FFE0000,0xEBBDB2A5,0xC1619C8C,0x00000000
- .long 0x3FFB0000,0xA8D839F8,0x30C1FB49,0x00000000
- .long 0x3FFE0000,0xE865AC7B,0x7603A197,0x00000000
- .long 0x3FFB0000,0xC61A2EB1,0x8CD907AD,0x00000000
- .long 0x3FFE0000,0xE525982A,0xF70C880E,0x00000000
- .long 0x3FFB0000,0xE2F2A47A,0xDE3A18AF,0x00000000
- .long 0x3FFE0000,0xE1FC780E,0x1FC780E2,0x00000000
- .long 0x3FFB0000,0xFF64898E,0xDF55D551,0x00000000
- .long 0x3FFE0000,0xDEE95C4C,0xA037BA57,0x00000000
- .long 0x3FFC0000,0x8DB956A9,0x7B3D0148,0x00000000
- .long 0x3FFE0000,0xDBEB61EE,0xD19C5958,0x00000000
- .long 0x3FFC0000,0x9B8FE100,0xF47BA1DE,0x00000000
- .long 0x3FFE0000,0xD901B203,0x6406C80E,0x00000000
- .long 0x3FFC0000,0xA9372F1D,0x0DA1BD17,0x00000000
- .long 0x3FFE0000,0xD62B80D6,0x2B80D62C,0x00000000
- .long 0x3FFC0000,0xB6B07F38,0xCE90E46B,0x00000000
- .long 0x3FFE0000,0xD3680D36,0x80D3680D,0x00000000
- .long 0x3FFC0000,0xC3FD0329,0x06488481,0x00000000
- .long 0x3FFE0000,0xD0B69FCB,0xD2580D0B,0x00000000
- .long 0x3FFC0000,0xD11DE0FF,0x15AB18CA,0x00000000
- .long 0x3FFE0000,0xCE168A77,0x25080CE1,0x00000000
- .long 0x3FFC0000,0xDE1433A1,0x6C66B150,0x00000000
- .long 0x3FFE0000,0xCB8727C0,0x65C393E0,0x00000000
- .long 0x3FFC0000,0xEAE10B5A,0x7DDC8ADD,0x00000000
- .long 0x3FFE0000,0xC907DA4E,0x871146AD,0x00000000
- .long 0x3FFC0000,0xF7856E5E,0xE2C9B291,0x00000000
- .long 0x3FFE0000,0xC6980C69,0x80C6980C,0x00000000
- .long 0x3FFD0000,0x82012CA5,0xA68206D7,0x00000000
- .long 0x3FFE0000,0xC4372F85,0x5D824CA6,0x00000000
- .long 0x3FFD0000,0x882C5FCD,0x7256A8C5,0x00000000
- .long 0x3FFE0000,0xC1E4BBD5,0x95F6E947,0x00000000
- .long 0x3FFD0000,0x8E44C60B,0x4CCFD7DE,0x00000000
- .long 0x3FFE0000,0xBFA02FE8,0x0BFA02FF,0x00000000
- .long 0x3FFD0000,0x944AD09E,0xF4351AF6,0x00000000
- .long 0x3FFE0000,0xBD691047,0x07661AA3,0x00000000
- .long 0x3FFD0000,0x9A3EECD4,0xC3EAA6B2,0x00000000
- .long 0x3FFE0000,0xBB3EE721,0xA54D880C,0x00000000
- .long 0x3FFD0000,0xA0218434,0x353F1DE8,0x00000000
- .long 0x3FFE0000,0xB92143FA,0x36F5E02E,0x00000000
- .long 0x3FFD0000,0xA5F2FCAB,0xBBC506DA,0x00000000
- .long 0x3FFE0000,0xB70FBB5A,0x19BE3659,0x00000000
- .long 0x3FFD0000,0xABB3B8BA,0x2AD362A5,0x00000000
- .long 0x3FFE0000,0xB509E68A,0x9B94821F,0x00000000
- .long 0x3FFD0000,0xB1641795,0xCE3CA97B,0x00000000
- .long 0x3FFE0000,0xB30F6352,0x8917C80B,0x00000000
- .long 0x3FFD0000,0xB7047551,0x5D0F1C61,0x00000000
- .long 0x3FFE0000,0xB11FD3B8,0x0B11FD3C,0x00000000
- .long 0x3FFD0000,0xBC952AFE,0xEA3D13E1,0x00000000
- .long 0x3FFE0000,0xAF3ADDC6,0x80AF3ADE,0x00000000
- .long 0x3FFD0000,0xC2168ED0,0xF458BA4A,0x00000000
- .long 0x3FFE0000,0xAD602B58,0x0AD602B6,0x00000000
- .long 0x3FFD0000,0xC788F439,0xB3163BF1,0x00000000
- .long 0x3FFE0000,0xAB8F69E2,0x8359CD11,0x00000000
- .long 0x3FFD0000,0xCCECAC08,0xBF04565D,0x00000000
- .long 0x3FFE0000,0xA9C84A47,0xA07F5638,0x00000000
- .long 0x3FFD0000,0xD2420487,0x2DD85160,0x00000000
- .long 0x3FFE0000,0xA80A80A8,0x0A80A80B,0x00000000
- .long 0x3FFD0000,0xD7894992,0x3BC3588A,0x00000000
- .long 0x3FFE0000,0xA655C439,0x2D7B73A8,0x00000000
- .long 0x3FFD0000,0xDCC2C4B4,0x9887DACC,0x00000000
- .long 0x3FFE0000,0xA4A9CF1D,0x96833751,0x00000000
- .long 0x3FFD0000,0xE1EEBD3E,0x6D6A6B9E,0x00000000
- .long 0x3FFE0000,0xA3065E3F,0xAE7CD0E0,0x00000000
- .long 0x3FFD0000,0xE70D785C,0x2F9F5BDC,0x00000000
- .long 0x3FFE0000,0xA16B312E,0xA8FC377D,0x00000000
- .long 0x3FFD0000,0xEC1F392C,0x5179F283,0x00000000
- .long 0x3FFE0000,0x9FD809FD,0x809FD80A,0x00000000
- .long 0x3FFD0000,0xF12440D3,0xE36130E6,0x00000000
- .long 0x3FFE0000,0x9E4CAD23,0xDD5F3A20,0x00000000
- .long 0x3FFD0000,0xF61CCE92,0x346600BB,0x00000000
- .long 0x3FFE0000,0x9CC8E160,0xC3FB19B9,0x00000000
- .long 0x3FFD0000,0xFB091FD3,0x8145630A,0x00000000
- .long 0x3FFE0000,0x9B4C6F9E,0xF03A3CAA,0x00000000
- .long 0x3FFD0000,0xFFE97042,0xBFA4C2AD,0x00000000
- .long 0x3FFE0000,0x99D722DA,0xBDE58F06,0x00000000
- .long 0x3FFE0000,0x825EFCED,0x49369330,0x00000000
- .long 0x3FFE0000,0x9868C809,0x868C8098,0x00000000
- .long 0x3FFE0000,0x84C37A7A,0xB9A905C9,0x00000000
- .long 0x3FFE0000,0x97012E02,0x5C04B809,0x00000000
- .long 0x3FFE0000,0x87224C2E,0x8E645FB7,0x00000000
- .long 0x3FFE0000,0x95A02568,0x095A0257,0x00000000
- .long 0x3FFE0000,0x897B8CAC,0x9F7DE298,0x00000000
- .long 0x3FFE0000,0x94458094,0x45809446,0x00000000
- .long 0x3FFE0000,0x8BCF55DE,0xC4CD05FE,0x00000000
- .long 0x3FFE0000,0x92F11384,0x0497889C,0x00000000
- .long 0x3FFE0000,0x8E1DC0FB,0x89E125E5,0x00000000
- .long 0x3FFE0000,0x91A2B3C4,0xD5E6F809,0x00000000
- .long 0x3FFE0000,0x9066E68C,0x955B6C9B,0x00000000
- .long 0x3FFE0000,0x905A3863,0x3E06C43B,0x00000000
- .long 0x3FFE0000,0x92AADE74,0xC7BE59E0,0x00000000
- .long 0x3FFE0000,0x8F1779D9,0xFDC3A219,0x00000000
- .long 0x3FFE0000,0x94E9BFF6,0x15845643,0x00000000
- .long 0x3FFE0000,0x8DDA5202,0x37694809,0x00000000
- .long 0x3FFE0000,0x9723A1B7,0x20134203,0x00000000
- .long 0x3FFE0000,0x8CA29C04,0x6514E023,0x00000000
- .long 0x3FFE0000,0x995899C8,0x90EB8990,0x00000000
- .long 0x3FFE0000,0x8B70344A,0x139BC75A,0x00000000
- .long 0x3FFE0000,0x9B88BDAA,0x3A3DAE2F,0x00000000
- .long 0x3FFE0000,0x8A42F870,0x5669DB46,0x00000000
- .long 0x3FFE0000,0x9DB4224F,0xFFE1157C,0x00000000
- .long 0x3FFE0000,0x891AC73A,0xE9819B50,0x00000000
- .long 0x3FFE0000,0x9FDADC26,0x8B7A12DA,0x00000000
- .long 0x3FFE0000,0x87F78087,0xF78087F8,0x00000000
- .long 0x3FFE0000,0xA1FCFF17,0xCE733BD4,0x00000000
- .long 0x3FFE0000,0x86D90544,0x7A34ACC6,0x00000000
- .long 0x3FFE0000,0xA41A9E8F,0x5446FB9F,0x00000000
- .long 0x3FFE0000,0x85BF3761,0x2CEE3C9B,0x00000000
- .long 0x3FFE0000,0xA633CD7E,0x6771CD8B,0x00000000
- .long 0x3FFE0000,0x84A9F9C8,0x084A9F9D,0x00000000
- .long 0x3FFE0000,0xA8489E60,0x0B435A5E,0x00000000
- .long 0x3FFE0000,0x83993052,0x3FBE3368,0x00000000
- .long 0x3FFE0000,0xAA59233C,0xCCA4BD49,0x00000000
- .long 0x3FFE0000,0x828CBFBE,0xB9A020A3,0x00000000
- .long 0x3FFE0000,0xAC656DAE,0x6BCC4985,0x00000000
- .long 0x3FFE0000,0x81848DA8,0xFAF0D277,0x00000000
- .long 0x3FFE0000,0xAE6D8EE3,0x60BB2468,0x00000000
- .long 0x3FFE0000,0x80808080,0x80808081,0x00000000
- .long 0x3FFE0000,0xB07197A2,0x3C46C654,0x00000000
-
- .set ADJK,L_SCR1
-
- .set X,FP_SCR1
- .set XDCARE,X+2
- .set XFRAC,X+4
-
- .set F,FP_SCR2
- .set FFRAC,F+4
-
- .set KLOG2,FP_SCR3
-
- .set SAVEU,FP_SCR4
-
- | xref t_frcinx
- |xref t_extdnrm
- |xref t_operr
- |xref t_dz
-
- .global slognd
-slognd:
-//--ENTRY POINT FOR LOG(X) FOR DENORMALIZED INPUT
-
- movel #-100,ADJK(%a6) // ...INPUT = 2^(ADJK) * FP0
-
-//----normalize the input value by left shifting k bits (k to be determined
-//----below), adjusting exponent and storing -k to ADJK
-//----the value TWOTO100 is no longer needed.
-//----Note that this code assumes the denormalized input is NON-ZERO.
-
- moveml %d2-%d7,-(%a7) // ...save some registers
- movel #0x00000000,%d3 // ...D3 is exponent of smallest norm. #
- movel 4(%a0),%d4
- movel 8(%a0),%d5 // ...(D4,D5) is (Hi_X,Lo_X)
- clrl %d2 // ...D2 used for holding K
-
- tstl %d4
- bnes HiX_not0
-
-HiX_0:
- movel %d5,%d4
- clrl %d5
- movel #32,%d2
- clrl %d6
- bfffo %d4{#0:#32},%d6
- lsll %d6,%d4
- addl %d6,%d2 // ...(D3,D4,D5) is normalized
-
- movel %d3,X(%a6)
- movel %d4,XFRAC(%a6)
- movel %d5,XFRAC+4(%a6)
- negl %d2
- movel %d2,ADJK(%a6)
- fmovex X(%a6),%fp0
- moveml (%a7)+,%d2-%d7 // ...restore registers
- lea X(%a6),%a0
- bras LOGBGN // ...begin regular log(X)
-
-
-HiX_not0:
- clrl %d6
- bfffo %d4{#0:#32},%d6 // ...find first 1
- movel %d6,%d2 // ...get k
- lsll %d6,%d4
- movel %d5,%d7 // ...a copy of D5
- lsll %d6,%d5
- negl %d6
- addil #32,%d6
- lsrl %d6,%d7
- orl %d7,%d4 // ...(D3,D4,D5) normalized
-
- movel %d3,X(%a6)
- movel %d4,XFRAC(%a6)
- movel %d5,XFRAC+4(%a6)
- negl %d2
- movel %d2,ADJK(%a6)
- fmovex X(%a6),%fp0
- moveml (%a7)+,%d2-%d7 // ...restore registers
- lea X(%a6),%a0
- bras LOGBGN // ...begin regular log(X)
-
-
- .global slogn
-slogn:
-//--ENTRY POINT FOR LOG(X) FOR X FINITE, NON-ZERO, NOT NAN'S
-
- fmovex (%a0),%fp0 // ...LOAD INPUT
- movel #0x00000000,ADJK(%a6)
-
-LOGBGN:
-//--FPCR SAVED AND CLEARED, INPUT IS 2^(ADJK)*FP0, FP0 CONTAINS
-//--A FINITE, NON-ZERO, NORMALIZED NUMBER.
-
- movel (%a0),%d0
- movew 4(%a0),%d0
-
- movel (%a0),X(%a6)
- movel 4(%a0),X+4(%a6)
- movel 8(%a0),X+8(%a6)
-
- cmpil #0,%d0 // ...CHECK IF X IS NEGATIVE
- blt LOGNEG // ...LOG OF NEGATIVE ARGUMENT IS INVALID
- cmp2l BOUNDS1,%d0 // ...X IS POSITIVE, CHECK IF X IS NEAR 1
- bcc LOGNEAR1 // ...BOUNDS IS ROUGHLY [15/16, 17/16]
-
-LOGMAIN:
-//--THIS SHOULD BE THE USUAL CASE, X NOT VERY CLOSE TO 1
-
-//--X = 2^(K) * Y, 1 <= Y < 2. THUS, Y = 1.XXXXXXXX....XX IN BINARY.
-//--WE DEFINE F = 1.XXXXXX1, I.E. FIRST 7 BITS OF Y AND ATTACH A 1.
-//--THE IDEA IS THAT LOG(X) = K*LOG2 + LOG(Y)
-//-- = K*LOG2 + LOG(F) + LOG(1 + (Y-F)/F).
-//--NOTE THAT U = (Y-F)/F IS VERY SMALL AND THUS APPROXIMATING
-//--LOG(1+U) CAN BE VERY EFFICIENT.
-//--ALSO NOTE THAT THE VALUE 1/F IS STORED IN A TABLE SO THAT NO
-//--DIVISION IS NEEDED TO CALCULATE (Y-F)/F.
-
-//--GET K, Y, F, AND ADDRESS OF 1/F.
- asrl #8,%d0
- asrl #8,%d0 // ...SHIFTED 16 BITS, BIASED EXPO. OF X
- subil #0x3FFF,%d0 // ...THIS IS K
- addl ADJK(%a6),%d0 // ...ADJUST K, ORIGINAL INPUT MAY BE DENORM.
- lea LOGTBL,%a0 // ...BASE ADDRESS OF 1/F AND LOG(F)
- fmovel %d0,%fp1 // ...CONVERT K TO FLOATING-POINT FORMAT
-
-//--WHILE THE CONVERSION IS GOING ON, WE GET F AND ADDRESS OF 1/F
- movel #0x3FFF0000,X(%a6) // ...X IS NOW Y, I.E. 2^(-K)*X
- movel XFRAC(%a6),FFRAC(%a6)
- andil #0xFE000000,FFRAC(%a6) // ...FIRST 7 BITS OF Y
- oril #0x01000000,FFRAC(%a6) // ...GET F: ATTACH A 1 AT THE EIGHTH BIT
- movel FFRAC(%a6),%d0 // ...READY TO GET ADDRESS OF 1/F
- andil #0x7E000000,%d0
- asrl #8,%d0
- asrl #8,%d0
- asrl #4,%d0 // ...SHIFTED 20, D0 IS THE DISPLACEMENT
- addal %d0,%a0 // ...A0 IS THE ADDRESS FOR 1/F
-
- fmovex X(%a6),%fp0
- movel #0x3fff0000,F(%a6)
- clrl F+8(%a6)
- fsubx F(%a6),%fp0 // ...Y-F
- fmovemx %fp2-%fp2/%fp3,-(%sp) // ...SAVE FP2 WHILE FP0 IS NOT READY
-//--SUMMARY: FP0 IS Y-F, A0 IS ADDRESS OF 1/F, FP1 IS K
-//--REGISTERS SAVED: FPCR, FP1, FP2
-
-LP1CONT1:
-//--AN RE-ENTRY POINT FOR LOGNP1
- fmulx (%a0),%fp0 // ...FP0 IS U = (Y-F)/F
- fmulx LOGOF2,%fp1 // ...GET K*LOG2 WHILE FP0 IS NOT READY
- fmovex %fp0,%fp2
- fmulx %fp2,%fp2 // ...FP2 IS V=U*U
- fmovex %fp1,KLOG2(%a6) // ...PUT K*LOG2 IN MEMORY, FREE FP1
-
-//--LOG(1+U) IS APPROXIMATED BY
-//--U + V*(A1+U*(A2+U*(A3+U*(A4+U*(A5+U*A6))))) WHICH IS
-//--[U + V*(A1+V*(A3+V*A5))] + [U*V*(A2+V*(A4+V*A6))]
-
- fmovex %fp2,%fp3
- fmovex %fp2,%fp1
-
- fmuld LOGA6,%fp1 // ...V*A6
- fmuld LOGA5,%fp2 // ...V*A5
-
- faddd LOGA4,%fp1 // ...A4+V*A6
- faddd LOGA3,%fp2 // ...A3+V*A5
-
- fmulx %fp3,%fp1 // ...V*(A4+V*A6)
- fmulx %fp3,%fp2 // ...V*(A3+V*A5)
-
- faddd LOGA2,%fp1 // ...A2+V*(A4+V*A6)
- faddd LOGA1,%fp2 // ...A1+V*(A3+V*A5)
-
- fmulx %fp3,%fp1 // ...V*(A2+V*(A4+V*A6))
- addal #16,%a0 // ...ADDRESS OF LOG(F)
- fmulx %fp3,%fp2 // ...V*(A1+V*(A3+V*A5)), FP3 RELEASED
-
- fmulx %fp0,%fp1 // ...U*V*(A2+V*(A4+V*A6))
- faddx %fp2,%fp0 // ...U+V*(A1+V*(A3+V*A5)), FP2 RELEASED
-
- faddx (%a0),%fp1 // ...LOG(F)+U*V*(A2+V*(A4+V*A6))
- fmovemx (%sp)+,%fp2-%fp2/%fp3 // ...RESTORE FP2
- faddx %fp1,%fp0 // ...FP0 IS LOG(F) + LOG(1+U)
-
- fmovel %d1,%fpcr
- faddx KLOG2(%a6),%fp0 // ...FINAL ADD
- bra t_frcinx
-
-
-LOGNEAR1:
-//--REGISTERS SAVED: FPCR, FP1. FP0 CONTAINS THE INPUT.
- fmovex %fp0,%fp1
- fsubs one,%fp1 // ...FP1 IS X-1
- fadds one,%fp0 // ...FP0 IS X+1
- faddx %fp1,%fp1 // ...FP1 IS 2(X-1)
-//--LOG(X) = LOG(1+U/2)-LOG(1-U/2) WHICH IS AN ODD POLYNOMIAL
-//--IN U, U = 2(X-1)/(X+1) = FP1/FP0
-
-LP1CONT2:
-//--THIS IS AN RE-ENTRY POINT FOR LOGNP1
- fdivx %fp0,%fp1 // ...FP1 IS U
- fmovemx %fp2-%fp2/%fp3,-(%sp) // ...SAVE FP2
-//--REGISTERS SAVED ARE NOW FPCR,FP1,FP2,FP3
-//--LET V=U*U, W=V*V, CALCULATE
-//--U + U*V*(B1 + V*(B2 + V*(B3 + V*(B4 + V*B5)))) BY
-//--U + U*V*( [B1 + W*(B3 + W*B5)] + [V*(B2 + W*B4)] )
- fmovex %fp1,%fp0
- fmulx %fp0,%fp0 // ...FP0 IS V
- fmovex %fp1,SAVEU(%a6) // ...STORE U IN MEMORY, FREE FP1
- fmovex %fp0,%fp1
- fmulx %fp1,%fp1 // ...FP1 IS W
-
- fmoved LOGB5,%fp3
- fmoved LOGB4,%fp2
-
- fmulx %fp1,%fp3 // ...W*B5
- fmulx %fp1,%fp2 // ...W*B4
-
- faddd LOGB3,%fp3 // ...B3+W*B5
- faddd LOGB2,%fp2 // ...B2+W*B4
-
- fmulx %fp3,%fp1 // ...W*(B3+W*B5), FP3 RELEASED
-
- fmulx %fp0,%fp2 // ...V*(B2+W*B4)
-
- faddd LOGB1,%fp1 // ...B1+W*(B3+W*B5)
- fmulx SAVEU(%a6),%fp0 // ...FP0 IS U*V
-
- faddx %fp2,%fp1 // ...B1+W*(B3+W*B5) + V*(B2+W*B4), FP2 RELEASED
- fmovemx (%sp)+,%fp2-%fp2/%fp3 // ...FP2 RESTORED
-
- fmulx %fp1,%fp0 // ...U*V*( [B1+W*(B3+W*B5)] + [V*(B2+W*B4)] )
-
- fmovel %d1,%fpcr
- faddx SAVEU(%a6),%fp0
- bra t_frcinx
- rts
-
-LOGNEG:
-//--REGISTERS SAVED FPCR. LOG(-VE) IS INVALID
- bra t_operr
-
- .global slognp1d
-slognp1d:
-//--ENTRY POINT FOR LOG(1+Z) FOR DENORMALIZED INPUT
-// Simply return the denorm
-
- bra t_extdnrm
-
- .global slognp1
-slognp1:
-//--ENTRY POINT FOR LOG(1+X) FOR X FINITE, NON-ZERO, NOT NAN'S
-
- fmovex (%a0),%fp0 // ...LOAD INPUT
- fabsx %fp0 //test magnitude
- fcmpx LTHOLD,%fp0 //compare with min threshold
- fbgt LP1REAL //if greater, continue
- fmovel #0,%fpsr //clr N flag from compare
- fmovel %d1,%fpcr
- fmovex (%a0),%fp0 //return signed argument
- bra t_frcinx
-
-LP1REAL:
- fmovex (%a0),%fp0 // ...LOAD INPUT
- movel #0x00000000,ADJK(%a6)
- fmovex %fp0,%fp1 // ...FP1 IS INPUT Z
- fadds one,%fp0 // ...X := ROUND(1+Z)
- fmovex %fp0,X(%a6)
- movew XFRAC(%a6),XDCARE(%a6)
- movel X(%a6),%d0
- cmpil #0,%d0
- ble LP1NEG0 // ...LOG OF ZERO OR -VE
- cmp2l BOUNDS2,%d0
- bcs LOGMAIN // ...BOUNDS2 IS [1/2,3/2]
-//--IF 1+Z > 3/2 OR 1+Z < 1/2, THEN X, WHICH IS ROUNDING 1+Z,
-//--CONTAINS AT LEAST 63 BITS OF INFORMATION OF Z. IN THAT CASE,
-//--SIMPLY INVOKE LOG(X) FOR LOG(1+Z).
-
-LP1NEAR1:
-//--NEXT SEE IF EXP(-1/16) < X < EXP(1/16)
- cmp2l BOUNDS1,%d0
- bcss LP1CARE
-
-LP1ONE16:
-//--EXP(-1/16) < X < EXP(1/16). LOG(1+Z) = LOG(1+U/2) - LOG(1-U/2)
-//--WHERE U = 2Z/(2+Z) = 2Z/(1+X).
- faddx %fp1,%fp1 // ...FP1 IS 2Z
- fadds one,%fp0 // ...FP0 IS 1+X
-//--U = FP1/FP0
- bra LP1CONT2
-
-LP1CARE:
-//--HERE WE USE THE USUAL TABLE DRIVEN APPROACH. CARE HAS TO BE
-//--TAKEN BECAUSE 1+Z CAN HAVE 67 BITS OF INFORMATION AND WE MUST
-//--PRESERVE ALL THE INFORMATION. BECAUSE 1+Z IS IN [1/2,3/2],
-//--THERE ARE ONLY TWO CASES.
-//--CASE 1: 1+Z < 1, THEN K = -1 AND Y-F = (2-F) + 2Z
-//--CASE 2: 1+Z > 1, THEN K = 0 AND Y-F = (1-F) + Z
-//--ON RETURNING TO LP1CONT1, WE MUST HAVE K IN FP1, ADDRESS OF
-//--(1/F) IN A0, Y-F IN FP0, AND FP2 SAVED.
-
- movel XFRAC(%a6),FFRAC(%a6)
- andil #0xFE000000,FFRAC(%a6)
- oril #0x01000000,FFRAC(%a6) // ...F OBTAINED
- cmpil #0x3FFF8000,%d0 // ...SEE IF 1+Z > 1
- bges KISZERO
-
-KISNEG1:
- fmoves TWO,%fp0
- movel #0x3fff0000,F(%a6)
- clrl F+8(%a6)
- fsubx F(%a6),%fp0 // ...2-F
- movel FFRAC(%a6),%d0
- andil #0x7E000000,%d0
- asrl #8,%d0
- asrl #8,%d0
- asrl #4,%d0 // ...D0 CONTAINS DISPLACEMENT FOR 1/F
- faddx %fp1,%fp1 // ...GET 2Z
- fmovemx %fp2-%fp2/%fp3,-(%sp) // ...SAVE FP2
- faddx %fp1,%fp0 // ...FP0 IS Y-F = (2-F)+2Z
- lea LOGTBL,%a0 // ...A0 IS ADDRESS OF 1/F
- addal %d0,%a0
- fmoves negone,%fp1 // ...FP1 IS K = -1
- bra LP1CONT1
-
-KISZERO:
- fmoves one,%fp0
- movel #0x3fff0000,F(%a6)
- clrl F+8(%a6)
- fsubx F(%a6),%fp0 // ...1-F
- movel FFRAC(%a6),%d0
- andil #0x7E000000,%d0
- asrl #8,%d0
- asrl #8,%d0
- asrl #4,%d0
- faddx %fp1,%fp0 // ...FP0 IS Y-F
- fmovemx %fp2-%fp2/%fp3,-(%sp) // ...FP2 SAVED
- lea LOGTBL,%a0
- addal %d0,%a0 // ...A0 IS ADDRESS OF 1/F
- fmoves zero,%fp1 // ...FP1 IS K = 0
- bra LP1CONT1
-
-LP1NEG0:
-//--FPCR SAVED. D0 IS X IN COMPACT FORM.
- cmpil #0,%d0
- blts LP1NEG
-LP1ZERO:
- fmoves negone,%fp0
-
- fmovel %d1,%fpcr
- bra t_dz
-
-LP1NEG:
- fmoves zero,%fp0
-
- fmovel %d1,%fpcr
- bra t_operr
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/smovecr.s b/c/src/lib/libcpu/m68k/m68040/fpsp/smovecr.s
deleted file mode 100644
index e2caae764e..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/smovecr.s
+++ /dev/null
@@ -1,164 +0,0 @@
-//
-// $Id$
-//
-// smovecr.sa 3.1 12/10/90
-//
-// The entry point sMOVECR returns the constant at the
-// offset given in the instruction field.
-//
-// Input: An offset in the instruction word.
-//
-// Output: The constant rounded to the user's rounding
-// mode unchecked for overflow.
-//
-// Modified: fp0.
-//
-//
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//SMOVECR idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref nrm_set
- |xref round
- |xref PIRN
- |xref PIRZRM
- |xref PIRP
- |xref SMALRN
- |xref SMALRZRM
- |xref SMALRP
- |xref BIGRN
- |xref BIGRZRM
- |xref BIGRP
-
-FZERO: .long 00000000
-//
-// FMOVECR
-//
- .global smovcr
-smovcr:
- bfextu CMDREG1B(%a6){#9:#7},%d0 //get offset
- bfextu USER_FPCR(%a6){#26:#2},%d1 //get rmode
-//
-// check range of offset
-//
- tstb %d0 //if zero, offset is to pi
- beqs PI_TBL //it is pi
- cmpib #0x0a,%d0 //check range $01 - $0a
- bles Z_VAL //if in this range, return zero
- cmpib #0x0e,%d0 //check range $0b - $0e
- bles SM_TBL //valid constants in this range
- cmpib #0x2f,%d0 //check range $10 - $2f
- bles Z_VAL //if in this range, return zero
- cmpib #0x3f,%d0 //check range $30 - $3f
- ble BG_TBL //valid constants in this range
-Z_VAL:
- fmoves FZERO,%fp0
- rts
-PI_TBL:
- tstb %d1 //offset is zero, check for rmode
- beqs PI_RN //if zero, rn mode
- cmpib #0x3,%d1 //check for rp
- beqs PI_RP //if 3, rp mode
-PI_RZRM:
- leal PIRZRM,%a0 //rmode is rz or rm, load PIRZRM in a0
- bra set_finx
-PI_RN:
- leal PIRN,%a0 //rmode is rn, load PIRN in a0
- bra set_finx
-PI_RP:
- leal PIRP,%a0 //rmode is rp, load PIRP in a0
- bra set_finx
-SM_TBL:
- subil #0xb,%d0 //make offset in 0 - 4 range
- tstb %d1 //check for rmode
- beqs SM_RN //if zero, rn mode
- cmpib #0x3,%d1 //check for rp
- beqs SM_RP //if 3, rp mode
-SM_RZRM:
- leal SMALRZRM,%a0 //rmode is rz or rm, load SMRZRM in a0
- cmpib #0x2,%d0 //check if result is inex
- ble set_finx //if 0 - 2, it is inexact
- bra no_finx //if 3, it is exact
-SM_RN:
- leal SMALRN,%a0 //rmode is rn, load SMRN in a0
- cmpib #0x2,%d0 //check if result is inex
- ble set_finx //if 0 - 2, it is inexact
- bra no_finx //if 3, it is exact
-SM_RP:
- leal SMALRP,%a0 //rmode is rp, load SMRP in a0
- cmpib #0x2,%d0 //check if result is inex
- ble set_finx //if 0 - 2, it is inexact
- bra no_finx //if 3, it is exact
-BG_TBL:
- subil #0x30,%d0 //make offset in 0 - f range
- tstb %d1 //check for rmode
- beqs BG_RN //if zero, rn mode
- cmpib #0x3,%d1 //check for rp
- beqs BG_RP //if 3, rp mode
-BG_RZRM:
- leal BIGRZRM,%a0 //rmode is rz or rm, load BGRZRM in a0
- cmpib #0x1,%d0 //check if result is inex
- ble set_finx //if 0 - 1, it is inexact
- cmpib #0x7,%d0 //second check
- ble no_finx //if 0 - 7, it is exact
- bra set_finx //if 8 - f, it is inexact
-BG_RN:
- leal BIGRN,%a0 //rmode is rn, load BGRN in a0
- cmpib #0x1,%d0 //check if result is inex
- ble set_finx //if 0 - 1, it is inexact
- cmpib #0x7,%d0 //second check
- ble no_finx //if 0 - 7, it is exact
- bra set_finx //if 8 - f, it is inexact
-BG_RP:
- leal BIGRP,%a0 //rmode is rp, load SMRP in a0
- cmpib #0x1,%d0 //check if result is inex
- ble set_finx //if 0 - 1, it is inexact
- cmpib #0x7,%d0 //second check
- ble no_finx //if 0 - 7, it is exact
-// bra set_finx ;if 8 - f, it is inexact
-set_finx:
- orl #inx2a_mask,USER_FPSR(%a6) //set inex2/ainex
-no_finx:
- mulul #12,%d0 //use offset to point into tables
- movel %d1,L_SCR1(%a6) //load mode for round call
- bfextu USER_FPCR(%a6){#24:#2},%d1 //get precision
- tstl %d1 //check if extended precision
-//
-// Precision is extended
-//
- bnes not_ext //if extended, do not call round
- fmovemx (%a0,%d0),%fp0-%fp0 //return result in fp0
- rts
-//
-// Precision is single or double
-//
-not_ext:
- swap %d1 //rnd prec in upper word of d1
- addl L_SCR1(%a6),%d1 //merge rmode in low word of d1
- movel (%a0,%d0),FP_SCR1(%a6) //load first word to temp storage
- movel 4(%a0,%d0),FP_SCR1+4(%a6) //load second word
- movel 8(%a0,%d0),FP_SCR1+8(%a6) //load third word
- clrl %d0 //clear g,r,s
- lea FP_SCR1(%a6),%a0
- btstb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0) //convert to internal ext. format
-
- bsr round //go round the mantissa
-
- bfclr LOCAL_SGN(%a0){#0:#8} //convert back to IEEE ext format
- beqs fin_fcr
- bsetb #sign_bit,LOCAL_EX(%a0)
-fin_fcr:
- fmovemx (%a0),%fp0-%fp0
- rts
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/srem_mod.s b/c/src/lib/libcpu/m68k/m68040/fpsp/srem_mod.s
deleted file mode 100644
index 8bbcb8a3de..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/srem_mod.s
+++ /dev/null
@@ -1,424 +0,0 @@
-//
-// $Id$
-//
-// srem_mod.sa 3.1 12/10/90
-//
-// The entry point sMOD computes the floating point MOD of the
-// input values X and Y. The entry point sREM computes the floating
-// point (IEEE) REM of the input values X and Y.
-//
-// INPUT
-// -----
-// Double-extended value Y is pointed to by address in register
-// A0. Double-extended value X is located in -12(A0). The values
-// of X and Y are both nonzero and finite; although either or both
-// of them can be denormalized. The special cases of zeros, NaNs,
-// and infinities are handled elsewhere.
-//
-// OUTPUT
-// ------
-// FREM(X,Y) or FMOD(X,Y), depending on entry point.
-//
-// ALGORITHM
-// ---------
-//
-// Step 1. Save and strip signs of X and Y: signX := sign(X),
-// signY := sign(Y), X := |X|, Y := |Y|,
-// signQ := signX EOR signY. Record whether MOD or REM
-// is requested.
-//
-// Step 2. Set L := expo(X)-expo(Y), k := 0, Q := 0.
-// If (L < 0) then
-// R := X, go to Step 4.
-// else
-// R := 2^(-L)X, j := L.
-// endif
-//
-// Step 3. Perform MOD(X,Y)
-// 3.1 If R = Y, go to Step 9.
-// 3.2 If R > Y, then { R := R - Y, Q := Q + 1}
-// 3.3 If j = 0, go to Step 4.
-// 3.4 k := k + 1, j := j - 1, Q := 2Q, R := 2R. Go to
-// Step 3.1.
-//
-// Step 4. At this point, R = X - QY = MOD(X,Y). Set
-// Last_Subtract := false (used in Step 7 below). If
-// MOD is requested, go to Step 6.
-//
-// Step 5. R = MOD(X,Y), but REM(X,Y) is requested.
-// 5.1 If R < Y/2, then R = MOD(X,Y) = REM(X,Y). Go to
-// Step 6.
-// 5.2 If R > Y/2, then { set Last_Subtract := true,
-// Q := Q + 1, Y := signY*Y }. Go to Step 6.
-// 5.3 This is the tricky case of R = Y/2. If Q is odd,
-// then { Q := Q + 1, signX := -signX }.
-//
-// Step 6. R := signX*R.
-//
-// Step 7. If Last_Subtract = true, R := R - Y.
-//
-// Step 8. Return signQ, last 7 bits of Q, and R as required.
-//
-// Step 9. At this point, R = 2^(-j)*X - Q Y = Y. Thus,
-// X = 2^(j)*(Q+1)Y. set Q := 2^(j)*(Q+1),
-// R := 0. Return signQ, last 7 bits of Q, and R.
-//
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-SREM_MOD: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- .set Mod_Flag,L_SCR3
- .set SignY,FP_SCR3+4
- .set SignX,FP_SCR3+8
- .set SignQ,FP_SCR3+12
- .set Sc_Flag,FP_SCR4
-
- .set Y,FP_SCR1
- .set Y_Hi,Y+4
- .set Y_Lo,Y+8
-
- .set R,FP_SCR2
- .set R_Hi,R+4
- .set R_Lo,R+8
-
-
-Scale: .long 0x00010000,0x80000000,0x00000000,0x00000000
-
- |xref t_avoid_unsupp
-
- .global smod
-smod:
-
- movel #0,Mod_Flag(%a6)
- bras Mod_Rem
-
- .global srem
-srem:
-
- movel #1,Mod_Flag(%a6)
-
-Mod_Rem:
-//..Save sign of X and Y
- moveml %d2-%d7,-(%a7) // ...save data registers
- movew (%a0),%d3
- movew %d3,SignY(%a6)
- andil #0x00007FFF,%d3 // ...Y := |Y|
-
-//
- movel 4(%a0),%d4
- movel 8(%a0),%d5 // ...(D3,D4,D5) is |Y|
-
- tstl %d3
- bnes Y_Normal
-
- movel #0x00003FFE,%d3 // ...$3FFD + 1
- tstl %d4
- bnes HiY_not0
-
-HiY_0:
- movel %d5,%d4
- clrl %d5
- subil #32,%d3
- clrl %d6
- bfffo %d4{#0:#32},%d6
- lsll %d6,%d4
- subl %d6,%d3 // ...(D3,D4,D5) is normalized
-// ...with bias $7FFD
- bras Chk_X
-
-HiY_not0:
- clrl %d6
- bfffo %d4{#0:#32},%d6
- subl %d6,%d3
- lsll %d6,%d4
- movel %d5,%d7 // ...a copy of D5
- lsll %d6,%d5
- negl %d6
- addil #32,%d6
- lsrl %d6,%d7
- orl %d7,%d4 // ...(D3,D4,D5) normalized
-// ...with bias $7FFD
- bras Chk_X
-
-Y_Normal:
- addil #0x00003FFE,%d3 // ...(D3,D4,D5) normalized
-// ...with bias $7FFD
-
-Chk_X:
- movew -12(%a0),%d0
- movew %d0,SignX(%a6)
- movew SignY(%a6),%d1
- eorl %d0,%d1
- andil #0x00008000,%d1
- movew %d1,SignQ(%a6) // ...sign(Q) obtained
- andil #0x00007FFF,%d0
- movel -8(%a0),%d1
- movel -4(%a0),%d2 // ...(D0,D1,D2) is |X|
- tstl %d0
- bnes X_Normal
- movel #0x00003FFE,%d0
- tstl %d1
- bnes HiX_not0
-
-HiX_0:
- movel %d2,%d1
- clrl %d2
- subil #32,%d0
- clrl %d6
- bfffo %d1{#0:#32},%d6
- lsll %d6,%d1
- subl %d6,%d0 // ...(D0,D1,D2) is normalized
-// ...with bias $7FFD
- bras Init
-
-HiX_not0:
- clrl %d6
- bfffo %d1{#0:#32},%d6
- subl %d6,%d0
- lsll %d6,%d1
- movel %d2,%d7 // ...a copy of D2
- lsll %d6,%d2
- negl %d6
- addil #32,%d6
- lsrl %d6,%d7
- orl %d7,%d1 // ...(D0,D1,D2) normalized
-// ...with bias $7FFD
- bras Init
-
-X_Normal:
- addil #0x00003FFE,%d0 // ...(D0,D1,D2) normalized
-// ...with bias $7FFD
-
-Init:
-//
- movel %d3,L_SCR1(%a6) // ...save biased expo(Y)
- movel %d0,L_SCR2(%a6) //save d0
- subl %d3,%d0 // ...L := expo(X)-expo(Y)
-// Move.L D0,L ...D0 is j
- clrl %d6 // ...D6 := carry <- 0
- clrl %d3 // ...D3 is Q
- moveal #0,%a1 // ...A1 is k; j+k=L, Q=0
-
-//..(Carry,D1,D2) is R
- tstl %d0
- bges Mod_Loop
-
-//..expo(X) < expo(Y). Thus X = mod(X,Y)
-//
- movel L_SCR2(%a6),%d0 //restore d0
- bra Get_Mod
-
-//..At this point R = 2^(-L)X; Q = 0; k = 0; and k+j = L
-
-
-Mod_Loop:
- tstl %d6 // ...test carry bit
- bgts R_GT_Y
-
-//..At this point carry = 0, R = (D1,D2), Y = (D4,D5)
- cmpl %d4,%d1 // ...compare hi(R) and hi(Y)
- bnes R_NE_Y
- cmpl %d5,%d2 // ...compare lo(R) and lo(Y)
- bnes R_NE_Y
-
-//..At this point, R = Y
- bra Rem_is_0
-
-R_NE_Y:
-//..use the borrow of the previous compare
- bcss R_LT_Y // ...borrow is set iff R < Y
-
-R_GT_Y:
-//..If Carry is set, then Y < (Carry,D1,D2) < 2Y. Otherwise, Carry = 0
-//..and Y < (D1,D2) < 2Y. Either way, perform R - Y
- subl %d5,%d2 // ...lo(R) - lo(Y)
- subxl %d4,%d1 // ...hi(R) - hi(Y)
- clrl %d6 // ...clear carry
- addql #1,%d3 // ...Q := Q + 1
-
-R_LT_Y:
-//..At this point, Carry=0, R < Y. R = 2^(k-L)X - QY; k+j = L; j >= 0.
- tstl %d0 // ...see if j = 0.
- beqs PostLoop
-
- addl %d3,%d3 // ...Q := 2Q
- addl %d2,%d2 // ...lo(R) = 2lo(R)
- roxll #1,%d1 // ...hi(R) = 2hi(R) + carry
- scs %d6 // ...set Carry if 2(R) overflows
- addql #1,%a1 // ...k := k+1
- subql #1,%d0 // ...j := j - 1
-//..At this point, R=(Carry,D1,D2) = 2^(k-L)X - QY, j+k=L, j >= 0, R < 2Y.
-
- bras Mod_Loop
-
-PostLoop:
-//..k = L, j = 0, Carry = 0, R = (D1,D2) = X - QY, R < Y.
-
-//..normalize R.
- movel L_SCR1(%a6),%d0 // ...new biased expo of R
- tstl %d1
- bnes HiR_not0
-
-HiR_0:
- movel %d2,%d1
- clrl %d2
- subil #32,%d0
- clrl %d6
- bfffo %d1{#0:#32},%d6
- lsll %d6,%d1
- subl %d6,%d0 // ...(D0,D1,D2) is normalized
-// ...with bias $7FFD
- bras Get_Mod
-
-HiR_not0:
- clrl %d6
- bfffo %d1{#0:#32},%d6
- bmis Get_Mod // ...already normalized
- subl %d6,%d0
- lsll %d6,%d1
- movel %d2,%d7 // ...a copy of D2
- lsll %d6,%d2
- negl %d6
- addil #32,%d6
- lsrl %d6,%d7
- orl %d7,%d1 // ...(D0,D1,D2) normalized
-
-//
-Get_Mod:
- cmpil #0x000041FE,%d0
- bges No_Scale
-Do_Scale:
- movew %d0,R(%a6)
- clrw R+2(%a6)
- movel %d1,R_Hi(%a6)
- movel %d2,R_Lo(%a6)
- movel L_SCR1(%a6),%d6
- movew %d6,Y(%a6)
- clrw Y+2(%a6)
- movel %d4,Y_Hi(%a6)
- movel %d5,Y_Lo(%a6)
- fmovex R(%a6),%fp0 // ...no exception
- movel #1,Sc_Flag(%a6)
- bras ModOrRem
-No_Scale:
- movel %d1,R_Hi(%a6)
- movel %d2,R_Lo(%a6)
- subil #0x3FFE,%d0
- movew %d0,R(%a6)
- clrw R+2(%a6)
- movel L_SCR1(%a6),%d6
- subil #0x3FFE,%d6
- movel %d6,L_SCR1(%a6)
- fmovex R(%a6),%fp0
- movew %d6,Y(%a6)
- movel %d4,Y_Hi(%a6)
- movel %d5,Y_Lo(%a6)
- movel #0,Sc_Flag(%a6)
-
-//
-
-
-ModOrRem:
- movel Mod_Flag(%a6),%d6
- beqs Fix_Sign
-
- movel L_SCR1(%a6),%d6 // ...new biased expo(Y)
- subql #1,%d6 // ...biased expo(Y/2)
- cmpl %d6,%d0
- blts Fix_Sign
- bgts Last_Sub
-
- cmpl %d4,%d1
- bnes Not_EQ
- cmpl %d5,%d2
- bnes Not_EQ
- bra Tie_Case
-
-Not_EQ:
- bcss Fix_Sign
-
-Last_Sub:
-//
- fsubx Y(%a6),%fp0 // ...no exceptions
- addql #1,%d3 // ...Q := Q + 1
-
-//
-
-Fix_Sign:
-//..Get sign of X
- movew SignX(%a6),%d6
- bges Get_Q
- fnegx %fp0
-
-//..Get Q
-//
-Get_Q:
- clrl %d6
- movew SignQ(%a6),%d6 // ...D6 is sign(Q)
- movel #8,%d7
- lsrl %d7,%d6
- andil #0x0000007F,%d3 // ...7 bits of Q
- orl %d6,%d3 // ...sign and bits of Q
- swap %d3
- fmovel %fpsr,%d6
- andil #0xFF00FFFF,%d6
- orl %d3,%d6
- fmovel %d6,%fpsr // ...put Q in fpsr
-
-//
-Restore:
- moveml (%a7)+,%d2-%d7
- fmovel USER_FPCR(%a6),%fpcr
- movel Sc_Flag(%a6),%d0
- beqs Finish
- fmulx Scale(%pc),%fp0 // ...may cause underflow
- bra t_avoid_unsupp //check for denorm as a
-// ;result of the scaling
-
-Finish:
- fmovex %fp0,%fp0 //capture exceptions & round
- rts
-
-Rem_is_0:
-//..R = 2^(-j)X - Q Y = Y, thus R = 0 and quotient = 2^j (Q+1)
- addql #1,%d3
- cmpil #8,%d0 // ...D0 is j
- bges Q_Big
-
- lsll %d0,%d3
- bras Set_R_0
-
-Q_Big:
- clrl %d3
-
-Set_R_0:
- fmoves #0x00000000,%fp0
- movel #0,Sc_Flag(%a6)
- bra Fix_Sign
-
-Tie_Case:
-//..Check parity of Q
- movel %d3,%d6
- andil #0x00000001,%d6
- tstl %d6
- beq Fix_Sign // ...Q is even
-
-//..Q is odd, Q := Q + 1, signX := -signX
- addql #1,%d3
- movew SignX(%a6),%d6
- eoril #0x00008000,%d6
- movew %d6,SignX(%a6)
- bra Fix_Sign
-
- //end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/ssin.s b/c/src/lib/libcpu/m68k/m68040/fpsp/ssin.s
deleted file mode 100644
index 9c93c95940..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/ssin.s
+++ /dev/null
@@ -1,748 +0,0 @@
-//
-// $Id$
-//
-// ssin.sa 3.3 7/29/91
-//
-// The entry point sSIN computes the sine of an input argument
-// sCOS computes the cosine, and sSINCOS computes both. The
-// corresponding entry points with a "d" computes the same
-// corresponding function values for denormalized inputs.
-//
-// Input: Double-extended number X in location pointed to
-// by address register a0.
-//
-// Output: The function value sin(X) or cos(X) returned in Fp0 if SIN or
-// COS is requested. Otherwise, for SINCOS, sin(X) is returned
-// in Fp0, and cos(X) is returned in Fp1.
-//
-// Modifies: Fp0 for SIN or COS; both Fp0 and Fp1 for SINCOS.
-//
-// Accuracy and Monotonicity: The returned result is within 1 ulp in
-// 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-// result is subsequently rounded to double precision. The
-// result is provably monotonic in double precision.
-//
-// Speed: The programs sSIN and sCOS take approximately 150 cycles for
-// input argument X such that |X| < 15Pi, which is the the usual
-// situation. The speed for sSINCOS is approximately 190 cycles.
-//
-// Algorithm:
-//
-// SIN and COS:
-// 1. If SIN is invoked, set AdjN := 0; otherwise, set AdjN := 1.
-//
-// 2. If |X| >= 15Pi or |X| < 2**(-40), go to 7.
-//
-// 3. Decompose X as X = N(Pi/2) + r where |r| <= Pi/4. Let
-// k = N mod 4, so in particular, k = 0,1,2,or 3. Overwrite
-// k by k := k + AdjN.
-//
-// 4. If k is even, go to 6.
-//
-// 5. (k is odd) Set j := (k-1)/2, sgn := (-1)**j. Return sgn*cos(r)
-// where cos(r) is approximated by an even polynomial in r,
-// 1 + r*r*(B1+s*(B2+ ... + s*B8)), s = r*r.
-// Exit.
-//
-// 6. (k is even) Set j := k/2, sgn := (-1)**j. Return sgn*sin(r)
-// where sin(r) is approximated by an odd polynomial in r
-// r + r*s*(A1+s*(A2+ ... + s*A7)), s = r*r.
-// Exit.
-//
-// 7. If |X| > 1, go to 9.
-//
-// 8. (|X|<2**(-40)) If SIN is invoked, return X; otherwise return 1.
-//
-// 9. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi, go back to 3.
-//
-// SINCOS:
-// 1. If |X| >= 15Pi or |X| < 2**(-40), go to 6.
-//
-// 2. Decompose X as X = N(Pi/2) + r where |r| <= Pi/4. Let
-// k = N mod 4, so in particular, k = 0,1,2,or 3.
-//
-// 3. If k is even, go to 5.
-//
-// 4. (k is odd) Set j1 := (k-1)/2, j2 := j1 (EOR) (k mod 2), i.e.
-// j1 exclusive or with the l.s.b. of k.
-// sgn1 := (-1)**j1, sgn2 := (-1)**j2.
-// SIN(X) = sgn1 * cos(r) and COS(X) = sgn2*sin(r) where
-// sin(r) and cos(r) are computed as odd and even polynomials
-// in r, respectively. Exit
-//
-// 5. (k is even) Set j1 := k/2, sgn1 := (-1)**j1.
-// SIN(X) = sgn1 * sin(r) and COS(X) = sgn1*cos(r) where
-// sin(r) and cos(r) are computed as odd and even polynomials
-// in r, respectively. Exit
-//
-// 6. If |X| > 1, go to 8.
-//
-// 7. (|X|<2**(-40)) SIN(X) = X and COS(X) = 1. Exit.
-//
-// 8. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi, go back to 2.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//SSIN idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
-BOUNDS1: .long 0x3FD78000,0x4004BC7E
-TWOBYPI: .long 0x3FE45F30,0x6DC9C883
-
-SINA7: .long 0xBD6AAA77,0xCCC994F5
-SINA6: .long 0x3DE61209,0x7AAE8DA1
-
-SINA5: .long 0xBE5AE645,0x2A118AE4
-SINA4: .long 0x3EC71DE3,0xA5341531
-
-SINA3: .long 0xBF2A01A0,0x1A018B59,0x00000000,0x00000000
-
-SINA2: .long 0x3FF80000,0x88888888,0x888859AF,0x00000000
-
-SINA1: .long 0xBFFC0000,0xAAAAAAAA,0xAAAAAA99,0x00000000
-
-COSB8: .long 0x3D2AC4D0,0xD6011EE3
-COSB7: .long 0xBDA9396F,0x9F45AC19
-
-COSB6: .long 0x3E21EED9,0x0612C972
-COSB5: .long 0xBE927E4F,0xB79D9FCF
-
-COSB4: .long 0x3EFA01A0,0x1A01D423,0x00000000,0x00000000
-
-COSB3: .long 0xBFF50000,0xB60B60B6,0x0B61D438,0x00000000
-
-COSB2: .long 0x3FFA0000,0xAAAAAAAA,0xAAAAAB5E
-COSB1: .long 0xBF000000
-
-INVTWOPI: .long 0x3FFC0000,0xA2F9836E,0x4E44152A
-
-TWOPI1: .long 0x40010000,0xC90FDAA2,0x00000000,0x00000000
-TWOPI2: .long 0x3FDF0000,0x85A308D4,0x00000000,0x00000000
-
- |xref PITBL
-
- .set INARG,FP_SCR4
-
- .set X,FP_SCR5
- .set XDCARE,X+2
- .set XFRAC,X+4
-
- .set RPRIME,FP_SCR1
- .set SPRIME,FP_SCR2
-
- .set POSNEG1,L_SCR1
- .set TWOTO63,L_SCR1
-
- .set ENDFLAG,L_SCR2
- .set N,L_SCR2
-
- .set ADJN,L_SCR3
-
- | xref t_frcinx
- |xref t_extdnrm
- |xref sto_cos
-
- .global ssind
-ssind:
-//--SIN(X) = X FOR DENORMALIZED X
- bra t_extdnrm
-
- .global scosd
-scosd:
-//--COS(X) = 1 FOR DENORMALIZED X
-
- fmoves #0x3F800000,%fp0
-//
-// 9D25B Fix: Sometimes the previous fmove.s sets fpsr bits
-//
- fmovel #0,%fpsr
-//
- bra t_frcinx
-
- .global ssin
-ssin:
-//--SET ADJN TO 0
- movel #0,ADJN(%a6)
- bras SINBGN
-
- .global scos
-scos:
-//--SET ADJN TO 1
- movel #1,ADJN(%a6)
-
-SINBGN:
-//--SAVE FPCR, FP1. CHECK IF |X| IS TOO SMALL OR LARGE
-
- fmovex (%a0),%fp0 // ...LOAD INPUT
-
- movel (%a0),%d0
- movew 4(%a0),%d0
- fmovex %fp0,X(%a6)
- andil #0x7FFFFFFF,%d0 // ...COMPACTIFY X
-
- cmpil #0x3FD78000,%d0 // ...|X| >= 2**(-40)?
- bges SOK1
- bra SINSM
-
-SOK1:
- cmpil #0x4004BC7E,%d0 // ...|X| < 15 PI?
- blts SINMAIN
- bra REDUCEX
-
-SINMAIN:
-//--THIS IS THE USUAL CASE, |X| <= 15 PI.
-//--THE ARGUMENT REDUCTION IS DONE BY TABLE LOOK UP.
- fmovex %fp0,%fp1
- fmuld TWOBYPI,%fp1 // ...X*2/PI
-
-//--HIDE THE NEXT THREE INSTRUCTIONS
- lea PITBL+0x200,%a1 // ...TABLE OF N*PI/2, N = -32,...,32
-
-
-//--FP1 IS NOW READY
- fmovel %fp1,N(%a6) // ...CONVERT TO INTEGER
-
- movel N(%a6),%d0
- asll #4,%d0
- addal %d0,%a1 // ...A1 IS THE ADDRESS OF N*PIBY2
-// ...WHICH IS IN TWO PIECES Y1 & Y2
-
- fsubx (%a1)+,%fp0 // ...X-Y1
-//--HIDE THE NEXT ONE
- fsubs (%a1),%fp0 // ...FP0 IS R = (X-Y1)-Y2
-
-SINCONT:
-//--continuation from REDUCEX
-
-//--GET N+ADJN AND SEE IF SIN(R) OR COS(R) IS NEEDED
- movel N(%a6),%d0
- addl ADJN(%a6),%d0 // ...SEE IF D0 IS ODD OR EVEN
- rorl #1,%d0 // ...D0 WAS ODD IFF D0 IS NEGATIVE
- cmpil #0,%d0
- blt COSPOLY
-
-SINPOLY:
-//--LET J BE THE LEAST SIG. BIT OF D0, LET SGN := (-1)**J.
-//--THEN WE RETURN SGN*SIN(R). SGN*SIN(R) IS COMPUTED BY
-//--R' + R'*S*(A1 + S(A2 + S(A3 + S(A4 + ... + SA7)))), WHERE
-//--R' = SGN*R, S=R*R. THIS CAN BE REWRITTEN AS
-//--R' + R'*S*( [A1+T(A3+T(A5+TA7))] + [S(A2+T(A4+TA6))])
-//--WHERE T=S*S.
-//--NOTE THAT A3 THROUGH A7 ARE STORED IN DOUBLE PRECISION
-//--WHILE A1 AND A2 ARE IN DOUBLE-EXTENDED FORMAT.
- fmovex %fp0,X(%a6) // ...X IS R
- fmulx %fp0,%fp0 // ...FP0 IS S
-//---HIDE THE NEXT TWO WHILE WAITING FOR FP0
- fmoved SINA7,%fp3
- fmoved SINA6,%fp2
-//--FP0 IS NOW READY
- fmovex %fp0,%fp1
- fmulx %fp1,%fp1 // ...FP1 IS T
-//--HIDE THE NEXT TWO WHILE WAITING FOR FP1
-
- rorl #1,%d0
- andil #0x80000000,%d0
-// ...LEAST SIG. BIT OF D0 IN SIGN POSITION
- eorl %d0,X(%a6) // ...X IS NOW R'= SGN*R
-
- fmulx %fp1,%fp3 // ...TA7
- fmulx %fp1,%fp2 // ...TA6
-
- faddd SINA5,%fp3 // ...A5+TA7
- faddd SINA4,%fp2 // ...A4+TA6
-
- fmulx %fp1,%fp3 // ...T(A5+TA7)
- fmulx %fp1,%fp2 // ...T(A4+TA6)
-
- faddd SINA3,%fp3 // ...A3+T(A5+TA7)
- faddx SINA2,%fp2 // ...A2+T(A4+TA6)
-
- fmulx %fp3,%fp1 // ...T(A3+T(A5+TA7))
-
- fmulx %fp0,%fp2 // ...S(A2+T(A4+TA6))
- faddx SINA1,%fp1 // ...A1+T(A3+T(A5+TA7))
- fmulx X(%a6),%fp0 // ...R'*S
-
- faddx %fp2,%fp1 // ...[A1+T(A3+T(A5+TA7))]+[S(A2+T(A4+TA6))]
-//--FP3 RELEASED, RESTORE NOW AND TAKE SOME ADVANTAGE OF HIDING
-//--FP2 RELEASED, RESTORE NOW AND TAKE FULL ADVANTAGE OF HIDING
-
-
- fmulx %fp1,%fp0 // ...SIN(R')-R'
-//--FP1 RELEASED.
-
- fmovel %d1,%FPCR //restore users exceptions
- faddx X(%a6),%fp0 //last inst - possible exception set
- bra t_frcinx
-
-
-COSPOLY:
-//--LET J BE THE LEAST SIG. BIT OF D0, LET SGN := (-1)**J.
-//--THEN WE RETURN SGN*COS(R). SGN*COS(R) IS COMPUTED BY
-//--SGN + S'*(B1 + S(B2 + S(B3 + S(B4 + ... + SB8)))), WHERE
-//--S=R*R AND S'=SGN*S. THIS CAN BE REWRITTEN AS
-//--SGN + S'*([B1+T(B3+T(B5+TB7))] + [S(B2+T(B4+T(B6+TB8)))])
-//--WHERE T=S*S.
-//--NOTE THAT B4 THROUGH B8 ARE STORED IN DOUBLE PRECISION
-//--WHILE B2 AND B3 ARE IN DOUBLE-EXTENDED FORMAT, B1 IS -1/2
-//--AND IS THEREFORE STORED AS SINGLE PRECISION.
-
- fmulx %fp0,%fp0 // ...FP0 IS S
-//---HIDE THE NEXT TWO WHILE WAITING FOR FP0
- fmoved COSB8,%fp2
- fmoved COSB7,%fp3
-//--FP0 IS NOW READY
- fmovex %fp0,%fp1
- fmulx %fp1,%fp1 // ...FP1 IS T
-//--HIDE THE NEXT TWO WHILE WAITING FOR FP1
- fmovex %fp0,X(%a6) // ...X IS S
- rorl #1,%d0
- andil #0x80000000,%d0
-// ...LEAST SIG. BIT OF D0 IN SIGN POSITION
-
- fmulx %fp1,%fp2 // ...TB8
-//--HIDE THE NEXT TWO WHILE WAITING FOR THE XU
- eorl %d0,X(%a6) // ...X IS NOW S'= SGN*S
- andil #0x80000000,%d0
-
- fmulx %fp1,%fp3 // ...TB7
-//--HIDE THE NEXT TWO WHILE WAITING FOR THE XU
- oril #0x3F800000,%d0 // ...D0 IS SGN IN SINGLE
- movel %d0,POSNEG1(%a6)
-
- faddd COSB6,%fp2 // ...B6+TB8
- faddd COSB5,%fp3 // ...B5+TB7
-
- fmulx %fp1,%fp2 // ...T(B6+TB8)
- fmulx %fp1,%fp3 // ...T(B5+TB7)
-
- faddd COSB4,%fp2 // ...B4+T(B6+TB8)
- faddx COSB3,%fp3 // ...B3+T(B5+TB7)
-
- fmulx %fp1,%fp2 // ...T(B4+T(B6+TB8))
- fmulx %fp3,%fp1 // ...T(B3+T(B5+TB7))
-
- faddx COSB2,%fp2 // ...B2+T(B4+T(B6+TB8))
- fadds COSB1,%fp1 // ...B1+T(B3+T(B5+TB7))
-
- fmulx %fp2,%fp0 // ...S(B2+T(B4+T(B6+TB8)))
-//--FP3 RELEASED, RESTORE NOW AND TAKE SOME ADVANTAGE OF HIDING
-//--FP2 RELEASED.
-
-
- faddx %fp1,%fp0
-//--FP1 RELEASED
-
- fmulx X(%a6),%fp0
-
- fmovel %d1,%FPCR //restore users exceptions
- fadds POSNEG1(%a6),%fp0 //last inst - possible exception set
- bra t_frcinx
-
-
-SINBORS:
-//--IF |X| > 15PI, WE USE THE GENERAL ARGUMENT REDUCTION.
-//--IF |X| < 2**(-40), RETURN X OR 1.
- cmpil #0x3FFF8000,%d0
- bgts REDUCEX
-
-
-SINSM:
- movel ADJN(%a6),%d0
- cmpil #0,%d0
- bgts COSTINY
-
-SINTINY:
- movew #0x0000,XDCARE(%a6) // ...JUST IN CASE
- fmovel %d1,%FPCR //restore users exceptions
- fmovex X(%a6),%fp0 //last inst - possible exception set
- bra t_frcinx
-
-
-COSTINY:
- fmoves #0x3F800000,%fp0
-
- fmovel %d1,%FPCR //restore users exceptions
- fsubs #0x00800000,%fp0 //last inst - possible exception set
- bra t_frcinx
-
-
-REDUCEX:
-//--WHEN REDUCEX IS USED, THE CODE WILL INEVITABLY BE SLOW.
-//--THIS REDUCTION METHOD, HOWEVER, IS MUCH FASTER THAN USING
-//--THE REMAINDER INSTRUCTION WHICH IS NOW IN SOFTWARE.
-
- fmovemx %fp2-%fp5,-(%a7) // ...save FP2 through FP5
- movel %d2,-(%a7)
- fmoves #0x00000000,%fp1
-//--If compact form of abs(arg) in d0=$7ffeffff, argument is so large that
-//--there is a danger of unwanted overflow in first LOOP iteration. In this
-//--case, reduce argument by one remainder step to make subsequent reduction
-//--safe.
- cmpil #0x7ffeffff,%d0 //is argument dangerously large?
- bnes LOOP
- movel #0x7ffe0000,FP_SCR2(%a6) //yes
-// ;create 2**16383*PI/2
- movel #0xc90fdaa2,FP_SCR2+4(%a6)
- clrl FP_SCR2+8(%a6)
- ftstx %fp0 //test sign of argument
- movel #0x7fdc0000,FP_SCR3(%a6) //create low half of 2**16383*
-// ;PI/2 at FP_SCR3
- movel #0x85a308d3,FP_SCR3+4(%a6)
- clrl FP_SCR3+8(%a6)
- fblt red_neg
- orw #0x8000,FP_SCR2(%a6) //positive arg
- orw #0x8000,FP_SCR3(%a6)
-red_neg:
- faddx FP_SCR2(%a6),%fp0 //high part of reduction is exact
- fmovex %fp0,%fp1 //save high result in fp1
- faddx FP_SCR3(%a6),%fp0 //low part of reduction
- fsubx %fp0,%fp1 //determine low component of result
- faddx FP_SCR3(%a6),%fp1 //fp0/fp1 are reduced argument.
-
-//--ON ENTRY, FP0 IS X, ON RETURN, FP0 IS X REM PI/2, |X| <= PI/4.
-//--integer quotient will be stored in N
-//--Intermediate remainder is 66-bit long; (R,r) in (FP0,FP1)
-
-LOOP:
- fmovex %fp0,INARG(%a6) // ...+-2**K * F, 1 <= F < 2
- movew INARG(%a6),%d0
- movel %d0,%a1 // ...save a copy of D0
- andil #0x00007FFF,%d0
- subil #0x00003FFF,%d0 // ...D0 IS K
- cmpil #28,%d0
- bles LASTLOOP
-CONTLOOP:
- subil #27,%d0 // ...D0 IS L := K-27
- movel #0,ENDFLAG(%a6)
- bras WORK
-LASTLOOP:
- clrl %d0 // ...D0 IS L := 0
- movel #1,ENDFLAG(%a6)
-
-WORK:
-//--FIND THE REMAINDER OF (R,r) W.R.T. 2**L * (PI/2). L IS SO CHOSEN
-//--THAT INT( X * (2/PI) / 2**(L) ) < 2**29.
-
-//--CREATE 2**(-L) * (2/PI), SIGN(INARG)*2**(63),
-//--2**L * (PIby2_1), 2**L * (PIby2_2)
-
- movel #0x00003FFE,%d2 // ...BIASED EXPO OF 2/PI
- subl %d0,%d2 // ...BIASED EXPO OF 2**(-L)*(2/PI)
-
- movel #0xA2F9836E,FP_SCR1+4(%a6)
- movel #0x4E44152A,FP_SCR1+8(%a6)
- movew %d2,FP_SCR1(%a6) // ...FP_SCR1 is 2**(-L)*(2/PI)
-
- fmovex %fp0,%fp2
- fmulx FP_SCR1(%a6),%fp2
-//--WE MUST NOW FIND INT(FP2). SINCE WE NEED THIS VALUE IN
-//--FLOATING POINT FORMAT, THE TWO FMOVE'S FMOVE.L FP <--> N
-//--WILL BE TOO INEFFICIENT. THE WAY AROUND IT IS THAT
-//--(SIGN(INARG)*2**63 + FP2) - SIGN(INARG)*2**63 WILL GIVE
-//--US THE DESIRED VALUE IN FLOATING POINT.
-
-//--HIDE SIX CYCLES OF INSTRUCTION
- movel %a1,%d2
- swap %d2
- andil #0x80000000,%d2
- oril #0x5F000000,%d2 // ...D2 IS SIGN(INARG)*2**63 IN SGL
- movel %d2,TWOTO63(%a6)
-
- movel %d0,%d2
- addil #0x00003FFF,%d2 // ...BIASED EXPO OF 2**L * (PI/2)
-
-//--FP2 IS READY
- fadds TWOTO63(%a6),%fp2 // ...THE FRACTIONAL PART OF FP1 IS ROUNDED
-
-//--HIDE 4 CYCLES OF INSTRUCTION; creating 2**(L)*Piby2_1 and 2**(L)*Piby2_2
- movew %d2,FP_SCR2(%a6)
- clrw FP_SCR2+2(%a6)
- movel #0xC90FDAA2,FP_SCR2+4(%a6)
- clrl FP_SCR2+8(%a6) // ...FP_SCR2 is 2**(L) * Piby2_1
-
-//--FP2 IS READY
- fsubs TWOTO63(%a6),%fp2 // ...FP2 is N
-
- addil #0x00003FDD,%d0
- movew %d0,FP_SCR3(%a6)
- clrw FP_SCR3+2(%a6)
- movel #0x85A308D3,FP_SCR3+4(%a6)
- clrl FP_SCR3+8(%a6) // ...FP_SCR3 is 2**(L) * Piby2_2
-
- movel ENDFLAG(%a6),%d0
-
-//--We are now ready to perform (R+r) - N*P1 - N*P2, P1 = 2**(L) * Piby2_1 and
-//--P2 = 2**(L) * Piby2_2
- fmovex %fp2,%fp4
- fmulx FP_SCR2(%a6),%fp4 // ...W = N*P1
- fmovex %fp2,%fp5
- fmulx FP_SCR3(%a6),%fp5 // ...w = N*P2
- fmovex %fp4,%fp3
-//--we want P+p = W+w but |p| <= half ulp of P
-//--Then, we need to compute A := R-P and a := r-p
- faddx %fp5,%fp3 // ...FP3 is P
- fsubx %fp3,%fp4 // ...W-P
-
- fsubx %fp3,%fp0 // ...FP0 is A := R - P
- faddx %fp5,%fp4 // ...FP4 is p = (W-P)+w
-
- fmovex %fp0,%fp3 // ...FP3 A
- fsubx %fp4,%fp1 // ...FP1 is a := r - p
-
-//--Now we need to normalize (A,a) to "new (R,r)" where R+r = A+a but
-//--|r| <= half ulp of R.
- faddx %fp1,%fp0 // ...FP0 is R := A+a
-//--No need to calculate r if this is the last loop
- cmpil #0,%d0
- bgt RESTORE
-
-//--Need to calculate r
- fsubx %fp0,%fp3 // ...A-R
- faddx %fp3,%fp1 // ...FP1 is r := (A-R)+a
- bra LOOP
-
-RESTORE:
- fmovel %fp2,N(%a6)
- movel (%a7)+,%d2
- fmovemx (%a7)+,%fp2-%fp5
-
-
- movel ADJN(%a6),%d0
- cmpil #4,%d0
-
- blt SINCONT
- bras SCCONT
-
- .global ssincosd
-ssincosd:
-//--SIN AND COS OF X FOR DENORMALIZED X
-
- fmoves #0x3F800000,%fp1
- bsr sto_cos //store cosine result
- bra t_extdnrm
-
- .global ssincos
-ssincos:
-//--SET ADJN TO 4
- movel #4,ADJN(%a6)
-
- fmovex (%a0),%fp0 // ...LOAD INPUT
-
- movel (%a0),%d0
- movew 4(%a0),%d0
- fmovex %fp0,X(%a6)
- andil #0x7FFFFFFF,%d0 // ...COMPACTIFY X
-
- cmpil #0x3FD78000,%d0 // ...|X| >= 2**(-40)?
- bges SCOK1
- bra SCSM
-
-SCOK1:
- cmpil #0x4004BC7E,%d0 // ...|X| < 15 PI?
- blts SCMAIN
- bra REDUCEX
-
-
-SCMAIN:
-//--THIS IS THE USUAL CASE, |X| <= 15 PI.
-//--THE ARGUMENT REDUCTION IS DONE BY TABLE LOOK UP.
- fmovex %fp0,%fp1
- fmuld TWOBYPI,%fp1 // ...X*2/PI
-
-//--HIDE THE NEXT THREE INSTRUCTIONS
- lea PITBL+0x200,%a1 // ...TABLE OF N*PI/2, N = -32,...,32
-
-
-//--FP1 IS NOW READY
- fmovel %fp1,N(%a6) // ...CONVERT TO INTEGER
-
- movel N(%a6),%d0
- asll #4,%d0
- addal %d0,%a1 // ...ADDRESS OF N*PIBY2, IN Y1, Y2
-
- fsubx (%a1)+,%fp0 // ...X-Y1
- fsubs (%a1),%fp0 // ...FP0 IS R = (X-Y1)-Y2
-
-SCCONT:
-//--continuation point from REDUCEX
-
-//--HIDE THE NEXT TWO
- movel N(%a6),%d0
- rorl #1,%d0
-
- cmpil #0,%d0 // ...D0 < 0 IFF N IS ODD
- bge NEVEN
-
-NODD:
-//--REGISTERS SAVED SO FAR: D0, A0, FP2.
-
- fmovex %fp0,RPRIME(%a6)
- fmulx %fp0,%fp0 // ...FP0 IS S = R*R
- fmoved SINA7,%fp1 // ...A7
- fmoved COSB8,%fp2 // ...B8
- fmulx %fp0,%fp1 // ...SA7
- movel %d2,-(%a7)
- movel %d0,%d2
- fmulx %fp0,%fp2 // ...SB8
- rorl #1,%d2
- andil #0x80000000,%d2
-
- faddd SINA6,%fp1 // ...A6+SA7
- eorl %d0,%d2
- andil #0x80000000,%d2
- faddd COSB7,%fp2 // ...B7+SB8
-
- fmulx %fp0,%fp1 // ...S(A6+SA7)
- eorl %d2,RPRIME(%a6)
- movel (%a7)+,%d2
- fmulx %fp0,%fp2 // ...S(B7+SB8)
- rorl #1,%d0
- andil #0x80000000,%d0
-
- faddd SINA5,%fp1 // ...A5+S(A6+SA7)
- movel #0x3F800000,POSNEG1(%a6)
- eorl %d0,POSNEG1(%a6)
- faddd COSB6,%fp2 // ...B6+S(B7+SB8)
-
- fmulx %fp0,%fp1 // ...S(A5+S(A6+SA7))
- fmulx %fp0,%fp2 // ...S(B6+S(B7+SB8))
- fmovex %fp0,SPRIME(%a6)
-
- faddd SINA4,%fp1 // ...A4+S(A5+S(A6+SA7))
- eorl %d0,SPRIME(%a6)
- faddd COSB5,%fp2 // ...B5+S(B6+S(B7+SB8))
-
- fmulx %fp0,%fp1 // ...S(A4+...)
- fmulx %fp0,%fp2 // ...S(B5+...)
-
- faddd SINA3,%fp1 // ...A3+S(A4+...)
- faddd COSB4,%fp2 // ...B4+S(B5+...)
-
- fmulx %fp0,%fp1 // ...S(A3+...)
- fmulx %fp0,%fp2 // ...S(B4+...)
-
- faddx SINA2,%fp1 // ...A2+S(A3+...)
- faddx COSB3,%fp2 // ...B3+S(B4+...)
-
- fmulx %fp0,%fp1 // ...S(A2+...)
- fmulx %fp0,%fp2 // ...S(B3+...)
-
- faddx SINA1,%fp1 // ...A1+S(A2+...)
- faddx COSB2,%fp2 // ...B2+S(B3+...)
-
- fmulx %fp0,%fp1 // ...S(A1+...)
- fmulx %fp2,%fp0 // ...S(B2+...)
-
-
-
- fmulx RPRIME(%a6),%fp1 // ...R'S(A1+...)
- fadds COSB1,%fp0 // ...B1+S(B2...)
- fmulx SPRIME(%a6),%fp0 // ...S'(B1+S(B2+...))
-
- movel %d1,-(%sp) //restore users mode & precision
- andil #0xff,%d1 //mask off all exceptions
- fmovel %d1,%FPCR
- faddx RPRIME(%a6),%fp1 // ...COS(X)
- bsr sto_cos //store cosine result
- fmovel (%sp)+,%FPCR //restore users exceptions
- fadds POSNEG1(%a6),%fp0 // ...SIN(X)
-
- bra t_frcinx
-
-
-NEVEN:
-//--REGISTERS SAVED SO FAR: FP2.
-
- fmovex %fp0,RPRIME(%a6)
- fmulx %fp0,%fp0 // ...FP0 IS S = R*R
- fmoved COSB8,%fp1 // ...B8
- fmoved SINA7,%fp2 // ...A7
- fmulx %fp0,%fp1 // ...SB8
- fmovex %fp0,SPRIME(%a6)
- fmulx %fp0,%fp2 // ...SA7
- rorl #1,%d0
- andil #0x80000000,%d0
- faddd COSB7,%fp1 // ...B7+SB8
- faddd SINA6,%fp2 // ...A6+SA7
- eorl %d0,RPRIME(%a6)
- eorl %d0,SPRIME(%a6)
- fmulx %fp0,%fp1 // ...S(B7+SB8)
- oril #0x3F800000,%d0
- movel %d0,POSNEG1(%a6)
- fmulx %fp0,%fp2 // ...S(A6+SA7)
-
- faddd COSB6,%fp1 // ...B6+S(B7+SB8)
- faddd SINA5,%fp2 // ...A5+S(A6+SA7)
-
- fmulx %fp0,%fp1 // ...S(B6+S(B7+SB8))
- fmulx %fp0,%fp2 // ...S(A5+S(A6+SA7))
-
- faddd COSB5,%fp1 // ...B5+S(B6+S(B7+SB8))
- faddd SINA4,%fp2 // ...A4+S(A5+S(A6+SA7))
-
- fmulx %fp0,%fp1 // ...S(B5+...)
- fmulx %fp0,%fp2 // ...S(A4+...)
-
- faddd COSB4,%fp1 // ...B4+S(B5+...)
- faddd SINA3,%fp2 // ...A3+S(A4+...)
-
- fmulx %fp0,%fp1 // ...S(B4+...)
- fmulx %fp0,%fp2 // ...S(A3+...)
-
- faddx COSB3,%fp1 // ...B3+S(B4+...)
- faddx SINA2,%fp2 // ...A2+S(A3+...)
-
- fmulx %fp0,%fp1 // ...S(B3+...)
- fmulx %fp0,%fp2 // ...S(A2+...)
-
- faddx COSB2,%fp1 // ...B2+S(B3+...)
- faddx SINA1,%fp2 // ...A1+S(A2+...)
-
- fmulx %fp0,%fp1 // ...S(B2+...)
- fmulx %fp2,%fp0 // ...s(a1+...)
-
-
-
- fadds COSB1,%fp1 // ...B1+S(B2...)
- fmulx RPRIME(%a6),%fp0 // ...R'S(A1+...)
- fmulx SPRIME(%a6),%fp1 // ...S'(B1+S(B2+...))
-
- movel %d1,-(%sp) //save users mode & precision
- andil #0xff,%d1 //mask off all exceptions
- fmovel %d1,%FPCR
- fadds POSNEG1(%a6),%fp1 // ...COS(X)
- bsr sto_cos //store cosine result
- fmovel (%sp)+,%FPCR //restore users exceptions
- faddx RPRIME(%a6),%fp0 // ...SIN(X)
-
- bra t_frcinx
-
-SCBORS:
- cmpil #0x3FFF8000,%d0
- bgt REDUCEX
-
-
-SCSM:
- movew #0x0000,XDCARE(%a6)
- fmoves #0x3F800000,%fp1
-
- movel %d1,-(%sp) //save users mode & precision
- andil #0xff,%d1 //mask off all exceptions
- fmovel %d1,%FPCR
- fsubs #0x00800000,%fp1
- bsr sto_cos //store cosine result
- fmovel (%sp)+,%FPCR //restore users exceptions
- fmovex X(%a6),%fp0
- bra t_frcinx
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/ssinh.s b/c/src/lib/libcpu/m68k/m68040/fpsp/ssinh.s
deleted file mode 100644
index 52af339319..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/ssinh.s
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// $Id$
-//
-// ssinh.sa 3.1 12/10/90
-//
-// The entry point sSinh computes the hyperbolic sine of
-// an input argument; sSinhd does the same except for denormalized
-// input.
-//
-// Input: Double-extended number X in location pointed to
-// by address register a0.
-//
-// Output: The value sinh(X) returned in floating-point register Fp0.
-//
-// Accuracy and Monotonicity: The returned result is within 3 ulps in
-// 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-// result is subsequently rounded to double precision. The
-// result is provably monotonic in double precision.
-//
-// Speed: The program sSINH takes approximately 280 cycles.
-//
-// Algorithm:
-//
-// SINH
-// 1. If |X| > 16380 log2, go to 3.
-//
-// 2. (|X| <= 16380 log2) Sinh(X) is obtained by the formulae
-// y = |X|, sgn = sign(X), and z = expm1(Y),
-// sinh(X) = sgn*(1/2)*( z + z/(1+z) ).
-// Exit.
-//
-// 3. If |X| > 16480 log2, go to 5.
-//
-// 4. (16380 log2 < |X| <= 16480 log2)
-// sinh(X) = sign(X) * exp(|X|)/2.
-// However, invoking exp(|X|) may cause premature overflow.
-// Thus, we calculate sinh(X) as follows:
-// Y := |X|
-// sgn := sign(X)
-// sgnFact := sgn * 2**(16380)
-// Y' := Y - 16381 log2
-// sinh(X) := sgnFact * exp(Y').
-// Exit.
-//
-// 5. (|X| > 16480 log2) sinh(X) must overflow. Return
-// sign(X)*Huge*Huge to generate overflow and an infinity with
-// the appropriate sign. Huge is the largest finite number in
-// extended format. Exit.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//SSINH idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-T1: .long 0x40C62D38,0xD3D64634 // ... 16381 LOG2 LEAD
-T2: .long 0x3D6F90AE,0xB1E75CC7 // ... 16381 LOG2 TRAIL
-
- |xref t_frcinx
- |xref t_ovfl
- |xref t_extdnrm
- |xref setox
- |xref setoxm1
-
- .global ssinhd
-ssinhd:
-//--SINH(X) = X FOR DENORMALIZED X
-
- bra t_extdnrm
-
- .global ssinh
-ssinh:
- fmovex (%a0),%fp0 // ...LOAD INPUT
-
- movel (%a0),%d0
- movew 4(%a0),%d0
- movel %d0,%a1 // save a copy of original (compacted) operand
- andl #0x7FFFFFFF,%d0
- cmpl #0x400CB167,%d0
- bgts SINHBIG
-
-//--THIS IS THE USUAL CASE, |X| < 16380 LOG2
-//--Y = |X|, Z = EXPM1(Y), SINH(X) = SIGN(X)*(1/2)*( Z + Z/(1+Z) )
-
- fabsx %fp0 // ...Y = |X|
-
- moveml %a1/%d1,-(%sp)
- fmovemx %fp0-%fp0,(%a0)
- clrl %d1
- bsr setoxm1 // ...FP0 IS Z = EXPM1(Y)
- fmovel #0,%fpcr
- moveml (%sp)+,%a1/%d1
-
- fmovex %fp0,%fp1
- fadds #0x3F800000,%fp1 // ...1+Z
- fmovex %fp0,-(%sp)
- fdivx %fp1,%fp0 // ...Z/(1+Z)
- movel %a1,%d0
- andl #0x80000000,%d0
- orl #0x3F000000,%d0
- faddx (%sp)+,%fp0
- movel %d0,-(%sp)
-
- fmovel %d1,%fpcr
- fmuls (%sp)+,%fp0 //last fp inst - possible exceptions set
-
- bra t_frcinx
-
-SINHBIG:
- cmpl #0x400CB2B3,%d0
- bgt t_ovfl
- fabsx %fp0
- fsubd T1(%pc),%fp0 // ...(|X|-16381LOG2_LEAD)
- movel #0,-(%sp)
- movel #0x80000000,-(%sp)
- movel %a1,%d0
- andl #0x80000000,%d0
- orl #0x7FFB0000,%d0
- movel %d0,-(%sp) // ...EXTENDED FMT
- fsubd T2(%pc),%fp0 // ...|X| - 16381 LOG2, ACCURATE
-
- movel %d1,-(%sp)
- clrl %d1
- fmovemx %fp0-%fp0,(%a0)
- bsr setox
- fmovel (%sp)+,%fpcr
-
- fmulx (%sp)+,%fp0 //possible exception
- bra t_frcinx
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/stan.s b/c/src/lib/libcpu/m68k/m68040/fpsp/stan.s
deleted file mode 100644
index 6f698e63d9..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/stan.s
+++ /dev/null
@@ -1,457 +0,0 @@
-//
-// $Id$
-//
-// stan.sa 3.3 7/29/91
-//
-// The entry point stan computes the tangent of
-// an input argument;
-// stand does the same except for denormalized input.
-//
-// Input: Double-extended number X in location pointed to
-// by address register a0.
-//
-// Output: The value tan(X) returned in floating-point register Fp0.
-//
-// Accuracy and Monotonicity: The returned result is within 3 ulp in
-// 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-// result is subsequently rounded to double precision. The
-// result is provably monotonic in double precision.
-//
-// Speed: The program sTAN takes approximately 170 cycles for
-// input argument X such that |X| < 15Pi, which is the the usual
-// situation.
-//
-// Algorithm:
-//
-// 1. If |X| >= 15Pi or |X| < 2**(-40), go to 6.
-//
-// 2. Decompose X as X = N(Pi/2) + r where |r| <= Pi/4. Let
-// k = N mod 2, so in particular, k = 0 or 1.
-//
-// 3. If k is odd, go to 5.
-//
-// 4. (k is even) Tan(X) = tan(r) and tan(r) is approximated by a
-// rational function U/V where
-// U = r + r*s*(P1 + s*(P2 + s*P3)), and
-// V = 1 + s*(Q1 + s*(Q2 + s*(Q3 + s*Q4))), s = r*r.
-// Exit.
-//
-// 4. (k is odd) Tan(X) = -cot(r). Since tan(r) is approximated by a
-// rational function U/V where
-// U = r + r*s*(P1 + s*(P2 + s*P3)), and
-// V = 1 + s*(Q1 + s*(Q2 + s*(Q3 + s*Q4))), s = r*r,
-// -Cot(r) = -V/U. Exit.
-//
-// 6. If |X| > 1, go to 8.
-//
-// 7. (|X|<2**(-40)) Tan(X) = X. Exit.
-//
-// 8. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi, go back to 2.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//STAN idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
-BOUNDS1: .long 0x3FD78000,0x4004BC7E
-TWOBYPI: .long 0x3FE45F30,0x6DC9C883
-
-TANQ4: .long 0x3EA0B759,0xF50F8688
-TANP3: .long 0xBEF2BAA5,0xA8924F04
-
-TANQ3: .long 0xBF346F59,0xB39BA65F,0x00000000,0x00000000
-
-TANP2: .long 0x3FF60000,0xE073D3FC,0x199C4A00,0x00000000
-
-TANQ2: .long 0x3FF90000,0xD23CD684,0x15D95FA1,0x00000000
-
-TANP1: .long 0xBFFC0000,0x8895A6C5,0xFB423BCA,0x00000000
-
-TANQ1: .long 0xBFFD0000,0xEEF57E0D,0xA84BC8CE,0x00000000
-
-INVTWOPI: .long 0x3FFC0000,0xA2F9836E,0x4E44152A,0x00000000
-
-TWOPI1: .long 0x40010000,0xC90FDAA2,0x00000000,0x00000000
-TWOPI2: .long 0x3FDF0000,0x85A308D4,0x00000000,0x00000000
-
-//--N*PI/2, -32 <= N <= 32, IN A LEADING TERM IN EXT. AND TRAILING
-//--TERM IN SGL. NOTE THAT PI IS 64-BIT LONG, THUS N*PI/2 IS AT
-//--MOST 69 BITS LONG.
- .global PITBL
-PITBL:
- .long 0xC0040000,0xC90FDAA2,0x2168C235,0x21800000
- .long 0xC0040000,0xC2C75BCD,0x105D7C23,0xA0D00000
- .long 0xC0040000,0xBC7EDCF7,0xFF523611,0xA1E80000
- .long 0xC0040000,0xB6365E22,0xEE46F000,0x21480000
- .long 0xC0040000,0xAFEDDF4D,0xDD3BA9EE,0xA1200000
- .long 0xC0040000,0xA9A56078,0xCC3063DD,0x21FC0000
- .long 0xC0040000,0xA35CE1A3,0xBB251DCB,0x21100000
- .long 0xC0040000,0x9D1462CE,0xAA19D7B9,0xA1580000
- .long 0xC0040000,0x96CBE3F9,0x990E91A8,0x21E00000
- .long 0xC0040000,0x90836524,0x88034B96,0x20B00000
- .long 0xC0040000,0x8A3AE64F,0x76F80584,0xA1880000
- .long 0xC0040000,0x83F2677A,0x65ECBF73,0x21C40000
- .long 0xC0030000,0xFB53D14A,0xA9C2F2C2,0x20000000
- .long 0xC0030000,0xEEC2D3A0,0x87AC669F,0x21380000
- .long 0xC0030000,0xE231D5F6,0x6595DA7B,0xA1300000
- .long 0xC0030000,0xD5A0D84C,0x437F4E58,0x9FC00000
- .long 0xC0030000,0xC90FDAA2,0x2168C235,0x21000000
- .long 0xC0030000,0xBC7EDCF7,0xFF523611,0xA1680000
- .long 0xC0030000,0xAFEDDF4D,0xDD3BA9EE,0xA0A00000
- .long 0xC0030000,0xA35CE1A3,0xBB251DCB,0x20900000
- .long 0xC0030000,0x96CBE3F9,0x990E91A8,0x21600000
- .long 0xC0030000,0x8A3AE64F,0x76F80584,0xA1080000
- .long 0xC0020000,0xFB53D14A,0xA9C2F2C2,0x1F800000
- .long 0xC0020000,0xE231D5F6,0x6595DA7B,0xA0B00000
- .long 0xC0020000,0xC90FDAA2,0x2168C235,0x20800000
- .long 0xC0020000,0xAFEDDF4D,0xDD3BA9EE,0xA0200000
- .long 0xC0020000,0x96CBE3F9,0x990E91A8,0x20E00000
- .long 0xC0010000,0xFB53D14A,0xA9C2F2C2,0x1F000000
- .long 0xC0010000,0xC90FDAA2,0x2168C235,0x20000000
- .long 0xC0010000,0x96CBE3F9,0x990E91A8,0x20600000
- .long 0xC0000000,0xC90FDAA2,0x2168C235,0x1F800000
- .long 0xBFFF0000,0xC90FDAA2,0x2168C235,0x1F000000
- .long 0x00000000,0x00000000,0x00000000,0x00000000
- .long 0x3FFF0000,0xC90FDAA2,0x2168C235,0x9F000000
- .long 0x40000000,0xC90FDAA2,0x2168C235,0x9F800000
- .long 0x40010000,0x96CBE3F9,0x990E91A8,0xA0600000
- .long 0x40010000,0xC90FDAA2,0x2168C235,0xA0000000
- .long 0x40010000,0xFB53D14A,0xA9C2F2C2,0x9F000000
- .long 0x40020000,0x96CBE3F9,0x990E91A8,0xA0E00000
- .long 0x40020000,0xAFEDDF4D,0xDD3BA9EE,0x20200000
- .long 0x40020000,0xC90FDAA2,0x2168C235,0xA0800000
- .long 0x40020000,0xE231D5F6,0x6595DA7B,0x20B00000
- .long 0x40020000,0xFB53D14A,0xA9C2F2C2,0x9F800000
- .long 0x40030000,0x8A3AE64F,0x76F80584,0x21080000
- .long 0x40030000,0x96CBE3F9,0x990E91A8,0xA1600000
- .long 0x40030000,0xA35CE1A3,0xBB251DCB,0xA0900000
- .long 0x40030000,0xAFEDDF4D,0xDD3BA9EE,0x20A00000
- .long 0x40030000,0xBC7EDCF7,0xFF523611,0x21680000
- .long 0x40030000,0xC90FDAA2,0x2168C235,0xA1000000
- .long 0x40030000,0xD5A0D84C,0x437F4E58,0x1FC00000
- .long 0x40030000,0xE231D5F6,0x6595DA7B,0x21300000
- .long 0x40030000,0xEEC2D3A0,0x87AC669F,0xA1380000
- .long 0x40030000,0xFB53D14A,0xA9C2F2C2,0xA0000000
- .long 0x40040000,0x83F2677A,0x65ECBF73,0xA1C40000
- .long 0x40040000,0x8A3AE64F,0x76F80584,0x21880000
- .long 0x40040000,0x90836524,0x88034B96,0xA0B00000
- .long 0x40040000,0x96CBE3F9,0x990E91A8,0xA1E00000
- .long 0x40040000,0x9D1462CE,0xAA19D7B9,0x21580000
- .long 0x40040000,0xA35CE1A3,0xBB251DCB,0xA1100000
- .long 0x40040000,0xA9A56078,0xCC3063DD,0xA1FC0000
- .long 0x40040000,0xAFEDDF4D,0xDD3BA9EE,0x21200000
- .long 0x40040000,0xB6365E22,0xEE46F000,0xA1480000
- .long 0x40040000,0xBC7EDCF7,0xFF523611,0x21E80000
- .long 0x40040000,0xC2C75BCD,0x105D7C23,0x20D00000
- .long 0x40040000,0xC90FDAA2,0x2168C235,0xA1800000
-
- .set INARG,FP_SCR4
-
- .set TWOTO63,L_SCR1
- .set ENDFLAG,L_SCR2
- .set N,L_SCR3
-
- | xref t_frcinx
- |xref t_extdnrm
-
- .global stand
-stand:
-//--TAN(X) = X FOR DENORMALIZED X
-
- bra t_extdnrm
-
- .global stan
-stan:
- fmovex (%a0),%fp0 // ...LOAD INPUT
-
- movel (%a0),%d0
- movew 4(%a0),%d0
- andil #0x7FFFFFFF,%d0
-
- cmpil #0x3FD78000,%d0 // ...|X| >= 2**(-40)?
- bges TANOK1
- bra TANSM
-TANOK1:
- cmpil #0x4004BC7E,%d0 // ...|X| < 15 PI?
- blts TANMAIN
- bra REDUCEX
-
-
-TANMAIN:
-//--THIS IS THE USUAL CASE, |X| <= 15 PI.
-//--THE ARGUMENT REDUCTION IS DONE BY TABLE LOOK UP.
- fmovex %fp0,%fp1
- fmuld TWOBYPI,%fp1 // ...X*2/PI
-
-//--HIDE THE NEXT TWO INSTRUCTIONS
- leal PITBL+0x200,%a1 // ...TABLE OF N*PI/2, N = -32,...,32
-
-//--FP1 IS NOW READY
- fmovel %fp1,%d0 // ...CONVERT TO INTEGER
-
- asll #4,%d0
- addal %d0,%a1 // ...ADDRESS N*PIBY2 IN Y1, Y2
-
- fsubx (%a1)+,%fp0 // ...X-Y1
-//--HIDE THE NEXT ONE
-
- fsubs (%a1),%fp0 // ...FP0 IS R = (X-Y1)-Y2
-
- rorl #5,%d0
- andil #0x80000000,%d0 // ...D0 WAS ODD IFF D0 < 0
-
-TANCONT:
-
- cmpil #0,%d0
- blt NODD
-
- fmovex %fp0,%fp1
- fmulx %fp1,%fp1 // ...S = R*R
-
- fmoved TANQ4,%fp3
- fmoved TANP3,%fp2
-
- fmulx %fp1,%fp3 // ...SQ4
- fmulx %fp1,%fp2 // ...SP3
-
- faddd TANQ3,%fp3 // ...Q3+SQ4
- faddx TANP2,%fp2 // ...P2+SP3
-
- fmulx %fp1,%fp3 // ...S(Q3+SQ4)
- fmulx %fp1,%fp2 // ...S(P2+SP3)
-
- faddx TANQ2,%fp3 // ...Q2+S(Q3+SQ4)
- faddx TANP1,%fp2 // ...P1+S(P2+SP3)
-
- fmulx %fp1,%fp3 // ...S(Q2+S(Q3+SQ4))
- fmulx %fp1,%fp2 // ...S(P1+S(P2+SP3))
-
- faddx TANQ1,%fp3 // ...Q1+S(Q2+S(Q3+SQ4))
- fmulx %fp0,%fp2 // ...RS(P1+S(P2+SP3))
-
- fmulx %fp3,%fp1 // ...S(Q1+S(Q2+S(Q3+SQ4)))
-
-
- faddx %fp2,%fp0 // ...R+RS(P1+S(P2+SP3))
-
-
- fadds #0x3F800000,%fp1 // ...1+S(Q1+...)
-
- fmovel %d1,%fpcr //restore users exceptions
- fdivx %fp1,%fp0 //last inst - possible exception set
-
- bra t_frcinx
-
-NODD:
- fmovex %fp0,%fp1
- fmulx %fp0,%fp0 // ...S = R*R
-
- fmoved TANQ4,%fp3
- fmoved TANP3,%fp2
-
- fmulx %fp0,%fp3 // ...SQ4
- fmulx %fp0,%fp2 // ...SP3
-
- faddd TANQ3,%fp3 // ...Q3+SQ4
- faddx TANP2,%fp2 // ...P2+SP3
-
- fmulx %fp0,%fp3 // ...S(Q3+SQ4)
- fmulx %fp0,%fp2 // ...S(P2+SP3)
-
- faddx TANQ2,%fp3 // ...Q2+S(Q3+SQ4)
- faddx TANP1,%fp2 // ...P1+S(P2+SP3)
-
- fmulx %fp0,%fp3 // ...S(Q2+S(Q3+SQ4))
- fmulx %fp0,%fp2 // ...S(P1+S(P2+SP3))
-
- faddx TANQ1,%fp3 // ...Q1+S(Q2+S(Q3+SQ4))
- fmulx %fp1,%fp2 // ...RS(P1+S(P2+SP3))
-
- fmulx %fp3,%fp0 // ...S(Q1+S(Q2+S(Q3+SQ4)))
-
-
- faddx %fp2,%fp1 // ...R+RS(P1+S(P2+SP3))
- fadds #0x3F800000,%fp0 // ...1+S(Q1+...)
-
-
- fmovex %fp1,-(%sp)
- eoril #0x80000000,(%sp)
-
- fmovel %d1,%fpcr //restore users exceptions
- fdivx (%sp)+,%fp0 //last inst - possible exception set
-
- bra t_frcinx
-
-TANBORS:
-//--IF |X| > 15PI, WE USE THE GENERAL ARGUMENT REDUCTION.
-//--IF |X| < 2**(-40), RETURN X OR 1.
- cmpil #0x3FFF8000,%d0
- bgts REDUCEX
-
-TANSM:
-
- fmovex %fp0,-(%sp)
- fmovel %d1,%fpcr //restore users exceptions
- fmovex (%sp)+,%fp0 //last inst - possible exception set
-
- bra t_frcinx
-
-
-REDUCEX:
-//--WHEN REDUCEX IS USED, THE CODE WILL INEVITABLY BE SLOW.
-//--THIS REDUCTION METHOD, HOWEVER, IS MUCH FASTER THAN USING
-//--THE REMAINDER INSTRUCTION WHICH IS NOW IN SOFTWARE.
-
- fmovemx %fp2-%fp5,-(%a7) // ...save FP2 through FP5
- movel %d2,-(%a7)
- fmoves #0x00000000,%fp1
-
-//--If compact form of abs(arg) in d0=$7ffeffff, argument is so large that
-//--there is a danger of unwanted overflow in first LOOP iteration. In this
-//--case, reduce argument by one remainder step to make subsequent reduction
-//--safe.
- cmpil #0x7ffeffff,%d0 //is argument dangerously large?
- bnes LOOP
- movel #0x7ffe0000,FP_SCR2(%a6) //yes
-// ;create 2**16383*PI/2
- movel #0xc90fdaa2,FP_SCR2+4(%a6)
- clrl FP_SCR2+8(%a6)
- ftstx %fp0 //test sign of argument
- movel #0x7fdc0000,FP_SCR3(%a6) //create low half of 2**16383*
-// ;PI/2 at FP_SCR3
- movel #0x85a308d3,FP_SCR3+4(%a6)
- clrl FP_SCR3+8(%a6)
- fblt red_neg
- orw #0x8000,FP_SCR2(%a6) //positive arg
- orw #0x8000,FP_SCR3(%a6)
-red_neg:
- faddx FP_SCR2(%a6),%fp0 //high part of reduction is exact
- fmovex %fp0,%fp1 //save high result in fp1
- faddx FP_SCR3(%a6),%fp0 //low part of reduction
- fsubx %fp0,%fp1 //determine low component of result
- faddx FP_SCR3(%a6),%fp1 //fp0/fp1 are reduced argument.
-
-//--ON ENTRY, FP0 IS X, ON RETURN, FP0 IS X REM PI/2, |X| <= PI/4.
-//--integer quotient will be stored in N
-//--Intermediate remainder is 66-bit long; (R,r) in (FP0,FP1)
-
-LOOP:
- fmovex %fp0,INARG(%a6) // ...+-2**K * F, 1 <= F < 2
- movew INARG(%a6),%d0
- movel %d0,%a1 // ...save a copy of D0
- andil #0x00007FFF,%d0
- subil #0x00003FFF,%d0 // ...D0 IS K
- cmpil #28,%d0
- bles LASTLOOP
-CONTLOOP:
- subil #27,%d0 // ...D0 IS L := K-27
- movel #0,ENDFLAG(%a6)
- bras WORK
-LASTLOOP:
- clrl %d0 // ...D0 IS L := 0
- movel #1,ENDFLAG(%a6)
-
-WORK:
-//--FIND THE REMAINDER OF (R,r) W.R.T. 2**L * (PI/2). L IS SO CHOSEN
-//--THAT INT( X * (2/PI) / 2**(L) ) < 2**29.
-
-//--CREATE 2**(-L) * (2/PI), SIGN(INARG)*2**(63),
-//--2**L * (PIby2_1), 2**L * (PIby2_2)
-
- movel #0x00003FFE,%d2 // ...BIASED EXPO OF 2/PI
- subl %d0,%d2 // ...BIASED EXPO OF 2**(-L)*(2/PI)
-
- movel #0xA2F9836E,FP_SCR1+4(%a6)
- movel #0x4E44152A,FP_SCR1+8(%a6)
- movew %d2,FP_SCR1(%a6) // ...FP_SCR1 is 2**(-L)*(2/PI)
-
- fmovex %fp0,%fp2
- fmulx FP_SCR1(%a6),%fp2
-//--WE MUST NOW FIND INT(FP2). SINCE WE NEED THIS VALUE IN
-//--FLOATING POINT FORMAT, THE TWO FMOVE'S FMOVE.L FP <--> N
-//--WILL BE TOO INEFFICIENT. THE WAY AROUND IT IS THAT
-//--(SIGN(INARG)*2**63 + FP2) - SIGN(INARG)*2**63 WILL GIVE
-//--US THE DESIRED VALUE IN FLOATING POINT.
-
-//--HIDE SIX CYCLES OF INSTRUCTION
- movel %a1,%d2
- swap %d2
- andil #0x80000000,%d2
- oril #0x5F000000,%d2 // ...D2 IS SIGN(INARG)*2**63 IN SGL
- movel %d2,TWOTO63(%a6)
-
- movel %d0,%d2
- addil #0x00003FFF,%d2 // ...BIASED EXPO OF 2**L * (PI/2)
-
-//--FP2 IS READY
- fadds TWOTO63(%a6),%fp2 // ...THE FRACTIONAL PART OF FP1 IS ROUNDED
-
-//--HIDE 4 CYCLES OF INSTRUCTION; creating 2**(L)*Piby2_1 and 2**(L)*Piby2_2
- movew %d2,FP_SCR2(%a6)
- clrw FP_SCR2+2(%a6)
- movel #0xC90FDAA2,FP_SCR2+4(%a6)
- clrl FP_SCR2+8(%a6) // ...FP_SCR2 is 2**(L) * Piby2_1
-
-//--FP2 IS READY
- fsubs TWOTO63(%a6),%fp2 // ...FP2 is N
-
- addil #0x00003FDD,%d0
- movew %d0,FP_SCR3(%a6)
- clrw FP_SCR3+2(%a6)
- movel #0x85A308D3,FP_SCR3+4(%a6)
- clrl FP_SCR3+8(%a6) // ...FP_SCR3 is 2**(L) * Piby2_2
-
- movel ENDFLAG(%a6),%d0
-
-//--We are now ready to perform (R+r) - N*P1 - N*P2, P1 = 2**(L) * Piby2_1 and
-//--P2 = 2**(L) * Piby2_2
- fmovex %fp2,%fp4
- fmulx FP_SCR2(%a6),%fp4 // ...W = N*P1
- fmovex %fp2,%fp5
- fmulx FP_SCR3(%a6),%fp5 // ...w = N*P2
- fmovex %fp4,%fp3
-//--we want P+p = W+w but |p| <= half ulp of P
-//--Then, we need to compute A := R-P and a := r-p
- faddx %fp5,%fp3 // ...FP3 is P
- fsubx %fp3,%fp4 // ...W-P
-
- fsubx %fp3,%fp0 // ...FP0 is A := R - P
- faddx %fp5,%fp4 // ...FP4 is p = (W-P)+w
-
- fmovex %fp0,%fp3 // ...FP3 A
- fsubx %fp4,%fp1 // ...FP1 is a := r - p
-
-//--Now we need to normalize (A,a) to "new (R,r)" where R+r = A+a but
-//--|r| <= half ulp of R.
- faddx %fp1,%fp0 // ...FP0 is R := A+a
-//--No need to calculate r if this is the last loop
- cmpil #0,%d0
- bgt RESTORE
-
-//--Need to calculate r
- fsubx %fp0,%fp3 // ...A-R
- faddx %fp3,%fp1 // ...FP1 is r := (A-R)+a
- bra LOOP
-
-RESTORE:
- fmovel %fp2,N(%a6)
- movel (%a7)+,%d2
- fmovemx (%a7)+,%fp2-%fp5
-
-
- movel N(%a6),%d0
- rorl #1,%d0
-
-
- bra TANCONT
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/stanh.s b/c/src/lib/libcpu/m68k/m68040/fpsp/stanh.s
deleted file mode 100644
index b3c591ac96..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/stanh.s
+++ /dev/null
@@ -1,187 +0,0 @@
-//
-// $Id$
-//
-// stanh.sa 3.1 12/10/90
-//
-// The entry point sTanh computes the hyperbolic tangent of
-// an input argument; sTanhd does the same except for denormalized
-// input.
-//
-// Input: Double-extended number X in location pointed to
-// by address register a0.
-//
-// Output: The value tanh(X) returned in floating-point register Fp0.
-//
-// Accuracy and Monotonicity: The returned result is within 3 ulps in
-// 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-// result is subsequently rounded to double precision. The
-// result is provably monotonic in double precision.
-//
-// Speed: The program stanh takes approximately 270 cycles.
-//
-// Algorithm:
-//
-// TANH
-// 1. If |X| >= (5/2) log2 or |X| <= 2**(-40), go to 3.
-//
-// 2. (2**(-40) < |X| < (5/2) log2) Calculate tanh(X) by
-// sgn := sign(X), y := 2|X|, z := expm1(Y), and
-// tanh(X) = sgn*( z/(2+z) ).
-// Exit.
-//
-// 3. (|X| <= 2**(-40) or |X| >= (5/2) log2). If |X| < 1,
-// go to 7.
-//
-// 4. (|X| >= (5/2) log2) If |X| >= 50 log2, go to 6.
-//
-// 5. ((5/2) log2 <= |X| < 50 log2) Calculate tanh(X) by
-// sgn := sign(X), y := 2|X|, z := exp(Y),
-// tanh(X) = sgn - [ sgn*2/(1+z) ].
-// Exit.
-//
-// 6. (|X| >= 50 log2) Tanh(X) = +-1 (round to nearest). Thus, we
-// calculate Tanh(X) by
-// sgn := sign(X), Tiny := 2**(-126),
-// tanh(X) := sgn - sgn*Tiny.
-// Exit.
-//
-// 7. (|X| < 2**(-40)). Tanh(X) = X. Exit.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//STANH idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- .set X,FP_SCR5
- .set XDCARE,X+2
- .set XFRAC,X+4
-
- .set SGN,L_SCR3
-
- .set V,FP_SCR6
-
-BOUNDS1: .long 0x3FD78000,0x3FFFDDCE // ... 2^(-40), (5/2)LOG2
-
- |xref t_frcinx
- |xref t_extdnrm
- |xref setox
- |xref setoxm1
-
- .global stanhd
-stanhd:
-//--TANH(X) = X FOR DENORMALIZED X
-
- bra t_extdnrm
-
- .global stanh
-stanh:
- fmovex (%a0),%fp0 // ...LOAD INPUT
-
- fmovex %fp0,X(%a6)
- movel (%a0),%d0
- movew 4(%a0),%d0
- movel %d0,X(%a6)
- andl #0x7FFFFFFF,%d0
- cmp2l BOUNDS1(%pc),%d0 // ...2**(-40) < |X| < (5/2)LOG2 ?
- bcss TANHBORS
-
-//--THIS IS THE USUAL CASE
-//--Y = 2|X|, Z = EXPM1(Y), TANH(X) = SIGN(X) * Z / (Z+2).
-
- movel X(%a6),%d0
- movel %d0,SGN(%a6)
- andl #0x7FFF0000,%d0
- addl #0x00010000,%d0 // ...EXPONENT OF 2|X|
- movel %d0,X(%a6)
- andl #0x80000000,SGN(%a6)
- fmovex X(%a6),%fp0 // ...FP0 IS Y = 2|X|
-
- movel %d1,-(%a7)
- clrl %d1
- fmovemx %fp0-%fp0,(%a0)
- bsr setoxm1 // ...FP0 IS Z = EXPM1(Y)
- movel (%a7)+,%d1
-
- fmovex %fp0,%fp1
- fadds #0x40000000,%fp1 // ...Z+2
- movel SGN(%a6),%d0
- fmovex %fp1,V(%a6)
- eorl %d0,V(%a6)
-
- fmovel %d1,%FPCR //restore users exceptions
- fdivx V(%a6),%fp0
- bra t_frcinx
-
-TANHBORS:
- cmpl #0x3FFF8000,%d0
- blt TANHSM
-
- cmpl #0x40048AA1,%d0
- bgt TANHHUGE
-
-//-- (5/2) LOG2 < |X| < 50 LOG2,
-//--TANH(X) = 1 - (2/[EXP(2X)+1]). LET Y = 2|X|, SGN = SIGN(X),
-//--TANH(X) = SGN - SGN*2/[EXP(Y)+1].
-
- movel X(%a6),%d0
- movel %d0,SGN(%a6)
- andl #0x7FFF0000,%d0
- addl #0x00010000,%d0 // ...EXPO OF 2|X|
- movel %d0,X(%a6) // ...Y = 2|X|
- andl #0x80000000,SGN(%a6)
- movel SGN(%a6),%d0
- fmovex X(%a6),%fp0 // ...Y = 2|X|
-
- movel %d1,-(%a7)
- clrl %d1
- fmovemx %fp0-%fp0,(%a0)
- bsr setox // ...FP0 IS EXP(Y)
- movel (%a7)+,%d1
- movel SGN(%a6),%d0
- fadds #0x3F800000,%fp0 // ...EXP(Y)+1
-
- eorl #0xC0000000,%d0 // ...-SIGN(X)*2
- fmoves %d0,%fp1 // ...-SIGN(X)*2 IN SGL FMT
- fdivx %fp0,%fp1 // ...-SIGN(X)2 / [EXP(Y)+1 ]
-
- movel SGN(%a6),%d0
- orl #0x3F800000,%d0 // ...SGN
- fmoves %d0,%fp0 // ...SGN IN SGL FMT
-
- fmovel %d1,%FPCR //restore users exceptions
- faddx %fp1,%fp0
-
- bra t_frcinx
-
-TANHSM:
- movew #0x0000,XDCARE(%a6)
-
- fmovel %d1,%FPCR //restore users exceptions
- fmovex X(%a6),%fp0 //last inst - possible exception set
-
- bra t_frcinx
-
-TANHHUGE:
-//---RETURN SGN(X) - SGN(X)EPS
- movel X(%a6),%d0
- andl #0x80000000,%d0
- orl #0x3F800000,%d0
- fmoves %d0,%fp0
- andl #0x80000000,%d0
- eorl #0x80800000,%d0 // ...-SIGN(X)*EPS
-
- fmovel %d1,%FPCR //restore users exceptions
- fadds %d0,%fp0
-
- bra t_frcinx
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/sto_res.s b/c/src/lib/libcpu/m68k/m68040/fpsp/sto_res.s
deleted file mode 100644
index a5b6543914..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/sto_res.s
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// $Id$
-//
-// sto_res.sa 3.1 12/10/90
-//
-// Takes the result and puts it in where the user expects it.
-// Library functions return result in fp0. If fp0 is not the
-// users destination register then fp0 is moved to the the
-// correct floating-point destination register. fp0 and fp1
-// are then restored to the original contents.
-//
-// Input: result in fp0,fp1
-//
-// d2 & a0 should be kept unmodified
-//
-// Output: moves the result to the true destination reg or mem
-//
-// Modifies: destination floating point register
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-STO_RES: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
-
- |section 8
-
-#include "fpsp.defs"
-
- .global sto_cos
-sto_cos:
- bfextu CMDREG1B(%a6){#13:#3},%d0 //extract cos destination
- cmpib #3,%d0 //check for fp0/fp1 cases
- bles c_fp0123
- fmovemx %fp1-%fp1,-(%a7)
- moveql #7,%d1
- subl %d0,%d1 //d1 = 7- (dest. reg. no.)
- clrl %d0
- bsetl %d1,%d0 //d0 is dynamic register mask
- fmovemx (%a7)+,%d0
- rts
-c_fp0123:
- cmpib #0,%d0
- beqs c_is_fp0
- cmpib #1,%d0
- beqs c_is_fp1
- cmpib #2,%d0
- beqs c_is_fp2
-c_is_fp3:
- fmovemx %fp1-%fp1,USER_FP3(%a6)
- rts
-c_is_fp2:
- fmovemx %fp1-%fp1,USER_FP2(%a6)
- rts
-c_is_fp1:
- fmovemx %fp1-%fp1,USER_FP1(%a6)
- rts
-c_is_fp0:
- fmovemx %fp1-%fp1,USER_FP0(%a6)
- rts
-
-
- .global sto_res
-sto_res:
- bfextu CMDREG1B(%a6){#6:#3},%d0 //extract destination register
- cmpib #3,%d0 //check for fp0/fp1 cases
- bles fp0123
- fmovemx %fp0-%fp0,-(%a7)
- moveql #7,%d1
- subl %d0,%d1 //d1 = 7- (dest. reg. no.)
- clrl %d0
- bsetl %d1,%d0 //d0 is dynamic register mask
- fmovemx (%a7)+,%d0
- rts
-fp0123:
- cmpib #0,%d0
- beqs is_fp0
- cmpib #1,%d0
- beqs is_fp1
- cmpib #2,%d0
- beqs is_fp2
-is_fp3:
- fmovemx %fp0-%fp0,USER_FP3(%a6)
- rts
-is_fp2:
- fmovemx %fp0-%fp0,USER_FP2(%a6)
- rts
-is_fp1:
- fmovemx %fp0-%fp0,USER_FP1(%a6)
- rts
-is_fp0:
- fmovemx %fp0-%fp0,USER_FP0(%a6)
- rts
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/stwotox.s b/c/src/lib/libcpu/m68k/m68040/fpsp/stwotox.s
deleted file mode 100644
index 45f2ad52f7..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/stwotox.s
+++ /dev/null
@@ -1,429 +0,0 @@
-//
-// $Id$
-//
-// stwotox.sa 3.1 12/10/90
-//
-// stwotox --- 2**X
-// stwotoxd --- 2**X for denormalized X
-// stentox --- 10**X
-// stentoxd --- 10**X for denormalized X
-//
-// Input: Double-extended number X in location pointed to
-// by address register a0.
-//
-// Output: The function values are returned in Fp0.
-//
-// Accuracy and Monotonicity: The returned result is within 2 ulps in
-// 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-// result is subsequently rounded to double precision. The
-// result is provably monotonic in double precision.
-//
-// Speed: The program stwotox takes approximately 190 cycles and the
-// program stentox takes approximately 200 cycles.
-//
-// Algorithm:
-//
-// twotox
-// 1. If |X| > 16480, go to ExpBig.
-//
-// 2. If |X| < 2**(-70), go to ExpSm.
-//
-// 3. Decompose X as X = N/64 + r where |r| <= 1/128. Furthermore
-// decompose N as
-// N = 64(M + M') + j, j = 0,1,2,...,63.
-//
-// 4. Overwrite r := r * log2. Then
-// 2**X = 2**(M') * 2**(M) * 2**(j/64) * exp(r).
-// Go to expr to compute that expression.
-//
-// tentox
-// 1. If |X| > 16480*log_10(2) (base 10 log of 2), go to ExpBig.
-//
-// 2. If |X| < 2**(-70), go to ExpSm.
-//
-// 3. Set y := X*log_2(10)*64 (base 2 log of 10). Set
-// N := round-to-int(y). Decompose N as
-// N = 64(M + M') + j, j = 0,1,2,...,63.
-//
-// 4. Define r as
-// r := ((X - N*L1)-N*L2) * L10
-// where L1, L2 are the leading and trailing parts of log_10(2)/64
-// and L10 is the natural log of 10. Then
-// 10**X = 2**(M') * 2**(M) * 2**(j/64) * exp(r).
-// Go to expr to compute that expression.
-//
-// expr
-// 1. Fetch 2**(j/64) from table as Fact1 and Fact2.
-//
-// 2. Overwrite Fact1 and Fact2 by
-// Fact1 := 2**(M) * Fact1
-// Fact2 := 2**(M) * Fact2
-// Thus Fact1 + Fact2 = 2**(M) * 2**(j/64).
-//
-// 3. Calculate P where 1 + P approximates exp(r):
-// P = r + r*r*(A1+r*(A2+...+r*A5)).
-//
-// 4. Let AdjFact := 2**(M'). Return
-// AdjFact * ( Fact1 + ((Fact1*P) + Fact2) ).
-// Exit.
-//
-// ExpBig
-// 1. Generate overflow by Huge * Huge if X > 0; otherwise, generate
-// underflow by Tiny * Tiny.
-//
-// ExpSm
-// 1. Return 1 + X.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//STWOTOX idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
-BOUNDS1: .long 0x3FB98000,0x400D80C0 // ... 2^(-70),16480
-BOUNDS2: .long 0x3FB98000,0x400B9B07 // ... 2^(-70),16480 LOG2/LOG10
-
-L2TEN64: .long 0x406A934F,0x0979A371 // ... 64LOG10/LOG2
-L10TWO1: .long 0x3F734413,0x509F8000 // ... LOG2/64LOG10
-
-L10TWO2: .long 0xBFCD0000,0xC0219DC1,0xDA994FD2,0x00000000
-
-LOG10: .long 0x40000000,0x935D8DDD,0xAAA8AC17,0x00000000
-
-LOG2: .long 0x3FFE0000,0xB17217F7,0xD1CF79AC,0x00000000
-
-EXPA5: .long 0x3F56C16D,0x6F7BD0B2
-EXPA4: .long 0x3F811112,0x302C712C
-EXPA3: .long 0x3FA55555,0x55554CC1
-EXPA2: .long 0x3FC55555,0x55554A54
-EXPA1: .long 0x3FE00000,0x00000000,0x00000000,0x00000000
-
-HUGE: .long 0x7FFE0000,0xFFFFFFFF,0xFFFFFFFF,0x00000000
-TINY: .long 0x00010000,0xFFFFFFFF,0xFFFFFFFF,0x00000000
-
-EXPTBL:
- .long 0x3FFF0000,0x80000000,0x00000000,0x3F738000
- .long 0x3FFF0000,0x8164D1F3,0xBC030773,0x3FBEF7CA
- .long 0x3FFF0000,0x82CD8698,0xAC2BA1D7,0x3FBDF8A9
- .long 0x3FFF0000,0x843A28C3,0xACDE4046,0x3FBCD7C9
- .long 0x3FFF0000,0x85AAC367,0xCC487B15,0xBFBDE8DA
- .long 0x3FFF0000,0x871F6196,0x9E8D1010,0x3FBDE85C
- .long 0x3FFF0000,0x88980E80,0x92DA8527,0x3FBEBBF1
- .long 0x3FFF0000,0x8A14D575,0x496EFD9A,0x3FBB80CA
- .long 0x3FFF0000,0x8B95C1E3,0xEA8BD6E7,0xBFBA8373
- .long 0x3FFF0000,0x8D1ADF5B,0x7E5BA9E6,0xBFBE9670
- .long 0x3FFF0000,0x8EA4398B,0x45CD53C0,0x3FBDB700
- .long 0x3FFF0000,0x9031DC43,0x1466B1DC,0x3FBEEEB0
- .long 0x3FFF0000,0x91C3D373,0xAB11C336,0x3FBBFD6D
- .long 0x3FFF0000,0x935A2B2F,0x13E6E92C,0xBFBDB319
- .long 0x3FFF0000,0x94F4EFA8,0xFEF70961,0x3FBDBA2B
- .long 0x3FFF0000,0x96942D37,0x20185A00,0x3FBE91D5
- .long 0x3FFF0000,0x9837F051,0x8DB8A96F,0x3FBE8D5A
- .long 0x3FFF0000,0x99E04593,0x20B7FA65,0xBFBCDE7B
- .long 0x3FFF0000,0x9B8D39B9,0xD54E5539,0xBFBEBAAF
- .long 0x3FFF0000,0x9D3ED9A7,0x2CFFB751,0xBFBD86DA
- .long 0x3FFF0000,0x9EF53260,0x91A111AE,0xBFBEBEDD
- .long 0x3FFF0000,0xA0B0510F,0xB9714FC2,0x3FBCC96E
- .long 0x3FFF0000,0xA2704303,0x0C496819,0xBFBEC90B
- .long 0x3FFF0000,0xA43515AE,0x09E6809E,0x3FBBD1DB
- .long 0x3FFF0000,0xA5FED6A9,0xB15138EA,0x3FBCE5EB
- .long 0x3FFF0000,0xA7CD93B4,0xE965356A,0xBFBEC274
- .long 0x3FFF0000,0xA9A15AB4,0xEA7C0EF8,0x3FBEA83C
- .long 0x3FFF0000,0xAB7A39B5,0xA93ED337,0x3FBECB00
- .long 0x3FFF0000,0xAD583EEA,0x42A14AC6,0x3FBE9301
- .long 0x3FFF0000,0xAF3B78AD,0x690A4375,0xBFBD8367
- .long 0x3FFF0000,0xB123F581,0xD2AC2590,0xBFBEF05F
- .long 0x3FFF0000,0xB311C412,0xA9112489,0x3FBDFB3C
- .long 0x3FFF0000,0xB504F333,0xF9DE6484,0x3FBEB2FB
- .long 0x3FFF0000,0xB6FD91E3,0x28D17791,0x3FBAE2CB
- .long 0x3FFF0000,0xB8FBAF47,0x62FB9EE9,0x3FBCDC3C
- .long 0x3FFF0000,0xBAFF5AB2,0x133E45FB,0x3FBEE9AA
- .long 0x3FFF0000,0xBD08A39F,0x580C36BF,0xBFBEAEFD
- .long 0x3FFF0000,0xBF1799B6,0x7A731083,0xBFBCBF51
- .long 0x3FFF0000,0xC12C4CCA,0x66709456,0x3FBEF88A
- .long 0x3FFF0000,0xC346CCDA,0x24976407,0x3FBD83B2
- .long 0x3FFF0000,0xC5672A11,0x5506DADD,0x3FBDF8AB
- .long 0x3FFF0000,0xC78D74C8,0xABB9B15D,0xBFBDFB17
- .long 0x3FFF0000,0xC9B9BD86,0x6E2F27A3,0xBFBEFE3C
- .long 0x3FFF0000,0xCBEC14FE,0xF2727C5D,0xBFBBB6F8
- .long 0x3FFF0000,0xCE248C15,0x1F8480E4,0xBFBCEE53
- .long 0x3FFF0000,0xD06333DA,0xEF2B2595,0xBFBDA4AE
- .long 0x3FFF0000,0xD2A81D91,0xF12AE45A,0x3FBC9124
- .long 0x3FFF0000,0xD4F35AAB,0xCFEDFA1F,0x3FBEB243
- .long 0x3FFF0000,0xD744FCCA,0xD69D6AF4,0x3FBDE69A
- .long 0x3FFF0000,0xD99D15C2,0x78AFD7B6,0xBFB8BC61
- .long 0x3FFF0000,0xDBFBB797,0xDAF23755,0x3FBDF610
- .long 0x3FFF0000,0xDE60F482,0x5E0E9124,0xBFBD8BE1
- .long 0x3FFF0000,0xE0CCDEEC,0x2A94E111,0x3FBACB12
- .long 0x3FFF0000,0xE33F8972,0xBE8A5A51,0x3FBB9BFE
- .long 0x3FFF0000,0xE5B906E7,0x7C8348A8,0x3FBCF2F4
- .long 0x3FFF0000,0xE8396A50,0x3C4BDC68,0x3FBEF22F
- .long 0x3FFF0000,0xEAC0C6E7,0xDD24392F,0xBFBDBF4A
- .long 0x3FFF0000,0xED4F301E,0xD9942B84,0x3FBEC01A
- .long 0x3FFF0000,0xEFE4B99B,0xDCDAF5CB,0x3FBE8CAC
- .long 0x3FFF0000,0xF281773C,0x59FFB13A,0xBFBCBB3F
- .long 0x3FFF0000,0xF5257D15,0x2486CC2C,0x3FBEF73A
- .long 0x3FFF0000,0xF7D0DF73,0x0AD13BB9,0xBFB8B795
- .long 0x3FFF0000,0xFA83B2DB,0x722A033A,0x3FBEF84B
- .long 0x3FFF0000,0xFD3E0C0C,0xF486C175,0xBFBEF581
-
- .set N,L_SCR1
-
- .set X,FP_SCR1
- .set XDCARE,X+2
- .set XFRAC,X+4
-
- .set ADJFACT,FP_SCR2
-
- .set FACT1,FP_SCR3
- .set FACT1HI,FACT1+4
- .set FACT1LOW,FACT1+8
-
- .set FACT2,FP_SCR4
- .set FACT2HI,FACT2+4
- .set FACT2LOW,FACT2+8
-
- | xref t_unfl
- |xref t_ovfl
- |xref t_frcinx
-
- .global stwotoxd
-stwotoxd:
-//--ENTRY POINT FOR 2**(X) FOR DENORMALIZED ARGUMENT
-
- fmovel %d1,%fpcr // ...set user's rounding mode/precision
- fmoves #0x3F800000,%fp0 // ...RETURN 1 + X
- movel (%a0),%d0
- orl #0x00800001,%d0
- fadds %d0,%fp0
- bra t_frcinx
-
- .global stwotox
-stwotox:
-//--ENTRY POINT FOR 2**(X), HERE X IS FINITE, NON-ZERO, AND NOT NAN'S
- fmovemx (%a0),%fp0-%fp0 // ...LOAD INPUT, do not set cc's
-
- movel (%a0),%d0
- movew 4(%a0),%d0
- fmovex %fp0,X(%a6)
- andil #0x7FFFFFFF,%d0
-
- cmpil #0x3FB98000,%d0 // ...|X| >= 2**(-70)?
- bges TWOOK1
- bra EXPBORS
-
-TWOOK1:
- cmpil #0x400D80C0,%d0 // ...|X| > 16480?
- bles TWOMAIN
- bra EXPBORS
-
-
-TWOMAIN:
-//--USUAL CASE, 2^(-70) <= |X| <= 16480
-
- fmovex %fp0,%fp1
- fmuls #0x42800000,%fp1 // ...64 * X
-
- fmovel %fp1,N(%a6) // ...N = ROUND-TO-INT(64 X)
- movel %d2,-(%sp)
- lea EXPTBL,%a1 // ...LOAD ADDRESS OF TABLE OF 2^(J/64)
- fmovel N(%a6),%fp1 // ...N --> FLOATING FMT
- movel N(%a6),%d0
- movel %d0,%d2
- andil #0x3F,%d0 // ...D0 IS J
- asll #4,%d0 // ...DISPLACEMENT FOR 2^(J/64)
- addal %d0,%a1 // ...ADDRESS FOR 2^(J/64)
- asrl #6,%d2 // ...d2 IS L, N = 64L + J
- movel %d2,%d0
- asrl #1,%d0 // ...D0 IS M
- subl %d0,%d2 // ...d2 IS M', N = 64(M+M') + J
- addil #0x3FFF,%d2
- movew %d2,ADJFACT(%a6) // ...ADJFACT IS 2^(M')
- movel (%sp)+,%d2
-//--SUMMARY: a1 IS ADDRESS FOR THE LEADING PORTION OF 2^(J/64),
-//--D0 IS M WHERE N = 64(M+M') + J. NOTE THAT |M| <= 16140 BY DESIGN.
-//--ADJFACT = 2^(M').
-//--REGISTERS SAVED SO FAR ARE (IN ORDER) FPCR, D0, FP1, a1, AND FP2.
-
- fmuls #0x3C800000,%fp1 // ...(1/64)*N
- movel (%a1)+,FACT1(%a6)
- movel (%a1)+,FACT1HI(%a6)
- movel (%a1)+,FACT1LOW(%a6)
- movew (%a1)+,FACT2(%a6)
- clrw FACT2+2(%a6)
-
- fsubx %fp1,%fp0 // ...X - (1/64)*INT(64 X)
-
- movew (%a1)+,FACT2HI(%a6)
- clrw FACT2HI+2(%a6)
- clrl FACT2LOW(%a6)
- addw %d0,FACT1(%a6)
-
- fmulx LOG2,%fp0 // ...FP0 IS R
- addw %d0,FACT2(%a6)
-
- bra expr
-
-EXPBORS:
-//--FPCR, D0 SAVED
- cmpil #0x3FFF8000,%d0
- bgts EXPBIG
-
-EXPSM:
-//--|X| IS SMALL, RETURN 1 + X
-
- fmovel %d1,%FPCR //restore users exceptions
- fadds #0x3F800000,%fp0 // ...RETURN 1 + X
-
- bra t_frcinx
-
-EXPBIG:
-//--|X| IS LARGE, GENERATE OVERFLOW IF X > 0; ELSE GENERATE UNDERFLOW
-//--REGISTERS SAVE SO FAR ARE FPCR AND D0
- movel X(%a6),%d0
- cmpil #0,%d0
- blts EXPNEG
-
- bclrb #7,(%a0) //t_ovfl expects positive value
- bra t_ovfl
-
-EXPNEG:
- bclrb #7,(%a0) //t_unfl expects positive value
- bra t_unfl
-
- .global stentoxd
-stentoxd:
-//--ENTRY POINT FOR 10**(X) FOR DENORMALIZED ARGUMENT
-
- fmovel %d1,%fpcr // ...set user's rounding mode/precision
- fmoves #0x3F800000,%fp0 // ...RETURN 1 + X
- movel (%a0),%d0
- orl #0x00800001,%d0
- fadds %d0,%fp0
- bra t_frcinx
-
- .global stentox
-stentox:
-//--ENTRY POINT FOR 10**(X), HERE X IS FINITE, NON-ZERO, AND NOT NAN'S
- fmovemx (%a0),%fp0-%fp0 // ...LOAD INPUT, do not set cc's
-
- movel (%a0),%d0
- movew 4(%a0),%d0
- fmovex %fp0,X(%a6)
- andil #0x7FFFFFFF,%d0
-
- cmpil #0x3FB98000,%d0 // ...|X| >= 2**(-70)?
- bges TENOK1
- bra EXPBORS
-
-TENOK1:
- cmpil #0x400B9B07,%d0 // ...|X| <= 16480*log2/log10 ?
- bles TENMAIN
- bra EXPBORS
-
-TENMAIN:
-//--USUAL CASE, 2^(-70) <= |X| <= 16480 LOG 2 / LOG 10
-
- fmovex %fp0,%fp1
- fmuld L2TEN64,%fp1 // ...X*64*LOG10/LOG2
-
- fmovel %fp1,N(%a6) // ...N=INT(X*64*LOG10/LOG2)
- movel %d2,-(%sp)
- lea EXPTBL,%a1 // ...LOAD ADDRESS OF TABLE OF 2^(J/64)
- fmovel N(%a6),%fp1 // ...N --> FLOATING FMT
- movel N(%a6),%d0
- movel %d0,%d2
- andil #0x3F,%d0 // ...D0 IS J
- asll #4,%d0 // ...DISPLACEMENT FOR 2^(J/64)
- addal %d0,%a1 // ...ADDRESS FOR 2^(J/64)
- asrl #6,%d2 // ...d2 IS L, N = 64L + J
- movel %d2,%d0
- asrl #1,%d0 // ...D0 IS M
- subl %d0,%d2 // ...d2 IS M', N = 64(M+M') + J
- addil #0x3FFF,%d2
- movew %d2,ADJFACT(%a6) // ...ADJFACT IS 2^(M')
- movel (%sp)+,%d2
-
-//--SUMMARY: a1 IS ADDRESS FOR THE LEADING PORTION OF 2^(J/64),
-//--D0 IS M WHERE N = 64(M+M') + J. NOTE THAT |M| <= 16140 BY DESIGN.
-//--ADJFACT = 2^(M').
-//--REGISTERS SAVED SO FAR ARE (IN ORDER) FPCR, D0, FP1, a1, AND FP2.
-
- fmovex %fp1,%fp2
-
- fmuld L10TWO1,%fp1 // ...N*(LOG2/64LOG10)_LEAD
- movel (%a1)+,FACT1(%a6)
-
- fmulx L10TWO2,%fp2 // ...N*(LOG2/64LOG10)_TRAIL
-
- movel (%a1)+,FACT1HI(%a6)
- movel (%a1)+,FACT1LOW(%a6)
- fsubx %fp1,%fp0 // ...X - N L_LEAD
- movew (%a1)+,FACT2(%a6)
-
- fsubx %fp2,%fp0 // ...X - N L_TRAIL
-
- clrw FACT2+2(%a6)
- movew (%a1)+,FACT2HI(%a6)
- clrw FACT2HI+2(%a6)
- clrl FACT2LOW(%a6)
-
- fmulx LOG10,%fp0 // ...FP0 IS R
-
- addw %d0,FACT1(%a6)
- addw %d0,FACT2(%a6)
-
-expr:
-//--FPCR, FP2, FP3 ARE SAVED IN ORDER AS SHOWN.
-//--ADJFACT CONTAINS 2**(M'), FACT1 + FACT2 = 2**(M) * 2**(J/64).
-//--FP0 IS R. THE FOLLOWING CODE COMPUTES
-//-- 2**(M'+M) * 2**(J/64) * EXP(R)
-
- fmovex %fp0,%fp1
- fmulx %fp1,%fp1 // ...FP1 IS S = R*R
-
- fmoved EXPA5,%fp2 // ...FP2 IS A5
- fmoved EXPA4,%fp3 // ...FP3 IS A4
-
- fmulx %fp1,%fp2 // ...FP2 IS S*A5
- fmulx %fp1,%fp3 // ...FP3 IS S*A4
-
- faddd EXPA3,%fp2 // ...FP2 IS A3+S*A5
- faddd EXPA2,%fp3 // ...FP3 IS A2+S*A4
-
- fmulx %fp1,%fp2 // ...FP2 IS S*(A3+S*A5)
- fmulx %fp1,%fp3 // ...FP3 IS S*(A2+S*A4)
-
- faddd EXPA1,%fp2 // ...FP2 IS A1+S*(A3+S*A5)
- fmulx %fp0,%fp3 // ...FP3 IS R*S*(A2+S*A4)
-
- fmulx %fp1,%fp2 // ...FP2 IS S*(A1+S*(A3+S*A5))
- faddx %fp3,%fp0 // ...FP0 IS R+R*S*(A2+S*A4)
-
- faddx %fp2,%fp0 // ...FP0 IS EXP(R) - 1
-
-
-//--FINAL RECONSTRUCTION PROCESS
-//--EXP(X) = 2^M*2^(J/64) + 2^M*2^(J/64)*(EXP(R)-1) - (1 OR 0)
-
- fmulx FACT1(%a6),%fp0
- faddx FACT2(%a6),%fp0
- faddx FACT1(%a6),%fp0
-
- fmovel %d1,%FPCR //restore users exceptions
- clrw ADJFACT+2(%a6)
- movel #0x80000000,ADJFACT+4(%a6)
- clrl ADJFACT+8(%a6)
- fmulx ADJFACT(%a6),%fp0 // ...FINAL ADJUSTMENT
-
- bra t_frcinx
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/tbldo.s b/c/src/lib/libcpu/m68k/m68040/fpsp/tbldo.s
deleted file mode 100644
index df3caba0e5..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/tbldo.s
+++ /dev/null
@@ -1,556 +0,0 @@
-//
-// $Id$
-//
-// tbldo.sa 3.1 12/10/90
-//
-// Modified:
-// 8/16/90 chinds The table was constructed to use only one level
-// of indirection in do_func for monadic
-// functions. Dyadic functions require two
-// levels, and the tables are still contained
-// in do_func. The table is arranged for
-// index with a 10-bit index, with the first
-// 7 bits the opcode, and the remaining 3
-// the stag. For dyadic functions, all
-// valid addresses are to the generic entry
-// point.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//TBLDO idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
- |xref ld_pinf,ld_pone,ld_ppi2
- |xref t_dz2,t_operr
- |xref serror,sone,szero,sinf,snzrinx
- |xref sopr_inf,spi_2,src_nan,szr_inf
-
- |xref smovcr
- |xref pmod,prem,pscale
- |xref satanh,satanhd
- |xref sacos,sacosd,sasin,sasind,satan,satand
- |xref setox,setoxd,setoxm1,setoxm1d,setoxm1i
- |xref sgetexp,sgetexpd,sgetman,sgetmand
- |xref sint,sintd,sintrz
- |xref ssincos,ssincosd,ssincosi,ssincosnan,ssincosz
- |xref scos,scosd,ssin,ssind,stan,stand
- |xref scosh,scoshd,ssinh,ssinhd,stanh,stanhd
- |xref sslog10,sslog2,sslogn,sslognp1
- |xref sslog10d,sslog2d,sslognd,slognp1d
- |xref stentox,stentoxd,stwotox,stwotoxd
-
-// instruction ;opcode-stag Notes
- .global tblpre
-tblpre:
- .long smovcr //$00-0 fmovecr all
- .long smovcr //$00-1 fmovecr all
- .long smovcr //$00-2 fmovecr all
- .long smovcr //$00-3 fmovecr all
- .long smovcr //$00-4 fmovecr all
- .long smovcr //$00-5 fmovecr all
- .long smovcr //$00-6 fmovecr all
- .long smovcr //$00-7 fmovecr all
-
- .long sint //$01-0 fint norm
- .long szero //$01-1 fint zero
- .long sinf //$01-2 fint inf
- .long src_nan //$01-3 fint nan
- .long sintd //$01-4 fint denorm inx
- .long serror //$01-5 fint ERROR
- .long serror //$01-6 fint ERROR
- .long serror //$01-7 fint ERROR
-
- .long ssinh //$02-0 fsinh norm
- .long szero //$02-1 fsinh zero
- .long sinf //$02-2 fsinh inf
- .long src_nan //$02-3 fsinh nan
- .long ssinhd //$02-4 fsinh denorm
- .long serror //$02-5 fsinh ERROR
- .long serror //$02-6 fsinh ERROR
- .long serror //$02-7 fsinh ERROR
-
- .long sintrz //$03-0 fintrz norm
- .long szero //$03-1 fintrz zero
- .long sinf //$03-2 fintrz inf
- .long src_nan //$03-3 fintrz nan
- .long snzrinx //$03-4 fintrz denorm inx
- .long serror //$03-5 fintrz ERROR
- .long serror //$03-6 fintrz ERROR
- .long serror //$03-7 fintrz ERROR
-
- .long serror //$04-0 ERROR - illegal extension
- .long serror //$04-1 ERROR - illegal extension
- .long serror //$04-2 ERROR - illegal extension
- .long serror //$04-3 ERROR - illegal extension
- .long serror //$04-4 ERROR - illegal extension
- .long serror //$04-5 ERROR - illegal extension
- .long serror //$04-6 ERROR - illegal extension
- .long serror //$04-7 ERROR - illegal extension
-
- .long serror //$05-0 ERROR - illegal extension
- .long serror //$05-1 ERROR - illegal extension
- .long serror //$05-2 ERROR - illegal extension
- .long serror //$05-3 ERROR - illegal extension
- .long serror //$05-4 ERROR - illegal extension
- .long serror //$05-5 ERROR - illegal extension
- .long serror //$05-6 ERROR - illegal extension
- .long serror //$05-7 ERROR - illegal extension
-
- .long sslognp1 //$06-0 flognp1 norm
- .long szero //$06-1 flognp1 zero
- .long sopr_inf //$06-2 flognp1 inf
- .long src_nan //$06-3 flognp1 nan
- .long slognp1d //$06-4 flognp1 denorm
- .long serror //$06-5 flognp1 ERROR
- .long serror //$06-6 flognp1 ERROR
- .long serror //$06-7 flognp1 ERROR
-
- .long serror //$07-0 ERROR - illegal extension
- .long serror //$07-1 ERROR - illegal extension
- .long serror //$07-2 ERROR - illegal extension
- .long serror //$07-3 ERROR - illegal extension
- .long serror //$07-4 ERROR - illegal extension
- .long serror //$07-5 ERROR - illegal extension
- .long serror //$07-6 ERROR - illegal extension
- .long serror //$07-7 ERROR - illegal extension
-
- .long setoxm1 //$08-0 fetoxm1 norm
- .long szero //$08-1 fetoxm1 zero
- .long setoxm1i //$08-2 fetoxm1 inf
- .long src_nan //$08-3 fetoxm1 nan
- .long setoxm1d //$08-4 fetoxm1 denorm
- .long serror //$08-5 fetoxm1 ERROR
- .long serror //$08-6 fetoxm1 ERROR
- .long serror //$08-7 fetoxm1 ERROR
-
- .long stanh //$09-0 ftanh norm
- .long szero //$09-1 ftanh zero
- .long sone //$09-2 ftanh inf
- .long src_nan //$09-3 ftanh nan
- .long stanhd //$09-4 ftanh denorm
- .long serror //$09-5 ftanh ERROR
- .long serror //$09-6 ftanh ERROR
- .long serror //$09-7 ftanh ERROR
-
- .long satan //$0a-0 fatan norm
- .long szero //$0a-1 fatan zero
- .long spi_2 //$0a-2 fatan inf
- .long src_nan //$0a-3 fatan nan
- .long satand //$0a-4 fatan denorm
- .long serror //$0a-5 fatan ERROR
- .long serror //$0a-6 fatan ERROR
- .long serror //$0a-7 fatan ERROR
-
- .long serror //$0b-0 ERROR - illegal extension
- .long serror //$0b-1 ERROR - illegal extension
- .long serror //$0b-2 ERROR - illegal extension
- .long serror //$0b-3 ERROR - illegal extension
- .long serror //$0b-4 ERROR - illegal extension
- .long serror //$0b-5 ERROR - illegal extension
- .long serror //$0b-6 ERROR - illegal extension
- .long serror //$0b-7 ERROR - illegal extension
-
- .long sasin //$0c-0 fasin norm
- .long szero //$0c-1 fasin zero
- .long t_operr //$0c-2 fasin inf
- .long src_nan //$0c-3 fasin nan
- .long sasind //$0c-4 fasin denorm
- .long serror //$0c-5 fasin ERROR
- .long serror //$0c-6 fasin ERROR
- .long serror //$0c-7 fasin ERROR
-
- .long satanh //$0d-0 fatanh norm
- .long szero //$0d-1 fatanh zero
- .long t_operr //$0d-2 fatanh inf
- .long src_nan //$0d-3 fatanh nan
- .long satanhd //$0d-4 fatanh denorm
- .long serror //$0d-5 fatanh ERROR
- .long serror //$0d-6 fatanh ERROR
- .long serror //$0d-7 fatanh ERROR
-
- .long ssin //$0e-0 fsin norm
- .long szero //$0e-1 fsin zero
- .long t_operr //$0e-2 fsin inf
- .long src_nan //$0e-3 fsin nan
- .long ssind //$0e-4 fsin denorm
- .long serror //$0e-5 fsin ERROR
- .long serror //$0e-6 fsin ERROR
- .long serror //$0e-7 fsin ERROR
-
- .long stan //$0f-0 ftan norm
- .long szero //$0f-1 ftan zero
- .long t_operr //$0f-2 ftan inf
- .long src_nan //$0f-3 ftan nan
- .long stand //$0f-4 ftan denorm
- .long serror //$0f-5 ftan ERROR
- .long serror //$0f-6 ftan ERROR
- .long serror //$0f-7 ftan ERROR
-
- .long setox //$10-0 fetox norm
- .long ld_pone //$10-1 fetox zero
- .long szr_inf //$10-2 fetox inf
- .long src_nan //$10-3 fetox nan
- .long setoxd //$10-4 fetox denorm
- .long serror //$10-5 fetox ERROR
- .long serror //$10-6 fetox ERROR
- .long serror //$10-7 fetox ERROR
-
- .long stwotox //$11-0 ftwotox norm
- .long ld_pone //$11-1 ftwotox zero
- .long szr_inf //$11-2 ftwotox inf
- .long src_nan //$11-3 ftwotox nan
- .long stwotoxd //$11-4 ftwotox denorm
- .long serror //$11-5 ftwotox ERROR
- .long serror //$11-6 ftwotox ERROR
- .long serror //$11-7 ftwotox ERROR
-
- .long stentox //$12-0 ftentox norm
- .long ld_pone //$12-1 ftentox zero
- .long szr_inf //$12-2 ftentox inf
- .long src_nan //$12-3 ftentox nan
- .long stentoxd //$12-4 ftentox denorm
- .long serror //$12-5 ftentox ERROR
- .long serror //$12-6 ftentox ERROR
- .long serror //$12-7 ftentox ERROR
-
- .long serror //$13-0 ERROR - illegal extension
- .long serror //$13-1 ERROR - illegal extension
- .long serror //$13-2 ERROR - illegal extension
- .long serror //$13-3 ERROR - illegal extension
- .long serror //$13-4 ERROR - illegal extension
- .long serror //$13-5 ERROR - illegal extension
- .long serror //$13-6 ERROR - illegal extension
- .long serror //$13-7 ERROR - illegal extension
-
- .long sslogn //$14-0 flogn norm
- .long t_dz2 //$14-1 flogn zero
- .long sopr_inf //$14-2 flogn inf
- .long src_nan //$14-3 flogn nan
- .long sslognd //$14-4 flogn denorm
- .long serror //$14-5 flogn ERROR
- .long serror //$14-6 flogn ERROR
- .long serror //$14-7 flogn ERROR
-
- .long sslog10 //$15-0 flog10 norm
- .long t_dz2 //$15-1 flog10 zero
- .long sopr_inf //$15-2 flog10 inf
- .long src_nan //$15-3 flog10 nan
- .long sslog10d //$15-4 flog10 denorm
- .long serror //$15-5 flog10 ERROR
- .long serror //$15-6 flog10 ERROR
- .long serror //$15-7 flog10 ERROR
-
- .long sslog2 //$16-0 flog2 norm
- .long t_dz2 //$16-1 flog2 zero
- .long sopr_inf //$16-2 flog2 inf
- .long src_nan //$16-3 flog2 nan
- .long sslog2d //$16-4 flog2 denorm
- .long serror //$16-5 flog2 ERROR
- .long serror //$16-6 flog2 ERROR
- .long serror //$16-7 flog2 ERROR
-
- .long serror //$17-0 ERROR - illegal extension
- .long serror //$17-1 ERROR - illegal extension
- .long serror //$17-2 ERROR - illegal extension
- .long serror //$17-3 ERROR - illegal extension
- .long serror //$17-4 ERROR - illegal extension
- .long serror //$17-5 ERROR - illegal extension
- .long serror //$17-6 ERROR - illegal extension
- .long serror //$17-7 ERROR - illegal extension
-
- .long serror //$18-0 ERROR - illegal extension
- .long serror //$18-1 ERROR - illegal extension
- .long serror //$18-2 ERROR - illegal extension
- .long serror //$18-3 ERROR - illegal extension
- .long serror //$18-4 ERROR - illegal extension
- .long serror //$18-5 ERROR - illegal extension
- .long serror //$18-6 ERROR - illegal extension
- .long serror //$18-7 ERROR - illegal extension
-
- .long scosh //$19-0 fcosh norm
- .long ld_pone //$19-1 fcosh zero
- .long ld_pinf //$19-2 fcosh inf
- .long src_nan //$19-3 fcosh nan
- .long scoshd //$19-4 fcosh denorm
- .long serror //$19-5 fcosh ERROR
- .long serror //$19-6 fcosh ERROR
- .long serror //$19-7 fcosh ERROR
-
- .long serror //$1a-0 ERROR - illegal extension
- .long serror //$1a-1 ERROR - illegal extension
- .long serror //$1a-2 ERROR - illegal extension
- .long serror //$1a-3 ERROR - illegal extension
- .long serror //$1a-4 ERROR - illegal extension
- .long serror //$1a-5 ERROR - illegal extension
- .long serror //$1a-6 ERROR - illegal extension
- .long serror //$1a-7 ERROR - illegal extension
-
- .long serror //$1b-0 ERROR - illegal extension
- .long serror //$1b-1 ERROR - illegal extension
- .long serror //$1b-2 ERROR - illegal extension
- .long serror //$1b-3 ERROR - illegal extension
- .long serror //$1b-4 ERROR - illegal extension
- .long serror //$1b-5 ERROR - illegal extension
- .long serror //$1b-6 ERROR - illegal extension
- .long serror //$1b-7 ERROR - illegal extension
-
- .long sacos //$1c-0 facos norm
- .long ld_ppi2 //$1c-1 facos zero
- .long t_operr //$1c-2 facos inf
- .long src_nan //$1c-3 facos nan
- .long sacosd //$1c-4 facos denorm
- .long serror //$1c-5 facos ERROR
- .long serror //$1c-6 facos ERROR
- .long serror //$1c-7 facos ERROR
-
- .long scos //$1d-0 fcos norm
- .long ld_pone //$1d-1 fcos zero
- .long t_operr //$1d-2 fcos inf
- .long src_nan //$1d-3 fcos nan
- .long scosd //$1d-4 fcos denorm
- .long serror //$1d-5 fcos ERROR
- .long serror //$1d-6 fcos ERROR
- .long serror //$1d-7 fcos ERROR
-
- .long sgetexp //$1e-0 fgetexp norm
- .long szero //$1e-1 fgetexp zero
- .long t_operr //$1e-2 fgetexp inf
- .long src_nan //$1e-3 fgetexp nan
- .long sgetexpd //$1e-4 fgetexp denorm
- .long serror //$1e-5 fgetexp ERROR
- .long serror //$1e-6 fgetexp ERROR
- .long serror //$1e-7 fgetexp ERROR
-
- .long sgetman //$1f-0 fgetman norm
- .long szero //$1f-1 fgetman zero
- .long t_operr //$1f-2 fgetman inf
- .long src_nan //$1f-3 fgetman nan
- .long sgetmand //$1f-4 fgetman denorm
- .long serror //$1f-5 fgetman ERROR
- .long serror //$1f-6 fgetman ERROR
- .long serror //$1f-7 fgetman ERROR
-
- .long serror //$20-0 ERROR - illegal extension
- .long serror //$20-1 ERROR - illegal extension
- .long serror //$20-2 ERROR - illegal extension
- .long serror //$20-3 ERROR - illegal extension
- .long serror //$20-4 ERROR - illegal extension
- .long serror //$20-5 ERROR - illegal extension
- .long serror //$20-6 ERROR - illegal extension
- .long serror //$20-7 ERROR - illegal extension
-
- .long pmod //$21-0 fmod all
- .long pmod //$21-1 fmod all
- .long pmod //$21-2 fmod all
- .long pmod //$21-3 fmod all
- .long pmod //$21-4 fmod all
- .long serror //$21-5 fmod ERROR
- .long serror //$21-6 fmod ERROR
- .long serror //$21-7 fmod ERROR
-
- .long serror //$22-0 ERROR - illegal extension
- .long serror //$22-1 ERROR - illegal extension
- .long serror //$22-2 ERROR - illegal extension
- .long serror //$22-3 ERROR - illegal extension
- .long serror //$22-4 ERROR - illegal extension
- .long serror //$22-5 ERROR - illegal extension
- .long serror //$22-6 ERROR - illegal extension
- .long serror //$22-7 ERROR - illegal extension
-
- .long serror //$23-0 ERROR - illegal extension
- .long serror //$23-1 ERROR - illegal extension
- .long serror //$23-2 ERROR - illegal extension
- .long serror //$23-3 ERROR - illegal extension
- .long serror //$23-4 ERROR - illegal extension
- .long serror //$23-5 ERROR - illegal extension
- .long serror //$23-6 ERROR - illegal extension
- .long serror //$23-7 ERROR - illegal extension
-
- .long serror //$24-0 ERROR - illegal extension
- .long serror //$24-1 ERROR - illegal extension
- .long serror //$24-2 ERROR - illegal extension
- .long serror //$24-3 ERROR - illegal extension
- .long serror //$24-4 ERROR - illegal extension
- .long serror //$24-5 ERROR - illegal extension
- .long serror //$24-6 ERROR - illegal extension
- .long serror //$24-7 ERROR - illegal extension
-
- .long prem //$25-0 frem all
- .long prem //$25-1 frem all
- .long prem //$25-2 frem all
- .long prem //$25-3 frem all
- .long prem //$25-4 frem all
- .long serror //$25-5 frem ERROR
- .long serror //$25-6 frem ERROR
- .long serror //$25-7 frem ERROR
-
- .long pscale //$26-0 fscale all
- .long pscale //$26-1 fscale all
- .long pscale //$26-2 fscale all
- .long pscale //$26-3 fscale all
- .long pscale //$26-4 fscale all
- .long serror //$26-5 fscale ERROR
- .long serror //$26-6 fscale ERROR
- .long serror //$26-7 fscale ERROR
-
- .long serror //$27-0 ERROR - illegal extension
- .long serror //$27-1 ERROR - illegal extension
- .long serror //$27-2 ERROR - illegal extension
- .long serror //$27-3 ERROR - illegal extension
- .long serror //$27-4 ERROR - illegal extension
- .long serror //$27-5 ERROR - illegal extension
- .long serror //$27-6 ERROR - illegal extension
- .long serror //$27-7 ERROR - illegal extension
-
- .long serror //$28-0 ERROR - illegal extension
- .long serror //$28-1 ERROR - illegal extension
- .long serror //$28-2 ERROR - illegal extension
- .long serror //$28-3 ERROR - illegal extension
- .long serror //$28-4 ERROR - illegal extension
- .long serror //$28-5 ERROR - illegal extension
- .long serror //$28-6 ERROR - illegal extension
- .long serror //$28-7 ERROR - illegal extension
-
- .long serror //$29-0 ERROR - illegal extension
- .long serror //$29-1 ERROR - illegal extension
- .long serror //$29-2 ERROR - illegal extension
- .long serror //$29-3 ERROR - illegal extension
- .long serror //$29-4 ERROR - illegal extension
- .long serror //$29-5 ERROR - illegal extension
- .long serror //$29-6 ERROR - illegal extension
- .long serror //$29-7 ERROR - illegal extension
-
- .long serror //$2a-0 ERROR - illegal extension
- .long serror //$2a-1 ERROR - illegal extension
- .long serror //$2a-2 ERROR - illegal extension
- .long serror //$2a-3 ERROR - illegal extension
- .long serror //$2a-4 ERROR - illegal extension
- .long serror //$2a-5 ERROR - illegal extension
- .long serror //$2a-6 ERROR - illegal extension
- .long serror //$2a-7 ERROR - illegal extension
-
- .long serror //$2b-0 ERROR - illegal extension
- .long serror //$2b-1 ERROR - illegal extension
- .long serror //$2b-2 ERROR - illegal extension
- .long serror //$2b-3 ERROR - illegal extension
- .long serror //$2b-4 ERROR - illegal extension
- .long serror //$2b-5 ERROR - illegal extension
- .long serror //$2b-6 ERROR - illegal extension
- .long serror //$2b-7 ERROR - illegal extension
-
- .long serror //$2c-0 ERROR - illegal extension
- .long serror //$2c-1 ERROR - illegal extension
- .long serror //$2c-2 ERROR - illegal extension
- .long serror //$2c-3 ERROR - illegal extension
- .long serror //$2c-4 ERROR - illegal extension
- .long serror //$2c-5 ERROR - illegal extension
- .long serror //$2c-6 ERROR - illegal extension
- .long serror //$2c-7 ERROR - illegal extension
-
- .long serror //$2d-0 ERROR - illegal extension
- .long serror //$2d-1 ERROR - illegal extension
- .long serror //$2d-2 ERROR - illegal extension
- .long serror //$2d-3 ERROR - illegal extension
- .long serror //$2d-4 ERROR - illegal extension
- .long serror //$2d-5 ERROR - illegal extension
- .long serror //$2d-6 ERROR - illegal extension
- .long serror //$2d-7 ERROR - illegal extension
-
- .long serror //$2e-0 ERROR - illegal extension
- .long serror //$2e-1 ERROR - illegal extension
- .long serror //$2e-2 ERROR - illegal extension
- .long serror //$2e-3 ERROR - illegal extension
- .long serror //$2e-4 ERROR - illegal extension
- .long serror //$2e-5 ERROR - illegal extension
- .long serror //$2e-6 ERROR - illegal extension
- .long serror //$2e-7 ERROR - illegal extension
-
- .long serror //$2f-0 ERROR - illegal extension
- .long serror //$2f-1 ERROR - illegal extension
- .long serror //$2f-2 ERROR - illegal extension
- .long serror //$2f-3 ERROR - illegal extension
- .long serror //$2f-4 ERROR - illegal extension
- .long serror //$2f-5 ERROR - illegal extension
- .long serror //$2f-6 ERROR - illegal extension
- .long serror //$2f-7 ERROR - illegal extension
-
- .long ssincos //$30-0 fsincos norm
- .long ssincosz //$30-1 fsincos zero
- .long ssincosi //$30-2 fsincos inf
- .long ssincosnan //$30-3 fsincos nan
- .long ssincosd //$30-4 fsincos denorm
- .long serror //$30-5 fsincos ERROR
- .long serror //$30-6 fsincos ERROR
- .long serror //$30-7 fsincos ERROR
-
- .long ssincos //$31-0 fsincos norm
- .long ssincosz //$31-1 fsincos zero
- .long ssincosi //$31-2 fsincos inf
- .long ssincosnan //$31-3 fsincos nan
- .long ssincosd //$31-4 fsincos denorm
- .long serror //$31-5 fsincos ERROR
- .long serror //$31-6 fsincos ERROR
- .long serror //$31-7 fsincos ERROR
-
- .long ssincos //$32-0 fsincos norm
- .long ssincosz //$32-1 fsincos zero
- .long ssincosi //$32-2 fsincos inf
- .long ssincosnan //$32-3 fsincos nan
- .long ssincosd //$32-4 fsincos denorm
- .long serror //$32-5 fsincos ERROR
- .long serror //$32-6 fsincos ERROR
- .long serror //$32-7 fsincos ERROR
-
- .long ssincos //$33-0 fsincos norm
- .long ssincosz //$33-1 fsincos zero
- .long ssincosi //$33-2 fsincos inf
- .long ssincosnan //$33-3 fsincos nan
- .long ssincosd //$33-4 fsincos denorm
- .long serror //$33-5 fsincos ERROR
- .long serror //$33-6 fsincos ERROR
- .long serror //$33-7 fsincos ERROR
-
- .long ssincos //$34-0 fsincos norm
- .long ssincosz //$34-1 fsincos zero
- .long ssincosi //$34-2 fsincos inf
- .long ssincosnan //$34-3 fsincos nan
- .long ssincosd //$34-4 fsincos denorm
- .long serror //$34-5 fsincos ERROR
- .long serror //$34-6 fsincos ERROR
- .long serror //$34-7 fsincos ERROR
-
- .long ssincos //$35-0 fsincos norm
- .long ssincosz //$35-1 fsincos zero
- .long ssincosi //$35-2 fsincos inf
- .long ssincosnan //$35-3 fsincos nan
- .long ssincosd //$35-4 fsincos denorm
- .long serror //$35-5 fsincos ERROR
- .long serror //$35-6 fsincos ERROR
- .long serror //$35-7 fsincos ERROR
-
- .long ssincos //$36-0 fsincos norm
- .long ssincosz //$36-1 fsincos zero
- .long ssincosi //$36-2 fsincos inf
- .long ssincosnan //$36-3 fsincos nan
- .long ssincosd //$36-4 fsincos denorm
- .long serror //$36-5 fsincos ERROR
- .long serror //$36-6 fsincos ERROR
- .long serror //$36-7 fsincos ERROR
-
- .long ssincos //$37-0 fsincos norm
- .long ssincosz //$37-1 fsincos zero
- .long ssincosi //$37-2 fsincos inf
- .long ssincosnan //$37-3 fsincos nan
- .long ssincosd //$37-4 fsincos denorm
- .long serror //$37-5 fsincos ERROR
- .long serror //$37-6 fsincos ERROR
- .long serror //$37-7 fsincos ERROR
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/util.s b/c/src/lib/libcpu/m68k/m68040/fpsp/util.s
deleted file mode 100644
index 894b986072..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/util.s
+++ /dev/null
@@ -1,750 +0,0 @@
-//
-// $Id$
-//
-// util.sa 3.7 7/29/91
-//
-// This file contains routines used by other programs.
-//
-// ovf_res: used by overflow to force the correct
-// result. ovf_r_k, ovf_r_x2, ovf_r_x3 are
-// derivatives of this routine.
-// get_fline: get user's opcode word
-// g_dfmtou: returns the destination format.
-// g_opcls: returns the opclass of the float instruction.
-// g_rndpr: returns the rounding precision.
-// reg_dest: write byte, word, or long data to Dn
-//
-//
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-//UTIL idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref mem_read
-
- .global g_dfmtou
- .global g_opcls
- .global g_rndpr
- .global get_fline
- .global reg_dest
-
-//
-// Final result table for ovf_res. Note that the negative counterparts
-// are unnecessary as ovf_res always returns the sign separately from
-// the exponent.
-// ;+inf
-EXT_PINF: .long 0x7fff0000,0x00000000,0x00000000,0x00000000
-// ;largest +ext
-EXT_PLRG: .long 0x7ffe0000,0xffffffff,0xffffffff,0x00000000
-// ;largest magnitude +sgl in ext
-SGL_PLRG: .long 0x407e0000,0xffffff00,0x00000000,0x00000000
-// ;largest magnitude +dbl in ext
-DBL_PLRG: .long 0x43fe0000,0xffffffff,0xfffff800,0x00000000
-// ;largest -ext
-
-tblovfl:
- .long EXT_RN
- .long EXT_RZ
- .long EXT_RM
- .long EXT_RP
- .long SGL_RN
- .long SGL_RZ
- .long SGL_RM
- .long SGL_RP
- .long DBL_RN
- .long DBL_RZ
- .long DBL_RM
- .long DBL_RP
- .long error
- .long error
- .long error
- .long error
-
-
-//
-// ovf_r_k --- overflow result calculation
-//
-// This entry point is used by kernel_ex.
-//
-// This forces the destination precision to be extended
-//
-// Input: operand in ETEMP
-// Output: a result is in ETEMP (internal extended format)
-//
- .global ovf_r_k
-ovf_r_k:
- lea ETEMP(%a6),%a0 //a0 points to source operand
- bclrb #sign_bit,ETEMP_EX(%a6)
- sne ETEMP_SGN(%a6) //convert to internal IEEE format
-
-//
-// ovf_r_x2 --- overflow result calculation
-//
-// This entry point used by x_ovfl. (opclass 0 and 2)
-//
-// Input a0 points to an operand in the internal extended format
-// Output a0 points to the result in the internal extended format
-//
-// This sets the round precision according to the user's FPCR unless the
-// instruction is fsgldiv or fsglmul or fsadd, fdadd, fsub, fdsub, fsmul,
-// fdmul, fsdiv, fddiv, fssqrt, fsmove, fdmove, fsabs, fdabs, fsneg, fdneg.
-// If the instruction is fsgldiv of fsglmul, the rounding precision must be
-// extended. If the instruction is not fsgldiv or fsglmul but a force-
-// precision instruction, the rounding precision is then set to the force
-// precision.
-
- .global ovf_r_x2
-ovf_r_x2:
- btstb #E3,E_BYTE(%a6) //check for nu exception
- beql ovf_e1_exc //it is cu exception
-ovf_e3_exc:
- movew CMDREG3B(%a6),%d0 //get the command word
- andiw #0x00000060,%d0 //clear all bits except 6 and 5
- cmpil #0x00000040,%d0
- beql ovff_sgl //force precision is single
- cmpil #0x00000060,%d0
- beql ovff_dbl //force precision is double
- movew CMDREG3B(%a6),%d0 //get the command word again
- andil #0x7f,%d0 //clear all except operation
- cmpil #0x33,%d0
- beql ovf_fsgl //fsglmul or fsgldiv
- cmpil #0x30,%d0
- beql ovf_fsgl
- bra ovf_fpcr //instruction is none of the above
-// ;use FPCR
-ovf_e1_exc:
- movew CMDREG1B(%a6),%d0 //get command word
- andil #0x00000044,%d0 //clear all bits except 6 and 2
- cmpil #0x00000040,%d0
- beql ovff_sgl //the instruction is force single
- cmpil #0x00000044,%d0
- beql ovff_dbl //the instruction is force double
- movew CMDREG1B(%a6),%d0 //again get the command word
- andil #0x0000007f,%d0 //clear all except the op code
- cmpil #0x00000027,%d0
- beql ovf_fsgl //fsglmul
- cmpil #0x00000024,%d0
- beql ovf_fsgl //fsgldiv
- bra ovf_fpcr //none of the above, use FPCR
-//
-//
-// Inst is either fsgldiv or fsglmul. Force extended precision.
-//
-ovf_fsgl:
- clrl %d0
- bras ovf_res
-
-ovff_sgl:
- movel #0x00000001,%d0 //set single
- bras ovf_res
-ovff_dbl:
- movel #0x00000002,%d0 //set double
- bras ovf_res
-//
-// The precision is in the fpcr.
-//
-ovf_fpcr:
- bfextu FPCR_MODE(%a6){#0:#2},%d0 //set round precision
- bras ovf_res
-
-//
-//
-// ovf_r_x3 --- overflow result calculation
-//
-// This entry point used by x_ovfl. (opclass 3 only)
-//
-// Input a0 points to an operand in the internal extended format
-// Output a0 points to the result in the internal extended format
-//
-// This sets the round precision according to the destination size.
-//
- .global ovf_r_x3
-ovf_r_x3:
- bsr g_dfmtou //get dest fmt in d0{1:0}
-// ;for fmovout, the destination format
-// ;is the rounding precision
-
-//
-// ovf_res --- overflow result calculation
-//
-// Input:
-// a0 points to operand in internal extended format
-// Output:
-// a0 points to result in internal extended format
-//
- .global ovf_res
-ovf_res:
- lsll #2,%d0 //move round precision to d0{3:2}
- bfextu FPCR_MODE(%a6){#2:#2},%d1 //set round mode
- orl %d1,%d0 //index is fmt:mode in d0{3:0}
- leal tblovfl,%a1 //load a1 with table address
- movel %a1@(%d0:l:4),%a1 //use d0 as index to the table
- jmp (%a1) //go to the correct routine
-//
-//case DEST_FMT = EXT
-//
-EXT_RN:
- leal EXT_PINF,%a1 //answer is +/- infinity
- bsetb #inf_bit,FPSR_CC(%a6)
- bra set_sign //now go set the sign
-EXT_RZ:
- leal EXT_PLRG,%a1 //answer is +/- large number
- bra set_sign //now go set the sign
-EXT_RM:
- tstb LOCAL_SGN(%a0) //if negative overflow
- beqs e_rm_pos
-e_rm_neg:
- leal EXT_PINF,%a1 //answer is negative infinity
- orl #neginf_mask,USER_FPSR(%a6)
- bra end_ovfr
-e_rm_pos:
- leal EXT_PLRG,%a1 //answer is large positive number
- bra end_ovfr
-EXT_RP:
- tstb LOCAL_SGN(%a0) //if negative overflow
- beqs e_rp_pos
-e_rp_neg:
- leal EXT_PLRG,%a1 //answer is large negative number
- bsetb #neg_bit,FPSR_CC(%a6)
- bra end_ovfr
-e_rp_pos:
- leal EXT_PINF,%a1 //answer is positive infinity
- bsetb #inf_bit,FPSR_CC(%a6)
- bra end_ovfr
-//
-//case DEST_FMT = DBL
-//
-DBL_RN:
- leal EXT_PINF,%a1 //answer is +/- infinity
- bsetb #inf_bit,FPSR_CC(%a6)
- bra set_sign
-DBL_RZ:
- leal DBL_PLRG,%a1 //answer is +/- large number
- bra set_sign //now go set the sign
-DBL_RM:
- tstb LOCAL_SGN(%a0) //if negative overflow
- beqs d_rm_pos
-d_rm_neg:
- leal EXT_PINF,%a1 //answer is negative infinity
- orl #neginf_mask,USER_FPSR(%a6)
- bra end_ovfr //inf is same for all precisions (ext,dbl,sgl)
-d_rm_pos:
- leal DBL_PLRG,%a1 //answer is large positive number
- bra end_ovfr
-DBL_RP:
- tstb LOCAL_SGN(%a0) //if negative overflow
- beqs d_rp_pos
-d_rp_neg:
- leal DBL_PLRG,%a1 //answer is large negative number
- bsetb #neg_bit,FPSR_CC(%a6)
- bra end_ovfr
-d_rp_pos:
- leal EXT_PINF,%a1 //answer is positive infinity
- bsetb #inf_bit,FPSR_CC(%a6)
- bra end_ovfr
-//
-//case DEST_FMT = SGL
-//
-SGL_RN:
- leal EXT_PINF,%a1 //answer is +/- infinity
- bsetb #inf_bit,FPSR_CC(%a6)
- bras set_sign
-SGL_RZ:
- leal SGL_PLRG,%a1 //answer is +/- large number
- bras set_sign
-SGL_RM:
- tstb LOCAL_SGN(%a0) //if negative overflow
- beqs s_rm_pos
-s_rm_neg:
- leal EXT_PINF,%a1 //answer is negative infinity
- orl #neginf_mask,USER_FPSR(%a6)
- bras end_ovfr
-s_rm_pos:
- leal SGL_PLRG,%a1 //answer is large positive number
- bras end_ovfr
-SGL_RP:
- tstb LOCAL_SGN(%a0) //if negative overflow
- beqs s_rp_pos
-s_rp_neg:
- leal SGL_PLRG,%a1 //answer is large negative number
- bsetb #neg_bit,FPSR_CC(%a6)
- bras end_ovfr
-s_rp_pos:
- leal EXT_PINF,%a1 //answer is positive infinity
- bsetb #inf_bit,FPSR_CC(%a6)
- bras end_ovfr
-
-set_sign:
- tstb LOCAL_SGN(%a0) //if negative overflow
- beqs end_ovfr
-neg_sign:
- bsetb #neg_bit,FPSR_CC(%a6)
-
-end_ovfr:
- movew LOCAL_EX(%a1),LOCAL_EX(%a0) //do not overwrite sign
- movel LOCAL_HI(%a1),LOCAL_HI(%a0)
- movel LOCAL_LO(%a1),LOCAL_LO(%a0)
- rts
-
-
-//
-// ERROR
-//
-error:
- rts
-//
-// get_fline --- get f-line opcode of interrupted instruction
-//
-// Returns opcode in the low word of d0.
-//
-get_fline:
- movel USER_FPIAR(%a6),%a0 //opcode address
- movel #0,-(%a7) //reserve a word on the stack
- leal 2(%a7),%a1 //point to low word of temporary
- movel #2,%d0 //count
- bsrl mem_read
- movel (%a7)+,%d0
- rts
-//
-// g_rndpr --- put rounding precision in d0{1:0}
-//
-// valid return codes are:
-// 00 - extended
-// 01 - single
-// 10 - double
-//
-// begin
-// get rounding precision (cmdreg3b{6:5})
-// begin
-// case opclass = 011 (move out)
-// get destination format - this is the also the rounding precision
-//
-// case opclass = 0x0
-// if E3
-// *case RndPr(from cmdreg3b{6:5} = 11 then RND_PREC = DBL
-// *case RndPr(from cmdreg3b{6:5} = 10 then RND_PREC = SGL
-// case RndPr(from cmdreg3b{6:5} = 00 | 01
-// use precision from FPCR{7:6}
-// case 00 then RND_PREC = EXT
-// case 01 then RND_PREC = SGL
-// case 10 then RND_PREC = DBL
-// else E1
-// use precision in FPCR{7:6}
-// case 00 then RND_PREC = EXT
-// case 01 then RND_PREC = SGL
-// case 10 then RND_PREC = DBL
-// end
-//
-g_rndpr:
- bsr g_opcls //get opclass in d0{2:0}
- cmpw #0x0003,%d0 //check for opclass 011
- bnes op_0x0
-
-//
-// For move out instructions (opclass 011) the destination format
-// is the same as the rounding precision. Pass results from g_dfmtou.
-//
- bsr g_dfmtou
- rts
-op_0x0:
- btstb #E3,E_BYTE(%a6)
- beql unf_e1_exc //branch to e1 underflow
-unf_e3_exc:
- movel CMDREG3B(%a6),%d0 //rounding precision in d0{10:9}
- bfextu %d0{#9:#2},%d0 //move the rounding prec bits to d0{1:0}
- cmpil #0x2,%d0
- beql unff_sgl //force precision is single
- cmpil #0x3,%d0 //force precision is double
- beql unff_dbl
- movew CMDREG3B(%a6),%d0 //get the command word again
- andil #0x7f,%d0 //clear all except operation
- cmpil #0x33,%d0
- beql unf_fsgl //fsglmul or fsgldiv
- cmpil #0x30,%d0
- beql unf_fsgl //fsgldiv or fsglmul
- bra unf_fpcr
-unf_e1_exc:
- movel CMDREG1B(%a6),%d0 //get 32 bits off the stack, 1st 16 bits
-// ;are the command word
- andil #0x00440000,%d0 //clear all bits except bits 6 and 2
- cmpil #0x00400000,%d0
- beql unff_sgl //force single
- cmpil #0x00440000,%d0 //force double
- beql unff_dbl
- movel CMDREG1B(%a6),%d0 //get the command word again
- andil #0x007f0000,%d0 //clear all bits except the operation
- cmpil #0x00270000,%d0
- beql unf_fsgl //fsglmul
- cmpil #0x00240000,%d0
- beql unf_fsgl //fsgldiv
- bra unf_fpcr
-
-//
-// Convert to return format. The values from cmdreg3b and the return
-// values are:
-// cmdreg3b return precision
-// -------- ------ ---------
-// 00,01 0 ext
-// 10 1 sgl
-// 11 2 dbl
-// Force single
-//
-unff_sgl:
- movel #1,%d0 //return 1
- rts
-//
-// Force double
-//
-unff_dbl:
- movel #2,%d0 //return 2
- rts
-//
-// Force extended
-//
-unf_fsgl:
- movel #0,%d0
- rts
-//
-// Get rounding precision set in FPCR{7:6}.
-//
-unf_fpcr:
- movel USER_FPCR(%a6),%d0 //rounding precision bits in d0{7:6}
- bfextu %d0{#24:#2},%d0 //move the rounding prec bits to d0{1:0}
- rts
-//
-// g_opcls --- put opclass in d0{2:0}
-//
-g_opcls:
- btstb #E3,E_BYTE(%a6)
- beqs opc_1b //if set, go to cmdreg1b
-opc_3b:
- clrl %d0 //if E3, only opclass 0x0 is possible
- rts
-opc_1b:
- movel CMDREG1B(%a6),%d0
- bfextu %d0{#0:#3},%d0 //shift opclass bits d0{31:29} to d0{2:0}
- rts
-//
-// g_dfmtou --- put destination format in d0{1:0}
-//
-// If E1, the format is from cmdreg1b{12:10}
-// If E3, the format is extended.
-//
-// Dest. Fmt.
-// extended 010 -> 00
-// single 001 -> 01
-// double 101 -> 10
-//
-g_dfmtou:
- btstb #E3,E_BYTE(%a6)
- beqs op011
- clrl %d0 //if E1, size is always ext
- rts
-op011:
- movel CMDREG1B(%a6),%d0
- bfextu %d0{#3:#3},%d0 //dest fmt from cmdreg1b{12:10}
- cmpb #1,%d0 //check for single
- bnes not_sgl
- movel #1,%d0
- rts
-not_sgl:
- cmpb #5,%d0 //check for double
- bnes not_dbl
- movel #2,%d0
- rts
-not_dbl:
- clrl %d0 //must be extended
- rts
-
-//
-//
-// Final result table for unf_sub. Note that the negative counterparts
-// are unnecessary as unf_sub always returns the sign separately from
-// the exponent.
-// ;+zero
-EXT_PZRO: .long 0x00000000,0x00000000,0x00000000,0x00000000
-// ;+zero
-SGL_PZRO: .long 0x3f810000,0x00000000,0x00000000,0x00000000
-// ;+zero
-DBL_PZRO: .long 0x3c010000,0x00000000,0x00000000,0x00000000
-// ;smallest +ext denorm
-EXT_PSML: .long 0x00000000,0x00000000,0x00000001,0x00000000
-// ;smallest +sgl denorm
-SGL_PSML: .long 0x3f810000,0x00000100,0x00000000,0x00000000
-// ;smallest +dbl denorm
-DBL_PSML: .long 0x3c010000,0x00000000,0x00000800,0x00000000
-//
-// UNF_SUB --- underflow result calculation
-//
-// Input:
-// d0 contains round precision
-// a0 points to input operand in the internal extended format
-//
-// Output:
-// a0 points to correct internal extended precision result.
-//
-
-tblunf:
- .long uEXT_RN
- .long uEXT_RZ
- .long uEXT_RM
- .long uEXT_RP
- .long uSGL_RN
- .long uSGL_RZ
- .long uSGL_RM
- .long uSGL_RP
- .long uDBL_RN
- .long uDBL_RZ
- .long uDBL_RM
- .long uDBL_RP
- .long uDBL_RN
- .long uDBL_RZ
- .long uDBL_RM
- .long uDBL_RP
-
- .global unf_sub
-unf_sub:
- lsll #2,%d0 //move round precision to d0{3:2}
- bfextu FPCR_MODE(%a6){#2:#2},%d1 //set round mode
- orl %d1,%d0 //index is fmt:mode in d0{3:0}
- leal tblunf,%a1 //load a1 with table address
- movel %a1@(%d0:l:4),%a1 //use d0 as index to the table
- jmp (%a1) //go to the correct routine
-//
-//case DEST_FMT = EXT
-//
-uEXT_RN:
- leal EXT_PZRO,%a1 //answer is +/- zero
- bsetb #z_bit,FPSR_CC(%a6)
- bra uset_sign //now go set the sign
-uEXT_RZ:
- leal EXT_PZRO,%a1 //answer is +/- zero
- bsetb #z_bit,FPSR_CC(%a6)
- bra uset_sign //now go set the sign
-uEXT_RM:
- tstb LOCAL_SGN(%a0) //if negative underflow
- beqs ue_rm_pos
-ue_rm_neg:
- leal EXT_PSML,%a1 //answer is negative smallest denorm
- bsetb #neg_bit,FPSR_CC(%a6)
- bra end_unfr
-ue_rm_pos:
- leal EXT_PZRO,%a1 //answer is positive zero
- bsetb #z_bit,FPSR_CC(%a6)
- bra end_unfr
-uEXT_RP:
- tstb LOCAL_SGN(%a0) //if negative underflow
- beqs ue_rp_pos
-ue_rp_neg:
- leal EXT_PZRO,%a1 //answer is negative zero
- oril #negz_mask,USER_FPSR(%a6)
- bra end_unfr
-ue_rp_pos:
- leal EXT_PSML,%a1 //answer is positive smallest denorm
- bra end_unfr
-//
-//case DEST_FMT = DBL
-//
-uDBL_RN:
- leal DBL_PZRO,%a1 //answer is +/- zero
- bsetb #z_bit,FPSR_CC(%a6)
- bra uset_sign
-uDBL_RZ:
- leal DBL_PZRO,%a1 //answer is +/- zero
- bsetb #z_bit,FPSR_CC(%a6)
- bra uset_sign //now go set the sign
-uDBL_RM:
- tstb LOCAL_SGN(%a0) //if negative overflow
- beqs ud_rm_pos
-ud_rm_neg:
- leal DBL_PSML,%a1 //answer is smallest denormalized negative
- bsetb #neg_bit,FPSR_CC(%a6)
- bra end_unfr
-ud_rm_pos:
- leal DBL_PZRO,%a1 //answer is positive zero
- bsetb #z_bit,FPSR_CC(%a6)
- bra end_unfr
-uDBL_RP:
- tstb LOCAL_SGN(%a0) //if negative overflow
- beqs ud_rp_pos
-ud_rp_neg:
- leal DBL_PZRO,%a1 //answer is negative zero
- oril #negz_mask,USER_FPSR(%a6)
- bra end_unfr
-ud_rp_pos:
- leal DBL_PSML,%a1 //answer is smallest denormalized negative
- bra end_unfr
-//
-//case DEST_FMT = SGL
-//
-uSGL_RN:
- leal SGL_PZRO,%a1 //answer is +/- zero
- bsetb #z_bit,FPSR_CC(%a6)
- bras uset_sign
-uSGL_RZ:
- leal SGL_PZRO,%a1 //answer is +/- zero
- bsetb #z_bit,FPSR_CC(%a6)
- bras uset_sign
-uSGL_RM:
- tstb LOCAL_SGN(%a0) //if negative overflow
- beqs us_rm_pos
-us_rm_neg:
- leal SGL_PSML,%a1 //answer is smallest denormalized negative
- bsetb #neg_bit,FPSR_CC(%a6)
- bras end_unfr
-us_rm_pos:
- leal SGL_PZRO,%a1 //answer is positive zero
- bsetb #z_bit,FPSR_CC(%a6)
- bras end_unfr
-uSGL_RP:
- tstb LOCAL_SGN(%a0) //if negative overflow
- beqs us_rp_pos
-us_rp_neg:
- leal SGL_PZRO,%a1 //answer is negative zero
- oril #negz_mask,USER_FPSR(%a6)
- bras end_unfr
-us_rp_pos:
- leal SGL_PSML,%a1 //answer is smallest denormalized positive
- bras end_unfr
-
-uset_sign:
- tstb LOCAL_SGN(%a0) //if negative overflow
- beqs end_unfr
-uneg_sign:
- bsetb #neg_bit,FPSR_CC(%a6)
-
-end_unfr:
- movew LOCAL_EX(%a1),LOCAL_EX(%a0) //be careful not to overwrite sign
- movel LOCAL_HI(%a1),LOCAL_HI(%a0)
- movel LOCAL_LO(%a1),LOCAL_LO(%a0)
- rts
-//
-// reg_dest --- write byte, word, or long data to Dn
-//
-//
-// Input:
-// L_SCR1: Data
-// d1: data size and dest register number formatted as:
-//
-// 32 5 4 3 2 1 0
-// -----------------------------------------------
-// | 0 | Size | Dest Reg # |
-// -----------------------------------------------
-//
-// Size is:
-// 0 - Byte
-// 1 - Word
-// 2 - Long/Single
-//
-pregdst:
- .long byte_d0
- .long byte_d1
- .long byte_d2
- .long byte_d3
- .long byte_d4
- .long byte_d5
- .long byte_d6
- .long byte_d7
- .long word_d0
- .long word_d1
- .long word_d2
- .long word_d3
- .long word_d4
- .long word_d5
- .long word_d6
- .long word_d7
- .long long_d0
- .long long_d1
- .long long_d2
- .long long_d3
- .long long_d4
- .long long_d5
- .long long_d6
- .long long_d7
-
-reg_dest:
- leal pregdst,%a0
- movel %a0@(%d1:l:4),%a0
- jmp (%a0)
-
-byte_d0:
- moveb L_SCR1(%a6),USER_D0+3(%a6)
- rts
-byte_d1:
- moveb L_SCR1(%a6),USER_D1+3(%a6)
- rts
-byte_d2:
- moveb L_SCR1(%a6),%d2
- rts
-byte_d3:
- moveb L_SCR1(%a6),%d3
- rts
-byte_d4:
- moveb L_SCR1(%a6),%d4
- rts
-byte_d5:
- moveb L_SCR1(%a6),%d5
- rts
-byte_d6:
- moveb L_SCR1(%a6),%d6
- rts
-byte_d7:
- moveb L_SCR1(%a6),%d7
- rts
-word_d0:
- movew L_SCR1(%a6),USER_D0+2(%a6)
- rts
-word_d1:
- movew L_SCR1(%a6),USER_D1+2(%a6)
- rts
-word_d2:
- movew L_SCR1(%a6),%d2
- rts
-word_d3:
- movew L_SCR1(%a6),%d3
- rts
-word_d4:
- movew L_SCR1(%a6),%d4
- rts
-word_d5:
- movew L_SCR1(%a6),%d5
- rts
-word_d6:
- movew L_SCR1(%a6),%d6
- rts
-word_d7:
- movew L_SCR1(%a6),%d7
- rts
-long_d0:
- movel L_SCR1(%a6),USER_D0(%a6)
- rts
-long_d1:
- movel L_SCR1(%a6),USER_D1(%a6)
- rts
-long_d2:
- movel L_SCR1(%a6),%d2
- rts
-long_d3:
- movel L_SCR1(%a6),%d3
- rts
-long_d4:
- movel L_SCR1(%a6),%d4
- rts
-long_d5:
- movel L_SCR1(%a6),%d5
- rts
-long_d6:
- movel L_SCR1(%a6),%d6
- rts
-long_d7:
- movel L_SCR1(%a6),%d7
- rts
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/x_bsun.s b/c/src/lib/libcpu/m68k/m68040/fpsp/x_bsun.s
deleted file mode 100644
index 51a6d74d19..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/x_bsun.s
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// $Id$
-//
-// x_bsun.sa 3.3 7/1/91
-//
-// fpsp_bsun --- FPSP handler for branch/set on unordered exception
-//
-// Copy the PC to FPIAR to maintain 881/882 compatibility
-//
-// The real_bsun handler will need to perform further corrective
-// measures as outlined in the 040 User's Manual on pages
-// 9-41f, section 9.8.3.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-X_BSUN: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref real_bsun
-
- .global fpsp_bsun
-fpsp_bsun:
-//
- link %a6,#-LOCAL_SIZE
- fsave -(%a7)
- moveml %d0-%d1/%a0-%a1,USER_DA(%a6)
- fmovemx %fp0-%fp3,USER_FP0(%a6)
- fmoveml %fpcr/%fpsr/%fpiar,USER_FPCR(%a6)
-
-//
- movel EXC_PC(%a6),USER_FPIAR(%a6)
-//
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- frestore (%a7)+
- unlk %a6
- bral real_bsun
-//
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/x_fline.s b/c/src/lib/libcpu/m68k/m68040/fpsp/x_fline.s
deleted file mode 100644
index 3dfbd08c52..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/x_fline.s
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// $Id$
-//
-// x_fline.sa 3.3 1/10/91
-//
-// fpsp_fline --- FPSP handler for fline exception
-//
-// First determine if the exception is one of the unimplemented
-// floating point instructions. If so, let fpsp_unimp handle it.
-// Next, determine if the instruction is an fmovecr with a non-zero
-// <ea> field. If so, handle here and return. Otherwise, it
-// must be a real F-line exception.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-X_FLINE: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref real_fline
- |xref fpsp_unimp
- |xref uni_2
- |xref mem_read
- |xref fpsp_fmt_error
-
- .global fpsp_fline
-fpsp_fline:
-//
-// check for unimplemented vector first. Use EXC_VEC-4 because
-// the equate is valid only after a 'link a6' has pushed one more
-// long onto the stack.
-//
- cmpw #UNIMP_VEC,EXC_VEC-4(%a7)
- beql fpsp_unimp
-
-//
-// fmovecr with non-zero <ea> handling here
-//
- subl #4,%a7 //4 accounts for 2-word difference
-// ;between six word frame (unimp) and
-// ;four word frame
- link %a6,#-LOCAL_SIZE
- fsave -(%a7)
- moveml %d0-%d1/%a0-%a1,USER_DA(%a6)
- moveal EXC_PC+4(%a6),%a0 //get address of fline instruction
- leal L_SCR1(%a6),%a1 //use L_SCR1 as scratch
- movel #4,%d0
- addl #4,%a6 //to offset the sub.l #4,a7 above so that
-// ;a6 can point correctly to the stack frame
-// ;before branching to mem_read
- bsrl mem_read
- subl #4,%a6
- movel L_SCR1(%a6),%d0 //d0 contains the fline and command word
- bfextu %d0{#4:#3},%d1 //extract coprocessor id
- cmpib #1,%d1 //check if cpid=1
- bne not_mvcr //exit if not
- bfextu %d0{#16:#6},%d1
- cmpib #0x17,%d1 //check if it is an FMOVECR encoding
- bne not_mvcr
-// ;if an FMOVECR instruction, fix stack
-// ;and go to FPSP_UNIMP
-fix_stack:
- cmpib #VER_40,(%a7) //test for orig unimp frame
- bnes ck_rev
- subl #UNIMP_40_SIZE-4,%a7 //emulate an orig fsave
- moveb #VER_40,(%a7)
- moveb #UNIMP_40_SIZE-4,1(%a7)
- clrw 2(%a7)
- bras fix_con
-ck_rev:
- cmpib #VER_41,(%a7) //test for rev unimp frame
- bnel fpsp_fmt_error //if not $40 or $41, exit with error
- subl #UNIMP_41_SIZE-4,%a7 //emulate a rev fsave
- moveb #VER_41,(%a7)
- moveb #UNIMP_41_SIZE-4,1(%a7)
- clrw 2(%a7)
-fix_con:
- movew EXC_SR+4(%a6),EXC_SR(%a6) //move stacked sr to new position
- movel EXC_PC+4(%a6),EXC_PC(%a6) //move stacked pc to new position
- fmovel EXC_PC(%a6),%FPIAR //point FPIAR to fline inst
- movel #4,%d1
- addl %d1,EXC_PC(%a6) //increment stacked pc value to next inst
- movew #0x202c,EXC_VEC(%a6) //reformat vector to unimp
- clrl EXC_EA(%a6) //clear the EXC_EA field
- movew %d0,CMDREG1B(%a6) //move the lower word into CMDREG1B
- clrl E_BYTE(%a6)
- bsetb #UFLAG,T_BYTE(%a6)
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1 //restore data registers
- bral uni_2
-
-not_mvcr:
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1 //restore data registers
- frestore (%a7)+
- unlk %a6
- addl #4,%a7
- bral real_fline
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/x_operr.s b/c/src/lib/libcpu/m68k/m68040/fpsp/x_operr.s
deleted file mode 100644
index 9fd9c99cf0..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/x_operr.s
+++ /dev/null
@@ -1,358 +0,0 @@
-//
-// $Id$
-//
-// x_operr.sa 3.5 7/1/91
-//
-// fpsp_operr --- FPSP handler for operand error exception
-//
-// See 68040 User's Manual pp. 9-44f
-//
-// Note 1: For trap disabled 040 does the following:
-// If the dest is a fp reg, then an extended precision non_signaling
-// NAN is stored in the dest reg. If the dest format is b, w, or l and
-// the source op is a NAN, then garbage is stored as the result (actually
-// the upper 32 bits of the mantissa are sent to the integer unit). If
-// the dest format is integer (b, w, l) and the operr is caused by
-// integer overflow, or the source op is inf, then the result stored is
-// garbage.
-// There are three cases in which operr is incorrectly signaled on the
-// 040. This occurs for move_out of format b, w, or l for the largest
-// negative integer (-2^7 for b, -2^15 for w, -2^31 for l).
-//
-// On opclass = 011 fmove.(b,w,l) that causes a conversion
-// overflow -> OPERR, the exponent in wbte (and fpte) is:
-// byte 56 - (62 - exp)
-// word 48 - (62 - exp)
-// long 32 - (62 - exp)
-//
-// where exp = (true exp) - 1
-//
-// So, wbtemp and fptemp will contain the following on erroneously
-// signalled operr:
-// fpts = 1
-// fpte = $4000 (15 bit externally)
-// byte fptm = $ffffffff ffffff80
-// word fptm = $ffffffff ffff8000
-// long fptm = $ffffffff 80000000
-//
-// Note 2: For trap enabled 040 does the following:
-// If the inst is move_out, then same as Note 1.
-// If the inst is not move_out, the dest is not modified.
-// The exceptional operand is not defined for integer overflow
-// during a move_out.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-X_OPERR: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref mem_write
- |xref real_operr
- |xref real_inex
- |xref get_fline
- |xref fpsp_done
- |xref reg_dest
-
- .global fpsp_operr
-fpsp_operr:
-//
- link %a6,#-LOCAL_SIZE
- fsave -(%a7)
- moveml %d0-%d1/%a0-%a1,USER_DA(%a6)
- fmovemx %fp0-%fp3,USER_FP0(%a6)
- fmoveml %fpcr/%fpsr/%fpiar,USER_FPCR(%a6)
-
-//
-// Check if this is an opclass 3 instruction.
-// If so, fall through, else branch to operr_end
-//
- btstb #TFLAG,T_BYTE(%a6)
- beqs operr_end
-
-//
-// If the destination size is B,W,or L, the operr must be
-// handled here.
-//
- movel CMDREG1B(%a6),%d0
- bfextu %d0{#3:#3},%d0 //0=long, 4=word, 6=byte
- cmpib #0,%d0 //determine size; check long
- beq operr_long
- cmpib #4,%d0 //check word
- beq operr_word
- cmpib #6,%d0 //check byte
- beq operr_byte
-
-//
-// The size is not B,W,or L, so the operr is handled by the
-// kernel handler. Set the operr bits and clean up, leaving
-// only the integer exception frame on the stack, and the
-// fpu in the original exceptional state.
-//
-operr_end:
- bsetb #operr_bit,FPSR_EXCEPT(%a6)
- bsetb #aiop_bit,FPSR_AEXCEPT(%a6)
-
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- frestore (%a7)+
- unlk %a6
- bral real_operr
-
-operr_long:
- moveql #4,%d1 //write size to d1
- moveb STAG(%a6),%d0 //test stag for nan
- andib #0xe0,%d0 //clr all but tag
- cmpib #0x60,%d0 //check for nan
- beq operr_nan
- cmpil #0x80000000,FPTEMP_LO(%a6) //test if ls lword is special
- bnes chklerr //if not equal, check for incorrect operr
- bsr check_upper //check if exp and ms mant are special
- tstl %d0
- bnes chklerr //if d0 is true, check for incorrect operr
- movel #0x80000000,%d0 //store special case result
- bsr operr_store
- bra not_enabled //clean and exit
-//
-// CHECK FOR INCORRECTLY GENERATED OPERR EXCEPTION HERE
-//
-chklerr:
- movew FPTEMP_EX(%a6),%d0
- andw #0x7FFF,%d0 //ignore sign bit
- cmpw #0x3FFE,%d0 //this is the only possible exponent value
- bnes chklerr2
-fixlong:
- movel FPTEMP_LO(%a6),%d0
- bsr operr_store
- bra not_enabled
-chklerr2:
- movew FPTEMP_EX(%a6),%d0
- andw #0x7FFF,%d0 //ignore sign bit
- cmpw #0x4000,%d0
- bcc store_max //exponent out of range
-
- movel FPTEMP_LO(%a6),%d0
- andl #0x7FFF0000,%d0 //look for all 1's on bits 30-16
- cmpl #0x7FFF0000,%d0
- beqs fixlong
-
- tstl FPTEMP_LO(%a6)
- bpls chklepos
- cmpl #0xFFFFFFFF,FPTEMP_HI(%a6)
- beqs fixlong
- bra store_max
-chklepos:
- tstl FPTEMP_HI(%a6)
- beqs fixlong
- bra store_max
-
-operr_word:
- moveql #2,%d1 //write size to d1
- moveb STAG(%a6),%d0 //test stag for nan
- andib #0xe0,%d0 //clr all but tag
- cmpib #0x60,%d0 //check for nan
- beq operr_nan
- cmpil #0xffff8000,FPTEMP_LO(%a6) //test if ls lword is special
- bnes chkwerr //if not equal, check for incorrect operr
- bsr check_upper //check if exp and ms mant are special
- tstl %d0
- bnes chkwerr //if d0 is true, check for incorrect operr
- movel #0x80000000,%d0 //store special case result
- bsr operr_store
- bra not_enabled //clean and exit
-//
-// CHECK FOR INCORRECTLY GENERATED OPERR EXCEPTION HERE
-//
-chkwerr:
- movew FPTEMP_EX(%a6),%d0
- andw #0x7FFF,%d0 //ignore sign bit
- cmpw #0x3FFE,%d0 //this is the only possible exponent value
- bnes store_max
- movel FPTEMP_LO(%a6),%d0
- swap %d0
- bsr operr_store
- bra not_enabled
-
-operr_byte:
- moveql #1,%d1 //write size to d1
- moveb STAG(%a6),%d0 //test stag for nan
- andib #0xe0,%d0 //clr all but tag
- cmpib #0x60,%d0 //check for nan
- beqs operr_nan
- cmpil #0xffffff80,FPTEMP_LO(%a6) //test if ls lword is special
- bnes chkberr //if not equal, check for incorrect operr
- bsr check_upper //check if exp and ms mant are special
- tstl %d0
- bnes chkberr //if d0 is true, check for incorrect operr
- movel #0x80000000,%d0 //store special case result
- bsr operr_store
- bra not_enabled //clean and exit
-//
-// CHECK FOR INCORRECTLY GENERATED OPERR EXCEPTION HERE
-//
-chkberr:
- movew FPTEMP_EX(%a6),%d0
- andw #0x7FFF,%d0 //ignore sign bit
- cmpw #0x3FFE,%d0 //this is the only possible exponent value
- bnes store_max
- movel FPTEMP_LO(%a6),%d0
- asll #8,%d0
- swap %d0
- bsr operr_store
- bra not_enabled
-
-//
-// This operr condition is not of the special case. Set operr
-// and aiop and write the portion of the nan to memory for the
-// given size.
-//
-operr_nan:
- orl #opaop_mask,USER_FPSR(%a6) //set operr & aiop
-
- movel ETEMP_HI(%a6),%d0 //output will be from upper 32 bits
- bsr operr_store
- bra end_operr
-//
-// Store_max loads the max pos or negative for the size, sets
-// the operr and aiop bits, and clears inex and ainex, incorrectly
-// set by the 040.
-//
-store_max:
- orl #opaop_mask,USER_FPSR(%a6) //set operr & aiop
- bclrb #inex2_bit,FPSR_EXCEPT(%a6)
- bclrb #ainex_bit,FPSR_AEXCEPT(%a6)
- fmovel #0,%FPSR
-
- tstw FPTEMP_EX(%a6) //check sign
- blts load_neg
- movel #0x7fffffff,%d0
- bsr operr_store
- bra end_operr
-load_neg:
- movel #0x80000000,%d0
- bsr operr_store
- bra end_operr
-
-//
-// This routine stores the data in d0, for the given size in d1,
-// to memory or data register as required. A read of the fline
-// is required to determine the destination.
-//
-operr_store:
- movel %d0,L_SCR1(%a6) //move write data to L_SCR1
- movel %d1,-(%a7) //save register size
- bsrl get_fline //fline returned in d0
- movel (%a7)+,%d1
- bftst %d0{#26:#3} //if mode is zero, dest is Dn
- bnes dest_mem
-//
-// Destination is Dn. Get register number from d0. Data is on
-// the stack at (a7). D1 has size: 1=byte,2=word,4=long/single
-//
- andil #7,%d0 //isolate register number
- cmpil #4,%d1
- beqs op_long //the most frequent case
- cmpil #2,%d1
- bnes op_con
- orl #8,%d0
- bras op_con
-op_long:
- orl #0x10,%d0
-op_con:
- movel %d0,%d1 //format size:reg for reg_dest
- bral reg_dest //call to reg_dest returns to caller
-// ;of operr_store
-//
-// Destination is memory. Get <ea> from integer exception frame
-// and call mem_write.
-//
-dest_mem:
- leal L_SCR1(%a6),%a0 //put ptr to write data in a0
- movel EXC_EA(%a6),%a1 //put user destination address in a1
- movel %d1,%d0 //put size in d0
- bsrl mem_write
- rts
-//
-// Check the exponent for $c000 and the upper 32 bits of the
-// mantissa for $ffffffff. If both are true, return d0 clr
-// and store the lower n bits of the least lword of FPTEMP
-// to d0 for write out. If not, it is a real operr, and set d0.
-//
-check_upper:
- cmpil #0xffffffff,FPTEMP_HI(%a6) //check if first byte is all 1's
- bnes true_operr //if not all 1's then was true operr
- cmpiw #0xc000,FPTEMP_EX(%a6) //check if incorrectly signalled
- beqs not_true_operr //branch if not true operr
- cmpiw #0xbfff,FPTEMP_EX(%a6) //check if incorrectly signalled
- beqs not_true_operr //branch if not true operr
-true_operr:
- movel #1,%d0 //signal real operr
- rts
-not_true_operr:
- clrl %d0 //signal no real operr
- rts
-
-//
-// End_operr tests for operr enabled. If not, it cleans up the stack
-// and does an rte. If enabled, it cleans up the stack and branches
-// to the kernel operr handler with only the integer exception
-// frame on the stack and the fpu in the original exceptional state
-// with correct data written to the destination.
-//
-end_operr:
- btstb #operr_bit,FPCR_ENABLE(%a6)
- beqs not_enabled
-enabled:
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- frestore (%a7)+
- unlk %a6
- bral real_operr
-
-not_enabled:
-//
-// It is possible to have either inex2 or inex1 exceptions with the
-// operr. If the inex enable bit is set in the FPCR, and either
-// inex2 or inex1 occurred, we must clean up and branch to the
-// real inex handler.
-//
-ck_inex:
- moveb FPCR_ENABLE(%a6),%d0
- andb FPSR_EXCEPT(%a6),%d0
- andib #0x3,%d0
- beq operr_exit
-//
-// Inexact enabled and reported, and we must take an inexact exception.
-//
-take_inex:
- moveb #INEX_VEC,EXC_VEC+1(%a6)
- movel USER_FPSR(%a6),FPSR_SHADOW(%a6)
- orl #sx_mask,E_BYTE(%a6)
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- frestore (%a7)+
- unlk %a6
- bral real_inex
-//
-// Since operr is only an E1 exception, there is no need to frestore
-// any state back to the fpu.
-//
-operr_exit:
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- unlk %a6
- bral fpsp_done
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/x_ovfl.s b/c/src/lib/libcpu/m68k/m68040/fpsp/x_ovfl.s
deleted file mode 100644
index e56f2b88c5..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/x_ovfl.s
+++ /dev/null
@@ -1,188 +0,0 @@
-//
-// $Id$
-//
-// x_ovfl.sa 3.5 7/1/91
-//
-// fpsp_ovfl --- FPSP handler for overflow exception
-//
-// Overflow occurs when a floating-point intermediate result is
-// too large to be represented in a floating-point data register,
-// or when storing to memory, the contents of a floating-point
-// data register are too large to be represented in the
-// destination format.
-//
-// Trap disabled results
-//
-// If the instruction is move_out, then garbage is stored in the
-// destination. If the instruction is not move_out, then the
-// destination is not affected. For 68881 compatibility, the
-// following values should be stored at the destination, based
-// on the current rounding mode:
-//
-// RN Infinity with the sign of the intermediate result.
-// RZ Largest magnitude number, with the sign of the
-// intermediate result.
-// RM For pos overflow, the largest pos number. For neg overflow,
-// -infinity
-// RP For pos overflow, +infinity. For neg overflow, the largest
-// neg number
-//
-// Trap enabled results
-// All trap disabled code applies. In addition the exceptional
-// operand needs to be made available to the users exception handler
-// with a bias of $6000 subtracted from the exponent.
-//
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-X_OVFL: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref ovf_r_x2
- |xref ovf_r_x3
- |xref store
- |xref real_ovfl
- |xref real_inex
- |xref fpsp_done
- |xref g_opcls
- |xref b1238_fix
-
- .global fpsp_ovfl
-fpsp_ovfl:
- link %a6,#-LOCAL_SIZE
- fsave -(%a7)
- moveml %d0-%d1/%a0-%a1,USER_DA(%a6)
- fmovemx %fp0-%fp3,USER_FP0(%a6)
- fmoveml %fpcr/%fpsr/%fpiar,USER_FPCR(%a6)
-
-//
-// The 040 doesn't set the AINEX bit in the FPSR, the following
-// line temporarily rectifies this error.
-//
- bsetb #ainex_bit,FPSR_AEXCEPT(%a6)
-//
- bsrl ovf_adj //denormalize, round & store interm op
-//
-// if overflow traps not enabled check for inexact exception
-//
- btstb #ovfl_bit,FPCR_ENABLE(%a6)
- beqs ck_inex
-//
- btstb #E3,E_BYTE(%a6)
- beqs no_e3_1
- bfextu CMDREG3B(%a6){#6:#3},%d0 //get dest reg no
- bclrb %d0,FPR_DIRTY_BITS(%a6) //clr dest dirty bit
- bsrl b1238_fix
- movel USER_FPSR(%a6),FPSR_SHADOW(%a6)
- orl #sx_mask,E_BYTE(%a6)
-no_e3_1:
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- frestore (%a7)+
- unlk %a6
- bral real_ovfl
-//
-// It is possible to have either inex2 or inex1 exceptions with the
-// ovfl. If the inex enable bit is set in the FPCR, and either
-// inex2 or inex1 occurred, we must clean up and branch to the
-// real inex handler.
-//
-ck_inex:
-// move.b FPCR_ENABLE(%a6),%d0
-// and.b FPSR_EXCEPT(%a6),%d0
-// andi.b #$3,%d0
- btstb #inex2_bit,FPCR_ENABLE(%a6)
- beqs ovfl_exit
-//
-// Inexact enabled and reported, and we must take an inexact exception.
-//
-take_inex:
- btstb #E3,E_BYTE(%a6)
- beqs no_e3_2
- bfextu CMDREG3B(%a6){#6:#3},%d0 //get dest reg no
- bclrb %d0,FPR_DIRTY_BITS(%a6) //clr dest dirty bit
- bsrl b1238_fix
- movel USER_FPSR(%a6),FPSR_SHADOW(%a6)
- orl #sx_mask,E_BYTE(%a6)
-no_e3_2:
- moveb #INEX_VEC,EXC_VEC+1(%a6)
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- frestore (%a7)+
- unlk %a6
- bral real_inex
-
-ovfl_exit:
- bclrb #E3,E_BYTE(%a6) //test and clear E3 bit
- beqs e1_set
-//
-// Clear dirty bit on dest resister in the frame before branching
-// to b1238_fix.
-//
- bfextu CMDREG3B(%a6){#6:#3},%d0 //get dest reg no
- bclrb %d0,FPR_DIRTY_BITS(%a6) //clr dest dirty bit
- bsrl b1238_fix //test for bug1238 case
-
- movel USER_FPSR(%a6),FPSR_SHADOW(%a6)
- orl #sx_mask,E_BYTE(%a6)
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- frestore (%a7)+
- unlk %a6
- bral fpsp_done
-e1_set:
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- unlk %a6
- bral fpsp_done
-
-//
-// ovf_adj
-//
-ovf_adj:
-//
-// Have a0 point to the correct operand.
-//
- btstb #E3,E_BYTE(%a6) //test E3 bit
- beqs ovf_e1
-
- lea WBTEMP(%a6),%a0
- bras ovf_com
-ovf_e1:
- lea ETEMP(%a6),%a0
-
-ovf_com:
- bclrb #sign_bit,LOCAL_EX(%a0)
- sne LOCAL_SGN(%a0)
-
- bsrl g_opcls //returns opclass in d0
- cmpiw #3,%d0 //check for opclass3
- bnes not_opc011
-
-//
-// FPSR_CC is saved and restored because ovf_r_x3 affects it. The
-// CCs are defined to be 'not affected' for the opclass3 instruction.
-//
- moveb FPSR_CC(%a6),L_SCR1(%a6)
- bsrl ovf_r_x3 //returns a0 pointing to result
- moveb L_SCR1(%a6),FPSR_CC(%a6)
- bral store //stores to memory or register
-
-not_opc011:
- bsrl ovf_r_x2 //returns a0 pointing to result
- bral store //stores to memory or register
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/x_snan.s b/c/src/lib/libcpu/m68k/m68040/fpsp/x_snan.s
deleted file mode 100644
index 473630f7b7..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/x_snan.s
+++ /dev/null
@@ -1,279 +0,0 @@
-//
-// $Id$
-//
-// x_snan.sa 3.3 7/1/91
-//
-// fpsp_snan --- FPSP handler for signalling NAN exception
-//
-// SNAN for float -> integer conversions (integer conversion of
-// an SNAN) is a non-maskable run-time exception.
-//
-// For trap disabled the 040 does the following:
-// If the dest data format is s, d, or x, then the SNAN bit in the NAN
-// is set to one and the resulting non-signaling NAN (truncated if
-// necessary) is transferred to the dest. If the dest format is b, w,
-// or l, then garbage is written to the dest (actually the upper 32 bits
-// of the mantissa are sent to the integer unit).
-//
-// For trap enabled the 040 does the following:
-// If the inst is move_out, then the results are the same as for trap
-// disabled with the exception posted. If the instruction is not move_
-// out, the dest. is not modified, and the exception is posted.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-X_SNAN: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref get_fline
- |xref mem_write
- |xref real_snan
- |xref real_inex
- |xref fpsp_done
- |xref reg_dest
-
- .global fpsp_snan
-fpsp_snan:
- link %a6,#-LOCAL_SIZE
- fsave -(%a7)
- moveml %d0-%d1/%a0-%a1,USER_DA(%a6)
- fmovemx %fp0-%fp3,USER_FP0(%a6)
- fmoveml %fpcr/%fpsr/%fpiar,USER_FPCR(%a6)
-
-//
-// Check if trap enabled
-//
- btstb #snan_bit,FPCR_ENABLE(%a6)
- bnes ena //If enabled, then branch
-
- bsrl move_out //else SNAN disabled
-//
-// It is possible to have an inex1 exception with the
-// snan. If the inex enable bit is set in the FPCR, and either
-// inex2 or inex1 occurred, we must clean up and branch to the
-// real inex handler.
-//
-ck_inex:
- moveb FPCR_ENABLE(%a6),%d0
- andb FPSR_EXCEPT(%a6),%d0
- andib #0x3,%d0
- beq end_snan
-//
-// Inexact enabled and reported, and we must take an inexact exception.
-//
-take_inex:
- moveb #INEX_VEC,EXC_VEC+1(%a6)
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- frestore (%a7)+
- unlk %a6
- bral real_inex
-//
-// SNAN is enabled. Check if inst is move_out.
-// Make any corrections to the 040 output as necessary.
-//
-ena:
- btstb #5,CMDREG1B(%a6) //if set, inst is move out
- beq not_out
-
- bsrl move_out
-
-report_snan:
- moveb (%a7),VER_TMP(%a6)
- cmpib #VER_40,(%a7) //test for orig unimp frame
- bnes ck_rev
- moveql #13,%d0 //need to zero 14 lwords
- bras rep_con
-ck_rev:
- moveql #11,%d0 //need to zero 12 lwords
-rep_con:
- clrl (%a7)
-loop1:
- clrl -(%a7) //clear and dec a7
- dbra %d0,loop1
- moveb VER_TMP(%a6),(%a7) //format a busy frame
- moveb #BUSY_SIZE-4,1(%a7)
- movel USER_FPSR(%a6),FPSR_SHADOW(%a6)
- orl #sx_mask,E_BYTE(%a6)
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- frestore (%a7)+
- unlk %a6
- bral real_snan
-//
-// Exit snan handler by expanding the unimp frame into a busy frame
-//
-end_snan:
- bclrb #E1,E_BYTE(%a6)
-
- moveb (%a7),VER_TMP(%a6)
- cmpib #VER_40,(%a7) //test for orig unimp frame
- bnes ck_rev2
- moveql #13,%d0 //need to zero 14 lwords
- bras rep_con2
-ck_rev2:
- moveql #11,%d0 //need to zero 12 lwords
-rep_con2:
- clrl (%a7)
-loop2:
- clrl -(%a7) //clear and dec a7
- dbra %d0,loop2
- moveb VER_TMP(%a6),(%a7) //format a busy frame
- moveb #BUSY_SIZE-4,1(%a7) //write busy size
- movel USER_FPSR(%a6),FPSR_SHADOW(%a6)
- orl #sx_mask,E_BYTE(%a6)
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- frestore (%a7)+
- unlk %a6
- bral fpsp_done
-
-//
-// Move_out
-//
-move_out:
- movel EXC_EA(%a6),%a0 //get <ea> from exc frame
-
- bfextu CMDREG1B(%a6){#3:#3},%d0 //move rx field to d0{2:0}
- cmpil #0,%d0 //check for long
- beqs sto_long //branch if move_out long
-
- cmpil #4,%d0 //check for word
- beqs sto_word //branch if move_out word
-
- cmpil #6,%d0 //check for byte
- beqs sto_byte //branch if move_out byte
-
-//
-// Not byte, word or long
-//
- rts
-//
-// Get the 32 most significant bits of etemp mantissa
-//
-sto_long:
- movel ETEMP_HI(%a6),%d1
- movel #4,%d0 //load byte count
-//
-// Set signalling nan bit
-//
- bsetl #30,%d1
-//
-// Store to the users destination address
-//
- tstl %a0 //check if <ea> is 0
- beqs wrt_dn //destination is a data register
-
- movel %d1,-(%a7) //move the snan onto the stack
- movel %a0,%a1 //load dest addr into a1
- movel %a7,%a0 //load src addr of snan into a0
- bsrl mem_write //write snan to user memory
- movel (%a7)+,%d1 //clear off stack
- rts
-//
-// Get the 16 most significant bits of etemp mantissa
-//
-sto_word:
- movel ETEMP_HI(%a6),%d1
- movel #2,%d0 //load byte count
-//
-// Set signalling nan bit
-//
- bsetl #30,%d1
-//
-// Store to the users destination address
-//
- tstl %a0 //check if <ea> is 0
- beqs wrt_dn //destination is a data register
-
- movel %d1,-(%a7) //move the snan onto the stack
- movel %a0,%a1 //load dest addr into a1
- movel %a7,%a0 //point to low word
- bsrl mem_write //write snan to user memory
- movel (%a7)+,%d1 //clear off stack
- rts
-//
-// Get the 8 most significant bits of etemp mantissa
-//
-sto_byte:
- movel ETEMP_HI(%a6),%d1
- movel #1,%d0 //load byte count
-//
-// Set signalling nan bit
-//
- bsetl #30,%d1
-//
-// Store to the users destination address
-//
- tstl %a0 //check if <ea> is 0
- beqs wrt_dn //destination is a data register
- movel %d1,-(%a7) //move the snan onto the stack
- movel %a0,%a1 //load dest addr into a1
- movel %a7,%a0 //point to source byte
- bsrl mem_write //write snan to user memory
- movel (%a7)+,%d1 //clear off stack
- rts
-
-//
-// wrt_dn --- write to a data register
-//
-// We get here with D1 containing the data to write and D0 the
-// number of bytes to write: 1=byte,2=word,4=long.
-//
-wrt_dn:
- movel %d1,L_SCR1(%a6) //data
- movel %d0,-(%a7) //size
- bsrl get_fline //returns fline word in d0
- movel %d0,%d1
- andil #0x7,%d1 //d1 now holds register number
- movel (%sp)+,%d0 //get original size
- cmpil #4,%d0
- beqs wrt_long
- cmpil #2,%d0
- bnes wrt_byte
-wrt_word:
- orl #0x8,%d1
- bral reg_dest
-wrt_long:
- orl #0x10,%d1
- bral reg_dest
-wrt_byte:
- bral reg_dest
-//
-// Check if it is a src nan or dst nan
-//
-not_out:
- movel DTAG(%a6),%d0
- bfextu %d0{#0:#3},%d0 //isolate dtag in lsbs
-
- cmpib #3,%d0 //check for nan in destination
- bnes issrc //destination nan has priority
-dst_nan:
- btstb #6,FPTEMP_HI(%a6) //check if dest nan is an snan
- bnes issrc //no, so check source for snan
- movew FPTEMP_EX(%a6),%d0
- bras cont
-issrc:
- movew ETEMP_EX(%a6),%d0
-cont:
- btstl #15,%d0 //test for sign of snan
- beqs clr_neg
- bsetb #neg_bit,FPSR_CC(%a6)
- bra report_snan
-clr_neg:
- bclrb #neg_bit,FPSR_CC(%a6)
- bra report_snan
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/x_store.s b/c/src/lib/libcpu/m68k/m68040/fpsp/x_store.s
deleted file mode 100644
index 081b2cc2ca..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/x_store.s
+++ /dev/null
@@ -1,258 +0,0 @@
-//
-// $Id$
-//
-// x_store.sa 3.2 1/24/91
-//
-// store --- store operand to memory or register
-//
-// Used by underflow and overflow handlers.
-//
-// a6 = points to fp value to be stored.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-X_STORE: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-fpreg_mask:
- .byte 0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01
-
-#include "fpsp.defs"
-
- |xref mem_write
- |xref get_fline
- |xref g_opcls
- |xref g_dfmtou
- |xref reg_dest
-
- .global dest_ext
- .global dest_dbl
- .global dest_sgl
-
- .global store
-store:
- btstb #E3,E_BYTE(%a6)
- beqs E1_sto
-E3_sto:
- movel CMDREG3B(%a6),%d0
- bfextu %d0{#6:#3},%d0 //isolate dest. reg from cmdreg3b
-sto_fp:
- lea fpreg_mask,%a1
- moveb (%a1,%d0.w),%d0 //convert reg# to dynamic register mask
- tstb LOCAL_SGN(%a0)
- beqs is_pos
- bsetb #sign_bit,LOCAL_EX(%a0)
-is_pos:
- fmovemx (%a0),%d0 //move to correct register
-//
-// if fp0-fp3 is being modified, we must put a copy
-// in the USER_FPn variable on the stack because all exception
-// handlers restore fp0-fp3 from there.
-//
- cmpb #0x80,%d0
- bnes not_fp0
- fmovemx %fp0-%fp0,USER_FP0(%a6)
- rts
-not_fp0:
- cmpb #0x40,%d0
- bnes not_fp1
- fmovemx %fp1-%fp1,USER_FP1(%a6)
- rts
-not_fp1:
- cmpb #0x20,%d0
- bnes not_fp2
- fmovemx %fp2-%fp2,USER_FP2(%a6)
- rts
-not_fp2:
- cmpb #0x10,%d0
- bnes not_fp3
- fmovemx %fp3-%fp3,USER_FP3(%a6)
- rts
-not_fp3:
- rts
-
-E1_sto:
- bsrl g_opcls //returns opclass in d0
- cmpib #3,%d0
- beq opc011 //branch if opclass 3
- movel CMDREG1B(%a6),%d0
- bfextu %d0{#6:#3},%d0 //extract destination register
- bras sto_fp
-
-opc011:
- bsrl g_dfmtou //returns dest format in d0
-// ;ext=00, sgl=01, dbl=10
- movel %a0,%a1 //save source addr in a1
- movel EXC_EA(%a6),%a0 //get the address
- cmpil #0,%d0 //if dest format is extended
- beq dest_ext //then branch
- cmpil #1,%d0 //if dest format is single
- beqs dest_sgl //then branch
-//
-// fall through to dest_dbl
-//
-
-//
-// dest_dbl --- write double precision value to user space
-//
-//Input
-// a0 -> destination address
-// a1 -> source in extended precision
-//Output
-// a0 -> destroyed
-// a1 -> destroyed
-// d0 -> 0
-//
-//Changes extended precision to double precision.
-// Note: no attempt is made to round the extended value to double.
-// dbl_sign = ext_sign
-// dbl_exp = ext_exp - $3fff(ext bias) + $7ff(dbl bias)
-// get rid of ext integer bit
-// dbl_mant = ext_mant{62:12}
-//
-// --------------- --------------- ---------------
-// extended -> |s| exp | |1| ms mant | | ls mant |
-// --------------- --------------- ---------------
-// 95 64 63 62 32 31 11 0
-// | |
-// | |
-// | |
-// v v
-// --------------- ---------------
-// double -> |s|exp| mant | | mant |
-// --------------- ---------------
-// 63 51 32 31 0
-//
-dest_dbl:
- clrl %d0 //clear d0
- movew LOCAL_EX(%a1),%d0 //get exponent
- subw #0x3fff,%d0 //subtract extended precision bias
- cmpw #0x4000,%d0 //check if inf
- beqs inf //if so, special case
- addw #0x3ff,%d0 //add double precision bias
- swap %d0 //d0 now in upper word
- lsll #4,%d0 //d0 now in proper place for dbl prec exp
- tstb LOCAL_SGN(%a1)
- beqs get_mant //if positive, go process mantissa
- bsetl #31,%d0 //if negative, put in sign information
-// ; before continuing
- bras get_mant //go process mantissa
-inf:
- movel #0x7ff00000,%d0 //load dbl inf exponent
- clrl LOCAL_HI(%a1) //clear msb
- tstb LOCAL_SGN(%a1)
- beqs dbl_inf //if positive, go ahead and write it
- bsetl #31,%d0 //if negative put in sign information
-dbl_inf:
- movel %d0,LOCAL_EX(%a1) //put the new exp back on the stack
- bras dbl_wrt
-get_mant:
- movel LOCAL_HI(%a1),%d1 //get ms mantissa
- bfextu %d1{#1:#20},%d1 //get upper 20 bits of ms
- orl %d1,%d0 //put these bits in ms word of double
- movel %d0,LOCAL_EX(%a1) //put the new exp back on the stack
- movel LOCAL_HI(%a1),%d1 //get ms mantissa
- movel #21,%d0 //load shift count
- lsll %d0,%d1 //put lower 11 bits in upper bits
- movel %d1,LOCAL_HI(%a1) //build lower lword in memory
- movel LOCAL_LO(%a1),%d1 //get ls mantissa
- bfextu %d1{#0:#21},%d0 //get ls 21 bits of double
- orl %d0,LOCAL_HI(%a1) //put them in double result
-dbl_wrt:
- movel #0x8,%d0 //byte count for double precision number
- exg %a0,%a1 //a0=supervisor source, a1=user dest
- bsrl mem_write //move the number to the user's memory
- rts
-//
-// dest_sgl --- write single precision value to user space
-//
-//Input
-// a0 -> destination address
-// a1 -> source in extended precision
-//
-//Output
-// a0 -> destroyed
-// a1 -> destroyed
-// d0 -> 0
-//
-//Changes extended precision to single precision.
-// sgl_sign = ext_sign
-// sgl_exp = ext_exp - $3fff(ext bias) + $7f(sgl bias)
-// get rid of ext integer bit
-// sgl_mant = ext_mant{62:12}
-//
-// --------------- --------------- ---------------
-// extended -> |s| exp | |1| ms mant | | ls mant |
-// --------------- --------------- ---------------
-// 95 64 63 62 40 32 31 12 0
-// | |
-// | |
-// | |
-// v v
-// ---------------
-// single -> |s|exp| mant |
-// ---------------
-// 31 22 0
-//
-dest_sgl:
- clrl %d0
- movew LOCAL_EX(%a1),%d0 //get exponent
- subw #0x3fff,%d0 //subtract extended precision bias
- cmpw #0x4000,%d0 //check if inf
- beqs sinf //if so, special case
- addw #0x7f,%d0 //add single precision bias
- swap %d0 //put exp in upper word of d0
- lsll #7,%d0 //shift it into single exp bits
- tstb LOCAL_SGN(%a1)
- beqs get_sman //if positive, continue
- bsetl #31,%d0 //if negative, put in sign first
- bras get_sman //get mantissa
-sinf:
- movel #0x7f800000,%d0 //load single inf exp to d0
- tstb LOCAL_SGN(%a1)
- beqs sgl_wrt //if positive, continue
- bsetl #31,%d0 //if negative, put in sign info
- bras sgl_wrt
-
-get_sman:
- movel LOCAL_HI(%a1),%d1 //get ms mantissa
- bfextu %d1{#1:#23},%d1 //get upper 23 bits of ms
- orl %d1,%d0 //put these bits in ms word of single
-
-sgl_wrt:
- movel %d0,L_SCR1(%a6) //put the new exp back on the stack
- movel #0x4,%d0 //byte count for single precision number
- tstl %a0 //users destination address
- beqs sgl_Dn //destination is a data register
- exg %a0,%a1 //a0=supervisor source, a1=user dest
- leal L_SCR1(%a6),%a0 //point a0 to data
- bsrl mem_write //move the number to the user's memory
- rts
-sgl_Dn:
- bsrl get_fline //returns fline word in d0
- andw #0x7,%d0 //isolate register number
- movel %d0,%d1 //d1 has size:reg formatted for reg_dest
- orl #0x10,%d1 //reg_dest wants size added to reg#
- bral reg_dest //size is X, rts in reg_dest will
-// ;return to caller of dest_sgl
-
-dest_ext:
- tstb LOCAL_SGN(%a1) //put back sign into exponent word
- beqs dstx_cont
- bsetb #sign_bit,LOCAL_EX(%a1)
-dstx_cont:
- clrb LOCAL_SGN(%a1) //clear out the sign byte
-
- movel #0x0c,%d0 //byte count for extended number
- exg %a0,%a1 //a0=supervisor source, a1=user dest
- bsrl mem_write //move the number to the user's memory
- rts
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/x_unfl.s b/c/src/lib/libcpu/m68k/m68040/fpsp/x_unfl.s
deleted file mode 100644
index 3a8d481dd7..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/x_unfl.s
+++ /dev/null
@@ -1,271 +0,0 @@
-//
-// $Id$
-//
-// x_unfl.sa 3.4 7/1/91
-//
-// fpsp_unfl --- FPSP handler for underflow exception
-//
-// Trap disabled results
-// For 881/2 compatibility, sw must denormalize the intermediate
-// result, then store the result. Denormalization is accomplished
-// by taking the intermediate result (which is always normalized) and
-// shifting the mantissa right while incrementing the exponent until
-// it is equal to the denormalized exponent for the destination
-// format. After denormalization, the result is rounded to the
-// destination format.
-//
-// Trap enabled results
-// All trap disabled code applies. In addition the exceptional
-// operand needs to made available to the user with a bias of $6000
-// added to the exponent.
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-X_UNFL: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref denorm
- |xref round
- |xref store
- |xref g_rndpr
- |xref g_opcls
- |xref g_dfmtou
- |xref real_unfl
- |xref real_inex
- |xref fpsp_done
- |xref b1238_fix
-
- .global fpsp_unfl
-fpsp_unfl:
- link %a6,#-LOCAL_SIZE
- fsave -(%a7)
- moveml %d0-%d1/%a0-%a1,USER_DA(%a6)
- fmovemx %fp0-%fp3,USER_FP0(%a6)
- fmoveml %fpcr/%fpsr/%fpiar,USER_FPCR(%a6)
-
-//
- bsrl unf_res //denormalize, round & store interm op
-//
-// If underflow exceptions are not enabled, check for inexact
-// exception
-//
- btstb #unfl_bit,FPCR_ENABLE(%a6)
- beqs ck_inex
-
- btstb #E3,E_BYTE(%a6)
- beqs no_e3_1
-//
-// Clear dirty bit on dest resister in the frame before branching
-// to b1238_fix.
-//
- bfextu CMDREG3B(%a6){#6:#3},%d0 //get dest reg no
- bclrb %d0,FPR_DIRTY_BITS(%a6) //clr dest dirty bit
- bsrl b1238_fix //test for bug1238 case
- movel USER_FPSR(%a6),FPSR_SHADOW(%a6)
- orl #sx_mask,E_BYTE(%a6)
-no_e3_1:
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- frestore (%a7)+
- unlk %a6
- bral real_unfl
-//
-// It is possible to have either inex2 or inex1 exceptions with the
-// unfl. If the inex enable bit is set in the FPCR, and either
-// inex2 or inex1 occurred, we must clean up and branch to the
-// real inex handler.
-//
-ck_inex:
- moveb FPCR_ENABLE(%a6),%d0
- andb FPSR_EXCEPT(%a6),%d0
- andib #0x3,%d0
- beqs unfl_done
-
-//
-// Inexact enabled and reported, and we must take an inexact exception
-//
-take_inex:
- btstb #E3,E_BYTE(%a6)
- beqs no_e3_2
-//
-// Clear dirty bit on dest resister in the frame before branching
-// to b1238_fix.
-//
- bfextu CMDREG3B(%a6){#6:#3},%d0 //get dest reg no
- bclrb %d0,FPR_DIRTY_BITS(%a6) //clr dest dirty bit
- bsrl b1238_fix //test for bug1238 case
- movel USER_FPSR(%a6),FPSR_SHADOW(%a6)
- orl #sx_mask,E_BYTE(%a6)
-no_e3_2:
- moveb #INEX_VEC,EXC_VEC+1(%a6)
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- frestore (%a7)+
- unlk %a6
- bral real_inex
-
-unfl_done:
- bclrb #E3,E_BYTE(%a6)
- beqs e1_set //if set then branch
-//
-// Clear dirty bit on dest resister in the frame before branching
-// to b1238_fix.
-//
- bfextu CMDREG3B(%a6){#6:#3},%d0 //get dest reg no
- bclrb %d0,FPR_DIRTY_BITS(%a6) //clr dest dirty bit
- bsrl b1238_fix //test for bug1238 case
- movel USER_FPSR(%a6),FPSR_SHADOW(%a6)
- orl #sx_mask,E_BYTE(%a6)
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- frestore (%a7)+
- unlk %a6
- bral fpsp_done
-e1_set:
- moveml USER_DA(%a6),%d0-%d1/%a0-%a1
- fmovemx USER_FP0(%a6),%fp0-%fp3
- fmoveml USER_FPCR(%a6),%fpcr/%fpsr/%fpiar
- unlk %a6
- bral fpsp_done
-//
-// unf_res --- underflow result calculation
-//
-unf_res:
- bsrl g_rndpr //returns RND_PREC in d0 0=ext,
-// ;1=sgl, 2=dbl
-// ;we need the RND_PREC in the
-// ;upper word for round
- movew #0,-(%a7)
- movew %d0,-(%a7) //copy RND_PREC to stack
-//
-//
-// If the exception bit set is E3, the exceptional operand from the
-// fpu is in WBTEMP; else it is in FPTEMP.
-//
- btstb #E3,E_BYTE(%a6)
- beqs unf_E1
-unf_E3:
- lea WBTEMP(%a6),%a0 //a0 now points to operand
-//
-// Test for fsgldiv and fsglmul. If the inst was one of these, then
-// force the precision to extended for the denorm routine. Use
-// the user's precision for the round routine.
-//
- movew CMDREG3B(%a6),%d1 //check for fsgldiv or fsglmul
- andiw #0x7f,%d1
- cmpiw #0x30,%d1 //check for sgldiv
- beqs unf_sgl
- cmpiw #0x33,%d1 //check for sglmul
- bnes unf_cont //if not, use fpcr prec in round
-unf_sgl:
- clrl %d0
- movew #0x1,(%a7) //override g_rndpr precision
-// ;force single
- bras unf_cont
-unf_E1:
- lea FPTEMP(%a6),%a0 //a0 now points to operand
-unf_cont:
- bclrb #sign_bit,LOCAL_EX(%a0) //clear sign bit
- sne LOCAL_SGN(%a0) //store sign
-
- bsrl denorm //returns denorm, a0 points to it
-//
-// WARNING:
-// ;d0 has guard,round sticky bit
-// ;make sure that it is not corrupted
-// ;before it reaches the round subroutine
-// ;also ensure that a0 isn't corrupted
-
-//
-// Set up d1 for round subroutine d1 contains the PREC/MODE
-// information respectively on upper/lower register halves.
-//
- bfextu FPCR_MODE(%a6){#2:#2},%d1 //get mode from FPCR
-// ;mode in lower d1
- addl (%a7)+,%d1 //merge PREC/MODE
-//
-// WARNING: a0 and d0 are assumed to be intact between the denorm and
-// round subroutines. All code between these two subroutines
-// must not corrupt a0 and d0.
-//
-//
-// Perform Round
-// Input: a0 points to input operand
-// d0{31:29} has guard, round, sticky
-// d1{01:00} has rounding mode
-// d1{17:16} has rounding precision
-// Output: a0 points to rounded operand
-//
-
- bsrl round //returns rounded denorm at (a0)
-//
-// Differentiate between store to memory vs. store to register
-//
-unf_store:
- bsrl g_opcls //returns opclass in d0{2:0}
- cmpib #0x3,%d0
- bnes not_opc011
-//
-// At this point, a store to memory is pending
-//
-opc011:
- bsrl g_dfmtou
- tstb %d0
- beqs ext_opc011 //If extended, do not subtract
-// ;If destination format is sgl/dbl,
- tstb LOCAL_HI(%a0) //If rounded result is normal,don't
-// ;subtract
- bmis ext_opc011
- subqw #1,LOCAL_EX(%a0) //account for denorm bias vs.
-// ;normalized bias
-// ; normalized denormalized
-// ;single $7f $7e
-// ;double $3ff $3fe
-//
-ext_opc011:
- bsrl store //stores to memory
- bras unf_done //finish up
-
-//
-// At this point, a store to a float register is pending
-//
-not_opc011:
- bsrl store //stores to float register
-// ;a0 is not corrupted on a store to a
-// ;float register.
-//
-// Set the condition codes according to result
-//
- tstl LOCAL_HI(%a0) //check upper mantissa
- bnes ck_sgn
- tstl LOCAL_LO(%a0) //check lower mantissa
- bnes ck_sgn
- bsetb #z_bit,FPSR_CC(%a6) //set condition codes if zero
-ck_sgn:
- btstb #sign_bit,LOCAL_EX(%a0) //check the sign bit
- beqs unf_done
- bsetb #neg_bit,FPSR_CC(%a6)
-
-//
-// Finish.
-//
-unf_done:
- btstb #inex2_bit,FPSR_EXCEPT(%a6)
- beqs no_aunfl
- bsetb #aunfl_bit,FPSR_AEXCEPT(%a6)
-no_aunfl:
- rts
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/x_unimp.s b/c/src/lib/libcpu/m68k/m68040/fpsp/x_unimp.s
deleted file mode 100644
index 9bbca88c67..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/x_unimp.s
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// $Id$
-//
-// x_unimp.sa 3.3 7/1/91
-//
-// fpsp_unimp --- FPSP handler for unimplemented instruction
-// exception.
-//
-// Invoked when the user program encounters a floating-point
-// op-code that hardware does not support. Trap vector# 11
-// (See table 8-1 MC68030 User's Manual).
-//
-//
-// Note: An fsave for an unimplemented inst. will create a short
-// fsave stack.
-//
-// Input: 1. Six word stack frame for unimplemented inst, four word
-// for illegal
-// (See table 8-7 MC68030 User's Manual).
-// 2. Unimp (short) fsave state frame created here by fsave
-// instruction.
-//
-//
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-X_UNIMP: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref get_op
- |xref do_func
- |xref sto_res
- |xref gen_except
- |xref fpsp_fmt_error
-
- .global fpsp_unimp
- .global uni_2
-fpsp_unimp:
- link %a6,#-LOCAL_SIZE
- fsave -(%a7)
-uni_2:
- moveml %d0-%d1/%a0-%a1,USER_DA(%a6)
- fmovemx %fp0-%fp3,USER_FP0(%a6)
- fmoveml %fpcr/%fpsr/%fpiar,USER_FPCR(%a6)
- moveb (%a7),%d0 //test for valid version num
- andib #0xf0,%d0 //test for $4x
- cmpib #VER_4,%d0 //must be $4x or exit
- bnel fpsp_fmt_error
-//
-// Temporary D25B Fix
-// The following lines are used to ensure that the FPSR
-// exception byte and condition codes are clear before proceeding
-//
- movel USER_FPSR(%a6),%d0
- andl #0xFF00FF,%d0 //clear all but accrued exceptions
- movel %d0,USER_FPSR(%a6)
- fmovel #0,%FPSR //clear all user bits
- fmovel #0,%FPCR //clear all user exceptions for FPSP
-
- clrb UFLG_TMP(%a6) //clr flag for unsupp data
-
- bsrl get_op //go get operand(s)
- clrb STORE_FLG(%a6)
- bsrl do_func //do the function
- fsave -(%a7) //capture possible exc state
- tstb STORE_FLG(%a6)
- bnes no_store //if STORE_FLG is set, no store
- bsrl sto_res //store the result in user space
-no_store:
- bral gen_except //post any exceptions and return
-
- |end
diff --git a/c/src/lib/libcpu/m68k/m68040/fpsp/x_unsupp.s b/c/src/lib/libcpu/m68k/m68040/fpsp/x_unsupp.s
deleted file mode 100644
index d1371d05f3..0000000000
--- a/c/src/lib/libcpu/m68k/m68040/fpsp/x_unsupp.s
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// $Id$
-//
-// x_unsupp.sa 3.3 7/1/91
-//
-// fpsp_unsupp --- FPSP handler for unsupported data type exception
-//
-// Trap vector #55 (See table 8-1 Mc68030 User's manual).
-// Invoked when the user program encounters a data format (packed) that
-// hardware does not support or a data type (denormalized numbers or un-
-// normalized numbers).
-// Normalizes denorms and unnorms, unpacks packed numbers then stores
-// them back into the machine to let the 040 finish the operation.
-//
-// Unsupp calls two routines:
-// 1. get_op - gets the operand(s)
-// 2. res_func - restore the function back into the 040 or
-// if fmove.p fpm,<ea> then pack source (fpm)
-// and store in users memory <ea>.
-//
-// Input: Long fsave stack frame
-//
-//
-
-// Copyright (C) Motorola, Inc. 1990
-// All Rights Reserved
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-
-X_UNSUPP: //idnt 2,1 | Motorola 040 Floating Point Software Package
-
- |section 8
-
-#include "fpsp.defs"
-
- |xref get_op
- |xref res_func
- |xref gen_except
- |xref fpsp_fmt_error
-
- .global fpsp_unsupp
-fpsp_unsupp:
-//
- link %a6,#-LOCAL_SIZE
- fsave -(%a7)
- moveml %d0-%d1/%a0-%a1,USER_DA(%a6)
- fmovemx %fp0-%fp3,USER_FP0(%a6)
- fmoveml %fpcr/%fpsr/%fpiar,USER_FPCR(%a6)
-
-
- moveb (%a7),VER_TMP(%a6) //save version number
- moveb (%a7),%d0 //test for valid version num
- andib #0xf0,%d0 //test for $4x
- cmpib #VER_4,%d0 //must be $4x or exit
- bnel fpsp_fmt_error
-
- fmovel #0,%FPSR //clear all user status bits
- fmovel #0,%FPCR //clear all user control bits
-//
-// The following lines are used to ensure that the FPSR
-// exception byte and condition codes are clear before proceeding,
-// except in the case of fmove, which leaves the cc's intact.
-//
-unsupp_con:
- movel USER_FPSR(%a6),%d1
- btst #5,CMDREG1B(%a6) //looking for fmove out
- bne fmove_con
- andl #0xFF00FF,%d1 //clear all but aexcs and qbyte
- bras end_fix
-fmove_con:
- andl #0x0FFF40FF,%d1 //clear all but cc's, snan bit, aexcs, and qbyte
-end_fix:
- movel %d1,USER_FPSR(%a6)
-
- st UFLG_TMP(%a6) //set flag for unsupp data
-
- bsrl get_op //everything okay, go get operand(s)
- bsrl res_func //fix up stack frame so can restore it
- clrl -(%a7)
- moveb VER_TMP(%a6),(%a7) //move idle fmt word to top of stack
- bral gen_except
-//
- |end
diff --git a/c/src/lib/libcpu/m68k/shared/misc/memcpy.c b/c/src/lib/libcpu/m68k/shared/misc/memcpy.c
deleted file mode 100644
index 3948411f4b..0000000000
--- a/c/src/lib/libcpu/m68k/shared/misc/memcpy.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * C library memcpy routine
- *
- * This routine has code to optimize performance on the CPU32+
- * and another version for other 68k machines.
- *
- * It could be optimized more for machines with MOVE16 instructions.
- *
- * The routine is placed in this source directory to ensure that it
- * is picked up by all applications.
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- */
-
-#include <string.h>
-#include <rtems/score/m68k.h>
-
-#if defined(__mcpu32__)
-#define COPYSETUP(n) n--
-#define COPY(to,from,n,size) \
- asm volatile ("1:\n" \
- "\tmove." size " (%0)+,(%1)+\n" \
- "\tdbf %2,1b\n" \
- "\tsub.l #0x10000,%2\n" \
- "\tbpl.b 1b\n" : \
- "=a" (from), "=a" (to), "=d" (n) :\
- "0" (from), "1" (to), "2" (n) : \
- "cc", "memory")
-#else
-#define COPYSETUP(n)
-#define COPY(to,from,n,size) \
- asm volatile ("1:\n" \
- "\tmove." size " (%0)+,(%1)+\n" \
- "\tsubq.l #1,%2\n\tbne.b 1b\n" : \
- "=a" (from), "=a" (to), "=d" (n) :\
- "0" (from), "1" (to), "2" (n) : \
- "cc", "memory")
-#endif
-
-void *
-memcpy(void *s1, const void *s2, size_t n)
-{
- char *p1 = s1;
- const char *p2 = s2;
-
- if (n) {
- if (n < 16) {
- COPYSETUP (n);
- COPY (p1, p2, n, "b");
- }
- else {
- int nbyte;
- int nl;
- nbyte = (int)p1 & 0x3;
- if (nbyte) {
- nbyte = 4 - nbyte;
- n -= nbyte;
- COPYSETUP (nbyte);
- COPY (p1, p2, nbyte, "b");
- }
-#if (M68K_HAS_MISALIGNED == 0)
- /*
- * Take care of machines that can't
- * handle misaligned references.
- */
- if ((int)p2 & 0x1) {
- COPYSETUP (n);
- COPY (p1, p2, n, "b");
- return s1;
- }
-#endif
- nl = (unsigned int)n >> 2;
- COPYSETUP (nl);
- COPY (p1, p2, nl, "l");
- nbyte = (int)n & 0x3;
- if (nbyte) {
- COPYSETUP (nbyte);
- COPY (p1, p2, nbyte, "b");
- }
- }
- }
- return s1;
-}
diff --git a/c/src/lib/libcpu/mips/clock/ckinit.c b/c/src/lib/libcpu/mips/clock/ckinit.c
deleted file mode 100644
index 60b3187223..0000000000
--- a/c/src/lib/libcpu/mips/clock/ckinit.c
+++ /dev/null
@@ -1,249 +0,0 @@
-
-/* ckinit.c
- *
- * This file contains the clock driver initialization for the IDT 4650.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)ckinit.c 08/20/96 1.3\n";
- */
-
-
-#include <stdlib.h>
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <bsp.h>
-
-#define EXT_INT5 0x8000 /* external interrupt 5 */
-
-#include "clock.h"
-
-#define CLOCKS_PER_MICROSECOND ( CPU_CLOCK_RATE_MHZ ) /* equivalent to CPU clock speed in MHz */
-
-void Clock_exit( void );
-rtems_isr Clock_isr( rtems_vector_number vector );
-
-
-/*
- * The interrupt vector number associated with the clock tick device
- * driver.
- */
-
-#define CLOCK_VECTOR_MASK EXT_INT5
-#define CLOCK_VECTOR 0x7
-
-/*
- * Clock_driver_ticks is a monotonically increasing counter of the
- * number of clock ticks since the driver was initialized.
- */
-
-volatile rtems_unsigned32 Clock_driver_ticks;
-
-/*
- * Clock_isrs is the number of clock ISRs until the next invocation of
- * the RTEMS clock tick routine. The clock tick device driver
- * gets an interrupt once a millisecond and counts down until the
- * length of time between the user configured microseconds per tick
- * has passed.
- */
-
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-/*
- * The previous ISR on this clock tick interrupt vector.
- */
-
-rtems_isr_entry Old_ticker;
-
-void Clock_exit( void );
-
-static unsigned32 mips_timer_rate = 0;
-
-/*
- * Isr Handler
- */
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
-/*
- * bump the number of clock driver ticks since initialization
- *
- * determine if it is time to announce the passing of tick as configured
- * to RTEMS through the rtems_clock_tick directive
- *
- * perform any timer dependent tasks
- */
-
- /* refresh the internal CPU timer */
- mips_set_timer( mips_timer_rate );
-
- Clock_driver_ticks += 1;
-
- rtems_clock_tick();
-}
-
-/* User callback shell (set from Clock_Control) */
-static void (*user_callback)(void);
-
-rtems_isr User_Clock_isr(
- rtems_vector_number vector
-)
-{
- /* refresh the internal CPU timer */
- mips_set_timer( mips_timer_rate );
-
- if (user_callback)
- user_callback();
-}
-
-/*
- * Install_clock
- *
- * Install a clock tick handleR and reprograms the chip. This
- * is used to initially establish the clock tick.
- */
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
- /*
- * Initialize the clock tick device driver variables
- */
-
- Clock_driver_ticks = 0;
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
-
- /*
- * If ticks_per_timeslice is configured as non-zero, then the user
- * wants a clock tick.
- */
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
- /*
- * Hardware specific initialize goes here
- */
-
- mips_timer_rate = BSP_Configuration.microseconds_per_tick * CLOCKS_PER_MICROSECOND;
- mips_set_timer( mips_timer_rate );
- enable_int(CLOCK_VECTOR_MASK);
- }
-
- /*
- * Schedule the clock cleanup routine to execute if the application exits.
- */
-
- atexit( Clock_exit );
-}
-
-/*
- * Clean up before the application exits
- */
-
-void Clock_exit( void )
-{
- if ( BSP_Configuration.ticks_per_timeslice ) {
-
- /* mips: turn off the timer interrupts */
- disable_int(CLOCK_VECTOR_MASK);
-
- }
-}
-
-/*
- * Clock_initialize
- *
- * Device driver entry point for clock tick driver initialization.
- */
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- user_callback = (void (*)(void))args->buffer;
- (void) set_vector( User_Clock_isr, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libcpu/mips/clock/clock.S b/c/src/lib/libcpu/mips/clock/clock.S
deleted file mode 100644
index ec0280f494..0000000000
--- a/c/src/lib/libcpu/mips/clock/clock.S
+++ /dev/null
@@ -1,45 +0,0 @@
-/* clock.s
- *
- * This file contains the assembly code for the IDT 4650 clock driver.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * $Id$
- */
-/* @(#)clock.S 08/20/96 1.2 */
-
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtcpu.h>
-#include <rtems/score/idtmon.h>
-
-FRAME(mips_set_timer,sp,0,ra)
- .set noreorder
- mfc0 t0,C0_COUNT
- nop
- addu t0,a0,t0
- mtc0 t0,C0_COMPARE
- nop
- j ra
- .set reorder
-ENDFRAME(mips_set_timer)
-
-FRAME(mips_get_timer,sp,0,ra)
- .set noreorder
- mfc0 v0,C0_COUNT
- nop
- j ra
- .set reorder
-ENDFRAME(mips_get_timer)
diff --git a/c/src/lib/libcpu/mips/clock/clock.h b/c/src/lib/libcpu/mips/clock/clock.h
deleted file mode 100644
index a14304f668..0000000000
--- a/c/src/lib/libcpu/mips/clock/clock.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* clock.s
- *
- * This file contains the assembly code for the IDT 4650 clock driver.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * $Id$
- */
-
-/* @(#)clock.h 08/20/96 1.2 */
-
-extern void mips_set_timer( unsigned32 timer_clock_interval );
diff --git a/c/src/lib/libcpu/mips/timer/gettime.S b/c/src/lib/libcpu/mips/timer/gettime.S
deleted file mode 100644
index a00f2d5819..0000000000
--- a/c/src/lib/libcpu/mips/timer/gettime.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* gettime.s
- *
- * This file contains the assembly code for the IDT 4650 timer driver.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * $Id$
- */
-
-/* @(#)gettime.S 08/20/96 1.2 */
-
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtcpu.h>
-#include <rtems/score/idtmon.h>
-
-FRAME(mips_read_timer,sp,0,ra)
- .set noreorder
- mfc0 v0,C0_COUNT
- nop
- j ra
- .set reorder
-ENDFRAME(mips_read_timer)
diff --git a/c/src/lib/libcpu/mips/timer/timer.c b/c/src/lib/libcpu/mips/timer/timer.c
deleted file mode 100644
index 167a9b3804..0000000000
--- a/c/src/lib/libcpu/mips/timer/timer.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* timer.c
- *
- * This file contains the initialization code for the IDT 4650 timer driver.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * derived from src/lib/libbsp/no_cpu/no_bsp/timer/timer.c
- *
- * This file manages the benchmark timer used by the RTEMS Timing Test
- * Suite. Each measured time period is demarcated by calls to
- * Timer_initialize() and Read_timer(). Read_timer() usually returns
- * the number of microseconds since Timer_initialize() exitted.
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)timer.c 08/20/96 1.5\n";
- */
-
-
-#include <rtems.h>
-#include <bsp.h>
-
-#define CLOCKS_PER_MICROSECOND ( CPU_CLOCK_RATE_MHZ )
-#define TIMER_MAX_VALUE 0xffffffff
-
-extern unsigned32 mips_read_timer( void );
-
-static rtems_boolean Timer_driver_Find_average_overhead;
-static unsigned32 Timer_initial_value = 0;
-
-void Timer_initialize( void )
-{
- Timer_initial_value = mips_read_timer();
- /*
- * Somehow start the timer
- */
-
- /* Timer on 4650 is always running */
-}
-
-/*
- * The following controls the behavior of Read_timer().
- *
- * AVG_OVEREHAD is the overhead for starting and stopping the timer. It
- * is usually deducted from the number returned.
- *
- * LEAST_VALID is the lowest number this routine should trust. Numbers
- * below this are "noise" and zero is returned.
- */
-
-#define AVG_OVERHEAD 8 /* It typically takes X.X microseconds */
- /* (Y countdowns) to start/stop the timer. */
- /* This value is in cycles. */
-#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-
-int Read_timer( void )
-{
- unsigned64 clicks;
- unsigned32 total;
-
- /*
- * Read the timer and see how many clicks it has been since we started.
- */
-
- clicks = mips_read_timer(); /* XXX: read some HW here */
- if (clicks < Timer_initial_value)
- {
- clicks += TIMER_MAX_VALUE;
- }
- clicks -= Timer_initial_value;
-
- /*
- * Total is calculated by taking into account the number of timer overflow
- * interrupts since the timer was initialized and clicks since the last
- * interrupts.
- */
-#if 0 /* leave total in number of cycles */
- total = clicks / CLOCKS_PER_MICROSECOND;
-#else
- total = clicks;
-#endif
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in # cycles units */
- else {
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
- /*
- * leave total in cycles
- */
- return (total - AVG_OVERHEAD);
- }
-}
-
-/*
- * Empty function call used in loops to measure basic cost of looping
- * in Timing Test Suite.
- */
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
-
diff --git a/c/src/lib/libcpu/mips64orion/Makefile.in b/c/src/lib/libcpu/mips64orion/Makefile.in
deleted file mode 100644
index 16fe4e3c14..0000000000
--- a/c/src/lib/libcpu/mips64orion/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=include clock timer
diff --git a/c/src/lib/libcpu/mips64orion/clock/Makefile.in b/c/src/lib/libcpu/mips64orion/clock/Makefile.in
deleted file mode 100644
index 229d5caec6..0000000000
--- a/c/src/lib/libcpu/mips64orion/clock/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=clock
-S_FILES=$(S_PIECES:%=%.S)
-S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/mips64orion/clock/ckinit.c b/c/src/lib/libcpu/mips64orion/clock/ckinit.c
deleted file mode 100644
index 60b3187223..0000000000
--- a/c/src/lib/libcpu/mips64orion/clock/ckinit.c
+++ /dev/null
@@ -1,249 +0,0 @@
-
-/* ckinit.c
- *
- * This file contains the clock driver initialization for the IDT 4650.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)ckinit.c 08/20/96 1.3\n";
- */
-
-
-#include <stdlib.h>
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <bsp.h>
-
-#define EXT_INT5 0x8000 /* external interrupt 5 */
-
-#include "clock.h"
-
-#define CLOCKS_PER_MICROSECOND ( CPU_CLOCK_RATE_MHZ ) /* equivalent to CPU clock speed in MHz */
-
-void Clock_exit( void );
-rtems_isr Clock_isr( rtems_vector_number vector );
-
-
-/*
- * The interrupt vector number associated with the clock tick device
- * driver.
- */
-
-#define CLOCK_VECTOR_MASK EXT_INT5
-#define CLOCK_VECTOR 0x7
-
-/*
- * Clock_driver_ticks is a monotonically increasing counter of the
- * number of clock ticks since the driver was initialized.
- */
-
-volatile rtems_unsigned32 Clock_driver_ticks;
-
-/*
- * Clock_isrs is the number of clock ISRs until the next invocation of
- * the RTEMS clock tick routine. The clock tick device driver
- * gets an interrupt once a millisecond and counts down until the
- * length of time between the user configured microseconds per tick
- * has passed.
- */
-
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-/*
- * The previous ISR on this clock tick interrupt vector.
- */
-
-rtems_isr_entry Old_ticker;
-
-void Clock_exit( void );
-
-static unsigned32 mips_timer_rate = 0;
-
-/*
- * Isr Handler
- */
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
-/*
- * bump the number of clock driver ticks since initialization
- *
- * determine if it is time to announce the passing of tick as configured
- * to RTEMS through the rtems_clock_tick directive
- *
- * perform any timer dependent tasks
- */
-
- /* refresh the internal CPU timer */
- mips_set_timer( mips_timer_rate );
-
- Clock_driver_ticks += 1;
-
- rtems_clock_tick();
-}
-
-/* User callback shell (set from Clock_Control) */
-static void (*user_callback)(void);
-
-rtems_isr User_Clock_isr(
- rtems_vector_number vector
-)
-{
- /* refresh the internal CPU timer */
- mips_set_timer( mips_timer_rate );
-
- if (user_callback)
- user_callback();
-}
-
-/*
- * Install_clock
- *
- * Install a clock tick handleR and reprograms the chip. This
- * is used to initially establish the clock tick.
- */
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
- /*
- * Initialize the clock tick device driver variables
- */
-
- Clock_driver_ticks = 0;
- Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
-
- /*
- * If ticks_per_timeslice is configured as non-zero, then the user
- * wants a clock tick.
- */
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
- /*
- * Hardware specific initialize goes here
- */
-
- mips_timer_rate = BSP_Configuration.microseconds_per_tick * CLOCKS_PER_MICROSECOND;
- mips_set_timer( mips_timer_rate );
- enable_int(CLOCK_VECTOR_MASK);
- }
-
- /*
- * Schedule the clock cleanup routine to execute if the application exits.
- */
-
- atexit( Clock_exit );
-}
-
-/*
- * Clean up before the application exits
- */
-
-void Clock_exit( void )
-{
- if ( BSP_Configuration.ticks_per_timeslice ) {
-
- /* mips: turn off the timer interrupts */
- disable_int(CLOCK_VECTOR_MASK);
-
- }
-}
-
-/*
- * Clock_initialize
- *
- * Device driver entry point for clock tick driver initialization.
- */
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_interrupt_disable( isrlevel );
- user_callback = (void (*)(void))args->buffer;
- (void) set_vector( User_Clock_isr, CLOCK_VECTOR, 1 );
- rtems_interrupt_enable( isrlevel );
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libcpu/mips64orion/clock/clock.S b/c/src/lib/libcpu/mips64orion/clock/clock.S
deleted file mode 100644
index ec0280f494..0000000000
--- a/c/src/lib/libcpu/mips64orion/clock/clock.S
+++ /dev/null
@@ -1,45 +0,0 @@
-/* clock.s
- *
- * This file contains the assembly code for the IDT 4650 clock driver.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * $Id$
- */
-/* @(#)clock.S 08/20/96 1.2 */
-
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtcpu.h>
-#include <rtems/score/idtmon.h>
-
-FRAME(mips_set_timer,sp,0,ra)
- .set noreorder
- mfc0 t0,C0_COUNT
- nop
- addu t0,a0,t0
- mtc0 t0,C0_COMPARE
- nop
- j ra
- .set reorder
-ENDFRAME(mips_set_timer)
-
-FRAME(mips_get_timer,sp,0,ra)
- .set noreorder
- mfc0 v0,C0_COUNT
- nop
- j ra
- .set reorder
-ENDFRAME(mips_get_timer)
diff --git a/c/src/lib/libcpu/mips64orion/clock/clock.h b/c/src/lib/libcpu/mips64orion/clock/clock.h
deleted file mode 100644
index a14304f668..0000000000
--- a/c/src/lib/libcpu/mips64orion/clock/clock.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* clock.s
- *
- * This file contains the assembly code for the IDT 4650 clock driver.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * $Id$
- */
-
-/* @(#)clock.h 08/20/96 1.2 */
-
-extern void mips_set_timer( unsigned32 timer_clock_interval );
diff --git a/c/src/lib/libcpu/mips64orion/include/Makefile.in b/c/src/lib/libcpu/mips64orion/include/Makefile.in
deleted file mode 100644
index c89f2f52c8..0000000000
--- a/c/src/lib/libcpu/mips64orion/include/Makefile.in
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# $Id$
-#
-# Install any include files needed by libcpu.
-# Mainly this just means bsp.h which would normally be installed
-# after libcpu is built.
-# This is a bit of a hack.
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-all: FORCEIT
- cd ../../../libbsp/$(RTEMS_CPU)/$(RTEMS_BSP_FAMILY)/include; $(MAKE) all
-
-
diff --git a/c/src/lib/libcpu/mips64orion/timer/Makefile.in b/c/src/lib/libcpu/mips64orion/timer/Makefile.in
deleted file mode 100644
index b919779ab4..0000000000
--- a/c/src/lib/libcpu/mips64orion/timer/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# NOTE: timerisr is normally an assembly file!!!
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=gettime
-S_FILES=$(S_PIECES:%=%.S)
-S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/mips64orion/timer/gettime.S b/c/src/lib/libcpu/mips64orion/timer/gettime.S
deleted file mode 100644
index a00f2d5819..0000000000
--- a/c/src/lib/libcpu/mips64orion/timer/gettime.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* gettime.s
- *
- * This file contains the assembly code for the IDT 4650 timer driver.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * $Id$
- */
-
-/* @(#)gettime.S 08/20/96 1.2 */
-
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtcpu.h>
-#include <rtems/score/idtmon.h>
-
-FRAME(mips_read_timer,sp,0,ra)
- .set noreorder
- mfc0 v0,C0_COUNT
- nop
- j ra
- .set reorder
-ENDFRAME(mips_read_timer)
diff --git a/c/src/lib/libcpu/mips64orion/timer/timer.c b/c/src/lib/libcpu/mips64orion/timer/timer.c
deleted file mode 100644
index 167a9b3804..0000000000
--- a/c/src/lib/libcpu/mips64orion/timer/timer.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* timer.c
- *
- * This file contains the initialization code for the IDT 4650 timer driver.
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * derived from src/lib/libbsp/no_cpu/no_bsp/timer/timer.c
- *
- * This file manages the benchmark timer used by the RTEMS Timing Test
- * Suite. Each measured time period is demarcated by calls to
- * Timer_initialize() and Read_timer(). Read_timer() usually returns
- * the number of microseconds since Timer_initialize() exitted.
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)timer.c 08/20/96 1.5\n";
- */
-
-
-#include <rtems.h>
-#include <bsp.h>
-
-#define CLOCKS_PER_MICROSECOND ( CPU_CLOCK_RATE_MHZ )
-#define TIMER_MAX_VALUE 0xffffffff
-
-extern unsigned32 mips_read_timer( void );
-
-static rtems_boolean Timer_driver_Find_average_overhead;
-static unsigned32 Timer_initial_value = 0;
-
-void Timer_initialize( void )
-{
- Timer_initial_value = mips_read_timer();
- /*
- * Somehow start the timer
- */
-
- /* Timer on 4650 is always running */
-}
-
-/*
- * The following controls the behavior of Read_timer().
- *
- * AVG_OVEREHAD is the overhead for starting and stopping the timer. It
- * is usually deducted from the number returned.
- *
- * LEAST_VALID is the lowest number this routine should trust. Numbers
- * below this are "noise" and zero is returned.
- */
-
-#define AVG_OVERHEAD 8 /* It typically takes X.X microseconds */
- /* (Y countdowns) to start/stop the timer. */
- /* This value is in cycles. */
-#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-
-int Read_timer( void )
-{
- unsigned64 clicks;
- unsigned32 total;
-
- /*
- * Read the timer and see how many clicks it has been since we started.
- */
-
- clicks = mips_read_timer(); /* XXX: read some HW here */
- if (clicks < Timer_initial_value)
- {
- clicks += TIMER_MAX_VALUE;
- }
- clicks -= Timer_initial_value;
-
- /*
- * Total is calculated by taking into account the number of timer overflow
- * interrupts since the timer was initialized and clicks since the last
- * interrupts.
- */
-#if 0 /* leave total in number of cycles */
- total = clicks / CLOCKS_PER_MICROSECOND;
-#else
- total = clicks;
-#endif
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in # cycles units */
- else {
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
- /*
- * leave total in cycles
- */
- return (total - AVG_OVERHEAD);
- }
-}
-
-/*
- * Empty function call used in loops to measure basic cost of looping
- * in Timing Test Suite.
- */
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
-
diff --git a/c/src/lib/libcpu/powerpc/Makefile.in b/c/src/lib/libcpu/powerpc/Makefile.in
deleted file mode 100644
index be2ceb4dee..0000000000
--- a/c/src/lib/libcpu/powerpc/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=$(wildcard $(RTEMS_CPU_MODEL))
diff --git a/c/src/lib/libcpu/powerpc/README b/c/src/lib/libcpu/powerpc/README
deleted file mode 100644
index 32e4aed60c..0000000000
--- a/c/src/lib/libcpu/powerpc/README
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-
-This hierarchy contains support routines for the various
-PowerPC processors.
-
-Since these routines can differ amongst different members
-of the PowerPC family, an entry per CPU type is provided.
-
-Currently only the PPC403 is supported.
-
-Andrew Bray 4/December/1995
diff --git a/c/src/lib/libcpu/powerpc/ppc403/Makefile.in b/c/src/lib/libcpu/powerpc/ppc403/Makefile.in
deleted file mode 100644
index a58384c787..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=include console clock timer vectors ictrl
diff --git a/c/src/lib/libcpu/powerpc/ppc403/README b/c/src/lib/libcpu/powerpc/ppc403/README
deleted file mode 100644
index 528506d3dd..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/README
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# $Id$
-#
-
-Various non BSP dependant support routines.
-
-clock - Uses the 403 PIT (Programmable interval timer) to
- generate RTEMS clock ticks.
-
-console - Uses the 403 Internal serial port to do RTEMS
- console I/O. Not ALL members of the 403 family
- have this.
-
-include - Currently empty
-
-timer - Uses the 403 timebase register for timing
- tests. Other PowerPCs have slightly different
- timebase register definitions.
-
-vectors - PowerPC 403 specific vector entry points.
- Includes CPU dependant, application independant
- handlers: alignment.
diff --git a/c/src/lib/libcpu/powerpc/ppc403/clock/Makefile.in b/c/src/lib/libcpu/powerpc/ppc403/clock/Makefile.in
deleted file mode 100644
index 7b299d4ef0..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/clock/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=clock
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by
-# libbsp/hppa/BSP/wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c b/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
deleted file mode 100644
index 99b538dcd3..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
+++ /dev/null
@@ -1,282 +0,0 @@
-/* clock.c
- *
- * This routine initializes the interval timer on the
- * PowerPC 403 CPU. The tick frequency is specified by the bsp.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/lib/libcpu/hppa1.1/clock/clock.c:
- *
- * Modifications for deriving timer clock from cpu system clock by
- * Thomas Doerfler <td@imd.m.isar.de>
- * for these modifications:
- * COPYRIGHT (c) 1997 by IMD, Puchheim, Germany.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <clockdrv.h>
-#include <rtems/libio.h>
-
-#include <stdlib.h> /* for atexit() */
-
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
-volatile rtems_unsigned32 Clock_driver_ticks;
-static rtems_unsigned32 pit_value, tick_time;
-static rtems_boolean auto_restart;
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-static inline rtems_unsigned32 get_itimer(void)
-{
- register rtems_unsigned32 rc;
-
- asm volatile ("mfspr %0, 0x3dd" : "=r" ((rc))); /* TBLO */
-
- return rc;
-}
-
-/*
- * ISR Handler
- */
-
-rtems_isr
-Clock_isr(rtems_vector_number vector)
-{
- if (!auto_restart)
- {
- rtems_unsigned32 clicks_til_next_interrupt;
- rtems_unsigned32 itimer_value;
-
- /*
- * setup for next interrupt; making sure the new value is reasonably
- * in the future.... in case we lost out on an interrupt somehow
- */
-
- itimer_value = get_itimer();
- tick_time += pit_value;
-
- /*
- * how far away is next interrupt *really*
- * It may be a long time; this subtraction works even if
- * Clock_clicks_interrupt < Clock_clicks_low_order via
- * the miracle of unsigned math.
- */
- clicks_til_next_interrupt = tick_time - itimer_value;
-
- /*
- * If it is too soon then bump it up.
- * This should only happen if CPU_HPPA_CLICKS_PER_TICK is too small.
- * But setting it low is useful for debug, so...
- */
-
- if (clicks_til_next_interrupt < 400)
- {
- tick_time = itimer_value + 1000;
- clicks_til_next_interrupt = 1000;
- /* XXX: count these! this should be rare */
- }
-
- /*
- * If it is too late, that means we missed the interrupt somehow.
- * Rather than wait 35-50s for a wrap, we just fudge it here.
- */
-
- if (clicks_til_next_interrupt > pit_value)
- {
- tick_time = itimer_value + 1000;
- clicks_til_next_interrupt = 1000;
- /* XXX: count these! this should never happen :-) */
- }
-
- asm volatile ("mtspr 0x3db, %0" :: "r"
- (clicks_til_next_interrupt)); /* PIT */
- }
-
- asm volatile ( "mtspr 0x3d8, %0" :: "r" (0x08000000)); /* TSR */
-
- Clock_driver_ticks++;
-
- rtems_clock_tick();
-}
-
-void Install_clock(rtems_isr_entry clock_isr)
-{
- rtems_isr_entry previous_isr;
- rtems_unsigned32 pvr, iocr;
-
- Clock_driver_ticks = 0;
-
- asm volatile ("mfdcr %0, 0xa0" : "=r" (iocr)); /* IOCR */
-
- if (Cpu_table.timer_internal_clock) {
- iocr &= ~4; /* timer clocked from system clock */
- }
- else {
- iocr |= 4; /* select external timer clock */
- }
-
- asm volatile ("mtdcr 0xa0, %0" : "=r" (iocr) : "0" (iocr)); /* IOCR */
-
- asm volatile ("mfspr %0, 0x11f" : "=r" ((pvr))); /* PVR */
-
- if (((pvr & 0xffff0000) >> 16) != 0x0020)
- return; /* Not a ppc403 */
-
- if ((pvr & 0xff00) == 0x0000) /* 403GA */
-#if 0 /* FIXME: in which processor versions will "autoload" work properly? */
- auto_restart = (pvr & 0x00f0) > 0x0000 ? 1 : 0;
-#else
- /* no known chip version supports auto restart of timer... */
- auto_restart = 0;
-#endif
- else if ((pvr & 0xff00) == 0x0100) /* 403GB */
- auto_restart = 1;
-
- pit_value = BSP_Configuration.microseconds_per_tick *
- Cpu_table.clicks_per_usec;
-
- if (BSP_Configuration.ticks_per_timeslice)
- {
- register rtems_unsigned32 tcr;
-
- /*
- * initialize the interval here
- * First tick is set to right amount of time in the future
- * Future ticks will be incremented over last value set
- * in order to provide consistent clicks in the face of
- * interrupt overhead
- */
-
- rtems_interrupt_catch(clock_isr, PPC_IRQ_PIT, &previous_isr);
-
- asm volatile ("mtspr 0x3db, %0" : : "r" (pit_value)); /* PIT */
-
- asm volatile ("mfspr %0, 0x3da" : "=r" ((tcr))); /* TCR */
-
- tcr &= ~ 0x04400000;
-
- tcr |= (auto_restart ? 0x04400000 : 0x04000000);
-
- tick_time = get_itimer() + pit_value;
-
- asm volatile ("mtspr 0x3da, %0" : "=r" ((tcr)) : "0" ((tcr))); /* TCR */
- }
- atexit(Clock_exit);
-}
-
-void
-ReInstall_clock(rtems_isr_entry new_clock_isr)
-{
- rtems_isr_entry previous_isr;
- rtems_unsigned32 isrlevel = 0;
-
- rtems_interrupt_disable(isrlevel);
-
- rtems_interrupt_catch(new_clock_isr, PPC_IRQ_PIT, &previous_isr);
-
- rtems_interrupt_enable(isrlevel);
-}
-
-
-/*
- * Called via atexit()
- * Remove the clock interrupt handler by setting handler to NULL
- */
-
-void
-Clock_exit(void)
-{
- if ( BSP_Configuration.ticks_per_timeslice )
- {
- register rtems_unsigned32 tcr;
-
- asm volatile ("mfspr %0, 0x3da" : "=r" ((tcr))); /* TCR */
-
- tcr &= ~ 0x04400000;
-
- asm volatile ("mtspr 0x3da, %0" : "=r" ((tcr)) : "0" ((tcr))); /* TCR */
-
- (void) set_vector(0, PPC_IRQ_PIT, 1);
- }
-
-}
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args == 0)
- goto done;
-
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(PPC_IRQ_PIT);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- ReInstall_clock(args->buffer);
- }
-
-done:
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/Makefile.in b/c/src/lib/libcpu/powerpc/ppc403/console/Makefile.in
deleted file mode 100644
index b73d23df40..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/console/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console.c b/c/src/lib/libcpu/powerpc/ppc403/console/console.c
deleted file mode 100644
index 8d073b672b..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/console/console.c
+++ /dev/null
@@ -1,553 +0,0 @@
-/*
- * This file contains the PowerPC 403GA console IO package.
- *
- * Author: Thomas Doerfler <td@imd.m.isar.de>
- * IMD Ingenieurbuero fuer Microcomputertechnik
- *
- * COPYRIGHT (c) 1998 by IMD
- *
- * Changes from IMD are covered by the original distributions terms.
- * changes include interrupt support and termios support
- * for backward compatibility, the original polled driver has been
- * renamed to console.c.polled
- *
- * This file has been initially created (polled version) by
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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.
- *
- * Modifications for spooling (interrupt driven) console driver
- * by Thomas Doerfler <td@imd.m.isar.de>
- * for these modifications:
- * COPYRIGHT (c) 1997 by IMD, Puchheim, Germany.
- *
- * 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. IMD makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/lib/libbsp/no_cpu/no_bsp/console/console.c:
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
- * On-Line Applications Research Corporation (OAR).
- * All rights assigned to U.S. Government, 1994.
- *
- * This material may be reproduced by or for the U.S. Government pursuant
- * to the copyright license under the clause at DFARS 252.227-7013. This
- * notice must appear in all copies of this file and its derivatives.
- *
- * console.c,v 1.4 1995/12/05 19:23:02 joel Exp
- */
-
-#define NO_BSP_INIT
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include "../ictrl/ictrl.h"
-#include <stdlib.h> /* for atexit() */
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
-struct async {
-/*---------------------------------------------------------------------------+
-| Line Status Register.
-+---------------------------------------------------------------------------*/
- unsigned char SPLS;
- unsigned char SPLSset;
-#define LSRDataReady 0x80
-#define LSRFramingError 0x40
-#define LSROverrunError 0x20
-#define LSRParityError 0x10
-#define LSRBreakInterrupt 0x08
-#define LSRTxHoldEmpty 0x04
-#define LSRTxShiftEmpty 0x02
-
-/*---------------------------------------------------------------------------+
-| Handshake Status Register.
-+---------------------------------------------------------------------------*/
- unsigned char SPHS;
- unsigned char SPHSset;
-#define HSRDsr 0x80
-#define HSRCts 0x40
-
-/*---------------------------------------------------------------------------+
-| Baud rate divisor registers
-+---------------------------------------------------------------------------*/
- unsigned char BRDH;
- unsigned char BRDL;
-
-/*---------------------------------------------------------------------------+
-| Control Register.
-+---------------------------------------------------------------------------*/
- unsigned char SPCTL;
-#define CRNormal 0x00
-#define CRLoopback 0x40
-#define CRAutoEcho 0x80
-#define CRDtr 0x20
-#define CRRts 0x10
-#define CRWordLength7 0x00
-#define CRWordLength8 0x08
-#define CRParityDisable 0x00
-#define CRParityEnable 0x04
-#define CREvenParity 0x00
-#define CROddParity 0x02
-#define CRStopBitsOne 0x00
-#define CRStopBitsTwo 0x01
-#define CRDisableDtrRts 0x00
-
-/*--------------------------------------------------------------------------+
-| Receiver Command Register.
-+--------------------------------------------------------------------------*/
- unsigned char SPRC;
-#define RCRDisable 0x00
-#define RCREnable 0x80
-#define RCRIntDisable 0x00
-#define RCRIntEnabled 0x20
-#define RCRDMACh2 0x40
-#define RCRDMACh3 0x60
-#define RCRErrorInt 0x10
-#define RCRPauseEnable 0x08
-
-/*--------------------------------------------------------------------------+
-| Transmitter Command Register.
-+--------------------------------------------------------------------------*/
- unsigned char SPTC;
-#define TCRDisable 0x00
-#define TCREnable 0x80
-#define TCRIntDisable 0x00
-#define TCRIntEnabled 0x20
-#define TCRDMACh2 0x40
-#define TCRDMACh3 0x60
-#define TCRTxEmpty 0x10
-#define TCRErrorInt 0x08
-#define TCRStopPause 0x04
-#define TCRBreakGen 0x02
-
-/*--------------------------------------------------------------------------+
-| Miscellanies defines.
-+--------------------------------------------------------------------------*/
- unsigned char SPTB;
-#define SPRB SPTB
-};
-
-typedef volatile struct async *pasync;
-static const pasync port = (pasync)0x40000000;
-
-static void *spittyp; /* handle for termios */
-int ppc403_spi_interrupt = 1; /* do not use interrupts... */
-
-/*
- * Rx Interrupt handler
- */
-static rtems_isr
-spiRxInterruptHandler (rtems_vector_number v)
-{
- char ch;
-
- /* clear any receive errors (errors are ignored now) */
- port->SPLS = (LSRFramingError | LSROverrunError |
- LSRParityError | LSRBreakInterrupt);
- /*
- * Buffer received?
- */
- if (port->SPLS & LSRDataReady) {
- ch = port->SPRB; /* read receive buffer */
- rtems_termios_enqueue_raw_characters (spittyp,&ch,1);
- }
-}
-
-/*
- * Tx Interrupt handler
- */
-static rtems_isr
-spiTxInterruptHandler (rtems_vector_number v)
-{
- /*
- * char transmitted?
- */
- if (0 != (port->SPLS & LSRTxHoldEmpty)) { /* must always be true!! */
- port->SPTC &= ~TCRIntEnabled; /* stop irqs for now... */
- /* and call termios... */
- rtems_termios_dequeue_characters (spittyp,1);
- }
-}
-
-/*
- * enable/disable RTS line to start/stop remote transmitter
- */
-static int
-spiStartRemoteTx (int minor)
-{
- rtems_interrupt_level level;
-
- rtems_interrupt_disable (level);
- port->SPCTL |= CRRts; /* activate RTS */
- rtems_interrupt_enable (level);
- return 0;
-}
-
-static int
-spiStopRemoteTx (int minor)
-{
- rtems_interrupt_level level;
-
- rtems_interrupt_disable (level);
- port->SPCTL &= ~CRRts; /* deactivate RTS */
- rtems_interrupt_enable (level);
- return 0;
-}
-
-void
-spiBaudSet(unsigned32 baudrate)
-{
- unsigned32 tmp;
- tmp = Cpu_table.serial_per_sec / baudrate;
- tmp = ((tmp) >> 4) - 1;
- port->BRDL = tmp & 0xff;
- port->BRDH = tmp >> 8;
-
-}
-/*
- * Hardware-dependent portion of tcsetattr().
- */
-static int
-spiSetAttributes (int minor, const struct termios *t)
-{
- int baud;
-
- /* FIXME: check c_cflag & CRTSCTS for hardware flowcontrol */
- /* FIXME: check and IMPLEMENT XON/XOFF */
- switch (t->c_cflag & CBAUD) {
- default: baud = -1; break;
- case B50: baud = 50; break;
- case B75: baud = 75; break;
- case B110: baud = 110; break;
- case B134: baud = 134; break;
- case B150: baud = 150; break;
- case B200: baud = 200; break;
- case B300: baud = 300; break;
- case B600: baud = 600; break;
- case B1200: baud = 1200; break;
- case B1800: baud = 1800; break;
- case B2400: baud = 2400; break;
- case B4800: baud = 4800; break;
- case B9600: baud = 9600; break;
- case B19200: baud = 19200; break;
- case B38400: baud = 38400; break;
- case B57600: baud = 57600; break;
- case B115200: baud = 115200; break;
- case B230400: baud = 230400; break;
- case B460800: baud = 460800; break;
- }
- if (baud > 0) {
- spiBaudSet(baud);
- }
- return 0;
-}
-
-static int
-spiPollRead (int minor)
-{
- unsigned char status;
-
- while (0 == ((status = port->SPLS) & LSRDataReady)) {
- /* Clean any dodgy status */
- if ((status & (LSRFramingError | LSROverrunError | LSRParityError |
- LSRBreakInterrupt)) != 0) {
- port->SPLS = (LSRFramingError | LSROverrunError | LSRParityError |
- LSRBreakInterrupt);
- }
- }
- return port->SPRB;
-}
-
-static int
-spiInterruptWrite (int minor, const char *buf, int len)
-{
- port->SPTB = *buf; /* write char to send */
- port->SPTC |= TCRIntEnabled; /* always enable tx interrupt */
- return 0;
-}
-
-static int
-spiPollWrite(int minor,const char *buf,int len)
-{
- unsigned char status;
-
- while (len-- > 0) {
- do {
- if (port->SPHS) {
- port->SPHS = (HSRDsr | HSRCts);
- }
- status = port->SPLS;
- } while (0 == (status & LSRTxHoldEmpty));
- port->SPTB = *buf++;
- }
- return 0;
-}
-
-/*
- *
- * deinit SPI
- *
- */
-void
-spiDeInit(void)
-{
- /*
- * disable interrupts for serial port
- * set it to state to work with polling boot monitor, if any...
- */
-
- /* set up baud rate to original state */
- spiBaudSet(Cpu_table.serial_rate);
-
- /* clear any receive (error) status */
- port->SPLS = (LSRDataReady | LSRFramingError | LSROverrunError |
- LSRParityError | LSRBreakInterrupt);
-
- /* set up port control: DTR/RTS active,8 bit,1 stop,no parity */
- port->SPCTL = (CRNormal |
- CRDtr | CRRts |
- CRWordLength8 | CRParityDisable | CRStopBitsOne);
-
- /* clear handshake status bits */
- port->SPHS = (HSRDsr | HSRCts);
-
- /* enable receiver/transmitter, no interrupts */
- port->SPRC = (RCREnable | RCRIntDisable);
- port->SPTC = (TCREnable | TCRIntDisable);
-
-}
-
-/*
- *
- * init SPI
- *
- */
-rtems_status_code
-spiInitialize(void)
-{
- register unsigned tmp;
- rtems_isr_entry previous_isr; /* this is a dummy */
-
- /*
- * Initialise the serial port
- */
-
- /*
- * select RTS/CTS hardware handshake lines,
- * select clock source
- */
- asm volatile ("mfdcr %0, 0xa0" : "=r" (tmp)); /* IOCR */
-
- tmp &= ~3;
- tmp |= (Cpu_table.serial_external_clock ? 2 : 0) | 1;
-
- asm volatile ("mtdcr 0xa0, %0" : "=r" (tmp) : "0" (tmp)); /* IOCR */
-
- /* clear any receive (error) status */
- port->SPLS = (LSRDataReady | LSRFramingError | LSROverrunError |
- LSRParityError | LSRBreakInterrupt);
-
- /* set up baud rate */
- spiBaudSet(Cpu_table.serial_rate);
-
- /* set up port control: DTR/RTS active,8 bit,1 stop,no parity */
- port->SPCTL = (CRNormal |
- CRDtr | CRRts |
- CRWordLength8 | CRParityDisable | CRStopBitsOne);
-
- /* clear handshake status bits */
- port->SPHS = (HSRDsr | HSRCts);
-
- if (ppc403_spi_interrupt) {
- /* add rx/tx isr to vector table */
- ictrl_set_vector(spiRxInterruptHandler,
- PPC_IRQ_EXT_SPIR,
- &previous_isr);
-
- ictrl_set_vector(spiTxInterruptHandler,
- PPC_IRQ_EXT_SPIT,
- &previous_isr);
-
- port->SPRC = (RCREnable | RCRIntEnabled | RCRErrorInt);
- port->SPTC = (TCREnable | TCRIntDisable); /* don't enable TxInt yet */
- }
- else {
- /* enable receiver/transmitter, no interrupts */
- port->SPRC = (RCREnable | RCRIntDisable);
- port->SPTC = (TCREnable | TCRIntDisable);
- }
-
- atexit(spiDeInit);
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- ***************
- * BOILERPLATE *
- ***************
- */
-
-/*
- * Reserve resources consumed by this driver
- */
-void console_reserve_resources(
- rtems_configuration_table *configuration
-)
-{
- rtems_termios_reserve_resources (configuration, 1);
-}
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
-
- /*
- * Set up TERMIOS
- */
- rtems_termios_initialize ();
-
- /*
- * Do device-specific initialization
- */
- spiInitialize ();
-
- /*
- * Register the device
- */
- status = rtems_io_register_name ("/dev/console", major, 0);
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (status);
- return RTEMS_SUCCESSFUL;
-}
-
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_status_code sc;
- static const rtems_termios_callbacks intrCallbacks = {
- NULL, /* firstOpen */
- NULL, /* lastClose */
- NULL, /* pollRead */
- spiInterruptWrite, /* write */
- spiSetAttributes, /* setAttributes */
- spiStopRemoteTx, /* stopRemoteTx */
- spiStartRemoteTx, /* startRemoteTx */
- 1 /* outputUsesInterrupts */
- };
-
- static const rtems_termios_callbacks pollCallbacks = {
- NULL, /* firstOpen */
- NULL, /* lastClose */
- spiPollRead, /* pollRead */
- spiPollWrite, /* write */
- spiSetAttributes, /* setAttributes */
- spiStopRemoteTx, /* stopRemoteTx */
- spiStartRemoteTx, /* startRemoteTx */
- 0 /* outputUsesInterrupts */
- };
-
- if (ppc403_spi_interrupt) {
- rtems_libio_open_close_args_t *args = arg;
-
- sc = rtems_termios_open (major, minor, arg, &intrCallbacks);
- spittyp = args->iop->data1;
- }
- else {
- sc = rtems_termios_open (major, minor, arg, &pollCallbacks);
- }
- return sc;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_close (arg);
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_read (arg);
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_write (arg);
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_ioctl (arg);
-}
-
diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled b/c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled
deleted file mode 100644
index a623dde95a..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- * This file contains the PowerPC 403GA console IO package.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/lib/libbsp/no_cpu/no_bsp/console/console.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 NO_BSP_INIT
-
-#include <bsp.h>
-#include <rtems/libio.h>
-
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
-struct async {
-/*-----------------------------------------------------------------------------+
-| Line Status Register.
-+-----------------------------------------------------------------------------*/
- unsigned char SPLS;
- unsigned char SPLSset;
-#define LSRDataReady 0x80
-#define LSRFramingError 0x40
-#define LSROverrunError 0x20
-#define LSRParityError 0x10
-#define LSRBreakInterrupt 0x08
-#define LSRTxHoldEmpty 0x04
-#define LSRTxShiftEmpty 0x02
-
-/*-----------------------------------------------------------------------------+
-| Handshake Status Register.
-+-----------------------------------------------------------------------------*/
- unsigned char SPHS;
- unsigned char SPHSset;
-#define HSRDsr 0x80
-#define HSRCts 0x40
-
-/*-----------------------------------------------------------------------------+
-| Baud rate divisor registers
-+-----------------------------------------------------------------------------*/
- unsigned char BRDH;
- unsigned char BRDL;
-
-/*-----------------------------------------------------------------------------+
-| Control Register.
-+-----------------------------------------------------------------------------*/
- unsigned char SPCTL;
-#define CRNormal 0x00
-#define CRLoopback 0x40
-#define CRAutoEcho 0x80
-#define CRDtr 0x20
-#define CRRts 0x10
-#define CRWordLength7 0x00
-#define CRWordLength8 0x08
-#define CRParityDisable 0x00
-#define CRParityEnable 0x04
-#define CREvenParity 0x00
-#define CROddParity 0x02
-#define CRStopBitsOne 0x00
-#define CRStopBitsTwo 0x01
-#define CRDisableDtrRts 0x00
-
-/*-----------------------------------------------------------------------------+
-| Receiver Command Register.
-+-----------------------------------------------------------------------------*/
- unsigned char SPRC;
-#define RCRDisable 0x00
-#define RCREnable 0x80
-#define RCRIntDisable 0x00
-#define RCRIntEnabled 0x20
-#define RCRDMACh2 0x40
-#define RCRDMACh3 0x60
-#define RCRErrorInt 0x10
-#define RCRPauseEnable 0x08
-
-/*-----------------------------------------------------------------------------+
-| Transmitter Command Register.
-+-----------------------------------------------------------------------------*/
- unsigned char SPTC;
-#define TCRDisable 0x00
-#define TCREnable 0x80
-#define TCRIntDisable 0x00
-#define TCRIntEnabled 0x20
-#define TCRDMACh2 0x40
-#define TCRDMACh3 0x60
-#define TCRTxEmpty 0x10
-#define TCRErrorInt 0x08
-#define TCRStopPause 0x04
-#define TCRBreakGen 0x02
-
-/*-----------------------------------------------------------------------------+
-| Miscellanies defines.
-+-----------------------------------------------------------------------------*/
- unsigned char SPTB;
-#define SPRB SPTB
-};
-
-#define XOFFchar 0x13
-#define XONchar 0x11
-
-typedef volatile struct async *pasync;
-static const pasync port = (pasync)0x40000000;
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_status_code status;
- register unsigned tmp;
-
- /* Initialise the serial port */
- asm volatile ("mfdcr %0, 0xa0" : "=r" (tmp)); /* IOCR */
- tmp &= ~3;
- tmp |= (Cpu_table.serial_external_clock ? 2 : 0) |
- (Cpu_table.serial_cts_rts ? 1 : 0);
- asm volatile ("mtdcr 0xa0, %0" : "=r" (tmp) : "0" (tmp)); /* IOCR */
- port->SPLS = (LSRDataReady | LSRFramingError | LSROverrunError |
- LSRParityError | LSRBreakInterrupt);
- tmp = Cpu_table.serial_per_sec / Cpu_table.serial_rate;
-#if 0 /* replaced by IMD... */
- tmp = ((tmp + 8) >> 4) - 1;
- port->BRDL = tmp & 0x255;
- port->BRDH = tmp >> 8;
-#else
- tmp = ((tmp) >> 4) - 1;
- port->BRDL = tmp & 0xff;
- port->BRDH = tmp >> 8;
-#endif
- port->SPCTL = (CRNormal | CRDtr | CRRts | CRWordLength8 | CRParityDisable |
- CRStopBitsOne);
- port->SPRC = (RCREnable | RCRIntDisable | RCRPauseEnable);
- port->SPTC = (TCREnable | TCRIntDisable);
- port->SPHS = (HSRDsr | HSRCts);
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-}
-
-
-/* is_character_ready
- *
- * This routine returns TRUE if a character is available.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_boolean is_character_ready(
- char *ch
-)
-{
- unsigned char status;
-
- if ((status = port->SPLS) & LSRDataReady)
- {
- *ch = port->SPRB;
- return(TRUE);
- }
-
- /* Clean any dodgy status */
- if ((status & (LSRFramingError | LSROverrunError | LSRParityError |
- LSRBreakInterrupt)) != 0)
- {
- port->SPLS = (LSRFramingError | LSROverrunError | LSRParityError |
- LSRBreakInterrupt);
- }
-
- return FALSE;
-}
-
-/* inbyte
- *
- * This routine reads a character from the SOURCE.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- * character read from SOURCE
- */
-
-char inbyte( void )
-{
- unsigned char status;
-
- while (1)
- {
- if ((status = port->SPLS) & LSRDataReady)
- break;
-
- /* Clean any dodgy status */
- if ((status & (LSRFramingError | LSROverrunError | LSRParityError |
- LSRBreakInterrupt)) != 0)
- {
- port->SPLS = (LSRFramingError | LSROverrunError | LSRParityError |
- LSRBreakInterrupt);
- }
- }
-
- return port->SPRB;
-}
-
-/* outbyte
- *
- * This routine transmits a character out the SOURCE. It may support
- * XON/XOFF flow control.
- *
- * Input parameters:
- * ch - character to be transmitted
- *
- * Output parameters: NONE
- */
-
-void outbyte(
- char ch
-)
-{
- unsigned char status;
-
- while (port->SPHS)
- port->SPHS = (HSRDsr | HSRCts);
-
- while (1)
- {
- status = port->SPLS;
-
- if (port->SPHS)
- port->SPHS = (HSRDsr | HSRCts);
- else if (status & LSRTxHoldEmpty)
- break;
- }
-
- if (Cpu_table.serial_xon_xoff)
- while (is_character_ready(&status))
- {
- if (status == XOFFchar)
- do {
- while (!is_character_ready(&status));
- } while (status != XONchar);
- }
-
- port->SPTB = ch;
-}
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
- int maximum;
- int count = 0;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- buffer[ count ] = inbyte();
- if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
- buffer[ count++ ] = '\n';
- buffer[ count ] = 0;
- break;
- }
- }
-
- rw_args->bytes_moved = count;
- return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- int count;
- int maximum;
- rtems_libio_rw_args_t *rw_args;
- char *buffer;
-
- rw_args = (rtems_libio_rw_args_t *) arg;
-
- buffer = rw_args->buffer;
- maximum = rw_args->count;
-
- for (count = 0; count < maximum; count++) {
- if ( buffer[ count ] == '\n') {
- outbyte('\r');
- }
- outbyte( buffer[ count ] );
- }
- return maximum;
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libcpu/powerpc/ppc403/ictrl/Makefile.in b/c/src/lib/libcpu/powerpc/ppc403/ictrl/Makefile.in
deleted file mode 100644
index 551b527ead..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/ictrl/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/ictrl.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ictrl
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/ictrl.h
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
-
-# the .rel file built here will be put into libbsp.a by
-# libbsp/hppa/BSP/wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c b/c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c
deleted file mode 100644
index 11d09f748a..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/* ictrl.c
- *
- * This routine installs and handles external interrupt vectors for
- * PowerPC 403 CPU built-in external interrupt controller
- *
- * Author: Thomas Doerfler <td@imd.m.isar.de>
- *
- * COPYRIGHT (c) 1998 by IMD, Puchheim, Germany
- *
- * 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 IMD not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * IMD makes no representations about the suitability
- * of this software for any purpose.
- *
- */
-
-#include "ictrl.h"
-#include <bsp.h>
-#include <rtems/libio.h>
-
-#include <stdlib.h> /* for atexit() */
-
-/*
- * ISR vector table to dispatch external interrupts
- */
-
-rtems_isr_entry ictrl_vector_table[PPC_IRQ_EXT_MAX];
-
-/*
- *
- * some utilities to access the EXI* registers
- *
- */
-
-/*
- * clear bits in EXISR that have a bit set in mask
- */
-RTEMS_INLINE_ROUTINE void
-clr_exisr(unsigned32 mask)
-{
- asm volatile ("mtdcr 0x40,%0"::"r" (mask));/*EXISR*/
-}
-
-/*
- * get value of EXISR
- */
-RTEMS_INLINE_ROUTINE unsigned32
-get_exisr(void)
-{
- unsigned32 val;
-
- asm volatile ("mfdcr %0,0x40":"=r" (val));/*EXISR*/
- return val;
-}
-
-/*
- * get value of EXIER
- */
-RTEMS_INLINE_ROUTINE unsigned32
-get_exier(void)
-{
- unsigned32 val;
- asm volatile ("mfdcr %0,0x42":"=r" (val));/*EXIER*/
- return val;
-}
-
-/*
- * set value of EXIER
- */
-RTEMS_INLINE_ROUTINE void
-set_exier(unsigned32 val)
-{
- asm volatile ("mtdcr 0x42,%0"::"r" (val));/*EXIER*/
-}
-
-/*
- * enable an external interrupt, make this interrupt consistent
- */
-RTEMS_INLINE_ROUTINE void
-enable_ext_irq( unsigned32 mask)
-{
- unsigned32 isrlvl;
- _CPU_ISR_Disable(isrlvl);
- set_exier(get_exier() | ((mask)&PPC_EXI_MASK));
- _CPU_ISR_Enable(isrlvl);
-}
-
-/*
- * disable an external interrupt, make this interrupt consistent
- */
-RTEMS_INLINE_ROUTINE void
-disable_ext_irq( unsigned32 mask)
-{
- unsigned32 isrlvl;
- _CPU_ISR_Disable(isrlvl);
- set_exier(get_exier() & ~(mask) & PPC_EXI_MASK);
- _CPU_ISR_Enable(isrlvl);
-}
-
-/*
- *
- * this function is called, when a external interrupt is present and
- * enabled but there is no handler installed. It will clear
- * the corresponding enable bits and call the spurious handler
- * present in the _CPU_Table, if any.
- *
- */
-void
-ictrl_spurious_handler(unsigned32 spurious_mask,
- CPU_Interrupt_frame *cpu_frame)
-{
- int v;
-
- for (v=0; v < PPC_IRQ_EXT_MAX; v++) {
- if (VEC_TO_EXMSK(v) & spurious_mask) {
- clr_exisr(VEC_TO_EXMSK(v));
- disable_ext_irq(VEC_TO_EXMSK(v));
-#if 0
- printf("spurious external interrupt: %d at pc 0x%x; disabling\n",
- vector, cpu_frame->Interrupt.pcoqfront);
-#endif
- if (_CPU_Table.spurious_handler) {
- _CPU_Table.spurious_handler(v + PPC_IRQ_EXT_BASE,cpu_frame);
- }
- }
- }
-}
-
-
-/*
- * ISR Handler: this is called from the primary exception dispatcher
- */
-
-void
-ictrl_isr(rtems_vector_number vector,CPU_Interrupt_frame *cpu_frame)
-{
- unsigned32 istat,
- mask,
- global_vec;
- int exvec;
- rtems_isr_entry handler;
-
- istat = get_exisr() & get_exier() & PPC_EXI_MASK;
-
- /* FIXME: this may be speeded up using cntlzw instruction */
- for (exvec = 0;exvec < PPC_IRQ_EXT_MAX;exvec++) {
- mask = VEC_TO_EXMSK(exvec);
- if (0 != (istat & mask)) {
- clr_exisr(mask);
- handler = ictrl_vector_table[exvec];
- if (handler) {
- istat &= ~mask;
- global_vec = exvec + PPC_IRQ_EXT_BASE;
- (handler)(global_vec);
- }
- }
- }
- if (istat != 0) { /* anything left? then we have a spurious interrupt */
- ictrl_spurious_handler(istat,cpu_frame);
- }
-}
-
-/*
- *
- * the following functions form the user interface
- *
- */
-
-/*
- *
- * install a user vector for one of the external interrupt sources
- *
- */
-rtems_status_code
-ictrl_set_vector(rtems_isr_entry new_handler,
- unsigned32 vector,
- rtems_isr_entry *old_handler
-)
-{
- /*
- * We put the actual user ISR address in 'ictrl_vector_table'. This will
- * be used by the _ictrl_isr so the user gets control.
- */
-
- /* check for valid vector range */
- if ((vector >= PPC_IRQ_EXT_BASE) &&
- (vector < PPC_IRQ_EXT_BASE + PPC_IRQ_EXT_MAX)) {
-
- /* return old handler entry */
- *old_handler = ictrl_vector_table[vector - PPC_IRQ_EXT_BASE];
-
- if (new_handler != NULL) {
- /* store handler function... */
- ictrl_vector_table[vector - PPC_IRQ_EXT_BASE] = new_handler;
- /* then enable it in EXIER register */
- enable_ext_irq(VEC_TO_EXMSK(vector - PPC_IRQ_EXT_BASE));
- }
- else { /* new_handler == NULL */
- /* then disable it in EXIER register */
- disable_ext_irq(VEC_TO_EXMSK(vector - PPC_IRQ_EXT_BASE));
- ictrl_vector_table[vector - PPC_IRQ_EXT_BASE] = NULL;
- }
- return RTEMS_SUCCESSFUL;
- }
- else {
- return RTEMS_INVALID_NUMBER;
- }
-}
-
-/*
- * Called via atexit()
- * deactivate the interrupt controller
- */
-
-void
-ictrl_exit(void)
-{
- /* mark them all unused */
- disable_ext_irq(~0);
- clr_exisr(~0);
-
-}
-
-/*
- * activate the interrupt controller
- */
-
-rtems_status_code
-ictrl_init(void)
-{
- proc_ptr dummy;
-
- /* mark them all unused */
- disable_ext_irq(~0);
- clr_exisr(~0);
-
- /* install the external interrupt handler */
- _CPU_ISR_install_vector(PPC_IRQ_EXTERNAL,
- ictrl_isr,
- &dummy);
- atexit(ictrl_exit);
- return RTEMS_SUCCESSFUL;
-}
-
diff --git a/c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.h b/c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.h
deleted file mode 100644
index 5891d8aa2e..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* ictrl.h
- *
- * This file contains definitions and declarations for the
- * PowerPC 403 CPU built-in external interrupt controller
- *
- *
- * Author: Thomas Doerfler <td@imd.m.isar.de>
- *
- * COPYRIGHT (c) 1998 by IMD, Puchheim, Germany
- *
- * 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 IMD not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * IMD makes no representations about the suitability
- * of this software for any purpose.
- *
- */
-
-
-#ifndef _INCLUDE_ICTRL_h
-#define _INCLUDE_ICTRL_h
-
-#include <rtems.h>
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * definitions for second level IRQ handler support
- * External Interrupts via EXTERNAL/EISR
- */
-#define PPC_IRQ_EXT_BASE (PPC_IRQ_LAST+1)
-
-/* mask for external interrupt status in EXIER/EXISR register */
-/* note: critical interrupt is in these registers aswell */
-#define PPC_EXI_MASK 0x0FFFFFFF
-
-#define PPC_IRQ_EXT_SPIR (PPC_IRQ_EXT_BASE+4)
-#define PPC_IRQ_EXT_SPIT (PPC_IRQ_EXT_BASE+5)
-#define PPC_IRQ_EXT_JTAGR (PPC_IRQ_EXT_BASE+6)
-#define PPC_IRQ_EXT_JTAGT (PPC_IRQ_EXT_BASE+7)
-#define PPC_IRQ_EXT_DMA0 (PPC_IRQ_EXT_BASE+8)
-#define PPC_IRQ_EXT_DMA1 (PPC_IRQ_EXT_BASE+9)
-#define PPC_IRQ_EXT_DMA2 (PPC_IRQ_EXT_BASE+10)
-#define PPC_IRQ_EXT_DMA3 (PPC_IRQ_EXT_BASE+11)
-#define PPC_IRQ_EXT_0 (PPC_IRQ_EXT_BASE+27)
-#define PPC_IRQ_EXT_1 (PPC_IRQ_EXT_BASE+28)
-#define PPC_IRQ_EXT_2 (PPC_IRQ_EXT_BASE+29)
-#define PPC_IRQ_EXT_3 (PPC_IRQ_EXT_BASE+30)
-#define PPC_IRQ_EXT_4 (PPC_IRQ_EXT_BASE+31)
-
-#define PPC_IRQ_EXT_MAX (32)
-
-#define VEC_TO_EXMSK(v) (0x80000000 >> (v))
-
-/*
- *
- * install a user vector for one of the external interrupt sources
- *
- */
-rtems_status_code
-ictrl_set_vector(rtems_isr_entry new_handler,
- unsigned32 vector,
- rtems_isr_entry *old_handler
-);
-/*
- * activate the interrupt controller
- */
-rtems_status_code
-ictrl_init(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! _INCLUDE_ICTRL_h */
-/* end of include file */
diff --git a/c/src/lib/libcpu/powerpc/ppc403/include/Makefile.in b/c/src/lib/libcpu/powerpc/ppc403/include/Makefile.in
deleted file mode 100644
index d735854532..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/include/Makefile.in
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# $Id$
-#
-# Install any include files needed by libcpu.
-# Mainly this just means bsp.h which would normally be installed
-# after libcpu is built.
-# This is a bit of a hack.
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-all: FORCEIT
- cd ../../../../libbsp/$(RTEMS_CPU)/$(RTEMS_BSP)/include; $(MAKE) all
-
-
diff --git a/c/src/lib/libcpu/powerpc/ppc403/timer/Makefile.in b/c/src/lib/libcpu/powerpc/ppc403/timer/Makefile.in
deleted file mode 100644
index 2c423f2a5a..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/timer/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by
-# libbsp/hppa/BSP/wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c b/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
deleted file mode 100644
index 0881eef128..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* timer.c
- *
- * This file manages the interval timer on the PowerPC 403*.
- * We shall use the bottom 32 bits of the timebase register,
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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/lib/libcpu/hppa1.1/timer/timer.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems.h>
-
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
-static volatile rtems_unsigned32 Timer_starting;
-static rtems_boolean Timer_driver_Find_average_overhead;
-
-/*
- * This is so small that this code will be reproduced where needed.
- */
-static inline rtems_unsigned32 get_itimer(void)
-{
- rtems_unsigned32 ret;
-
- asm volatile ("mfspr %0, 0x3dd" : "=r" ((ret))); /* TBLO */
-
- return ret;
-}
-
-void Timer_initialize()
-{
- rtems_unsigned32 iocr;
-
- asm volatile ("mfdcr %0, 0xa0" : "=r" (iocr)); /* IOCR */
- iocr &= ~4;
- iocr |= 4; /* Select external timer clock */
- asm volatile ("mtdcr 0xa0, %0" : "=r" (iocr) : "0" (iocr)); /* IOCR */
-
- Timer_starting = get_itimer();
-}
-
-int Read_timer()
-{
- rtems_unsigned32 clicks;
- rtems_unsigned32 total;
-
- clicks = get_itimer();
-
- total = clicks - Timer_starting;
-
- if ( Timer_driver_Find_average_overhead == 1 )
- return total; /* in XXX microsecond units */
-
- else {
- if ( total < Cpu_table.timer_least_valid )
- return 0; /* below timer resolution */
- return (total - Cpu_table.timer_average_overhead);
- }
-}
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libcpu/powerpc/ppc403/vectors/Makefile.in b/c/src/lib/libcpu/powerpc/ppc403/vectors/Makefile.in
deleted file mode 100644
index 4f07c4e13b..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/vectors/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/vectors.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=vectors align_h
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/powerpc/ppc403/vectors/README b/c/src/lib/libcpu/powerpc/ppc403/vectors/README
deleted file mode 100644
index 4081ae2525..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/vectors/README
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# $Id$
-#
-
-The location of the vectors file object is critical.
-
-From the comments at the head of vectors.s:
-
- The issue with this file is getting it loaded at the right place.
- The first vector MUST be at address 0x????0100.
- How this is achieved is dependant on the tool chain.
-
- However the basic mechanism for ELF assemblers is to create a
- section called ".vectors", which will be loaded to an address
- between 0x????0000 and 0x????0100 (inclusive) via a link script.
-
- The basic mechanism for XCOFF assemblers is to place it in the
- normal text section, and arrange for this file to be located
- at an appropriate position on the linker command line.
-
- The variable 'PPC_VECTOR_FILE_BASE' must be defined to be the
- offset from 0x????0000 to the first location in the file. This
- will usually be 0x0000 or 0x0100.
-
-Andrew Bray 18/8/1995
diff --git a/c/src/lib/libcpu/powerpc/ppc403/vectors/align_h.s b/c/src/lib/libcpu/powerpc/ppc403/vectors/align_h.s
deleted file mode 100644
index d16298343d..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/vectors/align_h.s
+++ /dev/null
@@ -1,434 +0,0 @@
-/* align_h.s 1.1 - 95/12/04
- *
- * This file contains the assembly code for the PowerPC 403
- * alignment exception handler for RTEMS.
- *
- * Based upon IBM provided code with the following release:
- *
- * This source code has been made available to you by IBM on an AS-IS
- * basis. Anyone receiving this source is licensed under IBM
- * 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 IBM patents or
- * patent applications is to be implied by the copyright license.
- *
- * Any user of this software should understand that IBM 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 IBM copyright notice, this paragraph, and the
- * preceding two paragraphs in the transferred software.
- *
- * COPYRIGHT I B M CORPORATION 1995
- * LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
- *
- * Modifications:
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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$
- */
-
-#include "asm.h"
-#include "bsp.h"
-
-.set CACHE_SIZE,16 # cache line size of 32 bytes
-.set CACHE_SIZE_L2,4 # cache line size, log 2
-
-.set Open_gpr0,0
-.set Open_gpr1,4
-.set Open_gpr2,8
-.set Open_gpr3,12
-.set Open_gpr4,16
-.set Open_gpr5,20
-.set Open_gpr6,24
-.set Open_gpr7,28
-.set Open_gpr8,32
-.set Open_gpr9,36
-.set Open_gpr10,40
-.set Open_gpr11,44
-.set Open_gpr12,48
-.set Open_gpr13,52
-.set Open_gpr14,56
-.set Open_gpr15,60
-.set Open_gpr16,64
-.set Open_gpr17,68
-.set Open_gpr18,72
-.set Open_gpr19,76
-.set Open_gpr20,80
-.set Open_gpr21,84
-.set Open_gpr22,88
-.set Open_gpr23,92
-.set Open_gpr24,96
-.set Open_gpr25,100
-.set Open_gpr26,104
-.set Open_gpr27,108
-.set Open_gpr28,112
-.set Open_gpr29,116
-.set Open_gpr30,120
-.set Open_gpr31,124
-.set Open_xer,128
-.set Open_lr,132
-.set Open_ctr,136
-.set Open_cr,140
-.set Open_srr2,144
-.set Open_srr3,148
-.set Open_srr0,152
-.set Open_srr1,156
-
-
-/*
- * This code makes several assumptions for processing efficiency
- * * General purpose registers are continuous in the image, beginning with
- * Open_gpr0
- * * Hash table is highly dependent on opcodes - opcode changes *will*
- * require rework of the instruction decode mechanism.
- */
-
- .text
- .globl align_h
-
- .align CACHE_SIZE_L2
-align_h:
- /*-----------------------------------------------------------------------
- * Store GPRs in Open Reg save area
- * Set up r2 as base reg, r1 pointing to Open Reg save area
- *----------------------------------------------------------------------*/
- stmw r0,ALIGN_REGS(r0)
- li r1,ALIGN_REGS
- /*-----------------------------------------------------------------------
- * Store special purpose registers in reg save area
- *----------------------------------------------------------------------*/
- mfxer r7
- mflr r8
- mfcr r9
- mfctr r10
- stw r7,Open_xer(r1)
- stw r8,Open_lr(r1)
- stw r9,Open_cr(r1)
- stw r10,Open_ctr(r1)
- mfspr r7, srr2 /* SRR 2 */
- mfspr r8, srr3 /* SRR 3 */
- mfspr r9, srr0 /* SRR 0 */
- mfspr r10, srr1 /* SRR 1 */
- stw r7,Open_srr2(r1)
- stw r8,Open_srr3(r1)
- stw r9,Open_srr0(r1)
- stw r10,Open_srr1(r1)
-
-/* Set up common registers */
- mfspr r5, dear /* DEAR: R5 is data exception address */
- lwz r9,Open_srr0(r1) /* get faulting instruction */
- addi r7,r9,4 /* bump instruction */
- stw r7,Open_srr0(r1) /* restore to image */
- lwz r9, 0(r9) /* retrieve actual instruction */
- rlwinm r6,r9,18,25,29 /* r6 is RA * 4 field from instruction */
- rlwinm r7,r9,6,26,31 /* r7 is primary opcode */
- bl ref_point /* establish addressibility */
-ref_point:
- mflr r11 /* r11 is the anchor point for ref_point */
- addi r10, r7, -31 /* r10 = r7 - 31 */
- rlwinm r10,r10,2,2,31 /* r10 *= 4 */
- add r10, r10, r11 /* r10 += anchor point */
- lwz r10, primary_jt-ref_point(r10)
- mtlr r10
- rlwinm r8,r9,13,25,29 /* r8 is RD * 4 */
- la r7,Open_gpr0(r1) /* r7 is address of GPR 0 in list */
- blr
-primary_jt:
- .long xform
- .long lwz
- .long lwzu
- .long 0
- .long 0
- .long stw
- .long stwu
- .long 0
- .long 0
- .long lhz
- .long lhzu
- .long lha
- .long lhau
- .long sth
- .long sthu
- .long lmw
- .long stmw
-/*
- * handlers
- */
-/*
- * xform instructions require an additional decode. Fortunately, a relatively
- * simple hash step breaks the instructions out with no collisions
- */
-xform:
- rlwinm r7,r9,31,22,31 /* r7 is secondary opcode */
- rlwinm r10,r7,27,5,31 /* r10 = r7 >> 5 */
- add r10,r7,r10 /* r10 = r7 + r10 */
- rlwinm r10,r10,2,25,29 /* r10 = (r10 & 0x1F) * 4 */
- add r10,r10,r11 /* r10 += anchor point */
- lwz r10, secondary_ht-ref_point(r10)
- mtlr r10
- la r7,Open_gpr0(r1) /* r7 is address of GPR 0 in list */
- rlwinm r8,r9,13,25,29 /* r8 is RD * 4 */
- blrl
-
-secondary_ht:
- .long lhzux /* b 0 0x137 */
- .long lhax /* b 1 0x157 */
- .long lhaux /* b 2 0x177 */
- .long sthx /* b 3 0x197 */
- .long sthux /* b 4 0x1b7 */
- .long 0 /* b 5 */
- .long lwbrx /* b 6 0x216 */
- .long 0 /* b 7 */
- .long 0 /* b 8 */
- .long 0 /* b 9 */
- .long stwbrx /* b A 0x296 */
- .long 0 /* b B */
- .long 0 /* b C */
- .long 0 /* b D */
- .long lhbrx /* b E 0x316 */
- .long 0 /* b F */
- .long 0 /* b 10 */
- .long 0 /* b 11 */
- .long sthbrx /* b 12 0x396 */
- .long 0 /* b 13 */
- .long lwarx /* b 14 0x014 */
- .long dcbz /* b 15 0x3f6 */
- .long 0 /* b 16 */
- .long lwzx /* b 17 0x017 */
- .long lwzux /* b 18 0x037 */
- .long 0 /* b 19 */
- .long stwcx /* b 1A 0x096 */
- .long stwx /* b 1B 0x097 */
- .long stwux /* b 1C 0x0B7 */
- .long 0 /* b 1D */
- .long 0 /* b 1E */
- .long lhzx /* b 1F 0x117 */
-
-/*
- * for all handlers
- * r4 - Addressability to interrupt context
- * r5 - DEAR address (faulting data address)
- * r6 - RA field * 4
- * r7 - Address of GPR 0 in image
- * r8 - RD field * 4
- * r9 - Failing instruction
- */
-
-/* Load halfword algebraic with update */
-lhau:
-/* Load halfword algebraic with update indexed */
-lhaux:
- stwx r5,r7,r6 /* update RA with effective addr */
-
-/* Load halfword algebraic */
-lha:
-/* Load halfword algebraic indexed */
-lhax:
- lswi r10,r5,2 /* load two bytes into r10 */
- srawi r10,r10,16 /* shift right 2 bytes, extending sign */
- stwx r10,r7,r8 /* update reg image */
- b align_complete /* return */
-
-/* Load Half Word Byte-Reversed Indexed */
-lhbrx:
- lswi r10,r5,2 /* load two bytes from DEAR into r10 */
- rlwinm r10,r10,0,0,15 /* mask off lower 2 bytes */
- stwbrx r10,r7,r8 /* store reversed in reg image */
- b align_complete /* return */
-
-/* Load Half Word and Zero with Update */
-lhzu:
-/* Load Half Word and Zero with Update Indexed */
-lhzux:
- stwx r5,r7,r6 /* update RA with effective addr */
-
-/* Load Half Word and Zero */
-lhz:
-/* Load Half Word and Zero Indexed */
-lhzx:
- lswi r10,r5,2 /* load two bytes from DEAR into r10 */
- rlwinm r10,r10,16,16,31 /* shift right 2 bytes, with zero fill */
- stwx r10,r7,r8 /* update reg image */
- b align_complete /* return */
-
-/*
- * Load Multiple Word
- */
-lmw:
- lwzx r9,r6,r7 /* R9 contains saved value of RA */
- addi r10,r7,32*4 /* r10 points to r31 in image + 4 */
- rlwinm r8,r8,30,2,31 /* r8 >>= 2 (recovers RT) */
- subfic r8,r8,32 /* r8 is reg count to load */
- mtctr r8 /* load counter */
- addi r8,r8,-1 /* r8-- */
- rlwinm r8,r8,2,2,31 /* r8 *= 4 */
- add r5,r5,r8 /* update DEAR to point to last reg */
-lwmloop:
- lswi r11,r5,4 /* load r11 with 4 bytes from DEAR */
- stwu r11,-4(r10) /* load image and decrement pointer */
- addi r5,r5,-4 /* decrement effective address */
- bdnz lwmloop
- stwx r9,r6,r7 /* restore RA (in case it was trashed) */
- b align_complete /* return */
-
-/*
- * Load Word and Reserve Indexed
- */
-lwarx:
- lswi r10,r5,4 /* load four bytes from DEAR into r10 */
- stwx r10,r7,r8 /* update reg image */
- rlwinm r5,r5,0,0,29 /* Word align address */
- lwarx r10,0,r5 /* Set reservation */
- b align_complete /* return */
-
-/*
- * Load Word Byte-Reversed Indexed
- */
-lwbrx:
- lswi r10,r5,4 /* load four bytes from DEAR into r10 */
- stwbrx r10,r7,r8 /* store reversed in reg image */
- b align_complete /* return */
-
-/* Load Word and Zero with Update */
-lwzu:
-/* Load Word and Zero with Update Indexed */
-lwzux:
- stwx r5,r7,r6 /* update RA with effective addr */
-
-/* Load Word and Zero */
-lwz:
-/* Load Word and Zero Indexed */
-lwzx:
- lswi r10,r5,4 /* load four bytes from DEAR into r10 */
- stwx r10,r7,r8 /* update reg image */
- b align_complete /* return */
-
-/* Store instructions */
-
-/* */
-/* Store Half Word and Update */
-sthu:
-/* Store Half Word and Update Indexed */
-sthux:
- stwx r5,r7,r6 /* Update RA with effective address */
-
-/* Store Half Word */
-sth:
-/* Store Half Word Indexed */
-sthx:
- lwzx r10,r8,r7 /* retrieve source register value */
- rlwinm r10,r10,16,0,15 /* move two bytes to high end of reg */
- stswi r10,r5,2 /* store bytes to DEAR address */
- b align_complete /* return */
-
-/* */
-/* Store Half Word Byte-Reversed Indexed */
-sthbrx:
- lwbrx r10,r8,r7 /* retrieve src reg value byte reversed */
- stswi r10,r5,2 /* move two bytes to DEAR address */
- b align_complete /* return */
-
-/* */
-/* Store Multiple Word */
-stmw:
- addi r10,r7,32*4 /* r10 points to r31 in image + 4 */
- rlwinm r8,r8,30,2,31 /* r8 >>= 2 (recovers RT) */
- subfic r8,r8,32 /* r8 is reg count to load */
- mtctr r8 /* load counter */
- addi r8,r8,-1 /* r8-- */
- rlwinm r8,r8,2,2,31 /* r8 *= 4 */
- add r5,r5,r8 /* update DEAR to point to last reg */
-stmloop:
- lwzu r11,-4(r10) /* get register value */
- stswi r11,r5,4 /* output to DEAR address */
- addi r5,r5,-4 /* decrement effective address */
- bdnz stmloop
- b align_complete /* return */
-
-/* */
-/* Store Word and Update */
-stwu:
-/* Store Word and Update Indexed */
-stwux:
- stwx r5,r7,r6 /* Update RA with effective address */
-
-/* Store Word */
-stw:
-/* Store Word Indexed */
-stwx:
- lwzx r10,r8,r7 /* retrieve source register value */
- stswi r10,r5,4 /* store bytes to DEAR address */
- b align_complete /* return */
-
-/* */
-/* Store Word Byte-Reversed Indexed */
-stwbrx:
- lwbrx r10,r8,r7 /* retrieve src reg value byte reversed */
- stswi r10,r5,4 /* move two bytes to DEAR address */
- b align_complete /* return */
-
-/* */
-/* Store Word Conditional Indexed */
-stwcx:
- rlwinm r10,r5,0,0,29 /* r10 = word aligned DEAR */
- lwz r11,0(r10) /* save original value of store */
- stwcx. r11,r0,r10 /* attempt store to address */
- bne stwcx_moveon /* store failed, move on */
- stw r11,0(r10) /* repair damage */
- lwzx r9,r7,r8 /* get register value */
- stswi r10,r5,4 /* store bytes to DEAR address */
-stwcx_moveon:
- mfcr r11 /* get condition reg */
- lwz r9,Open_cr(r1) /* get condition reg image */
- rlwimi r9,r11,0,0,2 /* insert 3 CR bits into cr image */
- lwz r11,Open_xer(r1) /* get XER reg */
- rlwimi r9,r11,29,2,2 /* insert XER SO bit into cr image */
- stw r9,Open_cr(r1) /* store cr image */
- b align_complete /* return */
-
-/* */
-/* Data Cache Block Zero */
-dcbz:
- rlwinm r5,r5,0,0,31-CACHE_SIZE_L2
- /* get address to nearest Cache line */
- addi r5,r5,-4 /* adjust by a word */
- addi r10,r0,CACHE_SIZE/4 /* set counter value */
- mtctr r10
- addi r11,r0,0 /* r11 = 0 */
-dcbz_loop:
- stwu r11,4(r5) /* store a word and update EA */
- bdnz dcbz_loop
- b align_complete /* return */
-
-align_complete:
- /*-----------------------------------------------------------------------
- * Restore regs and return from the interrupt
- *----------------------------------------------------------------------*/
- lmw r24,Open_xer+ALIGN_REGS(r0)
- mtxer r24
- mtlr r25
- mtctr r26
- mtcrf 0xFF, r27
- mtspr srr2, r28 /* SRR 2 */
- mtspr srr3, r29 /* SRR 3 */
- mtspr srr0, r30 /* SRR 0 */
- mtspr srr1, r31 /* SRR 1 */
- lmw r1,Open_gpr1+ALIGN_REGS(r0)
- lwz r0,Open_gpr0+ALIGN_REGS(r0)
- rfi
diff --git a/c/src/lib/libcpu/powerpc/ppc403/vectors/vectors.s b/c/src/lib/libcpu/powerpc/ppc403/vectors/vectors.s
deleted file mode 100644
index 45865c37ad..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/vectors/vectors.s
+++ /dev/null
@@ -1,299 +0,0 @@
-/* vectors.s 1.1 - 95/12/04
- *
- * This file contains the assembly code for the PowerPC 403
- * interrupt veneers for RTEMS.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * 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.
- *
- */
-
-/*
- * The issue with this file is getting it loaded at the right place.
- * The first vector MUST be at address 0x????0100.
- * How this is achieved is dependant on the tool chain.
- *
- * However the basic mechanism for ELF assemblers is to create a
- * section called ".vectors", which will be loaded to an address
- * between 0x????0000 and 0x????0100 (inclusive) via a link script.
- *
- * The basic mechanism for XCOFF assemblers is to place it in the
- * normal text section, and arrange for this file to be located
- * at an appropriate position on the linker command line.
- *
- * The variable 'PPC_VECTOR_FILE_BASE' must be defined to be the
- * offset from 0x????0000 to the first location in the file. This
- * will usually be 0x0000 or 0x0100.
- *
- * $Id$
- */
-
-#include "asm.h"
-
-#ifndef PPC_VECTOR_FILE_BASE
-#error "PPC_VECTOR_FILE_BASE is not defined."
-#endif
-
- /* Where this file will be loaded */
- .set file_base, PPC_VECTOR_FILE_BASE
-
- /* Offset to store reg 0 */
-
- .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)
-
- /* Vector offsets */
- .set begin_vector,0x0000
- .set crit_vector,0x0100
- .set mach_vector,0x0200
- .set prot_vector,0x0300
- .set ext_vector,0x0500
- .set align_vector,0x0600
- .set prog_vector,0x0700
- .set dec_vector,0x0900
- .set sys_vector,0x0C00
- .set pit_vector,0x1000
- .set fit_vector,0x1010
- .set wadt_vector,0x1020
- .set debug_vector,0x2000
-
-/* Go to the right section */
-#if PPC_ASM == PPC_ASM_ELF
- .section .vectors,"awx",@progbits
-#elif PPC_ASM == PPC_ASM_XCOFF
- .csect .text[PR]
-#endif
-
- PUBLIC_VAR (__vectors)
-SYM (__vectors):
-
-/* Critical error handling */
- .org crit_vector - file_base
-#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, PPC_IRQ_CRIT
- b PROC (_ISR_HandlerC)
-
-/* Machine check exception */
- .org mach_vector - file_base
-#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, PPC_IRQ_MCHECK
- b PROC (_ISR_HandlerC)
-
-/* Protection exception */
- .org prot_vector - file_base
-#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, PPC_IRQ_PROTECT
- b PROC (_ISR_Handler)
-
-/* External interrupt */
- .org ext_vector - file_base
-#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, PPC_IRQ_EXTERNAL
- b PROC (_ISR_Handler)
-
-/* Align exception */
- .org align_vector - file_base
- .extern align_h
- b align_h
-
-/* Program exception */
- .org prog_vector - file_base
-#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, PPC_IRQ_PROGRAM
- b PROC (_ISR_Handler)
-
-/* Decrementer exception */
- .org dec_vector - file_base
-#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, PPC_IRQ_PROGRAM
- b PROC (_ISR_Handler)
-
-/* System call */
- .org sys_vector - file_base
-#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, PPC_IRQ_SCALL
- b PROC (_ISR_Handler)
-
-/* PIT interrupt */
- .org pit_vector - file_base
-#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, PPC_IRQ_PIT
- b PROC (_ISR_Handler)
-
-/* FIT interrupt */
- .org fit_vector - file_base
-#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, PPC_IRQ_FIT
- b PROC (_ISR_Handler)
-
-/* Watchdog interrupt */
- .org wadt_vector - file_base
-#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, PPC_IRQ_WATCHDOG
- b PROC (_ISR_HandlerC)
-
-/* Debug exception */
-debug:
-#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, PPC_IRQ_DEBUG
- b PROC (_ISR_HandlerC)
-
-/* Debug exception */
- .org debug_vector - file_base
- b debug
diff --git a/c/src/lib/libcpu/sh/Makefile.in b/c/src/lib/libcpu/sh/Makefile.in
deleted file mode 100644
index dfb438cc3b..0000000000
--- a/c/src/lib/libcpu/sh/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH=@srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=$(wildcard $(RTEMS_CPU_MODEL))
diff --git a/c/src/lib/libcpu/sh/sh7032/Makefile.in b/c/src/lib/libcpu/sh/sh7032/Makefile.in
deleted file mode 100644
index 9118ca3fca..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH=@srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=include clock console timer null
diff --git a/c/src/lib/libcpu/sh/sh7032/clock/Makefile.in b/c/src/lib/libcpu/sh/sh7032/clock/Makefile.in
deleted file mode 100644
index d7946d5a8f..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/clock/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH=@srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/clock.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=ckinit
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- ${make-rel}
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by
-# libbsp/sh/BSP/wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/sh/sh7032/clock/ckinit.c b/c/src/lib/libcpu/sh/sh7032/clock/ckinit.c
deleted file mode 100644
index 885cdbd752..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/clock/ckinit.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * This file contains the clock driver the Hitachi SH 703X
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#include <stdlib.h>
-
-#include <rtems/libio.h>
-#include <rtems/score/sh_io.h>
-#include <rtems/score/sh.h>
-#include <rtems/score/cpu_isps.h>
-#include <rtems/score/iosh7030.h>
-
-#define _ITU_COUNTER0_MICROSECOND (MHZ/4)
-
-#ifndef CLOCKPRIO
-#define CLOCKPRIO 10
-#endif
-
-#define ITU0_STARTMASK 0xfe
-#define ITU0_SYNCMASK 0xfe
-#define ITU0_MODEMASK 0xfe
-#define ITU0_TCRMASK 0x22
-#define ITU_STAT_MASK 0xf8
-#define ITU0_IRQMASK 0xfe
-#define ITU0_TIERMASK 0x01
-#define IPRC_ITU0_MASK 0xff0f
-#define ITU0_TIORVAL 0x08
-
-/*
- * The interrupt vector number associated with the clock tick device
- * driver.
- */
-
-#define CLOCK_VECTOR IMIA0_ISP_V
-
-/*
- * Clock_driver_ticks is a monotonically increasing counter of the
- * number of clock ticks since the driver was initialized.
- */
-
-volatile rtems_unsigned32 Clock_driver_ticks;
-
-static void Clock_exit( void );
-static rtems_isr Clock_isr( rtems_vector_number vector );
-
-/*
- * Clock_isrs is the number of clock ISRs until the next invocation of
- * the RTEMS clock tick routine. The clock tick device driver
- * gets an interrupt once a millisecond and counts down until the
- * length of time between the user configured microseconds per tick
- * has passed.
- */
-
-rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
-static rtems_unsigned32 Clock_isrs_const; /* only calculated once */
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
-/*
- * The previous ISR on this clock tick interrupt vector.
- */
-
-rtems_isr_entry Old_ticker;
-
-/*
- * Isr Handler
- */
-
-rtems_isr Clock_isr(
- rtems_vector_number vector
-)
-{
- /*
- * bump the number of clock driver ticks since initialization
- *
-
- * determine if it is time to announce the passing of tick as configured
- * to RTEMS through the rtems_clock_tick directive
- *
- * perform any timer dependent tasks
- */
- unsigned8 temp;
-
- /* reset the flags of the status register */
- temp = read8( ITU_TSR0) & ITU_STAT_MASK;
- write8( temp, ITU_TSR0);
-
- Clock_driver_ticks++ ;
-
- if( Clock_isrs == 1)
- {
- rtems_clock_tick();
- Clock_isrs = Clock_isrs_const;
- }
- else
- {
- Clock_isrs-- ;
- }
-}
-
-/*
- * Install_clock
- *
- * Install a clock tick handler and reprograms the chip. This
- * is used to initially establish the clock tick.
- */
-
-void Install_clock(
- rtems_isr_entry clock_isr
-)
-{
- unsigned8 temp8 = 0;
-
- /*
- * Initialize the clock tick device driver variables
- */
-
- Clock_driver_ticks = 0;
- Clock_isrs_const = BSP_Configuration.microseconds_per_tick / 10000;
- Clock_isrs = Clock_isrs_const;
-
- /*
- * If ticks_per_timeslice is configured as non-zero, then the user
- * wants a clock tick.
- */
-
- if ( BSP_Configuration.ticks_per_timeslice ) {
- rtems_interrupt_catch( Clock_isr, CLOCK_VECTOR, &Old_ticker );
- /*
- * Hardware specific initialize goes here
- */
-
- /* stop Timer 0 */
- temp8 = read8( ITU_TSTR) & ITU0_STARTMASK;
- write8( temp8, ITU_TSTR);
-
- /* set initial counter value to 0 */
- write16( 0, ITU_TCNT0);
-
- /* Timer 0 runs independent */
- temp8 = read8( ITU_TSNC) & ITU0_SYNCMASK;
- write8( temp8, ITU_TSNC);
-
- /* Timer 0 normal mode */
- temp8 = read8( ITU_TMDR) & ITU0_MODEMASK;
- write8( temp8, ITU_TMDR);
-
- /* TCNT is cleared by GRA ; internal clock /4 */
- write8( ITU0_TCRMASK , ITU_TCR0);
-
- /* use GRA without I/O - pins */
- write8( ITU0_TIORVAL, ITU_TIOR0);
-
- /* reset flags of the status register */
- temp8 = read8( ITU_TSR0) & ITU_STAT_MASK;
- write8( temp8, ITU_TSR0);
-
- /* Irq if is equal GRA */
- temp8 = read8( ITU_TIER0) | ITU0_TIERMASK;
- write8( temp8, ITU_TIER0);
-
- /* set interrupt priority */
- if( sh_set_irq_priority( CLOCK_VECTOR, CLOCKPRIO ) != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred( RTEMS_NOT_CONFIGURED);
-
- /* set counter limits */
- write16( _ITU_COUNTER0_MICROSECOND * BSP_Configuration.microseconds_per_tick,
- ITU_GRA0);
-
- /* start counter */
- temp8 = read8( ITU_TSTR) |~ITU0_STARTMASK;
- write8( temp8, ITU_TSTR);
-
- }
-
- /*
- * Schedule the clock cleanup routine to execute if the application exits.
- */
-
- atexit( Clock_exit );
-}
-
-/*
- * Clean up before the application exits
- */
-
-void Clock_exit( void )
-{
- unsigned8 temp8 = 0;
- if ( BSP_Configuration.ticks_per_timeslice ) {
-
- /* turn off the timer interrupts */
- /* set interrupt priority to 0 */
- if( sh_set_irq_priority( CLOCK_VECTOR, 0 ) != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred( RTEMS_UNSATISFIED);
-
-/*
- * temp16 = read16( ITU_TIER0) & IPRC_ITU0_IRQMASK;
- * write16( temp16, ITU_TIER0);
- */
-
- /* stop counter */
- temp8 = read8( ITU_TSTR) & ITU0_STARTMASK;
- write8( temp8, ITU_TSTR);
-
- /* old vector shall not be installed */
- }
-}
-
-/*
- * Clock_initialize
- *
- * Device driver entry point for clock tick driver initialization.
- */
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- Install_clock( Clock_isr );
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_unsigned32 isrlevel;
- rtems_libio_ioctl_args_t *args = pargp;
-
- if (args != 0)
- {
- /*
- * This is hokey, but until we get a defined interface
- * to do this, it will just be this simple...
- */
-
- if (args->command == rtems_build_name('I', 'S', 'R', ' '))
- {
- Clock_isr(CLOCK_VECTOR);
- }
- else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
- {
- rtems_isr_entry ignored ;
- rtems_interrupt_disable( isrlevel );
- rtems_interrupt_catch( args->buffer, CLOCK_VECTOR, &ignored );
-
- rtems_interrupt_enable( isrlevel );
- }
- }
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libcpu/sh/sh7032/console/Makefile.in b/c/src/lib/libcpu/sh/sh7032/console/Makefile.in
deleted file mode 100644
index 4a57271abb..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/console/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH=@srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/console.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=console
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by
-# libbsp/sh/BSP/wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/sh/sh7032/console/console.c b/c/src/lib/libcpu/sh/sh7032/console/console.c
deleted file mode 100644
index db308cbb55..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/console/console.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * /dev/console for Hitachi SH 703X
- *
- * The SH doesn't have a designated console device. Therefore we "alias"
- * another device as /dev/console and revector all calls to /dev/console
- * to this device.
- *
- * This approach is similar to installing a sym-link from one device to
- * another device. If rtems once will support sym-links for devices files,
- * this implementation could be dropped.
- *
- * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <iosupp.h>
-
-#ifndef CPU_CONSOLE_DEVNAME
-#error Missing CPU_CONSOLE_DEVNAME
-#endif
-
-static rtems_driver_name_t *low_level_device_info = NULL ;
-
-/* console_initialize
- *
- * This routine initializes the console IO driver.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_device_driver console_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg
-)
-{
- rtems_device_driver status ;
-
- status = rtems_io_register_name(
- "/dev/console",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- status = rtems_io_lookup_name( CPU_CONSOLE_DEVNAME,
- &low_level_device_info );
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- return RTEMS_SUCCESSFUL;
-}
-
-
-/*
- * Open entry point
- */
-
-rtems_device_driver console_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_io_open( low_level_device_info->major,
- low_level_device_info->minor,
- arg );
-}
-
-/*
- * Close entry point
- */
-
-rtems_device_driver console_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_io_close( low_level_device_info->major,
- low_level_device_info->minor,
- arg );
-}
-
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_io_read( low_level_device_info->major,
- low_level_device_info->minor,
- arg );
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_io_write( low_level_device_info->major,
- low_level_device_info->minor,
- arg );
-}
-
-/*
- * IO Control entry point
- */
-
-rtems_device_driver console_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_io_control( low_level_device_info->major,
- low_level_device_info->minor,
- arg );
-}
diff --git a/c/src/lib/libcpu/sh/sh7032/include/Makefile.in b/c/src/lib/libcpu/sh/sh7032/include/Makefile.in
deleted file mode 100644
index 1a0b064c05..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/include/Makefile.in
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH=@srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES = $(wildcard $(srcdir)/*.h)
-
-SRCS=$(H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: install
-
-# NOTE: Unlike other CPUS, we install into a subdirectory to avoid
-# file name conflicts
-
-install:
- test -d $(PROJECT_INCLUDE)/sh || $(MKDIR) $(PROJECT_INCLUDE)/sh
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)/sh
diff --git a/c/src/lib/libcpu/sh/sh7032/include/ioqueue.h b/c/src/lib/libcpu/sh/sh7032/include/ioqueue.h
deleted file mode 100644
index 55020acfad..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/include/ioqueue.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Defines for low level queue management
- *
- * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * COPYRIGHT (c) 1997-1998, Ralf Corsepius, 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _io_queue_h
-#define _io_queue_h
-
-#include <stdlib.h> /* size_t */
-
-/*
- * NOTE: size needs to be a power of 2
- */
-#define IO_QUEUE(type,size,name) \
-typedef struct { \
- volatile type queue[size] ; \
- volatile unsigned short tail ; \
- volatile unsigned short head ; \
-} name ;
-
-#define IO_QUEUE_FULL(queue, size) \
- ((queue)->tail == (((queue)->head+1) & ((size)-1)))
-
-#define IO_QUEUE_EMPTY(queue) \
- (((queue)->tail) == ((queue)->head))
-
-#define IO_QUEUE_INIT(queue) \
- (queue)->tail = (queue)->head = 0
-
-#define IO_QUEUE_ADD(queue,size) \
- (queue)->head = (((queue)->head + 1) & ((size)-1))
-
-#define IO_QUEUE_SUB(queue,size) \
- (queue)->tail = (((queue)->tail + 1) & ((size)-1))
-
-#define IO_QUEUE_PUT(_queue,item) \
-{ \
- size_t i; \
- unsigned char* dest = (unsigned char*) ((_queue)->queue[(_queue)->head]); \
- unsigned char* src = (unsigned char*) (item); \
- for( i = 0; i < sizeof(item); i++) \
- { \
- dest[i] = src[i]; \
- } \
-}
-
-#define IO_QUEUE_GET(_queue,item) \
-{\
- size_t i; \
- unsigned char *src = (unsigned char*) (_queue)->queue[(_queue)->tail]; \
- unsigned char *dest = (unsigned char*) (item); \
- for( i=0; i< sizeof(item); i++)\
- {\
- dest[i] = src[i]; \
- }\
-}
-
-#endif
diff --git a/c/src/lib/libcpu/sh/sh7032/include/null.h b/c/src/lib/libcpu/sh/sh7032/include/null.h
deleted file mode 100644
index 9ce4886c14..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/include/null.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* null.h
- *
- * Null device driver, derived from rtems' stub driver.
- *
- * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __NULL_DRIVER_h
-#define __NULL_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define DEVNULL_DRIVER_TABLE_ENTRY \
- { null_initialize, null_open, null_close, null_read, \
- null_write, null_control }
-
-#define NULL_SUCCESSFUL RTEMS_SUCCESSFUL
-
-rtems_device_driver null_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver null_open(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver null_close(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver null_read(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver null_write(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver null_control(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libcpu/sh/sh7032/include/sci.h b/c/src/lib/libcpu/sh/sh7032/include/sci.h
deleted file mode 100644
index 1b1633a488..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/include/sci.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Driver for the sh1 703x on-chip serial devices (sci)
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _sh_sci_h
-#define _sh_sci_h
-
-#ifdef __cplusplus
-extern"C" {
-#endif
-
-/*
- * Devices are set to 9600 bps, 8 databits, 1 stopbit, no
- * parity and asynchronous mode by default.
- *
- * NOTE:
- * The onboard serial devices of the SH do not support hardware
- * handshake.
- */
-
-#define DEVSCI_DRIVER_TABLE_ENTRY \
- { sh_sci_initialize, sh_sci_open, sh_sci_close, sh_sci_read, \
- sh_sci_write, sh_sci_control }
-
-extern rtems_device_driver sh_sci_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-extern rtems_device_driver sh_sci_open(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-extern rtems_device_driver sh_sci_close(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-extern rtems_device_driver sh_sci_read(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-extern rtems_device_driver sh_sci_write(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-extern rtems_device_driver sh_sci_control(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-/* Internal error codes */
-#define SH_TTY_NO_ERROR 0x2000
-#define SH_TTY_FRAME_ERR 0x2001
-#define SH_TTY_PARITY_ERR 0x2002
-#define SH_TTY_OVERRUN_ERR 0x2003
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/lib/libcpu/sh/sh7032/include/sh7_pfc.h b/c/src/lib/libcpu/sh/sh7032/include/sh7_pfc.h
deleted file mode 100644
index ba6580c5fd..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/include/sh7_pfc.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Bit values for the pin function controller of the Hitachi SH703X
- *
- * From Hitachi tutorials
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _sh7_pfc_h
-#define _sh7_pfc_h
-
-#include <rtems/score/iosh7030.h>
-
-/*
- * Port B IO Register (PBIOR)
- */
-#define PBIOR PFC_PBIOR
-#define PB15IOR 0x8000
-#define PB14IOR 0x4000
-#define PB13IOR 0x2000
-#define PB12IOR 0x1000
-#define PB11IOR 0x0800
-#define PB10IOR 0x0400
-#define PB9IOR 0x0200
-#define PB8IOR 0x0100
-#define PB7IOR 0x0080
-#define PB6IOR 0x0040
-#define PB5IOR 0x0020
-#define PB4IOR 0x0010
-#define PB3IOR 0x0008
-#define PB2IOR 0x0004
-#define PB1IOR 0x0002
-#define PB0IOR 0x0001
-
-/*
- * Port B Control Register (PBCR1)
- */
-#define PBCR1 PFC_PBCR1
-#define PB15MD1 0x8000
-#define PB15MD0 0x4000
-#define PB14MD1 0x2000
-#define PB14MD0 0x1000
-#define PB13MD1 0x0800
-#define PB13MD0 0x0400
-#define PB12MD1 0x0200
-#define PB12MD0 0x0100
-#define PB11MD1 0x0080
-#define PB11MD0 0x0040
-#define PB10MD1 0x0020
-#define PB10MD0 0x0010
-#define PB9MD1 0x0008
-#define PB9MD0 0x0004
-#define PB8MD1 0x0002
-#define PB8MD0 0x0001
-
-#define PB15MD PB15MD1|PB14MD0
-#define PB14MD PB14MD1|PB14MD0
-#define PB13MD PB13MD1|PB13MD0
-#define PB12MD PB12MD1|PB12MD0
-#define PB11MD PB11MD1|PB11MD0
-#define PB10MD PB10MD1|PB10MD0
-#define PB9MD PB9MD1|PB9MD0
-#define PB8MD PB8MD1|PB8MD0
-
-#define PB_TXD1 PB11MD1
-#define PB_RXD1 PB10MD1
-#define PB_TXD0 PB9MD1
-#define PB_RXD0 PB8MD1
-
-/*
- * Port B Control Register (PBCR2)
- */
-#define PBCR2 PFC_PBCR2
-#define PB7MD1 0x8000
-#define PB7MD0 0x4000
-#define PB6MD1 0x2000
-#define PB6MD0 0x1000
-#define PB5MD1 0x0800
-#define PB5MD0 0x0400
-#define PB4MD1 0x0200
-#define PB4MD0 0x0100
-#define PB3MD1 0x0080
-#define PB3MD0 0x0040
-#define PB2MD1 0x0020
-#define PB2MD0 0x0010
-#define PB1MD1 0x0008
-#define PB1MD0 0x0004
-#define PB0MD1 0x0002
-#define PB0MD0 0x0001
-
-#define PB7MD PB7MD1|PB7MD0
-#define PB6MD PB6MD1|PB6MD0
-#define PB5MD PB5MD1|PB5MD0
-#define PB4MD PB4MD1|PB4MD0
-#define PB3MD PB3MD1|PB3MD0
-#define PB2MD PB2MD1|PB2MD0
-#define PB1MD PB1MD1|PB1MD0
-#define PB0MD PB0MD1|PB0MD0
-
-#endif /* _sh7_pfc_h */
diff --git a/c/src/lib/libcpu/sh/sh7032/include/sh7_sci.h b/c/src/lib/libcpu/sh/sh7032/include/sh7_sci.h
deleted file mode 100644
index cb2cc03893..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/include/sh7_sci.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Bit values for the serial control registers of the Hitachi SH703X
- *
- * From Hitachi tutorials
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _sh7_sci_h
-#define _sh7_sci_h
-
-#include <rtems/score/iosh7030.h>
-
-/*
- * Serial mode register bits
- */
-
-#define SCI_SYNC_MODE 0x80
-#define SCI_SEVEN_BIT_DATA 0x40
-#define SCI_PARITY_ON 0x20
-#define SCI_ODD_PARITY 0x10
-#define SCI_STOP_BITS_2 0x08
-#define SCI_ENABLE_MULTIP 0x04
-#define SCI_PHI_64 0x03
-#define SCI_PHI_16 0x02
-#define SCI_PHI_4 0x01
-#define SCI_PHI_0 0x00
-
-/*
- * Serial register offsets, relative to SCI0_SMR or SCI1_SMR
- */
-
-#define SCI_SMR 0x00
-#define SCI_BRR 0x01
-#define SCI_SCR 0x02
-#define SCI_TDR 0x03
-#define SCI_SSR 0x04
-#define SCI_RDR 0x05
-
-/*
- * Serial control register bits
- */
-#define SCI_TIE 0x80 /* Transmit interrupt enable */
-#define SCI_RIE 0x40 /* Receive interrupt enable */
-#define SCI_TE 0x20 /* Transmit enable */
-#define SCI_RE 0x10 /* Receive enable */
-#define SCI_MPIE 0x08 /* Multiprocessor interrupt enable */
-#define SCI_TEIE 0x04 /* Transmit end interrupt enable */
-#define SCI_CKE1 0x02 /* Clock enable 1 */
-#define SCI_CKE0 0x01 /* Clock enable 0 */
-
-/*
- * Serial status register bits
- */
-#define SCI_TDRE 0x80 /* Transmit data register empty */
-#define SCI_RDRF 0x40 /* Receive data register full */
-#define SCI_ORER 0x20 /* Overrun error */
-#define SCI_FER 0x10 /* Framing error */
-#define SCI_PER 0x08 /* Parity error */
-#define SCI_TEND 0x04 /* Transmit end */
-#define SCI_MPB 0x02 /* Multiprocessor bit */
-#define SCI_MPBT 0x01 /* Multiprocessor bit transfer */
-
-#endif /* _sh7_sci_h */
diff --git a/c/src/lib/libcpu/sh/sh7032/null/Makefile.in b/c/src/lib/libcpu/sh/sh7032/null/Makefile.in
deleted file mode 100644
index 71127550a9..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/null/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/null.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=open close read write init cntrl
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(DOCS) $(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/sh/sh7032/null/close.c b/c/src/lib/libcpu/sh/sh7032/null/close.c
deleted file mode 100644
index cb5ac8cd65..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/null/close.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* null_close
- *
- * This routine is the null device driver close routine.
- *
- * Derived from rtems' stub driver.
- *
- * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * Input parameters:
- * major - device major number
- * minor - device minor number
- * pargb - pointer to close parameter block
- *
- * Output parameters:
- * rval - NULL_SUCCESSFUL
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <sh/null.h>
-
-rtems_device_driver null_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return NULL_SUCCESSFUL;
-}
diff --git a/c/src/lib/libcpu/sh/sh7032/null/cntrl.c b/c/src/lib/libcpu/sh/sh7032/null/cntrl.c
deleted file mode 100644
index cafc714279..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/null/cntrl.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* null_control
- *
- * This routine is the null device driver control routine.
- *
- * Derived from rtems' stub driver.
- *
- * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * Input parameters:
- * major - device major number
- * minor - device minor number
- * pargp - pointer to cntrl parameter block
- *
- * Output parameters:
- * rval - NULL_SUCCESSFUL
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <sh/null.h>
-
-rtems_device_driver null_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return NULL_SUCCESSFUL;
-}
diff --git a/c/src/lib/libcpu/sh/sh7032/null/init.c b/c/src/lib/libcpu/sh/sh7032/null/init.c
deleted file mode 100644
index dcc1800f6b..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/null/init.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* null_initialize
- *
- * This routine is the null device driver init routine.
- *
- * Derived from rtems' stub driver.
- *
- * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * Input parameters:
- * major - device major number
- * minor - device minor number
- * pargp - pointer to parameter block
- *
- * Output parameters:
- * rval - NULL_SUCCESSFUL
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <sh/null.h>
-
-rtems_unsigned32 NULL_major;
-
-rtems_device_driver null_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_device_driver status ;
-
- status = rtems_io_register_name(
- "/dev/null",
- major,
- (rtems_device_minor_number) 0
- );
-
- if (status != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(status);
-
- NULL_major = major;
-
- return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libcpu/sh/sh7032/null/open.c b/c/src/lib/libcpu/sh/sh7032/null/open.c
deleted file mode 100644
index 352f4b981e..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/null/open.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* null_open
- *
- * This routine is the null device driver open routine.
- *
- * Derived from rtems' stub driver.
- *
- * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * Input parameters:
- * major - device major number
- * minor - device minor number
- * pargb - pointer to open parameter block
- *
- * Output parameters:
- * rval - NULL_SUCCESSFUL
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <sh/null.h>
-
-rtems_device_driver null_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return NULL_SUCCESSFUL;
-}
diff --git a/c/src/lib/libcpu/sh/sh7032/null/read.c b/c/src/lib/libcpu/sh/sh7032/null/read.c
deleted file mode 100644
index 895ba0c7f4..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/null/read.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* null_read
- *
- * This routine is the null device driver read routine.
- *
- * Derived from rtems' stub driver.
- *
- * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * Input parameters:
- * major - device major number
- * minor - device minor number
- * pargp - pointer to read parameter block
- *
- * Output parameters:
- * rval - NULL_SUCCESSFUL
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <sh/null.h>
-
-rtems_device_driver null_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return NULL_SUCCESSFUL;
-}
diff --git a/c/src/lib/libcpu/sh/sh7032/null/write.c b/c/src/lib/libcpu/sh/sh7032/null/write.c
deleted file mode 100644
index d9c4da434b..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/null/write.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* null_write
- *
- * This routine is the null device driver write routine.
- *
- * Derived from rtems' stub driver.
- *
- * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * Input parameters:
- * major - device major number
- * minor - device minor number
- * pargp - pointer to write parameter block
- *
- * Output parameters:
- * rval - NULL_SUCCESSFUL
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <rtems/libio.h>
-
-#include <sh/null.h>
-
-rtems_device_driver null_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp ;
-
- rw_args->bytes_moved = rw_args->count ;
-
- return NULL_SUCCESSFUL;
-}
diff --git a/c/src/lib/libcpu/sh/sh7032/score/cpu_asm.c b/c/src/lib/libcpu/sh/sh7032/score/cpu_asm.c
deleted file mode 100644
index 42764f6eb1..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/score/cpu_asm.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- * This file contains the basic algorithms for all assembly code used
- * in an specific CPU port of RTEMS. These algorithms must be implemented
- * in assembly language
- *
- * NOTE: This port uses a C file with inline assembler instructions
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 material may be reproduced by or for the U.S. Government pursuant
- * to the copyright license under the clause at DFARS 252.227-7013. This
- * notice must appear in all copies of this file and its derivatives.
- *
- */
-
-/*
- * This is supposed to be an assembly file. This means that system.h
- * and cpu.h should not be included in a "real" cpu_asm file. An
- * implementation in assembly should include "cpu_asm.h"
- */
-
-#include <rtems/system.h>
-#include <rtems/score/cpu.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/cpu_isps.h>
-#include <rtems/score/sh_io.h>
-#include <rtems/score/sh.h>
-#include <rtems/score/iosh7030.h>
-
-/* from cpu_isps.c */
-extern proc_ptr _Hardware_isr_Table[];
-
-#if( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
- unsigned long *_old_stack_ptr;
-#endif
-
-register unsigned long *stack_ptr asm("r15");
-
-/*
- * sh_set_irq_priority
- *
- * this function sets the interrupt level of the specified interrupt
- *
- * parameters:
- * - irq : interrupt number
- * - prio: priority to set for this interrupt number
- *
- * returns: 0 if ok
- * -1 on error
- */
-
-unsigned int sh_set_irq_priority(
- unsigned int irq,
- unsigned int prio )
-{
- unsigned32 shiftcount;
- unsigned32 prioreg;
- unsigned16 temp16;
- unsigned32 level;
-
- /*
- * first check for valid interrupt
- */
- if(( irq > 113) || (_Hardware_isr_Table[irq] == _dummy_isp))
- return -1;
- /*
- * check for valid irq priority
- */
- if( prio > 15 )
- return -1;
-
- /*
- * look up appropriate interrupt priority register
- */
- if( irq > 71)
- {
- irq = irq - 72;
- shiftcount = 12 - ((irq & ~0x03) % 16);
-
- switch( irq / 16)
- {
- case 0: { prioreg = INTC_IPRC; break;}
- case 1: { prioreg = INTC_IPRD; break;}
- case 2: { prioreg = INTC_IPRE; break;}
- default: return -1;
- }
- }
- else
- {
- shiftcount = 12 - 4 * ( irq % 4);
- if( irq > 67)
- prioreg = INTC_IPRB;
- else
- prioreg = INTC_IPRA;
- }
-
- /*
- * Set the interrupt priority register
- */
- _CPU_ISR_Disable( level );
-
- temp16 = read16( prioreg);
- temp16 &= ~( 15 << shiftcount);
- temp16 |= prio << shiftcount;
- write16( temp16, prioreg);
-
- _CPU_ISR_Enable( level );
-
- return 0;
-}
-
-/*
- * _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.
- */
-
-void _CPU_Context_save_fp(
- void **fp_context_ptr
-)
-{
-}
-
-/*
- * _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.
- */
-
-void _CPU_Context_restore_fp(
- void **fp_context_ptr
-)
-{
-}
-
-/* _CPU_Context_switch
- *
- * This routine performs a normal non-FP context switch.
- */
-
-/* within __CPU_Context_switch:
- * _CPU_Context_switch
- * _CPU_Context_restore
- *
- * This routine is generally used only to restart self in an
- * efficient manner. It may simply be a label in _CPU_Context_switch.
- *
- * NOTE: It should be safe not to store r4, r5
- *
- * NOTE: It is doubtful if r0 is really needed to be stored
- *
- * NOTE: gbr is added, but should not be necessary, as it is
- * only used globally in this port.
- */
-
-/*
- * FIXME: This is an ugly hack, but we wanted to avoid recalculating
- * the offset each time Context_Control is changed
- */
-void __CPU_Context_switch(
- Context_Control *run, /* r4 */
- Context_Control *heir /* r5 */
-)
-{
-
-asm volatile("
- .global __CPU_Context_switch
-__CPU_Context_switch:
-
- add %0,r4
-
- stc.l sr,@-r4
- stc.l gbr,@-r4
- mov.l r0,@-r4
- mov.l r1,@-r4
- mov.l r2,@-r4
- mov.l r3,@-r4
-
- mov.l r6,@-r4
- mov.l r7,@-r4
- mov.l r8,@-r4
- mov.l r9,@-r4
- mov.l r10,@-r4
- mov.l r11,@-r4
- mov.l r12,@-r4
- mov.l r13,@-r4
- mov.l r14,@-r4
- sts.l pr,@-r4
- sts.l mach,@-r4
- sts.l macl,@-r4
- mov.l r15,@-r4
-
- mov r5, r4"
- :: "I" (sizeof(Context_Control))
- );
-
- asm volatile("
- .global __CPU_Context_restore
-__CPU_Context_restore:
- mov.l @r4+,r15
- lds.l @r4+,macl
- lds.l @r4+,mach
- lds.l @r4+,pr
- mov.l @r4+,r14
- mov.l @r4+,r13
- mov.l @r4+,r12
- mov.l @r4+,r11
- mov.l @r4+,r10
- mov.l @r4+,r9
- mov.l @r4+,r8
- mov.l @r4+,r7
- mov.l @r4+,r6
-
- mov.l @r4+,r3
- mov.l @r4+,r2
- mov.l @r4+,r1
- mov.l @r4+,r0
- ldc.l @r4+,gbr
- ldc.l @r4+,sr
-
- rts
- nop" );
-}
-
-/*
- * This routine provides the RTEMS interrupt management.
- */
-
-void __ISR_Handler( unsigned32 vector)
-{
- register unsigned32 level;
-
- _CPU_ISR_Disable( level );
-
- _Thread_Dispatch_disable_level++;
-
-#if( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
- if( _ISR_Nest_level == 0 )
- {
- /* Install irq stack */
- _old_stack_ptr = stack_ptr;
- stack_ptr = _CPU_Interrupt_stack_high;
- }
-
-#endif
-
- _ISR_Nest_level++;
-
- _CPU_ISR_Enable( level );
-
- /* call isp */
- if( _ISR_Vector_table[ vector])
- (*_ISR_Vector_table[ vector ])( vector );
-
- _CPU_ISR_Disable( level );
-
- _ISR_Nest_level--;
-
-#if( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
-
- if( _ISR_Nest_level == 0 )
- /* restore old stack pointer */
- stack_ptr = _old_stack_ptr;
-#endif
-
- _Thread_Dispatch_disable_level--;
-
- _CPU_ISR_Enable( level );
-
- if ( _Thread_Dispatch_disable_level == 0 )
- {
- if(( _Context_Switch_necessary) || (! _ISR_Signals_to_thread_executing))
- {
- _ISR_Signals_to_thread_executing = FALSE;
- _Thread_Dispatch();
- }
- }
-}
diff --git a/c/src/lib/libcpu/sh/sh7032/score/ispsh7032.c b/c/src/lib/libcpu/sh/sh7032/score/ispsh7032.c
deleted file mode 100644
index 3ef3c32465..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/score/ispsh7032.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * This file contains the isp frames for the user interrupts.
- * From these procedures __ISR_Handler is called with the vector number
- * as argument.
- *
- * __ISR_Handler is kept in a separate file (cpu_asm.c), because a bug in
- * some releases of gcc doesn't properly handle #pragma interrupt, if a
- * file contains both isrs and normal functions.
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/shtypes.h>
-#include <rtems/score/cpu_isps.h>
-
-/*
- * This is a exception vector table
- *
- * It has the same structure like the actual vector table (vectab)
- */
-proc_ptr _Hardware_isr_Table[256]={
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp,
-_nmi_isp, _usb_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp,
-/* trapa 0 -31 */
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
-/* irq 64 ... */
-_irq0_isp, _irq1_isp, _irq2_isp, _irq3_isp,
-_irq4_isp, _irq5_isp, _irq6_isp, _irq7_isp,
-_dma0_isp, _dummy_isp, _dma1_isp, _dummy_isp,
-_dma2_isp, _dummy_isp, _dma3_isp, _dummy_isp,
-_imia0_isp, _imib0_isp, _ovi0_isp, _dummy_isp,
-_imia1_isp, _imib1_isp, _ovi1_isp, _dummy_isp,
-_imia2_isp, _imib2_isp, _ovi2_isp, _dummy_isp,
-_imia3_isp, _imib3_isp, _ovi3_isp, _dummy_isp,
-_imia4_isp, _imib4_isp, _ovi4_isp, _dummy_isp,
-_eri0_isp, _rxi0_isp, _txi0_isp, _tei0_isp,
-_eri1_isp, _rxi1_isp, _txi1_isp, _tei1_isp,
-_prt_isp, _adu_isp, _dummy_isp, _dummy_isp,
-_wdt_isp,
-/* 113 */ _dref_isp
-};
-
-#define Str(a)#a
-
-/*
- * Some versions of gcc and all version of egcs at least until egcs-1.1b
- * are not able to handle #pragma interrupt correctly if more than 1 isr is
- * contained in a file and when optimizing.
- * We try to work around this problem by using the macro below.
- */
-#define isp( name, number, func)\
-asm (".global _"Str(name)"\n\t" \
- "_"Str(name)": \n\t" \
- " mov.l r0,@-r15 \n\t" \
- " mov.l r1,@-r15 \n\t" \
- " mov.l r2,@-r15 \n\t" \
- " mov.l r3,@-r15 \n\t" \
- " mov.l r4,@-r15 \n\t" \
- " mov.l r5,@-r15 \n\t" \
- " mov.l r6,@-r15 \n\t" \
- " mov.l r7,@-r15 \n\t" \
- " mov.l r14,@-r15 \n\t" \
- " sts.l pr,@-r15 \n\t" \
- " sts.l mach,@-r15 \n\t" \
- " sts.l macl,@-r15 \n\t" \
- " mov r15,r14 \n\t" \
- " mov.l "Str(name)"_k, r1\n\t" \
- " jsr @r1 \n\t" \
- " mov #"Str(number)", r4\n\t" \
- " mov r14,r15 \n\t" \
- " lds.l @r15+,macl \n\t" \
- " lds.l @r15+,mach \n\t" \
- " lds.l @r15+,pr \n\t" \
- " mov.l @r15+,r14 \n\t" \
- " mov.l @r15+,r7 \n\t" \
- " mov.l @r15+,r6 \n\t" \
- " mov.l @r15+,r5 \n\t" \
- " mov.l @r15+,r4 \n\t" \
- " mov.l @r15+,r3 \n\t" \
- " mov.l @r15+,r2 \n\t" \
- " mov.l @r15+,r1 \n\t" \
- " mov.l @r15+,r0 \n\t" \
- " rte \n\t" \
- " nop \n\t" \
- " .align 2 \n\t" \
- #name"_k: \n\t" \
- ".long "Str(func));
-
-/************************************************
- * Dummy interrupt service procedure for
- * interrupts being not allowed --> Trap 34
- ************************************************/
-asm(" .section .text
-.global __dummy_isp
-__dummy_isp:
- mov.l r14,@-r15
- mov r15, r14
- trapa #34
- mov.l @r15+,r14
- rte
- nop");
-
-/*****************************
- * Non maskable interrupt
- *****************************/
-isp( _nmi_isp, NMI_ISP_V, ___ISR_Handler);
-
-/*****************************
- * User break controller
- *****************************/
-isp( _usb_isp, USB_ISP_V, ___ISR_Handler);
-
-/*****************************
- * External interrupts 0-7
- *****************************/
-isp( _irq0_isp, IRQ0_ISP_V, ___ISR_Handler);
-isp( _irq1_isp, IRQ1_ISP_V, ___ISR_Handler);
-isp( _irq2_isp, IRQ2_ISP_V, ___ISR_Handler);
-isp( _irq3_isp, IRQ3_ISP_V, ___ISR_Handler);
-isp( _irq4_isp, IRQ4_ISP_V, ___ISR_Handler);
-isp( _irq5_isp, IRQ5_ISP_V, ___ISR_Handler);
-isp( _irq6_isp, IRQ6_ISP_V, ___ISR_Handler);
-isp( _irq7_isp, IRQ7_ISP_V, ___ISR_Handler);
-
-/*****************************
- * DMA - controller
- *****************************/
-isp( _dma0_isp, DMA0_ISP_V, ___ISR_Handler);
-isp( _dma1_isp, DMA1_ISP_V, ___ISR_Handler);
-isp( _dma2_isp, DMA2_ISP_V, ___ISR_Handler);
-isp( _dma3_isp, DMA3_ISP_V, ___ISR_Handler);
-
-
-/*****************************
- * Interrupt timer unit
- *****************************/
-
-/*****************************
- * Timer 0
- *****************************/
-isp( _imia0_isp, IMIA0_ISP_V, ___ISR_Handler);
-isp( _imib0_isp, IMIB0_ISP_V, ___ISR_Handler);
-isp( _ovi0_isp, OVI0_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Timer 1
- *****************************/
-isp( _imia1_isp, IMIA1_ISP_V, ___ISR_Handler);
-isp( _imib1_isp, IMIB1_ISP_V, ___ISR_Handler);
-isp( _ovi1_isp, OVI1_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Timer 2
- *****************************/
-isp( _imia2_isp, IMIA2_ISP_V, ___ISR_Handler);
-isp( _imib2_isp, IMIB2_ISP_V, ___ISR_Handler);
-isp( _ovi2_isp, OVI2_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Timer 3
- *****************************/
-isp( _imia3_isp, IMIA3_ISP_V, ___ISR_Handler);
-isp( _imib3_isp, IMIB3_ISP_V, ___ISR_Handler);
-isp( _ovi3_isp, OVI3_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Timer 4
- *****************************/
-isp( _imia4_isp, IMIA4_ISP_V, ___ISR_Handler);
-isp( _imib4_isp, IMIB4_ISP_V, ___ISR_Handler);
-isp( _ovi4_isp, OVI4_ISP_V, ___ISR_Handler);
-
-
-/*****************************
- * Serial interfaces
- *****************************/
-
-/*****************************
- * Serial interface 0
- *****************************/
-isp( _eri0_isp, ERI0_ISP_V, ___ISR_Handler);
-isp( _rxi0_isp, RXI0_ISP_V, ___ISR_Handler);
-isp( _txi0_isp, TXI0_ISP_V, ___ISR_Handler);
-isp( _tei0_isp, TEI0_ISP_V, ___ISR_Handler);
-
-/*****************************
- * Serial interface 1
- *****************************/
-isp( _eri1_isp, ERI1_ISP_V, ___ISR_Handler);
-isp( _rxi1_isp, RXI1_ISP_V, ___ISR_Handler);
-isp( _txi1_isp, TXI1_ISP_V, ___ISR_Handler);
-isp( _tei1_isp, TEI1_ISP_V, ___ISR_Handler);
-
-
-/*****************************
- * Parity control unit of
- * the bus state controller
- *****************************/
-isp( _prt_isp, PRT_ISP_V, ___ISR_Handler);
-
-
-/******************************
- * Analog digital converter
- * ADC
- ******************************/
-isp( _adu_isp, ADU_ISP_V, ___ISR_Handler);
-
-
-/******************************
- * Watchdog timer
- ******************************/
-isp( _wdt_isp, WDT_ISP_V, ___ISR_Handler);
-
-
-/******************************
- * DRAM refresh control unit
- * of bus state controller
- ******************************/
-isp( _dref_isp, DREF_ISP_V, ___ISR_Handler);
diff --git a/c/src/lib/libcpu/sh/sh7032/timer/Makefile.in b/c/src/lib/libcpu/sh/sh7032/timer/Makefile.in
deleted file mode 100644
index 8fb56cf938..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/timer/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH=@srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/timer.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by
-# libbsp/sh/BSP/Makefile
-install: all
diff --git a/c/src/lib/libcpu/sh/sh7032/timer/timer.c b/c/src/lib/libcpu/sh/sh7032/timer/timer.c
deleted file mode 100644
index ddf8bfc06b..0000000000
--- a/c/src/lib/libcpu/sh/sh7032/timer/timer.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * timer for the Hitachi SH 703X
- *
- * This file manages the benchmark timer used by the RTEMS Timing Test
- * Suite. Each measured time period is demarcated by calls to
- * Timer_initialize() and Read_timer(). Read_timer() usually returns
- * the number of microseconds since Timer_initialize() exitted.
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#include <rtems/score/sh_io.h>
-#include <rtems/score/iosh7030.h>
-
-/*
- * We use a Phi/4 timer
- */
-#define SCALE (MHZ/4)
-
-#define ITU1_STARTMASK 0xfd
-#define ITU1_SYNCMASK 0xfd
-#define ITU1_MODEMASK 0xfd
-#define ITU1_TCRMASK 0x02
-#define ITU1_TIORMASK 0x88
-#define ITU1_STAT_MASK 0xf8
-#define ITU1_TIERMASK 0xfc
-#define IPRC_ITU1_MASK 0xfff0
-
-#ifndef ITU1_PRIO
-#define ITU1_PRIO 15
-#endif
-
-#define ITU1_VECTOR 86
-
-rtems_isr timerisr();
-
-static rtems_unsigned32 Timer_interrupts;
-
-rtems_boolean Timer_driver_Find_average_overhead;
-
-void Timer_initialize( void )
-{
- rtems_unsigned8 temp8;
- rtems_unsigned16 temp16;
- rtems_unsigned32 level;
- rtems_isr *ignored;
-
- /*
- * Timer has never overflowed. This may not be necessary on some
- * implemenations of timer but ....
- */
-
- Timer_interrupts /* .i */ = 0;
- _CPU_ISR_Disable( level);
-
- /*
- * Somehow start the timer
- */
- /* stop Timer 1 */
- temp8 = read8( ITU_TSTR) & ITU1_STARTMASK;
- write8( temp8, ITU_TSTR);
-
- /* initialize counter 1 */
- write16( 0, ITU_TCNT1);
-
- /* Timer 1 is independent of other timers */
- temp8 = read8( ITU_TSNC) & ITU1_SYNCMASK;
- write8( temp8, ITU_TSNC);
-
- /* Timer 1, normal mode */
- temp8 = read8( ITU_TMDR) & ITU1_MODEMASK;
- write8( temp8, ITU_TMDR);
-
- /* x0000000
- * |||||+++--- Internal Clock
- * |||++------ Count on rising edge
- * |++-------- disable TCNT clear
- * +---------- don`t care
- */
- write8( ITU1_TCRMASK, ITU_TCR1);
-
- /* gra and grb are not used */
- write8( ITU1_TIORMASK, ITU_TIOR1);
-
- /* reset all status flags */
- temp8 = read8( ITU_TSR1) & ITU1_STAT_MASK;
- write8( temp8, ITU_TSR1);
-
- /* enable overflow interrupt */
- write8( ITU1_TIERMASK, ITU_TIER1);
-
- /* set interrupt priority */
- temp16 = read16( INTC_IPRC) & IPRC_ITU1_MASK;
- temp16 |= ITU1_PRIO;
- write16( temp16, INTC_IPRC);
-
- /* initialize ISR */
- _CPU_ISR_install_raw_handler( ITU1_VECTOR, timerisr, &ignored );
- _CPU_ISR_Enable( level);
-
- /* start timer 1 */
- temp8 = read8( ITU_TSTR) | ~ITU1_STARTMASK;
- write8( temp8, ITU_TSTR);
-}
-
-/*
- * The following controls the behavior of Read_timer().
- *
- * AVG_OVERHEAD is the overhead for starting and stopping the timer. It
- * is usually deducted from the number returned.
- *
- * LEAST_VALID is the lowest number this routine should trust. Numbers
- * below this are "noise" and zero is returned.
- */
-
-#define AVG_OVERHEAD 1 /* It typically takes X.X microseconds */
- /* (Y countdowns) to start/stop the timer. */
- /* This value is in microseconds. */
-#define LEAST_VALID 0 /* 20 */ /* Don't trust a clicks value lower than this */
-
-int Read_timer( void )
-{
- rtems_unsigned32 clicks;
- rtems_unsigned32 total ;
- /*
- * Read the timer and see how many clicks it has been since we started.
- */
-
-
- clicks = read16( ITU_TCNT1); /* XXX: read some HW here */
-
- /*
- * Total is calculated by taking into account the number of timer overflow
- * interrupts since the timer was initialized and clicks since the last
- * interrupts.
- */
-
- total = clicks + Timer_interrupts * 65536 ;
-
- if ( Timer_driver_Find_average_overhead )
- return total / SCALE; /* in XXX microsecond units */
- else
- {
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
- /*
- * Somehow convert total into microseconds
- */
- return (total / SCALE - AVG_OVERHEAD) ;
- }
-}
-
-/*
- * Empty function call used in loops to measure basic cost of looping
- * in Timing Test Suite.
- */
-
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-)
-{
- Timer_driver_Find_average_overhead = find_flag;
-}
-
-/* Timer 1 is used */
-
-#pragma interrupt
-void timerisr( void )
-{
- unsigned8 temp8;
-
- /* reset the flags of the status register */
- temp8 = read8( ITU_TSR1) & ITU1_STAT_MASK;
- write8( temp8, ITU_TSR1);
-
- Timer_interrupts += 1;
-}
diff --git a/c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c b/c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c
deleted file mode 100644
index 42764f6eb1..0000000000
--- a/c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- * This file contains the basic algorithms for all assembly code used
- * in an specific CPU port of RTEMS. These algorithms must be implemented
- * in assembly language
- *
- * NOTE: This port uses a C file with inline assembler instructions
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 material may be reproduced by or for the U.S. Government pursuant
- * to the copyright license under the clause at DFARS 252.227-7013. This
- * notice must appear in all copies of this file and its derivatives.
- *
- */
-
-/*
- * This is supposed to be an assembly file. This means that system.h
- * and cpu.h should not be included in a "real" cpu_asm file. An
- * implementation in assembly should include "cpu_asm.h"
- */
-
-#include <rtems/system.h>
-#include <rtems/score/cpu.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/cpu_isps.h>
-#include <rtems/score/sh_io.h>
-#include <rtems/score/sh.h>
-#include <rtems/score/iosh7030.h>
-
-/* from cpu_isps.c */
-extern proc_ptr _Hardware_isr_Table[];
-
-#if( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
- unsigned long *_old_stack_ptr;
-#endif
-
-register unsigned long *stack_ptr asm("r15");
-
-/*
- * sh_set_irq_priority
- *
- * this function sets the interrupt level of the specified interrupt
- *
- * parameters:
- * - irq : interrupt number
- * - prio: priority to set for this interrupt number
- *
- * returns: 0 if ok
- * -1 on error
- */
-
-unsigned int sh_set_irq_priority(
- unsigned int irq,
- unsigned int prio )
-{
- unsigned32 shiftcount;
- unsigned32 prioreg;
- unsigned16 temp16;
- unsigned32 level;
-
- /*
- * first check for valid interrupt
- */
- if(( irq > 113) || (_Hardware_isr_Table[irq] == _dummy_isp))
- return -1;
- /*
- * check for valid irq priority
- */
- if( prio > 15 )
- return -1;
-
- /*
- * look up appropriate interrupt priority register
- */
- if( irq > 71)
- {
- irq = irq - 72;
- shiftcount = 12 - ((irq & ~0x03) % 16);
-
- switch( irq / 16)
- {
- case 0: { prioreg = INTC_IPRC; break;}
- case 1: { prioreg = INTC_IPRD; break;}
- case 2: { prioreg = INTC_IPRE; break;}
- default: return -1;
- }
- }
- else
- {
- shiftcount = 12 - 4 * ( irq % 4);
- if( irq > 67)
- prioreg = INTC_IPRB;
- else
- prioreg = INTC_IPRA;
- }
-
- /*
- * Set the interrupt priority register
- */
- _CPU_ISR_Disable( level );
-
- temp16 = read16( prioreg);
- temp16 &= ~( 15 << shiftcount);
- temp16 |= prio << shiftcount;
- write16( temp16, prioreg);
-
- _CPU_ISR_Enable( level );
-
- return 0;
-}
-
-/*
- * _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.
- */
-
-void _CPU_Context_save_fp(
- void **fp_context_ptr
-)
-{
-}
-
-/*
- * _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.
- */
-
-void _CPU_Context_restore_fp(
- void **fp_context_ptr
-)
-{
-}
-
-/* _CPU_Context_switch
- *
- * This routine performs a normal non-FP context switch.
- */
-
-/* within __CPU_Context_switch:
- * _CPU_Context_switch
- * _CPU_Context_restore
- *
- * This routine is generally used only to restart self in an
- * efficient manner. It may simply be a label in _CPU_Context_switch.
- *
- * NOTE: It should be safe not to store r4, r5
- *
- * NOTE: It is doubtful if r0 is really needed to be stored
- *
- * NOTE: gbr is added, but should not be necessary, as it is
- * only used globally in this port.
- */
-
-/*
- * FIXME: This is an ugly hack, but we wanted to avoid recalculating
- * the offset each time Context_Control is changed
- */
-void __CPU_Context_switch(
- Context_Control *run, /* r4 */
- Context_Control *heir /* r5 */
-)
-{
-
-asm volatile("
- .global __CPU_Context_switch
-__CPU_Context_switch:
-
- add %0,r4
-
- stc.l sr,@-r4
- stc.l gbr,@-r4
- mov.l r0,@-r4
- mov.l r1,@-r4
- mov.l r2,@-r4
- mov.l r3,@-r4
-
- mov.l r6,@-r4
- mov.l r7,@-r4
- mov.l r8,@-r4
- mov.l r9,@-r4
- mov.l r10,@-r4
- mov.l r11,@-r4
- mov.l r12,@-r4
- mov.l r13,@-r4
- mov.l r14,@-r4
- sts.l pr,@-r4
- sts.l mach,@-r4
- sts.l macl,@-r4
- mov.l r15,@-r4
-
- mov r5, r4"
- :: "I" (sizeof(Context_Control))
- );
-
- asm volatile("
- .global __CPU_Context_restore
-__CPU_Context_restore:
- mov.l @r4+,r15
- lds.l @r4+,macl
- lds.l @r4+,mach
- lds.l @r4+,pr
- mov.l @r4+,r14
- mov.l @r4+,r13
- mov.l @r4+,r12
- mov.l @r4+,r11
- mov.l @r4+,r10
- mov.l @r4+,r9
- mov.l @r4+,r8
- mov.l @r4+,r7
- mov.l @r4+,r6
-
- mov.l @r4+,r3
- mov.l @r4+,r2
- mov.l @r4+,r1
- mov.l @r4+,r0
- ldc.l @r4+,gbr
- ldc.l @r4+,sr
-
- rts
- nop" );
-}
-
-/*
- * This routine provides the RTEMS interrupt management.
- */
-
-void __ISR_Handler( unsigned32 vector)
-{
- register unsigned32 level;
-
- _CPU_ISR_Disable( level );
-
- _Thread_Dispatch_disable_level++;
-
-#if( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
- if( _ISR_Nest_level == 0 )
- {
- /* Install irq stack */
- _old_stack_ptr = stack_ptr;
- stack_ptr = _CPU_Interrupt_stack_high;
- }
-
-#endif
-
- _ISR_Nest_level++;
-
- _CPU_ISR_Enable( level );
-
- /* call isp */
- if( _ISR_Vector_table[ vector])
- (*_ISR_Vector_table[ vector ])( vector );
-
- _CPU_ISR_Disable( level );
-
- _ISR_Nest_level--;
-
-#if( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
-
- if( _ISR_Nest_level == 0 )
- /* restore old stack pointer */
- stack_ptr = _old_stack_ptr;
-#endif
-
- _Thread_Dispatch_disable_level--;
-
- _CPU_ISR_Enable( level );
-
- if ( _Thread_Dispatch_disable_level == 0 )
- {
- if(( _Context_Switch_necessary) || (! _ISR_Signals_to_thread_executing))
- {
- _ISR_Signals_to_thread_executing = FALSE;
- _Thread_Dispatch();
- }
- }
-}
diff --git a/c/src/lib/libcpu/sparc/Makefile.in b/c/src/lib/libcpu/sparc/Makefile.in
deleted file mode 100644
index 51795c3e3b..0000000000
--- a/c/src/lib/libcpu/sparc/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=reg_win
diff --git a/c/src/lib/libcpu/sparc/include/erc32.h b/c/src/lib/libcpu/sparc/include/erc32.h
deleted file mode 100644
index 50df21267f..0000000000
--- a/c/src/lib/libcpu/sparc/include/erc32.h
+++ /dev/null
@@ -1,521 +0,0 @@
-/* erc32.h
- *
- * This include file contains information pertaining to the ERC32.
- * The ERC32 is a custom SPARC V7 implementation based on the Cypress
- * 601/602 chipset. This CPU has a number of on-board peripherals and
- * was developed by the European Space Agency to target space applications.
- *
- * NOTE: Other than where absolutely required, this version currently
- * supports only the peripherals and bits used by the basic board
- * support package. This includes at least significant pieces of
- * the following items:
- *
- * + UART Channels A and B
- * + General Purpose Timer
- * + Real Time Clock
- * + Watchdog Timer (so it can be disabled)
- * + Control Register (so powerdown mode can be enabled)
- * + Memory Control Register
- * + Interrupt Control
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_ERC32_h
-#define _INCLUDE_ERC32_h
-
-#include <rtems/score/sparc.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Interrupt Sources
- *
- * The interrupt source numbers directly map to the trap type and to
- * the bits used in the Interrupt Clear, Interrupt Force, Interrupt Mask,
- * and the Interrupt Pending Registers.
- */
-
-#define ERC32_INTERRUPT_MASKED_ERRORS 1
-#define ERC32_INTERRUPT_EXTERNAL_1 2
-#define ERC32_INTERRUPT_EXTERNAL_2 3
-#define ERC32_INTERRUPT_UART_A_RX_TX 4
-#define ERC32_INTERRUPT_UART_B_RX_TX 5
-#define ERC32_INTERRUPT_CORRECTABLE_MEMORY_ERROR 6
-#define ERC32_INTERRUPT_UART_ERROR 7
-#define ERC32_INTERRUPT_DMA_ACCESS_ERROR 8
-#define ERC32_INTERRUPT_DMA_TIMEOUT 9
-#define ERC32_INTERRUPT_EXTERNAL_3 10
-#define ERC32_INTERRUPT_EXTERNAL_4 11
-#define ERC32_INTERRUPT_GENERAL_PURPOSE_TIMER 12
-#define ERC32_INTERRUPT_REAL_TIME_CLOCK 13
-#define ERC32_INTERRUPT_EXTERNAL_5 14
-#define ERC32_INTERRUPT_WATCHDOG_TIMEOUT 15
-
-#ifndef ASM
-
-/*
- * Trap Types for on-chip peripherals
- *
- * Source: Table 8 - Interrupt Trap Type and Default Priority Assignments
- *
- * NOTE: The priority level for each source corresponds to the least
- * significant nibble of the trap type.
- */
-
-#define ERC32_TRAP_TYPE( _source ) SPARC_ASYNCHRONOUS_TRAP((_source) + 0x10)
-
-#define ERC32_TRAP_SOURCE( _trap ) ((_trap) - 0x10)
-
-#define ERC32_Is_MEC_Trap( _trap ) \
- ( (_trap) >= ERC32_TRAP_TYPE( ERC32_INTERRUPT_MASKED_ERRORS ) && \
- (_trap) <= ERC32_TRAP_TYPE( ERC32_INTERRUPT_WATCHDOG_TIMEOUT ) )
-
-/*
- * Structure for ERC32 memory mapped registers.
- *
- * Source: Section 3.25.2 - Register Address Map
- *
- * NOTE: There is only one of these structures per CPU, its base address
- * is 0x01f80000, and the variable MEC is placed there by the
- * linkcmds file.
- */
-
-typedef struct {
- volatile unsigned32 Control; /* offset 0x00 */
- volatile unsigned32 Software_Reset; /* offset 0x04 */
- volatile unsigned32 Power_Down; /* offset 0x08 */
- volatile unsigned32 Unimplemented_0; /* offset 0x0c */
- volatile unsigned32 Memory_Configuration; /* offset 0x10 */
- volatile unsigned32 IO_Configuration; /* offset 0x14 */
- volatile unsigned32 Wait_State_Configuration; /* offset 0x18 */
- volatile unsigned32 Unimplemented_1; /* offset 0x1c */
- volatile unsigned32 Memory_Access_0; /* offset 0x20 */
- volatile unsigned32 Memory_Access_1; /* offset 0x24 */
- volatile unsigned32 Unimplemented_2[ 7 ]; /* offset 0x28 */
- volatile unsigned32 Interrupt_Shape; /* offset 0x44 */
- volatile unsigned32 Interrupt_Pending; /* offset 0x48 */
- volatile unsigned32 Interrupt_Mask; /* offset 0x4c */
- volatile unsigned32 Interrupt_Clear; /* offset 0x50 */
- volatile unsigned32 Interrupt_Force; /* offset 0x54 */
- volatile unsigned32 Unimplemented_3[ 2 ]; /* offset 0x58 */
- /* offset 0x60 */
- volatile unsigned32 Watchdog_Program_and_Timeout_Acknowledge;
- volatile unsigned32 Watchdog_Trap_Door_Set; /* offset 0x64 */
- volatile unsigned32 Unimplemented_4[ 6 ]; /* offset 0x68 */
- volatile unsigned32 Real_Time_Clock_Counter; /* offset 0x80 */
- volatile unsigned32 Real_Time_Clock_Scalar; /* offset 0x84 */
- volatile unsigned32 General_Purpose_Timer_Counter; /* offset 0x88 */
- volatile unsigned32 General_Purpose_Timer_Scalar; /* offset 0x8c */
- volatile unsigned32 Unimplemented_5[ 2 ]; /* offset 0x90 */
- volatile unsigned32 Timer_Control; /* offset 0x98 */
- volatile unsigned32 Unimplemented_6; /* offset 0x9c */
- volatile unsigned32 System_Fault_Status; /* offset 0xa0 */
- volatile unsigned32 First_Failing_Address; /* offset 0xa4 */
- volatile unsigned32 First_Failing_Data; /* offset 0xa8 */
- volatile unsigned32 First_Failing_Syndrome_and_Check_Bits;/* offset 0xac */
- volatile unsigned32 Error_and_Reset_Status; /* offset 0xb0 */
- volatile unsigned32 Error_Mask; /* offset 0xb4 */
- volatile unsigned32 Unimplemented_7[ 2 ]; /* offset 0xb8 */
- volatile unsigned32 Debug_Control; /* offset 0xc0 */
- volatile unsigned32 Breakpoint; /* offset 0xc4 */
- volatile unsigned32 Watchpoint; /* offset 0xc8 */
- volatile unsigned32 Unimplemented_8; /* offset 0xcc */
- volatile unsigned32 Test_Control; /* offset 0xd0 */
- volatile unsigned32 Test_Data; /* offset 0xd4 */
- volatile unsigned32 Unimplemented_9[ 2 ]; /* offset 0xd8 */
- volatile unsigned32 UART_Channel_A; /* offset 0xe0 */
- volatile unsigned32 UART_Channel_B; /* offset 0xe4 */
- volatile unsigned32 UART_Status; /* offset 0xe8 */
-} ERC32_Register_Map;
-
-#endif
-
-/*
- * The following constants are intended to be used ONLY in assembly
- * language files.
- *
- * NOTE: The intended style of usage is to load the address of MEC
- * into a register and then use these as displacements from
- * that register.
- */
-
-#ifdef ASM
-
-#define ERC32_MEC_CONTROL_OFFSET 0x00
-#define ERC32_MEC_SOFTWARE_RESET_OFFSET 0x04
-#define ERC32_MEC_POWER_DOWN_OFFSET 0x08
-#define ERC32_MEC_UNIMPLEMENTED_0_OFFSET 0x0C
-#define ERC32_MEC_MEMORY_CONFIGURATION_OFFSET 0x10
-#define ERC32_MEC_IO_CONFIGURATION_OFFSET 0x14
-#define ERC32_MEC_WAIT_STATE_CONFIGURATION_OFFSET 0x18
-#define ERC32_MEC_UNIMPLEMENTED_1_OFFSET 0x1C
-#define ERC32_MEC_MEMORY_ACCESS_0_OFFSET 0x20
-#define ERC32_MEC_MEMORY_ACCESS_1_OFFSET 0x24
-#define ERC32_MEC_UNIMPLEMENTED_2_OFFSET 0x28
-#define ERC32_MEC_INTERRUPT_SHAPE_OFFSET 0x44
-#define ERC32_MEC_INTERRUPT_PENDING_OFFSET 0x48
-#define ERC32_MEC_INTERRUPT_MASK_OFFSET 0x4C
-#define ERC32_MEC_INTERRUPT_CLEAR_OFFSET 0x50
-#define ERC32_MEC_INTERRUPT_FORCE_OFFSET 0x54
-#define ERC32_MEC_UNIMPLEMENTED_3_OFFSET 0x58
-#define ERC32_MEC_WATCHDOG_PROGRAM_AND_TIMEOUT_ACKNOWLEDGE_OFFSET 0x60
-#define ERC32_MEC_WATCHDOG_TRAP_DOOR_SET_OFFSET 0x64
-#define ERC32_MEC_UNIMPLEMENTED_4_OFFSET 0x6C
-#define ERC32_MEC_REAL_TIME_CLOCK_COUNTER_OFFSET 0x80
-#define ERC32_MEC_REAL_TIME_CLOCK_SCALAR_OFFSET 0x84
-#define ERC32_MEC_GENERAL_PURPOSE_TIMER_COUNTER_OFFSET 0x88
-#define ERC32_MEC_GENERAL_PURPOSE_TIMER_SCALAR_OFFSET 0x8C
-#define ERC32_MEC_UNIMPLEMENTED_5_OFFSET 0x90
-#define ERC32_MEC_TIMER_CONTROL_OFFSET 0x98
-#define ERC32_MEC_UNIMPLEMENTED_6_OFFSET 0x9C
-#define ERC32_MEC_SYSTEM_FAULT_STATUS_OFFSET 0xA0
-#define ERC32_MEC_FIRST_FAILING_ADDRESS_OFFSET 0xA4
-#define ERC32_MEC_FIRST_FAILING_DATA_OFFSET 0xA8
-#define ERC32_MEC_FIRST_FAILING_SYNDROME_AND_CHECK_BITS_OFFSET 0xAC
-#define ERC32_MEC_ERROR_AND_RESET_STATUS_OFFSET 0xB0
-#define ERC32_MEC_ERROR_MASK_OFFSET 0xB4
-#define ERC32_MEC_UNIMPLEMENTED_7_OFFSET 0xB8
-#define ERC32_MEC_DEBUG_CONTROL_OFFSET 0xC0
-#define ERC32_MEC_BREAKPOINT_OFFSET 0xC4
-#define ERC32_MEC_WATCHPOINT_OFFSET 0xC8
-#define ERC32_MEC_UNIMPLEMENTED_8_OFFSET 0xCC
-#define ERC32_MEC_TEST_CONTROL_OFFSET 0xD0
-#define ERC32_MEC_TEST_DATA_OFFSET 0xD4
-#define ERC32_MEC_UNIMPLEMENTED_9_OFFSET 0xD8
-#define ERC32_MEC_UART_CHANNEL_A_OFFSET 0xE0
-#define ERC32_MEC_UART_CHANNEL_B_OFFSET 0xE4
-#define ERC32_MEC_UART_STATUS_OFFSET 0xE8
-
-#endif
-
-/*
- * The following defines the bits in the Configuration Register.
- */
-
-#define ERC32_CONFIGURATION_POWER_DOWN_MASK 0x00000001
-#define ERC32_CONFIGURATION_POWER_DOWN_ALLOWED 0x00000001
-#define ERC32_CONFIGURATION_POWER_DOWN_DISABLED 0x00000000
-
-#define ERC32_CONFIGURATION_SOFTWARE_RESET_MASK 0x00000002
-#define ERC32_CONFIGURATION_SOFTWARE_RESET_ALLOWED 0x00000002
-#define ERC32_CONFIGURATION_SOFTWARE_RESET_DISABLED 0x00000000
-
-#define ERC32_CONFIGURATION_BUS_TIMEOUT_MASK 0x00000004
-#define ERC32_CONFIGURATION_BUS_TIMEOUT_ENABLED 0x00000004
-#define ERC32_CONFIGURATION_BUS_TIMEOUT_DISABLED 0x00000000
-
-#define ERC32_CONFIGURATION_ACCESS_PROTECTION_MASK 0x00000008
-#define ERC32_CONFIGURATION_ACCESS_PROTECTION_ENABLED 0x00000008
-#define ERC32_CONFIGURATION_ACCESS_PROTECTION_DISABLED 0x00000000
-
-
-/*
- * The following defines the bits in the Memory Configuration Register.
- */
-
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_MASK 0x00001C00
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_256K ( 0 << 10 )
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_512K ( 1 << 10 )
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_1MB ( 2 << 10 )
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_2MB ( 3 << 10 )
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_4MB ( 4 << 10 )
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_8MB ( 5 << 10 )
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_16MB ( 6 << 10 )
-#define ERC32_MEMORY_CONFIGURATION_RAM_SIZE_32MB ( 7 << 10 )
-
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_MASK 0x001C0000
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_128K ( 0 << 18 )
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_256K ( 1 << 18 )
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_512K ( 2 << 18 )
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_1M ( 3 << 18 )
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_2M ( 4 << 18 )
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_4M ( 5 << 18 )
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_8M ( 6 << 18 )
-#define ERC32_MEMORY_CONFIGURATION_PROM_SIZE_16M ( 7 << 18 )
-
-/*
- * The following defines the bits in the Timer Control Register.
- */
-
-#define ERC32_MEC_TIMER_CONTROL_GCR 0x00000001 /* 1 = reload at 0 */
- /* 0 = stop at 0 */
-#define ERC32_MEC_TIMER_CONTROL_GCL 0x00000002 /* 1 = load and start */
- /* 0 = no function */
-#define ERC32_MEC_TIMER_CONTROL_GSE 0x00000004 /* 1 = enable counting */
- /* 0 = hold scalar and counter */
-#define ERC32_MEC_TIMER_CONTROL_GSL 0x00000008 /* 1 = load scalar and start */
- /* 0 = no function */
-
-#define ERC32_MEC_TIMER_CONTROL_RTCCR 0x00000100 /* 1 = reload at 0 */
- /* 0 = stop at 0 */
-#define ERC32_MEC_TIMER_CONTROL_RTCCL 0x00000200 /* 1 = load and start */
- /* 0 = no function */
-#define ERC32_MEC_TIMER_CONTROL_RTCSE 0x00000400 /* 1 = enable counting */
- /* 0 = hold scalar and counter */
-#define ERC32_MEC_TIMER_CONTROL_RTCSL 0x00000800 /* 1 = load scalar and start */
- /* 0 = no function */
-
-/*
- * The following defines the bits in the UART Control Registers.
- *
- */
-
-#define ERC32_MEC_UART_CONTROL_RTD 0x000000FF /* RX/TX data */
-
-/*
- * The following defines the bits in the MEC UART Control Registers.
- */
-
-#define ERC32_MEC_UART_STATUS_DR 0x00000001 /* Data Ready */
-#define ERC32_MEC_UART_STATUS_TSE 0x00000002 /* TX Send Register Empty */
-#define ERC32_MEC_UART_STATUS_THE 0x00000004 /* TX Hold Register Empty */
-#define ERC32_MEC_UART_STATUS_FE 0x00000010 /* RX Framing Error */
-#define ERC32_MEC_UART_STATUS_PE 0x00000020 /* RX Parity Error */
-#define ERC32_MEC_UART_STATUS_OE 0x00000040 /* RX Overrun Error */
-#define ERC32_MEC_UART_STATUS_CU 0x00000080 /* Clear Errors */
-#define ERC32_MEC_UART_STATUS_TXE 0x00000006 /* TX Empty */
-#define ERC32_MEC_UART_STATUS_CLRA 0x00000080 /* Clear UART A */
-#define ERC32_MEC_UART_STATUS_CLRB 0x00800000 /* Clear UART B */
-#define ERC32_MEC_UART_STATUS_ERRA 0x00000070 /* Error in UART A */
-#define ERC32_MEC_UART_STATUS_ERRB 0x00700000 /* Error in UART B */
-
-#define ERC32_MEC_UART_STATUS_DRA (ERC32_MEC_UART_STATUS_DR << 0)
-#define ERC32_MEC_UART_STATUS_TSEA (ERC32_MEC_UART_STATUS_TSE << 0)
-#define ERC32_MEC_UART_STATUS_THEA (ERC32_MEC_UART_STATUS_THE << 0)
-#define ERC32_MEC_UART_STATUS_FEA (ERC32_MEC_UART_STATUS_FE << 0)
-#define ERC32_MEC_UART_STATUS_PEA (ERC32_MEC_UART_STATUS_PE << 0)
-#define ERC32_MEC_UART_STATUS_OEA (ERC32_MEC_UART_STATUS_OE << 0)
-#define ERC32_MEC_UART_STATUS_CUA (ERC32_MEC_UART_STATUS_CU << 0)
-#define ERC32_MEC_UART_STATUS_TXEA (ERC32_MEC_UART_STATUS_TXE << 0)
-
-#define ERC32_MEC_UART_STATUS_DRB (ERC32_MEC_UART_STATUS_DR << 16)
-#define ERC32_MEC_UART_STATUS_TSEB (ERC32_MEC_UART_STATUS_TSE << 16)
-#define ERC32_MEC_UART_STATUS_THEB (ERC32_MEC_UART_STATUS_THE << 16)
-#define ERC32_MEC_UART_STATUS_FEB (ERC32_MEC_UART_STATUS_FE << 16)
-#define ERC32_MEC_UART_STATUS_PEB (ERC32_MEC_UART_STATUS_PE << 16)
-#define ERC32_MEC_UART_STATUS_OEB (ERC32_MEC_UART_STATUS_OE << 16)
-#define ERC32_MEC_UART_STATUS_CUB (ERC32_MEC_UART_STATUS_CU << 16)
-#define ERC32_MEC_UART_STATUS_TXEB (ERC32_MEC_UART_STATUS_TXE << 16)
-
-#ifndef ASM
-
-/*
- * This is used to manipulate the on-chip registers.
- *
- * The following symbol must be defined in the linkcmds file and point
- * to the correct location.
- */
-
-extern ERC32_Register_Map ERC32_MEC;
-
-/*
- * Macros to manipulate the Interrupt Clear, Interrupt Force, Interrupt Mask,
- * and the Interrupt Pending Registers.
- *
- * NOTE: For operations which are not atomic, this code disables interrupts
- * to guarantee there are no intervening accesses to the same register.
- * The operations which read the register, modify the value and then
- * store the result back are vulnerable.
- */
-
-#define ERC32_Clear_interrupt( _source ) \
- do { \
- ERC32_MEC.Interrupt_Clear = (1 << (_source)); \
- } while (0)
-
-#define ERC32_Force_interrupt( _source ) \
- do { \
- unsigned32 _level; \
- \
- sparc_disable_interrupts( _level ); \
- ERC32_MEC.Test_Control = ERC32_MEC.Test_Control | 0x80000; \
- ERC32_MEC.Interrupt_Force = (1 << (_source)); \
- sparc_enable_interrupts( _level ); \
- } while (0)
-
-#define ERC32_Is_interrupt_pending( _source ) \
- (ERC32_MEC.Interrupt_Pending & (1 << (_source)))
-
-#define ERC32_Is_interrupt_masked( _source ) \
- (ERC32_MEC.Interrupt_Masked & (1 << (_source)))
-
-#define ERC32_Mask_interrupt( _source ) \
- do { \
- unsigned32 _level; \
- \
- sparc_disable_interrupts( _level ); \
- ERC32_MEC.Interrupt_Mask |= (1 << (_source)); \
- sparc_enable_interrupts( _level ); \
- } while (0)
-
-#define ERC32_Unmask_interrupt( _source ) \
- do { \
- unsigned32 _level; \
- \
- sparc_disable_interrupts( _level ); \
- ERC32_MEC.Interrupt_Mask &= ~(1 << (_source)); \
- sparc_enable_interrupts( _level ); \
- } while (0)
-
-#define ERC32_Disable_interrupt( _source, _previous ) \
- do { \
- unsigned32 _level; \
- unsigned32 _mask = 1 << (_source); \
- \
- sparc_disable_interrupts( _level ); \
- (_previous) = ERC32_MEC.Interrupt_Mask; \
- ERC32_MEC.Interrupt_Mask = _previous | _mask; \
- sparc_enable_interrupts( _level ); \
- (_previous) &= ~_mask; \
- } while (0)
-
-#define ERC32_Restore_interrupt( _source, _previous ) \
- do { \
- unsigned32 _level; \
- unsigned32 _mask = 1 << (_source); \
- \
- sparc_disable_interrupts( _level ); \
- ERC32_MEC.Interrupt_Mask = \
- (ERC32_MEC.Interrupt_Mask & ~_mask) | (_previous); \
- sparc_enable_interrupts( _level ); \
- } while (0)
-
-/*
- * The following macros attempt to hide the fact that the General Purpose
- * Timer and Real Time Clock Timer share the Timer Control Register. Because
- * the Timer Control Register is write only, we must mirror it in software
- * and insure that writes to one timer do not alter the current settings
- * and status of the other timer.
- *
- * This code promotes the view that the two timers are completely independent.
- * By exclusively using the routines below to access the Timer Control
- * Register, the application can view the system as having a General Purpose
- * Timer Control Register and a Real Time Clock Timer Control Register
- * rather than the single shared value.
- *
- * Each logical timer control register is organized as follows:
- *
- * D0 - Counter Reload
- * 1 = reload counter at zero and restart
- * 0 = stop counter at zero
- *
- * D1 - Counter Load
- * 1 = load counter with preset value and restart
- * 0 = no function
- *
- * D2 - Enable
- * 1 = enable counting
- * 0 = hold scaler and counter
- *
- * D3 - Scaler Load
- * 1 = load scalar with preset value and restart
- * 0 = no function
- *
- * To insure the management of the mirror is atomic, we disable interrupts
- * around updates.
- */
-
-#define ERC32_MEC_TIMER_COUNTER_RELOAD_AT_ZERO 0x00000001
-#define ERC32_MEC_TIMER_COUNTER_STOP_AT_ZERO 0x00000000
-
-#define ERC32_MEC_TIMER_COUNTER_LOAD_COUNTER 0x00000002
-
-#define ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING 0x00000004
-#define ERC32_MEC_TIMER_COUNTER_DISABLE_COUNTING 0x00000000
-
-#define ERC32_MEC_TIMER_COUNTER_LOAD_SCALER 0x00000008
-
-#define ERC32_MEC_TIMER_COUNTER_RELOAD_MASK 0x00000001
-#define ERC32_MEC_TIMER_COUNTER_ENABLE_MASK 0x00000004
-
-#define ERC32_MEC_TIMER_COUNTER_DEFINED_MASK 0x0000000F
-#define ERC32_MEC_TIMER_COUNTER_CURRENT_MODE_MASK 0x00000005
-
-extern unsigned32 _ERC32_MEC_Timer_Control_Mirror;
-
-/*
- * This macros manipulate the General Purpose Timer portion of the
- * Timer Control register and promote the view that there are actually
- * two independent Timer Control Registers.
- */
-
-#define ERC32_MEC_Set_General_Purpose_Timer_Control( _value ) \
- do { \
- unsigned32 _level; \
- unsigned32 _control; \
- unsigned32 __value; \
- \
- __value = ((_value) & 0x0f); \
- sparc_disable_interrupts( _level ); \
- _control = _ERC32_MEC_Timer_Control_Mirror; \
- _control &= ERC32_MEC_TIMER_COUNTER_DEFINED_MASK << 8; \
- _ERC32_MEC_Timer_Control_Mirror = _control | _value; \
- _control &= (ERC32_MEC_TIMER_COUNTER_CURRENT_MODE_MASK << 8); \
- _control |= __value; \
- /* printf( "GPT 0x%x 0x%x 0x%x\n", _value, __value, _control ); */ \
- ERC32_MEC.Timer_Control = _control; \
- sparc_enable_interrupts( _level ); \
- } while ( 0 )
-
-#define ERC32_MEC_Get_General_Purpose_Timer_Control( _value ) \
- do { \
- (_value) = _ERC32_MEC_Timer_Control_Mirror & 0xf; \
- } while ( 0 )
-
-/*
- * This macros manipulate the Real Timer Clock Timer portion of the
- * Timer Control register and promote the view that there are actually
- * two independent Timer Control Registers.
- */
-
-#define ERC32_MEC_Set_Real_Time_Clock_Timer_Control( _value ) \
- do { \
- unsigned32 _level; \
- unsigned32 _control; \
- unsigned32 __value; \
- \
- __value = ((_value) & 0x0f) << 8; \
- sparc_disable_interrupts( _level ); \
- _control = _ERC32_MEC_Timer_Control_Mirror; \
- _control &= ERC32_MEC_TIMER_COUNTER_DEFINED_MASK; \
- _ERC32_MEC_Timer_Control_Mirror = _control | __value; \
- _control &= ERC32_MEC_TIMER_COUNTER_CURRENT_MODE_MASK; \
- _control |= __value; \
- /* printf( "RTC 0x%x 0x%x 0x%x\n", _value, __value, _control ); */ \
- ERC32_MEC.Timer_Control = _control; \
- sparc_enable_interrupts( _level ); \
- } while ( 0 )
-
-#define ERC32_MEC_Get_Real_Time_Clock_Timer_Control( _value ) \
- do { \
- (_value) = (_ERC32_MEC_Timer_Control_Mirror >> 8) & 0xf; \
- } while ( 0 )
-
-
-#endif /* !ASM */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_INCLUDE_ERC32_h */
-/* end of include file */
-
diff --git a/c/src/lib/libcpu/sparc/reg_win/Makefile.in b/c/src/lib/libcpu/sparc/reg_win/Makefile.in
deleted file mode 100644
index 5fea203cfb..0000000000
--- a/c/src/lib/libcpu/sparc/reg_win/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/reg_win.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=window
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
-
-# the .rel file built here will be put into libbsp.a by
-# libbsp/sparc/BSP/wrapup/Makefile
-install: all
diff --git a/c/src/lib/libcpu/sparc/reg_win/window.s b/c/src/lib/libcpu/sparc/reg_win/window.s
deleted file mode 100644
index c21e73ebb4..0000000000
--- a/c/src/lib/libcpu/sparc/reg_win/window.s
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * window.s
- *
- * This file contains the register window management routines for the
- * SPARC architecture. Trap handlers for the following capabilities
- * are included in this file:
- *
- * + Window Overflow
- * + Window Underflow
- * + Flushing All Windows
- *
- * COPYRIGHT:
- *
- * This file includes the window overflow and underflow handlers from
- * the file srt0.s provided with the binary distribution of the SPARC
- * Instruction Simulator (SIS) found at
- * ftp://ftp.estec.esa.nl/pub/ws/wsd/erc32.
- *
- * COPYRIGHT (c) 1995. European Space Agency.
- *
- * This terms of the RTEMS license apply to this file.
- *
- * $Id$
- */
-
-#include <asm.h>
-
- .seg "text"
- /*
- * Window overflow trap handler.
- *
- * On entry:
- *
- * l0 = psr (from trap table)
- * l1 = pc
- * l2 = npc
- */
-
- PUBLIC(window_overflow_trap_handler)
-
-SYM(window_overflow_trap_handler):
-
- /*
- * Calculate new WIM by "rotating" the valid bits in the WIM right
- * by one position. The following shows how the bits move for a SPARC
- * cpu implementation where SPARC_NUMBER_OF_REGISTER_WINDOWS is 8.
- *
- * OLD WIM = 76543210
- * NEW WIM = 07654321
- *
- * NOTE: New WIM must be stored in a global register since the
- * "save" instruction just prior to the load of the wim
- * register will result in the local register set changing.
- */
-
- mov %wim, %l3 ! l3 = WIM
- mov %g1, %l7 ! save g1
- srl %l3, 1, %g1 ! g1 = WIM >> 1
- sll %l3, SPARC_NUMBER_OF_REGISTER_WINDOWS-1 , %l4
- ! l4 = WIM << (Number Windows - 1)
- or %l4, %g1, %g1 ! g1 = (WIM >> 1) |
- ! (WIM << (Number Windows - 1))
-
- save ! Get into window to be saved.
- mov %g1, %wim ! load new WIM
- nop; nop; nop ! 3 slot delay
- std %l0, [%sp + 0x00] ! save local register set
- std %l2, [%sp + 0x08]
- std %l4, [%sp + 0x10]
- std %l6, [%sp + 0x18]
- std %i0, [%sp + 0x20] ! save input register set
- std %i2, [%sp + 0x28]
- std %i4, [%sp + 0x30]
- std %i6, [%sp + 0x38]
- restore ! Go back to trap window.
- mov %l7, %g1 ! restore g1
- jmp %l1 ! Re-execute save.
- rett %l2
-
- /*
- * Window underflow trap handler.
- *
- * On entry:
- *
- * l0 = psr (from trap table)
- * l1 = pc
- * l2 = npc
- */
-
- PUBLIC(window_underflow_trap_handler)
-
-SYM(window_underflow_trap_handler):
-
- /*
- * Calculate new WIM by "rotating" the valid bits in the WIM left
- * by one position. The following shows how the bits move for a SPARC
- * cpu implementation where SPARC_NUMBER_OF_REGISTER_WINDOWS is 8.
- *
- * OLD WIM = 76543210
- * NEW WIM = 07654321
- *
- * NOTE: New WIM must be stored in a global register since the
- * "save" instruction just prior to the load of the wim
- * register will result in the local register set changing.
- */
-
- mov %wim, %l3 ! Calculate new WIM
- sll %l3, 1, %l4 ! l4 = WIM << 1
- srl %l3, SPARC_NUMBER_OF_REGISTER_WINDOWS-1, %l5
- ! l5 = WIM >> (Number Windows-1)
- or %l5, %l4, %l5 ! l5 = (WIM << 1) |
- ! (WIM >> (Number Windows-1))
- mov %l5, %wim ! load the new WIM
- nop; nop; nop
- restore ! Two restores to get into the
- restore ! window to restore
- ldd [%sp + 0x00], %l0 ! First the local register set
- ldd [%sp + 0x08], %l2
- ldd [%sp + 0x10], %l4
- ldd [%sp + 0x18], %l6
- ldd [%sp + 0x20], %i0 ! Then the input registers
- ldd [%sp + 0x28], %i2
- ldd [%sp + 0x30], %i4
- ldd [%sp + 0x38], %i6
- save ! Get back to the trap window.
- save
- jmp %l1 ! Re-execute restore.
- rett %l2
-
- /*
- * Flush All Windows trap handler.
- *
- * Flush all windows with valid contents except the current one
- * and the one we will be returning to.
- *
- * In examining the set register windows, one may logically divide
- * the windows into sets (some of which may be empty) based on their
- * current status:
- *
- * + current (i.e. in use),
- * + used (i.e. a restore would not trap)
- * + invalid (i.e. 1 in corresponding bit in WIM)
- * + unused
- *
- * Either the used or unused set of windows may be empty.
- *
- * NOTE: We assume only one bit is set in the WIM at a time.
- *
- * Given a CWP of 5 and a WIM of 0x1, the registers are divided
- * into sets as follows:
- *
- * + 0 - invalid
- * + 1-4 - unused
- * + 5 - current
- * + 6-7 - used
- *
- * In this case, we only would save the used windows which we
- * will not be returning to -- 6.
- *
- * Register Usage while saving the windows:
- * g1 = current PSR
- * g2 = current wim
- * g3 = CWP
- * g4 = wim scratch
- * g5 = scratch
- *
- * On entry:
- *
- * l0 = psr (from trap table)
- * l1 = pc
- * l2 = npc
- */
-
- PUBLIC(window_flush_trap_handler)
-
-SYM(window_flush_trap_handler):
- /*
- * Save the global registers we will be using
- */
-
- mov %g1, %l3
- mov %g2, %l4
- mov %g3, %l5
- mov %g4, %l6
- mov %g5, %l7
-
- mov %l0, %g1 ! g1 = psr
- mov %wim, %g2 ! g2 = wim
- and %l0, SPARC_PSR_CWP_MASK, %g3 ! g3 = CWP
-
- add %g3, 1, %g5 ! g5 = CWP + 1
- and %g5, SPARC_NUMBER_OF_REGISTER_WINDOWS - 1, %g5
-
- mov 1, %g4
- sll %g4, %g5, %g4 ! g4 = WIM mask for CWP+1 invalid
-
- restore ! go back one register window
-
-save_frame_loop:
- sll %g4, 1, %g5 ! rotate the "wim" left 1
- srl %g4, SPARC_NUMBER_OF_REGISTER_WINDOWS - 1, %g4
- or %g4, %g5, %g4 ! g4 = wim if we do one restore
-
- /*
- * If a restore would not underflow, then continue.
- */
-
- andcc %g4, %g2, %g0 ! Any windows to flush?
- bnz done_flushing ! No, then continue
- nop
-
- restore ! back one window
-
- /*
- * Now save the window just as if we overflowed to it.
- */
-
- std %l0, [%sp + CPU_STACK_FRAME_L0_OFFSET]
- std %l2, [%sp + CPU_STACK_FRAME_L2_OFFSET]
- std %l4, [%sp + CPU_STACK_FRAME_L4_OFFSET]
- std %l6, [%sp + CPU_STACK_FRAME_L6_OFFSET]
-
- std %i0, [%sp + CPU_STACK_FRAME_I0_OFFSET]
- std %i2, [%sp + CPU_STACK_FRAME_I2_OFFSET]
- std %i4, [%sp + CPU_STACK_FRAME_I4_OFFSET]
- std %i6, [%sp + CPU_STACK_FRAME_I6_FP_OFFSET]
-
- ba save_frame_loop
- nop
-
-done_flushing:
-
- add %g3, 2, %g3 ! calculate desired WIM
- and %g3, SPARC_NUMBER_OF_REGISTER_WINDOWS - 1, %g3
- mov 1, %g4
- sll %g4, %g3, %g4 ! g4 = new WIM
- mov %g4, %wim
-
- mov %g1, %psr ! restore PSR
- nop
- nop
- nop
-
- /*
- * Restore the global registers we used
- */
-
- mov %l3, %g1
- mov %l4, %g2
- mov %l5, %g3
- mov %l6, %g4
- mov %l7, %g5
-
- jmpl %l2, %g0
- rett %l2 + 4
-
-/* end of file */
diff --git a/c/src/lib/libmisc/Makefile.in b/c/src/lib/libmisc/Makefile.in
deleted file mode 100644
index 694266ae07..0000000000
--- a/c/src/lib/libmisc/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=assoc error stackchk monitor cpuuse rtmonuse wrapup
diff --git a/c/src/lib/libmisc/README b/c/src/lib/libmisc/README
deleted file mode 100644
index bbde4feeae..0000000000
--- a/c/src/lib/libmisc/README
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# $Id$
-#
-
-This directory contains for the "miscellaneous" library. Currently
-this library contains a number of useful support libraries:
-
- + Task Stack Overflow Checker
- + Workspace Consistency Checker
- + Task Execution Time Monitor
- + Period Statistics Monitor
- + Debug Monitor
-
-The following ideas have been mentioned for items which could go
-in this library, but this list is not all inclusive:
-
- + there are no outstanding suggestions.
-
-The intent of this library is to provide a home for useful utility routines
-which are dependent upon RTEMS.
-
---joel
-16 Sept 97
diff --git a/c/src/lib/libmisc/assoc/Makefile.in b/c/src/lib/libmisc/assoc/Makefile.in
deleted file mode 100644
index a547bb6565..0000000000
--- a/c/src/lib/libmisc/assoc/Makefile.in
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIB=${ARCH}/libassoc-tmp.a
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=assoc
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/assoc.h
-
-SRCS=$(C_FILES) $(H_FILES) $(INSTALLED_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${LIB}: ${SRCS} ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/lib/libmisc/assoc/assoc.c b/c/src/lib/libmisc/assoc/assoc.c
deleted file mode 100644
index 74387a8c5b..0000000000
--- a/c/src/lib/libmisc/assoc/assoc.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * assoc.c
- * rtems assoc routines
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include "assoc.h"
-
-#include <stdio.h> /* sprintf */
-#include <string.h> /* strcat, strcmp */
-
-#define STREQ(a,b) (strcmp((a), (b)) == 0)
-#define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME))
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (strcmp(ap->name, name) == 0)
- return ap;
-
- return default_ap;
-}
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (ap->local_value == local_value)
- return ap;
-
- return default_ap;
-}
-
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (ap->remote_value == remote_value)
- return ap;
-
- return default_ap;
-}
-
-
-/*
- * Get values
- */
-
-unsigned32
-rtems_assoc_remote_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_local(ap, local_value);
- if (nap)
- return nap->remote_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_local_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_remote(ap, remote_value);
- if (nap)
- return nap->local_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_remote_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_name(ap, name);
- if (nap)
- return nap->remote_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_local_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_name(ap, name);
- if (nap)
- return nap->local_value;
-
- return 0;
-}
-
-/*
- * what to return if a value is not found
- * this is not reentrant, but it really shouldn't be invoked anyway
- */
-
-const char *
-rtems_assoc_name_bad(
- unsigned32 bad_value
-)
-{
-#ifdef RTEMS_DEBUG
- static char bad_buffer[32];
-
- sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
-#else
- static char bad_buffer[32] = "<assoc.c: BAD NAME>";
-#endif
- return bad_buffer;
-}
-
-
-const char *
-rtems_assoc_name_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_local(ap, local_value);
- if (nap)
- return nap->name;
-
- return rtems_assoc_name_bad(local_value);
-}
-
-const char *
-rtems_assoc_name_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_remote(ap, remote_value);
- if (nap)
- return nap->name;
-
- return rtems_assoc_name_bad(remote_value);
-}
-
-/*
- * Bitfield functions assume just 1 bit set in each of remote and local
- * entries; they do not check for this.
- */
-
-unsigned32 rtems_assoc_remote_by_local_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- unsigned32 b;
- unsigned32 remote_value = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & local_value)
- remote_value |= rtems_assoc_remote_by_local(ap, b);
-
- return remote_value;
-}
-
-
-unsigned32 rtems_assoc_local_by_remote_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- unsigned32 b;
- unsigned32 local_value = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & remote_value)
- local_value |= rtems_assoc_local_by_remote(ap, b);
-
- return local_value;
-}
-
-char *
-rtems_assoc_name_by_remote_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 value,
- char *buffer
- )
-{
- unsigned32 b;
-
- *buffer = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (*buffer)
- strcat(buffer, " ");
- strcat(buffer, rtems_assoc_name_by_remote(ap, b));
- }
-
- return buffer;
-}
-
-char *
-rtems_assoc_name_by_local_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 value,
- char *buffer
- )
-{
- unsigned32 b;
-
- *buffer = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (*buffer)
- strcat(buffer, " ");
- strcat(buffer, rtems_assoc_name_by_local(ap, b));
- }
-
- return buffer;
-}
diff --git a/c/src/lib/libmisc/assoc/assoc.h b/c/src/lib/libmisc/assoc/assoc.h
deleted file mode 100644
index 1982d654ac..0000000000
--- a/c/src/lib/libmisc/assoc/assoc.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Rtems associativity routines. Mainly used to convert a value from
- * one space to another (eg: our errno's to host errno's and v.v)
- *
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_ASSOC_H
-#define _INCLUDE_ASSOC_H
-
-typedef struct {
- const char *name;
- unsigned32 local_value;
- unsigned32 remote_value;
-} rtems_assoc_t;
-
-/*
- * Flag/marker for optional default value in each table
- */
-
-#define RTEMS_ASSOC_DEFAULT_NAME "(default)"
-
-const rtems_assoc_t *rtems_assoc_ptr_by_name(const rtems_assoc_t *, const char *);
-const rtems_assoc_t *rtems_assoc_ptr_by_value(const rtems_assoc_t *, unsigned32);
-const rtems_assoc_t *rtems_assoc_ptr_by_remote(const rtems_assoc_t *, unsigned32);
-
-unsigned32 rtems_assoc_remote_by_local(const rtems_assoc_t *, unsigned32);
-unsigned32 rtems_assoc_local_by_remote(const rtems_assoc_t *, unsigned32);
-unsigned32 rtems_assoc_remote_by_name(const rtems_assoc_t *, const char *);
-unsigned32 rtems_assoc_local_by_name(const rtems_assoc_t *, const char *);
-const char *rtems_assoc_name_by_local(const rtems_assoc_t *, unsigned32);
-const char *rtems_assoc_name_by_remote(const rtems_assoc_t *, unsigned32);
-
-unsigned32 rtems_assoc_remote_by_local_bitfield(const rtems_assoc_t *, unsigned32);
-char *rtems_assoc_name_by_local_bitfield(const rtems_assoc_t *, unsigned32, char *);
-char *rtems_assoc_name_by_remote_bitfield(const rtems_assoc_t *, unsigned32, char *);
-unsigned32 rtems_assoc_local_by_remote_bitfield(const rtems_assoc_t *, unsigned32);
-
-
-#endif /* ! _INCLUDE_ASSOC_H */
diff --git a/c/src/lib/libmisc/cpuuse/Makefile.in b/c/src/lib/libmisc/cpuuse/Makefile.in
deleted file mode 100644
index 391b6cac8f..0000000000
--- a/c/src/lib/libmisc/cpuuse/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIB=${ARCH}/libcpuuse-tmp.a
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=cpuuse
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-INSTALLED_H_FILES=$(srcdir)/cpuuse.h
-
-SRCS=$(C_FILES) $(H_FILES) $(INSTALLED_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${LIB}: ${SRCS} ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL) -m 444 ${INSTALLED_H_FILES} $(PROJECT_INCLUDE)
-# $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/lib/libmisc/cpuuse/README b/c/src/lib/libmisc/cpuuse/README
deleted file mode 100644
index 20e76f07bc..0000000000
--- a/c/src/lib/libmisc/cpuuse/README
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# $Id$
-#
-
-This directory contains a stack bounds checker. It provides two
-primary features:
-
- + check for stack overflow at each context switch
- + provides an educated guess at each task's stack usage
-
-The stack overflow check at context switch works by looking for
-a 16 byte pattern at the logical end of the stack to be corrupted.
-The "guesser" assumes that the entire stack was prefilled with a known
-pattern and assumes that the pattern is still in place if the memory
-has not been used as a stack.
-
-Both of these can be fooled by pushing large holes onto the stack
-and not writing to them... or (much more unlikely) writing the
-magic patterns into memory.
-
-This code has not been extensively tested. It is provided as a tool
-for RTEMS users to catch the most common mistake in multitasking
-systems ... too little stack space. Suggestions and comments are appreciated.
-
-NOTES:
-
-1. Stack usage information is questionable on CPUs which push
- large holes on stack.
-
-2. The stack checker has a tendency to generate a fault when
- trying to print the helpful diagnostic message. If it comes
- out, congratulations. If not, then the variable Stack_check_Blown_task
- contains a pointer to the TCB of the offending task. This
- is usually enough to go on.
-
-FUTURE:
-
-1. Determine how/if gcc will generate stack probe calls and support that.
-
-2. Get accurate stack usage numbers on i960.. it pushes very large
- holes on the stack.
diff --git a/c/src/lib/libmisc/cpuuse/cpuuse.c b/c/src/lib/libmisc/cpuuse/cpuuse.c
deleted file mode 100644
index db43fbf3ee..0000000000
--- a/c/src/lib/libmisc/cpuuse/cpuuse.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * CPU Usage Reporter
- *
- * COPYRIGHT (c) 1989-1998. 1996.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-extern rtems_configuration_table BSP_Configuration;
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "cpuuse.h"
-
-unsigned32 CPU_usage_Ticks_at_last_reset;
-
-/*PAGE
- *
- * CPU_usage_Dump
- */
-
-void CPU_usage_Dump( void )
-{
- unsigned32 i;
- unsigned32 class_index;
- Thread_Control *the_thread;
- Objects_Information *information;
- unsigned32 u32_name;
- char name[5];
- unsigned32 total_units = 0;
-
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
-
- if ( the_thread )
- total_units += the_thread->ticks_executed;
- }
- }
- }
-
- printf("CPU Usage by thread\n");
-#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
- printf( " ID NAME TICKS PERCENT\n" );
-#else
- printf( " ID NAME TICKS\n" );
-#endif
-
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
-
- if ( !the_thread )
- continue;
-
- u32_name = *(unsigned32 *)the_thread->Object.name;
-
- name[ 0 ] = (u32_name >> 24) & 0xff;
- name[ 1 ] = (u32_name >> 16) & 0xff;
- name[ 2 ] = (u32_name >> 8) & 0xff;
- name[ 3 ] = (u32_name >> 0) & 0xff;
- name[ 4 ] = '\0';
-
-#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
- printf( "0x%08x %4s %8d %5.3f\n",
- the_thread->Object.id,
- name,
- the_thread->ticks_executed,
- (total_units) ?
- (double)the_thread->ticks_executed / (double)total_units :
- (double)total_units
- );
-#else
- printf( "0x%08x %4s %8d\n",
- the_thread->Object.id,
- name,
- the_thread->ticks_executed
- );
-#endif
- }
- }
- }
-
- printf(
- "\nTicks since last reset = %d\n",
- _Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset
- );
- printf( "\nTotal Units = %d\n", total_units );
-}
-
-/*PAGE
- *
- * CPU_usage_Reset
- */
-
-void CPU_usage_Reset( void )
-{
- unsigned32 i;
- unsigned32 class_index;
- Thread_Control *the_thread;
- Objects_Information *information;
-
- CPU_usage_Ticks_at_last_reset = _Watchdog_Ticks_since_boot;
-
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
-
- if ( !the_thread )
- continue;
-
- the_thread->ticks_executed = 0;
- }
- }
- }
-
-}
-
diff --git a/c/src/lib/libmisc/cpuuse/cpuuse.h b/c/src/lib/libmisc/cpuuse/cpuuse.h
deleted file mode 100644
index bc678bb284..0000000000
--- a/c/src/lib/libmisc/cpuuse/cpuuse.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* cpuuse.h
- *
- * This include file contains information necessary to utilize
- * and install the cpu usage reporting mechanism.
- *
- * COPYRIGHT (c) 1989-1998. 1996.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_USE_h
-#define __CPU_USE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * CPU_usage_Dump
- */
-
-void CPU_usage_Dump( void );
-
-/*
- * CPU_usage_Reset
- */
-
-void CPU_usage_Reset( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libmisc/cpuuse/internal.h b/c/src/lib/libmisc/cpuuse/internal.h
deleted file mode 100644
index 96d0c3f10a..0000000000
--- a/c/src/lib/libmisc/cpuuse/internal.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* internal.h
- *
- * This include file contains internal information
- * for the RTEMS stack checker.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INTERNAL_STACK_CHECK_h
-#define __INTERNAL_STACK_CHECK_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This structure is used to fill in and compare the "end of stack"
- * marker pattern.
- * pattern area must be a multiple of 4 words.
- */
-
-#ifdef CPU_STACK_CHECK_SIZE
-#define PATTERN_SIZE_WORDS (((CPU_STACK_CHECK_SIZE / 4) + 3) & ~0x3)
-#else
-#define PATTERN_SIZE_WORDS 4
-#endif
-
-#define PATTERN_SIZE_BYTES (PATTERN_SIZE_WORDS * 4)
-
-typedef struct {
- unsigned32 pattern[ PATTERN_SIZE_WORDS ];
-} Stack_check_Control;
-
-/*
- * The pattern used to fill the entire stack.
- */
-
-#define BYTE_PATTERN 0xA5
-#define U32_PATTERN 0xA5A5A5A5
-
-/*
- * Stack_check_Create_extension
- */
-
-boolean Stack_check_Create_extension(
- Thread_Control *running,
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Begin_extension
- */
-
-void Stack_check_Begin_extension(
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Switch_extension
- */
-
-void Stack_check_Switch_extension(
- Thread_Control *running,
- Thread_Control *heir
-);
-
-/*
- * Stack_check_Fatal_extension
- */
-
-void Stack_check_Fatal_extension(
- Internal_errors_Source source,
- boolean is_internal,
- unsigned32 status
-);
-
-/*
- * Stack_check_Dump_usage
- */
-
-void Stack_check_Dump_usage( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libmisc/error/Makefile.in b/c/src/lib/libmisc/error/Makefile.in
deleted file mode 100644
index 5cc51de586..0000000000
--- a/c/src/lib/libmisc/error/Makefile.in
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIB=${ARCH}/liberror-tmp.a
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=error
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/error.h
-
-SRCS=$(C_FILES) $(H_FILES) $(INSTALLED_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${LIB}: ${SRCS} ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/lib/libmisc/error/error.c b/c/src/lib/libmisc/error/error.c
deleted file mode 100644
index dd32fb8b66..0000000000
--- a/c/src/lib/libmisc/error/error.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * report errors and panics to RTEMS' stderr.
- * Currently just used by RTEMS monitor.
- *
- * $Id$
- */
-
-
-/*
- * These routines provide general purpose error reporting.
- * rtems_error reports an error to stderr and allows use of
- * printf style formatting. A newline is appended to all messages.
- *
- * error_flag can be specified as any of the following:
- *
- * RTEMS_ERROR_ERRNO -- include errno text in output
- * RTEMS_ERROR_PANIC -- halts local system after output
- * RTEMS_ERROR_ABORT -- abort after output
- *
- * It can also include a rtems_status value which can be OR'd
- * with the above flags. *
- *
- * EXAMPLE
- * #include <rtems.h>
- * #include <rtems/error.h>
- * rtems_error(0, "stray interrupt %d", intr);
- *
- * EXAMPLE
- * if ((status = rtems_task_create(...)) != RTEMS_SUCCCESSFUL)
- * {
- * rtems_error(status | RTEMS_ERROR_ABORT,
- * "could not create task");
- * }
- *
- * EXAMPLE
- * if ((fd = open(pathname, O_RDNLY)) < 0)
- * {
- * rtems_error(RTEMS_ERROR_ERRNO, "open of '%s' failed", pathname);
- * goto failed;
- * }
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-
-#include "error.h"
-#include <rtems/assoc.h>
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h> /* _exit() */
-
-/* bug in hpux <errno.h>: no prototypes unless you are C++ */
-#ifdef hpux9
-char *strerror(int);
-#endif
-
-extern char *rtems_progname;
-int rtems_panic_in_progress;
-
-rtems_assoc_t rtems_status_assoc[] = {
- { "successful completion", RTEMS_SUCCESSFUL, },
- { "returned from a thread", RTEMS_TASK_EXITTED, },
- { "multiprocessing not configured", RTEMS_MP_NOT_CONFIGURED, },
- { "invalid object name", RTEMS_INVALID_NAME, },
- { "invalid object id", RTEMS_INVALID_ID, },
- { "too many", RTEMS_TOO_MANY, },
- { "timed out waiting", RTEMS_TIMEOUT, },
- { "object deleted while waiting", RTEMS_OBJECT_WAS_DELETED, },
- { "specified size was invalid", RTEMS_INVALID_SIZE, },
- { "address specified is invalid", RTEMS_INVALID_ADDRESS, },
- { "number was invalid", RTEMS_INVALID_NUMBER, },
- { "item has not been initialized", RTEMS_NOT_DEFINED, },
- { "resources still outstanding", RTEMS_RESOURCE_IN_USE, },
- { "request not satisfied", RTEMS_UNSATISFIED, },
- { "thread is in wrong state", RTEMS_INCORRECT_STATE, },
- { "thread already in state", RTEMS_ALREADY_SUSPENDED, },
- { "illegal on calling thread", RTEMS_ILLEGAL_ON_SELF, },
- { "illegal for remote object", RTEMS_ILLEGAL_ON_REMOTE_OBJECT, },
- { "called from wrong environment", RTEMS_CALLED_FROM_ISR, },
- { "invalid thread priority", RTEMS_INVALID_PRIORITY, },
- { "invalid date/time", RTEMS_INVALID_CLOCK, },
- { "invalid node id", RTEMS_INVALID_NODE, },
- { "directive not configured", RTEMS_NOT_CONFIGURED, },
- { "not owner of resource", RTEMS_NOT_OWNER_OF_RESOURCE , },
- { "directive not implemented", RTEMS_NOT_IMPLEMENTED, },
- { "RTEMS inconsistency detected", RTEMS_INTERNAL_ERROR, },
- { "could not get enough memory", RTEMS_NO_MEMORY, },
- { "internal multiprocessing only", THREAD_STATUS_PROXY_BLOCKING, },
- { 0, 0, 0 },
-};
-
-
-const char *
-rtems_status_text(
- rtems_status_code status
-)
-{
- return rtems_assoc_name_by_local(rtems_status_assoc, status);
-}
-
-
-static int rtems_verror(
- unsigned32 error_flag,
- const char *printf_format,
- va_list arglist
-)
-{
- int local_errno = 0;
- int chars_written = 0;
- rtems_status_code status;
-
- if (error_flag & RTEMS_ERROR_PANIC)
- {
- if (rtems_panic_in_progress++)
- _Thread_Disable_dispatch(); /* disable task switches */
-
- /* don't aggravate things */
- if (rtems_panic_in_progress > 2)
- return 0;
- }
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- status = error_flag & ~RTEMS_ERROR_MASK;
- if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
- local_errno = errno;
-
- if (_System_state_Is_multiprocessing)
- fprintf(stderr, "[%d] ", _Configuration_MP_table->node);
-
- if (rtems_progname && *rtems_progname)
- chars_written += fprintf(stderr, "%s: ", rtems_progname);
- chars_written += vfprintf(stderr, printf_format, arglist);
-
- if (status)
- chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status));
-
- if (local_errno)
- {
- if ((local_errno > 0) && *strerror(local_errno))
- chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
- else
- chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
- }
-
- chars_written += fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (RTEMS_ERROR_PANIC | RTEMS_ERROR_ABORT))
- {
- if (error_flag & RTEMS_ERROR_PANIC)
- {
- rtems_error(0, "fatal error, exiting");
- _exit(local_errno);
- }
- else
- {
- rtems_error(0, "fatal error, aborting");
- abort();
- }
- }
- return chars_written;
-}
-
-
-/*
- * Report an error.
- * error_flag is as above; printf_format is a normal
- * printf(3) format string, with its concommitant arguments.
- *
- * Returns the number of characters written.
- */
-
-int rtems_error(
- int error_flag,
- const char *printf_format,
- ...
- )
-{
- va_list arglist;
- int chars_written;
-
- va_start(arglist, printf_format);
- chars_written = rtems_verror(error_flag, printf_format, arglist);
- va_end(arglist);
-
- return chars_written;
-}
-
-/*
- * rtems_panic is shorthand for rtems_error(RTEMS_ERROR_PANIC, ...)
- */
-
-void rtems_panic(
- const char *printf_format,
- ...
- )
-{
- va_list arglist;
-
- va_start(arglist, printf_format);
- (void) rtems_verror(RTEMS_ERROR_PANIC, printf_format, arglist);
- va_end(arglist);
-}
diff --git a/c/src/lib/libmisc/error/error.h b/c/src/lib/libmisc/error/error.h
deleted file mode 100644
index a0698afb5d..0000000000
--- a/c/src/lib/libmisc/error/error.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Defines and externs for rtems error reporting
- *
- * $Id$
- */
-
-#ifndef __RTEMS_ERROR_h
-#define __RTEMS_ERROR_h
-
-/*
- * rtems_error() and rtems_panic() support
- */
-
-#define RTEMS_ERROR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define RTEMS_ERROR_PANIC (RTEMS_ERROR_ERRNO / 2) /* err fatal; no return */
-#define RTEMS_ERROR_ABORT (RTEMS_ERROR_ERRNO / 4) /* err is fatal; panic */
-
-#define RTEMS_ERROR_MASK (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | \
- RTEMS_ERROR_PANIC) /* all */
-
-const char *rtems_status_text(rtems_status_code);
-int rtems_error(int error_code, const char *printf_format, ...);
-#ifdef __GNUC__
-void rtems_panic(const char *printf_format, ...);
-/*
- * We should be able to use this attribute but gcc complains that
- * rtems_panic does in fact return. :(
- *
- * __attribute__ ((__noreturn__));
- */
-#else
-void rtems_panic(const char *printf_format, ...);
-#endif
-
-extern int rtems_panic_in_progress;
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libmisc/monitor/Makefile.in b/c/src/lib/libmisc/monitor/Makefile.in
deleted file mode 100644
index 1ed5d13cb1..0000000000
--- a/c/src/lib/libmisc/monitor/Makefile.in
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIB=${ARCH}/libmonitor-tmp.a
-# C source names, if any, go here -- minus the .c
-C_PIECES=mon-command mon-symbols mon-prmisc mon-monitor mon-object mon-server \
- mon-task mon-queue mon-driver mon-dname mon-itask \
- mon-extension mon-manager mon-config mon-mpci
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-INSTALLED_H_FILES=$(srcdir)/monitor.h $(srcdir)/symbols.h
-
-SRCS=README $(C_FILES) $(H_FILES) $(INSTALLED_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I$(srcdir)
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-.PHONY: preinstall
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${LIB}: ${SRCS} ${OBJS}
- $(make-library)
-
-all: preinstall ${ARCH} $(SRCS) $(LIB)
-
-preinstall: $(INSTALLED_H_FILES)
- $(INSTALL) -m 444 ${INSTALLED_H_FILES} $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/lib/libmisc/monitor/README b/c/src/lib/libmisc/monitor/README
deleted file mode 100644
index d5a73da140..0000000000
--- a/c/src/lib/libmisc/monitor/README
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# $Id$
-#
-
-monitor task
-
-The monitor task is an optional task that knows about RTEMS
-data structures and can print out information about them.
-It is a work-in-progress and needs many more commands, but
-is useful now.
-
-The monitor works best when it is the highest priority task,
-so all your other tasks should ideally be at some priority
-greater than 1.
-
-To use the monitor:
--------------------
-
- #include <rtems/monitor.h>
-
- ...
-
- rtems_monitor_init(0);
-
- The parameter to rtems_monitor_init() tells the monitor whether
- to suspend itself on startup. A value of 0 causes the monitor
- to immediately enter command mode; a non-zero value causes the
- monitor to suspend itself after creation and wait for explicit
- wakeup.
-
-
- rtems_monitor_wakeup();
-
- wakes up a suspended monitor and causes it to reenter command mode.
-
-Monitor commands
-----------------
-
- The monitor prompt is 'rtems> '.
- Can abbreviate commands to "uniquity"
- There is a 'help' command. Here is the output from various
- help commands:
-
- Commands (may be abbreviated)
-
- help -- get this message or command specific help
- task -- show task information
- queue -- show message queue information
- symbol -- show entries from symbol table
- pause -- pause monitor for a specified number of ticks
- fatal -- invoke a fatal RTEMS error
-
- task [id [id ...] ]
- display information about the specified tasks.
- Default is to display information about all tasks on this node
-
- queue [id [id ... ] ]
- display information about the specified message queues
- Default is to display information about all queues on this node
-
- symbol [ symbolname [symbolname ... ] ]
- display value associated with specified symbol.
- Defaults to displaying all known symbols.
-
- pause [ticks]
- monitor goes to "sleep" for specified ticks (default is 1)
- monitor will resume at end of period or if explicitly awakened
-
- fatal [status]
- Invoke 'rtems_fatal_error_occurred' with 'status'
- (default is RTEMS_INTERNAL_ERROR)
-
- continue
- put the monitor to sleep waiting for an explicit wakeup from the
- program running.
-
-
-Sample output from 'task' command
----------------------------------
-
- rtems> task
- ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES
- ------------------------------------------------------------------------
- 00010001 UI1 2 READY P:T:nA NONE15: 0x40606348
- 00010002 RMON 1 READY nP NONE15: 0x40604110
-
- 'RMON' is the monitor itself, so we have 1 "user" task.
- Its modes are P:T:nA which translate to:
-
- preemptable
- timesliced
- no ASRS
-
- It has no events.
- It has a notepad value for notepad 15 which is 0x40606348
- (this is the libc thread state)
-
diff --git a/c/src/lib/libmisc/monitor/mon-command.c b/c/src/lib/libmisc/monitor/mon-command.c
deleted file mode 100644
index 1fe495e0ae..0000000000
--- a/c/src/lib/libmisc/monitor/mon-command.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Command parsing routines for RTEMS monitor
- *
- * TODO:
- *
- * $Id$
- */
-
-#include <rtems.h>
-
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <string.h>
-
-/*
- * make_argv(cp): token-count
- * Break up the command line in 'cp' into global argv[] and argc (return
- * value).
- */
-
-int
-rtems_monitor_make_argv(
- char *cp,
- int *argc_p,
- char **argv)
-{
- int argc = 0;
-
- while ((cp = strtok(cp, " \t\n\r")))
- {
- argv[argc++] = cp;
- cp = (char *) NULL;
- }
- argv[argc] = (char *) NULL; /* end of argv */
-
- return *argc_p = argc;
-}
-
-
-/*
- * Read and break up a monitor command
- *
- * We have to loop on the gets call, since it will return NULL under UNIX
- * RTEMS when we get a signal (eg: SIGALRM).
- */
-
-int
-rtems_monitor_command_read(char *command,
- int *argc,
- char **argv)
-{
- extern rtems_configuration_table BSP_Configuration;
- static char monitor_prompt[32];
-
- /*
- * put node number in the prompt if we are multiprocessing
- */
-
- if (BSP_Configuration.User_multiprocessing_table == 0)
- sprintf(monitor_prompt, "%s", MONITOR_PROMPT);
- else if (rtems_monitor_default_node != rtems_monitor_node)
- sprintf(monitor_prompt, "%d-%s-%d", rtems_monitor_node, MONITOR_PROMPT, rtems_monitor_default_node);
- else
- sprintf(monitor_prompt, "%d-%s", rtems_monitor_node, MONITOR_PROMPT);
-
-#ifdef RTEMS_UNIX
- /* RTEMS on unix gets so many interrupt system calls this is hosed */
- printf("%s> ", monitor_prompt);
- fflush(stdout);
- while (gets(command) == (char *) 0)
- ;
-#else
- do
- {
- printf("%s> ", monitor_prompt);
- fflush(stdout);
- } while (gets(command) == (char *) 0);
-#endif
-
- return rtems_monitor_make_argv(command, argc, argv);
-}
-
-/*
- * Look up a command in a command table
- *
- */
-
-rtems_monitor_command_entry_t *
-rtems_monitor_command_lookup(
- rtems_monitor_command_entry_t *table,
- int argc,
- char **argv
-)
-{
- rtems_monitor_command_entry_t *p;
- rtems_monitor_command_entry_t *abbreviated_match = 0;
- int abbreviated_matches = 0;
- char *command;
- int command_length;
-
- command = argv[0];
-
- if ((table == 0) || (command == 0))
- goto failed;
-
- command_length = strlen(command);
-
- for (p = table; p->command; p++)
- if (STREQ(command, p->command)) /* exact match */
- goto done;
- else if (STRNEQ(command, p->command, command_length))
- {
- abbreviated_matches++;
- abbreviated_match = p;
- }
-
- /* no perfect match; is there a non-ambigous abbreviated match? */
- if ( ! abbreviated_match)
- {
- printf("Unrecognized command '%s'; try 'help'\n", command);
- goto failed;
- }
-
- if (abbreviated_matches > 1)
- {
- printf("Command '%s' is ambiguous; try 'help'\n", command);
- goto failed;
- }
-
- p = abbreviated_match;
-
-done:
- if (p->command_function == 0)
- goto failed;
- return p;
-
-failed:
- return 0;
-}
-
-void
-rtems_monitor_command_usage(rtems_monitor_command_entry_t *table,
- char *command_string)
-{
- rtems_monitor_command_entry_t *help = 0;
- char *help_command_argv[2];
-
- /* if first entry in table is a usage, then print it out */
- if (command_string == 0)
- {
- if (STREQ(table->command, "--usage--") && table->usage)
- help = table;
- }
- else
- {
- help_command_argv[0] = command_string;
- help_command_argv[1] = 0;
- help = rtems_monitor_command_lookup(table, 1, help_command_argv);
- }
-
- if (help)
- printf("%s\n", help->usage);
-}
-
-
-void
-rtems_monitor_help_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- int arg;
- rtems_monitor_command_entry_t *command;
-
- command = (rtems_monitor_command_entry_t *) command_arg;
-
- if (argc == 1)
- rtems_monitor_command_usage(command, 0);
- else
- {
- for (arg=1; argv[arg]; arg++)
- rtems_monitor_command_usage(command, argv[arg]);
- }
-}
diff --git a/c/src/lib/libmisc/monitor/mon-config.c b/c/src/lib/libmisc/monitor/mon-config.c
deleted file mode 100644
index 5efd480b14..0000000000
--- a/c/src/lib/libmisc/monitor/mon-config.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * RTEMS Config display support
- *
- * TODO
- *
- * $Id$
- */
-
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-
-#define DATACOL 15
-#define CONTCOL DATACOL /* continued col */
-
-/*
- * Fill in entire monitor config table
- * for sending to a remote monitor or printing on the local system
- */
-
-void
-rtems_monitor_config_canonical(
- rtems_monitor_config_t *canonical_config,
- void *config_void
-)
-{
- rtems_configuration_table *c = (rtems_configuration_table *) config_void;
- rtems_api_configuration_table *r = c->RTEMS_api_configuration;
-
- canonical_config->work_space_start = c->work_space_start;
- canonical_config->work_space_size = c->work_space_size;
- canonical_config->maximum_tasks = r->maximum_tasks;
- canonical_config->maximum_timers = r->maximum_timers;
- canonical_config->maximum_semaphores = r->maximum_semaphores;
- canonical_config->maximum_message_queues = r->maximum_message_queues;
- canonical_config->maximum_partitions = r->maximum_partitions;
- canonical_config->maximum_regions = r->maximum_regions;
- canonical_config->maximum_ports = r->maximum_ports;
- canonical_config->maximum_periods = r->maximum_periods;
- canonical_config->maximum_extensions = c->maximum_extensions;
- canonical_config->microseconds_per_tick = c->microseconds_per_tick;
- canonical_config->ticks_per_timeslice = c->ticks_per_timeslice;
- canonical_config->number_of_initialization_tasks = r->number_of_initialization_tasks;
-}
-
-/*
- * This is easy, since there is only 1 (altho we could get them from
- * other nodes...)
- */
-
-void *
-rtems_monitor_config_next(
- void *object_info,
- rtems_monitor_config_t *canonical_config,
- rtems_id *next_id
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- int n = rtems_get_index(*next_id);
-
- if (n >= 1)
- goto failed;
-
- _Thread_Disable_dispatch();
-
- *next_id += 1;
- return (void *) c;
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-
-void
-rtems_monitor_config_dump_header(
- boolean verbose
-)
-{
- printf("\
-INITIAL (startup) Configuration Info\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-
-void
-rtems_monitor_config_dump(
- rtems_monitor_config_t *monitor_config,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length = 0;
- length += printf("WORKSPACE");
- length += rtems_monitor_pad(DATACOL, length);
- length += printf("start: 0x%x; size: 0x%x\n",
- (unsigned32) monitor_config->work_space_start,
- monitor_config->work_space_size);
-
- length = 0;
- length += printf("TIME");
- length += rtems_monitor_pad(DATACOL, length);
- length += printf("usec/tick: %d; tick/timeslice: %d; tick/sec: %d\n",
- monitor_config->microseconds_per_tick,
- monitor_config->ticks_per_timeslice,
- 1000000 / monitor_config->microseconds_per_tick);
-
- length = 0;
- length += printf("MAXIMUMS");
- length += rtems_monitor_pad(DATACOL, length);
- length += printf("tasks: %d; timers: %d; sems: %d; que's: %d; ext's: %d\n",
- monitor_config->maximum_tasks,
- monitor_config->maximum_timers,
- monitor_config->maximum_semaphores,
- monitor_config->maximum_message_queues,
- monitor_config->maximum_extensions);
- length = 0;
- length += rtems_monitor_pad(CONTCOL, length);
- length += printf("partitions: %d; regions: %d; ports: %d; periods: %d\n",
- monitor_config->maximum_partitions,
- monitor_config->maximum_regions,
- monitor_config->maximum_ports,
- monitor_config->maximum_periods);
-}
diff --git a/c/src/lib/libmisc/monitor/mon-dname.c b/c/src/lib/libmisc/monitor/mon-dname.c
deleted file mode 100644
index 45c28342ff..0000000000
--- a/c/src/lib/libmisc/monitor/mon-dname.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * RTEMS monitor driver names support.
- *
- * There are 2 "driver" things the monitor knows about.
- *
- * 1. Regular RTEMS drivers.
- * This is a table indexed by major device number and
- * containing driver entry points only.
- *
- * 2. Driver name table.
- * A separate table of names for drivers.
- * The table converts driver names to a major number
- * as index into the driver table and a minor number
- * for an argument to driver.
- *
- * Drivers are displayed with 'driver' command.
- * Names are displayed with 'dname' command.
- *
- * $Id$
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-#include <string.h> /* strncpy() */
-
-#define DATACOL 15
-#define CONTCOL DATACOL /* continued col */
-
-void
-rtems_monitor_dname_canonical(
- rtems_monitor_dname_t *canonical_dname,
- void *dname_void
-)
-{
- rtems_driver_name_t *np = (rtems_driver_name_t *) dname_void;
-
- (void) strncpy(canonical_dname->name_string, np->device_name, sizeof(canonical_dname->name_string));
- canonical_dname->major = np->major;
- canonical_dname->minor = np->minor;
-}
-
-void *
-rtems_monitor_dname_next(
- void *object_information,
- rtems_monitor_dname_t *canonical_dname,
- rtems_id *next_id
-)
-{
- rtems_unsigned32 n = rtems_get_index(*next_id);
- rtems_driver_name_t *table = _IO_Driver_name_table;
- rtems_driver_name_t *np = 0;
-
-/* XXX should we be using _IO_Number_of_devices */
- for (np = table + n ; n<_IO_Number_of_devices; n++, np++)
- if (np->device_name)
- goto done;
-
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-
-done:
- _Thread_Disable_dispatch();
-
- /*
- * dummy up a fake id and name for this item
- */
-
- canonical_dname->id = n;
- canonical_dname->name = rtems_build_name('-', '-', '-', '-');
-
- *next_id += 1;
- return np;
-}
-
-void
-rtems_monitor_dname_dump_header(
- boolean verbose
-)
-{
- printf("\
- Major:Minor Name\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-void
-rtems_monitor_dname_dump(
- rtems_monitor_dname_t *monitor_dname,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += rtems_monitor_pad(6, length);
- length += rtems_monitor_dump_hex(monitor_dname->major);
- length += printf(":");
- length += rtems_monitor_dump_hex(monitor_dname->minor);
-
- length += rtems_monitor_pad(16, length);
- length += printf("%.*s",
- (int) sizeof(monitor_dname->name_string),
- (char *) monitor_dname->name_string);
-
- length += printf("\n");
- length = 0;
-}
diff --git a/c/src/lib/libmisc/monitor/mon-driver.c b/c/src/lib/libmisc/monitor/mon-driver.c
deleted file mode 100644
index c8eb36ab4e..0000000000
--- a/c/src/lib/libmisc/monitor/mon-driver.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * RTEMS monitor IO (device drivers) support
- *
- * There are 2 "driver" things the monitor knows about.
- *
- * 1. Regular RTEMS drivers.
- * This is a table indexed by major device number and
- * containing driver entry points only.
- *
- * 2. Driver name table.
- * A separate table of names for drivers.
- * The table converts driver names to a major number
- * as index into the driver table and a minor number
- * for an argument to driver.
- *
- * Drivers are displayed with 'driver' command.
- * Names are displayed with 'name' command.
- *
- * $Id$
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-
-#define DATACOL 15
-#define CONTCOL DATACOL /* continued col */
-
-
-void
-rtems_monitor_driver_canonical(
- rtems_monitor_driver_t *canonical_driver,
- void *driver_void
-)
-{
- rtems_driver_address_table *d = (rtems_driver_address_table *) driver_void;
-
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->initialization,
- (void *) d->initialization);
-
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->open,
- (void *) d->open);
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->close,
- (void *) d->close);
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->read,
- (void *) d->read);
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->write,
- (void *) d->write);
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->control,
- (void *) d->control);
-}
-
-
-void *
-rtems_monitor_driver_next(
- void *object_info,
- rtems_monitor_driver_t *canonical_driver,
- rtems_id *next_id
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- rtems_unsigned32 n = rtems_get_index(*next_id);
-
- if (n >= c->number_of_device_drivers)
- goto failed;
-
- _Thread_Disable_dispatch();
-
- /*
- * dummy up a fake id and name for this item
- */
-
- canonical_driver->id = n;
- canonical_driver->name = rtems_build_name('-', '-', '-', '-');
-
- *next_id += 1;
- return (void *) (c->Device_driver_table + n);
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-
-void
-rtems_monitor_driver_dump_header(
- boolean verbose
-)
-{
- printf("\
- Major Entry points\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-void
-rtems_monitor_driver_dump(
- rtems_monitor_driver_t *monitor_driver,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += printf(" %d", monitor_driver->id);
-
- length += rtems_monitor_pad(13, length);
- length += printf("init: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->initialization, verbose);
- length += printf("; control: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->control, verbose);
- length += printf("\n");
- length = 0;
-
- length += rtems_monitor_pad(13, length);
-
- length += printf("open: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->open, verbose);
- length += printf("; close: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->close, verbose);
- length += printf("\n");
- length = 0;
-
- length += rtems_monitor_pad(13, length);
-
- length += printf("read: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->read, verbose);
- length += printf("; write: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->write, verbose);
- length += printf("\n");
- length = 0;
-}
diff --git a/c/src/lib/libmisc/monitor/mon-extension.c b/c/src/lib/libmisc/monitor/mon-extension.c
deleted file mode 100644
index 107fd5184e..0000000000
--- a/c/src/lib/libmisc/monitor/mon-extension.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * RTEMS Monitor extension support
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-
-void
-rtems_monitor_extension_canonical(
- rtems_monitor_extension_t *canonical_extension,
- void *extension_void
-)
-{
- Extension_Control *rtems_extension = (Extension_Control *) extension_void;
- rtems_extensions_table *e = &rtems_extension->Extension.Callouts;
-
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_create,
- (void *) e->thread_create);
-
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_start,
- (void *) e->thread_start);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_restart,
- (void *) e->thread_restart);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_delete,
- (void *) e->thread_delete);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_tswitch,
- (void *) e->thread_switch);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_begin,
- (void *) e->thread_begin);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_exitted,
- (void *) e->thread_exitted);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_fatal,
- (void *) e->fatal);
-}
-
-void
-rtems_monitor_extension_dump_header(
- boolean verbose
-)
-{
- printf("\
- ID NAME\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
-
- rtems_monitor_separator();
-}
-
-
-/*
- * Dump out the canonical form
- */
-
-void
-rtems_monitor_extension_dump(
- rtems_monitor_extension_t *monitor_extension,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += rtems_monitor_dump_id(monitor_extension->id);
- length += rtems_monitor_pad(11, length);
- length += rtems_monitor_dump_name(monitor_extension->name);
-
- length += rtems_monitor_pad(18, length);
- length += printf("create: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_create, verbose);
- length += printf("; start: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_start, verbose);
- length += printf("; restart: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_restart, verbose);
- length += printf("\n");
- length = 0;
-
- length += rtems_monitor_pad(18, length);
- length += printf("delete: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_delete, verbose);
- length += printf("; switch: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_tswitch, verbose);
- length += printf("; begin: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_begin, verbose);
- length += printf("\n");
- length = 0;
-
- length += rtems_monitor_pad(18, length);
- length += printf("exitted: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_exitted, verbose);
- length += printf("; fatal: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_fatal, verbose);
- length += printf("\n");
- length = 0;
- printf("\n");
-}
diff --git a/c/src/lib/libmisc/monitor/mon-itask.c b/c/src/lib/libmisc/monitor/mon-itask.c
deleted file mode 100644
index 59a3a4f284..0000000000
--- a/c/src/lib/libmisc/monitor/mon-itask.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * RTEMS Monitor init task support
- *
- * $Id$
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-
-/*
- * As above, but just for init tasks
- */
-void
-rtems_monitor_init_task_canonical(
- rtems_monitor_init_task_t *canonical_itask,
- void *itask_void
-)
-{
- rtems_initialization_tasks_table *rtems_itask = itask_void;
-
- rtems_monitor_symbol_canonical_by_value(&canonical_itask->entry,
- (void *) rtems_itask->entry_point);
-
- canonical_itask->argument = rtems_itask->argument;
- canonical_itask->stack_size = rtems_itask->stack_size;
- canonical_itask->priority = rtems_itask->initial_priority;
- canonical_itask->modes = rtems_itask->mode_set;
- canonical_itask->attributes = rtems_itask->attribute_set;
-}
-
-void *
-rtems_monitor_init_task_next(
- void *object_info,
- rtems_monitor_init_task_t *canonical_init_task,
- rtems_id *next_id
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- rtems_initialization_tasks_table *itask;
- rtems_unsigned32 n = rtems_get_index(*next_id);
-
- if (n >= c->RTEMS_api_configuration->number_of_initialization_tasks)
- goto failed;
-
- _Thread_Disable_dispatch();
-
- itask = c->RTEMS_api_configuration->User_initialization_tasks_table + n;
-
- /*
- * dummy up a fake id and name for this item
- */
-
- canonical_init_task->id = n;
- canonical_init_task->name = itask->name;
-
- *next_id += 1;
- return (void *) itask;
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-
-void
-rtems_monitor_init_task_dump_header(
- boolean verbose
-)
-{
- printf("\
- # NAME ENTRY ARGUMENT PRIO MODES ATTRIBUTES STACK SIZE\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-/*
- */
-
-void
-rtems_monitor_init_task_dump(
- rtems_monitor_init_task_t *monitor_itask,
- boolean verbose
-)
-{
- int length = 0;
-
- length += rtems_monitor_dump_decimal(monitor_itask->id);
-
- length += rtems_monitor_pad(7, length);
- length += rtems_monitor_dump_name(monitor_itask->name);
-
- length += rtems_monitor_pad(14, length);
- length += rtems_monitor_symbol_dump(&monitor_itask->entry, verbose);
-
- length += rtems_monitor_pad(25, length);
- length += printf("%d [0x%x]", monitor_itask->argument, monitor_itask->argument);
-
- length += rtems_monitor_pad(39, length);
- length += rtems_monitor_dump_priority(monitor_itask->priority);
-
- length += rtems_monitor_pad(46, length);
- length += rtems_monitor_dump_modes(monitor_itask->modes);
-
- length += rtems_monitor_pad(54, length);
- length += rtems_monitor_dump_attributes(monitor_itask->attributes);
-
- length += rtems_monitor_pad(66, length);
- length += printf("%d [0x%x]", monitor_itask->stack_size, monitor_itask->stack_size);
-
- printf("\n");
-}
diff --git a/c/src/lib/libmisc/monitor/mon-manager.c b/c/src/lib/libmisc/monitor/mon-manager.c
deleted file mode 100644
index 497f0255a0..0000000000
--- a/c/src/lib/libmisc/monitor/mon-manager.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * RTEMS Monitor "manager" support.
- * Used to traverse object (chain) lists and print them out.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-
-/*
- * "next" routine for all objects that are RTEMS manager objects
- */
-
-void *
-rtems_monitor_manager_next(
- void *table_void,
- void *canonical,
- rtems_id *next_id
-)
-{
- Objects_Information *table = table_void;
- rtems_monitor_generic_t *copy;
- Objects_Control *object = 0;
- Objects_Locations location;
-
- /*
- * When we are called, it must be local
- */
-
- if ( ! _Objects_Is_local_id(*next_id))
- goto done;
-
- object = _Objects_Get_next(table, *next_id, &location, next_id);
-
- if (object)
- {
- copy = (rtems_monitor_generic_t *) canonical;
- copy->id = object->id;
- _Objects_Copy_name_raw(object->name, &copy->name, sizeof(copy->name));
- }
-
-done:
- return object;
-}
-
diff --git a/c/src/lib/libmisc/monitor/mon-monitor.c b/c/src/lib/libmisc/monitor/mon-monitor.c
deleted file mode 100644
index 289425d8e4..0000000000
--- a/c/src/lib/libmisc/monitor/mon-monitor.c
+++ /dev/null
@@ -1,518 +0,0 @@
-/*
- * RTEMS monitor main body
- *
- * TODO:
- * add stuff to RTEMS api
- * rtems_get_name(id)
- * rtems_get_type(id)
- * rtems_build_id(node, type, num)
- * Add a command to dump out info about an arbitrary id when
- * types are added to id's
- * rtems> id idnum
- * idnum: node n, object: whatever, id: whatever
- * allow id's to be specified as n:t:id, where 'n:t' is optional
- * should have a separate monitor FILE stream (ala the debugger)
- * remote request/response stuff should be cleaned up
- * maybe we can use real rpc??
- * 'info' command to print out:
- * interrupt stack location, direction and size
- * floating point config stuff
- * interrupt config stuff
- *
- * $Id$
- */
-
-#include <rtems.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <rtems/monitor.h>
-
-/* set by trap handler */
-extern rtems_tcb *debugger_interrupted_task;
-extern rtems_context *debugger_interrupted_task_context;
-extern rtems_unsigned32 debugger_trap;
-
-/*
- * Various id's for the monitor
- * They need to be public variables for access by other agencies
- * such as debugger and remote servers'
- */
-
-rtems_id rtems_monitor_task_id;
-
-unsigned32 rtems_monitor_node; /* our node number */
-unsigned32 rtems_monitor_default_node; /* current default for commands */
-
-/*
- * The rtems symbol table
- */
-
-rtems_symbol_table_t *rtems_monitor_symbols;
-
-/*
- * The top-level commands
- */
-
-rtems_monitor_command_entry_t rtems_monitor_commands[] = {
- { "--usage--",
- "\n"
- "RTEMS monitor\n"
- "\n"
- "Commands (may be abbreviated)\n"
- "\n"
- " help -- get this message or command specific help\n"
- " pause -- pause monitor for a specified number of ticks\n"
- " exit -- invoke a fatal RTEMS error\n"
- " symbol -- show entries from symbol table\n"
- " continue -- put monitor to sleep waiting for explicit wakeup\n"
- " config -- show system configuration\n"
- " itask -- list init tasks\n"
- " mpci -- list mpci config\n"
- " task -- show task information\n"
- " queue -- show message queue information\n"
- " extension -- user extensions\n"
- " driver -- show information about named drivers\n"
- " dname -- show information about named drivers\n"
- " object -- generic object information\n"
- " node -- specify default node for commands that take id's\n"
-#ifdef CPU_INVOKE_DEBUGGER
- " debugger -- invoke system debugger\n"
-#endif
- ,
- 0,
- 0,
- (unsigned32) rtems_monitor_commands,
- },
- { "config",
- "config\n"
- " Show the system configuration.\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_CONFIG,
- },
- { "itask",
- "itask\n"
- " List init tasks for the system\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_INIT_TASK,
- },
- { "mpci",
- "mpci\n"
- " Show the MPCI system configuration, if configured.\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_MPCI,
- },
- { "pause",
- "pause [ticks]\n"
- " monitor goes to \"sleep\" for specified ticks (default is 1)\n"
- " monitor will resume at end of period or if explicitly awakened\n",
- 0,
- rtems_monitor_pause_cmd,
- 0,
- },
- { "continue",
- "continue\n"
- " put the monitor to sleep waiting for an explicit wakeup from the\n"
- " program running.\n",
- 0,
- rtems_monitor_continue_cmd,
- 0,
- },
- { "go",
- "go\n"
- " Alias for 'continue'\n",
- 0,
- rtems_monitor_continue_cmd,
- 0,
- },
- { "node",
- "node [ node number ]\n"
- " Specify default node number for commands that take id's\n",
- 0,
- rtems_monitor_node_cmd,
- 0,
- },
- { "symbol",
- "symbol [ symbolname [symbolname ... ] ]\n"
- " display value associated with specified symbol.\n"
- " Defaults to displaying all known symbols.\n",
- 0,
- rtems_monitor_symbol_cmd,
- (unsigned32) &rtems_monitor_symbols,
- },
- { "extension",
- "extension [id [id ...] ]\n"
- " display information about specified extensions.\n"
- " Default is to display information about all extensions on this node\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_EXTENSION,
- },
- { "task",
- "task [id [id ...] ]\n"
- " display information about the specified tasks.\n"
- " Default is to display information about all tasks on this node\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_TASK,
- },
- { "queue",
- "queue [id [id ... ] ]\n"
- " display information about the specified message queues\n"
- " Default is to display information about all queues on this node\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_QUEUE,
- },
- { "object",
- "object [id [id ...] ]\n"
- " display information about specified RTEMS objects.\n"
- " Object id's must include 'type' information.\n"
- " (which may normally be defaulted)\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_INVALID,
- },
- { "driver",
- "driver [ major [ major ... ] ]\n"
- " Display the RTEMS device driver table.\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_DRIVER,
- },
- { "dname",
- "dname\n"
- " Displays information about named drivers.\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_DNAME,
- },
- { "exit",
- "exit [status]\n"
- " Invoke 'rtems_fatal_error_occurred' with 'status'\n"
- " (default is RTEMS_SUCCESSFUL)\n",
- 0,
- rtems_monitor_fatal_cmd,
- RTEMS_SUCCESSFUL,
- },
- { "fatal",
- "fatal [status]\n"
- " 'exit' with fatal error; default error is RTEMS_TASK_EXITTED\n",
- 0,
- rtems_monitor_fatal_cmd,
- RTEMS_TASK_EXITTED, /* exit value */
- },
- { "quit",
- "quit [status]\n"
- " Alias for 'exit'\n",
- 0,
- rtems_monitor_fatal_cmd,
- RTEMS_SUCCESSFUL, /* exit value */
- },
- { "help",
- "help [ command [ command ] ]\n"
- " provide information about commands\n"
- " Default is show basic command summary.\n",
- 0,
- rtems_monitor_help_cmd,
- (unsigned32) rtems_monitor_commands,
- },
-#ifdef CPU_INVOKE_DEBUGGER
- { "debugger",
- "debugger\n"
- " Enter the debugger, if possible.\n"
- " A continue from the debugger will return to the monitor.\n",
- 0,
- rtems_monitor_debugger_cmd,
- 0,
- },
-#endif
- { 0, 0, 0, 0, 0 },
-};
-
-
-rtems_status_code
-rtems_monitor_suspend(rtems_interval timeout)
-{
- rtems_event_set event_set;
- rtems_status_code status;
-
- status = rtems_event_receive(MONITOR_WAKEUP_EVENT,
- RTEMS_DEFAULT_OPTIONS,
- timeout,
- &event_set);
- return status;
-}
-
-void
-rtems_monitor_wakeup(void)
-{
- rtems_status_code status;
-
- status = rtems_event_send(rtems_monitor_task_id, MONITOR_WAKEUP_EVENT);
-}
-
-void
-rtems_monitor_debugger_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
-#ifdef CPU_INVOKE_DEBUGGER
- CPU_INVOKE_DEBUGGER;
-#endif
-}
-
-void
-rtems_monitor_pause_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- if (argc == 1)
- rtems_monitor_suspend(1);
- else
- rtems_monitor_suspend(strtoul(argv[1], 0, 0));
-}
-
-void
-rtems_monitor_fatal_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- if (argc == 1)
- rtems_fatal_error_occurred(command_arg);
- else
- rtems_fatal_error_occurred(strtoul(argv[1], 0, 0));
-}
-
-void
-rtems_monitor_continue_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- rtems_monitor_suspend(RTEMS_NO_TIMEOUT);
-}
-
-void
-rtems_monitor_node_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- unsigned32 new_node = rtems_monitor_default_node;
-
- switch (argc)
- {
- case 1: /* no node, just set back to ours */
- new_node = rtems_monitor_node;
- break;
-
- case 2:
- new_node = strtoul(argv[1], 0, 0);
- break;
-
- default:
- printf("invalid syntax, try 'help node'\n");
- break;
- }
-
- if ((new_node >= 1) &&
- _Configuration_MP_table &&
- (new_node <= _Configuration_MP_table->maximum_nodes))
- rtems_monitor_default_node = new_node;
-}
-
-
-/*
- * Function: rtems_monitor_symbols_loadup
- *
- * Description:
- * Create and load the monitor's symbol table.
- * We are reading the output format of 'gnm' which looks like this:
- *
- * 400a7068 ? _Rate_monotonic_Information
- * 400a708c ? _Thread_Dispatch_disable_level
- * 400a7090 ? _Configuration_Table
- *
- * We ignore the type field.
- *
- * Side Effects:
- * Creates and fills in 'rtems_monitor_symbols' table
- *
- * TODO
- * there should be a BSP #define or something like that
- * to do this; Assuming stdio is crazy.
- * Someday this should know BFD
- * Maybe we could get objcopy to just copy the symbol areas
- * and copy that down.
- *
- */
-
-void
-rtems_monitor_symbols_loadup(void)
-{
- FILE *fp;
- char buffer[128];
-
- if (rtems_monitor_symbols)
- rtems_symbol_table_destroy(rtems_monitor_symbols);
-
- rtems_monitor_symbols = rtems_symbol_table_create(10);
- if (rtems_monitor_symbols == 0)
- return;
-
- fp = fopen("symbols", "r");
-
- if (fp == 0)
- return;
-
- while (fgets(buffer, sizeof(buffer) - 1, fp))
- {
- char *symbol;
- char *value;
- char *ignored_type;
-
- value = strtok(buffer, " \t\n");
- ignored_type = strtok(0, " \t\n");
- symbol = strtok(0, " \t\n");
-
- if (symbol && ignored_type && value)
- {
- rtems_symbol_t *sp;
- sp = rtems_symbol_create(rtems_monitor_symbols,
- symbol,
- (rtems_unsigned32) strtoul(value, 0, 16));
- if (sp == 0)
- {
- printf("could not define symbol '%s'\n", symbol);
- goto done;
- }
- }
- else
- {
- printf("parsing error on '%s'\n", buffer);
- goto done;
- }
- }
-
-done:
- return;
-}
-
-
-/*
- * Main monitor command loop
- */
-
-void
-rtems_monitor_task(
- rtems_task_argument monitor_flags
-)
-{
- rtems_tcb *debugee = 0;
- rtems_context *rp;
- rtems_context_fp *fp;
- char command_buffer[513];
- int argc;
- char *argv[64];
- boolean verbose = FALSE;
-
- if (monitor_flags & RTEMS_MONITOR_SUSPEND)
- (void) rtems_monitor_suspend(RTEMS_NO_TIMEOUT);
-
- for (;;)
- {
- extern rtems_tcb * _Thread_Executing;
- rtems_monitor_command_entry_t *command;
-
- debugee = _Thread_Executing;
- rp = &debugee->Registers;
- fp = (rtems_context_fp *) debugee->fp_context; /* possibly 0 */
-
- if (0 == rtems_monitor_command_read(command_buffer, &argc, argv))
- continue;
- if ((command = rtems_monitor_command_lookup(rtems_monitor_commands,
- argc,
- argv)) == 0)
- continue;
-
- command->command_function(argc, argv, command->command_arg, verbose);
-
- fflush(stdout);
- }
-}
-
-
-void
-rtems_monitor_kill(void)
-{
- if (rtems_monitor_task_id)
- rtems_task_delete(rtems_monitor_task_id);
- rtems_monitor_task_id = 0;
-
- rtems_monitor_server_kill();
-}
-
-void
-rtems_monitor_init(
- unsigned32 monitor_flags
-)
-{
- rtems_status_code status;
-
- rtems_monitor_kill();
-
- status = rtems_task_create(RTEMS_MONITOR_NAME,
- 1,
- RTEMS_MINIMUM_STACK_SIZE * 2,
- RTEMS_INTERRUPT_LEVEL(0),
- RTEMS_DEFAULT_ATTRIBUTES,
- &rtems_monitor_task_id);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not create monitor task");
- goto done;
- }
-
- rtems_monitor_node = rtems_get_node(rtems_monitor_task_id);
- rtems_monitor_default_node = rtems_monitor_node;
-
- rtems_monitor_symbols_loadup();
-
- if (monitor_flags & RTEMS_MONITOR_GLOBAL)
- rtems_monitor_server_init(monitor_flags);
-
- /*
- * Start the monitor task itself
- */
-
- status = rtems_task_start(rtems_monitor_task_id,
- rtems_monitor_task,
- monitor_flags);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not start monitor");
- goto done;
- }
-
-done:
-}
diff --git a/c/src/lib/libmisc/monitor/mon-mpci.c b/c/src/lib/libmisc/monitor/mon-mpci.c
deleted file mode 100644
index 5399f37555..0000000000
--- a/c/src/lib/libmisc/monitor/mon-mpci.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * RTEMS MPCI Config display support
- *
- * TODO
- *
- * $Id$
- */
-
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-
-#define DATACOL 15
-
-/*
- * Fill in entire monitor config table
- * for sending to a remote monitor or printing on the local system
- */
-
-void
-rtems_monitor_mpci_canonical(
- rtems_monitor_mpci_t *canonical_mpci,
- void *config_void
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- rtems_multiprocessing_table *m;
- rtems_mpci_table *mt;
-
- m = c->User_multiprocessing_table;
- if (m == 0)
- return;
- mt = m->User_mpci_table;
-
- canonical_mpci->node = m->node;
- canonical_mpci->maximum_nodes = m->maximum_nodes;
- canonical_mpci->maximum_global_objects = m->maximum_global_objects;
- canonical_mpci->maximum_proxies = m->maximum_proxies;
-
- canonical_mpci->default_timeout = mt->default_timeout;
- canonical_mpci->maximum_packet_size = mt->maximum_packet_size;
-
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->initialization,
- (void *) mt->initialization);
-
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->get_packet,
- (void *) mt->get_packet);
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->return_packet,
- (void *) mt->return_packet);
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->send_packet,
- (void *) mt->send_packet);
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->receive_packet,
- (void *) mt->receive_packet);
-}
-
-/*
- * This is easy, since there is only 1 (altho we could get them from
- * other nodes...)
- */
-
-void *
-rtems_monitor_mpci_next(
- void *object_info,
- rtems_monitor_mpci_t *canonical_mpci,
- rtems_id *next_id
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- int n = rtems_get_index(*next_id);
-
- if (n >= 1)
- goto failed;
-
- if ( ! c->User_multiprocessing_table)
- goto failed;
-
- _Thread_Disable_dispatch();
-
- *next_id += 1;
- return (void *) c;
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-
-void
-rtems_monitor_mpci_dump_header(
- boolean verbose
-)
-{
- printf("\
- max max max default max\n\
- node nodes globals proxies timeout pktsize\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
-
- rtems_monitor_separator();
-}
-
-
-void
-rtems_monitor_mpci_dump(
- rtems_monitor_mpci_t *monitor_mpci,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += rtems_monitor_pad(2, length);
- length += printf(" %d", monitor_mpci->node);
- length += rtems_monitor_pad(11, length);
- length += printf("%d", monitor_mpci->maximum_nodes);
-
- length += rtems_monitor_pad(18, length);
- length += rtems_monitor_dump_decimal(monitor_mpci->maximum_global_objects);
-
- length += rtems_monitor_pad(28, length);
- length += rtems_monitor_dump_decimal(monitor_mpci->maximum_proxies);
-
- length += rtems_monitor_pad(37, length);
- length += rtems_monitor_dump_decimal(monitor_mpci->default_timeout);
-
- length += rtems_monitor_pad(46, length);
- length += rtems_monitor_dump_decimal(monitor_mpci->maximum_packet_size);
-
- printf("\n");
- length = 0;
- length += rtems_monitor_pad(DATACOL, length);
-
- length += printf("init: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->initialization, verbose);
-
- printf("\n");
- length = 0;
- length += rtems_monitor_pad(DATACOL, length);
-
- length += printf("get: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->get_packet, verbose);
- length += printf("; return: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->return_packet, verbose);
-
- printf("\n");
- length = 0;
- length += rtems_monitor_pad(DATACOL, length);
-
- length += printf("send: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->send_packet, verbose);
- length += printf("; receive: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->receive_packet, verbose);
-
- printf("\n");
- length = 0;
-}
diff --git a/c/src/lib/libmisc/monitor/mon-object.c b/c/src/lib/libmisc/monitor/mon-object.c
deleted file mode 100644
index 8d5a9c395f..0000000000
--- a/c/src/lib/libmisc/monitor/mon-object.c
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * RTEMS Monitor "object" support.
- *
- * Used to traverse object lists and print them out.
- * An object can be an RTEMS object (chain based stuff) or
- * a "misc" object such as a device driver.
- *
- * Each object has its own file in this directory (eg: extension.c)
- * That file provides routines to convert a "native" structure
- * to its canonical form, print a canonical structure, etc.
- *
- * TODO:
- * should allow for non-numeric id's???
- *
- * $Id$
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-#include <string.h> /* memcpy() */
-
-#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
-
-/*
- * add:
- * next
- */
-
-rtems_monitor_object_info_t rtems_monitor_object_info[] =
-{
- { RTEMS_MONITOR_OBJECT_CONFIG,
- (void *) 0,
- sizeof(rtems_monitor_config_t),
- (rtems_monitor_object_next_fn) rtems_monitor_config_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_config_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_config_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_config_dump,
- },
- { RTEMS_MONITOR_OBJECT_MPCI,
- (void *) 0,
- sizeof(rtems_monitor_mpci_t),
- (rtems_monitor_object_next_fn) rtems_monitor_mpci_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_mpci_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_mpci_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_mpci_dump,
- },
- { RTEMS_MONITOR_OBJECT_INIT_TASK,
- (void *) 0,
- sizeof(rtems_monitor_init_task_t),
- (rtems_monitor_object_next_fn) rtems_monitor_init_task_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_init_task_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_init_task_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_init_task_dump,
- },
- { RTEMS_MONITOR_OBJECT_TASK,
- (void *) &_RTEMS_tasks_Information,
- sizeof(rtems_monitor_task_t),
- (rtems_monitor_object_next_fn) rtems_monitor_manager_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_task_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_task_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_task_dump,
- },
- { RTEMS_MONITOR_OBJECT_QUEUE,
- (void *) &_Message_queue_Information,
- sizeof(rtems_monitor_queue_t),
- (rtems_monitor_object_next_fn) rtems_monitor_manager_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_queue_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_queue_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_queue_dump,
- },
- { RTEMS_MONITOR_OBJECT_EXTENSION,
- (void *) &_Extension_Information,
- sizeof(rtems_monitor_extension_t),
- (rtems_monitor_object_next_fn) rtems_monitor_manager_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_extension_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_extension_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_extension_dump,
- },
- { RTEMS_MONITOR_OBJECT_DRIVER,
- (void *) 0,
- sizeof(rtems_monitor_driver_t),
- (rtems_monitor_object_next_fn) rtems_monitor_driver_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_driver_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_driver_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_driver_dump,
- },
- { RTEMS_MONITOR_OBJECT_DNAME,
- /* XXX now that the driver name table is allocated from the */
- /* XXX Workspace, this does not work */
- (void *) 0,
- /* (void *) _IO_Driver_name_table, */
- sizeof(rtems_monitor_dname_t),
- (rtems_monitor_object_next_fn) rtems_monitor_dname_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_dname_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_dname_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_dname_dump,
- },
-};
-
-/*
- * Allow id's to be specified without the node number or
- * type for convenience.
- */
-
-rtems_id
-rtems_monitor_id_fixup(
- rtems_id id,
- unsigned32 default_node,
- rtems_monitor_object_type_t type
-)
-{
- unsigned32 node;
-
- node = rtems_get_node(id);
- if (node == 0)
- {
- if (rtems_get_class(id) != OBJECTS_NO_CLASS)
- type = rtems_get_class(id);
-
- id = _Objects_Build_id(type, default_node, rtems_get_index(id));
- }
- return id;
-}
-
-
-rtems_monitor_object_info_t *
-rtems_monitor_object_lookup(
- rtems_monitor_object_type_t type
-)
-{
- rtems_monitor_object_info_t *p;
- for (p = &rtems_monitor_object_info[0];
- p < &rtems_monitor_object_info[NUMELEMS(rtems_monitor_object_info)];
- p++)
- {
- if (p->type == type)
- return p;
- }
- return 0;
-}
-
-rtems_id
-rtems_monitor_object_canonical_next_remote(
- rtems_monitor_object_type_t type,
- rtems_id id,
- void *canonical
-)
-{
- rtems_id next_id;
- rtems_status_code status;
- rtems_monitor_server_request_t request;
- rtems_monitor_server_response_t response;
-
- /*
- * Send request
- */
-
- request.command = RTEMS_MONITOR_SERVER_CANONICAL;
- request.argument0 = (unsigned32) type;
- request.argument1 = (unsigned32) id;
-
- status = rtems_monitor_server_request(rtems_get_node(id), &request, &response);
- if (status != RTEMS_SUCCESSFUL)
- goto failed;
-
- /*
- * process response
- */
-
- next_id = (rtems_id) response.result0;
- if (next_id != RTEMS_OBJECT_ID_FINAL)
- (void) memcpy(canonical, &response.payload, response.result1);
-
- return next_id;
-
-failed:
- return RTEMS_OBJECT_ID_FINAL;
-
-}
-
-
-rtems_id
-rtems_monitor_object_canonical_next(
- rtems_monitor_object_info_t *info,
- rtems_id id,
- void *canonical
-)
-{
- rtems_id next_id;
- void *raw_item;
-
- if ( ! _Objects_Is_local_id(id))
- next_id = rtems_monitor_object_canonical_next_remote(info->type,
- id,
- canonical);
- else
- {
- next_id = id;
-
- raw_item = (void *) info->next(info->object_information,
- canonical,
- &next_id);
-
- if (raw_item)
- {
- info->canonical(canonical, raw_item);
- _Thread_Enable_dispatch();
- }
- }
- return next_id;
-}
-
-
-/*
- * this is routine server invokes locally to get the type
- */
-
-rtems_id
-rtems_monitor_object_canonical_get(
- rtems_monitor_object_type_t type,
- rtems_id id,
- void *canonical,
- unsigned32 *size_p
-)
-{
- rtems_monitor_object_info_t *info;
- rtems_id next_id;
-
- *size_p = 0;
-
- info = rtems_monitor_object_lookup(type);
-
- if (info == 0)
- return RTEMS_OBJECT_ID_FINAL;
-
- next_id = rtems_monitor_object_canonical_next(info, id, canonical);
- *size_p = info->size;
-
- return next_id;
-}
-
-
-void
-rtems_monitor_object_dump_1(
- rtems_monitor_object_info_t *info,
- rtems_id id,
- boolean verbose
-)
-{
- rtems_id next_id;
- rtems_monitor_union_t canonical;
-
- if ((next_id = rtems_monitor_object_canonical_next(
- info,
- id,
- &canonical)) != RTEMS_OBJECT_ID_FINAL)
- {
- /*
- * If the one we actually got is the one we wanted, then
- * print it out.
- * For ones that have an id field, this works fine,
- * for all others, always dump it out.
- *
- * HACK: the way we determine whether there is an id is a hack.
- *
- * by the way: the reason we try to not have an id, is that some
- * of the canonical structures are almost too big for shared
- * memory driver (eg: mpci)
- */
-
- if ((info->next != rtems_monitor_manager_next) ||
- (id == canonical.generic.id))
- info->dump(&canonical, verbose);
- }
-}
-
-void
-rtems_monitor_object_dump_all(
- rtems_monitor_object_info_t *info,
- boolean verbose
-)
-{
- rtems_id next_id;
- rtems_monitor_union_t canonical;
-
- next_id = RTEMS_OBJECT_ID_INITIAL(info->type, rtems_monitor_default_node);
-
- while ((next_id = rtems_monitor_object_canonical_next(
- info,
- next_id,
- &canonical)) != RTEMS_OBJECT_ID_FINAL)
- {
- info->dump(&canonical, verbose);
- }
-}
-
-void
-rtems_monitor_object_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- int arg;
- rtems_monitor_object_info_t *info = 0;
- rtems_monitor_object_type_t type = (rtems_monitor_object_type_t) command_arg;
-
- /* what is the default type? */
- type = (rtems_monitor_object_type_t) command_arg;
-
- if (argc == 1)
- {
- if (type == RTEMS_MONITOR_OBJECT_INVALID)
- {
- printf("A type must be specified to \"dump all\"\n");
- goto done;
- }
-
- info = rtems_monitor_object_lookup(type);
- if (info == 0)
- goto not_found;
-
- if (info->dump_header)
- info->dump_header(verbose);
- rtems_monitor_object_dump_all(info, verbose);
- }
- else
- {
- unsigned32 default_node = rtems_monitor_default_node;
- rtems_monitor_object_type_t last_type = RTEMS_MONITOR_OBJECT_INVALID;
- rtems_id id;
-
- for (arg=1; argv[arg]; arg++)
- {
- id = (rtems_id) strtoul(argv[arg], 0, 16);
- id = rtems_monitor_id_fixup(id, default_node, type);
- type = (rtems_monitor_object_type_t) rtems_get_class(id);
-
- /*
- * Allow the item type to change in the middle
- * of the command. If the type changes, then
- * just dump out a new header and keep on going.
- */
- if (type != last_type)
- {
- info = rtems_monitor_object_lookup(type);
- if (info == 0)
- goto not_found;
-
- if (info->dump_header)
- info->dump_header(verbose);
- }
-
- if (info == 0)
- {
-not_found: printf("Invalid or unsupported type %d\n", type);
- goto done;
- }
-
- rtems_monitor_object_dump_1(info, id, verbose);
-
- default_node = rtems_get_node(id);
-
- last_type = type;
- }
- }
-done:
- return;
-}
diff --git a/c/src/lib/libmisc/monitor/mon-prmisc.c b/c/src/lib/libmisc/monitor/mon-prmisc.c
deleted file mode 100644
index ce9aa9a554..0000000000
--- a/c/src/lib/libmisc/monitor/mon-prmisc.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Print misc stuff for the monitor dump routines
- * Each routine returns the number of characters it output.
- *
- * TODO:
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <rtems/assoc.h>
-
-#include <stdio.h>
-#include <ctype.h>
-
-void
-rtems_monitor_separator(void)
-{
- printf("------------------------------------------------------------------------------\n");
-}
-
-unsigned32
-rtems_monitor_pad(
- unsigned32 destination_column,
- unsigned32 current_column
-)
-{
- int pad_length;
-
- if (destination_column <= current_column)
- pad_length = 1;
- else
- pad_length = destination_column - current_column;
-
- return printf("%*s", pad_length, "");
-}
-
-unsigned32
-rtems_monitor_dump_char(rtems_unsigned8 ch)
-{
- if (isprint(ch))
- return printf("%c", ch);
- else
- return printf("%02x", ch);
-}
-
-unsigned32
-rtems_monitor_dump_decimal(unsigned32 num)
-{
- return printf("%4d", num);
-}
-
-unsigned32
-rtems_monitor_dump_hex(unsigned32 num)
-{
- return printf("0x%x", num);
-}
-
-unsigned32
-rtems_monitor_dump_assoc_bitfield(
- rtems_assoc_t *ap,
- char *separator,
- unsigned32 value
- )
-{
- unsigned32 b;
- unsigned32 length = 0;
- const char *name;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (length)
- length += printf("%s", separator);
-
- name = rtems_assoc_name_by_local(ap, b);
-
- if (name)
- length += printf("%s", name);
- else
- length += printf("0x%x", b);
- }
-
- return length;
-}
-
-unsigned32
-rtems_monitor_dump_id(rtems_id id)
-{
- return printf("%08x", id);
-}
-
-unsigned32
-rtems_monitor_dump_name(rtems_name name)
-{
- unsigned32 i;
- unsigned32 length = 0;
- union {
- unsigned32 ui;
- char c[4];
- } u;
-
- u.ui = (rtems_unsigned32) name;
-
-#if (CPU_BIG_ENDIAN == TRUE)
- for (i=0; i<sizeof(u.c); i++)
- length += rtems_monitor_dump_char(u.c[i]);
-#else
- for (i=sizeof(u.c)-1; i ; i--)
- length += rtems_monitor_dump_char(u.c[i]);
-#endif
- return length;
-}
-
-unsigned32
-rtems_monitor_dump_priority(rtems_task_priority priority)
-{
- return printf("%3d", priority);
-}
-
-
-rtems_assoc_t rtems_monitor_state_assoc[] = {
- { "DORM", STATES_DORMANT },
- { "SUSP", STATES_SUSPENDED },
- { "TRANS", STATES_TRANSIENT },
- { "DELAY", STATES_DELAYING },
- { "Wbuf", STATES_WAITING_FOR_BUFFER },
- { "Wseg", STATES_WAITING_FOR_SEGMENT },
- { "Wmsg" , STATES_WAITING_FOR_MESSAGE },
- { "Wevnt", STATES_WAITING_FOR_EVENT },
- { "Wsem", STATES_WAITING_FOR_SEMAPHORE },
- { "Wtime", STATES_WAITING_FOR_TIME },
- { "Wrpc", STATES_WAITING_FOR_RPC_REPLY },
- { "WRATE", STATES_WAITING_FOR_PERIOD },
- { 0, 0, 0 },
-};
-
-unsigned32
-rtems_monitor_dump_state(States_Control state)
-{
- unsigned32 length = 0;
-
- if (state == STATES_READY) /* assoc doesn't deal with this as it is 0 */
- length += printf("READY");
-
- length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_state_assoc,
- ":",
- state);
- return length;
-}
-
-rtems_assoc_t rtems_monitor_attribute_assoc[] = {
- { "FL", RTEMS_FLOATING_POINT },
- { "GL", RTEMS_GLOBAL },
- { "PR", RTEMS_PRIORITY },
- { "BI", RTEMS_BINARY_SEMAPHORE },
- { "IN", RTEMS_INHERIT_PRIORITY },
- { 0, 0, 0 },
-};
-
-unsigned32
-rtems_monitor_dump_attributes(rtems_attribute attributes)
-{
- unsigned32 length = 0;
-
- if (attributes == RTEMS_DEFAULT_ATTRIBUTES) /* value is 0 */
- length += printf("DEFAULT");
-
- length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_attribute_assoc,
- ":",
- attributes);
- return length;
-}
-
-rtems_assoc_t rtems_monitor_modes_assoc[] = {
- { "nP", RTEMS_NO_PREEMPT },
- { "T", RTEMS_TIMESLICE },
- { "nA", RTEMS_NO_ASR },
- { 0, 0, 0 },
-};
-
-unsigned32
-rtems_monitor_dump_modes(rtems_mode modes)
-{
- unsigned32 length = 0;
-
- if (modes == RTEMS_DEFAULT_MODES) /* value is 0 */
- length += printf("P:T:nA");
-
- length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_modes_assoc,
- ":",
- modes);
- return length;
-}
-
-rtems_assoc_t rtems_monitor_events_assoc[] = {
- { "0", RTEMS_EVENT_0 },
- { "1", RTEMS_EVENT_1 },
- { "2", RTEMS_EVENT_2 },
- { "3", RTEMS_EVENT_3 },
- { "4", RTEMS_EVENT_4 },
- { "5", RTEMS_EVENT_5 },
- { "6", RTEMS_EVENT_6 },
- { "7", RTEMS_EVENT_7 },
- { "8", RTEMS_EVENT_8 },
- { "9", RTEMS_EVENT_9 },
- { "10", RTEMS_EVENT_10 },
- { "11", RTEMS_EVENT_11 },
- { "12", RTEMS_EVENT_12 },
- { "13", RTEMS_EVENT_13 },
- { "14", RTEMS_EVENT_14 },
- { "15", RTEMS_EVENT_15 },
- { "16", RTEMS_EVENT_16 },
- { "17", RTEMS_EVENT_17 },
- { "18", RTEMS_EVENT_18 },
- { "19", RTEMS_EVENT_19 },
- { "20", RTEMS_EVENT_20 },
- { "21", RTEMS_EVENT_21 },
- { "22", RTEMS_EVENT_22 },
- { "23", RTEMS_EVENT_23 },
- { "24", RTEMS_EVENT_24 },
- { "25", RTEMS_EVENT_25 },
- { "26", RTEMS_EVENT_26 },
- { "27", RTEMS_EVENT_27 },
- { "28", RTEMS_EVENT_28 },
- { "29", RTEMS_EVENT_29 },
- { "30", RTEMS_EVENT_30 },
- { "31", RTEMS_EVENT_31 },
- { 0, 0, 0 },
-};
-
-unsigned32
-rtems_monitor_dump_events(rtems_event_set events)
-{
- unsigned32 length = 0;
-
- if (events == EVENT_SETS_NONE_PENDING) /* value is 0 */
- length += printf("NONE");
-
- length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_events_assoc,
- ":",
- events);
- return length;
-}
-
-unsigned32
-rtems_monitor_dump_notepad(unsigned32 *notepad)
-{
- unsigned32 length = 0;
- int i;
-
- for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++)
- if (notepad[i])
- length += printf("%d: 0x%x ", i, notepad[i]);
-
- return length;
-}
diff --git a/c/src/lib/libmisc/monitor/mon-queue.c b/c/src/lib/libmisc/monitor/mon-queue.c
deleted file mode 100644
index b165062e28..0000000000
--- a/c/src/lib/libmisc/monitor/mon-queue.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-
-void
-rtems_monitor_queue_canonical(
- rtems_monitor_queue_t *canonical_queue,
- void *queue_void
-)
-{
- Message_queue_Control *rtems_queue = (Message_queue_Control *) queue_void;
-
- canonical_queue->attributes = rtems_queue->attribute_set;
- canonical_queue->maximum_message_size = rtems_queue->message_queue.maximum_message_size;
- canonical_queue->maximum_pending_messages = rtems_queue->message_queue.maximum_pending_messages;
- canonical_queue->number_of_pending_messages = rtems_queue->message_queue.number_of_pending_messages;
-}
-
-void
-rtems_monitor_queue_dump_header(
- boolean verbose
-)
-{
- printf("\
- ID NAME ATTRIBUTES PEND MAXPEND MAXSIZE\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-
-/*
- * Dump out the "next" queue indicated by 'id'.
- * Returns next one to check.
- * Returns RTEMS_OBJECT_ID_FINAL when all done
- */
-
-void
-rtems_monitor_queue_dump(
- rtems_monitor_queue_t *monitor_queue,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += rtems_monitor_dump_id(monitor_queue->id);
- length += rtems_monitor_pad(11, length);
- length += rtems_monitor_dump_name(monitor_queue->name);
- length += rtems_monitor_pad(19, length);
- length += rtems_monitor_dump_attributes(monitor_queue->attributes);
- length += rtems_monitor_pad(31, length);
- length += rtems_monitor_dump_decimal(monitor_queue->number_of_pending_messages);
- length += rtems_monitor_pad(39, length);
- length += rtems_monitor_dump_decimal(monitor_queue->maximum_pending_messages);
- length += rtems_monitor_pad(48, length);
- length += rtems_monitor_dump_decimal(monitor_queue->maximum_message_size);
-
- printf("\n");
-}
diff --git a/c/src/lib/libmisc/monitor/mon-server.c b/c/src/lib/libmisc/monitor/mon-server.c
deleted file mode 100644
index 3ae56058d3..0000000000
--- a/c/src/lib/libmisc/monitor/mon-server.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * RTEMS monitor server (handles requests for info from RTEMS monitors
- * running on other nodes)
- *
- * $Id$
- */
-
-#include <rtems.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <rtems/monitor.h>
-
-/*
- * Various id's for the server
- */
-
-rtems_id rtems_monitor_server_task_id;
-rtems_id rtems_monitor_server_request_queue_id; /* our server */
-rtems_id *rtems_monitor_server_request_queue_ids; /* all servers */
-rtems_id rtems_monitor_server_response_queue_id; /* our server */
-
-
-/*
- * Send a request to a server task
- */
-
-rtems_status_code
-rtems_monitor_server_request(
- unsigned32 server_node,
- rtems_monitor_server_request_t *request,
- rtems_monitor_server_response_t *response
-)
-{
- rtems_id server_id;
- rtems_status_code status;
- unsigned32 size;
-
- /*
- * What is id of monitor on target node?
- * Look it up if we don't know it yet.
- */
-
- server_id = rtems_monitor_server_request_queue_ids[server_node];
- if (server_id == 0)
- {
- status = rtems_message_queue_ident(RTEMS_MONITOR_QUEUE_NAME,
- server_node,
- &server_id);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "ident of remote server failed");
- goto done;
- }
-
- rtems_monitor_server_request_queue_ids[server_node] = server_id;
- }
-
- request->return_id = rtems_monitor_server_response_queue_id;
-
- status = rtems_message_queue_send(server_id, request, sizeof(*request));
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "monitor server request send failed");
- goto done;
- }
-
- /*
- * Await response, if requested
- */
-
- if (response)
- {
- status = rtems_message_queue_receive(rtems_monitor_server_response_queue_id,
- response,
- &size,
- RTEMS_WAIT,
- 100);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "server did not respond");
-
- /* maybe server task was restarted; look it up again next time */
- rtems_monitor_server_request_queue_ids[server_node] = 0;
-
- goto done;
- }
-
- if (response->command != RTEMS_MONITOR_SERVER_RESPONSE)
- {
- status = RTEMS_INCORRECT_STATE;
- goto done;
- }
- }
-
-done:
- return status;
-}
-
-
-
-/*
- * monitor server task
- */
-
-void
-rtems_monitor_server_task(
- rtems_task_argument monitor_flags
-)
-{
- rtems_monitor_server_request_t request;
- rtems_monitor_server_response_t response;
- rtems_status_code status;
- unsigned32 size;
-
- for (;;)
- {
- status = rtems_message_queue_receive(
- rtems_monitor_server_request_queue_id,
- &request,
- &size,
- RTEMS_WAIT,
- (rtems_interval) 0);
-
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "monitor server msg queue receive error");
- goto failed;
- }
-
- if (size != sizeof(request))
- {
- rtems_error(0, "monitor server bad size on receive");
- goto failed;
- }
-
- switch (request.command)
- {
- case RTEMS_MONITOR_SERVER_CANONICAL:
- {
- rtems_monitor_object_type_t object_type;
- rtems_id id;
- rtems_id next_id;
-
- object_type = (rtems_monitor_object_type_t) request.argument0;
- id = (rtems_id) request.argument1;
- next_id = rtems_monitor_object_canonical_get(object_type,
- id,
- &response.payload,
- &size);
-
- response.command = RTEMS_MONITOR_SERVER_RESPONSE;
- response.result0 = next_id;
- response.result1 = size;
-
-#define SERVER_OVERHEAD (RTEMS_offsetof(rtems_monitor_server_response_t, \
- payload))
-
- status = rtems_message_queue_send(request.return_id,
- &response,
- size + SERVER_OVERHEAD);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "response send failed");
- goto failed;
- }
- break;
- }
-
- default:
- {
- rtems_error(0, "invalid command to monitor server: %d", request.command);
- goto failed;
- }
- }
- }
-
-failed:
- rtems_task_delete(RTEMS_SELF);
-}
-
-
-/*
- * Kill off any old server
- * Not sure if this is useful, but it doesn't help
- */
-
-void
-rtems_monitor_server_kill(void)
-{
- if (rtems_monitor_server_task_id)
- rtems_task_delete(rtems_monitor_server_task_id);
- rtems_monitor_task_id = 0;
-
- if (rtems_monitor_server_request_queue_id)
- rtems_message_queue_delete(rtems_monitor_server_request_queue_id);
- rtems_monitor_server_response_queue_id = 0;
-
- if (rtems_monitor_server_response_queue_id)
- rtems_message_queue_delete(rtems_monitor_server_response_queue_id);
- rtems_monitor_server_request_queue_ids = 0;
-
- if (rtems_monitor_server_request_queue_ids)
- free(rtems_monitor_server_request_queue_ids);
- rtems_monitor_server_request_queue_ids = 0;
-}
-
-
-void
-rtems_monitor_server_init(
- unsigned32 monitor_flags
-)
-{
- rtems_status_code status;
-
- if (_System_state_Is_multiprocessing &&
- (_Configuration_MP_table->maximum_nodes > 1))
- {
- unsigned32 maximum_nodes = _Configuration_MP_table->maximum_nodes;
-
- /*
- * create the msg que our server will listen
- * Since we only get msgs from other RTEMS monitors, we just
- * need reserve space for 1 msg from each node.
- */
-
- status = rtems_message_queue_create(
- RTEMS_MONITOR_QUEUE_NAME,
- maximum_nodes,
- sizeof(rtems_monitor_server_request_t),
- RTEMS_GLOBAL,
- &rtems_monitor_server_request_queue_id);
-
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not create monitor server message queue");
- goto done;
- }
-
- /*
- * create the msg que our responses will come on
- * Since monitor just does one thing at a time, we only need 1 item
- * message queue.
- */
-
- status = rtems_message_queue_create(
- RTEMS_MONITOR_RESPONSE_QUEUE_NAME,
- 1, /* depth */
- sizeof(rtems_monitor_server_response_t),
- RTEMS_GLOBAL,
- &rtems_monitor_server_response_queue_id);
-
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not create monitor response message queue");
- goto done;
- }
-
- /* need an id for queue of each other server we might talk to */
- /* indexed by node, so add 1 to maximum_nodes */
- rtems_monitor_server_request_queue_ids =
- (rtems_id *) malloc((maximum_nodes + 1) * sizeof(rtems_id));
- (void) memset(rtems_monitor_server_request_queue_ids,
- 0,
- (maximum_nodes + 1) * sizeof(rtems_id));
-
- rtems_monitor_server_request_queue_ids[rtems_monitor_node] =
- rtems_monitor_server_request_queue_id;
-
- /*
- * create the server task
- */
- status = rtems_task_create(RTEMS_MONITOR_SERVER_NAME,
- 1,
- 0 /* default stack */,
- RTEMS_INTERRUPT_LEVEL(0),
- RTEMS_DEFAULT_ATTRIBUTES,
- &rtems_monitor_server_task_id);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not create monitor server task");
- goto done;
- }
-
- /*
- * Start the server task
- */
- status = rtems_task_start(rtems_monitor_server_task_id,
- rtems_monitor_server_task,
- monitor_flags);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not start monitor server");
- goto done;
- }
- }
-
-done:
- return;
-}
diff --git a/c/src/lib/libmisc/monitor/mon-symbols.c b/c/src/lib/libmisc/monitor/mon-symbols.c
deleted file mode 100644
index 48781bb6cc..0000000000
--- a/c/src/lib/libmisc/monitor/mon-symbols.c
+++ /dev/null
@@ -1,487 +0,0 @@
-/*
- * File: symbols.c
- *
- * Description:
- * Symbol table manager for the RTEMS monitor.
- * These routines may be used by other system resources also.
- *
- *
- * TODO:
- *
- * $Id$
- */
-
-/* for strcasecmp in linux and solaris */
-#if defined(__linux__)
-#include <features.h>
-#define __USE_BSD
-#endif
-#include <string.h>
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <rtems/monitor.h>
-#include <rtems/symbols.h>
-
-
-rtems_symbol_table_t *
-rtems_symbol_table_create()
-{
- rtems_symbol_table_t *table;
-
- table = (rtems_symbol_table_t *) malloc(sizeof(rtems_symbol_table_t));
- memset((void *) table, 0, sizeof(*table));
-
- table->growth_factor = 30; /* 30 percent */
-
- return table;
-}
-
-void
-rtems_symbol_table_destroy(rtems_symbol_table_t *table)
-{
- rtems_symbol_string_block_t *p, *pnext;
-
- if (table)
- {
- if (table->addresses)
- (void) free(table->addresses);
- table->addresses = 0;
- p = table->string_buffer_head;
- while (p)
- {
- pnext = p->next;
- free(p);
- p = pnext;
- }
- table->string_buffer_head = 0;
- table->string_buffer_current = 0;
-
- free(table);
- }
-}
-
-rtems_symbol_t *
-rtems_symbol_create(
- rtems_symbol_table_t *table,
- char *name,
- rtems_unsigned32 value
- )
-{
- int symbol_length;
- size_t newsize;
- rtems_symbol_t *sp;
-
- symbol_length = strlen(name) + 1; /* include '\000' in length */
-
- /* need to grow the table? */
- if (table->next >= table->size)
- {
- if (table->size == 0)
- newsize = 100;
- else
- newsize = table->size + (table->size / (100 / table->growth_factor));
-
- table->addresses = (rtems_symbol_t *) realloc((void *) table->addresses, newsize * sizeof(rtems_symbol_t));
- if (table->addresses == 0) /* blew it; lost orig */
- goto failed;
- table->size = newsize;
- }
-
- sp = &table->addresses[table->next];
- sp->value = value;
-
- /* Have to add it to string pool */
- /* need to grow pool? */
-
- if ((table->string_buffer_head == 0) ||
- (table->strings_next + symbol_length) >= SYMBOL_STRING_BLOCK_SIZE)
- {
- rtems_symbol_string_block_t *p;
-
- p = (rtems_symbol_string_block_t *) malloc(sizeof(rtems_symbol_string_block_t));
- if (p == 0)
- goto failed;
- p->next = 0;
- if (table->string_buffer_head == 0)
- table->string_buffer_head = p;
- else
- table->string_buffer_current->next = p;
- table->string_buffer_current = p;
-
- table->strings_next = 0;
- }
-
- sp->name = table->string_buffer_current->buffer + table->strings_next;
- (void) strcpy(sp->name, name);
-
- table->strings_next += symbol_length;
- table->sorted = 0;
- table->next++;
-
- return sp;
-
-/* XXX Not sure what to do here. We've possibly destroyed the initial
- symbol table due to realloc failure */
-failed:
- return 0;
-}
-
-/*
- * Qsort entry point for compare by address
- */
-
-static int
-rtems_symbol_compare(const void *e1,
- const void *e2)
-{
- rtems_symbol_t *s1, *s2;
- s1 = (rtems_symbol_t *) e1;
- s2 = (rtems_symbol_t *) e2;
-
- if (s1->value < s2->value)
- return -1;
- if (s1->value > s2->value)
- return 1;
- return 0;
-}
-
-
-/*
- * Sort the symbol table using qsort
- */
-
-static void
-rtems_symbol_sort(rtems_symbol_table_t *table)
-{
- qsort((void *) table->addresses, (size_t) table->next,
- sizeof(rtems_symbol_t), rtems_symbol_compare);
- table->sorted = 1;
-}
-
-
-/*
- * Search the symbol table by address
- * This code based on CYGNUS newlib bsearch, but changed
- * to allow for finding closest symbol <= key
- */
-
-rtems_symbol_t *
-rtems_symbol_value_lookup(
- rtems_symbol_table_t *table,
- rtems_unsigned32 value
- )
-{
- rtems_symbol_t *sp;
- rtems_symbol_t *base;
- rtems_symbol_t *best = 0;
- rtems_unsigned32 distance;
- rtems_unsigned32 best_distance = ~0;
- rtems_unsigned32 elements;
-
- if (table == 0)
- table = rtems_monitor_symbols;
-
- if ((table == 0) || (table->size == 0))
- return 0;
-
- if (table->sorted == 0)
- rtems_symbol_sort(table);
-
- base = table->addresses;
- elements = table->next;
-
- while (elements)
- {
- sp = base + (elements / 2);
- if (value < sp->value)
- elements /= 2;
- else if (value > sp->value)
- {
- distance = value - sp->value;
- if (distance < best_distance)
- {
- best_distance = distance;
- best = sp;
- }
- base = sp + 1;
- elements = (elements / 2) - (elements % 2 ? 0 : 1);
- }
- else
- return sp;
- }
-
- if (value == base->value)
- return base;
-
- return best;
-}
-
-/*
- * Search the symbol table for the exact matching address.
- * If the symbol table has already been sorted, then
- * call the regular symbol value lookup, however, it it
- * has not yet been sorted, search it sequentially.
- * This routine is primarily used for low level symbol
- * lookups (eg. from exception handler and interrupt routines)
- * where the penality of sorted is not wanted and where
- * an exact match is needed such that symbol table order
- * is not important.
- */
-const rtems_symbol_t *
-rtems_symbol_value_lookup_exact(
- rtems_symbol_table_t *table,
- rtems_unsigned32 value
- )
-{
- rtems_unsigned32 s;
- rtems_symbol_t *sp;
-
- if (table == 0)
- {
- table = rtems_monitor_symbols;
- if (table == 0)
- return NULL;
- }
-
- if (table->sorted)
- {
- sp = rtems_symbol_value_lookup(table, value);
- if ( rtems_symbol_value(sp) == value )
- return sp;
- else
- return NULL; /* not an exact match */
- }
-
- for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
- {
- if ( sp->value == value )
- return sp;
- }
-
- return NULL;
-
-}
-
-
-/*
- * Search the symbol table by string name (case independent)
- */
-
-rtems_symbol_t *
-rtems_symbol_name_lookup(
- rtems_symbol_table_t *table,
- char *name
- )
-{
- rtems_unsigned32 s;
- rtems_symbol_t *sp;
-
- if (table == 0)
- {
- table = rtems_monitor_symbols;
- if (table == 0)
- return NULL;
- }
-
- for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
- {
- if ( strcasecmp(sp->name, name) == 0 )
- return sp;
- }
-
- return NULL;
-}
-
-void *
-rtems_monitor_symbol_next(
- void *object_info,
- rtems_monitor_symbol_t *canonical,
- rtems_id *next_id
-)
-{
- rtems_symbol_table_t *table;
- rtems_unsigned32 n = rtems_get_index(*next_id);
-
- table = *(rtems_symbol_table_t **) object_info;
- if (table == 0)
- goto failed;
-
- if (n >= table->next)
- goto failed;
-
- /* NOTE: symbols do not have id and name fields */
-
- if (table->sorted == 0)
- rtems_symbol_sort(table);
-
- _Thread_Disable_dispatch();
-
- *next_id += 1;
- return (void *) (table->addresses + n);
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-void
-rtems_monitor_symbol_canonical(
- rtems_monitor_symbol_t *canonical_symbol,
- rtems_symbol_t *sp
-)
-{
- canonical_symbol->value = sp->value;
- canonical_symbol->offset = 0;
- strncpy(canonical_symbol->name, sp->name, sizeof(canonical_symbol->name));
-}
-
-
-void
-rtems_monitor_symbol_canonical_by_name(
- rtems_monitor_symbol_t *canonical_symbol,
- char *name
-)
-{
- rtems_symbol_t *sp;
-
- sp = rtems_symbol_name_lookup(0, name);
-
- canonical_symbol->value = sp ? sp->value : 0;
-
- strncpy(canonical_symbol->name, name, sizeof(canonical_symbol->name));
- canonical_symbol->offset = 0;
-}
-
-void
-rtems_monitor_symbol_canonical_by_value(
- rtems_monitor_symbol_t *canonical_symbol,
- void *value_void_p
-)
-{
- unsigned32 value = (unsigned32) value_void_p;
- rtems_symbol_t *sp;
-
- sp = rtems_symbol_value_lookup(0, value);
- if (sp)
- {
- canonical_symbol->value = sp->value;
- canonical_symbol->offset = value - sp->value;
- strncpy(canonical_symbol->name, sp->name, sizeof(canonical_symbol->name));
- }
- else
- {
- canonical_symbol->value = value;
- canonical_symbol->offset = 0;
- canonical_symbol->name[0] = '\0';
- }
-}
-
-
-unsigned32
-rtems_monitor_symbol_dump(
- rtems_monitor_symbol_t *canonical_symbol,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- /*
- * print the name if it exists AND if value is non-zero
- * Ie: don't print some garbage symbol for address 0
- */
-
- if (canonical_symbol->name[0] && (canonical_symbol->value != 0))
- {
- if (canonical_symbol->offset == 0)
- length += printf("%.*s",
- (int) sizeof(canonical_symbol->name),
- canonical_symbol->name);
- else
- length += printf("<%.*s+0x%x>",
- (int) sizeof(canonical_symbol->name),
- canonical_symbol->name,
- canonical_symbol->offset);
- if (verbose)
- length += printf(" [0x%x]", canonical_symbol->value);
- }
- else
- length += printf("[0x%x]", canonical_symbol->value);
-
- return length;
-}
-
-
-void
-rtems_monitor_symbol_dump_all(
- rtems_symbol_table_t *table,
- boolean verbose
-)
-{
- rtems_unsigned32 s;
- rtems_symbol_t *sp;
-
- if (table == 0)
- {
- table = rtems_monitor_symbols;
- if (table == 0)
- return;
- }
-
- if (table->sorted == 0)
- rtems_symbol_sort(table);
-
- for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
- {
- rtems_monitor_symbol_t canonical_symbol;
-
- rtems_monitor_symbol_canonical(&canonical_symbol, sp);
- rtems_monitor_symbol_dump(&canonical_symbol, TRUE);
- printf("\n");
- }
-}
-
-
-/*
- * 'symbol' command
- */
-
-void
-rtems_monitor_symbol_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- int arg;
- rtems_symbol_table_t *table;
-
- table = *(rtems_symbol_table_t **) command_arg;
- if (table == 0)
- {
- table = rtems_monitor_symbols;
- if (table == 0)
- return;
- }
-
- /*
- * Use object command to dump out whole symbol table
- */
- if (argc == 1)
- rtems_monitor_symbol_dump_all(table, verbose);
- else
- {
- rtems_monitor_symbol_t canonical_symbol;
-
- for (arg=1; argv[arg]; arg++)
- {
- rtems_monitor_symbol_canonical_by_name(&canonical_symbol, argv[arg]);
- rtems_monitor_symbol_dump(&canonical_symbol, verbose);
- printf("\n");
- }
- }
-}
diff --git a/c/src/lib/libmisc/monitor/mon-task.c b/c/src/lib/libmisc/monitor/mon-task.c
deleted file mode 100644
index b6ca36ddd1..0000000000
--- a/c/src/lib/libmisc/monitor/mon-task.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * RTEMS Monitor task support
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <string.h> /* memcpy() */
-
-void
-rtems_monitor_task_canonical(
- rtems_monitor_task_t *canonical_task,
- void *thread_void
-)
-{
- Thread_Control *rtems_thread = (Thread_Control *) thread_void;
- RTEMS_API_Control *api;
-
- api = rtems_thread->API_Extensions[ THREAD_API_RTEMS ];
-
- canonical_task->entry = rtems_thread->Start.entry_point;
- canonical_task->argument = rtems_thread->Start.numeric_argument;
- canonical_task->stack = rtems_thread->Start.Initial_stack.area;
- canonical_task->stack_size = rtems_thread->Start.Initial_stack.size;
- canonical_task->priority = rtems_thread->current_priority;
- canonical_task->state = rtems_thread->current_state;
- canonical_task->wait_id = rtems_thread->Wait.id;
- canonical_task->events = api->pending_events;
-
-/* XXX modes and attributes only exist in the RTEMS API .. */
-/* XXX not directly in the core thread.. they will have to be derived */
-/* XXX if they are important enough to include anymore. */
- canonical_task->modes = 0; /* XXX FIX ME.... rtems_thread->current_modes; */
- canonical_task->attributes = 0 /* XXX FIX ME rtems_thread->API_Extensions[ THREAD_API_RTEMS ]->attribute_set */;
- (void) memcpy(canonical_task->notepad, api ->Notepads, sizeof(canonical_task->notepad));
-/* XXX more to fix */
-/*
- (void) memcpy(&canonical_task->wait_args, &rtems_thread->Wait.Extra, sizeof(canonical_task->wait_args));
-*/
-}
-
-
-void
-rtems_monitor_task_dump_header(
- boolean verbose
-)
-{
- printf("\
- ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
-
- rtems_monitor_separator();
-}
-
-/*
- */
-
-void
-rtems_monitor_task_dump(
- rtems_monitor_task_t *monitor_task,
- boolean verbose
-)
-{
- int length = 0;
-
- length += rtems_monitor_dump_id(monitor_task->id);
- length += rtems_monitor_pad(11, length);
- length += rtems_monitor_dump_name(monitor_task->name);
- length += rtems_monitor_pad(18, length);
- length += rtems_monitor_dump_priority(monitor_task->priority);
- length += rtems_monitor_pad(24, length);
- length += rtems_monitor_dump_state(monitor_task->state);
- length += rtems_monitor_pad(31, length);
- length += rtems_monitor_dump_modes(monitor_task->modes);
- length += rtems_monitor_pad(39, length);
- length += rtems_monitor_dump_events(monitor_task->events);
- if (monitor_task->wait_id)
- {
- length += rtems_monitor_pad(47, length);
- length += rtems_monitor_dump_id(monitor_task->wait_id);
- length += rtems_monitor_pad(57, length);
- length += rtems_monitor_dump_hex(monitor_task->wait_args);
- }
-
- length += rtems_monitor_pad(65, length);
- length += rtems_monitor_dump_notepad(monitor_task->notepad);
- printf("\n");
-}
-
diff --git a/c/src/lib/libmisc/monitor/monitor.h b/c/src/lib/libmisc/monitor/monitor.h
deleted file mode 100644
index 16efd7c41f..0000000000
--- a/c/src/lib/libmisc/monitor/monitor.h
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * File: monitor.h
- *
- * Description:
- * The RTEMS monitor task include file.
- *
- * TODO:
- *
- * $Id$
- */
-
-#ifndef __MONITOR_H
-#define __MONITOR_H
-
-#include <rtems/symbols.h>
-#include <rtems/error.h> /* rtems_error() */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Monitor types are derived from rtems object classes
- */
-
-typedef enum {
- RTEMS_MONITOR_OBJECT_INVALID = OBJECTS_NO_CLASS,
- RTEMS_MONITOR_OBJECT_TASK = OBJECTS_RTEMS_TASKS,
- RTEMS_MONITOR_OBJECT_EXTENSION = OBJECTS_RTEMS_EXTENSIONS,
- RTEMS_MONITOR_OBJECT_QUEUE = OBJECTS_RTEMS_MESSAGE_QUEUES,
- RTEMS_MONITOR_OBJECT_SEMAPHORE = OBJECTS_RTEMS_SEMAPHORES,
- RTEMS_MONITOR_OBJECT_PARTITION = OBJECTS_RTEMS_PARTITIONS,
- RTEMS_MONITOR_OBJECT_REGION = OBJECTS_RTEMS_REGIONS,
- RTEMS_MONITOR_OBJECT_PORT = OBJECTS_RTEMS_PORTS,
-
- /* following monitor objects are not known to RTEMS, but
- * we like to have "types" for them anyway */
-
- RTEMS_MONITOR_OBJECT_DRIVER = OBJECTS_CLASSES_LAST+1,
- RTEMS_MONITOR_OBJECT_DNAME,
- RTEMS_MONITOR_OBJECT_CONFIG,
- RTEMS_MONITOR_OBJECT_INIT_TASK,
- RTEMS_MONITOR_OBJECT_MPCI,
- RTEMS_MONITOR_OBJECT_SYMBOL
-} rtems_monitor_object_type_t;
-
-/*
- * rtems_monitor_init() flags
- */
-
-#define RTEMS_MONITOR_SUSPEND 0x0001 /* suspend monitor on startup */
-#define RTEMS_MONITOR_GLOBAL 0x0002 /* monitor should be global */
-
-
-/*
- * Public interfaces for RTEMS data structures monitor is aware of.
- * These are only used by the monitor.
- *
- * NOTE:
- * All the canonical objects that correspond to RTEMS managed "objects"
- * must have an identical first portion with 'id' and 'name' fields.
- *
- * Others do not have that restriction, even tho we would like them to.
- * This is because some of the canonical structures are almost too big
- * for shared memory driver (eg: mpci) and we are nickel and diming it.
- */
-
-/*
- * Type of a pointer that may be a symbol
- */
-
-#define MONITOR_SYMBOL_LEN 20
-typedef struct {
- char name[MONITOR_SYMBOL_LEN];
- unsigned32 value;
- unsigned32 offset;
-} rtems_monitor_symbol_t;
-
-typedef struct {
- rtems_id id;
- rtems_name name;
- /* end of common portion */
-} rtems_monitor_generic_t;
-
-/*
- * Task
- */
-typedef struct {
- rtems_id id;
- rtems_name name;
- /* end of common portion */
- Thread_Entry entry;
- unsigned32 argument;
- void *stack;
- unsigned32 stack_size;
- rtems_task_priority priority;
- States_Control state;
- rtems_event_set events;
- rtems_mode modes;
- rtems_attribute attributes;
- unsigned32 notepad[RTEMS_NUMBER_NOTEPADS];
- rtems_id wait_id;
- unsigned32 wait_args;
-} rtems_monitor_task_t;
-
-/*
- * Init task
- */
-
-typedef struct {
- rtems_id id; /* not really an id */
- rtems_name name;
- /* end of common portion */
- rtems_monitor_symbol_t entry;
- unsigned32 argument;
- unsigned32 stack_size;
- rtems_task_priority priority;
- rtems_mode modes;
- rtems_attribute attributes;
-} rtems_monitor_init_task_t;
-
-
-/*
- * Message queue
- */
-typedef struct {
- rtems_id id;
- rtems_name name;
- /* end of common portion */
- rtems_attribute attributes;
- unsigned32 number_of_pending_messages;
- unsigned32 maximum_pending_messages;
- unsigned32 maximum_message_size;
-} rtems_monitor_queue_t;
-
-/*
- * Extension
- */
-typedef struct {
- rtems_id id;
- rtems_name name;
- /* end of common portion */
- rtems_monitor_symbol_t e_create;
- rtems_monitor_symbol_t e_start;
- rtems_monitor_symbol_t e_restart;
- rtems_monitor_symbol_t e_delete;
- rtems_monitor_symbol_t e_tswitch;
- rtems_monitor_symbol_t e_begin;
- rtems_monitor_symbol_t e_exitted;
- rtems_monitor_symbol_t e_fatal;
-} rtems_monitor_extension_t;
-
-/*
- * Device driver
- */
-
-typedef struct {
- rtems_id id; /* not really an id (should be tho) */
- rtems_name name; /* ditto */
- /* end of common portion */
- rtems_monitor_symbol_t initialization; /* initialization procedure */
- rtems_monitor_symbol_t open; /* open request procedure */
- rtems_monitor_symbol_t close; /* close request procedure */
- rtems_monitor_symbol_t read; /* read request procedure */
- rtems_monitor_symbol_t write; /* write request procedure */
- rtems_monitor_symbol_t control; /* special functions procedure */
-} rtems_monitor_driver_t;
-
-typedef struct {
- rtems_id id; /* not used for drivers (yet) */
- rtems_name name; /* not used for drivers (yet) */
- /* end of common portion */
- unsigned32 major;
- unsigned32 minor;
- char name_string[64];
-} rtems_monitor_dname_t;
-
-/*
- * System config
- */
-
-typedef struct {
- void *work_space_start;
- unsigned32 work_space_size;
- unsigned32 maximum_tasks;
- unsigned32 maximum_timers;
- unsigned32 maximum_semaphores;
- unsigned32 maximum_message_queues;
- unsigned32 maximum_partitions;
- unsigned32 maximum_regions;
- unsigned32 maximum_ports;
- unsigned32 maximum_periods;
- unsigned32 maximum_extensions;
- unsigned32 microseconds_per_tick;
- unsigned32 ticks_per_timeslice;
- unsigned32 number_of_initialization_tasks;
-} rtems_monitor_config_t;
-
-/*
- * MPCI config
- */
-
-typedef struct {
- unsigned32 node; /* local node number */
- unsigned32 maximum_nodes; /* maximum # nodes in system */
- unsigned32 maximum_global_objects; /* maximum # global objects */
- unsigned32 maximum_proxies; /* maximum # proxies */
-
- unsigned32 default_timeout; /* in ticks */
- unsigned32 maximum_packet_size;
- rtems_monitor_symbol_t initialization;
- rtems_monitor_symbol_t get_packet;
- rtems_monitor_symbol_t return_packet;
- rtems_monitor_symbol_t send_packet;
- rtems_monitor_symbol_t receive_packet;
-} rtems_monitor_mpci_t;
-
-/*
- * The generic canonical information union
- */
-
-typedef union {
- rtems_monitor_generic_t generic;
- rtems_monitor_task_t task;
- rtems_monitor_queue_t queue;
- rtems_monitor_extension_t extension;
- rtems_monitor_driver_t driver;
- rtems_monitor_dname_t dname;
- rtems_monitor_config_t config;
- rtems_monitor_mpci_t mpci;
- rtems_monitor_init_task_t itask;
-} rtems_monitor_union_t;
-
-/*
- * Support for talking to other monitors
- */
-
-/*
- * Names of other monitors
- */
-
-#define RTEMS_MONITOR_NAME (rtems_build_name('R', 'M', 'O', 'N'))
-#define RTEMS_MONITOR_SERVER_NAME (rtems_build_name('R', 'M', 'S', 'V'))
-#define RTEMS_MONITOR_QUEUE_NAME (rtems_build_name('R', 'M', 'S', 'Q'))
-#define RTEMS_MONITOR_RESPONSE_QUEUE_NAME (rtems_build_name('R', 'M', 'R', 'Q'))
-
-#define RTEMS_MONITOR_SERVER_RESPONSE 0x0001
-#define RTEMS_MONITOR_SERVER_CANONICAL 0x0002
-
-typedef struct
-{
- unsigned32 command;
- rtems_id return_id;
- unsigned32 argument0;
- unsigned32 argument1;
- unsigned32 argument2;
- unsigned32 argument3;
- unsigned32 argument4;
- unsigned32 argument5;
-} rtems_monitor_server_request_t;
-
-typedef struct
-{
- unsigned32 command;
- unsigned32 result0;
- unsigned32 result1;
- rtems_monitor_union_t payload;
-} rtems_monitor_server_response_t;
-
-extern rtems_id rtems_monitor_task_id;
-
-extern unsigned32 rtems_monitor_node; /* our node number */
-extern unsigned32 rtems_monitor_default_node; /* current default for commands */
-
-/*
- * Monitor command function and table entry
- */
-
-typedef struct rtems_monitor_command_entry_s rtems_monitor_command_entry_t;
-
-typedef void ( *rtems_monitor_command_function_t )(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
- );
-
-struct rtems_monitor_command_entry_s {
- char *command; /* command name */
- char *usage; /* usage string for the command */
- unsigned32 arguments_required; /* # of required args */
- rtems_monitor_command_function_t command_function;
-
- /* Some argument for the command */
- unsigned32 command_arg;
-};
-
-typedef void *(*rtems_monitor_object_next_fn)(void *, void *, rtems_id *);
-typedef void (*rtems_monitor_object_canonical_fn)(void *, void *);
-typedef void (*rtems_monitor_object_dump_header_fn)(boolean);
-typedef void (*rtems_monitor_object_dump_fn)(void *, boolean);
-
-typedef struct {
- rtems_monitor_object_type_t type;
- void *object_information;
- int size; /* of canonical object */
- rtems_monitor_object_next_fn next;
- rtems_monitor_object_canonical_fn canonical;
- rtems_monitor_object_dump_header_fn dump_header;
- rtems_monitor_object_dump_fn dump;
-} rtems_monitor_object_info_t;
-
-
-/* monitor.c */
-void rtems_monitor_kill(void);
-void rtems_monitor_init(unsigned32);
-void rtems_monitor_wakeup(void);
-void rtems_monitor_pause_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_fatal_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_continue_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_debugger_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_node_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_symbols_loadup(void);
-void rtems_monitor_task(rtems_task_argument);
-
-/* server.c */
-void rtems_monitor_server_kill(void);
-rtems_status_code rtems_monitor_server_request(unsigned32, rtems_monitor_server_request_t *, rtems_monitor_server_response_t *);
-void rtems_monitor_server_task(rtems_task_argument);
-void rtems_monitor_server_init(unsigned32);
-
-/* command.c */
-int rtems_monitor_make_argv(char *, int *, char **);
-int rtems_monitor_command_read(char *, int *, char **);
-rtems_monitor_command_entry_t *rtems_monitor_command_lookup(
- rtems_monitor_command_entry_t * table, int argc, char **argv);
-void rtems_monitor_command_usage(rtems_monitor_command_entry_t *, char *);
-void rtems_monitor_help_cmd(int, char **, unsigned32, boolean);
-
-/* prmisc.c */
-void rtems_monitor_separator(void);
-unsigned32 rtems_monitor_pad(unsigned32 dest_col, unsigned32 curr_col);
-unsigned32 rtems_monitor_dump_char(unsigned8 ch);
-unsigned32 rtems_monitor_dump_decimal(unsigned32 num);
-unsigned32 rtems_monitor_dump_hex(unsigned32 num);
-unsigned32 rtems_monitor_dump_id(rtems_id id);
-unsigned32 rtems_monitor_dump_name(rtems_name name);
-unsigned32 rtems_monitor_dump_priority(rtems_task_priority priority);
-unsigned32 rtems_monitor_dump_state(States_Control state);
-unsigned32 rtems_monitor_dump_modes(rtems_mode modes);
-unsigned32 rtems_monitor_dump_attributes(rtems_attribute attributes);
-unsigned32 rtems_monitor_dump_events(rtems_event_set events);
-unsigned32 rtems_monitor_dump_notepad(unsigned32 *notepad);
-
-/* object.c */
-rtems_id rtems_monitor_id_fixup(rtems_id, unsigned32, rtems_monitor_object_type_t);
-rtems_id rtems_monitor_object_canonical_get(rtems_monitor_object_type_t, rtems_id, void *, unsigned32 *size_p);
-rtems_id rtems_monitor_object_canonical_next(rtems_monitor_object_info_t *, rtems_id, void *);
-void *rtems_monitor_object_next(void *, void *, rtems_id, rtems_id *);
-rtems_id rtems_monitor_object_canonical(rtems_id, void *);
-void rtems_monitor_object_cmd(int, char **, unsigned32, boolean);
-
-/* manager.c */
-void *rtems_monitor_manager_next(void *, void *, rtems_id *);
-
-/* config.c */
-void rtems_monitor_config_canonical(rtems_monitor_config_t *, void *);
-void *rtems_monitor_config_next(void *, rtems_monitor_config_t *, rtems_id *);
-void rtems_monitor_config_dump_header(boolean);
-void rtems_monitor_config_dump(rtems_monitor_config_t *, boolean verbose);
-
-/* mpci.c */
-void rtems_monitor_mpci_canonical(rtems_monitor_mpci_t *, void *);
-void *rtems_monitor_mpci_next(void *, rtems_monitor_mpci_t *, rtems_id *);
-void rtems_monitor_mpci_dump_header(boolean);
-void rtems_monitor_mpci_dump(rtems_monitor_mpci_t *, boolean verbose);
-
-/* itask.c */
-void rtems_monitor_init_task_canonical(rtems_monitor_init_task_t *, void *);
-void *rtems_monitor_init_task_next(void *, rtems_monitor_init_task_t *, rtems_id *);
-void rtems_monitor_init_task_dump_header(boolean);
-void rtems_monitor_init_task_dump(rtems_monitor_init_task_t *, boolean verbose);
-
-/* extension.c */
-void rtems_monitor_extension_canonical(rtems_monitor_extension_t *, void *);
-void rtems_monitor_extension_dump_header(boolean verbose);
-void rtems_monitor_extension_dump(rtems_monitor_extension_t *, boolean);
-
-/* task.c */
-void rtems_monitor_task_canonical(rtems_monitor_task_t *, void *);
-void rtems_monitor_task_dump_header(boolean verbose);
-void rtems_monitor_task_dump(rtems_monitor_task_t *, boolean);
-
-/* queue.c */
-void rtems_monitor_queue_canonical(rtems_monitor_queue_t *, void *);
-void rtems_monitor_queue_dump_header(boolean verbose);
-void rtems_monitor_queue_dump(rtems_monitor_queue_t *, boolean);
-
-/* driver.c */
-void *rtems_monitor_driver_next(void *, rtems_monitor_driver_t *, rtems_id *);
-void rtems_monitor_driver_canonical(rtems_monitor_driver_t *, void *);
-void rtems_monitor_driver_dump_header(boolean);
-void rtems_monitor_driver_dump(rtems_monitor_driver_t *, boolean);
-
-/* dname.c */
-void *rtems_monitor_dname_next(void *, rtems_monitor_dname_t *, rtems_id *);
-void rtems_monitor_dname_canonical(rtems_monitor_dname_t *, void *);
-void rtems_monitor_dname_dump_header(boolean);
-void rtems_monitor_dname_dump(rtems_monitor_dname_t *, boolean);
-
-/* symbols.c */
-rtems_symbol_table_t *rtems_symbol_table_create();
-void rtems_symbol_table_destroy(rtems_symbol_table_t *table);
-
-rtems_symbol_t *rtems_symbol_create(rtems_symbol_table_t *, char *, unsigned32);
-rtems_symbol_t *rtems_symbol_value_lookup(rtems_symbol_table_t *, unsigned32);
-const rtems_symbol_t *rtems_symbol_value_lookup_exact(rtems_symbol_table_t *, unsigned32);
-rtems_symbol_t *rtems_symbol_name_lookup(rtems_symbol_table_t *, char *);
-void *rtems_monitor_symbol_next(void *object_info, rtems_monitor_symbol_t *, rtems_id *);
-void rtems_monitor_symbol_canonical(rtems_monitor_symbol_t *, rtems_symbol_t *);
-void rtems_monitor_symbol_canonical_by_name(rtems_monitor_symbol_t *, char *);
-void rtems_monitor_symbol_canonical_by_value(rtems_monitor_symbol_t *, void *);
-unsigned32 rtems_monitor_symbol_dump(rtems_monitor_symbol_t *, boolean);
-void rtems_monitor_symbol_cmd(int, char **, unsigned32, boolean);
-
-
-extern rtems_symbol_table_t *rtems_monitor_symbols;
-
-#ifndef MONITOR_PROMPT
-#define MONITOR_PROMPT "rtems" /* will have '> ' appended */
-#endif
-
-#define MONITOR_WAKEUP_EVENT RTEMS_EVENT_0
-
-
-#define STREQ(a,b) (strcmp(a,b) == 0)
-#define STRNEQ(a,b,n) (strncmp(a,b,n) == 0)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! __MONITOR_H */
diff --git a/c/src/lib/libmisc/monitor/symbols.h b/c/src/lib/libmisc/monitor/symbols.h
deleted file mode 100644
index 119c879d54..0000000000
--- a/c/src/lib/libmisc/monitor/symbols.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * RTEMS monitor symbol table functions
- *
- * Description:
- * Entry points for symbol table routines.
- *
- *
- *
- * TODO:
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_SYMBOLS_H
-#define _INCLUDE_SYMBOLS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct {
- rtems_unsigned32 value;
- char *name;
-} rtems_symbol_t;
-
-#define SYMBOL_STRING_BLOCK_SIZE 4080
-typedef struct rtems_symbol_string_block_s {
- struct rtems_symbol_string_block_s *next;
- char buffer[SYMBOL_STRING_BLOCK_SIZE];
-} rtems_symbol_string_block_t;
-
-typedef struct {
-
- rtems_unsigned32 sorted; /* are symbols sorted right now? */
- rtems_unsigned32 growth_factor; /* % to grow by when needed */
- rtems_unsigned32 next; /* next symbol slot to use when adding */
- rtems_unsigned32 size; /* max # of symbols */
-
- /*
- * Symbol list -- sorted by address (when we do a lookup)
- */
-
- rtems_symbol_t *addresses; /* symbol array by address */
-
- /*
- * String pool, unsorted, a list of blocks of string data
- */
-
- rtems_symbol_string_block_t *string_buffer_head;
- rtems_symbol_string_block_t *string_buffer_current;
- rtems_unsigned32 strings_next; /* next byte to use in this block */
-
-} rtems_symbol_table_t;
-
-#define rtems_symbol_name(sp) ((sp)->name)
-#define rtems_symbol_value(sp) ((sp)->value)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! _INCLUDE_SYMBOLS_H */
diff --git a/c/src/lib/libmisc/rtmonuse/Makefile.in b/c/src/lib/libmisc/rtmonuse/Makefile.in
deleted file mode 100644
index a344c894b6..0000000000
--- a/c/src/lib/libmisc/rtmonuse/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIB=${ARCH}/librtmonuse-tmp.a
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=rtmonuse
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-INSTALLED_H_FILES=$(srcdir)/rtmonuse.h
-
-SRCS=$(C_FILES) $(H_FILES) $(INSTALLED_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${LIB}: ${SRCS} ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL) -m 444 ${INSTALLED_H_FILES} $(PROJECT_INCLUDE)
-# $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/lib/libmisc/rtmonuse/rtmonuse.c b/c/src/lib/libmisc/rtmonuse/rtmonuse.c
deleted file mode 100644
index 843d29468e..0000000000
--- a/c/src/lib/libmisc/rtmonuse/rtmonuse.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <assert.h>
-
-#include "rtmonuse.h"
-
-typedef struct {
- rtems_id id;
- unsigned32 count;
- unsigned32 missed_count;
- unsigned32 min_cpu_time;
- unsigned32 max_cpu_time;
- unsigned32 total_cpu_time;
- unsigned32 min_wall_time;
- unsigned32 max_wall_time;
- unsigned32 total_wall_time;
-} Period_usage_t;
-
-Period_usage_t *Period_usage_Information;
-
-/*PAGE
- *
- * Period_usage_Initialize
- */
-
-void Period_usage_Initialize( void )
-{
- int maximum;
-
- maximum = _Configuration_Table->RTEMS_api_configuration->maximum_periods;
-
- Period_usage_Information = malloc( sizeof(Period_usage_t) * (maximum+1) );
-
- Period_usage_Reset();
-}
-
-/*PAGE
- *
- * Period_usage_Reset
- */
-
-void Period_usage_Reset( void )
-{
- unsigned32 i;
- Period_usage_t *the_usage;
-
- for ( i=0 ;
- i<_Configuration_Table->RTEMS_api_configuration->maximum_periods ;
- i++ ) {
- the_usage = &Period_usage_Information[ i ];
-
- the_usage->count = 0;
- the_usage->missed_count = 0;
- the_usage->min_cpu_time = 0xFFFFFFFF;
- the_usage->max_cpu_time = 0;
- the_usage->total_cpu_time = 0;
- the_usage->min_wall_time = 0xFFFFFFFF;
- the_usage->max_wall_time = 0;
- the_usage->total_wall_time = 0;
-
- }
-}
-
-/*PAGE
- *
- * Period_usage_Update
- */
-
-void Period_usage_Update(
- rtems_id id
-)
-{
- rtems_rate_monotonic_period_status rm_status;
- rtems_status_code status;
- Period_usage_t *the_usage;
-
- assert( Period_usage_Information );
-
- status = rtems_rate_monotonic_get_status( id, &rm_status );
- assert( status == RTEMS_SUCCESSFUL );
-
- the_usage = &Period_usage_Information[ rtems_get_index( id ) ];
-
- the_usage->id = id;
- the_usage->count++;
- if ( rm_status.state == RATE_MONOTONIC_EXPIRED )
- the_usage->missed_count++;
- the_usage->total_cpu_time += rm_status.ticks_executed_since_last_period;
- the_usage->total_wall_time += rm_status.ticks_since_last_period;
-
- /*
- * Update CPU time
- */
-
- if ( rm_status.ticks_executed_since_last_period < the_usage->min_cpu_time )
- the_usage->min_cpu_time = rm_status.ticks_executed_since_last_period;
-
- if ( rm_status.ticks_executed_since_last_period > the_usage->max_cpu_time )
- the_usage->max_cpu_time = rm_status.ticks_executed_since_last_period;
-
- /*
- * Update Wall time
- */
-
- if ( rm_status.ticks_since_last_period < the_usage->min_wall_time )
- the_usage->min_wall_time = rm_status.ticks_since_last_period;
-
- if ( rm_status.ticks_since_last_period > the_usage->max_wall_time )
- the_usage->max_wall_time = rm_status.ticks_since_last_period;
-
-}
-
-/*PAGE
- *
- * Period_usage_Dump
- */
-
-void Period_usage_Dump( void )
-{
- unsigned32 i;
- Period_usage_t *the_usage;
- Rate_monotonic_Control *the_period;
- unsigned32 u32_name;
- char name[5];
-
- if ( !Period_usage_Information ) {
- printf( "Period statistics library is not initialized\n" );
- return;
- }
-
- printf( "Period information by period\n" );
- printf( " ID OWNER PERIODS MISSED CPU TIME WALL TIME\n" );
-
- /*
- * RTEMS does not use an index of zero for object ids.
- */
-
- for ( i=1 ;
- i<_Configuration_Table->RTEMS_api_configuration->maximum_periods ;
- i++ ) {
- the_usage = &Period_usage_Information[ i ];
- if ( the_usage->count == 0 )
- continue;
-
- the_period =
- (Rate_monotonic_Control *)_Rate_monotonic_Information.local_table[ i ];
-
- if ( the_period->owner )
- u32_name = *(unsigned32 *)the_period->owner->Object.name;
- else
- u32_name = rtems_build_name(' ', ' ', ' ', ' ');
-
- name[ 0 ] = (u32_name >> 24) & 0xff;
- name[ 1 ] = (u32_name >> 16) & 0xff;
- name[ 2 ] = (u32_name >> 8) & 0xff;
- name[ 3 ] = (u32_name >> 0) & 0xff;
- name[ 4 ] = '\0';
-
- printf(
- "0x%08x %4s %6d %3d %d/%d/%5.2f %d/%d/%3.2f\n",
- the_usage->id,
- name,
- the_usage->count,
- the_usage->missed_count,
- the_usage->min_cpu_time,
- the_usage->max_cpu_time,
- (double) the_usage->total_cpu_time / (double) the_usage->count,
- the_usage->min_wall_time,
- the_usage->max_wall_time,
- (double) the_usage->total_wall_time / (double) the_usage->count
- );
- }
-}
diff --git a/c/src/lib/libmisc/rtmonuse/rtmonuse.h b/c/src/lib/libmisc/rtmonuse/rtmonuse.h
deleted file mode 100644
index f0580a4f0b..0000000000
--- a/c/src/lib/libmisc/rtmonuse/rtmonuse.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef __RATE_MONOTONIC_USAGE_h
-#define __RATE_MONOTONIC_USAGE_h
-
-void Period_usage_Initialize( void );
-
-void Period_usage_Reset( void );
-
-void Period_usage_Update(
- rtems_id id
-);
-
-void Period_usage_Dump( void );
-
-#endif
diff --git a/c/src/lib/libmisc/stackchk/Makefile.in b/c/src/lib/libmisc/stackchk/Makefile.in
deleted file mode 100644
index 2708e825bc..0000000000
--- a/c/src/lib/libmisc/stackchk/Makefile.in
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIB=${ARCH}/libstackchk-tmp.a
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=check
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=internal.h
-INSTALLED_H_FILES=$(srcdir)/stackchk.h
-
-SRCS=$(C_FILES) $(H_FILES) $(INSTALLED_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${LIB}: ${SRCS} ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL) -m 444 ${INSTALLED_H_FILES} $(PROJECT_INCLUDE)
diff --git a/c/src/lib/libmisc/stackchk/README b/c/src/lib/libmisc/stackchk/README
deleted file mode 100644
index 0f6e2f2b10..0000000000
--- a/c/src/lib/libmisc/stackchk/README
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# $Id$
-#
-
-Introduction
-============
-
-This directory contains a stack bounds checker. It provides two
-primary features:
-
- + check for stack overflow at each context switch
- + provides an educated guess at each task's stack usage
-
-Enabling
-========
-
-Add the stack checker extension to the initial user extension set.
-If using confdefs.h to build your configuration table, this is
-as simple as adding -DSTACK_CHECK_ON to the gcc command line which
-compiles the file defining the configuration table. In the RTEMS
-test suites and samples, this is always init.c
-
-Background
-==========
-
-The stack overflow check at context switch works by looking for
-a 16 byte pattern at the logical end of the stack to be corrupted.
-The "guesser" assumes that the entire stack was prefilled with a known
-pattern and assumes that the pattern is still in place if the memory
-has not been used as a stack.
-
-Both of these can be fooled by pushing large holes onto the stack
-and not writing to them... or (much more unlikely) writing the
-magic patterns into memory.
-
-This code has not been extensively tested. It is provided as a tool
-for RTEMS users to catch the most common mistake in multitasking
-systems ... too little stack space. Suggestions and comments are appreciated.
-
-NOTES:
-
-1. Stack usage information is questionable on CPUs which push
- large holes on stack.
-
-2. The stack checker has a tendency to generate a fault when
- trying to print the helpful diagnostic message. If it comes
- out, congratulations. If not, then the variable Stack_check_Blown_task
- contains a pointer to the TCB of the offending task. This
- is usually enough to go on.
-
-FUTURE:
-
-1. Determine how/if gcc will generate stack probe calls and support that.
-
-2. Get accurate stack usage numbers on i960.. it pushes very large
- holes on the stack.
diff --git a/c/src/lib/libmisc/stackchk/check.c b/c/src/lib/libmisc/stackchk/check.c
deleted file mode 100644
index 5bfb69bfb6..0000000000
--- a/c/src/lib/libmisc/stackchk/check.c
+++ /dev/null
@@ -1,535 +0,0 @@
-/*
- * Stack Overflow Check User Extension Set
- *
- * NOTE: This extension set automatically determines at
- * initialization time whether the stack for this
- * CPU grows up or down and installs the correct
- * extension routines for that direction.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-/*
- * HACK
- * the stack dump information should be printed by a "fatal" extension.
- * Fatal extensions only get called via rtems_fatal_error_occurred()
- * and not when rtems_shutdown_executive() is called.
- * I hope/think this is changing so that fatal extensions are renamed
- * to "shutdown" extensions.
- * When that happens, this #define should be deleted and all the code
- * it marks.
- */
-#define DONT_USE_FATAL_EXTENSION
-
-
-extern rtems_configuration_table BSP_Configuration;
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "stackchk.h"
-#include "internal.h"
-
-/*
- * This variable contains the name of the task which "blew" the stack.
- * It is NULL if the system is all right.
- */
-
-Thread_Control *Stack_check_Blown_task;
-
-/*
- * The extension table for the stack checker.
- */
-
-rtems_extensions_table Stack_check_Extension_table = {
- Stack_check_Create_extension, /* rtems_task_create */
- 0, /* rtems_task_start */
- 0, /* rtems_task_restart */
- 0, /* rtems_task_delete */
- Stack_check_Switch_extension, /* task_switch */
- Stack_check_Begin_extension, /* task_begin */
- 0, /* task_exitted */
-#ifdef DONT_USE_FATAL_EXTENSION
- 0, /* fatal */
-#else
- Stack_check_Fatal_extension, /* fatal */
-#endif
-};
-
-/*
- * The "magic pattern" used to mark the end of the stack.
- */
-
-Stack_check_Control Stack_check_Pattern;
-
-/*
- * Where the pattern goes in the stack area is dependent upon
- * whether the stack grow to the high or low area of the memory.
- *
- */
-
-#if ( CPU_STACK_GROWS_UP == TRUE )
-
-#define Stack_check_Get_pattern_area( _the_stack ) \
- ((Stack_check_Control *) ((char *)(_the_stack)->area + \
- (_the_stack)->size - sizeof( Stack_check_Control ) ))
-
-#define Stack_check_Calculate_used( _low, _size, _high_water ) \
- ((char *)(_high_water) - (char *)(_low))
-
-#define Stack_check_usable_stack_start(_the_stack) \
- ((_the_stack)->area)
-
-#else
-
-#define Stack_check_Get_pattern_area( _the_stack ) \
- ((Stack_check_Control *) ((char *)(_the_stack)->area + HEAP_OVERHEAD))
-
-#define Stack_check_Calculate_used( _low, _size, _high_water) \
- ( ((char *)(_low) + (_size)) - (char *)(_high_water) )
-
-#define Stack_check_usable_stack_start(_the_stack) \
- ((char *)(_the_stack)->area + sizeof(Stack_check_Control))
-
-#endif
-
-#define Stack_check_usable_stack_size(_the_stack) \
- ((_the_stack)->size - sizeof(Stack_check_Control))
-
-
-/*
- * Do we have an interrupt stack?
- * XXX it would sure be nice if the interrupt stack were also
- * stored in a "stack" structure!
- */
-
-
-Stack_Control stack_check_interrupt_stack;
-
-/*
- * Prototypes necessary for forward references
- */
-
-void Stack_check_Dump_usage( void );
-
-/*
- * Fill an entire stack area with BYTE_PATTERN.
- * This will be used by a Fatal extension to check for
- * amount of actual stack used
- */
-
-void
-stack_check_dope_stack(Stack_Control *stack)
-{
- memset(stack->area, BYTE_PATTERN, stack->size);
-}
-
-
-/*PAGE
- *
- * Stack_check_Initialize
- */
-
-unsigned32 stack_check_initialized = 0;
-
-void Stack_check_Initialize( void )
-{
-#if 0
- rtems_status_code status;
- Objects_Id id_ignored;
-#endif
- unsigned32 *p;
-#if 0
- unsigned32 i;
- unsigned32 class_index;
- Thread_Control *the_thread;
- Objects_Information *information;
-#endif
-
- if (stack_check_initialized)
- return;
-
- /*
- * Dope the pattern and fill areas
- */
-
- for ( p = Stack_check_Pattern.pattern;
- p < &Stack_check_Pattern.pattern[PATTERN_SIZE_WORDS];
- p += 4
- )
- {
- p[0] = 0xFEEDF00D; /* FEED FOOD to BAD DOG */
- p[1] = 0x0BAD0D06;
- p[2] = 0xDEADF00D; /* DEAD FOOD GOOD DOG */
- p[3] = 0x600D0D06;
- };
-
-#if 0
- status = rtems_extension_create(
- rtems_build_name( 'S', 'T', 'C', 'K' ),
- &Stack_check_Extension_table,
- &id_ignored
- );
- assert ( status == RTEMS_SUCCESSFUL );
-#endif
-
- Stack_check_Blown_task = 0;
-
- /*
- * If installed by a task, that task will not get setup properly
- * since it missed out on the create hook. This will cause a
- * failure on first switch out of that task.
- * So pretend here that we actually ran create and begin extensions.
- */
-
- /* XXX
- *
- * Technically this has not been done for any task created before this
- * happened. So just run through them and fix the situation.
- */
-#if 0
- if (_Thread_Executing)
- {
- Stack_check_Create_extension(_Thread_Executing, _Thread_Executing);
- }
-#endif
-
-#if 0
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
- Stack_check_Create_extension( the_thread, the_thread );
- }
- }
- }
-#endif
-
- /*
- * If appropriate, setup the interrupt stack for high water testing
- * also.
- */
- if (_CPU_Interrupt_stack_low && _CPU_Interrupt_stack_high)
- {
- stack_check_interrupt_stack.area = _CPU_Interrupt_stack_low;
- stack_check_interrupt_stack.size = (char *) _CPU_Interrupt_stack_high -
- (char *) _CPU_Interrupt_stack_low;
-
- stack_check_dope_stack(&stack_check_interrupt_stack);
- }
-
-#ifdef DONT_USE_FATAL_EXTENSION
-#ifdef RTEMS_DEBUG
- /*
- * this would normally be called by a fatal extension
- * handler, but we don't run fatal extensions unless
- * we fatal error.
- */
- atexit(Stack_check_Dump_usage);
-#endif
-#endif
-
- stack_check_initialized = 1;
-}
-
-/*PAGE
- *
- * Stack_check_Create_extension
- */
-
-boolean Stack_check_Create_extension(
- Thread_Control *running,
- Thread_Control *the_thread
-)
-{
- if (!stack_check_initialized)
- Stack_check_Initialize();
-
- if (the_thread /* XXX && (the_thread != _Thread_Executing) */ )
- stack_check_dope_stack(&the_thread->Start.Initial_stack);
-
- return TRUE;
-}
-
-/*PAGE
- *
- * Stack_check_Begin_extension
- */
-
-void Stack_check_Begin_extension(
- Thread_Control *the_thread
-)
-{
- Stack_check_Control *the_pattern;
-
- if (!stack_check_initialized)
- Stack_check_Initialize();
-
- if ( the_thread->Object.id == 0 ) /* skip system tasks */
- return;
-
- the_pattern = Stack_check_Get_pattern_area(&the_thread->Start.Initial_stack);
-
- *the_pattern = Stack_check_Pattern;
-}
-
-/*PAGE
- *
- * Stack_check_report_blown_task
- * Report a blown stack. Needs to be a separate routine
- * so that interrupt handlers can use this too.
- *
- * Caller must have set the Stack_check_Blown_task.
- *
- * NOTE: The system is in a questionable state... we may not get
- * the following message out.
- */
-
-void Stack_check_report_blown_task(void)
-{
- Stack_Control *stack;
- Thread_Control *running;
-
- running = Stack_check_Blown_task;
- stack = &running->Start.Initial_stack;
-
- fprintf(
- stderr,
- "BLOWN STACK!!! Offending task(%p): id=0x%08x; name=0x%08x",
- running,
- running->Object.id,
- *(unsigned32 *)running->Object.name
- );
- fflush(stderr);
-
- if (BSP_Configuration.User_multiprocessing_table)
- fprintf(
- stderr,
- "; node=%d\n",
- BSP_Configuration.User_multiprocessing_table->node
- );
- else
- fprintf(stderr, "\n");
- fflush(stderr);
-
- fprintf(
- stderr,
- " stack covers range 0x%08x - 0x%08x (%d bytes)\n",
- (unsigned32) stack->area,
- (unsigned32) stack->area + stack->size - 1,
- (unsigned32) stack->size);
- fflush(stderr);
-
- fprintf(
- stderr,
- " Damaged pattern begins at 0x%08x and is %d bytes long\n",
- (unsigned32) Stack_check_Get_pattern_area(stack), PATTERN_SIZE_BYTES);
- fflush(stderr);
-
- rtems_fatal_error_occurred( (unsigned32) "STACK BLOWN" );
-}
-
-/*PAGE
- *
- * Stack_check_Switch_extension
- */
-
-void Stack_check_Switch_extension(
- Thread_Control *running,
- Thread_Control *heir
-)
-{
- if ( running->Object.id == 0 ) /* skip system tasks */
- return;
-
- if (0 != memcmp( (void *) Stack_check_Get_pattern_area( &running->Start.Initial_stack)->pattern,
- (void *) Stack_check_Pattern.pattern,
- PATTERN_SIZE_BYTES))
- {
- Stack_check_Blown_task = running;
- Stack_check_report_blown_task();
- }
-}
-
-void *Stack_check_find_high_water_mark(
- const void *s,
- size_t n
-)
-{
- const unsigned32 *base, *ebase;
- unsigned32 length;
-
- base = s;
- length = n/4;
-
-#if ( CPU_STACK_GROWS_UP == TRUE )
- /*
- * start at higher memory and find first word that does not
- * match pattern
- */
-
- base += length - 1;
- for (ebase = s; base > ebase; base--)
- if (*base != U32_PATTERN)
- return (void *) base;
-#else
- /*
- * start at lower memory and find first word that does not
- * match pattern
- */
-
- base += PATTERN_SIZE_WORDS;
- for (ebase = base + length; base < ebase; base++)
- if (*base != U32_PATTERN)
- return (void *) base;
-#endif
-
- return (void *)0;
-}
-
-/*PAGE
- *
- * Stack_check_Dump_threads_usage
- * Try to print out how much stack was actually used by the task.
- *
- */
-
-void Stack_check_Dump_threads_usage(
- Thread_Control *the_thread
-)
-{
- unsigned32 size, used;
- void *low;
- void *high_water_mark;
- Stack_Control *stack;
- unsigned32 u32_name;
- char name[5];
-
-
- if ( !the_thread )
- return;
-
- /*
- * XXX HACK to get to interrupt stack
- */
-
- if (the_thread == (Thread_Control *) -1)
- {
- if (stack_check_interrupt_stack.area)
- {
- stack = &stack_check_interrupt_stack;
- the_thread = 0;
- }
- else
- return;
- }
- else
- stack = &the_thread->Start.Initial_stack;
-
- low = Stack_check_usable_stack_start(stack);
- size = Stack_check_usable_stack_size(stack);
-
- high_water_mark = Stack_check_find_high_water_mark(low, size);
-
- if ( high_water_mark )
- used = Stack_check_Calculate_used( low, size, high_water_mark );
- else
- used = 0;
-
- if ( the_thread )
- u32_name = *(unsigned32 *)the_thread->Object.name;
- else
- u32_name = rtems_build_name('I', 'N', 'T', 'R');
-
- name[ 0 ] = (u32_name >> 24) & 0xff;
- name[ 1 ] = (u32_name >> 16) & 0xff;
- name[ 2 ] = (u32_name >> 8) & 0xff;
- name[ 3 ] = (u32_name >> 0) & 0xff;
- name[ 4 ] = '\0';
-
- printf( "0x%08x %4s 0x%08x 0x%08x %8d %8d\n",
- the_thread ? the_thread->Object.id : ~0,
- name,
- (unsigned32) stack->area,
- (unsigned32) stack->area + (unsigned32) stack->size - 1,
- size,
- used
- );
-}
-
-/*PAGE
- *
- * Stack_check_Fatal_extension
- */
-
-void Stack_check_Fatal_extension(
- Internal_errors_Source source,
- boolean is_internal,
- unsigned32 status
-)
-{
-#ifndef DONT_USE_FATAL_EXTENSION
- if (status == 0)
- Stack_check_Dump_usage();
-#endif
-}
-
-
-/*PAGE
- *
- * Stack_check_Dump_usage
- */
-
-void Stack_check_Dump_usage( void )
-{
- unsigned32 i;
- unsigned32 class_index;
- Thread_Control *the_thread;
- unsigned32 hit_running = 0;
- Objects_Information *information;
-
- if (stack_check_initialized == 0)
- return;
-
- printf("Stack usage by thread\n");
- printf(
- " ID NAME LOW HIGH AVAILABLE USED\n"
- );
-
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
- Stack_check_Dump_threads_usage( the_thread );
- if ( the_thread == _Thread_Executing )
- hit_running = 1;
- }
- }
- }
-
- if ( !hit_running )
- Stack_check_Dump_threads_usage( _Thread_Executing );
-
- /* dump interrupt stack info if any */
- Stack_check_Dump_threads_usage((Thread_Control *) -1);
-}
-
diff --git a/c/src/lib/libmisc/stackchk/internal.h b/c/src/lib/libmisc/stackchk/internal.h
deleted file mode 100644
index 96d0c3f10a..0000000000
--- a/c/src/lib/libmisc/stackchk/internal.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* internal.h
- *
- * This include file contains internal information
- * for the RTEMS stack checker.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INTERNAL_STACK_CHECK_h
-#define __INTERNAL_STACK_CHECK_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This structure is used to fill in and compare the "end of stack"
- * marker pattern.
- * pattern area must be a multiple of 4 words.
- */
-
-#ifdef CPU_STACK_CHECK_SIZE
-#define PATTERN_SIZE_WORDS (((CPU_STACK_CHECK_SIZE / 4) + 3) & ~0x3)
-#else
-#define PATTERN_SIZE_WORDS 4
-#endif
-
-#define PATTERN_SIZE_BYTES (PATTERN_SIZE_WORDS * 4)
-
-typedef struct {
- unsigned32 pattern[ PATTERN_SIZE_WORDS ];
-} Stack_check_Control;
-
-/*
- * The pattern used to fill the entire stack.
- */
-
-#define BYTE_PATTERN 0xA5
-#define U32_PATTERN 0xA5A5A5A5
-
-/*
- * Stack_check_Create_extension
- */
-
-boolean Stack_check_Create_extension(
- Thread_Control *running,
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Begin_extension
- */
-
-void Stack_check_Begin_extension(
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Switch_extension
- */
-
-void Stack_check_Switch_extension(
- Thread_Control *running,
- Thread_Control *heir
-);
-
-/*
- * Stack_check_Fatal_extension
- */
-
-void Stack_check_Fatal_extension(
- Internal_errors_Source source,
- boolean is_internal,
- unsigned32 status
-);
-
-/*
- * Stack_check_Dump_usage
- */
-
-void Stack_check_Dump_usage( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libmisc/stackchk/stackchk.h b/c/src/lib/libmisc/stackchk/stackchk.h
deleted file mode 100644
index 1b40da5e0c..0000000000
--- a/c/src/lib/libmisc/stackchk/stackchk.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* stackchk.h
- *
- * This include file contains information necessary to utilize
- * and install the stack checker mechanism.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STACK_CHECK_h
-#define __STACK_CHECK_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Stack_check_Initialize
- */
-
-void Stack_check_Initialize( void );
-
-/*
- * Stack_check_Dump_usage
- */
-
-void Stack_check_Dump_usage( void );
-
-/*
- * Stack_check_Create_extension
- */
-
-boolean Stack_check_Create_extension(
- Thread_Control *running,
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Begin_extension
- */
-
-void Stack_check_Begin_extension(
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Switch_extension
- */
-
-void Stack_check_Switch_extension(
- Thread_Control *running,
- Thread_Control *heir
-);
-
-/*
- * Extension set definition
- */
-
-#define STACK_CHECKER_EXTENSION \
-{ \
- Stack_check_Create_extension, /* rtems_task_create */ \
- 0, /* rtems_task_start */ \
- 0, /* rtems_task_restart */ \
- 0, /* rtems_task_delete */ \
- Stack_check_Switch_extension, /* task_switch */ \
- Stack_check_Begin_extension, /* task_begin */ \
- 0, /* task_exitted */ \
- 0 /* Stack_check_Fatal_extension */, /* fatal */ \
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libmisc/wrapup/Makefile.in b/c/src/lib/libmisc/wrapup/Makefile.in
deleted file mode 100644
index 6a78cf222a..0000000000
--- a/c/src/lib/libmisc/wrapup/Makefile.in
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIB=$(ARCH)/libmisc.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-# Using the wildcard on the Purify support makes sure it may not be there
-
-LIBS=../monitor/$(ARCH)/libmonitor-tmp.a \
- ../error/$(ARCH)/liberror-tmp.a \
- ../assoc/$(ARCH)/libassoc-tmp.a \
- ../stackchk/$(ARCH)/libstackchk-tmp.a \
- ../cpuuse/$(ARCH)/libcpuuse-tmp.a \
- ../rtmonuse/$(ARCH)/librtmonuse-tmp.a \
- $(wildcard ../purify/$(ARCH)/libpurify-tmp.a)
-RELS=
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${LIBS} $(RELS)
- $(RM) -r $(ARCH)
- $(MKDIR) $(ARCH)
- cd $(ARCH); for lib in $(LIBS:%=../%); do \
- $(AR) -xv $$lib; \
- done
- $(RM) $@
- $(AR) ruv $@ $(ARCH)/*
- $(MKLIB) $@
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/libnetworking/CHANGELOG b/c/src/lib/libnetworking/CHANGELOG
deleted file mode 100644
index dd504eb885..0000000000
--- a/c/src/lib/libnetworking/CHANGELOG
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-19-AUG-1998 snapshot
- - Pulled BOOTP initialization out of rtems_glue. Applications which
- don't used BOOTP are now about 5k smaller.
- - Loopback interface is not installed by default, rather it is
- attached like any other interface. Saves about 0.5 kbytes.
- - Add rtems_bsdnet_show_if_stats();
- - Moved test programs from below freebsd directory.
-
-18-AUG-1998 snapshot
- - Removed some include files that were already part of RTEMS.
- - Cleaned up machine/types.h to prepare for inclusion in RTEMS source.
- - Added syslog library routines -- much simpler than KA9Q version.
- Sockets can be shared among tasks (as long as the send is
- protected by a mutex) so there's no need for a Syslog Daemon.
-
-16-AUG-1998 snapshot
- - Table-driven configuration (networkconfig.h).
- - Cleaned up rtems_bsdnet.h.
- - BOOTP now retries properly -- Note to Joel:
- The dichotomy between RTEMS and UNIX error codes is
- a real pain!
-
-14-AUG-1998 snapshot
- - Added dummy getprotobyname() and getprotobynum() functions.
- - Added socket ioctl.
- - Added application-level entry to manipulate routing tables.
- - Added non-BOOTP network initialization.
-
-13-AUG-1998 snapshot
- - Changed some BOOTP addresses from sockaddr_in to inaddr;
- - Get DNS information from BOOTP reply.
- - Got DNS lookups working.
- Bloatware comes to RTEMS -- invoking gethostbyname() drags in
- and extra 40 kbytes of code!
- - Added hostname lookup program.
-
-12-AUG-1998 snapshot
- - Added startup delay to network initialization.
- - More statistic-printing routines.
- - Added TFTP driver and test program
- - Modified TFTP test program to use networkconfig.h.
- - Removed unused include files.
- - Added from ftp://ftp.ca.FreeBSD.ORG/pub/FreeBSD/FreeBSD-current/src/lib/libc/net.
-
-11-AUG-1998 snapshot.
- - Added getpeername()
- - Added M68k versions of IP checksum code
- - Added TCP timing program to snapshot.
-
-02-AUG-1998 snapshot.
diff --git a/c/src/lib/libnetworking/Makefile.in b/c/src/lib/libnetworking/Makefile.in
deleted file mode 100644
index 7fce70b9aa..0000000000
--- a/c/src/lib/libnetworking/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=kern lib libc net netinet nfs rtems wrapup
diff --git a/c/src/lib/libnetworking/README b/c/src/lib/libnetworking/README
deleted file mode 100644
index d0c22ec688..0000000000
--- a/c/src/lib/libnetworking/README
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# $Id$
-#
-
-This is a snapshot of my attempt to fit the FreeBSD networking code into
-RTEMS. Things seem to be working!
-
-Things that need to be done:
- 1) More documentation!
- 2) Figure out what's still not working :-)
- 3) Rationalize the include files. Right now I have a special
- hack in the Makefile to ensure that I pick up the FreeBSD versions
- of the include files that are duplicated between RTEMS
- and FreeBSD.
- The network device driver source should move to the BSP source tree.
- 4) Have a look at all the FIXME comments.
- 5) Go through and make sure that all the source files are
- free of undesired copyright restrictions.
diff --git a/c/src/lib/libnetworking/arpa/ftp.h b/c/src/lib/libnetworking/arpa/ftp.h
deleted file mode 100644
index 584d290bc9..0000000000
--- a/c/src/lib/libnetworking/arpa/ftp.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 1983, 1989, 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.
- *
- * @(#)ftp.h 8.1 (Berkeley) 6/2/93
- *
- * $Id$
- */
-
-#ifndef _ARPA_FTP_H_
-#define _ARPA_FTP_H_
-
-/* Definitions for FTP; see RFC-765. */
-
-/*
- * 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 */
-
-/*
- * Type codes
- */
-#define TYPE_A 1 /* ASCII */
-#define TYPE_E 2 /* EBCDIC */
-#define TYPE_I 3 /* image */
-#define TYPE_L 4 /* local byte size */
-
-#ifdef FTP_NAMES
-char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
-#endif
-
-/*
- * Form codes
- */
-#define FORM_N 1 /* non-print */
-#define FORM_T 2 /* telnet format effectors */
-#define FORM_C 3 /* carriage control (ASA) */
-#ifdef FTP_NAMES
-char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
-#endif
-
-/*
- * Structure codes
- */
-#define STRU_F 1 /* file (no record structure) */
-#define STRU_R 2 /* record structure */
-#define STRU_P 3 /* page structure */
-#ifdef FTP_NAMES
-char *strunames[] = {"0", "File", "Record", "Page" };
-#endif
-
-/*
- * Mode types
- */
-#define MODE_S 1 /* stream */
-#define MODE_B 2 /* block */
-#define MODE_C 3 /* compressed */
-#ifdef FTP_NAMES
-char *modenames[] = {"0", "Stream", "Block", "Compressed" };
-#endif
-
-/*
- * Record Tokens
- */
-#define REC_ESC '\377' /* Record-mode Escape */
-#define REC_EOR '\001' /* Record-mode End-of-Record */
-#define REC_EOF '\002' /* Record-mode End-of-File */
-
-/*
- * Block Header
- */
-#define BLK_EOR 0x80 /* Block is End-of-Record */
-#define BLK_EOF 0x40 /* Block is End-of-File */
-#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
-#define BLK_RESTART 0x10 /* Block is Restart Marker */
-
-#define BLK_BYTECOUNT 2 /* Bytes in this block */
-
-#endif /* !_FTP_H_ */
diff --git a/c/src/lib/libnetworking/arpa/inet.h b/c/src/lib/libnetworking/arpa/inet.h
deleted file mode 100644
index ad5332e7ab..0000000000
--- a/c/src/lib/libnetworking/arpa/inet.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * @(#)inet.h 8.1 (Berkeley) 6/2/93
- * From: Id: inet.h,v 8.5 1997/01/29 08:48:09 vixie Exp $
- * $Id$
- */
-
-#ifndef _ARPA_INET_H_
-#define _ARPA_INET_H_
-
-/* External definitions for functions in inet(3), addr2ascii(3) */
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-struct in_addr;
-
-#if 0 /* RTEMS -- Why rename these? */
-/* XXX all new diversions!! argh!! */
-#define inet_addr __inet_addr
-#define inet_aton __inet_aton
-#define inet_lnaof __inet_lnaof
-#define inet_makeaddr __inet_makeaddr
-#define inet_neta __inet_neta
-#define inet_netof __inet_netof
-#define inet_network __inet_network
-#define inet_net_ntop __inet_net_ntop
-#define inet_net_pton __inet_net_pton
-#define inet_ntoa __inet_ntoa
-#define inet_pton __inet_pton
-#define inet_ntop __inet_ntop
-#define inet_nsap_addr __inet_nsap_addr
-#define inet_nsap_ntoa __inet_nsap_ntoa
-#endif
-
-__BEGIN_DECLS
-int ascii2addr __P((int, const char *, void *));
-char *addr2ascii __P((int, const void *, int, char *));
-unsigned long inet_addr __P((const char *));
-int inet_aton __P((const char *, struct in_addr *));
-unsigned long inet_lnaof __P((struct in_addr));
-struct in_addr inet_makeaddr __P((u_long , u_long));
-char * inet_neta __P((u_long, char *, size_t));
-unsigned long inet_netof __P((struct in_addr));
-unsigned long inet_network __P((const char *));
-char *inet_net_ntop __P((int, const void *, int, char *, size_t));
-int inet_net_pton __P((int, const char *, void *, size_t));
-char *inet_ntoa __P((struct in_addr));
-int inet_pton __P((int, const char *, void *));
-const char *inet_ntop __P((int, const void *, char *, size_t));
-u_int inet_nsap_addr __P((const char *, u_char *, int));
-char *inet_nsap_ntoa __P((int, const u_char *, char *));
-__END_DECLS
-
-#endif /* !_INET_H_ */
diff --git a/c/src/lib/libnetworking/arpa/nameser.h b/c/src/lib/libnetworking/arpa/nameser.h
deleted file mode 100644
index 634dece37b..0000000000
--- a/c/src/lib/libnetworking/arpa/nameser.h
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
- * Copyright (c) 1983, 1989, 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.
- */
-
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * From: Id: nameser.h,v 8.16 1998/02/06 00:35:58 halley Exp
- * $Id$
- */
-
-#ifndef _ARPA_NAMESER_H_
-#define _ARPA_NAMESER_H_
-
-#define BIND_4_COMPAT
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-/*
- * revision information. this is the release date in YYYYMMDD format.
- * it can change every day so the right thing to do with it is use it
- * in preprocessor commands such as "#if (__NAMESER > 19931104)". do not
- * compare for equality; rather, use it to determine whether your libnameser.a
- * is new enough to contain a certain feature.
- */
-
-/* XXXRTH I made this bigger than __BIND in 4.9.5 T6B */
-#define __NAMESER 19961001 /* New interface version stamp. */
-
-/*
- * Define constants based on RFC 883, RFC 1034, RFC 1035
- */
-#define NS_PACKETSZ 512 /* maximum packet size */
-#define NS_MAXDNAME 1025 /* maximum domain name */
-#define NS_MAXCDNAME 255 /* maximum compressed domain name */
-#define NS_MAXLABEL 63 /* maximum length of domain label */
-#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
-#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
-#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
-#define NS_INT32SZ 4 /* #/bytes of data in a u_int32_t */
-#define NS_INT16SZ 2 /* #/bytes of data in a u_int16_t */
-#define NS_INT8SZ 1 /* #/bytes of data in a u_int8_t */
-#define NS_INADDRSZ 4 /* IPv4 T_A */
-#define NS_IN6ADDRSZ 16 /* IPv6 T_AAAA */
-#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
-#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
-
-/*
- * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()
- * in synch with it.
- */
-typedef enum __ns_sect {
- ns_s_qd = 0, /* Query: Question. */
- ns_s_zn = 0, /* Update: Zone. */
- ns_s_an = 1, /* Query: Answer. */
- ns_s_pr = 1, /* Update: Prerequisites. */
- ns_s_ns = 2, /* Query: Name servers. */
- ns_s_ud = 2, /* Update: Update. */
- ns_s_ar = 3, /* Query|Update: Additional records. */
- ns_s_max = 4
-} ns_sect;
-
-/*
- * This is a message handle. It is caller allocated and has no dynamic data.
- * This structure is intended to be opaque to all but ns_parse.c, thus the
- * leading _'s on the member names. Use the accessor functions, not the _'s.
- */
-typedef struct __ns_msg {
- const u_char *_msg, *_eom;
- u_int16_t _id, _flags, _counts[ns_s_max];
- const u_char *_sections[ns_s_max];
- ns_sect _sect;
- int _rrnum;
- const u_char *_ptr;
-} ns_msg;
-
-/* Private data structure - do not use from outside library. */
-struct _ns_flagdata { int mask, shift; };
-extern struct _ns_flagdata _ns_flagdata[];
-
-/* Accessor macros - this is part of the public interface. */
-#define ns_msg_getflag(handle, flag) ( \
- ((handle)._flags & _ns_flagdata[flag].mask) \
- >> _ns_flagdata[flag].shift \
- )
-#define ns_msg_id(handle) ((handle)._id + 0)
-#define ns_msg_base(handle) ((handle)._msg + 0)
-#define ns_msg_end(handle) ((handle)._eom + 0)
-#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
-#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
-
-/*
- * This is a parsed record. It is caller allocated and has no dynamic data.
- */
-typedef struct __ns_rr {
- char name[NS_MAXDNAME]; /* XXX need to malloc */
- u_int16_t type;
- u_int16_t class;
- u_int32_t ttl;
- u_int16_t rdlength;
- const u_char *rdata;
-} ns_rr;
-
-/* Accessor macros - this is part of the public interface. */
-#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
-#define ns_rr_type(rr) ((rr).type + 0)
-#define ns_rr_class(rr) ((rr).class + 0)
-#define ns_rr_ttl(rr) ((rr).ttl + 0)
-#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
-#define ns_rr_rdata(rr) ((rr).rdata + 0)
-
-/*
- * These don't have to be in the same order as in the packet flags word,
- * and they can even overlap in some cases, but they will need to be kept
- * in synch with ns_parse.c:ns_flagdata[].
- */
-typedef enum __ns_flag {
- ns_f_qr, /* Question/Response. */
- ns_f_opcode, /* Operation code. */
- ns_f_aa, /* Authoritative Answer. */
- ns_f_tc, /* Truncation occurred. */
- ns_f_rd, /* Recursion Desired. */
- ns_f_ra, /* Recursion Available. */
- ns_f_z, /* MBZ. */
- ns_f_ad, /* Authentic Data (DNSSEC). */
- ns_f_cd, /* Checking Disabled (DNSSEC). */
- ns_f_rcode, /* Response code. */
- ns_f_max
-} ns_flag;
-
-/*
- * Currently defined opcodes.
- */
-typedef enum __ns_opcode {
- ns_o_query = 0, /* Standard query. */
- ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
- ns_o_status = 2, /* Name server status query (unsupported). */
- /* Opcode 3 is undefined/reserved. */
- ns_o_notify = 4, /* Zone change notification. */
- ns_o_update = 5, /* Zone update message. */
- ns_o_max = 6
-} ns_opcode;
-
-/*
- * Currently defined response codes.
- */
-typedef enum __ns_rcode {
- ns_r_noerror = 0, /* No error occurred. */
- ns_r_formerr = 1, /* Format error. */
- ns_r_servfail = 2, /* Server failure. */
- ns_r_nxdomain = 3, /* Name error. */
- ns_r_notimpl = 4, /* Unimplemented. */
- ns_r_refused = 5, /* Operation refused. */
- /* these are for BIND_UPDATE */
- ns_r_yxdomain = 6, /* Name exists */
- ns_r_yxrrset = 7, /* RRset exists */
- ns_r_nxrrset = 8, /* RRset does not exist */
- ns_r_notauth = 9, /* Not authoritative for zone */
- ns_r_notzone = 10, /* Zone of record different from zone section */
- ns_r_max = 11
-} ns_rcode;
-
-/* BIND_UPDATE */
-typedef enum __ns_update_operation {
- ns_uop_delete = 0,
- ns_uop_add = 1,
- ns_uop_max = 2
-} ns_update_operation;
-
-/*
- * This RR-like structure is particular to UPDATE.
- */
-struct ns_updrec {
- struct ns_updrec *r_prev; /* prev record */
- struct ns_updrec *r_next; /* next record */
- u_int8_t r_section; /* ZONE/PREREQUISITE/UPDATE */
- char * r_dname; /* owner of the RR */
- u_int16_t r_class; /* class number */
- u_int16_t r_type; /* type number */
- u_int32_t r_ttl; /* time to live */
- u_char * r_data; /* rdata fields as text string */
- u_int16_t r_size; /* size of r_data field */
- int r_opcode; /* type of operation */
- /* following fields for private use by the resolver/server routines */
- struct ns_updrec *r_grpnext; /* next record when grouped */
- struct databuf *r_dp; /* databuf to process */
- struct databuf *r_deldp; /* databuf's deleted/overwritten */
- u_int16_t r_zone; /* zone number on server */
-};
-typedef struct ns_updrec ns_updrec;
-
-/*
- * Currently defined type values for resources and queries.
- */
-typedef enum __ns_type {
- ns_t_a = 1, /* Host address. */
- ns_t_ns = 2, /* Authoritative server. */
- ns_t_md = 3, /* Mail destination. */
- ns_t_mf = 4, /* Mail forwarder. */
- ns_t_cname = 5, /* Canonical name. */
- ns_t_soa = 6, /* Start of authority zone. */
- ns_t_mb = 7, /* Mailbox domain name. */
- ns_t_mg = 8, /* Mail group member. */
- ns_t_mr = 9, /* Mail rename name. */
- ns_t_null = 10, /* Null resource record. */
- ns_t_wks = 11, /* Well known service. */
- ns_t_ptr = 12, /* Domain name pointer. */
- ns_t_hinfo = 13, /* Host information. */
- ns_t_minfo = 14, /* Mailbox information. */
- ns_t_mx = 15, /* Mail routing information. */
- ns_t_txt = 16, /* Text strings. */
- ns_t_rp = 17, /* Responsible person. */
- ns_t_afsdb = 18, /* AFS cell database. */
- ns_t_x25 = 19, /* X_25 calling address. */
- ns_t_isdn = 20, /* ISDN calling address. */
- ns_t_rt = 21, /* Router. */
- ns_t_nsap = 22, /* NSAP address. */
- ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
- ns_t_sig = 24, /* Security signature. */
- ns_t_key = 25, /* Security key. */
- ns_t_px = 26, /* X.400 mail mapping. */
- ns_t_gpos = 27, /* Geographical position (withdrawn). */
- ns_t_aaaa = 28, /* Ip6 Address. */
- ns_t_loc = 29, /* Location Information. */
- ns_t_nxt = 30, /* Next domain (security). */
- ns_t_eid = 31, /* Endpoint identifier. */
- ns_t_nimloc = 32, /* Nimrod Locator. */
- ns_t_srv = 33, /* Server Selection. */
- ns_t_atma = 34, /* ATM Address */
- ns_t_naptr = 35, /* Naming Authority PoinTeR */
- /* Query type values which do not appear in resource records. */
- ns_t_ixfr = 251, /* Incremental zone transfer. */
- ns_t_axfr = 252, /* Transfer zone of authority. */
- ns_t_mailb = 253, /* Transfer mailbox records. */
- ns_t_maila = 254, /* Transfer mail agent records. */
- ns_t_any = 255, /* Wildcard match. */
- ns_t_max = 65536
-} ns_type;
-
-/*
- * Values for class field
- */
-typedef enum __ns_class {
- ns_c_in = 1, /* Internet. */
- /* Class 2 unallocated/unsupported. */
- ns_c_chaos = 3, /* MIT Chaos-net. */
- ns_c_hs = 4, /* MIT Hesiod. */
- /* Query class values which do not appear in resource records */
- ns_c_none = 254, /* for prereq. sections in update requests */
- ns_c_any = 255, /* Wildcard match. */
- ns_c_max = 65536
-} ns_class;
-
-/*
- * Flags field of the KEY RR rdata
- */
-#define NS_KEY_TYPEMASK 0xC000 /* Mask for "type" bits */
-#define NS_KEY_TYPE_AUTH_CONF 0x0000 /* Key usable for both */
-#define NS_KEY_TYPE_CONF_ONLY 0x8000 /* Key usable for confidentiality */
-#define NS_KEY_TYPE_AUTH_ONLY 0x4000 /* Key usable for authentication */
-#define NS_KEY_TYPE_NO_KEY 0xC000 /* No key usable for either; no key */
-/* The type bits can also be interpreted independently, as single bits: */
-#define NS_KEY_NO_AUTH 0x8000 /* Key unusable for authentication */
-#define NS_KEY_NO_CONF 0x4000 /* Key unusable for confidentiality */
-#define NS_KEY_EXPERIMENTAL 0x2000 /* Security is *mandatory* if bit=0 */
-#define NS_KEY_RESERVED3 0x1000 /* reserved - must be zero */
-#define NS_KEY_RESERVED4 0x0800 /* reserved - must be zero */
-#define NS_KEY_USERACCOUNT 0x0400 /* key is assoc. with a user acct */
-#define NS_KEY_ENTITY 0x0200 /* key is assoc. with entity eg host */
-#define NS_KEY_ZONEKEY 0x0100 /* key is zone key */
-#define NS_KEY_IPSEC 0x0080 /* key is for IPSEC (host or user)*/
-#define NS_KEY_EMAIL 0x0040 /* key is for email (MIME security) */
-#define NS_KEY_RESERVED10 0x0020 /* reserved - must be zero */
-#define NS_KEY_RESERVED11 0x0010 /* reserved - must be zero */
-#define NS_KEY_SIGNATORYMASK 0x000F /* key can sign RR's of same name */
-
-#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED3 | \
- NS_KEY_RESERVED4 | \
- NS_KEY_RESERVED10 | \
- NS_KEY_RESERVED11 )
-
-/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
-#define NS_ALG_MD5RSA 1 /* MD5 with RSA */
-#define NS_ALG_EXPIRE_ONLY 253 /* No alg, no security */
-#define NS_ALG_PRIVATE_OID 254 /* Key begins with OID giving alg */
-
-/* Signatures */
-#define NS_MD5RSA_MIN_BITS 512 /* Size of a mod or exp in bits */
-#define NS_MD5RSA_MAX_BITS 2552
- /* Total of binary mod and exp */
-#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
- /* Max length of text sig block */
-#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
-
-/* Offsets into SIG record rdata to find various values */
-#define NS_SIG_TYPE 0 /* Type flags */
-#define NS_SIG_ALG 2 /* Algorithm */
-#define NS_SIG_LABELS 3 /* How many labels in name */
-#define NS_SIG_OTTL 4 /* Original TTL */
-#define NS_SIG_EXPIR 8 /* Expiration time */
-#define NS_SIG_SIGNED 12 /* Signature time */
-#define NS_SIG_FOOT 16 /* Key footprint */
-#define NS_SIG_SIGNER 18 /* Domain name of who signed it */
-
-/* How RR types are represented as bit-flags in NXT records */
-#define NS_NXT_BITS 8
-#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
-
-
-/*
- * Inline versions of get/put short/long. Pointer is advanced.
- */
-#define NS_GET16(s, cp) { \
- register u_char *t_cp = (u_char *)(cp); \
- (s) = ((u_int16_t)t_cp[0] << 8) \
- | ((u_int16_t)t_cp[1]) \
- ; \
- (cp) += NS_INT16SZ; \
-}
-
-#define NS_GET32(l, cp) { \
- register u_char *t_cp = (u_char *)(cp); \
- (l) = ((u_int32_t)t_cp[0] << 24) \
- | ((u_int32_t)t_cp[1] << 16) \
- | ((u_int32_t)t_cp[2] << 8) \
- | ((u_int32_t)t_cp[3]) \
- ; \
- (cp) += NS_INT32SZ; \
-}
-
-#define NS_PUT16(s, cp) { \
- register u_int16_t t_s = (u_int16_t)(s); \
- register u_char *t_cp = (u_char *)(cp); \
- *t_cp++ = t_s >> 8; \
- *t_cp = t_s; \
- (cp) += NS_INT16SZ; \
-}
-
-#define NS_PUT32(l, cp) { \
- register u_int32_t t_l = (u_int32_t)(l); \
- register u_char *t_cp = (u_char *)(cp); \
- *t_cp++ = t_l >> 24; \
- *t_cp++ = t_l >> 16; \
- *t_cp++ = t_l >> 8; \
- *t_cp = t_l; \
- (cp) += NS_INT32SZ; \
-}
-
-/*
- * ANSI C identifier hiding.
- */
-#define ns_get16 __ns_get16
-#define ns_get32 __ns_get32
-#define ns_put16 __ns_put16
-#define ns_put32 __ns_put32
-#define ns_initparse __ns_initparse
-#define ns_parserr __ns_parserr
-#define ns_sprintrr __ns_sprintrr
-#define ns_sprintrrf __ns_sprintrrf
-#define ns_format_ttl __ns_format_ttl
-#define ns_parse_ttl __ns_parse_ttl
-#define ns_name_ntop __ns_name_ntop
-#define ns_name_pton __ns_name_pton
-#define ns_name_unpack __ns_name_unpack
-#define ns_name_pack __ns_name_pack
-#define ns_name_compress __ns_name_compress
-#define ns_name_uncompress __ns_name_uncompress
-
-__BEGIN_DECLS
-u_int ns_get16 __P((const u_char *));
-u_long ns_get32 __P((const u_char *));
-void ns_put16 __P((u_int, u_char *));
-void ns_put32 __P((u_long, u_char *));
-int ns_initparse __P((const u_char *, int, ns_msg *));
-int ns_parserr __P((ns_msg *, ns_sect, int, ns_rr *));
-int ns_sprintrr __P((const ns_msg *, const ns_rr *,
- const char *, const char *, char *, size_t));
-int ns_sprintrrf __P((const u_char *, size_t, const char *,
- ns_class, ns_type, u_long, const u_char *,
- size_t, const char *, const char *,
- char *, size_t));
-int ns_format_ttl __P((u_long, char *, size_t));
-int ns_parse_ttl __P((const char *, u_long *));
-int ns_name_ntop __P((const u_char *, char *, size_t));
-int ns_name_pton __P((const char *, u_char *, size_t));
-int ns_name_unpack __P((const u_char *, const u_char *,
- const u_char *, u_char *, size_t));
-int ns_name_pack __P((const u_char *, u_char *, int,
- const u_char **, const u_char **));
-int ns_name_uncompress __P((const u_char *, const u_char *,
- const u_char *, char *, size_t));
-int ns_name_compress __P((const char *, u_char *, size_t,
- const u_char **, const u_char **));
-int ns_name_skip __P((const u_char **, const u_char *));
-__END_DECLS
-
-#ifdef BIND_4_COMPAT
-#include <arpa/nameser_compat.h>
-#endif
-
-#endif /* !_ARPA_NAMESER_H_ */
diff --git a/c/src/lib/libnetworking/arpa/nameser_compat.h b/c/src/lib/libnetworking/arpa/nameser_compat.h
deleted file mode 100644
index 2ab5b47386..0000000000
--- a/c/src/lib/libnetworking/arpa/nameser_compat.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/* Copyright (c) 1983, 1989
- * 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.
- */
-
-/*
- * from nameser.h 8.1 (Berkeley) 6/2/93
- * From: Id: nameser_compat.h,v 8.9 1998/03/20 23:25:10 halley Exp
- * $Id$
- */
-
-#ifndef _ARPA_NAMESER_COMPAT_
-#define _ARPA_NAMESER_COMPAT_
-
-#define __BIND 19950621 /* (DEAD) interface version stamp. */
-
-#include <machine/endian.h>
-
-#if !defined(BYTE_ORDER) || \
- (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
- BYTE_ORDER != PDP_ENDIAN)
- /* you must determine what the correct bit order is for
- * your compiler - the next line is an intentional error
- * which will force your compiles to bomb until you fix
- * the above macros.
- */
- error "Undefined or invalid BYTE_ORDER";
-#endif
-
-/*
- * Structure for query header. The order of the fields is machine- and
- * compiler-dependent, depending on the byte/bit order and the layout
- * of bit fields. We use bit fields only in int variables, as this
- * is all ANSI requires. This requires a somewhat confusing rearrangement.
- */
-
-typedef struct {
- unsigned id :16; /* query identification number */
-#if BYTE_ORDER == BIG_ENDIAN
- /* fields in third byte */
- unsigned qr: 1; /* response flag */
- unsigned opcode: 4; /* purpose of message */
- unsigned aa: 1; /* authoritive answer */
- unsigned tc: 1; /* truncated message */
- unsigned rd: 1; /* recursion desired */
- /* fields in fourth byte */
- unsigned ra: 1; /* recursion available */
- unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
- unsigned ad: 1; /* authentic data from named */
- unsigned cd: 1; /* checking disabled by resolver */
- unsigned rcode :4; /* response code */
-#endif
-#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
- /* fields in third byte */
- unsigned rd :1; /* recursion desired */
- unsigned tc :1; /* truncated message */
- unsigned aa :1; /* authoritive answer */
- unsigned opcode :4; /* purpose of message */
- unsigned qr :1; /* response flag */
- /* fields in fourth byte */
- unsigned rcode :4; /* response code */
- unsigned cd: 1; /* checking disabled by resolver */
- unsigned ad: 1; /* authentic data from named */
- unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
- unsigned ra :1; /* recursion available */
-#endif
- /* remaining bytes */
- unsigned qdcount :16; /* number of question entries */
- unsigned ancount :16; /* number of answer entries */
- unsigned nscount :16; /* number of authority entries */
- unsigned arcount :16; /* number of resource entries */
-} HEADER;
-
-#define PACKETSZ NS_PACKETSZ
-#define MAXDNAME NS_MAXDNAME
-#define MAXCDNAME NS_MAXCDNAME
-#define MAXLABEL NS_MAXLABEL
-#define HFIXEDSZ NS_HFIXEDSZ
-#define QFIXEDSZ NS_QFIXEDSZ
-#define RRFIXEDSZ NS_RRFIXEDSZ
-#define INT32SZ NS_INT32SZ
-#define INT16SZ NS_INT16SZ
-#define INADDRSZ NS_INADDRSZ
-#define IN6ADDRSZ NS_IN6ADDRSZ
-#define INDIR_MASK NS_CMPRSFLGS
-#define NAMESERVER_PORT NS_DEFAULTPORT
-
-#define S_ZONE ns_s_zn
-#define S_PREREQ ns_s_pr
-#define S_UPDATE ns_s_ud
-#define S_ADDT ns_s_ar
-
-#define QUERY ns_o_query
-#define IQUERY ns_o_iquery
-#define STATUS ns_o_status
-#define NS_NOTIFY_OP ns_o_notify
-#define NS_UPDATE_OP ns_o_update
-
-#define NOERROR ns_r_noerror
-#define FORMERR ns_r_formerr
-#define SERVFAIL ns_r_servfail
-#define NXDOMAIN ns_r_nxdomain
-#define NOTIMP ns_r_notimpl
-#define REFUSED ns_r_refused
-#define YXDOMAIN ns_r_yxdomain
-#define YXRRSET ns_r_yxrrset
-#define NXRRSET ns_r_nxrrset
-#define NOTAUTH ns_r_notauth
-#define NOTZONE ns_r_notzone
-
-#define DELETE ns_uop_delete
-#define ADD ns_uop_add
-
-#define T_A ns_t_a
-#define T_NS ns_t_ns
-#define T_MD ns_t_md
-#define T_MF ns_t_mf
-#define T_CNAME ns_t_cname
-#define T_SOA ns_t_soa
-#define T_MB ns_t_mb
-#define T_MG ns_t_mg
-#define T_MR ns_t_mr
-#define T_NULL ns_t_null
-#define T_WKS ns_t_wks
-#define T_PTR ns_t_ptr
-#define T_HINFO ns_t_hinfo
-#define T_MINFO ns_t_minfo
-#define T_MX ns_t_mx
-#define T_TXT ns_t_txt
-#define T_RP ns_t_rp
-#define T_AFSDB ns_t_afsdb
-#define T_X25 ns_t_x25
-#define T_ISDN ns_t_isdn
-#define T_RT ns_t_rt
-#define T_NSAP ns_t_nsap
-#define T_NSAP_PTR ns_t_nsap_ptr
-#define T_SIG ns_t_sig
-#define T_KEY ns_t_key
-#define T_PX ns_t_px
-#define T_GPOS ns_t_gpos
-#define T_AAAA ns_t_aaaa
-#define T_LOC ns_t_loc
-#define T_NXT ns_t_nxt
-#define T_EID ns_t_eid
-#define T_NIMLOC ns_t_nimloc
-#define T_SRV ns_t_srv
-#define T_ATMA ns_t_atma
-#define T_NAPTR ns_t_naptr
-#define T_IXFR ns_t_ixfr
-#define T_AXFR ns_t_axfr
-#define T_MAILB ns_t_mailb
-#define T_MAILA ns_t_maila
-#define T_ANY ns_t_any
-
-#define C_IN ns_c_in
-#define C_CHAOS ns_c_chaos
-#define C_HS ns_c_hs
-/* BIND_UPDATE */
-#define C_NONE ns_c_none
-#define C_ANY ns_c_any
-
-#define GETSHORT NS_GET16
-#define GETLONG NS_GET32
-#define PUTSHORT NS_PUT16
-#define PUTLONG NS_PUT32
-
-#endif /* _ARPA_NAMESER_COMPAT_ */
diff --git a/c/src/lib/libnetworking/arpa/telnet.h b/c/src/lib/libnetworking/arpa/telnet.h
deleted file mode 100644
index 09b85692da..0000000000
--- a/c/src/lib/libnetworking/arpa/telnet.h
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * @(#)telnet.h 8.2 (Berkeley) 12/15/93
- *
- * $Id$
- */
-
-#ifndef _ARPA_TELNET_H_
-#define _ARPA_TELNET_H_
-
-/*
- * Definitions for the TELNET protocol.
- */
-#define IAC 255 /* interpret as command: */
-#define DONT 254 /* you are not to use option */
-#define DO 253 /* please, you use option */
-#define WONT 252 /* I won't use option */
-#define WILL 251 /* I will use option */
-#define SB 250 /* interpret as subnegotiation */
-#define GA 249 /* you may reverse the line */
-#define EL 248 /* erase the current line */
-#define EC 247 /* erase the current character */
-#define AYT 246 /* are you there */
-#define AO 245 /* abort output--but let prog finish */
-#define IP 244 /* interrupt process--permanently */
-#define BREAK 243 /* break */
-#define DM 242 /* data mark--for connect. cleaning */
-#define NOP 241 /* nop */
-#define SE 240 /* end sub negotiation */
-#define EOR 239 /* end of record (transparent mode) */
-#define ABORT 238 /* Abort process */
-#define SUSP 237 /* Suspend process */
-#define xEOF 236 /* End of file: EOF is already used... */
-
-#define SYNCH 242 /* for telfunc calls */
-
-#ifdef TELCMDS
-char *telcmds[] = {
- "EOF", "SUSP", "ABORT", "EOR",
- "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
- "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC",
- 0
-};
-#else
-extern char *telcmds[];
-#endif
-
-#define TELCMD_FIRST xEOF
-#define TELCMD_LAST IAC
-#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
- (unsigned int)(x) >= TELCMD_FIRST)
-#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
-
-/* telnet options */
-#define TELOPT_BINARY 0 /* 8-bit data path */
-#define TELOPT_ECHO 1 /* echo */
-#define TELOPT_RCP 2 /* prepare to reconnect */
-#define TELOPT_SGA 3 /* suppress go ahead */
-#define TELOPT_NAMS 4 /* approximate message size */
-#define TELOPT_STATUS 5 /* give status */
-#define TELOPT_TM 6 /* timing mark */
-#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
-#define TELOPT_NAOL 8 /* negotiate about output line width */
-#define TELOPT_NAOP 9 /* negotiate about output page size */
-#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
-#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
-#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
-#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
-#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
-#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
-#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
-#define TELOPT_XASCII 17 /* extended ascic character set */
-#define TELOPT_LOGOUT 18 /* force logout */
-#define TELOPT_BM 19 /* byte macro */
-#define TELOPT_DET 20 /* data entry terminal */
-#define TELOPT_SUPDUP 21 /* supdup protocol */
-#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
-#define TELOPT_SNDLOC 23 /* send location */
-#define TELOPT_TTYPE 24 /* terminal type */
-#define TELOPT_EOR 25 /* end or record */
-#define TELOPT_TUID 26 /* TACACS user identification */
-#define TELOPT_OUTMRK 27 /* output marking */
-#define TELOPT_TTYLOC 28 /* terminal location number */
-#define TELOPT_3270REGIME 29 /* 3270 regime */
-#define TELOPT_X3PAD 30 /* X.3 PAD */
-#define TELOPT_NAWS 31 /* window size */
-#define TELOPT_TSPEED 32 /* terminal speed */
-#define TELOPT_LFLOW 33 /* remote flow control */
-#define TELOPT_LINEMODE 34 /* Linemode option */
-#define TELOPT_XDISPLOC 35 /* X Display Location */
-#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */
-#define TELOPT_AUTHENTICATION 37/* Authenticate */
-#define TELOPT_ENCRYPT 38 /* Encryption option */
-#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */
-#define TELOPT_EXOPL 255 /* extended-options-list */
-
-
-#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
-#ifdef TELOPTS
-char *telopts[NTELOPTS+1] = {
- "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
- "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
- "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
- "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
- "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
- "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
- "TACACS UID", "OUTPUT MARKING", "TTYLOC",
- "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
- "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
- "ENCRYPT", "NEW-ENVIRON",
- 0
-};
-#define TELOPT_FIRST TELOPT_BINARY
-#define TELOPT_LAST TELOPT_NEW_ENVIRON
-#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
-#define TELOPT(x) telopts[(x)-TELOPT_FIRST]
-#endif
-
-/* sub-option qualifiers */
-#define TELQUAL_IS 0 /* option is... */
-#define TELQUAL_SEND 1 /* send option */
-#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */
-#define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */
-#define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */
-
-#define LFLOW_OFF 0 /* Disable remote flow control */
-#define LFLOW_ON 1 /* Enable remote flow control */
-#define LFLOW_RESTART_ANY 2 /* Restart output on any char */
-#define LFLOW_RESTART_XON 3 /* Restart output only on XON */
-
-/*
- * LINEMODE suboptions
- */
-
-#define LM_MODE 1
-#define LM_FORWARDMASK 2
-#define LM_SLC 3
-
-#define MODE_EDIT 0x01
-#define MODE_TRAPSIG 0x02
-#define MODE_ACK 0x04
-#define MODE_SOFT_TAB 0x08
-#define MODE_LIT_ECHO 0x10
-
-#define MODE_MASK 0x1f
-
-/* Not part of protocol, but needed to simplify things... */
-#define MODE_FLOW 0x0100
-#define MODE_ECHO 0x0200
-#define MODE_INBIN 0x0400
-#define MODE_OUTBIN 0x0800
-#define MODE_FORCE 0x1000
-
-#define SLC_SYNCH 1
-#define SLC_BRK 2
-#define SLC_IP 3
-#define SLC_AO 4
-#define SLC_AYT 5
-#define SLC_EOR 6
-#define SLC_ABORT 7
-#define SLC_EOF 8
-#define SLC_SUSP 9
-#define SLC_EC 10
-#define SLC_EL 11
-#define SLC_EW 12
-#define SLC_RP 13
-#define SLC_LNEXT 14
-#define SLC_XON 15
-#define SLC_XOFF 16
-#define SLC_FORW1 17
-#define SLC_FORW2 18
-#define SLC_MCL 19
-#define SLC_MCR 20
-#define SLC_MCWL 21
-#define SLC_MCWR 22
-#define SLC_MCBOL 23
-#define SLC_MCEOL 24
-#define SLC_INSRT 25
-#define SLC_OVER 26
-#define SLC_ECR 27
-#define SLC_EWR 28
-#define SLC_EBOL 29
-#define SLC_EEOL 30
-
-#define NSLC 30
-
-/*
- * For backwards compatability, we define SLC_NAMES to be the
- * list of names if SLC_NAMES is not defined.
- */
-#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
- "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
- "LNEXT", "XON", "XOFF", "FORW1", "FORW2", \
- "MCL", "MCR", "MCWL", "MCWR", "MCBOL", \
- "MCEOL", "INSRT", "OVER", "ECR", "EWR", \
- "EBOL", "EEOL", \
- 0
-
-#ifdef SLC_NAMES
-char *slc_names[] = {
- SLC_NAMELIST
-};
-#else
-extern char *slc_names[];
-#define SLC_NAMES SLC_NAMELIST
-#endif
-
-#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
-#define SLC_NAME(x) slc_names[x]
-
-#define SLC_NOSUPPORT 0
-#define SLC_CANTCHANGE 1
-#define SLC_VARIABLE 2
-#define SLC_DEFAULT 3
-#define SLC_LEVELBITS 0x03
-
-#define SLC_FUNC 0
-#define SLC_FLAGS 1
-#define SLC_VALUE 2
-
-#define SLC_ACK 0x80
-#define SLC_FLUSHIN 0x40
-#define SLC_FLUSHOUT 0x20
-
-#define OLD_ENV_VAR 1
-#define OLD_ENV_VALUE 0
-#define NEW_ENV_VAR 0
-#define NEW_ENV_VALUE 1
-#define ENV_ESC 2
-#define ENV_USERVAR 3
-
-/*
- * AUTHENTICATION suboptions
- */
-
-/*
- * Who is authenticating who ...
- */
-#define AUTH_WHO_CLIENT 0 /* Client authenticating server */
-#define AUTH_WHO_SERVER 1 /* Server authenticating client */
-#define AUTH_WHO_MASK 1
-
-/*
- * amount of authentication done
- */
-#define AUTH_HOW_ONE_WAY 0
-#define AUTH_HOW_MUTUAL 2
-#define AUTH_HOW_MASK 2
-
-#define AUTHTYPE_NULL 0
-#define AUTHTYPE_KERBEROS_V4 1
-#define AUTHTYPE_KERBEROS_V5 2
-#define AUTHTYPE_SPX 3
-#define AUTHTYPE_MINK 4
-#define AUTHTYPE_CNT 5
-
-#define AUTHTYPE_TEST 99
-
-#ifdef AUTH_NAMES
-char *authtype_names[] = {
- "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK",
- 0
-};
-#else
-extern char *authtype_names[];
-#endif
-
-#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
-#define AUTHTYPE_NAME(x) authtype_names[x]
-
-/*
- * ENCRYPTion suboptions
- */
-#define ENCRYPT_IS 0 /* I pick encryption type ... */
-#define ENCRYPT_SUPPORT 1 /* I support encryption types ... */
-#define ENCRYPT_REPLY 2 /* Initial setup response */
-#define ENCRYPT_START 3 /* Am starting to send encrypted */
-#define ENCRYPT_END 4 /* Am ending encrypted */
-#define ENCRYPT_REQSTART 5 /* Request you start encrypting */
-#define ENCRYPT_REQEND 6 /* Request you end encrypting */
-#define ENCRYPT_ENC_KEYID 7
-#define ENCRYPT_DEC_KEYID 8
-#define ENCRYPT_CNT 9
-
-#define ENCTYPE_ANY 0
-#define ENCTYPE_DES_CFB64 1
-#define ENCTYPE_DES_OFB64 2
-#define ENCTYPE_CNT 3
-
-#ifdef ENCRYPT_NAMES
-char *encrypt_names[] = {
- "IS", "SUPPORT", "REPLY", "START", "END",
- "REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
- 0
-};
-char *enctype_names[] = {
- "ANY", "DES_CFB64", "DES_OFB64",
- 0
-};
-#else
-extern char *encrypt_names[];
-extern char *enctype_names[];
-#endif
-
-
-#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
-#define ENCRYPT_NAME(x) encrypt_names[x]
-
-#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
-#define ENCTYPE_NAME(x) enctype_names[x]
-
-#endif /* !_TELNET_H_ */
diff --git a/c/src/lib/libnetworking/bpfilter.h b/c/src/lib/libnetworking/bpfilter.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/lib/libnetworking/bpfilter.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/lib/libnetworking/include/Makefile.in b/c/src/lib/libnetworking/include/Makefile.in
deleted file mode 100644
index f2746d78f0..0000000000
--- a/c/src/lib/libnetworking/include/Makefile.in
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_PIECES=bpfilter loop netdb opt_ipfw opt_mrouting \
- opt_tcpdebug poll resolv syslog
-H_FILES=$(H_PIECES:%=$(srcdir)/../%.h)
-
-SYS_H_PIECES=buf callout cdefs conf domain filio ioccom ioctl kernel \
- libkern malloc mbuf mount param proc protosw queue reboot \
- resourcevar rtprio select signalvar socket socketvar \
- sockio sysctl syslimits syslog systm ttycom ttydefaults \
- ucred uio
-SYS_H_FILES=$(SYS_H_PIECES:%=$(srcdir)/../sys/%.h)
-
-RTEMS_H_PIECES= rtems_bsdnet rtems_bsdnet_internal tftp
-RTEMS_H_FILES=$(RTEMS_H_PIECES:%=$(srcdir)/../rtems/%.h)
-
-MACHINE_H_PIECES= conf cpu cpufunc endian in_cksum limits param types vmparam
-MACHINE_H_FILES=$(MACHINE_H_PIECES:%=$(srcdir)/../machine/%.h)
-
-VM_H_PIECES= vm vm_extern vm_kern vm_param
-VM_H_FILES=$(VM_H_PIECES:%=$(srcdir)/../vm/%.h)
-
-NET_H_PIECES= bpf ethernet if if_arp if_dl if_llc if_types netisr \
- radix raw_cb route
-NET_H_FILES=$(NET_H_PIECES:%=$(srcdir)/../net/%.h)
-
-NETINET_H_PIECES= icmp_var if_ether igmp igmp_var in in_pcb in_systm in_var \
- ip ip_fw ip_icmp ip_mroute ip_var tcp tcp_debug tcp_fsm \
- tcp_seq tcp_timer tcp_var tcpip udp udp_var
-NETINET_H_FILES=$(NETINET_H_PIECES:%=$(srcdir)/../netinet/%.h)
-
-ARPA_H_PIECES= ftp inet nameser nameser_compat telnet
-ARPA_H_FILES=$(ARPA_H_PIECES:%=$(srcdir)/../arpa/%.h)
-
-NFS_H_PIECES= krpc nfs nfsdiskless nfsproto rpcv2 xdr_subs
-NFS_H_FILES=$(NFS_H_PIECES:%=$(srcdir)/../nfs/%.h)
-
-SRCS=$(H_FILES) $(SYS_H_FILES) $(RTEMS_H_FILES) $(MACHINE_H_FILES) \
- $(VM_H_FILES) $(NET_H_FILES) $(NETINET_H_FILES) $(ARPA_H_FILES) \
- $(NFS_H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)/networking
- $(INSTALL) -m 444 $(SYS_H_FILES) $(PROJECT_INCLUDE)/networking/sys
- $(INSTALL) -m 444 $(RTEMS_H_FILES) $(PROJECT_INCLUDE)/networking/rtems
- $(INSTALL) -m 444 $(MACHINE_H_FILES) $(PROJECT_INCLUDE)/networking/machine
- $(INSTALL) -m 444 $(VM_H_FILES) $(PROJECT_INCLUDE)/networking/vm
- $(INSTALL) -m 444 $(NET_H_FILES) $(PROJECT_INCLUDE)/networking/net
- $(INSTALL) -m 444 $(NETINET_H_FILES) $(PROJECT_INCLUDE)/networking/netinet
- $(INSTALL) -m 444 $(ARPA_H_FILES) $(PROJECT_INCLUDE)/networking/arpa
- $(INSTALL) -m 444 $(NFS_H_FILES) $(PROJECT_INCLUDE)/networking/nfs
diff --git a/c/src/lib/libnetworking/kern/Makefile.in b/c/src/lib/libnetworking/kern/Makefile.in
deleted file mode 100644
index 35804e14ef..0000000000
--- a/c/src/lib/libnetworking/kern/Makefile.in
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=lib.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES=kern_subr uipc_domain uipc_mbuf uipc_socket uipc_socket2
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \
- -DDIAGNOSTIC -DBOOTP_COMPAT
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
diff --git a/c/src/lib/libnetworking/kern/kern_subr.c b/c/src/lib/libnetworking/kern/kern_subr.c
deleted file mode 100644
index 71e51fc442..0000000000
--- a/c/src/lib/libnetworking/kern/kern_subr.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/malloc.h>
-#include <sys/queue.h>
-
-int
-uiomove(cp, n, uio)
- register caddr_t cp;
- register int n;
- register struct uio *uio;
-{
- register struct iovec *iov;
- u_int cnt;
- int error;
-
-#ifdef DIAGNOSTIC
- if (uio->uio_rw != UIO_READ && uio->uio_rw != UIO_WRITE)
- panic("uiomove: mode");
-#endif
- while (n > 0 && uio->uio_resid) {
- iov = uio->uio_iov;
- cnt = iov->iov_len;
- if (cnt == 0) {
- uio->uio_iov++;
- uio->uio_iovcnt--;
- continue;
- }
- if (cnt > n)
- cnt = n;
-
- switch (uio->uio_segflg) {
-
- case UIO_USERSPACE:
- case UIO_USERISPACE:
- if (uio->uio_rw == UIO_READ)
- error = copyout(cp, iov->iov_base, cnt);
- else
- error = copyin(iov->iov_base, cp, cnt);
- if (error)
- return (error);
- break;
-
- case UIO_SYSSPACE:
- if (uio->uio_rw == UIO_READ)
- bcopy((caddr_t)cp, iov->iov_base, cnt);
- else
- bcopy(iov->iov_base, (caddr_t)cp, cnt);
- break;
- case UIO_NOCOPY:
- break;
- }
- iov->iov_base += cnt;
- iov->iov_len -= cnt;
- uio->uio_resid -= cnt;
- uio->uio_offset += cnt;
- cp += cnt;
- n -= cnt;
- }
- return (0);
-}
-
-#ifdef vax /* unused except by ct.c, other oddities XXX */
-/*
- * Get next character written in by user from uio.
- */
-int
-uwritec(uio)
- struct uio *uio;
-{
- register struct iovec *iov;
- register int c;
-
- if (uio->uio_resid <= 0)
- return (-1);
-again:
- if (uio->uio_iovcnt <= 0)
- panic("uwritec");
- iov = uio->uio_iov;
- if (iov->iov_len == 0) {
- uio->uio_iov++;
- if (--uio->uio_iovcnt == 0)
- return (-1);
- goto again;
- }
- switch (uio->uio_segflg) {
-
- case UIO_USERSPACE:
- c = fubyte(iov->iov_base);
- break;
-
- case UIO_SYSSPACE:
- c = *(u_char *) iov->iov_base;
- break;
-
- case UIO_USERISPACE:
- c = fuibyte(iov->iov_base);
- break;
- }
- if (c < 0)
- return (-1);
- iov->iov_base++;
- iov->iov_len--;
- uio->uio_resid--;
- uio->uio_offset++;
- return (c);
-}
-#endif /* vax */
-
-/*
- * General routine to allocate a hash table.
- */
-void *
-hashinit(elements, type, hashmask)
- int elements, type;
- u_long *hashmask;
-{
- long hashsize;
- LIST_HEAD(generic, generic) *hashtbl;
- int i;
-
- if (elements <= 0)
- panic("hashinit: bad elements");
- for (hashsize = 1; hashsize <= elements; hashsize <<= 1)
- continue;
- hashsize >>= 1;
- hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, M_WAITOK);
- for (i = 0; i < hashsize; i++)
- LIST_INIT(&hashtbl[i]);
- *hashmask = hashsize - 1;
- return (hashtbl);
-}
-
-#define NPRIMES 27
-static int primes[] = { 1, 13, 31, 61, 127, 251, 509, 761, 1021, 1531, 2039,
- 2557, 3067, 3583, 4093, 4603, 5119, 5623, 6143, 6653,
- 7159, 7673, 8191, 12281, 16381, 24571, 32749 };
-
-/*
- * General routine to allocate a prime number sized hash table.
- */
-void *
-phashinit(elements, type, nentries)
- int elements, type;
- u_long *nentries;
-{
- long hashsize;
- LIST_HEAD(generic, generic) *hashtbl;
- int i;
-
- if (elements <= 0)
- panic("phashinit: bad elements");
- for (i = 1, hashsize = primes[1]; hashsize <= elements;) {
- i++;
- if (i == NPRIMES)
- break;
- hashsize = primes[i];
- }
- hashsize = primes[i - 1];
- hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, M_WAITOK);
- for (i = 0; i < hashsize; i++)
- LIST_INIT(&hashtbl[i]);
- *nentries = hashsize;
- return (hashtbl);
-}
diff --git a/c/src/lib/libnetworking/kern/uipc_domain.c b/c/src/lib/libnetworking/kern/uipc_domain.c
deleted file mode 100644
index 910007395c..0000000000
--- a/c/src/lib/libnetworking/kern/uipc_domain.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/domain.h>
-#include <sys/mbuf.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-
-/*
- * System initialization
- *
- * Note: domain initialization wants to take place on a per domain basis
- * as a result of traversing a linker set. Most likely, each domain
- * want to call a registration function rather than being handled here
- * in domaininit(). Probably this will look like:
- *
- * SYSINIT(unique, SI_SUB_PROTO_DOMAI, SI_ORDER_ANY, domain_add, xxx)
- *
- * Where 'xxx' is replaced by the address of a parameter struct to be
- * passed to the doamin_add() function.
- */
-
-#if !defined(__rtems__)
-static int x_save_spl; /* used by kludge*/
-static void kludge_splimp __P((void *));
-static void kludge_splx __P((void *));
- void domaininit __P((void *));
-SYSINIT(splimp, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, kludge_splimp, &x_save_spl)
-SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL)
-SYSINIT(splx, SI_SUB_PROTO_END, SI_ORDER_FIRST, kludge_splx, &x_save_spl)
-#endif
-
-static void pffasttimo __P((void *));
-static void pfslowtimo __P((void *));
-
-struct domain *domains;
-
-#define ADDDOMAIN(x) { \
- __CONCAT(x,domain.dom_next) = domains; \
- domains = &__CONCAT(x,domain); \
-}
-
-extern struct linker_set domain_set;
-
-/* ARGSUSED*/
-void
-domaininit(dummy)
- void *dummy;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
-/* - not in our sources
-#ifdef ISDN
- ADDDOMAIN(isdn);
-#endif
-*/
-
- for (dp = domains; dp; dp = dp->dom_next) {
- if (dp->dom_init)
- (*dp->dom_init)();
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++){
-#ifdef PRU_OLDSTYLE
- /* See comments in uipc_socket2.c. */
- if (pr->pr_usrreqs == 0 && pr->pr_ousrreq)
- pr->pr_usrreqs = &pru_oldstyle;
-#endif
- if (pr->pr_init)
- (*pr->pr_init)();
- }
- }
-
- if (max_linkhdr < 16) /* XXX */
- max_linkhdr = 16;
- max_hdr = max_linkhdr + max_protohdr;
- max_datalen = MHLEN - max_hdr;
- timeout(pffasttimo, (void *)0, 1);
- timeout(pfslowtimo, (void *)0, 1);
-}
-
-
-/*
- * The following two operations are kludge code. Most likely, they should
- * be done as a "domainpreinit()" for the first function and then rolled
- * in as the last act of "domaininit()" for the second.
- *
- * In point of fact, it is questionable why other initialization prior
- * to this does not also take place at splimp by default.
- */
-static void
-kludge_splimp(udata)
- void *udata;
-{
- int *savesplp = udata;
-
- *savesplp = splimp();
-}
-
-static void
-kludge_splx(udata)
- void *udata;
-{
- int *savesplp = udata;
-
- splx( *savesplp);
-}
-
-
-
-struct protosw *
-pffindtype(int family, int type)
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- if (dp->dom_family == family)
- goto found;
- return (0);
-found:
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_type && pr->pr_type == type)
- return (pr);
- return (0);
-}
-
-struct protosw *
-pffindproto(int family, int protocol, int type)
-{
- register struct domain *dp;
- register struct protosw *pr;
- struct protosw *maybe = 0;
-
- if (family == 0)
- return (0);
- for (dp = domains; dp; dp = dp->dom_next)
- if (dp->dom_family == family)
- goto found;
- return (0);
-found:
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) {
- if ((pr->pr_protocol == protocol) && (pr->pr_type == type))
- return (pr);
-
- if (type == SOCK_RAW && pr->pr_type == SOCK_RAW &&
- pr->pr_protocol == 0 && maybe == (struct protosw *)0)
- maybe = pr;
- }
- return (maybe);
-}
-
-void
-pfctlinput(cmd, sa)
- int cmd;
- struct sockaddr *sa;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_ctlinput)
- (*pr->pr_ctlinput)(cmd, sa, (void *)0);
-}
-
-static void
-pfslowtimo(arg)
- void *arg;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_slowtimo)
- (*pr->pr_slowtimo)();
- timeout(pfslowtimo, (void *)0, hz/2);
-}
-
-static void
-pffasttimo(arg)
- void *arg;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_fasttimo)
- (*pr->pr_fasttimo)();
- timeout(pffasttimo, (void *)0, hz/5);
-}
diff --git a/c/src/lib/libnetworking/kern/uipc_mbuf.c b/c/src/lib/libnetworking/kern/uipc_mbuf.c
deleted file mode 100644
index f682be94a7..0000000000
--- a/c/src/lib/libnetworking/kern/uipc_mbuf.c
+++ /dev/null
@@ -1,851 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1991, 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.
- *
- * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/malloc.h>
-#define MBTYPES
-#include <sys/mbuf.h>
-#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/vm_kern.h>
-#include <vm/vm_extern.h>
-
-static void mbinit __P((void *));
-SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbinit, NULL)
-
-struct mbuf *mbutl;
-char *mclrefcnt;
-struct mbstat mbstat;
-struct mbuf *mmbfree;
-union mcluster *mclfree;
-int max_linkhdr;
-int max_protohdr;
-int max_hdr;
-int max_datalen;
-
-static void m_reclaim __P((void));
-
-/* "number of clusters of pages" */
-#define NCL_INIT 1
-
-#define NMB_INIT 16
-
-/* ARGSUSED*/
-static void
-mbinit(dummy)
- void *dummy;
-{
- int s;
-
- mmbfree = NULL; mclfree = NULL;
- s = splimp();
- if (m_mballoc(NMB_INIT, M_DONTWAIT) == 0)
- goto bad;
- if (m_clalloc(NCL_INIT, M_DONTWAIT) == 0)
- goto bad;
- splx(s);
- return;
-bad:
- panic("mbinit");
-}
-
-/*
- * Allocate at least nmb mbufs and place on mbuf free list.
- * Must be called at splimp.
- */
-/* ARGSUSED */
-int
-m_mballoc(nmb, nowait)
- register int nmb;
- int nowait;
-{
- register caddr_t p;
- register int i;
- int nbytes;
-
- /* Once we run out of map space, it will be impossible to get
- * any more (nothing is ever freed back to the map) (XXX which
- * is dumb). (however you are not dead as m_reclaim might
- * still be able to free a substantial amount of space).
- */
- if (mb_map_full)
- return (0);
-
- nbytes = round_page(nmb * MSIZE);
- p = (caddr_t)kmem_malloc(mb_map, nbytes, nowait ? M_NOWAIT : M_WAITOK);
- /*
- * Either the map is now full, or this is nowait and there
- * are no pages left.
- */
- if (p == NULL)
- return (0);
-
- nmb = nbytes / MSIZE;
- for (i = 0; i < nmb; i++) {
- ((struct mbuf *)p)->m_next = mmbfree;
- mmbfree = (struct mbuf *)p;
- p += MSIZE;
- }
- mbstat.m_mbufs += nmb;
- return (1);
-}
-
-/*
- * Allocate some number of mbuf clusters
- * and place on cluster free list.
- * Must be called at splimp.
- */
-/* ARGSUSED */
-int
-m_clalloc(ncl, nowait)
- register int ncl;
- int nowait;
-{
- register caddr_t p;
- register int i;
-
- /*
- * Once we run out of map space, it will be impossible
- * to get any more (nothing is ever freed back to the
- * map).
- */
- if (mb_map_full)
- return (0);
-
- p = (caddr_t)kmem_malloc(mb_map, ncl*MCLBYTES,
- nowait ? M_NOWAIT : M_WAITOK);
- /*
- * Either the map is now full, or this is nowait and there
- * are no pages left.
- */
- if (p == NULL)
- return (0);
-
- for (i = 0; i < ncl; i++) {
- ((union mcluster *)p)->mcl_next = mclfree;
- mclfree = (union mcluster *)p;
- p += MCLBYTES;
- mbstat.m_clfree++;
- }
- mbstat.m_clusters += ncl;
- return (1);
-}
-
-/*
- * When MGET failes, ask protocols to free space when short of memory,
- * then re-attempt to allocate an mbuf.
- */
-struct mbuf *
-m_retry(i, t)
- int i, t;
-{
- register struct mbuf *m;
-
- m_reclaim();
-#define m_retry(i, t) (struct mbuf *)0
- MGET(m, i, t);
-#undef m_retry
- if (m != NULL)
- mbstat.m_wait++;
- else
- mbstat.m_drops++;
- return (m);
-}
-
-/*
- * As above; retry an MGETHDR.
- */
-struct mbuf *
-m_retryhdr(i, t)
- int i, t;
-{
- register struct mbuf *m;
-
- m_reclaim();
-#define m_retryhdr(i, t) (struct mbuf *)0
- MGETHDR(m, i, t);
-#undef m_retryhdr
- if (m != NULL)
- mbstat.m_wait++;
- else
- mbstat.m_drops++;
- return (m);
-}
-
-static void
-m_reclaim()
-{
- register struct domain *dp;
- register struct protosw *pr;
- int s = splimp();
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_drain)
- (*pr->pr_drain)();
- splx(s);
- mbstat.m_drain++;
-}
-
-/*
- * Space allocation routines.
- * These are also available as macros
- * for critical paths.
- */
-struct mbuf *
-m_get(nowait, type)
- int nowait, type;
-{
- register struct mbuf *m;
-
- MGET(m, nowait, type);
- return (m);
-}
-
-struct mbuf *
-m_gethdr(nowait, type)
- int nowait, type;
-{
- register struct mbuf *m;
-
- MGETHDR(m, nowait, type);
- return (m);
-}
-
-struct mbuf *
-m_getclr(nowait, type)
- int nowait, type;
-{
- register struct mbuf *m;
-
- MGET(m, nowait, type);
- if (m == 0)
- return (0);
- bzero(mtod(m, caddr_t), MLEN);
- return (m);
-}
-
-struct mbuf *
-m_free(m)
- struct mbuf *m;
-{
- register struct mbuf *n;
-
- MFREE(m, n);
- return (n);
-}
-
-void
-m_freem(m)
- register struct mbuf *m;
-{
- register struct mbuf *n;
-
- if (m == NULL)
- return;
- do {
- MFREE(m, n);
- m = n;
- } while (m);
-}
-
-/*
- * Mbuffer utility routines.
- */
-
-/*
- * Lesser-used path for M_PREPEND:
- * allocate new mbuf to prepend to chain,
- * copy junk along.
- */
-struct mbuf *
-m_prepend(m, len, how)
- register struct mbuf *m;
- int len, how;
-{
- struct mbuf *mn;
-
- MGET(mn, how, m->m_type);
- if (mn == (struct mbuf *)NULL) {
- m_freem(m);
- return ((struct mbuf *)NULL);
- }
- if (m->m_flags & M_PKTHDR) {
- M_COPY_PKTHDR(mn, m);
- m->m_flags &= ~M_PKTHDR;
- }
- mn->m_next = m;
- m = mn;
- if (len < MHLEN)
- MH_ALIGN(m, len);
- m->m_len = len;
- return (m);
-}
-
-/*
- * Make a copy of an mbuf chain starting "off0" bytes from the beginning,
- * continuing for "len" bytes. If len is M_COPYALL, copy to end of mbuf.
- * The wait parameter is a choice of M_WAIT/M_DONTWAIT from caller.
- */
-static int MCFail;
-
-struct mbuf *
-m_copym(m, off0, len, wait)
- register struct mbuf *m;
- int off0, wait;
- register int len;
-{
- register struct mbuf *n, **np;
- register int off = off0;
- struct mbuf *top;
- int copyhdr = 0;
-
- if (off < 0 || len < 0)
- panic("m_copym");
- if (off == 0 && m->m_flags & M_PKTHDR)
- copyhdr = 1;
- while (off > 0) {
- if (m == 0)
- panic("m_copym");
- if (off < m->m_len)
- break;
- off -= m->m_len;
- m = m->m_next;
- }
- np = &top;
- top = 0;
- while (len > 0) {
- if (m == 0) {
- if (len != M_COPYALL)
- panic("m_copym");
- break;
- }
- MGET(n, wait, m->m_type);
- *np = n;
- if (n == 0)
- goto nospace;
- if (copyhdr) {
- M_COPY_PKTHDR(n, m);
- if (len == M_COPYALL)
- n->m_pkthdr.len -= off0;
- else
- n->m_pkthdr.len = len;
- copyhdr = 0;
- }
- n->m_len = min(len, m->m_len - off);
- if (m->m_flags & M_EXT) {
- n->m_data = m->m_data + off;
- if(!m->m_ext.ext_ref)
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- else
- (*(m->m_ext.ext_ref))(m->m_ext.ext_buf,
- m->m_ext.ext_size);
- n->m_ext = m->m_ext;
- n->m_flags |= M_EXT;
- } else
- bcopy(mtod(m, caddr_t)+off, mtod(n, caddr_t),
- (unsigned)n->m_len);
- if (len != M_COPYALL)
- len -= n->m_len;
- off = 0;
- m = m->m_next;
- np = &n->m_next;
- }
- if (top == 0)
- MCFail++;
- return (top);
-nospace:
- m_freem(top);
- MCFail++;
- return (0);
-}
-
-/*
- * Copy an entire packet, including header (which must be present).
- * An optimization of the common case `m_copym(m, 0, M_COPYALL, how)'.
- */
-struct mbuf *
-m_copypacket(m, how)
- struct mbuf *m;
- int how;
-{
- struct mbuf *top, *n, *o;
-
- MGET(n, how, m->m_type);
- top = n;
- if (!n)
- goto nospace;
-
- M_COPY_PKTHDR(n, m);
- n->m_len = m->m_len;
- if (m->m_flags & M_EXT) {
- n->m_data = m->m_data;
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- n->m_ext = m->m_ext;
- n->m_flags |= M_EXT;
- } else {
- bcopy(mtod(m, char *), mtod(n, char *), n->m_len);
- }
-
- m = m->m_next;
- while (m) {
- MGET(o, how, m->m_type);
- if (!o)
- goto nospace;
-
- n->m_next = o;
- n = n->m_next;
-
- n->m_len = m->m_len;
- if (m->m_flags & M_EXT) {
- n->m_data = m->m_data;
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- n->m_ext = m->m_ext;
- n->m_flags |= M_EXT;
- } else {
- bcopy(mtod(m, char *), mtod(n, char *), n->m_len);
- }
-
- m = m->m_next;
- }
- return top;
-nospace:
- m_freem(top);
- MCFail++;
- return 0;
-}
-
-/*
- * Copy data from an mbuf chain starting "off" bytes from the beginning,
- * continuing for "len" bytes, into the indicated buffer.
- */
-void
-m_copydata(m, off, len, cp)
- register struct mbuf *m;
- register int off;
- register int len;
- caddr_t cp;
-{
- register unsigned count;
-
- if (off < 0 || len < 0)
- panic("m_copydata");
- while (off > 0) {
- if (m == 0)
- panic("m_copydata");
- if (off < m->m_len)
- break;
- off -= m->m_len;
- m = m->m_next;
- }
- while (len > 0) {
- if (m == 0)
- panic("m_copydata");
- count = min(m->m_len - off, len);
- bcopy(mtod(m, caddr_t) + off, cp, count);
- len -= count;
- cp += count;
- off = 0;
- m = m->m_next;
- }
-}
-
-/*
- * Concatenate mbuf chain n to m.
- * Both chains must be of the same type (e.g. MT_DATA).
- * Any m_pkthdr is not updated.
- */
-void
-m_cat(m, n)
- register struct mbuf *m, *n;
-{
- while (m->m_next)
- m = m->m_next;
- while (n) {
- if (m->m_flags & M_EXT ||
- m->m_data + m->m_len + n->m_len >= &m->m_dat[MLEN]) {
- /* just join the two chains */
- m->m_next = n;
- return;
- }
- /* splat the data from one into the other */
- bcopy(mtod(n, caddr_t), mtod(m, caddr_t) + m->m_len,
- (u_int)n->m_len);
- m->m_len += n->m_len;
- n = m_free(n);
- }
-}
-
-void
-m_adj(mp, req_len)
- struct mbuf *mp;
- int req_len;
-{
- register int len = req_len;
- register struct mbuf *m;
- register int count;
-
- if ((m = mp) == NULL)
- return;
- if (len >= 0) {
- /*
- * Trim from head.
- */
- while (m != NULL && len > 0) {
- if (m->m_len <= len) {
- len -= m->m_len;
- m->m_len = 0;
- m = m->m_next;
- } else {
- m->m_len -= len;
- m->m_data += len;
- len = 0;
- }
- }
- m = mp;
- if (mp->m_flags & M_PKTHDR)
- m->m_pkthdr.len -= (req_len - len);
- } else {
- /*
- * Trim from tail. Scan the mbuf chain,
- * calculating its length and finding the last mbuf.
- * If the adjustment only affects this mbuf, then just
- * adjust and return. Otherwise, rescan and truncate
- * after the remaining size.
- */
- len = -len;
- count = 0;
- for (;;) {
- count += m->m_len;
- if (m->m_next == (struct mbuf *)0)
- break;
- m = m->m_next;
- }
- if (m->m_len >= len) {
- m->m_len -= len;
- if (mp->m_flags & M_PKTHDR)
- mp->m_pkthdr.len -= len;
- return;
- }
- count -= len;
- if (count < 0)
- count = 0;
- /*
- * Correct length for chain is "count".
- * Find the mbuf with last data, adjust its length,
- * and toss data from remaining mbufs on chain.
- */
- m = mp;
- if (m->m_flags & M_PKTHDR)
- m->m_pkthdr.len = count;
- for (; m; m = m->m_next) {
- if (m->m_len >= count) {
- m->m_len = count;
- break;
- }
- count -= m->m_len;
- }
- while (m->m_next)
- (m = m->m_next) ->m_len = 0;
- }
-}
-
-/*
- * Rearange an mbuf chain so that len bytes are contiguous
- * and in the data area of an mbuf (so that mtod and dtom
- * will work for a structure of size len). Returns the resulting
- * mbuf chain on success, frees it and returns null on failure.
- * If there is room, it will add up to max_protohdr-len extra bytes to the
- * contiguous region in an attempt to avoid being called next time.
- */
-static int MPFail;
-
-struct mbuf *
-m_pullup(n, len)
- register struct mbuf *n;
- int len;
-{
- register struct mbuf *m;
- register int count;
- int space;
-
- /*
- * If first mbuf has no cluster, and has room for len bytes
- * without shifting current data, pullup into it,
- * otherwise allocate a new mbuf to prepend to the chain.
- */
- if ((n->m_flags & M_EXT) == 0 &&
- n->m_data + len < &n->m_dat[MLEN] && n->m_next) {
- if (n->m_len >= len)
- return (n);
- m = n;
- n = n->m_next;
- len -= m->m_len;
- } else {
- if (len > MHLEN)
- goto bad;
- MGET(m, M_DONTWAIT, n->m_type);
- if (m == 0)
- goto bad;
- m->m_len = 0;
- if (n->m_flags & M_PKTHDR) {
- M_COPY_PKTHDR(m, n);
- n->m_flags &= ~M_PKTHDR;
- }
- }
- space = &m->m_dat[MLEN] - (m->m_data + m->m_len);
- do {
- count = min(min(max(len, max_protohdr), space), n->m_len);
- bcopy(mtod(n, caddr_t), mtod(m, caddr_t) + m->m_len,
- (unsigned)count);
- len -= count;
- m->m_len += count;
- n->m_len -= count;
- space -= count;
- if (n->m_len)
- n->m_data += count;
- else
- n = m_free(n);
- } while (len > 0 && n);
- if (len > 0) {
- (void) m_free(m);
- goto bad;
- }
- m->m_next = n;
- return (m);
-bad:
- m_freem(n);
- MPFail++;
- return (0);
-}
-
-/*
- * Partition an mbuf chain in two pieces, returning the tail --
- * all but the first len0 bytes. In case of failure, it returns NULL and
- * attempts to restore the chain to its original state.
- */
-struct mbuf *
-m_split(m0, len0, wait)
- register struct mbuf *m0;
- int len0, wait;
-{
- register struct mbuf *m, *n;
- unsigned len = len0, remain;
-
- for (m = m0; m && len > m->m_len; m = m->m_next)
- len -= m->m_len;
- if (m == 0)
- return (0);
- remain = m->m_len - len;
- if (m0->m_flags & M_PKTHDR) {
- MGETHDR(n, wait, m0->m_type);
- if (n == 0)
- return (0);
- n->m_pkthdr.rcvif = m0->m_pkthdr.rcvif;
- n->m_pkthdr.len = m0->m_pkthdr.len - len0;
- m0->m_pkthdr.len = len0;
- if (m->m_flags & M_EXT)
- goto extpacket;
- if (remain > MHLEN) {
- /* m can't be the lead packet */
- MH_ALIGN(n, 0);
- n->m_next = m_split(m, len, wait);
- if (n->m_next == 0) {
- (void) m_free(n);
- return (0);
- } else
- return (n);
- } else
- MH_ALIGN(n, remain);
- } else if (remain == 0) {
- n = m->m_next;
- m->m_next = 0;
- return (n);
- } else {
- MGET(n, wait, m->m_type);
- if (n == 0)
- return (0);
- M_ALIGN(n, remain);
- }
-extpacket:
- if (m->m_flags & M_EXT) {
- n->m_flags |= M_EXT;
- n->m_ext = m->m_ext;
- if(!m->m_ext.ext_ref)
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- else
- (*(m->m_ext.ext_ref))(m->m_ext.ext_buf,
- m->m_ext.ext_size);
- m->m_ext.ext_size = 0; /* For Accounting XXXXXX danger */
- n->m_data = m->m_data + len;
- } else {
- bcopy(mtod(m, caddr_t) + len, mtod(n, caddr_t), remain);
- }
- n->m_len = remain;
- m->m_len = len;
- n->m_next = m->m_next;
- m->m_next = 0;
- return (n);
-}
-/*
- * Routine to copy from device local memory into mbufs.
- */
-struct mbuf *
-m_devget(buf, totlen, off0, ifp, copy)
- char *buf;
- int totlen, off0;
- struct ifnet *ifp;
- void (*copy) __P((char *from, caddr_t to, u_int len));
-{
- register struct mbuf *m;
- struct mbuf *top = 0, **mp = &top;
- register int off = off0, len;
- register char *cp;
- char *epkt;
-
- cp = buf;
- epkt = cp + totlen;
- if (off) {
- cp += off + 2 * sizeof(u_short);
- totlen -= 2 * sizeof(u_short);
- }
- MGETHDR(m, M_DONTWAIT, MT_DATA);
- if (m == 0)
- return (0);
- m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = totlen;
- m->m_len = MHLEN;
-
- while (totlen > 0) {
- if (top) {
- MGET(m, M_DONTWAIT, MT_DATA);
- if (m == 0) {
- m_freem(top);
- return (0);
- }
- m->m_len = MLEN;
- }
- len = min(totlen, epkt - cp);
- if (len >= MINCLSIZE) {
- MCLGET(m, M_DONTWAIT);
- if (m->m_flags & M_EXT)
- m->m_len = len = min(len, MCLBYTES);
- else
- len = m->m_len;
- } else {
- /*
- * Place initial small packet/header at end of mbuf.
- */
- if (len < m->m_len) {
- if (top == 0 && len + max_linkhdr <= m->m_len)
- m->m_data += max_linkhdr;
- m->m_len = len;
- } else
- len = m->m_len;
- }
- if (copy)
- copy(cp, mtod(m, caddr_t), (unsigned)len);
- else
- bcopy(cp, mtod(m, caddr_t), (unsigned)len);
- cp += len;
- *mp = m;
- mp = &m->m_next;
- totlen -= len;
- if (cp == epkt)
- cp = buf;
- }
- return (top);
-}
-
-/*
- * Copy data from a buffer back into the indicated mbuf chain,
- * starting "off" bytes from the beginning, extending the mbuf
- * chain if necessary.
- */
-void
-m_copyback(m0, off, len, cp)
- struct mbuf *m0;
- register int off;
- register int len;
- caddr_t cp;
-{
- register int mlen;
- register struct mbuf *m = m0, *n;
- int totlen = 0;
-
- if (m0 == 0)
- return;
- while (off > (mlen = m->m_len)) {
- off -= mlen;
- totlen += mlen;
- if (m->m_next == 0) {
- n = m_getclr(M_DONTWAIT, m->m_type);
- if (n == 0)
- goto out;
- n->m_len = min(MLEN, len + off);
- m->m_next = n;
- }
- m = m->m_next;
- }
- while (len > 0) {
- mlen = min (m->m_len - off, len);
- bcopy(cp, off + mtod(m, caddr_t), (unsigned)mlen);
- cp += mlen;
- len -= mlen;
- mlen += off;
- off = 0;
- totlen += mlen;
- if (len == 0)
- break;
- if (m->m_next == 0) {
- n = m_get(M_DONTWAIT, m->m_type);
- if (n == 0)
- break;
- n->m_len = min(MLEN, len);
- m->m_next = n;
- }
- m = m->m_next;
- }
-out: if (((m = m0)->m_flags & M_PKTHDR) && (m->m_pkthdr.len < totlen))
- m->m_pkthdr.len = totlen;
-}
diff --git a/c/src/lib/libnetworking/kern/uipc_socket.c b/c/src/lib/libnetworking/kern/uipc_socket.c
deleted file mode 100644
index 895d1c7d45..0000000000
--- a/c/src/lib/libnetworking/kern/uipc_socket.c
+++ /dev/null
@@ -1,1100 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 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.
- *
- * @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/file.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/domain.h>
-#include <sys/kernel.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/resourcevar.h>
-#include <sys/signalvar.h>
-#include <sys/sysctl.h>
-
-static int somaxconn = SOMAXCONN;
-SYSCTL_INT(_kern, KERN_SOMAXCONN, somaxconn, CTLFLAG_RW, &somaxconn, 0, "");
-
-/*
- * Socket operation routines.
- * These routines are called by the routines in
- * sys_socket.c or from a system process, and
- * implement the semantics of socket operations by
- * switching out to the protocol specific routines.
- */
-/*ARGSUSED*/
-int
-socreate(dom, aso, type, proto, p)
- int dom;
- struct socket **aso;
- register int type;
- int proto;
- struct proc *p;
-{
- register struct protosw *prp;
- register struct socket *so;
- register int error;
-
- if (proto)
- prp = pffindproto(dom, proto, type);
- else
- prp = pffindtype(dom, type);
- if (prp == 0 || prp->pr_usrreqs == 0)
- return (EPROTONOSUPPORT);
- if (prp->pr_type != type)
- return (EPROTOTYPE);
- MALLOC(so, struct socket *, sizeof(*so), M_SOCKET, M_WAIT);
- bzero((caddr_t)so, sizeof(*so));
- TAILQ_INIT(&so->so_incomp);
- TAILQ_INIT(&so->so_comp);
- so->so_type = type;
- so->so_state = SS_PRIV;
- so->so_uid = 0;
- so->so_proto = prp;
- error = (*prp->pr_usrreqs->pru_attach)(so, proto);
- if (error) {
- so->so_state |= SS_NOFDREF;
- sofree(so);
- return (error);
- }
- *aso = so;
- return (0);
-}
-
-int
-sobind(so, nam)
- struct socket *so;
- struct mbuf *nam;
-{
- int s = splnet();
- int error;
-
- error = (*so->so_proto->pr_usrreqs->pru_bind)(so, nam);
- splx(s);
- return (error);
-}
-
-int
-solisten(so, backlog)
- register struct socket *so;
- int backlog;
-{
- int s = splnet(), error;
-
- error = (*so->so_proto->pr_usrreqs->pru_listen)(so);
- if (error) {
- splx(s);
- return (error);
- }
- if (so->so_comp.tqh_first == NULL)
- so->so_options |= SO_ACCEPTCONN;
- if (backlog < 0 || backlog > somaxconn)
- backlog = somaxconn;
- so->so_qlimit = backlog;
- splx(s);
- return (0);
-}
-
-void
-sofree(so)
- register struct socket *so;
-{
- struct socket *head = so->so_head;
-
- if (so->so_pcb || (so->so_state & SS_NOFDREF) == 0)
- return;
- if (head != NULL) {
- if (so->so_state & SS_INCOMP) {
- TAILQ_REMOVE(&head->so_incomp, so, so_list);
- head->so_incqlen--;
- } else if (so->so_state & SS_COMP) {
- TAILQ_REMOVE(&head->so_comp, so, so_list);
- } else {
- panic("sofree: not queued");
- }
- head->so_qlen--;
- so->so_state &= ~(SS_INCOMP|SS_COMP);
- so->so_head = NULL;
- }
- sbrelease(&so->so_snd);
- sorflush(so);
- FREE(so, M_SOCKET);
-}
-
-/*
- * Close a socket on last file table reference removal.
- * Initiate disconnect if connected.
- * Free socket when disconnect complete.
- */
-int
-soclose(so)
- register struct socket *so;
-{
- int s = splnet(); /* conservative */
- int error = 0;
-
- if (so->so_options & SO_ACCEPTCONN) {
- struct socket *sp, *sonext;
-
- for (sp = so->so_incomp.tqh_first; sp != NULL; sp = sonext) {
- sonext = sp->so_list.tqe_next;
- (void) soabort(sp);
- }
- for (sp = so->so_comp.tqh_first; sp != NULL; sp = sonext) {
- sonext = sp->so_list.tqe_next;
- (void) soabort(sp);
- }
- }
- if (so->so_pcb == 0)
- goto discard;
- if (so->so_state & SS_ISCONNECTED) {
- if ((so->so_state & SS_ISDISCONNECTING) == 0) {
- error = sodisconnect(so);
- if (error)
- goto drop;
- }
- if (so->so_options & SO_LINGER) {
- if ((so->so_state & SS_ISDISCONNECTING) &&
- (so->so_state & SS_NBIO))
- goto drop;
- while (so->so_state & SS_ISCONNECTED) {
- soconnsleep (so);
- }
- }
- }
-drop:
- if (so->so_pcb) {
- int error2 = (*so->so_proto->pr_usrreqs->pru_detach)(so);
- if (error == 0)
- error = error2;
- }
-discard:
- if (so->so_state & SS_NOFDREF)
- panic("soclose: NOFDREF");
- so->so_state |= SS_NOFDREF;
- sofree(so);
- splx(s);
- return (error);
-}
-
-/*
- * Must be called at splnet...
- */
-int
-soabort(so)
- struct socket *so;
-{
-
- return (*so->so_proto->pr_usrreqs->pru_abort)(so);
-}
-
-int
-soaccept(so, nam)
- register struct socket *so;
- struct mbuf *nam;
-{
- int s = splnet();
- int error;
-
- if ((so->so_state & SS_NOFDREF) == 0)
- panic("soaccept: !NOFDREF");
- so->so_state &= ~SS_NOFDREF;
- error = (*so->so_proto->pr_usrreqs->pru_accept)(so, nam);
- splx(s);
- return (error);
-}
-
-int
-soconnect(so, nam)
- register struct socket *so;
- struct mbuf *nam;
-{
- int s;
- int error;
-
- if (so->so_options & SO_ACCEPTCONN)
- return (EOPNOTSUPP);
- s = splnet();
- /*
- * If protocol is connection-based, can only connect once.
- * Otherwise, if connected, try to disconnect first.
- * This allows user to disconnect by connecting to, e.g.,
- * a null address.
- */
- if (so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING) &&
- ((so->so_proto->pr_flags & PR_CONNREQUIRED) ||
- (error = sodisconnect(so))))
- error = EISCONN;
- else
- error = (*so->so_proto->pr_usrreqs->pru_connect)(so, nam);
- splx(s);
- return (error);
-}
-
-int
-soconnect2(so1, so2)
- register struct socket *so1;
- struct socket *so2;
-{
- int s = splnet();
- int error;
-
- error = (*so1->so_proto->pr_usrreqs->pru_connect2)(so1, so2);
- splx(s);
- return (error);
-}
-
-int
-sodisconnect(so)
- register struct socket *so;
-{
- int s = splnet();
- int error;
-
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- error = ENOTCONN;
- goto bad;
- }
- if (so->so_state & SS_ISDISCONNECTING) {
- error = EALREADY;
- goto bad;
- }
- error = (*so->so_proto->pr_usrreqs->pru_disconnect)(so);
-bad:
- splx(s);
- return (error);
-}
-
-#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? M_NOWAIT : M_WAITOK)
-/*
- * Send on a socket.
- * If send must go all at once and message is larger than
- * send buffering, then hard error.
- * Lock against other senders.
- * If must go all at once and not enough room now, then
- * inform user that this would block and do nothing.
- * Otherwise, if nonblocking, send as much as possible.
- * The data to be sent is described by "uio" if nonzero,
- * otherwise by the mbuf chain "top" (which must be null
- * if uio is not). Data provided in mbuf chain must be small
- * enough to send all at once.
- *
- * Returns nonzero on error, timeout or signal; callers
- * must check for short counts if EINTR/ERESTART are returned.
- * Data and control buffers are freed on return.
- */
-int
-sosend(so, addr, uio, top, control, flags)
- register struct socket *so;
- struct mbuf *addr;
- struct uio *uio;
- struct mbuf *top;
- struct mbuf *control;
- int flags;
-{
- struct mbuf **mp;
- register struct mbuf *m;
- register long space, len, resid;
- int clen = 0, error, s, dontroute, mlen;
- int atomic = sosendallatonce(so) || top;
-
- if (uio)
- resid = uio->uio_resid;
- else
- resid = top->m_pkthdr.len;
- /*
- * In theory resid should be unsigned.
- * However, space must be signed, as it might be less than 0
- * if we over-committed, and we must use a signed comparison
- * of space and resid. On the other hand, a negative resid
- * causes us to loop sending 0-length segments to the protocol.
- *
- * Also check to make sure that MSG_EOR isn't used on SOCK_STREAM
- * type sockets since that's an error.
- */
- if ((resid < 0) || (so->so_type == SOCK_STREAM && (flags & MSG_EOR))) {
- error = EINVAL;
- goto out;
- }
-
- dontroute =
- (flags & MSG_DONTROUTE) && (so->so_options & SO_DONTROUTE) == 0 &&
- (so->so_proto->pr_flags & PR_ATOMIC);
- if (control)
- clen = control->m_len;
-#define snderr(errno) { error = errno; splx(s); goto release; }
-
-restart:
- error = sblock(&so->so_snd, SBLOCKWAIT(flags));
- if (error)
- goto out;
- do {
- s = splnet();
- if (so->so_state & SS_CANTSENDMORE)
- snderr(EPIPE);
- if (so->so_error) {
- error = so->so_error;
- so->so_error = 0;
- splx(s);
- goto release;
- }
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- /*
- * `sendto' and `sendmsg' is allowed on a connection-
- * based socket if it supports implied connect.
- * Return ENOTCONN if not connected and no address is
- * supplied.
- */
- if ((so->so_proto->pr_flags & PR_CONNREQUIRED) &&
- (so->so_proto->pr_flags & PR_IMPLOPCL) == 0) {
- if ((so->so_state & SS_ISCONFIRMING) == 0 &&
- !(resid == 0 && clen != 0))
- snderr(ENOTCONN);
- } else if (addr == 0)
- snderr(so->so_proto->pr_flags & PR_CONNREQUIRED ?
- ENOTCONN : EDESTADDRREQ);
- }
- space = sbspace(&so->so_snd);
- if (flags & MSG_OOB)
- space += 1024;
- if ((atomic && resid > so->so_snd.sb_hiwat) ||
- clen > so->so_snd.sb_hiwat)
- snderr(EMSGSIZE);
- if (space < resid + clen && uio &&
- (atomic || space < so->so_snd.sb_lowat || space < clen)) {
- if (so->so_state & SS_NBIO)
- snderr(EWOULDBLOCK);
- sbunlock(&so->so_snd);
- error = sbwait(&so->so_snd);
- splx(s);
- if (error)
- goto out;
- goto restart;
- }
- splx(s);
- mp = &top;
- space -= clen;
- do {
- if (uio == NULL) {
- /*
- * Data is prepackaged in "top".
- */
- resid = 0;
- if (flags & MSG_EOR)
- top->m_flags |= M_EOR;
- } else do {
- if (top == 0) {
- MGETHDR(m, M_WAIT, MT_DATA);
- mlen = MHLEN;
- m->m_pkthdr.len = 0;
- m->m_pkthdr.rcvif = (struct ifnet *)0;
- } else {
- MGET(m, M_WAIT, MT_DATA);
- mlen = MLEN;
- }
- if (resid >= MINCLSIZE) {
- MCLGET(m, M_WAIT);
- if ((m->m_flags & M_EXT) == 0)
- goto nopages;
- mlen = MCLBYTES;
- len = min(min(mlen, resid), space);
- } else {
-nopages:
- len = min(min(mlen, resid), space);
- /*
- * For datagram protocols, leave room
- * for protocol headers in first mbuf.
- */
- if (atomic && top == 0 && len < mlen)
- MH_ALIGN(m, len);
- }
- space -= len;
- error = uiomove(mtod(m, caddr_t), (int)len, uio);
- resid = uio->uio_resid;
- m->m_len = len;
- *mp = m;
- top->m_pkthdr.len += len;
- if (error)
- goto release;
- mp = &m->m_next;
- if (resid <= 0) {
- if (flags & MSG_EOR)
- top->m_flags |= M_EOR;
- break;
- }
- } while (space > 0 && atomic);
- if (dontroute)
- so->so_options |= SO_DONTROUTE;
- s = splnet(); /* XXX */
- error = (*so->so_proto->pr_usrreqs->pru_send)(so,
- (flags & MSG_OOB) ? PRUS_OOB :
- /*
- * If the user set MSG_EOF, the protocol
- * understands this flag and nothing left to
- * send then use PRU_SEND_EOF instead of PRU_SEND.
- */
- ((flags & MSG_EOF) &&
- (so->so_proto->pr_flags & PR_IMPLOPCL) &&
- (resid <= 0)) ?
- PRUS_EOF : 0,
- top, addr, control);
- splx(s);
- if (dontroute)
- so->so_options &= ~SO_DONTROUTE;
- clen = 0;
- control = 0;
- top = 0;
- mp = &top;
- if (error)
- goto release;
- } while (resid && space > 0);
- } while (resid);
-
-release:
- sbunlock(&so->so_snd);
-out:
- if (top)
- m_freem(top);
- if (control)
- m_freem(control);
- return (error);
-}
-
-/*
- * Implement receive operations on a socket.
- * We depend on the way that records are added to the sockbuf
- * by sbappend*. In particular, each record (mbufs linked through m_next)
- * must begin with an address if the protocol so specifies,
- * followed by an optional mbuf or mbufs containing ancillary data,
- * and then zero or more mbufs of data.
- * In order to avoid blocking network interrupts for the entire time here,
- * we splx() while doing the actual copy to user space.
- * Although the sockbuf is locked, new data may still be appended,
- * and thus we must maintain consistency of the sockbuf during that time.
- *
- * The caller may receive the data as a single mbuf chain by supplying
- * an mbuf **mp0 for use in returning the chain. The uio is then used
- * only for the count in uio_resid.
- */
-int
-soreceive(so, paddr, uio, mp0, controlp, flagsp)
- register struct socket *so;
- struct mbuf **paddr;
- struct uio *uio;
- struct mbuf **mp0;
- struct mbuf **controlp;
- int *flagsp;
-{
- register struct mbuf *m, **mp;
- register int flags, len, error, s, offset;
- struct protosw *pr = so->so_proto;
- struct mbuf *nextrecord;
- int moff, type = 0;
- int orig_resid = uio->uio_resid;
-
- mp = mp0;
- if (paddr)
- *paddr = 0;
- if (controlp)
- *controlp = 0;
- if (flagsp)
- flags = *flagsp &~ MSG_EOR;
- else
- flags = 0;
- if (flags & MSG_OOB) {
- m = m_get(M_WAIT, MT_DATA);
- error = (*pr->pr_usrreqs->pru_rcvoob)(so, m, flags & MSG_PEEK);
- if (error)
- goto bad;
- do {
- error = uiomove(mtod(m, caddr_t),
- (int) min(uio->uio_resid, m->m_len), uio);
- m = m_free(m);
- } while (uio->uio_resid && error == 0 && m);
-bad:
- if (m)
- m_freem(m);
- return (error);
- }
- if (mp)
- *mp = (struct mbuf *)0;
- if (so->so_state & SS_ISCONFIRMING && uio->uio_resid)
- (*pr->pr_usrreqs->pru_rcvd)(so, 0);
-
-restart:
- error = sblock(&so->so_rcv, SBLOCKWAIT(flags));
- if (error)
- return (error);
- s = splnet();
-
- m = so->so_rcv.sb_mb;
- /*
- * If we have less data than requested, block awaiting more
- * (subject to any timeout) if:
- * 1. the current count is less than the low water mark, or
- * 2. MSG_WAITALL is set, and it is possible to do the entire
- * receive operation at once if we block (resid <= hiwat).
- * 3. MSG_DONTWAIT is not set
- * If MSG_WAITALL is set but resid is larger than the receive buffer,
- * we have to do the receive in sections, and thus risk returning
- * a short count if a timeout or signal occurs after we start.
- */
- if (m == 0 || (((flags & MSG_DONTWAIT) == 0 &&
- so->so_rcv.sb_cc < uio->uio_resid) &&
- (so->so_rcv.sb_cc < so->so_rcv.sb_lowat ||
- ((flags & MSG_WAITALL) && uio->uio_resid <= so->so_rcv.sb_hiwat)) &&
- m->m_nextpkt == 0 && (pr->pr_flags & PR_ATOMIC) == 0)) {
-#ifdef DIAGNOSTIC
- if (m == 0 && so->so_rcv.sb_cc)
- panic("receive 1");
-#endif
- if (so->so_error) {
- if (m)
- goto dontblock;
- error = so->so_error;
- if ((flags & MSG_PEEK) == 0)
- so->so_error = 0;
- goto release;
- }
- if (so->so_state & SS_CANTRCVMORE) {
- if (m)
- goto dontblock;
- else
- goto release;
- }
- for (; m; m = m->m_next)
- if (m->m_type == MT_OOBDATA || (m->m_flags & M_EOR)) {
- m = so->so_rcv.sb_mb;
- goto dontblock;
- }
- if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 &&
- (so->so_proto->pr_flags & PR_CONNREQUIRED)) {
- error = ENOTCONN;
- goto release;
- }
- if (uio->uio_resid == 0)
- goto release;
- if ((so->so_state & SS_NBIO) || (flags & MSG_DONTWAIT)) {
- error = EWOULDBLOCK;
- goto release;
- }
- sbunlock(&so->so_rcv);
- error = sbwait(&so->so_rcv);
- splx(s);
- if (error)
- return (error);
- goto restart;
- }
-dontblock:
- nextrecord = m->m_nextpkt;
- if (pr->pr_flags & PR_ADDR) {
-#ifdef DIAGNOSTIC
- if (m->m_type != MT_SONAME)
- panic("receive 1a");
-#endif
- orig_resid = 0;
- if (flags & MSG_PEEK) {
- if (paddr)
- *paddr = m_copy(m, 0, m->m_len);
- m = m->m_next;
- } else {
- sbfree(&so->so_rcv, m);
- if (paddr) {
- *paddr = m;
- so->so_rcv.sb_mb = m->m_next;
- m->m_next = 0;
- m = so->so_rcv.sb_mb;
- } else {
- MFREE(m, so->so_rcv.sb_mb);
- m = so->so_rcv.sb_mb;
- }
- }
- }
- while (m && m->m_type == MT_CONTROL && error == 0) {
- if (flags & MSG_PEEK) {
- if (controlp)
- *controlp = m_copy(m, 0, m->m_len);
- m = m->m_next;
- } else {
- sbfree(&so->so_rcv, m);
- if (controlp) {
- if (pr->pr_domain->dom_externalize &&
- mtod(m, struct cmsghdr *)->cmsg_type ==
- SCM_RIGHTS)
- error = (*pr->pr_domain->dom_externalize)(m);
- *controlp = m;
- so->so_rcv.sb_mb = m->m_next;
- m->m_next = 0;
- m = so->so_rcv.sb_mb;
- } else {
- MFREE(m, so->so_rcv.sb_mb);
- m = so->so_rcv.sb_mb;
- }
- }
- if (controlp) {
- orig_resid = 0;
- controlp = &(*controlp)->m_next;
- }
- }
- if (m) {
- if ((flags & MSG_PEEK) == 0)
- m->m_nextpkt = nextrecord;
- type = m->m_type;
- if (type == MT_OOBDATA)
- flags |= MSG_OOB;
- }
- moff = 0;
- offset = 0;
- while (m && uio->uio_resid > 0 && error == 0) {
- if (m->m_type == MT_OOBDATA) {
- if (type != MT_OOBDATA)
- break;
- } else if (type == MT_OOBDATA)
- break;
-#ifdef DIAGNOSTIC
- else if (m->m_type != MT_DATA && m->m_type != MT_HEADER)
- panic("receive 3");
-#endif
- so->so_state &= ~SS_RCVATMARK;
- len = uio->uio_resid;
- if (so->so_oobmark && len > so->so_oobmark - offset)
- len = so->so_oobmark - offset;
- if (len > m->m_len - moff)
- len = m->m_len - moff;
- /*
- * If mp is set, just pass back the mbufs.
- * Otherwise copy them out via the uio, then free.
- * Sockbuf must be consistent here (points to current mbuf,
- * it points to next record) when we drop priority;
- * we must note any additions to the sockbuf when we
- * block interrupts again.
- */
- if (mp == 0) {
- splx(s);
- error = uiomove(mtod(m, caddr_t) + moff, (int)len, uio);
- s = splnet();
- if (error)
- goto release;
- } else
- uio->uio_resid -= len;
- if (len == m->m_len - moff) {
- if (m->m_flags & M_EOR)
- flags |= MSG_EOR;
- if (flags & MSG_PEEK) {
- m = m->m_next;
- moff = 0;
- } else {
- nextrecord = m->m_nextpkt;
- sbfree(&so->so_rcv, m);
- if (mp) {
- *mp = m;
- mp = &m->m_next;
- so->so_rcv.sb_mb = m = m->m_next;
- *mp = (struct mbuf *)0;
- } else {
- MFREE(m, so->so_rcv.sb_mb);
- m = so->so_rcv.sb_mb;
- }
- if (m)
- m->m_nextpkt = nextrecord;
- }
- } else {
- if (flags & MSG_PEEK)
- moff += len;
- else {
- if (mp)
- *mp = m_copym(m, 0, len, M_WAIT);
- m->m_data += len;
- m->m_len -= len;
- so->so_rcv.sb_cc -= len;
- }
- }
- if (so->so_oobmark) {
- if ((flags & MSG_PEEK) == 0) {
- so->so_oobmark -= len;
- if (so->so_oobmark == 0) {
- so->so_state |= SS_RCVATMARK;
- break;
- }
- } else {
- offset += len;
- if (offset == so->so_oobmark)
- break;
- }
- }
- if (flags & MSG_EOR)
- break;
- /*
- * If the MSG_WAITALL flag is set (for non-atomic socket),
- * we must not quit until "uio->uio_resid == 0" or an error
- * termination. If a signal/timeout occurs, return
- * with a short count but without error.
- * Keep sockbuf locked against other readers.
- */
- while (flags & MSG_WAITALL && m == 0 && uio->uio_resid > 0 &&
- !sosendallatonce(so) && !nextrecord) {
- if (so->so_error || so->so_state & SS_CANTRCVMORE)
- break;
- error = sbwait(&so->so_rcv);
- if (error) {
- sbunlock(&so->so_rcv);
- splx(s);
- return (0);
- }
- m = so->so_rcv.sb_mb;
- if (m)
- nextrecord = m->m_nextpkt;
- }
- }
-
- if (m && pr->pr_flags & PR_ATOMIC) {
- flags |= MSG_TRUNC;
- if ((flags & MSG_PEEK) == 0)
- (void) sbdroprecord(&so->so_rcv);
- }
- if ((flags & MSG_PEEK) == 0) {
- if (m == 0)
- so->so_rcv.sb_mb = nextrecord;
- if (pr->pr_flags & PR_WANTRCVD && so->so_pcb)
- (*pr->pr_usrreqs->pru_rcvd)(so, flags);
- }
- if (orig_resid == uio->uio_resid && orig_resid &&
- (flags & MSG_EOR) == 0 && (so->so_state & SS_CANTRCVMORE) == 0) {
- sbunlock(&so->so_rcv);
- splx(s);
- goto restart;
- }
-
- if (flagsp)
- *flagsp |= flags;
-release:
- sbunlock(&so->so_rcv);
- splx(s);
- return (error);
-}
-
-int
-soshutdown(so, how)
- register struct socket *so;
- register int how;
-{
- register struct protosw *pr = so->so_proto;
-
- how++;
- if (how & FREAD)
- sorflush(so);
- if (how & FWRITE)
- return ((*pr->pr_usrreqs->pru_shutdown)(so));
- return (0);
-}
-
-void
-sorflush(so)
- register struct socket *so;
-{
- register struct sockbuf *sb = &so->so_rcv;
- register struct protosw *pr = so->so_proto;
- register int s;
- struct sockbuf asb;
-
- sb->sb_flags |= SB_NOINTR;
- (void) sblock(sb, M_WAITOK);
- s = splimp();
- socantrcvmore(so);
- sbunlock(sb);
- asb = *sb;
- bzero((caddr_t)sb, sizeof (*sb));
- splx(s);
- if (pr->pr_flags & PR_RIGHTS && pr->pr_domain->dom_dispose)
- (*pr->pr_domain->dom_dispose)(asb.sb_mb);
- sbrelease(&asb);
-}
-
-int
-sosetopt(so, level, optname, m0)
- register struct socket *so;
- int level, optname;
- struct mbuf *m0;
-{
- int error = 0;
- register struct mbuf *m = m0;
-
- if (level != SOL_SOCKET) {
- if (so->so_proto && so->so_proto->pr_ctloutput)
- return ((*so->so_proto->pr_ctloutput)
- (PRCO_SETOPT, so, level, optname, &m0));
- error = ENOPROTOOPT;
- } else {
- switch (optname) {
-
- case SO_LINGER:
- if (m == NULL || m->m_len != sizeof (struct linger)) {
- error = EINVAL;
- goto bad;
- }
- so->so_linger = mtod(m, struct linger *)->l_linger;
- /* fall thru... */
-
- case SO_DEBUG:
- case SO_KEEPALIVE:
- case SO_DONTROUTE:
- case SO_USELOOPBACK:
- case SO_BROADCAST:
- case SO_REUSEADDR:
- case SO_REUSEPORT:
- case SO_OOBINLINE:
- case SO_TIMESTAMP:
- if (m == NULL || m->m_len < sizeof (int)) {
- error = EINVAL;
- goto bad;
- }
- if (*mtod(m, int *))
- so->so_options |= optname;
- else
- so->so_options &= ~optname;
- break;
-
- case SO_SNDBUF:
- case SO_RCVBUF:
- case SO_SNDLOWAT:
- case SO_RCVLOWAT:
- {
- int optval;
-
- if (m == NULL || m->m_len < sizeof (int)) {
- error = EINVAL;
- goto bad;
- }
-
- /*
- * Values < 1 make no sense for any of these
- * options, so disallow them.
- */
- optval = *mtod(m, int *);
- if (optval < 1) {
- error = EINVAL;
- goto bad;
- }
-
- switch (optname) {
-
- case SO_SNDBUF:
- case SO_RCVBUF:
- if (sbreserve(optname == SO_SNDBUF ?
- &so->so_snd : &so->so_rcv,
- (u_long) optval) == 0) {
- error = ENOBUFS;
- goto bad;
- }
- break;
-
- /*
- * Make sure the low-water is never greater than
- * the high-water.
- */
- case SO_SNDLOWAT:
- so->so_snd.sb_lowat =
- (optval > so->so_snd.sb_hiwat) ?
- so->so_snd.sb_hiwat : optval;
- break;
- case SO_RCVLOWAT:
- so->so_rcv.sb_lowat =
- (optval > so->so_rcv.sb_hiwat) ?
- so->so_rcv.sb_hiwat : optval;
- break;
- }
- break;
- }
-
- case SO_SNDTIMEO:
- case SO_RCVTIMEO:
- {
- struct timeval *tv;
- short val;
-
- if (m == NULL || m->m_len < sizeof (*tv)) {
- error = EINVAL;
- goto bad;
- }
- tv = mtod(m, struct timeval *);
- if (tv->tv_sec > SHRT_MAX / hz - hz) {
- error = EDOM;
- goto bad;
- }
- val = tv->tv_sec * hz + tv->tv_usec / tick;
-
- switch (optname) {
-
- case SO_SNDTIMEO:
- so->so_snd.sb_timeo = val;
- break;
- case SO_RCVTIMEO:
- so->so_rcv.sb_timeo = val;
- break;
- }
- break;
- }
-
- case SO_PRIVSTATE:
- /* we don't care what the parameter is... */
- so->so_state &= ~SS_PRIV;
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- if (error == 0 && so->so_proto && so->so_proto->pr_ctloutput) {
- (void) ((*so->so_proto->pr_ctloutput)
- (PRCO_SETOPT, so, level, optname, &m0));
- m = NULL; /* freed by protocol */
- }
- }
-bad:
- if (m)
- (void) m_free(m);
- return (error);
-}
-
-int
-sogetopt(so, level, optname, mp)
- register struct socket *so;
- int level, optname;
- struct mbuf **mp;
-{
- register struct mbuf *m;
-
- if (level != SOL_SOCKET) {
- if (so->so_proto && so->so_proto->pr_ctloutput) {
- return ((*so->so_proto->pr_ctloutput)
- (PRCO_GETOPT, so, level, optname, mp));
- } else
- return (ENOPROTOOPT);
- } else {
- m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof (int);
-
- switch (optname) {
-
- case SO_LINGER:
- m->m_len = sizeof (struct linger);
- mtod(m, struct linger *)->l_onoff =
- so->so_options & SO_LINGER;
- mtod(m, struct linger *)->l_linger = so->so_linger;
- break;
-
- case SO_USELOOPBACK:
- case SO_DONTROUTE:
- case SO_DEBUG:
- case SO_KEEPALIVE:
- case SO_REUSEADDR:
- case SO_REUSEPORT:
- case SO_BROADCAST:
- case SO_OOBINLINE:
- case SO_TIMESTAMP:
- *mtod(m, int *) = so->so_options & optname;
- break;
-
- case SO_PRIVSTATE:
- *mtod(m, int *) = so->so_state & SS_PRIV;
- break;
-
- case SO_TYPE:
- *mtod(m, int *) = so->so_type;
- break;
-
- case SO_ERROR:
- *mtod(m, int *) = so->so_error;
- so->so_error = 0;
- break;
-
- case SO_SNDBUF:
- *mtod(m, int *) = so->so_snd.sb_hiwat;
- break;
-
- case SO_RCVBUF:
- *mtod(m, int *) = so->so_rcv.sb_hiwat;
- break;
-
- case SO_SNDLOWAT:
- *mtod(m, int *) = so->so_snd.sb_lowat;
- break;
-
- case SO_RCVLOWAT:
- *mtod(m, int *) = so->so_rcv.sb_lowat;
- break;
-
- case SO_SNDTIMEO:
- case SO_RCVTIMEO:
- {
- int val = (optname == SO_SNDTIMEO ?
- so->so_snd.sb_timeo : so->so_rcv.sb_timeo);
-
- m->m_len = sizeof(struct timeval);
- mtod(m, struct timeval *)->tv_sec = val / hz;
- mtod(m, struct timeval *)->tv_usec =
- (val % hz) * tick;
- break;
- }
-
- default:
- (void)m_free(m);
- return (ENOPROTOOPT);
- }
- *mp = m;
- return (0);
- }
-}
-
-void
-sohasoutofband(so)
- register struct socket *so;
-{
-#if 0 /* FIXME: For now we just ignore out of band data */
- struct proc *p;
-
- if (so->so_pgid < 0)
- gsignal(-so->so_pgid, SIGURG);
- else if (so->so_pgid > 0 && (p = pfind(so->so_pgid)) != 0)
- psignal(p, SIGURG);
- selwakeup(&so->so_rcv.sb_sel);
-#endif
-}
diff --git a/c/src/lib/libnetworking/kern/uipc_socket2.c b/c/src/lib/libnetworking/kern/uipc_socket2.c
deleted file mode 100644
index 0539d2c5f3..0000000000
--- a/c/src/lib/libnetworking/kern/uipc_socket2.c
+++ /dev/null
@@ -1,965 +0,0 @@
-/*
- * This file has undergone several changes to reflect the
- * differences between the RTEMS and FreeBSD kernels.
- */
-
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 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.
- *
- * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
-#include <sys/file.h>
-#include <sys/buf.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/signalvar.h>
-#include <sys/sysctl.h>
-
-/*
- * Primitive routines for operating on sockets and socket buffers
- */
-
-u_long sb_max = SB_MAX; /* XXX should be static */
-SYSCTL_INT(_kern, KERN_MAXSOCKBUF, maxsockbuf, CTLFLAG_RW, &sb_max, 0, "")
-
-static u_long sb_efficiency = 8; /* parameter for sbreserve() */
-SYSCTL_INT(_kern, OID_AUTO, sockbuf_waste_factor, CTLFLAG_RW, &sb_efficiency,
- 0, "");
-
-/*
- * Procedures to manipulate state flags of socket
- * and do appropriate wakeups. Normal sequence from the
- * active (originating) side is that soisconnecting() is
- * called during processing of connect() call,
- * resulting in an eventual call to soisconnected() if/when the
- * connection is established. When the connection is torn down
- * soisdisconnecting() is called during processing of disconnect() call,
- * and soisdisconnected() is called when the connection to the peer
- * is totally severed. The semantics of these routines are such that
- * connectionless protocols can call soisconnected() and soisdisconnected()
- * only, bypassing the in-progress calls when setting up a ``connection''
- * takes no time.
- *
- * From the passive side, a socket is created with
- * two queues of sockets: so_q0 for connections in progress
- * and so_q for connections already made and awaiting user acceptance.
- * As a protocol is preparing incoming connections, it creates a socket
- * structure queued on so_q0 by calling sonewconn(). When the connection
- * is established, soisconnected() is called, and transfers the
- * socket structure to so_q, making it available to accept().
- *
- * If a socket is closed with sockets on either
- * so_q0 or so_q, these sockets are dropped.
- *
- * If higher level protocols are implemented in
- * the kernel, the wakeups done here will sometimes
- * cause software-interrupt process scheduling.
- */
-
-void
-soisconnecting(so)
- register struct socket *so;
-{
-
- so->so_state &= ~(SS_ISCONNECTED|SS_ISDISCONNECTING);
- so->so_state |= SS_ISCONNECTING;
-}
-
-void
-soisconnected(so)
- register struct socket *so;
-{
- register struct socket *head = so->so_head;
-
- so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING);
- so->so_state |= SS_ISCONNECTED;
- if (head && (so->so_state & SS_INCOMP)) {
- TAILQ_REMOVE(&head->so_incomp, so, so_list);
- head->so_incqlen--;
- so->so_state &= ~SS_INCOMP;
- TAILQ_INSERT_TAIL(&head->so_comp, so, so_list);
- so->so_state |= SS_COMP;
- sorwakeup(head);
- soconnwakeup(head);
- } else {
- soconnwakeup(so);
- sorwakeup(so);
- sowwakeup(so);
- }
-}
-
-void
-soisdisconnecting(so)
- register struct socket *so;
-{
-
- so->so_state &= ~SS_ISCONNECTING;
- so->so_state |= (SS_ISDISCONNECTING|SS_CANTRCVMORE|SS_CANTSENDMORE);
- soconnwakeup(so);
- sowwakeup(so);
- sorwakeup(so);
-}
-
-void
-soisdisconnected(so)
- register struct socket *so;
-{
-
- so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
- so->so_state |= (SS_CANTRCVMORE|SS_CANTSENDMORE);
- soconnwakeup(so);
- sowwakeup(so);
- sorwakeup(so);
-}
-
-/*
- * Return a random connection that hasn't been serviced yet and
- * is eligible for discard. There is a one in qlen chance that
- * we will return a null, saying that there are no dropable
- * requests. In this case, the protocol specific code should drop
- * the new request. This insures fairness.
- *
- * This may be used in conjunction with protocol specific queue
- * congestion routines.
- */
-struct socket *
-sodropablereq(head)
- register struct socket *head;
-{
- register struct socket *so;
- unsigned int i, j, qlen, m;
-
- static int rnd;
- static long old_mono_secs;
- static unsigned int cur_cnt, old_cnt;
-
- if ((i = (m = rtems_bsdnet_seconds_since_boot()) - old_mono_secs) != 0) {
- old_mono_secs = m;
- old_cnt = cur_cnt / i;
- cur_cnt = 0;
- }
-
- so = TAILQ_FIRST(&head->so_incomp);
- if (!so)
- return (so);
-
- qlen = head->so_incqlen;
- if (++cur_cnt > qlen || old_cnt > qlen) {
- rnd = (314159 * rnd + 66329) & 0xffff;
- j = ((qlen + 1) * rnd) >> 16;
-
- while (j-- && so)
- so = TAILQ_NEXT(so, so_list);
- }
-
- return (so);
-}
-
-/*
- * When an attempt at a new connection is noted on a socket
- * which accepts connections, sonewconn is called. If the
- * connection is possible (subject to space constraints, etc.)
- * then we allocate a new structure, propoerly linked into the
- * data structure of the original socket, and return this.
- * Connstatus may be 0, or SO_ISCONFIRMING, or SO_ISCONNECTED.
- *
- * Currently, sonewconn() is defined as sonewconn1() in socketvar.h
- * to catch calls that are missing the (new) second parameter.
- */
-struct socket *
-sonewconn1(head, connstatus)
- register struct socket *head;
- int connstatus;
-{
- register struct socket *so;
-
- if (head->so_qlen > 3 * head->so_qlimit / 2)
- return ((struct socket *)0);
- MALLOC(so, struct socket *, sizeof(*so), M_SOCKET, M_DONTWAIT);
- if (so == NULL)
- return ((struct socket *)0);
- bzero((caddr_t)so, sizeof(*so));
- so->so_head = head;
- so->so_type = head->so_type;
- so->so_options = head->so_options &~ SO_ACCEPTCONN;
- so->so_linger = head->so_linger;
- so->so_state = head->so_state | SS_NOFDREF;
- so->so_proto = head->so_proto;
- so->so_timeo = head->so_timeo;
- so->so_pgid = head->so_pgid;
- so->so_uid = head->so_uid;
- (void) soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat);
- if (connstatus) {
- TAILQ_INSERT_TAIL(&head->so_comp, so, so_list);
- so->so_state |= SS_COMP;
- } else {
- TAILQ_INSERT_TAIL(&head->so_incomp, so, so_list);
- so->so_state |= SS_INCOMP;
- head->so_incqlen++;
- }
- head->so_qlen++;
- if ((*so->so_proto->pr_usrreqs->pru_attach)(so, 0)) {
- if (so->so_state & SS_COMP) {
- TAILQ_REMOVE(&head->so_comp, so, so_list);
- } else {
- TAILQ_REMOVE(&head->so_incomp, so, so_list);
- head->so_incqlen--;
- }
- head->so_qlen--;
- (void) free((caddr_t)so, M_SOCKET);
- return ((struct socket *)0);
- }
- if (connstatus) {
- sorwakeup(head);
- soconnwakeup(head);
- so->so_state |= connstatus;
- }
- return (so);
-}
-
-/*
- * Socantsendmore indicates that no more data will be sent on the
- * socket; it would normally be applied to a socket when the user
- * informs the system that no more data is to be sent, by the protocol
- * code (in case PRU_SHUTDOWN). Socantrcvmore indicates that no more data
- * will be received, and will normally be applied to the socket by a
- * protocol when it detects that the peer will send no more data.
- * Data queued for reading in the socket may yet be read.
- */
-
-void
-socantsendmore(so)
- struct socket *so;
-{
-
- so->so_state |= SS_CANTSENDMORE;
- sowwakeup(so);
-}
-
-void
-socantrcvmore(so)
- struct socket *so;
-{
-
- so->so_state |= SS_CANTRCVMORE;
- sorwakeup(so);
-}
-
-/*
- * Socket buffer (struct sockbuf) utility routines.
- *
- * Each socket contains two socket buffers: one for sending data and
- * one for receiving data. Each buffer contains a queue of mbufs,
- * information about the number of mbufs and amount of data in the
- * queue, and other fields allowing select() statements and notification
- * on data availability to be implemented.
- *
- * Data stored in a socket buffer is maintained as a list of records.
- * Each record is a list of mbufs chained together with the m_next
- * field. Records are chained together with the m_nextpkt field. The upper
- * level routine soreceive() expects the following conventions to be
- * observed when placing information in the receive buffer:
- *
- * 1. If the protocol requires each message be preceded by the sender's
- * name, then a record containing that name must be present before
- * any associated data (mbuf's must be of type MT_SONAME).
- * 2. If the protocol supports the exchange of ``access rights'' (really
- * just additional data associated with the message), and there are
- * ``rights'' to be received, then a record containing this data
- * should be present (mbuf's must be of type MT_RIGHTS).
- * 3. If a name or rights record exists, then it must be followed by
- * a data record, perhaps of zero length.
- *
- * Before using a new socket structure it is first necessary to reserve
- * buffer space to the socket, by calling sbreserve(). This should commit
- * some of the available buffer space in the system buffer pool for the
- * socket (currently, it does nothing but enforce limits). The space
- * should be released by calling sbrelease() when the socket is destroyed.
- */
-
-int
-soreserve(so, sndcc, rcvcc)
- register struct socket *so;
- u_long sndcc, rcvcc;
-{
-
- if (sbreserve(&so->so_snd, sndcc) == 0)
- goto bad;
- if (sbreserve(&so->so_rcv, rcvcc) == 0)
- goto bad2;
- if (so->so_rcv.sb_lowat == 0)
- so->so_rcv.sb_lowat = 1;
- if (so->so_snd.sb_lowat == 0)
- so->so_snd.sb_lowat = MCLBYTES;
- if (so->so_snd.sb_lowat > so->so_snd.sb_hiwat)
- so->so_snd.sb_lowat = so->so_snd.sb_hiwat;
- return (0);
-bad2:
- sbrelease(&so->so_snd);
-bad:
- return (ENOBUFS);
-}
-
-/*
- * Allot mbufs to a sockbuf.
- * Attempt to scale mbmax so that mbcnt doesn't become limiting
- * if buffering efficiency is near the normal case.
- */
-int
-sbreserve(sb, cc)
- struct sockbuf *sb;
- u_long cc;
-{
-
- if (cc > sb_max * MCLBYTES / (MSIZE + MCLBYTES))
- return (0);
- sb->sb_hiwat = cc;
- sb->sb_mbmax = min(cc * sb_efficiency, sb_max);
- if (sb->sb_lowat > sb->sb_hiwat)
- sb->sb_lowat = sb->sb_hiwat;
- return (1);
-}
-
-/*
- * Free mbufs held by a socket, and reserved mbuf space.
- */
-void
-sbrelease(sb)
- struct sockbuf *sb;
-{
-
- sbflush(sb);
- sb->sb_hiwat = sb->sb_mbmax = 0;
-}
-
-/*
- * Routines to add and remove
- * data from an mbuf queue.
- *
- * The routines sbappend() or sbappendrecord() are normally called to
- * append new mbufs to a socket buffer, after checking that adequate
- * space is available, comparing the function sbspace() with the amount
- * of data to be added. sbappendrecord() differs from sbappend() in
- * that data supplied is treated as the beginning of a new record.
- * To place a sender's address, optional access rights, and data in a
- * socket receive buffer, sbappendaddr() should be used. To place
- * access rights and data in a socket receive buffer, sbappendrights()
- * should be used. In either case, the new data begins a new record.
- * Note that unlike sbappend() and sbappendrecord(), these routines check
- * for the caller that there will be enough space to store the data.
- * Each fails if there is not enough space, or if it cannot find mbufs
- * to store additional information in.
- *
- * Reliable protocols may use the socket send buffer to hold data
- * awaiting acknowledgement. Data is normally copied from a socket
- * send buffer in a protocol with m_copy for output to a peer,
- * and then removing the data from the socket buffer with sbdrop()
- * or sbdroprecord() when the data is acknowledged by the peer.
- */
-
-/*
- * Append mbuf chain m to the last record in the
- * socket buffer sb. The additional space associated
- * the mbuf chain is recorded in sb. Empty mbufs are
- * discarded and mbufs are compacted where possible.
- */
-void
-sbappend(sb, m)
- struct sockbuf *sb;
- struct mbuf *m;
-{
- register struct mbuf *n;
-
- if (m == 0)
- return;
- n = sb->sb_mb;
- if (n) {
- while (n->m_nextpkt)
- n = n->m_nextpkt;
- do {
- if (n->m_flags & M_EOR) {
- sbappendrecord(sb, m); /* XXXXXX!!!! */
- return;
- }
- } while (n->m_next && (n = n->m_next));
- }
- sbcompress(sb, m, n);
-}
-
-#ifdef SOCKBUF_DEBUG
-void
-sbcheck(sb)
- register struct sockbuf *sb;
-{
- register struct mbuf *m;
- register int len = 0, mbcnt = 0;
-
- for (m = sb->sb_mb; m; m = m->m_next) {
- len += m->m_len;
- mbcnt += MSIZE;
- if (m->m_flags & M_EXT) /*XXX*/ /* pretty sure this is bogus */
- mbcnt += m->m_ext.ext_size;
- if (m->m_nextpkt)
- panic("sbcheck nextpkt");
- }
- if (len != sb->sb_cc || mbcnt != sb->sb_mbcnt) {
- printf("cc %d != %d || mbcnt %d != %d\n", len, sb->sb_cc,
- mbcnt, sb->sb_mbcnt);
- panic("sbcheck");
- }
-}
-#endif
-
-/*
- * As above, except the mbuf chain
- * begins a new record.
- */
-void
-sbappendrecord(sb, m0)
- register struct sockbuf *sb;
- register struct mbuf *m0;
-{
- register struct mbuf *m;
-
- if (m0 == 0)
- return;
- m = sb->sb_mb;
- if (m)
- while (m->m_nextpkt)
- m = m->m_nextpkt;
- /*
- * Put the first mbuf on the queue.
- * Note this permits zero length records.
- */
- sballoc(sb, m0);
- if (m)
- m->m_nextpkt = m0;
- else
- sb->sb_mb = m0;
- m = m0->m_next;
- m0->m_next = 0;
- if (m && (m0->m_flags & M_EOR)) {
- m0->m_flags &= ~M_EOR;
- m->m_flags |= M_EOR;
- }
- sbcompress(sb, m, m0);
-}
-
-/*
- * As above except that OOB data
- * is inserted at the beginning of the sockbuf,
- * but after any other OOB data.
- */
-void
-sbinsertoob(sb, m0)
- register struct sockbuf *sb;
- register struct mbuf *m0;
-{
- register struct mbuf *m;
- register struct mbuf **mp;
-
- if (m0 == 0)
- return;
- for (mp = &sb->sb_mb; *mp ; mp = &((*mp)->m_nextpkt)) {
- m = *mp;
- again:
- switch (m->m_type) {
-
- case MT_OOBDATA:
- continue; /* WANT next train */
-
- case MT_CONTROL:
- m = m->m_next;
- if (m)
- goto again; /* inspect THIS train further */
- }
- break;
- }
- /*
- * Put the first mbuf on the queue.
- * Note this permits zero length records.
- */
- sballoc(sb, m0);
- m0->m_nextpkt = *mp;
- *mp = m0;
- m = m0->m_next;
- m0->m_next = 0;
- if (m && (m0->m_flags & M_EOR)) {
- m0->m_flags &= ~M_EOR;
- m->m_flags |= M_EOR;
- }
- sbcompress(sb, m, m0);
-}
-
-/*
- * Append address and data, and optionally, control (ancillary) data
- * to the receive queue of a socket. If present,
- * m0 must include a packet header with total length.
- * Returns 0 if no space in sockbuf or insufficient mbufs.
- */
-int
-sbappendaddr(sb, asa, m0, control)
- register struct sockbuf *sb;
- struct sockaddr *asa;
- struct mbuf *m0, *control;
-{
- register struct mbuf *m, *n;
- int space = asa->sa_len;
-
-if (m0 && (m0->m_flags & M_PKTHDR) == 0)
-panic("sbappendaddr");
- if (m0)
- space += m0->m_pkthdr.len;
- for (n = control; n; n = n->m_next) {
- space += n->m_len;
- if (n->m_next == 0) /* keep pointer to last control buf */
- break;
- }
- if (space > sbspace(sb))
- return (0);
- if (asa->sa_len > MLEN)
- return (0);
- MGET(m, M_DONTWAIT, MT_SONAME);
- if (m == 0)
- return (0);
- m->m_len = asa->sa_len;
- bcopy((caddr_t)asa, mtod(m, caddr_t), asa->sa_len);
- if (n)
- n->m_next = m0; /* concatenate data to control */
- else
- control = m0;
- m->m_next = control;
- for (n = m; n; n = n->m_next)
- sballoc(sb, n);
- n = sb->sb_mb;
- if (n) {
- while (n->m_nextpkt)
- n = n->m_nextpkt;
- n->m_nextpkt = m;
- } else
- sb->sb_mb = m;
- return (1);
-}
-
-int
-sbappendcontrol(sb, m0, control)
- struct sockbuf *sb;
- struct mbuf *control, *m0;
-{
- register struct mbuf *m, *n;
- int space = 0;
-
- if (control == 0)
- panic("sbappendcontrol");
- for (m = control; ; m = m->m_next) {
- space += m->m_len;
- if (m->m_next == 0)
- break;
- }
- n = m; /* save pointer to last control buffer */
- for (m = m0; m; m = m->m_next)
- space += m->m_len;
- if (space > sbspace(sb))
- return (0);
- n->m_next = m0; /* concatenate data to control */
- for (m = control; m; m = m->m_next)
- sballoc(sb, m);
- n = sb->sb_mb;
- if (n) {
- while (n->m_nextpkt)
- n = n->m_nextpkt;
- n->m_nextpkt = control;
- } else
- sb->sb_mb = control;
- return (1);
-}
-
-/*
- * Compress mbuf chain m into the socket
- * buffer sb following mbuf n. If n
- * is null, the buffer is presumed empty.
- */
-void
-sbcompress(sb, m, n)
- register struct sockbuf *sb;
- register struct mbuf *m, *n;
-{
- register int eor = 0;
- register struct mbuf *o;
-
- while (m) {
- eor |= m->m_flags & M_EOR;
- if (m->m_len == 0 &&
- (eor == 0 ||
- (((o = m->m_next) || (o = n)) &&
- o->m_type == m->m_type))) {
- m = m_free(m);
- continue;
- }
- if (n && (n->m_flags & (M_EXT | M_EOR)) == 0 &&
- (n->m_data + n->m_len + m->m_len) < &n->m_dat[MLEN] &&
- n->m_type == m->m_type) {
- bcopy(mtod(m, caddr_t), mtod(n, caddr_t) + n->m_len,
- (unsigned)m->m_len);
- n->m_len += m->m_len;
- sb->sb_cc += m->m_len;
- m = m_free(m);
- continue;
- }
- if (n)
- n->m_next = m;
- else
- sb->sb_mb = m;
- sballoc(sb, m);
- n = m;
- m->m_flags &= ~M_EOR;
- m = m->m_next;
- n->m_next = 0;
- }
- if (eor) {
- if (n)
- n->m_flags |= eor;
- else
- printf("semi-panic: sbcompress\n");
- }
-}
-
-/*
- * Free all mbufs in a sockbuf.
- * Check that all resources are reclaimed.
- */
-void
-sbflush(sb)
- register struct sockbuf *sb;
-{
-
- if (sb->sb_flags & SB_LOCK)
- panic("sbflush");
- while (sb->sb_mbcnt)
- sbdrop(sb, (int)sb->sb_cc);
- if (sb->sb_cc || sb->sb_mb)
- panic("sbflush 2");
-}
-
-/*
- * Drop data from (the front of) a sockbuf.
- */
-void
-sbdrop(sb, len)
- register struct sockbuf *sb;
- register int len;
-{
- register struct mbuf *m, *mn;
- struct mbuf *next;
-
- next = (m = sb->sb_mb) ? m->m_nextpkt : 0;
- while (len > 0) {
- if (m == 0) {
- if (next == 0)
- panic("sbdrop");
- m = next;
- next = m->m_nextpkt;
- continue;
- }
- if (m->m_len > len) {
- m->m_len -= len;
- m->m_data += len;
- sb->sb_cc -= len;
- break;
- }
- len -= m->m_len;
- sbfree(sb, m);
- MFREE(m, mn);
- m = mn;
- }
- while (m && m->m_len == 0) {
- sbfree(sb, m);
- MFREE(m, mn);
- m = mn;
- }
- if (m) {
- sb->sb_mb = m;
- m->m_nextpkt = next;
- } else
- sb->sb_mb = next;
-}
-
-/*
- * Drop a record off the front of a sockbuf
- * and move the next record to the front.
- */
-void
-sbdroprecord(sb)
- register struct sockbuf *sb;
-{
- register struct mbuf *m, *mn;
-
- m = sb->sb_mb;
- if (m) {
- sb->sb_mb = m->m_nextpkt;
- do {
- sbfree(sb, m);
- MFREE(m, mn);
- m = mn;
- } while (m);
- }
-}
-
-/*
- * Create a "control" mbuf containing the specified data
- * with the specified type for presentation on a socket buffer.
- */
-struct mbuf *
-sbcreatecontrol(p, size, type, level)
- caddr_t p;
- register int size;
- int type, level;
-{
- register struct cmsghdr *cp;
- struct mbuf *m;
-
- if ((m = m_get(M_DONTWAIT, MT_CONTROL)) == NULL)
- return ((struct mbuf *) NULL);
- cp = mtod(m, struct cmsghdr *);
- /* XXX check size? */
- (void)memcpy(CMSG_DATA(cp), p, size);
- size += sizeof(*cp);
- m->m_len = size;
- cp->cmsg_len = size;
- cp->cmsg_level = level;
- cp->cmsg_type = type;
- return (m);
-}
-
-#ifdef PRU_OLDSTYLE
-/*
- * The following routines mediate between the old-style `pr_usrreq'
- * protocol implementations and the new-style `struct pr_usrreqs'
- * calling convention.
- */
-
-/* syntactic sugar */
-#define nomb (struct mbuf *)0
-
-static int
-old_abort(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_ABORT, nomb, nomb, nomb);
-}
-
-static int
-old_accept(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_ACCEPT, nomb, nam, nomb);
-}
-
-static int
-old_attach(struct socket *so, int proto)
-{
- return so->so_proto->pr_ousrreq(so, PRU_ATTACH, nomb,
- (struct mbuf *)proto, /* XXX */
- nomb);
-}
-
-static int
-old_bind(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_BIND, nomb, nam, nomb);
-}
-
-static int
-old_connect(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_CONNECT, nomb, nam, nomb);
-}
-
-static int
-old_connect2(struct socket *so1, struct socket *so2)
-{
- return so1->so_proto->pr_ousrreq(so1, PRU_CONNECT2, nomb,
- (struct mbuf *)so2, nomb);
-}
-
-static int
-old_control(struct socket *so, int cmd, caddr_t data, struct ifnet *ifp)
-{
- return so->so_proto->pr_ousrreq(so, PRU_CONTROL, (struct mbuf *)cmd,
- (struct mbuf *)data,
- (struct mbuf *)ifp);
-}
-
-static int
-old_detach(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_DETACH, nomb, nomb, nomb);
-}
-
-static int
-old_disconnect(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_DISCONNECT, nomb, nomb, nomb);
-}
-
-static int
-old_listen(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_LISTEN, nomb, nomb, nomb);
-}
-
-static int
-old_peeraddr(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_PEERADDR, nomb, nam, nomb);
-}
-
-static int
-old_rcvd(struct socket *so, int flags)
-{
- return so->so_proto->pr_ousrreq(so, PRU_RCVD, nomb,
- (struct mbuf *)flags, /* XXX */
- nomb);
-}
-
-static int
-old_rcvoob(struct socket *so, struct mbuf *m, int flags)
-{
- return so->so_proto->pr_ousrreq(so, PRU_RCVOOB, m,
- (struct mbuf *)flags, /* XXX */
- nomb);
-}
-
-static int
-old_send(struct socket *so, int flags, struct mbuf *m, struct mbuf *addr,
- struct mbuf *control)
-{
- int req;
-
- if (flags & PRUS_OOB) {
- req = PRU_SENDOOB;
- } else if(flags & PRUS_EOF) {
- req = PRU_SEND_EOF;
- } else {
- req = PRU_SEND;
- }
- return so->so_proto->pr_ousrreq(so, req, m, addr, control);
-}
-
-static int
-old_sense(struct socket *so, struct stat *sb)
-{
- return so->so_proto->pr_ousrreq(so, PRU_SENSE, (struct mbuf *)sb,
- nomb, nomb);
-}
-
-static int
-old_shutdown(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_SHUTDOWN, nomb, nomb, nomb);
-}
-
-static int
-old_sockaddr(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_SOCKADDR, nomb, nam, nomb);
-}
-
-struct pr_usrreqs pru_oldstyle = {
- old_abort, old_accept, old_attach, old_bind, old_connect,
- old_connect2, old_control, old_detach, old_disconnect,
- old_listen, old_peeraddr, old_rcvd, old_rcvoob, old_send,
- old_sense, old_shutdown, old_sockaddr
-};
-
-#endif /* PRU_OLDSTYLE */
-
-/*
- * Some routines that return EOPNOTSUPP for entry points that are not
- * supported by a protocol. Fill in as needed.
- */
-int
-pru_accept_notsupp(struct socket *so, struct mbuf *nam)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_connect2_notsupp(struct socket *so1, struct socket *so2)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_control_notsupp(struct socket *so, int cmd, caddr_t data,
- struct ifnet *ifp)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_listen_notsupp(struct socket *so)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_rcvd_notsupp(struct socket *so, int flags)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_rcvoob_notsupp(struct socket *so, struct mbuf *m, int flags)
-{
- return EOPNOTSUPP;
-}
-
-/*
- * This isn't really a ``null'' operation, but it's the default one
- * and doesn't do anything destructive.
- */
-int
-pru_sense_null(struct socket *so, struct stat *sb)
-{
- sb->st_blksize = so->so_snd.sb_hiwat;
- return 0;
-}
-
diff --git a/c/src/lib/libnetworking/lib/Makefile.in b/c/src/lib/libnetworking/lib/Makefile.in
deleted file mode 100644
index 869818fadf..0000000000
--- a/c/src/lib/libnetworking/lib/Makefile.in
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=lib.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES=getprotoby syslog tftpDriver
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -DNOPOLL -DNOSELECT
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
diff --git a/c/src/lib/libnetworking/lib/README b/c/src/lib/libnetworking/lib/README
deleted file mode 100644
index 998bd5e708..0000000000
--- a/c/src/lib/libnetworking/lib/README
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# $Id$
-#
-
-Sources from application-level (as opposed to kernel-level) libraries.
diff --git a/c/src/lib/libnetworking/lib/getprotoby.c b/c/src/lib/libnetworking/lib/getprotoby.c
deleted file mode 100644
index fc8de6e402..0000000000
--- a/c/src/lib/libnetworking/lib/getprotoby.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * $Id$
- */
-
-#include <netdb.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-static const struct protoent prototab[] = {
- { "ip", NULL, IPPROTO_IP },
- { "icmp", NULL, IPPROTO_ICMP },
- { "tcp", NULL, IPPROTO_TCP },
- { "udp", NULL, IPPROTO_UDP },
- };
-
-/*
- * Dummy version of BSD getprotobyname()
- */
-struct protoent *
-getprotobyname (const char *name)
-{
- int i;
-
- for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
- if (strcmp (name, prototab[i].p_name) == 0)
- return (struct protoent *) &prototab[i];
- }
- return NULL;
-}
-
-/*
- * Dummy version of BSD getprotobynumber()
- */
-struct protoent *
-getprotobynumber (int proto)
-{
- int i;
-
- for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
- if (proto == prototab[i].p_proto)
- return (struct protoent *) &prototab[i];
- }
- return NULL;
-}
diff --git a/c/src/lib/libnetworking/lib/syslog.c b/c/src/lib/libnetworking/lib/syslog.c
deleted file mode 100644
index 0bb15bc78e..0000000000
--- a/c/src/lib/libnetworking/lib/syslog.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * RTEMS version of syslog and associated routines
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <syslog.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include <unistd.h>
-
-static int LogStatus = LOG_CONS;
-static const char *LogTag = "syslog";
-static int LogFacility = LOG_USER;
-static int LogMask = 0xff;
-
-static int LogFd = -1;
-static rtems_id LogSemaphore;
-extern struct in_addr rtems_bsdnet_log_host_address;
-
-#define SYSLOG_PORT 514
-
-void
-syslog (int pri, const char *fmt, ...)
-{
- va_list ap;
-
- va_start (ap, fmt);
- vsyslog (pri, fmt, ap);
- va_end (ap);
-}
-
-/*
- * FIXME: Should cbuf be static? It could be if we put the mutex
- * around the entire body of this routine. Then we wouldn't
- * have to worry about blowing stacks with a local variable
- * that large. Could make cbuf bigger, too.
- */
-void
-vsyslog (int pri, const char *fmt, va_list ap)
-{
- int cnt;
- char *cp;
- char *msgp, cbuf[200];
- int sent;
-
- if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) {
- syslog (LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID,
- "syslog: unknown facility/priority: %#x", pri);
- pri &= LOG_PRIMASK|LOG_FACMASK;
- }
-
- if (!LOG_MASK(LOG_PRI(pri)) & LogMask)
- return;
-
- if ((pri & LOG_FACMASK) == 0)
- pri |= LogFacility;
-
- cnt = sprintf (cbuf, "<%d>", pri);
- cp = msgp = cbuf + cnt;
- if (LogTag) {
- const char *lp = LogTag;
- while ((*cp = *lp++) != '\0')
- cp++;
- }
- if (LogStatus & LOG_PID) {
- rtems_id tid;
- rtems_task_ident (RTEMS_SELF, 0, &tid);
- cnt = sprintf (cp, "[%#lx]", (unsigned long)tid);
- cp += cnt;
- }
- if (LogTag) {
- *cp++ = ':';
- *cp++ = ' ';
- }
- cnt = vsprintf (cp, fmt, ap);
- cnt += cp - cbuf;
- if (cbuf[cnt-1] == '\n')
- cbuf[--cnt] = '\0';
-
- if (LogStatus & LOG_PERROR)
- printf ("%s\n", cbuf);
-
- /*
- * Grab the mutex
- */
- sent = 0;
- if ((rtems_bsdnet_log_host_address.s_addr != INADDR_ANY)
- && (LogFd >= 0)
- && (rtems_semaphore_obtain (LogSemaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT) == RTEMS_SUCCESSFUL)) {
- /*
- * Set the destination address/port
- */
- struct sockaddr_in farAddress;
- farAddress.sin_family = AF_INET;
- farAddress.sin_port = htons (SYSLOG_PORT);
- farAddress.sin_addr = rtems_bsdnet_log_host_address;
- memset (farAddress.sin_zero, '\0', sizeof farAddress.sin_zero);
-
- /*
- * Send the message
- */
- if (sendto (LogFd, cbuf, cnt, 0, (struct sockaddr *)&farAddress, sizeof farAddress) >= 0)
- sent = 1;
- rtems_semaphore_release (LogSemaphore);
- }
- if (!sent && (LogStatus & LOG_CONS) && !(LogStatus & LOG_PERROR))
- printf ("%s\n", msgp);
-}
-
-void
-openlog (const char *ident, int logstat, int logfac)
-{
- rtems_status_code sc;
- struct sockaddr_in myAddress;
-
- if (ident != NULL)
- LogTag = ident;
- LogStatus = logstat;
- if (logfac != 0 && (logfac & ~LOG_FACMASK) == 0)
- LogFacility = logfac;
-
- /*
- * Create the socket
- */
- if ((LogFd = socket (AF_INET, SOCK_DGRAM, 0)) < 0) {
- printf ("Can't create syslog socket: %d\n", errno);
- return;
- }
-
- /*
- * Bind socket to name
- */
- myAddress.sin_family = AF_INET;
- myAddress.sin_addr.s_addr = INADDR_ANY;
- myAddress.sin_port = 0;
- memset (myAddress.sin_zero, '\0', sizeof myAddress.sin_zero);
- if (bind (LogFd, (struct sockaddr *)&myAddress, sizeof (myAddress)) < 0) {
- close (LogFd);
- LogFd = -1;
- printf ("Can't bind syslog socket: %d\n", errno);
- return;
- }
-
- /*
- * Create the mutex
- */
- sc = rtems_semaphore_create (rtems_build_name('s', 'L', 'o', 'g'),
- 1,
- RTEMS_PRIORITY |
- RTEMS_BINARY_SEMAPHORE |
- RTEMS_INHERIT_PRIORITY |
- RTEMS_NO_PRIORITY_CEILING |
- RTEMS_LOCAL,
- 0,
- &LogSemaphore);
- if (sc != RTEMS_SUCCESSFUL) {
- printf ("Can't create syslog seamphore: %d\n", sc);
- close (LogFd);
- LogFd = -1;
- }
-}
-
-void
-closelog(void)
-{
- if (LogFd >= 0) {
- close (LogFd);
- LogFd = -1;
- rtems_semaphore_delete (LogSemaphore);
- }
-}
-
-int
-setlogmask (int pmask)
-{
- int omask;
-
- omask = LogMask;
- if (pmask != 0)
- LogMask = pmask;
- return (omask);
-}
diff --git a/c/src/lib/libnetworking/lib/tftpDriver.c b/c/src/lib/libnetworking/lib/tftpDriver.c
deleted file mode 100644
index cf75623580..0000000000
--- a/c/src/lib/libnetworking/lib/tftpDriver.c
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
- * Trivial File Transfer Protocol (RFC 1350)
- *
- * Transfer file to/from remote host
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-#include <stdio.h>
-#include <errno.h>
-#include <malloc.h>
-#include <string.h>
-#include <unistd.h>
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/rtems_bsdnet.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Range of UDP ports to try
- */
-#define UDP_PORT_BASE 3180
-
-/*
- * Pathname prefix
- */
-#define TFTP_PATHNAME_PREFIX "/TFTP/"
-
-/*
- * Default limits
- */
-#define PACKET_REPLY_MILLISECONDS 6000
-#define OPEN_RETRY_LIMIT 10
-#define IO_RETRY_LIMIT 10
-
-/*
- * TFTP opcodes
- */
-#define TFTP_OPCODE_RRQ 1
-#define TFTP_OPCODE_WRQ 2
-#define TFTP_OPCODE_DATA 3
-#define TFTP_OPCODE_ACK 4
-#define TFTP_OPCODE_ERROR 5
-
-/*
- * Largest data transfer
- */
-#define TFTP_BUFSIZE 512
-
-/*
- * Packets transferred between machines
- */
-union tftpPacket {
- /*
- * RRQ/WRQ packet
- */
- struct tftpRWRQ {
- rtems_unsigned16 opcode;
- char filename_mode[TFTP_BUFSIZE];
- } tftpRWRQ;
-
- /*
- * DATA packet
- */
- struct tftpDATA {
- rtems_unsigned16 opcode;
- rtems_unsigned16 blocknum;
- rtems_unsigned8 data[TFTP_BUFSIZE];
- } tftpDATA;
-
- /*
- * ACK packet
- */
- struct tftpACK {
- rtems_unsigned16 opcode;
- rtems_unsigned16 blocknum;
- } tftpACK;
-
- /*
- * ERROR packet
- */
- struct tftpERROR {
- rtems_unsigned16 opcode;
- rtems_unsigned16 errorCode;
- char errorMessage[TFTP_BUFSIZE];
- } tftpERROR;
-};
-
-/*
- * State of each TFTP stream
- */
-struct tftpStream {
- /*
- * Buffer for storing most recently-received packet
- */
- union tftpPacket pkbuf;
-
- /*
- * Last block number received
- */
- rtems_unsigned16 blocknum;
-
- /*
- * Data transfer socket
- */
- int socket;
- struct sockaddr_in myAddress;
- struct sockaddr_in farAddress;
-
- /*
- * Indices into buffer
- */
- int nleft;
- int nused;
-
- /*
- * Flags
- */
- int firstReply;
- int eof;
-};
-
-/*
- * Number of streams open at the same time
- */
-static rtems_id tftp_mutex;
-static int nStreams;
-static struct tftpStream ** volatile tftpStreams;
-
-/*
- * Initialize the TFTP driver
- */
-rtems_device_driver rtems_tftp_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_status_code sc;
-
- sc = rtems_semaphore_create (rtems_build_name('T', 'F', 'T', 'P'),
- 1,
- RTEMS_FIFO |
- RTEMS_BINARY_SEMAPHORE |
- RTEMS_NO_INHERIT_PRIORITY |
- RTEMS_NO_PRIORITY_CEILING |
- RTEMS_LOCAL,
- 0,
- &tftp_mutex);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- rtems_io_register_name (TFTP_PATHNAME_PREFIX, major, minor);
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Set error message
- * This RTEMS/UNIX error mapping needs to be fixed!
- */
-static void
-tftpSetErrno (struct tftpStream *tp)
-{
- unsigned int tftpError;
- static const int errorMap[] = {
- 0,
- ENOENT,
- EPERM,
- ENOSPC,
- EINVAL,
- ENXIO,
- EEXIST,
- ESRCH,
- 0,
- };
-
- tftpError = ntohs (tp->pkbuf.tftpERROR.errorCode);
- if (tftpError < (sizeof errorMap / sizeof errorMap[0]))
- errno = errorMap[tftpError];
- else
- errno = 1000 + tftpError;
-}
-
-/*
- * Send a message to make the other end shut up
- */
-static void
-sendStifle (struct tftpStream *tp, struct sockaddr_in *to)
-{
- int len;
-
- /*
- * Create the error packet (Unknown transfer ID).
- */
- tp->pkbuf.tftpERROR.opcode = htons (TFTP_OPCODE_ERROR);
- tp->pkbuf.tftpERROR.errorCode = htons (5);
- len = sizeof tp->pkbuf.tftpERROR.opcode +
- sizeof tp->pkbuf.tftpERROR.errorCode + 1;
- len += sprintf (tp->pkbuf.tftpERROR.errorMessage, "GO AWAY");
-
- /*
- * Send it
- */
- sendto (tp->socket, (char *)&tp->pkbuf, len, 0,
- (struct sockaddr *)to, sizeof *to);
-}
-
-/*
- * Wait for a data packet
- */
-static int
-getPacket (struct tftpStream *tp)
-{
- int len;
- struct timeval tv;
-
- tv.tv_sec = 6;
- tv.tv_usec = 0;
- setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
- for (;;) {
- union {
- struct sockaddr s;
- struct sockaddr_in i;
- } from;
- int fromlen = sizeof from;
- len = recvfrom (tp->socket, (char *)&tp->pkbuf,
- sizeof tp->pkbuf, 0,
- &from.s, &fromlen);
- if (len < 0)
- break;
- if (from.i.sin_addr.s_addr == tp->farAddress.sin_addr.s_addr) {
- if (tp->firstReply) {
- tp->firstReply = 0;
- tp->farAddress.sin_port = from.i.sin_port;
- }
- if (tp->farAddress.sin_port == from.i.sin_port)
- break;
- }
-
- /*
- * Packet is from someone with whom we are
- * not interested. Tell them to go away.
- */
- sendStifle (tp, &from.i);
- }
- tv.tv_sec = 0;
- setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
- return len;
-}
-
-/*
- * Send an acknowledgement
- */
-static int
-sendAck (struct tftpStream *tp)
-{
- /*
- * Create the acknowledgement
- */
- tp->pkbuf.tftpACK.opcode = htons (TFTP_OPCODE_ACK);
- tp->pkbuf.tftpACK.blocknum = htons (tp->blocknum);
-
- /*
- * Send it
- */
- if (sendto (tp->socket, (char *)&tp->pkbuf, sizeof tp->pkbuf.tftpACK, 0,
- (struct sockaddr *)&tp->farAddress,
- sizeof tp->farAddress) < 0)
- return errno;
- return 0;
-}
-
-/*
- * Release a stream and clear the pointer to it
- */
-static void
-releaseStream (int s)
-{
- rtems_semaphore_obtain (tftp_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- free (tftpStreams[s]);
- tftpStreams[s] = NULL;
- rtems_semaphore_release (tftp_mutex);
-}
-
-/*
- * Open a TFTP stream
- */
-rtems_device_driver rtems_tftp_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_open_close_args_t *ap = pargp;
- struct tftpStream *tp;
- int retryCount;
- rtems_unsigned32 farAddress;
- int s;
- int len;
- char *cp1, *cp2;
- char *remoteFilename;
- rtems_interval now;
- rtems_status_code sc;
-
- /*
- * Read-only for now
- */
- if (ap->flags & LIBIO_FLAGS_WRITE)
- return RTEMS_NOT_IMPLEMENTED;
-
- /*
- * Pick apart the name into a host:pathname pair
- */
- if (strlen (ap->iop->pathname) <= strlen (TFTP_PATHNAME_PREFIX))
- return RTEMS_INVALID_NAME;
- cp2 = ap->iop->pathname + strlen (TFTP_PATHNAME_PREFIX);
- if (*cp2 == '/') {
- farAddress = rtems_bsdnet_bootp_server_address.s_addr;
- }
- else {
- char *hostname;
-
- cp1 = cp2;
- while (*cp2 != '/') {
- if (*cp2 == '\0')
- return RTEMS_INVALID_NAME;
- cp2++;
- }
- len = cp2 - cp1;
- hostname = malloc (len + 1);
- if (hostname == NULL)
- return RTEMS_NO_MEMORY;
- strncpy (hostname, cp1, len);
- hostname[len] = '\0';
- farAddress = inet_addr (hostname);
- free (hostname);
- }
- if ((farAddress == 0) || (farAddress == ~0))
- return RTEMS_INVALID_NAME;
- if (*++cp2 == '\0')
- return RTEMS_INVALID_NAME;
- remoteFilename = cp2;
- if (strlen (remoteFilename) > (TFTP_BUFSIZE - 10))
- return RTEMS_INVALID_NAME;
-
- /*
- * Find a free stream
- */
- sc = rtems_semaphore_obtain (tftp_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- for (s = 0 ; s < nStreams ; s++) {
- if (tftpStreams[s] == NULL)
- break;
- }
- if (s == nStreams) {
- /*
- * Reallocate stream pointers
- * Guard against the case where realloc() returns NULL.
- */
- struct tftpStream **np;
-
- np = realloc (tftpStreams, ++nStreams * sizeof *tftpStreams);
- if (np == NULL) {
- rtems_semaphore_release (tftp_mutex);
- return RTEMS_NO_MEMORY;
- }
- tftpStreams = np;
- }
- tp = tftpStreams[s] = malloc (sizeof (struct tftpStream));
- rtems_semaphore_release (tftp_mutex);
- if (tp == NULL)
- return RTEMS_NO_MEMORY;
- ap->iop->data0 = s;
- ap->iop->data1 = tp;
-
- /*
- * Create the socket
- */
- if ((tp->socket = socket (AF_INET, SOCK_DGRAM, 0)) < 0) {
- releaseStream (s);
- return RTEMS_TOO_MANY;
- }
-
- /*
- * Bind the socket to a local address
- */
- retryCount = 0;
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- for (;;) {
- int try = (now + retryCount) % 10;
-
- tp->myAddress.sin_family = AF_INET;
- tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try + minor);
- tp->myAddress.sin_addr.s_addr = htonl (INADDR_ANY);
- if (bind (tp->socket, (struct sockaddr *)&tp->myAddress, sizeof tp->myAddress) >= 0)
- break;
- if (++retryCount == 10) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_RESOURCE_IN_USE;
- }
- }
-
- /*
- * Set the UDP destination to the TFTP server
- * port on the remote machine.
- */
- tp->farAddress.sin_family = AF_INET;
- tp->farAddress.sin_addr.s_addr = farAddress;
- tp->farAddress.sin_port = htons (69);
-
- /*
- * Start the transfer
- */
- tp->firstReply = 1;
- for (;;) {
- /*
- * Create the request
- */
- tp->pkbuf.tftpRWRQ.opcode = htons (TFTP_OPCODE_RRQ);
- cp1 = tp->pkbuf.tftpRWRQ.filename_mode;
- cp2 = remoteFilename;
- while ((*cp1++ = *cp2++) != '\0')
- continue;
- cp2 = "octet";
- while ((*cp1++ = *cp2++) != '\0')
- continue;
- len = cp1 - (char *)&tp->pkbuf.tftpRWRQ;
-
- /*
- * Send the request
- */
- if (sendto (tp->socket, (char *)&tp->pkbuf, len, 0,
- (struct sockaddr *)&tp->farAddress,
- sizeof tp->farAddress) < 0) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_UNSATISFIED;
- }
-
- /*
- * Get reply
- */
- len = getPacket (tp);
- if (len >= (int) sizeof tp->pkbuf.tftpACK) {
- int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
- if ((opcode == TFTP_OPCODE_DATA)
- && (ntohs (tp->pkbuf.tftpDATA.blocknum) == 1)) {
- tp->nused = 0;
- tp->blocknum = 1;
- tp->nleft = len - 2 * sizeof (rtems_unsigned16);
- tp->eof = (tp->nleft < TFTP_BUFSIZE);
- if (sendAck (tp) != 0) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_UNSATISFIED;
- }
- break;
- }
- if (opcode == TFTP_OPCODE_ERROR) {
- tftpSetErrno (tp);
- close (tp->socket);
- releaseStream (ap->iop->data0);
- return RTEMS_INTERNAL_ERROR;
- }
- }
-
- /*
- * Keep trying
- */
- if (++retryCount >= OPEN_RETRY_LIMIT) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_UNSATISFIED;
- }
- }
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Read from a TFTP stream
- */
-rtems_device_driver rtems_tftp_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_rw_args_t *ap = pargp;
- char *bp;
- struct tftpStream *tp;
- int retryCount;
- int nwant;
-
- tp = ap->iop->data1;
-
- /*
- * Read till user request is satisfied or EOF is reached
- */
- bp = ap->buffer;
- nwant = ap->count;
- while (nwant) {
- if (tp->nleft) {
- int count;
- if (nwant < tp->nleft)
- count = nwant;
- else
- count = tp->nleft;
- memcpy (bp, &tp->pkbuf.tftpDATA.data[tp->nused], count);
- tp->nused += count;
- tp->nleft -= count;
- bp += count;
- nwant -= count;
- if (nwant == 0)
- break;
- }
- if (tp->eof)
- break;
-
- /*
- * Wait for the next packet
- */
- retryCount = 0;
- for (;;) {
- int len = getPacket (tp);
- if (len >= (int)sizeof tp->pkbuf.tftpACK) {
- int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
- rtems_unsigned16 nextBlock = tp->blocknum + 1;
- if ((opcode == TFTP_OPCODE_DATA)
- && (ntohs (tp->pkbuf.tftpDATA.blocknum) == nextBlock)) {
- tp->nused = 0;
- tp->nleft = len - 2 * sizeof (rtems_unsigned16);
- tp->eof = (tp->nleft < TFTP_BUFSIZE);
- tp->blocknum++;
- if (sendAck (tp) != 0)
- return RTEMS_IO_ERROR;
- break;
- }
- if (opcode == TFTP_OPCODE_ERROR) {
- tftpSetErrno (tp);
- return RTEMS_INTERNAL_ERROR;
- }
- }
-
- /*
- * Keep trying?
- */
- if (++retryCount == IO_RETRY_LIMIT)
- return RTEMS_IO_ERROR;
- if (sendAck (tp) != 0)
- return RTEMS_IO_ERROR;
- }
- }
- ap->bytes_moved = ap->count - nwant;
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close a TFTP stream
- */
-rtems_device_driver rtems_tftp_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_open_close_args_t *ap = pargp;
- struct tftpStream *tp = ap->iop->data1;;
-
- if (!tp->eof && !tp->firstReply) {
- /*
- * Tell the other end to stop
- */
- rtems_interval ticksPerSecond;
- sendStifle (tp, &tp->farAddress);
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond);
- rtems_task_wake_after (1 + ticksPerSecond / 10);
- }
- close (tp->socket);
- releaseStream (ap->iop->data0);
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver rtems_tftp_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_device_driver rtems_tftp_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/lib/libnetworking/libc/Makefile.in b/c/src/lib/libnetworking/libc/Makefile.in
deleted file mode 100644
index 132c059cab..0000000000
--- a/c/src/lib/libnetworking/libc/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=lib.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES= base64 \
- gethostbydns gethostbyht gethostbynis gethostnamadr \
- herror \
- inet_addr inet_ntoa inet_ntop inet_pton \
- map_v4v6 \
- nsap_addr ns_name ns_netint ns_parse ns_print ns_ttl \
- res_comp res_data res_debug res_init res_mkquery res_mkupdate \
- res_query res_send res_stubs res_update \
- strsep
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -DNOPOLL -DNOSELECT
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
diff --git a/c/src/lib/libnetworking/libc/addr2ascii.3 b/c/src/lib/libnetworking/libc/addr2ascii.3
deleted file mode 100644
index 10c839ea74..0000000000
--- a/c/src/lib/libnetworking/libc/addr2ascii.3
+++ /dev/null
@@ -1,217 +0,0 @@
-.\"
-.\" Copyright 1996 Massachusetts Institute of Technology
-.\"
-.\" Permission to use, copy, modify, and distribute this software and
-.\" its documentation for any purpose and without fee is hereby
-.\" granted, provided that both the above copyright notice and this
-.\" permission notice appear in all copies, that both the above
-.\" copyright notice and this permission notice appear in all
-.\" supporting documentation, and that the name of M.I.T. not be used
-.\" in advertising or publicity pertaining to distribution of the
-.\" software without specific, written prior permission. M.I.T. makes
-.\" no representations about the suitability of this software for any
-.\" purpose. It is provided "as is" without express or implied
-.\" warranty.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
-.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
-.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
-.\" SHALL M.I.T. 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.
-.\"
-.\" $ANA: addr2ascii.3,v 1.1 1996/06/13 18:41:46 wollman Exp $
-.\" $Id$
-.\"
-.Dd June 13, 1996
-.Dt ADDR2ASCII 3
-.Os
-.Sh NAME
-.Nm addr2ascii ,
-.Nm ascii2addr
-.Nd Generic address formatting routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netinet/in.h>
-.Fd #include <arpa/inet.h>
-.Ft "char *"
-.Fn addr2ascii "int af" "const void *addrp" "int len" "char *buf"
-.Ft int
-.Fn ascii2addr "int af" "const char *ascii" "void *result"
-.Sh DESCRIPTION
-The routines
-.Fn addr2ascii
-and
-.Fn ascii2addr
-are used to convert network addresses between binary form and a
-printable form appropriate to the address family. Both functions take
-an
-.Fa af
-argument, specifying the address family to be used in the conversion
-process.
-(Currently, only the
-.Dv AF_INET
-and
-.Dv AF_LINK
-address families are supported.)
-.Pp
-The
-.Fn addr2ascii
-function
-is used to convert binary, network-format addresses into printable
-form. In addition to
-.Fa af ,
-there are three other arguments. The
-.Fa addrp
-argument is a pointer to the network address to be converted.
-The
-.Fa len
-argument is the length of the address. The
-.Fa buf
-argument is an optional pointer to a caller-allocated buffer to hold
-the result; if a null pointer is passed,
-.Fn addr2ascii
-uses a statically-allocated buffer.
-.Pp
-The
-.Fn ascii2addr
-function performs the inverse operation to
-.Fn addr2ascii .
-In addition to
-.Fa af ,
-it takes two parameters,
-.Fa ascii
-and
-.Fa result .
-The
-.Fa ascii
-parameter is a pointer to the string which is to be converted into
-binary. The
-.Fa result
-parameter is a pointer to an appropriate network address structure for
-the specified family.
-.Pp
-The following gives the appropriate structure to use for binary
-addresses in the specified family:
-.Pp
-.Bl -tag -width AF_INETxxxx -compact
-.It Dv AF_INET
-.Li struct in_addr
-.Pq in Aq Pa netinet/in.h
-.It Dv AF_LINK
-.Li struct sockaddr_dl
-.Pq in Aq Pa net/if_dl.h
-.\" .It Dv AF_INET6
-.\" .Li struct in6_addr
-.\" .Pq in Aq Pa netinet6/in6.h
-.El
-.Sh RETURN VALUES
-The
-.Fn addr2ascii
-function returns the address of the buffer it was passed, or a static
-buffer if the a null pointer was passed; on failure, it returns a null
-pointer.
-The
-.Fn ascii2addr
-function returns the length of the binary address in bytes, or -1 on
-failure.
-.Sh EXAMPLES
-The
-.Xr inet 3
-functions
-.Fn inet_ntoa
-and
-.Fn inet_aton
-could be implemented thusly:
-.Bd -literal -offset indent
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-char *
-inet_ntoa(struct in_addr addr)
-{
- return addr2ascii(AF_INET, &addr, sizeof addr, 0);
-}
-
-int
-inet_aton(const char *ascii, struct in_addr *addr)
-{
- return (ascii2addr(AF_INET, ascii, addr)
- == sizeof(*addr));
-}
-.Ed
-.Pp
-In actuality, this cannot be done because
-.Fn addr2ascii
-and
-.Fn ascii2addr
-are implemented in terms of the
-.Xr inet 3
-functions, rather than the other way around.
-.Sh ERRORS
-When a failure is returned,
-.Li errno
-is set to one of the following values:
-.Bl -tag -width [EPROTONOSUPPORT]
-.It Bq Er ENAMETOOLONG
-The
-.Fn addr2ascii
-routine was passed a
-.Fa len
-parameter which was inappropriate for the address family given by
-.Fa af .
-.It Bq Er EPROTONOSUPPORT
-Either routine was passed an
-.Fa af
-parameter other than
-.Dv AF_INET
-or
-.Dv AF_LINK .
-.It Bq Er EINVAL
-The string passed to
-.Fn ascii2addr
-was improperly formatted for address family
-.Fa af .
-.El
-.Sh SEE ALSO
-.Xr inet 3 ,
-.Xr linkaddr 3 ,
-.Xr inet 4
-.Sh HISTORY
-An interface close to this one was originally suggested by Craig
-Partridge. This particular interface originally appeared in the
-.Tn INRIA
-.Tn IPv6
-implementation.
-.Sh AUTHORS
-Code and documentation by
-.An Garrett A. Wollman ,
-MIT Laboratory for Computer Science.
-.Sh BUGS
-The original implementations supported IPv6. This support should
-eventually be resurrected. The
-.Tn NRL
-implementation also included support for the
-.Dv AF_ISO
-and
-.Dv AF_NS
-address families.
-.Pp
-The genericity of this interface is somewhat questionable. A truly
-generic interface would provide a means for determining the length of
-the buffer to be used so that it could be dynamically allocated, and
-would always require a
-.Dq Li "struct sockaddr"
-to hold the binary address. Unfortunately, this is incompatible with existing
-practice. This limitation means that a routine for printing network
-addresses from arbitrary address families must still have internal
-knowledge of the maximum buffer length needed and the appropriate part
-of the address to use as the binary address.
diff --git a/c/src/lib/libnetworking/libc/addr2ascii.c b/c/src/lib/libnetworking/libc/addr2ascii.c
deleted file mode 100644
index dc651743b6..0000000000
--- a/c/src/lib/libnetworking/libc/addr2ascii.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 1996 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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.
- *
- * $ANA: addr2ascii.c,v 1.1 1996/06/13 18:41:46 wollman Exp $
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <errno.h>
-#include <string.h>
-
-#include <net/if_dl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*-
- * Convert a network address from binary to printable numeric format.
- * This API is copied from INRIA's IPv6 implementation, but it is a
- * bit bogus in two ways:
- *
- * 1) There is no value in passing both an address family and
- * an address length; either one should imply the other,
- * or we should be passing sockaddrs instead.
- * 2) There should by contrast be /added/ a length for the buffer
- * that we pass in, so that programmers are spared the need to
- * manually calculate (read: ``guess'') the maximum length.
- *
- * Flash: the API is also the same in the NRL implementation, and seems to
- * be some sort of standard, so we appear to be stuck with both the bad
- * naming and the poor choice of arguments.
- */
-char *
-addr2ascii(af, addrp, len, buf)
- int af;
- const void *addrp;
- int len; /* should be size_t XXX */
- char *buf; /* XXX should pass length of buffer */
-{
- static char staticbuf[64]; /* 64 for AF_LINK > 16 for AF_INET */
-
- if (!buf)
- buf = staticbuf;
-
- switch(af) {
- case AF_INET:
- if (len != sizeof(struct in_addr)) {
- errno = ENAMETOOLONG;
- return 0;
- }
- strcpy(buf, inet_ntoa(*(const struct in_addr *)addrp));
- break;
-
- case AF_LINK:
- if (len != sizeof(struct sockaddr_dl)) {
- errno = ENAMETOOLONG;
- return 0;
- }
- strcpy(buf, link_ntoa((const struct sockaddr_dl *)addrp));
- break;
-
- default:
- errno = EPROTONOSUPPORT;
- return 0;
- }
- return buf;
-}
diff --git a/c/src/lib/libnetworking/libc/ascii2addr.c b/c/src/lib/libnetworking/libc/ascii2addr.c
deleted file mode 100644
index e140244737..0000000000
--- a/c/src/lib/libnetworking/libc/ascii2addr.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 1996 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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.
- *
- * $ANA: ascii2addr.c,v 1.2 1996/06/13 18:46:02 wollman Exp $
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <errno.h>
-#include <string.h>
-
-#include <net/if_dl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-int
-ascii2addr(af, ascii, result)
- int af;
- const char *ascii;
- void *result;
-{
- struct in_addr *ina;
- char strbuf[4*sizeof("123")]; /* long enough for V4 only */
-
- switch(af) {
- case AF_INET:
- ina = result;
- strbuf[0] = '\0';
- strncat(strbuf, ascii, (sizeof strbuf)-1);
- if (inet_aton(strbuf, ina))
- return sizeof(struct in_addr);
- errno = EINVAL;
- break;
-
- case AF_LINK:
- link_addr(ascii, result);
- /* oops... no way to detect failure */
- return sizeof(struct sockaddr_dl);
-
- default:
- errno = EPROTONOSUPPORT;
- break;
- }
-
- return -1;
-}
diff --git a/c/src/lib/libnetworking/libc/base64.c b/c/src/lib/libnetworking/libc/base64.c
deleted file mode 100644
index 3017ccc01c..0000000000
--- a/c/src/lib/libnetworking/libc/base64.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1995 by International Business Machines, Inc.
- *
- * International Business Machines, Inc. (hereinafter called IBM) grants
- * permission under its copyrights to use, copy, modify, and distribute this
- * Software with or without fee, provided that the above copyright notice and
- * all paragraphs of this notice appear in all copies, and that the name of IBM
- * not be used in connection with the marketing of any product incorporating
- * the Software or modifications thereof, without specific, written prior
- * permission.
- *
- * To the extent it has a right to do so, IBM grants an immunity from suit
- * under its patents, if any, for the use, sale or manufacture of products to
- * the extent that such products are used for performing Domain Name System
- * dynamic updates in TCP/IP networks by means of the Software. No immunity is
- * granted for any product per se or for any other function of any product.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define Assert(Cond) if (!(Cond)) abort()
-
-static const char Base64[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-static const char Pad64 = '=';
-
-/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
- The following encoding technique is taken from RFC 1521 by Borenstein
- and Freed. It is reproduced here in a slightly edited form for
- convenience.
-
- A 65-character subset of US-ASCII is used, enabling 6 bits to be
- represented per printable character. (The extra 65th character, "=",
- is used to signify a special processing function.)
-
- The encoding process represents 24-bit groups of input bits as output
- strings of 4 encoded characters. Proceeding from left to right, a
- 24-bit input group is formed by concatenating 3 8-bit input groups.
- These 24 bits are then treated as 4 concatenated 6-bit groups, each
- of which is translated into a single digit in the base64 alphabet.
-
- Each 6-bit group is used as an index into an array of 64 printable
- characters. The character referenced by the index is placed in the
- output string.
-
- Table 1: The Base64 Alphabet
-
- Value Encoding Value Encoding Value Encoding Value Encoding
- 0 A 17 R 34 i 51 z
- 1 B 18 S 35 j 52 0
- 2 C 19 T 36 k 53 1
- 3 D 20 U 37 l 54 2
- 4 E 21 V 38 m 55 3
- 5 F 22 W 39 n 56 4
- 6 G 23 X 40 o 57 5
- 7 H 24 Y 41 p 58 6
- 8 I 25 Z 42 q 59 7
- 9 J 26 a 43 r 60 8
- 10 K 27 b 44 s 61 9
- 11 L 28 c 45 t 62 +
- 12 M 29 d 46 u 63 /
- 13 N 30 e 47 v
- 14 O 31 f 48 w (pad) =
- 15 P 32 g 49 x
- 16 Q 33 h 50 y
-
- Special processing is performed if fewer than 24 bits are available
- at the end of the data being encoded. A full encoding quantum is
- always completed at the end of a quantity. When fewer than 24 input
- bits are available in an input group, zero bits are added (on the
- right) to form an integral number of 6-bit groups. Padding at the
- end of the data is performed using the '=' character.
-
- Since all base64 input is an integral number of octets, only the
- -------------------------------------------------
- following cases can arise:
-
- (1) the final quantum of encoding input is an integral
- multiple of 24 bits; here, the final unit of encoded
- output will be an integral multiple of 4 characters
- with no "=" padding,
- (2) the final quantum of encoding input is exactly 8 bits;
- here, the final unit of encoded output will be two
- characters followed by two "=" padding characters, or
- (3) the final quantum of encoding input is exactly 16 bits;
- here, the final unit of encoded output will be three
- characters followed by one "=" padding character.
- */
-
-int
-b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) {
- size_t datalength = 0;
- u_char input[3];
- u_char output[4];
- size_t i;
-
- while (2 < srclength) {
- input[0] = *src++;
- input[1] = *src++;
- input[2] = *src++;
- srclength -= 3;
-
- output[0] = input[0] >> 2;
- output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
- output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
- output[3] = input[2] & 0x3f;
- Assert(output[0] < 64);
- Assert(output[1] < 64);
- Assert(output[2] < 64);
- Assert(output[3] < 64);
-
- if (datalength + 4 > targsize)
- return (-1);
- target[datalength++] = Base64[output[0]];
- target[datalength++] = Base64[output[1]];
- target[datalength++] = Base64[output[2]];
- target[datalength++] = Base64[output[3]];
- }
-
- /* Now we worry about padding. */
- if (0 != srclength) {
- /* Get what's left. */
- input[0] = input[1] = input[2] = '\0';
- for (i = 0; i < srclength; i++)
- input[i] = *src++;
-
- output[0] = input[0] >> 2;
- output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
- output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
- Assert(output[0] < 64);
- Assert(output[1] < 64);
- Assert(output[2] < 64);
-
- if (datalength + 4 > targsize)
- return (-1);
- target[datalength++] = Base64[output[0]];
- target[datalength++] = Base64[output[1]];
- if (srclength == 1)
- target[datalength++] = Pad64;
- else
- target[datalength++] = Base64[output[2]];
- target[datalength++] = Pad64;
- }
- if (datalength >= targsize)
- return (-1);
- target[datalength] = '\0'; /* Returned value doesn't count \0. */
- return (datalength);
-}
-
-/* skips all whitespace anywhere.
- converts characters, four at a time, starting at (or after)
- src from base - 64 numbers into three 8 bit bytes in the target area.
- it returns the number of data bytes stored at the target, or -1 on error.
- */
-
-int
-b64_pton(src, target, targsize)
- char const *src;
- u_char *target;
- size_t targsize;
-{
- int tarindex, state, ch;
- char *pos;
-
- state = 0;
- tarindex = 0;
-
- while ((ch = *src++) != '\0') {
- if (isspace(ch)) /* Skip whitespace anywhere. */
- continue;
-
- if (ch == Pad64)
- break;
-
- pos = strchr(Base64, ch);
- if (pos == 0) /* A non-base64 character. */
- return (-1);
-
- switch (state) {
- case 0:
- if (target) {
- if ((size_t)tarindex >= targsize)
- return (-1);
- target[tarindex] = (pos - Base64) << 2;
- }
- state = 1;
- break;
- case 1:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize)
- return (-1);
- target[tarindex] |= (pos - Base64) >> 4;
- target[tarindex+1] = ((pos - Base64) & 0x0f)
- << 4 ;
- }
- tarindex++;
- state = 2;
- break;
- case 2:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize)
- return (-1);
- target[tarindex] |= (pos - Base64) >> 2;
- target[tarindex+1] = ((pos - Base64) & 0x03)
- << 6;
- }
- tarindex++;
- state = 3;
- break;
- case 3:
- if (target) {
- if ((size_t)tarindex >= targsize)
- return (-1);
- target[tarindex] |= (pos - Base64);
- }
- tarindex++;
- state = 0;
- break;
- default:
- abort();
- }
- }
-
- /*
- * We are done decoding Base-64 chars. Let's see if we ended
- * on a byte boundary, and/or with erroneous trailing characters.
- */
-
- if (ch == Pad64) { /* We got a pad char. */
- ch = *src++; /* Skip it, get next. */
- switch (state) {
- case 0: /* Invalid = in first position */
- case 1: /* Invalid = in second position */
- return (-1);
-
- case 2: /* Valid, means one byte of info */
- /* Skip any number of spaces. */
- for ((void)NULL; ch != '\0'; ch = *src++)
- if (!isspace(ch))
- break;
- /* Make sure there is another trailing = sign. */
- if (ch != Pad64)
- return (-1);
- ch = *src++; /* Skip the = */
- /* Fall through to "single trailing =" case. */
- /* FALLTHROUGH */
-
- case 3: /* Valid, means two bytes of info */
- /*
- * We know this char is an =. Is there anything but
- * whitespace after it?
- */
- for ((void)NULL; ch != '\0'; ch = *src++)
- if (!isspace(ch))
- return (-1);
-
- /*
- * Now make sure for cases 2 and 3 that the "extra"
- * bits that slopped past the last full byte were
- * zeros. If we don't check them, they become a
- * subliminal channel.
- */
- if (target && target[tarindex] != 0)
- return (-1);
- }
- } else {
- /*
- * We ended by seeing the end of the string. Make sure we
- * have no partial bytes lying around.
- */
- if (state != 0)
- return (-1);
- }
-
- return (tarindex);
-}
diff --git a/c/src/lib/libnetworking/libc/byteorder.3 b/c/src/lib/libnetworking/libc/byteorder.3
deleted file mode 100644
index 81bf604867..0000000000
--- a/c/src/lib/libnetworking/libc/byteorder.3
+++ /dev/null
@@ -1,77 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" @(#)byteorder.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt BYTEORDER 3
-.Os BSD 4.2
-.Sh NAME
-.Nm htonl ,
-.Nm htons ,
-.Nm ntohl ,
-.Nm ntohs
-.Nd convert values between host and network byte order
-.Sh SYNOPSIS
-.Fd #include <sys/param.h>
-.Ft u_long
-.Fn htonl "u_long hostlong"
-.Ft u_short
-.Fn htons "u_short hostshort"
-.Ft u_long
-.Fn ntohl "u_long netlong"
-.Ft u_short
-.Fn ntohs "u_short netshort"
-.Sh DESCRIPTION
-These routines convert 16 and 32 bit quantities between network
-byte order and host byte order.
-On machines which have a byte order which is the same as the network
-order, routines are defined as null macros.
-.Pp
-These routines are most often used in conjunction with Internet
-addresses and ports as returned by
-.Xr gethostbyname 3
-and
-.Xr getservent 3 .
-.Sh SEE ALSO
-.Xr gethostbyname 3 ,
-.Xr getservent 3
-.Sh HISTORY
-The
-.Nm byteorder
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-On the
-.Tn VAX
-bytes are handled backwards from most everyone else in
-the world. This is not expected to be fixed in the near future.
diff --git a/c/src/lib/libnetworking/libc/ether_addr.c b/c/src/lib/libnetworking/libc/ether_addr.c
deleted file mode 100644
index 9b7a9abf44..0000000000
--- a/c/src/lib/libnetworking/libc/ether_addr.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 1995
- * Bill Paul <wpaul@ctr.columbia.edu>. 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 Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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.
- *
- * ethernet address conversion and lookup routines
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Center for Telecommunications Research
- * Columbia University, New York City
- *
- * $Id$
- */
-
-
-#include <stdio.h>
-#include <paths.h>
-#include <sys/types.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <net/ethernet.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-#ifndef _PATH_ETHERS
-#define _PATH_ETHERS "/etc/ethers"
-#endif
-
-/*
- * Parse a string of text containing an ethernet address and hostname
- * and separate it into its component parts.
- */
-int ether_line(l, e, hostname)
- char *l;
- struct ether_addr *e;
- char *hostname;
-{
- int i, o[6];
-
- i = sscanf(l, "%x:%x:%x:%x:%x:%x %s", &o[0], &o[1], &o[2],
- &o[3], &o[4], &o[5],
- hostname);
- if (i != 7)
- return (i);
-
- for (i=0; i<6; i++)
- e->octet[i] = o[i];
- return (0);
-}
-
-/*
- * Convert an ASCII representation of an ethernet address to
- * binary form.
- */
-struct ether_addr *ether_aton(a)
- char *a;
-{
- int i;
- static struct ether_addr o;
- unsigned int o0, o1, o2, o3, o4, o5;
-
- i = sscanf(a, "%x:%x:%x:%x:%x:%x", &o0, &o1, &o2, &o3, &o4, &o5);
-
- if (i != 6)
- return (NULL);
-
- o.octet[0]=o0;
- o.octet[1]=o1;
- o.octet[2]=o2;
- o.octet[3]=o3;
- o.octet[4]=o4;
- o.octet[5]=o5;
-
- return ((struct ether_addr *)&o);
-}
-
-/*
- * Convert a binary representation of an ethernet address to
- * an ASCII string.
- */
-char *ether_ntoa(n)
- struct ether_addr *n;
-{
- int i;
- static char a[18];
-
- i = sprintf(a,"%x:%x:%x:%x:%x:%x",n->octet[0],n->octet[1],n->octet[2],
- n->octet[3],n->octet[4],n->octet[5]);
- if (i < 11)
- return (NULL);
- return ((char *)&a);
-}
-
-/*
- * Map an ethernet address to a hostname. Use either /etc/ethers or
- * NIS/YP.
- */
-
-int ether_ntohost(hostname, e)
- char *hostname;
- struct ether_addr *e;
-{
- FILE *fp;
- char buf[BUFSIZ + 2];
- struct ether_addr local_ether;
- char local_host[MAXHOSTNAMELEN];
-#ifdef YP
- char *result;
- int resultlen;
- char *ether_a;
- char *yp_domain;
-#endif
- if ((fp = fopen(_PATH_ETHERS, "r")) == NULL)
- return (1);
-
- while (fgets(buf,BUFSIZ,fp)) {
- if (buf[0] == '#')
- continue;
-#ifdef YP
- if (buf[0] == '+') {
- if (yp_get_default_domain(&yp_domain))
- continue;
- ether_a = ether_ntoa(e);
- if (yp_match(yp_domain, "ethers.byaddr", ether_a,
- strlen(ether_a), &result, &resultlen)) {
- continue;
- }
- strncpy(buf, result, resultlen);
- buf[resultlen] = '\0';
- free(result);
- }
-#endif
- if (!ether_line(buf, &local_ether, local_host)) {
- if (!bcmp((char *)&local_ether.octet[0],
- (char *)&e->octet[0], 6)) {
- /* We have a match */
- strcpy(hostname, local_host);
- fclose(fp);
- return(0);
- }
- }
- }
- fclose(fp);
- return (1);
-}
-
-/*
- * Map a hostname to an ethernet address using /etc/ethers or
- * NIS/YP.
- */
-int ether_hostton(hostname, e)
- char *hostname;
- struct ether_addr *e;
-{
- FILE *fp;
- char buf[BUFSIZ + 2];
- struct ether_addr local_ether;
- char local_host[MAXHOSTNAMELEN];
-#ifdef YP
- char *result;
- int resultlen;
- char *yp_domain;
-#endif
- if ((fp = fopen(_PATH_ETHERS, "r")) == NULL)
- return (1);
-
- while (fgets(buf,BUFSIZ,fp)) {
- if (buf[0] == '#')
- continue;
-#ifdef YP
- if (buf[0] == '+') {
- if (yp_get_default_domain(&yp_domain))
- continue;
- if (yp_match(yp_domain, "ethers.byname", hostname,
- strlen(hostname), &result, &resultlen)) {
- continue;
- }
- strncpy(buf, result, resultlen);
- buf[resultlen] = '\0';
- free(result);
- }
-#endif
- if (!ether_line(buf, &local_ether, local_host)) {
- if (!strcmp(hostname, local_host)) {
- /* We have a match */
- bcopy((char *)&local_ether.octet[0],
- (char *)&e->octet[0], 6);
- fclose(fp);
- return(0);
- }
- }
- }
- fclose(fp);
- return (1);
-}
diff --git a/c/src/lib/libnetworking/libc/ethers.3 b/c/src/lib/libnetworking/libc/ethers.3
deleted file mode 100644
index afea48320a..0000000000
--- a/c/src/lib/libnetworking/libc/ethers.3
+++ /dev/null
@@ -1,193 +0,0 @@
-.\" Copyright (c) 1995
-.\" Bill Paul <wpaul@ctr.columbia.edu>. 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 Bill Paul.
-.\" 4. Neither the name of the author nor the names of any co-contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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.
-.\"
-.\" $Id$
-.\"
-.Dd April 12, 1995
-.Dt ETHERS 3
-.Os FreeBSD 2.1
-.Sh NAME
-.Nm ethers ,
-.Nm ether_line ,
-.Nm ether_aton ,
-.Nm ether_ntoa ,
-.Nm ether_ntohost ,
-.Nm ether_hostton
-.Nd Ethernet address conversion and lookup routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/socket.h>
-.Fd #include <net/ethernet.h>
-.Ft int
-.Fn ether_line "char *l" "struct ether_addr *e" "char *hostname"
-.Ft struct ether_addr *
-.Fn ether_aton "char *a"
-.Ft char *
-.Fn ether_ntoa "struct ether_addr *n"
-.Ft int
-.Fn ether_ntohost "char *hostname" "struct ether_addr *e"
-.Ft int
-.Fn ether_hostton "char *hostname" "struct ether_addr *e"
-.Sh DESCRIPTION
-These functions operate on ethernet addresses using an
-.Ar ether_addr
-structure, which is defined in the header file
-.Aq Pa netinet/if_ether.h :
-.Bd -literal -offset indent
-/*
- * The number of bytes in an ethernet (MAC) address.
- */
-#define ETHER_ADDR_LEN 6
-
-/*
- * Structure of a 48-bit Ethernet address.
- */
-struct ether_addr {
- u_char octet[ETHER_ADDR_LEN];
-};
-.Ed
-.Pp
-The function
-.Fn ether_line
-scans
-.Ar l ,
-an
-.Tn ASCII
-string in
-.Xr ethers 5
-format and sets
-.Ar e
-to the ethernet address specified in the string and
-.Ar h
-to the hostname. This function is used to parse lines from
-.Pa /etc/ethers
-into their component parts.
-.Pp
-The
-.Fn ether_aton
-function converts an
-.Tn ASCII
-representation of an ethernet address into an
-.Ar ether_addr
-structure. Likewise,
-.Fn ether_ntoa
-converts an ethernet address specified as an
-.Ar ether_addr
-structure into an
-.Tn ASCII
-string.
-.Pp
-The
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions map ethernet addresses to their corresponding hostnames
-as specified in the
-.Pa /etc/ethers
-database.
-.Fn ether_ntohost
-converts from ethernet address to hostname, and
-.Fn ether_hostton
-converts from hostname to ethernet address.
-.Sh RETURN VALUES
-.Fn ether_line
-returns zero on success and non-zero if it was unable to parse
-any part of the supplied line
-.Ar l .
-It returns the extracted ethernet address in the supplied
-.Ar ether_addr
-structure
-.Ar e
-and the hostname in the supplied string
-.Ar h .
-.Pp
-On success,
-.Fn ether_ntoa
-returns a pointer to a string containing an
-.Tn ASCII
-representation of an ethernet address. If it is unable to convert
-the supplied
-.Ar ether_addr
-structure, it returns a
-.Dv NULL
-pointer. Likewise,
-.Fn ether_aton
-returns a pointer to an
-.Ar ether_addr
-structure on success and a
-.Dv NULL
-pointer on failure.
-.Pp
-The
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions both return zero on success or non-zero if they were
-unable to find a match in the
-.Pa /etc/ethers
-database.
-.Sh NOTES
-The user must insure that the hostname strings passed to the
-the
-.Fn ether_line ,
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions are large enough to contain the returned hostnames.
-.Sh NIS INTERACTION
-If the
-.Pa /etc/ethers
-contains a line with a single + in it, the
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions will attempt to consult the NIS
-.Pa ethers.byname
-and
-.Pa ethers.byaddr
-maps in addition to the data in the
-.Pa /etc/ethers
-file.
-.Sh SEE ALSO
-.Xr yp 4 ,
-.Xr ethers 5
-.Sh BUGS
-.Pp
-The
-.Fn ether_aton
-and
-.Fn ether_ntoa
-functions returns values that are stored in static memory areas
-which may be overwritten the next time they are called.
-.Sh HISTORY
-This particular implementation of the
-.Nm ethers
-library functions were written for and first appeared in
-.Fx 2.1 .
diff --git a/c/src/lib/libnetworking/libc/gethostbydns.c b/c/src/lib/libnetworking/libc/gethostbydns.c
deleted file mode 100644
index 3d80ffde7a..0000000000
--- a/c/src/lib/libnetworking/libc/gethostbydns.c
+++ /dev/null
@@ -1,773 +0,0 @@
-/*
- * ++Copyright++ 1985, 1988, 1993
- * -
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char fromrcsid[] = "From: Id: gethnamaddr.c,v 8.23 1998/04/07 04:59:46 vixie Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <ctype.h>
-#include <errno.h>
-#include <syslog.h>
-
-#include "res_config.h"
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-#define MAXALIASES 35
-#define MAXADDRS 35
-
-static const char AskedForGot[] =
- "gethostby*.gethostanswer: asked for \"%s\", got \"%s\"";
-
-static char *h_addr_ptrs[MAXADDRS + 1];
-
-static struct hostent host;
-static char *host_aliases[MAXALIASES];
-static char hostbuf[8*1024];
-static u_char host_addr[16]; /* IPv4 or IPv6 */
-
-#ifdef RESOLVSORT
-static void addrsort __P((char **, int));
-#endif
-
-#if PACKETSZ > 1024
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 1024
-#endif
-
-typedef union {
- HEADER hdr;
- u_char buf[MAXPACKET];
-} querybuf;
-
-typedef union {
- int32_t al;
- char ac;
-} align;
-
-extern int h_errno;
-int _dns_ttl_;
-
-#ifdef DEBUG
-static void
-dprintf(msg, num)
- char *msg;
- int num;
-{
- if (_res.options & RES_DEBUG) {
- int save = errno;
-
- printf(msg, num);
- errno = save;
- }
-}
-#else
-# define dprintf(msg, num) /*nada*/
-#endif
-
-#define BOUNDED_INCR(x) \
- do { \
- cp += x; \
- if (cp > eom) { \
- h_errno = NO_RECOVERY; \
- return (NULL); \
- } \
- } while (0)
-
-#define BOUNDS_CHECK(ptr, count) \
- do { \
- if ((ptr) + (count) > eom) { \
- h_errno = NO_RECOVERY; \
- return (NULL); \
- } \
- } while (0)
-
-static struct hostent *
-gethostanswer(answer, anslen, qname, qtype)
- const querybuf *answer;
- int anslen;
- const char *qname;
- int qtype;
-{
- register const HEADER *hp;
- register const u_char *cp;
- register int n;
- const u_char *eom, *erdata;
- char *bp, **ap, **hap;
- int type, class, buflen, ancount, qdcount;
- int haveanswer, had_error;
- int toobig = 0;
- char tbuf[MAXDNAME];
- const char *tname;
- int (*name_ok) __P((const char *));
-
- tname = qname;
- host.h_name = NULL;
- eom = answer->buf + anslen;
- switch (qtype) {
- case T_A:
- case T_AAAA:
- name_ok = res_hnok;
- break;
- case T_PTR:
- name_ok = res_dnok;
- break;
- default:
- h_errno = NO_RECOVERY;
- return (NULL); /* XXX should be abort(); */
- }
- /*
- * find first satisfactory answer
- */
- hp = &answer->hdr;
- ancount = ntohs(hp->ancount);
- qdcount = ntohs(hp->qdcount);
- bp = hostbuf;
- buflen = sizeof hostbuf;
- cp = answer->buf;
- BOUNDED_INCR(HFIXEDSZ);
- if (qdcount != 1) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !(*name_ok)(bp)) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- BOUNDED_INCR(n + QFIXEDSZ);
- if (qtype == T_A || qtype == T_AAAA) {
- /* res_send() has already verified that the query name is the
- * same as the one we sent; this just gets the expanded name
- * (i.e., with the succeeding search-domain tacked on).
- */
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- host.h_name = bp;
- bp += n;
- buflen -= n;
- /* The qname can be abbreviated, but h_name is now absolute. */
- qname = host.h_name;
- }
- ap = host_aliases;
- *ap = NULL;
- host.h_aliases = host_aliases;
- hap = h_addr_ptrs;
- *hap = NULL;
- host.h_addr_list = h_addr_ptrs;
- haveanswer = 0;
- had_error = 0;
- _dns_ttl_ = -1;
- while (ancount-- > 0 && cp < eom && !had_error) {
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !(*name_ok)(bp)) {
- had_error++;
- continue;
- }
- cp += n; /* name */
- BOUNDS_CHECK(cp, 3 * INT16SZ + INT32SZ);
- type = _getshort(cp);
- cp += INT16SZ; /* type */
- class = _getshort(cp);
- cp += INT16SZ; /* class */
- if (qtype == T_A && type == T_A)
- _dns_ttl_ = _getlong(cp);
- cp += INT32SZ; /* TTL */
- n = _getshort(cp);
- cp += INT16SZ; /* len */
- BOUNDS_CHECK(cp, n);
- erdata = cp + n;
- if (class != C_IN) {
- /* XXX - debug? syslog? */
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- if ((qtype == T_A || qtype == T_AAAA) && type == T_CNAME) {
- if (ap >= &host_aliases[MAXALIASES-1])
- continue;
- n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf);
- if ((n < 0) || !(*name_ok)(tbuf)) {
- had_error++;
- continue;
- }
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- /* Store alias. */
- *ap++ = bp;
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- had_error++;
- continue;
- }
- bp += n;
- buflen -= n;
- /* Get canonical name. */
- n = strlen(tbuf) + 1; /* for the \0 */
- if (n > buflen || n >= MAXHOSTNAMELEN) {
- had_error++;
- continue;
- }
- strcpy(bp, tbuf);
- host.h_name = bp;
- bp += n;
- buflen -= n;
- continue;
- }
- if (qtype == T_PTR && type == T_CNAME) {
- n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf);
- if (n < 0 || !res_dnok(tbuf)) {
- had_error++;
- continue;
- }
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- /* Get canonical name. */
- n = strlen(tbuf) + 1; /* for the \0 */
- if (n > buflen || n >= MAXHOSTNAMELEN) {
- had_error++;
- continue;
- }
- strcpy(bp, tbuf);
- tname = bp;
- bp += n;
- buflen -= n;
- continue;
- }
- if (type != qtype) {
- syslog(LOG_NOTICE|LOG_AUTH,
- "gethostby*.gethostanswer: asked for \"%s %s %s\", got type \"%s\"",
- qname, p_class(C_IN), p_type(qtype),
- p_type(type));
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- switch (type) {
- case T_PTR:
- if (strcasecmp(tname, bp) != 0) {
- syslog(LOG_NOTICE|LOG_AUTH,
- AskedForGot, qname, bp);
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !res_hnok(bp)) {
- had_error++;
- break;
- }
-#if MULTI_PTRS_ARE_ALIASES
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- if (!haveanswer)
- host.h_name = bp;
- else if (ap < &host_aliases[MAXALIASES-1])
- *ap++ = bp;
- else
- n = -1;
- if (n != -1) {
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- had_error++;
- break;
- }
- bp += n;
- buflen -= n;
- }
- break;
-#else
- host.h_name = bp;
- if (_res.options & RES_USE_INET6) {
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- had_error++;
- break;
- }
- bp += n;
- buflen -= n;
- _map_v4v6_hostent(&host, &bp, &buflen);
- }
- h_errno = NETDB_SUCCESS;
- return (&host);
-#endif
- case T_A:
- case T_AAAA:
- if (strcasecmp(host.h_name, bp) != 0) {
- syslog(LOG_NOTICE|LOG_AUTH,
- AskedForGot, host.h_name, bp);
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- if (n != host.h_length) {
- cp += n;
- continue;
- }
- if (!haveanswer) {
- register int nn;
-
- host.h_name = bp;
- nn = strlen(bp) + 1; /* for the \0 */
- bp += nn;
- buflen -= nn;
- }
-
- bp += sizeof(align) - ((u_long)bp % sizeof(align));
-
- if (bp + n >= &hostbuf[sizeof hostbuf]) {
- dprintf("size (%d) too big\n", n);
- had_error++;
- continue;
- }
- if (hap >= &h_addr_ptrs[MAXADDRS-1]) {
- if (!toobig++)
- dprintf("Too many addresses (%d)\n",
- MAXADDRS);
- cp += n;
- continue;
- }
- bcopy(cp, *hap++ = bp, n);
- bp += n;
- buflen -= n;
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- break;
- default:
- dprintf("Impossible condition (type=%d)\n", type);
- h_errno = NO_RECOVERY;
- return (NULL);
- /* BIND has abort() here, too risky on bad data */
- }
- if (!had_error)
- haveanswer++;
- }
- if (haveanswer) {
- *ap = NULL;
- *hap = NULL;
-# if defined(RESOLVSORT)
- /*
- * Note: we sort even if host can take only one address
- * in its return structures - should give it the "best"
- * address in that case, not some random one
- */
- if (_res.nsort && haveanswer > 1 && qtype == T_A)
- addrsort(h_addr_ptrs, haveanswer);
-# endif /*RESOLVSORT*/
- if (!host.h_name) {
- n = strlen(qname) + 1; /* for the \0 */
- if (n > buflen || n >= MAXHOSTNAMELEN)
- goto no_recovery;
- strcpy(bp, qname);
- host.h_name = bp;
- bp += n;
- buflen -= n;
- }
- if (_res.options & RES_USE_INET6)
- _map_v4v6_hostent(&host, &bp, &buflen);
- h_errno = NETDB_SUCCESS;
- return (&host);
- }
- no_recovery:
- h_errno = NO_RECOVERY;
- return (NULL);
-}
-
-struct hostent *
-__dns_getanswer(answer, anslen, qname, qtype)
- const char *answer;
- int anslen;
- const char *qname;
- int qtype;
-{
- switch(qtype) {
- case T_AAAA:
- host.h_addrtype = AF_INET6;
- host.h_length = IN6ADDRSZ;
- break;
- case T_A:
- default:
- host.h_addrtype = AF_INET;
- host.h_length = INADDRSZ;
- break;
- }
-
- return(gethostanswer((const querybuf *)answer, anslen, qname, qtype));
-}
-
-struct hostent *
-_gethostbydnsname(name, af)
- const char *name;
- int af;
-{
- querybuf buf;
- register const char *cp;
- char *bp;
- int n, size, type, len;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
-
- switch (af) {
- case AF_INET:
- size = INADDRSZ;
- type = T_A;
- break;
- case AF_INET6:
- size = IN6ADDRSZ;
- type = T_AAAA;
- break;
- default:
- h_errno = NETDB_INTERNAL;
- errno = EAFNOSUPPORT;
- return (NULL);
- }
-
- host.h_addrtype = af;
- host.h_length = size;
-
- /*
- * if there aren't any dots, it could be a user-level alias.
- * this is also done in res_query() since we are not the only
- * function that looks up host names.
- */
- if (!strchr(name, '.') && (cp = __hostalias(name)))
- name = cp;
-
- /*
- * disallow names consisting only of digits/dots, unless
- * they end in a dot.
- */
- if (isdigit((int)name[0]))
- for (cp = name;; ++cp) {
- if (!*cp) {
- if (*--cp == '.')
- break;
- /*
- * All-numeric, no dot at the end.
- * Fake up a hostent as if we'd actually
- * done a lookup.
- */
- if (inet_pton(af, name, host_addr) <= 0) {
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- strncpy(hostbuf, name, MAXDNAME);
- hostbuf[MAXDNAME] = '\0';
- bp = hostbuf + MAXDNAME;
- len = sizeof hostbuf - MAXDNAME;
- host.h_name = hostbuf;
- host.h_aliases = host_aliases;
- host_aliases[0] = NULL;
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- host.h_addr_list = h_addr_ptrs;
- if (_res.options & RES_USE_INET6)
- _map_v4v6_hostent(&host, &bp, &len);
- h_errno = NETDB_SUCCESS;
- return (&host);
- }
- if (!isdigit((int)*cp) && *cp != '.')
- break;
- }
- if ((isxdigit((int)name[0]) && strchr(name, ':') != NULL) ||
- name[0] == ':')
- for (cp = name;; ++cp) {
- if (!*cp) {
- if (*--cp == '.')
- break;
- /*
- * All-IPv6-legal, no dot at the end.
- * Fake up a hostent as if we'd actually
- * done a lookup.
- */
- if (inet_pton(af, name, host_addr) <= 0) {
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- strncpy(hostbuf, name, MAXDNAME);
- hostbuf[MAXDNAME] = '\0';
- bp = hostbuf + MAXDNAME;
- len = sizeof hostbuf - MAXDNAME;
- host.h_name = hostbuf;
- host.h_aliases = host_aliases;
- host_aliases[0] = NULL;
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- host.h_addr_list = h_addr_ptrs;
- h_errno = NETDB_SUCCESS;
- return (&host);
- }
- if (!isxdigit((int)*cp) && *cp != ':' && *cp != '.')
- break;
- }
-
- if ((n = res_search(name, C_IN, type, buf.buf, sizeof(buf))) < 0) {
- dprintf("res_search failed (%d)\n", n);
- return (NULL);
- }
- return (gethostanswer(&buf, n, name, type));
-}
-
-struct hostent *
-_gethostbydnsaddr(addr, len, af)
- const char *addr; /* XXX should have been def'd as u_char! */
- int len, af;
-{
- const u_char *uaddr = (const u_char *)addr;
- static const u_char mapped[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0xff,0xff };
- static const u_char tunnelled[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 };
- int n, size;
- querybuf buf;
- register struct hostent *hp;
- char qbuf[MAXDNAME+1], *qp;
-#ifdef SUNSECURITY
- register struct hostent *rhp;
- char **haddr;
- u_long old_options;
- char hname2[MAXDNAME+1];
-#endif /*SUNSECURITY*/
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- if (af == AF_INET6 && len == IN6ADDRSZ &&
- (!bcmp(uaddr, mapped, sizeof mapped) ||
- !bcmp(uaddr, tunnelled, sizeof tunnelled))) {
- /* Unmap. */
- addr += sizeof mapped;
- uaddr += sizeof mapped;
- af = AF_INET;
- len = INADDRSZ;
- }
- switch (af) {
- case AF_INET:
- size = INADDRSZ;
- break;
- case AF_INET6:
- size = IN6ADDRSZ;
- break;
- default:
- errno = EAFNOSUPPORT;
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- if (size != len) {
- errno = EINVAL;
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- switch (af) {
- case AF_INET:
- (void) sprintf(qbuf, "%u.%u.%u.%u.in-addr.arpa",
- (uaddr[3] & 0xff),
- (uaddr[2] & 0xff),
- (uaddr[1] & 0xff),
- (uaddr[0] & 0xff));
- break;
- case AF_INET6:
- qp = qbuf;
- for (n = IN6ADDRSZ - 1; n >= 0; n--) {
- qp += SPRINTF((qp, "%x.%x.",
- uaddr[n] & 0xf,
- (uaddr[n] >> 4) & 0xf));
- }
- strcpy(qp, "ip6.int");
- break;
- default:
- abort();
- }
- n = res_query(qbuf, C_IN, T_PTR, (u_char *)buf.buf, sizeof buf.buf);
- if (n < 0) {
- dprintf("res_query failed (%d)\n", n);
- return (NULL);
- }
- if (!(hp = gethostanswer(&buf, n, qbuf, T_PTR)))
- return (NULL); /* h_errno was set by gethostanswer() */
-#ifdef SUNSECURITY
- if (af == AF_INET) {
- /*
- * turn off search as the name should be absolute,
- * 'localhost' should be matched by defnames
- */
- strncpy(hname2, hp->h_name, MAXDNAME);
- hname2[MAXDNAME] = '\0';
- old_options = _res.options;
- _res.options &= ~RES_DNSRCH;
- _res.options |= RES_DEFNAMES;
- if (!(rhp = gethostbyname(hname2))) {
- syslog(LOG_NOTICE|LOG_AUTH,
- "gethostbyaddr: No A record for %s (verifying [%s])",
- hname2, inet_ntoa(*((struct in_addr *)addr)));
- _res.options = old_options;
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- _res.options = old_options;
- for (haddr = rhp->h_addr_list; *haddr; haddr++)
- if (!memcmp(*haddr, addr, INADDRSZ))
- break;
- if (!*haddr) {
- syslog(LOG_NOTICE|LOG_AUTH,
- "gethostbyaddr: A record of %s != PTR record [%s]",
- hname2, inet_ntoa(*((struct in_addr *)addr)));
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- }
-#endif /*SUNSECURITY*/
- hp->h_addrtype = af;
- hp->h_length = len;
- bcopy(addr, host_addr, len);
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- if (af == AF_INET && (_res.options & RES_USE_INET6)) {
- _map_v4v6_address((char*)host_addr, (char*)host_addr);
- hp->h_addrtype = AF_INET6;
- hp->h_length = IN6ADDRSZ;
- }
- h_errno = NETDB_SUCCESS;
- return (hp);
-}
-
-#ifdef RESOLVSORT
-static void
-addrsort(ap, num)
- char **ap;
- int num;
-{
- int i, j;
- char **p;
- short aval[MAXADDRS];
- int needsort = 0;
-
- p = ap;
- for (i = 0; i < num; i++, p++) {
- for (j = 0 ; (unsigned)j < _res.nsort; j++)
- if (_res.sort_list[j].addr.s_addr ==
- (((struct in_addr *)(*p))->s_addr & _res.sort_list[j].mask))
- break;
- aval[i] = j;
- if (needsort == 0 && i > 0 && j < aval[i-1])
- needsort = i;
- }
- if (!needsort)
- return;
-
- while (needsort < num) {
- for (j = needsort - 1; j >= 0; j--) {
- if (aval[j] > aval[j+1]) {
- char *hp;
-
- i = aval[j];
- aval[j] = aval[j+1];
- aval[j+1] = i;
-
- hp = ap[j];
- ap[j] = ap[j+1];
- ap[j+1] = hp;
-
- } else
- break;
- }
- needsort++;
- }
-}
-#endif
-void
-_sethostdnsent(stayopen)
- int stayopen;
-{
- if ((_res.options & RES_INIT) == 0 && res_init() == -1)
- return;
- if (stayopen)
- _res.options |= RES_STAYOPEN | RES_USEVC;
-}
-
-void
-_endhostdnsent()
-{
- _res.options &= ~(RES_STAYOPEN | RES_USEVC);
- res_close();
-}
diff --git a/c/src/lib/libnetworking/libc/gethostbyht.c b/c/src/lib/libnetworking/libc/gethostbyht.c
deleted file mode 100644
index 29f2805367..0000000000
--- a/c/src/lib/libnetworking/libc/gethostbyht.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*-
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <arpa/nameser.h> /* XXX */
-#include <resolv.h> /* XXX */
-
-#define MAXALIASES 35
-
-static struct hostent host;
-static char *host_aliases[MAXALIASES];
-static char hostbuf[BUFSIZ+1];
-static FILE *hostf = NULL;
-static u_char host_addr[16]; /* IPv4 or IPv6 */
-static char *h_addr_ptrs[2];
-static int stayopen = 0;
-
-void
-_sethosthtent(f)
- int f;
-{
- if (!hostf)
- hostf = fopen(_PATH_HOSTS, "r" );
- else
- rewind(hostf);
- stayopen = f;
-}
-
-void
-_endhosthtent()
-{
- if (hostf && !stayopen) {
- (void) fclose(hostf);
- hostf = NULL;
- }
-}
-
-struct hostent *
-gethostent()
-{
- char *p;
- register char *cp, **q;
- int af, len;
-
- if (!hostf && !(hostf = fopen(_PATH_HOSTS, "r" ))) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- again:
- if (!(p = fgets(hostbuf, sizeof hostbuf, hostf))) {
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- if (*p == '#')
- goto again;
- if (!(cp = strpbrk(p, "#\n")))
- goto again;
- *cp = '\0';
- if (!(cp = strpbrk(p, " \t")))
- goto again;
- *cp++ = '\0';
- if (inet_pton(AF_INET6, p, host_addr) > 0) {
- af = AF_INET6;
- len = IN6ADDRSZ;
- } else if (inet_pton(AF_INET, p, host_addr) > 0) {
- if (_res.options & RES_USE_INET6) {
- _map_v4v6_address((char*)host_addr, (char*)host_addr);
- af = AF_INET6;
- len = IN6ADDRSZ;
- } else {
- af = AF_INET;
- len = INADDRSZ;
- }
- } else {
- goto again;
- }
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- host.h_addr_list = h_addr_ptrs;
- host.h_length = len;
- host.h_addrtype = af;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- host.h_name = cp;
- q = host.h_aliases = host_aliases;
- if ((cp = strpbrk(cp, " \t")) != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &host_aliases[MAXALIASES - 1])
- *q++ = cp;
- if ((cp = strpbrk(cp, " \t")) != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- h_errno = NETDB_SUCCESS;
- return (&host);
-}
-
-struct hostent *
-_gethostbyhtname(name, af)
- const char *name;
- int af;
-{
- register struct hostent *p;
- register char **cp;
-
- sethostent(0);
- while ((p = gethostent()) != NULL) {
- if (p->h_addrtype != af)
- continue;
- if (strcasecmp(p->h_name, name) == 0)
- break;
- for (cp = p->h_aliases; *cp != 0; cp++)
- if (strcasecmp(*cp, name) == 0)
- goto found;
- }
-found:
- endhostent();
- return (p);
-}
-
-struct hostent *
-_gethostbyhtaddr(addr, len, af)
- const char *addr;
- int len, af;
-{
- register struct hostent *p;
-
- sethostent(0);
- while ((p = gethostent()) != NULL)
- if (p->h_addrtype == af && !bcmp(p->h_addr, addr, len))
- break;
- endhostent();
- return (p);
-}
diff --git a/c/src/lib/libnetworking/libc/gethostbyname.3 b/c/src/lib/libnetworking/libc/gethostbyname.3
deleted file mode 100644
index e21dc79f1d..0000000000
--- a/c/src/lib/libnetworking/libc/gethostbyname.3
+++ /dev/null
@@ -1,305 +0,0 @@
-.\" Copyright (c) 1983, 1987, 1991, 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.
-.\"
-.\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95
-.\" $Id$
-.\"
-.Dd May 25, 1995
-.Dt GETHOSTBYNAME 3
-.Os BSD 4.2
-.Sh NAME
-.Nm gethostbyname ,
-.Nm gethostbyname2 ,
-.Nm gethostbyaddr ,
-.Nm gethostent ,
-.Nm sethostent ,
-.Nm endhostent ,
-.Nm herror ,
-.Nm hstrerror
-.Nd get network host entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Vt extern int h_errno;
-.Ft struct hostent *
-.Fn gethostbyname "const char *name"
-.Ft struct hostent *
-.Fn gethostbyname2 "const char *name" "int af"
-.Ft struct hostent *
-.Fn gethostbyaddr "const char *addr" "int len" "int type"
-.Ft struct hostent *
-.Fn gethostent void
-.Ft void
-.Fn sethostent "int stayopen"
-.Ft void
-.Fn endhostent void
-.Ft void
-.Fn herror "const char *string"
-.Ft const char *
-.Fn hstrerror "int err"
-.Sh DESCRIPTION
-The
-.Fn gethostbyname ,
-.Fn gethostbyname2
-and
-.Fn gethostbyaddr
-functions
-each return a pointer to an object with the
-following structure describing an internet host
-referenced by name or by address, respectively.
-This structure contains either the information obtained from the name server,
-.Xr named 8 ,
-or broken-out fields from a line in
-.Pa /etc/hosts .
-If the local name server is not running these routines do a lookup in
-.Pa /etc/hosts .
-.Bd -literal
-struct hostent {
- char *h_name; /* official name of host */
- char **h_aliases; /* alias list */
- int h_addrtype; /* host address type */
- int h_length; /* length of address */
- char **h_addr_list; /* list of addresses from name server */
-};
-#define h_addr h_addr_list[0] /* address, for backward compatibility */
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width h_addr_list
-.It Fa h_name
-Official name of the host.
-.It Fa h_aliases
-A NULL-terminated array of alternate names for the host.
-.It Fa h_addrtype
-The type of address being returned; usually
-.Dv AF_INET .
-.It Fa h_length
-The length, in bytes, of the address.
-.It Fa h_addr_list
-A NULL-terminated array of network addresses for the host.
-Host addresses are returned in network byte order.
-.It Fa h_addr
-The first address in
-.Fa h_addr_list ;
-this is for backward compatibility.
-.El
-.Pp
-When using the nameserver,
-.Fn gethostbyname
-and
-.Fn gethostbyname
-will search for the named host in the current domain and its parents
-unless the name ends in a dot.
-If the name contains no dot, and if the environment variable
-.Dq Ev HOSTALIASES
-contains the name of an alias file, the alias file will first be searched
-for an alias matching the input name.
-See
-.Xr hostname 7
-for the domain search procedure and the alias file format.
-.Pp
-The
-.Fn gethostbyname2
-function is an evolution of
-.Fn gethostbyname
-which is intended to allow lookups in address families other than
-.Dv AF_INET ,
-for example
-.Dv AF_INET6 .
-Currently the
-.Fa af
-argument must be specified as
-.Dv AF_INET
-else the function will return
-.Dv NULL
-after having set
-.Va h_errno
-to
-.Dv NETDB_INTERNAL
-.Pp
-The
-.Fn sethostent
-function
-may be used to request the use of a connected
-.Tn TCP
-socket for queries.
-If the
-.Fa stayopen
-flag is non-zero,
-this sets the option to send all queries to the name server using
-.Tn TCP
-and to retain the connection after each call to
-.Fn gethostbyname ,
-.Fn gethostbyname2
-or
-.Fn gethostbyaddr .
-Otherwise, queries are performed using
-.Tn UDP
-datagrams.
-.Pp
-The
-.Fn endhostent
-function
-closes the
-.Tn TCP
-connection.
-.Pp
-The
-.Fn herror
-function writes a message to the diagnostic output consisting of the
-string parameter
-.Fa s ,
-the constant string ": ", and a message corresponding to the value of
-.Va h_errno .
-.Pp
-The
-.Fn hstrerror
-function returns a string which is the message text corresponding to the
-value of the
-.Fa err
-parameter.
-.Sh FILES
-.Bl -tag -width /etc/resolv.conf -compact
-.It Pa /etc/hosts
-.It Pa /etc/host.conf
-.It Pa /etc/resolv.conf
-.El
-.Sh DIAGNOSTICS
-Error return status from
-.Fn gethostbyname ,
-.Fn gethostbyname2
-and
-.Fn gethostbyaddr
-is indicated by return of a null pointer.
-The external integer
-.Va h_errno
-may then be checked to see whether this is a temporary failure
-or an invalid or unknown host.
-The routine
-.Fn herror
-can be used to print an error message describing the failure.
-If its argument
-.Fa string
-is
-.Pf non Dv -NULL ,
-it is printed, followed by a colon and a space.
-The error message is printed with a trailing newline.
-.Pp
-The variable
-.Va h_errno
-can have the following values:
-.Bl -tag -width HOST_NOT_FOUND
-.It Dv HOST_NOT_FOUND
-No such host is known.
-.It Dv TRY_AGAIN
-This is usually a temporary error
-and means that the local server did not receive
-a response from an authoritative server.
-A retry at some later time may succeed.
-.It Dv NO_RECOVERY
-Some unexpected server failure was encountered.
-This is a non-recoverable error.
-.It Dv NO_DATA
-The requested name is valid but does not have an IP address;
-this is not a temporary error.
-This means that the name is known to the name server but there is no address
-associated with this name.
-Another type of request to the name server using this domain name
-will result in an answer;
-for example, a mail-forwarder may be registered for this domain.
-.El
-.Sh SEE ALSO
-.Xr resolver 3 ,
-.Xr hosts 5 ,
-.Xr hostname 7 ,
-.Xr named 8
-.Sh CAVEAT
-The
-.Fn gethostent
-function
-is defined, and
-.Fn sethostent
-and
-.Fn endhostent
-are redefined,
-when
-.Xr libc 3
-is built to use only the routines to lookup in
-.Pa /etc/hosts
-and not the name server.
-.Pp
-The
-.Fn gethostent
-function
-reads the next line of
-.Pa /etc/hosts ,
-opening the file if necessary.
-.Pp
-The
-.Fn sethostent
-function
-opens and/or rewinds the file
-.Pa /etc/hosts .
-If the
-.Fa stayopen
-argument is non-zero,
-the file will not be closed after each call to
-.Fn gethostbyname ,
-.Fn gethostbyname2
-or
-.Fn gethostbyaddr .
-.Pp
-The
-.Fn endhostent
-function
-closes the file.
-.Sh HISTORY
-The
-.Fn herror
-function appeared in
-.Bx 4.3 .
-The
-.Fn endhostent ,
-.Fn gethostbyaddr ,
-.Fn gethostbyname ,
-.Fn gethostent ,
-and
-.Fn sethostent
-functions appeared in
-.Bx 4.2 .
-The
-.Fn gethostbyname2
-function first appeared in bind-4.9.4.
-.Sh BUGS
-These functions use static data storage;
-if the data is needed for future use, it should be
-copied before any subsequent calls overwrite it.
-Only the Internet
-address format is currently understood.
diff --git a/c/src/lib/libnetworking/libc/gethostbynis.c b/c/src/lib/libnetworking/libc/gethostbynis.c
deleted file mode 100644
index 45dbe5a85d..0000000000
--- a/c/src/lib/libnetworking/libc/gethostbynis.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id$";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-#define MAXALIASES 35
-#define MAXADDRS 35
-
-#ifdef YP
-static char *host_aliases[MAXALIASES];
-static char hostaddr[MAXADDRS];
-static char *host_addrs[2];
-#endif /* YP */
-
-static struct hostent *
-_gethostbynis(name, map, af)
- const char *name;
- char *map;
- int af;
-{
-#ifdef YP
- register char *cp, **q;
- char *result;
- int resultlen;
- static struct hostent h;
- static char *domain = (char *)NULL;
- static char ypbuf[YPMAXRECORD + 2];
-
- switch(af) {
- case AF_INET:
- break;
- default:
- case AF_INET6:
- errno = EAFNOSUPPORT;
- return NULL;
- }
-
- if (domain == (char *)NULL)
- if (yp_get_default_domain (&domain))
- return ((struct hostent *)NULL);
-
- if (yp_match(domain, map, name, strlen(name), &result, &resultlen))
- return ((struct hostent *)NULL);
-
- /* avoid potential memory leak */
- bcopy((char *)result, (char *)&ypbuf, resultlen);
- ypbuf[resultlen] = '\0';
- free(result);
- result = (char *)&ypbuf;
-
- if ((cp = index(result, '\n')))
- *cp = '\0';
-
- cp = strpbrk(result, " \t");
- *cp++ = '\0';
- h.h_addr_list = host_addrs;
- h.h_addr = hostaddr;
- *((u_long *)h.h_addr) = inet_addr(result);
- h.h_length = sizeof(u_long);
- h.h_addrtype = AF_INET;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- h.h_name = cp;
- q = h.h_aliases = host_aliases;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &host_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&h);
-#else
- return (NULL);
-#endif /* YP */
-}
-
-struct hostent *
-_gethostbynisname(name, af)
- const char *name;
- int af;
-{
- return _gethostbynis(name, "hosts.byname", af);
-}
-
-struct hostent *
-_gethostbynisaddr(addr, len, af)
- const char *addr;
- int len;
- int af;
-{
- return _gethostbynis(inet_ntoa(*(struct in_addr *)addr),"hosts.byaddr", af);
-}
diff --git a/c/src/lib/libnetworking/libc/gethostnamadr.c b/c/src/lib/libnetworking/libc/gethostnamadr.c
deleted file mode 100644
index 92f7a21014..0000000000
--- a/c/src/lib/libnetworking/libc/gethostnamadr.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id$";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <arpa/nameser.h> /* XXX hack for _res */
-#include <resolv.h> /* XXX hack for _res */
-
-#define _PATH_HOSTCONF "/etc/host.conf"
-
-enum service_type {
- SERVICE_NONE = 0,
- SERVICE_BIND,
- SERVICE_HOSTS,
- SERVICE_NIS };
-#define SERVICE_MAX SERVICE_NIS
-
-static struct {
- const char *name;
- enum service_type type;
-} service_names[] = {
- { "hosts", SERVICE_HOSTS },
- { "/etc/hosts", SERVICE_HOSTS },
- { "hosttable", SERVICE_HOSTS },
- { "htable", SERVICE_HOSTS },
- { "bind", SERVICE_BIND },
- { "dns", SERVICE_BIND },
- { "domain", SERVICE_BIND },
- { "yp", SERVICE_NIS },
- { "yellowpages", SERVICE_NIS },
- { "nis", SERVICE_NIS },
- { 0, SERVICE_NONE }
-};
-
-static enum service_type service_order[SERVICE_MAX + 1];
-static int service_done = 0;
-
-static enum service_type
-get_service_name(const char *name) {
- int i;
- for(i = 0; service_names[i].type != SERVICE_NONE; i++) {
- if(!strcasecmp(name, service_names[i].name)) {
- return service_names[i].type;
- }
- }
- return SERVICE_NONE;
-}
-
-static void
-init_services()
-{
- char *cp, *p, buf[BUFSIZ];
- register int cc = 0;
- FILE *fd;
-
- if ((fd = (FILE *)fopen(_PATH_HOSTCONF, "r")) == NULL) {
- /* make some assumptions */
- service_order[0] = SERVICE_BIND;
- service_order[1] = SERVICE_HOSTS;
- service_order[2] = SERVICE_NONE;
- } else {
- while (fgets(buf, BUFSIZ, fd) != NULL && cc < SERVICE_MAX) {
- if(buf[0] == '#')
- continue;
-
- p = buf;
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- if (cp == NULL)
- continue;
- do {
- if (isalpha((int)cp[0])) {
- service_order[cc] = get_service_name(cp);
- if(service_order[cc] != SERVICE_NONE)
- cc++;
- }
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- } while(cp != NULL && cc < SERVICE_MAX);
- }
- service_order[cc] = SERVICE_NONE;
- fclose(fd);
- }
- service_done = 1;
-}
-
-struct hostent *
-gethostbyname(const char *name)
-{
- struct hostent *hp;
-
- if (_res.options & RES_USE_INET6) { /* XXX */
- hp = gethostbyname2(name, AF_INET6); /* XXX */
- if (hp) /* XXX */
- return (hp); /* XXX */
- } /* XXX */
- return (gethostbyname2(name, AF_INET));
-}
-
-struct hostent *
-gethostbyname2(const char *name, int type)
-{
- struct hostent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return NULL;
- case SERVICE_HOSTS:
- hp = _gethostbyhtname(name, type);
- break;
- case SERVICE_BIND:
- hp = _gethostbydnsname(name, type);
- break;
- case SERVICE_NIS:
- hp = _gethostbynisname(name, type);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-struct hostent *
-gethostbyaddr(const char *addr, int len, int type)
-{
- struct hostent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return 0;
- case SERVICE_HOSTS:
- hp = _gethostbyhtaddr(addr, len, type);
- break;
- case SERVICE_BIND:
- hp = _gethostbydnsaddr(addr, len, type);
- break;
- case SERVICE_NIS:
- hp = _gethostbynisaddr(addr, len, type);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-#ifdef _THREAD_SAFE
-struct hostent_data;
-
-/*
- * Temporary function (not thread safe)
- */
-int gethostbyaddr_r(const char *addr, int len, int type,
- struct hostent *result, struct hostent_data *buffer)
-{
- struct hostent *hp;
- int ret;
- if ((hp = gethostbyaddr(addr, len, type)) == NULL) {
- ret = -1;
- } else {
- memcpy(result, hp, sizeof(struct hostent));
- ret = 0;
- }
- return(ret);
-}
-#endif
-
-void
-sethostent(stayopen)
- int stayopen;
-{
- _sethosthtent(stayopen);
- _sethostdnsent(stayopen);
-}
-
-void
-endhostent()
-{
- _endhosthtent();
- _endhostdnsent();
-}
diff --git a/c/src/lib/libnetworking/libc/gethostname.c b/c/src/lib/libnetworking/libc/gethostname.c
deleted file mode 100644
index 81dc2267c2..0000000000
--- a/c/src/lib/libnetworking/libc/gethostname.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * $Id$
- */
-
-#include "config.h"
-
-/*
- * Solaris doesn't include the gethostname call by default.
- */
-#include <sys/utsname.h>
-#include <sys/systeminfo.h>
-
-#include <netdb.h>
-
-/*
- * PUBLIC: #ifndef HAVE_GETHOSTNAME
- * PUBLIC: int gethostname __P((char *, int));
- * PUBLIC: #endif
- */
-int
-gethostname(host, len)
- char *host;
- int len;
-{
- return (sysinfo(SI_HOSTNAME, host, len) == -1 ? -1 : 0);
-}
diff --git a/c/src/lib/libnetworking/libc/getnetbydns.c b/c/src/lib/libnetworking/libc/getnetbydns.c
deleted file mode 100644
index 8f8c576332..0000000000
--- a/c/src/lib/libnetworking/libc/getnetbydns.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/*-
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-/* Portions Copyright (c) 1993 Carlos Leandro and Rui Salgueiro
- * Dep. Matematica Universidade de Coimbra, Portugal, Europe
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <stdio.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <syslog.h>
-
-#include "res_config.h"
-
-extern int h_errno;
-
-#define BYADDR 0
-#define BYNAME 1
-#define MAXALIASES 35
-
-#if PACKETSZ > 1024
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 1024
-#endif
-
-typedef union {
- HEADER hdr;
- u_char buf[MAXPACKET];
-} querybuf;
-
-typedef union {
- long al;
- char ac;
-} align;
-
-static struct netent *
-getnetanswer(answer, anslen, net_i)
- querybuf *answer;
- int anslen;
- int net_i;
-{
-
- register HEADER *hp;
- register u_char *cp;
- register int n;
- u_char *eom;
- int type, class, buflen, ancount, qdcount, haveanswer, i, nchar;
- char aux1[MAXHOSTNAMELEN], aux2[MAXHOSTNAMELEN], ans[MAXHOSTNAMELEN];
- char *in, *st, *pauxt, *bp, **ap;
- char *paux1 = &aux1[0], *paux2 = &aux2[0], flag = 0;
-static struct netent net_entry;
-static char *net_aliases[MAXALIASES], netbuf[PACKETSZ];
-
- /*
- * find first satisfactory answer
- *
- * answer --> +------------+ ( MESSAGE )
- * | Header |
- * +------------+
- * | Question | the question for the name server
- * +------------+
- * | Answer | RRs answering the question
- * +------------+
- * | Authority | RRs pointing toward an authority
- * | Additional | RRs holding additional information
- * +------------+
- */
- eom = answer->buf + anslen;
- hp = &answer->hdr;
- ancount = ntohs(hp->ancount); /* #/records in the answer section */
- qdcount = ntohs(hp->qdcount); /* #/entries in the question section */
- bp = netbuf;
- buflen = sizeof(netbuf);
- cp = answer->buf + HFIXEDSZ;
- if (!qdcount) {
- if (hp->aa)
- h_errno = HOST_NOT_FOUND;
- else
- h_errno = TRY_AGAIN;
- return (NULL);
- }
- while (qdcount-- > 0)
- cp += __dn_skipname(cp, eom) + QFIXEDSZ;
- ap = net_aliases;
- *ap = NULL;
- net_entry.n_aliases = net_aliases;
- haveanswer = 0;
- while (--ancount >= 0 && cp < eom) {
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !res_dnok(bp))
- break;
- cp += n;
- ans[0] = '\0';
- (void)strncpy(&ans[0], bp, sizeof(ans) - 1);
- ans[sizeof(ans) - 1] = '\0';
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- cp += INT32SZ; /* TTL */
- GETSHORT(n, cp);
- if (class == C_IN && type == T_PTR) {
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !res_hnok(bp)) {
- cp += n;
- return (NULL);
- }
- cp += n;
- *ap++ = bp;
- bp += strlen(bp) + 1;
- net_entry.n_addrtype =
- (class == C_IN) ? AF_INET : AF_UNSPEC;
- haveanswer++;
- }
- }
- if (haveanswer) {
- *ap = NULL;
- switch (net_i) {
- case BYADDR:
- net_entry.n_name = *net_entry.n_aliases;
- net_entry.n_net = 0L;
- break;
- case BYNAME:
- in = *net_entry.n_aliases;
- net_entry.n_name = &ans[0];
- aux2[0] = '\0';
- for (i = 0; i < 4; i++) {
- for (st = in, nchar = 0;
- *st != '.';
- st++, nchar++)
- ;
- if (nchar != 1 || *in != '0' || flag) {
- flag = 1;
- (void)strncpy(paux1,
- (i==0) ? in : in-1,
- (i==0) ?nchar : nchar+1);
- paux1[(i==0) ? nchar : nchar+1] = '\0';
- pauxt = paux2;
- paux2 = strcat(paux1, paux2);
- paux1 = pauxt;
- }
- in = ++st;
- }
- net_entry.n_net = inet_network(paux2);
- break;
- }
- net_entry.n_aliases++;
- return (&net_entry);
- }
- h_errno = TRY_AGAIN;
- return (NULL);
-}
-
-struct netent *
-_getnetbydnsaddr(net, net_type)
- register unsigned long net;
- register int net_type;
-{
- unsigned int netbr[4];
- int nn, anslen;
- querybuf buf;
- char qbuf[MAXDNAME];
- unsigned long net2;
- struct netent *net_entry;
-
- if (net_type != AF_INET)
- return (NULL);
-
- for (nn = 4, net2 = net; net2; net2 >>= 8)
- netbr[--nn] = net2 & 0xff;
- switch (nn) {
- case 3: /* Class A */
- sprintf(qbuf, "0.0.0.%u.in-addr.arpa", netbr[3]);
- break;
- case 2: /* Class B */
- sprintf(qbuf, "0.0.%u.%u.in-addr.arpa", netbr[3], netbr[2]);
- break;
- case 1: /* Class C */
- sprintf(qbuf, "0.%u.%u.%u.in-addr.arpa", netbr[3], netbr[2],
- netbr[1]);
- break;
- case 0: /* Class D - E */
- sprintf(qbuf, "%u.%u.%u.%u.in-addr.arpa", netbr[3], netbr[2],
- netbr[1], netbr[0]);
- break;
- }
- anslen = res_query(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof(buf));
- if (anslen < 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf("res_query failed\n");
-#endif
- return (NULL);
- }
- net_entry = getnetanswer(&buf, anslen, BYADDR);
- if (net_entry) {
- unsigned u_net = net; /* maybe net should be unsigned ? */
-
- /* Strip trailing zeros */
- while ((u_net & 0xff) == 0 && u_net != 0)
- u_net >>= 8;
- net_entry->n_net = u_net;
- return (net_entry);
- }
- return (NULL);
-}
-
-struct netent *
-_getnetbydnsname(net)
- register const char *net;
-{
- int anslen;
- querybuf buf;
- char qbuf[MAXDNAME];
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- strncpy(qbuf, net, sizeof(qbuf) - 1);
- qbuf[sizeof(qbuf) - 1] = '\0';
- anslen = res_search(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof(buf));
- if (anslen < 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf("res_query failed\n");
-#endif
- return (NULL);
- }
- return getnetanswer(&buf, anslen, BYNAME);
-}
-
-void
-_setnetdnsent(stayopen)
- int stayopen;
-{
- if (stayopen)
- _res.options |= RES_STAYOPEN | RES_USEVC;
-}
-
-void
-_endnetdnsent()
-{
- _res.options &= ~(RES_STAYOPEN | RES_USEVC);
- res_close();
-}
diff --git a/c/src/lib/libnetworking/libc/getnetbyht.c b/c/src/lib/libnetworking/libc/getnetbyht.c
deleted file mode 100644
index f7b7b1091d..0000000000
--- a/c/src/lib/libnetworking/libc/getnetbyht.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- */
-
-/* Portions Copyright (c) 1993 Carlos Leandro and Rui Salgueiro
- * Dep. Matematica Universidade de Coimbra, Portugal, Europe
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * from getnetent.c 1.1 (Coimbra) 93/06/02
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getnetent.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: getnetent.c,v 8.4 1997/06/01 20:34:37 vixie Exp";
-static chat rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <string.h>
-
-#define MAXALIASES 35
-
-static FILE *netf;
-static char line[BUFSIZ+1];
-static struct netent net;
-static char *net_aliases[MAXALIASES];
-static int _net_stayopen;
-
-void
-_setnethtent(f)
- int f;
-{
-
- if (netf == NULL)
- netf = fopen(_PATH_NETWORKS, "r" );
- else
- rewind(netf);
- _net_stayopen |= f;
-}
-
-void
-_endnethtent()
-{
-
- if (netf) {
- fclose(netf);
- netf = NULL;
- }
- _net_stayopen = 0;
-}
-
-struct netent *
-getnetent()
-{
- char *p;
- register char *cp, **q;
-
- if (netf == NULL && (netf = fopen(_PATH_NETWORKS, "r" )) == NULL)
- return (NULL);
-again:
- p = fgets(line, sizeof line, netf);
- if (p == NULL)
- return (NULL);
- if (*p == '#')
- goto again;
- cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
- net.n_name = p;
- cp = strpbrk(p, " \t");
- if (cp == NULL)
- goto again;
- *cp++ = '\0';
- while (*cp == ' ' || *cp == '\t')
- cp++;
- p = strpbrk(cp, " \t");
- if (p != NULL)
- *p++ = '\0';
- net.n_net = inet_network(cp);
- net.n_addrtype = AF_INET;
- q = net.n_aliases = net_aliases;
- if (p != NULL)
- cp = p;
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &net_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&net);
-}
-
-struct netent *
-_getnetbyhtname(name)
- register const char *name;
-{
- register struct netent *p;
- register char **cp;
-
- setnetent(_net_stayopen);
- while ( (p = getnetent()) ) {
- if (strcasecmp(p->n_name, name) == 0)
- break;
- for (cp = p->n_aliases; *cp != 0; cp++)
- if (strcasecmp(*cp, name) == 0)
- goto found;
- }
-found:
- if (!_net_stayopen)
- endnetent();
- return (p);
-}
-
-struct netent *
-_getnetbyhtaddr(net, type)
- register unsigned long net;
- register int type;
-{
- register struct netent *p;
-
- setnetent(_net_stayopen);
- while ( (p = getnetent()) )
- if (p->n_addrtype == type && p->n_net == net)
- break;
- if (!_net_stayopen)
- endnetent();
- return (p);
-}
diff --git a/c/src/lib/libnetworking/libc/getnetbynis.c b/c/src/lib/libnetworking/libc/getnetbynis.c
deleted file mode 100644
index 0549016ba2..0000000000
--- a/c/src/lib/libnetworking/libc/getnetbynis.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id$";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <arpa/nameser.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-#define MAXALIASES 35
-#define MAXADDRS 35
-
-#ifdef YP
-static char *host_aliases[MAXALIASES];
-#endif /* YP */
-
-static struct netent *
-_getnetbynis(name, map, af)
- const char *name;
- char *map;
- int af;
-{
-#ifdef YP
- register char *cp, **q;
- static char *result;
- int resultlen;
- static struct netent h;
- static char *domain = (char *)NULL;
- static char ypbuf[YPMAXRECORD + 2];
-
- switch(af) {
- case AF_INET:
- break;
- default:
- case AF_INET6:
- errno = EAFNOSUPPORT;
- return NULL;
- }
-
- if (domain == (char *)NULL)
- if (yp_get_default_domain (&domain))
- return (NULL);
-
- if (yp_match(domain, map, name, strlen(name), &result, &resultlen))
- return (NULL);
-
- bcopy((char *)result, (char *)&ypbuf, resultlen);
- ypbuf[resultlen] = '\0';
- free(result);
- result = (char *)&ypbuf;
-
- if ((cp = index(result, '\n')))
- *cp = '\0';
-
- cp = strpbrk(result, " \t");
- *cp++ = '\0';
- h.n_name = result;
-
- while (*cp == ' ' || *cp == '\t')
- cp++;
-
- h.n_net = inet_network(cp);
- h.n_addrtype = AF_INET;
-
- q = h.n_aliases = host_aliases;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &host_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&h);
-#else
- return (NULL);
-#endif
-}
-
-struct netent *
-_getnetbynisname(name)
- const char *name;
-{
- return _getnetbynis(name, "networks.byname", AF_INET);
-}
-
-struct netent *
-_getnetbynisaddr(addr, af)
- unsigned long addr;
- int af;
-{
- char *str, *cp;
- unsigned long net2;
- int nn;
- unsigned int netbr[4];
- char buf[MAXDNAME];
-
- if (af != AF_INET) {
- errno = EAFNOSUPPORT;
- return (NULL);
- }
-
- for (nn = 4, net2 = addr; net2; net2 >>= 8) {
- netbr[--nn] = net2 & 0xff;
- }
-
- switch (nn) {
- case 3: /* Class A */
- sprintf(buf, "%u", netbr[3]);
- break;
- case 2: /* Class B */
- sprintf(buf, "%u.%u", netbr[2], netbr[3]);
- break;
- case 1: /* Class C */
- sprintf(buf, "%u.%u.%u", netbr[1], netbr[2], netbr[3]);
- break;
- case 0: /* Class D - E */
- sprintf(buf, "%u.%u.%u.%u", netbr[0], netbr[1],
- netbr[2], netbr[3]);
- break;
- }
-
- str = (char *)&buf;
- cp = str + (strlen(str) - 2);
-
- while(!strcmp(cp, ".0")) {
- *cp = '\0';
- cp = str + (strlen(str) - 2);
- }
-
- return _getnetbynis(str, "networks.byaddr", af);
-}
diff --git a/c/src/lib/libnetworking/libc/getnetent.3 b/c/src/lib/libnetworking/libc/getnetent.3
deleted file mode 100644
index aec93b5876..0000000000
--- a/c/src/lib/libnetworking/libc/getnetent.3
+++ /dev/null
@@ -1,159 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" @(#)getnetent.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt GETNETENT 3
-.Os BSD 4.2
-.Sh NAME
-.Nm getnetent ,
-.Nm getnetbyaddr ,
-.Nm getnetbyname ,
-.Nm setnetent ,
-.Nm endnetent
-.Nd get network entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Ft struct netent *
-.Fn getnetent void
-.Ft struct netent *
-.Fn getnetbyname "const char *name"
-.Ft struct netent *
-.Fn getnetbyaddr "unsigned long net" "int type"
-.Ft void
-.Fn setnetent "int stayopen"
-.Ft void
-.Fn endnetent void
-.Sh DESCRIPTION
-The
-.Fn getnetent ,
-.Fn getnetbyname ,
-and
-.Fn getnetbyaddr
-functions
-each return a pointer to an object with the
-following structure
-containing the broken-out
-fields of a line in the network data base,
-.Pa /etc/networks .
-.Bd -literal -offset indent
-struct netent {
- char *n_name; /* official name of net */
- char **n_aliases; /* alias list */
- int n_addrtype; /* net number type */
- unsigned long n_net; /* net number */
-};
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width n_addrtype
-.It Fa n_name
-The official name of the network.
-.It Fa n_aliases
-A zero terminated list of alternate names for the network.
-.It Fa n_addrtype
-The type of the network number returned; currently only AF_INET.
-.It Fa n_net
-The network number. Network numbers are returned in machine byte
-order.
-.El
-.Pp
-The
-.Fn getnetent
-function
-reads the next line of the file, opening the file if necessary.
-.Pp
-The
-.Fn setnetent
-function
-opens and rewinds the file. If the
-.Fa stayopen
-flag is non-zero,
-the net data base will not be closed after each call to
-.Fn getnetbyname
-or
-.Fn getnetbyaddr .
-.Pp
-The
-.Fn endnetent
-function
-closes the file.
-.Pp
-The
-.Fn getnetbyname
-function
-and
-.Fn getnetbyaddr
-sequentially search from the beginning
-of the file until a matching
-net name or
-net address and type is found,
-or until
-.Dv EOF
-is encountered. The
-.Fa type
-must be
-.Dv AF_INET .
-Network numbers are supplied in host order.
-.Sh FILES
-.Bl -tag -width /etc/networks -compact
-.It Pa /etc/networks
-.El
-.Sh DIAGNOSTICS
-Null pointer
-(0) returned on
-.Dv EOF
-or error.
-.Sh SEE ALSO
-.Xr networks 5
-.Pp
-.%T RFC 1101
-.Sh HISTORY
-The
-.Fn getnetent ,
-.Fn getnetbyaddr ,
-.Fn getnetbyname ,
-.Fn setnetent ,
-and
-.Fn endnetent
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-The data space used by
-these functions is static; if future use requires the data, it should be
-copied before any subsequent calls to these functions overwrite it.
-Only Internet network
-numbers are currently understood.
-Expecting network numbers to fit
-in no more than 32 bits is probably
-naive.
diff --git a/c/src/lib/libnetworking/libc/getnetnamadr.c b/c/src/lib/libnetworking/libc/getnetnamadr.c
deleted file mode 100644
index 4d6597f98c..0000000000
--- a/c/src/lib/libnetworking/libc/getnetnamadr.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-
-#ifndef _PATH_NETCONF
-#define _PATH_NETCONF "/etc/host.conf"
-#endif
-
-enum service_type {
- SERVICE_NONE = 0,
- SERVICE_BIND,
- SERVICE_TABLE,
- SERVICE_NIS };
-#define SERVICE_MAX SERVICE_NIS
-
-static struct {
- const char *name;
- enum service_type type;
-} service_names[] = {
- { "hosts", SERVICE_TABLE },
- { "/etc/hosts", SERVICE_TABLE },
- { "hosttable", SERVICE_TABLE },
- { "htable", SERVICE_TABLE },
- { "bind", SERVICE_BIND },
- { "dns", SERVICE_BIND },
- { "domain", SERVICE_BIND },
- { "yp", SERVICE_NIS },
- { "yellowpages", SERVICE_NIS },
- { "nis", SERVICE_NIS },
- { 0, SERVICE_NONE }
-};
-
-static enum service_type service_order[SERVICE_MAX + 1];
-static int service_done = 0;
-
-static enum service_type
-get_service_name(const char *name) {
- int i;
- for(i = 0; service_names[i].type != SERVICE_NONE; i++) {
- if(!strcasecmp(name, service_names[i].name)) {
- return service_names[i].type;
- }
- }
- return SERVICE_NONE;
-}
-
-static void
-init_services()
-{
- char *cp, *p, buf[BUFSIZ];
- register int cc = 0;
- FILE *fd;
-
- if ((fd = (FILE *)fopen(_PATH_NETCONF, "r")) == NULL) {
- /* make some assumptions */
- service_order[0] = SERVICE_TABLE;
- service_order[1] = SERVICE_NONE;
- } else {
- while (fgets(buf, BUFSIZ, fd) != NULL && cc < SERVICE_MAX) {
- if(buf[0] == '#')
- continue;
-
- p = buf;
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- if (cp == NULL)
- continue;
- do {
- if (isalpha(cp[0])) {
- service_order[cc] = get_service_name(cp);
- if(service_order[cc] != SERVICE_NONE)
- cc++;
- }
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- } while(cp != NULL && cc < SERVICE_MAX);
- }
- service_order[cc] = SERVICE_NONE;
- fclose(fd);
- }
- service_done = 1;
-}
-
-struct netent *
-getnetbyname(const char *name)
-{
- struct netent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return NULL;
- case SERVICE_TABLE:
- hp = _getnetbyhtname(name);
- break;
- case SERVICE_BIND:
- hp = _getnetbydnsname(name);
- break;
- case SERVICE_NIS:
- hp = _getnetbynisname(name);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-struct netent *
-getnetbyaddr(addr, af)
- u_long addr;
- int af;
-{
- struct netent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return 0;
- case SERVICE_TABLE:
- hp = _getnetbyhtaddr(addr, af);
- break;
- case SERVICE_BIND:
- hp = _getnetbydnsaddr(addr, af);
- break;
- case SERVICE_NIS:
- hp = _getnetbynisaddr(addr, af);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-void
-setnetent(stayopen)
- int stayopen;
-{
- _setnethtent(stayopen);
- _setnetdnsent(stayopen);
-}
-
-void
-endnetent()
-{
- _endnethtent();
- _endnetdnsent();
-}
diff --git a/c/src/lib/libnetworking/libc/getproto.c b/c/src/lib/libnetworking/libc/getproto.c
deleted file mode 100644
index c2a653f4b4..0000000000
--- a/c/src/lib/libnetworking/libc/getproto.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getproto.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-
-extern int _proto_stayopen;
-
-struct protoent *
-getprotobynumber(proto)
- register int proto;
-{
- register struct protoent *p;
-
- setprotoent(_proto_stayopen);
- while ( (p = getprotoent()) )
- if (p->p_proto == proto)
- break;
- if (!_proto_stayopen)
- endprotoent();
- return (p);
-}
diff --git a/c/src/lib/libnetworking/libc/getprotoent.3 b/c/src/lib/libnetworking/libc/getprotoent.3
deleted file mode 100644
index 784461d7e3..0000000000
--- a/c/src/lib/libnetworking/libc/getprotoent.3
+++ /dev/null
@@ -1,147 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" @(#)getprotoent.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt GETPROTOENT 3
-.Os BSD 4.2
-.Sh NAME
-.Nm getprotoent ,
-.Nm getprotobynumber ,
-.Nm getprotobyname ,
-.Nm setprotoent ,
-.Nm endprotoent
-.Nd get protocol entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Ft struct protoent *
-.Fn getprotoent void
-.Ft struct protoent *
-.Fn getprotobyname "const char *name"
-.Ft struct protoent *
-.Fn getprotobynumber "int proto"
-.Ft void
-.Fn setprotoent "int stayopen"
-.Ft void
-.Fn endprotoent void
-.Sh DESCRIPTION
-The
-.Fn getprotoent ,
-.Fn getprotobyname ,
-and
-.Fn getprotobynumber
-functions
-each return a pointer to an object with the
-following structure
-containing the broken-out
-fields of a line in the network protocol data base,
-.Pa /etc/protocols .
-.Bd -literal -offset indent
-.Pp
-struct protoent {
- char *p_name; /* official name of protocol */
- char **p_aliases; /* alias list */
- int p_proto; /* protocol number */
-};
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width p_aliases
-.It Fa p_name
-The official name of the protocol.
-.It Fa p_aliases
-A zero terminated list of alternate names for the protocol.
-.It Fa p_proto
-The protocol number.
-.El
-.Pp
-The
-.Fn getprotoent
-function
-reads the next line of the file, opening the file if necessary.
-.Pp
-The
-.Fn setprotoent
-function
-opens and rewinds the file. If the
-.Fa stayopen
-flag is non-zero,
-the net data base will not be closed after each call to
-.Fn getprotobyname
-or
-.Fn getprotobynumber .
-.Pp
-The
-.Fn endprotoent
-function
-closes the file.
-.Pp
-The
-.Fn getprotobyname
-function
-and
-.Fn getprotobynumber
-sequentially search from the beginning
-of the file until a matching
-protocol name or
-protocol number is found,
-or until
-.Dv EOF
-is encountered.
-.Sh RETURN VALUES
-Null pointer
-(0) returned on
-.Dv EOF
-or error.
-.Sh FILES
-.Bl -tag -width /etc/protocols -compact
-.It Pa /etc/protocols
-.El
-.Sh SEE ALSO
-.Xr protocols 5
-.Sh HISTORY
-The
-.Fn getprotoent ,
-.Fn getprotobynumber ,
-.Fn getprotobyname ,
-.Fn setprotoent ,
-and
-.Fn endprotoent
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-These functions use a static data space;
-if the data is needed for future use, it should be
-copied before any subsequent calls overwrite it.
-Only the Internet
-protocols are currently understood.
diff --git a/c/src/lib/libnetworking/libc/getprotoent.c b/c/src/lib/libnetworking/libc/getprotoent.c
deleted file mode 100644
index 0b9cefec68..0000000000
--- a/c/src/lib/libnetworking/libc/getprotoent.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getprotoent.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define MAXALIASES 35
-
-static FILE *protof = NULL;
-static char line[BUFSIZ+1];
-static struct protoent proto;
-static char *proto_aliases[MAXALIASES];
-int _proto_stayopen;
-
-void
-setprotoent(f)
- int f;
-{
- if (protof == NULL)
- protof = fopen(_PATH_PROTOCOLS, "r" );
- else
- rewind(protof);
- _proto_stayopen |= f;
-}
-
-void
-endprotoent()
-{
- if (protof) {
- fclose(protof);
- protof = NULL;
- }
- _proto_stayopen = 0;
-}
-
-struct protoent *
-getprotoent()
-{
- char *p;
- register char *cp, **q;
-
- if (protof == NULL && (protof = fopen(_PATH_PROTOCOLS, "r" )) == NULL)
- return (NULL);
-again:
- if ((p = fgets(line, BUFSIZ, protof)) == NULL)
- return (NULL);
- if (*p == '#')
- goto again;
- cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
- proto.p_name = p;
- cp = strpbrk(p, " \t");
- if (cp == NULL)
- goto again;
- *cp++ = '\0';
- while (*cp == ' ' || *cp == '\t')
- cp++;
- p = strpbrk(cp, " \t");
- if (p != NULL)
- *p++ = '\0';
- proto.p_proto = atoi(cp);
- q = proto.p_aliases = proto_aliases;
- if (p != NULL) {
- cp = p;
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &proto_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- }
- *q = NULL;
- return (&proto);
-}
diff --git a/c/src/lib/libnetworking/libc/getprotoname.c b/c/src/lib/libnetworking/libc/getprotoname.c
deleted file mode 100644
index 46880eb005..0000000000
--- a/c/src/lib/libnetworking/libc/getprotoname.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getprotoname.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-#include <string.h>
-
-extern int _proto_stayopen;
-
-struct protoent *
-getprotobyname(name)
- register const char *name;
-{
- register struct protoent *p;
- register char **cp;
-
- setprotoent(_proto_stayopen);
- while ( (p = getprotoent()) ) {
- if (strcmp(p->p_name, name) == 0)
- break;
- for (cp = p->p_aliases; *cp != 0; cp++)
- if (strcmp(*cp, name) == 0)
- goto found;
- }
-found:
- if (!_proto_stayopen)
- endprotoent();
- return (p);
-}
diff --git a/c/src/lib/libnetworking/libc/getservbyname.c b/c/src/lib/libnetworking/libc/getservbyname.c
deleted file mode 100644
index 19936907d3..0000000000
--- a/c/src/lib/libnetworking/libc/getservbyname.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getservbyname.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-#include <string.h>
-
-extern int _serv_stayopen;
-
-struct servent *
-getservbyname(name, proto)
- const char *name, *proto;
-{
- register struct servent *p;
- register char **cp;
-
-#ifdef YP
- extern char *___getservbyname_yp;
- extern char *___getservbyproto_yp;
-
- ___getservbyname_yp = (char *)name;
- ___getservbyproto_yp = (char *)proto;
-#endif
-
- setservent(_serv_stayopen);
- while ( (p = getservent()) ) {
- if (strcmp(name, p->s_name) == 0)
- goto gotname;
- for (cp = p->s_aliases; *cp; cp++)
- if (strcmp(name, *cp) == 0)
- goto gotname;
- continue;
-gotname:
- if (proto == 0 || strcmp(p->s_proto, proto) == 0)
- break;
- }
- if (!_serv_stayopen)
- endservent();
-
-#ifdef YP
- ___getservbyname_yp = NULL;
- ___getservbyproto_yp = NULL;
-#endif
-
- return (p);
-}
diff --git a/c/src/lib/libnetworking/libc/getservbyport.c b/c/src/lib/libnetworking/libc/getservbyport.c
deleted file mode 100644
index c8433954e1..0000000000
--- a/c/src/lib/libnetworking/libc/getservbyport.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getservbyport.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-#include <string.h>
-
-extern int _serv_stayopen;
-
-struct servent *
-getservbyport(port, proto)
- int port;
- const char *proto;
-{
- register struct servent *p;
-
-#ifdef YP
- extern int ___getservbyport_yp;
- extern char *___getservbyproto_yp;
-
- ___getservbyport_yp = port;
- ___getservbyproto_yp = (char *)proto;
-#endif
-
- setservent(_serv_stayopen);
- while ( (p = getservent()) ) {
- if (p->s_port != port)
- continue;
- if (proto == 0 || strcmp(p->s_proto, proto) == 0)
- break;
- }
- if (!_serv_stayopen)
- endservent();
-
-#ifdef YP
- ___getservbyport_yp = 0;
- ___getservbyproto_yp = NULL;
-#endif
-
- return (p);
-}
diff --git a/c/src/lib/libnetworking/libc/getservent.3 b/c/src/lib/libnetworking/libc/getservent.3
deleted file mode 100644
index 79c18a3beb..0000000000
--- a/c/src/lib/libnetworking/libc/getservent.3
+++ /dev/null
@@ -1,156 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" From: @(#)getservent.3 8.3 (Berkeley) 1/12/94
-.\" $Id$
-.\"
-.Dd July 9, 1995
-.Dt GETSERVENT 3
-.Os BSD 4.2
-.Sh NAME
-.Nm getservent ,
-.Nm getservbyport ,
-.Nm getservbyname ,
-.Nm setservent ,
-.Nm endservent
-.Nd get service entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Ft struct servent *
-.Fn getservent
-.Ft struct servent *
-.Fn getservbyname "const char *name" "const char *proto"
-.Ft struct servent *
-.Fn getservbyport "int port" "const char *proto"
-.Ft void
-.Fn setservent "int stayopen"
-.Ft void
-.Fn endservent void
-.Sh DESCRIPTION
-The
-.Fn getservent ,
-.Fn getservbyname ,
-and
-.Fn getservbyport
-functions
-each return a pointer to an object with the
-following structure
-containing the broken-out
-fields of a line in the network services data base,
-.Pa /etc/services .
-.Bd -literal -offset indent
-struct servent {
- char *s_name; /* official name of service */
- char **s_aliases; /* alias list */
- int s_port; /* port service resides at */
- char *s_proto; /* protocol to use */
-};
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width s_aliases
-.It Fa s_name
-The official name of the service.
-.It Fa s_aliases
-A zero terminated list of alternate names for the service.
-.It Fa s_port
-The port number at which the service resides.
-Port numbers are returned in network byte order.
-.It Fa s_proto
-The name of the protocol to use when contacting the
-service.
-.El
-.Pp
-The
-.Fn getservent
-function
-reads the next line of the file, opening the file if necessary.
-.Pp
-The
-.Fn setservent
-function
-opens and rewinds the file. If the
-.Fa stayopen
-flag is non-zero,
-the net data base will not be closed after each call to
-.Fn getservbyname
-or
-.Fn getservbyport .
-.Pp
-The
-.Fn endservent
-function
-closes the file.
-.Pp
-The
-.Fn getservbyname
-and
-.Fn getservbyport
-functions
-sequentially search from the beginning
-of the file until a matching
-protocol name or
-port number is found,
-or until
-.Dv EOF
-is encountered.
-If a protocol name is also supplied (non-
-.Dv NULL ) ,
-searches must also match the protocol.
-.ne 1i
-.Sh FILES
-.Bl -tag -width /etc/services -compact
-.It Pa /etc/services
-.El
-.Sh DIAGNOSTICS
-Null pointer
-(0) returned on
-.Dv EOF
-or error.
-.Sh SEE ALSO
-.Xr getprotoent 3 ,
-.Xr services 5
-.Sh HISTORY
-The
-.Fn getservent ,
-.Fn getservbyport ,
-.Fn getservbyname ,
-.Fn setservent ,
-and
-.Fn endservent
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-These functions use static data storage;
-if the data is needed for future use, it should be
-copied before any subsequent calls overwrite it.
-Expecting port numbers to fit in a 32 bit
-quantity is probably naive.
diff --git a/c/src/lib/libnetworking/libc/getservent.c b/c/src/lib/libnetworking/libc/getservent.c
deleted file mode 100644
index 08a05c0975..0000000000
--- a/c/src/lib/libnetworking/libc/getservent.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-static int serv_stepping_yp = 0;
-extern int _yp_check __P(( char ** ));
-#endif
-
-
-#define MAXALIASES 35
-
-static FILE *servf = NULL;
-static char line[BUFSIZ+1];
-static struct servent serv;
-static char *serv_aliases[MAXALIASES];
-int _serv_stayopen;
-
-#ifdef YP
-char *___getservbyname_yp = NULL;
-char *___getservbyproto_yp = NULL;
-int ___getservbyport_yp = 0;
-static char *yp_domain = NULL;
-
-static int
-_getservbyport_yp(line)
- char *line;
-{
- char *result;
- int resultlen;
- char buf[YPMAXRECORD + 2];
- int rv;
-
- snprintf(buf, sizeof(buf), "%d/%s", ntohs(___getservbyport_yp),
- ___getservbyproto_yp);
-
- ___getservbyport_yp = 0;
- ___getservbyproto_yp = NULL;
-
- if(!yp_domain) {
- if(yp_get_default_domain(&yp_domain))
- return (0);
- }
-
- /*
- * We have to be a little flexible here. Ideally you're supposed
- * to have both a services.byname and a services.byport map, but
- * some systems have only services.byname. FreeBSD cheats a little
- * by putting the services.byport information in the same map as
- * services.byname so that either case will work. We allow for both
- * possibilities here: if there is no services.byport map, we try
- * services.byname instead.
- */
- if ((rv = yp_match(yp_domain, "services.byport", buf, strlen(buf),
- &result, &resultlen))) {
- if (rv == YPERR_MAP) {
- if (yp_match(yp_domain, "services.byname", buf,
- strlen(buf), &result, &resultlen))
- return(0);
- } else
- return(0);
- }
-
- /* getservent() expects lines terminated with \n -- make it happy */
- snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
-
- free(result);
- return(1);
-}
-
-static int
-_getservbyname_yp(line)
- char *line;
-{
- char *result;
- int resultlen;
- char buf[YPMAXRECORD + 2];
-
- if(!yp_domain) {
- if(yp_get_default_domain(&yp_domain))
- return (0);
- }
-
- snprintf(buf, sizeof(buf), "%s/%s", ___getservbyname_yp,
- ___getservbyproto_yp);
-
- ___getservbyname_yp = 0;
- ___getservbyproto_yp = NULL;
-
- if (yp_match(yp_domain, "services.byname", buf, strlen(buf),
- &result, &resultlen)) {
- return(0);
- }
-
- /* getservent() expects lines terminated with \n -- make it happy */
- snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
-
- free(result);
- return(1);
-}
-
-static int
-_getservent_yp(line)
- char *line;
-{
- static char *key = NULL;
- static int keylen;
- char *lastkey, *result;
- int resultlen;
- int rv;
-
- if(!yp_domain) {
- if(yp_get_default_domain(&yp_domain))
- return (0);
- }
-
- if (!serv_stepping_yp) {
- if (key)
- free(key);
- if ((rv = yp_first(yp_domain, "services.byname", &key, &keylen,
- &result, &resultlen))) {
- serv_stepping_yp = 0;
- return(0);
- }
- serv_stepping_yp = 1;
- } else {
- lastkey = key;
- rv = yp_next(yp_domain, "services.byname", key, keylen, &key,
- &keylen, &result, &resultlen);
- free(lastkey);
- if (rv) {
- serv_stepping_yp = 0;
- return (0);
- }
- }
-
- /* getservent() expects lines terminated with \n -- make it happy */
- snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
-
- free(result);
-
- return(1);
-}
-#endif
-
-void
-setservent(f)
- int f;
-{
- if (servf == NULL)
- servf = fopen(_PATH_SERVICES, "r" );
- else
- rewind(servf);
- _serv_stayopen |= f;
-}
-
-void
-endservent()
-{
- if (servf) {
- fclose(servf);
- servf = NULL;
- }
- _serv_stayopen = 0;
-}
-
-struct servent *
-getservent()
-{
- char *p;
- register char *cp, **q;
-
-#ifdef YP
- if (serv_stepping_yp && _getservent_yp(line)) {
- p = (char *)&line;
- goto unpack;
- }
-tryagain:
-#endif
- if (servf == NULL && (servf = fopen(_PATH_SERVICES, "r" )) == NULL)
- return (NULL);
-again:
- if ((p = fgets(line, BUFSIZ, servf)) == NULL)
- return (NULL);
-#ifdef YP
- if (*p == '+' && _yp_check(NULL)) {
- if (___getservbyname_yp != NULL) {
- if (!_getservbyname_yp(line))
- goto tryagain;
- }
- else if (___getservbyport_yp != 0) {
- if (!_getservbyport_yp(line))
- goto tryagain;
- }
- else if (!_getservent_yp(line))
- goto tryagain;
- }
-unpack:
-#endif
- if (*p == '#')
- goto again;
- cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
- serv.s_name = p;
- p = strpbrk(p, " \t");
- if (p == NULL)
- goto again;
- *p++ = '\0';
- while (*p == ' ' || *p == '\t')
- p++;
- cp = strpbrk(p, ",/");
- if (cp == NULL)
- goto again;
- *cp++ = '\0';
- serv.s_port = htons((u_short)atoi(p));
- serv.s_proto = cp;
- q = serv.s_aliases = serv_aliases;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &serv_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&serv);
-}
diff --git a/c/src/lib/libnetworking/libc/herror.c b/c/src/lib/libnetworking/libc/herror.c
deleted file mode 100644
index ba1dae934d..0000000000
--- a/c/src/lib/libnetworking/libc/herror.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 1987, 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.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <netdb.h>
-#include <string.h>
-#include <unistd.h>
-
-const char *h_errlist[] = {
- "Resolver Error 0 (no error)",
- "Unknown host", /* 1 HOST_NOT_FOUND */
- "Host name lookup failure", /* 2 TRY_AGAIN */
- "Unknown server error", /* 3 NO_RECOVERY */
- "No address associated with name", /* 4 NO_ADDRESS */
-};
-int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] };
-
-int h_errno;
-
-/*
- * herror --
- * print the error indicated by the h_errno value.
- */
-void
-herror(s)
- const char *s;
-{
-#if 0
- struct iovec iov[4];
- register struct iovec *v = iov;
-
- if (s && *s) {
- v->iov_base = (char *)s;
- v->iov_len = strlen(s);
- v++;
- v->iov_base = ": ";
- v->iov_len = 2;
- v++;
- }
- v->iov_base = (char *)hstrerror(h_errno);
- v->iov_len = strlen(v->iov_base);
- v++;
- v->iov_base = "\n";
- v->iov_len = 1;
- writev(STDERR_FILENO, iov, (v - iov) + 1);
-#else
- /*
- * RTEMS: no writev yet
- */
- if (s && *s) {
- write (2, s, strlen (s));
- write (2, ": ", 2);
- }
- s = (char *)hstrerror(h_errno);
- write (2, s, strlen (s));
- write (2, "\n", 1);
-#endif
-}
-
-const char *
-hstrerror(err)
- int err;
-{
- if (err < 0)
- return ("Resolver internal error");
- else if (err < h_nerr)
- return (h_errlist[err]);
- return ("Unknown resolver error");
-}
diff --git a/c/src/lib/libnetworking/libc/inet.3 b/c/src/lib/libnetworking/libc/inet.3
deleted file mode 100644
index 1052f538f2..0000000000
--- a/c/src/lib/libnetworking/libc/inet.3
+++ /dev/null
@@ -1,210 +0,0 @@
-.\" Copyright (c) 1983, 1990, 1991, 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.
-.\"
-.\" From: @(#)inet.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 17, 1996
-.Dt INET 3
-.Os BSD 4.2
-.Sh NAME
-.Nm inet_aton ,
-.Nm inet_addr ,
-.Nm inet_network ,
-.Nm inet_ntoa ,
-.Nm inet_makeaddr ,
-.Nm inet_lnaof ,
-.Nm inet_netof
-.Nd Internet address manipulation routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/socket.h>
-.Fd #include <netinet/in.h>
-.Fd #include <arpa/inet.h>
-.Ft int
-.Fn inet_aton "const char *cp" "struct in_addr *pin"
-.Ft unsigned long
-.Fn inet_addr "const char *cp"
-.Ft unsigned long
-.Fn inet_network "const char *cp"
-.Ft char *
-.Fn inet_ntoa "struct in_addr in"
-.Ft struct in_addr
-.Fn inet_makeaddr "unsigned long net" "unsigned long lna"
-.Ft unsigned long
-.Fn inet_lnaof "struct in_addr in"
-.Ft unsigned long
-.Fn inet_netof "struct in_addr in"
-.Sh DESCRIPTION
-The routines
-.Fn inet_aton ,
-.Fn inet_addr
-and
-.Fn inet_network
-interpret character strings representing
-numbers expressed in the Internet standard
-.Ql \&.
-notation.
-The
-.Fn inet_aton
-routine interprets the specified character string as an Internet address,
-placing the address into the structure provided.
-It returns 1 if the string was successfully interpreted,
-or 0 if the string is invalid.
-The
-.Fn inet_addr
-and
-.Fn inet_network
-functions return numbers suitable for use
-as Internet addresses and Internet network
-numbers, respectively.
-The routine
-.Fn inet_ntoa
-takes an Internet address and returns an
-.Tn ASCII
-string representing the address in
-.Ql \&.
-notation. The routine
-.Fn inet_makeaddr
-takes an Internet network number and a local
-network address and constructs an Internet address
-from it. The routines
-.Fn inet_netof
-and
-.Fn inet_lnaof
-break apart Internet host addresses, returning
-the network number and local network address part,
-respectively.
-.Pp
-All Internet addresses are returned in network
-order (bytes ordered from left to right).
-All network numbers and local address parts are
-returned as machine format integer values.
-.Sh INTERNET ADDRESSES
-Values specified using the
-.Ql \&.
-notation take one
-of the following forms:
-.Bd -literal -offset indent
-a.b.c.d
-a.b.c
-a.b
-a
-.Ed
-.Pp
-When four parts are specified, each is interpreted
-as a byte of data and assigned, from left to right,
-to the four bytes of an Internet address. Note
-that when an Internet address is viewed as a 32-bit
-integer quantity on the
-.Tn VAX
-the bytes referred to
-above appear as
-.Dq Li d.c.b.a .
-That is,
-.Tn VAX
-bytes are
-ordered from right to left.
-.Pp
-When a three part address is specified, the last
-part is interpreted as a 16-bit quantity and placed
-in the right-most two bytes of the network address.
-This makes the three part address format convenient
-for specifying Class B network addresses as
-.Dq Li 128.net.host .
-.Pp
-When a two part address is supplied, the last part
-is interpreted as a 24-bit quantity and placed in
-the right most three bytes of the network address.
-This makes the two part address format convenient
-for specifying Class A network addresses as
-.Dq Li net.host .
-.Pp
-When only one part is given, the value is stored
-directly in the network address without any byte
-rearrangement.
-.Pp
-All numbers supplied as
-.Dq parts
-in a
-.Ql \&.
-notation
-may be decimal, octal, or hexadecimal, as specified
-in the C language (i.e., a leading 0x or 0X implies
-hexadecimal; otherwise, a leading 0 implies octal;
-otherwise, the number is interpreted as decimal).
-.Pp
-The
-.Fn inet_aton
-and
-.Fn inet_ntoa
-functions are semi-deprecated in favor of the
-.Xr addr2ascii 3
-family. However, since those functions are not yet widely implemented,
-portable programs cannot rely on their presence and will continue
-to use the
-.Xr inet 3
-functions for some time.
-.Sh DIAGNOSTICS
-The constant
-.Dv INADDR_NONE
-is returned by
-.Fn inet_addr
-and
-.Fn inet_network
-for malformed requests.
-.Sh SEE ALSO
-.Xr addr2ascii 3 ,
-.Xr gethostbyname 3 ,
-.Xr getnetent 3 ,
-.Xr hosts 5 ,
-.Xr networks 5
-.Sh HISTORY
-These
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-The value
-.Dv INADDR_NONE
-(0xffffffff) is a valid broadcast address, but
-.Fn inet_addr
-cannot return that value without indicating failure.
-The newer
-.Fn inet_aton
-function does not share this problem.
-The problem of host byte ordering versus network byte ordering is
-confusing.
-The string returned by
-.Fn inet_ntoa
-resides in a static memory area.
-.Pp
-Inet_addr should return a
-.Fa struct in_addr .
diff --git a/c/src/lib/libnetworking/libc/inet_addr.c b/c/src/lib/libnetworking/libc/inet_addr.c
deleted file mode 100644
index 225ccc1269..0000000000
--- a/c/src/lib/libnetworking/libc/inet_addr.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * ++Copyright++ 1983, 1990, 1993
- * -
- * Copyright (c) 1983, 1990, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <ctype.h>
-
-/*
- * Ascii internet address interpretation routine.
- * The value returned is in network order.
- */
-u_long
-inet_addr(cp)
- register const char *cp;
-{
- struct in_addr val;
-
- if (inet_aton(cp, &val))
- return (val.s_addr);
- return (INADDR_NONE);
-}
-
-/*
- * Check whether "cp" is a valid ascii representation
- * of an Internet address and convert to a binary address.
- * Returns 1 if the address is valid, 0 if not.
- * This replaces inet_addr, the return value from which
- * cannot distinguish between failure and a local broadcast address.
- */
-int
-inet_aton(cp, addr)
- register const char *cp;
- struct in_addr *addr;
-{
- register u_long val;
- register int base, n;
- register char c;
- u_int parts[4];
- register u_int *pp = parts;
-
- c = *cp;
- for (;;) {
- /*
- * Collect number up to ``.''.
- * Values are specified as for C:
- * 0x=hex, 0=octal, isdigit=decimal.
- */
- if (!isdigit((int)c))
- return (0);
- val = 0; base = 10;
- if (c == '0') {
- c = *++cp;
- if (c == 'x' || c == 'X')
- base = 16, c = *++cp;
- else
- base = 8;
- }
- for (;;) {
- if (isascii((int)c) && isdigit((int)c)) {
- val = (val * base) + (c - '0');
- c = *++cp;
- } else if (base == 16 && isascii((int)c) && isxdigit((int)c)) {
- val = (val << 4) |
- (c + 10 - (islower((int)c) ? 'a' : 'A'));
- c = *++cp;
- } else
- break;
- }
- if (c == '.') {
- /*
- * Internet format:
- * a.b.c.d
- * a.b.c (with c treated as 16 bits)
- * a.b (with b treated as 24 bits)
- */
- if (pp >= parts + 3)
- return (0);
- *pp++ = val;
- c = *++cp;
- } else
- break;
- }
- /*
- * Check for trailing characters.
- */
- if (c != '\0' && (!isascii((int)c) || !isspace((int)c)))
- return (0);
- /*
- * Concoct the address according to
- * the number of parts specified.
- */
- n = pp - parts + 1;
- switch (n) {
-
- case 0:
- return (0); /* initial nondigit */
-
- case 1: /* a -- 32 bits */
- break;
-
- case 2: /* a.b -- 8.24 bits */
- if (val > 0xffffff)
- return (0);
- val |= parts[0] << 24;
- break;
-
- case 3: /* a.b.c -- 8.8.16 bits */
- if (val > 0xffff)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16);
- break;
-
- case 4: /* a.b.c.d -- 8.8.8.8 bits */
- if (val > 0xff)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
- break;
- }
- if (addr)
- addr->s_addr = htonl(val);
- return (1);
-}
diff --git a/c/src/lib/libnetworking/libc/inet_lnaof.c b/c/src/lib/libnetworking/libc/inet_lnaof.c
deleted file mode 100644
index 6ec6a9aef1..0000000000
--- a/c/src/lib/libnetworking/libc/inet_lnaof.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_lnaof.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Return the local network address portion of an
- * internet address; handles class a/b/c network
- * number formats.
- */
-u_long
-inet_lnaof(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return ((i)&IN_CLASSA_HOST);
- else if (IN_CLASSB(i))
- return ((i)&IN_CLASSB_HOST);
- else
- return ((i)&IN_CLASSC_HOST);
-}
diff --git a/c/src/lib/libnetworking/libc/inet_makeaddr.c b/c/src/lib/libnetworking/libc/inet_makeaddr.c
deleted file mode 100644
index ce84170ed9..0000000000
--- a/c/src/lib/libnetworking/libc/inet_makeaddr.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_makeaddr.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Formulate an Internet address from network + host. Used in
- * building addresses stored in the ifnet structure.
- */
-struct in_addr
-inet_makeaddr(net, host)
- u_long net, host;
-{
- u_long addr;
-
- if (net < 128)
- addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
- else if (net < 65536)
- addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
- else if (net < 16777216L)
- addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
- else
- addr = net | host;
- addr = htonl(addr);
- return (*(struct in_addr *)&addr);
-}
diff --git a/c/src/lib/libnetworking/libc/inet_net_ntop.c b/c/src/lib/libnetworking/libc/inet_net_ntop.c
deleted file mode 100644
index 4c7893d417..0000000000
--- a/c/src/lib/libnetworking/libc/inet_net_ntop.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char orig_rcsid[] = "From Id: inet_net_ntop.c,v 8.2 1996/08/08 06:54:44 vixie Exp";
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-static char * inet_net_ntop_ipv4 __P((const u_char *src, int bits,
- char *dst, size_t size));
-
-/*
- * char *
- * inet_net_ntop(af, src, bits, dst, size)
- * convert network number from network to presentation format.
- * generates CIDR style result always.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * author:
- * Paul Vixie (ISC), July 1996
- */
-char *
-inet_net_ntop(af, src, bits, dst, size)
- int af;
- const void *src;
- int bits;
- char *dst;
- size_t size;
-{
- switch (af) {
- case AF_INET:
- return (inet_net_ntop_ipv4(src, bits, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (NULL);
- }
-}
-
-/*
- * static char *
- * inet_net_ntop_ipv4(src, bits, dst, size)
- * convert IPv4 network number from network to presentation format.
- * generates CIDR style result always.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * note:
- * network byte order assumed. this means 192.5.5.240/28 has
- * 0x11110000 in its fourth octet.
- * author:
- * Paul Vixie (ISC), July 1996
- */
-static char *
-inet_net_ntop_ipv4(src, bits, dst, size)
- const u_char *src;
- int bits;
- char *dst;
- size_t size;
-{
- char *odst = dst;
- char *t;
- u_int m;
- int b;
-
- if (bits < 0 || bits > 32) {
- errno = EINVAL;
- return (NULL);
- }
- if (bits == 0) {
- if (size < sizeof "0")
- goto emsgsize;
- *dst++ = '0';
- *dst = '\0';
- }
-
- /* Format whole octets. */
- for (b = bits / 8; b > 0; b--) {
- if (size < sizeof "255.")
- goto emsgsize;
- t = dst;
- dst += SPRINTF((dst, "%u", *src++));
- if (b > 1) {
- *dst++ = '.';
- *dst = '\0';
- }
- size -= (size_t)(dst - t);
- }
-
- /* Format partial octet. */
- b = bits % 8;
- if (b > 0) {
- if (size < sizeof ".255")
- goto emsgsize;
- t = dst;
- if (dst != odst)
- *dst++ = '.';
- m = ((1 << b) - 1) << (8 - b);
- dst += SPRINTF((dst, "%u", *src & m));
- size -= (size_t)(dst - t);
- }
-
- /* Format CIDR /width. */
- if (size < sizeof "/32")
- goto emsgsize;
- dst += SPRINTF((dst, "/%u", bits));
- return (odst);
-
- emsgsize:
- errno = EMSGSIZE;
- return (NULL);
-}
diff --git a/c/src/lib/libnetworking/libc/inet_net_pton.c b/c/src/lib/libnetworking/libc/inet_net_pton.c
deleted file mode 100644
index 8915c2a5be..0000000000
--- a/c/src/lib/libnetworking/libc/inet_net_pton.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char orig_rcsid[] = "From Id: inet_net_pton.c,v 1.8 1996/11/21 10:28:12 vixie Exp $";
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-static int inet_net_pton_ipv4 __P((const char *src, u_char *dst,
- size_t size));
-
-/*
- * static int
- * inet_net_pton(af, src, dst, size)
- * convert network number from presentation to network format.
- * accepts hex octets, hex strings, decimal octets, and /CIDR.
- * "size" is in bytes and describes "dst".
- * return:
- * number of bits, either imputed classfully or specified with /CIDR,
- * or -1 if some failure occurred (check errno). ENOENT means it was
- * not a valid network specification.
- * author:
- * Paul Vixie (ISC), June 1996
- */
-int
-inet_net_pton(af, src, dst, size)
- int af;
- const char *src;
- void *dst;
- size_t size;
-{
- switch (af) {
- case AF_INET:
- return (inet_net_pton_ipv4(src, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (-1);
- }
-}
-
-/*
- * static int
- * inet_net_pton_ipv4(src, dst, size)
- * convert IPv4 network number from presentation to network format.
- * accepts hex octets, hex strings, decimal octets, and /CIDR.
- * "size" is in bytes and describes "dst".
- * return:
- * number of bits, either imputed classfully or specified with /CIDR,
- * or -1 if some failure occurred (check errno). ENOENT means it was
- * not an IPv4 network specification.
- * note:
- * network byte order assumed. this means 192.5.5.240/28 has
- * 0x11110000 in its fourth octet.
- * author:
- * Paul Vixie (ISC), June 1996
- */
-static int
-inet_net_pton_ipv4(src, dst, size)
- const char *src;
- u_char *dst;
- size_t size;
-{
- static const char
- xdigits[] = "0123456789abcdef",
- digits[] = "0123456789";
- int n, ch, tmp, dirty, bits;
- const u_char *odst = dst;
-
- ch = *src++;
- if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
- && isascii(src[1]) && isxdigit(src[1])) {
- /* Hexadecimal: Eat nybble string. */
- if (size <= 0)
- goto emsgsize;
- *dst = 0, dirty = 0;
- src++; /* skip x or X. */
- while ((ch = *src++) != '\0' &&
- isascii(ch) && isxdigit(ch)) {
- if (isupper(ch))
- ch = tolower(ch);
- n = strchr(xdigits, ch) - xdigits;
- assert(n >= 0 && n <= 15);
- *dst |= n;
- if (!dirty++)
- *dst <<= 4;
- else if (size-- > 0)
- *++dst = 0, dirty = 0;
- else
- goto emsgsize;
- }
- if (dirty)
- size--;
- } else if (isascii(ch) && isdigit(ch)) {
- /* Decimal: eat dotted digit string. */
- for (;;) {
- tmp = 0;
- do {
- n = strchr(digits, ch) - digits;
- assert(n >= 0 && n <= 9);
- tmp *= 10;
- tmp += n;
- if (tmp > 255)
- goto enoent;
- } while ((ch = *src++) != '\0' &&
- isascii(ch) && isdigit(ch));
- if (size-- <= 0)
- goto emsgsize;
- *dst++ = (u_char) tmp;
- if (ch == '\0' || ch == '/')
- break;
- if (ch != '.')
- goto enoent;
- ch = *src++;
- if (!isascii(ch) || !isdigit(ch))
- goto enoent;
- }
- } else
- goto enoent;
-
- bits = -1;
- if (ch == '/' && isascii(src[0]) && isdigit(src[0]) && dst > odst) {
- /* CIDR width specifier. Nothing can follow it. */
- ch = *src++; /* Skip over the /. */
- bits = 0;
- do {
- n = strchr(digits, ch) - digits;
- assert(n >= 0 && n <= 9);
- bits *= 10;
- bits += n;
- } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
- if (ch != '\0')
- goto enoent;
- if (bits > 32)
- goto emsgsize;
- }
-
- /* Firey death and destruction unless we prefetched EOS. */
- if (ch != '\0')
- goto enoent;
-
- /* If nothing was written to the destination, we found no address. */
- if (dst == odst)
- goto enoent;
- /* If no CIDR spec was given, infer width from net class. */
- if (bits == -1) {
- if (*odst >= 240) /* Class E */
- bits = 32;
- else if (*odst >= 224) /* Class D */
- bits = 4;
- else if (*odst >= 192) /* Class C */
- bits = 24;
- else if (*odst >= 128) /* Class B */
- bits = 16;
- else /* Class A */
- bits = 8;
- /* If imputed mask is narrower than specified octets, widen. */
- if (bits >= 8 && bits < ((dst - odst) * 8))
- bits = (dst - odst) * 8;
- }
- /* Extend network to cover the actual mask. */
- while (bits > ((dst - odst) * 8)) {
- if (size-- <= 0)
- goto emsgsize;
- *dst++ = '\0';
- }
- return (bits);
-
- enoent:
- errno = ENOENT;
- return (-1);
-
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
diff --git a/c/src/lib/libnetworking/libc/inet_neta.c b/c/src/lib/libnetworking/libc/inet_neta.c
deleted file mode 100644
index 59b156f7f6..0000000000
--- a/c/src/lib/libnetworking/libc/inet_neta.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char orig_rcsid[] = "From Id: inet_neta.c,v 8.2 1996/08/08 06:54:44 vixie Exp";
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-/*
- * char *
- * inet_neta(src, dst, size)
- * format a u_long network number into presentation format.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * note:
- * format of ``src'' is as for inet_network().
- * author:
- * Paul Vixie (ISC), July 1996
- */
-char *
-inet_neta(src, dst, size)
- u_long src;
- char *dst;
- size_t size;
-{
- char *odst = dst;
- char *tp;
-
- while (src & 0xffffffff) {
- u_char b = (src & 0xff000000) >> 24;
-
- src <<= 8;
- if (b) {
- if (size < sizeof "255.")
- goto emsgsize;
- tp = dst;
- dst += SPRINTF((dst, "%u", b));
- if (src != 0L) {
- *dst++ = '.';
- *dst = '\0';
- }
- size -= (size_t)(dst - tp);
- }
- }
- if (dst == odst) {
- if (size < sizeof "0.0.0.0")
- goto emsgsize;
- strcpy(dst, "0.0.0.0");
- }
- return (odst);
-
- emsgsize:
- errno = EMSGSIZE;
- return (NULL);
-}
diff --git a/c/src/lib/libnetworking/libc/inet_netof.c b/c/src/lib/libnetworking/libc/inet_netof.c
deleted file mode 100644
index 179731efc3..0000000000
--- a/c/src/lib/libnetworking/libc/inet_netof.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_netof.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Return the network number from an internet
- * address; handles class a/b/c network #'s.
- */
-u_long
-inet_netof(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
- else if (IN_CLASSB(i))
- return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT);
- else
- return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
-}
diff --git a/c/src/lib/libnetworking/libc/inet_network.c b/c/src/lib/libnetworking/libc/inet_network.c
deleted file mode 100644
index ac0073bf0a..0000000000
--- a/c/src/lib/libnetworking/libc/inet_network.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_network.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <ctype.h>
-
-/*
- * Internet network address interpretation routine.
- * The library routines call this routine to interpret
- * network numbers.
- */
-u_long
-inet_network(cp)
- register const char *cp;
-{
- register u_long val, base, n, i;
- register char c;
- u_long parts[4], *pp = parts;
-
-again:
- val = 0; base = 10;
- if (*cp == '0')
- base = 8, cp++;
- if (*cp == 'x' || *cp == 'X')
- base = 16, cp++;
- while ((c = *cp) != 0) {
- if (isdigit(c)) {
- val = (val * base) + (c - '0');
- cp++;
- continue;
- }
- if (base == 16 && isxdigit(c)) {
- val = (val << 4) + (c + 10 - (islower(c) ? 'a' : 'A'));
- cp++;
- continue;
- }
- break;
- }
- if (*cp == '.') {
- if (pp >= parts + 3)
- return (INADDR_NONE);
- *pp++ = val, cp++;
- goto again;
- }
- if (*cp && !isspace(*cp))
- return (INADDR_NONE);
- *pp++ = val;
- n = pp - parts;
- for (val = 0, i = 0; i < n; i++) {
- val <<= 8;
- val |= parts[i] & 0xff;
- }
- return (val);
-}
diff --git a/c/src/lib/libnetworking/libc/inet_ntoa.c b/c/src/lib/libnetworking/libc/inet_ntoa.c
deleted file mode 100644
index 44b686f0b3..0000000000
--- a/c/src/lib/libnetworking/libc/inet_ntoa.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_ntoa.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <stdio.h>
-
-/*
- * Convert network-format internet address
- * to base 256 d.d.d.d representation.
- */
-char *
-inet_ntoa(in)
- struct in_addr in;
-{
- static char ret[18];
-
- strcpy(ret, "[inet_ntoa error]");
- (void) inet_ntop(AF_INET, &in, ret, sizeof ret);
- return (ret);
-}
diff --git a/c/src/lib/libnetworking/libc/inet_ntop.c b/c/src/lib/libnetworking/libc/inet_ntop.c
deleted file mode 100644
index 76a538755a..0000000000
--- a/c/src/lib/libnetworking/libc/inet_ntop.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/* Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-/*
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static const char *inet_ntop4 __P((const u_char *src, char *dst, size_t size));
-static const char *inet_ntop6 __P((const u_char *src, char *dst, size_t size));
-
-/* char *
- * inet_ntop(af, src, dst, size)
- * convert a network format address to presentation format.
- * return:
- * pointer to presentation format address (`dst'), or NULL (see errno).
- * author:
- * Paul Vixie, 1996.
- */
-const char *
-inet_ntop(af, src, dst, size)
- int af;
- const void *src;
- char *dst;
- size_t size;
-{
- switch (af) {
- case AF_INET:
- return (inet_ntop4(src, dst, size));
- case AF_INET6:
- return (inet_ntop6(src, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (NULL);
- }
- /* NOTREACHED */
-}
-
-/* const char *
- * inet_ntop4(src, dst, size)
- * format an IPv4 address, more or less like inet_ntoa()
- * return:
- * `dst' (as a const)
- * notes:
- * (1) uses no statics
- * (2) takes a u_char* not an in_addr as input
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop4(src, dst, size)
- const u_char *src;
- char *dst;
- size_t size;
-{
- static const char fmt[] = "%u.%u.%u.%u";
- char tmp[sizeof "255.255.255.255"];
-
- if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
- errno = ENOSPC;
- return (NULL);
- }
- strcpy(dst, tmp);
- return (dst);
-}
-
-/* const char *
- * inet_ntop6(src, dst, size)
- * convert IPv6 binary address into presentation (printable) format
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop6(src, dst, size)
- const u_char *src;
- char *dst;
- size_t size;
-{
- /*
- * Note that int32_t and int16_t need only be "at least" large enough
- * to contain a value of the specified size. On some systems, like
- * Crays, there is no such thing as an integer variable with 16 bits.
- * Keep this in mind if you think this function should have been coded
- * to use pointer overlays. All the world's not a VAX.
- */
- char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
- struct { int base, len; } best, cur;
- u_int words[NS_IN6ADDRSZ / NS_INT16SZ];
- int i;
-
- /*
- * Preprocess:
- * Copy the input (bytewise) array into a wordwise array.
- * Find the longest run of 0x00's in src[] for :: shorthanding.
- */
- memset(words, '\0', sizeof words);
- for (i = 0; i < NS_IN6ADDRSZ; i++)
- words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
- best.base = -1;
- cur.base = -1;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
- if (words[i] == 0) {
- if (cur.base == -1)
- cur.base = i, cur.len = 1;
- else
- cur.len++;
- } else {
- if (cur.base != -1) {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- cur.base = -1;
- }
- }
- }
- if (cur.base != -1) {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- }
- if (best.base != -1 && best.len < 2)
- best.base = -1;
-
- /*
- * Format the result.
- */
- tp = tmp;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
- /* Are we inside the best run of 0x00's? */
- if (best.base != -1 && i >= best.base &&
- i < (best.base + best.len)) {
- if (i == best.base)
- *tp++ = ':';
- continue;
- }
- /* Are we following an initial run of 0x00s or any real hex? */
- if (i != 0)
- *tp++ = ':';
- /* Is this address an encapsulated IPv4? */
- if (i == 6 && best.base == 0 &&
- (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
- if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
- return (NULL);
- tp += strlen(tp);
- break;
- }
- tp += SPRINTF((tp, "%x", words[i]));
- }
- /* Was it a trailing run of 0x00's? */
- if (best.base != -1 && (best.base + best.len) ==
- (NS_IN6ADDRSZ / NS_INT16SZ))
- *tp++ = ':';
- *tp++ = '\0';
-
- /*
- * Check for overflow, copy, and we're done.
- */
- if ((size_t)(tp - tmp) > size) {
- errno = ENOSPC;
- return (NULL);
- }
- strcpy(dst, tmp);
- return (dst);
-}
diff --git a/c/src/lib/libnetworking/libc/inet_pton.c b/c/src/lib/libnetworking/libc/inet_pton.c
deleted file mode 100644
index 8d21111cfa..0000000000
--- a/c/src/lib/libnetworking/libc/inet_pton.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/* Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <string.h>
-#include <errno.h>
-
-/*
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static int inet_pton4 __P((const char *src, u_char *dst));
-static int inet_pton6 __P((const char *src, u_char *dst));
-
-/* int
- * inet_pton(af, src, dst)
- * convert from presentation format (which usually means ASCII printable)
- * to network format (which is usually some kind of binary format).
- * return:
- * 1 if the address was valid for the specified address family
- * 0 if the address wasn't valid (`dst' is untouched in this case)
- * -1 if some other error occurred (`dst' is untouched in this case, too)
- * author:
- * Paul Vixie, 1996.
- */
-int
-inet_pton(af, src, dst)
- int af;
- const char *src;
- void *dst;
-{
- switch (af) {
- case AF_INET:
- return (inet_pton4(src, dst));
- case AF_INET6:
- return (inet_pton6(src, dst));
- default:
- errno = EAFNOSUPPORT;
- return (-1);
- }
- /* NOTREACHED */
-}
-
-/* int
- * inet_pton4(src, dst)
- * like inet_aton() but without all the hexadecimal and shorthand.
- * return:
- * 1 if `src' is a valid dotted quad, else 0.
- * notice:
- * does not touch `dst' unless it's returning 1.
- * author:
- * Paul Vixie, 1996.
- */
-static int
-inet_pton4(src, dst)
- const char *src;
- u_char *dst;
-{
- static const char digits[] = "0123456789";
- int saw_digit, octets, ch;
- u_char tmp[NS_INADDRSZ], *tp;
-
- saw_digit = 0;
- octets = 0;
- *(tp = tmp) = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr(digits, ch)) != NULL) {
- u_int new = *tp * 10 + (pch - digits);
-
- if (new > 255)
- return (0);
- *tp = new;
- if (! saw_digit) {
- if (++octets > 4)
- return (0);
- saw_digit = 1;
- }
- } else if (ch == '.' && saw_digit) {
- if (octets == 4)
- return (0);
- *++tp = 0;
- saw_digit = 0;
- } else
- return (0);
- }
- if (octets < 4)
- return (0);
-
- memcpy(dst, tmp, NS_INADDRSZ);
- return (1);
-}
-
-/* int
- * inet_pton6(src, dst)
- * convert presentation level address to network order binary form.
- * return:
- * 1 if `src' is a valid [RFC1884 2.2] address, else 0.
- * notice:
- * (1) does not touch `dst' unless it's returning 1.
- * (2) :: in a full address is silently ignored.
- * credit:
- * inspired by Mark Andrews.
- * author:
- * Paul Vixie, 1996.
- */
-static int
-inet_pton6(src, dst)
- const char *src;
- u_char *dst;
-{
- static const char xdigits_l[] = "0123456789abcdef",
- xdigits_u[] = "0123456789ABCDEF";
- u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
- const char *xdigits, *curtok;
- int ch, saw_xdigit;
- u_int val;
-
- memset((tp = tmp), '\0', NS_IN6ADDRSZ);
- endp = tp + NS_IN6ADDRSZ;
- colonp = NULL;
- /* Leading :: requires some special handling. */
- if (*src == ':')
- if (*++src != ':')
- return (0);
- curtok = src;
- saw_xdigit = 0;
- val = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
- pch = strchr((xdigits = xdigits_u), ch);
- if (pch != NULL) {
- val <<= 4;
- val |= (pch - xdigits);
- if (val > 0xffff)
- return (0);
- saw_xdigit = 1;
- continue;
- }
- if (ch == ':') {
- curtok = src;
- if (!saw_xdigit) {
- if (colonp)
- return (0);
- colonp = tp;
- continue;
- }
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- saw_xdigit = 0;
- val = 0;
- continue;
- }
- if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
- inet_pton4(curtok, tp) > 0) {
- tp += NS_INADDRSZ;
- saw_xdigit = 0;
- break; /* '\0' was seen by inet_pton4(). */
- }
- return (0);
- }
- if (saw_xdigit) {
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- }
- if (colonp != NULL) {
- /*
- * Since some memmove()'s erroneously fail to handle
- * overlapping regions, we'll do the shift by hand.
- */
- const int n = tp - colonp;
- int i;
-
- for (i = 1; i <= n; i++) {
- endp[- i] = colonp[n - i];
- colonp[n - i] = 0;
- }
- tp = endp;
- }
- if (tp != endp)
- return (0);
- memcpy(dst, tmp, NS_IN6ADDRSZ);
- return (1);
-}
diff --git a/c/src/lib/libnetworking/libc/iso_addr.3 b/c/src/lib/libnetworking/libc/iso_addr.3
deleted file mode 100644
index 0c9973bef4..0000000000
--- a/c/src/lib/libnetworking/libc/iso_addr.3
+++ /dev/null
@@ -1,111 +0,0 @@
-.\" Copyright (c) 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.
-.\"
-.\" @(#)iso_addr.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt ISO_ADDR 3
-.Os
-.Sh NAME
-.Nm iso_addr ,
-.Nm iso_ntoa
-.Nd "elementary network address conversion routines for Open System Interconnection
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netiso/iso.h>
-.Ft struct iso_addr *
-.Fn iso_addr "char *cp"
-.Ft char *
-.Fn iso_ntoa "struct iso_addr *isoa"
-.Sh DESCRIPTION
-The routine
-.Fn iso_addr
-interprets character strings representing
-.Tn OSI
-addresses, returning binary information suitable
-for use in system calls.
-The routine
-.Fn iso_ntoa
-takes
-.Tn OSI
-addresses and returns
-.Tn ASCII
-strings representing NSAPs (network service
-access points) in a
-notation inverse to that accepted by
-.Fn iso_addr .
-.Pp
-Unfortunately, no universal standard exists for representing
-.Tn OSI
-network addresses.
-.Pp
-The format employed by
-.Fn iso_addr
-is a sequence of hexadecimal
-.Dq digits
-(optionally separated by periods),
-of the form:
-.Bd -filled -offset indent
-<hex digits>.<hex digits>.<hex digits>
-.Ed
-.Pp
-Each pair of hexadecimal digits represents a byte
-with the leading digit indicating the higher-ordered bits.
-A period following an even number of bytes has no
-effect (but may be used to increase legibility).
-A period following an odd number of bytes has the
-effect of causing the byte of address being translated
-to have its higher order bits filled with zeros.
-.Sh RETURN VALUES
-.Fn iso_ntoa
-always returns a null terminated string.
-.Fn iso_addr
-always returns a pointer to a struct iso_addr.
-(See
-.Sx BUGS . )
-.Sh SEE ALSO
-.Xr iso 4
-.Sh HISTORY
-The
-.Fn iso_addr
-and
-.Fn iso_ntoa
-functions appeared in
-.Bx 4.3 Reno .
-.Sh BUGS
-The returned values
-reside in a static memory area.
-.Pp
-The function
-.Fn iso_addr
-should diagnose improperly formed input, and there should be an unambiguous
-way to recognize this.
diff --git a/c/src/lib/libnetworking/libc/iso_addr.c b/c/src/lib/libnetworking/libc/iso_addr.c
deleted file mode 100644
index eb14e8a72b..0000000000
--- a/c/src/lib/libnetworking/libc/iso_addr.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 1989, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)iso_addr.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <netiso/iso.h>
-#include <string.h>
-
-/* States*/
-#define VIRGIN 0
-#define GOTONE 1
-#define GOTTWO 2
-/* Inputs */
-#define DIGIT (4*0)
-#define END (4*1)
-#define DELIM (4*2)
-
-struct iso_addr *
-iso_addr(addr)
- register const char *addr;
-{
- static struct iso_addr out_addr;
- register char *cp = out_addr.isoa_genaddr;
- char *cplim = cp + sizeof(out_addr.isoa_genaddr);
- register int byte = 0, state = VIRGIN, new;
-
- bzero((char *)&out_addr, sizeof(out_addr));
- do {
- if ((*addr >= '0') && (*addr <= '9')) {
- new = *addr - '0';
- } else if ((*addr >= 'a') && (*addr <= 'f')) {
- new = *addr - 'a' + 10;
- } else if ((*addr >= 'A') && (*addr <= 'F')) {
- new = *addr - 'A' + 10;
- } else if (*addr == 0)
- state |= END;
- else
- state |= DELIM;
- addr++;
- switch (state /* | INPUT */) {
- case GOTTWO | DIGIT:
- *cp++ = byte; /*FALLTHROUGH*/
- case VIRGIN | DIGIT:
- state = GOTONE; byte = new; continue;
- case GOTONE | DIGIT:
- state = GOTTWO; byte = new + (byte << 4); continue;
- default: /* | DELIM */
- state = VIRGIN; *cp++ = byte; byte = 0; continue;
- case GOTONE | END:
- case GOTTWO | END:
- *cp++ = byte; /* FALLTHROUGH */
- case VIRGIN | END:
- break;
- }
- break;
- } while (cp < cplim);
- out_addr.isoa_len = cp - out_addr.isoa_genaddr;
- return (&out_addr);
-}
-
-static char hexlist[] = "0123456789abcdef";
-
-char *
-iso_ntoa(isoa)
- const struct iso_addr *isoa;
-{
- static char tmpbuf[sizeof(isoa->isoa_genaddr)*3];
- const u_char *binary;
- char *cp;
- int i;
-
- binary = isoa->isoa_genaddr;
- cp = tmpbuf;
-
- for (i = 0; i < isoa->isoa_len; i++) {
- *cp++ = hexlist[*binary >> 4];
- *cp++ = hexlist[*binary++ & 0xf];
-
- if ((((i % 2) == 0) && ((i + 1) < isoa->isoa_len)))
- *cp++ = '.';
- }
- *cp = '\0';
- return tmpbuf;
-}
diff --git a/c/src/lib/libnetworking/libc/linkaddr.3 b/c/src/lib/libnetworking/libc/linkaddr.3
deleted file mode 100644
index 6999add0e8..0000000000
--- a/c/src/lib/libnetworking/libc/linkaddr.3
+++ /dev/null
@@ -1,138 +0,0 @@
-.\" Copyright (c) 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" This code is derived from software contributed to Berkeley by
-.\" Donn Seeley at BSDI.
-.\"
-.\" 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.
-.\"
-.\" From: @(#)linkaddr.3 8.1 (Berkeley) 7/28/93
-.\" $Id$
-.\"
-.Dd June 17, 1996
-.Dt LINK_ADDR 3
-.Os BSD 4.4
-.Sh NAME
-.Nm link_addr ,
-.Nm link_ntoa
-.Nd elementary address specification routines for link level access
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/socket.h>
-.Fd #include <net/if_dl.h>
-.Ft void
-.Fn link_addr "const char *addr" "struct sockaddr_dl *sdl"
-.Ft char *
-.Fn link_ntoa "const struct sockaddr_dl *sdl"
-.Sh DESCRIPTION
-The routine
-.Fn link_addr
-interprets character strings representing
-link-level addresses, returning binary information suitable
-for use in system calls.
-The routine
-.Fn link_ntoa
-takes
-a link-level
-address and returns an
-.Tn ASCII
-string representing some of the information present,
-including the link level address itself, and the interface name
-or number, if present.
-This facility is experimental and is
-still subject to change.
-.Pp
-For
-.Fn link_addr ,
-the string
-.Fa addr
-may contain
-an optional network interface identifier of the form
-.Dq "name unit-number" ,
-suitable for the first argument to
-.Xr ifconfig 8 ,
-followed in all cases by a colon and
-an interface address in the form of
-groups of hexadecimal digits
-separated by periods.
-Each group represents a byte of address;
-address bytes are filled left to right from
-low order bytes through high order bytes.
-.Pp
-.\" A regular expression may make this format clearer:
-.\" .Bd -literal -offset indent
-.\" ([a-z]+[0-9]+:)?[0-9a-f]+(\e.[0-9a-f]+)*
-.\" .Ed
-.\" .Pp
-Thus
-.Li le0:8.0.9.13.d.30
-represents an ethernet address
-to be transmitted on the first Lance ethernet interface.
-.Pp
-The direct use of these functions is deprecated in favor of the
-.Xr addr2ascii 3
-interface; however, portable programs cannot rely on the latter as it is
-not yet widely implemented.
-.Sh RETURN VALUES
-.Fn link_ntoa
-always returns a null terminated string.
-.Fn link_addr
-has no return value.
-(See
-.Sx BUGS . )
-.Sh SEE ALSO
-.Xr addr2ascii 3
-.\" .Xr iso 4
-.Sh HISTORY
-The
-.Fn link_addr
-and
-.Fn link_ntoa
-functions appeared in
-.Bx 4.3 Reno .
-.Sh BUGS
-The returned values for link_ntoa
-reside in a static memory area.
-.Pp
-The function
-.Fn link_addr
-should diagnose improperly formed input, and there should be an unambiguous
-way to recognize this.
-.Pp
-If the
-.Va sdl_len
-field of the link socket address
-.Fa sdl
-is 0,
-.Fn link_ntoa
-will not insert a colon before the interface address bytes.
-If this translated address is given to
-.Fn link_addr
-without inserting an initial colon,
-the latter will not interpret it correctly.
diff --git a/c/src/lib/libnetworking/libc/linkaddr.c b/c/src/lib/libnetworking/libc/linkaddr.c
deleted file mode 100644
index 28c16cff05..0000000000
--- a/c/src/lib/libnetworking/libc/linkaddr.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*-
- * Copyright (c) 1990, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)linkaddr.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <net/if_dl.h>
-#include <string.h>
-
-/* States*/
-#define NAMING 0
-#define GOTONE 1
-#define GOTTWO 2
-#define RESET 3
-/* Inputs */
-#define DIGIT (4*0)
-#define END (4*1)
-#define DELIM (4*2)
-#define LETTER (4*3)
-
-void
-link_addr(addr, sdl)
- register const char *addr;
- register struct sockaddr_dl *sdl;
-{
- register char *cp = sdl->sdl_data;
- char *cplim = sdl->sdl_len + (char *)sdl;
- register int byte = 0, state = NAMING, new;
-
- bzero((char *)&sdl->sdl_family, sdl->sdl_len - 1);
- sdl->sdl_family = AF_LINK;
- do {
- state &= ~LETTER;
- if ((*addr >= '0') && (*addr <= '9')) {
- new = *addr - '0';
- } else if ((*addr >= 'a') && (*addr <= 'f')) {
- new = *addr - 'a' + 10;
- } else if ((*addr >= 'A') && (*addr <= 'F')) {
- new = *addr - 'A' + 10;
- } else if (*addr == 0) {
- state |= END;
- } else if (state == NAMING &&
- (((*addr >= 'A') && (*addr <= 'Z')) ||
- ((*addr >= 'a') && (*addr <= 'z'))))
- state |= LETTER;
- else
- state |= DELIM;
- addr++;
- switch (state /* | INPUT */) {
- case NAMING | DIGIT:
- case NAMING | LETTER:
- *cp++ = addr[-1];
- continue;
- case NAMING | DELIM:
- state = RESET;
- sdl->sdl_nlen = cp - sdl->sdl_data;
- continue;
- case GOTTWO | DIGIT:
- *cp++ = byte;
- /* FALLTHROUGH */
- case RESET | DIGIT:
- state = GOTONE;
- byte = new;
- continue;
- case GOTONE | DIGIT:
- state = GOTTWO;
- byte = new + (byte << 4);
- continue;
- default: /* | DELIM */
- state = RESET;
- *cp++ = byte;
- byte = 0;
- continue;
- case GOTONE | END:
- case GOTTWO | END:
- *cp++ = byte;
- /* FALLTHROUGH */
- case RESET | END:
- break;
- }
- break;
- } while (cp < cplim);
- sdl->sdl_alen = cp - LLADDR(sdl);
- new = cp - (char *)sdl;
- if (new > sizeof(*sdl))
- sdl->sdl_len = new;
- return;
-}
-
-static char hexlist[] = "0123456789abcdef";
-
-char *
-link_ntoa(sdl)
- register const struct sockaddr_dl *sdl;
-{
- static char obuf[64];
- register char *out = obuf;
- register int i;
- register u_char *in = (u_char *)LLADDR(sdl);
- u_char *inlim = in + sdl->sdl_alen;
- int firsttime = 1;
-
- if (sdl->sdl_nlen) {
- bcopy(sdl->sdl_data, obuf, sdl->sdl_nlen);
- out += sdl->sdl_nlen;
- if (sdl->sdl_alen)
- *out++ = ':';
- }
- while (in < inlim) {
- if (firsttime)
- firsttime = 0;
- else
- *out++ = '.';
- i = *in++;
- if (i > 0xf) {
- out[1] = hexlist[i & 0xf];
- i >>= 4;
- out[0] = hexlist[i];
- out += 2;
- } else
- *out++ = hexlist[i];
- }
- *out = 0;
- return (obuf);
-}
diff --git a/c/src/lib/libnetworking/libc/map_v4v6.c b/c/src/lib/libnetworking/libc/map_v4v6.c
deleted file mode 100644
index 0f8658e117..0000000000
--- a/c/src/lib/libnetworking/libc/map_v4v6.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * ++Copyright++ 1985, 1988, 1993
- * -
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <ctype.h>
-#include <errno.h>
-#include <syslog.h>
-
-typedef union {
- int32_t al;
- char ac;
-} align;
-
-void
-_map_v4v6_address(src, dst)
- const char *src;
- char *dst;
-{
- u_char *p = (u_char *)dst;
- char tmp[INADDRSZ];
- int i;
-
- /* Stash a temporary copy so our caller can update in place. */
- bcopy(src, tmp, INADDRSZ);
- /* Mark this ipv6 addr as a mapped ipv4. */
- for (i = 0; i < 10; i++)
- *p++ = 0x00;
- *p++ = 0xff;
- *p++ = 0xff;
- /* Retrieve the saved copy and we're done. */
- bcopy(tmp, (void*)p, INADDRSZ);
-}
-
-void
-_map_v4v6_hostent(hp, bpp, lenp)
- struct hostent *hp;
- char **bpp;
- int *lenp;
-{
- char **ap;
-
- if (hp->h_addrtype != AF_INET || hp->h_length != INADDRSZ)
- return;
- hp->h_addrtype = AF_INET6;
- hp->h_length = IN6ADDRSZ;
- for (ap = hp->h_addr_list; *ap; ap++) {
- int i = sizeof(align) - ((u_long)*bpp % sizeof(align));
-
- if (*lenp < (i + IN6ADDRSZ)) {
- /* Out of memory. Truncate address list here. XXX */
- *ap = NULL;
- return;
- }
- *bpp += i;
- *lenp -= i;
- _map_v4v6_address(*ap, *bpp);
- *ap = *bpp;
- *bpp += IN6ADDRSZ;
- *lenp -= IN6ADDRSZ;
- }
-}
diff --git a/c/src/lib/libnetworking/libc/ns.3 b/c/src/lib/libnetworking/libc/ns.3
deleted file mode 100644
index e621ad2d90..0000000000
--- a/c/src/lib/libnetworking/libc/ns.3
+++ /dev/null
@@ -1,131 +0,0 @@
-.\" Copyright (c) 1986, 1991, 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.
-.\"
-.\" @(#)ns.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt NS 3
-.Os BSD 4.3
-.Sh NAME
-.Nm ns_addr ,
-.Nm ns_ntoa
-.Nd Xerox
-.Tn NS Ns (tm)
-address conversion routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netns/ns.h>
-.Ft struct ns_addr
-.Fn ns_addr "char *cp"
-.Ft char *
-.Fn ns_ntoa "struct ns_addr ns"
-.Sh DESCRIPTION
-The routine
-.Fn ns_addr
-interprets character strings representing
-.Tn XNS
-addresses, returning binary information suitable
-for use in system calls.
-The routine
-.Fn ns_ntoa
-takes
-.Tn XNS
-addresses and returns
-.Tn ASCII
-strings representing the address in a
-notation in common use in the Xerox Development Environment:
-.Bd -filled -offset indent
-<network number>.<host number>.<port number>
-.Ed
-.Pp
-Trailing zero fields are suppressed, and each number is printed in hexadecimal,
-in a format suitable for input to
-.Fn ns_addr .
-Any fields lacking super-decimal digits will have a
-trailing
-.Ql H
-appended.
-.Pp
-Unfortunately, no universal standard exists for representing
-.Tn XNS
-addresses.
-An effort has been made to insure that
-.Fn ns_addr
-be compatible with most formats in common use.
-It will first separate an address into 1 to 3 fields using a single delimiter
-chosen from
-period
-.Ql \&. ,
-colon
-.Ql \&:
-or pound-sign
-.Ql \&# .
-Each field is then examined for byte separators (colon or period).
-If there are byte separators, each subfield separated is taken to be
-a small hexadecimal number, and the entirety is taken as a network-byte-ordered
-quantity to be zero extended in the high-network-order bytes.
-Next, the field is inspected for hyphens, in which case
-the field is assumed to be a number in decimal notation
-with hyphens separating the millenia.
-Next, the field is assumed to be a number:
-It is interpreted
-as hexadecimal if there is a leading
-.Ql 0x
-(as in C),
-a trailing
-.Ql H
-(as in Mesa), or there are any super-decimal digits present.
-It is interpreted as octal is there is a leading
-.Ql 0
-and there are no super-octal digits.
-Otherwise, it is converted as a decimal number.
-.Sh RETURN VALUES
-None. (See
-.Sx BUGS . )
-.Sh SEE ALSO
-.Xr hosts 5 ,
-.Xr networks 5
-.Sh HISTORY
-The
-.Fn ns_addr
-and
-.Fn ns_toa
-functions appeared in
-.Bx 4.3 .
-.Sh BUGS
-The string returned by
-.Fn ns_ntoa
-resides in a static memory area.
-The function
-.Fn ns_addr
-should diagnose improperly formed input, and there should be an unambiguous
-way to recognize this.
diff --git a/c/src/lib/libnetworking/libc/ns_addr.c b/c/src/lib/libnetworking/libc/ns_addr.c
deleted file mode 100644
index 18fabe91f1..0000000000
--- a/c/src/lib/libnetworking/libc/ns_addr.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright (c) 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * J.Q. Johnson.
- *
- * 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ns_addr.c 8.1 (Berkeley) 6/7/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netns/ns.h>
-#include <stdio.h>
-#include <string.h>
-
-static struct ns_addr addr, zero_addr;
-
-static void Field(), cvtbase();
-
-struct ns_addr
-ns_addr(name)
- const char *name;
-{
- char separator;
- char *hostname, *socketname, *cp;
- char buf[50];
-
- (void)strncpy(buf, name, sizeof(buf) - 1);
- buf[sizeof(buf) - 1] = '\0';
-
- /*
- * First, figure out what he intends as a field separtor.
- * Despite the way this routine is written, the prefered
- * form 2-272.AA001234H.01777, i.e. XDE standard.
- * Great efforts are made to insure backward compatability.
- */
- if ((hostname = strchr(buf, '#')) != NULL)
- separator = '#';
- else {
- hostname = strchr(buf, '.');
- if ((cp = strchr(buf, ':')) &&
- ((hostname && cp < hostname) || (hostname == 0))) {
- hostname = cp;
- separator = ':';
- } else
- separator = '.';
- }
- if (hostname)
- *hostname++ = 0;
-
- addr = zero_addr;
- Field(buf, addr.x_net.c_net, 4);
- if (hostname == 0)
- return (addr); /* No separator means net only */
-
- socketname = strchr(hostname, separator);
- if (socketname) {
- *socketname++ = 0;
- Field(socketname, (u_char *)&addr.x_port, 2);
- }
-
- Field(hostname, addr.x_host.c_host, 6);
-
- return (addr);
-}
-
-static void
-Field(buf, out, len)
- char *buf;
- u_char *out;
- int len;
-{
- register char *bp = buf;
- int i, ibase, base16 = 0, base10 = 0, clen = 0;
- int hb[6], *hp;
- char *fmt;
-
- /*
- * first try 2-273#2-852-151-014#socket
- */
- if ((*buf != '-') &&
- (1 < (i = sscanf(buf, "%d-%d-%d-%d-%d",
- &hb[0], &hb[1], &hb[2], &hb[3], &hb[4])))) {
- cvtbase(1000L, 256, hb, i, out, len);
- return;
- }
- /*
- * try form 8E1#0.0.AA.0.5E.E6#socket
- */
- if (1 < (i = sscanf(buf,"%x.%x.%x.%x.%x.%x",
- &hb[0], &hb[1], &hb[2], &hb[3], &hb[4], &hb[5]))) {
- cvtbase(256L, 256, hb, i, out, len);
- return;
- }
- /*
- * try form 8E1#0:0:AA:0:5E:E6#socket
- */
- if (1 < (i = sscanf(buf,"%x:%x:%x:%x:%x:%x",
- &hb[0], &hb[1], &hb[2], &hb[3], &hb[4], &hb[5]))) {
- cvtbase(256L, 256, hb, i, out, len);
- return;
- }
- /*
- * This is REALLY stretching it but there was a
- * comma notation separting shorts -- definitely non standard
- */
- if (1 < (i = sscanf(buf,"%x,%x,%x",
- &hb[0], &hb[1], &hb[2]))) {
- hb[0] = htons(hb[0]); hb[1] = htons(hb[1]);
- hb[2] = htons(hb[2]);
- cvtbase(65536L, 256, hb, i, out, len);
- return;
- }
-
- /* Need to decide if base 10, 16 or 8 */
- while (*bp) switch (*bp++) {
-
- case '0': case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '-':
- break;
-
- case '8': case '9':
- base10 = 1;
- break;
-
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- base16 = 1;
- break;
-
- case 'x': case 'X':
- *--bp = '0';
- base16 = 1;
- break;
-
- case 'h': case 'H':
- base16 = 1;
- /* fall into */
-
- default:
- *--bp = 0; /* Ends Loop */
- }
- if (base16) {
- fmt = "%3x";
- ibase = 4096;
- } else if (base10 == 0 && *buf == '0') {
- fmt = "%3o";
- ibase = 512;
- } else {
- fmt = "%3d";
- ibase = 1000;
- }
-
- for (bp = buf; *bp++; ) clen++;
- if (clen == 0) clen++;
- if (clen > 18) clen = 18;
- i = ((clen - 1) / 3) + 1;
- bp = clen + buf - 3;
- hp = hb + i - 1;
-
- while (hp > hb) {
- (void)sscanf(bp, fmt, hp);
- bp[0] = 0;
- hp--;
- bp -= 3;
- }
- (void)sscanf(buf, fmt, hp);
- cvtbase((long)ibase, 256, hb, i, out, len);
-}
-
-static void
-cvtbase(oldbase,newbase,input,inlen,result,reslen)
- long oldbase;
- int newbase;
- int input[];
- int inlen;
- unsigned char result[];
- int reslen;
-{
- int d, e;
- long sum;
-
- e = 1;
- while (e > 0 && reslen > 0) {
- d = 0; e = 0; sum = 0;
- /* long division: input=input/newbase */
- while (d < inlen) {
- sum = sum*oldbase + (long) input[d];
- e += (sum > 0);
- input[d++] = sum / newbase;
- sum %= newbase;
- }
- result[--reslen] = sum; /* accumulate remainder */
- }
- for (d=0; d < reslen; d++)
- result[d] = 0;
-}
diff --git a/c/src/lib/libnetworking/libc/ns_name.c b/c/src/lib/libnetworking/libc/ns_name.c
deleted file mode 100644
index af10d2f062..0000000000
--- a/c/src/lib/libnetworking/libc/ns_name.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-
-#include <errno.h>
-#include <resolv.h>
-#include <string.h>
-
-/* Data. */
-
-static char digits[] = "0123456789";
-
-/* Forward. */
-
-static int special(int);
-static int printable(int);
-static int dn_find(const u_char *, const u_char *,
- const u_char * const *,
- const u_char * const *);
-
-/* Public. */
-
-/*
- * ns_name_ntop(src, dst, dstsiz)
- * Convert an encoded domain name to printable ascii as per RFC1035.
- * return:
- * Number of bytes written to buffer, or -1 (with errno set)
- * notes:
- * The root is returned as "."
- * All other domains are returned in non absolute form
- */
-int
-ns_name_ntop(const u_char *src, char *dst, size_t dstsiz) {
- const u_char *cp;
- char *dn, *eom;
- u_char c;
- u_int n;
-
- cp = src;
- dn = dst;
- eom = dst + dstsiz;
-
- while ((n = *cp++) != 0) {
- if ((n & NS_CMPRSFLGS) != 0) {
- /* Some kind of compression pointer. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (dn != dst) {
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '.';
- }
- if (dn + n >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- for ((void)NULL; n > 0; n--) {
- c = *cp++;
- if (special(c)) {
- if (dn + 1 >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '\\';
- *dn++ = (char)c;
- } else if (!printable(c)) {
- if (dn + 3 >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '\\';
- *dn++ = digits[c / 100];
- *dn++ = digits[(c % 100) / 10];
- *dn++ = digits[c % 10];
- } else {
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = (char)c;
- }
- }
- }
- if (dn == dst) {
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '.';
- }
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '\0';
- return (dn - dst);
-}
-
-/*
- * ns_name_pton(src, dst, dstsiz)
- * Convert a ascii string into an encoded domain name as per RFC1035.
- * return:
- * -1 if it fails
- * 1 if string was fully qualified
- * 0 is string was not fully qualified
- * notes:
- * Enforces label and domain length limits.
- */
-
-int
-ns_name_pton(const char *src, u_char *dst, size_t dstsiz) {
- u_char *label, *bp, *eom;
- int c, n, escaped;
- char *cp;
-
- escaped = 0;
- bp = dst;
- eom = dst + dstsiz;
- label = bp++;
-
- while ((c = *src++) != 0) {
- if (escaped) {
- if ((cp = strchr(digits, c)) != NULL) {
- n = (cp - digits) * 100;
- if ((c = *src++) == 0 ||
- (cp = strchr(digits, c)) == NULL) {
- errno = EMSGSIZE;
- return (-1);
- }
- n += (cp - digits) * 10;
- if ((c = *src++) == 0 ||
- (cp = strchr(digits, c)) == NULL) {
- errno = EMSGSIZE;
- return (-1);
- }
- n += (cp - digits);
- if (n > 255) {
- errno = EMSGSIZE;
- return (-1);
- }
- c = n;
- }
- escaped = 0;
- } else if (c == '\\') {
- escaped = 1;
- continue;
- } else if (c == '.') {
- c = (bp - label - 1);
- if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (label >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *label = c;
- /* Fully qualified ? */
- if (*src == '\0') {
- if (c != 0) {
- if (bp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *bp++ = '\0';
- }
- if ((bp - dst) > MAXCDNAME) {
- errno = EMSGSIZE;
- return (-1);
- }
- return (1);
- }
- if (c == 0) {
- errno = EMSGSIZE;
- return (-1);
- }
- label = bp++;
- continue;
- }
- if (bp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *bp++ = (u_char)c;
- }
- c = (bp - label - 1);
- if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (label >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *label = c;
- if (c != 0) {
- if (bp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *bp++ = 0;
- }
- if ((bp - dst) > MAXCDNAME) { /* src too big */
- errno = EMSGSIZE;
- return (-1);
- }
- return (0);
-}
-
-/*
- * ns_name_unpack(msg, eom, src, dst, dstsiz)
- * Unpack a domain name from a message, source may be compressed.
- * return:
- * -1 if it fails, or consumed octets if it succeeds.
- */
-int
-ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
- u_char *dst, size_t dstsiz)
-{
- const u_char *srcp, *dstlim;
- u_char *dstp;
- int n, len, checked;
-
- len = -1;
- checked = 0;
- dstp = dst;
- srcp = src;
- dstlim = dst + dstsiz;
- if (srcp < msg || srcp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- /* Fetch next label in domain name. */
- while ((n = *srcp++) != 0) {
- /* Check for indirection. */
- switch (n & NS_CMPRSFLGS) {
- case 0:
- /* Limit checks. */
- if (dstp + n + 1 >= dstlim || srcp + n >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- checked += n + 1;
- *dstp++ = n;
- memcpy(dstp, srcp, n);
- dstp += n;
- srcp += n;
- break;
-
- case NS_CMPRSFLGS:
- if (srcp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- if (len < 0)
- len = srcp - src + 1;
- srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff));
- if (srcp < msg || srcp >= eom) { /* Out of range. */
- errno = EMSGSIZE;
- return (-1);
- }
- checked += 2;
- /*
- * Check for loops in the compressed name;
- * if we've looked at the whole message,
- * there must be a loop.
- */
- if (checked >= eom - msg) {
- errno = EMSGSIZE;
- return (-1);
- }
- break;
-
- default:
- errno = EMSGSIZE;
- return (-1); /* flag error */
- }
- }
- *dstp = '\0';
- if (len < 0)
- len = srcp - src;
- return (len);
-}
-
-/*
- * ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr)
- * Pack domain name 'domain' into 'comp_dn'.
- * return:
- * Size of the compressed name, or -1.
- * notes:
- * 'dnptrs' is an array of pointers to previous compressed names.
- * dnptrs[0] is a pointer to the beginning of the message. The array
- * ends with NULL.
- * 'lastdnptr' is a pointer to the end of the array pointed to
- * by 'dnptrs'.
- * Side effects:
- * The list of pointers in dnptrs is updated for labels inserted into
- * the message as we compress the name. If 'dnptr' is NULL, we don't
- * try to compress names. If 'lastdnptr' is NULL, we don't update the
- * list.
- */
-int
-ns_name_pack(const u_char *src, u_char *dst, int dstsiz,
- const u_char **dnptrs, const u_char **lastdnptr)
-{
- u_char *dstp;
- const u_char **cpp, **lpp, *eob, *msg;
- const u_char *srcp;
- int n, l;
-
- srcp = src;
- dstp = dst;
- eob = dstp + dstsiz;
- lpp = cpp = NULL;
- if (dnptrs != NULL) {
- if ((msg = *dnptrs++) != NULL) {
- for (cpp = dnptrs; *cpp != NULL; cpp++)
- (void)NULL;
- lpp = cpp; /* end of list to search */
- }
- } else
- msg = NULL;
-
- /* make sure the domain we are about to add is legal */
- l = 0;
- do {
- n = *srcp;
- if ((n & NS_CMPRSFLGS) != 0) {
- errno = EMSGSIZE;
- return (-1);
- }
- l += n + 1;
- if (l > MAXCDNAME) {
- errno = EMSGSIZE;
- return (-1);
- }
- srcp += n + 1;
- } while (n != 0);
-
- srcp = src;
- do {
- /* Look to see if we can use pointers. */
- n = *srcp;
- if (n != 0 && msg != NULL) {
- l = dn_find(srcp, msg, (const u_char * const *)dnptrs,
- (const u_char * const *)lpp);
- if (l >= 0) {
- if (dstp + 1 >= eob) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dstp++ = (l >> 8) | NS_CMPRSFLGS;
- *dstp++ = l % 256;
- return (dstp - dst);
- }
- /* Not found, save it. */
- if (lastdnptr != NULL && cpp < lastdnptr - 1 &&
- (dstp - msg) < 0x4000) {
- *cpp++ = dstp;
- *cpp = NULL;
- }
- }
- /* copy label to buffer */
- if (n & NS_CMPRSFLGS) { /* Should not happen. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (dstp + 1 + n >= eob) {
- errno = EMSGSIZE;
- return (-1);
- }
- memcpy(dstp, srcp, n + 1);
- srcp += n + 1;
- dstp += n + 1;
- } while (n != 0);
-
- if (dstp > eob) {
- if (msg != NULL)
- *lpp = NULL;
- errno = EMSGSIZE;
- return (-1);
- }
- return (dstp - dst);
-}
-
-/*
- * ns_name_uncompress(msg, eom, src, dst, dstsiz)
- * Expand compressed domain name to presentation format.
- * return:
- * Number of bytes read out of `src', or -1 (with errno set).
- * note:
- * Root domain returns as "." not "".
- */
-int
-ns_name_uncompress(const u_char *msg, const u_char *eom, const u_char *src,
- char *dst, size_t dstsiz)
-{
- u_char tmp[NS_MAXCDNAME];
- int n;
-
- if ((n = ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1)
- return (-1);
- if (ns_name_ntop(tmp, dst, dstsiz) == -1)
- return (-1);
- return (n);
-}
-
-/*
- * ns_name_compress(src, dst, dstsiz, dnptrs, lastdnptr)
- * Compress a domain name into wire format, using compression pointers.
- * return:
- * Number of bytes consumed in `dst' or -1 (with errno set).
- * notes:
- * 'dnptrs' is an array of pointers to previous compressed names.
- * dnptrs[0] is a pointer to the beginning of the message.
- * The list ends with NULL. 'lastdnptr' is a pointer to the end of the
- * array pointed to by 'dnptrs'. Side effect is to update the list of
- * pointers for labels inserted into the message as we compress the name.
- * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr'
- * is NULL, we don't update the list.
- */
-int
-ns_name_compress(const char *src, u_char *dst, size_t dstsiz,
- const u_char **dnptrs, const u_char **lastdnptr)
-{
- u_char tmp[NS_MAXCDNAME];
-
- if (ns_name_pton(src, tmp, sizeof tmp) == -1)
- return (-1);
- return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr));
-}
-
-/*
- * ns_name_skip(ptrptr, eom)
- * Advance *ptrptr to skip over the compressed name it points at.
- * return:
- * 0 on success, -1 (with errno set) on failure.
- */
-int
-ns_name_skip(const u_char **ptrptr, const u_char *eom) {
- const u_char *cp;
- u_int n;
-
- cp = *ptrptr;
- while (cp < eom && (n = *cp++) != 0) {
- /* Check for indirection. */
- switch (n & NS_CMPRSFLGS) {
- case 0: /* normal case, n == len */
- cp += n;
- continue;
- case NS_CMPRSFLGS: /* indirection */
- cp++;
- break;
- default: /* illegal type */
- errno = EMSGSIZE;
- return (-1);
- }
- break;
- }
- if (cp > eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *ptrptr = cp;
- return (0);
-}
-
-/* Private. */
-
-/*
- * special(ch)
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * is this characted special ("in need of quoting") ?
- * return:
- * boolean.
- */
-static int
-special(int ch) {
- switch (ch) {
- case 0x22: /* '"' */
- case 0x2E: /* '.' */
- case 0x3B: /* ';' */
- case 0x5C: /* '\\' */
- /* Special modifiers in zone files. */
- case 0x40: /* '@' */
- case 0x24: /* '$' */
- return (1);
- default:
- return (0);
- }
-}
-
-/*
- * printable(ch)
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * is this character visible and not a space when printed ?
- * return:
- * boolean.
- */
-static int
-printable(int ch) {
- return (ch > 0x20 && ch < 0x7f);
-}
-
-/*
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * convert this character to lower case if it's upper case.
- */
-static int
-mklower(int ch) {
- if (ch >= 0x41 && ch <= 0x5A)
- return (ch + 0x20);
- return (ch);
-}
-
-/*
- * dn_find(domain, msg, dnptrs, lastdnptr)
- * Search for the counted-label name in an array of compressed names.
- * return:
- * offset from msg if found, or -1.
- * notes:
- * dnptrs is the pointer to the first name on the list,
- * not the pointer to the start of the message.
- */
-static int
-dn_find(const u_char *domain, const u_char *msg,
- const u_char * const *dnptrs,
- const u_char * const *lastdnptr)
-{
- const u_char *dn, *cp, *sp;
- const u_char * const *cpp;
- u_int n;
-
- for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
- dn = domain;
- sp = cp = *cpp;
- while ((n = *cp++) != 0) {
- /*
- * check for indirection
- */
- switch (n & NS_CMPRSFLGS) {
- case 0: /* normal case, n == len */
- if (n != *dn++)
- goto next;
- for ((void)NULL; n > 0; n--)
- if (mklower(*dn++) != mklower(*cp++))
- goto next;
- /* Is next root for both ? */
- if (*dn == '\0' && *cp == '\0')
- return (sp - msg);
- if (*dn)
- continue;
- goto next;
-
- case NS_CMPRSFLGS: /* indirection */
- cp = msg + (((n & 0x3f) << 8) | *cp);
- break;
-
- default: /* illegal type */
- errno = EMSGSIZE;
- return (-1);
- }
- }
- next: ;
- }
- errno = ENOENT;
- return (-1);
-}
diff --git a/c/src/lib/libnetworking/libc/ns_netint.c b/c/src/lib/libnetworking/libc/ns_netint.c
deleted file mode 100644
index 3c09da8f8c..0000000000
--- a/c/src/lib/libnetworking/libc/ns_netint.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/* Import. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-
-u_int
-ns_get16(const u_char *src) {
- u_int dst;
-
- NS_GET16(dst, src);
- return (dst);
-}
-
-u_long
-ns_get32(const u_char *src) {
- u_long dst;
-
- NS_GET32(dst, src);
- return (dst);
-}
-
-void
-ns_put16(u_int src, u_char *dst) {
- NS_PUT16(src, dst);
-}
-
-void
-ns_put32(u_long src, u_char *dst) {
- NS_PUT32(src, dst);
-}
diff --git a/c/src/lib/libnetworking/libc/ns_ntoa.c b/c/src/lib/libnetworking/libc/ns_ntoa.c
deleted file mode 100644
index 9d0be2e1dc..0000000000
--- a/c/src/lib/libnetworking/libc/ns_ntoa.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 1986, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ns_ntoa.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netns/ns.h>
-#include <stdio.h>
-
-char *
-ns_ntoa(addr)
- struct ns_addr addr;
-{
- static char obuf[40];
- union { union ns_net net_e; u_long long_e; } net;
- u_short port = htons(addr.x_port);
- register char *cp;
- char *cp2;
- register u_char *up = addr.x_host.c_host;
- u_char *uplim = up + 6;
- static char *spectHex();
-
- net.net_e = addr.x_net;
- sprintf(obuf, "%lx", (u_long)ntohl(net.long_e));
- cp = spectHex(obuf);
- cp2 = cp + 1;
- while (*up==0 && up < uplim) up++;
- if (up == uplim) {
- if (port) {
- sprintf(cp, ".0");
- cp += 2;
- }
- } else {
- sprintf(cp, ".%x", *up++);
- while (up < uplim) {
- while (*cp) cp++;
- sprintf(cp, "%02x", *up++);
- }
- cp = spectHex(cp2);
- }
- if (port) {
- sprintf(cp, ".%x", port);
- spectHex(cp + 1);
- }
- return (obuf);
-}
-
-static char *
-spectHex(p0)
- char *p0;
-{
- int ok = 0;
- int nonzero = 0;
- register char *p = p0;
- for (; *p; p++) switch (*p) {
-
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- *p += ('A' - 'a');
- /* fall into . . . */
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- ok = 1;
- case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
- nonzero = 1;
- }
- if (nonzero && !ok) { *p++ = 'H'; *p = 0; }
- return (p);
-}
diff --git a/c/src/lib/libnetworking/libc/ns_parse.c b/c/src/lib/libnetworking/libc/ns_parse.c
deleted file mode 100644
index cc1f070156..0000000000
--- a/c/src/lib/libnetworking/libc/ns_parse.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-
-#include <errno.h>
-#include <resolv.h>
-#include <string.h>
-
-/* These need to be in the same order as the nres.h:ns_flag enum. */
-struct _ns_flagdata _ns_flagdata[16] = {
- { 0x8000, 15 }, /* qr. */
- { 0x7800, 11 }, /* opcode. */
- { 0x0400, 10 }, /* aa. */
- { 0x0200, 9 }, /* tc. */
- { 0x0100, 8 }, /* rd. */
- { 0x0080, 7 }, /* ra. */
- { 0x0040, 6 }, /* z. */
- { 0x0020, 5 }, /* ad. */
- { 0x0010, 4 }, /* cd. */
- { 0x000f, 0 }, /* rcode. */
- { 0x0000, 0 }, /* expansion (1/6). */
- { 0x0000, 0 }, /* expansion (2/6). */
- { 0x0000, 0 }, /* expansion (3/6). */
- { 0x0000, 0 }, /* expansion (4/6). */
- { 0x0000, 0 }, /* expansion (5/6). */
- { 0x0000, 0 }, /* expansion (6/6). */
-};
-
-static int
-skiprr(const u_char *ptr, const u_char *eom, ns_sect section, int count) {
- const u_char *optr = ptr;
-
- for ((void)NULL; count > 0; count--) {
- int b, rdlength;
-
- b = dn_skipname(ptr, eom);
- if (b < 0)
- goto emsgsize;
- ptr += b/*Name*/ + NS_INT16SZ/*Type*/ + NS_INT16SZ/*Class*/;
- if (section != ns_s_qd) {
- if (ptr + NS_INT32SZ > eom)
- goto emsgsize;
- ptr += NS_INT32SZ/*TTL*/;
- if (ptr + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(rdlength, ptr);
- ptr += rdlength/*RData*/;
- }
- }
- if (ptr > eom)
- goto emsgsize;
- return (ptr - optr);
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
-
-int
-ns_initparse(const u_char *msg, int msglen, ns_msg *handle) {
- const u_char *eom = msg + msglen;
- int i;
-
- memset(handle, 0x5e, sizeof *handle);
- handle->_msg = msg;
- handle->_eom = eom;
- if (msg + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(handle->_id, msg);
- if (msg + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(handle->_flags, msg);
- for (i = 0; i < ns_s_max; i++) {
- if (msg + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(handle->_counts[i], msg);
- }
- for (i = 0; i < ns_s_max; i++)
- if (handle->_counts[i] == 0)
- handle->_sections[i] = NULL;
- else {
- int b = skiprr(msg, eom, (ns_sect)i,
- handle->_counts[i]);
-
- if (b < 0)
- return (-1);
- handle->_sections[i] = msg;
- msg += b;
- }
- if (msg != eom)
- goto emsgsize;
- handle->_sect = ns_s_max;
- handle->_rrnum = -1;
- handle->_ptr = NULL;
- return (0);
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
-
-int
-ns_parserr(ns_msg *handle, ns_sect section, int rrnum, ns_rr *rr) {
- int b;
-
- /* Make section right. */
- if (section < 0 || section >= ns_s_max)
- goto enodev;
- if ((int)section != (int)handle->_sect) {
- handle->_sect = section;
- handle->_rrnum = 0;
- handle->_ptr = handle->_sections[(int)section];
- }
-
- /* Make rrnum right. */
- if (rrnum == -1)
- rrnum = handle->_rrnum;
- if (rrnum < 0 || rrnum >= handle->_counts[(int)section])
- goto enodev;
- if (rrnum < handle->_rrnum) {
- handle->_rrnum = 0;
- handle->_ptr = handle->_sections[(int)section];
- }
-
- b = skiprr(handle->_msg, handle->_eom, section,
- rrnum - handle->_rrnum);
- if (b < 0)
- return (-1);
- handle->_ptr += b;
- handle->_rrnum = rrnum;
-
- /* Do the parse. */
- b = dn_expand(handle->_msg, handle->_eom,
- handle->_ptr, rr->name, NS_MAXDNAME);
- if (b < 0)
- return (-1);
- handle->_ptr += b;
- if (handle->_ptr + NS_INT16SZ > handle->_eom)
- goto emsgsize;
- NS_GET16(rr->type, handle->_ptr);
- if (handle->_ptr + NS_INT16SZ > handle->_eom)
- goto emsgsize;
- NS_GET16(rr->class, handle->_ptr);
- if (section == ns_s_qd) {
- rr->ttl = 0;
- rr->rdlength = 0;
- rr->rdata = NULL;
- } else {
- if (handle->_ptr + NS_INT32SZ > handle->_eom)
- goto emsgsize;
- NS_GET32(rr->ttl, handle->_ptr);
- if (handle->_ptr + NS_INT16SZ > handle->_eom)
- goto emsgsize;
- NS_GET16(rr->rdlength, handle->_ptr);
- if (handle->_ptr + rr->rdlength > handle->_eom)
- goto emsgsize;
- rr->rdata = handle->_ptr;
- handle->_ptr += rr->rdlength;
- }
- handle->_rrnum++;
-
- /* All done. */
- return (0);
- enodev:
- errno = ENODEV;
- return (-1);
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
diff --git a/c/src/lib/libnetworking/libc/ns_print.c b/c/src/lib/libnetworking/libc/ns_print.c
deleted file mode 100644
index f7d7d16c64..0000000000
--- a/c/src/lib/libnetworking/libc/ns_print.c
+++ /dev/null
@@ -1,745 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/* Import. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <assert.h>
-#include <errno.h>
-#include <resolv.h>
-#include <string.h>
-#include <ctype.h>
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-/* Forward. */
-
-static size_t prune_origin(const char *name, const char *origin);
-static int charstr(const u_char *rdata, const u_char *edata,
- char **buf, size_t *buflen);
-static int addname(const u_char *msg, size_t msglen,
- const u_char **p, const char *origin,
- char **buf, size_t *buflen);
-static void addlen(size_t len, char **buf, size_t *buflen);
-static int addstr(const char *src, size_t len,
- char **buf, size_t *buflen);
-static int addtab(size_t len, size_t target, int spaced,
- char **buf, size_t *buflen);
-
-/* Macros. */
-
-#define T(x) \
- do { \
- if ((x) < 0) \
- return (-1); \
- } while (0)
-
-/* Public. */
-
-/*
- * int
- * ns_sprintrr(handle, rr, name_ctx, origin, buf, buflen)
- * Convert an RR to presentation format.
- * return:
- * Number of characters written to buf, or -1 (check errno).
- */
-int
-ns_sprintrr(const ns_msg *handle, const ns_rr *rr,
- const char *name_ctx, const char *origin,
- char *buf, size_t buflen)
-{
- int n;
-
- n = ns_sprintrrf(ns_msg_base(*handle), ns_msg_size(*handle),
- ns_rr_name(*rr), ns_rr_class(*rr), ns_rr_type(*rr),
- ns_rr_ttl(*rr), ns_rr_rdata(*rr), ns_rr_rdlen(*rr),
- name_ctx, origin, buf, buflen);
- return (n);
-}
-
-/*
- * int
- * ns_sprintrrf(msg, msglen, name, class, type, ttl, rdata, rdlen,
- * name_ctx, origin, buf, buflen)
- * Convert the fields of an RR into presentation format.
- * return:
- * Number of characters written to buf, or -1 (check errno).
- */
-int
-ns_sprintrrf(const u_char *msg, size_t msglen,
- const char *name, ns_class class, ns_type type,
- u_long ttl, const u_char *rdata, size_t rdlen,
- const char *name_ctx, const char *origin,
- char *buf, size_t buflen)
-{
- const char *obuf = buf;
- const u_char *edata = rdata + rdlen;
- int spaced = 0;
-
- const char *comment;
- char tmp[100];
- int len, x;
-
- /*
- * Owner.
- */
- if (name_ctx != NULL && strcasecmp(name_ctx, name) == 0) {
- T(addstr("\t\t\t", 3, &buf, &buflen));
- } else {
- len = prune_origin(name, origin);
- if (len == 0) {
- T(addstr("@\t\t\t", 4, &buf, &buflen));
- } else {
- T(addstr(name, len, &buf, &buflen));
- /* Origin not used and no trailing dot? */
- if ((!origin || !origin[0] || name[len] == '\0') &&
- name[len - 1] != '.') {
- T(addstr(".", 1, &buf, &buflen));
- len++;
- }
- T(spaced = addtab(len, 24, spaced, &buf, &buflen));
- }
- }
-
- /*
- * TTL, Class, Type.
- */
- T(x = ns_format_ttl(ttl, buf, buflen));
- addlen(x, &buf, &buflen);
- len = SPRINTF((tmp, " %s %s", p_class(class), p_type(type)));
- T(addstr(tmp, len, &buf, &buflen));
- T(spaced = addtab(x + len, 16, spaced, &buf, &buflen));
-
- /*
- * RData.
- */
- switch (type) {
- case ns_t_a:
- if (rdlen != NS_INADDRSZ)
- goto formerr;
- (void) inet_ntop(AF_INET, rdata, buf, buflen);
- addlen(strlen(buf), &buf, &buflen);
- break;
-
- case ns_t_cname:
- case ns_t_mb:
- case ns_t_mg:
- case ns_t_mr:
- case ns_t_ns:
- case ns_t_ptr:
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- break;
-
- case ns_t_hinfo:
- case ns_t_isdn:
- /* First word. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Second word. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- break;
-
- case ns_t_soa: {
- u_long t;
-
- /* Server name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Administrator name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" (\n", 3, &buf, &buflen));
- spaced = 0;
-
- if ((edata - rdata) != 5*NS_INT32SZ)
- goto formerr;
-
- /* Serial number. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- len = SPRINTF((tmp, "%lu", t));
- T(addstr(tmp, len, &buf, &buflen));
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; serial\n", 9, &buf, &buflen));
- spaced = 0;
-
- /* Refresh interval. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; refresh\n", 10, &buf, &buflen));
- spaced = 0;
-
- /* Retry interval. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; retry\n", 8, &buf, &buflen));
- spaced = 0;
-
- /* Expiry. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; expiry\n", 9, &buf, &buflen));
- spaced = 0;
-
- /* Minimum TTL. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(addstr(" )", 2, &buf, &buflen));
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; minimum\n", 10, &buf, &buflen));
-
- break;
- }
-
- case ns_t_mx:
- case ns_t_afsdb:
- case ns_t_rt: {
- u_int t;
-
- if (rdlen < NS_INT16SZ)
- goto formerr;
-
- /* Priority. */
- t = ns_get16(rdata);
- rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", t));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Target. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- break;
- }
-
- case ns_t_px: {
- u_int t;
-
- if (rdlen < NS_INT16SZ)
- goto formerr;
-
- /* Priority. */
- t = ns_get16(rdata);
- rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", t));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Name1. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Name2. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- break;
- }
-
- case ns_t_x25:
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- break;
-
- case ns_t_txt:
- while (rdata < edata) {
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- if (rdata < edata)
- T(addstr(" ", 1, &buf, &buflen));
- }
- break;
-
- case ns_t_nsap: {
- char t[255*3];
-
- (void) inet_nsap_ntoa(rdlen, rdata, t);
- T(addstr(t, strlen(t), &buf, &buflen));
- break;
- }
-
- case ns_t_aaaa:
- if (rdlen != NS_IN6ADDRSZ)
- goto formerr;
- (void) inet_ntop(AF_INET6, rdata, buf, buflen);
- addlen(strlen(buf), &buf, &buflen);
- break;
-
- case ns_t_loc: {
- char t[255];
-
- /* XXX protocol format checking? */
- (void) loc_ntoa(rdata, t);
- T(addstr(t, strlen(t), &buf, &buflen));
- break;
- }
-
- case ns_t_naptr: {
- u_int order, preference;
- char t[50];
-
- if (rdlen < 2*NS_INT16SZ)
- goto formerr;
-
- /* Order, Precedence. */
- order = ns_get16(rdata); rdata += NS_INT16SZ;
- preference = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((t, "%u %u ", order, preference));
- T(addstr(t, len, &buf, &buflen));
-
- /* Flags. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Service. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Regexp. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len < 0)
- return (-1);
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Server. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- break;
- }
-
- case ns_t_srv: {
- u_int priority, weight, port;
- char t[50];
-
- if (rdlen < NS_INT16SZ*3)
- goto formerr;
-
- /* Priority, Weight, Port. */
- priority = ns_get16(rdata); rdata += NS_INT16SZ;
- weight = ns_get16(rdata); rdata += NS_INT16SZ;
- port = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((t, "%u %u %u ", priority, weight, port));
- T(addstr(t, len, &buf, &buflen));
-
- /* Server. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- break;
- }
-
- case ns_t_minfo:
- case ns_t_rp:
- /* Name1. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Name2. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- break;
-
- case ns_t_wks: {
- int n, lcnt;
-
- if (rdlen < NS_INT32SZ + 1)
- goto formerr;
-
- /* Address. */
- (void) inet_ntop(AF_INET, rdata, buf, buflen);
- addlen(strlen(buf), &buf, &buflen);
- rdata += NS_INADDRSZ;
-
- /* Protocol. */
- len = SPRINTF((tmp, " %u ( ", *rdata));
- T(addstr(tmp, len, &buf, &buflen));
- rdata += NS_INT8SZ;
-
- /* Bit map. */
- n = 0;
- lcnt = 0;
- while (rdata < edata) {
- u_int c = *rdata++;
- do {
- if (c & 0200) {
- if (lcnt == 0) {
- T(addstr("\n\t\t\t\t", 5,
- &buf, &buflen));
- lcnt = 10;
- spaced = 0;
- }
- len = SPRINTF((tmp, "%d ", n));
- T(addstr(tmp, len, &buf, &buflen));
- lcnt--;
- }
- c <<= 1;
- } while (++n & 07);
- }
- T(addstr(")", 1, &buf, &buflen));
-
- break;
- }
-
- case ns_t_key: {
- char base64_key[NS_MD5RSA_MAX_BASE64];
- u_int keyflags, protocol, algorithm;
- const char *leader;
- int n;
-
- if (rdlen < NS_INT16SZ + NS_INT8SZ + NS_INT8SZ)
- goto formerr;
-
- /* Key flags, Protocol, Algorithm. */
- keyflags = ns_get16(rdata); rdata += NS_INT16SZ;
- protocol = *rdata++;
- algorithm = *rdata++;
- len = SPRINTF((tmp, "0x%04x %u %u",
- keyflags, protocol, algorithm));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Public key data. */
- len = b64_ntop(rdata, edata - rdata,
- base64_key, sizeof base64_key);
- if (len < 0)
- goto formerr;
- if (len > 15) {
- T(addstr(" (", 2, &buf, &buflen));
- leader = "\n\t\t";
- spaced = 0;
- } else
- leader = " ";
- for (n = 0; n < len; n += 48) {
- T(addstr(leader, strlen(leader), &buf, &buflen));
- T(addstr(base64_key + n, MIN(len - n, 48),
- &buf, &buflen));
- }
- if (len > 15)
- T(addstr(" )", 2, &buf, &buflen));
-
- break;
- }
-
- case ns_t_sig: {
- char base64_key[NS_MD5RSA_MAX_BASE64];
- u_int type, algorithm, labels, footprint;
- const char *leader;
- u_long t;
- int n;
-
- if (rdlen < 22)
- goto formerr;
-
- /* Type covered, Algorithm, Label count, Original TTL. */
- type = ns_get16(rdata); rdata += NS_INT16SZ;
- algorithm = *rdata++;
- labels = *rdata++;
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, " %s %d %lu ",
- p_type(type), algorithm, t));
- T(addstr(tmp, len, &buf, &buflen));
- if (labels != (u_int)dn_count_labels(name))
- goto formerr;
-
- /* Signature expiry. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s ", p_secstodate(t)));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Time signed. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s ", p_secstodate(t)));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Signature Footprint. */
- footprint = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", footprint));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Signer's name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- /* Signature. */
- len = b64_ntop(rdata, edata - rdata,
- base64_key, sizeof base64_key);
- if (len > 15) {
- T(addstr(" (", 2, &buf, &buflen));
- leader = "\n\t\t";
- spaced = 0;
- } else
- leader = " ";
- if (len < 0)
- goto formerr;
- for (n = 0; n < len; n += 48) {
- T(addstr(leader, strlen(leader), &buf, &buflen));
- T(addstr(base64_key + n, MIN(len - n, 48),
- &buf, &buflen));
- }
- if (len > 15)
- T(addstr(" )", 2, &buf, &buflen));
-
- break;
- }
-
- case ns_t_nxt: {
- int n, c;
-
- /* Next domain name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- /* Type bit map. */
- n = edata - rdata;
- for (c = 0; c < n*8; c++)
- if (NS_NXT_BIT_ISSET(c, rdata)) {
- len = SPRINTF((tmp, " %s", p_type(c)));
- T(addstr(tmp, len, &buf, &buflen));
- }
- break;
- }
-
- default:
- comment = "unknown RR type";
- goto hexify;
- }
- return (buf - obuf);
- formerr:
- comment = "RR format error";
- hexify: {
- int n, m;
- char *p;
-
- len = SPRINTF((tmp, "\\#(\t\t; %s", comment));
- T(addstr(tmp, len, &buf, &buflen));
- while (rdata < edata) {
- p = tmp;
- p += SPRINTF((p, "\n\t"));
- spaced = 0;
- n = MIN(16, edata - rdata);
- for (m = 0; m < n; m++)
- p += SPRINTF((p, "%02x ", rdata[m]));
- T(addstr(tmp, p - tmp, &buf, &buflen));
- if (n < 16) {
- T(addstr(")", 1, &buf, &buflen));
- T(addtab(p - tmp + 1, 48, spaced, &buf, &buflen));
- }
- p = tmp;
- p += SPRINTF((p, "; "));
- for (m = 0; m < n; m++)
- *p++ = (isascii(rdata[m]) && isprint(rdata[m]))
- ? rdata[m]
- : '.';
- T(addstr(tmp, p - tmp, &buf, &buflen));
- rdata += n;
- }
- return (buf - obuf);
- }
-}
-
-/* Private. */
-
-/*
- * size_t
- * prune_origin(name, origin)
- * Find out if the name is at or under the current origin.
- * return:
- * Number of characters in name before start of origin,
- * or length of name if origin does not match.
- * notes:
- * This function should share code with samedomain().
- */
-static size_t
-prune_origin(const char *name, const char *origin) {
- const char *oname = name;
-
- while (*name != '\0') {
- if (origin != NULL && strcasecmp(name, origin) == 0)
- return (name - oname - (name > oname));
- while (*name != '\0') {
- if (*name == '\\') {
- name++;
- /* XXX need to handle \nnn form. */
- if (*name == '\0')
- break;
- } else if (*name == '.') {
- name++;
- break;
- }
- name++;
- }
- }
- return (name - oname);
-}
-
-/*
- * int
- * charstr(rdata, edata, buf, buflen)
- * Format a <character-string> into the presentation buffer.
- * return:
- * Number of rdata octets consumed
- * 0 for protocol format error
- * -1 for output buffer error
- * side effects:
- * buffer is advanced on success.
- */
-static int
-charstr(const u_char *rdata, const u_char *edata, char **buf, size_t *buflen) {
- const u_char *odata = rdata;
- size_t save_buflen = *buflen;
- char *save_buf = *buf;
-
- if (addstr("\"", 1, buf, buflen) < 0)
- goto enospc;
- if (rdata < edata) {
- int n = *rdata;
-
- if (rdata + 1 + n <= edata) {
- rdata++;
- while (n-- > 0) {
- if (strchr("\n\"\\", *rdata) != NULL)
- if (addstr("\\", 1, buf, buflen) < 0)
- goto enospc;
- if (addstr((const char *)rdata, 1,
- buf, buflen) < 0)
- goto enospc;
- rdata++;
- }
- }
- }
- if (addstr("\"", 1, buf, buflen) < 0)
- goto enospc;
- return (rdata - odata);
- enospc:
- errno = ENOSPC;
- *buf = save_buf;
- *buflen = save_buflen;
- return (-1);
-}
-
-static int
-addname(const u_char *msg, size_t msglen,
- const u_char **pp, const char *origin,
- char **buf, size_t *buflen)
-{
- size_t newlen, save_buflen = *buflen;
- char *save_buf = *buf;
- int n;
-
- n = dn_expand(msg, msg + msglen, *pp, *buf, *buflen);
- if (n < 0)
- goto enospc; /* Guess. */
- newlen = prune_origin(*buf, origin);
- if ((origin == NULL || origin[0] == '\0' || (*buf)[newlen] == '\0') &&
- (newlen == 0 || (*buf)[newlen - 1] != '.')) {
- /* No trailing dot. */
- if (newlen + 2 > *buflen)
- goto enospc; /* No room for ".\0". */
- (*buf)[newlen++] = '.';
- (*buf)[newlen] = '\0';
- }
- if (newlen == 0) {
- /* Use "@" instead of name. */
- if (newlen + 2 > *buflen)
- goto enospc; /* No room for "@\0". */
- (*buf)[newlen++] = '@';
- (*buf)[newlen] = '\0';
- }
- *pp += n;
- addlen(newlen, buf, buflen);
- **buf = '\0';
- return (newlen);
- enospc:
- errno = ENOSPC;
- *buf = save_buf;
- *buflen = save_buflen;
- return (-1);
-}
-
-static void
-addlen(size_t len, char **buf, size_t *buflen) {
- assert(len <= *buflen);
- *buf += len;
- *buflen -= len;
-}
-
-static int
-addstr(const char *src, size_t len, char **buf, size_t *buflen) {
- if (len > *buflen) {
- errno = ENOSPC;
- return (-1);
- }
- memcpy(*buf, src, len);
- addlen(len, buf, buflen);
- **buf = '\0';
- return (0);
-}
-
-static int
-addtab(size_t len, size_t target, int spaced, char **buf, size_t *buflen) {
- size_t save_buflen = *buflen;
- char *save_buf = *buf;
- int t;
-
- if (spaced || len >= target - 1) {
- T(addstr(" ", 2, buf, buflen));
- spaced = 1;
- } else {
- for (t = (target - len - 1) / 8; t >= 0; t--)
- if (addstr("\t", 1, buf, buflen) < 0) {
- *buflen = save_buflen;
- *buf = save_buf;
- return (-1);
- }
- spaced = 0;
- }
- return (spaced);
-}
diff --git a/c/src/lib/libnetworking/libc/ns_ttl.c b/c/src/lib/libnetworking/libc/ns_ttl.c
deleted file mode 100644
index 75093c1dbc..0000000000
--- a/c/src/lib/libnetworking/libc/ns_ttl.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/* Import. */
-
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-/* Forward. */
-
-static int fmt1(int t, char s, char **buf, size_t *buflen);
-
-/* Macros. */
-
-#define T(x) if ((x) < 0) return (-1); else (void)NULL
-
-/* Public. */
-
-int
-ns_format_ttl(u_long src, char *dst, size_t dstlen) {
- char *odst = dst;
- int secs, mins, hours, days, weeks, x;
- char *p;
-
- secs = src % 60; src /= 60;
- mins = src % 60; src /= 60;
- hours = src % 24; src /= 24;
- days = src % 7; src /= 7;
- weeks = src; src = 0;
-
- x = 0;
- if (weeks) {
- T(fmt1(weeks, 'W', &dst, &dstlen));
- x++;
- }
- if (days) {
- T(fmt1(days, 'D', &dst, &dstlen));
- x++;
- }
- if (hours) {
- T(fmt1(hours, 'H', &dst, &dstlen));
- x++;
- }
- if (mins) {
- T(fmt1(mins, 'M', &dst, &dstlen));
- x++;
- }
- if (secs || !(weeks || days || hours || mins)) {
- T(fmt1(secs, 'S', &dst, &dstlen));
- x++;
- }
-
- if (x > 1) {
- int ch;
-
- for (p = odst; (ch = *p) != '\0'; p++)
- if (isascii(ch) && isupper(ch))
- *p = tolower(ch);
- }
-
- return (dst - odst);
-}
-
-int
-ns_parse_ttl(const char *src, u_long *dst) {
- u_long ttl, tmp;
- int ch, digits, dirty;
-
- ttl = 0;
- tmp = 0;
- digits = 0;
- dirty = 0;
- while ((ch = *src++) != '\0') {
- if (!isascii(ch) || !isprint(ch))
- goto einval;
- if (isdigit(ch)) {
- tmp *= 10;
- tmp += (ch - '0');
- digits++;
- continue;
- }
- if (digits == 0)
- goto einval;
- if (islower(ch))
- ch = toupper(ch);
- switch (ch) {
- case 'W': tmp *= 7;
- case 'D': tmp *= 24;
- case 'H': tmp *= 60;
- case 'M': tmp *= 60;
- case 'S': break;
- default: goto einval;
- }
- ttl += tmp;
- tmp = 0;
- digits = 0;
- dirty = 1;
- }
- if (digits > 0) {
- if (dirty)
- goto einval;
- else
- ttl += tmp;
- }
- *dst = ttl;
- return (0);
-
- einval:
- errno = EINVAL;
- return (-1);
-}
-
-/* Private. */
-
-static int
-fmt1(int t, char s, char **buf, size_t *buflen) {
- char tmp[50];
- size_t len;
-
- len = SPRINTF((tmp, "%d%c", t, s));
- if (len + 1 > *buflen)
- return (-1);
- strcpy(*buf, tmp);
- *buf += len;
- *buflen -= len;
- return (0);
-}
diff --git a/c/src/lib/libnetworking/libc/nsap_addr.c b/c/src/lib/libnetworking/libc/nsap_addr.c
deleted file mode 100644
index a7af57a266..0000000000
--- a/c/src/lib/libnetworking/libc/nsap_addr.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-
-static char
-xtob(c)
- register int c;
-{
- return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
-}
-
-u_int
-inet_nsap_addr(ascii, binary, maxlen)
- const char *ascii;
- u_char *binary;
- int maxlen;
-{
- u_char c, nib;
- u_int len = 0;
-
- while ((c = *ascii++) != '\0' && len < (u_int)maxlen) {
- if (c == '.' || c == '+' || c == '/')
- continue;
- if (!isascii(c))
- return (0);
- if (islower(c))
- c = toupper(c);
- if (isxdigit(c)) {
- nib = xtob(c);
- c = *ascii++;
- if (c != '\0') {
- c = toupper(c);
- if (isxdigit(c)) {
- *binary++ = (nib << 4) | xtob(c);
- len++;
- } else
- return (0);
- }
- else
- return (0);
- }
- else
- return (0);
- }
- return (len);
-}
-
-char *
-inet_nsap_ntoa(binlen, binary, ascii)
- int binlen;
- register const u_char *binary;
- register char *ascii;
-{
- register int nib;
- int i;
- static char tmpbuf[255*3];
- char *start;
-
- if (ascii)
- start = ascii;
- else {
- ascii = tmpbuf;
- start = tmpbuf;
- }
-
- if (binlen > 255)
- binlen = 255;
-
- for (i = 0; i < binlen; i++) {
- nib = *binary >> 4;
- *ascii++ = nib + (nib < 10 ? '0' : '7');
- nib = *binary++ & 0x0f;
- *ascii++ = nib + (nib < 10 ? '0' : '7');
- if (((i % 2) == 0 && (i + 1) < binlen))
- *ascii++ = '.';
- }
- *ascii = '\0';
- return (start);
-}
diff --git a/c/src/lib/libnetworking/libc/rcmd.3 b/c/src/lib/libnetworking/libc/rcmd.3
deleted file mode 100644
index e25057fa4e..0000000000
--- a/c/src/lib/libnetworking/libc/rcmd.3
+++ /dev/null
@@ -1,204 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" From: @(#)rcmd.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd February 15, 1996
-.Dt RCMD 3
-.Os BSD 4.2
-.Sh NAME
-.Nm rcmd ,
-.Nm rresvport ,
-.Nm iruserok ,
-.Nm ruserok
-.Nd routines for returning a stream to a remote command
-.Sh SYNOPSIS
-.Fd #include <unistd.h>
-.Ft int
-.Fn rcmd "char **ahost" "int inport" "const char *locuser" "const char *remuser" "const char *cmd" "int *fd2p"
-.Ft int
-.Fn rresvport "int *port"
-.Ft int
-.Fn iruserok "u_long raddr" "int superuser" "const char *ruser" "const char *luser"
-.Ft int
-.Fn ruserok "const char *rhost" "int superuser" "const char *ruser" "const char *luser"
-.Sh DESCRIPTION
-The
-.Fn rcmd
-function
-is used by the super-user to execute a command on
-a remote machine using an authentication scheme based
-on reserved port numbers.
-The
-.Fn rresvport
-function
-returns a descriptor to a socket
-with an address in the privileged port space.
-The
-.Fn ruserok
-function
-is used by servers
-to authenticate clients requesting service with
-.Fn rcmd .
-All three functions are present in the same file and are used
-by the
-.Xr rshd 8
-server (among others).
-.Pp
-The
-.Fn rcmd
-function
-looks up the host
-.Fa *ahost
-using
-.Xr gethostbyname 3 ,
-returning \-1 if the host does not exist.
-Otherwise
-.Fa *ahost
-is set to the standard name of the host
-and a connection is established to a server
-residing at the well-known Internet port
-.Fa inport .
-.Pp
-If the connection succeeds,
-a socket in the Internet domain of type
-.Dv SOCK_STREAM
-is returned to the caller, and given to the remote
-command as
-.Em stdin
-and
-.Em stdout .
-If
-.Fa fd2p
-is non-zero, then an auxiliary channel to a control
-process will be set up, and a descriptor for it will be placed
-in
-.Fa *fd2p .
-The control process will return diagnostic
-output from the command (unit 2) on this channel, and will also
-accept bytes on this channel as being
-.Tn UNIX
-signal numbers, to be
-forwarded to the process group of the command.
-If
-.Fa fd2p
-is 0, then the
-.Em stderr
-(unit 2 of the remote
-command) will be made the same as the
-.Em stdout
-and no
-provision is made for sending arbitrary signals to the remote process,
-although you may be able to get its attention by using out-of-band data.
-.Pp
-The protocol is described in detail in
-.Xr rshd 8 .
-.Pp
-The
-.Fn rresvport
-function is used to obtain a socket with a privileged
-address bound to it. This socket is suitable for use
-by
-.Fn rcmd
-and several other functions. Privileged Internet ports are those
-in the range 0 to 1023. Only the super-user
-is allowed to bind an address of this sort to a socket.
-.Pp
-The
-.Fn iruserok
-and
-.Fn ruserok
-functions take a remote host's IP address or name, as returned by the
-.Xr gethostbyname 3
-routines, two user names and a flag indicating whether the local user's
-name is that of the super-user.
-Then, if the user is
-.Em NOT
-the super-user, it checks the
-.Pa /etc/hosts.equiv
-file.
-If that lookup is not done, or is unsuccessful, the
-.Pa .rhosts
-in the local user's home directory is checked to see if the request for
-service is allowed.
-.Pp
-If this file does not exist, is not a regular file, is owned by anyone
-other than the user or the super-user, or is writable by anyone other
-than the owner, the check automatically fails.
-Zero is returned if the machine name is listed in the
-.Dq Pa hosts.equiv
-file, or the host and remote user name are found in the
-.Dq Pa .rhosts
-file; otherwise
-.Fn iruserok
-and
-.Fn ruserok
-return \-1.
-If the local domain (as obtained from
-.Xr gethostname 3 )
-is the same as the remote domain, only the machine name need be specified.
-.Pp
-The
-.Fn iruserok
-function is strongly preferred for security reasons.
-It requires trusting the local DNS at most, while the
-.Fn ruserok
-function requires trusting the entire DNS, which can be spoofed.
-.Sh DIAGNOSTICS
-The
-.Fn rcmd
-function
-returns a valid socket descriptor on success.
-It returns \-1 on error and prints a diagnostic message on the standard error.
-.Pp
-The
-.Fn rresvport
-function
-returns a valid, bound socket descriptor on success.
-It returns \-1 on error with the global value
-.Va errno
-set according to the reason for failure.
-The error code
-.Dv EAGAIN
-is overloaded to mean ``All network ports in use.''
-.Sh SEE ALSO
-.Xr rlogin 1 ,
-.Xr rsh 1 ,
-.Xr intro 2 ,
-.Xr rexec 3 ,
-.Xr rexecd 8 ,
-.Xr rlogind 8 ,
-.Xr rshd 8
-.Sh HISTORY
-These
-functions appeared in
-.Bx 4.2 .
diff --git a/c/src/lib/libnetworking/libc/rcmd.c b/c/src/lib/libnetworking/libc/rcmd.c
deleted file mode 100644
index 32e4953e9b..0000000000
--- a/c/src/lib/libnetworking/libc/rcmd.c
+++ /dev/null
@@ -1,520 +0,0 @@
-/*
- * Copyright (c) 1983, 1993, 1994
- * 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <signal.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <unistd.h>
-#include <pwd.h>
-#include <errno.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-extern int innetgr __P(( const char *, const char *, const char *, const char * ));
-
-#define max(a, b) ((a > b) ? a : b)
-
-int __ivaliduser __P((FILE *, u_long, const char *, const char *));
-static int __icheckhost __P((u_long, char *));
-
-int
-rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
- char **ahost;
- u_short rport;
- const char *locuser, *remuser, *cmd;
- int *fd2p;
-{
- struct hostent *hp;
- struct sockaddr_in sin, from;
- fd_set reads;
- long oldmask;
- pid_t pid;
- int s, lport, timo;
- char c;
-
- pid = getpid();
- hp = gethostbyname(*ahost);
- if (hp == NULL) {
- herror(*ahost);
- return (-1);
- }
- *ahost = hp->h_name;
- oldmask = sigblock(sigmask(SIGURG));
- for (timo = 1, lport = IPPORT_RESERVED - 1;;) {
- s = rresvport(&lport);
- if (s < 0) {
- if (errno == EAGAIN)
- (void)fprintf(stderr,
- "rcmd: socket: All ports in use\n");
- else
- (void)fprintf(stderr, "rcmd: socket: %s\n",
- strerror(errno));
- sigsetmask(oldmask);
- return (-1);
- }
- fcntl(s, F_SETOWN, pid);
- bzero(&sin, sizeof sin);
- sin.sin_len = sizeof(struct sockaddr_in);
- sin.sin_family = hp->h_addrtype;
- sin.sin_port = rport;
- bcopy(hp->h_addr_list[0], &sin.sin_addr, MIN(hp->h_length, sizeof sin.sin_addr));
- if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
- break;
- (void)close(s);
- if (errno == EADDRINUSE) {
- lport--;
- continue;
- }
- if (errno == ECONNREFUSED && timo <= 16) {
- (void)sleep(timo);
- timo *= 2;
- continue;
- }
- if (hp->h_addr_list[1] != NULL) {
- int oerrno = errno;
-
- (void)fprintf(stderr, "connect to address %s: ",
- inet_ntoa(sin.sin_addr));
- errno = oerrno;
- perror(0);
- hp->h_addr_list++;
- bcopy(hp->h_addr_list[0], &sin.sin_addr, MIN(hp->h_length, sizeof sin.sin_addr));
- (void)fprintf(stderr, "Trying %s...\n",
- inet_ntoa(sin.sin_addr));
- continue;
- }
- (void)fprintf(stderr, "%s: %s\n", hp->h_name, strerror(errno));
- sigsetmask(oldmask);
- return (-1);
- }
- lport--;
- if (fd2p == 0) {
- write(s, "", 1);
- lport = 0;
- } else {
- char num[8];
- int s2 = rresvport(&lport), s3;
- int len = sizeof(from);
- int nfds;
-
- if (s2 < 0)
- goto bad;
- listen(s2, 1);
- (void)snprintf(num, sizeof(num), "%d", lport);
- if (write(s, num, strlen(num)+1) != strlen(num)+1) {
- (void)fprintf(stderr,
- "rcmd: write (setting up stderr): %s\n",
- strerror(errno));
- (void)close(s2);
- goto bad;
- }
- nfds = max(s, s2)+1;
- if(nfds > FD_SETSIZE) {
- fprintf(stderr, "rcmd: too many files\n");
- (void)close(s2);
- goto bad;
- }
-again:
- FD_ZERO(&reads);
- FD_SET(s, &reads);
- FD_SET(s2, &reads);
- errno = 0;
- if (select(nfds, &reads, 0, 0, 0) < 1 || !FD_ISSET(s2, &reads)){
- if (errno != 0)
- (void)fprintf(stderr,
- "rcmd: select (setting up stderr): %s\n",
- strerror(errno));
- else
- (void)fprintf(stderr,
- "select: protocol failure in circuit setup\n");
- (void)close(s2);
- goto bad;
- }
- s3 = accept(s2, (struct sockaddr *)&from, &len);
- /*
- * XXX careful for ftp bounce attacks. If discovered, shut them
- * down and check for the real auxiliary channel to connect.
- */
- if (from.sin_family == AF_INET && from.sin_port == htons(20)) {
- close(s3);
- goto again;
- }
- (void)close(s2);
- if (s3 < 0) {
- (void)fprintf(stderr,
- "rcmd: accept: %s\n", strerror(errno));
- lport = 0;
- goto bad;
- }
- *fd2p = s3;
- from.sin_port = ntohs((u_short)from.sin_port);
- if (from.sin_family != AF_INET ||
- from.sin_port >= IPPORT_RESERVED ||
- from.sin_port < IPPORT_RESERVED / 2) {
- (void)fprintf(stderr,
- "socket: protocol failure in circuit setup.\n");
- goto bad2;
- }
- }
- (void)write(s, locuser, strlen(locuser)+1);
- (void)write(s, remuser, strlen(remuser)+1);
- (void)write(s, cmd, strlen(cmd)+1);
- if (read(s, &c, 1) != 1) {
- (void)fprintf(stderr,
- "rcmd: %s: %s\n", *ahost, strerror(errno));
- goto bad2;
- }
- if (c != 0) {
- while (read(s, &c, 1) == 1) {
- (void)write(STDERR_FILENO, &c, 1);
- if (c == '\n')
- break;
- }
- goto bad2;
- }
- sigsetmask(oldmask);
- return (s);
-bad2:
- if (lport)
- (void)close(*fd2p);
-bad:
- (void)close(s);
- sigsetmask(oldmask);
- return (-1);
-}
-
-int
-rresvport(alport)
- int *alport;
-{
- struct sockaddr_in sin;
- int s;
-
- bzero(&sin, sizeof sin);
- sin.sin_len = sizeof(struct sockaddr_in);
- sin.sin_family = AF_INET;
- sin.sin_addr.s_addr = INADDR_ANY;
- s = socket(AF_INET, SOCK_STREAM, 0);
- if (s < 0)
- return (-1);
-#if 0 /* compat_exact_traditional_rresvport_semantics */
- sin.sin_port = htons((u_short)*alport);
- if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
- return (s);
- if (errno != EADDRINUSE) {
- (void)close(s);
- return (-1);
- }
-#endif
- sin.sin_port = 0;
- if (bindresvport(s, &sin) == -1) {
- (void)close(s);
- return (-1);
- }
- *alport = (int)ntohs(sin.sin_port);
- return (s);
-}
-
-int __check_rhosts_file = 1;
-char *__rcmd_errstr;
-
-int
-ruserok(rhost, superuser, ruser, luser)
- const char *rhost, *ruser, *luser;
- int superuser;
-{
- struct hostent *hp;
- u_long addr;
- char **ap;
-
- if ((hp = gethostbyname(rhost)) == NULL)
- return (-1);
- for (ap = hp->h_addr_list; *ap; ++ap) {
- bcopy(*ap, &addr, sizeof(addr));
- if (iruserok(addr, superuser, ruser, luser) == 0)
- return (0);
- }
- return (-1);
-}
-
-/*
- * New .rhosts strategy: We are passed an ip address. We spin through
- * hosts.equiv and .rhosts looking for a match. When the .rhosts only
- * has ip addresses, we don't have to trust a nameserver. When it
- * contains hostnames, we spin through the list of addresses the nameserver
- * gives us and look for a match.
- *
- * Returns 0 if ok, -1 if not ok.
- */
-int
-iruserok(raddr, superuser, ruser, luser)
- u_long raddr;
- int superuser;
- const char *ruser, *luser;
-{
- register char *cp;
- struct stat sbuf;
- struct passwd *pwd;
- FILE *hostf;
- uid_t uid;
- int first;
- char pbuf[MAXPATHLEN];
-
- first = 1;
- hostf = superuser ? NULL : fopen(_PATH_HEQUIV, "r");
-again:
- if (hostf) {
- if (__ivaliduser(hostf, raddr, luser, ruser) == 0) {
- (void)fclose(hostf);
- return (0);
- }
- (void)fclose(hostf);
- }
- if (first == 1 && (__check_rhosts_file || superuser)) {
- first = 0;
- if ((pwd = getpwnam(luser)) == NULL)
- return (-1);
- (void)strcpy(pbuf, pwd->pw_dir);
- (void)strcat(pbuf, "/.rhosts");
-
- /*
- * Change effective uid while opening .rhosts. If root and
- * reading an NFS mounted file system, can't read files that
- * are protected read/write owner only.
- */
- uid = geteuid();
- (void)seteuid(pwd->pw_uid);
- hostf = fopen(pbuf, "r");
- (void)seteuid(uid);
-
- if (hostf == NULL)
- return (-1);
- /*
- * If not a regular file, or is owned by someone other than
- * user or root or if writeable by anyone but the owner, quit.
- */
- cp = NULL;
- if (lstat(pbuf, &sbuf) < 0)
- cp = ".rhosts lstat failed";
- else if (!S_ISREG(sbuf.st_mode))
- cp = ".rhosts not regular file";
- else if (fstat(fileno(hostf), &sbuf) < 0)
- cp = ".rhosts fstat failed";
- else if (sbuf.st_uid && sbuf.st_uid != pwd->pw_uid)
- cp = "bad .rhosts owner";
- else if (sbuf.st_mode & (S_IWGRP|S_IWOTH))
- cp = ".rhosts writeable by other than owner";
- /* If there were any problems, quit. */
- if (cp) {
- __rcmd_errstr = cp;
- (void)fclose(hostf);
- return (-1);
- }
- goto again;
- }
- return (-1);
-}
-
-/*
- * XXX
- * Don't make static, used by lpd(8).
- *
- * Returns 0 if ok, -1 if not ok.
- */
-int
-__ivaliduser(hostf, raddr, luser, ruser)
- FILE *hostf;
- u_long raddr;
- const char *luser, *ruser;
-{
- register char *user, *p;
- int ch;
- char buf[MAXHOSTNAMELEN + 128]; /* host + login */
- char hname[MAXHOSTNAMELEN];
- struct hostent *hp;
- /* Presumed guilty until proven innocent. */
- int userok = 0, hostok = 0;
-#ifdef YP
- char *ypdomain;
-
- if (yp_get_default_domain(&ypdomain))
- ypdomain = NULL;
-#else
-#define ypdomain NULL
-#endif
- /* We need to get the damn hostname back for netgroup matching. */
- if ((hp = gethostbyaddr((char *)&raddr, sizeof(u_long),
- AF_INET)) == NULL)
- return (-1);
- strncpy(hname, hp->h_name, sizeof(hname));
- hname[sizeof(hname) - 1] = '\0';
-
- while (fgets(buf, sizeof(buf), hostf)) {
- p = buf;
- /* Skip lines that are too long. */
- if (strchr(p, '\n') == NULL) {
- while ((ch = getc(hostf)) != '\n' && ch != EOF);
- continue;
- }
- if (*p == '\n' || *p == '#') {
- /* comment... */
- continue;
- }
- while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') {
- *p = isupper(*p) ? tolower(*p) : *p;
- p++;
- }
- if (*p == ' ' || *p == '\t') {
- *p++ = '\0';
- while (*p == ' ' || *p == '\t')
- p++;
- user = p;
- while (*p != '\n' && *p != ' ' &&
- *p != '\t' && *p != '\0')
- p++;
- } else
- user = p;
- *p = '\0';
- /*
- * Do +/- and +@/-@ checking. This looks really nasty,
- * but it matches SunOS's behavior so far as I can tell.
- */
- switch(buf[0]) {
- case '+':
- if (!buf[1]) { /* '+' matches all hosts */
- hostok = 1;
- break;
- }
- if (buf[1] == '@') /* match a host by netgroup */
- hostok = innetgr((char *)&buf[2],
- (char *)&hname, NULL, ypdomain);
- else /* match a host by addr */
- hostok = __icheckhost(raddr,(char *)&buf[1]);
- break;
- case '-': /* reject '-' hosts and all their users */
- if (buf[1] == '@') {
- if (innetgr((char *)&buf[2],
- (char *)&hname, NULL, ypdomain))
- return(-1);
- } else {
- if (__icheckhost(raddr,(char *)&buf[1]))
- return(-1);
- }
- break;
- default: /* if no '+' or '-', do a simple match */
- hostok = __icheckhost(raddr, buf);
- break;
- }
- switch(*user) {
- case '+':
- if (!*(user+1)) { /* '+' matches all users */
- userok = 1;
- break;
- }
- if (*(user+1) == '@') /* match a user by netgroup */
- userok = innetgr(user+2, NULL, ruser, ypdomain);
- else /* match a user by direct specification */
- userok = !(strcmp(ruser, user+1));
- break;
- case '-': /* if we matched a hostname, */
- if (hostok) { /* check for user field rejections */
- if (!*(user+1))
- return(-1);
- if (*(user+1) == '@') {
- if (innetgr(user+2, NULL,
- ruser, ypdomain))
- return(-1);
- } else {
- if (!strcmp(ruser, user+1))
- return(-1);
- }
- }
- break;
- default: /* no rejections: try to match the user */
- if (hostok)
- userok = !(strcmp(ruser,*user ? user : luser));
- break;
- }
- if (hostok && userok)
- return(0);
- }
- return (-1);
-}
-
-/*
- * Returns "true" if match, 0 if no match.
- */
-static int
-__icheckhost(raddr, lhost)
- u_long raddr;
- register char *lhost;
-{
- register struct hostent *hp;
- register u_long laddr;
- register char **pp;
-
- /* Try for raw ip address first. */
- if (isdigit(*lhost) && (long)(laddr = inet_addr(lhost)) != -1)
- return (raddr == laddr);
-
- /* Better be a hostname. */
- if ((hp = gethostbyname(lhost)) == NULL)
- return (0);
-
- /* Spin through ip addresses. */
- for (pp = hp->h_addr_list; *pp; ++pp)
- if (!bcmp(&raddr, *pp, sizeof(u_long)))
- return (1);
-
- /* No match. */
- return (0);
-}
diff --git a/c/src/lib/libnetworking/libc/recv.c b/c/src/lib/libnetworking/libc/recv.c
deleted file mode 100644
index a842244caf..0000000000
--- a/c/src/lib/libnetworking/libc/recv.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)recv.c 8.2 (Berkeley) 2/21/94";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <stddef.h>
-
-ssize_t
-recv(s, buf, len, flags)
- int s, flags;
- size_t len;
- void *buf;
-{
- return (recvfrom(s, buf, len, flags, NULL, 0));
-}
diff --git a/c/src/lib/libnetworking/libc/res_comp.c b/c/src/lib/libnetworking/libc/res_comp.c
deleted file mode 100644
index 93043276f2..0000000000
--- a/c/src/lib/libnetworking/libc/res_comp.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright (c) 1985, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: res_comp.c,v 8.11 1997/05/21 19:31:04 halley Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#define BIND_4_COMPAT
-
-/*
- * Expand compressed domain name 'comp_dn' to full domain name.
- * 'msg' is a pointer to the begining of the message,
- * 'eomorig' points to the first location after the message,
- * 'exp_dn' is a pointer to a buffer of size 'length' for the result.
- * Return size of compressed name or -1 if there was an error.
- */
-int
-dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
- char *dst, int dstsiz)
-{
- int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);
-
- if (n > 0 && dst[0] == '.')
- dst[0] = '\0';
- return (n);
-}
-
-/*
- * Pack domain name 'exp_dn' in presentation form into 'comp_dn'.
- * Return the size of the compressed name or -1.
- * 'length' is the size of the array pointed to by 'comp_dn'.
- */
-int
-dn_comp(const char *src, u_char *dst, int dstsiz,
- u_char **dnptrs, u_char **lastdnptr)
-{
- return (ns_name_compress(src, dst, (size_t)dstsiz,
- (const u_char **)dnptrs,
- (const u_char **)lastdnptr));
-}
-
-/*
- * Skip over a compressed domain name. Return the size or -1.
- */
-int
-dn_skipname(const u_char *ptr, const u_char *eom) {
- const u_char *saveptr = ptr;
-
- if (ns_name_skip(&ptr, eom) == -1)
- return (-1);
- return (ptr - saveptr);
-}
-
-/*
- * Verify that a domain name uses an acceptable character set.
- */
-
-/*
- * Note the conspicuous absence of ctype macros in these definitions. On
- * non-ASCII hosts, we can't depend on string literals or ctype macros to
- * tell us anything about network-format data. The rest of the BIND system
- * is not careful about this, but for some reason, we're doing it right here.
- */
-#define PERIOD 0x2e
-#define hyphenchar(c) ((c) == 0x2d)
-#define bslashchar(c) ((c) == 0x5c)
-#define periodchar(c) ((c) == PERIOD)
-#define asterchar(c) ((c) == 0x2a)
-#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \
- || ((c) >= 0x61 && (c) <= 0x7a))
-#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
-
-#define borderchar(c) (alphachar(c) || digitchar(c))
-#define middlechar(c) (borderchar(c) || hyphenchar(c))
-#define domainchar(c) ((c) > 0x20 && (c) < 0x7f)
-
-int
-res_hnok(dn)
- const char *dn;
-{
- int ppch = '\0', pch = PERIOD, ch = *dn++;
-
- while (ch != '\0') {
- int nch = *dn++;
-
- if (periodchar(ch)) {
- (void)NULL;
- } else if (periodchar(pch)) {
- if (!borderchar(ch))
- return (0);
- } else if (periodchar(nch) || nch == '\0') {
- if (!borderchar(ch))
- return (0);
- } else {
- if (!middlechar(ch))
- return (0);
- }
- ppch = pch, pch = ch, ch = nch;
- }
- return (1);
-}
-
-/*
- * hostname-like (A, MX, WKS) owners can have "*" as their first label
- * but must otherwise be as a host name.
- */
-int
-res_ownok(dn)
- const char *dn;
-{
- if (asterchar(dn[0])) {
- if (periodchar(dn[1]))
- return (res_hnok(dn+2));
- if (dn[1] == '\0')
- return (1);
- }
- return (res_hnok(dn));
-}
-
-/*
- * SOA RNAMEs and RP RNAMEs can have any printable character in their first
- * label, but the rest of the name has to look like a host name.
- */
-int
-res_mailok(dn)
- const char *dn;
-{
- int ch, escaped = 0;
-
- /* "." is a valid missing representation */
- if (*dn == '\0')
- return (1);
-
- /* otherwise <label>.<hostname> */
- while ((ch = *dn++) != '\0') {
- if (!domainchar(ch))
- return (0);
- if (!escaped && periodchar(ch))
- break;
- if (escaped)
- escaped = 0;
- else if (bslashchar(ch))
- escaped = 1;
- }
- if (periodchar(ch))
- return (res_hnok(dn));
- return (0);
-}
-
-/*
- * This function is quite liberal, since RFC 1034's character sets are only
- * recommendations.
- */
-int
-res_dnok(dn)
- const char *dn;
-{
- int ch;
-
- while ((ch = *dn++) != '\0')
- if (!domainchar(ch))
- return (0);
- return (1);
-}
-
-#ifdef BIND_4_COMPAT
-/*
- * This module must export the following externally-visible symbols:
- * ___putlong
- * ___putshort
- * __getlong
- * __getshort
- * Note that one _ comes from C and the others come from us.
- */
-void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); }
-void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); }
-u_int32_t _getlong(const u_char *src) { return (ns_get32(src)); }
-u_int16_t _getshort(const u_char *src) { return (ns_get16(src)); }
-#endif /*BIND_4_COMPAT*/
diff --git a/c/src/lib/libnetworking/libc/res_config.h b/c/src/lib/libnetworking/libc/res_config.h
deleted file mode 100644
index 57ec414226..0000000000
--- a/c/src/lib/libnetworking/libc/res_config.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * $Id$
- */
-
-#define DEBUG 1 /* enable debugging code (needed for dig) */
-#define RESOLVSORT /* allow sorting of addresses in gethostbyname */
-#define RFC1535 /* comply with RFC1535 (STRONGLY reccomended by vixie)*/
-#undef USELOOPBACK /* res_init() bind to localhost */
-#undef SUNSECURITY /* verify gethostbyaddr() calls - WE DONT NEED IT */
-#define MULTI_PTRS_ARE_ALIASES 1 /* fold multiple PTR records into aliases */
-#define CHECK_SRVR_ADDR 1 /* confirm that the server requested sent the reply */
-#define BIND_UPDATE 1 /* update support */
-
-#if defined(__rtems__)
-u_int16_t _getshort(const u_char *src);
-u_int32_t _getlong(const u_char *src);
-int gethostname (char *name, int namelen);
-int sethostname (char *name, int namelen);
-int issetugid (void);
-#endif
diff --git a/c/src/lib/libnetworking/libc/res_data.c b/c/src/lib/libnetworking/libc/res_data.c
deleted file mode 100644
index fb7d2c66eb..0000000000
--- a/c/src/lib/libnetworking/libc/res_data.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 1995,1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "res_config.h"
-
-const char *_res_opcodes[] = {
- "QUERY",
- "IQUERY",
- "CQUERYM",
- "CQUERYU", /* experimental */
- "NOTIFY", /* experimental */
- "UPDATE",
- "6",
- "7",
- "8",
- "9",
- "10",
- "11",
- "12",
- "13",
- "ZONEINIT",
- "ZONEREF",
-};
-
-const char *_res_resultcodes[] = {
- "NOERROR",
- "FORMERR",
- "SERVFAIL",
- "NXDOMAIN",
- "NOTIMP",
- "REFUSED",
- "YXDOMAIN",
- "YXRRSET",
- "NXRRSET",
- "NOTAUTH",
- "ZONEERR",
- "11",
- "12",
- "13",
- "14",
- "NOCHANGE",
-};
-
-#ifdef BIND_UPDATE
-const char *_res_sectioncodes[] = {
- "ZONE",
- "PREREQUISITES",
- "UPDATE",
- "ADDITIONAL",
-};
-#endif
diff --git a/c/src/lib/libnetworking/libc/res_debug.c b/c/src/lib/libnetworking/libc/res_debug.c
deleted file mode 100644
index b747b6e6d2..0000000000
--- a/c/src/lib/libnetworking/libc/res_debug.c
+++ /dev/null
@@ -1,966 +0,0 @@
-/*
- * Copyright (c) 1985
- * 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1995 by International Business Machines, Inc.
- *
- * International Business Machines, Inc. (hereinafter called IBM) grants
- * permission under its copyrights to use, copy, modify, and distribute this
- * Software with or without fee, provided that the above copyright notice and
- * all paragraphs of this notice appear in all copies, and that the name of IBM
- * not be used in connection with the marketing of any product incorporating
- * the Software or modifications thereof, without specific, written prior
- * permission.
- *
- * To the extent it has a right to do so, IBM grants an immunity from suit
- * under its patents, if any, for the use, sale or manufacture of products to
- * the extent that such products are used for performing Domain Name System
- * dynamic updates in TCP/IP networks by means of the Software. No immunity is
- * granted for any product per se or for any other function of any product.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <math.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#define SPRINTF(x) sprintf x
-
-extern const char *_res_opcodes[];
-extern const char *_res_resultcodes[];
-extern const char *_res_sectioncodes[];
-
-/*
- * Print the current options.
- */
-void
-fp_resstat(struct __res_state *statp, FILE *file) {
- u_long mask;
-
- fprintf(file, ";; res options:");
- if (!statp)
- statp = &_res;
- for (mask = 1; mask != 0; mask <<= 1)
- if (statp->options & mask)
- fprintf(file, " %s", p_option(mask));
- putc('\n', file);
-}
-
-static void
-do_section(ns_msg *handle, ns_sect section, int pflag, FILE *file) {
- int n, sflag, rrnum;
- char buf[2048]; /* XXX need to malloc */
- ns_opcode opcode;
- ns_rr rr;
-
- /*
- * Print answer records.
- */
- sflag = (_res.pfcode & pflag);
- if (_res.pfcode && !sflag)
- return;
-
- opcode = ns_msg_getflag(*handle, ns_f_opcode);
- rrnum = 0;
- for (;;) {
- if (ns_parserr(handle, section, rrnum, &rr)) {
- if (errno != ENODEV)
- fprintf(file, ";; ns_parserr: %s\n",
- strerror(errno));
- else if (rrnum > 0 && sflag != 0 &&
- (_res.pfcode & RES_PRF_HEAD1))
- putc('\n', file);
- return;
- }
- if (rrnum == 0 && sflag != 0 && (_res.pfcode & RES_PRF_HEAD1))
- fprintf(file, ";; %s SECTION:\n",
- p_section(section, opcode));
- if (section == ns_s_qd)
- fprintf(file, ";;\t%s, type = %s, class = %s\n",
- ns_rr_name(rr),
- p_type(ns_rr_type(rr)),
- p_class(ns_rr_class(rr)));
- else {
- n = ns_sprintrr(handle, &rr, NULL, NULL,
- buf, sizeof buf);
- if (n < 0) {
- fprintf(file, ";; ns_sprintrr: %s\n",
- strerror(errno));
- return;
- }
- fputs(buf, file);
- fputc('\n', file);
- }
- rrnum++;
- }
-}
-
-void
-p_query(const u_char *msg) {
- fp_query(msg, stdout);
-}
-
-void
-fp_query(const u_char *msg, FILE *file) {
- fp_nquery(msg, PACKETSZ, file);
-}
-
-/*
- * Print the contents of a query.
- * This is intended to be primarily a debugging routine.
- */
-void
-fp_nquery(const u_char *msg, int len, FILE *file) {
- ns_msg handle;
- int qdcount, ancount, nscount, arcount;
- u_int opcode, rcode, id;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1)
- return;
-
- if (ns_initparse(msg, len, &handle) < 0) {
- fprintf(file, ";; ns_initparse: %s\n", strerror(errno));
- return;
- }
- opcode = ns_msg_getflag(handle, ns_f_opcode);
- rcode = ns_msg_getflag(handle, ns_f_rcode);
- id = ns_msg_id(handle);
- qdcount = ns_msg_count(handle, ns_s_qd);
- ancount = ns_msg_count(handle, ns_s_an);
- nscount = ns_msg_count(handle, ns_s_ns);
- arcount = ns_msg_count(handle, ns_s_ar);
-
- /*
- * Print header fields.
- */
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEADX) || rcode)
- fprintf(file,
- ";; ->>HEADER<<- opcode: %s, status: %s, id: %d\n",
- _res_opcodes[opcode], _res_resultcodes[rcode], id);
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEADX))
- putc(';', file);
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEAD2)) {
- fprintf(file, "; flags:");
- if (ns_msg_getflag(handle, ns_f_qr))
- fprintf(file, " qr");
- if (ns_msg_getflag(handle, ns_f_aa))
- fprintf(file, " aa");
- if (ns_msg_getflag(handle, ns_f_tc))
- fprintf(file, " tc");
- if (ns_msg_getflag(handle, ns_f_rd))
- fprintf(file, " rd");
- if (ns_msg_getflag(handle, ns_f_ra))
- fprintf(file, " ra");
- if (ns_msg_getflag(handle, ns_f_z))
- fprintf(file, " ??");
- if (ns_msg_getflag(handle, ns_f_ad))
- fprintf(file, " ad");
- if (ns_msg_getflag(handle, ns_f_cd))
- fprintf(file, " cd");
- }
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEAD1)) {
- fprintf(file, "; %s: %d",
- p_section(ns_s_qd, opcode), qdcount);
- fprintf(file, ", %s: %d",
- p_section(ns_s_an, opcode), ancount);
- fprintf(file, ", %s: %d",
- p_section(ns_s_ns, opcode), nscount);
- fprintf(file, ", %s: %d",
- p_section(ns_s_ar, opcode), arcount);
- }
- if ((!_res.pfcode) || (_res.pfcode &
- (RES_PRF_HEADX | RES_PRF_HEAD2 | RES_PRF_HEAD1))) {
- putc('\n',file);
- }
- /*
- * Print the various sections.
- */
- do_section(&handle, ns_s_qd, RES_PRF_QUES, file);
- do_section(&handle, ns_s_an, RES_PRF_ANS, file);
- do_section(&handle, ns_s_ns, RES_PRF_AUTH, file);
- do_section(&handle, ns_s_ar, RES_PRF_ADD, file);
- if (qdcount == 0 && ancount == 0 &&
- nscount == 0 && arcount == 0)
- putc('\n', file);
-}
-
-const u_char *
-p_cdnname(const u_char *cp, const u_char *msg, int len, FILE *file) {
- char name[MAXDNAME];
- int n;
-
- if ((n = dn_expand(msg, msg + len, cp, name, sizeof name)) < 0)
- return (NULL);
- if (name[0] == '\0')
- putc('.', file);
- else
- fputs(name, file);
- return (cp + n);
-}
-
-const u_char *
-p_cdname(const u_char *cp, const u_char *msg, FILE *file) {
- return (p_cdnname(cp, msg, PACKETSZ, file));
-}
-
-/* Return a fully-qualified domain name from a compressed name (with
- length supplied). */
-
-const u_char *
-p_fqnname(cp, msg, msglen, name, namelen)
- const u_char *cp, *msg;
- int msglen;
- char *name;
- int namelen;
-{
- int n, newlen;
-
- if ((n = dn_expand(msg, cp + msglen, cp, name, namelen)) < 0)
- return (NULL);
- newlen = strlen(name);
- if (newlen == 0 || name[newlen - 1] != '.') {
- if (newlen + 1 >= namelen) /* Lack space for final dot */
- return (NULL);
- else
- strcpy(name + newlen, ".");
- }
- return (cp + n);
-}
-
-/* XXX: the rest of these functions need to become length-limited, too. */
-
-const u_char *
-p_fqname(const u_char *cp, const u_char *msg, FILE *file) {
- char name[MAXDNAME];
- const u_char *n;
-
- n = p_fqnname(cp, msg, MAXCDNAME, name, sizeof name);
- if (n == NULL)
- return (NULL);
- fputs(name, file);
- return (n);
-}
-
-/*
- * Names of RR classes and qclasses. Classes and qclasses are the same, except
- * that C_ANY is a qclass but not a class. (You can ask for records of class
- * C_ANY, but you can't have any records of that class in the database.)
- */
-const struct res_sym __p_class_syms[] = {
- {C_IN, "IN"},
- {C_CHAOS, "CHAOS"},
- {C_HS, "HS"},
- {C_HS, "HESIOD"},
- {C_ANY, "ANY"},
- {C_NONE, "NONE"},
- {C_IN, (char *)0}
-};
-
-/*
- * Names of message sections.
- */
-const struct res_sym __p_default_section_syms[] = {
- {ns_s_qd, "QUERY"},
- {ns_s_an, "ANSWER"},
- {ns_s_ns, "AUTHORITY"},
- {ns_s_ar, "ADDITIONAL"},
- {0, (char *)0}
-};
-
-const struct res_sym __p_update_section_syms[] = {
- {S_ZONE, "ZONE"},
- {S_PREREQ, "PREREQUISITE"},
- {S_UPDATE, "UPDATE"},
- {S_ADDT, "ADDITIONAL"},
- {0, (char *)0}
-};
-
-/*
- * Names of RR types and qtypes. Types and qtypes are the same, except
- * that T_ANY is a qtype but not a type. (You can ask for records of type
- * T_ANY, but you can't have any records of that type in the database.)
- */
-const struct res_sym __p_type_syms[] = {
- {T_A, "A", "address"},
- {T_NS, "NS", "name server"},
- {T_MD, "MD", "mail destination (deprecated)"},
- {T_MF, "MF", "mail forwarder (deprecated)"},
- {T_CNAME, "CNAME", "canonical name"},
- {T_SOA, "SOA", "start of authority"},
- {T_MB, "MB", "mailbox"},
- {T_MG, "MG", "mail group member"},
- {T_MR, "MR", "mail rename"},
- {T_NULL, "NULL", "null"},
- {T_WKS, "WKS", "well-known service (deprecated)"},
- {T_PTR, "PTR", "domain name pointer"},
- {T_HINFO, "HINFO", "host information"},
- {T_MINFO, "MINFO", "mailbox information"},
- {T_MX, "MX", "mail exchanger"},
- {T_TXT, "TXT", "text"},
- {T_RP, "RP", "responsible person"},
- {T_AFSDB, "AFSDB", "DCE or AFS server"},
- {T_X25, "X25", "X25 address"},
- {T_ISDN, "ISDN", "ISDN address"},
- {T_RT, "RT", "router"},
- {T_NSAP, "NSAP", "nsap address"},
- {T_NSAP_PTR, "NSAP_PTR", "domain name pointer"},
- {T_SIG, "SIG", "signature"},
- {T_KEY, "KEY", "key"},
- {T_PX, "PX", "mapping information"},
- {T_GPOS, "GPOS", "geographical position (withdrawn)"},
- {T_AAAA, "AAAA", "IPv6 address"},
- {T_LOC, "LOC", "location"},
- {T_NXT, "NXT", "next valid name (unimplemented)"},
- {T_EID, "EID", "endpoint identifier (unimplemented)"},
- {T_NIMLOC, "NIMLOC", "NIMROD locator (unimplemented)"},
- {T_SRV, "SRV", "server selection"},
- {T_ATMA, "ATMA", "ATM address (unimplemented)"},
- {T_IXFR, "IXFR", "incremental zone transfer"},
- {T_AXFR, "AXFR", "zone transfer"},
- {T_MAILB, "MAILB", "mailbox-related data (deprecated)"},
- {T_MAILA, "MAILA", "mail agent (deprecated)"},
- {T_NAPTR, "NAPTR", "URN Naming Authority"},
- {T_ANY, "ANY", "\"any\""},
- {0, NULL, NULL}
-};
-
-int
-sym_ston(const struct res_sym *syms, const char *name, int *success) {
- for ((void)NULL; syms->name != 0; syms++) {
- if (strcasecmp (name, syms->name) == 0) {
- if (success)
- *success = 1;
- return (syms->number);
- }
- }
- if (success)
- *success = 0;
- return (syms->number); /* The default value. */
-}
-
-const char *
-sym_ntos(const struct res_sym *syms, int number, int *success) {
- static char unname[20];
-
- for ((void)NULL; syms->name != 0; syms++) {
- if (number == syms->number) {
- if (success)
- *success = 1;
- return (syms->name);
- }
- }
-
- sprintf(unname, "%d", number);
- if (success)
- *success = 0;
- return (unname);
-}
-
-const char *
-sym_ntop(const struct res_sym *syms, int number, int *success) {
- static char unname[20];
-
- for ((void)NULL; syms->name != 0; syms++) {
- if (number == syms->number) {
- if (success)
- *success = 1;
- return (syms->humanname);
- }
- }
- sprintf(unname, "%d", number);
- if (success)
- *success = 0;
- return (unname);
-}
-
-/*
- * Return a string for the type.
- */
-const char *
-p_type(int type) {
- return (sym_ntos(__p_type_syms, type, (int *)0));
-}
-
-/*
- * Return a string for the type.
- */
-const char *
-p_section(int section, int opcode) {
- const struct res_sym *symbols;
-
- switch (opcode) {
- case ns_o_update:
- symbols = __p_update_section_syms;
- break;
- default:
- symbols = __p_default_section_syms;
- break;
- }
- return (sym_ntos(symbols, section, (int *)0));
-}
-
-/*
- * Return a mnemonic for class.
- */
-const char *
-p_class(int class) {
- return (sym_ntos(__p_class_syms, class, (int *)0));
-}
-
-/*
- * Return a mnemonic for an option
- */
-const char *
-p_option(u_long option) {
- static char nbuf[40];
-
- switch (option) {
- case RES_INIT: return "init";
- case RES_DEBUG: return "debug";
- case RES_AAONLY: return "aaonly(unimpl)";
- case RES_USEVC: return "usevc";
- case RES_PRIMARY: return "primry(unimpl)";
- case RES_IGNTC: return "igntc";
- case RES_RECURSE: return "recurs";
- case RES_DEFNAMES: return "defnam";
- case RES_STAYOPEN: return "styopn";
- case RES_DNSRCH: return "dnsrch";
- case RES_INSECURE1: return "insecure1";
- case RES_INSECURE2: return "insecure2";
- default: sprintf(nbuf, "?0x%lx?", (u_long)option);
- return (nbuf);
- }
-}
-
-/*
- * Return a mnemonic for a time to live.
- */
-const char *
-p_time(u_int32_t value) {
- static char nbuf[40];
-
- if (ns_format_ttl(value, nbuf, sizeof nbuf) < 0)
- sprintf(nbuf, "%u", value);
- return (nbuf);
-}
-
-
-/*
- * routines to convert between on-the-wire RR format and zone file format.
- * Does not contain conversion to/from decimal degrees; divide or multiply
- * by 60*60*1000 for that.
- */
-
-static unsigned int poweroften[10] = {1, 10, 100, 1000, 10000, 100000,
- 1000000,10000000,100000000,1000000000};
-
-/* takes an XeY precision/size value, returns a string representation. */
-static const char *
-precsize_ntoa(prec)
- u_int8_t prec;
-{
- static char retbuf[sizeof "90000000.00"];
- unsigned long val;
- int mantissa, exponent;
-
- mantissa = (int)((prec >> 4) & 0x0f) % 10;
- exponent = (int)((prec >> 0) & 0x0f) % 10;
-
- val = mantissa * poweroften[exponent];
-
- (void) sprintf(retbuf, "%ld.%.2ld", val/100, val%100);
- return (retbuf);
-}
-
-/* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */
-static u_int8_t
-precsize_aton(strptr)
- char **strptr;
-{
- unsigned int mval = 0, cmval = 0;
- u_int8_t retval = 0;
- char *cp;
- int exponent;
- int mantissa;
-
- cp = *strptr;
-
- while (isdigit((int)*cp))
- mval = mval * 10 + (*cp++ - '0');
-
- if (*cp == '.') { /* centimeters */
- cp++;
- if (isdigit((int)*cp)) {
- cmval = (*cp++ - '0') * 10;
- if (isdigit((int)*cp)) {
- cmval += (*cp++ - '0');
- }
- }
- }
- cmval = (mval * 100) + cmval;
-
- for (exponent = 0; exponent < 9; exponent++)
- if (cmval < poweroften[exponent+1])
- break;
-
- mantissa = cmval / poweroften[exponent];
- if (mantissa > 9)
- mantissa = 9;
-
- retval = (mantissa << 4) | exponent;
-
- *strptr = cp;
-
- return (retval);
-}
-
-/* converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer. */
-static u_int32_t
-latlon2ul(latlonstrptr,which)
- char **latlonstrptr;
- int *which;
-{
- char *cp;
- u_int32_t retval;
- int deg = 0, min = 0, secs = 0, secsfrac = 0;
-
- cp = *latlonstrptr;
-
- while (isdigit((int)*cp))
- deg = deg * 10 + (*cp++ - '0');
-
- while (isspace((int)*cp))
- cp++;
-
- if (!(isdigit((int)*cp)))
- goto fndhemi;
-
- while (isdigit((int)*cp))
- min = min * 10 + (*cp++ - '0');
-
- while (isspace((int)*cp))
- cp++;
-
- if (!(isdigit((int)*cp)))
- goto fndhemi;
-
- while (isdigit((int)*cp))
- secs = secs * 10 + (*cp++ - '0');
-
- if (*cp == '.') { /* decimal seconds */
- cp++;
- if (isdigit((int)*cp)) {
- secsfrac = (*cp++ - '0') * 100;
- if (isdigit((int)*cp)) {
- secsfrac += (*cp++ - '0') * 10;
- if (isdigit((int)*cp)) {
- secsfrac += (*cp++ - '0');
- }
- }
- }
- }
-
- while (!isspace((int)*cp)) /* if any trailing garbage */
- cp++;
-
- while (isspace((int)*cp))
- cp++;
-
- fndhemi:
- switch (*cp) {
- case 'N': case 'n':
- case 'E': case 'e':
- retval = ((unsigned)1<<31)
- + (((((deg * 60) + min) * 60) + secs) * 1000)
- + secsfrac;
- break;
- case 'S': case 's':
- case 'W': case 'w':
- retval = ((unsigned)1<<31)
- - (((((deg * 60) + min) * 60) + secs) * 1000)
- - secsfrac;
- break;
- default:
- retval = 0; /* invalid value -- indicates error */
- break;
- }
-
- switch (*cp) {
- case 'N': case 'n':
- case 'S': case 's':
- *which = 1; /* latitude */
- break;
- case 'E': case 'e':
- case 'W': case 'w':
- *which = 2; /* longitude */
- break;
- default:
- *which = 0; /* error */
- break;
- }
-
- cp++; /* skip the hemisphere */
-
- while (!isspace((int)*cp)) /* if any trailing garbage */
- cp++;
-
- while (isspace((int)*cp)) /* move to next field */
- cp++;
-
- *latlonstrptr = cp;
-
- return (retval);
-}
-
-/* converts a zone file representation in a string to an RDATA on-the-wire
- * representation. */
-int
-loc_aton(ascii, binary)
- const char *ascii;
- u_char *binary;
-{
- const char *cp, *maxcp;
- u_char *bcp;
-
- u_int32_t latit = 0, longit = 0, alt = 0;
- u_int32_t lltemp1 = 0, lltemp2 = 0;
- int altmeters = 0, altfrac = 0, altsign = 1;
- u_int8_t hp = 0x16; /* default = 1e6 cm = 10000.00m = 10km */
- u_int8_t vp = 0x13; /* default = 1e3 cm = 10.00m */
- u_int8_t siz = 0x12; /* default = 1e2 cm = 1.00m */
- int which1 = 0, which2 = 0;
-
- cp = ascii;
- maxcp = cp + strlen(ascii);
-
- lltemp1 = latlon2ul(&cp, &which1);
-
- lltemp2 = latlon2ul(&cp, &which2);
-
- switch (which1 + which2) {
- case 3: /* 1 + 2, the only valid combination */
- if ((which1 == 1) && (which2 == 2)) { /* normal case */
- latit = lltemp1;
- longit = lltemp2;
- } else if ((which1 == 2) && (which2 == 1)) { /* reversed */
- longit = lltemp1;
- latit = lltemp2;
- } else { /* some kind of brokenness */
- return (0);
- }
- break;
- default: /* we didn't get one of each */
- return (0);
- }
-
- /* altitude */
- if (*cp == '-') {
- altsign = -1;
- cp++;
- }
-
- if (*cp == '+')
- cp++;
-
- while (isdigit((int)*cp))
- altmeters = altmeters * 10 + (*cp++ - '0');
-
- if (*cp == '.') { /* decimal meters */
- cp++;
- if (isdigit((int)*cp)) {
- altfrac = (*cp++ - '0') * 10;
- if (isdigit((int)*cp)) {
- altfrac += (*cp++ - '0');
- }
- }
- }
-
- alt = (10000000 + (altsign * (altmeters * 100 + altfrac)));
-
- while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
- cp++;
-
- while (isspace((int)*cp) && (cp < maxcp))
- cp++;
-
- if (cp >= maxcp)
- goto defaults;
-
- siz = precsize_aton(&cp);
-
- while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
- cp++;
-
- while (isspace((int)*cp) && (cp < maxcp))
- cp++;
-
- if (cp >= maxcp)
- goto defaults;
-
- hp = precsize_aton(&cp);
-
- while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
- cp++;
-
- while (isspace((int)*cp) && (cp < maxcp))
- cp++;
-
- if (cp >= maxcp)
- goto defaults;
-
- vp = precsize_aton(&cp);
-
- defaults:
-
- bcp = binary;
- *bcp++ = (u_int8_t) 0; /* version byte */
- *bcp++ = siz;
- *bcp++ = hp;
- *bcp++ = vp;
- PUTLONG(latit,bcp);
- PUTLONG(longit,bcp);
- PUTLONG(alt,bcp);
-
- return (16); /* size of RR in octets */
-}
-
-/* takes an on-the-wire LOC RR and formats it in a human readable format. */
-const char *
-loc_ntoa(binary, ascii)
- const u_char *binary;
- char *ascii;
-{
- static char *error = "?";
- const u_char *cp = binary;
-
- int latdeg, latmin, latsec, latsecfrac;
- int longdeg, longmin, longsec, longsecfrac;
- char northsouth, eastwest;
- int altmeters, altfrac, altsign;
-
- const u_int32_t referencealt = 100000 * 100;
-
- int32_t latval, longval, altval;
- u_int32_t templ;
- u_int8_t sizeval, hpval, vpval, versionval;
-
- char *sizestr, *hpstr, *vpstr;
-
- versionval = *cp++;
-
- if (versionval) {
- (void) sprintf(ascii, "; error: unknown LOC RR version");
- return (ascii);
- }
-
- sizeval = *cp++;
-
- hpval = *cp++;
- vpval = *cp++;
-
- GETLONG(templ, cp);
- latval = (templ - ((unsigned)1<<31));
-
- GETLONG(templ, cp);
- longval = (templ - ((unsigned)1<<31));
-
- GETLONG(templ, cp);
- if (templ < referencealt) { /* below WGS 84 spheroid */
- altval = referencealt - templ;
- altsign = -1;
- } else {
- altval = templ - referencealt;
- altsign = 1;
- }
-
- if (latval < 0) {
- northsouth = 'S';
- latval = -latval;
- } else
- northsouth = 'N';
-
- latsecfrac = latval % 1000;
- latval = latval / 1000;
- latsec = latval % 60;
- latval = latval / 60;
- latmin = latval % 60;
- latval = latval / 60;
- latdeg = latval;
-
- if (longval < 0) {
- eastwest = 'W';
- longval = -longval;
- } else
- eastwest = 'E';
-
- longsecfrac = longval % 1000;
- longval = longval / 1000;
- longsec = longval % 60;
- longval = longval / 60;
- longmin = longval % 60;
- longval = longval / 60;
- longdeg = longval;
-
- altfrac = altval % 100;
- altmeters = (altval / 100) * altsign;
-
- if ((sizestr = strdup(precsize_ntoa(sizeval))) == NULL)
- sizestr = error;
- if ((hpstr = strdup(precsize_ntoa(hpval))) == NULL)
- hpstr = error;
- if ((vpstr = strdup(precsize_ntoa(vpval))) == NULL)
- vpstr = error;
-
- sprintf(ascii,
- "%d %.2d %.2d.%.3d %c %d %.2d %.2d.%.3d %c %d.%.2dm %sm %sm %sm",
- latdeg, latmin, latsec, latsecfrac, northsouth,
- longdeg, longmin, longsec, longsecfrac, eastwest,
- altmeters, altfrac, sizestr, hpstr, vpstr);
-
- if (sizestr != error)
- free(sizestr);
- if (hpstr != error)
- free(hpstr);
- if (vpstr != error)
- free(vpstr);
-
- return (ascii);
-}
-
-
-/* Return the number of DNS hierarchy levels in the name. */
-int
-dn_count_labels(const char *name) {
- int i, len, count;
-
- len = strlen(name);
- for (i = 0, count = 0; i < len; i++) {
- /* XXX need to check for \. or use named's nlabels(). */
- if (name[i] == '.')
- count++;
- }
-
- /* don't count initial wildcard */
- if (name[0] == '*')
- if (count)
- count--;
-
- /* don't count the null label for root. */
- /* if terminating '.' not found, must adjust */
- /* count to include last label */
- if (len > 0 && name[len-1] != '.')
- count++;
- return (count);
-}
-
-
-/*
- * Make dates expressed in seconds-since-Jan-1-1970 easy to read.
- * SIG records are required to be printed like this, by the Secure DNS RFC.
- */
-char *
-p_secstodate (u_long secs) {
- static char output[15]; /* YYYYMMDDHHMMSS and null */
- time_t clock = secs;
- struct tm *time;
-
- time = gmtime(&clock);
- time->tm_year += 1900;
- time->tm_mon += 1;
- sprintf(output, "%04d%02d%02d%02d%02d%02d",
- time->tm_year, time->tm_mon, time->tm_mday,
- time->tm_hour, time->tm_min, time->tm_sec);
- return (output);
-}
diff --git a/c/src/lib/libnetworking/libc/res_init.c b/c/src/lib/libnetworking/libc/res_init.c
deleted file mode 100644
index 9371e9fa82..0000000000
--- a/c/src/lib/libnetworking/libc/res_init.c
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
- * Copyright (c) 1985, 1989, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
-static char orig_rcsid[] = "From: Id: res_init.c,v 8.7 1996/11/18 09:10:04 vixie Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "res_config.h"
-
-static void res_setoptions __P((char *, char *));
-
-#ifdef RESOLVSORT
-static const char sort_mask[] = "/&";
-#define ISSORTMASK(ch) (strchr(sort_mask, ch) != NULL)
-static u_int32_t net_mask __P((struct in_addr));
-#endif
-
-#if !defined(isascii) /* XXX - could be a function */
-# define isascii(c) (!(c & 0200))
-#endif
-
-/*
- * Resolver state default settings.
- */
-
-struct __res_state _res
-# if defined(__BIND_RES_TEXT)
- = { RES_TIMEOUT, } /* Motorola, et al. */
-# endif
- ;
-
-
-/*
- * Set up default settings. If the configuration file exist, the values
- * there will have precedence. Otherwise, the server address is set to
- * INADDR_ANY and the default domain name comes from the gethostname().
- *
- * An interrim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1
- * rather than INADDR_ANY ("0.0.0.0") as the default name server address
- * since it was noted that INADDR_ANY actually meant ``the first interface
- * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface,
- * it had to be "up" in order for you to reach your own name server. It
- * was later decided that since the recommended practice is to always
- * install local static routes through 127.0.0.1 for all your network
- * interfaces, that we could solve this problem without a code change.
- *
- * The configuration file should always be used, since it is the only way
- * to specify a default domain. If you are running a server on your local
- * machine, you should say "nameserver 0.0.0.0" or "nameserver 127.0.0.1"
- * in the configuration file.
- *
- * Return 0 if completes successfully, -1 on error
- */
-int
-res_init()
-{
- register FILE *fp;
- register char *cp, **pp;
- register int n;
- char buf[MAXDNAME];
- int nserv = 0; /* number of nameserver records read from file */
- int haveenv = 0;
- int havesearch = 0;
-#ifdef RESOLVSORT
- int nsort = 0;
- char *net;
-#endif
-#ifndef RFC1535
- int dots;
-#endif
-
- /*
- * These three fields used to be statically initialized. This made
- * it hard to use this code in a shared library. It is necessary,
- * now that we're doing dynamic initialization here, that we preserve
- * the old semantics: if an application modifies one of these three
- * fields of _res before res_init() is called, res_init() will not
- * alter them. Of course, if an application is setting them to
- * _zero_ before calling res_init(), hoping to override what used
- * to be the static default, we can't detect it and unexpected results
- * will follow. Zero for any of these fields would make no sense,
- * so one can safely assume that the applications were already getting
- * unexpected results.
- *
- * _res.options is tricky since some apps were known to diddle the bits
- * before res_init() was first called. We can't replicate that semantic
- * with dynamic initialization (they may have turned bits off that are
- * set in RES_DEFAULT). Our solution is to declare such applications
- * "broken". They could fool us by setting RES_INIT but none do (yet).
- */
- if (!_res.retrans)
- _res.retrans = RES_TIMEOUT;
- if (!_res.retry)
- _res.retry = 4;
- if (!(_res.options & RES_INIT))
- _res.options = RES_DEFAULT;
-
- /*
- * This one used to initialize implicitly to zero, so unless the app
- * has set it to something in particular, we can randomize it now.
- */
- if (!_res.id)
- _res.id = res_randomid();
-
-#ifdef USELOOPBACK
- _res.nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
-#else
- _res.nsaddr.sin_addr.s_addr = INADDR_ANY;
-#endif
- _res.nsaddr.sin_family = AF_INET;
- _res.nsaddr.sin_port = htons(NAMESERVER_PORT);
- _res.nscount = 1;
- _res.ndots = 1;
- _res.pfcode = 0;
-
- /*
- * RTEMS -- Set up name servers
- */
- {
-#include <rtems/rtems_bsdnet_internal.h>
- int n = 0;
- while ((n < rtems_bsdnet_nameserver_count) && (nserv < MAXNS)) {
- _res.nsaddr_list[nserv].sin_addr = rtems_bsdnet_nameserver[n];
- _res.nsaddr_list[nserv].sin_family = AF_INET;
- _res.nsaddr_list[nserv].sin_port = htons(NAMESERVER_PORT);
- nserv++;
- n++;
- }
- if (rtems_bsdnet_domain_name)
- (void)strncpy(_res.defdname, rtems_bsdnet_domain_name, sizeof(_res.defdname) - 1);
- }
-
- /* Allow user to override the local domain definition */
- if ((cp = getenv("LOCALDOMAIN")) != NULL) {
- (void)strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
- haveenv++;
-
- /*
- * Set search list to be blank-separated strings
- * from rest of env value. Permits users of LOCALDOMAIN
- * to still have a search list, and anyone to set the
- * one that they want to use as an individual (even more
- * important now that the rfc1535 stuff restricts searches)
- */
- cp = _res.defdname;
- pp = _res.dnsrch;
- *pp++ = cp;
- for (n = 0; *cp && pp < _res.dnsrch + MAXDNSRCH; cp++) {
- if (*cp == '\n') /* silly backwards compat */
- break;
- else if (*cp == ' ' || *cp == '\t') {
- *cp = 0;
- n = 1;
- } else if (n) {
- *pp++ = cp;
- n = 0;
- havesearch = 1;
- }
- }
- /* null terminate last domain if there are excess */
- while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n')
- cp++;
- *cp = '\0';
- *pp++ = 0;
- }
-
-#define MATCH(line, name) \
- (!strncmp(line, name, sizeof(name) - 1) && \
- (line[sizeof(name) - 1] == ' ' || \
- line[sizeof(name) - 1] == '\t'))
-
- if ((fp = fopen(_PATH_RESCONF, "r")) != NULL) {
- /* read the config file */
- while (fgets(buf, sizeof(buf), fp) != NULL) {
- /* skip comments */
- if (*buf == ';' || *buf == '#')
- continue;
- /* read default domain name */
- if (MATCH(buf, "domain")) {
- if (haveenv) /* skip if have from environ */
- continue;
- cp = buf + sizeof("domain") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp == '\0') || (*cp == '\n'))
- continue;
- strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
- if ((cp = strpbrk(_res.defdname, " \t\n")) != NULL)
- *cp = '\0';
- havesearch = 0;
- continue;
- }
- /* set search list */
- if (MATCH(buf, "search")) {
- if (haveenv) /* skip if have from environ */
- continue;
- cp = buf + sizeof("search") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp == '\0') || (*cp == '\n'))
- continue;
- strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
- if ((cp = strchr(_res.defdname, '\n')) != NULL)
- *cp = '\0';
- /*
- * Set search list to be blank-separated strings
- * on rest of line.
- */
- cp = _res.defdname;
- pp = _res.dnsrch;
- *pp++ = cp;
- for (n = 0; *cp && pp < _res.dnsrch + MAXDNSRCH; cp++) {
- if (*cp == ' ' || *cp == '\t') {
- *cp = 0;
- n = 1;
- } else if (n) {
- *pp++ = cp;
- n = 0;
- }
- }
- /* null terminate last domain if there are excess */
- while (*cp != '\0' && *cp != ' ' && *cp != '\t')
- cp++;
- *cp = '\0';
- *pp++ = 0;
- havesearch = 1;
- continue;
- }
- /* read nameservers to query */
- if (MATCH(buf, "nameserver") && nserv < MAXNS) {
- struct in_addr a;
-
- cp = buf + sizeof("nameserver") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp != '\0') && (*cp != '\n') && inet_aton(cp, &a)) {
- _res.nsaddr_list[nserv].sin_addr = a;
- _res.nsaddr_list[nserv].sin_family = AF_INET;
- _res.nsaddr_list[nserv].sin_port =
- htons(NAMESERVER_PORT);
- nserv++;
- }
- continue;
- }
-#ifdef RESOLVSORT
- if (MATCH(buf, "sortlist")) {
- struct in_addr a;
-
- cp = buf + sizeof("sortlist") - 1;
- while (nsort < MAXRESOLVSORT) {
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if (*cp == '\0' || *cp == '\n' || *cp == ';')
- break;
- net = cp;
- while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&
- isascii((int)*cp) && !isspace((int)*cp))
- cp++;
- n = *cp;
- *cp = 0;
- if (inet_aton(net, &a)) {
- _res.sort_list[nsort].addr = a;
- if (ISSORTMASK(n)) {
- *cp++ = n;
- net = cp;
- while (*cp && *cp != ';' &&
- isascii((int)*cp) && !isspace((int)*cp))
- cp++;
- n = *cp;
- *cp = 0;
- if (inet_aton(net, &a)) {
- _res.sort_list[nsort].mask = a.s_addr;
- } else {
- _res.sort_list[nsort].mask =
- net_mask(_res.sort_list[nsort].addr);
- }
- } else {
- _res.sort_list[nsort].mask =
- net_mask(_res.sort_list[nsort].addr);
- }
- nsort++;
- }
- *cp = n;
- }
- continue;
- }
-#endif
- if (MATCH(buf, "options")) {
- res_setoptions(buf + sizeof("options") - 1, "conf");
- continue;
- }
- }
- if (nserv > 1)
- _res.nscount = nserv;
-#ifdef RESOLVSORT
- _res.nsort = nsort;
-#endif
- (void) fclose(fp);
- }
- if (_res.defdname[0] == 0 &&
- gethostname(buf, sizeof(_res.defdname) - 1) == 0 &&
- (cp = strchr(buf, '.')) != NULL)
- strcpy(_res.defdname, cp + 1);
-
- /* find components of local domain that might be searched */
- if (havesearch == 0) {
- pp = _res.dnsrch;
- *pp++ = _res.defdname;
- *pp = NULL;
-
-#ifndef RFC1535
- dots = 0;
- for (cp = _res.defdname; *cp; cp++)
- dots += (*cp == '.');
-
- cp = _res.defdname;
- while (pp < _res.dnsrch + MAXDFLSRCH) {
- if (dots < LOCALDOMAINPARTS)
- break;
- cp = strchr(cp, '.') + 1; /* we know there is one */
- *pp++ = cp;
- dots--;
- }
- *pp = NULL;
-#ifdef DEBUG
- if (_res.options & RES_DEBUG) {
- printf(";; res_init()... default dnsrch list:\n");
- for (pp = _res.dnsrch; *pp; pp++)
- printf(";;\t%s\n", *pp);
- printf(";;\t..END..\n");
- }
-#endif
-#endif /* !RFC1535 */
- }
-
- if ((cp = getenv("RES_OPTIONS")) != NULL)
- res_setoptions(cp, "env");
- _res.options |= RES_INIT;
- return (0);
-}
-
-static void
-res_setoptions(options, source)
- char *options, *source;
-{
- char *cp = options;
- int i;
-
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_setoptions(\"%s\", \"%s\")...\n",
- options, source);
-#endif
- while (*cp) {
- /* skip leading and inner runs of spaces */
- while (*cp == ' ' || *cp == '\t')
- cp++;
- /* search for and process individual options */
- if (!strncmp(cp, "ndots:", sizeof("ndots:") - 1)) {
- i = atoi(cp + sizeof("ndots:") - 1);
- if (i <= RES_MAXNDOTS)
- _res.ndots = i;
- else
- _res.ndots = RES_MAXNDOTS;
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";;\tndots=%d\n", _res.ndots);
-#endif
- } else if (!strncmp(cp, "debug", sizeof("debug") - 1)) {
-#ifdef DEBUG
- if (!(_res.options & RES_DEBUG)) {
- printf(";; res_setoptions(\"%s\", \"%s\")..\n",
- options, source);
- _res.options |= RES_DEBUG;
- }
- printf(";;\tdebug\n");
-#endif
- } else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) {
- _res.options |= RES_USE_INET6;
- } else if (!strncmp(cp, "no_tld_query", sizeof("no_tld_query") - 1)) {
- _res.options |= RES_NOTLDQUERY;
- } else {
- /* XXX - print a warning here? */
- }
- /* skip to next run of spaces */
- while (*cp && *cp != ' ' && *cp != '\t')
- cp++;
- }
-}
-
-#ifdef RESOLVSORT
-/* XXX - should really support CIDR which means explicit masks always. */
-static u_int32_t
-net_mask(in) /* XXX - should really use system's version of this */
- struct in_addr in;
-{
- register u_int32_t i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return (htonl(IN_CLASSA_NET));
- else if (IN_CLASSB(i))
- return (htonl(IN_CLASSB_NET));
- return (htonl(IN_CLASSC_NET));
-}
-#endif
-
-u_int
-res_randomid()
-{
- struct timeval now;
-
- gettimeofday(&now, NULL);
- return (0xffff & (now.tv_sec ^ now.tv_usec ^ getpid()));
-}
diff --git a/c/src/lib/libnetworking/libc/res_mkquery.c b/c/src/lib/libnetworking/libc/res_mkquery.c
deleted file mode 100644
index d3fabfa5ab..0000000000
--- a/c/src/lib/libnetworking/libc/res_mkquery.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 1985, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: res_mkquery.c,v 8.9 1997/04/24 22:22:36 vixie Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "res_config.h"
-
-/*
- * Form all types of queries.
- * Returns the size of the result or -1.
- */
-int
-res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
- int op; /* opcode of query */
- const char *dname; /* domain name */
- int class, type; /* class and type of query */
- const u_char *data; /* resource record data */
- int datalen; /* length of data */
- const u_char *newrr_in; /* new rr for modify or append */
- u_char *buf; /* buffer to put query */
- int buflen; /* size of buffer */
-{
- register HEADER *hp;
- register u_char *cp;
- register int n;
- u_char *dnptrs[20], **dpp, **lastdnptr;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_mkquery(%d, %s, %d, %d)\n",
- op, dname, class, type);
-#endif
- /*
- * Initialize header fields.
- */
- if ((buf == NULL) || (buflen < HFIXEDSZ))
- return (-1);
- memset(buf, 0, HFIXEDSZ);
- hp = (HEADER *) buf;
- hp->id = htons(++_res.id);
- hp->opcode = op;
- hp->rd = (_res.options & RES_RECURSE) != 0;
- hp->rcode = NOERROR;
- cp = buf + HFIXEDSZ;
- buflen -= HFIXEDSZ;
- dpp = dnptrs;
- *dpp++ = buf;
- *dpp++ = NULL;
- lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
- /*
- * perform opcode specific processing
- */
- switch (op) {
- case QUERY: /*FALLTHROUGH*/
- case NS_NOTIFY_OP:
- if ((buflen -= QFIXEDSZ) < 0)
- return (-1);
- if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
- return (-1);
- cp += n;
- buflen -= n;
- __putshort(type, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- hp->qdcount = htons(1);
- if (op == QUERY || data == NULL)
- break;
- /*
- * Make an additional record for completion domain.
- */
- buflen -= RRFIXEDSZ;
- n = dn_comp((char *)data, cp, buflen, dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- buflen -= n;
- __putshort(T_NULL, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- __putlong(0, cp);
- cp += INT32SZ;
- __putshort(0, cp);
- cp += INT16SZ;
- hp->arcount = htons(1);
- break;
-
- case IQUERY:
- /*
- * Initialize answer section
- */
- if (buflen < 1 + RRFIXEDSZ + datalen)
- return (-1);
- *cp++ = '\0'; /* no domain name */
- __putshort(type, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- __putlong(0, cp);
- cp += INT32SZ;
- __putshort(datalen, cp);
- cp += INT16SZ;
- if (datalen) {
- memcpy(cp, data, datalen);
- cp += datalen;
- }
- hp->ancount = htons(1);
- break;
-
- default:
- return (-1);
- }
- return (cp - buf);
-}
diff --git a/c/src/lib/libnetworking/libc/res_mkupdate.c b/c/src/lib/libnetworking/libc/res_mkupdate.c
deleted file mode 100644
index 56362f650b..0000000000
--- a/c/src/lib/libnetworking/libc/res_mkupdate.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Based on the Dynamic DNS reference implementation by Viraj Bais
- * <viraj_bais@ccm.fm.intel.com>
- */
-
-#if !defined(__rtems__)
-#if !defined(lint) && !defined(SABER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-#include <sys/param.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <limits.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <ctype.h>
-
-#include "res_config.h"
-
-static int getnum_str(u_char **, u_char *);
-static int getword_str(char *, int, u_char **, u_char *);
-
-#define ShrinkBuffer(x) if ((buflen -= x) < 0) return (-2);
-
-/*
- * Form update packets.
- * Returns the size of the resulting packet if no error
- * On error,
- * returns -1 if error in reading a word/number in rdata
- * portion for update packets
- * -2 if length of buffer passed is insufficient
- * -3 if zone section is not the first section in
- * the linked list, or section order has a problem
- * -4 on a number overflow
- * -5 unknown operation or no records
- */
-int
-res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
- ns_updrec *rrecp_start = rrecp_in;
- HEADER *hp;
- u_char *cp, *sp1, *sp2, *startp, *endp;
- int n, i, soanum, multiline;
- ns_updrec *rrecp;
- struct in_addr ina;
- char buf2[MAXDNAME];
- int section, numrrs = 0, counts[ns_s_max];
- u_int16_t rtype, rclass;
- u_int32_t n1, rttl;
- u_char *dnptrs[20], **dpp, **lastdnptr;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-
- /*
- * Initialize header fields.
- */
- if ((buf == NULL) || (buflen < HFIXEDSZ))
- return (-1);
- memset(buf, 0, HFIXEDSZ);
- hp = (HEADER *) buf;
- hp->id = htons(++_res.id);
- hp->opcode = ns_o_update;
- hp->rcode = NOERROR;
- sp1 = buf + 2*INT16SZ; /* save pointer to zocount */
- cp = buf + HFIXEDSZ;
- buflen -= HFIXEDSZ;
- dpp = dnptrs;
- *dpp++ = buf;
- *dpp++ = NULL;
- lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
-
- if (rrecp_start == NULL)
- return (-5);
- else if (rrecp_start->r_section != S_ZONE)
- return (-3);
-
- memset(counts, 0, sizeof counts);
- for (rrecp = rrecp_start; rrecp; rrecp = rrecp->r_grpnext) {
- numrrs++;
- section = rrecp->r_section;
- if (section < 0 || section >= ns_s_max)
- return (-1);
- counts[section]++;
- for (i = section + 1; i < ns_s_max; i++)
- if (counts[i])
- return (-3);
- rtype = rrecp->r_type;
- rclass = rrecp->r_class;
- rttl = rrecp->r_ttl;
- /* overload class and type */
- if (section == S_PREREQ) {
- rttl = 0;
- switch (rrecp->r_opcode) {
- case YXDOMAIN:
- rclass = C_ANY;
- rtype = T_ANY;
- rrecp->r_size = 0;
- break;
- case NXDOMAIN:
- rclass = C_NONE;
- rtype = T_ANY;
- rrecp->r_size = 0;
- break;
- case NXRRSET:
- rclass = C_NONE;
- rrecp->r_size = 0;
- break;
- case YXRRSET:
- if (rrecp->r_size == 0)
- rclass = C_ANY;
- break;
- default:
- fprintf(stderr,
- "res_mkupdate: incorrect opcode: %d\n",
- rrecp->r_opcode);
- fflush(stderr);
- return (-1);
- }
- } else if (section == S_UPDATE) {
- switch (rrecp->r_opcode) {
- case DELETE:
- rclass = rrecp->r_size == 0 ? C_ANY : C_NONE;
- break;
- case ADD:
- break;
- default:
- fprintf(stderr,
- "res_mkupdate: incorrect opcode: %d\n",
- rrecp->r_opcode);
- fflush(stderr);
- return (-1);
- }
- }
-
- /*
- * XXX appending default domain to owner name is omitted,
- * fqdn must be provided
- */
- if ((n = dn_comp(rrecp->r_dname, cp, buflen, dnptrs,
- lastdnptr)) < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n + 2*INT16SZ);
- PUTSHORT(rtype, cp);
- PUTSHORT(rclass, cp);
- if (section == S_ZONE) {
- if (numrrs != 1 || rrecp->r_type != T_SOA)
- return (-3);
- continue;
- }
- ShrinkBuffer(INT32SZ + INT16SZ);
- PUTLONG(rttl, cp);
- sp2 = cp; /* save pointer to length byte */
- cp += INT16SZ;
- if (rrecp->r_size == 0) {
- if (section == S_UPDATE && rclass != C_ANY)
- return (-1);
- else {
- PUTSHORT(0, sp2);
- continue;
- }
- }
- startp = rrecp->r_data;
- endp = startp + rrecp->r_size - 1;
- /* XXX this should be done centrally. */
- switch (rrecp->r_type) {
- case T_A:
- if (!getword_str(buf2, sizeof buf2, &startp, endp))
- return (-1);
- if (!inet_aton(buf2, &ina))
- return (-1);
- n1 = ntohl(ina.s_addr);
- ShrinkBuffer(INT32SZ);
- PUTLONG(n1, cp);
- break;
- case T_CNAME:
- case T_MB:
- case T_MG:
- case T_MR:
- case T_NS:
- case T_PTR:
- if (!getword_str(buf2, sizeof buf2, &startp, endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen, dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- break;
- case T_MINFO:
- case T_SOA:
- case T_RP:
- for (i = 0; i < 2; i++) {
- if (!getword_str(buf2, sizeof buf2, &startp,
- endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen,
- dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- }
- if (rrecp->r_type == T_SOA) {
- ShrinkBuffer(5 * INT32SZ);
- while (isspace(*startp) || !*startp)
- startp++;
- if (*startp == '(') {
- multiline = 1;
- startp++;
- } else
- multiline = 0;
- /* serial, refresh, retry, expire, minimum */
- for (i = 0; i < 5; i++) {
- soanum = getnum_str(&startp, endp);
- if (soanum < 0)
- return (-1);
- PUTLONG(soanum, cp);
- }
- if (multiline) {
- while (isspace(*startp) || !*startp)
- startp++;
- if (*startp != ')')
- return (-1);
- }
- }
- break;
- case T_MX:
- case T_AFSDB:
- case T_RT:
- n = getnum_str(&startp, endp);
- if (n < 0)
- return (-1);
- PUTSHORT(n, cp);
- ShrinkBuffer(INT16SZ);
- if (!getword_str(buf2, sizeof buf2, &startp, endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen, dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- break;
- case T_PX:
- n = getnum_str(&startp, endp);
- if (n < 0)
- return (-1);
- PUTSHORT(n, cp);
- ShrinkBuffer(INT16SZ);
- for (i = 0; i < 2; i++) {
- if (!getword_str(buf2, sizeof buf2, &startp,
- endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen, dnptrs,
- lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- }
- break;
- case T_WKS:
- case T_HINFO:
- case T_TXT:
- case T_X25:
- case T_ISDN:
- case T_NSAP:
- case T_LOC:
- /* XXX - more fine tuning needed here */
- ShrinkBuffer(rrecp->r_size);
- memcpy(cp, rrecp->r_data, rrecp->r_size);
- cp += rrecp->r_size;
- break;
- default:
- return (-1);
- } /*switch*/
- n = (u_int16_t)((cp - sp2) - INT16SZ);
- PUTSHORT(n, sp2);
- } /*for*/
-
- hp->qdcount = htons(counts[0]);
- hp->ancount = htons(counts[1]);
- hp->nscount = htons(counts[2]);
- hp->arcount = htons(counts[3]);
- return (cp - buf);
-}
-
-/*
- * Get a whitespace delimited word from a string (not file)
- * into buf. modify the start pointer to point after the
- * word in the string.
- */
-static int
-getword_str(char *buf, int size, u_char **startpp, u_char *endp) {
- char *cp;
- int c;
-
- for (cp = buf; *startpp <= endp; ) {
- c = **startpp;
- if (isspace(c) || c == '\0') {
- if (cp != buf) /* trailing whitespace */
- break;
- else { /* leading whitespace */
- (*startpp)++;
- continue;
- }
- }
- (*startpp)++;
- if (cp >= buf+size-1)
- break;
- *cp++ = (u_char)c;
- }
- *cp = '\0';
- return (cp != buf);
-}
-
-/*
- * Get a whitespace delimited number from a string (not file) into buf
- * update the start pointer to point after the number in the string.
- */
-static int
-getnum_str(u_char **startpp, u_char *endp) {
- int c, n;
- int seendigit = 0;
- int m = 0;
-
- for (n = 0; *startpp <= endp; ) {
- c = **startpp;
- if (isspace(c) || c == '\0') {
- if (seendigit) /* trailing whitespace */
- break;
- else { /* leading whitespace */
- (*startpp)++;
- continue;
- }
- }
- if (c == ';') {
- while ((*startpp <= endp) &&
- ((c = **startpp) != '\n'))
- (*startpp)++;
- if (seendigit)
- break;
- continue;
- }
- if (!isdigit(c)) {
- if (c == ')' && seendigit) {
- (*startpp)--;
- break;
- }
- return (-1);
- }
- (*startpp)++;
- n = n * 10 + (c - '0');
- seendigit = 1;
- }
- return (n + m);
-}
-
-/*
- * Allocate a resource record buffer & save rr info.
- */
-ns_updrec *
-res_mkupdrec(int section, const char *dname,
- u_int class, u_int type, u_long ttl) {
- ns_updrec *rrecp = (ns_updrec *)calloc(1, sizeof(ns_updrec));
-
- if (!rrecp || !(rrecp->r_dname = strdup(dname)))
- return (NULL);
- rrecp->r_class = class;
- rrecp->r_type = type;
- rrecp->r_ttl = ttl;
- rrecp->r_section = section;
- return (rrecp);
-}
-
-/*
- * Free a resource record buffer created by res_mkupdrec.
- */
-void
-res_freeupdrec(ns_updrec *rrecp) {
- /* Note: freeing r_dp is the caller's responsibility. */
- if (rrecp->r_dname != NULL)
- free(rrecp->r_dname);
- free(rrecp);
-}
diff --git a/c/src/lib/libnetworking/libc/res_query.c b/c/src/lib/libnetworking/libc/res_query.c
deleted file mode 100644
index 784fa433bc..0000000000
--- a/c/src/lib/libnetworking/libc/res_query.c
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid = "From: Id: res_query.c,v 8.14 1997/06/09 17:47:05 halley Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <errno.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "res_config.h"
-
-#if PACKETSZ > 1024
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 1024
-#endif
-
-/*
- * Formulate a normal query, send, and await answer.
- * Returned answer is placed in supplied buffer "answer".
- * Perform preliminary check of answer, returning success only
- * if no error is indicated and the answer count is nonzero.
- * Return the size of the response on success, -1 on error.
- * Error number is left in h_errno.
- *
- * Caller must parse answer and determine whether it answers the question.
- */
-int
-res_query(name, class, type, answer, anslen)
- const char *name; /* domain name */
- int class, type; /* class and type of query */
- u_char *answer; /* buffer to put answer */
- int anslen; /* size of answer buffer */
-{
- u_char buf[MAXPACKET];
- HEADER *hp = (HEADER *) answer;
- int n;
-
- hp->rcode = NOERROR; /* default */
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_query(%s, %d, %d)\n", name, class, type);
-#endif
-
- n = res_mkquery(QUERY, name, class, type, NULL, 0, NULL,
- buf, sizeof(buf));
- if (n <= 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_query: mkquery failed\n");
-#endif
- h_errno = NO_RECOVERY;
- return (n);
- }
- n = res_send(buf, n, answer, anslen);
- if (n < 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_query: send error\n");
-#endif
- h_errno = TRY_AGAIN;
- return (n);
- }
-
- if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; rcode = %d, ancount=%d\n", hp->rcode,
- ntohs(hp->ancount));
-#endif
- switch (hp->rcode) {
- case NXDOMAIN:
- h_errno = HOST_NOT_FOUND;
- break;
- case SERVFAIL:
- h_errno = TRY_AGAIN;
- break;
- case NOERROR:
- h_errno = NO_DATA;
- break;
- case FORMERR:
- case NOTIMP:
- case REFUSED:
- default:
- h_errno = NO_RECOVERY;
- break;
- }
- return (-1);
- }
- return (n);
-}
-
-/*
- * Formulate a normal query, send, and retrieve answer in supplied buffer.
- * Return the size of the response on success, -1 on error.
- * If enabled, implement search rules until answer or unrecoverable failure
- * is detected. Error code, if any, is left in h_errno.
- */
-int
-res_search(name, class, type, answer, anslen)
- const char *name; /* domain name */
- int class, type; /* class and type of query */
- u_char *answer; /* buffer to put answer */
- int anslen; /* size of answer */
-{
- const char *cp, * const *domain;
- HEADER *hp = (HEADER *) answer;
- u_int dots;
- int trailing_dot, ret, saved_herrno;
- int got_nodata = 0, got_servfail = 0, tried_as_is = 0;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
- errno = 0;
- h_errno = HOST_NOT_FOUND; /* default, if we never query */
- dots = 0;
- for (cp = name; *cp; cp++)
- dots += (*cp == '.');
- trailing_dot = 0;
- if (cp > name && *--cp == '.')
- trailing_dot++;
-
- /* If there aren't any dots, it could be a user-level alias */
- if (!dots && (cp = hostalias(name)) != NULL)
- return (res_query(cp, class, type, answer, anslen));
-
- /*
- * If there are dots in the name already, let's just give it a try
- * 'as is'. The threshold can be set with the "ndots" option.
- */
- saved_herrno = -1;
- if (dots >= _res.ndots) {
- ret = res_querydomain(name, NULL, class, type, answer, anslen);
- if (ret > 0)
- return (ret);
- saved_herrno = h_errno;
- tried_as_is++;
- }
-
- /*
- * We do at least one level of search if
- * - there is no dot and RES_DEFNAME is set, or
- * - there is at least one dot, there is no trailing dot,
- * and RES_DNSRCH is set.
- */
- if ((!dots && (_res.options & RES_DEFNAMES)) ||
- (dots && !trailing_dot && (_res.options & RES_DNSRCH))) {
- int done = 0;
-
- for (domain = (const char * const *)_res.dnsrch;
- *domain && !done;
- domain++) {
-
- ret = res_querydomain(name, *domain, class, type,
- answer, anslen);
- if (ret > 0)
- return (ret);
-
- /*
- * If no server present, give up.
- * If name isn't found in this domain,
- * keep trying higher domains in the search list
- * (if that's enabled).
- * On a NO_DATA error, keep trying, otherwise
- * a wildcard entry of another type could keep us
- * from finding this entry higher in the domain.
- * If we get some other error (negative answer or
- * server failure), then stop searching up,
- * but try the input name below in case it's
- * fully-qualified.
- */
- if (errno == ECONNREFUSED) {
- h_errno = TRY_AGAIN;
- return (-1);
- }
-
- switch (h_errno) {
- case NO_DATA:
- got_nodata++;
- /* FALLTHROUGH */
- case HOST_NOT_FOUND:
- /* keep trying */
- break;
- case TRY_AGAIN:
- if (hp->rcode == SERVFAIL) {
- /* try next search element, if any */
- got_servfail++;
- break;
- }
- /* FALLTHROUGH */
- default:
- /* anything else implies that we're done */
- done++;
- }
-
- /* if we got here for some reason other than DNSRCH,
- * we only wanted one iteration of the loop, so stop.
- */
- if (!(_res.options & RES_DNSRCH))
- done++;
- }
- }
-
- /*
- * If we have not already tried the name "as is", do that now.
- * note that we do this regardless of how many dots were in the
- * name or whether it ends with a dot unless NOTLDQUERY is set.
- */
- if (!tried_as_is && (dots || !(_res.options & RES_NOTLDQUERY))) {
- ret = res_querydomain(name, NULL, class, type, answer, anslen);
- if (ret > 0)
- return (ret);
- }
-
- /* if we got here, we didn't satisfy the search.
- * if we did an initial full query, return that query's h_errno
- * (note that we wouldn't be here if that query had succeeded).
- * else if we ever got a nodata, send that back as the reason.
- * else send back meaningless h_errno, that being the one from
- * the last DNSRCH we did.
- */
- if (saved_herrno != -1)
- h_errno = saved_herrno;
- else if (got_nodata)
- h_errno = NO_DATA;
- else if (got_servfail)
- h_errno = TRY_AGAIN;
- return (-1);
-}
-
-/*
- * Perform a call on res_query on the concatenation of name and domain,
- * removing a trailing dot from name if domain is NULL.
- */
-int
-res_querydomain(name, domain, class, type, answer, anslen)
- const char *name, *domain;
- int class, type; /* class and type of query */
- u_char *answer; /* buffer to put answer */
- int anslen; /* size of answer */
-{
- char nbuf[MAXDNAME];
- const char *longname = nbuf;
- int n, d;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_querydomain(%s, %s, %d, %d)\n",
- name, domain?domain:"<Nil>", class, type);
-#endif
- if (domain == NULL) {
- /*
- * Check for trailing '.';
- * copy without '.' if present.
- */
- n = strlen(name);
- if (n >= MAXDNAME) {
- h_errno = NO_RECOVERY;
- return (-1);
- }
- n--;
- if (n >= 0 && name[n] == '.') {
- strncpy(nbuf, name, n);
- nbuf[n] = '\0';
- } else
- longname = name;
- } else {
- n = strlen(name);
- d = strlen(domain);
- if (n + d + 1 >= MAXDNAME) {
- h_errno = NO_RECOVERY;
- return (-1);
- }
- sprintf(nbuf, "%s.%s", name, domain);
- }
- return (res_query(longname, class, type, answer, anslen));
-}
-
-const char *
-hostalias(name)
- const char *name;
-{
- register char *cp1, *cp2;
- FILE *fp;
- char *file;
- char buf[BUFSIZ];
- static char abuf[MAXDNAME];
-
- if (_res.options & RES_NOALIASES)
- return (NULL);
- if (issetugid())
- return (NULL);
- file = getenv("HOSTALIASES");
- if (file == NULL || (fp = fopen(file, "r")) == NULL)
- return (NULL);
- setbuf(fp, NULL);
- buf[sizeof(buf) - 1] = '\0';
- while (fgets(buf, sizeof(buf), fp)) {
- for (cp1 = buf; *cp1 && !isspace((int)*cp1); ++cp1)
- ;
- if (!*cp1)
- break;
- *cp1 = '\0';
- if (!strcasecmp(buf, name)) {
- while (isspace((int)*++cp1))
- ;
- if (!*cp1)
- break;
- for (cp2 = cp1 + 1; *cp2 && !isspace((int)*cp2); ++cp2)
- ;
- abuf[sizeof(abuf) - 1] = *cp2 = '\0';
- strncpy(abuf, cp1, sizeof(abuf) - 1);
- fclose(fp);
- return (abuf);
- }
- }
- fclose(fp);
- return (NULL);
-}
diff --git a/c/src/lib/libnetworking/libc/res_send.c b/c/src/lib/libnetworking/libc/res_send.c
deleted file mode 100644
index 08cb78490f..0000000000
--- a/c/src/lib/libnetworking/libc/res_send.c
+++ /dev/null
@@ -1,929 +0,0 @@
-/*
- * Copyright (c) 1985, 1989, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: res_send.c,v 8.20 1998/04/06 23:27:51 halley Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Send query to name server and wait for reply.
- */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <poll.h>
-
-#include "res_config.h"
-
-#if !defined(__rtems__)
-#ifdef NOPOLL /* libc_r doesn't wrap poll yet() */
-static int use_poll = 0;
-#else
-static int use_poll = 1; /* adapt to poll() syscall availability */
- /* 0 = not present, 1 = try it, 2 = exists */
-#endif
-#endif
-
-static int s = -1; /* socket used for communications */
-static int connected = 0; /* is the socket connected */
-static int vc = 0; /* is the socket a virtual circuit? */
-static res_send_qhook Qhook = NULL;
-static res_send_rhook Rhook = NULL;
-
-
-#define CAN_RECONNECT 1
-
-#ifndef DEBUG
-# define Dprint(cond, args) /*empty*/
-# define DprintQ(cond, args, query, size) /*empty*/
-# define Aerror(file, string, error, address) /*empty*/
-# define Perror(file, string, error) /*empty*/
-#else
-# define Dprint(cond, args) if (cond) {fprintf args;} else {}
-# define DprintQ(cond, args, query, size) if (cond) {\
- fprintf args;\
- __fp_nquery(query, size, stdout);\
- } else {}
- static void
- Aerror(file, string, error, address)
- FILE *file;
- char *string;
- int error;
- struct sockaddr_in address;
- {
- int save = errno;
-
- if (_res.options & RES_DEBUG) {
- fprintf(file, "res_send: %s ([%s].%u): %s\n",
- string,
- inet_ntoa(address.sin_addr),
- ntohs(address.sin_port),
- strerror(error));
- }
- errno = save;
- }
- static void
- Perror(file, string, error)
- FILE *file;
- char *string;
- int error;
- {
- int save = errno;
-
- if (_res.options & RES_DEBUG) {
- fprintf(file, "res_send: %s: %s\n",
- string, strerror(error));
- }
- errno = save;
- }
-#endif
-
-void
-res_send_setqhook(hook)
- res_send_qhook hook;
-{
-
- Qhook = hook;
-}
-
-void
-res_send_setrhook(hook)
- res_send_rhook hook;
-{
-
- Rhook = hook;
-}
-
-/* int
- * res_isourserver(ina)
- * looks up "ina" in _res.ns_addr_list[]
- * returns:
- * 0 : not found
- * >0 : found
- * author:
- * paul vixie, 29may94
- */
-int
-res_isourserver(inp)
- const struct sockaddr_in *inp;
-{
- struct sockaddr_in ina;
- int ns, ret;
-
- ina = *inp;
- ret = 0;
- for (ns = 0; ns < _res.nscount; ns++) {
- const struct sockaddr_in *srv = &_res.nsaddr_list[ns];
-
- if (srv->sin_family == ina.sin_family &&
- srv->sin_port == ina.sin_port &&
- (srv->sin_addr.s_addr == INADDR_ANY ||
- srv->sin_addr.s_addr == ina.sin_addr.s_addr)) {
- ret++;
- break;
- }
- }
- return (ret);
-}
-
-/* int
- * res_nameinquery(name, type, class, buf, eom)
- * look for (name,type,class) in the query section of packet (buf,eom)
- * requires:
- * buf + HFIXEDSZ <= eom
- * returns:
- * -1 : format error
- * 0 : not found
- * >0 : found
- * author:
- * paul vixie, 29may94
- */
-int
-res_nameinquery(name, type, class, buf, eom)
- const char *name;
- int type, class;
- const u_char *buf, *eom;
-{
- const u_char *cp = buf + HFIXEDSZ;
- int qdcount = ntohs(((HEADER*)buf)->qdcount);
-
- while (qdcount-- > 0) {
- char tname[MAXDNAME+1];
- int n, ttype, tclass;
-
- n = dn_expand(buf, eom, cp, tname, sizeof tname);
- if (n < 0)
- return (-1);
- cp += n;
- if (cp + 2 * INT16SZ > eom)
- return (-1);
- ttype = ns_get16(cp); cp += INT16SZ;
- tclass = ns_get16(cp); cp += INT16SZ;
- if (ttype == type &&
- tclass == class &&
- strcasecmp(tname, name) == 0)
- return (1);
- }
- return (0);
-}
-
-/* int
- * res_queriesmatch(buf1, eom1, buf2, eom2)
- * is there a 1:1 mapping of (name,type,class)
- * in (buf1,eom1) and (buf2,eom2)?
- * returns:
- * -1 : format error
- * 0 : not a 1:1 mapping
- * >0 : is a 1:1 mapping
- * author:
- * paul vixie, 29may94
- */
-int
-res_queriesmatch(buf1, eom1, buf2, eom2)
- const u_char *buf1, *eom1;
- const u_char *buf2, *eom2;
-{
- const u_char *cp = buf1 + HFIXEDSZ;
- int qdcount = ntohs(((HEADER*)buf1)->qdcount);
-
- if (buf1 + HFIXEDSZ > eom1 || buf2 + HFIXEDSZ > eom2)
- return (-1);
-
- /*
- * Only header section present in replies to
- * dynamic update packets.
- */
- if ( (((HEADER *)buf1)->opcode == ns_o_update) &&
- (((HEADER *)buf2)->opcode == ns_o_update) )
- return (1);
-
- if (qdcount != ntohs(((HEADER*)buf2)->qdcount))
- return (0);
- while (qdcount-- > 0) {
- char tname[MAXDNAME+1];
- int n, ttype, tclass;
-
- n = dn_expand(buf1, eom1, cp, tname, sizeof tname);
- if (n < 0)
- return (-1);
- cp += n;
- if (cp + 2 * INT16SZ > eom1)
- return (-1);
- ttype = ns_get16(cp); cp += INT16SZ;
- tclass = ns_get16(cp); cp += INT16SZ;
- if (!res_nameinquery(tname, ttype, tclass, buf2, eom2))
- return (0);
- }
- return (1);
-}
-
-int
-res_send(buf, buflen, ans, anssiz)
- const u_char *buf;
- int buflen;
- u_char *ans;
- int anssiz;
-{
- HEADER *hp = (HEADER *) buf;
- HEADER *anhp = (HEADER *) ans;
- int gotsomewhere, connreset, terrno, try, v_circuit, resplen, ns, n;
- u_int badns; /* XXX NSMAX can't exceed #/bits in this variable */
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- /* errno should have been set by res_init() in this case. */
- return (-1);
- }
- if (anssiz < HFIXEDSZ) {
- errno = EINVAL;
- return (-1);
- }
- DprintQ((_res.options & RES_DEBUG) || (_res.pfcode & RES_PRF_QUERY),
- (stdout, ";; res_send()\n"), buf, buflen);
- v_circuit = (_res.options & RES_USEVC) || buflen > PACKETSZ;
- gotsomewhere = 0;
- connreset = 0;
- terrno = ETIMEDOUT;
- badns = 0;
-
- /*
- * Send request, RETRY times, or until successful
- */
- for (try = 0; try < _res.retry; try++) {
- for (ns = 0; ns < _res.nscount; ns++) {
- struct sockaddr_in *nsap = &_res.nsaddr_list[ns];
- same_ns:
- if (badns & (1 << ns)) {
- res_close();
- goto next_ns;
- }
-
- if (Qhook) {
- int done = 0, loops = 0;
-
- do {
- res_sendhookact act;
-
- act = (*Qhook)(&nsap, &buf, &buflen,
- ans, anssiz, &resplen);
- switch (act) {
- case res_goahead:
- done = 1;
- break;
- case res_nextns:
- res_close();
- goto next_ns;
- case res_done:
- return (resplen);
- case res_modified:
- /* give the hook another try */
- if (++loops < 42) /*doug adams*/
- break;
- /*FALLTHROUGH*/
- case res_error:
- /*FALLTHROUGH*/
- default:
- return (-1);
- }
- } while (!done);
- }
-
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; Querying server (# %d) address = %s\n",
- ns + 1, inet_ntoa(nsap->sin_addr)));
-
- if (v_circuit) {
- int truncated;
-#if !defined(__rtems__)
- struct iovec iov[2];
-#endif
- u_short len;
- u_char *cp;
-
- /*
- * Use virtual circuit;
- * at most one attempt per server.
- */
- try = _res.retry;
- truncated = 0;
- if (s < 0 || !vc || hp->opcode == ns_o_update) {
- if (s >= 0)
- res_close();
-
- s = socket(PF_INET, SOCK_STREAM, 0);
- if (s < 0) {
- terrno = errno;
- Perror(stderr, "socket(vc)", errno);
- return (-1);
- }
- errno = 0;
- if (connect(s, (struct sockaddr *)nsap,
- sizeof *nsap) < 0) {
- terrno = errno;
- Aerror(stderr, "connect/vc",
- errno, *nsap);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- vc = 1;
- }
- /*
- * Send length & message
- */
- putshort((u_short)buflen, (u_char*)&len);
-#if !defined(__rtems__)
- iov[0].iov_base = (caddr_t)&len;
- iov[0].iov_len = INT16SZ;
- iov[1].iov_base = (caddr_t)buf;
- iov[1].iov_len = buflen;
- if (writev(s, iov, 2) != (INT16SZ + buflen)) {
-#else
- /*
- * RTEMS doesn't have writev (yet)
- */
- if ((write (s, &len, INT16SZ) != INT16SZ)
- || (write (s, buf, buflen) != buflen)) {
-#endif
- terrno = errno;
- Perror(stderr, "write failed", errno);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- /*
- * Receive length & response
- */
-read_len:
- cp = ans;
- len = INT16SZ;
- while ((n = read(s, (char *)cp, (int)len)) > 0) {
- cp += n;
- if ((len -= n) <= 0)
- break;
- }
- if (n <= 0) {
- terrno = errno;
- Perror(stderr, "read failed", errno);
- res_close();
- /*
- * A long running process might get its TCP
- * connection reset if the remote server was
- * restarted. Requery the server instead of
- * trying a new one. When there is only one
- * server, this means that a query might work
- * instead of failing. We only allow one reset
- * per query to prevent looping.
- */
- if (terrno == ECONNRESET && !connreset) {
- connreset = 1;
- res_close();
- goto same_ns;
- }
- res_close();
- goto next_ns;
- }
- resplen = ns_get16(ans);
- if (resplen > anssiz) {
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; response truncated\n")
- );
- truncated = 1;
- len = anssiz;
- } else
- len = resplen;
- if (len < HFIXEDSZ) {
- /*
- * Undersized message.
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; undersized: %d\n", len));
- terrno = EMSGSIZE;
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- cp = ans;
- while (len != 0 &&
- (n = read(s, (char *)cp, (int)len)) > 0) {
- cp += n;
- len -= n;
- }
- if (n <= 0) {
- terrno = errno;
- Perror(stderr, "read(vc)", errno);
- res_close();
- goto next_ns;
- }
- if (truncated) {
- /*
- * Flush rest of answer
- * so connection stays in synch.
- */
- anhp->tc = 1;
- len = resplen - anssiz;
- while (len != 0) {
- char junk[PACKETSZ];
-
- n = (len > sizeof(junk)
- ? sizeof(junk)
- : len);
- if ((n = read(s, junk, n)) > 0)
- len -= n;
- else
- break;
- }
- }
- /*
- * The calling applicating has bailed out of
- * a previous call and failed to arrange to have
- * the circuit closed or the server has got
- * itself confused. Anyway drop the packet and
- * wait for the correct one.
- */
- if (hp->id != anhp->id) {
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; old answer (unexpected):\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto read_len;
- }
- } else {
- /*
- * Use datagrams.
- */
-#ifndef NOPOLL
- struct pollfd pfd;
- int msec;
-#endif
- struct timeval timeout;
-#ifndef NOSELECT
- fd_set dsmask, *dsmaskp;
- int dsmasklen;
-#endif
- struct sockaddr_in from;
- int fromlen;
-
- if ((s < 0) || vc) {
- if (vc)
- res_close();
- s = socket(PF_INET, SOCK_DGRAM, 0);
- if (s < 0) {
-#ifndef CAN_RECONNECT
- bad_dg_sock:
-#endif
- terrno = errno;
- Perror(stderr, "socket(dg)", errno);
- return (-1);
- }
- connected = 0;
- }
-#ifndef CANNOT_CONNECT_DGRAM
- /*
- * On a 4.3BSD+ machine (client and server,
- * actually), sending to a nameserver datagram
- * port with no nameserver will cause an
- * ICMP port unreachable message to be returned.
- * If our datagram socket is "connected" to the
- * server, we get an ECONNREFUSED error on the next
- * socket operation, and select returns if the
- * error message is received. We can thus detect
- * the absence of a nameserver without timing out.
- * If we have sent queries to at least two servers,
- * however, we don't want to remain connected,
- * as we wish to receive answers from the first
- * server to respond.
- */
- if (_res.nscount == 1 || (try == 0 && ns == 0)) {
- /*
- * Connect only if we are sure we won't
- * receive a response from another server.
- */
- if (!connected) {
- if (connect(s, (struct sockaddr *)nsap,
- sizeof *nsap
- ) < 0) {
- Aerror(stderr,
- "connect(dg)",
- errno, *nsap);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- connected = 1;
- }
- if (send(s, (char*)buf, buflen, 0) != buflen) {
- Perror(stderr, "send", errno);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- } else {
- /*
- * Disconnect if we want to listen
- * for responses from more than one server.
- */
- if (connected) {
-#ifdef CAN_RECONNECT
- struct sockaddr_in no_addr;
-
- no_addr.sin_family = AF_INET;
- no_addr.sin_addr.s_addr = INADDR_ANY;
- no_addr.sin_port = 0;
- (void) connect(s,
- (struct sockaddr *)
- &no_addr,
- sizeof no_addr);
-#else
- int s1 = socket(PF_INET, SOCK_DGRAM,0);
- if (s1 < 0)
- goto bad_dg_sock;
- (void) dup2(s1, s);
- (void) close(s1);
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; new DG socket\n"))
-#endif /* CAN_RECONNECT */
- connected = 0;
- errno = 0;
- }
-#endif /* !CANNOT_CONNECT_DGRAM */
- if (sendto(s, (char*)buf, buflen, 0,
- (struct sockaddr *)nsap,
- sizeof *nsap)
- != buflen) {
- Aerror(stderr, "sendto", errno, *nsap);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
-#ifndef CANNOT_CONNECT_DGRAM
- }
-#endif /* !CANNOT_CONNECT_DGRAM */
-
- /*
- * Wait for reply
- */
-#ifndef NOPOLL
- othersyscall:
- if (use_poll) {
- msec = (_res.retrans << try) * 1000;
- if (try > 0)
- msec /= _res.nscount;
- if (msec <= 0)
- msec = 1000;
- } else {
-#endif
- timeout.tv_sec = (_res.retrans << try);
- if (try > 0)
- timeout.tv_sec /= _res.nscount;
- if ((long) timeout.tv_sec <= 0)
- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
-#ifndef NOPOLL
- }
-#endif
- wait:
- if (s < 0) {
- Perror(stderr, "s out-of-bounds", EMFILE);
- res_close();
- goto next_ns;
- }
-#ifndef NOPOLL
- if (use_poll) {
- struct sigaction sa, osa;
- int sigsys_installed = 0;
-
- pfd.fd = s;
- pfd.events = POLLIN;
- if (use_poll == 1) {
- bzero(&sa, sizeof(sa));
- sa.sa_handler = SIG_IGN;
- if (sigaction(SIGSYS, &sa, &osa) >= 0)
- sigsys_installed = 1;
- }
- n = poll(&pfd, 1, msec);
- if (sigsys_installed == 1) {
- int oerrno = errno;
- sigaction(SIGSYS, &osa, NULL);
- errno = oerrno;
- }
- /* XXX why does nosys() return EINVAL? */
- if (n < 0 && (errno == ENOSYS ||
- errno == EINVAL)) {
- use_poll = 0;
- goto othersyscall;
- } else if (use_poll == 1)
- use_poll = 2;
- if (n < 0) {
- if (errno == EINTR)
- goto wait;
- Perror(stderr, "poll", errno);
- res_close();
- goto next_ns;
- }
- } else {
-#endif
-#ifndef NOSELECT
- dsmasklen = howmany(s + 1, NFDBITS) *
- sizeof(fd_mask);
- if (dsmasklen > sizeof(fd_set)) {
- dsmaskp = (fd_set *)malloc(dsmasklen);
- if (dsmaskp == NULL) {
- res_close();
- goto next_ns;
- }
- } else
- dsmaskp = &dsmask;
- /* only zero what we need */
- bzero((char *)dsmaskp, dsmasklen);
- FD_SET(s, dsmaskp);
- n = select(s + 1, dsmaskp, (fd_set *)NULL,
- (fd_set *)NULL, &timeout);
- if (dsmaskp != &dsmask)
- free(dsmaskp);
- if (n < 0) {
- if (errno == EINTR)
- goto wait;
- Perror(stderr, "select", errno);
- res_close();
- goto next_ns;
- }
-#endif
-#ifndef NOPOLL
- }
-#endif
-
-#ifdef NOSELECT
- setsockopt (s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof timeout);
-#else
- if (n == 0) {
- /*
- * timeout
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; timeout\n"));
- gotsomewhere = 1;
- res_close();
- goto next_ns;
- }
-#endif
- errno = 0;
- fromlen = sizeof(struct sockaddr_in);
- resplen = recvfrom(s, (char*)ans, anssiz, 0,
- (struct sockaddr *)&from, &fromlen);
- if (resplen <= 0) {
-#ifdef NOSELECT
- if (errno == ETIMEDOUT) {
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; timeout\n"));
- gotsomewhere = 1;
- res_close();
- goto next_ns;
- }
-#endif
- Perror(stderr, "recvfrom", errno);
- res_close();
- goto next_ns;
- }
- gotsomewhere = 1;
- if (resplen < HFIXEDSZ) {
- /*
- * Undersized message.
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; undersized: %d\n",
- resplen));
- terrno = EMSGSIZE;
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- if (hp->id != anhp->id) {
- /*
- * response from old query, ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; old answer:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto wait;
- }
-#ifdef CHECK_SRVR_ADDR
- if (!(_res.options & RES_INSECURE1) &&
- !res_isourserver(&from)) {
- /*
- * response from wrong server? ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; not our server:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto wait;
- }
-#endif
- if (!(_res.options & RES_INSECURE2) &&
- !res_queriesmatch(buf, buf + buflen,
- ans, ans + anssiz)) {
- /*
- * response contains wrong query? ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; wrong query name:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto wait;
- }
- if (anhp->rcode == SERVFAIL ||
- anhp->rcode == NOTIMP ||
- anhp->rcode == REFUSED) {
- DprintQ(_res.options & RES_DEBUG,
- (stdout, "server rejected query:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- badns |= (1 << ns);
- res_close();
- /* don't retry if called from dig */
- if (!_res.pfcode)
- goto next_ns;
- }
- if (!(_res.options & RES_IGNTC) && anhp->tc) {
- /*
- * get rest of answer;
- * use TCP with same server.
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; truncated answer\n"));
- v_circuit = 1;
- res_close();
- goto same_ns;
- }
- } /*if vc/dg*/
- Dprint((_res.options & RES_DEBUG) ||
- ((_res.pfcode & RES_PRF_REPLY) &&
- (_res.pfcode & RES_PRF_HEAD1)),
- (stdout, ";; got answer:\n"));
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, "%s", ""),
- ans, (resplen>anssiz)?anssiz:resplen);
- /*
- * If using virtual circuits, we assume that the first server
- * is preferred over the rest (i.e. it is on the local
- * machine) and only keep that one open.
- * If we have temporarily opened a virtual circuit,
- * or if we haven't been asked to keep a socket open,
- * close the socket.
- */
- if ((v_circuit && (!(_res.options & RES_USEVC) || ns != 0)) ||
- !(_res.options & RES_STAYOPEN)) {
- res_close();
- }
- if (Rhook) {
- int done = 0, loops = 0;
-
- do {
- res_sendhookact act;
-
- act = (*Rhook)(nsap, buf, buflen,
- ans, anssiz, &resplen);
- switch (act) {
- case res_goahead:
- case res_done:
- done = 1;
- break;
- case res_nextns:
- res_close();
- goto next_ns;
- case res_modified:
- /* give the hook another try */
- if (++loops < 42) /*doug adams*/
- break;
- /*FALLTHROUGH*/
- case res_error:
- /*FALLTHROUGH*/
- default:
- return (-1);
- }
- } while (!done);
-
- }
- return (resplen);
- next_ns: ;
- } /*foreach ns*/
- } /*foreach retry*/
- res_close();
- if (!v_circuit) {
- if (!gotsomewhere)
- errno = ECONNREFUSED; /* no nameservers found */
- else
- errno = ETIMEDOUT; /* no answer obtained */
- } else
- errno = terrno;
- return (-1);
-}
-
-/*
- * This routine is for closing the socket if a virtual circuit is used and
- * the program wants to close it. This provides support for endhostent()
- * which expects to close the socket.
- *
- * This routine is not expected to be user visible.
- */
-void
-res_close()
-{
- if (s >= 0) {
- (void) close(s);
- s = -1;
- connected = 0;
- vc = 0;
- }
-}
diff --git a/c/src/lib/libnetworking/libc/res_stubs.c b/c/src/lib/libnetworking/libc/res_stubs.c
deleted file mode 100644
index 92cf0fac54..0000000000
--- a/c/src/lib/libnetworking/libc/res_stubs.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 1996 Peter Wemm <peter@freebsd.org>.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- * $Id$
- */
-
-/*
- * This file is for FreeBSD-3.0 that has a bind-4.9.5-P1 derived
- * resolver in the libc. It provides aliases for functions that
- * have moved since 4.9.4-P1.
- *
- * I'll save everybody the trouble and say it now: *THIS IS A HACK*!
- *
- * Yes, many of these are private functions to the resolver, but some are
- * needed as there is no other way to provide the functionality and they've
- * turned up all over the place. :-(
- */
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-__weak_reference(__inet_addr, inet_addr);
-__weak_reference(__inet_aton, inet_aton);
-__weak_reference(__inet_lnaof, inet_lnaof);
-__weak_reference(__inet_makeaddr, inet_makeaddr);
-__weak_reference(__inet_neta, inet_neta);
-__weak_reference(__inet_netof, inet_netof);
-__weak_reference(__inet_network, inet_network);
-__weak_reference(__inet_net_ntop, inet_net_ntop);
-__weak_reference(__inet_net_pton, inet_net_pton);
-__weak_reference(__inet_ntoa, inet_ntoa);
-__weak_reference(__inet_pton, inet_pton);
-__weak_reference(__inet_ntop, inet_ntop);
-__weak_reference(__inet_nsap_addr, inet_nsap_addr);
-__weak_reference(__inet_nsap_ntoa, inet_nsap_ntoa);
-
-__weak_reference(__sym_ston, sym_ston);
-__weak_reference(__sym_ntos, sym_ntos);
-__weak_reference(__sym_ntop, sym_ntop);
-__weak_reference(__fp_resstat, fp_resstat);
-__weak_reference(__p_query, p_query);
-__weak_reference(__p_fqnname, p_fqnname);
-__weak_reference(__p_secstodate, p_secstodate);
-__weak_reference(__dn_count_labels, dn_count_labels);
-__weak_reference(__dn_comp, dn_comp);
-__weak_reference(__res_close, _res_close);
-__weak_reference(__dn_expand, dn_expand);
-__weak_reference(__res_init, res_init);
-__weak_reference(__res_query, res_query);
-__weak_reference(__res_search, res_search);
-__weak_reference(__res_querydomain, res_querydomain);
-__weak_reference(__res_mkquery, res_mkquery);
-__weak_reference(__res_send, res_send);
diff --git a/c/src/lib/libnetworking/libc/res_update.c b/c/src/lib/libnetworking/libc/res_update.c
deleted file mode 100644
index ef591e0674..0000000000
--- a/c/src/lib/libnetworking/libc/res_update.c
+++ /dev/null
@@ -1,518 +0,0 @@
-#if !defined(__rtems__)
-#if !defined(lint) && !defined(SABER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Based on the Dynamic DNS reference implementation by Viraj Bais
- * <viraj_bais@ccm.fm.intel.com>
- */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <errno.h>
-#include <limits.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/*
- * Separate a linked list of records into groups so that all records
- * in a group will belong to a single zone on the nameserver.
- * Create a dynamic update packet for each zone and send it to the
- * nameservers for that zone, and await answer.
- * Abort if error occurs in updating any zone.
- * Return the number of zones updated on success, < 0 on error.
- *
- * On error, caller must deal with the unsynchronized zones
- * eg. an A record might have been successfully added to the forward
- * zone but the corresponding PTR record would be missing if error
- * was encountered while updating the reverse zone.
- */
-
-#define NSMAX 16
-
-struct ns1 {
- char nsname[MAXDNAME];
- struct in_addr nsaddr1;
-};
-
-struct zonegrp {
- char z_origin[MAXDNAME];
- int16_t z_class;
- char z_soardata[MAXDNAME + 5 * INT32SZ];
- struct ns1 z_ns[NSMAX];
- int z_nscount;
- ns_updrec * z_rr;
- struct zonegrp *z_next;
-};
-
-
-int
-res_update(ns_updrec *rrecp_in) {
- ns_updrec *rrecp, *tmprrecp;
- u_char buf[PACKETSZ], answer[PACKETSZ], packet[2*PACKETSZ];
- char name[MAXDNAME], zname[MAXDNAME], primary[MAXDNAME],
- mailaddr[MAXDNAME];
- u_char soardata[2*MAXCDNAME+5*INT32SZ];
- char *dname, *svdname, *cp1, *target;
- u_char *cp, *eom;
- HEADER *hp = (HEADER *) answer;
- struct zonegrp *zptr = NULL, *tmpzptr, *prevzptr, *zgrp_start = NULL;
- int i, j, k = 0, n, ancount, nscount, arcount, rcode, rdatasize,
- newgroup, done, myzone, seen_before, numzones = 0;
- u_int16_t dlen, class, qclass, type, qtype;
- u_int32_t ttl;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-
- for (rrecp = rrecp_in; rrecp; rrecp = rrecp->r_next) {
- dname = rrecp->r_dname;
- n = strlen(dname);
- if (dname[n-1] == '.')
- dname[n-1] = '\0';
- qtype = T_SOA;
- qclass = rrecp->r_class;
- done = 0;
- seen_before = 0;
-
- while (!done && dname) {
- if (qtype == T_SOA) {
- for (tmpzptr = zgrp_start;
- tmpzptr && !seen_before;
- tmpzptr = tmpzptr->z_next) {
- if (strcasecmp(dname,
- tmpzptr->z_origin) == 0 &&
- tmpzptr->z_class == qclass)
- seen_before++;
- for (tmprrecp = tmpzptr->z_rr;
- tmprrecp && !seen_before;
- tmprrecp = tmprrecp->r_grpnext)
- if (strcasecmp(dname, tmprrecp->r_dname) == 0
- && tmprrecp->r_class == qclass) {
- seen_before++;
- break;
- }
- if (seen_before) {
- /*
- * Append to the end of
- * current group.
- */
- for (tmprrecp = tmpzptr->z_rr;
- tmprrecp->r_grpnext;
- tmprrecp = tmprrecp->r_grpnext)
- (void)NULL;
- tmprrecp->r_grpnext = rrecp;
- rrecp->r_grpnext = NULL;
- done = 1;
- break;
- }
- }
- } else if (qtype == T_A) {
- for (tmpzptr = zgrp_start;
- tmpzptr && !done;
- tmpzptr = tmpzptr->z_next)
- for (i = 0; i < tmpzptr->z_nscount; i++)
- if (tmpzptr->z_class == qclass &&
- strcasecmp(tmpzptr->z_ns[i].nsname,
- dname) == 0 &&
- tmpzptr->z_ns[i].nsaddr1.s_addr != 0) {
- zptr->z_ns[k].nsaddr1.s_addr =
- tmpzptr->z_ns[i].nsaddr1.s_addr;
- done = 1;
- break;
- }
- }
- if (done)
- break;
- n = res_mkquery(QUERY, dname, qclass, qtype, NULL,
- 0, NULL, buf, sizeof buf);
- if (n <= 0) {
- fprintf(stderr, "res_update: mkquery failed\n");
- return (n);
- }
- n = res_send(buf, n, answer, sizeof answer);
- if (n < 0) {
- fprintf(stderr, "res_update: send error for %s\n",
- rrecp->r_dname);
- return (n);
- }
- if (n < HFIXEDSZ)
- return (-1);
- ancount = ntohs(hp->ancount);
- nscount = ntohs(hp->nscount);
- arcount = ntohs(hp->arcount);
- rcode = hp->rcode;
- cp = answer + HFIXEDSZ;
- eom = answer + n;
- /* skip the question section */
- n = dn_skipname(cp, eom);
- if (n < 0 || cp + n + 2 * INT16SZ > eom)
- return (-1);
- cp += n + 2 * INT16SZ;
-
- if (qtype == T_SOA) {
- if (ancount == 0 && nscount == 0 && arcount == 0) {
- /*
- * if (rcode == NOERROR) then the dname exists but
- * has no soa record associated with it.
- * if (rcode == NXDOMAIN) then the dname does not
- * exist and the server is replying out of NCACHE.
- * in either case, proceed with the next try
- */
- dname = strchr(dname, '.');
- if (dname != NULL)
- dname++;
- continue;
- } else if ((rcode == NOERROR || rcode == NXDOMAIN) &&
- ancount == 0 &&
- nscount == 1 && arcount == 0) {
- /*
- * name/data does not exist, soa record supplied in the
- * authority section
- */
- /* authority section must contain the soa record */
- if ((n = dn_expand(answer, eom, cp, zname,
- sizeof zname)) < 0)
- return (n);
- cp += n;
- if (cp + 2 * INT16SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- if (type != T_SOA || class != qclass) {
- fprintf(stderr, "unknown answer\n");
- return (-1);
- }
- myzone = 0;
- svdname = dname;
- while (dname)
- if (strcasecmp(dname, zname) == 0) {
- myzone = 1;
- break;
- } else if ((dname = strchr(dname, '.')) != NULL)
- dname++;
- if (!myzone) {
- dname = strchr(svdname, '.');
- if (dname != NULL)
- dname++;
- continue;
- }
- nscount = 0;
- /* fallthrough */
- } else if (rcode == NOERROR && ancount == 1) {
- /*
- * found the zone name
- * new servers will supply NS records for the zone
- * in authority section and A records for those
- * nameservers in the additional section
- * older servers have to be explicitly queried for
- * NS records for the zone
- */
- /* answer section must contain the soa record */
- if ((n = dn_expand(answer, eom, cp, zname,
- sizeof zname)) < 0)
- return (n);
- else
- cp += n;
- if (cp + 2 * INT16SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- if (type == T_CNAME) {
- dname = strchr(dname, '.');
- if (dname != NULL)
- dname++;
- continue;
- }
- if (strcasecmp(dname, zname) != 0 ||
- type != T_SOA ||
- class != rrecp->r_class) {
- fprintf(stderr, "unknown answer\n");
- return (-1);
- }
- /* FALLTHROUGH */
- } else {
- fprintf(stderr,
- "unknown response: ans=%d, auth=%d, add=%d, rcode=%d\n",
- ancount, nscount, arcount, hp->rcode);
- return (-1);
- }
- if (cp + INT32SZ + INT16SZ > eom)
- return (-1);
- /* continue processing the soa record */
- GETLONG(ttl, cp);
- GETSHORT(dlen, cp);
- if (cp + dlen > eom)
- return (-1);
- newgroup = 1;
- zptr = zgrp_start;
- prevzptr = NULL;
- while (zptr) {
- if (strcasecmp(zname, zptr->z_origin) == 0 &&
- type == T_SOA && class == qclass) {
- newgroup = 0;
- break;
- }
- prevzptr = zptr;
- zptr = zptr->z_next;
- }
- if (!newgroup) {
- for (tmprrecp = zptr->z_rr;
- tmprrecp->r_grpnext;
- tmprrecp = tmprrecp->r_grpnext)
- ;
- tmprrecp->r_grpnext = rrecp;
- rrecp->r_grpnext = NULL;
- done = 1;
- cp += dlen;
- break;
- } else {
- if ((n = dn_expand(answer, eom, cp, primary,
- sizeof primary)) < 0)
- return (n);
- cp += n;
- /*
- * We don't have to bounds check here because the
- * next use of 'cp' is in dn_expand().
- */
- cp1 = (char *)soardata;
- strcpy(cp1, primary);
- cp1 += strlen(cp1) + 1;
- if ((n = dn_expand(answer, eom, cp, mailaddr,
- sizeof mailaddr)) < 0)
- return (n);
- cp += n;
- strcpy(cp1, mailaddr);
- cp1 += strlen(cp1) + 1;
- if (cp + 5*INT32SZ > eom)
- return (-1);
- memcpy(cp1, cp, 5*INT32SZ);
- cp += 5*INT32SZ;
- cp1 += 5*INT32SZ;
- rdatasize = (u_char *)cp1 - soardata;
- zptr = calloc(1, sizeof(struct zonegrp));
- if (zptr == NULL)
- return (-1);
- if (zgrp_start == NULL)
- zgrp_start = zptr;
- else
- prevzptr->z_next = zptr;
- zptr->z_rr = rrecp;
- rrecp->r_grpnext = NULL;
- strcpy(zptr->z_origin, zname);
- zptr->z_class = class;
- memcpy(zptr->z_soardata, soardata, rdatasize);
- /* fallthrough to process NS and A records */
- }
- } else if (qtype == T_NS) {
- if (rcode == NOERROR && ancount > 0) {
- strcpy(zname, dname);
- for (zptr = zgrp_start; zptr; zptr = zptr->z_next) {
- if (strcasecmp(zname, zptr->z_origin) == 0)
- break;
- }
- if (zptr == NULL)
- /* should not happen */
- return (-1);
- if (nscount > 0) {
- /*
- * answer and authority sections contain
- * the same information, skip answer section
- */
- for (j = 0; j < ancount; j++) {
- n = dn_skipname(cp, eom);
- if (n < 0)
- return (-1);
- n += 2*INT16SZ + INT32SZ;
- if (cp + n + INT16SZ > eom)
- return (-1);
- cp += n;
- GETSHORT(dlen, cp);
- cp += dlen;
- }
- } else
- nscount = ancount;
- /* fallthrough to process NS and A records */
- } else {
- fprintf(stderr, "cannot determine nameservers for %s:\
-ans=%d, auth=%d, add=%d, rcode=%d\n",
- dname, ancount, nscount, arcount, hp->rcode);
- return (-1);
- }
- } else if (qtype == T_A) {
- if (rcode == NOERROR && ancount > 0) {
- arcount = ancount;
- ancount = nscount = 0;
- /* fallthrough to process A records */
- } else {
- fprintf(stderr, "cannot determine address for %s:\
-ans=%d, auth=%d, add=%d, rcode=%d\n",
- dname, ancount, nscount, arcount, hp->rcode);
- return (-1);
- }
- }
- /* process NS records for the zone */
- j = 0;
- for (i = 0; i < nscount; i++) {
- if ((n = dn_expand(answer, eom, cp, name,
- sizeof name)) < 0)
- return (n);
- cp += n;
- if (cp + 3 * INT16SZ + INT32SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- GETLONG(ttl, cp);
- GETSHORT(dlen, cp);
- if (cp + dlen > eom)
- return (-1);
- if (strcasecmp(name, zname) == 0 &&
- type == T_NS && class == qclass) {
- if ((n = dn_expand(answer, eom, cp,
- name, sizeof name)) < 0)
- return (n);
- target = zptr->z_ns[j++].nsname;
- strcpy(target, name);
- }
- cp += dlen;
- }
- if (zptr->z_nscount == 0)
- zptr->z_nscount = j;
- /* get addresses for the nameservers */
- for (i = 0; i < arcount; i++) {
- if ((n = dn_expand(answer, eom, cp, name,
- sizeof name)) < 0)
- return (n);
- cp += n;
- if (cp + 3 * INT16SZ + INT32SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- GETLONG(ttl, cp);
- GETSHORT(dlen, cp);
- if (cp + dlen > eom)
- return (-1);
- if (type == T_A && dlen == INT32SZ && class == qclass) {
- for (j = 0; j < zptr->z_nscount; j++)
- if (strcasecmp(name, zptr->z_ns[j].nsname) == 0) {
- memcpy(&zptr->z_ns[j].nsaddr1.s_addr, cp,
- INT32SZ);
- break;
- }
- }
- cp += dlen;
- }
- if (zptr->z_nscount == 0) {
- dname = zname;
- qtype = T_NS;
- continue;
- }
- done = 1;
- for (k = 0; k < zptr->z_nscount; k++)
- if (zptr->z_ns[k].nsaddr1.s_addr == 0) {
- done = 0;
- dname = zptr->z_ns[k].nsname;
- qtype = T_A;
- }
-
- } /* while */
- }
-
- _res.options |= RES_DEBUG;
- for (zptr = zgrp_start; zptr; zptr = zptr->z_next) {
-
- /* append zone section */
- rrecp = res_mkupdrec(ns_s_zn, zptr->z_origin,
- zptr->z_class, ns_t_soa, 0);
- if (rrecp == NULL) {
- fprintf(stderr, "saverrec error\n");
- fflush(stderr);
- return (-1);
- }
- rrecp->r_grpnext = zptr->z_rr;
- zptr->z_rr = rrecp;
-
- n = res_mkupdate(zptr->z_rr, packet, sizeof packet);
- if (n < 0) {
- fprintf(stderr, "res_mkupdate error\n");
- fflush(stderr);
- return (-1);
- } else
- fprintf(stdout, "res_mkupdate: packet size = %d\n", n);
-
- /*
- * Override the list of NS records from res_init() with
- * the authoritative nameservers for the zone being updated.
- * Sort primary to be the first in the list of nameservers.
- */
- for (i = 0; i < zptr->z_nscount; i++) {
- if (strcasecmp(zptr->z_ns[i].nsname,
- zptr->z_soardata) == 0) {
- struct in_addr tmpaddr;
-
- if (i != 0) {
- strcpy(zptr->z_ns[i].nsname,
- zptr->z_ns[0].nsname);
- strcpy(zptr->z_ns[0].nsname,
- zptr->z_soardata);
- tmpaddr = zptr->z_ns[i].nsaddr1;
- zptr->z_ns[i].nsaddr1 =
- zptr->z_ns[0].nsaddr1;
- zptr->z_ns[0].nsaddr1 = tmpaddr;
- }
- break;
- }
- }
- for (i = 0; i < MAXNS; i++) {
- _res.nsaddr_list[i].sin_addr = zptr->z_ns[i].nsaddr1;
- _res.nsaddr_list[i].sin_family = AF_INET;
- _res.nsaddr_list[i].sin_port = htons(NAMESERVER_PORT);
- }
- _res.nscount = (zptr->z_nscount < MAXNS) ?
- zptr->z_nscount : MAXNS;
- n = res_send(packet, n, answer, sizeof(answer));
- if (n < 0) {
- fprintf(stderr, "res_send: send error, n=%d\n", n);
- break;
- } else
- numzones++;
- }
-
- /* free malloc'ed memory */
- while(zgrp_start) {
- zptr = zgrp_start;
- zgrp_start = zgrp_start->z_next;
- res_freeupdrec(zptr->z_rr); /* Zone section we allocated. */
- free((char *)zptr);
- }
-
- return (numzones);
-}
diff --git a/c/src/lib/libnetworking/libc/resolver.3 b/c/src/lib/libnetworking/libc/resolver.3
deleted file mode 100644
index 8c6f18334f..0000000000
--- a/c/src/lib/libnetworking/libc/resolver.3
+++ /dev/null
@@ -1,352 +0,0 @@
-.\" Copyright (c) 1985, 1991, 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.
-.\"
-.\" @(#)resolver.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt RESOLVER 3
-.Os BSD 4.3
-.Sh NAME
-.Nm res_query ,
-.Nm res_search ,
-.Nm res_mkquery ,
-.Nm res_send ,
-.Nm res_init ,
-.Nm dn_comp ,
-.Nm dn_expand
-.Nd resolver routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netinet/in.h>
-.Fd #include <arpa/nameser.h>
-.Fd #include <resolv.h>
-.Ft int
-.Fo res_query
-.Fa "const char *dname"
-.Fa "int class"
-.Fa "int type"
-.Fa "u_char *answer"
-.Fa "int anslen"
-.Fc
-.Ft int
-.Fo res_search
-.Fa "const char *dname"
-.Fa "int class"
-.Fa "int type"
-.Fa "u_char *answer"
-.Fa "int anslen"
-.Fc
-.Ft int
-.Fo res_mkquery
-.Fa "int op"
-.Fa "const char *dname"
-.Fa "int class"
-.Fa "int type"
-.Fa "const u_char *data"
-.Fa "int datalen"
-.Fa "const u_char *newrr_in"
-.Fa "u_char *buf"
-.Fa "int buflen"
-.Fc
-.Ft int
-.Fo res_send
-.Fa "const u_char *msg"
-.Fa "int msglen"
-.Fa "u_char *answer"
-.Fa "int anslen"
-.Fc
-.Ft int
-.Fn res_init
-.Fo dn_comp
-.Fa "const char *exp_dn"
-.Fa "u_char *comp_dn"
-.Fa "int length"
-.Fa "u_char **dnptrs"
-.Fa "u_char **lastdnptr"
-.Fc
-.Ft int
-.Fo dn_expand
-.Fa "const u_char *msg"
-.Fa "const u_char *eomorig"
-.Fa "const u_char *comp_dn"
-.Fa "char *exp_dn"
-.Fa "int length"
-.Fc
-.Sh DESCRIPTION
-These routines are used for making, sending and interpreting
-query and reply messages with Internet domain name servers.
-.Pp
-Global configuration and state information that is used by the
-resolver routines is kept in the structure
-.Em _res .
-Most of the values have reasonable defaults and can be ignored.
-Options
-stored in
-.Em _res.options
-are defined in
-.Pa resolv.h
-and are as follows.
-Options are stored as a simple bit mask containing the bitwise ``or''
-of the options enabled.
-.Bl -tag -width RES_DEFNAMES
-.It Dv RES_INIT
-True if the initial name server address and default domain name are
-initialized (i.e.,
-.Fn res_init
-has been called).
-.It Dv RES_DEBUG
-Print debugging messages.
-.It Dv RES_AAONLY
-Accept authoritative answers only.
-With this option,
-.Fn res_send
-should continue until it finds an authoritative answer or finds an error.
-Currently this is not implemented.
-.It Dv RES_USEVC
-Use
-.Tn TCP
-connections for queries instead of
-.Tn UDP
-datagrams.
-.It Dv RES_STAYOPEN
-Used with
-.Dv RES_USEVC
-to keep the
-.Tn TCP
-connection open between
-queries.
-This is useful only in programs that regularly do many queries.
-.Tn UDP
-should be the normal mode used.
-.It Dv RES_IGNTC
-Unused currently (ignore truncation errors, i.e., don't retry with
-.Tn TCP ) .
-.It Dv RES_RECURSE
-Set the recursion-desired bit in queries.
-This is the default.
-.Pf ( Fn res_send
-does not do iterative queries and expects the name server
-to handle recursion.)
-.It Dv RES_DEFNAMES
-If set,
-.Fn res_search
-will append the default domain name to single-component names
-(those that do not contain a dot).
-This option is enabled by default.
-.It Dv RES_DNSRCH
-If this option is set,
-.Fn res_search
-will search for host names in the current domain and in parent domains; see
-.Xr hostname 7 .
-This is used by the standard host lookup routine
-.Xr gethostbyname 3 .
-This option is enabled by default.
-.It Dv RES_NOALIASES
-This option turns off the user level aliasing feature controlled by the
-.Dq Ev HOSTALIASES
-environment variable. Network daemons should set this option.
-.El
-.Pp
-The
-.Fn res_init
-routine
-reads the configuration file (if any; see
-.Xr resolver 5 )
-to get the default domain name,
-search list and
-the Internet address of the local name server(s).
-If no server is configured, the host running
-the resolver is tried.
-The current domain name is defined by the hostname
-if not specified in the configuration file;
-it can be overridden by the environment variable
-.Ev LOCALDOMAIN .
-This environment variable may contain several blank-separated
-tokens if you wish to override the
-.Em "search list"
-on a per-process basis. This is similar to the
-.Em search
-command in the configuration file.
-Another environment variable (
-.Dq Ev RES_OPTIONS
-can be set to
-override certain internal resolver options which are otherwise
-set by changing fields in the
-.Em _res
-structure or are inherited from the configuration file's
-.Em options
-command. The syntax of the
-.Dq Ev RES_OPTIONS
-environment variable is explained in
-.Xr resolver 5 .
-Initialization normally occurs on the first call
-to one of the following routines.
-.Pp
-The
-.Fn res_query
-function provides an interface to the server query mechanism.
-It constructs a query, sends it to the local server,
-awaits a response, and makes preliminary checks on the reply.
-The query requests information of the specified
-.Fa type
-and
-.Fa class
-for the specified fully-qualified domain name
-.Fa dname .
-The reply message is left in the
-.Fa answer
-buffer with length
-.Fa anslen
-supplied by the caller.
-.Pp
-The
-.Fn res_search
-routine makes a query and awaits a response like
-.Fn res_query ,
-but in addition, it implements the default and search rules
-controlled by the
-.Dv RES_DEFNAMES
-and
-.Dv RES_DNSRCH
-options.
-It returns the first successful reply.
-.Pp
-The remaining routines are lower-level routines used by
-.Fn res_query .
-The
-.Fn res_mkquery
-function
-constructs a standard query message and places it in
-.Fa buf .
-It returns the size of the query, or \-1 if the query is
-larger than
-.Fa buflen .
-The query type
-.Fa op
-is usually
-.Dv QUERY ,
-but can be any of the query types defined in
-.Aq Pa arpa/nameser.h .
-The domain name for the query is given by
-.Fa dname .
-.Fa Newrr
-is currently unused but is intended for making update messages.
-.Pp
-The
-.Fn res_send
-routine
-sends a pre-formatted query and returns an answer.
-It will call
-.Fn res_init
-if
-.Dv RES_INIT
-is not set, send the query to the local name server, and
-handle timeouts and retries.
-The length of the reply message is returned, or
-\-1 if there were errors.
-.Pp
-The
-.Fn dn_comp
-function
-compresses the domain name
-.Fa exp_dn
-and stores it in
-.Fa comp_dn .
-The size of the compressed name is returned or \-1 if there were errors.
-The size of the array pointed to by
-.Fa comp_dn
-is given by
-.Fa length .
-The compression uses
-an array of pointers
-.Fa dnptrs
-to previously-compressed names in the current message.
-The first pointer points to
-to the beginning of the message and the list ends with
-.Dv NULL .
-The limit to the array is specified by
-.Fa lastdnptr .
-A side effect of
-.Fn dn_comp
-is to update the list of pointers for
-labels inserted into the message
-as the name is compressed.
-If
-.Em dnptr
-is
-.Dv NULL, names are not compressed.
-If
-.Fa lastdnptr
-is
-.Dv NULL ,
-the list of labels is not updated.
-.Pp
-The
-.Fn dn_expand
-entry
-expands the compressed domain name
-.Fa comp_dn
-to a full domain name
-The compressed name is contained in a query or reply message;
-.Fa msg
-is a pointer to the beginning of the message.
-The uncompressed name is placed in the buffer indicated by
-.Fa exp_dn
-which is of size
-.Fa length .
-The size of compressed name is returned or \-1 if there was an error.
-.Sh FILES
-.Bl -tag -width Pa
-/etc/resolv.conf
-The configuration file
-see
-.Xr resolver 5 .
-.El
-.Sh SEE ALSO
-.Xr gethostbyname 3 ,
-.Xr resolver 5 ,
-.Xr hostname 7 ,
-.Xr named 8
-.Pp
-.%T RFC1032 ,
-.%T RFC1033 ,
-.%T RFC1034 ,
-.%T RFC1035 ,
-.%T RFC974
-.Rs
-.%T "Name Server Operations Guide for BIND"
-.Re
-.Sh HISTORY
-The
-.Nm
-function appeared in
-.Bx 4.3 .
diff --git a/c/src/lib/libnetworking/libc/send.c b/c/src/lib/libnetworking/libc/send.c
deleted file mode 100644
index ad14bd3cd2..0000000000
--- a/c/src/lib/libnetworking/libc/send.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)send.c 8.2 (Berkeley) 2/21/94";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <stddef.h>
-
-ssize_t
-send(s, msg, len, flags)
- int s, flags;
- size_t len;
- const void *msg;
-{
- return (sendto(s, msg, len, flags, NULL, 0));
-}
diff --git a/c/src/lib/libnetworking/libc/strsep.c b/c/src/lib/libnetworking/libc/strsep.c
deleted file mode 100644
index 182319493d..0000000000
--- a/c/src/lib/libnetworking/libc/strsep.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * Copyright (c) 1990, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <string.h>
-#include <stdio.h>
-
-/*
- * Get next token from string *stringp, where tokens are possibly-empty
- * strings separated by characters from delim.
- *
- * Writes NULs into the string at *stringp to end tokens.
- * delim need not remain constant from call to call.
- * On return, *stringp points past the last NUL written (if there might
- * be further tokens), or is NULL (if there are definitely no more tokens).
- *
- * If *stringp is NULL, strsep returns NULL.
- *
- * PUBLIC: #ifndef HAVE_STRSEP
- * PUBLIC: char *strsep __P((char **, const char *));
- * PUBLIC: #endif
- */
-char *
-strsep(stringp, delim)
- register char **stringp;
- register const char *delim;
-{
- register char *s;
- register const char *spanp;
- register int c, sc;
- char *tok;
-
- if ((s = *stringp) == NULL)
- return (NULL);
- for (tok = s;;) {
- c = *s++;
- spanp = delim;
- do {
- if ((sc = *spanp++) == c) {
- if (c == 0)
- s = NULL;
- else
- s[-1] = 0;
- *stringp = s;
- return (tok);
- }
- } while (sc != 0);
- }
- /* NOTREACHED */
-}
diff --git a/c/src/lib/libnetworking/loop.h b/c/src/lib/libnetworking/loop.h
deleted file mode 100644
index 34e0b828e4..0000000000
--- a/c/src/lib/libnetworking/loop.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-#define NLOOP 1
diff --git a/c/src/lib/libnetworking/machine/conf.h b/c/src/lib/libnetworking/machine/conf.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/lib/libnetworking/machine/conf.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/lib/libnetworking/machine/cpu.h b/c/src/lib/libnetworking/machine/cpu.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/lib/libnetworking/machine/cpu.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/lib/libnetworking/machine/cpufunc.h b/c/src/lib/libnetworking/machine/cpufunc.h
deleted file mode 100644
index 2b4c47e48f..0000000000
--- a/c/src/lib/libnetworking/machine/cpufunc.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
diff --git a/c/src/lib/libnetworking/machine/endian.h b/c/src/lib/libnetworking/machine/endian.h
deleted file mode 100644
index 6b17da58d3..0000000000
--- a/c/src/lib/libnetworking/machine/endian.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef _MACHINE_ENDIAN_H_
-#define _MACHINE_ENDIAN_H_
-
-#include <rtems/score/cpu.h>
-
-/*
- * BSD-style endian declaration
- */
-#define BIG_ENDIAN 4321
-#define LITTLE_ENDIAN 1234
-
-#if CPU_BIG_ENDIAN
-# define BYTE_ORDER BIG_ENDIAN
-#elif CPU_LITTLE_ENDIAN
-# define BYTE_ORDER LITTLE_ENDIAN
-#else
-# error "Can't decide which end is which!"
-#endif
-
-#if ( CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES == FALSE )
-
-#if ( CPU_BIG_ENDIAN == TRUE )
-
-/*
- * Very simply on big endian CPUs
- */
-
-#define ntohl(_x) (_x)
-#define ntohs(_x) (_x)
-#define htonl(_x) (_x)
-#define htons(_x) (_x)
-
-#define NTOHS(x)
-#define HTONS(x)
-#define NTOHL(x)
-#define HTONL(x)
-
-#elif ( CPU_LITTLE_ENDIAN == TRUE )
-
-/*
- * A little more complicated on little endian CPUs
- */
-
-#define ntohl(_x) ((long) CPU_swap_u32((unsigned32)_x))
-#define ntohs(_x) ((short) CPU_swap_u16((unsigned16)_x))
-#define htonl(_x) ((long) CPU_swap_u32((unsigned32)_x))
-#define htons(_x) ((short) CPU_swap_u16((unsigned16)_x))
-
-#define NTOHS(x) (x) = ntohs(x)
-#define HTONS(x) (x) = htons(x)
-#define NTOHL(x) (x) = ntohl(x)
-#define HTONL(x) (x) = htonl(x)
-
-#else
-#error "Unknown endian-ness for this cpu"
-#endif
-
-#endif /* CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES */
-
-#endif /* _MACHINE_ENDIAN_H_ */
diff --git a/c/src/lib/libnetworking/machine/in_cksum.h b/c/src/lib/libnetworking/machine/in_cksum.h
deleted file mode 100644
index 15509b3888..0000000000
--- a/c/src/lib/libnetworking/machine/in_cksum.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * Copyright (c) 1990 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.
- *
- * from tahoe: in_cksum.c 1.2 86/01/05
- * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
- * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
- * $Id$
- */
-
-#ifndef _MACHINE_IN_CKSUM_H_
-#define _MACHINE_IN_CKSUM_H_ 1
-
-#include <sys/cdefs.h>
-
-/*
- * It it useful to have an Internet checksum routine which is inlineable
- * and optimized specifically for the task of computing IP header checksums
- * in the normal case (where there are no options and the header length is
- * therefore always exactly five 32-bit words.
- */
-#if (defined(__GNUC__) && defined(__i386__))
-static __inline u_int
-in_cksum_hdr(const struct ip *ip)
-{
- register u_int sum = 0;
-
-#define ADD(n) __asm("addl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (ip))
-#define ADDC(n) __asm("adcl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (ip))
-#define MOP __asm("adcl $0, %0" : "=r" (sum) : "0" (sum))
-
- ADD(0);
- ADDC(4);
- ADDC(8);
- ADDC(12);
- ADDC(16);
- MOP;
- sum = (sum & 0xffff) + (sum >> 16);
- if (sum > 0xffff)
- sum -= 0xffff;
-
- return ~sum & 0xffff;
-}
-
-static __inline void
-in_cksum_update(struct ip *ip)
-{
- int __tmpsum;
- __tmpsum = (int)ntohs(ip->ip_sum) + 256;
- ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
-}
-
-#elif (defined(__GNUC__) && (defined(__mc68000__) || defined(__m68k__)))
-
-static __inline__ u_int
-in_cksum_hdr(const struct ip *ip)
-{
- register u_int *ap = (u_int *)ip;
- register u_int sum = *ap++;
- register u_int tmp;
-
- __asm__("addl %2@+,%0\n\t"
- "movel %2@+,%1\n\t"
- "addxl %1,%0\n\t"
- "movel %2@+,%1\n\t"
- "addxl %1,%0\n\t"
- "movel %2@,%1\n\t"
- "addxl %1,%0\n\t"
- "moveq #0,%1\n\t"
- "addxl %1,%0\n" :
- "=d" (sum), "=d" (tmp), "=a" (ap) :
- "0" (sum), "2" (ap));
- sum = (sum & 0xffff) + (sum >> 16);
- if (sum > 0xffff)
- sum -= 0xffff;
- return ~sum & 0xffff;
-}
-
-#else
-u_int in_cksum_hdr __P((const struct ip *));
-#define in_cksum_update(ip) \
- do { \
- int __tmpsum; \
- __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
- ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
- } while(0)
-
-#endif
-
-#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/c/src/lib/libnetworking/machine/limits.h b/c/src/lib/libnetworking/machine/limits.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/lib/libnetworking/machine/limits.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/lib/libnetworking/machine/param.h b/c/src/lib/libnetworking/machine/param.h
deleted file mode 100644
index 4168f1f6cf..0000000000
--- a/c/src/lib/libnetworking/machine/param.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef _MACHINE_PARAM_H_
-#define _MACHINE_PARAM_H_
-
-/*
- * These aren't really machine-dependent for RTEMS.....
- */
-
-/*
-#define MACHINE "i386"
-#define MID_MACHINE MID_I386
-*/
-
-/*
- * Round p (pointer or byte index) up to a correctly-aligned value
- * for all data types (int, long, ...). The result is unsigned int
- * and must be cast to any desired pointer type.
- */
-#define ALIGNBYTES (sizeof(int) - 1)
-#define ALIGN(p) (((unsigned)(p) + ALIGNBYTES) & ~ALIGNBYTES)
-
-#define PAGE_SHIFT 12 /* LOG2(PAGE_SIZE) */
-#define PAGE_SIZE (1<<PAGE_SHIFT) /* bytes/page */
-#define PAGE_MASK (PAGE_SIZE-1)
-#define NPTEPG (PAGE_SIZE/(sizeof (pt_entry_t)))
-
-#define NPDEPG (PAGE_SIZE/(sizeof (pd_entry_t)))
-#define PDRSHIFT 22 /* LOG2(NBPDR) */
-#define NBPDR (1<<PDRSHIFT) /* bytes/page dir */
-
-#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
-#define DEV_BSIZE (1<<DEV_BSHIFT)
-
-#define BLKDEV_IOSIZE 2048
-#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
-
-#define UPAGES 2 /* pages of u-area */
-
-/*
- * Constants related to network buffer management.
- * MCLBYTES must be no larger than CLBYTES (the software page size), and,
- * on machines that exchange pages of input or output buffers with mbuf
- * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
- * of the hardware page size.
- */
-#ifndef MSIZE
-#define MSIZE 128 /* size of an mbuf */
-#endif /* MSIZE */
-
-#ifndef MCLSHIFT
-#define MCLSHIFT 11 /* convert bytes to m_buf clusters */
-#endif /* MCLSHIFT */
-#define MCLBYTES (1 << MCLSHIFT) /* size of an m_buf cluster */
-#define MCLOFSET (MCLBYTES - 1) /* offset within an m_buf cluster */
-
-/*
- * Some macros for units conversion
- */
-
-/* clicks to bytes */
-#define ctob(x) ((x)<<PAGE_SHIFT)
-
-/* bytes to clicks */
-#define btoc(x) (((unsigned)(x)+PAGE_MASK)>>PAGE_SHIFT)
-
-/*
- * btodb() is messy and perhaps slow because `bytes' may be an off_t. We
- * want to shift an unsigned type to avoid sign extension and we don't
- * want to widen `bytes' unnecessarily. Assume that the result fits in
- * a daddr_t.
- */
-#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
- (sizeof (bytes) > sizeof(long) \
- ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \
- : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT))
-
-#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
- ((off_t)(db) << DEV_BSHIFT)
-
-/*
- * Mach derived conversion macros
- */
-#define trunc_page(x) ((unsigned)(x) & ~PAGE_MASK)
-#define round_page(x) ((((unsigned)(x)) + PAGE_MASK) & ~PAGE_MASK)
-
-#define atop(x) ((unsigned)(x) >> PAGE_SHIFT)
-#define ptoa(x) ((unsigned)(x) << PAGE_SHIFT)
-
-#endif /* !_MACHINE_PARAM_H_ */
diff --git a/c/src/lib/libnetworking/machine/types.h b/c/src/lib/libnetworking/machine/types.h
deleted file mode 100644
index 730a6dec1d..0000000000
--- a/c/src/lib/libnetworking/machine/types.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file will have to be incorparated into the RTEMS source
- * tree (probably in the existing <machine/types.h> so that these
- * contents are included when an application source file includes
- * <sys/types.h>.
- *
- * $Id$
- */
-
-#ifndef _MACHINE_TYPES_H_
-#define _MACHINE_TYPES_H_
-
-#include <rtems.h>
-#include <machine/endian.h>
-
-typedef rtems_signed64 int64_t;
-typedef rtems_signed32 int32_t;
-typedef rtems_signed16 int16_t;
-typedef rtems_signed8 int8_t;
-
-typedef rtems_unsigned64 u_int64_t;
-typedef rtems_unsigned32 u_int32_t;
-typedef rtems_unsigned16 u_int16_t;
-typedef rtems_unsigned8 u_int8_t;
-
-#define _CLOCK_T_ unsigned long
-#define _TIME_T_ long
-
-#ifdef _COMPILING_BSD_KERNEL_
-#include <rtems/rtems_bsdnet_internal.h>
-#include <rtems/rtems_bsdnet.h>
-#endif
-
-#endif /* _MACHINE_TYPES_H_ */
diff --git a/c/src/lib/libnetworking/machine/vmparam.h b/c/src/lib/libnetworking/machine/vmparam.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/lib/libnetworking/machine/vmparam.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/lib/libnetworking/net/Makefile.in b/c/src/lib/libnetworking/net/Makefile.in
deleted file mode 100644
index 5a68c81ec0..0000000000
--- a/c/src/lib/libnetworking/net/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=lib.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES=if if_ethersubr if_loop \
- radix route rtsock \
- raw_cb raw_usrreq
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \
- -DDIAGNOSTIC -DBOOTP_COMPAT
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
diff --git a/c/src/lib/libnetworking/net/bpf.h b/c/src/lib/libnetworking/net/bpf.h
deleted file mode 100644
index 7847d72470..0000000000
--- a/c/src/lib/libnetworking/net/bpf.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 1990, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from the Stanford/CMU enet packet filter,
- * (net/enet.c) distributed as part of 4.3BSD, and code contributed
- * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
- * Berkeley Laboratory.
- *
- * 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.
- *
- * @(#)bpf.h 8.1 (Berkeley) 6/10/93
- * @(#)bpf.h 1.34 (LBL) 6/16/96
- *
- * $Id$
- */
-
-#ifndef _NET_BPF_H_
-#define _NET_BPF_H_
-
-/* BSD style release date */
-#define BPF_RELEASE 199606
-
-typedef int32_t bpf_int32;
-typedef u_int32_t bpf_u_int32;
-
-/*
- * Alignment macros. BPF_WORDALIGN rounds up to the next
- * even multiple of BPF_ALIGNMENT.
- */
-#define BPF_ALIGNMENT sizeof(bpf_int32)
-#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))
-
-#define BPF_MAXINSNS 512
-#define BPF_MAXBUFSIZE 0x8000
-#define BPF_MINBUFSIZE 32
-
-/*
- * Structure for BIOCSETF.
- */
-struct bpf_program {
- u_int bf_len;
- struct bpf_insn *bf_insns;
-};
-
-/*
- * Struct returned by BIOCGSTATS.
- */
-struct bpf_stat {
- u_int bs_recv; /* number of packets received */
- u_int bs_drop; /* number of packets dropped */
-};
-
-/*
- * Struct return by BIOCVERSION. This represents the version number of
- * the filter language described by the instruction encodings below.
- * bpf understands a program iff kernel_major == filter_major &&
- * kernel_minor >= filter_minor, that is, if the value returned by the
- * running kernel has the same major number and a minor number equal
- * equal to or less than the filter being downloaded. Otherwise, the
- * results are undefined, meaning an error may be returned or packets
- * may be accepted haphazardly.
- * It has nothing to do with the source code version.
- */
-struct bpf_version {
- u_short bv_major;
- u_short bv_minor;
-};
-/* Current version number of filter architecture. */
-#define BPF_MAJOR_VERSION 1
-#define BPF_MINOR_VERSION 1
-
-#define BIOCGBLEN _IOR('B',102, u_int)
-#define BIOCSBLEN _IOWR('B',102, u_int)
-#define BIOCSETF _IOW('B',103, struct bpf_program)
-#define BIOCFLUSH _IO('B',104)
-#define BIOCPROMISC _IO('B',105)
-#define BIOCGDLT _IOR('B',106, u_int)
-#define BIOCGETIF _IOR('B',107, struct ifreq)
-#define BIOCSETIF _IOW('B',108, struct ifreq)
-#define BIOCSRTIMEOUT _IOW('B',109, struct timeval)
-#define BIOCGRTIMEOUT _IOR('B',110, struct timeval)
-#define BIOCGSTATS _IOR('B',111, struct bpf_stat)
-#define BIOCIMMEDIATE _IOW('B',112, u_int)
-#define BIOCVERSION _IOR('B',113, struct bpf_version)
-#define BIOCGRSIG _IOR('B',114, u_int)
-#define BIOCSRSIG _IOW('B',115, u_int)
-
-/*
- * Structure prepended to each packet.
- */
-struct bpf_hdr {
- struct timeval bh_tstamp; /* time stamp */
- bpf_u_int32 bh_caplen; /* length of captured portion */
- bpf_u_int32 bh_datalen; /* original length of packet */
- u_short bh_hdrlen; /* length of bpf header (this struct
- plus alignment padding) */
-};
-/*
- * Because the structure above is not a multiple of 4 bytes, some compilers
- * will insist on inserting padding; hence, sizeof(struct bpf_hdr) won't work.
- * Only the kernel needs to know about it; applications use bh_hdrlen.
- */
-#ifdef KERNEL
-#define SIZEOF_BPF_HDR 18
-#endif
-
-/*
- * Data-link level type codes.
- */
-#define DLT_NULL 0 /* no link-layer encapsulation */
-#define DLT_EN10MB 1 /* Ethernet (10Mb) */
-#define DLT_EN3MB 2 /* Experimental Ethernet (3Mb) */
-#define DLT_AX25 3 /* Amateur Radio AX.25 */
-#define DLT_PRONET 4 /* Proteon ProNET Token Ring */
-#define DLT_CHAOS 5 /* Chaos */
-#define DLT_IEEE802 6 /* IEEE 802 Networks */
-#define DLT_ARCNET 7 /* ARCNET */
-#define DLT_SLIP 8 /* Serial Line IP */
-#define DLT_PPP 9 /* Point-to-point Protocol */
-#define DLT_FDDI 10 /* FDDI */
-#define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */
-
-/*
- * The instruction encodings.
- */
-/* instruction classes */
-#define BPF_CLASS(code) ((code) & 0x07)
-#define BPF_LD 0x00
-#define BPF_LDX 0x01
-#define BPF_ST 0x02
-#define BPF_STX 0x03
-#define BPF_ALU 0x04
-#define BPF_JMP 0x05
-#define BPF_RET 0x06
-#define BPF_MISC 0x07
-
-/* ld/ldx fields */
-#define BPF_SIZE(code) ((code) & 0x18)
-#define BPF_W 0x00
-#define BPF_H 0x08
-#define BPF_B 0x10
-#define BPF_MODE(code) ((code) & 0xe0)
-#define BPF_IMM 0x00
-#define BPF_ABS 0x20
-#define BPF_IND 0x40
-#define BPF_MEM 0x60
-#define BPF_LEN 0x80
-#define BPF_MSH 0xa0
-
-/* alu/jmp fields */
-#define BPF_OP(code) ((code) & 0xf0)
-#define BPF_ADD 0x00
-#define BPF_SUB 0x10
-#define BPF_MUL 0x20
-#define BPF_DIV 0x30
-#define BPF_OR 0x40
-#define BPF_AND 0x50
-#define BPF_LSH 0x60
-#define BPF_RSH 0x70
-#define BPF_NEG 0x80
-#define BPF_JA 0x00
-#define BPF_JEQ 0x10
-#define BPF_JGT 0x20
-#define BPF_JGE 0x30
-#define BPF_JSET 0x40
-#define BPF_SRC(code) ((code) & 0x08)
-#define BPF_K 0x00
-#define BPF_X 0x08
-
-/* ret - BPF_K and BPF_X also apply */
-#define BPF_RVAL(code) ((code) & 0x18)
-#define BPF_A 0x10
-
-/* misc */
-#define BPF_MISCOP(code) ((code) & 0xf8)
-#define BPF_TAX 0x00
-#define BPF_TXA 0x80
-
-/*
- * The instruction data structure.
- */
-struct bpf_insn {
- u_short code;
- u_char jt;
- u_char jf;
- bpf_u_int32 k;
-};
-
-/*
- * Macros for insn array initializers.
- */
-#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }
-#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }
-
-#ifdef KERNEL
-int bpf_validate __P((struct bpf_insn *, int));
-void bpf_tap __P((struct ifnet *, u_char *, u_int));
-void bpf_mtap __P((struct ifnet *, struct mbuf *));
-void bpfattach __P((struct ifnet *, u_int, u_int));
-void bpfilterattach __P((int));
-u_int bpf_filter __P((struct bpf_insn *, u_char *, u_int, u_int));
-#endif
-
-/*
- * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
- */
-#define BPF_MEMWORDS 16
-
-#endif
diff --git a/c/src/lib/libnetworking/net/ethernet.h b/c/src/lib/libnetworking/net/ethernet.h
deleted file mode 100644
index c6c07189ec..0000000000
--- a/c/src/lib/libnetworking/net/ethernet.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Fundamental constants relating to ethernet.
- *
- * $Id$
- *
- */
-
-#ifndef _NET_ETHERNET_H_
-#define _NET_ETHERNET_H_
-
-/*
- * The number of bytes in an ethernet (MAC) address.
- */
-#define ETHER_ADDR_LEN 6
-
-/*
- * The number of bytes in the type field.
- */
-#define ETHER_TYPE_LEN 2
-
-/*
- * The number of bytes in the trailing CRC field.
- */
-#define ETHER_CRC_LEN 4
-
-/*
- * The length of the combined header.
- */
-#define ETHER_HDR_LEN (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
-
-/*
- * The minimum packet length.
- */
-#define ETHER_MIN_LEN 64
-
-/*
- * The maximum packet length.
- */
-#define ETHER_MAX_LEN 1518
-
-/*
- * A macro to validate a length with
- */
-#define ETHER_IS_VALID_LEN(foo) \
- ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
-
-/*
- * Structure of a 10Mb/s Ethernet header.
- */
-struct ether_header {
- u_char ether_dhost[ETHER_ADDR_LEN];
- u_char ether_shost[ETHER_ADDR_LEN];
- u_short ether_type;
-};
-
-/*
- * Structure of a 48-bit Ethernet address.
- */
-struct ether_addr {
- u_char octet[ETHER_ADDR_LEN];
-};
-
-#endif
diff --git a/c/src/lib/libnetworking/net/if.c b/c/src/lib/libnetworking/net/if.c
deleted file mode 100644
index af6f003de3..0000000000
--- a/c/src/lib/libnetworking/net/if.c
+++ /dev/null
@@ -1,783 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)if.c 8.3 (Berkeley) 1/4/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/mbuf.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/kernel.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/if_types.h>
-#include <net/radix.h>
-
-/*
- * System initialization
- */
-
-static int ifconf __P((int, caddr_t));
- void ifinit __P((void *));
-static void if_qflush __P((struct ifqueue *));
-static void if_slowtimo __P((void *));
-static void link_rtrequest __P((int, struct rtentry *, struct sockaddr *));
-
-SYSINIT(interfaces, SI_SUB_PROTO_IF, SI_ORDER_FIRST, ifinit, NULL)
-
-
-int ifqmaxlen = IFQ_MAXLEN;
-struct ifnet *ifnet;
-
-/*
- * Network interface utility routines.
- *
- * Routines with ifa_ifwith* names take sockaddr *'s as
- * parameters.
- *
- * This routine assumes that it will be called at splimp() or higher.
- */
-/* ARGSUSED*/
-void
-ifinit(dummy)
- void *dummy;
-{
- register struct ifnet *ifp;
-
- for (ifp = ifnet; ifp; ifp = ifp->if_next)
- if (ifp->if_snd.ifq_maxlen == 0)
- ifp->if_snd.ifq_maxlen = ifqmaxlen;
- if_slowtimo(0);
-}
-
-int if_index = 0;
-struct ifaddr **ifnet_addrs;
-
-
-/*
- * Attach an interface to the
- * list of "active" interfaces.
- */
-void
-if_attach(ifp)
- struct ifnet *ifp;
-{
- unsigned socksize, ifasize;
- int namelen, masklen;
- char workbuf[64];
- register struct ifnet **p = &ifnet;
- register struct sockaddr_dl *sdl;
- register struct ifaddr *ifa;
- static int if_indexlim = 8;
-
-
- while (*p)
- p = &((*p)->if_next);
- *p = ifp;
- ifp->if_index = ++if_index;
- microtime(&ifp->if_lastchange);
- if (ifnet_addrs == 0 || if_index >= if_indexlim) {
- unsigned n = (if_indexlim <<= 1) * sizeof(ifa);
- struct ifaddr **q = (struct ifaddr **)
- malloc(n, M_IFADDR, M_WAITOK);
- bzero((caddr_t)q, n);
- if (ifnet_addrs) {
- bcopy((caddr_t)ifnet_addrs, (caddr_t)q, n/2);
- free((caddr_t)ifnet_addrs, M_IFADDR);
- }
- ifnet_addrs = q;
- }
- /*
- * create a Link Level name for this device
- */
- namelen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit);
-#define _offsetof(t, m) ((int)((caddr_t)&((t *)0)->m))
- masklen = _offsetof(struct sockaddr_dl, sdl_data[0]) + namelen;
- socksize = masklen + ifp->if_addrlen;
-#define ROUNDUP(a) (1 + (((a) - 1) | (sizeof(long) - 1)))
- socksize = ROUNDUP(socksize);
- if (socksize < sizeof(*sdl))
- socksize = sizeof(*sdl);
- ifasize = sizeof(*ifa) + 2 * socksize;
- ifa = (struct ifaddr *)malloc(ifasize, M_IFADDR, M_WAITOK);
- if (ifa) {
- bzero((caddr_t)ifa, ifasize);
- sdl = (struct sockaddr_dl *)(ifa + 1);
- sdl->sdl_len = socksize;
- sdl->sdl_family = AF_LINK;
- bcopy(workbuf, sdl->sdl_data, namelen);
- sdl->sdl_nlen = namelen;
- sdl->sdl_index = ifp->if_index;
- sdl->sdl_type = ifp->if_type;
- ifnet_addrs[if_index - 1] = ifa;
- ifa->ifa_ifp = ifp;
- ifa->ifa_next = ifp->if_addrlist;
- ifa->ifa_rtrequest = link_rtrequest;
- ifp->if_addrlist = ifa;
- ifa->ifa_addr = (struct sockaddr *)sdl;
-
- sdl = (struct sockaddr_dl *)(socksize + (caddr_t)sdl);
- ifa->ifa_netmask = (struct sockaddr *)sdl;
- sdl->sdl_len = masklen;
- while (namelen != 0)
- sdl->sdl_data[--namelen] = 0xff;
- }
-}
-/*
- * Locate an interface based on a complete address.
- */
-/*ARGSUSED*/
-struct ifaddr *
-ifa_ifwithaddr(addr)
- register struct sockaddr *addr;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
-
-#define equal(a1, a2) \
- (bcmp((caddr_t)(a1), (caddr_t)(a2), ((struct sockaddr *)(a1))->sa_len) == 0)
- for (ifp = ifnet; ifp; ifp = ifp->if_next)
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr->sa_family != addr->sa_family)
- continue;
- if (equal(addr, ifa->ifa_addr))
- return (ifa);
- if ((ifp->if_flags & IFF_BROADCAST) && ifa->ifa_broadaddr &&
- equal(ifa->ifa_broadaddr, addr))
- return (ifa);
- }
- return ((struct ifaddr *)0);
-}
-/*
- * Locate the point to point interface with a given destination address.
- */
-/*ARGSUSED*/
-struct ifaddr *
-ifa_ifwithdstaddr(addr)
- register struct sockaddr *addr;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
-
- for (ifp = ifnet; ifp; ifp = ifp->if_next)
- if (ifp->if_flags & IFF_POINTOPOINT)
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr->sa_family != addr->sa_family)
- continue;
- if (ifa->ifa_dstaddr && equal(addr, ifa->ifa_dstaddr))
- return (ifa);
- }
- return ((struct ifaddr *)0);
-}
-
-/*
- * Find an interface on a specific network. If many, choice
- * is most specific found.
- */
-struct ifaddr *
-ifa_ifwithnet(addr)
- struct sockaddr *addr;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
- struct ifaddr *ifa_maybe = (struct ifaddr *) 0;
- u_int af = addr->sa_family;
- char *addr_data = addr->sa_data, *cplim;
-
- if (af == AF_LINK) {
- register struct sockaddr_dl *sdl = (struct sockaddr_dl *)addr;
- if (sdl->sdl_index && sdl->sdl_index <= if_index)
- return (ifnet_addrs[sdl->sdl_index - 1]);
- }
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- register char *cp, *cp2, *cp3;
-
- if (ifa->ifa_addr->sa_family != af)
- next: continue;
- if (ifp->if_flags & IFF_POINTOPOINT) {
- if (ifa->ifa_dstaddr != 0
- && equal(addr, ifa->ifa_dstaddr))
- return (ifa);
- } else {
- /*
- * if we have a special address handler,
- * then use it instead of the generic one.
- */
- if (ifa->ifa_claim_addr) {
- if ((*ifa->ifa_claim_addr)(ifa, addr)) {
- return (ifa);
- } else {
- continue;
- }
- }
-
- /*
- * Scan all the bits in the ifa's address.
- * If a bit dissagrees with what we are
- * looking for, mask it with the netmask
- * to see if it really matters.
- * (A byte at a time)
- */
- if (ifa->ifa_netmask == 0)
- continue;
- cp = addr_data;
- cp2 = ifa->ifa_addr->sa_data;
- cp3 = ifa->ifa_netmask->sa_data;
- cplim = ifa->ifa_netmask->sa_len + (char *)ifa->ifa_netmask;
- while (cp3 < cplim)
- if ((*cp++ ^ *cp2++) & *cp3++)
- goto next;
- if (ifa_maybe == 0 ||
- rn_refines((caddr_t)ifa->ifa_netmask,
- (caddr_t)ifa_maybe->ifa_netmask))
- ifa_maybe = ifa;
- }
- }
- }
- return (ifa_maybe);
-}
-
-/*
- * Find an interface address specific to an interface best matching
- * a given address.
- */
-struct ifaddr *
-ifaof_ifpforaddr(addr, ifp)
- struct sockaddr *addr;
- register struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
- register char *cp, *cp2, *cp3;
- register char *cplim;
- struct ifaddr *ifa_maybe = 0;
- u_int af = addr->sa_family;
-
- if (af >= AF_MAX)
- return (0);
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr->sa_family != af)
- continue;
- if (ifa_maybe == 0)
- ifa_maybe = ifa;
- if (ifa->ifa_netmask == 0) {
- if (equal(addr, ifa->ifa_addr) ||
- (ifa->ifa_dstaddr && equal(addr, ifa->ifa_dstaddr)))
- return (ifa);
- continue;
- }
- if (ifp->if_flags & IFF_POINTOPOINT) {
- if (equal(addr, ifa->ifa_dstaddr))
- return (ifa);
- } else {
- cp = addr->sa_data;
- cp2 = ifa->ifa_addr->sa_data;
- cp3 = ifa->ifa_netmask->sa_data;
- cplim = ifa->ifa_netmask->sa_len + (char *)ifa->ifa_netmask;
- for (; cp3 < cplim; cp3++)
- if ((*cp++ ^ *cp2++) & *cp3)
- break;
- if (cp3 == cplim)
- return (ifa);
- }
- }
- return (ifa_maybe);
-}
-
-#include <net/route.h>
-
-/*
- * Default action when installing a route with a Link Level gateway.
- * Lookup an appropriate real ifa to point to.
- * This should be moved to /sys/net/link.c eventually.
- */
-static void
-link_rtrequest(cmd, rt, sa)
- int cmd;
- register struct rtentry *rt;
- struct sockaddr *sa;
-{
- register struct ifaddr *ifa;
- struct sockaddr *dst;
- struct ifnet *ifp;
-
- if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == 0) ||
- ((ifp = ifa->ifa_ifp) == 0) || ((dst = rt_key(rt)) == 0))
- return;
- ifa = ifaof_ifpforaddr(dst, ifp);
- if (ifa) {
- IFAFREE(rt->rt_ifa);
- rt->rt_ifa = ifa;
- ifa->ifa_refcnt++;
- if (ifa->ifa_rtrequest && ifa->ifa_rtrequest != link_rtrequest)
- ifa->ifa_rtrequest(cmd, rt, sa);
- }
-}
-
-/*
- * Mark an interface down and notify protocols of
- * the transition.
- * NOTE: must be called at splnet or eqivalent.
- */
-void
-if_down(ifp)
- register struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
-
- ifp->if_flags &= ~IFF_UP;
- microtime(&ifp->if_lastchange);
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
- if_qflush(&ifp->if_snd);
- rt_ifmsg(ifp);
-}
-
-/*
- * Mark an interface up and notify protocols of
- * the transition.
- * NOTE: must be called at splnet or eqivalent.
- */
-void
-if_up(ifp)
- register struct ifnet *ifp;
-{
-
- ifp->if_flags |= IFF_UP;
- microtime(&ifp->if_lastchange);
-#ifdef notyet
- register struct ifaddr *ifa;
- /* this has no effect on IP, and will kill all iso connections XXX */
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- pfctlinput(PRC_IFUP, ifa->ifa_addr);
-#endif
- rt_ifmsg(ifp);
-}
-
-/*
- * Flush an interface queue.
- */
-static void
-if_qflush(ifq)
- register struct ifqueue *ifq;
-{
- register struct mbuf *m, *n;
-
- n = ifq->ifq_head;
- while ((m = n) != 0) {
- n = m->m_act;
- m_freem(m);
- }
- ifq->ifq_head = 0;
- ifq->ifq_tail = 0;
- ifq->ifq_len = 0;
-}
-
-/*
- * Handle interface watchdog timer routines. Called
- * from softclock, we decrement timers (if set) and
- * call the appropriate interface routine on expiration.
- */
-static void
-if_slowtimo(arg)
- void *arg;
-{
- register struct ifnet *ifp;
- int s = splimp();
-
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- if (ifp->if_timer == 0 || --ifp->if_timer)
- continue;
- if (ifp->if_watchdog)
- (*ifp->if_watchdog)(ifp);
- }
- splx(s);
- timeout(if_slowtimo, (void *)0, hz / IFNET_SLOWHZ);
-}
-
-/*
- * Map interface name to
- * interface structure pointer.
- */
-struct ifnet *
-ifunit(name)
- register char *name;
-{
- register char *cp;
- register struct ifnet *ifp;
- int unit;
- unsigned len;
- char *ep, c;
-
- for (cp = name; cp < name + IFNAMSIZ && *cp; cp++)
- if (*cp >= '0' && *cp <= '9')
- break;
- if (*cp == '\0' || cp == name + IFNAMSIZ)
- return ((struct ifnet *)0);
- /*
- * Save first char of unit, and pointer to it,
- * so we can put a null there to avoid matching
- * initial substrings of interface names.
- */
- len = cp - name + 1;
- c = *cp;
- ep = cp;
- for (unit = 0; *cp >= '0' && *cp <= '9'; )
- unit = unit * 10 + *cp++ - '0';
- if (*cp != '\0')
- return 0; /* no trailing garbage allowed */
- *ep = 0;
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- if (bcmp(ifp->if_name, name, len))
- continue;
- if (unit == ifp->if_unit)
- break;
- }
- *ep = c;
- return (ifp);
-}
-
-/*
- * Interface ioctls.
- */
-int
-ifioctl(so, cmd, data, p)
- struct socket *so;
- int cmd;
- caddr_t data;
- struct proc *p;
-{
- register struct ifnet *ifp;
- register struct ifreq *ifr;
- int error;
-
- switch (cmd) {
-
- case SIOCGIFCONF:
- case OSIOCGIFCONF:
- return (ifconf(cmd, data));
- }
- ifr = (struct ifreq *)data;
- ifp = ifunit(ifr->ifr_name);
- if (ifp == 0)
- return (ENXIO);
- switch (cmd) {
-
- case SIOCGIFFLAGS:
- ifr->ifr_flags = ifp->if_flags;
- break;
-
- case SIOCGIFMETRIC:
- ifr->ifr_metric = ifp->if_metric;
- break;
-
- case SIOCGIFMTU:
- ifr->ifr_mtu = ifp->if_mtu;
- break;
-
- case SIOCGIFPHYS:
- ifr->ifr_phys = ifp->if_physical;
- break;
-
- case SIOCSIFFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_flags & IFF_UP && (ifr->ifr_flags & IFF_UP) == 0) {
- int s = splimp();
- if_down(ifp);
- splx(s);
- }
- if (ifr->ifr_flags & IFF_UP && (ifp->if_flags & IFF_UP) == 0) {
- int s = splimp();
- if_up(ifp);
- splx(s);
- }
- ifp->if_flags = (ifp->if_flags & IFF_CANTCHANGE) |
- (ifr->ifr_flags &~ IFF_CANTCHANGE);
- if (ifp->if_ioctl)
- (void) (*ifp->if_ioctl)(ifp, cmd, data);
- microtime(&ifp->if_lastchange);
- break;
-
- case SIOCSIFMETRIC:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- ifp->if_metric = ifr->ifr_metric;
- microtime(&ifp->if_lastchange);
- break;
-
- case SIOCSIFPHYS:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return error;
- if (!ifp->if_ioctl)
- return EOPNOTSUPP;
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0)
- microtime(&ifp->if_lastchange);
- return(error);
-
- case SIOCSIFMTU:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_ioctl == NULL)
- return (EOPNOTSUPP);
- /*
- * 72 was chosen below because it is the size of a TCP/IP
- * header (40) + the minimum mss (32).
- */
- if (ifr->ifr_mtu < 72 || ifr->ifr_mtu > 65535)
- return (EINVAL);
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0)
- microtime(&ifp->if_lastchange);
- return(error);
-
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_ioctl == NULL)
- return (EOPNOTSUPP);
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0 )
- microtime(&ifp->if_lastchange);
- return(error);
-
- case SIOCSIFMEDIA:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_ioctl == 0)
- return (EOPNOTSUPP);
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0)
- microtime(&ifp->if_lastchange);
- return error;
-
- case SIOCGIFMEDIA:
- if (ifp->if_ioctl == 0)
- return (EOPNOTSUPP);
- return ((*ifp->if_ioctl)(ifp, cmd, data));
-
- default:
- if (so->so_proto == 0)
- return (EOPNOTSUPP);
-#ifndef COMPAT_43
- return ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
- data,
- ifp));
-#else
- {
- int ocmd = cmd;
-
- switch (cmd) {
-
- case SIOCSIFDSTADDR:
- case SIOCSIFADDR:
- case SIOCSIFBRDADDR:
- case SIOCSIFNETMASK:
-#if BYTE_ORDER != BIG_ENDIAN
- if (ifr->ifr_addr.sa_family == 0 &&
- ifr->ifr_addr.sa_len < 16) {
- ifr->ifr_addr.sa_family = ifr->ifr_addr.sa_len;
- ifr->ifr_addr.sa_len = 16;
- }
-#else
- if (ifr->ifr_addr.sa_len == 0)
- ifr->ifr_addr.sa_len = 16;
-#endif
- break;
-
- case OSIOCGIFADDR:
- cmd = SIOCGIFADDR;
- break;
-
- case OSIOCGIFDSTADDR:
- cmd = SIOCGIFDSTADDR;
- break;
-
- case OSIOCGIFBRDADDR:
- cmd = SIOCGIFBRDADDR;
- break;
-
- case OSIOCGIFNETMASK:
- cmd = SIOCGIFNETMASK;
- }
- error = ((*so->so_proto->pr_usrreqs->pru_control)(so,
- cmd,
- data,
- ifp));
- switch (ocmd) {
-
- case OSIOCGIFADDR:
- case OSIOCGIFDSTADDR:
- case OSIOCGIFBRDADDR:
- case OSIOCGIFNETMASK:
- *(u_short *)&ifr->ifr_addr = ifr->ifr_addr.sa_family;
- }
- return (error);
-
- }
-#endif
- }
- return (0);
-}
-
-/*
- * Set/clear promiscuous mode on interface ifp based on the truth value
- * of pswitch. The calls are reference counted so that only the first
- * "on" request actually has an effect, as does the final "off" request.
- * Results are undefined if the "off" and "on" requests are not matched.
- */
-int
-ifpromisc(ifp, pswitch)
- struct ifnet *ifp;
- int pswitch;
-{
- struct ifreq ifr;
-
- if (pswitch) {
- /*
- * If the device is not configured up, we cannot put it in
- * promiscuous mode.
- */
- if ((ifp->if_flags & IFF_UP) == 0)
- return (ENETDOWN);
- if (ifp->if_pcount++ != 0)
- return (0);
- ifp->if_flags |= IFF_PROMISC;
- log(LOG_INFO, "%s%d: promiscuous mode enabled\n",
- ifp->if_name, ifp->if_unit);
- } else {
- if (--ifp->if_pcount > 0)
- return (0);
- ifp->if_flags &= ~IFF_PROMISC;
- }
- ifr.ifr_flags = ifp->if_flags;
- return ((*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr));
-}
-
-/*
- * Return interface configuration
- * of system. List may be used
- * in later ioctl's (above) to get
- * other information.
- */
-/*ARGSUSED*/
-static int
-ifconf(cmd, data)
- int cmd;
- caddr_t data;
-{
- register struct ifconf *ifc = (struct ifconf *)data;
- register struct ifnet *ifp = ifnet;
- register struct ifaddr *ifa;
- struct ifreq ifr, *ifrp;
- int space = ifc->ifc_len, error = 0;
-
- ifrp = ifc->ifc_req;
- for (; space > sizeof (ifr) && ifp; ifp = ifp->if_next) {
- char workbuf[64];
- int ifnlen;
-
- ifnlen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit);
- if(ifnlen + 1 > sizeof ifr.ifr_name) {
- error = ENAMETOOLONG;
- } else {
- strcpy(ifr.ifr_name, workbuf);
- }
-
- if ((ifa = ifp->if_addrlist) == 0) {
- bzero((caddr_t)&ifr.ifr_addr, sizeof(ifr.ifr_addr));
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr));
- if (error)
- break;
- space -= sizeof (ifr), ifrp++;
- } else
- for ( ; space > sizeof (ifr) && ifa; ifa = ifa->ifa_next) {
- register struct sockaddr *sa = ifa->ifa_addr;
-#ifdef COMPAT_43
- if (cmd == OSIOCGIFCONF) {
- struct osockaddr *osa =
- (struct osockaddr *)&ifr.ifr_addr;
- ifr.ifr_addr = *sa;
- osa->sa_family = sa->sa_family;
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr));
- ifrp++;
- } else
-#endif
- if (sa->sa_len <= sizeof(*sa)) {
- ifr.ifr_addr = *sa;
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr));
- ifrp++;
- } else {
- space -= sa->sa_len - sizeof(*sa);
- if (space < sizeof (ifr))
- break;
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr.ifr_name));
- if (error == 0)
- error = copyout((caddr_t)sa,
- (caddr_t)&ifrp->ifr_addr, sa->sa_len);
- ifrp = (struct ifreq *)
- (sa->sa_len + (caddr_t)&ifrp->ifr_addr);
- }
- if (error)
- break;
- space -= sizeof (ifr);
- }
- }
- ifc->ifc_len -= space;
- return (error);
-}
-
-SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers");
-SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management");
diff --git a/c/src/lib/libnetworking/net/if.h b/c/src/lib/libnetworking/net/if.h
deleted file mode 100644
index acddd4f095..0000000000
--- a/c/src/lib/libnetworking/net/if.h
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 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.
- *
- * @(#)if.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_H_
-#define _NET_IF_H_
-
-/*
- * Structures defining a network interface, providing a packet
- * transport mechanism (ala level 0 of the PUP protocols).
- *
- * Each interface accepts output datagrams of a specified maximum
- * length, and provides higher level routines with input datagrams
- * received from its medium.
- *
- * Output occurs when the routine if_output is called, with three parameters:
- * (*ifp->if_output)(ifp, m, dst, rt)
- * Here m is the mbuf chain to be sent and dst is the destination address.
- * The output routine encapsulates the supplied datagram if necessary,
- * and then transmits it on its medium.
- *
- * On input, each interface unwraps the data received by it, and either
- * places it on the input queue of a internetwork datagram routine
- * and posts the associated software interrupt, or passes the datagram to a raw
- * packet input routine.
- *
- * Routines exist for locating interfaces by their addresses
- * or for locating a interface on a certain network, as well as more general
- * routing and gateway routines maintaining information used to locate
- * interfaces. These routines live in the files if.c and route.c
- */
-
-#ifndef _TIME_ /* XXX fast fix for SNMP, going away soon */
-#include <sys/time.h>
-#endif
-
-#ifdef __STDC__
-/*
- * Forward structure declarations for function prototypes [sic].
- */
-struct mbuf;
-struct proc;
-struct rtentry;
-struct socket;
-struct ether_header;
-#endif
-
-/*
- * Structure describing information about an interface
- * which may be of interest to management entities.
- */
-struct if_data {
- /* generic interface information */
- u_char ifi_type; /* ethernet, tokenring, etc */
- u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */
- u_char ifi_addrlen; /* media address length */
- u_char ifi_hdrlen; /* media header length */
- u_char ifi_recvquota; /* polling quota for receive intrs */
- u_char ifi_xmitquota; /* polling quota for xmit intrs */
- u_long ifi_mtu; /* maximum transmission unit */
- u_long ifi_metric; /* routing metric (external only) */
- u_long ifi_baudrate; /* linespeed */
- /* volatile statistics */
- u_long ifi_ipackets; /* packets received on interface */
- u_long ifi_ierrors; /* input errors on interface */
- u_long ifi_opackets; /* packets sent on interface */
- u_long ifi_oerrors; /* output errors on interface */
- u_long ifi_collisions; /* collisions on csma interfaces */
- u_long ifi_ibytes; /* total number of octets received */
- u_long ifi_obytes; /* total number of octets sent */
- u_long ifi_imcasts; /* packets received via multicast */
- u_long ifi_omcasts; /* packets sent via multicast */
- u_long ifi_iqdrops; /* dropped on input, this interface */
- u_long ifi_noproto; /* destined for unsupported protocol */
- u_long ifi_recvtiming; /* usec spent receiving when timing */
- u_long ifi_xmittiming; /* usec spent xmitting when timing */
- struct timeval ifi_lastchange; /* time of last administrative change */
-};
-
-/*
- * Structure defining a queue for a network interface.
- */
-struct ifqueue {
- struct mbuf *ifq_head;
- struct mbuf *ifq_tail;
- int ifq_len;
- int ifq_maxlen;
- int ifq_drops;
-};
-
-/*
- * Structure defining a network interface.
- *
- * (Would like to call this struct ``if'', but C isn't PL/1.)
- */
-struct ifnet {
- void *if_softc; /* pointer to driver state */
- char *if_name; /* name, e.g. ``en'' or ``lo'' */
- struct ifnet *if_next; /* all struct ifnets are chained */
- struct ifaddr *if_addrlist; /* linked list of addresses per if */
- int if_pcount; /* number of promiscuous listeners */
- struct bpf_if *if_bpf; /* packet filter structure */
- u_short if_index; /* numeric abbreviation for this if */
- short if_unit; /* sub-unit for lower level driver */
- short if_timer; /* time 'til if_watchdog called */
- short if_flags; /* up/down, broadcast, etc. */
- int if_ipending; /* interrupts pending */
- void *if_linkmib; /* link-type-specific MIB data */
- size_t if_linkmiblen; /* length of above data */
- struct if_data if_data;
-/* procedure handles */
- int (*if_output) /* output routine (enqueue) */
- __P((struct ifnet *, struct mbuf *, struct sockaddr *,
- struct rtentry *));
- void (*if_start) /* initiate output routine */
- __P((struct ifnet *));
- int (*if_done) /* output complete routine */
- __P((struct ifnet *)); /* (XXX not used; fake prototype) */
- int (*if_ioctl) /* ioctl routine */
- __P((struct ifnet *, int, caddr_t));
- void (*if_watchdog) /* timer routine */
- __P((struct ifnet *));
- int (*if_poll_recv) /* polled receive routine */
- __P((struct ifnet *, int *));
- int (*if_poll_xmit) /* polled transmit routine */
- __P((struct ifnet *, int *));
- void (*if_poll_intren) /* polled interrupt reenable routine */
- __P((struct ifnet *));
- void (*if_poll_slowinput) /* input routine for slow devices */
- __P((struct ifnet *, struct mbuf *));
- void (*if_init) /* Init routine */
- __P((void *));
- struct ifqueue if_snd; /* output queue */
- struct ifqueue *if_poll_slowq; /* input queue for slow devices */
-};
-typedef void if_init_f_t __P((void *));
-
-#define if_mtu if_data.ifi_mtu
-#define if_type if_data.ifi_type
-#define if_physical if_data.ifi_physical
-#define if_addrlen if_data.ifi_addrlen
-#define if_hdrlen if_data.ifi_hdrlen
-#define if_metric if_data.ifi_metric
-#define if_baudrate if_data.ifi_baudrate
-#define if_ipackets if_data.ifi_ipackets
-#define if_ierrors if_data.ifi_ierrors
-#define if_opackets if_data.ifi_opackets
-#define if_oerrors if_data.ifi_oerrors
-#define if_collisions if_data.ifi_collisions
-#define if_ibytes if_data.ifi_ibytes
-#define if_obytes if_data.ifi_obytes
-#define if_imcasts if_data.ifi_imcasts
-#define if_omcasts if_data.ifi_omcasts
-#define if_iqdrops if_data.ifi_iqdrops
-#define if_noproto if_data.ifi_noproto
-#define if_lastchange if_data.ifi_lastchange
-#define if_recvquota if_data.ifi_recvquota
-#define if_xmitquota if_data.ifi_xmitquota
-#define if_rawoutput(if, m, sa) if_output(if, m, sa, (struct rtentry *)0)
-
-#define IFF_UP 0x1 /* interface is up */
-#define IFF_BROADCAST 0x2 /* broadcast address valid */
-#define IFF_DEBUG 0x4 /* turn on debugging */
-#define IFF_LOOPBACK 0x8 /* is a loopback net */
-#define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */
-/*#define IFF_NOTRAILERS 0x20 * obsolete: avoid use of trailers */
-#define IFF_RUNNING 0x40 /* resources allocated */
-#define IFF_NOARP 0x80 /* no address resolution protocol */
-#define IFF_PROMISC 0x100 /* receive all packets */
-#define IFF_ALLMULTI 0x200 /* receive all multicast packets */
-#define IFF_OACTIVE 0x400 /* transmission in progress */
-#define IFF_SIMPLEX 0x800 /* can't hear own transmissions */
-#define IFF_LINK0 0x1000 /* per link layer defined bit */
-#define IFF_LINK1 0x2000 /* per link layer defined bit */
-#define IFF_LINK2 0x4000 /* per link layer defined bit */
-#define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */
-#define IFF_MULTICAST 0x8000 /* supports multicast */
-
-/* flags set internally only: */
-#define IFF_CANTCHANGE \
- (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\
- IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI)
-
-
-/*
- * These really don't belong here, but there's no other obviously appropriate
- * location.
- */
-#define IFP_AUI 0
-#define IFP_10BASE2 1
-#define IFP_10BASET 2
-/* etc. */
-
-/*
- * Bit values in if_ipending
- */
-#define IFI_RECV 1 /* I want to receive */
-#define IFI_XMIT 2 /* I want to transmit */
-
-/*
- * Output queues (ifp->if_snd) and slow device input queues (*ifp->if_slowq)
- * are queues of messages stored on ifqueue structures
- * (defined above). Entries are added to and deleted from these structures
- * by these macros, which should be called with ipl raised to splimp().
- */
-#define IF_QFULL(ifq) ((ifq)->ifq_len >= (ifq)->ifq_maxlen)
-#define IF_DROP(ifq) ((ifq)->ifq_drops++)
-#define IF_ENQUEUE(ifq, m) { \
- (m)->m_nextpkt = 0; \
- if ((ifq)->ifq_tail == 0) \
- (ifq)->ifq_head = m; \
- else \
- (ifq)->ifq_tail->m_nextpkt = m; \
- (ifq)->ifq_tail = m; \
- (ifq)->ifq_len++; \
-}
-#define IF_PREPEND(ifq, m) { \
- (m)->m_nextpkt = (ifq)->ifq_head; \
- if ((ifq)->ifq_tail == 0) \
- (ifq)->ifq_tail = (m); \
- (ifq)->ifq_head = (m); \
- (ifq)->ifq_len++; \
-}
-#define IF_DEQUEUE(ifq, m) { \
- (m) = (ifq)->ifq_head; \
- if (m) { \
- if (((ifq)->ifq_head = (m)->m_nextpkt) == 0) \
- (ifq)->ifq_tail = 0; \
- (m)->m_nextpkt = 0; \
- (ifq)->ifq_len--; \
- } \
-}
-
-#ifdef KERNEL
-#define IF_ENQ_DROP(ifq, m) if_enq_drop(ifq, m)
-
-#if defined(__GNUC__) && defined(MT_HEADER)
-static inline int
-if_queue_drop(struct ifqueue *ifq, struct mbuf *m)
-{
- IF_DROP(ifq);
- return 0;
-}
-
-static inline int
-if_enq_drop(struct ifqueue *ifq, struct mbuf *m)
-{
- if (IF_QFULL(ifq) &&
- !if_queue_drop(ifq, m))
- return 0;
- IF_ENQUEUE(ifq, m);
- return 1;
-}
-#else
-
-#ifdef MT_HEADER
-int if_enq_drop __P((struct ifqueue *, struct mbuf *));
-#endif
-
-#endif
-#endif /* KERNEL */
-
-#define IFQ_MAXLEN 50
-#define IFNET_SLOWHZ 1 /* granularity is 1 second */
-
-/*
- * The ifaddr structure contains information about one address
- * of an interface. They are maintained by the different address families,
- * are allocated and attached when an address is set, and are linked
- * together so all addresses for an interface can be located.
- */
-struct ifaddr {
- struct sockaddr *ifa_addr; /* address of interface */
- struct sockaddr *ifa_dstaddr; /* other end of p-to-p link */
-#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */
- struct sockaddr *ifa_netmask; /* used to determine subnet */
- struct ifnet *ifa_ifp; /* back-pointer to interface */
- struct ifaddr *ifa_next; /* next address for interface */
- void (*ifa_rtrequest) /* check or clean routes (+ or -)'d */
- __P((int, struct rtentry *, struct sockaddr *));
- u_short ifa_flags; /* mostly rt_flags for cloning */
- short ifa_refcnt; /* references to this structure */
- int ifa_metric; /* cost of going out this interface */
-#ifdef notdef
- struct rtentry *ifa_rt; /* XXXX for ROUTETOIF ????? */
-#endif
- int (*ifa_claim_addr) /* check if an addr goes to this if */
- __P((struct ifaddr *, struct sockaddr *));
-
-};
-#define IFA_ROUTE RTF_UP /* route installed */
-
-/*
- * Message format for use in obtaining information about interfaces
- * from getkerninfo and the routing socket
- */
-struct if_msghdr {
- u_short ifm_msglen; /* to skip over non-understood messages */
- u_char ifm_version; /* future binary compatability */
- u_char ifm_type; /* message type */
- int ifm_addrs; /* like rtm_addrs */
- int ifm_flags; /* value of if_flags */
- u_short ifm_index; /* index for associated ifp */
- struct if_data ifm_data;/* statistics and other data about if */
-};
-
-/*
- * Message format for use in obtaining information about interface addresses
- * from getkerninfo and the routing socket
- */
-struct ifa_msghdr {
- u_short ifam_msglen; /* to skip over non-understood messages */
- u_char ifam_version; /* future binary compatability */
- u_char ifam_type; /* message type */
- int ifam_addrs; /* like rtm_addrs */
- int ifam_flags; /* value of ifa_flags */
- u_short ifam_index; /* index for associated ifp */
- int ifam_metric; /* value of ifa_metric */
-};
-
-/*
- * Interface request structure used for socket
- * ioctl's. All interface ioctl's must have parameter
- * definitions which begin with ifr_name. The
- * remainder may be interface specific.
- */
-struct ifreq {
-#define IFNAMSIZ 16
- char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- union {
- struct sockaddr ifru_addr;
- struct sockaddr ifru_dstaddr;
- struct sockaddr ifru_broadaddr;
- short ifru_flags;
- int ifru_metric;
- int ifru_mtu;
- int ifru_phys;
- int ifru_media;
- caddr_t ifru_data;
- } ifr_ifru;
-#define ifr_addr ifr_ifru.ifru_addr /* address */
-#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
-#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
-#define ifr_flags ifr_ifru.ifru_flags /* flags */
-#define ifr_metric ifr_ifru.ifru_metric /* metric */
-#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
-#define ifr_phys ifr_ifru.ifru_phys /* physical wire */
-#define ifr_media ifr_ifru.ifru_media /* physical media */
-#define ifr_data ifr_ifru.ifru_data /* for use by interface */
-};
-
-struct ifaliasreq {
- char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- struct sockaddr ifra_addr;
- struct sockaddr ifra_broadaddr;
- struct sockaddr ifra_mask;
-};
-
-struct ifmediareq {
- char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- int ifm_current; /* current media options */
- int ifm_mask; /* don't care mask */
- int ifm_status; /* media status */
- int ifm_active; /* active options */
- int ifm_count; /* # entries in ifm_ulist array */
- int *ifm_ulist; /* media words */
-};
-/*
- * Structure used in SIOCGIFCONF request.
- * Used to retrieve interface configuration
- * for machine (useful for programs which
- * must know all networks accessible).
- */
-struct ifconf {
- int ifc_len; /* size of associated buffer */
- union {
- caddr_t ifcu_buf;
- struct ifreq *ifcu_req;
- } ifc_ifcu;
-#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
-#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
-};
-
-#include <net/if_arp.h>
-
-#ifdef KERNEL
-#define IFAFREE(ifa) \
- if ((ifa)->ifa_refcnt <= 0) \
- ifafree(ifa); \
- else \
- (ifa)->ifa_refcnt--;
-
-extern struct ifnet *ifnet;
-extern int ifqmaxlen;
-extern struct ifnet loif[];
-extern int if_index;
-extern struct ifaddr **ifnet_addrs;
-
-void ether_ifattach __P((struct ifnet *));
-void ether_input __P((struct ifnet *, struct ether_header *, struct mbuf *));
-int ether_output __P((struct ifnet *,
- struct mbuf *, struct sockaddr *, struct rtentry *));
-int ether_ioctl __P((struct ifnet *, int , caddr_t ));
-
-void if_attach __P((struct ifnet *));
-void if_down __P((struct ifnet *));
-void if_up __P((struct ifnet *));
-#ifdef vax
-void ifubareset __P((int));
-#endif
-/*void ifinit __P((void));*/ /* declared in systm.h for main() */
-int ifioctl __P((struct socket *, int, caddr_t, struct proc *));
-int ifpromisc __P((struct ifnet *, int));
-struct ifnet *ifunit __P((char *));
-
-int if_poll_recv_slow __P((struct ifnet *ifp, int *quotap));
-void if_poll_xmit_slow __P((struct ifnet *ifp, int *quotap));
-void if_poll_throttle __P((void));
-void if_poll_unthrottle __P((void *));
-void if_poll_init __P((void));
-void if_poll __P((void));
-
-struct ifaddr *ifa_ifwithaddr __P((struct sockaddr *));
-struct ifaddr *ifa_ifwithdstaddr __P((struct sockaddr *));
-struct ifaddr *ifa_ifwithnet __P((struct sockaddr *));
-struct ifaddr *ifa_ifwithroute __P((int, struct sockaddr *,
- struct sockaddr *));
-struct ifaddr *ifaof_ifpforaddr __P((struct sockaddr *, struct ifnet *));
-void ifafree __P((struct ifaddr *));
-
-int looutput __P((struct ifnet *,
- struct mbuf *, struct sockaddr *, struct rtentry *));
-#endif /* KERNEL */
-
-#endif /* !_NET_IF_H_ */
diff --git a/c/src/lib/libnetworking/net/if_arp.h b/c/src/lib/libnetworking/net/if_arp.h
deleted file mode 100644
index dd726bf856..0000000000
--- a/c/src/lib/libnetworking/net/if_arp.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 1986, 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.
- *
- * @(#)if_arp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_ARP_H_
-#define _NET_IF_ARP_H_
-
-/*
- * Address Resolution Protocol.
- *
- * See RFC 826 for protocol description. ARP packets are variable
- * in size; the arphdr structure defines the fixed-length portion.
- * Protocol type values are the same as those for 10 Mb/s Ethernet.
- * It is followed by the variable-sized fields ar_sha, arp_spa,
- * arp_tha and arp_tpa in that order, according to the lengths
- * specified. Field names used correspond to RFC 826.
- */
-struct arphdr {
- u_short ar_hrd; /* format of hardware address */
-#define ARPHRD_ETHER 1 /* ethernet hardware format */
-#define ARPHRD_FRELAY 15 /* frame relay hardware format */
- u_short ar_pro; /* format of protocol address */
- u_char ar_hln; /* length of hardware address */
- u_char ar_pln; /* length of protocol address */
- u_short ar_op; /* one of: */
-#define ARPOP_REQUEST 1 /* request to resolve address */
-#define ARPOP_REPLY 2 /* response to previous request */
-#define ARPOP_REVREQUEST 3 /* request protocol address given hardware */
-#define ARPOP_REVREPLY 4 /* response giving protocol address */
-#define ARPOP_INVREQUEST 8 /* request to identify peer */
-#define ARPOP_INVREPLY 9 /* response identifying peer */
-/*
- * The remaining fields are variable in size,
- * according to the sizes above.
- */
-#ifdef COMMENT_ONLY
- u_char ar_sha[]; /* sender hardware address */
- u_char ar_spa[]; /* sender protocol address */
- u_char ar_tha[]; /* target hardware address */
- u_char ar_tpa[]; /* target protocol address */
-#endif
-};
-
-/*
- * ARP ioctl request
- */
-struct arpreq {
- struct sockaddr arp_pa; /* protocol address */
- struct sockaddr arp_ha; /* hardware address */
- int arp_flags; /* flags */
-};
-/* arp_flags and at_flags field values */
-#define ATF_INUSE 0x01 /* entry in use */
-#define ATF_COM 0x02 /* completed entry (enaddr valid) */
-#define ATF_PERM 0x04 /* permanent entry */
-#define ATF_PUBL 0x08 /* publish entry (respond for other host) */
-#define ATF_USETRAILERS 0x10 /* has requested trailers */
-
-#endif /* !_NET_IF_ARP_H_ */
diff --git a/c/src/lib/libnetworking/net/if_dl.h b/c/src/lib/libnetworking/net/if_dl.h
deleted file mode 100644
index 053ae3e92f..0000000000
--- a/c/src/lib/libnetworking/net/if_dl.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 1990, 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.
- *
- * @(#)if_dl.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_DL_H_
-#define _NET_IF_DL_H_
-
-/*
- * A Link-Level Sockaddr may specify the interface in one of two
- * ways: either by means of a system-provided index number (computed
- * anew and possibly differently on every reboot), or by a human-readable
- * string such as "il0" (for managerial convenience).
- *
- * Census taking actions, such as something akin to SIOCGCONF would return
- * both the index and the human name.
- *
- * High volume transactions (such as giving a link-level ``from'' address
- * in a recvfrom or recvmsg call) may be likely only to provide the indexed
- * form, (which requires fewer copy operations and less space).
- *
- * The form and interpretation of the link-level address is purely a matter
- * of convention between the device driver and its consumers; however, it is
- * expected that all drivers for an interface of a given if_type will agree.
- */
-
-/*
- * Structure of a Link-Level sockaddr:
- */
-struct sockaddr_dl {
- u_char sdl_len; /* Total length of sockaddr */
- u_char sdl_family; /* AF_DLI */
- u_short sdl_index; /* if != 0, system given index for interface */
- u_char sdl_type; /* interface type */
- u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */
- u_char sdl_alen; /* link level address length */
- u_char sdl_slen; /* link layer selector length */
- char sdl_data[12]; /* minimum work area, can be larger;
- contains both if name and ll address */
-};
-
-#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-void link_addr __P((const char *, struct sockaddr_dl *));
-char *link_ntoa __P((const struct sockaddr_dl *));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif
diff --git a/c/src/lib/libnetworking/net/if_ethersubr.c b/c/src/lib/libnetworking/net/if_ethersubr.c
deleted file mode 100644
index 4d1675ca3c..0000000000
--- a/c/src/lib/libnetworking/net/if_ethersubr.c
+++ /dev/null
@@ -1,988 +0,0 @@
-/*
- * Copyright (c) 1982, 1989, 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.
- *
- * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/netisr.h>
-#include <net/route.h>
-#include <net/if_llc.h>
-#include <net/if_dl.h>
-#include <net/if_types.h>
-#include <net/ethernet.h>
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#endif
-#include <netinet/if_ether.h>
-
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
-#ifdef NS
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-ushort ns_nettype;
-int ether_outputdebug = 0;
-int ether_inputdebug = 0;
-#endif
-
-#ifdef ISO
-#include <netiso/argo_debug.h>
-#include <netiso/iso.h>
-#include <netiso/iso_var.h>
-#include <netiso/iso_snpac.h>
-#endif
-
-/*#ifdef LLC
-#include <netccitt/dll.h>
-#include <netccitt/llc_var.h>
-#endif*/
-
-#if defined(LLC) && defined(CCITT)
-extern struct ifqueue pkintrq;
-#endif
-
-#ifdef NETATALK
-#include <netatalk/at.h>
-#include <netatalk/at_var.h>
-#include <netatalk/at_extern.h>
-
-#define llc_snap_org_code llc_un.type_snap.org_code
-#define llc_snap_ether_type llc_un.type_snap.ether_type
-
-extern u_char at_org_code[ 3 ];
-extern u_char aarp_org_code[ 3 ];
-#endif NETATALK
-
-u_char etherbroadcastaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-#define senderr(e) { error = (e); goto bad;}
-
-/*
- * Ethernet output routine.
- * Encapsulate a packet of type family for the local net.
- * Use trailer local net encapsulation if enough data in first
- * packet leaves a multiple of 512 bytes of data in remainder.
- * Assumes that ifp is actually pointer to arpcom structure.
- */
-int
-ether_output(ifp, m0, dst, rt0)
- register struct ifnet *ifp;
- struct mbuf *m0;
- struct sockaddr *dst;
- struct rtentry *rt0;
-{
- short type;
- int s, error = 0;
-#ifdef NS
- u_char *cp
- register struct ifqueue *inq;
- register struct mbuf *m2;
-#endif
- u_char edst[6];
- register struct mbuf *m = m0;
- register struct rtentry *rt;
- struct mbuf *mcopy = (struct mbuf *)0;
- register struct ether_header *eh;
- int off, len = m->m_pkthdr.len;
- struct arpcom *ac = (struct arpcom *)ifp;
-#ifdef NETATALK
- struct at_ifaddr *aa;
-#endif NETATALK
-
- if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
- senderr(ENETDOWN);
- rt = rt0;
- if (rt) {
- if ((rt->rt_flags & RTF_UP) == 0) {
- rt0 = rt = rtalloc1(dst, 1, 0UL);
- if (rt0)
- rt->rt_refcnt--;
- else
- senderr(EHOSTUNREACH);
- }
- if (rt->rt_flags & RTF_GATEWAY) {
- if (rt->rt_gwroute == 0)
- goto lookup;
- if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) {
- rtfree(rt); rt = rt0;
- lookup: rt->rt_gwroute = rtalloc1(rt->rt_gateway, 1,
- 0UL);
- if ((rt = rt->rt_gwroute) == 0)
- senderr(EHOSTUNREACH);
- }
- }
- if (rt->rt_flags & RTF_REJECT)
- if (rt->rt_rmx.rmx_expire == 0 ||
- rtems_bsdnet_seconds_since_boot() < rt->rt_rmx.rmx_expire)
- senderr(rt == rt0 ? EHOSTDOWN : EHOSTUNREACH);
- }
- switch (dst->sa_family) {
-
-#ifdef INET
- case AF_INET:
- if (!arpresolve(ac, rt, m, dst, edst, rt0))
- return (0); /* if not yet resolved */
- /* If broadcasting on a simplex interface, loopback a copy */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- off = m->m_pkthdr.len - m->m_len;
- type = htons(ETHERTYPE_IP);
- break;
-#endif
-#ifdef IPX
- case AF_IPX:
- {
- struct ifaddr *ia;
-
- type = htons(ETHERTYPE_IPX);
- bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host),
- (caddr_t)edst, sizeof (edst));
- for (ia = ifp->if_addrlist; ia != NULL; ia = ia->ifa_next)
- if(ia->ifa_addr->sa_family == AF_IPX &&
- !bcmp((caddr_t)edst,
- (caddr_t)&((struct ipx_ifaddr *)ia)->ia_addr.sipx_addr.x_host,
- sizeof(edst)))
- return (looutput(ifp, m, dst, rt));
- /* If broadcasting on a simplex interface, loopback a copy */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- break;
- }
-#endif
-#ifdef NETATALK
- case AF_APPLETALK:
- {
- struct sockaddr_at *sat = (struct sockaddr_at *)dst;
-
- /*
- * super hack..
- * Most of this loopback code should move into the appletalk
- * code, but it's here for now.. remember to move it! [JRE]
- * This may not get the same interface we started with
- * fix asap. XXX
- */
- aa = at_ifawithnet( sat );
- if (aa == NULL) {
- goto bad;
- }
- if( aa->aa_ifa.ifa_ifp != ifp ) {
- (*aa->aa_ifa.ifa_ifp->if_output)(aa->aa_ifa.ifa_ifp,
- m,dst,rt);
- }
- if (((sat->sat_addr.s_net == ATADDR_ANYNET)
- && (sat->sat_addr.s_node == ATADDR_ANYNODE))
- || ((sat->sat_addr.s_net == aa->aa_addr.sat_addr.s_net )
- && (sat->sat_addr.s_node == aa->aa_addr.sat_addr.s_node))) {
- (void) looutput(ifp, m, dst, rt);
- return(0);
- }
-
- if (!aarpresolve(ac, m, (struct sockaddr_at *)dst, edst)) {
-#ifdef NETATALKDEBUG
- extern char *prsockaddr(struct sockaddr *);
- printf("aarpresolv: failed for %s\n", prsockaddr(dst));
-#endif NETATALKDEBUG
- return (0);
- }
-
- /*
- * If broadcasting on a simplex interface, loopback a copy
- */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- }
- /*
- * In the phase 2 case, we need to prepend an mbuf for the llc header.
- * Since we must preserve the value of m, which is passed to us by
- * value, we m_copy() the first mbuf, and use it for our llc header.
- */
- if ( aa->aa_flags & AFA_PHASE2 ) {
- struct llc llc;
-
- M_PREPEND(m, sizeof(struct llc), M_WAIT);
- len += sizeof(struct llc);
- llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP;
- llc.llc_control = LLC_UI;
- bcopy(at_org_code, llc.llc_snap_org_code, sizeof(at_org_code));
- llc.llc_snap_ether_type = htons( ETHERTYPE_AT );
- bcopy(&llc, mtod(m, caddr_t), sizeof(struct llc));
- type = htons(m->m_pkthdr.len);
- } else {
- type = htons(ETHERTYPE_AT);
- }
- break;
-#endif NETATALK
-#ifdef NS
- case AF_NS:
- switch(ns_nettype){
- default:
- case 0x8137: /* Novell Ethernet_II Ethernet TYPE II */
- type = 0x8137;
- break;
- case 0x0: /* Novell 802.3 */
- type = htons( m->m_pkthdr.len);
- break;
- case 0xe0e0: /* Novell 802.2 and Token-Ring */
- M_PREPEND(m, 3, M_WAIT);
- type = htons( m->m_pkthdr.len);
- cp = mtod(m, u_char *);
- *cp++ = 0xE0;
- *cp++ = 0xE0;
- *cp++ = 0x03;
- break;
- }
- bcopy((caddr_t)&(((struct sockaddr_ns *)dst)->sns_addr.x_host),
- (caddr_t)edst, sizeof (edst));
- if (!bcmp((caddr_t)edst, (caddr_t)&ns_thishost, sizeof(edst))){
- m->m_pkthdr.rcvif = ifp;
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- s = splimp();
- if (IF_QFULL(inq)) {
- IF_DROP(inq);
- m_freem(m);
- } else
- IF_ENQUEUE(inq, m);
- splx(s);
- return (error);
- }
- if (!bcmp((caddr_t)edst, (caddr_t)&ns_broadhost, sizeof(edst))){
- m2 = m_copy(m, 0, (int)M_COPYALL);
- m2->m_pkthdr.rcvif = ifp;
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- s = splimp();
- if (IF_QFULL(inq)) {
- IF_DROP(inq);
- m_freem(m2);
- } else
- IF_ENQUEUE(inq, m2);
- splx(s);
- }
- /* If broadcasting on a simplex interface, loopback a copy */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX)){
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- }
- break;
-#endif /* NS */
-#ifdef ISO
- case AF_ISO: {
- int snpalen;
- struct llc *l;
- register struct sockaddr_dl *sdl;
-
- if (rt && (sdl = (struct sockaddr_dl *)rt->rt_gateway) &&
- sdl->sdl_family == AF_LINK && sdl->sdl_alen > 0) {
- bcopy(LLADDR(sdl), (caddr_t)edst, sizeof(edst));
- } else if (error =
- iso_snparesolve(ifp, (struct sockaddr_iso *)dst,
- (char *)edst, &snpalen))
- goto bad; /* Not Resolved */
- /* If broadcasting on a simplex interface, loopback a copy */
- if (*edst & 1)
- m->m_flags |= (M_BCAST|M_MCAST);
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX) &&
- (mcopy = m_copy(m, 0, (int)M_COPYALL))) {
- M_PREPEND(mcopy, sizeof (*eh), M_DONTWAIT);
- if (mcopy) {
- eh = mtod(mcopy, struct ether_header *);
- bcopy((caddr_t)edst,
- (caddr_t)eh->ether_dhost, sizeof (edst));
- bcopy((caddr_t)ac->ac_enaddr,
- (caddr_t)eh->ether_shost, sizeof (edst));
- }
- }
- M_PREPEND(m, 3, M_DONTWAIT);
- if (m == NULL)
- return (0);
- type = htons(m->m_pkthdr.len);
- l = mtod(m, struct llc *);
- l->llc_dsap = l->llc_ssap = LLC_ISO_LSAP;
- l->llc_control = LLC_UI;
- len += 3;
- IFDEBUG(D_ETHER)
- int i;
- printf("unoutput: sending pkt to: ");
- for (i=0; i<6; i++)
- printf("%x ", edst[i] & 0xff);
- printf("\n");
- ENDDEBUG
- } break;
-#endif /* ISO */
-#ifdef LLC
-/* case AF_NSAP: */
- case AF_CCITT: {
- register struct sockaddr_dl *sdl =
- (struct sockaddr_dl *) rt -> rt_gateway;
-
- if (sdl && sdl->sdl_family == AF_LINK
- && sdl->sdl_alen > 0) {
- bcopy(LLADDR(sdl), (char *)edst,
- sizeof(edst));
- } else goto bad; /* Not a link interface ? Funny ... */
- if ((ifp->if_flags & IFF_SIMPLEX) && (*edst & 1) &&
- (mcopy = m_copy(m, 0, (int)M_COPYALL))) {
- M_PREPEND(mcopy, sizeof (*eh), M_DONTWAIT);
- if (mcopy) {
- eh = mtod(mcopy, struct ether_header *);
- bcopy((caddr_t)edst,
- (caddr_t)eh->ether_dhost, sizeof (edst));
- bcopy((caddr_t)ac->ac_enaddr,
- (caddr_t)eh->ether_shost, sizeof (edst));
- }
- }
- type = htons(m->m_pkthdr.len);
-#ifdef LLC_DEBUG
- {
- int i;
- register struct llc *l = mtod(m, struct llc *);
-
- printf("ether_output: sending LLC2 pkt to: ");
- for (i=0; i<6; i++)
- printf("%x ", edst[i] & 0xff);
- printf(" len 0x%x dsap 0x%x ssap 0x%x control 0x%x\n",
- type & 0xff, l->llc_dsap & 0xff, l->llc_ssap &0xff,
- l->llc_control & 0xff);
-
- }
-#endif /* LLC_DEBUG */
- } break;
-#endif /* LLC */
-
- case AF_UNSPEC:
- eh = (struct ether_header *)dst->sa_data;
- (void)memcpy(edst, eh->ether_dhost, sizeof (edst));
- type = eh->ether_type;
- break;
-
- default:
- printf("%s%d: can't handle af%d\n", ifp->if_name, ifp->if_unit,
- dst->sa_family);
- senderr(EAFNOSUPPORT);
- }
-
-
- if (mcopy)
- (void) looutput(ifp, mcopy, dst, rt);
- /*
- * Add local net header. If no space in first mbuf,
- * allocate another.
- */
- M_PREPEND(m, sizeof (struct ether_header), M_DONTWAIT);
- if (m == 0)
- senderr(ENOBUFS);
- eh = mtod(m, struct ether_header *);
- (void)memcpy(&eh->ether_type, &type,
- sizeof(eh->ether_type));
- (void)memcpy(eh->ether_dhost, edst, sizeof (edst));
- (void)memcpy(eh->ether_shost, ac->ac_enaddr,
- sizeof(eh->ether_shost));
- s = splimp();
- /*
- * Queue message on interface, and start output if interface
- * not yet active.
- */
- if (IF_QFULL(&ifp->if_snd)) {
- IF_DROP(&ifp->if_snd);
- splx(s);
- senderr(ENOBUFS);
- }
- IF_ENQUEUE(&ifp->if_snd, m);
- if ((ifp->if_flags & IFF_OACTIVE) == 0)
- (*ifp->if_start)(ifp);
- splx(s);
- ifp->if_obytes += len + sizeof (struct ether_header);
- if (m->m_flags & M_MCAST)
- ifp->if_omcasts++;
- return (error);
-
-bad:
- if (m)
- m_freem(m);
- return (error);
-}
-
-/*
- * Process a received Ethernet packet;
- * the packet is in the mbuf chain m without
- * the ether header, which is provided separately.
- */
-void
-ether_input(ifp, eh, m)
- struct ifnet *ifp;
- register struct ether_header *eh;
- struct mbuf *m;
-{
- register struct ifqueue *inq;
- u_short ether_type;
-#ifdef NS
- u_short *checksum;
-#endif
- int s;
-#if defined (ISO) || defined (LLC) || defined(NETATALK)
- register struct llc *l;
-#endif
-
- if ((ifp->if_flags & IFF_UP) == 0) {
- m_freem(m);
- return;
- }
- ifp->if_ibytes += m->m_pkthdr.len + sizeof (*eh);
- if (bcmp((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
- sizeof(etherbroadcastaddr)) == 0)
- m->m_flags |= M_BCAST;
- else if (eh->ether_dhost[0] & 1)
- m->m_flags |= M_MCAST;
- if (m->m_flags & (M_BCAST|M_MCAST))
- ifp->if_imcasts++;
-
- ether_type = ntohs(eh->ether_type);
-
- switch (ether_type) {
-#ifdef INET
- case ETHERTYPE_IP:
- schednetisr(NETISR_IP);
- inq = &ipintrq;
- break;
-
- case ETHERTYPE_ARP:
- schednetisr(NETISR_ARP);
- inq = &arpintrq;
- break;
-#endif
-#ifdef IPX
- case ETHERTYPE_IPX:
- schednetisr(NETISR_IPX);
- inq = &ipxintrq;
- break;
-#endif
-#ifdef NS
- case 0x8137: /* Novell Ethernet_II Ethernet TYPE II */
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- break;
-
-#endif /* NS */
-#ifdef NETATALK
- case ETHERTYPE_AT:
- schednetisr(NETISR_ATALK);
- inq = &atintrq1;
- break;
- case ETHERTYPE_AARP:
- /* probably this should be done with a NETISR as well */
- aarpinput((struct arpcom *)ifp, m); /* XXX */
- return;
-#endif NETATALK
- default:
-#ifdef NS
- checksum = mtod(m, ushort *);
- /* Novell 802.3 */
- if ((ether_type <= ETHERMTU) &&
- ((*checksum == 0xffff) || (*checksum == 0xE0E0))){
- if(*checksum == 0xE0E0) {
- m->m_pkthdr.len -= 3;
- m->m_len -= 3;
- m->m_data += 3;
- }
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- break;
- }
-#endif /* NS */
-#if defined (ISO) || defined (LLC) || defined(NETATALK)
- if (ether_type > ETHERMTU)
- goto dropanyway;
- l = mtod(m, struct llc *);
- switch (l->llc_dsap) {
-#ifdef NETATALK
- case LLC_SNAP_LSAP:
- switch (l->llc_control) {
- case LLC_UI:
- if (l->llc_ssap != LLC_SNAP_LSAP)
- goto dropanyway;
-
- if (Bcmp(&(l->llc_snap_org_code)[0], at_org_code,
- sizeof(at_org_code)) == 0 &&
- ntohs(l->llc_snap_ether_type) == ETHERTYPE_AT) {
- inq = &atintrq2;
- m_adj( m, sizeof( struct llc ));
- schednetisr(NETISR_ATALK);
- break;
- }
-
- if (Bcmp(&(l->llc_snap_org_code)[0], aarp_org_code,
- sizeof(aarp_org_code)) == 0 &&
- ntohs(l->llc_snap_ether_type) == ETHERTYPE_AARP) {
- m_adj( m, sizeof( struct llc ));
- aarpinput((struct arpcom *)ifp, m); /* XXX */
- return;
- }
-
- default:
- goto dropanyway;
- }
- break;
-#endif NETATALK
-#ifdef ISO
- case LLC_ISO_LSAP:
- switch (l->llc_control) {
- case LLC_UI:
- /* LLC_UI_P forbidden in class 1 service */
- if ((l->llc_dsap == LLC_ISO_LSAP) &&
- (l->llc_ssap == LLC_ISO_LSAP)) {
- /* LSAP for ISO */
- if (m->m_pkthdr.len > ether_type)
- m_adj(m, ether_type - m->m_pkthdr.len);
- m->m_data += 3; /* XXX */
- m->m_len -= 3; /* XXX */
- m->m_pkthdr.len -= 3; /* XXX */
- M_PREPEND(m, sizeof *eh, M_DONTWAIT);
- if (m == 0)
- return;
- *mtod(m, struct ether_header *) = *eh;
- IFDEBUG(D_ETHER)
- printf("clnp packet");
- ENDDEBUG
- schednetisr(NETISR_ISO);
- inq = &clnlintrq;
- break;
- }
- goto dropanyway;
-
- case LLC_XID:
- case LLC_XID_P:
- if(m->m_len < 6)
- goto dropanyway;
- l->llc_window = 0;
- l->llc_fid = 9;
- l->llc_class = 1;
- l->llc_dsap = l->llc_ssap = 0;
- /* Fall through to */
- case LLC_TEST:
- case LLC_TEST_P:
- {
- struct sockaddr sa;
- register struct ether_header *eh2;
- int i;
- u_char c = l->llc_dsap;
-
- l->llc_dsap = l->llc_ssap;
- l->llc_ssap = c;
- if (m->m_flags & (M_BCAST | M_MCAST))
- bcopy((caddr_t)ac->ac_enaddr,
- (caddr_t)eh->ether_dhost, 6);
- sa.sa_family = AF_UNSPEC;
- sa.sa_len = sizeof(sa);
- eh2 = (struct ether_header *)sa.sa_data;
- for (i = 0; i < 6; i++) {
- eh2->ether_shost[i] = c = eh->ether_dhost[i];
- eh2->ether_dhost[i] =
- eh->ether_dhost[i] = eh->ether_shost[i];
- eh->ether_shost[i] = c;
- }
- ifp->if_output(ifp, m, &sa, NULL);
- return;
- }
- default:
- m_freem(m);
- return;
- }
- break;
-#endif /* ISO */
-#ifdef LLC
- case LLC_X25_LSAP:
- {
- if (m->m_pkthdr.len > ether_type)
- m_adj(m, ether_type - m->m_pkthdr.len);
- M_PREPEND(m, sizeof(struct sdl_hdr) , M_DONTWAIT);
- if (m == 0)
- return;
- if ( !sdl_sethdrif(ifp, eh->ether_shost, LLC_X25_LSAP,
- eh->ether_dhost, LLC_X25_LSAP, 6,
- mtod(m, struct sdl_hdr *)))
- panic("ETHER cons addr failure");
- mtod(m, struct sdl_hdr *)->sdlhdr_len = ether_type;
-#ifdef LLC_DEBUG
- printf("llc packet\n");
-#endif /* LLC_DEBUG */
- schednetisr(NETISR_CCITT);
- inq = &llcintrq;
- break;
- }
-#endif /* LLC */
- dropanyway:
- default:
- m_freem(m);
- return;
- }
-#else /* ISO || LLC || NETATALK */
- m_freem(m);
- return;
-#endif /* ISO || LLC || NETATALK */
- }
-
- s = splimp();
- if (IF_QFULL(inq)) {
- IF_DROP(inq);
- m_freem(m);
- } else
- IF_ENQUEUE(inq, m);
- splx(s);
-}
-
-/*
- * Perform common duties while attaching to interface list
- */
-void
-ether_ifattach(ifp)
- register struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
- register struct sockaddr_dl *sdl;
-
- ifp->if_type = IFT_ETHER;
- ifp->if_addrlen = 6;
- ifp->if_hdrlen = 14;
- ifp->if_mtu = ETHERMTU;
- if (ifp->if_baudrate == 0)
- ifp->if_baudrate = 10000000;
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- if ((sdl = (struct sockaddr_dl *)ifa->ifa_addr) &&
- sdl->sdl_family == AF_LINK) {
- sdl->sdl_type = IFT_ETHER;
- sdl->sdl_alen = ifp->if_addrlen;
- bcopy((caddr_t)((struct arpcom *)ifp)->ac_enaddr,
- LLADDR(sdl), ifp->if_addrlen);
- break;
- }
-}
-
-static u_char ether_ipmulticast_min[6] =
- { 0x01, 0x00, 0x5e, 0x00, 0x00, 0x00 };
-static u_char ether_ipmulticast_max[6] =
- { 0x01, 0x00, 0x5e, 0x7f, 0xff, 0xff };
-/*
- * Add an Ethernet multicast address or range of addresses to the list for a
- * given interface.
- */
-int
-ether_addmulti(ifr, ac)
- struct ifreq *ifr;
- register struct arpcom *ac;
-{
- register struct ether_multi *enm;
- struct sockaddr_in *sin;
- u_char addrlo[6];
- u_char addrhi[6];
- int set_allmulti = 0;
- int s = splimp();
-
- switch (ifr->ifr_addr.sa_family) {
-
- case AF_UNSPEC:
- bcopy(ifr->ifr_addr.sa_data, addrlo, 6);
- bcopy(addrlo, addrhi, 6);
- break;
-
-#ifdef INET
- case AF_INET:
- sin = (struct sockaddr_in *)&(ifr->ifr_addr);
- if (sin->sin_addr.s_addr == INADDR_ANY) {
- /*
- * An IP address of INADDR_ANY means listen to all
- * of the Ethernet multicast addresses used for IP.
- * (This is for the sake of IP multicast routers.)
- */
- bcopy(ether_ipmulticast_min, addrlo, 6);
- bcopy(ether_ipmulticast_max, addrhi, 6);
- set_allmulti = 1;
- }
- else {
- ETHER_MAP_IP_MULTICAST(&sin->sin_addr, addrlo);
- bcopy(addrlo, addrhi, 6);
- }
- break;
-#endif
-
- default:
- splx(s);
- return (EAFNOSUPPORT);
- }
-
- /*
- * Verify that we have valid Ethernet multicast addresses.
- */
- if ((addrlo[0] & 0x01) != 1 || (addrhi[0] & 0x01) != 1) {
- splx(s);
- return (EINVAL);
- }
- /*
- * See if the address range is already in the list.
- */
- ETHER_LOOKUP_MULTI(addrlo, addrhi, ac, enm);
- if (enm != NULL) {
- /*
- * Found it; just increment the reference count.
- */
- ++enm->enm_refcount;
- splx(s);
- return (0);
- }
- /*
- * New address or range; malloc a new multicast record
- * and link it into the interface's multicast list.
- */
- enm = (struct ether_multi *)malloc(sizeof(*enm), M_IFMADDR, M_NOWAIT);
- if (enm == NULL) {
- splx(s);
- return (ENOBUFS);
- }
- bcopy(addrlo, enm->enm_addrlo, 6);
- bcopy(addrhi, enm->enm_addrhi, 6);
- enm->enm_ac = ac;
- enm->enm_refcount = 1;
- enm->enm_next = ac->ac_multiaddrs;
- ac->ac_multiaddrs = enm;
- ac->ac_multicnt++;
- splx(s);
- if (set_allmulti)
- ac->ac_if.if_flags |= IFF_ALLMULTI;
-
- /*
- * Return ENETRESET to inform the driver that the list has changed
- * and its reception filter should be adjusted accordingly.
- */
- return (ENETRESET);
-}
-
-/*
- * Delete a multicast address record.
- */
-int
-ether_delmulti(ifr, ac)
- struct ifreq *ifr;
- register struct arpcom *ac;
-{
- register struct ether_multi *enm;
- register struct ether_multi **p;
- struct sockaddr_in *sin;
- u_char addrlo[6];
- u_char addrhi[6];
- int unset_allmulti = 0;
- int s = splimp();
-
- switch (ifr->ifr_addr.sa_family) {
-
- case AF_UNSPEC:
- bcopy(ifr->ifr_addr.sa_data, addrlo, 6);
- bcopy(addrlo, addrhi, 6);
- break;
-
-#ifdef INET
- case AF_INET:
- sin = (struct sockaddr_in *)&(ifr->ifr_addr);
- if (sin->sin_addr.s_addr == INADDR_ANY) {
- /*
- * An IP address of INADDR_ANY means stop listening
- * to the range of Ethernet multicast addresses used
- * for IP.
- */
- bcopy(ether_ipmulticast_min, addrlo, 6);
- bcopy(ether_ipmulticast_max, addrhi, 6);
- unset_allmulti = 1;
- }
- else {
- ETHER_MAP_IP_MULTICAST(&sin->sin_addr, addrlo);
- bcopy(addrlo, addrhi, 6);
- }
- break;
-#endif
-
- default:
- splx(s);
- return (EAFNOSUPPORT);
- }
-
- /*
- * Look up the address in our list.
- */
- ETHER_LOOKUP_MULTI(addrlo, addrhi, ac, enm);
- if (enm == NULL) {
- splx(s);
- return (ENXIO);
- }
- if (--enm->enm_refcount != 0) {
- /*
- * Still some claims to this record.
- */
- splx(s);
- return (0);
- }
- /*
- * No remaining claims to this record; unlink and free it.
- */
- for (p = &enm->enm_ac->ac_multiaddrs;
- *p != enm;
- p = &(*p)->enm_next)
- continue;
- *p = (*p)->enm_next;
- free(enm, M_IFMADDR);
- ac->ac_multicnt--;
- splx(s);
- if (unset_allmulti)
- ac->ac_if.if_flags &= ~IFF_ALLMULTI;
-
- /*
- * Return ENETRESET to inform the driver that the list has changed
- * and its reception filter should be adjusted accordingly.
- */
- return (ENETRESET);
-}
-
-SYSCTL_NODE(_net_link, IFT_ETHER, ether, CTLFLAG_RW, 0, "Ethernet");
-
-int
-ether_ioctl(struct ifnet *ifp, int command, caddr_t data)
-{
- struct ifaddr *ifa = (struct ifaddr *) data;
- struct ifreq *ifr = (struct ifreq *) data;
- int error = 0;
-
- switch (command) {
- case SIOCSIFADDR:
- ifp->if_flags |= IFF_UP;
-
- switch (ifa->ifa_addr->sa_family) {
-#ifdef INET
- case AF_INET:
- ifp->if_init(ifp->if_softc); /* before arpwhohas */
- arp_ifinit((struct arpcom *)ifp, ifa);
- break;
-#endif
-#ifdef IPX
- /*
- * XXX - This code is probably wrong
- */
- case AF_IPX:
- {
- register struct ipx_addr *ina = &(IA_SIPX(ifa)->sipx_addr);
- struct arpcom *ac = (struct arpcom *) (ifp->if_softc);
-
- if (ipx_nullhost(*ina))
- ina->x_host =
- *(union ipx_host *)
- ac->ac_enaddr;
- else {
- bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) ac->ac_enaddr,
- sizeof(ac->ac_enaddr));
- }
-
- /*
- * Set new address
- */
- ifp->if_init(ifp->if_softc);
- break;
- }
-#endif
-#ifdef NS
- /*
- * XXX - This code is probably wrong
- */
- case AF_NS:
- {
- register struct ns_addr *ina = &(IA_SNS(ifa)->sns_addr);
- struct arpcom *ac = (struct arpcom *) (ifp->if_softc);
-
- if (ns_nullhost(*ina))
- ina->x_host =
- *(union ns_host *) (ac->ac_enaddr);
- else {
- bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) ac->ac_enaddr,
- sizeof(ac->ac_enaddr));
- }
-
- /*
- * Set new address
- */
- ifp->if_init(ifp->if_softc);
- break;
- }
-#endif
- default:
- ifp->if_init(ifp->if_softc);
- break;
- }
- break;
-
- case SIOCGIFADDR:
- {
- struct sockaddr *sa;
-
- sa = (struct sockaddr *) & ifr->ifr_data;
- bcopy(((struct arpcom *)ifp->if_softc)->ac_enaddr,
- (caddr_t) sa->sa_data, ETHER_ADDR_LEN);
- }
- break;
-
- case SIOCSIFMTU:
- /*
- * Set the interface MTU.
- */
- if (ifr->ifr_mtu > ETHERMTU) {
- error = EINVAL;
- } else {
- ifp->if_mtu = ifr->ifr_mtu;
- }
- break;
- }
- return (error);
-}
diff --git a/c/src/lib/libnetworking/net/if_llc.h b/c/src/lib/libnetworking/net/if_llc.h
deleted file mode 100644
index 3cdf652167..0000000000
--- a/c/src/lib/libnetworking/net/if_llc.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * @(#)if_llc.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_LLC_H_
-#define _NET_IF_LLC_H_
-
-/*
- * IEEE 802.2 Link Level Control headers, for use in conjunction with
- * 802.{3,4,5} media access control methods.
- *
- * Headers here do not use bit fields due to shortcomings in many
- * compilers.
- */
-
-struct llc {
- u_char llc_dsap;
- u_char llc_ssap;
- union {
- struct {
- u_char control;
- u_char format_id;
- u_char class;
- u_char window_x2;
- } type_u;
- struct {
- u_char num_snd_x2;
- u_char num_rcv_x2;
- } type_i;
- struct {
- u_char control;
- u_char num_rcv_x2;
- } type_s;
- struct {
- u_char control;
- struct frmrinfo {
- u_char rej_pdu_0;
- u_char rej_pdu_1;
- u_char frmr_control;
- u_char frmr_control_ext;
- u_char frmr_cause;
- } frmrinfo;
- } type_frmr;
- struct {
- u_char control;
- u_char org_code[3];
- u_short ether_type;
- } type_snap;
- struct {
- u_char control;
- u_char control_ext;
- } type_raw;
- } llc_un;
-};
-#define llc_control llc_un.type_u.control
-#define llc_control_ext llc_un.type_raw.control_ext
-#define llc_fid llc_un.type_u.format_id
-#define llc_class llc_un.type_u.class
-#define llc_window llc_un.type_u.window_x2
-#define llc_frmrinfo llc_un.type_frmr.frmrinfo
-#define llc_frmr_pdu0 llc_un.type_frmr.frmrinfo.rej_pdu0
-#define llc_frmr_pdu1 llc_un.type_frmr.frmrinfo.rej_pdu1
-#define llc_frmr_control llc_un.type_frmr.frmrinfo.frmr_control
-#define llc_frmr_control_ext llc_un.type_frmr.frmrinfo.frmr_control_ext
-#define llc_frmr_cause llc_un.type_frmr.frmrinfo.frmr_control_ext
-
-/*
- * Don't use sizeof(struct llc_un) for LLC header sizes
- */
-#define LLC_ISFRAMELEN 4
-#define LLC_UFRAMELEN 3
-#define LLC_FRMRLEN 7
-
-/*
- * Unnumbered LLC format commands
- */
-#define LLC_UI 0x3
-#define LLC_UI_P 0x13
-#define LLC_DISC 0x43
-#define LLC_DISC_P 0x53
-#define LLC_UA 0x63
-#define LLC_UA_P 0x73
-#define LLC_TEST 0xe3
-#define LLC_TEST_P 0xf3
-#define LLC_FRMR 0x87
-#define LLC_FRMR_P 0x97
-#define LLC_DM 0x0f
-#define LLC_DM_P 0x1f
-#define LLC_XID 0xaf
-#define LLC_XID_P 0xbf
-#define LLC_SABME 0x6f
-#define LLC_SABME_P 0x7f
-
-/*
- * Supervisory LLC commands
- */
-#define LLC_RR 0x01
-#define LLC_RNR 0x05
-#define LLC_REJ 0x09
-
-/*
- * Info format - dummy only
- */
-#define LLC_INFO 0x00
-
-/*
- * ISO PDTR 10178 contains among others
- */
-#define LLC_X25_LSAP 0x7e
-#define LLC_SNAP_LSAP 0xaa
-#define LLC_ISO_LSAP 0xfe
-
-#endif
diff --git a/c/src/lib/libnetworking/net/if_loop.c b/c/src/lib/libnetworking/net/if_loop.c
deleted file mode 100644
index 3823c28744..0000000000
--- a/c/src/lib/libnetworking/net/if_loop.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)if_loop.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-/*
- * Loopback interface driver for protocol testing and timing.
- */
-#include "loop.h"
-#if NLOOP > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-
-#include <net/if.h>
-#include <net/if_types.h>
-#include <net/netisr.h>
-#include <net/route.h>
-#include <net/bpf.h>
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#endif
-
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
-#ifdef NS
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-#endif
-
-#ifdef ISO
-#include <netiso/iso.h>
-#include <netiso/iso_var.h>
-#endif
-
-#ifdef NETATALK
-#include <netinet/if_ether.h>
-#include <netatalk/at.h>
-#include <netatalk/at_var.h>
-#endif NETATALK
-
-#include "bpfilter.h"
-
-static int loioctl __P((struct ifnet *, int, caddr_t));
-static void lortrequest __P((int, struct rtentry *, struct sockaddr *));
-
- void rtems_bsdnet_loopattach __P((void *));
-PSEUDO_SET(loopattach, if_loop);
-
-#ifdef TINY_LOMTU
-#define LOMTU (1024+512)
-#else
-#define LOMTU 16384
-#endif
-
-struct ifnet loif[NLOOP];
-
-/* ARGSUSED */
-void
-rtems_bsdnet_loopattach(dummy)
- void *dummy;
-{
- register struct ifnet *ifp;
- register int i = 0;
-
- for (ifp = loif; i < NLOOP; ifp++) {
- ifp->if_name = "lo";
- ifp->if_next = NULL;
- ifp->if_unit = i++;
- ifp->if_mtu = LOMTU;
- ifp->if_flags = IFF_LOOPBACK | IFF_MULTICAST;
- ifp->if_ioctl = loioctl;
- ifp->if_output = looutput;
- ifp->if_type = IFT_LOOP;
- ifp->if_hdrlen = 0;
- ifp->if_addrlen = 0;
- if_attach(ifp);
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_NULL, sizeof(u_int));
-#endif
- }
-}
-
-int
-looutput(ifp, m, dst, rt)
- struct ifnet *ifp;
- register struct mbuf *m;
- struct sockaddr *dst;
- register struct rtentry *rt;
-{
- int s, isr;
- register struct ifqueue *ifq = 0;
-
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("looutput no HDR");
-#if NBPFILTER > 0
- /* BPF write needs to be handled specially */
- if (dst->sa_family == AF_UNSPEC) {
- dst->sa_family = *(mtod(m, int *));
- m->m_len -= sizeof(int);
- m->m_pkthdr.len -= sizeof(int);
- m->m_data += sizeof(int);
- }
-
- if (ifp->if_bpf) {
- /*
- * We need to prepend the address family as
- * a four byte field. Cons up a dummy header
- * to pacify bpf. This is safe because bpf
- * will only read from the mbuf (i.e., it won't
- * try to free it or keep a pointer a to it).
- */
- struct mbuf m0;
- u_int af = dst->sa_family;
-
- m0.m_next = m;
- m0.m_len = 4;
- m0.m_data = (char *)&af;
-
- bpf_mtap(ifp, &m0);
- }
-#endif
- m->m_pkthdr.rcvif = ifp;
-
- if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
- m_freem(m);
- return (rt->rt_flags & RTF_BLACKHOLE ? 0 :
- rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
- }
- ifp->if_opackets++;
- ifp->if_obytes += m->m_pkthdr.len;
- switch (dst->sa_family) {
-
-#ifdef INET
- case AF_INET:
- ifq = &ipintrq;
- isr = NETISR_IP;
- break;
-#endif
-#ifdef IPX
- case AF_IPX:
- ifq = &ipxintrq;
- isr = NETISR_IPX;
- break;
-#endif
-#ifdef NS
- case AF_NS:
- ifq = &nsintrq;
- isr = NETISR_NS;
- break;
-#endif
-#ifdef ISO
- case AF_ISO:
- ifq = &clnlintrq;
- isr = NETISR_ISO;
- break;
-#endif
-#ifdef NETATALK
- case AF_APPLETALK:
- ifq = &atintrq2;
- isr = NETISR_ATALK;
- break;
-#endif NETATALK
- default:
- printf("lo%d: can't handle af%d\n", ifp->if_unit,
- dst->sa_family);
- m_freem(m);
- return (EAFNOSUPPORT);
- }
- s = splimp();
- if (IF_QFULL(ifq)) {
- IF_DROP(ifq);
- m_freem(m);
- splx(s);
- return (ENOBUFS);
- }
- IF_ENQUEUE(ifq, m);
- schednetisr(isr);
- ifp->if_ipackets++;
- ifp->if_ibytes += m->m_pkthdr.len;
- splx(s);
- return (0);
-}
-
-/* ARGSUSED */
-static void
-lortrequest(cmd, rt, sa)
- int cmd;
- struct rtentry *rt;
- struct sockaddr *sa;
-{
- if (rt) {
- rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; /* for ISO */
- /*
- * For optimal performance, the send and receive buffers
- * should be at least twice the MTU plus a little more for
- * overhead.
- */
- rt->rt_rmx.rmx_recvpipe =
- rt->rt_rmx.rmx_sendpipe = 3 * LOMTU;
- }
-}
-
-/*
- * Process an ioctl request.
- */
-/* ARGSUSED */
-static int
-loioctl(ifp, cmd, data)
- register struct ifnet *ifp;
- int cmd;
- caddr_t data;
-{
- register struct ifaddr *ifa;
- register struct ifreq *ifr = (struct ifreq *)data;
- register int error = 0;
-
- switch (cmd) {
-
- case SIOCSIFADDR:
- ifp->if_flags |= IFF_UP | IFF_RUNNING;
- ifa = (struct ifaddr *)data;
- ifa->ifa_rtrequest = lortrequest;
- /*
- * Everything else is done at a higher level.
- */
- break;
-
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- if (ifr == 0) {
- error = EAFNOSUPPORT; /* XXX */
- break;
- }
- switch (ifr->ifr_addr.sa_family) {
-
-#ifdef INET
- case AF_INET:
- break;
-#endif
-
- default:
- error = EAFNOSUPPORT;
- break;
- }
- break;
-
- case SIOCSIFMTU:
- ifp->if_mtu = ifr->ifr_mtu;
- break;
-
- default:
- error = EINVAL;
- }
- return (error);
-}
-#endif /* NLOOP > 0 */
diff --git a/c/src/lib/libnetworking/net/if_types.h b/c/src/lib/libnetworking/net/if_types.h
deleted file mode 100644
index 833ba471c3..0000000000
--- a/c/src/lib/libnetworking/net/if_types.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 1989, 1993, 1994
- * 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.
- *
- * @(#)if_types.h 8.2 (Berkeley) 4/20/94
- * $Id$
- */
-
-#ifndef _NET_IF_TYPES_H_
-#define _NET_IF_TYPES_H_
-
-/*
- * Interface types for benefit of parsing media address headers.
- * This list is derived from the SNMP list of ifTypes, currently
- * documented in RFC1573.
- */
-
-#define IFT_OTHER 0x1 /* none of the following */
-#define IFT_1822 0x2 /* old-style arpanet imp */
-#define IFT_HDH1822 0x3 /* HDH arpanet imp */
-#define IFT_X25DDN 0x4 /* x25 to imp */
-#define IFT_X25 0x5 /* PDN X25 interface (RFC877) */
-#define IFT_ETHER 0x6 /* Ethernet CSMACD */
-#define IFT_ISO88023 0x7 /* CMSA CD */
-#define IFT_ISO88024 0x8 /* Token Bus */
-#define IFT_ISO88025 0x9 /* Token Ring */
-#define IFT_ISO88026 0xa /* MAN */
-#define IFT_STARLAN 0xb
-#define IFT_P10 0xc /* Proteon 10MBit ring */
-#define IFT_P80 0xd /* Proteon 80MBit ring */
-#define IFT_HY 0xe /* Hyperchannel */
-#define IFT_FDDI 0xf
-#define IFT_LAPB 0x10
-#define IFT_SDLC 0x11
-#define IFT_T1 0x12
-#define IFT_CEPT 0x13 /* E1 - european T1 */
-#define IFT_ISDNBASIC 0x14
-#define IFT_ISDNPRIMARY 0x15
-#define IFT_PTPSERIAL 0x16 /* Proprietary PTP serial */
-#define IFT_PPP 0x17 /* RFC 1331 */
-#define IFT_LOOP 0x18 /* loopback */
-#define IFT_EON 0x19 /* ISO over IP */
-#define IFT_XETHER 0x1a /* obsolete 3MB experimental ethernet */
-#define IFT_NSIP 0x1b /* XNS over IP */
-#define IFT_SLIP 0x1c /* IP over generic TTY */
-#define IFT_ULTRA 0x1d /* Ultra Technologies */
-#define IFT_DS3 0x1e /* Generic T3 */
-#define IFT_SIP 0x1f /* SMDS */
-#define IFT_FRELAY 0x20 /* Frame Relay DTE only */
-#define IFT_RS232 0x21
-#define IFT_PARA 0x22 /* parallel-port */
-#define IFT_ARCNET 0x23
-#define IFT_ARCNETPLUS 0x24
-#define IFT_ATM 0x25 /* ATM cells */
-#define IFT_MIOX25 0x26
-#define IFT_SONET 0x27 /* SONET or SDH */
-#define IFT_X25PLE 0x28
-#define IFT_ISO88022LLC 0x29
-#define IFT_LOCALTALK 0x2a
-#define IFT_SMDSDXI 0x2b
-#define IFT_FRELAYDCE 0x2c /* Frame Relay DCE */
-#define IFT_V35 0x2d
-#define IFT_HSSI 0x2e
-#define IFT_HIPPI 0x2f
-#define IFT_MODEM 0x30 /* Generic Modem */
-#define IFT_AAL5 0x31 /* AAL5 over ATM */
-#define IFT_SONETPATH 0x32
-#define IFT_SONETVT 0x33
-#define IFT_SMDSICIP 0x34 /* SMDS InterCarrier Interface */
-#define IFT_PROPVIRTUAL 0x35 /* Proprietary Virtual/internal */
-#define IFT_PROPMUX 0x36 /* Proprietary Multiplexing */
-
-#endif
diff --git a/c/src/lib/libnetworking/net/netisr.h b/c/src/lib/libnetworking/net/netisr.h
deleted file mode 100644
index 73269a4442..0000000000
--- a/c/src/lib/libnetworking/net/netisr.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 1989, 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.
- *
- * @(#)netisr.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_NETISR_H_
-#define _NET_NETISR_H_
-
-/*
- * The networking code runs off software interrupts.
- *
- * You can switch into the network by doing splnet() and return by splx().
- * The software interrupt level for the network is higher than the software
- * level for the clock (so you can enter the network in routines called
- * at timeout time).
- */
-#if defined(vax) || defined(tahoe)
-#define setsoftnet() mtpr(SIRR, 12)
-#endif
-
-/*
- * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status
- * word which is used to de-multiplex a single software
- * interrupt used for scheduling the network code to calls
- * on the lowest level routine of each protocol.
- */
-#define NETISR_RAW 0 /* same as AF_UNSPEC */
-#define NETISR_IP 2 /* same as AF_INET */
-#define NETISR_IMP 3 /* same as AF_IMPLINK */
-#define NETISR_NS 6 /* same as AF_NS */
-#define NETISR_ISO 7 /* same as AF_ISO */
-#define NETISR_CCITT 10 /* same as AF_CCITT */
-#define NETISR_ATALK 16 /* same as AF_APPLETALK */
-#define NETISR_ARP 18 /* same as AF_LINK */
-#define NETISR_IPX 23 /* same as AF_IPX */
-#define NETISR_ISDN 26 /* same as AF_E164 */
-#define NETISR_PPP 27 /* PPP soft interrupt */
-
-#define schednetisr(anisr) rtems_bsdnet_schednetisr(anisr)
-
-#ifndef LOCORE
-#ifdef KERNEL
-extern volatile unsigned int netisr; /* scheduling bits for network */
-
-typedef void netisr_t(void);
-
-struct netisrtab {
- int nit_num;
- netisr_t *nit_isr;
-};
-
-#define NETISR_SET(num, isr)
-
-int register_netisr __P((int, netisr_t *));
-
-#endif
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/net/radix.c b/c/src/lib/libnetworking/net/radix.c
deleted file mode 100644
index bc1b7ee1d1..0000000000
--- a/c/src/lib/libnetworking/net/radix.c
+++ /dev/null
@@ -1,1028 +0,0 @@
-/*
- * Copyright (c) 1988, 1989, 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.
- *
- * @(#)radix.c 8.4 (Berkeley) 11/2/94
- * $Id$
- */
-
-/*
- * Routines to build and maintain radix trees for routing lookups.
- */
-#ifndef _RADIX_H_
-#include <sys/param.h>
-#ifdef KERNEL
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#define M_DONTWAIT M_NOWAIT
-#include <sys/domain.h>
-#else
-#include <stdlib.h>
-#endif
-#include <sys/syslog.h>
-#include <net/radix.h>
-#endif
-
-static struct radix_node *
- rn_lookup __P((void *v_arg, void *m_arg,
- struct radix_node_head *head));
-static int rn_walktree_from __P((struct radix_node_head *h, void *a,
- void *m, walktree_f_t *f, void *w));
-static int rn_walktree __P((struct radix_node_head *, walktree_f_t *, void *));
-static struct radix_node
- *rn_delete __P((void *, void *, struct radix_node_head *)),
- *rn_insert __P((void *, struct radix_node_head *, int *,
- struct radix_node [2])),
- *rn_newpair __P((void *, int, struct radix_node[2])),
- *rn_search __P((void *, struct radix_node *)),
- *rn_search_m __P((void *, struct radix_node *, void *));
-
-static int max_keylen;
-static struct radix_mask *rn_mkfreelist;
-static struct radix_node_head *mask_rnhead;
-static char *addmask_key;
-static char normal_chars[] = {0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, -1};
-static char *rn_zeros, *rn_ones;
-
-#define rn_masktop (mask_rnhead->rnh_treetop)
-#undef Bcmp
-#define Bcmp(a, b, l) (l == 0 ? 0 : bcmp((caddr_t)(a), (caddr_t)(b), (u_long)l))
-
-static int rn_lexobetter __P((void *m_arg, void *n_arg));
-static struct radix_mask *
- rn_new_radix_mask __P((struct radix_node *tt,
- struct radix_mask *next));
-static int rn_satsifies_leaf __P((char *trial, struct radix_node *leaf,
- int skip));
-
-/*
- * The data structure for the keys is a radix tree with one way
- * branching removed. The index rn_b at an internal node n represents a bit
- * position to be tested. The tree is arranged so that all descendants
- * of a node n have keys whose bits all agree up to position rn_b - 1.
- * (We say the index of n is rn_b.)
- *
- * There is at least one descendant which has a one bit at position rn_b,
- * and at least one with a zero there.
- *
- * A route is determined by a pair of key and mask. We require that the
- * bit-wise logical and of the key and mask to be the key.
- * We define the index of a route to associated with the mask to be
- * the first bit number in the mask where 0 occurs (with bit number 0
- * representing the highest order bit).
- *
- * We say a mask is normal if every bit is 0, past the index of the mask.
- * If a node n has a descendant (k, m) with index(m) == index(n) == rn_b,
- * and m is a normal mask, then the route applies to every descendant of n.
- * If the index(m) < rn_b, this implies the trailing last few bits of k
- * before bit b are all 0, (and hence consequently true of every descendant
- * of n), so the route applies to all descendants of the node as well.
- *
- * Similar logic shows that a non-normal mask m such that
- * index(m) <= index(n) could potentially apply to many children of n.
- * Thus, for each non-host route, we attach its mask to a list at an internal
- * node as high in the tree as we can go.
- *
- * The present version of the code makes use of normal routes in short-
- * circuiting an explict mask and compare operation when testing whether
- * a key satisfies a normal route, and also in remembering the unique leaf
- * that governs a subtree.
- */
-
-static struct radix_node *
-rn_search(v_arg, head)
- void *v_arg;
- struct radix_node *head;
-{
- register struct radix_node *x;
- register caddr_t v;
-
- for (x = head, v = v_arg; x->rn_b >= 0;) {
- if (x->rn_bmask & v[x->rn_off])
- x = x->rn_r;
- else
- x = x->rn_l;
- }
- return (x);
-};
-
-static struct radix_node *
-rn_search_m(v_arg, head, m_arg)
- struct radix_node *head;
- void *v_arg, *m_arg;
-{
- register struct radix_node *x;
- register caddr_t v = v_arg, m = m_arg;
-
- for (x = head; x->rn_b >= 0;) {
- if ((x->rn_bmask & m[x->rn_off]) &&
- (x->rn_bmask & v[x->rn_off]))
- x = x->rn_r;
- else
- x = x->rn_l;
- }
- return x;
-};
-
-int
-rn_refines(m_arg, n_arg)
- void *m_arg, *n_arg;
-{
- register caddr_t m = m_arg, n = n_arg;
- register caddr_t lim, lim2 = lim = n + *(u_char *)n;
- int longer = (*(u_char *)n++) - (int)(*(u_char *)m++);
- int masks_are_equal = 1;
-
- if (longer > 0)
- lim -= longer;
- while (n < lim) {
- if (*n & ~(*m))
- return 0;
- if (*n++ != *m++)
- masks_are_equal = 0;
- }
- while (n < lim2)
- if (*n++)
- return 0;
- if (masks_are_equal && (longer < 0))
- for (lim2 = m - longer; m < lim2; )
- if (*m++)
- return 1;
- return (!masks_are_equal);
-}
-
-struct radix_node *
-rn_lookup(v_arg, m_arg, head)
- void *v_arg, *m_arg;
- struct radix_node_head *head;
-{
- register struct radix_node *x;
- caddr_t netmask = 0;
-
- if (m_arg) {
- if ((x = rn_addmask(m_arg, 1, head->rnh_treetop->rn_off)) == 0)
- return (0);
- netmask = x->rn_key;
- }
- x = rn_match(v_arg, head);
- if (x && netmask) {
- while (x && x->rn_mask != netmask)
- x = x->rn_dupedkey;
- }
- return x;
-}
-
-static int
-rn_satsifies_leaf(trial, leaf, skip)
- char *trial;
- register struct radix_node *leaf;
- int skip;
-{
- register char *cp = trial, *cp2 = leaf->rn_key, *cp3 = leaf->rn_mask;
- char *cplim;
- int length = min(*(u_char *)cp, *(u_char *)cp2);
-
- if (cp3 == 0)
- cp3 = rn_ones;
- else
- length = min(length, *(u_char *)cp3);
- cplim = cp + length; cp3 += skip; cp2 += skip;
- for (cp += skip; cp < cplim; cp++, cp2++, cp3++)
- if ((*cp ^ *cp2) & *cp3)
- return 0;
- return 1;
-}
-
-struct radix_node *
-rn_match(v_arg, head)
- void *v_arg;
- struct radix_node_head *head;
-{
- caddr_t v = v_arg;
- register struct radix_node *t = head->rnh_treetop, *x;
- register caddr_t cp = v, cp2;
- caddr_t cplim;
- struct radix_node *saved_t, *top = t;
- int off = t->rn_off, vlen = *(u_char *)cp, matched_off;
- register int test, b, rn_b;
-
- /*
- * Open code rn_search(v, top) to avoid overhead of extra
- * subroutine call.
- */
- for (; t->rn_b >= 0; ) {
- if (t->rn_bmask & cp[t->rn_off])
- t = t->rn_r;
- else
- t = t->rn_l;
- }
- /*
- * See if we match exactly as a host destination
- * or at least learn how many bits match, for normal mask finesse.
- *
- * It doesn't hurt us to limit how many bytes to check
- * to the length of the mask, since if it matches we had a genuine
- * match and the leaf we have is the most specific one anyway;
- * if it didn't match with a shorter length it would fail
- * with a long one. This wins big for class B&C netmasks which
- * are probably the most common case...
- */
- if (t->rn_mask)
- vlen = *(u_char *)t->rn_mask;
- cp += off; cp2 = t->rn_key + off; cplim = v + vlen;
- for (; cp < cplim; cp++, cp2++)
- if (*cp != *cp2)
- goto on1;
- /*
- * This extra grot is in case we are explicitly asked
- * to look up the default. Ugh!
- */
- if ((t->rn_flags & RNF_ROOT) && t->rn_dupedkey)
- t = t->rn_dupedkey;
- return t;
-on1:
- test = (*cp ^ *cp2) & 0xff; /* find first bit that differs */
- for (b = 7; (test >>= 1) > 0;)
- b--;
- matched_off = cp - v;
- b += matched_off << 3;
- rn_b = -1 - b;
- /*
- * If there is a host route in a duped-key chain, it will be first.
- */
- if ((saved_t = t)->rn_mask == 0)
- t = t->rn_dupedkey;
- for (; t; t = t->rn_dupedkey)
- /*
- * Even if we don't match exactly as a host,
- * we may match if the leaf we wound up at is
- * a route to a net.
- */
- if (t->rn_flags & RNF_NORMAL) {
- if (rn_b <= t->rn_b)
- return t;
- } else if (rn_satsifies_leaf(v, t, matched_off))
- return t;
- t = saved_t;
- /* start searching up the tree */
- do {
- register struct radix_mask *m;
- t = t->rn_p;
- m = t->rn_mklist;
- if (m) {
- /*
- * If non-contiguous masks ever become important
- * we can restore the masking and open coding of
- * the search and satisfaction test and put the
- * calculation of "off" back before the "do".
- */
- do {
- if (m->rm_flags & RNF_NORMAL) {
- if (rn_b <= m->rm_b)
- return (m->rm_leaf);
- } else {
- off = min(t->rn_off, matched_off);
- x = rn_search_m(v, t, m->rm_mask);
- while (x && x->rn_mask != m->rm_mask)
- x = x->rn_dupedkey;
- if (x && rn_satsifies_leaf(v, x, off))
- return x;
- }
- m = m->rm_mklist;
- } while (m);
- }
- } while (t != top);
- return 0;
-};
-
-#ifdef RN_DEBUG
-int rn_nodenum;
-struct radix_node *rn_clist;
-int rn_saveinfo;
-int rn_debug = 1;
-#endif
-
-static struct radix_node *
-rn_newpair(v, b, nodes)
- void *v;
- int b;
- struct radix_node nodes[2];
-{
- register struct radix_node *tt = nodes, *t = tt + 1;
- t->rn_b = b; t->rn_bmask = 0x80 >> (b & 7);
- t->rn_l = tt; t->rn_off = b >> 3;
- tt->rn_b = -1; tt->rn_key = (caddr_t)v; tt->rn_p = t;
- tt->rn_flags = t->rn_flags = RNF_ACTIVE;
-#ifdef RN_DEBUG
- tt->rn_info = rn_nodenum++; t->rn_info = rn_nodenum++;
- tt->rn_twin = t; tt->rn_ybro = rn_clist; rn_clist = tt;
-#endif
- return t;
-}
-
-static struct radix_node *
-rn_insert(v_arg, head, dupentry, nodes)
- void *v_arg;
- struct radix_node_head *head;
- int *dupentry;
- struct radix_node nodes[2];
-{
- caddr_t v = v_arg;
- struct radix_node *top = head->rnh_treetop;
- int head_off = top->rn_off, vlen = (int)*((u_char *)v);
- register struct radix_node *t = rn_search(v_arg, top);
- register caddr_t cp = v + head_off;
- register int b;
- struct radix_node *tt;
- /*
- * Find first bit at which v and t->rn_key differ
- */
- {
- register caddr_t cp2 = t->rn_key + head_off;
- register int cmp_res;
- caddr_t cplim = v + vlen;
-
- while (cp < cplim)
- if (*cp2++ != *cp++)
- goto on1;
- *dupentry = 1;
- return t;
-on1:
- *dupentry = 0;
- cmp_res = (cp[-1] ^ cp2[-1]) & 0xff;
- for (b = (cp - v) << 3; cmp_res; b--)
- cmp_res >>= 1;
- }
- {
- register struct radix_node *p, *x = top;
- cp = v;
- do {
- p = x;
- if (cp[x->rn_off] & x->rn_bmask)
- x = x->rn_r;
- else x = x->rn_l;
- } while (b > (unsigned) x->rn_b); /* x->rn_b < b && x->rn_b >= 0 */
-#ifdef RN_DEBUG
- if (rn_debug)
- log(LOG_DEBUG, "rn_insert: Going In:\n"), traverse(p);
-#endif
- t = rn_newpair(v_arg, b, nodes); tt = t->rn_l;
- if ((cp[p->rn_off] & p->rn_bmask) == 0)
- p->rn_l = t;
- else
- p->rn_r = t;
- x->rn_p = t; t->rn_p = p; /* frees x, p as temp vars below */
- if ((cp[t->rn_off] & t->rn_bmask) == 0) {
- t->rn_r = x;
- } else {
- t->rn_r = tt; t->rn_l = x;
- }
-#ifdef RN_DEBUG
- if (rn_debug)
- log(LOG_DEBUG, "rn_insert: Coming Out:\n"), traverse(p);
-#endif
- }
- return (tt);
-}
-
-struct radix_node *
-rn_addmask(n_arg, search, skip)
- int search, skip;
- void *n_arg;
-{
- caddr_t netmask = (caddr_t)n_arg;
- register struct radix_node *x;
- register caddr_t cp, cplim;
- register int b = 0, mlen, j;
- int maskduplicated, m0, isnormal;
- struct radix_node *saved_x;
- static int last_zeroed = 0;
-
- if ((mlen = *(u_char *)netmask) > max_keylen)
- mlen = max_keylen;
- if (skip == 0)
- skip = 1;
- if (mlen <= skip)
- return (mask_rnhead->rnh_nodes);
- if (skip > 1)
- Bcopy(rn_ones + 1, addmask_key + 1, skip - 1);
- if ((m0 = mlen) > skip)
- Bcopy(netmask + skip, addmask_key + skip, mlen - skip);
- /*
- * Trim trailing zeroes.
- */
- for (cp = addmask_key + mlen; (cp > addmask_key) && cp[-1] == 0;)
- cp--;
- mlen = cp - addmask_key;
- if (mlen <= skip) {
- if (m0 >= last_zeroed)
- last_zeroed = mlen;
- return (mask_rnhead->rnh_nodes);
- }
- if (m0 < last_zeroed)
- Bzero(addmask_key + m0, last_zeroed - m0);
- *addmask_key = last_zeroed = mlen;
- x = rn_search(addmask_key, rn_masktop);
- if (Bcmp(addmask_key, x->rn_key, mlen) != 0)
- x = 0;
- if (x || search)
- return (x);
- R_Malloc(x, struct radix_node *, max_keylen + 2 * sizeof (*x));
- if ((saved_x = x) == 0)
- return (0);
- Bzero(x, max_keylen + 2 * sizeof (*x));
- netmask = cp = (caddr_t)(x + 2);
- Bcopy(addmask_key, cp, mlen);
- x = rn_insert(cp, mask_rnhead, &maskduplicated, x);
- if (maskduplicated) {
- log(LOG_ERR, "rn_addmask: mask impossibly already in tree");
- Free(saved_x);
- return (x);
- }
- /*
- * Calculate index of mask, and check for normalcy.
- */
- cplim = netmask + mlen; isnormal = 1;
- for (cp = netmask + skip; (cp < cplim) && *(u_char *)cp == 0xff;)
- cp++;
- if (cp != cplim) {
- for (j = 0x80; (j & *cp) != 0; j >>= 1)
- b++;
- if (*cp != normal_chars[b] || cp != (cplim - 1))
- isnormal = 0;
- }
- b += (cp - netmask) << 3;
- x->rn_b = -1 - b;
- if (isnormal)
- x->rn_flags |= RNF_NORMAL;
- return (x);
-}
-
-static int /* XXX: arbitrary ordering for non-contiguous masks */
-rn_lexobetter(m_arg, n_arg)
- void *m_arg, *n_arg;
-{
- register u_char *mp = m_arg, *np = n_arg, *lim;
-
- if (*mp > *np)
- return 1; /* not really, but need to check longer one first */
- if (*mp == *np)
- for (lim = mp + *mp; mp < lim;)
- if (*mp++ > *np++)
- return 1;
- return 0;
-}
-
-static struct radix_mask *
-rn_new_radix_mask(tt, next)
- register struct radix_node *tt;
- register struct radix_mask *next;
-{
- register struct radix_mask *m;
-
- MKGet(m);
- if (m == 0) {
- log(LOG_ERR, "Mask for route not entered\n");
- return (0);
- }
- Bzero(m, sizeof *m);
- m->rm_b = tt->rn_b;
- m->rm_flags = tt->rn_flags;
- if (tt->rn_flags & RNF_NORMAL)
- m->rm_leaf = tt;
- else
- m->rm_mask = tt->rn_mask;
- m->rm_mklist = next;
- tt->rn_mklist = m;
- return m;
-}
-
-struct radix_node *
-rn_addroute(v_arg, n_arg, head, treenodes)
- void *v_arg, *n_arg;
- struct radix_node_head *head;
- struct radix_node treenodes[2];
-{
- caddr_t v = (caddr_t)v_arg, netmask = (caddr_t)n_arg;
- register struct radix_node *t, *x = 0, *tt;
- struct radix_node *saved_tt, *top = head->rnh_treetop;
- short b = 0, b_leaf = 0;
- int keyduplicated;
- caddr_t mmask;
- struct radix_mask *m, **mp;
-
- /*
- * In dealing with non-contiguous masks, there may be
- * many different routes which have the same mask.
- * We will find it useful to have a unique pointer to
- * the mask to speed avoiding duplicate references at
- * nodes and possibly save time in calculating indices.
- */
- if (netmask) {
- if ((x = rn_addmask(netmask, 0, top->rn_off)) == 0)
- return (0);
- b_leaf = x->rn_b;
- b = -1 - x->rn_b;
- netmask = x->rn_key;
- }
- /*
- * Deal with duplicated keys: attach node to previous instance
- */
- saved_tt = tt = rn_insert(v, head, &keyduplicated, treenodes);
- if (keyduplicated) {
- for (t = tt; tt; t = tt, tt = tt->rn_dupedkey) {
- if (tt->rn_mask == netmask)
- return (0);
- if (netmask == 0 ||
- (tt->rn_mask &&
- ((b_leaf < tt->rn_b) || /* index(netmask) > node */
- rn_refines(netmask, tt->rn_mask) ||
- rn_lexobetter(netmask, tt->rn_mask))))
- break;
- }
- /*
- * If the mask is not duplicated, we wouldn't
- * find it among possible duplicate key entries
- * anyway, so the above test doesn't hurt.
- *
- * We sort the masks for a duplicated key the same way as
- * in a masklist -- most specific to least specific.
- * This may require the unfortunate nuisance of relocating
- * the head of the list.
- */
- if (tt == saved_tt) {
- struct radix_node *xx = x;
- /* link in at head of list */
- (tt = treenodes)->rn_dupedkey = t;
- tt->rn_flags = t->rn_flags;
- tt->rn_p = x = t->rn_p;
- t->rn_p = tt; /* parent */
- if (x->rn_l == t) x->rn_l = tt; else x->rn_r = tt;
- saved_tt = tt; x = xx;
- } else {
- (tt = treenodes)->rn_dupedkey = t->rn_dupedkey;
- t->rn_dupedkey = tt;
- tt->rn_p = t; /* parent */
- if (tt->rn_dupedkey) /* parent */
- tt->rn_dupedkey->rn_p = tt; /* parent */
- }
-#ifdef RN_DEBUG
- t=tt+1; tt->rn_info = rn_nodenum++; t->rn_info = rn_nodenum++;
- tt->rn_twin = t; tt->rn_ybro = rn_clist; rn_clist = tt;
-#endif
- tt->rn_key = (caddr_t) v;
- tt->rn_b = -1;
- tt->rn_flags = RNF_ACTIVE;
- }
- /*
- * Put mask in tree.
- */
- if (netmask) {
- tt->rn_mask = netmask;
- tt->rn_b = x->rn_b;
- tt->rn_flags |= x->rn_flags & RNF_NORMAL;
- }
- t = saved_tt->rn_p;
- if (keyduplicated)
- goto on2;
- b_leaf = -1 - t->rn_b;
- if (t->rn_r == saved_tt) x = t->rn_l; else x = t->rn_r;
- /* Promote general routes from below */
- if (x->rn_b < 0) {
- for (mp = &t->rn_mklist; x; x = x->rn_dupedkey)
- if (x->rn_mask && (x->rn_b >= b_leaf) && x->rn_mklist == 0) {
- *mp = m = rn_new_radix_mask(x, 0);
- if (m)
- mp = &m->rm_mklist;
- }
- } else if (x->rn_mklist) {
- /*
- * Skip over masks whose index is > that of new node
- */
- for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist)
- if (m->rm_b >= b_leaf)
- break;
- t->rn_mklist = m; *mp = 0;
- }
-on2:
- /* Add new route to highest possible ancestor's list */
- if ((netmask == 0) || (b > t->rn_b ))
- return tt; /* can't lift at all */
- b_leaf = tt->rn_b;
- do {
- x = t;
- t = t->rn_p;
- } while (b <= t->rn_b && x != top);
- /*
- * Search through routes associated with node to
- * insert new route according to index.
- * Need same criteria as when sorting dupedkeys to avoid
- * double loop on deletion.
- */
- for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist) {
- if (m->rm_b < b_leaf)
- continue;
- if (m->rm_b > b_leaf)
- break;
- if (m->rm_flags & RNF_NORMAL) {
- mmask = m->rm_leaf->rn_mask;
- if (tt->rn_flags & RNF_NORMAL) {
- log(LOG_ERR,
- "Non-unique normal route, mask not entered");
- return tt;
- }
- } else
- mmask = m->rm_mask;
- if (mmask == netmask) {
- m->rm_refs++;
- tt->rn_mklist = m;
- return tt;
- }
- if (rn_refines(netmask, mmask) || rn_lexobetter(netmask, mmask))
- break;
- }
- *mp = rn_new_radix_mask(tt, *mp);
- return tt;
-}
-
-static struct radix_node *
-rn_delete(v_arg, netmask_arg, head)
- void *v_arg, *netmask_arg;
- struct radix_node_head *head;
-{
- register struct radix_node *t, *p, *x, *tt;
- struct radix_mask *m, *saved_m, **mp;
- struct radix_node *dupedkey, *saved_tt, *top;
- caddr_t v, netmask;
- int b, head_off, vlen;
-
- v = v_arg;
- netmask = netmask_arg;
- x = head->rnh_treetop;
- tt = rn_search(v, x);
- head_off = x->rn_off;
- vlen = *(u_char *)v;
- saved_tt = tt;
- top = x;
- if (tt == 0 ||
- Bcmp(v + head_off, tt->rn_key + head_off, vlen - head_off))
- return (0);
- /*
- * Delete our route from mask lists.
- */
- if (netmask) {
- if ((x = rn_addmask(netmask, 1, head_off)) == 0)
- return (0);
- netmask = x->rn_key;
- while (tt->rn_mask != netmask)
- if ((tt = tt->rn_dupedkey) == 0)
- return (0);
- }
- if (tt->rn_mask == 0 || (saved_m = m = tt->rn_mklist) == 0)
- goto on1;
- if (tt->rn_flags & RNF_NORMAL) {
- if (m->rm_leaf != tt || m->rm_refs > 0) {
- log(LOG_ERR, "rn_delete: inconsistent annotation\n");
- return 0; /* dangling ref could cause disaster */
- }
- } else {
- if (m->rm_mask != tt->rn_mask) {
- log(LOG_ERR, "rn_delete: inconsistent annotation\n");
- goto on1;
- }
- if (--m->rm_refs >= 0)
- goto on1;
- }
- b = -1 - tt->rn_b;
- t = saved_tt->rn_p;
- if (b > t->rn_b)
- goto on1; /* Wasn't lifted at all */
- do {
- x = t;
- t = t->rn_p;
- } while (b <= t->rn_b && x != top);
- for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist)
- if (m == saved_m) {
- *mp = m->rm_mklist;
- MKFree(m);
- break;
- }
- if (m == 0) {
- log(LOG_ERR, "rn_delete: couldn't find our annotation\n");
- if (tt->rn_flags & RNF_NORMAL)
- return (0); /* Dangling ref to us */
- }
-on1:
- /*
- * Eliminate us from tree
- */
- if (tt->rn_flags & RNF_ROOT)
- return (0);
-#ifdef RN_DEBUG
- /* Get us out of the creation list */
- for (t = rn_clist; t && t->rn_ybro != tt; t = t->rn_ybro) {}
- if (t) t->rn_ybro = tt->rn_ybro;
-#endif
- t = tt->rn_p;
- dupedkey = saved_tt->rn_dupedkey;
- if (dupedkey) {
- /*
- * at this point, tt is the deletion target and saved_tt
- * is the head of the dupekey chain
- */
- if (tt == saved_tt) {
- /* remove from head of chain */
- x = dupedkey; x->rn_p = t;
- if (t->rn_l == tt) t->rn_l = x; else t->rn_r = x;
- } else {
- /* find node in front of tt on the chain */
- for (x = p = saved_tt; p && p->rn_dupedkey != tt;)
- p = p->rn_dupedkey;
- if (p) {
- p->rn_dupedkey = tt->rn_dupedkey;
- if (tt->rn_dupedkey) /* parent */
- tt->rn_dupedkey->rn_p = p; /* parent */
- } else log(LOG_ERR, "rn_delete: couldn't find us\n");
- }
- t = tt + 1;
- if (t->rn_flags & RNF_ACTIVE) {
-#ifndef RN_DEBUG
- *++x = *t; p = t->rn_p;
-#else
- b = t->rn_info; *++x = *t; t->rn_info = b; p = t->rn_p;
-#endif
- if (p->rn_l == t) p->rn_l = x; else p->rn_r = x;
- x->rn_l->rn_p = x; x->rn_r->rn_p = x;
- }
- goto out;
- }
- if (t->rn_l == tt) x = t->rn_r; else x = t->rn_l;
- p = t->rn_p;
- if (p->rn_r == t) p->rn_r = x; else p->rn_l = x;
- x->rn_p = p;
- /*
- * Demote routes attached to us.
- */
- if (t->rn_mklist) {
- if (x->rn_b >= 0) {
- for (mp = &x->rn_mklist; (m = *mp);)
- mp = &m->rm_mklist;
- *mp = t->rn_mklist;
- } else {
- /* If there are any key,mask pairs in a sibling
- duped-key chain, some subset will appear sorted
- in the same order attached to our mklist */
- for (m = t->rn_mklist; m && x; x = x->rn_dupedkey)
- if (m == x->rn_mklist) {
- struct radix_mask *mm = m->rm_mklist;
- x->rn_mklist = 0;
- if (--(m->rm_refs) < 0)
- MKFree(m);
- m = mm;
- }
- if (m)
- log(LOG_ERR, "%s %p at %x\n",
- "rn_delete: Orphaned Mask", m, x);
- }
- }
- /*
- * We may be holding an active internal node in the tree.
- */
- x = tt + 1;
- if (t != x) {
-#ifndef RN_DEBUG
- *t = *x;
-#else
- b = t->rn_info; *t = *x; t->rn_info = b;
-#endif
- t->rn_l->rn_p = t; t->rn_r->rn_p = t;
- p = x->rn_p;
- if (p->rn_l == x) p->rn_l = t; else p->rn_r = t;
- }
-out:
- tt->rn_flags &= ~RNF_ACTIVE;
- tt[1].rn_flags &= ~RNF_ACTIVE;
- return (tt);
-}
-
-/*
- * This is the same as rn_walktree() except for the parameters and the
- * exit.
- */
-static int
-rn_walktree_from(h, a, m, f, w)
- struct radix_node_head *h;
- void *a, *m;
- walktree_f_t *f;
- void *w;
-{
- int error;
- struct radix_node *base, *next;
- u_char *xa = (u_char *)a;
- u_char *xm = (u_char *)m;
- register struct radix_node *rn, *last = 0 /* shut up gcc */;
- int stopping = 0;
- int lastb;
-
- /*
- * rn_search_m is sort-of-open-coded here.
- */
- /* printf("about to search\n"); */
- for (rn = h->rnh_treetop; rn->rn_b >= 0; ) {
- last = rn;
- /* printf("rn_b %d, rn_bmask %x, xm[rn_off] %x\n",
- rn->rn_b, rn->rn_bmask, xm[rn->rn_off]); */
- if (!(rn->rn_bmask & xm[rn->rn_off])) {
- break;
- }
- if (rn->rn_bmask & xa[rn->rn_off]) {
- rn = rn->rn_r;
- } else {
- rn = rn->rn_l;
- }
- }
- /* printf("done searching\n"); */
-
- /*
- * Two cases: either we stepped off the end of our mask,
- * in which case last == rn, or we reached a leaf, in which
- * case we want to start from the last node we looked at.
- * Either way, last is the node we want to start from.
- */
- rn = last;
- lastb = rn->rn_b;
-
- /* printf("rn %p, lastb %d\n", rn, lastb);*/
-
- /*
- * This gets complicated because we may delete the node
- * while applying the function f to it, so we need to calculate
- * the successor node in advance.
- */
- while (rn->rn_b >= 0)
- rn = rn->rn_l;
-
- while (!stopping) {
- /* printf("node %p (%d)\n", rn, rn->rn_b); */
- base = rn;
- /* If at right child go back up, otherwise, go right */
- while (rn->rn_p->rn_r == rn && !(rn->rn_flags & RNF_ROOT)) {
- rn = rn->rn_p;
-
- /* if went up beyond last, stop */
- if (rn->rn_b < lastb) {
- stopping = 1;
- /* printf("up too far\n"); */
- }
- }
-
- /* Find the next *leaf* since next node might vanish, too */
- for (rn = rn->rn_p->rn_r; rn->rn_b >= 0;)
- rn = rn->rn_l;
- next = rn;
- /* Process leaves */
- while ((rn = base) != 0) {
- base = rn->rn_dupedkey;
- /* printf("leaf %p\n", rn); */
- if (!(rn->rn_flags & RNF_ROOT)
- && (error = (*f)(rn, w)))
- return (error);
- }
- rn = next;
-
- if (rn->rn_flags & RNF_ROOT) {
- /* printf("root, stopping"); */
- stopping = 1;
- }
-
- }
- return 0;
-}
-
-static int
-rn_walktree(h, f, w)
- struct radix_node_head *h;
- walktree_f_t *f;
- void *w;
-{
- int error;
- struct radix_node *base, *next;
- register struct radix_node *rn = h->rnh_treetop;
- /*
- * This gets complicated because we may delete the node
- * while applying the function f to it, so we need to calculate
- * the successor node in advance.
- */
- /* First time through node, go left */
- while (rn->rn_b >= 0)
- rn = rn->rn_l;
- for (;;) {
- base = rn;
- /* If at right child go back up, otherwise, go right */
- while (rn->rn_p->rn_r == rn && (rn->rn_flags & RNF_ROOT) == 0)
- rn = rn->rn_p;
- /* Find the next *leaf* since next node might vanish, too */
- for (rn = rn->rn_p->rn_r; rn->rn_b >= 0;)
- rn = rn->rn_l;
- next = rn;
- /* Process leaves */
- while ((rn = base)) {
- base = rn->rn_dupedkey;
- if (!(rn->rn_flags & RNF_ROOT) && (error = (*f)(rn, w)))
- return (error);
- }
- rn = next;
- if (rn->rn_flags & RNF_ROOT)
- return (0);
- }
- /* NOTREACHED */
-}
-
-int
-rn_inithead(head, off)
- void **head;
- int off;
-{
- register struct radix_node_head *rnh;
- register struct radix_node *t, *tt, *ttt;
- if (*head)
- return (1);
- R_Malloc(rnh, struct radix_node_head *, sizeof (*rnh));
- if (rnh == 0)
- return (0);
- Bzero(rnh, sizeof (*rnh));
- *head = rnh;
- t = rn_newpair(rn_zeros, off, rnh->rnh_nodes);
- ttt = rnh->rnh_nodes + 2;
- t->rn_r = ttt;
- t->rn_p = t;
- tt = t->rn_l;
- tt->rn_flags = t->rn_flags = RNF_ROOT | RNF_ACTIVE;
- tt->rn_b = -1 - off;
- *ttt = *tt;
- ttt->rn_key = rn_ones;
- rnh->rnh_addaddr = rn_addroute;
- rnh->rnh_deladdr = rn_delete;
- rnh->rnh_matchaddr = rn_match;
- rnh->rnh_lookup = rn_lookup;
- rnh->rnh_walktree = rn_walktree;
- rnh->rnh_walktree_from = rn_walktree_from;
- rnh->rnh_treetop = t;
- return (1);
-}
-
-void
-rn_init()
-{
- char *cp, *cplim;
-#ifdef KERNEL
- struct domain *dom;
-
- for (dom = domains; dom; dom = dom->dom_next)
- if (dom->dom_maxrtkey > max_keylen)
- max_keylen = dom->dom_maxrtkey;
-#endif
- if (max_keylen == 0) {
- log(LOG_ERR,
- "rn_init: radix functions require max_keylen be set\n");
- return;
- }
- R_Malloc(rn_zeros, char *, 3 * max_keylen);
- if (rn_zeros == NULL)
- panic("rn_init");
- Bzero(rn_zeros, 3 * max_keylen);
- rn_ones = cp = rn_zeros + max_keylen;
- addmask_key = cplim = rn_ones + max_keylen;
- while (cp < cplim)
- *cp++ = -1;
- if (rn_inithead((void **)&mask_rnhead, 0) == 0)
- panic("rn_init 2");
-}
diff --git a/c/src/lib/libnetworking/net/radix.h b/c/src/lib/libnetworking/net/radix.h
deleted file mode 100644
index 6ef9aafbac..0000000000
--- a/c/src/lib/libnetworking/net/radix.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 1988, 1989, 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.
- *
- * @(#)radix.h 8.2 (Berkeley) 10/31/94
- * $Id$
- */
-
-#ifndef _RADIX_H_
-#define _RADIX_H_
-
-/*
- * Radix search tree node layout.
- */
-
-struct radix_node {
- struct radix_mask *rn_mklist; /* list of masks contained in subtree */
- struct radix_node *rn_p; /* parent */
- short rn_b; /* bit offset; -1-index(netmask) */
- char rn_bmask; /* node: mask for bit test*/
- u_char rn_flags; /* enumerated next */
-#define RNF_NORMAL 1 /* leaf contains normal route */
-#define RNF_ROOT 2 /* leaf is root leaf for tree */
-#define RNF_ACTIVE 4 /* This node is alive (for rtfree) */
- union {
- struct { /* leaf only data: */
- caddr_t rn_Key; /* object of search */
- caddr_t rn_Mask; /* netmask, if present */
- struct radix_node *rn_Dupedkey;
- } rn_leaf;
- struct { /* node only data: */
- int rn_Off; /* where to start compare */
- struct radix_node *rn_L;/* progeny */
- struct radix_node *rn_R;/* progeny */
- } rn_node;
- } rn_u;
-#ifdef RN_DEBUG
- int rn_info;
- struct radix_node *rn_twin;
- struct radix_node *rn_ybro;
-#endif
-};
-
-#define rn_dupedkey rn_u.rn_leaf.rn_Dupedkey
-#define rn_key rn_u.rn_leaf.rn_Key
-#define rn_mask rn_u.rn_leaf.rn_Mask
-#define rn_off rn_u.rn_node.rn_Off
-#define rn_l rn_u.rn_node.rn_L
-#define rn_r rn_u.rn_node.rn_R
-
-/*
- * Annotations to tree concerning potential routes applying to subtrees.
- */
-
-extern struct radix_mask {
- short rm_b; /* bit offset; -1-index(netmask) */
- char rm_unused; /* cf. rn_bmask */
- u_char rm_flags; /* cf. rn_flags */
- struct radix_mask *rm_mklist; /* more masks to try */
- union {
- caddr_t rmu_mask; /* the mask */
- struct radix_node *rmu_leaf; /* for normal routes */
- } rm_rmu;
- int rm_refs; /* # of references to this struct */
-} *rn_mkfreelist;
-
-#define rm_mask rm_rmu.rmu_mask
-#define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */
-
-#define MKGet(m) {\
- if (rn_mkfreelist) {\
- m = rn_mkfreelist; \
- rn_mkfreelist = (m)->rm_mklist; \
- } else \
- R_Malloc(m, struct radix_mask *, sizeof (*(m))); }\
-
-#define MKFree(m) { (m)->rm_mklist = rn_mkfreelist; rn_mkfreelist = (m);}
-
-typedef int walktree_f_t __P((struct radix_node *, void *));
-
-struct radix_node_head {
- struct radix_node *rnh_treetop;
- int rnh_addrsize; /* permit, but not require fixed keys */
- int rnh_pktsize; /* permit, but not require fixed keys */
- struct radix_node *(*rnh_addaddr) /* add based on sockaddr */
- __P((void *v, void *mask,
- struct radix_node_head *head, struct radix_node nodes[]));
- struct radix_node *(*rnh_addpkt) /* add based on packet hdr */
- __P((void *v, void *mask,
- struct radix_node_head *head, struct radix_node nodes[]));
- struct radix_node *(*rnh_deladdr) /* remove based on sockaddr */
- __P((void *v, void *mask, struct radix_node_head *head));
- struct radix_node *(*rnh_delpkt) /* remove based on packet hdr */
- __P((void *v, void *mask, struct radix_node_head *head));
- struct radix_node *(*rnh_matchaddr) /* locate based on sockaddr */
- __P((void *v, struct radix_node_head *head));
- struct radix_node *(*rnh_lookup) /* locate based on sockaddr */
- __P((void *v, void *mask, struct radix_node_head *head));
- struct radix_node *(*rnh_matchpkt) /* locate based on packet hdr */
- __P((void *v, struct radix_node_head *head));
- int (*rnh_walktree) /* traverse tree */
- __P((struct radix_node_head *head, walktree_f_t *f, void *w));
- int (*rnh_walktree_from) /* traverse tree below a */
- __P((struct radix_node_head *head, void *a, void *m,
- walktree_f_t *f, void *w));
- void (*rnh_close) /* do something when the last ref drops */
- __P((struct radix_node *rn, struct radix_node_head *head));
- struct radix_node rnh_nodes[3]; /* empty tree for common case */
-};
-
-#ifndef KERNEL
-#define Bcmp(a, b, n) bcmp(((char *)(a)), ((char *)(b)), (n))
-#define Bcopy(a, b, n) bcopy(((char *)(a)), ((char *)(b)), (unsigned)(n))
-#define Bzero(p, n) bzero((char *)(p), (int)(n));
-#define R_Malloc(p, t, n) (p = (t) malloc((unsigned int)(n)))
-#define Free(p) free((char *)p);
-#else
-#define Bcmp(a, b, n) bcmp(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n))
-#define Bcopy(a, b, n) bcopy(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n))
-#define Bzero(p, n) bzero((caddr_t)(p), (unsigned)(n));
-#define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_DONTWAIT))
-#define Free(p) free((caddr_t)p, M_RTABLE);
-#endif /*KERNEL*/
-
-extern struct radix_node_head *mask_rnhead;
-
-void rn_init __P((void));
-int rn_inithead __P((void **, int));
-int rn_refines __P((void *, void *));
-struct radix_node
- *rn_addmask __P((void *, int, int)),
- *rn_addroute __P((void *, void *, struct radix_node_head *,
- struct radix_node [2])),
- *rn_match __P((void *, struct radix_node_head *));
-
-
-#endif /* _RADIX_H_ */
diff --git a/c/src/lib/libnetworking/net/raw_cb.c b/c/src/lib/libnetworking/net/raw_cb.c
deleted file mode 100644
index 0676931cdc..0000000000
--- a/c/src/lib/libnetworking/net/raw_cb.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)raw_cb.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/raw_cb.h>
-#include <netinet/in.h>
-
-/*
- * Routines to manage the raw protocol control blocks.
- *
- * TODO:
- * hash lookups by protocol family/protocol + address family
- * take care of unique address problems per AF?
- * redo address binding to allow wildcards
- */
-
-struct rawcb rawcb;
-static u_long raw_sendspace = RAWSNDQ;
-static u_long raw_recvspace = RAWRCVQ;
-
-/*
- * Allocate a control block and a nominal amount
- * of buffer space for the socket.
- */
-int
-raw_attach(so, proto)
- register struct socket *so;
- int proto;
-{
- register struct rawcb *rp = sotorawcb(so);
- int error;
-
- /*
- * It is assumed that raw_attach is called
- * after space has been allocated for the
- * rawcb.
- */
- if (rp == 0)
- return (ENOBUFS);
- error = soreserve(so, raw_sendspace, raw_recvspace);
- if (error)
- return (error);
- rp->rcb_socket = so;
- rp->rcb_proto.sp_family = so->so_proto->pr_domain->dom_family;
- rp->rcb_proto.sp_protocol = proto;
- insque(rp, &rawcb);
- return (0);
-}
-
-/*
- * Detach the raw connection block and discard
- * socket resources.
- */
-void
-raw_detach(rp)
- register struct rawcb *rp;
-{
- struct socket *so = rp->rcb_socket;
-
- so->so_pcb = 0;
- sofree(so);
- remque(rp);
-#ifdef notdef
- if (rp->rcb_laddr)
- m_freem(dtom(rp->rcb_laddr));
- rp->rcb_laddr = 0;
-#endif
- free((caddr_t)(rp), M_PCB);
-}
-
-/*
- * Disconnect and possibly release resources.
- */
-void
-raw_disconnect(rp)
- struct rawcb *rp;
-{
-
-#ifdef notdef
- if (rp->rcb_faddr)
- m_freem(dtom(rp->rcb_faddr));
- rp->rcb_faddr = 0;
-#endif
- if (rp->rcb_socket->so_state & SS_NOFDREF)
- raw_detach(rp);
-}
-
-#ifdef notdef
-int
-raw_bind(so, nam)
- register struct socket *so;
- struct mbuf *nam;
-{
- struct sockaddr *addr = mtod(nam, struct sockaddr *);
- register struct rawcb *rp;
-
- if (ifnet == 0)
- return (EADDRNOTAVAIL);
- rp = sotorawcb(so);
- nam = m_copym(nam, 0, M_COPYALL, M_WAITOK);
- rp->rcb_laddr = mtod(nam, struct sockaddr *);
- return (0);
-}
-#endif
diff --git a/c/src/lib/libnetworking/net/raw_cb.h b/c/src/lib/libnetworking/net/raw_cb.h
deleted file mode 100644
index c1ed5e5e0a..0000000000
--- a/c/src/lib/libnetworking/net/raw_cb.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)raw_cb.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_RAW_CB_H_
-#define _NET_RAW_CB_H_
-
-/*
- * Raw protocol interface control block. Used
- * to tie a socket to the generic raw interface.
- */
-struct rawcb {
- struct rawcb *rcb_next; /* doubly linked list */
- struct rawcb *rcb_prev;
- struct socket *rcb_socket; /* back pointer to socket */
- struct sockaddr *rcb_faddr; /* destination address */
- struct sockaddr *rcb_laddr; /* socket's address */
- struct sockproto rcb_proto; /* protocol family, protocol */
-};
-
-#define sotorawcb(so) ((struct rawcb *)(so)->so_pcb)
-
-/*
- * Nominal space allocated to a raw socket.
- */
-#define RAWSNDQ 8192
-#define RAWRCVQ 8192
-
-#ifdef KERNEL
-extern struct rawcb rawcb; /* head of list */
-
-int raw_attach __P((struct socket *, int));
-void raw_ctlinput __P((int, struct sockaddr *, void *));
-void raw_detach __P((struct rawcb *));
-void raw_disconnect __P((struct rawcb *));
-void raw_init __P((void));
-void raw_input __P((struct mbuf *,
- struct sockproto *, struct sockaddr *, struct sockaddr *));
-int raw_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/net/raw_usrreq.c b/c/src/lib/libnetworking/net/raw_usrreq.c
deleted file mode 100644
index fb4faf4d6d..0000000000
--- a/c/src/lib/libnetworking/net/raw_usrreq.c
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)raw_usrreq.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/netisr.h>
-#include <net/raw_cb.h>
-
-/*
- * Initialize raw connection block q.
- */
-void
-raw_init()
-{
-
- rawcb.rcb_next = rawcb.rcb_prev = &rawcb;
-}
-
-
-/*
- * Raw protocol input routine. Find the socket
- * associated with the packet(s) and move them over. If
- * nothing exists for this packet, drop it.
- */
-/*
- * Raw protocol interface.
- */
-void
-raw_input(m0, proto, src, dst)
- struct mbuf *m0;
- register struct sockproto *proto;
- struct sockaddr *src, *dst;
-{
- register struct rawcb *rp;
- register struct mbuf *m = m0;
- register int sockets = 0;
- struct socket *last;
-
- last = 0;
- for (rp = rawcb.rcb_next; rp != &rawcb; rp = rp->rcb_next) {
- if (rp->rcb_proto.sp_family != proto->sp_family)
- continue;
- if (rp->rcb_proto.sp_protocol &&
- rp->rcb_proto.sp_protocol != proto->sp_protocol)
- continue;
- /*
- * We assume the lower level routines have
- * placed the address in a canonical format
- * suitable for a structure comparison.
- *
- * Note that if the lengths are not the same
- * the comparison will fail at the first byte.
- */
-#define equal(a1, a2) \
- (bcmp((caddr_t)(a1), (caddr_t)(a2), a1->sa_len) == 0)
- if (rp->rcb_laddr && !equal(rp->rcb_laddr, dst))
- continue;
- if (rp->rcb_faddr && !equal(rp->rcb_faddr, src))
- continue;
- if (last) {
- struct mbuf *n;
- n = m_copy(m, 0, (int)M_COPYALL);
- if (n) {
- if (sbappendaddr(&last->so_rcv, src,
- n, (struct mbuf *)0) == 0)
- /* should notify about lost packet */
- m_freem(n);
- else {
- sorwakeup(last);
- sockets++;
- }
- }
- }
- last = rp->rcb_socket;
- }
- if (last) {
- if (sbappendaddr(&last->so_rcv, src,
- m, (struct mbuf *)0) == 0)
- m_freem(m);
- else {
- sorwakeup(last);
- sockets++;
- }
- } else
- m_freem(m);
-}
-
-/*ARGSUSED*/
-void
-raw_ctlinput(cmd, arg, dummy)
- int cmd;
- struct sockaddr *arg;
- void *dummy;
-{
-
- if (cmd < 0 || cmd > PRC_NCMDS)
- return;
- /* INCOMPLETE */
-}
-
-/*ARGSUSED*/
-int
-raw_usrreq(so, req, m, nam, control)
- struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register struct rawcb *rp = sotorawcb(so);
- register int error = 0;
- int len;
-
- if (req == PRU_CONTROL)
- return (EOPNOTSUPP);
- if (control && control->m_len) {
- error = EOPNOTSUPP;
- goto release;
- }
- if (rp == 0) {
- error = EINVAL;
- goto release;
- }
- switch (req) {
-
- /*
- * Allocate a raw control block and fill in the
- * necessary info to allow packets to be routed to
- * the appropriate raw interface routine.
- */
- case PRU_ATTACH:
- if ((so->so_state & SS_PRIV) == 0) {
- error = EACCES;
- break;
- }
- error = raw_attach(so, (int)nam);
- break;
-
- /*
- * Destroy state just before socket deallocation.
- * Flush data or not depending on the options.
- */
- case PRU_DETACH:
- if (rp == 0) {
- error = ENOTCONN;
- break;
- }
- raw_detach(rp);
- break;
-
- /*
- * If a socket isn't bound to a single address,
- * the raw input routine will hand it anything
- * within that protocol family (assuming there's
- * nothing else around it should go to).
- */
- case PRU_CONNECT:
- error = EINVAL;
-#if 0
- if (rp->rcb_faddr) {
- error = EISCONN;
- break;
- }
- nam = m_copym(nam, 0, M_COPYALL, M_WAIT);
- rp->rcb_faddr = mtod(nam, struct sockaddr *);
- soisconnected(so);
-#endif
- break;
-
- case PRU_BIND:
- error = EINVAL;
-#if 0
- if (rp->rcb_laddr) {
- error = EINVAL; /* XXX */
- break;
- }
- error = raw_bind(so, nam);
-#endif
- break;
-
- case PRU_CONNECT2:
- error = EOPNOTSUPP;
- goto release;
-
- case PRU_DISCONNECT:
- if (rp->rcb_faddr == 0) {
- error = ENOTCONN;
- break;
- }
- raw_disconnect(rp);
- soisdisconnected(so);
- break;
-
- /*
- * Mark the connection as being incapable of further input.
- */
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- /*
- * Ship a packet out. The appropriate raw output
- * routine handles any massaging necessary.
- */
- case PRU_SEND:
- if (nam) {
- if (rp->rcb_faddr) {
- error = EISCONN;
- break;
- }
- rp->rcb_faddr = mtod(nam, struct sockaddr *);
- } else if (rp->rcb_faddr == 0) {
- error = ENOTCONN;
- break;
- }
- error = (*so->so_proto->pr_output)(m, so);
- m = NULL;
- if (nam)
- rp->rcb_faddr = 0;
- break;
-
- case PRU_ABORT:
- raw_disconnect(rp);
- sofree(so);
- soisdisconnected(so);
- break;
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- /*
- * Not supported.
- */
- case PRU_RCVOOB:
- case PRU_RCVD:
- return(EOPNOTSUPP);
-
- case PRU_LISTEN:
- case PRU_ACCEPT:
- case PRU_SENDOOB:
- error = EOPNOTSUPP;
- break;
-
- case PRU_SOCKADDR:
- if (rp->rcb_laddr == 0) {
- error = EINVAL;
- break;
- }
- len = rp->rcb_laddr->sa_len;
- bcopy((caddr_t)rp->rcb_laddr, mtod(nam, caddr_t), (unsigned)len);
- nam->m_len = len;
- break;
-
- case PRU_PEERADDR:
- if (rp->rcb_faddr == 0) {
- error = ENOTCONN;
- break;
- }
- len = rp->rcb_faddr->sa_len;
- bcopy((caddr_t)rp->rcb_faddr, mtod(nam, caddr_t), (unsigned)len);
- nam->m_len = len;
- break;
-
- default:
- panic("raw_usrreq");
- }
-release:
- if (m != NULL)
- m_freem(m);
- return (error);
-}
diff --git a/c/src/lib/libnetworking/net/route.c b/c/src/lib/libnetworking/net/route.c
deleted file mode 100644
index 683ddafee9..0000000000
--- a/c/src/lib/libnetworking/net/route.c
+++ /dev/null
@@ -1,959 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 1991, 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.
- *
- * @(#)route.c 8.2 (Berkeley) 11/15/93
- * $Id$
- */
-
-#include "opt_mrouting.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/ioctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/raw_cb.h>
-
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_mroute.h>
-
-#define SA(p) ((struct sockaddr *)(p))
-
-struct route_cb route_cb;
-static struct rtstat rtstat;
-struct radix_node_head *rt_tables[AF_MAX+1];
-
-static int rttrash; /* routes not in table but not freed */
-
-static void rt_maskedcopy __P((struct sockaddr *,
- struct sockaddr *, struct sockaddr *));
-static void rtable_init __P((void **));
-
-static void
-rtable_init(table)
- void **table;
-{
- struct domain *dom;
- for (dom = domains; dom; dom = dom->dom_next)
- if (dom->dom_rtattach)
- dom->dom_rtattach(&table[dom->dom_family],
- dom->dom_rtoffset);
-}
-
-void
-route_init()
-{
- rn_init(); /* initialize all zeroes, all ones, mask table */
- rtable_init((void **)rt_tables);
-}
-
-/*
- * Packet routing routines.
- */
-void
-rtalloc(ro)
- register struct route *ro;
-{
- if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP))
- return; /* XXX */
- ro->ro_rt = rtalloc1(&ro->ro_dst, 1, 0UL);
-}
-
-void
-rtalloc_ign(ro, ignore)
- register struct route *ro;
- u_long ignore;
-{
- if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP))
- return; /* XXX */
- ro->ro_rt = rtalloc1(&ro->ro_dst, 1, ignore);
-}
-
-/*
- * Look up the route that matches the address given
- * Or, at least try.. Create a cloned route if needed.
- */
-struct rtentry *
-rtalloc1(dst, report, ignflags)
- register struct sockaddr *dst;
- int report;
- u_long ignflags;
-{
- register struct radix_node_head *rnh = rt_tables[dst->sa_family];
- register struct rtentry *rt;
- register struct radix_node *rn;
- struct rtentry *newrt = 0;
- struct rt_addrinfo info;
- u_long nflags;
- int s = splnet(), err = 0, msgtype = RTM_MISS;
-
- /*
- * Look up the address in the table for that Address Family
- */
- if (rnh && (rn = rnh->rnh_matchaddr((caddr_t)dst, rnh)) &&
- ((rn->rn_flags & RNF_ROOT) == 0)) {
- /*
- * If we find it and it's not the root node, then
- * get a refernce on the rtentry associated.
- */
- newrt = rt = (struct rtentry *)rn;
- nflags = rt->rt_flags & ~ignflags;
- if (report && (nflags & (RTF_CLONING | RTF_PRCLONING))) {
- /*
- * We are apparently adding (report = 0 in delete).
- * If it requires that it be cloned, do so.
- * (This implies it wasn't a HOST route.)
- */
- err = rtrequest(RTM_RESOLVE, dst, SA(0),
- SA(0), 0, &newrt);
- if (err) {
- /*
- * If the cloning didn't succeed, maybe
- * what we have will do. Return that.
- */
- newrt = rt;
- rt->rt_refcnt++;
- goto miss;
- }
- if ((rt = newrt) && (rt->rt_flags & RTF_XRESOLVE)) {
- /*
- * If the new route specifies it be
- * externally resolved, then go do that.
- */
- msgtype = RTM_RESOLVE;
- goto miss;
- }
- } else
- rt->rt_refcnt++;
- } else {
- /*
- * Either we hit the root or couldn't find any match,
- * Which basically means
- * "caint get there frm here"
- */
- rtstat.rts_unreach++;
- miss: if (report) {
- /*
- * If required, report the failure to the supervising
- * Authorities.
- * For a delete, this is not an error. (report == 0)
- */
- bzero((caddr_t)&info, sizeof(info));
- info.rti_info[RTAX_DST] = dst;
- rt_missmsg(msgtype, &info, 0, err);
- }
- }
- splx(s);
- return (newrt);
-}
-
-void
-rtfree(rt)
- register struct rtentry *rt;
-{
- register struct radix_node_head *rnh =
- rt_tables[rt_key(rt)->sa_family];
- register struct ifaddr *ifa;
-
- if (rt == 0 || rnh == 0)
- panic("rtfree");
- rt->rt_refcnt--;
- if(rnh->rnh_close && rt->rt_refcnt == 0) {
- rnh->rnh_close((struct radix_node *)rt, rnh);
- }
- if (rt->rt_refcnt <= 0 && (rt->rt_flags & RTF_UP) == 0) {
- if (rt->rt_nodes->rn_flags & (RNF_ACTIVE | RNF_ROOT))
- panic ("rtfree 2");
- rttrash--;
- if (rt->rt_refcnt < 0) {
- printf("rtfree: %p not freed (neg refs)\n", rt);
- return;
- }
- ifa = rt->rt_ifa;
- IFAFREE(ifa);
- if (rt->rt_parent) {
- RTFREE(rt->rt_parent);
- }
- Free(rt_key(rt));
- Free(rt);
- }
-}
-
-void
-ifafree(ifa)
- register struct ifaddr *ifa;
-{
- if (ifa == NULL)
- panic("ifafree");
- if (ifa->ifa_refcnt == 0)
- free(ifa, M_IFADDR);
- else
- ifa->ifa_refcnt--;
-}
-
-/*
- * Force a routing table entry to the specified
- * destination to go through the given gateway.
- * Normally called as a result of a routing redirect
- * message from the network layer.
- *
- * N.B.: must be called at splnet
- *
- */
-void
-rtredirect(dst, gateway, netmask, flags, src, rtp)
- struct sockaddr *dst, *gateway, *netmask, *src;
- int flags;
- struct rtentry **rtp;
-{
- register struct rtentry *rt;
- int error = 0;
- short *stat = 0;
- struct rt_addrinfo info;
- struct ifaddr *ifa;
-
- /* verify the gateway is directly reachable */
- if ((ifa = ifa_ifwithnet(gateway)) == 0) {
- error = ENETUNREACH;
- goto out;
- }
- rt = rtalloc1(dst, 0, 0UL);
- /*
- * If the redirect isn't from our current router for this dst,
- * it's either old or wrong. If it redirects us to ourselves,
- * we have a routing loop, perhaps as a result of an interface
- * going down recently.
- */
-#define equal(a1, a2) (bcmp((caddr_t)(a1), (caddr_t)(a2), (a1)->sa_len) == 0)
- if (!(flags & RTF_DONE) && rt &&
- (!equal(src, rt->rt_gateway) || rt->rt_ifa != ifa))
- error = EINVAL;
- else if (ifa_ifwithaddr(gateway))
- error = EHOSTUNREACH;
- if (error)
- goto done;
- /*
- * Create a new entry if we just got back a wildcard entry
- * or the the lookup failed. This is necessary for hosts
- * which use routing redirects generated by smart gateways
- * to dynamically build the routing tables.
- */
- if ((rt == 0) || (rt_mask(rt) && rt_mask(rt)->sa_len < 2))
- goto create;
- /*
- * Don't listen to the redirect if it's
- * for a route to an interface.
- */
- if (rt->rt_flags & RTF_GATEWAY) {
- if (((rt->rt_flags & RTF_HOST) == 0) && (flags & RTF_HOST)) {
- /*
- * Changing from route to net => route to host.
- * Create new route, rather than smashing route to net.
- */
- create:
- flags |= RTF_GATEWAY | RTF_DYNAMIC;
- error = rtrequest((int)RTM_ADD, dst, gateway,
- netmask, flags,
- (struct rtentry **)0);
- stat = &rtstat.rts_dynamic;
- } else {
- /*
- * Smash the current notion of the gateway to
- * this destination. Should check about netmask!!!
- */
- rt->rt_flags |= RTF_MODIFIED;
- flags |= RTF_MODIFIED;
- stat = &rtstat.rts_newgateway;
- rt_setgate(rt, rt_key(rt), gateway);
- }
- } else
- error = EHOSTUNREACH;
-done:
- if (rt) {
- if (rtp && !error)
- *rtp = rt;
- else
- rtfree(rt);
- }
-out:
- if (error)
- rtstat.rts_badredirect++;
- else if (stat != NULL)
- (*stat)++;
- bzero((caddr_t)&info, sizeof(info));
- info.rti_info[RTAX_DST] = dst;
- info.rti_info[RTAX_GATEWAY] = gateway;
- info.rti_info[RTAX_NETMASK] = netmask;
- info.rti_info[RTAX_AUTHOR] = src;
- rt_missmsg(RTM_REDIRECT, &info, flags, error);
-}
-
-/*
-* Routing table ioctl interface.
-*/
-int
-rtioctl(req, data, p)
- int req;
- caddr_t data;
- struct proc *p;
-{
-#ifdef INET
- /* Multicast goop, grrr... */
-#ifdef MROUTING
- return mrt_ioctl(req, data);
-#else
- return mrt_ioctl(req, data, p);
-#endif
-#else /* INET */
- return ENXIO;
-#endif /* INET */
-}
-
-struct ifaddr *
-ifa_ifwithroute(flags, dst, gateway)
- int flags;
- struct sockaddr *dst, *gateway;
-{
- register struct ifaddr *ifa;
- if ((flags & RTF_GATEWAY) == 0) {
- /*
- * If we are adding a route to an interface,
- * and the interface is a pt to pt link
- * we should search for the destination
- * as our clue to the interface. Otherwise
- * we can use the local address.
- */
- ifa = 0;
- if (flags & RTF_HOST) {
- ifa = ifa_ifwithdstaddr(dst);
- }
- if (ifa == 0)
- ifa = ifa_ifwithaddr(gateway);
- } else {
- /*
- * If we are adding a route to a remote net
- * or host, the gateway may still be on the
- * other end of a pt to pt link.
- */
- ifa = ifa_ifwithdstaddr(gateway);
- }
- if (ifa == 0)
- ifa = ifa_ifwithnet(gateway);
- if (ifa == 0) {
- struct rtentry *rt = rtalloc1(dst, 0, 0UL);
- if (rt == 0)
- return (0);
- rt->rt_refcnt--;
- if ((ifa = rt->rt_ifa) == 0)
- return (0);
- }
- if (ifa->ifa_addr->sa_family != dst->sa_family) {
- struct ifaddr *oifa = ifa;
- ifa = ifaof_ifpforaddr(dst, ifa->ifa_ifp);
- if (ifa == 0)
- ifa = oifa;
- }
- return (ifa);
-}
-
-#define ROUNDUP(a) (a>0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
-
-static int rt_fixdelete(struct radix_node *, void *);
-static int rt_fixchange(struct radix_node *, void *);
-
-struct rtfc_arg {
- struct rtentry *rt0;
- struct radix_node_head *rnh;
-};
-
-/*
- * Do appropriate manipulations of a routing tree given
- * all the bits of info needed
- */
-int
-rtrequest(req, dst, gateway, netmask, flags, ret_nrt)
- int req, flags;
- struct sockaddr *dst, *gateway, *netmask;
- struct rtentry **ret_nrt;
-{
- int s = splnet(); int error = 0;
- register struct rtentry *rt;
- register struct radix_node *rn;
- register struct radix_node_head *rnh;
- struct ifaddr *ifa;
- struct sockaddr *ndst;
-#define senderr(x) { error = x ; goto bad; }
-
- /*
- * Find the correct routing tree to use for this Address Family
- */
- if ((rnh = rt_tables[dst->sa_family]) == 0)
- senderr(ESRCH);
- /*
- * If we are adding a host route then we don't want to put
- * a netmask in the tree
- */
- if (flags & RTF_HOST)
- netmask = 0;
- switch (req) {
- case RTM_DELETE:
- /*
- * Remove the item from the tree and return it.
- * Complain if it is not there and do no more processing.
- */
- if ((rn = rnh->rnh_deladdr(dst, netmask, rnh)) == 0)
- senderr(ESRCH);
- if (rn->rn_flags & (RNF_ACTIVE | RNF_ROOT))
- panic ("rtrequest delete");
- rt = (struct rtentry *)rn;
-
- /*
- * Now search what's left of the subtree for any cloned
- * routes which might have been formed from this node.
- */
- if ((rt->rt_flags & RTF_PRCLONING) && netmask) {
- rnh->rnh_walktree_from(rnh, dst, netmask,
- rt_fixdelete, rt);
- }
-
- /*
- * Remove any external references we may have.
- * This might result in another rtentry being freed if
- * we held it's last reference.
- */
- if (rt->rt_gwroute) {
- rt = rt->rt_gwroute;
- RTFREE(rt);
- (rt = (struct rtentry *)rn)->rt_gwroute = 0;
- }
-
- /*
- * NB: RTF_UP must be set during the search above,
- * because we might delete the last ref, causing
- * rt to get freed prematurely.
- */
- rt->rt_flags &= ~RTF_UP;
-
- /*
- * If there is llinfo or similar associated with the
- * route, give the interface a chance to deal with it..
- */
- if ((ifa = rt->rt_ifa) && ifa->ifa_rtrequest)
- ifa->ifa_rtrequest(RTM_DELETE, rt, SA(0));
- rttrash++;
- /*
- * If the caller wants it, then it can have it, but it's up to it
- * to free the rtentry as we won't be doing it.
- */
- if (ret_nrt)
- *ret_nrt = rt;
- else if (rt->rt_refcnt <= 0) {
- rt->rt_refcnt++; /* make a 1->0 transition */
- rtfree(rt);
- }
- break;
-
- case RTM_RESOLVE:
- if (ret_nrt == 0 || (rt = *ret_nrt) == 0)
- senderr(EINVAL);
- ifa = rt->rt_ifa;
- flags = rt->rt_flags &
- ~(RTF_CLONING | RTF_PRCLONING | RTF_STATIC);
- flags |= RTF_WASCLONED;
- gateway = rt->rt_gateway;
- if ((netmask = rt->rt_genmask) == 0)
- flags |= RTF_HOST;
- goto makeroute;
-
- case RTM_ADD:
- if ((flags & RTF_GATEWAY) && !gateway)
- panic("rtrequest: GATEWAY but no gateway");
-
- if ((ifa = ifa_ifwithroute(flags, dst, gateway)) == 0)
- senderr(ENETUNREACH);
-
- makeroute:
- R_Malloc(rt, struct rtentry *, sizeof(*rt));
- if (rt == 0)
- senderr(ENOBUFS);
- Bzero(rt, sizeof(*rt));
- rt->rt_flags = RTF_UP | flags;
- if ((error = rt_setgate(rt, dst, gateway))) {
- Free(rt);
- senderr(error);
- }
- ndst = rt_key(rt);
- if (netmask) {
- rt_maskedcopy(dst, ndst, netmask);
- } else
- Bcopy(dst, ndst, dst->sa_len);
-
- /*
- * This moved from below so that rnh->rnh_addaddr() can
- * examine the ifa and ifp if it so desires.
- */
- ifa->ifa_refcnt++;
- rt->rt_ifa = ifa;
- rt->rt_ifp = ifa->ifa_ifp;
-
- rn = rnh->rnh_addaddr((caddr_t)ndst, (caddr_t)netmask,
- rnh, rt->rt_nodes);
- if (rn == 0) {
- struct rtentry *rt2;
- /*
- * Uh-oh, we already have one of these in the tree.
- * We do a special hack: if the route that's already
- * there was generated by the protocol-cloning
- * mechanism, then we just blow it away and retry
- * the insertion of the new one.
- */
- rt2 = rtalloc1(dst, 0, RTF_PRCLONING);
- if (rt2 && rt2->rt_parent) {
- rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt2),
- rt2->rt_gateway,
- rt_mask(rt2), rt2->rt_flags, 0);
- RTFREE(rt2);
- rn = rnh->rnh_addaddr((caddr_t)ndst,
- (caddr_t)netmask,
- rnh, rt->rt_nodes);
- } else if (rt2) {
- RTFREE(rt2);
- }
- }
-
- if (rn == 0) {
- if (rt->rt_gwroute)
- rtfree(rt->rt_gwroute);
- if (rt->rt_ifa) {
- IFAFREE(rt->rt_ifa);
- }
- Free(rt_key(rt));
- Free(rt);
- senderr(EEXIST);
- }
- rt->rt_parent = 0;
-
- if (req == RTM_RESOLVE) {
- rt->rt_rmx = (*ret_nrt)->rt_rmx; /* copy metrics */
- if ((*ret_nrt)->rt_flags & RTF_PRCLONING) {
- rt->rt_parent = (*ret_nrt);
- (*ret_nrt)->rt_refcnt++;
- }
- }
- if (ifa->ifa_rtrequest)
- ifa->ifa_rtrequest(req, rt, SA(ret_nrt ? *ret_nrt : 0));
- /*
- * We repeat the same procedure from rt_setgate() here because
- * it doesn't fire when we call it there because the node
- * hasn't been added to the tree yet.
- */
- if (!(rt->rt_flags & RTF_HOST) && rt_mask(rt) != 0) {
- struct rtfc_arg arg;
- arg.rnh = rnh;
- arg.rt0 = rt;
- rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt),
- rt_fixchange, &arg);
- }
-
- if (ret_nrt) {
- *ret_nrt = rt;
- rt->rt_refcnt++;
- }
- break;
- }
-bad:
- splx(s);
- return (error);
-}
-
-/*
- * Called from rtrequest(RTM_DELETE, ...) to fix up the route's ``family''
- * (i.e., the routes related to it by the operation of cloning). This
- * routine is iterated over all potential former-child-routes by way of
- * rnh->rnh_walktree_from() above, and those that actually are children of
- * the late parent (passed in as VP here) are themselves deleted.
- */
-static int
-rt_fixdelete(struct radix_node *rn, void *vp)
-{
- struct rtentry *rt = (struct rtentry *)rn;
- struct rtentry *rt0 = vp;
-
- if (rt->rt_parent == rt0 && !(rt->rt_flags & RTF_PINNED)) {
- return rtrequest(RTM_DELETE, rt_key(rt),
- (struct sockaddr *)0, rt_mask(rt),
- rt->rt_flags, (struct rtentry **)0);
- }
- return 0;
-}
-
-/*
- * This routine is called from rt_setgate() to do the analogous thing for
- * adds and changes. There is the added complication in this case of a
- * middle insert; i.e., insertion of a new network route between an older
- * network route and (cloned) host routes. For this reason, a simple check
- * of rt->rt_parent is insufficient; each candidate route must be tested
- * against the (mask, value) of the new route (passed as before in vp)
- * to see if the new route matches it. Unfortunately, this has the obnoxious
- * property of also triggering for insertion /above/ a pre-existing network
- * route and clones. Sigh. This may be fixed some day.
- *
- * XXX - it may be possible to do fixdelete() for changes and reserve this
- * routine just for adds. I'm not sure why I thought it was necessary to do
- * changes this way.
- */
-#ifdef DEBUG
-int rtfcdebug = 0;
-#endif
-
-static int
-rt_fixchange(struct radix_node *rn, void *vp)
-{
- struct rtentry *rt = (struct rtentry *)rn;
- struct rtfc_arg *ap = vp;
- struct rtentry *rt0 = ap->rt0;
- struct radix_node_head *rnh = ap->rnh;
- u_char *xk1, *xm1, *xk2;
- int i, len;
-
-#ifdef DEBUG
- if (rtfcdebug)
- printf("rt_fixchange: rt %p, rt0 %p\n", rt, rt0);
-#endif
-
- if (!rt->rt_parent || (rt->rt_flags & RTF_PINNED)) {
-#ifdef DEBUG
- if(rtfcdebug) printf("no parent or pinned\n");
-#endif
- return 0;
- }
-
- if (rt->rt_parent == rt0) {
-#ifdef DEBUG
- if(rtfcdebug) printf("parent match\n");
-#endif
- return rtrequest(RTM_DELETE, rt_key(rt),
- (struct sockaddr *)0, rt_mask(rt),
- rt->rt_flags, (struct rtentry **)0);
- }
-
- /*
- * There probably is a function somewhere which does this...
- * if not, there should be.
- */
- len = imin(((struct sockaddr *)rt_key(rt0))->sa_len,
- ((struct sockaddr *)rt_key(rt))->sa_len);
-
- xk1 = (u_char *)rt_key(rt0);
- xm1 = (u_char *)rt_mask(rt0);
- xk2 = (u_char *)rt_key(rt);
-
- for (i = rnh->rnh_treetop->rn_off; i < len; i++) {
- if ((xk2[i] & xm1[i]) != xk1[i]) {
-#ifdef DEBUG
- if(rtfcdebug) printf("no match\n");
-#endif
- return 0;
- }
- }
-
- /*
- * OK, this node is a clone, and matches the node currently being
- * changed/added under the node's mask. So, get rid of it.
- */
-#ifdef DEBUG
- if(rtfcdebug) printf("deleting\n");
-#endif
- return rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *)0,
- rt_mask(rt), rt->rt_flags, (struct rtentry **)0);
-}
-
-int
-rt_setgate(rt0, dst, gate)
- struct rtentry *rt0;
- struct sockaddr *dst, *gate;
-{
- caddr_t new, old;
- int dlen = ROUNDUP(dst->sa_len), glen = ROUNDUP(gate->sa_len);
- register struct rtentry *rt = rt0;
- struct radix_node_head *rnh = rt_tables[dst->sa_family];
-
- /*
- * A host route with the destination equal to the gateway
- * will interfere with keeping LLINFO in the routing
- * table, so disallow it.
- */
- if (((rt0->rt_flags & (RTF_HOST|RTF_GATEWAY|RTF_LLINFO)) ==
- (RTF_HOST|RTF_GATEWAY)) &&
- (dst->sa_len == gate->sa_len) &&
- (bcmp(dst, gate, dst->sa_len) == 0)) {
- /*
- * The route might already exist if this is an RTM_CHANGE
- * or a routing redirect, so try to delete it.
- */
- if (rt_key(rt0))
- rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt0),
- rt0->rt_gateway, rt_mask(rt0), rt0->rt_flags, 0);
- return EADDRNOTAVAIL;
- }
-
- if (rt->rt_gateway == 0 || glen > ROUNDUP(rt->rt_gateway->sa_len)) {
- old = (caddr_t)rt_key(rt);
- R_Malloc(new, caddr_t, dlen + glen);
- if (new == 0)
- return ENOBUFS;
- rt->rt_nodes->rn_key = new;
- } else {
- new = rt->rt_nodes->rn_key;
- old = 0;
- }
- Bcopy(gate, (rt->rt_gateway = (struct sockaddr *)(new + dlen)), glen);
- if (old) {
- Bcopy(dst, new, dlen);
- Free(old);
- }
- if (rt->rt_gwroute) {
- rt = rt->rt_gwroute; RTFREE(rt);
- rt = rt0; rt->rt_gwroute = 0;
- }
- /*
- * Cloning loop avoidance:
- * In the presence of protocol-cloning and bad configuration,
- * it is possible to get stuck in bottomless mutual recursion
- * (rtrequest rt_setgate rtalloc1). We avoid this by not allowing
- * protocol-cloning to operate for gateways (which is probably the
- * correct choice anyway), and avoid the resulting reference loops
- * by disallowing any route to run through itself as a gateway.
- * This is obviuosly mandatory when we get rt->rt_output().
- */
- if (rt->rt_flags & RTF_GATEWAY) {
- rt->rt_gwroute = rtalloc1(gate, 1, RTF_PRCLONING);
- if (rt->rt_gwroute == rt) {
- RTFREE(rt->rt_gwroute);
- rt->rt_gwroute = 0;
- return EDQUOT; /* failure */
- }
- }
-
- /*
- * This isn't going to do anything useful for host routes, so
- * don't bother. Also make sure we have a reasonable mask
- * (we don't yet have one during adds).
- */
- if (!(rt->rt_flags & RTF_HOST) && rt_mask(rt) != 0) {
- struct rtfc_arg arg;
- arg.rnh = rnh;
- arg.rt0 = rt;
- rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt),
- rt_fixchange, &arg);
- }
-
- return 0;
-}
-
-static void
-rt_maskedcopy(src, dst, netmask)
- struct sockaddr *src, *dst, *netmask;
-{
- register u_char *cp1 = (u_char *)src;
- register u_char *cp2 = (u_char *)dst;
- register u_char *cp3 = (u_char *)netmask;
- u_char *cplim = cp2 + *cp3;
- u_char *cplim2 = cp2 + *cp1;
-
- *cp2++ = *cp1++; *cp2++ = *cp1++; /* copies sa_len & sa_family */
- cp3 += 2;
- if (cplim > cplim2)
- cplim = cplim2;
- while (cp2 < cplim)
- *cp2++ = *cp1++ & *cp3++;
- if (cp2 < cplim2)
- bzero((caddr_t)cp2, (unsigned)(cplim2 - cp2));
-}
-
-/*
- * Set up a routing table entry, normally
- * for an interface.
- */
-int
-rtinit(ifa, cmd, flags)
- register struct ifaddr *ifa;
- int cmd, flags;
-{
- register struct rtentry *rt;
- register struct sockaddr *dst;
- register struct sockaddr *deldst;
- struct mbuf *m = 0;
- struct rtentry *nrt = 0;
- int error;
-
- dst = flags & RTF_HOST ? ifa->ifa_dstaddr : ifa->ifa_addr;
- /*
- * If it's a delete, check that if it exists, it's on the correct
- * interface or we might scrub a route to another ifa which would
- * be confusing at best and possibly worse.
- */
- if (cmd == RTM_DELETE) {
- /*
- * It's a delete, so it should already exist..
- * If it's a net, mask off the host bits
- * (Assuming we have a mask)
- */
- if ((flags & RTF_HOST) == 0 && ifa->ifa_netmask) {
- m = m_get(M_WAIT, MT_SONAME);
- deldst = mtod(m, struct sockaddr *);
- rt_maskedcopy(dst, deldst, ifa->ifa_netmask);
- dst = deldst;
- }
- /*
- * Get an rtentry that is in the routing tree and
- * contains the correct info. (if this fails we can't get there).
- * We set "report" to FALSE so that if it doesn't exist,
- * it doesn't report an error or clone a route, etc. etc.
- */
- rt = rtalloc1(dst, 0, 0UL);
- if (rt) {
- /*
- * Ok so we found the rtentry. it has an extra reference
- * for us at this stage. we won't need that so
- * lop that off now.
- */
- rt->rt_refcnt--;
- if (rt->rt_ifa != ifa) {
- /*
- * If the interface in the rtentry doesn't match
- * the interface we are using, then we don't
- * want to delete it, so return an error.
- * This seems to be the only point of
- * this whole RTM_DELETE clause.
- */
- if (m)
- (void) m_free(m);
- return (flags & RTF_HOST ? EHOSTUNREACH
- : ENETUNREACH);
- }
- }
- /* XXX */
-#if 0
- else {
- /*
- * One would think that as we are deleting, and we know
- * it doesn't exist, we could just return at this point
- * with an "ELSE" clause, but apparently not..
- */
- return (flags & RTF_HOST ? EHOSTUNREACH
- : ENETUNREACH);
- }
-#endif
- }
- /*
- * Do the actual request
- */
- error = rtrequest(cmd, dst, ifa->ifa_addr, ifa->ifa_netmask,
- flags | ifa->ifa_flags, &nrt);
- if (m)
- (void) m_free(m);
- /*
- * If we are deleting, and we found an entry, then
- * it's been removed from the tree.. now throw it away.
- */
- if (cmd == RTM_DELETE && error == 0 && (rt = nrt)) {
- /*
- * notify any listenning routing agents of the change
- */
- rt_newaddrmsg(cmd, ifa, error, nrt);
- if (rt->rt_refcnt <= 0) {
- rt->rt_refcnt++; /* need a 1->0 transition to free */
- rtfree(rt);
- }
- }
-
- /*
- * We are adding, and we have a returned routing entry.
- * We need to sanity check the result.
- */
- if (cmd == RTM_ADD && error == 0 && (rt = nrt)) {
- /*
- * We just wanted to add it.. we don't actually need a reference
- */
- rt->rt_refcnt--;
- /*
- * If it came back with an unexpected interface, then it must
- * have already existed or something. (XXX)
- */
- if (rt->rt_ifa != ifa) {
- printf("rtinit: wrong ifa (%p) was (%p)\n", ifa,
- rt->rt_ifa);
- /*
- * Ask that the route we got back be removed
- * from the routing tables as we are trying
- * to supersede it.
- */
- if (rt->rt_ifa->ifa_rtrequest)
- rt->rt_ifa->ifa_rtrequest(RTM_DELETE, rt, SA(0));
- /*
- * Remove the referenve to the it's ifaddr.
- */
- IFAFREE(rt->rt_ifa);
- /*
- * And substitute in references to the ifaddr
- * we are adding.
- */
- rt->rt_ifa = ifa;
- rt->rt_ifp = ifa->ifa_ifp;
- ifa->ifa_refcnt++;
- /*
- * Now add it to the routing table
- * XXX could we have just left it?
- * as it might have been in the right place..
- */
- if (ifa->ifa_rtrequest)
- ifa->ifa_rtrequest(RTM_ADD, rt, SA(0));
- }
- /*
- * notify any listenning routing agents of the change
- */
- rt_newaddrmsg(cmd, ifa, error, nrt);
- }
- return (error);
-}
diff --git a/c/src/lib/libnetworking/net/route.h b/c/src/lib/libnetworking/net/route.h
deleted file mode 100644
index 69d76909fc..0000000000
--- a/c/src/lib/libnetworking/net/route.h
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)route.h 8.3 (Berkeley) 4/19/94
- * $Id$
- */
-
-#ifndef _NET_ROUTE_H_
-#define _NET_ROUTE_H_
-
-/*
- * Kernel resident routing tables.
- *
- * The routing tables are initialized when interface addresses
- * are set by making entries for all directly connected interfaces.
- */
-
-/*
- * A route consists of a destination address and a reference
- * to a routing entry. These are often held by protocols
- * in their control blocks, e.g. inpcb.
- */
-struct route {
- struct rtentry *ro_rt;
- struct sockaddr ro_dst;
-};
-
-/*
- * These numbers are used by reliable protocols for determining
- * retransmission behavior and are included in the routing structure.
- */
-struct rt_metrics {
- u_long rmx_locks; /* Kernel must leave these values alone */
- u_long rmx_mtu; /* MTU for this path */
- u_long rmx_hopcount; /* max hops expected */
- u_long rmx_expire; /* lifetime for route, e.g. redirect */
- u_long rmx_recvpipe; /* inbound delay-bandwidth product */
- u_long rmx_sendpipe; /* outbound delay-bandwidth product */
- u_long rmx_ssthresh; /* outbound gateway buffer limit */
- u_long rmx_rtt; /* estimated round trip time */
- u_long rmx_rttvar; /* estimated rtt variance */
- u_long rmx_pksent; /* packets sent using this route */
- u_long rmx_filler[4]; /* will be used for T/TCP later */
-};
-
-/*
- * rmx_rtt and rmx_rttvar are stored as microseconds;
- * RTTTOPRHZ(rtt) converts to a value suitable for use
- * by a protocol slowtimo counter.
- */
-#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */
-#define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ))
-
-/*
- * XXX kernel function pointer `rt_output' is visible to applications.
- */
-struct mbuf;
-
-/*
- * We distinguish between routes to hosts and routes to networks,
- * preferring the former if available. For each route we infer
- * the interface to use from the gateway address supplied when
- * the route was entered. Routes that forward packets through
- * gateways are marked so that the output routines know to address the
- * gateway rather than the ultimate destination.
- */
-#ifndef RNF_NORMAL
-#include <net/radix.h>
-#endif
-struct rtentry {
- struct radix_node rt_nodes[2]; /* tree glue, and other values */
-#define rt_key(r) ((struct sockaddr *)((r)->rt_nodes->rn_key))
-#define rt_mask(r) ((struct sockaddr *)((r)->rt_nodes->rn_mask))
- struct sockaddr *rt_gateway; /* value */
- short rt_filler; /* was short flags field */
- short rt_refcnt; /* # held references */
- u_long rt_flags; /* up/down?, host/net */
- struct ifnet *rt_ifp; /* the answer: interface to use */
- struct ifaddr *rt_ifa; /* the answer: interface to use */
- struct sockaddr *rt_genmask; /* for generation of cloned routes */
- caddr_t rt_llinfo; /* pointer to link level info cache */
- struct rt_metrics rt_rmx; /* metrics used by rx'ing protocols */
- struct rtentry *rt_gwroute; /* implied entry for gatewayed routes */
- int (*rt_output) __P((struct ifnet *, struct mbuf *,
- struct sockaddr *, struct rtentry *));
- /* output routine for this (rt,if) */
- struct rtentry *rt_parent; /* cloning parent of this route */
- void *rt_filler2; /* more filler */
-};
-
-/*
- * Following structure necessary for 4.3 compatibility;
- * We should eventually move it to a compat file.
- */
-struct ortentry {
- u_long rt_hash; /* to speed lookups */
- struct sockaddr rt_dst; /* key */
- struct sockaddr rt_gateway; /* value */
- short rt_flags; /* up/down?, host/net */
- short rt_refcnt; /* # held references */
- u_long rt_use; /* raw # packets forwarded */
- struct ifnet *rt_ifp; /* the answer: interface to use */
-};
-
-#define rt_use rt_rmx.rmx_pksent
-
-#define RTF_UP 0x1 /* route usable */
-#define RTF_GATEWAY 0x2 /* destination is a gateway */
-#define RTF_HOST 0x4 /* host entry (net otherwise) */
-#define RTF_REJECT 0x8 /* host or net unreachable */
-#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */
-#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */
-#define RTF_DONE 0x40 /* message confirmed */
-/* 0x80 unused */
-#define RTF_CLONING 0x100 /* generate new routes on use */
-#define RTF_XRESOLVE 0x200 /* external daemon resolves name */
-#define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP) */
-#define RTF_STATIC 0x800 /* manually added */
-#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */
-#define RTF_PROTO2 0x4000 /* protocol specific routing flag */
-#define RTF_PROTO1 0x8000 /* protocol specific routing flag */
-
-#define RTF_PRCLONING 0x10000 /* protocol requires cloning */
-#define RTF_WASCLONED 0x20000 /* route generated through cloning */
-#define RTF_PROTO3 0x40000 /* protocol specific routing flag */
-/* 0x80000 unused */
-#define RTF_PINNED 0x100000 /* future use */
-#define RTF_LOCAL 0x200000 /* route represents a local address */
-#define RTF_BROADCAST 0x400000 /* route represents a bcast address */
-#define RTF_MULTICAST 0x800000 /* route represents a mcast address */
- /* 0x1000000 and up unassigned */
-
-/*
- * Routing statistics.
- */
-struct rtstat {
- short rts_badredirect; /* bogus redirect calls */
- short rts_dynamic; /* routes created by redirects */
- short rts_newgateway; /* routes modified by redirects */
- short rts_unreach; /* lookups which failed */
- short rts_wildcard; /* lookups satisfied by a wildcard */
-};
-/*
- * Structures for routing messages.
- */
-struct rt_msghdr {
- u_short rtm_msglen; /* to skip over non-understood messages */
- u_char rtm_version; /* future binary compatibility */
- u_char rtm_type; /* message type */
- u_short rtm_index; /* index for associated ifp */
- int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
- int rtm_addrs; /* bitmask identifying sockaddrs in msg */
- pid_t rtm_pid; /* identify sender */
- int rtm_seq; /* for sender to identify action */
- int rtm_errno; /* why failed */
- int rtm_use; /* from rtentry */
- u_long rtm_inits; /* which metrics we are initializing */
- struct rt_metrics rtm_rmx; /* metrics themselves */
-};
-
-#define RTM_VERSION 5 /* Up the ante and ignore older versions */
-
-#define RTM_ADD 0x1 /* Add Route */
-#define RTM_DELETE 0x2 /* Delete Route */
-#define RTM_CHANGE 0x3 /* Change Metrics or flags */
-#define RTM_GET 0x4 /* Report Metrics */
-#define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */
-#define RTM_REDIRECT 0x6 /* Told to use different route */
-#define RTM_MISS 0x7 /* Lookup failed on this address */
-#define RTM_LOCK 0x8 /* fix specified metrics */
-#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */
-#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */
-#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */
-#define RTM_NEWADDR 0xc /* address being added to iface */
-#define RTM_DELADDR 0xd /* address being removed from iface */
-#define RTM_IFINFO 0xe /* iface going up/down etc. */
-
-#define RTV_MTU 0x1 /* init or lock _mtu */
-#define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */
-#define RTV_EXPIRE 0x4 /* init or lock _hopcount */
-#define RTV_RPIPE 0x8 /* init or lock _recvpipe */
-#define RTV_SPIPE 0x10 /* init or lock _sendpipe */
-#define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */
-#define RTV_RTT 0x40 /* init or lock _rtt */
-#define RTV_RTTVAR 0x80 /* init or lock _rttvar */
-
-/*
- * Bitmask values for rtm_addr.
- */
-#define RTA_DST 0x1 /* destination sockaddr present */
-#define RTA_GATEWAY 0x2 /* gateway sockaddr present */
-#define RTA_NETMASK 0x4 /* netmask sockaddr present */
-#define RTA_GENMASK 0x8 /* cloning mask sockaddr present */
-#define RTA_IFP 0x10 /* interface name sockaddr present */
-#define RTA_IFA 0x20 /* interface addr sockaddr present */
-#define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */
-#define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */
-
-/*
- * Index offsets for sockaddr array for alternate internal encoding.
- */
-#define RTAX_DST 0 /* destination sockaddr present */
-#define RTAX_GATEWAY 1 /* gateway sockaddr present */
-#define RTAX_NETMASK 2 /* netmask sockaddr present */
-#define RTAX_GENMASK 3 /* cloning mask sockaddr present */
-#define RTAX_IFP 4 /* interface name sockaddr present */
-#define RTAX_IFA 5 /* interface addr sockaddr present */
-#define RTAX_AUTHOR 6 /* sockaddr for author of redirect */
-#define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */
-#define RTAX_MAX 8 /* size of array to allocate */
-
-struct rt_addrinfo {
- int rti_addrs;
- struct sockaddr *rti_info[RTAX_MAX];
-};
-
-struct route_cb {
- int ip_count;
- int ipx_count;
- int ns_count;
- int iso_count;
- int any_count;
-};
-
-#ifdef KERNEL
-#define RTFREE(rt) \
- if ((rt)->rt_refcnt <= 1) \
- rtfree(rt); \
- else \
- (rt)->rt_refcnt--;
-
-extern struct route_cb route_cb;
-extern struct rtstat rtstat;
-extern struct radix_node_head *rt_tables[AF_MAX+1];
-
-void route_init __P((void));
-void rt_ifmsg __P((struct ifnet *));
-void rt_missmsg __P((int, struct rt_addrinfo *, int, int));
-void rt_newaddrmsg __P((int, struct ifaddr *, int, struct rtentry *));
-int rt_setgate __P((struct rtentry *,
- struct sockaddr *, struct sockaddr *));
-void rtalloc __P((struct route *));
-void rtalloc_ign __P((struct route *, unsigned long));
-struct rtentry *
- rtalloc1 __P((struct sockaddr *, int, unsigned long));
-void rtfree __P((struct rtentry *));
-int rtinit __P((struct ifaddr *, int, int));
-int rtioctl __P((int, caddr_t, struct proc *));
-void rtredirect __P((struct sockaddr *, struct sockaddr *,
- struct sockaddr *, int, struct sockaddr *, struct rtentry **));
-int rtrequest __P((int, struct sockaddr *,
- struct sockaddr *, struct sockaddr *, int, struct rtentry **));
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/net/rtsock.c b/c/src/lib/libnetworking/net/rtsock.c
deleted file mode 100644
index 57e777906a..0000000000
--- a/c/src/lib/libnetworking/net/rtsock.c
+++ /dev/null
@@ -1,829 +0,0 @@
-/*
- * Copyright (c) 1988, 1991, 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.
- *
- * @(#)rtsock.c 8.5 (Berkeley) 11/2/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/raw_cb.h>
-
-static struct sockaddr route_dst = { 2, PF_ROUTE, };
-static struct sockaddr route_src = { 2, PF_ROUTE, };
-static struct sockaddr sa_zero = { sizeof(sa_zero), AF_INET, };
-static struct sockproto route_proto = { PF_ROUTE, };
-
-struct walkarg {
- int w_tmemsize;
- int w_op, w_arg;
- caddr_t w_tmem;
- struct sysctl_req *w_req;
-};
-
-static struct mbuf *
- rt_msg1 __P((int, struct rt_addrinfo *));
-static int rt_msg2 __P((int,
- struct rt_addrinfo *, caddr_t, struct walkarg *));
-static int rt_xaddrs __P((caddr_t, caddr_t, struct rt_addrinfo *));
-static int sysctl_dumpentry __P((struct radix_node *rn, void *vw));
-static int sysctl_iflist __P((int af, struct walkarg *w));
-static int route_output __P((struct mbuf *, struct socket *));
-static int route_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-static void rt_setmetrics __P((u_long, struct rt_metrics *, struct rt_metrics *));
-
-/* Sleazy use of local variables throughout file, warning!!!! */
-#define dst info.rti_info[RTAX_DST]
-#define gate info.rti_info[RTAX_GATEWAY]
-#define netmask info.rti_info[RTAX_NETMASK]
-#define genmask info.rti_info[RTAX_GENMASK]
-#define ifpaddr info.rti_info[RTAX_IFP]
-#define ifaaddr info.rti_info[RTAX_IFA]
-#define brdaddr info.rti_info[RTAX_BRD]
-
-/*ARGSUSED*/
-static int
-route_usrreq(so, req, m, nam, control)
- register struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register int error = 0;
- register struct rawcb *rp = sotorawcb(so);
- int s;
-
- if (req == PRU_ATTACH) {
- MALLOC(rp, struct rawcb *, sizeof(*rp), M_PCB, M_WAITOK);
- so->so_pcb = (caddr_t)rp;
- if (so->so_pcb)
- bzero(so->so_pcb, sizeof(*rp));
- }
- if (req == PRU_DETACH && rp) {
- int af = rp->rcb_proto.sp_protocol;
- if (af == AF_INET)
- route_cb.ip_count--;
- else if (af == AF_IPX)
- route_cb.ipx_count--;
- else if (af == AF_NS)
- route_cb.ns_count--;
- else if (af == AF_ISO)
- route_cb.iso_count--;
- route_cb.any_count--;
- }
- s = splnet();
- error = raw_usrreq(so, req, m, nam, control);
- rp = sotorawcb(so);
- if (req == PRU_ATTACH && rp) {
- int af = rp->rcb_proto.sp_protocol;
- if (error) {
- free((caddr_t)rp, M_PCB);
- splx(s);
- return (error);
- }
- if (af == AF_INET)
- route_cb.ip_count++;
- else if (af == AF_IPX)
- route_cb.ipx_count++;
- else if (af == AF_NS)
- route_cb.ns_count++;
- else if (af == AF_ISO)
- route_cb.iso_count++;
- rp->rcb_faddr = &route_src;
- route_cb.any_count++;
- soisconnected(so);
- so->so_options |= SO_USELOOPBACK;
- }
- splx(s);
- return (error);
-}
-
-/*ARGSUSED*/
-static int
-route_output(m, so)
- register struct mbuf *m;
- struct socket *so;
-{
- register struct rt_msghdr *rtm = 0;
- register struct rtentry *rt = 0;
- struct rtentry *saved_nrt = 0;
- struct radix_node_head *rnh;
- struct rt_addrinfo info;
- int len, error = 0;
- struct ifnet *ifp = 0;
- struct ifaddr *ifa = 0;
-
-#define senderr(e) { error = e; goto flush;}
- if (m == 0 || ((m->m_len < sizeof(long)) &&
- (m = m_pullup(m, sizeof(long))) == 0))
- return (ENOBUFS);
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("route_output");
- len = m->m_pkthdr.len;
- if (len < sizeof(*rtm) ||
- len != mtod(m, struct rt_msghdr *)->rtm_msglen) {
- dst = 0;
- senderr(EINVAL);
- }
- R_Malloc(rtm, struct rt_msghdr *, len);
- if (rtm == 0) {
- dst = 0;
- senderr(ENOBUFS);
- }
- m_copydata(m, 0, len, (caddr_t)rtm);
- if (rtm->rtm_version != RTM_VERSION) {
- dst = 0;
- senderr(EPROTONOSUPPORT);
- }
- info.rti_addrs = rtm->rtm_addrs;
- if (rt_xaddrs((caddr_t)(rtm + 1), len + (caddr_t)rtm, &info)) {
- dst = 0;
- senderr(EINVAL);
- }
- if (dst == 0 || (dst->sa_family >= AF_MAX)
- || (gate != 0 && (gate->sa_family >= AF_MAX)))
- senderr(EINVAL);
- if (genmask) {
- struct radix_node *t;
- t = rn_addmask((caddr_t)genmask, 0, 1);
- if (t && Bcmp(genmask, t->rn_key, *(u_char *)genmask) == 0)
- genmask = (struct sockaddr *)(t->rn_key);
- else
- senderr(ENOBUFS);
- }
- switch (rtm->rtm_type) {
-
- case RTM_ADD:
- if (gate == 0)
- senderr(EINVAL);
- error = rtrequest(RTM_ADD, dst, gate, netmask,
- rtm->rtm_flags, &saved_nrt);
- if (error == 0 && saved_nrt) {
- rt_setmetrics(rtm->rtm_inits,
- &rtm->rtm_rmx, &saved_nrt->rt_rmx);
- saved_nrt->rt_rmx.rmx_locks &= ~(rtm->rtm_inits);
- saved_nrt->rt_rmx.rmx_locks |=
- (rtm->rtm_inits & rtm->rtm_rmx.rmx_locks);
- saved_nrt->rt_refcnt--;
- saved_nrt->rt_genmask = genmask;
- }
- break;
-
- case RTM_DELETE:
- error = rtrequest(RTM_DELETE, dst, gate, netmask,
- rtm->rtm_flags, &saved_nrt);
- if (error == 0) {
- if ((rt = saved_nrt))
- rt->rt_refcnt++;
- goto report;
- }
- break;
-
- case RTM_GET:
- case RTM_CHANGE:
- case RTM_LOCK:
- if ((rnh = rt_tables[dst->sa_family]) == 0) {
- senderr(EAFNOSUPPORT);
- } else if ((rt = (struct rtentry *)
- rnh->rnh_lookup(dst, netmask, rnh)))
- rt->rt_refcnt++;
- else
- senderr(ESRCH);
- switch(rtm->rtm_type) {
-
- case RTM_GET:
- report:
- dst = rt_key(rt);
- gate = rt->rt_gateway;
- netmask = rt_mask(rt);
- genmask = rt->rt_genmask;
- if (rtm->rtm_addrs & (RTA_IFP | RTA_IFA)) {
- ifp = rt->rt_ifp;
- if (ifp) {
- ifpaddr = ifp->if_addrlist->ifa_addr;
- ifaaddr = rt->rt_ifa->ifa_addr;
- rtm->rtm_index = ifp->if_index;
- } else {
- ifpaddr = 0;
- ifaaddr = 0;
- }
- }
- len = rt_msg2(rtm->rtm_type, &info, (caddr_t)0,
- (struct walkarg *)0);
- if (len > rtm->rtm_msglen) {
- struct rt_msghdr *new_rtm;
- R_Malloc(new_rtm, struct rt_msghdr *, len);
- if (new_rtm == 0)
- senderr(ENOBUFS);
- Bcopy(rtm, new_rtm, rtm->rtm_msglen);
- Free(rtm); rtm = new_rtm;
- }
- (void)rt_msg2(rtm->rtm_type, &info, (caddr_t)rtm,
- (struct walkarg *)0);
- rtm->rtm_flags = rt->rt_flags;
- rtm->rtm_rmx = rt->rt_rmx;
- rtm->rtm_addrs = info.rti_addrs;
- break;
-
- case RTM_CHANGE:
- if (gate && (error = rt_setgate(rt, rt_key(rt), gate)))
- senderr(error);
-
- /*
- * If they tried to change things but didn't specify
- * the required gateway, then just use the old one.
- * This can happen if the user tries to change the
- * flags on the default route without changing the
- * default gateway. Changing flags still doesn't work.
- */
- if ((rt->rt_flags & RTF_GATEWAY) && !gate)
- gate = rt->rt_gateway;
-
- /* new gateway could require new ifaddr, ifp;
- flags may also be different; ifp may be specified
- by ll sockaddr when protocol address is ambiguous */
- if (ifpaddr && (ifa = ifa_ifwithnet(ifpaddr)) &&
- (ifp = ifa->ifa_ifp) && (ifaaddr || gate))
- ifa = ifaof_ifpforaddr(ifaaddr ? ifaaddr : gate,
- ifp);
- else if ((ifaaddr && (ifa = ifa_ifwithaddr(ifaaddr))) ||
- (gate && (ifa = ifa_ifwithroute(rt->rt_flags,
- rt_key(rt), gate))))
- ifp = ifa->ifa_ifp;
- if (ifa) {
- register struct ifaddr *oifa = rt->rt_ifa;
- if (oifa != ifa) {
- if (oifa && oifa->ifa_rtrequest)
- oifa->ifa_rtrequest(RTM_DELETE,
- rt, gate);
- IFAFREE(rt->rt_ifa);
- rt->rt_ifa = ifa;
- ifa->ifa_refcnt++;
- rt->rt_ifp = ifp;
- }
- }
- rt_setmetrics(rtm->rtm_inits, &rtm->rtm_rmx,
- &rt->rt_rmx);
- if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest)
- rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, gate);
- if (genmask)
- rt->rt_genmask = genmask;
- /*
- * Fall into
- */
- case RTM_LOCK:
- rt->rt_rmx.rmx_locks &= ~(rtm->rtm_inits);
- rt->rt_rmx.rmx_locks |=
- (rtm->rtm_inits & rtm->rtm_rmx.rmx_locks);
- break;
- }
- break;
-
- default:
- senderr(EOPNOTSUPP);
- }
-
-flush:
- if (rtm) {
- if (error)
- rtm->rtm_errno = error;
- else
- rtm->rtm_flags |= RTF_DONE;
- }
- if (rt)
- rtfree(rt);
- {
- register struct rawcb *rp = 0;
- /*
- * Check to see if we don't want our own messages.
- */
- if ((so->so_options & SO_USELOOPBACK) == 0) {
- if (route_cb.any_count <= 1) {
- if (rtm)
- Free(rtm);
- m_freem(m);
- return (error);
- }
- /* There is another listener, so construct message */
- rp = sotorawcb(so);
- }
- if (rtm) {
- m_copyback(m, 0, rtm->rtm_msglen, (caddr_t)rtm);
- Free(rtm);
- }
- if (rp)
- rp->rcb_proto.sp_family = 0; /* Avoid us */
- if (dst)
- route_proto.sp_protocol = dst->sa_family;
- raw_input(m, &route_proto, &route_src, &route_dst);
- if (rp)
- rp->rcb_proto.sp_family = PF_ROUTE;
- }
- return (error);
-}
-
-static void
-rt_setmetrics(which, in, out)
- u_long which;
- register struct rt_metrics *in, *out;
-{
-#define metric(f, e) if (which & (f)) out->e = in->e;
- metric(RTV_RPIPE, rmx_recvpipe);
- metric(RTV_SPIPE, rmx_sendpipe);
- metric(RTV_SSTHRESH, rmx_ssthresh);
- metric(RTV_RTT, rmx_rtt);
- metric(RTV_RTTVAR, rmx_rttvar);
- metric(RTV_HOPCOUNT, rmx_hopcount);
- metric(RTV_MTU, rmx_mtu);
- metric(RTV_EXPIRE, rmx_expire);
-#undef metric
-}
-
-#define ROUNDUP(a) \
- ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
-#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
-
-
-/*
- * Extract the addresses of the passed sockaddrs.
- * Do a little sanity checking so as to avoid bad memory references.
- * This data is derived straight from userland.
- */
-static int
-rt_xaddrs(cp, cplim, rtinfo)
- register caddr_t cp, cplim;
- register struct rt_addrinfo *rtinfo;
-{
- register struct sockaddr *sa;
- register int i;
-
- bzero(rtinfo->rti_info, sizeof(rtinfo->rti_info));
- for (i = 0; (i < RTAX_MAX) && (cp < cplim); i++) {
- if ((rtinfo->rti_addrs & (1 << i)) == 0)
- continue;
- sa = (struct sockaddr *)cp;
- /*
- * It won't fit.
- */
- if ( (cp + sa->sa_len) > cplim ) {
- return (EINVAL);
- }
-
- /*
- * there are no more.. quit now
- * If there are more bits, they are in error.
- * I've seen this. route(1) can evidently generate these.
- * This causes kernel to core dump.
- * for compatibility, If we see this, point to a safe address.
- */
- if (sa->sa_len == 0) {
- rtinfo->rti_info[i] = &sa_zero;
- return (0); /* should be EINVAL but for compat */
- }
-
- /* accept it */
- rtinfo->rti_info[i] = sa;
- ADVANCE(cp, sa);
- }
- return (0);
-}
-
-static struct mbuf *
-rt_msg1(type, rtinfo)
- int type;
- register struct rt_addrinfo *rtinfo;
-{
- register struct rt_msghdr *rtm;
- register struct mbuf *m;
- register int i;
- register struct sockaddr *sa;
- int len, dlen;
-
- m = m_gethdr(M_DONTWAIT, MT_DATA);
- if (m == 0)
- return (m);
- switch (type) {
-
- case RTM_DELADDR:
- case RTM_NEWADDR:
- len = sizeof(struct ifa_msghdr);
- break;
-
- case RTM_IFINFO:
- len = sizeof(struct if_msghdr);
- break;
-
- default:
- len = sizeof(struct rt_msghdr);
- }
- if (len > MHLEN)
- panic("rt_msg1");
- m->m_pkthdr.len = m->m_len = len;
- m->m_pkthdr.rcvif = 0;
- rtm = mtod(m, struct rt_msghdr *);
- bzero((caddr_t)rtm, len);
- for (i = 0; i < RTAX_MAX; i++) {
- if ((sa = rtinfo->rti_info[i]) == NULL)
- continue;
- rtinfo->rti_addrs |= (1 << i);
- dlen = ROUNDUP(sa->sa_len);
- m_copyback(m, len, dlen, (caddr_t)sa);
- len += dlen;
- }
- if (m->m_pkthdr.len != len) {
- m_freem(m);
- return (NULL);
- }
- rtm->rtm_msglen = len;
- rtm->rtm_version = RTM_VERSION;
- rtm->rtm_type = type;
- return (m);
-}
-
-static int
-rt_msg2(type, rtinfo, cp, w)
- int type;
- register struct rt_addrinfo *rtinfo;
- caddr_t cp;
- struct walkarg *w;
-{
- register int i;
- int len, dlen, second_time = 0;
- caddr_t cp0;
-
- rtinfo->rti_addrs = 0;
-again:
- switch (type) {
-
- case RTM_DELADDR:
- case RTM_NEWADDR:
- len = sizeof(struct ifa_msghdr);
- break;
-
- case RTM_IFINFO:
- len = sizeof(struct if_msghdr);
- break;
-
- default:
- len = sizeof(struct rt_msghdr);
- }
- cp0 = cp;
- if (cp0)
- cp += len;
- for (i = 0; i < RTAX_MAX; i++) {
- register struct sockaddr *sa;
-
- if ((sa = rtinfo->rti_info[i]) == 0)
- continue;
- rtinfo->rti_addrs |= (1 << i);
- dlen = ROUNDUP(sa->sa_len);
- if (cp) {
- bcopy((caddr_t)sa, cp, (unsigned)dlen);
- cp += dlen;
- }
- len += dlen;
- }
- if (cp == 0 && w != NULL && !second_time) {
- register struct walkarg *rw = w;
-
- if (rw->w_req) {
- if (rw->w_tmemsize < len) {
- if (rw->w_tmem)
- free(rw->w_tmem, M_RTABLE);
- rw->w_tmem = (caddr_t)
- malloc(len, M_RTABLE, M_NOWAIT);
- if (rw->w_tmem)
- rw->w_tmemsize = len;
- }
- if (rw->w_tmem) {
- cp = rw->w_tmem;
- second_time = 1;
- goto again;
- }
- }
- }
- if (cp) {
- register struct rt_msghdr *rtm = (struct rt_msghdr *)cp0;
-
- rtm->rtm_version = RTM_VERSION;
- rtm->rtm_type = type;
- rtm->rtm_msglen = len;
- }
- return (len);
-}
-
-/*
- * This routine is called to generate a message from the routing
- * socket indicating that a redirect has occured, a routing lookup
- * has failed, or that a protocol has detected timeouts to a particular
- * destination.
- */
-void
-rt_missmsg(type, rtinfo, flags, error)
- int type, flags, error;
- register struct rt_addrinfo *rtinfo;
-{
- register struct rt_msghdr *rtm;
- register struct mbuf *m;
- struct sockaddr *sa = rtinfo->rti_info[RTAX_DST];
-
- if (route_cb.any_count == 0)
- return;
- m = rt_msg1(type, rtinfo);
- if (m == 0)
- return;
- rtm = mtod(m, struct rt_msghdr *);
- rtm->rtm_flags = RTF_DONE | flags;
- rtm->rtm_errno = error;
- rtm->rtm_addrs = rtinfo->rti_addrs;
- route_proto.sp_protocol = sa ? sa->sa_family : 0;
- raw_input(m, &route_proto, &route_src, &route_dst);
-}
-
-/*
- * This routine is called to generate a message from the routing
- * socket indicating that the status of a network interface has changed.
- */
-void
-rt_ifmsg(ifp)
- register struct ifnet *ifp;
-{
- register struct if_msghdr *ifm;
- struct mbuf *m;
- struct rt_addrinfo info;
-
- if (route_cb.any_count == 0)
- return;
- bzero((caddr_t)&info, sizeof(info));
- m = rt_msg1(RTM_IFINFO, &info);
- if (m == 0)
- return;
- ifm = mtod(m, struct if_msghdr *);
- ifm->ifm_index = ifp->if_index;
- ifm->ifm_flags = (u_short)ifp->if_flags;
- ifm->ifm_data = ifp->if_data;
- ifm->ifm_addrs = 0;
- route_proto.sp_protocol = 0;
- raw_input(m, &route_proto, &route_src, &route_dst);
-}
-
-/*
- * This is called to generate messages from the routing socket
- * indicating a network interface has had addresses associated with it.
- * if we ever reverse the logic and replace messages TO the routing
- * socket indicate a request to configure interfaces, then it will
- * be unnecessary as the routing socket will automatically generate
- * copies of it.
- */
-void
-rt_newaddrmsg(cmd, ifa, error, rt)
- int cmd, error;
- register struct ifaddr *ifa;
- register struct rtentry *rt;
-{
- struct rt_addrinfo info;
- struct sockaddr *sa = 0;
- int pass;
- struct mbuf *m = 0;
- struct ifnet *ifp = ifa->ifa_ifp;
-
- if (route_cb.any_count == 0)
- return;
- for (pass = 1; pass < 3; pass++) {
- bzero((caddr_t)&info, sizeof(info));
- if ((cmd == RTM_ADD && pass == 1) ||
- (cmd == RTM_DELETE && pass == 2)) {
- register struct ifa_msghdr *ifam;
- int ncmd = cmd == RTM_ADD ? RTM_NEWADDR : RTM_DELADDR;
-
- ifaaddr = sa = ifa->ifa_addr;
- ifpaddr = ifp->if_addrlist->ifa_addr;
- netmask = ifa->ifa_netmask;
- brdaddr = ifa->ifa_dstaddr;
- if ((m = rt_msg1(ncmd, &info)) == NULL)
- continue;
- ifam = mtod(m, struct ifa_msghdr *);
- ifam->ifam_index = ifp->if_index;
- ifam->ifam_metric = ifa->ifa_metric;
- ifam->ifam_flags = ifa->ifa_flags;
- ifam->ifam_addrs = info.rti_addrs;
- }
- if ((cmd == RTM_ADD && pass == 2) ||
- (cmd == RTM_DELETE && pass == 1)) {
- register struct rt_msghdr *rtm;
-
- if (rt == 0)
- continue;
- netmask = rt_mask(rt);
- dst = sa = rt_key(rt);
- gate = rt->rt_gateway;
- if ((m = rt_msg1(cmd, &info)) == NULL)
- continue;
- rtm = mtod(m, struct rt_msghdr *);
- rtm->rtm_index = ifp->if_index;
- rtm->rtm_flags |= rt->rt_flags;
- rtm->rtm_errno = error;
- rtm->rtm_addrs = info.rti_addrs;
- }
- route_proto.sp_protocol = sa ? sa->sa_family : 0;
- raw_input(m, &route_proto, &route_src, &route_dst);
- }
-}
-
-
-/*
- * This is used in dumping the kernel table via sysctl().
- */
-int
-sysctl_dumpentry(rn, vw)
- struct radix_node *rn;
- void *vw;
-{
- register struct walkarg *w = vw;
- register struct rtentry *rt = (struct rtentry *)rn;
- int error = 0, size;
- struct rt_addrinfo info;
-
- if (w->w_op == NET_RT_FLAGS && !(rt->rt_flags & w->w_arg))
- return 0;
- bzero((caddr_t)&info, sizeof(info));
- dst = rt_key(rt);
- gate = rt->rt_gateway;
- netmask = rt_mask(rt);
- genmask = rt->rt_genmask;
- size = rt_msg2(RTM_GET, &info, 0, w);
- if (w->w_req && w->w_tmem) {
- register struct rt_msghdr *rtm = (struct rt_msghdr *)w->w_tmem;
-
- rtm->rtm_flags = rt->rt_flags;
- rtm->rtm_use = rt->rt_use;
- rtm->rtm_rmx = rt->rt_rmx;
- rtm->rtm_index = rt->rt_ifp->if_index;
- rtm->rtm_errno = rtm->rtm_pid = rtm->rtm_seq = 0;
- rtm->rtm_addrs = info.rti_addrs;
- error = 0;
- return (error);
- }
- return (error);
-}
-
-int
-sysctl_iflist(af, w)
- int af;
- register struct walkarg *w;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
- struct rt_addrinfo info;
- int len, error = 0;
-
- bzero((caddr_t)&info, sizeof(info));
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- if (w->w_arg && w->w_arg != ifp->if_index)
- continue;
- ifa = ifp->if_addrlist;
- ifpaddr = ifa->ifa_addr;
- len = rt_msg2(RTM_IFINFO, &info, (caddr_t)0, w);
- ifpaddr = 0;
- if (w->w_req && w->w_tmem) {
- register struct if_msghdr *ifm;
-
- ifm = (struct if_msghdr *)w->w_tmem;
- ifm->ifm_index = ifp->if_index;
- ifm->ifm_flags = (u_short)ifp->if_flags;
- ifm->ifm_data = ifp->if_data;
- ifm->ifm_addrs = info.rti_addrs;
- error =0;
- if (error)
- return (error);
- }
- while ((ifa = ifa->ifa_next) != 0) {
- if (af && af != ifa->ifa_addr->sa_family)
- continue;
- ifaaddr = ifa->ifa_addr;
- netmask = ifa->ifa_netmask;
- brdaddr = ifa->ifa_dstaddr;
- len = rt_msg2(RTM_NEWADDR, &info, 0, w);
- if (w->w_req && w->w_tmem) {
- register struct ifa_msghdr *ifam;
-
- ifam = (struct ifa_msghdr *)w->w_tmem;
- ifam->ifam_index = ifa->ifa_ifp->if_index;
- ifam->ifam_flags = ifa->ifa_flags;
- ifam->ifam_metric = ifa->ifa_metric;
- ifam->ifam_addrs = info.rti_addrs;
- error = 0;
- if (error)
- return (error);
- }
- }
- ifaaddr = netmask = brdaddr = 0;
- }
- return (0);
-}
-
-static int
-sysctl_rtsock SYSCTL_HANDLER_ARGS
-{
- int *name = (int *)arg1;
- u_int namelen = arg2;
- register struct radix_node_head *rnh;
- int i, s, error = EINVAL;
- u_char af;
- struct walkarg w;
-
- name ++;
- namelen--;
- if (req->newptr)
- return (EPERM);
- if (namelen != 3)
- return (EINVAL);
- af = name[0];
- Bzero(&w, sizeof(w));
- w.w_op = name[1];
- w.w_arg = name[2];
- w.w_req = req;
-
- s = splnet();
- switch (w.w_op) {
-
- case NET_RT_DUMP:
- case NET_RT_FLAGS:
- for (i = 1; i <= AF_MAX; i++)
- if ((rnh = rt_tables[i]) && (af == 0 || af == i) &&
- (error = rnh->rnh_walktree(rnh,
- sysctl_dumpentry, &w)))
- break;
- break;
-
- case NET_RT_IFLIST:
- error = sysctl_iflist(af, &w);
- }
- splx(s);
- if (w.w_tmem)
- free(w.w_tmem, M_RTABLE);
- return (error);
-}
-
-SYSCTL_NODE(_net, PF_ROUTE, routetable, CTLFLAG_RD, sysctl_rtsock,"");
-
-/*
- * Definitions of protocols supported in the ROUTE domain.
- */
-
-extern struct domain routedomain; /* or at least forward */
-
-static struct protosw routesw[] = {
-{ SOCK_RAW, &routedomain, 0, PR_ATOMIC|PR_ADDR,
- 0, route_output, raw_ctlinput, 0,
- route_usrreq,
- raw_init
-}
-};
-
-struct domain routedomain =
- { PF_ROUTE, "route", route_init, 0, 0,
- routesw, &routesw[sizeof(routesw)/sizeof(routesw[0])] };
-
-DOMAIN_SET(route);
diff --git a/c/src/lib/libnetworking/netdb.h b/c/src/lib/libnetworking/netdb.h
deleted file mode 100644
index ec274f851f..0000000000
--- a/c/src/lib/libnetworking/netdb.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*-
- * Copyright (c) 1980, 1983, 1988, 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.
- *
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-/*
- * @(#)netdb.h 8.1 (Berkeley) 6/2/93
- * From: Id: netdb.h,v 8.9 1996/11/19 08:39:29 vixie Exp $
- * $Id$
- */
-
-#ifndef _NETDB_H_
-#define _NETDB_H_
-
-#include <sys/cdefs.h>
-
-#ifndef _PATH_HEQUIV
-# define _PATH_HEQUIV "/etc/hosts.equiv"
-#endif
-#define _PATH_HOSTS "/etc/hosts"
-#define _PATH_NETWORKS "/etc/networks"
-#define _PATH_PROTOCOLS "/etc/protocols"
-#define _PATH_SERVICES "/etc/services"
-
-extern int h_errno;
-
-/*
- * Structures returned by network data base library. All addresses are
- * supplied in host order, and returned in network order (suitable for
- * use in system calls).
- */
-struct hostent {
- char *h_name; /* official name of host */
- char **h_aliases; /* alias list */
- int h_addrtype; /* host address type */
- int h_length; /* length of address */
- char **h_addr_list; /* list of addresses from name server */
-#define h_addr h_addr_list[0] /* address, for backward compatibility */
-};
-
-/*
- * Assumption here is that a network number
- * fits in an unsigned long -- probably a poor one.
- */
-struct netent {
- char *n_name; /* official name of net */
- char **n_aliases; /* alias list */
- int n_addrtype; /* net address type */
- unsigned long n_net; /* network # */
-};
-
-struct servent {
- char *s_name; /* official service name */
- char **s_aliases; /* alias list */
- int s_port; /* port # */
- char *s_proto; /* protocol to use */
-};
-
-struct protoent {
- char *p_name; /* official protocol name */
- char **p_aliases; /* alias list */
- int p_proto; /* protocol # */
-};
-
-/*
- * Error return codes from gethostbyname() and gethostbyaddr()
- * (left in extern int h_errno).
- */
-
-#define NETDB_INTERNAL -1 /* see errno */
-#define NETDB_SUCCESS 0 /* no problem */
-#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
-#define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */
-#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
-#define NO_DATA 4 /* Valid name, no data record of requested type */
-#define NO_ADDRESS NO_DATA /* no address, look for MX record */
-
-__BEGIN_DECLS
-void endhostent __P((void));
-void endnetent __P((void));
-void endprotoent __P((void));
-void endservent __P((void));
-struct hostent *gethostbyaddr __P((const char *, int, int));
-struct hostent *gethostbyname __P((const char *));
-struct hostent *gethostbyname2 __P((const char *, int));
-struct hostent *gethostent __P((void));
-struct netent *getnetbyaddr __P((unsigned long, int));
-struct netent *getnetbyname __P((const char *));
-struct netent *getnetent __P((void));
-struct protoent *getprotobyname __P((const char *));
-struct protoent *getprotobynumber __P((int));
-struct protoent *getprotoent __P((void));
-struct servent *getservbyname __P((const char *, const char *));
-struct servent *getservbyport __P((int, const char *));
-struct servent *getservent __P((void));
-void herror __P((const char *));
-__const char *hstrerror __P((int));
-void sethostent __P((int));
-/* void sethostfile __P((const char *)); */
-void setnetent __P((int));
-void setprotoent __P((int));
-void setservent __P((int));
-
-/*
- * PRIVATE functions specific to the FreeBSD implementation
- */
-
-/* DO NOT USE THESE, THEY ARE SUBJECT TO CHANGE AND ARE NOT PORTABLE!!! */
-void _sethosthtent __P((int));
-void _endhosthtent __P((void));
-void _sethostdnsent __P((int));
-void _endhostdnsent __P((void));
-void _setnethtent __P((int));
-void _endnethtent __P((void));
-void _setnetdnsent __P((int));
-void _endnetdnsent __P((void));
-struct hostent * _gethostbyhtname __P((const char *, int));
-struct hostent * _gethostbydnsname __P((const char *, int));
-struct hostent * _gethostbynisname __P((const char *, int));
-struct hostent * _gethostbyhtaddr __P((const char *, int, int));
-struct hostent * _gethostbydnsaddr __P((const char *, int, int));
-struct hostent * _gethostbynisaddr __P((const char *, int, int));
-struct netent * _getnetbyhtname __P((const char *));
-struct netent * _getnetbydnsname __P((const char *));
-struct netent * _getnetbynisname __P((const char *));
-struct netent * _getnetbyhtaddr __P((unsigned long, int));
-struct netent * _getnetbydnsaddr __P((unsigned long, int));
-struct netent * _getnetbynisaddr __P((unsigned long, int));
-void _map_v4v6_address __P((const char *src, char *dst));
-void _map_v4v6_hostent __P((struct hostent *hp, char **bp, int *len));
-__END_DECLS
-
-#endif /* !_NETDB_H_ */
diff --git a/c/src/lib/libnetworking/netinet/Makefile.in b/c/src/lib/libnetworking/netinet/Makefile.in
deleted file mode 100644
index 94a8f2f0b8..0000000000
--- a/c/src/lib/libnetworking/netinet/Makefile.in
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=lib.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES=if_ether \
- igmp \
- in in_cksum in_pcb in_proto in_rmx \
- ip_divert ip_fw ip_icmp ip_input ip_mroute ip_output \
- raw_ip \
- tcp_debug tcp_input tcp_output tcp_subr tcp_timer tcp_usrreq \
- udp_usrreq
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \
- -DDIAGNOSTIC -DBOOTP_COMPAT
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
diff --git a/c/src/lib/libnetworking/netinet/icmp_var.h b/c/src/lib/libnetworking/netinet/icmp_var.h
deleted file mode 100644
index 7657f31acf..0000000000
--- a/c/src/lib/libnetworking/netinet/icmp_var.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)icmp_var.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_ICMP_VAR_H_
-#define _NETINET_ICMP_VAR_H_
-
-/*
- * Variables related to this implementation
- * of the internet control message protocol.
- */
-struct icmpstat {
-/* statistics related to icmp packets generated */
- u_long icps_error; /* # of calls to icmp_error */
- u_long icps_oldshort; /* no error 'cuz old ip too short */
- u_long icps_oldicmp; /* no error 'cuz old was icmp */
- u_long icps_outhist[ICMP_MAXTYPE + 1];
-/* statistics related to input messages processed */
- u_long icps_badcode; /* icmp_code out of range */
- u_long icps_tooshort; /* packet < ICMP_MINLEN */
- u_long icps_checksum; /* bad checksum */
- u_long icps_badlen; /* calculated bound mismatch */
- u_long icps_reflect; /* number of responses */
- u_long icps_inhist[ICMP_MAXTYPE + 1];
- u_long icps_bmcastecho; /* b/mcast echo requests dropped */
- u_long icps_bmcasttstamp; /* b/mcast tstamp requests dropped */
-};
-
-/*
- * Names for ICMP sysctl objects
- */
-#define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */
-#define ICMPCTL_STATS 2 /* statistics (read-only) */
-#define ICMPCTL_MAXID 3
-
-#define ICMPCTL_NAMES { \
- { 0, 0 }, \
- { "maskrepl", CTLTYPE_INT }, \
- { "stats", CTLTYPE_STRUCT }, \
-}
-
-#ifdef KERNEL
-extern struct icmpstat icmpstat;
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/netinet/if_ether.c b/c/src/lib/libnetworking/netinet/if_ether.c
deleted file mode 100644
index 985ce6e7d9..0000000000
--- a/c/src/lib/libnetworking/netinet/if_ether.c
+++ /dev/null
@@ -1,638 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)if_ether.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-/*
- * Ethernet address resolution protocol.
- * TODO:
- * add "inuse/lock" bit (or ref. count) along with valid bit
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/socket.h>
-#include <sys/syslog.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/route.h>
-#include <net/netisr.h>
-
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/if_ether.h>
-
-#define SIN(s) ((struct sockaddr_in *)s)
-#define SDL(s) ((struct sockaddr_dl *)s)
-
-SYSCTL_NODE(_net_link_ether, PF_INET, inet, CTLFLAG_RW, 0, "");
-
-/* timer values */
-static int arpt_prune = (5*60*1); /* walk list every 5 minutes */
-static int arpt_keep = (20*60); /* once resolved, good for 20 more minutes */
-static int arpt_down = 20; /* once declared down, don't send for 20 sec */
-
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, prune_intvl, CTLFLAG_RW,
- &arpt_prune, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_RW,
- &arpt_keep, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, host_down_time, CTLFLAG_RW,
- &arpt_down, 0, "");
-
-#define rt_expire rt_rmx.rmx_expire
-
-struct llinfo_arp {
- LIST_ENTRY(llinfo_arp) la_le;
- struct rtentry *la_rt;
- struct mbuf *la_hold; /* last packet until resolved/timeout */
- long la_asked; /* last time we QUERIED for this addr */
-#define la_timer la_rt->rt_rmx.rmx_expire /* deletion time in seconds */
-};
-
-static LIST_HEAD(, llinfo_arp) llinfo_arp;
-
-struct ifqueue arpintrq = {0, 0, 0, 50};
-static int arp_inuse, arp_allocated;
-
-static int arp_maxtries = 5;
-static int useloopback = 1; /* use loopback interface for local traffic */
-static int arp_proxyall = 0;
-
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, maxtries, CTLFLAG_RW,
- &arp_maxtries, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, useloopback, CTLFLAG_RW,
- &useloopback, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, proxyall, CTLFLAG_RW,
- &arp_proxyall, 0, "");
-
-static void arp_rtrequest __P((int, struct rtentry *, struct sockaddr *));
-static void arprequest __P((struct arpcom *, u_long *, u_long *, u_char *));
-void arpintr __P((void));
-static void arptfree __P((struct llinfo_arp *));
-static void arptimer __P((void *));
-static struct llinfo_arp
- *arplookup __P((u_long, int, int));
-static void in_arpinput __P((struct mbuf *));
-
-/*
- * Timeout routine. Age arp_tab entries periodically.
- */
-/* ARGSUSED */
-static void
-arptimer(ignored_arg)
- void *ignored_arg;
-{
- int s = splnet();
- register struct llinfo_arp *la = llinfo_arp.lh_first;
- struct llinfo_arp *ola;
-
- timeout(arptimer, (caddr_t)0, arpt_prune * hz);
- while ((ola = la) != 0) {
- register struct rtentry *rt = la->la_rt;
- la = la->la_le.le_next;
- if (rt->rt_expire && rt->rt_expire <= rtems_bsdnet_seconds_since_boot())
- arptfree(ola); /* timer has expired, clear */
- }
- splx(s);
-}
-
-/*
- * Parallel to llc_rtrequest.
- */
-static void
-arp_rtrequest(req, rt, sa)
- int req;
- register struct rtentry *rt;
- struct sockaddr *sa;
-{
- register struct sockaddr *gate = rt->rt_gateway;
- register struct llinfo_arp *la = (struct llinfo_arp *)rt->rt_llinfo;
- static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK};
- static int arpinit_done;
-
- if (!arpinit_done) {
- arpinit_done = 1;
- LIST_INIT(&llinfo_arp);
- timeout(arptimer, (caddr_t)0, hz);
- }
- if (rt->rt_flags & RTF_GATEWAY)
- return;
- switch (req) {
-
- case RTM_ADD:
- /*
- * XXX: If this is a manually added route to interface
- * such as older version of routed or gated might provide,
- * restore cloning bit.
- */
- if ((rt->rt_flags & RTF_HOST) == 0 &&
- SIN(rt_mask(rt))->sin_addr.s_addr != 0xffffffff)
- rt->rt_flags |= RTF_CLONING;
- if (rt->rt_flags & RTF_CLONING) {
- /*
- * Case 1: This route should come from a route to iface.
- */
- rt_setgate(rt, rt_key(rt),
- (struct sockaddr *)&null_sdl);
- gate = rt->rt_gateway;
- SDL(gate)->sdl_type = rt->rt_ifp->if_type;
- SDL(gate)->sdl_index = rt->rt_ifp->if_index;
- rt->rt_expire = rtems_bsdnet_seconds_since_boot();
- break;
- }
- /* Announce a new entry if requested. */
- if (rt->rt_flags & RTF_ANNOUNCE)
- arprequest((struct arpcom *)rt->rt_ifp,
- &SIN(rt_key(rt))->sin_addr.s_addr,
- &SIN(rt_key(rt))->sin_addr.s_addr,
- (u_char *)LLADDR(SDL(gate)));
- /*FALLTHROUGH*/
- case RTM_RESOLVE:
- if (gate->sa_family != AF_LINK ||
- gate->sa_len < sizeof(null_sdl)) {
- log(LOG_DEBUG, "arp_rtrequest: bad gateway value\n");
- break;
- }
- SDL(gate)->sdl_type = rt->rt_ifp->if_type;
- SDL(gate)->sdl_index = rt->rt_ifp->if_index;
- if (la != 0)
- break; /* This happens on a route change */
- /*
- * Case 2: This route may come from cloning, or a manual route
- * add with a LL address.
- */
- R_Malloc(la, struct llinfo_arp *, sizeof(*la));
- rt->rt_llinfo = (caddr_t)la;
- if (la == 0) {
- log(LOG_DEBUG, "arp_rtrequest: malloc failed\n");
- break;
- }
- arp_inuse++, arp_allocated++;
- Bzero(la, sizeof(*la));
- la->la_rt = rt;
- rt->rt_flags |= RTF_LLINFO;
- LIST_INSERT_HEAD(&llinfo_arp, la, la_le);
-
- /*
- * This keeps the multicast addresses from showing up
- * in `arp -a' listings as unresolved. It's not actually
- * functional. Then the same for broadcast.
- */
- if (IN_MULTICAST(ntohl(SIN(rt_key(rt))->sin_addr.s_addr))) {
- ETHER_MAP_IP_MULTICAST(&SIN(rt_key(rt))->sin_addr,
- LLADDR(SDL(gate)));
- SDL(gate)->sdl_alen = 6;
- rt->rt_expire = 0;
- }
- if (in_broadcast(SIN(rt_key(rt))->sin_addr, rt->rt_ifp)) {
- memcpy(LLADDR(SDL(gate)), etherbroadcastaddr, 6);
- SDL(gate)->sdl_alen = 6;
- rt->rt_expire = 0;
- }
-
- if (SIN(rt_key(rt))->sin_addr.s_addr ==
- (IA_SIN(rt->rt_ifa))->sin_addr.s_addr) {
- /*
- * This test used to be
- * if (loif.if_flags & IFF_UP)
- * It allowed local traffic to be forced
- * through the hardware by configuring the loopback down.
- * However, it causes problems during network configuration
- * for boards that can't receive packets they send.
- * It is now necessary to clear "useloopback" and remove
- * the route to force traffic out to the hardware.
- */
- rt->rt_expire = 0;
- Bcopy(((struct arpcom *)rt->rt_ifp)->ac_enaddr,
- LLADDR(SDL(gate)), SDL(gate)->sdl_alen = 6);
- if (useloopback)
- rt->rt_ifp = loif;
-
- }
- break;
-
- case RTM_DELETE:
- if (la == 0)
- break;
- arp_inuse--;
- LIST_REMOVE(la, la_le);
- rt->rt_llinfo = 0;
- rt->rt_flags &= ~RTF_LLINFO;
- if (la->la_hold)
- m_freem(la->la_hold);
- Free((caddr_t)la);
- }
-}
-
-/*
- * Broadcast an ARP request. Caller specifies:
- * - arp header source ip address
- * - arp header target ip address
- * - arp header source ethernet address
- */
-static void
-arprequest(ac, sip, tip, enaddr)
- register struct arpcom *ac;
- register u_long *sip, *tip;
- register u_char *enaddr;
-{
- register struct mbuf *m;
- register struct ether_header *eh;
- register struct ether_arp *ea;
- struct sockaddr sa;
-
- if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL)
- return;
- m->m_len = sizeof(*ea);
- m->m_pkthdr.len = sizeof(*ea);
- MH_ALIGN(m, sizeof(*ea));
- ea = mtod(m, struct ether_arp *);
- eh = (struct ether_header *)sa.sa_data;
- bzero((caddr_t)ea, sizeof (*ea));
- (void)memcpy(eh->ether_dhost, etherbroadcastaddr, sizeof(eh->ether_dhost));
- eh->ether_type = htons(ETHERTYPE_ARP); /* if_output will not swap */
- ea->arp_hrd = htons(ARPHRD_ETHER);
- ea->arp_pro = htons(ETHERTYPE_IP);
- ea->arp_hln = sizeof(ea->arp_sha); /* hardware address length */
- ea->arp_pln = sizeof(ea->arp_spa); /* protocol address length */
- ea->arp_op = htons(ARPOP_REQUEST);
- (void)memcpy(ea->arp_sha, enaddr, sizeof(ea->arp_sha));
- (void)memcpy(ea->arp_spa, sip, sizeof(ea->arp_spa));
- (void)memcpy(ea->arp_tpa, tip, sizeof(ea->arp_tpa));
- sa.sa_family = AF_UNSPEC;
- sa.sa_len = sizeof(sa);
- (*ac->ac_if.if_output)(&ac->ac_if, m, &sa, (struct rtentry *)0);
-}
-
-/*
- * Resolve an IP address into an ethernet address. If success,
- * desten is filled in. If there is no entry in arptab,
- * set one up and broadcast a request for the IP address.
- * Hold onto this mbuf and resend it once the address
- * is finally resolved. A return value of 1 indicates
- * that desten has been filled in and the packet should be sent
- * normally; a 0 return indicates that the packet has been
- * taken over here, either now or for later transmission.
- */
-int
-arpresolve(ac, rt, m, dst, desten, rt0)
- register struct arpcom *ac;
- register struct rtentry *rt;
- struct mbuf *m;
- register struct sockaddr *dst;
- register u_char *desten;
- struct rtentry *rt0;
-{
- register struct llinfo_arp *la;
- struct sockaddr_dl *sdl;
-
- if (m->m_flags & M_BCAST) { /* broadcast */
- (void)memcpy(desten, etherbroadcastaddr, sizeof(etherbroadcastaddr));
- return (1);
- }
- if (m->m_flags & M_MCAST) { /* multicast */
- ETHER_MAP_IP_MULTICAST(&SIN(dst)->sin_addr, desten);
- return(1);
- }
- if (rt)
- la = (struct llinfo_arp *)rt->rt_llinfo;
- else {
- la = arplookup(SIN(dst)->sin_addr.s_addr, 1, 0);
- if (la)
- rt = la->la_rt;
- }
- if (la == 0 || rt == 0) {
- log(LOG_DEBUG, "arpresolve: can't allocate llinfo for %s\n",
- inet_ntoa(SIN(dst)->sin_addr));
- m_freem(m);
- return (0);
- }
- sdl = SDL(rt->rt_gateway);
- /*
- * Check the address family and length is valid, the address
- * is resolved; otherwise, try to resolve.
- */
- if ((rt->rt_expire == 0 || rt->rt_expire > rtems_bsdnet_seconds_since_boot()) &&
- sdl->sdl_family == AF_LINK && sdl->sdl_alen != 0) {
- bcopy(LLADDR(sdl), desten, sdl->sdl_alen);
- return 1;
- }
- /*
- * There is an arptab entry, but no ethernet address
- * response yet. Replace the held mbuf with this
- * latest one.
- */
- if (la->la_hold)
- m_freem(la->la_hold);
- la->la_hold = m;
- if (rt->rt_expire) {
- rt->rt_flags &= ~RTF_REJECT;
- if (la->la_asked == 0 || rt->rt_expire != rtems_bsdnet_seconds_since_boot()) {
- rt->rt_expire = rtems_bsdnet_seconds_since_boot();
- if (la->la_asked++ < arp_maxtries)
- arprequest(ac,
- &(SIN(rt->rt_ifa->ifa_addr)->sin_addr.s_addr),
- &(SIN(dst)->sin_addr.s_addr),
- ac->ac_enaddr);
- else {
- rt->rt_flags |= RTF_REJECT;
- rt->rt_expire += arpt_down;
- la->la_asked = 0;
- }
-
- }
- }
- return (0);
-}
-
-/*
- * Common length and type checks are done here,
- * then the protocol-specific routine is called.
- */
-void
-arpintr(void)
-{
- register struct mbuf *m;
- register struct arphdr *ar;
- int s;
-
- while (arpintrq.ifq_head) {
- s = splimp();
- IF_DEQUEUE(&arpintrq, m);
- splx(s);
- if (m == 0 || (m->m_flags & M_PKTHDR) == 0)
- panic("arpintr");
- if (m->m_len >= sizeof(struct arphdr) &&
- (ar = mtod(m, struct arphdr *)) &&
- ntohs(ar->ar_hrd) == ARPHRD_ETHER &&
- m->m_len >=
- sizeof(struct arphdr) + 2 * ar->ar_hln + 2 * ar->ar_pln)
-
- switch (ntohs(ar->ar_pro)) {
-
- case ETHERTYPE_IP:
- in_arpinput(m);
- continue;
- }
- m_freem(m);
- }
-}
-
-NETISR_SET(NETISR_ARP, arpintr);
-
-/*
- * ARP for Internet protocols on 10 Mb/s Ethernet.
- * Algorithm is that given in RFC 826.
- * In addition, a sanity check is performed on the sender
- * protocol address, to catch impersonators.
- * We no longer handle negotiations for use of trailer protocol:
- * Formerly, ARP replied for protocol type ETHERTYPE_TRAIL sent
- * along with IP replies if we wanted trailers sent to us,
- * and also sent them in response to IP replies.
- * This allowed either end to announce the desire to receive
- * trailer packets.
- * We no longer reply to requests for ETHERTYPE_TRAIL protocol either,
- * but formerly didn't normally send requests.
- */
-static void
-in_arpinput(m)
- struct mbuf *m;
-{
- register struct ether_arp *ea;
- register struct arpcom *ac = (struct arpcom *)m->m_pkthdr.rcvif;
- struct ether_header *eh;
- register struct llinfo_arp *la = 0;
- register struct rtentry *rt;
- struct in_ifaddr *ia, *maybe_ia = 0;
- struct sockaddr_dl *sdl;
- struct sockaddr sa;
- struct in_addr isaddr, itaddr, myaddr;
- int op;
-
- ea = mtod(m, struct ether_arp *);
- op = ntohs(ea->arp_op);
- (void)memcpy(&isaddr, ea->arp_spa, sizeof (isaddr));
- (void)memcpy(&itaddr, ea->arp_tpa, sizeof (itaddr));
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if (ia->ia_ifp == &ac->ac_if) {
- maybe_ia = ia;
- if ((itaddr.s_addr == ia->ia_addr.sin_addr.s_addr) ||
- (isaddr.s_addr == ia->ia_addr.sin_addr.s_addr))
- break;
- }
- if (maybe_ia == 0) {
- m_freem(m);
- return;
- }
- myaddr = ia ? ia->ia_addr.sin_addr : maybe_ia->ia_addr.sin_addr;
- if (!bcmp((caddr_t)ea->arp_sha, (caddr_t)ac->ac_enaddr,
- sizeof (ea->arp_sha))) {
- m_freem(m); /* it's from me, ignore it. */
- return;
- }
- if (!bcmp((caddr_t)ea->arp_sha, (caddr_t)etherbroadcastaddr,
- sizeof (ea->arp_sha))) {
- log(LOG_ERR,
- "arp: ether address is broadcast for IP address %s!\n",
- inet_ntoa(isaddr));
- m_freem(m);
- return;
- }
- if (isaddr.s_addr == myaddr.s_addr) {
- log(LOG_ERR,
- "arp: %6D is using my IP address %s!\n",
- ea->arp_sha, ":", inet_ntoa(isaddr));
- itaddr = myaddr;
- goto reply;
- }
- la = arplookup(isaddr.s_addr, itaddr.s_addr == myaddr.s_addr, 0);
- if (la && (rt = la->la_rt) && (sdl = SDL(rt->rt_gateway))) {
- if (sdl->sdl_alen &&
- bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen))
- log(LOG_INFO, "arp: %s moved from %6D to %6D\n",
- inet_ntoa(isaddr), (u_char *)LLADDR(sdl), ":",
- ea->arp_sha, ":");
- (void)memcpy(LLADDR(sdl), ea->arp_sha, sizeof(ea->arp_sha));
- sdl->sdl_alen = sizeof(ea->arp_sha);
- if (rt->rt_expire)
- rt->rt_expire = rtems_bsdnet_seconds_since_boot() + arpt_keep;
- rt->rt_flags &= ~RTF_REJECT;
- la->la_asked = 0;
- if (la->la_hold) {
- (*ac->ac_if.if_output)(&ac->ac_if, la->la_hold,
- rt_key(rt), rt);
- la->la_hold = 0;
- }
- }
-reply:
- if (op != ARPOP_REQUEST) {
- m_freem(m);
- return;
- }
- if (itaddr.s_addr == myaddr.s_addr) {
- /* I am the target */
- (void)memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha));
- (void)memcpy(ea->arp_sha, ac->ac_enaddr, sizeof(ea->arp_sha));
- } else {
- la = arplookup(itaddr.s_addr, 0, SIN_PROXY);
- if (la == NULL) {
- struct sockaddr_in sin;
-
- if (!arp_proxyall) {
- m_freem(m);
- return;
- }
-
- bzero(&sin, sizeof sin);
- sin.sin_family = AF_INET;
- sin.sin_len = sizeof sin;
- sin.sin_addr = itaddr;
-
- rt = rtalloc1((struct sockaddr *)&sin, 0, 0UL);
- if (!rt) {
- m_freem(m);
- return;
- }
- /*
- * Don't send proxies for nodes on the same interface
- * as this one came out of, or we'll get into a fight
- * over who claims what Ether address.
- */
- if (rt->rt_ifp == &ac->ac_if) {
- rtfree(rt);
- m_freem(m);
- return;
- }
- (void)memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha));
- (void)memcpy(ea->arp_sha, ac->ac_enaddr, sizeof(ea->arp_sha));
- rtfree(rt);
-#ifdef DEBUG_PROXY
- printf("arp: proxying for %s\n",
- inet_ntoa(itaddr));
-#endif
- } else {
- rt = la->la_rt;
- (void)memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha));
- sdl = SDL(rt->rt_gateway);
- (void)memcpy(ea->arp_sha, LLADDR(sdl), sizeof(ea->arp_sha));
- }
- }
-
- (void)memcpy(ea->arp_tpa, ea->arp_spa, sizeof(ea->arp_spa));
- (void)memcpy(ea->arp_spa, &itaddr, sizeof(ea->arp_spa));
- ea->arp_op = htons(ARPOP_REPLY);
- ea->arp_pro = htons(ETHERTYPE_IP); /* let's be sure! */
- eh = (struct ether_header *)sa.sa_data;
- (void)memcpy(eh->ether_dhost, ea->arp_tha, sizeof(eh->ether_dhost));
- eh->ether_type = htons(ETHERTYPE_ARP);
- sa.sa_family = AF_UNSPEC;
- sa.sa_len = sizeof(sa);
- (*ac->ac_if.if_output)(&ac->ac_if, m, &sa, (struct rtentry *)0);
- return;
-}
-
-/*
- * Free an arp entry.
- */
-static void
-arptfree(la)
- register struct llinfo_arp *la;
-{
- register struct rtentry *rt = la->la_rt;
- register struct sockaddr_dl *sdl;
- if (rt == 0)
- panic("arptfree");
- if (rt->rt_refcnt > 0 && (sdl = SDL(rt->rt_gateway)) &&
- sdl->sdl_family == AF_LINK) {
- sdl->sdl_alen = 0;
- la->la_asked = 0;
- rt->rt_flags &= ~RTF_REJECT;
- return;
- }
- rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *)0, rt_mask(rt),
- 0, (struct rtentry **)0);
-}
-/*
- * Lookup or enter a new address in arptab.
- */
-static struct llinfo_arp *
-arplookup(addr, create, proxy)
- u_long addr;
- int create, proxy;
-{
- register struct rtentry *rt;
- static struct sockaddr_inarp sin = {sizeof(sin), AF_INET };
- const char *why = 0;
-
- sin.sin_addr.s_addr = addr;
- sin.sin_other = proxy ? SIN_PROXY : 0;
- rt = rtalloc1((struct sockaddr *)&sin, create, 0UL);
- if (rt == 0)
- return (0);
- rt->rt_refcnt--;
-
- if (rt->rt_flags & RTF_GATEWAY)
- why = "host is not on local network";
- else if ((rt->rt_flags & RTF_LLINFO) == 0)
- why = "could not allocate llinfo";
- else if (rt->rt_gateway->sa_family != AF_LINK)
- why = "gateway route is not ours";
-
- if (why && create) {
- log(LOG_DEBUG, "arplookup %s failed: %s\n",
- inet_ntoa(sin.sin_addr), why);
- return 0;
- } else if (why) {
- return 0;
- }
- return ((struct llinfo_arp *)rt->rt_llinfo);
-}
-
-void
-arp_ifinit(ac, ifa)
- struct arpcom *ac;
- struct ifaddr *ifa;
-{
- if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) != INADDR_ANY)
- arprequest(ac, &(IA_SIN(ifa)->sin_addr.s_addr),
- &(IA_SIN(ifa)->sin_addr.s_addr), ac->ac_enaddr);
- ifa->ifa_rtrequest = arp_rtrequest;
- ifa->ifa_flags |= RTF_CLONING;
-}
diff --git a/c/src/lib/libnetworking/netinet/if_ether.h b/c/src/lib/libnetworking/netinet/if_ether.h
deleted file mode 100644
index 22c8e97187..0000000000
--- a/c/src/lib/libnetworking/netinet/if_ether.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)if_ether.h 8.3 (Berkeley) 5/2/95
- * $Id$
- */
-
-#ifndef _NETINET_IF_ETHER_H_
-#define _NETINET_IF_ETHER_H_
-
-#include <net/ethernet.h>
-
-#define ETHERTYPE_PUP 0x0200 /* PUP protocol */
-#define ETHERTYPE_IP 0x0800 /* IP protocol */
-#define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */
-#define ETHERTYPE_REVARP 0x8035 /* reverse Addr. resolution protocol */
-
-/*
- * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
- * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
- * by an ETHER type (as given above) and then the (variable-length) header.
- */
-#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
-#define ETHERTYPE_NTRAILER 16
-
-#define ETHERMTU (ETHER_MAX_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-#define ETHERMIN (ETHER_MIN_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-
-#ifdef KERNEL
-/*
- * Macro to map an IP multicast address to an Ethernet multicast address.
- * The high-order 25 bits of the Ethernet address are statically assigned,
- * and the low-order 23 bits are taken from the low end of the IP address.
- */
-#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
- /* struct in_addr *ipaddr; */ \
- /* u_char enaddr[ETHER_ADDR_LEN]; */ \
-{ \
- (enaddr)[0] = 0x01; \
- (enaddr)[1] = 0x00; \
- (enaddr)[2] = 0x5e; \
- (enaddr)[3] = ((u_char *)ipaddr)[1] & 0x7f; \
- (enaddr)[4] = ((u_char *)ipaddr)[2]; \
- (enaddr)[5] = ((u_char *)ipaddr)[3]; \
-}
-#endif
-
-/*
- * Ethernet Address Resolution Protocol.
- *
- * See RFC 826 for protocol description. Structure below is adapted
- * to resolving internet addresses. Field names used correspond to
- * RFC 826.
- */
-struct ether_arp {
- struct arphdr ea_hdr; /* fixed-size header */
- u_char arp_sha[ETHER_ADDR_LEN]; /* sender hardware address */
- u_char arp_spa[4]; /* sender protocol address */
- u_char arp_tha[ETHER_ADDR_LEN]; /* target hardware address */
- u_char arp_tpa[4]; /* target protocol address */
-};
-#define arp_hrd ea_hdr.ar_hrd
-#define arp_pro ea_hdr.ar_pro
-#define arp_hln ea_hdr.ar_hln
-#define arp_pln ea_hdr.ar_pln
-#define arp_op ea_hdr.ar_op
-
-
-/*
- * Structure shared between the ethernet driver modules and
- * the address resolution code. For example, each ec_softc or il_softc
- * begins with this structure.
- */
-struct arpcom {
- /*
- * The ifnet struct _must_ be at the head of this structure.
- */
- struct ifnet ac_if; /* network-visible interface */
- u_char ac_enaddr[ETHER_ADDR_LEN]; /* ethernet hardware address */
- struct ether_multi *ac_multiaddrs; /* list of ether multicast addrs */
- int ac_multicnt; /* length of ac_multiaddrs list */
-};
-
-struct sockaddr_inarp {
- u_char sin_len;
- u_char sin_family;
- u_short sin_port;
- struct in_addr sin_addr;
- struct in_addr sin_srcaddr;
- u_short sin_tos;
- u_short sin_other;
-#define SIN_PROXY 1
-};
-/*
- * IP and ethernet specific routing flags
- */
-#define RTF_USETRAILERS RTF_PROTO1 /* use trailers */
-#define RTF_ANNOUNCE RTF_PROTO2 /* announce new arp entry */
-
-#ifdef KERNEL
-extern u_char etherbroadcastaddr[ETHER_ADDR_LEN];
-extern u_char ether_ipmulticast_min[ETHER_ADDR_LEN];
-extern u_char ether_ipmulticast_max[ETHER_ADDR_LEN];
-extern struct ifqueue arpintrq;
-
-int arpresolve __P((struct arpcom *, struct rtentry *, struct mbuf *,
- struct sockaddr *, u_char *, struct rtentry *));
-void arp_ifinit __P((struct arpcom *, struct ifaddr *));
-int ether_addmulti __P((struct ifreq *, struct arpcom *));
-int ether_delmulti __P((struct ifreq *, struct arpcom *));
-
-/*
- * Ethernet multicast address structure. There is one of these for each
- * multicast address or range of multicast addresses that we are supposed
- * to listen to on a particular interface. They are kept in a linked list,
- * rooted in the interface's arpcom structure. (This really has nothing to
- * do with ARP, or with the Internet address family, but this appears to be
- * the minimally-disrupting place to put it.)
- */
-struct ether_multi {
- u_char enm_addrlo[ETHER_ADDR_LEN]; /* low or only address of range */
- u_char enm_addrhi[ETHER_ADDR_LEN]; /* high or only address of range */
- struct arpcom *enm_ac; /* back pointer to arpcom */
- u_int enm_refcount; /* no. claims to this addr/range */
- struct ether_multi *enm_next; /* ptr to next ether_multi */
-};
-
-/*
- * Structure used by macros below to remember position when stepping through
- * all of the ether_multi records.
- */
-struct ether_multistep {
- struct ether_multi *e_enm;
-};
-
-/*
- * Macro for looking up the ether_multi record for a given range of Ethernet
- * multicast addresses connected to a given arpcom structure. If no matching
- * record is found, "enm" returns NULL.
- */
-#define ETHER_LOOKUP_MULTI(addrlo, addrhi, ac, enm) \
- /* u_char addrlo[ETHER_ADDR_LEN]; */ \
- /* u_char addrhi[ETHER_ADDR_LEN]; */ \
- /* struct arpcom *ac; */ \
- /* struct ether_multi *enm; */ \
-{ \
- for ((enm) = (ac)->ac_multiaddrs; \
- (enm) != NULL && \
- (bcmp((enm)->enm_addrlo, (addrlo), ETHER_ADDR_LEN) != 0 || \
- bcmp((enm)->enm_addrhi, (addrhi), ETHER_ADDR_LEN) != 0); \
- (enm) = (enm)->enm_next); \
-}
-
-/*
- * Macro to step through all of the ether_multi records, one at a time.
- * The current position is remembered in "step", which the caller must
- * provide. ETHER_FIRST_MULTI(), below, must be called to initialize "step"
- * and get the first record. Both macros return a NULL "enm" when there
- * are no remaining records.
- */
-#define ETHER_NEXT_MULTI(step, enm) \
- /* struct ether_multistep step; */ \
- /* struct ether_multi *enm; */ \
-{ \
- if (((enm) = (step).e_enm) != NULL) \
- (step).e_enm = (enm)->enm_next; \
-}
-
-#define ETHER_FIRST_MULTI(step, ac, enm) \
- /* struct ether_multistep step; */ \
- /* struct arpcom *ac; */ \
- /* struct ether_multi *enm; */ \
-{ \
- (step).e_enm = (ac)->ac_multiaddrs; \
- ETHER_NEXT_MULTI((step), (enm)); \
-}
-
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/netinet/igmp.c b/c/src/lib/libnetworking/netinet/igmp.c
deleted file mode 100644
index 2af8b7038e..0000000000
--- a/c/src/lib/libnetworking/netinet/igmp.c
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * Copyright (c) 1988 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)igmp.c 8.1 (Berkeley) 7/19/93
- * $Id$
- */
-
-/*
- * Internet Group Management Protocol (IGMP) routines.
- *
- * Written by Steve Deering, Stanford, May 1988.
- * Modified by Rosen Sharma, Stanford, Aug 1994.
- * Modified by Bill Fenner, Xerox PARC, Feb 1995.
- * Modified to fully comply to IGMPv2 by Bill Fenner, Oct 1995.
- *
- * MULTICAST Revision: 3.5.1.4
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/igmp.h>
-#include <netinet/igmp_var.h>
-
-static struct router_info *
- find_rti __P((struct ifnet *ifp));
-
-static struct igmpstat igmpstat;
-
-SYSCTL_STRUCT(_net_inet_igmp, IGMPCTL_STATS, stats, CTLFLAG_RD,
- &igmpstat, igmpstat, "");
-
-static int igmp_timers_are_running;
-static u_long igmp_all_hosts_group;
-static u_long igmp_all_rtrs_group;
-static struct mbuf *router_alert;
-static struct router_info *Head;
-
-static void igmp_sendpkt(struct in_multi *, int, unsigned long);
-
-void
-igmp_init()
-{
- struct ipoption *ra;
-
- /*
- * To avoid byte-swapping the same value over and over again.
- */
- igmp_all_hosts_group = htonl(INADDR_ALLHOSTS_GROUP);
- igmp_all_rtrs_group = htonl(INADDR_ALLRTRS_GROUP);
-
- igmp_timers_are_running = 0;
-
- /*
- * Construct a Router Alert option to use in outgoing packets
- */
- MGET(router_alert, M_DONTWAIT, MT_DATA);
- ra = mtod(router_alert, struct ipoption *);
- ra->ipopt_dst.s_addr = 0;
- ra->ipopt_list[0] = IPOPT_RA; /* Router Alert Option */
- ra->ipopt_list[1] = 0x04; /* 4 bytes long */
- ra->ipopt_list[2] = 0x00;
- ra->ipopt_list[3] = 0x00;
- router_alert->m_len = sizeof(ra->ipopt_dst) + ra->ipopt_list[1];
-
- Head = (struct router_info *) 0;
-}
-
-static struct router_info *
-find_rti(ifp)
- struct ifnet *ifp;
-{
- register struct router_info *rti = Head;
-
-#ifdef IGMP_DEBUG
- printf("[igmp.c, _find_rti] --> entering \n");
-#endif
- while (rti) {
- if (rti->rti_ifp == ifp) {
-#ifdef IGMP_DEBUG
- printf("[igmp.c, _find_rti] --> found old entry \n");
-#endif
- return rti;
- }
- rti = rti->rti_next;
- }
- MALLOC(rti, struct router_info *, sizeof *rti, M_MRTABLE, M_NOWAIT);
- rti->rti_ifp = ifp;
- rti->rti_type = IGMP_V2_ROUTER;
- rti->rti_time = 0;
- rti->rti_next = Head;
- Head = rti;
-#ifdef IGMP_DEBUG
- printf("[igmp.c, _find_rti] --> created an entry \n");
-#endif
- return rti;
-}
-
-void
-igmp_input(m, iphlen)
- register struct mbuf *m;
- register int iphlen;
-{
- register struct igmp *igmp;
- register struct ip *ip;
- register int igmplen;
- register struct ifnet *ifp = m->m_pkthdr.rcvif;
- register int minlen;
- register struct in_multi *inm;
- register struct in_ifaddr *ia;
- struct in_multistep step;
- struct router_info *rti;
-
- int timer; /** timer value in the igmp query header **/
-
- ++igmpstat.igps_rcv_total;
-
- ip = mtod(m, struct ip *);
- igmplen = ip->ip_len;
-
- /*
- * Validate lengths
- */
- if (igmplen < IGMP_MINLEN) {
- ++igmpstat.igps_rcv_tooshort;
- m_freem(m);
- return;
- }
- minlen = iphlen + IGMP_MINLEN;
- if ((m->m_flags & M_EXT || m->m_len < minlen) &&
- (m = m_pullup(m, minlen)) == 0) {
- ++igmpstat.igps_rcv_tooshort;
- return;
- }
-
- /*
- * Validate checksum
- */
- m->m_data += iphlen;
- m->m_len -= iphlen;
- igmp = mtod(m, struct igmp *);
- if (in_cksum(m, igmplen)) {
- ++igmpstat.igps_rcv_badsum;
- m_freem(m);
- return;
- }
- m->m_data -= iphlen;
- m->m_len += iphlen;
-
- ip = mtod(m, struct ip *);
- timer = igmp->igmp_code * PR_FASTHZ / IGMP_TIMER_SCALE;
- rti = find_rti(ifp);
-
- /*
- * In the IGMPv2 specification, there are 3 states and a flag.
- *
- * In Non-Member state, we simply don't have a membership record.
- * In Delaying Member state, our timer is running (inm->inm_timer)
- * In Idle Member state, our timer is not running (inm->inm_timer==0)
- *
- * The flag is inm->inm_state, it is set to IGMP_OTHERMEMBER if
- * we have heard a report from another member, or IGMP_IREPORTEDLAST
- * if I sent the last report.
- */
- switch (igmp->igmp_type) {
-
- case IGMP_MEMBERSHIP_QUERY:
- ++igmpstat.igps_rcv_queries;
-
- if (ifp->if_flags & IFF_LOOPBACK)
- break;
-
- if (igmp->igmp_code == 0) {
- /*
- * Old router. Remember that the querier on this
- * interface is old, and set the timer to the
- * value in RFC 1112.
- */
-
- rti->rti_type = IGMP_V1_ROUTER;
- rti->rti_time = 0;
-
- timer = IGMP_MAX_HOST_REPORT_DELAY * PR_FASTHZ;
-
- if (ip->ip_dst.s_addr != igmp_all_hosts_group ||
- igmp->igmp_group.s_addr != 0) {
- ++igmpstat.igps_rcv_badqueries;
- m_freem(m);
- return;
- }
- } else {
- /*
- * New router. Simply do the new validity check.
- */
-
- if (igmp->igmp_group.s_addr != 0 &&
- !IN_MULTICAST(ntohl(igmp->igmp_group.s_addr))) {
- ++igmpstat.igps_rcv_badqueries;
- m_freem(m);
- return;
- }
- }
-
- /*
- * - Start the timers in all of our membership records
- * that the query applies to for the interface on
- * which the query arrived excl. those that belong
- * to the "all-hosts" group (224.0.0.1).
- * - Restart any timer that is already running but has
- * a value longer than the requested timeout.
- * - Use the value specified in the query message as
- * the maximum timeout.
- */
- IN_FIRST_MULTI(step, inm);
- while (inm != NULL) {
- if (inm->inm_ifp == ifp &&
- inm->inm_addr.s_addr != igmp_all_hosts_group &&
- (igmp->igmp_group.s_addr == 0 ||
- igmp->igmp_group.s_addr == inm->inm_addr.s_addr)) {
- if (inm->inm_timer == 0 ||
- inm->inm_timer > timer) {
- inm->inm_timer =
- IGMP_RANDOM_DELAY(timer);
- igmp_timers_are_running = 1;
- }
- }
- IN_NEXT_MULTI(step, inm);
- }
-
- break;
-
- case IGMP_V1_MEMBERSHIP_REPORT:
- case IGMP_V2_MEMBERSHIP_REPORT:
- /*
- * For fast leave to work, we have to know that we are the
- * last person to send a report for this group. Reports
- * can potentially get looped back if we are a multicast
- * router, so discard reports sourced by me.
- */
- IFP_TO_IA(ifp, ia);
- if (ia && ip->ip_src.s_addr == IA_SIN(ia)->sin_addr.s_addr)
- break;
-
- ++igmpstat.igps_rcv_reports;
-
- if (ifp->if_flags & IFF_LOOPBACK)
- break;
-
- if (!IN_MULTICAST(ntohl(igmp->igmp_group.s_addr))) {
- ++igmpstat.igps_rcv_badreports;
- m_freem(m);
- return;
- }
-
- /*
- * KLUDGE: if the IP source address of the report has an
- * unspecified (i.e., zero) subnet number, as is allowed for
- * a booting host, replace it with the correct subnet number
- * so that a process-level multicast routing demon can
- * determine which subnet it arrived from. This is necessary
- * to compensate for the lack of any way for a process to
- * determine the arrival interface of an incoming packet.
- */
- if ((ntohl(ip->ip_src.s_addr) & IN_CLASSA_NET) == 0)
- if (ia) ip->ip_src.s_addr = htonl(ia->ia_subnet);
-
- /*
- * If we belong to the group being reported, stop
- * our timer for that group.
- */
- IN_LOOKUP_MULTI(igmp->igmp_group, ifp, inm);
-
- if (inm != NULL) {
- inm->inm_timer = 0;
- ++igmpstat.igps_rcv_ourreports;
-
- inm->inm_state = IGMP_OTHERMEMBER;
- }
-
- break;
- }
-
- /*
- * Pass all valid IGMP packets up to any process(es) listening
- * on a raw IGMP socket.
- */
- rip_input(m, iphlen);
-}
-
-void
-igmp_joingroup(inm)
- struct in_multi *inm;
-{
- int s = splnet();
-
- if (inm->inm_addr.s_addr == igmp_all_hosts_group
- || inm->inm_ifp->if_flags & IFF_LOOPBACK) {
- inm->inm_timer = 0;
- inm->inm_state = IGMP_OTHERMEMBER;
- } else {
- inm->inm_rti = find_rti(inm->inm_ifp);
- igmp_sendpkt(inm, inm->inm_rti->rti_type, 0);
- inm->inm_timer = IGMP_RANDOM_DELAY(
- IGMP_MAX_HOST_REPORT_DELAY*PR_FASTHZ);
- inm->inm_state = IGMP_IREPORTEDLAST;
- igmp_timers_are_running = 1;
- }
- splx(s);
-}
-
-void
-igmp_leavegroup(inm)
- struct in_multi *inm;
-{
- if (inm->inm_state == IGMP_IREPORTEDLAST &&
- inm->inm_addr.s_addr != igmp_all_hosts_group &&
- !(inm->inm_ifp->if_flags & IFF_LOOPBACK) &&
- inm->inm_rti->rti_type != IGMP_V1_ROUTER)
- igmp_sendpkt(inm, IGMP_V2_LEAVE_GROUP, igmp_all_rtrs_group);
-}
-
-void
-igmp_fasttimo()
-{
- register struct in_multi *inm;
- struct in_multistep step;
- int s;
-
- /*
- * Quick check to see if any work needs to be done, in order
- * to minimize the overhead of fasttimo processing.
- */
-
- if (!igmp_timers_are_running)
- return;
-
- s = splnet();
- igmp_timers_are_running = 0;
- IN_FIRST_MULTI(step, inm);
- while (inm != NULL) {
- if (inm->inm_timer == 0) {
- /* do nothing */
- } else if (--inm->inm_timer == 0) {
- igmp_sendpkt(inm, inm->inm_rti->rti_type, 0);
- inm->inm_state = IGMP_IREPORTEDLAST;
- } else {
- igmp_timers_are_running = 1;
- }
- IN_NEXT_MULTI(step, inm);
- }
- splx(s);
-}
-
-void
-igmp_slowtimo()
-{
- int s = splnet();
- register struct router_info *rti = Head;
-
-#ifdef IGMP_DEBUG
- printf("[igmp.c,_slowtimo] -- > entering \n");
-#endif
- while (rti) {
- if (rti->rti_type == IGMP_V1_ROUTER) {
- rti->rti_time++;
- if (rti->rti_time >= IGMP_AGE_THRESHOLD) {
- rti->rti_type = IGMP_V2_ROUTER;
- }
- }
- rti = rti->rti_next;
- }
-#ifdef IGMP_DEBUG
- printf("[igmp.c,_slowtimo] -- > exiting \n");
-#endif
- splx(s);
-}
-
-static struct route igmprt;
-
-static void
-igmp_sendpkt(inm, type, addr)
- struct in_multi *inm;
- int type;
- unsigned long addr;
-{
- struct mbuf *m;
- struct igmp *igmp;
- struct ip *ip;
- struct ip_moptions imo;
-
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- return;
-
- m->m_pkthdr.rcvif = loif;
- m->m_pkthdr.len = sizeof(struct ip) + IGMP_MINLEN;
- MH_ALIGN(m, IGMP_MINLEN + sizeof(struct ip));
- m->m_data += sizeof(struct ip);
- m->m_len = IGMP_MINLEN;
- igmp = mtod(m, struct igmp *);
- igmp->igmp_type = type;
- igmp->igmp_code = 0;
- igmp->igmp_group = inm->inm_addr;
- igmp->igmp_cksum = 0;
- igmp->igmp_cksum = in_cksum(m, IGMP_MINLEN);
-
- m->m_data -= sizeof(struct ip);
- m->m_len += sizeof(struct ip);
- ip = mtod(m, struct ip *);
- ip->ip_tos = 0;
- ip->ip_len = sizeof(struct ip) + IGMP_MINLEN;
- ip->ip_off = 0;
- ip->ip_p = IPPROTO_IGMP;
- ip->ip_src.s_addr = INADDR_ANY;
- ip->ip_dst.s_addr = addr ? addr : igmp->igmp_group.s_addr;
-
- imo.imo_multicast_ifp = inm->inm_ifp;
- imo.imo_multicast_ttl = 1;
- imo.imo_multicast_vif = -1;
- /*
- * Request loopback of the report if we are acting as a multicast
- * router, so that the process-level routing demon can hear it.
- */
- imo.imo_multicast_loop = (ip_mrouter != NULL);
-
- /*
- * XXX
- * Do we have to worry about reentrancy here? Don't think so.
- */
- ip_output(m, router_alert, &igmprt, 0, &imo);
-
- ++igmpstat.igps_snd_reports;
-}
diff --git a/c/src/lib/libnetworking/netinet/igmp.h b/c/src/lib/libnetworking/netinet/igmp.h
deleted file mode 100644
index 01d6d09179..0000000000
--- a/c/src/lib/libnetworking/netinet/igmp.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 1988 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)igmp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IGMP_H_
-#define _NETINET_IGMP_H_
-
-/*
- * Internet Group Management Protocol (IGMP) definitions.
- *
- * Written by Steve Deering, Stanford, May 1988.
- *
- * MULTICAST Revision: 3.5.1.2
- */
-
-/*
- * IGMP packet format.
- */
-struct igmp {
- u_char igmp_type; /* version & type of IGMP message */
- u_char igmp_code; /* subtype for routing msgs */
- u_short igmp_cksum; /* IP-style checksum */
- struct in_addr igmp_group; /* group address being reported */
-}; /* (zero for queries) */
-
-#define IGMP_MINLEN 8
-
-/*
- * Message types, including version number.
- */
-#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */
-#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */
-#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */
-#define IGMP_V2_LEAVE_GROUP 0x17 /* Leave-group message */
-
-#define IGMP_DVMRP 0x13 /* DVMRP routing message */
-#define IGMP_PIM 0x14 /* PIM routing message */
-
-#define IGMP_MTRACE_RESP 0x1e /* traceroute resp.(to sender)*/
-#define IGMP_MTRACE 0x1f /* mcast traceroute messages */
-
-#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
- /* query (in seconds) according */
- /* to RFC1112 */
-
-
-#define IGMP_TIMER_SCALE 10 /* denotes that the igmp code field */
- /* specifies time in 10th of seconds*/
-
-/*
- * The following four defininitions are for backwards compatibility.
- * They should be removed as soon as all applications are updated to
- * use the new constant names.
- */
-#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
-#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
-#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
-#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
-
-#endif /* _NETINET_IGMP_H_ */
diff --git a/c/src/lib/libnetworking/netinet/igmp_var.h b/c/src/lib/libnetworking/netinet/igmp_var.h
deleted file mode 100644
index f408bf2bc1..0000000000
--- a/c/src/lib/libnetworking/netinet/igmp_var.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 1988 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)igmp_var.h 8.1 (Berkeley) 7/19/93
- * $Id$
- */
-
-#ifndef _NETINET_IGMP_VAR_H_
-#define _NETINET_IGMP_VAR_H_
-
-/*
- * Internet Group Management Protocol (IGMP),
- * implementation-specific definitions.
- *
- * Written by Steve Deering, Stanford, May 1988.
- *
- * MULTICAST Revision: 3.5.1.3
- */
-
-struct igmpstat {
- u_int igps_rcv_total; /* total IGMP messages received */
- u_int igps_rcv_tooshort; /* received with too few bytes */
- u_int igps_rcv_badsum; /* received with bad checksum */
- u_int igps_rcv_queries; /* received membership queries */
- u_int igps_rcv_badqueries; /* received invalid queries */
- u_int igps_rcv_reports; /* received membership reports */
- u_int igps_rcv_badreports; /* received invalid reports */
- u_int igps_rcv_ourreports; /* received reports for our groups */
- u_int igps_snd_reports; /* sent membership reports */
-};
-
-#ifdef KERNEL
-extern struct igmpstat igmpstat;
-
-#define IGMP_RANDOM_DELAY(X) (random() % (X) + 1)
-
-/*
- * States for IGMPv2's leave processing
- */
-#define IGMP_OTHERMEMBER 0
-#define IGMP_IREPORTEDLAST 1
-
-/*
- * We must remember what version the subnet's querier is.
- * We conveniently use the IGMP message type for the proper
- * membership report to keep this state.
- */
-#define IGMP_V1_ROUTER IGMP_V1_MEMBERSHIP_REPORT
-#define IGMP_V2_ROUTER IGMP_V2_MEMBERSHIP_REPORT
-
-/*
- * Revert to new router if we haven't heard from an old router in
- * this amount of time.
- */
-#define IGMP_AGE_THRESHOLD 540
-
-void igmp_init __P((void));
-void igmp_input __P((struct mbuf *, int));
-void igmp_joingroup __P((struct in_multi *));
-void igmp_leavegroup __P((struct in_multi *));
-void igmp_fasttimo __P((void));
-void igmp_slowtimo __P((void));
-#endif
-
-/*
- * Names for IGMP sysctl objects
- */
-#define IGMPCTL_STATS 1 /* statistics (read-only) */
-#define IGMPCTL_MAXID 2
-
-#define IGMPCTL_NAMES { \
- { 0, 0 }, \
- { "stats", CTLTYPE_STRUCT }, \
-}
-
-#endif
-
-
diff --git a/c/src/lib/libnetworking/netinet/in.c b/c/src/lib/libnetworking/netinet/in.c
deleted file mode 100644
index 701406f207..0000000000
--- a/c/src/lib/libnetworking/netinet/in.c
+++ /dev/null
@@ -1,728 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1991, 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.c 8.4 (Berkeley) 1/9/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/malloc.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/if_ether.h>
-
-#include <netinet/igmp_var.h>
-
-/*
- * This structure is used to keep track of in_multi chains which belong to
- * deleted interface addresses.
- */
-static LIST_HEAD(, multi_kludge) in_mk; /* XXX BSS initialization */
-
-struct multi_kludge {
- LIST_ENTRY(multi_kludge) mk_entry;
- struct ifnet *mk_ifp;
- struct in_multihead mk_head;
-};
-
-static void in_socktrim __P((struct sockaddr_in *));
-static int in_ifinit __P((struct ifnet *,
- struct in_ifaddr *, struct sockaddr_in *, int));
-static void in_ifscrub __P((struct ifnet *, struct in_ifaddr *));
-
-static int subnetsarelocal = 0;
-SYSCTL_INT(_net_inet_ip, OID_AUTO, subnets_are_local, CTLFLAG_RW,
- &subnetsarelocal, 0, "");
-/*
- * Return 1 if an internet address is for a ``local'' host
- * (one to which we have a connection). If subnetsarelocal
- * is true, this includes other subnets of the local net.
- * Otherwise, it includes only the directly-connected (sub)nets.
- */
-int
-in_localaddr(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
- register struct in_ifaddr *ia;
-
- if (subnetsarelocal) {
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if ((i & ia->ia_netmask) == ia->ia_net)
- return (1);
- } else {
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if ((i & ia->ia_subnetmask) == ia->ia_subnet)
- return (1);
- }
- return (0);
-}
-
-/*
- * Determine whether an IP address is in a reserved set of addresses
- * that may not be forwarded, or whether datagrams to that destination
- * may be forwarded.
- */
-int
-in_canforward(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
- register u_long net;
-
- if (IN_EXPERIMENTAL(i) || IN_MULTICAST(i))
- return (0);
- if (IN_CLASSA(i)) {
- net = i & IN_CLASSA_NET;
- if (net == 0 || net == (IN_LOOPBACKNET << IN_CLASSA_NSHIFT))
- return (0);
- }
- return (1);
-}
-
-/*
- * Trim a mask in a sockaddr
- */
-static void
-in_socktrim(ap)
-struct sockaddr_in *ap;
-{
- register char *cplim = (char *) &ap->sin_addr;
- register char *cp = (char *) (&ap->sin_addr + 1);
-
- ap->sin_len = 0;
- while (--cp >= cplim)
- if (*cp) {
- (ap)->sin_len = cp - (char *) (ap) + 1;
- break;
- }
-}
-
-static int in_interfaces; /* number of external internet interfaces */
-
-/*
- * Generic internet control operations (ioctl's).
- * Ifp is 0 if not an interface-specific ioctl.
- */
-/* ARGSUSED */
-int
-in_control(so, cmd, data, ifp)
- struct socket *so;
- u_long cmd;
- caddr_t data;
- register struct ifnet *ifp;
-{
- register struct ifreq *ifr = (struct ifreq *)data;
- register struct in_ifaddr *ia = 0, *iap;
- register struct ifaddr *ifa;
- struct in_ifaddr *oia;
- struct in_aliasreq *ifra = (struct in_aliasreq *)data;
- struct sockaddr_in oldaddr;
- int error, hostIsNew, maskIsNew, s;
- u_long i;
- struct multi_kludge *mk;
-
- /*
- * Find address for this interface, if it exists.
- *
- * If an alias address was specified, find that one instead of
- * the first one on the interface.
- */
- if (ifp)
- for (iap = in_ifaddr; iap; iap = iap->ia_next)
- if (iap->ia_ifp == ifp) {
- if (((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr.s_addr ==
- iap->ia_addr.sin_addr.s_addr) {
- ia = iap;
- break;
- } else if (ia == NULL) {
- ia = iap;
- if (ifr->ifr_addr.sa_family != AF_INET)
- break;
- }
- }
-
- switch (cmd) {
-
- case SIOCAIFADDR:
- case SIOCDIFADDR:
- if (ifra->ifra_addr.sin_family == AF_INET) {
- for (oia = ia; ia; ia = ia->ia_next) {
- if (ia->ia_ifp == ifp &&
- ia->ia_addr.sin_addr.s_addr ==
- ifra->ifra_addr.sin_addr.s_addr)
- break;
- }
- if ((ifp->if_flags & IFF_POINTOPOINT)
- && (cmd == SIOCAIFADDR)
- && (ifra->ifra_dstaddr.sin_addr.s_addr
- == INADDR_ANY)) {
- return EDESTADDRREQ;
- }
- }
- if (cmd == SIOCDIFADDR && ia == 0)
- return (EADDRNOTAVAIL);
- /* FALLTHROUGH */
- case SIOCSIFADDR:
- case SIOCSIFNETMASK:
- case SIOCSIFDSTADDR:
- if ((so->so_state & SS_PRIV) == 0)
- return (EPERM);
-
- if (ifp == 0)
- panic("in_control");
- if (ia == (struct in_ifaddr *)0) {
- oia = (struct in_ifaddr *)
- malloc(sizeof *oia, M_IFADDR, M_WAITOK);
- if (oia == (struct in_ifaddr *)NULL)
- return (ENOBUFS);
- bzero((caddr_t)oia, sizeof *oia);
- ia = in_ifaddr;
- /*
- * Protect from ipintr() traversing address list
- * while we're modifying it.
- */
- s = splnet();
-
- if (ia) {
- for ( ; ia->ia_next; ia = ia->ia_next)
- continue;
- ia->ia_next = oia;
- } else
- in_ifaddr = oia;
- ia = oia;
- ifa = ifp->if_addrlist;
- if (ifa) {
- for ( ; ifa->ifa_next; ifa = ifa->ifa_next)
- continue;
- ifa->ifa_next = (struct ifaddr *) ia;
- } else
- ifp->if_addrlist = (struct ifaddr *) ia;
- ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr;
- ia->ia_ifa.ifa_dstaddr
- = (struct sockaddr *)&ia->ia_dstaddr;
- ia->ia_ifa.ifa_netmask
- = (struct sockaddr *)&ia->ia_sockmask;
- ia->ia_sockmask.sin_len = 8;
- if (ifp->if_flags & IFF_BROADCAST) {
- ia->ia_broadaddr.sin_len = sizeof(ia->ia_addr);
- ia->ia_broadaddr.sin_family = AF_INET;
- }
- ia->ia_ifp = ifp;
- if (!(ifp->if_flags & IFF_LOOPBACK))
- in_interfaces++;
- splx(s);
- }
- break;
-
- case SIOCSIFBRDADDR:
- if ((so->so_state & SS_PRIV) == 0)
- return (EPERM);
- /* FALLTHROUGH */
-
- case SIOCGIFADDR:
- case SIOCGIFNETMASK:
- case SIOCGIFDSTADDR:
- case SIOCGIFBRDADDR:
- if (ia == (struct in_ifaddr *)0)
- return (EADDRNOTAVAIL);
- break;
- }
- switch (cmd) {
-
- case SIOCGIFADDR:
- *((struct sockaddr_in *)&ifr->ifr_addr) = ia->ia_addr;
- break;
-
- case SIOCGIFBRDADDR:
- if ((ifp->if_flags & IFF_BROADCAST) == 0)
- return (EINVAL);
- *((struct sockaddr_in *)&ifr->ifr_dstaddr) = ia->ia_broadaddr;
- break;
-
- case SIOCGIFDSTADDR:
- if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
- return (EINVAL);
- *((struct sockaddr_in *)&ifr->ifr_dstaddr) = ia->ia_dstaddr;
- break;
-
- case SIOCGIFNETMASK:
- *((struct sockaddr_in *)&ifr->ifr_addr) = ia->ia_sockmask;
- break;
-
- case SIOCSIFDSTADDR:
- if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
- return (EINVAL);
- oldaddr = ia->ia_dstaddr;
- ia->ia_dstaddr = *(struct sockaddr_in *)&ifr->ifr_dstaddr;
- if (ifp->if_ioctl && (error = (*ifp->if_ioctl)
- (ifp, SIOCSIFDSTADDR, (caddr_t)ia))) {
- ia->ia_dstaddr = oldaddr;
- return (error);
- }
- if (ia->ia_flags & IFA_ROUTE) {
- ia->ia_ifa.ifa_dstaddr = (struct sockaddr *)&oldaddr;
- rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST);
- ia->ia_ifa.ifa_dstaddr =
- (struct sockaddr *)&ia->ia_dstaddr;
- rtinit(&(ia->ia_ifa), (int)RTM_ADD, RTF_HOST|RTF_UP);
- }
- break;
-
- case SIOCSIFBRDADDR:
- if ((ifp->if_flags & IFF_BROADCAST) == 0)
- return (EINVAL);
- ia->ia_broadaddr = *(struct sockaddr_in *)&ifr->ifr_broadaddr;
- break;
-
- case SIOCSIFADDR:
- return (in_ifinit(ifp, ia,
- (struct sockaddr_in *) &ifr->ifr_addr, 1));
-
- case SIOCSIFNETMASK:
- i = ifra->ifra_addr.sin_addr.s_addr;
- ia->ia_subnetmask = ntohl(ia->ia_sockmask.sin_addr.s_addr = i);
- break;
-
- case SIOCAIFADDR:
- maskIsNew = 0;
- hostIsNew = 1;
- error = 0;
- if (ia->ia_addr.sin_family == AF_INET) {
- if (ifra->ifra_addr.sin_len == 0) {
- ifra->ifra_addr = ia->ia_addr;
- hostIsNew = 0;
- } else if (ifra->ifra_addr.sin_addr.s_addr ==
- ia->ia_addr.sin_addr.s_addr)
- hostIsNew = 0;
- }
- if (ifra->ifra_mask.sin_len) {
- in_ifscrub(ifp, ia);
- ia->ia_sockmask = ifra->ifra_mask;
- ia->ia_subnetmask =
- ntohl(ia->ia_sockmask.sin_addr.s_addr);
- maskIsNew = 1;
- }
- if ((ifp->if_flags & IFF_POINTOPOINT) &&
- (ifra->ifra_dstaddr.sin_family == AF_INET)) {
- in_ifscrub(ifp, ia);
- ia->ia_dstaddr = ifra->ifra_dstaddr;
- maskIsNew = 1; /* We lie; but the effect's the same */
- }
- if (ifra->ifra_addr.sin_family == AF_INET &&
- (hostIsNew || maskIsNew))
- error = in_ifinit(ifp, ia, &ifra->ifra_addr, 0);
- if ((ifp->if_flags & IFF_BROADCAST) &&
- (ifra->ifra_broadaddr.sin_family == AF_INET))
- ia->ia_broadaddr = ifra->ifra_broadaddr;
- return (error);
-
- case SIOCDIFADDR:
- mk = malloc(sizeof *mk, M_IPMADDR, M_WAITOK);
- if (!mk)
- return ENOBUFS;
-
- in_ifscrub(ifp, ia);
- /*
- * Protect from ipintr() traversing address list
- * while we're modifying it.
- */
- s = splnet();
-
- if ((ifa = ifp->if_addrlist) == (struct ifaddr *)ia)
- ifp->if_addrlist = ifa->ifa_next;
- else {
- while (ifa->ifa_next &&
- (ifa->ifa_next != (struct ifaddr *)ia))
- ifa = ifa->ifa_next;
- if (ifa->ifa_next)
- ifa->ifa_next = ((struct ifaddr *)ia)->ifa_next;
- else
- printf("Couldn't unlink inifaddr from ifp\n");
- }
- oia = ia;
- if (oia == (ia = in_ifaddr))
- in_ifaddr = ia->ia_next;
- else {
- while (ia->ia_next && (ia->ia_next != oia))
- ia = ia->ia_next;
- if (ia->ia_next)
- ia->ia_next = oia->ia_next;
- else
- printf("Didn't unlink inifadr from list\n");
- }
-
- if (!oia->ia_multiaddrs.lh_first) {
- IFAFREE(&oia->ia_ifa);
- FREE(mk, M_IPMADDR);
- splx(s);
- break;
- }
-
- /*
- * Multicast address kludge:
- * If there were any multicast addresses attached to this
- * interface address, either move them to another address
- * on this interface, or save them until such time as this
- * interface is reconfigured for IP.
- */
- IFP_TO_IA(oia->ia_ifp, ia);
- if (ia) { /* there is another address */
- struct in_multi *inm;
- for(inm = oia->ia_multiaddrs.lh_first; inm;
- inm = inm->inm_entry.le_next) {
- IFAFREE(&inm->inm_ia->ia_ifa);
- ia->ia_ifa.ifa_refcnt++;
- inm->inm_ia = ia;
- LIST_INSERT_HEAD(&ia->ia_multiaddrs, inm,
- inm_entry);
- }
- FREE(mk, M_IPMADDR);
- } else { /* last address on this if deleted, save */
- struct in_multi *inm;
-
- LIST_INIT(&mk->mk_head);
- mk->mk_ifp = ifp;
-
- for(inm = oia->ia_multiaddrs.lh_first; inm;
- inm = inm->inm_entry.le_next) {
- LIST_INSERT_HEAD(&mk->mk_head, inm, inm_entry);
- }
-
- if (mk->mk_head.lh_first) {
- LIST_INSERT_HEAD(&in_mk, mk, mk_entry);
- } else {
- FREE(mk, M_IPMADDR);
- }
- }
-
- IFAFREE((&oia->ia_ifa));
- splx(s);
- break;
-
- default:
- if (ifp == 0 || ifp->if_ioctl == 0)
- return (EOPNOTSUPP);
- return ((*ifp->if_ioctl)(ifp, cmd, data));
- }
- return (0);
-}
-
-/*
- * Delete any existing route for an interface.
- */
-static void
-in_ifscrub(ifp, ia)
- register struct ifnet *ifp;
- register struct in_ifaddr *ia;
-{
-
- if ((ia->ia_flags & IFA_ROUTE) == 0)
- return;
- if (ifp->if_flags & (IFF_LOOPBACK|IFF_POINTOPOINT))
- rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST);
- else
- rtinit(&(ia->ia_ifa), (int)RTM_DELETE, 0);
- ia->ia_flags &= ~IFA_ROUTE;
-}
-
-/*
- * Initialize an interface's internet address
- * and routing table entry.
- */
-static int
-in_ifinit(ifp, ia, sin, scrub)
- register struct ifnet *ifp;
- register struct in_ifaddr *ia;
- struct sockaddr_in *sin;
- int scrub;
-{
- register u_long i = ntohl(sin->sin_addr.s_addr);
- struct sockaddr_in oldaddr;
- int s = splimp(), flags = RTF_UP, error;
- struct multi_kludge *mk;
-
- oldaddr = ia->ia_addr;
- ia->ia_addr = *sin;
- /*
- * Give the interface a chance to initialize
- * if this is its first address,
- * and to validate the address if necessary.
- */
- if (ifp->if_ioctl &&
- (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia))) {
- splx(s);
- ia->ia_addr = oldaddr;
- return (error);
- }
- splx(s);
- if (scrub) {
- ia->ia_ifa.ifa_addr = (struct sockaddr *)&oldaddr;
- in_ifscrub(ifp, ia);
- ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr;
- }
- if (IN_CLASSA(i))
- ia->ia_netmask = IN_CLASSA_NET;
- else if (IN_CLASSB(i))
- ia->ia_netmask = IN_CLASSB_NET;
- else
- ia->ia_netmask = IN_CLASSC_NET;
- /*
- * The subnet mask usually includes at least the standard network part,
- * but may may be smaller in the case of supernetting.
- * If it is set, we believe it.
- */
- if (ia->ia_subnetmask == 0) {
- ia->ia_subnetmask = ia->ia_netmask;
- ia->ia_sockmask.sin_addr.s_addr = htonl(ia->ia_subnetmask);
- } else
- ia->ia_netmask &= ia->ia_subnetmask;
- ia->ia_net = i & ia->ia_netmask;
- ia->ia_subnet = i & ia->ia_subnetmask;
- in_socktrim(&ia->ia_sockmask);
- /*
- * Add route for the network.
- */
- ia->ia_ifa.ifa_metric = ifp->if_metric;
- if (ifp->if_flags & IFF_BROADCAST) {
- ia->ia_broadaddr.sin_addr.s_addr =
- htonl(ia->ia_subnet | ~ia->ia_subnetmask);
- ia->ia_netbroadcast.s_addr =
- htonl(ia->ia_net | ~ ia->ia_netmask);
- } else if (ifp->if_flags & IFF_LOOPBACK) {
- ia->ia_ifa.ifa_dstaddr = ia->ia_ifa.ifa_addr;
- flags |= RTF_HOST;
- } else if (ifp->if_flags & IFF_POINTOPOINT) {
- if (ia->ia_dstaddr.sin_family != AF_INET)
- return (0);
- flags |= RTF_HOST;
- }
- if ((error = rtinit(&(ia->ia_ifa), (int)RTM_ADD, flags)) == 0)
- ia->ia_flags |= IFA_ROUTE;
-
- LIST_INIT(&ia->ia_multiaddrs);
- /*
- * If the interface supports multicast, join the "all hosts"
- * multicast group on that interface.
- */
- if (ifp->if_flags & IFF_MULTICAST) {
- struct in_addr addr;
-
- /*
- * Continuation of multicast address hack:
- * If there was a multicast group list previously saved
- * for this interface, then we re-attach it to the first
- * address configured on the i/f.
- */
- for(mk = in_mk.lh_first; mk; mk = mk->mk_entry.le_next) {
- if(mk->mk_ifp == ifp) {
- struct in_multi *inm;
-
- for(inm = mk->mk_head.lh_first; inm;
- inm = inm->inm_entry.le_next) {
- IFAFREE(&inm->inm_ia->ia_ifa);
- ia->ia_ifa.ifa_refcnt++;
- inm->inm_ia = ia;
- LIST_INSERT_HEAD(&ia->ia_multiaddrs,
- inm, inm_entry);
- }
- LIST_REMOVE(mk, mk_entry);
- free(mk, M_IPMADDR);
- break;
- }
- }
-
- addr.s_addr = htonl(INADDR_ALLHOSTS_GROUP);
- in_addmulti(&addr, ifp);
- }
- return (error);
-}
-
-
-/*
- * Return 1 if the address might be a local broadcast address.
- */
-int
-in_broadcast(in, ifp)
- struct in_addr in;
- struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
- u_long t;
-
- if (in.s_addr == INADDR_BROADCAST ||
- in.s_addr == INADDR_ANY)
- return 1;
- if ((ifp->if_flags & IFF_BROADCAST) == 0)
- return 0;
- t = ntohl(in.s_addr);
- /*
- * Look through the list of addresses for a match
- * with a broadcast address.
- */
-#define ia ((struct in_ifaddr *)ifa)
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- if (ifa->ifa_addr->sa_family == AF_INET &&
- (in.s_addr == ia->ia_broadaddr.sin_addr.s_addr ||
- in.s_addr == ia->ia_netbroadcast.s_addr ||
- /*
- * Check for old-style (host 0) broadcast.
- */
- t == ia->ia_subnet || t == ia->ia_net) &&
- /*
- * Check for an all one subnetmask. These
- * only exist when an interface gets a secondary
- * address.
- */
- ia->ia_subnetmask != (u_long)0xffffffff)
- return 1;
- return (0);
-#undef ia
-}
-/*
- * Add an address to the list of IP multicast addresses for a given interface.
- */
-struct in_multi *
-in_addmulti(ap, ifp)
- register struct in_addr *ap;
- register struct ifnet *ifp;
-{
- register struct in_multi *inm;
- struct ifreq ifr;
- struct in_ifaddr *ia;
- int s = splnet();
-
- /*
- * See if address already in list.
- */
- IN_LOOKUP_MULTI(*ap, ifp, inm);
- if (inm != NULL) {
- /*
- * Found it; just increment the reference count.
- */
- ++inm->inm_refcount;
- }
- else {
- /*
- * New address; allocate a new multicast record
- * and link it into the interface's multicast list.
- */
- inm = (struct in_multi *)malloc(sizeof(*inm),
- M_IPMADDR, M_NOWAIT);
- if (inm == NULL) {
- splx(s);
- return (NULL);
- }
- inm->inm_addr = *ap;
- inm->inm_ifp = ifp;
- inm->inm_refcount = 1;
- IFP_TO_IA(ifp, ia);
- if (ia == NULL) {
- free(inm, M_IPMADDR);
- splx(s);
- return (NULL);
- }
- inm->inm_ia = ia;
- ia->ia_ifa.ifa_refcnt++; /* gain a reference */
- LIST_INSERT_HEAD(&ia->ia_multiaddrs, inm, inm_entry);
-
- /*
- * Ask the network driver to update its multicast reception
- * filter appropriately for the new address.
- */
- ((struct sockaddr_in *)&ifr.ifr_addr)->sin_family = AF_INET;
- ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr = *ap;
- if ((ifp->if_ioctl == NULL) ||
- (*ifp->if_ioctl)(ifp, SIOCADDMULTI,(caddr_t)&ifr) != 0) {
- LIST_REMOVE(inm, inm_entry);
- IFAFREE(&ia->ia_ifa); /* release reference */
- free(inm, M_IPMADDR);
- splx(s);
- return (NULL);
- }
- /*
- * Let IGMP know that we have joined a new IP multicast group.
- */
- igmp_joingroup(inm);
- }
- splx(s);
- return (inm);
-}
-
-/*
- * Delete a multicast address record.
- */
-void
-in_delmulti(inm)
- register struct in_multi *inm;
-{
- struct ifreq ifr;
- int s = splnet();
-
- if (--inm->inm_refcount == 0) {
- /*
- * No remaining claims to this record; let IGMP know that
- * we are leaving the multicast group.
- */
- igmp_leavegroup(inm);
- /*
- * Unlink from list.
- */
- LIST_REMOVE(inm, inm_entry);
- IFAFREE(&inm->inm_ia->ia_ifa); /* release reference */
-
- /*
- * Notify the network driver to update its multicast reception
- * filter.
- */
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr =
- inm->inm_addr;
- (*inm->inm_ifp->if_ioctl)(inm->inm_ifp, SIOCDELMULTI,
- (caddr_t)&ifr);
- free(inm, M_IPMADDR);
- }
- splx(s);
-}
diff --git a/c/src/lib/libnetworking/netinet/in.h b/c/src/lib/libnetworking/netinet/in.h
deleted file mode 100644
index ba3cbb21cc..0000000000
--- a/c/src/lib/libnetworking/netinet/in.h
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1990, 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.h 8.3 (Berkeley) 1/3/94
- * $Id$
- */
-
-#ifndef _NETINET_IN_H_
-#define _NETINET_IN_H_
-
-/*
- * Constants and structures defined by the internet system,
- * Per RFC 790, September 1981, and numerous additions.
- */
-
-/*
- * Protocols (RFC 1700)
- */
-#define IPPROTO_IP 0 /* dummy for IP */
-#define IPPROTO_ICMP 1 /* control message protocol */
-#define IPPROTO_IGMP 2 /* group mgmt protocol */
-#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
-#define IPPROTO_IPIP 4 /* IP encapsulation in IP */
-#define IPPROTO_TCP 6 /* tcp */
-#define IPPROTO_ST 7 /* Stream protocol II */
-#define IPPROTO_EGP 8 /* exterior gateway protocol */
-#define IPPROTO_PIGP 9 /* private interior gateway */
-#define IPPROTO_RCCMON 10 /* BBN RCC Monitoring */
-#define IPPROTO_NVPII 11 /* network voice protocol*/
-#define IPPROTO_PUP 12 /* pup */
-#define IPPROTO_ARGUS 13 /* Argus */
-#define IPPROTO_EMCON 14 /* EMCON */
-#define IPPROTO_XNET 15 /* Cross Net Debugger */
-#define IPPROTO_CHAOS 16 /* Chaos*/
-#define IPPROTO_UDP 17 /* user datagram protocol */
-#define IPPROTO_MUX 18 /* Multiplexing */
-#define IPPROTO_MEAS 19 /* DCN Measurement Subsystems */
-#define IPPROTO_HMP 20 /* Host Monitoring */
-#define IPPROTO_PRM 21 /* Packet Radio Measurement */
-#define IPPROTO_IDP 22 /* xns idp */
-#define IPPROTO_TRUNK1 23 /* Trunk-1 */
-#define IPPROTO_TRUNK2 24 /* Trunk-2 */
-#define IPPROTO_LEAF1 25 /* Leaf-1 */
-#define IPPROTO_LEAF2 26 /* Leaf-2 */
-#define IPPROTO_RDP 27 /* Reliable Data */
-#define IPPROTO_IRTP 28 /* Reliable Transaction */
-#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */
-#define IPPROTO_BLT 30 /* Bulk Data Transfer */
-#define IPPROTO_NSP 31 /* Network Services */
-#define IPPROTO_INP 32 /* Merit Internodal */
-#define IPPROTO_SEP 33 /* Sequential Exchange */
-#define IPPROTO_3PC 34 /* Third Party Connect */
-#define IPPROTO_IDPR 35 /* InterDomain Policy Routing */
-#define IPPROTO_XTP 36 /* XTP */
-#define IPPROTO_DDP 37 /* Datagram Delivery */
-#define IPPROTO_CMTP 38 /* Control Message Transport */
-#define IPPROTO_TPXX 39 /* TP++ Transport */
-#define IPPROTO_IL 40 /* IL transport protocol */
-#define IPPROTO_SIP 41 /* Simple Internet Protocol */
-#define IPPROTO_SDRP 42 /* Source Demand Routing */
-#define IPPROTO_SIPSR 43 /* SIP Source Route */
-#define IPPROTO_SIPFRAG 44 /* SIP Fragment */
-#define IPPROTO_IDRP 45 /* InterDomain Routing*/
-#define IPPROTO_RSVP 46 /* resource reservation */
-#define IPPROTO_GRE 47 /* General Routing Encap. */
-#define IPPROTO_MHRP 48 /* Mobile Host Routing */
-#define IPPROTO_BHA 49 /* BHA */
-#define IPPROTO_ESP 50 /* SIPP Encap Sec. Payload */
-#define IPPROTO_AH 51 /* SIPP Auth Header */
-#define IPPROTO_INLSP 52 /* Integ. Net Layer Security */
-#define IPPROTO_SWIPE 53 /* IP with encryption */
-#define IPPROTO_NHRP 54 /* Next Hop Resolution */
-/* 55-60: Unassigned */
-#define IPPROTO_AHIP 61 /* any host internal protocol */
-#define IPPROTO_CFTP 62 /* CFTP */
-#define IPPROTO_HELLO 63 /* "hello" routing protocol */
-#define IPPROTO_SATEXPAK 64 /* SATNET/Backroom EXPAK */
-#define IPPROTO_KRYPTOLAN 65 /* Kryptolan */
-#define IPPROTO_RVD 66 /* Remote Virtual Disk */
-#define IPPROTO_IPPC 67 /* Pluribus Packet Core */
-#define IPPROTO_ADFS 68 /* Any distributed FS */
-#define IPPROTO_SATMON 69 /* Satnet Monitoring */
-#define IPPROTO_VISA 70 /* VISA Protocol */
-#define IPPROTO_IPCV 71 /* Packet Core Utility */
-#define IPPROTO_CPNX 72 /* Comp. Prot. Net. Executive */
-#define IPPROTO_CPHB 73 /* Comp. Prot. HeartBeat */
-#define IPPROTO_WSN 74 /* Wang Span Network */
-#define IPPROTO_PVP 75 /* Packet Video Protocol */
-#define IPPROTO_BRSATMON 76 /* BackRoom SATNET Monitoring */
-#define IPPROTO_ND 77 /* Sun net disk proto (temp.) */
-#define IPPROTO_WBMON 78 /* WIDEBAND Monitoring */
-#define IPPROTO_WBEXPAK 79 /* WIDEBAND EXPAK */
-#define IPPROTO_EON 80 /* ISO cnlp */
-#define IPPROTO_VMTP 81 /* VMTP */
-#define IPPROTO_SVMTP 82 /* Secure VMTP */
-#define IPPROTO_VINES 83 /* Banyon VINES */
-#define IPPROTO_TTP 84 /* TTP */
-#define IPPROTO_IGP 85 /* NSFNET-IGP */
-#define IPPROTO_DGP 86 /* dissimilar gateway prot. */
-#define IPPROTO_TCF 87 /* TCF */
-#define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */
-#define IPPROTO_OSPFIGP 89 /* OSPFIGP */
-#define IPPROTO_SRPC 90 /* Strite RPC protocol */
-#define IPPROTO_LARP 91 /* Locus Address Resoloution */
-#define IPPROTO_MTP 92 /* Multicast Transport */
-#define IPPROTO_AX25 93 /* AX.25 Frames */
-#define IPPROTO_IPEIP 94 /* IP encapsulated in IP */
-#define IPPROTO_MICP 95 /* Mobile Int.ing control */
-#define IPPROTO_SCCSP 96 /* Semaphore Comm. security */
-#define IPPROTO_ETHERIP 97 /* Ethernet IP encapsulation */
-#define IPPROTO_ENCAP 98 /* encapsulation header */
-#define IPPROTO_APES 99 /* any private encr. scheme */
-#define IPPROTO_GMTP 100 /* GMTP*/
-/* 101-254: Unassigned */
-/* 255: Reserved */
-/* BSD Private, local use, namespace incursion */
-#define IPPROTO_DIVERT 254 /* divert pseudo-protocol */
-#define IPPROTO_RAW 255 /* raw IP packet */
-#define IPPROTO_MAX 256
-
-
-/*
- * Local port number conventions:
- *
- * When a user does a bind(2) or connect(2) with a port number of zero,
- * a non-conflicting local port address is chosen.
- * The default range is IPPORT_RESERVED through
- * IPPORT_USERRESERVED, although that is settable by sysctl.
- *
- * A user may set the IPPROTO_IP option IP_PORTRANGE to change this
- * default assignment range.
- *
- * The value IP_PORTRANGE_DEFAULT causes the default behavior.
- *
- * The value IP_PORTRANGE_HIGH changes the range of candidate port numbers
- * into the "high" range. These are reserved for client outbound connections
- * which do not want to be filtered by any firewalls.
- *
- * The value IP_PORTRANGE_LOW changes the range to the "low" are
- * that is (by convention) restricted to privileged processes. This
- * convention is based on "vouchsafe" principles only. It is only secure
- * if you trust the remote host to restrict these ports.
- *
- * The default range of ports and the high range can be changed by
- * sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto)
- *
- * Changing those values has bad security implications if you are
- * using a a stateless firewall that is allowing packets outside of that
- * range in order to allow transparent outgoing connections.
- *
- * Such a firewall configuration will generally depend on the use of these
- * default values. If you change them, you may find your Security
- * Administrator looking for you with a heavy object.
- */
-
-/*
- * Ports < IPPORT_RESERVED are reserved for
- * privileged processes (e.g. root). (IP_PORTRANGE_LOW)
- * Ports > IPPORT_USERRESERVED are reserved
- * for servers, not necessarily privileged. (IP_PORTRANGE_DEFAULT)
- */
-#define IPPORT_RESERVED 1024
-#define IPPORT_USERRESERVED 5000
-
-/*
- * Default local port range to use by setting IP_PORTRANGE_HIGH
- */
-#define IPPORT_HIFIRSTAUTO 40000
-#define IPPORT_HILASTAUTO 44999
-
-/*
- * Scanning for a free reserved port return a value below IPPORT_RESERVED,
- * but higher than IPPORT_RESERVEDSTART. Traditionally the start value was
- * 512, but that conflicts with some well-known-services that firewalls may
- * have a fit if we use.
- */
-#define IPPORT_RESERVEDSTART 600
-
-/*
- * Internet address (a structure for historical reasons)
- */
-struct in_addr {
- u_long s_addr;
-};
-
-/*
- * Definitions of bits in internet address integers.
- * On subnets, the decomposition of addresses to host and net parts
- * is done according to subnet mask, not the masks here.
- */
-#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0)
-#define IN_CLASSA_NET 0xff000000
-#define IN_CLASSA_NSHIFT 24
-#define IN_CLASSA_HOST 0x00ffffff
-#define IN_CLASSA_MAX 128
-
-#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000)
-#define IN_CLASSB_NET 0xffff0000
-#define IN_CLASSB_NSHIFT 16
-#define IN_CLASSB_HOST 0x0000ffff
-#define IN_CLASSB_MAX 65536
-
-#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000)
-#define IN_CLASSC_NET 0xffffff00
-#define IN_CLASSC_NSHIFT 8
-#define IN_CLASSC_HOST 0x000000ff
-
-#define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000)
-#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */
-#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */
-#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */
-#define IN_MULTICAST(i) IN_CLASSD(i)
-
-#define IN_EXPERIMENTAL(i) (((long)(i) & 0xf0000000) == 0xf0000000)
-#define IN_BADCLASS(i) (((long)(i) & 0xf0000000) == 0xf0000000)
-
-#define INADDR_ANY (u_long)0x00000000
-#define INADDR_BROADCAST (u_long)0xffffffff /* must be masked */
-#ifndef KERNEL
-#define INADDR_NONE 0xffffffff /* -1 return */
-#endif
-
-#define INADDR_UNSPEC_GROUP (u_long)0xe0000000 /* 224.0.0.0 */
-#define INADDR_ALLHOSTS_GROUP (u_long)0xe0000001 /* 224.0.0.1 */
-#define INADDR_ALLRTRS_GROUP (u_long)0xe0000002 /* 224.0.0.2 */
-#define INADDR_MAX_LOCAL_GROUP (u_long)0xe00000ff /* 224.0.0.255 */
-
-#define IN_LOOPBACKNET 127 /* official! */
-
-/*
- * Socket address, internet style.
- */
-struct sockaddr_in {
- u_char sin_len;
- u_char sin_family;
- u_short sin_port;
- struct in_addr sin_addr;
- char sin_zero[8];
-};
-
-/*
- * Structure used to describe IP options.
- * Used to store options internally, to pass them to a process,
- * or to restore options retrieved earlier.
- * The ip_dst is used for the first-hop gateway when using a source route
- * (this gets put into the header proper).
- */
-struct ip_opts {
- struct in_addr ip_dst; /* first hop, 0 w/o src rt */
- char ip_opts[40]; /* actually variable in size */
-};
-
-/*
- * Options for use with [gs]etsockopt at the IP level.
- * First word of comment is data type; bool is stored in int.
- */
-#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */
-#define IP_HDRINCL 2 /* int; header is included with data */
-#define IP_TOS 3 /* int; IP type of service and preced. */
-#define IP_TTL 4 /* int; IP time to live */
-#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */
-#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */
-#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */
-#define IP_RETOPTS 8 /* ip_opts; set/get IP options */
-#define IP_MULTICAST_IF 9 /* u_char; set/get IP multicast i/f */
-#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
-#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */
-#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */
-#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */
-#define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */
-#define IP_RSVP_ON 15 /* enable RSVP in kernel */
-#define IP_RSVP_OFF 16 /* disable RSVP in kernel */
-#define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */
-#define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */
-#define IP_PORTRANGE 19 /* int; range to choose for unspec port */
-#define IP_RECVIF 20 /* bool; receive reception if w/dgram */
-
-#define IP_FW_ADD 50 /* add a firewall rule to chain */
-#define IP_FW_DEL 51 /* delete a firewall rule from chain */
-#define IP_FW_FLUSH 52 /* flush firewall rule chain */
-#define IP_FW_ZERO 53 /* clear single/all firewall counter(s) */
-#define IP_FW_GET 54 /* get entire firewall rule chain */
-#define IP_NAT 55 /* set/get NAT opts */
-
-/*
- * Defaults and limits for options
- */
-#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
-#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
-#define IP_MAX_MEMBERSHIPS 20 /* per socket */
-
-/*
- * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
- */
-struct ip_mreq {
- struct in_addr imr_multiaddr; /* IP multicast address of group */
- struct in_addr imr_interface; /* local IP address of interface */
-};
-
-/*
- * Argument for IP_PORTRANGE:
- * - which range to search when port is unspecified at bind() or connect()
- */
-#define IP_PORTRANGE_DEFAULT 0 /* default range */
-#define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
-#define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
-
-/*
- * Definitions for inet sysctl operations.
- *
- * Third level is protocol number.
- * Fourth level is desired variable within that protocol.
- */
-#define IPPROTO_MAXID (IPPROTO_IDP + 1) /* don't list to IPPROTO_MAX */
-
-#define CTL_IPPROTO_NAMES { \
- { "ip", CTLTYPE_NODE }, \
- { "icmp", CTLTYPE_NODE }, \
- { "igmp", CTLTYPE_NODE }, \
- { "ggp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "tcp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { "egp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "pup", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "udp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "idp", CTLTYPE_NODE }, \
-}
-
-/*
- * Names for IP sysctl objects
- */
-#define IPCTL_FORWARDING 1 /* act as router */
-#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */
-#define IPCTL_DEFTTL 3 /* default TTL */
-#ifdef notyet
-#define IPCTL_DEFMTU 4 /* default MTU */
-#endif
-#define IPCTL_RTEXPIRE 5 /* cloned route expiration time */
-#define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */
-#define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */
-#define IPCTL_SOURCEROUTE 8 /* may perform source routes */
-#define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */
-#define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */
-#define IPCTL_INTRQDROPS 11 /* number of netisr q drops */
-#define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */
-#define IPCTL_MAXID 13
-
-#define IPCTL_NAMES { \
- { 0, 0 }, \
- { "forwarding", CTLTYPE_INT }, \
- { "redirect", CTLTYPE_INT }, \
- { "ttl", CTLTYPE_INT }, \
- { "mtu", CTLTYPE_INT }, \
- { "rtexpire", CTLTYPE_INT }, \
- { "rtminexpire", CTLTYPE_INT }, \
- { "rtmaxcache", CTLTYPE_INT }, \
- { "sourceroute", CTLTYPE_INT }, \
- { "directed-broadcast", CTLTYPE_INT }, \
- { "intr-queue-maxlen", CTLTYPE_INT }, \
- { "intr-queue-drops", CTLTYPE_INT }, \
- { "accept_sourceroute", CTLTYPE_INT }, \
-}
-
-
-#ifdef KERNEL
-struct ifnet; struct mbuf; /* forward declarations for Standard C */
-
-int in_broadcast __P((struct in_addr, struct ifnet *));
-int in_canforward __P((struct in_addr));
-int in_cksum __P((struct mbuf *, int));
-int in_localaddr __P((struct in_addr));
-char *inet_ntoa __P((struct in_addr)); /* in libkern */
-
-/* Firewall hooks */
-struct ip;
-typedef int ip_fw_chk_t __P((struct ip**, int, struct ifnet*, int, struct mbuf**));
-typedef int ip_fw_ctl_t __P((int, struct mbuf**));
-extern ip_fw_chk_t *ip_fw_chk_ptr;
-extern ip_fw_ctl_t *ip_fw_ctl_ptr;
-
-/* IP NAT hooks */
-typedef int ip_nat_t __P((struct ip**, struct mbuf**, struct ifnet*, int));
-typedef int ip_nat_ctl_t __P((int, struct mbuf**));
-extern ip_nat_t *ip_nat_ptr;
-extern ip_nat_ctl_t *ip_nat_ctl_ptr;
-#define IP_NAT_IN 0x00000001
-#define IP_NAT_OUT 0x00000002
-
-#endif /* KERNEL */
-
-#endif
diff --git a/c/src/lib/libnetworking/netinet/in_cksum.c b/c/src/lib/libnetworking/netinet/in_cksum.c
deleted file mode 100644
index 9cffad3221..0000000000
--- a/c/src/lib/libnetworking/netinet/in_cksum.c
+++ /dev/null
@@ -1,166 +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 <sys/param.h>
-#include <sys/mbuf.h>
-
-/*
- * Try to use a CPU specific version, then punt to the portable C one.
- */
-
-#if (defined(__GNUC__) && (defined(__mc68000__) || defined(__m68k__)))
-
-#include "in_cksum_m68k.c"
-
-#elif (defined(__GNUC__) && defined(__i386__))
-
-#include "in_cksum_i386.c"
-
-#else
-
-/*
- * Checksum routine for Internet Protocol family headers (Portable Version).
- *
- * This routine is very heavily used in the network
- * code and should be modified for each CPU to be as fast as possible.
- */
-
-#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
-#define REDUCE \
- {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);}
-
-int
-in_cksum(m, len)
- register struct mbuf *m;
- register int len;
-{
- register u_short *w;
- register int sum = 0;
- register int mlen = 0;
- int byte_swapped = 0;
-
- union {
- char c[2];
- u_short s;
- } s_util;
- union {
- u_short s[2];
- long l;
- } l_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 even boundary.
- */
- if ((1 & (int) w) && (mlen > 0)) {
- REDUCE;
- sum <<= 8;
- s_util.c[0] = *(u_char *)w;
- w = (u_short *)((char *)w + 1);
- mlen--;
- byte_swapped = 1;
- }
- /*
- * Unroll the loop to make overhead from
- * branches &c small.
- */
- while ((mlen -= 32) >= 0) {
- sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
- sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7];
- sum += w[8]; sum += w[9]; sum += w[10]; sum += w[11];
- sum += w[12]; sum += w[13]; sum += w[14]; sum += w[15];
- w += 16;
- }
- mlen += 32;
- while ((mlen -= 8) >= 0) {
- sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
- w += 4;
- }
- mlen += 8;
- if (mlen == 0 && byte_swapped == 0)
- continue;
- REDUCE;
- 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)
- printf("cksum: out of data\n");
- 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);
-}
-#endif
diff --git a/c/src/lib/libnetworking/netinet/in_cksum_i386.c b/c/src/lib/libnetworking/netinet/in_cksum_i386.c
deleted file mode 100644
index 2057ab3fd6..0000000000
--- a/c/src/lib/libnetworking/netinet/in_cksum_i386.c
+++ /dev/null
@@ -1,198 +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$
- */
-
-#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("addl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (w))
-#define ADDC(n) asm("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("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)
- printf("cksum: out of data\n");
- 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/c/src/lib/libnetworking/netinet/in_cksum_m68k.c b/c/src/lib/libnetworking/netinet/in_cksum_m68k.c
deleted file mode 100644
index 58199c3adf..0000000000
--- a/c/src/lib/libnetworking/netinet/in_cksum_m68k.c
+++ /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 <sys/param.h>
-#include <sys/mbuf.h>
-
-#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/c/src/lib/libnetworking/netinet/in_pcb.c b/c/src/lib/libnetworking/netinet/in_pcb.c
deleted file mode 100644
index 116f70eebf..0000000000
--- a/c/src/lib/libnetworking/netinet/in_pcb.c
+++ /dev/null
@@ -1,757 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1991, 1993, 1995
- * 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_pcb.c 8.4 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/proc.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-
-struct in_addr zeroin_addr;
-
-static void in_pcbinshash __P((struct inpcb *));
-static void in_rtchange __P((struct inpcb *, int));
-
-/*
- * These configure the range of local port addresses assigned to
- * "unspecified" outgoing connections/packets/whatever.
- */
-static int ipport_lowfirstauto = IPPORT_RESERVED - 1; /* 1023 */
-static int ipport_lowlastauto = IPPORT_RESERVEDSTART; /* 600 */
-static int ipport_firstauto = IPPORT_RESERVED; /* 1024 */
-static int ipport_lastauto = IPPORT_USERRESERVED; /* 5000 */
-static int ipport_hifirstauto = IPPORT_HIFIRSTAUTO; /* 40000 */
-static int ipport_hilastauto = IPPORT_HILASTAUTO; /* 44999 */
-
-#define RANGECHK(var, min, max) \
- if ((var) < (min)) { (var) = (min); } \
- else if ((var) > (max)) { (var) = (max); }
-
-#if 0
-static int
-sysctl_net_ipport_check SYSCTL_HANDLER_ARGS
-{
- int error = sysctl_handle_int(oidp,
- oidp->oid_arg1, oidp->oid_arg2, req);
- if (!error) {
- RANGECHK(ipport_lowfirstauto, 1, IPPORT_RESERVED - 1);
- RANGECHK(ipport_lowlastauto, 1, IPPORT_RESERVED - 1);
- RANGECHK(ipport_firstauto, IPPORT_RESERVED, USHRT_MAX);
- RANGECHK(ipport_lastauto, IPPORT_RESERVED, USHRT_MAX);
- RANGECHK(ipport_hifirstauto, IPPORT_RESERVED, USHRT_MAX);
- RANGECHK(ipport_hilastauto, IPPORT_RESERVED, USHRT_MAX);
- }
- return error;
-}
-#endif
-
-#undef RANGECHK
-
-SYSCTL_NODE(_net_inet_ip, IPPROTO_IP, portrange, CTLFLAG_RW, 0, "IP Ports");
-
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, lowfirst, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_lowfirstauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, lowlast, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_lowlastauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, first, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_firstauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, last, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_lastauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, hifirst, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_hifirstauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, hilast, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_hilastauto, 0, &sysctl_net_ipport_check, "I", "");
-
-int
-in_pcballoc(so, pcbinfo)
- struct socket *so;
- struct inpcbinfo *pcbinfo;
-{
- register struct inpcb *inp;
- int s;
-
- MALLOC(inp, struct inpcb *, sizeof(*inp), M_PCB, M_NOWAIT);
- if (inp == NULL)
- return (ENOBUFS);
- bzero((caddr_t)inp, sizeof(*inp));
- inp->inp_pcbinfo = pcbinfo;
- inp->inp_socket = so;
- s = splnet();
- LIST_INSERT_HEAD(pcbinfo->listhead, inp, inp_list);
- in_pcbinshash(inp);
- splx(s);
- so->so_pcb = (caddr_t)inp;
- return (0);
-}
-
-int
-in_pcbbind(inp, nam)
- register struct inpcb *inp;
- struct mbuf *nam;
-{
- register struct socket *so = inp->inp_socket;
- unsigned short *lastport;
- struct sockaddr_in *sin;
- u_short lport = 0;
- int wild = 0, reuseport = (so->so_options & SO_REUSEPORT);
- int error;
-
- if (in_ifaddr == 0)
- return (EADDRNOTAVAIL);
- if (inp->inp_lport || inp->inp_laddr.s_addr != INADDR_ANY)
- return (EINVAL);
- if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0 &&
- ((so->so_proto->pr_flags & PR_CONNREQUIRED) == 0 ||
- (so->so_options & SO_ACCEPTCONN) == 0))
- wild = 1;
- if (nam) {
- sin = mtod(nam, struct sockaddr_in *);
- if (nam->m_len != sizeof (*sin))
- return (EINVAL);
-#ifdef notdef
- /*
- * We should check the family, but old programs
- * incorrectly fail to initialize it.
- */
- if (sin->sin_family != AF_INET)
- return (EAFNOSUPPORT);
-#endif
- lport = sin->sin_port;
- if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) {
- /*
- * Treat SO_REUSEADDR as SO_REUSEPORT for multicast;
- * allow complete duplication of binding if
- * SO_REUSEPORT is set, or if SO_REUSEADDR is set
- * and a multicast address is bound on both
- * new and duplicated sockets.
- */
- if (so->so_options & SO_REUSEADDR)
- reuseport = SO_REUSEADDR|SO_REUSEPORT;
- } else if (sin->sin_addr.s_addr != INADDR_ANY) {
- sin->sin_port = 0; /* yech... */
- if (ifa_ifwithaddr((struct sockaddr *)sin) == 0)
- return (EADDRNOTAVAIL);
- }
- if (lport) {
- struct inpcb *t;
-
- /* GROSS */
- if (ntohs(lport) < IPPORT_RESERVED &&
- (error = suser(p->p_ucred, &p->p_acflag)))
- return (EACCES);
- if (so->so_uid) {
- t = in_pcblookup(inp->inp_pcbinfo, zeroin_addr,
- 0, sin->sin_addr, lport,
- INPLOOKUP_WILDCARD);
- if (t && (so->so_uid != t->inp_socket->so_uid))
- return (EADDRINUSE);
- }
- t = in_pcblookup(inp->inp_pcbinfo, zeroin_addr, 0,
- sin->sin_addr, lport, wild);
- if (t && (reuseport & t->inp_socket->so_options) == 0)
- return (EADDRINUSE);
- }
- inp->inp_laddr = sin->sin_addr;
- }
- if (lport == 0) {
- ushort first, last;
- int count;
-
- inp->inp_flags |= INP_ANONPORT;
-
- if (inp->inp_flags & INP_HIGHPORT) {
- first = ipport_hifirstauto; /* sysctl */
- last = ipport_hilastauto;
- lastport = &inp->inp_pcbinfo->lasthi;
- } else if (inp->inp_flags & INP_LOWPORT) {
- if ((error = suser(p->p_ucred, &p->p_acflag)))
- return (EACCES);
- first = ipport_lowfirstauto; /* 1023 */
- last = ipport_lowlastauto; /* 600 */
- lastport = &inp->inp_pcbinfo->lastlow;
- } else {
- first = ipport_firstauto; /* sysctl */
- last = ipport_lastauto;
- lastport = &inp->inp_pcbinfo->lastport;
- }
- /*
- * Simple check to ensure all ports are not used up causing
- * a deadlock here.
- *
- * We split the two cases (up and down) so that the direction
- * is not being tested on each round of the loop.
- */
- if (first > last) {
- /*
- * counting down
- */
- count = first - last;
-
- do {
- if (count-- <= 0) /* completely used? */
- return (EADDRNOTAVAIL);
- --*lastport;
- if (*lastport > first || *lastport < last)
- *lastport = first;
- lport = htons(*lastport);
- } while (in_pcblookup(inp->inp_pcbinfo,
- zeroin_addr, 0, inp->inp_laddr, lport, wild));
- } else {
- /*
- * counting up
- */
- count = last - first;
-
- do {
- if (count-- <= 0) /* completely used? */
- return (EADDRNOTAVAIL);
- ++*lastport;
- if (*lastport < first || *lastport > last)
- *lastport = first;
- lport = htons(*lastport);
- } while (in_pcblookup(inp->inp_pcbinfo,
- zeroin_addr, 0, inp->inp_laddr, lport, wild));
- }
- }
- inp->inp_lport = lport;
- in_pcbrehash(inp);
- return (0);
-}
-
-/*
- * Transform old in_pcbconnect() into an inner subroutine for new
- * in_pcbconnect(): Do some validity-checking on the remote
- * address (in mbuf 'nam') and then determine local host address
- * (i.e., which interface) to use to access that remote host.
- *
- * This preserves definition of in_pcbconnect(), while supporting a
- * slightly different version for T/TCP. (This is more than
- * a bit of a kludge, but cleaning up the internal interfaces would
- * have forced minor changes in every protocol).
- */
-
-int
-in_pcbladdr(inp, nam, plocal_sin)
- register struct inpcb *inp;
- struct mbuf *nam;
- struct sockaddr_in **plocal_sin;
-{
- struct in_ifaddr *ia;
- register struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *);
-
- if (nam->m_len != sizeof (*sin))
- return (EINVAL);
- if (sin->sin_family != AF_INET)
- return (EAFNOSUPPORT);
- if (sin->sin_port == 0)
- return (EADDRNOTAVAIL);
- if (in_ifaddr) {
- /*
- * If the destination address is INADDR_ANY,
- * use the primary local address.
- * If the supplied address is INADDR_BROADCAST,
- * and the primary interface supports broadcast,
- * choose the broadcast address for that interface.
- */
-#define satosin(sa) ((struct sockaddr_in *)(sa))
-#define sintosa(sin) ((struct sockaddr *)(sin))
-#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
- if (sin->sin_addr.s_addr == INADDR_ANY)
- sin->sin_addr = IA_SIN(in_ifaddr)->sin_addr;
- else if (sin->sin_addr.s_addr == (u_long)INADDR_BROADCAST &&
- (in_ifaddr->ia_ifp->if_flags & IFF_BROADCAST))
- sin->sin_addr = satosin(&in_ifaddr->ia_broadaddr)->sin_addr;
- }
- if (inp->inp_laddr.s_addr == INADDR_ANY) {
- register struct route *ro;
-
- ia = (struct in_ifaddr *)0;
- /*
- * If route is known or can be allocated now,
- * our src addr is taken from the i/f, else punt.
- */
- ro = &inp->inp_route;
- if (ro->ro_rt &&
- (satosin(&ro->ro_dst)->sin_addr.s_addr !=
- sin->sin_addr.s_addr ||
- inp->inp_socket->so_options & SO_DONTROUTE)) {
- RTFREE(ro->ro_rt);
- ro->ro_rt = (struct rtentry *)0;
- }
- if ((inp->inp_socket->so_options & SO_DONTROUTE) == 0 && /*XXX*/
- (ro->ro_rt == (struct rtentry *)0 ||
- ro->ro_rt->rt_ifp == (struct ifnet *)0)) {
- /* No route yet, so try to acquire one */
- ro->ro_dst.sa_family = AF_INET;
- ro->ro_dst.sa_len = sizeof(struct sockaddr_in);
- ((struct sockaddr_in *) &ro->ro_dst)->sin_addr =
- sin->sin_addr;
- rtalloc(ro);
- }
- /*
- * If we found a route, use the address
- * corresponding to the outgoing interface
- * unless it is the loopback (in case a route
- * to our address on another net goes to loopback).
- */
- if (ro->ro_rt && !(ro->ro_rt->rt_ifp->if_flags & IFF_LOOPBACK))
- ia = ifatoia(ro->ro_rt->rt_ifa);
- if (ia == 0) {
- u_short fport = sin->sin_port;
-
- sin->sin_port = 0;
- ia = ifatoia(ifa_ifwithdstaddr(sintosa(sin)));
- if (ia == 0)
- ia = ifatoia(ifa_ifwithnet(sintosa(sin)));
- sin->sin_port = fport;
- if (ia == 0)
- ia = in_ifaddr;
- if (ia == 0)
- return (EADDRNOTAVAIL);
- }
- /*
- * If the destination address is multicast and an outgoing
- * interface has been set as a multicast option, use the
- * address of that interface as our source address.
- */
- if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr)) &&
- inp->inp_moptions != NULL) {
- struct ip_moptions *imo;
- struct ifnet *ifp;
-
- imo = inp->inp_moptions;
- if (imo->imo_multicast_ifp != NULL) {
- ifp = imo->imo_multicast_ifp;
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if (ia->ia_ifp == ifp)
- break;
- if (ia == 0)
- return (EADDRNOTAVAIL);
- }
- }
- /*
- * Don't do pcblookup call here; return interface in plocal_sin
- * and exit to caller, that will do the lookup.
- */
- *plocal_sin = &ia->ia_addr;
-
- }
- return(0);
-}
-
-/*
- * Outer subroutine:
- * Connect from a socket to a specified address.
- * Both address and port must be specified in argument sin.
- * If don't have a local address for this socket yet,
- * then pick one.
- */
-int
-in_pcbconnect(inp, nam)
- register struct inpcb *inp;
- struct mbuf *nam;
-{
- struct sockaddr_in *ifaddr;
- register struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *);
- int error;
-
- /*
- * Call inner routine, to assign local interface address.
- */
- if ((error = in_pcbladdr(inp, nam, &ifaddr)))
- return(error);
-
- if (in_pcblookuphash(inp->inp_pcbinfo, sin->sin_addr, sin->sin_port,
- inp->inp_laddr.s_addr ? inp->inp_laddr : ifaddr->sin_addr,
- inp->inp_lport, 0) != NULL)
- return (EADDRINUSE);
- if (inp->inp_laddr.s_addr == INADDR_ANY) {
- if (inp->inp_lport == 0)
- (void)in_pcbbind(inp, (struct mbuf *)0);
- inp->inp_laddr = ifaddr->sin_addr;
- }
- inp->inp_faddr = sin->sin_addr;
- inp->inp_fport = sin->sin_port;
- in_pcbrehash(inp);
- return (0);
-}
-
-void
-in_pcbdisconnect(inp)
- struct inpcb *inp;
-{
-
- inp->inp_faddr.s_addr = INADDR_ANY;
- inp->inp_fport = 0;
- in_pcbrehash(inp);
- if (inp->inp_socket->so_state & SS_NOFDREF)
- in_pcbdetach(inp);
-}
-
-void
-in_pcbdetach(inp)
- struct inpcb *inp;
-{
- struct socket *so = inp->inp_socket;
- int s;
-
- so->so_pcb = 0;
- sofree(so);
- if (inp->inp_options)
- (void)m_free(inp->inp_options);
- if (inp->inp_route.ro_rt)
- rtfree(inp->inp_route.ro_rt);
- ip_freemoptions(inp->inp_moptions);
- s = splnet();
- LIST_REMOVE(inp, inp_hash);
- LIST_REMOVE(inp, inp_list);
- splx(s);
- FREE(inp, M_PCB);
-}
-
-void
-in_setsockaddr(inp, nam)
- register struct inpcb *inp;
- struct mbuf *nam;
-{
- register struct sockaddr_in *sin;
-
- nam->m_len = sizeof (*sin);
- sin = mtod(nam, struct sockaddr_in *);
- bzero((caddr_t)sin, sizeof (*sin));
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_port = inp->inp_lport;
- sin->sin_addr = inp->inp_laddr;
-}
-
-void
-in_setpeeraddr(inp, nam)
- struct inpcb *inp;
- struct mbuf *nam;
-{
- register struct sockaddr_in *sin;
-
- nam->m_len = sizeof (*sin);
- sin = mtod(nam, struct sockaddr_in *);
- bzero((caddr_t)sin, sizeof (*sin));
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_port = inp->inp_fport;
- sin->sin_addr = inp->inp_faddr;
-}
-
-/*
- * Pass some notification to all connections of a protocol
- * associated with address dst. The local address and/or port numbers
- * may be specified to limit the search. The "usual action" will be
- * taken, depending on the ctlinput cmd. The caller must filter any
- * cmds that are uninteresting (e.g., no error in the map).
- * Call the protocol specific routine (if any) to report
- * any errors for each matching socket.
- *
- * Must be called at splnet.
- */
-void
-in_pcbnotify(head, dst, fport_arg, laddr, lport_arg, cmd, notify)
- struct inpcbhead *head;
- struct sockaddr *dst;
- u_int fport_arg, lport_arg;
- struct in_addr laddr;
- int cmd;
- void (*notify) __P((struct inpcb *, int));
-{
- register struct inpcb *inp, *oinp;
- struct in_addr faddr;
- u_short fport = fport_arg, lport = lport_arg;
- int errnum, s;
-
- if ((unsigned)cmd > PRC_NCMDS || dst->sa_family != AF_INET)
- return;
- faddr = ((struct sockaddr_in *)dst)->sin_addr;
- if (faddr.s_addr == INADDR_ANY)
- return;
-
- /*
- * Redirects go to all references to the destination,
- * and use in_rtchange to invalidate the route cache.
- * Dead host indications: notify all references to the destination.
- * Otherwise, if we have knowledge of the local port and address,
- * deliver only to that socket.
- */
- if (PRC_IS_REDIRECT(cmd) || cmd == PRC_HOSTDEAD) {
- fport = 0;
- lport = 0;
- laddr.s_addr = 0;
- if (cmd != PRC_HOSTDEAD)
- notify = in_rtchange;
- }
- errnum = inetctlerrmap[cmd];
- s = splnet();
- for (inp = head->lh_first; inp != NULL;) {
- if (inp->inp_faddr.s_addr != faddr.s_addr ||
- inp->inp_socket == 0 ||
- (lport && inp->inp_lport != lport) ||
- (laddr.s_addr && inp->inp_laddr.s_addr != laddr.s_addr) ||
- (fport && inp->inp_fport != fport)) {
- inp = inp->inp_list.le_next;
- continue;
- }
- oinp = inp;
- inp = inp->inp_list.le_next;
- if (notify)
- (*notify)(oinp, errnum);
- }
- splx(s);
-}
-
-/*
- * Check for alternatives when higher level complains
- * about service problems. For now, invalidate cached
- * routing information. If the route was created dynamically
- * (by a redirect), time to try a default gateway again.
- */
-void
-in_losing(inp)
- struct inpcb *inp;
-{
- register struct rtentry *rt;
- struct rt_addrinfo info;
-
- if ((rt = inp->inp_route.ro_rt)) {
- inp->inp_route.ro_rt = 0;
- bzero((caddr_t)&info, sizeof(info));
- info.rti_info[RTAX_DST] =
- (struct sockaddr *)&inp->inp_route.ro_dst;
- info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
- info.rti_info[RTAX_NETMASK] = rt_mask(rt);
- rt_missmsg(RTM_LOSING, &info, rt->rt_flags, 0);
- if (rt->rt_flags & RTF_DYNAMIC)
- (void) rtrequest(RTM_DELETE, rt_key(rt),
- rt->rt_gateway, rt_mask(rt), rt->rt_flags,
- (struct rtentry **)0);
- else
- /*
- * A new route can be allocated
- * the next time output is attempted.
- */
- rtfree(rt);
- }
-}
-
-/*
- * After a routing change, flush old routing
- * and allocate a (hopefully) better one.
- */
-static void
-in_rtchange(inp, errnum)
- register struct inpcb *inp;
- int errnum;
-{
- if (inp->inp_route.ro_rt) {
- rtfree(inp->inp_route.ro_rt);
- inp->inp_route.ro_rt = 0;
- /*
- * A new route can be allocated the next time
- * output is attempted.
- */
- }
-}
-
-struct inpcb *
-in_pcblookup(pcbinfo, faddr, fport_arg, laddr, lport_arg, wild_okay)
- struct inpcbinfo *pcbinfo;
- struct in_addr faddr, laddr;
- u_int fport_arg, lport_arg;
- int wild_okay;
-{
- register struct inpcb *inp, *match = NULL;
- int matchwild = 3, wildcard;
- u_short fport = fport_arg, lport = lport_arg;
- int s;
-
- s = splnet();
-
- for (inp = pcbinfo->listhead->lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_lport != lport)
- continue;
- wildcard = 0;
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- if (faddr.s_addr == INADDR_ANY)
- wildcard++;
- else if (inp->inp_faddr.s_addr != faddr.s_addr ||
- inp->inp_fport != fport)
- continue;
- } else {
- if (faddr.s_addr != INADDR_ANY)
- wildcard++;
- }
- if (inp->inp_laddr.s_addr != INADDR_ANY) {
- if (laddr.s_addr == INADDR_ANY)
- wildcard++;
- else if (inp->inp_laddr.s_addr != laddr.s_addr)
- continue;
- } else {
- if (laddr.s_addr != INADDR_ANY)
- wildcard++;
- }
- if (wildcard && wild_okay == 0)
- continue;
- if (wildcard < matchwild) {
- match = inp;
- matchwild = wildcard;
- if (matchwild == 0) {
- break;
- }
- }
- }
- splx(s);
- return (match);
-}
-
-/*
- * Lookup PCB in hash list.
- */
-struct inpcb *
-in_pcblookuphash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard)
- struct inpcbinfo *pcbinfo;
- struct in_addr faddr, laddr;
- u_int fport_arg, lport_arg;
- int wildcard;
-{
- struct inpcbhead *head;
- register struct inpcb *inp;
- u_short fport = fport_arg, lport = lport_arg;
- int s;
-
- s = splnet();
- /*
- * First look for an exact match.
- */
- head = &pcbinfo->hashbase[INP_PCBHASH(faddr.s_addr, lport, fport, pcbinfo->hashmask)];
- for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
- if (inp->inp_faddr.s_addr == faddr.s_addr &&
- inp->inp_laddr.s_addr == laddr.s_addr &&
- inp->inp_fport == fport &&
- inp->inp_lport == lport)
- goto found;
- }
- if (wildcard) {
- struct inpcb *local_wild = NULL;
-
- head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbinfo->hashmask)];
- for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
- if (inp->inp_faddr.s_addr == INADDR_ANY &&
- inp->inp_fport == 0 && inp->inp_lport == lport) {
- if (inp->inp_laddr.s_addr == laddr.s_addr)
- goto found;
- else if (inp->inp_laddr.s_addr == INADDR_ANY)
- local_wild = inp;
- }
- }
- if (local_wild != NULL) {
- inp = local_wild;
- goto found;
- }
- }
- splx(s);
- return (NULL);
-
-found:
- /*
- * Move PCB to head of this hash chain so that it can be
- * found more quickly in the future.
- * XXX - this is a pessimization on machines with few
- * concurrent connections.
- */
- if (inp != head->lh_first) {
- LIST_REMOVE(inp, inp_hash);
- LIST_INSERT_HEAD(head, inp, inp_hash);
- }
- splx(s);
- return (inp);
-}
-
-/*
- * Insert PCB into hash chain. Must be called at splnet.
- */
-static void
-in_pcbinshash(inp)
- struct inpcb *inp;
-{
- struct inpcbhead *head;
-
- head = &inp->inp_pcbinfo->hashbase[INP_PCBHASH(inp->inp_faddr.s_addr,
- inp->inp_lport, inp->inp_fport, inp->inp_pcbinfo->hashmask)];
-
- LIST_INSERT_HEAD(head, inp, inp_hash);
-}
-
-void
-in_pcbrehash(inp)
- struct inpcb *inp;
-{
- struct inpcbhead *head;
- int s;
-
- s = splnet();
- LIST_REMOVE(inp, inp_hash);
-
- head = &inp->inp_pcbinfo->hashbase[INP_PCBHASH(inp->inp_faddr.s_addr,
- inp->inp_lport, inp->inp_fport, inp->inp_pcbinfo->hashmask)];
-
- LIST_INSERT_HEAD(head, inp, inp_hash);
- splx(s);
-}
diff --git a/c/src/lib/libnetworking/netinet/in_pcb.h b/c/src/lib/libnetworking/netinet/in_pcb.h
deleted file mode 100644
index 9390cfda6c..0000000000
--- a/c/src/lib/libnetworking/netinet/in_pcb.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1990, 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_pcb.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IN_PCB_H_
-#define _NETINET_IN_PCB_H_
-
-#include <sys/queue.h>
-
-/*
- * Common structure pcb for internet protocol implementation.
- * Here are stored pointers to local and foreign host table
- * entries, local and foreign socket numbers, and pointers
- * up (to a socket structure) and down (to a protocol-specific)
- * control block.
- */
-LIST_HEAD(inpcbhead, inpcb);
-
-struct inpcb {
- LIST_ENTRY(inpcb) inp_list; /* list for all PCBs of this proto */
- LIST_ENTRY(inpcb) inp_hash; /* hash list */
- struct inpcbinfo *inp_pcbinfo; /* PCB list info */
- struct in_addr inp_faddr; /* foreign host table entry */
- struct in_addr inp_laddr; /* local host table entry */
- u_short inp_fport; /* foreign port */
- u_short inp_lport; /* local port */
- caddr_t inp_ppcb; /* pointer to per-protocol pcb */
- struct socket *inp_socket; /* back pointer to socket */
- struct mbuf *inp_options; /* IP options */
- struct route inp_route; /* placeholder for routing entry */
- int inp_flags; /* generic IP/datagram flags */
- u_char inp_ip_tos; /* type of service proto */
- u_char inp_ip_ttl; /* time to live proto */
- u_char inp_ip_p; /* protocol proto */
- u_char pad[1]; /* alignment */
- struct ip_moptions *inp_moptions; /* IP multicast options */
-#if 0 /* Someday, perhaps... */
- struct ip inp_ip; /* header prototype; should have more */
-#endif
-};
-
-struct inpcbinfo {
- struct inpcbhead *listhead;
- struct inpcbhead *hashbase;
- unsigned long hashmask;
- unsigned short lastport;
- unsigned short lastlow;
- unsigned short lasthi;
-};
-
-#define INP_PCBHASH(faddr, lport, fport, mask) \
- (((faddr) ^ ((faddr) >> 16) ^ (lport) ^ (fport)) & (mask))
-
-/* flags in inp_flags: */
-#define INP_RECVOPTS 0x01 /* receive incoming IP options */
-#define INP_RECVRETOPTS 0x02 /* receive IP options for reply */
-#define INP_RECVDSTADDR 0x04 /* receive IP dst address */
-#define INP_HDRINCL 0x08 /* user supplies entire IP header */
-#define INP_HIGHPORT 0x10 /* user wants "high" port binding */
-#define INP_LOWPORT 0x20 /* user wants "low" port binding */
-#define INP_ANONPORT 0x40 /* port chosen for user */
-#define INP_RECVIF 0x80 /* receive incoming interface */
-#define INP_CONTROLOPTS (INP_RECVOPTS|INP_RECVRETOPTS|INP_RECVDSTADDR|\
- INP_RECVIF)
-
-#define INPLOOKUP_WILDCARD 1
-
-#define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb)
-
-#ifdef KERNEL
-void in_losing __P((struct inpcb *));
-int in_pcballoc __P((struct socket *, struct inpcbinfo *));
-int in_pcbbind __P((struct inpcb *, struct mbuf *));
-int in_pcbconnect __P((struct inpcb *, struct mbuf *));
-void in_pcbdetach __P((struct inpcb *));
-void in_pcbdisconnect __P((struct inpcb *));
-int in_pcbladdr __P((struct inpcb *, struct mbuf *,
- struct sockaddr_in **));
-struct inpcb *
- in_pcblookup __P((struct inpcbinfo *,
- struct in_addr, u_int, struct in_addr, u_int, int));
-struct inpcb *
- in_pcblookuphash __P((struct inpcbinfo *,
- struct in_addr, u_int, struct in_addr, u_int, int));
-void in_pcbnotify __P((struct inpcbhead *, struct sockaddr *,
- u_int, struct in_addr, u_int, int, void (*)(struct inpcb *, int)));
-void in_pcbrehash __P((struct inpcb *));
-void in_setpeeraddr __P((struct inpcb *, struct mbuf *));
-void in_setsockaddr __P((struct inpcb *, struct mbuf *));
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/netinet/in_proto.c b/c/src/lib/libnetworking/netinet/in_proto.c
deleted file mode 100644
index 3fa845955e..0000000000
--- a/c/src/lib/libnetworking/netinet/in_proto.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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_proto.c 8.2 (Berkeley) 2/9/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/radix.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/in_pcb.h>
-#include <netinet/igmp_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-/*
- * TCP/IP protocol family: IP, ICMP, UDP, TCP.
- */
-
-#ifdef IPXIP
-#include <netipx/ipx.h>
-#include <netipx/ipx_ip.h>
-#endif
-
-#ifdef NSIP
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-#endif
-
-#ifdef TPIP
-void tpip_input(), tpip_ctlinput(), tp_init(), tp_slowtimo(), tp_drain();
-int tp_ctloutput(), tp_usrreq();
-#endif
-
-#ifdef EON
-void eoninput(), eonctlinput(), eonprotoinit();
-#endif /* EON */
-
-extern struct domain inetdomain;
-
-struct protosw inetsw[] = {
-{ 0, &inetdomain, 0, 0,
- 0, 0, 0, 0,
- 0,
- ip_init, 0, ip_slowtimo, ip_drain
-},
-{ SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR,
- udp_input, 0, udp_ctlinput, ip_ctloutput,
- udp_usrreq,
- udp_init
-},
-{ SOCK_STREAM, &inetdomain, IPPROTO_TCP,
- PR_CONNREQUIRED|PR_IMPLOPCL|PR_WANTRCVD,
- tcp_input, 0, tcp_ctlinput, tcp_ctloutput,
- 0,
- tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain,
- &tcp_usrreqs
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR,
- rip_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR,
- icmp_input, 0, 0, rip_ctloutput,
- rip_usrreq
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_IGMP, PR_ATOMIC|PR_ADDR,
- igmp_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- igmp_init, igmp_fasttimo, igmp_slowtimo
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_RSVP, PR_ATOMIC|PR_ADDR,
- rsvp_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_IPIP, PR_ATOMIC|PR_ADDR,
- ipip_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-#ifdef IPDIVERT
-{ SOCK_RAW, &inetdomain, IPPROTO_DIVERT, PR_ATOMIC|PR_ADDR,
- div_input, 0, 0, ip_ctloutput,
- div_usrreq,
- div_init, 0, 0, 0,
-},
-#endif
-#ifdef TPIP
-{ SOCK_SEQPACKET,&inetdomain, IPPROTO_TP, PR_CONNREQUIRED|PR_WANTRCVD,
- tpip_input, 0, tpip_ctlinput, tp_ctloutput,
- tp_usrreq,
- tp_init, 0, tp_slowtimo, tp_drain,
-},
-#endif
-/* EON (ISO CLNL over IP) */
-#ifdef EON
-{ SOCK_RAW, &inetdomain, IPPROTO_EON, 0,
- eoninput, 0, eonctlinput, 0,
- 0,
- eonprotoinit, 0, 0, 0,
-},
-#endif
-#ifdef IPXIP
-{ SOCK_RAW, &inetdomain, IPPROTO_IDP, PR_ATOMIC|PR_ADDR,
- ipxip_input, 0, ipxip_ctlinput, 0,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-#endif
-#ifdef NSIP
-{ SOCK_RAW, &inetdomain, IPPROTO_IDP, PR_ATOMIC|PR_ADDR,
- idpip_input, 0, nsip_ctlinput, 0,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-#endif
- /* raw wildcard */
-{ SOCK_RAW, &inetdomain, 0, PR_ATOMIC|PR_ADDR,
- rip_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- rip_init, 0, 0, 0,
-},
-};
-
-extern int in_inithead(void **, int);
-
-struct domain inetdomain =
- { AF_INET, "internet", 0, 0, 0,
- inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])], 0,
- in_inithead, 32, sizeof(struct sockaddr_in)
- };
-
-DOMAIN_SET(inet);
-
-SYSCTL_NODE(_net, PF_INET, inet, CTLFLAG_RW, 0,
- "Internet Family");
-
-SYSCTL_NODE(_net_inet, IPPROTO_IP, ip, CTLFLAG_RW, 0, "IP");
-SYSCTL_NODE(_net_inet, IPPROTO_ICMP, icmp, CTLFLAG_RW, 0, "ICMP");
-SYSCTL_NODE(_net_inet, IPPROTO_UDP, udp, CTLFLAG_RW, 0, "UDP");
-SYSCTL_NODE(_net_inet, IPPROTO_TCP, tcp, CTLFLAG_RW, 0, "TCP");
-SYSCTL_NODE(_net_inet, IPPROTO_IGMP, igmp, CTLFLAG_RW, 0, "IGMP");
-#ifdef IPDIVERT
-SYSCTL_NODE(_net_inet, IPPROTO_DIVERT, div, CTLFLAG_RW, 0, "DIVERT");
-#endif
-
diff --git a/c/src/lib/libnetworking/netinet/in_rmx.c b/c/src/lib/libnetworking/netinet/in_rmx.c
deleted file mode 100644
index ba1793b3b4..0000000000
--- a/c/src/lib/libnetworking/netinet/in_rmx.c
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
- * Copyright 1994, 1995 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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.
- *
- * $Id$
- */
-
-/*
- * This code does two things necessary for the enhanced TCP metrics to
- * function in a useful manner:
- * 1) It marks all non-host routes as `cloning', thus ensuring that
- * every actual reference to such a route actually gets turned
- * into a reference to a host route to the specific destination
- * requested.
- * 2) When such routes lose all their references, it arranges for them
- * to be deleted in some random collection of circumstances, so that
- * a large quantity of stale routing data is not kept in kernel memory
- * indefinitely. See in_rtqtimo() below for the exact mechanism.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/queue.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/mbuf.h>
-#include <sys/syslog.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-
-#include <netinet/tcp.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-
-extern int in_inithead __P((void **head, int off));
-
-#define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */
-
-/*
- * Do what we need to do when inserting a route.
- */
-static struct radix_node *
-in_addroute(void *v_arg, void *n_arg, struct radix_node_head *head,
- struct radix_node *treenodes)
-{
- struct rtentry *rt = (struct rtentry *)treenodes;
- struct sockaddr_in *sin = (struct sockaddr_in *)rt_key(rt);
- struct radix_node *ret;
-
- /*
- * For IP, all unicast non-host routes are automatically cloning.
- */
- if(IN_MULTICAST(ntohl(sin->sin_addr.s_addr)))
- rt->rt_flags |= RTF_MULTICAST;
-
- if(!(rt->rt_flags & (RTF_HOST | RTF_CLONING | RTF_MULTICAST))) {
- rt->rt_flags |= RTF_PRCLONING;
- }
-
- /*
- * A little bit of help for both IP output and input:
- * For host routes, we make sure that RTF_BROADCAST
- * is set for anything that looks like a broadcast address.
- * This way, we can avoid an expensive call to in_broadcast()
- * in ip_output() most of the time (because the route passed
- * to ip_output() is almost always a host route).
- *
- * We also do the same for local addresses, with the thought
- * that this might one day be used to speed up ip_input().
- *
- * We also mark routes to multicast addresses as such, because
- * it's easy to do and might be useful (but this is much more
- * dubious since it's so easy to inspect the address). (This
- * is done above.)
- */
- if (rt->rt_flags & RTF_HOST) {
- if (in_broadcast(sin->sin_addr, rt->rt_ifp)) {
- rt->rt_flags |= RTF_BROADCAST;
- } else {
-#define satosin(sa) ((struct sockaddr_in *)sa)
- if (satosin(rt->rt_ifa->ifa_addr)->sin_addr.s_addr
- == sin->sin_addr.s_addr)
- rt->rt_flags |= RTF_LOCAL;
-#undef satosin
- }
- }
-
- /*
- * We also specify a send and receive pipe size for every
- * route added, to help TCP a bit. TCP doesn't actually
- * want a true pipe size, which would be prohibitive in memory
- * costs and is hard to compute anyway; it simply uses these
- * values to size its buffers. So, we fill them in with the
- * same values that TCP would have used anyway, and allow the
- * installing program or the link layer to override these values
- * as it sees fit. This will hopefully allow TCP more
- * opportunities to save its ssthresh value.
- */
- if (!rt->rt_rmx.rmx_sendpipe && !(rt->rt_rmx.rmx_locks & RTV_SPIPE))
- rt->rt_rmx.rmx_sendpipe = tcp_sendspace;
-
- if (!rt->rt_rmx.rmx_recvpipe && !(rt->rt_rmx.rmx_locks & RTV_RPIPE))
- rt->rt_rmx.rmx_recvpipe = tcp_recvspace;
-
- if (!rt->rt_rmx.rmx_mtu && !(rt->rt_rmx.rmx_locks & RTV_MTU)
- && rt->rt_ifp)
- rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu;
-
- ret = rn_addroute(v_arg, n_arg, head, treenodes);
- if (ret == NULL && rt->rt_flags & RTF_HOST) {
- struct rtentry *rt2;
- /*
- * We are trying to add a host route, but can't.
- * Find out if it is because of an
- * ARP entry and delete it if so.
- */
- rt2 = rtalloc1((struct sockaddr *)sin, 0,
- RTF_CLONING | RTF_PRCLONING);
- if (rt2) {
- if (rt2->rt_flags & RTF_LLINFO &&
- rt2->rt_flags & RTF_HOST &&
- rt2->rt_gateway &&
- rt2->rt_gateway->sa_family == AF_LINK) {
- rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt2),
- rt2->rt_gateway,
- rt_mask(rt2), rt2->rt_flags, 0);
- ret = rn_addroute(v_arg, n_arg, head,
- treenodes);
- }
- RTFREE(rt2);
- }
- }
- return ret;
-}
-
-/*
- * This code is the inverse of in_clsroute: on first reference, if we
- * were managing the route, stop doing so and set the expiration timer
- * back off again.
- */
-static struct radix_node *
-in_matroute(void *v_arg, struct radix_node_head *head)
-{
- struct radix_node *rn = rn_match(v_arg, head);
- struct rtentry *rt = (struct rtentry *)rn;
-
- if(rt && rt->rt_refcnt == 0) { /* this is first reference */
- if(rt->rt_flags & RTPRF_OURS) {
- rt->rt_flags &= ~RTPRF_OURS;
- rt->rt_rmx.rmx_expire = 0;
- }
- }
- return rn;
-}
-
-static int rtq_reallyold = 60*60;
- /* one hour is ``really old'' */
-SYSCTL_INT(_net_inet_ip, IPCTL_RTEXPIRE, rtexpire,
- CTLFLAG_RW, &rtq_reallyold , 0, "");
-
-static int rtq_minreallyold = 10;
- /* never automatically crank down to less */
-SYSCTL_INT(_net_inet_ip, IPCTL_RTMINEXPIRE, rtminexpire,
- CTLFLAG_RW, &rtq_minreallyold , 0, "");
-
-static int rtq_toomany = 128;
- /* 128 cached routes is ``too many'' */
-SYSCTL_INT(_net_inet_ip, IPCTL_RTMAXCACHE, rtmaxcache,
- CTLFLAG_RW, &rtq_toomany , 0, "");
-
-
-/*
- * On last reference drop, mark the route as belong to us so that it can be
- * timed out.
- */
-static void
-in_clsroute(struct radix_node *rn, struct radix_node_head *head)
-{
- struct rtentry *rt = (struct rtentry *)rn;
-
- if(!(rt->rt_flags & RTF_UP))
- return; /* prophylactic measures */
-
- if((rt->rt_flags & (RTF_LLINFO | RTF_HOST)) != RTF_HOST)
- return;
-
- if((rt->rt_flags & (RTF_WASCLONED | RTPRF_OURS))
- != RTF_WASCLONED)
- return;
-
- /*
- * As requested by David Greenman:
- * If rtq_reallyold is 0, just delete the route without
- * waiting for a timeout cycle to kill it.
- */
- if(rtq_reallyold != 0) {
- rt->rt_flags |= RTPRF_OURS;
- rt->rt_rmx.rmx_expire = rtems_bsdnet_seconds_since_boot() + rtq_reallyold;
- } else {
- rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt),
- rt->rt_gateway, rt_mask(rt),
- rt->rt_flags, 0);
- }
-}
-
-struct rtqk_arg {
- struct radix_node_head *rnh;
- int draining;
- int killed;
- int found;
- int updating;
- time_t nextstop;
-};
-
-/*
- * Get rid of old routes. When draining, this deletes everything, even when
- * the timeout is not expired yet. When updating, this makes sure that
- * nothing has a timeout longer than the current value of rtq_reallyold.
- */
-static int
-in_rtqkill(struct radix_node *rn, void *rock)
-{
- struct rtqk_arg *ap = rock;
- struct rtentry *rt = (struct rtentry *)rn;
- int err;
-
- if(rt->rt_flags & RTPRF_OURS) {
- ap->found++;
-
- if(ap->draining || rt->rt_rmx.rmx_expire <= rtems_bsdnet_seconds_since_boot()) {
- if(rt->rt_refcnt > 0)
- panic("rtqkill route really not free");
-
- err = rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt),
- rt->rt_gateway, rt_mask(rt),
- rt->rt_flags, 0);
- if(err) {
- log(LOG_WARNING, "in_rtqkill: error %d\n", err);
- } else {
- ap->killed++;
- }
- } else {
- if(ap->updating
- && (rt->rt_rmx.rmx_expire - rtems_bsdnet_seconds_since_boot()
- > rtq_reallyold)) {
- rt->rt_rmx.rmx_expire = rtems_bsdnet_seconds_since_boot()
- + rtq_reallyold;
- }
- ap->nextstop = lmin(ap->nextstop,
- rt->rt_rmx.rmx_expire);
- }
- }
-
- return 0;
-}
-
-#define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */
-static int rtq_timeout = RTQ_TIMEOUT;
-
-static void
-in_rtqtimo(void *rock)
-{
- struct radix_node_head *rnh = rock;
- struct rtqk_arg arg;
- struct timeval atv;
- static time_t last_adjusted_timeout = 0;
- int s;
-
- arg.found = arg.killed = 0;
- arg.rnh = rnh;
- arg.nextstop = rtems_bsdnet_seconds_since_boot() + rtq_timeout;
- arg.draining = arg.updating = 0;
- s = splnet();
- rnh->rnh_walktree(rnh, in_rtqkill, &arg);
- splx(s);
-
- /*
- * Attempt to be somewhat dynamic about this:
- * If there are ``too many'' routes sitting around taking up space,
- * then crank down the timeout, and see if we can't make some more
- * go away. However, we make sure that we will never adjust more
- * than once in rtq_timeout seconds, to keep from cranking down too
- * hard.
- */
- if((arg.found - arg.killed > rtq_toomany)
- && (rtems_bsdnet_seconds_since_boot() - last_adjusted_timeout >= rtq_timeout)
- && rtq_reallyold > rtq_minreallyold) {
- rtq_reallyold = 2*rtq_reallyold / 3;
- if(rtq_reallyold < rtq_minreallyold) {
- rtq_reallyold = rtq_minreallyold;
- }
-
- last_adjusted_timeout = rtems_bsdnet_seconds_since_boot();
-#ifdef DIAGNOSTIC
- log(LOG_DEBUG, "in_rtqtimo: adjusted rtq_reallyold to %d\n",
- rtq_reallyold);
-#endif
- arg.found = arg.killed = 0;
- arg.updating = 1;
- s = splnet();
- rnh->rnh_walktree(rnh, in_rtqkill, &arg);
- splx(s);
- }
-
- atv.tv_usec = 0;
- atv.tv_sec = arg.nextstop;
- timeout(in_rtqtimo, rock, hzto(&atv));
-}
-
-void
-in_rtqdrain(void)
-{
- struct radix_node_head *rnh = rt_tables[AF_INET];
- struct rtqk_arg arg;
- int s;
- arg.found = arg.killed = 0;
- arg.rnh = rnh;
- arg.nextstop = 0;
- arg.draining = 1;
- arg.updating = 0;
- s = splnet();
- rnh->rnh_walktree(rnh, in_rtqkill, &arg);
- splx(s);
-}
-
-/*
- * Initialize our routing tree.
- */
-int
-in_inithead(void **head, int off)
-{
- struct radix_node_head *rnh;
-
- if(!rn_inithead(head, off))
- return 0;
-
- if(head != (void **)&rt_tables[AF_INET]) /* BOGUS! */
- return 1; /* only do this for the real routing table */
-
- rnh = *head;
- rnh->rnh_addaddr = in_addroute;
- rnh->rnh_matchaddr = in_matroute;
- rnh->rnh_close = in_clsroute;
- in_rtqtimo(rnh); /* kick off timeout first time */
- return 1;
-}
-
diff --git a/c/src/lib/libnetworking/netinet/in_systm.h b/c/src/lib/libnetworking/netinet/in_systm.h
deleted file mode 100644
index d72e9b4665..0000000000
--- a/c/src/lib/libnetworking/netinet/in_systm.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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_systm.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IN_SYSTM_H_
-#define _NETINET_IN_SYSTM_H_
-
-/*
- * Miscellaneous internetwork
- * definitions for kernel.
- */
-
-/*
- * Network types.
- *
- * Internally the system keeps counters in the headers with the bytes
- * swapped so that VAX instructions will work on them. It reverses
- * the bytes before transmission at each protocol level. The n_ types
- * represent the types with the bytes in ``high-ender'' order.
- */
-typedef u_short n_short; /* short as received from the net */
-typedef u_long n_long; /* long as received from the net */
-
-typedef u_long n_time; /* ms since 00:00 GMT, byte rev */
-
-#ifdef KERNEL
-n_time iptime __P((void));
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/netinet/in_var.h b/c/src/lib/libnetworking/netinet/in_var.h
deleted file mode 100644
index e7a54d5e85..0000000000
--- a/c/src/lib/libnetworking/netinet/in_var.h
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 1985, 1986, 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_var.h 8.2 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _NETINET_IN_VAR_H_
-#define _NETINET_IN_VAR_H_
-
-#include <sys/queue.h>
-
-/*
- * Interface address, Internet version. One of these structures
- * is allocated for each interface with an Internet address.
- * The ifaddr structure contains the protocol-independent part
- * of the structure and is assumed to be first.
- */
-struct in_ifaddr {
- struct ifaddr ia_ifa; /* protocol-independent info */
-#define ia_ifp ia_ifa.ifa_ifp
-#define ia_flags ia_ifa.ifa_flags
- /* ia_{,sub}net{,mask} in host order */
- u_long ia_net; /* network number of interface */
- u_long ia_netmask; /* mask of net part */
- u_long ia_subnet; /* subnet number, including net */
- u_long ia_subnetmask; /* mask of subnet part */
- struct in_addr ia_netbroadcast; /* to recognize net broadcasts */
- struct in_ifaddr *ia_next; /* next in list of internet addresses */
- struct sockaddr_in ia_addr; /* reserve space for interface name */
- struct sockaddr_in ia_dstaddr; /* reserve space for broadcast addr */
-#define ia_broadaddr ia_dstaddr
- struct sockaddr_in ia_sockmask; /* reserve space for general netmask */
- LIST_HEAD(in_multihead, in_multi) ia_multiaddrs;
- /* list of multicast addresses */
-};
-
-struct in_aliasreq {
- char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- struct sockaddr_in ifra_addr;
- struct sockaddr_in ifra_broadaddr;
-#define ifra_dstaddr ifra_broadaddr
- struct sockaddr_in ifra_mask;
-};
-/*
- * Given a pointer to an in_ifaddr (ifaddr),
- * return a pointer to the addr as a sockaddr_in.
- */
-#define IA_SIN(ia) (&(((struct in_ifaddr *)(ia))->ia_addr))
-#define IA_DSTSIN(ia) (&(((struct in_ifaddr *)(ia))->ia_dstaddr))
-
-#define IN_LNAOF(in, ifa) \
- ((ntohl((in).s_addr) & ~((struct in_ifaddr *)(ifa)->ia_subnetmask))
-
-
-#ifdef KERNEL
-extern struct in_ifaddr *in_ifaddr;
-extern struct ifqueue ipintrq; /* ip packet input queue */
-extern struct in_addr zeroin_addr;
-extern u_char inetctlerrmap[];
-extern int rtq_reallyold; /* XXX */
-extern int rtq_minreallyold; /* XXX */
-extern int rtq_toomany; /* XXX */
-
-/*
- * Macro for finding the interface (ifnet structure) corresponding to one
- * of our IP addresses.
- */
-#define INADDR_TO_IFP(addr, ifp) \
- /* struct in_addr addr; */ \
- /* struct ifnet *ifp; */ \
-{ \
- register struct in_ifaddr *ia; \
-\
- for (ia = in_ifaddr; \
- ia != NULL && ((ia->ia_ifp->if_flags & IFF_POINTOPOINT)? \
- IA_DSTSIN(ia):IA_SIN(ia))->sin_addr.s_addr != (addr).s_addr; \
- ia = ia->ia_next) \
- continue; \
- if (ia == NULL) \
- for (ia = in_ifaddr; \
- ia != NULL; \
- ia = ia->ia_next) \
- if (ia->ia_ifp->if_flags & IFF_POINTOPOINT && \
- IA_SIN(ia)->sin_addr.s_addr == (addr).s_addr) \
- break; \
- (ifp) = (ia == NULL) ? NULL : ia->ia_ifp; \
-}
-
-/*
- * Macro for finding the internet address structure (in_ifaddr) corresponding
- * to a given interface (ifnet structure).
- */
-#define IFP_TO_IA(ifp, ia) \
- /* struct ifnet *ifp; */ \
- /* struct in_ifaddr *ia; */ \
-{ \
- for ((ia) = in_ifaddr; \
- (ia) != NULL && (ia)->ia_ifp != (ifp); \
- (ia) = (ia)->ia_next) \
- continue; \
-}
-#endif
-
-/*
- * This information should be part of the ifnet structure but we don't wish
- * to change that - as it might break a number of things
- */
-
-struct router_info {
- struct ifnet *rti_ifp;
- int rti_type; /* type of router which is querier on this interface */
- int rti_time; /* # of slow timeouts since last old query */
- struct router_info *rti_next;
-};
-
-/*
- * Internet multicast address structure. There is one of these for each IP
- * multicast group to which this host belongs on a given network interface.
- * They are kept in a linked list, rooted in the interface's in_ifaddr
- * structure.
- */
-struct in_multi {
- LIST_ENTRY(in_multi) inm_entry; /* list glue */
- struct in_addr inm_addr; /* IP multicast address */
- struct ifnet *inm_ifp; /* back pointer to ifnet */
- struct in_ifaddr *inm_ia; /* back pointer to in_ifaddr */
- u_int inm_refcount; /* no. membership claims by sockets */
- u_int inm_timer; /* IGMP membership report timer */
- u_int inm_state; /* state of the membership */
- struct router_info *inm_rti; /* router info*/
-};
-
-#ifdef KERNEL
-/*
- * Structure used by macros below to remember position when stepping through
- * all of the in_multi records.
- */
-struct in_multistep {
- struct in_ifaddr *i_ia;
- struct in_multi *i_inm;
-};
-
-/*
- * Macro for looking up the in_multi record for a given IP multicast address
- * on a given interface. If no matching record is found, "inm" returns NULL.
- */
-#define IN_LOOKUP_MULTI(addr, ifp, inm) \
- /* struct in_addr addr; */ \
- /* struct ifnet *ifp; */ \
- /* struct in_multi *inm; */ \
-{ \
- register struct in_ifaddr *ia; \
-\
- IFP_TO_IA((ifp), ia); \
- if (ia == NULL) \
- (inm) = NULL; \
- else \
- for ((inm) = ia->ia_multiaddrs.lh_first; \
- (inm) != NULL && (inm)->inm_addr.s_addr != (addr).s_addr; \
- (inm) = inm->inm_entry.le_next) \
- continue; \
-}
-
-/*
- * Macro to step through all of the in_multi records, one at a time.
- * The current position is remembered in "step", which the caller must
- * provide. IN_FIRST_MULTI(), below, must be called to initialize "step"
- * and get the first record. Both macros return a NULL "inm" when there
- * are no remaining records.
- */
-#define IN_NEXT_MULTI(step, inm) \
- /* struct in_multistep step; */ \
- /* struct in_multi *inm; */ \
-{ \
- if (((inm) = (step).i_inm) != NULL) \
- (step).i_inm = (inm)->inm_entry.le_next; \
- else \
- while ((step).i_ia != NULL) { \
- (inm) = (step).i_ia->ia_multiaddrs.lh_first; \
- (step).i_ia = (step).i_ia->ia_next; \
- if ((inm) != NULL) { \
- (step).i_inm = (inm)->inm_entry.le_next; \
- break; \
- } \
- } \
-}
-
-#define IN_FIRST_MULTI(step, inm) \
- /* struct in_multistep step; */ \
- /* struct in_multi *inm; */ \
-{ \
- (step).i_ia = in_ifaddr; \
- (step).i_inm = NULL; \
- IN_NEXT_MULTI((step), (inm)); \
-}
-
-struct in_multi *in_addmulti __P((struct in_addr *, struct ifnet *));
-void in_delmulti __P((struct in_multi *));
-int in_control __P((struct socket *, u_long, caddr_t, struct ifnet *));
-void in_rtqdrain __P((void));
-void ip_input __P((struct mbuf *));
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_IN_VAR_H_ */
diff --git a/c/src/lib/libnetworking/netinet/ip.h b/c/src/lib/libnetworking/netinet/ip.h
deleted file mode 100644
index e7f824ca6f..0000000000
--- a/c/src/lib/libnetworking/netinet/ip.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)ip.h 8.2 (Berkeley) 6/1/94
- * $Id$
- */
-
-#ifndef _NETINET_IP_H_
-#define _NETINET_IP_H_
-
-/*
- * Definitions for internet protocol version 4.
- * Per RFC 791, September 1981.
- */
-#define IPVERSION 4
-
-/*
- * Structure of an internet header, naked of options.
- *
- * We declare ip_len and ip_off to be short, rather than u_short
- * pragmatically since otherwise unsigned comparisons can result
- * against negative integers quite easily, and fail in subtle ways.
- */
-struct ip {
-#ifdef _IP_VHL
- u_char ip_vhl; /* version << 4 | header length >> 2 */
-#else
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char ip_hl:4, /* header length */
- ip_v:4; /* version */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char ip_v:4, /* version */
- ip_hl:4; /* header length */
-#endif
-#endif /* not _IP_VHL */
- u_char ip_tos; /* type of service */
- u_short ip_len; /* total length */
- u_short ip_id; /* identification */
- u_short ip_off; /* fragment offset field */
-#define IP_RF 0x8000 /* reserved fragment flag */
-#define IP_DF 0x4000 /* dont fragment flag */
-#define IP_MF 0x2000 /* more fragments flag */
-#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
- u_char ip_ttl; /* time to live */
- u_char ip_p; /* protocol */
- u_short ip_sum; /* checksum */
- struct in_addr ip_src,ip_dst; /* source and dest address */
-};
-
-#ifdef _IP_VHL
-#define IP_MAKE_VHL(v, hl) ((v) << 4 | (hl))
-#define IP_VHL_HL(vhl) ((vhl) & 0x0f)
-#define IP_VHL_V(vhl) ((vhl) >> 4)
-#define IP_VHL_BORING 0x45
-#endif
-
-#define IP_MAXPACKET 65535 /* maximum packet size */
-
-/*
- * Definitions for IP type of service (ip_tos)
- */
-#define IPTOS_LOWDELAY 0x10
-#define IPTOS_THROUGHPUT 0x08
-#define IPTOS_RELIABILITY 0x04
-#define IPTOS_MINCOST 0x02
-
-/*
- * Definitions for IP precedence (also in ip_tos) (hopefully unused)
- */
-#define IPTOS_PREC_NETCONTROL 0xe0
-#define IPTOS_PREC_INTERNETCONTROL 0xc0
-#define IPTOS_PREC_CRITIC_ECP 0xa0
-#define IPTOS_PREC_FLASHOVERRIDE 0x80
-#define IPTOS_PREC_FLASH 0x60
-#define IPTOS_PREC_IMMEDIATE 0x40
-#define IPTOS_PREC_PRIORITY 0x20
-#define IPTOS_PREC_ROUTINE 0x00
-
-/*
- * Definitions for options.
- */
-#define IPOPT_COPIED(o) ((o)&0x80)
-#define IPOPT_CLASS(o) ((o)&0x60)
-#define IPOPT_NUMBER(o) ((o)&0x1f)
-
-#define IPOPT_CONTROL 0x00
-#define IPOPT_RESERVED1 0x20
-#define IPOPT_DEBMEAS 0x40
-#define IPOPT_RESERVED2 0x60
-
-#define IPOPT_EOL 0 /* end of option list */
-#define IPOPT_NOP 1 /* no operation */
-
-#define IPOPT_RR 7 /* record packet route */
-#define IPOPT_TS 68 /* timestamp */
-#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
-#define IPOPT_LSRR 131 /* loose source route */
-#define IPOPT_SATID 136 /* satnet id */
-#define IPOPT_SSRR 137 /* strict source route */
-#define IPOPT_RA 148 /* router alert */
-
-/*
- * Offsets to fields in options other than EOL and NOP.
- */
-#define IPOPT_OPTVAL 0 /* option ID */
-#define IPOPT_OLEN 1 /* option length */
-#define IPOPT_OFFSET 2 /* offset within option */
-#define IPOPT_MINOFF 4 /* min value of above */
-
-/*
- * Time stamp option structure.
- */
-struct ip_timestamp {
- u_char ipt_code; /* IPOPT_TS */
- u_char ipt_len; /* size of structure (variable) */
- u_char ipt_ptr; /* index of current entry */
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char ipt_flg:4, /* flags, see below */
- ipt_oflw:4; /* overflow counter */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char ipt_oflw:4, /* overflow counter */
- ipt_flg:4; /* flags, see below */
-#endif
- union ipt_timestamp {
- n_long ipt_time[1];
- struct ipt_ta {
- struct in_addr ipt_addr;
- n_long ipt_time;
- } ipt_ta[1];
- } ipt_timestamp;
-};
-
-#include <machine/in_cksum.h>
-
-/* flag bits for ipt_flg */
-#define IPOPT_TS_TSONLY 0 /* timestamps only */
-#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
-#define IPOPT_TS_PRESPEC 3 /* specified modules only */
-
-/* bits for security (not byte swapped) */
-#define IPOPT_SECUR_UNCLASS 0x0000
-#define IPOPT_SECUR_CONFID 0xf135
-#define IPOPT_SECUR_EFTO 0x789a
-#define IPOPT_SECUR_MMMM 0xbc4d
-#define IPOPT_SECUR_RESTR 0xaf13
-#define IPOPT_SECUR_SECRET 0xd788
-#define IPOPT_SECUR_TOPSECRET 0x6bc5
-
-/*
- * Internet implementation parameters.
- */
-#define MAXTTL 255 /* maximum time to live (seconds) */
-#define IPDEFTTL 64 /* default ttl, from RFC 1340 */
-#define IPFRAGTTL 60 /* time to live for frags, slowhz */
-#define IPTTLDEC 1 /* subtracted when forwarding */
-
-#define IP_MSS 576 /* default maximum segment size */
-
-#endif
diff --git a/c/src/lib/libnetworking/netinet/ip_divert.c b/c/src/lib/libnetworking/netinet/ip_divert.c
deleted file mode 100644
index 2955e811ad..0000000000
--- a/c/src/lib/libnetworking/netinet/ip_divert.c
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/systm.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-
-/*
- * Divert sockets
- */
-
-/*
- * Allocate enough space to hold a full IP packet
- */
-#define DIVSNDQ (65536 + 100)
-#define DIVRCVQ (65536 + 100)
-
-/* Global variables */
-
-/*
- * ip_input() and ip_output() set this secret value before calling us to
- * let us know which divert port to divert a packet to; this is done so
- * we can use the existing prototype for struct protosw's pr_input().
- * This is stored in host order.
- */
-u_short ip_divert_port;
-
-/*
- * We set this value to a non-zero port number when we want the call to
- * ip_fw_chk() in ip_input() or ip_output() to ignore ``divert <port>''
- * chain entries. This is stored in host order.
- */
-u_short ip_divert_ignore;
-
-/* Internal variables */
-
-static struct inpcbhead divcb;
-static struct inpcbinfo divcbinfo;
-
-static u_long div_sendspace = DIVSNDQ; /* XXX sysctl ? */
-static u_long div_recvspace = DIVRCVQ; /* XXX sysctl ? */
-
-/* Optimization: have this preinitialized */
-static struct sockaddr_in divsrc = { sizeof(divsrc), AF_INET };
-
-/* Internal functions */
-
-static int div_output(struct socket *so,
- struct mbuf *m, struct mbuf *addr, struct mbuf *control);
-
-/*
- * Initialize divert connection block queue.
- */
-void
-div_init(void)
-{
- LIST_INIT(&divcb);
- divcbinfo.listhead = &divcb;
- /*
- * XXX We don't use the hash list for divert IP, but it's easier
- * to allocate a one entry hash list than it is to check all
- * over the place for hashbase == NULL.
- */
- divcbinfo.hashbase = hashinit(1, M_PCB, &divcbinfo.hashmask);
-}
-
-/*
- * Setup generic address and protocol structures
- * for div_input routine, then pass them along with
- * mbuf chain. ip->ip_len is assumed to have had
- * the header length (hlen) subtracted out already.
- * We tell whether the packet was incoming or outgoing
- * by seeing if hlen == 0, which is a hack.
- */
-void
-div_input(struct mbuf *m, int hlen)
-{
- struct ip *ip;
- struct inpcb *inp;
- struct socket *sa;
-
- /* Sanity check */
- if (ip_divert_port == 0)
- panic("div_input: port is 0");
-
- /* Assure header */
- if (m->m_len < sizeof(struct ip) &&
- (m = m_pullup(m, sizeof(struct ip))) == 0) {
- return;
- }
- ip = mtod(m, struct ip *);
-
- /* Record divert port */
- divsrc.sin_port = htons(ip_divert_port);
-
- /* Restore packet header fields */
- ip->ip_len += hlen;
- HTONS(ip->ip_len);
- HTONS(ip->ip_off);
-
- /* Record receive interface address, if any */
- divsrc.sin_addr.s_addr = 0;
- if (hlen) {
- struct ifaddr *ifa;
-
-#ifdef DIAGNOSTIC
- /* Sanity check */
- if (!(m->m_flags & M_PKTHDR))
- panic("div_input: no pkt hdr");
-#endif
-
- /* More fields affected by ip_input() */
- HTONS(ip->ip_id);
-
- /* Find IP address for recieve interface */
- for (ifa = m->m_pkthdr.rcvif->if_addrlist;
- ifa != NULL; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr == NULL)
- continue;
- if (ifa->ifa_addr->sa_family != AF_INET)
- continue;
- divsrc.sin_addr =
- ((struct sockaddr_in *) ifa->ifa_addr)->sin_addr;
- break;
- }
- }
-
- /* Put packet on socket queue, if any */
- sa = NULL;
- for (inp = divcb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_lport == htons(ip_divert_port))
- sa = inp->inp_socket;
- }
- if (sa) {
- if (sbappendaddr(&sa->so_rcv, (struct sockaddr *)&divsrc,
- m, (struct mbuf *)0) == 0)
- m_freem(m);
- else
- sorwakeup(sa);
- } else {
- m_freem(m);
- ipstat.ips_noproto++;
- ipstat.ips_delivered--;
- }
-}
-
-/*
- * Deliver packet back into the IP processing machinery.
- *
- * If no address specified, or address is 0.0.0.0, send to ip_output();
- * otherwise, send to ip_input() and mark as having been received on
- * the interface with that address.
- *
- * If no address specified, or dest port is 0, allow packet to divert
- * back to this socket; otherwise, don't.
- */
-static int
-div_output(so, m, addr, control)
- struct socket *so;
- register struct mbuf *m;
- struct mbuf *addr, *control;
-{
- register struct inpcb *const inp = sotoinpcb(so);
- register struct ip *const ip = mtod(m, struct ip *);
- struct sockaddr_in *sin = NULL;
- int error = 0;
-
- if (control)
- m_freem(control); /* XXX */
- if (addr)
- sin = mtod(addr, struct sockaddr_in *);
-
- /* Loopback avoidance option */
- ip_divert_ignore = ntohs(inp->inp_lport);
-
- /* Reinject packet into the system as incoming or outgoing */
- if (!sin || sin->sin_addr.s_addr == 0) {
- /* Don't allow both user specified and setsockopt options,
- and don't allow packet length sizes that will crash */
- if (((ip->ip_hl != (sizeof (*ip) >> 2)) && inp->inp_options) ||
- ((u_short)ntohs(ip->ip_len) > m->m_pkthdr.len)) {
- error = EINVAL;
- goto cantsend;
- }
-
- /* Convert fields to host order for ip_output() */
- NTOHS(ip->ip_len);
- NTOHS(ip->ip_off);
-
- /* Send packet to output processing */
- ipstat.ips_rawout++; /* XXX */
- error = ip_output(m, inp->inp_options, &inp->inp_route,
- (so->so_options & SO_DONTROUTE) |
- IP_ALLOWBROADCAST | IP_RAWOUTPUT, inp->inp_moptions);
- } else {
- struct ifaddr *ifa;
-
- /* Find receive interface with the given IP address */
- sin->sin_port = 0;
- if ((ifa = ifa_ifwithaddr((struct sockaddr *) sin)) == 0) {
- error = EADDRNOTAVAIL;
- goto cantsend;
- }
- m->m_pkthdr.rcvif = ifa->ifa_ifp;
-
- /* Send packet to input processing */
- ip_input(m);
- }
-
- /* Reset for next time (and other packets) */
- ip_divert_ignore = 0;
- return error;
-
-cantsend:
- ip_divert_ignore = 0;
- m_freem(m);
- return error;
-}
-
-/*ARGSUSED*/
-int
-div_usrreq(so, req, m, nam, control)
- register struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register int error = 0;
- register struct inpcb *inp = sotoinpcb(so);
- int s;
-
- if (inp == NULL && req != PRU_ATTACH) {
- error = EINVAL;
- goto release;
- }
- switch (req) {
-
- case PRU_ATTACH:
- if (inp)
- panic("div_attach");
- if ((so->so_state & SS_PRIV) == 0) {
- error = EACCES;
- break;
- }
- s = splnet();
- error = in_pcballoc(so, &divcbinfo);
- splx(s);
- if (error)
- break;
- error = soreserve(so, div_sendspace, div_recvspace);
- if (error)
- break;
- inp = (struct inpcb *)so->so_pcb;
- inp->inp_ip_p = (int)nam; /* XXX */
- inp->inp_flags |= INP_HDRINCL;
- /* The socket is always "connected" because
- we always know "where" to send the packet */
- so->so_state |= SS_ISCONNECTED;
- break;
-
- case PRU_DISCONNECT:
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- error = ENOTCONN;
- break;
- }
- /* FALLTHROUGH */
- case PRU_ABORT:
- soisdisconnected(so);
- /* FALLTHROUGH */
- case PRU_DETACH:
- if (inp == 0)
- panic("div_detach");
- in_pcbdetach(inp);
- break;
-
- case PRU_BIND:
- s = splnet();
- error = in_pcbbind(inp, nam);
- splx(s);
- break;
-
- /*
- * Mark the connection as being incapable of further input.
- */
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- case PRU_SEND:
- /* Packet must have a header (but that's about it) */
- if (m->m_len < sizeof (struct ip) ||
- (m = m_pullup(m, sizeof (struct ip))) == 0) {
- ipstat.ips_toosmall++;
- error = EINVAL;
- break;
- }
-
- /* Send packet */
- error = div_output(so, m, nam, control);
- m = NULL;
- break;
-
- case PRU_SOCKADDR:
- in_setsockaddr(inp, nam);
- break;
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- /*
- * Not supported.
- */
- case PRU_CONNECT:
- case PRU_CONNECT2:
- case PRU_CONTROL:
- case PRU_RCVOOB:
- case PRU_RCVD:
- case PRU_LISTEN:
- case PRU_ACCEPT:
- case PRU_SENDOOB:
- case PRU_PEERADDR:
- error = EOPNOTSUPP;
- break;
-
- default:
- panic("div_usrreq");
- }
-release:
- if (m)
- m_freem(m);
- return (error);
-}
diff --git a/c/src/lib/libnetworking/netinet/ip_fw.c b/c/src/lib/libnetworking/netinet/ip_fw.c
deleted file mode 100644
index aeb09b0bbe..0000000000
--- a/c/src/lib/libnetworking/netinet/ip_fw.c
+++ /dev/null
@@ -1,1069 +0,0 @@
-/*
- * Copyright (c) 1996 Alex Nash
- * Copyright (c) 1993 Daniel Boulet
- * Copyright (c) 1994 Ugen J.S.Antsilevich
- *
- * Redistribution and use in source forms, with and without modification,
- * are permitted provided that this entire comment appears intact.
- *
- * Redistribution in binary form may occur without any restrictions.
- * Obviously, it would be nice if you gave credit where credit is due
- * but requiring it would be too onerous.
- *
- * This software is provided ``AS IS'' without any warranties of any kind.
- *
- * $Id$
- */
-
-/*
- * Implement IP packet firewall
- */
-
-#ifndef IPFIREWALL_MODULE
-#include "opt_ipfw.h"
-#endif
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/queue.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/sysctl.h>
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_fw.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#include <netinet/udp.h>
-
-static int fw_debug = 1;
-#ifdef IPFIREWALL_VERBOSE
-static int fw_verbose = 1;
-#else
-static int fw_verbose = 0;
-#endif
-#ifdef IPFIREWALL_VERBOSE_LIMIT
-static int fw_verbose_limit = IPFIREWALL_VERBOSE_LIMIT;
-#else
-static int fw_verbose_limit = 0;
-#endif
-
-LIST_HEAD (ip_fw_head, ip_fw_chain) ip_fw_chain;
-
-#ifdef SYSCTL_NODE
-SYSCTL_NODE(_net_inet_ip, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, debug, CTLFLAG_RW, &fw_debug, 0, "");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose, CTLFLAG_RW, &fw_verbose, 0, "");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose_limit, CTLFLAG_RW, &fw_verbose_limit, 0, "");
-#endif
-
-#define dprintf(a) if (!fw_debug); else printf a
-
-#define print_ip(a) printf("%ld.%ld.%ld.%ld",(ntohl(a.s_addr)>>24)&0xFF,\
- (ntohl(a.s_addr)>>16)&0xFF,\
- (ntohl(a.s_addr)>>8)&0xFF,\
- (ntohl(a.s_addr))&0xFF);
-
-#define dprint_ip(a) if (!fw_debug); else print_ip(a)
-
-static int add_entry __P((struct ip_fw_head *chainptr, struct ip_fw *frwl));
-static int del_entry __P((struct ip_fw_head *chainptr, u_short number));
-static int zero_entry __P((struct mbuf *m));
-static struct ip_fw *check_ipfw_struct __P((struct ip_fw *m));
-static struct ip_fw *check_ipfw_mbuf __P((struct mbuf *fw));
-static int ipopts_match __P((struct ip *ip, struct ip_fw *f));
-static int port_match __P((u_short *portptr, int nports, u_short port,
- int range_flag));
-static int tcpflg_match __P((struct tcphdr *tcp, struct ip_fw *f));
-static int icmptype_match __P((struct icmp * icmp, struct ip_fw * f));
-static void ipfw_report __P((struct ip_fw *f, struct ip *ip,
- struct ifnet *rif, struct ifnet *oif));
-
-#ifdef IPFIREWALL_MODULE
-static ip_fw_chk_t *old_chk_ptr;
-static ip_fw_ctl_t *old_ctl_ptr;
-#endif
-
-static int ip_fw_chk __P((struct ip **pip, int hlen,
- struct ifnet *oif, int ignport, struct mbuf **m));
-static int ip_fw_ctl __P((int stage, struct mbuf **mm));
-
-static char err_prefix[] = "ip_fw_ctl:";
-
-/*
- * Returns 1 if the port is matched by the vector, 0 otherwise
- */
-static inline int
-port_match(u_short *portptr, int nports, u_short port, int range_flag)
-{
- if (!nports)
- return 1;
- if (range_flag) {
- if (portptr[0] <= port && port <= portptr[1]) {
- return 1;
- }
- nports -= 2;
- portptr += 2;
- }
- while (nports-- > 0) {
- if (*portptr++ == port) {
- return 1;
- }
- }
- return 0;
-}
-
-static int
-tcpflg_match(struct tcphdr *tcp, struct ip_fw *f)
-{
- u_char flg_set, flg_clr;
-
- if ((f->fw_tcpf & IP_FW_TCPF_ESTAB) &&
- (tcp->th_flags & (IP_FW_TCPF_RST | IP_FW_TCPF_ACK)))
- return 1;
-
- flg_set = tcp->th_flags & f->fw_tcpf;
- flg_clr = tcp->th_flags & f->fw_tcpnf;
-
- if (flg_set != f->fw_tcpf)
- return 0;
- if (flg_clr)
- return 0;
-
- return 1;
-}
-
-static int
-icmptype_match(struct icmp *icmp, struct ip_fw *f)
-{
- int type;
-
- if (!(f->fw_flg & IP_FW_F_ICMPBIT))
- return(1);
-
- type = icmp->icmp_type;
-
- /* check for matching type in the bitmap */
- if (type < IP_FW_ICMPTYPES_DIM * sizeof(unsigned) * 8 &&
- (f->fw_icmptypes[type / (sizeof(unsigned) * 8)] &
- (1U << (type % (8 * sizeof(unsigned))))))
- return(1);
-
- return(0); /* no match */
-}
-
-static int
-ipopts_match(struct ip *ip, struct ip_fw *f)
-{
- register u_char *cp;
- int opt, optlen, cnt;
- u_char opts, nopts, nopts_sve;
-
- cp = (u_char *)(ip + 1);
- cnt = (ip->ip_hl << 2) - sizeof (struct ip);
- opts = f->fw_ipopt;
- nopts = nopts_sve = f->fw_ipnopt;
-
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[IPOPT_OLEN];
- if (optlen <= 0 || optlen > cnt) {
- return 0; /*XXX*/
- }
- }
- switch (opt) {
-
- default:
- break;
-
- case IPOPT_LSRR:
- opts &= ~IP_FW_IPOPT_LSRR;
- nopts &= ~IP_FW_IPOPT_LSRR;
- break;
-
- case IPOPT_SSRR:
- opts &= ~IP_FW_IPOPT_SSRR;
- nopts &= ~IP_FW_IPOPT_SSRR;
- break;
-
- case IPOPT_RR:
- opts &= ~IP_FW_IPOPT_RR;
- nopts &= ~IP_FW_IPOPT_RR;
- break;
- case IPOPT_TS:
- opts &= ~IP_FW_IPOPT_TS;
- nopts &= ~IP_FW_IPOPT_TS;
- break;
- }
- if (opts == nopts)
- break;
- }
- if (opts == 0 && nopts == nopts_sve)
- return 1;
- else
- return 0;
-}
-
-static inline int
-iface_match(struct ifnet *ifp, union ip_fw_if *ifu, int byname)
-{
- /* Check by name or by IP address */
- if (byname) {
- /* Check unit number (-1 is wildcard) */
- if (ifu->fu_via_if.unit != -1
- && ifp->if_unit != ifu->fu_via_if.unit)
- return(0);
- /* Check name */
- if (strncmp(ifp->if_name, ifu->fu_via_if.name, FW_IFNLEN))
- return(0);
- return(1);
- } else if (ifu->fu_via_ip.s_addr != 0) { /* Zero == wildcard */
- struct ifaddr *ia;
-
- for (ia = ifp->if_addrlist; ia; ia = ia->ifa_next) {
- if (ia->ifa_addr == NULL)
- continue;
- if (ia->ifa_addr->sa_family != AF_INET)
- continue;
- if (ifu->fu_via_ip.s_addr != ((struct sockaddr_in *)
- (ia->ifa_addr))->sin_addr.s_addr)
- continue;
- return(1);
- }
- return(0);
- }
- return(1);
-}
-
-static void
-ipfw_report(struct ip_fw *f, struct ip *ip,
- struct ifnet *rif, struct ifnet *oif)
-{
- static int counter;
- struct tcphdr *const tcp = (struct tcphdr *) ((u_long *) ip+ ip->ip_hl);
- struct udphdr *const udp = (struct udphdr *) ((u_long *) ip+ ip->ip_hl);
- struct icmp *const icmp = (struct icmp *) ((u_long *) ip + ip->ip_hl);
- int count;
-
- count = f ? f->fw_pcnt : ++counter;
- if (fw_verbose_limit != 0 && count > fw_verbose_limit)
- return;
-
- /* Print command name */
- printf("ipfw: %d ", f ? f->fw_number : -1);
- if (!f)
- printf("Refuse");
- else
- switch (f->fw_flg & IP_FW_F_COMMAND) {
- case IP_FW_F_DENY:
- printf("Deny");
- break;
- case IP_FW_F_REJECT:
- if (f->fw_reject_code == IP_FW_REJECT_RST)
- printf("Reset");
- else
- printf("Unreach");
- break;
- case IP_FW_F_ACCEPT:
- printf("Accept");
- break;
- case IP_FW_F_COUNT:
- printf("Count");
- break;
- case IP_FW_F_DIVERT:
- printf("Divert %d", f->fw_divert_port);
- break;
- case IP_FW_F_TEE:
- printf("Tee %d", f->fw_divert_port);
- break;
- case IP_FW_F_SKIPTO:
- printf("SkipTo %d", f->fw_skipto_rule);
- break;
- default:
- printf("UNKNOWN");
- break;
- }
- printf(" ");
-
- switch (ip->ip_p) {
- case IPPROTO_TCP:
- printf("TCP ");
- print_ip(ip->ip_src);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d ", ntohs(tcp->th_sport));
- else
- printf(" ");
- print_ip(ip->ip_dst);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d", ntohs(tcp->th_dport));
- break;
- case IPPROTO_UDP:
- printf("UDP ");
- print_ip(ip->ip_src);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d ", ntohs(udp->uh_sport));
- else
- printf(" ");
- print_ip(ip->ip_dst);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d", ntohs(udp->uh_dport));
- break;
- case IPPROTO_ICMP:
- printf("ICMP:%u.%u ", icmp->icmp_type, icmp->icmp_code);
- print_ip(ip->ip_src);
- printf(" ");
- print_ip(ip->ip_dst);
- break;
- default:
- printf("P:%d ", ip->ip_p);
- print_ip(ip->ip_src);
- printf(" ");
- print_ip(ip->ip_dst);
- break;
- }
- if (oif)
- printf(" out via %s%d", oif->if_name, oif->if_unit);
- else if (rif)
- printf(" in via %s%d", rif->if_name, rif->if_unit);
- if ((ip->ip_off & IP_OFFMASK))
- printf(" Fragment = %d",ip->ip_off & IP_OFFMASK);
- printf("\n");
- if (fw_verbose_limit != 0 && count == fw_verbose_limit)
- printf("ipfw: limit reached on rule #%d\n",
- f ? f->fw_number : -1);
-}
-
-/*
- * Parameters:
- *
- * ip Pointer to packet header (struct ip *)
- * hlen Packet header length
- * oif Outgoing interface, or NULL if packet is incoming
- * ignport Ignore all divert/tee rules to this port (if non-zero)
- * *m The packet; we set to NULL when/if we nuke it.
- *
- * Return value:
- *
- * 0 The packet is to be accepted and routed normally OR
- * the packet was denied/rejected and has been dropped;
- * in the latter case, *m is equal to NULL upon return.
- * port Divert the packet to port.
- */
-
-static int
-ip_fw_chk(struct ip **pip, int hlen,
- struct ifnet *oif, int ignport, struct mbuf **m)
-{
- struct ip_fw_chain *chain;
- struct ip_fw *rule = NULL;
- struct ip *ip = *pip;
- struct ifnet *const rif = (*m)->m_pkthdr.rcvif;
- u_short offset = (ip->ip_off & IP_OFFMASK);
- u_short src_port, dst_port;
-
- /*
- * Go down the chain, looking for enlightment
- */
- for (chain=ip_fw_chain.lh_first; chain; chain = chain->chain.le_next) {
- register struct ip_fw *const f = chain->rule;
-
- /* Check direction inbound */
- if (!oif && !(f->fw_flg & IP_FW_F_IN))
- continue;
-
- /* Check direction outbound */
- if (oif && !(f->fw_flg & IP_FW_F_OUT))
- continue;
-
- /* Fragments */
- if ((f->fw_flg & IP_FW_F_FRAG) && !(ip->ip_off & IP_OFFMASK))
- continue;
-
- /* If src-addr doesn't match, not this rule. */
- if (((f->fw_flg & IP_FW_F_INVSRC) != 0) ^ ((ip->ip_src.s_addr
- & f->fw_smsk.s_addr) != f->fw_src.s_addr))
- continue;
-
- /* If dest-addr doesn't match, not this rule. */
- if (((f->fw_flg & IP_FW_F_INVDST) != 0) ^ ((ip->ip_dst.s_addr
- & f->fw_dmsk.s_addr) != f->fw_dst.s_addr))
- continue;
-
- /* Interface check */
- if ((f->fw_flg & IF_FW_F_VIAHACK) == IF_FW_F_VIAHACK) {
- struct ifnet *const iface = oif ? oif : rif;
-
- /* Backwards compatibility hack for "via" */
- if (!iface || !iface_match(iface,
- &f->fw_in_if, f->fw_flg & IP_FW_F_OIFNAME))
- continue;
- } else {
- /* Check receive interface */
- if ((f->fw_flg & IP_FW_F_IIFACE)
- && (!rif || !iface_match(rif,
- &f->fw_in_if, f->fw_flg & IP_FW_F_IIFNAME)))
- continue;
- /* Check outgoing interface */
- if ((f->fw_flg & IP_FW_F_OIFACE)
- && (!oif || !iface_match(oif,
- &f->fw_out_if, f->fw_flg & IP_FW_F_OIFNAME)))
- continue;
- }
-
- /* Check IP options */
- if (f->fw_ipopt != f->fw_ipnopt && !ipopts_match(ip, f))
- continue;
-
- /* Check protocol; if wildcard, match */
- if (f->fw_prot == IPPROTO_IP)
- goto got_match;
-
- /* If different, don't match */
- if (ip->ip_p != f->fw_prot)
- continue;
-
-#define PULLUP_TO(len) do { \
- if ((*m)->m_len < (len) \
- && (*m = m_pullup(*m, (len))) == 0) { \
- goto bogusfrag; \
- } \
- *pip = ip = mtod(*m, struct ip *); \
- offset = (ip->ip_off & IP_OFFMASK); \
- } while (0)
-
- /* Protocol specific checks */
- switch (ip->ip_p) {
- case IPPROTO_TCP:
- {
- struct tcphdr *tcp;
-
- if (offset == 1) /* cf. RFC 1858 */
- goto bogusfrag;
- if (offset != 0) {
- /*
- * TCP flags and ports aren't available in this
- * packet -- if this rule specified either one,
- * we consider the rule a non-match.
- */
- if (f->fw_nports != 0 ||
- f->fw_tcpf != f->fw_tcpnf)
- continue;
-
- break;
- }
- PULLUP_TO(hlen + 14);
- tcp = (struct tcphdr *) ((u_long *)ip + ip->ip_hl);
- if (f->fw_tcpf != f->fw_tcpnf && !tcpflg_match(tcp, f))
- continue;
- src_port = ntohs(tcp->th_sport);
- dst_port = ntohs(tcp->th_dport);
- goto check_ports;
- }
-
- case IPPROTO_UDP:
- {
- struct udphdr *udp;
-
- if (offset != 0) {
- /*
- * Port specification is unavailable -- if this
- * rule specifies a port, we consider the rule
- * a non-match.
- */
- if (f->fw_nports != 0)
- continue;
-
- break;
- }
- PULLUP_TO(hlen + 4);
- udp = (struct udphdr *) ((u_long *)ip + ip->ip_hl);
- src_port = ntohs(udp->uh_sport);
- dst_port = ntohs(udp->uh_dport);
-check_ports:
- if (!port_match(&f->fw_pts[0],
- IP_FW_GETNSRCP(f), src_port,
- f->fw_flg & IP_FW_F_SRNG))
- continue;
- if (!port_match(&f->fw_pts[IP_FW_GETNSRCP(f)],
- IP_FW_GETNDSTP(f), dst_port,
- f->fw_flg & IP_FW_F_DRNG))
- continue;
- break;
- }
-
- case IPPROTO_ICMP:
- {
- struct icmp *icmp;
-
- if (offset != 0) /* Type isn't valid */
- break;
- PULLUP_TO(hlen + 2);
- icmp = (struct icmp *) ((u_long *)ip + ip->ip_hl);
- if (!icmptype_match(icmp, f))
- continue;
- break;
- }
-#undef PULLUP_TO
-
-bogusfrag:
- if (fw_verbose)
- ipfw_report(NULL, ip, rif, oif);
- goto dropit;
- }
-
-got_match:
- /* Ignore divert/tee rule if socket port is "ignport" */
- switch (f->fw_flg & IP_FW_F_COMMAND) {
- case IP_FW_F_DIVERT:
- case IP_FW_F_TEE:
- if (f->fw_divert_port == ignport)
- continue; /* ignore this rule */
- break;
- }
-
- /* Update statistics */
- f->fw_pcnt += 1;
- f->fw_bcnt += ip->ip_len;
- f->timestamp = rtems_bsdnet_seconds_since_boot();
-
- /* Log to console if desired */
- if ((f->fw_flg & IP_FW_F_PRN) && fw_verbose)
- ipfw_report(f, ip, rif, oif);
-
- /* Take appropriate action */
- switch (f->fw_flg & IP_FW_F_COMMAND) {
- case IP_FW_F_ACCEPT:
- return(0);
- case IP_FW_F_COUNT:
- continue;
- case IP_FW_F_DIVERT:
- return(f->fw_divert_port);
- case IP_FW_F_TEE:
- /*
- * XXX someday tee packet here, but beware that you
- * can't use m_copym() or m_copypacket() because
- * the divert input routine modifies the mbuf
- * (and these routines only increment reference
- * counts in the case of mbuf clusters), so need
- * to write custom routine.
- */
- continue;
- case IP_FW_F_SKIPTO:
-#ifdef DIAGNOSTIC
- while (chain->chain.le_next
- && chain->chain.le_next->rule->fw_number
- < f->fw_skipto_rule)
-#else
- while (chain->chain.le_next->rule->fw_number
- < f->fw_skipto_rule)
-#endif
- chain = chain->chain.le_next;
- continue;
- }
-
- /* Deny/reject this packet using this rule */
- rule = f;
- break;
- }
-
-#ifdef DIAGNOSTIC
- /* Rule 65535 should always be there and should always match */
- if (!chain)
- panic("ip_fw: chain");
-#endif
-
- /*
- * At this point, we're going to drop the packet.
- * Send a reject notice if all of the following are true:
- *
- * - The packet matched a reject rule
- * - The packet is not an ICMP packet
- * - The packet is not a multicast or broadcast packet
- */
- if ((rule->fw_flg & IP_FW_F_COMMAND) == IP_FW_F_REJECT
- && ip->ip_p != IPPROTO_ICMP
- && !((*m)->m_flags & (M_BCAST|M_MCAST))
- && !IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- switch (rule->fw_reject_code) {
- case IP_FW_REJECT_RST:
- {
- struct tcphdr *const tcp =
- (struct tcphdr *) ((u_long *)ip + ip->ip_hl);
- struct tcpiphdr ti, *const tip = (struct tcpiphdr *) ip;
-
- if (offset != 0 || (tcp->th_flags & TH_RST))
- break;
- ti.ti_i = *((struct ipovly *) ip);
- ti.ti_t = *tcp;
- bcopy(&ti, ip, sizeof(ti));
- NTOHL(tip->ti_seq);
- NTOHL(tip->ti_ack);
- tip->ti_len = ip->ip_len - hlen - (tip->ti_off << 2);
- if (tcp->th_flags & TH_ACK) {
- tcp_respond(NULL, tip, *m,
- (tcp_seq)0, ntohl(tcp->th_ack), TH_RST);
- } else {
- if (tcp->th_flags & TH_SYN)
- tip->ti_len++;
- tcp_respond(NULL, tip, *m, tip->ti_seq
- + tip->ti_len, (tcp_seq)0, TH_RST|TH_ACK);
- }
- *m = NULL;
- break;
- }
- default: /* Send an ICMP unreachable using code */
- icmp_error(*m, ICMP_UNREACH,
- rule->fw_reject_code, 0L, 0);
- *m = NULL;
- break;
- }
- }
-
-dropit:
- /*
- * Finally, drop the packet.
- */
- if (*m) {
- m_freem(*m);
- *m = NULL;
- }
- return(0);
-}
-
-static int
-add_entry(struct ip_fw_head *chainptr, struct ip_fw *frwl)
-{
- struct ip_fw *ftmp = 0;
- struct ip_fw_chain *fwc = 0, *fcp, *fcpl = 0;
- u_short nbr = 0;
- int s;
-
- fwc = malloc(sizeof *fwc, M_IPFW, M_DONTWAIT);
- ftmp = malloc(sizeof *ftmp, M_IPFW, M_DONTWAIT);
- if (!fwc || !ftmp) {
- dprintf(("%s malloc said no\n", err_prefix));
- if (fwc) free(fwc, M_IPFW);
- if (ftmp) free(ftmp, M_IPFW);
- return (ENOSPC);
- }
-
- bcopy(frwl, ftmp, sizeof(struct ip_fw));
- ftmp->fw_in_if.fu_via_if.name[FW_IFNLEN - 1] = '\0';
- ftmp->fw_pcnt = 0L;
- ftmp->fw_bcnt = 0L;
- fwc->rule = ftmp;
-
- s = splnet();
-
- if (!chainptr->lh_first) {
- LIST_INSERT_HEAD(chainptr, fwc, chain);
- splx(s);
- return(0);
- } else if (ftmp->fw_number == (u_short)-1) {
- if (fwc) free(fwc, M_IPFW);
- if (ftmp) free(ftmp, M_IPFW);
- splx(s);
- dprintf(("%s bad rule number\n", err_prefix));
- return (EINVAL);
- }
-
- /* If entry number is 0, find highest numbered rule and add 100 */
- if (ftmp->fw_number == 0) {
- for (fcp = chainptr->lh_first; fcp; fcp = fcp->chain.le_next) {
- if (fcp->rule->fw_number != (u_short)-1)
- nbr = fcp->rule->fw_number;
- else
- break;
- }
- if (nbr < (u_short)-1 - 100)
- nbr += 100;
- ftmp->fw_number = nbr;
- }
-
- /* Got a valid number; now insert it, keeping the list ordered */
- for (fcp = chainptr->lh_first; fcp; fcp = fcp->chain.le_next) {
- if (fcp->rule->fw_number > ftmp->fw_number) {
- if (fcpl) {
- LIST_INSERT_AFTER(fcpl, fwc, chain);
- } else {
- LIST_INSERT_HEAD(chainptr, fwc, chain);
- }
- break;
- } else {
- fcpl = fcp;
- }
- }
-
- splx(s);
- return (0);
-}
-
-static int
-del_entry(struct ip_fw_head *chainptr, u_short number)
-{
- struct ip_fw_chain *fcp;
- int s;
-
- s = splnet();
-
- fcp = chainptr->lh_first;
- if (number != (u_short)-1) {
- for (; fcp; fcp = fcp->chain.le_next) {
- if (fcp->rule->fw_number == number) {
- LIST_REMOVE(fcp, chain);
- splx(s);
- free(fcp->rule, M_IPFW);
- free(fcp, M_IPFW);
- return 0;
- }
- }
- }
-
- splx(s);
- return (EINVAL);
-}
-
-static int
-zero_entry(struct mbuf *m)
-{
- struct ip_fw *frwl;
- struct ip_fw_chain *fcp;
- int s;
-
- if (m) {
- if (m->m_len != sizeof(struct ip_fw))
- return(EINVAL);
- frwl = mtod(m, struct ip_fw *);
- }
- else
- frwl = NULL;
-
- /*
- * It's possible to insert multiple chain entries with the
- * same number, so we don't stop after finding the first
- * match if zeroing a specific entry.
- */
- s = splnet();
- for (fcp = ip_fw_chain.lh_first; fcp; fcp = fcp->chain.le_next)
- if (!frwl || frwl->fw_number == fcp->rule->fw_number) {
- fcp->rule->fw_bcnt = fcp->rule->fw_pcnt = 0;
- fcp->rule->timestamp = 0;
- }
- splx(s);
-
- if (fw_verbose) {
- if (frwl)
- printf("ipfw: Entry %d cleared.\n", frwl->fw_number);
- else
- printf("ipfw: Accounting cleared.\n");
- }
-
- return(0);
-}
-
-static struct ip_fw *
-check_ipfw_mbuf(struct mbuf *m)
-{
- /* Check length */
- if (m->m_len != sizeof(struct ip_fw)) {
- dprintf(("%s len=%d, want %d\n", err_prefix, m->m_len,
- (int)sizeof(struct ip_fw)));
- return (NULL);
- }
- return(check_ipfw_struct(mtod(m, struct ip_fw *)));
-}
-
-static struct ip_fw *
-check_ipfw_struct(struct ip_fw *frwl)
-{
- /* Check for invalid flag bits */
- if ((frwl->fw_flg & ~IP_FW_F_MASK) != 0) {
- dprintf(("%s undefined flag bits set (flags=%x)\n",
- err_prefix, frwl->fw_flg));
- return (NULL);
- }
- /* Must apply to incoming or outgoing (or both) */
- if (!(frwl->fw_flg & (IP_FW_F_IN | IP_FW_F_OUT))) {
- dprintf(("%s neither in nor out\n", err_prefix));
- return (NULL);
- }
- /* Empty interface name is no good */
- if (((frwl->fw_flg & IP_FW_F_IIFNAME)
- && !*frwl->fw_in_if.fu_via_if.name)
- || ((frwl->fw_flg & IP_FW_F_OIFNAME)
- && !*frwl->fw_out_if.fu_via_if.name)) {
- dprintf(("%s empty interface name\n", err_prefix));
- return (NULL);
- }
- /* Sanity check interface matching */
- if ((frwl->fw_flg & IF_FW_F_VIAHACK) == IF_FW_F_VIAHACK) {
- ; /* allow "via" backwards compatibility */
- } else if ((frwl->fw_flg & IP_FW_F_IN)
- && (frwl->fw_flg & IP_FW_F_OIFACE)) {
- dprintf(("%s outgoing interface check on incoming\n",
- err_prefix));
- return (NULL);
- }
- /* Sanity check port ranges */
- if ((frwl->fw_flg & IP_FW_F_SRNG) && IP_FW_GETNSRCP(frwl) < 2) {
- dprintf(("%s src range set but n_src_p=%d\n",
- err_prefix, IP_FW_GETNSRCP(frwl)));
- return (NULL);
- }
- if ((frwl->fw_flg & IP_FW_F_DRNG) && IP_FW_GETNDSTP(frwl) < 2) {
- dprintf(("%s dst range set but n_dst_p=%d\n",
- err_prefix, IP_FW_GETNDSTP(frwl)));
- return (NULL);
- }
- if (IP_FW_GETNSRCP(frwl) + IP_FW_GETNDSTP(frwl) > IP_FW_MAX_PORTS) {
- dprintf(("%s too many ports (%d+%d)\n",
- err_prefix, IP_FW_GETNSRCP(frwl), IP_FW_GETNDSTP(frwl)));
- return (NULL);
- }
- /*
- * Protocols other than TCP/UDP don't use port range
- */
- if ((frwl->fw_prot != IPPROTO_TCP) &&
- (frwl->fw_prot != IPPROTO_UDP) &&
- (IP_FW_GETNSRCP(frwl) || IP_FW_GETNDSTP(frwl))) {
- dprintf(("%s port(s) specified for non TCP/UDP rule\n",
- err_prefix));
- return(NULL);
- }
-
- /*
- * Rather than modify the entry to make such entries work,
- * we reject this rule and require user level utilities
- * to enforce whatever policy they deem appropriate.
- */
- if ((frwl->fw_src.s_addr & (~frwl->fw_smsk.s_addr)) ||
- (frwl->fw_dst.s_addr & (~frwl->fw_dmsk.s_addr))) {
- dprintf(("%s rule never matches\n", err_prefix));
- return(NULL);
- }
-
- if ((frwl->fw_flg & IP_FW_F_FRAG) &&
- (frwl->fw_prot == IPPROTO_UDP || frwl->fw_prot == IPPROTO_TCP)) {
- if (frwl->fw_nports) {
- dprintf(("%s cannot mix 'frag' and ports\n", err_prefix));
- return(NULL);
- }
- if (frwl->fw_prot == IPPROTO_TCP &&
- frwl->fw_tcpf != frwl->fw_tcpnf) {
- dprintf(("%s cannot mix 'frag' with TCP flags\n", err_prefix));
- return(NULL);
- }
- }
-
- /* Check command specific stuff */
- switch (frwl->fw_flg & IP_FW_F_COMMAND)
- {
- case IP_FW_F_REJECT:
- if (frwl->fw_reject_code >= 0x100
- && !(frwl->fw_prot == IPPROTO_TCP
- && frwl->fw_reject_code == IP_FW_REJECT_RST)) {
- dprintf(("%s unknown reject code\n", err_prefix));
- return(NULL);
- }
- break;
- case IP_FW_F_DIVERT: /* Diverting to port zero is invalid */
- case IP_FW_F_TEE:
- if (frwl->fw_divert_port == 0) {
- dprintf(("%s can't divert to port 0\n", err_prefix));
- return (NULL);
- }
- break;
- case IP_FW_F_DENY:
- case IP_FW_F_ACCEPT:
- case IP_FW_F_COUNT:
- case IP_FW_F_SKIPTO:
- break;
- default:
- dprintf(("%s invalid command\n", err_prefix));
- return(NULL);
- }
-
- return frwl;
-}
-
-static int
-ip_fw_ctl(int stage, struct mbuf **mm)
-{
- int error;
- struct mbuf *m;
-
- if (stage == IP_FW_GET) {
- struct ip_fw_chain *fcp = ip_fw_chain.lh_first;
- *mm = m = m_get(M_WAIT, MT_SOOPTS);
- for (; fcp; fcp = fcp->chain.le_next) {
- memcpy(m->m_data, fcp->rule, sizeof *(fcp->rule));
- m->m_len = sizeof *(fcp->rule);
- m->m_next = m_get(M_WAIT, MT_SOOPTS);
- m = m->m_next;
- m->m_len = 0;
- }
- return (0);
- }
- m = *mm;
- /* only allow get calls if secure mode > 2 */
- if (securelevel > 2) {
- if (m) (void)m_free(m);
- return(EPERM);
- }
- if (stage == IP_FW_FLUSH) {
- while (ip_fw_chain.lh_first != NULL &&
- ip_fw_chain.lh_first->rule->fw_number != (u_short)-1) {
- struct ip_fw_chain *fcp = ip_fw_chain.lh_first;
- int s = splnet();
- LIST_REMOVE(ip_fw_chain.lh_first, chain);
- splx(s);
- free(fcp->rule, M_IPFW);
- free(fcp, M_IPFW);
- }
- if (m) (void)m_free(m);
- return (0);
- }
- if (stage == IP_FW_ZERO) {
- error = zero_entry(m);
- if (m) (void)m_free(m);
- return (error);
- }
- if (m == NULL) {
- printf("%s NULL mbuf ptr\n", err_prefix);
- return (EINVAL);
- }
-
- if (stage == IP_FW_ADD) {
- struct ip_fw *frwl = check_ipfw_mbuf(m);
-
- if (!frwl)
- error = EINVAL;
- else
- error = add_entry(&ip_fw_chain, frwl);
- if (m) (void)m_free(m);
- return error;
- }
- if (stage == IP_FW_DEL) {
- if (m->m_len != sizeof(struct ip_fw)) {
- dprintf(("%s len=%d, want %d\n", err_prefix, m->m_len,
- (int)sizeof(struct ip_fw)));
- error = EINVAL;
- } else if (mtod(m, struct ip_fw *)->fw_number == (u_short)-1) {
- dprintf(("%s can't delete rule 65535\n", err_prefix));
- error = EINVAL;
- } else
- error = del_entry(&ip_fw_chain,
- mtod(m, struct ip_fw *)->fw_number);
- if (m) (void)m_free(m);
- return error;
- }
-
- dprintf(("%s unknown request %d\n", err_prefix, stage));
- if (m) (void)m_free(m);
- return (EINVAL);
-}
-
-void
-ip_fw_init(void)
-{
- struct ip_fw default_rule;
-
- ip_fw_chk_ptr = ip_fw_chk;
- ip_fw_ctl_ptr = ip_fw_ctl;
- LIST_INIT(&ip_fw_chain);
-
- bzero(&default_rule, sizeof default_rule);
- default_rule.fw_prot = IPPROTO_IP;
- default_rule.fw_number = (u_short)-1;
-#ifdef IPFIREWALL_DEFAULT_TO_ACCEPT
- default_rule.fw_flg |= IP_FW_F_ACCEPT;
-#else
- default_rule.fw_flg |= IP_FW_F_DENY;
-#endif
- default_rule.fw_flg |= IP_FW_F_IN | IP_FW_F_OUT;
- if (check_ipfw_struct(&default_rule) == NULL ||
- add_entry(&ip_fw_chain, &default_rule))
- panic(__FUNCTION__);
-
- printf("IP packet filtering initialized, "
-#ifdef IPDIVERT
- "divert enabled, ");
-#else
- "divert disabled, ");
-#endif
-#ifdef IPFIREWALL_DEFAULT_TO_ACCEPT
- printf("default to accept, ");
-#endif
-#ifndef IPFIREWALL_VERBOSE
- printf("logging disabled\n");
-#else
- if (fw_verbose_limit == 0)
- printf("unlimited logging\n");
- else
- printf("logging limited to %d packets/entry\n",
- fw_verbose_limit);
-#endif
-}
-
-#ifdef IPFIREWALL_MODULE
-
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-MOD_MISC(ipfw);
-
-static int
-ipfw_load(struct lkm_table *lkmtp, int cmd)
-{
- int s=splnet();
-
- old_chk_ptr = ip_fw_chk_ptr;
- old_ctl_ptr = ip_fw_ctl_ptr;
-
- ip_fw_init();
- splx(s);
- return 0;
-}
-
-static int
-ipfw_unload(struct lkm_table *lkmtp, int cmd)
-{
- int s=splnet();
-
- ip_fw_chk_ptr = old_chk_ptr;
- ip_fw_ctl_ptr = old_ctl_ptr;
-
- while (ip_fw_chain.lh_first != NULL) {
- struct ip_fw_chain *fcp = ip_fw_chain.lh_first;
- LIST_REMOVE(ip_fw_chain.lh_first, chain);
- free(fcp->rule, M_IPFW);
- free(fcp, M_IPFW);
- }
-
- splx(s);
- printf("IP firewall unloaded\n");
- return 0;
-}
-
-int
-ipfw_mod(struct lkm_table *lkmtp, int cmd, int ver)
-{
- DISPATCH(lkmtp, cmd, ver, ipfw_load, ipfw_unload, lkm_nullcmd);
-}
-#endif
diff --git a/c/src/lib/libnetworking/netinet/ip_fw.h b/c/src/lib/libnetworking/netinet/ip_fw.h
deleted file mode 100644
index cab7f4ac93..0000000000
--- a/c/src/lib/libnetworking/netinet/ip_fw.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 1993 Daniel Boulet
- * Copyright (c) 1994 Ugen J.S.Antsilevich
- *
- * Redistribution and use in source forms, with and without modification,
- * are permitted provided that this entire comment appears intact.
- *
- * Redistribution in binary form may occur without any restrictions.
- * Obviously, it would be nice if you gave credit where credit is due
- * but requiring it would be too onerous.
- *
- * This software is provided ``AS IS'' without any warranties of any kind.
- *
- * $Id$
- */
-
-#ifndef _IP_FW_H
-#define _IP_FW_H
-
-#include <net/if.h>
-
-/*
- * This union structure identifies an interface, either explicitly
- * by name or implicitly by IP address. The flags IP_FW_F_IIFNAME
- * and IP_FW_F_OIFNAME say how to interpret this structure. An
- * interface unit number of -1 matches any unit number, while an
- * IP address of 0.0.0.0 indicates matches any interface.
- *
- * The receive and transmit interfaces are only compared against the
- * the packet if the corresponding bit (IP_FW_F_IIFACE or IP_FW_F_OIFACE)
- * is set. Note some packets lack a receive or transmit interface
- * (in which case the missing "interface" never matches).
- */
-
-union ip_fw_if {
- struct in_addr fu_via_ip; /* Specified by IP address */
- struct { /* Specified by interface name */
-#define FW_IFNLEN IFNAMSIZ
- char name[FW_IFNLEN];
- short unit; /* -1 means match any unit */
- } fu_via_if;
-};
-
-/*
- * Format of an IP firewall descriptor
- *
- * fw_src, fw_dst, fw_smsk, fw_dmsk are always stored in network byte order.
- * fw_flg and fw_n*p are stored in host byte order (of course).
- * Port numbers are stored in HOST byte order.
- * Warning: setsockopt() will fail if sizeof(struct ip_fw) > MLEN (108)
- */
-
-struct ip_fw {
- u_long fw_pcnt,fw_bcnt; /* Packet and byte counters */
- struct in_addr fw_src, fw_dst; /* Source and destination IP addr */
- struct in_addr fw_smsk, fw_dmsk; /* Mask for src and dest IP addr */
- u_short fw_number; /* Rule number */
- u_short fw_flg; /* Flags word */
-#define IP_FW_MAX_PORTS 10 /* A reasonable maximum */
- u_short fw_pts[IP_FW_MAX_PORTS]; /* Array of port numbers to match */
- u_char fw_ipopt,fw_ipnopt; /* IP options set/unset */
- u_char fw_tcpf,fw_tcpnf; /* TCP flags set/unset */
-#define IP_FW_ICMPTYPES_DIM (32 / (sizeof(unsigned) * 8))
- unsigned fw_icmptypes[IP_FW_ICMPTYPES_DIM]; /* ICMP types bitmap */
- long timestamp; /* timestamp (tv_sec) of last match */
- union ip_fw_if fw_in_if, fw_out_if; /* Incoming and outgoing interfaces */
- union {
- u_short fu_divert_port; /* Divert/tee port (options IPDIVERT) */
- u_short fu_skipto_rule; /* SKIPTO command rule number */
- u_short fu_reject_code; /* REJECT response code */
- } fw_un;
- u_char fw_prot; /* IP protocol */
- u_char fw_nports; /* N'of src ports and # of dst ports */
- /* in ports array (dst ports follow */
- /* src ports; max of 10 ports in all; */
- /* count of 0 means match all ports) */
-};
-
-#define IP_FW_GETNSRCP(rule) ((rule)->fw_nports & 0x0f)
-#define IP_FW_SETNSRCP(rule, n) do { \
- (rule)->fw_nports &= ~0x0f; \
- (rule)->fw_nports |= (n); \
- } while (0)
-#define IP_FW_GETNDSTP(rule) ((rule)->fw_nports >> 4)
-#define IP_FW_SETNDSTP(rule, n) do { \
- (rule)->fw_nports &= ~0xf0; \
- (rule)->fw_nports |= (n) << 4;\
- } while (0)
-
-#define fw_divert_port fw_un.fu_divert_port
-#define fw_skipto_rule fw_un.fu_skipto_rule
-#define fw_reject_code fw_un.fu_reject_code
-
-struct ip_fw_chain {
- LIST_ENTRY(ip_fw_chain) chain;
- struct ip_fw *rule;
-};
-
-/*
- * Values for "flags" field .
- */
-#define IP_FW_F_IN 0x0001 /* Check inbound packets */
-#define IP_FW_F_OUT 0x0002 /* Check outbound packets */
-#define IP_FW_F_IIFACE 0x0004 /* Apply inbound interface test */
-#define IP_FW_F_OIFACE 0x0008 /* Apply outbound interface test */
-
-#define IP_FW_F_COMMAND 0x0070 /* Mask for type of chain entry: */
-#define IP_FW_F_DENY 0x0000 /* This is a deny rule */
-#define IP_FW_F_REJECT 0x0010 /* Deny and send a response packet */
-#define IP_FW_F_ACCEPT 0x0020 /* This is an accept rule */
-#define IP_FW_F_COUNT 0x0030 /* This is a count rule */
-#define IP_FW_F_DIVERT 0x0040 /* This is a divert rule */
-#define IP_FW_F_TEE 0x0050 /* This is a tee rule */
-#define IP_FW_F_SKIPTO 0x0060 /* This is a skipto rule */
-
-#define IP_FW_F_PRN 0x0080 /* Print if this rule matches */
-
-#define IP_FW_F_SRNG 0x0100 /* The first two src ports are a min *
- * and max range (stored in host byte *
- * order). */
-
-#define IP_FW_F_DRNG 0x0200 /* The first two dst ports are a min *
- * and max range (stored in host byte *
- * order). */
-
-#define IP_FW_F_IIFNAME 0x0400 /* In interface by name/unit (not IP) */
-#define IP_FW_F_OIFNAME 0x0800 /* Out interface by name/unit (not IP) */
-
-#define IP_FW_F_INVSRC 0x1000 /* Invert sense of src check */
-#define IP_FW_F_INVDST 0x2000 /* Invert sense of dst check */
-
-#define IP_FW_F_FRAG 0x4000 /* Fragment */
-
-#define IP_FW_F_ICMPBIT 0x8000 /* ICMP type bitmap is valid */
-
-#define IP_FW_F_MASK 0xFFFF /* All possible flag bits mask */
-
-/*
- * For backwards compatibility with rules specifying "via iface" but
- * not restricted to only "in" or "out" packets, we define this combination
- * of bits to represent this configuration.
- */
-
-#define IF_FW_F_VIAHACK (IP_FW_F_IN|IP_FW_F_OUT|IP_FW_F_IIFACE|IP_FW_F_OIFACE)
-
-/*
- * Definitions for REJECT response codes.
- * Values less than 256 correspond to ICMP unreachable codes.
- */
-#define IP_FW_REJECT_RST 0x0100 /* TCP packets: send RST */
-
-/*
- * Definitions for IP option names.
- */
-#define IP_FW_IPOPT_LSRR 0x01
-#define IP_FW_IPOPT_SSRR 0x02
-#define IP_FW_IPOPT_RR 0x04
-#define IP_FW_IPOPT_TS 0x08
-
-/*
- * Definitions for TCP flags.
- */
-#define IP_FW_TCPF_FIN TH_FIN
-#define IP_FW_TCPF_SYN TH_SYN
-#define IP_FW_TCPF_RST TH_RST
-#define IP_FW_TCPF_PSH TH_PUSH
-#define IP_FW_TCPF_ACK TH_ACK
-#define IP_FW_TCPF_URG TH_URG
-#define IP_FW_TCPF_ESTAB 0x40
-
-/*
- * Main firewall chains definitions and global var's definitions.
- */
-#ifdef KERNEL
-
-/*
- * Function definitions.
- */
-void ip_fw_init(void);
-
-#endif /* KERNEL */
-
-#endif /* _IP_FW_H */
diff --git a/c/src/lib/libnetworking/netinet/ip_icmp.c b/c/src/lib/libnetworking/netinet/ip_icmp.c
deleted file mode 100644
index a18dacca99..0000000000
--- a/c/src/lib/libnetworking/netinet/ip_icmp.c
+++ /dev/null
@@ -1,710 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#define _IP_VHL
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_var.h>
-#include <netinet/icmp_var.h>
-
-/*
- * ICMP routines: error generation, receive packet processing, and
- * routines to turnaround packets back to the originator, and
- * host table maintenance routines.
- */
-
- struct icmpstat icmpstat;
-SYSCTL_STRUCT(_net_inet_icmp, ICMPCTL_STATS, stats, CTLFLAG_RD,
- &icmpstat, icmpstat, "");
-
-static int icmpmaskrepl = 0;
-SYSCTL_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_RW,
- &icmpmaskrepl, 0, "");
-
-static int icmpbmcastecho = 1;
-SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, &icmpbmcastecho,
- 0, "");
-
-#ifdef ICMPPRINTFS
-int icmpprintfs = 0;
-#endif
-
-static void icmp_reflect __P((struct mbuf *));
-static void icmp_send __P((struct mbuf *, struct mbuf *));
-static int ip_next_mtu __P((int, int));
-
-extern struct protosw inetsw[];
-
-/*
- * Generate an error packet of type error
- * in response to bad packet ip.
- */
-void
-icmp_error(n, type, code, dest, destifp)
- struct mbuf *n;
- int type, code;
- n_long dest;
- struct ifnet *destifp;
-{
- register struct ip *oip = mtod(n, struct ip *), *nip;
- register unsigned oiplen = IP_VHL_HL(oip->ip_vhl) << 2;
- register struct icmp *icp;
- register struct mbuf *m;
- unsigned icmplen;
-
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("icmp_error(%p, %x, %d)\n", oip, type, code);
-#endif
- if (type != ICMP_REDIRECT)
- icmpstat.icps_error++;
- /*
- * Don't send error if not the first fragment of message.
- * Don't error if the old packet protocol was ICMP
- * error message, only known informational types.
- */
- if (oip->ip_off &~ (IP_MF|IP_DF))
- goto freeit;
- if (oip->ip_p == IPPROTO_ICMP && type != ICMP_REDIRECT &&
- n->m_len >= oiplen + ICMP_MINLEN &&
- !ICMP_INFOTYPE(((struct icmp *)((caddr_t)oip + oiplen))->icmp_type)) {
- icmpstat.icps_oldicmp++;
- goto freeit;
- }
- /* Don't send error in response to a multicast or broadcast packet */
- if (n->m_flags & (M_BCAST|M_MCAST))
- goto freeit;
- /*
- * First, formulate icmp message
- */
- m = m_gethdr(M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- goto freeit;
- icmplen = oiplen + min(8, oip->ip_len);
- m->m_len = icmplen + ICMP_MINLEN;
- MH_ALIGN(m, m->m_len);
- icp = mtod(m, struct icmp *);
- if ((u_int)type > ICMP_MAXTYPE)
- panic("icmp_error");
- icmpstat.icps_outhist[type]++;
- icp->icmp_type = type;
- if (type == ICMP_REDIRECT)
- icp->icmp_gwaddr.s_addr = dest;
- else {
- icp->icmp_void = 0;
- /*
- * The following assignments assume an overlay with the
- * zeroed icmp_void field.
- */
- if (type == ICMP_PARAMPROB) {
- icp->icmp_pptr = code;
- code = 0;
- } else if (type == ICMP_UNREACH &&
- code == ICMP_UNREACH_NEEDFRAG && destifp) {
- icp->icmp_nextmtu = htons(destifp->if_mtu);
- }
- }
-
- icp->icmp_code = code;
- bcopy((caddr_t)oip, (caddr_t)&icp->icmp_ip, icmplen);
- nip = &icp->icmp_ip;
- nip->ip_len = htons((u_short)(nip->ip_len + oiplen));
-
- /*
- * Now, copy old ip header (without options)
- * in front of icmp message.
- */
- if (m->m_data - sizeof(struct ip) < m->m_pktdat)
- panic("icmp len");
- m->m_data -= sizeof(struct ip);
- m->m_len += sizeof(struct ip);
- m->m_pkthdr.len = m->m_len;
- m->m_pkthdr.rcvif = n->m_pkthdr.rcvif;
- nip = mtod(m, struct ip *);
- bcopy((caddr_t)oip, (caddr_t)nip, sizeof(struct ip));
- nip->ip_len = m->m_len;
- nip->ip_vhl = IP_VHL_BORING;
- nip->ip_p = IPPROTO_ICMP;
- nip->ip_tos = 0;
- icmp_reflect(m);
-
-freeit:
- m_freem(n);
-}
-
-static struct sockaddr_in icmpsrc = { sizeof (struct sockaddr_in), AF_INET };
-static struct sockaddr_in icmpdst = { sizeof (struct sockaddr_in), AF_INET };
-static struct sockaddr_in icmpgw = { sizeof (struct sockaddr_in), AF_INET };
-
-/*
- * Process a received ICMP message.
- */
-void
-icmp_input(m, hlen)
- register struct mbuf *m;
- int hlen;
-{
- register struct icmp *icp;
- register struct ip *ip = mtod(m, struct ip *);
- int icmplen = ip->ip_len;
- register int i;
- struct in_ifaddr *ia;
- void (*ctlfunc) __P((int, struct sockaddr *, void *));
- int code;
-
- /*
- * Locate icmp structure in mbuf, and check
- * that not corrupted and of at least minimum length.
- */
-#ifdef ICMPPRINTFS
- if (icmpprintfs) {
- char buf[4 * sizeof "123"];
- strcpy(buf, inet_ntoa(ip->ip_src));
- printf("icmp_input from %s to %s, len %d\n",
- buf, inet_ntoa(ip->ip_dst), icmplen);
- }
-#endif
- if (icmplen < ICMP_MINLEN) {
- icmpstat.icps_tooshort++;
- goto freeit;
- }
- i = hlen + min(icmplen, ICMP_ADVLENMIN);
- if (m->m_len < i && (m = m_pullup(m, i)) == 0) {
- icmpstat.icps_tooshort++;
- return;
- }
- ip = mtod(m, struct ip *);
- m->m_len -= hlen;
- m->m_data += hlen;
- icp = mtod(m, struct icmp *);
- if (in_cksum(m, icmplen)) {
- icmpstat.icps_checksum++;
- goto freeit;
- }
- m->m_len += hlen;
- m->m_data -= hlen;
-
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("icmp_input, type %d code %d\n", icp->icmp_type,
- icp->icmp_code);
-#endif
-
- /*
- * Message type specific processing.
- */
- if (icp->icmp_type > ICMP_MAXTYPE)
- goto raw;
- icmpstat.icps_inhist[icp->icmp_type]++;
- code = icp->icmp_code;
- switch (icp->icmp_type) {
-
- case ICMP_UNREACH:
- switch (code) {
- case ICMP_UNREACH_NET:
- case ICMP_UNREACH_HOST:
- case ICMP_UNREACH_PROTOCOL:
- case ICMP_UNREACH_PORT:
- case ICMP_UNREACH_SRCFAIL:
- code += PRC_UNREACH_NET;
- break;
-
- case ICMP_UNREACH_NEEDFRAG:
- code = PRC_MSGSIZE;
- break;
-
- case ICMP_UNREACH_NET_UNKNOWN:
- case ICMP_UNREACH_NET_PROHIB:
- case ICMP_UNREACH_TOSNET:
- code = PRC_UNREACH_NET;
- break;
-
- case ICMP_UNREACH_HOST_UNKNOWN:
- case ICMP_UNREACH_ISOLATED:
- case ICMP_UNREACH_HOST_PROHIB:
- case ICMP_UNREACH_TOSHOST:
- code = PRC_UNREACH_HOST;
- break;
-
- case ICMP_UNREACH_FILTER_PROHIB:
- case ICMP_UNREACH_HOST_PRECEDENCE:
- case ICMP_UNREACH_PRECEDENCE_CUTOFF:
- code = PRC_UNREACH_PORT;
- break;
-
- default:
- goto badcode;
- }
- goto deliver;
-
- case ICMP_TIMXCEED:
- if (code > 1)
- goto badcode;
- code += PRC_TIMXCEED_INTRANS;
- goto deliver;
-
- case ICMP_PARAMPROB:
- if (code > 1)
- goto badcode;
- code = PRC_PARAMPROB;
- goto deliver;
-
- case ICMP_SOURCEQUENCH:
- if (code)
- goto badcode;
- code = PRC_QUENCH;
- deliver:
- /*
- * Problem with datagram; advise higher level routines.
- */
- if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
- IP_VHL_HL(icp->icmp_ip.ip_vhl) < (sizeof(struct ip) >> 2)) {
- icmpstat.icps_badlen++;
- goto freeit;
- }
- NTOHS(icp->icmp_ip.ip_len);
- /* Discard ICMP's in response to multicast packets */
- if (IN_MULTICAST(ntohl(icp->icmp_ip.ip_dst.s_addr)))
- goto badcode;
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("deliver to protocol %d\n", icp->icmp_ip.ip_p);
-#endif
- icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
-#if 1
- /*
- * MTU discovery:
- * If we got a needfrag and there is a host route to the
- * original destination, and the MTU is not locked, then
- * set the MTU in the route to the suggested new value
- * (if given) and then notify as usual. The ULPs will
- * notice that the MTU has changed and adapt accordingly.
- * If no new MTU was suggested, then we guess a new one
- * less than the current value. If the new MTU is
- * unreasonably small (arbitrarily set at 296), then
- * we reset the MTU to the interface value and enable the
- * lock bit, indicating that we are no longer doing MTU
- * discovery.
- */
- if (code == PRC_MSGSIZE) {
- struct rtentry *rt;
- int mtu;
-
- rt = rtalloc1((struct sockaddr *)&icmpsrc, 0,
- RTF_CLONING | RTF_PRCLONING);
- if (rt && (rt->rt_flags & RTF_HOST)
- && !(rt->rt_rmx.rmx_locks & RTV_MTU)) {
- mtu = ntohs(icp->icmp_nextmtu);
- if (!mtu)
- mtu = ip_next_mtu(rt->rt_rmx.rmx_mtu,
- 1);
-#ifdef DEBUG_MTUDISC
- printf("MTU for %s reduced to %d\n",
- inet_ntoa(icmpsrc.sin_addr), mtu);
-#endif
- if (mtu < 296) {
- /* rt->rt_rmx.rmx_mtu =
- rt->rt_ifp->if_mtu; */
- rt->rt_rmx.rmx_locks |= RTV_MTU;
- } else if (rt->rt_rmx.rmx_mtu > mtu) {
- rt->rt_rmx.rmx_mtu = mtu;
- }
- }
- if (rt)
- RTFREE(rt);
- }
-
-#endif
- ctlfunc = inetsw[ip_protox[icp->icmp_ip.ip_p]].pr_ctlinput;
- if (ctlfunc)
- (*ctlfunc)(code, (struct sockaddr *)&icmpsrc,
- (void *)&icp->icmp_ip);
- break;
-
- badcode:
- icmpstat.icps_badcode++;
- break;
-
- case ICMP_ECHO:
- if (!icmpbmcastecho
- && (m->m_flags & (M_MCAST | M_BCAST)) != 0
- && IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- icmpstat.icps_bmcastecho++;
- break;
- }
- icp->icmp_type = ICMP_ECHOREPLY;
- goto reflect;
-
- case ICMP_TSTAMP:
- if (!icmpbmcastecho
- && (m->m_flags & (M_MCAST | M_BCAST)) != 0
- && IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- icmpstat.icps_bmcasttstamp++;
- break;
- }
- if (icmplen < ICMP_TSLEN) {
- icmpstat.icps_badlen++;
- break;
- }
- icp->icmp_type = ICMP_TSTAMPREPLY;
- icp->icmp_rtime = iptime();
- icp->icmp_ttime = icp->icmp_rtime; /* bogus, do later! */
- goto reflect;
-
- case ICMP_MASKREQ:
-#define satosin(sa) ((struct sockaddr_in *)(sa))
- if (icmpmaskrepl == 0)
- break;
- /*
- * We are not able to respond with all ones broadcast
- * unless we receive it over a point-to-point interface.
- */
- if (icmplen < ICMP_MASKLEN)
- break;
- switch (ip->ip_dst.s_addr) {
-
- case INADDR_BROADCAST:
- case INADDR_ANY:
- icmpdst.sin_addr = ip->ip_src;
- break;
-
- default:
- icmpdst.sin_addr = ip->ip_dst;
- }
- ia = (struct in_ifaddr *)ifaof_ifpforaddr(
- (struct sockaddr *)&icmpdst, m->m_pkthdr.rcvif);
- if (ia == 0)
- break;
- if (ia->ia_ifp == 0)
- break;
- icp->icmp_type = ICMP_MASKREPLY;
- icp->icmp_mask = ia->ia_sockmask.sin_addr.s_addr;
- if (ip->ip_src.s_addr == 0) {
- if (ia->ia_ifp->if_flags & IFF_BROADCAST)
- ip->ip_src = satosin(&ia->ia_broadaddr)->sin_addr;
- else if (ia->ia_ifp->if_flags & IFF_POINTOPOINT)
- ip->ip_src = satosin(&ia->ia_dstaddr)->sin_addr;
- }
-reflect:
- ip->ip_len += hlen; /* since ip_input deducts this */
- icmpstat.icps_reflect++;
- icmpstat.icps_outhist[icp->icmp_type]++;
- icmp_reflect(m);
- return;
-
- case ICMP_REDIRECT:
- if (code > 3)
- goto badcode;
- if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
- IP_VHL_HL(icp->icmp_ip.ip_vhl) < (sizeof(struct ip) >> 2)) {
- icmpstat.icps_badlen++;
- break;
- }
- /*
- * Short circuit routing redirects to force
- * immediate change in the kernel's routing
- * tables. The message is also handed to anyone
- * listening on a raw socket (e.g. the routing
- * daemon for use in updating its tables).
- */
- icmpgw.sin_addr = ip->ip_src;
- icmpdst.sin_addr = icp->icmp_gwaddr;
-#ifdef ICMPPRINTFS
- if (icmpprintfs) {
- char buf[4 * sizeof "123"];
- strcpy(buf, inet_ntoa(icp->icmp_ip.ip_dst));
-
- printf("redirect dst %s to %s\n",
- buf, inet_ntoa(icp->icmp_gwaddr));
- }
-#endif
- icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
- rtredirect((struct sockaddr *)&icmpsrc,
- (struct sockaddr *)&icmpdst,
- (struct sockaddr *)0, RTF_GATEWAY | RTF_HOST,
- (struct sockaddr *)&icmpgw, (struct rtentry **)0);
- pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&icmpsrc);
- break;
-
- /*
- * No kernel processing for the following;
- * just fall through to send to raw listener.
- */
- case ICMP_ECHOREPLY:
- case ICMP_ROUTERADVERT:
- case ICMP_ROUTERSOLICIT:
- case ICMP_TSTAMPREPLY:
- case ICMP_IREQREPLY:
- case ICMP_MASKREPLY:
- default:
- break;
- }
-
-raw:
- rip_input(m, hlen);
- return;
-
-freeit:
- m_freem(m);
-}
-
-/*
- * Reflect the ip packet back to the source
- */
-static void
-icmp_reflect(m)
- struct mbuf *m;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register struct in_ifaddr *ia;
- struct in_addr t;
- struct mbuf *opts = 0;
- int optlen = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof(struct ip);
-
- if (!in_canforward(ip->ip_src) &&
- ((ntohl(ip->ip_src.s_addr) & IN_CLASSA_NET) !=
- (IN_LOOPBACKNET << IN_CLASSA_NSHIFT))) {
- m_freem(m); /* Bad return address */
- goto done; /* Ip_output() will check for broadcast */
- }
- t = ip->ip_dst;
- ip->ip_dst = ip->ip_src;
- /*
- * If the incoming packet was addressed directly to us,
- * use dst as the src for the reply. Otherwise (broadcast
- * or anonymous), use the address which corresponds
- * to the incoming interface.
- */
- for (ia = in_ifaddr; ia; ia = ia->ia_next) {
- if (t.s_addr == IA_SIN(ia)->sin_addr.s_addr)
- break;
- if (ia->ia_ifp && (ia->ia_ifp->if_flags & IFF_BROADCAST) &&
- t.s_addr == satosin(&ia->ia_broadaddr)->sin_addr.s_addr)
- break;
- }
- icmpdst.sin_addr = t;
- if ((ia == (struct in_ifaddr *)0) && m->m_pkthdr.rcvif)
- ia = (struct in_ifaddr *)ifaof_ifpforaddr(
- (struct sockaddr *)&icmpdst, m->m_pkthdr.rcvif);
- /*
- * The following happens if the packet was not addressed to us,
- * and was received on an interface with no IP address.
- */
- if (ia == (struct in_ifaddr *)0)
- ia = in_ifaddr;
- t = IA_SIN(ia)->sin_addr;
- ip->ip_src = t;
- ip->ip_ttl = MAXTTL;
-
- if (optlen > 0) {
- register u_char *cp;
- int opt, cnt;
- u_int len;
-
- /*
- * Retrieve any source routing from the incoming packet;
- * add on any record-route or timestamp options.
- */
- cp = (u_char *) (ip + 1);
- if ((opts = ip_srcroute()) == 0 &&
- (opts = m_gethdr(M_DONTWAIT, MT_HEADER))) {
- opts->m_len = sizeof(struct in_addr);
- mtod(opts, struct in_addr *)->s_addr = 0;
- }
- if (opts) {
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("icmp_reflect optlen %d rt %d => ",
- optlen, opts->m_len);
-#endif
- for (cnt = optlen; cnt > 0; cnt -= len, cp += len) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- len = 1;
- else {
- len = cp[IPOPT_OLEN];
- if (len <= 0 || len > cnt)
- break;
- }
- /*
- * Should check for overflow, but it "can't happen"
- */
- if (opt == IPOPT_RR || opt == IPOPT_TS ||
- opt == IPOPT_SECURITY) {
- bcopy((caddr_t)cp,
- mtod(opts, caddr_t) + opts->m_len, len);
- opts->m_len += len;
- }
- }
- /* Terminate & pad, if necessary */
- cnt = opts->m_len % 4;
- if (cnt) {
- for (; cnt < 4; cnt++) {
- *(mtod(opts, caddr_t) + opts->m_len) =
- IPOPT_EOL;
- opts->m_len++;
- }
- }
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("%d\n", opts->m_len);
-#endif
- }
- /*
- * Now strip out original options by copying rest of first
- * mbuf's data back, and adjust the IP length.
- */
- ip->ip_len -= optlen;
- ip->ip_vhl = IP_VHL_BORING;
- m->m_len -= optlen;
- if (m->m_flags & M_PKTHDR)
- m->m_pkthdr.len -= optlen;
- optlen += sizeof(struct ip);
- bcopy((caddr_t)ip + optlen, (caddr_t)(ip + 1),
- (unsigned)(m->m_len - sizeof(struct ip)));
- }
- m->m_flags &= ~(M_BCAST|M_MCAST);
- icmp_send(m, opts);
-done:
- if (opts)
- (void)m_free(opts);
-}
-
-/*
- * Send an icmp packet back to the ip level,
- * after supplying a checksum.
- */
-static void
-icmp_send(m, opts)
- register struct mbuf *m;
- struct mbuf *opts;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register int hlen;
- register struct icmp *icp;
- struct route ro;
-
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
- m->m_data += hlen;
- m->m_len -= hlen;
- icp = mtod(m, struct icmp *);
- icp->icmp_cksum = 0;
- icp->icmp_cksum = in_cksum(m, ip->ip_len - hlen);
- m->m_data -= hlen;
- m->m_len += hlen;
-#ifdef ICMPPRINTFS
- if (icmpprintfs) {
- char buf[4 * sizeof "123"];
- strcpy(buf, inet_ntoa(ip->ip_dst));
- printf("icmp_send dst %s src %s\n",
- buf, inet_ntoa(ip->ip_src));
- }
-#endif
- bzero(&ro, sizeof ro);
- (void) ip_output(m, opts, &ro, 0, NULL);
- if (ro.ro_rt)
- RTFREE(ro.ro_rt);
-}
-
-n_time
-iptime()
-{
- struct timeval atv;
- u_long t;
-
- microtime(&atv);
- t = (atv.tv_sec % (24*60*60)) * 1000 + atv.tv_usec / 1000;
- return (htonl(t));
-}
-
-#if 1
-/*
- * Return the next larger or smaller MTU plateau (table from RFC 1191)
- * given current value MTU. If DIR is less than zero, a larger plateau
- * is returned; otherwise, a smaller value is returned.
- */
-static int
-ip_next_mtu(mtu, dir)
- int mtu;
- int dir;
-{
- static int mtutab[] = {
- 65535, 32000, 17914, 8166, 4352, 2002, 1492, 1006, 508, 296,
- 68, 0
- };
- int i;
-
- for (i = 0; i < (sizeof mtutab) / (sizeof mtutab[0]); i++) {
- if (mtu >= mtutab[i])
- break;
- }
-
- if (dir < 0) {
- if (i == 0) {
- return 0;
- } else {
- return mtutab[i - 1];
- }
- } else {
- if (mtutab[i] == 0) {
- return 0;
- } else if(mtu > mtutab[i]) {
- return mtutab[i];
- } else {
- return mtutab[i + 1];
- }
- }
-}
-#endif
diff --git a/c/src/lib/libnetworking/netinet/ip_icmp.h b/c/src/lib/libnetworking/netinet/ip_icmp.h
deleted file mode 100644
index 9d07a682de..0000000000
--- a/c/src/lib/libnetworking/netinet/ip_icmp.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IP_ICMP_H_
-#define _NETINET_IP_ICMP_H_
-
-/*
- * Interface Control Message Protocol Definitions.
- * Per RFC 792, September 1981.
- */
-
-/*
- * Internal of an ICMP Router Advertisement
- */
-struct icmp_ra_addr {
- u_int32_t ira_addr;
- u_int32_t ira_preference;
-};
-
-/*
- * Structure of an icmp header.
- */
-struct icmp {
- u_char icmp_type; /* type of message, see below */
- u_char icmp_code; /* type sub code */
- u_short icmp_cksum; /* ones complement cksum of struct */
- union {
- u_char ih_pptr; /* ICMP_PARAMPROB */
- struct in_addr ih_gwaddr; /* ICMP_REDIRECT */
- struct ih_idseq {
- n_short icd_id;
- n_short icd_seq;
- } ih_idseq;
- int ih_void;
-
- /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
- struct ih_pmtu {
- n_short ipm_void;
- n_short ipm_nextmtu;
- } ih_pmtu;
-
- struct ih_rtradv {
- u_char irt_num_addrs;
- u_char irt_wpa;
- u_int16_t irt_lifetime;
- } ih_rtradv;
- } icmp_hun;
-#define icmp_pptr icmp_hun.ih_pptr
-#define icmp_gwaddr icmp_hun.ih_gwaddr
-#define icmp_id icmp_hun.ih_idseq.icd_id
-#define icmp_seq icmp_hun.ih_idseq.icd_seq
-#define icmp_void icmp_hun.ih_void
-#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
-#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
-#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
-#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
-#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
- union {
- struct id_ts {
- n_time its_otime;
- n_time its_rtime;
- n_time its_ttime;
- } id_ts;
- struct id_ip {
- struct ip idi_ip;
- /* options and then 64 bits of data */
- } id_ip;
- struct icmp_ra_addr id_radv;
- u_long id_mask;
- char id_data[1];
- } icmp_dun;
-#define icmp_otime icmp_dun.id_ts.its_otime
-#define icmp_rtime icmp_dun.id_ts.its_rtime
-#define icmp_ttime icmp_dun.id_ts.its_ttime
-#define icmp_ip icmp_dun.id_ip.idi_ip
-#define icmp_radv icmp_dun.id_radv
-#define icmp_mask icmp_dun.id_mask
-#define icmp_data icmp_dun.id_data
-};
-
-/*
- * Lower bounds on packet lengths for various types.
- * For the error advice packets must first insure that the
- * packet is large enough to contain the returned ip header.
- * Only then can we do the check to see if 64 bits of packet
- * data have been returned, since we need to check the returned
- * ip header length.
- */
-#define ICMP_MINLEN 8 /* abs minimum */
-#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */
-#define ICMP_MASKLEN 12 /* address mask */
-#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
-#ifndef _IP_VHL
-#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
- /* N.B.: must separately check that ip_hl >= 5 */
-#else
-#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
- /* N.B.: must separately check that header length >= 5 */
-#endif
-
-/*
- * Definition of type and code field values.
- */
-#define ICMP_ECHOREPLY 0 /* echo reply */
-#define ICMP_UNREACH 3 /* dest unreachable, codes: */
-#define ICMP_UNREACH_NET 0 /* bad net */
-#define ICMP_UNREACH_HOST 1 /* bad host */
-#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
-#define ICMP_UNREACH_PORT 3 /* bad port */
-#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
-#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
-#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
-#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
-#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
-#define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */
-#define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */
-#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
-#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
-#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
-#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
-#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
-#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
-#define ICMP_REDIRECT 5 /* shorter route, codes: */
-#define ICMP_REDIRECT_NET 0 /* for network */
-#define ICMP_REDIRECT_HOST 1 /* for host */
-#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
-#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
-#define ICMP_ECHO 8 /* echo service */
-#define ICMP_ROUTERADVERT 9 /* router advertisement */
-#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
-#define ICMP_TIMXCEED 11 /* time exceeded, code: */
-#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
-#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
-#define ICMP_PARAMPROB 12 /* ip header bad */
-#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
-#define ICMP_TSTAMP 13 /* timestamp request */
-#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
-#define ICMP_IREQ 15 /* information request */
-#define ICMP_IREQREPLY 16 /* information reply */
-#define ICMP_MASKREQ 17 /* address mask request */
-#define ICMP_MASKREPLY 18 /* address mask reply */
-
-#define ICMP_MAXTYPE 18
-
-#define ICMP_INFOTYPE(type) \
- ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
- (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
- (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
- (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
- (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
-
-#ifdef KERNEL
-void icmp_error __P((struct mbuf *, int, int, n_long, struct ifnet *));
-void icmp_input __P((struct mbuf *, int));
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/netinet/ip_input.c b/c/src/lib/libnetworking/netinet/ip_input.c
deleted file mode 100644
index 4cc141933f..0000000000
--- a/c/src/lib/libnetworking/netinet/ip_input.c
+++ /dev/null
@@ -1,1488 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)ip_input.c 8.2 (Berkeley) 1/4/94
- * $Id$
- * $ANA: ip_input.c,v 1.5 1996/09/18 14:34:59 wollman Exp $
- */
-
-#define _IP_VHL
-
-#include "opt_ipfw.h"
-
-#include <stddef.h>
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/route.h>
-#include <net/netisr.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <machine/in_cksum.h>
-
-#include <sys/socketvar.h>
-
-#ifdef IPFIREWALL
-#include <netinet/ip_fw.h>
-#endif
-
-int rsvp_on = 0;
-static int ip_rsvp_on;
-struct socket *ip_rsvpd;
-
-static int ipforwarding = 0;
-SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_RW,
- &ipforwarding, 0, "");
-
-static int ipsendredirects = 1; /* XXX */
-SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_RW,
- &ipsendredirects, 0, "");
-
-int ip_defttl = IPDEFTTL;
-SYSCTL_INT(_net_inet_ip, IPCTL_DEFTTL, ttl, CTLFLAG_RW,
- &ip_defttl, 0, "");
-
-static int ip_dosourceroute = 0;
-SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW,
- &ip_dosourceroute, 0, "");
-
-static int ip_acceptsourceroute = 0;
-SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute,
- CTLFLAG_RW, &ip_acceptsourceroute, 0, "");
-#ifdef DIAGNOSTIC
-static int ipprintfs = 0;
-#endif
-
-extern struct domain inetdomain;
-extern struct protosw inetsw[];
-u_char ip_protox[IPPROTO_MAX];
-static int ipqmaxlen = IFQ_MAXLEN;
-struct in_ifaddr *in_ifaddr; /* first inet address */
-struct ifqueue ipintrq;
-SYSCTL_INT(_net_inet_ip, IPCTL_INTRQMAXLEN, intr_queue_maxlen, CTLFLAG_RD,
- &ipintrq.ifq_maxlen, 0, "");
-SYSCTL_INT(_net_inet_ip, IPCTL_INTRQDROPS, intr_queue_drops, CTLFLAG_RD,
- &ipintrq.ifq_drops, 0, "");
-
-struct ipstat ipstat;
-
-/* Packet reassembly stuff */
-#define IPREASS_NHASH_LOG2 6
-#define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2)
-#define IPREASS_HMASK (IPREASS_NHASH - 1)
-#define IPREASS_HASH(x,y) \
- (((((x) & 0xF) | ((((x) >> 8) & 0xF) << 4)) ^ (y)) & IPREASS_HMASK)
-
-static struct ipq ipq[IPREASS_NHASH];
-static int nipq = 0; /* total # of reass queues */
-static int maxnipq;
-
-#ifdef IPCTL_DEFMTU
-SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW,
- &ip_mtu, 0, "");
-#endif
-
-#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1
-#undef COMPAT_IPFW
-#define COMPAT_IPFW 1
-#else
-#undef COMPAT_IPFW
-#endif
-
-#ifdef COMPAT_IPFW
-/* Firewall hooks */
-ip_fw_chk_t *ip_fw_chk_ptr;
-ip_fw_ctl_t *ip_fw_ctl_ptr;
-
-/* IP Network Address Translation (NAT) hooks */
-ip_nat_t *ip_nat_ptr;
-ip_nat_ctl_t *ip_nat_ctl_ptr;
-#endif
-
-/*
- * We need to save the IP options in case a protocol wants to respond
- * to an incoming packet over the same route if the packet got here
- * using IP source routing. This allows connection establishment and
- * maintenance when the remote end is on a network that is not known
- * to us.
- */
-static int ip_nhops = 0;
-static struct ip_srcrt {
- struct in_addr dst; /* final destination */
- char nop; /* one NOP to align */
- char srcopt[IPOPT_OFFSET + 1]; /* OPTVAL, OLEN and OFFSET */
- struct in_addr route[MAX_IPOPTLEN/sizeof(struct in_addr)];
-} ip_srcrt;
-
-#ifdef IPDIVERT
-/*
- * Shared variable between ip_input() and ip_reass() to communicate
- * about which packets, once assembled from fragments, get diverted,
- * and to which port.
- */
-static u_short frag_divert_port;
-#endif
-
-static void save_rte __P((u_char *, struct in_addr));
-static void ip_deq __P((struct ipasfrag *));
-static int ip_dooptions __P((struct mbuf *));
-static void ip_enq __P((struct ipasfrag *, struct ipasfrag *));
-static void ip_forward __P((struct mbuf *, int));
-static void ip_freef __P((struct ipq *));
-static struct ip *
- ip_reass __P((struct ipasfrag *, struct ipq *, struct ipq *));
-static struct in_ifaddr *
- ip_rtaddr __P((struct in_addr));
-void ipintr __P((void));
-/*
- * IP initialization: fill in IP protocol switch table.
- * All protocols not implemented in kernel go to raw IP protocol handler.
- */
-void
-ip_init()
-{
- register struct protosw *pr;
- register int i;
-
- pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW);
- if (pr == 0)
- panic("ip_init");
- for (i = 0; i < IPPROTO_MAX; i++)
- ip_protox[i] = pr - inetsw;
- for (pr = inetdomain.dom_protosw;
- pr < inetdomain.dom_protoswNPROTOSW; pr++)
- if (pr->pr_domain->dom_family == PF_INET &&
- pr->pr_protocol && pr->pr_protocol != IPPROTO_RAW)
- ip_protox[pr->pr_protocol] = pr - inetsw;
-
- for (i = 0; i < IPREASS_NHASH; i++)
- ipq[i].next = ipq[i].prev = &ipq[i];
-
- maxnipq = nmbclusters/4;
-
- ip_id = rtems_bsdnet_seconds_since_boot() & 0xffff;
- ipintrq.ifq_maxlen = ipqmaxlen;
-#ifdef IPFIREWALL
- ip_fw_init();
-#endif
-#ifdef IPNAT
- ip_nat_init();
-#endif
-
-}
-
-static struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET };
-static struct route ipforward_rt;
-
-/*
- * Ip input routine. Checksum and byte swap header. If fragmented
- * try to reassemble. Process options. Pass to next level.
- */
-void
-ip_input(struct mbuf *m)
-{
- struct ip *ip;
- struct ipq *fp;
- struct in_ifaddr *ia;
- int i, hlen;
- u_short sum;
-
-#ifdef DIAGNOSTIC
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("ip_input no HDR");
-#endif
- /*
- * If no IP addresses have been set yet but the interfaces
- * are receiving, can't do anything with incoming packets yet.
- */
- if (in_ifaddr == NULL)
- goto bad;
- ipstat.ips_total++;
-
- if (m->m_pkthdr.len < sizeof(struct ip))
- goto tooshort;
-
-#ifdef DIAGNOSTIC
- if (m->m_len < sizeof(struct ip))
- panic("ipintr mbuf too short");
-#endif
-
- if (m->m_len < sizeof (struct ip) &&
- (m = m_pullup(m, sizeof (struct ip))) == 0) {
- ipstat.ips_toosmall++;
- return;
- }
- ip = mtod(m, struct ip *);
-
- if (IP_VHL_V(ip->ip_vhl) != IPVERSION) {
- ipstat.ips_badvers++;
- goto bad;
- }
-
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
- if (hlen < sizeof(struct ip)) { /* minimum header length */
- ipstat.ips_badhlen++;
- goto bad;
- }
- if (hlen > m->m_len) {
- if ((m = m_pullup(m, hlen)) == 0) {
- ipstat.ips_badhlen++;
- return;
- }
- ip = mtod(m, struct ip *);
- }
- if (hlen == sizeof(struct ip)) {
- sum = in_cksum_hdr(ip);
- } else {
- sum = in_cksum(m, hlen);
- }
- if (sum) {
- ipstat.ips_badsum++;
- goto bad;
- }
-
- /*
- * Convert fields to host representation.
- */
- NTOHS(ip->ip_len);
- if (ip->ip_len < hlen) {
- ipstat.ips_badlen++;
- goto bad;
- }
- NTOHS(ip->ip_id);
- NTOHS(ip->ip_off);
-
- /*
- * Check that the amount of data in the buffers
- * is as at least much as the IP header would have us expect.
- * Trim mbufs if longer than we expect.
- * Drop packet if shorter than we expect.
- */
- if (m->m_pkthdr.len < ip->ip_len) {
-tooshort:
- ipstat.ips_tooshort++;
- goto bad;
- }
- if (m->m_pkthdr.len > ip->ip_len) {
- if (m->m_len == m->m_pkthdr.len) {
- m->m_len = ip->ip_len;
- m->m_pkthdr.len = ip->ip_len;
- } else
- m_adj(m, ip->ip_len - m->m_pkthdr.len);
- }
- /*
- * IpHack's section.
- * Right now when no processing on packet has done
- * and it is still fresh out of network we do our black
- * deals with it.
- * - Firewall: deny/allow/divert
- * - Xlate: translate packet's addr/port (NAT).
- * - Wrap: fake packet's addr/port <unimpl.>
- * - Encapsulate: put it in another IP and send out. <unimp.>
- */
-
-#ifdef COMPAT_IPFW
- if (ip_fw_chk_ptr) {
-#ifdef IPDIVERT
- u_short port;
-
- port = (*ip_fw_chk_ptr)(&ip, hlen, NULL, ip_divert_ignore, &m);
- ip_divert_ignore = 0;
- if (port) { /* Divert packet */
- frag_divert_port = port;
- goto ours;
- }
-#else
- /* If ipfw says divert, we have to just drop packet */
- if ((*ip_fw_chk_ptr)(&ip, hlen, NULL, 0, &m)) {
- m_freem(m);
- m = NULL;
- }
-#endif
- if (!m)
- return;
- }
-
- if (ip_nat_ptr && !(*ip_nat_ptr)(&ip, &m, m->m_pkthdr.rcvif, IP_NAT_IN))
- return;
-#endif
-
- /*
- * Process options and, if not destined for us,
- * ship it on. ip_dooptions returns 1 when an
- * error was detected (causing an icmp message
- * to be sent and the original packet to be freed).
- */
- ip_nhops = 0; /* for source routed packets */
- if (hlen > sizeof (struct ip) && ip_dooptions(m))
- return;
-
- /* greedy RSVP, snatches any PATH packet of the RSVP protocol and no
- * matter if it is destined to another node, or whether it is
- * a multicast one, RSVP wants it! and prevents it from being forwarded
- * anywhere else. Also checks if the rsvp daemon is running before
- * grabbing the packet.
- */
- if (rsvp_on && ip->ip_p==IPPROTO_RSVP)
- goto ours;
-
- /*
- * Check our list of addresses, to see if the packet is for us.
- */
- for (ia = in_ifaddr; ia; ia = ia->ia_next) {
-#define satosin(sa) ((struct sockaddr_in *)(sa))
-
- if (IA_SIN(ia)->sin_addr.s_addr == ip->ip_dst.s_addr)
- goto ours;
-#ifdef BOOTP_COMPAT
- if (IA_SIN(ia)->sin_addr.s_addr == INADDR_ANY)
- goto ours;
-#endif
- if (ia->ia_ifp && ia->ia_ifp->if_flags & IFF_BROADCAST) {
- if (satosin(&ia->ia_broadaddr)->sin_addr.s_addr ==
- ip->ip_dst.s_addr)
- goto ours;
- if (ip->ip_dst.s_addr == ia->ia_netbroadcast.s_addr)
- goto ours;
- }
- }
- if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- struct in_multi *inm;
- if (ip_mrouter) {
- /*
- * If we are acting as a multicast router, all
- * incoming multicast packets are passed to the
- * kernel-level multicast forwarding function.
- * The packet is returned (relatively) intact; if
- * ip_mforward() returns a non-zero value, the packet
- * must be discarded, else it may be accepted below.
- *
- * (The IP ident field is put in the same byte order
- * as expected when ip_mforward() is called from
- * ip_output().)
- */
- ip->ip_id = htons(ip->ip_id);
- if (ip_mforward(ip, m->m_pkthdr.rcvif, m, 0) != 0) {
- ipstat.ips_cantforward++;
- m_freem(m);
- return;
- }
- ip->ip_id = ntohs(ip->ip_id);
-
- /*
- * The process-level routing demon needs to receive
- * all multicast IGMP packets, whether or not this
- * host belongs to their destination groups.
- */
- if (ip->ip_p == IPPROTO_IGMP)
- goto ours;
- ipstat.ips_forward++;
- }
- /*
- * See if we belong to the destination multicast group on the
- * arrival interface.
- */
- IN_LOOKUP_MULTI(ip->ip_dst, m->m_pkthdr.rcvif, inm);
- if (inm == NULL) {
- ipstat.ips_cantforward++;
- m_freem(m);
- return;
- }
- goto ours;
- }
- if (ip->ip_dst.s_addr == (u_long)INADDR_BROADCAST)
- goto ours;
- if (ip->ip_dst.s_addr == INADDR_ANY)
- goto ours;
-
- /*
- * Not for us; forward if possible and desirable.
- */
- if (ipforwarding == 0) {
- ipstat.ips_cantforward++;
- m_freem(m);
- } else
- ip_forward(m, 0);
- return;
-
-ours:
-
- /*
- * If offset or IP_MF are set, must reassemble.
- * Otherwise, nothing need be done.
- * (We could look in the reassembly queue to see
- * if the packet was previously fragmented,
- * but it's not worth the time; just let them time out.)
- */
- if (ip->ip_off &~ (IP_DF | IP_RF)) {
- if (m->m_flags & M_EXT) { /* XXX */
- if ((m = m_pullup(m, sizeof (struct ip))) == 0) {
- ipstat.ips_toosmall++;
-#ifdef IPDIVERT
- frag_divert_port = 0;
-#endif
- return;
- }
- ip = mtod(m, struct ip *);
- }
- sum = IPREASS_HASH(ip->ip_src.s_addr, ip->ip_id);
- /*
- * Look for queue of fragments
- * of this datagram.
- */
- for (fp = ipq[sum].next; fp != &ipq[sum]; fp = fp->next)
- if (ip->ip_id == fp->ipq_id &&
- ip->ip_src.s_addr == fp->ipq_src.s_addr &&
- ip->ip_dst.s_addr == fp->ipq_dst.s_addr &&
- ip->ip_p == fp->ipq_p)
- goto found;
-
- fp = 0;
-
- /* check if there's a place for the new queue */
- if (nipq > maxnipq) {
- /*
- * drop something from the tail of the current queue
- * before proceeding further
- */
- if (ipq[sum].prev == &ipq[sum]) { /* gak */
- for (i = 0; i < IPREASS_NHASH; i++) {
- if (ipq[i].prev != &ipq[i]) {
- ip_freef(ipq[i].prev);
- break;
- }
- }
- } else
- ip_freef(ipq[sum].prev);
- }
-found:
- /*
- * Adjust ip_len to not reflect header,
- * set ip_mff if more fragments are expected,
- * convert offset of this to bytes.
- */
- ip->ip_len -= hlen;
- ((struct ipasfrag *)ip)->ipf_mff &= ~1;
- if (ip->ip_off & IP_MF)
- ((struct ipasfrag *)ip)->ipf_mff |= 1;
- ip->ip_off <<= 3;
-
- /*
- * If datagram marked as having more fragments
- * or if this is not the first fragment,
- * attempt reassembly; if it succeeds, proceed.
- */
- if (((struct ipasfrag *)ip)->ipf_mff & 1 || ip->ip_off) {
- ipstat.ips_fragments++;
- ip = ip_reass((struct ipasfrag *)ip, fp, &ipq[sum]);
- if (ip == 0)
- return;
- ipstat.ips_reassembled++;
- m = dtom(ip);
-#ifdef IPDIVERT
- if (frag_divert_port) {
- ip->ip_len += hlen;
- HTONS(ip->ip_len);
- HTONS(ip->ip_off);
- HTONS(ip->ip_id);
- ip->ip_sum = 0;
- ip->ip_sum = in_cksum_hdr(ip);
- NTOHS(ip->ip_id);
- NTOHS(ip->ip_off);
- NTOHS(ip->ip_len);
- ip->ip_len -= hlen;
- }
-#endif
- } else
- if (fp)
- ip_freef(fp);
- } else
- ip->ip_len -= hlen;
-
-#ifdef IPDIVERT
- /*
- * Divert reassembled packets to the divert protocol if required
- */
- if (frag_divert_port) {
- ipstat.ips_delivered++;
- ip_divert_port = frag_divert_port;
- frag_divert_port = 0;
- (*inetsw[ip_protox[IPPROTO_DIVERT]].pr_input)(m, hlen);
- return;
- }
-
- /* Don't let packets divert themselves */
- if (ip->ip_p == IPPROTO_DIVERT) {
- ipstat.ips_noproto++;
- goto bad;
- }
-#endif
-
- /*
- * Switch out to protocol's input routine.
- */
- ipstat.ips_delivered++;
- (*inetsw[ip_protox[ip->ip_p]].pr_input)(m, hlen);
- return;
-bad:
- m_freem(m);
-}
-
-/*
- * IP software interrupt routine - to go away sometime soon
- */
-void
-ipintr(void)
-{
- int s;
- struct mbuf *m;
-
- while(1) {
- s = splimp();
- IF_DEQUEUE(&ipintrq, m);
- splx(s);
- if (m == 0)
- return;
- ip_input(m);
- }
-}
-
-NETISR_SET(NETISR_IP, ipintr);
-
-/*
- * Take incoming datagram fragment and try to
- * reassemble it into whole datagram. If a chain for
- * reassembly of this datagram already exists, then it
- * is given as fp; otherwise have to make a chain.
- */
-static struct ip *
-ip_reass(ip, fp, where)
- register struct ipasfrag *ip;
- register struct ipq *fp;
- struct ipq *where;
-{
- register struct mbuf *m = dtom(ip);
- register struct ipasfrag *q;
- struct mbuf *t;
- int hlen = ip->ip_hl << 2;
- int i, next;
-
- /*
- * Presence of header sizes in mbufs
- * would confuse code below.
- */
- m->m_data += hlen;
- m->m_len -= hlen;
-
- /*
- * If first fragment to arrive, create a reassembly queue.
- */
- if (fp == 0) {
- if ((t = m_get(M_DONTWAIT, MT_FTABLE)) == NULL)
- goto dropfrag;
- fp = mtod(t, struct ipq *);
- insque(fp, where);
- nipq++;
- fp->ipq_ttl = IPFRAGTTL;
- fp->ipq_p = ip->ip_p;
- fp->ipq_id = ip->ip_id;
- fp->ipq_next = fp->ipq_prev = (struct ipasfrag *)fp;
- fp->ipq_src = ((struct ip *)ip)->ip_src;
- fp->ipq_dst = ((struct ip *)ip)->ip_dst;
-#ifdef IPDIVERT
- fp->ipq_divert = 0;
-#endif
- q = (struct ipasfrag *)fp;
- goto insert;
- }
-
- /*
- * Find a segment which begins after this one does.
- */
- for (q = fp->ipq_next; q != (struct ipasfrag *)fp; q = q->ipf_next)
- if (q->ip_off > ip->ip_off)
- break;
-
- /*
- * If there is a preceding segment, it may provide some of
- * our data already. If so, drop the data from the incoming
- * segment. If it provides all of our data, drop us.
- */
- if (q->ipf_prev != (struct ipasfrag *)fp) {
- i = q->ipf_prev->ip_off + q->ipf_prev->ip_len - ip->ip_off;
- if (i > 0) {
- if (i >= ip->ip_len)
- goto dropfrag;
- m_adj(dtom(ip), i);
- ip->ip_off += i;
- ip->ip_len -= i;
- }
- }
-
- /*
- * While we overlap succeeding segments trim them or,
- * if they are completely covered, dequeue them.
- */
- while (q != (struct ipasfrag *)fp && ip->ip_off + ip->ip_len > q->ip_off) {
- struct mbuf *m0;
-
- i = (ip->ip_off + ip->ip_len) - q->ip_off;
- if (i < q->ip_len) {
- q->ip_len -= i;
- q->ip_off += i;
- m_adj(dtom(q), i);
- break;
- }
- m0 = dtom(q);
- q = q->ipf_next;
- ip_deq(q->ipf_prev);
- m_freem(m0);
- }
-
-insert:
-
-#ifdef IPDIVERT
- /*
- * Any fragment diverting causes the whole packet to divert
- */
- if (frag_divert_port != 0)
- fp->ipq_divert = frag_divert_port;
- frag_divert_port = 0;
-#endif
-
- /*
- * Stick new segment in its place;
- * check for complete reassembly.
- */
- ip_enq(ip, q->ipf_prev);
- next = 0;
- for (q = fp->ipq_next; q != (struct ipasfrag *)fp; q = q->ipf_next) {
- if (q->ip_off != next)
- return (0);
- next += q->ip_len;
- }
- if (q->ipf_prev->ipf_mff & 1)
- return (0);
-
- /*
- * Reassembly is complete. Make sure the packet is a sane size.
- */
- if (next + (IP_VHL_HL(((struct ip *)fp->ipq_next)->ip_vhl) << 2)
- > IP_MAXPACKET) {
- ipstat.ips_toolong++;
- ip_freef(fp);
- return (0);
- }
-
- /*
- * Concatenate fragments.
- */
- q = fp->ipq_next;
- m = dtom(q);
- t = m->m_next;
- m->m_next = 0;
- m_cat(m, t);
- q = q->ipf_next;
- while (q != (struct ipasfrag *)fp) {
- t = dtom(q);
- q = q->ipf_next;
- m_cat(m, t);
- }
-
-#ifdef IPDIVERT
- /*
- * Record divert port for packet, if any
- */
- frag_divert_port = fp->ipq_divert;
-#endif
-
- /*
- * Create header for new ip packet by
- * modifying header of first packet;
- * dequeue and discard fragment reassembly header.
- * Make header visible.
- */
- ip = fp->ipq_next;
- ip->ip_len = next;
- ip->ipf_mff &= ~1;
- ((struct ip *)ip)->ip_src = fp->ipq_src;
- ((struct ip *)ip)->ip_dst = fp->ipq_dst;
- remque(fp);
- nipq--;
- (void) m_free(dtom(fp));
- m = dtom(ip);
- m->m_len += (ip->ip_hl << 2);
- m->m_data -= (ip->ip_hl << 2);
- /* some debugging cruft by sklower, below, will go away soon */
- if (m->m_flags & M_PKTHDR) { /* XXX this should be done elsewhere */
- register int plen = 0;
- for (t = m; m; m = m->m_next)
- plen += m->m_len;
- t->m_pkthdr.len = plen;
- }
- return ((struct ip *)ip);
-
-dropfrag:
- ipstat.ips_fragdropped++;
- m_freem(m);
- return (0);
-}
-
-/*
- * Free a fragment reassembly header and all
- * associated datagrams.
- */
-static void
-ip_freef(fp)
- struct ipq *fp;
-{
- register struct ipasfrag *q, *p;
-
- for (q = fp->ipq_next; q != (struct ipasfrag *)fp; q = p) {
- p = q->ipf_next;
- ip_deq(q);
- m_freem(dtom(q));
- }
- remque(fp);
- (void) m_free(dtom(fp));
- nipq--;
-}
-
-/*
- * Put an ip fragment on a reassembly chain.
- * Like insque, but pointers in middle of structure.
- */
-static void
-ip_enq(p, prev)
- register struct ipasfrag *p, *prev;
-{
-
- p->ipf_prev = prev;
- p->ipf_next = prev->ipf_next;
- prev->ipf_next->ipf_prev = p;
- prev->ipf_next = p;
-}
-
-/*
- * To ip_enq as remque is to insque.
- */
-static void
-ip_deq(p)
- register struct ipasfrag *p;
-{
-
- p->ipf_prev->ipf_next = p->ipf_next;
- p->ipf_next->ipf_prev = p->ipf_prev;
-}
-
-/*
- * IP timer processing;
- * if a timer expires on a reassembly
- * queue, discard it.
- */
-void
-ip_slowtimo()
-{
- register struct ipq *fp;
- int s = splnet();
- int i;
-
- for (i = 0; i < IPREASS_NHASH; i++) {
- fp = ipq[i].next;
- if (fp == 0)
- continue;
- while (fp != &ipq[i]) {
- --fp->ipq_ttl;
- fp = fp->next;
- if (fp->prev->ipq_ttl == 0) {
- ipstat.ips_fragtimeout++;
- ip_freef(fp->prev);
- }
- }
- }
- splx(s);
-}
-
-/*
- * Drain off all datagram fragments.
- */
-void
-ip_drain()
-{
- int i;
-
- for (i = 0; i < IPREASS_NHASH; i++) {
- while (ipq[i].next != &ipq[i]) {
- ipstat.ips_fragdropped++;
- ip_freef(ipq[i].next);
- }
- }
- in_rtqdrain();
-}
-
-/*
- * Do option processing on a datagram,
- * possibly discarding it if bad options are encountered,
- * or forwarding it if source-routed.
- * Returns 1 if packet has been forwarded/freed,
- * 0 if the packet should be processed further.
- */
-static int
-ip_dooptions(m)
- struct mbuf *m;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register u_char *cp;
- register struct ip_timestamp *ipt;
- register struct in_ifaddr *ia;
- int opt, optlen, cnt, off, code, type = ICMP_PARAMPROB, forward = 0;
- struct in_addr *sin, dst;
- n_time ntime;
-
- dst = ip->ip_dst;
- cp = (u_char *)(ip + 1);
- cnt = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof (struct ip);
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[IPOPT_OLEN];
- if (optlen <= 0 || optlen > cnt) {
- code = &cp[IPOPT_OLEN] - (u_char *)ip;
- goto bad;
- }
- }
- switch (opt) {
-
- default:
- break;
-
- /*
- * Source routing with record.
- * Find interface with current destination address.
- * If none on this machine then drop if strictly routed,
- * or do nothing if loosely routed.
- * Record interface address and bring up next address
- * component. If strictly routed make sure next
- * address is on directly accessible net.
- */
- case IPOPT_LSRR:
- case IPOPT_SSRR:
- if ((off = cp[IPOPT_OFFSET]) < IPOPT_MINOFF) {
- code = &cp[IPOPT_OFFSET] - (u_char *)ip;
- goto bad;
- }
- ipaddr.sin_addr = ip->ip_dst;
- ia = (struct in_ifaddr *)
- ifa_ifwithaddr((struct sockaddr *)&ipaddr);
- if (ia == 0) {
- if (opt == IPOPT_SSRR) {
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_SRCFAIL;
- goto bad;
- }
- if (!ip_dosourceroute)
- goto nosourcerouting;
- /*
- * Loose routing, and not at next destination
- * yet; nothing to do except forward.
- */
- break;
- }
- off--; /* 0 origin */
- if (off > optlen - sizeof(struct in_addr)) {
- /*
- * End of source route. Should be for us.
- */
- if (!ip_acceptsourceroute)
- goto nosourcerouting;
- save_rte(cp, ip->ip_src);
- break;
- }
-
- if (!ip_dosourceroute) {
- char buf[4*sizeof "123"];
-
-nosourcerouting:
- strcpy(buf, inet_ntoa(ip->ip_dst));
- log(LOG_WARNING,
- "attempted source route from %s to %s\n",
- inet_ntoa(ip->ip_src), buf);
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_SRCFAIL;
- goto bad;
- }
-
- /*
- * locate outgoing interface
- */
- (void)memcpy(&ipaddr.sin_addr, cp + off,
- sizeof(ipaddr.sin_addr));
-
- if (opt == IPOPT_SSRR) {
-#define INA struct in_ifaddr *
-#define SA struct sockaddr *
- if ((ia = (INA)ifa_ifwithdstaddr((SA)&ipaddr)) == 0)
- ia = (INA)ifa_ifwithnet((SA)&ipaddr);
- } else
- ia = ip_rtaddr(ipaddr.sin_addr);
- if (ia == 0) {
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_SRCFAIL;
- goto bad;
- }
- ip->ip_dst = ipaddr.sin_addr;
- (void)memcpy(cp + off, &(IA_SIN(ia)->sin_addr),
- sizeof(struct in_addr));
- cp[IPOPT_OFFSET] += sizeof(struct in_addr);
- /*
- * Let ip_intr's mcast routing check handle mcast pkts
- */
- forward = !IN_MULTICAST(ntohl(ip->ip_dst.s_addr));
- break;
-
- case IPOPT_RR:
- if ((off = cp[IPOPT_OFFSET]) < IPOPT_MINOFF) {
- code = &cp[IPOPT_OFFSET] - (u_char *)ip;
- goto bad;
- }
- /*
- * If no space remains, ignore.
- */
- off--; /* 0 origin */
- if (off > optlen - sizeof(struct in_addr))
- break;
- (void)memcpy(&ipaddr.sin_addr, &ip->ip_dst,
- sizeof(ipaddr.sin_addr));
- /*
- * locate outgoing interface; if we're the destination,
- * use the incoming interface (should be same).
- */
- if ((ia = (INA)ifa_ifwithaddr((SA)&ipaddr)) == 0 &&
- (ia = ip_rtaddr(ipaddr.sin_addr)) == 0) {
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_HOST;
- goto bad;
- }
- (void)memcpy(cp + off, &(IA_SIN(ia)->sin_addr),
- sizeof(struct in_addr));
- cp[IPOPT_OFFSET] += sizeof(struct in_addr);
- break;
-
- case IPOPT_TS:
- code = cp - (u_char *)ip;
- ipt = (struct ip_timestamp *)cp;
- if (ipt->ipt_len < 5)
- goto bad;
- if (ipt->ipt_ptr > ipt->ipt_len - sizeof (long)) {
- if (++ipt->ipt_oflw == 0)
- goto bad;
- break;
- }
- sin = (struct in_addr *)(cp + ipt->ipt_ptr - 1);
- switch (ipt->ipt_flg) {
-
- case IPOPT_TS_TSONLY:
- break;
-
- case IPOPT_TS_TSANDADDR:
- if (ipt->ipt_ptr + sizeof(n_time) +
- sizeof(struct in_addr) > ipt->ipt_len)
- goto bad;
- ipaddr.sin_addr = dst;
- ia = (INA)ifaof_ifpforaddr((SA)&ipaddr,
- m->m_pkthdr.rcvif);
- if (ia == 0)
- continue;
- (void)memcpy(sin, &IA_SIN(ia)->sin_addr,
- sizeof(struct in_addr));
- ipt->ipt_ptr += sizeof(struct in_addr);
- break;
-
- case IPOPT_TS_PRESPEC:
- if (ipt->ipt_ptr + sizeof(n_time) +
- sizeof(struct in_addr) > ipt->ipt_len)
- goto bad;
- (void)memcpy(&ipaddr.sin_addr, sin,
- sizeof(struct in_addr));
- if (ifa_ifwithaddr((SA)&ipaddr) == 0)
- continue;
- ipt->ipt_ptr += sizeof(struct in_addr);
- break;
-
- default:
- goto bad;
- }
- ntime = iptime();
- (void)memcpy(cp + ipt->ipt_ptr - 1, &ntime,
- sizeof(n_time));
- ipt->ipt_ptr += sizeof(n_time);
- }
- }
- if (forward && ipforwarding) {
- ip_forward(m, 1);
- return (1);
- }
- return (0);
-bad:
- ip->ip_len -= IP_VHL_HL(ip->ip_vhl) << 2; /* XXX icmp_error adds in hdr length */
- icmp_error(m, type, code, 0, 0);
- ipstat.ips_badoptions++;
- return (1);
-}
-
-/*
- * Given address of next destination (final or next hop),
- * return internet address info of interface to be used to get there.
- */
-static struct in_ifaddr *
-ip_rtaddr(dst)
- struct in_addr dst;
-{
- register struct sockaddr_in *sin;
-
- sin = (struct sockaddr_in *) &ipforward_rt.ro_dst;
-
- if (ipforward_rt.ro_rt == 0 || dst.s_addr != sin->sin_addr.s_addr) {
- if (ipforward_rt.ro_rt) {
- RTFREE(ipforward_rt.ro_rt);
- ipforward_rt.ro_rt = 0;
- }
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_addr = dst;
-
- rtalloc_ign(&ipforward_rt, RTF_PRCLONING);
- }
- if (ipforward_rt.ro_rt == 0)
- return ((struct in_ifaddr *)0);
- return ((struct in_ifaddr *) ipforward_rt.ro_rt->rt_ifa);
-}
-
-/*
- * Save incoming source route for use in replies,
- * to be picked up later by ip_srcroute if the receiver is interested.
- */
-void
-save_rte(option, dst)
- u_char *option;
- struct in_addr dst;
-{
- unsigned olen;
-
- olen = option[IPOPT_OLEN];
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("save_rte: olen %d\n", olen);
-#endif
- if (olen > sizeof(ip_srcrt) - (1 + sizeof(dst)))
- return;
- bcopy(option, ip_srcrt.srcopt, olen);
- ip_nhops = (olen - IPOPT_OFFSET - 1) / sizeof(struct in_addr);
- ip_srcrt.dst = dst;
-}
-
-/*
- * Retrieve incoming source route for use in replies,
- * in the same form used by setsockopt.
- * The first hop is placed before the options, will be removed later.
- */
-struct mbuf *
-ip_srcroute()
-{
- register struct in_addr *p, *q;
- register struct mbuf *m;
-
- if (ip_nhops == 0)
- return ((struct mbuf *)0);
- m = m_get(M_DONTWAIT, MT_SOOPTS);
- if (m == 0)
- return ((struct mbuf *)0);
-
-#define OPTSIZ (sizeof(ip_srcrt.nop) + sizeof(ip_srcrt.srcopt))
-
- /* length is (nhops+1)*sizeof(addr) + sizeof(nop + srcrt header) */
- m->m_len = ip_nhops * sizeof(struct in_addr) + sizeof(struct in_addr) +
- OPTSIZ;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("ip_srcroute: nhops %d mlen %d", ip_nhops, m->m_len);
-#endif
-
- /*
- * First save first hop for return route
- */
- p = &ip_srcrt.route[ip_nhops - 1];
- *(mtod(m, struct in_addr *)) = *p--;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf(" hops %lx", ntohl(mtod(m, struct in_addr *)->s_addr));
-#endif
-
- /*
- * Copy option fields and padding (nop) to mbuf.
- */
- ip_srcrt.nop = IPOPT_NOP;
- ip_srcrt.srcopt[IPOPT_OFFSET] = IPOPT_MINOFF;
- (void)memcpy(mtod(m, caddr_t) + sizeof(struct in_addr),
- &ip_srcrt.nop, OPTSIZ);
- q = (struct in_addr *)(mtod(m, caddr_t) +
- sizeof(struct in_addr) + OPTSIZ);
-#undef OPTSIZ
- /*
- * Record return path as an IP source route,
- * reversing the path (pointers are now aligned).
- */
- while (p >= ip_srcrt.route) {
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf(" %lx", ntohl(q->s_addr));
-#endif
- *q++ = *p--;
- }
- /*
- * Last hop goes to final destination.
- */
- *q = ip_srcrt.dst;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf(" %lx\n", ntohl(q->s_addr));
-#endif
- return (m);
-}
-
-/*
- * Strip out IP options, at higher
- * level protocol in the kernel.
- * Second argument is buffer to which options
- * will be moved, and return value is their length.
- * XXX should be deleted; last arg currently ignored.
- */
-void
-ip_stripoptions(m, mopt)
- register struct mbuf *m;
- struct mbuf *mopt;
-{
- register int i;
- struct ip *ip = mtod(m, struct ip *);
- register caddr_t opts;
- int olen;
-
- olen = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof (struct ip);
- opts = (caddr_t)(ip + 1);
- i = m->m_len - (sizeof (struct ip) + olen);
- bcopy(opts + olen, opts, (unsigned)i);
- m->m_len -= olen;
- if (m->m_flags & M_PKTHDR)
- m->m_pkthdr.len -= olen;
- ip->ip_vhl = IP_MAKE_VHL(IPVERSION, sizeof(struct ip) >> 2);
-}
-
-u_char inetctlerrmap[PRC_NCMDS] = {
- 0, 0, 0, 0,
- 0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH,
- EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED,
- EMSGSIZE, EHOSTUNREACH, 0, 0,
- 0, 0, 0, 0,
- ENOPROTOOPT
-};
-
-/*
- * Forward a packet. If some error occurs return the sender
- * an icmp packet. Note we can't always generate a meaningful
- * icmp message because icmp doesn't have a large enough repertoire
- * of codes and types.
- *
- * If not forwarding, just drop the packet. This could be confusing
- * if ipforwarding was zero but some routing protocol was advancing
- * us as a gateway to somewhere. However, we must let the routing
- * protocol deal with that.
- *
- * The srcrt parameter indicates whether the packet is being forwarded
- * via a source route.
- */
-static void
-ip_forward(m, srcrt)
- struct mbuf *m;
- int srcrt;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register struct sockaddr_in *sin;
- register struct rtentry *rt;
- int error, type = 0, code = 0;
- struct mbuf *mcopy;
- n_long dest;
- struct ifnet *destifp;
-
- dest = 0;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("forward: src %lx dst %lx ttl %x\n",
- ip->ip_src.s_addr, ip->ip_dst.s_addr, ip->ip_ttl);
-#endif
-
-
- if (m->m_flags & M_BCAST || in_canforward(ip->ip_dst) == 0) {
- ipstat.ips_cantforward++;
- m_freem(m);
- return;
- }
- HTONS(ip->ip_id);
- if (ip->ip_ttl <= IPTTLDEC) {
- icmp_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, dest, 0);
- return;
- }
- ip->ip_ttl -= IPTTLDEC;
-
- sin = (struct sockaddr_in *)&ipforward_rt.ro_dst;
- if ((rt = ipforward_rt.ro_rt) == 0 ||
- ip->ip_dst.s_addr != sin->sin_addr.s_addr) {
- if (ipforward_rt.ro_rt) {
- RTFREE(ipforward_rt.ro_rt);
- ipforward_rt.ro_rt = 0;
- }
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_addr = ip->ip_dst;
-
- rtalloc_ign(&ipforward_rt, RTF_PRCLONING);
- if (ipforward_rt.ro_rt == 0) {
- icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, dest, 0);
- return;
- }
- rt = ipforward_rt.ro_rt;
- }
-
- /*
- * Save at most 64 bytes of the packet in case
- * we need to generate an ICMP message to the src.
- */
- mcopy = m_copy(m, 0, imin((int)ip->ip_len, 64));
-
- /*
- * If forwarding packet using same interface that it came in on,
- * perhaps should send a redirect to sender to shortcut a hop.
- * Only send redirect if source is sending directly to us,
- * and if packet was not source routed (or has any options).
- * Also, don't send redirect if forwarding using a default route
- * or a route modified by a redirect.
- */
-#define satosin(sa) ((struct sockaddr_in *)(sa))
- if (rt->rt_ifp == m->m_pkthdr.rcvif &&
- (rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0 &&
- satosin(rt_key(rt))->sin_addr.s_addr != 0 &&
- ipsendredirects && !srcrt) {
-#define RTA(rt) ((struct in_ifaddr *)(rt->rt_ifa))
- u_long src = ntohl(ip->ip_src.s_addr);
-
- if (RTA(rt) &&
- (src & RTA(rt)->ia_subnetmask) == RTA(rt)->ia_subnet) {
- if (rt->rt_flags & RTF_GATEWAY)
- dest = satosin(rt->rt_gateway)->sin_addr.s_addr;
- else
- dest = ip->ip_dst.s_addr;
- /* Router requirements says to only send host redirects */
- type = ICMP_REDIRECT;
- code = ICMP_REDIRECT_HOST;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("redirect (%d) to %lx\n", code, (u_long)dest);
-#endif
- }
- }
-
- error = ip_output(m, (struct mbuf *)0, &ipforward_rt,
- IP_FORWARDING, 0);
- if (error)
- ipstat.ips_cantforward++;
- else {
- ipstat.ips_forward++;
- if (type)
- ipstat.ips_redirectsent++;
- else {
- if (mcopy)
- m_freem(mcopy);
- return;
- }
- }
- if (mcopy == NULL)
- return;
- destifp = NULL;
-
- switch (error) {
-
- case 0: /* forwarded, but need redirect */
- /* type, code set above */
- break;
-
- case ENETUNREACH: /* shouldn't happen, checked above */
- case EHOSTUNREACH:
- case ENETDOWN:
- case EHOSTDOWN:
- default:
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_HOST;
- break;
-
- case EMSGSIZE:
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_NEEDFRAG;
- if (ipforward_rt.ro_rt)
- destifp = ipforward_rt.ro_rt->rt_ifp;
- ipstat.ips_cantfrag++;
- break;
-
- case ENOBUFS:
- type = ICMP_SOURCEQUENCH;
- code = 0;
- break;
- }
- icmp_error(mcopy, type, code, dest, destifp);
-}
-
-void
-ip_savecontrol(inp, mp, ip, m)
- register struct inpcb *inp;
- register struct mbuf **mp;
- register struct ip *ip;
- register struct mbuf *m;
-{
- if (inp->inp_socket->so_options & SO_TIMESTAMP) {
- struct timeval tv;
-
- microtime(&tv);
- *mp = sbcreatecontrol((caddr_t) &tv, sizeof(tv),
- SCM_TIMESTAMP, SOL_SOCKET);
- if (*mp)
- mp = &(*mp)->m_next;
- }
- if (inp->inp_flags & INP_RECVDSTADDR) {
- *mp = sbcreatecontrol((caddr_t) &ip->ip_dst,
- sizeof(struct in_addr), IP_RECVDSTADDR, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
-#ifdef notyet
- /* XXX
- * Moving these out of udp_input() made them even more broken
- * than they already were.
- */
- /* options were tossed already */
- if (inp->inp_flags & INP_RECVOPTS) {
- *mp = sbcreatecontrol((caddr_t) opts_deleted_above,
- sizeof(struct in_addr), IP_RECVOPTS, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
- /* ip_srcroute doesn't do what we want here, need to fix */
- if (inp->inp_flags & INP_RECVRETOPTS) {
- *mp = sbcreatecontrol((caddr_t) ip_srcroute(),
- sizeof(struct in_addr), IP_RECVRETOPTS, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
-#endif
- if (inp->inp_flags & INP_RECVIF) {
- struct sockaddr_dl sdl;
-
- sdl.sdl_len = offsetof(struct sockaddr_dl, sdl_data[0]);
- sdl.sdl_family = AF_LINK;
- sdl.sdl_index = m->m_pkthdr.rcvif ?
- m->m_pkthdr.rcvif->if_index : 0;
- sdl.sdl_nlen = sdl.sdl_alen = sdl.sdl_slen = 0;
- *mp = sbcreatecontrol((caddr_t) &sdl, sdl.sdl_len,
- IP_RECVIF, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
-}
-
-int
-ip_rsvp_init(struct socket *so)
-{
- if (so->so_type != SOCK_RAW ||
- so->so_proto->pr_protocol != IPPROTO_RSVP)
- return EOPNOTSUPP;
-
- if (ip_rsvpd != NULL)
- return EADDRINUSE;
-
- ip_rsvpd = so;
- /*
- * This may seem silly, but we need to be sure we don't over-increment
- * the RSVP counter, in case something slips up.
- */
- if (!ip_rsvp_on) {
- ip_rsvp_on = 1;
- rsvp_on++;
- }
-
- return 0;
-}
-
-int
-ip_rsvp_done(void)
-{
- ip_rsvpd = NULL;
- /*
- * This may seem silly, but we need to be sure we don't over-decrement
- * the RSVP counter, in case something slips up.
- */
- if (ip_rsvp_on) {
- ip_rsvp_on = 0;
- rsvp_on--;
- }
- return 0;
-}
diff --git a/c/src/lib/libnetworking/netinet/ip_mroute.c b/c/src/lib/libnetworking/netinet/ip_mroute.c
deleted file mode 100644
index 662d695dfe..0000000000
--- a/c/src/lib/libnetworking/netinet/ip_mroute.c
+++ /dev/null
@@ -1,2302 +0,0 @@
-/*
- * IP multicast forwarding procedures
- *
- * Written by David Waitzman, BBN Labs, August 1988.
- * Modified by Steve Deering, Stanford, February 1989.
- * Modified by Mark J. Steiglitz, Stanford, May, 1991
- * Modified by Van Jacobson, LBL, January 1993
- * Modified by Ajit Thyagarajan, PARC, August 1993
- * Modified by Bill Fenner, PARC, April 1995
- *
- * MROUTING Revision: 3.5
- * $Id$
- */
-
-#include "opt_mrouting.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
-#include <sys/ioctl.h>
-#include <sys/syslog.h>
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/igmp.h>
-#include <netinet/igmp_var.h>
-#include <netinet/ip_mroute.h>
-#include <netinet/udp.h>
-
-#ifndef NTOHL
-#if BYTE_ORDER != BIG_ENDIAN
-#define NTOHL(d) ((d) = ntohl((d)))
-#define NTOHS(d) ((d) = ntohs((u_short)(d)))
-#define HTONL(d) ((d) = htonl((d)))
-#define HTONS(d) ((d) = htons((u_short)(d)))
-#else
-#define NTOHL(d)
-#define NTOHS(d)
-#define HTONL(d)
-#define HTONS(d)
-#endif
-#endif
-
-#ifndef MROUTING
-extern u_long _ip_mcast_src __P((int vifi));
-extern int _ip_mforward __P((struct ip *ip, struct ifnet *ifp,
- struct mbuf *m, struct ip_moptions *imo));
-extern int _ip_mrouter_done __P((void));
-extern int _ip_mrouter_get __P((int cmd, struct socket *so,
- struct mbuf **m));
-extern int _ip_mrouter_set __P((int cmd, struct socket *so,
- struct mbuf *m));
-extern int _mrt_ioctl __P((int req, caddr_t data, struct proc *p));
-
-/*
- * Dummy routines and globals used when multicast routing is not compiled in.
- */
-
-struct socket *ip_mrouter = NULL;
-/* static u_int ip_mrtproto = 0; */
-/* static struct mrtstat mrtstat; */
-u_int rsvpdebug = 0;
-
-int
-_ip_mrouter_set(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf *m;
-{
- return(EOPNOTSUPP);
-}
-
-int (*ip_mrouter_set)(int, struct socket *, struct mbuf *) = _ip_mrouter_set;
-
-
-int
-_ip_mrouter_get(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf **m;
-{
- return(EOPNOTSUPP);
-}
-
-int (*ip_mrouter_get)(int, struct socket *, struct mbuf **) = _ip_mrouter_get;
-
-int
-_ip_mrouter_done()
-{
- return(0);
-}
-
-int (*ip_mrouter_done)(void) = _ip_mrouter_done;
-
-int
-_ip_mforward(ip, ifp, m, imo)
- struct ip *ip;
- struct ifnet *ifp;
- struct mbuf *m;
- struct ip_moptions *imo;
-{
- return(0);
-}
-
-int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *,
- struct ip_moptions *) = _ip_mforward;
-
-int
-_mrt_ioctl(int req, caddr_t data, struct proc *p)
-{
- return EOPNOTSUPP;
-}
-
-int (*mrt_ioctl)(int, caddr_t, struct proc *) = _mrt_ioctl;
-
-void
-rsvp_input(m, iphlen) /* XXX must fixup manually */
- struct mbuf *m;
- int iphlen;
-{
- /* Can still get packets with rsvp_on = 0 if there is a local member
- * of the group to which the RSVP packet is addressed. But in this
- * case we want to throw the packet away.
- */
- if (!rsvp_on) {
- m_freem(m);
- return;
- }
-
- if (ip_rsvpd != NULL) {
- if (rsvpdebug)
- printf("rsvp_input: Sending packet up old-style socket\n");
- rip_input(m, iphlen);
- return;
- }
- /* Drop the packet */
- m_freem(m);
-}
-
-void ipip_input(struct mbuf *m, int iphlen) { /* XXX must fixup manually */
- rip_input(m, iphlen);
-}
-
-int (*legal_vif_num)(int) = 0;
-
-/*
- * This should never be called, since IP_MULTICAST_VIF should fail, but
- * just in case it does get called, the code a little lower in ip_output
- * will assign the packet a local address.
- */
-u_long
-_ip_mcast_src(int vifi) { return INADDR_ANY; }
-u_long (*ip_mcast_src)(int) = _ip_mcast_src;
-
-int
-ip_rsvp_vif_init(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- return(EINVAL);
-}
-
-int
-ip_rsvp_vif_done(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- return(EINVAL);
-}
-
-void
-ip_rsvp_force_done(so)
- struct socket *so;
-{
- return;
-}
-
-#else /* MROUTING */
-
-#define M_HASCL(m) ((m)->m_flags & M_EXT)
-
-#define INSIZ sizeof(struct in_addr)
-#define same(a1, a2) \
- (bcmp((caddr_t)(a1), (caddr_t)(a2), INSIZ) == 0)
-
-#define MT_MRTABLE MT_RTABLE /* since nothing else uses it */
-
-/*
- * Globals. All but ip_mrouter and ip_mrtproto could be static,
- * except for netstat or debugging purposes.
- */
-#ifndef MROUTE_LKM
-struct socket *ip_mrouter = NULL;
-struct mrtstat mrtstat;
-
-int ip_mrtproto = IGMP_DVMRP; /* for netstat only */
-#else /* MROUTE_LKM */
-extern void X_ipip_input __P((struct mbuf *m, int iphlen));
-extern struct mrtstat mrtstat;
-static int ip_mrtproto;
-#endif
-
-#define NO_RTE_FOUND 0x1
-#define RTE_FOUND 0x2
-
-static struct mbuf *mfctable[MFCTBLSIZ];
-static u_char nexpire[MFCTBLSIZ];
-static struct vif viftable[MAXVIFS];
-static u_int mrtdebug = 0; /* debug level */
-#define DEBUG_MFC 0x02
-#define DEBUG_FORWARD 0x04
-#define DEBUG_EXPIRE 0x08
-#define DEBUG_XMIT 0x10
-static u_int tbfdebug = 0; /* tbf debug level */
-static u_int rsvpdebug = 0; /* rsvp debug level */
-
-#define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */
-#define UPCALL_EXPIRE 6 /* number of timeouts */
-
-/*
- * Define the token bucket filter structures
- * tbftable -> each vif has one of these for storing info
- */
-
-static struct tbf tbftable[MAXVIFS];
-#define TBF_REPROCESS (hz / 100) /* 100x / second */
-
-/*
- * 'Interfaces' associated with decapsulator (so we can tell
- * packets that went through it from ones that get reflected
- * by a broken gateway). These interfaces are never linked into
- * the system ifnet list & no routes point to them. I.e., packets
- * can't be sent this way. They only exist as a placeholder for
- * multicast source verification.
- */
-static struct ifnet multicast_decap_if[MAXVIFS];
-
-#define ENCAP_TTL 64
-#define ENCAP_PROTO IPPROTO_IPIP /* 4 */
-
-/* prototype IP hdr for encapsulated packets */
-static struct ip multicast_encap_iphdr = {
-#if BYTE_ORDER == LITTLE_ENDIAN
- sizeof(struct ip) >> 2, IPVERSION,
-#else
- IPVERSION, sizeof(struct ip) >> 2,
-#endif
- 0, /* tos */
- sizeof(struct ip), /* total length */
- 0, /* id */
- 0, /* frag offset */
- ENCAP_TTL, ENCAP_PROTO,
- 0, /* checksum */
-};
-
-/*
- * Private variables.
- */
-static vifi_t numvifs = 0;
-static int have_encap_tunnel = 0;
-
-/*
- * one-back cache used by ipip_input to locate a tunnel's vif
- * given a datagram's src ip address.
- */
-static u_long last_encap_src;
-static struct vif *last_encap_vif;
-
-static u_long X_ip_mcast_src __P((int vifi));
-static int X_ip_mforward __P((struct ip *ip, struct ifnet *ifp, struct mbuf *m, struct ip_moptions *imo));
-static int X_ip_mrouter_done __P((void));
-static int X_ip_mrouter_get __P((int cmd, struct socket *so, struct mbuf **m));
-static int X_ip_mrouter_set __P((int cmd, struct socket *so, struct mbuf *m));
-static int X_legal_vif_num __P((int vif));
-static int X_mrt_ioctl __P((int cmd, caddr_t data));
-
-static int get_sg_cnt(struct sioc_sg_req *);
-static int get_vif_cnt(struct sioc_vif_req *);
-static int ip_mrouter_init(struct socket *, struct mbuf *);
-static int add_vif(struct vifctl *);
-static int del_vif(vifi_t *);
-static int add_mfc(struct mfcctl *);
-static int del_mfc(struct mfcctl *);
-static int socket_send(struct socket *, struct mbuf *, struct sockaddr_in *);
-static int get_version(struct mbuf *);
-static int get_assert(struct mbuf *);
-static int set_assert(int *);
-static void expire_upcalls(void *);
-static int ip_mdq(struct mbuf *, struct ifnet *, struct mfc *,
- vifi_t);
-static void phyint_send(struct ip *, struct vif *, struct mbuf *);
-static void encap_send(struct ip *, struct vif *, struct mbuf *);
-static void tbf_control(struct vif *, struct mbuf *, struct ip *, u_long);
-static void tbf_queue(struct vif *, struct mbuf *);
-static void tbf_process_q(struct vif *);
-static void tbf_reprocess_q(void *);
-static int tbf_dq_sel(struct vif *, struct ip *);
-static void tbf_send_packet(struct vif *, struct mbuf *);
-static void tbf_update_tokens(struct vif *);
-static int priority(struct vif *, struct ip *);
-void multiencap_decap(struct mbuf *);
-
-/*
- * whether or not special PIM assert processing is enabled.
- */
-static int pim_assert;
-/*
- * Rate limit for assert notification messages, in usec
- */
-#define ASSERT_MSG_TIME 3000000
-
-/*
- * Hash function for a source, group entry
- */
-#define MFCHASH(a, g) MFCHASHMOD(((a) >> 20) ^ ((a) >> 10) ^ (a) ^ \
- ((g) >> 20) ^ ((g) >> 10) ^ (g))
-
-/*
- * Find a route for a given origin IP address and Multicast group address
- * Type of service parameter to be added in the future!!!
- */
-
-#define MFCFIND(o, g, rt) { \
- register struct mbuf *_mb_rt = mfctable[MFCHASH(o,g)]; \
- register struct mfc *_rt = NULL; \
- rt = NULL; \
- ++mrtstat.mrts_mfc_lookups; \
- while (_mb_rt) { \
- _rt = mtod(_mb_rt, struct mfc *); \
- if ((_rt->mfc_origin.s_addr == o) && \
- (_rt->mfc_mcastgrp.s_addr == g) && \
- (_mb_rt->m_act == NULL)) { \
- rt = _rt; \
- break; \
- } \
- _mb_rt = _mb_rt->m_next; \
- } \
- if (rt == NULL) { \
- ++mrtstat.mrts_mfc_misses; \
- } \
-}
-
-
-/*
- * Macros to compute elapsed time efficiently
- * Borrowed from Van Jacobson's scheduling code
- */
-#define TV_DELTA(a, b, delta) { \
- register int xxs; \
- \
- delta = (a).tv_usec - (b).tv_usec; \
- if ((xxs = (a).tv_sec - (b).tv_sec)) { \
- switch (xxs) { \
- case 2: \
- delta += 1000000; \
- /* fall through */ \
- case 1: \
- delta += 1000000; \
- break; \
- default: \
- delta += (1000000 * xxs); \
- } \
- } \
-}
-
-#define TV_LT(a, b) (((a).tv_usec < (b).tv_usec && \
- (a).tv_sec <= (b).tv_sec) || (a).tv_sec < (b).tv_sec)
-
-#ifdef UPCALL_TIMING
-u_long upcall_data[51];
-static void collate(struct timeval *);
-#endif /* UPCALL_TIMING */
-
-
-/*
- * Handle MRT setsockopt commands to modify the multicast routing tables.
- */
-static int
-X_ip_mrouter_set(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf *m;
-{
- if (cmd != MRT_INIT && so != ip_mrouter) return EACCES;
-
- switch (cmd) {
- case MRT_INIT: return ip_mrouter_init(so, m);
- case MRT_DONE: return ip_mrouter_done();
- case MRT_ADD_VIF: return add_vif (mtod(m, struct vifctl *));
- case MRT_DEL_VIF: return del_vif (mtod(m, vifi_t *));
- case MRT_ADD_MFC: return add_mfc (mtod(m, struct mfcctl *));
- case MRT_DEL_MFC: return del_mfc (mtod(m, struct mfcctl *));
- case MRT_ASSERT: return set_assert(mtod(m, int *));
- default: return EOPNOTSUPP;
- }
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mrouter_set)(int, struct socket *, struct mbuf *) = X_ip_mrouter_set;
-#endif
-
-/*
- * Handle MRT getsockopt commands
- */
-static int
-X_ip_mrouter_get(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf **m;
-{
- struct mbuf *mb;
-
- if (so != ip_mrouter) return EACCES;
-
- *m = mb = m_get(M_WAIT, MT_SOOPTS);
-
- switch (cmd) {
- case MRT_VERSION: return get_version(mb);
- case MRT_ASSERT: return get_assert(mb);
- default: return EOPNOTSUPP;
- }
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mrouter_get)(int, struct socket *, struct mbuf **) = X_ip_mrouter_get;
-#endif
-
-/*
- * Handle ioctl commands to obtain information from the cache
- */
-static int
-X_mrt_ioctl(cmd, data)
- int cmd;
- caddr_t data;
-{
- int error = 0;
-
- switch (cmd) {
- case (SIOCGETVIFCNT):
- return (get_vif_cnt((struct sioc_vif_req *)data));
- break;
- case (SIOCGETSGCNT):
- return (get_sg_cnt((struct sioc_sg_req *)data));
- break;
- default:
- return (EINVAL);
- break;
- }
- return error;
-}
-
-#ifndef MROUTE_LKM
-int (*mrt_ioctl)(int, caddr_t) = X_mrt_ioctl;
-#endif
-
-/*
- * returns the packet, byte, rpf-failure count for the source group provided
- */
-static int
-get_sg_cnt(req)
- register struct sioc_sg_req *req;
-{
- register struct mfc *rt;
- int s;
-
- s = splnet();
- MFCFIND(req->src.s_addr, req->grp.s_addr, rt);
- splx(s);
- if (rt != NULL) {
- req->pktcnt = rt->mfc_pkt_cnt;
- req->bytecnt = rt->mfc_byte_cnt;
- req->wrong_if = rt->mfc_wrong_if;
- } else
- req->pktcnt = req->bytecnt = req->wrong_if = 0xffffffff;
-
- return 0;
-}
-
-/*
- * returns the input and output packet and byte counts on the vif provided
- */
-static int
-get_vif_cnt(req)
- register struct sioc_vif_req *req;
-{
- register vifi_t vifi = req->vifi;
-
- if (vifi >= numvifs) return EINVAL;
-
- req->icount = viftable[vifi].v_pkt_in;
- req->ocount = viftable[vifi].v_pkt_out;
- req->ibytes = viftable[vifi].v_bytes_in;
- req->obytes = viftable[vifi].v_bytes_out;
-
- return 0;
-}
-
-/*
- * Enable multicast routing
- */
-static int
-ip_mrouter_init(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- int *v;
-
- if (mrtdebug)
- log(LOG_DEBUG,"ip_mrouter_init: so_type = %d, pr_protocol = %d\n",
- so->so_type, so->so_proto->pr_protocol);
-
- if (so->so_type != SOCK_RAW ||
- so->so_proto->pr_protocol != IPPROTO_IGMP) return EOPNOTSUPP;
-
- if (!m || (m->m_len != sizeof(int *)))
- return ENOPROTOOPT;
-
- v = mtod(m, int *);
- if (*v != 1)
- return ENOPROTOOPT;
-
- if (ip_mrouter != NULL) return EADDRINUSE;
-
- ip_mrouter = so;
-
- bzero((caddr_t)mfctable, sizeof(mfctable));
- bzero((caddr_t)nexpire, sizeof(nexpire));
-
- pim_assert = 0;
-
- timeout(expire_upcalls, (caddr_t)NULL, EXPIRE_TIMEOUT);
-
- if (mrtdebug)
- log(LOG_DEBUG, "ip_mrouter_init\n");
-
- return 0;
-}
-
-/*
- * Disable multicast routing
- */
-static int
-X_ip_mrouter_done()
-{
- vifi_t vifi;
- int i;
- struct ifnet *ifp;
- struct ifreq ifr;
- struct mbuf *mb_rt;
- struct mbuf *m;
- struct rtdetq *rte;
- int s;
-
- s = splnet();
-
- /*
- * For each phyint in use, disable promiscuous reception of all IP
- * multicasts.
- */
- for (vifi = 0; vifi < numvifs; vifi++) {
- if (viftable[vifi].v_lcl_addr.s_addr != 0 &&
- !(viftable[vifi].v_flags & VIFF_TUNNEL)) {
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr.s_addr
- = INADDR_ANY;
- ifp = viftable[vifi].v_ifp;
- (*ifp->if_ioctl)(ifp, SIOCDELMULTI, (caddr_t)&ifr);
- }
- }
- bzero((caddr_t)tbftable, sizeof(tbftable));
- bzero((caddr_t)viftable, sizeof(viftable));
- numvifs = 0;
- pim_assert = 0;
-
- untimeout(expire_upcalls, (caddr_t)NULL);
-
- /*
- * Free all multicast forwarding cache entries.
- */
- for (i = 0; i < MFCTBLSIZ; i++) {
- mb_rt = mfctable[i];
- while (mb_rt) {
- if (mb_rt->m_act != NULL) {
- while (mb_rt->m_act) {
- m = mb_rt->m_act;
- mb_rt->m_act = m->m_act;
- rte = mtod(m, struct rtdetq *);
- m_freem(rte->m);
- m_free(m);
- }
- }
- mb_rt = m_free(mb_rt);
- }
- }
-
- bzero((caddr_t)mfctable, sizeof(mfctable));
-
- /*
- * Reset de-encapsulation cache
- */
- last_encap_src = 0;
- last_encap_vif = NULL;
- have_encap_tunnel = 0;
-
- ip_mrouter = NULL;
-
- splx(s);
-
- if (mrtdebug)
- log(LOG_DEBUG, "ip_mrouter_done\n");
-
- return 0;
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mrouter_done)(void) = X_ip_mrouter_done;
-#endif
-
-static int
-get_version(mb)
- struct mbuf *mb;
-{
- int *v;
-
- v = mtod(mb, int *);
-
- *v = 0x0305; /* XXX !!!! */
- mb->m_len = sizeof(int);
-
- return 0;
-}
-
-/*
- * Set PIM assert processing global
- */
-static int
-set_assert(i)
- int *i;
-{
- if ((*i != 1) && (*i != 0))
- return EINVAL;
-
- pim_assert = *i;
-
- return 0;
-}
-
-/*
- * Get PIM assert processing global
- */
-static int
-get_assert(m)
- struct mbuf *m;
-{
- int *i;
-
- i = mtod(m, int *);
-
- *i = pim_assert;
-
- return 0;
-}
-
-/*
- * Add a vif to the vif table
- */
-static int
-add_vif(vifcp)
- register struct vifctl *vifcp;
-{
- register struct vif *vifp = viftable + vifcp->vifc_vifi;
- static struct sockaddr_in sin = {sizeof sin, AF_INET};
- struct ifaddr *ifa;
- struct ifnet *ifp;
- struct ifreq ifr;
- int error, s;
- struct tbf *v_tbf = tbftable + vifcp->vifc_vifi;
-
- if (vifcp->vifc_vifi >= MAXVIFS) return EINVAL;
- if (vifp->v_lcl_addr.s_addr != 0) return EADDRINUSE;
-
- /* Find the interface with an address in AF_INET family */
- sin.sin_addr = vifcp->vifc_lcl_addr;
- ifa = ifa_ifwithaddr((struct sockaddr *)&sin);
- if (ifa == 0) return EADDRNOTAVAIL;
- ifp = ifa->ifa_ifp;
-
- if (vifcp->vifc_flags & VIFF_TUNNEL) {
- if ((vifcp->vifc_flags & VIFF_SRCRT) == 0) {
- /*
- * An encapsulating tunnel is wanted. Tell ipip_input() to
- * start paying attention to encapsulated packets.
- */
- if (have_encap_tunnel == 0) {
- have_encap_tunnel = 1;
- for (s = 0; s < MAXVIFS; ++s) {
- multicast_decap_if[s].if_name = "mdecap";
- multicast_decap_if[s].if_unit = s;
- }
- }
- /*
- * Set interface to fake encapsulator interface
- */
- ifp = &multicast_decap_if[vifcp->vifc_vifi];
- /*
- * Prepare cached route entry
- */
- bzero(&vifp->v_route, sizeof(vifp->v_route));
- } else {
- log(LOG_ERR, "source routed tunnels not supported\n");
- return EOPNOTSUPP;
- }
- } else {
- /* Make sure the interface supports multicast */
- if ((ifp->if_flags & IFF_MULTICAST) == 0)
- return EOPNOTSUPP;
-
- /* Enable promiscuous reception of all IP multicasts from the if */
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr.s_addr = INADDR_ANY;
- s = splnet();
- error = (*ifp->if_ioctl)(ifp, SIOCADDMULTI, (caddr_t)&ifr);
- splx(s);
- if (error)
- return error;
- }
-
- s = splnet();
- /* define parameters for the tbf structure */
- vifp->v_tbf = v_tbf;
- GET_TIME(vifp->v_tbf->tbf_last_pkt_t);
- vifp->v_tbf->tbf_n_tok = 0;
- vifp->v_tbf->tbf_q_len = 0;
- vifp->v_tbf->tbf_max_q_len = MAXQSIZE;
- vifp->v_tbf->tbf_q = vifp->v_tbf->tbf_t = NULL;
-
- vifp->v_flags = vifcp->vifc_flags;
- vifp->v_threshold = vifcp->vifc_threshold;
- vifp->v_lcl_addr = vifcp->vifc_lcl_addr;
- vifp->v_rmt_addr = vifcp->vifc_rmt_addr;
- vifp->v_ifp = ifp;
- /* scaling up here allows division by 1024 in critical code */
- vifp->v_rate_limit= vifcp->vifc_rate_limit * 1024 / 1000;
- vifp->v_rsvp_on = 0;
- vifp->v_rsvpd = NULL;
- /* initialize per vif pkt counters */
- vifp->v_pkt_in = 0;
- vifp->v_pkt_out = 0;
- vifp->v_bytes_in = 0;
- vifp->v_bytes_out = 0;
- splx(s);
-
- /* Adjust numvifs up if the vifi is higher than numvifs */
- if (numvifs <= vifcp->vifc_vifi) numvifs = vifcp->vifc_vifi + 1;
-
- if (mrtdebug)
- log(LOG_DEBUG, "add_vif #%d, lcladdr %x, %s %x, thresh %x, rate %d\n",
- vifcp->vifc_vifi,
- ntohl(vifcp->vifc_lcl_addr.s_addr),
- (vifcp->vifc_flags & VIFF_TUNNEL) ? "rmtaddr" : "mask",
- ntohl(vifcp->vifc_rmt_addr.s_addr),
- vifcp->vifc_threshold,
- vifcp->vifc_rate_limit);
-
- return 0;
-}
-
-/*
- * Delete a vif from the vif table
- */
-static int
-del_vif(vifip)
- vifi_t *vifip;
-{
- register struct vif *vifp = viftable + *vifip;
- register vifi_t vifi;
- register struct mbuf *m;
- struct ifnet *ifp;
- struct ifreq ifr;
- int s;
-
- if (*vifip >= numvifs) return EINVAL;
- if (vifp->v_lcl_addr.s_addr == 0) return EADDRNOTAVAIL;
-
- s = splnet();
-
- if (!(vifp->v_flags & VIFF_TUNNEL)) {
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr.s_addr = INADDR_ANY;
- ifp = vifp->v_ifp;
- (*ifp->if_ioctl)(ifp, SIOCDELMULTI, (caddr_t)&ifr);
- }
-
- if (vifp == last_encap_vif) {
- last_encap_vif = 0;
- last_encap_src = 0;
- }
-
- /*
- * Free packets queued at the interface
- */
- while (vifp->v_tbf->tbf_q) {
- m = vifp->v_tbf->tbf_q;
- vifp->v_tbf->tbf_q = m->m_act;
- m_freem(m);
- }
-
- bzero((caddr_t)vifp->v_tbf, sizeof(*(vifp->v_tbf)));
- bzero((caddr_t)vifp, sizeof (*vifp));
-
- /* Adjust numvifs down */
- for (vifi = numvifs; vifi > 0; vifi--)
- if (viftable[vifi-1].v_lcl_addr.s_addr != 0) break;
- numvifs = vifi;
-
- splx(s);
-
- if (mrtdebug)
- log(LOG_DEBUG, "del_vif %d, numvifs %d\n", *vifip, numvifs);
-
- return 0;
-}
-
-/*
- * Add an mfc entry
- */
-static int
-add_mfc(mfccp)
- struct mfcctl *mfccp;
-{
- struct mfc *rt;
- register struct mbuf *mb_rt;
- u_long hash;
- struct mbuf *mb_ntry;
- struct rtdetq *rte;
- register u_short nstl;
- int s;
- int i;
-
- MFCFIND(mfccp->mfcc_origin.s_addr, mfccp->mfcc_mcastgrp.s_addr, rt);
-
- /* If an entry already exists, just update the fields */
- if (rt) {
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"add_mfc update o %x g %x p %x\n",
- ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent);
-
- s = splnet();
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- splx(s);
- return 0;
- }
-
- /*
- * Find the entry for which the upcall was made and update
- */
- s = splnet();
- hash = MFCHASH(mfccp->mfcc_origin.s_addr, mfccp->mfcc_mcastgrp.s_addr);
- for (mb_rt = mfctable[hash], nstl = 0; mb_rt; mb_rt = mb_rt->m_next) {
-
- rt = mtod(mb_rt, struct mfc *);
- if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
- (rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr) &&
- (mb_rt->m_act != NULL)) {
-
- if (nstl++)
- log(LOG_ERR, "add_mfc %s o %x g %x p %x dbx %x\n",
- "multiple kernel entries",
- ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent, mb_rt->m_act);
-
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"add_mfc o %x g %x p %x dbg %x\n",
- ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent, mb_rt->m_act);
-
- rt->mfc_origin = mfccp->mfcc_origin;
- rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- /* initialize pkt counters per src-grp */
- rt->mfc_pkt_cnt = 0;
- rt->mfc_byte_cnt = 0;
- rt->mfc_wrong_if = 0;
- rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
-
- rt->mfc_expire = 0; /* Don't clean this guy up */
- nexpire[hash]--;
-
- /* free packets Qed at the end of this entry */
- while (mb_rt->m_act) {
- mb_ntry = mb_rt->m_act;
- rte = mtod(mb_ntry, struct rtdetq *);
-/* #ifdef RSVP_ISI */
- ip_mdq(rte->m, rte->ifp, rt, -1);
-/* #endif */
- mb_rt->m_act = mb_ntry->m_act;
- m_freem(rte->m);
-#ifdef UPCALL_TIMING
- collate(&(rte->t));
-#endif /* UPCALL_TIMING */
- m_free(mb_ntry);
- }
- }
- }
-
- /*
- * It is possible that an entry is being inserted without an upcall
- */
- if (nstl == 0) {
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"add_mfc no upcall h %d o %x g %x p %x\n",
- hash, ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent);
-
- for (mb_rt = mfctable[hash]; mb_rt; mb_rt = mb_rt->m_next) {
-
- rt = mtod(mb_rt, struct mfc *);
- if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
- (rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr)) {
-
- rt->mfc_origin = mfccp->mfcc_origin;
- rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- /* initialize pkt counters per src-grp */
- rt->mfc_pkt_cnt = 0;
- rt->mfc_byte_cnt = 0;
- rt->mfc_wrong_if = 0;
- rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
- if (rt->mfc_expire)
- nexpire[hash]--;
- rt->mfc_expire = 0;
- }
- }
- if (mb_rt == NULL) {
- /* no upcall, so make a new entry */
- MGET(mb_rt, M_DONTWAIT, MT_MRTABLE);
- if (mb_rt == NULL) {
- splx(s);
- return ENOBUFS;
- }
-
- rt = mtod(mb_rt, struct mfc *);
-
- /* insert new entry at head of hash chain */
- rt->mfc_origin = mfccp->mfcc_origin;
- rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- /* initialize pkt counters per src-grp */
- rt->mfc_pkt_cnt = 0;
- rt->mfc_byte_cnt = 0;
- rt->mfc_wrong_if = 0;
- rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
- rt->mfc_expire = 0;
-
- /* link into table */
- mb_rt->m_next = mfctable[hash];
- mfctable[hash] = mb_rt;
- mb_rt->m_act = NULL;
- }
- }
- splx(s);
- return 0;
-}
-
-#ifdef UPCALL_TIMING
-/*
- * collect delay statistics on the upcalls
- */
-static void collate(t)
-register struct timeval *t;
-{
- register u_long d;
- register struct timeval tp;
- register u_long delta;
-
- GET_TIME(tp);
-
- if (TV_LT(*t, tp))
- {
- TV_DELTA(tp, *t, delta);
-
- d = delta >> 10;
- if (d > 50)
- d = 50;
-
- ++upcall_data[d];
- }
-}
-#endif /* UPCALL_TIMING */
-
-/*
- * Delete an mfc entry
- */
-static int
-del_mfc(mfccp)
- struct mfcctl *mfccp;
-{
- struct in_addr origin;
- struct in_addr mcastgrp;
- struct mfc *rt;
- struct mbuf *mb_rt;
- struct mbuf **nptr;
- u_long hash;
- int s;
-
- origin = mfccp->mfcc_origin;
- mcastgrp = mfccp->mfcc_mcastgrp;
- hash = MFCHASH(origin.s_addr, mcastgrp.s_addr);
-
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"del_mfc orig %x mcastgrp %x\n",
- ntohl(origin.s_addr), ntohl(mcastgrp.s_addr));
-
- s = splnet();
-
- nptr = &mfctable[hash];
- while ((mb_rt = *nptr) != NULL) {
- rt = mtod(mb_rt, struct mfc *);
- if (origin.s_addr == rt->mfc_origin.s_addr &&
- mcastgrp.s_addr == rt->mfc_mcastgrp.s_addr &&
- mb_rt->m_act == NULL)
- break;
-
- nptr = &mb_rt->m_next;
- }
- if (mb_rt == NULL) {
- splx(s);
- return EADDRNOTAVAIL;
- }
-
- MFREE(mb_rt, *nptr);
-
- splx(s);
-
- return 0;
-}
-
-/*
- * Send a message to mrouted on the multicast routing socket
- */
-static int
-socket_send(s, mm, src)
- struct socket *s;
- struct mbuf *mm;
- struct sockaddr_in *src;
-{
- if (s) {
- if (sbappendaddr(&s->so_rcv,
- (struct sockaddr *)src,
- mm, (struct mbuf *)0) != 0) {
- sorwakeup(s);
- return 0;
- }
- }
- m_freem(mm);
- return -1;
-}
-
-/*
- * IP multicast forwarding function. This function assumes that the packet
- * pointed to by "ip" has arrived on (or is about to be sent to) the interface
- * pointed to by "ifp", and the packet is to be relayed to other networks
- * that have members of the packet's destination IP multicast group.
- *
- * The packet is returned unscathed to the caller, unless it is
- * erroneous, in which case a non-zero return value tells the caller to
- * discard it.
- */
-
-#define IP_HDR_LEN 20 /* # bytes of fixed IP header (excluding options) */
-#define TUNNEL_LEN 12 /* # bytes of IP option for tunnel encapsulation */
-
-static int
-X_ip_mforward(ip, ifp, m, imo)
- register struct ip *ip;
- struct ifnet *ifp;
- struct mbuf *m;
- struct ip_moptions *imo;
-{
- register struct mfc *rt;
- register u_char *ipoptions;
- static struct sockaddr_in k_igmpsrc = { sizeof k_igmpsrc, AF_INET };
- static int srctun = 0;
- register struct mbuf *mm;
- int s;
- vifi_t vifi;
- struct vif *vifp;
-
- if (mrtdebug & DEBUG_FORWARD)
- log(LOG_DEBUG, "ip_mforward: src %x, dst %x, ifp %x\n",
- ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr), ifp);
-
- if (ip->ip_hl < (IP_HDR_LEN + TUNNEL_LEN) >> 2 ||
- (ipoptions = (u_char *)(ip + 1))[1] != IPOPT_LSRR ) {
- /*
- * Packet arrived via a physical interface or
- * an encapsulated tunnel.
- */
- } else {
- /*
- * Packet arrived through a source-route tunnel.
- * Source-route tunnels are no longer supported.
- */
- if ((srctun++ % 1000) == 0)
- log(LOG_ERR, "ip_mforward: received source-routed packet from %x\n",
- ntohl(ip->ip_src.s_addr));
-
- return 1;
- }
-
- if ((imo) && ((vifi = imo->imo_multicast_vif) < numvifs)) {
- if (ip->ip_ttl < 255)
- ip->ip_ttl++; /* compensate for -1 in *_send routines */
- if (rsvpdebug && ip->ip_p == IPPROTO_RSVP) {
- vifp = viftable + vifi;
- printf("Sending IPPROTO_RSVP from %lx to %lx on vif %d (%s%s%d)\n",
- ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr), vifi,
- (vifp->v_flags & VIFF_TUNNEL) ? "tunnel on " : "",
- vifp->v_ifp->if_name, vifp->v_ifp->if_unit);
- }
- return (ip_mdq(m, ifp, NULL, vifi));
- }
- if (rsvpdebug && ip->ip_p == IPPROTO_RSVP) {
- printf("Warning: IPPROTO_RSVP from %lx to %lx without vif option\n",
- ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr));
- if(!imo)
- printf("In fact, no options were specified at all\n");
- }
-
- /*
- * Don't forward a packet with time-to-live of zero or one,
- * or a packet destined to a local-only group.
- */
- if (ip->ip_ttl <= 1 ||
- ntohl(ip->ip_dst.s_addr) <= INADDR_MAX_LOCAL_GROUP)
- return 0;
-
- /*
- * Determine forwarding vifs from the forwarding cache table
- */
- s = splnet();
- MFCFIND(ip->ip_src.s_addr, ip->ip_dst.s_addr, rt);
-
- /* Entry exists, so forward if necessary */
- if (rt != NULL) {
- splx(s);
- return (ip_mdq(m, ifp, rt, -1));
- } else {
- /*
- * If we don't have a route for packet's origin,
- * Make a copy of the packet &
- * send message to routing daemon
- */
-
- register struct mbuf *mb_rt;
- register struct mbuf *mb_ntry;
- register struct mbuf *mb0;
- register struct rtdetq *rte;
- register struct mbuf *rte_m;
- register u_long hash;
- register int npkts;
- int hlen = ip->ip_hl << 2;
-#ifdef UPCALL_TIMING
- struct timeval tp;
-
- GET_TIME(tp);
-#endif
-
- mrtstat.mrts_no_route++;
- if (mrtdebug & (DEBUG_FORWARD | DEBUG_MFC))
- log(LOG_DEBUG, "ip_mforward: no rte s %x g %x\n",
- ntohl(ip->ip_src.s_addr),
- ntohl(ip->ip_dst.s_addr));
-
- /*
- * Allocate mbufs early so that we don't do extra work if we are
- * just going to fail anyway. Make sure to pullup the header so
- * that other people can't step on it.
- */
- MGET(mb_ntry, M_DONTWAIT, MT_DATA);
- if (mb_ntry == NULL) {
- splx(s);
- return ENOBUFS;
- }
- mb0 = m_copy(m, 0, M_COPYALL);
- if (mb0 && (M_HASCL(mb0) || mb0->m_len < hlen))
- mb0 = m_pullup(mb0, hlen);
- if (mb0 == NULL) {
- m_free(mb_ntry);
- splx(s);
- return ENOBUFS;
- }
-
- /* is there an upcall waiting for this packet? */
- hash = MFCHASH(ip->ip_src.s_addr, ip->ip_dst.s_addr);
- for (mb_rt = mfctable[hash]; mb_rt; mb_rt = mb_rt->m_next) {
- rt = mtod(mb_rt, struct mfc *);
- if ((ip->ip_src.s_addr == rt->mfc_origin.s_addr) &&
- (ip->ip_dst.s_addr == rt->mfc_mcastgrp.s_addr) &&
- (mb_rt->m_act != NULL))
- break;
- }
-
- if (mb_rt == NULL) {
- int i;
- struct igmpmsg *im;
-
- /* no upcall, so make a new entry */
- MGET(mb_rt, M_DONTWAIT, MT_MRTABLE);
- if (mb_rt == NULL) {
- m_free(mb_ntry);
- m_freem(mb0);
- splx(s);
- return ENOBUFS;
- }
- /* Make a copy of the header to send to the user level process */
- mm = m_copy(mb0, 0, hlen);
- if (mm == NULL) {
- m_free(mb_ntry);
- m_freem(mb0);
- m_free(mb_rt);
- splx(s);
- return ENOBUFS;
- }
-
- /*
- * Send message to routing daemon to install
- * a route into the kernel table
- */
- k_igmpsrc.sin_addr = ip->ip_src;
-
- im = mtod(mm, struct igmpmsg *);
- im->im_msgtype = IGMPMSG_NOCACHE;
- im->im_mbz = 0;
-
- mrtstat.mrts_upcalls++;
-
- if (socket_send(ip_mrouter, mm, &k_igmpsrc) < 0) {
- log(LOG_WARNING, "ip_mforward: ip_mrouter socket queue full\n");
- ++mrtstat.mrts_upq_sockfull;
- m_free(mb_ntry);
- m_freem(mb0);
- m_free(mb_rt);
- splx(s);
- return ENOBUFS;
- }
-
- rt = mtod(mb_rt, struct mfc *);
-
- /* insert new entry at head of hash chain */
- rt->mfc_origin.s_addr = ip->ip_src.s_addr;
- rt->mfc_mcastgrp.s_addr = ip->ip_dst.s_addr;
- rt->mfc_expire = UPCALL_EXPIRE;
- nexpire[hash]++;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = 0;
- rt->mfc_parent = -1;
-
- /* link into table */
- mb_rt->m_next = mfctable[hash];
- mfctable[hash] = mb_rt;
- mb_rt->m_act = NULL;
-
- rte_m = mb_rt;
- } else {
- /* determine if q has overflowed */
- for (rte_m = mb_rt, npkts = 0; rte_m->m_act; rte_m = rte_m->m_act)
- npkts++;
-
- if (npkts > MAX_UPQ) {
- mrtstat.mrts_upq_ovflw++;
- m_free(mb_ntry);
- m_freem(mb0);
- splx(s);
- return 0;
- }
- }
-
- mb_ntry->m_act = NULL;
- rte = mtod(mb_ntry, struct rtdetq *);
-
- rte->m = mb0;
- rte->ifp = ifp;
-#ifdef UPCALL_TIMING
- rte->t = tp;
-#endif
-
- /* Add this entry to the end of the queue */
- rte_m->m_act = mb_ntry;
-
- splx(s);
-
- return 0;
- }
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *,
- struct ip_moptions *) = X_ip_mforward;
-#endif
-
-/*
- * Clean up the cache entry if upcall is not serviced
- */
-static void
-expire_upcalls(void *unused)
-{
- struct mbuf *mb_rt, *m, **nptr;
- struct rtdetq *rte;
- struct mfc *mfc;
- int i;
- int s;
-
- s = splnet();
- for (i = 0; i < MFCTBLSIZ; i++) {
- if (nexpire[i] == 0)
- continue;
- nptr = &mfctable[i];
- for (mb_rt = *nptr; mb_rt != NULL; mb_rt = *nptr) {
- mfc = mtod(mb_rt, struct mfc *);
-
- /*
- * Skip real cache entries
- * Make sure it wasn't marked to not expire (shouldn't happen)
- * If it expires now
- */
- if (mb_rt->m_act != NULL &&
- mfc->mfc_expire != 0 &&
- --mfc->mfc_expire == 0) {
- if (mrtdebug & DEBUG_EXPIRE)
- log(LOG_DEBUG, "expire_upcalls: expiring (%x %x)\n",
- ntohl(mfc->mfc_origin.s_addr),
- ntohl(mfc->mfc_mcastgrp.s_addr));
- /*
- * drop all the packets
- * free the mbuf with the pkt, if, timing info
- */
- while (mb_rt->m_act) {
- m = mb_rt->m_act;
- mb_rt->m_act = m->m_act;
-
- rte = mtod(m, struct rtdetq *);
- m_freem(rte->m);
- m_free(m);
- }
- ++mrtstat.mrts_cache_cleanups;
- nexpire[i]--;
-
- MFREE(mb_rt, *nptr);
- } else {
- nptr = &mb_rt->m_next;
- }
- }
- }
- splx(s);
- timeout(expire_upcalls, (caddr_t)NULL, EXPIRE_TIMEOUT);
-}
-
-/*
- * Packet forwarding routine once entry in the cache is made
- */
-static int
-ip_mdq(m, ifp, rt, xmt_vif)
- register struct mbuf *m;
- register struct ifnet *ifp;
- register struct mfc *rt;
- register vifi_t xmt_vif;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register vifi_t vifi;
- register struct vif *vifp;
- register int plen = ntohs(ip->ip_len);
-
-/*
- * Macro to send packet on vif. Since RSVP packets don't get counted on
- * input, they shouldn't get counted on output, so statistics keeping is
- * seperate.
- */
-#define MC_SEND(ip,vifp,m) { \
- if ((vifp)->v_flags & VIFF_TUNNEL) \
- encap_send((ip), (vifp), (m)); \
- else \
- phyint_send((ip), (vifp), (m)); \
-}
-
- /*
- * If xmt_vif is not -1, send on only the requested vif.
- *
- * (since vifi_t is u_short, -1 becomes MAXUSHORT, which > numvifs.)
- */
- if (xmt_vif < numvifs) {
- MC_SEND(ip, viftable + xmt_vif, m);
- return 1;
- }
-
- /*
- * Don't forward if it didn't arrive from the parent vif for its origin.
- */
- vifi = rt->mfc_parent;
- if ((vifi >= numvifs) || (viftable[vifi].v_ifp != ifp)) {
- /* came in the wrong interface */
- if (mrtdebug & DEBUG_FORWARD)
- log(LOG_DEBUG, "wrong if: ifp %x vifi %d vififp %x\n",
- ifp, vifi, viftable[vifi].v_ifp);
- ++mrtstat.mrts_wrong_if;
- ++rt->mfc_wrong_if;
- /*
- * If we are doing PIM assert processing, and we are forwarding
- * packets on this interface, and it is a broadcast medium
- * interface (and not a tunnel), send a message to the routing daemon.
- */
- if (pim_assert && rt->mfc_ttls[vifi] &&
- (ifp->if_flags & IFF_BROADCAST) &&
- !(viftable[vifi].v_flags & VIFF_TUNNEL)) {
- struct sockaddr_in k_igmpsrc;
- struct mbuf *mm;
- struct igmpmsg *im;
- int hlen = ip->ip_hl << 2;
- struct timeval now;
- register u_long delta;
-
- GET_TIME(now);
-
- TV_DELTA(rt->mfc_last_assert, now, delta);
-
- if (delta > ASSERT_MSG_TIME) {
- mm = m_copy(m, 0, hlen);
- if (mm && (M_HASCL(mm) || mm->m_len < hlen))
- mm = m_pullup(mm, hlen);
- if (mm == NULL) {
- return ENOBUFS;
- }
-
- rt->mfc_last_assert = now;
-
- im = mtod(mm, struct igmpmsg *);
- im->im_msgtype = IGMPMSG_WRONGVIF;
- im->im_mbz = 0;
- im->im_vif = vifi;
-
- k_igmpsrc.sin_addr = im->im_src;
-
- socket_send(ip_mrouter, mm, &k_igmpsrc);
- }
- }
- return 0;
- }
-
- /* If I sourced this packet, it counts as output, else it was input. */
- if (ip->ip_src.s_addr == viftable[vifi].v_lcl_addr.s_addr) {
- viftable[vifi].v_pkt_out++;
- viftable[vifi].v_bytes_out += plen;
- } else {
- viftable[vifi].v_pkt_in++;
- viftable[vifi].v_bytes_in += plen;
- }
- rt->mfc_pkt_cnt++;
- rt->mfc_byte_cnt += plen;
-
- /*
- * For each vif, decide if a copy of the packet should be forwarded.
- * Forward if:
- * - the ttl exceeds the vif's threshold
- * - there are group members downstream on interface
- */
- for (vifp = viftable, vifi = 0; vifi < numvifs; vifp++, vifi++)
- if ((rt->mfc_ttls[vifi] > 0) &&
- (ip->ip_ttl > rt->mfc_ttls[vifi])) {
- vifp->v_pkt_out++;
- vifp->v_bytes_out += plen;
- MC_SEND(ip, vifp, m);
- }
-
- return 0;
-}
-
-/*
- * check if a vif number is legal/ok. This is used by ip_output, to export
- * numvifs there,
- */
-static int
-X_legal_vif_num(vif)
- int vif;
-{
- if (vif >= 0 && vif < numvifs)
- return(1);
- else
- return(0);
-}
-
-#ifndef MROUTE_LKM
-int (*legal_vif_num)(int) = X_legal_vif_num;
-#endif
-
-/*
- * Return the local address used by this vif
- */
-static u_long
-X_ip_mcast_src(vifi)
- int vifi;
-{
- if (vifi >= 0 && vifi < numvifs)
- return viftable[vifi].v_lcl_addr.s_addr;
- else
- return INADDR_ANY;
-}
-
-#ifndef MROUTE_LKM
-u_long (*ip_mcast_src)(int) = X_ip_mcast_src;
-#endif
-
-static void
-phyint_send(ip, vifp, m)
- struct ip *ip;
- struct vif *vifp;
- struct mbuf *m;
-{
- register struct mbuf *mb_copy;
- register int hlen = ip->ip_hl << 2;
-
- /*
- * Make a new reference to the packet; make sure that
- * the IP header is actually copied, not just referenced,
- * so that ip_output() only scribbles on the copy.
- */
- mb_copy = m_copy(m, 0, M_COPYALL);
- if (mb_copy && (M_HASCL(mb_copy) || mb_copy->m_len < hlen))
- mb_copy = m_pullup(mb_copy, hlen);
- if (mb_copy == NULL)
- return;
-
- if (vifp->v_rate_limit <= 0)
- tbf_send_packet(vifp, mb_copy);
- else
- tbf_control(vifp, mb_copy, mtod(mb_copy, struct ip *), ip->ip_len);
-}
-
-static void
-encap_send(ip, vifp, m)
- register struct ip *ip;
- register struct vif *vifp;
- register struct mbuf *m;
-{
- register struct mbuf *mb_copy;
- register struct ip *ip_copy;
- register int i, len = ip->ip_len;
-
- /*
- * copy the old packet & pullup it's IP header into the
- * new mbuf so we can modify it. Try to fill the new
- * mbuf since if we don't the ethernet driver will.
- */
- MGETHDR(mb_copy, M_DONTWAIT, MT_HEADER);
- if (mb_copy == NULL)
- return;
- mb_copy->m_data += max_linkhdr;
- mb_copy->m_len = sizeof(multicast_encap_iphdr);
-
- if ((mb_copy->m_next = m_copy(m, 0, M_COPYALL)) == NULL) {
- m_freem(mb_copy);
- return;
- }
- i = MHLEN - M_LEADINGSPACE(mb_copy);
- if (i > len)
- i = len;
- mb_copy = m_pullup(mb_copy, i);
- if (mb_copy == NULL)
- return;
- mb_copy->m_pkthdr.len = len + sizeof(multicast_encap_iphdr);
-
- /*
- * fill in the encapsulating IP header.
- */
- ip_copy = mtod(mb_copy, struct ip *);
- *ip_copy = multicast_encap_iphdr;
- ip_copy->ip_id = htons(ip_id++);
- ip_copy->ip_len += len;
- ip_copy->ip_src = vifp->v_lcl_addr;
- ip_copy->ip_dst = vifp->v_rmt_addr;
-
- /*
- * turn the encapsulated IP header back into a valid one.
- */
- ip = (struct ip *)((caddr_t)ip_copy + sizeof(multicast_encap_iphdr));
- --ip->ip_ttl;
- HTONS(ip->ip_len);
- HTONS(ip->ip_off);
- ip->ip_sum = 0;
- mb_copy->m_data += sizeof(multicast_encap_iphdr);
- ip->ip_sum = in_cksum(mb_copy, ip->ip_hl << 2);
- mb_copy->m_data -= sizeof(multicast_encap_iphdr);
-
- if (vifp->v_rate_limit <= 0)
- tbf_send_packet(vifp, mb_copy);
- else
- tbf_control(vifp, mb_copy, ip, ip_copy->ip_len);
-}
-
-/*
- * De-encapsulate a packet and feed it back through ip input (this
- * routine is called whenever IP gets a packet with proto type
- * ENCAP_PROTO and a local destination address).
- */
-void
-#ifdef MROUTE_LKM
-X_ipip_input(m, iphlen)
-#else
-ipip_input(m, iphlen)
-#endif
- register struct mbuf *m;
- int iphlen;
-{
- struct ifnet *ifp = m->m_pkthdr.rcvif;
- register struct ip *ip = mtod(m, struct ip *);
- register int hlen = ip->ip_hl << 2;
- register int s;
- register struct ifqueue *ifq;
- register struct vif *vifp;
-
- if (!have_encap_tunnel) {
- rip_input(m, iphlen);
- return;
- }
- /*
- * dump the packet if it's not to a multicast destination or if
- * we don't have an encapsulating tunnel with the source.
- * Note: This code assumes that the remote site IP address
- * uniquely identifies the tunnel (i.e., that this site has
- * at most one tunnel with the remote site).
- */
- if (! IN_MULTICAST(ntohl(((struct ip *)((char *)ip + hlen))->ip_dst.s_addr))) {
- ++mrtstat.mrts_bad_tunnel;
- m_freem(m);
- return;
- }
- if (ip->ip_src.s_addr != last_encap_src) {
- register struct vif *vife;
-
- vifp = viftable;
- vife = vifp + numvifs;
- last_encap_src = ip->ip_src.s_addr;
- last_encap_vif = 0;
- for ( ; vifp < vife; ++vifp)
- if (vifp->v_rmt_addr.s_addr == ip->ip_src.s_addr) {
- if ((vifp->v_flags & (VIFF_TUNNEL|VIFF_SRCRT))
- == VIFF_TUNNEL)
- last_encap_vif = vifp;
- break;
- }
- }
- if ((vifp = last_encap_vif) == 0) {
- last_encap_src = 0;
- mrtstat.mrts_cant_tunnel++; /*XXX*/
- m_freem(m);
- if (mrtdebug)
- log(LOG_DEBUG, "ip_mforward: no tunnel with %x\n",
- ntohl(ip->ip_src.s_addr));
- return;
- }
- ifp = vifp->v_ifp;
-
- if (hlen > IP_HDR_LEN)
- ip_stripoptions(m, (struct mbuf *) 0);
- m->m_data += IP_HDR_LEN;
- m->m_len -= IP_HDR_LEN;
- m->m_pkthdr.len -= IP_HDR_LEN;
- m->m_pkthdr.rcvif = ifp;
-
- ifq = &ipintrq;
- s = splimp();
- if (IF_QFULL(ifq)) {
- IF_DROP(ifq);
- m_freem(m);
- } else {
- IF_ENQUEUE(ifq, m);
- /*
- * normally we would need a "schednetisr(NETISR_IP)"
- * here but we were called by ip_input and it is going
- * to loop back & try to dequeue the packet we just
- * queued as soon as we return so we avoid the
- * unnecessary software interrrupt.
- */
- }
- splx(s);
-}
-
-/*
- * Token bucket filter module
- */
-
-static void
-tbf_control(vifp, m, ip, p_len)
- register struct vif *vifp;
- register struct mbuf *m;
- register struct ip *ip;
- register u_long p_len;
-{
- register struct tbf *t = vifp->v_tbf;
-
- if (p_len > MAX_BKT_SIZE) {
- /* drop if packet is too large */
- mrtstat.mrts_pkt2large++;
- m_freem(m);
- return;
- }
-
- tbf_update_tokens(vifp);
-
- /* if there are enough tokens,
- * and the queue is empty,
- * send this packet out
- */
-
- if (t->tbf_q_len == 0) {
- /* queue empty, send packet if enough tokens */
- if (p_len <= t->tbf_n_tok) {
- t->tbf_n_tok -= p_len;
- tbf_send_packet(vifp, m);
- } else {
- /* queue packet and timeout till later */
- tbf_queue(vifp, m);
- timeout(tbf_reprocess_q, (caddr_t)vifp, TBF_REPROCESS);
- }
- } else if (t->tbf_q_len < t->tbf_max_q_len) {
- /* finite queue length, so queue pkts and process queue */
- tbf_queue(vifp, m);
- tbf_process_q(vifp);
- } else {
- /* queue length too much, try to dq and queue and process */
- if (!tbf_dq_sel(vifp, ip)) {
- mrtstat.mrts_q_overflow++;
- m_freem(m);
- return;
- } else {
- tbf_queue(vifp, m);
- tbf_process_q(vifp);
- }
- }
- return;
-}
-
-/*
- * adds a packet to the queue at the interface
- */
-static void
-tbf_queue(vifp, m)
- register struct vif *vifp;
- register struct mbuf *m;
-{
- register int s = splnet();
- register struct tbf *t = vifp->v_tbf;
-
- if (t->tbf_t == NULL) {
- /* Queue was empty */
- t->tbf_q = m;
- } else {
- /* Insert at tail */
- t->tbf_t->m_act = m;
- }
-
- /* Set new tail pointer */
- t->tbf_t = m;
-
-#ifdef DIAGNOSTIC
- /* Make sure we didn't get fed a bogus mbuf */
- if (m->m_act)
- panic("tbf_queue: m_act");
-#endif
- m->m_act = NULL;
-
- t->tbf_q_len++;
-
- splx(s);
-}
-
-
-/*
- * processes the queue at the interface
- */
-static void
-tbf_process_q(vifp)
- register struct vif *vifp;
-{
- register struct mbuf *m;
- register int len;
- register int s = splnet();
- register struct tbf *t = vifp->v_tbf;
-
- /* loop through the queue at the interface and send as many packets
- * as possible
- */
- while (t->tbf_q_len > 0) {
- m = t->tbf_q;
-
- len = mtod(m, struct ip *)->ip_len;
-
- /* determine if the packet can be sent */
- if (len <= t->tbf_n_tok) {
- /* if so,
- * reduce no of tokens, dequeue the packet,
- * send the packet.
- */
- t->tbf_n_tok -= len;
-
- t->tbf_q = m->m_act;
- if (--t->tbf_q_len == 0)
- t->tbf_t = NULL;
-
- m->m_act = NULL;
- tbf_send_packet(vifp, m);
-
- } else break;
- }
- splx(s);
-}
-
-static void
-tbf_reprocess_q(xvifp)
- void *xvifp;
-{
- register struct vif *vifp = xvifp;
- if (ip_mrouter == NULL)
- return;
-
- tbf_update_tokens(vifp);
-
- tbf_process_q(vifp);
-
- if (vifp->v_tbf->tbf_q_len)
- timeout(tbf_reprocess_q, (caddr_t)vifp, TBF_REPROCESS);
-}
-
-/* function that will selectively discard a member of the queue
- * based on the precedence value and the priority
- */
-static int
-tbf_dq_sel(vifp, ip)
- register struct vif *vifp;
- register struct ip *ip;
-{
- register int s = splnet();
- register u_int p;
- register struct mbuf *m, *last;
- register struct mbuf **np;
- register struct tbf *t = vifp->v_tbf;
-
- p = priority(vifp, ip);
-
- np = &t->tbf_q;
- last = NULL;
- while ((m = *np) != NULL) {
- if (p > priority(vifp, mtod(m, struct ip *))) {
- *np = m->m_act;
- /* If we're removing the last packet, fix the tail pointer */
- if (m == t->tbf_t)
- t->tbf_t = last;
- m_freem(m);
- /* it's impossible for the queue to be empty, but
- * we check anyway. */
- if (--t->tbf_q_len == 0)
- t->tbf_t = NULL;
- splx(s);
- mrtstat.mrts_drop_sel++;
- return(1);
- }
- np = &m->m_act;
- last = m;
- }
- splx(s);
- return(0);
-}
-
-static void
-tbf_send_packet(vifp, m)
- register struct vif *vifp;
- register struct mbuf *m;
-{
- struct ip_moptions imo;
- int error;
- static struct route ro;
- int s = splnet();
-
- if (vifp->v_flags & VIFF_TUNNEL) {
- /* If tunnel options */
- ip_output(m, (struct mbuf *)0, &vifp->v_route,
- IP_FORWARDING, (struct ip_moptions *)0);
- } else {
- imo.imo_multicast_ifp = vifp->v_ifp;
- imo.imo_multicast_ttl = mtod(m, struct ip *)->ip_ttl - 1;
- imo.imo_multicast_loop = 1;
- imo.imo_multicast_vif = -1;
-
- /*
- * Re-entrancy should not be a problem here, because
- * the packets that we send out and are looped back at us
- * should get rejected because they appear to come from
- * the loopback interface, thus preventing looping.
- */
- error = ip_output(m, (struct mbuf *)0, &ro,
- IP_FORWARDING, &imo);
-
- if (mrtdebug & DEBUG_XMIT)
- log(LOG_DEBUG, "phyint_send on vif %d err %d\n",
- vifp - viftable, error);
- }
- splx(s);
-}
-
-/* determine the current time and then
- * the elapsed time (between the last time and time now)
- * in milliseconds & update the no. of tokens in the bucket
- */
-static void
-tbf_update_tokens(vifp)
- register struct vif *vifp;
-{
- struct timeval tp;
- register u_long tm;
- register int s = splnet();
- register struct tbf *t = vifp->v_tbf;
-
- GET_TIME(tp);
-
- TV_DELTA(tp, t->tbf_last_pkt_t, tm);
-
- /*
- * This formula is actually
- * "time in seconds" * "bytes/second".
- *
- * (tm / 1000000) * (v_rate_limit * 1000 * (1000/1024) / 8)
- *
- * The (1000/1024) was introduced in add_vif to optimize
- * this divide into a shift.
- */
- t->tbf_n_tok += tm * vifp->v_rate_limit / 1024 / 8;
- t->tbf_last_pkt_t = tp;
-
- if (t->tbf_n_tok > MAX_BKT_SIZE)
- t->tbf_n_tok = MAX_BKT_SIZE;
-
- splx(s);
-}
-
-static int
-priority(vifp, ip)
- register struct vif *vifp;
- register struct ip *ip;
-{
- register int prio;
-
- /* temporary hack; may add general packet classifier some day */
-
- /*
- * The UDP port space is divided up into four priority ranges:
- * [0, 16384) : unclassified - lowest priority
- * [16384, 32768) : audio - highest priority
- * [32768, 49152) : whiteboard - medium priority
- * [49152, 65536) : video - low priority
- */
- if (ip->ip_p == IPPROTO_UDP) {
- struct udphdr *udp = (struct udphdr *)(((char *)ip) + (ip->ip_hl << 2));
- switch (ntohs(udp->uh_dport) & 0xc000) {
- case 0x4000:
- prio = 70;
- break;
- case 0x8000:
- prio = 60;
- break;
- case 0xc000:
- prio = 55;
- break;
- default:
- prio = 50;
- break;
- }
- if (tbfdebug > 1)
- log(LOG_DEBUG, "port %x prio%d\n", ntohs(udp->uh_dport), prio);
- } else {
- prio = 50;
- }
- return prio;
-}
-
-/*
- * End of token bucket filter modifications
- */
-
-int
-ip_rsvp_vif_init(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- int i;
- register int s;
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_init: so_type = %d, pr_protocol = %d\n",
- so->so_type, so->so_proto->pr_protocol);
-
- if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP)
- return EOPNOTSUPP;
-
- /* Check mbuf. */
- if (m == NULL || m->m_len != sizeof(int)) {
- return EINVAL;
- }
- i = *(mtod(m, int *));
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_init: vif = %d rsvp_on = %d\n",i,rsvp_on);
-
- s = splnet();
-
- /* Check vif. */
- if (!legal_vif_num(i)) {
- splx(s);
- return EADDRNOTAVAIL;
- }
-
- /* Check if socket is available. */
- if (viftable[i].v_rsvpd != NULL) {
- splx(s);
- return EADDRINUSE;
- }
-
- viftable[i].v_rsvpd = so;
- /* This may seem silly, but we need to be sure we don't over-increment
- * the RSVP counter, in case something slips up.
- */
- if (!viftable[i].v_rsvp_on) {
- viftable[i].v_rsvp_on = 1;
- rsvp_on++;
- }
-
- splx(s);
- return 0;
-}
-
-int
-ip_rsvp_vif_done(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- int i;
- register int s;
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_done: so_type = %d, pr_protocol = %d\n",
- so->so_type, so->so_proto->pr_protocol);
-
- if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP)
- return EOPNOTSUPP;
-
- /* Check mbuf. */
- if (m == NULL || m->m_len != sizeof(int)) {
- return EINVAL;
- }
- i = *(mtod(m, int *));
-
- s = splnet();
-
- /* Check vif. */
- if (!legal_vif_num(i)) {
- splx(s);
- return EADDRNOTAVAIL;
- }
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_done: v_rsvpd = %p so = %p\n",
- viftable[i].v_rsvpd, so);
-
- viftable[i].v_rsvpd = NULL;
- /* This may seem silly, but we need to be sure we don't over-decrement
- * the RSVP counter, in case something slips up.
- */
- if (viftable[i].v_rsvp_on) {
- viftable[i].v_rsvp_on = 0;
- rsvp_on--;
- }
-
- splx(s);
- return 0;
-}
-
-void
-ip_rsvp_force_done(so)
- struct socket *so;
-{
- int vifi;
- register int s;
-
- /* Don't bother if it is not the right type of socket. */
- if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP)
- return;
-
- s = splnet();
-
- /* The socket may be attached to more than one vif...this
- * is perfectly legal.
- */
- for (vifi = 0; vifi < numvifs; vifi++) {
- if (viftable[vifi].v_rsvpd == so) {
- viftable[vifi].v_rsvpd = NULL;
- /* This may seem silly, but we need to be sure we don't
- * over-decrement the RSVP counter, in case something slips up.
- */
- if (viftable[vifi].v_rsvp_on) {
- viftable[vifi].v_rsvp_on = 0;
- rsvp_on--;
- }
- }
- }
-
- splx(s);
- return;
-}
-
-void
-rsvp_input(m, iphlen)
- struct mbuf *m;
- int iphlen;
-{
- int vifi;
- register struct ip *ip = mtod(m, struct ip *);
- static struct sockaddr_in rsvp_src = { sizeof rsvp_src, AF_INET };
- register int s;
- struct ifnet *ifp;
-
- if (rsvpdebug)
- printf("rsvp_input: rsvp_on %d\n",rsvp_on);
-
- /* Can still get packets with rsvp_on = 0 if there is a local member
- * of the group to which the RSVP packet is addressed. But in this
- * case we want to throw the packet away.
- */
- if (!rsvp_on) {
- m_freem(m);
- return;
- }
-
- /* If the old-style non-vif-associated socket is set, then use
- * it and ignore the new ones.
- */
- if (ip_rsvpd != NULL) {
- if (rsvpdebug)
- printf("rsvp_input: Sending packet up old-style socket\n");
- rip_input(m, iphlen);
- return;
- }
-
- s = splnet();
-
- if (rsvpdebug)
- printf("rsvp_input: check vifs\n");
-
-#ifdef DIAGNOSTIC
- if (!(m->m_flags & M_PKTHDR))
- panic("rsvp_input no hdr");
-#endif
-
- ifp = m->m_pkthdr.rcvif;
- /* Find which vif the packet arrived on. */
- for (vifi = 0; vifi < numvifs; vifi++) {
- if (viftable[vifi].v_ifp == ifp)
- break;
- }
-
- if (vifi == numvifs) {
- /* Can't find vif packet arrived on. Drop packet. */
- if (rsvpdebug)
- printf("rsvp_input: Can't find vif for packet...dropping it.\n");
- m_freem(m);
- splx(s);
- return;
- }
-
- if (rsvpdebug)
- printf("rsvp_input: check socket\n");
-
- if (viftable[vifi].v_rsvpd == NULL) {
- /* drop packet, since there is no specific socket for this
- * interface */
- if (rsvpdebug)
- printf("rsvp_input: No socket defined for vif %d\n",vifi);
- m_freem(m);
- splx(s);
- return;
- }
- rsvp_src.sin_addr = ip->ip_src;
-
- if (rsvpdebug && m)
- printf("rsvp_input: m->m_len = %d, sbspace() = %ld\n",
- m->m_len,sbspace(&(viftable[vifi].v_rsvpd->so_rcv)));
-
- if (socket_send(viftable[vifi].v_rsvpd, m, &rsvp_src) < 0)
- if (rsvpdebug)
- printf("rsvp_input: Failed to append to socket\n");
- else
- if (rsvpdebug)
- printf("rsvp_input: send packet up\n");
-
- splx(s);
-}
-
-#ifdef MROUTE_LKM
-#include <sys/conf.h>
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-MOD_MISC("ip_mroute_mod")
-
-static int
-ip_mroute_mod_handle(struct lkm_table *lkmtp, int cmd)
-{
- int i;
- struct lkm_misc *args = lkmtp->private.lkm_misc;
- int err = 0;
-
- switch(cmd) {
- static int (*old_ip_mrouter_cmd)();
- static int (*old_ip_mrouter_done)();
- static int (*old_ip_mforward)();
- static int (*old_mrt_ioctl)();
- static void (*old_proto4_input)();
- static int (*old_legal_vif_num)();
- extern struct protosw inetsw[];
-
- case LKM_E_LOAD:
- if(lkmexists(lkmtp) || ip_mrtproto)
- return(EEXIST);
- old_ip_mrouter_cmd = ip_mrouter_cmd;
- ip_mrouter_cmd = X_ip_mrouter_cmd;
- old_ip_mrouter_done = ip_mrouter_done;
- ip_mrouter_done = X_ip_mrouter_done;
- old_ip_mforward = ip_mforward;
- ip_mforward = X_ip_mforward;
- old_mrt_ioctl = mrt_ioctl;
- mrt_ioctl = X_mrt_ioctl;
- old_proto4_input = inetsw[ip_protox[ENCAP_PROTO]].pr_input;
- inetsw[ip_protox[ENCAP_PROTO]].pr_input = X_ipip_input;
- old_legal_vif_num = legal_vif_num;
- legal_vif_num = X_legal_vif_num;
- ip_mrtproto = IGMP_DVMRP;
-
- printf("\nIP multicast routing loaded\n");
- break;
-
- case LKM_E_UNLOAD:
- if (ip_mrouter)
- return EINVAL;
-
- ip_mrouter_cmd = old_ip_mrouter_cmd;
- ip_mrouter_done = old_ip_mrouter_done;
- ip_mforward = old_ip_mforward;
- mrt_ioctl = old_mrt_ioctl;
- inetsw[ip_protox[ENCAP_PROTO]].pr_input = old_proto4_input;
- legal_vif_num = old_legal_vif_num;
- ip_mrtproto = 0;
- break;
-
- default:
- err = EINVAL;
- break;
- }
-
- return(err);
-}
-
-int
-ip_mroute_mod(struct lkm_table *lkmtp, int cmd, int ver) {
- DISPATCH(lkmtp, cmd, ver, ip_mroute_mod_handle, ip_mroute_mod_handle,
- nosys);
-}
-
-#endif /* MROUTE_LKM */
-#endif /* MROUTING */
diff --git a/c/src/lib/libnetworking/netinet/ip_mroute.h b/c/src/lib/libnetworking/netinet/ip_mroute.h
deleted file mode 100644
index 5ddd6799d2..0000000000
--- a/c/src/lib/libnetworking/netinet/ip_mroute.h
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright (c) 1989 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)ip_mroute.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IP_MROUTE_H_
-#define _NETINET_IP_MROUTE_H_
-
-/*
- * Definitions for IP multicast forwarding.
- *
- * Written by David Waitzman, BBN Labs, August 1988.
- * Modified by Steve Deering, Stanford, February 1989.
- * Modified by Ajit Thyagarajan, PARC, August 1993.
- * Modified by Ajit Thyagarajan, PARC, August 1994.
- *
- * MROUTING Revision: 3.3.1.3
- */
-
-
-/*
- * Multicast Routing set/getsockopt commands.
- */
-#define MRT_INIT 100 /* initialize forwarder */
-#define MRT_DONE 101 /* shut down forwarder */
-#define MRT_ADD_VIF 102 /* create virtual interface */
-#define MRT_DEL_VIF 103 /* delete virtual interface */
-#define MRT_ADD_MFC 104 /* insert forwarding cache entry */
-#define MRT_DEL_MFC 105 /* delete forwarding cache entry */
-#define MRT_VERSION 106 /* get kernel version number */
-#define MRT_ASSERT 107 /* enable PIM assert processing */
-
-
-#define GET_TIME(t) microtime(&t)
-
-/*
- * Types and macros for handling bitmaps with one bit per virtual interface.
- */
-#define MAXVIFS 32
-typedef u_long vifbitmap_t;
-typedef u_short vifi_t; /* type of a vif index */
-#define ALL_VIFS (vifi_t)-1
-
-#define VIFM_SET(n, m) ((m) |= (1 << (n)))
-#define VIFM_CLR(n, m) ((m) &= ~(1 << (n)))
-#define VIFM_ISSET(n, m) ((m) & (1 << (n)))
-#define VIFM_CLRALL(m) ((m) = 0x00000000)
-#define VIFM_COPY(mfrom, mto) ((mto) = (mfrom))
-#define VIFM_SAME(m1, m2) ((m1) == (m2))
-
-
-/*
- * Argument structure for MRT_ADD_VIF.
- * (MRT_DEL_VIF takes a single vifi_t argument.)
- */
-struct vifctl {
- vifi_t vifc_vifi; /* the index of the vif to be added */
- u_char vifc_flags; /* VIFF_ flags defined below */
- u_char vifc_threshold; /* min ttl required to forward on vif */
- u_int vifc_rate_limit; /* max rate */
- struct in_addr vifc_lcl_addr; /* local interface address */
- struct in_addr vifc_rmt_addr; /* remote address (tunnels only) */
-};
-
-#define VIFF_TUNNEL 0x1 /* vif represents a tunnel end-point */
-#define VIFF_SRCRT 0x2 /* tunnel uses IP source routing */
-
-/*
- * Argument structure for MRT_ADD_MFC and MRT_DEL_MFC
- * (mfcc_tos to be added at a future point)
- */
-struct mfcctl {
- struct in_addr mfcc_origin; /* ip origin of mcasts */
- struct in_addr mfcc_mcastgrp; /* multicast group associated*/
- vifi_t mfcc_parent; /* incoming vif */
- u_char mfcc_ttls[MAXVIFS]; /* forwarding ttls on vifs */
-};
-
-/*
- * The kernel's multicast routing statistics.
- */
-struct mrtstat {
- u_long mrts_mfc_lookups; /* # forw. cache hash table hits */
- u_long mrts_mfc_misses; /* # forw. cache hash table misses */
- u_long mrts_upcalls; /* # calls to mrouted */
- u_long mrts_no_route; /* no route for packet's origin */
- u_long mrts_bad_tunnel; /* malformed tunnel options */
- u_long mrts_cant_tunnel; /* no room for tunnel options */
- u_long mrts_wrong_if; /* arrived on wrong interface */
- u_long mrts_upq_ovflw; /* upcall Q overflow */
- u_long mrts_cache_cleanups; /* # entries with no upcalls */
- u_long mrts_drop_sel; /* pkts dropped selectively */
- u_long mrts_q_overflow; /* pkts dropped - Q overflow */
- u_long mrts_pkt2large; /* pkts dropped - size > BKT SIZE */
- u_long mrts_upq_sockfull; /* upcalls dropped - socket full */
-};
-
-/*
- * Argument structure used by mrouted to get src-grp pkt counts
- */
-struct sioc_sg_req {
- struct in_addr src;
- struct in_addr grp;
- u_long pktcnt;
- u_long bytecnt;
- u_long wrong_if;
-};
-
-/*
- * Argument structure used by mrouted to get vif pkt counts
- */
-struct sioc_vif_req {
- vifi_t vifi; /* vif number */
- u_long icount; /* Input packet count on vif */
- u_long ocount; /* Output packet count on vif */
- u_long ibytes; /* Input byte count on vif */
- u_long obytes; /* Output byte count on vif */
-};
-
-
-/*
- * The kernel's virtual-interface structure.
- */
-struct vif {
- u_char v_flags; /* VIFF_ flags defined above */
- u_char v_threshold; /* min ttl required to forward on vif*/
- u_int v_rate_limit; /* max rate */
- struct tbf *v_tbf; /* token bucket structure at intf. */
- struct in_addr v_lcl_addr; /* local interface address */
- struct in_addr v_rmt_addr; /* remote address (tunnels only) */
- struct ifnet *v_ifp; /* pointer to interface */
- u_long v_pkt_in; /* # pkts in on interface */
- u_long v_pkt_out; /* # pkts out on interface */
- u_long v_bytes_in; /* # bytes in on interface */
- u_long v_bytes_out; /* # bytes out on interface */
- struct route v_route; /* cached route if this is a tunnel */
- u_int v_rsvp_on; /* RSVP listening on this vif */
- struct socket *v_rsvpd; /* RSVP daemon socket */
-};
-
-/*
- * The kernel's multicast forwarding cache entry structure
- * (A field for the type of service (mfc_tos) is to be added
- * at a future point)
- */
-struct mfc {
- struct in_addr mfc_origin; /* IP origin of mcasts */
- struct in_addr mfc_mcastgrp; /* multicast group associated*/
- vifi_t mfc_parent; /* incoming vif */
- u_char mfc_ttls[MAXVIFS]; /* forwarding ttls on vifs */
- u_long mfc_pkt_cnt; /* pkt count for src-grp */
- u_long mfc_byte_cnt; /* byte count for src-grp */
- u_long mfc_wrong_if; /* wrong if for src-grp */
- int mfc_expire; /* time to clean entry up */
- struct timeval mfc_last_assert; /* last time I sent an assert*/
-};
-
-/*
- * Struct used to communicate from kernel to multicast router
- * note the convenient similarity to an IP packet
- */
-struct igmpmsg {
- u_long unused1;
- u_long unused2;
- u_char im_msgtype; /* what type of message */
-#define IGMPMSG_NOCACHE 1
-#define IGMPMSG_WRONGVIF 2
- u_char im_mbz; /* must be zero */
- u_char im_vif; /* vif rec'd on */
- u_char unused3;
- struct in_addr im_src, im_dst;
-};
-
-/*
- * Argument structure used for pkt info. while upcall is made
- */
-struct rtdetq {
- struct mbuf *m; /* A copy of the packet */
- struct ifnet *ifp; /* Interface pkt came in on */
- vifi_t xmt_vif; /* Saved copy of imo_multicast_vif */
-#ifdef UPCALL_TIMING
- struct timeval t; /* Timestamp */
-#endif /* UPCALL_TIMING */
-};
-
-#define MFCTBLSIZ 256
-#if (MFCTBLSIZ & (MFCTBLSIZ - 1)) == 0 /* from sys:route.h */
-#define MFCHASHMOD(h) ((h) & (MFCTBLSIZ - 1))
-#else
-#define MFCHASHMOD(h) ((h) % MFCTBLSIZ)
-#endif
-
-#define MAX_UPQ 4 /* max. no of pkts in upcall Q */
-
-/*
- * Token Bucket filter code
- */
-#define MAX_BKT_SIZE 10000 /* 10K bytes size */
-#define MAXQSIZE 10 /* max # of pkts in queue */
-
-/*
- * the token bucket filter at each vif
- */
-struct tbf
-{
- struct timeval tbf_last_pkt_t; /* arr. time of last pkt */
- u_long tbf_n_tok; /* no of tokens in bucket */
- u_long tbf_q_len; /* length of queue at this vif */
- u_long tbf_max_q_len; /* max. queue length */
- struct mbuf *tbf_q; /* Packet queue */
- struct mbuf *tbf_t; /* tail-insertion pointer */
-};
-
-#ifdef KERNEL
-
-extern int (*ip_mrouter_set) __P((int, struct socket *, struct mbuf *));
-extern int (*ip_mrouter_get) __P((int, struct socket *, struct mbuf **));
-extern int (*ip_mrouter_done) __P((void));
-#ifdef MROUTING
-extern int (*mrt_ioctl) __P((int, caddr_t));
-#else
-extern int (*mrt_ioctl) __P((int, caddr_t, struct proc *));
-#endif
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_IP_MROUTE_H_ */
diff --git a/c/src/lib/libnetworking/netinet/ip_output.c b/c/src/lib/libnetworking/netinet/ip_output.c
deleted file mode 100644
index 810f6c7479..0000000000
--- a/c/src/lib/libnetworking/netinet/ip_output.c
+++ /dev/null
@@ -1,1307 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 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.
- *
- * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
- * $Id$
- */
-
-#define _IP_VHL
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/errno.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-
-#ifdef vax
-#include <machine/mtpr.h>
-#endif
-#include <machine/in_cksum.h>
-
-#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1
-#undef COMPAT_IPFW
-#define COMPAT_IPFW 1
-#else
-#undef COMPAT_IPFW
-#endif
-
-u_short ip_id;
-
-static struct mbuf *ip_insertoptions __P((struct mbuf *, struct mbuf *, int *));
-static void ip_mloopback
- __P((struct ifnet *, struct mbuf *, struct sockaddr_in *, int));
-static int ip_getmoptions
- __P((int, struct ip_moptions *, struct mbuf **));
-static int ip_optcopy __P((struct ip *, struct ip *));
-static int ip_pcbopts __P((struct mbuf **, struct mbuf *));
-static int ip_setmoptions
- __P((int, struct ip_moptions **, struct mbuf *));
-
-extern struct protosw inetsw[];
-
-/*
- * IP output. The packet in mbuf chain m contains a skeletal IP
- * header (with len, off, ttl, proto, tos, src, dst).
- * The mbuf chain containing the packet will be freed.
- * The mbuf opt, if present, will not be freed.
- */
-int
-ip_output(m0, opt, ro, flags, imo)
- struct mbuf *m0;
- struct mbuf *opt;
- struct route *ro;
- int flags;
- struct ip_moptions *imo;
-{
- struct ip *ip, *mhip;
- struct ifnet *ifp;
- struct mbuf *m = m0;
- int hlen = sizeof (struct ip);
- int len, off, error = 0;
- struct sockaddr_in *dst;
- struct in_ifaddr *ia;
- int isbroadcast;
-
-#ifdef DIAGNOSTIC
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("ip_output no HDR");
- if (!ro)
- panic("ip_output no route, proto = %d",
- mtod(m, struct ip *)->ip_p);
-#endif
- if (opt) {
- m = ip_insertoptions(m, opt, &len);
- hlen = len;
- }
- ip = mtod(m, struct ip *);
- /*
- * Fill in IP header.
- */
- if ((flags & (IP_FORWARDING|IP_RAWOUTPUT)) == 0) {
- ip->ip_vhl = IP_MAKE_VHL(IPVERSION, hlen >> 2);
- ip->ip_off &= IP_DF;
- ip->ip_id = htons(ip_id++);
- ipstat.ips_localout++;
- } else {
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
- }
-
- dst = (struct sockaddr_in *)&ro->ro_dst;
- /*
- * If there is a cached route,
- * check that it is to the same destination
- * and is still up. If not, free it and try again.
- */
- if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 ||
- dst->sin_addr.s_addr != ip->ip_dst.s_addr)) {
- RTFREE(ro->ro_rt);
- ro->ro_rt = (struct rtentry *)0;
- }
- if (ro->ro_rt == 0) {
- dst->sin_family = AF_INET;
- dst->sin_len = sizeof(*dst);
- dst->sin_addr = ip->ip_dst;
- }
- /*
- * If routing to interface only,
- * short circuit routing lookup.
- */
-#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
-#define sintosa(sin) ((struct sockaddr *)(sin))
- if (flags & IP_ROUTETOIF) {
- if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == 0 &&
- (ia = ifatoia(ifa_ifwithnet(sintosa(dst)))) == 0) {
- ipstat.ips_noroute++;
- error = ENETUNREACH;
- goto bad;
- }
- ifp = ia->ia_ifp;
- ip->ip_ttl = 1;
- isbroadcast = in_broadcast(dst->sin_addr, ifp);
- } else {
- /*
- * If this is the case, we probably don't want to allocate
- * a protocol-cloned route since we didn't get one from the
- * ULP. This lets TCP do its thing, while not burdening
- * forwarding or ICMP with the overhead of cloning a route.
- * Of course, we still want to do any cloning requested by
- * the link layer, as this is probably required in all cases
- * for correct operation (as it is for ARP).
- */
- if (ro->ro_rt == 0)
- rtalloc_ign(ro, RTF_PRCLONING);
- if (ro->ro_rt == 0) {
- ipstat.ips_noroute++;
- error = EHOSTUNREACH;
- goto bad;
- }
- ia = ifatoia(ro->ro_rt->rt_ifa);
- ifp = ro->ro_rt->rt_ifp;
- ro->ro_rt->rt_use++;
- if (ro->ro_rt->rt_flags & RTF_GATEWAY)
- dst = (struct sockaddr_in *)ro->ro_rt->rt_gateway;
- if (ro->ro_rt->rt_flags & RTF_HOST)
- isbroadcast = (ro->ro_rt->rt_flags & RTF_BROADCAST);
- else
- isbroadcast = in_broadcast(dst->sin_addr, ifp);
- }
- if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- struct in_multi *inm;
-
- m->m_flags |= M_MCAST;
- /*
- * IP destination address is multicast. Make sure "dst"
- * still points to the address in "ro". (It may have been
- * changed to point to a gateway address, above.)
- */
- dst = (struct sockaddr_in *)&ro->ro_dst;
- /*
- * See if the caller provided any multicast options
- */
- if (imo != NULL) {
- ip->ip_ttl = imo->imo_multicast_ttl;
- if (imo->imo_multicast_ifp != NULL)
- ifp = imo->imo_multicast_ifp;
- if (imo->imo_multicast_vif != -1)
- ip->ip_src.s_addr =
- ip_mcast_src(imo->imo_multicast_vif);
- } else
- ip->ip_ttl = IP_DEFAULT_MULTICAST_TTL;
- /*
- * Confirm that the outgoing interface supports multicast.
- */
- if ((imo == NULL) || (imo->imo_multicast_vif == -1)) {
- if ((ifp->if_flags & IFF_MULTICAST) == 0) {
- ipstat.ips_noroute++;
- error = ENETUNREACH;
- goto bad;
- }
- }
- /*
- * If source address not specified yet, use address
- * of outgoing interface.
- */
- if (ip->ip_src.s_addr == INADDR_ANY) {
- register struct in_ifaddr *ia;
-
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if (ia->ia_ifp == ifp) {
- ip->ip_src = IA_SIN(ia)->sin_addr;
- break;
- }
- }
-
- IN_LOOKUP_MULTI(ip->ip_dst, ifp, inm);
- if (inm != NULL &&
- (imo == NULL || imo->imo_multicast_loop)) {
- /*
- * If we belong to the destination multicast group
- * on the outgoing interface, and the caller did not
- * forbid loopback, loop back a copy.
- */
- ip_mloopback(ifp, m, dst, hlen);
- }
- else {
- /*
- * If we are acting as a multicast router, perform
- * multicast forwarding as if the packet had just
- * arrived on the interface to which we are about
- * to send. The multicast forwarding function
- * recursively calls this function, using the
- * IP_FORWARDING flag to prevent infinite recursion.
- *
- * Multicasts that are looped back by ip_mloopback(),
- * above, will be forwarded by the ip_input() routine,
- * if necessary.
- */
- if (ip_mrouter && (flags & IP_FORWARDING) == 0) {
- /*
- * Check if rsvp daemon is running. If not, don't
- * set ip_moptions. This ensures that the packet
- * is multicast and not just sent down one link
- * as prescribed by rsvpd.
- */
- if (!rsvp_on)
- imo = NULL;
- if (ip_mforward(ip, ifp, m, imo) != 0) {
- m_freem(m);
- goto done;
- }
- }
- }
-
- /*
- * Multicasts with a time-to-live of zero may be looped-
- * back, above, but must not be transmitted on a network.
- * Also, multicasts addressed to the loopback interface
- * are not sent -- the above call to ip_mloopback() will
- * loop back a copy if this host actually belongs to the
- * destination group on the loopback interface.
- */
- if (ip->ip_ttl == 0 || ifp->if_flags & IFF_LOOPBACK) {
- m_freem(m);
- goto done;
- }
-
- goto sendit;
- }
-#ifndef notdef
- /*
- * If source address not specified yet, use address
- * of outgoing interface.
- */
- if (ip->ip_src.s_addr == INADDR_ANY)
- ip->ip_src = IA_SIN(ia)->sin_addr;
-#endif
- /*
- * Verify that we have any chance at all of being able to queue
- * the packet or packet fragments
- */
- if ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >=
- ifp->if_snd.ifq_maxlen) {
- error = ENOBUFS;
- goto bad;
- }
-
- /*
- * Look for broadcast address and
- * and verify user is allowed to send
- * such a packet.
- */
- if (isbroadcast) {
- if ((ifp->if_flags & IFF_BROADCAST) == 0) {
- error = EADDRNOTAVAIL;
- goto bad;
- }
- if ((flags & IP_ALLOWBROADCAST) == 0) {
- error = EACCES;
- goto bad;
- }
- /* don't allow broadcast messages to be fragmented */
- if ((u_short)ip->ip_len > ifp->if_mtu) {
- error = EMSGSIZE;
- goto bad;
- }
- m->m_flags |= M_BCAST;
- } else {
- m->m_flags &= ~M_BCAST;
- }
-
-sendit:
- /*
- * IpHack's section.
- * - Xlate: translate packet's addr/port (NAT).
- * - Firewall: deny/allow/etc.
- * - Wrap: fake packet's addr/port <unimpl.>
- * - Encapsulate: put it in another IP and send out. <unimp.>
- */
-
-#ifdef COMPAT_IPFW
- if (ip_nat_ptr && !(*ip_nat_ptr)(&ip, &m, ifp, IP_NAT_OUT)) {
- error = EACCES;
- goto done;
- }
-
- /*
- * Check with the firewall...
- */
- if (ip_fw_chk_ptr) {
-#ifdef IPDIVERT
- ip_divert_port = (*ip_fw_chk_ptr)(&ip,
- hlen, ifp, ip_divert_ignore, &m);
- ip_divert_ignore = 0;
- if (ip_divert_port) { /* Divert packet */
- (*inetsw[ip_protox[IPPROTO_DIVERT]].pr_input)(m, 0);
- goto done;
- }
-#else
- /* If ipfw says divert, we have to just drop packet */
- if ((*ip_fw_chk_ptr)(&ip, hlen, ifp, 0, &m)) {
- m_freem(m);
- goto done;
- }
-#endif
- if (!m) {
- error = EACCES;
- goto done;
- }
- }
-#endif /* COMPAT_IPFW */
-
- /*
- * If small enough for interface, can just send directly.
- */
- if ((u_short)ip->ip_len <= ifp->if_mtu) {
- ip->ip_len = htons((u_short)ip->ip_len);
- ip->ip_off = htons((u_short)ip->ip_off);
- ip->ip_sum = 0;
- if (ip->ip_vhl == IP_VHL_BORING) {
- ip->ip_sum = in_cksum_hdr(ip);
- } else {
- ip->ip_sum = in_cksum(m, hlen);
- }
- error = (*ifp->if_output)(ifp, m,
- (struct sockaddr *)dst, ro->ro_rt);
- goto done;
- }
- /*
- * Too large for interface; fragment if possible.
- * Must be able to put at least 8 bytes per fragment.
- */
- if (ip->ip_off & IP_DF) {
- error = EMSGSIZE;
- /*
- * This case can happen if the user changed the MTU
- * of an interface after enabling IP on it. Because
- * most netifs don't keep track of routes pointing to
- * them, there is no way for one to update all its
- * routes when the MTU is changed.
- */
- if ((ro->ro_rt->rt_flags & (RTF_UP | RTF_HOST))
- && !(ro->ro_rt->rt_rmx.rmx_locks & RTV_MTU)
- && (ro->ro_rt->rt_rmx.rmx_mtu > ifp->if_mtu)) {
- ro->ro_rt->rt_rmx.rmx_mtu = ifp->if_mtu;
- }
- ipstat.ips_cantfrag++;
- goto bad;
- }
- len = (ifp->if_mtu - hlen) &~ 7;
- if (len < 8) {
- error = EMSGSIZE;
- goto bad;
- }
-
- {
- int mhlen, firstlen = len;
- struct mbuf **mnext = &m->m_nextpkt;
-
- /*
- * Loop through length of segment after first fragment,
- * make new header and copy data of each part and link onto chain.
- */
- m0 = m;
- mhlen = sizeof (struct ip);
- for (off = hlen + len; off < (u_short)ip->ip_len; off += len) {
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == 0) {
- error = ENOBUFS;
- ipstat.ips_odropped++;
- goto sendorfree;
- }
- m->m_data += max_linkhdr;
- mhip = mtod(m, struct ip *);
- *mhip = *ip;
- if (hlen > sizeof (struct ip)) {
- mhlen = ip_optcopy(ip, mhip) + sizeof (struct ip);
- mhip->ip_vhl = IP_MAKE_VHL(IPVERSION, mhlen >> 2);
- }
- m->m_len = mhlen;
- mhip->ip_off = ((off - hlen) >> 3) + (ip->ip_off & ~IP_MF);
- if (ip->ip_off & IP_MF)
- mhip->ip_off |= IP_MF;
- if (off + len >= (u_short)ip->ip_len)
- len = (u_short)ip->ip_len - off;
- else
- mhip->ip_off |= IP_MF;
- mhip->ip_len = htons((u_short)(len + mhlen));
- m->m_next = m_copy(m0, off, len);
- if (m->m_next == 0) {
- (void) m_free(m);
- error = ENOBUFS; /* ??? */
- ipstat.ips_odropped++;
- goto sendorfree;
- }
- m->m_pkthdr.len = mhlen + len;
- m->m_pkthdr.rcvif = (struct ifnet *)0;
- mhip->ip_off = htons((u_short)mhip->ip_off);
- mhip->ip_sum = 0;
- if (mhip->ip_vhl == IP_VHL_BORING) {
- mhip->ip_sum = in_cksum_hdr(mhip);
- } else {
- mhip->ip_sum = in_cksum(m, mhlen);
- }
- *mnext = m;
- mnext = &m->m_nextpkt;
- ipstat.ips_ofragments++;
- }
- /*
- * Update first fragment by trimming what's been copied out
- * and updating header, then send each fragment (in order).
- */
- m = m0;
- m_adj(m, hlen + firstlen - (u_short)ip->ip_len);
- m->m_pkthdr.len = hlen + firstlen;
- ip->ip_len = htons((u_short)m->m_pkthdr.len);
- ip->ip_off = htons((u_short)(ip->ip_off | IP_MF));
- ip->ip_sum = 0;
- if (ip->ip_vhl == IP_VHL_BORING) {
- ip->ip_sum = in_cksum_hdr(ip);
- } else {
- ip->ip_sum = in_cksum(m, hlen);
- }
-sendorfree:
- for (m = m0; m; m = m0) {
- m0 = m->m_nextpkt;
- m->m_nextpkt = 0;
- if (error == 0)
- error = (*ifp->if_output)(ifp, m,
- (struct sockaddr *)dst, ro->ro_rt);
- else
- m_freem(m);
- }
-
- if (error == 0)
- ipstat.ips_fragmented++;
- }
-done:
- return (error);
-bad:
- m_freem(m0);
- goto done;
-}
-
-/*
- * Insert IP options into preformed packet.
- * Adjust IP destination as required for IP source routing,
- * as indicated by a non-zero in_addr at the start of the options.
- *
- * XXX This routine assumes that the packet has no options in place.
- */
-static struct mbuf *
-ip_insertoptions(m, opt, phlen)
- register struct mbuf *m;
- struct mbuf *opt;
- int *phlen;
-{
- register struct ipoption *p = mtod(opt, struct ipoption *);
- struct mbuf *n;
- register struct ip *ip = mtod(m, struct ip *);
- unsigned optlen;
-
- optlen = opt->m_len - sizeof(p->ipopt_dst);
- if (optlen + (u_short)ip->ip_len > IP_MAXPACKET)
- return (m); /* XXX should fail */
- if (p->ipopt_dst.s_addr)
- ip->ip_dst = p->ipopt_dst;
- if (m->m_flags & M_EXT || m->m_data - optlen < m->m_pktdat) {
- MGETHDR(n, M_DONTWAIT, MT_HEADER);
- if (n == 0)
- return (m);
- n->m_pkthdr.len = m->m_pkthdr.len + optlen;
- m->m_len -= sizeof(struct ip);
- m->m_data += sizeof(struct ip);
- n->m_next = m;
- m = n;
- m->m_len = optlen + sizeof(struct ip);
- m->m_data += max_linkhdr;
- (void)memcpy(mtod(m, void *), ip, sizeof(struct ip));
- } else {
- m->m_data -= optlen;
- m->m_len += optlen;
- m->m_pkthdr.len += optlen;
- ovbcopy((caddr_t)ip, mtod(m, caddr_t), sizeof(struct ip));
- }
- ip = mtod(m, struct ip *);
- bcopy(p->ipopt_list, ip + 1, optlen);
- *phlen = sizeof(struct ip) + optlen;
- ip->ip_vhl = IP_MAKE_VHL(IPVERSION, *phlen >> 2);
- ip->ip_len += optlen;
- return (m);
-}
-
-/*
- * Copy options from ip to jp,
- * omitting those not copied during fragmentation.
- */
-static int
-ip_optcopy(ip, jp)
- struct ip *ip, *jp;
-{
- register u_char *cp, *dp;
- int opt, optlen, cnt;
-
- cp = (u_char *)(ip + 1);
- dp = (u_char *)(jp + 1);
- cnt = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof (struct ip);
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[0];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP) {
- /* Preserve for IP mcast tunnel's LSRR alignment. */
- *dp++ = IPOPT_NOP;
- optlen = 1;
- continue;
- } else
- optlen = cp[IPOPT_OLEN];
- /* bogus lengths should have been caught by ip_dooptions */
- if (optlen > cnt)
- optlen = cnt;
- if (IPOPT_COPIED(opt)) {
- bcopy(cp, dp, optlen);
- dp += optlen;
- }
- }
- for (optlen = dp - (u_char *)(jp+1); optlen & 0x3; optlen++)
- *dp++ = IPOPT_EOL;
- return (optlen);
-}
-
-/*
- * IP socket option processing.
- */
-int
-ip_ctloutput(op, so, level, optname, mp)
- int op;
- struct socket *so;
- int level, optname;
- struct mbuf **mp;
-{
- register struct inpcb *inp = sotoinpcb(so);
- register struct mbuf *m = *mp;
- register int optval = 0;
- int error = 0;
-
- if (level != IPPROTO_IP) {
- error = EINVAL;
- if (op == PRCO_SETOPT && *mp)
- (void) m_free(*mp);
- } else switch (op) {
-
- case PRCO_SETOPT:
- switch (optname) {
- case IP_OPTIONS:
-#ifdef notyet
- case IP_RETOPTS:
- return (ip_pcbopts(optname, &inp->inp_options, m));
-#else
- return (ip_pcbopts(&inp->inp_options, m));
-#endif
-
- case IP_TOS:
- case IP_TTL:
- case IP_RECVOPTS:
- case IP_RECVRETOPTS:
- case IP_RECVDSTADDR:
- case IP_RECVIF:
- if (m == 0 || m->m_len != sizeof(int))
- error = EINVAL;
- else {
- optval = *mtod(m, int *);
- switch (optname) {
-
- case IP_TOS:
- inp->inp_ip_tos = optval;
- break;
-
- case IP_TTL:
- inp->inp_ip_ttl = optval;
- break;
-#define OPTSET(bit) \
- if (optval) \
- inp->inp_flags |= bit; \
- else \
- inp->inp_flags &= ~bit;
-
- case IP_RECVOPTS:
- OPTSET(INP_RECVOPTS);
- break;
-
- case IP_RECVRETOPTS:
- OPTSET(INP_RECVRETOPTS);
- break;
-
- case IP_RECVDSTADDR:
- OPTSET(INP_RECVDSTADDR);
- break;
-
- case IP_RECVIF:
- OPTSET(INP_RECVIF);
- break;
- }
- }
- break;
-#undef OPTSET
-
- case IP_MULTICAST_IF:
- case IP_MULTICAST_VIF:
- case IP_MULTICAST_TTL:
- case IP_MULTICAST_LOOP:
- case IP_ADD_MEMBERSHIP:
- case IP_DROP_MEMBERSHIP:
- error = ip_setmoptions(optname, &inp->inp_moptions, m);
- break;
-
- case IP_PORTRANGE:
- if (m == 0 || m->m_len != sizeof(int))
- error = EINVAL;
- else {
- optval = *mtod(m, int *);
-
- switch (optval) {
-
- case IP_PORTRANGE_DEFAULT:
- inp->inp_flags &= ~(INP_LOWPORT);
- inp->inp_flags &= ~(INP_HIGHPORT);
- break;
-
- case IP_PORTRANGE_HIGH:
- inp->inp_flags &= ~(INP_LOWPORT);
- inp->inp_flags |= INP_HIGHPORT;
- break;
-
- case IP_PORTRANGE_LOW:
- inp->inp_flags &= ~(INP_HIGHPORT);
- inp->inp_flags |= INP_LOWPORT;
- break;
-
- default:
- error = EINVAL;
- break;
- }
- }
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- if (m)
- (void)m_free(m);
- break;
-
- case PRCO_GETOPT:
- switch (optname) {
- case IP_OPTIONS:
- case IP_RETOPTS:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- if (inp->inp_options) {
- m->m_len = inp->inp_options->m_len;
- bcopy(mtod(inp->inp_options, void *),
- mtod(m, void *), m->m_len);
- } else
- m->m_len = 0;
- break;
-
- case IP_TOS:
- case IP_TTL:
- case IP_RECVOPTS:
- case IP_RECVRETOPTS:
- case IP_RECVDSTADDR:
- case IP_RECVIF:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof(int);
- switch (optname) {
-
- case IP_TOS:
- optval = inp->inp_ip_tos;
- break;
-
- case IP_TTL:
- optval = inp->inp_ip_ttl;
- break;
-
-#define OPTBIT(bit) (inp->inp_flags & bit ? 1 : 0)
-
- case IP_RECVOPTS:
- optval = OPTBIT(INP_RECVOPTS);
- break;
-
- case IP_RECVRETOPTS:
- optval = OPTBIT(INP_RECVRETOPTS);
- break;
-
- case IP_RECVDSTADDR:
- optval = OPTBIT(INP_RECVDSTADDR);
- break;
-
- case IP_RECVIF:
- optval = OPTBIT(INP_RECVIF);
- break;
- }
- *mtod(m, int *) = optval;
- break;
-
- case IP_MULTICAST_IF:
- case IP_MULTICAST_VIF:
- case IP_MULTICAST_TTL:
- case IP_MULTICAST_LOOP:
- case IP_ADD_MEMBERSHIP:
- case IP_DROP_MEMBERSHIP:
- error = ip_getmoptions(optname, inp->inp_moptions, mp);
- break;
-
- case IP_PORTRANGE:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof(int);
-
- if (inp->inp_flags & INP_HIGHPORT)
- optval = IP_PORTRANGE_HIGH;
- else if (inp->inp_flags & INP_LOWPORT)
- optval = IP_PORTRANGE_LOW;
- else
- optval = 0;
-
- *mtod(m, int *) = optval;
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- break;
- }
- return (error);
-}
-
-/*
- * Set up IP options in pcb for insertion in output packets.
- * Store in mbuf with pointer in pcbopt, adding pseudo-option
- * with destination address if source routed.
- */
-static int
-#ifdef notyet
-ip_pcbopts(optname, pcbopt, m)
- int optname;
-#else
-ip_pcbopts(pcbopt, m)
-#endif
- struct mbuf **pcbopt;
- register struct mbuf *m;
-{
- register int cnt, optlen;
- register u_char *cp;
- u_char opt;
-
- /* turn off any old options */
- if (*pcbopt)
- (void)m_free(*pcbopt);
- *pcbopt = 0;
- if (m == (struct mbuf *)0 || m->m_len == 0) {
- /*
- * Only turning off any previous options.
- */
- if (m)
- (void)m_free(m);
- return (0);
- }
-
-#ifndef vax
- if (m->m_len % sizeof(long))
- goto bad;
-#endif
- /*
- * IP first-hop destination address will be stored before
- * actual options; move other options back
- * and clear it when none present.
- */
- if (m->m_data + m->m_len + sizeof(struct in_addr) >= &m->m_dat[MLEN])
- goto bad;
- cnt = m->m_len;
- m->m_len += sizeof(struct in_addr);
- cp = mtod(m, u_char *) + sizeof(struct in_addr);
- ovbcopy(mtod(m, caddr_t), (caddr_t)cp, (unsigned)cnt);
- bzero(mtod(m, caddr_t), sizeof(struct in_addr));
-
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[IPOPT_OLEN];
- if (optlen <= IPOPT_OLEN || optlen > cnt)
- goto bad;
- }
- switch (opt) {
-
- default:
- break;
-
- case IPOPT_LSRR:
- case IPOPT_SSRR:
- /*
- * user process specifies route as:
- * ->A->B->C->D
- * D must be our final destination (but we can't
- * check that since we may not have connected yet).
- * A is first hop destination, which doesn't appear in
- * actual IP option, but is stored before the options.
- */
- if (optlen < IPOPT_MINOFF - 1 + sizeof(struct in_addr))
- goto bad;
- m->m_len -= sizeof(struct in_addr);
- cnt -= sizeof(struct in_addr);
- optlen -= sizeof(struct in_addr);
- cp[IPOPT_OLEN] = optlen;
- /*
- * Move first hop before start of options.
- */
- bcopy((caddr_t)&cp[IPOPT_OFFSET+1], mtod(m, caddr_t),
- sizeof(struct in_addr));
- /*
- * Then copy rest of options back
- * to close up the deleted entry.
- */
- ovbcopy((caddr_t)(&cp[IPOPT_OFFSET+1] +
- sizeof(struct in_addr)),
- (caddr_t)&cp[IPOPT_OFFSET+1],
- (unsigned)cnt + sizeof(struct in_addr));
- break;
- }
- }
- if (m->m_len > MAX_IPOPTLEN + sizeof(struct in_addr))
- goto bad;
- *pcbopt = m;
- return (0);
-
-bad:
- (void)m_free(m);
- return (EINVAL);
-}
-
-/*
- * Set the IP multicast options in response to user setsockopt().
- */
-static int
-ip_setmoptions(optname, imop, m)
- int optname;
- struct ip_moptions **imop;
- struct mbuf *m;
-{
- register int error = 0;
- u_char loop;
- register int i;
- struct in_addr addr;
- register struct ip_mreq *mreq;
- register struct ifnet *ifp;
- register struct ip_moptions *imo = *imop;
- struct route ro;
- register struct sockaddr_in *dst;
- int s;
-
- if (imo == NULL) {
- /*
- * No multicast option buffer attached to the pcb;
- * allocate one and initialize to default values.
- */
- imo = (struct ip_moptions*)malloc(sizeof(*imo), M_IPMOPTS,
- M_WAITOK);
-
- if (imo == NULL)
- return (ENOBUFS);
- *imop = imo;
- imo->imo_multicast_ifp = NULL;
- imo->imo_multicast_vif = -1;
- imo->imo_multicast_ttl = IP_DEFAULT_MULTICAST_TTL;
- imo->imo_multicast_loop = IP_DEFAULT_MULTICAST_LOOP;
- imo->imo_num_memberships = 0;
- }
-
- switch (optname) {
- /* store an index number for the vif you wanna use in the send */
- case IP_MULTICAST_VIF:
- if (!legal_vif_num) {
- error = EOPNOTSUPP;
- break;
- }
- if (m == NULL || m->m_len != sizeof(int)) {
- error = EINVAL;
- break;
- }
- i = *(mtod(m, int *));
- if (!legal_vif_num(i) && (i != -1)) {
- error = EINVAL;
- break;
- }
- imo->imo_multicast_vif = i;
- break;
-
- case IP_MULTICAST_IF:
- /*
- * Select the interface for outgoing multicast packets.
- */
- if (m == NULL || m->m_len != sizeof(struct in_addr)) {
- error = EINVAL;
- break;
- }
- addr = *(mtod(m, struct in_addr *));
- /*
- * INADDR_ANY is used to remove a previous selection.
- * When no interface is selected, a default one is
- * chosen every time a multicast packet is sent.
- */
- if (addr.s_addr == INADDR_ANY) {
- imo->imo_multicast_ifp = NULL;
- break;
- }
- /*
- * The selected interface is identified by its local
- * IP address. Find the interface and confirm that
- * it supports multicasting.
- */
- s = splimp();
- INADDR_TO_IFP(addr, ifp);
- if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) {
- splx(s);
- error = EADDRNOTAVAIL;
- break;
- }
- imo->imo_multicast_ifp = ifp;
- splx(s);
- break;
-
- case IP_MULTICAST_TTL:
- /*
- * Set the IP time-to-live for outgoing multicast packets.
- */
- if (m == NULL || m->m_len != 1) {
- error = EINVAL;
- break;
- }
- imo->imo_multicast_ttl = *(mtod(m, u_char *));
- break;
-
- case IP_MULTICAST_LOOP:
- /*
- * Set the loopback flag for outgoing multicast packets.
- * Must be zero or one.
- */
- if (m == NULL || m->m_len != 1 ||
- (loop = *(mtod(m, u_char *))) > 1) {
- error = EINVAL;
- break;
- }
- imo->imo_multicast_loop = loop;
- break;
-
- case IP_ADD_MEMBERSHIP:
- /*
- * Add a multicast group membership.
- * Group must be a valid IP multicast address.
- */
- if (m == NULL || m->m_len != sizeof(struct ip_mreq)) {
- error = EINVAL;
- break;
- }
- mreq = mtod(m, struct ip_mreq *);
- if (!IN_MULTICAST(ntohl(mreq->imr_multiaddr.s_addr))) {
- error = EINVAL;
- break;
- }
- s = splimp();
- /*
- * If no interface address was provided, use the interface of
- * the route to the given multicast address.
- */
- if (mreq->imr_interface.s_addr == INADDR_ANY) {
- bzero((caddr_t)&ro, sizeof(ro));
- dst = (struct sockaddr_in *)&ro.ro_dst;
- dst->sin_len = sizeof(*dst);
- dst->sin_family = AF_INET;
- dst->sin_addr = mreq->imr_multiaddr;
- rtalloc(&ro);
- if (ro.ro_rt == NULL) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- ifp = ro.ro_rt->rt_ifp;
- rtfree(ro.ro_rt);
- }
- else {
- INADDR_TO_IFP(mreq->imr_interface, ifp);
- }
-
- /*
- * See if we found an interface, and confirm that it
- * supports multicast.
- */
- if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- /*
- * See if the membership already exists or if all the
- * membership slots are full.
- */
- for (i = 0; i < imo->imo_num_memberships; ++i) {
- if (imo->imo_membership[i]->inm_ifp == ifp &&
- imo->imo_membership[i]->inm_addr.s_addr
- == mreq->imr_multiaddr.s_addr)
- break;
- }
- if (i < imo->imo_num_memberships) {
- error = EADDRINUSE;
- splx(s);
- break;
- }
- if (i == IP_MAX_MEMBERSHIPS) {
- error = ETOOMANYREFS;
- splx(s);
- break;
- }
- /*
- * Everything looks good; add a new record to the multicast
- * address list for the given interface.
- */
- if ((imo->imo_membership[i] =
- in_addmulti(&mreq->imr_multiaddr, ifp)) == NULL) {
- error = ENOBUFS;
- splx(s);
- break;
- }
- ++imo->imo_num_memberships;
- splx(s);
- break;
-
- case IP_DROP_MEMBERSHIP:
- /*
- * Drop a multicast group membership.
- * Group must be a valid IP multicast address.
- */
- if (m == NULL || m->m_len != sizeof(struct ip_mreq)) {
- error = EINVAL;
- break;
- }
- mreq = mtod(m, struct ip_mreq *);
- if (!IN_MULTICAST(ntohl(mreq->imr_multiaddr.s_addr))) {
- error = EINVAL;
- break;
- }
-
- s = splimp();
- /*
- * If an interface address was specified, get a pointer
- * to its ifnet structure.
- */
- if (mreq->imr_interface.s_addr == INADDR_ANY)
- ifp = NULL;
- else {
- INADDR_TO_IFP(mreq->imr_interface, ifp);
- if (ifp == NULL) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- }
- /*
- * Find the membership in the membership array.
- */
- for (i = 0; i < imo->imo_num_memberships; ++i) {
- if ((ifp == NULL ||
- imo->imo_membership[i]->inm_ifp == ifp) &&
- imo->imo_membership[i]->inm_addr.s_addr ==
- mreq->imr_multiaddr.s_addr)
- break;
- }
- if (i == imo->imo_num_memberships) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- /*
- * Give up the multicast address record to which the
- * membership points.
- */
- in_delmulti(imo->imo_membership[i]);
- /*
- * Remove the gap in the membership array.
- */
- for (++i; i < imo->imo_num_memberships; ++i)
- imo->imo_membership[i-1] = imo->imo_membership[i];
- --imo->imo_num_memberships;
- splx(s);
- break;
-
- default:
- error = EOPNOTSUPP;
- break;
- }
-
- /*
- * If all options have default values, no need to keep the mbuf.
- */
- if (imo->imo_multicast_ifp == NULL &&
- imo->imo_multicast_vif == -1 &&
- imo->imo_multicast_ttl == IP_DEFAULT_MULTICAST_TTL &&
- imo->imo_multicast_loop == IP_DEFAULT_MULTICAST_LOOP &&
- imo->imo_num_memberships == 0) {
- free(*imop, M_IPMOPTS);
- *imop = NULL;
- }
-
- return (error);
-}
-
-/*
- * Return the IP multicast options in response to user getsockopt().
- */
-static int
-ip_getmoptions(optname, imo, mp)
- int optname;
- register struct ip_moptions *imo;
- register struct mbuf **mp;
-{
- u_char *ttl;
- u_char *loop;
- struct in_addr *addr;
- struct in_ifaddr *ia;
-
- *mp = m_get(M_WAIT, MT_SOOPTS);
-
- switch (optname) {
-
- case IP_MULTICAST_VIF:
- if (imo != NULL)
- *(mtod(*mp, int *)) = imo->imo_multicast_vif;
- else
- *(mtod(*mp, int *)) = -1;
- (*mp)->m_len = sizeof(int);
- return(0);
-
- case IP_MULTICAST_IF:
- addr = mtod(*mp, struct in_addr *);
- (*mp)->m_len = sizeof(struct in_addr);
- if (imo == NULL || imo->imo_multicast_ifp == NULL)
- addr->s_addr = INADDR_ANY;
- else {
- IFP_TO_IA(imo->imo_multicast_ifp, ia);
- addr->s_addr = (ia == NULL) ? INADDR_ANY
- : IA_SIN(ia)->sin_addr.s_addr;
- }
- return (0);
-
- case IP_MULTICAST_TTL:
- ttl = mtod(*mp, u_char *);
- (*mp)->m_len = 1;
- *ttl = (imo == NULL) ? IP_DEFAULT_MULTICAST_TTL
- : imo->imo_multicast_ttl;
- return (0);
-
- case IP_MULTICAST_LOOP:
- loop = mtod(*mp, u_char *);
- (*mp)->m_len = 1;
- *loop = (imo == NULL) ? IP_DEFAULT_MULTICAST_LOOP
- : imo->imo_multicast_loop;
- return (0);
-
- default:
- return (EOPNOTSUPP);
- }
-}
-
-/*
- * Discard the IP multicast options.
- */
-void
-ip_freemoptions(imo)
- register struct ip_moptions *imo;
-{
- register int i;
-
- if (imo != NULL) {
- for (i = 0; i < imo->imo_num_memberships; ++i)
- in_delmulti(imo->imo_membership[i]);
- free(imo, M_IPMOPTS);
- }
-}
-
-/*
- * Routine called from ip_output() to loop back a copy of an IP multicast
- * packet to the input queue of a specified interface. Note that this
- * calls the output routine of the loopback "driver", but with an interface
- * pointer that might NOT be a loopback interface -- evil, but easier than
- * replicating that code here.
- */
-static void
-ip_mloopback(ifp, m, dst, hlen)
- struct ifnet *ifp;
- register struct mbuf *m;
- register struct sockaddr_in *dst;
- int hlen;
-{
- register struct ip *ip;
- struct mbuf *copym;
-
- copym = m_copy(m, 0, M_COPYALL);
- if (copym != NULL && (copym->m_flags & M_EXT || copym->m_len < hlen))
- copym = m_pullup(copym, hlen);
- if (copym != NULL) {
- /*
- * We don't bother to fragment if the IP length is greater
- * than the interface's MTU. Can this possibly matter?
- */
- ip = mtod(copym, struct ip *);
- ip->ip_len = htons((u_short)ip->ip_len);
- ip->ip_off = htons((u_short)ip->ip_off);
- ip->ip_sum = 0;
- if (ip->ip_vhl == IP_VHL_BORING) {
- ip->ip_sum = in_cksum_hdr(ip);
- } else {
- ip->ip_sum = in_cksum(copym, hlen);
- }
- /*
- * NB:
- * It's not clear whether there are any lingering
- * reentrancy problems in other areas which might
- * be exposed by using ip_input directly (in
- * particular, everything which modifies the packet
- * in-place). Yet another option is using the
- * protosw directly to deliver the looped back
- * packet. For the moment, we'll err on the side
- * of safety by continuing to abuse looutput().
- */
-#ifdef notdef
- copym->m_pkthdr.rcvif = ifp;
- ip_input(copym)
-#else
- (void) looutput(ifp, copym, (struct sockaddr *)dst, NULL);
-#endif
- }
-}
diff --git a/c/src/lib/libnetworking/netinet/ip_var.h b/c/src/lib/libnetworking/netinet/ip_var.h
deleted file mode 100644
index cc7908e9a3..0000000000
--- a/c/src/lib/libnetworking/netinet/ip_var.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)ip_var.h 8.2 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _NETINET_IP_VAR_H_
-#define _NETINET_IP_VAR_H_
-
-/*
- * Overlay for ip header used by other protocols (tcp, udp).
- */
-struct ipovly {
- caddr_t ih_next, ih_prev; /* for protocol sequence q's */
- u_char ih_x1; /* (unused) */
- u_char ih_pr; /* protocol */
- u_short ih_len; /* protocol length */
- struct in_addr ih_src; /* source internet address */
- struct in_addr ih_dst; /* destination internet address */
-};
-
-/*
- * Ip reassembly queue structure. Each fragment
- * being reassembled is attached to one of these structures.
- * They are timed out after ipq_ttl drops to 0, and may also
- * be reclaimed if memory becomes tight.
- */
-struct ipq {
- struct ipq *next,*prev; /* to other reass headers */
- u_char ipq_ttl; /* time for reass q to live */
- u_char ipq_p; /* protocol of this fragment */
- u_short ipq_id; /* sequence id for reassembly */
- struct ipasfrag *ipq_next,*ipq_prev;
- /* to ip headers of fragments */
- struct in_addr ipq_src,ipq_dst;
-#ifdef IPDIVERT
- u_short ipq_divert; /* divert protocol port */
-#endif
-};
-
-/*
- * Ip header, when holding a fragment.
- *
- * Note: ipf_next must be at same offset as ipq_next above
- */
-struct ipasfrag {
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char ip_hl:4,
- ip_v:4;
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char ip_v:4,
- ip_hl:4;
-#endif
- u_char ipf_mff; /* XXX overlays ip_tos: use low bit
- * to avoid destroying tos;
- * copied from (ip_off&IP_MF) */
- u_short ip_len;
- u_short ip_id;
- u_short ip_off;
- u_char ip_ttl;
- u_char ip_p;
- u_short ip_sum;
- struct ipasfrag *ipf_next; /* next fragment */
- struct ipasfrag *ipf_prev; /* previous fragment */
-};
-
-/*
- * Structure stored in mbuf in inpcb.ip_options
- * and passed to ip_output when ip options are in use.
- * The actual length of the options (including ipopt_dst)
- * is in m_len.
- */
-#define MAX_IPOPTLEN 40
-
-struct ipoption {
- struct in_addr ipopt_dst; /* first-hop dst if source routed */
- char ipopt_list[MAX_IPOPTLEN]; /* options proper */
-};
-
-/*
- * Structure attached to inpcb.ip_moptions and
- * passed to ip_output when IP multicast options are in use.
- */
-struct ip_moptions {
- struct ifnet *imo_multicast_ifp; /* ifp for outgoing multicasts */
- u_char imo_multicast_ttl; /* TTL for outgoing multicasts */
- u_char imo_multicast_loop; /* 1 => hear sends if a member */
- u_short imo_num_memberships; /* no. memberships this socket */
- struct in_multi *imo_membership[IP_MAX_MEMBERSHIPS];
- u_long imo_multicast_vif; /* vif num outgoing multicasts */
-};
-
-struct ipstat {
- u_long ips_total; /* total packets received */
- u_long ips_badsum; /* checksum bad */
- u_long ips_tooshort; /* packet too short */
- u_long ips_toosmall; /* not enough data */
- u_long ips_badhlen; /* ip header length < data size */
- u_long ips_badlen; /* ip length < ip header length */
- u_long ips_fragments; /* fragments received */
- u_long ips_fragdropped; /* frags dropped (dups, out of space) */
- u_long ips_fragtimeout; /* fragments timed out */
- u_long ips_forward; /* packets forwarded */
- u_long ips_cantforward; /* packets rcvd for unreachable dest */
- u_long ips_redirectsent; /* packets forwarded on same net */
- u_long ips_noproto; /* unknown or unsupported protocol */
- u_long ips_delivered; /* datagrams delivered to upper level*/
- u_long ips_localout; /* total ip packets generated here */
- u_long ips_odropped; /* lost packets due to nobufs, etc. */
- u_long ips_reassembled; /* total packets reassembled ok */
- u_long ips_fragmented; /* datagrams successfully fragmented */
- u_long ips_ofragments; /* output fragments created */
- u_long ips_cantfrag; /* don't fragment flag was set, etc. */
- u_long ips_badoptions; /* error in option processing */
- u_long ips_noroute; /* packets discarded due to no route */
- u_long ips_badvers; /* ip version != 4 */
- u_long ips_rawout; /* total raw ip packets generated */
- u_long ips_toolong; /* ip length > max ip packet size */
-};
-
-#ifdef KERNEL
-/* flags passed to ip_output as last parameter */
-#define IP_FORWARDING 0x1 /* most of ip header exists */
-#define IP_RAWOUTPUT 0x2 /* raw ip header exists */
-#define IP_ROUTETOIF SO_DONTROUTE /* bypass routing tables */
-#define IP_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets */
-
-struct inpcb;
-struct route;
-
-extern struct ipstat ipstat;
-extern u_short ip_id; /* ip packet ctr, for ids */
-extern int ip_defttl; /* default IP ttl */
-extern u_char ip_protox[];
-extern struct socket *ip_rsvpd; /* reservation protocol daemon */
-extern struct socket *ip_mrouter; /* multicast routing daemon */
-extern int (*legal_vif_num) __P((int));
-extern u_long (*ip_mcast_src) __P((int));
-extern int rsvp_on;
-
-int ip_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
-void ip_drain __P((void));
-void ip_freemoptions __P((struct ip_moptions *));
-void ip_init __P((void));
-extern int (*ip_mforward) __P((struct ip *, struct ifnet *, struct mbuf *,
- struct ip_moptions *));
-int ip_output __P((struct mbuf *,
- struct mbuf *, struct route *, int, struct ip_moptions *));
-void ip_savecontrol __P((struct inpcb *, struct mbuf **, struct ip *,
- struct mbuf *));
-void ip_slowtimo __P((void));
-struct mbuf *
- ip_srcroute __P((void));
-void ip_stripoptions __P((struct mbuf *, struct mbuf *));
-int rip_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
-void rip_init __P((void));
-void rip_input __P((struct mbuf *, int));
-int rip_output __P((struct mbuf *, struct socket *, u_long));
-int rip_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-void ipip_input __P((struct mbuf *, int));
-void rsvp_input __P((struct mbuf *, int));
-int ip_rsvp_init __P((struct socket *));
-int ip_rsvp_done __P((void));
-int ip_rsvp_vif_init __P((struct socket *, struct mbuf *));
-int ip_rsvp_vif_done __P((struct socket *, struct mbuf *));
-void ip_rsvp_force_done __P((struct socket *));
-
-#ifdef IPDIVERT
-void div_init __P((void));
-void div_input __P((struct mbuf *, int));
-int div_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-extern u_short ip_divert_port;
-extern u_short ip_divert_ignore;
-#endif /* IPDIVERT */
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_IP_VAR_H_ */
diff --git a/c/src/lib/libnetworking/netinet/raw_ip.c b/c/src/lib/libnetworking/netinet/raw_ip.c
deleted file mode 100644
index 44d58f1844..0000000000
--- a/c/src/lib/libnetworking/netinet/raw_ip.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/systm.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#define _IP_VHL
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_mroute.h>
-
-#include <netinet/ip_fw.h>
-
-#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1
-#undef COMPAT_IPFW
-#define COMPAT_IPFW 1
-#else
-#undef COMPAT_IPFW
-#endif
-
-static struct inpcbhead ripcb;
-static struct inpcbinfo ripcbinfo;
-
-/*
- * Nominal space allocated to a raw ip socket.
- */
-#define RIPSNDQ 8192
-#define RIPRCVQ 8192
-
-/*
- * Raw interface to IP protocol.
- */
-
-/*
- * Initialize raw connection block q.
- */
-void
-rip_init()
-{
- LIST_INIT(&ripcb);
- ripcbinfo.listhead = &ripcb;
- /*
- * XXX We don't use the hash list for raw IP, but it's easier
- * to allocate a one entry hash list than it is to check all
- * over the place for hashbase == NULL.
- */
- ripcbinfo.hashbase = hashinit(1, M_PCB, &ripcbinfo.hashmask);
-}
-
-static struct sockaddr_in ripsrc = { sizeof(ripsrc), AF_INET };
-/*
- * Setup generic address and protocol structures
- * for raw_input routine, then pass them along with
- * mbuf chain.
- */
-void
-rip_input(m, iphlen)
- struct mbuf *m;
- int iphlen;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register struct inpcb *inp;
- struct inpcb *last = 0;
- struct mbuf *opts = 0;
-
- ripsrc.sin_addr = ip->ip_src;
- for (inp = ripcb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_ip_p && inp->inp_ip_p != ip->ip_p)
- continue;
- if (inp->inp_laddr.s_addr &&
- inp->inp_laddr.s_addr != ip->ip_dst.s_addr)
- continue;
- if (inp->inp_faddr.s_addr &&
- inp->inp_faddr.s_addr != ip->ip_src.s_addr)
- continue;
- if (last) {
- struct mbuf *n = m_copy(m, 0, (int)M_COPYALL);
- if (n) {
- if (last->inp_flags & INP_CONTROLOPTS ||
- last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, n);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&ripsrc, n,
- opts) == 0) {
- /* should notify about lost packet */
- m_freem(n);
- if (opts)
- m_freem(opts);
- } else
- sorwakeup(last->inp_socket);
- opts = 0;
- }
- }
- last = inp;
- }
- if (last) {
- if (last->inp_flags & INP_CONTROLOPTS ||
- last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, m);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&ripsrc, m, opts) == 0) {
- m_freem(m);
- if (opts)
- m_freem(opts);
- } else
- sorwakeup(last->inp_socket);
- } else {
- m_freem(m);
- ipstat.ips_noproto++;
- ipstat.ips_delivered--;
- }
-}
-
-/*
- * Generate IP header and pass packet to ip_output.
- * Tack on options user may have setup with control call.
- */
-int
-rip_output(m, so, dst)
- register struct mbuf *m;
- struct socket *so;
- u_long dst;
-{
- register struct ip *ip;
- register struct inpcb *inp = sotoinpcb(so);
- int flags = (so->so_options & SO_DONTROUTE) | IP_ALLOWBROADCAST;
-
- /*
- * If the user handed us a complete IP packet, use it.
- * Otherwise, allocate an mbuf for a header and fill it in.
- */
- if ((inp->inp_flags & INP_HDRINCL) == 0) {
- if (m->m_pkthdr.len + sizeof(struct ip) > IP_MAXPACKET) {
- m_freem(m);
- return(EMSGSIZE);
- }
- M_PREPEND(m, sizeof(struct ip), M_WAIT);
- ip = mtod(m, struct ip *);
- ip->ip_tos = 0;
- ip->ip_off = 0;
- ip->ip_p = inp->inp_ip_p;
- ip->ip_len = m->m_pkthdr.len;
- ip->ip_src = inp->inp_laddr;
- ip->ip_dst.s_addr = dst;
- ip->ip_ttl = MAXTTL;
- } else {
- if (m->m_pkthdr.len > IP_MAXPACKET) {
- m_freem(m);
- return(EMSGSIZE);
- }
- ip = mtod(m, struct ip *);
- /* don't allow both user specified and setsockopt options,
- and don't allow packet length sizes that will crash */
- if (((IP_VHL_HL(ip->ip_vhl) != (sizeof (*ip) >> 2))
- && inp->inp_options)
- || (ip->ip_len > m->m_pkthdr.len)
- || (ip->ip_len < (IP_VHL_HL(ip->ip_vhl) << 2))) {
- m_freem(m);
- return EINVAL;
- }
- if (ip->ip_id == 0)
- ip->ip_id = htons(ip_id++);
- /* XXX prevent ip_output from overwriting header fields */
- flags |= IP_RAWOUTPUT;
- ipstat.ips_rawout++;
- }
- return (ip_output(m, inp->inp_options, &inp->inp_route, flags,
- inp->inp_moptions));
-}
-
-/*
- * Raw IP socket option processing.
- */
-int
-rip_ctloutput(op, so, level, optname, m)
- int op;
- struct socket *so;
- int level, optname;
- struct mbuf **m;
-{
- register struct inpcb *inp = sotoinpcb(so);
- register int error;
-
- if (level != IPPROTO_IP) {
- if (op == PRCO_SETOPT && *m)
- (void)m_free(*m);
- return (EINVAL);
- }
-
- switch (optname) {
-
- case IP_HDRINCL:
- error = 0;
- if (op == PRCO_SETOPT) {
- if (m == 0 || *m == 0 || (*m)->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(*m, int *))
- inp->inp_flags |= INP_HDRINCL;
- else
- inp->inp_flags &= ~INP_HDRINCL;
- if (*m)
- (void)m_free(*m);
- } else {
- *m = m_get(M_WAIT, MT_SOOPTS);
- (*m)->m_len = sizeof (int);
- *mtod(*m, int *) = inp->inp_flags & INP_HDRINCL;
- }
- return (error);
-
-#ifdef COMPAT_IPFW
- case IP_FW_GET:
- if (ip_fw_ctl_ptr == NULL || op == PRCO_SETOPT) {
- if (*m) (void)m_free(*m);
- return(EINVAL);
- }
- return (*ip_fw_ctl_ptr)(optname, m);
-
- case IP_FW_ADD:
- case IP_FW_DEL:
- case IP_FW_FLUSH:
- case IP_FW_ZERO:
- if (ip_fw_ctl_ptr == NULL || op != PRCO_SETOPT) {
- if (*m) (void)m_free(*m);
- return(EINVAL);
- }
- return (*ip_fw_ctl_ptr)(optname, m);
-
- case IP_NAT:
- if (ip_nat_ctl_ptr == NULL) {
- if (*m) (void)m_free(*m);
- return(EINVAL);
- }
- return (*ip_nat_ctl_ptr)(op, m);
-
-#endif
- case IP_RSVP_ON:
- return ip_rsvp_init(so);
- break;
-
- case IP_RSVP_OFF:
- return ip_rsvp_done();
- break;
-
- case IP_RSVP_VIF_ON:
- return ip_rsvp_vif_init(so, *m);
-
- case IP_RSVP_VIF_OFF:
- return ip_rsvp_vif_done(so, *m);
-
- case MRT_INIT:
- case MRT_DONE:
- case MRT_ADD_VIF:
- case MRT_DEL_VIF:
- case MRT_ADD_MFC:
- case MRT_DEL_MFC:
- case MRT_VERSION:
- case MRT_ASSERT:
- if (op == PRCO_SETOPT) {
- error = ip_mrouter_set(optname, so, *m);
- if (*m)
- (void)m_free(*m);
- } else if (op == PRCO_GETOPT) {
- error = ip_mrouter_get(optname, so, m);
- } else
- error = EINVAL;
- return (error);
- }
- return (ip_ctloutput(op, so, level, optname, m));
-}
-
-static u_long rip_sendspace = RIPSNDQ; /* XXX sysctl ? */
-static u_long rip_recvspace = RIPRCVQ; /* XXX sysctl ? */
-
-/*ARGSUSED*/
-int
-rip_usrreq(so, req, m, nam, control)
- register struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register int error = 0;
- register struct inpcb *inp = sotoinpcb(so);
- int s;
-
- if (req == PRU_CONTROL)
- return (in_control(so, (u_long)m, (caddr_t)nam,
- (struct ifnet *)control));
-
- switch (req) {
-
- case PRU_ATTACH:
- if (inp)
- panic("rip_attach");
- if ((so->so_state & SS_PRIV) == 0) {
- error = EACCES;
- break;
- }
- s = splnet();
- error = in_pcballoc(so, &ripcbinfo);
- splx(s);
- if (error)
- break;
- error = soreserve(so, rip_sendspace, rip_recvspace);
- if (error)
- break;
- inp = (struct inpcb *)so->so_pcb;
- inp->inp_ip_p = (int)nam;
- break;
-
- case PRU_DISCONNECT:
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- error = ENOTCONN;
- break;
- }
- /* FALLTHROUGH */
- case PRU_ABORT:
- soisdisconnected(so);
- /* FALLTHROUGH */
- case PRU_DETACH:
- if (inp == 0)
- panic("rip_detach");
- if (so == ip_mrouter)
- ip_mrouter_done();
- ip_rsvp_force_done(so);
- if (so == ip_rsvpd)
- ip_rsvp_done();
- in_pcbdetach(inp);
- break;
-
- case PRU_BIND:
- {
- struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *);
-
- if (nam->m_len != sizeof(*addr)) {
- error = EINVAL;
- break;
- }
- if ((ifnet == 0) ||
- ((addr->sin_family != AF_INET) &&
- (addr->sin_family != AF_IMPLINK)) ||
- (addr->sin_addr.s_addr &&
- ifa_ifwithaddr((struct sockaddr *)addr) == 0)) {
- error = EADDRNOTAVAIL;
- break;
- }
- inp->inp_laddr = addr->sin_addr;
- break;
- }
- case PRU_CONNECT:
- {
- struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *);
-
- if (nam->m_len != sizeof(*addr)) {
- error = EINVAL;
- break;
- }
- if (ifnet == 0) {
- error = EADDRNOTAVAIL;
- break;
- }
- if ((addr->sin_family != AF_INET) &&
- (addr->sin_family != AF_IMPLINK)) {
- error = EAFNOSUPPORT;
- break;
- }
- inp->inp_faddr = addr->sin_addr;
- soisconnected(so);
- break;
- }
-
- case PRU_CONNECT2:
- error = EOPNOTSUPP;
- break;
-
- /*
- * Mark the connection as being incapable of further input.
- */
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- /*
- * Ship a packet out. The appropriate raw output
- * routine handles any massaging necessary.
- */
- case PRU_SEND:
- {
- register u_long dst;
-
- if (so->so_state & SS_ISCONNECTED) {
- if (nam) {
- error = EISCONN;
- break;
- }
- dst = inp->inp_faddr.s_addr;
- } else {
- if (nam == NULL) {
- error = ENOTCONN;
- break;
- }
- dst = mtod(nam, struct sockaddr_in *)->sin_addr.s_addr;
- }
- error = rip_output(m, so, dst);
- m = NULL;
- break;
- }
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- /*
- * Not supported.
- */
- case PRU_RCVOOB:
- case PRU_RCVD:
- case PRU_LISTEN:
- case PRU_ACCEPT:
- case PRU_SENDOOB:
- error = EOPNOTSUPP;
- break;
-
- case PRU_SOCKADDR:
- in_setsockaddr(inp, nam);
- break;
-
- case PRU_PEERADDR:
- in_setpeeraddr(inp, nam);
- break;
-
- default:
- panic("rip_usrreq");
- }
- if (m != NULL)
- m_freem(m);
- return (error);
-}
diff --git a/c/src/lib/libnetworking/netinet/tcp.h b/c/src/lib/libnetworking/netinet/tcp.h
deleted file mode 100644
index 3585917aa3..0000000000
--- a/c/src/lib/libnetworking/netinet/tcp.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_H_
-#define _NETINET_TCP_H_
-
-typedef u_long tcp_seq;
-typedef u_long tcp_cc; /* connection count per rfc1644 */
-
-/*
- * TCP header.
- * Per RFC 793, September, 1981.
- */
-struct tcphdr {
- u_short th_sport; /* source port */
- u_short th_dport; /* destination port */
- tcp_seq th_seq; /* sequence number */
- tcp_seq th_ack; /* acknowledgement number */
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char th_x2:4, /* (unused) */
- th_off:4; /* data offset */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char th_off:4, /* data offset */
- th_x2:4; /* (unused) */
-#endif
- u_char th_flags;
-#define TH_FIN 0x01
-#define TH_SYN 0x02
-#define TH_RST 0x04
-#define TH_PUSH 0x08
-#define TH_ACK 0x10
-#define TH_URG 0x20
-#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG)
-
- u_short th_win; /* window */
- u_short th_sum; /* checksum */
- u_short th_urp; /* urgent pointer */
-};
-
-#define TCPOPT_EOL 0
-#define TCPOPT_NOP 1
-#define TCPOPT_MAXSEG 2
-#define TCPOLEN_MAXSEG 4
-#define TCPOPT_WINDOW 3
-#define TCPOLEN_WINDOW 3
-#define TCPOPT_SACK_PERMITTED 4 /* Experimental */
-#define TCPOLEN_SACK_PERMITTED 2
-#define TCPOPT_SACK 5 /* Experimental */
-#define TCPOPT_TIMESTAMP 8
-#define TCPOLEN_TIMESTAMP 10
-#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
-#define TCPOPT_TSTAMP_HDR \
- (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
-
-#define TCPOPT_CC 11 /* CC options: RFC-1644 */
-#define TCPOPT_CCNEW 12
-#define TCPOPT_CCECHO 13
-#define TCPOLEN_CC 6
-#define TCPOLEN_CC_APPA (TCPOLEN_CC+2)
-#define TCPOPT_CC_HDR(ccopt) \
- (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC)
-
-/*
- * Default maximum segment size for TCP.
- * With an IP MSS of 576, this is 536,
- * but 512 is probably more convenient.
- * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
- */
-#define TCP_MSS 512
-
-#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
-#define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */
-
-#define TCP_MAX_WINSHIFT 14 /* maximum window shift */
-
-#define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */
-#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr))
- /* max space left for options */
-
-/*
- * User-settable options (used with setsockopt).
- */
-#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
-#define TCP_MAXSEG 0x02 /* set maximum segment size */
-#define TCP_NOPUSH 0x04 /* don't push last block of write */
-#define TCP_NOOPT 0x08 /* don't use TCP options */
-
-#endif
diff --git a/c/src/lib/libnetworking/netinet/tcp_debug.c b/c/src/lib/libnetworking/netinet/tcp_debug.c
deleted file mode 100644
index 864a01cb1a..0000000000
--- a/c/src/lib/libnetworking/netinet/tcp_debug.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_debug.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#ifdef TCPDEBUG
-/* load symbolic names */
-#define PRUREQUESTS
-#define TCPSTATES
-#define TCPTIMERS
-#define TANAMES
-#endif
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <net/route.h>
-#include <net/if.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#include <netinet/tcp_debug.h>
-
-#ifdef TCPDEBUG
-static int tcpconsdebug = 0;
-#endif
-
-static struct tcp_debug tcp_debug[TCP_NDEBUG];
-static int tcp_debx;
-
-/*
- * Tcp debug routines
- */
-void
-tcp_trace(act, ostate, tp, ti, req)
- short act, ostate;
- struct tcpcb *tp;
- struct tcpiphdr *ti;
- int req;
-{
-#ifdef TCPDEBUG
- tcp_seq seq, ack;
- int len, flags;
-#endif
- struct tcp_debug *td = &tcp_debug[tcp_debx++];
-
- if (tcp_debx == TCP_NDEBUG)
- tcp_debx = 0;
- td->td_time = iptime();
- td->td_act = act;
- td->td_ostate = ostate;
- td->td_tcb = (caddr_t)tp;
- if (tp)
- td->td_cb = *tp;
- else
- bzero((caddr_t)&td->td_cb, sizeof (*tp));
- if (ti)
- td->td_ti = *ti;
- else
- bzero((caddr_t)&td->td_ti, sizeof (*ti));
- td->td_req = req;
-#ifdef TCPDEBUG
- if (tcpconsdebug == 0)
- return;
- if (tp)
- printf("%p %s:", tp, tcpstates[ostate]);
- else
- printf("???????? ");
- printf("%s ", tanames[act]);
- switch (act) {
-
- case TA_INPUT:
- case TA_OUTPUT:
- case TA_DROP:
- if (ti == 0)
- break;
- seq = ti->ti_seq;
- ack = ti->ti_ack;
- len = ti->ti_len;
- if (act == TA_OUTPUT) {
- seq = ntohl(seq);
- ack = ntohl(ack);
- len = ntohs((u_short)len);
- }
- if (act == TA_OUTPUT)
- len -= sizeof (struct tcphdr);
- if (len)
- printf("[%x..%x)", seq, seq+len);
- else
- printf("%x", seq);
- printf("@%x, urp=%x", ack, ti->ti_urp);
- flags = ti->ti_flags;
- if (flags) {
- char *cp = "<";
-#define pf(f) { \
- if (ti->ti_flags & TH_##f) { \
- printf("%s%s", cp, #f); \
- cp = ","; \
- } \
-}
- pf(SYN); pf(ACK); pf(FIN); pf(RST); pf(PUSH); pf(URG);
- printf(">");
- }
- break;
-
- case TA_USER:
- printf("%s", prurequests[req&0xff]);
- if ((req & 0xff) == PRU_SLOWTIMO)
- printf("<%s>", tcptimers[req>>8]);
- break;
- }
- if (tp)
- printf(" -> %s", tcpstates[tp->t_state]);
- /* print out internal state of tp !?! */
- printf("\n");
- if (tp == 0)
- return;
- printf("\trcv_(nxt,wnd,up) (%x,%x,%x) snd_(una,nxt,max) (%x,%x,%x)\n",
- tp->rcv_nxt, tp->rcv_wnd, tp->rcv_up, tp->snd_una, tp->snd_nxt,
- tp->snd_max);
- printf("\tsnd_(wl1,wl2,wnd) (%x,%x,%x)\n",
- tp->snd_wl1, tp->snd_wl2, tp->snd_wnd);
-#endif /* TCPDEBUG */
-}
diff --git a/c/src/lib/libnetworking/netinet/tcp_debug.h b/c/src/lib/libnetworking/netinet/tcp_debug.h
deleted file mode 100644
index a33743b077..0000000000
--- a/c/src/lib/libnetworking/netinet/tcp_debug.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_debug.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_DEBUG_H_
-#define _NETINET_TCP_DEBUG_H_
-
-struct tcp_debug {
- n_time td_time;
- short td_act;
- short td_ostate;
- caddr_t td_tcb;
- struct tcpiphdr td_ti;
- short td_req;
- struct tcpcb td_cb;
-};
-
-#define TA_INPUT 0
-#define TA_OUTPUT 1
-#define TA_USER 2
-#define TA_RESPOND 3
-#define TA_DROP 4
-
-#ifdef TANAMES
-static char *tanames[] =
- { "input", "output", "user", "respond", "drop" };
-#endif
-
-#define TCP_NDEBUG 100
-
-#ifndef KERNEL
-/* XXX common variables for broken applications. */
-struct tcp_debug tcp_debug[TCP_NDEBUG];
-int tcp_debx;
-#endif
-
-#endif /* !_NETINET_TCP_DEBUG_H_ */
diff --git a/c/src/lib/libnetworking/netinet/tcp_fsm.h b/c/src/lib/libnetworking/netinet/tcp_fsm.h
deleted file mode 100644
index 3f2c12f54f..0000000000
--- a/c/src/lib/libnetworking/netinet/tcp_fsm.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_fsm.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_FSM_H_
-#define _NETINET_TCP_FSM_H_
-
-/*
- * TCP FSM state definitions.
- * Per RFC793, September, 1981.
- */
-
-#define TCP_NSTATES 11
-
-#define TCPS_CLOSED 0 /* closed */
-#define TCPS_LISTEN 1 /* listening for connection */
-#define TCPS_SYN_SENT 2 /* active, have sent syn */
-#define TCPS_SYN_RECEIVED 3 /* have send and received syn */
-/* states < TCPS_ESTABLISHED are those where connections not established */
-#define TCPS_ESTABLISHED 4 /* established */
-#define TCPS_CLOSE_WAIT 5 /* rcvd fin, waiting for close */
-/* states > TCPS_CLOSE_WAIT are those where user has closed */
-#define TCPS_FIN_WAIT_1 6 /* have closed, sent fin */
-#define TCPS_CLOSING 7 /* closed xchd FIN; await FIN ACK */
-#define TCPS_LAST_ACK 8 /* had fin and close; await FIN ACK */
-/* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */
-#define TCPS_FIN_WAIT_2 9 /* have closed, fin is acked */
-#define TCPS_TIME_WAIT 10 /* in 2*msl quiet wait after close */
-
-#define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED)
-#define TCPS_HAVEESTABLISHED(s) ((s) >= TCPS_ESTABLISHED)
-#define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT)
-
-#ifdef TCPOUTFLAGS
-/*
- * Flags used when sending segments in tcp_output.
- * Basic flags (TH_RST,TH_ACK,TH_SYN,TH_FIN) are totally
- * determined by state, with the proviso that TH_FIN is sent only
- * if all data queued for output is included in the segment.
- */
-static u_char tcp_outflags[TCP_NSTATES] = {
- TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK,
- TH_ACK, TH_ACK,
- TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK,
-};
-#endif
-
-#ifdef KPROF
-int tcp_acounts[TCP_NSTATES][PRU_NREQ];
-#endif
-
-#ifdef TCPSTATES
-char *tcpstates[] = {
- "CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD",
- "ESTABLISHED", "CLOSE_WAIT", "FIN_WAIT_1", "CLOSING",
- "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT",
-};
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/netinet/tcp_input.c b/c/src/lib/libnetworking/netinet/tcp_input.c
deleted file mode 100644
index bc55a79ae2..0000000000
--- a/c/src/lib/libnetworking/netinet/tcp_input.c
+++ /dev/null
@@ -1,2149 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995
- * 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.
- *
- * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#ifndef TUBA_INCLUDE
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-
-#include <machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-static struct tcpiphdr tcp_saveti;
-#endif
-
-static int tcprexmtthresh = 3;
-tcp_seq tcp_iss;
-tcp_cc tcp_ccgen;
-
-struct tcpstat tcpstat;
-SYSCTL_STRUCT(_net_inet_tcp, TCPCTL_STATS, stats,
- CTLFLAG_RD, &tcpstat , tcpstat, "");
-
-static int log_in_vain = 0;
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_in_vain, CTLFLAG_RW,
- &log_in_vain, 0, "");
-
-u_long tcp_now;
-struct inpcbhead tcb;
-struct inpcbinfo tcbinfo;
-
-static void tcp_dooptions __P((struct tcpcb *,
- u_char *, int, struct tcpiphdr *, struct tcpopt *));
-static void tcp_pulloutofband __P((struct socket *,
- struct tcpiphdr *, struct mbuf *));
-static int tcp_reass __P((struct tcpcb *, struct tcpiphdr *, struct mbuf *));
-static void tcp_xmit_timer __P((struct tcpcb *, int));
-
-#endif /* TUBA_INCLUDE */
-
-/*
- * Insert segment ti into reassembly queue of tcp with
- * control block tp. Return TH_FIN if reassembly now includes
- * a segment with FIN. The macro form does the common case inline
- * (segment is the next to be received on an established connection,
- * and the queue is empty), avoiding linkage into and removal
- * from the queue and repetition of various conversions.
- * Set DELACK for segments received in order, but ack immediately
- * when segments are out of order (so fast retransmit can work).
- */
-#ifdef TCP_ACK_HACK
-#define TCP_REASS(tp, ti, m, so, flags) { \
- if ((ti)->ti_seq == (tp)->rcv_nxt && \
- (tp)->seg_next == (struct tcpiphdr *)(tp) && \
- (tp)->t_state == TCPS_ESTABLISHED) { \
- if (ti->ti_flags & TH_PUSH) \
- tp->t_flags |= TF_ACKNOW; \
- else \
- tp->t_flags |= TF_DELACK; \
- (tp)->rcv_nxt += (ti)->ti_len; \
- flags = (ti)->ti_flags & TH_FIN; \
- tcpstat.tcps_rcvpack++;\
- tcpstat.tcps_rcvbyte += (ti)->ti_len;\
- sbappend(&(so)->so_rcv, (m)); \
- sorwakeup(so); \
- } else { \
- (flags) = tcp_reass((tp), (ti), (m)); \
- tp->t_flags |= TF_ACKNOW; \
- } \
-}
-#else
-#define TCP_REASS(tp, ti, m, so, flags) { \
- if ((ti)->ti_seq == (tp)->rcv_nxt && \
- (tp)->seg_next == (struct tcpiphdr *)(tp) && \
- (tp)->t_state == TCPS_ESTABLISHED) { \
- tp->t_flags |= TF_DELACK; \
- (tp)->rcv_nxt += (ti)->ti_len; \
- flags = (ti)->ti_flags & TH_FIN; \
- tcpstat.tcps_rcvpack++;\
- tcpstat.tcps_rcvbyte += (ti)->ti_len;\
- sbappend(&(so)->so_rcv, (m)); \
- sorwakeup(so); \
- } else { \
- (flags) = tcp_reass((tp), (ti), (m)); \
- tp->t_flags |= TF_ACKNOW; \
- } \
-}
-#endif
-#ifndef TUBA_INCLUDE
-
-static int
-tcp_reass(tp, ti, m)
- register struct tcpcb *tp;
- register struct tcpiphdr *ti;
- struct mbuf *m;
-{
- register struct tcpiphdr *q;
- struct socket *so = tp->t_inpcb->inp_socket;
- int flags;
-
- /*
- * Call with ti==0 after become established to
- * force pre-ESTABLISHED data up to user socket.
- */
- if (ti == 0)
- goto present;
-
- /*
- * Find a segment which begins after this one does.
- */
- for (q = tp->seg_next; q != (struct tcpiphdr *)tp;
- q = (struct tcpiphdr *)q->ti_next)
- if (SEQ_GT(q->ti_seq, ti->ti_seq))
- break;
-
- /*
- * If there is a preceding segment, it may provide some of
- * our data already. If so, drop the data from the incoming
- * segment. If it provides all of our data, drop us.
- */
- if ((struct tcpiphdr *)q->ti_prev != (struct tcpiphdr *)tp) {
- register int i;
- q = (struct tcpiphdr *)q->ti_prev;
- /* conversion to int (in i) handles seq wraparound */
- i = q->ti_seq + q->ti_len - ti->ti_seq;
- if (i > 0) {
- if (i >= ti->ti_len) {
- tcpstat.tcps_rcvduppack++;
- tcpstat.tcps_rcvdupbyte += ti->ti_len;
- m_freem(m);
- /*
- * Try to present any queued data
- * at the left window edge to the user.
- * This is needed after the 3-WHS
- * completes.
- */
- goto present; /* ??? */
- }
- m_adj(m, i);
- ti->ti_len -= i;
- ti->ti_seq += i;
- }
- q = (struct tcpiphdr *)(q->ti_next);
- }
- tcpstat.tcps_rcvoopack++;
- tcpstat.tcps_rcvoobyte += ti->ti_len;
- REASS_MBUF(ti) = m; /* XXX */
-
- /*
- * While we overlap succeeding segments trim them or,
- * if they are completely covered, dequeue them.
- */
- while (q != (struct tcpiphdr *)tp) {
- register int i = (ti->ti_seq + ti->ti_len) - q->ti_seq;
- if (i <= 0)
- break;
- if (i < q->ti_len) {
- q->ti_seq += i;
- q->ti_len -= i;
- m_adj(REASS_MBUF(q), i);
- break;
- }
- q = (struct tcpiphdr *)q->ti_next;
- m = REASS_MBUF((struct tcpiphdr *)q->ti_prev);
- remque(q->ti_prev);
- m_freem(m);
- }
-
- /*
- * Stick new segment in its place.
- */
- insque(ti, q->ti_prev);
-
-present:
- /*
- * Present data to user, advancing rcv_nxt through
- * completed sequence space.
- */
- if (!TCPS_HAVEESTABLISHED(tp->t_state))
- return (0);
- ti = tp->seg_next;
- if (ti == (struct tcpiphdr *)tp || ti->ti_seq != tp->rcv_nxt)
- return (0);
- do {
- tp->rcv_nxt += ti->ti_len;
- flags = ti->ti_flags & TH_FIN;
- remque(ti);
- m = REASS_MBUF(ti);
- ti = (struct tcpiphdr *)ti->ti_next;
- if (so->so_state & SS_CANTRCVMORE)
- m_freem(m);
- else
- sbappend(&so->so_rcv, m);
- } while (ti != (struct tcpiphdr *)tp && ti->ti_seq == tp->rcv_nxt);
- sorwakeup(so);
- return (flags);
-}
-
-/*
- * TCP input routine, follows pages 65-76 of the
- * protocol specification dated September, 1981 very closely.
- */
-void
-tcp_input(m, iphlen)
- register struct mbuf *m;
- int iphlen;
-{
- register struct tcpiphdr *ti;
- register struct inpcb *inp;
- u_char *optp = NULL;
- int optlen = 0;
- int len, tlen, off;
- register struct tcpcb *tp = 0;
- register int tiflags;
- struct socket *so = 0;
- int todrop, acked, ourfinisacked, needoutput = 0;
- struct in_addr laddr;
- int dropsocket = 0;
- int iss = 0;
- u_long tiwin;
- struct tcpopt to; /* options in this segment */
- struct rmxp_tao *taop; /* pointer to our TAO cache entry */
- struct rmxp_tao tao_noncached; /* in case there's no cached entry */
-#ifdef TCPDEBUG
- short ostate = 0;
-#endif
-
- bzero((char *)&to, sizeof(to));
-
- tcpstat.tcps_rcvtotal++;
- /*
- * Get IP and TCP header together in first mbuf.
- * Note: IP leaves IP header in first mbuf.
- */
- ti = mtod(m, struct tcpiphdr *);
- if (iphlen > sizeof (struct ip))
- ip_stripoptions(m, (struct mbuf *)0);
- if (m->m_len < sizeof (struct tcpiphdr)) {
- if ((m = m_pullup(m, sizeof (struct tcpiphdr))) == 0) {
- tcpstat.tcps_rcvshort++;
- return;
- }
- ti = mtod(m, struct tcpiphdr *);
- }
-
- /*
- * Checksum extended TCP header and data.
- */
- tlen = ((struct ip *)ti)->ip_len;
- len = sizeof (struct ip) + tlen;
- ti->ti_next = ti->ti_prev = 0;
- ti->ti_x1 = 0;
- ti->ti_len = (u_short)tlen;
- HTONS(ti->ti_len);
- ti->ti_sum = in_cksum(m, len);
- if (ti->ti_sum) {
- tcpstat.tcps_rcvbadsum++;
- goto drop;
- }
-#endif /* TUBA_INCLUDE */
-
- /*
- * Check that TCP offset makes sense,
- * pull out TCP options and adjust length. XXX
- */
- off = ti->ti_off << 2;
- if (off < sizeof (struct tcphdr) || off > tlen) {
- tcpstat.tcps_rcvbadoff++;
- goto drop;
- }
- tlen -= off;
- ti->ti_len = tlen;
- if (off > sizeof (struct tcphdr)) {
- if (m->m_len < sizeof(struct ip) + off) {
- if ((m = m_pullup(m, sizeof (struct ip) + off)) == 0) {
- tcpstat.tcps_rcvshort++;
- return;
- }
- ti = mtod(m, struct tcpiphdr *);
- }
- optlen = off - sizeof (struct tcphdr);
- optp = mtod(m, u_char *) + sizeof (struct tcpiphdr);
- }
- tiflags = ti->ti_flags;
-
- /*
- * Convert TCP protocol specific fields to host format.
- */
- NTOHL(ti->ti_seq);
- NTOHL(ti->ti_ack);
- NTOHS(ti->ti_win);
- NTOHS(ti->ti_urp);
-
- /*
- * Drop TCP, IP headers and TCP options.
- */
- m->m_data += sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
- m->m_len -= sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
-
- /*
- * Locate pcb for segment.
- */
-findpcb:
- inp = in_pcblookuphash(&tcbinfo, ti->ti_src, ti->ti_sport,
- ti->ti_dst, ti->ti_dport, 1);
-
- /*
- * If the state is CLOSED (i.e., TCB does not exist) then
- * all data in the incoming segment is discarded.
- * If the TCB exists but is in CLOSED state, it is embryonic,
- * but should either do a listen or a connect soon.
- */
- if (inp == NULL) {
- if (log_in_vain && tiflags & TH_SYN) {
- char buf[4*sizeof "123"];
-
- strcpy(buf, inet_ntoa(ti->ti_dst));
- log(LOG_INFO, "Connection attempt to TCP %s:%d"
- " from %s:%d\n",
- buf, ntohs(ti->ti_dport),
- inet_ntoa(ti->ti_src), ntohs(ti->ti_sport));
- }
- goto dropwithreset;
- }
- tp = intotcpcb(inp);
- if (tp == 0)
- goto dropwithreset;
- if (tp->t_state == TCPS_CLOSED)
- goto drop;
-
- /* Unscale the window into a 32-bit value. */
- if ((tiflags & TH_SYN) == 0)
- tiwin = ti->ti_win << tp->snd_scale;
- else
- tiwin = ti->ti_win;
-
- so = inp->inp_socket;
- if (so->so_options & (SO_DEBUG|SO_ACCEPTCONN)) {
-#ifdef TCPDEBUG
- if (so->so_options & SO_DEBUG) {
- ostate = tp->t_state;
- tcp_saveti = *ti;
- }
-#endif
- if (so->so_options & SO_ACCEPTCONN) {
- register struct tcpcb *tp0 = tp;
- struct socket *so2;
- if ((tiflags & (TH_RST|TH_ACK|TH_SYN)) != TH_SYN) {
- /*
- * Note: dropwithreset makes sure we don't
- * send a RST in response to a RST.
- */
- if (tiflags & TH_ACK) {
- tcpstat.tcps_badsyn++;
- goto dropwithreset;
- }
- goto drop;
- }
- so2 = sonewconn(so, 0);
- if (so2 == 0) {
- tcpstat.tcps_listendrop++;
- so2 = sodropablereq(so);
- if (so2) {
- tcp_drop(sototcpcb(so2), ETIMEDOUT);
- so2 = sonewconn(so, 0);
- }
- if (!so2)
- goto drop;
- }
- so = so2;
- /*
- * This is ugly, but ....
- *
- * Mark socket as temporary until we're
- * committed to keeping it. The code at
- * ``drop'' and ``dropwithreset'' check the
- * flag dropsocket to see if the temporary
- * socket created here should be discarded.
- * We mark the socket as discardable until
- * we're committed to it below in TCPS_LISTEN.
- */
- dropsocket++;
- inp = (struct inpcb *)so->so_pcb;
- inp->inp_laddr = ti->ti_dst;
- inp->inp_lport = ti->ti_dport;
- in_pcbrehash(inp);
-#if BSD>=43
- inp->inp_options = ip_srcroute();
-#endif
- tp = intotcpcb(inp);
- tp->t_state = TCPS_LISTEN;
- tp->t_flags |= tp0->t_flags & (TF_NOPUSH|TF_NOOPT);
-
- /* Compute proper scaling value from buffer space */
- while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
- TCP_MAXWIN << tp->request_r_scale < so->so_rcv.sb_hiwat)
- tp->request_r_scale++;
- }
- }
-
- /*
- * Segment received on connection.
- * Reset idle time and keep-alive timer.
- */
- tp->t_idle = 0;
- if (TCPS_HAVEESTABLISHED(tp->t_state))
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
-
- /*
- * Process options if not in LISTEN state,
- * else do it below (after getting remote address).
- */
- if (tp->t_state != TCPS_LISTEN)
- tcp_dooptions(tp, optp, optlen, ti, &to);
-
- /*
- * Header prediction: check for the two common cases
- * of a uni-directional data xfer. If the packet has
- * no control flags, is in-sequence, the window didn't
- * change and we're not retransmitting, it's a
- * candidate. If the length is zero and the ack moved
- * forward, we're the sender side of the xfer. Just
- * free the data acked & wake any higher level process
- * that was blocked waiting for space. If the length
- * is non-zero and the ack didn't move, we're the
- * receiver side. If we're getting packets in-order
- * (the reassembly queue is empty), add the data to
- * the socket buffer and note that we need a delayed ack.
- * Make sure that the hidden state-flags are also off.
- * Since we check for TCPS_ESTABLISHED above, it can only
- * be TH_NEEDSYN.
- */
- if (tp->t_state == TCPS_ESTABLISHED &&
- (tiflags & (TH_SYN|TH_FIN|TH_RST|TH_URG|TH_ACK)) == TH_ACK &&
- ((tp->t_flags & (TF_NEEDSYN|TF_NEEDFIN)) == 0) &&
- ((to.to_flag & TOF_TS) == 0 ||
- TSTMP_GEQ(to.to_tsval, tp->ts_recent)) &&
- /*
- * Using the CC option is compulsory if once started:
- * the segment is OK if no T/TCP was negotiated or
- * if the segment has a CC option equal to CCrecv
- */
- ((tp->t_flags & (TF_REQ_CC|TF_RCVD_CC)) != (TF_REQ_CC|TF_RCVD_CC) ||
- ((to.to_flag & TOF_CC) != 0 && to.to_cc == tp->cc_recv)) &&
- ti->ti_seq == tp->rcv_nxt &&
- tiwin && tiwin == tp->snd_wnd &&
- tp->snd_nxt == tp->snd_max) {
-
- /*
- * If last ACK falls within this segment's sequence numbers,
- * record the timestamp.
- * NOTE that the test is modified according to the latest
- * proposal of the tcplw@cray.com list (Braden 1993/04/26).
- */
- if ((to.to_flag & TOF_TS) != 0 &&
- SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) {
- tp->ts_recent_age = tcp_now;
- tp->ts_recent = to.to_tsval;
- }
-
- if (ti->ti_len == 0) {
- if (SEQ_GT(ti->ti_ack, tp->snd_una) &&
- SEQ_LEQ(ti->ti_ack, tp->snd_max) &&
- tp->snd_cwnd >= tp->snd_wnd &&
- tp->t_dupacks < tcprexmtthresh) {
- /*
- * this is a pure ack for outstanding data.
- */
- ++tcpstat.tcps_predack;
- if ((to.to_flag & TOF_TS) != 0)
- tcp_xmit_timer(tp,
- tcp_now - to.to_tsecr + 1);
- else if (tp->t_rtt &&
- SEQ_GT(ti->ti_ack, tp->t_rtseq))
- tcp_xmit_timer(tp, tp->t_rtt);
- acked = ti->ti_ack - tp->snd_una;
- tcpstat.tcps_rcvackpack++;
- tcpstat.tcps_rcvackbyte += acked;
- sbdrop(&so->so_snd, acked);
- tp->snd_una = ti->ti_ack;
- m_freem(m);
-
- /*
- * If all outstanding data are acked, stop
- * retransmit timer, otherwise restart timer
- * using current (possibly backed-off) value.
- * If process is waiting for space,
- * wakeup/selwakeup/signal. If data
- * are ready to send, let tcp_output
- * decide between more output or persist.
- */
- if (tp->snd_una == tp->snd_max)
- tp->t_timer[TCPT_REXMT] = 0;
- else if (tp->t_timer[TCPT_PERSIST] == 0)
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
-
- if (so->so_snd.sb_flags & SB_NOTIFY)
- sowwakeup(so);
- if (so->so_snd.sb_cc)
- (void) tcp_output(tp);
- return;
- }
- } else if (ti->ti_ack == tp->snd_una &&
- tp->seg_next == (struct tcpiphdr *)tp &&
- ti->ti_len <= sbspace(&so->so_rcv)) {
- /*
- * this is a pure, in-sequence data packet
- * with nothing on the reassembly queue and
- * we have enough buffer space to take it.
- */
- ++tcpstat.tcps_preddat;
- tp->rcv_nxt += ti->ti_len;
- tcpstat.tcps_rcvpack++;
- tcpstat.tcps_rcvbyte += ti->ti_len;
- /*
- * Add data to socket buffer.
- */
- sbappend(&so->so_rcv, m);
- sorwakeup(so);
-#ifdef TCP_ACK_HACK
- /*
- * If this is a short packet, then ACK now - with Nagel
- * congestion avoidance sender won't send more until
- * he gets an ACK.
- */
- if (tiflags & TH_PUSH) {
- tp->t_flags |= TF_ACKNOW;
- tcp_output(tp);
- } else {
- tp->t_flags |= TF_DELACK;
- }
-#else
- tp->t_flags |= TF_DELACK;
-#endif
- return;
- }
- }
-
- /*
- * Calculate amount of space in receive window,
- * and then do TCP input processing.
- * Receive window is amount of space in rcv queue,
- * but not less than advertised window.
- */
- { int win;
-
- win = sbspace(&so->so_rcv);
- if (win < 0)
- win = 0;
- tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt));
- }
-
- switch (tp->t_state) {
-
- /*
- * If the state is LISTEN then ignore segment if it contains an RST.
- * If the segment contains an ACK then it is bad and send a RST.
- * If it does not contain a SYN then it is not interesting; drop it.
- * If it is from this socket, drop it, it must be forged.
- * Don't bother responding if the destination was a broadcast.
- * Otherwise initialize tp->rcv_nxt, and tp->irs, select an initial
- * tp->iss, and send a segment:
- * <SEQ=ISS><ACK=RCV_NXT><CTL=SYN,ACK>
- * Also initialize tp->snd_nxt to tp->iss+1 and tp->snd_una to tp->iss.
- * Fill in remote peer address fields if not previously specified.
- * Enter SYN_RECEIVED state, and process any other fields of this
- * segment in this state.
- */
- case TCPS_LISTEN: {
- struct mbuf *am;
- register struct sockaddr_in *sin;
-
- if (tiflags & TH_RST)
- goto drop;
- if (tiflags & TH_ACK)
- goto dropwithreset;
- if ((tiflags & TH_SYN) == 0)
- goto drop;
- if ((ti->ti_dport == ti->ti_sport) &&
- (ti->ti_dst.s_addr == ti->ti_src.s_addr))
- goto drop;
- /*
- * RFC1122 4.2.3.10, p. 104: discard bcast/mcast SYN
- * in_broadcast() should never return true on a received
- * packet with M_BCAST not set.
- */
- if (m->m_flags & (M_BCAST|M_MCAST) ||
- IN_MULTICAST(ntohl(ti->ti_dst.s_addr)))
- goto drop;
- am = m_get(M_DONTWAIT, MT_SONAME); /* XXX */
- if (am == NULL)
- goto drop;
- am->m_len = sizeof (struct sockaddr_in);
- sin = mtod(am, struct sockaddr_in *);
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_addr = ti->ti_src;
- sin->sin_port = ti->ti_sport;
- bzero((caddr_t)sin->sin_zero, sizeof(sin->sin_zero));
- laddr = inp->inp_laddr;
- if (inp->inp_laddr.s_addr == INADDR_ANY)
- inp->inp_laddr = ti->ti_dst;
- if (in_pcbconnect(inp, am)) {
- inp->inp_laddr = laddr;
- (void) m_free(am);
- goto drop;
- }
- (void) m_free(am);
- tp->t_template = tcp_template(tp);
- if (tp->t_template == 0) {
- tp = tcp_drop(tp, ENOBUFS);
- dropsocket = 0; /* socket is already gone */
- goto drop;
- }
- if ((taop = tcp_gettaocache(inp)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
- tcp_dooptions(tp, optp, optlen, ti, &to);
- if (iss)
- tp->iss = iss;
- else
- tp->iss = tcp_iss;
- tcp_iss += TCP_ISSINCR/4;
- tp->irs = ti->ti_seq;
- tcp_sendseqinit(tp);
- tcp_rcvseqinit(tp);
- /*
- * Initialization of the tcpcb for transaction;
- * set SND.WND = SEG.WND,
- * initialize CCsend and CCrecv.
- */
- tp->snd_wnd = tiwin; /* initial send-window */
- tp->cc_send = CC_INC(tcp_ccgen);
- tp->cc_recv = to.to_cc;
- /*
- * Perform TAO test on incoming CC (SEG.CC) option, if any.
- * - compare SEG.CC against cached CC from the same host,
- * if any.
- * - if SEG.CC > chached value, SYN must be new and is accepted
- * immediately: save new CC in the cache, mark the socket
- * connected, enter ESTABLISHED state, turn on flag to
- * send a SYN in the next segment.
- * A virtual advertised window is set in rcv_adv to
- * initialize SWS prevention. Then enter normal segment
- * processing: drop SYN, process data and FIN.
- * - otherwise do a normal 3-way handshake.
- */
- if ((to.to_flag & TOF_CC) != 0) {
- if (taop->tao_cc != 0 && CC_GT(to.to_cc, taop->tao_cc)) {
- taop->tao_cc = to.to_cc;
- tp->t_state = TCPS_ESTABLISHED;
-
- /*
- * If there is a FIN, or if there is data and the
- * connection is local, then delay SYN,ACK(SYN) in
- * the hope of piggy-backing it on a response
- * segment. Otherwise must send ACK now in case
- * the other side is slow starting.
- */
- if ((tiflags & TH_FIN) || (ti->ti_len != 0 &&
- in_localaddr(inp->inp_faddr)))
- tp->t_flags |= (TF_DELACK | TF_NEEDSYN);
- else
- tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN);
-
- /*
- * Limit the `virtual advertised window' to TCP_MAXWIN
- * here. Even if we requested window scaling, it will
- * become effective only later when our SYN is acked.
- */
- tp->rcv_adv += min(tp->rcv_wnd, TCP_MAXWIN);
- tcpstat.tcps_connects++;
- soisconnected(so);
- tp->t_timer[TCPT_KEEP] = tcp_keepinit;
- dropsocket = 0; /* committed to socket */
- tcpstat.tcps_accepts++;
- goto trimthenstep6;
- }
- /* else do standard 3-way handshake */
- } else {
- /*
- * No CC option, but maybe CC.NEW:
- * invalidate cached value.
- */
- taop->tao_cc = 0;
- }
- /*
- * TAO test failed or there was no CC option,
- * do a standard 3-way handshake.
- */
- tp->t_flags |= TF_ACKNOW;
- tp->t_state = TCPS_SYN_RECEIVED;
- tp->t_timer[TCPT_KEEP] = tcp_keepinit;
- dropsocket = 0; /* committed to socket */
- tcpstat.tcps_accepts++;
- goto trimthenstep6;
- }
-
- /*
- * If the state is SYN_RECEIVED:
- * if seg contains SYN/ACK, send a RST.
- * if seg contains an ACK, but not for our SYN/ACK, send a RST.
- */
- case TCPS_SYN_RECEIVED:
- if (tiflags & TH_ACK) {
- if (tiflags & TH_SYN) {
- tcpstat.tcps_badsyn++;
- goto dropwithreset;
- }
- if (SEQ_LEQ(ti->ti_ack, tp->snd_una) ||
- SEQ_GT(ti->ti_ack, tp->snd_max))
- goto dropwithreset;
- }
- break;
-
- /*
- * If the state is SYN_SENT:
- * if seg contains an ACK, but not for our SYN, drop the input.
- * if seg contains a RST, then drop the connection.
- * if seg does not contain SYN, then drop it.
- * Otherwise this is an acceptable SYN segment
- * initialize tp->rcv_nxt and tp->irs
- * if seg contains ack then advance tp->snd_una
- * if SYN has been acked change to ESTABLISHED else SYN_RCVD state
- * arrange for segment to be acked (eventually)
- * continue processing rest of data/controls, beginning with URG
- */
- case TCPS_SYN_SENT:
- if ((taop = tcp_gettaocache(inp)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
-
- if ((tiflags & TH_ACK) &&
- (SEQ_LEQ(ti->ti_ack, tp->iss) ||
- SEQ_GT(ti->ti_ack, tp->snd_max))) {
- /*
- * If we have a cached CCsent for the remote host,
- * hence we haven't just crashed and restarted,
- * do not send a RST. This may be a retransmission
- * from the other side after our earlier ACK was lost.
- * Our new SYN, when it arrives, will serve as the
- * needed ACK.
- */
- if (taop->tao_ccsent != 0)
- goto drop;
- else
- goto dropwithreset;
- }
- if (tiflags & TH_RST) {
- if (tiflags & TH_ACK)
- tp = tcp_drop(tp, ECONNREFUSED);
- goto drop;
- }
- if ((tiflags & TH_SYN) == 0)
- goto drop;
- tp->snd_wnd = ti->ti_win; /* initial send window */
- tp->cc_recv = to.to_cc; /* foreign CC */
-
- tp->irs = ti->ti_seq;
- tcp_rcvseqinit(tp);
- if (tiflags & TH_ACK) {
- /*
- * Our SYN was acked. If segment contains CC.ECHO
- * option, check it to make sure this segment really
- * matches our SYN. If not, just drop it as old
- * duplicate, but send an RST if we're still playing
- * by the old rules. If no CC.ECHO option, make sure
- * we don't get fooled into using T/TCP.
- */
- if (to.to_flag & TOF_CCECHO) {
- if (tp->cc_send != to.to_ccecho)
- if (taop->tao_ccsent != 0)
- goto drop;
- else
- goto dropwithreset;
- } else
- tp->t_flags &= ~TF_RCVD_CC;
- tcpstat.tcps_connects++;
- soisconnected(so);
- /* Do window scaling on this connection? */
- if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
- (TF_RCVD_SCALE|TF_REQ_SCALE)) {
- tp->snd_scale = tp->requested_s_scale;
- tp->rcv_scale = tp->request_r_scale;
- }
- /* Segment is acceptable, update cache if undefined. */
- if (taop->tao_ccsent == 0)
- taop->tao_ccsent = to.to_ccecho;
-
- tp->rcv_adv += tp->rcv_wnd;
- tp->snd_una++; /* SYN is acked */
- /*
- * If there's data, delay ACK; if there's also a FIN
- * ACKNOW will be turned on later.
- */
- if (ti->ti_len != 0)
- tp->t_flags |= TF_DELACK;
- else
- tp->t_flags |= TF_ACKNOW;
- /*
- * Received <SYN,ACK> in SYN_SENT[*] state.
- * Transitions:
- * SYN_SENT --> ESTABLISHED
- * SYN_SENT* --> FIN_WAIT_1
- */
- if (tp->t_flags & TF_NEEDFIN) {
- tp->t_state = TCPS_FIN_WAIT_1;
- tp->t_flags &= ~TF_NEEDFIN;
- tiflags &= ~TH_SYN;
- } else {
- tp->t_state = TCPS_ESTABLISHED;
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- }
- } else {
- /*
- * Received initial SYN in SYN-SENT[*] state => simul-
- * taneous open. If segment contains CC option and there is
- * a cached CC, apply TAO test; if it succeeds, connection is
- * half-synchronized. Otherwise, do 3-way handshake:
- * SYN-SENT -> SYN-RECEIVED
- * SYN-SENT* -> SYN-RECEIVED*
- * If there was no CC option, clear cached CC value.
- */
- tp->t_flags |= TF_ACKNOW;
- tp->t_timer[TCPT_REXMT] = 0;
- if (to.to_flag & TOF_CC) {
- if (taop->tao_cc != 0 &&
- CC_GT(to.to_cc, taop->tao_cc)) {
- /*
- * update cache and make transition:
- * SYN-SENT -> ESTABLISHED*
- * SYN-SENT* -> FIN-WAIT-1*
- */
- taop->tao_cc = to.to_cc;
- if (tp->t_flags & TF_NEEDFIN) {
- tp->t_state = TCPS_FIN_WAIT_1;
- tp->t_flags &= ~TF_NEEDFIN;
- } else {
- tp->t_state = TCPS_ESTABLISHED;
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- }
- tp->t_flags |= TF_NEEDSYN;
- } else
- tp->t_state = TCPS_SYN_RECEIVED;
- } else {
- /* CC.NEW or no option => invalidate cache */
- taop->tao_cc = 0;
- tp->t_state = TCPS_SYN_RECEIVED;
- }
- }
-
-trimthenstep6:
- /*
- * Advance ti->ti_seq to correspond to first data byte.
- * If data, trim to stay within window,
- * dropping FIN if necessary.
- */
- ti->ti_seq++;
- if (ti->ti_len > tp->rcv_wnd) {
- todrop = ti->ti_len - tp->rcv_wnd;
- m_adj(m, -todrop);
- ti->ti_len = tp->rcv_wnd;
- tiflags &= ~TH_FIN;
- tcpstat.tcps_rcvpackafterwin++;
- tcpstat.tcps_rcvbyteafterwin += todrop;
- }
- tp->snd_wl1 = ti->ti_seq - 1;
- tp->rcv_up = ti->ti_seq;
- /*
- * Client side of transaction: already sent SYN and data.
- * If the remote host used T/TCP to validate the SYN,
- * our data will be ACK'd; if so, enter normal data segment
- * processing in the middle of step 5, ack processing.
- * Otherwise, goto step 6.
- */
- if (tiflags & TH_ACK)
- goto process_ACK;
- goto step6;
- /*
- * If the state is LAST_ACK or CLOSING or TIME_WAIT:
- * if segment contains a SYN and CC [not CC.NEW] option:
- * if state == TIME_WAIT and connection duration > MSL,
- * drop packet and send RST;
- *
- * if SEG.CC > CCrecv then is new SYN, and can implicitly
- * ack the FIN (and data) in retransmission queue.
- * Complete close and delete TCPCB. Then reprocess
- * segment, hoping to find new TCPCB in LISTEN state;
- *
- * else must be old SYN; drop it.
- * else do normal processing.
- */
- case TCPS_LAST_ACK:
- case TCPS_CLOSING:
- case TCPS_TIME_WAIT:
- if ((tiflags & TH_SYN) &&
- (to.to_flag & TOF_CC) && tp->cc_recv != 0) {
- if (tp->t_state == TCPS_TIME_WAIT &&
- tp->t_duration > TCPTV_MSL)
- goto dropwithreset;
- if (CC_GT(to.to_cc, tp->cc_recv)) {
- tp = tcp_close(tp);
- goto findpcb;
- }
- else
- goto drop;
- }
- break; /* continue normal processing */
- }
-
- /*
- * States other than LISTEN or SYN_SENT.
- * First check timestamp, if present.
- * Then check the connection count, if present.
- * Then check that at least some bytes of segment are within
- * receive window. If segment begins before rcv_nxt,
- * drop leading data (and SYN); if nothing left, just ack.
- *
- * RFC 1323 PAWS: If we have a timestamp reply on this segment
- * and it's less than ts_recent, drop it.
- */
- if ((to.to_flag & TOF_TS) != 0 && (tiflags & TH_RST) == 0 &&
- tp->ts_recent && TSTMP_LT(to.to_tsval, tp->ts_recent)) {
-
- /* Check to see if ts_recent is over 24 days old. */
- if ((int)(tcp_now - tp->ts_recent_age) > TCP_PAWS_IDLE) {
- /*
- * Invalidate ts_recent. If this segment updates
- * ts_recent, the age will be reset later and ts_recent
- * will get a valid value. If it does not, setting
- * ts_recent to zero will at least satisfy the
- * requirement that zero be placed in the timestamp
- * echo reply when ts_recent isn't valid. The
- * age isn't reset until we get a valid ts_recent
- * because we don't want out-of-order segments to be
- * dropped when ts_recent is old.
- */
- tp->ts_recent = 0;
- } else {
- tcpstat.tcps_rcvduppack++;
- tcpstat.tcps_rcvdupbyte += ti->ti_len;
- tcpstat.tcps_pawsdrop++;
- goto dropafterack;
- }
- }
-
- /*
- * T/TCP mechanism
- * If T/TCP was negotiated and the segment doesn't have CC,
- * or if it's CC is wrong then drop the segment.
- * RST segments do not have to comply with this.
- */
- if ((tp->t_flags & (TF_REQ_CC|TF_RCVD_CC)) == (TF_REQ_CC|TF_RCVD_CC) &&
- ((to.to_flag & TOF_CC) == 0 || tp->cc_recv != to.to_cc) &&
- (tiflags & TH_RST) == 0)
- goto dropafterack;
-
- todrop = tp->rcv_nxt - ti->ti_seq;
- if (todrop > 0) {
- if (tiflags & TH_SYN) {
- tiflags &= ~TH_SYN;
- ti->ti_seq++;
- if (ti->ti_urp > 1)
- ti->ti_urp--;
- else
- tiflags &= ~TH_URG;
- todrop--;
- }
- /*
- * Following if statement from Stevens, vol. 2, p. 960.
- */
- if (todrop > ti->ti_len
- || (todrop == ti->ti_len && (tiflags & TH_FIN) == 0)) {
- /*
- * Any valid FIN must be to the left of the window.
- * At this point the FIN must be a duplicate or out
- * of sequence; drop it.
- */
- tiflags &= ~TH_FIN;
-
- /*
- * Send an ACK to resynchronize and drop any data.
- * But keep on processing for RST or ACK.
- */
- tp->t_flags |= TF_ACKNOW;
- todrop = ti->ti_len;
- tcpstat.tcps_rcvduppack++;
- tcpstat.tcps_rcvdupbyte += todrop;
- } else {
- tcpstat.tcps_rcvpartduppack++;
- tcpstat.tcps_rcvpartdupbyte += todrop;
- }
- m_adj(m, todrop);
- ti->ti_seq += todrop;
- ti->ti_len -= todrop;
- if (ti->ti_urp > todrop)
- ti->ti_urp -= todrop;
- else {
- tiflags &= ~TH_URG;
- ti->ti_urp = 0;
- }
- }
-
- /*
- * If new data are received on a connection after the
- * user processes are gone, then RST the other end.
- */
- if ((so->so_state & SS_NOFDREF) &&
- tp->t_state > TCPS_CLOSE_WAIT && ti->ti_len) {
- tp = tcp_close(tp);
- tcpstat.tcps_rcvafterclose++;
- goto dropwithreset;
- }
-
- /*
- * If segment ends after window, drop trailing data
- * (and PUSH and FIN); if nothing left, just ACK.
- */
- todrop = (ti->ti_seq+ti->ti_len) - (tp->rcv_nxt+tp->rcv_wnd);
- if (todrop > 0) {
- tcpstat.tcps_rcvpackafterwin++;
- if (todrop >= ti->ti_len) {
- tcpstat.tcps_rcvbyteafterwin += ti->ti_len;
- /*
- * If a new connection request is received
- * while in TIME_WAIT, drop the old connection
- * and start over if the sequence numbers
- * are above the previous ones.
- */
- if (tiflags & TH_SYN &&
- tp->t_state == TCPS_TIME_WAIT &&
- SEQ_GT(ti->ti_seq, tp->rcv_nxt)) {
- iss = tp->rcv_nxt + TCP_ISSINCR;
- tp = tcp_close(tp);
- goto findpcb;
- }
- /*
- * If window is closed can only take segments at
- * window edge, and have to drop data and PUSH from
- * incoming segments. Continue processing, but
- * remember to ack. Otherwise, drop segment
- * and ack.
- */
- if (tp->rcv_wnd == 0 && ti->ti_seq == tp->rcv_nxt) {
- tp->t_flags |= TF_ACKNOW;
- tcpstat.tcps_rcvwinprobe++;
- } else
- goto dropafterack;
- } else
- tcpstat.tcps_rcvbyteafterwin += todrop;
- m_adj(m, -todrop);
- ti->ti_len -= todrop;
- tiflags &= ~(TH_PUSH|TH_FIN);
- }
-
- /*
- * If last ACK falls within this segment's sequence numbers,
- * record its timestamp.
- * NOTE that the test is modified according to the latest
- * proposal of the tcplw@cray.com list (Braden 1993/04/26).
- */
- if ((to.to_flag & TOF_TS) != 0 &&
- SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) {
- tp->ts_recent_age = tcp_now;
- tp->ts_recent = to.to_tsval;
- }
-
- /*
- * If the RST bit is set examine the state:
- * SYN_RECEIVED STATE:
- * If passive open, return to LISTEN state.
- * If active open, inform user that connection was refused.
- * ESTABLISHED, FIN_WAIT_1, FIN_WAIT2, CLOSE_WAIT STATES:
- * Inform user that connection was reset, and close tcb.
- * CLOSING, LAST_ACK, TIME_WAIT STATES
- * Close the tcb.
- */
- if (tiflags&TH_RST) switch (tp->t_state) {
-
- case TCPS_SYN_RECEIVED:
- so->so_error = ECONNREFUSED;
- goto close;
-
- case TCPS_ESTABLISHED:
- case TCPS_FIN_WAIT_1:
- case TCPS_FIN_WAIT_2:
- case TCPS_CLOSE_WAIT:
- so->so_error = ECONNRESET;
- close:
- tp->t_state = TCPS_CLOSED;
- tcpstat.tcps_drops++;
- tp = tcp_close(tp);
- goto drop;
-
- case TCPS_CLOSING:
- case TCPS_LAST_ACK:
- case TCPS_TIME_WAIT:
- tp = tcp_close(tp);
- goto drop;
- }
-
- /*
- * If a SYN is in the window, then this is an
- * error and we send an RST and drop the connection.
- */
- if (tiflags & TH_SYN) {
- tp = tcp_drop(tp, ECONNRESET);
- goto dropwithreset;
- }
-
- /*
- * If the ACK bit is off: if in SYN-RECEIVED state or SENDSYN
- * flag is on (half-synchronized state), then queue data for
- * later processing; else drop segment and return.
- */
- if ((tiflags & TH_ACK) == 0) {
- if (tp->t_state == TCPS_SYN_RECEIVED ||
- (tp->t_flags & TF_NEEDSYN))
- goto step6;
- else
- goto drop;
- }
-
- /*
- * Ack processing.
- */
- switch (tp->t_state) {
-
- /*
- * In SYN_RECEIVED state, the ack ACKs our SYN, so enter
- * ESTABLISHED state and continue processing.
- * The ACK was checked above.
- */
- case TCPS_SYN_RECEIVED:
-
- tcpstat.tcps_connects++;
- soisconnected(so);
- /* Do window scaling? */
- if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
- (TF_RCVD_SCALE|TF_REQ_SCALE)) {
- tp->snd_scale = tp->requested_s_scale;
- tp->rcv_scale = tp->request_r_scale;
- }
- /*
- * Upon successful completion of 3-way handshake,
- * update cache.CC if it was undefined, pass any queued
- * data to the user, and advance state appropriately.
- */
- if ((taop = tcp_gettaocache(inp)) != NULL &&
- taop->tao_cc == 0)
- taop->tao_cc = tp->cc_recv;
-
- /*
- * Make transitions:
- * SYN-RECEIVED -> ESTABLISHED
- * SYN-RECEIVED* -> FIN-WAIT-1
- */
- if (tp->t_flags & TF_NEEDFIN) {
- tp->t_state = TCPS_FIN_WAIT_1;
- tp->t_flags &= ~TF_NEEDFIN;
- } else {
- tp->t_state = TCPS_ESTABLISHED;
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- }
- /*
- * If segment contains data or ACK, will call tcp_reass()
- * later; if not, do so now to pass queued data to user.
- */
- if (ti->ti_len == 0 && (tiflags & TH_FIN) == 0)
- (void) tcp_reass(tp, (struct tcpiphdr *)0,
- (struct mbuf *)0);
- tp->snd_wl1 = ti->ti_seq - 1;
- /* fall into ... */
-
- /*
- * In ESTABLISHED state: drop duplicate ACKs; ACK out of range
- * ACKs. If the ack is in the range
- * tp->snd_una < ti->ti_ack <= tp->snd_max
- * then advance tp->snd_una to ti->ti_ack and drop
- * data from the retransmission queue. If this ACK reflects
- * more up to date window information we update our window information.
- */
- case TCPS_ESTABLISHED:
- case TCPS_FIN_WAIT_1:
- case TCPS_FIN_WAIT_2:
- case TCPS_CLOSE_WAIT:
- case TCPS_CLOSING:
- case TCPS_LAST_ACK:
- case TCPS_TIME_WAIT:
-
- if (SEQ_LEQ(ti->ti_ack, tp->snd_una)) {
- if (ti->ti_len == 0 && tiwin == tp->snd_wnd) {
- tcpstat.tcps_rcvdupack++;
- /*
- * If we have outstanding data (other than
- * a window probe), this is a completely
- * duplicate ack (ie, window info didn't
- * change), the ack is the biggest we've
- * seen and we've seen exactly our rexmt
- * threshhold of them, assume a packet
- * has been dropped and retransmit it.
- * Kludge snd_nxt & the congestion
- * window so we send only this one
- * packet.
- *
- * We know we're losing at the current
- * window size so do congestion avoidance
- * (set ssthresh to half the current window
- * and pull our congestion window back to
- * the new ssthresh).
- *
- * Dup acks mean that packets have left the
- * network (they're now cached at the receiver)
- * so bump cwnd by the amount in the receiver
- * to keep a constant cwnd packets in the
- * network.
- */
- if (tp->t_timer[TCPT_REXMT] == 0 ||
- ti->ti_ack != tp->snd_una)
- tp->t_dupacks = 0;
- else if (++tp->t_dupacks == tcprexmtthresh) {
- tcp_seq onxt = tp->snd_nxt;
- u_int win =
- min(tp->snd_wnd, tp->snd_cwnd) / 2 /
- tp->t_maxseg;
-
- if (win < 2)
- win = 2;
- tp->snd_ssthresh = win * tp->t_maxseg;
- tp->t_timer[TCPT_REXMT] = 0;
- tp->t_rtt = 0;
- tp->snd_nxt = ti->ti_ack;
- tp->snd_cwnd = tp->t_maxseg;
- (void) tcp_output(tp);
- tp->snd_cwnd = tp->snd_ssthresh +
- tp->t_maxseg * tp->t_dupacks;
- if (SEQ_GT(onxt, tp->snd_nxt))
- tp->snd_nxt = onxt;
- goto drop;
- } else if (tp->t_dupacks > tcprexmtthresh) {
- tp->snd_cwnd += tp->t_maxseg;
- (void) tcp_output(tp);
- goto drop;
- }
- } else
- tp->t_dupacks = 0;
- break;
- }
- /*
- * If the congestion window was inflated to account
- * for the other side's cached packets, retract it.
- */
- if (tp->t_dupacks >= tcprexmtthresh &&
- tp->snd_cwnd > tp->snd_ssthresh)
- tp->snd_cwnd = tp->snd_ssthresh;
- tp->t_dupacks = 0;
- if (SEQ_GT(ti->ti_ack, tp->snd_max)) {
- tcpstat.tcps_rcvacktoomuch++;
- goto dropafterack;
- }
- /*
- * If we reach this point, ACK is not a duplicate,
- * i.e., it ACKs something we sent.
- */
- if (tp->t_flags & TF_NEEDSYN) {
- /*
- * T/TCP: Connection was half-synchronized, and our
- * SYN has been ACK'd (so connection is now fully
- * synchronized). Go to non-starred state,
- * increment snd_una for ACK of SYN, and check if
- * we can do window scaling.
- */
- tp->t_flags &= ~TF_NEEDSYN;
- tp->snd_una++;
- /* Do window scaling? */
- if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
- (TF_RCVD_SCALE|TF_REQ_SCALE)) {
- tp->snd_scale = tp->requested_s_scale;
- tp->rcv_scale = tp->request_r_scale;
- }
- }
-
-process_ACK:
- acked = ti->ti_ack - tp->snd_una;
- tcpstat.tcps_rcvackpack++;
- tcpstat.tcps_rcvackbyte += acked;
-
- /*
- * If we have a timestamp reply, update smoothed
- * round trip time. If no timestamp is present but
- * transmit timer is running and timed sequence
- * number was acked, update smoothed round trip time.
- * Since we now have an rtt measurement, cancel the
- * timer backoff (cf., Phil Karn's retransmit alg.).
- * Recompute the initial retransmit timer.
- */
- if (to.to_flag & TOF_TS)
- tcp_xmit_timer(tp, tcp_now - to.to_tsecr + 1);
- else if (tp->t_rtt && SEQ_GT(ti->ti_ack, tp->t_rtseq))
- tcp_xmit_timer(tp,tp->t_rtt);
-
- /*
- * If all outstanding data is acked, stop retransmit
- * timer and remember to restart (more output or persist).
- * If there is more data to be acked, restart retransmit
- * timer, using current (possibly backed-off) value.
- */
- if (ti->ti_ack == tp->snd_max) {
- tp->t_timer[TCPT_REXMT] = 0;
- needoutput = 1;
- } else if (tp->t_timer[TCPT_PERSIST] == 0)
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
-
- /*
- * If no data (only SYN) was ACK'd,
- * skip rest of ACK processing.
- */
- if (acked == 0)
- goto step6;
-
- /*
- * When new data is acked, open the congestion window.
- * If the window gives us less than ssthresh packets
- * in flight, open exponentially (maxseg per packet).
- * Otherwise open linearly: maxseg per window
- * (maxseg^2 / cwnd per packet).
- */
- {
- register u_int cw = tp->snd_cwnd;
- register u_int incr = tp->t_maxseg;
-
- if (cw > tp->snd_ssthresh)
- incr = incr * incr / cw;
- tp->snd_cwnd = min(cw + incr, TCP_MAXWIN<<tp->snd_scale);
- }
- if (acked > so->so_snd.sb_cc) {
- tp->snd_wnd -= so->so_snd.sb_cc;
- sbdrop(&so->so_snd, (int)so->so_snd.sb_cc);
- ourfinisacked = 1;
- } else {
- sbdrop(&so->so_snd, acked);
- tp->snd_wnd -= acked;
- ourfinisacked = 0;
- }
- if (so->so_snd.sb_flags & SB_NOTIFY)
- sowwakeup(so);
- tp->snd_una = ti->ti_ack;
- if (SEQ_LT(tp->snd_nxt, tp->snd_una))
- tp->snd_nxt = tp->snd_una;
-
- switch (tp->t_state) {
-
- /*
- * In FIN_WAIT_1 STATE in addition to the processing
- * for the ESTABLISHED state if our FIN is now acknowledged
- * then enter FIN_WAIT_2.
- */
- case TCPS_FIN_WAIT_1:
- if (ourfinisacked) {
- /*
- * If we can't receive any more
- * data, then closing user can proceed.
- * Starting the timer is contrary to the
- * specification, but if we don't get a FIN
- * we'll hang forever.
- */
- if (so->so_state & SS_CANTRCVMORE) {
- soisdisconnected(so);
- tp->t_timer[TCPT_2MSL] = tcp_maxidle;
- }
- tp->t_state = TCPS_FIN_WAIT_2;
- }
- break;
-
- /*
- * In CLOSING STATE in addition to the processing for
- * the ESTABLISHED state if the ACK acknowledges our FIN
- * then enter the TIME-WAIT state, otherwise ignore
- * the segment.
- */
- case TCPS_CLOSING:
- if (ourfinisacked) {
- tp->t_state = TCPS_TIME_WAIT;
- tcp_canceltimers(tp);
- /* Shorten TIME_WAIT [RFC-1644, p.28] */
- if (tp->cc_recv != 0 &&
- tp->t_duration < TCPTV_MSL)
- tp->t_timer[TCPT_2MSL] =
- tp->t_rxtcur * TCPTV_TWTRUNC;
- else
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- soisdisconnected(so);
- }
- break;
-
- /*
- * In LAST_ACK, we may still be waiting for data to drain
- * and/or to be acked, as well as for the ack of our FIN.
- * If our FIN is now acknowledged, delete the TCB,
- * enter the closed state and return.
- */
- case TCPS_LAST_ACK:
- if (ourfinisacked) {
- tp = tcp_close(tp);
- goto drop;
- }
- break;
-
- /*
- * In TIME_WAIT state the only thing that should arrive
- * is a retransmission of the remote FIN. Acknowledge
- * it and restart the finack timer.
- */
- case TCPS_TIME_WAIT:
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- goto dropafterack;
- }
- }
-
-step6:
- /*
- * Update window information.
- * Don't look at window if no ACK: TAC's send garbage on first SYN.
- */
- if ((tiflags & TH_ACK) &&
- (SEQ_LT(tp->snd_wl1, ti->ti_seq) ||
- (tp->snd_wl1 == ti->ti_seq && (SEQ_LT(tp->snd_wl2, ti->ti_ack) ||
- (tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd))))) {
- /* keep track of pure window updates */
- if (ti->ti_len == 0 &&
- tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd)
- tcpstat.tcps_rcvwinupd++;
- tp->snd_wnd = tiwin;
- tp->snd_wl1 = ti->ti_seq;
- tp->snd_wl2 = ti->ti_ack;
- if (tp->snd_wnd > tp->max_sndwnd)
- tp->max_sndwnd = tp->snd_wnd;
- needoutput = 1;
- }
-
- /*
- * Process segments with URG.
- */
- if ((tiflags & TH_URG) && ti->ti_urp &&
- TCPS_HAVERCVDFIN(tp->t_state) == 0) {
- /*
- * This is a kludge, but if we receive and accept
- * random urgent pointers, we'll crash in
- * soreceive. It's hard to imagine someone
- * actually wanting to send this much urgent data.
- */
- if (ti->ti_urp + so->so_rcv.sb_cc > sb_max) {
- ti->ti_urp = 0; /* XXX */
- tiflags &= ~TH_URG; /* XXX */
- goto dodata; /* XXX */
- }
- /*
- * If this segment advances the known urgent pointer,
- * then mark the data stream. This should not happen
- * in CLOSE_WAIT, CLOSING, LAST_ACK or TIME_WAIT STATES since
- * a FIN has been received from the remote side.
- * In these states we ignore the URG.
- *
- * According to RFC961 (Assigned Protocols),
- * the urgent pointer points to the last octet
- * of urgent data. We continue, however,
- * to consider it to indicate the first octet
- * of data past the urgent section as the original
- * spec states (in one of two places).
- */
- if (SEQ_GT(ti->ti_seq+ti->ti_urp, tp->rcv_up)) {
- tp->rcv_up = ti->ti_seq + ti->ti_urp;
- so->so_oobmark = so->so_rcv.sb_cc +
- (tp->rcv_up - tp->rcv_nxt) - 1;
- if (so->so_oobmark == 0)
- so->so_state |= SS_RCVATMARK;
- sohasoutofband(so);
- tp->t_oobflags &= ~(TCPOOB_HAVEDATA | TCPOOB_HADDATA);
- }
- /*
- * Remove out of band data so doesn't get presented to user.
- * This can happen independent of advancing the URG pointer,
- * but if two URG's are pending at once, some out-of-band
- * data may creep in... ick.
- */
- if (ti->ti_urp <= (u_long)ti->ti_len
-#ifdef SO_OOBINLINE
- && (so->so_options & SO_OOBINLINE) == 0
-#endif
- )
- tcp_pulloutofband(so, ti, m);
- } else
- /*
- * If no out of band data is expected,
- * pull receive urgent pointer along
- * with the receive window.
- */
- if (SEQ_GT(tp->rcv_nxt, tp->rcv_up))
- tp->rcv_up = tp->rcv_nxt;
-dodata: /* XXX */
-
- /*
- * Process the segment text, merging it into the TCP sequencing queue,
- * and arranging for acknowledgment of receipt if necessary.
- * This process logically involves adjusting tp->rcv_wnd as data
- * is presented to the user (this happens in tcp_usrreq.c,
- * case PRU_RCVD). If a FIN has already been received on this
- * connection then we just ignore the text.
- */
- if ((ti->ti_len || (tiflags&TH_FIN)) &&
- TCPS_HAVERCVDFIN(tp->t_state) == 0) {
- TCP_REASS(tp, ti, m, so, tiflags);
- /*
- * Note the amount of data that peer has sent into
- * our window, in order to estimate the sender's
- * buffer size.
- */
- len = so->so_rcv.sb_hiwat - (tp->rcv_adv - tp->rcv_nxt);
- } else {
- m_freem(m);
- tiflags &= ~TH_FIN;
- }
-
- /*
- * If FIN is received ACK the FIN and let the user know
- * that the connection is closing.
- */
- if (tiflags & TH_FIN) {
- if (TCPS_HAVERCVDFIN(tp->t_state) == 0) {
- socantrcvmore(so);
- /*
- * If connection is half-synchronized
- * (ie NEEDSYN flag on) then delay ACK,
- * so it may be piggybacked when SYN is sent.
- * Otherwise, since we received a FIN then no
- * more input can be expected, send ACK now.
- */
- if (tp->t_flags & TF_NEEDSYN)
- tp->t_flags |= TF_DELACK;
- else
- tp->t_flags |= TF_ACKNOW;
- tp->rcv_nxt++;
- }
- switch (tp->t_state) {
-
- /*
- * In SYN_RECEIVED and ESTABLISHED STATES
- * enter the CLOSE_WAIT state.
- */
- case TCPS_SYN_RECEIVED:
- case TCPS_ESTABLISHED:
- tp->t_state = TCPS_CLOSE_WAIT;
- break;
-
- /*
- * If still in FIN_WAIT_1 STATE FIN has not been acked so
- * enter the CLOSING state.
- */
- case TCPS_FIN_WAIT_1:
- tp->t_state = TCPS_CLOSING;
- break;
-
- /*
- * In FIN_WAIT_2 state enter the TIME_WAIT state,
- * starting the time-wait timer, turning off the other
- * standard timers.
- */
- case TCPS_FIN_WAIT_2:
- tp->t_state = TCPS_TIME_WAIT;
- tcp_canceltimers(tp);
- /* Shorten TIME_WAIT [RFC-1644, p.28] */
- if (tp->cc_recv != 0 &&
- tp->t_duration < TCPTV_MSL) {
- tp->t_timer[TCPT_2MSL] =
- tp->t_rxtcur * TCPTV_TWTRUNC;
- /* For transaction client, force ACK now. */
- tp->t_flags |= TF_ACKNOW;
- }
- else
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- soisdisconnected(so);
- break;
-
- /*
- * In TIME_WAIT state restart the 2 MSL time_wait timer.
- */
- case TCPS_TIME_WAIT:
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- break;
- }
- }
-#ifdef TCPDEBUG
- if (so->so_options & SO_DEBUG)
- tcp_trace(TA_INPUT, ostate, tp, &tcp_saveti, 0);
-#endif
-
- /*
- * Return any desired output.
- */
- if (needoutput || (tp->t_flags & TF_ACKNOW))
- (void) tcp_output(tp);
- return;
-
-dropafterack:
- /*
- * Generate an ACK dropping incoming segment if it occupies
- * sequence space, where the ACK reflects our state.
- */
- if (tiflags & TH_RST)
- goto drop;
-#ifdef TCPDEBUG
- if (so->so_options & SO_DEBUG)
- tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0);
-#endif
- m_freem(m);
- tp->t_flags |= TF_ACKNOW;
- (void) tcp_output(tp);
- return;
-
-dropwithreset:
- /*
- * Generate a RST, dropping incoming segment.
- * Make ACK acceptable to originator of segment.
- * Don't bother to respond if destination was broadcast/multicast.
- */
- if ((tiflags & TH_RST) || m->m_flags & (M_BCAST|M_MCAST) ||
- IN_MULTICAST(ntohl(ti->ti_dst.s_addr)))
- goto drop;
-#ifdef TCPDEBUG
- if (tp == 0 || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
- tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0);
-#endif
- if (tiflags & TH_ACK)
- tcp_respond(tp, ti, m, (tcp_seq)0, ti->ti_ack, TH_RST);
- else {
- if (tiflags & TH_SYN)
- ti->ti_len++;
- tcp_respond(tp, ti, m, ti->ti_seq+ti->ti_len, (tcp_seq)0,
- TH_RST|TH_ACK);
- }
- /* destroy temporarily created socket */
- if (dropsocket)
- (void) soabort(so);
- return;
-
-drop:
- /*
- * Drop space held by incoming segment and return.
- */
-#ifdef TCPDEBUG
- if (tp == 0 || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
- tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0);
-#endif
- m_freem(m);
- /* destroy temporarily created socket */
- if (dropsocket)
- (void) soabort(so);
- return;
-#ifndef TUBA_INCLUDE
-}
-
-static void
-tcp_dooptions(tp, cp, cnt, ti, to)
- struct tcpcb *tp;
- u_char *cp;
- int cnt;
- struct tcpiphdr *ti;
- struct tcpopt *to;
-{
- u_short mss = 0;
- int opt, optlen;
-
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[0];
- if (opt == TCPOPT_EOL)
- break;
- if (opt == TCPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[1];
- if (optlen <= 0)
- break;
- }
- switch (opt) {
-
- default:
- continue;
-
- case TCPOPT_MAXSEG:
- if (optlen != TCPOLEN_MAXSEG)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- bcopy((char *) cp + 2, (char *) &mss, sizeof(mss));
- NTOHS(mss);
- break;
-
- case TCPOPT_WINDOW:
- if (optlen != TCPOLEN_WINDOW)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- tp->t_flags |= TF_RCVD_SCALE;
- tp->requested_s_scale = min(cp[2], TCP_MAX_WINSHIFT);
- break;
-
- case TCPOPT_TIMESTAMP:
- if (optlen != TCPOLEN_TIMESTAMP)
- continue;
- to->to_flag |= TOF_TS;
- bcopy((char *)cp + 2,
- (char *)&to->to_tsval, sizeof(to->to_tsval));
- NTOHL(to->to_tsval);
- bcopy((char *)cp + 6,
- (char *)&to->to_tsecr, sizeof(to->to_tsecr));
- NTOHL(to->to_tsecr);
-
- /*
- * A timestamp received in a SYN makes
- * it ok to send timestamp requests and replies.
- */
- if (ti->ti_flags & TH_SYN) {
- tp->t_flags |= TF_RCVD_TSTMP;
- tp->ts_recent = to->to_tsval;
- tp->ts_recent_age = tcp_now;
- }
- break;
- case TCPOPT_CC:
- if (optlen != TCPOLEN_CC)
- continue;
- to->to_flag |= TOF_CC;
- bcopy((char *)cp + 2,
- (char *)&to->to_cc, sizeof(to->to_cc));
- NTOHL(to->to_cc);
- /*
- * A CC or CC.new option received in a SYN makes
- * it ok to send CC in subsequent segments.
- */
- if (ti->ti_flags & TH_SYN)
- tp->t_flags |= TF_RCVD_CC;
- break;
- case TCPOPT_CCNEW:
- if (optlen != TCPOLEN_CC)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- to->to_flag |= TOF_CCNEW;
- bcopy((char *)cp + 2,
- (char *)&to->to_cc, sizeof(to->to_cc));
- NTOHL(to->to_cc);
- /*
- * A CC or CC.new option received in a SYN makes
- * it ok to send CC in subsequent segments.
- */
- tp->t_flags |= TF_RCVD_CC;
- break;
- case TCPOPT_CCECHO:
- if (optlen != TCPOLEN_CC)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- to->to_flag |= TOF_CCECHO;
- bcopy((char *)cp + 2,
- (char *)&to->to_ccecho, sizeof(to->to_ccecho));
- NTOHL(to->to_ccecho);
- break;
- }
- }
- if (ti->ti_flags & TH_SYN)
- tcp_mss(tp, mss); /* sets t_maxseg */
-}
-
-/*
- * Pull out of band byte out of a segment so
- * it doesn't appear in the user's data queue.
- * It is still reflected in the segment length for
- * sequencing purposes.
- */
-static void
-tcp_pulloutofband(so, ti, m)
- struct socket *so;
- struct tcpiphdr *ti;
- register struct mbuf *m;
-{
- int cnt = ti->ti_urp - 1;
-
- while (cnt >= 0) {
- if (m->m_len > cnt) {
- char *cp = mtod(m, caddr_t) + cnt;
- struct tcpcb *tp = sototcpcb(so);
-
- tp->t_iobc = *cp;
- tp->t_oobflags |= TCPOOB_HAVEDATA;
- bcopy(cp+1, cp, (unsigned)(m->m_len - cnt - 1));
- m->m_len--;
- return;
- }
- cnt -= m->m_len;
- m = m->m_next;
- if (m == 0)
- break;
- }
- panic("tcp_pulloutofband");
-}
-
-/*
- * Collect new round-trip time estimate
- * and update averages and current timeout.
- */
-static void
-tcp_xmit_timer(tp, rtt)
- register struct tcpcb *tp;
- short rtt;
-{
- register int delta;
-
- tcpstat.tcps_rttupdated++;
- tp->t_rttupdated++;
- if (tp->t_srtt != 0) {
- /*
- * srtt is stored as fixed point with 5 bits after the
- * binary point (i.e., scaled by 8). The following magic
- * is equivalent to the smoothing algorithm in rfc793 with
- * an alpha of .875 (srtt = rtt/8 + srtt*7/8 in fixed
- * point). Adjust rtt to origin 0.
- */
- delta = ((rtt - 1) << TCP_DELTA_SHIFT)
- - (tp->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT));
-
- if ((tp->t_srtt += delta) <= 0)
- tp->t_srtt = 1;
-
- /*
- * We accumulate a smoothed rtt variance (actually, a
- * smoothed mean difference), then set the retransmit
- * timer to smoothed rtt + 4 times the smoothed variance.
- * rttvar is stored as fixed point with 4 bits after the
- * binary point (scaled by 16). The following is
- * equivalent to rfc793 smoothing with an alpha of .75
- * (rttvar = rttvar*3/4 + |delta| / 4). This replaces
- * rfc793's wired-in beta.
- */
- if (delta < 0)
- delta = -delta;
- delta -= tp->t_rttvar >> (TCP_RTTVAR_SHIFT - TCP_DELTA_SHIFT);
- if ((tp->t_rttvar += delta) <= 0)
- tp->t_rttvar = 1;
- } else {
- /*
- * No rtt measurement yet - use the unsmoothed rtt.
- * Set the variance to half the rtt (so our first
- * retransmit happens at 3*rtt).
- */
- tp->t_srtt = rtt << TCP_RTT_SHIFT;
- tp->t_rttvar = rtt << (TCP_RTTVAR_SHIFT - 1);
- }
- tp->t_rtt = 0;
- tp->t_rxtshift = 0;
-
- /*
- * the retransmit should happen at rtt + 4 * rttvar.
- * Because of the way we do the smoothing, srtt and rttvar
- * will each average +1/2 tick of bias. When we compute
- * the retransmit timer, we want 1/2 tick of rounding and
- * 1 extra tick because of +-1/2 tick uncertainty in the
- * firing of the timer. The bias will give us exactly the
- * 1.5 tick we need. But, because the bias is
- * statistical, we have to test that we don't drop below
- * the minimum feasible timer (which is 2 ticks).
- */
- TCPT_RANGESET(tp->t_rxtcur, TCP_REXMTVAL(tp),
- max(tp->t_rttmin, rtt + 2), TCPTV_REXMTMAX);
-
- /*
- * We received an ack for a packet that wasn't retransmitted;
- * it is probably safe to discard any error indications we've
- * received recently. This isn't quite right, but close enough
- * for now (a route might have failed after we sent a segment,
- * and the return path might not be symmetrical).
- */
- tp->t_softerror = 0;
-}
-
-/*
- * Determine a reasonable value for maxseg size.
- * If the route is known, check route for mtu.
- * If none, use an mss that can be handled on the outgoing
- * interface without forcing IP to fragment; if bigger than
- * an mbuf cluster (MCLBYTES), round down to nearest multiple of MCLBYTES
- * to utilize large mbufs. If no route is found, route has no mtu,
- * or the destination isn't local, use a default, hopefully conservative
- * size (usually 512 or the default IP max size, but no more than the mtu
- * of the interface), as we can't discover anything about intervening
- * gateways or networks. We also initialize the congestion/slow start
- * window to be a single segment if the destination isn't local.
- * While looking at the routing entry, we also initialize other path-dependent
- * parameters from pre-set or cached values in the routing entry.
- *
- * Also take into account the space needed for options that we
- * send regularly. Make maxseg shorter by that amount to assure
- * that we can send maxseg amount of data even when the options
- * are present. Store the upper limit of the length of options plus
- * data in maxopd.
- *
- * NOTE that this routine is only called when we process an incoming
- * segment, for outgoing segments only tcp_mssopt is called.
- *
- * In case of T/TCP, we call this routine during implicit connection
- * setup as well (offer = -1), to initialize maxseg from the cached
- * MSS of our peer.
- */
-void
-tcp_mss(tp, offer)
- struct tcpcb *tp;
- int offer;
-{
- register struct rtentry *rt;
- struct ifnet *ifp;
- register int rtt, mss;
- u_long bufsize;
- struct inpcb *inp;
- struct socket *so;
- struct rmxp_tao *taop;
- int origoffer = offer;
-
- inp = tp->t_inpcb;
- if ((rt = tcp_rtlookup(inp)) == NULL) {
- tp->t_maxopd = tp->t_maxseg = tcp_mssdflt;
- return;
- }
- ifp = rt->rt_ifp;
- so = inp->inp_socket;
-
- taop = rmx_taop(rt->rt_rmx);
- /*
- * Offer == -1 means that we didn't receive SYN yet,
- * use cached value in that case;
- */
- if (offer == -1)
- offer = taop->tao_mssopt;
- /*
- * Offer == 0 means that there was no MSS on the SYN segment,
- * in this case we use tcp_mssdflt.
- */
- if (offer == 0)
- offer = tcp_mssdflt;
- else
- /*
- * Sanity check: make sure that maxopd will be large
- * enough to allow some data on segments even is the
- * all the option space is used (40bytes). Otherwise
- * funny things may happen in tcp_output.
- */
- offer = max(offer, 64);
- taop->tao_mssopt = offer;
-
- /*
- * While we're here, check if there's an initial rtt
- * or rttvar. Convert from the route-table units
- * to scaled multiples of the slow timeout timer.
- */
- if (tp->t_srtt == 0 && (rtt = rt->rt_rmx.rmx_rtt)) {
- /*
- * XXX the lock bit for RTT indicates that the value
- * is also a minimum value; this is subject to time.
- */
- if (rt->rt_rmx.rmx_locks & RTV_RTT)
- tp->t_rttmin = rtt / (RTM_RTTUNIT / PR_SLOWHZ);
- tp->t_srtt = rtt / (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTT_SCALE));
- tcpstat.tcps_usedrtt++;
- if (rt->rt_rmx.rmx_rttvar) {
- tp->t_rttvar = rt->rt_rmx.rmx_rttvar /
- (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTTVAR_SCALE));
- tcpstat.tcps_usedrttvar++;
- } else {
- /* default variation is +- 1 rtt */
- tp->t_rttvar =
- tp->t_srtt * TCP_RTTVAR_SCALE / TCP_RTT_SCALE;
- }
- TCPT_RANGESET(tp->t_rxtcur,
- ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1,
- tp->t_rttmin, TCPTV_REXMTMAX);
- }
- /*
- * if there's an mtu associated with the route, use it
- */
- if (rt->rt_rmx.rmx_mtu)
- mss = rt->rt_rmx.rmx_mtu - sizeof(struct tcpiphdr);
- else
- {
- mss = ifp->if_mtu - sizeof(struct tcpiphdr);
- if (!in_localaddr(inp->inp_faddr))
- mss = min(mss, tcp_mssdflt);
- }
- mss = min(mss, offer);
- /*
- * maxopd stores the maximum length of data AND options
- * in a segment; maxseg is the amount of data in a normal
- * segment. We need to store this value (maxopd) apart
- * from maxseg, because now every segment carries options
- * and thus we normally have somewhat less data in segments.
- */
- tp->t_maxopd = mss;
-
- /*
- * In case of T/TCP, origoffer==-1 indicates, that no segments
- * were received yet. In this case we just guess, otherwise
- * we do the same as before T/TCP.
- */
- if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP &&
- (origoffer == -1 ||
- (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP))
- mss -= TCPOLEN_TSTAMP_APPA;
- if ((tp->t_flags & (TF_REQ_CC|TF_NOOPT)) == TF_REQ_CC &&
- (origoffer == -1 ||
- (tp->t_flags & TF_RCVD_CC) == TF_RCVD_CC))
- mss -= TCPOLEN_CC_APPA;
-
-#if (MCLBYTES & (MCLBYTES - 1)) == 0
- if (mss > MCLBYTES)
- mss &= ~(MCLBYTES-1);
-#else
- if (mss > MCLBYTES)
- mss = mss / MCLBYTES * MCLBYTES;
-#endif
- /*
- * If there's a pipesize, change the socket buffer
- * to that size. Make the socket buffers an integral
- * number of mss units; if the mss is larger than
- * the socket buffer, decrease the mss.
- */
-#ifdef RTV_SPIPE
- if ((bufsize = rt->rt_rmx.rmx_sendpipe) == 0)
-#endif
- bufsize = so->so_snd.sb_hiwat;
- if (bufsize < mss)
- mss = bufsize;
- else {
- bufsize = roundup(bufsize, mss);
- if (bufsize > sb_max)
- bufsize = sb_max;
- (void)sbreserve(&so->so_snd, bufsize);
- }
- tp->t_maxseg = mss;
-
-#ifdef RTV_RPIPE
- if ((bufsize = rt->rt_rmx.rmx_recvpipe) == 0)
-#endif
- bufsize = so->so_rcv.sb_hiwat;
- if (bufsize > mss) {
- bufsize = roundup(bufsize, mss);
- if (bufsize > sb_max)
- bufsize = sb_max;
- (void)sbreserve(&so->so_rcv, bufsize);
- }
- /*
- * Don't force slow-start on local network.
- */
- if (!in_localaddr(inp->inp_faddr))
- tp->snd_cwnd = mss;
-
- if (rt->rt_rmx.rmx_ssthresh) {
- /*
- * There's some sort of gateway or interface
- * buffer limit on the path. Use this to set
- * the slow start threshhold, but set the
- * threshold to no less than 2*mss.
- */
- tp->snd_ssthresh = max(2 * mss, rt->rt_rmx.rmx_ssthresh);
- tcpstat.tcps_usedssthresh++;
- }
-}
-
-/*
- * Determine the MSS option to send on an outgoing SYN.
- */
-int
-tcp_mssopt(tp)
- struct tcpcb *tp;
-{
- struct rtentry *rt;
-
- rt = tcp_rtlookup(tp->t_inpcb);
- if (rt == NULL)
- return tcp_mssdflt;
-
- return rt->rt_ifp->if_mtu - sizeof(struct tcpiphdr);
-}
-#endif /* TUBA_INCLUDE */
diff --git a/c/src/lib/libnetworking/netinet/tcp_output.c b/c/src/lib/libnetworking/netinet/tcp_output.c
deleted file mode 100644
index cbb5218dce..0000000000
--- a/c/src/lib/libnetworking/netinet/tcp_output.c
+++ /dev/null
@@ -1,755 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#define TCPOUTFLAGS
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-#ifdef notyet
-extern struct mbuf *m_copypack();
-#endif
-
-
-/*
- * Tcp output routine: figure out what should be sent and send it.
- */
-int
-tcp_output(tp)
- register struct tcpcb *tp;
-{
- register struct socket *so = tp->t_inpcb->inp_socket;
- register long len, win;
- int off, flags, error;
- register struct mbuf *m;
- register struct tcpiphdr *ti;
- u_char opt[TCP_MAXOLEN];
- unsigned optlen, hdrlen;
- int idle, sendalot;
- struct rmxp_tao *taop;
- struct rmxp_tao tao_noncached;
-
- /*
- * Determine length of data that should be transmitted,
- * and flags that will be used.
- * If there is some data or critical controls (SYN, RST)
- * to send, then transmit; otherwise, investigate further.
- */
- idle = (tp->snd_max == tp->snd_una);
- if (idle && tp->t_idle >= tp->t_rxtcur)
- /*
- * We have been idle for "a while" and no acks are
- * expected to clock out any data we send --
- * slow start to get ack "clock" running again.
- */
- tp->snd_cwnd = tp->t_maxseg;
-again:
- sendalot = 0;
- off = tp->snd_nxt - tp->snd_una;
- win = min(tp->snd_wnd, tp->snd_cwnd);
-
- flags = tcp_outflags[tp->t_state];
- /*
- * Get standard flags, and add SYN or FIN if requested by 'hidden'
- * state flags.
- */
- if (tp->t_flags & TF_NEEDFIN)
- flags |= TH_FIN;
- if (tp->t_flags & TF_NEEDSYN)
- flags |= TH_SYN;
-
- /*
- * If in persist timeout with window of 0, send 1 byte.
- * Otherwise, if window is small but nonzero
- * and timer expired, we will send what we can
- * and go to transmit state.
- */
- if (tp->t_force) {
- if (win == 0) {
- /*
- * If we still have some data to send, then
- * clear the FIN bit. Usually this would
- * happen below when it realizes that we
- * aren't sending all the data. However,
- * if we have exactly 1 byte of unset data,
- * then it won't clear the FIN bit below,
- * and if we are in persist state, we wind
- * up sending the packet without recording
- * that we sent the FIN bit.
- *
- * We can't just blindly clear the FIN bit,
- * because if we don't have any more data
- * to send then the probe will be the FIN
- * itself.
- */
- if (off < so->so_snd.sb_cc)
- flags &= ~TH_FIN;
- win = 1;
- } else {
- tp->t_timer[TCPT_PERSIST] = 0;
- tp->t_rxtshift = 0;
- }
- }
-
- len = min(so->so_snd.sb_cc, win) - off;
-
- if ((taop = tcp_gettaocache(tp->t_inpcb)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
-
- /*
- * Lop off SYN bit if it has already been sent. However, if this
- * is SYN-SENT state and if segment contains data and if we don't
- * know that foreign host supports TAO, suppress sending segment.
- */
- if ((flags & TH_SYN) && SEQ_GT(tp->snd_nxt, tp->snd_una)) {
- flags &= ~TH_SYN;
- off--, len++;
- if (len > 0 && tp->t_state == TCPS_SYN_SENT &&
- taop->tao_ccsent == 0)
- return 0;
- }
-
- /*
- * Be careful not to send data and/or FIN on SYN segments
- * in cases when no CC option will be sent.
- * This measure is needed to prevent interoperability problems
- * with not fully conformant TCP implementations.
- */
- if ((flags & TH_SYN) &&
- ((tp->t_flags & TF_NOOPT) || !(tp->t_flags & TF_REQ_CC) ||
- ((flags & TH_ACK) && !(tp->t_flags & TF_RCVD_CC)))) {
- len = 0;
- flags &= ~TH_FIN;
- }
-
- if (len < 0) {
- /*
- * If FIN has been sent but not acked,
- * but we haven't been called to retransmit,
- * len will be -1. Otherwise, window shrank
- * after we sent into it. If window shrank to 0,
- * cancel pending retransmit, pull snd_nxt back
- * to (closed) window, and set the persist timer
- * if it isn't already going. If the window didn't
- * close completely, just wait for an ACK.
- */
- len = 0;
- if (win == 0) {
- tp->t_timer[TCPT_REXMT] = 0;
- tp->t_rxtshift = 0;
- tp->snd_nxt = tp->snd_una;
- if (tp->t_timer[TCPT_PERSIST] == 0)
- tcp_setpersist(tp);
- }
- }
- if (len > tp->t_maxseg) {
- len = tp->t_maxseg;
- sendalot = 1;
- }
- if (SEQ_LT(tp->snd_nxt + len, tp->snd_una + so->so_snd.sb_cc))
- flags &= ~TH_FIN;
-
- win = sbspace(&so->so_rcv);
-
- /*
- * Sender silly window avoidance. If connection is idle
- * and can send all data, a maximum segment,
- * at least a maximum default-size segment do it,
- * or are forced, do it; otherwise don't bother.
- * If peer's buffer is tiny, then send
- * when window is at least half open.
- * If retransmitting (possibly after persist timer forced us
- * to send into a small window), then must resend.
- */
- if (len) {
- if (len == tp->t_maxseg)
- goto send;
- if ((idle || tp->t_flags & TF_NODELAY) &&
- (tp->t_flags & TF_NOPUSH) == 0 &&
- len + off >= so->so_snd.sb_cc)
- goto send;
- if (tp->t_force)
- goto send;
- if (len >= tp->max_sndwnd / 2 && tp->max_sndwnd > 0)
- goto send;
- if (SEQ_LT(tp->snd_nxt, tp->snd_max))
- goto send;
- }
-
- /*
- * Compare available window to amount of window
- * known to peer (as advertised window less
- * next expected input). If the difference is at least two
- * max size segments, or at least 50% of the maximum possible
- * window, then want to send a window update to peer.
- */
- if (win > 0) {
- /*
- * "adv" is the amount we can increase the window,
- * taking into account that we are limited by
- * TCP_MAXWIN << tp->rcv_scale.
- */
- long adv = min(win, (long)TCP_MAXWIN << tp->rcv_scale) -
- (tp->rcv_adv - tp->rcv_nxt);
-
- if (adv >= (long) (2 * tp->t_maxseg))
- goto send;
- if (2 * adv >= (long) so->so_rcv.sb_hiwat)
- goto send;
- }
-
- /*
- * Send if we owe peer an ACK.
- */
- if (tp->t_flags & TF_ACKNOW)
- goto send;
- if ((flags & TH_RST) ||
- ((flags & TH_SYN) && (tp->t_flags & TF_NEEDSYN) == 0))
- goto send;
- if (SEQ_GT(tp->snd_up, tp->snd_una))
- goto send;
- /*
- * If our state indicates that FIN should be sent
- * and we have not yet done so, or we're retransmitting the FIN,
- * then we need to send.
- */
- if (flags & TH_FIN &&
- ((tp->t_flags & TF_SENTFIN) == 0 || tp->snd_nxt == tp->snd_una))
- goto send;
-
- /*
- * TCP window updates are not reliable, rather a polling protocol
- * using ``persist'' packets is used to insure receipt of window
- * updates. The three ``states'' for the output side are:
- * idle not doing retransmits or persists
- * persisting to move a small or zero window
- * (re)transmitting and thereby not persisting
- *
- * tp->t_timer[TCPT_PERSIST]
- * is set when we are in persist state.
- * tp->t_force
- * is set when we are called to send a persist packet.
- * tp->t_timer[TCPT_REXMT]
- * is set when we are retransmitting
- * The output side is idle when both timers are zero.
- *
- * If send window is too small, there is data to transmit, and no
- * retransmit or persist is pending, then go to persist state.
- * If nothing happens soon, send when timer expires:
- * if window is nonzero, transmit what we can,
- * otherwise force out a byte.
- */
- if (so->so_snd.sb_cc && tp->t_timer[TCPT_REXMT] == 0 &&
- tp->t_timer[TCPT_PERSIST] == 0) {
- tp->t_rxtshift = 0;
- tcp_setpersist(tp);
- }
-
- /*
- * No reason to send a segment, just return.
- */
- return (0);
-
-send:
- /*
- * Before ESTABLISHED, force sending of initial options
- * unless TCP set not to do any options.
- * NOTE: we assume that the IP/TCP header plus TCP options
- * always fit in a single mbuf, leaving room for a maximum
- * link header, i.e.
- * max_linkhdr + sizeof (struct tcpiphdr) + optlen <= MHLEN
- */
- optlen = 0;
- hdrlen = sizeof (struct tcpiphdr);
- if (flags & TH_SYN) {
- tp->snd_nxt = tp->iss;
- if ((tp->t_flags & TF_NOOPT) == 0) {
- u_short mss;
-
- opt[0] = TCPOPT_MAXSEG;
- opt[1] = TCPOLEN_MAXSEG;
- mss = htons((u_short) tcp_mssopt(tp));
- (void)memcpy(opt + 2, &mss, sizeof(mss));
- optlen = TCPOLEN_MAXSEG;
-
- if ((tp->t_flags & TF_REQ_SCALE) &&
- ((flags & TH_ACK) == 0 ||
- (tp->t_flags & TF_RCVD_SCALE))) {
- *((u_long *) (opt + optlen)) = htonl(
- TCPOPT_NOP << 24 |
- TCPOPT_WINDOW << 16 |
- TCPOLEN_WINDOW << 8 |
- tp->request_r_scale);
- optlen += 4;
- }
- }
- }
-
- /*
- * Send a timestamp and echo-reply if this is a SYN and our side
- * wants to use timestamps (TF_REQ_TSTMP is set) or both our side
- * and our peer have sent timestamps in our SYN's.
- */
- if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP &&
- (flags & TH_RST) == 0 &&
- ((flags & TH_ACK) == 0 ||
- (tp->t_flags & TF_RCVD_TSTMP))) {
- u_long *lp = (u_long *)(opt + optlen);
-
- /* Form timestamp option as shown in appendix A of RFC 1323. */
- *lp++ = htonl(TCPOPT_TSTAMP_HDR);
- *lp++ = htonl(tcp_now);
- *lp = htonl(tp->ts_recent);
- optlen += TCPOLEN_TSTAMP_APPA;
- }
-
- /*
- * Send `CC-family' options if our side wants to use them (TF_REQ_CC),
- * options are allowed (!TF_NOOPT) and it's not a RST.
- */
- if ((tp->t_flags & (TF_REQ_CC|TF_NOOPT)) == TF_REQ_CC &&
- (flags & TH_RST) == 0) {
- switch (flags & (TH_SYN|TH_ACK)) {
- /*
- * This is a normal ACK, send CC if we received CC before
- * from our peer.
- */
- case TH_ACK:
- if (!(tp->t_flags & TF_RCVD_CC))
- break;
- /*FALLTHROUGH*/
-
- /*
- * We can only get here in T/TCP's SYN_SENT* state, when
- * we're a sending a non-SYN segment without waiting for
- * the ACK of our SYN. A check above assures that we only
- * do this if our peer understands T/TCP.
- */
- case 0:
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_CC;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] = htonl(tp->cc_send);
-
- optlen += 4;
- break;
-
- /*
- * This is our initial SYN, check whether we have to use
- * CC or CC.new.
- */
- case TH_SYN:
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = tp->t_flags & TF_SENDCCNEW ?
- TCPOPT_CCNEW : TCPOPT_CC;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] = htonl(tp->cc_send);
- optlen += 4;
- break;
-
- /*
- * This is a SYN,ACK; send CC and CC.echo if we received
- * CC from our peer.
- */
- case (TH_SYN|TH_ACK):
- if (tp->t_flags & TF_RCVD_CC) {
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_CC;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] =
- htonl(tp->cc_send);
- optlen += 4;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_CCECHO;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] =
- htonl(tp->cc_recv);
- optlen += 4;
- }
- break;
- }
- }
-
- hdrlen += optlen;
-
- /*
- * Adjust data length if insertion of options will
- * bump the packet length beyond the t_maxopd length.
- * Clear the FIN bit because we cut off the tail of
- * the segment.
- */
- if (len + optlen > tp->t_maxopd) {
- /*
- * If there is still more to send, don't close the connection.
- */
- flags &= ~TH_FIN;
- len = tp->t_maxopd - optlen;
- sendalot = 1;
- }
-
-/*#ifdef DIAGNOSTIC*/
- if (max_linkhdr + hdrlen > MHLEN)
- panic("tcphdr too big");
-/*#endif*/
-
- /*
- * Grab a header mbuf, attaching a copy of data to
- * be transmitted, and initialize the header from
- * the template for sends on this connection.
- */
- if (len) {
- if (tp->t_force && len == 1)
- tcpstat.tcps_sndprobe++;
- else if (SEQ_LT(tp->snd_nxt, tp->snd_max)) {
- tcpstat.tcps_sndrexmitpack++;
- tcpstat.tcps_sndrexmitbyte += len;
- } else {
- tcpstat.tcps_sndpack++;
- tcpstat.tcps_sndbyte += len;
- }
-#ifdef notyet
- if ((m = m_copypack(so->so_snd.sb_mb, off,
- (int)len, max_linkhdr + hdrlen)) == 0) {
- error = ENOBUFS;
- goto out;
- }
- /*
- * m_copypack left space for our hdr; use it.
- */
- m->m_len += hdrlen;
- m->m_data -= hdrlen;
-#else
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- }
- m->m_data += max_linkhdr;
- m->m_len = hdrlen;
- if (len <= MHLEN - hdrlen - max_linkhdr) {
- m_copydata(so->so_snd.sb_mb, off, (int) len,
- mtod(m, caddr_t) + hdrlen);
- m->m_len += len;
- } else {
- m->m_next = m_copy(so->so_snd.sb_mb, off, (int) len);
- if (m->m_next == 0) {
- (void) m_free(m);
- error = ENOBUFS;
- goto out;
- }
- }
-#endif
- /*
- * If we're sending everything we've got, set PUSH.
- * (This will keep happy those implementations which only
- * give data to the user when a buffer fills or
- * a PUSH comes in.)
- */
- if (off + len == so->so_snd.sb_cc)
- flags |= TH_PUSH;
- } else {
- if (tp->t_flags & TF_ACKNOW)
- tcpstat.tcps_sndacks++;
- else if (flags & (TH_SYN|TH_FIN|TH_RST))
- tcpstat.tcps_sndctrl++;
- else if (SEQ_GT(tp->snd_up, tp->snd_una))
- tcpstat.tcps_sndurg++;
- else
- tcpstat.tcps_sndwinup++;
-
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- }
- m->m_data += max_linkhdr;
- m->m_len = hdrlen;
- }
- m->m_pkthdr.rcvif = (struct ifnet *)0;
- ti = mtod(m, struct tcpiphdr *);
- if (tp->t_template == 0)
- panic("tcp_output");
- (void)memcpy(ti, tp->t_template, sizeof (struct tcpiphdr));
-
- /*
- * Fill in fields, remembering maximum advertised
- * window for use in delaying messages about window sizes.
- * If resending a FIN, be sure not to use a new sequence number.
- */
- if (flags & TH_FIN && tp->t_flags & TF_SENTFIN &&
- tp->snd_nxt == tp->snd_max)
- tp->snd_nxt--;
- /*
- * If we are doing retransmissions, then snd_nxt will
- * not reflect the first unsent octet. For ACK only
- * packets, we do not want the sequence number of the
- * retransmitted packet, we want the sequence number
- * of the next unsent octet. So, if there is no data
- * (and no SYN or FIN), use snd_max instead of snd_nxt
- * when filling in ti_seq. But if we are in persist
- * state, snd_max might reflect one byte beyond the
- * right edge of the window, so use snd_nxt in that
- * case, since we know we aren't doing a retransmission.
- * (retransmit and persist are mutually exclusive...)
- */
- if (len || (flags & (TH_SYN|TH_FIN)) || tp->t_timer[TCPT_PERSIST])
- ti->ti_seq = htonl(tp->snd_nxt);
- else
- ti->ti_seq = htonl(tp->snd_max);
- ti->ti_ack = htonl(tp->rcv_nxt);
- if (optlen) {
- bcopy(opt, ti + 1, optlen);
- ti->ti_off = (sizeof (struct tcphdr) + optlen) >> 2;
- }
- ti->ti_flags = flags;
- /*
- * Calculate receive window. Don't shrink window,
- * but avoid silly window syndrome.
- */
- if (win < (long)(so->so_rcv.sb_hiwat / 4) && win < (long)tp->t_maxseg)
- win = 0;
- if (win < (long)(tp->rcv_adv - tp->rcv_nxt))
- win = (long)(tp->rcv_adv - tp->rcv_nxt);
- if (win > (long)TCP_MAXWIN << tp->rcv_scale)
- win = (long)TCP_MAXWIN << tp->rcv_scale;
- ti->ti_win = htons((u_short) (win>>tp->rcv_scale));
- if (SEQ_GT(tp->snd_up, tp->snd_nxt)) {
- ti->ti_urp = htons((u_short)(tp->snd_up - tp->snd_nxt));
- ti->ti_flags |= TH_URG;
- } else
- /*
- * If no urgent pointer to send, then we pull
- * the urgent pointer to the left edge of the send window
- * so that it doesn't drift into the send window on sequence
- * number wraparound.
- */
- tp->snd_up = tp->snd_una; /* drag it along */
-
- /*
- * Put TCP length in extended header, and then
- * checksum extended header and data.
- */
- if (len + optlen)
- ti->ti_len = htons((u_short)(sizeof (struct tcphdr) +
- optlen + len));
- ti->ti_sum = in_cksum(m, (int)(hdrlen + len));
-
- /*
- * In transmit state, time the transmission and arrange for
- * the retransmit. In persist state, just set snd_max.
- */
- if (tp->t_force == 0 || tp->t_timer[TCPT_PERSIST] == 0) {
- tcp_seq startseq = tp->snd_nxt;
-
- /*
- * Advance snd_nxt over sequence space of this segment.
- */
- if (flags & (TH_SYN|TH_FIN)) {
- if (flags & TH_SYN)
- tp->snd_nxt++;
- if (flags & TH_FIN) {
- tp->snd_nxt++;
- tp->t_flags |= TF_SENTFIN;
- }
- }
- tp->snd_nxt += len;
- if (SEQ_GT(tp->snd_nxt, tp->snd_max)) {
- tp->snd_max = tp->snd_nxt;
- /*
- * Time this transmission if not a retransmission and
- * not currently timing anything.
- */
- if (tp->t_rtt == 0) {
- tp->t_rtt = 1;
- tp->t_rtseq = startseq;
- tcpstat.tcps_segstimed++;
- }
- }
-
- /*
- * Set retransmit timer if not currently set,
- * and not doing an ack or a keep-alive probe.
- * Initial value for retransmit timer is smoothed
- * round-trip time + 2 * round-trip time variance.
- * Initialize shift counter which is used for backoff
- * of retransmit time.
- */
- if (tp->t_timer[TCPT_REXMT] == 0 &&
- tp->snd_nxt != tp->snd_una) {
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
- if (tp->t_timer[TCPT_PERSIST]) {
- tp->t_timer[TCPT_PERSIST] = 0;
- tp->t_rxtshift = 0;
- }
- }
- } else
- if (SEQ_GT(tp->snd_nxt + len, tp->snd_max))
- tp->snd_max = tp->snd_nxt + len;
-
-#ifdef TCPDEBUG
- /*
- * Trace.
- */
- if (so->so_options & SO_DEBUG)
- tcp_trace(TA_OUTPUT, tp->t_state, tp, ti, 0);
-#endif
-
- /*
- * Fill in IP length and desired time to live and
- * send to IP level. There should be a better way
- * to handle ttl and tos; we could keep them in
- * the template, but need a way to checksum without them.
- */
- m->m_pkthdr.len = hdrlen + len;
-#ifdef TUBA
- if (tp->t_tuba_pcb)
- error = tuba_output(m, tp);
- else
-#endif
- {
-#if 1
- struct rtentry *rt;
-#endif
- ((struct ip *)ti)->ip_len = m->m_pkthdr.len;
- ((struct ip *)ti)->ip_ttl = tp->t_inpcb->inp_ip_ttl; /* XXX */
- ((struct ip *)ti)->ip_tos = tp->t_inpcb->inp_ip_tos; /* XXX */
-#if 1
- /*
- * See if we should do MTU discovery. We do it only if the following
- * are true:
- * 1) we have a valid route to the destination
- * 2) the MTU is not locked (if it is, then discovery has been
- * disabled)
- */
- if ((rt = tp->t_inpcb->inp_route.ro_rt)
- && rt->rt_flags & RTF_UP
- && !(rt->rt_rmx.rmx_locks & RTV_MTU)) {
- ((struct ip *)ti)->ip_off |= IP_DF;
- }
-#endif
- error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route,
- so->so_options & SO_DONTROUTE, 0);
- }
- if (error) {
-out:
- if (error == ENOBUFS) {
- tcp_quench(tp->t_inpcb, 0);
- return (0);
- }
-#if 1
- if (error == EMSGSIZE) {
- /*
- * ip_output() will have already fixed the route
- * for us. tcp_mtudisc() will, as its last action,
- * initiate retransmission, so it is important to
- * not do so here.
- */
- tcp_mtudisc(tp->t_inpcb, 0);
- return 0;
- }
-#endif
- if ((error == EHOSTUNREACH || error == ENETDOWN)
- && TCPS_HAVERCVDSYN(tp->t_state)) {
- tp->t_softerror = error;
- return (0);
- }
- return (error);
- }
- tcpstat.tcps_sndtotal++;
-
- /*
- * Data sent (as far as we can tell).
- * If this advertises a larger window than any other segment,
- * then remember the size of the advertised window.
- * Any pending ACK has now been sent.
- */
- if (win > 0 && SEQ_GT(tp->rcv_nxt+win, tp->rcv_adv))
- tp->rcv_adv = tp->rcv_nxt + win;
- tp->last_ack_sent = tp->rcv_nxt;
- tp->t_flags &= ~(TF_ACKNOW|TF_DELACK);
- if (sendalot)
- goto again;
- return (0);
-}
-
-void
-tcp_setpersist(tp)
- register struct tcpcb *tp;
-{
- register int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1;
-
- if (tp->t_timer[TCPT_REXMT])
- panic("tcp_output REXMT");
- /*
- * Start/restart persistance timer.
- */
- TCPT_RANGESET(tp->t_timer[TCPT_PERSIST],
- t * tcp_backoff[tp->t_rxtshift],
- TCPTV_PERSMIN, TCPTV_PERSMAX);
- if (tp->t_rxtshift < TCP_MAXRXTSHIFT)
- tp->t_rxtshift++;
-}
diff --git a/c/src/lib/libnetworking/netinet/tcp_seq.h b/c/src/lib/libnetworking/netinet/tcp_seq.h
deleted file mode 100644
index 8cccf199e1..0000000000
--- a/c/src/lib/libnetworking/netinet/tcp_seq.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993, 1995
- * 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.
- *
- * @(#)tcp_seq.h 8.3 (Berkeley) 6/21/95
- * $Id$
- */
-
-#ifndef _NETINET_TCP_SEQ_H_
-#define _NETINET_TCP_SEQ_H_
-/*
- * TCP sequence numbers are 32 bit integers operated
- * on with modular arithmetic. These macros can be
- * used to compare such integers.
- */
-#define SEQ_LT(a,b) ((int)((a)-(b)) < 0)
-#define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0)
-#define SEQ_GT(a,b) ((int)((a)-(b)) > 0)
-#define SEQ_GEQ(a,b) ((int)((a)-(b)) >= 0)
-
-/* for modulo comparisons of timestamps */
-#define TSTMP_LT(a,b) ((int)((a)-(b)) < 0)
-#define TSTMP_GEQ(a,b) ((int)((a)-(b)) >= 0)
-
-/*
- * TCP connection counts are 32 bit integers operated
- * on with modular arithmetic. These macros can be
- * used to compare such integers.
- */
-#define CC_LT(a,b) ((int)((a)-(b)) < 0)
-#define CC_LEQ(a,b) ((int)((a)-(b)) <= 0)
-#define CC_GT(a,b) ((int)((a)-(b)) > 0)
-#define CC_GEQ(a,b) ((int)((a)-(b)) >= 0)
-
-/* Macro to increment a CC: skip 0 which has a special meaning */
-#define CC_INC(c) (++(c) == 0 ? ++(c) : (c))
-
-/*
- * Macros to initialize tcp sequence numbers for
- * send and receive from initial send and receive
- * sequence numbers.
- */
-#define tcp_rcvseqinit(tp) \
- (tp)->rcv_adv = (tp)->rcv_nxt = (tp)->irs + 1
-
-#define tcp_sendseqinit(tp) \
- (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \
- (tp)->iss
-
-#define TCP_PAWS_IDLE (24 * 24 * 60 * 60 * PR_SLOWHZ)
- /* timestamp wrap-around time */
-
-#ifdef KERNEL
-extern tcp_cc tcp_ccgen; /* global connection count */
-
-/*
- * Increment for tcp_iss each second.
- * This is designed to increment at the standard 250 KB/s,
- * but with a random component averaging 128 KB.
- * We also increment tcp_iss by a quarter of this amount
- * each time we use the value for a new connection.
- * If defined, the tcp_random18() macro should produce a
- * number in the range [0-0x3ffff] that is hard to predict.
- */
-#ifndef tcp_random18
-#define tcp_random18() ((random() >> 14) & 0x3ffff)
-#endif
-#define TCP_ISSINCR (122*1024 + tcp_random18())
-
-extern tcp_seq tcp_iss; /* tcp initial send seq # */
-#else
-#define TCP_ISSINCR (250*1024) /* increment for tcp_iss each second */
-#endif /* KERNEL */
-#endif /* _NETINET_TCP_SEQ_H_ */
diff --git a/c/src/lib/libnetworking/netinet/tcp_subr.c b/c/src/lib/libnetworking/netinet/tcp_subr.c
deleted file mode 100644
index a9cde3fdf0..0000000000
--- a/c/src/lib/libnetworking/netinet/tcp_subr.c
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/proc.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <net/route.h>
-#include <net/if.h>
-
-#define _IP_VHL
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-int tcp_mssdflt = TCP_MSS;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt,
- CTLFLAG_RW, &tcp_mssdflt , 0, "");
-
-static int tcp_do_rfc1323 = 1;
-static int tcp_do_rfc1644 = 1;
-#if !defined(__rtems__)
-static int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_RTTDFLT, rttdflt,
- CTLFLAG_RW, &tcp_rttdflt , 0, "");
-
-SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323,
- CTLFLAG_RW, &tcp_do_rfc1323 , 0, "");
-
-SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1644, rfc1644,
- CTLFLAG_RW, &tcp_do_rfc1644 , 0, "");
-#endif
-
-static void tcp_cleartaocache(void);
-static void tcp_notify __P((struct inpcb *, int));
-
-/*
- * Target size of TCP PCB hash table. Will be rounded down to a prime
- * number.
- */
-#ifndef TCBHASHSIZE
-#define TCBHASHSIZE 128
-#endif
-
-/*
- * Tcp initialization
- */
-void
-tcp_init()
-{
-
- tcp_iss = random(); /* wrong, but better than a constant */
- tcp_ccgen = 1;
- tcp_cleartaocache();
- LIST_INIT(&tcb);
- tcbinfo.listhead = &tcb;
- tcbinfo.hashbase = hashinit(TCBHASHSIZE, M_PCB, &tcbinfo.hashmask);
- if (max_protohdr < sizeof(struct tcpiphdr))
- max_protohdr = sizeof(struct tcpiphdr);
- if (max_linkhdr + sizeof(struct tcpiphdr) > MHLEN)
- panic("tcp_init");
-}
-
-/*
- * Create template to be used to send tcp packets on a connection.
- * Call after host entry created, allocates an mbuf and fills
- * in a skeletal tcp/ip header, minimizing the amount of work
- * necessary when the connection is used.
- */
-struct tcpiphdr *
-tcp_template(tp)
- struct tcpcb *tp;
-{
- register struct inpcb *inp = tp->t_inpcb;
- register struct mbuf *m;
- register struct tcpiphdr *n;
-
- if ((n = tp->t_template) == 0) {
- m = m_get(M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- return (0);
- m->m_len = sizeof (struct tcpiphdr);
- n = mtod(m, struct tcpiphdr *);
- }
- n->ti_next = n->ti_prev = 0;
- n->ti_x1 = 0;
- n->ti_pr = IPPROTO_TCP;
- n->ti_len = htons(sizeof (struct tcpiphdr) - sizeof (struct ip));
- n->ti_src = inp->inp_laddr;
- n->ti_dst = inp->inp_faddr;
- n->ti_sport = inp->inp_lport;
- n->ti_dport = inp->inp_fport;
- n->ti_seq = 0;
- n->ti_ack = 0;
- n->ti_x2 = 0;
- n->ti_off = 5;
- n->ti_flags = 0;
- n->ti_win = 0;
- n->ti_sum = 0;
- n->ti_urp = 0;
- return (n);
-}
-
-/*
- * Send a single message to the TCP at address specified by
- * the given TCP/IP header. If m == 0, then we make a copy
- * of the tcpiphdr at ti and send directly to the addressed host.
- * This is used to force keep alive messages out using the TCP
- * template for a connection tp->t_template. If flags are given
- * then we send a message back to the TCP which originated the
- * segment ti, and discard the mbuf containing it and any other
- * attached mbufs.
- *
- * In any case the ack and sequence number of the transmitted
- * segment are as specified by the parameters.
- *
- * NOTE: If m != NULL, then ti must point to *inside* the mbuf.
- */
-void
-tcp_respond(tp, ti, m, ack, seq, flags)
- struct tcpcb *tp;
- register struct tcpiphdr *ti;
- register struct mbuf *m;
- tcp_seq ack, seq;
- int flags;
-{
- register int tlen;
- int win = 0;
- struct route *ro = 0;
- struct route sro;
-
- if (tp) {
- win = sbspace(&tp->t_inpcb->inp_socket->so_rcv);
- ro = &tp->t_inpcb->inp_route;
- } else {
- ro = &sro;
- bzero(ro, sizeof *ro);
- }
- if (m == 0) {
- m = m_gethdr(M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- return;
-#ifdef TCP_COMPAT_42
- tlen = 1;
-#else
- tlen = 0;
-#endif
- m->m_data += max_linkhdr;
- *mtod(m, struct tcpiphdr *) = *ti;
- ti = mtod(m, struct tcpiphdr *);
- flags = TH_ACK;
- } else {
- m_freem(m->m_next);
- m->m_next = 0;
- m->m_data = (caddr_t)ti;
- m->m_len = sizeof (struct tcpiphdr);
- tlen = 0;
-#define xchg(a,b,type) { type t; t=a; a=b; b=t; }
- xchg(ti->ti_dst.s_addr, ti->ti_src.s_addr, u_long);
- xchg(ti->ti_dport, ti->ti_sport, u_short);
-#undef xchg
- }
- ti->ti_len = htons((u_short)(sizeof (struct tcphdr) + tlen));
- tlen += sizeof (struct tcpiphdr);
- m->m_len = tlen;
- m->m_pkthdr.len = tlen;
- m->m_pkthdr.rcvif = (struct ifnet *) 0;
- ti->ti_next = ti->ti_prev = 0;
- ti->ti_x1 = 0;
- ti->ti_seq = htonl(seq);
- ti->ti_ack = htonl(ack);
- ti->ti_x2 = 0;
- ti->ti_off = sizeof (struct tcphdr) >> 2;
- ti->ti_flags = flags;
- if (tp)
- ti->ti_win = htons((u_short) (win >> tp->rcv_scale));
- else
- ti->ti_win = htons((u_short)win);
- ti->ti_urp = 0;
- ti->ti_sum = 0;
- ti->ti_sum = in_cksum(m, tlen);
- ((struct ip *)ti)->ip_len = tlen;
- ((struct ip *)ti)->ip_ttl = ip_defttl;
-#ifdef TCPDEBUG
- if (tp == NULL || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
- tcp_trace(TA_OUTPUT, 0, tp, ti, 0);
-#endif
- (void) ip_output(m, NULL, ro, 0, NULL);
- if (ro == &sro && ro->ro_rt) {
- RTFREE(ro->ro_rt);
- }
-}
-
-/*
- * Create a new TCP control block, making an
- * empty reassembly queue and hooking it to the argument
- * protocol control block.
- */
-struct tcpcb *
-tcp_newtcpcb(inp)
- struct inpcb *inp;
-{
- register struct tcpcb *tp;
-
- tp = malloc(sizeof(*tp), M_PCB, M_NOWAIT);
- if (tp == NULL)
- return ((struct tcpcb *)0);
- bzero((char *) tp, sizeof(struct tcpcb));
- tp->seg_next = tp->seg_prev = (struct tcpiphdr *)tp;
- tp->t_maxseg = tp->t_maxopd = tcp_mssdflt;
-
- if (tcp_do_rfc1323)
- tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP);
- if (tcp_do_rfc1644)
- tp->t_flags |= TF_REQ_CC;
- tp->t_inpcb = inp;
- /*
- * Init srtt to TCPTV_SRTTBASE (0), so we can tell that we have no
- * rtt estimate. Set rttvar so that srtt + 4 * rttvar gives
- * reasonable initial retransmit time.
- */
- tp->t_srtt = TCPTV_SRTTBASE;
- tp->t_rttvar = ((TCPTV_RTOBASE - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4;
- tp->t_rttmin = TCPTV_MIN;
- tp->t_rxtcur = TCPTV_RTOBASE;
- tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT;
- tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT;
- inp->inp_ip_ttl = ip_defttl;
- inp->inp_ppcb = (caddr_t)tp;
- return (tp);
-}
-
-/*
- * Drop a TCP connection, reporting
- * the specified error. If connection is synchronized,
- * then send a RST to peer.
- */
-struct tcpcb *
-tcp_drop(tp, errnum)
- register struct tcpcb *tp;
- int errnum;
-{
- struct socket *so = tp->t_inpcb->inp_socket;
-
- if (TCPS_HAVERCVDSYN(tp->t_state)) {
- tp->t_state = TCPS_CLOSED;
- (void) tcp_output(tp);
- tcpstat.tcps_drops++;
- } else
- tcpstat.tcps_conndrops++;
- if (errnum == ETIMEDOUT && tp->t_softerror)
- errnum = tp->t_softerror;
- so->so_error = errnum;
- return (tcp_close(tp));
-}
-
-/*
- * Close a TCP control block:
- * discard all space held by the tcp
- * discard internet protocol block
- * wake up any sleepers
- */
-struct tcpcb *
-tcp_close(tp)
- register struct tcpcb *tp;
-{
- register struct tcpiphdr *t;
- struct inpcb *inp = tp->t_inpcb;
- struct socket *so = inp->inp_socket;
- register struct mbuf *m;
- register struct rtentry *rt;
-
- /*
- * If we got enough samples through the srtt filter,
- * save the rtt and rttvar in the routing entry.
- * 'Enough' is arbitrarily defined as the 16 samples.
- * 16 samples is enough for the srtt filter to converge
- * to within 5% of the correct value; fewer samples and
- * we could save a very bogus rtt.
- *
- * Don't update the default route's characteristics and don't
- * update anything that the user "locked".
- */
- if (tp->t_rttupdated >= 16 &&
- (rt = inp->inp_route.ro_rt) &&
- ((struct sockaddr_in *)rt_key(rt))->sin_addr.s_addr != INADDR_ANY) {
- register u_long i = 0;
-
- if ((rt->rt_rmx.rmx_locks & RTV_RTT) == 0) {
- i = tp->t_srtt *
- (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTT_SCALE));
- if (rt->rt_rmx.rmx_rtt && i)
- /*
- * filter this update to half the old & half
- * the new values, converting scale.
- * See route.h and tcp_var.h for a
- * description of the scaling constants.
- */
- rt->rt_rmx.rmx_rtt =
- (rt->rt_rmx.rmx_rtt + i) / 2;
- else
- rt->rt_rmx.rmx_rtt = i;
- tcpstat.tcps_cachedrtt++;
- }
- if ((rt->rt_rmx.rmx_locks & RTV_RTTVAR) == 0) {
- i = tp->t_rttvar *
- (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTTVAR_SCALE));
- if (rt->rt_rmx.rmx_rttvar && i)
- rt->rt_rmx.rmx_rttvar =
- (rt->rt_rmx.rmx_rttvar + i) / 2;
- else
- rt->rt_rmx.rmx_rttvar = i;
- tcpstat.tcps_cachedrttvar++;
- }
- /*
- * update the pipelimit (ssthresh) if it has been updated
- * already or if a pipesize was specified & the threshhold
- * got below half the pipesize. I.e., wait for bad news
- * before we start updating, then update on both good
- * and bad news.
- */
- if (((rt->rt_rmx.rmx_locks & RTV_SSTHRESH) == 0 &&
- ((i = tp->snd_ssthresh) != 0) && rt->rt_rmx.rmx_ssthresh) ||
- i < (rt->rt_rmx.rmx_sendpipe / 2)) {
- /*
- * convert the limit from user data bytes to
- * packets then to packet data bytes.
- */
- i = (i + tp->t_maxseg / 2) / tp->t_maxseg;
- if (i < 2)
- i = 2;
- i *= (u_long)(tp->t_maxseg + sizeof (struct tcpiphdr));
- if (rt->rt_rmx.rmx_ssthresh)
- rt->rt_rmx.rmx_ssthresh =
- (rt->rt_rmx.rmx_ssthresh + i) / 2;
- else
- rt->rt_rmx.rmx_ssthresh = i;
- tcpstat.tcps_cachedssthresh++;
- }
- }
- /* free the reassembly queue, if any */
- t = tp->seg_next;
- while (t != (struct tcpiphdr *)tp) {
- t = (struct tcpiphdr *)t->ti_next;
- m = REASS_MBUF((struct tcpiphdr *)t->ti_prev);
- remque(t->ti_prev);
- m_freem(m);
- }
- if (tp->t_template)
- (void) m_free(dtom(tp->t_template));
- free(tp, M_PCB);
- inp->inp_ppcb = 0;
- soisdisconnected(so);
- in_pcbdetach(inp);
- tcpstat.tcps_closed++;
- return ((struct tcpcb *)0);
-}
-
-void
-tcp_drain()
-{
-
-}
-
-/*
- * Notify a tcp user of an asynchronous error;
- * store error as soft error, but wake up user
- * (for now, won't do anything until can select for soft error).
- */
-static void
-tcp_notify(inp, error)
- struct inpcb *inp;
- int error;
-{
- register struct tcpcb *tp = (struct tcpcb *)inp->inp_ppcb;
- register struct socket *so = inp->inp_socket;
-
- /*
- * Ignore some errors if we are hooked up.
- * If connection hasn't completed, has retransmitted several times,
- * and receives a second error, give up now. This is better
- * than waiting a long time to establish a connection that
- * can never complete.
- */
- if (tp->t_state == TCPS_ESTABLISHED &&
- (error == EHOSTUNREACH || error == ENETUNREACH ||
- error == EHOSTDOWN)) {
- return;
- } else if (tp->t_state < TCPS_ESTABLISHED && tp->t_rxtshift > 3 &&
- tp->t_softerror)
- so->so_error = error;
- else
- tp->t_softerror = error;
- soconnwakeup (so);
- sorwakeup(so);
- sowwakeup(so);
-}
-
-void
-tcp_ctlinput(cmd, sa, vip)
- int cmd;
- struct sockaddr *sa;
- void *vip;
-{
- register struct ip *ip = vip;
- register struct tcphdr *th;
- void (*notify) __P((struct inpcb *, int)) = tcp_notify;
-
- if (cmd == PRC_QUENCH)
- notify = tcp_quench;
-#if 1
- else if (cmd == PRC_MSGSIZE)
- notify = tcp_mtudisc;
-#endif
- else if (!PRC_IS_REDIRECT(cmd) &&
- ((unsigned)cmd > PRC_NCMDS || inetctlerrmap[cmd] == 0))
- return;
- if (ip) {
- th = (struct tcphdr *)((caddr_t)ip
- + (IP_VHL_HL(ip->ip_vhl) << 2));
- in_pcbnotify(&tcb, sa, th->th_dport, ip->ip_src, th->th_sport,
- cmd, notify);
- } else
- in_pcbnotify(&tcb, sa, 0, zeroin_addr, 0, cmd, notify);
-}
-
-/*
- * When a source quench is received, close congestion window
- * to one segment. We will gradually open it again as we proceed.
- */
-void
-tcp_quench(inp, errnum)
- struct inpcb *inp;
- int errnum;
-{
- struct tcpcb *tp = intotcpcb(inp);
-
- if (tp)
- tp->snd_cwnd = tp->t_maxseg;
-}
-
-#if 1
-/*
- * When `need fragmentation' ICMP is received, update our idea of the MSS
- * based on the new value in the route. Also nudge TCP to send something,
- * since we know the packet we just sent was dropped.
- * This duplicates some code in the tcp_mss() function in tcp_input.c.
- */
-void
-tcp_mtudisc(inp, errnum)
- struct inpcb *inp;
- int errnum;
-{
- struct tcpcb *tp = intotcpcb(inp);
- struct rtentry *rt;
- struct rmxp_tao *taop;
- struct socket *so = inp->inp_socket;
- int offered;
- int mss;
-
- if (tp) {
- rt = tcp_rtlookup(inp);
- if (!rt || !rt->rt_rmx.rmx_mtu) {
- tp->t_maxopd = tp->t_maxseg = tcp_mssdflt;
- return;
- }
- taop = rmx_taop(rt->rt_rmx);
- offered = taop->tao_mssopt;
- mss = rt->rt_rmx.rmx_mtu - sizeof(struct tcpiphdr);
- if (offered)
- mss = min(mss, offered);
- /*
- * XXX - The above conditional probably violates the TCP
- * spec. The problem is that, since we don't know the
- * other end's MSS, we are supposed to use a conservative
- * default. But, if we do that, then MTU discovery will
- * never actually take place, because the conservative
- * default is much less than the MTUs typically seen
- * on the Internet today. For the moment, we'll sweep
- * this under the carpet.
- *
- * The conservative default might not actually be a problem
- * if the only case this occurs is when sending an initial
- * SYN with options and data to a host we've never talked
- * to before. Then, they will reply with an MSS value which
- * will get recorded and the new parameters should get
- * recomputed. For Further Study.
- */
- if (tp->t_maxopd <= mss)
- return;
- tp->t_maxopd = mss;
-
- if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP &&
- (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP)
- mss -= TCPOLEN_TSTAMP_APPA;
- if ((tp->t_flags & (TF_REQ_CC|TF_NOOPT)) == TF_REQ_CC &&
- (tp->t_flags & TF_RCVD_CC) == TF_RCVD_CC)
- mss -= TCPOLEN_CC_APPA;
-#if (MCLBYTES & (MCLBYTES - 1)) == 0
- if (mss > MCLBYTES)
- mss &= ~(MCLBYTES-1);
-#else
- if (mss > MCLBYTES)
- mss = mss / MCLBYTES * MCLBYTES;
-#endif
- if (so->so_snd.sb_hiwat < mss)
- mss = so->so_snd.sb_hiwat;
-
- tp->t_maxseg = mss;
-
- tcpstat.tcps_mturesent++;
- tp->t_rtt = 0;
- tp->snd_nxt = tp->snd_una;
- tcp_output(tp);
- }
-}
-#endif
-
-/*
- * Look-up the routing entry to the peer of this inpcb. If no route
- * is found and it cannot be allocated the return NULL. This routine
- * is called by TCP routines that access the rmx structure and by tcp_mss
- * to get the interface MTU.
- */
-struct rtentry *
-tcp_rtlookup(inp)
- struct inpcb *inp;
-{
- struct route *ro;
- struct rtentry *rt;
-
- ro = &inp->inp_route;
- rt = ro->ro_rt;
- if (rt == NULL || !(rt->rt_flags & RTF_UP)) {
- /* No route yet, so try to acquire one */
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- ro->ro_dst.sa_family = AF_INET;
- ro->ro_dst.sa_len = sizeof(ro->ro_dst);
- ((struct sockaddr_in *) &ro->ro_dst)->sin_addr =
- inp->inp_faddr;
- rtalloc(ro);
- rt = ro->ro_rt;
- }
- }
- return rt;
-}
-
-/*
- * Return a pointer to the cached information about the remote host.
- * The cached information is stored in the protocol specific part of
- * the route metrics.
- */
-struct rmxp_tao *
-tcp_gettaocache(inp)
- struct inpcb *inp;
-{
- struct rtentry *rt = tcp_rtlookup(inp);
-
- /* Make sure this is a host route and is up. */
- if (rt == NULL ||
- (rt->rt_flags & (RTF_UP|RTF_HOST)) != (RTF_UP|RTF_HOST))
- return NULL;
-
- return rmx_taop(rt->rt_rmx);
-}
-
-/*
- * Clear all the TAO cache entries, called from tcp_init.
- *
- * XXX
- * This routine is just an empty one, because we assume that the routing
- * routing tables are initialized at the same time when TCP, so there is
- * nothing in the cache left over.
- */
-static void
-tcp_cleartaocache(void)
-{ }
diff --git a/c/src/lib/libnetworking/netinet/tcp_timer.c b/c/src/lib/libnetworking/netinet/tcp_timer.c
deleted file mode 100644
index 04d3d604e2..0000000000
--- a/c/src/lib/libnetworking/netinet/tcp_timer.c
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#ifndef TUBA_INCLUDE
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-int tcp_keepinit = TCPTV_KEEP_INIT;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit,
- CTLFLAG_RW, &tcp_keepinit , 0, "");
-
-int tcp_keepidle = TCPTV_KEEP_IDLE;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPIDLE, keepidle,
- CTLFLAG_RW, &tcp_keepidle , 0, "");
-
-static int tcp_keepintvl = TCPTV_KEEPINTVL;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPINTVL, keepintvl,
- CTLFLAG_RW, &tcp_keepintvl , 0, "");
-
-static int always_keepalive = 0;
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive,
- CTLFLAG_RW, &always_keepalive , 0, "");
-
-static int tcp_keepcnt = TCPTV_KEEPCNT;
- /* max idle probes */
-static int tcp_maxpersistidle = TCPTV_KEEP_IDLE;
- /* max idle time in persist */
-int tcp_maxidle;
-#else /* TUBA_INCLUDE */
-
-static int tcp_maxpersistidle;
-#endif /* TUBA_INCLUDE */
-
-/*
- * Fast timeout routine for processing delayed acks
- */
-void
-tcp_fasttimo()
-{
- register struct inpcb *inp;
- register struct tcpcb *tp;
- int s;
-
- s = splnet();
-
- for (inp = tcb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if ((tp = (struct tcpcb *)inp->inp_ppcb) &&
- (tp->t_flags & TF_DELACK)) {
- tp->t_flags &= ~TF_DELACK;
- tp->t_flags |= TF_ACKNOW;
- tcpstat.tcps_delack++;
- (void) tcp_output(tp);
- }
- }
- splx(s);
-}
-
-/*
- * Tcp protocol timeout routine called every 500 ms.
- * Updates the timers in all active tcb's and
- * causes finite state machine actions if timers expire.
- */
-void
-tcp_slowtimo()
-{
- register struct inpcb *ip, *ipnxt;
- register struct tcpcb *tp;
- register int i;
- int s;
-#ifdef TCPDEBUG
- int ostate;
-#endif
-
- s = splnet();
-
- tcp_maxidle = tcp_keepcnt * tcp_keepintvl;
-
- ip = tcb.lh_first;
- if (ip == NULL) {
- splx(s);
- return;
- }
- /*
- * Search through tcb's and update active timers.
- */
- for (; ip != NULL; ip = ipnxt) {
- ipnxt = ip->inp_list.le_next;
- tp = intotcpcb(ip);
- if (tp == 0 || tp->t_state == TCPS_LISTEN)
- continue;
- for (i = 0; i < TCPT_NTIMERS; i++) {
- if (tp->t_timer[i] && --tp->t_timer[i] == 0) {
-#ifdef TCPDEBUG
- ostate = tp->t_state;
-#endif
- tp = tcp_timers(tp, i);
- if (tp == NULL)
- goto tpgone;
-#ifdef TCPDEBUG
- if (tp->t_inpcb->inp_socket->so_options
- & SO_DEBUG)
- tcp_trace(TA_USER, ostate, tp,
- (struct tcpiphdr *)0,
- PRU_SLOWTIMO);
-#endif
- }
- }
- tp->t_idle++;
- tp->t_duration++;
- if (tp->t_rtt)
- tp->t_rtt++;
-tpgone:
- ;
- }
- tcp_iss += TCP_ISSINCR/PR_SLOWHZ; /* increment iss */
-#ifdef TCP_COMPAT_42
- if ((int)tcp_iss < 0)
- tcp_iss = TCP_ISSINCR; /* XXX */
-#endif
- tcp_now++; /* for timestamps */
- splx(s);
-}
-#ifndef TUBA_INCLUDE
-
-/*
- * Cancel all timers for TCP tp.
- */
-void
-tcp_canceltimers(tp)
- struct tcpcb *tp;
-{
- register int i;
-
- for (i = 0; i < TCPT_NTIMERS; i++)
- tp->t_timer[i] = 0;
-}
-
-int tcp_backoff[TCP_MAXRXTSHIFT + 1] =
- { 1, 2, 4, 8, 16, 32, 64, 64, 64, 64, 64, 64, 64 };
-
-static int tcp_totbackoff = 511; /* sum of tcp_backoff[] */
-
-/*
- * TCP timer processing.
- */
-struct tcpcb *
-tcp_timers(tp, timer)
- register struct tcpcb *tp;
- int timer;
-{
- register int rexmt;
-
- switch (timer) {
-
- /*
- * 2 MSL timeout in shutdown went off. If we're closed but
- * still waiting for peer to close and connection has been idle
- * too long, or if 2MSL time is up from TIME_WAIT, delete connection
- * control block. Otherwise, check again in a bit.
- */
- case TCPT_2MSL:
- if (tp->t_state != TCPS_TIME_WAIT &&
- tp->t_idle <= tcp_maxidle)
- tp->t_timer[TCPT_2MSL] = tcp_keepintvl;
- else
- tp = tcp_close(tp);
- break;
-
- /*
- * Retransmission timer went off. Message has not
- * been acked within retransmit interval. Back off
- * to a longer retransmit interval and retransmit one segment.
- */
- case TCPT_REXMT:
- if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) {
- tp->t_rxtshift = TCP_MAXRXTSHIFT;
- tcpstat.tcps_timeoutdrop++;
- tp = tcp_drop(tp, tp->t_softerror ?
- tp->t_softerror : ETIMEDOUT);
- break;
- }
- tcpstat.tcps_rexmttimeo++;
- rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
- TCPT_RANGESET(tp->t_rxtcur, rexmt,
- tp->t_rttmin, TCPTV_REXMTMAX);
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
- /*
- * If losing, let the lower level know and try for
- * a better route. Also, if we backed off this far,
- * our srtt estimate is probably bogus. Clobber it
- * so we'll take the next rtt measurement as our srtt;
- * move the current srtt into rttvar to keep the current
- * retransmit times until then.
- */
- if (tp->t_rxtshift > TCP_MAXRXTSHIFT / 4) {
- in_losing(tp->t_inpcb);
- tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT);
- tp->t_srtt = 0;
- }
- tp->snd_nxt = tp->snd_una;
- /*
- * Force a segment to be sent.
- */
- tp->t_flags |= TF_ACKNOW;
- /*
- * If timing a segment in this window, stop the timer.
- */
- tp->t_rtt = 0;
- /*
- * Close the congestion window down to one segment
- * (we'll open it by one segment for each ack we get).
- * Since we probably have a window's worth of unacked
- * data accumulated, this "slow start" keeps us from
- * dumping all that data as back-to-back packets (which
- * might overwhelm an intermediate gateway).
- *
- * There are two phases to the opening: Initially we
- * open by one mss on each ack. This makes the window
- * size increase exponentially with time. If the
- * window is larger than the path can handle, this
- * exponential growth results in dropped packet(s)
- * almost immediately. To get more time between
- * drops but still "push" the network to take advantage
- * of improving conditions, we switch from exponential
- * to linear window opening at some threshhold size.
- * For a threshhold, we use half the current window
- * size, truncated to a multiple of the mss.
- *
- * (the minimum cwnd that will give us exponential
- * growth is 2 mss. We don't allow the threshhold
- * to go below this.)
- */
- {
- u_int win = min(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg;
- if (win < 2)
- win = 2;
- tp->snd_cwnd = tp->t_maxseg;
- tp->snd_ssthresh = win * tp->t_maxseg;
- tp->t_dupacks = 0;
- }
- (void) tcp_output(tp);
- break;
-
- /*
- * Persistance timer into zero window.
- * Force a byte to be output, if possible.
- */
- case TCPT_PERSIST:
- tcpstat.tcps_persisttimeo++;
- /*
- * Hack: if the peer is dead/unreachable, we do not
- * time out if the window is closed. After a full
- * backoff, drop the connection if the idle time
- * (no responses to probes) reaches the maximum
- * backoff that we would use if retransmitting.
- */
- if (tp->t_rxtshift == TCP_MAXRXTSHIFT) {
- u_long maxidle = TCP_REXMTVAL(tp);
- if (maxidle < tp->t_rttmin)
- maxidle = tp->t_rttmin;
- maxidle *= tcp_totbackoff;
- if (tp->t_idle >= tcp_maxpersistidle ||
- tp->t_idle >= maxidle) {
- tcpstat.tcps_persistdrop++;
- tp = tcp_drop(tp, ETIMEDOUT);
- break;
- }
- }
- tcp_setpersist(tp);
- tp->t_force = 1;
- (void) tcp_output(tp);
- tp->t_force = 0;
- break;
-
- /*
- * Keep-alive timer went off; send something
- * or drop connection if idle for too long.
- */
- case TCPT_KEEP:
- tcpstat.tcps_keeptimeo++;
- if (tp->t_state < TCPS_ESTABLISHED)
- goto dropit;
- if ((always_keepalive ||
- tp->t_inpcb->inp_socket->so_options & SO_KEEPALIVE) &&
- tp->t_state <= TCPS_CLOSING) {
- if (tp->t_idle >= tcp_keepidle + tcp_maxidle)
- goto dropit;
- /*
- * Send a packet designed to force a response
- * if the peer is up and reachable:
- * either an ACK if the connection is still alive,
- * or an RST if the peer has closed the connection
- * due to timeout or reboot.
- * Using sequence number tp->snd_una-1
- * causes the transmitted zero-length segment
- * to lie outside the receive window;
- * by the protocol spec, this requires the
- * correspondent TCP to respond.
- */
- tcpstat.tcps_keepprobe++;
-#ifdef TCP_COMPAT_42
- /*
- * The keepalive packet must have nonzero length
- * to get a 4.2 host to respond.
- */
- tcp_respond(tp, tp->t_template, (struct mbuf *)NULL,
- tp->rcv_nxt - 1, tp->snd_una - 1, 0);
-#else
- tcp_respond(tp, tp->t_template, (struct mbuf *)NULL,
- tp->rcv_nxt, tp->snd_una - 1, 0);
-#endif
- tp->t_timer[TCPT_KEEP] = tcp_keepintvl;
- } else
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- break;
- dropit:
- tcpstat.tcps_keepdrops++;
- tp = tcp_drop(tp, ETIMEDOUT);
- break;
- }
- return (tp);
-}
-#endif /* TUBA_INCLUDE */
diff --git a/c/src/lib/libnetworking/netinet/tcp_timer.h b/c/src/lib/libnetworking/netinet/tcp_timer.h
deleted file mode 100644
index 38ffac4ee7..0000000000
--- a/c/src/lib/libnetworking/netinet/tcp_timer.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_timer.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_TIMER_H_
-#define _NETINET_TCP_TIMER_H_
-
-/*
- * Definitions of the TCP timers. These timers are counted
- * down PR_SLOWHZ times a second.
- */
-#define TCPT_NTIMERS 4
-
-#define TCPT_REXMT 0 /* retransmit */
-#define TCPT_PERSIST 1 /* retransmit persistence */
-#define TCPT_KEEP 2 /* keep alive */
-#define TCPT_2MSL 3 /* 2*msl quiet time timer */
-
-/*
- * The TCPT_REXMT timer is used to force retransmissions.
- * The TCP has the TCPT_REXMT timer set whenever segments
- * have been sent for which ACKs are expected but not yet
- * received. If an ACK is received which advances tp->snd_una,
- * then the retransmit timer is cleared (if there are no more
- * outstanding segments) or reset to the base value (if there
- * are more ACKs expected). Whenever the retransmit timer goes off,
- * we retransmit one unacknowledged segment, and do a backoff
- * on the retransmit timer.
- *
- * The TCPT_PERSIST timer is used to keep window size information
- * flowing even if the window goes shut. If all previous transmissions
- * have been acknowledged (so that there are no retransmissions in progress),
- * and the window is too small to bother sending anything, then we start
- * the TCPT_PERSIST timer. When it expires, if the window is nonzero,
- * we go to transmit state. Otherwise, at intervals send a single byte
- * into the peer's window to force him to update our window information.
- * We do this at most as often as TCPT_PERSMIN time intervals,
- * but no more frequently than the current estimate of round-trip
- * packet time. The TCPT_PERSIST timer is cleared whenever we receive
- * a window update from the peer.
- *
- * The TCPT_KEEP timer is used to keep connections alive. If an
- * connection is idle (no segments received) for TCPTV_KEEP_INIT amount of time,
- * but not yet established, then we drop the connection. Once the connection
- * is established, if the connection is idle for TCPTV_KEEP_IDLE time
- * (and keepalives have been enabled on the socket), we begin to probe
- * the connection. We force the peer to send us a segment by sending:
- * <SEQ=SND.UNA-1><ACK=RCV.NXT><CTL=ACK>
- * This segment is (deliberately) outside the window, and should elicit
- * an ack segment in response from the peer. If, despite the TCPT_KEEP
- * initiated segments we cannot elicit a response from a peer in TCPT_MAXIDLE
- * amount of time probing, then we drop the connection.
- */
-
-/*
- * Time constants.
- */
-#define TCPTV_MSL ( 30*PR_SLOWHZ) /* max seg lifetime (hah!) */
-#define TCPTV_SRTTBASE 0 /* base roundtrip time;
- if 0, no idea yet */
-#define TCPTV_RTOBASE ( 3*PR_SLOWHZ) /* assumed RTO if no info */
-#define TCPTV_SRTTDFLT ( 3*PR_SLOWHZ) /* assumed RTT if no info */
-
-#define TCPTV_PERSMIN ( 5*PR_SLOWHZ) /* retransmit persistence */
-#define TCPTV_PERSMAX ( 60*PR_SLOWHZ) /* maximum persist interval */
-
-#define TCPTV_KEEP_INIT ( 75*PR_SLOWHZ) /* initial connect keep alive */
-#define TCPTV_KEEP_IDLE (120*60*PR_SLOWHZ) /* dflt time before probing */
-#define TCPTV_KEEPINTVL ( 75*PR_SLOWHZ) /* default probe interval */
-#define TCPTV_KEEPCNT 8 /* max probes before drop */
-
-#define TCPTV_MIN ( 1*PR_SLOWHZ) /* minimum allowable value */
-#define TCPTV_REXMTMAX ( 64*PR_SLOWHZ) /* max allowable REXMT value */
-
-#define TCPTV_TWTRUNC 8 /* RTO factor to truncate TW */
-
-#define TCP_LINGERTIME 120 /* linger at most 2 minutes */
-
-#define TCP_MAXRXTSHIFT 12 /* maximum retransmits */
-
-#ifdef TCPTIMERS
-static char *tcptimers[] =
- { "REXMT", "PERSIST", "KEEP", "2MSL" };
-#endif
-
-/*
- * Force a time value to be in a certain range.
- */
-#define TCPT_RANGESET(tv, value, tvmin, tvmax) { \
- (tv) = (value); \
- if ((u_long)(tv) < (u_long)(tvmin)) \
- (tv) = (tvmin); \
- else if ((u_long)(tv) > (u_long)(tvmax)) \
- (tv) = (tvmax); \
-}
-
-#ifdef KERNEL
-extern int tcp_keepinit; /* time to establish connection */
-extern int tcp_keepidle; /* time before keepalive probes begin */
-extern int tcp_keepintvl; /* time between keepalive probes */
-extern int tcp_maxidle; /* time to drop after starting probes */
-extern int tcp_ttl; /* time to live for TCP segs */
-extern int tcp_backoff[];
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/netinet/tcp_usrreq.c b/c/src/lib/libnetworking/netinet/tcp_usrreq.c
deleted file mode 100644
index ecd9d95636..0000000000
--- a/c/src/lib/libnetworking/netinet/tcp_usrreq.c
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-#include <sys/stat.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-/*
- * TCP protocol interface to socket abstraction.
- */
-extern char *tcpstates[];
-
-static int tcp_attach __P((struct socket *));
-static int tcp_connect __P((struct tcpcb *, struct mbuf *));
-static struct tcpcb *
- tcp_disconnect __P((struct tcpcb *));
-static struct tcpcb *
- tcp_usrclosed __P((struct tcpcb *));
-
-#ifdef TCPDEBUG
-#define TCPDEBUG0 int ostate
-#define TCPDEBUG1() ostate = tp ? tp->t_state : 0
-#define TCPDEBUG2(req) if (tp && (so->so_options & SO_DEBUG)) \
- tcp_trace(TA_USER, ostate, tp, 0, req)
-#else
-#define TCPDEBUG0
-#define TCPDEBUG1()
-#define TCPDEBUG2(req)
-#endif
-
-/*
- * TCP attaches to socket via pru_attach(), reserving space,
- * and an internet control block.
- */
-static int
-tcp_usr_attach(struct socket *so, int proto)
-{
- int s = splnet();
- int error;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp = 0;
- TCPDEBUG0;
-
- TCPDEBUG1();
- if (inp) {
- error = EISCONN;
- goto out;
- }
-
- error = tcp_attach(so);
- if (error)
- goto out;
-
- if ((so->so_options & SO_LINGER) && so->so_linger == 0)
- so->so_linger = TCP_LINGERTIME * hz;
- tp = sototcpcb(so);
-out:
- TCPDEBUG2(PRU_ATTACH);
- splx(s);
- return error;
-}
-
-/*
- * pru_detach() detaches the TCP protocol from the socket.
- * If the protocol state is non-embryonic, then can't
- * do this directly: have to initiate a pru_disconnect(),
- * which may finish later; embryonic TCB's can just
- * be discarded here.
- */
-static int
-tcp_usr_detach(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
- TCPDEBUG0;
-
- if (inp == 0) {
- splx(s);
- return EINVAL; /* XXX */
- }
- tp = intotcpcb(inp);
- TCPDEBUG1();
- if (tp->t_state > TCPS_LISTEN)
- tp = tcp_disconnect(tp);
- else
- tp = tcp_close(tp);
-
- TCPDEBUG2(PRU_DETACH);
- splx(s);
- return error;
-}
-
-#define COMMON_START() TCPDEBUG0; \
- do { \
- if (inp == 0) { \
- splx(s); \
- return EINVAL; \
- } \
- tp = intotcpcb(inp); \
- TCPDEBUG1(); \
- } while(0)
-
-#define COMMON_END(req) out: TCPDEBUG2(req); splx(s); return error; goto out
-
-
-/*
- * Give the socket an address.
- */
-static int
-tcp_usr_bind(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
- struct sockaddr_in *sinp;
-
- COMMON_START();
-
- /*
- * Must check for multicast addresses and disallow binding
- * to them.
- */
- sinp = mtod(nam, struct sockaddr_in *);
- if (sinp->sin_family == AF_INET &&
- IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) {
- error = EAFNOSUPPORT;
- goto out;
- }
- error = in_pcbbind(inp, nam);
- if (error)
- goto out;
- COMMON_END(PRU_BIND);
-
-}
-
-/*
- * Prepare to accept connections.
- */
-static int
-tcp_usr_listen(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- if (inp->inp_lport == 0)
- error = in_pcbbind(inp, NULL);
- if (error == 0)
- tp->t_state = TCPS_LISTEN;
- COMMON_END(PRU_LISTEN);
-}
-
-/*
- * Initiate connection to peer.
- * Create a template for use in transmissions on this connection.
- * Enter SYN_SENT state, and mark socket as connecting.
- * Start keep-alive timer, and seed output sequence space.
- * Send initial segment on connection.
- */
-static int
-tcp_usr_connect(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
- struct sockaddr_in *sinp;
-
- COMMON_START();
-
- /*
- * Must disallow TCP ``connections'' to multicast addresses.
- */
- sinp = mtod(nam, struct sockaddr_in *);
- if (sinp->sin_family == AF_INET
- && IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) {
- error = EAFNOSUPPORT;
- goto out;
- }
-
- if ((error = tcp_connect(tp, nam)) != 0)
- goto out;
- error = tcp_output(tp);
- COMMON_END(PRU_CONNECT);
-}
-
-/*
- * Initiate disconnect from peer.
- * If connection never passed embryonic stage, just drop;
- * else if don't need to let data drain, then can just drop anyways,
- * else have to begin TCP shutdown process: mark socket disconnecting,
- * drain unread data, state switch to reflect user close, and
- * send segment (e.g. FIN) to peer. Socket will be really disconnected
- * when peer sends FIN and acks ours.
- *
- * SHOULD IMPLEMENT LATER PRU_CONNECT VIA REALLOC TCPCB.
- */
-static int
-tcp_usr_disconnect(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- tp = tcp_disconnect(tp);
- COMMON_END(PRU_DISCONNECT);
-}
-
-/*
- * Accept a connection. Essentially all the work is
- * done at higher levels; just return the address
- * of the peer, storing through addr.
- */
-static int
-tcp_usr_accept(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- in_setpeeraddr(inp, nam);
- COMMON_END(PRU_ACCEPT);
-}
-
-/*
- * Mark the connection as being incapable of further output.
- */
-static int
-tcp_usr_shutdown(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- socantsendmore(so);
- tp = tcp_usrclosed(tp);
- if (tp)
- error = tcp_output(tp);
- COMMON_END(PRU_SHUTDOWN);
-}
-
-/*
- * After a receive, possibly send window update to peer.
- */
-static int
-tcp_usr_rcvd(struct socket *so, int flags)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- tcp_output(tp);
- COMMON_END(PRU_RCVD);
-}
-
-/*
- * Do a send by putting data in output queue and updating urgent
- * marker if URG set. Possibly send more data.
- */
-static int
-tcp_usr_send(struct socket *so, int flags, struct mbuf *m, struct mbuf *nam,
- struct mbuf *control)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- if (control && control->m_len) {
- m_freem(control); /* XXX shouldn't caller do this??? */
- if (m)
- m_freem(m);
- error = EINVAL;
- goto out;
- }
-
- if(!(flags & PRUS_OOB)) {
- sbappend(&so->so_snd, m);
- if (nam && tp->t_state < TCPS_SYN_SENT) {
- /*
- * Do implied connect if not yet connected,
- * initialize window to default value, and
- * initialize maxseg/maxopd using peer's cached
- * MSS.
- */
- error = tcp_connect(tp, nam);
- if (error)
- goto out;
- tp->snd_wnd = TTCP_CLIENT_SND_WND;
- tcp_mss(tp, -1);
- }
-
- if (flags & PRUS_EOF) {
- /*
- * Close the send side of the connection after
- * the data is sent.
- */
- socantsendmore(so);
- tp = tcp_usrclosed(tp);
- }
- if (tp != NULL)
- error = tcp_output(tp);
- } else {
- if (sbspace(&so->so_snd) < -512) {
- m_freem(m);
- error = ENOBUFS;
- goto out;
- }
- /*
- * According to RFC961 (Assigned Protocols),
- * the urgent pointer points to the last octet
- * of urgent data. We continue, however,
- * to consider it to indicate the first octet
- * of data past the urgent section.
- * Otherwise, snd_up should be one lower.
- */
- sbappend(&so->so_snd, m);
- if (nam && tp->t_state < TCPS_SYN_SENT) {
- /*
- * Do implied connect if not yet connected,
- * initialize window to default value, and
- * initialize maxseg/maxopd using peer's cached
- * MSS.
- */
- error = tcp_connect(tp, nam);
- if (error)
- goto out;
- tp->snd_wnd = TTCP_CLIENT_SND_WND;
- tcp_mss(tp, -1);
- }
- tp->snd_up = tp->snd_una + so->so_snd.sb_cc;
- tp->t_force = 1;
- error = tcp_output(tp);
- tp->t_force = 0;
- }
- COMMON_END((flags & PRUS_OOB) ? PRU_SENDOOB :
- ((flags & PRUS_EOF) ? PRU_SEND_EOF : PRU_SEND));
-}
-
-/*
- * Abort the TCP.
- */
-static int
-tcp_usr_abort(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- tp = tcp_drop(tp, ECONNABORTED);
- COMMON_END(PRU_ABORT);
-}
-
-/*
- * Fill in st_bklsize for fstat() operations on a socket.
- */
-static int
-tcp_usr_sense(struct socket *so, struct stat *sb)
-{
- int s = splnet();
-
- sb->st_blksize = so->so_snd.sb_hiwat;
- splx(s);
- return 0;
-}
-
-/*
- * Receive out-of-band data.
- */
-static int
-tcp_usr_rcvoob(struct socket *so, struct mbuf *m, int flags)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- if ((so->so_oobmark == 0 &&
- (so->so_state & SS_RCVATMARK) == 0) ||
- so->so_options & SO_OOBINLINE ||
- tp->t_oobflags & TCPOOB_HADDATA) {
- error = EINVAL;
- goto out;
- }
- if ((tp->t_oobflags & TCPOOB_HAVEDATA) == 0) {
- error = EWOULDBLOCK;
- goto out;
- }
- m->m_len = 1;
- *mtod(m, caddr_t) = tp->t_iobc;
- if ((flags & MSG_PEEK) == 0)
- tp->t_oobflags ^= (TCPOOB_HAVEDATA | TCPOOB_HADDATA);
- COMMON_END(PRU_RCVOOB);
-}
-
-static int
-tcp_usr_sockaddr(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- in_setsockaddr(inp, nam);
- COMMON_END(PRU_SOCKADDR);
-}
-
-static int
-tcp_usr_peeraddr(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- in_setpeeraddr(inp, nam);
- COMMON_END(PRU_PEERADDR);
-}
-
-/*
- * XXX - this should just be a call to in_control, but we need to get
- * the types worked out.
- */
-static int
-tcp_usr_control(struct socket *so, int cmd, caddr_t arg, struct ifnet *ifp)
-{
- return in_control(so, cmd, arg, ifp);
-}
-
-/* xxx - should be const */
-struct pr_usrreqs tcp_usrreqs = {
- tcp_usr_abort, tcp_usr_accept, tcp_usr_attach, tcp_usr_bind,
- tcp_usr_connect, pru_connect2_notsupp, tcp_usr_control, tcp_usr_detach,
- tcp_usr_disconnect, tcp_usr_listen, tcp_usr_peeraddr, tcp_usr_rcvd,
- tcp_usr_rcvoob, tcp_usr_send, tcp_usr_sense, tcp_usr_shutdown,
- tcp_usr_sockaddr
-};
-
-/*
- * Common subroutine to open a TCP connection to remote host specified
- * by struct sockaddr_in in mbuf *nam. Call in_pcbbind to assign a local
- * port number if needed. Call in_pcbladdr to do the routing and to choose
- * a local host address (interface). If there is an existing incarnation
- * of the same connection in TIME-WAIT state and if the remote host was
- * sending CC options and if the connection duration was < MSL, then
- * truncate the previous TIME-WAIT state and proceed.
- * Initialize connection parameters and enter SYN-SENT state.
- */
-static int
-tcp_connect(tp, nam)
- register struct tcpcb *tp;
- struct mbuf *nam;
-{
- struct inpcb *inp = tp->t_inpcb, *oinp;
- struct socket *so = inp->inp_socket;
- struct tcpcb *otp;
- struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *);
- struct sockaddr_in *ifaddr;
- int error;
- struct rmxp_tao *taop;
- struct rmxp_tao tao_noncached;
-
- if (inp->inp_lport == 0) {
- error = in_pcbbind(inp, NULL);
- if (error)
- return error;
- }
-
- /*
- * Cannot simply call in_pcbconnect, because there might be an
- * earlier incarnation of this same connection still in
- * TIME_WAIT state, creating an ADDRINUSE error.
- */
- error = in_pcbladdr(inp, nam, &ifaddr);
- if (error)
- return error;
- oinp = in_pcblookuphash(inp->inp_pcbinfo,
- sin->sin_addr, sin->sin_port,
- inp->inp_laddr.s_addr != INADDR_ANY ? inp->inp_laddr
- : ifaddr->sin_addr,
- inp->inp_lport, 0);
- if (oinp) {
- if (oinp != inp && (otp = intotcpcb(oinp)) != NULL &&
- otp->t_state == TCPS_TIME_WAIT &&
- otp->t_duration < TCPTV_MSL &&
- (otp->t_flags & TF_RCVD_CC))
- otp = tcp_close(otp);
- else
- return EADDRINUSE;
- }
- if (inp->inp_laddr.s_addr == INADDR_ANY)
- inp->inp_laddr = ifaddr->sin_addr;
- inp->inp_faddr = sin->sin_addr;
- inp->inp_fport = sin->sin_port;
- in_pcbrehash(inp);
-
- tp->t_template = tcp_template(tp);
- if (tp->t_template == 0) {
- in_pcbdisconnect(inp);
- return ENOBUFS;
- }
-
- /* Compute window scaling to request. */
- while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
- (TCP_MAXWIN << tp->request_r_scale) < so->so_rcv.sb_hiwat)
- tp->request_r_scale++;
-
- soisconnecting(so);
- tcpstat.tcps_connattempt++;
- tp->t_state = TCPS_SYN_SENT;
- tp->t_timer[TCPT_KEEP] = tcp_keepinit;
- tp->iss = tcp_iss; tcp_iss += TCP_ISSINCR/2;
- tcp_sendseqinit(tp);
-
- /*
- * Generate a CC value for this connection and
- * check whether CC or CCnew should be used.
- */
- if ((taop = tcp_gettaocache(tp->t_inpcb)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
-
- tp->cc_send = CC_INC(tcp_ccgen);
- if (taop->tao_ccsent != 0 &&
- CC_GEQ(tp->cc_send, taop->tao_ccsent)) {
- taop->tao_ccsent = tp->cc_send;
- } else {
- taop->tao_ccsent = 0;
- tp->t_flags |= TF_SENDCCNEW;
- }
-
- return 0;
-}
-
-int
-tcp_ctloutput(op, so, level, optname, mp)
- int op;
- struct socket *so;
- int level, optname;
- struct mbuf **mp;
-{
- int error = 0, s;
- struct inpcb *inp;
- register struct tcpcb *tp;
- register struct mbuf *m;
- register int i;
-
- s = splnet();
- inp = sotoinpcb(so);
- if (inp == NULL) {
- splx(s);
- if (op == PRCO_SETOPT && *mp)
- (void) m_free(*mp);
- return (ECONNRESET);
- }
- if (level != IPPROTO_TCP) {
- error = ip_ctloutput(op, so, level, optname, mp);
- splx(s);
- return (error);
- }
- tp = intotcpcb(inp);
-
- switch (op) {
-
- case PRCO_SETOPT:
- m = *mp;
- switch (optname) {
-
- case TCP_NODELAY:
- if (m == NULL || m->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(m, int *))
- tp->t_flags |= TF_NODELAY;
- else
- tp->t_flags &= ~TF_NODELAY;
- break;
-
- case TCP_MAXSEG:
- if (m && (i = *mtod(m, int *)) > 0 && i <= tp->t_maxseg)
- tp->t_maxseg = i;
- else
- error = EINVAL;
- break;
-
- case TCP_NOOPT:
- if (m == NULL || m->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(m, int *))
- tp->t_flags |= TF_NOOPT;
- else
- tp->t_flags &= ~TF_NOOPT;
- break;
-
- case TCP_NOPUSH:
- if (m == NULL || m->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(m, int *))
- tp->t_flags |= TF_NOPUSH;
- else
- tp->t_flags &= ~TF_NOPUSH;
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- if (m)
- (void) m_free(m);
- break;
-
- case PRCO_GETOPT:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof(int);
-
- switch (optname) {
- case TCP_NODELAY:
- *mtod(m, int *) = tp->t_flags & TF_NODELAY;
- break;
- case TCP_MAXSEG:
- *mtod(m, int *) = tp->t_maxseg;
- break;
- case TCP_NOOPT:
- *mtod(m, int *) = tp->t_flags & TF_NOOPT;
- break;
- case TCP_NOPUSH:
- *mtod(m, int *) = tp->t_flags & TF_NOPUSH;
- break;
- default:
- error = ENOPROTOOPT;
- break;
- }
- break;
- }
- splx(s);
- return (error);
-}
-
-/*
- * tcp_sendspace and tcp_recvspace are the default send and receive window
- * sizes, respectively. These are obsolescent (this information should
- * be set by the route).
- */
-u_long tcp_sendspace = 1024*16;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_SENDSPACE, sendspace,
- CTLFLAG_RW, &tcp_sendspace , 0, "");
-u_long tcp_recvspace = 1024*16;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace,
- CTLFLAG_RW, &tcp_recvspace , 0, "");
-
-/*
- * Attach TCP protocol to socket, allocating
- * internet protocol control block, tcp control block,
- * bufer space, and entering LISTEN state if to accept connections.
- */
-static int
-tcp_attach(so)
- struct socket *so;
-{
- register struct tcpcb *tp;
- struct inpcb *inp;
- int error;
-
- if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) {
- error = soreserve(so, tcp_sendspace, tcp_recvspace);
- if (error)
- return (error);
- }
- error = in_pcballoc(so, &tcbinfo);
- if (error)
- return (error);
- inp = sotoinpcb(so);
- tp = tcp_newtcpcb(inp);
- if (tp == 0) {
- int nofd = so->so_state & SS_NOFDREF; /* XXX */
-
- so->so_state &= ~SS_NOFDREF; /* don't free the socket yet */
- in_pcbdetach(inp);
- so->so_state |= nofd;
- return (ENOBUFS);
- }
- tp->t_state = TCPS_CLOSED;
- return (0);
-}
-
-/*
- * Initiate (or continue) disconnect.
- * If embryonic state, just send reset (once).
- * If in ``let data drain'' option and linger null, just drop.
- * Otherwise (hard), mark socket disconnecting and drop
- * current input data; switch states based on user close, and
- * send segment to peer (with FIN).
- */
-static struct tcpcb *
-tcp_disconnect(tp)
- register struct tcpcb *tp;
-{
- struct socket *so = tp->t_inpcb->inp_socket;
-
- if (tp->t_state < TCPS_ESTABLISHED)
- tp = tcp_close(tp);
- else if ((so->so_options & SO_LINGER) && so->so_linger == 0)
- tp = tcp_drop(tp, 0);
- else {
- soisdisconnecting(so);
- sbflush(&so->so_rcv);
- tp = tcp_usrclosed(tp);
- if (tp)
- (void) tcp_output(tp);
- }
- return (tp);
-}
-
-/*
- * User issued close, and wish to trail through shutdown states:
- * if never received SYN, just forget it. If got a SYN from peer,
- * but haven't sent FIN, then go to FIN_WAIT_1 state to send peer a FIN.
- * If already got a FIN from peer, then almost done; go to LAST_ACK
- * state. In all other cases, have already sent FIN to peer (e.g.
- * after PRU_SHUTDOWN), and just have to play tedious game waiting
- * for peer to send FIN or not respond to keep-alives, etc.
- * We can let the user exit from the close as soon as the FIN is acked.
- */
-static struct tcpcb *
-tcp_usrclosed(tp)
- register struct tcpcb *tp;
-{
-
- switch (tp->t_state) {
-
- case TCPS_CLOSED:
- case TCPS_LISTEN:
- tp->t_state = TCPS_CLOSED;
- tp = tcp_close(tp);
- break;
-
- case TCPS_SYN_SENT:
- case TCPS_SYN_RECEIVED:
- tp->t_flags |= TF_NEEDFIN;
- break;
-
- case TCPS_ESTABLISHED:
- tp->t_state = TCPS_FIN_WAIT_1;
- break;
-
- case TCPS_CLOSE_WAIT:
- tp->t_state = TCPS_LAST_ACK;
- break;
- }
- if (tp && tp->t_state >= TCPS_FIN_WAIT_2) {
- soisdisconnected(tp->t_inpcb->inp_socket);
- /* To prevent the connection hanging in FIN_WAIT_2 forever. */
- if (tp->t_state == TCPS_FIN_WAIT_2)
- tp->t_timer[TCPT_2MSL] = tcp_maxidle;
- }
- return (tp);
-}
-
diff --git a/c/src/lib/libnetworking/netinet/tcp_var.h b/c/src/lib/libnetworking/netinet/tcp_var.h
deleted file mode 100644
index 8e63a2cafe..0000000000
--- a/c/src/lib/libnetworking/netinet/tcp_var.h
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993, 1994, 1995
- * 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.
- *
- * @(#)tcp_var.h 8.4 (Berkeley) 5/24/95
- * $Id$
- */
-
-#ifndef _NETINET_TCP_VAR_H_
-#define _NETINET_TCP_VAR_H_
-/*
- * Kernel variables for tcp.
- */
-
-/*
- * Tcp control block, one per tcp; fields:
- */
-struct tcpcb {
- struct tcpiphdr *seg_next; /* sequencing queue */
- struct tcpiphdr *seg_prev;
- int t_state; /* state of this connection */
- int t_timer[TCPT_NTIMERS]; /* tcp timers */
- int t_rxtshift; /* log(2) of rexmt exp. backoff */
- int t_rxtcur; /* current retransmit value */
- int t_dupacks; /* consecutive dup acks recd */
- u_int t_maxseg; /* maximum segment size */
- u_int t_maxopd; /* mss plus options */
- int t_force; /* 1 if forcing out a byte */
- u_int t_flags;
-#define TF_ACKNOW 0x0001 /* ack peer immediately */
-#define TF_DELACK 0x0002 /* ack, but try to delay it */
-#define TF_NODELAY 0x0004 /* don't delay packets to coalesce */
-#define TF_NOOPT 0x0008 /* don't use tcp options */
-#define TF_SENTFIN 0x0010 /* have sent FIN */
-#define TF_REQ_SCALE 0x0020 /* have/will request window scaling */
-#define TF_RCVD_SCALE 0x0040 /* other side has requested scaling */
-#define TF_REQ_TSTMP 0x0080 /* have/will request timestamps */
-#define TF_RCVD_TSTMP 0x0100 /* a timestamp was received in SYN */
-#define TF_SACK_PERMIT 0x0200 /* other side said I could SACK */
-#define TF_NEEDSYN 0x0400 /* send SYN (implicit state) */
-#define TF_NEEDFIN 0x0800 /* send FIN (implicit state) */
-#define TF_NOPUSH 0x1000 /* don't push */
-#define TF_REQ_CC 0x2000 /* have/will request CC */
-#define TF_RCVD_CC 0x4000 /* a CC was received in SYN */
-#define TF_SENDCCNEW 0x8000 /* send CCnew instead of CC in SYN */
-
- struct tcpiphdr *t_template; /* skeletal packet for transmit */
- struct inpcb *t_inpcb; /* back pointer to internet pcb */
-/*
- * The following fields are used as in the protocol specification.
- * See RFC783, Dec. 1981, page 21.
- */
-/* send sequence variables */
- tcp_seq snd_una; /* send unacknowledged */
- tcp_seq snd_nxt; /* send next */
- tcp_seq snd_up; /* send urgent pointer */
- tcp_seq snd_wl1; /* window update seg seq number */
- tcp_seq snd_wl2; /* window update seg ack number */
- tcp_seq iss; /* initial send sequence number */
- u_long snd_wnd; /* send window */
-/* receive sequence variables */
- u_long rcv_wnd; /* receive window */
- tcp_seq rcv_nxt; /* receive next */
- tcp_seq rcv_up; /* receive urgent pointer */
- tcp_seq irs; /* initial receive sequence number */
-/*
- * Additional variables for this implementation.
- */
-/* receive variables */
- tcp_seq rcv_adv; /* advertised window */
-/* retransmit variables */
- tcp_seq snd_max; /* highest sequence number sent;
- * used to recognize retransmits
- */
-/* congestion control (for slow start, source quench, retransmit after loss) */
- u_long snd_cwnd; /* congestion-controlled window */
- u_long snd_ssthresh; /* snd_cwnd size threshold for
- * for slow start exponential to
- * linear switch
- */
-/*
- * transmit timing stuff. See below for scale of srtt and rttvar.
- * "Variance" is actually smoothed difference.
- */
- u_int t_idle; /* inactivity time */
- int t_rtt; /* round trip time */
- tcp_seq t_rtseq; /* sequence number being timed */
- int t_srtt; /* smoothed round-trip time */
- int t_rttvar; /* variance in round-trip time */
- u_int t_rttmin; /* minimum rtt allowed */
- u_long max_sndwnd; /* largest window peer has offered */
-
-/* out-of-band data */
- char t_oobflags; /* have some */
- char t_iobc; /* input character */
-#define TCPOOB_HAVEDATA 0x01
-#define TCPOOB_HADDATA 0x02
- int t_softerror; /* possible error not yet reported */
-
-/* RFC 1323 variables */
- u_char snd_scale; /* window scaling for send window */
- u_char rcv_scale; /* window scaling for recv window */
- u_char request_r_scale; /* pending window scaling */
- u_char requested_s_scale;
- u_long ts_recent; /* timestamp echo data */
- u_long ts_recent_age; /* when last updated */
- tcp_seq last_ack_sent;
-/* RFC 1644 variables */
- tcp_cc cc_send; /* send connection count */
- tcp_cc cc_recv; /* receive connection count */
- u_long t_duration; /* connection duration */
-
-/* TUBA stuff */
- caddr_t t_tuba_pcb; /* next level down pcb for TCP over z */
-/* More RTT stuff */
- u_long t_rttupdated; /* number of times rtt sampled */
-};
-
-/*
- * Structure to hold TCP options that are only used during segment
- * processing (in tcp_input), but not held in the tcpcb.
- * It's basically used to reduce the number of parameters
- * to tcp_dooptions.
- */
-struct tcpopt {
- u_long to_flag; /* which options are present */
-#define TOF_TS 0x0001 /* timestamp */
-#define TOF_CC 0x0002 /* CC and CCnew are exclusive */
-#define TOF_CCNEW 0x0004
-#define TOF_CCECHO 0x0008
- u_long to_tsval;
- u_long to_tsecr;
- tcp_cc to_cc; /* holds CC or CCnew */
- tcp_cc to_ccecho;
-};
-
-/*
- * The TAO cache entry which is stored in the protocol family specific
- * portion of the route metrics.
- */
-struct rmxp_tao {
- tcp_cc tao_cc; /* latest CC in valid SYN */
- tcp_cc tao_ccsent; /* latest CC sent to peer */
- u_short tao_mssopt; /* peer's cached MSS */
-#ifdef notyet
- u_short tao_flags; /* cache status flags */
-#define TAOF_DONT 0x0001 /* peer doesn't understand rfc1644 */
-#define TAOF_OK 0x0002 /* peer does understand rfc1644 */
-#define TAOF_UNDEF 0 /* we don't know yet */
-#endif /* notyet */
-};
-#define rmx_taop(r) ((struct rmxp_tao *)(r).rmx_filler)
-
-#define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb)
-#define sototcpcb(so) (intotcpcb(sotoinpcb(so)))
-
-/*
- * The smoothed round-trip time and estimated variance
- * are stored as fixed point numbers scaled by the values below.
- * For convenience, these scales are also used in smoothing the average
- * (smoothed = (1/scale)sample + ((scale-1)/scale)smoothed).
- * With these scales, srtt has 3 bits to the right of the binary point,
- * and thus an "ALPHA" of 0.875. rttvar has 2 bits to the right of the
- * binary point, and is smoothed with an ALPHA of 0.75.
- */
-#define TCP_RTT_SCALE 32 /* multiplier for srtt; 3 bits frac. */
-#define TCP_RTT_SHIFT 5 /* shift for srtt; 3 bits frac. */
-#define TCP_RTTVAR_SCALE 16 /* multiplier for rttvar; 2 bits */
-#define TCP_RTTVAR_SHIFT 4 /* shift for rttvar; 2 bits */
-#define TCP_DELTA_SHIFT 2 /* see tcp_input.c */
-
-/*
- * The initial retransmission should happen at rtt + 4 * rttvar.
- * Because of the way we do the smoothing, srtt and rttvar
- * will each average +1/2 tick of bias. When we compute
- * the retransmit timer, we want 1/2 tick of rounding and
- * 1 extra tick because of +-1/2 tick uncertainty in the
- * firing of the timer. The bias will give us exactly the
- * 1.5 tick we need. But, because the bias is
- * statistical, we have to test that we don't drop below
- * the minimum feasible timer (which is 2 ticks).
- * This version of the macro adapted from a paper by Lawrence
- * Brakmo and Larry Peterson which outlines a problem caused
- * by insufficient precision in the original implementation,
- * which results in inappropriately large RTO values for very
- * fast networks.
- */
-#define TCP_REXMTVAL(tp) \
- ((((tp)->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT)) \
- + (tp)->t_rttvar) >> TCP_DELTA_SHIFT)
-
-/* XXX
- * We want to avoid doing m_pullup on incoming packets but that
- * means avoiding dtom on the tcp reassembly code. That in turn means
- * keeping an mbuf pointer in the reassembly queue (since we might
- * have a cluster). As a quick hack, the source & destination
- * port numbers (which are no longer needed once we've located the
- * tcpcb) are overlayed with an mbuf pointer.
- */
-#define REASS_MBUF(ti) (*(struct mbuf **)&((ti)->ti_t))
-
-/*
- * TCP statistics.
- * Many of these should be kept per connection,
- * but that's inconvenient at the moment.
- */
-struct tcpstat {
- u_long tcps_connattempt; /* connections initiated */
- u_long tcps_accepts; /* connections accepted */
- u_long tcps_connects; /* connections established */
- u_long tcps_drops; /* connections dropped */
- u_long tcps_conndrops; /* embryonic connections dropped */
- u_long tcps_closed; /* conn. closed (includes drops) */
- u_long tcps_segstimed; /* segs where we tried to get rtt */
- u_long tcps_rttupdated; /* times we succeeded */
- u_long tcps_delack; /* delayed acks sent */
- u_long tcps_timeoutdrop; /* conn. dropped in rxmt timeout */
- u_long tcps_rexmttimeo; /* retransmit timeouts */
- u_long tcps_persisttimeo; /* persist timeouts */
- u_long tcps_keeptimeo; /* keepalive timeouts */
- u_long tcps_keepprobe; /* keepalive probes sent */
- u_long tcps_keepdrops; /* connections dropped in keepalive */
-
- u_long tcps_sndtotal; /* total packets sent */
- u_long tcps_sndpack; /* data packets sent */
- u_long tcps_sndbyte; /* data bytes sent */
- u_long tcps_sndrexmitpack; /* data packets retransmitted */
- u_long tcps_sndrexmitbyte; /* data bytes retransmitted */
- u_long tcps_sndacks; /* ack-only packets sent */
- u_long tcps_sndprobe; /* window probes sent */
- u_long tcps_sndurg; /* packets sent with URG only */
- u_long tcps_sndwinup; /* window update-only packets sent */
- u_long tcps_sndctrl; /* control (SYN|FIN|RST) packets sent */
-
- u_long tcps_rcvtotal; /* total packets received */
- u_long tcps_rcvpack; /* packets received in sequence */
- u_long tcps_rcvbyte; /* bytes received in sequence */
- u_long tcps_rcvbadsum; /* packets received with ccksum errs */
- u_long tcps_rcvbadoff; /* packets received with bad offset */
- u_long tcps_rcvshort; /* packets received too short */
- u_long tcps_rcvduppack; /* duplicate-only packets received */
- u_long tcps_rcvdupbyte; /* duplicate-only bytes received */
- u_long tcps_rcvpartduppack; /* packets with some duplicate data */
- u_long tcps_rcvpartdupbyte; /* dup. bytes in part-dup. packets */
- u_long tcps_rcvoopack; /* out-of-order packets received */
- u_long tcps_rcvoobyte; /* out-of-order bytes received */
- u_long tcps_rcvpackafterwin; /* packets with data after window */
- u_long tcps_rcvbyteafterwin; /* bytes rcvd after window */
- u_long tcps_rcvafterclose; /* packets rcvd after "close" */
- u_long tcps_rcvwinprobe; /* rcvd window probe packets */
- u_long tcps_rcvdupack; /* rcvd duplicate acks */
- u_long tcps_rcvacktoomuch; /* rcvd acks for unsent data */
- u_long tcps_rcvackpack; /* rcvd ack packets */
- u_long tcps_rcvackbyte; /* bytes acked by rcvd acks */
- u_long tcps_rcvwinupd; /* rcvd window update packets */
- u_long tcps_pawsdrop; /* segments dropped due to PAWS */
- u_long tcps_predack; /* times hdr predict ok for acks */
- u_long tcps_preddat; /* times hdr predict ok for data pkts */
- u_long tcps_pcbcachemiss;
- u_long tcps_cachedrtt; /* times cached RTT in route updated */
- u_long tcps_cachedrttvar; /* times cached rttvar updated */
- u_long tcps_cachedssthresh; /* times cached ssthresh updated */
- u_long tcps_usedrtt; /* times RTT initialized from route */
- u_long tcps_usedrttvar; /* times RTTVAR initialized from rt */
- u_long tcps_usedssthresh; /* times ssthresh initialized from rt*/
- u_long tcps_persistdrop; /* timeout in persist state */
- u_long tcps_badsyn; /* bogus SYN, e.g. premature ACK */
- u_long tcps_mturesent; /* resends due to MTU discovery */
- u_long tcps_listendrop; /* listen queue overflows */
-};
-
-/*
- * Names for TCP sysctl objects
- */
-#define TCPCTL_DO_RFC1323 1 /* use RFC-1323 extensions */
-#define TCPCTL_DO_RFC1644 2 /* use RFC-1644 extensions */
-#define TCPCTL_MSSDFLT 3 /* MSS default */
-#define TCPCTL_STATS 4 /* statistics (read-only) */
-#define TCPCTL_RTTDFLT 5 /* default RTT estimate */
-#define TCPCTL_KEEPIDLE 6 /* keepalive idle timer */
-#define TCPCTL_KEEPINTVL 7 /* interval to send keepalives */
-#define TCPCTL_SENDSPACE 8 /* send buffer space */
-#define TCPCTL_RECVSPACE 9 /* receive buffer space */
-#define TCPCTL_KEEPINIT 10 /* receive buffer space */
-#define TCPCTL_MAXID 11
-
-#define TCPCTL_NAMES { \
- { 0, 0 }, \
- { "rfc1323", CTLTYPE_INT }, \
- { "rfc1644", CTLTYPE_INT }, \
- { "mssdflt", CTLTYPE_INT }, \
- { "stats", CTLTYPE_STRUCT }, \
- { "rttdflt", CTLTYPE_INT }, \
- { "keepidle", CTLTYPE_INT }, \
- { "keepintvl", CTLTYPE_INT }, \
- { "sendspace", CTLTYPE_INT }, \
- { "recvspace", CTLTYPE_INT }, \
- { "keepinit", CTLTYPE_INT }, \
-}
-
-#ifdef KERNEL
-extern struct inpcbhead tcb; /* head of queue of active tcpcb's */
-extern struct inpcbinfo tcbinfo;
-extern struct tcpstat tcpstat; /* tcp statistics */
-extern int tcp_mssdflt; /* XXX */
-extern u_long tcp_now; /* for RFC 1323 timestamps */
-
-void tcp_canceltimers __P((struct tcpcb *));
-struct tcpcb *
- tcp_close __P((struct tcpcb *));
-void tcp_ctlinput __P((int, struct sockaddr *, void *));
-int tcp_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
-struct tcpcb *
- tcp_drop __P((struct tcpcb *, int));
-void tcp_drain __P((void));
-void tcp_fasttimo __P((void));
-struct rmxp_tao *
- tcp_gettaocache __P((struct inpcb *));
-void tcp_init __P((void));
-void tcp_input __P((struct mbuf *, int));
-void tcp_mss __P((struct tcpcb *, int));
-int tcp_mssopt __P((struct tcpcb *));
-void tcp_mtudisc __P((struct inpcb *, int));
-struct tcpcb *
- tcp_newtcpcb __P((struct inpcb *));
-int tcp_output __P((struct tcpcb *));
-void tcp_quench __P((struct inpcb *, int));
-void tcp_respond __P((struct tcpcb *,
- struct tcpiphdr *, struct mbuf *, u_long, u_long, int));
-struct rtentry *
- tcp_rtlookup __P((struct inpcb *));
-void tcp_setpersist __P((struct tcpcb *));
-void tcp_slowtimo __P((void));
-struct tcpiphdr *
- tcp_template __P((struct tcpcb *));
-struct tcpcb *
- tcp_timers __P((struct tcpcb *, int));
-void tcp_trace __P((int, int, struct tcpcb *, struct tcpiphdr *, int));
-
-extern struct pr_usrreqs tcp_usrreqs;
-extern u_long tcp_sendspace;
-extern u_long tcp_recvspace;
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_TCP_VAR_H_ */
diff --git a/c/src/lib/libnetworking/netinet/tcpip.h b/c/src/lib/libnetworking/netinet/tcpip.h
deleted file mode 100644
index b8634bfd15..0000000000
--- a/c/src/lib/libnetworking/netinet/tcpip.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcpip.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCPIP_H_
-#define _NETINET_TCPIP_H_
-
-/*
- * Tcp+ip header, after ip options removed.
- */
-struct tcpiphdr {
- struct ipovly ti_i; /* overlaid ip structure */
- struct tcphdr ti_t; /* tcp header */
-};
-#ifdef notyet
-/*
- * Tcp+ip header, after ip options removed but including TCP options.
- */
-struct full_tcpiphdr {
- struct ipovly ti_i; /* overlaid ip structure */
- struct tcphdr ti_t; /* tcp header */
- char ti_o[TCP_MAXOLEN]; /* space for tcp options */
-};
-#endif /* notyet */
-#define ti_next ti_i.ih_next
-#define ti_prev ti_i.ih_prev
-#define ti_x1 ti_i.ih_x1
-#define ti_pr ti_i.ih_pr
-#define ti_len ti_i.ih_len
-#define ti_src ti_i.ih_src
-#define ti_dst ti_i.ih_dst
-#define ti_sport ti_t.th_sport
-#define ti_dport ti_t.th_dport
-#define ti_seq ti_t.th_seq
-#define ti_ack ti_t.th_ack
-#define ti_x2 ti_t.th_x2
-#define ti_off ti_t.th_off
-#define ti_flags ti_t.th_flags
-#define ti_win ti_t.th_win
-#define ti_sum ti_t.th_sum
-#define ti_urp ti_t.th_urp
-
-#endif
diff --git a/c/src/lib/libnetworking/netinet/udp.h b/c/src/lib/libnetworking/netinet/udp.h
deleted file mode 100644
index e73e1f4ddb..0000000000
--- a/c/src/lib/libnetworking/netinet/udp.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)udp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_UDP_H_
-#define _NETINET_UDP_H_
-
-/*
- * Udp protocol header.
- * Per RFC 768, September, 1981.
- */
-struct udphdr {
- u_short uh_sport; /* source port */
- u_short uh_dport; /* destination port */
- u_short uh_ulen; /* udp length */
- u_short uh_sum; /* udp checksum */
-};
-
-#endif
diff --git a/c/src/lib/libnetworking/netinet/udp_usrreq.c b/c/src/lib/libnetworking/netinet/udp_usrreq.c
deleted file mode 100644
index 16c5fce2df..0000000000
--- a/c/src/lib/libnetworking/netinet/udp_usrreq.c
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/stat.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/syslog.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-
-/*
- * UDP protocol implementation.
- * Per RFC 768, August, 1980.
- */
-#ifndef COMPAT_42
-static int udpcksum = 1;
-#else
-static int udpcksum = 0; /* XXX */
-#endif
-SYSCTL_INT(_net_inet_udp, UDPCTL_CHECKSUM, checksum, CTLFLAG_RW,
- &udpcksum, 0, "");
-
-static int log_in_vain = 0;
-SYSCTL_INT(_net_inet_udp, OID_AUTO, log_in_vain, CTLFLAG_RW,
- &log_in_vain, 0, "");
-
-static struct inpcbhead udb; /* from udp_var.h */
-static struct inpcbinfo udbinfo;
-
-#ifndef UDBHASHSIZE
-#define UDBHASHSIZE 64
-#endif
-
- struct udpstat udpstat; /* from udp_var.h */
-SYSCTL_STRUCT(_net_inet_udp, UDPCTL_STATS, stats, CTLFLAG_RD,
- &udpstat, udpstat, "");
-
-static struct sockaddr_in udp_in = { sizeof(udp_in), AF_INET };
-
-static void udp_detach __P((struct inpcb *));
-static int udp_output __P((struct inpcb *, struct mbuf *, struct mbuf *,
- struct mbuf *));
-static void udp_notify __P((struct inpcb *, int));
-
-void
-udp_init()
-{
- LIST_INIT(&udb);
- udbinfo.listhead = &udb;
- udbinfo.hashbase = hashinit(UDBHASHSIZE, M_PCB, &udbinfo.hashmask);
-}
-
-void
-udp_input(m, iphlen)
- register struct mbuf *m;
- int iphlen;
-{
- register struct ip *ip;
- register struct udphdr *uh;
- register struct inpcb *inp;
- struct mbuf *opts = 0;
- int len;
- struct ip save_ip;
-
- udpstat.udps_ipackets++;
-
- /*
- * Strip IP options, if any; should skip this,
- * make available to user, and use on returned packets,
- * but we don't yet have a way to check the checksum
- * with options still present.
- */
- if (iphlen > sizeof (struct ip)) {
- ip_stripoptions(m, (struct mbuf *)0);
- iphlen = sizeof(struct ip);
- }
-
- /*
- * Get IP and UDP header together in first mbuf.
- */
- ip = mtod(m, struct ip *);
- if (m->m_len < iphlen + sizeof(struct udphdr)) {
- if ((m = m_pullup(m, iphlen + sizeof(struct udphdr))) == 0) {
- udpstat.udps_hdrops++;
- return;
- }
- ip = mtod(m, struct ip *);
- }
- uh = (struct udphdr *)((caddr_t)ip + iphlen);
-
- /*
- * Make mbuf data length reflect UDP length.
- * If not enough data to reflect UDP length, drop.
- */
- len = ntohs((u_short)uh->uh_ulen);
- if (ip->ip_len != len) {
- if (len > ip->ip_len || len < sizeof(struct udphdr)) {
- udpstat.udps_badlen++;
- goto bad;
- }
- m_adj(m, len - ip->ip_len);
- /* ip->ip_len = len; */
- }
- /*
- * Save a copy of the IP header in case we want restore it
- * for sending an ICMP error message in response.
- */
- save_ip = *ip;
-
- /*
- * Checksum extended UDP header and data.
- */
- if (uh->uh_sum) {
- ((struct ipovly *)ip)->ih_next = 0;
- ((struct ipovly *)ip)->ih_prev = 0;
- ((struct ipovly *)ip)->ih_x1 = 0;
- ((struct ipovly *)ip)->ih_len = uh->uh_ulen;
- uh->uh_sum = in_cksum(m, len + sizeof (struct ip));
- if (uh->uh_sum) {
- udpstat.udps_badsum++;
- m_freem(m);
- return;
- }
- }
-
- if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
- in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) {
- struct inpcb *last;
- /*
- * Deliver a multicast or broadcast datagram to *all* sockets
- * for which the local and remote addresses and ports match
- * those of the incoming datagram. This allows more than
- * one process to receive multi/broadcasts on the same port.
- * (This really ought to be done for unicast datagrams as
- * well, but that would cause problems with existing
- * applications that open both address-specific sockets and
- * a wildcard socket listening to the same port -- they would
- * end up receiving duplicates of every unicast datagram.
- * Those applications open the multiple sockets to overcome an
- * inadequacy of the UDP socket interface, but for backwards
- * compatibility we avoid the problem here rather than
- * fixing the interface. Maybe 4.5BSD will remedy this?)
- */
-
- /*
- * Construct sockaddr format source address.
- */
- udp_in.sin_port = uh->uh_sport;
- udp_in.sin_addr = ip->ip_src;
- m->m_len -= sizeof (struct udpiphdr);
- m->m_data += sizeof (struct udpiphdr);
- /*
- * Locate pcb(s) for datagram.
- * (Algorithm copied from raw_intr().)
- */
- last = NULL;
- for (inp = udb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_lport != uh->uh_dport)
- continue;
- if (inp->inp_laddr.s_addr != INADDR_ANY) {
- if (inp->inp_laddr.s_addr !=
- ip->ip_dst.s_addr)
- continue;
- }
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- if (inp->inp_faddr.s_addr !=
- ip->ip_src.s_addr ||
- inp->inp_fport != uh->uh_sport)
- continue;
- }
-
- if (last != NULL) {
- struct mbuf *n;
-
- if ((n = m_copy(m, 0, M_COPYALL)) != NULL) {
- if (last->inp_flags & INP_CONTROLOPTS
- || last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, n);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&udp_in,
- n, opts) == 0) {
- m_freem(n);
- if (opts)
- m_freem(opts);
- udpstat.udps_fullsock++;
- } else
- sorwakeup(last->inp_socket);
- opts = 0;
- }
- }
- last = inp;
- /*
- * Don't look for additional matches if this one does
- * not have either the SO_REUSEPORT or SO_REUSEADDR
- * socket options set. This heuristic avoids searching
- * through all pcbs in the common case of a non-shared
- * port. It * assumes that an application will never
- * clear these options after setting them.
- */
- if (((last->inp_socket->so_options&(SO_REUSEPORT|SO_REUSEADDR)) == 0))
- break;
- }
-
- if (last == NULL) {
- /*
- * No matching pcb found; discard datagram.
- * (No need to send an ICMP Port Unreachable
- * for a broadcast or multicast datgram.)
- */
- udpstat.udps_noportbcast++;
- goto bad;
- }
- if (last->inp_flags & INP_CONTROLOPTS
- || last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, m);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&udp_in,
- m, opts) == 0) {
- udpstat.udps_fullsock++;
- goto bad;
- }
- sorwakeup(last->inp_socket);
- return;
- }
- /*
- * Locate pcb for datagram.
- */
- inp = in_pcblookuphash(&udbinfo, ip->ip_src, uh->uh_sport,
- ip->ip_dst, uh->uh_dport, 1);
- if (inp == NULL) {
- if (log_in_vain) {
- char buf[4*sizeof "123"];
-
- strcpy(buf, inet_ntoa(ip->ip_dst));
- log(LOG_INFO, "Connection attempt to UDP %s:%d"
- " from %s:%d\n",
- buf, ntohs(uh->uh_dport),
- inet_ntoa(ip->ip_src), ntohs(uh->uh_sport));
- }
- udpstat.udps_noport++;
- if (m->m_flags & (M_BCAST | M_MCAST)) {
- udpstat.udps_noportbcast++;
- goto bad;
- }
- *ip = save_ip;
- icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0);
- return;
- }
-
- /*
- * Construct sockaddr format source address.
- * Stuff source address and datagram in user buffer.
- */
- udp_in.sin_port = uh->uh_sport;
- udp_in.sin_addr = ip->ip_src;
- if (inp->inp_flags & INP_CONTROLOPTS
- || inp->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(inp, &opts, ip, m);
- iphlen += sizeof(struct udphdr);
- m->m_len -= iphlen;
- m->m_pkthdr.len -= iphlen;
- m->m_data += iphlen;
- if (sbappendaddr(&inp->inp_socket->so_rcv, (struct sockaddr *)&udp_in,
- m, opts) == 0) {
- udpstat.udps_fullsock++;
- goto bad;
- }
- sorwakeup(inp->inp_socket);
- return;
-bad:
- m_freem(m);
- if (opts)
- m_freem(opts);
-}
-
-/*
- * Notify a udp user of an asynchronous error;
- * just wake up so that he can collect error status.
- */
-static void
-udp_notify(inp, errnum)
- register struct inpcb *inp;
- int errnum;
-{
- inp->inp_socket->so_error = errnum;
- sorwakeup(inp->inp_socket);
- sowwakeup(inp->inp_socket);
-}
-
-void
-udp_ctlinput(cmd, sa, vip)
- int cmd;
- struct sockaddr *sa;
- void *vip;
-{
- register struct ip *ip = vip;
- register struct udphdr *uh;
-
- if (!PRC_IS_REDIRECT(cmd) &&
- ((unsigned)cmd >= PRC_NCMDS || inetctlerrmap[cmd] == 0))
- return;
- if (ip) {
- uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2));
- in_pcbnotify(&udb, sa, uh->uh_dport, ip->ip_src, uh->uh_sport,
- cmd, udp_notify);
- } else
- in_pcbnotify(&udb, sa, 0, zeroin_addr, 0, cmd, udp_notify);
-}
-
-static int
-udp_output(inp, m, addr, control)
- register struct inpcb *inp;
- register struct mbuf *m;
- struct mbuf *addr, *control;
-{
- register struct udpiphdr *ui;
- register int len = m->m_pkthdr.len;
- struct in_addr laddr;
- int s = 0, error = 0;
-
- if (control)
- m_freem(control); /* XXX */
-
- if (len + sizeof(struct udpiphdr) > IP_MAXPACKET) {
- error = EMSGSIZE;
- goto release;
- }
-
- if (addr) {
- laddr = inp->inp_laddr;
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- error = EISCONN;
- goto release;
- }
- /*
- * Must block input while temporarily connected.
- */
- s = splnet();
- error = in_pcbconnect(inp, addr);
- if (error) {
- splx(s);
- goto release;
- }
- } else {
- if (inp->inp_faddr.s_addr == INADDR_ANY) {
- error = ENOTCONN;
- goto release;
- }
- }
- /*
- * Calculate data length and get a mbuf
- * for UDP and IP headers.
- */
- M_PREPEND(m, sizeof(struct udpiphdr), M_DONTWAIT);
- if (m == 0) {
- error = ENOBUFS;
- if (addr)
- splx(s);
- goto release;
- }
-
- /*
- * Fill in mbuf with extended UDP header
- * and addresses and length put into network format.
- */
- ui = mtod(m, struct udpiphdr *);
- ui->ui_next = ui->ui_prev = 0;
- ui->ui_x1 = 0;
- ui->ui_pr = IPPROTO_UDP;
- ui->ui_len = htons((u_short)len + sizeof (struct udphdr));
- ui->ui_src = inp->inp_laddr;
- ui->ui_dst = inp->inp_faddr;
- ui->ui_sport = inp->inp_lport;
- ui->ui_dport = inp->inp_fport;
- ui->ui_ulen = ui->ui_len;
-
- /*
- * Stuff checksum and output datagram.
- */
- ui->ui_sum = 0;
- if (udpcksum) {
- if ((ui->ui_sum = in_cksum(m, sizeof (struct udpiphdr) + len)) == 0)
- ui->ui_sum = 0xffff;
- }
- ((struct ip *)ui)->ip_len = sizeof (struct udpiphdr) + len;
- ((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; /* XXX */
- ((struct ip *)ui)->ip_tos = inp->inp_ip_tos; /* XXX */
- udpstat.udps_opackets++;
- error = ip_output(m, inp->inp_options, &inp->inp_route,
- inp->inp_socket->so_options & (SO_DONTROUTE | SO_BROADCAST),
- inp->inp_moptions);
-
- if (addr) {
- in_pcbdisconnect(inp);
- inp->inp_laddr = laddr;
- splx(s);
- }
- return (error);
-
-release:
- m_freem(m);
- return (error);
-}
-
-static u_long udp_sendspace = 9216; /* really max datagram size */
- /* 40 1K datagrams */
-SYSCTL_INT(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW,
- &udp_sendspace, 0, "");
-
-static u_long udp_recvspace = 40 * (1024 + sizeof(struct sockaddr_in));
-SYSCTL_INT(_net_inet_udp, UDPCTL_RECVSPACE, recvspace, CTLFLAG_RW,
- &udp_recvspace, 0, "");
-
-/*ARGSUSED*/
-int
-udp_usrreq(so, req, m, addr, control)
- struct socket *so;
- int req;
- struct mbuf *m, *addr, *control;
-{
- struct inpcb *inp = sotoinpcb(so);
- int error = 0;
- int s;
-
- if (req == PRU_CONTROL)
- return (in_control(so, (u_long)m, (caddr_t)addr,
- (struct ifnet *)control));
- if (inp == NULL && req != PRU_ATTACH) {
- error = EINVAL;
- goto release;
- }
- /*
- * Note: need to block udp_input while changing
- * the udp pcb queue and/or pcb addresses.
- */
- switch (req) {
-
- case PRU_ATTACH:
- if (inp != NULL) {
- error = EINVAL;
- break;
- }
- s = splnet();
- error = in_pcballoc(so, &udbinfo);
- splx(s);
- if (error)
- break;
- error = soreserve(so, udp_sendspace, udp_recvspace);
- if (error)
- break;
- ((struct inpcb *) so->so_pcb)->inp_ip_ttl = ip_defttl;
- break;
-
- case PRU_DETACH:
- udp_detach(inp);
- break;
-
- case PRU_BIND:
- s = splnet();
- error = in_pcbbind(inp, addr);
- splx(s);
- break;
-
- case PRU_LISTEN:
- error = EOPNOTSUPP;
- break;
-
- case PRU_CONNECT:
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- error = EISCONN;
- break;
- }
- s = splnet();
- error = in_pcbconnect(inp, addr);
- splx(s);
- if (error == 0)
- soisconnected(so);
- break;
-
- case PRU_CONNECT2:
- error = EOPNOTSUPP;
- break;
-
- case PRU_ACCEPT:
- error = EOPNOTSUPP;
- break;
-
- case PRU_DISCONNECT:
- if (inp->inp_faddr.s_addr == INADDR_ANY) {
- error = ENOTCONN;
- break;
- }
- s = splnet();
- in_pcbdisconnect(inp);
- inp->inp_laddr.s_addr = INADDR_ANY;
- splx(s);
- so->so_state &= ~SS_ISCONNECTED; /* XXX */
- break;
-
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- case PRU_SEND:
- return (udp_output(inp, m, addr, control));
-
- case PRU_ABORT:
- soisdisconnected(so);
- udp_detach(inp);
- break;
-
- case PRU_SOCKADDR:
- in_setsockaddr(inp, addr);
- break;
-
- case PRU_PEERADDR:
- in_setpeeraddr(inp, addr);
- break;
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- case PRU_SENDOOB:
- case PRU_FASTTIMO:
- case PRU_SLOWTIMO:
- case PRU_PROTORCV:
- case PRU_PROTOSEND:
- error = EOPNOTSUPP;
- break;
-
- case PRU_RCVD:
- case PRU_RCVOOB:
- return (EOPNOTSUPP); /* do not free mbuf's */
-
- default:
- panic("udp_usrreq");
- }
-
-release:
- if (control) {
- printf("udp control data unexpectedly retained\n");
- m_freem(control);
- }
- if (m)
- m_freem(m);
- return (error);
-}
-
-static void
-udp_detach(inp)
- struct inpcb *inp;
-{
- int s = splnet();
-
- in_pcbdetach(inp);
- splx(s);
-}
diff --git a/c/src/lib/libnetworking/netinet/udp_var.h b/c/src/lib/libnetworking/netinet/udp_var.h
deleted file mode 100644
index 90785b53de..0000000000
--- a/c/src/lib/libnetworking/netinet/udp_var.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 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.
- *
- * @(#)udp_var.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_UDP_VAR_H_
-#define _NETINET_UDP_VAR_H_
-
-/*
- * UDP kernel structures and variables.
- */
-struct udpiphdr {
- struct ipovly ui_i; /* overlaid ip structure */
- struct udphdr ui_u; /* udp header */
-};
-#define ui_next ui_i.ih_next
-#define ui_prev ui_i.ih_prev
-#define ui_x1 ui_i.ih_x1
-#define ui_pr ui_i.ih_pr
-#define ui_len ui_i.ih_len
-#define ui_src ui_i.ih_src
-#define ui_dst ui_i.ih_dst
-#define ui_sport ui_u.uh_sport
-#define ui_dport ui_u.uh_dport
-#define ui_ulen ui_u.uh_ulen
-#define ui_sum ui_u.uh_sum
-
-struct udpstat {
- /* input statistics: */
- u_long udps_ipackets; /* total input packets */
- u_long udps_hdrops; /* packet shorter than header */
- u_long udps_badsum; /* checksum error */
- u_long udps_badlen; /* data length larger than packet */
- u_long udps_noport; /* no socket on port */
- u_long udps_noportbcast; /* of above, arrived as broadcast */
- u_long udps_fullsock; /* not delivered, input socket full */
- u_long udpps_pcbcachemiss; /* input packets missing pcb cache */
- u_long udpps_pcbhashmiss; /* input packets not for hashed pcb */
- /* output statistics: */
- u_long udps_opackets; /* total output packets */
-};
-
-/*
- * Names for UDP sysctl objects
- */
-#define UDPCTL_CHECKSUM 1 /* checksum UDP packets */
-#define UDPCTL_STATS 2 /* statistics (read-only) */
-#define UDPCTL_MAXDGRAM 3 /* max datagram size */
-#define UDPCTL_RECVSPACE 4 /* default receive buffer space */
-#define UDPCTL_MAXID 5
-
-#define UDPCTL_NAMES { \
- { 0, 0 }, \
- { "checksum", CTLTYPE_INT }, \
- { "stats", CTLTYPE_STRUCT }, \
- { "maxdgram", CTLTYPE_INT }, \
- { "recvspace", CTLTYPE_INT }, \
-}
-
-#ifdef KERNEL
-extern struct inpcbhead udb;
-extern struct inpcbinfo udbinfo;
-extern struct udpstat udpstat;
-
-void udp_ctlinput __P((int, struct sockaddr *, void *));
-void udp_init __P((void));
-void udp_input __P((struct mbuf *, int));
-int udp_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/nfs/Makefile.in b/c/src/lib/libnetworking/nfs/Makefile.in
deleted file mode 100644
index 404d85040a..0000000000
--- a/c/src/lib/libnetworking/nfs/Makefile.in
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=lib.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES= bootp_subr
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \
- -DDIAGNOSTIC -DBOOTP_COMPAT
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
diff --git a/c/src/lib/libnetworking/nfs/bootp_subr.c b/c/src/lib/libnetworking/nfs/bootp_subr.c
deleted file mode 100644
index cb7d3d3407..0000000000
--- a/c/src/lib/libnetworking/nfs/bootp_subr.c
+++ /dev/null
@@ -1,968 +0,0 @@
-/* $Id$ */
-
-/*
- * Copyright (c) 1995 Gordon Ross, Adam Glass
- * Copyright (c) 1992 Regents of the University of California.
- * All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * 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, Lawrence Berkeley Laboratory 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.
- *
- * based on:
- * nfs/krpc_subr.c
- * $NetBSD: krpc_subr.c,v 1.10 1995/08/08 20:43:43 gwr Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/conf.h>
-#include <sys/sockio.h>
-#include <sys/proc.h>
-#include <sys/mount.h>
-#include <sys/mbuf.h>
-#include <sys/reboot.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <net/if_types.h>
-#include <net/if_dl.h>
-#include <netinet/if_ether.h>
-
-#include <nfs/rpcv2.h>
-#include <nfs/nfsproto.h>
-#include <nfs/nfs.h>
-#include <nfs/nfsdiskless.h>
-#include <nfs/krpc.h>
-#include <nfs/xdr_subs.h>
-
-#define BOOTP_MIN_LEN 300 /* Minimum size of bootp udp packet */
-
-/*
- * What is the longest we will wait before re-sending a request?
- * Note this is also the frequency of "RPC timeout" messages.
- * The re-send loop count sup linearly to this maximum, so the
- * first complaint will happen after (1+2+3+4+5)=15 seconds.
- */
-#define MAX_RESEND_DELAY 5 /* seconds */
-
-/* Definitions from RFC951 */
-struct bootp_packet {
- u_int8_t op;
- u_int8_t htype;
- u_int8_t hlen;
- u_int8_t hops;
- u_int32_t xid;
- u_int16_t secs;
- u_int16_t flags;
- struct in_addr ciaddr;
- struct in_addr yiaddr;
- struct in_addr siaddr;
- struct in_addr giaddr;
- unsigned char chaddr[16];
- char sname[64];
- char file[128];
- unsigned char vend[256];
-};
-
-#define IPPORT_BOOTPC 68
-#define IPPORT_BOOTPS 67
-
-extern int nfs_diskless_valid;
-extern struct nfsv3_diskless nfsv3_diskless;
-
-/* mountd RPC */
-#if !defined(__rtems__)
-static int md_mount __P((struct sockaddr_in *mdsin, char *path,
- u_char *fhp, int *fhsizep, struct nfs_args *args,struct proc *procp));
-static int md_lookup_swap __P((struct sockaddr_in *mdsin,char *path,
- u_char *fhp, int *fhsizep,
- struct nfs_args *args,
- struct proc *procp));
-static int setfs __P((struct sockaddr_in *addr, char *path, char *p));
-#endif
-static int getdec __P((char **ptr));
-static char *substr __P((char *a,char *b));
-#if !defined(__rtems__)
-static void mountopts __P((struct nfs_args *args, char *p));
-static int xdr_opaque_decode __P((struct mbuf **ptr,u_char *buf,
- int len));
-static int xdr_int_decode __P((struct mbuf **ptr,int *iptr));
-#endif
-static void printip __P((char *prefix,struct in_addr addr));
-
-#ifdef BOOTP_DEBUG
-void bootpboot_p_sa(struct sockaddr *sa,struct sockaddr *ma);
-void bootpboot_p_ma(struct sockaddr *ma);
-void bootpboot_p_rtentry(struct rtentry *rt);
-void bootpboot_p_tree(struct radix_node *rn);
-void bootpboot_p_rtlist(void);
-void bootpboot_p_iflist(void);
-#endif
-
-int bootpc_call(struct bootp_packet *call,
- struct bootp_packet *reply,
- struct proc *procp);
-
-int bootpc_fakeup_interface(struct ifreq *ireq,struct socket *so,
- struct proc *procp);
-
-int
-bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
- struct sockaddr_in *myaddr,
- struct sockaddr_in *netmask,
- struct sockaddr_in *gw,
- struct proc *procp);
-
-void bootpc_init(void);
-
-#ifdef BOOTP_DEBUG
-void bootpboot_p_sa(sa,ma)
- struct sockaddr *sa;
- struct sockaddr *ma;
-{
- if (!sa) {
- printf("(sockaddr *) <null>");
- return;
- }
- switch (sa->sa_family) {
- case AF_INET:
- {
- struct sockaddr_in *sin = (struct sockaddr_in *) sa;
- printf("inet %x",ntohl(sin->sin_addr.s_addr));
- if (ma) {
- struct sockaddr_in *sin = (struct sockaddr_in *) ma;
- printf(" mask %x",ntohl(sin->sin_addr.s_addr));
- }
- }
- break;
- case AF_LINK:
- {
- struct sockaddr_dl *sli = (struct sockaddr_dl *) sa;
- int i;
- printf("link %.*s ",sli->sdl_nlen,sli->sdl_data);
- for (i=0;i<sli->sdl_alen;i++) {
- if (i>0)
- printf(":");
- printf("%x",(unsigned char) sli->sdl_data[i+sli->sdl_nlen]);
- }
- }
- break;
- default:
- printf("af%d",sa->sa_family);
- }
-}
-
-void bootpboot_p_ma(ma)
- struct sockaddr *ma;
-{
- if (!ma) {
- printf("<null>");
- return;
- }
- printf("%x",*(int*)ma);
-}
-
-void bootpboot_p_rtentry(rt)
- struct rtentry *rt;
-{
- bootpboot_p_sa(rt_key(rt),rt_mask(rt));
- printf(" ");
- bootpboot_p_ma(rt->rt_genmask);
- printf(" ");
- bootpboot_p_sa(rt->rt_gateway,NULL);
- printf(" ");
- printf("flags %x",(unsigned short) rt->rt_flags);
- printf(" %d",rt->rt_rmx.rmx_expire);
- printf(" %s%d\n",rt->rt_ifp->if_name,rt->rt_ifp->if_unit);
-}
-void bootpboot_p_tree(rn)
- struct radix_node *rn;
-{
- while (rn) {
- if (rn->rn_b < 0) {
- if (rn->rn_flags & RNF_ROOT) {
- } else {
- bootpboot_p_rtentry((struct rtentry *) rn);
- }
- rn = rn->rn_dupedkey;
- } else {
- bootpboot_p_tree(rn->rn_l);
- bootpboot_p_tree(rn->rn_r);
- return;
- }
-
- }
-}
-
-void bootpboot_p_rtlist(void)
-{
- printf("Routing table:\n");
- bootpboot_p_tree(rt_tables[AF_INET]->rnh_treetop);
-}
-
-void bootpboot_p_iflist(void)
-{
- struct ifnet *ifp;
- struct ifaddr *ifa;
- printf("Interface list:\n");
- for (ifp = TAILQ_FIRST(&ifnet); ifp != 0; ifp = TAILQ_NEXT(ifp,if_link))
- {
- for (ifa = TAILQ_FIRST(&ifp->if_addrhead) ;ifa;
- ifa=TAILQ_NEXT(ifa,ifa_link))
- if (ifa->ifa_addr->sa_family == AF_INET ) {
- printf("%s%d flags %x, addr %x, bcast %x, net %x\n",
- ifp->if_name,ifp->if_unit,
- (unsigned short) ifp->if_flags,
- ntohl(((struct sockaddr_in *) ifa->ifa_addr)->sin_addr.s_addr),
- ntohl(((struct sockaddr_in *) ifa->ifa_dstaddr)->sin_addr.s_addr),
- ntohl(((struct sockaddr_in *) ifa->ifa_netmask)->sin_addr.s_addr)
- );
- }
- }
-}
-#endif
-
-int
-bootpc_call(call,reply,procp)
- struct bootp_packet *call;
- struct bootp_packet *reply; /* output */
- struct proc *procp;
-{
- struct socket *so;
- struct sockaddr_in *sin;
- struct mbuf *m, *nam;
- struct uio auio;
- struct iovec aio;
- int error, rcvflg, timo, secs, len;
-
- /* Free at end if not null. */
- nam = NULL;
-
- /*
- * Create socket and set its recieve timeout.
- */
- if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0,procp)))
- goto out;
-
- m = m_get(M_WAIT, MT_SOOPTS);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- } else {
- struct timeval *tv;
- tv = mtod(m, struct timeval *);
- m->m_len = sizeof(*tv);
- tv->tv_sec = 1;
- tv->tv_usec = 0;
- if ((error = sosetopt(so, SOL_SOCKET, SO_RCVTIMEO, m)))
- goto out;
- }
-
- /*
- * Enable broadcast.
- */
- {
- int *on;
- m = m_get(M_WAIT, MT_SOOPTS);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- }
- on = mtod(m, int *);
- m->m_len = sizeof(*on);
- *on = 1;
- if ((error = sosetopt(so, SOL_SOCKET, SO_BROADCAST, m)))
- goto out;
- }
-
- /*
- * Bind the local endpoint to a bootp client port.
- */
- m = m_getclr(M_WAIT, MT_SONAME);
- sin = mtod(m, struct sockaddr_in *);
- sin->sin_len = m->m_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_ANY;
- sin->sin_port = htons(IPPORT_BOOTPC);
- error = sobind(so, m);
- m_freem(m);
- if (error) {
- printf("bind failed\n");
- goto out;
- }
-
- /*
- * Setup socket address for the server.
- */
- nam = m_get(M_WAIT, MT_SONAME);
- if (nam == NULL) {
- error = ENOBUFS;
- goto out;
- }
- sin = mtod(nam, struct sockaddr_in *);
- sin-> sin_len = sizeof(*sin);
- sin-> sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_BROADCAST;
- sin->sin_port = htons(IPPORT_BOOTPS);
-
- nam->m_len = sizeof(*sin);
-
- /*
- * Send it, repeatedly, until a reply is received,
- * but delay each re-send by an increasing amount.
- * If the delay hits the maximum, start complaining.
- */
- timo = 0;
- for (;;) {
- /* Send BOOTP request (or re-send). */
-
- aio.iov_base = (caddr_t) call;
- aio.iov_len = sizeof(*call);
-
- auio.uio_iov = &aio;
- auio.uio_iovcnt = 1;
- auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_rw = UIO_WRITE;
- auio.uio_offset = 0;
- auio.uio_resid = sizeof(*call);
- auio.uio_procp = procp;
-
- error = sosend(so, nam, &auio, NULL, NULL, 0);
- if (error) {
- printf("bootpc_call: sosend: %d\n", error);
- goto out;
- }
-
- /* Determine new timeout. */
- if (timo < MAX_RESEND_DELAY)
- timo++;
- else
- printf("BOOTP timeout for server 0x%x\n",
- (int)ntohl(sin->sin_addr.s_addr));
-
- /*
- * Wait for up to timo seconds for a reply.
- * The socket receive timeout was set to 1 second.
- */
- secs = timo;
- while (secs > 0) {
- aio.iov_base = (caddr_t) reply;
- aio.iov_len = sizeof(*reply);
-
- auio.uio_iov = &aio;
- auio.uio_iovcnt = 1;
- auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_rw = UIO_READ;
- auio.uio_offset = 0;
- auio.uio_resid = sizeof(*reply);
- auio.uio_procp = procp;
-
- rcvflg = 0;
- error = soreceive(so, NULL, &auio, NULL, NULL, &rcvflg);
- if (error == EWOULDBLOCK) {
- secs--;
- call->secs=htons(ntohs(call->secs)+1);
- continue;
- }
- if (error)
- goto out;
- len = sizeof(*reply) - auio.uio_resid;
-
- /* Do we have the required number of bytes ? */
- if (len < BOOTP_MIN_LEN)
- continue;
-
- /* Is it the right reply? */
- if (reply->op != 2)
- continue;
-
- if (reply->xid != call->xid)
- continue;
-
- if (reply->hlen != call->hlen)
- continue;
-
- if (bcmp(reply->chaddr,call->chaddr,call->hlen))
- continue;
-
- goto gotreply; /* break two levels */
-
- } /* while secs */
- } /* forever send/receive */
-
- error = ETIMEDOUT;
- goto out;
-
- gotreply:
- out:
- if (nam) m_freem(nam);
- soclose(so);
- return error;
-}
-
-int
-bootpc_fakeup_interface(struct ifreq *ireq,struct socket *so,
- struct proc *procp)
-{
- struct sockaddr_in *sin;
- int error;
- struct sockaddr_in dst;
- struct sockaddr_in gw;
- struct sockaddr_in mask;
-
- /*
- * Bring up the interface.
- *
- * Get the old interface flags and or IFF_UP into them; if
- * IFF_UP set blindly, interface selection can be clobbered.
- */
- error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: GIFFLAGS, error=%d", error);
- ireq->ifr_flags |= IFF_UP;
- error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: SIFFLAGS, error=%d", error);
-
- /*
- * Do enough of ifconfig(8) so that the chosen interface
- * can talk to the servers. (just set the address)
- */
-
- /* addr is 0.0.0.0 */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_ANY;
- error = ifioctl(so, SIOCSIFADDR, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: set if addr, error=%d", error);
-
- /* netmask is 0.0.0.0 */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_ANY;
- error = ifioctl(so, SIOCSIFNETMASK, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: set if net addr, error=%d", error);
-
- /* Broadcast is 255.255.255.255 */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_BROADCAST;
- error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: set if broadcast addr, error=%d", error);
-
- /* Add default route to 0.0.0.0 so we can send data */
-
- bzero((caddr_t) &dst, sizeof(dst));
- dst.sin_len=sizeof(dst);
- dst.sin_family=AF_INET;
- dst.sin_addr.s_addr = htonl(0);
-
- bzero((caddr_t) &gw, sizeof(gw));
- gw.sin_len=sizeof(gw);
- gw.sin_family=AF_INET;
- gw.sin_addr.s_addr = htonl(0x0);
-
- bzero((caddr_t) &mask, sizeof(mask));
- mask.sin_len=sizeof(mask);
- mask.sin_family=AF_INET;
- mask.sin_addr.s_addr = htonl(0);
-
- error = rtrequest(RTM_ADD,
- (struct sockaddr *) &dst,
- (struct sockaddr *) &gw,
- (struct sockaddr *) &mask,
- RTF_UP | RTF_STATIC
- , NULL);
- if (error)
- printf("bootpc_fakeup_interface: add default route, error=%d\n", error);
- return error;
-}
-
-int
-bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
- struct sockaddr_in *myaddr,
- struct sockaddr_in *netmask,
- struct sockaddr_in *gw,
- struct proc *procp)
-{
- int error;
- struct sockaddr_in oldgw;
- struct sockaddr_in olddst;
- struct sockaddr_in oldmask;
- struct sockaddr_in *sin;
-
- /* Remove old default route to 0.0.0.0 */
-
- bzero((caddr_t) &olddst, sizeof(olddst));
- olddst.sin_len=sizeof(olddst);
- olddst.sin_family=AF_INET;
- olddst.sin_addr.s_addr = INADDR_ANY;
-
- bzero((caddr_t) &oldgw, sizeof(oldgw));
- oldgw.sin_len=sizeof(oldgw);
- oldgw.sin_family=AF_INET;
- oldgw.sin_addr.s_addr = INADDR_ANY;
-
- bzero((caddr_t) &oldmask, sizeof(oldmask));
- oldmask.sin_len=sizeof(oldmask);
- oldmask.sin_family=AF_INET;
- oldmask.sin_addr.s_addr = INADDR_ANY;
-
- error = rtrequest(RTM_DELETE,
- (struct sockaddr *) &olddst,
- (struct sockaddr *) &oldgw,
- (struct sockaddr *) &oldmask,
- (RTF_UP | RTF_STATIC), NULL);
- if (error) {
- printf("nfs_boot: del default route, error=%d\n", error);
- return error;
- }
-
- /*
- * Do enough of ifconfig(8) so that the chosen interface
- * can talk to the servers. (just set the address)
- */
- bcopy(netmask,&ireq->ifr_addr,sizeof(*netmask));
- error = ifioctl(so, SIOCSIFNETMASK, (caddr_t)ireq, procp);
- if (error)
- panic("nfs_boot: set if netmask, error=%d", error);
-
- /* Broadcast is with host part of IP address all 1's */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = myaddr->sin_addr.s_addr | ~ netmask->sin_addr.s_addr;
- error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_call: set if broadcast addr, error=%d", error);
-
- bcopy(myaddr,&ireq->ifr_addr,sizeof(*myaddr));
- error = ifioctl(so, SIOCSIFADDR, (caddr_t)ireq, procp);
- if (error)
- panic("nfs_boot: set if addr, error=%d", error);
-
- /* Add new default route */
-
- error = rtrequest(RTM_ADD,
- (struct sockaddr *) &olddst,
- (struct sockaddr *) gw,
- (struct sockaddr *) &oldmask,
- (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL);
- if (error) {
- printf("nfs_boot: add net route, error=%d\n", error);
- return error;
- }
-
- return 0;
-}
-
-#if !defined(__rtems__)
-static int setfs(addr, path, p)
- struct sockaddr_in *addr;
- char *path;
- char *p;
-{
- unsigned ip = 0;
- int val;
-
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip = val << 24;
- if (*p != '.') return(0);
- p++;
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip |= (val << 16);
- if (*p != '.') return(0);
- p++;
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip |= (val << 8);
- if (*p != '.') return(0);
- p++;
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip |= val;
- if (*p != ':') return(0);
- p++;
-
- addr->sin_addr.s_addr = htonl(ip);
- addr->sin_len = sizeof(struct sockaddr_in);
- addr->sin_family = AF_INET;
-
- strncpy(path,p,MNAMELEN-1);
- return(1);
-}
-#endif
-
-static int getdec(ptr)
- char **ptr;
-{
- char *p = *ptr;
- int ret=0;
- if ((*p < '0') || (*p > '9')) return(-1);
- while ((*p >= '0') && (*p <= '9')) {
- ret = ret*10 + (*p - '0');
- p++;
- }
- *ptr = p;
- return(ret);
-}
-
-static char *substr(a,b)
- char *a,*b;
-{
- char *loc1;
- char *loc2;
-
- while (*a != '\0') {
- loc1 = a;
- loc2 = b;
- while (*loc1 == *loc2++) {
- if (*loc1 == '\0') return (0);
- loc1++;
- if (*loc2 == '\0') return (loc1);
- }
- a++;
- }
- return (0);
-}
-
-static void printip(char *prefix,struct in_addr addr)
-{
- unsigned int ip;
-
- ip = ntohl(addr.s_addr);
-
- printf("%s is %d.%d.%d.%d\n",prefix,
- ip >> 24, (ip >> 16) & 255 ,(ip >> 8) & 255 ,ip & 255 );
-}
-
-void
-bootpc_init(void)
-{
- struct bootp_packet call;
- struct bootp_packet reply;
- static u_int32_t xid = ~0xFF;
-
- struct ifreq ireq;
- struct ifnet *ifp;
- struct socket *so;
- int error;
- int code,ncode,len;
- int j;
- char *p;
- unsigned int ip;
-
- struct sockaddr_in myaddr;
- struct sockaddr_in netmask;
- struct sockaddr_in gw;
- int gotgw=0;
- int gotnetmask=0;
-#if !defined(__rtems__)
- int gotrootpath=0;
- int gotswappath=0;
-#endif
- char lookup_path[24];
-
-#define EALEN 6
-#if !defined(__rtems__)
- unsigned char ea[EALEN];
-#endif
- struct ifaddr *ifa;
- struct sockaddr_dl *sdl = NULL;
- char *delim;
- struct proc *procp = NULL;
-
- /*
- * If already filled in, don't touch it here
- */
- if (nfs_diskless_valid)
- return;
-
- /*
- * Bump time if 0.
- if (!time.tv_sec)
- time.tv_sec++;
- */
-
- /*
- * Find a network interface.
- */
- for (ifp = ifnet; ifp != 0; ifp = ifp->if_next)
- if ((ifp->if_flags &
- (IFF_LOOPBACK|IFF_POINTOPOINT)) == 0)
- break;
- if (ifp == NULL)
- panic("bootpc_init: no suitable interface");
- bzero(&ireq,sizeof(ireq));
- sprintf(ireq.ifr_name, "%s%d", ifp->if_name,ifp->if_unit);
- printf("bootpc_init: using network interface '%s'\n",
- ireq.ifr_name);
-
- if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0,procp)) != 0)
- panic("nfs_boot: socreate, error=%d", error);
-
- bootpc_fakeup_interface(&ireq,so,procp);
-
- printf("Bootpc testing starting\n");
-
- /* Get HW address */
-
- for (ifa = ifp->if_addrlist;ifa; ifa = ifa->ifa_next)
- if (ifa->ifa_addr->sa_family == AF_LINK &&
- (sdl = ((struct sockaddr_dl *) ifa->ifa_addr)) &&
- sdl->sdl_type == IFT_ETHER)
- break;
-
- if (!sdl)
- panic("bootpc: Unable to find HW address");
- if (sdl->sdl_alen != EALEN )
- panic("bootpc: HW address len is %d, expected value is %d",
- sdl->sdl_alen,EALEN);
-
- printf("bootpc hw address is ");
- delim="";
- for (j=0;j<sdl->sdl_alen;j++) {
- printf("%s%x",delim,((unsigned char *)LLADDR(sdl))[j]);
- delim=":";
- }
- printf("\n");
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
-
- bzero((caddr_t) &call, sizeof(call));
-
- /* bootpc part */
- call.op = 1; /* BOOTREQUEST */
- call.htype= 1; /* 10mb ethernet */
- call.hlen=sdl->sdl_alen; /* Hardware address length */
- call.hops=0;
- xid++;
- call.xid = txdr_unsigned(xid);
- bcopy(LLADDR(sdl),&call.chaddr,sdl->sdl_alen);
-
- call.vend[0]=99;
- call.vend[1]=130;
- call.vend[2]=83;
- call.vend[3]=99;
- call.vend[4]=255;
-
- call.secs = 0;
- call.flags = htons(0x8000); /* We need an broadcast answer */
-
- error = bootpc_call(&call,&reply,procp);
-
- if (error)
- panic("BOOTP call failed -- error %d", error);
-
- bzero(&myaddr,sizeof(myaddr));
- bzero(&netmask,sizeof(netmask));
- bzero(&gw,sizeof(gw));
-
- myaddr.sin_len = sizeof(myaddr);
- myaddr.sin_family = AF_INET;
-
- netmask.sin_len = sizeof(netmask);
- netmask.sin_family = AF_INET;
-
- gw.sin_len = sizeof(gw);
- gw.sin_family= AF_INET;
-
- rtems_bsdnet_bootp_server_address = reply.siaddr;
- rtems_bsdnet_log_host_address = reply.siaddr;
-
- myaddr.sin_addr = reply.yiaddr;
-
- ip = ntohl(myaddr.sin_addr.s_addr);
- sprintf(lookup_path,"swap.%d.%d.%d.%d",
- ip >> 24, (ip >> 16) & 255 ,(ip >> 8) & 255 ,ip & 255 );
-
- printip("My ip address",myaddr.sin_addr);
-
- printip("Server ip address",reply.siaddr);
-
- gw.sin_addr = reply.giaddr;
- printip("Gateway ip address",reply.giaddr);
-
- if (reply.sname[0])
- printf("Server name is %s\n",reply.sname);
- if (reply.file[0])
- printf("boot file is %s\n",reply.file);
- rtems_bsdnet_bootp_boot_file_name = strdup (reply.file);
- if (reply.vend[0]==99 && reply.vend[1]==130 &&
- reply.vend[2]==83 && reply.vend[3]==99) {
- j=4;
- ncode = reply.vend[j];
- while (j<sizeof(reply.vend)) {
- code = reply.vend[j] = ncode;
- if (code==255)
- break;
- if (code==0) {
- j++;
- continue;
- }
- len = reply.vend[j+1];
- j+=2;
- if (len+j>=sizeof(reply.vend)) {
- printf("Truncated field");
- break;
- }
- ncode = reply.vend[j+len];
- reply.vend[j+len]='\0';
- p = &reply.vend[j];
- switch (code) {
- case 1:
- if (len!=4)
- panic("bootpc: subnet mask len is %d",len);
- bcopy(&reply.vend[j],&netmask.sin_addr,4);
- gotnetmask=1;
- printip("Subnet mask",netmask.sin_addr);
- break;
- case 6:
- /* Domain Name servers */
- if (len % 4)
- panic("bootpc: DNS Len is %d",len);
- {
- int dlen = 0;
- while ((dlen < len) &&
- (rtems_bsdnet_nameserver_count < sizeof rtems_bsdnet_config.name_server /
- sizeof rtems_bsdnet_config.name_server[0])) {
- bcopy(&reply.vend[j+dlen],
- &rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count],
- 4);
- printip("Domain Name Server",
- rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count]);
- rtems_bsdnet_nameserver_count++;
- dlen += 4;
- }
- }
- break;
- case 16: /* Swap server IP address. unused */
- case 2:
- /* Time offset */
- break;
- case 3:
- /* Routers */
- if (len % 4)
- panic("bootpc: Router Len is %d",len);
- if (len > 0) {
- bcopy(&reply.vend[j],&gw.sin_addr,4);
- printip("Router",gw.sin_addr);
- gotgw=1;
- }
- break;
- case 7:
- /* Log servers */
- if (len % 4)
- panic("bootpc: Log server len is %d",len);
- if (len > 0) {
- bcopy(&reply.vend[j],&rtems_bsdnet_log_host_address,4);
- printip("Log server",rtems_bsdnet_log_host_address);
- }
- break;
- case 12:
- if (len>=MAXHOSTNAMELEN)
- panic("bootpc: hostname >=%d bytes",MAXHOSTNAMELEN);
- if (sethostname (&reply.vend[j], len) < 0)
- panic("Can't set host name");
- printf("Hostname is %.*s\n",len,&reply.vend[j]);
- break;
- case 15:
- /* Domain name */
- rtems_bsdnet_domain_name = strdup (&reply.vend[j]);
- if (rtems_bsdnet_domain_name)
- printf("Domain name is %s\n", rtems_bsdnet_domain_name);
- break;
- default:
- printf("Ignoring field type %d\n",code);
- }
- j+=len;
- }
- }
-
- if (!gotnetmask) {
- if (IN_CLASSA(ntohl(myaddr.sin_addr.s_addr)))
- netmask.sin_addr.s_addr = htonl(IN_CLASSA_NET);
- else if (IN_CLASSB(ntohl(myaddr.sin_addr.s_addr)))
- netmask.sin_addr.s_addr = htonl(IN_CLASSB_NET);
- else
- netmask.sin_addr.s_addr = htonl(IN_CLASSC_NET);
- }
- if (!gotgw) {
- /* Use proxyarp */
- gw.sin_addr.s_addr = myaddr.sin_addr.s_addr;
- }
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
- error = bootpc_adjust_interface(&ireq,so,
- &myaddr,&netmask,&gw,procp);
-
- soclose(so);
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
-
-
-#if 0
- myaddr.sin_addr.s_addr | ~ netmask.sin_addr.s_addr;
-#endif
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
- return;
-}
diff --git a/c/src/lib/libnetworking/nfs/krpc.h b/c/src/lib/libnetworking/nfs/krpc.h
deleted file mode 100644
index 8a21392657..0000000000
--- a/c/src/lib/libnetworking/nfs/krpc.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* $NetBSD: krpc.h,v 1.4 1995/12/19 23:07:11 cgd Exp $ */
-/* $Id$ */
-
-#include <sys/cdefs.h>
-
-int krpc_call __P((struct sockaddr_in *sin,
- u_int prog, u_int vers, u_int func,
- struct mbuf **data, struct mbuf **from, struct proc *procp));
-
-int krpc_portmap __P((struct sockaddr_in *sin,
- u_int prog, u_int vers, u_int16_t *portp, struct proc *procp));
-
-struct mbuf *xdr_string_encode __P((char *str, int len));
-
-/*
- * RPC definitions for the portmapper
- */
-#define PMAPPORT 111
-#define PMAPPROG 100000
-#define PMAPVERS 2
-#define PMAPPROC_NULL 0
-#define PMAPPROC_SET 1
-#define PMAPPROC_UNSET 2
-#define PMAPPROC_GETPORT 3
-#define PMAPPROC_DUMP 4
-#define PMAPPROC_CALLIT 5
diff --git a/c/src/lib/libnetworking/nfs/nfs.h b/c/src/lib/libnetworking/nfs/nfs.h
deleted file mode 100644
index 68f206e213..0000000000
--- a/c/src/lib/libnetworking/nfs/nfs.h
+++ /dev/null
@@ -1,620 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)nfs.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_NFS_H_
-#define _NFS_NFS_H_
-
-#include <nfs/rpcv2.h>
-
-/*
- * Tunable constants for nfs
- */
-
-#define NFS_MAXIOVEC 34
-#define NFS_TICKINTVL 5 /* Desired time for a tick (msec) */
-#define NFS_HZ (hz / nfs_ticks) /* Ticks/sec */
-#define NFS_TIMEO (1 * NFS_HZ) /* Default timeout = 1 second */
-#define NFS_MINTIMEO (1 * NFS_HZ) /* Min timeout to use */
-#define NFS_MAXTIMEO (60 * NFS_HZ) /* Max timeout to backoff to */
-#define NFS_MINIDEMTIMEO (5 * NFS_HZ) /* Min timeout for non-idempotent ops*/
-#define NFS_MAXREXMIT 100 /* Stop counting after this many */
-#define NFS_MAXWINDOW 1024 /* Max number of outstanding requests */
-#define NFS_RETRANS 10 /* Num of retrans for soft mounts */
-#define NFS_MAXGRPS 16 /* Max. size of groups list */
-#ifndef NFS_MINATTRTIMO
-#define NFS_MINATTRTIMO 5 /* Attribute cache timeout in sec */
-#endif
-#ifndef NFS_MAXATTRTIMO
-#define NFS_MAXATTRTIMO 60
-#endif
-#define NFS_WSIZE 8192 /* Def. write data size <= 8192 */
-#define NFS_RSIZE 8192 /* Def. read data size <= 8192 */
-#define NFS_READDIRSIZE 8192 /* Def. readdir size */
-#define NFS_DEFRAHEAD 1 /* Def. read ahead # blocks */
-#define NFS_MAXRAHEAD 4 /* Max. read ahead # blocks */
-#define NFS_MAXUIDHASH 64 /* Max. # of hashed uid entries/mp */
-#define NFS_MAXASYNCDAEMON 20 /* Max. number async_daemons runnable */
-#define NFS_MAXGATHERDELAY 100 /* Max. write gather delay (msec) */
-#ifndef NFS_GATHERDELAY
-#define NFS_GATHERDELAY 10 /* Default write gather delay (msec) */
-#endif
-#define NFS_DIRBLKSIZ 4096 /* Must be a multiple of DIRBLKSIZ */
-
-/*
- * Oddballs
- */
-#define NMOD(a) ((a) % nfs_asyncdaemons)
-#define NFS_CMPFH(n, f, s) \
- ((n)->n_fhsize == (s) && !bcmp((caddr_t)(n)->n_fhp, (caddr_t)(f), (s)))
-#define NFS_ISV3(v) (VFSTONFS((v)->v_mount)->nm_flag & NFSMNT_NFSV3)
-#define NFS_SRVMAXDATA(n) \
- (((n)->nd_flag & ND_NFSV3) ? (((n)->nd_nam2) ? \
- NFS_MAXDGRAMDATA : NFS_MAXDATA) : NFS_V2MAXDATA)
-
-/*
- * XXX
- * sys/buf.h should be edited to change B_APPENDWRITE --> B_NEEDCOMMIT, but
- * until then...
- * Same goes for sys/malloc.h, which needs M_NFSDIROFF,
- * M_NFSRVDESC and M_NFSBIGFH added.
- * The VA_EXCLUSIVE flag should be added for va_vaflags and set for an
- * exclusive create.
- * The B_INVAFTERWRITE flag should be set to whatever is required by the
- * buffer cache code to say "Invalidate the block after it is written back".
- */
-#ifndef B_NEEDCOMMIT
-#define B_NEEDCOMMIT B_APPENDWRITE
-#endif
-#ifndef M_NFSRVDESC
-#define M_NFSRVDESC M_TEMP
-#endif
-#ifndef M_NFSDIROFF
-#define M_NFSDIROFF M_TEMP
-#endif
-#ifndef M_NFSBIGFH
-#define M_NFSBIGFH M_TEMP
-#endif
-#ifndef VA_EXCLUSIVE
-#define VA_EXCLUSIVE 0
-#endif
-#ifdef __FreeBSD__
-#define B_INVAFTERWRITE B_NOCACHE
-#else
-#define B_INVAFTERWRITE B_INVAL
-#endif
-
-/*
- * These ifdefs try to handle the differences between the various 4.4BSD-Lite
- * based vfs interfaces.
- * btw: NetBSD-current does have a VOP_LEASDE(), but I don't know how to
- * differentiate between NetBSD-1.0 and NetBSD-current, so..
- * I also don't know about BSDi's 2.0 release.
- */
-#if !defined(HAS_VOPLEASE) && !defined(__FreeBSD__) && !defined(__NetBSD__)
-#define HAS_VOPLEASE 1
-#endif
-#if !defined(HAS_VOPREVOKE) && !defined(__FreeBSD__) && !defined(__NetBSD__)
-#define HAS_VOPREVOKE 1
-#endif
-
-/*
- * The IO_METASYNC flag should be implemented for local file systems.
- * (Until then, it is nothin at all.)
- */
-#ifndef IO_METASYNC
-#define IO_METASYNC 0
-#endif
-
-/*
- * Set the attribute timeout based on how recently the file has been modified.
- */
-#define NFS_ATTRTIMEO(np) \
- ((((np)->n_flag & NMODIFIED) || \
- (time.tv_sec - (np)->n_mtime) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \
- ((time.tv_sec - (np)->n_mtime) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \
- (time.tv_sec - (np)->n_mtime) / 10))
-
-/*
- * Expected allocation sizes for major data structures. If the actual size
- * of the structure exceeds these sizes, then malloc() will be allocating
- * almost twice the memory required. This is used in nfs_init() to warn
- * the sysadmin that the size of a structure should be reduced.
- * (These sizes are always a power of 2. If the kernel malloc() changes
- * to one that does not allocate space in powers of 2 size, then this all
- * becomes bunk!)
- */
-#define NFS_NODEALLOC 256
-#define NFS_MNTALLOC 512
-#define NFS_SVCALLOC 256
-#define NFS_UIDALLOC 128
-
-/*
- * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs
- * should ever try and use it.
- */
-struct nfsd_args {
- int sock; /* Socket to serve */
- caddr_t name; /* Client address for connection based sockets */
- int namelen; /* Length of name */
-};
-
-struct nfsd_srvargs {
- struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */
- uid_t nsd_uid; /* Effective uid mapped to cred */
- u_long nsd_haddr; /* Ip address of client */
- struct ucred nsd_cr; /* Cred. uid maps to */
- int nsd_authlen; /* Length of auth string (ret) */
- u_char *nsd_authstr; /* Auth string (ret) */
- int nsd_verflen; /* and the verfier */
- u_char *nsd_verfstr;
- struct timeval nsd_timestamp; /* timestamp from verifier */
- u_long nsd_ttl; /* credential ttl (sec) */
- NFSKERBKEY_T nsd_key; /* Session key */
-};
-
-struct nfsd_cargs {
- char *ncd_dirp; /* Mount dir path */
- uid_t ncd_authuid; /* Effective uid */
- int ncd_authtype; /* Type of authenticator */
- int ncd_authlen; /* Length of authenticator string */
- u_char *ncd_authstr; /* Authenticator string */
- int ncd_verflen; /* and the verifier */
- u_char *ncd_verfstr;
- NFSKERBKEY_T ncd_key; /* Session key */
-};
-
-/*
- * Stats structure
- */
-struct nfsstats {
- int attrcache_hits;
- int attrcache_misses;
- int lookupcache_hits;
- int lookupcache_misses;
- int direofcache_hits;
- int direofcache_misses;
- int biocache_reads;
- int read_bios;
- int read_physios;
- int biocache_writes;
- int write_bios;
- int write_physios;
- int biocache_readlinks;
- int readlink_bios;
- int biocache_readdirs;
- int readdir_bios;
- int rpccnt[NFS_NPROCS];
- int rpcretries;
- int srvrpccnt[NFS_NPROCS];
- int srvrpc_errs;
- int srv_errs;
- int rpcrequests;
- int rpctimeouts;
- int rpcunexpected;
- int rpcinvalid;
- int srvcache_inproghits;
- int srvcache_idemdonehits;
- int srvcache_nonidemdonehits;
- int srvcache_misses;
- int srvnqnfs_leases;
- int srvnqnfs_maxleases;
- int srvnqnfs_getleases;
- int srvvop_writes;
-};
-
-/*
- * Flags for nfssvc() system call.
- */
-#define NFSSVC_BIOD 0x002
-#define NFSSVC_NFSD 0x004
-#define NFSSVC_ADDSOCK 0x008
-#define NFSSVC_AUTHIN 0x010
-#define NFSSVC_GOTAUTH 0x040
-#define NFSSVC_AUTHINFAIL 0x080
-#define NFSSVC_MNTD 0x100
-
-/*
- * fs.nfs sysctl(3) identifiers
- */
-#define NFS_NFSSTATS 1 /* struct: struct nfsstats */
-#define NFS_NFSPRIVPORT 2 /* int: prohibit nfs to resvports */
-
-#define FS_NFS_NAMES { \
- { 0, 0 }, \
- { "nfsstats", CTLTYPE_STRUCT }, \
- { "nfsprivport", CTLTYPE_INT }, \
-}
-
-/*
- * The set of signals the interrupt an I/O in progress for NFSMNT_INT mounts.
- * What should be in this set is open to debate, but I believe that since
- * I/O system calls on ufs are never interrupted by signals the set should
- * be minimal. My reasoning is that many current programs that use signals
- * such as SIGALRM will not expect file I/O system calls to be interrupted
- * by them and break.
- */
-#if defined(KERNEL) || defined(_KERNEL)
-
-struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
-
-#define NFSINT_SIGMASK (sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGKILL)| \
- sigmask(SIGHUP)|sigmask(SIGQUIT))
-
-/*
- * Socket errors ignored for connectionless sockets??
- * For now, ignore them all
- */
-#define NFSIGNORE_SOERROR(s, e) \
- ((e) != EINTR && (e) != ERESTART && (e) != EWOULDBLOCK && \
- ((s) & PR_CONNREQUIRED) == 0)
-
-/*
- * Nfs outstanding request list element
- */
-struct nfsreq {
- TAILQ_ENTRY(nfsreq) r_chain;
- struct mbuf *r_mreq;
- struct mbuf *r_mrep;
- struct mbuf *r_md;
- caddr_t r_dpos;
- struct nfsmount *r_nmp;
- struct vnode *r_vp;
- u_long r_xid;
- int r_flags; /* flags on request, see below */
- int r_retry; /* max retransmission count */
- int r_rexmit; /* current retrans count */
- int r_timer; /* tick counter on reply */
- int r_procnum; /* NFS procedure number */
- int r_rtt; /* RTT for rpc */
- struct proc *r_procp; /* Proc that did I/O system call */
-};
-
-/*
- * Queue head for nfsreq's
- */
-extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
-
-/* Flag values for r_flags */
-#define R_TIMING 0x01 /* timing request (in mntp) */
-#define R_SENT 0x02 /* request has been sent */
-#define R_SOFTTERM 0x04 /* soft mnt, too many retries */
-#define R_INTR 0x08 /* intr mnt, signal pending */
-#define R_SOCKERR 0x10 /* Fatal error on socket */
-#define R_TPRINTFMSG 0x20 /* Did a tprintf msg. */
-#define R_MUSTRESEND 0x40 /* Must resend request */
-#define R_GETONEREP 0x80 /* Probe for one reply only */
-
-/*
- * A list of nfssvc_sock structures is maintained with all the sockets
- * that require service by the nfsd.
- * The nfsuid structs hang off of the nfssvc_sock structs in both lru
- * and uid hash lists.
- */
-#ifndef NFS_UIDHASHSIZ
-#define NFS_UIDHASHSIZ 29 /* Tune the size of nfssvc_sock with this */
-#endif
-#define NUIDHASH(sock, uid) \
- (&(sock)->ns_uidhashtbl[(uid) % NFS_UIDHASHSIZ])
-#ifndef NFS_WDELAYHASHSIZ
-#define NFS_WDELAYHASHSIZ 16 /* and with this */
-#endif
-#define NWDELAYHASH(sock, f) \
- (&(sock)->ns_wdelayhashtbl[(*((u_long *)(f))) % NFS_WDELAYHASHSIZ])
-#ifndef NFS_MUIDHASHSIZ
-#define NFS_MUIDHASHSIZ 63 /* Tune the size of nfsmount with this */
-#endif
-#define NMUIDHASH(nmp, uid) \
- (&(nmp)->nm_uidhashtbl[(uid) % NFS_MUIDHASHSIZ])
-#define NFSNOHASH(fhsum) \
- (&nfsnodehashtbl[(fhsum) & nfsnodehash])
-
-/*
- * Network address hash list element
- */
-union nethostaddr {
- u_long had_inetaddr;
- struct mbuf *had_nam;
-};
-
-struct nfsuid {
- TAILQ_ENTRY(nfsuid) nu_lru; /* LRU chain */
- LIST_ENTRY(nfsuid) nu_hash; /* Hash list */
- int nu_flag; /* Flags */
- union nethostaddr nu_haddr; /* Host addr. for dgram sockets */
- struct ucred nu_cr; /* Cred uid mapped to */
- int nu_expire; /* Expiry time (sec) */
- struct timeval nu_timestamp; /* Kerb. timestamp */
- u_long nu_nickname; /* Nickname on server */
- NFSKERBKEY_T nu_key; /* and session key */
-};
-
-#define nu_inetaddr nu_haddr.had_inetaddr
-#define nu_nam nu_haddr.had_nam
-/* Bits for nu_flag */
-#define NU_INETADDR 0x1
-#define NU_NAM 0x2
-#define NU_NETFAM(u) (((u)->nu_flag & NU_INETADDR) ? AF_INET : AF_ISO)
-
-struct nfssvc_sock {
- TAILQ_ENTRY(nfssvc_sock) ns_chain; /* List of all nfssvc_sock's */
- TAILQ_HEAD(, nfsuid) ns_uidlruhead;
- struct file *ns_fp;
- struct socket *ns_so;
- struct mbuf *ns_nam;
- struct mbuf *ns_raw;
- struct mbuf *ns_rawend;
- struct mbuf *ns_rec;
- struct mbuf *ns_recend;
- struct mbuf *ns_frag;
- int ns_flag;
- int ns_solock;
- int ns_cc;
- int ns_reclen;
- int ns_numuids;
- u_long ns_sref;
- LIST_HEAD(, nfsrv_descript) ns_tq; /* Write gather lists */
- LIST_HEAD(, nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ];
- LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ];
-};
-
-/* Bits for "ns_flag" */
-#define SLP_VALID 0x01
-#define SLP_DOREC 0x02
-#define SLP_NEEDQ 0x04
-#define SLP_DISCONN 0x08
-#define SLP_GETSTREAM 0x10
-#define SLP_LASTFRAG 0x20
-#define SLP_ALLFLAGS 0xff
-
-extern TAILQ_HEAD(nfssvc_sockhead, nfssvc_sock) nfssvc_sockhead;
-extern int nfssvc_sockhead_flag;
-#define SLP_INIT 0x01
-#define SLP_WANTINIT 0x02
-
-/*
- * One of these structures is allocated for each nfsd.
- */
-struct nfsd {
- TAILQ_ENTRY(nfsd) nfsd_chain; /* List of all nfsd's */
- int nfsd_flag; /* NFSD_ flags */
- struct nfssvc_sock *nfsd_slp; /* Current socket */
- int nfsd_authlen; /* Authenticator len */
- u_char nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */
- int nfsd_verflen; /* and the Verifier */
- u_char nfsd_verfstr[RPCVERF_MAXSIZ];
- struct proc *nfsd_procp; /* Proc ptr */
- struct nfsrv_descript *nfsd_nd; /* Associated nfsrv_descript */
-};
-
-/* Bits for "nfsd_flag" */
-#define NFSD_WAITING 0x01
-#define NFSD_REQINPROG 0x02
-#define NFSD_NEEDAUTH 0x04
-#define NFSD_AUTHFAIL 0x08
-
-/*
- * This structure is used by the server for describing each request.
- * Some fields are used only when write request gathering is performed.
- */
-struct nfsrv_descript {
- u_quad_t nd_time; /* Write deadline (usec) */
- off_t nd_off; /* Start byte offset */
- off_t nd_eoff; /* and end byte offset */
- LIST_ENTRY(nfsrv_descript) nd_hash; /* Hash list */
- LIST_ENTRY(nfsrv_descript) nd_tq; /* and timer list */
- LIST_HEAD(,nfsrv_descript) nd_coalesce; /* coalesced writes */
- struct mbuf *nd_mrep; /* Request mbuf list */
- struct mbuf *nd_md; /* Current dissect mbuf */
- struct mbuf *nd_mreq; /* Reply mbuf list */
- struct mbuf *nd_nam; /* and socket addr */
- struct mbuf *nd_nam2; /* return socket addr */
- caddr_t nd_dpos; /* Current dissect pos */
- int nd_procnum; /* RPC # */
- int nd_stable; /* storage type */
- int nd_flag; /* nd_flag */
- int nd_len; /* Length of this write */
- int nd_repstat; /* Reply status */
- u_long nd_retxid; /* Reply xid */
- u_long nd_duration; /* Lease duration */
- struct timeval nd_starttime; /* Time RPC initiated */
- fhandle_t nd_fh; /* File handle */
- struct ucred nd_cr; /* Credentials */
-};
-
-/* Bits for "nd_flag" */
-#define ND_READ LEASE_READ
-#define ND_WRITE LEASE_WRITE
-#define ND_CHECK 0x04
-#define ND_LEASE (ND_READ | ND_WRITE | ND_CHECK)
-#define ND_NFSV3 0x08
-#define ND_NQNFS 0x10
-#define ND_KERBNICK 0x20
-#define ND_KERBFULL 0x40
-#define ND_KERBAUTH (ND_KERBNICK | ND_KERBFULL)
-
-extern TAILQ_HEAD(nfsd_head, nfsd) nfsd_head;
-extern int nfsd_head_flag;
-#define NFSD_CHECKSLP 0x01
-
-/*
- * These macros compare nfsrv_descript structures.
- */
-#define NFSW_CONTIG(o, n) \
- ((o)->nd_eoff >= (n)->nd_off && \
- !bcmp((caddr_t)&(o)->nd_fh, (caddr_t)&(n)->nd_fh, NFSX_V3FH))
-
-#define NFSW_SAMECRED(o, n) \
- (((o)->nd_flag & ND_KERBAUTH) == ((n)->nd_flag & ND_KERBAUTH) && \
- !bcmp((caddr_t)&(o)->nd_cr, (caddr_t)&(n)->nd_cr, \
- sizeof (struct ucred)))
-
-int nfs_reply __P((struct nfsreq *));
-int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
-int nfs_send __P((struct socket *,struct mbuf *,struct mbuf *,struct nfsreq *));
-int nfs_rephead __P((int,struct nfsrv_descript *,struct nfssvc_sock *,int,int,u_quad_t *,struct mbuf **,struct mbuf **,caddr_t *));
-int nfs_sndlock __P((int *,struct nfsreq *));
-void nfs_sndunlock __P((int *flagp));
-int nfs_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *));
-int nfs_vinvalbuf __P((struct vnode *,int,struct ucred *,struct proc *,int));
-int nfs_readrpc __P((struct vnode *,struct uio *,struct ucred *));
-int nfs_writerpc __P((struct vnode *,struct uio *,struct ucred *,int *,int *));
-int nfs_readdirrpc __P((register struct vnode *,struct uio *,struct ucred *));
-int nfs_asyncio __P((struct buf *,struct ucred *));
-int nfs_doio __P((struct buf *,struct ucred *,struct proc *));
-int nfs_readlinkrpc __P((struct vnode *,struct uio *,struct ucred *));
-int nfs_sigintr __P((struct nfsmount *,struct nfsreq *r,struct proc *));
-int nfs_readdirplusrpc __P((struct vnode *,register struct uio *,struct ucred *));
-int nfsm_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *));
-void nfsm_srvfattr __P((struct nfsrv_descript *,struct vattr *,struct nfs_fattr *));
-void nfsm_srvwcc __P((struct nfsrv_descript *,int,struct vattr *,int,struct vattr *,struct mbuf **,char **));
-void nfsm_srvpostopattr __P((struct nfsrv_descript *,int,struct vattr *,struct mbuf **,char **));
-int netaddr_match __P((int,union nethostaddr *,struct mbuf *));
-int nfs_request __P((struct vnode *,struct mbuf *,int,struct proc *,struct ucred *,struct mbuf **,struct mbuf **,caddr_t *));
-int nfs_loadattrcache __P((struct vnode **,struct mbuf **,caddr_t *,struct vattr *));
-int nfs_namei __P((struct nameidata *,fhandle_t *,int,struct nfssvc_sock *,struct mbuf *,struct mbuf **,caddr_t *,struct vnode **,struct proc *,int));
-void nfsm_adj __P((struct mbuf *,int,int));
-int nfsm_mbuftouio __P((struct mbuf **,struct uio *,int,caddr_t *));
-void nfsrv_initcache __P((void));
-int nfs_getauth __P((struct nfsmount *,struct nfsreq *,struct ucred *,char **,int *,char *,int *,NFSKERBKEY_T));
-int nfs_getnickauth __P((struct nfsmount *,struct ucred *,char **,int *,char *,int));
-int nfs_savenickauth __P((struct nfsmount *,struct ucred *,int,NFSKERBKEY_T,struct mbuf **,char **,struct mbuf *));
-int nfs_adv __P((struct mbuf **,caddr_t *,int,int));
-void nfs_nhinit __P((void));
-void nfs_timer __P((void*));
-u_long nfs_hash __P((nfsfh_t *,int));
-void nfsrv_slpderef __P((struct nfssvc_sock *slp));
-int nfsrv_dorec __P((struct nfssvc_sock *,struct nfsd *,struct nfsrv_descript **));
-void nfsrv_cleancache __P((void));
-int nfsrv_getcache __P((struct nfsrv_descript *,struct nfssvc_sock *,struct mbuf **));
-int nfs_init __P((void));
-void nfsrv_updatecache __P((struct nfsrv_descript *,int,struct mbuf *));
-int nfs_connect __P((struct nfsmount *,struct nfsreq *));
-void nfs_disconnect __P((struct nfsmount *nmp));
-int nfs_getattrcache __P((struct vnode *,struct vattr *));
-int nfsm_strtmbuf __P((struct mbuf **,char **,char *,long));
-int nfs_bioread __P((struct vnode *,struct uio *,int,struct ucred *, int getpages));
-int nfsm_uiotombuf __P((struct uio *,struct mbuf **,int,caddr_t *));
-void nfsrv_init __P((int));
-void nfs_clearcommit __P((struct mount *));
-int nfsrv_errmap __P((struct nfsrv_descript *, int));
-void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag));
-void nfsrvw_sort __P((gid_t [],int));
-void nfsrv_setcred __P((struct ucred *,struct ucred *));
-int nfs_writebp __P((struct buf *,int));
-int nfsrv_object_create __P(( struct vnode * ));
-void nfsrv_wakenfsd __P((struct nfssvc_sock *slp));
-int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *,
- struct proc *, struct mbuf **));
-int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *,
- struct proc *p));
-
-int nfsrv3_access __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **,
- struct ucred *,struct nfssvc_sock *,struct mbuf *,
- int *,int));
-int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_link __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_lookup __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_mkdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_mknod __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_noop __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_null __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_pathconf __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_read __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_readdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_readdirplus __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_readlink __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_remove __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_rename __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_rmdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_setattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_statfs __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_symlink __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-
-#ifdef NFS_DEBUG
-
-extern int nfs_debug;
-#define NFS_DEBUG_ASYNCIO 1 /* asynchronous i/o */
-#define NFS_DEBUG_WG 2 /* server write gathering */
-#define NFS_DEBUG_RC 4 /* server request caching */
-
-#define NFS_DPF(cat, args) \
- do { \
- if (nfs_debug & NFS_DEBUG_##cat) printf args; \
- } while (0)
-
-#else
-
-#define NFS_DPF(cat, args)
-
-#endif
-
-#endif /* KERNEL */
-
-#endif
diff --git a/c/src/lib/libnetworking/nfs/nfsdiskless.h b/c/src/lib/libnetworking/nfs/nfsdiskless.h
deleted file mode 100644
index 0ed5c8f6f7..0000000000
--- a/c/src/lib/libnetworking/nfs/nfsdiskless.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)nfsdiskless.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_NFSDISKLESS_H_
-#define _NFS_NFSDISKLESS_H_
-
-/*
- * Structure that must be initialized for a diskless nfs client.
- * This structure is used by nfs_mountroot() to set up the root and swap
- * vnodes plus do a partial ifconfig(8) and route(8) so that the critical net
- * interface can communicate with the server.
- * The primary bootstrap is expected to fill in the appropriate fields before
- * starting the kernel. Whether or not the swap area is nfs mounted is determined
- * by the value in swdevt[0]. (equal to NODEV --> swap over nfs)
- * Currently only works for AF_INET protocols.
- * NB: All fields are stored in net byte order to avoid hassles with
- * client/server byte ordering differences.
- */
-
-/*
- * I have defined a new structure that can handle an NFS Version 3 file handle
- * but the kernel still expects the old Version 2 one to be provided. The
- * changes required in nfs_vfsops.c for using the new are documented there in
- * comments. (I felt that breaking network booting code by changing this
- * structure would not be prudent at this time, since almost all servers are
- * still Version 2 anyhow.)
- */
-struct nfsv3_diskless {
- struct ifaliasreq myif; /* Default interface */
- struct sockaddr_in mygateway; /* Default gateway */
- struct nfs_args swap_args; /* Mount args for swap file */
- int swap_fhsize; /* Size of file handle */
- u_char swap_fh[NFSX_V3FHMAX]; /* Swap file's file handle */
- struct sockaddr_in swap_saddr; /* Address of swap server */
- char swap_hostnam[MNAMELEN]; /* Host name for mount pt */
- int swap_nblks; /* Size of server swap file */
- struct ucred swap_ucred; /* Swap credentials */
- struct nfs_args root_args; /* Mount args for root fs */
- int root_fhsize; /* Size of root file handle */
- u_char root_fh[NFSX_V3FHMAX]; /* File handle of root dir */
- struct sockaddr_in root_saddr; /* Address of root server */
- char root_hostnam[MNAMELEN]; /* Host name for mount pt */
- long root_time; /* Timestamp of root fs */
- char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */
-};
-
-struct nfs_diskless {
- struct ifaliasreq myif; /* Default interface */
- struct sockaddr_in mygateway; /* Default gateway */
- struct nfs_args swap_args; /* Mount args for swap file */
- u_char swap_fh[NFSX_V2FH]; /* Swap file's file handle */
- struct sockaddr_in swap_saddr; /* Address of swap server */
- char swap_hostnam[MNAMELEN]; /* Host name for mount pt */
- int swap_nblks; /* Size of server swap file */
- struct ucred swap_ucred; /* Swap credentials */
- struct nfs_args root_args; /* Mount args for root fs */
- u_char root_fh[NFSX_V2FH]; /* File handle of root dir */
- struct sockaddr_in root_saddr; /* Address of root server */
- char root_hostnam[MNAMELEN]; /* Host name for mount pt */
- long root_time; /* Timestamp of root fs */
- char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */
-};
-
-#endif
diff --git a/c/src/lib/libnetworking/nfs/nfsproto.h b/c/src/lib/libnetworking/nfs/nfsproto.h
deleted file mode 100644
index 6ce7c5b960..0000000000
--- a/c/src/lib/libnetworking/nfs/nfsproto.h
+++ /dev/null
@@ -1,441 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)nfsproto.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_NFSPROTO_H_
-#define _NFS_NFSPROTO_H_
-
-/*
- * nfs definitions as per the Version 2 and 3 specs
- */
-
-/*
- * Constants as defined in the Sun NFS Version 2 and 3 specs.
- * "NFS: Network File System Protocol Specification" RFC1094
- * and in the "NFS: Network File System Version 3 Protocol
- * Specification"
- */
-
-#define NFS_PORT 2049
-#define NFS_PROG 100003
-#define NFS_VER2 2
-#define NFS_VER3 3
-#define NFS_V2MAXDATA 8192
-#define NFS_MAXDGRAMDATA 16384
-#define NFS_MAXDATA 32768
-#define NFS_MAXPATHLEN 1024
-#define NFS_MAXNAMLEN 255
-#define NFS_MAXPKTHDR 404
-#define NFS_MAXPACKET (NFS_MAXPKTHDR + NFS_MAXDATA)
-#define NFS_MINPACKET 20
-#define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */
-
-/* Stat numbers for rpc returns (version 2 and 3) */
-#define NFS_OK 0
-#define NFSERR_PERM 1
-#define NFSERR_NOENT 2
-#define NFSERR_IO 5
-#define NFSERR_NXIO 6
-#define NFSERR_ACCES 13
-#define NFSERR_EXIST 17
-#define NFSERR_XDEV 18 /* Version 3 only */
-#define NFSERR_NODEV 19
-#define NFSERR_NOTDIR 20
-#define NFSERR_ISDIR 21
-#define NFSERR_INVAL 22 /* Version 3 only */
-#define NFSERR_FBIG 27
-#define NFSERR_NOSPC 28
-#define NFSERR_ROFS 30
-#define NFSERR_MLINK 31 /* Version 3 only */
-#define NFSERR_NAMETOL 63
-#define NFSERR_NOTEMPTY 66
-#define NFSERR_DQUOT 69
-#define NFSERR_STALE 70
-#define NFSERR_REMOTE 71 /* Version 3 only */
-#define NFSERR_WFLUSH 99 /* Version 2 only */
-#define NFSERR_BADHANDLE 10001 /* The rest Version 3 only */
-#define NFSERR_NOT_SYNC 10002
-#define NFSERR_BAD_COOKIE 10003
-#define NFSERR_NOTSUPP 10004
-#define NFSERR_TOOSMALL 10005
-#define NFSERR_SERVERFAULT 10006
-#define NFSERR_BADTYPE 10007
-#define NFSERR_JUKEBOX 10008
-#define NFSERR_TRYLATER NFSERR_JUKEBOX
-#define NFSERR_STALEWRITEVERF 30001 /* Fake return for nfs_commit() */
-
-#define NFSERR_RETVOID 0x20000000 /* Return void, not error */
-#define NFSERR_AUTHERR 0x40000000 /* Mark an authentication error */
-#define NFSERR_RETERR 0x80000000 /* Mark an error return for V3 */
-
-/* Sizes in bytes of various nfs rpc components */
-#define NFSX_UNSIGNED 4
-
-/* specific to NFS Version 2 */
-#define NFSX_V2FH 32
-#define NFSX_V2FATTR 68
-#define NFSX_V2SATTR 32
-#define NFSX_V2COOKIE 4
-#define NFSX_V2STATFS 20
-
-/* specific to NFS Version 3 */
-#define NFSX_V3FH (sizeof (fhandle_t)) /* size this server uses */
-#define NFSX_V3FHMAX 64 /* max. allowed by protocol */
-#define NFSX_V3FATTR 84
-#define NFSX_V3SATTR 60 /* max. all fields filled in */
-#define NFSX_V3SRVSATTR (sizeof (struct nfsv3_sattr))
-#define NFSX_V3POSTOPATTR (NFSX_V3FATTR + NFSX_UNSIGNED)
-#define NFSX_V3WCCDATA (NFSX_V3POSTOPATTR + 8 * NFSX_UNSIGNED)
-#define NFSX_V3COOKIEVERF 8
-#define NFSX_V3WRITEVERF 8
-#define NFSX_V3CREATEVERF 8
-#define NFSX_V3STATFS 52
-#define NFSX_V3FSINFO 48
-#define NFSX_V3PATHCONF 24
-
-/* variants for both versions */
-#define NFSX_FH(v3) ((v3) ? (NFSX_V3FHMAX + NFSX_UNSIGNED) : \
- NFSX_V2FH)
-#define NFSX_SRVFH(v3) ((v3) ? NFSX_V3FH : NFSX_V2FH)
-#define NFSX_FATTR(v3) ((v3) ? NFSX_V3FATTR : NFSX_V2FATTR)
-#define NFSX_PREOPATTR(v3) ((v3) ? (7 * NFSX_UNSIGNED) : 0)
-#define NFSX_POSTOPATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : 0)
-#define NFSX_POSTOPORFATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : \
- NFSX_V2FATTR)
-#define NFSX_WCCDATA(v3) ((v3) ? NFSX_V3WCCDATA : 0)
-#define NFSX_WCCORFATTR(v3) ((v3) ? NFSX_V3WCCDATA : NFSX_V2FATTR)
-#define NFSX_SATTR(v3) ((v3) ? NFSX_V3SATTR : NFSX_V2SATTR)
-#define NFSX_COOKIEVERF(v3) ((v3) ? NFSX_V3COOKIEVERF : 0)
-#define NFSX_WRITEVERF(v3) ((v3) ? NFSX_V3WRITEVERF : 0)
-#define NFSX_READDIR(v3) ((v3) ? (5 * NFSX_UNSIGNED) : \
- (2 * NFSX_UNSIGNED))
-#define NFSX_STATFS(v3) ((v3) ? NFSX_V3STATFS : NFSX_V2STATFS)
-
-/* nfs rpc procedure numbers (before version mapping) */
-#define NFSPROC_NULL 0
-#define NFSPROC_GETATTR 1
-#define NFSPROC_SETATTR 2
-#define NFSPROC_LOOKUP 3
-#define NFSPROC_ACCESS 4
-#define NFSPROC_READLINK 5
-#define NFSPROC_READ 6
-#define NFSPROC_WRITE 7
-#define NFSPROC_CREATE 8
-#define NFSPROC_MKDIR 9
-#define NFSPROC_SYMLINK 10
-#define NFSPROC_MKNOD 11
-#define NFSPROC_REMOVE 12
-#define NFSPROC_RMDIR 13
-#define NFSPROC_RENAME 14
-#define NFSPROC_LINK 15
-#define NFSPROC_READDIR 16
-#define NFSPROC_READDIRPLUS 17
-#define NFSPROC_FSSTAT 18
-#define NFSPROC_FSINFO 19
-#define NFSPROC_PATHCONF 20
-#define NFSPROC_COMMIT 21
-
-/* And leasing (nqnfs) procedure numbers (must be last) */
-#define NQNFSPROC_GETLEASE 22
-#define NQNFSPROC_VACATED 23
-#define NQNFSPROC_EVICTED 24
-
-#define NFSPROC_NOOP 25
-#define NFS_NPROCS 26
-
-/* Actual Version 2 procedure numbers */
-#define NFSV2PROC_NULL 0
-#define NFSV2PROC_GETATTR 1
-#define NFSV2PROC_SETATTR 2
-#define NFSV2PROC_NOOP 3
-#define NFSV2PROC_ROOT NFSV2PROC_NOOP /* Obsolete */
-#define NFSV2PROC_LOOKUP 4
-#define NFSV2PROC_READLINK 5
-#define NFSV2PROC_READ 6
-#define NFSV2PROC_WRITECACHE NFSV2PROC_NOOP /* Obsolete */
-#define NFSV2PROC_WRITE 8
-#define NFSV2PROC_CREATE 9
-#define NFSV2PROC_REMOVE 10
-#define NFSV2PROC_RENAME 11
-#define NFSV2PROC_LINK 12
-#define NFSV2PROC_SYMLINK 13
-#define NFSV2PROC_MKDIR 14
-#define NFSV2PROC_RMDIR 15
-#define NFSV2PROC_READDIR 16
-#define NFSV2PROC_STATFS 17
-
-/*
- * Constants used by the Version 3 protocol for various RPCs
- */
-#define NFSV3SATTRTIME_DONTCHANGE 0
-#define NFSV3SATTRTIME_TOSERVER 1
-#define NFSV3SATTRTIME_TOCLIENT 2
-
-#define NFSV3ACCESS_READ 0x01
-#define NFSV3ACCESS_LOOKUP 0x02
-#define NFSV3ACCESS_MODIFY 0x04
-#define NFSV3ACCESS_EXTEND 0x08
-#define NFSV3ACCESS_DELETE 0x10
-#define NFSV3ACCESS_EXECUTE 0x20
-
-#define NFSV3WRITE_UNSTABLE 0
-#define NFSV3WRITE_DATASYNC 1
-#define NFSV3WRITE_FILESYNC 2
-
-#define NFSV3CREATE_UNCHECKED 0
-#define NFSV3CREATE_GUARDED 1
-#define NFSV3CREATE_EXCLUSIVE 2
-
-#define NFSV3FSINFO_LINK 0x01
-#define NFSV3FSINFO_SYMLINK 0x02
-#define NFSV3FSINFO_HOMOGENEOUS 0x08
-#define NFSV3FSINFO_CANSETTIME 0x10
-
-/* Conversion macros */
-#define vtonfsv2_mode(t,m) \
- txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \
- MAKEIMODE((t), (m)))
-#define vtonfsv3_mode(m) txdr_unsigned((m) & 07777)
-#define nfstov_mode(a) (fxdr_unsigned(u_short, (a))&07777)
-#define vtonfsv2_type(a) txdr_unsigned(nfsv2_type[((long)(a))])
-#define vtonfsv3_type(a) txdr_unsigned(nfsv3_type[((long)(a))])
-#define nfsv2tov_type(a) nv2tov_type[fxdr_unsigned(u_long,(a))&0x7]
-#define nfsv3tov_type(a) nv3tov_type[fxdr_unsigned(u_long,(a))&0x7]
-
-/* File types */
-typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5,
- NFSOCK=6, NFFIFO=7 } nfstype;
-
-/* Structs for common parts of the rpc's */
-/*
- * File Handle (32 bytes for version 2), variable up to 64 for version 3.
- * File Handles of up to NFS_SMALLFH in size are stored directly in the
- * nfs node, whereas larger ones are malloc'd. (This never happens when
- * NFS_SMALLFH is set to 64.)
- * NFS_SMALLFH should be in the range of 32 to 64 and be divisible by 4.
- */
-#ifndef NFS_SMALLFH
-#define NFS_SMALLFH 64
-#endif
-union nfsfh {
- fhandle_t fh_generic;
- u_char fh_bytes[NFS_SMALLFH];
-};
-typedef union nfsfh nfsfh_t;
-
-struct nfsv2_time {
- u_long nfsv2_sec;
- u_long nfsv2_usec;
-};
-typedef struct nfsv2_time nfstime2;
-
-struct nfsv3_time {
- u_long nfsv3_sec;
- u_long nfsv3_nsec;
-};
-typedef struct nfsv3_time nfstime3;
-
-/*
- * Quads are defined as arrays of 2 longs to ensure dense packing for the
- * protocol and to facilitate xdr conversion.
- */
-struct nfs_uquad {
- u_long nfsuquad[2];
-};
-typedef struct nfs_uquad nfsuint64;
-
-/*
- * Used to convert between two u_longs and a u_quad_t.
- */
-union nfs_quadconvert {
- u_long lval[2];
- u_quad_t qval;
-};
-typedef union nfs_quadconvert nfsquad_t;
-
-/*
- * NFS Version 3 special file number.
- */
-struct nfsv3_spec {
- u_long specdata1;
- u_long specdata2;
-};
-typedef struct nfsv3_spec nfsv3spec;
-
-/*
- * File attributes and setable attributes. These structures cover both
- * NFS version 2 and the version 3 protocol. Note that the union is only
- * used so that one pointer can refer to both variants. These structures
- * go out on the wire and must be densely packed, so no quad data types
- * are used. (all fields are longs or u_longs or structures of same)
- * NB: You can't do sizeof(struct nfs_fattr), you must use the
- * NFSX_FATTR(v3) macro.
- */
-struct nfs_fattr {
- u_long fa_type;
- u_long fa_mode;
- u_long fa_nlink;
- u_long fa_uid;
- u_long fa_gid;
- union {
- struct {
- u_long nfsv2fa_size;
- u_long nfsv2fa_blocksize;
- u_long nfsv2fa_rdev;
- u_long nfsv2fa_blocks;
- u_long nfsv2fa_fsid;
- u_long nfsv2fa_fileid;
- nfstime2 nfsv2fa_atime;
- nfstime2 nfsv2fa_mtime;
- nfstime2 nfsv2fa_ctime;
- } fa_nfsv2;
- struct {
- nfsuint64 nfsv3fa_size;
- nfsuint64 nfsv3fa_used;
- nfsv3spec nfsv3fa_rdev;
- nfsuint64 nfsv3fa_fsid;
- nfsuint64 nfsv3fa_fileid;
- nfstime3 nfsv3fa_atime;
- nfstime3 nfsv3fa_mtime;
- nfstime3 nfsv3fa_ctime;
- } fa_nfsv3;
- } fa_un;
-};
-
-/* and some ugly defines for accessing union components */
-#define fa2_size fa_un.fa_nfsv2.nfsv2fa_size
-#define fa2_blocksize fa_un.fa_nfsv2.nfsv2fa_blocksize
-#define fa2_rdev fa_un.fa_nfsv2.nfsv2fa_rdev
-#define fa2_blocks fa_un.fa_nfsv2.nfsv2fa_blocks
-#define fa2_fsid fa_un.fa_nfsv2.nfsv2fa_fsid
-#define fa2_fileid fa_un.fa_nfsv2.nfsv2fa_fileid
-#define fa2_atime fa_un.fa_nfsv2.nfsv2fa_atime
-#define fa2_mtime fa_un.fa_nfsv2.nfsv2fa_mtime
-#define fa2_ctime fa_un.fa_nfsv2.nfsv2fa_ctime
-#define fa3_size fa_un.fa_nfsv3.nfsv3fa_size
-#define fa3_used fa_un.fa_nfsv3.nfsv3fa_used
-#define fa3_rdev fa_un.fa_nfsv3.nfsv3fa_rdev
-#define fa3_fsid fa_un.fa_nfsv3.nfsv3fa_fsid
-#define fa3_fileid fa_un.fa_nfsv3.nfsv3fa_fileid
-#define fa3_atime fa_un.fa_nfsv3.nfsv3fa_atime
-#define fa3_mtime fa_un.fa_nfsv3.nfsv3fa_mtime
-#define fa3_ctime fa_un.fa_nfsv3.nfsv3fa_ctime
-
-struct nfsv2_sattr {
- u_long sa_mode;
- u_long sa_uid;
- u_long sa_gid;
- u_long sa_size;
- nfstime2 sa_atime;
- nfstime2 sa_mtime;
-};
-
-/*
- * NFS Version 3 sattr structure for the new node creation case.
- */
-struct nfsv3_sattr {
- u_long sa_modetrue;
- u_long sa_mode;
- u_long sa_uidtrue;
- u_long sa_uid;
- u_long sa_gidtrue;
- u_long sa_gid;
- u_long sa_sizefalse;
- u_long sa_atimetype;
- nfstime3 sa_atime;
- u_long sa_mtimetype;
- nfstime3 sa_mtime;
-};
-
-struct nfs_statfs {
- union {
- struct {
- u_long nfsv2sf_tsize;
- u_long nfsv2sf_bsize;
- u_long nfsv2sf_blocks;
- u_long nfsv2sf_bfree;
- u_long nfsv2sf_bavail;
- } sf_nfsv2;
- struct {
- nfsuint64 nfsv3sf_tbytes;
- nfsuint64 nfsv3sf_fbytes;
- nfsuint64 nfsv3sf_abytes;
- nfsuint64 nfsv3sf_tfiles;
- nfsuint64 nfsv3sf_ffiles;
- nfsuint64 nfsv3sf_afiles;
- u_long nfsv3sf_invarsec;
- } sf_nfsv3;
- } sf_un;
-};
-
-#define sf_tsize sf_un.sf_nfsv2.nfsv2sf_tsize
-#define sf_bsize sf_un.sf_nfsv2.nfsv2sf_bsize
-#define sf_blocks sf_un.sf_nfsv2.nfsv2sf_blocks
-#define sf_bfree sf_un.sf_nfsv2.nfsv2sf_bfree
-#define sf_bavail sf_un.sf_nfsv2.nfsv2sf_bavail
-#define sf_tbytes sf_un.sf_nfsv3.nfsv3sf_tbytes
-#define sf_fbytes sf_un.sf_nfsv3.nfsv3sf_fbytes
-#define sf_abytes sf_un.sf_nfsv3.nfsv3sf_abytes
-#define sf_tfiles sf_un.sf_nfsv3.nfsv3sf_tfiles
-#define sf_ffiles sf_un.sf_nfsv3.nfsv3sf_ffiles
-#define sf_afiles sf_un.sf_nfsv3.nfsv3sf_afiles
-#define sf_invarsec sf_un.sf_nfsv3.nfsv3sf_invarsec
-
-struct nfsv3_fsinfo {
- u_long fs_rtmax;
- u_long fs_rtpref;
- u_long fs_rtmult;
- u_long fs_wtmax;
- u_long fs_wtpref;
- u_long fs_wtmult;
- u_long fs_dtpref;
- nfsuint64 fs_maxfilesize;
- nfstime3 fs_timedelta;
- u_long fs_properties;
-};
-
-struct nfsv3_pathconf {
- u_long pc_linkmax;
- u_long pc_namemax;
- u_long pc_notrunc;
- u_long pc_chownrestricted;
- u_long pc_caseinsensitive;
- u_long pc_casepreserving;
-};
-
-#endif
diff --git a/c/src/lib/libnetworking/nfs/rpcv2.h b/c/src/lib/libnetworking/nfs/rpcv2.h
deleted file mode 100644
index 5fd6e7febf..0000000000
--- a/c/src/lib/libnetworking/nfs/rpcv2.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)rpcv2.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_RPCV2_H_
-#define _NFS_RPCV2_H_
-
-/*
- * Definitions for Sun RPC Version 2, from
- * "RPC: Remote Procedure Call Protocol Specification" RFC1057
- */
-
-/* Version # */
-#define RPC_VER2 2
-
-/* Authentication */
-#define RPCAUTH_NULL 0
-#define RPCAUTH_UNIX 1
-#define RPCAUTH_SHORT 2
-#define RPCAUTH_KERB4 4
-#define RPCAUTH_NQNFS 300000
-#define RPCAUTH_MAXSIZ 400
-#define RPCVERF_MAXSIZ 12 /* For Kerb, can actually be 400 */
-#define RPCAUTH_UNIXGIDS 16
-
-/*
- * Constants associated with authentication flavours.
- */
-#define RPCAKN_FULLNAME 0
-#define RPCAKN_NICKNAME 1
-
-/* Rpc Constants */
-#define RPC_CALL 0
-#define RPC_REPLY 1
-#define RPC_MSGACCEPTED 0
-#define RPC_MSGDENIED 1
-#define RPC_PROGUNAVAIL 1
-#define RPC_PROGMISMATCH 2
-#define RPC_PROCUNAVAIL 3
-#define RPC_GARBAGE 4 /* I like this one */
-#define RPC_MISMATCH 0
-#define RPC_AUTHERR 1
-
-/* Authentication failures */
-#define AUTH_BADCRED 1
-#define AUTH_REJECTCRED 2
-#define AUTH_BADVERF 3
-#define AUTH_REJECTVERF 4
-#define AUTH_TOOWEAK 5 /* Give em wheaties */
-
-/* Sizes of rpc header parts */
-#define RPC_SIZ 24
-#define RPC_REPLYSIZ 28
-
-/* RPC Prog definitions */
-#define RPCPROG_MNT 100005
-#define RPCMNT_VER1 1
-#define RPCMNT_VER3 3
-#define RPCMNT_MOUNT 1
-#define RPCMNT_DUMP 2
-#define RPCMNT_UMOUNT 3
-#define RPCMNT_UMNTALL 4
-#define RPCMNT_EXPORT 5
-#define RPCMNT_NAMELEN 255
-#define RPCMNT_PATHLEN 1024
-#define RPCPROG_NFS 100003
-
-/*
- * Structures used for RPCAUTH_KERB4.
- */
-struct nfsrpc_fullverf {
- u_long t1;
- u_long t2;
- u_long w2;
-};
-
-struct nfsrpc_fullblock {
- u_long t1;
- u_long t2;
- u_long w1;
- u_long w2;
-};
-
-struct nfsrpc_nickverf {
- u_long kind;
- struct nfsrpc_fullverf verf;
-};
-
-/*
- * and their sizes in bytes.. If sizeof (struct nfsrpc_xx) != these
- * constants, well then things will break in mount_nfs and nfsd.
- */
-#define RPCX_FULLVERF 12
-#define RPCX_FULLBLOCK 16
-#define RPCX_NICKVERF 16
-
-#ifdef NFSKERB
-XXX
-#else
-typedef u_char NFSKERBKEY_T[2];
-typedef u_char NFSKERBKEYSCHED_T[2];
-#endif
-#define NFS_KERBSRV "rcmd" /* Kerberos Service for NFS */
-#define NFS_KERBTTL (30 * 60) /* Credential ttl (sec) */
-#define NFS_KERBCLOCKSKEW (5 * 60) /* Clock skew (sec) */
-#define NFS_KERBW1(t) (*((u_long *)(&((t).dat[((t).length + 3) & ~0x3]))))
-#endif
diff --git a/c/src/lib/libnetworking/nfs/xdr_subs.h b/c/src/lib/libnetworking/nfs/xdr_subs.h
deleted file mode 100644
index 874730378f..0000000000
--- a/c/src/lib/libnetworking/nfs/xdr_subs.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)xdr_subs.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_XDR_SUBS_H_
-#define _NFS_XDR_SUBS_H_
-
-/*
- * Macros used for conversion to/from xdr representation by nfs...
- * These use the MACHINE DEPENDENT routines ntohl, htonl
- * As defined by "XDR: External Data Representation Standard" RFC1014
- *
- * To simplify the implementation, we use ntohl/htonl even on big-endian
- * machines, and count on them being `#define'd away. Some of these
- * might be slightly more efficient as quad_t copies on a big-endian,
- * but we cannot count on their alignment anyway.
- */
-
-#define fxdr_unsigned(t, v) ((t)ntohl((long)(v)))
-#define txdr_unsigned(v) (htonl((long)(v)))
-
-#define fxdr_nfsv2time(f, t) { \
- (t)->tv_sec = ntohl(((struct nfsv2_time *)(f))->nfsv2_sec); \
- if (((struct nfsv2_time *)(f))->nfsv2_usec != 0xffffffff) \
- (t)->tv_nsec = 1000 * ntohl(((struct nfsv2_time *)(f))->nfsv2_usec); \
- else \
- (t)->tv_nsec = 0; \
-}
-#define txdr_nfsv2time(f, t) { \
- ((struct nfsv2_time *)(t))->nfsv2_sec = htonl((f)->tv_sec); \
- if ((f)->tv_nsec != -1) \
- ((struct nfsv2_time *)(t))->nfsv2_usec = htonl((f)->tv_nsec / 1000); \
- else \
- ((struct nfsv2_time *)(t))->nfsv2_usec = 0xffffffff; \
-}
-
-#define fxdr_nfsv3time(f, t) { \
- (t)->tv_sec = ntohl(((struct nfsv3_time *)(f))->nfsv3_sec); \
- (t)->tv_nsec = ntohl(((struct nfsv3_time *)(f))->nfsv3_nsec); \
-}
-#define txdr_nfsv3time(f, t) { \
- ((struct nfsv3_time *)(t))->nfsv3_sec = htonl((f)->tv_sec); \
- ((struct nfsv3_time *)(t))->nfsv3_nsec = htonl((f)->tv_nsec); \
-}
-
-#define fxdr_hyper(f, t) { \
- ((long *)(t))[_QUAD_HIGHWORD] = ntohl(((long *)(f))[0]); \
- ((long *)(t))[_QUAD_LOWWORD] = ntohl(((long *)(f))[1]); \
-}
-#define txdr_hyper(f, t) { \
- ((long *)(t))[0] = htonl(((long *)(f))[_QUAD_HIGHWORD]); \
- ((long *)(t))[1] = htonl(((long *)(f))[_QUAD_LOWWORD]); \
-}
-
-#endif
diff --git a/c/src/lib/libnetworking/opt_ipfw.h b/c/src/lib/libnetworking/opt_ipfw.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/lib/libnetworking/opt_ipfw.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/lib/libnetworking/opt_mrouting.h b/c/src/lib/libnetworking/opt_mrouting.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/lib/libnetworking/opt_mrouting.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/lib/libnetworking/opt_tcpdebug.h b/c/src/lib/libnetworking/opt_tcpdebug.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/lib/libnetworking/opt_tcpdebug.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/lib/libnetworking/poll.h b/c/src/lib/libnetworking/poll.h
deleted file mode 100644
index 74dfca76c1..0000000000
--- a/c/src/lib/libnetworking/poll.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*-
- * Copyright (c) 1997 Peter Wemm <peter@freebsd.org>
- * 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. 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 BY THE AUTHOR 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 AUTHOR 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.
- *
- * $Id$
- */
-
-#ifndef _SYS_POLL_H_
-#define _SYS_POLL_H_
-
-/*
- * This file is intended to be compatable with the traditional poll.h.
- */
-
-/*
- * This structure is passed as an array to poll(2).
- */
-struct pollfd {
- int fd; /* which file descriptor to poll */
- short events; /* events we are interested in */
- short revents; /* events found on return */
-};
-
-/*
- * Requestable events. If poll(2) finds any of these set, they are
- * copied to revents on return.
- * XXX Note that FreeBSD doesn't make much distinction between POLLPRI
- * and POLLRDBAND since none of the file types have distinct priority
- * bands - and only some have an urgent "mode".
- * XXX Note POLLIN isn't really supported in true SVSV terms. Under SYSV
- * POLLIN includes all of normal, band and urgent data. Most poll handlers
- * on FreeBSD only treat it as "normal" data.
- */
-#define POLLIN 0x0001 /* any readable data available */
-#define POLLPRI 0x0002 /* OOB/Urgent readable data */
-#define POLLOUT 0x0004 /* file descriptor is writeable */
-#define POLLRDNORM 0x0040 /* non-OOB/URG data available */
-#define POLLWRNORM POLLOUT /* no write type differentiation */
-#define POLLRDBAND 0x0080 /* OOB/Urgent readable data */
-#define POLLWRBAND 0x0100 /* OOB/Urgent data can be written */
-
-/*
- * FreeBSD extensions: polling on a regular file might return one
- * of these events (currently only supported on UFS).
- */
-#define POLLEXTEND 0x0200 /* file may have been extended */
-#define POLLATTRIB 0x0400 /* file attributes may have changed */
-#define POLLNLINK 0x0800 /* (un)link/rename may have happened */
-#define POLLWRITE 0x1000 /* file's contents may have changed */
-
-/*
- * These events are set if they occur regardless of whether they were
- * requested.
- */
-#define POLLERR 0x0008 /* some poll error occurred */
-#define POLLHUP 0x0010 /* file descriptor was "hung up" */
-#define POLLNVAL 0x0020 /* requested events "invalid" */
-
-#define POLLSTANDARD (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|\
- POLLWRBAND|POLLERR|POLLHUP|POLLNVAL)
-
-/*
- * Request that poll() wait forever.
- * XXX in SYSV, this is defined in stropts.h, which is not included
- * by poll.h.
- */
-#define INFTIM (-1)
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-/*
- * XXX logically, poll() should be declared in <poll.h>, but SVR4 at
- * least has it here in <sys/poll.h>.
- * XXX poll() has "unsigned long" nfds on SVR4, not unsigned as on the
- * other BSDs.
- */
-int poll __P((struct pollfd *_pfd, unsigned _nfds, int _timeout));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif /* !_SYS_POLL_H_ */
diff --git a/c/src/lib/libnetworking/resolv.h b/c/src/lib/libnetworking/resolv.h
deleted file mode 100644
index 614f204706..0000000000
--- a/c/src/lib/libnetworking/resolv.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/*-
- * Copyright (c) 1983, 1987, 1989, 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.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * @(#)resolv.h 8.1 (Berkeley) 6/2/93
- * From Id: resolv.h,v 8.12 1998/04/28 19:36:46 halley Exp $
- * $Id$
- */
-
-#ifndef _RESOLV_H_
-#define _RESOLV_H_
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/cdefs.h>
-#include <stdio.h>
-
-/*
- * Revision information. This is the release date in YYYYMMDD format.
- * It can change every day so the right thing to do with it is use it
- * in preprocessor commands such as "#if (__RES > 19931104)". Do not
- * compare for equality; rather, use it to determine whether your resolver
- * is new enough to contain a certain feature.
- */
-
-#define __RES 19960801
-
-/*
- * This used to be defined in res_query.c, now it's in herror.c. It was
- * never extern'd by any *.h file before it was placed here. herror.c is
- * part of libresolv.a even though it might make more sense in libnetdb.a
- * or even libnet.a.
- */
-
-extern int h_errno;
-
-/*
- * Resolver configuration file.
- * Normally not present, but may contain the address of the
- * inital name server(s) to query and the domain search list.
- */
-
-#ifndef _PATH_RESCONF
-#define _PATH_RESCONF "/etc/resolv.conf"
-#endif
-
-/*
- * Global defines and variables for resolver stub.
- */
-#define MAXNS 3 /* max # name servers we'll track */
-#define MAXDFLSRCH 3 /* # default domain levels to try */
-#define MAXDNSRCH 6 /* max # domains in search path */
-#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
-
-#define RES_TIMEOUT 5 /* min. seconds between retries */
-#define MAXRESOLVSORT 10 /* number of net to sort on */
-#define RES_MAXNDOTS 15 /* should reflect bit field size */
-
-struct __res_state {
- int retrans; /* retransmition time interval */
- int retry; /* number of times to retransmit */
- u_long options; /* option flags - see below. */
- int nscount; /* number of name servers */
- struct sockaddr_in
- nsaddr_list[MAXNS]; /* address of name server */
-#define nsaddr nsaddr_list[0] /* for backward compatibility */
- u_short id; /* current message id */
- char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
- char defdname[256]; /* default domain (deprecated) */
- u_long pfcode; /* RES_PRF_ flags - see below. */
- unsigned ndots:4; /* threshold for initial abs. query */
- unsigned nsort:4; /* number of elements in sort_list[] */
- char unused[3];
- struct {
- struct in_addr addr;
- u_int32_t mask;
- } sort_list[MAXRESOLVSORT];
- char pad[72]; /* on an i386 this means 512b total */
-};
-
-/*
- * Resolver options (keep these in synch with res_debug.c, please)
- */
-#define RES_INIT 0x00000001 /* address initialized */
-#define RES_DEBUG 0x00000002 /* print debug messages */
-#define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/
-#define RES_USEVC 0x00000008 /* use virtual circuit */
-#define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */
-#define RES_IGNTC 0x00000020 /* ignore truncation errors */
-#define RES_RECURSE 0x00000040 /* recursion desired */
-#define RES_DEFNAMES 0x00000080 /* use default domain name */
-#define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */
-#define RES_DNSRCH 0x00000200 /* search up local domain tree */
-#define RES_INSECURE1 0x00000400 /* type 1 security disabled */
-#define RES_INSECURE2 0x00000800 /* type 2 security disabled */
-#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
-#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
-#define RES_NOTLDQUERY 0x00004000 /* Don't query TLD names */
-
-#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
-
-/*
- * Resolver "pfcode" values. Used by dig.
- */
-#define RES_PRF_STATS 0x00000001
-#define RES_PRF_UPDATE 0x00000002
-#define RES_PRF_CLASS 0x00000004
-#define RES_PRF_CMD 0x00000008
-#define RES_PRF_QUES 0x00000010
-#define RES_PRF_ANS 0x00000020
-#define RES_PRF_AUTH 0x00000040
-#define RES_PRF_ADD 0x00000080
-#define RES_PRF_HEAD1 0x00000100
-#define RES_PRF_HEAD2 0x00000200
-#define RES_PRF_TTLID 0x00000400
-#define RES_PRF_HEADX 0x00000800
-#define RES_PRF_QUERY 0x00001000
-#define RES_PRF_REPLY 0x00002000
-#define RES_PRF_INIT 0x00004000
-/* 0x00008000 */
-
-typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
- res_sendhookact;
-
-typedef res_sendhookact (*res_send_qhook)__P((struct sockaddr_in * const *ns,
- const u_char **query,
- int *querylen,
- u_char *ans,
- int anssiz,
- int *resplen));
-
-typedef res_sendhookact (*res_send_rhook)__P((const struct sockaddr_in *ns,
- const u_char *query,
- int querylen,
- u_char *ans,
- int anssiz,
- int *resplen));
-
-struct res_sym {
- int number; /* Identifying number, like T_MX */
- char * name; /* Its symbolic name, like "MX" */
- char * humanname; /* Its fun name, like "mail exchanger" */
-};
-
-extern struct __res_state _res;
-extern const struct res_sym __p_class_syms[];
-extern const struct res_sym __p_type_syms[];
-
-/* Private routines shared between libc/net, named, nslookup and others. */
-#define res_hnok __res_hnok
-#define res_ownok __res_ownok
-#define res_mailok __res_mailok
-#define res_dnok __res_dnok
-#define sym_ston __sym_ston
-#define sym_ntos __sym_ntos
-#define sym_ntop __sym_ntop
-#define b64_ntop __b64_ntop
-#define b64_pton __b64_pton
-#define loc_ntoa __loc_ntoa
-#define loc_aton __loc_aton
-#define fp_resstat __fp_resstat
-#define p_query __p_query
-#define dn_skipname __dn_skipname
-#define fp_resstat __fp_resstat
-#define fp_query __fp_query
-#define fp_nquery __fp_nquery
-#define hostalias __hostalias
-#define putlong __putlong
-#define putshort __putshort
-#define p_class __p_class
-#define p_time __p_time
-#define p_type __p_type
-#define p_query __p_query
-#define p_cdnname __p_cdnname
-#define p_section __p_section
-#define p_cdname __p_cdname
-#define p_fqnname __p_fqnname
-#define p_fqname __p_fqname
-#define p_option __p_option
-#define p_secstodate __p_secstodate
-#define dn_count_labels __dn_count_labels
-#define dn_comp __dn_comp
-#define dn_expand __dn_expand
-#define res_init __res_init
-#define res_randomid __res_randomid
-#define res_query __res_query
-#define res_search __res_search
-#define res_querydomain __res_querydomain
-#define res_mkquery __res_mkquery
-#define res_send __res_send
-#define res_isourserver __res_isourserver
-#define res_nameinquery __res_nameinquery
-#define res_queriesmatch __res_queriesmatch
-#define res_close __res_close
-#define res_mkupdate __res_mkupdate
-#define res_mkupdrec __res_mkupdrec
-#define res_freeupdrec __res_freeupdrec
-
-__BEGIN_DECLS
-int res_hnok __P((const char *));
-int res_ownok __P((const char *));
-int res_mailok __P((const char *));
-int res_dnok __P((const char *));
-int sym_ston __P((const struct res_sym *, const char *, int *));
-const char * sym_ntos __P((const struct res_sym *, int, int *));
-const char * sym_ntop __P((const struct res_sym *, int, int *));
-int b64_ntop __P((u_char const *, size_t, char *, size_t));
-int b64_pton __P((char const *, u_char *, size_t));
-int loc_aton __P((const char *, u_char *));
-const char * loc_ntoa __P((const u_char *, char *));
-int dn_skipname __P((const u_char *, const u_char *));
-void fp_resstat __P((struct __res_state *, FILE *));
-void fp_query __P((const u_char *, FILE *));
-void fp_nquery __P((const u_char *, int, FILE *));
-const char * hostalias __P((const char *));
-void putlong __P((u_int32_t, u_char *));
-void putshort __P((u_int16_t, u_char *));
-const char * p_class __P((int));
-const char * p_time __P((u_int32_t));
-const char * p_type __P((int));
-void p_query __P((const u_char *));
-const u_char * p_cdnname __P((const u_char *, const u_char *, int, FILE *));
-const u_char * p_cdname __P((const u_char *, const u_char *, FILE *));
-const u_char * p_fqnname __P((const u_char *, const u_char *,
- int, char *, int));
-const u_char * p_fqname __P((const u_char *, const u_char *, FILE *));
-const char * p_option __P((u_long));
-char * p_secstodate __P((u_long));
-int dn_count_labels __P((const char *));
-int dn_comp __P((const char *, u_char *, int,
- u_char **, u_char **));
-int dn_expand __P((const u_char *, const u_char *, const u_char *,
- char *, int));
-int res_init __P((void));
-u_int res_randomid __P((void));
-int res_query __P((const char *, int, int, u_char *, int));
-int res_search __P((const char *, int, int, u_char *, int));
-int res_querydomain __P((const char *, const char *, int, int,
- u_char *, int));
-int res_mkquery __P((int, const char *, int, int, const u_char *,
- int, const u_char *, u_char *, int));
-int res_send __P((const u_char *, int, u_char *, int));
-int res_isourserver __P((const struct sockaddr_in *));
-int res_nameinquery __P((const char *, int, int,
- const u_char *, const u_char *));
-int res_queriesmatch __P((const u_char *, const u_char *,
- const u_char *, const u_char *));
-void res_close __P((void));
-const char * p_section __P((int, int));
-/* XXX The following depend on the ns_updrec typedef in arpa/nameser.h */
-#ifdef _ARPA_NAMESER_H_
-int res_update __P((ns_updrec *));
-int res_mkupdate __P((ns_updrec *, u_char *, int));
-ns_updrec * res_mkupdrec __P((int, const char *, u_int, u_int, u_long));
-void res_freeupdrec __P((ns_updrec *));
-#endif
-__END_DECLS
-
-#endif /* !_RESOLV_H_ */
diff --git a/c/src/lib/libnetworking/rtems/Makefile.in b/c/src/lib/libnetworking/rtems/Makefile.in
deleted file mode 100644
index 038fb5c68e..0000000000
--- a/c/src/lib/libnetworking/rtems/Makefile.in
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=lib.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES=sghostname issetugid \
- rtems_glue rtems_syscall rtems_bootp \
- rtems_showmbuf rtems_showroute \
- rtems_showifstat rtems_showipstat rtems_showicmpstat \
- rtems_showtcpstat rtems_showudpstat
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \
- -DDIAGNOSTIC -DBOOTP_COMPAT
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
diff --git a/c/src/lib/libnetworking/rtems/issetugid.c b/c/src/lib/libnetworking/rtems/issetugid.c
deleted file mode 100644
index 3baf0ec88b..0000000000
--- a/c/src/lib/libnetworking/rtems/issetugid.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Dummy version of BSD routine
- *
- * $Id$
- */
-
-int
-issetugid (void)
-{
- return 0;
-}
diff --git a/c/src/lib/libnetworking/rtems/rtems_bootp.c b/c/src/lib/libnetworking/rtems/rtems_bootp.c
deleted file mode 100644
index 47e3db758f..0000000000
--- a/c/src/lib/libnetworking/rtems/rtems_bootp.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/error.h>
-#include <sys/types.h>
-#include <rtems/rtems_bsdnet.h>
-
-/*
- * Perform a BOOTP request
- */
-void
-rtems_bsdnet_do_bootp (void)
-{
- rtems_bsdnet_semaphore_obtain ();
- bootpc_init ();
- rtems_bsdnet_semaphore_release ();
-}
diff --git a/c/src/lib/libnetworking/rtems/rtems_bsdnet.h b/c/src/lib/libnetworking/rtems/rtems_bsdnet.h
deleted file mode 100644
index 73ad92fa30..0000000000
--- a/c/src/lib/libnetworking/rtems/rtems_bsdnet.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef _RTEMS_BSDNET_
-#define _RTEMS_BSDNET_
-
-#include <rtems.h>
-
-/*
- * Values that may be obtained by BOOTP
- */
-extern struct in_addr rtems_bsdnet_bootp_server_address;
-extern char *rtems_bsdnet_bootp_boot_file_name;
-
-/*
- * Manipulate routing tables
- */
-struct sockaddr;
-struct rtentry;
-int rtems_bsdnet_rtrequest (
- int req,
- struct sockaddr *dst,
- struct sockaddr *gateway,
- struct sockaddr *netmask,
- int flags,
- struct rtentry **net_nrt);
-
-/*
- * Diagnostics
- */
-void rtems_bsdnet_show_inet_routes (void);
-void rtems_bsdnet_show_mbuf_stats (void);
-void rtems_bsdnet_show_if_stats (void);
-void rtems_bsdnet_show_ip_stats (void);
-void rtems_bsdnet_show_icmp_stats (void);
-void rtems_bsdnet_show_udp_stats (void);
-void rtems_bsdnet_show_tcp_stats (void);
-
-/*
- * Network configuration
- */
-struct rtems_bsdnet_ifconfig {
- /*
- * These two entries must be supplied for each interface.
- */
- char *name;
- int (*attach)(struct rtems_bsdnet_ifconfig *conf);
-
- /*
- * Link to next interface
- */
- struct rtems_bsdnet_ifconfig *next;
-
- /*
- * The following entries may be obtained
- * from BOOTP or explicitily supplied.
- */
- char *ip_address;
- char *ip_netmask;
- void *hardware_address;
-
- /*
- * The driver assigns defaults values to the following
- * entries if they are not explicitly supplied.
- */
- int ignore_broadcast;
- int mtu;
- int rbuf_count;
- int xbuf_count;
-
- /*
- * For external ethernet controller board the following
- * parameters are needed
- */
- unsigned int port; /* port of the board */
- unsigned int irno; /* irq of the board */
- unsigned int bpar; /* memory of the board */
-
-};
-
-struct rtems_bsdnet_config {
- /*
- * This entry points to the head of the ifconfig chain.
- */
- struct rtems_bsdnet_ifconfig *ifconfig;
-
- /*
- * This entry should be rtems_bsdnet_do_bootp if BOOTP
- * is being used to configure the network, and NULL
- * if BOOTP is not being used.
- */
- void (*bootp)(void);
-
- /*
- * The remaining items can be initialized to 0, in
- * which case the default value will be used.
- */
- rtems_task_priority network_task_priority; /* 100 */
- unsigned long mbuf_bytecount; /* 64 kbytes */
- unsigned long mbuf_cluster_bytecount; /* 128 kbytes */
- char *hostname; /* BOOTP */
- char *domainname; /* BOOTP */
- char *gateway; /* BOOTP */
- char *log_host; /* BOOTP */
- char *name_server[3]; /* BOOTP */
-};
-extern struct rtems_bsdnet_config rtems_bsdnet_config;
-int rtems_bsdnet_initialize_network (void);
-void rtems_bsdnet_do_bootp (void);
-
-#endif /* _RTEMS_BSDNET_ */
diff --git a/c/src/lib/libnetworking/rtems/rtems_bsdnet_internal.h b/c/src/lib/libnetworking/rtems/rtems_bsdnet_internal.h
deleted file mode 100644
index 559bafd4c5..0000000000
--- a/c/src/lib/libnetworking/rtems/rtems_bsdnet_internal.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Declarations to fit FreeBSD to RTEMS.
- *
- *******************************************************************
- * WARNING *
- * This file should *never* be included by any application program *
- *******************************************************************
- *
- * $Id$
- */
-
-#ifndef _RTEMS_BSDNET_INTERNAL_H_
-#define _RTEMS_BSDNET_INTERNAL_H_
-
-typedef unsigned int vm_offset_t;
-typedef long long vm_ooffset_t;
-typedef unsigned int vm_pindex_t;
-typedef unsigned int vm_size_t;
-
-#define _BSD_OFF_T_ rtems_signed32
-#define _BSD_PID_T_ rtems_id
-#define _BSD_VA_LIST_ char *
-
-/* make sure we get the network versions of these */
-#include "../machine/types.h"
-#include "../machine/param.h"
-
-#include <sys/time.h>
-struct itimerval {
- struct timeval it_interval;
- struct timeval it_value;
-};
-struct mdproc {
- int md_flags;
- int *md_regs;
-};
-
-#define USHRT_MAX 65535
-
-/*
- * Other RTEMS/BSD glue
- */
-struct socket;
-extern void soconnsleep (struct socket *so);
-extern void soconnwakeup (struct socket *so);
-#define splnet() 0
-#define splimp() 0
-#define splx(_s) do { (_s) = 0; } while(0)
-
-#define ovbcopy(f,t,n) bcopy(f,t,n)
-#define copyout(f,t,n) (memcpy(t,f,n),0)
-#define copyin(f,t,n) (memcpy(t,f,n),0)
-
-#define random() rtems_bsdnet_random()
-#define panic rtems_panic
-#define suser(a,b) 0
-
-void microtime (struct timeval *tv);
-#define hz rtems_bsdnet_ticks_per_second
-#define tick rtems_bsdnet_microseconds_per_tick
-
-#define SHRT_MAX 65535
-
-#define log rtems_bsdnet_log
-
-/*
- * Since we can't have two sys/types.h files, we'll hack around
- * and copy the contents of the BSD sys/types.h to here....
- */
-#include <sys/cdefs.h>
-
-typedef u_int64_t u_quad_t; /* quads */
-typedef int64_t quad_t;
-typedef quad_t * qaddr_t;
-
-typedef void __sighandler_t __P((int));
-typedef __sighandler_t *sig_t; /* type of pointer to a signal function */
-#define NSIG 32
-struct sigaltstack {
- char *ss_sp; /* signal stack base */
- int ss_size; /* signal stack length */
- int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */
-};
-
-#ifdef KERNEL
-typedef int boolean_t;
-typedef struct vm_page *vm_page_t;
-#endif
-
-#ifndef _POSIX_SOURCE
-/*
- * minor() gives a cookie instead of an index since we don't want to
- * change the meanings of bits 0-15 or waste time and space shifting
- * bits 16-31 for devices that don't use them.
- */
-#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
-#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */
-#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */
-#endif
-
-#include <machine/endian.h>
-
-typedef quad_t rlim_t; /* resource limit */
-typedef u_int32_t fixpt_t; /* fixed point number */
-
-/*
- * Forward structure declarations for function prototypes. We include the
- * common structures that cross subsystem boundaries here; others are mostly
- * used in the same place that the structure is defined.
- */
-struct proc;
-struct pgrp;
-struct ucred;
-struct rusage;
-struct file;
-struct buf;
-struct tty;
-struct uio;
-
-/*
- * Redo kernel memory allocation
- */
-#define malloc rtems_bsdnet_malloc
-#define free rtems_bsdnet_free
-
-#define M_NOWAIT 0x0001
-void *rtems_bsdnet_malloc (unsigned long size, int type, int flags);
-void rtems_bsdnet_free (void *addr, int type);
-
-void rtems_bsdnet_semaphore_obtain (void);
-void rtems_bsdnet_semaphore_release (void);
-void rtems_bsdnet_schednetisr (int n);
-
-unsigned long rtems_bsdnet_seconds_since_boot (void);
-unsigned long rtems_bsdnet_random (void);
-
-rtems_id rtems_bsdnet_newproc (
- char *name,
- int stacksize,
- void (*entry)(void *),
- void *arg
-);
-
-rtems_status_code rtems_bsdnet_event_receive (
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-);
-
-/*
- * Network configuration
- */
-extern int rtems_bsdnet_ticks_per_second;
-extern int rtems_bsdnet_microseconds_per_tick;
-extern struct in_addr rtems_bsdnet_log_host_address;
-extern char *rtems_bsdnet_domain_name;
-extern struct in_addr rtems_bsdnet_nameserver[];
-extern int rtems_bsdnet_nameserver_count;
-
-/*
- * Internal IOCTL command
- */
-#define SIO_RTEMS_SHOW_STATS _IO('i', 250)
-
-/*
- * Some extra prototypes
- */
-int sethostname (char *name, int namelen);
-void domaininit (void *);
-void ifinit (void *);
-void ipintr (void);
-void arpintr (void);
-void bootpc_init(void);
-int socket (int, int, int);
-int ioctl (int, unsigned long, ...);
-
-#endif /* _RTEMS_BSDNET_INTERNAL_H_ */
diff --git a/c/src/lib/libnetworking/rtems/rtems_glue.c b/c/src/lib/libnetworking/rtems/rtems_glue.c
deleted file mode 100644
index dd80a13d08..0000000000
--- a/c/src/lib/libnetworking/rtems/rtems_glue.c
+++ /dev/null
@@ -1,905 +0,0 @@
-/*
- * $Id$
- */
-
-#include <string.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <errno.h>
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/error.h>
-#include <rtems/rtems_bsdnet.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/domain.h>
-#include <sys/mbuf.h>
-#include <sys/socketvar.h>
-#include <sys/socket.h>
-#include <sys/sockio.h>
-#include <sys/callout.h>
-#include <sys/proc.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <vm/vm.h>
-#include <arpa/inet.h>
-
-#include <net/netisr.h>
-#include <net/route.h>
-
-/*
- * Events used by networking routines.
- * Everything will break if the application
- * tries to use these events or if the `sleep'
- * events are equal to any of the NETISR * events.
- */
-#define SBWAIT_EVENT RTEMS_EVENT_24
-#define SOSLEEP_EVENT RTEMS_EVENT_25
-#define NETISR_IP_EVENT (1 << NETISR_IP)
-#define NETISR_ARP_EVENT (1 << NETISR_ARP)
-#define NETISR_EVENTS (NETISR_IP_EVENT|NETISR_ARP_EVENT)
-
-
-/*
- * Memory allocation
- */
-static int nmbuf = (64 * 1024) / MSIZE;
- int nmbclusters = (128 * 1024) / MCLBYTES;
-
-/*
- * Socket buffering parameters
- */
-unsigned long sb_efficiency = 8;
-
-/*
- * Network task synchronization
- */
-static rtems_id networkSemaphore;
-static rtems_id networkDaemonTid;
-static rtems_unsigned32 networkDaemonPriority;
-static void networkDaemon (void *task_argument);
-
-/*
- * Network timing
- */
-int rtems_bsdnet_ticks_per_second;
-int rtems_bsdnet_microseconds_per_tick;
-
-/*
- * Callout processing
- */
-static rtems_interval ticksWhenCalloutsLastChecked;
-static struct callout *callfree, calltodo;
-
-/*
- * FreeBSD variables
- */
-int nfs_diskless_valid;
-
-/*
- * BOOTP values
- */
-struct in_addr rtems_bsdnet_log_host_address;
-struct in_addr rtems_bsdnet_bootp_server_address;
-char *rtems_bsdnet_bootp_boot_file_name;
-char *rtems_bsdnet_domain_name;
-struct in_addr rtems_bsdnet_nameserver[sizeof rtems_bsdnet_config.name_server /
- sizeof rtems_bsdnet_config.name_server[0]];
-int rtems_bsdnet_nameserver_count;
-
-extern rtems_libio_handler_t rtems_bsdnet_io_handler;
-
-/*
- * Perform FreeBSD memory allocation.
- * FIXME: This should be modified to keep memory allocation statistics.
- */
-#undef malloc
-#undef free
-extern void *malloc (size_t);
-extern void free (void *);
-void *
-rtems_bsdnet_malloc (unsigned long size, int type, int flags)
-{
- void *p;
-
- for (;;) {
- p = malloc (size);
- if (p)
- return p;
- if (flags & M_NOWAIT)
- return p;
- /*
- * FIXME: This should be redone as:
- * static volatile int rtems_bsdnet_need_memory;
- *
- * rtems_bsdnet_need_memory = 1;
- * message_queue_receive
- *
- * Then in rtems_bsdnet_freee:
- * free (....);
- * if (rtems_bsdnet_need_memory)
- * rtems_bsdnet_need_memory = 0;
- * message_queue_broadcast
- */
- rtems_task_wake_after (rtems_bsdnet_ticks_per_second);
- }
-}
-
-/*
- * Free FreeBSD memory
- * FIXME: This should be modified to keep memory allocation statistics.
- */
-void
-rtems_bsdnet_free (void *addr, int type)
-{
- free (addr);
-}
-
-/*
- * Do the initializations required by the BSD code
- * FIXME: Maybe we should use a different memory allocation scheme that
- * would let us share space between mbufs and mbuf clusters.
- * For now, we'll just take the easy way out!
- */
-static void
-bsd_init ()
-{
- /*
- * Set up mbuf data strutures
- * Cluster allocation *must* come first -- see comment on kmem_malloc().
- */
- m_clalloc (nmbclusters, M_DONTWAIT);
- mclrefcnt = malloc (nmbclusters);
- if (mclrefcnt == NULL)
- rtems_panic ("No memory for mbuf cluster reference counts.");
- memset (mclrefcnt, '\0', nmbclusters);
- m_mballoc (nmbuf, M_DONTWAIT);
- mbstat.m_mtypes[MT_FREE] = nmbuf;
-
-
- /*
- * Set up domains
- */
- {
- extern struct domain routedomain;
- extern struct domain inetdomain;
-
- routedomain.dom_next = domains;
- domains = &routedomain;
- inetdomain.dom_next = domains;
- domains = &inetdomain;
- domaininit (NULL);
- }
-
- /*
- * Set up interfaces
- */
- ifinit (NULL);
-}
-
-/*
- * Initialize and start network operations
- */
-static void
-rtems_bsdnet_initialize (void)
-{
- rtems_status_code sc;
-
- /*
- * Set the priority of all network tasks
- */
- if (rtems_bsdnet_config.network_task_priority == 0)
- networkDaemonPriority = 100;
- else
- networkDaemonPriority = rtems_bsdnet_config.network_task_priority;
-
- /*
- * Set the memory allocation limits
- */
- if (rtems_bsdnet_config.mbuf_bytecount)
- nmbuf = rtems_bsdnet_config.mbuf_bytecount / MSIZE;
- if (rtems_bsdnet_config.mbuf_cluster_bytecount)
- nmbclusters = rtems_bsdnet_config.mbuf_cluster_bytecount / MCLBYTES;
-
- /*
- * Create the task-synchronization semaphore
- */
- sc = rtems_semaphore_create (rtems_build_name('B', 'S', 'D', 'n'),
- 0,
- RTEMS_FIFO |
- RTEMS_BINARY_SEMAPHORE |
- RTEMS_NO_INHERIT_PRIORITY |
- RTEMS_NO_PRIORITY_CEILING |
- RTEMS_LOCAL,
- 0,
- &networkSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't create network seamphore: `%s'\n", rtems_status_text (sc));
-
- /*
- * Compute clock tick conversion factors
- */
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &rtems_bsdnet_ticks_per_second);
- if (rtems_bsdnet_ticks_per_second <= 0)
- rtems_bsdnet_ticks_per_second = 1;
- rtems_bsdnet_microseconds_per_tick = 1000000 / rtems_bsdnet_ticks_per_second;
-
- /*
- * Ensure that `seconds' is greater than 0
- */
- rtems_task_wake_after (rtems_bsdnet_ticks_per_second);
-
- /*
- * Set up BSD-style sockets
- */
- bsd_init ();
-
- /*
- * Start network daemon
- */
- networkDaemonTid = rtems_bsdnet_newproc ("ntwk", 4096, networkDaemon, NULL);
-
- /*
- * Register as an external I/O handler
- */
- rtems_register_libio_handler (RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET,
- &rtems_bsdnet_io_handler);
-
- /*
- * Let other network tasks begin
- */
- rtems_bsdnet_semaphore_release ();
-}
-
-rtems_id TaskWithSemaphore;
-/*
- * Obtain network mutex
- */
-void
-rtems_bsdnet_semaphore_obtain (void)
-{
- rtems_status_code sc;
-
- sc = rtems_semaphore_obtain (networkSemaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-rtems_task_ident (RTEMS_SELF, 0, &TaskWithSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't obtain network semaphore: `%s'\n", rtems_status_text (sc));
-}
-
-/*
- * Release network mutex
- */
-void
-rtems_bsdnet_semaphore_release (void)
-{
- rtems_status_code sc;
-
-TaskWithSemaphore = 0;
- sc = rtems_semaphore_release (networkSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't release network semaphore: `%s'\n", rtems_status_text (sc));
- }
-
-/*
- * Wait for something to happen to a socket buffer
- */
-int
-sbwait(sb)
- struct sockbuf *sb;
-{
- rtems_event_set events;
- rtems_id tid;
- rtems_status_code sc;
-
- /*
- * Soak up any pending events.
- * The sleep/wakeup synchronization in the FreeBSD
- * kernel has no memory.
- */
- rtems_event_receive (SBWAIT_EVENT, RTEMS_EVENT_ANY | RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Set this task as the target of the wakeup operation.
- */
- if (sb->sb_sel.si_pid)
- rtems_panic ("Another task is already sleeping on that socket buffer");
- rtems_task_ident (RTEMS_SELF, 0, &tid);
- sb->sb_sel.si_pid = tid;
-
- /*
- * Mark the socket buffer as waiting.
- */
- sb->sb_flags |= SB_WAIT;
-
- /*
- * Release the network semaphore.
- */
- rtems_bsdnet_semaphore_release ();
-
- /*
- * Wait for the wakeup event.
- */
- sc = rtems_event_receive (SBWAIT_EVENT, RTEMS_EVENT_ANY | RTEMS_WAIT, sb->sb_timeo, &events);
-
- /*
- * Reobtain the network semaphore.
- */
- rtems_bsdnet_semaphore_obtain ();
-
- /*
- * Relinquish ownership of the socket buffer
- */
- sb->sb_flags &= ~SB_WAIT;
- sb->sb_sel.si_pid = 0;
-
- /*
- * Return the status of the wait.
- */
- switch (sc) {
- case RTEMS_SUCCESSFUL: return 0;
- case RTEMS_TIMEOUT: return EWOULDBLOCK;
- default: return ENXIO;
- }
-}
-
-
-/*
- * Wake up the task waiting on a socket buffer.
- */
-void
-sowakeup(so, sb)
- register struct socket *so;
- register struct sockbuf *sb;
-{
- if (sb->sb_flags & SB_WAIT) {
- sb->sb_flags &= ~SB_WAIT;
- rtems_event_send (sb->sb_sel.si_pid, SBWAIT_EVENT);
- }
-}
-
-/*
- * For now, a socket can be used by only one task at a time.
- */
-int
-sb_lock(sb)
- register struct sockbuf *sb;
-{
- rtems_panic ("Socket buffer is already in use.");
- return 0;
-}
-void
-wakeup (void *p)
-{
- rtems_panic ("Wakeup called");
-}
-
-/*
- * Wait for a connection/disconnection event.
- */
-void
-soconnsleep (struct socket *so)
-{
- rtems_event_set events;
- rtems_id tid;
-
- /*
- * Soak up any pending events.
- * The sleep/wakeup synchronization in the FreeBSD
- * kernel has no memory.
- */
- rtems_event_receive (SOSLEEP_EVENT, RTEMS_EVENT_ANY | RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Set this task as the target of the wakeup operation.
- */
- if (so->so_pgid)
- rtems_panic ("Another task is already sleeping on that socket");
- rtems_task_ident (RTEMS_SELF, 0, &tid);
- so->so_pgid = tid;
-
- /*
- * Wait for the wakeup event.
- */
- rtems_bsdnet_event_receive (SOSLEEP_EVENT, RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Relinquish ownership of the socket.
- */
- so->so_pgid = 0;
-}
-
-/*
- * Wake up a task waiting for a connection/disconnection to complete.
- */
-void
-soconnwakeup (struct socket *so)
-{
- if (so->so_pgid)
- rtems_event_send (so->so_pgid, SOSLEEP_EVENT);
-}
-
-/*
- * Send an event to the network daemon.
- * This corresponds to sending a software interrupt in the BSD kernel.
- */
-void
-rtems_bsdnet_schednetisr (int n)
-{
- rtems_event_send (networkDaemonTid, 1 << n);
-}
-
-/*
- * The network daemon
- * This provides a context to run BSD software interrupts
- */
-static void
-networkDaemon (void *task_argument)
-{
- rtems_event_set events;
- rtems_interval now;
- int ticksPassed;
- unsigned32 timeout;
- struct callout *c;
-
- for (;;) {
- c = calltodo.c_next;
- if (c)
- timeout = c->c_time;
- else
- timeout = RTEMS_NO_TIMEOUT;
- rtems_bsdnet_event_receive (NETISR_EVENTS,
- RTEMS_EVENT_ANY | RTEMS_WAIT,
- timeout,
- &events);
- if (events & NETISR_IP_EVENT)
- ipintr ();
- if (events & NETISR_ARP_EVENT)
- arpintr ();
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- ticksPassed = now - ticksWhenCalloutsLastChecked;
- if (ticksPassed != 0) {
- ticksWhenCalloutsLastChecked = now;
-
- c = calltodo.c_next;
- if (c) {
- c->c_time -= ticksPassed;
- while ((c = calltodo.c_next) != NULL && c->c_time <= 0) {
- void *arg;
- void (*func) (void *);
-
- func = c->c_func;
- arg = c->c_arg;
- calltodo.c_next = c->c_next;
- c->c_next = callfree;
- callfree = c;
- (*func)(arg);
- }
- }
- }
- }
-}
-
-/*
- * Structure passed to task-start stub
- */
-struct newtask {
- void (*entry)(void *);
- void *arg;
-};
-
-/*
- * Task-start stub
- */
-static void
-taskEntry (rtems_task_argument arg)
-{
- struct newtask t;
-
- /*
- * Pick up task information and free
- * the memory allocated to pass the
- * information to this task.
- */
- t = *(struct newtask *)arg;
- free ((struct newtask *)arg);
-
- /*
- * Enter the competition for the network semaphore
- */
- rtems_bsdnet_semaphore_obtain ();
-
- /*
- * Enter the task
- */
- (*t.entry)(t.arg);
- rtems_panic ("Network task returned!\n");
-}
-
-/*
- * Start a network task
- */
-rtems_id
-rtems_bsdnet_newproc (char *name, int stacksize, void(*entry)(void *), void *arg)
-{
- struct newtask *t;
- char nm[4];
- rtems_id tid;
- rtems_status_code sc;
-
- strncpy (nm, name, 4);
- sc = rtems_task_create (rtems_build_name(nm[0], nm[1], nm[2], nm[3]),
- networkDaemonPriority,
- stacksize,
- RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
- RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
- &tid);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't create network daemon `%s': `%s'\n", name, rtems_status_text (sc));
-
- /*
- * Set up task arguments
- */
- t = malloc (sizeof *t);
- t->entry = entry;
- t->arg = arg;
-
- /*
- * Start the task
- */
- sc = rtems_task_start (tid, taskEntry, (rtems_task_argument)t);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't start network daemon `%s': `%s'\n", name, rtems_status_text (sc));
-
- /*
- * Let our caller know the i.d. of the new task
- */
- return tid;
-}
-
-rtems_status_code rtems_bsdnet_event_receive (
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out)
-{
- rtems_status_code sc;
-
- rtems_bsdnet_semaphore_release ();
- sc = rtems_event_receive (event_in, option_set, ticks, event_out);
- rtems_bsdnet_semaphore_obtain ();
- return sc;
-}
-
-/*
- * Return time since startup
- */
-void
-microtime (struct timeval *t)
-{
- rtems_interval now;
-
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- t->tv_sec = now / rtems_bsdnet_ticks_per_second;
- t->tv_usec = (now % rtems_bsdnet_ticks_per_second) * rtems_bsdnet_microseconds_per_tick;
-}
-
-unsigned long
-rtems_bsdnet_seconds_since_boot (void)
-{
- rtems_interval now;
-
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- return now / rtems_bsdnet_ticks_per_second;
-}
-
-/*
- * Fake random number generator
- */
-unsigned long
-rtems_bsdnet_random (void)
-{
- rtems_interval now;
-
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- return (now * 99991);
-}
-
-/*
- * Callout list processing
- */
-void
-timeout(void (*ftn)(void *), void *arg, int ticks)
-{
- register struct callout *new, *p, *t;
-
- if (ticks <= 0)
- ticks = 1;
-
- /* Fill in the next free callout structure. */
- if (callfree == NULL) {
- callfree = malloc (sizeof *callfree);
- if (callfree == NULL)
- rtems_panic ("No memory for timeout table entry");
- callfree->c_next = NULL;
- }
-
- new = callfree;
- callfree = new->c_next;
- new->c_arg = arg;
- new->c_func = ftn;
-
- /*
- * The time for each event is stored as a difference from the time
- * of the previous event on the queue. Walk the queue, correcting
- * the ticks argument for queue entries passed. Correct the ticks
- * value for the queue entry immediately after the insertion point
- * as well. Watch out for negative c_time values; these represent
- * overdue events.
- */
- for (p = &calltodo;
- (t = p->c_next) != NULL && ticks > t->c_time; p = t)
- if (t->c_time > 0)
- ticks -= t->c_time;
- new->c_time = ticks;
- if (t != NULL)
- t->c_time -= ticks;
-
- /* Insert the new entry into the queue. */
- p->c_next = new;
- new->c_next = t;
-}
-
-/*
- * Ticks till specified time
- * FIXME: This version worries only about seconds, but that's good
- * enough for the way the network code uses this routine.
- */
-int
-hzto(struct timeval *tv)
-{
- long diff = tv->tv_sec - rtems_bsdnet_seconds_since_boot();
-
- if (diff <= 0)
- return 1;
- return diff * rtems_bsdnet_ticks_per_second;
-}
-
-/*
- * Kernel debugging
- */
-int rtems_bsdnet_log_priority;
-void
-rtems_bsdnet_log (int priority, const char *fmt, ...)
-{
- va_list args;
-
- if (priority & rtems_bsdnet_log_priority) {
- va_start (args, fmt);
- vprintf (fmt, args);
- va_end (args);
- }
-}
-
-/*
- * Hack alert: kmem_malloc `knows' that its
- * first invocation is to get mbuf clusters!
- */
-int mb_map_full;
-vm_map_t mb_map;
-vm_offset_t
-kmem_malloc (vm_map_t *map, vm_size_t size, boolean_t waitflag)
-{
- void *p;
-
- /*
- * Can't get memory if we're already running.
- */
- if (networkDaemonTid) {
- if (waitflag == M_WAITOK)
- rtems_panic (
-"Network mbuf space can not be enlarged after rtems_bsdnet_initialize() has\n"
-"returned. Enlarge the initial mbuf/cluster size in rtems_bsdnet_config.");
- return 0;
- }
-
-#define ROUNDSIZE 2048
- p = malloc (size+ROUNDSIZE);
- p = (void *)((unsigned long)p & ~(ROUNDSIZE-1));
- if ((p == NULL) && (waitflag == M_WAITOK))
- rtems_panic ("Can't get initial network memory!");
- if (mbutl == NULL)
- mbutl = p;
- return (vm_offset_t)p;
-}
-
-/*
- * IP header checksum routine for processors which don't have an inline version
- */
-u_int
-in_cksum_hdr (const void *ip)
-{
- rtems_unsigned32 sum;
- const rtems_unsigned16 *sp;
- int i;
-
- sum = 0;
- sp = (rtems_unsigned16 *)ip;
- for (i = 0 ; i < 10 ; i++)
- sum += *sp++;
- while (sum > 0xFFFF)
- sum = (sum & 0xffff) + (sum >> 16);
- return ~sum & 0xFFFF;
-}
-
-/*
- * Manipulate routing tables
- */
-int rtems_bsdnet_rtrequest (
- int req,
- struct sockaddr *dst,
- struct sockaddr *gateway,
- struct sockaddr *netmask,
- int flags,
- struct rtentry **net_nrt)
-{
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- error = rtrequest (req, dst, gateway, netmask, flags, net_nrt);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- errno = error;
- return -1;
- }
- return 0;
-}
-
-static void
-rtems_bsdnet_setup (void)
-{
- struct rtems_bsdnet_ifconfig *ifp;
- int s;
- struct ifreq ifreq;
- struct sockaddr_in address;
- struct sockaddr_in netmask;
- struct sockaddr_in broadcast;
- struct sockaddr_in gateway;
- int i;
-
- /*
- * Set local parameters
- */
- if (rtems_bsdnet_config.hostname)
- sethostname (rtems_bsdnet_config.hostname,
- strlen (rtems_bsdnet_config.hostname));
- if (rtems_bsdnet_config.domainname)
- rtems_bsdnet_domain_name =
- strdup (rtems_bsdnet_config.domainname);
- if (rtems_bsdnet_config.log_host)
- rtems_bsdnet_log_host_address.s_addr =
- inet_addr (rtems_bsdnet_config.log_host);
- for (i = 0 ; i < sizeof rtems_bsdnet_config.name_server /
- sizeof rtems_bsdnet_config.name_server[0] ; i++) {
- if (!rtems_bsdnet_config.name_server[i])
- break;
- rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count++].s_addr
- = inet_addr (rtems_bsdnet_config.name_server[i]);
- }
-
- /*
- * Configure interfaces
- */
- s = socket (AF_INET, SOCK_DGRAM, 0);
- if (s < 0)
- rtems_panic ("Can't create initial socket: %s", strerror (errno));
- for (ifp = rtems_bsdnet_config.ifconfig ; ifp ; ifp = ifp->next) {
- if (ifp->ip_address == NULL)
- continue;
-
- /*
- * Get the interface flags
- */
- strcpy (ifreq.ifr_name, ifp->name);
- if (ioctl (s, SIOCGIFFLAGS, &ifreq) < 0)
- rtems_panic ("Can't get %s flags: %s", ifp->name, strerror (errno));
-
- /*
- * Bring interface up
- */
- ifreq.ifr_flags |= IFF_UP;
- if (ioctl (s, SIOCSIFFLAGS, &ifreq) < 0)
- rtems_panic ("Can't bring %s up: %s", ifp->name, strerror (errno));
-
- /*
- * Set interface netmask
- */
- memset (&netmask, '\0', sizeof netmask);
- netmask.sin_len = sizeof netmask;
- netmask.sin_family = AF_INET;
- netmask.sin_addr.s_addr = inet_addr (ifp->ip_netmask);
- memcpy (&ifreq.ifr_addr, &netmask, sizeof netmask);
- if (ioctl (s, SIOCSIFNETMASK, &ifreq) < 0)
- rtems_panic ("Can't set %s netmask: %s", ifp->name, strerror (errno));
-
- /*
- * Set interface address
- */
- memset (&address, '\0', sizeof address);
- address.sin_len = sizeof address;
- address.sin_family = AF_INET;
- address.sin_addr.s_addr = inet_addr (ifp->ip_address);
- memcpy (&ifreq.ifr_addr, &address, sizeof address);
- if (ioctl (s, SIOCSIFADDR, &ifreq) < 0)
- rtems_panic ("Can't set %s address: %s", ifp->name, strerror (errno));
-
- /*
- * Set interface broadcast address
- */
- memset (&broadcast, '\0', sizeof broadcast);
- broadcast.sin_len = sizeof broadcast;
- broadcast.sin_family = AF_INET;
- broadcast.sin_addr.s_addr = address.sin_addr.s_addr | ~netmask.sin_addr.s_addr;
- memcpy (&ifreq.ifr_broadaddr, &broadcast, sizeof broadcast);
- if (ioctl (s, SIOCSIFBRDADDR, &ifreq) < 0)
- rtems_panic ("Can't set %s broadcast address: %s", ifp->name, strerror (errno));
- }
-
- /*
- * We're done with the dummy socket
- */
- close (s);
-
- /*
- * Set default route
- */
- if (rtems_bsdnet_config.gateway) {
- address.sin_addr.s_addr = INADDR_ANY;
- netmask.sin_addr.s_addr = INADDR_ANY;
- memset (&gateway, '\0', sizeof gateway);
- gateway.sin_len = sizeof gateway;
- gateway.sin_family = AF_INET;
- gateway.sin_addr.s_addr = inet_addr (rtems_bsdnet_config.gateway);
- if (rtems_bsdnet_rtrequest (
- RTM_ADD,
- (struct sockaddr *)&address,
- (struct sockaddr *)&gateway,
- (struct sockaddr *)&netmask,
- (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL) < 0)
- rtems_panic ("Can't set default route: %s", strerror (errno));
- }
-}
-
-/*
- * Initialize the network
- */
-int
-rtems_bsdnet_initialize_network (void)
-{
- struct rtems_bsdnet_ifconfig *ifp;
-
- /*
- * Start network tasks.
- * Initialize BSD network data structures.
- */
- rtems_bsdnet_initialize ();
-
- /*
- * Attach interfaces
- */
- for (ifp = rtems_bsdnet_config.ifconfig ; ifp ; ifp = ifp->next) {
- rtems_bsdnet_semaphore_obtain ();
- (ifp->attach)(ifp);
- rtems_bsdnet_semaphore_release ();
- }
-
- /*
- * Bring up the network
- */
- rtems_bsdnet_setup ();
- if (rtems_bsdnet_config.bootp)
- (*rtems_bsdnet_config.bootp)();
- return 0;
-}
diff --git a/c/src/lib/libnetworking/rtems/rtems_showicmpstat.c b/c/src/lib/libnetworking/rtems/rtems_showicmpstat.c
deleted file mode 100644
index 1faea2512b..0000000000
--- a/c/src/lib/libnetworking/rtems/rtems_showicmpstat.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/icmp_var.h>
-
-/*
- * Display ICMP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showicmpstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_icmp_stats (void)
-{
- int i;
- char cbuf[20];
-
- printf ("************ ICMP Statistics ************\n");
- showicmpstat ("Calls to icmp_error()", icmpstat.icps_error);
- showicmpstat ("Errors not sent -- old was icmp", icmpstat.icps_oldicmp);
- for (i = 0 ; i <= ICMP_MAXTYPE ; i++) {
- if (icmpstat.icps_outhist[i]) {
- sprintf (cbuf, "Type %d sent", i);
- showicmpstat (cbuf, icmpstat.icps_outhist[i]);
- }
- }
- showicmpstat ("icmp_code out of range", icmpstat.icps_badcode);
- showicmpstat ("packet < ICMP_MINLEN", icmpstat.icps_tooshort);
- showicmpstat ("bad checksum", icmpstat.icps_checksum);
- showicmpstat ("calculated bound mismatch", icmpstat.icps_badlen);
- showicmpstat ("number of responses", icmpstat.icps_reflect);
- showicmpstat ("b/mcast echo requests dropped", icmpstat.icps_bmcastecho);
- showicmpstat ("b/mcast tstamp requests dropped", icmpstat.icps_bmcasttstamp);
- for (i = 0 ; i <= ICMP_MAXTYPE ; i++) {
- if (icmpstat.icps_inhist[i]) {
- sprintf (cbuf, "Type %d received", i);
- showicmpstat (cbuf, icmpstat.icps_inhist[i]);
- }
- }
-
- printf ("\n");
-}
diff --git a/c/src/lib/libnetworking/rtems/rtems_showifstat.c b/c/src/lib/libnetworking/rtems/rtems_showifstat.c
deleted file mode 100644
index 9f9efc5ac2..0000000000
--- a/c/src/lib/libnetworking/rtems/rtems_showifstat.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <netinet/in.h>
-
-/*
- * Display an address
- */
-static int
-showaddress (char *name, struct sockaddr *a)
-{
- struct sockaddr_in *sa;
-
- if (!a || (a->sa_family != AF_INET))
- return 0;
- printf ("%s:", name);
- sa = (struct sockaddr_in *)a;
- printf ("%-16s", inet_ntoa (sa->sin_addr));
- return 1;
-}
-
-/*
- * Display interface statistics
- */
-void
-rtems_bsdnet_show_if_stats (void)
-{
- struct ifnet *ifp;
- struct ifaddr *ifa;
- unsigned int bit, flags;
- int printed;
-
- printf ("************ INTERFACE STATISTICS ************\n");
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- printf ("***** %s%d *****\n", ifp->if_name, ifp->if_unit);
- for (ifa = ifp->if_addrlist ; ifa ; ifa = ifa->ifa_next) {
- printed = showaddress ("Address", ifa->ifa_addr);
- if (ifp->if_flags & IFF_BROADCAST)
- printed |= showaddress ("Broadcast Address", ifa->ifa_broadaddr);
- if (ifp->if_flags & IFF_POINTOPOINT)
- printed |= showaddress ("Destination Address", ifa->ifa_dstaddr);
- printed |= showaddress ("Net mask", ifa->ifa_netmask);
- if (printed)
- printf ("\n");
- }
-
- printf ("Flags:");
- for (bit = 1, flags = ifp->if_flags ; flags ; bit <<= 1) {
- char *cp;
- switch (flags & bit) {
- default: cp = NULL; break;
- case IFF_UP: cp = "Up"; break;
- case IFF_BROADCAST: cp = "Broadcast"; break;
- case IFF_DEBUG: cp = "Debug"; break;
- case IFF_LOOPBACK: cp = "Loopback"; break;
- case IFF_POINTOPOINT: cp = "Point-to-point"; break;
- case IFF_RUNNING: cp = "Running"; break;
- case IFF_NOARP: cp = "No-ARP"; break;
- case IFF_PROMISC: cp = "Promiscuous"; break;
- case IFF_ALLMULTI: cp = "All-multicast"; break;
- case IFF_OACTIVE: cp = "Active"; break;
- case IFF_SIMPLEX: cp = "Simplex"; break;
- case IFF_LINK0: cp = "Link0"; break;
- case IFF_LINK1: cp = "Link1"; break;
- case IFF_LINK2: cp = "Link2"; break;
- case IFF_MULTICAST: cp = "Multicast"; break;
- }
- if (cp) {
- flags &= ~bit;
- printf (" %s", cp);
- }
- }
- printf ("\n");
-
- printf ("Send queue limit:%-4d length:%-4d Dropped:%-8d\n",
- ifp->if_snd.ifq_maxlen,
- ifp->if_snd.ifq_len,
- ifp->if_snd.ifq_drops);
-
- /*
- * FIXME: Could print if_data statistics here,
- * but right now the drivers maintain their
- * own statistics.
- */
-
- /*
- * Grab the network semaphore.
- * In most cases this is not necessary, but it's
- * easier to always call the driver ioctl function
- * while holding the semaphore than to try
- * and explain why some ioctl commands are invoked
- * while holding the semaphore and others are
- * invoked while not holding the semaphore.
- */
- rtems_bsdnet_semaphore_obtain ();
- (*ifp->if_ioctl)(ifp, SIO_RTEMS_SHOW_STATS, NULL);
- rtems_bsdnet_semaphore_release ();
- }
- printf ("\n");
-}
diff --git a/c/src/lib/libnetworking/rtems/rtems_showipstat.c b/c/src/lib/libnetworking/rtems/rtems_showipstat.c
deleted file mode 100644
index 2dd499a8c0..0000000000
--- a/c/src/lib/libnetworking/rtems/rtems_showipstat.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-
-/*
- * Display IP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showipstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_ip_stats (void)
-{
- printf ("************ IP Statistics ************\n");
- showipstat ("total packets received", ipstat.ips_total);
- showipstat ("checksum bad", ipstat.ips_badsum);
- showipstat ("packet too short", ipstat.ips_tooshort);
- showipstat ("not enough data", ipstat.ips_toosmall);
- showipstat ("ip header length < data size", ipstat.ips_badhlen);
- showipstat ("ip length < ip header length", ipstat.ips_badlen);
- showipstat ("fragments received", ipstat.ips_fragments);
- showipstat ("frags dropped (dups, out of space)", ipstat.ips_fragdropped);
- showipstat ("fragments timed out", ipstat.ips_fragtimeout);
- showipstat ("packets forwarded", ipstat.ips_forward);
- showipstat ("packets rcvd for unreachable dest", ipstat.ips_cantforward);
- showipstat ("packets forwarded on same net", ipstat.ips_redirectsent);
- showipstat ("unknown or unsupported protocol", ipstat.ips_noproto);
- showipstat ("datagrams delivered to upper level", ipstat.ips_delivered);
- showipstat ("total ip packets generated here", ipstat.ips_localout);
- showipstat ("lost packets due to nobufs, etc.", ipstat.ips_odropped);
- showipstat ("total packets reassembled ok", ipstat.ips_reassembled);
- showipstat ("datagrams successfully fragmented", ipstat.ips_fragmented);
- showipstat ("output fragments created", ipstat.ips_ofragments);
- showipstat ("don't fragment flag was set, etc.", ipstat.ips_cantfrag);
- showipstat ("error in option processing", ipstat.ips_badoptions);
- showipstat ("packets discarded due to no route", ipstat.ips_noroute);
- showipstat ("ip version != 4", ipstat.ips_badvers);
- showipstat ("total raw ip packets generated", ipstat.ips_rawout);
- showipstat ("ip length > max ip packet size", ipstat.ips_toolong);
- printf ("\n");
-}
diff --git a/c/src/lib/libnetworking/rtems/rtems_showmbuf.c b/c/src/lib/libnetworking/rtems/rtems_showmbuf.c
deleted file mode 100644
index 39523bd00a..0000000000
--- a/c/src/lib/libnetworking/rtems/rtems_showmbuf.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-
-/*
- * Display MBUF statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-void
-rtems_bsdnet_show_mbuf_stats (void)
-{
- int i;
- int printed = 0;
- char *cp;
-
- printf ("************ MBUF STATISTICS ************\n");
- printf ("mbufs:%4lu clusters:%4lu free:%4lu\n",
- mbstat.m_mbufs, mbstat.m_clusters, mbstat.m_clfree);
- printf ("drops:%4lu waits:%4lu drains:%4lu\n",
- mbstat.m_drops, mbstat.m_wait, mbstat.m_drain);
- for (i = 0 ; i < 20 ; i++) {
- switch (i) {
- case MT_FREE: cp = "free"; break;
- case MT_DATA: cp = "data"; break;
- case MT_HEADER: cp = "header"; break;
- case MT_SOCKET: cp = "socket"; break;
- case MT_PCB: cp = "pcb"; break;
- case MT_RTABLE: cp = "rtable"; break;
- case MT_HTABLE: cp = "htable"; break;
- case MT_ATABLE: cp = "atable"; break;
- case MT_SONAME: cp = "soname"; break;
- case MT_SOOPTS: cp = "soopts"; break;
- case MT_FTABLE: cp = "ftable"; break;
- case MT_RIGHTS: cp = "rights"; break;
- case MT_IFADDR: cp = "ifaddr"; break;
- case MT_CONTROL: cp = "control"; break;
- case MT_OOBDATA: cp = "oobdata"; break;
- default: cp = NULL; break;
- }
- if ((cp != NULL) || (mbstat.m_mtypes[i] != 0)) {
- char cbuf[16];
- if (cp == NULL) {
- sprintf (cbuf, "Type %d", i);
- cp = cbuf;
- }
- printf ("%10s:%-8u", cp, mbstat.m_mtypes[i]);
- if (++printed == 4) {
- printf ("\n");
- printed = 0;
- }
- }
- }
- if (printed)
- printf ("\n");
- printf ("\n");
-}
diff --git a/c/src/lib/libnetworking/rtems/rtems_showroute.c b/c/src/lib/libnetworking/rtems/rtems_showroute.c
deleted file mode 100644
index b8196de8d3..0000000000
--- a/c/src/lib/libnetworking/rtems/rtems_showroute.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * $Id$
- */
-
-#include <stdlib.h>
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-
-#include <arpa/inet.h>
-
-/*
- * We'll use the application versions of malloc and free.
- */
-#undef malloc
-#undef free
-
-/*
- * Information per route
- */
-struct rinfo {
- struct sockaddr dst;
- union {
- struct sockaddr sa;
- struct sockaddr_in sin;
- struct sockaddr_dl sdl;
- } un;
- unsigned long pksent;
- unsigned long expire;
- int flags;
- char ifname[16];
- short ifunit;
- short refcnt;
-};
-
-/*
- * Information per display
- */
-struct dinfo {
- int capacity;
- int count;
- struct rinfo *routes;
-};
-
-/*
- * Copy address
- */
-static void
-copyAddress (void *to, void *from, int tolen)
-{
- int ncopy;
- struct sockaddr dummy;
-
- if (from == NULL) {
- /*
- * Create a fake address of unspecified type
- */
- from = &dummy;
- dummy.sa_len = 4;
- dummy.sa_family = AF_UNSPEC;
- }
- ncopy = ((struct sockaddr *)from)->sa_len;
- if (ncopy > tolen)
- ncopy = tolen;
- memcpy (to, from, ncopy);
-}
-
-/*
- * Package everything up before printing it.
- * We don't want to block all network operations till
- * the printing completes!
- */
-static int
-show_inet_route (rn, vw)
- struct radix_node *rn;
- void *vw;
-{
- struct rtentry *rt = (struct rtentry *)rn;
- struct ifnet *ifp;
- struct dinfo *dp = (struct dinfo *)vw;
- struct rinfo *r;
-
- /*
- * Get a pointer to a new route info structure
- */
- if (dp->count >= dp->capacity) {
- r = realloc (dp->routes, (sizeof *r) * (dp->capacity + 20));
- if (r == 0)
- return ENOMEM;
- dp->capacity += 20;
- dp->routes = r;
- }
- r = dp->routes + dp->count++;
-
- /*
- * Fill in the route info structure
- */
- copyAddress (&r->dst, rt_key(rt), sizeof r->dst);
- if (rt->rt_flags & (RTF_GATEWAY | RTF_HOST)) {
- copyAddress (&r->un, rt->rt_gateway, sizeof r->un);
- }
- else {
- /*
- * Create a fake address to hold the mask
- */
- struct sockaddr_in dummy;
-
- dummy.sin_family = AF_INET;
- dummy.sin_len = sizeof dummy;
- dummy.sin_addr = ((struct sockaddr_in *)rt_mask(rt))->sin_addr;
- copyAddress (&r->un, &dummy, sizeof r->un);
- }
- r->flags = rt->rt_flags;
- r->refcnt = rt->rt_refcnt;
- r->pksent = rt->rt_rmx.rmx_pksent;
- r->expire = rt->rt_rmx.rmx_expire;
- ifp = rt->rt_ifp;
- strncpy (r->ifname, ifp->if_name, sizeof r->ifname);
- r->ifunit = ifp->if_unit;
- return 0;
-}
-
-/*
- * Convert link address to ASCII
- */
-static char *
-link_ascii (struct sockaddr_dl *sdl, char *buf, int bufsize)
-{
- char *cp;
- int i;
- int first = 1;
- int nleft = sdl->sdl_alen;
- unsigned char *ap = LLADDR (sdl);
- static const char hextab[16] = "0123456789ABCDEF";
-
- cp = buf;
- while (nleft && (bufsize > 4)) {
- if (first) {
- first = 0;
- }
- else {
- *cp++ = ':';
- bufsize--;
- }
- i = *ap++;
- *cp++ = hextab[(i >> 4) & 0xf];
- *cp++ = hextab[i & 0xf];
- nleft--;
- bufsize -= 2;
- }
- *cp = '\0';
- return buf;
-}
-
-void
-rtems_bsdnet_show_inet_routes (void)
-{
- struct radix_node_head *rnh;
- struct dinfo d;
- struct rinfo *r;
- int i, error;
-
- /*
- * For now we'll handle only AF_INET
- */
- rnh = rt_tables[AF_INET];
- if (!rnh)
- return;
- d.count = d.capacity = 0;
- d.routes = NULL;
- rtems_bsdnet_semaphore_obtain ();
- error = rnh->rnh_walktree(rnh, show_inet_route, &d);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- printf ("Can't get route info: %s\n", strerror (error));
- return;
- }
- if (d.count == 0) {
- printf ("No routes!\n");
- return;
- }
- printf ("Destination Gateway/Mask/Hw Flags Refs Use Expire Interface\n");
- for (i = 0, r = d.routes ; i < d.count ; i++, r++) {
- char buf[30];
- char *cp, *fc, flagbuf[10];
- const char *addr;
- unsigned long flagbit;
- struct sockaddr_in *sin;
-
- sin = (struct sockaddr_in *)&r->dst;
- if (sin->sin_addr.s_addr == INADDR_ANY)
- addr = "default";
- else
- addr = inet_ntop (AF_INET, &sin->sin_addr, buf, sizeof buf);
- printf ("%-16s", addr);
- switch (r->un.sa.sa_family) {
- case AF_INET:
- addr = inet_ntop (AF_INET, &r->un.sin.sin_addr, buf, sizeof buf);
- break;
-
- case AF_LINK:
- addr = link_ascii (&r->un.sdl, buf, sizeof buf);
- break;
-
- default:
- addr = "";
- break;
- }
- printf ("%-19s", addr);
- fc = "UGHRDM XLS";
- for (flagbit = 0x1, cp = flagbuf ; *fc ; flagbit <<= 1, fc++) {
- if ((r->flags & flagbit) && (*fc != ' '))
- *cp++ = *fc;
- }
- *cp = '\0';
- printf ("%-10s%3d%9ld%7ld %.*s%d\n", flagbuf,
- r->refcnt, r->pksent,
- r->expire,
- (int)sizeof r->ifname, r->ifname,
- r->ifunit);
- }
- free (d.routes);
-}
diff --git a/c/src/lib/libnetworking/rtems/rtems_showtcpstat.c b/c/src/lib/libnetworking/rtems/rtems_showtcpstat.c
deleted file mode 100644
index b9a0366819..0000000000
--- a/c/src/lib/libnetworking/rtems/rtems_showtcpstat.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_var.h>
-
-/*
- * Display TCP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showtcpstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_tcp_stats (void)
-{
- printf ("************ TCP Statistics ************\n");
- showtcpstat ("connections initiated", tcpstat.tcps_connattempt);
- showtcpstat ("connections accepted", tcpstat.tcps_accepts);
- showtcpstat ("connections established", tcpstat.tcps_connects);
- showtcpstat ("connections dropped", tcpstat.tcps_drops);
- showtcpstat ("embryonic connections dropped", tcpstat.tcps_conndrops);
- showtcpstat ("conn. closed (includes drops)", tcpstat.tcps_closed);
- showtcpstat ("segs where we tried to get rtt", tcpstat.tcps_segstimed);
- showtcpstat ("times we succeeded", tcpstat.tcps_rttupdated);
- showtcpstat ("delayed acks sent", tcpstat.tcps_delack);
- showtcpstat ("conn. dropped in rxmt timeout", tcpstat.tcps_timeoutdrop);
- showtcpstat ("retransmit timeouts", tcpstat.tcps_rexmttimeo);
- showtcpstat ("persist timeouts", tcpstat.tcps_persisttimeo);
- showtcpstat ("keepalive timeouts", tcpstat.tcps_keeptimeo);
- showtcpstat ("keepalive probes sent", tcpstat.tcps_keepprobe);
- showtcpstat ("connections dropped in keepalive", tcpstat.tcps_keepdrops);
-
- showtcpstat ("total packets sent", tcpstat.tcps_sndtotal);
- showtcpstat ("data packets sent", tcpstat.tcps_sndpack);
- showtcpstat ("data bytes sent", tcpstat.tcps_sndbyte);
- showtcpstat ("data packets retransmitted", tcpstat.tcps_sndrexmitpack);
- showtcpstat ("data bytes retransmitted", tcpstat.tcps_sndrexmitbyte);
- showtcpstat ("ack-only packets sent", tcpstat.tcps_sndacks);
- showtcpstat ("window probes sent", tcpstat.tcps_sndprobe);
- showtcpstat ("packets sent with URG only", tcpstat.tcps_sndurg);
- showtcpstat ("window update-only packets sent", tcpstat.tcps_sndwinup);
- showtcpstat ("control (SYN|FIN|RST) packets sent", tcpstat.tcps_sndctrl);
-
- showtcpstat ("total packets received", tcpstat.tcps_rcvtotal);
- showtcpstat ("packets received in sequence", tcpstat.tcps_rcvpack);
- showtcpstat ("bytes received in sequence", tcpstat.tcps_rcvbyte);
- showtcpstat ("packets received with ccksum errs", tcpstat.tcps_rcvbadsum);
- showtcpstat ("packets received with bad offset", tcpstat.tcps_rcvbadoff);
- showtcpstat ("packets received too short", tcpstat.tcps_rcvshort);
- showtcpstat ("duplicate-only packets received", tcpstat.tcps_rcvduppack);
- showtcpstat ("duplicate-only bytes received", tcpstat.tcps_rcvdupbyte);
- showtcpstat ("packets with some duplicate data", tcpstat.tcps_rcvpartduppack);
- showtcpstat ("dup. bytes in part-dup. packets", tcpstat.tcps_rcvpartdupbyte);
- showtcpstat ("out-of-order packets received", tcpstat.tcps_rcvoopack);
- showtcpstat ("out-of-order bytes received", tcpstat.tcps_rcvoobyte);
- showtcpstat ("packets with data after window", tcpstat.tcps_rcvpackafterwin);
- showtcpstat ("bytes rcvd after window", tcpstat.tcps_rcvbyteafterwin);
- showtcpstat ("packets rcvd after \"close\"", tcpstat.tcps_rcvafterclose);
- showtcpstat ("rcvd window probe packets", tcpstat.tcps_rcvwinprobe);
- showtcpstat ("rcvd duplicate acks", tcpstat.tcps_rcvdupack);
- showtcpstat ("rcvd acks for unsent data", tcpstat.tcps_rcvacktoomuch);
- showtcpstat ("rcvd ack packets", tcpstat.tcps_rcvackpack);
- showtcpstat ("bytes acked by rcvd acks", tcpstat.tcps_rcvackbyte);
- showtcpstat ("rcvd window update packets", tcpstat.tcps_rcvwinupd);
- showtcpstat ("segments dropped due to PAWS", tcpstat.tcps_pawsdrop);
- showtcpstat ("times hdr predict ok for acks", tcpstat.tcps_predack);
- showtcpstat ("times hdr predict ok for data pkts", tcpstat.tcps_preddat);
- showtcpstat ("pcb cache misses", tcpstat.tcps_pcbcachemiss);
- showtcpstat ("times cached RTT in route updated", tcpstat.tcps_cachedrtt);
- showtcpstat ("times cached rttvar updated", tcpstat.tcps_cachedrttvar);
- showtcpstat ("times cached ssthresh updated", tcpstat.tcps_cachedssthresh);
- showtcpstat ("times RTT initialized from route", tcpstat.tcps_usedrtt);
- showtcpstat ("times RTTVAR initialized from rt", tcpstat.tcps_usedrttvar);
- showtcpstat ("times ssthresh initialized from rt", tcpstat.tcps_usedssthresh);
- showtcpstat ("timeout in persist state", tcpstat.tcps_persistdrop);
- showtcpstat ("bogus SYN, e.g. premature ACK", tcpstat.tcps_badsyn);
- showtcpstat ("resends due to MTU discovery", tcpstat.tcps_mturesent);
- showtcpstat ("listen queue overflows", tcpstat.tcps_listendrop);
- printf ("\n");
-}
diff --git a/c/src/lib/libnetworking/rtems/rtems_showudpstat.c b/c/src/lib/libnetworking/rtems/rtems_showudpstat.c
deleted file mode 100644
index 1fc2d15a0b..0000000000
--- a/c/src/lib/libnetworking/rtems/rtems_showudpstat.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-
-/*
- * Display UDP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showudpstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_udp_stats (void)
-{
- printf ("************ UDP Statistics ************\n");
- showudpstat ("total input packets", udpstat.udps_ipackets);
- showudpstat ("packet shorter than header", udpstat.udps_hdrops);
- showudpstat ("checksum error", udpstat.udps_badsum);
- showudpstat ("data length larger than packet", udpstat.udps_badlen);
- showudpstat ("no socket on port", udpstat.udps_noport);
- showudpstat ("of above, arrived as broadcast", udpstat.udps_noportbcast);
- showudpstat ("not delivered, input socket full", udpstat.udps_fullsock);
- showudpstat ("input packets missing pcb cache", udpstat.udpps_pcbcachemiss);
- showudpstat ("input packets not for hashed pcb", udpstat.udpps_pcbhashmiss);
- showudpstat ("total output packets", udpstat.udps_opackets);
- printf ("\n");
-}
diff --git a/c/src/lib/libnetworking/rtems/rtems_syscall.c b/c/src/lib/libnetworking/rtems/rtems_syscall.c
deleted file mode 100644
index 782a2f907b..0000000000
--- a/c/src/lib/libnetworking/rtems/rtems_syscall.c
+++ /dev/null
@@ -1,761 +0,0 @@
-/*
- * $Id$
- */
-
-#include <string.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/error.h>
-#include <rtems/rtems_bsdnet.h>
-
-#include <sys/errno.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/proc.h>
-#include <sys/filio.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-/*
- *********************************************************************
- * Map RTEMS file descriptor to BSD socket *
- *********************************************************************
- */
-struct fdsock {
- int indexFreeNext;
- struct socket *sock;
-};
-static struct fdsock *fdsock;
-static int fdsockCount;
-static int indexFreeHead = -1;
-
-/*
- * Convert an RTEMS file descriptor to a BSD socket pointer.
- */
-static struct socket *
-fdToSocket (int fd)
-{
- int i;
- struct socket *s;
-
- if ((fd < 0)
- || (rtems_file_descriptor_type(fd) != RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET)
- || ((i = rtems_file_descriptor_base(fd)) >= fdsockCount)
- || ((s = fdsock[i].sock) == NULL)) {
- errno = EBADF;
- return NULL;
- }
- return s;
-}
-
-/*
- * Enlarge the size of the file-descritor/socket pointer map.
- */
-static int
-enlargeFdMap (void)
-{
- struct fdsock *nfdsock;
- int i;
-
- nfdsock = realloc (fdsock, sizeof *fdsock * (fdsockCount + 20));
- if (nfdsock == NULL) {
- errno = ENFILE;
- return 0;
- }
- fdsock = nfdsock;
- for (i = fdsockCount, fdsockCount += 20 ; i < fdsockCount ; i++) {
- fdsock[i].sock = NULL;
- fdsock[i].indexFreeNext = indexFreeHead;
- indexFreeHead = i;
- }
- return 1;
-}
-
-/*
- * Create a file descriptor for a new socket
- */
-static int
-makeFd (struct socket *s)
-{
- int i;
-
- if ((indexFreeHead < 0) && !enlargeFdMap ())
- return -1;
- i = indexFreeHead;
- indexFreeHead = fdsock[i].indexFreeNext;
- fdsock[i].sock = s;
- return rtems_make_file_descriptor(i,RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET);
-}
-
-/*
- * Package system call argument into mbuf.
- */
-static int
-sockargstombuf (struct mbuf **mp, const void *buf, int buflen, int type)
-{
- struct mbuf *m;
-
- if ((u_int)buflen > MLEN)
- return (EINVAL);
- m = m_get(M_WAIT, type);
- if (m == NULL)
- return (ENOBUFS);
- m->m_len = buflen;
- memcpy (mtod(m, caddr_t), buf, buflen);
- *mp = m;
- if (type == MT_SONAME) {
- struct sockaddr *sa;
- sa = mtod(m, struct sockaddr *);
- sa->sa_len = buflen;
- }
- return 0;
-}
-
-/*
- *********************************************************************
- * BSD-style entry points *
- *********************************************************************
- */
-int
-socket (int domain, int type, int protocol)
-{
- int fd = -1;
- int error;
- struct socket *so;
-
- rtems_bsdnet_semaphore_obtain ();
- error = socreate(domain, &so, type, protocol, NULL);
- if (error == 0) {
- fd = makeFd (so);
- if (fd < 0)
- soclose (so);
- }
- else {
- errno = error;
- fd = -1;
- }
- rtems_bsdnet_semaphore_release ();
- return fd;
-}
-
-int
-bind (int s, struct sockaddr *name, int namelen)
-{
- int error;
- int ret = -1;
- struct socket *so;
- struct mbuf *nam;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) != NULL) {
- error = sockargstombuf (&nam, name, namelen, MT_SONAME);
- if (error == 0) {
- error = sobind (so, nam);
- if (error == 0)
- ret = 0;
- else
- errno = error;
- m_freem (nam);
- }
- else {
- errno = error;
- }
- }
- rtems_bsdnet_semaphore_release ();
- return ret;
-}
-
-int
-connect (int s, struct sockaddr *name, int namelen)
-{
- int error;
- int ret = -1;
- struct socket *so;
- struct mbuf *nam;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((so->so_state & SS_NBIO) && (so->so_state & SS_ISCONNECTING)) {
- errno = EALREADY;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- error = sockargstombuf (&nam, name, namelen, MT_SONAME);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- error = soconnect (so, nam);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((so->so_state & SS_NBIO) && (so->so_state & SS_ISCONNECTING)) {
- m_freem(nam);
- errno = EINPROGRESS;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) {
- soconnsleep (so);
- }
- if (error == 0) {
- error = so->so_error;
- so->so_error = 0;
- }
- so->so_state &= ~SS_ISCONNECTING;
- m_freem (nam);
- if (error == 0)
- ret = 0;
- rtems_bsdnet_semaphore_release ();
- return ret;
-}
-
-int
-listen (int s, int backlog)
-{
- int error;
- int ret = -1;
- struct socket *so;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) != NULL) {
- error = solisten (so, backlog);
- if (error == 0)
- ret = 0;
- else
- errno = error;
- }
- rtems_bsdnet_semaphore_release ();
- return ret;
-}
-
-int
-accept (int s, struct sockaddr *name, int *namelen)
-{
- int fd;
- struct socket *head, *so;
- struct mbuf *nam;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((head = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((head->so_options & SO_ACCEPTCONN) == 0) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((head->so_state & SS_NBIO) && head->so_comp.tqh_first == NULL) {
- errno = EWOULDBLOCK;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- while (head->so_comp.tqh_first == NULL && head->so_error == 0) {
- if (head->so_state & SS_CANTRCVMORE) {
- head->so_error = ECONNABORTED;
- break;
- }
- soconnsleep (head);
- }
- if (head->so_error) {
- errno = head->so_error;
- head->so_error = 0;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
-
- so = head->so_comp.tqh_first;
- TAILQ_REMOVE(&head->so_comp, so, so_list);
- head->so_qlen--;
-
- fd = makeFd (so);
- if (fd < 0) {
- TAILQ_INSERT_HEAD(&head->so_comp, so, so_list);
- head->so_qlen++;
- soconnwakeup (head);
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- so->so_state &= ~SS_COMP;
- so->so_head = NULL;
-
- nam = m_get(M_WAIT, MT_SONAME);
- (void) soaccept(so, nam);
- if (name) {
- /* check length before it is destroyed */
- if (*namelen > nam->m_len)
- *namelen = nam->m_len;
- memcpy (name, mtod(nam, caddr_t), *namelen);
- }
- m_freem(nam);
- rtems_bsdnet_semaphore_release ();
- return (fd);
-
-}
-
-/*
- * All `transmit' operations end up calling this routine.
- */
-ssize_t
-sendmsg (int s, const struct msghdr *mp, int flags)
-{
- int ret = -1;
- int error;
- struct uio auio;
- struct iovec *iov;
- struct socket *so;
- struct mbuf *to, *control;
- int i;
- int len;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- auio.uio_iov = mp->msg_iov;
- auio.uio_iovcnt = mp->msg_iovlen;
- auio.uio_segflg = UIO_USERSPACE;
- auio.uio_rw = UIO_WRITE;
- auio.uio_offset = 0;
- auio.uio_resid = 0;
- iov = mp->msg_iov;
- for (i = 0; i < mp->msg_iovlen; i++, iov++) {
- if ((auio.uio_resid += iov->iov_len) < 0) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- if (mp->msg_name) {
- error = sockargstombuf (&to, mp->msg_name, mp->msg_namelen, MT_SONAME);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- else {
- to = NULL;
- }
- if (mp->msg_control) {
- if (mp->msg_controllen < sizeof (struct cmsghdr)) {
- errno = EINVAL;
- if (to)
- m_freem(to);
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- sockargstombuf (&control, mp->msg_control, mp->msg_controllen, MT_CONTROL);
- }
- else {
- control = NULL;
- }
- len = auio.uio_resid;
- error = sosend (so, to, &auio, (struct mbuf *)0, control, flags);
- if (error) {
- if (auio.uio_resid != len && (error == EINTR || error == EWOULDBLOCK))
- error = 0;
- }
- if (error)
- errno = error;
- else
- ret = len - auio.uio_resid;
- if (to)
- m_freem(to);
- rtems_bsdnet_semaphore_release ();
- return (ret);
-}
-
-/*
- * Send a message to a host
- */
-ssize_t
-sendto (int s, const void *buf, size_t buflen, int flags, const struct sockaddr *to, int tolen)
-{
- struct msghdr msg;
- struct iovec iov;
-
- iov.iov_base = (void *)buf;
- iov.iov_len = buflen;
- msg.msg_name = (caddr_t)to;
- msg.msg_namelen = tolen;
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
- msg.msg_control = NULL;
- msg.msg_controllen = 0;
- return sendmsg (s, &msg, flags);
-}
-
-/*
- * Send a message to a connected host
- */
-ssize_t
-send (int s, const void *buf, size_t buflen, int flags)
-{
- return sendto (s, buf, buflen, flags, NULL, 0);
-}
-
-/*
- * All `receive' operations end up calling this routine.
- */
-ssize_t
-recvmsg (int s, struct msghdr *mp, int flags)
-{
- int ret = -1;
- int error;
- struct uio auio;
- struct iovec *iov;
- struct socket *so;
- struct mbuf *from = NULL, *control = NULL;
- int i;
- int len;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- auio.uio_iov = mp->msg_iov;
- auio.uio_iovcnt = mp->msg_iovlen;
- auio.uio_segflg = UIO_USERSPACE;
- auio.uio_rw = UIO_READ;
- auio.uio_offset = 0;
- auio.uio_resid = 0;
- iov = mp->msg_iov;
- for (i = 0; i < mp->msg_iovlen; i++, iov++) {
- if ((auio.uio_resid += iov->iov_len) < 0) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- len = auio.uio_resid;
- mp->msg_flags = flags;
- error = soreceive (so, &from, &auio, (struct mbuf **)NULL,
- mp->msg_control ? &control : (struct mbuf **)NULL,
- &mp->msg_flags);
- if (error) {
- if (auio.uio_resid != len && (error == EINTR || error == EWOULDBLOCK))
- error = 0;
- }
- if (error) {
- errno = error;
- }
- else {
- ret = len - auio.uio_resid;
- if (mp->msg_name) {
- len = mp->msg_namelen;
- if ((len <= 0) || (from == NULL)) {
- len = 0;
- }
- else {
- if (len > from->m_len)
- len = from->m_len;
- memcpy (mp->msg_name, mtod(from, caddr_t), len);
- }
- mp->msg_namelen = len;
- }
- if (mp->msg_control) {
- struct mbuf *m;
- caddr_t ctlbuf;
-
- len = mp->msg_controllen;
- m = control;
- mp->msg_controllen = 0;
- ctlbuf = (caddr_t) mp->msg_control;
-
- while (m && (len > 0)) {
- unsigned int tocopy;
-
- if (len >= m->m_len)
- tocopy = m->m_len;
- else {
- mp->msg_flags |= MSG_CTRUNC;
- tocopy = len;
- }
- memcpy(ctlbuf, mtod(m, caddr_t), tocopy);
- ctlbuf += tocopy;
- len -= tocopy;
- m = m->m_next;
- }
- mp->msg_controllen = ctlbuf - mp->msg_control;
- }
- }
- if (from)
- m_freem (from);
- if (control)
- m_freem (control);
- rtems_bsdnet_semaphore_release ();
- return (ret);
-}
-
-/*
- * Receive a message from a host
- */
-ssize_t
-recvfrom (int s, void *buf, size_t buflen, int flags, const struct sockaddr *from, int *fromlen)
-{
- struct msghdr msg;
- struct iovec iov;
- int ret;
-
- iov.iov_base = buf;
- iov.iov_len = buflen;
- msg.msg_name = (caddr_t)from;
- msg.msg_namelen = *fromlen;
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
- msg.msg_control = NULL;
- msg.msg_controllen = 0;
- ret = recvmsg (s, &msg, flags);
- if ((from != NULL) && (fromlen != NULL) && (ret >= 0))
- *fromlen = msg.msg_namelen;
- return ret;
-}
-
-/*
- * Receive a message from a connected host
- */
-ssize_t
-recv (int s, void *buf, size_t buflen, int flags)
-{
- return recvfrom (s, buf, buflen, flags, NULL, NULL);
-}
-
-int
-setsockopt (int s, int level, int name, const void *val, int len)
-{
- struct socket *so;
- struct mbuf *m = NULL;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (len > MLEN) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (val) {
- error = sockargstombuf (&m, val, len, MT_SOOPTS);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- error = sosetopt(so, level, name, m);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- rtems_bsdnet_semaphore_release ();
- return 0;
-}
-
-int
-getsockopt (int s, int level, int name, void *aval, int *avalsize)
-{
- struct socket *so;
- struct mbuf *m = NULL, *m0;
- char *val = aval;
- int i, op, valsize;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (val)
- valsize = *avalsize;
- else
- valsize = 0;
- if (((error = sogetopt(so, level, name, &m)) == 0) && val && valsize && m) {
- op = 0;
- while (m && op < valsize) {
- i = valsize - op;
- if (i > m->m_len)
- i = m->m_len;
- memcpy (val, mtod(m, caddr_t), i);
- op += i;
- val += i;
- m0 = m;
- MFREE (m0, m);
- }
- *avalsize = op;
- }
- if (m != NULL)
- (void) m_free(m);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- rtems_bsdnet_semaphore_release ();
- return 0;
-}
-
-static int
-getpeersockname (int s, struct sockaddr *name, int *namelen, int pflag)
-{
- struct socket *so;
- struct mbuf *m;
- int len = *namelen;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- m = m_getclr(M_WAIT, MT_SONAME);
- if (m == NULL) {
- errno = ENOBUFS;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (pflag)
- error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, m);
- else
- error = (*so->so_proto->pr_usrreqs->pru_sockaddr)(so, m);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (len > m->m_len) {
- len = m->m_len;
- *namelen = len;
- }
- memcpy (name, mtod(m, caddr_t), len);
- m_freem (m);
- rtems_bsdnet_semaphore_release ();
- return 0;
-}
-
-int
-getpeername (int s, struct sockaddr *name, int *namelen)
-{
- return getpeersockname (s, name, namelen, 1);
-}
-int
-getsockname (int s, struct sockaddr *name, int *namelen)
-{
- return getpeersockname (s, name, namelen, 0);
-}
-
-/*
- ************************************************************************
- * RTEMS EXTERNAL I/O HANDLER ROUTINES *
- ************************************************************************
- */
-static int
-rtems_bsdnet_close (int fd)
-{
- struct socket *so;
- int error;
- int i;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (fd)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- i = rtems_file_descriptor_base(fd);
- fdsock[i].indexFreeNext = indexFreeHead;;
- indexFreeHead = i;
- error = soclose (so);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- errno = error;
- return -1;
- }
- return 0;
-}
-
-static int
-rtems_bsdnet_read (int fd, void *buffer, unsigned32 count)
-{
- return recv (fd, buffer, count, 0);
-}
-
-static int
-rtems_bsdnet_write (int fd, const void *buffer, unsigned32 count)
-{
- return send (fd, buffer, count, 0);
-}
-
-static int
-so_ioctl (struct socket *so, unsigned32 command, void *buffer)
-{
- switch (command) {
- case FIONBIO:
- if (*(int *)buffer)
- so->so_state |= SS_NBIO;
- else
- so->so_state &= ~SS_NBIO;
- return 0;
-
- case FIONREAD:
- *(int *)buffer = so->so_rcv.sb_cc;
- return 0;
- }
-
- if (IOCGROUP(command) == 'i')
- return ifioctl (so, command, buffer, NULL);
- if (IOCGROUP(command) == 'r')
- return rtioctl (command, buffer, NULL);
- return (*so->so_proto->pr_usrreqs->pru_control)(so, command, buffer, 0);
-}
-
-static int
-rtems_bsdnet_ioctl (int fd, unsigned32 command, void *buffer)
-{
- struct socket *so;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (fd)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- error = so_ioctl (so, command, buffer);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- errno = error;
- return -1;
- }
- return 0;
-}
-
-rtems_libio_handler_t rtems_bsdnet_io_handler = {
- NULL, /* open */
- rtems_bsdnet_close, /* close */
- rtems_bsdnet_read, /* read */
- rtems_bsdnet_write, /* write */
- rtems_bsdnet_ioctl, /* ioctl */
- NULL, /* lseek */
-};
-
diff --git a/c/src/lib/libnetworking/rtems/sghostname.c b/c/src/lib/libnetworking/rtems/sghostname.c
deleted file mode 100644
index 36894caa86..0000000000
--- a/c/src/lib/libnetworking/rtems/sghostname.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * RTEMS versions of hostname functions
- * FIXME: Not thread-safe
- *
- * $Id$
- */
-
-#include <string.h>
-#include <errno.h>
-#include <rtems/rtems_bsdnet.h>
-#include <sys/param.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-
-static char *rtems_hostname;
-
-int
-gethostname (char *name, int namelen)
-{
- char *cp = rtems_hostname;
-
- if (cp == NULL)
- cp = "";
- strncpy (name, cp, namelen);
- return 0;
-}
-
-int
-sethostname (char *name, int namelen)
-{
- char *old, *new;
-
- if (namelen >= MAXHOSTNAMELEN) {
- errno = EINVAL;
- return -1;
- }
- new = malloc (namelen + 1, M_HTABLE, M_NOWAIT);
- if (new == NULL) {
- errno = ENOMEM;
- return -1;
- }
- strncpy (new, name, namelen);
- new[namelen] = '\0';
- old = rtems_hostname;
- rtems_hostname = new;
- if (old)
- free (old, M_HTABLE);
- return 0;
-}
diff --git a/c/src/lib/libnetworking/rtems/tftp.h b/c/src/lib/libnetworking/rtems/tftp.h
deleted file mode 100644
index d09782e22b..0000000000
--- a/c/src/lib/libnetworking/rtems/tftp.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * $Id$
- */
-
-/*
- * Trivial File Transfer Protocol (TFTP)
- *
- * Transfer file to/from remote host
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- */
-
-/*
- * Usage:
- *
- * To open `/bootfiles/image' on `hostname' for reading:
- * fd = open ("/TFTP/hostname/bootfiles/image", O_RDONLY);
- *
- * The `hostname' must be four dot-separated decimal values.
- *
- * To open a file on the host which supplied the BOOTP
- * information just leave the `hostname' part empty:
- * fd = open ("/TFTP//bootfiles/image", O_RDONLY);
- *
- */
-
-#ifndef _TFTP_DRIVER_h
-#define _TFTP_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Driver entry points
- */
-#define TFTP_DRIVER_TABLE_ENTRY \
- { rtems_tftp_initialize, rtems_tftp_open, rtems_tftp_close, \
- rtems_tftp_read, rtems_tftp_write, rtems_tftp_control }
-
-rtems_device_driver rtems_tftp_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_open(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_close(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_read(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_write(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_control(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/sys/buf.h b/c/src/lib/libnetworking/sys/buf.h
deleted file mode 100644
index 6cca571141..0000000000
--- a/c/src/lib/libnetworking/sys/buf.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)buf.h 8.9 (Berkeley) 3/30/95
- * $Id$
- */
-
-#ifndef _SYS_BUF_H_
-#define _SYS_BUF_H_
-
-#include <sys/queue.h>
-
-#define NOLIST ((struct buf *)0x87654321)
-
-struct buf;
-
-struct iodone_chain {
- long ic_prev_flags;
- void (*ic_prev_iodone) __P((struct buf *));
- void *ic_prev_iodone_chain;
- struct {
- long ia_long;
- void *ia_ptr;
- } ic_args[5];
-};
-
-typedef TAILQ_HEAD(buf_queue_head, buf) buf_queue_head, *buf_queue_head_t;
-
-/*
- * The buffer header describes an I/O operation in the kernel.
- */
-struct buf {
- LIST_ENTRY(buf) b_hash; /* Hash chain. */
- LIST_ENTRY(buf) b_vnbufs; /* Buffer's associated vnode. */
- TAILQ_ENTRY(buf) b_freelist; /* Free list position if not active. */
- TAILQ_ENTRY(buf) b_act; /* Device driver queue when active. *new* */
- struct proc *b_proc; /* Associated proc; NULL if kernel. */
- long b_flags; /* B_* flags. */
- unsigned short b_qindex; /* buffer queue index */
- unsigned char b_usecount; /* buffer use count */
- int b_error; /* Errno value. */
- long b_bufsize; /* Allocated buffer size. */
- long b_bcount; /* Valid bytes in buffer. */
- long b_resid; /* Remaining I/O. */
- dev_t b_dev; /* Device associated with buffer. */
- struct {
- caddr_t b_addr; /* Memory, superblocks, indirect etc. */
- } b_un;
- caddr_t b_kvabase; /* base kva for buffer */
- int b_kvasize; /* size of kva for buffer */
- void *b_saveaddr; /* Original b_addr for physio. */
- daddr_t b_lblkno; /* Logical block number. */
- daddr_t b_blkno; /* Underlying physical block number. */
- /* Function to call upon completion. */
- void (*b_iodone) __P((struct buf *));
- /* For nested b_iodone's. */
- struct iodone_chain *b_iodone_chain;
- struct vnode *b_vp; /* Device vnode. */
- int b_dirtyoff; /* Offset in buffer of dirty region. */
- int b_dirtyend; /* Offset of end of dirty region. */
- struct ucred *b_rcred; /* Read credentials reference. */
- struct ucred *b_wcred; /* Write credentials reference. */
- int b_validoff; /* Offset in buffer of valid region. */
- int b_validend; /* Offset of end of valid region. */
- daddr_t b_pblkno; /* physical block number */
- caddr_t b_savekva; /* saved kva for transfer while bouncing */
- void *b_driver1; /* for private use by the driver */
- void *b_driver2; /* for private use by the driver */
- void *b_spc;
- union cluster_info {
- TAILQ_HEAD(cluster_list_head, buf) cluster_head;
- TAILQ_ENTRY(buf) cluster_entry;
- } b_cluster;
- struct vm_page *b_pages[btoc(MAXPHYS)];
- int b_npages;
-};
-
-/* Device driver compatibility definitions. */
-#define b_data b_un.b_addr /* b_un.b_addr is not changeable. */
-
-/*
- * These flags are kept in b_flags.
- */
-#define B_AGE 0x00000001 /* Move to age queue when I/O done. */
-#define B_NEEDCOMMIT 0x00000002 /* Append-write in progress. */
-#define B_ASYNC 0x00000004 /* Start I/O, do not wait. */
-#define B_BAD 0x00000008 /* Bad block revectoring in progress. */
-#define B_BUSY 0x00000010 /* I/O in progress. */
-#define B_CACHE 0x00000020 /* Bread found us in the cache. */
-#define B_CALL 0x00000040 /* Call b_iodone from biodone. */
-#define B_DELWRI 0x00000080 /* Delay I/O until buffer reused. */
-#define B_DIRTY 0x00000100 /* Dirty page to be pushed out async. */
-#define B_DONE 0x00000200 /* I/O completed. */
-#define B_EINTR 0x00000400 /* I/O was interrupted */
-#define B_ERROR 0x00000800 /* I/O error occurred. */
-#define B_GATHERED 0x00001000 /* LFS: already in a segment. */
-#define B_INVAL 0x00002000 /* Does not contain valid info. */
-#define B_LOCKED 0x00004000 /* Locked in core (not reusable). */
-#define B_NOCACHE 0x00008000 /* Do not cache block after use. */
-#define B_MALLOC 0x00010000 /* malloced b_data */
-#define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */
-#define B_PHYS 0x00040000 /* I/O to user memory. */
-#define B_RAW 0x00080000 /* Set by physio for raw transfers. */
-#define B_READ 0x00100000 /* Read buffer. */
-#define B_TAPE 0x00200000 /* Magnetic tape I/O. */
-#define B_RELBUF 0x00400000 /* Release VMIO buffer. */
-#define B_WANTED 0x00800000 /* Process wants this buffer. */
-#define B_WRITE 0x00000000 /* Write buffer (pseudo flag). */
-#define B_WRITEINPROG 0x01000000 /* Write in progress. */
-#define B_XXX 0x02000000 /* Debugging flag. */
-#define B_PAGING 0x04000000 /* volatile paging I/O -- bypass VMIO */
-#define B_ORDERED 0x08000000 /* Must guarantee I/O ordering */
-#define B_VMIO 0x20000000 /* VMIO flag */
-#define B_CLUSTER 0x40000000 /* pagein op, so swap() can count it */
-#define B_BOUNCE 0x80000000 /* bounce buffer flag */
-
-/*
- * number of buffer hash entries
- */
-#define BUFHSZ 512
-
-/*
- * buffer hash table calculation, originally by David Greenman
- */
-#define BUFHASH(vnp, bn) \
- (&bufhashtbl[(((unsigned long)(vnp) >> 7)+(int)(bn)) % BUFHSZ])
-
-/*
- * Definitions for the buffer free lists.
- */
-#define BUFFER_QUEUES 6 /* number of free buffer queues */
-
-extern LIST_HEAD(bufhashhdr, buf) bufhashtbl[BUFHSZ], invalhash;
-extern TAILQ_HEAD(bqueues, buf) bufqueues[BUFFER_QUEUES];
-
-#define QUEUE_NONE 0 /* on no queue */
-#define QUEUE_LOCKED 1 /* locked buffers */
-#define QUEUE_LRU 2 /* useful buffers */
-#define QUEUE_VMIO 3 /* VMIO buffers */
-#define QUEUE_AGE 4 /* not-useful buffers */
-#define QUEUE_EMPTY 5 /* empty buffer headers*/
-
-/*
- * Zero out the buffer's data area.
- */
-#define clrbuf(bp) { \
- bzero((bp)->b_data, (u_int)(bp)->b_bcount); \
- (bp)->b_resid = 0; \
-}
-
-/* Flags to low-level allocation routines. */
-#define B_CLRBUF 0x01 /* Request allocated buffer be cleared. */
-#define B_SYNC 0x02 /* Do all allocations synchronously. */
-
-#ifdef KERNEL
-extern int nbuf; /* The number of buffer headers */
-extern struct buf *buf; /* The buffer headers. */
-extern char *buffers; /* The buffer contents. */
-extern int bufpages; /* Number of memory pages in the buffer pool. */
-extern struct buf *swbuf; /* Swap I/O buffer headers. */
-extern int nswbuf; /* Number of swap I/O buffer headers. */
-extern TAILQ_HEAD(swqueue, buf) bswlist;
-
-void bufinit __P((void));
-void bremfree __P((struct buf *));
-int bread __P((struct vnode *, daddr_t, int,
- struct ucred *, struct buf **));
-int breadn __P((struct vnode *, daddr_t, int, daddr_t *, int *, int,
- struct ucred *, struct buf **));
-int bwrite __P((struct buf *));
-void bdwrite __P((struct buf *));
-void bawrite __P((struct buf *));
-int bowrite __P((struct buf *));
-void brelse __P((struct buf *));
-void bqrelse __P((struct buf *));
-int vfs_bio_awrite __P((struct buf *));
-struct buf * getpbuf __P((void));
-struct buf *incore __P((struct vnode *, daddr_t));
-struct buf *gbincore __P((struct vnode *, daddr_t));
-int inmem __P((struct vnode *, daddr_t));
-struct buf *getblk __P((struct vnode *, daddr_t, int, int, int));
-struct buf *geteblk __P((int));
-int allocbuf __P((struct buf *, int));
-int biowait __P((struct buf *));
-void biodone __P((struct buf *));
-
-void cluster_callback __P((struct buf *));
-int cluster_read __P((struct vnode *, u_quad_t, daddr_t, long,
- struct ucred *, struct buf **));
-int cluster_wbuild __P((struct vnode *, long, daddr_t, int));
-void cluster_write __P((struct buf *, u_quad_t));
-int physio __P((void (*)(struct buf *), struct buf *, dev_t,
- int, u_int (*)(struct buf *), struct uio *));
-u_int minphys __P((struct buf *));
-void vfs_bio_clrbuf __P((struct buf *));
-void vfs_busy_pages __P((struct buf *, int clear_modify));
-void vfs_unbusy_pages(struct buf *);
-void vwakeup __P((struct buf *));
-void vmapbuf __P((struct buf *));
-void vunmapbuf __P((struct buf *));
-void relpbuf __P((struct buf *));
-void brelvp __P((struct buf *));
-void bgetvp __P((struct vnode *, struct buf *));
-void pbgetvp __P((struct vnode *, struct buf *));
-void pbrelvp __P((struct buf *));
-void reassignbuf __P((struct buf *, struct vnode *));
-struct buf *trypbuf __P((void));
-void vm_bounce_alloc __P((struct buf *));
-void vm_bounce_free __P((struct buf *));
-vm_offset_t vm_bounce_kva_alloc __P((int));
-void vm_bounce_kva_alloc_free __P((vm_offset_t, int));
-#endif /* KERNEL */
-
-#endif /* !_SYS_BUF_H_ */
diff --git a/c/src/lib/libnetworking/sys/callout.h b/c/src/lib/libnetworking/sys/callout.h
deleted file mode 100644
index 5fec98f28b..0000000000
--- a/c/src/lib/libnetworking/sys/callout.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)callout.h 8.2 (Berkeley) 1/21/94
- * $Id$
- */
-
-#ifndef _SYS_CALLOUT_H_
-#define _SYS_CALLOUT_H_
-
-struct callout {
- struct callout *c_next; /* next callout in queue */
- void *c_arg; /* function argument */
- void (*c_func) __P((void *)); /* function to call */
- int c_time; /* ticks to the event */
-};
-
-#ifdef KERNEL
-extern struct callout *callfree, *callout, calltodo;
-extern int ncallout;
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/sys/cdefs.h b/c/src/lib/libnetworking/sys/cdefs.h
deleted file mode 100644
index d089dc5894..0000000000
--- a/c/src/lib/libnetworking/sys/cdefs.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Berkeley Software Design, Inc.
- *
- * 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.
- *
- * @(#)cdefs.h 8.8 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _SYS_CDEFS_H_
-#define _SYS_CDEFS_H_
-
-#if defined(__cplusplus)
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS };
-#else
-#define __BEGIN_DECLS
-#define __END_DECLS
-#endif
-
-/*
- * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
- * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
- * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
- * in between its arguments. __CONCAT can also concatenate double-quoted
- * strings produced by the __STRING macro, but this only works with ANSI C.
- *
- * __XSTRING is like __STRING, but it expands any macros in its argument
- * first. It is only available with ANSI C.
- */
-#if defined(__STDC__) || defined(__cplusplus)
-#define __P(protos) protos /* full-blown ANSI C */
-#define __CONCAT1(x,y) x ## y
-#define __CONCAT(x,y) __CONCAT1(x,y)
-#define __STRING(x) #x /* stringify without expanding x */
-#define __XSTRING(x) __STRING(x) /* expand x, then stringify */
-
-#define __const const /* define reserved names to standard */
-#define __signed signed
-#define __volatile volatile
-#if defined(__cplusplus)
-#define __inline inline /* convert to C++ keyword */
-#else
-#ifndef __GNUC__
-#define __inline /* delete GCC keyword */
-#endif /* !__GNUC__ */
-#endif /* !__cplusplus */
-
-#else /* !(__STDC__ || __cplusplus) */
-#define __P(protos) () /* traditional C preprocessor */
-#define __CONCAT(x,y) x/**/y
-#define __STRING(x) "x"
-
-#ifndef __GNUC__
-#define __const /* delete pseudo-ANSI C keywords */
-#define __inline
-#define __signed
-#define __volatile
-/*
- * In non-ANSI C environments, new programs will want ANSI-only C keywords
- * deleted from the program and old programs will want them left alone.
- * When using a compiler other than gcc, programs using the ANSI C keywords
- * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
- * When using "gcc -traditional", we assume that this is the intent; if
- * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
- */
-#ifndef NO_ANSI_KEYWORDS
-#define const /* delete ANSI C keywords */
-#define inline
-#define signed
-#define volatile
-#endif /* !NO_ANSI_KEYWORDS */
-#endif /* !__GNUC__ */
-#endif /* !(__STDC__ || __cplusplus) */
-
-/*
- * GCC1 and some versions of GCC2 declare dead (non-returning) and
- * pure (no side effects) functions using "volatile" and "const";
- * unfortunately, these then cause warnings under "-ansi -pedantic".
- * GCC2.5 uses a new, peculiar __attribute__((attrs)) style. All of
- * these work for GNU C++ (modulo a slight glitch in the C++ grammar
- * in the distribution version of 2.5.5).
- */
-#if __GNUC__ < 2
-#define __dead
-#define __dead2
-#define __pure
-#define __pure2
-#define __unused
-#define __attribute__(x)
-#endif
-#if __GNUC__ == 2 && __GNUC_MINOR__ < 5
-#define __dead __volatile
-#define __dead2
-#define __pure __const
-#define __pure2
-#define __unused
-#endif
-#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7
-#define __dead
-#define __dead2 __attribute__((__noreturn__))
-#define __pure
-#define __pure2 __attribute__((__const__))
-#define __unused
-#endif
-#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3
-#define __dead
-#define __dead2 __attribute__((__noreturn__))
-#define __pure
-#define __pure2 __attribute__((__const__))
-#define __unused __attribute__((__unused__))
-#endif
-
-#ifdef __GNUC__
-#ifdef __STDC__
-#define __weak_reference(sym,alias) \
- __asm__(".stabs \"_" #alias "\",11,0,0,0"); \
- __asm__(".stabs \"_" #sym "\",1,0,0,0")
-#define __warn_references(sym,msg) \
- __asm__(".stabs \"" msg "\",30,0,0,0"); \
- __asm__(".stabs \"_" #sym "\",1,0,0,0")
-#else
-#define __weak_reference(sym,alias) \
- __asm__(".stabs \"_/**/alias\",11,0,0,0"); \
- __asm__(".stabs \"_/**/sym\",1,0,0,0")
-#define __warn_references(sym,msg) \
- __asm__(".stabs msg,30,0,0,0"); \
- __asm__(".stabs \"_/**/sym\",1,0,0,0")
-#endif
-#endif
-
-#define __IDSTRING(name,string) \
- static const char name[] __attribute__((__unused__)) = string
-
-#ifndef __RCSID
-#define __RCSID(s) __IDSTRING(rcsid,s)
-#endif
-
-#ifndef __RCSID_SOURCE
-#define __RCSID_SOURCE(s) __IDSTRING(rcsid_source,s)
-#endif
-
-#ifndef __COPYRIGHT
-#define __COPYRIGHT(s) __IDSTRING(copyright,s)
-#endif
-
-#endif /* !_SYS_CDEFS_H_ */
diff --git a/c/src/lib/libnetworking/sys/conf.h b/c/src/lib/libnetworking/sys/conf.h
deleted file mode 100644
index 92d99d9d07..0000000000
--- a/c/src/lib/libnetworking/sys/conf.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)conf.h 8.5 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _SYS_CONF_H_
-#define _SYS_CONF_H_
-
-/*
- * Definitions of device driver entry switches
- */
-
-struct buf;
-struct proc;
-struct tty;
-struct uio;
-struct vnode;
-
-typedef int d_open_t __P((dev_t dev, int oflags, int devtype, struct proc *p));
-typedef int d_close_t __P((dev_t dev, int fflag, int devtype, struct proc *p));
-typedef void d_strategy_t __P((struct buf *bp));
-typedef int d_ioctl_t __P((dev_t dev, int cmd, caddr_t data,
- int fflag, struct proc *p));
-typedef int d_dump_t __P((dev_t dev));
-typedef int d_psize_t __P((dev_t dev));
-
-typedef int d_read_t __P((dev_t dev, struct uio *uio, int ioflag));
-typedef int d_write_t __P((dev_t dev, struct uio *uio, int ioflag));
-typedef void d_stop_t __P((struct tty *tp, int rw));
-typedef int d_reset_t __P((dev_t dev));
-typedef struct tty *d_devtotty_t __P((dev_t dev));
-typedef int d_select_t __P((dev_t dev, int which, struct proc *p));
-typedef int d_mmap_t __P((dev_t dev, int offset, int nprot));
-
-typedef int l_open_t __P((dev_t dev, struct tty *tp));
-typedef int l_close_t __P((struct tty *tp, int flag));
-typedef int l_read_t __P((struct tty *tp, struct uio *uio, int flag));
-typedef int l_write_t __P((struct tty *tp, struct uio *uio, int flag));
-typedef int l_ioctl_t __P((struct tty *tp, int cmd, caddr_t data,
- int flag, struct proc *p));
-typedef int l_rint_t __P((int c, struct tty *tp));
-typedef int l_start_t __P((struct tty *tp));
-typedef int l_modem_t __P((struct tty *tp, int flag));
-
-/*
- * Block device switch table
- */
-struct bdevsw {
- d_open_t *d_open;
- d_close_t *d_close;
- d_strategy_t *d_strategy;
- d_ioctl_t *d_ioctl;
- d_dump_t *d_dump;
- d_psize_t *d_psize;
- int d_flags;
- char *d_name; /* name of the driver e.g. audio */
- struct cdevsw *d_cdev; /* cross pointer to the cdev */
- int d_maj; /* the major number we were assigned */
-};
-
-#ifdef KERNEL
-extern struct bdevsw *bdevsw[];
-#endif
-
-/*
- * Character device switch table
- */
-struct cdevsw {
- d_open_t *d_open;
- d_close_t *d_close;
- d_read_t *d_read;
- d_write_t *d_write;
- d_ioctl_t *d_ioctl;
- d_stop_t *d_stop;
- d_reset_t *d_reset; /* XXX not used */
- d_devtotty_t *d_devtotty;
- d_select_t *d_select;
- d_mmap_t *d_mmap;
- d_strategy_t *d_strategy;
- char *d_name; /* see above */
- struct bdevsw *d_bdev;
- int d_maj;
-};
-
-#ifdef KERNEL
-extern struct cdevsw *cdevsw[];
-#endif
-
-/*
- * Line discipline switch table
- */
-struct linesw {
- l_open_t *l_open;
- l_close_t *l_close;
- l_read_t *l_read;
- l_write_t *l_write;
- l_ioctl_t *l_ioctl;
- l_rint_t *l_rint;
- l_start_t *l_start;
- l_modem_t *l_modem;
-};
-
-#ifdef KERNEL
-extern struct linesw linesw[];
-extern int nlinesw;
-
-int ldisc_register __P((int , struct linesw *));
-void ldisc_deregister __P((int));
-#define LDISC_LOAD -1 /* Loadable line discipline */
-#endif
-
-/*
- * Swap device table
- */
-struct swdevt {
- dev_t sw_dev;
- int sw_flags;
- int sw_nblks;
- struct vnode *sw_vp;
-};
-#define SW_FREED 0x01
-#define SW_SEQUENTIAL 0x02
-#define sw_freed sw_flags /* XXX compat */
-
-#ifdef KERNEL
-d_open_t noopen;
-d_close_t noclose;
-d_read_t noread;
-d_write_t nowrite;
-d_ioctl_t noioctl;
-d_stop_t nostop;
-d_reset_t noreset;
-d_devtotty_t nodevtotty;
-d_select_t noselect;
-d_mmap_t nommap;
-
-/* Bogus defines for compatibility. */
-#define noioc noioctl
-#define nostrat nostrategy
-#define zerosize nopsize
-/*
- * XXX d_strategy seems to be unused for cdevs that aren't associated with
- * bdevs and called without checking for it being non-NULL for bdevs.
- */
-#define nostrategy ((d_strategy_t *)NULL)
-
-d_dump_t nodump;
-
-/*
- * nopsize is little used, so not worth having dummy functions for.
- */
-#define nopsize ((d_psize_t *)NULL)
-
-d_open_t nullopen;
-d_close_t nullclose;
-#define nullstop nostop /* one void return is as good as another */
-#define nullreset noreset /* one unused function is as good as another */
-
-d_open_t nxopen;
-d_close_t nxclose;
-d_read_t nxread;
-d_write_t nxwrite;
-d_ioctl_t nxioctl;
-#define nxstop nostop /* one void return is as good as another */
-#define nxreset noreset /* one unused function is as good as another */
-#define nxdevtotty nodevtotty /* one NULL return is as good as another */
-d_select_t nxselect;
-#define nxmmap nommap /* one -1 return is as good as another */
-#define nxstrategy nostrategy /* one NULL value is as good as another */
-d_dump_t nxdump;
-#define nxpsize nopsize /* one NULL value is as good as another */
-
-d_read_t rawread;
-d_write_t rawwrite;
-
-l_read_t l_noread;
-l_write_t l_nowrite;
-
-int bdevsw_add __P((dev_t *descrip,struct bdevsw *new,struct bdevsw **old));
-int cdevsw_add __P((dev_t *descrip,struct cdevsw *new,struct cdevsw **old));
-void cdevsw_make __P((struct bdevsw *from));
-void bdevsw_add_generic __P((int bdev, int cdev, struct bdevsw *bdevsw));
-dev_t chrtoblk __P((dev_t dev));
-int isdisk __P((dev_t dev, int type));
-int iskmemdev __P((dev_t dev));
-int iszerodev __P((dev_t dev));
-void setconf __P((void));
-#endif /* KERNEL */
-
-#include <machine/conf.h>
-
-#endif /* !_SYS_CONF_H_ */
diff --git a/c/src/lib/libnetworking/sys/domain.h b/c/src/lib/libnetworking/sys/domain.h
deleted file mode 100644
index 2ec8a5fb05..0000000000
--- a/c/src/lib/libnetworking/sys/domain.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)domain.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_DOMAIN_H_
-#define _SYS_DOMAIN_H_
-
-/*
- * Structure per communications domain.
- */
-
-/*
- * Forward structure declarations for function prototypes [sic].
- */
-struct mbuf;
-
-struct domain {
- int dom_family; /* AF_xxx */
- char *dom_name;
- void (*dom_init) /* initialize domain data structures */
- __P((void));
- int (*dom_externalize) /* externalize access rights */
- __P((struct mbuf *));
- void (*dom_dispose) /* dispose of internalized rights */
- __P((struct mbuf *));
- struct protosw *dom_protosw, *dom_protoswNPROTOSW;
- struct domain *dom_next;
- int (*dom_rtattach) /* initialize routing table */
- __P((void **, int));
- int dom_rtoffset; /* an arg to rtattach, in bits */
- int dom_maxrtkey; /* for routing layer */
-};
-
-#ifdef KERNEL
-extern struct domain *domains;
-extern struct domain localdomain;
-
-#define DOMAIN_SET(name) \
- DATA_SET(domain_set, name ## domain);
-
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/sys/filio.h b/c/src/lib/libnetworking/sys/filio.h
deleted file mode 100644
index b82a649c0f..0000000000
--- a/c/src/lib/libnetworking/sys/filio.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)filio.h 8.1 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_FILIO_H_
-#define _SYS_FILIO_H_
-
-#include <sys/ioccom.h>
-
-/* Generic file-descriptor ioctl's. */
-#define FIOCLEX _IO('f', 1) /* set close on exec on fd */
-#define FIONCLEX _IO('f', 2) /* remove close on exec */
-#define FIONREAD _IOR('f', 127, int) /* get # bytes to read */
-#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */
-#define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */
-#define FIOSETOWN _IOW('f', 124, int) /* set owner */
-#define FIOGETOWN _IOR('f', 123, int) /* get owner */
-
-#endif /* !_SYS_FILIO_H_ */
diff --git a/c/src/lib/libnetworking/sys/ioccom.h b/c/src/lib/libnetworking/sys/ioccom.h
deleted file mode 100644
index 18c4b74741..0000000000
--- a/c/src/lib/libnetworking/sys/ioccom.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * 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.
- *
- * @(#)ioccom.h 8.2 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_IOCCOM_H_
-#define _SYS_IOCCOM_H_
-
-/*
- * Ioctl's have the command encoded in the lower word, and the size of
- * any in or out parameters in the upper word. The high 3 bits of the
- * upper word are used to encode the in/out status of the parameter.
- */
-#define IOCPARM_MASK 0x1fff /* parameter length, at most 13 bits */
-#define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK)
-#define IOCBASECMD(x) ((x) & ~(IOCPARM_MASK << 16))
-#define IOCGROUP(x) (((x) >> 8) & 0xff)
-
-#define IOCPARM_MAX PAGE_SIZE /* max size of ioctl, mult. of PAGE_SIZE */
-#define IOC_VOID 0x20000000 /* no parameters */
-#define IOC_OUT 0x40000000 /* copy out parameters */
-#define IOC_IN 0x80000000 /* copy in parameters */
-#define IOC_INOUT (IOC_IN|IOC_OUT)
-#define IOC_DIRMASK 0xe0000000 /* mask for IN/OUT/VOID */
-
-#define _IOC(inout,group,num,len) \
- (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))
-#define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0)
-#define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t))
-#define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t))
-/* this should be _IORW, but stdio got there first */
-#define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t))
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int ioctl __P((int, unsigned long, ...));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif /* !_SYS_IOCCOM_H_ */
diff --git a/c/src/lib/libnetworking/sys/ioctl.h b/c/src/lib/libnetworking/sys/ioctl.h
deleted file mode 100644
index e3a69a5a7f..0000000000
--- a/c/src/lib/libnetworking/sys/ioctl.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)ioctl.h 8.6 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_IOCTL_H_
-#define _SYS_IOCTL_H_
-
-#include <sys/ttycom.h>
-
-/*
- * Pun for SunOS prior to 3.2. SunOS 3.2 and later support TIOCGWINSZ
- * and TIOCSWINSZ (yes, even 3.2-3.5, the fact that it wasn't documented
- * notwithstanding).
- */
-struct ttysize {
- unsigned short ts_lines;
- unsigned short ts_cols;
- unsigned short ts_xxx;
- unsigned short ts_yyy;
-};
-#define TIOCGSIZE TIOCGWINSZ
-#define TIOCSSIZE TIOCSWINSZ
-
-#include <sys/ioccom.h>
-
-#include <sys/filio.h>
-#include <sys/sockio.h>
-
-#endif /* !_SYS_IOCTL_H_ */
-
-/*
- * Keep outside _SYS_IOCTL_H_
- * Compatibility with old terminal driver
- *
- * Source level -> #define USE_OLD_TTY
- * Kernel level -> options COMPAT_43 or COMPAT_SUNOS
- */
-#if defined(USE_OLD_TTY) || defined(COMPAT_43) || defined(COMPAT_SUNOS)
-#include <sys/ioctl_compat.h>
-#endif
diff --git a/c/src/lib/libnetworking/sys/kernel.h b/c/src/lib/libnetworking/sys/kernel.h
deleted file mode 100644
index 35bce70bd6..0000000000
--- a/c/src/lib/libnetworking/sys/kernel.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/*-
- * Copyright (c) 1995 Terrence R. Lambert
- * All rights reserved.
- *
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)kernel.h 8.3 (Berkeley) 1/21/94
- * $Id$
- */
-
-#ifndef _SYS_KERNEL_H_
-#define _SYS_KERNEL_H_
-
-/* Global variables for the kernel. */
-
-/* 1.1 */
-extern long hostid;
-extern char hostname[MAXHOSTNAMELEN];
-extern int hostnamelen;
-extern char domainname[MAXHOSTNAMELEN];
-extern int domainnamelen;
-extern char kernelname[MAXPATHLEN];
-
-/* 1.2 */
-extern volatile struct timeval mono_time;
-extern struct timeval boottime;
-extern struct timeval runtime;
-/* extern volatile struct timeval time; */
-extern struct timezone tz; /* XXX */
-
-extern int tick; /* usec per tick (1000000 / hz) */
-extern int hz; /* system clock's frequency */
-extern int psratio; /* ratio: prof / stat */
-extern int stathz; /* statistics clock's frequency */
-extern int profhz; /* profiling clock's frequency */
-extern int ticks;
-extern int lbolt; /* once a second sleep address */
-extern int tickdelta;
-extern long timedelta;
-
-/*
- * The following macros are used to declare global sets of objects, which
- * are collected by the linker into a `struct linker_set' as defined below.
- *
- * NB: the constants defined below must match those defined in
- * ld/ld.h. Since their calculation requires arithmetic, we
- * can't name them symbolically (e.g., 23 is N_SETT | N_EXT).
- */
-#define MAKE_SET(set, sym, type)
-#define TEXT_SET(set, sym) MAKE_SET(set, sym, 23)
-#define DATA_SET(set, sym) MAKE_SET(set, sym, 25)
-#define BSS_SET(set, sym) MAKE_SET(set, sym, 27)
-#define ABS_SET(set, sym) MAKE_SET(set, sym, 21)
-
-
-/*
- * Enumerated types for known system startup interfaces.
- *
- * Startup occurs in ascending numeric order; the list entries are
- * sorted prior to attempting startup to guarantee order. Items
- * of the same level are arbitrated for order based on the 'order'
- * element.
- *
- * These numbers are arbitrary and are chosen ONLY for ordering; the
- * enumeration values are explicit rather than implicit to provide
- * for binary compatibility with inserted elements.
- *
- * The SI_SUB_RUN_SCHEDULER value must have the highest lexical value.
- *
- * The SI_SUB_CONSOLE and SI_SUB_SWAP values represent values used by
- * the BSD 4.4Lite but not by FreeBSD; they are maintained in dependent
- * order to support porting.
- *
- * The SI_SUB_PROTO_BEGIN and SI_SUB_PROTO_END bracket a range of
- * initializations to take place at splimp(). This is a historical
- * wart that should be removed -- probably running everything at
- * splimp() until the first init that doesn't want it is the correct
- * fix. They are currently present to ensure historical behavior.
- */
-enum sysinit_sub_id {
- SI_SUB_DUMMY = 0x00000000, /* not executed; for linker*/
- SI_SUB_CONSOLE = 0x08000000, /* console*/
- SI_SUB_COPYRIGHT = 0x08000001, /* first use of console*/
- SI_SUB_VM = 0x10000000, /* virtual memory system init*/
- SI_SUB_KMEM = 0x18000000, /* kernel memory*/
- SI_SUB_CPU = 0x20000000, /* CPU resource(s)*/
- SI_SUB_DEVFS = 0x22000000, /* get DEVFS ready */
- SI_SUB_DRIVERS = 0x23000000, /* Let Drivers initialize */
- SI_SUB_CONFIGURE = 0x24000000, /* Configure devices */
- SI_SUB_INTRINSIC = 0x28000000, /* proc 0*/
- SI_SUB_RUN_QUEUE = 0x30000000, /* the run queue*/
- SI_SUB_VM_CONF = 0x38000000, /* config VM, set limits*/
- SI_SUB_VFS = 0x40000000, /* virtual file system*/
- SI_SUB_CLOCKS = 0x48000000, /* real time and stat clocks*/
- SI_SUB_MBUF = 0x50000000, /* mbufs*/
- SI_SUB_CLIST = 0x58000000, /* clists*/
- SI_SUB_SYSV_SHM = 0x64000000, /* System V shared memory*/
- SI_SUB_SYSV_SEM = 0x68000000, /* System V semaphores*/
- SI_SUB_SYSV_MSG = 0x6C000000, /* System V message queues*/
- SI_SUB_PSEUDO = 0x70000000, /* pseudo devices*/
- SI_SUB_PROTO_BEGIN = 0x80000000, /* XXX: set splimp (kludge)*/
- SI_SUB_PROTO_IF = 0x84000000, /* interfaces*/
- SI_SUB_PROTO_DOMAIN = 0x88000000, /* domains (address families?)*/
- SI_SUB_PROTO_END = 0x8fffffff, /* XXX: set splx (kludge)*/
- SI_SUB_KPROF = 0x90000000, /* kernel profiling*/
- SI_SUB_KICK_SCHEDULER = 0xa0000000, /* start the timeout events*/
- SI_SUB_ROOT = 0xb0000000, /* root mount*/
- SI_SUB_ROOT_FDTAB = 0xb8000000, /* root vnode in fd table...*/
- SI_SUB_SWAP = 0xc0000000, /* swap*/
- SI_SUB_INTRINSIC_POST = 0xd0000000, /* proc 0 cleanup*/
- SI_SUB_KTHREAD_INIT = 0xe0000000, /* init process*/
- SI_SUB_KTHREAD_PAGE = 0xe4000000, /* pageout daemon*/
- SI_SUB_KTHREAD_VM = 0xe8000000, /* vm daemon*/
- SI_SUB_KTHREAD_UPDATE = 0xec000000, /* update daemon*/
- SI_SUB_RUN_SCHEDULER = 0xffffffff /* scheduler: no return*/
-};
-
-
-/*
- * Some enumerated orders; "ANY" sorts last.
- */
-enum sysinit_elem_order {
- SI_ORDER_FIRST = 0x00000000, /* first*/
- SI_ORDER_SECOND = 0x00000001, /* second*/
- SI_ORDER_THIRD = 0x00000002, /* third*/
- SI_ORDER_MIDDLE = 0x10000000, /* somewhere in the middle */
- SI_ORDER_ANY = 0xffffffff /* last*/
-};
-
-
-/*
- * System initialization call types; currently two are supported... one
- * to do a simple function call and one to cause a process to be started
- * by the kernel on the callers behalf.
- */
-typedef enum sysinit_elem_type {
- SI_TYPE_DEFAULT = 0x00000000, /* No special processing*/
- SI_TYPE_KTHREAD = 0x00000001 /* start kernel thread*/
-} si_elem_t;
-
-
-/*
- * A system initialization call instance
- *
- * The subsystem
- */
-struct sysinit {
- unsigned int subsystem; /* subsystem identifier*/
- unsigned int order; /* init order within subsystem*/
- void (*func) __P((void *)); /* init function*/
- void *udata; /* multiplexer/argument */
- si_elem_t type; /* sysinit_elem_type*/
-};
-
-
-/*
- * Default: no special processing
- */
-#define SYSINIT(uniquifier, subsystem, order, func, ident)
-
-/*
- * Call 'fork()' before calling '(*func)(ident)';
- * for making a kernel 'thread' (or builtin process.)
- */
-#define SYSINIT_KT(uniquifier, subsystem, order, func, ident)
-
-
-/*
- * A kernel process descriptor; used to start "internal" daemons
- *
- * Note: global_procpp may be NULL for no global save area
- */
-struct kproc_desc {
- char *arg0; /* arg 0 (for 'ps' listing)*/
- void (*func) __P((void)); /* "main" for kernel process*/
- struct proc **global_procpp; /* ptr to proc ptr save area*/
-};
-
-void kproc_start __P((void *udata));
-
-#ifdef PSEUDO_LKM
-#include <sys/conf.h>
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-#define PSEUDO_SET(init, name) \
- extern struct linker_set MODVNOPS; \
- MOD_MISC(name); \
- static int \
- name ## _load(struct lkm_table *lkmtp, int cmd) \
- { init((void *)NULL /* XXX unused (?) */); return 0; } \
- static int \
- name ## _unload(struct lkm_table *lkmtp, int cmd) \
- { return EINVAL; } \
- int \
- name ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \
- DISPATCH(lkmtp, cmd, ver, name ## _load, name ## _unload, \
- lkm_nullcmd); }
-#else /* PSEUDO_LKM */
-
-/*
- * Compatibility. To be deprecated after LKM is updated.
- */
-#define PSEUDO_SET(sym, name) SYSINIT(ps, SI_SUB_PSEUDO, SI_ORDER_ANY, sym, 0)
-
-#endif /* PSEUDO_LKM */
-
-struct linker_set {
- int ls_length;
- const void *ls_items[1]; /* really ls_length of them,
- * trailing NULL */
-};
-
-extern struct linker_set execsw_set;
-
-#endif /* !_SYS_KERNEL_H_*/
diff --git a/c/src/lib/libnetworking/sys/libkern.h b/c/src/lib/libnetworking/sys/libkern.h
deleted file mode 100644
index c01e35b273..0000000000
--- a/c/src/lib/libnetworking/sys/libkern.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * 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.
- *
- * @(#)libkern.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _SYS_LIBKERN_H_
-#define _SYS_LIBKERN_H_
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-/* BCD conversions. */
-extern u_char const bcd2bin_data[];
-extern u_char const bin2bcd_data[];
-extern char const hex2ascii_data[];
-
-#define bcd2bin(bcd) (bcd2bin_data[bcd])
-#define bin2bcd(bin) (bin2bcd_data[bin])
-#define hex2ascii(hex) (hex2ascii_data[hex])
-
-static __inline int imax(int a, int b) { return (a > b ? a : b); }
-static __inline int imin(int a, int b) { return (a < b ? a : b); }
-static __inline long lmax(long a, long b) { return (a > b ? a : b); }
-static __inline long lmin(long a, long b) { return (a < b ? a : b); }
-static __inline u_int max(u_int a, u_int b) { return (a > b ? a : b); }
-static __inline u_int min(u_int a, u_int b) { return (a < b ? a : b); }
-static __inline quad_t qmax(quad_t a, quad_t b) { return (a > b ? a : b); }
-static __inline quad_t qmin(quad_t a, quad_t b) { return (a < b ? a : b); }
-static __inline u_long ulmax(u_long a, u_long b) { return (a > b ? a : b); }
-static __inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); }
-
-/* Prototypes for non-quad routines. */
-int bcmp __P((const void *, const void *, size_t));
-#ifndef HAVE_INLINE_FFS
-int ffs __P((int));
-#endif
-#ifndef HAVE_INLINE_FLS
-int fls __P((int));
-#endif
-int locc __P((int, char *, u_int));
-void qsort __P((void *base, size_t nmemb, size_t size,
- int (*compar)(const void *, const void *)));
-u_long random __P((void));
-char *index __P((const char *, int));
-char *rindex __P((const char *, int));
-int scanc __P((u_int, const u_char *, const u_char *, int));
-int skpc __P((int, int, char *));
-void srandom __P((u_long));
-char *strcat __P((char *, const char *));
-int strcmp __P((const char *, const char *));
-char *strdup __P((const char *s));
-char *strcpy __P((char *, const char *));
-size_t strlen __P((const char *));
-int strncmp __P((const char *, const char *, size_t));
-char *strncpy __P((char *, const char *, size_t));
-char *strerror __P((int errnum));
-
-#endif /* !_SYS_LIBKERN_H_ */
diff --git a/c/src/lib/libnetworking/sys/malloc.h b/c/src/lib/libnetworking/sys/malloc.h
deleted file mode 100644
index ec85c1814d..0000000000
--- a/c/src/lib/libnetworking/sys/malloc.h
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Copyright (c) 1987, 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.
- *
- * @(#)malloc.h 8.5 (Berkeley) 5/3/95
- * $Id$
- */
-
-#ifndef _SYS_MALLOC_H_
-#define _SYS_MALLOC_H_
-
-#include <rtems/rtems_bsdnet_internal.h> /* Ensure we get RTEMS malloc hooks */
-#define KMEMSTATS
-
-/*
- * flags to malloc
- */
-#define M_WAITOK 0x0000
-#define M_NOWAIT 0x0001
-#define M_KERNEL 0x0002
-
-/*
- * Types of memory to be allocated
- */
-#define M_FREE 0 /* should be on free list */
-#define M_MBUF 1 /* mbuf */
-#define M_DEVBUF 2 /* device driver memory */
-#define M_SOCKET 3 /* socket structure */
-#define M_PCB 4 /* protocol control block */
-#define M_RTABLE 5 /* routing tables */
-#define M_HTABLE 6 /* IMP host tables */
-#define M_FTABLE 7 /* fragment reassembly header */
-#define M_ZOMBIE 8 /* zombie proc status */
-#define M_IFADDR 9 /* interface address */
-#define M_SOOPTS 10 /* socket options */
-#define M_SONAME 11 /* socket name */
-#define M_NAMEI 12 /* namei path name buffer */
-#define M_GPROF 13 /* kernel profiling buffer */
-#define M_IOCTLOPS 14 /* ioctl data buffer */
-#define M_MAPMEM 15 /* mapped memory descriptors */
-#define M_CRED 16 /* credentials */
-#define M_PGRP 17 /* process group header */
-#define M_SESSION 18 /* session header */
-#define M_IOV 19 /* large iov's */
-#define M_MOUNT 20 /* vfs mount struct */
-#define M_FHANDLE 21 /* network file handle */
-#define M_NFSREQ 22 /* NFS request header */
-#define M_NFSMNT 23 /* NFS mount structure */
-#define M_NFSNODE 24 /* NFS vnode private part */
-#define M_VNODE 25 /* Dynamically allocated vnodes */
-#define M_CACHE 26 /* Dynamically allocated cache entries */
-#define M_DQUOT 27 /* UFS quota entries */
-#define M_UFSMNT 28 /* UFS mount structure */
-#define M_SHM 29 /* SVID compatible shared memory segments */
-#define M_VMMAP 30 /* VM map structures */
-#define M_VMMAPENT 31 /* VM map entry structures */
-#define M_VMOBJ 32 /* VM object structure */
-#define M_VMOBJHASH 33 /* VM object hash structure */
-#define M_VMPMAP 34 /* VM pmap */
-#define M_VMPVENT 35 /* VM phys-virt mapping entry */
-#define M_VMPAGER 36 /* XXX: VM pager struct */
-#define M_VMPGDATA 37 /* XXX: VM pager private data */
-#define M_FILE 38 /* Open file structure */
-#define M_FILEDESC 39 /* Open file descriptor table */
-#define M_LOCKF 40 /* Byte-range locking structures */
-#define M_PROC 41 /* Proc structures */
-#define M_SUBPROC 42 /* Proc sub-structures */
-#define M_SEGMENT 43 /* Segment for LFS */
-#define M_LFSNODE 44 /* LFS vnode private part */
-#define M_FFSNODE 45 /* FFS vnode private part */
-#define M_MFSNODE 46 /* MFS vnode private part */
-#define M_NQLEASE 47 /* Nqnfs lease */
-#define M_NQMHOST 48 /* Nqnfs host address table */
-#define M_NETADDR 49 /* Export host address structure */
-#define M_NFSSVC 50 /* Nfs server structure */
-#define M_NFSUID 51 /* Nfs uid mapping structure */
-#define M_NFSD 52 /* Nfs server daemon structure */
-#define M_IPMOPTS 53 /* internet multicast options */
-#define M_IPMADDR 54 /* internet multicast address */
-#define M_IFMADDR 55 /* link-level multicast address */
-#define M_MRTABLE 56 /* multicast routing tables */
-#define M_ISOFSMNT 57 /* ISOFS mount structure */
-#define M_ISOFSNODE 58 /* ISOFS vnode private part */
-#define M_NFSRVDESC 59 /* NFS server socket descriptor */
-#define M_NFSDIROFF 60 /* NFS directory offset data */
-#define M_NFSBIGFH 61 /* NFS version 3 file handle */
-#define M_MSDOSFSMNT 67 /* MSDOSFS mount structure */
-#define M_MSDOSFSNODE 68 /* MSDOSFS vnode private part */
-#define M_MSDOSFSFAT 69 /* MSDOSFS file allocation table */
-#define M_DEVFSMNT 70 /* DEVFS mount structure */
-#define M_DEVFSBACK 71 /* DEVFS Back node */
-#define M_DEVFSFRONT 72 /* DEVFS Front node */
-#define M_DEVFSNODE 73 /* DEVFS node */
-#define M_TEMP 74 /* misc temporary data buffers */
-#define M_TTYS 75 /* tty data structures */
-#define M_GZIP 76 /* Gzip trees */
-#define M_IPFW 77 /* IpFw/IpAcct chain's */
-#define M_DEVL 78 /* isa_device lists in userconfig() */
-#define M_PKTCLASS 79 /* structures used in packet classifier */
-#define M_SYSCTL 80 /* sysctl internal magic */
-#define M_SECA 81 /* security associations, key management */
-#define M_BIOBUF 82 /* BIO buffer */
-#define M_KTRACE 83 /* KTRACE */
-#define M_SELECT 84 /* select() buffer */
-#define M_CFS 85 /* Coda */
-#define M_LAST 86 /* Must be last type + 1 */
-
-#define INITKMEMNAMES { \
- "free", /* 0 M_FREE */ \
- "mbuf", /* 1 M_MBUF */ \
- "devbuf", /* 2 M_DEVBUF */ \
- "socket", /* 3 M_SOCKET */ \
- "pcb", /* 4 M_PCB */ \
- "routetbl", /* 5 M_RTABLE */ \
- "hosttbl", /* 6 M_HTABLE */ \
- "fragtbl", /* 7 M_FTABLE */ \
- "zombie", /* 8 M_ZOMBIE */ \
- "ifaddr", /* 9 M_IFADDR */ \
- "soopts", /* 10 M_SOOPTS */ \
- "soname", /* 11 M_SONAME */ \
- "namei", /* 12 M_NAMEI */ \
- "gprof", /* 13 M_GPROF */ \
- "ioctlops", /* 14 M_IOCTLOPS */ \
- "mapmem", /* 15 M_MAPMEM */ \
- "cred", /* 16 M_CRED */ \
- "pgrp", /* 17 M_PGRP */ \
- "session", /* 18 M_SESSION */ \
- "iov", /* 19 M_IOV */ \
- "mount", /* 20 M_MOUNT */ \
- "fhandle", /* 21 M_FHANDLE */ \
- "NFS req", /* 22 M_NFSREQ */ \
- "NFS mount", /* 23 M_NFSMNT */ \
- "NFS node", /* 24 M_NFSNODE */ \
- "vnodes", /* 25 M_VNODE */ \
- "namecache", /* 26 M_CACHE */ \
- "UFS quota", /* 27 M_DQUOT */ \
- "UFS mount", /* 28 M_UFSMNT */ \
- "shm", /* 29 M_SHM */ \
- "VM map", /* 30 M_VMMAP */ \
- "VM mapent", /* 31 M_VMMAPENT */ \
- "VM object", /* 32 M_VMOBJ */ \
- "VM objhash", /* 33 M_VMOBJHASH */ \
- "VM pmap", /* 34 M_VMPMAP */ \
- "VM pvmap", /* 35 M_VMPVENT */ \
- "VM pager", /* 36 M_VMPAGER */ \
- "VM pgdata", /* 37 M_VMPGDATA */ \
- "file", /* 38 M_FILE */ \
- "file desc", /* 39 M_FILEDESC */ \
- "lockf", /* 40 M_LOCKF */ \
- "proc", /* 41 M_PROC */ \
- "subproc", /* 42 M_SUBPROC */ \
- "LFS segment", /* 43 M_SEGMENT */ \
- "LFS node", /* 44 M_LFSNODE */ \
- "FFS node", /* 45 M_FFSNODE */ \
- "MFS node", /* 46 M_MFSNODE */ \
- "NQNFS Lease", /* 47 M_NQLEASE */ \
- "NQNFS Host", /* 48 M_NQMHOST */ \
- "Export Host", /* 49 M_NETADDR */ \
- "NFS srvsock", /* 50 M_NFSSVC */ \
- "NFS uid", /* 51 M_NFSUID */ \
- "NFS daemon", /* 52 M_NFSD */ \
- "ip_moptions", /* 53 M_IPMOPTS */ \
- "in_multi", /* 54 M_IPMADDR */ \
- "ether_multi", /* 55 M_IFMADDR */ \
- "mrt", /* 56 M_MRTABLE */ \
- "ISOFS mount", /* 57 M_ISOFSMNT */ \
- "ISOFS node", /* 58 M_ISOFSNODE */ \
- "NFSV3 srvdesc",/* 59 M_NFSRVDESC */ \
- "NFSV3 diroff", /* 60 M_NFSDIROFF */ \
- "NFSV3 bigfh", /* 61 M_NFSBIGFH */ \
- NULL, \
- NULL, NULL, NULL, NULL, \
- "MSDOSFS mount",/* 67 M_MSDOSFSMNT */ \
- "MSDOSFS node", /* 68 M_MSDOSFSNODE */ \
- "MSDOSFS FAT", /* 69 M_MSDOSFSFAR */ \
- "DEVFS mount", /* 70 M_DEVFSMNT */ \
- "DEVFS back", /* 71 M_DEVFSBACK */ \
- "DEVFS front", /* 72 M_DEVFSFRONT */ \
- "DEVFS node", /* 73 M_DEVFSNODE */ \
- "temp", /* 74 M_TEMP */ \
- "ttys", /* 75 M_TTYS */ \
- "Gzip trees", /* 76 M_GZIP */ \
- "IpFw/IpAcct", /* 77 M_IPFW */ \
- "isa_devlist", /* 78 M_DEVL */ \
- "PktClass", /* 79 M_PKTCLASS */ \
- "sysctl", /* 80 M_SYSCTL */ \
- "key mgmt", /* 81 M_SECA */ \
- "BIO buffer", /* 82 M_BIOBUF */ \
- "KTRACE", /* 83 M_KTRACE */ \
- "select", /* 84 M_SELECT */ \
- "Coda", /* 85 M_CFS */ \
-}
-
-struct kmemstats {
- long ks_inuse; /* # of packets of this type currently in use */
- long ks_calls; /* total packets of this type ever allocated */
- long ks_memuse; /* total memory held in bytes */
- u_short ks_limblocks; /* number of times blocked for hitting limit */
- u_short ks_mapblocks; /* number of times blocked for kernel map */
- long ks_maxused; /* maximum number ever used */
- long ks_limit; /* most that are allowed to exist */
- long ks_size; /* sizes of this thing that are allocated */
- long ks_spare;
-};
-
-/*
- * Array of descriptors that describe the contents of each page
- */
-struct kmemusage {
- short ku_indx; /* bucket index */
- union {
- u_short freecnt;/* for small allocations, free pieces in page */
- u_short pagecnt;/* for large allocations, pages alloced */
- } ku_un;
-};
-#define ku_freecnt ku_un.freecnt
-#define ku_pagecnt ku_un.pagecnt
-
-/*
- * Set of buckets for each size of memory block that is retained
- */
-struct kmembuckets {
- caddr_t kb_next; /* list of free blocks */
- caddr_t kb_last; /* last free block */
- long kb_calls; /* total calls to allocate this size */
- long kb_total; /* total number of blocks allocated */
- long kb_totalfree; /* # of free elements in this bucket */
- long kb_elmpercl; /* # of elements in this sized allocation */
- long kb_highwat; /* high water mark */
- long kb_couldfree; /* over high water mark and could free */
-};
-
-#ifdef KERNEL
-#define MINALLOCSIZE (1 << MINBUCKET)
-#define BUCKETINDX(size) \
- ((size) <= (MINALLOCSIZE * 128) \
- ? (size) <= (MINALLOCSIZE * 8) \
- ? (size) <= (MINALLOCSIZE * 2) \
- ? (size) <= (MINALLOCSIZE * 1) \
- ? (MINBUCKET + 0) \
- : (MINBUCKET + 1) \
- : (size) <= (MINALLOCSIZE * 4) \
- ? (MINBUCKET + 2) \
- : (MINBUCKET + 3) \
- : (size) <= (MINALLOCSIZE* 32) \
- ? (size) <= (MINALLOCSIZE * 16) \
- ? (MINBUCKET + 4) \
- : (MINBUCKET + 5) \
- : (size) <= (MINALLOCSIZE * 64) \
- ? (MINBUCKET + 6) \
- : (MINBUCKET + 7) \
- : (size) <= (MINALLOCSIZE * 2048) \
- ? (size) <= (MINALLOCSIZE * 512) \
- ? (size) <= (MINALLOCSIZE * 256) \
- ? (MINBUCKET + 8) \
- : (MINBUCKET + 9) \
- : (size) <= (MINALLOCSIZE * 1024) \
- ? (MINBUCKET + 10) \
- : (MINBUCKET + 11) \
- : (size) <= (MINALLOCSIZE * 8192) \
- ? (size) <= (MINALLOCSIZE * 4096) \
- ? (MINBUCKET + 12) \
- : (MINBUCKET + 13) \
- : (size) <= (MINALLOCSIZE * 16384) \
- ? (MINBUCKET + 14) \
- : (MINBUCKET + 15))
-
-/*
- * Turn virtual addresses into kmem map indices
- */
-#define kmemxtob(alloc) (kmembase + (alloc) * PAGE_SIZE)
-#define btokmemx(addr) (((caddr_t)(addr) - kmembase) / PAGE_SIZE)
-#define btokup(addr) (&kmemusage[(caddr_t)(addr) - kmembase >> PAGE_SHIFT])
-
-/*
- * Macro versions for the usual cases of malloc/free
- */
-#if defined(KMEMSTATS) || defined(DIAGNOSTIC)
-#define MALLOC(space, cast, size, type, flags) \
- (space) = (cast)malloc((u_long)(size), type, flags)
-#define FREE(addr, type) free((addr), type)
-
-#else /* do not collect statistics */
-#define MALLOC(space, cast, size, type, flags) { \
- register struct kmembuckets *kbp = &bucket[BUCKETINDX(size)]; \
- long s = splimp(); \
- if (kbp->kb_next == NULL) { \
- (space) = (cast)malloc((u_long)(size), type, flags); \
- } else { \
- (space) = (cast)kbp->kb_next; \
- kbp->kb_next = *(caddr_t *)(space); \
- } \
- splx(s); \
-}
-
-#define FREE(addr, type) { \
- register struct kmembuckets *kbp; \
- register struct kmemusage *kup = btokup(addr); \
- long s = splimp(); \
- if (1 << kup->ku_indx > MAXALLOCSAVE) { \
- free((addr), type); \
- } else { \
- kbp = &bucket[kup->ku_indx]; \
- if (kbp->kb_next == NULL) \
- kbp->kb_next = (caddr_t)(addr); \
- else \
- *(caddr_t *)(kbp->kb_last) = (caddr_t)(addr); \
- *(caddr_t *)(addr) = NULL; \
- kbp->kb_last = (caddr_t)(addr); \
- } \
- splx(s); \
-}
-#endif /* do not collect statistics */
-
-extern struct kmemstats kmemstats[];
-extern struct kmemusage *kmemusage;
-extern char *kmembase;
-extern struct kmembuckets bucket[];
-
-void *contigmalloc __P((unsigned long size, int type, int flags,
- unsigned long low, unsigned long high,
- unsigned long alignment, unsigned long boundary));
-void free __P((void *addr, int type));
-void *malloc __P((unsigned long size, int type, int flags));
-#endif /* KERNEL */
-
-#endif /* !_SYS_MALLOC_H_ */
diff --git a/c/src/lib/libnetworking/sys/mbuf.h b/c/src/lib/libnetworking/sys/mbuf.h
deleted file mode 100644
index b380b3fca3..0000000000
--- a/c/src/lib/libnetworking/sys/mbuf.h
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)mbuf.h 8.5 (Berkeley) 2/19/95
- * $Id$
- */
-
-#ifndef _SYS_MBUF_H_
-#define _SYS_MBUF_H_
-
-#ifndef M_WAITOK
-#include <sys/malloc.h>
-#endif
-
-/*
- * Mbufs are of a single size, MSIZE (machine/machparam.h), which
- * includes overhead. An mbuf may add a single "mbuf cluster" of size
- * MCLBYTES (also in machine/machparam.h), which has no additional overhead
- * and is used instead of the internal data area; this is done when
- * at least MINCLSIZE of data must be stored.
- */
-
-#define MLEN (MSIZE - sizeof(struct m_hdr)) /* normal data len */
-#define MHLEN (MLEN - sizeof(struct pkthdr)) /* data len w/pkthdr */
-
-#define MINCLSIZE (MHLEN + MLEN) /* smallest amount to put in cluster */
-#define M_MAXCOMPRESS (MHLEN / 2) /* max amount to copy for compression */
-
-/*
- * Macros for type conversion
- * mtod(m,t) - convert mbuf pointer to data pointer of correct type
- * dtom(x) - convert data pointer within mbuf to mbuf pointer (XXX)
- * mtocl(x) - convert pointer within cluster to cluster index #
- * cltom(x) - convert cluster # to ptr to beginning of cluster
- */
-#define mtod(m,t) ((t)((m)->m_data))
-#define dtom(x) ((struct mbuf *)((long)(x) & ~(MSIZE-1)))
-#define mtocl(x) (((u_long)(x) - (u_long)mbutl) >> MCLSHIFT)
-#define cltom(x) ((caddr_t)((u_long)mbutl + ((u_long)(x) << MCLSHIFT)))
-
-/* header at beginning of each mbuf: */
-struct m_hdr {
- struct mbuf *mh_next; /* next buffer in chain */
- struct mbuf *mh_nextpkt; /* next chain in queue/record */
- caddr_t mh_data; /* location of data */
- int mh_len; /* amount of data in this mbuf */
- short mh_type; /* type of data in this mbuf */
- short mh_flags; /* flags; see below */
-};
-
-/* record/packet header in first mbuf of chain; valid if M_PKTHDR set */
-struct pkthdr {
- struct ifnet *rcvif; /* rcv interface */
- int len; /* total packet length */
-};
-
-/* description of external storage mapped into mbuf, valid if M_EXT set */
-struct m_ext {
- caddr_t ext_buf; /* start of buffer */
- void (*ext_free) /* free routine if not the usual */
- __P((caddr_t, u_int));
- u_int ext_size; /* size of buffer, for ext_free */
- void (*ext_ref) /* add a reference to the ext object */
- __P((caddr_t, u_int));
-};
-
-struct mbuf {
- struct m_hdr m_hdr;
- union {
- struct {
- struct pkthdr MH_pkthdr; /* M_PKTHDR set */
- union {
- struct m_ext MH_ext; /* M_EXT set */
- char MH_databuf[MHLEN];
- } MH_dat;
- } MH;
- char M_databuf[MLEN]; /* !M_PKTHDR, !M_EXT */
- } M_dat;
-};
-#define m_next m_hdr.mh_next
-#define m_len m_hdr.mh_len
-#define m_data m_hdr.mh_data
-#define m_type m_hdr.mh_type
-#define m_flags m_hdr.mh_flags
-#define m_nextpkt m_hdr.mh_nextpkt
-#define m_act m_nextpkt
-#define m_pkthdr M_dat.MH.MH_pkthdr
-#define m_ext M_dat.MH.MH_dat.MH_ext
-#define m_pktdat M_dat.MH.MH_dat.MH_databuf
-#define m_dat M_dat.M_databuf
-
-/* mbuf flags */
-#define M_EXT 0x0001 /* has associated external storage */
-#define M_PKTHDR 0x0002 /* start of record */
-#define M_EOR 0x0004 /* end of record */
-#define M_PROTO1 0x0008 /* protocol-specific */
-
-/* mbuf pkthdr flags, also in m_flags */
-#define M_BCAST 0x0100 /* send/received as link-level broadcast */
-#define M_MCAST 0x0200 /* send/received as link-level multicast */
-
-/* flags copied when copying m_pkthdr */
-#define M_COPYFLAGS (M_PKTHDR|M_EOR|M_PROTO1|M_BCAST|M_MCAST)
-
-/* mbuf types */
-#define MT_FREE 0 /* should be on free list */
-#define MT_DATA 1 /* dynamic (data) allocation */
-#define MT_HEADER 2 /* packet header */
-#define MT_SOCKET 3 /* socket structure */
-#define MT_PCB 4 /* protocol control block */
-#define MT_RTABLE 5 /* routing tables */
-#define MT_HTABLE 6 /* IMP host tables */
-#define MT_ATABLE 7 /* address resolution tables */
-#define MT_SONAME 8 /* socket name */
-#define MT_SOOPTS 10 /* socket options */
-#define MT_FTABLE 11 /* fragment reassembly header */
-#define MT_RIGHTS 12 /* access rights */
-#define MT_IFADDR 13 /* interface address */
-#define MT_CONTROL 14 /* extra-data protocol message */
-#define MT_OOBDATA 15 /* expedited data */
-
-/* flags to m_get/MGET */
-#define M_DONTWAIT M_NOWAIT
-#define M_WAIT M_WAITOK
-
-/* Freelists:
- *
- * Normal mbuf clusters are normally treated as character arrays
- * after allocation, but use the first word of the buffer as a free list
- * pointer while on the free list.
- */
-union mcluster {
- union mcluster *mcl_next;
- char mcl_buf[MCLBYTES];
-};
-
-/*
- * mbuf utility macros:
- *
- * MBUFLOCK(code)
- * prevents a section of code from from being interrupted by network
- * drivers.
- */
-#define MBUFLOCK(code) \
- { int ms = splimp(); \
- { code } \
- splx(ms); \
- }
-
-/*
- * mbuf allocation/deallocation macros:
- *
- * MGET(struct mbuf *m, int how, int type)
- * allocates an mbuf and initializes it to contain internal data.
- *
- * MGETHDR(struct mbuf *m, int how, int type)
- * allocates an mbuf and initializes it to contain a packet header
- * and internal data.
- */
-#define MGET(m, how, type) { \
- int _ms = splimp(); \
- if (mmbfree == 0) \
- (void)m_mballoc(1, (how)); \
- if (((m) = mmbfree) != 0) { \
- mmbfree = (m)->m_next; \
- mbstat.m_mtypes[MT_FREE]--; \
- (m)->m_type = (type); \
- mbstat.m_mtypes[type]++; \
- (m)->m_next = (struct mbuf *)NULL; \
- (m)->m_nextpkt = (struct mbuf *)NULL; \
- (m)->m_data = (m)->m_dat; \
- (m)->m_flags = 0; \
- splx(_ms); \
- } else { \
- splx(_ms); \
- (m) = m_retry((how), (type)); \
- } \
-}
-
-#define MGETHDR(m, how, type) { \
- int _ms = splimp(); \
- if (mmbfree == 0) \
- (void)m_mballoc(1, (how)); \
- if (((m) = mmbfree) != 0) { \
- mmbfree = (m)->m_next; \
- mbstat.m_mtypes[MT_FREE]--; \
- (m)->m_type = (type); \
- mbstat.m_mtypes[type]++; \
- (m)->m_next = (struct mbuf *)NULL; \
- (m)->m_nextpkt = (struct mbuf *)NULL; \
- (m)->m_data = (m)->m_pktdat; \
- (m)->m_flags = M_PKTHDR; \
- splx(_ms); \
- } else { \
- splx(_ms); \
- (m) = m_retryhdr((how), (type)); \
- } \
-}
-
-/*
- * Mbuf cluster macros.
- * MCLALLOC(caddr_t p, int how) allocates an mbuf cluster.
- * MCLGET adds such clusters to a normal mbuf;
- * the flag M_EXT is set upon success.
- * MCLFREE releases a reference to a cluster allocated by MCLALLOC,
- * freeing the cluster if the reference count has reached 0.
- */
-#define MCLALLOC(p, how) \
- MBUFLOCK( \
- if (mclfree == 0) \
- (void)m_clalloc(1, (how)); \
- if (((p) = (caddr_t)mclfree) != 0) { \
- ++mclrefcnt[mtocl(p)]; \
- mbstat.m_clfree--; \
- mclfree = ((union mcluster *)(p))->mcl_next; \
- } \
- )
-
-#define MCLGET(m, how) \
- { MCLALLOC((m)->m_ext.ext_buf, (how)); \
- if ((m)->m_ext.ext_buf != NULL) { \
- (m)->m_data = (m)->m_ext.ext_buf; \
- (m)->m_flags |= M_EXT; \
- (m)->m_ext.ext_free = NULL; \
- (m)->m_ext.ext_ref = NULL; \
- (m)->m_ext.ext_size = MCLBYTES; \
- } \
- }
-
-#define MCLFREE(p) \
- MBUFLOCK ( \
- if (--mclrefcnt[mtocl(p)] == 0) { \
- ((union mcluster *)(p))->mcl_next = mclfree; \
- mclfree = (union mcluster *)(p); \
- mbstat.m_clfree++; \
- } \
- )
-
-/*
- * MFREE(struct mbuf *m, struct mbuf *n)
- * Free a single mbuf and associated external storage.
- * Place the successor, if any, in n.
- */
-#define MFREE(m, n) \
- MBUFLOCK( \
- mbstat.m_mtypes[(m)->m_type]--; \
- if ((m)->m_flags & M_EXT) { \
- if ((m)->m_ext.ext_free) \
- (*((m)->m_ext.ext_free))((m)->m_ext.ext_buf, \
- (m)->m_ext.ext_size); \
- else { \
- char *p = (m)->m_ext.ext_buf; \
- if (--mclrefcnt[mtocl(p)] == 0) { \
- ((union mcluster *)(p))->mcl_next = mclfree; \
- mclfree = (union mcluster *)(p); \
- mbstat.m_clfree++; \
- } \
- } \
- } \
- (n) = (m)->m_next; \
- (m)->m_type = MT_FREE; \
- mbstat.m_mtypes[MT_FREE]++; \
- (m)->m_next = mmbfree; \
- mmbfree = (m); \
- )
-
-/*
- * Copy mbuf pkthdr from from to to.
- * from must have M_PKTHDR set, and to must be empty.
- */
-#define M_COPY_PKTHDR(to, from) { \
- (to)->m_pkthdr = (from)->m_pkthdr; \
- (to)->m_flags = (from)->m_flags & M_COPYFLAGS; \
- (to)->m_data = (to)->m_pktdat; \
-}
-
-/*
- * Set the m_data pointer of a newly-allocated mbuf (m_get/MGET) to place
- * an object of the specified size at the end of the mbuf, longword aligned.
- */
-#define M_ALIGN(m, len) \
- { (m)->m_data += (MLEN - (len)) &~ (sizeof(long) - 1); }
-/*
- * As above, for mbufs allocated with m_gethdr/MGETHDR
- * or initialized by M_COPY_PKTHDR.
- */
-#define MH_ALIGN(m, len) \
- { (m)->m_data += (MHLEN - (len)) &~ (sizeof(long) - 1); }
-
-/*
- * Compute the amount of space available
- * before the current start of data in an mbuf.
- */
-#define M_LEADINGSPACE(m) \
- ((m)->m_flags & M_EXT ? /* (m)->m_data - (m)->m_ext.ext_buf */ 0 : \
- (m)->m_flags & M_PKTHDR ? (m)->m_data - (m)->m_pktdat : \
- (m)->m_data - (m)->m_dat)
-
-/*
- * Compute the amount of space available
- * after the end of data in an mbuf.
- */
-#define M_TRAILINGSPACE(m) \
- ((m)->m_flags & M_EXT ? (m)->m_ext.ext_buf + (m)->m_ext.ext_size - \
- ((m)->m_data + (m)->m_len) : \
- &(m)->m_dat[MLEN] - ((m)->m_data + (m)->m_len))
-
-/*
- * Arrange to prepend space of size plen to mbuf m.
- * If a new mbuf must be allocated, how specifies whether to wait.
- * If how is M_DONTWAIT and allocation fails, the original mbuf chain
- * is freed and m is set to NULL.
- */
-#define M_PREPEND(m, plen, how) { \
- if (M_LEADINGSPACE(m) >= (plen)) { \
- (m)->m_data -= (plen); \
- (m)->m_len += (plen); \
- } else \
- (m) = m_prepend((m), (plen), (how)); \
- if ((m) && (m)->m_flags & M_PKTHDR) \
- (m)->m_pkthdr.len += (plen); \
-}
-
-/* change mbuf to new type */
-#define MCHTYPE(m, t) { \
- MBUFLOCK(mbstat.m_mtypes[(m)->m_type]--; mbstat.m_mtypes[t]++;) \
- (m)->m_type = t;\
-}
-
-/* length to m_copy to copy all */
-#define M_COPYALL 1000000000
-
-/* compatibility with 4.3 */
-#define m_copy(m, o, l) m_copym((m), (o), (l), M_DONTWAIT)
-
-/*
- * Mbuf statistics.
- */
-struct mbstat {
- u_long m_mbufs; /* mbufs obtained from page pool */
- u_long m_clusters; /* clusters obtained from page pool */
- u_long m_spare; /* spare field */
- u_long m_clfree; /* free clusters */
- u_long m_drops; /* times failed to find space */
- u_long m_wait; /* times waited for space */
- u_long m_drain; /* times drained protocols for space */
- u_short m_mtypes[256]; /* type specific mbuf allocations */
-};
-
-#ifdef KERNEL
-extern struct mbuf *mbutl; /* virtual address of mclusters */
-extern char *mclrefcnt; /* cluster reference counts */
-extern struct mbstat mbstat;
-extern int nmbclusters;
-extern int nmbufs;
-extern struct mbuf *mmbfree;
-extern union mcluster *mclfree;
-extern int max_linkhdr; /* largest link-level header */
-extern int max_protohdr; /* largest protocol header */
-extern int max_hdr; /* largest link+protocol header */
-extern int max_datalen; /* MHLEN - max_hdr */
-extern int mbtypes[]; /* XXX */
-
-struct mbuf *m_copym __P((struct mbuf *, int, int, int));
-struct mbuf *m_copypacket __P((struct mbuf *, int));
-struct mbuf *m_devget __P((char *, int, int, struct ifnet *,
- void (*copy)(char *, caddr_t, u_int)));
-struct mbuf *m_free __P((struct mbuf *));
-struct mbuf *m_get __P((int, int));
-struct mbuf *m_getclr __P((int, int));
-struct mbuf *m_gethdr __P((int, int));
-struct mbuf *m_prepend __P((struct mbuf *,int,int));
-struct mbuf *m_pullup __P((struct mbuf *, int));
-struct mbuf *m_retry __P((int, int));
-struct mbuf *m_retryhdr __P((int, int));
-struct mbuf *m_split __P((struct mbuf *,int,int));
-void m_adj __P((struct mbuf *, int));
-void m_cat __P((struct mbuf *,struct mbuf *));
-int m_mballoc __P((int, int));
-int m_clalloc __P((int, int));
-void m_copyback __P((struct mbuf *, int, int, caddr_t));
-void m_copydata __P((struct mbuf *,int,int,caddr_t));
-void m_freem __P((struct mbuf *));
-
-#ifdef MBTYPES
-int mbtypes[] = { /* XXX */
- M_FREE, /* MT_FREE 0 should be on free list */
- M_MBUF, /* MT_DATA 1 dynamic (data) allocation */
- M_MBUF, /* MT_HEADER 2 packet header */
- M_SOCKET, /* MT_SOCKET 3 socket structure */
- M_PCB, /* MT_PCB 4 protocol control block */
- M_RTABLE, /* MT_RTABLE 5 routing tables */
- M_HTABLE, /* MT_HTABLE 6 IMP host tables */
- 0, /* MT_ATABLE 7 address resolution tables */
- M_MBUF, /* MT_SONAME 8 socket name */
- 0, /* 9 */
- M_SOOPTS, /* MT_SOOPTS 10 socket options */
- M_FTABLE, /* MT_FTABLE 11 fragment reassembly header */
- M_MBUF, /* MT_RIGHTS 12 access rights */
- M_IFADDR, /* MT_IFADDR 13 interface address */
- M_MBUF, /* MT_CONTROL 14 extra-data protocol message */
- M_MBUF, /* MT_OOBDATA 15 expedited data */
-#ifdef DATAKIT
- 25, 26, 27, 28, 29, 30, 31, 32 /* datakit ugliness */
-#endif
-};
-#endif
-#endif
-
-#endif /* !_SYS_MBUF_H_ */
diff --git a/c/src/lib/libnetworking/sys/mount.h b/c/src/lib/libnetworking/sys/mount.h
deleted file mode 100644
index a6254e302d..0000000000
--- a/c/src/lib/libnetworking/sys/mount.h
+++ /dev/null
@@ -1,531 +0,0 @@
-/*
- * Copyright (c) 1989, 1991, 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.
- *
- * @(#)mount.h 8.13 (Berkeley) 3/27/94
- * $Id$
- */
-
-#ifndef _SYS_MOUNT_H_
-#define _SYS_MOUNT_H_
-
-#ifndef KERNEL
-#include <sys/ucred.h>
-#endif
-#include <sys/queue.h>
-
-typedef struct fsid { long val[2]; } fsid_t; /* file system id type */
-
-/*
- * File identifier.
- * These are unique per filesystem on a single machine.
- */
-#define MAXFIDSZ 16
-
-struct fid {
- u_short fid_len; /* length of data in bytes */
- u_short fid_reserved; /* force longword alignment */
- char fid_data[MAXFIDSZ]; /* data (variable length) */
-};
-
-/*
- * file system statistics
- */
-
-#define MNAMELEN 90 /* length of buffer for returned name */
-
-struct statfs {
- long f_spare2; /* placeholder */
- long f_bsize; /* fundamental file system block size */
- long f_iosize; /* optimal transfer block size */
- long f_blocks; /* total data blocks in file system */
- long f_bfree; /* free blocks in fs */
- long f_bavail; /* free blocks avail to non-superuser */
- long f_files; /* total file nodes in file system */
- long f_ffree; /* free file nodes in fs */
- fsid_t f_fsid; /* file system id */
- uid_t f_owner; /* user that mounted the filesystem */
- int f_type; /* type of filesystem (see below) */
- int f_flags; /* copy of mount flags */
- long f_spare[6]; /* spare for later */
- char f_mntonname[MNAMELEN]; /* directory on which mounted */
- char f_mntfromname[MNAMELEN];/* mounted filesystem */
-};
-
-/*
- * File system types.
- */
-#define MOUNT_NONE 0
-#define MOUNT_UFS 1 /* Fast Filesystem */
-#define MOUNT_NFS 2 /* Sun-compatible Network Filesystem */
-#define MOUNT_MFS 3 /* Memory-based Filesystem */
-#define MOUNT_MSDOS 4 /* MS/DOS Filesystem */
-#define MOUNT_LFS 5 /* Log-based Filesystem */
-#define MOUNT_LOFS 6 /* Loopback Filesystem */
-#define MOUNT_FDESC 7 /* File Descriptor Filesystem */
-#define MOUNT_PORTAL 8 /* Portal Filesystem */
-#define MOUNT_NULL 9 /* Minimal Filesystem Layer */
-#define MOUNT_UMAP 10 /* User/Group Identifier Remapping Filesystem */
-#define MOUNT_KERNFS 11 /* Kernel Information Filesystem */
-#define MOUNT_PROCFS 12 /* /proc Filesystem */
-#define MOUNT_AFS 13 /* Andrew Filesystem */
-#define MOUNT_CD9660 14 /* ISO9660 (aka CDROM) Filesystem */
-#define MOUNT_UNION 15 /* Union (translucent) Filesystem */
-#define MOUNT_DEVFS 16 /* existing device Filesystem */
-#define MOUNT_EXT2FS 17 /* Linux EXT2FS */
-#define MOUNT_TFS 18 /* Netcon Novell filesystem */
-#define MOUNT_CFS 19 /* Coda filesystem */
-#define MOUNT_MAXTYPE 19
-
-#define INITMOUNTNAMES { \
- "none", /* 0 MOUNT_NONE */ \
- "ufs", /* 1 MOUNT_UFS */ \
- "nfs", /* 2 MOUNT_NFS */ \
- "mfs", /* 3 MOUNT_MFS */ \
- "msdos", /* 4 MOUNT_MSDOS */ \
- "lfs", /* 5 MOUNT_LFS */ \
- "lofs", /* 6 MOUNT_LOFS */ \
- "fdesc", /* 7 MOUNT_FDESC */ \
- "portal", /* 8 MOUNT_PORTAL */ \
- "null", /* 9 MOUNT_NULL */ \
- "umap", /* 10 MOUNT_UMAP */ \
- "kernfs", /* 11 MOUNT_KERNFS */ \
- "procfs", /* 12 MOUNT_PROCFS */ \
- "afs", /* 13 MOUNT_AFS */ \
- "cd9660", /* 14 MOUNT_CD9660 */ \
- "union", /* 15 MOUNT_UNION */ \
- "devfs", /* 16 MOUNT_DEVFS */ \
- "ext2fs", /* 17 MOUNT_EXT2FS */ \
- "tfs", /* 18 MOUNT_TFS */ \
- "cfs", /* 19 MOUNT_CFS */ \
- 0, /* 20 MOUNT_SPARE */ \
-}
-
-/*
- * Structure per mounted file system. Each mounted file system has an
- * array of operations and an instance record. The file systems are
- * put on a doubly linked list.
- */
-LIST_HEAD(vnodelst, vnode);
-
-struct mount {
- CIRCLEQ_ENTRY(mount) mnt_list; /* mount list */
- struct vfsops *mnt_op; /* operations on fs */
- struct vfsconf *mnt_vfc; /* configuration info */
- struct vnode *mnt_vnodecovered; /* vnode we mounted on */
- struct vnodelst mnt_vnodelist; /* list of vnodes this mount */
- int mnt_flag; /* flags */
- int mnt_maxsymlinklen; /* max size of short symlink */
- struct statfs mnt_stat; /* cache of filesystem stats */
- qaddr_t mnt_data; /* private data */
-/* struct vfsconf *mnt_vfc; */ /* configuration info */
- time_t mnt_time; /* last time written*/
-};
-
-/*
- * Mount flags.
- *
- * Unmount uses MNT_FORCE flag.
- */
-#define MNT_RDONLY 0x00000001 /* read only filesystem */
-#define MNT_SYNCHRONOUS 0x00000002 /* file system written synchronously */
-#define MNT_NOEXEC 0x00000004 /* can't exec from filesystem */
-#define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */
-#define MNT_NODEV 0x00000010 /* don't interpret special files */
-#define MNT_UNION 0x00000020 /* union with underlying filesystem */
-#define MNT_ASYNC 0x00000040 /* file system written asynchronously */
-#define MNT_NOATIME 0x10000000 /* Disable update of file access times */
-
-/*
- * exported mount flags.
- */
-#define MNT_EXRDONLY 0x00000080 /* exported read only */
-#define MNT_EXPORTED 0x00000100 /* file system is exported */
-#define MNT_DEFEXPORTED 0x00000200 /* exported to the world */
-#define MNT_EXPORTANON 0x00000400 /* use anon uid mapping for everyone */
-#define MNT_EXKERB 0x00000800 /* exported with Kerberos uid mapping */
-
-/*
- * Flags set by internal operations.
- */
-#define MNT_LOCAL 0x00001000 /* filesystem is stored locally */
-#define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */
-#define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */
-#define MNT_USER 0x00008000 /* mounted by a user */
-
-/*
- * Mask of flags that are visible to statfs()
- */
-#define MNT_VISFLAGMASK (MNT_RDONLY|MNT_SYNCHRONOUS|MNT_NOEXEC|MNT_NOSUID| \
- MNT_NODEV|MNT_UNION|MNT_ASYNC|MNT_EXRDONLY|MNT_EXPORTED| \
- MNT_DEFEXPORTED|MNT_EXPORTANON|MNT_EXKERB|MNT_LOCAL| \
- MNT_QUOTA|MNT_ROOTFS|MNT_USER|MNT_NOATIME)
-
-/*
- * filesystem control flags.
- *
- * MNT_MLOCK lock the mount entry so that name lookup cannot proceed
- * past the mount point. This keeps the subtree stable during mounts
- * and unmounts.
- */
-#define MNT_UPDATE 0x00010000 /* not a real mount, just an update */
-#define MNT_DELEXPORT 0x00020000 /* delete export host lists */
-#define MNT_RELOAD 0x00040000 /* reload filesystem data */
-#define MNT_FORCE 0x00080000 /* force unmount or readonly change */
-#define MNT_MLOCK 0x00100000 /* lock so that subtree is stable */
-#define MNT_MWAIT 0x00200000 /* someone is waiting for lock */
-#define MNT_MPBUSY 0x00400000 /* scan of mount point in progress */
-#define MNT_MPWANT 0x00800000 /* waiting for mount point */
-#define MNT_UNMOUNT 0x01000000 /* unmount in progress */
-#define MNT_WANTRDWR 0x02000000 /* want upgrade to read/write */
-
-/*
- * used to get configured filesystems information
- */
-#define VFS_MAXNAMELEN 32
-struct vfsconf {
- void *vfc_vfsops;
- char vfc_name[VFS_MAXNAMELEN];
- int vfc_index;
- int vfc_refcount;
- int vfc_flags;
-};
-
-/*
- * NB: these flags refer to IMPLEMENTATION properties, not properties of
- * any actual mounts; i.e., it does not make sense to change the flags.
- */
-#define VFCF_STATIC 0x00000001 /* statically compiled into kernel */
-#define VFCF_NETWORK 0x00000002 /* may get data over the network */
-#define VFCF_READONLY 0x00000004 /* writes are not implemented */
-#define VFCF_SYNTHETIC 0x00000008 /* data does not represent real files */
-#define VFCF_LOOPBACK 0x00000010 /* aliases some other mounted FS */
-#define VFCF_UNICODE 0x00000020 /* stores file names as Unicode*/
-
-/*
- * Operations supported on mounted file system.
- */
-#ifdef KERNEL
-
-extern int doforce; /* Flag to permit forcible unmounting. */
-extern struct vfsconf void_vfsconf;
-extern struct vfsconf *vfsconf[];
-
-#ifdef __STDC__
-struct nameidata;
-struct mbuf;
-#endif
-
-struct vfsops {
- int (*vfs_mount) __P((struct mount *mp, char *path, caddr_t data,
- struct nameidata *ndp, struct proc *p));
- int (*vfs_start) __P((struct mount *mp, int flags,
- struct proc *p));
- int (*vfs_unmount) __P((struct mount *mp, int mntflags,
- struct proc *p));
- int (*vfs_root) __P((struct mount *mp, struct vnode **vpp));
- int (*vfs_quotactl) __P((struct mount *mp, int cmds, uid_t uid,
- caddr_t arg, struct proc *p));
- int (*vfs_statfs) __P((struct mount *mp, struct statfs *sbp,
- struct proc *p));
- int (*vfs_sync) __P((struct mount *mp, int waitfor,
- struct ucred *cred, struct proc *p));
- int (*vfs_vget) __P((struct mount *mp, ino_t ino,
- struct vnode **vpp));
- int (*vfs_fhtovp) __P((struct mount *mp, struct fid *fhp,
- struct mbuf *nam, struct vnode **vpp,
- int *exflagsp, struct ucred **credanonp));
- int (*vfs_vptofh) __P((struct vnode *vp, struct fid *fhp));
- int (*vfs_init) __P((void));
-};
-
-#define VFS_MOUNT(MP, PATH, DATA, NDP, P) \
- (*(MP)->mnt_op->vfs_mount)(MP, PATH, DATA, NDP, P)
-#define VFS_START(MP, FLAGS, P) (*(MP)->mnt_op->vfs_start)(MP, FLAGS, P)
-#define VFS_UNMOUNT(MP, FORCE, P) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE, P)
-#define VFS_ROOT(MP, VPP) (*(MP)->mnt_op->vfs_root)(MP, VPP)
-#define VFS_QUOTACTL(MP,C,U,A,P) (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A, P)
-#define VFS_STATFS(MP, SBP, P) (*(MP)->mnt_op->vfs_statfs)(MP, SBP, P)
-#define VFS_SYNC(MP, WAIT, C, P) (*(MP)->mnt_op->vfs_sync)(MP, WAIT, C, P)
-#define VFS_VGET(MP, INO, VPP) (*(MP)->mnt_op->vfs_vget)(MP, INO, VPP)
-#define VFS_FHTOVP(MP, FIDP, NAM, VPP, EXFLG, CRED) \
- (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, NAM, VPP, EXFLG, CRED)
-#define VFS_VPTOFH(VP, FIDP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP)
-
-#ifdef VFS_LKM
-#include <sys/conf.h>
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-#define VFS_SET(vfsops, fsname, index, flags) \
- static struct vfsconf _fs_vfsconf = { \
- &vfsops, \
- #fsname, \
- index, \
- 0, \
- flags \
- }; \
- extern struct linker_set MODVNOPS; \
- MOD_VFS(#fsname,index,&MODVNOPS,&_fs_vfsconf); \
- int \
- fsname ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \
- DISPATCH(lkmtp, cmd, ver, lkm_nullcmd, lkm_nullcmd, lkm_nullcmd); }
-#else
-
-#define VFS_SET(vfsops, fsname, index, flags) \
- static struct vfsconf _fs_vfsconf = { \
- &vfsops, \
- #fsname, \
- index, \
- 0, \
- flags | VFCF_STATIC \
- }; \
- DATA_SET(vfs_set,_fs_vfsconf)
-#endif /* VFS_LKM */
-
-#endif /* KERNEL */
-
-/*
- * Flags for various system call interfaces.
- *
- * waitfor flags to vfs_sync() and getfsstat()
- */
-#define MNT_WAIT 1
-#define MNT_NOWAIT 2
-
-/*
- * Generic file handle
- */
-struct fhandle {
- fsid_t fh_fsid; /* File system id of mount point */
- struct fid fh_fid; /* File sys specific id */
-};
-typedef struct fhandle fhandle_t;
-
-#ifdef KERNEL
-#include <net/radix.h>
-#include <sys/socket.h> /* XXX for AF_MAX */
-
-/*
- * Network address lookup element
- */
-struct netcred {
- struct radix_node netc_rnodes[2];
- int netc_exflags;
- struct ucred netc_anon;
-};
-
-/*
- * Network export information
- */
-struct netexport {
- struct netcred ne_defexported; /* Default export */
- struct radix_node_head *ne_rtable[AF_MAX+1]; /* Individual exports */
-};
-#endif /* KERNEL */
-
-/*
- * Export arguments for local filesystem mount calls.
- */
-struct export_args {
- int ex_flags; /* export related flags */
- uid_t ex_root; /* mapping for root uid */
- struct ucred ex_anon; /* mapping for anonymous user */
- struct sockaddr *ex_addr; /* net address to which exported */
- int ex_addrlen; /* and the net address length */
- struct sockaddr *ex_mask; /* mask of valid bits in saddr */
- int ex_masklen; /* and the smask length */
-};
-
-/*
- * Arguments to mount UFS-based filesystems
- */
-struct ufs_args {
- char *fspec; /* block special device to mount */
- struct export_args export; /* network export information */
-};
-
-#ifdef MFS
-/*
- * Arguments to mount MFS
- */
-struct mfs_args {
- char *fspec; /* name to export for statfs */
- struct export_args export; /* if exported MFSes are supported */
- caddr_t base; /* base of file system in memory */
- u_long size; /* size of file system */
-};
-#endif /* MFS */
-
-#ifdef MSDOSFS
-/*
- * Arguments to mount MSDOS filesystems.
- */
-struct msdosfs_args {
- char *fspec; /* blocks special holding the fs to mount */
- struct export_args export; /* network export information */
- uid_t uid; /* uid that owns msdosfs files */
- gid_t gid; /* gid that owns msdosfs files */
- mode_t mask; /* mask to be applied for msdosfs perms */
-};
-#endif
-
-#ifdef CD9660
-/*
- * Arguments to mount ISO 9660 filesystems.
- */
-struct iso_args {
- char *fspec; /* block special device to mount */
- struct export_args export; /* network export info */
- int flags; /* mounting flags, see below */
- int ssector; /* starting sector */
-
-};
-#define ISOFSMNT_NORRIP 0x00000001 /* disable Rock Ridge Ext.*/
-#define ISOFSMNT_GENS 0x00000002 /* enable generation numbers */
-#define ISOFSMNT_EXTATT 0x00000004 /* enable extended attributes */
-#endif /* CD9660 */
-
-#ifdef NFS
-/*
- * Arguments to mount NFS
- */
-struct nfs_args {
- struct sockaddr *addr; /* file server address */
- int addrlen; /* length of address */
- int sotype; /* Socket type */
- int proto; /* and Protocol */
- u_char *fh; /* File handle to be mounted */
- int fhsize; /* Size, in bytes, of fh */
- int flags; /* flags */
- int wsize; /* write size in bytes */
- int rsize; /* read size in bytes */
- int readdirsize; /* readdir size in bytes */
- int timeo; /* initial timeout in .1 secs */
- int retrans; /* times to retry send */
- int maxgrouplist; /* Max. size of group list */
- int readahead; /* # of blocks to readahead */
- int leaseterm; /* Term (sec) of lease */
- int deadthresh; /* Retrans threshold */
- char *hostname; /* server's name */
-};
-
-/*
- * NFS mount option flags
- */
-#define NFSMNT_SOFT 0x00000001 /* soft mount (hard is default) */
-#define NFSMNT_WSIZE 0x00000002 /* set write size */
-#define NFSMNT_RSIZE 0x00000004 /* set read size */
-#define NFSMNT_TIMEO 0x00000008 /* set initial timeout */
-#define NFSMNT_RETRANS 0x00000010 /* set number of request retrys */
-#define NFSMNT_MAXGRPS 0x00000020 /* set maximum grouplist size */
-#define NFSMNT_INT 0x00000040 /* allow interrupts on hard mount */
-#define NFSMNT_NOCONN 0x00000080 /* Don't Connect the socket */
-#define NFSMNT_NQNFS 0x00000100 /* Use Nqnfs protocol */
-#define NFSMNT_NFSV3 0x00000200 /* Use NFS Version 3 protocol */
-#define NFSMNT_KERB 0x00000400 /* Use Kerberos authentication */
-#define NFSMNT_DUMBTIMR 0x00000800 /* Don't estimate rtt dynamically */
-#define NFSMNT_LEASETERM 0x00001000 /* set lease term (nqnfs) */
-#define NFSMNT_READAHEAD 0x00002000 /* set read ahead */
-#define NFSMNT_DEADTHRESH 0x00004000 /* set dead server retry thresh */
-#define NFSMNT_RESVPORT 0x00008000 /* Allocate a reserved port */
-#define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */
-#define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */
-#define NFSMNT_INTERNAL 0xfffc0000 /* Bits set internally */
-#define NFSMNT_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */
-#define NFSMNT_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */
-#define NFSMNT_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */
-#define NFSMNT_MNTD 0x00200000 /* Mnt server for mnt point */
-#define NFSMNT_DISMINPROG 0x00400000 /* Dismount in progress */
-#define NFSMNT_DISMNT 0x00800000 /* Dismounted */
-#define NFSMNT_SNDLOCK 0x01000000 /* Send socket lock */
-#define NFSMNT_WANTSND 0x02000000 /* Want above */
-#define NFSMNT_RCVLOCK 0x04000000 /* Rcv socket lock */
-#define NFSMNT_WANTRCV 0x08000000 /* Want above */
-#define NFSMNT_WAITAUTH 0x10000000 /* Wait for authentication */
-#define NFSMNT_HASAUTH 0x20000000 /* Has authenticator */
-#define NFSMNT_WANTAUTH 0x40000000 /* Wants an authenticator */
-#define NFSMNT_AUTHERR 0x80000000 /* Authentication error */
-#endif /* NFS */
-
-#ifdef KERNEL
-extern int (*mountroot) __P((void *));
-extern struct vfsops *mountrootvfsops;
-
-/*
- * exported vnode operations
- */
-int dounmount __P((struct mount *, int, struct proc *));
-struct mount *getvfs __P((fsid_t *)); /* return vfs given fsid */
-void getnewfsid __P((struct mount *, int));
-int vflush __P((struct mount *, struct vnode *, int));
-int vfs_export /* process mount export info */
- __P((struct mount *, struct netexport *, struct export_args *));
-struct netcred *vfs_export_lookup /* lookup host in fs export list */
- __P((struct mount *, struct netexport *, struct mbuf *));
-int vfs_lock __P((struct mount *)); /* lock a vfs */
-int vfs_mountedon __P((struct vnode *)); /* is a vfs mounted on vp */
-int vfs_mountroot __P((void *)); /* XXX goes away? */
-void vfs_msync __P((struct mount *, int));
-void vfs_unlock __P((struct mount *)); /* unlock a vfs */
-void vfs_unmountall __P((void));
-int vfs_busy __P((struct mount *)); /* mark a vfs busy */
-void vfs_unbusy __P((struct mount *)); /* mark a vfs not busy */
-extern CIRCLEQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */
-extern struct vfsops *vfssw[]; /* filesystem type table */
-
-#else /* KERNEL */
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int fstatfs __P((int, struct statfs *));
-int getfh __P((const char *, fhandle_t *));
-int getfsstat __P((struct statfs *, long, int));
-int getmntinfo __P((struct statfs **, int));
-int mount __P((int, const char *, int, void *));
-int statfs __P((const char *, struct statfs *));
-int unmount __P((const char *, int));
-
-/* C library stuff */
-struct vfsconf *getvfsbyname __P((const char *));
-struct vfsconf *getvfsbytype __P((int));
-struct vfsconf *getvfsent __P((void));
-void setvfsent __P((int));
-void endvfsent __P((void));
-int vfsisloadable __P((const char *));
-int vfsload __P((const char *));
-__END_DECLS
-
-#endif /* KERNEL */
-
-#endif /* !_SYS_MOUNT_H_ */
diff --git a/c/src/lib/libnetworking/sys/param.h b/c/src/lib/libnetworking/sys/param.h
deleted file mode 100644
index 21a9758520..0000000000
--- a/c/src/lib/libnetworking/sys/param.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)param.h 8.3 (Berkeley) 4/4/95
- * $Id$
- */
-
-#ifndef _SYS_PARAM_H_
-#define _SYS_PARAM_H_
-
-#include <unistd.h>
-
-#define BSD 199506 /* System version (year & month). */
-#define BSD4_3 1
-#define BSD4_4 1
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef LOCORE
-#include <sys/types.h>
-#endif
-
-/*
- * Machine-independent constants (some used in following include files).
- * Redefined constants are from POSIX 1003.1 limits file.
- *
- * MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>)
- * MAXLOGNAME should be >= UT_NAMESIZE (see <utmp.h>)
- */
-#include <sys/syslimits.h>
-
-#define MAXCOMLEN 16 /* max command name remembered */
-#define MAXINTERP 32 /* max interpreter file name length */
-#define MAXLOGNAME 12 /* max login name length */
-#define MAXUPRC CHILD_MAX /* max simultaneous processes */
-#define NCARGS ARG_MAX /* max bytes for an exec function */
-#define NGROUPS NGROUPS_MAX /* max number groups */
-#define NOFILE OPEN_MAX /* max open files per process */
-#define NOGROUP 65535 /* marker for empty group set member */
-#define MAXHOSTNAMELEN 256 /* max hostname size */
-
-/* More types and definitions used throughout the kernel. */
-#ifdef KERNEL
-#include <sys/cdefs.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/ucred.h>
-#include <sys/uio.h>
-#include <sys/rtprio.h>
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-#endif
-
-/* Signals. */
-#include <sys/signal.h>
-
-/* Machine type dependent parameters. */
-#include <machine/param.h>
-#include <machine/limits.h>
-
-/*
- * Priorities. Note that with 32 run queues, differences less than 4 are
- * insignificant.
- */
-#define PSWP 0
-#define PVM 4
-#define PINOD 8
-#define PRIBIO 16
-#define PVFS 20
-#define PZERO 22 /* No longer magic, shouldn't be here. XXX */
-#define PSOCK 24
-#define PWAIT 32
-#define PLOCK 36
-#define PPAUSE 40
-#define PUSER 50
-#define MAXPRI 127 /* Priorities range from 0 through MAXPRI. */
-
-#define PRIMASK 0x0ff
-#define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */
-
-#define NZERO 0 /* default "nice" */
-
-#define NBPW sizeof(int) /* number of bytes per word (integer) */
-
-#define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */
-#define NODEV (dev_t)(-1) /* non-existent device */
-
-/*
- * Clustering of hardware pages on machines with ridiculously small
- * page sizes is done here. The paging subsystem deals with units of
- * CLSIZE pte's describing PAGE_SIZE (from machine/machparam.h) pages each.
- */
-#if 0
-#define CLBYTES (CLSIZE*PAGE_SIZE)
-#endif
-
-#define CBLOCK 128 /* Clist block size, must be a power of 2. */
-#define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */
- /* Data chars/clist. */
-#define CBSIZE (CBLOCK - sizeof(struct cblock *) - CBQSIZE)
-#define CROUND (CBLOCK - 1) /* Clist rounding. */
-
-/*
- * File system parameters and macros.
- *
- * The file system is made out of blocks of at most MAXBSIZE units, with
- * smaller units (fragments) only in the last direct block. MAXBSIZE
- * primarily determines the size of buffers in the buffer pool. It may be
- * made larger without any effect on existing file systems; however making
- * it smaller make make some file systems unmountable. Also, MAXBSIZE
- * must be less than MAXPHYS!!! DFLTBSIZE is the average amount of
- * memory allocated by vfs_bio per nbuf. BKVASIZE is the average amount
- * of kernel virtual space allocated per nbuf. BKVASIZE should be >=
- * DFLTBSIZE. If it is significantly bigger than DFLTBSIZE, then
- * kva fragmentation causes fewer performance problems.
- */
-#define MAXBSIZE 65536
-#define BKVASIZE 8192
-#define DFLTBSIZE 4096
-#define MAXFRAG 8
-
-/*
- * MAXPATHLEN defines the longest permissible path length after expanding
- * symbolic links. It is used to allocate a temporary buffer from the buffer
- * pool in which to do the name expansion, hence should be a power of two,
- * and must be less than or equal to MAXBSIZE. MAXSYMLINKS defines the
- * maximum number of symbolic links that may be expanded in a path name.
- * It should be set high enough to allow all legitimate uses, but halt
- * infinite loops reasonably quickly.
- */
-#if !defined(__rtems__)
-#define MAXPATHLEN PATH_MAX
-#endif
-#define MAXSYMLINKS 32
-
-/* Bit map related macros. */
-#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
-#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
-#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
-#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
-
-/* Macros for counting and rounding. */
-#ifndef howmany
-#define howmany(x, y) (((x)+((y)-1))/(y))
-#endif
-#define rounddown(x, y) (((x)/(y))*(y))
-#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */
-#define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */
-#define powerof2(x) ((((x)-1)&(x))==0)
-
-/* Macros for min/max. */
-#ifndef KERNEL
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#endif
-
-/*
- * Constants for setting the parameters of the kernel memory allocator.
- *
- * 2 ** MINBUCKET is the smallest unit of memory that will be
- * allocated. It must be at least large enough to hold a pointer.
- *
- * Units of memory less or equal to MAXALLOCSAVE will permanently
- * allocate physical memory; requests for these size pieces of
- * memory are quite fast. Allocations greater than MAXALLOCSAVE must
- * always allocate and free physical memory; requests for these
- * size allocations should be done infrequently as they will be slow.
- *
- * Constraints: PAGE_SIZE <= MAXALLOCSAVE <= 2 ** (MINBUCKET + 14), and
- * MAXALLOCSIZE must be a power of two.
- */
-#define MINBUCKET 4 /* 4 => min allocation of 16 bytes */
-#define MAXALLOCSAVE (2 * PAGE_SIZE)
-
-/*
- * Scale factor for scaled integers used to count %cpu time and load avgs.
- *
- * The number of CPU `tick's that map to a unique `%age' can be expressed
- * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that
- * can be calculated (assuming 32 bits) can be closely approximated using
- * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15).
- *
- * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age',
- * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024.
- */
-#define FSHIFT 11 /* bits to right of fixed binary point */
-#define FSCALE (1<<FSHIFT)
-
-#endif /* _SYS_PARAM_H_ */
diff --git a/c/src/lib/libnetworking/sys/proc.h b/c/src/lib/libnetworking/sys/proc.h
deleted file mode 100644
index 2189a33b11..0000000000
--- a/c/src/lib/libnetworking/sys/proc.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Dummy structure
- *
- * $Id$
- */
-struct proc {
- int this_should_never_be_referenced;
-};
diff --git a/c/src/lib/libnetworking/sys/protosw.h b/c/src/lib/libnetworking/sys/protosw.h
deleted file mode 100644
index a7aa52feea..0000000000
--- a/c/src/lib/libnetworking/sys/protosw.h
+++ /dev/null
@@ -1,300 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)protosw.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_PROTOSW_H_
-#define _SYS_PROTOSW_H_
-
-struct ifnet;
-struct mbuf;
-struct sockaddr;
-struct socket;
-struct sockproto;
-struct stat;
-
-/*
- * Protocol switch table.
- *
- * Each protocol has a handle initializing one of these structures,
- * which is used for protocol-protocol and system-protocol communication.
- *
- * A protocol is called through the pr_init entry before any other.
- * Thereafter it is called every 200ms through the pr_fasttimo entry and
- * every 500ms through the pr_slowtimo for timer based actions.
- * The system will call the pr_drain entry if it is low on space and
- * this should throw away any non-critical data.
- *
- * Protocols pass data between themselves as chains of mbufs using
- * the pr_input and pr_output hooks. Pr_input passes data up (towards
- * UNIX) and pr_output passes it down (towards the imps); control
- * information passes up and down on pr_ctlinput and pr_ctloutput.
- * The protocol is responsible for the space occupied by any the
- * arguments to these entries and must dispose it.
- *
- * The userreq routine interfaces protocols to the system and is
- * described below.
- */
-struct protosw {
- short pr_type; /* socket type used for */
- struct domain *pr_domain; /* domain protocol a member of */
- short pr_protocol; /* protocol number */
- short pr_flags; /* see below */
-/* protocol-protocol hooks */
- void (*pr_input) __P((struct mbuf *, int len));
- /* input to protocol (from below) */
- int (*pr_output) __P((struct mbuf *m, struct socket *so));
- /* output to protocol (from above) */
- void (*pr_ctlinput)__P((int, struct sockaddr *, void *));
- /* control input (from below) */
- int (*pr_ctloutput)__P((int, struct socket *, int, int,
- struct mbuf **));
- /* control output (from above) */
-/* user-protocol hook */
- int (*pr_ousrreq) __P((struct socket *, int, struct mbuf *,
- struct mbuf *, struct mbuf *));
- /* user request: see list below */
-/* utility hooks */
- void (*pr_init) __P((void)); /* initialization hook */
- void (*pr_fasttimo) __P((void));
- /* fast timeout (200ms) */
- void (*pr_slowtimo) __P((void));
- /* slow timeout (500ms) */
- void (*pr_drain) __P((void));
- /* flush any excess space possible */
- struct pr_usrreqs *pr_usrreqs; /* supersedes pr_usrreq() */
-};
-
-#define PR_SLOWHZ 2 /* 2 slow timeouts per second */
-#define PR_FASTHZ 5 /* 5 fast timeouts per second */
-
-/*
- * Values for pr_flags.
- * PR_ADDR requires PR_ATOMIC;
- * PR_ADDR and PR_CONNREQUIRED are mutually exclusive.
- * PR_IMPLOPCL means that the protocol allows sendto without prior connect,
- * and the protocol understands the MSG_EOF flag. The first property is
- * is only relevant if PR_CONNREQUIRED is set (otherwise sendto is allowed
- * anyhow).
- */
-#define PR_ATOMIC 0x01 /* exchange atomic messages only */
-#define PR_ADDR 0x02 /* addresses given with messages */
-#define PR_CONNREQUIRED 0x04 /* connection required by protocol */
-#define PR_WANTRCVD 0x08 /* want PRU_RCVD calls */
-#define PR_RIGHTS 0x10 /* passes capabilities */
-#define PR_IMPLOPCL 0x20 /* implied open/close */
-
-/*
- * The arguments to usrreq are:
- * (*protosw[].pr_usrreq)(up, req, m, nam, opt);
- * where up is a (struct socket *), req is one of these requests,
- * m is a optional mbuf chain containing a message,
- * nam is an optional mbuf chain containing an address,
- * and opt is a pointer to a socketopt structure or nil.
- * The protocol is responsible for disposal of the mbuf chain m,
- * the caller is responsible for any space held by nam and opt.
- * A non-zero return from usrreq gives an
- * UNIX error number which should be passed to higher level software.
- */
-#define PRU_ATTACH 0 /* attach protocol to up */
-#define PRU_DETACH 1 /* detach protocol from up */
-#define PRU_BIND 2 /* bind socket to address */
-#define PRU_LISTEN 3 /* listen for connection */
-#define PRU_CONNECT 4 /* establish connection to peer */
-#define PRU_ACCEPT 5 /* accept connection from peer */
-#define PRU_DISCONNECT 6 /* disconnect from peer */
-#define PRU_SHUTDOWN 7 /* won't send any more data */
-#define PRU_RCVD 8 /* have taken data; more room now */
-#define PRU_SEND 9 /* send this data */
-#define PRU_ABORT 10 /* abort (fast DISCONNECT, DETATCH) */
-#define PRU_CONTROL 11 /* control operations on protocol */
-#define PRU_SENSE 12 /* return status into m */
-#define PRU_RCVOOB 13 /* retrieve out of band data */
-#define PRU_SENDOOB 14 /* send out of band data */
-#define PRU_SOCKADDR 15 /* fetch socket's address */
-#define PRU_PEERADDR 16 /* fetch peer's address */
-#define PRU_CONNECT2 17 /* connect two sockets */
-/* begin for protocols internal use */
-#define PRU_FASTTIMO 18 /* 200ms timeout */
-#define PRU_SLOWTIMO 19 /* 500ms timeout */
-#define PRU_PROTORCV 20 /* receive from below */
-#define PRU_PROTOSEND 21 /* send to below */
-/* end for protocol's internal use */
-#define PRU_SEND_EOF 22 /* send and close */
-#define PRU_NREQ 22
-
-#ifdef PRUREQUESTS
-char *prurequests[] = {
- "ATTACH", "DETACH", "BIND", "LISTEN",
- "CONNECT", "ACCEPT", "DISCONNECT", "SHUTDOWN",
- "RCVD", "SEND", "ABORT", "CONTROL",
- "SENSE", "RCVOOB", "SENDOOB", "SOCKADDR",
- "PEERADDR", "CONNECT2", "FASTTIMO", "SLOWTIMO",
- "PROTORCV", "PROTOSEND",
- "SEND_EOF",
-};
-#endif
-
-#ifdef KERNEL /* users shouldn't see this decl */
-struct stat;
-struct ifnet;
-
-/*
- * If the ordering here looks odd, that's because it's alphabetical.
- */
-struct pr_usrreqs {
- int (*pru_abort) __P((struct socket *so));
- int (*pru_accept) __P((struct socket *so, struct mbuf *nam));
- int (*pru_attach) __P((struct socket *so, int proto));
- int (*pru_bind) __P((struct socket *so, struct mbuf *nam));
- int (*pru_connect) __P((struct socket *so, struct mbuf *nam));
- int (*pru_connect2) __P((struct socket *so1, struct socket *so2));
- int (*pru_control) __P((struct socket *so, int cmd, caddr_t data,
- struct ifnet *ifp));
- int (*pru_detach) __P((struct socket *so));
- int (*pru_disconnect) __P((struct socket *so));
- int (*pru_listen) __P((struct socket *so));
- int (*pru_peeraddr) __P((struct socket *so, struct mbuf *nam));
- int (*pru_rcvd) __P((struct socket *so, int flags));
- int (*pru_rcvoob) __P((struct socket *so, struct mbuf *m,
- int flags));
- /*
- * The `m' parameter here is almost certainly going to become a
- * `struct uio' at some point in the future. Similar changes
- * will probably happen for the receive entry points.
- */
- int (*pru_send) __P((struct socket *so, int flags, struct mbuf *m,
- struct mbuf *addr, struct mbuf *control));
-#define PRUS_OOB 0x1
-#define PRUS_EOF 0x2
- int (*pru_sense) __P((struct socket *so, struct stat *sb));
- int (*pru_shutdown) __P((struct socket *so));
- int (*pru_sockaddr) __P((struct socket *so, struct mbuf *nam));
-};
-
-int pru_accept_notsupp __P((struct socket *so, struct mbuf *nam));
-int pru_connect2_notsupp __P((struct socket *so1, struct socket *so2));
-int pru_control_notsupp __P((struct socket *so, int cmd, caddr_t data,
- struct ifnet *ifp));
-int pru_listen_notsupp __P((struct socket *so));
-int pru_rcvd_notsupp __P((struct socket *so, int flags));
-int pru_rcvoob_notsupp __P((struct socket *so, struct mbuf *m, int flags));
-int pru_sense_null __P((struct socket *so, struct stat *sb));
-
-#define PRU_OLDSTYLE
-
-#ifdef PRU_OLDSTYLE
-/*
- * Protocols which don't yet implement pr_usrreqs can point it to this
- * structure, which will call the old pr_usrreq() entry point with the
- * appropriate arguments.
- */
-extern struct pr_usrreqs pru_oldstyle;
-#endif /* PRU_OLDSTYLE */
-
-#endif /* KERNEL */
-
-/*
- * The arguments to the ctlinput routine are
- * (*protosw[].pr_ctlinput)(cmd, sa, arg);
- * where cmd is one of the commands below, sa is a pointer to a sockaddr,
- * and arg is a `void *' argument used within a protocol family.
- */
-#define PRC_IFDOWN 0 /* interface transition */
-#define PRC_ROUTEDEAD 1 /* select new route if possible ??? */
-#define PRC_QUENCH2 3 /* DEC congestion bit says slow down */
-#define PRC_QUENCH 4 /* some one said to slow down */
-#define PRC_MSGSIZE 5 /* message size forced drop */
-#define PRC_HOSTDEAD 6 /* host appears to be down */
-#define PRC_HOSTUNREACH 7 /* deprecated (use PRC_UNREACH_HOST) */
-#define PRC_UNREACH_NET 8 /* no route to network */
-#define PRC_UNREACH_HOST 9 /* no route to host */
-#define PRC_UNREACH_PROTOCOL 10 /* dst says bad protocol */
-#define PRC_UNREACH_PORT 11 /* bad port # */
-/* was PRC_UNREACH_NEEDFRAG 12 (use PRC_MSGSIZE) */
-#define PRC_UNREACH_SRCFAIL 13 /* source route failed */
-#define PRC_REDIRECT_NET 14 /* net routing redirect */
-#define PRC_REDIRECT_HOST 15 /* host routing redirect */
-#define PRC_REDIRECT_TOSNET 16 /* redirect for type of service & net */
-#define PRC_REDIRECT_TOSHOST 17 /* redirect for tos & host */
-#define PRC_TIMXCEED_INTRANS 18 /* packet lifetime expired in transit */
-#define PRC_TIMXCEED_REASS 19 /* lifetime expired on reass q */
-#define PRC_PARAMPROB 20 /* header incorrect */
-
-#define PRC_NCMDS 21
-
-#define PRC_IS_REDIRECT(cmd) \
- ((cmd) >= PRC_REDIRECT_NET && (cmd) <= PRC_REDIRECT_TOSHOST)
-
-#ifdef PRCREQUESTS
-char *prcrequests[] = {
- "IFDOWN", "ROUTEDEAD", "#2", "DEC-BIT-QUENCH2",
- "QUENCH", "MSGSIZE", "HOSTDEAD", "#7",
- "NET-UNREACH", "HOST-UNREACH", "PROTO-UNREACH", "PORT-UNREACH",
- "#12", "SRCFAIL-UNREACH", "NET-REDIRECT", "HOST-REDIRECT",
- "TOSNET-REDIRECT", "TOSHOST-REDIRECT", "TX-INTRANS", "TX-REASS",
- "PARAMPROB"
-};
-#endif
-
-/*
- * The arguments to ctloutput are:
- * (*protosw[].pr_ctloutput)(req, so, level, optname, optval);
- * req is one of the actions listed below, so is a (struct socket *),
- * level is an indication of which protocol layer the option is intended.
- * optname is a protocol dependent socket option request,
- * optval is a pointer to a mbuf-chain pointer, for value-return results.
- * The protocol is responsible for disposal of the mbuf chain *optval
- * if supplied,
- * the caller is responsible for any space held by *optval, when returned.
- * A non-zero return from usrreq gives an
- * UNIX error number which should be passed to higher level software.
- */
-#define PRCO_GETOPT 0
-#define PRCO_SETOPT 1
-
-#define PRCO_NCMDS 2
-
-#ifdef PRCOREQUESTS
-char *prcorequests[] = {
- "GETOPT", "SETOPT",
-};
-#endif
-
-#ifdef KERNEL
-struct protosw *pffindproto __P((int family, int protocol, int type));
-struct protosw *pffindtype __P((int family, int type));
-#endif
-
-#endif
diff --git a/c/src/lib/libnetworking/sys/queue.h b/c/src/lib/libnetworking/sys/queue.h
deleted file mode 100644
index e8aa08cf5d..0000000000
--- a/c/src/lib/libnetworking/sys/queue.h
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * Copyright (c) 1991, 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.
- *
- * @(#)queue.h 8.5 (Berkeley) 8/20/94
- * $Id$
- */
-
-#ifndef _SYS_QUEUE_H_
-#define _SYS_QUEUE_H_
-
-/*
- * This file defines five types of data structures: singly-linked lists,
- * slingly-linked tail queues, lists, tail queues, and circular queues.
- *
- * A singly-linked list is headed by a single forward pointer. The elements
- * are singly linked for minimum space and pointer manipulation overhead at
- * the expense of O(n) removal for arbitrary elements. New elements can be
- * added to the list after an existing element or at the head of the list.
- * Elements being removed from the head of the list should use the explicit
- * macro for this purpose for optimum efficiency. A singly-linked list may
- * only be traversed in the forward direction. Singly-linked lists are ideal
- * for applications with large datasets and few or no removals or for
- * implementing a LIFO queue.
- *
- * A singly-linked tail queue is headed by a pair of pointers, one to the
- * head of the list and the other to the tail of the list. The elements are
- * singly linked for minimum space and pointer manipulation overhead at the
- * expense of O(n) removal for arbitrary elements. New elements can be added
- * to the list after an existing element, at the head of the list, or at the
- * end of the list. Elements being removed from the head of the tail queue
- * should use the explicit macro for this purpose for optimum efficiency.
- * A singly-linked tail queue may only be traversed in the forward direction.
- * Singly-linked tail queues are ideal for applications with large datasets
- * and few or no removals or for implementing a FIFO queue.
- *
- * A list is headed by a single forward pointer (or an array of forward
- * pointers for a hash table header). The elements are doubly linked
- * so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before
- * or after an existing element or at the head of the list. A list
- * may only be traversed in the forward direction.
- *
- * A tail queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or
- * after an existing element, at the head of the list, or at the end of
- * the list. A tail queue may only be traversed in the forward direction.
- *
- * A circle queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or after
- * an existing element, at the head of the list, or at the end of the list.
- * A circle queue may be traversed in either direction, but has a more
- * complex end of list detection.
- *
- * For details on the use of these macros, see the queue(3) manual page.
- */
-
-/*
- * Singly-linked List definitions.
- */
-#define SLIST_HEAD(name, type) \
-struct name { \
- struct type *slh_first; /* first element */ \
-}
-
-#define SLIST_ENTRY(type) \
-struct { \
- struct type *sle_next; /* next element */ \
-}
-
-/*
- * Singly-linked List functions.
- */
-#define SLIST_INIT(head) { \
- (head)->slh_first = NULL; \
-}
-
-#define SLIST_INSERT_AFTER(slistelm, elm, field) { \
- (elm)->field.sle_next = (slistelm)->field.sle_next; \
- (slistelm)->field.sle_next = (elm); \
-}
-
-#define SLIST_INSERT_HEAD(head, elm, field) { \
- (elm)->field.sle_next = (head)->slh_first; \
- (head)->slh_first = (elm); \
-}
-
-#define SLIST_REMOVE_HEAD(head, field) { \
- (head)->slh_first = (head)->slh_first->field.sle_next; \
-}
-
-#define SLIST_REMOVE(head, elm, type, field) { \
- if ((head)->slh_first == (elm)) { \
- SLIST_REMOVE_HEAD((head), field); \
- } \
- else { \
- struct type *curelm = (head)->slh_first; \
- while( curelm->field.sle_next != (elm) ) \
- curelm = curelm->field.sle_next; \
- curelm->field.sle_next = \
- curelm->field.sle_next->field.sle_next; \
- } \
-}
-
-/*
- * Singly-linked Tail queue definitions.
- */
-#define STAILQ_HEAD(name, type) \
-struct name { \
- struct type *stqh_first;/* first element */ \
- struct type **stqh_last;/* addr of last next element */ \
-}
-
-#define STAILQ_ENTRY(type) \
-struct { \
- struct type *stqe_next; /* next element */ \
-}
-
-/*
- * Singly-linked Tail queue functions.
- */
-#define STAILQ_INIT(head) { \
- (head)->stqh_first = NULL; \
- (head)->stqh_last = &(head)->stqh_first; \
-}
-
-#define STAILQ_INSERT_HEAD(head, elm, field) { \
- if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
- (head)->stqh_last = &(elm)->field.stqe_next; \
- (head)->stqh_first = (elm); \
-}
-
-#define STAILQ_INSERT_TAIL(head, elm, field) { \
- (elm)->field.stqe_next = NULL; \
- *(head)->stqh_last = (elm); \
- (head)->stqh_last = &(elm)->field.stqe_next; \
-}
-
-#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) { \
- if (((elm)->field.stqe_next = (tqelm)->field.stqe_next) == NULL)\
- (head)->stqh_last = &(elm)->field.stqe_next; \
- (tqelm)->field.stqe_next = (elm); \
-}
-
-#define STAILQ_REMOVE_HEAD(head, field) { \
- if (((head)->stqh_first = \
- (head)->stqh_first->field.stqe_next) == NULL) \
- (head)->stqh_last = &(head)->stqh_first; \
-}
-
-#define STAILQ_REMOVE(head, elm, type, field) { \
- if ((head)->stqh_first == (elm)) { \
- STAILQ_REMOVE_HEAD(head, field); \
- } \
- else { \
- struct type *curelm = (head)->stqh_first; \
- while( curelm->field.stqe_next != (elm) ) \
- curelm = curelm->field.stqe_next; \
- if((curelm->field.stqe_next = \
- curelm->field.stqe_next->field.stqe_next) == NULL) \
- (head)->stqh_last = &(curelm)->field.stqe_next; \
- } \
-}
-
-/*
- * List definitions.
- */
-#define LIST_HEAD(name, type) \
-struct name { \
- struct type *lh_first; /* first element */ \
-}
-
-#define LIST_ENTRY(type) \
-struct { \
- struct type *le_next; /* next element */ \
- struct type **le_prev; /* address of previous next element */ \
-}
-
-/*
- * List functions.
- */
-#define LIST_INIT(head) { \
- (head)->lh_first = NULL; \
-}
-
-#define LIST_INSERT_AFTER(listelm, elm, field) { \
- if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
- (listelm)->field.le_next->field.le_prev = \
- &(elm)->field.le_next; \
- (listelm)->field.le_next = (elm); \
- (elm)->field.le_prev = &(listelm)->field.le_next; \
-}
-
-#define LIST_INSERT_BEFORE(listelm, elm, field) { \
- (elm)->field.le_prev = (listelm)->field.le_prev; \
- (elm)->field.le_next = (listelm); \
- *(listelm)->field.le_prev = (elm); \
- (listelm)->field.le_prev = &(elm)->field.le_next; \
-}
-
-#define LIST_INSERT_HEAD(head, elm, field) { \
- if (((elm)->field.le_next = (head)->lh_first) != NULL) \
- (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
- (head)->lh_first = (elm); \
- (elm)->field.le_prev = &(head)->lh_first; \
-}
-
-#define LIST_REMOVE(elm, field) { \
- if ((elm)->field.le_next != NULL) \
- (elm)->field.le_next->field.le_prev = \
- (elm)->field.le_prev; \
- *(elm)->field.le_prev = (elm)->field.le_next; \
-}
-
-/*
- * Tail queue definitions.
- */
-#define TAILQ_HEAD(name, type) \
-struct name { \
- struct type *tqh_first; /* first element */ \
- struct type **tqh_last; /* addr of last next element */ \
-}
-
-#define TAILQ_HEAD_INITIALIZER(head) \
- { NULL, &(head).tqh_first }
-
-#define TAILQ_ENTRY(type) \
-struct { \
- struct type *tqe_next; /* next element */ \
- struct type **tqe_prev; /* address of previous next element */ \
-}
-
-/*
- * Tail queue functions.
- */
-#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
-
-#define TAILQ_FIRST(head) ((head)->tqh_first)
-
-#define TAILQ_LAST(head) ((head)->tqh_last)
-
-#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
-
-#define TAILQ_PREV(elm, field) ((elm)->field.tqe_prev)
-
-#define TAILQ_INIT(head) { \
- (head)->tqh_first = NULL; \
- (head)->tqh_last = &(head)->tqh_first; \
-}
-
-#define TAILQ_INSERT_HEAD(head, elm, field) { \
- if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
- (head)->tqh_first->field.tqe_prev = \
- &(elm)->field.tqe_next; \
- else \
- (head)->tqh_last = &(elm)->field.tqe_next; \
- (head)->tqh_first = (elm); \
- (elm)->field.tqe_prev = &(head)->tqh_first; \
-}
-
-#define TAILQ_INSERT_TAIL(head, elm, field) { \
- (elm)->field.tqe_next = NULL; \
- (elm)->field.tqe_prev = (head)->tqh_last; \
- *(head)->tqh_last = (elm); \
- (head)->tqh_last = &(elm)->field.tqe_next; \
-}
-
-#define TAILQ_INSERT_AFTER(head, listelm, elm, field) { \
- if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
- (elm)->field.tqe_next->field.tqe_prev = \
- &(elm)->field.tqe_next; \
- else \
- (head)->tqh_last = &(elm)->field.tqe_next; \
- (listelm)->field.tqe_next = (elm); \
- (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
-}
-
-#define TAILQ_INSERT_BEFORE(listelm, elm, field) { \
- (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
- (elm)->field.tqe_next = (listelm); \
- *(listelm)->field.tqe_prev = (elm); \
- (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
-}
-
-#define TAILQ_REMOVE(head, elm, field) { \
- if (((elm)->field.tqe_next) != NULL) \
- (elm)->field.tqe_next->field.tqe_prev = \
- (elm)->field.tqe_prev; \
- else \
- (head)->tqh_last = (elm)->field.tqe_prev; \
- *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
-}
-
-/*
- * Circular queue definitions.
- */
-#define CIRCLEQ_HEAD(name, type) \
-struct name { \
- struct type *cqh_first; /* first element */ \
- struct type *cqh_last; /* last element */ \
-}
-
-#define CIRCLEQ_ENTRY(type) \
-struct { \
- struct type *cqe_next; /* next element */ \
- struct type *cqe_prev; /* previous element */ \
-}
-
-/*
- * Circular queue functions.
- */
-#define CIRCLEQ_INIT(head) { \
- (head)->cqh_first = (void *)(head); \
- (head)->cqh_last = (void *)(head); \
-}
-
-#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) { \
- (elm)->field.cqe_next = (listelm)->field.cqe_next; \
- (elm)->field.cqe_prev = (listelm); \
- if ((listelm)->field.cqe_next == (void *)(head)) \
- (head)->cqh_last = (elm); \
- else \
- (listelm)->field.cqe_next->field.cqe_prev = (elm); \
- (listelm)->field.cqe_next = (elm); \
-}
-
-#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) { \
- (elm)->field.cqe_next = (listelm); \
- (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
- if ((listelm)->field.cqe_prev == (void *)(head)) \
- (head)->cqh_first = (elm); \
- else \
- (listelm)->field.cqe_prev->field.cqe_next = (elm); \
- (listelm)->field.cqe_prev = (elm); \
-}
-
-#define CIRCLEQ_INSERT_HEAD(head, elm, field) { \
- (elm)->field.cqe_next = (head)->cqh_first; \
- (elm)->field.cqe_prev = (void *)(head); \
- if ((head)->cqh_last == (void *)(head)) \
- (head)->cqh_last = (elm); \
- else \
- (head)->cqh_first->field.cqe_prev = (elm); \
- (head)->cqh_first = (elm); \
-}
-
-#define CIRCLEQ_INSERT_TAIL(head, elm, field) { \
- (elm)->field.cqe_next = (void *)(head); \
- (elm)->field.cqe_prev = (head)->cqh_last; \
- if ((head)->cqh_first == (void *)(head)) \
- (head)->cqh_first = (elm); \
- else \
- (head)->cqh_last->field.cqe_next = (elm); \
- (head)->cqh_last = (elm); \
-}
-
-#define CIRCLEQ_REMOVE(head, elm, field) { \
- if ((elm)->field.cqe_next == (void *)(head)) \
- (head)->cqh_last = (elm)->field.cqe_prev; \
- else \
- (elm)->field.cqe_next->field.cqe_prev = \
- (elm)->field.cqe_prev; \
- if ((elm)->field.cqe_prev == (void *)(head)) \
- (head)->cqh_first = (elm)->field.cqe_next; \
- else \
- (elm)->field.cqe_prev->field.cqe_next = \
- (elm)->field.cqe_next; \
-}
-
-#ifdef KERNEL
-
-/*
- * XXX insque() and remque() are an old way of handling certain queues.
- * They bogusly assumes that all queue heads look alike.
- */
-
-struct quehead {
- struct quehead *qh_link;
- struct quehead *qh_rlink;
-};
-
-#ifdef __GNUC__
-
-static __inline void
-insque(void *a, void *b)
-{
- struct quehead *element = a, *head = b;
-
- element->qh_link = head->qh_link;
- element->qh_rlink = head;
- head->qh_link = element;
- element->qh_link->qh_rlink = element;
-}
-
-static __inline void
-remque(void *a)
-{
- struct quehead *element = a;
-
- element->qh_link->qh_rlink = element->qh_rlink;
- element->qh_rlink->qh_link = element->qh_link;
- element->qh_rlink = 0;
-}
-
-#else /* !__GNUC__ */
-
-void insque __P((void *a, void *b));
-void remque __P((void *a));
-
-#endif /* __GNUC__ */
-
-#endif /* KERNEL */
-
-#endif /* !_SYS_QUEUE_H_ */
diff --git a/c/src/lib/libnetworking/sys/reboot.h b/c/src/lib/libnetworking/sys/reboot.h
deleted file mode 100644
index 48a7f0f782..0000000000
--- a/c/src/lib/libnetworking/sys/reboot.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1993, 1994
- * 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.
- *
- * @(#)reboot.h 8.3 (Berkeley) 12/13/94
- * $Id$
- */
-
-#ifndef _SYS_REBOOT_H_
-#define _SYS_REBOOT_H_
-
-/*
- * Arguments to reboot system call. These are passed to
- * the boot program and on to init.
- */
-#define RB_AUTOBOOT 0 /* flags for system auto-booting itself */
-
-#define RB_ASKNAME 0x001 /* ask for file name to reboot from */
-#define RB_SINGLE 0x002 /* reboot to single user only */
-#define RB_NOSYNC 0x004 /* dont sync before reboot */
-#define RB_HALT 0x008 /* don't reboot, just halt */
-#define RB_INITNAME 0x010 /* name given for /etc/init (unused) */
-#define RB_DFLTROOT 0x020 /* use compiled-in rootdev */
-#define RB_KDB 0x040 /* give control to kernel debugger */
-#define RB_RDONLY 0x080 /* mount root fs read-only */
-#define RB_DUMP 0x100 /* dump kernel memory before reboot */
-#define RB_MINIROOT 0x200 /* mini-root present in memory at boot time */
-#define RB_CONFIG 0x400 /* invoke user configuration routing */
-#define RB_VERBOSE 0x800 /* print all potentially useful info */
-#define RB_SERIAL 0x1000 /* user serial port as console */
-#define RB_CDROM 0x2000 /* use cdrom as root */
-#define RB_POWEROFF 0x4000 /* if you can, turn the power off */
-#define RB_GDB 0x8000 /* use GDB remote debugger instead of DDB */
-#define RB_MUTE 0x10000 /* Come up with the console muted */
-#define RB_SELFTEST 0x20000 /* don't boot to normal operation, do selftest */
-
-#define RB_BOOTINFO 0x80000000 /* have `struct bootinfo *' arg */
-
-/*
- * Constants for converting boot-style device number to type,
- * adaptor (uba, mba, etc), unit number and partition number.
- * Type (== major device number) is in the low byte
- * for backward compatibility. Except for that of the "magic
- * number", each mask applies to the shifted value.
- * Format:
- * (4) (4) (4) (4) (8) (8)
- * --------------------------------
- * |MA | AD| CT| UN| PART | TYPE |
- * --------------------------------
- */
-#define B_ADAPTORSHIFT 24
-#define B_ADAPTORMASK 0x0f
-#define B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
-#define B_CONTROLLERSHIFT 20
-#define B_CONTROLLERMASK 0xf
-#define B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
-#define B_SLICESHIFT 20
-#define B_SLICEMASK 0xff
-#define B_SLICE(val) (((val)>>B_SLICESHIFT) & B_SLICEMASK)
-#define B_UNITSHIFT 16
-#define B_UNITMASK 0xf
-#define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK)
-#define B_PARTITIONSHIFT 8
-#define B_PARTITIONMASK 0xff
-#define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
-#define B_TYPESHIFT 0
-#define B_TYPEMASK 0xff
-#define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK)
-
-#define B_MAGICMASK 0xf0000000
-#define B_DEVMAGIC 0xa0000000
-
-#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
- (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
- ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
- ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
-
-#endif
diff --git a/c/src/lib/libnetworking/sys/resourcevar.h b/c/src/lib/libnetworking/sys/resourcevar.h
deleted file mode 100644
index 2b4c47e48f..0000000000
--- a/c/src/lib/libnetworking/sys/resourcevar.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
diff --git a/c/src/lib/libnetworking/sys/rtprio.h b/c/src/lib/libnetworking/sys/rtprio.h
deleted file mode 100644
index dd9521e7c8..0000000000
--- a/c/src/lib/libnetworking/sys/rtprio.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 1994, Henrik Vestergaard Draboel
- * 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 (name).
- * 4. 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 BY THE AUTHOR 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 AUTHOR 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.
- *
- * $Id$
- */
-
-#ifndef _SYS_RTPRIO_H_
-#define _SYS_RTPRIO_H_
-
-/*
- * Process realtime-priority specifications to rtprio.
- */
-
-/* priority types */
-#define RTP_PRIO_REALTIME 0
-#define RTP_PRIO_NORMAL 1
-#define RTP_PRIO_IDLE 2
-
-/* priority range */
-#define RTP_PRIO_MIN 0 /* Highest priority */
-#define RTP_PRIO_MAX 31 /* Lowest priority */
-
-/*
- * rtprio() syscall functions
- */
-#define RTP_LOOKUP 0
-#define RTP_SET 1
-
-#ifndef LOCORE
-struct rtprio {
- u_short type;
- u_short prio;
-};
-#endif
-
-#ifndef KERNEL
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int rtprio __P((int, pid_t, struct rtprio *));
-__END_DECLS
-#endif /* !KERNEL */
-#endif /* !_SYS_RTPRIO_H_ */
diff --git a/c/src/lib/libnetworking/sys/select.h b/c/src/lib/libnetworking/sys/select.h
deleted file mode 100644
index e69971e3b6..0000000000
--- a/c/src/lib/libnetworking/sys/select.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * 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.
- *
- * @(#)select.h 8.2 (Berkeley) 1/4/94
- * $Id$
- */
-
-#ifndef _SYS_SELECT_H_
-#define _SYS_SELECT_H_
-
-/*
- * Used to maintain information about processes that wish to be
- * notified when I/O becomes possible.
- */
-struct selinfo {
- pid_t si_pid; /* process to be notified */
- short si_flags; /* see below */
-};
-#define SI_COLL 0x0001 /* collision occurred */
-
-#ifdef KERNEL
-struct proc;
-
-void selrecord __P((struct proc *selector, struct selinfo *));
-void selwakeup __P((struct selinfo *));
-#endif
-
-#endif /* !_SYS_SELECT_H_ */
diff --git a/c/src/lib/libnetworking/sys/signalvar.h b/c/src/lib/libnetworking/sys/signalvar.h
deleted file mode 100644
index 8900458fdb..0000000000
--- a/c/src/lib/libnetworking/sys/signalvar.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 1991, 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.
- *
- * @(#)signalvar.h 8.6 (Berkeley) 2/19/95
- * $Id$
- */
-
-#ifndef _SYS_SIGNALVAR_H_ /* tmp for user.h */
-#define _SYS_SIGNALVAR_H_
-
-/*
- * Kernel signal definitions and data structures,
- * not exported to user programs.
- */
-
-/*
- * Process signal actions and state, needed only within the process
- * (not necessarily resident).
- */
-struct sigacts {
- sig_t ps_sigact[NSIG]; /* disposition of signals */
- sigset_t ps_catchmask[NSIG]; /* signals to be blocked */
- sigset_t ps_sigonstack; /* signals to take on sigstack */
- sigset_t ps_sigintr; /* signals that interrupt syscalls */
- sigset_t ps_sigreset; /* signals that reset when caught */
- sigset_t ps_signodefer; /* signals not masked while handled */
- sigset_t ps_oldmask; /* saved mask from before sigpause */
- int ps_flags; /* signal flags, below */
- struct sigaltstack ps_sigstk; /* sp & on stack state variable */
- int ps_sig; /* for core dump/debugger XXX */
- u_long ps_code; /* for core dump/debugger XXX */
- sigset_t ps_usertramp; /* SunOS compat; libc sigtramp XXX */
-};
-
-/* signal flags */
-#define SAS_OLDMASK 0x01 /* need to restore mask before pause */
-#define SAS_ALTSTACK 0x02 /* have alternate signal stack */
-
-/* additional signal action values, used only temporarily/internally */
-#define SIG_CATCH ((__sighandler_t *)2)
-#define SIG_HOLD ((__sighandler_t *)3)
-
-/*
- * get signal action for process and signal; currently only for current process
- */
-#define SIGACTION(p, sig) (p->p_sigacts->ps_sigact[(sig)])
-
-/*
- * Determine signal that should be delivered to process p, the current
- * process, 0 if none. If there is a pending stop signal with default
- * action, the process stops in issignal().
- */
-#define CURSIG(p) \
- (((p)->p_siglist == 0 || \
- (((p)->p_flag & P_TRACED) == 0 && \
- ((p)->p_siglist & ~(p)->p_sigmask) == 0)) ? \
- 0 : issignal(p))
-
-/*
- * Clear a pending signal from a process.
- */
-#define CLRSIG(p, sig) { (p)->p_siglist &= ~sigmask(sig); }
-
-/*
- * Signal properties and actions.
- * The array below categorizes the signals and their default actions
- * according to the following properties:
- */
-#define SA_KILL 0x01 /* terminates process by default */
-#define SA_CORE 0x02 /* ditto and coredumps */
-#define SA_STOP 0x04 /* suspend process */
-#define SA_TTYSTOP 0x08 /* ditto, from tty */
-#define SA_IGNORE 0x10 /* ignore by default */
-#define SA_CONT 0x20 /* continue if suspended */
-#define SA_CANTMASK 0x40 /* non-maskable, catchable */
-
-#ifdef SIGPROP
-static int sigprop[NSIG + 1] = {
- 0, /* unused */
- SA_KILL, /* SIGHUP */
- SA_KILL, /* SIGINT */
- SA_KILL|SA_CORE, /* SIGQUIT */
- SA_KILL|SA_CORE, /* SIGILL */
- SA_KILL|SA_CORE, /* SIGTRAP */
- SA_KILL|SA_CORE, /* SIGABRT */
- SA_KILL|SA_CORE, /* SIGEMT */
- SA_KILL|SA_CORE, /* SIGFPE */
- SA_KILL, /* SIGKILL */
- SA_KILL|SA_CORE, /* SIGBUS */
- SA_KILL|SA_CORE, /* SIGSEGV */
- SA_KILL|SA_CORE, /* SIGSYS */
- SA_KILL, /* SIGPIPE */
- SA_KILL, /* SIGALRM */
- SA_KILL, /* SIGTERM */
- SA_IGNORE, /* SIGURG */
- SA_STOP, /* SIGSTOP */
- SA_STOP|SA_TTYSTOP, /* SIGTSTP */
- SA_IGNORE|SA_CONT, /* SIGCONT */
- SA_IGNORE, /* SIGCHLD */
- SA_STOP|SA_TTYSTOP, /* SIGTTIN */
- SA_STOP|SA_TTYSTOP, /* SIGTTOU */
- SA_IGNORE, /* SIGIO */
- SA_KILL, /* SIGXCPU */
- SA_KILL, /* SIGXFSZ */
- SA_KILL, /* SIGVTALRM */
- SA_KILL, /* SIGPROF */
- SA_IGNORE, /* SIGWINCH */
- SA_IGNORE, /* SIGINFO */
- SA_KILL, /* SIGUSR1 */
- SA_KILL, /* SIGUSR2 */
-};
-
-#define contsigmask (sigmask(SIGCONT))
-#define stopsigmask (sigmask(SIGSTOP) | sigmask(SIGTSTP) | \
- sigmask(SIGTTIN) | sigmask(SIGTTOU))
-
-#endif /* SIGPROP */
-
-#define sigcantmask (sigmask(SIGKILL) | sigmask(SIGSTOP))
-
-#ifdef KERNEL
-/*
- * Machine-independent functions:
- */
-void execsigs __P((struct proc *p));
-void gsignal __P((int pgid, int sig));
-int issignal __P((struct proc *p));
-void killproc __P((struct proc *p, char *why));
-void pgsignal __P((struct pgrp *pgrp, int sig, int checkctty));
-void postsig __P((int sig));
-void psignal __P((struct proc *p, int sig));
-void setsigvec __P((struct proc *p, int signum, struct sigaction *sa));
-void sigexit __P((struct proc *p, int signum));
-void siginit __P((struct proc *p));
-void trapsignal __P((struct proc *p, int sig, u_long code));
-
-/*
- * Machine-dependent functions:
- */
-void sendsig __P((sig_t action, int sig, int returnmask, u_long code));
-#endif /* KERNEL */
-#endif /* !_SYS_SIGNALVAR_H_ */
diff --git a/c/src/lib/libnetworking/sys/socket.h b/c/src/lib/libnetworking/sys/socket.h
deleted file mode 100644
index 7e0f6c7572..0000000000
--- a/c/src/lib/libnetworking/sys/socket.h
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
- * 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.
- *
- * @(#)socket.h 8.4 (Berkeley) 2/21/94
- * $Id$
- */
-
-#ifndef _SYS_SOCKET_H_
-#define _SYS_SOCKET_H_
-
-/*
- * Definitions related to sockets: types, address families, options.
- */
-
-/*
- * Types
- */
-#define SOCK_STREAM 1 /* stream socket */
-#define SOCK_DGRAM 2 /* datagram socket */
-#define SOCK_RAW 3 /* raw-protocol interface */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */
-#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-#define SO_PRIVSTATE 0x1009 /* get/deny privileged state */
-
-/*
- * Structure used for manipulating linger option.
- */
-struct linger {
- int l_onoff; /* option on/off */
- int l_linger; /* linger time */
-};
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/*
- * Address families.
- */
-#define AF_UNSPEC 0 /* unspecified */
-#define AF_LOCAL 1 /* local to host (pipes, portals) */
-#define AF_UNIX AF_LOCAL /* backward compatibility */
-#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
-#define AF_IMPLINK 3 /* arpanet imp addresses */
-#define AF_PUP 4 /* pup protocols: e.g. BSP */
-#define AF_CHAOS 5 /* mit CHAOS protocols */
-#define AF_NS 6 /* XEROX NS protocols */
-#define AF_ISO 7 /* ISO protocols */
-#define AF_OSI AF_ISO
-#define AF_ECMA 8 /* European computer manufacturers */
-#define AF_DATAKIT 9 /* datakit protocols */
-#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
-#define AF_SNA 11 /* IBM SNA */
-#define AF_DECnet 12 /* DECnet */
-#define AF_DLI 13 /* DEC Direct data link interface */
-#define AF_LAT 14 /* LAT */
-#define AF_HYLINK 15 /* NSC Hyperchannel */
-#define AF_APPLETALK 16 /* Apple Talk */
-#define AF_ROUTE 17 /* Internal Routing Protocol */
-#define AF_LINK 18 /* Link layer interface */
-#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
-#define AF_COIP 20 /* connection-oriented IP, aka ST II */
-#define AF_CNT 21 /* Computer Network Technology */
-#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */
-#define AF_IPX 23 /* Novell Internet Protocol */
-#define AF_SIP 24 /* Simple Internet Protocol */
-#define pseudo_AF_PIP 25 /* Help Identify PIP packets */
-#define AF_ISDN 26 /* Integrated Services Digital Network*/
-#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */
-#define pseudo_AF_KEY 27 /* Internal key-management function */
-#define AF_INET6 28 /* IPv6 */
-
-#define AF_MAX 29
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- u_char sa_len; /* total length */
- u_char sa_family; /* address family */
- char sa_data[14]; /* actually longer; address value */
-};
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- u_short sp_family; /* address family */
- u_short sp_protocol; /* protocol */
-};
-
-/*
- * Protocol families, same as address families for now.
- */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_LOCAL AF_LOCAL
-#define PF_UNIX PF_LOCAL /* backward compatibility */
-#define PF_INET AF_INET
-#define PF_IMPLINK AF_IMPLINK
-#define PF_PUP AF_PUP
-#define PF_CHAOS AF_CHAOS
-#define PF_NS AF_NS
-#define PF_ISO AF_ISO
-#define PF_OSI AF_ISO
-#define PF_ECMA AF_ECMA
-#define PF_DATAKIT AF_DATAKIT
-#define PF_CCITT AF_CCITT
-#define PF_SNA AF_SNA
-#define PF_DECnet AF_DECnet
-#define PF_DLI AF_DLI
-#define PF_LAT AF_LAT
-#define PF_HYLINK AF_HYLINK
-#define PF_APPLETALK AF_APPLETALK
-#define PF_ROUTE AF_ROUTE
-#define PF_LINK AF_LINK
-#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
-#define PF_COIP AF_COIP
-#define PF_CNT AF_CNT
-#define PF_SIP AF_SIP
-#define PF_IPX AF_IPX /* same format as AF_NS */
-#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */
-#define PF_PIP pseudo_AF_PIP
-#define PF_ISDN AF_ISDN
-#define PF_KEY pseudo_AF_KEY
-#define PF_INET6 AF_INET6
-
-#define PF_MAX AF_MAX
-
-/*
- * Definitions for network related sysctl, CTL_NET.
- *
- * Second level is protocol family.
- * Third level is protocol number.
- *
- * Further levels are defined by the individual families below.
- */
-#define NET_MAXID AF_MAX
-
-#define CTL_NET_NAMES { \
- { 0, 0 }, \
- { "unix", CTLTYPE_NODE }, \
- { "inet", CTLTYPE_NODE }, \
- { "implink", CTLTYPE_NODE }, \
- { "pup", CTLTYPE_NODE }, \
- { "chaos", CTLTYPE_NODE }, \
- { "xerox_ns", CTLTYPE_NODE }, \
- { "iso", CTLTYPE_NODE }, \
- { "emca", CTLTYPE_NODE }, \
- { "datakit", CTLTYPE_NODE }, \
- { "ccitt", CTLTYPE_NODE }, \
- { "ibm_sna", CTLTYPE_NODE }, \
- { "decnet", CTLTYPE_NODE }, \
- { "dec_dli", CTLTYPE_NODE }, \
- { "lat", CTLTYPE_NODE }, \
- { "hylink", CTLTYPE_NODE }, \
- { "appletalk", CTLTYPE_NODE }, \
- { "route", CTLTYPE_NODE }, \
- { "link_layer", CTLTYPE_NODE }, \
- { "xtp", CTLTYPE_NODE }, \
- { "coip", CTLTYPE_NODE }, \
- { "cnt", CTLTYPE_NODE }, \
- { "rtip", CTLTYPE_NODE }, \
- { "ipx", CTLTYPE_NODE }, \
- { "sip", CTLTYPE_NODE }, \
- { "pip", CTLTYPE_NODE }, \
- { "isdn", CTLTYPE_NODE }, \
- { "key", CTLTYPE_NODE }, \
-}
-
-/*
- * PF_ROUTE - Routing table
- *
- * Three additional levels are defined:
- * Fourth: address family, 0 is wildcard
- * Fifth: type of info, defined below
- * Sixth: flag(s) to mask with for NET_RT_FLAGS
- */
-#define NET_RT_DUMP 1 /* dump; may limit to a.f. */
-#define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */
-#define NET_RT_IFLIST 3 /* survey interface list */
-#define NET_RT_MAXID 4
-
-#define CTL_NET_RT_NAMES { \
- { 0, 0 }, \
- { "dump", CTLTYPE_STRUCT }, \
- { "flags", CTLTYPE_STRUCT }, \
- { "iflist", CTLTYPE_STRUCT }, \
-}
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#define SOMAXCONN 128
-
-/*
- * Message header for recvmsg and sendmsg calls.
- * Used value-result for recvmsg, value only for sendmsg.
- */
-struct msghdr {
- caddr_t msg_name; /* optional address */
- u_int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- u_int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_control; /* ancillary data, see below */
- u_int msg_controllen; /* ancillary data buffer len */
- int msg_flags; /* flags on received message */
-};
-
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-#define MSG_EOR 0x8 /* data completes record */
-#define MSG_TRUNC 0x10 /* data discarded before delivery */
-#define MSG_CTRUNC 0x20 /* control data lost before delivery */
-#define MSG_WAITALL 0x40 /* wait for full request or error */
-#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */
-#define MSG_EOF 0x100 /* data completes connection */
-#define MSG_COMPAT 0x8000 /* used in sendit() */
-
-/*
- * Header for ancillary data objects in msg_control buffer.
- * Used for additional information with/about a datagram
- * not expressible by flags. The format is a sequence
- * of message elements headed by cmsghdr structures.
- */
-struct cmsghdr {
- u_int cmsg_len; /* data byte count, including hdr */
- int cmsg_level; /* originating protocol */
- int cmsg_type; /* protocol-specific type */
-/* followed by u_char cmsg_data[]; */
-};
-
-/* given pointer to struct cmsghdr, return pointer to data */
-#define CMSG_DATA(cmsg) ((u_char *)((cmsg) + 1))
-
-/* given pointer to struct cmsghdr, return pointer to next cmsghdr */
-#define CMSG_NXTHDR(mhdr, cmsg) \
- (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
- (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
- (struct cmsghdr *)NULL : \
- (struct cmsghdr *)((caddr_t)(cmsg) + ALIGN((cmsg)->cmsg_len)))
-
-#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
-
-/* "Socket"-level control message types: */
-#define SCM_RIGHTS 0x01 /* access rights (array of int) */
-#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */
-
-/*
- * 4.3 compat sockaddr, move to compat file later
- */
-struct osockaddr {
- u_short sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
-};
-
-/*
- * 4.3-compat message header (move to compat file later).
- */
-struct omsghdr {
- caddr_t msg_name; /* optional address */
- int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_accrights; /* access rights sent/received */
- int msg_accrightslen;
-};
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int accept __P((int, struct sockaddr *, int *));
-int bind __P((int, const struct sockaddr *, int));
-int connect __P((int, const struct sockaddr *, int));
-int getpeername __P((int, struct sockaddr *, int *));
-int getsockname __P((int, struct sockaddr *, int *));
-int getsockopt __P((int, int, int, void *, int *));
-int listen __P((int, int));
-ssize_t recv __P((int, void *, size_t, int));
-ssize_t recvfrom __P((int, void *, size_t, int, struct sockaddr *, int *));
-ssize_t recvmsg __P((int, struct msghdr *, int));
-ssize_t send __P((int, const void *, size_t, int));
-ssize_t sendto __P((int, const void *,
- size_t, int, const struct sockaddr *, int));
-ssize_t sendmsg __P((int, const struct msghdr *, int));
-int setsockopt __P((int, int, int, const void *, int));
-int shutdown __P((int, int));
-int socket __P((int, int, int));
-int socketpair __P((int, int, int, int *));
-__END_DECLS
-
-#else /* KERNEL */
-void pfctlinput __P((int, struct sockaddr *));
-#endif /* !KERNEL */
-#endif /* !_SYS_SOCKET_H_ */
diff --git a/c/src/lib/libnetworking/sys/socketvar.h b/c/src/lib/libnetworking/sys/socketvar.h
deleted file mode 100644
index 257fee012b..0000000000
--- a/c/src/lib/libnetworking/sys/socketvar.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 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.
- *
- * @(#)socketvar.h 8.3 (Berkeley) 2/19/95
- * $Id$
- */
-
-#ifndef _SYS_SOCKETVAR_H_
-#define _SYS_SOCKETVAR_H_
-
-#include <sys/queue.h> /* for TAILQ macros */
-#include <sys/select.h> /* for struct selinfo */
-
-/*
- * Kernel structure per socket.
- * Contains send and receive buffer queues,
- * handle on protocol and pointer to protocol
- * private data and error information.
- */
-struct socket {
- short so_type; /* generic type, see socket.h */
- short so_options; /* from socket call, see socket.h */
- short so_linger; /* time to linger while closing */
- short so_state; /* internal state flags SS_*, below */
- caddr_t so_pcb; /* protocol control block */
- struct protosw *so_proto; /* protocol handle */
-/*
- * Variables for connection queuing.
- * Socket where accepts occur is so_head in all subsidiary sockets.
- * If so_head is 0, socket is not related to an accept.
- * For head socket so_q0 queues partially completed connections,
- * while so_q is a queue of connections ready to be accepted.
- * If a connection is aborted and it has so_head set, then
- * it has to be pulled out of either so_q0 or so_q.
- * We allow connections to queue up based on current queue lengths
- * and limit on number of queued connections for this socket.
- */
- struct socket *so_head; /* back pointer to accept socket */
- TAILQ_HEAD(, socket) so_incomp; /* queue of partial unaccepted connections */
- TAILQ_HEAD(, socket) so_comp; /* queue of complete unaccepted connections */
- TAILQ_ENTRY(socket) so_list; /* list of unaccepted connections */
- short so_qlen; /* number of unaccepted connections */
- short so_incqlen; /* number of unaccepted incomplete
- connections */
- short so_qlimit; /* max number queued connections */
- short so_timeo; /* connection timeout */
- u_short so_error; /* error affecting connection */
- pid_t so_pgid; /* pgid for signals */
- u_long so_oobmark; /* chars to oob mark */
-/*
- * Variables for socket buffering.
- */
- struct sockbuf {
- u_long sb_cc; /* actual chars in buffer */
- u_long sb_hiwat; /* max actual char count */
- u_long sb_mbcnt; /* chars of mbufs used */
- u_long sb_mbmax; /* max chars of mbufs to use */
- long sb_lowat; /* low water mark */
- struct mbuf *sb_mb; /* the mbuf chain */
- struct selinfo sb_sel; /* process selecting read/write */
- short sb_flags; /* flags, see below */
- short sb_timeo; /* timeout for read/write */
- } so_rcv, so_snd;
-#define SB_MAX (256*1024) /* default for max chars in sockbuf */
-#define SB_LOCK 0x01 /* lock on data queue */
-#define SB_WANT 0x02 /* someone is waiting to lock */
-#define SB_WAIT 0x04 /* someone is waiting for data/space */
-#define SB_SEL 0x08 /* someone is selecting */
-#define SB_ASYNC 0x10 /* ASYNC I/O, need signals */
-#define SB_NOTIFY (SB_WAIT|SB_SEL|SB_ASYNC)
-#define SB_NOINTR 0x40 /* operations not interruptible */
-
- caddr_t so_tpcb; /* Wisc. protocol control block XXX */
- void (*so_upcall) __P((struct socket *so, caddr_t arg, int waitf));
- caddr_t so_upcallarg; /* Arg for above */
- uid_t so_uid; /* who opened the socket */
-};
-
-/*
- * Socket state bits.
- */
-#define SS_NOFDREF 0x0001 /* no file table ref any more */
-#define SS_ISCONNECTED 0x0002 /* socket connected to a peer */
-#define SS_ISCONNECTING 0x0004 /* in process of connecting to peer */
-#define SS_ISDISCONNECTING 0x0008 /* in process of disconnecting */
-#define SS_CANTSENDMORE 0x0010 /* can't send more data to peer */
-#define SS_CANTRCVMORE 0x0020 /* can't receive more data from peer */
-#define SS_RCVATMARK 0x0040 /* at mark on input */
-
-#define SS_PRIV 0x0080 /* privileged for broadcast, raw... */
-#define SS_NBIO 0x0100 /* non-blocking ops */
-#define SS_ASYNC 0x0200 /* async i/o notify */
-#define SS_ISCONFIRMING 0x0400 /* deciding to accept connection req */
-
-#define SS_INCOMP 0x0800 /* unaccepted, incomplete connection */
-#define SS_COMP 0x1000 /* unaccepted, complete connection */
-
-
-/*
- * Macros for sockets and socket buffering.
- */
-
-/*
- * How much space is there in a socket buffer (so->so_snd or so->so_rcv)?
- * This is problematical if the fields are unsigned, as the space might
- * still be negative (cc > hiwat or mbcnt > mbmax). Should detect
- * overflow and return 0. Should use "lmin" but it doesn't exist now.
- */
-#define sbspace(sb) \
- ((long) imin((int)((sb)->sb_hiwat - (sb)->sb_cc), \
- (int)((sb)->sb_mbmax - (sb)->sb_mbcnt)))
-
-/* do we have to send all at once on a socket? */
-#define sosendallatonce(so) \
- ((so)->so_proto->pr_flags & PR_ATOMIC)
-
-/* can we read something from so? */
-#define soreadable(so) \
- ((so)->so_rcv.sb_cc >= (so)->so_rcv.sb_lowat || \
- ((so)->so_state & SS_CANTRCVMORE) || \
- (so)->so_comp.tqh_first || (so)->so_error)
-
-/* can we write something to so? */
-#define sowriteable(so) \
- ((sbspace(&(so)->so_snd) >= (so)->so_snd.sb_lowat && \
- (((so)->so_state&SS_ISCONNECTED) || \
- ((so)->so_proto->pr_flags&PR_CONNREQUIRED)==0)) || \
- ((so)->so_state & SS_CANTSENDMORE) || \
- (so)->so_error)
-
-/* adjust counters in sb reflecting allocation of m */
-#define sballoc(sb, m) { \
- (sb)->sb_cc += (m)->m_len; \
- (sb)->sb_mbcnt += MSIZE; \
- if ((m)->m_flags & M_EXT) \
- (sb)->sb_mbcnt += (m)->m_ext.ext_size; \
-}
-
-/* adjust counters in sb reflecting freeing of m */
-#define sbfree(sb, m) { \
- (sb)->sb_cc -= (m)->m_len; \
- (sb)->sb_mbcnt -= MSIZE; \
- if ((m)->m_flags & M_EXT) \
- (sb)->sb_mbcnt -= (m)->m_ext.ext_size; \
-}
-
-/*
- * Set lock on sockbuf sb; sleep if lock is already held.
- * Unless SB_NOINTR is set on sockbuf, sleep is interruptible.
- * Returns error without lock if sleep is interrupted.
- */
-#define sblock(sb, wf) ((sb)->sb_flags & SB_LOCK ? \
- (((wf) == M_WAITOK) ? sb_lock(sb) : EWOULDBLOCK) : \
- ((sb)->sb_flags |= SB_LOCK), 0)
-
-/* release lock on sockbuf sb */
-#define sbunlock(sb) { \
- (sb)->sb_flags &= ~SB_LOCK; \
- if ((sb)->sb_flags & SB_WANT) { \
- (sb)->sb_flags &= ~SB_WANT; \
- wakeup((caddr_t)&(sb)->sb_flags); \
- } \
-}
-
-#define sorwakeup(so) { sowakeup((so), &(so)->so_rcv); \
- if ((so)->so_upcall) \
- (*((so)->so_upcall))((so), (so)->so_upcallarg, M_DONTWAIT); \
- }
-
-#define sowwakeup(so) sowakeup((so), &(so)->so_snd)
-
-#ifdef KERNEL
-extern u_long sb_max;
-
-/* to catch callers missing new second argument to sonewconn: */
-#define sonewconn(head, connstatus) sonewconn1((head), (connstatus))
-
-struct filedesc;
-struct mbuf;
-struct sockaddr;
-struct stat;
-
-/*
- * File operations on sockets.
- */
-int soo_ioctl __P((struct file *fp, int cmd, caddr_t data,
- struct proc *p));
-int soo_select __P((struct file *fp, int which, struct proc *p));
-int soo_stat __P((struct socket *so, struct stat *ub));
-
-/*
- * From uipc_socket and friends
- */
-int getsock __P((struct filedesc *fdp, int fdes, struct file **fpp));
-int sockargs __P((struct mbuf **mp, caddr_t buf, int buflen, int type));
-void sbappend __P((struct sockbuf *sb, struct mbuf *m));
-int sbappendaddr __P((struct sockbuf *sb, struct sockaddr *asa,
- struct mbuf *m0, struct mbuf *control));
-int sbappendcontrol __P((struct sockbuf *sb, struct mbuf *m0,
- struct mbuf *control));
-void sbappendrecord __P((struct sockbuf *sb, struct mbuf *m0));
-void sbcheck __P((struct sockbuf *sb));
-void sbcompress __P((struct sockbuf *sb, struct mbuf *m, struct mbuf *n));
-struct mbuf *
- sbcreatecontrol __P((caddr_t p, int size, int type, int level));
-void sbdrop __P((struct sockbuf *sb, int len));
-void sbdroprecord __P((struct sockbuf *sb));
-void sbflush __P((struct sockbuf *sb));
-void sbinsertoob __P((struct sockbuf *sb, struct mbuf *m0));
-void sbrelease __P((struct sockbuf *sb));
-int sbreserve __P((struct sockbuf *sb, u_long cc));
-int sbwait __P((struct sockbuf *sb));
-int sb_lock __P((struct sockbuf *sb));
-int soabort __P((struct socket *so));
-int soaccept __P((struct socket *so, struct mbuf *nam));
-int sobind __P((struct socket *so, struct mbuf *nam));
-void socantrcvmore __P((struct socket *so));
-void socantsendmore __P((struct socket *so));
-int soclose __P((struct socket *so));
-int soconnect __P((struct socket *so, struct mbuf *nam));
-int soconnect2 __P((struct socket *so1, struct socket *so2));
-int socreate __P((int dom, struct socket **aso, int type, int proto,
- struct proc *p));
-int sodisconnect __P((struct socket *so));
-void sofree __P((struct socket *so));
-int sogetopt __P((struct socket *so, int level, int optname,
- struct mbuf **mp));
-void sohasoutofband __P((struct socket *so));
-void soisconnected __P((struct socket *so));
-void soisconnecting __P((struct socket *so));
-void soisdisconnected __P((struct socket *so));
-void soisdisconnecting __P((struct socket *so));
-int solisten __P((struct socket *so, int backlog));
-struct socket *
- sodropablereq __P((struct socket *head));
-struct socket *
- sonewconn1 __P((struct socket *head, int connstatus));
-int soreceive __P((struct socket *so, struct mbuf **paddr, struct uio *uio,
- struct mbuf **mp0, struct mbuf **controlp, int *flagsp));
-int soreserve __P((struct socket *so, u_long sndcc, u_long rcvcc));
-void sorflush __P((struct socket *so));
-int sosend __P((struct socket *so, struct mbuf *addr, struct uio *uio,
- struct mbuf *top, struct mbuf *control, int flags));
-int sosetopt __P((struct socket *so, int level, int optname,
- struct mbuf *m0));
-int soshutdown __P((struct socket *so, int how));
-void sowakeup __P((struct socket *so, struct sockbuf *sb));
-#endif /* KERNEL */
-
-#endif /* !_SYS_SOCKETVAR_H_ */
diff --git a/c/src/lib/libnetworking/sys/sockio.h b/c/src/lib/libnetworking/sys/sockio.h
deleted file mode 100644
index 020061170f..0000000000
--- a/c/src/lib/libnetworking/sys/sockio.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * 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.
- *
- * @(#)sockio.h 8.1 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_SOCKIO_H_
-#define _SYS_SOCKIO_H_
-
-#include <sys/ioccom.h>
-
-/* Socket ioctl's. */
-#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */
-#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */
-#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */
-#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */
-#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */
-#define SIOCSPGRP _IOW('s', 8, int) /* set process group */
-#define SIOCGPGRP _IOR('s', 9, int) /* get process group */
-
-#define SIOCADDRT _IOW('r', 10, struct ortentry) /* add route */
-#define SIOCDELRT _IOW('r', 11, struct ortentry) /* delete route */
-#define SIOCGETVIFCNT _IOWR('r', 15, struct sioc_vif_req)/* get vif pkt cnt */
-#define SIOCGETSGCNT _IOWR('r', 16, struct sioc_sg_req) /* get s,g pkt cnt */
-
-#define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */
-#define OSIOCGIFADDR _IOWR('i', 13, struct ifreq) /* get ifnet address */
-#define SIOCGIFADDR _IOWR('i', 33, struct ifreq) /* get ifnet address */
-#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */
-#define OSIOCGIFDSTADDR _IOWR('i', 15, struct ifreq) /* get p-p address */
-#define SIOCGIFDSTADDR _IOWR('i', 34, struct ifreq) /* get p-p address */
-#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */
-#define SIOCGIFFLAGS _IOWR('i', 17, struct ifreq) /* get ifnet flags */
-#define OSIOCGIFBRDADDR _IOWR('i', 18, struct ifreq) /* get broadcast addr */
-#define SIOCGIFBRDADDR _IOWR('i', 35, struct ifreq) /* get broadcast addr */
-#define SIOCSIFBRDADDR _IOW('i', 19, struct ifreq) /* set broadcast addr */
-#define OSIOCGIFCONF _IOWR('i', 20, struct ifconf) /* get ifnet list */
-#define SIOCGIFCONF _IOWR('i', 36, struct ifconf) /* get ifnet list */
-#define OSIOCGIFNETMASK _IOWR('i', 21, struct ifreq) /* get net addr mask */
-#define SIOCGIFNETMASK _IOWR('i', 37, struct ifreq) /* get net addr mask */
-#define SIOCSIFNETMASK _IOW('i', 22, struct ifreq) /* set net addr mask */
-#define SIOCGIFMETRIC _IOWR('i', 23, struct ifreq) /* get IF metric */
-#define SIOCSIFMETRIC _IOW('i', 24, struct ifreq) /* set IF metric */
-#define SIOCDIFADDR _IOW('i', 25, struct ifreq) /* delete IF addr */
-#define SIOCAIFADDR _IOW('i', 26, struct ifaliasreq)/* add/chg IF alias */
-
-#define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */
-#define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */
-#define SIOCGIFMTU _IOWR('i', 51, struct ifreq) /* get IF mtu */
-#define SIOCSIFMTU _IOW('i', 52, struct ifreq) /* set IF mtu */
-#define SIOCGIFPHYS _IOWR('i', 53, struct ifreq) /* get IF wire */
-#define SIOCSIFPHYS _IOW('i', 54, struct ifreq) /* set IF wire */
-#define SIOCSIFMEDIA _IOWR('i', 55, struct ifreq) /* set net media */
-#define SIOCGIFMEDIA _IOWR('i', 56, struct ifmediareq) /* get net media */
-
-#endif /* !_SYS_SOCKIO_H_ */
diff --git a/c/src/lib/libnetworking/sys/sysctl.h b/c/src/lib/libnetworking/sys/sysctl.h
deleted file mode 100644
index b25ba43c4f..0000000000
--- a/c/src/lib/libnetworking/sys/sysctl.h
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Mike Karels at Berkeley Software Design, Inc.
- *
- * 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.
- *
- * @(#)sysctl.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_SYSCTL_H_
-#define _SYS_SYSCTL_H_
-
-/*
- * Definitions for sysctl call. The sysctl call uses a hierarchical name
- * for objects that can be examined or modified. The name is expressed as
- * a sequence of integers. Like a file path name, the meaning of each
- * component depends on its place in the hierarchy. The top-level and kern
- * identifiers are defined here, and other identifiers are defined in the
- * respective subsystem header files.
- */
-
-#define CTL_MAXNAME 12 /* largest number of components supported */
-
-/*
- * Each subsystem defined by sysctl defines a list of variables
- * for that subsystem. Each name is either a node with further
- * levels defined below it, or it is a leaf of some particular
- * type given below. Each sysctl level defines a set of name/type
- * pairs to be used by sysctl(1) in manipulating the subsystem.
- */
-struct ctlname {
- char *ctl_name; /* subsystem name */
- int ctl_type; /* type of name */
-};
-
-#define CTLTYPE 0xf /* Mask for the type */
-#define CTLTYPE_NODE 1 /* name is a node */
-#define CTLTYPE_INT 2 /* name describes an integer */
-#define CTLTYPE_STRING 3 /* name describes a string */
-#define CTLTYPE_QUAD 4 /* name describes a 64-bit number */
-#define CTLTYPE_OPAQUE 5 /* name describes a structure */
-#define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */
-
-#define CTLFLAG_RD 0x80000000 /* Allow reads of variable */
-#define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */
-#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR)
-#define CTLFLAG_NOLOCK 0x20000000 /* XXX Don't Lock */
-#define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */
-
-/*
- * USE THIS instead of a hardwired number from the categories below
- * to get dynamically assigned sysctl entries using the linker-set
- * technology. This is the way nearly all new sysctl variables should
- * be implimented.
- * e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, "");
- */
-#define OID_AUTO (-1)
-
-#ifdef KERNEL
-#define SYSCTL_HANDLER_ARGS (struct sysctl_oid *oidp, void *arg1, int arg2, \
- struct sysctl_req *req)
-
-/*
- * This describes the access space for a sysctl request. This is needed
- * so that we can use the interface from the kernel or from user-space.
- */
-struct sysctl_req {
- struct proc *p;
- int lock;
- void *oldptr;
- int oldlen;
- int oldidx;
- int (*oldfunc)(struct sysctl_req *, const void *, int);
- void *newptr;
- int newlen;
- int newidx;
- int (*newfunc)(struct sysctl_req *, void *, int);
-};
-
-/*
- * This describes one "oid" in the MIB tree. Potentially more nodes can
- * be hidden behind it, expanded by the handler.
- */
-struct sysctl_oid {
- int oid_number;
- int oid_kind;
- void *oid_arg1;
- int oid_arg2;
- const char *oid_name;
- int (*oid_handler) SYSCTL_HANDLER_ARGS;
- const char *oid_fmt;
-};
-
-#define SYSCTL_IN(r, p, l)
-#define SYSCTL_OUT(r, p, l)
-
-int sysctl_handle_int SYSCTL_HANDLER_ARGS;
-int sysctl_handle_string SYSCTL_HANDLER_ARGS;
-int sysctl_handle_opaque SYSCTL_HANDLER_ARGS;
-
-/* This is the "raw" function for a mib-oid */
-#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr)
-
-/* This makes a node from which other oids can hang */
-#define SYSCTL_NODE(parent, nbr, name, access, handler, descr)
-
-/* This is a string len can be 0 to indicate '\0' termination */
-#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr)
-
-/* This is a integer, if ptr is NULL, val is returned */
-#define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr)
-
-/* This is anything, specified by a pointer and a lenth */
-#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr)
-
-/* This is a struct, specified by a pointer and type */
-#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr)
-
-/* Needs a proc. Specify by pointer and arg */
-#define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr)
-#endif /* KERNEL */
-
-/*
- * Top-level identifiers
- */
-#define CTL_UNSPEC 0 /* unused */
-#define CTL_KERN 1 /* "high kernel": proc, limits */
-#define CTL_VM 2 /* virtual memory */
-#define CTL_VFS 3 /* file system, mount type is next */
-#define CTL_NET 4 /* network, see socket.h */
-#define CTL_DEBUG 5 /* debugging parameters */
-#define CTL_HW 6 /* generic cpu/io */
-#define CTL_MACHDEP 7 /* machine dependent */
-#define CTL_USER 8 /* user-level */
-#define CTL_MAXID 9 /* number of valid top-level ids */
-
-#define CTL_NAMES { \
- { 0, 0 }, \
- { "kern", CTLTYPE_NODE }, \
- { "vm", CTLTYPE_NODE }, \
- { "vfs", CTLTYPE_NODE }, \
- { "net", CTLTYPE_NODE }, \
- { "debug", CTLTYPE_NODE }, \
- { "hw", CTLTYPE_NODE }, \
- { "machdep", CTLTYPE_NODE }, \
- { "user", CTLTYPE_NODE }, \
-}
-
-/*
- * CTL_KERN identifiers
- */
-#define KERN_OSTYPE 1 /* string: system version */
-#define KERN_OSRELEASE 2 /* string: system release */
-#define KERN_OSREV 3 /* int: system revision */
-#define KERN_VERSION 4 /* string: compile time info */
-#define KERN_MAXVNODES 5 /* int: max vnodes */
-#define KERN_MAXPROC 6 /* int: max processes */
-#define KERN_MAXFILES 7 /* int: max open files */
-#define KERN_ARGMAX 8 /* int: max arguments to exec */
-#define KERN_SECURELVL 9 /* int: system security level */
-#define KERN_HOSTNAME 10 /* string: hostname */
-#define KERN_HOSTID 11 /* int: host identifier */
-#define KERN_CLOCKRATE 12 /* struct: struct clockrate */
-#define KERN_VNODE 13 /* struct: vnode structures */
-#define KERN_PROC 14 /* struct: process entries */
-#define KERN_FILE 15 /* struct: file entries */
-#define KERN_PROF 16 /* node: kernel profiling info */
-#define KERN_POSIX1 17 /* int: POSIX.1 version */
-#define KERN_NGROUPS 18 /* int: # of supplemental group ids */
-#define KERN_JOB_CONTROL 19 /* int: is job control available */
-#define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */
-#define KERN_BOOTTIME 21 /* struct: time kernel was booted */
-#define KERN_NISDOMAINNAME 22 /* string: YP domain name */
-#define KERN_UPDATEINTERVAL 23 /* int: update process sleep time */
-#define KERN_OSRELDATE 24 /* int: OS release date */
-#define KERN_NTP_PLL 25 /* node: NTP PLL control */
-#define KERN_BOOTFILE 26 /* string: name of booted kernel */
-#define KERN_MAXFILESPERPROC 27 /* int: max open files per proc */
-#define KERN_MAXPROCPERUID 28 /* int: max processes per uid */
-#define KERN_DUMPDEV 29 /* dev_t: device to dump on */
-#define KERN_SOMAXCONN 30 /* int: max connections in listen q */
-#define KERN_MAXSOCKBUF 31 /* int: max size of a socket buffer */
-#define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */
-#define KERN_USRSTACK 33 /* int: address of USRSTACK */
-#define KERN_MAXID 34 /* number of valid kern ids */
-
-#define CTL_KERN_NAMES { \
- { 0, 0 }, \
- { "ostype", CTLTYPE_STRING }, \
- { "osrelease", CTLTYPE_STRING }, \
- { "osrevision", CTLTYPE_INT }, \
- { "version", CTLTYPE_STRING }, \
- { "maxvnodes", CTLTYPE_INT }, \
- { "maxproc", CTLTYPE_INT }, \
- { "maxfiles", CTLTYPE_INT }, \
- { "argmax", CTLTYPE_INT }, \
- { "securelevel", CTLTYPE_INT }, \
- { "hostname", CTLTYPE_STRING }, \
- { "hostid", CTLTYPE_INT }, \
- { "clockrate", CTLTYPE_STRUCT }, \
- { "vnode", CTLTYPE_STRUCT }, \
- { "proc", CTLTYPE_STRUCT }, \
- { "file", CTLTYPE_STRUCT }, \
- { "profiling", CTLTYPE_NODE }, \
- { "posix1version", CTLTYPE_INT }, \
- { "ngroups", CTLTYPE_INT }, \
- { "job_control", CTLTYPE_INT }, \
- { "saved_ids", CTLTYPE_INT }, \
- { "boottime", CTLTYPE_STRUCT }, \
- { "nisdomainname", CTLTYPE_STRING }, \
- { "update", CTLTYPE_INT }, \
- { "osreldate", CTLTYPE_INT }, \
- { "ntp_pll", CTLTYPE_NODE }, \
- { "bootfile", CTLTYPE_STRING }, \
- { "maxfilesperproc", CTLTYPE_INT }, \
- { "maxprocperuid", CTLTYPE_INT }, \
- { "dumpdev", CTLTYPE_STRUCT }, /* we lie; don't print as int */ \
- { "somaxconn", CTLTYPE_INT }, \
- { "maxsockbuf", CTLTYPE_INT }, \
- { "ps_strings", CTLTYPE_INT }, \
- { "usrstack", CTLTYPE_INT }, \
-}
-
-/*
- * CTL_VFS identifiers
- */
-#define VFS_VFSCONF 0 /* get configured filesystems */
-#define VFS_MAXID 1 /* number of items */
-
-#define CTL_VFS_NAMES { \
- { "vfsconf", CTLTYPE_STRUCT }, \
-}
-
-/*
- * KERN_PROC subtypes
- */
-#define KERN_PROC_ALL 0 /* everything */
-#define KERN_PROC_PID 1 /* by process id */
-#define KERN_PROC_PGRP 2 /* by process group id */
-#define KERN_PROC_SESSION 3 /* by session of pid */
-#define KERN_PROC_TTY 4 /* by controlling tty */
-#define KERN_PROC_UID 5 /* by effective uid */
-#define KERN_PROC_RUID 6 /* by real uid */
-
-/*
- * CTL_HW identifiers
- */
-#define HW_MACHINE 1 /* string: machine class */
-#define HW_MODEL 2 /* string: specific machine model */
-#define HW_NCPU 3 /* int: number of cpus */
-#define HW_BYTEORDER 4 /* int: machine byte order */
-#define HW_PHYSMEM 5 /* int: total memory */
-#define HW_USERMEM 6 /* int: non-kernel memory */
-#define HW_PAGESIZE 7 /* int: software page size */
-#define HW_DISKNAMES 8 /* strings: disk drive names */
-#define HW_DISKSTATS 9 /* struct: diskstats[] */
-#define HW_FLOATINGPT 10 /* int: has HW floating point? */
-#define HW_MACHINE_ARCH 11 /* string: machine architecture */
-#define HW_MAXID 12 /* number of valid hw ids */
-
-#define CTL_HW_NAMES { \
- { 0, 0 }, \
- { "machine", CTLTYPE_STRING }, \
- { "model", CTLTYPE_STRING }, \
- { "ncpu", CTLTYPE_INT }, \
- { "byteorder", CTLTYPE_INT }, \
- { "physmem", CTLTYPE_INT }, \
- { "usermem", CTLTYPE_INT }, \
- { "pagesize", CTLTYPE_INT }, \
- { "disknames", CTLTYPE_STRUCT }, \
- { "diskstats", CTLTYPE_STRUCT }, \
- { "floatingpoint", CTLTYPE_INT }, \
-}
-
-/*
- * CTL_USER definitions
- */
-#define USER_CS_PATH 1 /* string: _CS_PATH */
-#define USER_BC_BASE_MAX 2 /* int: BC_BASE_MAX */
-#define USER_BC_DIM_MAX 3 /* int: BC_DIM_MAX */
-#define USER_BC_SCALE_MAX 4 /* int: BC_SCALE_MAX */
-#define USER_BC_STRING_MAX 5 /* int: BC_STRING_MAX */
-#define USER_COLL_WEIGHTS_MAX 6 /* int: COLL_WEIGHTS_MAX */
-#define USER_EXPR_NEST_MAX 7 /* int: EXPR_NEST_MAX */
-#define USER_LINE_MAX 8 /* int: LINE_MAX */
-#define USER_RE_DUP_MAX 9 /* int: RE_DUP_MAX */
-#define USER_POSIX2_VERSION 10 /* int: POSIX2_VERSION */
-#define USER_POSIX2_C_BIND 11 /* int: POSIX2_C_BIND */
-#define USER_POSIX2_C_DEV 12 /* int: POSIX2_C_DEV */
-#define USER_POSIX2_CHAR_TERM 13 /* int: POSIX2_CHAR_TERM */
-#define USER_POSIX2_FORT_DEV 14 /* int: POSIX2_FORT_DEV */
-#define USER_POSIX2_FORT_RUN 15 /* int: POSIX2_FORT_RUN */
-#define USER_POSIX2_LOCALEDEF 16 /* int: POSIX2_LOCALEDEF */
-#define USER_POSIX2_SW_DEV 17 /* int: POSIX2_SW_DEV */
-#define USER_POSIX2_UPE 18 /* int: POSIX2_UPE */
-#define USER_STREAM_MAX 19 /* int: POSIX2_STREAM_MAX */
-#define USER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */
-#define USER_MAXID 21 /* number of valid user ids */
-
-#define CTL_USER_NAMES { \
- { 0, 0 }, \
- { "cs_path", CTLTYPE_STRING }, \
- { "bc_base_max", CTLTYPE_INT }, \
- { "bc_dim_max", CTLTYPE_INT }, \
- { "bc_scale_max", CTLTYPE_INT }, \
- { "bc_string_max", CTLTYPE_INT }, \
- { "coll_weights_max", CTLTYPE_INT }, \
- { "expr_nest_max", CTLTYPE_INT }, \
- { "line_max", CTLTYPE_INT }, \
- { "re_dup_max", CTLTYPE_INT }, \
- { "posix2_version", CTLTYPE_INT }, \
- { "posix2_c_bind", CTLTYPE_INT }, \
- { "posix2_c_dev", CTLTYPE_INT }, \
- { "posix2_char_term", CTLTYPE_INT }, \
- { "posix2_fort_dev", CTLTYPE_INT }, \
- { "posix2_fort_run", CTLTYPE_INT }, \
- { "posix2_localedef", CTLTYPE_INT }, \
- { "posix2_sw_dev", CTLTYPE_INT }, \
- { "posix2_upe", CTLTYPE_INT }, \
- { "stream_max", CTLTYPE_INT }, \
- { "tzname_max", CTLTYPE_INT }, \
-}
-
-#ifdef KERNEL
-
-extern char cpu_model[];
-extern char machine[];
-extern char osrelease[];
-extern char ostype[];
-
-int kernel_sysctl(struct proc *p, int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen, int *retval);
-int userland_sysctl(struct proc *p, int *name, u_int namelen, void *old, size_t *oldlenp, int inkernel, void *new, size_t newlen, int *retval);
-/*
-int sysctl_clockrate __P((char *, size_t*));
-int sysctl_file __P((char *, size_t*));
-int sysctl_doproc __P((int *, u_int, char *, size_t*));
-int sysctl_doprof __P((int *, u_int, void *, size_t *, void *, size_t));
-*/
-
-#else /* !KERNEL */
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int sysctl __P((int *, u_int, void *, size_t *, void *, size_t));
-int sysctlbyname __P((const char *, void *, size_t *, void *, size_t));
-__END_DECLS
-#endif /* KERNEL */
-
-#endif /* !_SYS_SYSCTL_H_ */
diff --git a/c/src/lib/libnetworking/sys/syslimits.h b/c/src/lib/libnetworking/sys/syslimits.h
deleted file mode 100644
index 283a0241e3..0000000000
--- a/c/src/lib/libnetworking/sys/syslimits.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * @(#)syslimits.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_SYSLIMITS_H_
-#define _SYS_SYSLIMITS_H_
-
-#if !defined(__rtems__)
-#define ARG_MAX 65536 /* max bytes for an exec function */
-#endif
-
-#if !defined(__rtems__)
-#ifndef CHILD_MAX
-#define CHILD_MAX 40 /* max simultaneous processes */
-#endif
-#endif
-
-#if !defined(__rtems__)
-#define LINK_MAX 32767 /* max file link count */
-#endif
-
-#define MAX_CANON 255 /* max bytes in term canon input line */
-
-#define MAX_INPUT 255 /* max bytes in terminal input */
-
-#if !defined(__rtems__)
-#define NAME_MAX 255 /* max bytes in a file name */
-#endif
-
-#define NGROUPS_MAX 16 /* max supplemental group id's */
-
-#if !defined(__rtems__)
-#ifndef OPEN_MAX
-#define OPEN_MAX 64 /* max open files per process */
-#endif
-#endif
-
-#if !defined(__rtems__)
-#define PATH_MAX 1024 /* max bytes in pathname */
-#endif
-
-#define PIPE_BUF 512 /* max bytes for atomic pipe writes */
-
-#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */
-#define BC_DIM_MAX 2048 /* max array elements in bc(1) */
-#define BC_SCALE_MAX 99 /* max scale value in bc(1) */
-#define BC_STRING_MAX 1000 /* max const string length in bc(1) */
-#define COLL_WEIGHTS_MAX 0 /* max weights for order keyword */
-#define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */
-#define LINE_MAX 2048 /* max bytes in an input line */
-#define RE_DUP_MAX 255 /* max RE's in interval notation */
-
-#endif
diff --git a/c/src/lib/libnetworking/sys/syslog.h b/c/src/lib/libnetworking/sys/syslog.h
deleted file mode 100644
index 724bee62c7..0000000000
--- a/c/src/lib/libnetworking/sys/syslog.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)syslog.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_SYSLOG_H_
-#define _SYS_SYSLOG_H_
-
-#define _PATH_LOG "/var/run/log"
-#define _PATH_OLDLOG "/dev/log" /* backward compatibility */
-
-/*
- * priorities/facilities are encoded into a single 32-bit quantity, where the
- * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
- * (0-big number). Both the priorities and the facilities map roughly
- * one-to-one to strings in the syslogd(8) source code. This mapping is
- * included in this file.
- *
- * priorities (these are ordered)
- */
-#define LOG_EMERG 0 /* system is unusable */
-#define LOG_ALERT 1 /* action must be taken immediately */
-#define LOG_CRIT 2 /* critical conditions */
-#define LOG_ERR 3 /* error conditions */
-#define LOG_WARNING 4 /* warning conditions */
-#define LOG_NOTICE 5 /* normal but significant condition */
-#define LOG_INFO 6 /* informational */
-#define LOG_DEBUG 7 /* debug-level messages */
-
-#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
- /* extract priority */
-#define LOG_PRI(p) ((p) & LOG_PRIMASK)
-#define LOG_MAKEPRI(fac, pri) ((fac) | (pri))
-
-#ifdef SYSLOG_NAMES
-#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
- /* mark "facility" */
-#define INTERNAL_MARK LOG_MAKEPRI((LOG_NFACILITIES<<3), 0)
-typedef struct _code {
- char *c_name;
- int c_val;
-} CODE;
-
-CODE prioritynames[] = {
- { "alert", LOG_ALERT, },
- { "crit", LOG_CRIT, },
- { "debug", LOG_DEBUG, },
- { "emerg", LOG_EMERG, },
- { "err", LOG_ERR, },
- { "error", LOG_ERR, }, /* DEPRECATED */
- { "info", LOG_INFO, },
- { "none", INTERNAL_NOPRI, }, /* INTERNAL */
- { "notice", LOG_NOTICE, },
- { "panic", LOG_EMERG, }, /* DEPRECATED */
- { "warn", LOG_WARNING, }, /* DEPRECATED */
- { "warning", LOG_WARNING, },
- { NULL, -1, }
-};
-#endif
-
-/* facility codes */
-#define LOG_KERN (0<<3) /* kernel messages */
-#define LOG_USER (1<<3) /* random user-level messages */
-#define LOG_MAIL (2<<3) /* mail system */
-#define LOG_DAEMON (3<<3) /* system daemons */
-#define LOG_AUTH (4<<3) /* security/authorization messages */
-#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
-#define LOG_LPR (6<<3) /* line printer subsystem */
-#define LOG_NEWS (7<<3) /* network news subsystem */
-#define LOG_UUCP (8<<3) /* UUCP subsystem */
-#define LOG_CRON (9<<3) /* clock daemon */
-#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
- /* Facility #10 clashes in DEC UNIX, where */
- /* it's defined as LOG_MEGASAFE for AdvFS */
- /* event logging. */
-#define LOG_FTP (11<<3) /* ftp daemon */
-#define LOG_NTP (12<<3) /* NTP subsystem */
-
- /* other codes through 15 reserved for system use */
-#define LOG_LOCAL0 (16<<3) /* reserved for local use */
-#define LOG_LOCAL1 (17<<3) /* reserved for local use */
-#define LOG_LOCAL2 (18<<3) /* reserved for local use */
-#define LOG_LOCAL3 (19<<3) /* reserved for local use */
-#define LOG_LOCAL4 (20<<3) /* reserved for local use */
-#define LOG_LOCAL5 (21<<3) /* reserved for local use */
-#define LOG_LOCAL6 (22<<3) /* reserved for local use */
-#define LOG_LOCAL7 (23<<3) /* reserved for local use */
-
-#define LOG_NFACILITIES 24 /* current number of facilities */
-#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
- /* facility of pri */
-#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
-
-#ifdef SYSLOG_NAMES
-CODE facilitynames[] = {
- { "auth", LOG_AUTH, },
- { "authpriv", LOG_AUTHPRIV, },
- { "cron", LOG_CRON, },
- { "daemon", LOG_DAEMON, },
- { "ftp", LOG_FTP, },
- { "kern", LOG_KERN, },
- { "lpr", LOG_LPR, },
- { "mail", LOG_MAIL, },
- { "mark", INTERNAL_MARK, }, /* INTERNAL */
- { "news", LOG_NEWS, },
- { "ntp", LOG_NTP, },
- { "security", LOG_AUTH, }, /* DEPRECATED */
- { "syslog", LOG_SYSLOG, },
- { "user", LOG_USER, },
- { "uucp", LOG_UUCP, },
- { "local0", LOG_LOCAL0, },
- { "local1", LOG_LOCAL1, },
- { "local2", LOG_LOCAL2, },
- { "local3", LOG_LOCAL3, },
- { "local4", LOG_LOCAL4, },
- { "local5", LOG_LOCAL5, },
- { "local6", LOG_LOCAL6, },
- { "local7", LOG_LOCAL7, },
- { NULL, -1, }
-};
-#endif
-
-#ifdef KERNEL
-#define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */
-#endif
-
-/*
- * arguments to setlogmask.
- */
-#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
-#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
-
-/*
- * Option flags for openlog.
- *
- * LOG_ODELAY no longer does anything.
- * LOG_NDELAY is the inverse of what it used to be.
- */
-#define LOG_PID 0x01 /* log the pid with each message */
-#define LOG_CONS 0x02 /* log on the console if errors in sending */
-#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
-#define LOG_NDELAY 0x08 /* don't delay open */
-#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
-#define LOG_PERROR 0x20 /* log to stderr as well */
-
-#ifdef KERNEL
-
-#else /* not KERNEL */
-
-#include <sys/cdefs.h>
-#include <stdarg.h>
-
-__BEGIN_DECLS
-void closelog __P((void));
-void openlog __P((const char *, int, int));
-int setlogmask __P((int));
-void syslog __P((int, const char *, ...));
-void vsyslog __P((int, const char *, va_list));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif
diff --git a/c/src/lib/libnetworking/sys/systm.h b/c/src/lib/libnetworking/sys/systm.h
deleted file mode 100644
index 7e14867e70..0000000000
--- a/c/src/lib/libnetworking/sys/systm.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/*-
- * Copyright (c) 1982, 1988, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)systm.h 8.7 (Berkeley) 3/29/95
- * $Id$
- */
-
-#ifndef _SYS_SYSTM_H_
-#define _SYS_SYSTM_H_
-
-#include <machine/cpufunc.h>
-
-extern int securelevel; /* system security level (see init(8)) */
-
-extern int cold; /* nonzero if we are doing a cold boot */
-extern const char *panicstr; /* panic message */
-extern char version[]; /* system version */
-extern char copyright[]; /* system copyright */
-
-extern int nblkdev; /* number of entries in bdevsw */
-extern int nchrdev; /* number of entries in cdevsw */
-extern struct swdevt *swdevt; /* swap-device information */
-extern int nswdev; /* number of swap devices */
-extern int nswap; /* size of swap space */
-
-extern int selwait; /* select timeout address */
-
-extern u_char curpriority; /* priority of current process */
-
-extern int physmem; /* physical memory */
-
-extern dev_t dumpdev; /* dump device */
-extern long dumplo; /* offset into dumpdev */
-
-extern dev_t rootdev; /* root device */
-extern struct vnode *rootvp; /* vnode equivalent to above */
-
-extern dev_t swapdev; /* swapping device */
-extern struct vnode *swapdev_vp;/* vnode equivalent to above */
-
-extern int boothowto; /* reboot flags, from console subsystem */
-extern int bootverbose; /* nonzero to print verbose messages */
-
-/*
- * General function declarations.
- */
-void Debugger __P((const char *msg));
-int nullop __P((void));
-int eopnotsupp __P((void));
-int einval __P((void));
-int seltrue __P((dev_t dev, int which, struct proc *p));
-int ureadc __P((int, struct uio *));
-void *hashinit __P((int count, int type, u_long *hashmask));
-void *phashinit __P((int count, int type, u_long *nentries));
-
-void panic __P((const char *, ...)) __dead2;
-void boot __P((int)) __dead2;
-void cpu_boot __P((int));
-void tablefull __P((const char *));
-int addlog __P((const char *, ...));
-int kvprintf __P((char const *, void (*)(int, void*), void *, int,
- _BSD_VA_LIST_));
-void log __P((int, const char *, ...));
-int printf __P((const char *, ...));
-int sprintf __P((char *buf, const char *, ...));
-void uprintf __P((const char *, ...));
-void ttyprintf __P((struct tty *, const char *, ...));
-
-#define bcopy(f,t,n) memcpy((t),(f),(n))
-#define bzero(p,n) memset((p),(0),(n))
-
-int copystr __P((const void *kfaddr, void *kdaddr, size_t len,
- size_t *lencopied));
-int copyinstr __P((const void *udaddr, void *kaddr, size_t len,
- size_t *lencopied));
-int copyin __P((const void *udaddr, void *kaddr, size_t len));
-int copyout __P((const void *kaddr, void *udaddr, size_t len));
-
-int fubyte __P((const void *base));
-int fuibyte __P((const void *base));
-int subyte __P((void *base, int byte));
-int suibyte __P((void *base, int byte));
-int fuword __P((const void *base));
-int suword __P((void *base, int word));
-int susword __P((void *base, int word));
-
-int hzto __P((struct timeval *tv));
-void realitexpire __P((void *));
-
-struct clockframe;
-void hardclock __P((struct clockframe *frame));
-void softclock __P((void));
-void statclock __P((struct clockframe *frame));
-
-void startprofclock __P((struct proc *));
-void stopprofclock __P((struct proc *));
-void setstatclockrate __P((int hzrate));
-
-void hardupdate __P((long));
-void hardpps __P((struct timeval *tvp, long usec));
-
-#include <sys/libkern.h>
-
-/* Initialize the world */
-extern void consinit(void);
-extern void usrinfoinit(void);
-extern void cpu_initclocks(void);
-extern void vntblinit(void);
-extern void nchinit(void);
-
-/* Finalize the world. */
-void shutdown_nice __P((void));
-
-/*
- * Kernel to clock driver interface.
- */
-void inittodr __P((time_t base));
-void resettodr __P((void));
-void startrtclock __P((void));
-
-/* Timeouts */
-typedef void (timeout_t)(void *); /* actual timeout function type */
-typedef timeout_t *timeout_func_t; /* a pointer to this type */
-
-void timeout(timeout_func_t, void *, int);
-void untimeout(timeout_func_t, void *);
-void logwakeup __P((void));
-
-/* Various other callout lists that modules might want to know about */
-/* shutdown callout list definitions */
-typedef void (*bootlist_fn)(int,void *);
-int at_shutdown(bootlist_fn function, void *arg, int);
-int rm_at_shutdown(bootlist_fn function, void *arg);
-#define SHUTDOWN_PRE_SYNC 0
-#define SHUTDOWN_POST_SYNC 1
-
-/* forking */ /* XXX not yet */
-typedef void (*forklist_fn)(struct proc *parent,struct proc *child,int flags);
-int at_fork(forklist_fn function);
-int rm_at_fork(forklist_fn function);
-
-/* exiting */
-typedef void (*exitlist_fn)(struct proc *procp);
-int at_exit(exitlist_fn function);
-int rm_at_exit(exitlist_fn function);
-
-/* Not exactly a callout LIST, but a callout entry.. */
-/* Allow an external module to define a hardware watchdog tickler */
-/* Normally a process would do this, but there are times when the */
-/* kernel needs to be able to hold off the watchdog, when the process */
-/* is not active, e.g. when dumping core. Costs us a whole 4 bytes to */
-/* make this generic. the variable is in kern_shutdown.c */
-typedef void (*watchdog_tickle_fn)(void);
-extern watchdog_tickle_fn wdog_tickler;
-
-
-/*
- * Common `proc' functions are declared here so that proc.h can be included
- * less often.
- */
-int tsleep __P((void *chan, int pri, char *wmesg, int timo));
-void wakeup __P((void *chan));
-
-#endif /* !_SYS_SYSTM_H_ */
diff --git a/c/src/lib/libnetworking/sys/ttycom.h b/c/src/lib/libnetworking/sys/ttycom.h
deleted file mode 100644
index f2e491bc50..0000000000
--- a/c/src/lib/libnetworking/sys/ttycom.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)ttycom.h 8.1 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_TTYCOM_H_
-#define _SYS_TTYCOM_H_
-
-#include <sys/ioccom.h>
-
-/*
- * Tty ioctl's except for those supported only for backwards compatibility
- * with the old tty driver.
- */
-
-/*
- * Window/terminal size structure. This information is stored by the kernel
- * in order to provide a consistent interface, but is not used by the kernel.
- */
-struct winsize {
- unsigned short ws_row; /* rows, in characters */
- unsigned short ws_col; /* columns, in characters */
- unsigned short ws_xpixel; /* horizontal size, pixels */
- unsigned short ws_ypixel; /* vertical size, pixels */
-};
-
-#define TIOCMODG _IOR('t', 3, int) /* get modem control state */
-#define TIOCMODS _IOW('t', 4, int) /* set modem control state */
-#define TIOCM_LE 0001 /* line enable */
-#define TIOCM_DTR 0002 /* data terminal ready */
-#define TIOCM_RTS 0004 /* request to send */
-#define TIOCM_ST 0010 /* secondary transmit */
-#define TIOCM_SR 0020 /* secondary receive */
-#define TIOCM_CTS 0040 /* clear to send */
-#define TIOCM_CAR 0100 /* carrier detect */
-#define TIOCM_CD TIOCM_CAR
-#define TIOCM_RNG 0200 /* ring */
-#define TIOCM_RI TIOCM_RNG
-#define TIOCM_DSR 0400 /* data set ready */
- /* 8-10 compat */
-#define TIOCEXCL _IO('t', 13) /* set exclusive use of tty */
-#define TIOCNXCL _IO('t', 14) /* reset exclusive use of tty */
- /* 15 unused */
-#define TIOCFLUSH _IOW('t', 16, int) /* flush buffers */
- /* 17-18 compat */
-#define TIOCGETA _IOR('t', 19, struct termios) /* get termios struct */
-#define TIOCSETA _IOW('t', 20, struct termios) /* set termios struct */
-#define TIOCSETAW _IOW('t', 21, struct termios) /* drain output, set */
-#define TIOCSETAF _IOW('t', 22, struct termios) /* drn out, fls in, set */
-#define TIOCGETD _IOR('t', 26, int) /* get line discipline */
-#define TIOCSETD _IOW('t', 27, int) /* set line discipline */
- /* 127-124 compat */
-#define TIOCSBRK _IO('t', 123) /* set break bit */
-#define TIOCCBRK _IO('t', 122) /* clear break bit */
-#define TIOCSDTR _IO('t', 121) /* set data terminal ready */
-#define TIOCCDTR _IO('t', 120) /* clear data terminal ready */
-#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */
-#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */
- /* 117-116 compat */
-#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
-#define TIOCSTI _IOW('t', 114, char) /* simulate terminal input */
-#define TIOCNOTTY _IO('t', 113) /* void tty association */
-#define TIOCPKT _IOW('t', 112, int) /* pty: set/clear packet mode */
-#define TIOCPKT_DATA 0x00 /* data packet */
-#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */
-#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */
-#define TIOCPKT_STOP 0x04 /* stop output */
-#define TIOCPKT_START 0x08 /* start output */
-#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */
-#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */
-#define TIOCPKT_IOCTL 0x40 /* state change of pty driver */
-#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
-#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
-#define TIOCMSET _IOW('t', 109, int) /* set all modem bits */
-#define TIOCMBIS _IOW('t', 108, int) /* bis modem bits */
-#define TIOCMBIC _IOW('t', 107, int) /* bic modem bits */
-#define TIOCMGET _IOR('t', 106, int) /* get all modem bits */
-#define TIOCREMOTE _IOW('t', 105, int) /* remote input editing */
-#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
-#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
-#define TIOCUCNTL _IOW('t', 102, int) /* pty: set/clr usr cntl mode */
-#define TIOCSTAT _IO('t', 101) /* simulate ^T status message */
-#define UIOCCMD(n) _IO('u', n) /* usr cntl op "n" */
-#define TIOCCONS _IOW('t', 98, int) /* become virtual console */
-#define TIOCSCTTY _IO('t', 97) /* become controlling tty */
-#define TIOCEXT _IOW('t', 96, int) /* pty: external processing */
-#define TIOCSIG _IO('t', 95) /* pty: generate signal */
-#define TIOCDRAIN _IO('t', 94) /* wait till output drained */
-#define TIOCMSDTRWAIT _IOW('t', 91, int) /* modem: set wait on close */
-#define TIOCMGDTRWAIT _IOR('t', 90, int) /* modem: get wait on close */
-#define TIOCTIMESTAMP _IOR('t', 89, struct timeval) /* enable/get timestamp
- * of last input event */
-#define TIOCDCDTIMESTAMP _IOR('t', 88, struct timeval) /* enable/get timestamp
- * of last DCd rise */
-#define TIOCSDRAINWAIT _IOW('t', 87, int) /* set ttywait timeout */
-#define TIOCGDRAINWAIT _IOR('t', 86, int) /* get ttywait timeout */
-#define TIOCDSIMICROCODE _IO('t', 85) /* download microcode to
- * DSI Softmodem */
-
-#define TTYDISC 0 /* termios tty line discipline */
-#define TABLDISC 3 /* tablet discipline */
-#define SLIPDISC 4 /* serial IP discipline */
-#define PPPDISC 5 /* PPP discipline */
-
-#endif /* !_SYS_TTYCOM_H_ */
diff --git a/c/src/lib/libnetworking/sys/ttydefaults.h b/c/src/lib/libnetworking/sys/ttydefaults.h
deleted file mode 100644
index 68f0ddbe77..0000000000
--- a/c/src/lib/libnetworking/sys/ttydefaults.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94
- * $Id$
- */
-
-/*
- * System wide defaults for terminal state.
- */
-#ifndef _SYS_TTYDEFAULTS_H_
-#define _SYS_TTYDEFAULTS_H_
-
-/*
- * Defaults on "first" open.
- */
-#define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY)
-#define TTYDEF_OFLAG (OPOST | ONLCR)
-#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
-#define TTYDEF_CFLAG (CREAD | CS8 | HUPCL)
-#define TTYDEF_SPEED (B9600)
-
-/*
- * Control Character Defaults
- */
-#define CTRL(x) (x&037)
-#define CEOF CTRL('d')
-#define CEOL 0xff /* XXX avoid _POSIX_VDISABLE */
-#define CERASE 0177
-#define CINTR CTRL('c')
-#define CSTATUS CTRL('t')
-#define CKILL CTRL('u')
-#define CMIN 1
-#define CQUIT 034 /* FS, ^\ */
-#define CSUSP CTRL('z')
-#define CTIME 0
-#define CDSUSP CTRL('y')
-#define CSTART CTRL('q')
-#define CSTOP CTRL('s')
-#define CLNEXT CTRL('v')
-#define CDISCARD CTRL('o')
-#define CWERASE CTRL('w')
-#define CREPRINT CTRL('r')
-#define CEOT CEOF
-/* compat */
-#define CBRK CEOL
-#define CRPRNT CREPRINT
-#define CFLUSH CDISCARD
-
-/* PROTECTED INCLUSION ENDS HERE */
-#endif /* !_SYS_TTYDEFAULTS_H_ */
-
-/*
- * #define TTYDEFCHARS to include an array of default control characters.
- */
-#ifdef TTYDEFCHARS
-static cc_t ttydefchars[NCCS] = {
- CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
- _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
- CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE
-};
-#undef TTYDEFCHARS
-#endif
diff --git a/c/src/lib/libnetworking/sys/ucred.h b/c/src/lib/libnetworking/sys/ucred.h
deleted file mode 100644
index d3899c3b4c..0000000000
--- a/c/src/lib/libnetworking/sys/ucred.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1989, 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.
- *
- * @(#)ucred.h 8.4 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _SYS_UCRED_H_
-#define _SYS_UCRED_H_
-
-/*
- * Credentials.
- */
-struct ucred {
- u_short cr_ref; /* reference count */
- uid_t cr_uid; /* effective user id */
- short cr_ngroups; /* number of groups */
- gid_t cr_groups[NGROUPS]; /* groups */
-};
-#define cr_gid cr_groups[0]
-#define NOCRED ((struct ucred *)0) /* no credential available */
-#define FSCRED ((struct ucred *)-1) /* filesystem credential */
-
-#ifdef KERNEL
-#define crhold(cr) (cr)->cr_ref++
-
-struct ucred *crcopy __P((struct ucred *cr));
-struct ucred *crdup __P((struct ucred *cr));
-void crfree __P((struct ucred *cr));
-struct ucred *crget __P((void));
-int suser __P((struct ucred *cred, u_short *acflag));
-int groupmember __P((gid_t gid, struct ucred *cred));
-#endif /* KERNEL */
-
-#endif /* !_SYS_UCRED_H_ */
diff --git a/c/src/lib/libnetworking/sys/uio.h b/c/src/lib/libnetworking/sys/uio.h
deleted file mode 100644
index 305941500d..0000000000
--- a/c/src/lib/libnetworking/sys/uio.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993, 1994
- * 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.
- *
- * @(#)uio.h 8.5 (Berkeley) 2/22/94
- * $Id$
- */
-
-#ifndef _SYS_UIO_H_
-#define _SYS_UIO_H_
-
-/*
- * XXX
- * iov_base should be a void *.
- */
-struct iovec {
- char *iov_base; /* Base address. */
- size_t iov_len; /* Length. */
-};
-
-enum uio_rw { UIO_READ, UIO_WRITE };
-
-/* Segment flag values. */
-enum uio_seg {
- UIO_USERSPACE, /* from user data space */
- UIO_SYSSPACE, /* from system space */
- UIO_USERISPACE, /* from user I space */
- UIO_NOCOPY /* don't copy, already in object */
-};
-
-#ifdef KERNEL
-struct uio {
- struct iovec *uio_iov;
- int uio_iovcnt;
- off_t uio_offset;
- int uio_resid;
- enum uio_seg uio_segflg;
- enum uio_rw uio_rw;
- struct proc *uio_procp;
-};
-
-/*
- * Limits
- */
-#define UIO_MAXIOV 1024 /* max 1K of iov's */
-#define UIO_SMALLIOV 8 /* 8 on stack, else malloc */
-#endif /* KERNEL */
-
-#ifdef KERNEL
-
-int uiomove __P((caddr_t, int, struct uio *));
-
-#else /* !KERNEL */
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-ssize_t readv __P((int, const struct iovec *, int));
-ssize_t writev __P((int, const struct iovec *, int));
-__END_DECLS
-
-#endif /* KERNEL */
-
-#endif /* !_SYS_UIO_H_ */
diff --git a/c/src/lib/libnetworking/syslog.h b/c/src/lib/libnetworking/syslog.h
deleted file mode 100644
index 6d223d00b7..0000000000
--- a/c/src/lib/libnetworking/syslog.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/syslog.h>
diff --git a/c/src/lib/libnetworking/vm/vm.h b/c/src/lib/libnetworking/vm/vm.h
deleted file mode 100644
index 19ea10e5eb..0000000000
--- a/c/src/lib/libnetworking/vm/vm.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 1991, 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.
- *
- * @(#)vm.h 8.2 (Berkeley) 12/13/93
- * $Id$
- */
-
-#ifndef VM_H
-#define VM_H
-
-typedef char vm_inherit_t; /* XXX: inheritance codes */
-typedef u_char vm_prot_t; /* protection codes */
-
-union vm_map_object;
-typedef union vm_map_object vm_map_object_t;
-
-struct vm_map_entry;
-typedef struct vm_map_entry *vm_map_entry_t;
-
-struct vm_map;
-typedef struct vm_map *vm_map_t;
-
-struct vm_object;
-typedef struct vm_object *vm_object_t;
-
-#ifndef KERNEL
-/*
- * This is defined in <sys/types.h> for the kernel so that non-vm kernel
- * sources (mainly Mach-derived ones such as ddb) don't have to include
- * vm stuff. Defining it there for applications might break things.
- * Define it here for "applications" that include vm headers (e.g.,
- * genassym).
- */
-typedef int boolean_t;
-
-/*
- * This is defined in <sys/types.h> for the kernel so that vnode_if.h
- * doesn't have to include <vm/vm.h>.
- */
-struct vm_page;
-typedef struct vm_page *vm_page_t;
-#endif
-
-#endif /* VM_H */
diff --git a/c/src/lib/libnetworking/vm/vm_extern.h b/c/src/lib/libnetworking/vm/vm_extern.h
deleted file mode 100644
index 720d42dc28..0000000000
--- a/c/src/lib/libnetworking/vm/vm_extern.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-
- * 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.
- *
- * @(#)vm_extern.h 8.2 (Berkeley) 1/12/94
- * $Id$
- */
-
-#ifndef _VM_EXTERN_H_
-#define _VM_EXTERN_H_
-
-struct buf;
-struct proc;
-struct vmspace;
-struct vmtotal;
-struct mount;
-struct vnode;
-
-#ifdef KERNEL
-
-#ifdef TYPEDEF_FOR_UAP
-int getpagesize __P((struct proc * p, void *, int *));
-int madvise __P((struct proc *, void *, int *));
-int mincore __P((struct proc *, void *, int *));
-int mprotect __P((struct proc *, void *, int *));
-int msync __P((struct proc *, void *, int *));
-int munmap __P((struct proc *, void *, int *));
-int obreak __P((struct proc *, void *, int *));
-int sbrk __P((struct proc *, void *, int *));
-int smmap __P((struct proc *, void *, int *));
-int sstk __P((struct proc *, void *, int *));
-int swapon __P((struct proc *, void *, int *));
-#endif
-
-void faultin __P((struct proc *p));
-int grow __P((struct proc *, u_int));
-int kernacc __P((caddr_t, int, int));
-vm_offset_t kmem_alloc __P((vm_map_t, vm_size_t));
-vm_offset_t kmem_alloc_pageable __P((vm_map_t, vm_size_t));
-vm_offset_t kmem_alloc_wait __P((vm_map_t, vm_size_t));
-void kmem_free __P((vm_map_t, vm_offset_t, vm_size_t));
-void kmem_free_wakeup __P((vm_map_t, vm_offset_t, vm_size_t));
-void kmem_init __P((vm_offset_t, vm_offset_t));
-vm_offset_t kmem_malloc __P((vm_map_t, vm_size_t, boolean_t));
-vm_map_t kmem_suballoc __P((vm_map_t, vm_offset_t *, vm_offset_t *, vm_size_t, boolean_t));
-void munmapfd __P((struct proc *, int));
-int pager_cache __P((vm_object_t, boolean_t));
-int swaponvp __P((struct proc *, struct vnode *, dev_t , u_long));
-void swapout_procs __P((void));
-int useracc __P((caddr_t, int, int));
-int vm_fault __P((vm_map_t, vm_offset_t, vm_prot_t, boolean_t));
-void vm_fault_copy_entry __P((vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t));
-void vm_fault_unwire __P((vm_map_t, vm_offset_t, vm_offset_t));
-int vm_fault_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
-int vm_fault_user_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
-int vm_fork __P((struct proc *, struct proc *));
-int vm_mmap __P((vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, caddr_t, vm_ooffset_t));
-vm_offset_t vm_page_alloc_contig __P((vm_offset_t, vm_offset_t, vm_offset_t, vm_offset_t));
-void vm_set_page_size __P((void));
-void vmmeter __P((void));
-struct vmspace *vmspace_alloc __P((vm_offset_t, vm_offset_t, int));
-struct vmspace *vmspace_fork __P((struct vmspace *));
-void vmspace_free __P((struct vmspace *));
-void vnode_pager_setsize __P((struct vnode *, vm_ooffset_t));
-void vnode_pager_umount __P((struct mount *));
-void vnode_pager_uncache __P((struct vnode *));
-void vslock __P((caddr_t, u_int));
-void vsunlock __P((caddr_t, u_int, int));
-void vm_object_print __P((/* db_expr_t */ int, boolean_t, /* db_expr_t */ int,
- char *));
-void vm_fault_quick __P((caddr_t v, int prot));
-
-#endif /* KERNEL */
-
-#endif /* !_VM_EXTERN_H_ */
diff --git a/c/src/lib/libnetworking/vm/vm_kern.h b/c/src/lib/libnetworking/vm/vm_kern.h
deleted file mode 100644
index b1e073dd3a..0000000000
--- a/c/src/lib/libnetworking/vm/vm_kern.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * The Mach Operating System project at Carnegie-Mellon University.
- *
- * 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.
- *
- * from: @(#)vm_kern.h 8.1 (Berkeley) 6/11/93
- *
- *
- * Copyright (c) 1987, 1990 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Authors: Avadis Tevanian, Jr., Michael Wayne Young
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- *
- * $Id$
- */
-
-#ifndef _VM_VM_KERN_H_
-#define _VM_VM_KERN_H_ 1
-
-/* Kernel memory management definitions. */
-extern vm_map_t buffer_map;
-extern vm_map_t kernel_map;
-extern vm_map_t kmem_map;
-extern vm_map_t mb_map;
-extern int mb_map_full;
-extern vm_map_t io_map;
-extern vm_map_t clean_map;
-extern vm_map_t phys_map;
-extern vm_map_t exec_map;
-extern vm_map_t u_map;
-
-extern vm_offset_t kernel_vm_end;
-
-#endif /* _VM_VM_KERN_H_ */
diff --git a/c/src/lib/libnetworking/vm/vm_param.h b/c/src/lib/libnetworking/vm/vm_param.h
deleted file mode 100644
index f1cfca98ec..0000000000
--- a/c/src/lib/libnetworking/vm/vm_param.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * The Mach Operating System project at Carnegie-Mellon University.
- *
- * 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.
- *
- * from: @(#)vm_param.h 8.1 (Berkeley) 6/11/93
- *
- *
- * Copyright (c) 1987, 1990 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Authors: Avadis Tevanian, Jr., Michael Wayne Young
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- *
- * $Id$
- */
-
-/*
- * Machine independent virtual memory parameters.
- */
-
-#ifndef _VM_PARAM_
-#define _VM_PARAM_
-
-#include <machine/vmparam.h>
-
-/*
- * The machine independent pages are refered to as PAGES. A page
- * is some number of hardware pages, depending on the target machine.
- */
-#define DEFAULT_PAGE_SIZE 4096
-
-#if 0
-
-/*
- * All references to the size of a page should be done with PAGE_SIZE
- * or PAGE_SHIFT. The fact they are variables is hidden here so that
- * we can easily make them constant if we so desire.
- */
-#ifndef PAGE_SIZE
-#define PAGE_SIZE cnt.v_page_size /* size of page */
-#endif
-#ifndef PAGE_MASK
-#define PAGE_MASK page_mask /* size of page - 1 */
-#endif
-#ifndef PAGE_SHIFT
-#define PAGE_SHIFT page_shift /* bits to shift for pages */
-#endif
-
-#endif
-
-#ifdef KERNEL
-extern vm_size_t page_mask;
-extern int page_shift;
-
-#endif
-
-/*
- * CTL_VM identifiers
- */
-#define VM_METER 1 /* struct vmmeter */
-#define VM_LOADAVG 2 /* struct loadavg */
-#define VM_V_FREE_MIN 3 /* cnt.v_free_min */
-#define VM_V_FREE_TARGET 4 /* cnt.v_free_target */
-#define VM_V_FREE_RESERVED 5 /* cnt.v_free_reserved */
-#define VM_V_INACTIVE_TARGET 6 /* cnt.v_inactive_target */
-#define VM_V_CACHE_MIN 7 /* cnt.v_cache_max */
-#define VM_V_CACHE_MAX 8 /* cnt.v_cache_min */
-#define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min */
-#define VM_PAGEOUT_ALGORITHM 10 /* pageout algorithm */
-#define VM_SWAPPING_ENABLED 11 /* swapping enabled */
-#define VM_MAXID 12 /* number of valid vm ids */
-
-#define CTL_VM_NAMES { \
- { 0, 0 }, \
- { "vmmeter", CTLTYPE_STRUCT }, \
- { "loadavg", CTLTYPE_STRUCT }, \
- { "v_free_min", CTLTYPE_INT }, \
- { "v_free_target", CTLTYPE_INT }, \
- { "v_free_reserved", CTLTYPE_INT }, \
- { "v_inactive_target", CTLTYPE_INT }, \
- { "v_cache_min", CTLTYPE_INT }, \
- { "v_cache_max", CTLTYPE_INT }, \
- { "v_pageout_free_min", CTLTYPE_INT}, \
- { "pageout_algorithm", CTLTYPE_INT}, \
- { "swapping_enabled", CTLTYPE_INT},\
-}
-
-/*
- * Return values from the VM routines.
- */
-#define KERN_SUCCESS 0
-#define KERN_INVALID_ADDRESS 1
-#define KERN_PROTECTION_FAILURE 2
-#define KERN_NO_SPACE 3
-#define KERN_INVALID_ARGUMENT 4
-#define KERN_FAILURE 5
-#define KERN_RESOURCE_SHORTAGE 6
-#define KERN_NOT_RECEIVER 7
-#define KERN_NO_ACCESS 8
-
-#ifndef ASSEMBLER
-/*
- * Convert addresses to pages and vice versa.
- * No rounding is used.
- */
-#ifdef KERNEL
-#define num_pages(x) \
- ((vm_offset_t)((((vm_offset_t)(x)) + PAGE_MASK) >> PAGE_SHIFT))
-
-extern vm_size_t mem_size; /* size of physical memory (bytes) */
-extern vm_offset_t first_addr; /* first physical page */
-extern vm_offset_t last_addr; /* last physical page */
-#endif /* KERNEL */
-#endif /* ASSEMBLER */
-#endif /* _VM_PARAM_ */
diff --git a/c/src/lib/libnetworking/wrapup/Makefile.in b/c/src/lib/libnetworking/wrapup/Makefile.in
deleted file mode 100644
index 55b9f618ed..0000000000
--- a/c/src/lib/libnetworking/wrapup/Makefile.in
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NET_PIECES=kern lib libc net netinet nfs rtems
-OBJS=$(foreach piece, $(NET_PIECES), ../$(piece)/$(ARCH)/*.o)
-LIB=$(ARCH)/libnetworking.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/lib/librtems++/Makefile.in b/c/src/lib/librtems++/Makefile.in
deleted file mode 100644
index c69c34790a..0000000000
--- a/c/src/lib/librtems++/Makefile.in
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=librtems++.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-CC_PIECES=rtemsEvent rtemsInterrupt rtemsMessageQueue rtemsSemaphore \
- rtemsStatusCode rtemsTask rtemsTimer
-CC_FILES=$(CC_PIECES:%=%.cc)
-CC_O_FILES=$(CC_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(CC_FILES)
-OBJS=$(CC_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(LIBC_DEFINES)
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
- $(INSTALL_VARIANT) -m 644 ${LIB} ${PROJECT_RELEASE}/lib
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
-
-
diff --git a/c/src/lib/librtems++/README b/c/src/lib/librtems++/README
deleted file mode 100644
index 65b0eb980e..0000000000
--- a/c/src/lib/librtems++/README
+++ /dev/null
@@ -1,266 +0,0 @@
-#
-# $Id$
-#
-
-RTEMS C++ Library
-=================
-
-The RTEMS C++ Library or librtems++ is a wrapper for the RTEMS API.
-The classes provide as close a match to the RTEMS C API, for
-performance, to share the existing C documentation as much as
-possible, and to allow easy tracking of any changes to the RTEMS C
-API.
-
-The C++ interface only uses RTEMS API calls. No external references
-or internal interfaces are used. This allows the classes to be used
-in separately compiled modules or applications which link to the RTEMS
-trap interface.
-
-(This is the goal, which has not quite been reached. The TOD macro for
-micro-seconds to ticks is used, and this uses an internal global RTEMS
-variable)
-
-The C++ interface does not deal with RTEMS initialisation or the
-device driver interface. The current view is these parts of a system
-are best handled in the current manner. This means BSP for
-initialisation and the C API for drivers.
-
-RTEMS C++ Classes
-=================
-
-The classes map to the managers of RTEMS.
-
-The methods have default values selected which try to fit most cases
-or follow the documented RTEMS default values. Moving from left to
-right the parameters become less used, allowing the defaults to be
-selected. An example is the scope parameter for most classes. This
-can be local or global. I assume that most RTEMS objects are local,
-therefore it has been made the last parameter.
-
-Inline methods have been used for methods which are commonly used in
-applications. This tries to add the minimum of overhead. For
-example, the methods to send or receive events are inline, while all
-methods for control of a task are not.
-
-The RTEMS types, enumerations, and defines are used. If a new type,
-enumeration or define is made it will map directly to the RTEMS
-equivalent. For example the enumeration Scope is defined for various
-classes which can be local or global. The elements of the enumeration
-are forced to the same value as the RTEMS values. An enumeration is
-used in this case to allow the compiler to type check a little
-better. It saves having to check only RTEMS_LOCAL or RTEMS_GLOBAL is
-passed as a parameter (I am not convinced this is really needed as the
-goal was to not define anything and to only use what RTEMS provided).
-
-Where possible the various parts of an option bit set, or mode can be
-controlled separately or controlled as a group. An example is the
-task mode. The RTEMS C API allows a set of modes to be modified at
-once. The TaskMode class allows this to occur, while also providing
-methods to control a single mode item.
-
-The name of an object is always passed as a string. The classes turn
-the string into a rtems_name variable. The string does not have to be
-nul character terminated.
-
-The RTEMS C API uses 'delete' to remove or kill an RTEMS object. This
-is a reserved word in C++, so the word 'destroy' is used instead.
-
-Calling the classes from interrupts follows the rules of RTEMS. An
-exception introduced by the class library is the last status code.
-There is only one last status code for each instance of the library's
-classes and it is not protected. This needs to be watched for. Maybe
-a better solution needs to be found, such as interrupt calls do not set
-the last status code.
-
-RTEMS objects created by the C++ library can be operated on by C code
-just as any other RTEMS object. If limitations exist they should be
-documented in under the class.
-
-RTEMS Object Ownership
-======================
-
-The concept of ownership of an object is not defined as part of the
-RTEMS C API. A piece of code executing as part a task can create a
-message queue. Another piece of code running as part of a different
-task can destroy the message queue. Correct behavior between the code
-that creates the message queue and the code which destroy's the
-message queue must be provided by the programmer.
-
-The librtems++ supports the concept of ownership of an RTEMS object.
-Only the C++ object that creates the RTEMS object can destroy it. A
-C++ object can connect to an existing RTEMS object and control it,
-how-ever it can not destroy it.
-
-Copy constructors and assignment operators are provided to in-force
-this rule.
-
-Ownership only applies to classes that create RTEMS objects. These
-classes contain a flag which signals ownership of the id.
-
-Timeouts
-========
-
-The timeout value is specified in micro-seconds. The classes turn the
-micro-second timeout value into ticks required by the RTEMS C API.
-
-This causes a problem for timeout values which are less than one tick.
-This case is tested for and the timeout value is set to one tick. All
-other cases round down to the nearest tick.
-
-Status Codes
-============
-
-All classes which form the C++ API are derived from the StatusCode
-class. This class provides a common method for handling the status
-code returned by RTEMS.
-
-The last returned status code is held in the StatusCode object. It
-can be queried directly, or as a boolean. You can also obtain an
-error string for the status code.
-
-The setting of a status code is restricted to derived classes.
-
-The last status code attribute of the class is only ever set to an
-RTEMS defined status code.
-
-Event Class
-===========
-
-The event class allows users to send and receive events to and from
-tasks.
-
-Events objects are by default connected the RTEMS_SELF task. A send
-or receive will operate on the task currently executing.
-
-An Event object can be connected to a task using the connect method.
-The name is the name of the task. Connection can also be achieved by
-using the copy constructor or assignment operator.
-
-Events can be sent to a task by specifying an RTEMS task id, or by
-passing a reference to a Task object.
-
-Interrupt Class
-===============
-
-The interrupt class allows a protected virtual method of a derived
-class to be an interrupt handler.
-
-You derive from this class and provide the handler method. The next
-interrupt after the vector is caught will cause the handler method to
-be entered.
-
-You can chain the interrupt by calling the chain method. If the old
-handler is not an instance of this class the chain is passed as "void
-(*)(void)". If it is an instance of this class, the handler method is
-directly called. (Chaining has not been tested)
-
-This class implements a table of pointers to the last instance to
-catch the interrupt. A static method of the class catches the
-interrupt and re-directs the interrupt to the instance in the table.
-The re-direct adds a additional virtual function call and return to
-the overhead of the interrupt. For a i386 type processor this is
-about 12 instructions including the function call entry.
-
-Message Queue Class
-===================
-
-The MessageQueue class allows message queue's to be created, or
-connected too. Only the creator can destroy a message queue.
-
-The class implements, sending, urgent sending, broadcast, flushing,
-and receiving.
-
-Semaphore Class
-===============
-
-The Semaphore class allows semaphores to be created, or connected
-too. Only the creator can destroy a semaphore.
-
-All types of semaphores can be created.
-
-(Not tested in the test code)
-
-Task Class
-==========
-
-The Task class allows tasks to be created, or connected too. Only the
-creator can destroy a task.
-
-If creating a task, derive from the Task class and provide the body
-method. The body method is the entry point for a task. When
-connecting to an existing task, no body method is required to be
-provided. It is how-ever required if you create a task. This is not
-enforced by the compiler, how-ever the default body will be entered,
-and it contains no code. The RTEMS default behaviour for a task that
-returns occurs.
-
-The mode of a task is controlled using the TaskMode class.
-
-The Task class allows you to start, restart, suspend, and resume a
-task. You can control the priority, and access the note-pad
-registers. The task can also be slept using the wake_after and
-wake_when methods.
-
-Currently the task argument is used to pass the 'this' pointer to the
-libraries default task body. The actual argument is held in the class
-instance and passed to the virtual body method. This means of passing
-the 'this' pointer through RTEMS to the default task body requires the
-actual task object to perform a restart call. This is not really the
-best solution to the problem. Another solution is to remove a notpad
-register, say 31 from the task and use it. This would mean any Task
-object could stop and restart a task how-ever a notpad register is
-lost. Any other ideas are welcome.
-
-Task Mode Class
-===============
-
-The TaskMode class allows you to query or change the mode of a task.
-The object only operates on the currently executing task.
-
-The standard flags defined in RTEMS are used.
-
-Methods are provided to operate on a group of modes which are required
-to be changed in a single operation. The mode and mask is specified
-by ORing the required flags as documented in the RTEMS manual.
-
-Methods are provided for accessing and controlling a specific mode.
-The returned value will only contain the requested mode's flags, and
-only the that mode will be changed when setting a mode.
-
-Timer Class
-===========
-
-The Timer class allows timers to be created. You cannot connect to an
-existing timer.
-
-You derive from the Timer class and provide the trigger method. This
-method is called when the timer triggers or times out.
-
-You can request a single shot timer using the fire_after or fire_when
-methods, or a periodic timer by calling the repeat_file_at method.
-
-You cannot copy timer objects.
-
-Contact
-=======
-Send any question to me Chris Johns at cjohns@plessey.com.au, or the RTEMS
-mailing list.
-
-To Do
-=====
-
-1) Develop a complete test suite (under way, cjohns@plessey.com.au).
-
-2) Complete wrapping the remaining RTEMS C API.
-
-3) Provide light weight cout/cerr/clog classes based on printf for
-embedded systems.
-
-4) Provide a memory serial class which maps the <</>> operators onto
-raw memory in network byte order independent of CPU byte order.
-
-5) Fix the Task class so any Task object can restart a task.
-
-6) Provide some frame work classes which allow actor type objects that
-start in an ordered manner.
-
diff --git a/c/src/lib/librtems++/rtemsEvent.cc b/c/src/lib/librtems++/rtemsEvent.cc
deleted file mode 100644
index a917f32836..0000000000
--- a/c/src/lib/librtems++/rtemsEvent.cc
+++ /dev/null
@@ -1,75 +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.
-
- ------------------------------------------------------------------------
-
- See header file.
-
- ------------------------------------------------------------------------
-*/
-
-#include <rtems++/rtemsEvent.h>
-
-/* ----
- rtemsEvent
-*/
-
-rtemsEvent::rtemsEvent(const char *name_str, rtems_unsigned32 node)
- : name(rtems_build_name('S', 'E', 'L', 'F')),
- id(RTEMS_SELF)
-{
- connect(name_str, node);
-}
-
-rtemsEvent::rtemsEvent(const rtemsEvent& event)
-{
- name = event.name;
- id = event.id;
-}
-
-rtemsEvent::rtemsEvent()
- : name(rtems_build_name('S', 'E', 'L', 'F')),
- id(RTEMS_SELF)
-{
-}
-
-rtemsEvent::~rtemsEvent()
-{
-}
-
-const rtemsEvent& rtemsEvent::operator=(const rtemsEvent& event)
-{
- name = event.name;
- id = event.id;
-
- return *this;
-}
-
-const rtems_status_code rtemsEvent::connect(const char *name_str,
- const rtems_unsigned32 node)
-{
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- set_status_code(rtems_task_ident(name, node, &id));
-
- if (unsuccessful())
- {
- name = rtems_build_name('S', 'E', 'L', 'F');
- id = RTEMS_SELF;
- }
-
- return last_status_code();
-}
diff --git a/c/src/lib/librtems++/rtemsInterrupt.cc b/c/src/lib/librtems++/rtemsInterrupt.cc
deleted file mode 100644
index 4cd5d9afa9..0000000000
--- a/c/src/lib/librtems++/rtemsInterrupt.cc
+++ /dev/null
@@ -1,115 +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.
-
- ------------------------------------------------------------------------
-
- See header file.
-
- ------------------------------------------------------------------------
-*/
-
-#include <rtems++/rtemsInterrupt.h>
-
-/* ----
- Interrupt Table
-
- This table is used to re-direct the call from RTEMS to a user
- object
-*/
-
-static rtemsInterrupt *interrupt_table[CPU_INTERRUPT_NUMBER_OF_VECTORS];
-
-// has the table been initialised
-static bool initialised = false;
-
-/* ----
- rtemsInterrupt
-*/
-
-rtemsInterrupt::rtemsInterrupt()
- : vector(0),
- caught(false),
- old_handler(0),
- old_interrupt(0)
-{
- if (!initialised)
- {
- for (rtems_vector_number vec = 0;
- vec < CPU_INTERRUPT_NUMBER_OF_VECTORS;
- vec++)
- {
- interrupt_table[vector] = 0;
- }
- initialised = true;
- }
-}
-
-rtemsInterrupt::~rtemsInterrupt()
-{
- release();
-}
-
-const rtems_status_code rtemsInterrupt::isr_catch(const rtems_vector_number vec)
-{
- if (vec >= CPU_INTERRUPT_NUMBER_OF_VECTORS)
- return set_status_code(RTEMS_INVALID_NUMBER);
-
- if (caught)
- return set_status_code(RTEMS_RESOURCE_IN_USE);
-
- old_interrupt = interrupt_table[vector];
- interrupt_table[vector] = this;
- vector = vec;
-
- set_status_code(rtems_interrupt_catch(redirector,
- vector,
- &old_handler));
-
- if (successful())
- caught = true;
- else
- {
- interrupt_table[vector] = old_interrupt;
- old_interrupt = 0;
- old_handler = 0;
- vector = 0;
- }
-
- return last_status_code();
-}
-
-const rtems_status_code rtemsInterrupt::release(void)
-{
- if (caught)
- {
- set_status_code(rtems_interrupt_catch(old_handler,
- vector,
- &old_handler));
-
- interrupt_table[vector] = old_interrupt;
- old_interrupt = 0;
- old_handler = 0;
- vector = 0;
- caught = false;
- }
- else
- set_status_code(RTEMS_SUCCESSFUL);
-
- return last_status_code();
-}
-
-void rtemsInterrupt::redirector(rtems_vector_number vector)
-{
- if (interrupt_table[vector])
- interrupt_table[vector]->handler();
-}
diff --git a/c/src/lib/librtems++/rtemsMessageQueue.cc b/c/src/lib/librtems++/rtemsMessageQueue.cc
deleted file mode 100644
index c3183dc2b0..0000000000
--- a/c/src/lib/librtems++/rtemsMessageQueue.cc
+++ /dev/null
@@ -1,165 +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.
-
- ------------------------------------------------------------------------
-
- See header file.
-
- ------------------------------------------------------------------------
-*/
-
-#include <string.h>
-#include <rtems++/rtemsMessageQueue.h>
-
-/* ----
- rtemsMessageQueue
-*/
-
-rtemsMessageQueue::rtemsMessageQueue(const char* mqname,
- const rtems_unsigned32 count,
- const rtems_unsigned32 max_message_size,
- const WaitMode wait_mode,
- const Scope scope)
- : name(0),
- owner(true),
- id(0)
-{
- strcpy(name_str, "NOID");
- create(mqname, count, max_message_size, wait_mode, scope);
-}
-
-rtemsMessageQueue::rtemsMessageQueue(const char *mqname,
- const rtems_unsigned32 node)
- : name(0),
- owner(false),
- id(0)
-{
- strcpy(name_str, "NOID");
- connect(mqname, node);
-}
-
-rtemsMessageQueue::rtemsMessageQueue(const rtemsMessageQueue& message_queue)
- : name(0),
- owner(false),
- id(0)
-{
- name = message_queue.name;
- strcpy(name_str, message_queue.name_str);
- id = message_queue.id;
-}
-
-rtemsMessageQueue::rtemsMessageQueue()
- : name(0),
- owner(false),
- id(0)
-{
- strcpy(name_str, "NOID");
-}
-
-rtemsMessageQueue::~rtemsMessageQueue()
-{
- destroy();
-}
-
-void rtemsMessageQueue::make_invalid()
-{
- strcpy(name_str, "NOID");
- name = 0;
- id = 0;
- owner = false;
-}
-
-const rtems_status_code rtemsMessageQueue::create(const char* mqname,
- const rtems_unsigned32 count,
- const rtems_unsigned32 max_message_size,
- const WaitMode wait_mode,
- const Scope scope)
-{
- if (id)
- return set_status_code(RTEMS_ILLEGAL_ON_SELF);
-
- owner = true;
-
- strcpy(name_str, " ");
- for (int c = 0; (c < 4) && (mqname[c] != '\0'); c++)
- name_str[c] = mqname[c];
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- set_status_code(rtems_message_queue_create(name,
- count,
- max_message_size,
- scope | wait_mode,
- &id));
-
- if (unsuccessful())
- {
- make_invalid();
- }
-
- return last_status_code();
-}
-
-const rtems_status_code rtemsMessageQueue::destroy()
-{
- if (id && owner)
- {
- set_status_code(rtems_message_queue_delete(id));
- make_invalid();
- }
- else
- set_status_code(RTEMS_NOT_OWNER_OF_RESOURCE);
-
- return last_status_code();
-}
-
-const rtemsMessageQueue& rtemsMessageQueue::operator=(const rtemsMessageQueue& message_queue)
-{
- if (!owner)
- {
- name = message_queue.name;
- strcpy(name_str, message_queue.name_str);
- id = message_queue.id;
- }
-
- return *this;
-}
-
-const rtems_status_code rtemsMessageQueue::connect(const char *mqname,
- const rtems_unsigned32 node)
-{
- if (id && owner)
- return set_status_code(RTEMS_UNSATISFIED);
-
- // change state to not owner
- owner = false;
-
- strcpy(name_str, " ");
- for (int c = 0; (c < 4) && (mqname[c] != '\0'); c++)
- name_str[c] = mqname[c];
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- set_status_code(rtems_message_queue_ident(name, node, &id));
-
- if (unsuccessful())
- {
- make_invalid();
- }
-
- return last_status_code();
-}
diff --git a/c/src/lib/librtems++/rtemsSemaphore.cc b/c/src/lib/librtems++/rtemsSemaphore.cc
deleted file mode 100644
index 5821612618..0000000000
--- a/c/src/lib/librtems++/rtemsSemaphore.cc
+++ /dev/null
@@ -1,175 +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.
-
- ------------------------------------------------------------------------
-
- See header file.
-
- ------------------------------------------------------------------------
-*/
-
-#include <string.h>
-#include <rtems++/rtemsSemaphore.h>
-
-/* ----
- rtemsSemaphore
-*/
-
-rtemsSemaphore::rtemsSemaphore(const char* sname,
- const Scope scope,
- const rtems_unsigned32 counter,
- const WaitMode wait_mode,
- const Type type,
- const Priority priority,
- const Ceiling ceiling,
- const rtems_task_priority priority_ceiling)
- : name(0),
- owner(true),
- id(0)
-{
- strcpy(name_str, "NOID");
- create(sname,
- scope,
- counter,
- wait_mode,
- type,
- priority,
- ceiling,
- priority_ceiling);
-}
-
-rtemsSemaphore::rtemsSemaphore(const char *sname, const rtems_unsigned32 node)
- : name(0),
- owner(false),
- id(0)
-{
- strcpy(name_str, "NOID");
- connect(sname, node);
-}
-
-rtemsSemaphore::rtemsSemaphore(const rtemsSemaphore& semaphore)
- : name(0),
- owner(false),
- id(0)
-{
- name = semaphore.name;
- strcpy(name_str, semaphore.name_str);
- id = semaphore.id;
-}
-
-rtemsSemaphore::rtemsSemaphore()
- : name(0),
- owner(false),
- id(0)
-{
- strcpy(name_str, "NOID");
-}
-
-rtemsSemaphore::~rtemsSemaphore()
-{
- destroy();
-}
-
-void rtemsSemaphore::make_invalid()
-{
- strcpy(name_str, "NOID");
- name = 0;
- id = 0;
- owner = false;
-}
-
-const rtems_status_code rtemsSemaphore::create(const char* sname,
- const Scope scope,
- const rtems_unsigned32 counter,
- const WaitMode wait_mode,
- const Type type,
- const Priority priority,
- const Ceiling ceiling,
- const rtems_task_priority priority_ceiling)
-{
- if (id)
- return set_status_code(RTEMS_ILLEGAL_ON_SELF);
-
- owner = true;
-
- strcpy(name_str, " ");
- for (int c = 0; (c < 4) && (sname[c] != '\0'); c++)
- name_str[c] = sname[c];
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- set_status_code(rtems_semaphore_create(name,
- counter,
- scope | wait_mode | type | priority | ceiling,
- priority_ceiling,
- &id));
-
- if (unsuccessful())
- {
- make_invalid();
- }
-
- return last_status_code();
-}
-
-const rtems_status_code rtemsSemaphore::destroy()
-{
- if (id && owner)
- {
- set_status_code(rtems_semaphore_delete(id));
- make_invalid();
- }
- else
- set_status_code(RTEMS_NOT_OWNER_OF_RESOURCE);
-
- return last_status_code();
-}
-
-const rtemsSemaphore& rtemsSemaphore::operator=(const rtemsSemaphore& semaphore)
-{
- if (!owner)
- {
- name = semaphore.name;
- id = semaphore.id;
- }
- return *this;
-}
-
-const rtems_status_code rtemsSemaphore::connect(const char *sname,
- const rtems_unsigned32 node)
-{
- if (id && owner)
- return set_status_code(RTEMS_UNSATISFIED);
-
- // change state to not owner
- owner = false;
-
- strcpy(name_str, " ");
- for (int c = 0; (c < 4) && (sname[c] != '\0'); c++)
- name_str[c] = sname[c];
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- set_status_code(rtems_semaphore_ident(name, node, &id));
-
- if (unsuccessful())
- {
- make_invalid();
- }
-
- return last_status_code();
-}
diff --git a/c/src/lib/librtems++/rtemsStatusCode.cc b/c/src/lib/librtems++/rtemsStatusCode.cc
deleted file mode 100644
index e8e3f965ba..0000000000
--- a/c/src/lib/librtems++/rtemsStatusCode.cc
+++ /dev/null
@@ -1,77 +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.
-
- ------------------------------------------------------------------------
-
- See header file.
-
- ------------------------------------------------------------------------
-*/
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- Status Code string table
-*/
-
-static char *status_strings[RTEMS_STATUS_CODES_LAST + 1] =
-{
- "RTEMS[00] successful completion",
- "RTEMS[01] task exitted, returned from a thread",
- "RTEMS[02] multiprocessing not configured",
- "RTEMS[03] invalid object name",
- "RTEMS[04] invalid object id",
- "RTEMS[05] too many",
- "RTEMS[06] timed out waiting",
- "RTEMS[07] object deleted while waiting",
- "RTEMS[08] specified size was invalid",
- "RTEMS[09] address specified is invalid",
- "RTEMS[10] number was invalid",
- "RTEMS[11] item has not been initialized",
- "RTEMS[12] resources still outstanding",
- "RTEMS[13] request not satisfied",
- "RTEMS[14] thread is in wrong state",
- "RTEMS[15] thread already in state",
- "RTEMS[16] illegal on calling thread",
- "RTEMS[17] illegal for remote object",
- "RTEMS[18] called from wrong environment",
- "RTEMS[19] invalid thread priority",
- "RTEMS[20] invalid date/time",
- "RTEMS[21] invalid node id",
- "RTEMS[22] directive not configured",
- "RTEMS[23] not owner of resource",
- "RTEMS[24] directive not implemented",
- "RTEMS[25] RTEMS inconsistency detected",
- "RTEMS[26] could not get enough memory"
-};
-
-/* ----
- StatusCode
-*/
-
-const char *rtemsStatusCode::last_status_string()
-{
- return status_string(last_status);
-}
-
-const char *rtemsStatusCode::status_string(rtems_status_code status_code)
-{
- // mapped from "rtems/rtems/status.h"
- if (status_code <= RTEMS_STATUS_CODES_LAST)
- {
- return status_strings[status_code];
- }
-
- return "unknown status code";
-}
-
diff --git a/c/src/lib/librtems++/rtemsTask.cc b/c/src/lib/librtems++/rtemsTask.cc
deleted file mode 100644
index 619f7d4071..0000000000
--- a/c/src/lib/librtems++/rtemsTask.cc
+++ /dev/null
@@ -1,288 +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.
-
- ------------------------------------------------------------------------
-
- See header file.
-
- ------------------------------------------------------------------------
-*/
-
-#include <string.h>
-#include <rtems++/rtemsTask.h>
-// include to allow it to be compiled
-#include <rtems++/rtemsTaskMode.h>
-
-/* ----
- rtemsTask
-*/
-
-rtemsTask::rtemsTask(const char* tname,
- const rtems_task_priority initial_priority,
- const rtems_unsigned32 stack_size,
- const rtems_mode preemption,
- const rtems_mode timeslice,
- const rtems_mode asr,
- const rtems_interrupt_level interrupt_level,
- const FloatingPoint floating_point,
- const Scope scope)
- : name(rtems_build_name('S', 'E', 'L', 'F')),
- owner(true),
- id(RTEMS_SELF),
- argument(0)
-{
- strcpy(name_str, "SELF");
- create(tname,
- initial_priority,
- stack_size,
- preemption,
- timeslice,
- asr,
- interrupt_level,
- floating_point,
- scope);
-}
-
-rtemsTask::rtemsTask(const char *tname, rtems_unsigned32 node)
- : name(rtems_build_name('S', 'E', 'L', 'F')),
- owner(false),
- id(RTEMS_SELF),
- argument(0)
-{
- strcpy(name_str, "SELF");
- connect(tname, node);
-}
-
-rtemsTask::rtemsTask(const rtemsTask& task)
- : name(rtems_build_name('S', 'E', 'L', 'F')),
- owner(false),
- id(RTEMS_SELF),
- argument(0)
-{
- name = task.name;
- strcpy(name_str, task.name_str);
- argument = task.argument;
- id = task.id;
-}
-
-rtemsTask::rtemsTask()
- : name(rtems_build_name('S', 'E', 'L', 'F')),
- owner(false),
- id(RTEMS_SELF),
- argument(0)
-{
- strcpy(name_str, "SELF");
-}
-
-rtemsTask::~rtemsTask()
-{
- destroy();
-}
-
-void rtemsTask::make_self()
-{
- strcpy(name_str, "SELF");
- name = rtems_build_name('S', 'E', 'L', 'F');
- id = RTEMS_SELF;
- owner = false;
-}
-
-const rtems_status_code rtemsTask::create(const char* tname,
- const rtems_task_priority initial_priority,
- const rtems_unsigned32 stack_size,
- const rtems_mode preemption,
- const rtems_mode timeslice,
- const rtems_mode asr,
- const rtems_interrupt_level interrupt_level,
- const FloatingPoint floating_point,
- const Scope scope)
-{
- if (id)
- return set_status_code(RTEMS_ILLEGAL_ON_SELF);
-
- owner = true;
-
- strcpy(name_str, " ");
- for (int c = 0; (c < 4) && (tname[c] != '\0'); c++)
- name_str[c] = tname[c];
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- // protect the values that be set as the parameters are not enums
- set_status_code(rtems_task_create(name,
- initial_priority,
- stack_size,
- (preemption & RTEMS_PREEMPT_MASK) |
- (timeslice & RTEMS_TIMESLICE_MASK) |
- (asr & RTEMS_ASR_MASK) |
- (interrupt_level & RTEMS_INTERRUPT_MASK),
- floating_point | scope,
- &id));
-
- if (unsuccessful())
- {
- make_self();
- }
-
- return last_status_code();
-}
-
-const rtems_status_code rtemsTask::destroy()
-{
- if (id && owner)
- {
- set_status_code(rtems_task_delete(id));
- make_self();
- }
- else
- set_status_code(RTEMS_NOT_OWNER_OF_RESOURCE);
-
- return last_status_code();
-}
-
-const rtemsTask& rtemsTask::operator=(const rtemsTask& task)
-{
- if (!owner)
- {
- name = task.name;
- strcpy(name_str, task.name_str);
- argument = task.argument;
- id = task.id;
- }
- return *this;
-}
-
-const rtems_status_code rtemsTask::connect(const char *sname,
- const rtems_unsigned32 node)
-{
- if (id && owner)
- return set_status_code(RTEMS_UNSATISFIED);
-
- // change state to not owner
- owner = false;
-
- strcpy(name_str, " ");
- for (int c = 0; (c < 4) && (sname[c] != '\0'); c++)
- name_str[c] = sname[c];
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- set_status_code(rtems_task_ident(name, node, &id));
-
- if (unsuccessful())
- {
- make_self();
- }
-
- return last_status_code();
-}
-
-const rtems_status_code rtemsTask::start(const rtems_task_argument arg)
-{
- if (owner)
- {
- argument = arg;
- // pass the this pointer as the argument
- set_status_code(rtems_task_start(id,
- origin,
- (rtems_task_argument) this));
- }
- else
- set_status_code(RTEMS_NOT_OWNER_OF_RESOURCE);
- return last_status_code();
-}
-
-const rtems_status_code rtemsTask::restart(const rtems_task_argument arg)
-{
- if (owner)
- {
- argument = arg;
- set_status_code(rtems_task_restart(id, (rtems_task_argument) this));
- }
- else
- set_status_code(RTEMS_NOT_OWNER_OF_RESOURCE);
-
- return last_status_code();
-}
-
-const rtems_status_code rtemsTask::suspend()
-{
- return set_status_code(rtems_task_suspend(id));
-}
-
-const rtems_status_code rtemsTask::resume()
-{
- return set_status_code(rtems_task_resume(id));
-}
-
-const rtems_status_code rtemsTask::wake_after(const rtems_interval micro_secs)
-{
- rtems_interval usecs =
- micro_secs && (micro_secs < _TOD_Microseconds_per_tick) ?
- _TOD_Microseconds_per_tick : micro_secs;
- return set_status_code(rtems_task_wake_after(TOD_MICROSECONDS_TO_TICKS(usecs)));
-}
-
-const rtems_status_code rtemsTask::wake_when(const rtems_time_of_day& tod)
-{
- return set_status_code(rtems_task_wake_when((rtems_time_of_day*) &tod));
-}
-
-const rtems_status_code rtemsTask::get_priority(rtems_task_priority& priority)
-{
- return set_status_code(rtems_task_set_priority(id,
- RTEMS_CURRENT_PRIORITY,
- &priority));
-}
-
-const rtems_status_code rtemsTask::set_priority(const rtems_task_priority priority)
-{
- rtems_task_priority old_priority;
- return set_status_code(rtems_task_set_priority(id,
- priority,
- &old_priority));
-}
-
-const rtems_status_code rtemsTask::set_priority(const rtems_task_priority priority,
- rtems_task_priority& old_priority)
-{
- return set_status_code(rtems_task_set_priority(id,
- priority,
- &old_priority));
-}
-
-const rtems_status_code rtemsTask::get_note(const rtems_unsigned32 notepad,
- rtems_unsigned32& note)
-{
- return set_status_code(rtems_task_get_note(id, notepad, &note));
-}
-
-const rtems_status_code rtemsTask::set_note(const rtems_unsigned32 notepad,
- const rtems_unsigned32 note)
-{
- return set_status_code(rtems_task_set_note(id, notepad, note));
-}
-
-void rtemsTask::body(rtems_task_argument )
-{
-}
-
-rtems_task rtemsTask::origin(rtems_task_argument argument)
-{
- rtemsTask *task = (rtemsTask*) argument;
- task->body(task->argument);
-}
diff --git a/c/src/lib/librtems++/rtemsTimer.cc b/c/src/lib/librtems++/rtemsTimer.cc
deleted file mode 100644
index 835bfd74ce..0000000000
--- a/c/src/lib/librtems++/rtemsTimer.cc
+++ /dev/null
@@ -1,101 +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.
-
- ------------------------------------------------------------------------
-
- See header file.
-
- ------------------------------------------------------------------------
-*/
-
-#include <string.h>
-#include <rtems++/rtemsTimer.h>
-
-/* ----
- rtemsTimer
-*/
-
-rtemsTimer::rtemsTimer(const char* tname)
- : name(0),
- repeat(false),
- id(0)
-{
- strcpy(name_str, " ");
- create(tname);
-}
-
-rtemsTimer::rtemsTimer()
- : name(0),
- repeat(false),
- id(0)
-{
- strcpy(name_str, " ");
-}
-
-rtemsTimer::~rtemsTimer()
-{
- destroy();
-}
-
-void rtemsTimer::make_invalid()
-{
- strcpy(name_str, " ");
- name = 0;
- id = 0;
- repeat = false;
-}
-const rtems_status_code rtemsTimer::create(const char* tname)
-{
- if (id)
- return set_status_code(RTEMS_ILLEGAL_ON_SELF);
-
- strcpy(name_str, " ");
- for (int c = 0; (c < 4) && (tname[c] != '\0'); c++)
- name_str[c] = tname[c];
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- set_status_code(rtems_timer_create(name, &id));
-
- if (unsuccessful())
- {
- make_invalid();
- }
-
- return last_status_code();
-}
-
-const rtems_status_code rtemsTimer::destroy()
-{
- if (id)
- {
- set_status_code(rtems_timer_delete(id));
- make_invalid();
- }
- else
- set_status_code(RTEMS_NOT_OWNER_OF_RESOURCE);
-
- return last_status_code();
-}
-
-void rtemsTimer::common_handler(rtems_id , void *user_data)
-{
- rtemsTimer *timer = (rtemsTimer*) user_data;
-
- if (timer->repeat)
- timer->reset();
-
- timer->triggered();
-}
diff --git a/c/src/lib/start/Makefile.in b/c/src/lib/start/Makefile.in
deleted file mode 100644
index 5c974036b3..0000000000
--- a/c/src/lib/start/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=$(wildcard $(RTEMS_CPU))
diff --git a/c/src/lib/start/README b/c/src/lib/start/README
deleted file mode 100644
index 52556d4bb1..0000000000
--- a/c/src/lib/start/README
+++ /dev/null
@@ -1,10 +0,0 @@
-$Id$
-
-For each processor there may be some start up code
-(like crt.o) in the appropriate entry subdirectory. This
-entry code transfers control to target board specific
-code).
-
-For some processors this code exists in some external (to RTEMS)
-library such as libgloss or the host system (for example the hppa1.1
-and UNIX cpu's)
diff --git a/c/src/lib/start/a29k/Makefile.in b/c/src/lib/start/a29k/Makefile.in
deleted file mode 100644
index f89c5a7e6f..0000000000
--- a/c/src/lib/start/a29k/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=crt0 register
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-PGM=${ARCH}/crt0.o ${ARCH}/register.o
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/start/a29k/amd.ah b/c/src/lib/start/a29k/amd.ah
deleted file mode 100644
index 69f34f173e..0000000000
--- a/c/src/lib/start/a29k/amd.ah
+++ /dev/null
@@ -1,517 +0,0 @@
-; /* @(#)amd.ah 1.1 96/05/23 08:56:58, TEI */
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Initialization values for registers after RESET
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; /* $Id$ */
-;
-;* File information and includes.
-
- .file "amd.ah"
- .ident "@(#)amd.ah 1.1 96/05/23 08:56:58, TEI"
-
-
-
-;
-;* AMD PROCESSOR SPECIFIC VALUES...
-;
-
-;
-;* Processor revision levels...
-;
-
-; PRL values: 31-28 27-24
-; Am29000 0 x
-; Am29005 1 x
-; Am29050 2 x
-; Am29035 3 x
-; Am29030 4 x
-; Am29200 5 x
-; Am29205 5 1x
-; Am29240 6 0
-; Manx 7 0
-; Cougar 8 0
-
-
- .equ AM29000_PRL, 0x00
-
- .equ AM29005_PRL, 0x10
-
- .equ AM29050_PRL, 0x20
-
- .equ AM29035_PRL, 0x30
-
- .equ AM29030_PRL, 0x40
-
- .equ AM29200_PRL, 0x50
-
- .equ AM29205_PRL, 0x58
-
- .equ AM29240_PRL, 0x60
-
- .equ AM29040_PRL, 0x70
-
- .equ MANX_PRL, 0x70
-
- .equ COUGAR_PRL, 0x80
-
-;
-;* data structures sizes.
-;
- .equ CFGINFO_SIZE, 16*4
-
- .equ PGMINFO_SIZE, 16*4
-
- .equ VARARGS_SPACE, 16*4
-
- .equ WINDOWSIZE, 0x80
-;
-;* Am29027 Mode registers
-;
-
- .equ Am29027Mode1, 0x0fc00820
-
- .equ Am29027Mode2, 0x00001375
-
-
-
-;* Processor Based Equates and Defines
-
- .equ SIG_SYNC, -1
-
- .equ ENABLE, (SM)
-
- .equ DISABLE, (ENABLE | DI | DA)
-
- .equ DISABLE_FZ, (FZ | ENABLE | DI | DA)
-
- .equ CLR_TRAP, (FZ | DA)
-
- .equ InitOPS, (TD | SM | (3<<IMShift) | DI | DA)
-
- .equ InitCPS, (TD | SM | (0<<IMShift) | DI | DA)
-
- .equ InitCPS1, (TD | SM | (0<<IMShift) | DI )
-
- .equ CPS_TMR, (SM | (0<<IMShift) | DI)
-
- .equ CPS_INT0, (TD | SM | (0<<IMShift))
-
- .equ CPS_TMRINT0, (SM | (0<<IMShift))
-
- .equ InitCFG, 0x0
-
- .equ InitRBP, (B0|B1|B2|B3|B4|B5)
-
- .equ TMC_VALUE, 0xFFFFFF
-
- .equ TMR_VALUE, (IE | TMC_VALUE)
-
-
-
-
-
-
-;* 29205 specific (internal) peripheral initialization constants.
-
-; Current Processor Status (CPS) Register.
-; Old Processor Status Register (OPS).
-
- .equ DA, 0x00001
- .equ DI, 0x00002
- .equ IMShift,0x2
- .equ SM, 0x00010
- .equ PI, 0x00020
- .equ PD, 0x00040
- .equ WM, 0x00080
- .equ RE, 0x00100
- .equ LK, 0x00200
- .equ FZ, 0x00400
- .equ TU, 0x00800
- .equ TP, 0x01000
- .equ TE, 0x02000
- .equ IP, 0x04000
- .equ CA, 0x08000
- .equ MM, 0x10000
- .equ TD, 0x20000
-
-; Configuration Register (CFG)
-
- .equ CD, 0x01
- .equ CP, 0x02
- .equ BO, 0x04
- .equ RV, 0x08
- .equ VF, 0x10
- .equ DW, 0x20
- .equ CO, 0x40
- .equ EE, 0x80
- .equ IDShift, 8
- .equ CFG_ID, 0x100
- .equ ILShift, 9
- .equ CFG_ILMask, 0x600
- .equ DDShift, 11
- .equ CFG_DD, 0x800
- .equ DLShift, 12
- .equ CFG_DLMask, 0x3000
- .equ PCEShift, 14
- .equ CFG_PCE, 0x4000
- .equ PMBShift, 16
- .equ D16, 0x8000
- .equ TBOShift, 23
- .equ PRLShift, 24
-
-; Channel Control Register (CHC)
-
- .equ CV, 0x1
- .equ NN, 0x2
- .equ TRShift, 2
- .equ TF, 0x400
- .equ PER, 0x800
- .equ LA, 0x1000
- .equ ST, 0x2000
- .equ ML, 0x4000
- .equ LS, 0x8000
- .equ CRShift, 16
- .equ CNTLShift, 24
- .equ CEShift, 31
- .equ WBERShift, 31
-
-; Register Bank Protect (RBP)
- .equ B0, 0x1
- .equ B1, 0x2
- .equ B2, 0x4
- .equ B3, 0x8
- .equ B4, 0x10
- .equ B5, 0x20
- .equ B6, 0x40
- .equ B7, 0x80
- .equ B8, 0x100
- .equ B9, 0x200
- .equ B10, 0x400
- .equ B11, 0x800
- .equ B12, 0x1000
- .equ B13, 0x2000
- .equ B14, 0x4000
- .equ B15, 0x8000
-
-; Timer Counter
-
- .equ TCVMask, 0xffffff
-
-; Timer Reload Register
-
- .equ IE, 0x1000000
- .equ IN, 0x2000000
- .equ OV, 0x4000000
- .equ TRVMAsk, 0xffffff
-
-; MMU Configuration
-
- .equ PSShift, 8
- .equ PS0Shift, 8
- .equ PS1Shift, 12
-
-; LRU Recommendation (LRU)
- .equ LRUMask, 0xff
-
-; Reason Vector (RSN)
- .equ RSNMask, 0xff
-
-; Region Mapping Address (RMA0 | RMA1)
- .equ PBAMask,0xffff
- .equ VBAShift, 16
-
-; Region Mapping Control (RMC0 | RMC1)
- .equ TIDMask, 0xff
- .equ RMC_UE, 0x100
- .equ RMC_UW, 0x200
- .equ RMC_UR, 0x400
- .equ RMC_SE, 0x800
- .equ RMC_SW, 0x1000
- .equ RMC_SR, 0x2000
- .equ RMC_VE, 0x4000
- .equ RMC_IO, 0x10000
- .equ RGSShift, 17
- .equ RMC_PGMShift, 22
-
-; Instruction breakpoint Control (IBC0 | IBC1)
- .equ BPIDMask, 0xff
- .equ BTE, 0x100
- .equ BRM, 0x200
- .equ IBC_BSY, 0x400
- .equ BEN, 0x800
- .equ BHO, 0x1000
-
-; Cache Data Register (CDR)
- .equ CDR_US, 0x1
- .equ P, 0x2
- .equ CDR_V, 0x4
- .equ IATAGShift, 20
-
-; Cache Interface Register (CIR)
- .equ CPTRShift, 2
- .equ CIR_RW, 0x1000000
- .equ FSELShift, 28
-
-; Indirect Pointer A, B, C (IPA, IPB, IPC)
- .equ IPShift, 2
-
-; ALU Status (ALU)
- .equ FCMask, 0x1F
- .equ BPShift, 5
- .equ C, 0x80
- .equ Z, 0x100
- .equ N, 0x200
- .equ ALU_V, 0x400
- .equ DF, 0x800
-
-; Byte Pointer
- .equ BPMask, 0x3
-
-; Load/Store Count Remaining (CR)
- .equ CRMask, 0xff
-
-; Floating Point Environment (FPE)
- .equ NM, 0x1
- .equ RM, 0x2
- .equ VM, 0x4
- .equ UM, 0x8
- .equ XM, 0x10
- .equ DM, 0x20
- .equ FRMShift, 6
- .equ FF, 0x100
- .equ ACFShift, 9
-
-; Integer Environment (INTE)
- .equ MO, 0x1
- .equ DO, 0x2
-
-; Floating Point Status (FPS)
- .equ NS, 0x1
- .equ RS, 0x2
- .equ VS, 0x4
- .equ FPS_US, 0x8
- .equ XS, 0x10
- .equ DS, 0x20
- .equ NT, 0x100
- .equ RT, 0x200
- .equ VT, 0x400
- .equ UT, 0x800
- .equ XT, 0x1000
- .equ DT, 0x2000
-
-; Exception Opcode (EXOP)
- .equ IOPMask, 0xff
-
-; TLB Entry Word 0
-; .equ TIDMask, 0xff already defined above
- .equ TLB_UE, 0x100
- .equ TLB_UW, 0x200
- .equ TLB_UR, 0x400
- .equ TLB_SE, 0x800
- .equ TLB_SW, 0x1000
- .equ TLB_SR, 0x2000
- .equ TLB_VE, 0x4000
- .equ VTAGShift, 15
-
-; TLB Entry Word 1
- .equ TLB_IO, 0x1
- .equ U, 0x2
- .equ TLB_PGMShift, 6
- .equ RPNShift, 10
-
-; Am29200 ROM Control bits.
- .equ RMCT_DW0Shift, 29
- .equ RMCT_DW1Shift, 21
- .equ RMCT_DW2Shift, 13
- .equ RMCT_DW3Shift, 5
-
-; Am29200 DRAM Control bits.
- .equ DW3, (1<<18)
- .equ DW2, (1<<22)
- .equ DW1, (1<<26)
- .equ DW0, (1<<30)
-
- ; Internal peripheral address assignments.
- .equ RMCT, 0x80000000
- .equ RMCF, 0x80000004
- .equ DRCT, 0x80000008
- .equ DRCF, 0x8000000C
- .equ DRM0, 0x80000010
- .equ DRM1, 0x80000014
- .equ DRM2, 0x80000018
- .equ DRM3, 0x8000001C
- .equ PIACT0, 0x80000020
- .equ PIACT1, 0x80000020
- .equ ICT, 0x80000028
- .equ DMCT0, 0x80000030
- .equ DMAD0, 0x80000034
- .ifdef revA
- .equ TAD0, 0x80000036
- .equ TCN0, 0x8000003A
- .else
- .equ TAD0, 0x80000070 ; default
- .equ TCN0, 0x8000003C ; default
- .endif
- .equ DMCN0, 0x80000038
- .equ DMCT1, 0x80000040
- .equ DMAD1, 0x80000044
- .equ DMCN1, 0x80000048
- .equ SPCT, 0x80000080
- .equ SPST, 0x80000084
- .equ SPTH, 0x80000088
- .equ SPRB, 0x8000008C
- .equ BAUD, 0x80000090
- .equ PPCT, 0x800000C0
- .equ PPST, 0x800000C1
- .equ PPDT, 0x800000C4
- .equ POCT, 0x800000D0
- .equ PIN, 0x800000D4
- .equ POUT, 0x800000D8
- .equ POEN, 0x800000DC
- .equ VCT, 0x800000E0
- .equ TOP, 0x800000E4
- .equ SIDE, 0x800000E8
- .equ VDT, 0x800000EC
-
- ; Interrupt Controller Register bits.
- .equ TXDI, (1<<5)
- .equ RXDI, (1<<6)
- .equ RXSI, (1<<7)
- .equ PPI, (1<<11)
- .equ DMA1I, (1<<13)
- .equ DMA0I, (1<<14)
- .equ IOPIMask, (0xFF<<16)
- .equ VDI, (1<<27)
- .equ ICT200_I, (TXDI|RXDI|RXSI|PPI|DMA1I|DMA0I|IOPIMask|VDI)
- .equ ICT205_I, (TXDI|RXDI|RXSI|PPI|DMA1I|DMA0I|IOPIMask|VDI)
-
- ; Serial port Initialization bits
- .equ NO_PARITY, 0
-
-
- ; SPST bits
- .equ THREShift, 22
-
-;* REGISTER Addresses
-
- .equ ROMCntlRegAddr, 0x80000000
-
- .equ ROMCfgRegAddr, 0x80000004
-
- .equ DRAMCntlRegAddr, 0x80000008
-
- .equ DRAMCfgRegAddr, 0x8000000C
-
- .equ DRAMMap0RegAddr, 0x80000010
-
- .equ DRAMMap1RegAddr, 0x80000014
-
- .equ DRAMMap2RegAddr, 0x80000018
-
- .equ DRAMMap3RegAddr, 0x8000001C
-
- .equ PIACntl0RegAddr, 0x80000020
-
- .equ PIACntl1RegAddr, 0x80000024
-
- .equ INTRCntlRegAddr, 0x80000028
-
- .equ DMACntl0RegAddr, 0x80000030
-
- .equ DMACntl1RegAddr, 0x80000040
-
- .equ SERPortCntlRegAddr, 0x80000080
-
- .equ SERPortStatRegAddr, 0x80000084
-
- .equ SERPortTHLDRegAddr, 0x80000088
-
- .equ SERPortRbufRegAddr, 0x8000008C
-
- .equ SERPortBaudRegAddr, 0x80000090
-
- .equ PARPortCntlRegAddr, 0x800000C0
-
- .equ PIOCntlRegAddr, 0x800000D0
-
- .equ PIOInpRegAddr, 0x800000D4
-
- .equ PIOOutRegAddr, 0x800000D8
-
- .equ PIOOutEnaRegAddr, 0x800000DC
-
- .equ VCTCntlRegAddr, 0x800000E0
-
-;
-;* Control constants
-;
-
-;* AM29030 Timer related constants.
-
- .equ TMR_IE, 0x01000000
-
- .equ TMR_IN, 0x02000000
-
- .equ TMR_OV, 0x04000000
-
- .equ TMC_INITCNT, 1613
-
-;
-;* System initialization values.
-;
-
- .equ __os_version, 0x0001 ;
-
- .equ STACKSize, 0x8000 ;
-
- .equ PGMExecMode, 0x0000 ;
-
- .equ TSTCK_OFST, 28 * 4
-
- .equ CSTCK_OFST, 29 * 4
-
- .equ TMSTCK_OFST, 30 * 4
-
- .equ CMSTCK_OFST, 31 * 4
-
- .equ CTXSW_OK, 0xA55A ; ctx switch ok
-
- .set NV_STARTOFST, 0x20 ; 32 bytes
-
- .set NV_BAUDOFST, 0x00 ; 00 bytes
-
- .set reg_cir, 29
-
- .set reg_cdr, 30
-
- .equ MSG_BUFSIZE, 0x1000 ; serial buffer size
-
- .equ ILLOPTRAP, 0
-
- .equ UATRAP, 1
-
- .equ PVTRAP, 5
-
- .equ UITLBMISSTRAP, 8
-
- .equ UDTLBMISSTRAP, 9
-
- .equ TIMERTRAP, 14
-
- .equ TRACETRAP, 15
-
- .equ XLINXTRAP, 16
-
- .equ SERIALTRAP, 17
-
- .equ SLOWTMRTRAP, 18
-
- .equ PORTTRAP, 19
-
- .equ SVSCTRAP, 80
-
- .equ SVSCTRAP1, 81
-
- .equ V_CACHETRAP, 66 ;
-
- .equ V_SETSERVICE, 67 ;
diff --git a/c/src/lib/start/a29k/crt0.s b/c/src/lib/start/a29k/crt0.s
deleted file mode 100644
index 017f2d4cca..0000000000
--- a/c/src/lib/start/a29k/crt0.s
+++ /dev/null
@@ -1,288 +0,0 @@
-; @(#)crt0.s 1.3 96/05/31 14:40:27, AMD
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Copyright 1988, 1989, 1990 Advanced Micro Devices, Inc.
-;
-; This software is the property of Advanced Micro Devices, Inc (AMD) which
-; specifically grants the user the right to modify, use and distribute this
-; software provided this notice is not removed or altered. All other rights
-; are reserved by AMD.
-;
-; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
-; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
-; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
-; USE OF THIS SOFTWARE.
-;
-; So that all may benefit from your experience, please report any problems
-; or suggestions about this software to the 29K Technical Support Center at
-; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
-; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
-;
-; Advanced Micro Devices, Inc.
-; 29K Support Products
-; Mail Stop 573
-; 5900 E. Ben White Blvd.
-; Austin, TX 78741
-; 800-292-9263
-;
-; /* $Id$ */
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- .file "crt0.s"
-
-; crt0.s version 3.3-0
-;
-; This module gets control from the OS.
-; It saves away the Am29027 Mode register settings and
-; then sets up the pointers to the resident spill and fill
-; trap handlers. It then establishes argv and argc for passing
-; to main. It then calls _main. If main returns, it calls _exit.
-;
-; void = start( );
-; NOTE - not C callable (no lead underscore)
-;
- .include "sysmac.h"
-;
-;
- .extern V_SPILL, V_FILL
-; .comm __29027Mode, 8 ; A shadow of the mode register
- .comm __LibInit, 4
-
- .text
- .extern _main, _exit, _atexit
-
- .word 0 ; Terminating tag word
- .global start
-start:
- sub gr1, gr1, 6 * 4
- asgeu V_SPILL, gr1, rab ; better not ever happen
- add lr1, gr1, 6 * 4
-
-;
-; Save the initial value of the Am29027's Mode register
-;
-; If your system does not enter crt0 with value for Am29027's Mode
-; register in gr96 and gr97, and also the coprocessor is active
-; uncomment the next 4 instructions.
-;
-; const gr96, 0xfc00820
-; consth gr96, 0xfc00820
-; const gr97, 0x1375
-; store 1, 3, gr96, gr97
-;
-; const gr98, __29027Mode
-; consth gr98, __29027Mode
-; store 0, 0, gr96, gr98
-; add gr98, gr98, 4
-; store 0, 0, gr97, gr98
-;
-; Now call the system to setup the spill and fill trap handlers
-;
- const lr3, spill
- consth lr3, spill
- const lr2, V_SPILL
- syscall setvec
- const lr3, fill
- consth lr3, fill
- const lr2, V_FILL
- syscall setvec
-
-;
-; atexit(_fini)
-;
-; const lr0, _atexit
-; consth lr0, _atexit
-; const lr2,__fini
-; calli lr0,lr0
-; consth lr2,__fini
-;
-; Now call _init
-;
-; const lr0, __init
-; consth lr0, __init
-; calli lr0,lr0
-; nop
-
-;
-; Get the argv base address and calculate argc.
-;
- syscall getargs
- add lr3, v0, 0 ; argv
- add lr4, v0, 0
- constn lr2, -1
-argcloop: ; scan for NULL terminator
- load 0, 0, gr97, lr4
- add lr4, lr4, 4
- cpeq gr97, gr97, 0
- jmpf gr97, argcloop
- add lr2, lr2, 1
-;
-; Now call LibInit, if there is one. To aid runtime libraries
-; that need to do some startup initialization, we have created
-; a bss variable called LibInit. If the library doesn't need
-; any run-time initialization, the variable is still 0. If the
-; library does need run-time initialization, the library will
-; contain a definition like
-; void (*_LibInit)(void) = LibInitFunction;
-; The linker will match up our bss LibInit with this data LibInit
-; and the variable will not be 0. This results in the LibInit routine
-; being called via the calli instruction below.
-;
- const lr0, __LibInit
- consth lr0, __LibInit
- load 0, 0, lr0, lr0
- cpeq gr96, lr0, 0
- jmpt gr96, NoLibInit
- nop
- calli lr0, lr0
- nop
-NoLibInit:
-
-;
-; Call RAMInit to initialize the data memory.
-;
-; The following code segment was used to create the two flavors of the
-; run-time initialization routines (crt0_1.o, and crt0_2.o) as described
-; in the User's Manual. If osboot is used to create a stand-alone
-; application, or the call to RAMInit is made in the start-up routine,
-; then the following is not needed.
-;
-; .ifdef ROM_LOAD
-; .extern RAMInit
-;
-; const lr0, RAMInit
-; consth lr0, RAMInit
-; calli gr96, lr0
-; nop
-; .else
-; nop
-; nop
-; nop
-; nop
-; .endif
-
-;
-; Uncomment the following .comm, if you ARE NOT using osboot as released
-; with the High C 29K product, AND plan to use the romcoff utility to
-; move code and/or data sections to ROM.
-;
-; .comm RAMInit, 4
-;
-; Furthermore, if the above is uncommented, then use the following logic
-; to call the RAMInit function, if needed.
-;
-; const lr0, RAMInit
-; consth lr0, RAMInit
-; load 0, 0, gr96, lr0
-; cpeq gr96, gr96, 0 ; nothing there?
-; jmpt gr96, endRAMInit ; yes, nothing to init
-; nop
-; calli gr96, lr0 ; no, then instruction found
-; nop ; execute function.
-;
-
-
-;
-; call main, passing it 2 arguments. main( argc, argv )
-;
- const lr0, _main
- consth lr0, _main
- calli lr0, lr0
- nop
-;
-; call exit
-;
- const lr0, _exit
- consth lr0, _exit
- calli lr0, lr0
- add lr2, gr96, 0
-;
-; Should never get here, but just in case
-;
-loop:
- syscall exit
- jmp loop
- nop
- .sbttl "Spill and Fill trap handlers"
- .eject
-;
-; SPILL, FILL trap handlers
-;
-; Note that these Spill and Fill trap handlers allow the OS to
-; assume that the only registers of use are between gr1 and rfb.
-; Therefore, if the OS desires to, it may simply preserve from
-; lr0 for (rfb-gr1)/4 registers when doing a context save.
-;
-;
-; Here is the spill handler
-;
-; spill registers from [*gr1..*rab)
-; and move rab downto where gr1 points
-;
-; rab must change before rfb for signals to work
-;
-; On entry: rfb - rab = windowsize, gr1 < rab
-; Near the end: rfb - rab > windowsize, gr1 == rab
-; On exit: rfb - rab = windowsize, gr1 == rab
-;
- .global spill
-spill:
- sub tav, rab, gr1 ; tav = number of bytes to spill
- srl tav, tav, 2 ; change byte count to word count
- sub tav, tav, 1 ; make count zero based
- mtsr CR, tav ; set Count Remaining register
- sub tav, rab, gr1
- sub tav, rfb, tav ; pull down free bound and save it in rab
- add rab, gr1, 0 ; first pull down allocate bound
- storem 0, 0, lr0, tav ; store lr0..lr(tav) into rfb
- jmpi tpc ; return...
- add rfb, tav, 0
-;
-; Here is the fill handler
-;
-; fill registers from [*rfb..*lr1)
-; and move rfb upto where lr1 points.
-;
-; rab must change before rfb for signals to work
-;
-; On entry: rfb - rab = windowsize, lr1 > rfb
-; Near the end: rfb - rab < windowsize, lr1 == rab + windowsize
-; On exit: rfb - rab = windowsize, lr1 == rfb
-;
- .global fill
-fill:
- const tav, 0x80 << 2
- or tav, tav, rfb ; tav = ((rfb>>2) | 0x80)<<2 == [rfb]<<2
- mtsr IPA, tav ; ipa = [rfb]<<2 == 1st reg to fill
- ; gr0 is now the first reg to fill
- sub tav, lr1, rfb ; tav = number of bytes to fill
- add rab, rab, tav ; push up allocate bound
- srl tav, tav, 2 ; change byte count to word count
- sub tav, tav, 1 ; make count zero based
- mtsr CR, tav ; set Count Remaining register
- loadm 0, 0, gr0, rfb ; load registers
- jmpi tpc ; return...
- add rfb, lr1, 0 ; ... first pushing up free bound
-
-;
-; The __init function
-;
-; .sect .init,text
-; .use .init
-; .global __init
-;__init:
-; sub gr1,gr1,16
-; asgeu V_SPILL,gr1,gr126
-; add lr1,gr1,24
-;
-;
-; The __fini function
-;
-; .sect .fini,text
-; .use .fini
-; .global __fini
-;__fini:
-; sub gr1,gr1,16
-; asgeu V_SPILL,gr1,gr126
-; add lr1,gr1,24
-;
- .end
diff --git a/c/src/lib/start/a29k/pswmacro.ah b/c/src/lib/start/a29k/pswmacro.ah
deleted file mode 100644
index a994719c58..0000000000
--- a/c/src/lib/start/a29k/pswmacro.ah
+++ /dev/null
@@ -1,442 +0,0 @@
-; /* @(#)pswmacro.ah 1.1 96/05/23 08:56:58, TEI */
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; macros: Do_install and init_TLB
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; /* $Id$ */
-
-;* File information and includes.
-
- .file "macro.ah"
- .ident "@(#)pswmacro.ah 1.1 96/05/23 08:56:58, TEI"
-
-
- .macro CONST32, RegName, RegValue
- const RegName, RegValue
- consth RegName, RegValue
- .endm
-
- .macro CONSTX, RegName, RegValue
- .if (RegValue) <= 0x0000ffff
- const RegName, RegValue
- .else
- const RegName, RegValue
- consth RegName, RegValue
- .endif
- .endm
-
- .macro PRODEV, RegName
- srl RegName, RegName, 24
- .endm
-
-;
-;* MACRO TO INSTALL VECTOR TABLE ENTRIES
-;
-
-;* Assumes vector table address in v0
-
- .macro _setvec, trapnum, trapaddr
- mfsr v0, vab ;
- const v2, trapnum ;
- sll v1, v2, 2 ;
- add v1, v1, v0 ; v0 has location of vector tab
-
- const v2, trapaddr ;
- consth v2, trapaddr ;
- store 0, 0, v2, v1 ;
- nop ;
- .endm
-
- .macro syscall, name
- const tav, HIF_@name ;
- asneq V_SYSCALL, gr1, gr1 ;
- nop ;
- nop ;
- .endm
-
-
-
-;* MACRO TO INSTALL VECTOR TABLE ENTRIES
-
- .macro Do_Install, V_Number, V_Address
- const lr4, V_Address
- consth lr4, V_Address
- const lr3, V_Number * 4
- consth lr3, V_Number * 4
- call lr0, V_Install
- nop
- .endm
-
- .macro Do_InstallX, V_Number, V_Address
- const lr4, V_Address
- consth lr4, V_Address
- const lr3, V_Number * 4
- consth lr3, V_Number * 4
- call lr0, V_InstallX
- nop
- .endm
-
-
-
-; push a register onto the stack
- .macro pushreg, reg, sp
- sub sp, sp, 4 ; adjust stack pointer
- store 0, 0, reg, sp ; push register
- .endm
-
- .macro push, sp, reg
- sub sp, sp, 4
- store 0, 0, reg, sp
- .endm
-
-; pop the register from stack
- .macro popreg, reg, sp
- load 0, 0, reg, sp ; pop register
- add sp, sp, 4 ; adjust stack pointer
- .endm
- .macro pop, reg, sp
- load 0, 0, reg, sp
- add sp, sp, 4
- .endm
-
-; push a special register onto stack
- .macro pushspcl, spcl, tmpreg, sp
- sub sp, sp, 4 ; adjust stack pointer
- mfsr tmpreg, spcl ; get spcl reg
- store 0, 0, tmpreg, sp ; push onto stack
- .endm
-
- .macro pushsr, sp, reg, sreg
- mfsr reg, sreg
- sub sp, sp, 4
- store 0, 0, reg, sp
- .endm
-
-; pop a special register from stack
- .macro popspcl, spcl, tmpreg, sp
- load 0, 0, tmpreg, sp ; pop from stack
- add sp, sp, 4 ; adjust stack pointer
- mtsr spcl, tmpreg ; set spcl reg
- .endm
-
- .macro popsr, sreg, reg, sp
- load 0, 0, reg, sp
- add sp, sp, 4
- mtsr sreg, reg
- .endm
-
-;
-; save freeze mode registers on memory stack.
-;
-
- .macro SaveFZState, tmp1, tmp2
-
- ; save freeze mode registers.
-
- pushspcl pc0, tmp1, msp
- pushspcl pc1, tmp1, msp
- pushspcl alu, tmp1, msp
-
- pushspcl cha, tmp1, msp
- pushspcl chd, tmp1, msp
- pushspcl chc, tmp1, msp
-
- pushspcl ops, tmp1, msp
-
- ; turn freeze off
-
- const tmp2, FZ
- mfsr tmp1, cps
- andn tmp1, tmp1, tmp2
- mtsr cps, tmp1
- .endm
-
-; restore freeze mode registers from memory stack.
-
- .macro RestoreFZState, tmp1, tmp2
-
- ; turn freeze on
-
- const tmp2, (FZ|DI|DA)
- mfsr tmp1, cps
- or tmp1, tmp1, tmp2
- mtsr cps, tmp1
-
- ; restore freeze mode registers.
-
- popspcl ops, tmp1, msp
- popspcl chc, tmp1, msp
- popspcl chd, tmp1, msp
- popspcl cha, tmp1, msp
- popspcl alu, tmp1, msp
- popspcl pc1, tmp1, msp
- popspcl pc0, tmp1, msp
- .endm
-
-;
-;*
-;
- .equ WS, 512 ; window size
- .equ RALLOC, 4 * 4 ; stack alloc for C
- .equ SIGCTX_UM_SIZE, 40 * 4 ;
- .equ SIGCTX_RFB, (38) * 4 ; user mode saved
- .equ SIGCTX_SM_SIZE, 12 * 4 ;
- .equ SIGCTX_SIG, (11)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_GR1, (10)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_RAB, (9)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_PC0, (8)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_PC1, (7)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_PC2, (6)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_CHC, (3)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_OPS, (1)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_TAV, (0)*4 + SIGCTX_UM_SIZE ;
-
- .macro sup_sv
- add it2, trapreg, 0 ; transfer signal #
- sub msp, msp, 4 ;
- store 0, 0, it2, msp ; save signal number
- sub msp, msp, 4 ; push gr1
-
- store 0, 0, gr1, msp ;
- sub msp, msp, 4 ; push rab
- store 0, 0, rab, msp ;
- const it0, WS ; Window size
-
- sub rab, rfb, it0 ; set rab = rfb-512
- pushsr msp, it0, PC0 ; save program counter0
- pushsr msp, it0, PC1 ; save program counter1
- pushsr msp, it0, PC2 ; save program counter2
-
- pushsr msp, it0, CHA ; save channel address
- pushsr msp, it0, CHD ; save channel data
- pushsr msp, it0, CHC ; save channel control
- pushsr msp, it0, ALU ; save alu
-
- pushsr msp, it0, OPS ; save ops
- sub msp, msp, 4 ;
- store 0, 0, tav, msp ; push tav
- mtsrim chc, 0 ; no loadm/storem
-
- mfsr it0, ops ; get ops value
- const it1, (TD | DI) ; disable interrupts
- consth it1, (TD | DI) ; disable interrupts
- or it0, it0, it1 ; set bits
-
- mtsr ops, it0 ; set new ops
- const it0, sigcode ; signal handler
- consth it0, sigcode ; signal handler
- mtsr pc1, it0 ; store pc1
-
- add it1, it0, 4 ; next addr
- mtsr pc0, it1 ; store pc1 location
- iret ; return
- nop ; ALIGN
- .endm
-
- .macro sig_return
- mfsr it0, cps ; get processor status
- const it1, FZ|DA ; Freeze + traps disable
- or it0, it0, it1 ; to set FZ+DA
- mtsr cps, it0 ; in freeze mode
-
- load 0, 0, tav, msp ; restore tav
- add msp, msp, 4 ;
-
- popsr OPS,it0, msp ;
- popsr ALU,it0, msp ;
- popsr CHC,it0, msp ;
- popsr CHD,it0, msp ;
-
- popsr CHA,it0, msp ;
- popsr PC2,it0, msp ;
- popsr PC1,it0, msp ;
- popsr PC0,it0, msp ;
-
- load 0, 0, rab, msp ;
- add msp, msp, 4 ;
- load 0, 0, it0, msp ;
- add gr1, it0, 0 ; pop rsp
-
- add msp, msp, 8 ; discount signal #
- iret
- .endm
-
- .macro repair_R_stack
- add v0, msp, SIGCTX_GR1 ; interrupted gr1
- load 0, 0, v2, v0 ;
- add v0, msp, SIGCTX_RFB ;
- load 0, 0, v3, v0 ; interupted rfb
-
- const v1, WS ;
- sub v1, v3, v1 ; rfb-512
- cpltu v0, v2, v1 ; test gr1 < rfb-512
- jmpf v0, $1 ;
-
- add gr1, rab, 0 ;
- add v2, v1, 0 ; set LB = rfb-512
-$1:
-;* if gr1 < rfb-512 yes LB = rfb-512 signalled during spill
-;* if no, LB=gr1 interrupted cache < 126 registers
- cpleu v0, v2, rfb ; test LB<=rfb
- jmpf v0, $2 ;
- nop ;
- add v2, rfb, 0 ;
-$2:
- cpeq v0, v3, rfb ; fill rfb->'rfb
- jmpt v0, $3 ; if rfb==rfb'
- const tav, (0x80<<2) ; prepare for fill
- or tav, tav, v2 ;
-
- mtsr IPA, tav ; IPA=LA<<2
- sub tav, v3, gr98 ; cache fill LA->rfb
- srl tav, tav, 2 ; convert to words
- sub tav, tav, 1 ;
-
- mtsr cr, tav ;
- loadm 0, 0, gr0, v2 ; fill from LA->rfb
-$3:
- add rfb, v3, 0 ; move rfb upto 'rfb
- sub rab, v1, 0 ; assign rab to rfb-512
-
- add v0, msp, SIGCTX_GR1 ;
- load 0, 0, v2, v0 ; v0 = interrupted gr1
- add gr1, v2, 0 ; move gr1 upto 'gr1
- nop ;
- .endm
-
- .macro repair_regs
- mtsrim cr, 29 - 1 ; to restore locals
- loadm 0, 0, v0, msp ;
- add msp, msp, 29*4 ;
- popsr Q, tav, msp ;
-
- popsr IPC, tav, msp ;
- popsr IPB, tav, msp ;
- popsr IPA, tav, msp ;
- pop FPStat3, msp ; floating point regs
-
- pop FPStat2, msp ; floating point regs
- pop FPStat1, msp ; floating point regs
- pop FPStat0, msp ; floating point regs
-
- add msp, msp, 3*4 ; R-stack repaired
- .endm
-
-;
-;*HIF related...
-;
-
-
-
-
-; send the message in bufaddr to Montip.
- .macro SendMessageToMontip, bufaddr
- const lr2, bufaddr
-$1:
- call lr0, _msg_send
- consth lr2, bufaddr
- cpeq gr96, gr96, 0
- jmpf gr96, $1
- const lr2, bufaddr
- .endm
-
-; build a HIF_CALL message in bufaddr to send to montip.
- .macro BuildHIFCALLMsg, bufaddr, tmp1, tmp2
- const tmp1, bufaddr
- consth tmp1, bufaddr
- const tmp2, HIF_CALL_MSGCODE
- store 0, 0, tmp2, tmp1 ; msg code
- add tmp1, tmp1, 4
- const tmp2, HIF_CALL_MSGLEN
- store 0, 0, tmp2, tmp1 ; msg len
- add tmp1, tmp1, 4
- store 0, 0, gr121, tmp1 ; service number
- add tmp1, tmp1, 4
- store 0, 0, lr2, tmp1 ; lr2
- add tmp1, tmp1, 4
- store 0, 0, lr3, tmp1 ; lr3
- add tmp1, tmp1, 4
- store 0, 0, lr4, tmp1 ; lr4
- .endm
-
-;
-;*
-;* All the funky AMD style macros go in here...simply for
-;* compatility
-;
-;
- .macro IMPORT, symbol
- .extern symbol
- .endm
-
- .macro GLOBAL, symbol
- .global symbol
- .endm
-
- .macro USESECT, name, type
- .sect name, type
- .use name
- .endm
-
- .macro SECTION, name, type
- .sect name, type
- .endm
-
- .macro FUNC, fname, lineno
- .global fname
-fname:
- .endm
-
- .macro ENDFUNC, fname, lineno
- .endm
-
-;*************************************LONG
- .macro LONG, varname
-varname:
- .block 4
- .endm
-
-;*************************************UNSIGNED LONG
- .macro ULONG, varname
-varname:
- .block 4
- .endm
-
-;*************************************SHORT
- .macro SHORT, varname
-varname:
- .block 2
- .endm
-
-;*************************************CHAR
- .macro CHAR, varname
-varname:
- .block 1
- .endm
-
-;*************************************LONGARRAY
- .macro LONGARRAY, name, count
-name:
- .block count*4
- .endm
-
-;*************************************SHORTARRAY
-
- .macro SHORTARRAY, name, count
-name:
- .block count*2
- .endm
-
-;*************************************CHARARRAY
-
- .macro CHARARRAY, name, count
-name:
- .block count
- .endm
-
-
-;*************************************VOID_FPTR
-
- .macro VOID_FPTR, name
-name:
- .block 4
- .endm
diff --git a/c/src/lib/start/a29k/register.ah b/c/src/lib/start/a29k/register.ah
deleted file mode 100644
index 1dced5b043..0000000000
--- a/c/src/lib/start/a29k/register.ah
+++ /dev/null
@@ -1,214 +0,0 @@
-; /* @(#)register.ah 1.1 96/05/23 08:56:57, TEI */
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; naming of various registers
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; /* $Id$ */
-
-;* File information and includes.
-
- .file "register.ah"
- .ident "@(#)register.ah 1.1 96/05/23 08:56:57, TEI\n"
-
-;* Register Stack pointer and frame pointer registers.
-
- .extern Rrsp, Rfp
-
- .reg regsp, %%Rrsp
- .reg fp, %%Rfp
-
-
- .extern RTrapReg
- .extern Rtrapreg
-
- .reg TrapReg, %%RTrapReg
- .reg trapreg, %%Rtrapreg
-
-
-;* Operating system Interrupt handler registers (gr64-gr67)
-
- .extern ROSint0, ROSint1, ROSint2, ROSint3
-
- .reg OSint0, %%ROSint0
- .reg OSint1, %%ROSint1
- .reg OSint2, %%ROSint2
- .reg OSint3, %%ROSint3
-
- .reg it0, %%ROSint0
- .reg it1, %%ROSint1
- .reg it2, %%ROSint2
- .reg it3, %%ROSint3
-
-
-
-;* Operating system temporary (or scratch) registers (gr68-gr79)
-
- .extern ROStmp0, ROStmp1, ROStmp2, ROStmp3
- .extern ROStmp4, ROStmp5, ROStmp6, ROStmp7
- .extern ROStmp8, ROStmp9, ROStmp10, ROStmp11
-
- .reg OStmp0, %%ROStmp0
- .reg OStmp1, %%ROStmp1
- .reg OStmp2, %%ROStmp2
- .reg OStmp3, %%ROStmp3
-
- .reg OStmp4, %%ROStmp4
- .reg OStmp5, %%ROStmp5
- .reg OStmp6, %%ROStmp6
- .reg OStmp7, %%ROStmp7
-
- .reg OStmp8, %%ROStmp8
- .reg OStmp9, %%ROStmp9
- .reg OStmp10, %%ROStmp10
- .reg OStmp11, %%ROStmp11
-
-
- .reg kt0, %%ROStmp0
- .reg kt1, %%ROStmp1
- .reg kt2, %%ROStmp2
- .reg kt3, %%ROStmp3
-
- .reg kt4, %%ROStmp4
- .reg kt5, %%ROStmp5
- .reg kt6, %%ROStmp6
- .reg kt7, %%ROStmp7
-
- .reg kt8, %%ROStmp8
- .reg kt9, %%ROStmp9
- .reg kt10, %%ROStmp10
- .reg kt11, %%ROStmp11
-
-
- .reg TempReg0, %%ROSint0
- .reg TempReg1, %%ROSint1
- .reg TempReg2, %%ROSint2
- .reg TempReg3, %%ROSint3
-
- .reg TempReg4, %%ROStmp0
- .reg TempReg5, %%ROStmp1
- .reg TempReg6, %%ROStmp2
- .reg TempReg7, %%ROStmp3
-
- .reg TempReg8, %%ROStmp4
- .reg TempReg9, %%ROStmp5
- .reg TempReg10, %%ROStmp6
- .reg TempReg11, %%ROStmp7
-
- .reg TempReg12, %%ROStmp8
- .reg TempReg13, %%ROStmp9
- .reg TempReg14, %%ROStmp10
- .reg TempReg15, %%ROStmp11
-
-
-;* Assigned static registers
-
- .extern RSpillAddrReg, RFillAddrReg, RSignalAddrReg
- .extern Rpcb, Retc
- .extern RTimerExt, RTimerUtil, RLEDReg, RERRReg
- .extern Ret0, Ret1, Ret2, Ret3, Ret4, Ret5, Ret6, Ret7, Reta, Retb
- .extern Retx, Rety, Retz
-
-
- .reg SpillAddrReg, %%RSpillAddrReg
- .reg FillAddrReg, %%RFillAddrReg
- .reg SignalAddrReg, %%RSignalAddrReg
- .reg pcb, %%Rpcb
-
- .reg etx, %%Retx
- .reg ety, %%Rety
- .reg etz, %%Retz
- .reg eta, %%Reta
-
- .reg etb, %%Retb
- .reg etc, %%Retc
- .reg TimerExt, %%RTimerExt
- .reg TimerUtil, %%RTimerUtil
-
- .reg LEDReg, %%RLEDReg
- .reg ERRReg, %%RERRReg
-
-
- .reg et0, %%Ret0
- .reg et1, %%Ret1
- .reg et2, %%Ret2
- .reg et3, %%Ret3
-
- .reg et4, %%Ret4
- .reg et5, %%Ret5
- .reg et6, %%Ret6
- .reg et7, %%Ret7
-
-;
- .equ SCB1REG_NUM, 88
- .reg SCB1REG_PTR, %%Ret0
-
-; The floating point trap handlers need a few static registers
-
- .extern RFPStat0, RFPStat1, RFPStat2, RFPStat3
- .extern Rheapptr, RHeapPtr, RArgvPtr
-
- .reg FPStat0, %%RFPStat0
- .reg FPStat1, %%RFPStat1
- .reg FPStat2, %%RFPStat2
- .reg FPStat3, %%RFPStat3
-
- .reg heapptr, %%Rheapptr
- .reg HeapPtr, %%RHeapPtr
- .reg ArgvPtr, %%RArgvPtr
-
- .extern RXLINXReg, RVMBCReg, RUARTReg, RETHERReg
-
- .reg XLINXReg, %%RXLINXReg
- .reg VMBCReg, %%RVMBCReg
- .reg UARTReg, %%RUARTReg
- .reg ETHERReg, %%RXLINXReg
-
-;* Compiler and programmer registers. (gr96-gr127)
-
- .extern Rv0, Rv1, Rv2, Rv3, Rv4, Rv5, Rv6, Rv7, Rv8, Rv9
- .extern Rv10, Rv11, Rv12, Rv13, Rv14, Rv15
-
- .reg v0, %%Rv0
- .reg v1, %%Rv1
- .reg v2, %%Rv2
- .reg v3, %%Rv3
-
- .reg v4, %%Rv4
- .reg v5, %%Rv5
- .reg v6, %%Rv6
- .reg v7, %%Rv7
-
- .reg v8, %%Rv8
- .reg v9, %%Rv9
- .reg v10, %%Rv10
- .reg v11, %%Rv11
-
- .reg v12, %%Rv12
- .reg v13, %%Rv13
- .reg v14, %%Rv14
- .reg v15, %%Rv15
-
- .extern Rtv0, Rtv1, Rtv2, Rtv3, Rtv4
-
- .reg tv0, %%Rtv0
- .reg tv1, %%Rtv1
- .reg tv2, %%Rtv2
- .reg tv3, %%Rtv3
- .reg tv4, %%Rtv4
-
-; ****************************************************************************
-; For uatrap
-; register definitions -- since this trap handler must allow for
-; nested traps and interrupts such as TLB miss, protection violation,
-; or Data Access Exception, and these trap handlers use the shared
-; Temp registers, we must maintain our own that are safe over user-
-; mode loads and stores. The following must be assigned global
-; registers which are not used in INTR[0-3], TRAP[0-1], TLB miss,
-; TLB protection violation, or data exception trap handlers.
-
-; .reg cha_cpy, OStmp4 ; copy of CHA
-; .reg chd_cpy, OStmp5 ; copy of CHD
-; .reg chc_cpy, OStmp6 ; copy of CHC
-; .reg LTemp0, OStmp7 ; local temp 0
-; .reg LTemp1, OStmp8 ; local temp 1
-
-; ****************************************************************************
diff --git a/c/src/lib/start/a29k/register.s b/c/src/lib/start/a29k/register.s
deleted file mode 100644
index 4d17071ed1..0000000000
--- a/c/src/lib/start/a29k/register.s
+++ /dev/null
@@ -1,393 +0,0 @@
-; /* @(#)register.s 1.1 96/05/23 08:57:34, TEI */
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Register Definitions and Usage Conventions
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; /* $Id$ */
-;
-
-;* File information and includes.
-
- .file "c_register.s"
- .ident "@(#)register.s 1.1 96/05/23 08:57:34, TEI\n"
-
-; Basic guidelines for register distribution and usage are derived from
-; the AMD application notes. It would be best to stick with the conventions
-; laid out by AMD.
-; Application Note: Context Switching with 29000 Processor By Daniel Mann.
-
-;
-;*************************************************************************
-;
-
-;
-; Rule 1:
-; Gr1 is used as a pointer to the register stack
-; Lr1 is used as frame pointer
-;
-
- .reg regsp, gr1 ; Register Stack Pointer
- .reg fp, lr1 ; frame pointer
-
- .equ Rrsp, &regsp
- .equ Rfp, &fp
-
- .global Rrsp, Rfp
-
-;
-;*************************************************************************
-;
-
-;
-; Gr2-Gr63 are not implemented in silicon
-;
-
-;
-;*************************************************************************
-;
-
-;
-; Rule 2:
-; The registers GR64-GR95 are dedicated for operating system use.
-;
-
-; The register range GR64-GR95 i.e 32 Registers is furthur sub-divided as
-; follows...
-; gr64-gr67 interrupt handlers.
-; gr68-gr71 OS temporaries I
-; gr72-gr79 OS temporaries II
-; gr80-gr95 OS statics. Dedicated throughout the operation of a program.
-
-
-;
-; 32 Registers for Operating System Use.
-;
-
-;
-; Assigning Names to Interrupt Handlers Registers.
-;
-
- .reg OSint0, gr64
- .reg OSint1, gr65
- .reg OSint2, gr66
- .reg OSint3, gr67
-
- .equ ROSint0, &OSint0
- .equ ROSint1, &OSint1
- .equ ROSint2, &OSint2
- .equ ROSint3, &OSint3
-
- .global ROSint0, ROSint1, ROSint2, ROSint3
-
- .reg TrapReg, gr64 ; trap register
- .reg trapreg, gr64 ; trapreg
-
- .equ RTrapReg, &TrapReg
- .equ Rtrapreg, &trapreg
-
- .global RTrapReg, Rtrapreg
-
-
-;
-; Assigning Names to Scratch/Temporary Registers.
-;
-
- .reg OStmp0, gr68
- .reg OStmp1, gr69
- .reg OStmp2, gr70
- .reg OStmp3, gr71
-
- .reg OStmp4, gr72
- .reg OStmp5, gr73
- .reg OStmp6, gr74
- .reg OStmp7, gr75
-
- .reg OStmp8, gr76
- .reg OStmp9, gr77
- .reg OStmp10, gr78
- .reg OStmp11, gr79
-
- .equ ROStmp0, &OStmp0
- .equ ROStmp1, &OStmp1
- .equ ROStmp2, &OStmp2
- .equ ROStmp3, &OStmp3
-
- .equ ROStmp4, &OStmp4
- .equ ROStmp5, &OStmp5
- .equ ROStmp6, &OStmp6
- .equ ROStmp7, &OStmp7
-
- .equ ROStmp8, &OStmp8
- .equ ROStmp9, &OStmp9
- .equ ROStmp10, &OStmp10
- .equ ROStmp11, &OStmp11
-
- .global ROStmp0, ROStmp1, ROStmp2, ROStmp3
- .global ROStmp4, ROStmp5, ROStmp6, ROStmp7
- .global ROStmp8, ROStmp9, ROStmp10, ROStmp11
-
-;
-; Assigning Names to Statics/Permanent Registers.
-;
-
- .reg OSsta0, gr80 ; Spill Address Register
- .reg OSsta1, gr81 ; Fill Address Register
- .reg OSsta2, gr82 ; Signal Address Register
- .reg OSsta3, gr83 ; pcb Register
-
- .reg OSsta4, gr84 ;
- .reg OSsta5, gr85 ;
- .reg OSsta6, gr86 ;
- .reg OSsta7, gr87 ;
-
- .reg OSsta8, gr88 ;
- .reg OSsta9, gr89 ;
- .reg OSsta10, gr90 ;
- .reg OSsta11, gr91 ;
-
- .reg OSsta12, gr92 ;
- .reg OSsta13, gr93 ;
- .reg OSsta14, gr94 ;
- .reg OSsta15, gr95 ;
-
-;
-; Round 2 of Name Assignments
-;
-
-;
-; Assignment of Specific Use oriented names to statics.
-;
- .reg SpillAddrReg, gr80
- .reg FillAddrReg, gr81
- .reg SignalAddrReg, gr82
- .reg pcb, gr83
-
- .reg etx, gr80
- .reg ety, gr81
- .reg etz, gr82
- .reg etc, gr83
-
-;*
-
- .reg TimerExt, gr84
- .reg TimerUtil, gr85
-
-;*
-
- .reg LEDReg, gr86
- .reg ERRReg, gr87
-
- .reg eta, gr86
- .reg etb, gr87
-
-;*
-
-
-;* The following registers are used by switching code
-
- .reg et0, gr88
- .reg et1, gr89
- .reg et2, gr90
- .reg et3, gr91
-
- .reg et4, gr92
- .reg et5, gr93
- .reg et6, gr94
- .reg et7, gr95
-
-
-; The floating point trap handlers need a few static registers
-
- .reg FPStat0, gr88
- .reg FPStat1, gr89
- .reg FPStat2, gr90
- .reg FPStat3, gr91
-
-; The following registers are used temporarily during diagnostics.
-
- .reg XLINXReg, gr92
- .reg VMBCReg, gr93
- .reg UARTReg, gr94
- .reg ETHERReg, gr95
-
-;*
-
-;;*
- .reg heapptr, gr90
- .reg ArgvPtr, gr91
-;;*
-
-
-
-;
-;* Preparing to export Register Names for the Linkers benefit.
-;
-
- .equ RSpillAddrReg, &SpillAddrReg
- .equ RFillAddrReg, &FillAddrReg
- .equ RSignalAddrReg, &SignalAddrReg
- .equ Rpcb, &pcb
-
- .equ Retx, &etx
- .equ Rety, &ety
- .equ Retz, &etz
- .equ Reta, &eta
-
- .equ Retb, &etb
- .equ Retc, &etc
- .equ RTimerExt, &TimerExt
- .equ RTimerUtil, &TimerUtil
-
- .equ RLEDReg, &LEDReg
- .equ RERRReg, &ERRReg
-
- .equ Ret0, &et0
- .equ Ret1, &et1
- .equ Ret2, &et2
- .equ Ret3, &et3
-
- .equ RFPStat0, &FPStat0
- .equ RFPStat1, &FPStat1
- .equ RFPStat2, &FPStat2
- .equ RFPStat3, &FPStat3
-
- .equ Rheapptr, &heapptr
- .equ RHeapPtr, &heapptr
- .equ RArgvPtr, &ArgvPtr
-
- .equ Ret4, &et4
- .equ Ret5, &et5
- .equ Ret6, &et6
- .equ Ret7, &et7
-
- .equ RXLINXReg, &XLINXReg
- .equ RVMBCReg, &VMBCReg
- .equ RUARTReg, &UARTReg
- .equ RETHERReg, &ETHERReg
-
- .global RSpillAddrReg, RFillAddrReg, RSignalAddrReg
- .global Rpcb, Retc
- .global RTimerExt, RTimerUtil, RLEDReg, RERRReg
- .global Ret0, Ret1, Ret2, Ret3, Ret4, Ret5, Ret6, Ret7, Reta, Retb
- .global Retx, Rety, Retz
- .global RFPStat0, RFPStat1, RFPStat2, RFPStat3
- .global Rheapptr, RHeapPtr, RArgvPtr
- .global RXLINXReg, RVMBCReg, RUARTReg, RETHERReg
-
-;
-;*************************************************************************
-;
-
-
-;
-; Rule 3:
-; Gr96-Gr127 Compiler & Programmer use registers.
-; 32 Registers for Compiler & Programmer use
-
-;
-; 16 Registers for Compiler Use.
-;
-
-;
-; Compiler Temporaries and Function Return Values
-;
-
- .reg v0, gr96 ; First word of Return Value
- .reg v1, gr97
- .reg v2, gr98
- .reg v3, gr99
-
- .reg v4, gr100
- .reg v5, gr101
- .reg v6, gr102
- .reg v7, gr103
-
- .reg v8, gr104
- .reg v9, gr105
- .reg v10, gr106
- .reg v11, gr107
-
- .reg v12, gr108
- .reg v13, gr109
- .reg v14, gr110
- .reg v15, gr111
-
- .equ Rv0, &v0
- .equ Rv1, &v1
- .equ Rv2, &v2
- .equ Rv3, &v3
-
- .equ Rv4, &v4
- .equ Rv5, &v5
- .equ Rv6, &v6
- .equ Rv7, &v7
-
- .equ Rv8, &v8
- .equ Rv9, &v9
- .equ Rv10, &v10
- .equ Rv11, &v11
-
- .equ Rv12, &v12
- .equ Rv13, &v13
- .equ Rv14, &v14
- .equ Rv15, &v15
-
- .global Rv0, Rv1, Rv2, Rv3, Rv4, Rv5, Rv6, Rv7, Rv8, Rv9
- .global Rv10, Rv11, Rv12, Rv13, Rv14, Rv15
-
-
-;
-; User Process Statics Registers
-;
-
- .reg rp0, gr112 ; Reserved for Programmer, #0
- .reg rp1, gr113 ; Reserved for Programmer, #1
- .reg rp2, gr114 ; Reserved for Programmer, #2
- .reg rp3, gr115 ; Reserved for Programmer, #3
-
- .equ Rrp0, &rp0
- .equ Rrp1, &rp1
- .equ Rrp2, &rp2
- .equ Rrp3, &rp3
-
- .global Rrp0, Rrp1, Rrp2, Rrp3
-
-;
-; Compiler Temporaries II
-;
-
- .reg tv0, gr116 ;
- .reg tv1, gr117 ;
- .reg tv2, gr118 ;
- .reg tv3, gr119 ;
- .reg tv4, gr120 ;
-
- .equ Rtv0, &tv0 ;
- .equ Rtv1, &tv1 ;
- .equ Rtv2, &tv2 ;
- .equ Rtv3, &tv3 ;
- .equ Rtv4, &tv4 ;
-
- .global Rtv0, Rtv1, Rtv2, Rtv3, Rtv4
-
-;
-; Special pointers and registers for handlers and stack operations.
-;
-
- .reg tav, gr121 ; Temp, Arg for Trap Handlers
- .reg tpc, gr122 ; Temp, Ret PC for Trap Handlers
- .reg lrp, gr123 ; Large Return Pointer
- .reg slp, gr124 ; Static Link Pointer
-
- .reg msp, gr125 ; Memory Stack Pointer
- .reg rab, gr126 ; Register Allocate Bound
- .reg rfb, gr127 ; Register Free Bound
-
- .equ Rtav, &tav
- .equ Rtpc, &tpc
- .equ Rlrp, &lrp
- .equ Rslp, &slp
- .equ Rmsp, &msp
- .equ Rrab, &rab
- .equ Rrfb, &rfb
-
- .global Rtav, Rtpc, Rlrp, Rslp, Rmsp, Rrab, Rrfb
diff --git a/c/src/lib/start/i960/Makefile.in b/c/src/lib/start/i960/Makefile.in
deleted file mode 100644
index 68dcd2196e..0000000000
--- a/c/src/lib/start/i960/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-PGM=${ARCH}/start.o
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/start/i960/start.s b/c/src/lib/start/i960/start.s
deleted file mode 100644
index 1d6055363a..0000000000
--- a/c/src/lib/start/i960/start.s
+++ /dev/null
@@ -1,110 +0,0 @@
-/* entry.s
- *
- * This file contains the entry point for the application.
- * The name of this entry point is compiler dependent.
- * It jumps to the BSP which is responsible for performing
- * all initialization.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-
- BEGIN_CODE
- PUBLIC(start) # GNU960 default entry point
-
-SYM(start):
- mov 3, r12
- modpc r12, r12, r12 # enable tracing/trace faults
- mov g5, g5 # NOP
- mov 0, g14 # initialize constant for C
-
- /*
- * zero out uninitialized data area
- */
-zerobss:
- lda _end, r4 /* find end of .bss */
- lda _bss_start, r5 /* find beginning of .bss */
- ldconst 0, r6
-
-loop: st r6, (r5) /* to zero out uninitialized */
- addo 4, r5, r5 /* data area */
- cmpobl r5, r4, loop /* loop until _end reached */
-
-/* set up stack pointer:
- * The heap will begin at '_end'; its length is 'heap_size'
- * bytes. The stack will begin at the first 64-byte-aligned
- * block after the heap.
- *
- * A default value of 'heap_size' is set by linking with libnindy.a
- * The default can be overridden by redefining this symbol at link
- * time (with a line of the form 'heap_size=XXXX;' in the lnk960
- * linker specification file; or one of the form
- * "-defsym heap_size=XXXX" on the gld960 invocation line).
- */
-
- ldconst _end, sp /* set sp = address of end of heap */
- lda heap_size(sp),sp
- lda 64(sp), sp /* Now round up to 64-byte boundary */
- ldconst 0xffffffc0, r12
- and r12, sp, sp
- st sp, _stack_start /* Save for brk() routine */
-
- call init_frames
- ret /* return to monitor */
-
-init_frames:
- mov 0, g14 /* initialize constant for C */
- ldconst 0x3b001000, g0
- ldconst 0x00009107, g1
- modac g1, g0, g0 /* set AC controls */
-
- /*
- * remember the frame, so that we can set it up if necessary
- */
-
- st fp, _start_frame
-
- /*
- * Call application boot_card.
- * Someday, real values of argc and argv will be set up.
- * For now, they are set to 0.
- */
- ldconst 0,g0
- ldconst 0,g1
- ldconst 0,g2
- call _boot_card
- ret
-
-END_CODE
-
- BEGIN_DATA
-
- PUBLIC(_start_frame)
- PUBLIC(start_frame)
-SYM (_start_frame):
-SYM (start_frame):
- .word 0 # addr of first user frame: for gdb960
-
- PUBLIC(_stack_start)
- PUBLIC(stack_start)
-SYM (_stack_start):
-SYM (stack_start):
- .word 0 # addr of first user frame: for gdb960
-
-END_DATA
-
-BEGIN_BSS
- PUBLIC(heap_size)
- .set heap_size,0x2000
-END_BSS
-
-END
diff --git a/c/src/lib/start/m68k/Makefile.in b/c/src/lib/start/m68k/Makefile.in
deleted file mode 100644
index bafd65a3ff..0000000000
--- a/c/src/lib/start/m68k/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/start.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/start/m68k/start.s b/c/src/lib/start/m68k/start.s
deleted file mode 100644
index 72849170d9..0000000000
--- a/c/src/lib/start/m68k/start.s
+++ /dev/null
@@ -1,153 +0,0 @@
-/* entry.s
- *
- * This file contains the entry point for the application.
- * The name of this entry point is compiler dependent.
- * It jumps to the BSP which is responsible for performing
- * all initialization.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-
-#if (M68K_COLDFIRE_ARCH == 0) /* All ColdFire BSPs must provide their own start vector */
-
-BEGIN_CODE
- | Default entry points for:
- PUBLIC (start) | GNU
- PUBLIC (M68Kvec) | Vector Table
-
-SYM (start):
-SYM (M68Kvec): | standard location for vectors
- nop | for linkers with problem
- | location zero
- jmp SYM (start_around)
-
- /*
- * We can use the following space as our vector table
- * if the CPU has a VBR or we can save vector table in it
- * if the CPU does not.
- */
-
- .space 4088 | to avoid initial intr stack
- | from 135BUG on MVME13?
- | and start code at 0x4000
-SYM (vectors):
- .space 1016 | reserve space for rest of vectors
-
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
-SYM (lowintstack):
- .space 4092 | reserve for interrupt stack
-SYM (hiintstack):
- .space 4 | end of interrupt stack
-#endif
-
- PUBLIC (start_around)
-SYM (start_around):
- move.w sr, SYM (initial_sr)
- oriw #0x3700,sr | SUPV MODE,INTERRUPTS OFF!!!
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
- movec isp,a0
- move.l a0, SYM (initial_isp)
- movec usp,a0
- move.l a0, SYM (initial_usp)
- movec msp,a0
- move.l a0, SYM (initial_msp)
-#else
- move.l a7, SYM (initial_msp)
-#endif
-
- |
- | zero out uninitialized data area
- |
-zerobss:
- moveal # SYM (end),a0 | find end of .bss
- moveal # SYM (bss_start),a1 | find beginning of .bss
- movel #0,d0
-
-loop: movel #0,a1@+ | to zero out uninitialized
- cmpal a0,a1
- jlt loop | loop until _end reached
-
- movel # SYM (stack_init),d0 | d0 = stop of stack
- andl #0xffffffc0,d0 | align it on 16 byte boundary
- movw #0x3700,sr | SUPV MODE,INTERRUPTS OFF!!!
- movel d0,a7 | set master stack pointer
- movel d0,a6 | set base pointer
-
- /*
- * RTEMS should maintain a separate interrupt stack on CPUs
- * without one in hardware. This is currently not supported
- * on versions of the m68k without a HW intr stack.
- */
-
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
- lea SYM (hiintstack),a0 | a0 = high end of intr stack
- movec a0,isp | set interrupt stack
-#endif
- movel #0,a7@- | push environp
- movel #0,a7@- | push argv
- movel #0,a7@- | push argc
-
- jsr SYM (boot_card)
- addl #12,a7
-
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
- move.l SYM (initial_isp),a0
- movec a0,isp
- move.l SYM (initial_usp),a0
- movec a0,usp
- move.l SYM (initial_msp),a0
- movec a0,msp
-#else
- movea.l SYM (initial_msp),a7
-#endif
- move.w SYM (initial_sr),sr
- rts
-
-END_CODE
-
-BEGIN_DATA
-
- PUBLIC (start_frame)
-SYM (start_frame):
- .space 4,0
-
-END_DATA
-
-BEGIN_BSS
-
- PUBLIC (environ)
- .align 2
-SYM (environ):
- .long 0
-
- PUBLIC (initial_isp)
-SYM (initial_isp):
- .space 4
-
- PUBLIC (initial_msp)
-SYM (initial_msp):
- .space 4
-
- PUBLIC (initial_usp)
-SYM (initial_usp):
- .space 4
-
- PUBLIC (initial_sr)
-SYM (initial_sr):
- .space 2
-
-END_DATA
-#endif
-END
-
-
diff --git a/c/src/lib/start/mips64orion/Makefile.in b/c/src/lib/start/mips64orion/Makefile.in
deleted file mode 100644
index 046969120a..0000000000
--- a/c/src/lib/start/mips64orion/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=idt_csu
-S_FILES=$(S_PIECES:%=%.S)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-PGM=${ARCH}/idt_csu.o
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/start/mips64orion/idt_csu.S b/c/src/lib/start/mips64orion/idt_csu.S
deleted file mode 100644
index 8dc31c8999..0000000000
--- a/c/src/lib/start/mips64orion/idt_csu.S
+++ /dev/null
@@ -1,299 +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$
-*/
-
-/*************************************************************************
-**
-** Copyright 1991-95 Integrated Device Technology, Inc.
-** All Rights Reserved
-**
-** idt_csu.S -- IDT stand alone startup code
-**
-**************************************************************************/
-#include <rtems/score/iregdef.h>
-#include <rtems/score/idtcpu.h>
-#include <rtems/score/idtmon.h>
-
-
-.extern _fbss,4 /* this is defined by the linker */
-.extern end,4 /* this is defined by the linker */
-
-.lcomm sim_mem_cfg_struct,12
-
- .text
-
-
-#define TMP_STKSIZE 1024
-
-/**************************************************************************
-**
-** start - Typicl standalone start up code required for R3000/R4000
-**
-**
-** 1) Initialize the STATUS Register
-** a) Clear parity error bit
-** b) Set co_processor 1 usable bit ON
-** c) Clear all IntMask Enables
-** d) Set kernel/disabled mode
-** 2) Initialize Cause Register
-** a) clear software interrupt bits
-** 3) Determine FPU installed or not
-** if not, clear CoProcessor 1 usable bit
-** 4) Clear bss area
-** 5) MUST allocate temporary stack until memory size determined
-** It MUST be uncached to prevent overwriting when caches are cleared
-** 6) Install exception handlers
-** 7) Determine memory and cache sizes
-** 8) Establish permanent stack (cached or uncached as defined by bss)
-** 9) Flush Instruction and Data caches
-** 10) If there is a Translation Lookaside Buffer, Clear the TLB
-** 11) Execute initialization code if the IDT/c library is to be used
-**
-** 12) Jump to user's "main()"
-** 13) Jump to promexit
-**
-** IDT/C 5.x defines _R3000, IDT/C 6.x defines _R4000 internally.
-** This is used to mark code specific to R3xxx or R4xxx processors.
-** IDT/C 6.x defines __mips to be the ISA level for which we're
-** generating code. This is used to make sure the stack etc. is
-** double word aligned, when using -mips3 (default) or -mips2,
-** when compiling with IDT/C6.x
-**
-***************************************************************************/
-
-FRAME(start,sp,0,ra)
-
- .set noreorder
-#ifdef _R3000
- li v0,SR_PE|SR_CU1 /* reset parity error and set */
- /* cp1 usable */
-#endif
-#ifdef _R4000
-#if __mips==3 || defined(R4650)
- li v0,SR_CU1|SR_DE|SR_FR /* initally clear ERL, enable FPA 64bit regs*/
- /* 4650: Need fr to be set anyway */
-#else
- li v0,SR_CU1|SR_DE /* initally clear ERL, enable FPA 32bit regs*/
-#endif mips3
-#endif
-
- mtc0 v0,C0_SR /* clr IntMsks/ kernel/disabled mode */
- nop
- mtc0 zero,C0_CAUSE /* clear software interrupts */
- nop
-
-#ifdef _R4000
- li v0,CFG_C_NONCOHERENT # initialise default cache mode
- mtc0 v0,C0_CONFIG
-#endif
-
-/*
-** check to see if an fpu is really plugged in
-*/
- li t3,0xaaaa5555 /* put a's and 5's in t3 */
- mtc1 t3,fp0 /* try to write them into fp0 */
- mtc1 zero,fp1 /* try to write zero in fp */
- mfc1 t0,fp0
- mfc1 t1,fp1
- nop
- bne t0,t3,1f /* branch if no match */
- nop
- bne t1,zero,1f /* double check for positive id */
- nop
- /* We have a FPU. clear fcsr */
- ctc1 zero, fcr31
- j 2f /* status register already correct */
- nop
-1:
-#ifdef _R3000
- li v0, SR_PE /* reset parity error/NO cp1 usable */
-#endif
-
-#ifdef _R4000
- li v0,SR_DE /* clear ERL and disable FPA */
-#endif
-
- mtc0 v0, C0_SR /* reset status register */
-2:
- la gp, _gp
-
- la v0,_fbss /* clear bss before using it */
- la v1,end /* end of bss */
-3: sw zero,0(v0)
- bltu v0,v1,3b
- add v0,4
-
-
-/************************************************************************
-**
-** Temporary Stack - needed to handle stack saves until
-** memory size is determined and permanent stack set
-**
-** MUST be uncached to avoid confusion at cache
-** switching during memory sizing
-**
-*************************************************************************/
-#if __mips==3
- /* For MIPS 3, we need to be sure that the stack is aligned on a
- * double word boundary.
- */
- andi t0, v0, 0x7
- beqz t0, 11f /* Last three bits Zero, already aligned */
- nop
- add v0, 4
-11:
-#endif
-
- or v0, K1BASE /* switch to uncached */
- add v1, v0, TMP_STKSIZE /* end of bss + length of tmp stack */
- sub v1, v1, (4*4) /* overhead */
- move sp, v1 /* set sp to top of stack */
-4: sw zero, 0(v0)
- bltu v0, v1, 4b /* clear out temp stack */
- add v0, 4
-
- jal init_exc_vecs /* install exception handlers */
- nop /* MUST do before memory probes */
-
- la v0, 5f
- li v1, K1BASE /* force into uncached space */
- or v0, v1 /* during memory/cache probes */
- j v0
- nop
-5:
- la a0, sim_mem_cfg_struct
- jal sim_mem_cfg /* Make SIM call to get mem size */
- nop
- la a0, sim_mem_cfg_struct
- lw a0, 0(a0) /* Get memory size from struct */
-#ifdef _R3000
- jal config_Icache
- nop
- jal config_Dcache /* determine size of D & I caches */
- nop
-#endif
-#ifdef _R4000
- jal config_cache /* determine size of D & I caches */
- nop
-#endif
-
- move v0, a0 /* mem_size */
-
-#if __mips==3
- /* For MIPS 3, we need to be sure that the stack (and hence v0
- * here) is aligned on a double word boundary.
- */
- andi t0, v0, 0x7
- beqz t0, 12f /* Last three bits Zero, already aligned */
- nop
- subu v0, 4 /* mem_size was not aligned on doubleword bdry????*/
-12:
-#endif
-
-
-
-/**************************************************************************
-**
-** Permanent Stack - now know top of memory, put permanent stack there
-**
-***************************************************************************/
-
- la t2, _fbss /* cache mode as linked */
- and t2, 0xF0000000 /* isolate segment */
- la t1, 6f
- j t1 /* back to original cache mode */
- nop
-6:
- or v0, t2 /* stack back to original cache mode */
- addiu v0,v0,-16 /* overhead */
- move sp, v0 /* now replace count w top of memory */
- move v1, v0
- subu v1, P_STACKSIZE /* clear requested stack size */
-
-7: sw zero, 0(v1) /* clear P_STACKSIZE stack */
- bltu v1,v0,7b
- add v1, 4
- .set reorder
-
-#ifdef _R3000
- jal flush_Icache
- jal flush_Dcache /* flush Data & Instruction caches */
-#endif
-#ifdef _R4000
- jal flush_cache_nowrite /* flush Data & Instruction caches */
-#endif
-
-
-
-/**************************************************************************
-**
-** If this chip supports a Translation Lookaside Buffer, clear it
-**
-***************************************************************************/
-
- .set noreorder
- mfc0 t1, C0_SR /* look at Status Register */
- nop
- .set reorder
-#ifdef _R3000
- li t2, SR_TS /* TLB Shutdown bit */
- and t1,t2 /* TLB Shutdown if 1 */
- bnez t1, 8f /* skip clearing if no TLB */
-#endif
-
-#ifndef R4650
- jal init_tlb /* clear the tlb */
-#endif
-
-
-/************************************************************************
-**
-** Initialization required if using IDT/c or libc.a, standard C Lib
-**
-** can SKIP if not necessary for application
-**
-************************************************************************/
-8:
-
- jal idtsim_init_sbrk
- jal idtsim_init_file
-/*********************** END I/O initialization **********************/
-
-
- jal main
-
- jal idtsim_promexit
-
-ENDFRAME(start)
-
-
- .globl sim_mem_cfg
-sim_mem_cfg:
- .set noat
- .set noreorder
- li AT, (0xbfc00000+((55)*8))
- jr AT
- nop
- .set at
- .set reorder
diff --git a/c/src/lib/start/sh/Makefile.in b/c/src/lib/start/sh/Makefile.in
deleted file mode 100644
index b5d382a468..0000000000
--- a/c/src/lib/start/sh/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH=@srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGMS=${ARCH}/start.o
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=start
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-# force optimization, unless start.o will not work
-# CFLAGS_PROFILE=
-# CFLAGS_DEBUG=-O3
-# CFLAGS_OPTIMIZE=-O3
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/start/sh/start.s b/c/src/lib/start/sh/start.s
deleted file mode 100644
index 9deeb53fed..0000000000
--- a/c/src/lib/start/sh/start.s
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include "asm.h"
-
- BEGIN_CODE
- PUBLIC(start)
-SYM (start):
- ! install the stack pointer
- mov.l stack_k,r15
-
- ! zero out bss
- mov.l edata_k,r0
- mov.l end_k,r1
- mov #0,r2
-0:
- mov.l r2,@r0
- add #4,r0
- cmp/ge r0,r1
- bt 0b
-
- ! copy the vector table from rom to ram
- mov.l vects_k,r0 ! vectab
- mov #0,r1 ! address of boot vector table
- mov #0,r2 | number of bytes copied
- mov.w vects_size,r3 ! size of entries in vectab
-1:
- mov.l @r1+,r4
- mov.l r4,@r0
- add #4,r0
- add #1,r2
- cmp/hi r3,r2
- bf 1b
-
- mov.l vects_k,r0 ! update vbr to point to vectab
- ldc r0,vbr
-
- ! call the mainline
- mov #0,r4 ! argc
- mov.l main_k,r0
- jsr @r0
- mov #0,r5 ! argv
-
- ! call exit
- mov r0,r4
- mov.l exit_k,r0
- jsr @r0
- or r0,r0
-
- END_CODE
-
- .align 2
-stack_k:
- .long SYM(stack)
-edata_k:
- .long SYM(edata)
-end_k:
- .long SYM(end)
-main_k:
- .long SYM(boot_card)
-exit_k:
- .long SYM(exit)
-
-vects_k:
- .long SYM(vectab)
-vects_size:
- .word 255
-
-#ifdef __ELF__
- .section .stack,"aw"
-#else
- .section .stack
-#endif
-SYM(stack):
- .long 0xdeaddead
diff --git a/c/src/lib/wrapup/Makefile.in b/c/src/lib/wrapup/Makefile.in
deleted file mode 100644
index d7c6fcdaf9..0000000000
--- a/c/src/lib/wrapup/Makefile.in
+++ /dev/null
@@ -1,73 +0,0 @@
-#
-# $Id$
-#
-# build and install "glommed" librtemsall.a
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-LIB=$(PROJECT_RELEASE)/lib/librtemsall${LIB_VARIANT}.a
-
-SRCS=$(wildcard $(PROJECT_RELEASE)/lib/libbsp$(LIB_VARIANT).a) \
- $(PROJECT_RELEASE)/lib/librtems$(LIB_VARIANT).a \
- $(wildcard $(PROJECT_RELEASE)/lib/libposix$(LIB_VARIANT).a) \
- $(wildcard $(PROJECT_RELEASE)/lib/libnetworking$(LIB_VARIANT).a) \
- $(wildcard $(PROJECT_RELEASE)/lib/libcpu$(LIB_VARIANT).a) \
- $(wildcard $(PROJECT_RELEASE)/lib/librtcio$(LIB_VARIANT).a) \
- $(wildcard $(PROJECT_RELEASE)/lib/libserialio$(LIB_VARIANT).a) \
- $(PROJECT_RELEASE)/lib/libcsupport$(LIB_VARIANT).a \
- $(PROJECT_RELEASE)/lib/libmisc$(LIB_VARIANT).a \
- $(wildcard $(PROJECT_RELEASE)/lib/rtems-ctor$(LIB_VARIANT).o) \
- $(wildcard $(PROJECT_RELEASE)/lib/libno-ctor$(LIB_VARIANT).a)
-
-CLEAN_ADDITIONS += $(ARCH)/check
-CLOBBER_ADDITIONS +=
-
-all: $(ARCH) $(LIB)
-
-install: all
-
-$(ARCH)/check:: $(SRCS)
- @$(RM) $@; touch $@;
- @for f in $(SRCS); do \
- case $$f in \
- *.o) echo " `basename $$f`" >> $@ \
- ;; \
- *.rel) echo " `basename $$f`" >> $@ \
- ;; \
- *.a) \
- ( list=`$(AR) t $$f`;\
- for i in $$list; do \
- if grep " $$i" $@; then \
- echo "ERROR -- $$i in multiple files"; exit 1; \
- fi;\
- echo " $$i" >> $@;\
- done; ) \
- ;; \
- esac; \
- done;
-
-$(LIB):: $(ARCH)/check
- @for f in $(SRCS); do \
- case $$f in \
- *.o) $(AR) ru $@ $$f \
- ;;\
- *.rel) $(AR) ru $@ $$f \
- ;;\
- *.a) \
- (cd $(ARCH); \
- list=`$(AR) t $$f`; \
- $(AR) x $$f $$list; $(AR) ru $@ $$list; \
- $(RM) $$list ;)\
- ;; \
- esac; \
- done;
- @$(RANLIB) $@
- @echo "*** Glommed $@"
diff --git a/c/src/libchip/rtc/Makefile.in b/c/src/libchip/rtc/Makefile.in
deleted file mode 100644
index 724a1af380..0000000000
--- a/c/src/libchip/rtc/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=librtcio.a
-LIB=${ARCH}/${LIBNAME}
-
-C_PIECES=\
- rtcprobe \
- icm7170 icm7170_reg icm7170_reg2 icm7170_reg4 icm7170_reg8 \
- m48t08 m48t08_reg m48t08_reg2 m48t08_reg4 m48t08_reg8
-
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-INSTALLED_H_FILES=$(srcdir)/rtc.h \
- $(srcdir)/icm7170.h $(srcdir)/m48t08.h
-
-SRCS=$(C_FILES) $(H_FILES) $(SYS_H_FILES) $(RTEMS_H_FILES) $(PRIVATE_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(LIBC_DEFINES)
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} preinstall $(LIB)
- $(INSTALL_VARIANT) -m 644 ${LIB} ${PROJECT_RELEASE}/lib
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
-
-# Install the library, appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-preinstall:
- $(INSTALL) -m 444 $(INSTALLED_H_FILES) $(PROJECT_INCLUDE)/libchip
-
-
diff --git a/c/src/libchip/rtc/README.ds1643 b/c/src/libchip/rtc/README.ds1643
deleted file mode 100644
index 4fab5b62c6..0000000000
--- a/c/src/libchip/rtc/README.ds1643
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# $Id$
-#
-
-The Mostek M48T08 is compatible with the Dallas Semiconductor DS1643. Please
-use that driver.
-
diff --git a/c/src/libchip/rtc/README.icm7170 b/c/src/libchip/rtc/README.icm7170
deleted file mode 100644
index de2199339d..0000000000
--- a/c/src/libchip/rtc/README.icm7170
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-
-
-Configuration Table Use
-=======================
-
-sDeviceName
-
- The name of this device.
-
-deviceType
-
- This field must be RTC_ICM7170.
-
-pDeviceFns
-
- The device interface control table. This must be icm7170_fns.
-
-deviceProbe
-
- This is the address of the routine which probes to see if the device
- is present.
-
-pDeviceParams
-
- This field specifies the clock frequency. It may be one of the
- following:
- ICM7170_AT_32_KHZ
- ICM7170_AT_1_MHZ
- ICM7170_AT_2_MHZ
- ICM7170_AT_4_MHZ
-
-ulCtrlPort1
-
- This field is the base address of the RTC area of the chip.
-
-ulCtrlPort2
-
- This field is ignored.
-
-ulDataPort
-
- This field is ignored.
-
-
-getRegister
-setRegister
-
- These follow standard conventions.
-
diff --git a/c/src/libchip/rtc/README.m48t08 b/c/src/libchip/rtc/README.m48t08
deleted file mode 100644
index d792d7957e..0000000000
--- a/c/src/libchip/rtc/README.m48t08
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# $Id$
-#
-
-
-Configuration Table Use
-=======================
-
-sDeviceName
-
- The name of this device.
-
-deviceType
-
- This field must be RTC_M48T08.
-
-pDeviceFns
-
- The device interface control table. This must be m48t08_fns.
-
-deviceProbe
-
- This is the address of the routine which probes to see if the device
- is present.
-
-pDeviceParams
-
- This is ignored and should be NULL.
-
-ulCtrlPort1
-
- This field is the base address of the RTC area of the chip. The
- NVRAM portion of the chip is ignored.
-
-ulCtrlPort2
-
- This field is ignored.
-
-ulDataPort
-
- This field is ignored.
-
-
-getRegister
-setRegister
-
- These follow standard conventions.
-
diff --git a/c/src/libchip/rtc/README.m48t18 b/c/src/libchip/rtc/README.m48t18
deleted file mode 100644
index 85fe918f23..0000000000
--- a/c/src/libchip/rtc/README.m48t18
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# $Id$
-#
-
-This is supported by the m48t08 driver.
diff --git a/c/src/libchip/rtc/STATUS b/c/src/libchip/rtc/STATUS
deleted file mode 100644
index e95a924ae9..0000000000
--- a/c/src/libchip/rtc/STATUS
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# $Id$
-#
-
-General
-=======
-
-+ It would be nice to utilize the interrupt capabilities of some
- RTC parts. This could be used to trigger checking the software
- clock against the hardware clock.
-
-+ The periodic capability of most RTCs is not suitable for use
- as a general purpose flexible clock tick source. For example,
- many RTCs generate only a handful of periods with 100 Hz being the
- most frequent.
-
-+ The tick field is not set on get. Anything smaller than a second
- is ignored on set and get operations.
-
-+ Day of week is ignored since RTEMS does not set it internally.
-
-+ There is no attempt in RTEMS to know about time zones.
-
-Harris ICM7170
-==============
-
-+ Tested on a DMV177.
-
-+ Interrupt capabilities are ignored.
-
-Mostek 48T08
-============
-
-+ Untested.
-
-+ NVRAM is ignored.
-
diff --git a/c/src/libchip/rtc/icm7170.c b/c/src/libchip/rtc/icm7170.c
deleted file mode 100644
index f3cf513d2e..0000000000
--- a/c/src/libchip/rtc/icm7170.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * This file interfaces with the real-time clock found in
- * a Harris ICM7170
- *
- * Year 2K Notes:
- *
- * This chip only uses a two digit field to store the year. This
- * code uses the RTEMS Epoch as a pivot year. This lets us map the
- * two digit year field as follows:
- *
- * + two digit years 0-87 are mapped to 2000-2087.
- * + two digit years 88-99 are mapped to 1988-1999.
- *
- * This is less than the time span supported by RTEMS.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <libchip/rtc.h>
-#include <libchip/icm7170.h>
-
-/*
- * Control register bits
- */
-
-/* XXX */
-
-/*
- * icm7170_initialize
- */
-
-void icm7170_initialize(
- int minor
-)
-{
- unsigned32 icm7170;
- setRegister_f setReg;
- unsigned32 clock;
-
- icm7170 = RTC_Table[ minor ].ulCtrlPort1;
- setReg = RTC_Table[ minor ].setRegister;
-
- /*
- * Initialize the RTC with the proper clock frequency
- */
-
- clock = (unsigned32) RTC_Table[ minor ].pDeviceParams;
- (*setReg)( icm7170, ICM7170_CONTROL, 0x0c | clock );
-}
-
-/*
- * icm7170_get_time
- */
-
-int icm7170_get_time(
- int minor,
- rtems_time_of_day *time
-)
-{
- unsigned32 icm7170;
- getRegister_f getReg;
- setRegister_f setReg;
- unsigned32 year;
-
- icm7170 = RTC_Table[ minor ].ulCtrlPort1;
- getReg = RTC_Table[ minor ].getRegister;
- setReg = RTC_Table[ minor ].setRegister;
-
- /*
- * Put the RTC into read mode
- */
-
- (void) (*getReg)( icm7170, ICM7170_COUNTER_HUNDREDTHS );
-
- /*
- * Now get the time
- */
-
-
- year = (*getReg)( icm7170, ICM7170_YEAR );
- if ( year < 88 )
- year += 2000;
- else
- year += 1900;
-
- time->year = year;
- time->month = (*getReg)( icm7170, ICM7170_MONTH );
- time->day = (*getReg)( icm7170, ICM7170_DATE );
- time->hour = (*getReg)( icm7170, ICM7170_HOUR );
- time->minute = (*getReg)( icm7170, ICM7170_MINUTE );
- time->second = (*getReg)( icm7170, ICM7170_SECOND );
-
- time->ticks = 0;
-
- /*
- * Put the RTC back into normal mode.
- */
-
- (void) (*getReg)( icm7170, ICM7170_COUNTER_HUNDREDTHS );
-
- return 0;
-}
-
-/*
- * icm7170_set_time
- */
-
-int icm7170_set_time(
- int minor,
- rtems_time_of_day *time
-)
-{
- unsigned32 icm7170;
- getRegister_f getReg;
- setRegister_f setReg;
- unsigned32 year;
- unsigned32 clock;
-
- icm7170 = RTC_Table[ minor ].ulCtrlPort1;
- getReg = RTC_Table[ minor ].getRegister;
- setReg = RTC_Table[ minor ].setRegister;
- clock = (unsigned32) RTC_Table[ minor ].pDeviceParams;
-
- year = time->year;
-
- if ( year >= 2088 )
- rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER );
-
- if ( year >= 2000 )
- year -= 2000;
- else
- year -= 1900;
-
- (*setReg)( icm7170, ICM7170_CONTROL, 0x04 | clock );
-
- (*setReg)( icm7170, ICM7170_YEAR, year );
- (*setReg)( icm7170, ICM7170_MONTH, time->month );
- (*setReg)( icm7170, ICM7170_DATE, time->day );
- (*setReg)( icm7170, ICM7170_HOUR, time->hour );
- (*setReg)( icm7170, ICM7170_MINUTE, time->minute );
- (*setReg)( icm7170, ICM7170_SECOND, time->second );
-
- /*
- * This is not really right.
- */
-
- (*setReg)( icm7170, ICM7170_DAY_OF_WEEK, 1 );
-
- /*
- * Put the RTC back into normal mode.
- */
-
- (*setReg)( icm7170, ICM7170_CONTROL, 0x0c | clock );
-
- return 0;
-}
-
-/*
- * Driver function table
- */
-
-rtc_fns icm7170_fns = {
- icm7170_initialize,
- icm7170_get_time,
- icm7170_set_time
-};
-
diff --git a/c/src/libchip/rtc/icm7170.h b/c/src/libchip/rtc/icm7170.h
deleted file mode 100644
index 5bf9fd065c..0000000000
--- a/c/src/libchip/rtc/icm7170.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * This file contains the definitions for the following real-time clocks:
- *
- * + Harris Semiconduction ICM7170
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __LIBCHIP_ICM7170_h
-#define __LIBCHIP_ICM7170_h
-
-/*
- * Register indices
- */
-
-#define ICM7170_CONTROL 0x11
-
-
-#define ICM7170_COUNTER_HUNDREDTHS 0x00
-#define ICM7170_HOUR 0x01
-#define ICM7170_MINUTE 0x02
-#define ICM7170_SECOND 0x03
-#define ICM7170_MONTH 0x04
-#define ICM7170_DATE 0x05
-#define ICM7170_YEAR 0x06
-#define ICM7170_DAY_OF_WEEK 0x07
-
-/*
- * Configuration information in the parameters field
- */
-
-#define ICM7170_AT_32_KHZ 0x00
-#define ICM7170_AT_1_MHZ 0x01
-#define ICM7170_AT_2_MHZ 0x02
-#define ICM7170_AT_4_MHZ 0x03
-
-/*
- * Driver function table
- */
-
-extern rtc_fns icm7170_fns;
-
-/*
- * Default register access routines
- */
-
-unsigned32 icm7170_get_register( /* registers are at 1 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void icm7170_set_register(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-unsigned32 icm7170_get_register_2( /* registers are at 2 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void icm7170_set_register_2(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-unsigned32 icm7170_get_register_4( /* registers are at 4 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void icm7170_set_register_4(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-unsigned32 icm7170_get_register_8( /* registers are at 8 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void icm7170_set_register_8(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-#endif
-/* end of include file */
diff --git a/c/src/libchip/rtc/icm7170_reg.c b/c/src/libchip/rtc/icm7170_reg.c
deleted file mode 100644
index b6961824b6..0000000000
--- a/c/src/libchip/rtc/icm7170_reg.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the icm7170 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are only byte-aligned (no address gaps)
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#ifndef _ICM7170_MULTIPLIER
-#define _ICM7170_MULTIPLIER 1
-#define _ICM7170_NAME(_X) _X
-#define _ICM7170_TYPE unsigned8
-#endif
-
-#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
- (_ICM7170_TYPE *)((_base) + ((_reg) * _ICM7170_MULTIPLIER ))
-
-/*
- * ICM7170 Get Register Routine
- */
-
-unsigned32 _ICM7170_NAME(icm7170_get_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum
-)
-{
- _ICM7170_TYPE *port;
-
- port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
-
- return *port;
-}
-
-/*
- * ICM7170 Set Register Routine
- */
-
-void _ICM7170_NAME(icm7170_set_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-)
-{
- _ICM7170_TYPE *port;
-
- port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
-
- *port = ucData;
-}
diff --git a/c/src/libchip/rtc/icm7170_reg2.c b/c/src/libchip/rtc/icm7170_reg2.c
deleted file mode 100644
index bab92697bf..0000000000
--- a/c/src/libchip/rtc/icm7170_reg2.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the icm7170 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 16-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _ICM7170_MULTIPLIER 2
-#define _ICM7170_NAME(_X) _X##_2
-#define _ICM7170_TYPE unsigned8
-
-#include "icm7170_reg.c"
-
diff --git a/c/src/libchip/rtc/icm7170_reg4.c b/c/src/libchip/rtc/icm7170_reg4.c
deleted file mode 100644
index 896e0cbc0b..0000000000
--- a/c/src/libchip/rtc/icm7170_reg4.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the icm7170 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 32-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _ICM7170_MULTIPLIER 4
-#define _ICM7170_NAME(_X) _X##_4
-#define _ICM7170_TYPE unsigned8
-
-#include "icm7170_reg.c"
-
diff --git a/c/src/libchip/rtc/icm7170_reg8.c b/c/src/libchip/rtc/icm7170_reg8.c
deleted file mode 100644
index d2ed2844ac..0000000000
--- a/c/src/libchip/rtc/icm7170_reg8.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the icm7170 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 64-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _ICM7170_MULTIPLIER 8
-#define _ICM7170_NAME(_X) _X##_8
-#define _ICM7170_TYPE unsigned8
-
-#include "icm7170_reg.c"
-
diff --git a/c/src/libchip/rtc/m48t08.c b/c/src/libchip/rtc/m48t08.c
deleted file mode 100644
index b3d0dcb0de..0000000000
--- a/c/src/libchip/rtc/m48t08.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * This file interfaces with the real-time clock found in
- * a Mostek M48T08 or M48T18 or compatibles.
- *
- * Year 2K Notes:
- *
- * This chip only uses a two digit field to store the year. This
- * code uses the RTEMS Epoch as a pivot year. This lets us map the
- * two digit year field as follows:
- *
- * + two digit years 0-87 are mapped to 2000-2087.
- * + two digit years 88-99 are mapped to 1988-1999.
- *
- * This is less than the time span supported by RTEMS.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <libchip/rtc.h>
-#include <libchip/m48t08.h>
-
-/*
- * Control register bits
- */
-
-#define M48T08_CONTROL_WRITE 0x80
-#define M48T08_CONTROL_READ 0x40
-#define M48T08_CONTROL_SIGN 0x20
-
-/*
- * m48t08_initialize
- */
-
-void m48t08_initialize(
- int minor
-)
-{
-}
-
-/*
- * m48t08_get_time
- */
-
-#define From_BCD( _x ) ((((_x) >> 4) * 10) + ((_x) & 0x0F))
-#define To_BCD( _x ) ((((_x) / 10) << 4) + ((_x) % 10))
-
-int m48t08_get_time(
- int minor,
- rtems_time_of_day *time
-)
-{
- unsigned32 m48t08;
- getRegister_f getReg;
- setRegister_f setReg;
- unsigned8 controlReg;
- unsigned32 value1;
- unsigned32 value2;
-
- m48t08 = RTC_Table[ minor ].ulCtrlPort1;
- getReg = RTC_Table[ minor ].getRegister;
- setReg = RTC_Table[ minor ].setRegister;
-
- /*
- * Put the RTC into read mode
- */
-
- controlReg = (*getReg)( m48t08, M48T08_CONTROL );
- (*setReg)( m48t08, M48T08_CONTROL, controlReg | M48T08_CONTROL_READ );
-
- value1 = (*getReg)( m48t08, M48T08_YEAR );
- value2 = From_BCD( value1 );
- if ( value2 < 88 )
- time->year = 2000 + value2;
- else
- time->year = 1900 + value2;
-
- value1 = (*getReg)( m48t08, M48T08_MONTH );
- time->month = From_BCD( value1 );
-
- value1 = (*getReg)( m48t08, M48T08_DATE );
- time->day = From_BCD( value1 );
-
- value1 = (*getReg)( m48t08, M48T08_HOUR );
- time->hour = From_BCD( value1 );
-
- value1 = (*getReg)( m48t08, M48T08_MINUTE );
- time->minute = From_BCD( value1 );
-
- value1 = (*getReg)( m48t08, M48T08_SECOND );
- time->second = From_BCD( value1 );
-
- time->ticks = 0;
-
- /*
- * Put the RTC back into normal mode.
- */
-
- (*setReg)( m48t08, M48T08_CONTROL, controlReg );
-
- return 0;
-}
-
-/*
- * m48t08_set_time
- */
-
-int m48t08_set_time(
- int minor,
- rtems_time_of_day *time
-)
-{
- unsigned32 m48t08;
- getRegister_f getReg;
- setRegister_f setReg;
- unsigned8 controlReg;
-
- m48t08 = RTC_Table[ minor ].ulCtrlPort1;
- getReg = RTC_Table[ minor ].getRegister;
- setReg = RTC_Table[ minor ].setRegister;
-
- /*
- * Put the RTC into read mode
- */
-
- controlReg = (*getReg)( m48t08, M48T08_CONTROL );
- (*setReg)( m48t08, M48T08_CONTROL, controlReg | M48T08_CONTROL_WRITE );
-
- if ( time->year >= 2088 )
- rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER );
-
- (*setReg)( m48t08, M48T08_YEAR, To_BCD(time->year % 100) );
- (*setReg)( m48t08, M48T08_MONTH, To_BCD(time->month) );
- (*setReg)( m48t08, M48T08_DATE, To_BCD(time->day) );
- (*setReg)( m48t08, M48T08_HOUR, To_BCD(time->hour) );
- (*setReg)( m48t08, M48T08_MINUTE, To_BCD(time->minute) );
- (*setReg)( m48t08, M48T08_SECOND, To_BCD(time->second) );
-
- /*
- * Put the RTC back into normal mode.
- */
-
- (*setReg)( m48t08, M48T08_CONTROL, controlReg );
-
- return 0;
-}
-
-/*
- * Driver function table
- */
-
-rtc_fns m48t08_fns = {
- m48t08_initialize,
- m48t08_get_time,
- m48t08_set_time
-};
-
diff --git a/c/src/libchip/rtc/m48t08.h b/c/src/libchip/rtc/m48t08.h
deleted file mode 100644
index 7d27215e1e..0000000000
--- a/c/src/libchip/rtc/m48t08.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * This file contains the definitions for the following real-time clocks:
- *
- * + Mostek M48T08
- * + Mostek M48T18
- * + Dallas Semiconductor DS1643
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __LIBCHIP_M48T08_h
-#define __LIBCHIP_M48T08_h
-
-/*
- * Register indices
- */
-
-#define M48T08_CONTROL 0
-#define M48T08_SECOND 1
-#define M48T08_MINUTE 2
-#define M48T08_HOUR 3
-#define M48T08_DAY_OF_WEEK 4
-#define M48T08_DATE 5
-#define M48T08_MONTH 6
-#define M48T08_YEAR 7
-
-/*
- * Driver function table
- */
-
-extern rtc_fns m48t08_fns;
-
-/*
- * Default register access routines
- */
-
-unsigned32 m48t08_get_register( /* registers are at 1 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void m48t08_set_register(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-unsigned32 m48t08_get_register_2( /* registers are at 2 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void m48t08_set_register_2(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-unsigned32 m48t08_get_register_4( /* registers are at 4 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void m48t08_set_register_4(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-unsigned32 m48t08_get_register_8( /* registers are at 8 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void m48t08_set_register_8(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-);
-
-#endif
-/* end of include file */
diff --git a/c/src/libchip/rtc/m48t08_reg.c b/c/src/libchip/rtc/m48t08_reg.c
deleted file mode 100644
index abb37c628c..0000000000
--- a/c/src/libchip/rtc/m48t08_reg.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the m48t08 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are only byte-aligned (no address gaps)
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#ifndef _M48T08_MULTIPLIER
-#define _M48T08_MULTIPLIER 1
-#define _M48T08_NAME(_X) _X
-#define _M48T08_TYPE unsigned8
-#endif
-
-#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
- (_M48T08_TYPE *)((_base) + ((_reg) * _M48T08_MULTIPLIER ))
-
-/*
- * M48T08 Get Register Routine
- */
-
-unsigned32 _M48T08_NAME(m48t08_get_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum
-)
-{
- _M48T08_TYPE *port;
-
- port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
-
- return *port;
-}
-
-/*
- * M48T08 Set Register Routine
- */
-
-void _M48T08_NAME(m48t08_set_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned32 ucData
-)
-{
- _M48T08_TYPE *port;
-
- port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
-
- *port = ucData;
-}
diff --git a/c/src/libchip/rtc/m48t08_reg2.c b/c/src/libchip/rtc/m48t08_reg2.c
deleted file mode 100644
index a6f294a3f7..0000000000
--- a/c/src/libchip/rtc/m48t08_reg2.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the m48t08 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 16-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _M48T08_MULTIPLIER 2
-#define _M48T08_NAME(_X) _X##_2
-#define _M48T08_TYPE unsigned8
-
-#include "m48t08_reg.c"
-
diff --git a/c/src/libchip/rtc/m48t08_reg4.c b/c/src/libchip/rtc/m48t08_reg4.c
deleted file mode 100644
index a84b988a34..0000000000
--- a/c/src/libchip/rtc/m48t08_reg4.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the m48t08 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 32-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _M48T08_MULTIPLIER 4
-#define _M48T08_NAME(_X) _X##_4
-#define _M48T08_TYPE unsigned8
-
-#include "m48t08_reg.c"
-
diff --git a/c/src/libchip/rtc/m48t08_reg8.c b/c/src/libchip/rtc/m48t08_reg8.c
deleted file mode 100644
index dcc2a9b39b..0000000000
--- a/c/src/libchip/rtc/m48t08_reg8.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the m48t08 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 64-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _M48T08_MULTIPLIER 8
-#define _M48T08_NAME(_X) _X##_8
-#define _M48T08_TYPE unsigned8
-
-#include "m48t08_reg.c"
-
diff --git a/c/src/libchip/rtc/rtc.h b/c/src/libchip/rtc/rtc.h
deleted file mode 100644
index 94b42e3f34..0000000000
--- a/c/src/libchip/rtc/rtc.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * This file contains the Real-Time Clock definitions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __LIBCHIP_RTC_h
-#define __LIBCHIP_RTC_h
-
-/*
- * Types for get and set register routines
- */
-
-typedef unsigned32 (*getRegister_f)(unsigned32 port, unsigned8 register);
-typedef void (*setRegister_f)(
- unsigned32 port, unsigned8 reg, unsigned32 value);
-
-typedef struct _rtc_fns {
- void (*deviceInitialize)(int minor);
- int (*deviceGetTime)(int minor, rtems_time_of_day *time);
- int (*deviceSetTime)(int minor, rtems_time_of_day *time);
-} rtc_fns;
-
-typedef enum {
- RTC_M48T08, /* SGS-Thomsom M48T08 or M48T18 */
- RTC_ICM7170, /* Harris ICM-7170 */
- RTC_CUSTOM /* BSP specific driver */
-} rtc_devs;
-
-/*
- * Each field is interpreted thus:
- *
- * sDeviceName This is the name of the device.
- *
- * deviceType This indicates the chip type.
- *
- * pDeviceFns This is a pointer to the set of driver routines to use.
- *
- * pDeviceParams This contains either device specific data or a pointer to a
- * device specific information table.
- *
- * ulCtrlPort1 This is the primary control port number for the device.
- *
- * ulCtrlPort2 This is the secondary control port number.
- *
- * ulDataPort This is the port number for the data port of the device
- *
- * getRegister This is the routine used to read register values.
- *
- * setRegister This is the routine used to write register values.
- */
-
-typedef struct _rtc_tbl {
- char *sDeviceName;
- rtc_devs deviceType;
- rtc_fns *pDeviceFns;
- boolean (*deviceProbe)(int minor);
- void *pDeviceParams;
- unsigned32 ulCtrlPort1;
- unsigned32 ulDataPort;
- getRegister_f getRegister;
- setRegister_f setRegister;
-} rtc_tbl;
-
-extern rtc_tbl RTC_Table[];
-extern unsigned long RTC_Count;
-
-
-boolean rtc_probe( int minor );
-
-#endif
-/* end of include file */
diff --git a/c/src/libchip/rtc/rtcprobe.c b/c/src/libchip/rtc/rtcprobe.c
deleted file mode 100644
index 6aaad89486..0000000000
--- a/c/src/libchip/rtc/rtcprobe.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains the default Real-Time Clock probe routine.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <libchip/rtc.h>
-
-
-boolean rtc_probe(
- int minor
-)
-{
- return TRUE;
-}
diff --git a/c/src/libchip/serial/Makefile.in b/c/src/libchip/serial/Makefile.in
deleted file mode 100644
index d9c78faf97..0000000000
--- a/c/src/libchip/serial/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=libserialio.a
-LIB=${ARCH}/${LIBNAME}
-
-C_PIECES=\
- mc68681 mc68681_baud mc68681_reg mc68681_reg2 mc68681_reg4 mc68681_reg8 \
- ns16550 \
- z85c30 z85c30_reg \
- serprobe termios_baud2index termios_baud2num
-
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-INSTALLED_H_FILES=$(srcdir)/mc68681.h $(srcdir)/ns16550.h $(srcdir)/z85c30.h \
- $(srcdir)/serial.h
-SRCS=$(C_FILES) $(H_FILES) $(SYS_H_FILES) $(RTEMS_H_FILES) $(PRIVATE_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(LIBC_DEFINES)
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} preinstall $(LIB)
- $(INSTALL_VARIANT) -m 644 ${LIB} ${PROJECT_RELEASE}/lib
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
-
-# Install the library, appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-preinstall:
- $(INSTALL) -m 444 $(INSTALLED_H_FILES) $(PROJECT_INCLUDE)/libchip
-
-
diff --git a/c/src/libchip/serial/README b/c/src/libchip/serial/README
deleted file mode 100644
index 3a1013b45b..0000000000
--- a/c/src/libchip/serial/README
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# $Id$
-#
-
-This is the serial controller portion of the libchip library. This
-directory contains the source code for reusable console driver
-support code. Each individual driver is configured using the
-console_tbl data structure. This structure is defined and explained
-in the console.h file.
-
-The reusable chip drivers do not directly access the serial controller.
-They access the registers on the controller via a set of up to four
-functions which are provided by the BSP. These functins set and get
-general registers and data buffers. Some chips can access the data
-buffers as general registers and thus the driver may not require
-those interface routines.
-
diff --git a/c/src/libchip/serial/README.mc68681 b/c/src/libchip/serial/README.mc68681
deleted file mode 100644
index 240faf759b..0000000000
--- a/c/src/libchip/serial/README.mc68681
+++ /dev/null
@@ -1,87 +0,0 @@
-#
-# $Id$
-#
-
-Configuration Table Use
-=======================
-
-sDeviceName
-
- The name of this device.
-
-deviceType
-
- This field must be SERIAL_MC68681.
-
-pDeviceFns
-
- The device interface control table. This may be:
- + mc68681_fns for interrupt driven IO
- + mc68681_fns_polled for polled IO
-
-deviceProbe
-
- This is the address of the routine which probes to see if the device
- is present.
-
-pDeviceFlow
-
- This field is ignored as hardware flow control is not currently supported.
-
-ulMargin
-
- This is currently unused.
-
-ulHysteresis
-
- This is currently unused.
-
-pDeviceParams
-
- This is set to the default settings.
-
-ulCtrlPort1
-
- This field is the base address of the entire DUART.
-
-ulCtrlPort2
-
- This field is the base address of the port specific registers.
-
-ulDataPort
-
- This field is bit mapped as follows:
- bit 0: baud rate set a or b
- bit 1-2: BRG selection ("Select Extend bit")
-
- Note: If both ports on single DUART are not configured for the same
- baud rate set, then unexpected results will occur.
-
- Note: On the Exar 88c681, if a standard clock of 3.6864 Mhz is used
- and the "Select Extend bit" is 0 (disabled), then the default
- MC68681 baud rate table is selected.
-
-getRegister
-setRegister
-
- These follow standard conventions.
-
-getData
-setData
-
- These are unused since the TX and RX data registers can be accessed
- as regular registers.
-
-ulClock
-
- This is a pointer to a baud rate mapping table. If set to
- mc68681_baud_rate_table, then the CSR/ACR/X bit mappings shown
- in the 68681 and 88681 manuals are used. Otherwise, the board
- specific baud rate mapping is used.
-
- NULL is not a valid value.
-
-ulIntVector
-
- This is the interrupt vector number associated with this chip.
-
diff --git a/c/src/libchip/serial/README.ns16550 b/c/src/libchip/serial/README.ns16550
deleted file mode 100644
index 2956173b1b..0000000000
--- a/c/src/libchip/serial/README.ns16550
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# $Id$
-#
-
-This driver needs to be debugged before this is written.
diff --git a/c/src/libchip/serial/README.xr88681 b/c/src/libchip/serial/README.xr88681
deleted file mode 100644
index 37364aaec6..0000000000
--- a/c/src/libchip/serial/README.xr88681
+++ /dev/null
@@ -1,6 +0,0 @@
-#
-# $Id$
-#
-
-The Exar XR88681 is an enhanced version of the Motorola MC68681 and is
-supported by the mc68681 driver.
diff --git a/c/src/libchip/serial/README.z85c30 b/c/src/libchip/serial/README.z85c30
deleted file mode 100644
index 4442b5ef40..0000000000
--- a/c/src/libchip/serial/README.z85c30
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# $Id$
-#
-
-Configuration Table Use
-=======================
-
-sDeviceName
-
- The name of this device.
-
-deviceType
-
- This field must be SERIAL_Z85C30.
-
-pDeviceFns
-
- The device interface control table. This may be:
- + z85c30_fns for interrupt driven IO
- + z85c30_fns_polled for polled IO
-
-deviceProbe
-
- This is the address of the routine which probes to see if the device
- is present.
-
-pDeviceFlow
-
- This field is set to one of the following values:
- + NULL for no hardware flow control
- + z85c30_flow_RTSCTS for RTS/CTS based flow control
- + z85c30_flow_DTRCTS for DTR/CTS based flow control
-
-ulMargin
-
- This is currently unused.
-
-ulHysteresis
-
- This is currently unused.
-
-pDeviceParams
-
- This is set to the default settings.
-
-ulCtrlPort1
-
- This field is the address of the control register for this port.
-
-ulCtrlPort2
-
- This field is the address of the control register for chip.
-
-ulDataPort
-
- This field is the address of the data register for this port.
-
-getRegister
-setRegister
-
- These follow standard conventions.
-
-getData
-setData
-
- These follow standard conventions.
-
-ulClock
-
- This is the clock speed of the baud rate clock.
- NULL, then the CSR/ACR/X bit mappings shown in the 68681 and 88681
- manuals are used. Otherwise, the board specific baud rate mapping
- is used.
-
-ulIntVector
-
- This is the interrupt vector number associated with this chip.
-
diff --git a/c/src/libchip/serial/STATUS b/c/src/libchip/serial/STATUS
deleted file mode 100644
index 6eb7fa4171..0000000000
--- a/c/src/libchip/serial/STATUS
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# $Id$
-#
-
-General
-=======
-
-+ Hardware flow control is not currently supported. Some of the chip
- drivers (in particular the z8530) have support for hardware flow control
- but this has not been tested in the libchip context. There will need
- to be a way to totally disabled hardware flow control which is not
- currently in this.
-
-+ "ulClockSpeed" configuration item field to become a pointer to a table
- of chip specific information. For example, the z8530 should specify
- clock speed and clock divisor setting.
-
-+ A termios structure should be included to specify the initial settings.
- Right now all drivers default to 9600, 8N1.
-
-+ Need to switch to passing pointers rather than a minor number to
- functions which are strictly internal to each chip driver. This
- should be a performance win.
-
-+ Need a test which prompts you for termios settings and tests them. Until
- this happens, testing for the variety of settings possible will be limited.
- This test should be able to test any serial port while prompts come to the
- console.
-
-MC68681
-=======
-
-+ Works interrupt and polled.
-
-+ Hardware flow control not included.
-
-NS16650
-=======
-
-+ Not tested in libchip context. Based on Radstone PPC2 driver which worked
- well.
-
-+ Interrupt code has been reworked to not use ring buffer and may be broken
- as it has not been tested since this was done.
-
-+ ns16550_set-attributes function is untested.
-
-+ Hardware flow control included but is currently disabled in ISR.
-
-Z85C30
-======
-
-+ Works polled and interrupt.
-
-+ Hardware flow control included but is currently disabled in ISR.
-
-+ Needs to support mode where more specific vectors are generated.
-
diff --git a/c/src/libchip/serial/mc68681.c b/c/src/libchip/serial/mc68681.c
deleted file mode 100644
index a917f5aa46..0000000000
--- a/c/src/libchip/serial/mc68681.c
+++ /dev/null
@@ -1,756 +0,0 @@
-/*
- * This file contains the termios TTY driver for the Motorola MC68681.
- *
- * This part is available from a number of secondary sources.
- * In particular, we know about the following:
- *
- * + Exar 88c681 and 68c681
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <rtems/libio.h>
-#include <stdlib.h>
-
-#include <libchip/serial.h>
-#include <libchip/mc68681.h>
-#include "sersupp.h"
-#include "mc68681_p.h"
-
-/*
- * Flow control is only supported when using interrupts
- */
-
-console_fns mc68681_fns =
-{
- libchip_serial_default_probe, /* deviceProbe */
- mc68681_open, /* deviceFirstOpen */
- NULL, /* deviceLastClose */
- NULL, /* deviceRead */
- mc68681_write_support_int, /* deviceWrite */
- mc68681_initialize_interrupts, /* deviceInitialize */
- mc68681_write_polled, /* deviceWritePolled */
- mc68681_set_attributes, /* deviceSetAttributes */
- TRUE /* deviceOutputUsesInterrupts */
-};
-
-console_fns mc68681_fns_polled =
-{
- libchip_serial_default_probe, /* deviceProbe */
- mc68681_open, /* deviceFirstOpen */
- mc68681_close, /* deviceLastClose */
- mc68681_inbyte_nonblocking_polled, /* deviceRead */
- mc68681_write_support_polled, /* deviceWrite */
- mc68681_init, /* deviceInitialize */
- mc68681_write_polled, /* deviceWritePolled */
- mc68681_set_attributes, /* deviceSetAttributes */
- FALSE, /* deviceOutputUsesInterrupts */
-};
-
-extern void set_vector( rtems_isr_entry, rtems_vector_number, int );
-
-/*
- * Console Device Driver Entry Points
- */
-
-/*
- * mc68681_baud_rate
- *
- * This routine returns the proper ACR bit and baud rate field values
- * based on the requested baud rate. The baud rate set to be used
- * must be configured by the user.
- */
-
-MC68681_STATIC int mc68681_baud_rate(
- int minor,
- int baud,
- unsigned int *baud_mask_p,
- unsigned int *acr_bit_p,
- unsigned int *command
-);
-
-/*
- * mc68681_set_attributes
- *
- * This function sets the DUART channel to reflect the requested termios
- * port settings.
- */
-
-MC68681_STATIC int mc68681_set_attributes(
- int minor,
- const struct termios *t
-)
-{
- unsigned32 pMC68681_port;
- unsigned32 pMC68681;
- unsigned int mode1;
- unsigned int mode2;
- unsigned int baud_mask;
- unsigned int acr_bit;
- unsigned int cmd;
- setRegister_f setReg;
- rtems_interrupt_level Irql;
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Set the baud rate
- */
-
- if (mc68681_baud_rate( minor, t->c_cflag, &baud_mask, &acr_bit, &cmd ) == -1)
- return -1;
-
- baud_mask |= baud_mask << 4;
- acr_bit <<= 7;
-
- /*
- * Parity
- */
-
- mode1 = 0;
- mode2 = 0;
-
- if (t->c_cflag & PARENB) {
- if (t->c_cflag & PARODD)
- mode1 |= 0x04;
- else
- mode1 |= 0x04;
- } else {
- mode1 |= 0x10;
- }
-
- /*
- * Character Size
- */
-
- if (t->c_cflag & CSIZE) {
- switch (t->c_cflag & CSIZE) {
- case CS5: break;
- case CS6: mode1 |= 0x01; break;
- case CS7: mode1 |= 0x02; break;
- case CS8: mode1 |= 0x03; break;
- }
- } else {
- mode1 |= 0x03; /* default to 9600,8,N,1 */
- }
-
- /*
- * Stop Bits
- */
-
- if (t->c_cflag & CSTOPB) {
- mode2 |= 0x07; /* 2 stop bits */
- } else {
- if ((t->c_cflag & CSIZE) == CS5) /* CS5 and 2 stop bits not supported */
- return -1;
- mode2 |= 0x0F; /* 1 stop bit */
- }
-
- rtems_interrupt_disable(Irql);
- (*setReg)( pMC68681, MC68681_AUX_CTRL_REG, acr_bit );
- (*setReg)( pMC68681_port, MC68681_CLOCK_SELECT, baud_mask );
- if ( cmd ) {
- (*setReg)( pMC68681_port, MC68681_COMMAND, cmd ); /* RX */
- (*setReg)( pMC68681_port, MC68681_COMMAND, cmd | 0x20 ); /* TX */
- }
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_RESET_MR_PTR );
- (*setReg)( pMC68681_port, MC68681_MODE, mode1 );
- (*setReg)( pMC68681_port, MC68681_MODE, mode2 );
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * mc68681_initialize_context
- *
- * This function sets the default values of the per port context structure.
- */
-
-MC68681_STATIC void mc68681_initialize_context(
- int minor,
- mc68681_context *pmc68681Context
-)
-{
- int port;
- unsigned int pMC68681;
- unsigned int pMC68681_port;
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
-
- pmc68681Context->mate = -1;
-
- for (port=0 ; port<Console_Port_Count ; port++ ) {
- if ( Console_Port_Tbl[port].ulCtrlPort1 == pMC68681 &&
- Console_Port_Tbl[port].ulCtrlPort2 != pMC68681_port ) {
- pmc68681Context->mate = port;
- pmc68681Context->imr = 0;
- break;
- }
- }
-
-}
-
-/*
- * mc68681_init
- *
- * This function initializes the DUART to a quiecsent state.
- */
-
-MC68681_STATIC void mc68681_init(int minor)
-{
- unsigned32 pMC68681_port;
- unsigned32 pMC68681;
- mc68681_context *pmc68681Context;
- setRegister_f setReg;
- getRegister_f getReg;
-
- pmc68681Context = (mc68681_context *) malloc(sizeof(mc68681_context));
-
- Console_Port_Data[minor].pDeviceContext = (void *)pmc68681Context;
-
- mc68681_initialize_context( minor, pmc68681Context );
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- setReg = Console_Port_Tbl[minor].setRegister;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- /*
- * Reset everything and leave this port disabled.
- */
-
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_RESET_RX );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_RESET_TX );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_RESET_ERROR );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_RESET_BREAK );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_STOP_BREAK );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_DISABLE_TX );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_DISABLE_RX );
-
-
- (*setReg)( pMC68681_port, MC68681_MODE_REG_1A, 0x00 );
- (*setReg)( pMC68681_port, MC68681_MODE_REG_2A, 0x02 );
-
- /*
- * Disable interrupts on RX and TX for this port
- */
-
- mc68681_enable_interrupts( minor, MC68681_IMR_DISABLE_ALL );
-}
-
-/*
- * mc68681_open
- *
- * This function opens a port for communication.
- *
- * Default state is 9600 baud, 8 bits, No parity, and 1 stop bit.
- */
-
-MC68681_STATIC int mc68681_open(
- int major,
- int minor,
- void *arg
-)
-{
- unsigned32 pMC68681;
- unsigned32 pMC68681_port;
- unsigned int baud;
- unsigned int acr;
- unsigned int vector;
- unsigned int command;
- rtems_interrupt_level Irql;
- setRegister_f setReg;
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- setReg = Console_Port_Tbl[minor].setRegister;
- vector = Console_Port_Tbl[minor].ulIntVector;
-
- /* XXX default baud rate should be from configuration table */
-
- (void) mc68681_baud_rate( minor, B9600, &baud, &acr, &command );
-
- /*
- * Set the DUART channel to a default useable state
- */
-
- rtems_interrupt_disable(Irql);
- (*setReg)( pMC68681, MC68681_AUX_CTRL_REG, acr );
- (*setReg)( pMC68681_port, MC68681_CLOCK_SELECT, baud );
- if ( command ) {
- (*setReg)( pMC68681_port, MC68681_COMMAND, command ); /* RX */
- (*setReg)( pMC68681_port, MC68681_COMMAND, command | 0x20 ); /* TX */
- }
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_RESET_MR_PTR );
- (*setReg)( pMC68681_port, MC68681_MODE, 0x13 );
- (*setReg)( pMC68681_port, MC68681_MODE, 0x07 );
- rtems_interrupt_enable(Irql);
-
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_ENABLE_TX );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_ENABLE_RX );
-
- (*setReg)( pMC68681, MC68681_INTERRUPT_VECTOR_REG, vector );
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * mc68681_close
- *
- * This function shuts down the requested port.
- */
-
-MC68681_STATIC int mc68681_close(
- int major,
- int minor,
- void *arg
-)
-{
- unsigned32 pMC68681;
- unsigned32 pMC68681_port;
- setRegister_f setReg;
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Disable interrupts from this channel and then disable it totally.
- */
-
-#if 0
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_DISABLE_TX );
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_DISABLE_RX );
-#endif
-
- return(RTEMS_SUCCESSFUL);
-}
-
-/*
- * mc68681_write_polled
- *
- * This routine polls out the requested character.
- */
-
-MC68681_STATIC void mc68681_write_polled(
- int minor,
- char cChar
-)
-{
- unsigned32 pMC68681_port;
- unsigned char ucLineStatus;
- int iTimeout;
- getRegister_f getReg;
- setRegister_f setReg;
-
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- getReg = Console_Port_Tbl[minor].getRegister;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * wait for transmitter holding register to be empty
- */
- iTimeout = 1000;
- ucLineStatus = (*getReg)(pMC68681_port, MC68681_STATUS);
- while ((ucLineStatus & (MC68681_TX_READY|MC68681_TX_EMPTY)) == 0) {
-
- if ((ucLineStatus & 0xF0))
- (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_RESET_ERROR );
-
- /*
- * Yield while we wait
- */
-
-#if 0
- if(_System_state_Is_up(_System_state_Get())) {
- rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
- }
-#endif
- ucLineStatus = (*getReg)(pMC68681_port, MC68681_STATUS);
- if(!--iTimeout) {
- break;
- }
- }
-
- /*
- * transmit character
- */
-
- (*setReg)(pMC68681_port, MC68681_TX_BUFFER, cChar);
-}
-
-/*
- * mc68681_isr
- *
- * This is the single interrupt entry point which parcels interrupts
- * out to the various ports.
- */
-
-MC68681_STATIC rtems_isr mc68681_isr(
- rtems_vector_number vector
-)
-{
- int minor;
-
- for(minor=0 ; minor<Console_Port_Count ; minor++) {
- if(Console_Port_Tbl[minor].ulIntVector == vector &&
- Console_Port_Tbl[minor].deviceType == SERIAL_MC68681 ) {
- mc68681_process(minor);
- }
- }
-}
-
-/*
- * mc68681_initialize_interrupts
- *
- * This routine initializes the console's receive and transmit
- * ring buffers and loads the appropriate vectors to handle the interrupts.
- */
-
-MC68681_STATIC void mc68681_initialize_interrupts(int minor)
-{
- mc68681_init(minor);
-
- Console_Port_Data[minor].bActive = FALSE;
-
- set_vector(mc68681_isr, Console_Port_Tbl[minor].ulIntVector, 1);
-
- mc68681_enable_interrupts(minor,MC68681_IMR_ENABLE_ALL_EXCEPT_TX);
-}
-
-/*
- * mc68681_write_support_int
- *
- * Console Termios output entry point when using interrupt driven output.
- */
-
-MC68681_STATIC int mc68681_write_support_int(
- int minor,
- const char *buf,
- int len
-)
-{
- unsigned32 Irql;
- unsigned32 pMC68681_port;
- setRegister_f setReg;
-
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * We are using interrupt driven output and termios only sends us
- * one character at a time.
- */
-
- if ( !len )
- return 0;
-
- /*
- * Put the character out and enable interrupts if necessary.
- */
-
- rtems_interrupt_disable(Irql);
- if ( Console_Port_Data[minor].bActive == FALSE ) {
- Console_Port_Data[minor].bActive = TRUE;
- mc68681_enable_interrupts(minor, MC68681_IMR_ENABLE_ALL);
- }
- (*setReg)(pMC68681_port, MC68681_TX_BUFFER, *buf);
- rtems_interrupt_enable(Irql);
-
- return 1;
-}
-
-/*
- * mc68681_write_support_polled
- *
- * Console Termios output entry point when using polled output.
- *
- */
-
-MC68681_STATIC int mc68681_write_support_polled(
- int minor,
- const char *buf,
- int len
-)
-{
- int nwrite = 0;
-
- /*
- * poll each byte in the string out of the port.
- */
- while (nwrite < len) {
- /*
- * transmit character
- */
- mc68681_write_polled(minor, *buf++);
- nwrite++;
- }
-
- /*
- * return the number of bytes written.
- */
- return nwrite;
-}
-
-/*
- * mc68681_inbyte_nonblocking_polled
- *
- * Console Termios polling input entry point.
- */
-
-MC68681_STATIC int mc68681_inbyte_nonblocking_polled(
- int minor
-)
-{
- unsigned32 pMC68681_port;
- unsigned char ucLineStatus;
- unsigned char cChar;
- getRegister_f getReg;
-
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- ucLineStatus = (*getReg)(pMC68681_port, MC68681_STATUS);
- if(ucLineStatus & MC68681_RX_READY) {
- cChar = (*getReg)(pMC68681_port, MC68681_RX_BUFFER);
- return (int)cChar;
- } else {
- return -1;
- }
-}
-
-/*
- * mc68681_baud_rate
- */
-
-MC68681_STATIC int mc68681_baud_rate(
- int minor,
- int baud,
- unsigned int *baud_mask_p,
- unsigned int *acr_bit_p,
- unsigned int *command
-)
-{
- unsigned int baud_mask;
- unsigned int acr_bit;
- int status;
- int is_extended;
- int baud_requested;
- mc68681_baud_table_t *baud_tbl;
-
- baud_mask = 0;
- acr_bit = 0;
- status = 0;
-
- if ( !(Console_Port_Tbl[minor].ulDataPort & MC68681_DATA_BAUD_RATE_SET_1) )
- acr_bit = 1;
-
- is_extended = 0;
-
- switch (Console_Port_Tbl[minor].ulDataPort & MC68681_XBRG_MASK) {
- case MC68681_XBRG_IGNORED:
- *command = 0x00;
- break;
- case MC68681_XBRG_ENABLED:
- *command = 0x80;
- is_extended = 1;
- break;
- case MC68681_XBRG_DISABLED:
- *command = 0x90;
- break;
- }
-
- baud_requested = baud & CBAUD;
- if (!baud_requested)
- baud_requested = B9600; /* default to 9600 baud */
-
- baud_requested = termios_baud_to_index( baud_requested );
-
- baud_tbl = (mc68681_baud_table_t *) Console_Port_Tbl[minor].ulClock;
- if (!baud_tbl)
- rtems_fatal_error_occurred(RTEMS_INVALID_ADDRESS);
-
- if ( is_extended )
- baud_mask = (unsigned int)baud_tbl[ acr_bit + 2 ][ baud_requested ];
- else
- baud_mask = baud_tbl[ acr_bit ][ baud_requested ];
-
- if ( baud_mask == MC68681_BAUD_NOT_VALID )
- status = -1;
-
- /*
- * upper nibble is receiver and lower nibble is transmitter
- */
-
- *baud_mask_p = (baud_mask << 4) | baud_mask;
- *acr_bit_p = acr_bit;
- return status;
-}
-
-/*
- * mc68681_process
- *
- * This routine is the per port console interrupt handler.
- */
-
-MC68681_STATIC void mc68681_process(
- int minor
-)
-{
- unsigned32 pMC68681;
- unsigned32 pMC68681_port;
- volatile unsigned8 ucLineStatus;
- unsigned char cChar;
- getRegister_f getReg;
- setRegister_f setReg;
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- getReg = Console_Port_Tbl[minor].getRegister;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Deal with any received characters
- */
- while(TRUE) {
- ucLineStatus = (*getReg)(pMC68681_port, MC68681_STATUS);
- if(!(ucLineStatus & MC68681_RX_READY)) {
- break;
- }
- /*
- * If there is a RX error, then dump all the data.
- */
- if ( ucLineStatus & MC68681_RX_ERRORS ) {
- do {
- cChar = (*getReg)(pMC68681_port, MC68681_RX_BUFFER);
- ucLineStatus = (*getReg)(pMC68681_port, MC68681_STATUS);
- } while ( ucLineStatus & MC68681_RX_READY );
- continue;
- }
- cChar = (*getReg)(pMC68681_port, MC68681_RX_BUFFER);
- rtems_termios_enqueue_raw_characters(
- Console_Port_Data[minor].termios_data,
- &cChar,
- 1
- );
- }
-
- /*
- * Deal with the transmitter
- */
-
- ucLineStatus = (*getReg)(pMC68681, MC68681_INTERRUPT_STATUS_REG);
- if (pMC68681 != pMC68681_port)
- ucLineStatus >>= 4;
-
- if(ucLineStatus & MC68681_IR_TX_READY) {
- if (rtems_termios_dequeue_characters(
- Console_Port_Data[minor].termios_data, 1)) {
- Console_Port_Data[minor].bActive = FALSE;
- mc68681_enable_interrupts(minor, MC68681_IMR_ENABLE_ALL_EXCEPT_TX);
- }
- }
-
-}
-
-/*
- * mc68681_build_imr
- *
- * This function returns the value for the interrupt mask register for this
- * DUART. Since this is a shared register, we must look at the other port
- * on this chip to determine whether or not it is using interrupts.
- */
-
-MC68681_STATIC unsigned int mc68681_build_imr(
- int minor,
- int enable_flag
-)
-{
- int mate;
- int is_a;
- unsigned int mask;
- unsigned int mate_mask;
- unsigned int pMC68681;
- unsigned int pMC68681_port;
- mc68681_context *pmc68681Context;
- mc68681_context *mateContext;
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
- pmc68681Context = (mc68681_context *) Console_Port_Data[minor].pDeviceContext;
- mate = pmc68681Context->mate;
-
- mask = 0;
- mate_mask = 0;
-
- is_a = (pMC68681 == pMC68681_port);
-
- /*
- * If there is a mate for this port, get its IMR mask.
- */
-
- if ( mate != -1 ) {
- mateContext = Console_Port_Data[mate].pDeviceContext;
-
- if (mateContext)
- mate_mask = mateContext->imr;
- }
-
- /*
- * Calculate this port's IMR mask and save it in the context area.
- */
-
- if ( Console_Port_Tbl[minor].pDeviceFns->deviceOutputUsesInterrupts )
- mask = enable_flag;
-
- pmc68681Context->imr = mask;
-
- /*
- * Now return the full IMR value
- */
-
- if (is_a)
- return (mate_mask << 4) | mask;
-
- return (mask << 4) | mate_mask;
-}
-
-/*
- * mc68681_enable_interrupts
- *
- * This function enables specific interrupt sources on the DUART.
- */
-
-MC68681_STATIC void mc68681_enable_interrupts(
- int minor,
- int imr_mask
-)
-{
- unsigned32 pMC68681;
- setRegister_f setReg;
-
- pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Enable interrupts on RX and TX -- not break
- */
-
- (*setReg)(
- pMC68681,
- MC68681_INTERRUPT_MASK_REG,
- mc68681_build_imr(minor, imr_mask)
- );
-}
diff --git a/c/src/libchip/serial/mc68681.h b/c/src/libchip/serial/mc68681.h
deleted file mode 100644
index 57713e3eff..0000000000
--- a/c/src/libchip/serial/mc68681.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _MC68681_H_
-#define _MC68681_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * These are just used in the interface between this driver and
- * the read/write register routines when accessing the first
- * control port.
- */
-
-#define MC68681_STATUS 1
-#define MC68681_RX_BUFFER 3
-
-#define MC68681_MODE 0
-#define MC68681_CLOCK_SELECT 1
-#define MC68681_COMMAND 2
-#define MC68681_TX_BUFFER 3
-
-/*
- * Data Port bit map configuration
- *
- * D0 : Baud Rate Set Selection
- * D1 - D2 : Extended Baud Rate Setting
- */
-
-#define MC68681_DATA_BAUD_RATE_SET_1 0 /* ACR[7] = 0 */
-#define MC68681_DATA_BAUD_RATE_SET_2 1 /* ACR[7] = 1 */
-
-#define MC68681_XBRG_IGNORED (0 << 1)
-#define MC68681_XBRG_ENABLED (1 << 1)
-#define MC68681_XBRG_DISABLED (2 << 1)
-#define MC68681_XBRG_MASK (3 << 1)
-
-/*
- * Custom baud rate table information
- */
-
-typedef unsigned char mc68681_baud_t;
-typedef mc68681_baud_t mc68681_baud_table_t[RTEMS_TERMIOS_NUMBER_BAUD_RATES];
-
-#define MC68681_BAUD_NOT_VALID 0xFF
-
-extern mc68681_baud_t
- mc68681_baud_rate_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES];
-
-
-/*
- * Driver function table
- */
-
-extern console_fns mc68681_fns;
-extern console_fns mc68681_fns_polled;
-
-/*
- * Default register access routines
- */
-
-unsigned8 mc68681_get_register( /* registers are at 1 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void mc68681_set_register(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned8 ucData
-);
-
-unsigned8 mc68681_get_register_2( /* registers are at 2 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void mc68681_set_register_2(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned8 ucData
-);
-
-unsigned8 mc68681_get_register_4( /* registers are at 4 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void mc68681_set_register_4(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned8 ucData
-);
-
-unsigned8 mc68681_get_register_8( /* registers are at 8 byte boundaries */
- unsigned32 ulCtrlPort, /* and accessed as bytes */
- unsigned8 ucRegNum
-);
-
-void mc68681_set_register_8(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned8 ucData
-);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _MC68681_H_ */
diff --git a/c/src/libchip/serial/mc68681_baud.c b/c/src/libchip/serial/mc68681_baud.c
deleted file mode 100644
index d91774e501..0000000000
--- a/c/src/libchip/serial/mc68681_baud.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * MC68681 Default Baud Rate Table
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <libchip/serial.h>
-#include <libchip/mc68681.h>
-
-/* major index of 0 : ACR[7] = 0, X = 0 -- 68c681 only has these */
-/* major index of 1 : ACR[7] = 1, X = 0 -- 68c681 only has these */
-/* major index of 2 : ACR[7] = 0, X = 1 */
-/* major index of 3 : ACR[7] = 1, X = 1 */
-
-/* mc68681_baud_table_t mc68681_baud_rate_table[4] = { */
-mc68681_baud_t mc68681_baud_rate_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = {
- { /* ACR[7] = 0, X = 0 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- 0x00, /* B50 */
- MC68681_BAUD_NOT_VALID, /* B75 */
- 0x01, /* B110 */
- 0x02, /* B134 */
- MC68681_BAUD_NOT_VALID, /* B150 */
- 0x03, /* B200 */
- 0x04, /* B300 */
- 0x05, /* B600 */
- 0x06, /* B1200 */
- MC68681_BAUD_NOT_VALID, /* B1800 */
- 0x08, /* B2400 */
- 0x09, /* B4800 */
- 0x0B, /* B9600 */
- MC68681_BAUD_NOT_VALID, /* B19200 */
- 0x0C, /* B38400 */
- MC68681_BAUD_NOT_VALID, /* B57600 */
- MC68681_BAUD_NOT_VALID, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
- { /* ACR[7] = 1, X = 0 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- MC68681_BAUD_NOT_VALID, /* B50 */
- 0x00, /* B75 */
- 0x01, /* B110 */
- 0x02, /* B134 */
- 0x03, /* B150 */
- MC68681_BAUD_NOT_VALID, /* B200 */
- 0x04, /* B300 */
- 0x05, /* B600 */
- 0x06, /* B1200 */
- 0x0A, /* B1800 */
- 0x08, /* B2400 */
- 0x09, /* B4800 */
- 0x0B, /* B9600 */
- 0x0C, /* B19200 */
- MC68681_BAUD_NOT_VALID, /* B38400 */
- MC68681_BAUD_NOT_VALID, /* B57600 */
- MC68681_BAUD_NOT_VALID, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
- { /* ACR[7] = 0, X = 1 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- MC68681_BAUD_NOT_VALID, /* B50 */
- 0x00, /* B75 */
- 0x01, /* B110 */
- 0x02, /* B134 */
- 0x03, /* B150 */
- MC68681_BAUD_NOT_VALID, /* B200 */
- MC68681_BAUD_NOT_VALID, /* B300 */
- MC68681_BAUD_NOT_VALID, /* B600 */
- MC68681_BAUD_NOT_VALID, /* B1200 */
- 0x0A, /* B1800 */
- MC68681_BAUD_NOT_VALID, /* B2400 */
- 0x08, /* B4800 */
- 0x0B, /* B9600 */
- 0x0C, /* B19200 */
- MC68681_BAUD_NOT_VALID, /* B38400 */
- 0x07, /* B57600 */
- 0x08, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
- { /* ACR[7] = 1, X = 1 */
- MC68681_BAUD_NOT_VALID, /* B0 */
- 0x00, /* B50 */
- MC68681_BAUD_NOT_VALID, /* B75 */
- 0x01, /* B110 */
- 0x02, /* B134 */
- MC68681_BAUD_NOT_VALID, /* B150 */
- 0x03, /* B200 */
- MC68681_BAUD_NOT_VALID, /* B300 */
- MC68681_BAUD_NOT_VALID, /* B600 */
- MC68681_BAUD_NOT_VALID, /* B1200 */
- MC68681_BAUD_NOT_VALID, /* B1800 */
- MC68681_BAUD_NOT_VALID, /* B2400 */
- 0x09, /* B4800 */
- 0x0B, /* B9600 */
- MC68681_BAUD_NOT_VALID, /* B19200 */
- 0x0C, /* B38400 */
- 0x07, /* B57600 */
- 0x08, /* B115200 */
- MC68681_BAUD_NOT_VALID, /* B230400 */
- MC68681_BAUD_NOT_VALID /* B460800 */
- },
-};
-
diff --git a/c/src/libchip/serial/mc68681_p.h b/c/src/libchip/serial/mc68681_p.h
deleted file mode 100644
index 471b0ae42e..0000000000
--- a/c/src/libchip/serial/mc68681_p.h
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _MC68681_P_H_
-#define _MC68681_P_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Define MC68681_STATIC to nothing while debugging so the entry points
- * will show up in the symbol table.
- */
-
-#define MC68681_STATIC
-
-/* #define MC68681_STATIC static */
-
-/*
- * mc68681 register offsets Read/Write Addresses
- */
-
-#define MC68681_MODE_REG_1A 0 /* MR1A-MR Prior to Read */
-#define MC68681_MODE_REG_2A 0 /* MR2A-MR After Read */
-
-#define MC68681_COUNT_MODE_CURRENT_MSB 6 /* CTU */
-#define MC68681_COUNTER_TIMER_UPPER_REG 6 /* CTU */
-#define MC68681_COUNT_MODE_CURRENT_LSB 7 /* CTL */
-#define MC68681_COUNTER_TIMER_LOWER_REG 7 /* CTL */
-#define MC68681_INTERRUPT_VECTOR_REG 12 /* IVR */
-
-#define MC68681_MODE_REG_1B 8 /* MR1B-MR Prior to Read */
-#define MC68681_MODE_REG_2B 8 /* MR2BA-MR After Read */
-
-/*
- * mc68681 register offsets Read Only Addresses
- */
-
-#define MC68681_STATUS_REG_A 1 /* SRA */
-#define MC68681_MASK_ISR_REG 2 /* MISR */
-#define MC68681_RECEIVE_BUFFER_A 3 /* RHRA */
-#define MC68681_INPUT_PORT_CHANGE_REG 4 /* IPCR */
-#define MC68681_INTERRUPT_STATUS_REG 5 /* ISR */
-#define MC68681_STATUS_REG_B 9 /* SRB */
-#define MC68681_RECEIVE_BUFFER_B 11 /* RHRB */
-#define MC68681_INPUT_PORT 13 /* IP */
-#define MC68681_START_COUNT_CMD 14 /* SCC */
-#define MC68681_STOP_COUNT_CMD 15 /* STC */
-
-/*
- * mc68681 register offsets Write Only Addresses
- */
-
-#define MC68681_CLOCK_SELECT_REG_A 1 /* CSRA */
-#define MC68681_COMMAND_REG_A 2 /* CRA */
-#define MC68681_TRANSMIT_BUFFER_A 3 /* THRA */
-#define MC68681_AUX_CTRL_REG 4 /* ACR */
-#define MC68681_INTERRUPT_MASK_REG 5 /* IMR */
-#define MC68681_CLOCK_SELECT_REG_B 9 /* CSRB */
-#define MC68681_COMMAND_REG_B 10 /* CRB */
-#define MC68681_TRANSMIT_BUFFER_B 11 /* THRB */
-#define MC68681_OUTPUT_PORT_CONFIG_REG 13 /* OPCR */
-#define MC68681_OUTPUT_PORT_SET_REG 14 /* SOPBC */
-#define MC68681_OUTPUT_PORT_RESET_BITS 15 /* COPBC */
-
-/*
- * DUART Command Register Definitions:
- *
- * MC68681_COMMAND_REG_A,MC68681_COMMAND_REG_B
- */
-
-#define MC68681_MODE_REG_ENABLE_RX 0x01
-#define MC68681_MODE_REG_DISABLE_RX 0x02
-#define MC68681_MODE_REG_ENABLE_TX 0x04
-#define MC68681_MODE_REG_DISABLE_TX 0x08
-#define MC68681_MODE_REG_RESET_MR_PTR 0x10
-#define MC68681_MODE_REG_RESET_RX 0x20
-#define MC68681_MODE_REG_RESET_TX 0x30
-#define MC68681_MODE_REG_RESET_ERROR 0x40
-#define MC68681_MODE_REG_RESET_BREAK 0x50
-#define MC68681_MODE_REG_START_BREAK 0x60
-#define MC68681_MODE_REG_STOP_BREAK 0x70
-#define MC68681_MODE_REG_SET_RX_BRG 0x80
-#define MC68681_MODE_REG_CLEAR_RX_BRG 0x90
-#define MC68681_MODE_REG_SET_TX_BRG 0xa0
-#define MC68681_MODE_REG_CLEAR_TX_BRG 0xb0
-#define MC68681_MODE_REG_SET_STANDBY 0xc0
-#define MC68681_MODE_REG_SET_ACTIVE 0xd0
-
-/*
- * Mode Register Definitions
- *
- * MC68681_MODE_REG_1A
- * MC68681_MODE_REG_1B
- */
-
-#define MC68681_5BIT_CHARS 0x00
-#define MC68681_6BIT_CHARS 0x01
-#define MC68681_7BIT_CHARS 0x02
-#define MC68681_8BIT_CHARS 0x03
-
-#define MC68681_ODD_PARITY 0x00
-#define MC68681_EVEN_PARITY 0x04
-
-#define MC68681_WITH_PARITY 0x00
-#define MC68681_FORCE_PARITY 0x08
-#define MC68681_NO_PARITY 0x10
-#define MC68681_MULTI_DROP 0x18
-
-#define MC68681_ERR_MODE_CHAR 0x00
-#define MC68681_ERR_MODE_BLOCK 0x20
-
-#define MC68681_RX_INTR_RX_READY 0x00
-#define MC68681_RX_INTR_FFULL 0x40
-
-#define MC68681_NO_RX_RTS_CTL 0x00
-#define MC68681_RX_RTS_CTRL 0x80
-
-/*
- * Mode Register Definitions
- *
- * MC68681_MODE_REG_2A
- * MC68681_MODE_REG_2B
- */
-
-#define MC68681_STOP_BIT_LENGTH__563 0x00
-#define MC68681_STOP_BIT_LENGTH__625 0x01
-#define MC68681_STOP_BIT_LENGTH__688 0x02
-#define MC68681_STOP_BIT_LENGTH__75 0x03
-#define MC68681_STOP_BIT_LENGTH__813 0x04
-#define MC68681_STOP_BIT_LENGTH__875 0x05
-#define MC68681_STOP_BIT_LENGTH__938 0x06
-#define MC68681_STOP_BIT_LENGTH_1 0x07
-#define MC68681_STOP_BIT_LENGTH_1_563 0x08
-#define MC68681_STOP_BIT_LENGTH_1_625 0x09
-#define MC68681_STOP_BIT_LENGTH_1_688 0x0a
-#define MC68681_STOP_BIT_LENGTH_1_75 0x0b
-#define MC68681_STOP_BIT_LENGTH_1_813 0x0c
-#define MC68681_STOP_BIT_LENGTH_1_875 0x0d
-#define MC68681_STOP_BIT_LENGTH_1_938 0x0e
-#define MC68681_STOP_BIT_LENGTH_2 0x0f
-
-#define MC68681_CTS_ENABLE_TX 0x10
-#define MC68681_TX_RTS_CTRL 0x20
-
-#define MC68681_CHANNEL_MODE_NORMAL 0x00
-#define MC68681_CHANNEL_MODE_ECHO 0x40
-#define MC68681_CHANNEL_MODE_LOCAL_LOOP 0x80
-#define MC68681_CHANNEL_MODE_REMOTE_LOOP 0xc0
-
-/*
- * Status Register Definitions
- *
- * MC68681_STATUS_REG_A, MC68681_STATUS_REG_B
- */
-
-#define MC68681_RX_READY 0x01
-#define MC68681_FFULL 0x02
-#define MC68681_TX_READY 0x04
-#define MC68681_TX_EMPTY 0x08
-#define MC68681_OVERRUN_ERROR 0x10
-#define MC68681_PARITY_ERROR 0x20
-#define MC68681_FRAMING_ERROR 0x40
-#define MC68681_RECEIVED_BREAK 0x80
-
-#define MC68681_RX_ERRORS \
- (MC68681_OVERRUN_ERROR|MC68681_PARITY_ERROR| \
- MC68681_FRAMING_ERROR|MC68681_RECEIVED_BREAK)
-
-/*
- * Interupt Status Register Definitions.
- *
- * MC68681_INTERRUPT_STATUS_REG
- */
-
-/*
- * Interupt Mask Register Definitions
- *
- * MC68681_INTERRUPT_MASK_REG
- */
-
-/* These are passed to mc68681_build_imr */
-#define MC68681_IR_TX_READY 0x01
-#define MC68681_IR_RX_READY 0x02
-#define MC68681_IR_BREAK 0x04
-#define MC68681_IMR_ENABLE_ALL 0x07
-#define MC68681_IMR_DISABLE_ALL 0x00
-#define MC68681_IMR_ENABLE_ALL_EXCEPT_TX 0x06
-
-#define MC68681_IR_TX_READY_A 0x01
-#define MC68681_IR_RX_READY_A 0x02
-#define MC68681_IR_BREAK_A 0x04
-#define MC68681_IR_COUNTER_READY 0x08
-#define MC68681_IR_TX_READY_B 0x10
-#define MC68681_IR_RX_READY_B 0x20
-#define MC68681_IR_BREAK_B 0x40
-#define MC68681_IR_INPUT_PORT_CHANGE 0x80
-
-/*
- * Status Register Definitions.
- *
- * MC68681_STATUS_REG_A,MC68681_STATUS_REG_B
- */
-
-#define MC68681_STATUS_RXRDY 0x01
-#define MC68681_STATUS_FFULL 0x02
-#define MC68681_STATUS_TXRDY 0x04
-#define MC68681_STATUS_TXEMT 0x08
-#define MC68681_STATUS_OVERRUN_ERROR 0x10
-#define MC68681_STATUS_PARITY_ERROR 0x20
-#define MC68681_STATUS_FRAMING_ERROR 0x40
-#define MC68681_STATUS_RECEIVED_BREAK 0x80
-
-/*
- * Definitions for the Interrupt Vector Register:
- *
- * MC68681_INTERRUPT_VECTOR_REG
- */
-
-#define MC68681_INTERRUPT_VECTOR_INIT 0x0f
-
-/*
- * Definitions for the Auxiliary Control Register
- *
- * MC68681_AUX_CTRL_REG
- */
-
-#define MC68681_AUX_BRG_SET1 0x00
-#define MC68681_AUX_BRG_SET2 0x80
-
-/*
- * Per chip context control
- */
-
-typedef struct _mc68681_context
-{
- int mate;
- unsigned char imr;
-} mc68681_context;
-
-/*
- * Driver functions
- */
-MC68681_STATIC boolean mc68681_probe(int minor);
-
-MC68681_STATIC int mc68681_set_attributes(
- int minor,
- const struct termios *t
-);
-
-MC68681_STATIC void mc68681_init(int minor);
-
-MC68681_STATIC int mc68681_open(
- int major,
- int minor,
- void * arg
-);
-
-MC68681_STATIC int mc68681_close(
- int major,
- int minor,
- void * arg
-);
-
-MC68681_STATIC void mc68681_write_polled(
- int minor,
- char cChar
-);
-
-MC68681_STATIC void mc68681_initialize_interrupts(int minor);
-
-MC68681_STATIC int mc68681_write_support_int(
- int minor,
- const char *buf,
- int len
-);
-
-MC68681_STATIC int mc68681_write_support_polled(
- int minor,
- const char *buf,
- int len
- );
-
-MC68681_STATIC int mc68681_inbyte_nonblocking_polled(
- int minor
-);
-
-MC68681_STATIC unsigned int mc68681_build_imr(
- int minor,
- int enable_flag
-);
-
-MC68681_STATIC void mc68681_process(
- int minor
-);
-
-MC68681_STATIC void mc68681_enable_interrupts(
- int minor,
- int imr_mask
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _MC68681_P_H_ */
diff --git a/c/src/libchip/serial/mc68681_reg.c b/c/src/libchip/serial/mc68681_reg.c
deleted file mode 100644
index 115bafdfe8..0000000000
--- a/c/src/libchip/serial/mc68681_reg.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the mc68681 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are only byte-aligned (no address gaps)
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#ifndef _MC68681_MULTIPLIER
-#define _MC68681_MULTIPLIER 1
-#define _MC68681_NAME(_X) _X
-#define _MC68681_TYPE unsigned8
-#endif
-
-#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
- (_MC68681_TYPE *)((_base) + ((_reg) * _MC68681_MULTIPLIER ))
-
-/*
- * MC68681 Get Register Routine
- */
-
-unsigned8 _MC68681_NAME(mc68681_get_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum
-)
-{
- _MC68681_TYPE *port;
-
- port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
-
- return *port;
-}
-
-/*
- * MC68681 Set Register Routine
- */
-
-void _MC68681_NAME(mc68681_set_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned8 ucData
-)
-{
- _MC68681_TYPE *port;
-
- port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
-
- *port = ucData;
-}
diff --git a/c/src/libchip/serial/mc68681_reg2.c b/c/src/libchip/serial/mc68681_reg2.c
deleted file mode 100644
index f786ab5df5..0000000000
--- a/c/src/libchip/serial/mc68681_reg2.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the mc68681 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 16-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _MC68681_MULTIPLIER 2
-#define _MC68681_NAME(_X) _X##_2
-#define _MC68681_TYPE unsigned8
-
-#include "mc68681_reg.c"
-
diff --git a/c/src/libchip/serial/mc68681_reg4.c b/c/src/libchip/serial/mc68681_reg4.c
deleted file mode 100644
index 075a9b2564..0000000000
--- a/c/src/libchip/serial/mc68681_reg4.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the mc68681 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 32-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _MC68681_MULTIPLIER 4
-#define _MC68681_NAME(_X) _X##_4
-#define _MC68681_TYPE unsigned8
-
-#include "mc68681_reg.c"
-
diff --git a/c/src/libchip/serial/mc68681_reg8.c b/c/src/libchip/serial/mc68681_reg8.c
deleted file mode 100644
index b83ccd2b46..0000000000
--- a/c/src/libchip/serial/mc68681_reg8.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the mc68681 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- * + registers are on 64-bit boundaries
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _MC68681_MULTIPLIER 8
-#define _MC68681_NAME(_X) _X##_8
-#define _MC68681_TYPE unsigned8
-
-#include "mc68681_reg.c"
-
diff --git a/c/src/libchip/serial/ns16550.c b/c/src/libchip/serial/ns16550.c
deleted file mode 100644
index 918e87bf8c..0000000000
--- a/c/src/libchip/serial/ns16550.c
+++ /dev/null
@@ -1,660 +0,0 @@
-/*
- * This file contains the TTY driver for the National Semiconductor NS16550.
- *
- * This part is widely cloned and second sourced. It is found in a number
- * of "Super IO" controllers.
- *
- * COPYRIGHT (c) 1998 by Radstone Technology
- *
- *
- * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
- * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
- *
- * You are hereby granted permission to use, copy, modify, and distribute
- * this file, provided that this notice, plus the above copyright notice
- * and disclaimer, appears in all copies. Radstone Technology will provide
- * no support for this code.
- *
- * This driver uses the termios pseudo driver.
- */
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <stdlib.h>
-#include <ringbuf.h>
-
-#include <libchip/serial.h>
-#include "ns16550_p.h"
-#include "sersupp.h"
-
-/*
- * Flow control is only supported when using interrupts
- */
-
-console_flow ns16550_flow_RTSCTS = {
- ns16550_negate_RTS, /* deviceStopRemoteTx */
- ns16550_assert_RTS /* deviceStartRemoteTx */
-};
-
-console_flow ns16550_flow_DTRCTS = {
- ns16550_negate_DTR, /* deviceStopRemoteTx */
- ns16550_assert_DTR /* deviceStartRemoteTx */
-};
-
-console_fns ns16550_fns = {
- libchip_serial_default_probe, /* deviceProbe */
- ns16550_open, /* deviceFirstOpen */
- NULL, /* deviceLastClose */
- NULL, /* deviceRead */
- ns16550_write_support_int, /* deviceWrite */
- ns16550_initialize_interrupts, /* deviceInitialize */
- ns16550_write_polled, /* deviceWritePolled */
- ns16550_set_attributes, /* deviceSetAttributes */
- TRUE /* deviceOutputUsesInterrupts */
-};
-
-console_fns ns16550_fns_polled = {
- libchip_serial_default_probe, /* deviceProbe */
- ns16550_open, /* deviceFirstOpen */
- ns16550_close, /* deviceLastClose */
- ns16550_inbyte_nonblocking_polled, /* deviceRead */
- ns16550_write_support_polled, /* deviceWrite */
- ns16550_init, /* deviceInitialize */
- ns16550_write_polled, /* deviceWritePolled */
- ns16550_set_attributes, /* deviceSetAttributes */
- FALSE /* deviceOutputUsesInterrupts */
-};
-
-extern void set_vector( rtems_isr_entry, rtems_vector_number, int );
-
-/*
- * ns16550_init
- */
-
-NS16550_STATIC void ns16550_init(int minor)
-{
- unsigned32 pNS16550;
- unsigned8 ucTrash;
- unsigned8 ucDataByte;
- unsigned32 ulBaudDivisor;
- ns16550_context *pns16550Context;
- setRegister_f setReg;
- getRegister_f getReg;
-
- pns16550Context=(ns16550_context *)malloc(sizeof(ns16550_context));
-
- Console_Port_Data[minor].pDeviceContext=(void *)pns16550Context;
- pns16550Context->ucModemCtrl=SP_MODEM_IRQ;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- /* Clear the divisor latch, clear all interrupt enables,
- * and reset and
- * disable the FIFO's.
- */
-
- (*setReg)(pNS16550, NS16550_LINE_CONTROL, 0x0);
- ns16550_enable_interrupts(minor, NS16550_DISABLE_ALL_INTR);
-
- /* Set the divisor latch and set the baud rate. */
-
- ulBaudDivisor=NS16550_Baud((unsigned32)Console_Port_Tbl[minor].pDeviceParams);
- ucDataByte = SP_LINE_DLAB;
- (*setReg)(pNS16550, NS16550_LINE_CONTROL, ucDataByte);
-
- /* XXX */
- (*setReg)(pNS16550, NS16550_TRANSMIT_BUFFER, ulBaudDivisor&0xff);
- (*setReg)(pNS16550, NS16550_INTERRUPT_ENABLE, (ulBaudDivisor>>8)&0xff);
-
- /* Clear the divisor latch and set the character size to eight bits */
- /* with one stop bit and no parity checking. */
- ucDataByte = EIGHT_BITS;
- (*setReg)(pNS16550, NS16550_LINE_CONTROL, ucDataByte);
-
- /* Enable and reset transmit and receive FIFOs. TJA */
- ucDataByte = SP_FIFO_ENABLE;
- (*setReg)(pNS16550, NS16550_FIFO_CONTROL, ucDataByte);
-
- ucDataByte = SP_FIFO_ENABLE | SP_FIFO_RXRST | SP_FIFO_TXRST;
- (*setReg)(pNS16550, NS16550_FIFO_CONTROL, ucDataByte);
-
- ns16550_enable_interrupts(minor, NS16550_DISABLE_ALL_INTR);
-
- /* Set data terminal ready. */
- /* And open interrupt tristate line */
- (*setReg)(pNS16550, NS16550_MODEM_CONTROL,pns16550Context->ucModemCtrl);
-
- ucTrash = (*getReg)(pNS16550, NS16550_LINE_STATUS );
- ucTrash = (*getReg)(pNS16550, NS16550_RECEIVE_BUFFER );
-}
-
-/*
- * ns16550_open
- */
-
-NS16550_STATIC int ns16550_open(
- int major,
- int minor,
- void * arg
-)
-{
- /*
- * Assert DTR
- */
-
- if(Console_Port_Tbl[minor].pDeviceFlow != &ns16550_flow_DTRCTS) {
- ns16550_assert_DTR(minor);
- }
-
- return(RTEMS_SUCCESSFUL);
-}
-
-/*
- * ns16550_close
- */
-
-NS16550_STATIC int ns16550_close(
- int major,
- int minor,
- void * arg
-)
-{
- /*
- * Negate DTR
- */
- if(Console_Port_Tbl[minor].pDeviceFlow != &ns16550_flow_DTRCTS) {
- ns16550_negate_DTR(minor);
- }
-
- return(RTEMS_SUCCESSFUL);
-}
-
-/*
- * ns16550_write_polled
- */
-
-NS16550_STATIC void ns16550_write_polled(
- int minor,
- char cChar
-)
-{
- unsigned32 pNS16550;
- unsigned char ucLineStatus;
- int iTimeout;
- getRegister_f getReg;
- setRegister_f setReg;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- getReg = Console_Port_Tbl[minor].getRegister;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * wait for transmitter holding register to be empty
- */
- iTimeout=1000;
- ucLineStatus = (*getReg)(pNS16550, NS16550_LINE_STATUS);
- while ((ucLineStatus & SP_LSR_THOLD) == 0) {
- /*
- * Yield while we wait
- */
-#if 0
- if(_System_state_Is_up(_System_state_Get())) {
- rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
- }
-#endif
- ucLineStatus = (*getReg)(pNS16550, NS16550_LINE_STATUS);
- if(!--iTimeout) {
- break;
- }
- }
-
- /*
- * transmit character
- */
- (*setReg)(pNS16550, NS16550_TRANSMIT_BUFFER, cChar);
-}
-
-/*
- * These routines provide control of the RTS and DTR lines
- */
-
-/*
- * ns16550_assert_RTS
- */
-
-NS16550_STATIC int ns16550_assert_RTS(int minor)
-{
- unsigned32 pNS16550;
- unsigned32 Irql;
- ns16550_context *pns16550Context;
- setRegister_f setReg;
-
- pns16550Context=(ns16550_context *) Console_Port_Data[minor].pDeviceContext;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Assert RTS
- */
- rtems_interrupt_disable(Irql);
- pns16550Context->ucModemCtrl|=SP_MODEM_RTS;
- (*setReg)(pNS16550, NS16550_MODEM_CONTROL, pns16550Context->ucModemCtrl);
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * ns16550_negate_RTS
- */
-
-NS16550_STATIC int ns16550_negate_RTS(int minor)
-{
- unsigned32 pNS16550;
- unsigned32 Irql;
- ns16550_context *pns16550Context;
- setRegister_f setReg;
-
- pns16550Context=(ns16550_context *) Console_Port_Data[minor].pDeviceContext;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Negate RTS
- */
- rtems_interrupt_disable(Irql);
- pns16550Context->ucModemCtrl&=~SP_MODEM_RTS;
- (*setReg)(pNS16550, NS16550_MODEM_CONTROL, pns16550Context->ucModemCtrl);
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * These flow control routines utilise a connection from the local DTR
- * line to the remote CTS line
- */
-
-/*
- * ns16550_assert_DTR
- */
-
-NS16550_STATIC int ns16550_assert_DTR(int minor)
-{
- unsigned32 pNS16550;
- unsigned32 Irql;
- ns16550_context *pns16550Context;
- setRegister_f setReg;
-
- pns16550Context=(ns16550_context *) Console_Port_Data[minor].pDeviceContext;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Assert DTR
- */
- rtems_interrupt_disable(Irql);
- pns16550Context->ucModemCtrl|=SP_MODEM_DTR;
- (*setReg)(pNS16550, NS16550_MODEM_CONTROL, pns16550Context->ucModemCtrl);
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * ns16550_negate_DTR
- */
-
-NS16550_STATIC int ns16550_negate_DTR(int minor)
-{
- unsigned32 pNS16550;
- unsigned32 Irql;
- ns16550_context *pns16550Context;
- setRegister_f setReg;
-
- pns16550Context=(ns16550_context *) Console_Port_Data[minor].pDeviceContext;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Negate DTR
- */
- rtems_interrupt_disable(Irql);
- pns16550Context->ucModemCtrl&=~SP_MODEM_DTR;
- (*setReg)(pNS16550, NS16550_MODEM_CONTROL,pns16550Context->ucModemCtrl);
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * ns16550_set_attributes
- *
- * This function sets the channel to reflect the requested termios
- * port settings.
- */
-
-NS16550_STATIC int ns16550_set_attributes(
- int minor,
- const struct termios *t
-)
-{
- unsigned32 pNS16550;
- unsigned32 ulBaudDivisor;
- unsigned8 ucLineControl;
- unsigned32 baud_requested;
- setRegister_f setReg;
- getRegister_f getReg;
- unsigned32 Irql;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- /*
- * Calculate the baud rate divisor
- */
-
- baud_requested = t->c_cflag & CBAUD;
- if (!baud_requested)
- baud_requested = B9600; /* default to 9600 baud */
-
- ulBaudDivisor = termios_baud_to_number(baud_requested);
-
- ucLineControl = 0;
-
- /*
- * Parity
- */
-
- if (t->c_cflag & PARENB) {
- ucLineControl |= SP_LINE_PAR;
- if (!(t->c_cflag & PARODD))
- ucLineControl |= SP_LINE_ODD;
- }
-
- /*
- * Character Size
- */
-
- if (t->c_cflag & CSIZE) {
- switch (t->c_cflag & CSIZE) {
- case CS5: ucLineControl |= FIVE_BITS; break;
- case CS6: ucLineControl |= SIX_BITS; break;
- case CS7: ucLineControl |= SEVEN_BITS; break;
- case CS8: ucLineControl |= EIGHT_BITS; break;
- }
- } else {
- ucLineControl |= EIGHT_BITS; /* default to 9600,8,N,1 */
- }
-
- /*
- * Stop Bits
- */
-
- if (t->c_cflag & CSTOPB) {
- ucLineControl |= SP_LINE_STOP; /* 2 stop bits */
- } else {
- ; /* 1 stop bit */
- }
-
- /*
- * Now actually set the chip
- */
-
- rtems_interrupt_disable(Irql);
-
- /*
- * Set the baud rate
- */
-
- (*setReg)(pNS16550, NS16550_LINE_CONTROL, SP_LINE_DLAB);
- /* XXX are these registers right? */
- (*setReg)(pNS16550, NS16550_TRANSMIT_BUFFER, ulBaudDivisor&0xff);
- (*setReg)(pNS16550, NS16550_INTERRUPT_ENABLE, (ulBaudDivisor>>8)&0xff);
-
- /*
- * Now write the line control
- */
- (*setReg)(pNS16550, NS16550_LINE_CONTROL, ucLineControl );
-
- rtems_interrupt_enable(Irql);
-
-}
-
-/*
- * ns16550_process
- *
- * This routine is the console interrupt handler for A port.
- */
-
-NS16550_STATIC void ns16550_process(
- int minor
-)
-{
- unsigned32 pNS16550;
- volatile unsigned8 ucLineStatus;
- volatile unsigned8 ucInterruptId;
- unsigned char cChar;
- getRegister_f getReg;
- setRegister_f setReg;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- getReg = Console_Port_Tbl[minor].getRegister;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- do {
- /*
- * Deal with any received characters
- */
- while(TRUE) {
- ucLineStatus = (*getReg)(pNS16550, NS16550_LINE_STATUS);
- if(~ucLineStatus & SP_LSR_RDY) {
- break;
- }
- cChar = (*getReg)(pNS16550, NS16550_RECEIVE_BUFFER);
- rtems_termios_enqueue_raw_characters(
- Console_Port_Data[minor].termios_data,
- &cChar,
- 1
- );
- }
-
- /*
- * TX all the characters we can
- */
-
- while(TRUE) {
- ucLineStatus = (*getReg)(pNS16550, NS16550_LINE_STATUS);
- if(~ucLineStatus & SP_LSR_THOLD) {
- /*
- * We'll get another interrupt when
- * the transmitter holding reg. becomes
- * free again
- */
- break;
- }
-
-#if 0
- /* XXX flow control not completely supported in libchip */
-
- if(Console_Port_Tbl[minor].pDeviceFlow != &ns16550_flow_RTSCTS) {
- ns16550_negate_RTS(minor);
- }
-#endif
-
- rtems_termios_dequeue_characters(Console_Port_Data[minor].termios_data, 1);
- if (rtems_termios_dequeue_characters(
- Console_Port_Data[minor].termios_data, 1)) {
- if (Console_Port_Tbl[minor].pDeviceFlow != &ns16550_flow_RTSCTS) {
- ns16550_negate_RTS(minor);
- }
- Console_Port_Data[minor].bActive = FALSE;
- ns16550_enable_interrupts(minor, NS16550_ENABLE_ALL_INTR_EXCEPT_TX);
- break;
- }
-
- ucInterruptId = (*getReg)(pNS16550, NS16550_INTERRUPT_ID);
- }
- } while((ucInterruptId&0xf)!=0x1);
-}
-
-/*
- * ns16550_isr
- */
-
-NS16550_STATIC rtems_isr ns16550_isr(
- rtems_vector_number vector
-)
-{
- int minor;
-
- for(minor=0;minor<Console_Port_Count;minor++) {
- if(Console_Port_Tbl[minor].ulIntVector == vector &&
- Console_Port_Tbl[minor].deviceType == SERIAL_NS16550 ) {
- ns16550_process(minor);
- }
- }
-}
-
-/*
- * ns16550_enable_interrupts
- *
- * This routine initializes the port to have the specified interrupts masked.
- */
-
-NS16550_STATIC void ns16550_enable_interrupts(
- int minor,
- int mask
-)
-{
- unsigned32 pNS16550;
- setRegister_f setReg;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- (*setReg)(pNS16550, NS16550_INTERRUPT_ENABLE, mask);
-}
-
-/*
- * ns16550_initialize_interrupts
- *
- * This routine initializes the port to operate in interrupt driver mode.
- */
-
-NS16550_STATIC void ns16550_initialize_interrupts(int minor)
-{
- ns16550_init(minor);
-
- Console_Port_Data[minor].bActive = FALSE;
-
- set_vector(ns16550_isr, Console_Port_Tbl[minor].ulIntVector, 1);
-
- ns16550_enable_interrupts(minor, NS16550_ENABLE_ALL_INTR);
-}
-
-/*
- * ns16550_write_support_int
- *
- * Console Termios output entry point.
- */
-
-NS16550_STATIC int ns16550_write_support_int(
- int minor,
- const char *buf,
- int len
-)
-{
- unsigned32 Irql;
- unsigned32 pNS16550;
- setRegister_f setReg;
-
- setReg = Console_Port_Tbl[minor].setRegister;
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
-
- /*
- * We are using interrupt driven output and termios only sends us
- * one character at a time.
- */
-
- if ( !len )
- return 0;
-
- if(Console_Port_Tbl[minor].pDeviceFlow != &ns16550_flow_RTSCTS) {
- ns16550_assert_RTS(minor);
- }
-
- rtems_interrupt_disable(Irql);
- if ( Console_Port_Data[minor].bActive == FALSE) {
- Console_Port_Data[minor].bActive = TRUE;
- ns16550_enable_interrupts(minor, NS16550_ENABLE_ALL_INTR);
- }
- (*setReg)(pNS16550, NS16550_TRANSMIT_BUFFER, *buf);
- rtems_interrupt_enable(Irql);
-
- return 1;
-}
-
-/*
- * ns16550_write_support_polled
- *
- * Console Termios output entry point.
- *
- */
-
-NS16550_STATIC int ns16550_write_support_polled(
- int minor,
- const char *buf,
- int len
-)
-{
- int nwrite = 0;
-
- /*
- * poll each byte in the string out of the port.
- */
- while (nwrite < len) {
- /*
- * transmit character
- */
- ns16550_write_polled(minor, *buf++);
- nwrite++;
- }
-
- /*
- * return the number of bytes written.
- */
- return nwrite;
-}
-
-/*
- * ns16550_inbyte_nonblocking_polled
- *
- * Console Termios polling input entry point.
- */
-
-NS16550_STATIC int ns16550_inbyte_nonblocking_polled(
- int minor
-)
-{
- unsigned32 pNS16550;
- unsigned char ucLineStatus;
- char cChar;
- getRegister_f getReg;
-
- pNS16550 = Console_Port_Tbl[minor].ulCtrlPort1;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- ucLineStatus = (*getReg)(pNS16550, NS16550_LINE_STATUS);
- if(ucLineStatus & SP_LSR_RDY) {
- cChar = (*getReg)(pNS16550, NS16550_RECEIVE_BUFFER);
- return (int)cChar;
- } else {
- return -1;
- }
-}
diff --git a/c/src/libchip/serial/ns16550.h b/c/src/libchip/serial/ns16550.h
deleted file mode 100644
index cb01d20a85..0000000000
--- a/c/src/libchip/serial/ns16550.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * COPYRIGHT (c) 1998 by Radstone Technology
- *
- *
- * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
- * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
- *
- * You are hereby granted permission to use, copy, modify, and distribute
- * this file, provided that this notice, plus the above copyright notice
- * and disclaimer, appears in all copies. Radstone Technology will provide
- * no support for this code.
- *
- */
-
-#ifndef _NS16550_H_
-#define _NS16550_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Driver function table
- */
-
-extern console_fns ns16550_fns;
-extern console_fns ns16550_fns_polled;
-
-/*
- * Flow control function tables
- */
-
-extern console_flow ns16550_flow_RTSCTS;
-extern console_flow ns16550_flow_DTRCTS;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _NS16550_H_ */
diff --git a/c/src/libchip/serial/ns16550_p.h b/c/src/libchip/serial/ns16550_p.h
deleted file mode 100644
index 27c3502a0d..0000000000
--- a/c/src/libchip/serial/ns16550_p.h
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * COPYRIGHT (c) 1998 by Radstone Technology
- *
- *
- * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
- * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
- *
- * You are hereby granted permission to use, copy, modify, and distribute
- * this file, provided that this notice, plus the above copyright notice
- * and disclaimer, appears in all copies. Radstone Technology will provide
- * no support for this code.
- *
- * $Id$
- */
-
-#ifndef _NS16550_P_H_
-#define _NS16550_P_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Define NS16550_STATIC to nothing while debugging so the entry points
- * will show up in the symbol table.
- */
-
-#define NS16550_STATIC
-
-/* #define NS16550_STATIC static */
-
-/*
- * Define serial port read registers structure.
- */
-
-typedef volatile struct _SP_READ_REGISTERS {
- unsigned char ReceiveBuffer;
- unsigned char InterruptEnable;
- unsigned char InterruptId;
- unsigned char LineControl;
- unsigned char ModemControl;
- unsigned char LineStatus;
- unsigned char ModemStatus;
- unsigned char ScratchPad;
-} SP_READ_REGISTERS, *PSP_READ_REGISTERS;
-
-#define NS16550_RECEIVE_BUFFER 0
-#define NS16550_INTERRUPT_ENABLE 1
-#define NS16550_INTERRUPT_ID 2
-#define NS16550_LINE_CONTROL 3
-#define NS16550_MODEM_CONTROL 4
-#define NS16550_LINE_STATUS 5
-#define NS16550_MODEM_STATUS 6
-#define NS16550_SCRATCH_PAD 7
-
-/*
- * Define serial port write registers structure.
- */
-
-typedef volatile struct _SP_WRITE_REGISTERS {
- unsigned char TransmitBuffer;
- unsigned char InterruptEnable;
- unsigned char FifoControl;
- unsigned char LineControl;
- unsigned char ModemControl;
- unsigned char Reserved1;
- unsigned char ModemStatus;
- unsigned char ScratchPad;
-} SP_WRITE_REGISTERS, *PSP_WRITE_REGISTERS;
-
-#define NS16550_TRANSMIT_BUFFER 0
-#define NS16550_FIFO_CONTROL 2
-
-/*
- * Define serial port interrupt enable register structure.
- */
-
-#define SP_INT_RX_ENABLE 0x01
-#define SP_INT_TX_ENABLE 0x02
-#define SP_INT_LS_ENABLE 0x04
-#define SP_INT_MS_ENABLE 0x08
-
-#define NS16550_ENABLE_ALL_INTR (SP_INT_RX_ENABLE | SP_INT_TX_ENABLE)
-#define NS16550_DISABLE_ALL_INTR 0x00
-#define NS16550_ENABLE_ALL_INTR_EXCEPT_TX (SP_INT_RX_ENABLE)
-
-/*
- * Define serial port interrupt id register structure.
- */
-
-typedef struct _SP_INTERRUPT_ID {
- unsigned char InterruptPending : 1;
- unsigned char Identification : 3;
- unsigned char Reserved1 : 2;
- unsigned char FifoEnabled : 2;
-} SP_INTERRUPT_ID, *PSP_INTERRUPT_ID;
-
-/*
- * Define serial port fifo control register structure.
- */
-
-#define SP_FIFO_ENABLE 0x01
-#define SP_FIFO_RXRST 0x02
-#define SP_FIFO_TXRST 0x04
-#define SP_FIFO_DMA 0x08
-#define SP_FIFO_RXLEVEL 0xc0
-
-/*
- * Define serial port line control register structure.
- */
-
-#define SP_LINE_SIZE 0x03
-#define SP_LINE_STOP 0x04
-#define SP_LINE_PAR 0x08
-#define SP_LINE_ODD 0x10
-#define SP_LINE_STICK 0x20
-#define SP_LINE_BREAK 0x40
-#define SP_LINE_DLAB 0x80
-
-/*
- * Line status register character size definitions.
- */
-
-#define FIVE_BITS 0x0 /* five bits per character */
-#define SIX_BITS 0x1 /* six bits per character */
-#define SEVEN_BITS 0x2 /* seven bits per character */
-#define EIGHT_BITS 0x3 /* eight bits per character */
-
-/*
- * Line speed divisor definition.
- */
-
-#define NS16550_Baud(baud_rate) (115200/baud_rate)
-
-/*
- * Define serial port modem control register structure.
- */
-
-#define SP_MODEM_DTR 0x01
-#define SP_MODEM_RTS 0x02
-#define SP_MODEM_IRQ 0x08
-#define SP_MODEM_LOOP 0x10
-#define SP_MODEM_DIV4 0x80
-
-/*
- * Define serial port line status register structure.
- */
-
-#define SP_LSR_RDY 0x01
-#define SP_LSR_EOVRUN 0x02
-#define SP_LSR_EPAR 0x04
-#define SP_LSR_EFRAME 0x08
-#define SP_LSR_BREAK 0x10
-#define SP_LSR_THOLD 0x20
-#define SP_LSR_TX 0x40
-#define SP_LSR_EFIFO 0x80
-
-typedef struct _ns16550_context
-{
- unsigned8 ucModemCtrl;
-} ns16550_context;
-
-/*
- * Driver functions
- */
-
-NS16550_STATIC boolean ns16550_probe(int minor);
-
-NS16550_STATIC void ns16550_init(int minor);
-
-NS16550_STATIC int ns16550_open(
- int major,
- int minor,
- void * arg
-);
-
-NS16550_STATIC int ns16550_close(
- int major,
- int minor,
- void * arg
-);
-
-NS16550_STATIC void ns16550_write_polled(
- int minor,
- char cChar
-);
-
-NS16550_STATIC int ns16550_assert_RTS(
- int minor
-);
-
-NS16550_STATIC int ns16550_negate_RTS(
- int minor
-);
-
-NS16550_STATIC int ns16550_assert_DTR(
- int minor
-);
-
-NS16550_STATIC int ns16550_negate_DTR(
- int minor
-);
-
-NS16550_STATIC void ns16550_initialize_interrupts(int minor);
-
-NS16550_STATIC int ns16550_write_support_int(
- int minor,
- const char *buf,
- int len
-);
-
-NS16550_STATIC int ns16550_write_support_polled(
- int minor,
- const char *buf,
- int len
- );
-
-NS16550_STATIC int ns16550_inbyte_nonblocking_polled(
- int minor
-);
-
-NS16550_STATIC void ns16550_enable_interrupts(
- int minor,
- int mask
-);
-
-NS16550_STATIC int ns16550_set_attributes(
- int minor,
- const struct termios *t
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _NS16550_P_H_ */
diff --git a/c/src/libchip/serial/serial.h b/c/src/libchip/serial/serial.h
deleted file mode 100644
index aa0e7f58aa..0000000000
--- a/c/src/libchip/serial/serial.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * This file contains the TTY driver table definition
- *
- * This driver uses the termios pseudo driver.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __LIBCHIP_SERIAL_h
-#define __LIBCHIP_SERIAL_h
-
-#include <termios.h>
-
-/*
- * Types for get and set register routines
- */
-
-typedef unsigned8 (*getRegister_f)(unsigned32 port, unsigned8 register);
-typedef void (*setRegister_f)(
- unsigned32 port, unsigned8 reg, unsigned8 value);
-typedef unsigned8 (*getData_f)(unsigned32 port);
-typedef void (*setData_f)(unsigned32 port, unsigned8 value);
-
-typedef struct _console_fns {
- boolean (*deviceProbe)(int minor);
- int (*deviceFirstOpen)(int major, int minor, void *arg);
- int (*deviceLastClose)(int major, int minor, void *arg);
- int (*deviceRead)(int minor);
- int (*deviceWrite)(int minor, const char *buf, int len);
- void (*deviceInitialize)(int minor);
- void (*deviceWritePolled)(int minor, char cChar);
- int (*deviceSetAttributes)(int minor, const struct termios *t);
- int deviceOutputUsesInterrupts;
-} console_fns;
-
-typedef struct _console_flow {
- int (*deviceStopRemoteTx)(int minor);
- int (*deviceStartRemoteTx)(int minor);
-} console_flow;
-
-typedef enum {
- SERIAL_MC68681, /* Motorola MC68681 or Exar 88681 */
- SERIAL_NS16550, /* National Semiconductor NS16550 */
- SERIAL_Z85C30, /* Zilog Z85C30 */
- SERIAL_CUSTOM /* BSP specific driver */
-} console_devs;
-
-/*
- * Each field is interpreted thus:
- *
- * sDeviceName This is the name of the device.
- *
- * deviceType This indicates the chip type. It is especially important when
- * multiple devices share the same interrupt vector and must be
- * distinguished.
- *
- * pDeviceFns This is a pointer to the set of driver routines to use.
- *
- * pDeviceFlow This is a pointer to the set of flow control routines to
- * use. Serial device drivers will typically supply RTSCTS
- * and DTRCTS handshake routines for DCE to DCE communication,
- * however for DCE to DTE communication, no such routines
- * should be necessary as RTS will be driven automatically
- * when the transmitter is active.
- *
- * ulMargin The high water mark in the input buffer is set to the buffer
- * size less ulMargin. Once this level is reached, the driver's
- * flow control routine used to stop the remote transmitter will
- * be called. This figure should be greater than or equal to
- * the number of stages of FIFO between the transmitter and
- * receiver.
- *
- * NOTE: At the current time, this parameter is hard coded
- * in termios and this number is ignored.
- *
- * ulHysteresis After the high water mark specified by ulMargin has been
- * reached, the driver's routine to re-start the remote
- * transmitter will be called once the level in the input
- * buffer has fallen by ulHysteresis bytes.
- *
- * NOTE: At the current time, this parameter is hard coded
- * in termios and this number is ignored.
- *
- * pDeviceParams This contains either device specific data or a pointer to a
- * device specific structure containing additional information
- * not provided in this table.
- *
- * ulCtrlPort1 This is the primary control port number for the device. This
- * may be used to specify different instances of the same device
- * type.
- *
- * ulCtrlPort2 This is the secondary control port number, of use when a given
- * device has more than one available channel.
- *
- * ulDataPort This is the port number for the data port of the device
- *
- * getRegister This is the routine used to read register values.
- *
- * setRegister This is the routine used to write register values.
- *
- * getData This is the routine used to read the data register (RX).
- *
- * setData This is the routine used to write the data register (TX).
- *
- * ulClock This is the baud rate clock speed.
- *
- * ulIntVector This encodes the interrupt vector of the device.
- */
-
-typedef struct _console_tbl {
- char *sDeviceName;
- console_devs deviceType;
- console_fns *pDeviceFns;
- boolean (*deviceProbe)(int minor);
- console_flow *pDeviceFlow;
- unsigned32 ulMargin;
- unsigned32 ulHysteresis;
- void *pDeviceParams;
- unsigned32 ulCtrlPort1;
- unsigned32 ulCtrlPort2;
- unsigned32 ulDataPort;
- getRegister_f getRegister;
- setRegister_f setRegister;
- getData_f getData;
- setData_f setData;
- unsigned32 ulClock;
- unsigned int ulIntVector;
-} console_tbl;
-
-typedef struct _console_data {
- void *termios_data;
- volatile boolean bActive;
- /*
- * This field may be used for any purpose required by the driver
- */
- void *pDeviceContext;
-} console_data;
-
-extern console_tbl Console_Port_Tbl[];
-extern console_data Console_Port_Data[];
-extern unsigned long Console_Port_Count;
-
-#endif
-/* end of include file */
diff --git a/c/src/libchip/serial/serprobe.c b/c/src/libchip/serial/serprobe.c
deleted file mode 100644
index b76bbebe3c..0000000000
--- a/c/src/libchip/serial/serprobe.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-#include <libchip/serial.h>
-#include "sersupp.h"
-
-boolean libchip_serial_default_probe(int minor)
-{
- /*
- * If the configuration dependent probe has located the device then
- * assume it is there
- */
-
- return TRUE;
-}
-
-
-
diff --git a/c/src/libchip/serial/sersupp.h b/c/src/libchip/serial/sersupp.h
deleted file mode 100644
index a996d53c7c..0000000000
--- a/c/src/libchip/serial/sersupp.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef __LIBCHIP_SERIAL_SUPPORT_h
-#define __LIBCHIP_SERIAL_SUPPORT_h
-
-int termios_baud_to_index(
- int termios_baud
-);
-
-int termios_baud_to_number(
- int termios_baud
-);
-
-boolean libchip_serial_default_probe(
- int minor
-);
-
-
-#endif
-/* end of include file */
diff --git a/c/src/libchip/serial/termios_baud2index.c b/c/src/libchip/serial/termios_baud2index.c
deleted file mode 100644
index b4bf3623a2..0000000000
--- a/c/src/libchip/serial/termios_baud2index.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/termios.h>
-
-int termios_baud_to_index(
- int termios_baud
-)
-{
- int baud_index;
-
- switch (termios_baud) {
- case B0: baud_index = 0; break;
- case B50: baud_index = 1; break;
- case B75: baud_index = 2; break;
- case B110: baud_index = 3; break;
- case B134: baud_index = 4; break;
- case B150: baud_index = 5; break;
- case B200: baud_index = 6; break;
- case B300: baud_index = 7; break;
- case B600: baud_index = 8; break;
- case B1200: baud_index = 9; break;
- case B1800: baud_index = 10; break;
- case B2400: baud_index = 11; break;
- case B4800: baud_index = 12; break;
- case B9600: baud_index = 13; break;
- case B19200: baud_index = 14; break;
- case B38400: baud_index = 15; break;
- case B57600: baud_index = 16; break;
- case B115200: baud_index = 17; break;
- case B230400: baud_index = 18; break;
- case B460800: baud_index = 19; break;
- default: baud_index = -1; break;
- }
-
- return baud_index;
-}
-
diff --git a/c/src/libchip/serial/termios_baud2num.c b/c/src/libchip/serial/termios_baud2num.c
deleted file mode 100644
index 9c2ddc047e..0000000000
--- a/c/src/libchip/serial/termios_baud2num.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/termios.h>
-
-int termios_baud_to_number(
- int termios_baud
-)
-{
- int baud;
-
- switch (termios_baud) {
- case B0: baud = 0; break;
- case B50: baud = 50; break;
- case B75: baud = 75; break;
- case B110: baud = 110; break;
- case B134: baud = 135; break;
- case B150: baud = 150; break;
- case B200: baud = 200; break;
- case B300: baud = 300; break;
- case B600: baud = 600; break;
- case B1200: baud = 1200; break;
- case B1800: baud = 1800; break;
- case B2400: baud = 2400; break;
- case B4800: baud = 4800; break;
- case B9600: baud = 9600; break;
- case B19200: baud = 19200; break;
- case B38400: baud = 38400; break;
- case B57600: baud = 57600; break;
- case B115200: baud = 115200; break;
- case B230400: baud = 230400; break;
- case B460800: baud = 460800; break;
- default: baud = -1; break;
- }
-
- return baud;
-}
-
diff --git a/c/src/libchip/serial/z85c30.c b/c/src/libchip/serial/z85c30.c
deleted file mode 100644
index b158887618..0000000000
--- a/c/src/libchip/serial/z85c30.c
+++ /dev/null
@@ -1,889 +0,0 @@
-/*
- * This file contains the console driver chip level routines for the
- * Zilog z85c30 chip.
- *
- * The Zilog Z8530 is also available as:
- *
- * + Intel 82530
- * + AMD ???
- *
- * COPYRIGHT (c) 1998 by Radstone Technology
- *
- *
- * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
- * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
- *
- * You are hereby granted permission to use, copy, modify, and distribute
- * this file, provided that this notice, plus the above copyright notice
- * and disclaimer, appears in all copies. Radstone Technology will provide
- * no support for this code.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <rtems/libio.h>
-#include <stdlib.h>
-
-#include <libchip/serial.h>
-#include "z85c30_p.h"
-#include "sersupp.h"
-
-/*
- * Flow control is only supported when using interrupts
- */
-
-console_flow z85c30_flow_RTSCTS = {
- z85c30_negate_RTS, /* deviceStopRemoteTx */
- z85c30_assert_RTS /* deviceStartRemoteTx */
-};
-
-console_flow z85c30_flow_DTRCTS = {
- z85c30_negate_DTR, /* deviceStopRemoteTx */
- z85c30_assert_DTR /* deviceStartRemoteTx */
-};
-
-/*
- * Exported driver function table
- */
-
-console_fns z85c30_fns = {
- libchip_serial_default_probe, /* deviceProbe */
- z85c30_open, /* deviceFirstOpen */
- NULL, /* deviceLastClose */
- NULL, /* deviceRead */
- z85c30_write_support_int, /* deviceWrite */
- z85c30_initialize_interrupts, /* deviceInitialize */
- z85c30_write_polled, /* deviceWritePolled */
- NULL, /* deviceSetAttributes */
- TRUE /* deviceOutputUsesInterrupts */
-};
-
-console_fns z85c30_fns_polled = {
- libchip_serial_default_probe, /* deviceProbe */
- z85c30_open, /* deviceFirstOpen */
- z85c30_close, /* deviceLastClose */
- z85c30_inbyte_nonblocking_polled, /* deviceRead */
- z85c30_write_support_polled, /* deviceWrite */
- z85c30_init, /* deviceInitialize */
- z85c30_write_polled, /* deviceWritePolled */
- NULL, /* deviceSetAttributes */
- FALSE /* deviceOutputUsesInterrupts */
-};
-
-extern void set_vector( rtems_isr_entry, rtems_vector_number, int );
-
-/*
- * z85c30_initialize_port
- *
- * initialize a z85c30 Port
- */
-
-Z85C30_STATIC void z85c30_initialize_port(
- int minor
-)
-{
- unsigned32 ulCtrlPort;
- unsigned32 ulBaudDivisor;
- setRegister_f setReg;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Using register 4
- * Set up the clock rate is 16 times the data
- * rate, 8 bit sync char, 1 stop bit, no parity
- */
-
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR4, SCC_WR4_1_STOP | SCC_WR4_16_CLOCK );
-
- /*
- * Set up for 8 bits/character on receive with
- * receiver disable via register 3
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR3, SCC_WR3_RX_8_BITS );
-
- /*
- * Set up for 8 bits/character on transmit
- * with transmitter disable via register 5
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR5, SCC_WR5_TX_8_BITS );
-
- /*
- * Clear misc control bits
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR10, 0x00 );
-
- /*
- * Setup the source of the receive and xmit
- * clock as BRG output and the transmit clock
- * as the output source for TRxC pin via register 11
- */
- (*setReg)(
- ulCtrlPort,
- SCC_WR0_SEL_WR11,
- SCC_WR11_OUT_BR_GEN | SCC_WR11_TRXC_OI |
- SCC_WR11_TX_BR_GEN | SCC_WR11_RX_BR_GEN
- );
-
- ulBaudDivisor = Z85C30_Baud(
- (unsigned32) Console_Port_Tbl[minor].ulClock,
- (unsigned32) Console_Port_Tbl[minor].pDeviceParams
- );
-
- /*
- * Setup the lower 8 bits time constants=1E.
- * If the time constans=1E, then the desire
- * baud rate will be equilvalent to 9600, via register 12.
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR12, ulBaudDivisor & 0xff );
-
- /*
- * using register 13
- * Setup the upper 8 bits time constant
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR13, (ulBaudDivisor>>8) & 0xff );
-
- /*
- * Enable the baud rate generator enable with clock from the
- * SCC's PCLK input via register 14.
- */
- (*setReg)(
- ulCtrlPort,
- SCC_WR0_SEL_WR14,
- SCC_WR14_BR_EN | SCC_WR14_BR_SRC | SCC_WR14_NULL
- );
-
- /*
- * We are only interested in CTS state changes
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR15, SCC_WR15_CTS_IE );
-
- /*
- * Reset errors
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_RST_INT );
-
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_ERR_RST );
-
- /*
- * Enable the receiver via register 3
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR3, SCC_WR3_RX_8_BITS | SCC_WR3_RX_EN );
-
- /*
- * Enable the transmitter pins set via register 5.
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR5, SCC_WR5_TX_8_BITS | SCC_WR5_TX_EN );
-
- /*
- * Disable interrupts
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR1, 0 );
-
- /*
- * Reset TX CRC
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_RST_TX_CRC );
-
- /*
- * Reset interrupts
- */
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_RST_INT );
-}
-
-/*
- * z85c30_open
- */
-
-Z85C30_STATIC int z85c30_open(
- int major,
- int minor,
- void *arg
-)
-{
-
- z85c30_initialize_port(minor);
-
- /*
- * Assert DTR
- */
-
- if (Console_Port_Tbl[minor].pDeviceFlow !=&z85c30_flow_DTRCTS) {
- z85c30_assert_DTR(minor);
- }
-
- return(RTEMS_SUCCESSFUL);
-}
-
-/*
- * z85c30_close
- */
-
-Z85C30_STATIC int z85c30_close(
- int major,
- int minor,
- void *arg
-)
-{
- /*
- * Negate DTR
- */
-
- if (Console_Port_Tbl[minor].pDeviceFlow !=&z85c30_flow_DTRCTS) {
- z85c30_negate_DTR(minor);
- }
-
- return(RTEMS_SUCCESSFUL);
-}
-
-/*
- * z85c30_init
- */
-
-Z85C30_STATIC void z85c30_init(int minor)
-{
- unsigned32 ulCtrlPort;
- unsigned8 dummy;
- z85c30_context *pz85c30Context;
- setRegister_f setReg;
- getRegister_f getReg;
-
- setReg = Console_Port_Tbl[minor].setRegister;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- pz85c30Context = (z85c30_context *)malloc(sizeof(z85c30_context));
-
- Console_Port_Data[minor].pDeviceContext = (void *)pz85c30Context;
-
- pz85c30Context->ucModemCtrl = SCC_WR5_TX_8_BITS | SCC_WR5_TX_EN;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- if ( ulCtrlPort == Console_Port_Tbl[minor].ulCtrlPort2 ) {
- /*
- * This is channel A
- */
- /*
- * Ensure port state machine is reset
- */
- dummy = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD0);
-
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR9, SCC_WR9_CH_A_RST);
-
- } else {
- /*
- * This is channel B
- */
- /*
- * Ensure port state machine is reset
- */
- dummy = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD0);
-
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR9, SCC_WR9_CH_B_RST);
- }
-}
-
-/*
- * These routines provide control of the RTS and DTR lines
- */
-
-/*
- * z85c30_assert_RTS
- */
-
-Z85C30_STATIC int z85c30_assert_RTS(int minor)
-{
- rtems_interrupt_level Irql;
- z85c30_context *pz85c30Context;
- setRegister_f setReg;
-
- setReg = Console_Port_Tbl[minor].setRegister;
-
- pz85c30Context = (z85c30_context *) Console_Port_Data[minor].pDeviceContext;
-
- /*
- * Assert RTS
- */
-
- rtems_interrupt_disable(Irql);
- pz85c30Context->ucModemCtrl|=SCC_WR5_RTS;
- (*setReg)(
- Console_Port_Tbl[minor].ulCtrlPort1,
- SCC_WR0_SEL_WR5,
- pz85c30Context->ucModemCtrl
- );
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * z85c30_negate_RTS
- */
-
-Z85C30_STATIC int z85c30_negate_RTS(int minor)
-{
- rtems_interrupt_level Irql;
- z85c30_context *pz85c30Context;
- setRegister_f setReg;
-
- setReg = Console_Port_Tbl[minor].setRegister;
-
- pz85c30Context = (z85c30_context *) Console_Port_Data[minor].pDeviceContext;
-
- /*
- * Negate RTS
- */
-
- rtems_interrupt_disable(Irql);
- pz85c30Context->ucModemCtrl&=~SCC_WR5_RTS;
- (*setReg)(
- Console_Port_Tbl[minor].ulCtrlPort1,
- SCC_WR0_SEL_WR5,
- pz85c30Context->ucModemCtrl
- );
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * These flow control routines utilise a connection from the local DTR
- * line to the remote CTS line
- */
-
-/*
- * z85c30_assert_DTR
- */
-
-Z85C30_STATIC int z85c30_assert_DTR(int minor)
-{
- rtems_interrupt_level Irql;
- z85c30_context *pz85c30Context;
- setRegister_f setReg;
-
- setReg = Console_Port_Tbl[minor].setRegister;
-
- pz85c30Context = (z85c30_context *) Console_Port_Data[minor].pDeviceContext;
-
- /*
- * Assert DTR
- */
-
- rtems_interrupt_disable(Irql);
- pz85c30Context->ucModemCtrl|=SCC_WR5_DTR;
- (*setReg)(
- Console_Port_Tbl[minor].ulCtrlPort1,
- SCC_WR0_SEL_WR5,
- pz85c30Context->ucModemCtrl
- );
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * z85c30_negate_DTR
- */
-
-Z85C30_STATIC int z85c30_negate_DTR(int minor)
-{
- rtems_interrupt_level Irql;
- z85c30_context *pz85c30Context;
- setRegister_f setReg;
-
- setReg = Console_Port_Tbl[minor].setRegister;
-
- pz85c30Context = (z85c30_context *) Console_Port_Data[minor].pDeviceContext;
-
- /*
- * Negate DTR
- */
-
- rtems_interrupt_disable(Irql);
- pz85c30Context->ucModemCtrl&=~SCC_WR5_DTR;
- (*setReg)(
- Console_Port_Tbl[minor].ulCtrlPort1,
- SCC_WR0_SEL_WR5,
- pz85c30Context->ucModemCtrl
- );
- rtems_interrupt_enable(Irql);
- return 0;
-}
-
-/*
- * z85c30_set_attributes
- *
- * This function sets the SCC channel to reflect the requested termios
- * port settings.
- */
-
-Z85C30_STATIC int z85c30_set_attributes(
- int minor,
- const struct termios *t
-)
-{
- unsigned32 ulCtrlPort;
- unsigned32 ulBaudDivisor;
- unsigned32 wr3;
- unsigned32 wr4;
- unsigned32 wr5;
- int baud_requested;
- setRegister_f setReg;
- rtems_interrupt_level Irql;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Calculate the baud rate divisor
- */
-
- baud_requested = t->c_cflag & CBAUD;
- if (!baud_requested)
- baud_requested = B9600; /* default to 9600 baud */
-
- ulBaudDivisor = Z85C30_Baud(
- (unsigned32) Console_Port_Tbl[minor].ulClock,
- (unsigned32) termios_baud_to_number( baud_requested )
- );
-
- wr3 = SCC_WR3_RX_EN;
- wr4 = SCC_WR4_16_CLOCK;
- wr5 = SCC_WR5_TX_EN;
-
- /*
- * Parity
- */
-
- if (t->c_cflag & PARENB) {
- wr4 |= SCC_WR4_PAR_EN;
- if (!(t->c_cflag & PARODD))
- wr4 |= SCC_WR4_PAR_EVEN;
- }
-
- /*
- * Character Size
- */
-
- if (t->c_cflag & CSIZE) {
- switch (t->c_cflag & CSIZE) {
- case CS5: break;
- case CS6: wr3 |= SCC_WR3_RX_6_BITS; wr5 |= SCC_WR5_TX_6_BITS; break;
- case CS7: wr3 |= SCC_WR3_RX_7_BITS; wr5 |= SCC_WR5_TX_7_BITS; break;
- case CS8: wr3 |= SCC_WR3_RX_8_BITS; wr5 |= SCC_WR5_TX_8_BITS; break;
- }
- } else {
- wr3 |= SCC_WR3_RX_8_BITS; /* default to 9600,8,N,1 */
- wr5 |= SCC_WR5_TX_8_BITS; /* default to 9600,8,N,1 */
- }
-
- /*
- * Stop Bits
- */
-
- if (t->c_cflag & CSTOPB) {
- wr4 |= SCC_WR4_2_STOP; /* 2 stop bits */
- } else {
- wr4 |= SCC_WR4_1_STOP; /* 1 stop bits */
- }
-
- /*
- * Now actually set the chip
- */
-
- rtems_interrupt_disable(Irql);
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR4, wr4 );
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR3, wr3 );
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR5, wr5 );
-
- /*
- * Setup the lower 8 bits time constants=1E.
- * If the time constans=1E, then the desire
- * baud rate will be equilvalent to 9600, via register 12.
- */
-
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR12, ulBaudDivisor & 0xff );
-
- /*
- * using register 13
- * Setup the upper 8 bits time constant
- */
-
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR13, (ulBaudDivisor>>8) & 0xff );
-
- rtems_interrupt_enable(Irql);
-
- return 0;
-}
-
-/*
- * z85c30_process
- *
- * This is the per port ISR handler.
- */
-
-Z85C30_STATIC void z85c30_process(
- int minor,
- unsigned8 ucIntPend
-)
-{
- unsigned32 ulCtrlPort;
- volatile unsigned8 z85c30_status;
- unsigned char cChar;
- setRegister_f setReg;
- getRegister_f getReg;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- /*
- * Deal with any received characters
- */
-
- while (ucIntPend&SCC_RR3_B_RX_IP)
- {
- z85c30_status = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD0);
- if (!Z85C30_Status_Is_RX_character_available(z85c30_status)) {
- break;
- }
-
- /*
- * Return the character read.
- */
-
- cChar = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD8);
-
- rtems_termios_enqueue_raw_characters(
- Console_Port_Data[minor].termios_data,
- &cChar,
- 1
- );
- }
-
- /*
- * There could be a race condition here if there is not yet a TX
- * interrupt pending but the buffer is empty. This condition has
- * been seen before on other z8530 drivers but has not been seen
- * with this one. The typical solution is to use "vector includes
- * status" or to only look at the interrupts actually pending
- * in RR3.
- */
-
- while (TRUE) {
- z85c30_status = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD0);
- if (!Z85C30_Status_Is_TX_buffer_empty(z85c30_status)) {
- /*
- * We'll get another interrupt when
- * the transmitter holding reg. becomes
- * free again and we are clear to send
- */
- break;
- }
-
-#if 0
- if (!Z85C30_Status_Is_CTS_asserted(z85c30_status)) {
- /*
- * We can't transmit yet
- */
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_RST_TX_INT);
- /*
- * The next state change of CTS will wake us up
- */
- break;
- }
-#endif
-
- rtems_termios_dequeue_characters(Console_Port_Data[minor].termios_data, 1);
- if (rtems_termios_dequeue_characters(
- Console_Port_Data[minor].termios_data, 1)) {
- if (Console_Port_Tbl[minor].pDeviceFlow != &z85c30_flow_RTSCTS) {
- z85c30_negate_RTS(minor);
- }
- Console_Port_Data[minor].bActive = FALSE;
- z85c30_enable_interrupts(minor, SCC_ENABLE_ALL_INTR_EXCEPT_TX);
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_RST_TX_INT);
- break;
- }
-
- }
-
- if (ucIntPend & SCC_RR3_B_EXT_IP) {
- /*
- * Clear the external status interrupt
- */
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_RST_INT);
- z85c30_status = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD0);
- }
-
- /*
- * Reset interrupts
- */
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR0, SCC_WR0_RST_HI_IUS);
-}
-
-/*
- * z85c30_isr
- *
- * This is the ISR handler for each Z8530.
- */
-
-Z85C30_STATIC rtems_isr z85c30_isr(
- rtems_vector_number vector
-)
-{
- int minor;
- unsigned32 ulCtrlPort;
- volatile unsigned8 ucIntPend;
- volatile unsigned8 ucIntPendPort;
- getRegister_f getReg;
-
- for (minor=0;minor<Console_Port_Count;minor++) {
- if(Console_Port_Tbl[minor].ulIntVector == vector &&
- Console_Port_Tbl[minor].deviceType == SERIAL_Z85C30 ) {
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort2;
- getReg = Console_Port_Tbl[minor].getRegister;
- do {
- ucIntPend = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD3);
-
- /*
- * If this is channel A select channel A status
- */
-
- if (ulCtrlPort == Console_Port_Tbl[minor].ulCtrlPort1) {
- ucIntPendPort = ucIntPend>>3;
- ucIntPendPort = ucIntPendPort&=7;
- } else {
- ucIntPendPort = ucIntPend &= 7;
- }
-
- if (ucIntPendPort) {
- z85c30_process(minor, ucIntPendPort);
- }
- } while (ucIntPendPort);
- }
- }
-}
-
-/*
- * z85c30_enable_interrupts
- *
- * This routine enables the specified interrupts for this minor.
- */
-
-Z85C30_STATIC void z85c30_enable_interrupts(
- int minor,
- int interrupt_mask
-)
-{
- unsigned32 ulCtrlPort;
- setRegister_f setReg;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR1, interrupt_mask);
-}
-
-/*
- * z85c30_initialize_interrupts
- *
- * This routine initializes the port to use interrupts.
- */
-
-Z85C30_STATIC void z85c30_initialize_interrupts(
- int minor
-)
-{
- unsigned32 ulCtrlPort1;
- unsigned32 ulCtrlPort2;
- setRegister_f setReg;
-
- ulCtrlPort1 = Console_Port_Tbl[minor].ulCtrlPort1;
- ulCtrlPort2 = Console_Port_Tbl[minor].ulCtrlPort2;
- setReg = Console_Port_Tbl[minor].setRegister;
-
-
- z85c30_init(minor);
-
- Console_Port_Data[minor].bActive=FALSE;
-
- z85c30_initialize_port( minor );
-
- if (Console_Port_Tbl[minor].pDeviceFlow != &z85c30_flow_RTSCTS) {
- z85c30_negate_RTS(minor);
- }
-
- set_vector(z85c30_isr, Console_Port_Tbl[minor].ulIntVector, 1);
-
- z85c30_enable_interrupts(minor, SCC_ENABLE_ALL_INTR_EXCEPT_TX);
-
- (*setReg)(ulCtrlPort1, SCC_WR0_SEL_WR2, 0); /* XXX vector */
- (*setReg)(ulCtrlPort1, SCC_WR0_SEL_WR9, SCC_WR9_MIE);
-
- /*
- * Reset interrupts
- */
-
- (*setReg)(ulCtrlPort1, SCC_WR0_SEL_WR0, SCC_WR0_RST_INT);
-}
-
-/*
- * z85c30_write_support_int
- *
- * Console Termios output entry point.
- *
- */
-
-Z85C30_STATIC int z85c30_write_support_int(
- int minor,
- const char *buf,
- int len)
-{
- unsigned32 Irql;
- unsigned32 ulCtrlPort;
- setRegister_f setReg;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * We are using interrupt driven output and termios only sends us
- * one character at a time.
- */
-
- if ( !len )
- return 0;
-
- /*
- * Put the character out and enable interrupts if necessary.
- */
-
- if (Console_Port_Tbl[minor].pDeviceFlow != &z85c30_flow_RTSCTS) {
- z85c30_assert_RTS(minor);
- }
- rtems_interrupt_disable(Irql);
- if ( Console_Port_Data[minor].bActive == FALSE) {
- Console_Port_Data[minor].bActive = TRUE;
- z85c30_enable_interrupts(minor, SCC_ENABLE_ALL_INTR);
- }
- (*setReg)(ulCtrlPort, SCC_WR0_SEL_WR8, *buf);
- rtems_interrupt_enable(Irql);
-
- return 1;
-}
-
-/*
- * z85c30_inbyte_nonblocking_polled
- *
- * This routine polls for a character.
- */
-
-Z85C30_STATIC int z85c30_inbyte_nonblocking_polled(
- int minor
-)
-{
- volatile unsigned8 z85c30_status;
- unsigned32 ulCtrlPort;
- getRegister_f getReg;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- getReg = Console_Port_Tbl[minor].getRegister;
-
- /*
- * return -1 if a character is not available.
- */
- z85c30_status = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD0);
- if (!Z85C30_Status_Is_RX_character_available(z85c30_status)) {
- return -1;
- }
-
- /*
- * Return the character read.
- */
-
- return (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD8);
-}
-
-/*
- * z85c30_write_support_polled
- *
- * Console Termios output entry point.
- *
- */
-
-Z85C30_STATIC int z85c30_write_support_polled(
- int minor,
- const char *buf,
- int len)
-{
- int nwrite=0;
-
- /*
- * poll each byte in the string out of the port.
- */
- while (nwrite < len) {
- z85c30_write_polled(minor, *buf++);
- nwrite++;
- }
-
- /*
- * return the number of bytes written.
- */
- return nwrite;
-}
-
-/*
- * z85c30_write_polled
- *
- * This routine transmits a character using polling.
- */
-
-Z85C30_STATIC void z85c30_write_polled(
- int minor,
- char cChar
-)
-{
- volatile unsigned8 z85c30_status;
- unsigned32 ulCtrlPort;
- getRegister_f getReg;
- setRegister_f setReg;
-
- ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort1;
- getReg = Console_Port_Tbl[minor].getRegister;
- setReg = Console_Port_Tbl[minor].setRegister;
-
- /*
- * Wait for the Transmit buffer to indicate that it is empty.
- */
-
- z85c30_status = (*getReg)( ulCtrlPort, SCC_WR0_SEL_RD0 );
-
- while (!Z85C30_Status_Is_TX_buffer_empty(z85c30_status)) {
- /*
- * Yield while we wait
- */
-#if 0
- if (_System_state_Is_up(_System_state_Get())) {
- rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
- }
-#endif
- z85c30_status = (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD0);
- }
-
- /*
- * Write the character.
- */
-
- (*setReg)( ulCtrlPort, SCC_WR0_SEL_WR8, cChar );
-}
-
diff --git a/c/src/libchip/serial/z85c30.h b/c/src/libchip/serial/z85c30.h
deleted file mode 100644
index f1beeef5e0..0000000000
--- a/c/src/libchip/serial/z85c30.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * This include file contains all console driver definitions for the
- * Zilog z85c30.
- *
- * COPYRIGHT (c) 1998 by Radstone Technology
- *
- *
- * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
- * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
- *
- * You are hereby granted permission to use, copy, modify, and distribute
- * this file, provided that this notice, plus the above copyright notice
- * and disclaimer, appears in all copies. Radstone Technology will provide
- * no support for this code.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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:
- */
-
-#ifndef __Z85C30_H
-#define __Z85C30_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Driver function table
- */
-
-extern console_fns z85c30_fns;
-extern console_fns z85c30_fns_polled;
-
-/*
- * Flow control function tables
- */
-
-extern console_flow z85c30_flow_RTSCTS;
-extern console_flow z85c30_flow_DTRCTS;
-
-/*
- * Default register access routines
- */
-
-unsigned8 z85c30_get_register( /* registers are byte-wide */
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum
-);
-
-void z85c30_set_register(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned8 ucData
-);
-
-unsigned8 z85c30_get_data(
- unsigned32 ulDataPort
-);
-
-void z85c30_set_data(
- unsigned32 ulDataPort,
- unsigned8 ucData
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/libchip/serial/z85c30_p.h b/c/src/libchip/serial/z85c30_p.h
deleted file mode 100644
index 0076fbeaef..0000000000
--- a/c/src/libchip/serial/z85c30_p.h
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * This include file contains all private driver definitions for the
- * Zilog z85c30.
- *
- * COPYRIGHT (c) 1998 by Radstone Technology
- *
- *
- * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
- * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
- *
- * You are hereby granted permission to use, copy, modify, and distribute
- * this file, provided that this notice, plus the above copyright notice
- * and disclaimer, appears in all copies. Radstone Technology will provide
- * no support for this code.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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$
- */
-
-#ifndef __Z85C30_P_H
-#define __Z85C30_P_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Define Z85C30_STATIC to nothing while debugging so the entry points
- * will show up in the symbol table.
- */
-
-#define Z85C30_STATIC
-
-/* #define Z85C30_STATIC static */
-
-/* bit values for write register 0 */
-/* command register */
-
-#define SCC_WR0_SEL_WR0 0x00
-#define SCC_WR0_SEL_WR1 0x01
-#define SCC_WR0_SEL_WR2 0x02
-#define SCC_WR0_SEL_WR3 0x03
-#define SCC_WR0_SEL_WR4 0x04
-#define SCC_WR0_SEL_WR5 0x05
-#define SCC_WR0_SEL_WR6 0x06
-#define SCC_WR0_SEL_WR7 0x07
-#define SCC_WR0_SEL_WR8 0x08
-#define SCC_WR0_SEL_WR9 0x09
-#define SCC_WR0_SEL_WR10 0x0a
-#define SCC_WR0_SEL_WR11 0x0b
-#define SCC_WR0_SEL_WR12 0x0c
-#define SCC_WR0_SEL_WR13 0x0d
-#define SCC_WR0_SEL_WR14 0x0e
-#define SCC_WR0_SEL_WR15 0x0f
-#define SCC_WR0_SEL_RD0 0x00
-#define SCC_WR0_SEL_RD1 0x01
-#define SCC_WR0_SEL_RD2 0x02
-#define SCC_WR0_SEL_RD3 0x03
-#define SCC_WR0_SEL_RD4 0x04
-#define SCC_WR0_SEL_RD5 0x05
-#define SCC_WR0_SEL_RD6 0x06
-#define SCC_WR0_SEL_RD7 0x07
-#define SCC_WR0_SEL_RD8 0x08
-#define SCC_WR0_SEL_RD9 0x09
-#define SCC_WR0_SEL_RD10 0x0a
-#define SCC_WR0_SEL_RD11 0x0b
-#define SCC_WR0_SEL_RD12 0x0c
-#define SCC_WR0_SEL_RD13 0x0d
-#define SCC_WR0_SEL_RD14 0x0e
-#define SCC_WR0_SEL_RD15 0x0f
-#define SCC_WR0_NULL_CODE 0x00
-#define SCC_WR0_RST_INT 0x10
-#define SCC_WR0_SEND_ABORT 0x18
-#define SCC_WR0_EN_INT_RX 0x20
-#define SCC_WR0_RST_TX_INT 0x28
-#define SCC_WR0_ERR_RST 0x30
-#define SCC_WR0_RST_HI_IUS 0x38
-#define SCC_WR0_RST_RX_CRC 0x40
-#define SCC_WR0_RST_TX_CRC 0x80
-#define SCC_WR0_RST_TX_UND 0xc0
-
-/* write register 2 */
-/* interrupt vector */
-
-/* bit values for write register 1 */
-/* tx/rx interrupt and data transfer mode definition */
-
-#define SCC_WR1_EXT_INT_EN 0x01
-#define SCC_WR1_TX_INT_EN 0x02
-#define SCC_WR1_PARITY 0x04
-#define SCC_WR1_RX_INT_DIS 0x00
-#define SCC_WR1_RX_INT_FIR 0x08
-#define SCC_WR1_INT_ALL_RX 0x10
-#define SCC_WR1_RX_INT_SPE 0x18
-#define SCC_WR1_RDMA_RECTR 0x20
-#define SCC_WR1_RDMA_FUNC 0x40
-#define SCC_WR1_RDMA_EN 0x80
-
-#define SCC_ENABLE_ALL_INTR \
- (SCC_WR1_EXT_INT_EN | SCC_WR1_TX_INT_EN | SCC_WR1_INT_ALL_RX)
-
-#define SCC_DISABLE_ALL_INTR 0x00
-
-#define SCC_ENABLE_ALL_INTR_EXCEPT_TX \
- (SCC_WR1_EXT_INT_EN | SCC_WR1_INT_ALL_RX)
-
-/* bit values for write register 3 */
-/* receive parameters and control */
-
-#define SCC_WR3_RX_EN 0x01
-#define SCC_WR3_SYNC_CHAR 0x02
-#define SCC_WR3_ADR_SEARCH 0x04
-#define SCC_WR3_RX_CRC_EN 0x08
-#define SCC_WR3_ENTER_HUNT 0x10
-#define SCC_WR3_AUTO_EN 0x20
-#define SCC_WR3_RX_5_BITS 0x00
-#define SCC_WR3_RX_7_BITS 0x40
-#define SCC_WR3_RX_6_BITS 0x80
-#define SCC_WR3_RX_8_BITS 0xc0
-
-/* bit values for write register 4 */
-/* tx/rx misc parameters and modes */
-
-#define SCC_WR4_PAR_EN 0x01
-#define SCC_WR4_PAR_EVEN 0x02
-#define SCC_WR4_SYNC_EN 0x00
-#define SCC_WR4_1_STOP 0x04
-#define SCC_WR4_2_STOP 0x0c
-#define SCC_WR4_8_SYNC 0x00
-#define SCC_WR4_16_SYNC 0x10
-#define SCC_WR4_SDLC 0x20
-#define SCC_WR4_EXT_SYNC 0x30
-#define SCC_WR4_1_CLOCK 0x00
-#define SCC_WR4_16_CLOCK 0x40
-#define SCC_WR4_32_CLOCK 0x80
-#define SCC_WR4_64_CLOCK 0xc0
-
-/* bit values for write register 5 */
-/* transmit parameter and controls */
-
-#define SCC_WR5_TX_CRC_EN 0x01
-#define SCC_WR5_RTS 0x02
-#define SCC_WR5_SDLC 0x04
-#define SCC_WR5_TX_EN 0x08
-#define SCC_WR5_SEND_BRK 0x10
-
-#define SCC_WR5_TX_5_BITS 0x00
-#define SCC_WR5_TX_7_BITS 0x20
-#define SCC_WR5_TX_6_BITS 0x40
-#define SCC_WR5_TX_8_BITS 0x60
-#define SCC_WR5_DTR 0x80
-
-/* write register 6 */
-/* sync chars or sdlc address field */
-
-/* write register 7 */
-/* sync char or sdlc flag */
-
-/* write register 8 */
-/* transmit buffer */
-
-/* bit values for write register 9 */
-/* master interrupt control */
-
-#define SCC_WR9_VIS 0x01
-#define SCC_WR9_NV 0x02
-#define SCC_WR9_DLC 0x04
-#define SCC_WR9_MIE 0x08
-#define SCC_WR9_STATUS_HI 0x10
-#define SCC_WR9_NO_RST 0x00
-#define SCC_WR9_CH_B_RST 0x40
-#define SCC_WR9_CH_A_RST 0x80
-#define SCC_WR9_HDWR_RST 0xc0
-
-/* bit values for write register 10 */
-/* misc tx/rx control bits */
-
-#define SCC_WR10_6_BIT_SYNC 0x01
-#define SCC_WR10_LOOP_MODE 0x02
-#define SCC_WR10_ABORT_UND 0x04
-#define SCC_WR10_MARK_IDLE 0x08
-#define SCC_WR10_ACT_POLL 0x10
-#define SCC_WR10_NRZ 0x00
-#define SCC_WR10_NRZI 0x20
-#define SCC_WR10_FM1 0x40
-#define SCC_WR10_FM0 0x60
-#define SCC_WR10_CRC_PRESET 0x80
-
-/* bit values for write register 11 */
-/* clock mode control */
-
-#define SCC_WR11_OUT_XTAL 0x00
-#define SCC_WR11_OUT_TX_CLK 0x01
-#define SCC_WR11_OUT_BR_GEN 0x02
-#define SCC_WR11_OUT_DPLL 0x03
-#define SCC_WR11_TRXC_OI 0x04
-#define SCC_WR11_TX_RTXC 0x00
-#define SCC_WR11_TX_TRXC 0x08
-#define SCC_WR11_TX_BR_GEN 0x10
-#define SCC_WR11_TX_DPLL 0x18
-#define SCC_WR11_RX_RTXC 0x00
-#define SCC_WR11_RX_TRXC 0x20
-#define SCC_WR11_RX_BR_GEN 0x40
-#define SCC_WR11_RX_DPLL 0x60
-#define SCC_WR11_RTXC_XTAL 0x80
-
-/* write register 12 */
-/* lower byte of baud rate generator time constant */
-
-/* write register 13 */
-/* upper byte of baud rate generator time constant */
-
-/* bit values for write register 14 */
-/* misc control bits */
-
-#define SCC_WR14_BR_EN 0x01
-#define SCC_WR14_BR_SRC 0x02
-#define SCC_WR14_DTR_FUNC 0x04
-#define SCC_WR14_AUTO_ECHO 0x08
-#define SCC_WR14_LCL_LOOP 0x10
-#define SCC_WR14_NULL 0x00
-#define SCC_WR14_SEARCH 0x20
-#define SCC_WR14_RST_CLK 0x40
-#define SCC_WR14_DIS_DPLL 0x60
-#define SCC_WR14_SRC_BR 0x80
-#define SCC_WR14_SRC_RTXC 0xa0
-#define SCC_WR14_FM_MODE 0xc0
-#define SCC_WR14_NRZI 0xe0
-
-/* bit values for write register 15 */
-/* external/status interrupt control */
-
-#define SCC_WR15_ZERO_CNT 0x02
-#define SCC_WR15_CD_IE 0x08
-#define SCC_WR15_SYNC_IE 0x10
-#define SCC_WR15_CTS_IE 0x20
-#define SCC_WR15_TX_UND_IE 0x40
-#define SCC_WR15_BREAK_IE 0x80
-
-/* bit values for read register 0 */
-/* tx/rx buffer status and external status */
-
-#define SCC_RR0_RX_AVAIL 0x01
-#define SCC_RR0_ZERO_CNT 0x02
-#define SCC_RR0_TX_EMPTY 0x04
-#define SCC_RR0_CD 0x08
-#define SCC_RR0_SYNC 0x10
-#define SCC_RR0_CTS 0x20
-#define SCC_RR0_TX_UND 0x40
-#define SCC_RR0_BREAK 0x80
-
-/* bit values for read register 1 */
-
-#define SCC_RR1_ALL_SENT 0x01
-#define SCC_RR1_RES_CD_2 0x02
-#define SCC_RR1_RES_CD_1 0x01
-#define SCC_RR1_RES_CD_0 0x08
-#define SCC_RR1_PAR_ERR 0x10
-#define SCC_RR1_RX_OV_ERR 0x20
-#define SCC_RR1_CRC_ERR 0x40
-#define SCC_RR1_END_FRAME 0x80
-
-/* read register 2 */
-/* interrupt vector */
-
-/* bit values for read register 3 */
-/* interrupt pending register */
-
-#define SCC_RR3_B_EXT_IP 0x01
-#define SCC_RR3_B_TX_IP 0x02
-#define SCC_RR3_B_RX_IP 0x04
-#define SCC_RR3_A_EXT_IP 0x08
-#define SCC_RR3_A_TX_IP 0x10
-#define SCC_RR3_A_RX_IP 0x20
-
-/* read register 8 */
-/* receive data register */
-
-/* bit values for read register 10 */
-/* misc status bits */
-
-#define SCC_RR10_ON_LOOP 0x02
-#define SCC_RR10_LOOP_SEND 0x10
-#define SCC_RR10_2_CLK_MIS 0x40
-#define SCC_RR10_1_CLK_MIS 0x80
-
-/* read register 12 */
-/* lower byte of time constant */
-
-/* read register 13 */
-/* upper byte of time constant */
-
-/* bit values for read register 15 */
-/* external/status ie bits */
-
-#define SCC_RR15_ZERO_CNT 0x02
-#define SCC_RR15_CD_IE 0x08
-#define SCC_RR15_SYNC_IE 0x10
-#define SCC_RR15_CTS_IE 0x20
-#define SCC_RR15_TX_UND_IE 0x40
-#define SCC_RR15_BREAK_IE 0x80
-
-typedef struct _z85c30_context
-{
- unsigned8 ucModemCtrl;
-} z85c30_context;
-
-/*
- * The following macro calculates the Baud constant. For the Z85C30 chip.
- *
- * Note: baud constant = ((clock frequency / Clock_X) / (2 * Baud Rate)) - 2
- * eg ((10,000,000 / 16) / (2 * Baud Rate)) - 2
- */
-
-#define Z85C30_Baud( _clock, _baud_rate ) \
- ( ((_clock) /( 16 * 2 * _baud_rate)) - 2)
-
-#define Z85C30_Status_Is_RX_character_available(_status) \
- ((_status) & SCC_RR0_RX_AVAIL)
-
-#define Z85C30_Status_Is_TX_buffer_empty(_status) \
- ((_status) & SCC_RR0_TX_EMPTY)
-
-#define Z85C30_Status_Is_CTS_asserted(_status) \
- ((_status) & SCC_RR0_CTS)
-
-#define Z85C30_Status_Is_break_abort(_status) \
- ((_status) & SCC_RR0_BREAK)
-
-/*
- * Private routines
- */
-
-Z85C30_STATIC void z85c30_init(int minor);
-
-Z85C30_STATIC int z85c30_set_attributes(
- int minor,
- const struct termios *t
-);
-
-Z85C30_STATIC int z85c30_open(
- int major,
- int minor,
- void * arg
-);
-
-Z85C30_STATIC int z85c30_close(
- int major,
- int minor,
- void * arg
-);
-
-Z85C30_STATIC void z85c30_write_polled(
- int minor,
- char cChar
-);
-
-Z85C30_STATIC int z85c30_assert_RTS(
- int minor
-);
-
-Z85C30_STATIC int z85c30_negate_RTS(
- int minor
-);
-
-Z85C30_STATIC int z85c30_assert_DTR(
- int minor
-);
-
-Z85C30_STATIC int z85c30_negate_DTR(
- int minor
-);
-
-Z85C30_STATIC void z85c30_initialize_interrupts(int minor);
-
-Z85C30_STATIC int z85c30_write_support_int(
- int minor,
- const char *buf,
- int len
-);
-
-Z85C30_STATIC int z85c30_write_support_polled(
- int minor,
- const char *buf,
- int len
-);
-
-Z85C30_STATIC int z85c30_inbyte_nonblocking_polled(
- int minor
-);
-
-Z85C30_STATIC void z85c30_enable_interrupts(
- int minor,
- int interrupt_mask
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/libchip/serial/z85c30_reg.c b/c/src/libchip/serial/z85c30_reg.c
deleted file mode 100644
index 889dad4530..0000000000
--- a/c/src/libchip/serial/z85c30_reg.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * This file contains a typical set of register access routines which may be
- * used with the z85c30 chip if accesses to the chip are as follows:
- *
- * + registers are accessed as bytes
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#ifndef _Z85C30_MULTIPLIER
-#define _Z85C30_MULTIPLIER 1
-#define _Z85C30_NAME(_X) _X
-#define _Z85C30_TYPE unsigned8
-#endif
-
-/*
- * Z85C30 Get Register Routine
- */
-
-unsigned8 _Z85C30_NAME(z85c30_get_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum
-)
-{
- _Z85C30_TYPE *port;
- unsigned8 data;
- rtems_interrupt_level level;
-
- port = (_Z85C30_TYPE *)ulCtrlPort;
-
- rtems_interrupt_disable(level);
-
- if(ucRegNum) {
- *port = ucRegNum;
- }
- data = *port;
- rtems_interrupt_enable(level);
-
- return data;
-}
-
-/*
- * Z85C30 Set Register Routine
- */
-
-void _Z85C30_NAME(z85c30_set_register)(
- unsigned32 ulCtrlPort,
- unsigned8 ucRegNum,
- unsigned8 ucData
-)
-{
- _Z85C30_TYPE *port;
- rtems_interrupt_level level;
-
- port = (_Z85C30_TYPE *)ulCtrlPort;
-
- rtems_interrupt_disable(level);
- if(ucRegNum) {
- *port = ucRegNum;
- }
- *port = ucData;
- rtems_interrupt_enable(level);
-}
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 2eace43e4d..0000000000
--- a/c/src/libchip/shmdr/addlq.c
+++ /dev/null
@@ -1,43 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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 4a9a4006db..0000000000
--- a/c/src/libchip/shmdr/cnvpkt.c
+++ /dev/null
@@ -1,42 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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 6cd4e2129f..0000000000
--- a/c/src/libchip/shmdr/dump.c
+++ /dev/null
@@ -1,51 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <stdio.h>
-
-#include "shm.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 b0558c92f0..0000000000
--- a/c/src/libchip/shmdr/fatal.c
+++ /dev/null
@@ -1,39 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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 7b525b2d92..0000000000
--- a/c/src/libchip/shmdr/getlq.c
+++ /dev/null
@@ -1,48 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <shm.h>
-
-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 03971ea022..0000000000
--- a/c/src/libchip/shmdr/getpkt.c
+++ /dev/null
@@ -1,36 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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 4e1df20be0..0000000000
--- a/c/src/libchip/shmdr/init.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/* Shm_Initialization
- *
- * This routine is the shared memory communications initerface
- * driver initialization routine.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <rtems.h>
-#include <shm.h>
-
-#include <string.h> /* memset() */
-#include <stdlib.h> /* malloc() */
-#include <assert.h>
-
-/*
- * 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 ; i<Shm_Maximum_envelopes ; i++ ) {
- Shm_Envelopes[ i ].index = Shm_Convert(i);
- Shm_Free_envelope( &Shm_Envelopes[ i ] );
- }
-
- /*
- * 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;
-
- /*
- * 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 f876d4b43d..0000000000
--- a/c/src/libchip/shmdr/initlq.c
+++ /dev/null
@@ -1,35 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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 1483cd3afe..0000000000
--- a/c/src/libchip/shmdr/intr.c
+++ /dev/null
@@ -1,58 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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 5e08cc4ec4..0000000000
--- a/c/src/libchip/shmdr/mpci.h
+++ /dev/null
@@ -1,59 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <shm.h>
-
-#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.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 573a4ebd21..0000000000
--- a/c/src/libchip/shmdr/mpisr.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* _Shm_isr()
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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 22dc116435..0000000000
--- a/c/src/libchip/shmdr/poll.c
+++ /dev/null
@@ -1,53 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/libio.h>
-
-#include "shm.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 98fd23b29d..0000000000
--- a/c/src/libchip/shmdr/receive.c
+++ /dev/null
@@ -1,44 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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 d14b6e26e1..0000000000
--- a/c/src/libchip/shmdr/retpkt.c
+++ /dev/null
@@ -1,32 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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 f26445cb42..0000000000
--- a/c/src/libchip/shmdr/send.c
+++ /dev/null
@@ -1,61 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "shm.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 1e56e5737b..0000000000
--- a/c/src/libchip/shmdr/setckvec.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <rtems/libio.h>
-
-#include "shm.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 8875525983..0000000000
--- a/c/src/libchip/shmdr/shm_driver.h
+++ /dev/null
@@ -1,542 +0,0 @@
-/* shm.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <clockdrv.h>
-
-#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(no_cpu) /* for this values are irrelevant */
-#define SHM_LOCK_VALUE 1
-#define SHM_UNLOCK_VALUE 0
-#else
-#error "shm.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/c/src/libmisc/README b/c/src/libmisc/README
deleted file mode 100644
index bbde4feeae..0000000000
--- a/c/src/libmisc/README
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# $Id$
-#
-
-This directory contains for the "miscellaneous" library. Currently
-this library contains a number of useful support libraries:
-
- + Task Stack Overflow Checker
- + Workspace Consistency Checker
- + Task Execution Time Monitor
- + Period Statistics Monitor
- + Debug Monitor
-
-The following ideas have been mentioned for items which could go
-in this library, but this list is not all inclusive:
-
- + there are no outstanding suggestions.
-
-The intent of this library is to provide a home for useful utility routines
-which are dependent upon RTEMS.
-
---joel
-16 Sept 97
diff --git a/c/src/libmisc/assoc/Makefile.in b/c/src/libmisc/assoc/Makefile.in
deleted file mode 100644
index a547bb6565..0000000000
--- a/c/src/libmisc/assoc/Makefile.in
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIB=${ARCH}/libassoc-tmp.a
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=assoc
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/assoc.h
-
-SRCS=$(C_FILES) $(H_FILES) $(INSTALLED_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${LIB}: ${SRCS} ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/libmisc/assoc/assoc.c b/c/src/libmisc/assoc/assoc.c
deleted file mode 100644
index 74387a8c5b..0000000000
--- a/c/src/libmisc/assoc/assoc.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * assoc.c
- * rtems assoc routines
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include "assoc.h"
-
-#include <stdio.h> /* sprintf */
-#include <string.h> /* strcat, strcmp */
-
-#define STREQ(a,b) (strcmp((a), (b)) == 0)
-#define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME))
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (strcmp(ap->name, name) == 0)
- return ap;
-
- return default_ap;
-}
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (ap->local_value == local_value)
- return ap;
-
- return default_ap;
-}
-
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (ap->remote_value == remote_value)
- return ap;
-
- return default_ap;
-}
-
-
-/*
- * Get values
- */
-
-unsigned32
-rtems_assoc_remote_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_local(ap, local_value);
- if (nap)
- return nap->remote_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_local_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_remote(ap, remote_value);
- if (nap)
- return nap->local_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_remote_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_name(ap, name);
- if (nap)
- return nap->remote_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_local_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_name(ap, name);
- if (nap)
- return nap->local_value;
-
- return 0;
-}
-
-/*
- * what to return if a value is not found
- * this is not reentrant, but it really shouldn't be invoked anyway
- */
-
-const char *
-rtems_assoc_name_bad(
- unsigned32 bad_value
-)
-{
-#ifdef RTEMS_DEBUG
- static char bad_buffer[32];
-
- sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
-#else
- static char bad_buffer[32] = "<assoc.c: BAD NAME>";
-#endif
- return bad_buffer;
-}
-
-
-const char *
-rtems_assoc_name_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_local(ap, local_value);
- if (nap)
- return nap->name;
-
- return rtems_assoc_name_bad(local_value);
-}
-
-const char *
-rtems_assoc_name_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_remote(ap, remote_value);
- if (nap)
- return nap->name;
-
- return rtems_assoc_name_bad(remote_value);
-}
-
-/*
- * Bitfield functions assume just 1 bit set in each of remote and local
- * entries; they do not check for this.
- */
-
-unsigned32 rtems_assoc_remote_by_local_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- unsigned32 b;
- unsigned32 remote_value = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & local_value)
- remote_value |= rtems_assoc_remote_by_local(ap, b);
-
- return remote_value;
-}
-
-
-unsigned32 rtems_assoc_local_by_remote_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- unsigned32 b;
- unsigned32 local_value = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & remote_value)
- local_value |= rtems_assoc_local_by_remote(ap, b);
-
- return local_value;
-}
-
-char *
-rtems_assoc_name_by_remote_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 value,
- char *buffer
- )
-{
- unsigned32 b;
-
- *buffer = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (*buffer)
- strcat(buffer, " ");
- strcat(buffer, rtems_assoc_name_by_remote(ap, b));
- }
-
- return buffer;
-}
-
-char *
-rtems_assoc_name_by_local_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 value,
- char *buffer
- )
-{
- unsigned32 b;
-
- *buffer = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (*buffer)
- strcat(buffer, " ");
- strcat(buffer, rtems_assoc_name_by_local(ap, b));
- }
-
- return buffer;
-}
diff --git a/c/src/libmisc/assoc/assoc.h b/c/src/libmisc/assoc/assoc.h
deleted file mode 100644
index 1982d654ac..0000000000
--- a/c/src/libmisc/assoc/assoc.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Rtems associativity routines. Mainly used to convert a value from
- * one space to another (eg: our errno's to host errno's and v.v)
- *
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_ASSOC_H
-#define _INCLUDE_ASSOC_H
-
-typedef struct {
- const char *name;
- unsigned32 local_value;
- unsigned32 remote_value;
-} rtems_assoc_t;
-
-/*
- * Flag/marker for optional default value in each table
- */
-
-#define RTEMS_ASSOC_DEFAULT_NAME "(default)"
-
-const rtems_assoc_t *rtems_assoc_ptr_by_name(const rtems_assoc_t *, const char *);
-const rtems_assoc_t *rtems_assoc_ptr_by_value(const rtems_assoc_t *, unsigned32);
-const rtems_assoc_t *rtems_assoc_ptr_by_remote(const rtems_assoc_t *, unsigned32);
-
-unsigned32 rtems_assoc_remote_by_local(const rtems_assoc_t *, unsigned32);
-unsigned32 rtems_assoc_local_by_remote(const rtems_assoc_t *, unsigned32);
-unsigned32 rtems_assoc_remote_by_name(const rtems_assoc_t *, const char *);
-unsigned32 rtems_assoc_local_by_name(const rtems_assoc_t *, const char *);
-const char *rtems_assoc_name_by_local(const rtems_assoc_t *, unsigned32);
-const char *rtems_assoc_name_by_remote(const rtems_assoc_t *, unsigned32);
-
-unsigned32 rtems_assoc_remote_by_local_bitfield(const rtems_assoc_t *, unsigned32);
-char *rtems_assoc_name_by_local_bitfield(const rtems_assoc_t *, unsigned32, char *);
-char *rtems_assoc_name_by_remote_bitfield(const rtems_assoc_t *, unsigned32, char *);
-unsigned32 rtems_assoc_local_by_remote_bitfield(const rtems_assoc_t *, unsigned32);
-
-
-#endif /* ! _INCLUDE_ASSOC_H */
diff --git a/c/src/libmisc/cpuuse/Makefile.in b/c/src/libmisc/cpuuse/Makefile.in
deleted file mode 100644
index 391b6cac8f..0000000000
--- a/c/src/libmisc/cpuuse/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIB=${ARCH}/libcpuuse-tmp.a
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=cpuuse
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-INSTALLED_H_FILES=$(srcdir)/cpuuse.h
-
-SRCS=$(C_FILES) $(H_FILES) $(INSTALLED_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${LIB}: ${SRCS} ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL) -m 444 ${INSTALLED_H_FILES} $(PROJECT_INCLUDE)
-# $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/libmisc/cpuuse/README b/c/src/libmisc/cpuuse/README
deleted file mode 100644
index 20e76f07bc..0000000000
--- a/c/src/libmisc/cpuuse/README
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# $Id$
-#
-
-This directory contains a stack bounds checker. It provides two
-primary features:
-
- + check for stack overflow at each context switch
- + provides an educated guess at each task's stack usage
-
-The stack overflow check at context switch works by looking for
-a 16 byte pattern at the logical end of the stack to be corrupted.
-The "guesser" assumes that the entire stack was prefilled with a known
-pattern and assumes that the pattern is still in place if the memory
-has not been used as a stack.
-
-Both of these can be fooled by pushing large holes onto the stack
-and not writing to them... or (much more unlikely) writing the
-magic patterns into memory.
-
-This code has not been extensively tested. It is provided as a tool
-for RTEMS users to catch the most common mistake in multitasking
-systems ... too little stack space. Suggestions and comments are appreciated.
-
-NOTES:
-
-1. Stack usage information is questionable on CPUs which push
- large holes on stack.
-
-2. The stack checker has a tendency to generate a fault when
- trying to print the helpful diagnostic message. If it comes
- out, congratulations. If not, then the variable Stack_check_Blown_task
- contains a pointer to the TCB of the offending task. This
- is usually enough to go on.
-
-FUTURE:
-
-1. Determine how/if gcc will generate stack probe calls and support that.
-
-2. Get accurate stack usage numbers on i960.. it pushes very large
- holes on the stack.
diff --git a/c/src/libmisc/cpuuse/cpuuse.c b/c/src/libmisc/cpuuse/cpuuse.c
deleted file mode 100644
index db43fbf3ee..0000000000
--- a/c/src/libmisc/cpuuse/cpuuse.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * CPU Usage Reporter
- *
- * COPYRIGHT (c) 1989-1998. 1996.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-extern rtems_configuration_table BSP_Configuration;
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "cpuuse.h"
-
-unsigned32 CPU_usage_Ticks_at_last_reset;
-
-/*PAGE
- *
- * CPU_usage_Dump
- */
-
-void CPU_usage_Dump( void )
-{
- unsigned32 i;
- unsigned32 class_index;
- Thread_Control *the_thread;
- Objects_Information *information;
- unsigned32 u32_name;
- char name[5];
- unsigned32 total_units = 0;
-
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
-
- if ( the_thread )
- total_units += the_thread->ticks_executed;
- }
- }
- }
-
- printf("CPU Usage by thread\n");
-#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
- printf( " ID NAME TICKS PERCENT\n" );
-#else
- printf( " ID NAME TICKS\n" );
-#endif
-
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
-
- if ( !the_thread )
- continue;
-
- u32_name = *(unsigned32 *)the_thread->Object.name;
-
- name[ 0 ] = (u32_name >> 24) & 0xff;
- name[ 1 ] = (u32_name >> 16) & 0xff;
- name[ 2 ] = (u32_name >> 8) & 0xff;
- name[ 3 ] = (u32_name >> 0) & 0xff;
- name[ 4 ] = '\0';
-
-#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
- printf( "0x%08x %4s %8d %5.3f\n",
- the_thread->Object.id,
- name,
- the_thread->ticks_executed,
- (total_units) ?
- (double)the_thread->ticks_executed / (double)total_units :
- (double)total_units
- );
-#else
- printf( "0x%08x %4s %8d\n",
- the_thread->Object.id,
- name,
- the_thread->ticks_executed
- );
-#endif
- }
- }
- }
-
- printf(
- "\nTicks since last reset = %d\n",
- _Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset
- );
- printf( "\nTotal Units = %d\n", total_units );
-}
-
-/*PAGE
- *
- * CPU_usage_Reset
- */
-
-void CPU_usage_Reset( void )
-{
- unsigned32 i;
- unsigned32 class_index;
- Thread_Control *the_thread;
- Objects_Information *information;
-
- CPU_usage_Ticks_at_last_reset = _Watchdog_Ticks_since_boot;
-
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
-
- if ( !the_thread )
- continue;
-
- the_thread->ticks_executed = 0;
- }
- }
- }
-
-}
-
diff --git a/c/src/libmisc/cpuuse/cpuuse.h b/c/src/libmisc/cpuuse/cpuuse.h
deleted file mode 100644
index bc678bb284..0000000000
--- a/c/src/libmisc/cpuuse/cpuuse.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* cpuuse.h
- *
- * This include file contains information necessary to utilize
- * and install the cpu usage reporting mechanism.
- *
- * COPYRIGHT (c) 1989-1998. 1996.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_USE_h
-#define __CPU_USE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * CPU_usage_Dump
- */
-
-void CPU_usage_Dump( void );
-
-/*
- * CPU_usage_Reset
- */
-
-void CPU_usage_Reset( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/libmisc/cpuuse/internal.h b/c/src/libmisc/cpuuse/internal.h
deleted file mode 100644
index 96d0c3f10a..0000000000
--- a/c/src/libmisc/cpuuse/internal.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* internal.h
- *
- * This include file contains internal information
- * for the RTEMS stack checker.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INTERNAL_STACK_CHECK_h
-#define __INTERNAL_STACK_CHECK_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This structure is used to fill in and compare the "end of stack"
- * marker pattern.
- * pattern area must be a multiple of 4 words.
- */
-
-#ifdef CPU_STACK_CHECK_SIZE
-#define PATTERN_SIZE_WORDS (((CPU_STACK_CHECK_SIZE / 4) + 3) & ~0x3)
-#else
-#define PATTERN_SIZE_WORDS 4
-#endif
-
-#define PATTERN_SIZE_BYTES (PATTERN_SIZE_WORDS * 4)
-
-typedef struct {
- unsigned32 pattern[ PATTERN_SIZE_WORDS ];
-} Stack_check_Control;
-
-/*
- * The pattern used to fill the entire stack.
- */
-
-#define BYTE_PATTERN 0xA5
-#define U32_PATTERN 0xA5A5A5A5
-
-/*
- * Stack_check_Create_extension
- */
-
-boolean Stack_check_Create_extension(
- Thread_Control *running,
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Begin_extension
- */
-
-void Stack_check_Begin_extension(
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Switch_extension
- */
-
-void Stack_check_Switch_extension(
- Thread_Control *running,
- Thread_Control *heir
-);
-
-/*
- * Stack_check_Fatal_extension
- */
-
-void Stack_check_Fatal_extension(
- Internal_errors_Source source,
- boolean is_internal,
- unsigned32 status
-);
-
-/*
- * Stack_check_Dump_usage
- */
-
-void Stack_check_Dump_usage( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/libmisc/error/Makefile.in b/c/src/libmisc/error/Makefile.in
deleted file mode 100644
index 5cc51de586..0000000000
--- a/c/src/libmisc/error/Makefile.in
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIB=${ARCH}/liberror-tmp.a
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=error
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/error.h
-
-SRCS=$(C_FILES) $(H_FILES) $(INSTALLED_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${LIB}: ${SRCS} ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/libmisc/error/error.c b/c/src/libmisc/error/error.c
deleted file mode 100644
index dd32fb8b66..0000000000
--- a/c/src/libmisc/error/error.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * report errors and panics to RTEMS' stderr.
- * Currently just used by RTEMS monitor.
- *
- * $Id$
- */
-
-
-/*
- * These routines provide general purpose error reporting.
- * rtems_error reports an error to stderr and allows use of
- * printf style formatting. A newline is appended to all messages.
- *
- * error_flag can be specified as any of the following:
- *
- * RTEMS_ERROR_ERRNO -- include errno text in output
- * RTEMS_ERROR_PANIC -- halts local system after output
- * RTEMS_ERROR_ABORT -- abort after output
- *
- * It can also include a rtems_status value which can be OR'd
- * with the above flags. *
- *
- * EXAMPLE
- * #include <rtems.h>
- * #include <rtems/error.h>
- * rtems_error(0, "stray interrupt %d", intr);
- *
- * EXAMPLE
- * if ((status = rtems_task_create(...)) != RTEMS_SUCCCESSFUL)
- * {
- * rtems_error(status | RTEMS_ERROR_ABORT,
- * "could not create task");
- * }
- *
- * EXAMPLE
- * if ((fd = open(pathname, O_RDNLY)) < 0)
- * {
- * rtems_error(RTEMS_ERROR_ERRNO, "open of '%s' failed", pathname);
- * goto failed;
- * }
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-
-#include "error.h"
-#include <rtems/assoc.h>
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h> /* _exit() */
-
-/* bug in hpux <errno.h>: no prototypes unless you are C++ */
-#ifdef hpux9
-char *strerror(int);
-#endif
-
-extern char *rtems_progname;
-int rtems_panic_in_progress;
-
-rtems_assoc_t rtems_status_assoc[] = {
- { "successful completion", RTEMS_SUCCESSFUL, },
- { "returned from a thread", RTEMS_TASK_EXITTED, },
- { "multiprocessing not configured", RTEMS_MP_NOT_CONFIGURED, },
- { "invalid object name", RTEMS_INVALID_NAME, },
- { "invalid object id", RTEMS_INVALID_ID, },
- { "too many", RTEMS_TOO_MANY, },
- { "timed out waiting", RTEMS_TIMEOUT, },
- { "object deleted while waiting", RTEMS_OBJECT_WAS_DELETED, },
- { "specified size was invalid", RTEMS_INVALID_SIZE, },
- { "address specified is invalid", RTEMS_INVALID_ADDRESS, },
- { "number was invalid", RTEMS_INVALID_NUMBER, },
- { "item has not been initialized", RTEMS_NOT_DEFINED, },
- { "resources still outstanding", RTEMS_RESOURCE_IN_USE, },
- { "request not satisfied", RTEMS_UNSATISFIED, },
- { "thread is in wrong state", RTEMS_INCORRECT_STATE, },
- { "thread already in state", RTEMS_ALREADY_SUSPENDED, },
- { "illegal on calling thread", RTEMS_ILLEGAL_ON_SELF, },
- { "illegal for remote object", RTEMS_ILLEGAL_ON_REMOTE_OBJECT, },
- { "called from wrong environment", RTEMS_CALLED_FROM_ISR, },
- { "invalid thread priority", RTEMS_INVALID_PRIORITY, },
- { "invalid date/time", RTEMS_INVALID_CLOCK, },
- { "invalid node id", RTEMS_INVALID_NODE, },
- { "directive not configured", RTEMS_NOT_CONFIGURED, },
- { "not owner of resource", RTEMS_NOT_OWNER_OF_RESOURCE , },
- { "directive not implemented", RTEMS_NOT_IMPLEMENTED, },
- { "RTEMS inconsistency detected", RTEMS_INTERNAL_ERROR, },
- { "could not get enough memory", RTEMS_NO_MEMORY, },
- { "internal multiprocessing only", THREAD_STATUS_PROXY_BLOCKING, },
- { 0, 0, 0 },
-};
-
-
-const char *
-rtems_status_text(
- rtems_status_code status
-)
-{
- return rtems_assoc_name_by_local(rtems_status_assoc, status);
-}
-
-
-static int rtems_verror(
- unsigned32 error_flag,
- const char *printf_format,
- va_list arglist
-)
-{
- int local_errno = 0;
- int chars_written = 0;
- rtems_status_code status;
-
- if (error_flag & RTEMS_ERROR_PANIC)
- {
- if (rtems_panic_in_progress++)
- _Thread_Disable_dispatch(); /* disable task switches */
-
- /* don't aggravate things */
- if (rtems_panic_in_progress > 2)
- return 0;
- }
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- status = error_flag & ~RTEMS_ERROR_MASK;
- if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
- local_errno = errno;
-
- if (_System_state_Is_multiprocessing)
- fprintf(stderr, "[%d] ", _Configuration_MP_table->node);
-
- if (rtems_progname && *rtems_progname)
- chars_written += fprintf(stderr, "%s: ", rtems_progname);
- chars_written += vfprintf(stderr, printf_format, arglist);
-
- if (status)
- chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status));
-
- if (local_errno)
- {
- if ((local_errno > 0) && *strerror(local_errno))
- chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
- else
- chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
- }
-
- chars_written += fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (RTEMS_ERROR_PANIC | RTEMS_ERROR_ABORT))
- {
- if (error_flag & RTEMS_ERROR_PANIC)
- {
- rtems_error(0, "fatal error, exiting");
- _exit(local_errno);
- }
- else
- {
- rtems_error(0, "fatal error, aborting");
- abort();
- }
- }
- return chars_written;
-}
-
-
-/*
- * Report an error.
- * error_flag is as above; printf_format is a normal
- * printf(3) format string, with its concommitant arguments.
- *
- * Returns the number of characters written.
- */
-
-int rtems_error(
- int error_flag,
- const char *printf_format,
- ...
- )
-{
- va_list arglist;
- int chars_written;
-
- va_start(arglist, printf_format);
- chars_written = rtems_verror(error_flag, printf_format, arglist);
- va_end(arglist);
-
- return chars_written;
-}
-
-/*
- * rtems_panic is shorthand for rtems_error(RTEMS_ERROR_PANIC, ...)
- */
-
-void rtems_panic(
- const char *printf_format,
- ...
- )
-{
- va_list arglist;
-
- va_start(arglist, printf_format);
- (void) rtems_verror(RTEMS_ERROR_PANIC, printf_format, arglist);
- va_end(arglist);
-}
diff --git a/c/src/libmisc/error/error.h b/c/src/libmisc/error/error.h
deleted file mode 100644
index a0698afb5d..0000000000
--- a/c/src/libmisc/error/error.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Defines and externs for rtems error reporting
- *
- * $Id$
- */
-
-#ifndef __RTEMS_ERROR_h
-#define __RTEMS_ERROR_h
-
-/*
- * rtems_error() and rtems_panic() support
- */
-
-#define RTEMS_ERROR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define RTEMS_ERROR_PANIC (RTEMS_ERROR_ERRNO / 2) /* err fatal; no return */
-#define RTEMS_ERROR_ABORT (RTEMS_ERROR_ERRNO / 4) /* err is fatal; panic */
-
-#define RTEMS_ERROR_MASK (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | \
- RTEMS_ERROR_PANIC) /* all */
-
-const char *rtems_status_text(rtems_status_code);
-int rtems_error(int error_code, const char *printf_format, ...);
-#ifdef __GNUC__
-void rtems_panic(const char *printf_format, ...);
-/*
- * We should be able to use this attribute but gcc complains that
- * rtems_panic does in fact return. :(
- *
- * __attribute__ ((__noreturn__));
- */
-#else
-void rtems_panic(const char *printf_format, ...);
-#endif
-
-extern int rtems_panic_in_progress;
-
-#endif
-/* end of include file */
diff --git a/c/src/libmisc/monitor/Makefile.in b/c/src/libmisc/monitor/Makefile.in
deleted file mode 100644
index 1ed5d13cb1..0000000000
--- a/c/src/libmisc/monitor/Makefile.in
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIB=${ARCH}/libmonitor-tmp.a
-# C source names, if any, go here -- minus the .c
-C_PIECES=mon-command mon-symbols mon-prmisc mon-monitor mon-object mon-server \
- mon-task mon-queue mon-driver mon-dname mon-itask \
- mon-extension mon-manager mon-config mon-mpci
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-INSTALLED_H_FILES=$(srcdir)/monitor.h $(srcdir)/symbols.h
-
-SRCS=README $(C_FILES) $(H_FILES) $(INSTALLED_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I$(srcdir)
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-.PHONY: preinstall
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${LIB}: ${SRCS} ${OBJS}
- $(make-library)
-
-all: preinstall ${ARCH} $(SRCS) $(LIB)
-
-preinstall: $(INSTALLED_H_FILES)
- $(INSTALL) -m 444 ${INSTALLED_H_FILES} $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/libmisc/monitor/README b/c/src/libmisc/monitor/README
deleted file mode 100644
index d5a73da140..0000000000
--- a/c/src/libmisc/monitor/README
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# $Id$
-#
-
-monitor task
-
-The monitor task is an optional task that knows about RTEMS
-data structures and can print out information about them.
-It is a work-in-progress and needs many more commands, but
-is useful now.
-
-The monitor works best when it is the highest priority task,
-so all your other tasks should ideally be at some priority
-greater than 1.
-
-To use the monitor:
--------------------
-
- #include <rtems/monitor.h>
-
- ...
-
- rtems_monitor_init(0);
-
- The parameter to rtems_monitor_init() tells the monitor whether
- to suspend itself on startup. A value of 0 causes the monitor
- to immediately enter command mode; a non-zero value causes the
- monitor to suspend itself after creation and wait for explicit
- wakeup.
-
-
- rtems_monitor_wakeup();
-
- wakes up a suspended monitor and causes it to reenter command mode.
-
-Monitor commands
-----------------
-
- The monitor prompt is 'rtems> '.
- Can abbreviate commands to "uniquity"
- There is a 'help' command. Here is the output from various
- help commands:
-
- Commands (may be abbreviated)
-
- help -- get this message or command specific help
- task -- show task information
- queue -- show message queue information
- symbol -- show entries from symbol table
- pause -- pause monitor for a specified number of ticks
- fatal -- invoke a fatal RTEMS error
-
- task [id [id ...] ]
- display information about the specified tasks.
- Default is to display information about all tasks on this node
-
- queue [id [id ... ] ]
- display information about the specified message queues
- Default is to display information about all queues on this node
-
- symbol [ symbolname [symbolname ... ] ]
- display value associated with specified symbol.
- Defaults to displaying all known symbols.
-
- pause [ticks]
- monitor goes to "sleep" for specified ticks (default is 1)
- monitor will resume at end of period or if explicitly awakened
-
- fatal [status]
- Invoke 'rtems_fatal_error_occurred' with 'status'
- (default is RTEMS_INTERNAL_ERROR)
-
- continue
- put the monitor to sleep waiting for an explicit wakeup from the
- program running.
-
-
-Sample output from 'task' command
----------------------------------
-
- rtems> task
- ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES
- ------------------------------------------------------------------------
- 00010001 UI1 2 READY P:T:nA NONE15: 0x40606348
- 00010002 RMON 1 READY nP NONE15: 0x40604110
-
- 'RMON' is the monitor itself, so we have 1 "user" task.
- Its modes are P:T:nA which translate to:
-
- preemptable
- timesliced
- no ASRS
-
- It has no events.
- It has a notepad value for notepad 15 which is 0x40606348
- (this is the libc thread state)
-
diff --git a/c/src/libmisc/monitor/mon-command.c b/c/src/libmisc/monitor/mon-command.c
deleted file mode 100644
index 1fe495e0ae..0000000000
--- a/c/src/libmisc/monitor/mon-command.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Command parsing routines for RTEMS monitor
- *
- * TODO:
- *
- * $Id$
- */
-
-#include <rtems.h>
-
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <string.h>
-
-/*
- * make_argv(cp): token-count
- * Break up the command line in 'cp' into global argv[] and argc (return
- * value).
- */
-
-int
-rtems_monitor_make_argv(
- char *cp,
- int *argc_p,
- char **argv)
-{
- int argc = 0;
-
- while ((cp = strtok(cp, " \t\n\r")))
- {
- argv[argc++] = cp;
- cp = (char *) NULL;
- }
- argv[argc] = (char *) NULL; /* end of argv */
-
- return *argc_p = argc;
-}
-
-
-/*
- * Read and break up a monitor command
- *
- * We have to loop on the gets call, since it will return NULL under UNIX
- * RTEMS when we get a signal (eg: SIGALRM).
- */
-
-int
-rtems_monitor_command_read(char *command,
- int *argc,
- char **argv)
-{
- extern rtems_configuration_table BSP_Configuration;
- static char monitor_prompt[32];
-
- /*
- * put node number in the prompt if we are multiprocessing
- */
-
- if (BSP_Configuration.User_multiprocessing_table == 0)
- sprintf(monitor_prompt, "%s", MONITOR_PROMPT);
- else if (rtems_monitor_default_node != rtems_monitor_node)
- sprintf(monitor_prompt, "%d-%s-%d", rtems_monitor_node, MONITOR_PROMPT, rtems_monitor_default_node);
- else
- sprintf(monitor_prompt, "%d-%s", rtems_monitor_node, MONITOR_PROMPT);
-
-#ifdef RTEMS_UNIX
- /* RTEMS on unix gets so many interrupt system calls this is hosed */
- printf("%s> ", monitor_prompt);
- fflush(stdout);
- while (gets(command) == (char *) 0)
- ;
-#else
- do
- {
- printf("%s> ", monitor_prompt);
- fflush(stdout);
- } while (gets(command) == (char *) 0);
-#endif
-
- return rtems_monitor_make_argv(command, argc, argv);
-}
-
-/*
- * Look up a command in a command table
- *
- */
-
-rtems_monitor_command_entry_t *
-rtems_monitor_command_lookup(
- rtems_monitor_command_entry_t *table,
- int argc,
- char **argv
-)
-{
- rtems_monitor_command_entry_t *p;
- rtems_monitor_command_entry_t *abbreviated_match = 0;
- int abbreviated_matches = 0;
- char *command;
- int command_length;
-
- command = argv[0];
-
- if ((table == 0) || (command == 0))
- goto failed;
-
- command_length = strlen(command);
-
- for (p = table; p->command; p++)
- if (STREQ(command, p->command)) /* exact match */
- goto done;
- else if (STRNEQ(command, p->command, command_length))
- {
- abbreviated_matches++;
- abbreviated_match = p;
- }
-
- /* no perfect match; is there a non-ambigous abbreviated match? */
- if ( ! abbreviated_match)
- {
- printf("Unrecognized command '%s'; try 'help'\n", command);
- goto failed;
- }
-
- if (abbreviated_matches > 1)
- {
- printf("Command '%s' is ambiguous; try 'help'\n", command);
- goto failed;
- }
-
- p = abbreviated_match;
-
-done:
- if (p->command_function == 0)
- goto failed;
- return p;
-
-failed:
- return 0;
-}
-
-void
-rtems_monitor_command_usage(rtems_monitor_command_entry_t *table,
- char *command_string)
-{
- rtems_monitor_command_entry_t *help = 0;
- char *help_command_argv[2];
-
- /* if first entry in table is a usage, then print it out */
- if (command_string == 0)
- {
- if (STREQ(table->command, "--usage--") && table->usage)
- help = table;
- }
- else
- {
- help_command_argv[0] = command_string;
- help_command_argv[1] = 0;
- help = rtems_monitor_command_lookup(table, 1, help_command_argv);
- }
-
- if (help)
- printf("%s\n", help->usage);
-}
-
-
-void
-rtems_monitor_help_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- int arg;
- rtems_monitor_command_entry_t *command;
-
- command = (rtems_monitor_command_entry_t *) command_arg;
-
- if (argc == 1)
- rtems_monitor_command_usage(command, 0);
- else
- {
- for (arg=1; argv[arg]; arg++)
- rtems_monitor_command_usage(command, argv[arg]);
- }
-}
diff --git a/c/src/libmisc/monitor/mon-config.c b/c/src/libmisc/monitor/mon-config.c
deleted file mode 100644
index 5efd480b14..0000000000
--- a/c/src/libmisc/monitor/mon-config.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * RTEMS Config display support
- *
- * TODO
- *
- * $Id$
- */
-
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-
-#define DATACOL 15
-#define CONTCOL DATACOL /* continued col */
-
-/*
- * Fill in entire monitor config table
- * for sending to a remote monitor or printing on the local system
- */
-
-void
-rtems_monitor_config_canonical(
- rtems_monitor_config_t *canonical_config,
- void *config_void
-)
-{
- rtems_configuration_table *c = (rtems_configuration_table *) config_void;
- rtems_api_configuration_table *r = c->RTEMS_api_configuration;
-
- canonical_config->work_space_start = c->work_space_start;
- canonical_config->work_space_size = c->work_space_size;
- canonical_config->maximum_tasks = r->maximum_tasks;
- canonical_config->maximum_timers = r->maximum_timers;
- canonical_config->maximum_semaphores = r->maximum_semaphores;
- canonical_config->maximum_message_queues = r->maximum_message_queues;
- canonical_config->maximum_partitions = r->maximum_partitions;
- canonical_config->maximum_regions = r->maximum_regions;
- canonical_config->maximum_ports = r->maximum_ports;
- canonical_config->maximum_periods = r->maximum_periods;
- canonical_config->maximum_extensions = c->maximum_extensions;
- canonical_config->microseconds_per_tick = c->microseconds_per_tick;
- canonical_config->ticks_per_timeslice = c->ticks_per_timeslice;
- canonical_config->number_of_initialization_tasks = r->number_of_initialization_tasks;
-}
-
-/*
- * This is easy, since there is only 1 (altho we could get them from
- * other nodes...)
- */
-
-void *
-rtems_monitor_config_next(
- void *object_info,
- rtems_monitor_config_t *canonical_config,
- rtems_id *next_id
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- int n = rtems_get_index(*next_id);
-
- if (n >= 1)
- goto failed;
-
- _Thread_Disable_dispatch();
-
- *next_id += 1;
- return (void *) c;
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-
-void
-rtems_monitor_config_dump_header(
- boolean verbose
-)
-{
- printf("\
-INITIAL (startup) Configuration Info\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-
-void
-rtems_monitor_config_dump(
- rtems_monitor_config_t *monitor_config,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length = 0;
- length += printf("WORKSPACE");
- length += rtems_monitor_pad(DATACOL, length);
- length += printf("start: 0x%x; size: 0x%x\n",
- (unsigned32) monitor_config->work_space_start,
- monitor_config->work_space_size);
-
- length = 0;
- length += printf("TIME");
- length += rtems_monitor_pad(DATACOL, length);
- length += printf("usec/tick: %d; tick/timeslice: %d; tick/sec: %d\n",
- monitor_config->microseconds_per_tick,
- monitor_config->ticks_per_timeslice,
- 1000000 / monitor_config->microseconds_per_tick);
-
- length = 0;
- length += printf("MAXIMUMS");
- length += rtems_monitor_pad(DATACOL, length);
- length += printf("tasks: %d; timers: %d; sems: %d; que's: %d; ext's: %d\n",
- monitor_config->maximum_tasks,
- monitor_config->maximum_timers,
- monitor_config->maximum_semaphores,
- monitor_config->maximum_message_queues,
- monitor_config->maximum_extensions);
- length = 0;
- length += rtems_monitor_pad(CONTCOL, length);
- length += printf("partitions: %d; regions: %d; ports: %d; periods: %d\n",
- monitor_config->maximum_partitions,
- monitor_config->maximum_regions,
- monitor_config->maximum_ports,
- monitor_config->maximum_periods);
-}
diff --git a/c/src/libmisc/monitor/mon-dname.c b/c/src/libmisc/monitor/mon-dname.c
deleted file mode 100644
index 45c28342ff..0000000000
--- a/c/src/libmisc/monitor/mon-dname.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * RTEMS monitor driver names support.
- *
- * There are 2 "driver" things the monitor knows about.
- *
- * 1. Regular RTEMS drivers.
- * This is a table indexed by major device number and
- * containing driver entry points only.
- *
- * 2. Driver name table.
- * A separate table of names for drivers.
- * The table converts driver names to a major number
- * as index into the driver table and a minor number
- * for an argument to driver.
- *
- * Drivers are displayed with 'driver' command.
- * Names are displayed with 'dname' command.
- *
- * $Id$
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-#include <string.h> /* strncpy() */
-
-#define DATACOL 15
-#define CONTCOL DATACOL /* continued col */
-
-void
-rtems_monitor_dname_canonical(
- rtems_monitor_dname_t *canonical_dname,
- void *dname_void
-)
-{
- rtems_driver_name_t *np = (rtems_driver_name_t *) dname_void;
-
- (void) strncpy(canonical_dname->name_string, np->device_name, sizeof(canonical_dname->name_string));
- canonical_dname->major = np->major;
- canonical_dname->minor = np->minor;
-}
-
-void *
-rtems_monitor_dname_next(
- void *object_information,
- rtems_monitor_dname_t *canonical_dname,
- rtems_id *next_id
-)
-{
- rtems_unsigned32 n = rtems_get_index(*next_id);
- rtems_driver_name_t *table = _IO_Driver_name_table;
- rtems_driver_name_t *np = 0;
-
-/* XXX should we be using _IO_Number_of_devices */
- for (np = table + n ; n<_IO_Number_of_devices; n++, np++)
- if (np->device_name)
- goto done;
-
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-
-done:
- _Thread_Disable_dispatch();
-
- /*
- * dummy up a fake id and name for this item
- */
-
- canonical_dname->id = n;
- canonical_dname->name = rtems_build_name('-', '-', '-', '-');
-
- *next_id += 1;
- return np;
-}
-
-void
-rtems_monitor_dname_dump_header(
- boolean verbose
-)
-{
- printf("\
- Major:Minor Name\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-void
-rtems_monitor_dname_dump(
- rtems_monitor_dname_t *monitor_dname,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += rtems_monitor_pad(6, length);
- length += rtems_monitor_dump_hex(monitor_dname->major);
- length += printf(":");
- length += rtems_monitor_dump_hex(monitor_dname->minor);
-
- length += rtems_monitor_pad(16, length);
- length += printf("%.*s",
- (int) sizeof(monitor_dname->name_string),
- (char *) monitor_dname->name_string);
-
- length += printf("\n");
- length = 0;
-}
diff --git a/c/src/libmisc/monitor/mon-driver.c b/c/src/libmisc/monitor/mon-driver.c
deleted file mode 100644
index c8eb36ab4e..0000000000
--- a/c/src/libmisc/monitor/mon-driver.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * RTEMS monitor IO (device drivers) support
- *
- * There are 2 "driver" things the monitor knows about.
- *
- * 1. Regular RTEMS drivers.
- * This is a table indexed by major device number and
- * containing driver entry points only.
- *
- * 2. Driver name table.
- * A separate table of names for drivers.
- * The table converts driver names to a major number
- * as index into the driver table and a minor number
- * for an argument to driver.
- *
- * Drivers are displayed with 'driver' command.
- * Names are displayed with 'name' command.
- *
- * $Id$
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-
-#define DATACOL 15
-#define CONTCOL DATACOL /* continued col */
-
-
-void
-rtems_monitor_driver_canonical(
- rtems_monitor_driver_t *canonical_driver,
- void *driver_void
-)
-{
- rtems_driver_address_table *d = (rtems_driver_address_table *) driver_void;
-
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->initialization,
- (void *) d->initialization);
-
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->open,
- (void *) d->open);
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->close,
- (void *) d->close);
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->read,
- (void *) d->read);
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->write,
- (void *) d->write);
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->control,
- (void *) d->control);
-}
-
-
-void *
-rtems_monitor_driver_next(
- void *object_info,
- rtems_monitor_driver_t *canonical_driver,
- rtems_id *next_id
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- rtems_unsigned32 n = rtems_get_index(*next_id);
-
- if (n >= c->number_of_device_drivers)
- goto failed;
-
- _Thread_Disable_dispatch();
-
- /*
- * dummy up a fake id and name for this item
- */
-
- canonical_driver->id = n;
- canonical_driver->name = rtems_build_name('-', '-', '-', '-');
-
- *next_id += 1;
- return (void *) (c->Device_driver_table + n);
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-
-void
-rtems_monitor_driver_dump_header(
- boolean verbose
-)
-{
- printf("\
- Major Entry points\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-void
-rtems_monitor_driver_dump(
- rtems_monitor_driver_t *monitor_driver,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += printf(" %d", monitor_driver->id);
-
- length += rtems_monitor_pad(13, length);
- length += printf("init: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->initialization, verbose);
- length += printf("; control: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->control, verbose);
- length += printf("\n");
- length = 0;
-
- length += rtems_monitor_pad(13, length);
-
- length += printf("open: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->open, verbose);
- length += printf("; close: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->close, verbose);
- length += printf("\n");
- length = 0;
-
- length += rtems_monitor_pad(13, length);
-
- length += printf("read: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->read, verbose);
- length += printf("; write: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->write, verbose);
- length += printf("\n");
- length = 0;
-}
diff --git a/c/src/libmisc/monitor/mon-extension.c b/c/src/libmisc/monitor/mon-extension.c
deleted file mode 100644
index 107fd5184e..0000000000
--- a/c/src/libmisc/monitor/mon-extension.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * RTEMS Monitor extension support
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-
-void
-rtems_monitor_extension_canonical(
- rtems_monitor_extension_t *canonical_extension,
- void *extension_void
-)
-{
- Extension_Control *rtems_extension = (Extension_Control *) extension_void;
- rtems_extensions_table *e = &rtems_extension->Extension.Callouts;
-
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_create,
- (void *) e->thread_create);
-
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_start,
- (void *) e->thread_start);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_restart,
- (void *) e->thread_restart);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_delete,
- (void *) e->thread_delete);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_tswitch,
- (void *) e->thread_switch);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_begin,
- (void *) e->thread_begin);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_exitted,
- (void *) e->thread_exitted);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_fatal,
- (void *) e->fatal);
-}
-
-void
-rtems_monitor_extension_dump_header(
- boolean verbose
-)
-{
- printf("\
- ID NAME\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
-
- rtems_monitor_separator();
-}
-
-
-/*
- * Dump out the canonical form
- */
-
-void
-rtems_monitor_extension_dump(
- rtems_monitor_extension_t *monitor_extension,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += rtems_monitor_dump_id(monitor_extension->id);
- length += rtems_monitor_pad(11, length);
- length += rtems_monitor_dump_name(monitor_extension->name);
-
- length += rtems_monitor_pad(18, length);
- length += printf("create: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_create, verbose);
- length += printf("; start: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_start, verbose);
- length += printf("; restart: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_restart, verbose);
- length += printf("\n");
- length = 0;
-
- length += rtems_monitor_pad(18, length);
- length += printf("delete: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_delete, verbose);
- length += printf("; switch: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_tswitch, verbose);
- length += printf("; begin: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_begin, verbose);
- length += printf("\n");
- length = 0;
-
- length += rtems_monitor_pad(18, length);
- length += printf("exitted: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_exitted, verbose);
- length += printf("; fatal: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_fatal, verbose);
- length += printf("\n");
- length = 0;
- printf("\n");
-}
diff --git a/c/src/libmisc/monitor/mon-itask.c b/c/src/libmisc/monitor/mon-itask.c
deleted file mode 100644
index 59a3a4f284..0000000000
--- a/c/src/libmisc/monitor/mon-itask.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * RTEMS Monitor init task support
- *
- * $Id$
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-
-/*
- * As above, but just for init tasks
- */
-void
-rtems_monitor_init_task_canonical(
- rtems_monitor_init_task_t *canonical_itask,
- void *itask_void
-)
-{
- rtems_initialization_tasks_table *rtems_itask = itask_void;
-
- rtems_monitor_symbol_canonical_by_value(&canonical_itask->entry,
- (void *) rtems_itask->entry_point);
-
- canonical_itask->argument = rtems_itask->argument;
- canonical_itask->stack_size = rtems_itask->stack_size;
- canonical_itask->priority = rtems_itask->initial_priority;
- canonical_itask->modes = rtems_itask->mode_set;
- canonical_itask->attributes = rtems_itask->attribute_set;
-}
-
-void *
-rtems_monitor_init_task_next(
- void *object_info,
- rtems_monitor_init_task_t *canonical_init_task,
- rtems_id *next_id
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- rtems_initialization_tasks_table *itask;
- rtems_unsigned32 n = rtems_get_index(*next_id);
-
- if (n >= c->RTEMS_api_configuration->number_of_initialization_tasks)
- goto failed;
-
- _Thread_Disable_dispatch();
-
- itask = c->RTEMS_api_configuration->User_initialization_tasks_table + n;
-
- /*
- * dummy up a fake id and name for this item
- */
-
- canonical_init_task->id = n;
- canonical_init_task->name = itask->name;
-
- *next_id += 1;
- return (void *) itask;
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-
-void
-rtems_monitor_init_task_dump_header(
- boolean verbose
-)
-{
- printf("\
- # NAME ENTRY ARGUMENT PRIO MODES ATTRIBUTES STACK SIZE\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-/*
- */
-
-void
-rtems_monitor_init_task_dump(
- rtems_monitor_init_task_t *monitor_itask,
- boolean verbose
-)
-{
- int length = 0;
-
- length += rtems_monitor_dump_decimal(monitor_itask->id);
-
- length += rtems_monitor_pad(7, length);
- length += rtems_monitor_dump_name(monitor_itask->name);
-
- length += rtems_monitor_pad(14, length);
- length += rtems_monitor_symbol_dump(&monitor_itask->entry, verbose);
-
- length += rtems_monitor_pad(25, length);
- length += printf("%d [0x%x]", monitor_itask->argument, monitor_itask->argument);
-
- length += rtems_monitor_pad(39, length);
- length += rtems_monitor_dump_priority(monitor_itask->priority);
-
- length += rtems_monitor_pad(46, length);
- length += rtems_monitor_dump_modes(monitor_itask->modes);
-
- length += rtems_monitor_pad(54, length);
- length += rtems_monitor_dump_attributes(monitor_itask->attributes);
-
- length += rtems_monitor_pad(66, length);
- length += printf("%d [0x%x]", monitor_itask->stack_size, monitor_itask->stack_size);
-
- printf("\n");
-}
diff --git a/c/src/libmisc/monitor/mon-manager.c b/c/src/libmisc/monitor/mon-manager.c
deleted file mode 100644
index 497f0255a0..0000000000
--- a/c/src/libmisc/monitor/mon-manager.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * RTEMS Monitor "manager" support.
- * Used to traverse object (chain) lists and print them out.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-
-/*
- * "next" routine for all objects that are RTEMS manager objects
- */
-
-void *
-rtems_monitor_manager_next(
- void *table_void,
- void *canonical,
- rtems_id *next_id
-)
-{
- Objects_Information *table = table_void;
- rtems_monitor_generic_t *copy;
- Objects_Control *object = 0;
- Objects_Locations location;
-
- /*
- * When we are called, it must be local
- */
-
- if ( ! _Objects_Is_local_id(*next_id))
- goto done;
-
- object = _Objects_Get_next(table, *next_id, &location, next_id);
-
- if (object)
- {
- copy = (rtems_monitor_generic_t *) canonical;
- copy->id = object->id;
- _Objects_Copy_name_raw(object->name, &copy->name, sizeof(copy->name));
- }
-
-done:
- return object;
-}
-
diff --git a/c/src/libmisc/monitor/mon-monitor.c b/c/src/libmisc/monitor/mon-monitor.c
deleted file mode 100644
index 289425d8e4..0000000000
--- a/c/src/libmisc/monitor/mon-monitor.c
+++ /dev/null
@@ -1,518 +0,0 @@
-/*
- * RTEMS monitor main body
- *
- * TODO:
- * add stuff to RTEMS api
- * rtems_get_name(id)
- * rtems_get_type(id)
- * rtems_build_id(node, type, num)
- * Add a command to dump out info about an arbitrary id when
- * types are added to id's
- * rtems> id idnum
- * idnum: node n, object: whatever, id: whatever
- * allow id's to be specified as n:t:id, where 'n:t' is optional
- * should have a separate monitor FILE stream (ala the debugger)
- * remote request/response stuff should be cleaned up
- * maybe we can use real rpc??
- * 'info' command to print out:
- * interrupt stack location, direction and size
- * floating point config stuff
- * interrupt config stuff
- *
- * $Id$
- */
-
-#include <rtems.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <rtems/monitor.h>
-
-/* set by trap handler */
-extern rtems_tcb *debugger_interrupted_task;
-extern rtems_context *debugger_interrupted_task_context;
-extern rtems_unsigned32 debugger_trap;
-
-/*
- * Various id's for the monitor
- * They need to be public variables for access by other agencies
- * such as debugger and remote servers'
- */
-
-rtems_id rtems_monitor_task_id;
-
-unsigned32 rtems_monitor_node; /* our node number */
-unsigned32 rtems_monitor_default_node; /* current default for commands */
-
-/*
- * The rtems symbol table
- */
-
-rtems_symbol_table_t *rtems_monitor_symbols;
-
-/*
- * The top-level commands
- */
-
-rtems_monitor_command_entry_t rtems_monitor_commands[] = {
- { "--usage--",
- "\n"
- "RTEMS monitor\n"
- "\n"
- "Commands (may be abbreviated)\n"
- "\n"
- " help -- get this message or command specific help\n"
- " pause -- pause monitor for a specified number of ticks\n"
- " exit -- invoke a fatal RTEMS error\n"
- " symbol -- show entries from symbol table\n"
- " continue -- put monitor to sleep waiting for explicit wakeup\n"
- " config -- show system configuration\n"
- " itask -- list init tasks\n"
- " mpci -- list mpci config\n"
- " task -- show task information\n"
- " queue -- show message queue information\n"
- " extension -- user extensions\n"
- " driver -- show information about named drivers\n"
- " dname -- show information about named drivers\n"
- " object -- generic object information\n"
- " node -- specify default node for commands that take id's\n"
-#ifdef CPU_INVOKE_DEBUGGER
- " debugger -- invoke system debugger\n"
-#endif
- ,
- 0,
- 0,
- (unsigned32) rtems_monitor_commands,
- },
- { "config",
- "config\n"
- " Show the system configuration.\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_CONFIG,
- },
- { "itask",
- "itask\n"
- " List init tasks for the system\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_INIT_TASK,
- },
- { "mpci",
- "mpci\n"
- " Show the MPCI system configuration, if configured.\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_MPCI,
- },
- { "pause",
- "pause [ticks]\n"
- " monitor goes to \"sleep\" for specified ticks (default is 1)\n"
- " monitor will resume at end of period or if explicitly awakened\n",
- 0,
- rtems_monitor_pause_cmd,
- 0,
- },
- { "continue",
- "continue\n"
- " put the monitor to sleep waiting for an explicit wakeup from the\n"
- " program running.\n",
- 0,
- rtems_monitor_continue_cmd,
- 0,
- },
- { "go",
- "go\n"
- " Alias for 'continue'\n",
- 0,
- rtems_monitor_continue_cmd,
- 0,
- },
- { "node",
- "node [ node number ]\n"
- " Specify default node number for commands that take id's\n",
- 0,
- rtems_monitor_node_cmd,
- 0,
- },
- { "symbol",
- "symbol [ symbolname [symbolname ... ] ]\n"
- " display value associated with specified symbol.\n"
- " Defaults to displaying all known symbols.\n",
- 0,
- rtems_monitor_symbol_cmd,
- (unsigned32) &rtems_monitor_symbols,
- },
- { "extension",
- "extension [id [id ...] ]\n"
- " display information about specified extensions.\n"
- " Default is to display information about all extensions on this node\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_EXTENSION,
- },
- { "task",
- "task [id [id ...] ]\n"
- " display information about the specified tasks.\n"
- " Default is to display information about all tasks on this node\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_TASK,
- },
- { "queue",
- "queue [id [id ... ] ]\n"
- " display information about the specified message queues\n"
- " Default is to display information about all queues on this node\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_QUEUE,
- },
- { "object",
- "object [id [id ...] ]\n"
- " display information about specified RTEMS objects.\n"
- " Object id's must include 'type' information.\n"
- " (which may normally be defaulted)\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_INVALID,
- },
- { "driver",
- "driver [ major [ major ... ] ]\n"
- " Display the RTEMS device driver table.\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_DRIVER,
- },
- { "dname",
- "dname\n"
- " Displays information about named drivers.\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_DNAME,
- },
- { "exit",
- "exit [status]\n"
- " Invoke 'rtems_fatal_error_occurred' with 'status'\n"
- " (default is RTEMS_SUCCESSFUL)\n",
- 0,
- rtems_monitor_fatal_cmd,
- RTEMS_SUCCESSFUL,
- },
- { "fatal",
- "fatal [status]\n"
- " 'exit' with fatal error; default error is RTEMS_TASK_EXITTED\n",
- 0,
- rtems_monitor_fatal_cmd,
- RTEMS_TASK_EXITTED, /* exit value */
- },
- { "quit",
- "quit [status]\n"
- " Alias for 'exit'\n",
- 0,
- rtems_monitor_fatal_cmd,
- RTEMS_SUCCESSFUL, /* exit value */
- },
- { "help",
- "help [ command [ command ] ]\n"
- " provide information about commands\n"
- " Default is show basic command summary.\n",
- 0,
- rtems_monitor_help_cmd,
- (unsigned32) rtems_monitor_commands,
- },
-#ifdef CPU_INVOKE_DEBUGGER
- { "debugger",
- "debugger\n"
- " Enter the debugger, if possible.\n"
- " A continue from the debugger will return to the monitor.\n",
- 0,
- rtems_monitor_debugger_cmd,
- 0,
- },
-#endif
- { 0, 0, 0, 0, 0 },
-};
-
-
-rtems_status_code
-rtems_monitor_suspend(rtems_interval timeout)
-{
- rtems_event_set event_set;
- rtems_status_code status;
-
- status = rtems_event_receive(MONITOR_WAKEUP_EVENT,
- RTEMS_DEFAULT_OPTIONS,
- timeout,
- &event_set);
- return status;
-}
-
-void
-rtems_monitor_wakeup(void)
-{
- rtems_status_code status;
-
- status = rtems_event_send(rtems_monitor_task_id, MONITOR_WAKEUP_EVENT);
-}
-
-void
-rtems_monitor_debugger_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
-#ifdef CPU_INVOKE_DEBUGGER
- CPU_INVOKE_DEBUGGER;
-#endif
-}
-
-void
-rtems_monitor_pause_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- if (argc == 1)
- rtems_monitor_suspend(1);
- else
- rtems_monitor_suspend(strtoul(argv[1], 0, 0));
-}
-
-void
-rtems_monitor_fatal_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- if (argc == 1)
- rtems_fatal_error_occurred(command_arg);
- else
- rtems_fatal_error_occurred(strtoul(argv[1], 0, 0));
-}
-
-void
-rtems_monitor_continue_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- rtems_monitor_suspend(RTEMS_NO_TIMEOUT);
-}
-
-void
-rtems_monitor_node_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- unsigned32 new_node = rtems_monitor_default_node;
-
- switch (argc)
- {
- case 1: /* no node, just set back to ours */
- new_node = rtems_monitor_node;
- break;
-
- case 2:
- new_node = strtoul(argv[1], 0, 0);
- break;
-
- default:
- printf("invalid syntax, try 'help node'\n");
- break;
- }
-
- if ((new_node >= 1) &&
- _Configuration_MP_table &&
- (new_node <= _Configuration_MP_table->maximum_nodes))
- rtems_monitor_default_node = new_node;
-}
-
-
-/*
- * Function: rtems_monitor_symbols_loadup
- *
- * Description:
- * Create and load the monitor's symbol table.
- * We are reading the output format of 'gnm' which looks like this:
- *
- * 400a7068 ? _Rate_monotonic_Information
- * 400a708c ? _Thread_Dispatch_disable_level
- * 400a7090 ? _Configuration_Table
- *
- * We ignore the type field.
- *
- * Side Effects:
- * Creates and fills in 'rtems_monitor_symbols' table
- *
- * TODO
- * there should be a BSP #define or something like that
- * to do this; Assuming stdio is crazy.
- * Someday this should know BFD
- * Maybe we could get objcopy to just copy the symbol areas
- * and copy that down.
- *
- */
-
-void
-rtems_monitor_symbols_loadup(void)
-{
- FILE *fp;
- char buffer[128];
-
- if (rtems_monitor_symbols)
- rtems_symbol_table_destroy(rtems_monitor_symbols);
-
- rtems_monitor_symbols = rtems_symbol_table_create(10);
- if (rtems_monitor_symbols == 0)
- return;
-
- fp = fopen("symbols", "r");
-
- if (fp == 0)
- return;
-
- while (fgets(buffer, sizeof(buffer) - 1, fp))
- {
- char *symbol;
- char *value;
- char *ignored_type;
-
- value = strtok(buffer, " \t\n");
- ignored_type = strtok(0, " \t\n");
- symbol = strtok(0, " \t\n");
-
- if (symbol && ignored_type && value)
- {
- rtems_symbol_t *sp;
- sp = rtems_symbol_create(rtems_monitor_symbols,
- symbol,
- (rtems_unsigned32) strtoul(value, 0, 16));
- if (sp == 0)
- {
- printf("could not define symbol '%s'\n", symbol);
- goto done;
- }
- }
- else
- {
- printf("parsing error on '%s'\n", buffer);
- goto done;
- }
- }
-
-done:
- return;
-}
-
-
-/*
- * Main monitor command loop
- */
-
-void
-rtems_monitor_task(
- rtems_task_argument monitor_flags
-)
-{
- rtems_tcb *debugee = 0;
- rtems_context *rp;
- rtems_context_fp *fp;
- char command_buffer[513];
- int argc;
- char *argv[64];
- boolean verbose = FALSE;
-
- if (monitor_flags & RTEMS_MONITOR_SUSPEND)
- (void) rtems_monitor_suspend(RTEMS_NO_TIMEOUT);
-
- for (;;)
- {
- extern rtems_tcb * _Thread_Executing;
- rtems_monitor_command_entry_t *command;
-
- debugee = _Thread_Executing;
- rp = &debugee->Registers;
- fp = (rtems_context_fp *) debugee->fp_context; /* possibly 0 */
-
- if (0 == rtems_monitor_command_read(command_buffer, &argc, argv))
- continue;
- if ((command = rtems_monitor_command_lookup(rtems_monitor_commands,
- argc,
- argv)) == 0)
- continue;
-
- command->command_function(argc, argv, command->command_arg, verbose);
-
- fflush(stdout);
- }
-}
-
-
-void
-rtems_monitor_kill(void)
-{
- if (rtems_monitor_task_id)
- rtems_task_delete(rtems_monitor_task_id);
- rtems_monitor_task_id = 0;
-
- rtems_monitor_server_kill();
-}
-
-void
-rtems_monitor_init(
- unsigned32 monitor_flags
-)
-{
- rtems_status_code status;
-
- rtems_monitor_kill();
-
- status = rtems_task_create(RTEMS_MONITOR_NAME,
- 1,
- RTEMS_MINIMUM_STACK_SIZE * 2,
- RTEMS_INTERRUPT_LEVEL(0),
- RTEMS_DEFAULT_ATTRIBUTES,
- &rtems_monitor_task_id);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not create monitor task");
- goto done;
- }
-
- rtems_monitor_node = rtems_get_node(rtems_monitor_task_id);
- rtems_monitor_default_node = rtems_monitor_node;
-
- rtems_monitor_symbols_loadup();
-
- if (monitor_flags & RTEMS_MONITOR_GLOBAL)
- rtems_monitor_server_init(monitor_flags);
-
- /*
- * Start the monitor task itself
- */
-
- status = rtems_task_start(rtems_monitor_task_id,
- rtems_monitor_task,
- monitor_flags);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not start monitor");
- goto done;
- }
-
-done:
-}
diff --git a/c/src/libmisc/monitor/mon-mpci.c b/c/src/libmisc/monitor/mon-mpci.c
deleted file mode 100644
index 5399f37555..0000000000
--- a/c/src/libmisc/monitor/mon-mpci.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * RTEMS MPCI Config display support
- *
- * TODO
- *
- * $Id$
- */
-
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-
-#define DATACOL 15
-
-/*
- * Fill in entire monitor config table
- * for sending to a remote monitor or printing on the local system
- */
-
-void
-rtems_monitor_mpci_canonical(
- rtems_monitor_mpci_t *canonical_mpci,
- void *config_void
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- rtems_multiprocessing_table *m;
- rtems_mpci_table *mt;
-
- m = c->User_multiprocessing_table;
- if (m == 0)
- return;
- mt = m->User_mpci_table;
-
- canonical_mpci->node = m->node;
- canonical_mpci->maximum_nodes = m->maximum_nodes;
- canonical_mpci->maximum_global_objects = m->maximum_global_objects;
- canonical_mpci->maximum_proxies = m->maximum_proxies;
-
- canonical_mpci->default_timeout = mt->default_timeout;
- canonical_mpci->maximum_packet_size = mt->maximum_packet_size;
-
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->initialization,
- (void *) mt->initialization);
-
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->get_packet,
- (void *) mt->get_packet);
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->return_packet,
- (void *) mt->return_packet);
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->send_packet,
- (void *) mt->send_packet);
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->receive_packet,
- (void *) mt->receive_packet);
-}
-
-/*
- * This is easy, since there is only 1 (altho we could get them from
- * other nodes...)
- */
-
-void *
-rtems_monitor_mpci_next(
- void *object_info,
- rtems_monitor_mpci_t *canonical_mpci,
- rtems_id *next_id
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- int n = rtems_get_index(*next_id);
-
- if (n >= 1)
- goto failed;
-
- if ( ! c->User_multiprocessing_table)
- goto failed;
-
- _Thread_Disable_dispatch();
-
- *next_id += 1;
- return (void *) c;
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-
-void
-rtems_monitor_mpci_dump_header(
- boolean verbose
-)
-{
- printf("\
- max max max default max\n\
- node nodes globals proxies timeout pktsize\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
-
- rtems_monitor_separator();
-}
-
-
-void
-rtems_monitor_mpci_dump(
- rtems_monitor_mpci_t *monitor_mpci,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += rtems_monitor_pad(2, length);
- length += printf(" %d", monitor_mpci->node);
- length += rtems_monitor_pad(11, length);
- length += printf("%d", monitor_mpci->maximum_nodes);
-
- length += rtems_monitor_pad(18, length);
- length += rtems_monitor_dump_decimal(monitor_mpci->maximum_global_objects);
-
- length += rtems_monitor_pad(28, length);
- length += rtems_monitor_dump_decimal(monitor_mpci->maximum_proxies);
-
- length += rtems_monitor_pad(37, length);
- length += rtems_monitor_dump_decimal(monitor_mpci->default_timeout);
-
- length += rtems_monitor_pad(46, length);
- length += rtems_monitor_dump_decimal(monitor_mpci->maximum_packet_size);
-
- printf("\n");
- length = 0;
- length += rtems_monitor_pad(DATACOL, length);
-
- length += printf("init: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->initialization, verbose);
-
- printf("\n");
- length = 0;
- length += rtems_monitor_pad(DATACOL, length);
-
- length += printf("get: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->get_packet, verbose);
- length += printf("; return: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->return_packet, verbose);
-
- printf("\n");
- length = 0;
- length += rtems_monitor_pad(DATACOL, length);
-
- length += printf("send: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->send_packet, verbose);
- length += printf("; receive: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->receive_packet, verbose);
-
- printf("\n");
- length = 0;
-}
diff --git a/c/src/libmisc/monitor/mon-object.c b/c/src/libmisc/monitor/mon-object.c
deleted file mode 100644
index 8d5a9c395f..0000000000
--- a/c/src/libmisc/monitor/mon-object.c
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * RTEMS Monitor "object" support.
- *
- * Used to traverse object lists and print them out.
- * An object can be an RTEMS object (chain based stuff) or
- * a "misc" object such as a device driver.
- *
- * Each object has its own file in this directory (eg: extension.c)
- * That file provides routines to convert a "native" structure
- * to its canonical form, print a canonical structure, etc.
- *
- * TODO:
- * should allow for non-numeric id's???
- *
- * $Id$
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-#include <string.h> /* memcpy() */
-
-#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
-
-/*
- * add:
- * next
- */
-
-rtems_monitor_object_info_t rtems_monitor_object_info[] =
-{
- { RTEMS_MONITOR_OBJECT_CONFIG,
- (void *) 0,
- sizeof(rtems_monitor_config_t),
- (rtems_monitor_object_next_fn) rtems_monitor_config_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_config_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_config_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_config_dump,
- },
- { RTEMS_MONITOR_OBJECT_MPCI,
- (void *) 0,
- sizeof(rtems_monitor_mpci_t),
- (rtems_monitor_object_next_fn) rtems_monitor_mpci_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_mpci_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_mpci_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_mpci_dump,
- },
- { RTEMS_MONITOR_OBJECT_INIT_TASK,
- (void *) 0,
- sizeof(rtems_monitor_init_task_t),
- (rtems_monitor_object_next_fn) rtems_monitor_init_task_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_init_task_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_init_task_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_init_task_dump,
- },
- { RTEMS_MONITOR_OBJECT_TASK,
- (void *) &_RTEMS_tasks_Information,
- sizeof(rtems_monitor_task_t),
- (rtems_monitor_object_next_fn) rtems_monitor_manager_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_task_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_task_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_task_dump,
- },
- { RTEMS_MONITOR_OBJECT_QUEUE,
- (void *) &_Message_queue_Information,
- sizeof(rtems_monitor_queue_t),
- (rtems_monitor_object_next_fn) rtems_monitor_manager_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_queue_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_queue_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_queue_dump,
- },
- { RTEMS_MONITOR_OBJECT_EXTENSION,
- (void *) &_Extension_Information,
- sizeof(rtems_monitor_extension_t),
- (rtems_monitor_object_next_fn) rtems_monitor_manager_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_extension_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_extension_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_extension_dump,
- },
- { RTEMS_MONITOR_OBJECT_DRIVER,
- (void *) 0,
- sizeof(rtems_monitor_driver_t),
- (rtems_monitor_object_next_fn) rtems_monitor_driver_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_driver_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_driver_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_driver_dump,
- },
- { RTEMS_MONITOR_OBJECT_DNAME,
- /* XXX now that the driver name table is allocated from the */
- /* XXX Workspace, this does not work */
- (void *) 0,
- /* (void *) _IO_Driver_name_table, */
- sizeof(rtems_monitor_dname_t),
- (rtems_monitor_object_next_fn) rtems_monitor_dname_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_dname_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_dname_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_dname_dump,
- },
-};
-
-/*
- * Allow id's to be specified without the node number or
- * type for convenience.
- */
-
-rtems_id
-rtems_monitor_id_fixup(
- rtems_id id,
- unsigned32 default_node,
- rtems_monitor_object_type_t type
-)
-{
- unsigned32 node;
-
- node = rtems_get_node(id);
- if (node == 0)
- {
- if (rtems_get_class(id) != OBJECTS_NO_CLASS)
- type = rtems_get_class(id);
-
- id = _Objects_Build_id(type, default_node, rtems_get_index(id));
- }
- return id;
-}
-
-
-rtems_monitor_object_info_t *
-rtems_monitor_object_lookup(
- rtems_monitor_object_type_t type
-)
-{
- rtems_monitor_object_info_t *p;
- for (p = &rtems_monitor_object_info[0];
- p < &rtems_monitor_object_info[NUMELEMS(rtems_monitor_object_info)];
- p++)
- {
- if (p->type == type)
- return p;
- }
- return 0;
-}
-
-rtems_id
-rtems_monitor_object_canonical_next_remote(
- rtems_monitor_object_type_t type,
- rtems_id id,
- void *canonical
-)
-{
- rtems_id next_id;
- rtems_status_code status;
- rtems_monitor_server_request_t request;
- rtems_monitor_server_response_t response;
-
- /*
- * Send request
- */
-
- request.command = RTEMS_MONITOR_SERVER_CANONICAL;
- request.argument0 = (unsigned32) type;
- request.argument1 = (unsigned32) id;
-
- status = rtems_monitor_server_request(rtems_get_node(id), &request, &response);
- if (status != RTEMS_SUCCESSFUL)
- goto failed;
-
- /*
- * process response
- */
-
- next_id = (rtems_id) response.result0;
- if (next_id != RTEMS_OBJECT_ID_FINAL)
- (void) memcpy(canonical, &response.payload, response.result1);
-
- return next_id;
-
-failed:
- return RTEMS_OBJECT_ID_FINAL;
-
-}
-
-
-rtems_id
-rtems_monitor_object_canonical_next(
- rtems_monitor_object_info_t *info,
- rtems_id id,
- void *canonical
-)
-{
- rtems_id next_id;
- void *raw_item;
-
- if ( ! _Objects_Is_local_id(id))
- next_id = rtems_monitor_object_canonical_next_remote(info->type,
- id,
- canonical);
- else
- {
- next_id = id;
-
- raw_item = (void *) info->next(info->object_information,
- canonical,
- &next_id);
-
- if (raw_item)
- {
- info->canonical(canonical, raw_item);
- _Thread_Enable_dispatch();
- }
- }
- return next_id;
-}
-
-
-/*
- * this is routine server invokes locally to get the type
- */
-
-rtems_id
-rtems_monitor_object_canonical_get(
- rtems_monitor_object_type_t type,
- rtems_id id,
- void *canonical,
- unsigned32 *size_p
-)
-{
- rtems_monitor_object_info_t *info;
- rtems_id next_id;
-
- *size_p = 0;
-
- info = rtems_monitor_object_lookup(type);
-
- if (info == 0)
- return RTEMS_OBJECT_ID_FINAL;
-
- next_id = rtems_monitor_object_canonical_next(info, id, canonical);
- *size_p = info->size;
-
- return next_id;
-}
-
-
-void
-rtems_monitor_object_dump_1(
- rtems_monitor_object_info_t *info,
- rtems_id id,
- boolean verbose
-)
-{
- rtems_id next_id;
- rtems_monitor_union_t canonical;
-
- if ((next_id = rtems_monitor_object_canonical_next(
- info,
- id,
- &canonical)) != RTEMS_OBJECT_ID_FINAL)
- {
- /*
- * If the one we actually got is the one we wanted, then
- * print it out.
- * For ones that have an id field, this works fine,
- * for all others, always dump it out.
- *
- * HACK: the way we determine whether there is an id is a hack.
- *
- * by the way: the reason we try to not have an id, is that some
- * of the canonical structures are almost too big for shared
- * memory driver (eg: mpci)
- */
-
- if ((info->next != rtems_monitor_manager_next) ||
- (id == canonical.generic.id))
- info->dump(&canonical, verbose);
- }
-}
-
-void
-rtems_monitor_object_dump_all(
- rtems_monitor_object_info_t *info,
- boolean verbose
-)
-{
- rtems_id next_id;
- rtems_monitor_union_t canonical;
-
- next_id = RTEMS_OBJECT_ID_INITIAL(info->type, rtems_monitor_default_node);
-
- while ((next_id = rtems_monitor_object_canonical_next(
- info,
- next_id,
- &canonical)) != RTEMS_OBJECT_ID_FINAL)
- {
- info->dump(&canonical, verbose);
- }
-}
-
-void
-rtems_monitor_object_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- int arg;
- rtems_monitor_object_info_t *info = 0;
- rtems_monitor_object_type_t type = (rtems_monitor_object_type_t) command_arg;
-
- /* what is the default type? */
- type = (rtems_monitor_object_type_t) command_arg;
-
- if (argc == 1)
- {
- if (type == RTEMS_MONITOR_OBJECT_INVALID)
- {
- printf("A type must be specified to \"dump all\"\n");
- goto done;
- }
-
- info = rtems_monitor_object_lookup(type);
- if (info == 0)
- goto not_found;
-
- if (info->dump_header)
- info->dump_header(verbose);
- rtems_monitor_object_dump_all(info, verbose);
- }
- else
- {
- unsigned32 default_node = rtems_monitor_default_node;
- rtems_monitor_object_type_t last_type = RTEMS_MONITOR_OBJECT_INVALID;
- rtems_id id;
-
- for (arg=1; argv[arg]; arg++)
- {
- id = (rtems_id) strtoul(argv[arg], 0, 16);
- id = rtems_monitor_id_fixup(id, default_node, type);
- type = (rtems_monitor_object_type_t) rtems_get_class(id);
-
- /*
- * Allow the item type to change in the middle
- * of the command. If the type changes, then
- * just dump out a new header and keep on going.
- */
- if (type != last_type)
- {
- info = rtems_monitor_object_lookup(type);
- if (info == 0)
- goto not_found;
-
- if (info->dump_header)
- info->dump_header(verbose);
- }
-
- if (info == 0)
- {
-not_found: printf("Invalid or unsupported type %d\n", type);
- goto done;
- }
-
- rtems_monitor_object_dump_1(info, id, verbose);
-
- default_node = rtems_get_node(id);
-
- last_type = type;
- }
- }
-done:
- return;
-}
diff --git a/c/src/libmisc/monitor/mon-prmisc.c b/c/src/libmisc/monitor/mon-prmisc.c
deleted file mode 100644
index ce9aa9a554..0000000000
--- a/c/src/libmisc/monitor/mon-prmisc.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Print misc stuff for the monitor dump routines
- * Each routine returns the number of characters it output.
- *
- * TODO:
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <rtems/assoc.h>
-
-#include <stdio.h>
-#include <ctype.h>
-
-void
-rtems_monitor_separator(void)
-{
- printf("------------------------------------------------------------------------------\n");
-}
-
-unsigned32
-rtems_monitor_pad(
- unsigned32 destination_column,
- unsigned32 current_column
-)
-{
- int pad_length;
-
- if (destination_column <= current_column)
- pad_length = 1;
- else
- pad_length = destination_column - current_column;
-
- return printf("%*s", pad_length, "");
-}
-
-unsigned32
-rtems_monitor_dump_char(rtems_unsigned8 ch)
-{
- if (isprint(ch))
- return printf("%c", ch);
- else
- return printf("%02x", ch);
-}
-
-unsigned32
-rtems_monitor_dump_decimal(unsigned32 num)
-{
- return printf("%4d", num);
-}
-
-unsigned32
-rtems_monitor_dump_hex(unsigned32 num)
-{
- return printf("0x%x", num);
-}
-
-unsigned32
-rtems_monitor_dump_assoc_bitfield(
- rtems_assoc_t *ap,
- char *separator,
- unsigned32 value
- )
-{
- unsigned32 b;
- unsigned32 length = 0;
- const char *name;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (length)
- length += printf("%s", separator);
-
- name = rtems_assoc_name_by_local(ap, b);
-
- if (name)
- length += printf("%s", name);
- else
- length += printf("0x%x", b);
- }
-
- return length;
-}
-
-unsigned32
-rtems_monitor_dump_id(rtems_id id)
-{
- return printf("%08x", id);
-}
-
-unsigned32
-rtems_monitor_dump_name(rtems_name name)
-{
- unsigned32 i;
- unsigned32 length = 0;
- union {
- unsigned32 ui;
- char c[4];
- } u;
-
- u.ui = (rtems_unsigned32) name;
-
-#if (CPU_BIG_ENDIAN == TRUE)
- for (i=0; i<sizeof(u.c); i++)
- length += rtems_monitor_dump_char(u.c[i]);
-#else
- for (i=sizeof(u.c)-1; i ; i--)
- length += rtems_monitor_dump_char(u.c[i]);
-#endif
- return length;
-}
-
-unsigned32
-rtems_monitor_dump_priority(rtems_task_priority priority)
-{
- return printf("%3d", priority);
-}
-
-
-rtems_assoc_t rtems_monitor_state_assoc[] = {
- { "DORM", STATES_DORMANT },
- { "SUSP", STATES_SUSPENDED },
- { "TRANS", STATES_TRANSIENT },
- { "DELAY", STATES_DELAYING },
- { "Wbuf", STATES_WAITING_FOR_BUFFER },
- { "Wseg", STATES_WAITING_FOR_SEGMENT },
- { "Wmsg" , STATES_WAITING_FOR_MESSAGE },
- { "Wevnt", STATES_WAITING_FOR_EVENT },
- { "Wsem", STATES_WAITING_FOR_SEMAPHORE },
- { "Wtime", STATES_WAITING_FOR_TIME },
- { "Wrpc", STATES_WAITING_FOR_RPC_REPLY },
- { "WRATE", STATES_WAITING_FOR_PERIOD },
- { 0, 0, 0 },
-};
-
-unsigned32
-rtems_monitor_dump_state(States_Control state)
-{
- unsigned32 length = 0;
-
- if (state == STATES_READY) /* assoc doesn't deal with this as it is 0 */
- length += printf("READY");
-
- length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_state_assoc,
- ":",
- state);
- return length;
-}
-
-rtems_assoc_t rtems_monitor_attribute_assoc[] = {
- { "FL", RTEMS_FLOATING_POINT },
- { "GL", RTEMS_GLOBAL },
- { "PR", RTEMS_PRIORITY },
- { "BI", RTEMS_BINARY_SEMAPHORE },
- { "IN", RTEMS_INHERIT_PRIORITY },
- { 0, 0, 0 },
-};
-
-unsigned32
-rtems_monitor_dump_attributes(rtems_attribute attributes)
-{
- unsigned32 length = 0;
-
- if (attributes == RTEMS_DEFAULT_ATTRIBUTES) /* value is 0 */
- length += printf("DEFAULT");
-
- length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_attribute_assoc,
- ":",
- attributes);
- return length;
-}
-
-rtems_assoc_t rtems_monitor_modes_assoc[] = {
- { "nP", RTEMS_NO_PREEMPT },
- { "T", RTEMS_TIMESLICE },
- { "nA", RTEMS_NO_ASR },
- { 0, 0, 0 },
-};
-
-unsigned32
-rtems_monitor_dump_modes(rtems_mode modes)
-{
- unsigned32 length = 0;
-
- if (modes == RTEMS_DEFAULT_MODES) /* value is 0 */
- length += printf("P:T:nA");
-
- length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_modes_assoc,
- ":",
- modes);
- return length;
-}
-
-rtems_assoc_t rtems_monitor_events_assoc[] = {
- { "0", RTEMS_EVENT_0 },
- { "1", RTEMS_EVENT_1 },
- { "2", RTEMS_EVENT_2 },
- { "3", RTEMS_EVENT_3 },
- { "4", RTEMS_EVENT_4 },
- { "5", RTEMS_EVENT_5 },
- { "6", RTEMS_EVENT_6 },
- { "7", RTEMS_EVENT_7 },
- { "8", RTEMS_EVENT_8 },
- { "9", RTEMS_EVENT_9 },
- { "10", RTEMS_EVENT_10 },
- { "11", RTEMS_EVENT_11 },
- { "12", RTEMS_EVENT_12 },
- { "13", RTEMS_EVENT_13 },
- { "14", RTEMS_EVENT_14 },
- { "15", RTEMS_EVENT_15 },
- { "16", RTEMS_EVENT_16 },
- { "17", RTEMS_EVENT_17 },
- { "18", RTEMS_EVENT_18 },
- { "19", RTEMS_EVENT_19 },
- { "20", RTEMS_EVENT_20 },
- { "21", RTEMS_EVENT_21 },
- { "22", RTEMS_EVENT_22 },
- { "23", RTEMS_EVENT_23 },
- { "24", RTEMS_EVENT_24 },
- { "25", RTEMS_EVENT_25 },
- { "26", RTEMS_EVENT_26 },
- { "27", RTEMS_EVENT_27 },
- { "28", RTEMS_EVENT_28 },
- { "29", RTEMS_EVENT_29 },
- { "30", RTEMS_EVENT_30 },
- { "31", RTEMS_EVENT_31 },
- { 0, 0, 0 },
-};
-
-unsigned32
-rtems_monitor_dump_events(rtems_event_set events)
-{
- unsigned32 length = 0;
-
- if (events == EVENT_SETS_NONE_PENDING) /* value is 0 */
- length += printf("NONE");
-
- length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_events_assoc,
- ":",
- events);
- return length;
-}
-
-unsigned32
-rtems_monitor_dump_notepad(unsigned32 *notepad)
-{
- unsigned32 length = 0;
- int i;
-
- for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++)
- if (notepad[i])
- length += printf("%d: 0x%x ", i, notepad[i]);
-
- return length;
-}
diff --git a/c/src/libmisc/monitor/mon-queue.c b/c/src/libmisc/monitor/mon-queue.c
deleted file mode 100644
index b165062e28..0000000000
--- a/c/src/libmisc/monitor/mon-queue.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-
-void
-rtems_monitor_queue_canonical(
- rtems_monitor_queue_t *canonical_queue,
- void *queue_void
-)
-{
- Message_queue_Control *rtems_queue = (Message_queue_Control *) queue_void;
-
- canonical_queue->attributes = rtems_queue->attribute_set;
- canonical_queue->maximum_message_size = rtems_queue->message_queue.maximum_message_size;
- canonical_queue->maximum_pending_messages = rtems_queue->message_queue.maximum_pending_messages;
- canonical_queue->number_of_pending_messages = rtems_queue->message_queue.number_of_pending_messages;
-}
-
-void
-rtems_monitor_queue_dump_header(
- boolean verbose
-)
-{
- printf("\
- ID NAME ATTRIBUTES PEND MAXPEND MAXSIZE\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-
-/*
- * Dump out the "next" queue indicated by 'id'.
- * Returns next one to check.
- * Returns RTEMS_OBJECT_ID_FINAL when all done
- */
-
-void
-rtems_monitor_queue_dump(
- rtems_monitor_queue_t *monitor_queue,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += rtems_monitor_dump_id(monitor_queue->id);
- length += rtems_monitor_pad(11, length);
- length += rtems_monitor_dump_name(monitor_queue->name);
- length += rtems_monitor_pad(19, length);
- length += rtems_monitor_dump_attributes(monitor_queue->attributes);
- length += rtems_monitor_pad(31, length);
- length += rtems_monitor_dump_decimal(monitor_queue->number_of_pending_messages);
- length += rtems_monitor_pad(39, length);
- length += rtems_monitor_dump_decimal(monitor_queue->maximum_pending_messages);
- length += rtems_monitor_pad(48, length);
- length += rtems_monitor_dump_decimal(monitor_queue->maximum_message_size);
-
- printf("\n");
-}
diff --git a/c/src/libmisc/monitor/mon-server.c b/c/src/libmisc/monitor/mon-server.c
deleted file mode 100644
index 3ae56058d3..0000000000
--- a/c/src/libmisc/monitor/mon-server.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * RTEMS monitor server (handles requests for info from RTEMS monitors
- * running on other nodes)
- *
- * $Id$
- */
-
-#include <rtems.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <rtems/monitor.h>
-
-/*
- * Various id's for the server
- */
-
-rtems_id rtems_monitor_server_task_id;
-rtems_id rtems_monitor_server_request_queue_id; /* our server */
-rtems_id *rtems_monitor_server_request_queue_ids; /* all servers */
-rtems_id rtems_monitor_server_response_queue_id; /* our server */
-
-
-/*
- * Send a request to a server task
- */
-
-rtems_status_code
-rtems_monitor_server_request(
- unsigned32 server_node,
- rtems_monitor_server_request_t *request,
- rtems_monitor_server_response_t *response
-)
-{
- rtems_id server_id;
- rtems_status_code status;
- unsigned32 size;
-
- /*
- * What is id of monitor on target node?
- * Look it up if we don't know it yet.
- */
-
- server_id = rtems_monitor_server_request_queue_ids[server_node];
- if (server_id == 0)
- {
- status = rtems_message_queue_ident(RTEMS_MONITOR_QUEUE_NAME,
- server_node,
- &server_id);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "ident of remote server failed");
- goto done;
- }
-
- rtems_monitor_server_request_queue_ids[server_node] = server_id;
- }
-
- request->return_id = rtems_monitor_server_response_queue_id;
-
- status = rtems_message_queue_send(server_id, request, sizeof(*request));
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "monitor server request send failed");
- goto done;
- }
-
- /*
- * Await response, if requested
- */
-
- if (response)
- {
- status = rtems_message_queue_receive(rtems_monitor_server_response_queue_id,
- response,
- &size,
- RTEMS_WAIT,
- 100);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "server did not respond");
-
- /* maybe server task was restarted; look it up again next time */
- rtems_monitor_server_request_queue_ids[server_node] = 0;
-
- goto done;
- }
-
- if (response->command != RTEMS_MONITOR_SERVER_RESPONSE)
- {
- status = RTEMS_INCORRECT_STATE;
- goto done;
- }
- }
-
-done:
- return status;
-}
-
-
-
-/*
- * monitor server task
- */
-
-void
-rtems_monitor_server_task(
- rtems_task_argument monitor_flags
-)
-{
- rtems_monitor_server_request_t request;
- rtems_monitor_server_response_t response;
- rtems_status_code status;
- unsigned32 size;
-
- for (;;)
- {
- status = rtems_message_queue_receive(
- rtems_monitor_server_request_queue_id,
- &request,
- &size,
- RTEMS_WAIT,
- (rtems_interval) 0);
-
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "monitor server msg queue receive error");
- goto failed;
- }
-
- if (size != sizeof(request))
- {
- rtems_error(0, "monitor server bad size on receive");
- goto failed;
- }
-
- switch (request.command)
- {
- case RTEMS_MONITOR_SERVER_CANONICAL:
- {
- rtems_monitor_object_type_t object_type;
- rtems_id id;
- rtems_id next_id;
-
- object_type = (rtems_monitor_object_type_t) request.argument0;
- id = (rtems_id) request.argument1;
- next_id = rtems_monitor_object_canonical_get(object_type,
- id,
- &response.payload,
- &size);
-
- response.command = RTEMS_MONITOR_SERVER_RESPONSE;
- response.result0 = next_id;
- response.result1 = size;
-
-#define SERVER_OVERHEAD (RTEMS_offsetof(rtems_monitor_server_response_t, \
- payload))
-
- status = rtems_message_queue_send(request.return_id,
- &response,
- size + SERVER_OVERHEAD);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "response send failed");
- goto failed;
- }
- break;
- }
-
- default:
- {
- rtems_error(0, "invalid command to monitor server: %d", request.command);
- goto failed;
- }
- }
- }
-
-failed:
- rtems_task_delete(RTEMS_SELF);
-}
-
-
-/*
- * Kill off any old server
- * Not sure if this is useful, but it doesn't help
- */
-
-void
-rtems_monitor_server_kill(void)
-{
- if (rtems_monitor_server_task_id)
- rtems_task_delete(rtems_monitor_server_task_id);
- rtems_monitor_task_id = 0;
-
- if (rtems_monitor_server_request_queue_id)
- rtems_message_queue_delete(rtems_monitor_server_request_queue_id);
- rtems_monitor_server_response_queue_id = 0;
-
- if (rtems_monitor_server_response_queue_id)
- rtems_message_queue_delete(rtems_monitor_server_response_queue_id);
- rtems_monitor_server_request_queue_ids = 0;
-
- if (rtems_monitor_server_request_queue_ids)
- free(rtems_monitor_server_request_queue_ids);
- rtems_monitor_server_request_queue_ids = 0;
-}
-
-
-void
-rtems_monitor_server_init(
- unsigned32 monitor_flags
-)
-{
- rtems_status_code status;
-
- if (_System_state_Is_multiprocessing &&
- (_Configuration_MP_table->maximum_nodes > 1))
- {
- unsigned32 maximum_nodes = _Configuration_MP_table->maximum_nodes;
-
- /*
- * create the msg que our server will listen
- * Since we only get msgs from other RTEMS monitors, we just
- * need reserve space for 1 msg from each node.
- */
-
- status = rtems_message_queue_create(
- RTEMS_MONITOR_QUEUE_NAME,
- maximum_nodes,
- sizeof(rtems_monitor_server_request_t),
- RTEMS_GLOBAL,
- &rtems_monitor_server_request_queue_id);
-
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not create monitor server message queue");
- goto done;
- }
-
- /*
- * create the msg que our responses will come on
- * Since monitor just does one thing at a time, we only need 1 item
- * message queue.
- */
-
- status = rtems_message_queue_create(
- RTEMS_MONITOR_RESPONSE_QUEUE_NAME,
- 1, /* depth */
- sizeof(rtems_monitor_server_response_t),
- RTEMS_GLOBAL,
- &rtems_monitor_server_response_queue_id);
-
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not create monitor response message queue");
- goto done;
- }
-
- /* need an id for queue of each other server we might talk to */
- /* indexed by node, so add 1 to maximum_nodes */
- rtems_monitor_server_request_queue_ids =
- (rtems_id *) malloc((maximum_nodes + 1) * sizeof(rtems_id));
- (void) memset(rtems_monitor_server_request_queue_ids,
- 0,
- (maximum_nodes + 1) * sizeof(rtems_id));
-
- rtems_monitor_server_request_queue_ids[rtems_monitor_node] =
- rtems_monitor_server_request_queue_id;
-
- /*
- * create the server task
- */
- status = rtems_task_create(RTEMS_MONITOR_SERVER_NAME,
- 1,
- 0 /* default stack */,
- RTEMS_INTERRUPT_LEVEL(0),
- RTEMS_DEFAULT_ATTRIBUTES,
- &rtems_monitor_server_task_id);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not create monitor server task");
- goto done;
- }
-
- /*
- * Start the server task
- */
- status = rtems_task_start(rtems_monitor_server_task_id,
- rtems_monitor_server_task,
- monitor_flags);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not start monitor server");
- goto done;
- }
- }
-
-done:
- return;
-}
diff --git a/c/src/libmisc/monitor/mon-symbols.c b/c/src/libmisc/monitor/mon-symbols.c
deleted file mode 100644
index 48781bb6cc..0000000000
--- a/c/src/libmisc/monitor/mon-symbols.c
+++ /dev/null
@@ -1,487 +0,0 @@
-/*
- * File: symbols.c
- *
- * Description:
- * Symbol table manager for the RTEMS monitor.
- * These routines may be used by other system resources also.
- *
- *
- * TODO:
- *
- * $Id$
- */
-
-/* for strcasecmp in linux and solaris */
-#if defined(__linux__)
-#include <features.h>
-#define __USE_BSD
-#endif
-#include <string.h>
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <rtems/monitor.h>
-#include <rtems/symbols.h>
-
-
-rtems_symbol_table_t *
-rtems_symbol_table_create()
-{
- rtems_symbol_table_t *table;
-
- table = (rtems_symbol_table_t *) malloc(sizeof(rtems_symbol_table_t));
- memset((void *) table, 0, sizeof(*table));
-
- table->growth_factor = 30; /* 30 percent */
-
- return table;
-}
-
-void
-rtems_symbol_table_destroy(rtems_symbol_table_t *table)
-{
- rtems_symbol_string_block_t *p, *pnext;
-
- if (table)
- {
- if (table->addresses)
- (void) free(table->addresses);
- table->addresses = 0;
- p = table->string_buffer_head;
- while (p)
- {
- pnext = p->next;
- free(p);
- p = pnext;
- }
- table->string_buffer_head = 0;
- table->string_buffer_current = 0;
-
- free(table);
- }
-}
-
-rtems_symbol_t *
-rtems_symbol_create(
- rtems_symbol_table_t *table,
- char *name,
- rtems_unsigned32 value
- )
-{
- int symbol_length;
- size_t newsize;
- rtems_symbol_t *sp;
-
- symbol_length = strlen(name) + 1; /* include '\000' in length */
-
- /* need to grow the table? */
- if (table->next >= table->size)
- {
- if (table->size == 0)
- newsize = 100;
- else
- newsize = table->size + (table->size / (100 / table->growth_factor));
-
- table->addresses = (rtems_symbol_t *) realloc((void *) table->addresses, newsize * sizeof(rtems_symbol_t));
- if (table->addresses == 0) /* blew it; lost orig */
- goto failed;
- table->size = newsize;
- }
-
- sp = &table->addresses[table->next];
- sp->value = value;
-
- /* Have to add it to string pool */
- /* need to grow pool? */
-
- if ((table->string_buffer_head == 0) ||
- (table->strings_next + symbol_length) >= SYMBOL_STRING_BLOCK_SIZE)
- {
- rtems_symbol_string_block_t *p;
-
- p = (rtems_symbol_string_block_t *) malloc(sizeof(rtems_symbol_string_block_t));
- if (p == 0)
- goto failed;
- p->next = 0;
- if (table->string_buffer_head == 0)
- table->string_buffer_head = p;
- else
- table->string_buffer_current->next = p;
- table->string_buffer_current = p;
-
- table->strings_next = 0;
- }
-
- sp->name = table->string_buffer_current->buffer + table->strings_next;
- (void) strcpy(sp->name, name);
-
- table->strings_next += symbol_length;
- table->sorted = 0;
- table->next++;
-
- return sp;
-
-/* XXX Not sure what to do here. We've possibly destroyed the initial
- symbol table due to realloc failure */
-failed:
- return 0;
-}
-
-/*
- * Qsort entry point for compare by address
- */
-
-static int
-rtems_symbol_compare(const void *e1,
- const void *e2)
-{
- rtems_symbol_t *s1, *s2;
- s1 = (rtems_symbol_t *) e1;
- s2 = (rtems_symbol_t *) e2;
-
- if (s1->value < s2->value)
- return -1;
- if (s1->value > s2->value)
- return 1;
- return 0;
-}
-
-
-/*
- * Sort the symbol table using qsort
- */
-
-static void
-rtems_symbol_sort(rtems_symbol_table_t *table)
-{
- qsort((void *) table->addresses, (size_t) table->next,
- sizeof(rtems_symbol_t), rtems_symbol_compare);
- table->sorted = 1;
-}
-
-
-/*
- * Search the symbol table by address
- * This code based on CYGNUS newlib bsearch, but changed
- * to allow for finding closest symbol <= key
- */
-
-rtems_symbol_t *
-rtems_symbol_value_lookup(
- rtems_symbol_table_t *table,
- rtems_unsigned32 value
- )
-{
- rtems_symbol_t *sp;
- rtems_symbol_t *base;
- rtems_symbol_t *best = 0;
- rtems_unsigned32 distance;
- rtems_unsigned32 best_distance = ~0;
- rtems_unsigned32 elements;
-
- if (table == 0)
- table = rtems_monitor_symbols;
-
- if ((table == 0) || (table->size == 0))
- return 0;
-
- if (table->sorted == 0)
- rtems_symbol_sort(table);
-
- base = table->addresses;
- elements = table->next;
-
- while (elements)
- {
- sp = base + (elements / 2);
- if (value < sp->value)
- elements /= 2;
- else if (value > sp->value)
- {
- distance = value - sp->value;
- if (distance < best_distance)
- {
- best_distance = distance;
- best = sp;
- }
- base = sp + 1;
- elements = (elements / 2) - (elements % 2 ? 0 : 1);
- }
- else
- return sp;
- }
-
- if (value == base->value)
- return base;
-
- return best;
-}
-
-/*
- * Search the symbol table for the exact matching address.
- * If the symbol table has already been sorted, then
- * call the regular symbol value lookup, however, it it
- * has not yet been sorted, search it sequentially.
- * This routine is primarily used for low level symbol
- * lookups (eg. from exception handler and interrupt routines)
- * where the penality of sorted is not wanted and where
- * an exact match is needed such that symbol table order
- * is not important.
- */
-const rtems_symbol_t *
-rtems_symbol_value_lookup_exact(
- rtems_symbol_table_t *table,
- rtems_unsigned32 value
- )
-{
- rtems_unsigned32 s;
- rtems_symbol_t *sp;
-
- if (table == 0)
- {
- table = rtems_monitor_symbols;
- if (table == 0)
- return NULL;
- }
-
- if (table->sorted)
- {
- sp = rtems_symbol_value_lookup(table, value);
- if ( rtems_symbol_value(sp) == value )
- return sp;
- else
- return NULL; /* not an exact match */
- }
-
- for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
- {
- if ( sp->value == value )
- return sp;
- }
-
- return NULL;
-
-}
-
-
-/*
- * Search the symbol table by string name (case independent)
- */
-
-rtems_symbol_t *
-rtems_symbol_name_lookup(
- rtems_symbol_table_t *table,
- char *name
- )
-{
- rtems_unsigned32 s;
- rtems_symbol_t *sp;
-
- if (table == 0)
- {
- table = rtems_monitor_symbols;
- if (table == 0)
- return NULL;
- }
-
- for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
- {
- if ( strcasecmp(sp->name, name) == 0 )
- return sp;
- }
-
- return NULL;
-}
-
-void *
-rtems_monitor_symbol_next(
- void *object_info,
- rtems_monitor_symbol_t *canonical,
- rtems_id *next_id
-)
-{
- rtems_symbol_table_t *table;
- rtems_unsigned32 n = rtems_get_index(*next_id);
-
- table = *(rtems_symbol_table_t **) object_info;
- if (table == 0)
- goto failed;
-
- if (n >= table->next)
- goto failed;
-
- /* NOTE: symbols do not have id and name fields */
-
- if (table->sorted == 0)
- rtems_symbol_sort(table);
-
- _Thread_Disable_dispatch();
-
- *next_id += 1;
- return (void *) (table->addresses + n);
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-void
-rtems_monitor_symbol_canonical(
- rtems_monitor_symbol_t *canonical_symbol,
- rtems_symbol_t *sp
-)
-{
- canonical_symbol->value = sp->value;
- canonical_symbol->offset = 0;
- strncpy(canonical_symbol->name, sp->name, sizeof(canonical_symbol->name));
-}
-
-
-void
-rtems_monitor_symbol_canonical_by_name(
- rtems_monitor_symbol_t *canonical_symbol,
- char *name
-)
-{
- rtems_symbol_t *sp;
-
- sp = rtems_symbol_name_lookup(0, name);
-
- canonical_symbol->value = sp ? sp->value : 0;
-
- strncpy(canonical_symbol->name, name, sizeof(canonical_symbol->name));
- canonical_symbol->offset = 0;
-}
-
-void
-rtems_monitor_symbol_canonical_by_value(
- rtems_monitor_symbol_t *canonical_symbol,
- void *value_void_p
-)
-{
- unsigned32 value = (unsigned32) value_void_p;
- rtems_symbol_t *sp;
-
- sp = rtems_symbol_value_lookup(0, value);
- if (sp)
- {
- canonical_symbol->value = sp->value;
- canonical_symbol->offset = value - sp->value;
- strncpy(canonical_symbol->name, sp->name, sizeof(canonical_symbol->name));
- }
- else
- {
- canonical_symbol->value = value;
- canonical_symbol->offset = 0;
- canonical_symbol->name[0] = '\0';
- }
-}
-
-
-unsigned32
-rtems_monitor_symbol_dump(
- rtems_monitor_symbol_t *canonical_symbol,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- /*
- * print the name if it exists AND if value is non-zero
- * Ie: don't print some garbage symbol for address 0
- */
-
- if (canonical_symbol->name[0] && (canonical_symbol->value != 0))
- {
- if (canonical_symbol->offset == 0)
- length += printf("%.*s",
- (int) sizeof(canonical_symbol->name),
- canonical_symbol->name);
- else
- length += printf("<%.*s+0x%x>",
- (int) sizeof(canonical_symbol->name),
- canonical_symbol->name,
- canonical_symbol->offset);
- if (verbose)
- length += printf(" [0x%x]", canonical_symbol->value);
- }
- else
- length += printf("[0x%x]", canonical_symbol->value);
-
- return length;
-}
-
-
-void
-rtems_monitor_symbol_dump_all(
- rtems_symbol_table_t *table,
- boolean verbose
-)
-{
- rtems_unsigned32 s;
- rtems_symbol_t *sp;
-
- if (table == 0)
- {
- table = rtems_monitor_symbols;
- if (table == 0)
- return;
- }
-
- if (table->sorted == 0)
- rtems_symbol_sort(table);
-
- for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
- {
- rtems_monitor_symbol_t canonical_symbol;
-
- rtems_monitor_symbol_canonical(&canonical_symbol, sp);
- rtems_monitor_symbol_dump(&canonical_symbol, TRUE);
- printf("\n");
- }
-}
-
-
-/*
- * 'symbol' command
- */
-
-void
-rtems_monitor_symbol_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- int arg;
- rtems_symbol_table_t *table;
-
- table = *(rtems_symbol_table_t **) command_arg;
- if (table == 0)
- {
- table = rtems_monitor_symbols;
- if (table == 0)
- return;
- }
-
- /*
- * Use object command to dump out whole symbol table
- */
- if (argc == 1)
- rtems_monitor_symbol_dump_all(table, verbose);
- else
- {
- rtems_monitor_symbol_t canonical_symbol;
-
- for (arg=1; argv[arg]; arg++)
- {
- rtems_monitor_symbol_canonical_by_name(&canonical_symbol, argv[arg]);
- rtems_monitor_symbol_dump(&canonical_symbol, verbose);
- printf("\n");
- }
- }
-}
diff --git a/c/src/libmisc/monitor/mon-task.c b/c/src/libmisc/monitor/mon-task.c
deleted file mode 100644
index b6ca36ddd1..0000000000
--- a/c/src/libmisc/monitor/mon-task.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * RTEMS Monitor task support
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <string.h> /* memcpy() */
-
-void
-rtems_monitor_task_canonical(
- rtems_monitor_task_t *canonical_task,
- void *thread_void
-)
-{
- Thread_Control *rtems_thread = (Thread_Control *) thread_void;
- RTEMS_API_Control *api;
-
- api = rtems_thread->API_Extensions[ THREAD_API_RTEMS ];
-
- canonical_task->entry = rtems_thread->Start.entry_point;
- canonical_task->argument = rtems_thread->Start.numeric_argument;
- canonical_task->stack = rtems_thread->Start.Initial_stack.area;
- canonical_task->stack_size = rtems_thread->Start.Initial_stack.size;
- canonical_task->priority = rtems_thread->current_priority;
- canonical_task->state = rtems_thread->current_state;
- canonical_task->wait_id = rtems_thread->Wait.id;
- canonical_task->events = api->pending_events;
-
-/* XXX modes and attributes only exist in the RTEMS API .. */
-/* XXX not directly in the core thread.. they will have to be derived */
-/* XXX if they are important enough to include anymore. */
- canonical_task->modes = 0; /* XXX FIX ME.... rtems_thread->current_modes; */
- canonical_task->attributes = 0 /* XXX FIX ME rtems_thread->API_Extensions[ THREAD_API_RTEMS ]->attribute_set */;
- (void) memcpy(canonical_task->notepad, api ->Notepads, sizeof(canonical_task->notepad));
-/* XXX more to fix */
-/*
- (void) memcpy(&canonical_task->wait_args, &rtems_thread->Wait.Extra, sizeof(canonical_task->wait_args));
-*/
-}
-
-
-void
-rtems_monitor_task_dump_header(
- boolean verbose
-)
-{
- printf("\
- ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
-
- rtems_monitor_separator();
-}
-
-/*
- */
-
-void
-rtems_monitor_task_dump(
- rtems_monitor_task_t *monitor_task,
- boolean verbose
-)
-{
- int length = 0;
-
- length += rtems_monitor_dump_id(monitor_task->id);
- length += rtems_monitor_pad(11, length);
- length += rtems_monitor_dump_name(monitor_task->name);
- length += rtems_monitor_pad(18, length);
- length += rtems_monitor_dump_priority(monitor_task->priority);
- length += rtems_monitor_pad(24, length);
- length += rtems_monitor_dump_state(monitor_task->state);
- length += rtems_monitor_pad(31, length);
- length += rtems_monitor_dump_modes(monitor_task->modes);
- length += rtems_monitor_pad(39, length);
- length += rtems_monitor_dump_events(monitor_task->events);
- if (monitor_task->wait_id)
- {
- length += rtems_monitor_pad(47, length);
- length += rtems_monitor_dump_id(monitor_task->wait_id);
- length += rtems_monitor_pad(57, length);
- length += rtems_monitor_dump_hex(monitor_task->wait_args);
- }
-
- length += rtems_monitor_pad(65, length);
- length += rtems_monitor_dump_notepad(monitor_task->notepad);
- printf("\n");
-}
-
diff --git a/c/src/libmisc/monitor/monitor.h b/c/src/libmisc/monitor/monitor.h
deleted file mode 100644
index 16efd7c41f..0000000000
--- a/c/src/libmisc/monitor/monitor.h
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * File: monitor.h
- *
- * Description:
- * The RTEMS monitor task include file.
- *
- * TODO:
- *
- * $Id$
- */
-
-#ifndef __MONITOR_H
-#define __MONITOR_H
-
-#include <rtems/symbols.h>
-#include <rtems/error.h> /* rtems_error() */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Monitor types are derived from rtems object classes
- */
-
-typedef enum {
- RTEMS_MONITOR_OBJECT_INVALID = OBJECTS_NO_CLASS,
- RTEMS_MONITOR_OBJECT_TASK = OBJECTS_RTEMS_TASKS,
- RTEMS_MONITOR_OBJECT_EXTENSION = OBJECTS_RTEMS_EXTENSIONS,
- RTEMS_MONITOR_OBJECT_QUEUE = OBJECTS_RTEMS_MESSAGE_QUEUES,
- RTEMS_MONITOR_OBJECT_SEMAPHORE = OBJECTS_RTEMS_SEMAPHORES,
- RTEMS_MONITOR_OBJECT_PARTITION = OBJECTS_RTEMS_PARTITIONS,
- RTEMS_MONITOR_OBJECT_REGION = OBJECTS_RTEMS_REGIONS,
- RTEMS_MONITOR_OBJECT_PORT = OBJECTS_RTEMS_PORTS,
-
- /* following monitor objects are not known to RTEMS, but
- * we like to have "types" for them anyway */
-
- RTEMS_MONITOR_OBJECT_DRIVER = OBJECTS_CLASSES_LAST+1,
- RTEMS_MONITOR_OBJECT_DNAME,
- RTEMS_MONITOR_OBJECT_CONFIG,
- RTEMS_MONITOR_OBJECT_INIT_TASK,
- RTEMS_MONITOR_OBJECT_MPCI,
- RTEMS_MONITOR_OBJECT_SYMBOL
-} rtems_monitor_object_type_t;
-
-/*
- * rtems_monitor_init() flags
- */
-
-#define RTEMS_MONITOR_SUSPEND 0x0001 /* suspend monitor on startup */
-#define RTEMS_MONITOR_GLOBAL 0x0002 /* monitor should be global */
-
-
-/*
- * Public interfaces for RTEMS data structures monitor is aware of.
- * These are only used by the monitor.
- *
- * NOTE:
- * All the canonical objects that correspond to RTEMS managed "objects"
- * must have an identical first portion with 'id' and 'name' fields.
- *
- * Others do not have that restriction, even tho we would like them to.
- * This is because some of the canonical structures are almost too big
- * for shared memory driver (eg: mpci) and we are nickel and diming it.
- */
-
-/*
- * Type of a pointer that may be a symbol
- */
-
-#define MONITOR_SYMBOL_LEN 20
-typedef struct {
- char name[MONITOR_SYMBOL_LEN];
- unsigned32 value;
- unsigned32 offset;
-} rtems_monitor_symbol_t;
-
-typedef struct {
- rtems_id id;
- rtems_name name;
- /* end of common portion */
-} rtems_monitor_generic_t;
-
-/*
- * Task
- */
-typedef struct {
- rtems_id id;
- rtems_name name;
- /* end of common portion */
- Thread_Entry entry;
- unsigned32 argument;
- void *stack;
- unsigned32 stack_size;
- rtems_task_priority priority;
- States_Control state;
- rtems_event_set events;
- rtems_mode modes;
- rtems_attribute attributes;
- unsigned32 notepad[RTEMS_NUMBER_NOTEPADS];
- rtems_id wait_id;
- unsigned32 wait_args;
-} rtems_monitor_task_t;
-
-/*
- * Init task
- */
-
-typedef struct {
- rtems_id id; /* not really an id */
- rtems_name name;
- /* end of common portion */
- rtems_monitor_symbol_t entry;
- unsigned32 argument;
- unsigned32 stack_size;
- rtems_task_priority priority;
- rtems_mode modes;
- rtems_attribute attributes;
-} rtems_monitor_init_task_t;
-
-
-/*
- * Message queue
- */
-typedef struct {
- rtems_id id;
- rtems_name name;
- /* end of common portion */
- rtems_attribute attributes;
- unsigned32 number_of_pending_messages;
- unsigned32 maximum_pending_messages;
- unsigned32 maximum_message_size;
-} rtems_monitor_queue_t;
-
-/*
- * Extension
- */
-typedef struct {
- rtems_id id;
- rtems_name name;
- /* end of common portion */
- rtems_monitor_symbol_t e_create;
- rtems_monitor_symbol_t e_start;
- rtems_monitor_symbol_t e_restart;
- rtems_monitor_symbol_t e_delete;
- rtems_monitor_symbol_t e_tswitch;
- rtems_monitor_symbol_t e_begin;
- rtems_monitor_symbol_t e_exitted;
- rtems_monitor_symbol_t e_fatal;
-} rtems_monitor_extension_t;
-
-/*
- * Device driver
- */
-
-typedef struct {
- rtems_id id; /* not really an id (should be tho) */
- rtems_name name; /* ditto */
- /* end of common portion */
- rtems_monitor_symbol_t initialization; /* initialization procedure */
- rtems_monitor_symbol_t open; /* open request procedure */
- rtems_monitor_symbol_t close; /* close request procedure */
- rtems_monitor_symbol_t read; /* read request procedure */
- rtems_monitor_symbol_t write; /* write request procedure */
- rtems_monitor_symbol_t control; /* special functions procedure */
-} rtems_monitor_driver_t;
-
-typedef struct {
- rtems_id id; /* not used for drivers (yet) */
- rtems_name name; /* not used for drivers (yet) */
- /* end of common portion */
- unsigned32 major;
- unsigned32 minor;
- char name_string[64];
-} rtems_monitor_dname_t;
-
-/*
- * System config
- */
-
-typedef struct {
- void *work_space_start;
- unsigned32 work_space_size;
- unsigned32 maximum_tasks;
- unsigned32 maximum_timers;
- unsigned32 maximum_semaphores;
- unsigned32 maximum_message_queues;
- unsigned32 maximum_partitions;
- unsigned32 maximum_regions;
- unsigned32 maximum_ports;
- unsigned32 maximum_periods;
- unsigned32 maximum_extensions;
- unsigned32 microseconds_per_tick;
- unsigned32 ticks_per_timeslice;
- unsigned32 number_of_initialization_tasks;
-} rtems_monitor_config_t;
-
-/*
- * MPCI config
- */
-
-typedef struct {
- unsigned32 node; /* local node number */
- unsigned32 maximum_nodes; /* maximum # nodes in system */
- unsigned32 maximum_global_objects; /* maximum # global objects */
- unsigned32 maximum_proxies; /* maximum # proxies */
-
- unsigned32 default_timeout; /* in ticks */
- unsigned32 maximum_packet_size;
- rtems_monitor_symbol_t initialization;
- rtems_monitor_symbol_t get_packet;
- rtems_monitor_symbol_t return_packet;
- rtems_monitor_symbol_t send_packet;
- rtems_monitor_symbol_t receive_packet;
-} rtems_monitor_mpci_t;
-
-/*
- * The generic canonical information union
- */
-
-typedef union {
- rtems_monitor_generic_t generic;
- rtems_monitor_task_t task;
- rtems_monitor_queue_t queue;
- rtems_monitor_extension_t extension;
- rtems_monitor_driver_t driver;
- rtems_monitor_dname_t dname;
- rtems_monitor_config_t config;
- rtems_monitor_mpci_t mpci;
- rtems_monitor_init_task_t itask;
-} rtems_monitor_union_t;
-
-/*
- * Support for talking to other monitors
- */
-
-/*
- * Names of other monitors
- */
-
-#define RTEMS_MONITOR_NAME (rtems_build_name('R', 'M', 'O', 'N'))
-#define RTEMS_MONITOR_SERVER_NAME (rtems_build_name('R', 'M', 'S', 'V'))
-#define RTEMS_MONITOR_QUEUE_NAME (rtems_build_name('R', 'M', 'S', 'Q'))
-#define RTEMS_MONITOR_RESPONSE_QUEUE_NAME (rtems_build_name('R', 'M', 'R', 'Q'))
-
-#define RTEMS_MONITOR_SERVER_RESPONSE 0x0001
-#define RTEMS_MONITOR_SERVER_CANONICAL 0x0002
-
-typedef struct
-{
- unsigned32 command;
- rtems_id return_id;
- unsigned32 argument0;
- unsigned32 argument1;
- unsigned32 argument2;
- unsigned32 argument3;
- unsigned32 argument4;
- unsigned32 argument5;
-} rtems_monitor_server_request_t;
-
-typedef struct
-{
- unsigned32 command;
- unsigned32 result0;
- unsigned32 result1;
- rtems_monitor_union_t payload;
-} rtems_monitor_server_response_t;
-
-extern rtems_id rtems_monitor_task_id;
-
-extern unsigned32 rtems_monitor_node; /* our node number */
-extern unsigned32 rtems_monitor_default_node; /* current default for commands */
-
-/*
- * Monitor command function and table entry
- */
-
-typedef struct rtems_monitor_command_entry_s rtems_monitor_command_entry_t;
-
-typedef void ( *rtems_monitor_command_function_t )(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
- );
-
-struct rtems_monitor_command_entry_s {
- char *command; /* command name */
- char *usage; /* usage string for the command */
- unsigned32 arguments_required; /* # of required args */
- rtems_monitor_command_function_t command_function;
-
- /* Some argument for the command */
- unsigned32 command_arg;
-};
-
-typedef void *(*rtems_monitor_object_next_fn)(void *, void *, rtems_id *);
-typedef void (*rtems_monitor_object_canonical_fn)(void *, void *);
-typedef void (*rtems_monitor_object_dump_header_fn)(boolean);
-typedef void (*rtems_monitor_object_dump_fn)(void *, boolean);
-
-typedef struct {
- rtems_monitor_object_type_t type;
- void *object_information;
- int size; /* of canonical object */
- rtems_monitor_object_next_fn next;
- rtems_monitor_object_canonical_fn canonical;
- rtems_monitor_object_dump_header_fn dump_header;
- rtems_monitor_object_dump_fn dump;
-} rtems_monitor_object_info_t;
-
-
-/* monitor.c */
-void rtems_monitor_kill(void);
-void rtems_monitor_init(unsigned32);
-void rtems_monitor_wakeup(void);
-void rtems_monitor_pause_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_fatal_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_continue_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_debugger_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_node_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_symbols_loadup(void);
-void rtems_monitor_task(rtems_task_argument);
-
-/* server.c */
-void rtems_monitor_server_kill(void);
-rtems_status_code rtems_monitor_server_request(unsigned32, rtems_monitor_server_request_t *, rtems_monitor_server_response_t *);
-void rtems_monitor_server_task(rtems_task_argument);
-void rtems_monitor_server_init(unsigned32);
-
-/* command.c */
-int rtems_monitor_make_argv(char *, int *, char **);
-int rtems_monitor_command_read(char *, int *, char **);
-rtems_monitor_command_entry_t *rtems_monitor_command_lookup(
- rtems_monitor_command_entry_t * table, int argc, char **argv);
-void rtems_monitor_command_usage(rtems_monitor_command_entry_t *, char *);
-void rtems_monitor_help_cmd(int, char **, unsigned32, boolean);
-
-/* prmisc.c */
-void rtems_monitor_separator(void);
-unsigned32 rtems_monitor_pad(unsigned32 dest_col, unsigned32 curr_col);
-unsigned32 rtems_monitor_dump_char(unsigned8 ch);
-unsigned32 rtems_monitor_dump_decimal(unsigned32 num);
-unsigned32 rtems_monitor_dump_hex(unsigned32 num);
-unsigned32 rtems_monitor_dump_id(rtems_id id);
-unsigned32 rtems_monitor_dump_name(rtems_name name);
-unsigned32 rtems_monitor_dump_priority(rtems_task_priority priority);
-unsigned32 rtems_monitor_dump_state(States_Control state);
-unsigned32 rtems_monitor_dump_modes(rtems_mode modes);
-unsigned32 rtems_monitor_dump_attributes(rtems_attribute attributes);
-unsigned32 rtems_monitor_dump_events(rtems_event_set events);
-unsigned32 rtems_monitor_dump_notepad(unsigned32 *notepad);
-
-/* object.c */
-rtems_id rtems_monitor_id_fixup(rtems_id, unsigned32, rtems_monitor_object_type_t);
-rtems_id rtems_monitor_object_canonical_get(rtems_monitor_object_type_t, rtems_id, void *, unsigned32 *size_p);
-rtems_id rtems_monitor_object_canonical_next(rtems_monitor_object_info_t *, rtems_id, void *);
-void *rtems_monitor_object_next(void *, void *, rtems_id, rtems_id *);
-rtems_id rtems_monitor_object_canonical(rtems_id, void *);
-void rtems_monitor_object_cmd(int, char **, unsigned32, boolean);
-
-/* manager.c */
-void *rtems_monitor_manager_next(void *, void *, rtems_id *);
-
-/* config.c */
-void rtems_monitor_config_canonical(rtems_monitor_config_t *, void *);
-void *rtems_monitor_config_next(void *, rtems_monitor_config_t *, rtems_id *);
-void rtems_monitor_config_dump_header(boolean);
-void rtems_monitor_config_dump(rtems_monitor_config_t *, boolean verbose);
-
-/* mpci.c */
-void rtems_monitor_mpci_canonical(rtems_monitor_mpci_t *, void *);
-void *rtems_monitor_mpci_next(void *, rtems_monitor_mpci_t *, rtems_id *);
-void rtems_monitor_mpci_dump_header(boolean);
-void rtems_monitor_mpci_dump(rtems_monitor_mpci_t *, boolean verbose);
-
-/* itask.c */
-void rtems_monitor_init_task_canonical(rtems_monitor_init_task_t *, void *);
-void *rtems_monitor_init_task_next(void *, rtems_monitor_init_task_t *, rtems_id *);
-void rtems_monitor_init_task_dump_header(boolean);
-void rtems_monitor_init_task_dump(rtems_monitor_init_task_t *, boolean verbose);
-
-/* extension.c */
-void rtems_monitor_extension_canonical(rtems_monitor_extension_t *, void *);
-void rtems_monitor_extension_dump_header(boolean verbose);
-void rtems_monitor_extension_dump(rtems_monitor_extension_t *, boolean);
-
-/* task.c */
-void rtems_monitor_task_canonical(rtems_monitor_task_t *, void *);
-void rtems_monitor_task_dump_header(boolean verbose);
-void rtems_monitor_task_dump(rtems_monitor_task_t *, boolean);
-
-/* queue.c */
-void rtems_monitor_queue_canonical(rtems_monitor_queue_t *, void *);
-void rtems_monitor_queue_dump_header(boolean verbose);
-void rtems_monitor_queue_dump(rtems_monitor_queue_t *, boolean);
-
-/* driver.c */
-void *rtems_monitor_driver_next(void *, rtems_monitor_driver_t *, rtems_id *);
-void rtems_monitor_driver_canonical(rtems_monitor_driver_t *, void *);
-void rtems_monitor_driver_dump_header(boolean);
-void rtems_monitor_driver_dump(rtems_monitor_driver_t *, boolean);
-
-/* dname.c */
-void *rtems_monitor_dname_next(void *, rtems_monitor_dname_t *, rtems_id *);
-void rtems_monitor_dname_canonical(rtems_monitor_dname_t *, void *);
-void rtems_monitor_dname_dump_header(boolean);
-void rtems_monitor_dname_dump(rtems_monitor_dname_t *, boolean);
-
-/* symbols.c */
-rtems_symbol_table_t *rtems_symbol_table_create();
-void rtems_symbol_table_destroy(rtems_symbol_table_t *table);
-
-rtems_symbol_t *rtems_symbol_create(rtems_symbol_table_t *, char *, unsigned32);
-rtems_symbol_t *rtems_symbol_value_lookup(rtems_symbol_table_t *, unsigned32);
-const rtems_symbol_t *rtems_symbol_value_lookup_exact(rtems_symbol_table_t *, unsigned32);
-rtems_symbol_t *rtems_symbol_name_lookup(rtems_symbol_table_t *, char *);
-void *rtems_monitor_symbol_next(void *object_info, rtems_monitor_symbol_t *, rtems_id *);
-void rtems_monitor_symbol_canonical(rtems_monitor_symbol_t *, rtems_symbol_t *);
-void rtems_monitor_symbol_canonical_by_name(rtems_monitor_symbol_t *, char *);
-void rtems_monitor_symbol_canonical_by_value(rtems_monitor_symbol_t *, void *);
-unsigned32 rtems_monitor_symbol_dump(rtems_monitor_symbol_t *, boolean);
-void rtems_monitor_symbol_cmd(int, char **, unsigned32, boolean);
-
-
-extern rtems_symbol_table_t *rtems_monitor_symbols;
-
-#ifndef MONITOR_PROMPT
-#define MONITOR_PROMPT "rtems" /* will have '> ' appended */
-#endif
-
-#define MONITOR_WAKEUP_EVENT RTEMS_EVENT_0
-
-
-#define STREQ(a,b) (strcmp(a,b) == 0)
-#define STRNEQ(a,b,n) (strncmp(a,b,n) == 0)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! __MONITOR_H */
diff --git a/c/src/libmisc/monitor/symbols.h b/c/src/libmisc/monitor/symbols.h
deleted file mode 100644
index 119c879d54..0000000000
--- a/c/src/libmisc/monitor/symbols.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * RTEMS monitor symbol table functions
- *
- * Description:
- * Entry points for symbol table routines.
- *
- *
- *
- * TODO:
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_SYMBOLS_H
-#define _INCLUDE_SYMBOLS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct {
- rtems_unsigned32 value;
- char *name;
-} rtems_symbol_t;
-
-#define SYMBOL_STRING_BLOCK_SIZE 4080
-typedef struct rtems_symbol_string_block_s {
- struct rtems_symbol_string_block_s *next;
- char buffer[SYMBOL_STRING_BLOCK_SIZE];
-} rtems_symbol_string_block_t;
-
-typedef struct {
-
- rtems_unsigned32 sorted; /* are symbols sorted right now? */
- rtems_unsigned32 growth_factor; /* % to grow by when needed */
- rtems_unsigned32 next; /* next symbol slot to use when adding */
- rtems_unsigned32 size; /* max # of symbols */
-
- /*
- * Symbol list -- sorted by address (when we do a lookup)
- */
-
- rtems_symbol_t *addresses; /* symbol array by address */
-
- /*
- * String pool, unsorted, a list of blocks of string data
- */
-
- rtems_symbol_string_block_t *string_buffer_head;
- rtems_symbol_string_block_t *string_buffer_current;
- rtems_unsigned32 strings_next; /* next byte to use in this block */
-
-} rtems_symbol_table_t;
-
-#define rtems_symbol_name(sp) ((sp)->name)
-#define rtems_symbol_value(sp) ((sp)->value)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! _INCLUDE_SYMBOLS_H */
diff --git a/c/src/libmisc/rtmonuse/Makefile.in b/c/src/libmisc/rtmonuse/Makefile.in
deleted file mode 100644
index a344c894b6..0000000000
--- a/c/src/libmisc/rtmonuse/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIB=${ARCH}/librtmonuse-tmp.a
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=rtmonuse
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-INSTALLED_H_FILES=$(srcdir)/rtmonuse.h
-
-SRCS=$(C_FILES) $(H_FILES) $(INSTALLED_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${LIB}: ${SRCS} ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL) -m 444 ${INSTALLED_H_FILES} $(PROJECT_INCLUDE)
-# $(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems
diff --git a/c/src/libmisc/rtmonuse/rtmonuse.c b/c/src/libmisc/rtmonuse/rtmonuse.c
deleted file mode 100644
index 843d29468e..0000000000
--- a/c/src/libmisc/rtmonuse/rtmonuse.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <assert.h>
-
-#include "rtmonuse.h"
-
-typedef struct {
- rtems_id id;
- unsigned32 count;
- unsigned32 missed_count;
- unsigned32 min_cpu_time;
- unsigned32 max_cpu_time;
- unsigned32 total_cpu_time;
- unsigned32 min_wall_time;
- unsigned32 max_wall_time;
- unsigned32 total_wall_time;
-} Period_usage_t;
-
-Period_usage_t *Period_usage_Information;
-
-/*PAGE
- *
- * Period_usage_Initialize
- */
-
-void Period_usage_Initialize( void )
-{
- int maximum;
-
- maximum = _Configuration_Table->RTEMS_api_configuration->maximum_periods;
-
- Period_usage_Information = malloc( sizeof(Period_usage_t) * (maximum+1) );
-
- Period_usage_Reset();
-}
-
-/*PAGE
- *
- * Period_usage_Reset
- */
-
-void Period_usage_Reset( void )
-{
- unsigned32 i;
- Period_usage_t *the_usage;
-
- for ( i=0 ;
- i<_Configuration_Table->RTEMS_api_configuration->maximum_periods ;
- i++ ) {
- the_usage = &Period_usage_Information[ i ];
-
- the_usage->count = 0;
- the_usage->missed_count = 0;
- the_usage->min_cpu_time = 0xFFFFFFFF;
- the_usage->max_cpu_time = 0;
- the_usage->total_cpu_time = 0;
- the_usage->min_wall_time = 0xFFFFFFFF;
- the_usage->max_wall_time = 0;
- the_usage->total_wall_time = 0;
-
- }
-}
-
-/*PAGE
- *
- * Period_usage_Update
- */
-
-void Period_usage_Update(
- rtems_id id
-)
-{
- rtems_rate_monotonic_period_status rm_status;
- rtems_status_code status;
- Period_usage_t *the_usage;
-
- assert( Period_usage_Information );
-
- status = rtems_rate_monotonic_get_status( id, &rm_status );
- assert( status == RTEMS_SUCCESSFUL );
-
- the_usage = &Period_usage_Information[ rtems_get_index( id ) ];
-
- the_usage->id = id;
- the_usage->count++;
- if ( rm_status.state == RATE_MONOTONIC_EXPIRED )
- the_usage->missed_count++;
- the_usage->total_cpu_time += rm_status.ticks_executed_since_last_period;
- the_usage->total_wall_time += rm_status.ticks_since_last_period;
-
- /*
- * Update CPU time
- */
-
- if ( rm_status.ticks_executed_since_last_period < the_usage->min_cpu_time )
- the_usage->min_cpu_time = rm_status.ticks_executed_since_last_period;
-
- if ( rm_status.ticks_executed_since_last_period > the_usage->max_cpu_time )
- the_usage->max_cpu_time = rm_status.ticks_executed_since_last_period;
-
- /*
- * Update Wall time
- */
-
- if ( rm_status.ticks_since_last_period < the_usage->min_wall_time )
- the_usage->min_wall_time = rm_status.ticks_since_last_period;
-
- if ( rm_status.ticks_since_last_period > the_usage->max_wall_time )
- the_usage->max_wall_time = rm_status.ticks_since_last_period;
-
-}
-
-/*PAGE
- *
- * Period_usage_Dump
- */
-
-void Period_usage_Dump( void )
-{
- unsigned32 i;
- Period_usage_t *the_usage;
- Rate_monotonic_Control *the_period;
- unsigned32 u32_name;
- char name[5];
-
- if ( !Period_usage_Information ) {
- printf( "Period statistics library is not initialized\n" );
- return;
- }
-
- printf( "Period information by period\n" );
- printf( " ID OWNER PERIODS MISSED CPU TIME WALL TIME\n" );
-
- /*
- * RTEMS does not use an index of zero for object ids.
- */
-
- for ( i=1 ;
- i<_Configuration_Table->RTEMS_api_configuration->maximum_periods ;
- i++ ) {
- the_usage = &Period_usage_Information[ i ];
- if ( the_usage->count == 0 )
- continue;
-
- the_period =
- (Rate_monotonic_Control *)_Rate_monotonic_Information.local_table[ i ];
-
- if ( the_period->owner )
- u32_name = *(unsigned32 *)the_period->owner->Object.name;
- else
- u32_name = rtems_build_name(' ', ' ', ' ', ' ');
-
- name[ 0 ] = (u32_name >> 24) & 0xff;
- name[ 1 ] = (u32_name >> 16) & 0xff;
- name[ 2 ] = (u32_name >> 8) & 0xff;
- name[ 3 ] = (u32_name >> 0) & 0xff;
- name[ 4 ] = '\0';
-
- printf(
- "0x%08x %4s %6d %3d %d/%d/%5.2f %d/%d/%3.2f\n",
- the_usage->id,
- name,
- the_usage->count,
- the_usage->missed_count,
- the_usage->min_cpu_time,
- the_usage->max_cpu_time,
- (double) the_usage->total_cpu_time / (double) the_usage->count,
- the_usage->min_wall_time,
- the_usage->max_wall_time,
- (double) the_usage->total_wall_time / (double) the_usage->count
- );
- }
-}
diff --git a/c/src/libmisc/rtmonuse/rtmonuse.h b/c/src/libmisc/rtmonuse/rtmonuse.h
deleted file mode 100644
index f0580a4f0b..0000000000
--- a/c/src/libmisc/rtmonuse/rtmonuse.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef __RATE_MONOTONIC_USAGE_h
-#define __RATE_MONOTONIC_USAGE_h
-
-void Period_usage_Initialize( void );
-
-void Period_usage_Reset( void );
-
-void Period_usage_Update(
- rtems_id id
-);
-
-void Period_usage_Dump( void );
-
-#endif
diff --git a/c/src/libmisc/stackchk/Makefile.in b/c/src/libmisc/stackchk/Makefile.in
deleted file mode 100644
index 2708e825bc..0000000000
--- a/c/src/libmisc/stackchk/Makefile.in
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIB=${ARCH}/libstackchk-tmp.a
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=check
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=internal.h
-INSTALLED_H_FILES=$(srcdir)/stackchk.h
-
-SRCS=$(C_FILES) $(H_FILES) $(INSTALLED_H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${LIB}: ${SRCS} ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL) -m 444 ${INSTALLED_H_FILES} $(PROJECT_INCLUDE)
diff --git a/c/src/libmisc/stackchk/README b/c/src/libmisc/stackchk/README
deleted file mode 100644
index 0f6e2f2b10..0000000000
--- a/c/src/libmisc/stackchk/README
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# $Id$
-#
-
-Introduction
-============
-
-This directory contains a stack bounds checker. It provides two
-primary features:
-
- + check for stack overflow at each context switch
- + provides an educated guess at each task's stack usage
-
-Enabling
-========
-
-Add the stack checker extension to the initial user extension set.
-If using confdefs.h to build your configuration table, this is
-as simple as adding -DSTACK_CHECK_ON to the gcc command line which
-compiles the file defining the configuration table. In the RTEMS
-test suites and samples, this is always init.c
-
-Background
-==========
-
-The stack overflow check at context switch works by looking for
-a 16 byte pattern at the logical end of the stack to be corrupted.
-The "guesser" assumes that the entire stack was prefilled with a known
-pattern and assumes that the pattern is still in place if the memory
-has not been used as a stack.
-
-Both of these can be fooled by pushing large holes onto the stack
-and not writing to them... or (much more unlikely) writing the
-magic patterns into memory.
-
-This code has not been extensively tested. It is provided as a tool
-for RTEMS users to catch the most common mistake in multitasking
-systems ... too little stack space. Suggestions and comments are appreciated.
-
-NOTES:
-
-1. Stack usage information is questionable on CPUs which push
- large holes on stack.
-
-2. The stack checker has a tendency to generate a fault when
- trying to print the helpful diagnostic message. If it comes
- out, congratulations. If not, then the variable Stack_check_Blown_task
- contains a pointer to the TCB of the offending task. This
- is usually enough to go on.
-
-FUTURE:
-
-1. Determine how/if gcc will generate stack probe calls and support that.
-
-2. Get accurate stack usage numbers on i960.. it pushes very large
- holes on the stack.
diff --git a/c/src/libmisc/stackchk/check.c b/c/src/libmisc/stackchk/check.c
deleted file mode 100644
index 5bfb69bfb6..0000000000
--- a/c/src/libmisc/stackchk/check.c
+++ /dev/null
@@ -1,535 +0,0 @@
-/*
- * Stack Overflow Check User Extension Set
- *
- * NOTE: This extension set automatically determines at
- * initialization time whether the stack for this
- * CPU grows up or down and installs the correct
- * extension routines for that direction.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-/*
- * HACK
- * the stack dump information should be printed by a "fatal" extension.
- * Fatal extensions only get called via rtems_fatal_error_occurred()
- * and not when rtems_shutdown_executive() is called.
- * I hope/think this is changing so that fatal extensions are renamed
- * to "shutdown" extensions.
- * When that happens, this #define should be deleted and all the code
- * it marks.
- */
-#define DONT_USE_FATAL_EXTENSION
-
-
-extern rtems_configuration_table BSP_Configuration;
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "stackchk.h"
-#include "internal.h"
-
-/*
- * This variable contains the name of the task which "blew" the stack.
- * It is NULL if the system is all right.
- */
-
-Thread_Control *Stack_check_Blown_task;
-
-/*
- * The extension table for the stack checker.
- */
-
-rtems_extensions_table Stack_check_Extension_table = {
- Stack_check_Create_extension, /* rtems_task_create */
- 0, /* rtems_task_start */
- 0, /* rtems_task_restart */
- 0, /* rtems_task_delete */
- Stack_check_Switch_extension, /* task_switch */
- Stack_check_Begin_extension, /* task_begin */
- 0, /* task_exitted */
-#ifdef DONT_USE_FATAL_EXTENSION
- 0, /* fatal */
-#else
- Stack_check_Fatal_extension, /* fatal */
-#endif
-};
-
-/*
- * The "magic pattern" used to mark the end of the stack.
- */
-
-Stack_check_Control Stack_check_Pattern;
-
-/*
- * Where the pattern goes in the stack area is dependent upon
- * whether the stack grow to the high or low area of the memory.
- *
- */
-
-#if ( CPU_STACK_GROWS_UP == TRUE )
-
-#define Stack_check_Get_pattern_area( _the_stack ) \
- ((Stack_check_Control *) ((char *)(_the_stack)->area + \
- (_the_stack)->size - sizeof( Stack_check_Control ) ))
-
-#define Stack_check_Calculate_used( _low, _size, _high_water ) \
- ((char *)(_high_water) - (char *)(_low))
-
-#define Stack_check_usable_stack_start(_the_stack) \
- ((_the_stack)->area)
-
-#else
-
-#define Stack_check_Get_pattern_area( _the_stack ) \
- ((Stack_check_Control *) ((char *)(_the_stack)->area + HEAP_OVERHEAD))
-
-#define Stack_check_Calculate_used( _low, _size, _high_water) \
- ( ((char *)(_low) + (_size)) - (char *)(_high_water) )
-
-#define Stack_check_usable_stack_start(_the_stack) \
- ((char *)(_the_stack)->area + sizeof(Stack_check_Control))
-
-#endif
-
-#define Stack_check_usable_stack_size(_the_stack) \
- ((_the_stack)->size - sizeof(Stack_check_Control))
-
-
-/*
- * Do we have an interrupt stack?
- * XXX it would sure be nice if the interrupt stack were also
- * stored in a "stack" structure!
- */
-
-
-Stack_Control stack_check_interrupt_stack;
-
-/*
- * Prototypes necessary for forward references
- */
-
-void Stack_check_Dump_usage( void );
-
-/*
- * Fill an entire stack area with BYTE_PATTERN.
- * This will be used by a Fatal extension to check for
- * amount of actual stack used
- */
-
-void
-stack_check_dope_stack(Stack_Control *stack)
-{
- memset(stack->area, BYTE_PATTERN, stack->size);
-}
-
-
-/*PAGE
- *
- * Stack_check_Initialize
- */
-
-unsigned32 stack_check_initialized = 0;
-
-void Stack_check_Initialize( void )
-{
-#if 0
- rtems_status_code status;
- Objects_Id id_ignored;
-#endif
- unsigned32 *p;
-#if 0
- unsigned32 i;
- unsigned32 class_index;
- Thread_Control *the_thread;
- Objects_Information *information;
-#endif
-
- if (stack_check_initialized)
- return;
-
- /*
- * Dope the pattern and fill areas
- */
-
- for ( p = Stack_check_Pattern.pattern;
- p < &Stack_check_Pattern.pattern[PATTERN_SIZE_WORDS];
- p += 4
- )
- {
- p[0] = 0xFEEDF00D; /* FEED FOOD to BAD DOG */
- p[1] = 0x0BAD0D06;
- p[2] = 0xDEADF00D; /* DEAD FOOD GOOD DOG */
- p[3] = 0x600D0D06;
- };
-
-#if 0
- status = rtems_extension_create(
- rtems_build_name( 'S', 'T', 'C', 'K' ),
- &Stack_check_Extension_table,
- &id_ignored
- );
- assert ( status == RTEMS_SUCCESSFUL );
-#endif
-
- Stack_check_Blown_task = 0;
-
- /*
- * If installed by a task, that task will not get setup properly
- * since it missed out on the create hook. This will cause a
- * failure on first switch out of that task.
- * So pretend here that we actually ran create and begin extensions.
- */
-
- /* XXX
- *
- * Technically this has not been done for any task created before this
- * happened. So just run through them and fix the situation.
- */
-#if 0
- if (_Thread_Executing)
- {
- Stack_check_Create_extension(_Thread_Executing, _Thread_Executing);
- }
-#endif
-
-#if 0
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
- Stack_check_Create_extension( the_thread, the_thread );
- }
- }
- }
-#endif
-
- /*
- * If appropriate, setup the interrupt stack for high water testing
- * also.
- */
- if (_CPU_Interrupt_stack_low && _CPU_Interrupt_stack_high)
- {
- stack_check_interrupt_stack.area = _CPU_Interrupt_stack_low;
- stack_check_interrupt_stack.size = (char *) _CPU_Interrupt_stack_high -
- (char *) _CPU_Interrupt_stack_low;
-
- stack_check_dope_stack(&stack_check_interrupt_stack);
- }
-
-#ifdef DONT_USE_FATAL_EXTENSION
-#ifdef RTEMS_DEBUG
- /*
- * this would normally be called by a fatal extension
- * handler, but we don't run fatal extensions unless
- * we fatal error.
- */
- atexit(Stack_check_Dump_usage);
-#endif
-#endif
-
- stack_check_initialized = 1;
-}
-
-/*PAGE
- *
- * Stack_check_Create_extension
- */
-
-boolean Stack_check_Create_extension(
- Thread_Control *running,
- Thread_Control *the_thread
-)
-{
- if (!stack_check_initialized)
- Stack_check_Initialize();
-
- if (the_thread /* XXX && (the_thread != _Thread_Executing) */ )
- stack_check_dope_stack(&the_thread->Start.Initial_stack);
-
- return TRUE;
-}
-
-/*PAGE
- *
- * Stack_check_Begin_extension
- */
-
-void Stack_check_Begin_extension(
- Thread_Control *the_thread
-)
-{
- Stack_check_Control *the_pattern;
-
- if (!stack_check_initialized)
- Stack_check_Initialize();
-
- if ( the_thread->Object.id == 0 ) /* skip system tasks */
- return;
-
- the_pattern = Stack_check_Get_pattern_area(&the_thread->Start.Initial_stack);
-
- *the_pattern = Stack_check_Pattern;
-}
-
-/*PAGE
- *
- * Stack_check_report_blown_task
- * Report a blown stack. Needs to be a separate routine
- * so that interrupt handlers can use this too.
- *
- * Caller must have set the Stack_check_Blown_task.
- *
- * NOTE: The system is in a questionable state... we may not get
- * the following message out.
- */
-
-void Stack_check_report_blown_task(void)
-{
- Stack_Control *stack;
- Thread_Control *running;
-
- running = Stack_check_Blown_task;
- stack = &running->Start.Initial_stack;
-
- fprintf(
- stderr,
- "BLOWN STACK!!! Offending task(%p): id=0x%08x; name=0x%08x",
- running,
- running->Object.id,
- *(unsigned32 *)running->Object.name
- );
- fflush(stderr);
-
- if (BSP_Configuration.User_multiprocessing_table)
- fprintf(
- stderr,
- "; node=%d\n",
- BSP_Configuration.User_multiprocessing_table->node
- );
- else
- fprintf(stderr, "\n");
- fflush(stderr);
-
- fprintf(
- stderr,
- " stack covers range 0x%08x - 0x%08x (%d bytes)\n",
- (unsigned32) stack->area,
- (unsigned32) stack->area + stack->size - 1,
- (unsigned32) stack->size);
- fflush(stderr);
-
- fprintf(
- stderr,
- " Damaged pattern begins at 0x%08x and is %d bytes long\n",
- (unsigned32) Stack_check_Get_pattern_area(stack), PATTERN_SIZE_BYTES);
- fflush(stderr);
-
- rtems_fatal_error_occurred( (unsigned32) "STACK BLOWN" );
-}
-
-/*PAGE
- *
- * Stack_check_Switch_extension
- */
-
-void Stack_check_Switch_extension(
- Thread_Control *running,
- Thread_Control *heir
-)
-{
- if ( running->Object.id == 0 ) /* skip system tasks */
- return;
-
- if (0 != memcmp( (void *) Stack_check_Get_pattern_area( &running->Start.Initial_stack)->pattern,
- (void *) Stack_check_Pattern.pattern,
- PATTERN_SIZE_BYTES))
- {
- Stack_check_Blown_task = running;
- Stack_check_report_blown_task();
- }
-}
-
-void *Stack_check_find_high_water_mark(
- const void *s,
- size_t n
-)
-{
- const unsigned32 *base, *ebase;
- unsigned32 length;
-
- base = s;
- length = n/4;
-
-#if ( CPU_STACK_GROWS_UP == TRUE )
- /*
- * start at higher memory and find first word that does not
- * match pattern
- */
-
- base += length - 1;
- for (ebase = s; base > ebase; base--)
- if (*base != U32_PATTERN)
- return (void *) base;
-#else
- /*
- * start at lower memory and find first word that does not
- * match pattern
- */
-
- base += PATTERN_SIZE_WORDS;
- for (ebase = base + length; base < ebase; base++)
- if (*base != U32_PATTERN)
- return (void *) base;
-#endif
-
- return (void *)0;
-}
-
-/*PAGE
- *
- * Stack_check_Dump_threads_usage
- * Try to print out how much stack was actually used by the task.
- *
- */
-
-void Stack_check_Dump_threads_usage(
- Thread_Control *the_thread
-)
-{
- unsigned32 size, used;
- void *low;
- void *high_water_mark;
- Stack_Control *stack;
- unsigned32 u32_name;
- char name[5];
-
-
- if ( !the_thread )
- return;
-
- /*
- * XXX HACK to get to interrupt stack
- */
-
- if (the_thread == (Thread_Control *) -1)
- {
- if (stack_check_interrupt_stack.area)
- {
- stack = &stack_check_interrupt_stack;
- the_thread = 0;
- }
- else
- return;
- }
- else
- stack = &the_thread->Start.Initial_stack;
-
- low = Stack_check_usable_stack_start(stack);
- size = Stack_check_usable_stack_size(stack);
-
- high_water_mark = Stack_check_find_high_water_mark(low, size);
-
- if ( high_water_mark )
- used = Stack_check_Calculate_used( low, size, high_water_mark );
- else
- used = 0;
-
- if ( the_thread )
- u32_name = *(unsigned32 *)the_thread->Object.name;
- else
- u32_name = rtems_build_name('I', 'N', 'T', 'R');
-
- name[ 0 ] = (u32_name >> 24) & 0xff;
- name[ 1 ] = (u32_name >> 16) & 0xff;
- name[ 2 ] = (u32_name >> 8) & 0xff;
- name[ 3 ] = (u32_name >> 0) & 0xff;
- name[ 4 ] = '\0';
-
- printf( "0x%08x %4s 0x%08x 0x%08x %8d %8d\n",
- the_thread ? the_thread->Object.id : ~0,
- name,
- (unsigned32) stack->area,
- (unsigned32) stack->area + (unsigned32) stack->size - 1,
- size,
- used
- );
-}
-
-/*PAGE
- *
- * Stack_check_Fatal_extension
- */
-
-void Stack_check_Fatal_extension(
- Internal_errors_Source source,
- boolean is_internal,
- unsigned32 status
-)
-{
-#ifndef DONT_USE_FATAL_EXTENSION
- if (status == 0)
- Stack_check_Dump_usage();
-#endif
-}
-
-
-/*PAGE
- *
- * Stack_check_Dump_usage
- */
-
-void Stack_check_Dump_usage( void )
-{
- unsigned32 i;
- unsigned32 class_index;
- Thread_Control *the_thread;
- unsigned32 hit_running = 0;
- Objects_Information *information;
-
- if (stack_check_initialized == 0)
- return;
-
- printf("Stack usage by thread\n");
- printf(
- " ID NAME LOW HIGH AVAILABLE USED\n"
- );
-
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
- Stack_check_Dump_threads_usage( the_thread );
- if ( the_thread == _Thread_Executing )
- hit_running = 1;
- }
- }
- }
-
- if ( !hit_running )
- Stack_check_Dump_threads_usage( _Thread_Executing );
-
- /* dump interrupt stack info if any */
- Stack_check_Dump_threads_usage((Thread_Control *) -1);
-}
-
diff --git a/c/src/libmisc/stackchk/internal.h b/c/src/libmisc/stackchk/internal.h
deleted file mode 100644
index 96d0c3f10a..0000000000
--- a/c/src/libmisc/stackchk/internal.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* internal.h
- *
- * This include file contains internal information
- * for the RTEMS stack checker.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INTERNAL_STACK_CHECK_h
-#define __INTERNAL_STACK_CHECK_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This structure is used to fill in and compare the "end of stack"
- * marker pattern.
- * pattern area must be a multiple of 4 words.
- */
-
-#ifdef CPU_STACK_CHECK_SIZE
-#define PATTERN_SIZE_WORDS (((CPU_STACK_CHECK_SIZE / 4) + 3) & ~0x3)
-#else
-#define PATTERN_SIZE_WORDS 4
-#endif
-
-#define PATTERN_SIZE_BYTES (PATTERN_SIZE_WORDS * 4)
-
-typedef struct {
- unsigned32 pattern[ PATTERN_SIZE_WORDS ];
-} Stack_check_Control;
-
-/*
- * The pattern used to fill the entire stack.
- */
-
-#define BYTE_PATTERN 0xA5
-#define U32_PATTERN 0xA5A5A5A5
-
-/*
- * Stack_check_Create_extension
- */
-
-boolean Stack_check_Create_extension(
- Thread_Control *running,
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Begin_extension
- */
-
-void Stack_check_Begin_extension(
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Switch_extension
- */
-
-void Stack_check_Switch_extension(
- Thread_Control *running,
- Thread_Control *heir
-);
-
-/*
- * Stack_check_Fatal_extension
- */
-
-void Stack_check_Fatal_extension(
- Internal_errors_Source source,
- boolean is_internal,
- unsigned32 status
-);
-
-/*
- * Stack_check_Dump_usage
- */
-
-void Stack_check_Dump_usage( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/libmisc/stackchk/stackchk.h b/c/src/libmisc/stackchk/stackchk.h
deleted file mode 100644
index 1b40da5e0c..0000000000
--- a/c/src/libmisc/stackchk/stackchk.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* stackchk.h
- *
- * This include file contains information necessary to utilize
- * and install the stack checker mechanism.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STACK_CHECK_h
-#define __STACK_CHECK_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Stack_check_Initialize
- */
-
-void Stack_check_Initialize( void );
-
-/*
- * Stack_check_Dump_usage
- */
-
-void Stack_check_Dump_usage( void );
-
-/*
- * Stack_check_Create_extension
- */
-
-boolean Stack_check_Create_extension(
- Thread_Control *running,
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Begin_extension
- */
-
-void Stack_check_Begin_extension(
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Switch_extension
- */
-
-void Stack_check_Switch_extension(
- Thread_Control *running,
- Thread_Control *heir
-);
-
-/*
- * Extension set definition
- */
-
-#define STACK_CHECKER_EXTENSION \
-{ \
- Stack_check_Create_extension, /* rtems_task_create */ \
- 0, /* rtems_task_start */ \
- 0, /* rtems_task_restart */ \
- 0, /* rtems_task_delete */ \
- Stack_check_Switch_extension, /* task_switch */ \
- Stack_check_Begin_extension, /* task_begin */ \
- 0, /* task_exitted */ \
- 0 /* Stack_check_Fatal_extension */, /* fatal */ \
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/libmisc/wrapup/Makefile.in b/c/src/libmisc/wrapup/Makefile.in
deleted file mode 100644
index 6a78cf222a..0000000000
--- a/c/src/libmisc/wrapup/Makefile.in
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIB=$(ARCH)/libmisc.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-# Using the wildcard on the Purify support makes sure it may not be there
-
-LIBS=../monitor/$(ARCH)/libmonitor-tmp.a \
- ../error/$(ARCH)/liberror-tmp.a \
- ../assoc/$(ARCH)/libassoc-tmp.a \
- ../stackchk/$(ARCH)/libstackchk-tmp.a \
- ../cpuuse/$(ARCH)/libcpuuse-tmp.a \
- ../rtmonuse/$(ARCH)/librtmonuse-tmp.a \
- $(wildcard ../purify/$(ARCH)/libpurify-tmp.a)
-RELS=
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${LIBS} $(RELS)
- $(RM) -r $(ARCH)
- $(MKDIR) $(ARCH)
- cd $(ARCH); for lib in $(LIBS:%=../%); do \
- $(AR) -xv $$lib; \
- done
- $(RM) $@
- $(AR) ruv $@ $(ARCH)/*
- $(MKLIB) $@
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/libnetworking/CHANGELOG b/c/src/libnetworking/CHANGELOG
deleted file mode 100644
index dd504eb885..0000000000
--- a/c/src/libnetworking/CHANGELOG
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-19-AUG-1998 snapshot
- - Pulled BOOTP initialization out of rtems_glue. Applications which
- don't used BOOTP are now about 5k smaller.
- - Loopback interface is not installed by default, rather it is
- attached like any other interface. Saves about 0.5 kbytes.
- - Add rtems_bsdnet_show_if_stats();
- - Moved test programs from below freebsd directory.
-
-18-AUG-1998 snapshot
- - Removed some include files that were already part of RTEMS.
- - Cleaned up machine/types.h to prepare for inclusion in RTEMS source.
- - Added syslog library routines -- much simpler than KA9Q version.
- Sockets can be shared among tasks (as long as the send is
- protected by a mutex) so there's no need for a Syslog Daemon.
-
-16-AUG-1998 snapshot
- - Table-driven configuration (networkconfig.h).
- - Cleaned up rtems_bsdnet.h.
- - BOOTP now retries properly -- Note to Joel:
- The dichotomy between RTEMS and UNIX error codes is
- a real pain!
-
-14-AUG-1998 snapshot
- - Added dummy getprotobyname() and getprotobynum() functions.
- - Added socket ioctl.
- - Added application-level entry to manipulate routing tables.
- - Added non-BOOTP network initialization.
-
-13-AUG-1998 snapshot
- - Changed some BOOTP addresses from sockaddr_in to inaddr;
- - Get DNS information from BOOTP reply.
- - Got DNS lookups working.
- Bloatware comes to RTEMS -- invoking gethostbyname() drags in
- and extra 40 kbytes of code!
- - Added hostname lookup program.
-
-12-AUG-1998 snapshot
- - Added startup delay to network initialization.
- - More statistic-printing routines.
- - Added TFTP driver and test program
- - Modified TFTP test program to use networkconfig.h.
- - Removed unused include files.
- - Added from ftp://ftp.ca.FreeBSD.ORG/pub/FreeBSD/FreeBSD-current/src/lib/libc/net.
-
-11-AUG-1998 snapshot.
- - Added getpeername()
- - Added M68k versions of IP checksum code
- - Added TCP timing program to snapshot.
-
-02-AUG-1998 snapshot.
diff --git a/c/src/libnetworking/Makefile.in b/c/src/libnetworking/Makefile.in
deleted file mode 100644
index 7fce70b9aa..0000000000
--- a/c/src/libnetworking/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=kern lib libc net netinet nfs rtems wrapup
diff --git a/c/src/libnetworking/README b/c/src/libnetworking/README
deleted file mode 100644
index d0c22ec688..0000000000
--- a/c/src/libnetworking/README
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# $Id$
-#
-
-This is a snapshot of my attempt to fit the FreeBSD networking code into
-RTEMS. Things seem to be working!
-
-Things that need to be done:
- 1) More documentation!
- 2) Figure out what's still not working :-)
- 3) Rationalize the include files. Right now I have a special
- hack in the Makefile to ensure that I pick up the FreeBSD versions
- of the include files that are duplicated between RTEMS
- and FreeBSD.
- The network device driver source should move to the BSP source tree.
- 4) Have a look at all the FIXME comments.
- 5) Go through and make sure that all the source files are
- free of undesired copyright restrictions.
diff --git a/c/src/libnetworking/arpa/ftp.h b/c/src/libnetworking/arpa/ftp.h
deleted file mode 100644
index 584d290bc9..0000000000
--- a/c/src/libnetworking/arpa/ftp.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 1983, 1989, 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.
- *
- * @(#)ftp.h 8.1 (Berkeley) 6/2/93
- *
- * $Id$
- */
-
-#ifndef _ARPA_FTP_H_
-#define _ARPA_FTP_H_
-
-/* Definitions for FTP; see RFC-765. */
-
-/*
- * 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 */
-
-/*
- * Type codes
- */
-#define TYPE_A 1 /* ASCII */
-#define TYPE_E 2 /* EBCDIC */
-#define TYPE_I 3 /* image */
-#define TYPE_L 4 /* local byte size */
-
-#ifdef FTP_NAMES
-char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
-#endif
-
-/*
- * Form codes
- */
-#define FORM_N 1 /* non-print */
-#define FORM_T 2 /* telnet format effectors */
-#define FORM_C 3 /* carriage control (ASA) */
-#ifdef FTP_NAMES
-char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
-#endif
-
-/*
- * Structure codes
- */
-#define STRU_F 1 /* file (no record structure) */
-#define STRU_R 2 /* record structure */
-#define STRU_P 3 /* page structure */
-#ifdef FTP_NAMES
-char *strunames[] = {"0", "File", "Record", "Page" };
-#endif
-
-/*
- * Mode types
- */
-#define MODE_S 1 /* stream */
-#define MODE_B 2 /* block */
-#define MODE_C 3 /* compressed */
-#ifdef FTP_NAMES
-char *modenames[] = {"0", "Stream", "Block", "Compressed" };
-#endif
-
-/*
- * Record Tokens
- */
-#define REC_ESC '\377' /* Record-mode Escape */
-#define REC_EOR '\001' /* Record-mode End-of-Record */
-#define REC_EOF '\002' /* Record-mode End-of-File */
-
-/*
- * Block Header
- */
-#define BLK_EOR 0x80 /* Block is End-of-Record */
-#define BLK_EOF 0x40 /* Block is End-of-File */
-#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
-#define BLK_RESTART 0x10 /* Block is Restart Marker */
-
-#define BLK_BYTECOUNT 2 /* Bytes in this block */
-
-#endif /* !_FTP_H_ */
diff --git a/c/src/libnetworking/arpa/inet.h b/c/src/libnetworking/arpa/inet.h
deleted file mode 100644
index ad5332e7ab..0000000000
--- a/c/src/libnetworking/arpa/inet.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * @(#)inet.h 8.1 (Berkeley) 6/2/93
- * From: Id: inet.h,v 8.5 1997/01/29 08:48:09 vixie Exp $
- * $Id$
- */
-
-#ifndef _ARPA_INET_H_
-#define _ARPA_INET_H_
-
-/* External definitions for functions in inet(3), addr2ascii(3) */
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-struct in_addr;
-
-#if 0 /* RTEMS -- Why rename these? */
-/* XXX all new diversions!! argh!! */
-#define inet_addr __inet_addr
-#define inet_aton __inet_aton
-#define inet_lnaof __inet_lnaof
-#define inet_makeaddr __inet_makeaddr
-#define inet_neta __inet_neta
-#define inet_netof __inet_netof
-#define inet_network __inet_network
-#define inet_net_ntop __inet_net_ntop
-#define inet_net_pton __inet_net_pton
-#define inet_ntoa __inet_ntoa
-#define inet_pton __inet_pton
-#define inet_ntop __inet_ntop
-#define inet_nsap_addr __inet_nsap_addr
-#define inet_nsap_ntoa __inet_nsap_ntoa
-#endif
-
-__BEGIN_DECLS
-int ascii2addr __P((int, const char *, void *));
-char *addr2ascii __P((int, const void *, int, char *));
-unsigned long inet_addr __P((const char *));
-int inet_aton __P((const char *, struct in_addr *));
-unsigned long inet_lnaof __P((struct in_addr));
-struct in_addr inet_makeaddr __P((u_long , u_long));
-char * inet_neta __P((u_long, char *, size_t));
-unsigned long inet_netof __P((struct in_addr));
-unsigned long inet_network __P((const char *));
-char *inet_net_ntop __P((int, const void *, int, char *, size_t));
-int inet_net_pton __P((int, const char *, void *, size_t));
-char *inet_ntoa __P((struct in_addr));
-int inet_pton __P((int, const char *, void *));
-const char *inet_ntop __P((int, const void *, char *, size_t));
-u_int inet_nsap_addr __P((const char *, u_char *, int));
-char *inet_nsap_ntoa __P((int, const u_char *, char *));
-__END_DECLS
-
-#endif /* !_INET_H_ */
diff --git a/c/src/libnetworking/arpa/nameser.h b/c/src/libnetworking/arpa/nameser.h
deleted file mode 100644
index 634dece37b..0000000000
--- a/c/src/libnetworking/arpa/nameser.h
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
- * Copyright (c) 1983, 1989, 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.
- */
-
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * From: Id: nameser.h,v 8.16 1998/02/06 00:35:58 halley Exp
- * $Id$
- */
-
-#ifndef _ARPA_NAMESER_H_
-#define _ARPA_NAMESER_H_
-
-#define BIND_4_COMPAT
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-/*
- * revision information. this is the release date in YYYYMMDD format.
- * it can change every day so the right thing to do with it is use it
- * in preprocessor commands such as "#if (__NAMESER > 19931104)". do not
- * compare for equality; rather, use it to determine whether your libnameser.a
- * is new enough to contain a certain feature.
- */
-
-/* XXXRTH I made this bigger than __BIND in 4.9.5 T6B */
-#define __NAMESER 19961001 /* New interface version stamp. */
-
-/*
- * Define constants based on RFC 883, RFC 1034, RFC 1035
- */
-#define NS_PACKETSZ 512 /* maximum packet size */
-#define NS_MAXDNAME 1025 /* maximum domain name */
-#define NS_MAXCDNAME 255 /* maximum compressed domain name */
-#define NS_MAXLABEL 63 /* maximum length of domain label */
-#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
-#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
-#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
-#define NS_INT32SZ 4 /* #/bytes of data in a u_int32_t */
-#define NS_INT16SZ 2 /* #/bytes of data in a u_int16_t */
-#define NS_INT8SZ 1 /* #/bytes of data in a u_int8_t */
-#define NS_INADDRSZ 4 /* IPv4 T_A */
-#define NS_IN6ADDRSZ 16 /* IPv6 T_AAAA */
-#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
-#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
-
-/*
- * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()
- * in synch with it.
- */
-typedef enum __ns_sect {
- ns_s_qd = 0, /* Query: Question. */
- ns_s_zn = 0, /* Update: Zone. */
- ns_s_an = 1, /* Query: Answer. */
- ns_s_pr = 1, /* Update: Prerequisites. */
- ns_s_ns = 2, /* Query: Name servers. */
- ns_s_ud = 2, /* Update: Update. */
- ns_s_ar = 3, /* Query|Update: Additional records. */
- ns_s_max = 4
-} ns_sect;
-
-/*
- * This is a message handle. It is caller allocated and has no dynamic data.
- * This structure is intended to be opaque to all but ns_parse.c, thus the
- * leading _'s on the member names. Use the accessor functions, not the _'s.
- */
-typedef struct __ns_msg {
- const u_char *_msg, *_eom;
- u_int16_t _id, _flags, _counts[ns_s_max];
- const u_char *_sections[ns_s_max];
- ns_sect _sect;
- int _rrnum;
- const u_char *_ptr;
-} ns_msg;
-
-/* Private data structure - do not use from outside library. */
-struct _ns_flagdata { int mask, shift; };
-extern struct _ns_flagdata _ns_flagdata[];
-
-/* Accessor macros - this is part of the public interface. */
-#define ns_msg_getflag(handle, flag) ( \
- ((handle)._flags & _ns_flagdata[flag].mask) \
- >> _ns_flagdata[flag].shift \
- )
-#define ns_msg_id(handle) ((handle)._id + 0)
-#define ns_msg_base(handle) ((handle)._msg + 0)
-#define ns_msg_end(handle) ((handle)._eom + 0)
-#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
-#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
-
-/*
- * This is a parsed record. It is caller allocated and has no dynamic data.
- */
-typedef struct __ns_rr {
- char name[NS_MAXDNAME]; /* XXX need to malloc */
- u_int16_t type;
- u_int16_t class;
- u_int32_t ttl;
- u_int16_t rdlength;
- const u_char *rdata;
-} ns_rr;
-
-/* Accessor macros - this is part of the public interface. */
-#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
-#define ns_rr_type(rr) ((rr).type + 0)
-#define ns_rr_class(rr) ((rr).class + 0)
-#define ns_rr_ttl(rr) ((rr).ttl + 0)
-#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
-#define ns_rr_rdata(rr) ((rr).rdata + 0)
-
-/*
- * These don't have to be in the same order as in the packet flags word,
- * and they can even overlap in some cases, but they will need to be kept
- * in synch with ns_parse.c:ns_flagdata[].
- */
-typedef enum __ns_flag {
- ns_f_qr, /* Question/Response. */
- ns_f_opcode, /* Operation code. */
- ns_f_aa, /* Authoritative Answer. */
- ns_f_tc, /* Truncation occurred. */
- ns_f_rd, /* Recursion Desired. */
- ns_f_ra, /* Recursion Available. */
- ns_f_z, /* MBZ. */
- ns_f_ad, /* Authentic Data (DNSSEC). */
- ns_f_cd, /* Checking Disabled (DNSSEC). */
- ns_f_rcode, /* Response code. */
- ns_f_max
-} ns_flag;
-
-/*
- * Currently defined opcodes.
- */
-typedef enum __ns_opcode {
- ns_o_query = 0, /* Standard query. */
- ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
- ns_o_status = 2, /* Name server status query (unsupported). */
- /* Opcode 3 is undefined/reserved. */
- ns_o_notify = 4, /* Zone change notification. */
- ns_o_update = 5, /* Zone update message. */
- ns_o_max = 6
-} ns_opcode;
-
-/*
- * Currently defined response codes.
- */
-typedef enum __ns_rcode {
- ns_r_noerror = 0, /* No error occurred. */
- ns_r_formerr = 1, /* Format error. */
- ns_r_servfail = 2, /* Server failure. */
- ns_r_nxdomain = 3, /* Name error. */
- ns_r_notimpl = 4, /* Unimplemented. */
- ns_r_refused = 5, /* Operation refused. */
- /* these are for BIND_UPDATE */
- ns_r_yxdomain = 6, /* Name exists */
- ns_r_yxrrset = 7, /* RRset exists */
- ns_r_nxrrset = 8, /* RRset does not exist */
- ns_r_notauth = 9, /* Not authoritative for zone */
- ns_r_notzone = 10, /* Zone of record different from zone section */
- ns_r_max = 11
-} ns_rcode;
-
-/* BIND_UPDATE */
-typedef enum __ns_update_operation {
- ns_uop_delete = 0,
- ns_uop_add = 1,
- ns_uop_max = 2
-} ns_update_operation;
-
-/*
- * This RR-like structure is particular to UPDATE.
- */
-struct ns_updrec {
- struct ns_updrec *r_prev; /* prev record */
- struct ns_updrec *r_next; /* next record */
- u_int8_t r_section; /* ZONE/PREREQUISITE/UPDATE */
- char * r_dname; /* owner of the RR */
- u_int16_t r_class; /* class number */
- u_int16_t r_type; /* type number */
- u_int32_t r_ttl; /* time to live */
- u_char * r_data; /* rdata fields as text string */
- u_int16_t r_size; /* size of r_data field */
- int r_opcode; /* type of operation */
- /* following fields for private use by the resolver/server routines */
- struct ns_updrec *r_grpnext; /* next record when grouped */
- struct databuf *r_dp; /* databuf to process */
- struct databuf *r_deldp; /* databuf's deleted/overwritten */
- u_int16_t r_zone; /* zone number on server */
-};
-typedef struct ns_updrec ns_updrec;
-
-/*
- * Currently defined type values for resources and queries.
- */
-typedef enum __ns_type {
- ns_t_a = 1, /* Host address. */
- ns_t_ns = 2, /* Authoritative server. */
- ns_t_md = 3, /* Mail destination. */
- ns_t_mf = 4, /* Mail forwarder. */
- ns_t_cname = 5, /* Canonical name. */
- ns_t_soa = 6, /* Start of authority zone. */
- ns_t_mb = 7, /* Mailbox domain name. */
- ns_t_mg = 8, /* Mail group member. */
- ns_t_mr = 9, /* Mail rename name. */
- ns_t_null = 10, /* Null resource record. */
- ns_t_wks = 11, /* Well known service. */
- ns_t_ptr = 12, /* Domain name pointer. */
- ns_t_hinfo = 13, /* Host information. */
- ns_t_minfo = 14, /* Mailbox information. */
- ns_t_mx = 15, /* Mail routing information. */
- ns_t_txt = 16, /* Text strings. */
- ns_t_rp = 17, /* Responsible person. */
- ns_t_afsdb = 18, /* AFS cell database. */
- ns_t_x25 = 19, /* X_25 calling address. */
- ns_t_isdn = 20, /* ISDN calling address. */
- ns_t_rt = 21, /* Router. */
- ns_t_nsap = 22, /* NSAP address. */
- ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
- ns_t_sig = 24, /* Security signature. */
- ns_t_key = 25, /* Security key. */
- ns_t_px = 26, /* X.400 mail mapping. */
- ns_t_gpos = 27, /* Geographical position (withdrawn). */
- ns_t_aaaa = 28, /* Ip6 Address. */
- ns_t_loc = 29, /* Location Information. */
- ns_t_nxt = 30, /* Next domain (security). */
- ns_t_eid = 31, /* Endpoint identifier. */
- ns_t_nimloc = 32, /* Nimrod Locator. */
- ns_t_srv = 33, /* Server Selection. */
- ns_t_atma = 34, /* ATM Address */
- ns_t_naptr = 35, /* Naming Authority PoinTeR */
- /* Query type values which do not appear in resource records. */
- ns_t_ixfr = 251, /* Incremental zone transfer. */
- ns_t_axfr = 252, /* Transfer zone of authority. */
- ns_t_mailb = 253, /* Transfer mailbox records. */
- ns_t_maila = 254, /* Transfer mail agent records. */
- ns_t_any = 255, /* Wildcard match. */
- ns_t_max = 65536
-} ns_type;
-
-/*
- * Values for class field
- */
-typedef enum __ns_class {
- ns_c_in = 1, /* Internet. */
- /* Class 2 unallocated/unsupported. */
- ns_c_chaos = 3, /* MIT Chaos-net. */
- ns_c_hs = 4, /* MIT Hesiod. */
- /* Query class values which do not appear in resource records */
- ns_c_none = 254, /* for prereq. sections in update requests */
- ns_c_any = 255, /* Wildcard match. */
- ns_c_max = 65536
-} ns_class;
-
-/*
- * Flags field of the KEY RR rdata
- */
-#define NS_KEY_TYPEMASK 0xC000 /* Mask for "type" bits */
-#define NS_KEY_TYPE_AUTH_CONF 0x0000 /* Key usable for both */
-#define NS_KEY_TYPE_CONF_ONLY 0x8000 /* Key usable for confidentiality */
-#define NS_KEY_TYPE_AUTH_ONLY 0x4000 /* Key usable for authentication */
-#define NS_KEY_TYPE_NO_KEY 0xC000 /* No key usable for either; no key */
-/* The type bits can also be interpreted independently, as single bits: */
-#define NS_KEY_NO_AUTH 0x8000 /* Key unusable for authentication */
-#define NS_KEY_NO_CONF 0x4000 /* Key unusable for confidentiality */
-#define NS_KEY_EXPERIMENTAL 0x2000 /* Security is *mandatory* if bit=0 */
-#define NS_KEY_RESERVED3 0x1000 /* reserved - must be zero */
-#define NS_KEY_RESERVED4 0x0800 /* reserved - must be zero */
-#define NS_KEY_USERACCOUNT 0x0400 /* key is assoc. with a user acct */
-#define NS_KEY_ENTITY 0x0200 /* key is assoc. with entity eg host */
-#define NS_KEY_ZONEKEY 0x0100 /* key is zone key */
-#define NS_KEY_IPSEC 0x0080 /* key is for IPSEC (host or user)*/
-#define NS_KEY_EMAIL 0x0040 /* key is for email (MIME security) */
-#define NS_KEY_RESERVED10 0x0020 /* reserved - must be zero */
-#define NS_KEY_RESERVED11 0x0010 /* reserved - must be zero */
-#define NS_KEY_SIGNATORYMASK 0x000F /* key can sign RR's of same name */
-
-#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED3 | \
- NS_KEY_RESERVED4 | \
- NS_KEY_RESERVED10 | \
- NS_KEY_RESERVED11 )
-
-/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
-#define NS_ALG_MD5RSA 1 /* MD5 with RSA */
-#define NS_ALG_EXPIRE_ONLY 253 /* No alg, no security */
-#define NS_ALG_PRIVATE_OID 254 /* Key begins with OID giving alg */
-
-/* Signatures */
-#define NS_MD5RSA_MIN_BITS 512 /* Size of a mod or exp in bits */
-#define NS_MD5RSA_MAX_BITS 2552
- /* Total of binary mod and exp */
-#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
- /* Max length of text sig block */
-#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
-
-/* Offsets into SIG record rdata to find various values */
-#define NS_SIG_TYPE 0 /* Type flags */
-#define NS_SIG_ALG 2 /* Algorithm */
-#define NS_SIG_LABELS 3 /* How many labels in name */
-#define NS_SIG_OTTL 4 /* Original TTL */
-#define NS_SIG_EXPIR 8 /* Expiration time */
-#define NS_SIG_SIGNED 12 /* Signature time */
-#define NS_SIG_FOOT 16 /* Key footprint */
-#define NS_SIG_SIGNER 18 /* Domain name of who signed it */
-
-/* How RR types are represented as bit-flags in NXT records */
-#define NS_NXT_BITS 8
-#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
-
-
-/*
- * Inline versions of get/put short/long. Pointer is advanced.
- */
-#define NS_GET16(s, cp) { \
- register u_char *t_cp = (u_char *)(cp); \
- (s) = ((u_int16_t)t_cp[0] << 8) \
- | ((u_int16_t)t_cp[1]) \
- ; \
- (cp) += NS_INT16SZ; \
-}
-
-#define NS_GET32(l, cp) { \
- register u_char *t_cp = (u_char *)(cp); \
- (l) = ((u_int32_t)t_cp[0] << 24) \
- | ((u_int32_t)t_cp[1] << 16) \
- | ((u_int32_t)t_cp[2] << 8) \
- | ((u_int32_t)t_cp[3]) \
- ; \
- (cp) += NS_INT32SZ; \
-}
-
-#define NS_PUT16(s, cp) { \
- register u_int16_t t_s = (u_int16_t)(s); \
- register u_char *t_cp = (u_char *)(cp); \
- *t_cp++ = t_s >> 8; \
- *t_cp = t_s; \
- (cp) += NS_INT16SZ; \
-}
-
-#define NS_PUT32(l, cp) { \
- register u_int32_t t_l = (u_int32_t)(l); \
- register u_char *t_cp = (u_char *)(cp); \
- *t_cp++ = t_l >> 24; \
- *t_cp++ = t_l >> 16; \
- *t_cp++ = t_l >> 8; \
- *t_cp = t_l; \
- (cp) += NS_INT32SZ; \
-}
-
-/*
- * ANSI C identifier hiding.
- */
-#define ns_get16 __ns_get16
-#define ns_get32 __ns_get32
-#define ns_put16 __ns_put16
-#define ns_put32 __ns_put32
-#define ns_initparse __ns_initparse
-#define ns_parserr __ns_parserr
-#define ns_sprintrr __ns_sprintrr
-#define ns_sprintrrf __ns_sprintrrf
-#define ns_format_ttl __ns_format_ttl
-#define ns_parse_ttl __ns_parse_ttl
-#define ns_name_ntop __ns_name_ntop
-#define ns_name_pton __ns_name_pton
-#define ns_name_unpack __ns_name_unpack
-#define ns_name_pack __ns_name_pack
-#define ns_name_compress __ns_name_compress
-#define ns_name_uncompress __ns_name_uncompress
-
-__BEGIN_DECLS
-u_int ns_get16 __P((const u_char *));
-u_long ns_get32 __P((const u_char *));
-void ns_put16 __P((u_int, u_char *));
-void ns_put32 __P((u_long, u_char *));
-int ns_initparse __P((const u_char *, int, ns_msg *));
-int ns_parserr __P((ns_msg *, ns_sect, int, ns_rr *));
-int ns_sprintrr __P((const ns_msg *, const ns_rr *,
- const char *, const char *, char *, size_t));
-int ns_sprintrrf __P((const u_char *, size_t, const char *,
- ns_class, ns_type, u_long, const u_char *,
- size_t, const char *, const char *,
- char *, size_t));
-int ns_format_ttl __P((u_long, char *, size_t));
-int ns_parse_ttl __P((const char *, u_long *));
-int ns_name_ntop __P((const u_char *, char *, size_t));
-int ns_name_pton __P((const char *, u_char *, size_t));
-int ns_name_unpack __P((const u_char *, const u_char *,
- const u_char *, u_char *, size_t));
-int ns_name_pack __P((const u_char *, u_char *, int,
- const u_char **, const u_char **));
-int ns_name_uncompress __P((const u_char *, const u_char *,
- const u_char *, char *, size_t));
-int ns_name_compress __P((const char *, u_char *, size_t,
- const u_char **, const u_char **));
-int ns_name_skip __P((const u_char **, const u_char *));
-__END_DECLS
-
-#ifdef BIND_4_COMPAT
-#include <arpa/nameser_compat.h>
-#endif
-
-#endif /* !_ARPA_NAMESER_H_ */
diff --git a/c/src/libnetworking/arpa/nameser_compat.h b/c/src/libnetworking/arpa/nameser_compat.h
deleted file mode 100644
index 2ab5b47386..0000000000
--- a/c/src/libnetworking/arpa/nameser_compat.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/* Copyright (c) 1983, 1989
- * 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.
- */
-
-/*
- * from nameser.h 8.1 (Berkeley) 6/2/93
- * From: Id: nameser_compat.h,v 8.9 1998/03/20 23:25:10 halley Exp
- * $Id$
- */
-
-#ifndef _ARPA_NAMESER_COMPAT_
-#define _ARPA_NAMESER_COMPAT_
-
-#define __BIND 19950621 /* (DEAD) interface version stamp. */
-
-#include <machine/endian.h>
-
-#if !defined(BYTE_ORDER) || \
- (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
- BYTE_ORDER != PDP_ENDIAN)
- /* you must determine what the correct bit order is for
- * your compiler - the next line is an intentional error
- * which will force your compiles to bomb until you fix
- * the above macros.
- */
- error "Undefined or invalid BYTE_ORDER";
-#endif
-
-/*
- * Structure for query header. The order of the fields is machine- and
- * compiler-dependent, depending on the byte/bit order and the layout
- * of bit fields. We use bit fields only in int variables, as this
- * is all ANSI requires. This requires a somewhat confusing rearrangement.
- */
-
-typedef struct {
- unsigned id :16; /* query identification number */
-#if BYTE_ORDER == BIG_ENDIAN
- /* fields in third byte */
- unsigned qr: 1; /* response flag */
- unsigned opcode: 4; /* purpose of message */
- unsigned aa: 1; /* authoritive answer */
- unsigned tc: 1; /* truncated message */
- unsigned rd: 1; /* recursion desired */
- /* fields in fourth byte */
- unsigned ra: 1; /* recursion available */
- unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
- unsigned ad: 1; /* authentic data from named */
- unsigned cd: 1; /* checking disabled by resolver */
- unsigned rcode :4; /* response code */
-#endif
-#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
- /* fields in third byte */
- unsigned rd :1; /* recursion desired */
- unsigned tc :1; /* truncated message */
- unsigned aa :1; /* authoritive answer */
- unsigned opcode :4; /* purpose of message */
- unsigned qr :1; /* response flag */
- /* fields in fourth byte */
- unsigned rcode :4; /* response code */
- unsigned cd: 1; /* checking disabled by resolver */
- unsigned ad: 1; /* authentic data from named */
- unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
- unsigned ra :1; /* recursion available */
-#endif
- /* remaining bytes */
- unsigned qdcount :16; /* number of question entries */
- unsigned ancount :16; /* number of answer entries */
- unsigned nscount :16; /* number of authority entries */
- unsigned arcount :16; /* number of resource entries */
-} HEADER;
-
-#define PACKETSZ NS_PACKETSZ
-#define MAXDNAME NS_MAXDNAME
-#define MAXCDNAME NS_MAXCDNAME
-#define MAXLABEL NS_MAXLABEL
-#define HFIXEDSZ NS_HFIXEDSZ
-#define QFIXEDSZ NS_QFIXEDSZ
-#define RRFIXEDSZ NS_RRFIXEDSZ
-#define INT32SZ NS_INT32SZ
-#define INT16SZ NS_INT16SZ
-#define INADDRSZ NS_INADDRSZ
-#define IN6ADDRSZ NS_IN6ADDRSZ
-#define INDIR_MASK NS_CMPRSFLGS
-#define NAMESERVER_PORT NS_DEFAULTPORT
-
-#define S_ZONE ns_s_zn
-#define S_PREREQ ns_s_pr
-#define S_UPDATE ns_s_ud
-#define S_ADDT ns_s_ar
-
-#define QUERY ns_o_query
-#define IQUERY ns_o_iquery
-#define STATUS ns_o_status
-#define NS_NOTIFY_OP ns_o_notify
-#define NS_UPDATE_OP ns_o_update
-
-#define NOERROR ns_r_noerror
-#define FORMERR ns_r_formerr
-#define SERVFAIL ns_r_servfail
-#define NXDOMAIN ns_r_nxdomain
-#define NOTIMP ns_r_notimpl
-#define REFUSED ns_r_refused
-#define YXDOMAIN ns_r_yxdomain
-#define YXRRSET ns_r_yxrrset
-#define NXRRSET ns_r_nxrrset
-#define NOTAUTH ns_r_notauth
-#define NOTZONE ns_r_notzone
-
-#define DELETE ns_uop_delete
-#define ADD ns_uop_add
-
-#define T_A ns_t_a
-#define T_NS ns_t_ns
-#define T_MD ns_t_md
-#define T_MF ns_t_mf
-#define T_CNAME ns_t_cname
-#define T_SOA ns_t_soa
-#define T_MB ns_t_mb
-#define T_MG ns_t_mg
-#define T_MR ns_t_mr
-#define T_NULL ns_t_null
-#define T_WKS ns_t_wks
-#define T_PTR ns_t_ptr
-#define T_HINFO ns_t_hinfo
-#define T_MINFO ns_t_minfo
-#define T_MX ns_t_mx
-#define T_TXT ns_t_txt
-#define T_RP ns_t_rp
-#define T_AFSDB ns_t_afsdb
-#define T_X25 ns_t_x25
-#define T_ISDN ns_t_isdn
-#define T_RT ns_t_rt
-#define T_NSAP ns_t_nsap
-#define T_NSAP_PTR ns_t_nsap_ptr
-#define T_SIG ns_t_sig
-#define T_KEY ns_t_key
-#define T_PX ns_t_px
-#define T_GPOS ns_t_gpos
-#define T_AAAA ns_t_aaaa
-#define T_LOC ns_t_loc
-#define T_NXT ns_t_nxt
-#define T_EID ns_t_eid
-#define T_NIMLOC ns_t_nimloc
-#define T_SRV ns_t_srv
-#define T_ATMA ns_t_atma
-#define T_NAPTR ns_t_naptr
-#define T_IXFR ns_t_ixfr
-#define T_AXFR ns_t_axfr
-#define T_MAILB ns_t_mailb
-#define T_MAILA ns_t_maila
-#define T_ANY ns_t_any
-
-#define C_IN ns_c_in
-#define C_CHAOS ns_c_chaos
-#define C_HS ns_c_hs
-/* BIND_UPDATE */
-#define C_NONE ns_c_none
-#define C_ANY ns_c_any
-
-#define GETSHORT NS_GET16
-#define GETLONG NS_GET32
-#define PUTSHORT NS_PUT16
-#define PUTLONG NS_PUT32
-
-#endif /* _ARPA_NAMESER_COMPAT_ */
diff --git a/c/src/libnetworking/arpa/telnet.h b/c/src/libnetworking/arpa/telnet.h
deleted file mode 100644
index 09b85692da..0000000000
--- a/c/src/libnetworking/arpa/telnet.h
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * @(#)telnet.h 8.2 (Berkeley) 12/15/93
- *
- * $Id$
- */
-
-#ifndef _ARPA_TELNET_H_
-#define _ARPA_TELNET_H_
-
-/*
- * Definitions for the TELNET protocol.
- */
-#define IAC 255 /* interpret as command: */
-#define DONT 254 /* you are not to use option */
-#define DO 253 /* please, you use option */
-#define WONT 252 /* I won't use option */
-#define WILL 251 /* I will use option */
-#define SB 250 /* interpret as subnegotiation */
-#define GA 249 /* you may reverse the line */
-#define EL 248 /* erase the current line */
-#define EC 247 /* erase the current character */
-#define AYT 246 /* are you there */
-#define AO 245 /* abort output--but let prog finish */
-#define IP 244 /* interrupt process--permanently */
-#define BREAK 243 /* break */
-#define DM 242 /* data mark--for connect. cleaning */
-#define NOP 241 /* nop */
-#define SE 240 /* end sub negotiation */
-#define EOR 239 /* end of record (transparent mode) */
-#define ABORT 238 /* Abort process */
-#define SUSP 237 /* Suspend process */
-#define xEOF 236 /* End of file: EOF is already used... */
-
-#define SYNCH 242 /* for telfunc calls */
-
-#ifdef TELCMDS
-char *telcmds[] = {
- "EOF", "SUSP", "ABORT", "EOR",
- "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
- "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC",
- 0
-};
-#else
-extern char *telcmds[];
-#endif
-
-#define TELCMD_FIRST xEOF
-#define TELCMD_LAST IAC
-#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
- (unsigned int)(x) >= TELCMD_FIRST)
-#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
-
-/* telnet options */
-#define TELOPT_BINARY 0 /* 8-bit data path */
-#define TELOPT_ECHO 1 /* echo */
-#define TELOPT_RCP 2 /* prepare to reconnect */
-#define TELOPT_SGA 3 /* suppress go ahead */
-#define TELOPT_NAMS 4 /* approximate message size */
-#define TELOPT_STATUS 5 /* give status */
-#define TELOPT_TM 6 /* timing mark */
-#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
-#define TELOPT_NAOL 8 /* negotiate about output line width */
-#define TELOPT_NAOP 9 /* negotiate about output page size */
-#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
-#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
-#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
-#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
-#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
-#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
-#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
-#define TELOPT_XASCII 17 /* extended ascic character set */
-#define TELOPT_LOGOUT 18 /* force logout */
-#define TELOPT_BM 19 /* byte macro */
-#define TELOPT_DET 20 /* data entry terminal */
-#define TELOPT_SUPDUP 21 /* supdup protocol */
-#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
-#define TELOPT_SNDLOC 23 /* send location */
-#define TELOPT_TTYPE 24 /* terminal type */
-#define TELOPT_EOR 25 /* end or record */
-#define TELOPT_TUID 26 /* TACACS user identification */
-#define TELOPT_OUTMRK 27 /* output marking */
-#define TELOPT_TTYLOC 28 /* terminal location number */
-#define TELOPT_3270REGIME 29 /* 3270 regime */
-#define TELOPT_X3PAD 30 /* X.3 PAD */
-#define TELOPT_NAWS 31 /* window size */
-#define TELOPT_TSPEED 32 /* terminal speed */
-#define TELOPT_LFLOW 33 /* remote flow control */
-#define TELOPT_LINEMODE 34 /* Linemode option */
-#define TELOPT_XDISPLOC 35 /* X Display Location */
-#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */
-#define TELOPT_AUTHENTICATION 37/* Authenticate */
-#define TELOPT_ENCRYPT 38 /* Encryption option */
-#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */
-#define TELOPT_EXOPL 255 /* extended-options-list */
-
-
-#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
-#ifdef TELOPTS
-char *telopts[NTELOPTS+1] = {
- "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
- "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
- "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
- "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
- "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
- "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
- "TACACS UID", "OUTPUT MARKING", "TTYLOC",
- "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
- "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
- "ENCRYPT", "NEW-ENVIRON",
- 0
-};
-#define TELOPT_FIRST TELOPT_BINARY
-#define TELOPT_LAST TELOPT_NEW_ENVIRON
-#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
-#define TELOPT(x) telopts[(x)-TELOPT_FIRST]
-#endif
-
-/* sub-option qualifiers */
-#define TELQUAL_IS 0 /* option is... */
-#define TELQUAL_SEND 1 /* send option */
-#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */
-#define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */
-#define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */
-
-#define LFLOW_OFF 0 /* Disable remote flow control */
-#define LFLOW_ON 1 /* Enable remote flow control */
-#define LFLOW_RESTART_ANY 2 /* Restart output on any char */
-#define LFLOW_RESTART_XON 3 /* Restart output only on XON */
-
-/*
- * LINEMODE suboptions
- */
-
-#define LM_MODE 1
-#define LM_FORWARDMASK 2
-#define LM_SLC 3
-
-#define MODE_EDIT 0x01
-#define MODE_TRAPSIG 0x02
-#define MODE_ACK 0x04
-#define MODE_SOFT_TAB 0x08
-#define MODE_LIT_ECHO 0x10
-
-#define MODE_MASK 0x1f
-
-/* Not part of protocol, but needed to simplify things... */
-#define MODE_FLOW 0x0100
-#define MODE_ECHO 0x0200
-#define MODE_INBIN 0x0400
-#define MODE_OUTBIN 0x0800
-#define MODE_FORCE 0x1000
-
-#define SLC_SYNCH 1
-#define SLC_BRK 2
-#define SLC_IP 3
-#define SLC_AO 4
-#define SLC_AYT 5
-#define SLC_EOR 6
-#define SLC_ABORT 7
-#define SLC_EOF 8
-#define SLC_SUSP 9
-#define SLC_EC 10
-#define SLC_EL 11
-#define SLC_EW 12
-#define SLC_RP 13
-#define SLC_LNEXT 14
-#define SLC_XON 15
-#define SLC_XOFF 16
-#define SLC_FORW1 17
-#define SLC_FORW2 18
-#define SLC_MCL 19
-#define SLC_MCR 20
-#define SLC_MCWL 21
-#define SLC_MCWR 22
-#define SLC_MCBOL 23
-#define SLC_MCEOL 24
-#define SLC_INSRT 25
-#define SLC_OVER 26
-#define SLC_ECR 27
-#define SLC_EWR 28
-#define SLC_EBOL 29
-#define SLC_EEOL 30
-
-#define NSLC 30
-
-/*
- * For backwards compatability, we define SLC_NAMES to be the
- * list of names if SLC_NAMES is not defined.
- */
-#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
- "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
- "LNEXT", "XON", "XOFF", "FORW1", "FORW2", \
- "MCL", "MCR", "MCWL", "MCWR", "MCBOL", \
- "MCEOL", "INSRT", "OVER", "ECR", "EWR", \
- "EBOL", "EEOL", \
- 0
-
-#ifdef SLC_NAMES
-char *slc_names[] = {
- SLC_NAMELIST
-};
-#else
-extern char *slc_names[];
-#define SLC_NAMES SLC_NAMELIST
-#endif
-
-#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
-#define SLC_NAME(x) slc_names[x]
-
-#define SLC_NOSUPPORT 0
-#define SLC_CANTCHANGE 1
-#define SLC_VARIABLE 2
-#define SLC_DEFAULT 3
-#define SLC_LEVELBITS 0x03
-
-#define SLC_FUNC 0
-#define SLC_FLAGS 1
-#define SLC_VALUE 2
-
-#define SLC_ACK 0x80
-#define SLC_FLUSHIN 0x40
-#define SLC_FLUSHOUT 0x20
-
-#define OLD_ENV_VAR 1
-#define OLD_ENV_VALUE 0
-#define NEW_ENV_VAR 0
-#define NEW_ENV_VALUE 1
-#define ENV_ESC 2
-#define ENV_USERVAR 3
-
-/*
- * AUTHENTICATION suboptions
- */
-
-/*
- * Who is authenticating who ...
- */
-#define AUTH_WHO_CLIENT 0 /* Client authenticating server */
-#define AUTH_WHO_SERVER 1 /* Server authenticating client */
-#define AUTH_WHO_MASK 1
-
-/*
- * amount of authentication done
- */
-#define AUTH_HOW_ONE_WAY 0
-#define AUTH_HOW_MUTUAL 2
-#define AUTH_HOW_MASK 2
-
-#define AUTHTYPE_NULL 0
-#define AUTHTYPE_KERBEROS_V4 1
-#define AUTHTYPE_KERBEROS_V5 2
-#define AUTHTYPE_SPX 3
-#define AUTHTYPE_MINK 4
-#define AUTHTYPE_CNT 5
-
-#define AUTHTYPE_TEST 99
-
-#ifdef AUTH_NAMES
-char *authtype_names[] = {
- "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK",
- 0
-};
-#else
-extern char *authtype_names[];
-#endif
-
-#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
-#define AUTHTYPE_NAME(x) authtype_names[x]
-
-/*
- * ENCRYPTion suboptions
- */
-#define ENCRYPT_IS 0 /* I pick encryption type ... */
-#define ENCRYPT_SUPPORT 1 /* I support encryption types ... */
-#define ENCRYPT_REPLY 2 /* Initial setup response */
-#define ENCRYPT_START 3 /* Am starting to send encrypted */
-#define ENCRYPT_END 4 /* Am ending encrypted */
-#define ENCRYPT_REQSTART 5 /* Request you start encrypting */
-#define ENCRYPT_REQEND 6 /* Request you end encrypting */
-#define ENCRYPT_ENC_KEYID 7
-#define ENCRYPT_DEC_KEYID 8
-#define ENCRYPT_CNT 9
-
-#define ENCTYPE_ANY 0
-#define ENCTYPE_DES_CFB64 1
-#define ENCTYPE_DES_OFB64 2
-#define ENCTYPE_CNT 3
-
-#ifdef ENCRYPT_NAMES
-char *encrypt_names[] = {
- "IS", "SUPPORT", "REPLY", "START", "END",
- "REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
- 0
-};
-char *enctype_names[] = {
- "ANY", "DES_CFB64", "DES_OFB64",
- 0
-};
-#else
-extern char *encrypt_names[];
-extern char *enctype_names[];
-#endif
-
-
-#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
-#define ENCRYPT_NAME(x) encrypt_names[x]
-
-#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
-#define ENCTYPE_NAME(x) enctype_names[x]
-
-#endif /* !_TELNET_H_ */
diff --git a/c/src/libnetworking/bpfilter.h b/c/src/libnetworking/bpfilter.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/libnetworking/bpfilter.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/libnetworking/include/Makefile.in b/c/src/libnetworking/include/Makefile.in
deleted file mode 100644
index f2746d78f0..0000000000
--- a/c/src/libnetworking/include/Makefile.in
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_PIECES=bpfilter loop netdb opt_ipfw opt_mrouting \
- opt_tcpdebug poll resolv syslog
-H_FILES=$(H_PIECES:%=$(srcdir)/../%.h)
-
-SYS_H_PIECES=buf callout cdefs conf domain filio ioccom ioctl kernel \
- libkern malloc mbuf mount param proc protosw queue reboot \
- resourcevar rtprio select signalvar socket socketvar \
- sockio sysctl syslimits syslog systm ttycom ttydefaults \
- ucred uio
-SYS_H_FILES=$(SYS_H_PIECES:%=$(srcdir)/../sys/%.h)
-
-RTEMS_H_PIECES= rtems_bsdnet rtems_bsdnet_internal tftp
-RTEMS_H_FILES=$(RTEMS_H_PIECES:%=$(srcdir)/../rtems/%.h)
-
-MACHINE_H_PIECES= conf cpu cpufunc endian in_cksum limits param types vmparam
-MACHINE_H_FILES=$(MACHINE_H_PIECES:%=$(srcdir)/../machine/%.h)
-
-VM_H_PIECES= vm vm_extern vm_kern vm_param
-VM_H_FILES=$(VM_H_PIECES:%=$(srcdir)/../vm/%.h)
-
-NET_H_PIECES= bpf ethernet if if_arp if_dl if_llc if_types netisr \
- radix raw_cb route
-NET_H_FILES=$(NET_H_PIECES:%=$(srcdir)/../net/%.h)
-
-NETINET_H_PIECES= icmp_var if_ether igmp igmp_var in in_pcb in_systm in_var \
- ip ip_fw ip_icmp ip_mroute ip_var tcp tcp_debug tcp_fsm \
- tcp_seq tcp_timer tcp_var tcpip udp udp_var
-NETINET_H_FILES=$(NETINET_H_PIECES:%=$(srcdir)/../netinet/%.h)
-
-ARPA_H_PIECES= ftp inet nameser nameser_compat telnet
-ARPA_H_FILES=$(ARPA_H_PIECES:%=$(srcdir)/../arpa/%.h)
-
-NFS_H_PIECES= krpc nfs nfsdiskless nfsproto rpcv2 xdr_subs
-NFS_H_FILES=$(NFS_H_PIECES:%=$(srcdir)/../nfs/%.h)
-
-SRCS=$(H_FILES) $(SYS_H_FILES) $(RTEMS_H_FILES) $(MACHINE_H_FILES) \
- $(VM_H_FILES) $(NET_H_FILES) $(NETINET_H_FILES) $(ARPA_H_FILES) \
- $(NFS_H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)/networking
- $(INSTALL) -m 444 $(SYS_H_FILES) $(PROJECT_INCLUDE)/networking/sys
- $(INSTALL) -m 444 $(RTEMS_H_FILES) $(PROJECT_INCLUDE)/networking/rtems
- $(INSTALL) -m 444 $(MACHINE_H_FILES) $(PROJECT_INCLUDE)/networking/machine
- $(INSTALL) -m 444 $(VM_H_FILES) $(PROJECT_INCLUDE)/networking/vm
- $(INSTALL) -m 444 $(NET_H_FILES) $(PROJECT_INCLUDE)/networking/net
- $(INSTALL) -m 444 $(NETINET_H_FILES) $(PROJECT_INCLUDE)/networking/netinet
- $(INSTALL) -m 444 $(ARPA_H_FILES) $(PROJECT_INCLUDE)/networking/arpa
- $(INSTALL) -m 444 $(NFS_H_FILES) $(PROJECT_INCLUDE)/networking/nfs
diff --git a/c/src/libnetworking/kern/Makefile.in b/c/src/libnetworking/kern/Makefile.in
deleted file mode 100644
index 35804e14ef..0000000000
--- a/c/src/libnetworking/kern/Makefile.in
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=lib.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES=kern_subr uipc_domain uipc_mbuf uipc_socket uipc_socket2
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \
- -DDIAGNOSTIC -DBOOTP_COMPAT
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
diff --git a/c/src/libnetworking/kern/kern_subr.c b/c/src/libnetworking/kern/kern_subr.c
deleted file mode 100644
index 71e51fc442..0000000000
--- a/c/src/libnetworking/kern/kern_subr.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/malloc.h>
-#include <sys/queue.h>
-
-int
-uiomove(cp, n, uio)
- register caddr_t cp;
- register int n;
- register struct uio *uio;
-{
- register struct iovec *iov;
- u_int cnt;
- int error;
-
-#ifdef DIAGNOSTIC
- if (uio->uio_rw != UIO_READ && uio->uio_rw != UIO_WRITE)
- panic("uiomove: mode");
-#endif
- while (n > 0 && uio->uio_resid) {
- iov = uio->uio_iov;
- cnt = iov->iov_len;
- if (cnt == 0) {
- uio->uio_iov++;
- uio->uio_iovcnt--;
- continue;
- }
- if (cnt > n)
- cnt = n;
-
- switch (uio->uio_segflg) {
-
- case UIO_USERSPACE:
- case UIO_USERISPACE:
- if (uio->uio_rw == UIO_READ)
- error = copyout(cp, iov->iov_base, cnt);
- else
- error = copyin(iov->iov_base, cp, cnt);
- if (error)
- return (error);
- break;
-
- case UIO_SYSSPACE:
- if (uio->uio_rw == UIO_READ)
- bcopy((caddr_t)cp, iov->iov_base, cnt);
- else
- bcopy(iov->iov_base, (caddr_t)cp, cnt);
- break;
- case UIO_NOCOPY:
- break;
- }
- iov->iov_base += cnt;
- iov->iov_len -= cnt;
- uio->uio_resid -= cnt;
- uio->uio_offset += cnt;
- cp += cnt;
- n -= cnt;
- }
- return (0);
-}
-
-#ifdef vax /* unused except by ct.c, other oddities XXX */
-/*
- * Get next character written in by user from uio.
- */
-int
-uwritec(uio)
- struct uio *uio;
-{
- register struct iovec *iov;
- register int c;
-
- if (uio->uio_resid <= 0)
- return (-1);
-again:
- if (uio->uio_iovcnt <= 0)
- panic("uwritec");
- iov = uio->uio_iov;
- if (iov->iov_len == 0) {
- uio->uio_iov++;
- if (--uio->uio_iovcnt == 0)
- return (-1);
- goto again;
- }
- switch (uio->uio_segflg) {
-
- case UIO_USERSPACE:
- c = fubyte(iov->iov_base);
- break;
-
- case UIO_SYSSPACE:
- c = *(u_char *) iov->iov_base;
- break;
-
- case UIO_USERISPACE:
- c = fuibyte(iov->iov_base);
- break;
- }
- if (c < 0)
- return (-1);
- iov->iov_base++;
- iov->iov_len--;
- uio->uio_resid--;
- uio->uio_offset++;
- return (c);
-}
-#endif /* vax */
-
-/*
- * General routine to allocate a hash table.
- */
-void *
-hashinit(elements, type, hashmask)
- int elements, type;
- u_long *hashmask;
-{
- long hashsize;
- LIST_HEAD(generic, generic) *hashtbl;
- int i;
-
- if (elements <= 0)
- panic("hashinit: bad elements");
- for (hashsize = 1; hashsize <= elements; hashsize <<= 1)
- continue;
- hashsize >>= 1;
- hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, M_WAITOK);
- for (i = 0; i < hashsize; i++)
- LIST_INIT(&hashtbl[i]);
- *hashmask = hashsize - 1;
- return (hashtbl);
-}
-
-#define NPRIMES 27
-static int primes[] = { 1, 13, 31, 61, 127, 251, 509, 761, 1021, 1531, 2039,
- 2557, 3067, 3583, 4093, 4603, 5119, 5623, 6143, 6653,
- 7159, 7673, 8191, 12281, 16381, 24571, 32749 };
-
-/*
- * General routine to allocate a prime number sized hash table.
- */
-void *
-phashinit(elements, type, nentries)
- int elements, type;
- u_long *nentries;
-{
- long hashsize;
- LIST_HEAD(generic, generic) *hashtbl;
- int i;
-
- if (elements <= 0)
- panic("phashinit: bad elements");
- for (i = 1, hashsize = primes[1]; hashsize <= elements;) {
- i++;
- if (i == NPRIMES)
- break;
- hashsize = primes[i];
- }
- hashsize = primes[i - 1];
- hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, M_WAITOK);
- for (i = 0; i < hashsize; i++)
- LIST_INIT(&hashtbl[i]);
- *nentries = hashsize;
- return (hashtbl);
-}
diff --git a/c/src/libnetworking/kern/uipc_domain.c b/c/src/libnetworking/kern/uipc_domain.c
deleted file mode 100644
index 910007395c..0000000000
--- a/c/src/libnetworking/kern/uipc_domain.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/domain.h>
-#include <sys/mbuf.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-
-/*
- * System initialization
- *
- * Note: domain initialization wants to take place on a per domain basis
- * as a result of traversing a linker set. Most likely, each domain
- * want to call a registration function rather than being handled here
- * in domaininit(). Probably this will look like:
- *
- * SYSINIT(unique, SI_SUB_PROTO_DOMAI, SI_ORDER_ANY, domain_add, xxx)
- *
- * Where 'xxx' is replaced by the address of a parameter struct to be
- * passed to the doamin_add() function.
- */
-
-#if !defined(__rtems__)
-static int x_save_spl; /* used by kludge*/
-static void kludge_splimp __P((void *));
-static void kludge_splx __P((void *));
- void domaininit __P((void *));
-SYSINIT(splimp, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, kludge_splimp, &x_save_spl)
-SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL)
-SYSINIT(splx, SI_SUB_PROTO_END, SI_ORDER_FIRST, kludge_splx, &x_save_spl)
-#endif
-
-static void pffasttimo __P((void *));
-static void pfslowtimo __P((void *));
-
-struct domain *domains;
-
-#define ADDDOMAIN(x) { \
- __CONCAT(x,domain.dom_next) = domains; \
- domains = &__CONCAT(x,domain); \
-}
-
-extern struct linker_set domain_set;
-
-/* ARGSUSED*/
-void
-domaininit(dummy)
- void *dummy;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
-/* - not in our sources
-#ifdef ISDN
- ADDDOMAIN(isdn);
-#endif
-*/
-
- for (dp = domains; dp; dp = dp->dom_next) {
- if (dp->dom_init)
- (*dp->dom_init)();
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++){
-#ifdef PRU_OLDSTYLE
- /* See comments in uipc_socket2.c. */
- if (pr->pr_usrreqs == 0 && pr->pr_ousrreq)
- pr->pr_usrreqs = &pru_oldstyle;
-#endif
- if (pr->pr_init)
- (*pr->pr_init)();
- }
- }
-
- if (max_linkhdr < 16) /* XXX */
- max_linkhdr = 16;
- max_hdr = max_linkhdr + max_protohdr;
- max_datalen = MHLEN - max_hdr;
- timeout(pffasttimo, (void *)0, 1);
- timeout(pfslowtimo, (void *)0, 1);
-}
-
-
-/*
- * The following two operations are kludge code. Most likely, they should
- * be done as a "domainpreinit()" for the first function and then rolled
- * in as the last act of "domaininit()" for the second.
- *
- * In point of fact, it is questionable why other initialization prior
- * to this does not also take place at splimp by default.
- */
-static void
-kludge_splimp(udata)
- void *udata;
-{
- int *savesplp = udata;
-
- *savesplp = splimp();
-}
-
-static void
-kludge_splx(udata)
- void *udata;
-{
- int *savesplp = udata;
-
- splx( *savesplp);
-}
-
-
-
-struct protosw *
-pffindtype(int family, int type)
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- if (dp->dom_family == family)
- goto found;
- return (0);
-found:
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_type && pr->pr_type == type)
- return (pr);
- return (0);
-}
-
-struct protosw *
-pffindproto(int family, int protocol, int type)
-{
- register struct domain *dp;
- register struct protosw *pr;
- struct protosw *maybe = 0;
-
- if (family == 0)
- return (0);
- for (dp = domains; dp; dp = dp->dom_next)
- if (dp->dom_family == family)
- goto found;
- return (0);
-found:
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) {
- if ((pr->pr_protocol == protocol) && (pr->pr_type == type))
- return (pr);
-
- if (type == SOCK_RAW && pr->pr_type == SOCK_RAW &&
- pr->pr_protocol == 0 && maybe == (struct protosw *)0)
- maybe = pr;
- }
- return (maybe);
-}
-
-void
-pfctlinput(cmd, sa)
- int cmd;
- struct sockaddr *sa;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_ctlinput)
- (*pr->pr_ctlinput)(cmd, sa, (void *)0);
-}
-
-static void
-pfslowtimo(arg)
- void *arg;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_slowtimo)
- (*pr->pr_slowtimo)();
- timeout(pfslowtimo, (void *)0, hz/2);
-}
-
-static void
-pffasttimo(arg)
- void *arg;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_fasttimo)
- (*pr->pr_fasttimo)();
- timeout(pffasttimo, (void *)0, hz/5);
-}
diff --git a/c/src/libnetworking/kern/uipc_mbuf.c b/c/src/libnetworking/kern/uipc_mbuf.c
deleted file mode 100644
index f682be94a7..0000000000
--- a/c/src/libnetworking/kern/uipc_mbuf.c
+++ /dev/null
@@ -1,851 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1991, 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.
- *
- * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/malloc.h>
-#define MBTYPES
-#include <sys/mbuf.h>
-#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/vm_kern.h>
-#include <vm/vm_extern.h>
-
-static void mbinit __P((void *));
-SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbinit, NULL)
-
-struct mbuf *mbutl;
-char *mclrefcnt;
-struct mbstat mbstat;
-struct mbuf *mmbfree;
-union mcluster *mclfree;
-int max_linkhdr;
-int max_protohdr;
-int max_hdr;
-int max_datalen;
-
-static void m_reclaim __P((void));
-
-/* "number of clusters of pages" */
-#define NCL_INIT 1
-
-#define NMB_INIT 16
-
-/* ARGSUSED*/
-static void
-mbinit(dummy)
- void *dummy;
-{
- int s;
-
- mmbfree = NULL; mclfree = NULL;
- s = splimp();
- if (m_mballoc(NMB_INIT, M_DONTWAIT) == 0)
- goto bad;
- if (m_clalloc(NCL_INIT, M_DONTWAIT) == 0)
- goto bad;
- splx(s);
- return;
-bad:
- panic("mbinit");
-}
-
-/*
- * Allocate at least nmb mbufs and place on mbuf free list.
- * Must be called at splimp.
- */
-/* ARGSUSED */
-int
-m_mballoc(nmb, nowait)
- register int nmb;
- int nowait;
-{
- register caddr_t p;
- register int i;
- int nbytes;
-
- /* Once we run out of map space, it will be impossible to get
- * any more (nothing is ever freed back to the map) (XXX which
- * is dumb). (however you are not dead as m_reclaim might
- * still be able to free a substantial amount of space).
- */
- if (mb_map_full)
- return (0);
-
- nbytes = round_page(nmb * MSIZE);
- p = (caddr_t)kmem_malloc(mb_map, nbytes, nowait ? M_NOWAIT : M_WAITOK);
- /*
- * Either the map is now full, or this is nowait and there
- * are no pages left.
- */
- if (p == NULL)
- return (0);
-
- nmb = nbytes / MSIZE;
- for (i = 0; i < nmb; i++) {
- ((struct mbuf *)p)->m_next = mmbfree;
- mmbfree = (struct mbuf *)p;
- p += MSIZE;
- }
- mbstat.m_mbufs += nmb;
- return (1);
-}
-
-/*
- * Allocate some number of mbuf clusters
- * and place on cluster free list.
- * Must be called at splimp.
- */
-/* ARGSUSED */
-int
-m_clalloc(ncl, nowait)
- register int ncl;
- int nowait;
-{
- register caddr_t p;
- register int i;
-
- /*
- * Once we run out of map space, it will be impossible
- * to get any more (nothing is ever freed back to the
- * map).
- */
- if (mb_map_full)
- return (0);
-
- p = (caddr_t)kmem_malloc(mb_map, ncl*MCLBYTES,
- nowait ? M_NOWAIT : M_WAITOK);
- /*
- * Either the map is now full, or this is nowait and there
- * are no pages left.
- */
- if (p == NULL)
- return (0);
-
- for (i = 0; i < ncl; i++) {
- ((union mcluster *)p)->mcl_next = mclfree;
- mclfree = (union mcluster *)p;
- p += MCLBYTES;
- mbstat.m_clfree++;
- }
- mbstat.m_clusters += ncl;
- return (1);
-}
-
-/*
- * When MGET failes, ask protocols to free space when short of memory,
- * then re-attempt to allocate an mbuf.
- */
-struct mbuf *
-m_retry(i, t)
- int i, t;
-{
- register struct mbuf *m;
-
- m_reclaim();
-#define m_retry(i, t) (struct mbuf *)0
- MGET(m, i, t);
-#undef m_retry
- if (m != NULL)
- mbstat.m_wait++;
- else
- mbstat.m_drops++;
- return (m);
-}
-
-/*
- * As above; retry an MGETHDR.
- */
-struct mbuf *
-m_retryhdr(i, t)
- int i, t;
-{
- register struct mbuf *m;
-
- m_reclaim();
-#define m_retryhdr(i, t) (struct mbuf *)0
- MGETHDR(m, i, t);
-#undef m_retryhdr
- if (m != NULL)
- mbstat.m_wait++;
- else
- mbstat.m_drops++;
- return (m);
-}
-
-static void
-m_reclaim()
-{
- register struct domain *dp;
- register struct protosw *pr;
- int s = splimp();
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_drain)
- (*pr->pr_drain)();
- splx(s);
- mbstat.m_drain++;
-}
-
-/*
- * Space allocation routines.
- * These are also available as macros
- * for critical paths.
- */
-struct mbuf *
-m_get(nowait, type)
- int nowait, type;
-{
- register struct mbuf *m;
-
- MGET(m, nowait, type);
- return (m);
-}
-
-struct mbuf *
-m_gethdr(nowait, type)
- int nowait, type;
-{
- register struct mbuf *m;
-
- MGETHDR(m, nowait, type);
- return (m);
-}
-
-struct mbuf *
-m_getclr(nowait, type)
- int nowait, type;
-{
- register struct mbuf *m;
-
- MGET(m, nowait, type);
- if (m == 0)
- return (0);
- bzero(mtod(m, caddr_t), MLEN);
- return (m);
-}
-
-struct mbuf *
-m_free(m)
- struct mbuf *m;
-{
- register struct mbuf *n;
-
- MFREE(m, n);
- return (n);
-}
-
-void
-m_freem(m)
- register struct mbuf *m;
-{
- register struct mbuf *n;
-
- if (m == NULL)
- return;
- do {
- MFREE(m, n);
- m = n;
- } while (m);
-}
-
-/*
- * Mbuffer utility routines.
- */
-
-/*
- * Lesser-used path for M_PREPEND:
- * allocate new mbuf to prepend to chain,
- * copy junk along.
- */
-struct mbuf *
-m_prepend(m, len, how)
- register struct mbuf *m;
- int len, how;
-{
- struct mbuf *mn;
-
- MGET(mn, how, m->m_type);
- if (mn == (struct mbuf *)NULL) {
- m_freem(m);
- return ((struct mbuf *)NULL);
- }
- if (m->m_flags & M_PKTHDR) {
- M_COPY_PKTHDR(mn, m);
- m->m_flags &= ~M_PKTHDR;
- }
- mn->m_next = m;
- m = mn;
- if (len < MHLEN)
- MH_ALIGN(m, len);
- m->m_len = len;
- return (m);
-}
-
-/*
- * Make a copy of an mbuf chain starting "off0" bytes from the beginning,
- * continuing for "len" bytes. If len is M_COPYALL, copy to end of mbuf.
- * The wait parameter is a choice of M_WAIT/M_DONTWAIT from caller.
- */
-static int MCFail;
-
-struct mbuf *
-m_copym(m, off0, len, wait)
- register struct mbuf *m;
- int off0, wait;
- register int len;
-{
- register struct mbuf *n, **np;
- register int off = off0;
- struct mbuf *top;
- int copyhdr = 0;
-
- if (off < 0 || len < 0)
- panic("m_copym");
- if (off == 0 && m->m_flags & M_PKTHDR)
- copyhdr = 1;
- while (off > 0) {
- if (m == 0)
- panic("m_copym");
- if (off < m->m_len)
- break;
- off -= m->m_len;
- m = m->m_next;
- }
- np = &top;
- top = 0;
- while (len > 0) {
- if (m == 0) {
- if (len != M_COPYALL)
- panic("m_copym");
- break;
- }
- MGET(n, wait, m->m_type);
- *np = n;
- if (n == 0)
- goto nospace;
- if (copyhdr) {
- M_COPY_PKTHDR(n, m);
- if (len == M_COPYALL)
- n->m_pkthdr.len -= off0;
- else
- n->m_pkthdr.len = len;
- copyhdr = 0;
- }
- n->m_len = min(len, m->m_len - off);
- if (m->m_flags & M_EXT) {
- n->m_data = m->m_data + off;
- if(!m->m_ext.ext_ref)
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- else
- (*(m->m_ext.ext_ref))(m->m_ext.ext_buf,
- m->m_ext.ext_size);
- n->m_ext = m->m_ext;
- n->m_flags |= M_EXT;
- } else
- bcopy(mtod(m, caddr_t)+off, mtod(n, caddr_t),
- (unsigned)n->m_len);
- if (len != M_COPYALL)
- len -= n->m_len;
- off = 0;
- m = m->m_next;
- np = &n->m_next;
- }
- if (top == 0)
- MCFail++;
- return (top);
-nospace:
- m_freem(top);
- MCFail++;
- return (0);
-}
-
-/*
- * Copy an entire packet, including header (which must be present).
- * An optimization of the common case `m_copym(m, 0, M_COPYALL, how)'.
- */
-struct mbuf *
-m_copypacket(m, how)
- struct mbuf *m;
- int how;
-{
- struct mbuf *top, *n, *o;
-
- MGET(n, how, m->m_type);
- top = n;
- if (!n)
- goto nospace;
-
- M_COPY_PKTHDR(n, m);
- n->m_len = m->m_len;
- if (m->m_flags & M_EXT) {
- n->m_data = m->m_data;
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- n->m_ext = m->m_ext;
- n->m_flags |= M_EXT;
- } else {
- bcopy(mtod(m, char *), mtod(n, char *), n->m_len);
- }
-
- m = m->m_next;
- while (m) {
- MGET(o, how, m->m_type);
- if (!o)
- goto nospace;
-
- n->m_next = o;
- n = n->m_next;
-
- n->m_len = m->m_len;
- if (m->m_flags & M_EXT) {
- n->m_data = m->m_data;
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- n->m_ext = m->m_ext;
- n->m_flags |= M_EXT;
- } else {
- bcopy(mtod(m, char *), mtod(n, char *), n->m_len);
- }
-
- m = m->m_next;
- }
- return top;
-nospace:
- m_freem(top);
- MCFail++;
- return 0;
-}
-
-/*
- * Copy data from an mbuf chain starting "off" bytes from the beginning,
- * continuing for "len" bytes, into the indicated buffer.
- */
-void
-m_copydata(m, off, len, cp)
- register struct mbuf *m;
- register int off;
- register int len;
- caddr_t cp;
-{
- register unsigned count;
-
- if (off < 0 || len < 0)
- panic("m_copydata");
- while (off > 0) {
- if (m == 0)
- panic("m_copydata");
- if (off < m->m_len)
- break;
- off -= m->m_len;
- m = m->m_next;
- }
- while (len > 0) {
- if (m == 0)
- panic("m_copydata");
- count = min(m->m_len - off, len);
- bcopy(mtod(m, caddr_t) + off, cp, count);
- len -= count;
- cp += count;
- off = 0;
- m = m->m_next;
- }
-}
-
-/*
- * Concatenate mbuf chain n to m.
- * Both chains must be of the same type (e.g. MT_DATA).
- * Any m_pkthdr is not updated.
- */
-void
-m_cat(m, n)
- register struct mbuf *m, *n;
-{
- while (m->m_next)
- m = m->m_next;
- while (n) {
- if (m->m_flags & M_EXT ||
- m->m_data + m->m_len + n->m_len >= &m->m_dat[MLEN]) {
- /* just join the two chains */
- m->m_next = n;
- return;
- }
- /* splat the data from one into the other */
- bcopy(mtod(n, caddr_t), mtod(m, caddr_t) + m->m_len,
- (u_int)n->m_len);
- m->m_len += n->m_len;
- n = m_free(n);
- }
-}
-
-void
-m_adj(mp, req_len)
- struct mbuf *mp;
- int req_len;
-{
- register int len = req_len;
- register struct mbuf *m;
- register int count;
-
- if ((m = mp) == NULL)
- return;
- if (len >= 0) {
- /*
- * Trim from head.
- */
- while (m != NULL && len > 0) {
- if (m->m_len <= len) {
- len -= m->m_len;
- m->m_len = 0;
- m = m->m_next;
- } else {
- m->m_len -= len;
- m->m_data += len;
- len = 0;
- }
- }
- m = mp;
- if (mp->m_flags & M_PKTHDR)
- m->m_pkthdr.len -= (req_len - len);
- } else {
- /*
- * Trim from tail. Scan the mbuf chain,
- * calculating its length and finding the last mbuf.
- * If the adjustment only affects this mbuf, then just
- * adjust and return. Otherwise, rescan and truncate
- * after the remaining size.
- */
- len = -len;
- count = 0;
- for (;;) {
- count += m->m_len;
- if (m->m_next == (struct mbuf *)0)
- break;
- m = m->m_next;
- }
- if (m->m_len >= len) {
- m->m_len -= len;
- if (mp->m_flags & M_PKTHDR)
- mp->m_pkthdr.len -= len;
- return;
- }
- count -= len;
- if (count < 0)
- count = 0;
- /*
- * Correct length for chain is "count".
- * Find the mbuf with last data, adjust its length,
- * and toss data from remaining mbufs on chain.
- */
- m = mp;
- if (m->m_flags & M_PKTHDR)
- m->m_pkthdr.len = count;
- for (; m; m = m->m_next) {
- if (m->m_len >= count) {
- m->m_len = count;
- break;
- }
- count -= m->m_len;
- }
- while (m->m_next)
- (m = m->m_next) ->m_len = 0;
- }
-}
-
-/*
- * Rearange an mbuf chain so that len bytes are contiguous
- * and in the data area of an mbuf (so that mtod and dtom
- * will work for a structure of size len). Returns the resulting
- * mbuf chain on success, frees it and returns null on failure.
- * If there is room, it will add up to max_protohdr-len extra bytes to the
- * contiguous region in an attempt to avoid being called next time.
- */
-static int MPFail;
-
-struct mbuf *
-m_pullup(n, len)
- register struct mbuf *n;
- int len;
-{
- register struct mbuf *m;
- register int count;
- int space;
-
- /*
- * If first mbuf has no cluster, and has room for len bytes
- * without shifting current data, pullup into it,
- * otherwise allocate a new mbuf to prepend to the chain.
- */
- if ((n->m_flags & M_EXT) == 0 &&
- n->m_data + len < &n->m_dat[MLEN] && n->m_next) {
- if (n->m_len >= len)
- return (n);
- m = n;
- n = n->m_next;
- len -= m->m_len;
- } else {
- if (len > MHLEN)
- goto bad;
- MGET(m, M_DONTWAIT, n->m_type);
- if (m == 0)
- goto bad;
- m->m_len = 0;
- if (n->m_flags & M_PKTHDR) {
- M_COPY_PKTHDR(m, n);
- n->m_flags &= ~M_PKTHDR;
- }
- }
- space = &m->m_dat[MLEN] - (m->m_data + m->m_len);
- do {
- count = min(min(max(len, max_protohdr), space), n->m_len);
- bcopy(mtod(n, caddr_t), mtod(m, caddr_t) + m->m_len,
- (unsigned)count);
- len -= count;
- m->m_len += count;
- n->m_len -= count;
- space -= count;
- if (n->m_len)
- n->m_data += count;
- else
- n = m_free(n);
- } while (len > 0 && n);
- if (len > 0) {
- (void) m_free(m);
- goto bad;
- }
- m->m_next = n;
- return (m);
-bad:
- m_freem(n);
- MPFail++;
- return (0);
-}
-
-/*
- * Partition an mbuf chain in two pieces, returning the tail --
- * all but the first len0 bytes. In case of failure, it returns NULL and
- * attempts to restore the chain to its original state.
- */
-struct mbuf *
-m_split(m0, len0, wait)
- register struct mbuf *m0;
- int len0, wait;
-{
- register struct mbuf *m, *n;
- unsigned len = len0, remain;
-
- for (m = m0; m && len > m->m_len; m = m->m_next)
- len -= m->m_len;
- if (m == 0)
- return (0);
- remain = m->m_len - len;
- if (m0->m_flags & M_PKTHDR) {
- MGETHDR(n, wait, m0->m_type);
- if (n == 0)
- return (0);
- n->m_pkthdr.rcvif = m0->m_pkthdr.rcvif;
- n->m_pkthdr.len = m0->m_pkthdr.len - len0;
- m0->m_pkthdr.len = len0;
- if (m->m_flags & M_EXT)
- goto extpacket;
- if (remain > MHLEN) {
- /* m can't be the lead packet */
- MH_ALIGN(n, 0);
- n->m_next = m_split(m, len, wait);
- if (n->m_next == 0) {
- (void) m_free(n);
- return (0);
- } else
- return (n);
- } else
- MH_ALIGN(n, remain);
- } else if (remain == 0) {
- n = m->m_next;
- m->m_next = 0;
- return (n);
- } else {
- MGET(n, wait, m->m_type);
- if (n == 0)
- return (0);
- M_ALIGN(n, remain);
- }
-extpacket:
- if (m->m_flags & M_EXT) {
- n->m_flags |= M_EXT;
- n->m_ext = m->m_ext;
- if(!m->m_ext.ext_ref)
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- else
- (*(m->m_ext.ext_ref))(m->m_ext.ext_buf,
- m->m_ext.ext_size);
- m->m_ext.ext_size = 0; /* For Accounting XXXXXX danger */
- n->m_data = m->m_data + len;
- } else {
- bcopy(mtod(m, caddr_t) + len, mtod(n, caddr_t), remain);
- }
- n->m_len = remain;
- m->m_len = len;
- n->m_next = m->m_next;
- m->m_next = 0;
- return (n);
-}
-/*
- * Routine to copy from device local memory into mbufs.
- */
-struct mbuf *
-m_devget(buf, totlen, off0, ifp, copy)
- char *buf;
- int totlen, off0;
- struct ifnet *ifp;
- void (*copy) __P((char *from, caddr_t to, u_int len));
-{
- register struct mbuf *m;
- struct mbuf *top = 0, **mp = &top;
- register int off = off0, len;
- register char *cp;
- char *epkt;
-
- cp = buf;
- epkt = cp + totlen;
- if (off) {
- cp += off + 2 * sizeof(u_short);
- totlen -= 2 * sizeof(u_short);
- }
- MGETHDR(m, M_DONTWAIT, MT_DATA);
- if (m == 0)
- return (0);
- m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = totlen;
- m->m_len = MHLEN;
-
- while (totlen > 0) {
- if (top) {
- MGET(m, M_DONTWAIT, MT_DATA);
- if (m == 0) {
- m_freem(top);
- return (0);
- }
- m->m_len = MLEN;
- }
- len = min(totlen, epkt - cp);
- if (len >= MINCLSIZE) {
- MCLGET(m, M_DONTWAIT);
- if (m->m_flags & M_EXT)
- m->m_len = len = min(len, MCLBYTES);
- else
- len = m->m_len;
- } else {
- /*
- * Place initial small packet/header at end of mbuf.
- */
- if (len < m->m_len) {
- if (top == 0 && len + max_linkhdr <= m->m_len)
- m->m_data += max_linkhdr;
- m->m_len = len;
- } else
- len = m->m_len;
- }
- if (copy)
- copy(cp, mtod(m, caddr_t), (unsigned)len);
- else
- bcopy(cp, mtod(m, caddr_t), (unsigned)len);
- cp += len;
- *mp = m;
- mp = &m->m_next;
- totlen -= len;
- if (cp == epkt)
- cp = buf;
- }
- return (top);
-}
-
-/*
- * Copy data from a buffer back into the indicated mbuf chain,
- * starting "off" bytes from the beginning, extending the mbuf
- * chain if necessary.
- */
-void
-m_copyback(m0, off, len, cp)
- struct mbuf *m0;
- register int off;
- register int len;
- caddr_t cp;
-{
- register int mlen;
- register struct mbuf *m = m0, *n;
- int totlen = 0;
-
- if (m0 == 0)
- return;
- while (off > (mlen = m->m_len)) {
- off -= mlen;
- totlen += mlen;
- if (m->m_next == 0) {
- n = m_getclr(M_DONTWAIT, m->m_type);
- if (n == 0)
- goto out;
- n->m_len = min(MLEN, len + off);
- m->m_next = n;
- }
- m = m->m_next;
- }
- while (len > 0) {
- mlen = min (m->m_len - off, len);
- bcopy(cp, off + mtod(m, caddr_t), (unsigned)mlen);
- cp += mlen;
- len -= mlen;
- mlen += off;
- off = 0;
- totlen += mlen;
- if (len == 0)
- break;
- if (m->m_next == 0) {
- n = m_get(M_DONTWAIT, m->m_type);
- if (n == 0)
- break;
- n->m_len = min(MLEN, len);
- m->m_next = n;
- }
- m = m->m_next;
- }
-out: if (((m = m0)->m_flags & M_PKTHDR) && (m->m_pkthdr.len < totlen))
- m->m_pkthdr.len = totlen;
-}
diff --git a/c/src/libnetworking/kern/uipc_socket.c b/c/src/libnetworking/kern/uipc_socket.c
deleted file mode 100644
index 895d1c7d45..0000000000
--- a/c/src/libnetworking/kern/uipc_socket.c
+++ /dev/null
@@ -1,1100 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 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.
- *
- * @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/file.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/domain.h>
-#include <sys/kernel.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/resourcevar.h>
-#include <sys/signalvar.h>
-#include <sys/sysctl.h>
-
-static int somaxconn = SOMAXCONN;
-SYSCTL_INT(_kern, KERN_SOMAXCONN, somaxconn, CTLFLAG_RW, &somaxconn, 0, "");
-
-/*
- * Socket operation routines.
- * These routines are called by the routines in
- * sys_socket.c or from a system process, and
- * implement the semantics of socket operations by
- * switching out to the protocol specific routines.
- */
-/*ARGSUSED*/
-int
-socreate(dom, aso, type, proto, p)
- int dom;
- struct socket **aso;
- register int type;
- int proto;
- struct proc *p;
-{
- register struct protosw *prp;
- register struct socket *so;
- register int error;
-
- if (proto)
- prp = pffindproto(dom, proto, type);
- else
- prp = pffindtype(dom, type);
- if (prp == 0 || prp->pr_usrreqs == 0)
- return (EPROTONOSUPPORT);
- if (prp->pr_type != type)
- return (EPROTOTYPE);
- MALLOC(so, struct socket *, sizeof(*so), M_SOCKET, M_WAIT);
- bzero((caddr_t)so, sizeof(*so));
- TAILQ_INIT(&so->so_incomp);
- TAILQ_INIT(&so->so_comp);
- so->so_type = type;
- so->so_state = SS_PRIV;
- so->so_uid = 0;
- so->so_proto = prp;
- error = (*prp->pr_usrreqs->pru_attach)(so, proto);
- if (error) {
- so->so_state |= SS_NOFDREF;
- sofree(so);
- return (error);
- }
- *aso = so;
- return (0);
-}
-
-int
-sobind(so, nam)
- struct socket *so;
- struct mbuf *nam;
-{
- int s = splnet();
- int error;
-
- error = (*so->so_proto->pr_usrreqs->pru_bind)(so, nam);
- splx(s);
- return (error);
-}
-
-int
-solisten(so, backlog)
- register struct socket *so;
- int backlog;
-{
- int s = splnet(), error;
-
- error = (*so->so_proto->pr_usrreqs->pru_listen)(so);
- if (error) {
- splx(s);
- return (error);
- }
- if (so->so_comp.tqh_first == NULL)
- so->so_options |= SO_ACCEPTCONN;
- if (backlog < 0 || backlog > somaxconn)
- backlog = somaxconn;
- so->so_qlimit = backlog;
- splx(s);
- return (0);
-}
-
-void
-sofree(so)
- register struct socket *so;
-{
- struct socket *head = so->so_head;
-
- if (so->so_pcb || (so->so_state & SS_NOFDREF) == 0)
- return;
- if (head != NULL) {
- if (so->so_state & SS_INCOMP) {
- TAILQ_REMOVE(&head->so_incomp, so, so_list);
- head->so_incqlen--;
- } else if (so->so_state & SS_COMP) {
- TAILQ_REMOVE(&head->so_comp, so, so_list);
- } else {
- panic("sofree: not queued");
- }
- head->so_qlen--;
- so->so_state &= ~(SS_INCOMP|SS_COMP);
- so->so_head = NULL;
- }
- sbrelease(&so->so_snd);
- sorflush(so);
- FREE(so, M_SOCKET);
-}
-
-/*
- * Close a socket on last file table reference removal.
- * Initiate disconnect if connected.
- * Free socket when disconnect complete.
- */
-int
-soclose(so)
- register struct socket *so;
-{
- int s = splnet(); /* conservative */
- int error = 0;
-
- if (so->so_options & SO_ACCEPTCONN) {
- struct socket *sp, *sonext;
-
- for (sp = so->so_incomp.tqh_first; sp != NULL; sp = sonext) {
- sonext = sp->so_list.tqe_next;
- (void) soabort(sp);
- }
- for (sp = so->so_comp.tqh_first; sp != NULL; sp = sonext) {
- sonext = sp->so_list.tqe_next;
- (void) soabort(sp);
- }
- }
- if (so->so_pcb == 0)
- goto discard;
- if (so->so_state & SS_ISCONNECTED) {
- if ((so->so_state & SS_ISDISCONNECTING) == 0) {
- error = sodisconnect(so);
- if (error)
- goto drop;
- }
- if (so->so_options & SO_LINGER) {
- if ((so->so_state & SS_ISDISCONNECTING) &&
- (so->so_state & SS_NBIO))
- goto drop;
- while (so->so_state & SS_ISCONNECTED) {
- soconnsleep (so);
- }
- }
- }
-drop:
- if (so->so_pcb) {
- int error2 = (*so->so_proto->pr_usrreqs->pru_detach)(so);
- if (error == 0)
- error = error2;
- }
-discard:
- if (so->so_state & SS_NOFDREF)
- panic("soclose: NOFDREF");
- so->so_state |= SS_NOFDREF;
- sofree(so);
- splx(s);
- return (error);
-}
-
-/*
- * Must be called at splnet...
- */
-int
-soabort(so)
- struct socket *so;
-{
-
- return (*so->so_proto->pr_usrreqs->pru_abort)(so);
-}
-
-int
-soaccept(so, nam)
- register struct socket *so;
- struct mbuf *nam;
-{
- int s = splnet();
- int error;
-
- if ((so->so_state & SS_NOFDREF) == 0)
- panic("soaccept: !NOFDREF");
- so->so_state &= ~SS_NOFDREF;
- error = (*so->so_proto->pr_usrreqs->pru_accept)(so, nam);
- splx(s);
- return (error);
-}
-
-int
-soconnect(so, nam)
- register struct socket *so;
- struct mbuf *nam;
-{
- int s;
- int error;
-
- if (so->so_options & SO_ACCEPTCONN)
- return (EOPNOTSUPP);
- s = splnet();
- /*
- * If protocol is connection-based, can only connect once.
- * Otherwise, if connected, try to disconnect first.
- * This allows user to disconnect by connecting to, e.g.,
- * a null address.
- */
- if (so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING) &&
- ((so->so_proto->pr_flags & PR_CONNREQUIRED) ||
- (error = sodisconnect(so))))
- error = EISCONN;
- else
- error = (*so->so_proto->pr_usrreqs->pru_connect)(so, nam);
- splx(s);
- return (error);
-}
-
-int
-soconnect2(so1, so2)
- register struct socket *so1;
- struct socket *so2;
-{
- int s = splnet();
- int error;
-
- error = (*so1->so_proto->pr_usrreqs->pru_connect2)(so1, so2);
- splx(s);
- return (error);
-}
-
-int
-sodisconnect(so)
- register struct socket *so;
-{
- int s = splnet();
- int error;
-
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- error = ENOTCONN;
- goto bad;
- }
- if (so->so_state & SS_ISDISCONNECTING) {
- error = EALREADY;
- goto bad;
- }
- error = (*so->so_proto->pr_usrreqs->pru_disconnect)(so);
-bad:
- splx(s);
- return (error);
-}
-
-#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? M_NOWAIT : M_WAITOK)
-/*
- * Send on a socket.
- * If send must go all at once and message is larger than
- * send buffering, then hard error.
- * Lock against other senders.
- * If must go all at once and not enough room now, then
- * inform user that this would block and do nothing.
- * Otherwise, if nonblocking, send as much as possible.
- * The data to be sent is described by "uio" if nonzero,
- * otherwise by the mbuf chain "top" (which must be null
- * if uio is not). Data provided in mbuf chain must be small
- * enough to send all at once.
- *
- * Returns nonzero on error, timeout or signal; callers
- * must check for short counts if EINTR/ERESTART are returned.
- * Data and control buffers are freed on return.
- */
-int
-sosend(so, addr, uio, top, control, flags)
- register struct socket *so;
- struct mbuf *addr;
- struct uio *uio;
- struct mbuf *top;
- struct mbuf *control;
- int flags;
-{
- struct mbuf **mp;
- register struct mbuf *m;
- register long space, len, resid;
- int clen = 0, error, s, dontroute, mlen;
- int atomic = sosendallatonce(so) || top;
-
- if (uio)
- resid = uio->uio_resid;
- else
- resid = top->m_pkthdr.len;
- /*
- * In theory resid should be unsigned.
- * However, space must be signed, as it might be less than 0
- * if we over-committed, and we must use a signed comparison
- * of space and resid. On the other hand, a negative resid
- * causes us to loop sending 0-length segments to the protocol.
- *
- * Also check to make sure that MSG_EOR isn't used on SOCK_STREAM
- * type sockets since that's an error.
- */
- if ((resid < 0) || (so->so_type == SOCK_STREAM && (flags & MSG_EOR))) {
- error = EINVAL;
- goto out;
- }
-
- dontroute =
- (flags & MSG_DONTROUTE) && (so->so_options & SO_DONTROUTE) == 0 &&
- (so->so_proto->pr_flags & PR_ATOMIC);
- if (control)
- clen = control->m_len;
-#define snderr(errno) { error = errno; splx(s); goto release; }
-
-restart:
- error = sblock(&so->so_snd, SBLOCKWAIT(flags));
- if (error)
- goto out;
- do {
- s = splnet();
- if (so->so_state & SS_CANTSENDMORE)
- snderr(EPIPE);
- if (so->so_error) {
- error = so->so_error;
- so->so_error = 0;
- splx(s);
- goto release;
- }
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- /*
- * `sendto' and `sendmsg' is allowed on a connection-
- * based socket if it supports implied connect.
- * Return ENOTCONN if not connected and no address is
- * supplied.
- */
- if ((so->so_proto->pr_flags & PR_CONNREQUIRED) &&
- (so->so_proto->pr_flags & PR_IMPLOPCL) == 0) {
- if ((so->so_state & SS_ISCONFIRMING) == 0 &&
- !(resid == 0 && clen != 0))
- snderr(ENOTCONN);
- } else if (addr == 0)
- snderr(so->so_proto->pr_flags & PR_CONNREQUIRED ?
- ENOTCONN : EDESTADDRREQ);
- }
- space = sbspace(&so->so_snd);
- if (flags & MSG_OOB)
- space += 1024;
- if ((atomic && resid > so->so_snd.sb_hiwat) ||
- clen > so->so_snd.sb_hiwat)
- snderr(EMSGSIZE);
- if (space < resid + clen && uio &&
- (atomic || space < so->so_snd.sb_lowat || space < clen)) {
- if (so->so_state & SS_NBIO)
- snderr(EWOULDBLOCK);
- sbunlock(&so->so_snd);
- error = sbwait(&so->so_snd);
- splx(s);
- if (error)
- goto out;
- goto restart;
- }
- splx(s);
- mp = &top;
- space -= clen;
- do {
- if (uio == NULL) {
- /*
- * Data is prepackaged in "top".
- */
- resid = 0;
- if (flags & MSG_EOR)
- top->m_flags |= M_EOR;
- } else do {
- if (top == 0) {
- MGETHDR(m, M_WAIT, MT_DATA);
- mlen = MHLEN;
- m->m_pkthdr.len = 0;
- m->m_pkthdr.rcvif = (struct ifnet *)0;
- } else {
- MGET(m, M_WAIT, MT_DATA);
- mlen = MLEN;
- }
- if (resid >= MINCLSIZE) {
- MCLGET(m, M_WAIT);
- if ((m->m_flags & M_EXT) == 0)
- goto nopages;
- mlen = MCLBYTES;
- len = min(min(mlen, resid), space);
- } else {
-nopages:
- len = min(min(mlen, resid), space);
- /*
- * For datagram protocols, leave room
- * for protocol headers in first mbuf.
- */
- if (atomic && top == 0 && len < mlen)
- MH_ALIGN(m, len);
- }
- space -= len;
- error = uiomove(mtod(m, caddr_t), (int)len, uio);
- resid = uio->uio_resid;
- m->m_len = len;
- *mp = m;
- top->m_pkthdr.len += len;
- if (error)
- goto release;
- mp = &m->m_next;
- if (resid <= 0) {
- if (flags & MSG_EOR)
- top->m_flags |= M_EOR;
- break;
- }
- } while (space > 0 && atomic);
- if (dontroute)
- so->so_options |= SO_DONTROUTE;
- s = splnet(); /* XXX */
- error = (*so->so_proto->pr_usrreqs->pru_send)(so,
- (flags & MSG_OOB) ? PRUS_OOB :
- /*
- * If the user set MSG_EOF, the protocol
- * understands this flag and nothing left to
- * send then use PRU_SEND_EOF instead of PRU_SEND.
- */
- ((flags & MSG_EOF) &&
- (so->so_proto->pr_flags & PR_IMPLOPCL) &&
- (resid <= 0)) ?
- PRUS_EOF : 0,
- top, addr, control);
- splx(s);
- if (dontroute)
- so->so_options &= ~SO_DONTROUTE;
- clen = 0;
- control = 0;
- top = 0;
- mp = &top;
- if (error)
- goto release;
- } while (resid && space > 0);
- } while (resid);
-
-release:
- sbunlock(&so->so_snd);
-out:
- if (top)
- m_freem(top);
- if (control)
- m_freem(control);
- return (error);
-}
-
-/*
- * Implement receive operations on a socket.
- * We depend on the way that records are added to the sockbuf
- * by sbappend*. In particular, each record (mbufs linked through m_next)
- * must begin with an address if the protocol so specifies,
- * followed by an optional mbuf or mbufs containing ancillary data,
- * and then zero or more mbufs of data.
- * In order to avoid blocking network interrupts for the entire time here,
- * we splx() while doing the actual copy to user space.
- * Although the sockbuf is locked, new data may still be appended,
- * and thus we must maintain consistency of the sockbuf during that time.
- *
- * The caller may receive the data as a single mbuf chain by supplying
- * an mbuf **mp0 for use in returning the chain. The uio is then used
- * only for the count in uio_resid.
- */
-int
-soreceive(so, paddr, uio, mp0, controlp, flagsp)
- register struct socket *so;
- struct mbuf **paddr;
- struct uio *uio;
- struct mbuf **mp0;
- struct mbuf **controlp;
- int *flagsp;
-{
- register struct mbuf *m, **mp;
- register int flags, len, error, s, offset;
- struct protosw *pr = so->so_proto;
- struct mbuf *nextrecord;
- int moff, type = 0;
- int orig_resid = uio->uio_resid;
-
- mp = mp0;
- if (paddr)
- *paddr = 0;
- if (controlp)
- *controlp = 0;
- if (flagsp)
- flags = *flagsp &~ MSG_EOR;
- else
- flags = 0;
- if (flags & MSG_OOB) {
- m = m_get(M_WAIT, MT_DATA);
- error = (*pr->pr_usrreqs->pru_rcvoob)(so, m, flags & MSG_PEEK);
- if (error)
- goto bad;
- do {
- error = uiomove(mtod(m, caddr_t),
- (int) min(uio->uio_resid, m->m_len), uio);
- m = m_free(m);
- } while (uio->uio_resid && error == 0 && m);
-bad:
- if (m)
- m_freem(m);
- return (error);
- }
- if (mp)
- *mp = (struct mbuf *)0;
- if (so->so_state & SS_ISCONFIRMING && uio->uio_resid)
- (*pr->pr_usrreqs->pru_rcvd)(so, 0);
-
-restart:
- error = sblock(&so->so_rcv, SBLOCKWAIT(flags));
- if (error)
- return (error);
- s = splnet();
-
- m = so->so_rcv.sb_mb;
- /*
- * If we have less data than requested, block awaiting more
- * (subject to any timeout) if:
- * 1. the current count is less than the low water mark, or
- * 2. MSG_WAITALL is set, and it is possible to do the entire
- * receive operation at once if we block (resid <= hiwat).
- * 3. MSG_DONTWAIT is not set
- * If MSG_WAITALL is set but resid is larger than the receive buffer,
- * we have to do the receive in sections, and thus risk returning
- * a short count if a timeout or signal occurs after we start.
- */
- if (m == 0 || (((flags & MSG_DONTWAIT) == 0 &&
- so->so_rcv.sb_cc < uio->uio_resid) &&
- (so->so_rcv.sb_cc < so->so_rcv.sb_lowat ||
- ((flags & MSG_WAITALL) && uio->uio_resid <= so->so_rcv.sb_hiwat)) &&
- m->m_nextpkt == 0 && (pr->pr_flags & PR_ATOMIC) == 0)) {
-#ifdef DIAGNOSTIC
- if (m == 0 && so->so_rcv.sb_cc)
- panic("receive 1");
-#endif
- if (so->so_error) {
- if (m)
- goto dontblock;
- error = so->so_error;
- if ((flags & MSG_PEEK) == 0)
- so->so_error = 0;
- goto release;
- }
- if (so->so_state & SS_CANTRCVMORE) {
- if (m)
- goto dontblock;
- else
- goto release;
- }
- for (; m; m = m->m_next)
- if (m->m_type == MT_OOBDATA || (m->m_flags & M_EOR)) {
- m = so->so_rcv.sb_mb;
- goto dontblock;
- }
- if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 &&
- (so->so_proto->pr_flags & PR_CONNREQUIRED)) {
- error = ENOTCONN;
- goto release;
- }
- if (uio->uio_resid == 0)
- goto release;
- if ((so->so_state & SS_NBIO) || (flags & MSG_DONTWAIT)) {
- error = EWOULDBLOCK;
- goto release;
- }
- sbunlock(&so->so_rcv);
- error = sbwait(&so->so_rcv);
- splx(s);
- if (error)
- return (error);
- goto restart;
- }
-dontblock:
- nextrecord = m->m_nextpkt;
- if (pr->pr_flags & PR_ADDR) {
-#ifdef DIAGNOSTIC
- if (m->m_type != MT_SONAME)
- panic("receive 1a");
-#endif
- orig_resid = 0;
- if (flags & MSG_PEEK) {
- if (paddr)
- *paddr = m_copy(m, 0, m->m_len);
- m = m->m_next;
- } else {
- sbfree(&so->so_rcv, m);
- if (paddr) {
- *paddr = m;
- so->so_rcv.sb_mb = m->m_next;
- m->m_next = 0;
- m = so->so_rcv.sb_mb;
- } else {
- MFREE(m, so->so_rcv.sb_mb);
- m = so->so_rcv.sb_mb;
- }
- }
- }
- while (m && m->m_type == MT_CONTROL && error == 0) {
- if (flags & MSG_PEEK) {
- if (controlp)
- *controlp = m_copy(m, 0, m->m_len);
- m = m->m_next;
- } else {
- sbfree(&so->so_rcv, m);
- if (controlp) {
- if (pr->pr_domain->dom_externalize &&
- mtod(m, struct cmsghdr *)->cmsg_type ==
- SCM_RIGHTS)
- error = (*pr->pr_domain->dom_externalize)(m);
- *controlp = m;
- so->so_rcv.sb_mb = m->m_next;
- m->m_next = 0;
- m = so->so_rcv.sb_mb;
- } else {
- MFREE(m, so->so_rcv.sb_mb);
- m = so->so_rcv.sb_mb;
- }
- }
- if (controlp) {
- orig_resid = 0;
- controlp = &(*controlp)->m_next;
- }
- }
- if (m) {
- if ((flags & MSG_PEEK) == 0)
- m->m_nextpkt = nextrecord;
- type = m->m_type;
- if (type == MT_OOBDATA)
- flags |= MSG_OOB;
- }
- moff = 0;
- offset = 0;
- while (m && uio->uio_resid > 0 && error == 0) {
- if (m->m_type == MT_OOBDATA) {
- if (type != MT_OOBDATA)
- break;
- } else if (type == MT_OOBDATA)
- break;
-#ifdef DIAGNOSTIC
- else if (m->m_type != MT_DATA && m->m_type != MT_HEADER)
- panic("receive 3");
-#endif
- so->so_state &= ~SS_RCVATMARK;
- len = uio->uio_resid;
- if (so->so_oobmark && len > so->so_oobmark - offset)
- len = so->so_oobmark - offset;
- if (len > m->m_len - moff)
- len = m->m_len - moff;
- /*
- * If mp is set, just pass back the mbufs.
- * Otherwise copy them out via the uio, then free.
- * Sockbuf must be consistent here (points to current mbuf,
- * it points to next record) when we drop priority;
- * we must note any additions to the sockbuf when we
- * block interrupts again.
- */
- if (mp == 0) {
- splx(s);
- error = uiomove(mtod(m, caddr_t) + moff, (int)len, uio);
- s = splnet();
- if (error)
- goto release;
- } else
- uio->uio_resid -= len;
- if (len == m->m_len - moff) {
- if (m->m_flags & M_EOR)
- flags |= MSG_EOR;
- if (flags & MSG_PEEK) {
- m = m->m_next;
- moff = 0;
- } else {
- nextrecord = m->m_nextpkt;
- sbfree(&so->so_rcv, m);
- if (mp) {
- *mp = m;
- mp = &m->m_next;
- so->so_rcv.sb_mb = m = m->m_next;
- *mp = (struct mbuf *)0;
- } else {
- MFREE(m, so->so_rcv.sb_mb);
- m = so->so_rcv.sb_mb;
- }
- if (m)
- m->m_nextpkt = nextrecord;
- }
- } else {
- if (flags & MSG_PEEK)
- moff += len;
- else {
- if (mp)
- *mp = m_copym(m, 0, len, M_WAIT);
- m->m_data += len;
- m->m_len -= len;
- so->so_rcv.sb_cc -= len;
- }
- }
- if (so->so_oobmark) {
- if ((flags & MSG_PEEK) == 0) {
- so->so_oobmark -= len;
- if (so->so_oobmark == 0) {
- so->so_state |= SS_RCVATMARK;
- break;
- }
- } else {
- offset += len;
- if (offset == so->so_oobmark)
- break;
- }
- }
- if (flags & MSG_EOR)
- break;
- /*
- * If the MSG_WAITALL flag is set (for non-atomic socket),
- * we must not quit until "uio->uio_resid == 0" or an error
- * termination. If a signal/timeout occurs, return
- * with a short count but without error.
- * Keep sockbuf locked against other readers.
- */
- while (flags & MSG_WAITALL && m == 0 && uio->uio_resid > 0 &&
- !sosendallatonce(so) && !nextrecord) {
- if (so->so_error || so->so_state & SS_CANTRCVMORE)
- break;
- error = sbwait(&so->so_rcv);
- if (error) {
- sbunlock(&so->so_rcv);
- splx(s);
- return (0);
- }
- m = so->so_rcv.sb_mb;
- if (m)
- nextrecord = m->m_nextpkt;
- }
- }
-
- if (m && pr->pr_flags & PR_ATOMIC) {
- flags |= MSG_TRUNC;
- if ((flags & MSG_PEEK) == 0)
- (void) sbdroprecord(&so->so_rcv);
- }
- if ((flags & MSG_PEEK) == 0) {
- if (m == 0)
- so->so_rcv.sb_mb = nextrecord;
- if (pr->pr_flags & PR_WANTRCVD && so->so_pcb)
- (*pr->pr_usrreqs->pru_rcvd)(so, flags);
- }
- if (orig_resid == uio->uio_resid && orig_resid &&
- (flags & MSG_EOR) == 0 && (so->so_state & SS_CANTRCVMORE) == 0) {
- sbunlock(&so->so_rcv);
- splx(s);
- goto restart;
- }
-
- if (flagsp)
- *flagsp |= flags;
-release:
- sbunlock(&so->so_rcv);
- splx(s);
- return (error);
-}
-
-int
-soshutdown(so, how)
- register struct socket *so;
- register int how;
-{
- register struct protosw *pr = so->so_proto;
-
- how++;
- if (how & FREAD)
- sorflush(so);
- if (how & FWRITE)
- return ((*pr->pr_usrreqs->pru_shutdown)(so));
- return (0);
-}
-
-void
-sorflush(so)
- register struct socket *so;
-{
- register struct sockbuf *sb = &so->so_rcv;
- register struct protosw *pr = so->so_proto;
- register int s;
- struct sockbuf asb;
-
- sb->sb_flags |= SB_NOINTR;
- (void) sblock(sb, M_WAITOK);
- s = splimp();
- socantrcvmore(so);
- sbunlock(sb);
- asb = *sb;
- bzero((caddr_t)sb, sizeof (*sb));
- splx(s);
- if (pr->pr_flags & PR_RIGHTS && pr->pr_domain->dom_dispose)
- (*pr->pr_domain->dom_dispose)(asb.sb_mb);
- sbrelease(&asb);
-}
-
-int
-sosetopt(so, level, optname, m0)
- register struct socket *so;
- int level, optname;
- struct mbuf *m0;
-{
- int error = 0;
- register struct mbuf *m = m0;
-
- if (level != SOL_SOCKET) {
- if (so->so_proto && so->so_proto->pr_ctloutput)
- return ((*so->so_proto->pr_ctloutput)
- (PRCO_SETOPT, so, level, optname, &m0));
- error = ENOPROTOOPT;
- } else {
- switch (optname) {
-
- case SO_LINGER:
- if (m == NULL || m->m_len != sizeof (struct linger)) {
- error = EINVAL;
- goto bad;
- }
- so->so_linger = mtod(m, struct linger *)->l_linger;
- /* fall thru... */
-
- case SO_DEBUG:
- case SO_KEEPALIVE:
- case SO_DONTROUTE:
- case SO_USELOOPBACK:
- case SO_BROADCAST:
- case SO_REUSEADDR:
- case SO_REUSEPORT:
- case SO_OOBINLINE:
- case SO_TIMESTAMP:
- if (m == NULL || m->m_len < sizeof (int)) {
- error = EINVAL;
- goto bad;
- }
- if (*mtod(m, int *))
- so->so_options |= optname;
- else
- so->so_options &= ~optname;
- break;
-
- case SO_SNDBUF:
- case SO_RCVBUF:
- case SO_SNDLOWAT:
- case SO_RCVLOWAT:
- {
- int optval;
-
- if (m == NULL || m->m_len < sizeof (int)) {
- error = EINVAL;
- goto bad;
- }
-
- /*
- * Values < 1 make no sense for any of these
- * options, so disallow them.
- */
- optval = *mtod(m, int *);
- if (optval < 1) {
- error = EINVAL;
- goto bad;
- }
-
- switch (optname) {
-
- case SO_SNDBUF:
- case SO_RCVBUF:
- if (sbreserve(optname == SO_SNDBUF ?
- &so->so_snd : &so->so_rcv,
- (u_long) optval) == 0) {
- error = ENOBUFS;
- goto bad;
- }
- break;
-
- /*
- * Make sure the low-water is never greater than
- * the high-water.
- */
- case SO_SNDLOWAT:
- so->so_snd.sb_lowat =
- (optval > so->so_snd.sb_hiwat) ?
- so->so_snd.sb_hiwat : optval;
- break;
- case SO_RCVLOWAT:
- so->so_rcv.sb_lowat =
- (optval > so->so_rcv.sb_hiwat) ?
- so->so_rcv.sb_hiwat : optval;
- break;
- }
- break;
- }
-
- case SO_SNDTIMEO:
- case SO_RCVTIMEO:
- {
- struct timeval *tv;
- short val;
-
- if (m == NULL || m->m_len < sizeof (*tv)) {
- error = EINVAL;
- goto bad;
- }
- tv = mtod(m, struct timeval *);
- if (tv->tv_sec > SHRT_MAX / hz - hz) {
- error = EDOM;
- goto bad;
- }
- val = tv->tv_sec * hz + tv->tv_usec / tick;
-
- switch (optname) {
-
- case SO_SNDTIMEO:
- so->so_snd.sb_timeo = val;
- break;
- case SO_RCVTIMEO:
- so->so_rcv.sb_timeo = val;
- break;
- }
- break;
- }
-
- case SO_PRIVSTATE:
- /* we don't care what the parameter is... */
- so->so_state &= ~SS_PRIV;
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- if (error == 0 && so->so_proto && so->so_proto->pr_ctloutput) {
- (void) ((*so->so_proto->pr_ctloutput)
- (PRCO_SETOPT, so, level, optname, &m0));
- m = NULL; /* freed by protocol */
- }
- }
-bad:
- if (m)
- (void) m_free(m);
- return (error);
-}
-
-int
-sogetopt(so, level, optname, mp)
- register struct socket *so;
- int level, optname;
- struct mbuf **mp;
-{
- register struct mbuf *m;
-
- if (level != SOL_SOCKET) {
- if (so->so_proto && so->so_proto->pr_ctloutput) {
- return ((*so->so_proto->pr_ctloutput)
- (PRCO_GETOPT, so, level, optname, mp));
- } else
- return (ENOPROTOOPT);
- } else {
- m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof (int);
-
- switch (optname) {
-
- case SO_LINGER:
- m->m_len = sizeof (struct linger);
- mtod(m, struct linger *)->l_onoff =
- so->so_options & SO_LINGER;
- mtod(m, struct linger *)->l_linger = so->so_linger;
- break;
-
- case SO_USELOOPBACK:
- case SO_DONTROUTE:
- case SO_DEBUG:
- case SO_KEEPALIVE:
- case SO_REUSEADDR:
- case SO_REUSEPORT:
- case SO_BROADCAST:
- case SO_OOBINLINE:
- case SO_TIMESTAMP:
- *mtod(m, int *) = so->so_options & optname;
- break;
-
- case SO_PRIVSTATE:
- *mtod(m, int *) = so->so_state & SS_PRIV;
- break;
-
- case SO_TYPE:
- *mtod(m, int *) = so->so_type;
- break;
-
- case SO_ERROR:
- *mtod(m, int *) = so->so_error;
- so->so_error = 0;
- break;
-
- case SO_SNDBUF:
- *mtod(m, int *) = so->so_snd.sb_hiwat;
- break;
-
- case SO_RCVBUF:
- *mtod(m, int *) = so->so_rcv.sb_hiwat;
- break;
-
- case SO_SNDLOWAT:
- *mtod(m, int *) = so->so_snd.sb_lowat;
- break;
-
- case SO_RCVLOWAT:
- *mtod(m, int *) = so->so_rcv.sb_lowat;
- break;
-
- case SO_SNDTIMEO:
- case SO_RCVTIMEO:
- {
- int val = (optname == SO_SNDTIMEO ?
- so->so_snd.sb_timeo : so->so_rcv.sb_timeo);
-
- m->m_len = sizeof(struct timeval);
- mtod(m, struct timeval *)->tv_sec = val / hz;
- mtod(m, struct timeval *)->tv_usec =
- (val % hz) * tick;
- break;
- }
-
- default:
- (void)m_free(m);
- return (ENOPROTOOPT);
- }
- *mp = m;
- return (0);
- }
-}
-
-void
-sohasoutofband(so)
- register struct socket *so;
-{
-#if 0 /* FIXME: For now we just ignore out of band data */
- struct proc *p;
-
- if (so->so_pgid < 0)
- gsignal(-so->so_pgid, SIGURG);
- else if (so->so_pgid > 0 && (p = pfind(so->so_pgid)) != 0)
- psignal(p, SIGURG);
- selwakeup(&so->so_rcv.sb_sel);
-#endif
-}
diff --git a/c/src/libnetworking/kern/uipc_socket2.c b/c/src/libnetworking/kern/uipc_socket2.c
deleted file mode 100644
index 0539d2c5f3..0000000000
--- a/c/src/libnetworking/kern/uipc_socket2.c
+++ /dev/null
@@ -1,965 +0,0 @@
-/*
- * This file has undergone several changes to reflect the
- * differences between the RTEMS and FreeBSD kernels.
- */
-
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 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.
- *
- * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
-#include <sys/file.h>
-#include <sys/buf.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/signalvar.h>
-#include <sys/sysctl.h>
-
-/*
- * Primitive routines for operating on sockets and socket buffers
- */
-
-u_long sb_max = SB_MAX; /* XXX should be static */
-SYSCTL_INT(_kern, KERN_MAXSOCKBUF, maxsockbuf, CTLFLAG_RW, &sb_max, 0, "")
-
-static u_long sb_efficiency = 8; /* parameter for sbreserve() */
-SYSCTL_INT(_kern, OID_AUTO, sockbuf_waste_factor, CTLFLAG_RW, &sb_efficiency,
- 0, "");
-
-/*
- * Procedures to manipulate state flags of socket
- * and do appropriate wakeups. Normal sequence from the
- * active (originating) side is that soisconnecting() is
- * called during processing of connect() call,
- * resulting in an eventual call to soisconnected() if/when the
- * connection is established. When the connection is torn down
- * soisdisconnecting() is called during processing of disconnect() call,
- * and soisdisconnected() is called when the connection to the peer
- * is totally severed. The semantics of these routines are such that
- * connectionless protocols can call soisconnected() and soisdisconnected()
- * only, bypassing the in-progress calls when setting up a ``connection''
- * takes no time.
- *
- * From the passive side, a socket is created with
- * two queues of sockets: so_q0 for connections in progress
- * and so_q for connections already made and awaiting user acceptance.
- * As a protocol is preparing incoming connections, it creates a socket
- * structure queued on so_q0 by calling sonewconn(). When the connection
- * is established, soisconnected() is called, and transfers the
- * socket structure to so_q, making it available to accept().
- *
- * If a socket is closed with sockets on either
- * so_q0 or so_q, these sockets are dropped.
- *
- * If higher level protocols are implemented in
- * the kernel, the wakeups done here will sometimes
- * cause software-interrupt process scheduling.
- */
-
-void
-soisconnecting(so)
- register struct socket *so;
-{
-
- so->so_state &= ~(SS_ISCONNECTED|SS_ISDISCONNECTING);
- so->so_state |= SS_ISCONNECTING;
-}
-
-void
-soisconnected(so)
- register struct socket *so;
-{
- register struct socket *head = so->so_head;
-
- so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING);
- so->so_state |= SS_ISCONNECTED;
- if (head && (so->so_state & SS_INCOMP)) {
- TAILQ_REMOVE(&head->so_incomp, so, so_list);
- head->so_incqlen--;
- so->so_state &= ~SS_INCOMP;
- TAILQ_INSERT_TAIL(&head->so_comp, so, so_list);
- so->so_state |= SS_COMP;
- sorwakeup(head);
- soconnwakeup(head);
- } else {
- soconnwakeup(so);
- sorwakeup(so);
- sowwakeup(so);
- }
-}
-
-void
-soisdisconnecting(so)
- register struct socket *so;
-{
-
- so->so_state &= ~SS_ISCONNECTING;
- so->so_state |= (SS_ISDISCONNECTING|SS_CANTRCVMORE|SS_CANTSENDMORE);
- soconnwakeup(so);
- sowwakeup(so);
- sorwakeup(so);
-}
-
-void
-soisdisconnected(so)
- register struct socket *so;
-{
-
- so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
- so->so_state |= (SS_CANTRCVMORE|SS_CANTSENDMORE);
- soconnwakeup(so);
- sowwakeup(so);
- sorwakeup(so);
-}
-
-/*
- * Return a random connection that hasn't been serviced yet and
- * is eligible for discard. There is a one in qlen chance that
- * we will return a null, saying that there are no dropable
- * requests. In this case, the protocol specific code should drop
- * the new request. This insures fairness.
- *
- * This may be used in conjunction with protocol specific queue
- * congestion routines.
- */
-struct socket *
-sodropablereq(head)
- register struct socket *head;
-{
- register struct socket *so;
- unsigned int i, j, qlen, m;
-
- static int rnd;
- static long old_mono_secs;
- static unsigned int cur_cnt, old_cnt;
-
- if ((i = (m = rtems_bsdnet_seconds_since_boot()) - old_mono_secs) != 0) {
- old_mono_secs = m;
- old_cnt = cur_cnt / i;
- cur_cnt = 0;
- }
-
- so = TAILQ_FIRST(&head->so_incomp);
- if (!so)
- return (so);
-
- qlen = head->so_incqlen;
- if (++cur_cnt > qlen || old_cnt > qlen) {
- rnd = (314159 * rnd + 66329) & 0xffff;
- j = ((qlen + 1) * rnd) >> 16;
-
- while (j-- && so)
- so = TAILQ_NEXT(so, so_list);
- }
-
- return (so);
-}
-
-/*
- * When an attempt at a new connection is noted on a socket
- * which accepts connections, sonewconn is called. If the
- * connection is possible (subject to space constraints, etc.)
- * then we allocate a new structure, propoerly linked into the
- * data structure of the original socket, and return this.
- * Connstatus may be 0, or SO_ISCONFIRMING, or SO_ISCONNECTED.
- *
- * Currently, sonewconn() is defined as sonewconn1() in socketvar.h
- * to catch calls that are missing the (new) second parameter.
- */
-struct socket *
-sonewconn1(head, connstatus)
- register struct socket *head;
- int connstatus;
-{
- register struct socket *so;
-
- if (head->so_qlen > 3 * head->so_qlimit / 2)
- return ((struct socket *)0);
- MALLOC(so, struct socket *, sizeof(*so), M_SOCKET, M_DONTWAIT);
- if (so == NULL)
- return ((struct socket *)0);
- bzero((caddr_t)so, sizeof(*so));
- so->so_head = head;
- so->so_type = head->so_type;
- so->so_options = head->so_options &~ SO_ACCEPTCONN;
- so->so_linger = head->so_linger;
- so->so_state = head->so_state | SS_NOFDREF;
- so->so_proto = head->so_proto;
- so->so_timeo = head->so_timeo;
- so->so_pgid = head->so_pgid;
- so->so_uid = head->so_uid;
- (void) soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat);
- if (connstatus) {
- TAILQ_INSERT_TAIL(&head->so_comp, so, so_list);
- so->so_state |= SS_COMP;
- } else {
- TAILQ_INSERT_TAIL(&head->so_incomp, so, so_list);
- so->so_state |= SS_INCOMP;
- head->so_incqlen++;
- }
- head->so_qlen++;
- if ((*so->so_proto->pr_usrreqs->pru_attach)(so, 0)) {
- if (so->so_state & SS_COMP) {
- TAILQ_REMOVE(&head->so_comp, so, so_list);
- } else {
- TAILQ_REMOVE(&head->so_incomp, so, so_list);
- head->so_incqlen--;
- }
- head->so_qlen--;
- (void) free((caddr_t)so, M_SOCKET);
- return ((struct socket *)0);
- }
- if (connstatus) {
- sorwakeup(head);
- soconnwakeup(head);
- so->so_state |= connstatus;
- }
- return (so);
-}
-
-/*
- * Socantsendmore indicates that no more data will be sent on the
- * socket; it would normally be applied to a socket when the user
- * informs the system that no more data is to be sent, by the protocol
- * code (in case PRU_SHUTDOWN). Socantrcvmore indicates that no more data
- * will be received, and will normally be applied to the socket by a
- * protocol when it detects that the peer will send no more data.
- * Data queued for reading in the socket may yet be read.
- */
-
-void
-socantsendmore(so)
- struct socket *so;
-{
-
- so->so_state |= SS_CANTSENDMORE;
- sowwakeup(so);
-}
-
-void
-socantrcvmore(so)
- struct socket *so;
-{
-
- so->so_state |= SS_CANTRCVMORE;
- sorwakeup(so);
-}
-
-/*
- * Socket buffer (struct sockbuf) utility routines.
- *
- * Each socket contains two socket buffers: one for sending data and
- * one for receiving data. Each buffer contains a queue of mbufs,
- * information about the number of mbufs and amount of data in the
- * queue, and other fields allowing select() statements and notification
- * on data availability to be implemented.
- *
- * Data stored in a socket buffer is maintained as a list of records.
- * Each record is a list of mbufs chained together with the m_next
- * field. Records are chained together with the m_nextpkt field. The upper
- * level routine soreceive() expects the following conventions to be
- * observed when placing information in the receive buffer:
- *
- * 1. If the protocol requires each message be preceded by the sender's
- * name, then a record containing that name must be present before
- * any associated data (mbuf's must be of type MT_SONAME).
- * 2. If the protocol supports the exchange of ``access rights'' (really
- * just additional data associated with the message), and there are
- * ``rights'' to be received, then a record containing this data
- * should be present (mbuf's must be of type MT_RIGHTS).
- * 3. If a name or rights record exists, then it must be followed by
- * a data record, perhaps of zero length.
- *
- * Before using a new socket structure it is first necessary to reserve
- * buffer space to the socket, by calling sbreserve(). This should commit
- * some of the available buffer space in the system buffer pool for the
- * socket (currently, it does nothing but enforce limits). The space
- * should be released by calling sbrelease() when the socket is destroyed.
- */
-
-int
-soreserve(so, sndcc, rcvcc)
- register struct socket *so;
- u_long sndcc, rcvcc;
-{
-
- if (sbreserve(&so->so_snd, sndcc) == 0)
- goto bad;
- if (sbreserve(&so->so_rcv, rcvcc) == 0)
- goto bad2;
- if (so->so_rcv.sb_lowat == 0)
- so->so_rcv.sb_lowat = 1;
- if (so->so_snd.sb_lowat == 0)
- so->so_snd.sb_lowat = MCLBYTES;
- if (so->so_snd.sb_lowat > so->so_snd.sb_hiwat)
- so->so_snd.sb_lowat = so->so_snd.sb_hiwat;
- return (0);
-bad2:
- sbrelease(&so->so_snd);
-bad:
- return (ENOBUFS);
-}
-
-/*
- * Allot mbufs to a sockbuf.
- * Attempt to scale mbmax so that mbcnt doesn't become limiting
- * if buffering efficiency is near the normal case.
- */
-int
-sbreserve(sb, cc)
- struct sockbuf *sb;
- u_long cc;
-{
-
- if (cc > sb_max * MCLBYTES / (MSIZE + MCLBYTES))
- return (0);
- sb->sb_hiwat = cc;
- sb->sb_mbmax = min(cc * sb_efficiency, sb_max);
- if (sb->sb_lowat > sb->sb_hiwat)
- sb->sb_lowat = sb->sb_hiwat;
- return (1);
-}
-
-/*
- * Free mbufs held by a socket, and reserved mbuf space.
- */
-void
-sbrelease(sb)
- struct sockbuf *sb;
-{
-
- sbflush(sb);
- sb->sb_hiwat = sb->sb_mbmax = 0;
-}
-
-/*
- * Routines to add and remove
- * data from an mbuf queue.
- *
- * The routines sbappend() or sbappendrecord() are normally called to
- * append new mbufs to a socket buffer, after checking that adequate
- * space is available, comparing the function sbspace() with the amount
- * of data to be added. sbappendrecord() differs from sbappend() in
- * that data supplied is treated as the beginning of a new record.
- * To place a sender's address, optional access rights, and data in a
- * socket receive buffer, sbappendaddr() should be used. To place
- * access rights and data in a socket receive buffer, sbappendrights()
- * should be used. In either case, the new data begins a new record.
- * Note that unlike sbappend() and sbappendrecord(), these routines check
- * for the caller that there will be enough space to store the data.
- * Each fails if there is not enough space, or if it cannot find mbufs
- * to store additional information in.
- *
- * Reliable protocols may use the socket send buffer to hold data
- * awaiting acknowledgement. Data is normally copied from a socket
- * send buffer in a protocol with m_copy for output to a peer,
- * and then removing the data from the socket buffer with sbdrop()
- * or sbdroprecord() when the data is acknowledged by the peer.
- */
-
-/*
- * Append mbuf chain m to the last record in the
- * socket buffer sb. The additional space associated
- * the mbuf chain is recorded in sb. Empty mbufs are
- * discarded and mbufs are compacted where possible.
- */
-void
-sbappend(sb, m)
- struct sockbuf *sb;
- struct mbuf *m;
-{
- register struct mbuf *n;
-
- if (m == 0)
- return;
- n = sb->sb_mb;
- if (n) {
- while (n->m_nextpkt)
- n = n->m_nextpkt;
- do {
- if (n->m_flags & M_EOR) {
- sbappendrecord(sb, m); /* XXXXXX!!!! */
- return;
- }
- } while (n->m_next && (n = n->m_next));
- }
- sbcompress(sb, m, n);
-}
-
-#ifdef SOCKBUF_DEBUG
-void
-sbcheck(sb)
- register struct sockbuf *sb;
-{
- register struct mbuf *m;
- register int len = 0, mbcnt = 0;
-
- for (m = sb->sb_mb; m; m = m->m_next) {
- len += m->m_len;
- mbcnt += MSIZE;
- if (m->m_flags & M_EXT) /*XXX*/ /* pretty sure this is bogus */
- mbcnt += m->m_ext.ext_size;
- if (m->m_nextpkt)
- panic("sbcheck nextpkt");
- }
- if (len != sb->sb_cc || mbcnt != sb->sb_mbcnt) {
- printf("cc %d != %d || mbcnt %d != %d\n", len, sb->sb_cc,
- mbcnt, sb->sb_mbcnt);
- panic("sbcheck");
- }
-}
-#endif
-
-/*
- * As above, except the mbuf chain
- * begins a new record.
- */
-void
-sbappendrecord(sb, m0)
- register struct sockbuf *sb;
- register struct mbuf *m0;
-{
- register struct mbuf *m;
-
- if (m0 == 0)
- return;
- m = sb->sb_mb;
- if (m)
- while (m->m_nextpkt)
- m = m->m_nextpkt;
- /*
- * Put the first mbuf on the queue.
- * Note this permits zero length records.
- */
- sballoc(sb, m0);
- if (m)
- m->m_nextpkt = m0;
- else
- sb->sb_mb = m0;
- m = m0->m_next;
- m0->m_next = 0;
- if (m && (m0->m_flags & M_EOR)) {
- m0->m_flags &= ~M_EOR;
- m->m_flags |= M_EOR;
- }
- sbcompress(sb, m, m0);
-}
-
-/*
- * As above except that OOB data
- * is inserted at the beginning of the sockbuf,
- * but after any other OOB data.
- */
-void
-sbinsertoob(sb, m0)
- register struct sockbuf *sb;
- register struct mbuf *m0;
-{
- register struct mbuf *m;
- register struct mbuf **mp;
-
- if (m0 == 0)
- return;
- for (mp = &sb->sb_mb; *mp ; mp = &((*mp)->m_nextpkt)) {
- m = *mp;
- again:
- switch (m->m_type) {
-
- case MT_OOBDATA:
- continue; /* WANT next train */
-
- case MT_CONTROL:
- m = m->m_next;
- if (m)
- goto again; /* inspect THIS train further */
- }
- break;
- }
- /*
- * Put the first mbuf on the queue.
- * Note this permits zero length records.
- */
- sballoc(sb, m0);
- m0->m_nextpkt = *mp;
- *mp = m0;
- m = m0->m_next;
- m0->m_next = 0;
- if (m && (m0->m_flags & M_EOR)) {
- m0->m_flags &= ~M_EOR;
- m->m_flags |= M_EOR;
- }
- sbcompress(sb, m, m0);
-}
-
-/*
- * Append address and data, and optionally, control (ancillary) data
- * to the receive queue of a socket. If present,
- * m0 must include a packet header with total length.
- * Returns 0 if no space in sockbuf or insufficient mbufs.
- */
-int
-sbappendaddr(sb, asa, m0, control)
- register struct sockbuf *sb;
- struct sockaddr *asa;
- struct mbuf *m0, *control;
-{
- register struct mbuf *m, *n;
- int space = asa->sa_len;
-
-if (m0 && (m0->m_flags & M_PKTHDR) == 0)
-panic("sbappendaddr");
- if (m0)
- space += m0->m_pkthdr.len;
- for (n = control; n; n = n->m_next) {
- space += n->m_len;
- if (n->m_next == 0) /* keep pointer to last control buf */
- break;
- }
- if (space > sbspace(sb))
- return (0);
- if (asa->sa_len > MLEN)
- return (0);
- MGET(m, M_DONTWAIT, MT_SONAME);
- if (m == 0)
- return (0);
- m->m_len = asa->sa_len;
- bcopy((caddr_t)asa, mtod(m, caddr_t), asa->sa_len);
- if (n)
- n->m_next = m0; /* concatenate data to control */
- else
- control = m0;
- m->m_next = control;
- for (n = m; n; n = n->m_next)
- sballoc(sb, n);
- n = sb->sb_mb;
- if (n) {
- while (n->m_nextpkt)
- n = n->m_nextpkt;
- n->m_nextpkt = m;
- } else
- sb->sb_mb = m;
- return (1);
-}
-
-int
-sbappendcontrol(sb, m0, control)
- struct sockbuf *sb;
- struct mbuf *control, *m0;
-{
- register struct mbuf *m, *n;
- int space = 0;
-
- if (control == 0)
- panic("sbappendcontrol");
- for (m = control; ; m = m->m_next) {
- space += m->m_len;
- if (m->m_next == 0)
- break;
- }
- n = m; /* save pointer to last control buffer */
- for (m = m0; m; m = m->m_next)
- space += m->m_len;
- if (space > sbspace(sb))
- return (0);
- n->m_next = m0; /* concatenate data to control */
- for (m = control; m; m = m->m_next)
- sballoc(sb, m);
- n = sb->sb_mb;
- if (n) {
- while (n->m_nextpkt)
- n = n->m_nextpkt;
- n->m_nextpkt = control;
- } else
- sb->sb_mb = control;
- return (1);
-}
-
-/*
- * Compress mbuf chain m into the socket
- * buffer sb following mbuf n. If n
- * is null, the buffer is presumed empty.
- */
-void
-sbcompress(sb, m, n)
- register struct sockbuf *sb;
- register struct mbuf *m, *n;
-{
- register int eor = 0;
- register struct mbuf *o;
-
- while (m) {
- eor |= m->m_flags & M_EOR;
- if (m->m_len == 0 &&
- (eor == 0 ||
- (((o = m->m_next) || (o = n)) &&
- o->m_type == m->m_type))) {
- m = m_free(m);
- continue;
- }
- if (n && (n->m_flags & (M_EXT | M_EOR)) == 0 &&
- (n->m_data + n->m_len + m->m_len) < &n->m_dat[MLEN] &&
- n->m_type == m->m_type) {
- bcopy(mtod(m, caddr_t), mtod(n, caddr_t) + n->m_len,
- (unsigned)m->m_len);
- n->m_len += m->m_len;
- sb->sb_cc += m->m_len;
- m = m_free(m);
- continue;
- }
- if (n)
- n->m_next = m;
- else
- sb->sb_mb = m;
- sballoc(sb, m);
- n = m;
- m->m_flags &= ~M_EOR;
- m = m->m_next;
- n->m_next = 0;
- }
- if (eor) {
- if (n)
- n->m_flags |= eor;
- else
- printf("semi-panic: sbcompress\n");
- }
-}
-
-/*
- * Free all mbufs in a sockbuf.
- * Check that all resources are reclaimed.
- */
-void
-sbflush(sb)
- register struct sockbuf *sb;
-{
-
- if (sb->sb_flags & SB_LOCK)
- panic("sbflush");
- while (sb->sb_mbcnt)
- sbdrop(sb, (int)sb->sb_cc);
- if (sb->sb_cc || sb->sb_mb)
- panic("sbflush 2");
-}
-
-/*
- * Drop data from (the front of) a sockbuf.
- */
-void
-sbdrop(sb, len)
- register struct sockbuf *sb;
- register int len;
-{
- register struct mbuf *m, *mn;
- struct mbuf *next;
-
- next = (m = sb->sb_mb) ? m->m_nextpkt : 0;
- while (len > 0) {
- if (m == 0) {
- if (next == 0)
- panic("sbdrop");
- m = next;
- next = m->m_nextpkt;
- continue;
- }
- if (m->m_len > len) {
- m->m_len -= len;
- m->m_data += len;
- sb->sb_cc -= len;
- break;
- }
- len -= m->m_len;
- sbfree(sb, m);
- MFREE(m, mn);
- m = mn;
- }
- while (m && m->m_len == 0) {
- sbfree(sb, m);
- MFREE(m, mn);
- m = mn;
- }
- if (m) {
- sb->sb_mb = m;
- m->m_nextpkt = next;
- } else
- sb->sb_mb = next;
-}
-
-/*
- * Drop a record off the front of a sockbuf
- * and move the next record to the front.
- */
-void
-sbdroprecord(sb)
- register struct sockbuf *sb;
-{
- register struct mbuf *m, *mn;
-
- m = sb->sb_mb;
- if (m) {
- sb->sb_mb = m->m_nextpkt;
- do {
- sbfree(sb, m);
- MFREE(m, mn);
- m = mn;
- } while (m);
- }
-}
-
-/*
- * Create a "control" mbuf containing the specified data
- * with the specified type for presentation on a socket buffer.
- */
-struct mbuf *
-sbcreatecontrol(p, size, type, level)
- caddr_t p;
- register int size;
- int type, level;
-{
- register struct cmsghdr *cp;
- struct mbuf *m;
-
- if ((m = m_get(M_DONTWAIT, MT_CONTROL)) == NULL)
- return ((struct mbuf *) NULL);
- cp = mtod(m, struct cmsghdr *);
- /* XXX check size? */
- (void)memcpy(CMSG_DATA(cp), p, size);
- size += sizeof(*cp);
- m->m_len = size;
- cp->cmsg_len = size;
- cp->cmsg_level = level;
- cp->cmsg_type = type;
- return (m);
-}
-
-#ifdef PRU_OLDSTYLE
-/*
- * The following routines mediate between the old-style `pr_usrreq'
- * protocol implementations and the new-style `struct pr_usrreqs'
- * calling convention.
- */
-
-/* syntactic sugar */
-#define nomb (struct mbuf *)0
-
-static int
-old_abort(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_ABORT, nomb, nomb, nomb);
-}
-
-static int
-old_accept(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_ACCEPT, nomb, nam, nomb);
-}
-
-static int
-old_attach(struct socket *so, int proto)
-{
- return so->so_proto->pr_ousrreq(so, PRU_ATTACH, nomb,
- (struct mbuf *)proto, /* XXX */
- nomb);
-}
-
-static int
-old_bind(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_BIND, nomb, nam, nomb);
-}
-
-static int
-old_connect(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_CONNECT, nomb, nam, nomb);
-}
-
-static int
-old_connect2(struct socket *so1, struct socket *so2)
-{
- return so1->so_proto->pr_ousrreq(so1, PRU_CONNECT2, nomb,
- (struct mbuf *)so2, nomb);
-}
-
-static int
-old_control(struct socket *so, int cmd, caddr_t data, struct ifnet *ifp)
-{
- return so->so_proto->pr_ousrreq(so, PRU_CONTROL, (struct mbuf *)cmd,
- (struct mbuf *)data,
- (struct mbuf *)ifp);
-}
-
-static int
-old_detach(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_DETACH, nomb, nomb, nomb);
-}
-
-static int
-old_disconnect(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_DISCONNECT, nomb, nomb, nomb);
-}
-
-static int
-old_listen(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_LISTEN, nomb, nomb, nomb);
-}
-
-static int
-old_peeraddr(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_PEERADDR, nomb, nam, nomb);
-}
-
-static int
-old_rcvd(struct socket *so, int flags)
-{
- return so->so_proto->pr_ousrreq(so, PRU_RCVD, nomb,
- (struct mbuf *)flags, /* XXX */
- nomb);
-}
-
-static int
-old_rcvoob(struct socket *so, struct mbuf *m, int flags)
-{
- return so->so_proto->pr_ousrreq(so, PRU_RCVOOB, m,
- (struct mbuf *)flags, /* XXX */
- nomb);
-}
-
-static int
-old_send(struct socket *so, int flags, struct mbuf *m, struct mbuf *addr,
- struct mbuf *control)
-{
- int req;
-
- if (flags & PRUS_OOB) {
- req = PRU_SENDOOB;
- } else if(flags & PRUS_EOF) {
- req = PRU_SEND_EOF;
- } else {
- req = PRU_SEND;
- }
- return so->so_proto->pr_ousrreq(so, req, m, addr, control);
-}
-
-static int
-old_sense(struct socket *so, struct stat *sb)
-{
- return so->so_proto->pr_ousrreq(so, PRU_SENSE, (struct mbuf *)sb,
- nomb, nomb);
-}
-
-static int
-old_shutdown(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_SHUTDOWN, nomb, nomb, nomb);
-}
-
-static int
-old_sockaddr(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_SOCKADDR, nomb, nam, nomb);
-}
-
-struct pr_usrreqs pru_oldstyle = {
- old_abort, old_accept, old_attach, old_bind, old_connect,
- old_connect2, old_control, old_detach, old_disconnect,
- old_listen, old_peeraddr, old_rcvd, old_rcvoob, old_send,
- old_sense, old_shutdown, old_sockaddr
-};
-
-#endif /* PRU_OLDSTYLE */
-
-/*
- * Some routines that return EOPNOTSUPP for entry points that are not
- * supported by a protocol. Fill in as needed.
- */
-int
-pru_accept_notsupp(struct socket *so, struct mbuf *nam)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_connect2_notsupp(struct socket *so1, struct socket *so2)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_control_notsupp(struct socket *so, int cmd, caddr_t data,
- struct ifnet *ifp)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_listen_notsupp(struct socket *so)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_rcvd_notsupp(struct socket *so, int flags)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_rcvoob_notsupp(struct socket *so, struct mbuf *m, int flags)
-{
- return EOPNOTSUPP;
-}
-
-/*
- * This isn't really a ``null'' operation, but it's the default one
- * and doesn't do anything destructive.
- */
-int
-pru_sense_null(struct socket *so, struct stat *sb)
-{
- sb->st_blksize = so->so_snd.sb_hiwat;
- return 0;
-}
-
diff --git a/c/src/libnetworking/lib/Makefile.in b/c/src/libnetworking/lib/Makefile.in
deleted file mode 100644
index 869818fadf..0000000000
--- a/c/src/libnetworking/lib/Makefile.in
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=lib.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES=getprotoby syslog tftpDriver
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -DNOPOLL -DNOSELECT
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
diff --git a/c/src/libnetworking/lib/README b/c/src/libnetworking/lib/README
deleted file mode 100644
index 998bd5e708..0000000000
--- a/c/src/libnetworking/lib/README
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# $Id$
-#
-
-Sources from application-level (as opposed to kernel-level) libraries.
diff --git a/c/src/libnetworking/lib/getprotoby.c b/c/src/libnetworking/lib/getprotoby.c
deleted file mode 100644
index fc8de6e402..0000000000
--- a/c/src/libnetworking/lib/getprotoby.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * $Id$
- */
-
-#include <netdb.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-static const struct protoent prototab[] = {
- { "ip", NULL, IPPROTO_IP },
- { "icmp", NULL, IPPROTO_ICMP },
- { "tcp", NULL, IPPROTO_TCP },
- { "udp", NULL, IPPROTO_UDP },
- };
-
-/*
- * Dummy version of BSD getprotobyname()
- */
-struct protoent *
-getprotobyname (const char *name)
-{
- int i;
-
- for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
- if (strcmp (name, prototab[i].p_name) == 0)
- return (struct protoent *) &prototab[i];
- }
- return NULL;
-}
-
-/*
- * Dummy version of BSD getprotobynumber()
- */
-struct protoent *
-getprotobynumber (int proto)
-{
- int i;
-
- for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
- if (proto == prototab[i].p_proto)
- return (struct protoent *) &prototab[i];
- }
- return NULL;
-}
diff --git a/c/src/libnetworking/lib/syslog.c b/c/src/libnetworking/lib/syslog.c
deleted file mode 100644
index 0bb15bc78e..0000000000
--- a/c/src/libnetworking/lib/syslog.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * RTEMS version of syslog and associated routines
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <syslog.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include <unistd.h>
-
-static int LogStatus = LOG_CONS;
-static const char *LogTag = "syslog";
-static int LogFacility = LOG_USER;
-static int LogMask = 0xff;
-
-static int LogFd = -1;
-static rtems_id LogSemaphore;
-extern struct in_addr rtems_bsdnet_log_host_address;
-
-#define SYSLOG_PORT 514
-
-void
-syslog (int pri, const char *fmt, ...)
-{
- va_list ap;
-
- va_start (ap, fmt);
- vsyslog (pri, fmt, ap);
- va_end (ap);
-}
-
-/*
- * FIXME: Should cbuf be static? It could be if we put the mutex
- * around the entire body of this routine. Then we wouldn't
- * have to worry about blowing stacks with a local variable
- * that large. Could make cbuf bigger, too.
- */
-void
-vsyslog (int pri, const char *fmt, va_list ap)
-{
- int cnt;
- char *cp;
- char *msgp, cbuf[200];
- int sent;
-
- if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) {
- syslog (LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID,
- "syslog: unknown facility/priority: %#x", pri);
- pri &= LOG_PRIMASK|LOG_FACMASK;
- }
-
- if (!LOG_MASK(LOG_PRI(pri)) & LogMask)
- return;
-
- if ((pri & LOG_FACMASK) == 0)
- pri |= LogFacility;
-
- cnt = sprintf (cbuf, "<%d>", pri);
- cp = msgp = cbuf + cnt;
- if (LogTag) {
- const char *lp = LogTag;
- while ((*cp = *lp++) != '\0')
- cp++;
- }
- if (LogStatus & LOG_PID) {
- rtems_id tid;
- rtems_task_ident (RTEMS_SELF, 0, &tid);
- cnt = sprintf (cp, "[%#lx]", (unsigned long)tid);
- cp += cnt;
- }
- if (LogTag) {
- *cp++ = ':';
- *cp++ = ' ';
- }
- cnt = vsprintf (cp, fmt, ap);
- cnt += cp - cbuf;
- if (cbuf[cnt-1] == '\n')
- cbuf[--cnt] = '\0';
-
- if (LogStatus & LOG_PERROR)
- printf ("%s\n", cbuf);
-
- /*
- * Grab the mutex
- */
- sent = 0;
- if ((rtems_bsdnet_log_host_address.s_addr != INADDR_ANY)
- && (LogFd >= 0)
- && (rtems_semaphore_obtain (LogSemaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT) == RTEMS_SUCCESSFUL)) {
- /*
- * Set the destination address/port
- */
- struct sockaddr_in farAddress;
- farAddress.sin_family = AF_INET;
- farAddress.sin_port = htons (SYSLOG_PORT);
- farAddress.sin_addr = rtems_bsdnet_log_host_address;
- memset (farAddress.sin_zero, '\0', sizeof farAddress.sin_zero);
-
- /*
- * Send the message
- */
- if (sendto (LogFd, cbuf, cnt, 0, (struct sockaddr *)&farAddress, sizeof farAddress) >= 0)
- sent = 1;
- rtems_semaphore_release (LogSemaphore);
- }
- if (!sent && (LogStatus & LOG_CONS) && !(LogStatus & LOG_PERROR))
- printf ("%s\n", msgp);
-}
-
-void
-openlog (const char *ident, int logstat, int logfac)
-{
- rtems_status_code sc;
- struct sockaddr_in myAddress;
-
- if (ident != NULL)
- LogTag = ident;
- LogStatus = logstat;
- if (logfac != 0 && (logfac & ~LOG_FACMASK) == 0)
- LogFacility = logfac;
-
- /*
- * Create the socket
- */
- if ((LogFd = socket (AF_INET, SOCK_DGRAM, 0)) < 0) {
- printf ("Can't create syslog socket: %d\n", errno);
- return;
- }
-
- /*
- * Bind socket to name
- */
- myAddress.sin_family = AF_INET;
- myAddress.sin_addr.s_addr = INADDR_ANY;
- myAddress.sin_port = 0;
- memset (myAddress.sin_zero, '\0', sizeof myAddress.sin_zero);
- if (bind (LogFd, (struct sockaddr *)&myAddress, sizeof (myAddress)) < 0) {
- close (LogFd);
- LogFd = -1;
- printf ("Can't bind syslog socket: %d\n", errno);
- return;
- }
-
- /*
- * Create the mutex
- */
- sc = rtems_semaphore_create (rtems_build_name('s', 'L', 'o', 'g'),
- 1,
- RTEMS_PRIORITY |
- RTEMS_BINARY_SEMAPHORE |
- RTEMS_INHERIT_PRIORITY |
- RTEMS_NO_PRIORITY_CEILING |
- RTEMS_LOCAL,
- 0,
- &LogSemaphore);
- if (sc != RTEMS_SUCCESSFUL) {
- printf ("Can't create syslog seamphore: %d\n", sc);
- close (LogFd);
- LogFd = -1;
- }
-}
-
-void
-closelog(void)
-{
- if (LogFd >= 0) {
- close (LogFd);
- LogFd = -1;
- rtems_semaphore_delete (LogSemaphore);
- }
-}
-
-int
-setlogmask (int pmask)
-{
- int omask;
-
- omask = LogMask;
- if (pmask != 0)
- LogMask = pmask;
- return (omask);
-}
diff --git a/c/src/libnetworking/lib/tftpDriver.c b/c/src/libnetworking/lib/tftpDriver.c
deleted file mode 100644
index cf75623580..0000000000
--- a/c/src/libnetworking/lib/tftpDriver.c
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
- * Trivial File Transfer Protocol (RFC 1350)
- *
- * Transfer file to/from remote host
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-#include <stdio.h>
-#include <errno.h>
-#include <malloc.h>
-#include <string.h>
-#include <unistd.h>
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/rtems_bsdnet.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Range of UDP ports to try
- */
-#define UDP_PORT_BASE 3180
-
-/*
- * Pathname prefix
- */
-#define TFTP_PATHNAME_PREFIX "/TFTP/"
-
-/*
- * Default limits
- */
-#define PACKET_REPLY_MILLISECONDS 6000
-#define OPEN_RETRY_LIMIT 10
-#define IO_RETRY_LIMIT 10
-
-/*
- * TFTP opcodes
- */
-#define TFTP_OPCODE_RRQ 1
-#define TFTP_OPCODE_WRQ 2
-#define TFTP_OPCODE_DATA 3
-#define TFTP_OPCODE_ACK 4
-#define TFTP_OPCODE_ERROR 5
-
-/*
- * Largest data transfer
- */
-#define TFTP_BUFSIZE 512
-
-/*
- * Packets transferred between machines
- */
-union tftpPacket {
- /*
- * RRQ/WRQ packet
- */
- struct tftpRWRQ {
- rtems_unsigned16 opcode;
- char filename_mode[TFTP_BUFSIZE];
- } tftpRWRQ;
-
- /*
- * DATA packet
- */
- struct tftpDATA {
- rtems_unsigned16 opcode;
- rtems_unsigned16 blocknum;
- rtems_unsigned8 data[TFTP_BUFSIZE];
- } tftpDATA;
-
- /*
- * ACK packet
- */
- struct tftpACK {
- rtems_unsigned16 opcode;
- rtems_unsigned16 blocknum;
- } tftpACK;
-
- /*
- * ERROR packet
- */
- struct tftpERROR {
- rtems_unsigned16 opcode;
- rtems_unsigned16 errorCode;
- char errorMessage[TFTP_BUFSIZE];
- } tftpERROR;
-};
-
-/*
- * State of each TFTP stream
- */
-struct tftpStream {
- /*
- * Buffer for storing most recently-received packet
- */
- union tftpPacket pkbuf;
-
- /*
- * Last block number received
- */
- rtems_unsigned16 blocknum;
-
- /*
- * Data transfer socket
- */
- int socket;
- struct sockaddr_in myAddress;
- struct sockaddr_in farAddress;
-
- /*
- * Indices into buffer
- */
- int nleft;
- int nused;
-
- /*
- * Flags
- */
- int firstReply;
- int eof;
-};
-
-/*
- * Number of streams open at the same time
- */
-static rtems_id tftp_mutex;
-static int nStreams;
-static struct tftpStream ** volatile tftpStreams;
-
-/*
- * Initialize the TFTP driver
- */
-rtems_device_driver rtems_tftp_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_status_code sc;
-
- sc = rtems_semaphore_create (rtems_build_name('T', 'F', 'T', 'P'),
- 1,
- RTEMS_FIFO |
- RTEMS_BINARY_SEMAPHORE |
- RTEMS_NO_INHERIT_PRIORITY |
- RTEMS_NO_PRIORITY_CEILING |
- RTEMS_LOCAL,
- 0,
- &tftp_mutex);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- rtems_io_register_name (TFTP_PATHNAME_PREFIX, major, minor);
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Set error message
- * This RTEMS/UNIX error mapping needs to be fixed!
- */
-static void
-tftpSetErrno (struct tftpStream *tp)
-{
- unsigned int tftpError;
- static const int errorMap[] = {
- 0,
- ENOENT,
- EPERM,
- ENOSPC,
- EINVAL,
- ENXIO,
- EEXIST,
- ESRCH,
- 0,
- };
-
- tftpError = ntohs (tp->pkbuf.tftpERROR.errorCode);
- if (tftpError < (sizeof errorMap / sizeof errorMap[0]))
- errno = errorMap[tftpError];
- else
- errno = 1000 + tftpError;
-}
-
-/*
- * Send a message to make the other end shut up
- */
-static void
-sendStifle (struct tftpStream *tp, struct sockaddr_in *to)
-{
- int len;
-
- /*
- * Create the error packet (Unknown transfer ID).
- */
- tp->pkbuf.tftpERROR.opcode = htons (TFTP_OPCODE_ERROR);
- tp->pkbuf.tftpERROR.errorCode = htons (5);
- len = sizeof tp->pkbuf.tftpERROR.opcode +
- sizeof tp->pkbuf.tftpERROR.errorCode + 1;
- len += sprintf (tp->pkbuf.tftpERROR.errorMessage, "GO AWAY");
-
- /*
- * Send it
- */
- sendto (tp->socket, (char *)&tp->pkbuf, len, 0,
- (struct sockaddr *)to, sizeof *to);
-}
-
-/*
- * Wait for a data packet
- */
-static int
-getPacket (struct tftpStream *tp)
-{
- int len;
- struct timeval tv;
-
- tv.tv_sec = 6;
- tv.tv_usec = 0;
- setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
- for (;;) {
- union {
- struct sockaddr s;
- struct sockaddr_in i;
- } from;
- int fromlen = sizeof from;
- len = recvfrom (tp->socket, (char *)&tp->pkbuf,
- sizeof tp->pkbuf, 0,
- &from.s, &fromlen);
- if (len < 0)
- break;
- if (from.i.sin_addr.s_addr == tp->farAddress.sin_addr.s_addr) {
- if (tp->firstReply) {
- tp->firstReply = 0;
- tp->farAddress.sin_port = from.i.sin_port;
- }
- if (tp->farAddress.sin_port == from.i.sin_port)
- break;
- }
-
- /*
- * Packet is from someone with whom we are
- * not interested. Tell them to go away.
- */
- sendStifle (tp, &from.i);
- }
- tv.tv_sec = 0;
- setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
- return len;
-}
-
-/*
- * Send an acknowledgement
- */
-static int
-sendAck (struct tftpStream *tp)
-{
- /*
- * Create the acknowledgement
- */
- tp->pkbuf.tftpACK.opcode = htons (TFTP_OPCODE_ACK);
- tp->pkbuf.tftpACK.blocknum = htons (tp->blocknum);
-
- /*
- * Send it
- */
- if (sendto (tp->socket, (char *)&tp->pkbuf, sizeof tp->pkbuf.tftpACK, 0,
- (struct sockaddr *)&tp->farAddress,
- sizeof tp->farAddress) < 0)
- return errno;
- return 0;
-}
-
-/*
- * Release a stream and clear the pointer to it
- */
-static void
-releaseStream (int s)
-{
- rtems_semaphore_obtain (tftp_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- free (tftpStreams[s]);
- tftpStreams[s] = NULL;
- rtems_semaphore_release (tftp_mutex);
-}
-
-/*
- * Open a TFTP stream
- */
-rtems_device_driver rtems_tftp_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_open_close_args_t *ap = pargp;
- struct tftpStream *tp;
- int retryCount;
- rtems_unsigned32 farAddress;
- int s;
- int len;
- char *cp1, *cp2;
- char *remoteFilename;
- rtems_interval now;
- rtems_status_code sc;
-
- /*
- * Read-only for now
- */
- if (ap->flags & LIBIO_FLAGS_WRITE)
- return RTEMS_NOT_IMPLEMENTED;
-
- /*
- * Pick apart the name into a host:pathname pair
- */
- if (strlen (ap->iop->pathname) <= strlen (TFTP_PATHNAME_PREFIX))
- return RTEMS_INVALID_NAME;
- cp2 = ap->iop->pathname + strlen (TFTP_PATHNAME_PREFIX);
- if (*cp2 == '/') {
- farAddress = rtems_bsdnet_bootp_server_address.s_addr;
- }
- else {
- char *hostname;
-
- cp1 = cp2;
- while (*cp2 != '/') {
- if (*cp2 == '\0')
- return RTEMS_INVALID_NAME;
- cp2++;
- }
- len = cp2 - cp1;
- hostname = malloc (len + 1);
- if (hostname == NULL)
- return RTEMS_NO_MEMORY;
- strncpy (hostname, cp1, len);
- hostname[len] = '\0';
- farAddress = inet_addr (hostname);
- free (hostname);
- }
- if ((farAddress == 0) || (farAddress == ~0))
- return RTEMS_INVALID_NAME;
- if (*++cp2 == '\0')
- return RTEMS_INVALID_NAME;
- remoteFilename = cp2;
- if (strlen (remoteFilename) > (TFTP_BUFSIZE - 10))
- return RTEMS_INVALID_NAME;
-
- /*
- * Find a free stream
- */
- sc = rtems_semaphore_obtain (tftp_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- for (s = 0 ; s < nStreams ; s++) {
- if (tftpStreams[s] == NULL)
- break;
- }
- if (s == nStreams) {
- /*
- * Reallocate stream pointers
- * Guard against the case where realloc() returns NULL.
- */
- struct tftpStream **np;
-
- np = realloc (tftpStreams, ++nStreams * sizeof *tftpStreams);
- if (np == NULL) {
- rtems_semaphore_release (tftp_mutex);
- return RTEMS_NO_MEMORY;
- }
- tftpStreams = np;
- }
- tp = tftpStreams[s] = malloc (sizeof (struct tftpStream));
- rtems_semaphore_release (tftp_mutex);
- if (tp == NULL)
- return RTEMS_NO_MEMORY;
- ap->iop->data0 = s;
- ap->iop->data1 = tp;
-
- /*
- * Create the socket
- */
- if ((tp->socket = socket (AF_INET, SOCK_DGRAM, 0)) < 0) {
- releaseStream (s);
- return RTEMS_TOO_MANY;
- }
-
- /*
- * Bind the socket to a local address
- */
- retryCount = 0;
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- for (;;) {
- int try = (now + retryCount) % 10;
-
- tp->myAddress.sin_family = AF_INET;
- tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try + minor);
- tp->myAddress.sin_addr.s_addr = htonl (INADDR_ANY);
- if (bind (tp->socket, (struct sockaddr *)&tp->myAddress, sizeof tp->myAddress) >= 0)
- break;
- if (++retryCount == 10) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_RESOURCE_IN_USE;
- }
- }
-
- /*
- * Set the UDP destination to the TFTP server
- * port on the remote machine.
- */
- tp->farAddress.sin_family = AF_INET;
- tp->farAddress.sin_addr.s_addr = farAddress;
- tp->farAddress.sin_port = htons (69);
-
- /*
- * Start the transfer
- */
- tp->firstReply = 1;
- for (;;) {
- /*
- * Create the request
- */
- tp->pkbuf.tftpRWRQ.opcode = htons (TFTP_OPCODE_RRQ);
- cp1 = tp->pkbuf.tftpRWRQ.filename_mode;
- cp2 = remoteFilename;
- while ((*cp1++ = *cp2++) != '\0')
- continue;
- cp2 = "octet";
- while ((*cp1++ = *cp2++) != '\0')
- continue;
- len = cp1 - (char *)&tp->pkbuf.tftpRWRQ;
-
- /*
- * Send the request
- */
- if (sendto (tp->socket, (char *)&tp->pkbuf, len, 0,
- (struct sockaddr *)&tp->farAddress,
- sizeof tp->farAddress) < 0) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_UNSATISFIED;
- }
-
- /*
- * Get reply
- */
- len = getPacket (tp);
- if (len >= (int) sizeof tp->pkbuf.tftpACK) {
- int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
- if ((opcode == TFTP_OPCODE_DATA)
- && (ntohs (tp->pkbuf.tftpDATA.blocknum) == 1)) {
- tp->nused = 0;
- tp->blocknum = 1;
- tp->nleft = len - 2 * sizeof (rtems_unsigned16);
- tp->eof = (tp->nleft < TFTP_BUFSIZE);
- if (sendAck (tp) != 0) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_UNSATISFIED;
- }
- break;
- }
- if (opcode == TFTP_OPCODE_ERROR) {
- tftpSetErrno (tp);
- close (tp->socket);
- releaseStream (ap->iop->data0);
- return RTEMS_INTERNAL_ERROR;
- }
- }
-
- /*
- * Keep trying
- */
- if (++retryCount >= OPEN_RETRY_LIMIT) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_UNSATISFIED;
- }
- }
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Read from a TFTP stream
- */
-rtems_device_driver rtems_tftp_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_rw_args_t *ap = pargp;
- char *bp;
- struct tftpStream *tp;
- int retryCount;
- int nwant;
-
- tp = ap->iop->data1;
-
- /*
- * Read till user request is satisfied or EOF is reached
- */
- bp = ap->buffer;
- nwant = ap->count;
- while (nwant) {
- if (tp->nleft) {
- int count;
- if (nwant < tp->nleft)
- count = nwant;
- else
- count = tp->nleft;
- memcpy (bp, &tp->pkbuf.tftpDATA.data[tp->nused], count);
- tp->nused += count;
- tp->nleft -= count;
- bp += count;
- nwant -= count;
- if (nwant == 0)
- break;
- }
- if (tp->eof)
- break;
-
- /*
- * Wait for the next packet
- */
- retryCount = 0;
- for (;;) {
- int len = getPacket (tp);
- if (len >= (int)sizeof tp->pkbuf.tftpACK) {
- int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
- rtems_unsigned16 nextBlock = tp->blocknum + 1;
- if ((opcode == TFTP_OPCODE_DATA)
- && (ntohs (tp->pkbuf.tftpDATA.blocknum) == nextBlock)) {
- tp->nused = 0;
- tp->nleft = len - 2 * sizeof (rtems_unsigned16);
- tp->eof = (tp->nleft < TFTP_BUFSIZE);
- tp->blocknum++;
- if (sendAck (tp) != 0)
- return RTEMS_IO_ERROR;
- break;
- }
- if (opcode == TFTP_OPCODE_ERROR) {
- tftpSetErrno (tp);
- return RTEMS_INTERNAL_ERROR;
- }
- }
-
- /*
- * Keep trying?
- */
- if (++retryCount == IO_RETRY_LIMIT)
- return RTEMS_IO_ERROR;
- if (sendAck (tp) != 0)
- return RTEMS_IO_ERROR;
- }
- }
- ap->bytes_moved = ap->count - nwant;
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close a TFTP stream
- */
-rtems_device_driver rtems_tftp_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_open_close_args_t *ap = pargp;
- struct tftpStream *tp = ap->iop->data1;;
-
- if (!tp->eof && !tp->firstReply) {
- /*
- * Tell the other end to stop
- */
- rtems_interval ticksPerSecond;
- sendStifle (tp, &tp->farAddress);
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond);
- rtems_task_wake_after (1 + ticksPerSecond / 10);
- }
- close (tp->socket);
- releaseStream (ap->iop->data0);
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver rtems_tftp_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_device_driver rtems_tftp_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/libnetworking/libc/Makefile.in b/c/src/libnetworking/libc/Makefile.in
deleted file mode 100644
index 132c059cab..0000000000
--- a/c/src/libnetworking/libc/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=lib.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES= base64 \
- gethostbydns gethostbyht gethostbynis gethostnamadr \
- herror \
- inet_addr inet_ntoa inet_ntop inet_pton \
- map_v4v6 \
- nsap_addr ns_name ns_netint ns_parse ns_print ns_ttl \
- res_comp res_data res_debug res_init res_mkquery res_mkupdate \
- res_query res_send res_stubs res_update \
- strsep
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -DNOPOLL -DNOSELECT
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
diff --git a/c/src/libnetworking/libc/addr2ascii.3 b/c/src/libnetworking/libc/addr2ascii.3
deleted file mode 100644
index 10c839ea74..0000000000
--- a/c/src/libnetworking/libc/addr2ascii.3
+++ /dev/null
@@ -1,217 +0,0 @@
-.\"
-.\" Copyright 1996 Massachusetts Institute of Technology
-.\"
-.\" Permission to use, copy, modify, and distribute this software and
-.\" its documentation for any purpose and without fee is hereby
-.\" granted, provided that both the above copyright notice and this
-.\" permission notice appear in all copies, that both the above
-.\" copyright notice and this permission notice appear in all
-.\" supporting documentation, and that the name of M.I.T. not be used
-.\" in advertising or publicity pertaining to distribution of the
-.\" software without specific, written prior permission. M.I.T. makes
-.\" no representations about the suitability of this software for any
-.\" purpose. It is provided "as is" without express or implied
-.\" warranty.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
-.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
-.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
-.\" SHALL M.I.T. 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.
-.\"
-.\" $ANA: addr2ascii.3,v 1.1 1996/06/13 18:41:46 wollman Exp $
-.\" $Id$
-.\"
-.Dd June 13, 1996
-.Dt ADDR2ASCII 3
-.Os
-.Sh NAME
-.Nm addr2ascii ,
-.Nm ascii2addr
-.Nd Generic address formatting routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netinet/in.h>
-.Fd #include <arpa/inet.h>
-.Ft "char *"
-.Fn addr2ascii "int af" "const void *addrp" "int len" "char *buf"
-.Ft int
-.Fn ascii2addr "int af" "const char *ascii" "void *result"
-.Sh DESCRIPTION
-The routines
-.Fn addr2ascii
-and
-.Fn ascii2addr
-are used to convert network addresses between binary form and a
-printable form appropriate to the address family. Both functions take
-an
-.Fa af
-argument, specifying the address family to be used in the conversion
-process.
-(Currently, only the
-.Dv AF_INET
-and
-.Dv AF_LINK
-address families are supported.)
-.Pp
-The
-.Fn addr2ascii
-function
-is used to convert binary, network-format addresses into printable
-form. In addition to
-.Fa af ,
-there are three other arguments. The
-.Fa addrp
-argument is a pointer to the network address to be converted.
-The
-.Fa len
-argument is the length of the address. The
-.Fa buf
-argument is an optional pointer to a caller-allocated buffer to hold
-the result; if a null pointer is passed,
-.Fn addr2ascii
-uses a statically-allocated buffer.
-.Pp
-The
-.Fn ascii2addr
-function performs the inverse operation to
-.Fn addr2ascii .
-In addition to
-.Fa af ,
-it takes two parameters,
-.Fa ascii
-and
-.Fa result .
-The
-.Fa ascii
-parameter is a pointer to the string which is to be converted into
-binary. The
-.Fa result
-parameter is a pointer to an appropriate network address structure for
-the specified family.
-.Pp
-The following gives the appropriate structure to use for binary
-addresses in the specified family:
-.Pp
-.Bl -tag -width AF_INETxxxx -compact
-.It Dv AF_INET
-.Li struct in_addr
-.Pq in Aq Pa netinet/in.h
-.It Dv AF_LINK
-.Li struct sockaddr_dl
-.Pq in Aq Pa net/if_dl.h
-.\" .It Dv AF_INET6
-.\" .Li struct in6_addr
-.\" .Pq in Aq Pa netinet6/in6.h
-.El
-.Sh RETURN VALUES
-The
-.Fn addr2ascii
-function returns the address of the buffer it was passed, or a static
-buffer if the a null pointer was passed; on failure, it returns a null
-pointer.
-The
-.Fn ascii2addr
-function returns the length of the binary address in bytes, or -1 on
-failure.
-.Sh EXAMPLES
-The
-.Xr inet 3
-functions
-.Fn inet_ntoa
-and
-.Fn inet_aton
-could be implemented thusly:
-.Bd -literal -offset indent
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-char *
-inet_ntoa(struct in_addr addr)
-{
- return addr2ascii(AF_INET, &addr, sizeof addr, 0);
-}
-
-int
-inet_aton(const char *ascii, struct in_addr *addr)
-{
- return (ascii2addr(AF_INET, ascii, addr)
- == sizeof(*addr));
-}
-.Ed
-.Pp
-In actuality, this cannot be done because
-.Fn addr2ascii
-and
-.Fn ascii2addr
-are implemented in terms of the
-.Xr inet 3
-functions, rather than the other way around.
-.Sh ERRORS
-When a failure is returned,
-.Li errno
-is set to one of the following values:
-.Bl -tag -width [EPROTONOSUPPORT]
-.It Bq Er ENAMETOOLONG
-The
-.Fn addr2ascii
-routine was passed a
-.Fa len
-parameter which was inappropriate for the address family given by
-.Fa af .
-.It Bq Er EPROTONOSUPPORT
-Either routine was passed an
-.Fa af
-parameter other than
-.Dv AF_INET
-or
-.Dv AF_LINK .
-.It Bq Er EINVAL
-The string passed to
-.Fn ascii2addr
-was improperly formatted for address family
-.Fa af .
-.El
-.Sh SEE ALSO
-.Xr inet 3 ,
-.Xr linkaddr 3 ,
-.Xr inet 4
-.Sh HISTORY
-An interface close to this one was originally suggested by Craig
-Partridge. This particular interface originally appeared in the
-.Tn INRIA
-.Tn IPv6
-implementation.
-.Sh AUTHORS
-Code and documentation by
-.An Garrett A. Wollman ,
-MIT Laboratory for Computer Science.
-.Sh BUGS
-The original implementations supported IPv6. This support should
-eventually be resurrected. The
-.Tn NRL
-implementation also included support for the
-.Dv AF_ISO
-and
-.Dv AF_NS
-address families.
-.Pp
-The genericity of this interface is somewhat questionable. A truly
-generic interface would provide a means for determining the length of
-the buffer to be used so that it could be dynamically allocated, and
-would always require a
-.Dq Li "struct sockaddr"
-to hold the binary address. Unfortunately, this is incompatible with existing
-practice. This limitation means that a routine for printing network
-addresses from arbitrary address families must still have internal
-knowledge of the maximum buffer length needed and the appropriate part
-of the address to use as the binary address.
diff --git a/c/src/libnetworking/libc/addr2ascii.c b/c/src/libnetworking/libc/addr2ascii.c
deleted file mode 100644
index dc651743b6..0000000000
--- a/c/src/libnetworking/libc/addr2ascii.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 1996 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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.
- *
- * $ANA: addr2ascii.c,v 1.1 1996/06/13 18:41:46 wollman Exp $
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <errno.h>
-#include <string.h>
-
-#include <net/if_dl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*-
- * Convert a network address from binary to printable numeric format.
- * This API is copied from INRIA's IPv6 implementation, but it is a
- * bit bogus in two ways:
- *
- * 1) There is no value in passing both an address family and
- * an address length; either one should imply the other,
- * or we should be passing sockaddrs instead.
- * 2) There should by contrast be /added/ a length for the buffer
- * that we pass in, so that programmers are spared the need to
- * manually calculate (read: ``guess'') the maximum length.
- *
- * Flash: the API is also the same in the NRL implementation, and seems to
- * be some sort of standard, so we appear to be stuck with both the bad
- * naming and the poor choice of arguments.
- */
-char *
-addr2ascii(af, addrp, len, buf)
- int af;
- const void *addrp;
- int len; /* should be size_t XXX */
- char *buf; /* XXX should pass length of buffer */
-{
- static char staticbuf[64]; /* 64 for AF_LINK > 16 for AF_INET */
-
- if (!buf)
- buf = staticbuf;
-
- switch(af) {
- case AF_INET:
- if (len != sizeof(struct in_addr)) {
- errno = ENAMETOOLONG;
- return 0;
- }
- strcpy(buf, inet_ntoa(*(const struct in_addr *)addrp));
- break;
-
- case AF_LINK:
- if (len != sizeof(struct sockaddr_dl)) {
- errno = ENAMETOOLONG;
- return 0;
- }
- strcpy(buf, link_ntoa((const struct sockaddr_dl *)addrp));
- break;
-
- default:
- errno = EPROTONOSUPPORT;
- return 0;
- }
- return buf;
-}
diff --git a/c/src/libnetworking/libc/ascii2addr.c b/c/src/libnetworking/libc/ascii2addr.c
deleted file mode 100644
index e140244737..0000000000
--- a/c/src/libnetworking/libc/ascii2addr.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 1996 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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.
- *
- * $ANA: ascii2addr.c,v 1.2 1996/06/13 18:46:02 wollman Exp $
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <errno.h>
-#include <string.h>
-
-#include <net/if_dl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-int
-ascii2addr(af, ascii, result)
- int af;
- const char *ascii;
- void *result;
-{
- struct in_addr *ina;
- char strbuf[4*sizeof("123")]; /* long enough for V4 only */
-
- switch(af) {
- case AF_INET:
- ina = result;
- strbuf[0] = '\0';
- strncat(strbuf, ascii, (sizeof strbuf)-1);
- if (inet_aton(strbuf, ina))
- return sizeof(struct in_addr);
- errno = EINVAL;
- break;
-
- case AF_LINK:
- link_addr(ascii, result);
- /* oops... no way to detect failure */
- return sizeof(struct sockaddr_dl);
-
- default:
- errno = EPROTONOSUPPORT;
- break;
- }
-
- return -1;
-}
diff --git a/c/src/libnetworking/libc/base64.c b/c/src/libnetworking/libc/base64.c
deleted file mode 100644
index 3017ccc01c..0000000000
--- a/c/src/libnetworking/libc/base64.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1995 by International Business Machines, Inc.
- *
- * International Business Machines, Inc. (hereinafter called IBM) grants
- * permission under its copyrights to use, copy, modify, and distribute this
- * Software with or without fee, provided that the above copyright notice and
- * all paragraphs of this notice appear in all copies, and that the name of IBM
- * not be used in connection with the marketing of any product incorporating
- * the Software or modifications thereof, without specific, written prior
- * permission.
- *
- * To the extent it has a right to do so, IBM grants an immunity from suit
- * under its patents, if any, for the use, sale or manufacture of products to
- * the extent that such products are used for performing Domain Name System
- * dynamic updates in TCP/IP networks by means of the Software. No immunity is
- * granted for any product per se or for any other function of any product.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define Assert(Cond) if (!(Cond)) abort()
-
-static const char Base64[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-static const char Pad64 = '=';
-
-/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
- The following encoding technique is taken from RFC 1521 by Borenstein
- and Freed. It is reproduced here in a slightly edited form for
- convenience.
-
- A 65-character subset of US-ASCII is used, enabling 6 bits to be
- represented per printable character. (The extra 65th character, "=",
- is used to signify a special processing function.)
-
- The encoding process represents 24-bit groups of input bits as output
- strings of 4 encoded characters. Proceeding from left to right, a
- 24-bit input group is formed by concatenating 3 8-bit input groups.
- These 24 bits are then treated as 4 concatenated 6-bit groups, each
- of which is translated into a single digit in the base64 alphabet.
-
- Each 6-bit group is used as an index into an array of 64 printable
- characters. The character referenced by the index is placed in the
- output string.
-
- Table 1: The Base64 Alphabet
-
- Value Encoding Value Encoding Value Encoding Value Encoding
- 0 A 17 R 34 i 51 z
- 1 B 18 S 35 j 52 0
- 2 C 19 T 36 k 53 1
- 3 D 20 U 37 l 54 2
- 4 E 21 V 38 m 55 3
- 5 F 22 W 39 n 56 4
- 6 G 23 X 40 o 57 5
- 7 H 24 Y 41 p 58 6
- 8 I 25 Z 42 q 59 7
- 9 J 26 a 43 r 60 8
- 10 K 27 b 44 s 61 9
- 11 L 28 c 45 t 62 +
- 12 M 29 d 46 u 63 /
- 13 N 30 e 47 v
- 14 O 31 f 48 w (pad) =
- 15 P 32 g 49 x
- 16 Q 33 h 50 y
-
- Special processing is performed if fewer than 24 bits are available
- at the end of the data being encoded. A full encoding quantum is
- always completed at the end of a quantity. When fewer than 24 input
- bits are available in an input group, zero bits are added (on the
- right) to form an integral number of 6-bit groups. Padding at the
- end of the data is performed using the '=' character.
-
- Since all base64 input is an integral number of octets, only the
- -------------------------------------------------
- following cases can arise:
-
- (1) the final quantum of encoding input is an integral
- multiple of 24 bits; here, the final unit of encoded
- output will be an integral multiple of 4 characters
- with no "=" padding,
- (2) the final quantum of encoding input is exactly 8 bits;
- here, the final unit of encoded output will be two
- characters followed by two "=" padding characters, or
- (3) the final quantum of encoding input is exactly 16 bits;
- here, the final unit of encoded output will be three
- characters followed by one "=" padding character.
- */
-
-int
-b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) {
- size_t datalength = 0;
- u_char input[3];
- u_char output[4];
- size_t i;
-
- while (2 < srclength) {
- input[0] = *src++;
- input[1] = *src++;
- input[2] = *src++;
- srclength -= 3;
-
- output[0] = input[0] >> 2;
- output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
- output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
- output[3] = input[2] & 0x3f;
- Assert(output[0] < 64);
- Assert(output[1] < 64);
- Assert(output[2] < 64);
- Assert(output[3] < 64);
-
- if (datalength + 4 > targsize)
- return (-1);
- target[datalength++] = Base64[output[0]];
- target[datalength++] = Base64[output[1]];
- target[datalength++] = Base64[output[2]];
- target[datalength++] = Base64[output[3]];
- }
-
- /* Now we worry about padding. */
- if (0 != srclength) {
- /* Get what's left. */
- input[0] = input[1] = input[2] = '\0';
- for (i = 0; i < srclength; i++)
- input[i] = *src++;
-
- output[0] = input[0] >> 2;
- output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
- output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
- Assert(output[0] < 64);
- Assert(output[1] < 64);
- Assert(output[2] < 64);
-
- if (datalength + 4 > targsize)
- return (-1);
- target[datalength++] = Base64[output[0]];
- target[datalength++] = Base64[output[1]];
- if (srclength == 1)
- target[datalength++] = Pad64;
- else
- target[datalength++] = Base64[output[2]];
- target[datalength++] = Pad64;
- }
- if (datalength >= targsize)
- return (-1);
- target[datalength] = '\0'; /* Returned value doesn't count \0. */
- return (datalength);
-}
-
-/* skips all whitespace anywhere.
- converts characters, four at a time, starting at (or after)
- src from base - 64 numbers into three 8 bit bytes in the target area.
- it returns the number of data bytes stored at the target, or -1 on error.
- */
-
-int
-b64_pton(src, target, targsize)
- char const *src;
- u_char *target;
- size_t targsize;
-{
- int tarindex, state, ch;
- char *pos;
-
- state = 0;
- tarindex = 0;
-
- while ((ch = *src++) != '\0') {
- if (isspace(ch)) /* Skip whitespace anywhere. */
- continue;
-
- if (ch == Pad64)
- break;
-
- pos = strchr(Base64, ch);
- if (pos == 0) /* A non-base64 character. */
- return (-1);
-
- switch (state) {
- case 0:
- if (target) {
- if ((size_t)tarindex >= targsize)
- return (-1);
- target[tarindex] = (pos - Base64) << 2;
- }
- state = 1;
- break;
- case 1:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize)
- return (-1);
- target[tarindex] |= (pos - Base64) >> 4;
- target[tarindex+1] = ((pos - Base64) & 0x0f)
- << 4 ;
- }
- tarindex++;
- state = 2;
- break;
- case 2:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize)
- return (-1);
- target[tarindex] |= (pos - Base64) >> 2;
- target[tarindex+1] = ((pos - Base64) & 0x03)
- << 6;
- }
- tarindex++;
- state = 3;
- break;
- case 3:
- if (target) {
- if ((size_t)tarindex >= targsize)
- return (-1);
- target[tarindex] |= (pos - Base64);
- }
- tarindex++;
- state = 0;
- break;
- default:
- abort();
- }
- }
-
- /*
- * We are done decoding Base-64 chars. Let's see if we ended
- * on a byte boundary, and/or with erroneous trailing characters.
- */
-
- if (ch == Pad64) { /* We got a pad char. */
- ch = *src++; /* Skip it, get next. */
- switch (state) {
- case 0: /* Invalid = in first position */
- case 1: /* Invalid = in second position */
- return (-1);
-
- case 2: /* Valid, means one byte of info */
- /* Skip any number of spaces. */
- for ((void)NULL; ch != '\0'; ch = *src++)
- if (!isspace(ch))
- break;
- /* Make sure there is another trailing = sign. */
- if (ch != Pad64)
- return (-1);
- ch = *src++; /* Skip the = */
- /* Fall through to "single trailing =" case. */
- /* FALLTHROUGH */
-
- case 3: /* Valid, means two bytes of info */
- /*
- * We know this char is an =. Is there anything but
- * whitespace after it?
- */
- for ((void)NULL; ch != '\0'; ch = *src++)
- if (!isspace(ch))
- return (-1);
-
- /*
- * Now make sure for cases 2 and 3 that the "extra"
- * bits that slopped past the last full byte were
- * zeros. If we don't check them, they become a
- * subliminal channel.
- */
- if (target && target[tarindex] != 0)
- return (-1);
- }
- } else {
- /*
- * We ended by seeing the end of the string. Make sure we
- * have no partial bytes lying around.
- */
- if (state != 0)
- return (-1);
- }
-
- return (tarindex);
-}
diff --git a/c/src/libnetworking/libc/byteorder.3 b/c/src/libnetworking/libc/byteorder.3
deleted file mode 100644
index 81bf604867..0000000000
--- a/c/src/libnetworking/libc/byteorder.3
+++ /dev/null
@@ -1,77 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" @(#)byteorder.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt BYTEORDER 3
-.Os BSD 4.2
-.Sh NAME
-.Nm htonl ,
-.Nm htons ,
-.Nm ntohl ,
-.Nm ntohs
-.Nd convert values between host and network byte order
-.Sh SYNOPSIS
-.Fd #include <sys/param.h>
-.Ft u_long
-.Fn htonl "u_long hostlong"
-.Ft u_short
-.Fn htons "u_short hostshort"
-.Ft u_long
-.Fn ntohl "u_long netlong"
-.Ft u_short
-.Fn ntohs "u_short netshort"
-.Sh DESCRIPTION
-These routines convert 16 and 32 bit quantities between network
-byte order and host byte order.
-On machines which have a byte order which is the same as the network
-order, routines are defined as null macros.
-.Pp
-These routines are most often used in conjunction with Internet
-addresses and ports as returned by
-.Xr gethostbyname 3
-and
-.Xr getservent 3 .
-.Sh SEE ALSO
-.Xr gethostbyname 3 ,
-.Xr getservent 3
-.Sh HISTORY
-The
-.Nm byteorder
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-On the
-.Tn VAX
-bytes are handled backwards from most everyone else in
-the world. This is not expected to be fixed in the near future.
diff --git a/c/src/libnetworking/libc/ether_addr.c b/c/src/libnetworking/libc/ether_addr.c
deleted file mode 100644
index 9b7a9abf44..0000000000
--- a/c/src/libnetworking/libc/ether_addr.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 1995
- * Bill Paul <wpaul@ctr.columbia.edu>. 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 Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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.
- *
- * ethernet address conversion and lookup routines
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Center for Telecommunications Research
- * Columbia University, New York City
- *
- * $Id$
- */
-
-
-#include <stdio.h>
-#include <paths.h>
-#include <sys/types.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <net/ethernet.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-#ifndef _PATH_ETHERS
-#define _PATH_ETHERS "/etc/ethers"
-#endif
-
-/*
- * Parse a string of text containing an ethernet address and hostname
- * and separate it into its component parts.
- */
-int ether_line(l, e, hostname)
- char *l;
- struct ether_addr *e;
- char *hostname;
-{
- int i, o[6];
-
- i = sscanf(l, "%x:%x:%x:%x:%x:%x %s", &o[0], &o[1], &o[2],
- &o[3], &o[4], &o[5],
- hostname);
- if (i != 7)
- return (i);
-
- for (i=0; i<6; i++)
- e->octet[i] = o[i];
- return (0);
-}
-
-/*
- * Convert an ASCII representation of an ethernet address to
- * binary form.
- */
-struct ether_addr *ether_aton(a)
- char *a;
-{
- int i;
- static struct ether_addr o;
- unsigned int o0, o1, o2, o3, o4, o5;
-
- i = sscanf(a, "%x:%x:%x:%x:%x:%x", &o0, &o1, &o2, &o3, &o4, &o5);
-
- if (i != 6)
- return (NULL);
-
- o.octet[0]=o0;
- o.octet[1]=o1;
- o.octet[2]=o2;
- o.octet[3]=o3;
- o.octet[4]=o4;
- o.octet[5]=o5;
-
- return ((struct ether_addr *)&o);
-}
-
-/*
- * Convert a binary representation of an ethernet address to
- * an ASCII string.
- */
-char *ether_ntoa(n)
- struct ether_addr *n;
-{
- int i;
- static char a[18];
-
- i = sprintf(a,"%x:%x:%x:%x:%x:%x",n->octet[0],n->octet[1],n->octet[2],
- n->octet[3],n->octet[4],n->octet[5]);
- if (i < 11)
- return (NULL);
- return ((char *)&a);
-}
-
-/*
- * Map an ethernet address to a hostname. Use either /etc/ethers or
- * NIS/YP.
- */
-
-int ether_ntohost(hostname, e)
- char *hostname;
- struct ether_addr *e;
-{
- FILE *fp;
- char buf[BUFSIZ + 2];
- struct ether_addr local_ether;
- char local_host[MAXHOSTNAMELEN];
-#ifdef YP
- char *result;
- int resultlen;
- char *ether_a;
- char *yp_domain;
-#endif
- if ((fp = fopen(_PATH_ETHERS, "r")) == NULL)
- return (1);
-
- while (fgets(buf,BUFSIZ,fp)) {
- if (buf[0] == '#')
- continue;
-#ifdef YP
- if (buf[0] == '+') {
- if (yp_get_default_domain(&yp_domain))
- continue;
- ether_a = ether_ntoa(e);
- if (yp_match(yp_domain, "ethers.byaddr", ether_a,
- strlen(ether_a), &result, &resultlen)) {
- continue;
- }
- strncpy(buf, result, resultlen);
- buf[resultlen] = '\0';
- free(result);
- }
-#endif
- if (!ether_line(buf, &local_ether, local_host)) {
- if (!bcmp((char *)&local_ether.octet[0],
- (char *)&e->octet[0], 6)) {
- /* We have a match */
- strcpy(hostname, local_host);
- fclose(fp);
- return(0);
- }
- }
- }
- fclose(fp);
- return (1);
-}
-
-/*
- * Map a hostname to an ethernet address using /etc/ethers or
- * NIS/YP.
- */
-int ether_hostton(hostname, e)
- char *hostname;
- struct ether_addr *e;
-{
- FILE *fp;
- char buf[BUFSIZ + 2];
- struct ether_addr local_ether;
- char local_host[MAXHOSTNAMELEN];
-#ifdef YP
- char *result;
- int resultlen;
- char *yp_domain;
-#endif
- if ((fp = fopen(_PATH_ETHERS, "r")) == NULL)
- return (1);
-
- while (fgets(buf,BUFSIZ,fp)) {
- if (buf[0] == '#')
- continue;
-#ifdef YP
- if (buf[0] == '+') {
- if (yp_get_default_domain(&yp_domain))
- continue;
- if (yp_match(yp_domain, "ethers.byname", hostname,
- strlen(hostname), &result, &resultlen)) {
- continue;
- }
- strncpy(buf, result, resultlen);
- buf[resultlen] = '\0';
- free(result);
- }
-#endif
- if (!ether_line(buf, &local_ether, local_host)) {
- if (!strcmp(hostname, local_host)) {
- /* We have a match */
- bcopy((char *)&local_ether.octet[0],
- (char *)&e->octet[0], 6);
- fclose(fp);
- return(0);
- }
- }
- }
- fclose(fp);
- return (1);
-}
diff --git a/c/src/libnetworking/libc/ethers.3 b/c/src/libnetworking/libc/ethers.3
deleted file mode 100644
index afea48320a..0000000000
--- a/c/src/libnetworking/libc/ethers.3
+++ /dev/null
@@ -1,193 +0,0 @@
-.\" Copyright (c) 1995
-.\" Bill Paul <wpaul@ctr.columbia.edu>. 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 Bill Paul.
-.\" 4. Neither the name of the author nor the names of any co-contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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.
-.\"
-.\" $Id$
-.\"
-.Dd April 12, 1995
-.Dt ETHERS 3
-.Os FreeBSD 2.1
-.Sh NAME
-.Nm ethers ,
-.Nm ether_line ,
-.Nm ether_aton ,
-.Nm ether_ntoa ,
-.Nm ether_ntohost ,
-.Nm ether_hostton
-.Nd Ethernet address conversion and lookup routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/socket.h>
-.Fd #include <net/ethernet.h>
-.Ft int
-.Fn ether_line "char *l" "struct ether_addr *e" "char *hostname"
-.Ft struct ether_addr *
-.Fn ether_aton "char *a"
-.Ft char *
-.Fn ether_ntoa "struct ether_addr *n"
-.Ft int
-.Fn ether_ntohost "char *hostname" "struct ether_addr *e"
-.Ft int
-.Fn ether_hostton "char *hostname" "struct ether_addr *e"
-.Sh DESCRIPTION
-These functions operate on ethernet addresses using an
-.Ar ether_addr
-structure, which is defined in the header file
-.Aq Pa netinet/if_ether.h :
-.Bd -literal -offset indent
-/*
- * The number of bytes in an ethernet (MAC) address.
- */
-#define ETHER_ADDR_LEN 6
-
-/*
- * Structure of a 48-bit Ethernet address.
- */
-struct ether_addr {
- u_char octet[ETHER_ADDR_LEN];
-};
-.Ed
-.Pp
-The function
-.Fn ether_line
-scans
-.Ar l ,
-an
-.Tn ASCII
-string in
-.Xr ethers 5
-format and sets
-.Ar e
-to the ethernet address specified in the string and
-.Ar h
-to the hostname. This function is used to parse lines from
-.Pa /etc/ethers
-into their component parts.
-.Pp
-The
-.Fn ether_aton
-function converts an
-.Tn ASCII
-representation of an ethernet address into an
-.Ar ether_addr
-structure. Likewise,
-.Fn ether_ntoa
-converts an ethernet address specified as an
-.Ar ether_addr
-structure into an
-.Tn ASCII
-string.
-.Pp
-The
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions map ethernet addresses to their corresponding hostnames
-as specified in the
-.Pa /etc/ethers
-database.
-.Fn ether_ntohost
-converts from ethernet address to hostname, and
-.Fn ether_hostton
-converts from hostname to ethernet address.
-.Sh RETURN VALUES
-.Fn ether_line
-returns zero on success and non-zero if it was unable to parse
-any part of the supplied line
-.Ar l .
-It returns the extracted ethernet address in the supplied
-.Ar ether_addr
-structure
-.Ar e
-and the hostname in the supplied string
-.Ar h .
-.Pp
-On success,
-.Fn ether_ntoa
-returns a pointer to a string containing an
-.Tn ASCII
-representation of an ethernet address. If it is unable to convert
-the supplied
-.Ar ether_addr
-structure, it returns a
-.Dv NULL
-pointer. Likewise,
-.Fn ether_aton
-returns a pointer to an
-.Ar ether_addr
-structure on success and a
-.Dv NULL
-pointer on failure.
-.Pp
-The
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions both return zero on success or non-zero if they were
-unable to find a match in the
-.Pa /etc/ethers
-database.
-.Sh NOTES
-The user must insure that the hostname strings passed to the
-the
-.Fn ether_line ,
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions are large enough to contain the returned hostnames.
-.Sh NIS INTERACTION
-If the
-.Pa /etc/ethers
-contains a line with a single + in it, the
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions will attempt to consult the NIS
-.Pa ethers.byname
-and
-.Pa ethers.byaddr
-maps in addition to the data in the
-.Pa /etc/ethers
-file.
-.Sh SEE ALSO
-.Xr yp 4 ,
-.Xr ethers 5
-.Sh BUGS
-.Pp
-The
-.Fn ether_aton
-and
-.Fn ether_ntoa
-functions returns values that are stored in static memory areas
-which may be overwritten the next time they are called.
-.Sh HISTORY
-This particular implementation of the
-.Nm ethers
-library functions were written for and first appeared in
-.Fx 2.1 .
diff --git a/c/src/libnetworking/libc/gethostbydns.c b/c/src/libnetworking/libc/gethostbydns.c
deleted file mode 100644
index 3d80ffde7a..0000000000
--- a/c/src/libnetworking/libc/gethostbydns.c
+++ /dev/null
@@ -1,773 +0,0 @@
-/*
- * ++Copyright++ 1985, 1988, 1993
- * -
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char fromrcsid[] = "From: Id: gethnamaddr.c,v 8.23 1998/04/07 04:59:46 vixie Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <ctype.h>
-#include <errno.h>
-#include <syslog.h>
-
-#include "res_config.h"
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-#define MAXALIASES 35
-#define MAXADDRS 35
-
-static const char AskedForGot[] =
- "gethostby*.gethostanswer: asked for \"%s\", got \"%s\"";
-
-static char *h_addr_ptrs[MAXADDRS + 1];
-
-static struct hostent host;
-static char *host_aliases[MAXALIASES];
-static char hostbuf[8*1024];
-static u_char host_addr[16]; /* IPv4 or IPv6 */
-
-#ifdef RESOLVSORT
-static void addrsort __P((char **, int));
-#endif
-
-#if PACKETSZ > 1024
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 1024
-#endif
-
-typedef union {
- HEADER hdr;
- u_char buf[MAXPACKET];
-} querybuf;
-
-typedef union {
- int32_t al;
- char ac;
-} align;
-
-extern int h_errno;
-int _dns_ttl_;
-
-#ifdef DEBUG
-static void
-dprintf(msg, num)
- char *msg;
- int num;
-{
- if (_res.options & RES_DEBUG) {
- int save = errno;
-
- printf(msg, num);
- errno = save;
- }
-}
-#else
-# define dprintf(msg, num) /*nada*/
-#endif
-
-#define BOUNDED_INCR(x) \
- do { \
- cp += x; \
- if (cp > eom) { \
- h_errno = NO_RECOVERY; \
- return (NULL); \
- } \
- } while (0)
-
-#define BOUNDS_CHECK(ptr, count) \
- do { \
- if ((ptr) + (count) > eom) { \
- h_errno = NO_RECOVERY; \
- return (NULL); \
- } \
- } while (0)
-
-static struct hostent *
-gethostanswer(answer, anslen, qname, qtype)
- const querybuf *answer;
- int anslen;
- const char *qname;
- int qtype;
-{
- register const HEADER *hp;
- register const u_char *cp;
- register int n;
- const u_char *eom, *erdata;
- char *bp, **ap, **hap;
- int type, class, buflen, ancount, qdcount;
- int haveanswer, had_error;
- int toobig = 0;
- char tbuf[MAXDNAME];
- const char *tname;
- int (*name_ok) __P((const char *));
-
- tname = qname;
- host.h_name = NULL;
- eom = answer->buf + anslen;
- switch (qtype) {
- case T_A:
- case T_AAAA:
- name_ok = res_hnok;
- break;
- case T_PTR:
- name_ok = res_dnok;
- break;
- default:
- h_errno = NO_RECOVERY;
- return (NULL); /* XXX should be abort(); */
- }
- /*
- * find first satisfactory answer
- */
- hp = &answer->hdr;
- ancount = ntohs(hp->ancount);
- qdcount = ntohs(hp->qdcount);
- bp = hostbuf;
- buflen = sizeof hostbuf;
- cp = answer->buf;
- BOUNDED_INCR(HFIXEDSZ);
- if (qdcount != 1) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !(*name_ok)(bp)) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- BOUNDED_INCR(n + QFIXEDSZ);
- if (qtype == T_A || qtype == T_AAAA) {
- /* res_send() has already verified that the query name is the
- * same as the one we sent; this just gets the expanded name
- * (i.e., with the succeeding search-domain tacked on).
- */
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- host.h_name = bp;
- bp += n;
- buflen -= n;
- /* The qname can be abbreviated, but h_name is now absolute. */
- qname = host.h_name;
- }
- ap = host_aliases;
- *ap = NULL;
- host.h_aliases = host_aliases;
- hap = h_addr_ptrs;
- *hap = NULL;
- host.h_addr_list = h_addr_ptrs;
- haveanswer = 0;
- had_error = 0;
- _dns_ttl_ = -1;
- while (ancount-- > 0 && cp < eom && !had_error) {
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !(*name_ok)(bp)) {
- had_error++;
- continue;
- }
- cp += n; /* name */
- BOUNDS_CHECK(cp, 3 * INT16SZ + INT32SZ);
- type = _getshort(cp);
- cp += INT16SZ; /* type */
- class = _getshort(cp);
- cp += INT16SZ; /* class */
- if (qtype == T_A && type == T_A)
- _dns_ttl_ = _getlong(cp);
- cp += INT32SZ; /* TTL */
- n = _getshort(cp);
- cp += INT16SZ; /* len */
- BOUNDS_CHECK(cp, n);
- erdata = cp + n;
- if (class != C_IN) {
- /* XXX - debug? syslog? */
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- if ((qtype == T_A || qtype == T_AAAA) && type == T_CNAME) {
- if (ap >= &host_aliases[MAXALIASES-1])
- continue;
- n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf);
- if ((n < 0) || !(*name_ok)(tbuf)) {
- had_error++;
- continue;
- }
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- /* Store alias. */
- *ap++ = bp;
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- had_error++;
- continue;
- }
- bp += n;
- buflen -= n;
- /* Get canonical name. */
- n = strlen(tbuf) + 1; /* for the \0 */
- if (n > buflen || n >= MAXHOSTNAMELEN) {
- had_error++;
- continue;
- }
- strcpy(bp, tbuf);
- host.h_name = bp;
- bp += n;
- buflen -= n;
- continue;
- }
- if (qtype == T_PTR && type == T_CNAME) {
- n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf);
- if (n < 0 || !res_dnok(tbuf)) {
- had_error++;
- continue;
- }
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- /* Get canonical name. */
- n = strlen(tbuf) + 1; /* for the \0 */
- if (n > buflen || n >= MAXHOSTNAMELEN) {
- had_error++;
- continue;
- }
- strcpy(bp, tbuf);
- tname = bp;
- bp += n;
- buflen -= n;
- continue;
- }
- if (type != qtype) {
- syslog(LOG_NOTICE|LOG_AUTH,
- "gethostby*.gethostanswer: asked for \"%s %s %s\", got type \"%s\"",
- qname, p_class(C_IN), p_type(qtype),
- p_type(type));
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- switch (type) {
- case T_PTR:
- if (strcasecmp(tname, bp) != 0) {
- syslog(LOG_NOTICE|LOG_AUTH,
- AskedForGot, qname, bp);
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !res_hnok(bp)) {
- had_error++;
- break;
- }
-#if MULTI_PTRS_ARE_ALIASES
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- if (!haveanswer)
- host.h_name = bp;
- else if (ap < &host_aliases[MAXALIASES-1])
- *ap++ = bp;
- else
- n = -1;
- if (n != -1) {
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- had_error++;
- break;
- }
- bp += n;
- buflen -= n;
- }
- break;
-#else
- host.h_name = bp;
- if (_res.options & RES_USE_INET6) {
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- had_error++;
- break;
- }
- bp += n;
- buflen -= n;
- _map_v4v6_hostent(&host, &bp, &buflen);
- }
- h_errno = NETDB_SUCCESS;
- return (&host);
-#endif
- case T_A:
- case T_AAAA:
- if (strcasecmp(host.h_name, bp) != 0) {
- syslog(LOG_NOTICE|LOG_AUTH,
- AskedForGot, host.h_name, bp);
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- if (n != host.h_length) {
- cp += n;
- continue;
- }
- if (!haveanswer) {
- register int nn;
-
- host.h_name = bp;
- nn = strlen(bp) + 1; /* for the \0 */
- bp += nn;
- buflen -= nn;
- }
-
- bp += sizeof(align) - ((u_long)bp % sizeof(align));
-
- if (bp + n >= &hostbuf[sizeof hostbuf]) {
- dprintf("size (%d) too big\n", n);
- had_error++;
- continue;
- }
- if (hap >= &h_addr_ptrs[MAXADDRS-1]) {
- if (!toobig++)
- dprintf("Too many addresses (%d)\n",
- MAXADDRS);
- cp += n;
- continue;
- }
- bcopy(cp, *hap++ = bp, n);
- bp += n;
- buflen -= n;
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- break;
- default:
- dprintf("Impossible condition (type=%d)\n", type);
- h_errno = NO_RECOVERY;
- return (NULL);
- /* BIND has abort() here, too risky on bad data */
- }
- if (!had_error)
- haveanswer++;
- }
- if (haveanswer) {
- *ap = NULL;
- *hap = NULL;
-# if defined(RESOLVSORT)
- /*
- * Note: we sort even if host can take only one address
- * in its return structures - should give it the "best"
- * address in that case, not some random one
- */
- if (_res.nsort && haveanswer > 1 && qtype == T_A)
- addrsort(h_addr_ptrs, haveanswer);
-# endif /*RESOLVSORT*/
- if (!host.h_name) {
- n = strlen(qname) + 1; /* for the \0 */
- if (n > buflen || n >= MAXHOSTNAMELEN)
- goto no_recovery;
- strcpy(bp, qname);
- host.h_name = bp;
- bp += n;
- buflen -= n;
- }
- if (_res.options & RES_USE_INET6)
- _map_v4v6_hostent(&host, &bp, &buflen);
- h_errno = NETDB_SUCCESS;
- return (&host);
- }
- no_recovery:
- h_errno = NO_RECOVERY;
- return (NULL);
-}
-
-struct hostent *
-__dns_getanswer(answer, anslen, qname, qtype)
- const char *answer;
- int anslen;
- const char *qname;
- int qtype;
-{
- switch(qtype) {
- case T_AAAA:
- host.h_addrtype = AF_INET6;
- host.h_length = IN6ADDRSZ;
- break;
- case T_A:
- default:
- host.h_addrtype = AF_INET;
- host.h_length = INADDRSZ;
- break;
- }
-
- return(gethostanswer((const querybuf *)answer, anslen, qname, qtype));
-}
-
-struct hostent *
-_gethostbydnsname(name, af)
- const char *name;
- int af;
-{
- querybuf buf;
- register const char *cp;
- char *bp;
- int n, size, type, len;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
-
- switch (af) {
- case AF_INET:
- size = INADDRSZ;
- type = T_A;
- break;
- case AF_INET6:
- size = IN6ADDRSZ;
- type = T_AAAA;
- break;
- default:
- h_errno = NETDB_INTERNAL;
- errno = EAFNOSUPPORT;
- return (NULL);
- }
-
- host.h_addrtype = af;
- host.h_length = size;
-
- /*
- * if there aren't any dots, it could be a user-level alias.
- * this is also done in res_query() since we are not the only
- * function that looks up host names.
- */
- if (!strchr(name, '.') && (cp = __hostalias(name)))
- name = cp;
-
- /*
- * disallow names consisting only of digits/dots, unless
- * they end in a dot.
- */
- if (isdigit((int)name[0]))
- for (cp = name;; ++cp) {
- if (!*cp) {
- if (*--cp == '.')
- break;
- /*
- * All-numeric, no dot at the end.
- * Fake up a hostent as if we'd actually
- * done a lookup.
- */
- if (inet_pton(af, name, host_addr) <= 0) {
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- strncpy(hostbuf, name, MAXDNAME);
- hostbuf[MAXDNAME] = '\0';
- bp = hostbuf + MAXDNAME;
- len = sizeof hostbuf - MAXDNAME;
- host.h_name = hostbuf;
- host.h_aliases = host_aliases;
- host_aliases[0] = NULL;
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- host.h_addr_list = h_addr_ptrs;
- if (_res.options & RES_USE_INET6)
- _map_v4v6_hostent(&host, &bp, &len);
- h_errno = NETDB_SUCCESS;
- return (&host);
- }
- if (!isdigit((int)*cp) && *cp != '.')
- break;
- }
- if ((isxdigit((int)name[0]) && strchr(name, ':') != NULL) ||
- name[0] == ':')
- for (cp = name;; ++cp) {
- if (!*cp) {
- if (*--cp == '.')
- break;
- /*
- * All-IPv6-legal, no dot at the end.
- * Fake up a hostent as if we'd actually
- * done a lookup.
- */
- if (inet_pton(af, name, host_addr) <= 0) {
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- strncpy(hostbuf, name, MAXDNAME);
- hostbuf[MAXDNAME] = '\0';
- bp = hostbuf + MAXDNAME;
- len = sizeof hostbuf - MAXDNAME;
- host.h_name = hostbuf;
- host.h_aliases = host_aliases;
- host_aliases[0] = NULL;
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- host.h_addr_list = h_addr_ptrs;
- h_errno = NETDB_SUCCESS;
- return (&host);
- }
- if (!isxdigit((int)*cp) && *cp != ':' && *cp != '.')
- break;
- }
-
- if ((n = res_search(name, C_IN, type, buf.buf, sizeof(buf))) < 0) {
- dprintf("res_search failed (%d)\n", n);
- return (NULL);
- }
- return (gethostanswer(&buf, n, name, type));
-}
-
-struct hostent *
-_gethostbydnsaddr(addr, len, af)
- const char *addr; /* XXX should have been def'd as u_char! */
- int len, af;
-{
- const u_char *uaddr = (const u_char *)addr;
- static const u_char mapped[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0xff,0xff };
- static const u_char tunnelled[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 };
- int n, size;
- querybuf buf;
- register struct hostent *hp;
- char qbuf[MAXDNAME+1], *qp;
-#ifdef SUNSECURITY
- register struct hostent *rhp;
- char **haddr;
- u_long old_options;
- char hname2[MAXDNAME+1];
-#endif /*SUNSECURITY*/
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- if (af == AF_INET6 && len == IN6ADDRSZ &&
- (!bcmp(uaddr, mapped, sizeof mapped) ||
- !bcmp(uaddr, tunnelled, sizeof tunnelled))) {
- /* Unmap. */
- addr += sizeof mapped;
- uaddr += sizeof mapped;
- af = AF_INET;
- len = INADDRSZ;
- }
- switch (af) {
- case AF_INET:
- size = INADDRSZ;
- break;
- case AF_INET6:
- size = IN6ADDRSZ;
- break;
- default:
- errno = EAFNOSUPPORT;
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- if (size != len) {
- errno = EINVAL;
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- switch (af) {
- case AF_INET:
- (void) sprintf(qbuf, "%u.%u.%u.%u.in-addr.arpa",
- (uaddr[3] & 0xff),
- (uaddr[2] & 0xff),
- (uaddr[1] & 0xff),
- (uaddr[0] & 0xff));
- break;
- case AF_INET6:
- qp = qbuf;
- for (n = IN6ADDRSZ - 1; n >= 0; n--) {
- qp += SPRINTF((qp, "%x.%x.",
- uaddr[n] & 0xf,
- (uaddr[n] >> 4) & 0xf));
- }
- strcpy(qp, "ip6.int");
- break;
- default:
- abort();
- }
- n = res_query(qbuf, C_IN, T_PTR, (u_char *)buf.buf, sizeof buf.buf);
- if (n < 0) {
- dprintf("res_query failed (%d)\n", n);
- return (NULL);
- }
- if (!(hp = gethostanswer(&buf, n, qbuf, T_PTR)))
- return (NULL); /* h_errno was set by gethostanswer() */
-#ifdef SUNSECURITY
- if (af == AF_INET) {
- /*
- * turn off search as the name should be absolute,
- * 'localhost' should be matched by defnames
- */
- strncpy(hname2, hp->h_name, MAXDNAME);
- hname2[MAXDNAME] = '\0';
- old_options = _res.options;
- _res.options &= ~RES_DNSRCH;
- _res.options |= RES_DEFNAMES;
- if (!(rhp = gethostbyname(hname2))) {
- syslog(LOG_NOTICE|LOG_AUTH,
- "gethostbyaddr: No A record for %s (verifying [%s])",
- hname2, inet_ntoa(*((struct in_addr *)addr)));
- _res.options = old_options;
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- _res.options = old_options;
- for (haddr = rhp->h_addr_list; *haddr; haddr++)
- if (!memcmp(*haddr, addr, INADDRSZ))
- break;
- if (!*haddr) {
- syslog(LOG_NOTICE|LOG_AUTH,
- "gethostbyaddr: A record of %s != PTR record [%s]",
- hname2, inet_ntoa(*((struct in_addr *)addr)));
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- }
-#endif /*SUNSECURITY*/
- hp->h_addrtype = af;
- hp->h_length = len;
- bcopy(addr, host_addr, len);
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- if (af == AF_INET && (_res.options & RES_USE_INET6)) {
- _map_v4v6_address((char*)host_addr, (char*)host_addr);
- hp->h_addrtype = AF_INET6;
- hp->h_length = IN6ADDRSZ;
- }
- h_errno = NETDB_SUCCESS;
- return (hp);
-}
-
-#ifdef RESOLVSORT
-static void
-addrsort(ap, num)
- char **ap;
- int num;
-{
- int i, j;
- char **p;
- short aval[MAXADDRS];
- int needsort = 0;
-
- p = ap;
- for (i = 0; i < num; i++, p++) {
- for (j = 0 ; (unsigned)j < _res.nsort; j++)
- if (_res.sort_list[j].addr.s_addr ==
- (((struct in_addr *)(*p))->s_addr & _res.sort_list[j].mask))
- break;
- aval[i] = j;
- if (needsort == 0 && i > 0 && j < aval[i-1])
- needsort = i;
- }
- if (!needsort)
- return;
-
- while (needsort < num) {
- for (j = needsort - 1; j >= 0; j--) {
- if (aval[j] > aval[j+1]) {
- char *hp;
-
- i = aval[j];
- aval[j] = aval[j+1];
- aval[j+1] = i;
-
- hp = ap[j];
- ap[j] = ap[j+1];
- ap[j+1] = hp;
-
- } else
- break;
- }
- needsort++;
- }
-}
-#endif
-void
-_sethostdnsent(stayopen)
- int stayopen;
-{
- if ((_res.options & RES_INIT) == 0 && res_init() == -1)
- return;
- if (stayopen)
- _res.options |= RES_STAYOPEN | RES_USEVC;
-}
-
-void
-_endhostdnsent()
-{
- _res.options &= ~(RES_STAYOPEN | RES_USEVC);
- res_close();
-}
diff --git a/c/src/libnetworking/libc/gethostbyht.c b/c/src/libnetworking/libc/gethostbyht.c
deleted file mode 100644
index 29f2805367..0000000000
--- a/c/src/libnetworking/libc/gethostbyht.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*-
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <arpa/nameser.h> /* XXX */
-#include <resolv.h> /* XXX */
-
-#define MAXALIASES 35
-
-static struct hostent host;
-static char *host_aliases[MAXALIASES];
-static char hostbuf[BUFSIZ+1];
-static FILE *hostf = NULL;
-static u_char host_addr[16]; /* IPv4 or IPv6 */
-static char *h_addr_ptrs[2];
-static int stayopen = 0;
-
-void
-_sethosthtent(f)
- int f;
-{
- if (!hostf)
- hostf = fopen(_PATH_HOSTS, "r" );
- else
- rewind(hostf);
- stayopen = f;
-}
-
-void
-_endhosthtent()
-{
- if (hostf && !stayopen) {
- (void) fclose(hostf);
- hostf = NULL;
- }
-}
-
-struct hostent *
-gethostent()
-{
- char *p;
- register char *cp, **q;
- int af, len;
-
- if (!hostf && !(hostf = fopen(_PATH_HOSTS, "r" ))) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- again:
- if (!(p = fgets(hostbuf, sizeof hostbuf, hostf))) {
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- if (*p == '#')
- goto again;
- if (!(cp = strpbrk(p, "#\n")))
- goto again;
- *cp = '\0';
- if (!(cp = strpbrk(p, " \t")))
- goto again;
- *cp++ = '\0';
- if (inet_pton(AF_INET6, p, host_addr) > 0) {
- af = AF_INET6;
- len = IN6ADDRSZ;
- } else if (inet_pton(AF_INET, p, host_addr) > 0) {
- if (_res.options & RES_USE_INET6) {
- _map_v4v6_address((char*)host_addr, (char*)host_addr);
- af = AF_INET6;
- len = IN6ADDRSZ;
- } else {
- af = AF_INET;
- len = INADDRSZ;
- }
- } else {
- goto again;
- }
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- host.h_addr_list = h_addr_ptrs;
- host.h_length = len;
- host.h_addrtype = af;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- host.h_name = cp;
- q = host.h_aliases = host_aliases;
- if ((cp = strpbrk(cp, " \t")) != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &host_aliases[MAXALIASES - 1])
- *q++ = cp;
- if ((cp = strpbrk(cp, " \t")) != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- h_errno = NETDB_SUCCESS;
- return (&host);
-}
-
-struct hostent *
-_gethostbyhtname(name, af)
- const char *name;
- int af;
-{
- register struct hostent *p;
- register char **cp;
-
- sethostent(0);
- while ((p = gethostent()) != NULL) {
- if (p->h_addrtype != af)
- continue;
- if (strcasecmp(p->h_name, name) == 0)
- break;
- for (cp = p->h_aliases; *cp != 0; cp++)
- if (strcasecmp(*cp, name) == 0)
- goto found;
- }
-found:
- endhostent();
- return (p);
-}
-
-struct hostent *
-_gethostbyhtaddr(addr, len, af)
- const char *addr;
- int len, af;
-{
- register struct hostent *p;
-
- sethostent(0);
- while ((p = gethostent()) != NULL)
- if (p->h_addrtype == af && !bcmp(p->h_addr, addr, len))
- break;
- endhostent();
- return (p);
-}
diff --git a/c/src/libnetworking/libc/gethostbyname.3 b/c/src/libnetworking/libc/gethostbyname.3
deleted file mode 100644
index e21dc79f1d..0000000000
--- a/c/src/libnetworking/libc/gethostbyname.3
+++ /dev/null
@@ -1,305 +0,0 @@
-.\" Copyright (c) 1983, 1987, 1991, 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.
-.\"
-.\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95
-.\" $Id$
-.\"
-.Dd May 25, 1995
-.Dt GETHOSTBYNAME 3
-.Os BSD 4.2
-.Sh NAME
-.Nm gethostbyname ,
-.Nm gethostbyname2 ,
-.Nm gethostbyaddr ,
-.Nm gethostent ,
-.Nm sethostent ,
-.Nm endhostent ,
-.Nm herror ,
-.Nm hstrerror
-.Nd get network host entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Vt extern int h_errno;
-.Ft struct hostent *
-.Fn gethostbyname "const char *name"
-.Ft struct hostent *
-.Fn gethostbyname2 "const char *name" "int af"
-.Ft struct hostent *
-.Fn gethostbyaddr "const char *addr" "int len" "int type"
-.Ft struct hostent *
-.Fn gethostent void
-.Ft void
-.Fn sethostent "int stayopen"
-.Ft void
-.Fn endhostent void
-.Ft void
-.Fn herror "const char *string"
-.Ft const char *
-.Fn hstrerror "int err"
-.Sh DESCRIPTION
-The
-.Fn gethostbyname ,
-.Fn gethostbyname2
-and
-.Fn gethostbyaddr
-functions
-each return a pointer to an object with the
-following structure describing an internet host
-referenced by name or by address, respectively.
-This structure contains either the information obtained from the name server,
-.Xr named 8 ,
-or broken-out fields from a line in
-.Pa /etc/hosts .
-If the local name server is not running these routines do a lookup in
-.Pa /etc/hosts .
-.Bd -literal
-struct hostent {
- char *h_name; /* official name of host */
- char **h_aliases; /* alias list */
- int h_addrtype; /* host address type */
- int h_length; /* length of address */
- char **h_addr_list; /* list of addresses from name server */
-};
-#define h_addr h_addr_list[0] /* address, for backward compatibility */
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width h_addr_list
-.It Fa h_name
-Official name of the host.
-.It Fa h_aliases
-A NULL-terminated array of alternate names for the host.
-.It Fa h_addrtype
-The type of address being returned; usually
-.Dv AF_INET .
-.It Fa h_length
-The length, in bytes, of the address.
-.It Fa h_addr_list
-A NULL-terminated array of network addresses for the host.
-Host addresses are returned in network byte order.
-.It Fa h_addr
-The first address in
-.Fa h_addr_list ;
-this is for backward compatibility.
-.El
-.Pp
-When using the nameserver,
-.Fn gethostbyname
-and
-.Fn gethostbyname
-will search for the named host in the current domain and its parents
-unless the name ends in a dot.
-If the name contains no dot, and if the environment variable
-.Dq Ev HOSTALIASES
-contains the name of an alias file, the alias file will first be searched
-for an alias matching the input name.
-See
-.Xr hostname 7
-for the domain search procedure and the alias file format.
-.Pp
-The
-.Fn gethostbyname2
-function is an evolution of
-.Fn gethostbyname
-which is intended to allow lookups in address families other than
-.Dv AF_INET ,
-for example
-.Dv AF_INET6 .
-Currently the
-.Fa af
-argument must be specified as
-.Dv AF_INET
-else the function will return
-.Dv NULL
-after having set
-.Va h_errno
-to
-.Dv NETDB_INTERNAL
-.Pp
-The
-.Fn sethostent
-function
-may be used to request the use of a connected
-.Tn TCP
-socket for queries.
-If the
-.Fa stayopen
-flag is non-zero,
-this sets the option to send all queries to the name server using
-.Tn TCP
-and to retain the connection after each call to
-.Fn gethostbyname ,
-.Fn gethostbyname2
-or
-.Fn gethostbyaddr .
-Otherwise, queries are performed using
-.Tn UDP
-datagrams.
-.Pp
-The
-.Fn endhostent
-function
-closes the
-.Tn TCP
-connection.
-.Pp
-The
-.Fn herror
-function writes a message to the diagnostic output consisting of the
-string parameter
-.Fa s ,
-the constant string ": ", and a message corresponding to the value of
-.Va h_errno .
-.Pp
-The
-.Fn hstrerror
-function returns a string which is the message text corresponding to the
-value of the
-.Fa err
-parameter.
-.Sh FILES
-.Bl -tag -width /etc/resolv.conf -compact
-.It Pa /etc/hosts
-.It Pa /etc/host.conf
-.It Pa /etc/resolv.conf
-.El
-.Sh DIAGNOSTICS
-Error return status from
-.Fn gethostbyname ,
-.Fn gethostbyname2
-and
-.Fn gethostbyaddr
-is indicated by return of a null pointer.
-The external integer
-.Va h_errno
-may then be checked to see whether this is a temporary failure
-or an invalid or unknown host.
-The routine
-.Fn herror
-can be used to print an error message describing the failure.
-If its argument
-.Fa string
-is
-.Pf non Dv -NULL ,
-it is printed, followed by a colon and a space.
-The error message is printed with a trailing newline.
-.Pp
-The variable
-.Va h_errno
-can have the following values:
-.Bl -tag -width HOST_NOT_FOUND
-.It Dv HOST_NOT_FOUND
-No such host is known.
-.It Dv TRY_AGAIN
-This is usually a temporary error
-and means that the local server did not receive
-a response from an authoritative server.
-A retry at some later time may succeed.
-.It Dv NO_RECOVERY
-Some unexpected server failure was encountered.
-This is a non-recoverable error.
-.It Dv NO_DATA
-The requested name is valid but does not have an IP address;
-this is not a temporary error.
-This means that the name is known to the name server but there is no address
-associated with this name.
-Another type of request to the name server using this domain name
-will result in an answer;
-for example, a mail-forwarder may be registered for this domain.
-.El
-.Sh SEE ALSO
-.Xr resolver 3 ,
-.Xr hosts 5 ,
-.Xr hostname 7 ,
-.Xr named 8
-.Sh CAVEAT
-The
-.Fn gethostent
-function
-is defined, and
-.Fn sethostent
-and
-.Fn endhostent
-are redefined,
-when
-.Xr libc 3
-is built to use only the routines to lookup in
-.Pa /etc/hosts
-and not the name server.
-.Pp
-The
-.Fn gethostent
-function
-reads the next line of
-.Pa /etc/hosts ,
-opening the file if necessary.
-.Pp
-The
-.Fn sethostent
-function
-opens and/or rewinds the file
-.Pa /etc/hosts .
-If the
-.Fa stayopen
-argument is non-zero,
-the file will not be closed after each call to
-.Fn gethostbyname ,
-.Fn gethostbyname2
-or
-.Fn gethostbyaddr .
-.Pp
-The
-.Fn endhostent
-function
-closes the file.
-.Sh HISTORY
-The
-.Fn herror
-function appeared in
-.Bx 4.3 .
-The
-.Fn endhostent ,
-.Fn gethostbyaddr ,
-.Fn gethostbyname ,
-.Fn gethostent ,
-and
-.Fn sethostent
-functions appeared in
-.Bx 4.2 .
-The
-.Fn gethostbyname2
-function first appeared in bind-4.9.4.
-.Sh BUGS
-These functions use static data storage;
-if the data is needed for future use, it should be
-copied before any subsequent calls overwrite it.
-Only the Internet
-address format is currently understood.
diff --git a/c/src/libnetworking/libc/gethostbynis.c b/c/src/libnetworking/libc/gethostbynis.c
deleted file mode 100644
index 45dbe5a85d..0000000000
--- a/c/src/libnetworking/libc/gethostbynis.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id$";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-#define MAXALIASES 35
-#define MAXADDRS 35
-
-#ifdef YP
-static char *host_aliases[MAXALIASES];
-static char hostaddr[MAXADDRS];
-static char *host_addrs[2];
-#endif /* YP */
-
-static struct hostent *
-_gethostbynis(name, map, af)
- const char *name;
- char *map;
- int af;
-{
-#ifdef YP
- register char *cp, **q;
- char *result;
- int resultlen;
- static struct hostent h;
- static char *domain = (char *)NULL;
- static char ypbuf[YPMAXRECORD + 2];
-
- switch(af) {
- case AF_INET:
- break;
- default:
- case AF_INET6:
- errno = EAFNOSUPPORT;
- return NULL;
- }
-
- if (domain == (char *)NULL)
- if (yp_get_default_domain (&domain))
- return ((struct hostent *)NULL);
-
- if (yp_match(domain, map, name, strlen(name), &result, &resultlen))
- return ((struct hostent *)NULL);
-
- /* avoid potential memory leak */
- bcopy((char *)result, (char *)&ypbuf, resultlen);
- ypbuf[resultlen] = '\0';
- free(result);
- result = (char *)&ypbuf;
-
- if ((cp = index(result, '\n')))
- *cp = '\0';
-
- cp = strpbrk(result, " \t");
- *cp++ = '\0';
- h.h_addr_list = host_addrs;
- h.h_addr = hostaddr;
- *((u_long *)h.h_addr) = inet_addr(result);
- h.h_length = sizeof(u_long);
- h.h_addrtype = AF_INET;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- h.h_name = cp;
- q = h.h_aliases = host_aliases;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &host_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&h);
-#else
- return (NULL);
-#endif /* YP */
-}
-
-struct hostent *
-_gethostbynisname(name, af)
- const char *name;
- int af;
-{
- return _gethostbynis(name, "hosts.byname", af);
-}
-
-struct hostent *
-_gethostbynisaddr(addr, len, af)
- const char *addr;
- int len;
- int af;
-{
- return _gethostbynis(inet_ntoa(*(struct in_addr *)addr),"hosts.byaddr", af);
-}
diff --git a/c/src/libnetworking/libc/gethostnamadr.c b/c/src/libnetworking/libc/gethostnamadr.c
deleted file mode 100644
index 92f7a21014..0000000000
--- a/c/src/libnetworking/libc/gethostnamadr.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id$";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <arpa/nameser.h> /* XXX hack for _res */
-#include <resolv.h> /* XXX hack for _res */
-
-#define _PATH_HOSTCONF "/etc/host.conf"
-
-enum service_type {
- SERVICE_NONE = 0,
- SERVICE_BIND,
- SERVICE_HOSTS,
- SERVICE_NIS };
-#define SERVICE_MAX SERVICE_NIS
-
-static struct {
- const char *name;
- enum service_type type;
-} service_names[] = {
- { "hosts", SERVICE_HOSTS },
- { "/etc/hosts", SERVICE_HOSTS },
- { "hosttable", SERVICE_HOSTS },
- { "htable", SERVICE_HOSTS },
- { "bind", SERVICE_BIND },
- { "dns", SERVICE_BIND },
- { "domain", SERVICE_BIND },
- { "yp", SERVICE_NIS },
- { "yellowpages", SERVICE_NIS },
- { "nis", SERVICE_NIS },
- { 0, SERVICE_NONE }
-};
-
-static enum service_type service_order[SERVICE_MAX + 1];
-static int service_done = 0;
-
-static enum service_type
-get_service_name(const char *name) {
- int i;
- for(i = 0; service_names[i].type != SERVICE_NONE; i++) {
- if(!strcasecmp(name, service_names[i].name)) {
- return service_names[i].type;
- }
- }
- return SERVICE_NONE;
-}
-
-static void
-init_services()
-{
- char *cp, *p, buf[BUFSIZ];
- register int cc = 0;
- FILE *fd;
-
- if ((fd = (FILE *)fopen(_PATH_HOSTCONF, "r")) == NULL) {
- /* make some assumptions */
- service_order[0] = SERVICE_BIND;
- service_order[1] = SERVICE_HOSTS;
- service_order[2] = SERVICE_NONE;
- } else {
- while (fgets(buf, BUFSIZ, fd) != NULL && cc < SERVICE_MAX) {
- if(buf[0] == '#')
- continue;
-
- p = buf;
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- if (cp == NULL)
- continue;
- do {
- if (isalpha((int)cp[0])) {
- service_order[cc] = get_service_name(cp);
- if(service_order[cc] != SERVICE_NONE)
- cc++;
- }
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- } while(cp != NULL && cc < SERVICE_MAX);
- }
- service_order[cc] = SERVICE_NONE;
- fclose(fd);
- }
- service_done = 1;
-}
-
-struct hostent *
-gethostbyname(const char *name)
-{
- struct hostent *hp;
-
- if (_res.options & RES_USE_INET6) { /* XXX */
- hp = gethostbyname2(name, AF_INET6); /* XXX */
- if (hp) /* XXX */
- return (hp); /* XXX */
- } /* XXX */
- return (gethostbyname2(name, AF_INET));
-}
-
-struct hostent *
-gethostbyname2(const char *name, int type)
-{
- struct hostent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return NULL;
- case SERVICE_HOSTS:
- hp = _gethostbyhtname(name, type);
- break;
- case SERVICE_BIND:
- hp = _gethostbydnsname(name, type);
- break;
- case SERVICE_NIS:
- hp = _gethostbynisname(name, type);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-struct hostent *
-gethostbyaddr(const char *addr, int len, int type)
-{
- struct hostent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return 0;
- case SERVICE_HOSTS:
- hp = _gethostbyhtaddr(addr, len, type);
- break;
- case SERVICE_BIND:
- hp = _gethostbydnsaddr(addr, len, type);
- break;
- case SERVICE_NIS:
- hp = _gethostbynisaddr(addr, len, type);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-#ifdef _THREAD_SAFE
-struct hostent_data;
-
-/*
- * Temporary function (not thread safe)
- */
-int gethostbyaddr_r(const char *addr, int len, int type,
- struct hostent *result, struct hostent_data *buffer)
-{
- struct hostent *hp;
- int ret;
- if ((hp = gethostbyaddr(addr, len, type)) == NULL) {
- ret = -1;
- } else {
- memcpy(result, hp, sizeof(struct hostent));
- ret = 0;
- }
- return(ret);
-}
-#endif
-
-void
-sethostent(stayopen)
- int stayopen;
-{
- _sethosthtent(stayopen);
- _sethostdnsent(stayopen);
-}
-
-void
-endhostent()
-{
- _endhosthtent();
- _endhostdnsent();
-}
diff --git a/c/src/libnetworking/libc/gethostname.c b/c/src/libnetworking/libc/gethostname.c
deleted file mode 100644
index 81dc2267c2..0000000000
--- a/c/src/libnetworking/libc/gethostname.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * $Id$
- */
-
-#include "config.h"
-
-/*
- * Solaris doesn't include the gethostname call by default.
- */
-#include <sys/utsname.h>
-#include <sys/systeminfo.h>
-
-#include <netdb.h>
-
-/*
- * PUBLIC: #ifndef HAVE_GETHOSTNAME
- * PUBLIC: int gethostname __P((char *, int));
- * PUBLIC: #endif
- */
-int
-gethostname(host, len)
- char *host;
- int len;
-{
- return (sysinfo(SI_HOSTNAME, host, len) == -1 ? -1 : 0);
-}
diff --git a/c/src/libnetworking/libc/getnetbydns.c b/c/src/libnetworking/libc/getnetbydns.c
deleted file mode 100644
index 8f8c576332..0000000000
--- a/c/src/libnetworking/libc/getnetbydns.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/*-
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-/* Portions Copyright (c) 1993 Carlos Leandro and Rui Salgueiro
- * Dep. Matematica Universidade de Coimbra, Portugal, Europe
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <stdio.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <syslog.h>
-
-#include "res_config.h"
-
-extern int h_errno;
-
-#define BYADDR 0
-#define BYNAME 1
-#define MAXALIASES 35
-
-#if PACKETSZ > 1024
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 1024
-#endif
-
-typedef union {
- HEADER hdr;
- u_char buf[MAXPACKET];
-} querybuf;
-
-typedef union {
- long al;
- char ac;
-} align;
-
-static struct netent *
-getnetanswer(answer, anslen, net_i)
- querybuf *answer;
- int anslen;
- int net_i;
-{
-
- register HEADER *hp;
- register u_char *cp;
- register int n;
- u_char *eom;
- int type, class, buflen, ancount, qdcount, haveanswer, i, nchar;
- char aux1[MAXHOSTNAMELEN], aux2[MAXHOSTNAMELEN], ans[MAXHOSTNAMELEN];
- char *in, *st, *pauxt, *bp, **ap;
- char *paux1 = &aux1[0], *paux2 = &aux2[0], flag = 0;
-static struct netent net_entry;
-static char *net_aliases[MAXALIASES], netbuf[PACKETSZ];
-
- /*
- * find first satisfactory answer
- *
- * answer --> +------------+ ( MESSAGE )
- * | Header |
- * +------------+
- * | Question | the question for the name server
- * +------------+
- * | Answer | RRs answering the question
- * +------------+
- * | Authority | RRs pointing toward an authority
- * | Additional | RRs holding additional information
- * +------------+
- */
- eom = answer->buf + anslen;
- hp = &answer->hdr;
- ancount = ntohs(hp->ancount); /* #/records in the answer section */
- qdcount = ntohs(hp->qdcount); /* #/entries in the question section */
- bp = netbuf;
- buflen = sizeof(netbuf);
- cp = answer->buf + HFIXEDSZ;
- if (!qdcount) {
- if (hp->aa)
- h_errno = HOST_NOT_FOUND;
- else
- h_errno = TRY_AGAIN;
- return (NULL);
- }
- while (qdcount-- > 0)
- cp += __dn_skipname(cp, eom) + QFIXEDSZ;
- ap = net_aliases;
- *ap = NULL;
- net_entry.n_aliases = net_aliases;
- haveanswer = 0;
- while (--ancount >= 0 && cp < eom) {
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !res_dnok(bp))
- break;
- cp += n;
- ans[0] = '\0';
- (void)strncpy(&ans[0], bp, sizeof(ans) - 1);
- ans[sizeof(ans) - 1] = '\0';
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- cp += INT32SZ; /* TTL */
- GETSHORT(n, cp);
- if (class == C_IN && type == T_PTR) {
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !res_hnok(bp)) {
- cp += n;
- return (NULL);
- }
- cp += n;
- *ap++ = bp;
- bp += strlen(bp) + 1;
- net_entry.n_addrtype =
- (class == C_IN) ? AF_INET : AF_UNSPEC;
- haveanswer++;
- }
- }
- if (haveanswer) {
- *ap = NULL;
- switch (net_i) {
- case BYADDR:
- net_entry.n_name = *net_entry.n_aliases;
- net_entry.n_net = 0L;
- break;
- case BYNAME:
- in = *net_entry.n_aliases;
- net_entry.n_name = &ans[0];
- aux2[0] = '\0';
- for (i = 0; i < 4; i++) {
- for (st = in, nchar = 0;
- *st != '.';
- st++, nchar++)
- ;
- if (nchar != 1 || *in != '0' || flag) {
- flag = 1;
- (void)strncpy(paux1,
- (i==0) ? in : in-1,
- (i==0) ?nchar : nchar+1);
- paux1[(i==0) ? nchar : nchar+1] = '\0';
- pauxt = paux2;
- paux2 = strcat(paux1, paux2);
- paux1 = pauxt;
- }
- in = ++st;
- }
- net_entry.n_net = inet_network(paux2);
- break;
- }
- net_entry.n_aliases++;
- return (&net_entry);
- }
- h_errno = TRY_AGAIN;
- return (NULL);
-}
-
-struct netent *
-_getnetbydnsaddr(net, net_type)
- register unsigned long net;
- register int net_type;
-{
- unsigned int netbr[4];
- int nn, anslen;
- querybuf buf;
- char qbuf[MAXDNAME];
- unsigned long net2;
- struct netent *net_entry;
-
- if (net_type != AF_INET)
- return (NULL);
-
- for (nn = 4, net2 = net; net2; net2 >>= 8)
- netbr[--nn] = net2 & 0xff;
- switch (nn) {
- case 3: /* Class A */
- sprintf(qbuf, "0.0.0.%u.in-addr.arpa", netbr[3]);
- break;
- case 2: /* Class B */
- sprintf(qbuf, "0.0.%u.%u.in-addr.arpa", netbr[3], netbr[2]);
- break;
- case 1: /* Class C */
- sprintf(qbuf, "0.%u.%u.%u.in-addr.arpa", netbr[3], netbr[2],
- netbr[1]);
- break;
- case 0: /* Class D - E */
- sprintf(qbuf, "%u.%u.%u.%u.in-addr.arpa", netbr[3], netbr[2],
- netbr[1], netbr[0]);
- break;
- }
- anslen = res_query(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof(buf));
- if (anslen < 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf("res_query failed\n");
-#endif
- return (NULL);
- }
- net_entry = getnetanswer(&buf, anslen, BYADDR);
- if (net_entry) {
- unsigned u_net = net; /* maybe net should be unsigned ? */
-
- /* Strip trailing zeros */
- while ((u_net & 0xff) == 0 && u_net != 0)
- u_net >>= 8;
- net_entry->n_net = u_net;
- return (net_entry);
- }
- return (NULL);
-}
-
-struct netent *
-_getnetbydnsname(net)
- register const char *net;
-{
- int anslen;
- querybuf buf;
- char qbuf[MAXDNAME];
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- strncpy(qbuf, net, sizeof(qbuf) - 1);
- qbuf[sizeof(qbuf) - 1] = '\0';
- anslen = res_search(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof(buf));
- if (anslen < 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf("res_query failed\n");
-#endif
- return (NULL);
- }
- return getnetanswer(&buf, anslen, BYNAME);
-}
-
-void
-_setnetdnsent(stayopen)
- int stayopen;
-{
- if (stayopen)
- _res.options |= RES_STAYOPEN | RES_USEVC;
-}
-
-void
-_endnetdnsent()
-{
- _res.options &= ~(RES_STAYOPEN | RES_USEVC);
- res_close();
-}
diff --git a/c/src/libnetworking/libc/getnetbyht.c b/c/src/libnetworking/libc/getnetbyht.c
deleted file mode 100644
index f7b7b1091d..0000000000
--- a/c/src/libnetworking/libc/getnetbyht.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- */
-
-/* Portions Copyright (c) 1993 Carlos Leandro and Rui Salgueiro
- * Dep. Matematica Universidade de Coimbra, Portugal, Europe
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * from getnetent.c 1.1 (Coimbra) 93/06/02
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getnetent.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: getnetent.c,v 8.4 1997/06/01 20:34:37 vixie Exp";
-static chat rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <string.h>
-
-#define MAXALIASES 35
-
-static FILE *netf;
-static char line[BUFSIZ+1];
-static struct netent net;
-static char *net_aliases[MAXALIASES];
-static int _net_stayopen;
-
-void
-_setnethtent(f)
- int f;
-{
-
- if (netf == NULL)
- netf = fopen(_PATH_NETWORKS, "r" );
- else
- rewind(netf);
- _net_stayopen |= f;
-}
-
-void
-_endnethtent()
-{
-
- if (netf) {
- fclose(netf);
- netf = NULL;
- }
- _net_stayopen = 0;
-}
-
-struct netent *
-getnetent()
-{
- char *p;
- register char *cp, **q;
-
- if (netf == NULL && (netf = fopen(_PATH_NETWORKS, "r" )) == NULL)
- return (NULL);
-again:
- p = fgets(line, sizeof line, netf);
- if (p == NULL)
- return (NULL);
- if (*p == '#')
- goto again;
- cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
- net.n_name = p;
- cp = strpbrk(p, " \t");
- if (cp == NULL)
- goto again;
- *cp++ = '\0';
- while (*cp == ' ' || *cp == '\t')
- cp++;
- p = strpbrk(cp, " \t");
- if (p != NULL)
- *p++ = '\0';
- net.n_net = inet_network(cp);
- net.n_addrtype = AF_INET;
- q = net.n_aliases = net_aliases;
- if (p != NULL)
- cp = p;
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &net_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&net);
-}
-
-struct netent *
-_getnetbyhtname(name)
- register const char *name;
-{
- register struct netent *p;
- register char **cp;
-
- setnetent(_net_stayopen);
- while ( (p = getnetent()) ) {
- if (strcasecmp(p->n_name, name) == 0)
- break;
- for (cp = p->n_aliases; *cp != 0; cp++)
- if (strcasecmp(*cp, name) == 0)
- goto found;
- }
-found:
- if (!_net_stayopen)
- endnetent();
- return (p);
-}
-
-struct netent *
-_getnetbyhtaddr(net, type)
- register unsigned long net;
- register int type;
-{
- register struct netent *p;
-
- setnetent(_net_stayopen);
- while ( (p = getnetent()) )
- if (p->n_addrtype == type && p->n_net == net)
- break;
- if (!_net_stayopen)
- endnetent();
- return (p);
-}
diff --git a/c/src/libnetworking/libc/getnetbynis.c b/c/src/libnetworking/libc/getnetbynis.c
deleted file mode 100644
index 0549016ba2..0000000000
--- a/c/src/libnetworking/libc/getnetbynis.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id$";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <arpa/nameser.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-#define MAXALIASES 35
-#define MAXADDRS 35
-
-#ifdef YP
-static char *host_aliases[MAXALIASES];
-#endif /* YP */
-
-static struct netent *
-_getnetbynis(name, map, af)
- const char *name;
- char *map;
- int af;
-{
-#ifdef YP
- register char *cp, **q;
- static char *result;
- int resultlen;
- static struct netent h;
- static char *domain = (char *)NULL;
- static char ypbuf[YPMAXRECORD + 2];
-
- switch(af) {
- case AF_INET:
- break;
- default:
- case AF_INET6:
- errno = EAFNOSUPPORT;
- return NULL;
- }
-
- if (domain == (char *)NULL)
- if (yp_get_default_domain (&domain))
- return (NULL);
-
- if (yp_match(domain, map, name, strlen(name), &result, &resultlen))
- return (NULL);
-
- bcopy((char *)result, (char *)&ypbuf, resultlen);
- ypbuf[resultlen] = '\0';
- free(result);
- result = (char *)&ypbuf;
-
- if ((cp = index(result, '\n')))
- *cp = '\0';
-
- cp = strpbrk(result, " \t");
- *cp++ = '\0';
- h.n_name = result;
-
- while (*cp == ' ' || *cp == '\t')
- cp++;
-
- h.n_net = inet_network(cp);
- h.n_addrtype = AF_INET;
-
- q = h.n_aliases = host_aliases;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &host_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&h);
-#else
- return (NULL);
-#endif
-}
-
-struct netent *
-_getnetbynisname(name)
- const char *name;
-{
- return _getnetbynis(name, "networks.byname", AF_INET);
-}
-
-struct netent *
-_getnetbynisaddr(addr, af)
- unsigned long addr;
- int af;
-{
- char *str, *cp;
- unsigned long net2;
- int nn;
- unsigned int netbr[4];
- char buf[MAXDNAME];
-
- if (af != AF_INET) {
- errno = EAFNOSUPPORT;
- return (NULL);
- }
-
- for (nn = 4, net2 = addr; net2; net2 >>= 8) {
- netbr[--nn] = net2 & 0xff;
- }
-
- switch (nn) {
- case 3: /* Class A */
- sprintf(buf, "%u", netbr[3]);
- break;
- case 2: /* Class B */
- sprintf(buf, "%u.%u", netbr[2], netbr[3]);
- break;
- case 1: /* Class C */
- sprintf(buf, "%u.%u.%u", netbr[1], netbr[2], netbr[3]);
- break;
- case 0: /* Class D - E */
- sprintf(buf, "%u.%u.%u.%u", netbr[0], netbr[1],
- netbr[2], netbr[3]);
- break;
- }
-
- str = (char *)&buf;
- cp = str + (strlen(str) - 2);
-
- while(!strcmp(cp, ".0")) {
- *cp = '\0';
- cp = str + (strlen(str) - 2);
- }
-
- return _getnetbynis(str, "networks.byaddr", af);
-}
diff --git a/c/src/libnetworking/libc/getnetent.3 b/c/src/libnetworking/libc/getnetent.3
deleted file mode 100644
index aec93b5876..0000000000
--- a/c/src/libnetworking/libc/getnetent.3
+++ /dev/null
@@ -1,159 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" @(#)getnetent.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt GETNETENT 3
-.Os BSD 4.2
-.Sh NAME
-.Nm getnetent ,
-.Nm getnetbyaddr ,
-.Nm getnetbyname ,
-.Nm setnetent ,
-.Nm endnetent
-.Nd get network entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Ft struct netent *
-.Fn getnetent void
-.Ft struct netent *
-.Fn getnetbyname "const char *name"
-.Ft struct netent *
-.Fn getnetbyaddr "unsigned long net" "int type"
-.Ft void
-.Fn setnetent "int stayopen"
-.Ft void
-.Fn endnetent void
-.Sh DESCRIPTION
-The
-.Fn getnetent ,
-.Fn getnetbyname ,
-and
-.Fn getnetbyaddr
-functions
-each return a pointer to an object with the
-following structure
-containing the broken-out
-fields of a line in the network data base,
-.Pa /etc/networks .
-.Bd -literal -offset indent
-struct netent {
- char *n_name; /* official name of net */
- char **n_aliases; /* alias list */
- int n_addrtype; /* net number type */
- unsigned long n_net; /* net number */
-};
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width n_addrtype
-.It Fa n_name
-The official name of the network.
-.It Fa n_aliases
-A zero terminated list of alternate names for the network.
-.It Fa n_addrtype
-The type of the network number returned; currently only AF_INET.
-.It Fa n_net
-The network number. Network numbers are returned in machine byte
-order.
-.El
-.Pp
-The
-.Fn getnetent
-function
-reads the next line of the file, opening the file if necessary.
-.Pp
-The
-.Fn setnetent
-function
-opens and rewinds the file. If the
-.Fa stayopen
-flag is non-zero,
-the net data base will not be closed after each call to
-.Fn getnetbyname
-or
-.Fn getnetbyaddr .
-.Pp
-The
-.Fn endnetent
-function
-closes the file.
-.Pp
-The
-.Fn getnetbyname
-function
-and
-.Fn getnetbyaddr
-sequentially search from the beginning
-of the file until a matching
-net name or
-net address and type is found,
-or until
-.Dv EOF
-is encountered. The
-.Fa type
-must be
-.Dv AF_INET .
-Network numbers are supplied in host order.
-.Sh FILES
-.Bl -tag -width /etc/networks -compact
-.It Pa /etc/networks
-.El
-.Sh DIAGNOSTICS
-Null pointer
-(0) returned on
-.Dv EOF
-or error.
-.Sh SEE ALSO
-.Xr networks 5
-.Pp
-.%T RFC 1101
-.Sh HISTORY
-The
-.Fn getnetent ,
-.Fn getnetbyaddr ,
-.Fn getnetbyname ,
-.Fn setnetent ,
-and
-.Fn endnetent
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-The data space used by
-these functions is static; if future use requires the data, it should be
-copied before any subsequent calls to these functions overwrite it.
-Only Internet network
-numbers are currently understood.
-Expecting network numbers to fit
-in no more than 32 bits is probably
-naive.
diff --git a/c/src/libnetworking/libc/getnetnamadr.c b/c/src/libnetworking/libc/getnetnamadr.c
deleted file mode 100644
index 4d6597f98c..0000000000
--- a/c/src/libnetworking/libc/getnetnamadr.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-
-#ifndef _PATH_NETCONF
-#define _PATH_NETCONF "/etc/host.conf"
-#endif
-
-enum service_type {
- SERVICE_NONE = 0,
- SERVICE_BIND,
- SERVICE_TABLE,
- SERVICE_NIS };
-#define SERVICE_MAX SERVICE_NIS
-
-static struct {
- const char *name;
- enum service_type type;
-} service_names[] = {
- { "hosts", SERVICE_TABLE },
- { "/etc/hosts", SERVICE_TABLE },
- { "hosttable", SERVICE_TABLE },
- { "htable", SERVICE_TABLE },
- { "bind", SERVICE_BIND },
- { "dns", SERVICE_BIND },
- { "domain", SERVICE_BIND },
- { "yp", SERVICE_NIS },
- { "yellowpages", SERVICE_NIS },
- { "nis", SERVICE_NIS },
- { 0, SERVICE_NONE }
-};
-
-static enum service_type service_order[SERVICE_MAX + 1];
-static int service_done = 0;
-
-static enum service_type
-get_service_name(const char *name) {
- int i;
- for(i = 0; service_names[i].type != SERVICE_NONE; i++) {
- if(!strcasecmp(name, service_names[i].name)) {
- return service_names[i].type;
- }
- }
- return SERVICE_NONE;
-}
-
-static void
-init_services()
-{
- char *cp, *p, buf[BUFSIZ];
- register int cc = 0;
- FILE *fd;
-
- if ((fd = (FILE *)fopen(_PATH_NETCONF, "r")) == NULL) {
- /* make some assumptions */
- service_order[0] = SERVICE_TABLE;
- service_order[1] = SERVICE_NONE;
- } else {
- while (fgets(buf, BUFSIZ, fd) != NULL && cc < SERVICE_MAX) {
- if(buf[0] == '#')
- continue;
-
- p = buf;
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- if (cp == NULL)
- continue;
- do {
- if (isalpha(cp[0])) {
- service_order[cc] = get_service_name(cp);
- if(service_order[cc] != SERVICE_NONE)
- cc++;
- }
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- } while(cp != NULL && cc < SERVICE_MAX);
- }
- service_order[cc] = SERVICE_NONE;
- fclose(fd);
- }
- service_done = 1;
-}
-
-struct netent *
-getnetbyname(const char *name)
-{
- struct netent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return NULL;
- case SERVICE_TABLE:
- hp = _getnetbyhtname(name);
- break;
- case SERVICE_BIND:
- hp = _getnetbydnsname(name);
- break;
- case SERVICE_NIS:
- hp = _getnetbynisname(name);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-struct netent *
-getnetbyaddr(addr, af)
- u_long addr;
- int af;
-{
- struct netent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return 0;
- case SERVICE_TABLE:
- hp = _getnetbyhtaddr(addr, af);
- break;
- case SERVICE_BIND:
- hp = _getnetbydnsaddr(addr, af);
- break;
- case SERVICE_NIS:
- hp = _getnetbynisaddr(addr, af);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-void
-setnetent(stayopen)
- int stayopen;
-{
- _setnethtent(stayopen);
- _setnetdnsent(stayopen);
-}
-
-void
-endnetent()
-{
- _endnethtent();
- _endnetdnsent();
-}
diff --git a/c/src/libnetworking/libc/getproto.c b/c/src/libnetworking/libc/getproto.c
deleted file mode 100644
index c2a653f4b4..0000000000
--- a/c/src/libnetworking/libc/getproto.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getproto.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-
-extern int _proto_stayopen;
-
-struct protoent *
-getprotobynumber(proto)
- register int proto;
-{
- register struct protoent *p;
-
- setprotoent(_proto_stayopen);
- while ( (p = getprotoent()) )
- if (p->p_proto == proto)
- break;
- if (!_proto_stayopen)
- endprotoent();
- return (p);
-}
diff --git a/c/src/libnetworking/libc/getprotoent.3 b/c/src/libnetworking/libc/getprotoent.3
deleted file mode 100644
index 784461d7e3..0000000000
--- a/c/src/libnetworking/libc/getprotoent.3
+++ /dev/null
@@ -1,147 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" @(#)getprotoent.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt GETPROTOENT 3
-.Os BSD 4.2
-.Sh NAME
-.Nm getprotoent ,
-.Nm getprotobynumber ,
-.Nm getprotobyname ,
-.Nm setprotoent ,
-.Nm endprotoent
-.Nd get protocol entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Ft struct protoent *
-.Fn getprotoent void
-.Ft struct protoent *
-.Fn getprotobyname "const char *name"
-.Ft struct protoent *
-.Fn getprotobynumber "int proto"
-.Ft void
-.Fn setprotoent "int stayopen"
-.Ft void
-.Fn endprotoent void
-.Sh DESCRIPTION
-The
-.Fn getprotoent ,
-.Fn getprotobyname ,
-and
-.Fn getprotobynumber
-functions
-each return a pointer to an object with the
-following structure
-containing the broken-out
-fields of a line in the network protocol data base,
-.Pa /etc/protocols .
-.Bd -literal -offset indent
-.Pp
-struct protoent {
- char *p_name; /* official name of protocol */
- char **p_aliases; /* alias list */
- int p_proto; /* protocol number */
-};
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width p_aliases
-.It Fa p_name
-The official name of the protocol.
-.It Fa p_aliases
-A zero terminated list of alternate names for the protocol.
-.It Fa p_proto
-The protocol number.
-.El
-.Pp
-The
-.Fn getprotoent
-function
-reads the next line of the file, opening the file if necessary.
-.Pp
-The
-.Fn setprotoent
-function
-opens and rewinds the file. If the
-.Fa stayopen
-flag is non-zero,
-the net data base will not be closed after each call to
-.Fn getprotobyname
-or
-.Fn getprotobynumber .
-.Pp
-The
-.Fn endprotoent
-function
-closes the file.
-.Pp
-The
-.Fn getprotobyname
-function
-and
-.Fn getprotobynumber
-sequentially search from the beginning
-of the file until a matching
-protocol name or
-protocol number is found,
-or until
-.Dv EOF
-is encountered.
-.Sh RETURN VALUES
-Null pointer
-(0) returned on
-.Dv EOF
-or error.
-.Sh FILES
-.Bl -tag -width /etc/protocols -compact
-.It Pa /etc/protocols
-.El
-.Sh SEE ALSO
-.Xr protocols 5
-.Sh HISTORY
-The
-.Fn getprotoent ,
-.Fn getprotobynumber ,
-.Fn getprotobyname ,
-.Fn setprotoent ,
-and
-.Fn endprotoent
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-These functions use a static data space;
-if the data is needed for future use, it should be
-copied before any subsequent calls overwrite it.
-Only the Internet
-protocols are currently understood.
diff --git a/c/src/libnetworking/libc/getprotoent.c b/c/src/libnetworking/libc/getprotoent.c
deleted file mode 100644
index 0b9cefec68..0000000000
--- a/c/src/libnetworking/libc/getprotoent.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getprotoent.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define MAXALIASES 35
-
-static FILE *protof = NULL;
-static char line[BUFSIZ+1];
-static struct protoent proto;
-static char *proto_aliases[MAXALIASES];
-int _proto_stayopen;
-
-void
-setprotoent(f)
- int f;
-{
- if (protof == NULL)
- protof = fopen(_PATH_PROTOCOLS, "r" );
- else
- rewind(protof);
- _proto_stayopen |= f;
-}
-
-void
-endprotoent()
-{
- if (protof) {
- fclose(protof);
- protof = NULL;
- }
- _proto_stayopen = 0;
-}
-
-struct protoent *
-getprotoent()
-{
- char *p;
- register char *cp, **q;
-
- if (protof == NULL && (protof = fopen(_PATH_PROTOCOLS, "r" )) == NULL)
- return (NULL);
-again:
- if ((p = fgets(line, BUFSIZ, protof)) == NULL)
- return (NULL);
- if (*p == '#')
- goto again;
- cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
- proto.p_name = p;
- cp = strpbrk(p, " \t");
- if (cp == NULL)
- goto again;
- *cp++ = '\0';
- while (*cp == ' ' || *cp == '\t')
- cp++;
- p = strpbrk(cp, " \t");
- if (p != NULL)
- *p++ = '\0';
- proto.p_proto = atoi(cp);
- q = proto.p_aliases = proto_aliases;
- if (p != NULL) {
- cp = p;
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &proto_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- }
- *q = NULL;
- return (&proto);
-}
diff --git a/c/src/libnetworking/libc/getprotoname.c b/c/src/libnetworking/libc/getprotoname.c
deleted file mode 100644
index 46880eb005..0000000000
--- a/c/src/libnetworking/libc/getprotoname.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getprotoname.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-#include <string.h>
-
-extern int _proto_stayopen;
-
-struct protoent *
-getprotobyname(name)
- register const char *name;
-{
- register struct protoent *p;
- register char **cp;
-
- setprotoent(_proto_stayopen);
- while ( (p = getprotoent()) ) {
- if (strcmp(p->p_name, name) == 0)
- break;
- for (cp = p->p_aliases; *cp != 0; cp++)
- if (strcmp(*cp, name) == 0)
- goto found;
- }
-found:
- if (!_proto_stayopen)
- endprotoent();
- return (p);
-}
diff --git a/c/src/libnetworking/libc/getservbyname.c b/c/src/libnetworking/libc/getservbyname.c
deleted file mode 100644
index 19936907d3..0000000000
--- a/c/src/libnetworking/libc/getservbyname.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getservbyname.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-#include <string.h>
-
-extern int _serv_stayopen;
-
-struct servent *
-getservbyname(name, proto)
- const char *name, *proto;
-{
- register struct servent *p;
- register char **cp;
-
-#ifdef YP
- extern char *___getservbyname_yp;
- extern char *___getservbyproto_yp;
-
- ___getservbyname_yp = (char *)name;
- ___getservbyproto_yp = (char *)proto;
-#endif
-
- setservent(_serv_stayopen);
- while ( (p = getservent()) ) {
- if (strcmp(name, p->s_name) == 0)
- goto gotname;
- for (cp = p->s_aliases; *cp; cp++)
- if (strcmp(name, *cp) == 0)
- goto gotname;
- continue;
-gotname:
- if (proto == 0 || strcmp(p->s_proto, proto) == 0)
- break;
- }
- if (!_serv_stayopen)
- endservent();
-
-#ifdef YP
- ___getservbyname_yp = NULL;
- ___getservbyproto_yp = NULL;
-#endif
-
- return (p);
-}
diff --git a/c/src/libnetworking/libc/getservbyport.c b/c/src/libnetworking/libc/getservbyport.c
deleted file mode 100644
index c8433954e1..0000000000
--- a/c/src/libnetworking/libc/getservbyport.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getservbyport.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-#include <string.h>
-
-extern int _serv_stayopen;
-
-struct servent *
-getservbyport(port, proto)
- int port;
- const char *proto;
-{
- register struct servent *p;
-
-#ifdef YP
- extern int ___getservbyport_yp;
- extern char *___getservbyproto_yp;
-
- ___getservbyport_yp = port;
- ___getservbyproto_yp = (char *)proto;
-#endif
-
- setservent(_serv_stayopen);
- while ( (p = getservent()) ) {
- if (p->s_port != port)
- continue;
- if (proto == 0 || strcmp(p->s_proto, proto) == 0)
- break;
- }
- if (!_serv_stayopen)
- endservent();
-
-#ifdef YP
- ___getservbyport_yp = 0;
- ___getservbyproto_yp = NULL;
-#endif
-
- return (p);
-}
diff --git a/c/src/libnetworking/libc/getservent.3 b/c/src/libnetworking/libc/getservent.3
deleted file mode 100644
index 79c18a3beb..0000000000
--- a/c/src/libnetworking/libc/getservent.3
+++ /dev/null
@@ -1,156 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" From: @(#)getservent.3 8.3 (Berkeley) 1/12/94
-.\" $Id$
-.\"
-.Dd July 9, 1995
-.Dt GETSERVENT 3
-.Os BSD 4.2
-.Sh NAME
-.Nm getservent ,
-.Nm getservbyport ,
-.Nm getservbyname ,
-.Nm setservent ,
-.Nm endservent
-.Nd get service entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Ft struct servent *
-.Fn getservent
-.Ft struct servent *
-.Fn getservbyname "const char *name" "const char *proto"
-.Ft struct servent *
-.Fn getservbyport "int port" "const char *proto"
-.Ft void
-.Fn setservent "int stayopen"
-.Ft void
-.Fn endservent void
-.Sh DESCRIPTION
-The
-.Fn getservent ,
-.Fn getservbyname ,
-and
-.Fn getservbyport
-functions
-each return a pointer to an object with the
-following structure
-containing the broken-out
-fields of a line in the network services data base,
-.Pa /etc/services .
-.Bd -literal -offset indent
-struct servent {
- char *s_name; /* official name of service */
- char **s_aliases; /* alias list */
- int s_port; /* port service resides at */
- char *s_proto; /* protocol to use */
-};
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width s_aliases
-.It Fa s_name
-The official name of the service.
-.It Fa s_aliases
-A zero terminated list of alternate names for the service.
-.It Fa s_port
-The port number at which the service resides.
-Port numbers are returned in network byte order.
-.It Fa s_proto
-The name of the protocol to use when contacting the
-service.
-.El
-.Pp
-The
-.Fn getservent
-function
-reads the next line of the file, opening the file if necessary.
-.Pp
-The
-.Fn setservent
-function
-opens and rewinds the file. If the
-.Fa stayopen
-flag is non-zero,
-the net data base will not be closed after each call to
-.Fn getservbyname
-or
-.Fn getservbyport .
-.Pp
-The
-.Fn endservent
-function
-closes the file.
-.Pp
-The
-.Fn getservbyname
-and
-.Fn getservbyport
-functions
-sequentially search from the beginning
-of the file until a matching
-protocol name or
-port number is found,
-or until
-.Dv EOF
-is encountered.
-If a protocol name is also supplied (non-
-.Dv NULL ) ,
-searches must also match the protocol.
-.ne 1i
-.Sh FILES
-.Bl -tag -width /etc/services -compact
-.It Pa /etc/services
-.El
-.Sh DIAGNOSTICS
-Null pointer
-(0) returned on
-.Dv EOF
-or error.
-.Sh SEE ALSO
-.Xr getprotoent 3 ,
-.Xr services 5
-.Sh HISTORY
-The
-.Fn getservent ,
-.Fn getservbyport ,
-.Fn getservbyname ,
-.Fn setservent ,
-and
-.Fn endservent
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-These functions use static data storage;
-if the data is needed for future use, it should be
-copied before any subsequent calls overwrite it.
-Expecting port numbers to fit in a 32 bit
-quantity is probably naive.
diff --git a/c/src/libnetworking/libc/getservent.c b/c/src/libnetworking/libc/getservent.c
deleted file mode 100644
index 08a05c0975..0000000000
--- a/c/src/libnetworking/libc/getservent.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-static int serv_stepping_yp = 0;
-extern int _yp_check __P(( char ** ));
-#endif
-
-
-#define MAXALIASES 35
-
-static FILE *servf = NULL;
-static char line[BUFSIZ+1];
-static struct servent serv;
-static char *serv_aliases[MAXALIASES];
-int _serv_stayopen;
-
-#ifdef YP
-char *___getservbyname_yp = NULL;
-char *___getservbyproto_yp = NULL;
-int ___getservbyport_yp = 0;
-static char *yp_domain = NULL;
-
-static int
-_getservbyport_yp(line)
- char *line;
-{
- char *result;
- int resultlen;
- char buf[YPMAXRECORD + 2];
- int rv;
-
- snprintf(buf, sizeof(buf), "%d/%s", ntohs(___getservbyport_yp),
- ___getservbyproto_yp);
-
- ___getservbyport_yp = 0;
- ___getservbyproto_yp = NULL;
-
- if(!yp_domain) {
- if(yp_get_default_domain(&yp_domain))
- return (0);
- }
-
- /*
- * We have to be a little flexible here. Ideally you're supposed
- * to have both a services.byname and a services.byport map, but
- * some systems have only services.byname. FreeBSD cheats a little
- * by putting the services.byport information in the same map as
- * services.byname so that either case will work. We allow for both
- * possibilities here: if there is no services.byport map, we try
- * services.byname instead.
- */
- if ((rv = yp_match(yp_domain, "services.byport", buf, strlen(buf),
- &result, &resultlen))) {
- if (rv == YPERR_MAP) {
- if (yp_match(yp_domain, "services.byname", buf,
- strlen(buf), &result, &resultlen))
- return(0);
- } else
- return(0);
- }
-
- /* getservent() expects lines terminated with \n -- make it happy */
- snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
-
- free(result);
- return(1);
-}
-
-static int
-_getservbyname_yp(line)
- char *line;
-{
- char *result;
- int resultlen;
- char buf[YPMAXRECORD + 2];
-
- if(!yp_domain) {
- if(yp_get_default_domain(&yp_domain))
- return (0);
- }
-
- snprintf(buf, sizeof(buf), "%s/%s", ___getservbyname_yp,
- ___getservbyproto_yp);
-
- ___getservbyname_yp = 0;
- ___getservbyproto_yp = NULL;
-
- if (yp_match(yp_domain, "services.byname", buf, strlen(buf),
- &result, &resultlen)) {
- return(0);
- }
-
- /* getservent() expects lines terminated with \n -- make it happy */
- snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
-
- free(result);
- return(1);
-}
-
-static int
-_getservent_yp(line)
- char *line;
-{
- static char *key = NULL;
- static int keylen;
- char *lastkey, *result;
- int resultlen;
- int rv;
-
- if(!yp_domain) {
- if(yp_get_default_domain(&yp_domain))
- return (0);
- }
-
- if (!serv_stepping_yp) {
- if (key)
- free(key);
- if ((rv = yp_first(yp_domain, "services.byname", &key, &keylen,
- &result, &resultlen))) {
- serv_stepping_yp = 0;
- return(0);
- }
- serv_stepping_yp = 1;
- } else {
- lastkey = key;
- rv = yp_next(yp_domain, "services.byname", key, keylen, &key,
- &keylen, &result, &resultlen);
- free(lastkey);
- if (rv) {
- serv_stepping_yp = 0;
- return (0);
- }
- }
-
- /* getservent() expects lines terminated with \n -- make it happy */
- snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
-
- free(result);
-
- return(1);
-}
-#endif
-
-void
-setservent(f)
- int f;
-{
- if (servf == NULL)
- servf = fopen(_PATH_SERVICES, "r" );
- else
- rewind(servf);
- _serv_stayopen |= f;
-}
-
-void
-endservent()
-{
- if (servf) {
- fclose(servf);
- servf = NULL;
- }
- _serv_stayopen = 0;
-}
-
-struct servent *
-getservent()
-{
- char *p;
- register char *cp, **q;
-
-#ifdef YP
- if (serv_stepping_yp && _getservent_yp(line)) {
- p = (char *)&line;
- goto unpack;
- }
-tryagain:
-#endif
- if (servf == NULL && (servf = fopen(_PATH_SERVICES, "r" )) == NULL)
- return (NULL);
-again:
- if ((p = fgets(line, BUFSIZ, servf)) == NULL)
- return (NULL);
-#ifdef YP
- if (*p == '+' && _yp_check(NULL)) {
- if (___getservbyname_yp != NULL) {
- if (!_getservbyname_yp(line))
- goto tryagain;
- }
- else if (___getservbyport_yp != 0) {
- if (!_getservbyport_yp(line))
- goto tryagain;
- }
- else if (!_getservent_yp(line))
- goto tryagain;
- }
-unpack:
-#endif
- if (*p == '#')
- goto again;
- cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
- serv.s_name = p;
- p = strpbrk(p, " \t");
- if (p == NULL)
- goto again;
- *p++ = '\0';
- while (*p == ' ' || *p == '\t')
- p++;
- cp = strpbrk(p, ",/");
- if (cp == NULL)
- goto again;
- *cp++ = '\0';
- serv.s_port = htons((u_short)atoi(p));
- serv.s_proto = cp;
- q = serv.s_aliases = serv_aliases;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &serv_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&serv);
-}
diff --git a/c/src/libnetworking/libc/herror.c b/c/src/libnetworking/libc/herror.c
deleted file mode 100644
index ba1dae934d..0000000000
--- a/c/src/libnetworking/libc/herror.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 1987, 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.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <netdb.h>
-#include <string.h>
-#include <unistd.h>
-
-const char *h_errlist[] = {
- "Resolver Error 0 (no error)",
- "Unknown host", /* 1 HOST_NOT_FOUND */
- "Host name lookup failure", /* 2 TRY_AGAIN */
- "Unknown server error", /* 3 NO_RECOVERY */
- "No address associated with name", /* 4 NO_ADDRESS */
-};
-int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] };
-
-int h_errno;
-
-/*
- * herror --
- * print the error indicated by the h_errno value.
- */
-void
-herror(s)
- const char *s;
-{
-#if 0
- struct iovec iov[4];
- register struct iovec *v = iov;
-
- if (s && *s) {
- v->iov_base = (char *)s;
- v->iov_len = strlen(s);
- v++;
- v->iov_base = ": ";
- v->iov_len = 2;
- v++;
- }
- v->iov_base = (char *)hstrerror(h_errno);
- v->iov_len = strlen(v->iov_base);
- v++;
- v->iov_base = "\n";
- v->iov_len = 1;
- writev(STDERR_FILENO, iov, (v - iov) + 1);
-#else
- /*
- * RTEMS: no writev yet
- */
- if (s && *s) {
- write (2, s, strlen (s));
- write (2, ": ", 2);
- }
- s = (char *)hstrerror(h_errno);
- write (2, s, strlen (s));
- write (2, "\n", 1);
-#endif
-}
-
-const char *
-hstrerror(err)
- int err;
-{
- if (err < 0)
- return ("Resolver internal error");
- else if (err < h_nerr)
- return (h_errlist[err]);
- return ("Unknown resolver error");
-}
diff --git a/c/src/libnetworking/libc/inet.3 b/c/src/libnetworking/libc/inet.3
deleted file mode 100644
index 1052f538f2..0000000000
--- a/c/src/libnetworking/libc/inet.3
+++ /dev/null
@@ -1,210 +0,0 @@
-.\" Copyright (c) 1983, 1990, 1991, 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.
-.\"
-.\" From: @(#)inet.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 17, 1996
-.Dt INET 3
-.Os BSD 4.2
-.Sh NAME
-.Nm inet_aton ,
-.Nm inet_addr ,
-.Nm inet_network ,
-.Nm inet_ntoa ,
-.Nm inet_makeaddr ,
-.Nm inet_lnaof ,
-.Nm inet_netof
-.Nd Internet address manipulation routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/socket.h>
-.Fd #include <netinet/in.h>
-.Fd #include <arpa/inet.h>
-.Ft int
-.Fn inet_aton "const char *cp" "struct in_addr *pin"
-.Ft unsigned long
-.Fn inet_addr "const char *cp"
-.Ft unsigned long
-.Fn inet_network "const char *cp"
-.Ft char *
-.Fn inet_ntoa "struct in_addr in"
-.Ft struct in_addr
-.Fn inet_makeaddr "unsigned long net" "unsigned long lna"
-.Ft unsigned long
-.Fn inet_lnaof "struct in_addr in"
-.Ft unsigned long
-.Fn inet_netof "struct in_addr in"
-.Sh DESCRIPTION
-The routines
-.Fn inet_aton ,
-.Fn inet_addr
-and
-.Fn inet_network
-interpret character strings representing
-numbers expressed in the Internet standard
-.Ql \&.
-notation.
-The
-.Fn inet_aton
-routine interprets the specified character string as an Internet address,
-placing the address into the structure provided.
-It returns 1 if the string was successfully interpreted,
-or 0 if the string is invalid.
-The
-.Fn inet_addr
-and
-.Fn inet_network
-functions return numbers suitable for use
-as Internet addresses and Internet network
-numbers, respectively.
-The routine
-.Fn inet_ntoa
-takes an Internet address and returns an
-.Tn ASCII
-string representing the address in
-.Ql \&.
-notation. The routine
-.Fn inet_makeaddr
-takes an Internet network number and a local
-network address and constructs an Internet address
-from it. The routines
-.Fn inet_netof
-and
-.Fn inet_lnaof
-break apart Internet host addresses, returning
-the network number and local network address part,
-respectively.
-.Pp
-All Internet addresses are returned in network
-order (bytes ordered from left to right).
-All network numbers and local address parts are
-returned as machine format integer values.
-.Sh INTERNET ADDRESSES
-Values specified using the
-.Ql \&.
-notation take one
-of the following forms:
-.Bd -literal -offset indent
-a.b.c.d
-a.b.c
-a.b
-a
-.Ed
-.Pp
-When four parts are specified, each is interpreted
-as a byte of data and assigned, from left to right,
-to the four bytes of an Internet address. Note
-that when an Internet address is viewed as a 32-bit
-integer quantity on the
-.Tn VAX
-the bytes referred to
-above appear as
-.Dq Li d.c.b.a .
-That is,
-.Tn VAX
-bytes are
-ordered from right to left.
-.Pp
-When a three part address is specified, the last
-part is interpreted as a 16-bit quantity and placed
-in the right-most two bytes of the network address.
-This makes the three part address format convenient
-for specifying Class B network addresses as
-.Dq Li 128.net.host .
-.Pp
-When a two part address is supplied, the last part
-is interpreted as a 24-bit quantity and placed in
-the right most three bytes of the network address.
-This makes the two part address format convenient
-for specifying Class A network addresses as
-.Dq Li net.host .
-.Pp
-When only one part is given, the value is stored
-directly in the network address without any byte
-rearrangement.
-.Pp
-All numbers supplied as
-.Dq parts
-in a
-.Ql \&.
-notation
-may be decimal, octal, or hexadecimal, as specified
-in the C language (i.e., a leading 0x or 0X implies
-hexadecimal; otherwise, a leading 0 implies octal;
-otherwise, the number is interpreted as decimal).
-.Pp
-The
-.Fn inet_aton
-and
-.Fn inet_ntoa
-functions are semi-deprecated in favor of the
-.Xr addr2ascii 3
-family. However, since those functions are not yet widely implemented,
-portable programs cannot rely on their presence and will continue
-to use the
-.Xr inet 3
-functions for some time.
-.Sh DIAGNOSTICS
-The constant
-.Dv INADDR_NONE
-is returned by
-.Fn inet_addr
-and
-.Fn inet_network
-for malformed requests.
-.Sh SEE ALSO
-.Xr addr2ascii 3 ,
-.Xr gethostbyname 3 ,
-.Xr getnetent 3 ,
-.Xr hosts 5 ,
-.Xr networks 5
-.Sh HISTORY
-These
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-The value
-.Dv INADDR_NONE
-(0xffffffff) is a valid broadcast address, but
-.Fn inet_addr
-cannot return that value without indicating failure.
-The newer
-.Fn inet_aton
-function does not share this problem.
-The problem of host byte ordering versus network byte ordering is
-confusing.
-The string returned by
-.Fn inet_ntoa
-resides in a static memory area.
-.Pp
-Inet_addr should return a
-.Fa struct in_addr .
diff --git a/c/src/libnetworking/libc/inet_addr.c b/c/src/libnetworking/libc/inet_addr.c
deleted file mode 100644
index 225ccc1269..0000000000
--- a/c/src/libnetworking/libc/inet_addr.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * ++Copyright++ 1983, 1990, 1993
- * -
- * Copyright (c) 1983, 1990, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <ctype.h>
-
-/*
- * Ascii internet address interpretation routine.
- * The value returned is in network order.
- */
-u_long
-inet_addr(cp)
- register const char *cp;
-{
- struct in_addr val;
-
- if (inet_aton(cp, &val))
- return (val.s_addr);
- return (INADDR_NONE);
-}
-
-/*
- * Check whether "cp" is a valid ascii representation
- * of an Internet address and convert to a binary address.
- * Returns 1 if the address is valid, 0 if not.
- * This replaces inet_addr, the return value from which
- * cannot distinguish between failure and a local broadcast address.
- */
-int
-inet_aton(cp, addr)
- register const char *cp;
- struct in_addr *addr;
-{
- register u_long val;
- register int base, n;
- register char c;
- u_int parts[4];
- register u_int *pp = parts;
-
- c = *cp;
- for (;;) {
- /*
- * Collect number up to ``.''.
- * Values are specified as for C:
- * 0x=hex, 0=octal, isdigit=decimal.
- */
- if (!isdigit((int)c))
- return (0);
- val = 0; base = 10;
- if (c == '0') {
- c = *++cp;
- if (c == 'x' || c == 'X')
- base = 16, c = *++cp;
- else
- base = 8;
- }
- for (;;) {
- if (isascii((int)c) && isdigit((int)c)) {
- val = (val * base) + (c - '0');
- c = *++cp;
- } else if (base == 16 && isascii((int)c) && isxdigit((int)c)) {
- val = (val << 4) |
- (c + 10 - (islower((int)c) ? 'a' : 'A'));
- c = *++cp;
- } else
- break;
- }
- if (c == '.') {
- /*
- * Internet format:
- * a.b.c.d
- * a.b.c (with c treated as 16 bits)
- * a.b (with b treated as 24 bits)
- */
- if (pp >= parts + 3)
- return (0);
- *pp++ = val;
- c = *++cp;
- } else
- break;
- }
- /*
- * Check for trailing characters.
- */
- if (c != '\0' && (!isascii((int)c) || !isspace((int)c)))
- return (0);
- /*
- * Concoct the address according to
- * the number of parts specified.
- */
- n = pp - parts + 1;
- switch (n) {
-
- case 0:
- return (0); /* initial nondigit */
-
- case 1: /* a -- 32 bits */
- break;
-
- case 2: /* a.b -- 8.24 bits */
- if (val > 0xffffff)
- return (0);
- val |= parts[0] << 24;
- break;
-
- case 3: /* a.b.c -- 8.8.16 bits */
- if (val > 0xffff)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16);
- break;
-
- case 4: /* a.b.c.d -- 8.8.8.8 bits */
- if (val > 0xff)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
- break;
- }
- if (addr)
- addr->s_addr = htonl(val);
- return (1);
-}
diff --git a/c/src/libnetworking/libc/inet_lnaof.c b/c/src/libnetworking/libc/inet_lnaof.c
deleted file mode 100644
index 6ec6a9aef1..0000000000
--- a/c/src/libnetworking/libc/inet_lnaof.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_lnaof.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Return the local network address portion of an
- * internet address; handles class a/b/c network
- * number formats.
- */
-u_long
-inet_lnaof(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return ((i)&IN_CLASSA_HOST);
- else if (IN_CLASSB(i))
- return ((i)&IN_CLASSB_HOST);
- else
- return ((i)&IN_CLASSC_HOST);
-}
diff --git a/c/src/libnetworking/libc/inet_makeaddr.c b/c/src/libnetworking/libc/inet_makeaddr.c
deleted file mode 100644
index ce84170ed9..0000000000
--- a/c/src/libnetworking/libc/inet_makeaddr.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_makeaddr.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Formulate an Internet address from network + host. Used in
- * building addresses stored in the ifnet structure.
- */
-struct in_addr
-inet_makeaddr(net, host)
- u_long net, host;
-{
- u_long addr;
-
- if (net < 128)
- addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
- else if (net < 65536)
- addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
- else if (net < 16777216L)
- addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
- else
- addr = net | host;
- addr = htonl(addr);
- return (*(struct in_addr *)&addr);
-}
diff --git a/c/src/libnetworking/libc/inet_net_ntop.c b/c/src/libnetworking/libc/inet_net_ntop.c
deleted file mode 100644
index 4c7893d417..0000000000
--- a/c/src/libnetworking/libc/inet_net_ntop.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char orig_rcsid[] = "From Id: inet_net_ntop.c,v 8.2 1996/08/08 06:54:44 vixie Exp";
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-static char * inet_net_ntop_ipv4 __P((const u_char *src, int bits,
- char *dst, size_t size));
-
-/*
- * char *
- * inet_net_ntop(af, src, bits, dst, size)
- * convert network number from network to presentation format.
- * generates CIDR style result always.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * author:
- * Paul Vixie (ISC), July 1996
- */
-char *
-inet_net_ntop(af, src, bits, dst, size)
- int af;
- const void *src;
- int bits;
- char *dst;
- size_t size;
-{
- switch (af) {
- case AF_INET:
- return (inet_net_ntop_ipv4(src, bits, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (NULL);
- }
-}
-
-/*
- * static char *
- * inet_net_ntop_ipv4(src, bits, dst, size)
- * convert IPv4 network number from network to presentation format.
- * generates CIDR style result always.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * note:
- * network byte order assumed. this means 192.5.5.240/28 has
- * 0x11110000 in its fourth octet.
- * author:
- * Paul Vixie (ISC), July 1996
- */
-static char *
-inet_net_ntop_ipv4(src, bits, dst, size)
- const u_char *src;
- int bits;
- char *dst;
- size_t size;
-{
- char *odst = dst;
- char *t;
- u_int m;
- int b;
-
- if (bits < 0 || bits > 32) {
- errno = EINVAL;
- return (NULL);
- }
- if (bits == 0) {
- if (size < sizeof "0")
- goto emsgsize;
- *dst++ = '0';
- *dst = '\0';
- }
-
- /* Format whole octets. */
- for (b = bits / 8; b > 0; b--) {
- if (size < sizeof "255.")
- goto emsgsize;
- t = dst;
- dst += SPRINTF((dst, "%u", *src++));
- if (b > 1) {
- *dst++ = '.';
- *dst = '\0';
- }
- size -= (size_t)(dst - t);
- }
-
- /* Format partial octet. */
- b = bits % 8;
- if (b > 0) {
- if (size < sizeof ".255")
- goto emsgsize;
- t = dst;
- if (dst != odst)
- *dst++ = '.';
- m = ((1 << b) - 1) << (8 - b);
- dst += SPRINTF((dst, "%u", *src & m));
- size -= (size_t)(dst - t);
- }
-
- /* Format CIDR /width. */
- if (size < sizeof "/32")
- goto emsgsize;
- dst += SPRINTF((dst, "/%u", bits));
- return (odst);
-
- emsgsize:
- errno = EMSGSIZE;
- return (NULL);
-}
diff --git a/c/src/libnetworking/libc/inet_net_pton.c b/c/src/libnetworking/libc/inet_net_pton.c
deleted file mode 100644
index 8915c2a5be..0000000000
--- a/c/src/libnetworking/libc/inet_net_pton.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char orig_rcsid[] = "From Id: inet_net_pton.c,v 1.8 1996/11/21 10:28:12 vixie Exp $";
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-static int inet_net_pton_ipv4 __P((const char *src, u_char *dst,
- size_t size));
-
-/*
- * static int
- * inet_net_pton(af, src, dst, size)
- * convert network number from presentation to network format.
- * accepts hex octets, hex strings, decimal octets, and /CIDR.
- * "size" is in bytes and describes "dst".
- * return:
- * number of bits, either imputed classfully or specified with /CIDR,
- * or -1 if some failure occurred (check errno). ENOENT means it was
- * not a valid network specification.
- * author:
- * Paul Vixie (ISC), June 1996
- */
-int
-inet_net_pton(af, src, dst, size)
- int af;
- const char *src;
- void *dst;
- size_t size;
-{
- switch (af) {
- case AF_INET:
- return (inet_net_pton_ipv4(src, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (-1);
- }
-}
-
-/*
- * static int
- * inet_net_pton_ipv4(src, dst, size)
- * convert IPv4 network number from presentation to network format.
- * accepts hex octets, hex strings, decimal octets, and /CIDR.
- * "size" is in bytes and describes "dst".
- * return:
- * number of bits, either imputed classfully or specified with /CIDR,
- * or -1 if some failure occurred (check errno). ENOENT means it was
- * not an IPv4 network specification.
- * note:
- * network byte order assumed. this means 192.5.5.240/28 has
- * 0x11110000 in its fourth octet.
- * author:
- * Paul Vixie (ISC), June 1996
- */
-static int
-inet_net_pton_ipv4(src, dst, size)
- const char *src;
- u_char *dst;
- size_t size;
-{
- static const char
- xdigits[] = "0123456789abcdef",
- digits[] = "0123456789";
- int n, ch, tmp, dirty, bits;
- const u_char *odst = dst;
-
- ch = *src++;
- if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
- && isascii(src[1]) && isxdigit(src[1])) {
- /* Hexadecimal: Eat nybble string. */
- if (size <= 0)
- goto emsgsize;
- *dst = 0, dirty = 0;
- src++; /* skip x or X. */
- while ((ch = *src++) != '\0' &&
- isascii(ch) && isxdigit(ch)) {
- if (isupper(ch))
- ch = tolower(ch);
- n = strchr(xdigits, ch) - xdigits;
- assert(n >= 0 && n <= 15);
- *dst |= n;
- if (!dirty++)
- *dst <<= 4;
- else if (size-- > 0)
- *++dst = 0, dirty = 0;
- else
- goto emsgsize;
- }
- if (dirty)
- size--;
- } else if (isascii(ch) && isdigit(ch)) {
- /* Decimal: eat dotted digit string. */
- for (;;) {
- tmp = 0;
- do {
- n = strchr(digits, ch) - digits;
- assert(n >= 0 && n <= 9);
- tmp *= 10;
- tmp += n;
- if (tmp > 255)
- goto enoent;
- } while ((ch = *src++) != '\0' &&
- isascii(ch) && isdigit(ch));
- if (size-- <= 0)
- goto emsgsize;
- *dst++ = (u_char) tmp;
- if (ch == '\0' || ch == '/')
- break;
- if (ch != '.')
- goto enoent;
- ch = *src++;
- if (!isascii(ch) || !isdigit(ch))
- goto enoent;
- }
- } else
- goto enoent;
-
- bits = -1;
- if (ch == '/' && isascii(src[0]) && isdigit(src[0]) && dst > odst) {
- /* CIDR width specifier. Nothing can follow it. */
- ch = *src++; /* Skip over the /. */
- bits = 0;
- do {
- n = strchr(digits, ch) - digits;
- assert(n >= 0 && n <= 9);
- bits *= 10;
- bits += n;
- } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
- if (ch != '\0')
- goto enoent;
- if (bits > 32)
- goto emsgsize;
- }
-
- /* Firey death and destruction unless we prefetched EOS. */
- if (ch != '\0')
- goto enoent;
-
- /* If nothing was written to the destination, we found no address. */
- if (dst == odst)
- goto enoent;
- /* If no CIDR spec was given, infer width from net class. */
- if (bits == -1) {
- if (*odst >= 240) /* Class E */
- bits = 32;
- else if (*odst >= 224) /* Class D */
- bits = 4;
- else if (*odst >= 192) /* Class C */
- bits = 24;
- else if (*odst >= 128) /* Class B */
- bits = 16;
- else /* Class A */
- bits = 8;
- /* If imputed mask is narrower than specified octets, widen. */
- if (bits >= 8 && bits < ((dst - odst) * 8))
- bits = (dst - odst) * 8;
- }
- /* Extend network to cover the actual mask. */
- while (bits > ((dst - odst) * 8)) {
- if (size-- <= 0)
- goto emsgsize;
- *dst++ = '\0';
- }
- return (bits);
-
- enoent:
- errno = ENOENT;
- return (-1);
-
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
diff --git a/c/src/libnetworking/libc/inet_neta.c b/c/src/libnetworking/libc/inet_neta.c
deleted file mode 100644
index 59b156f7f6..0000000000
--- a/c/src/libnetworking/libc/inet_neta.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char orig_rcsid[] = "From Id: inet_neta.c,v 8.2 1996/08/08 06:54:44 vixie Exp";
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-/*
- * char *
- * inet_neta(src, dst, size)
- * format a u_long network number into presentation format.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * note:
- * format of ``src'' is as for inet_network().
- * author:
- * Paul Vixie (ISC), July 1996
- */
-char *
-inet_neta(src, dst, size)
- u_long src;
- char *dst;
- size_t size;
-{
- char *odst = dst;
- char *tp;
-
- while (src & 0xffffffff) {
- u_char b = (src & 0xff000000) >> 24;
-
- src <<= 8;
- if (b) {
- if (size < sizeof "255.")
- goto emsgsize;
- tp = dst;
- dst += SPRINTF((dst, "%u", b));
- if (src != 0L) {
- *dst++ = '.';
- *dst = '\0';
- }
- size -= (size_t)(dst - tp);
- }
- }
- if (dst == odst) {
- if (size < sizeof "0.0.0.0")
- goto emsgsize;
- strcpy(dst, "0.0.0.0");
- }
- return (odst);
-
- emsgsize:
- errno = EMSGSIZE;
- return (NULL);
-}
diff --git a/c/src/libnetworking/libc/inet_netof.c b/c/src/libnetworking/libc/inet_netof.c
deleted file mode 100644
index 179731efc3..0000000000
--- a/c/src/libnetworking/libc/inet_netof.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_netof.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Return the network number from an internet
- * address; handles class a/b/c network #'s.
- */
-u_long
-inet_netof(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
- else if (IN_CLASSB(i))
- return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT);
- else
- return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
-}
diff --git a/c/src/libnetworking/libc/inet_network.c b/c/src/libnetworking/libc/inet_network.c
deleted file mode 100644
index ac0073bf0a..0000000000
--- a/c/src/libnetworking/libc/inet_network.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_network.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <ctype.h>
-
-/*
- * Internet network address interpretation routine.
- * The library routines call this routine to interpret
- * network numbers.
- */
-u_long
-inet_network(cp)
- register const char *cp;
-{
- register u_long val, base, n, i;
- register char c;
- u_long parts[4], *pp = parts;
-
-again:
- val = 0; base = 10;
- if (*cp == '0')
- base = 8, cp++;
- if (*cp == 'x' || *cp == 'X')
- base = 16, cp++;
- while ((c = *cp) != 0) {
- if (isdigit(c)) {
- val = (val * base) + (c - '0');
- cp++;
- continue;
- }
- if (base == 16 && isxdigit(c)) {
- val = (val << 4) + (c + 10 - (islower(c) ? 'a' : 'A'));
- cp++;
- continue;
- }
- break;
- }
- if (*cp == '.') {
- if (pp >= parts + 3)
- return (INADDR_NONE);
- *pp++ = val, cp++;
- goto again;
- }
- if (*cp && !isspace(*cp))
- return (INADDR_NONE);
- *pp++ = val;
- n = pp - parts;
- for (val = 0, i = 0; i < n; i++) {
- val <<= 8;
- val |= parts[i] & 0xff;
- }
- return (val);
-}
diff --git a/c/src/libnetworking/libc/inet_ntoa.c b/c/src/libnetworking/libc/inet_ntoa.c
deleted file mode 100644
index 44b686f0b3..0000000000
--- a/c/src/libnetworking/libc/inet_ntoa.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_ntoa.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <stdio.h>
-
-/*
- * Convert network-format internet address
- * to base 256 d.d.d.d representation.
- */
-char *
-inet_ntoa(in)
- struct in_addr in;
-{
- static char ret[18];
-
- strcpy(ret, "[inet_ntoa error]");
- (void) inet_ntop(AF_INET, &in, ret, sizeof ret);
- return (ret);
-}
diff --git a/c/src/libnetworking/libc/inet_ntop.c b/c/src/libnetworking/libc/inet_ntop.c
deleted file mode 100644
index 76a538755a..0000000000
--- a/c/src/libnetworking/libc/inet_ntop.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/* Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-/*
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static const char *inet_ntop4 __P((const u_char *src, char *dst, size_t size));
-static const char *inet_ntop6 __P((const u_char *src, char *dst, size_t size));
-
-/* char *
- * inet_ntop(af, src, dst, size)
- * convert a network format address to presentation format.
- * return:
- * pointer to presentation format address (`dst'), or NULL (see errno).
- * author:
- * Paul Vixie, 1996.
- */
-const char *
-inet_ntop(af, src, dst, size)
- int af;
- const void *src;
- char *dst;
- size_t size;
-{
- switch (af) {
- case AF_INET:
- return (inet_ntop4(src, dst, size));
- case AF_INET6:
- return (inet_ntop6(src, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (NULL);
- }
- /* NOTREACHED */
-}
-
-/* const char *
- * inet_ntop4(src, dst, size)
- * format an IPv4 address, more or less like inet_ntoa()
- * return:
- * `dst' (as a const)
- * notes:
- * (1) uses no statics
- * (2) takes a u_char* not an in_addr as input
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop4(src, dst, size)
- const u_char *src;
- char *dst;
- size_t size;
-{
- static const char fmt[] = "%u.%u.%u.%u";
- char tmp[sizeof "255.255.255.255"];
-
- if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
- errno = ENOSPC;
- return (NULL);
- }
- strcpy(dst, tmp);
- return (dst);
-}
-
-/* const char *
- * inet_ntop6(src, dst, size)
- * convert IPv6 binary address into presentation (printable) format
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop6(src, dst, size)
- const u_char *src;
- char *dst;
- size_t size;
-{
- /*
- * Note that int32_t and int16_t need only be "at least" large enough
- * to contain a value of the specified size. On some systems, like
- * Crays, there is no such thing as an integer variable with 16 bits.
- * Keep this in mind if you think this function should have been coded
- * to use pointer overlays. All the world's not a VAX.
- */
- char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
- struct { int base, len; } best, cur;
- u_int words[NS_IN6ADDRSZ / NS_INT16SZ];
- int i;
-
- /*
- * Preprocess:
- * Copy the input (bytewise) array into a wordwise array.
- * Find the longest run of 0x00's in src[] for :: shorthanding.
- */
- memset(words, '\0', sizeof words);
- for (i = 0; i < NS_IN6ADDRSZ; i++)
- words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
- best.base = -1;
- cur.base = -1;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
- if (words[i] == 0) {
- if (cur.base == -1)
- cur.base = i, cur.len = 1;
- else
- cur.len++;
- } else {
- if (cur.base != -1) {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- cur.base = -1;
- }
- }
- }
- if (cur.base != -1) {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- }
- if (best.base != -1 && best.len < 2)
- best.base = -1;
-
- /*
- * Format the result.
- */
- tp = tmp;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
- /* Are we inside the best run of 0x00's? */
- if (best.base != -1 && i >= best.base &&
- i < (best.base + best.len)) {
- if (i == best.base)
- *tp++ = ':';
- continue;
- }
- /* Are we following an initial run of 0x00s or any real hex? */
- if (i != 0)
- *tp++ = ':';
- /* Is this address an encapsulated IPv4? */
- if (i == 6 && best.base == 0 &&
- (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
- if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
- return (NULL);
- tp += strlen(tp);
- break;
- }
- tp += SPRINTF((tp, "%x", words[i]));
- }
- /* Was it a trailing run of 0x00's? */
- if (best.base != -1 && (best.base + best.len) ==
- (NS_IN6ADDRSZ / NS_INT16SZ))
- *tp++ = ':';
- *tp++ = '\0';
-
- /*
- * Check for overflow, copy, and we're done.
- */
- if ((size_t)(tp - tmp) > size) {
- errno = ENOSPC;
- return (NULL);
- }
- strcpy(dst, tmp);
- return (dst);
-}
diff --git a/c/src/libnetworking/libc/inet_pton.c b/c/src/libnetworking/libc/inet_pton.c
deleted file mode 100644
index 8d21111cfa..0000000000
--- a/c/src/libnetworking/libc/inet_pton.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/* Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <string.h>
-#include <errno.h>
-
-/*
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static int inet_pton4 __P((const char *src, u_char *dst));
-static int inet_pton6 __P((const char *src, u_char *dst));
-
-/* int
- * inet_pton(af, src, dst)
- * convert from presentation format (which usually means ASCII printable)
- * to network format (which is usually some kind of binary format).
- * return:
- * 1 if the address was valid for the specified address family
- * 0 if the address wasn't valid (`dst' is untouched in this case)
- * -1 if some other error occurred (`dst' is untouched in this case, too)
- * author:
- * Paul Vixie, 1996.
- */
-int
-inet_pton(af, src, dst)
- int af;
- const char *src;
- void *dst;
-{
- switch (af) {
- case AF_INET:
- return (inet_pton4(src, dst));
- case AF_INET6:
- return (inet_pton6(src, dst));
- default:
- errno = EAFNOSUPPORT;
- return (-1);
- }
- /* NOTREACHED */
-}
-
-/* int
- * inet_pton4(src, dst)
- * like inet_aton() but without all the hexadecimal and shorthand.
- * return:
- * 1 if `src' is a valid dotted quad, else 0.
- * notice:
- * does not touch `dst' unless it's returning 1.
- * author:
- * Paul Vixie, 1996.
- */
-static int
-inet_pton4(src, dst)
- const char *src;
- u_char *dst;
-{
- static const char digits[] = "0123456789";
- int saw_digit, octets, ch;
- u_char tmp[NS_INADDRSZ], *tp;
-
- saw_digit = 0;
- octets = 0;
- *(tp = tmp) = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr(digits, ch)) != NULL) {
- u_int new = *tp * 10 + (pch - digits);
-
- if (new > 255)
- return (0);
- *tp = new;
- if (! saw_digit) {
- if (++octets > 4)
- return (0);
- saw_digit = 1;
- }
- } else if (ch == '.' && saw_digit) {
- if (octets == 4)
- return (0);
- *++tp = 0;
- saw_digit = 0;
- } else
- return (0);
- }
- if (octets < 4)
- return (0);
-
- memcpy(dst, tmp, NS_INADDRSZ);
- return (1);
-}
-
-/* int
- * inet_pton6(src, dst)
- * convert presentation level address to network order binary form.
- * return:
- * 1 if `src' is a valid [RFC1884 2.2] address, else 0.
- * notice:
- * (1) does not touch `dst' unless it's returning 1.
- * (2) :: in a full address is silently ignored.
- * credit:
- * inspired by Mark Andrews.
- * author:
- * Paul Vixie, 1996.
- */
-static int
-inet_pton6(src, dst)
- const char *src;
- u_char *dst;
-{
- static const char xdigits_l[] = "0123456789abcdef",
- xdigits_u[] = "0123456789ABCDEF";
- u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
- const char *xdigits, *curtok;
- int ch, saw_xdigit;
- u_int val;
-
- memset((tp = tmp), '\0', NS_IN6ADDRSZ);
- endp = tp + NS_IN6ADDRSZ;
- colonp = NULL;
- /* Leading :: requires some special handling. */
- if (*src == ':')
- if (*++src != ':')
- return (0);
- curtok = src;
- saw_xdigit = 0;
- val = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
- pch = strchr((xdigits = xdigits_u), ch);
- if (pch != NULL) {
- val <<= 4;
- val |= (pch - xdigits);
- if (val > 0xffff)
- return (0);
- saw_xdigit = 1;
- continue;
- }
- if (ch == ':') {
- curtok = src;
- if (!saw_xdigit) {
- if (colonp)
- return (0);
- colonp = tp;
- continue;
- }
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- saw_xdigit = 0;
- val = 0;
- continue;
- }
- if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
- inet_pton4(curtok, tp) > 0) {
- tp += NS_INADDRSZ;
- saw_xdigit = 0;
- break; /* '\0' was seen by inet_pton4(). */
- }
- return (0);
- }
- if (saw_xdigit) {
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- }
- if (colonp != NULL) {
- /*
- * Since some memmove()'s erroneously fail to handle
- * overlapping regions, we'll do the shift by hand.
- */
- const int n = tp - colonp;
- int i;
-
- for (i = 1; i <= n; i++) {
- endp[- i] = colonp[n - i];
- colonp[n - i] = 0;
- }
- tp = endp;
- }
- if (tp != endp)
- return (0);
- memcpy(dst, tmp, NS_IN6ADDRSZ);
- return (1);
-}
diff --git a/c/src/libnetworking/libc/iso_addr.3 b/c/src/libnetworking/libc/iso_addr.3
deleted file mode 100644
index 0c9973bef4..0000000000
--- a/c/src/libnetworking/libc/iso_addr.3
+++ /dev/null
@@ -1,111 +0,0 @@
-.\" Copyright (c) 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.
-.\"
-.\" @(#)iso_addr.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt ISO_ADDR 3
-.Os
-.Sh NAME
-.Nm iso_addr ,
-.Nm iso_ntoa
-.Nd "elementary network address conversion routines for Open System Interconnection
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netiso/iso.h>
-.Ft struct iso_addr *
-.Fn iso_addr "char *cp"
-.Ft char *
-.Fn iso_ntoa "struct iso_addr *isoa"
-.Sh DESCRIPTION
-The routine
-.Fn iso_addr
-interprets character strings representing
-.Tn OSI
-addresses, returning binary information suitable
-for use in system calls.
-The routine
-.Fn iso_ntoa
-takes
-.Tn OSI
-addresses and returns
-.Tn ASCII
-strings representing NSAPs (network service
-access points) in a
-notation inverse to that accepted by
-.Fn iso_addr .
-.Pp
-Unfortunately, no universal standard exists for representing
-.Tn OSI
-network addresses.
-.Pp
-The format employed by
-.Fn iso_addr
-is a sequence of hexadecimal
-.Dq digits
-(optionally separated by periods),
-of the form:
-.Bd -filled -offset indent
-<hex digits>.<hex digits>.<hex digits>
-.Ed
-.Pp
-Each pair of hexadecimal digits represents a byte
-with the leading digit indicating the higher-ordered bits.
-A period following an even number of bytes has no
-effect (but may be used to increase legibility).
-A period following an odd number of bytes has the
-effect of causing the byte of address being translated
-to have its higher order bits filled with zeros.
-.Sh RETURN VALUES
-.Fn iso_ntoa
-always returns a null terminated string.
-.Fn iso_addr
-always returns a pointer to a struct iso_addr.
-(See
-.Sx BUGS . )
-.Sh SEE ALSO
-.Xr iso 4
-.Sh HISTORY
-The
-.Fn iso_addr
-and
-.Fn iso_ntoa
-functions appeared in
-.Bx 4.3 Reno .
-.Sh BUGS
-The returned values
-reside in a static memory area.
-.Pp
-The function
-.Fn iso_addr
-should diagnose improperly formed input, and there should be an unambiguous
-way to recognize this.
diff --git a/c/src/libnetworking/libc/iso_addr.c b/c/src/libnetworking/libc/iso_addr.c
deleted file mode 100644
index eb14e8a72b..0000000000
--- a/c/src/libnetworking/libc/iso_addr.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 1989, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)iso_addr.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <netiso/iso.h>
-#include <string.h>
-
-/* States*/
-#define VIRGIN 0
-#define GOTONE 1
-#define GOTTWO 2
-/* Inputs */
-#define DIGIT (4*0)
-#define END (4*1)
-#define DELIM (4*2)
-
-struct iso_addr *
-iso_addr(addr)
- register const char *addr;
-{
- static struct iso_addr out_addr;
- register char *cp = out_addr.isoa_genaddr;
- char *cplim = cp + sizeof(out_addr.isoa_genaddr);
- register int byte = 0, state = VIRGIN, new;
-
- bzero((char *)&out_addr, sizeof(out_addr));
- do {
- if ((*addr >= '0') && (*addr <= '9')) {
- new = *addr - '0';
- } else if ((*addr >= 'a') && (*addr <= 'f')) {
- new = *addr - 'a' + 10;
- } else if ((*addr >= 'A') && (*addr <= 'F')) {
- new = *addr - 'A' + 10;
- } else if (*addr == 0)
- state |= END;
- else
- state |= DELIM;
- addr++;
- switch (state /* | INPUT */) {
- case GOTTWO | DIGIT:
- *cp++ = byte; /*FALLTHROUGH*/
- case VIRGIN | DIGIT:
- state = GOTONE; byte = new; continue;
- case GOTONE | DIGIT:
- state = GOTTWO; byte = new + (byte << 4); continue;
- default: /* | DELIM */
- state = VIRGIN; *cp++ = byte; byte = 0; continue;
- case GOTONE | END:
- case GOTTWO | END:
- *cp++ = byte; /* FALLTHROUGH */
- case VIRGIN | END:
- break;
- }
- break;
- } while (cp < cplim);
- out_addr.isoa_len = cp - out_addr.isoa_genaddr;
- return (&out_addr);
-}
-
-static char hexlist[] = "0123456789abcdef";
-
-char *
-iso_ntoa(isoa)
- const struct iso_addr *isoa;
-{
- static char tmpbuf[sizeof(isoa->isoa_genaddr)*3];
- const u_char *binary;
- char *cp;
- int i;
-
- binary = isoa->isoa_genaddr;
- cp = tmpbuf;
-
- for (i = 0; i < isoa->isoa_len; i++) {
- *cp++ = hexlist[*binary >> 4];
- *cp++ = hexlist[*binary++ & 0xf];
-
- if ((((i % 2) == 0) && ((i + 1) < isoa->isoa_len)))
- *cp++ = '.';
- }
- *cp = '\0';
- return tmpbuf;
-}
diff --git a/c/src/libnetworking/libc/linkaddr.3 b/c/src/libnetworking/libc/linkaddr.3
deleted file mode 100644
index 6999add0e8..0000000000
--- a/c/src/libnetworking/libc/linkaddr.3
+++ /dev/null
@@ -1,138 +0,0 @@
-.\" Copyright (c) 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" This code is derived from software contributed to Berkeley by
-.\" Donn Seeley at BSDI.
-.\"
-.\" 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.
-.\"
-.\" From: @(#)linkaddr.3 8.1 (Berkeley) 7/28/93
-.\" $Id$
-.\"
-.Dd June 17, 1996
-.Dt LINK_ADDR 3
-.Os BSD 4.4
-.Sh NAME
-.Nm link_addr ,
-.Nm link_ntoa
-.Nd elementary address specification routines for link level access
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/socket.h>
-.Fd #include <net/if_dl.h>
-.Ft void
-.Fn link_addr "const char *addr" "struct sockaddr_dl *sdl"
-.Ft char *
-.Fn link_ntoa "const struct sockaddr_dl *sdl"
-.Sh DESCRIPTION
-The routine
-.Fn link_addr
-interprets character strings representing
-link-level addresses, returning binary information suitable
-for use in system calls.
-The routine
-.Fn link_ntoa
-takes
-a link-level
-address and returns an
-.Tn ASCII
-string representing some of the information present,
-including the link level address itself, and the interface name
-or number, if present.
-This facility is experimental and is
-still subject to change.
-.Pp
-For
-.Fn link_addr ,
-the string
-.Fa addr
-may contain
-an optional network interface identifier of the form
-.Dq "name unit-number" ,
-suitable for the first argument to
-.Xr ifconfig 8 ,
-followed in all cases by a colon and
-an interface address in the form of
-groups of hexadecimal digits
-separated by periods.
-Each group represents a byte of address;
-address bytes are filled left to right from
-low order bytes through high order bytes.
-.Pp
-.\" A regular expression may make this format clearer:
-.\" .Bd -literal -offset indent
-.\" ([a-z]+[0-9]+:)?[0-9a-f]+(\e.[0-9a-f]+)*
-.\" .Ed
-.\" .Pp
-Thus
-.Li le0:8.0.9.13.d.30
-represents an ethernet address
-to be transmitted on the first Lance ethernet interface.
-.Pp
-The direct use of these functions is deprecated in favor of the
-.Xr addr2ascii 3
-interface; however, portable programs cannot rely on the latter as it is
-not yet widely implemented.
-.Sh RETURN VALUES
-.Fn link_ntoa
-always returns a null terminated string.
-.Fn link_addr
-has no return value.
-(See
-.Sx BUGS . )
-.Sh SEE ALSO
-.Xr addr2ascii 3
-.\" .Xr iso 4
-.Sh HISTORY
-The
-.Fn link_addr
-and
-.Fn link_ntoa
-functions appeared in
-.Bx 4.3 Reno .
-.Sh BUGS
-The returned values for link_ntoa
-reside in a static memory area.
-.Pp
-The function
-.Fn link_addr
-should diagnose improperly formed input, and there should be an unambiguous
-way to recognize this.
-.Pp
-If the
-.Va sdl_len
-field of the link socket address
-.Fa sdl
-is 0,
-.Fn link_ntoa
-will not insert a colon before the interface address bytes.
-If this translated address is given to
-.Fn link_addr
-without inserting an initial colon,
-the latter will not interpret it correctly.
diff --git a/c/src/libnetworking/libc/linkaddr.c b/c/src/libnetworking/libc/linkaddr.c
deleted file mode 100644
index 28c16cff05..0000000000
--- a/c/src/libnetworking/libc/linkaddr.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*-
- * Copyright (c) 1990, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)linkaddr.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <net/if_dl.h>
-#include <string.h>
-
-/* States*/
-#define NAMING 0
-#define GOTONE 1
-#define GOTTWO 2
-#define RESET 3
-/* Inputs */
-#define DIGIT (4*0)
-#define END (4*1)
-#define DELIM (4*2)
-#define LETTER (4*3)
-
-void
-link_addr(addr, sdl)
- register const char *addr;
- register struct sockaddr_dl *sdl;
-{
- register char *cp = sdl->sdl_data;
- char *cplim = sdl->sdl_len + (char *)sdl;
- register int byte = 0, state = NAMING, new;
-
- bzero((char *)&sdl->sdl_family, sdl->sdl_len - 1);
- sdl->sdl_family = AF_LINK;
- do {
- state &= ~LETTER;
- if ((*addr >= '0') && (*addr <= '9')) {
- new = *addr - '0';
- } else if ((*addr >= 'a') && (*addr <= 'f')) {
- new = *addr - 'a' + 10;
- } else if ((*addr >= 'A') && (*addr <= 'F')) {
- new = *addr - 'A' + 10;
- } else if (*addr == 0) {
- state |= END;
- } else if (state == NAMING &&
- (((*addr >= 'A') && (*addr <= 'Z')) ||
- ((*addr >= 'a') && (*addr <= 'z'))))
- state |= LETTER;
- else
- state |= DELIM;
- addr++;
- switch (state /* | INPUT */) {
- case NAMING | DIGIT:
- case NAMING | LETTER:
- *cp++ = addr[-1];
- continue;
- case NAMING | DELIM:
- state = RESET;
- sdl->sdl_nlen = cp - sdl->sdl_data;
- continue;
- case GOTTWO | DIGIT:
- *cp++ = byte;
- /* FALLTHROUGH */
- case RESET | DIGIT:
- state = GOTONE;
- byte = new;
- continue;
- case GOTONE | DIGIT:
- state = GOTTWO;
- byte = new + (byte << 4);
- continue;
- default: /* | DELIM */
- state = RESET;
- *cp++ = byte;
- byte = 0;
- continue;
- case GOTONE | END:
- case GOTTWO | END:
- *cp++ = byte;
- /* FALLTHROUGH */
- case RESET | END:
- break;
- }
- break;
- } while (cp < cplim);
- sdl->sdl_alen = cp - LLADDR(sdl);
- new = cp - (char *)sdl;
- if (new > sizeof(*sdl))
- sdl->sdl_len = new;
- return;
-}
-
-static char hexlist[] = "0123456789abcdef";
-
-char *
-link_ntoa(sdl)
- register const struct sockaddr_dl *sdl;
-{
- static char obuf[64];
- register char *out = obuf;
- register int i;
- register u_char *in = (u_char *)LLADDR(sdl);
- u_char *inlim = in + sdl->sdl_alen;
- int firsttime = 1;
-
- if (sdl->sdl_nlen) {
- bcopy(sdl->sdl_data, obuf, sdl->sdl_nlen);
- out += sdl->sdl_nlen;
- if (sdl->sdl_alen)
- *out++ = ':';
- }
- while (in < inlim) {
- if (firsttime)
- firsttime = 0;
- else
- *out++ = '.';
- i = *in++;
- if (i > 0xf) {
- out[1] = hexlist[i & 0xf];
- i >>= 4;
- out[0] = hexlist[i];
- out += 2;
- } else
- *out++ = hexlist[i];
- }
- *out = 0;
- return (obuf);
-}
diff --git a/c/src/libnetworking/libc/map_v4v6.c b/c/src/libnetworking/libc/map_v4v6.c
deleted file mode 100644
index 0f8658e117..0000000000
--- a/c/src/libnetworking/libc/map_v4v6.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * ++Copyright++ 1985, 1988, 1993
- * -
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <ctype.h>
-#include <errno.h>
-#include <syslog.h>
-
-typedef union {
- int32_t al;
- char ac;
-} align;
-
-void
-_map_v4v6_address(src, dst)
- const char *src;
- char *dst;
-{
- u_char *p = (u_char *)dst;
- char tmp[INADDRSZ];
- int i;
-
- /* Stash a temporary copy so our caller can update in place. */
- bcopy(src, tmp, INADDRSZ);
- /* Mark this ipv6 addr as a mapped ipv4. */
- for (i = 0; i < 10; i++)
- *p++ = 0x00;
- *p++ = 0xff;
- *p++ = 0xff;
- /* Retrieve the saved copy and we're done. */
- bcopy(tmp, (void*)p, INADDRSZ);
-}
-
-void
-_map_v4v6_hostent(hp, bpp, lenp)
- struct hostent *hp;
- char **bpp;
- int *lenp;
-{
- char **ap;
-
- if (hp->h_addrtype != AF_INET || hp->h_length != INADDRSZ)
- return;
- hp->h_addrtype = AF_INET6;
- hp->h_length = IN6ADDRSZ;
- for (ap = hp->h_addr_list; *ap; ap++) {
- int i = sizeof(align) - ((u_long)*bpp % sizeof(align));
-
- if (*lenp < (i + IN6ADDRSZ)) {
- /* Out of memory. Truncate address list here. XXX */
- *ap = NULL;
- return;
- }
- *bpp += i;
- *lenp -= i;
- _map_v4v6_address(*ap, *bpp);
- *ap = *bpp;
- *bpp += IN6ADDRSZ;
- *lenp -= IN6ADDRSZ;
- }
-}
diff --git a/c/src/libnetworking/libc/ns.3 b/c/src/libnetworking/libc/ns.3
deleted file mode 100644
index e621ad2d90..0000000000
--- a/c/src/libnetworking/libc/ns.3
+++ /dev/null
@@ -1,131 +0,0 @@
-.\" Copyright (c) 1986, 1991, 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.
-.\"
-.\" @(#)ns.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt NS 3
-.Os BSD 4.3
-.Sh NAME
-.Nm ns_addr ,
-.Nm ns_ntoa
-.Nd Xerox
-.Tn NS Ns (tm)
-address conversion routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netns/ns.h>
-.Ft struct ns_addr
-.Fn ns_addr "char *cp"
-.Ft char *
-.Fn ns_ntoa "struct ns_addr ns"
-.Sh DESCRIPTION
-The routine
-.Fn ns_addr
-interprets character strings representing
-.Tn XNS
-addresses, returning binary information suitable
-for use in system calls.
-The routine
-.Fn ns_ntoa
-takes
-.Tn XNS
-addresses and returns
-.Tn ASCII
-strings representing the address in a
-notation in common use in the Xerox Development Environment:
-.Bd -filled -offset indent
-<network number>.<host number>.<port number>
-.Ed
-.Pp
-Trailing zero fields are suppressed, and each number is printed in hexadecimal,
-in a format suitable for input to
-.Fn ns_addr .
-Any fields lacking super-decimal digits will have a
-trailing
-.Ql H
-appended.
-.Pp
-Unfortunately, no universal standard exists for representing
-.Tn XNS
-addresses.
-An effort has been made to insure that
-.Fn ns_addr
-be compatible with most formats in common use.
-It will first separate an address into 1 to 3 fields using a single delimiter
-chosen from
-period
-.Ql \&. ,
-colon
-.Ql \&:
-or pound-sign
-.Ql \&# .
-Each field is then examined for byte separators (colon or period).
-If there are byte separators, each subfield separated is taken to be
-a small hexadecimal number, and the entirety is taken as a network-byte-ordered
-quantity to be zero extended in the high-network-order bytes.
-Next, the field is inspected for hyphens, in which case
-the field is assumed to be a number in decimal notation
-with hyphens separating the millenia.
-Next, the field is assumed to be a number:
-It is interpreted
-as hexadecimal if there is a leading
-.Ql 0x
-(as in C),
-a trailing
-.Ql H
-(as in Mesa), or there are any super-decimal digits present.
-It is interpreted as octal is there is a leading
-.Ql 0
-and there are no super-octal digits.
-Otherwise, it is converted as a decimal number.
-.Sh RETURN VALUES
-None. (See
-.Sx BUGS . )
-.Sh SEE ALSO
-.Xr hosts 5 ,
-.Xr networks 5
-.Sh HISTORY
-The
-.Fn ns_addr
-and
-.Fn ns_toa
-functions appeared in
-.Bx 4.3 .
-.Sh BUGS
-The string returned by
-.Fn ns_ntoa
-resides in a static memory area.
-The function
-.Fn ns_addr
-should diagnose improperly formed input, and there should be an unambiguous
-way to recognize this.
diff --git a/c/src/libnetworking/libc/ns_addr.c b/c/src/libnetworking/libc/ns_addr.c
deleted file mode 100644
index 18fabe91f1..0000000000
--- a/c/src/libnetworking/libc/ns_addr.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright (c) 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * J.Q. Johnson.
- *
- * 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ns_addr.c 8.1 (Berkeley) 6/7/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netns/ns.h>
-#include <stdio.h>
-#include <string.h>
-
-static struct ns_addr addr, zero_addr;
-
-static void Field(), cvtbase();
-
-struct ns_addr
-ns_addr(name)
- const char *name;
-{
- char separator;
- char *hostname, *socketname, *cp;
- char buf[50];
-
- (void)strncpy(buf, name, sizeof(buf) - 1);
- buf[sizeof(buf) - 1] = '\0';
-
- /*
- * First, figure out what he intends as a field separtor.
- * Despite the way this routine is written, the prefered
- * form 2-272.AA001234H.01777, i.e. XDE standard.
- * Great efforts are made to insure backward compatability.
- */
- if ((hostname = strchr(buf, '#')) != NULL)
- separator = '#';
- else {
- hostname = strchr(buf, '.');
- if ((cp = strchr(buf, ':')) &&
- ((hostname && cp < hostname) || (hostname == 0))) {
- hostname = cp;
- separator = ':';
- } else
- separator = '.';
- }
- if (hostname)
- *hostname++ = 0;
-
- addr = zero_addr;
- Field(buf, addr.x_net.c_net, 4);
- if (hostname == 0)
- return (addr); /* No separator means net only */
-
- socketname = strchr(hostname, separator);
- if (socketname) {
- *socketname++ = 0;
- Field(socketname, (u_char *)&addr.x_port, 2);
- }
-
- Field(hostname, addr.x_host.c_host, 6);
-
- return (addr);
-}
-
-static void
-Field(buf, out, len)
- char *buf;
- u_char *out;
- int len;
-{
- register char *bp = buf;
- int i, ibase, base16 = 0, base10 = 0, clen = 0;
- int hb[6], *hp;
- char *fmt;
-
- /*
- * first try 2-273#2-852-151-014#socket
- */
- if ((*buf != '-') &&
- (1 < (i = sscanf(buf, "%d-%d-%d-%d-%d",
- &hb[0], &hb[1], &hb[2], &hb[3], &hb[4])))) {
- cvtbase(1000L, 256, hb, i, out, len);
- return;
- }
- /*
- * try form 8E1#0.0.AA.0.5E.E6#socket
- */
- if (1 < (i = sscanf(buf,"%x.%x.%x.%x.%x.%x",
- &hb[0], &hb[1], &hb[2], &hb[3], &hb[4], &hb[5]))) {
- cvtbase(256L, 256, hb, i, out, len);
- return;
- }
- /*
- * try form 8E1#0:0:AA:0:5E:E6#socket
- */
- if (1 < (i = sscanf(buf,"%x:%x:%x:%x:%x:%x",
- &hb[0], &hb[1], &hb[2], &hb[3], &hb[4], &hb[5]))) {
- cvtbase(256L, 256, hb, i, out, len);
- return;
- }
- /*
- * This is REALLY stretching it but there was a
- * comma notation separting shorts -- definitely non standard
- */
- if (1 < (i = sscanf(buf,"%x,%x,%x",
- &hb[0], &hb[1], &hb[2]))) {
- hb[0] = htons(hb[0]); hb[1] = htons(hb[1]);
- hb[2] = htons(hb[2]);
- cvtbase(65536L, 256, hb, i, out, len);
- return;
- }
-
- /* Need to decide if base 10, 16 or 8 */
- while (*bp) switch (*bp++) {
-
- case '0': case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '-':
- break;
-
- case '8': case '9':
- base10 = 1;
- break;
-
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- base16 = 1;
- break;
-
- case 'x': case 'X':
- *--bp = '0';
- base16 = 1;
- break;
-
- case 'h': case 'H':
- base16 = 1;
- /* fall into */
-
- default:
- *--bp = 0; /* Ends Loop */
- }
- if (base16) {
- fmt = "%3x";
- ibase = 4096;
- } else if (base10 == 0 && *buf == '0') {
- fmt = "%3o";
- ibase = 512;
- } else {
- fmt = "%3d";
- ibase = 1000;
- }
-
- for (bp = buf; *bp++; ) clen++;
- if (clen == 0) clen++;
- if (clen > 18) clen = 18;
- i = ((clen - 1) / 3) + 1;
- bp = clen + buf - 3;
- hp = hb + i - 1;
-
- while (hp > hb) {
- (void)sscanf(bp, fmt, hp);
- bp[0] = 0;
- hp--;
- bp -= 3;
- }
- (void)sscanf(buf, fmt, hp);
- cvtbase((long)ibase, 256, hb, i, out, len);
-}
-
-static void
-cvtbase(oldbase,newbase,input,inlen,result,reslen)
- long oldbase;
- int newbase;
- int input[];
- int inlen;
- unsigned char result[];
- int reslen;
-{
- int d, e;
- long sum;
-
- e = 1;
- while (e > 0 && reslen > 0) {
- d = 0; e = 0; sum = 0;
- /* long division: input=input/newbase */
- while (d < inlen) {
- sum = sum*oldbase + (long) input[d];
- e += (sum > 0);
- input[d++] = sum / newbase;
- sum %= newbase;
- }
- result[--reslen] = sum; /* accumulate remainder */
- }
- for (d=0; d < reslen; d++)
- result[d] = 0;
-}
diff --git a/c/src/libnetworking/libc/ns_name.c b/c/src/libnetworking/libc/ns_name.c
deleted file mode 100644
index af10d2f062..0000000000
--- a/c/src/libnetworking/libc/ns_name.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-
-#include <errno.h>
-#include <resolv.h>
-#include <string.h>
-
-/* Data. */
-
-static char digits[] = "0123456789";
-
-/* Forward. */
-
-static int special(int);
-static int printable(int);
-static int dn_find(const u_char *, const u_char *,
- const u_char * const *,
- const u_char * const *);
-
-/* Public. */
-
-/*
- * ns_name_ntop(src, dst, dstsiz)
- * Convert an encoded domain name to printable ascii as per RFC1035.
- * return:
- * Number of bytes written to buffer, or -1 (with errno set)
- * notes:
- * The root is returned as "."
- * All other domains are returned in non absolute form
- */
-int
-ns_name_ntop(const u_char *src, char *dst, size_t dstsiz) {
- const u_char *cp;
- char *dn, *eom;
- u_char c;
- u_int n;
-
- cp = src;
- dn = dst;
- eom = dst + dstsiz;
-
- while ((n = *cp++) != 0) {
- if ((n & NS_CMPRSFLGS) != 0) {
- /* Some kind of compression pointer. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (dn != dst) {
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '.';
- }
- if (dn + n >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- for ((void)NULL; n > 0; n--) {
- c = *cp++;
- if (special(c)) {
- if (dn + 1 >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '\\';
- *dn++ = (char)c;
- } else if (!printable(c)) {
- if (dn + 3 >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '\\';
- *dn++ = digits[c / 100];
- *dn++ = digits[(c % 100) / 10];
- *dn++ = digits[c % 10];
- } else {
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = (char)c;
- }
- }
- }
- if (dn == dst) {
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '.';
- }
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '\0';
- return (dn - dst);
-}
-
-/*
- * ns_name_pton(src, dst, dstsiz)
- * Convert a ascii string into an encoded domain name as per RFC1035.
- * return:
- * -1 if it fails
- * 1 if string was fully qualified
- * 0 is string was not fully qualified
- * notes:
- * Enforces label and domain length limits.
- */
-
-int
-ns_name_pton(const char *src, u_char *dst, size_t dstsiz) {
- u_char *label, *bp, *eom;
- int c, n, escaped;
- char *cp;
-
- escaped = 0;
- bp = dst;
- eom = dst + dstsiz;
- label = bp++;
-
- while ((c = *src++) != 0) {
- if (escaped) {
- if ((cp = strchr(digits, c)) != NULL) {
- n = (cp - digits) * 100;
- if ((c = *src++) == 0 ||
- (cp = strchr(digits, c)) == NULL) {
- errno = EMSGSIZE;
- return (-1);
- }
- n += (cp - digits) * 10;
- if ((c = *src++) == 0 ||
- (cp = strchr(digits, c)) == NULL) {
- errno = EMSGSIZE;
- return (-1);
- }
- n += (cp - digits);
- if (n > 255) {
- errno = EMSGSIZE;
- return (-1);
- }
- c = n;
- }
- escaped = 0;
- } else if (c == '\\') {
- escaped = 1;
- continue;
- } else if (c == '.') {
- c = (bp - label - 1);
- if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (label >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *label = c;
- /* Fully qualified ? */
- if (*src == '\0') {
- if (c != 0) {
- if (bp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *bp++ = '\0';
- }
- if ((bp - dst) > MAXCDNAME) {
- errno = EMSGSIZE;
- return (-1);
- }
- return (1);
- }
- if (c == 0) {
- errno = EMSGSIZE;
- return (-1);
- }
- label = bp++;
- continue;
- }
- if (bp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *bp++ = (u_char)c;
- }
- c = (bp - label - 1);
- if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (label >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *label = c;
- if (c != 0) {
- if (bp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *bp++ = 0;
- }
- if ((bp - dst) > MAXCDNAME) { /* src too big */
- errno = EMSGSIZE;
- return (-1);
- }
- return (0);
-}
-
-/*
- * ns_name_unpack(msg, eom, src, dst, dstsiz)
- * Unpack a domain name from a message, source may be compressed.
- * return:
- * -1 if it fails, or consumed octets if it succeeds.
- */
-int
-ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
- u_char *dst, size_t dstsiz)
-{
- const u_char *srcp, *dstlim;
- u_char *dstp;
- int n, len, checked;
-
- len = -1;
- checked = 0;
- dstp = dst;
- srcp = src;
- dstlim = dst + dstsiz;
- if (srcp < msg || srcp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- /* Fetch next label in domain name. */
- while ((n = *srcp++) != 0) {
- /* Check for indirection. */
- switch (n & NS_CMPRSFLGS) {
- case 0:
- /* Limit checks. */
- if (dstp + n + 1 >= dstlim || srcp + n >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- checked += n + 1;
- *dstp++ = n;
- memcpy(dstp, srcp, n);
- dstp += n;
- srcp += n;
- break;
-
- case NS_CMPRSFLGS:
- if (srcp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- if (len < 0)
- len = srcp - src + 1;
- srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff));
- if (srcp < msg || srcp >= eom) { /* Out of range. */
- errno = EMSGSIZE;
- return (-1);
- }
- checked += 2;
- /*
- * Check for loops in the compressed name;
- * if we've looked at the whole message,
- * there must be a loop.
- */
- if (checked >= eom - msg) {
- errno = EMSGSIZE;
- return (-1);
- }
- break;
-
- default:
- errno = EMSGSIZE;
- return (-1); /* flag error */
- }
- }
- *dstp = '\0';
- if (len < 0)
- len = srcp - src;
- return (len);
-}
-
-/*
- * ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr)
- * Pack domain name 'domain' into 'comp_dn'.
- * return:
- * Size of the compressed name, or -1.
- * notes:
- * 'dnptrs' is an array of pointers to previous compressed names.
- * dnptrs[0] is a pointer to the beginning of the message. The array
- * ends with NULL.
- * 'lastdnptr' is a pointer to the end of the array pointed to
- * by 'dnptrs'.
- * Side effects:
- * The list of pointers in dnptrs is updated for labels inserted into
- * the message as we compress the name. If 'dnptr' is NULL, we don't
- * try to compress names. If 'lastdnptr' is NULL, we don't update the
- * list.
- */
-int
-ns_name_pack(const u_char *src, u_char *dst, int dstsiz,
- const u_char **dnptrs, const u_char **lastdnptr)
-{
- u_char *dstp;
- const u_char **cpp, **lpp, *eob, *msg;
- const u_char *srcp;
- int n, l;
-
- srcp = src;
- dstp = dst;
- eob = dstp + dstsiz;
- lpp = cpp = NULL;
- if (dnptrs != NULL) {
- if ((msg = *dnptrs++) != NULL) {
- for (cpp = dnptrs; *cpp != NULL; cpp++)
- (void)NULL;
- lpp = cpp; /* end of list to search */
- }
- } else
- msg = NULL;
-
- /* make sure the domain we are about to add is legal */
- l = 0;
- do {
- n = *srcp;
- if ((n & NS_CMPRSFLGS) != 0) {
- errno = EMSGSIZE;
- return (-1);
- }
- l += n + 1;
- if (l > MAXCDNAME) {
- errno = EMSGSIZE;
- return (-1);
- }
- srcp += n + 1;
- } while (n != 0);
-
- srcp = src;
- do {
- /* Look to see if we can use pointers. */
- n = *srcp;
- if (n != 0 && msg != NULL) {
- l = dn_find(srcp, msg, (const u_char * const *)dnptrs,
- (const u_char * const *)lpp);
- if (l >= 0) {
- if (dstp + 1 >= eob) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dstp++ = (l >> 8) | NS_CMPRSFLGS;
- *dstp++ = l % 256;
- return (dstp - dst);
- }
- /* Not found, save it. */
- if (lastdnptr != NULL && cpp < lastdnptr - 1 &&
- (dstp - msg) < 0x4000) {
- *cpp++ = dstp;
- *cpp = NULL;
- }
- }
- /* copy label to buffer */
- if (n & NS_CMPRSFLGS) { /* Should not happen. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (dstp + 1 + n >= eob) {
- errno = EMSGSIZE;
- return (-1);
- }
- memcpy(dstp, srcp, n + 1);
- srcp += n + 1;
- dstp += n + 1;
- } while (n != 0);
-
- if (dstp > eob) {
- if (msg != NULL)
- *lpp = NULL;
- errno = EMSGSIZE;
- return (-1);
- }
- return (dstp - dst);
-}
-
-/*
- * ns_name_uncompress(msg, eom, src, dst, dstsiz)
- * Expand compressed domain name to presentation format.
- * return:
- * Number of bytes read out of `src', or -1 (with errno set).
- * note:
- * Root domain returns as "." not "".
- */
-int
-ns_name_uncompress(const u_char *msg, const u_char *eom, const u_char *src,
- char *dst, size_t dstsiz)
-{
- u_char tmp[NS_MAXCDNAME];
- int n;
-
- if ((n = ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1)
- return (-1);
- if (ns_name_ntop(tmp, dst, dstsiz) == -1)
- return (-1);
- return (n);
-}
-
-/*
- * ns_name_compress(src, dst, dstsiz, dnptrs, lastdnptr)
- * Compress a domain name into wire format, using compression pointers.
- * return:
- * Number of bytes consumed in `dst' or -1 (with errno set).
- * notes:
- * 'dnptrs' is an array of pointers to previous compressed names.
- * dnptrs[0] is a pointer to the beginning of the message.
- * The list ends with NULL. 'lastdnptr' is a pointer to the end of the
- * array pointed to by 'dnptrs'. Side effect is to update the list of
- * pointers for labels inserted into the message as we compress the name.
- * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr'
- * is NULL, we don't update the list.
- */
-int
-ns_name_compress(const char *src, u_char *dst, size_t dstsiz,
- const u_char **dnptrs, const u_char **lastdnptr)
-{
- u_char tmp[NS_MAXCDNAME];
-
- if (ns_name_pton(src, tmp, sizeof tmp) == -1)
- return (-1);
- return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr));
-}
-
-/*
- * ns_name_skip(ptrptr, eom)
- * Advance *ptrptr to skip over the compressed name it points at.
- * return:
- * 0 on success, -1 (with errno set) on failure.
- */
-int
-ns_name_skip(const u_char **ptrptr, const u_char *eom) {
- const u_char *cp;
- u_int n;
-
- cp = *ptrptr;
- while (cp < eom && (n = *cp++) != 0) {
- /* Check for indirection. */
- switch (n & NS_CMPRSFLGS) {
- case 0: /* normal case, n == len */
- cp += n;
- continue;
- case NS_CMPRSFLGS: /* indirection */
- cp++;
- break;
- default: /* illegal type */
- errno = EMSGSIZE;
- return (-1);
- }
- break;
- }
- if (cp > eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *ptrptr = cp;
- return (0);
-}
-
-/* Private. */
-
-/*
- * special(ch)
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * is this characted special ("in need of quoting") ?
- * return:
- * boolean.
- */
-static int
-special(int ch) {
- switch (ch) {
- case 0x22: /* '"' */
- case 0x2E: /* '.' */
- case 0x3B: /* ';' */
- case 0x5C: /* '\\' */
- /* Special modifiers in zone files. */
- case 0x40: /* '@' */
- case 0x24: /* '$' */
- return (1);
- default:
- return (0);
- }
-}
-
-/*
- * printable(ch)
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * is this character visible and not a space when printed ?
- * return:
- * boolean.
- */
-static int
-printable(int ch) {
- return (ch > 0x20 && ch < 0x7f);
-}
-
-/*
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * convert this character to lower case if it's upper case.
- */
-static int
-mklower(int ch) {
- if (ch >= 0x41 && ch <= 0x5A)
- return (ch + 0x20);
- return (ch);
-}
-
-/*
- * dn_find(domain, msg, dnptrs, lastdnptr)
- * Search for the counted-label name in an array of compressed names.
- * return:
- * offset from msg if found, or -1.
- * notes:
- * dnptrs is the pointer to the first name on the list,
- * not the pointer to the start of the message.
- */
-static int
-dn_find(const u_char *domain, const u_char *msg,
- const u_char * const *dnptrs,
- const u_char * const *lastdnptr)
-{
- const u_char *dn, *cp, *sp;
- const u_char * const *cpp;
- u_int n;
-
- for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
- dn = domain;
- sp = cp = *cpp;
- while ((n = *cp++) != 0) {
- /*
- * check for indirection
- */
- switch (n & NS_CMPRSFLGS) {
- case 0: /* normal case, n == len */
- if (n != *dn++)
- goto next;
- for ((void)NULL; n > 0; n--)
- if (mklower(*dn++) != mklower(*cp++))
- goto next;
- /* Is next root for both ? */
- if (*dn == '\0' && *cp == '\0')
- return (sp - msg);
- if (*dn)
- continue;
- goto next;
-
- case NS_CMPRSFLGS: /* indirection */
- cp = msg + (((n & 0x3f) << 8) | *cp);
- break;
-
- default: /* illegal type */
- errno = EMSGSIZE;
- return (-1);
- }
- }
- next: ;
- }
- errno = ENOENT;
- return (-1);
-}
diff --git a/c/src/libnetworking/libc/ns_netint.c b/c/src/libnetworking/libc/ns_netint.c
deleted file mode 100644
index 3c09da8f8c..0000000000
--- a/c/src/libnetworking/libc/ns_netint.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/* Import. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-
-u_int
-ns_get16(const u_char *src) {
- u_int dst;
-
- NS_GET16(dst, src);
- return (dst);
-}
-
-u_long
-ns_get32(const u_char *src) {
- u_long dst;
-
- NS_GET32(dst, src);
- return (dst);
-}
-
-void
-ns_put16(u_int src, u_char *dst) {
- NS_PUT16(src, dst);
-}
-
-void
-ns_put32(u_long src, u_char *dst) {
- NS_PUT32(src, dst);
-}
diff --git a/c/src/libnetworking/libc/ns_ntoa.c b/c/src/libnetworking/libc/ns_ntoa.c
deleted file mode 100644
index 9d0be2e1dc..0000000000
--- a/c/src/libnetworking/libc/ns_ntoa.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 1986, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ns_ntoa.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netns/ns.h>
-#include <stdio.h>
-
-char *
-ns_ntoa(addr)
- struct ns_addr addr;
-{
- static char obuf[40];
- union { union ns_net net_e; u_long long_e; } net;
- u_short port = htons(addr.x_port);
- register char *cp;
- char *cp2;
- register u_char *up = addr.x_host.c_host;
- u_char *uplim = up + 6;
- static char *spectHex();
-
- net.net_e = addr.x_net;
- sprintf(obuf, "%lx", (u_long)ntohl(net.long_e));
- cp = spectHex(obuf);
- cp2 = cp + 1;
- while (*up==0 && up < uplim) up++;
- if (up == uplim) {
- if (port) {
- sprintf(cp, ".0");
- cp += 2;
- }
- } else {
- sprintf(cp, ".%x", *up++);
- while (up < uplim) {
- while (*cp) cp++;
- sprintf(cp, "%02x", *up++);
- }
- cp = spectHex(cp2);
- }
- if (port) {
- sprintf(cp, ".%x", port);
- spectHex(cp + 1);
- }
- return (obuf);
-}
-
-static char *
-spectHex(p0)
- char *p0;
-{
- int ok = 0;
- int nonzero = 0;
- register char *p = p0;
- for (; *p; p++) switch (*p) {
-
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- *p += ('A' - 'a');
- /* fall into . . . */
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- ok = 1;
- case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
- nonzero = 1;
- }
- if (nonzero && !ok) { *p++ = 'H'; *p = 0; }
- return (p);
-}
diff --git a/c/src/libnetworking/libc/ns_parse.c b/c/src/libnetworking/libc/ns_parse.c
deleted file mode 100644
index cc1f070156..0000000000
--- a/c/src/libnetworking/libc/ns_parse.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-
-#include <errno.h>
-#include <resolv.h>
-#include <string.h>
-
-/* These need to be in the same order as the nres.h:ns_flag enum. */
-struct _ns_flagdata _ns_flagdata[16] = {
- { 0x8000, 15 }, /* qr. */
- { 0x7800, 11 }, /* opcode. */
- { 0x0400, 10 }, /* aa. */
- { 0x0200, 9 }, /* tc. */
- { 0x0100, 8 }, /* rd. */
- { 0x0080, 7 }, /* ra. */
- { 0x0040, 6 }, /* z. */
- { 0x0020, 5 }, /* ad. */
- { 0x0010, 4 }, /* cd. */
- { 0x000f, 0 }, /* rcode. */
- { 0x0000, 0 }, /* expansion (1/6). */
- { 0x0000, 0 }, /* expansion (2/6). */
- { 0x0000, 0 }, /* expansion (3/6). */
- { 0x0000, 0 }, /* expansion (4/6). */
- { 0x0000, 0 }, /* expansion (5/6). */
- { 0x0000, 0 }, /* expansion (6/6). */
-};
-
-static int
-skiprr(const u_char *ptr, const u_char *eom, ns_sect section, int count) {
- const u_char *optr = ptr;
-
- for ((void)NULL; count > 0; count--) {
- int b, rdlength;
-
- b = dn_skipname(ptr, eom);
- if (b < 0)
- goto emsgsize;
- ptr += b/*Name*/ + NS_INT16SZ/*Type*/ + NS_INT16SZ/*Class*/;
- if (section != ns_s_qd) {
- if (ptr + NS_INT32SZ > eom)
- goto emsgsize;
- ptr += NS_INT32SZ/*TTL*/;
- if (ptr + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(rdlength, ptr);
- ptr += rdlength/*RData*/;
- }
- }
- if (ptr > eom)
- goto emsgsize;
- return (ptr - optr);
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
-
-int
-ns_initparse(const u_char *msg, int msglen, ns_msg *handle) {
- const u_char *eom = msg + msglen;
- int i;
-
- memset(handle, 0x5e, sizeof *handle);
- handle->_msg = msg;
- handle->_eom = eom;
- if (msg + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(handle->_id, msg);
- if (msg + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(handle->_flags, msg);
- for (i = 0; i < ns_s_max; i++) {
- if (msg + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(handle->_counts[i], msg);
- }
- for (i = 0; i < ns_s_max; i++)
- if (handle->_counts[i] == 0)
- handle->_sections[i] = NULL;
- else {
- int b = skiprr(msg, eom, (ns_sect)i,
- handle->_counts[i]);
-
- if (b < 0)
- return (-1);
- handle->_sections[i] = msg;
- msg += b;
- }
- if (msg != eom)
- goto emsgsize;
- handle->_sect = ns_s_max;
- handle->_rrnum = -1;
- handle->_ptr = NULL;
- return (0);
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
-
-int
-ns_parserr(ns_msg *handle, ns_sect section, int rrnum, ns_rr *rr) {
- int b;
-
- /* Make section right. */
- if (section < 0 || section >= ns_s_max)
- goto enodev;
- if ((int)section != (int)handle->_sect) {
- handle->_sect = section;
- handle->_rrnum = 0;
- handle->_ptr = handle->_sections[(int)section];
- }
-
- /* Make rrnum right. */
- if (rrnum == -1)
- rrnum = handle->_rrnum;
- if (rrnum < 0 || rrnum >= handle->_counts[(int)section])
- goto enodev;
- if (rrnum < handle->_rrnum) {
- handle->_rrnum = 0;
- handle->_ptr = handle->_sections[(int)section];
- }
-
- b = skiprr(handle->_msg, handle->_eom, section,
- rrnum - handle->_rrnum);
- if (b < 0)
- return (-1);
- handle->_ptr += b;
- handle->_rrnum = rrnum;
-
- /* Do the parse. */
- b = dn_expand(handle->_msg, handle->_eom,
- handle->_ptr, rr->name, NS_MAXDNAME);
- if (b < 0)
- return (-1);
- handle->_ptr += b;
- if (handle->_ptr + NS_INT16SZ > handle->_eom)
- goto emsgsize;
- NS_GET16(rr->type, handle->_ptr);
- if (handle->_ptr + NS_INT16SZ > handle->_eom)
- goto emsgsize;
- NS_GET16(rr->class, handle->_ptr);
- if (section == ns_s_qd) {
- rr->ttl = 0;
- rr->rdlength = 0;
- rr->rdata = NULL;
- } else {
- if (handle->_ptr + NS_INT32SZ > handle->_eom)
- goto emsgsize;
- NS_GET32(rr->ttl, handle->_ptr);
- if (handle->_ptr + NS_INT16SZ > handle->_eom)
- goto emsgsize;
- NS_GET16(rr->rdlength, handle->_ptr);
- if (handle->_ptr + rr->rdlength > handle->_eom)
- goto emsgsize;
- rr->rdata = handle->_ptr;
- handle->_ptr += rr->rdlength;
- }
- handle->_rrnum++;
-
- /* All done. */
- return (0);
- enodev:
- errno = ENODEV;
- return (-1);
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
diff --git a/c/src/libnetworking/libc/ns_print.c b/c/src/libnetworking/libc/ns_print.c
deleted file mode 100644
index f7d7d16c64..0000000000
--- a/c/src/libnetworking/libc/ns_print.c
+++ /dev/null
@@ -1,745 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/* Import. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <assert.h>
-#include <errno.h>
-#include <resolv.h>
-#include <string.h>
-#include <ctype.h>
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-/* Forward. */
-
-static size_t prune_origin(const char *name, const char *origin);
-static int charstr(const u_char *rdata, const u_char *edata,
- char **buf, size_t *buflen);
-static int addname(const u_char *msg, size_t msglen,
- const u_char **p, const char *origin,
- char **buf, size_t *buflen);
-static void addlen(size_t len, char **buf, size_t *buflen);
-static int addstr(const char *src, size_t len,
- char **buf, size_t *buflen);
-static int addtab(size_t len, size_t target, int spaced,
- char **buf, size_t *buflen);
-
-/* Macros. */
-
-#define T(x) \
- do { \
- if ((x) < 0) \
- return (-1); \
- } while (0)
-
-/* Public. */
-
-/*
- * int
- * ns_sprintrr(handle, rr, name_ctx, origin, buf, buflen)
- * Convert an RR to presentation format.
- * return:
- * Number of characters written to buf, or -1 (check errno).
- */
-int
-ns_sprintrr(const ns_msg *handle, const ns_rr *rr,
- const char *name_ctx, const char *origin,
- char *buf, size_t buflen)
-{
- int n;
-
- n = ns_sprintrrf(ns_msg_base(*handle), ns_msg_size(*handle),
- ns_rr_name(*rr), ns_rr_class(*rr), ns_rr_type(*rr),
- ns_rr_ttl(*rr), ns_rr_rdata(*rr), ns_rr_rdlen(*rr),
- name_ctx, origin, buf, buflen);
- return (n);
-}
-
-/*
- * int
- * ns_sprintrrf(msg, msglen, name, class, type, ttl, rdata, rdlen,
- * name_ctx, origin, buf, buflen)
- * Convert the fields of an RR into presentation format.
- * return:
- * Number of characters written to buf, or -1 (check errno).
- */
-int
-ns_sprintrrf(const u_char *msg, size_t msglen,
- const char *name, ns_class class, ns_type type,
- u_long ttl, const u_char *rdata, size_t rdlen,
- const char *name_ctx, const char *origin,
- char *buf, size_t buflen)
-{
- const char *obuf = buf;
- const u_char *edata = rdata + rdlen;
- int spaced = 0;
-
- const char *comment;
- char tmp[100];
- int len, x;
-
- /*
- * Owner.
- */
- if (name_ctx != NULL && strcasecmp(name_ctx, name) == 0) {
- T(addstr("\t\t\t", 3, &buf, &buflen));
- } else {
- len = prune_origin(name, origin);
- if (len == 0) {
- T(addstr("@\t\t\t", 4, &buf, &buflen));
- } else {
- T(addstr(name, len, &buf, &buflen));
- /* Origin not used and no trailing dot? */
- if ((!origin || !origin[0] || name[len] == '\0') &&
- name[len - 1] != '.') {
- T(addstr(".", 1, &buf, &buflen));
- len++;
- }
- T(spaced = addtab(len, 24, spaced, &buf, &buflen));
- }
- }
-
- /*
- * TTL, Class, Type.
- */
- T(x = ns_format_ttl(ttl, buf, buflen));
- addlen(x, &buf, &buflen);
- len = SPRINTF((tmp, " %s %s", p_class(class), p_type(type)));
- T(addstr(tmp, len, &buf, &buflen));
- T(spaced = addtab(x + len, 16, spaced, &buf, &buflen));
-
- /*
- * RData.
- */
- switch (type) {
- case ns_t_a:
- if (rdlen != NS_INADDRSZ)
- goto formerr;
- (void) inet_ntop(AF_INET, rdata, buf, buflen);
- addlen(strlen(buf), &buf, &buflen);
- break;
-
- case ns_t_cname:
- case ns_t_mb:
- case ns_t_mg:
- case ns_t_mr:
- case ns_t_ns:
- case ns_t_ptr:
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- break;
-
- case ns_t_hinfo:
- case ns_t_isdn:
- /* First word. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Second word. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- break;
-
- case ns_t_soa: {
- u_long t;
-
- /* Server name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Administrator name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" (\n", 3, &buf, &buflen));
- spaced = 0;
-
- if ((edata - rdata) != 5*NS_INT32SZ)
- goto formerr;
-
- /* Serial number. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- len = SPRINTF((tmp, "%lu", t));
- T(addstr(tmp, len, &buf, &buflen));
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; serial\n", 9, &buf, &buflen));
- spaced = 0;
-
- /* Refresh interval. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; refresh\n", 10, &buf, &buflen));
- spaced = 0;
-
- /* Retry interval. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; retry\n", 8, &buf, &buflen));
- spaced = 0;
-
- /* Expiry. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; expiry\n", 9, &buf, &buflen));
- spaced = 0;
-
- /* Minimum TTL. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(addstr(" )", 2, &buf, &buflen));
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; minimum\n", 10, &buf, &buflen));
-
- break;
- }
-
- case ns_t_mx:
- case ns_t_afsdb:
- case ns_t_rt: {
- u_int t;
-
- if (rdlen < NS_INT16SZ)
- goto formerr;
-
- /* Priority. */
- t = ns_get16(rdata);
- rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", t));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Target. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- break;
- }
-
- case ns_t_px: {
- u_int t;
-
- if (rdlen < NS_INT16SZ)
- goto formerr;
-
- /* Priority. */
- t = ns_get16(rdata);
- rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", t));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Name1. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Name2. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- break;
- }
-
- case ns_t_x25:
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- break;
-
- case ns_t_txt:
- while (rdata < edata) {
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- if (rdata < edata)
- T(addstr(" ", 1, &buf, &buflen));
- }
- break;
-
- case ns_t_nsap: {
- char t[255*3];
-
- (void) inet_nsap_ntoa(rdlen, rdata, t);
- T(addstr(t, strlen(t), &buf, &buflen));
- break;
- }
-
- case ns_t_aaaa:
- if (rdlen != NS_IN6ADDRSZ)
- goto formerr;
- (void) inet_ntop(AF_INET6, rdata, buf, buflen);
- addlen(strlen(buf), &buf, &buflen);
- break;
-
- case ns_t_loc: {
- char t[255];
-
- /* XXX protocol format checking? */
- (void) loc_ntoa(rdata, t);
- T(addstr(t, strlen(t), &buf, &buflen));
- break;
- }
-
- case ns_t_naptr: {
- u_int order, preference;
- char t[50];
-
- if (rdlen < 2*NS_INT16SZ)
- goto formerr;
-
- /* Order, Precedence. */
- order = ns_get16(rdata); rdata += NS_INT16SZ;
- preference = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((t, "%u %u ", order, preference));
- T(addstr(t, len, &buf, &buflen));
-
- /* Flags. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Service. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Regexp. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len < 0)
- return (-1);
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Server. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- break;
- }
-
- case ns_t_srv: {
- u_int priority, weight, port;
- char t[50];
-
- if (rdlen < NS_INT16SZ*3)
- goto formerr;
-
- /* Priority, Weight, Port. */
- priority = ns_get16(rdata); rdata += NS_INT16SZ;
- weight = ns_get16(rdata); rdata += NS_INT16SZ;
- port = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((t, "%u %u %u ", priority, weight, port));
- T(addstr(t, len, &buf, &buflen));
-
- /* Server. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- break;
- }
-
- case ns_t_minfo:
- case ns_t_rp:
- /* Name1. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Name2. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- break;
-
- case ns_t_wks: {
- int n, lcnt;
-
- if (rdlen < NS_INT32SZ + 1)
- goto formerr;
-
- /* Address. */
- (void) inet_ntop(AF_INET, rdata, buf, buflen);
- addlen(strlen(buf), &buf, &buflen);
- rdata += NS_INADDRSZ;
-
- /* Protocol. */
- len = SPRINTF((tmp, " %u ( ", *rdata));
- T(addstr(tmp, len, &buf, &buflen));
- rdata += NS_INT8SZ;
-
- /* Bit map. */
- n = 0;
- lcnt = 0;
- while (rdata < edata) {
- u_int c = *rdata++;
- do {
- if (c & 0200) {
- if (lcnt == 0) {
- T(addstr("\n\t\t\t\t", 5,
- &buf, &buflen));
- lcnt = 10;
- spaced = 0;
- }
- len = SPRINTF((tmp, "%d ", n));
- T(addstr(tmp, len, &buf, &buflen));
- lcnt--;
- }
- c <<= 1;
- } while (++n & 07);
- }
- T(addstr(")", 1, &buf, &buflen));
-
- break;
- }
-
- case ns_t_key: {
- char base64_key[NS_MD5RSA_MAX_BASE64];
- u_int keyflags, protocol, algorithm;
- const char *leader;
- int n;
-
- if (rdlen < NS_INT16SZ + NS_INT8SZ + NS_INT8SZ)
- goto formerr;
-
- /* Key flags, Protocol, Algorithm. */
- keyflags = ns_get16(rdata); rdata += NS_INT16SZ;
- protocol = *rdata++;
- algorithm = *rdata++;
- len = SPRINTF((tmp, "0x%04x %u %u",
- keyflags, protocol, algorithm));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Public key data. */
- len = b64_ntop(rdata, edata - rdata,
- base64_key, sizeof base64_key);
- if (len < 0)
- goto formerr;
- if (len > 15) {
- T(addstr(" (", 2, &buf, &buflen));
- leader = "\n\t\t";
- spaced = 0;
- } else
- leader = " ";
- for (n = 0; n < len; n += 48) {
- T(addstr(leader, strlen(leader), &buf, &buflen));
- T(addstr(base64_key + n, MIN(len - n, 48),
- &buf, &buflen));
- }
- if (len > 15)
- T(addstr(" )", 2, &buf, &buflen));
-
- break;
- }
-
- case ns_t_sig: {
- char base64_key[NS_MD5RSA_MAX_BASE64];
- u_int type, algorithm, labels, footprint;
- const char *leader;
- u_long t;
- int n;
-
- if (rdlen < 22)
- goto formerr;
-
- /* Type covered, Algorithm, Label count, Original TTL. */
- type = ns_get16(rdata); rdata += NS_INT16SZ;
- algorithm = *rdata++;
- labels = *rdata++;
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, " %s %d %lu ",
- p_type(type), algorithm, t));
- T(addstr(tmp, len, &buf, &buflen));
- if (labels != (u_int)dn_count_labels(name))
- goto formerr;
-
- /* Signature expiry. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s ", p_secstodate(t)));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Time signed. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s ", p_secstodate(t)));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Signature Footprint. */
- footprint = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", footprint));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Signer's name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- /* Signature. */
- len = b64_ntop(rdata, edata - rdata,
- base64_key, sizeof base64_key);
- if (len > 15) {
- T(addstr(" (", 2, &buf, &buflen));
- leader = "\n\t\t";
- spaced = 0;
- } else
- leader = " ";
- if (len < 0)
- goto formerr;
- for (n = 0; n < len; n += 48) {
- T(addstr(leader, strlen(leader), &buf, &buflen));
- T(addstr(base64_key + n, MIN(len - n, 48),
- &buf, &buflen));
- }
- if (len > 15)
- T(addstr(" )", 2, &buf, &buflen));
-
- break;
- }
-
- case ns_t_nxt: {
- int n, c;
-
- /* Next domain name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- /* Type bit map. */
- n = edata - rdata;
- for (c = 0; c < n*8; c++)
- if (NS_NXT_BIT_ISSET(c, rdata)) {
- len = SPRINTF((tmp, " %s", p_type(c)));
- T(addstr(tmp, len, &buf, &buflen));
- }
- break;
- }
-
- default:
- comment = "unknown RR type";
- goto hexify;
- }
- return (buf - obuf);
- formerr:
- comment = "RR format error";
- hexify: {
- int n, m;
- char *p;
-
- len = SPRINTF((tmp, "\\#(\t\t; %s", comment));
- T(addstr(tmp, len, &buf, &buflen));
- while (rdata < edata) {
- p = tmp;
- p += SPRINTF((p, "\n\t"));
- spaced = 0;
- n = MIN(16, edata - rdata);
- for (m = 0; m < n; m++)
- p += SPRINTF((p, "%02x ", rdata[m]));
- T(addstr(tmp, p - tmp, &buf, &buflen));
- if (n < 16) {
- T(addstr(")", 1, &buf, &buflen));
- T(addtab(p - tmp + 1, 48, spaced, &buf, &buflen));
- }
- p = tmp;
- p += SPRINTF((p, "; "));
- for (m = 0; m < n; m++)
- *p++ = (isascii(rdata[m]) && isprint(rdata[m]))
- ? rdata[m]
- : '.';
- T(addstr(tmp, p - tmp, &buf, &buflen));
- rdata += n;
- }
- return (buf - obuf);
- }
-}
-
-/* Private. */
-
-/*
- * size_t
- * prune_origin(name, origin)
- * Find out if the name is at or under the current origin.
- * return:
- * Number of characters in name before start of origin,
- * or length of name if origin does not match.
- * notes:
- * This function should share code with samedomain().
- */
-static size_t
-prune_origin(const char *name, const char *origin) {
- const char *oname = name;
-
- while (*name != '\0') {
- if (origin != NULL && strcasecmp(name, origin) == 0)
- return (name - oname - (name > oname));
- while (*name != '\0') {
- if (*name == '\\') {
- name++;
- /* XXX need to handle \nnn form. */
- if (*name == '\0')
- break;
- } else if (*name == '.') {
- name++;
- break;
- }
- name++;
- }
- }
- return (name - oname);
-}
-
-/*
- * int
- * charstr(rdata, edata, buf, buflen)
- * Format a <character-string> into the presentation buffer.
- * return:
- * Number of rdata octets consumed
- * 0 for protocol format error
- * -1 for output buffer error
- * side effects:
- * buffer is advanced on success.
- */
-static int
-charstr(const u_char *rdata, const u_char *edata, char **buf, size_t *buflen) {
- const u_char *odata = rdata;
- size_t save_buflen = *buflen;
- char *save_buf = *buf;
-
- if (addstr("\"", 1, buf, buflen) < 0)
- goto enospc;
- if (rdata < edata) {
- int n = *rdata;
-
- if (rdata + 1 + n <= edata) {
- rdata++;
- while (n-- > 0) {
- if (strchr("\n\"\\", *rdata) != NULL)
- if (addstr("\\", 1, buf, buflen) < 0)
- goto enospc;
- if (addstr((const char *)rdata, 1,
- buf, buflen) < 0)
- goto enospc;
- rdata++;
- }
- }
- }
- if (addstr("\"", 1, buf, buflen) < 0)
- goto enospc;
- return (rdata - odata);
- enospc:
- errno = ENOSPC;
- *buf = save_buf;
- *buflen = save_buflen;
- return (-1);
-}
-
-static int
-addname(const u_char *msg, size_t msglen,
- const u_char **pp, const char *origin,
- char **buf, size_t *buflen)
-{
- size_t newlen, save_buflen = *buflen;
- char *save_buf = *buf;
- int n;
-
- n = dn_expand(msg, msg + msglen, *pp, *buf, *buflen);
- if (n < 0)
- goto enospc; /* Guess. */
- newlen = prune_origin(*buf, origin);
- if ((origin == NULL || origin[0] == '\0' || (*buf)[newlen] == '\0') &&
- (newlen == 0 || (*buf)[newlen - 1] != '.')) {
- /* No trailing dot. */
- if (newlen + 2 > *buflen)
- goto enospc; /* No room for ".\0". */
- (*buf)[newlen++] = '.';
- (*buf)[newlen] = '\0';
- }
- if (newlen == 0) {
- /* Use "@" instead of name. */
- if (newlen + 2 > *buflen)
- goto enospc; /* No room for "@\0". */
- (*buf)[newlen++] = '@';
- (*buf)[newlen] = '\0';
- }
- *pp += n;
- addlen(newlen, buf, buflen);
- **buf = '\0';
- return (newlen);
- enospc:
- errno = ENOSPC;
- *buf = save_buf;
- *buflen = save_buflen;
- return (-1);
-}
-
-static void
-addlen(size_t len, char **buf, size_t *buflen) {
- assert(len <= *buflen);
- *buf += len;
- *buflen -= len;
-}
-
-static int
-addstr(const char *src, size_t len, char **buf, size_t *buflen) {
- if (len > *buflen) {
- errno = ENOSPC;
- return (-1);
- }
- memcpy(*buf, src, len);
- addlen(len, buf, buflen);
- **buf = '\0';
- return (0);
-}
-
-static int
-addtab(size_t len, size_t target, int spaced, char **buf, size_t *buflen) {
- size_t save_buflen = *buflen;
- char *save_buf = *buf;
- int t;
-
- if (spaced || len >= target - 1) {
- T(addstr(" ", 2, buf, buflen));
- spaced = 1;
- } else {
- for (t = (target - len - 1) / 8; t >= 0; t--)
- if (addstr("\t", 1, buf, buflen) < 0) {
- *buflen = save_buflen;
- *buf = save_buf;
- return (-1);
- }
- spaced = 0;
- }
- return (spaced);
-}
diff --git a/c/src/libnetworking/libc/ns_ttl.c b/c/src/libnetworking/libc/ns_ttl.c
deleted file mode 100644
index 75093c1dbc..0000000000
--- a/c/src/libnetworking/libc/ns_ttl.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/* Import. */
-
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-/* Forward. */
-
-static int fmt1(int t, char s, char **buf, size_t *buflen);
-
-/* Macros. */
-
-#define T(x) if ((x) < 0) return (-1); else (void)NULL
-
-/* Public. */
-
-int
-ns_format_ttl(u_long src, char *dst, size_t dstlen) {
- char *odst = dst;
- int secs, mins, hours, days, weeks, x;
- char *p;
-
- secs = src % 60; src /= 60;
- mins = src % 60; src /= 60;
- hours = src % 24; src /= 24;
- days = src % 7; src /= 7;
- weeks = src; src = 0;
-
- x = 0;
- if (weeks) {
- T(fmt1(weeks, 'W', &dst, &dstlen));
- x++;
- }
- if (days) {
- T(fmt1(days, 'D', &dst, &dstlen));
- x++;
- }
- if (hours) {
- T(fmt1(hours, 'H', &dst, &dstlen));
- x++;
- }
- if (mins) {
- T(fmt1(mins, 'M', &dst, &dstlen));
- x++;
- }
- if (secs || !(weeks || days || hours || mins)) {
- T(fmt1(secs, 'S', &dst, &dstlen));
- x++;
- }
-
- if (x > 1) {
- int ch;
-
- for (p = odst; (ch = *p) != '\0'; p++)
- if (isascii(ch) && isupper(ch))
- *p = tolower(ch);
- }
-
- return (dst - odst);
-}
-
-int
-ns_parse_ttl(const char *src, u_long *dst) {
- u_long ttl, tmp;
- int ch, digits, dirty;
-
- ttl = 0;
- tmp = 0;
- digits = 0;
- dirty = 0;
- while ((ch = *src++) != '\0') {
- if (!isascii(ch) || !isprint(ch))
- goto einval;
- if (isdigit(ch)) {
- tmp *= 10;
- tmp += (ch - '0');
- digits++;
- continue;
- }
- if (digits == 0)
- goto einval;
- if (islower(ch))
- ch = toupper(ch);
- switch (ch) {
- case 'W': tmp *= 7;
- case 'D': tmp *= 24;
- case 'H': tmp *= 60;
- case 'M': tmp *= 60;
- case 'S': break;
- default: goto einval;
- }
- ttl += tmp;
- tmp = 0;
- digits = 0;
- dirty = 1;
- }
- if (digits > 0) {
- if (dirty)
- goto einval;
- else
- ttl += tmp;
- }
- *dst = ttl;
- return (0);
-
- einval:
- errno = EINVAL;
- return (-1);
-}
-
-/* Private. */
-
-static int
-fmt1(int t, char s, char **buf, size_t *buflen) {
- char tmp[50];
- size_t len;
-
- len = SPRINTF((tmp, "%d%c", t, s));
- if (len + 1 > *buflen)
- return (-1);
- strcpy(*buf, tmp);
- *buf += len;
- *buflen -= len;
- return (0);
-}
diff --git a/c/src/libnetworking/libc/nsap_addr.c b/c/src/libnetworking/libc/nsap_addr.c
deleted file mode 100644
index a7af57a266..0000000000
--- a/c/src/libnetworking/libc/nsap_addr.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-
-static char
-xtob(c)
- register int c;
-{
- return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
-}
-
-u_int
-inet_nsap_addr(ascii, binary, maxlen)
- const char *ascii;
- u_char *binary;
- int maxlen;
-{
- u_char c, nib;
- u_int len = 0;
-
- while ((c = *ascii++) != '\0' && len < (u_int)maxlen) {
- if (c == '.' || c == '+' || c == '/')
- continue;
- if (!isascii(c))
- return (0);
- if (islower(c))
- c = toupper(c);
- if (isxdigit(c)) {
- nib = xtob(c);
- c = *ascii++;
- if (c != '\0') {
- c = toupper(c);
- if (isxdigit(c)) {
- *binary++ = (nib << 4) | xtob(c);
- len++;
- } else
- return (0);
- }
- else
- return (0);
- }
- else
- return (0);
- }
- return (len);
-}
-
-char *
-inet_nsap_ntoa(binlen, binary, ascii)
- int binlen;
- register const u_char *binary;
- register char *ascii;
-{
- register int nib;
- int i;
- static char tmpbuf[255*3];
- char *start;
-
- if (ascii)
- start = ascii;
- else {
- ascii = tmpbuf;
- start = tmpbuf;
- }
-
- if (binlen > 255)
- binlen = 255;
-
- for (i = 0; i < binlen; i++) {
- nib = *binary >> 4;
- *ascii++ = nib + (nib < 10 ? '0' : '7');
- nib = *binary++ & 0x0f;
- *ascii++ = nib + (nib < 10 ? '0' : '7');
- if (((i % 2) == 0 && (i + 1) < binlen))
- *ascii++ = '.';
- }
- *ascii = '\0';
- return (start);
-}
diff --git a/c/src/libnetworking/libc/rcmd.3 b/c/src/libnetworking/libc/rcmd.3
deleted file mode 100644
index e25057fa4e..0000000000
--- a/c/src/libnetworking/libc/rcmd.3
+++ /dev/null
@@ -1,204 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" From: @(#)rcmd.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd February 15, 1996
-.Dt RCMD 3
-.Os BSD 4.2
-.Sh NAME
-.Nm rcmd ,
-.Nm rresvport ,
-.Nm iruserok ,
-.Nm ruserok
-.Nd routines for returning a stream to a remote command
-.Sh SYNOPSIS
-.Fd #include <unistd.h>
-.Ft int
-.Fn rcmd "char **ahost" "int inport" "const char *locuser" "const char *remuser" "const char *cmd" "int *fd2p"
-.Ft int
-.Fn rresvport "int *port"
-.Ft int
-.Fn iruserok "u_long raddr" "int superuser" "const char *ruser" "const char *luser"
-.Ft int
-.Fn ruserok "const char *rhost" "int superuser" "const char *ruser" "const char *luser"
-.Sh DESCRIPTION
-The
-.Fn rcmd
-function
-is used by the super-user to execute a command on
-a remote machine using an authentication scheme based
-on reserved port numbers.
-The
-.Fn rresvport
-function
-returns a descriptor to a socket
-with an address in the privileged port space.
-The
-.Fn ruserok
-function
-is used by servers
-to authenticate clients requesting service with
-.Fn rcmd .
-All three functions are present in the same file and are used
-by the
-.Xr rshd 8
-server (among others).
-.Pp
-The
-.Fn rcmd
-function
-looks up the host
-.Fa *ahost
-using
-.Xr gethostbyname 3 ,
-returning \-1 if the host does not exist.
-Otherwise
-.Fa *ahost
-is set to the standard name of the host
-and a connection is established to a server
-residing at the well-known Internet port
-.Fa inport .
-.Pp
-If the connection succeeds,
-a socket in the Internet domain of type
-.Dv SOCK_STREAM
-is returned to the caller, and given to the remote
-command as
-.Em stdin
-and
-.Em stdout .
-If
-.Fa fd2p
-is non-zero, then an auxiliary channel to a control
-process will be set up, and a descriptor for it will be placed
-in
-.Fa *fd2p .
-The control process will return diagnostic
-output from the command (unit 2) on this channel, and will also
-accept bytes on this channel as being
-.Tn UNIX
-signal numbers, to be
-forwarded to the process group of the command.
-If
-.Fa fd2p
-is 0, then the
-.Em stderr
-(unit 2 of the remote
-command) will be made the same as the
-.Em stdout
-and no
-provision is made for sending arbitrary signals to the remote process,
-although you may be able to get its attention by using out-of-band data.
-.Pp
-The protocol is described in detail in
-.Xr rshd 8 .
-.Pp
-The
-.Fn rresvport
-function is used to obtain a socket with a privileged
-address bound to it. This socket is suitable for use
-by
-.Fn rcmd
-and several other functions. Privileged Internet ports are those
-in the range 0 to 1023. Only the super-user
-is allowed to bind an address of this sort to a socket.
-.Pp
-The
-.Fn iruserok
-and
-.Fn ruserok
-functions take a remote host's IP address or name, as returned by the
-.Xr gethostbyname 3
-routines, two user names and a flag indicating whether the local user's
-name is that of the super-user.
-Then, if the user is
-.Em NOT
-the super-user, it checks the
-.Pa /etc/hosts.equiv
-file.
-If that lookup is not done, or is unsuccessful, the
-.Pa .rhosts
-in the local user's home directory is checked to see if the request for
-service is allowed.
-.Pp
-If this file does not exist, is not a regular file, is owned by anyone
-other than the user or the super-user, or is writable by anyone other
-than the owner, the check automatically fails.
-Zero is returned if the machine name is listed in the
-.Dq Pa hosts.equiv
-file, or the host and remote user name are found in the
-.Dq Pa .rhosts
-file; otherwise
-.Fn iruserok
-and
-.Fn ruserok
-return \-1.
-If the local domain (as obtained from
-.Xr gethostname 3 )
-is the same as the remote domain, only the machine name need be specified.
-.Pp
-The
-.Fn iruserok
-function is strongly preferred for security reasons.
-It requires trusting the local DNS at most, while the
-.Fn ruserok
-function requires trusting the entire DNS, which can be spoofed.
-.Sh DIAGNOSTICS
-The
-.Fn rcmd
-function
-returns a valid socket descriptor on success.
-It returns \-1 on error and prints a diagnostic message on the standard error.
-.Pp
-The
-.Fn rresvport
-function
-returns a valid, bound socket descriptor on success.
-It returns \-1 on error with the global value
-.Va errno
-set according to the reason for failure.
-The error code
-.Dv EAGAIN
-is overloaded to mean ``All network ports in use.''
-.Sh SEE ALSO
-.Xr rlogin 1 ,
-.Xr rsh 1 ,
-.Xr intro 2 ,
-.Xr rexec 3 ,
-.Xr rexecd 8 ,
-.Xr rlogind 8 ,
-.Xr rshd 8
-.Sh HISTORY
-These
-functions appeared in
-.Bx 4.2 .
diff --git a/c/src/libnetworking/libc/rcmd.c b/c/src/libnetworking/libc/rcmd.c
deleted file mode 100644
index 32e4953e9b..0000000000
--- a/c/src/libnetworking/libc/rcmd.c
+++ /dev/null
@@ -1,520 +0,0 @@
-/*
- * Copyright (c) 1983, 1993, 1994
- * 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <signal.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <unistd.h>
-#include <pwd.h>
-#include <errno.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-extern int innetgr __P(( const char *, const char *, const char *, const char * ));
-
-#define max(a, b) ((a > b) ? a : b)
-
-int __ivaliduser __P((FILE *, u_long, const char *, const char *));
-static int __icheckhost __P((u_long, char *));
-
-int
-rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
- char **ahost;
- u_short rport;
- const char *locuser, *remuser, *cmd;
- int *fd2p;
-{
- struct hostent *hp;
- struct sockaddr_in sin, from;
- fd_set reads;
- long oldmask;
- pid_t pid;
- int s, lport, timo;
- char c;
-
- pid = getpid();
- hp = gethostbyname(*ahost);
- if (hp == NULL) {
- herror(*ahost);
- return (-1);
- }
- *ahost = hp->h_name;
- oldmask = sigblock(sigmask(SIGURG));
- for (timo = 1, lport = IPPORT_RESERVED - 1;;) {
- s = rresvport(&lport);
- if (s < 0) {
- if (errno == EAGAIN)
- (void)fprintf(stderr,
- "rcmd: socket: All ports in use\n");
- else
- (void)fprintf(stderr, "rcmd: socket: %s\n",
- strerror(errno));
- sigsetmask(oldmask);
- return (-1);
- }
- fcntl(s, F_SETOWN, pid);
- bzero(&sin, sizeof sin);
- sin.sin_len = sizeof(struct sockaddr_in);
- sin.sin_family = hp->h_addrtype;
- sin.sin_port = rport;
- bcopy(hp->h_addr_list[0], &sin.sin_addr, MIN(hp->h_length, sizeof sin.sin_addr));
- if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
- break;
- (void)close(s);
- if (errno == EADDRINUSE) {
- lport--;
- continue;
- }
- if (errno == ECONNREFUSED && timo <= 16) {
- (void)sleep(timo);
- timo *= 2;
- continue;
- }
- if (hp->h_addr_list[1] != NULL) {
- int oerrno = errno;
-
- (void)fprintf(stderr, "connect to address %s: ",
- inet_ntoa(sin.sin_addr));
- errno = oerrno;
- perror(0);
- hp->h_addr_list++;
- bcopy(hp->h_addr_list[0], &sin.sin_addr, MIN(hp->h_length, sizeof sin.sin_addr));
- (void)fprintf(stderr, "Trying %s...\n",
- inet_ntoa(sin.sin_addr));
- continue;
- }
- (void)fprintf(stderr, "%s: %s\n", hp->h_name, strerror(errno));
- sigsetmask(oldmask);
- return (-1);
- }
- lport--;
- if (fd2p == 0) {
- write(s, "", 1);
- lport = 0;
- } else {
- char num[8];
- int s2 = rresvport(&lport), s3;
- int len = sizeof(from);
- int nfds;
-
- if (s2 < 0)
- goto bad;
- listen(s2, 1);
- (void)snprintf(num, sizeof(num), "%d", lport);
- if (write(s, num, strlen(num)+1) != strlen(num)+1) {
- (void)fprintf(stderr,
- "rcmd: write (setting up stderr): %s\n",
- strerror(errno));
- (void)close(s2);
- goto bad;
- }
- nfds = max(s, s2)+1;
- if(nfds > FD_SETSIZE) {
- fprintf(stderr, "rcmd: too many files\n");
- (void)close(s2);
- goto bad;
- }
-again:
- FD_ZERO(&reads);
- FD_SET(s, &reads);
- FD_SET(s2, &reads);
- errno = 0;
- if (select(nfds, &reads, 0, 0, 0) < 1 || !FD_ISSET(s2, &reads)){
- if (errno != 0)
- (void)fprintf(stderr,
- "rcmd: select (setting up stderr): %s\n",
- strerror(errno));
- else
- (void)fprintf(stderr,
- "select: protocol failure in circuit setup\n");
- (void)close(s2);
- goto bad;
- }
- s3 = accept(s2, (struct sockaddr *)&from, &len);
- /*
- * XXX careful for ftp bounce attacks. If discovered, shut them
- * down and check for the real auxiliary channel to connect.
- */
- if (from.sin_family == AF_INET && from.sin_port == htons(20)) {
- close(s3);
- goto again;
- }
- (void)close(s2);
- if (s3 < 0) {
- (void)fprintf(stderr,
- "rcmd: accept: %s\n", strerror(errno));
- lport = 0;
- goto bad;
- }
- *fd2p = s3;
- from.sin_port = ntohs((u_short)from.sin_port);
- if (from.sin_family != AF_INET ||
- from.sin_port >= IPPORT_RESERVED ||
- from.sin_port < IPPORT_RESERVED / 2) {
- (void)fprintf(stderr,
- "socket: protocol failure in circuit setup.\n");
- goto bad2;
- }
- }
- (void)write(s, locuser, strlen(locuser)+1);
- (void)write(s, remuser, strlen(remuser)+1);
- (void)write(s, cmd, strlen(cmd)+1);
- if (read(s, &c, 1) != 1) {
- (void)fprintf(stderr,
- "rcmd: %s: %s\n", *ahost, strerror(errno));
- goto bad2;
- }
- if (c != 0) {
- while (read(s, &c, 1) == 1) {
- (void)write(STDERR_FILENO, &c, 1);
- if (c == '\n')
- break;
- }
- goto bad2;
- }
- sigsetmask(oldmask);
- return (s);
-bad2:
- if (lport)
- (void)close(*fd2p);
-bad:
- (void)close(s);
- sigsetmask(oldmask);
- return (-1);
-}
-
-int
-rresvport(alport)
- int *alport;
-{
- struct sockaddr_in sin;
- int s;
-
- bzero(&sin, sizeof sin);
- sin.sin_len = sizeof(struct sockaddr_in);
- sin.sin_family = AF_INET;
- sin.sin_addr.s_addr = INADDR_ANY;
- s = socket(AF_INET, SOCK_STREAM, 0);
- if (s < 0)
- return (-1);
-#if 0 /* compat_exact_traditional_rresvport_semantics */
- sin.sin_port = htons((u_short)*alport);
- if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
- return (s);
- if (errno != EADDRINUSE) {
- (void)close(s);
- return (-1);
- }
-#endif
- sin.sin_port = 0;
- if (bindresvport(s, &sin) == -1) {
- (void)close(s);
- return (-1);
- }
- *alport = (int)ntohs(sin.sin_port);
- return (s);
-}
-
-int __check_rhosts_file = 1;
-char *__rcmd_errstr;
-
-int
-ruserok(rhost, superuser, ruser, luser)
- const char *rhost, *ruser, *luser;
- int superuser;
-{
- struct hostent *hp;
- u_long addr;
- char **ap;
-
- if ((hp = gethostbyname(rhost)) == NULL)
- return (-1);
- for (ap = hp->h_addr_list; *ap; ++ap) {
- bcopy(*ap, &addr, sizeof(addr));
- if (iruserok(addr, superuser, ruser, luser) == 0)
- return (0);
- }
- return (-1);
-}
-
-/*
- * New .rhosts strategy: We are passed an ip address. We spin through
- * hosts.equiv and .rhosts looking for a match. When the .rhosts only
- * has ip addresses, we don't have to trust a nameserver. When it
- * contains hostnames, we spin through the list of addresses the nameserver
- * gives us and look for a match.
- *
- * Returns 0 if ok, -1 if not ok.
- */
-int
-iruserok(raddr, superuser, ruser, luser)
- u_long raddr;
- int superuser;
- const char *ruser, *luser;
-{
- register char *cp;
- struct stat sbuf;
- struct passwd *pwd;
- FILE *hostf;
- uid_t uid;
- int first;
- char pbuf[MAXPATHLEN];
-
- first = 1;
- hostf = superuser ? NULL : fopen(_PATH_HEQUIV, "r");
-again:
- if (hostf) {
- if (__ivaliduser(hostf, raddr, luser, ruser) == 0) {
- (void)fclose(hostf);
- return (0);
- }
- (void)fclose(hostf);
- }
- if (first == 1 && (__check_rhosts_file || superuser)) {
- first = 0;
- if ((pwd = getpwnam(luser)) == NULL)
- return (-1);
- (void)strcpy(pbuf, pwd->pw_dir);
- (void)strcat(pbuf, "/.rhosts");
-
- /*
- * Change effective uid while opening .rhosts. If root and
- * reading an NFS mounted file system, can't read files that
- * are protected read/write owner only.
- */
- uid = geteuid();
- (void)seteuid(pwd->pw_uid);
- hostf = fopen(pbuf, "r");
- (void)seteuid(uid);
-
- if (hostf == NULL)
- return (-1);
- /*
- * If not a regular file, or is owned by someone other than
- * user or root or if writeable by anyone but the owner, quit.
- */
- cp = NULL;
- if (lstat(pbuf, &sbuf) < 0)
- cp = ".rhosts lstat failed";
- else if (!S_ISREG(sbuf.st_mode))
- cp = ".rhosts not regular file";
- else if (fstat(fileno(hostf), &sbuf) < 0)
- cp = ".rhosts fstat failed";
- else if (sbuf.st_uid && sbuf.st_uid != pwd->pw_uid)
- cp = "bad .rhosts owner";
- else if (sbuf.st_mode & (S_IWGRP|S_IWOTH))
- cp = ".rhosts writeable by other than owner";
- /* If there were any problems, quit. */
- if (cp) {
- __rcmd_errstr = cp;
- (void)fclose(hostf);
- return (-1);
- }
- goto again;
- }
- return (-1);
-}
-
-/*
- * XXX
- * Don't make static, used by lpd(8).
- *
- * Returns 0 if ok, -1 if not ok.
- */
-int
-__ivaliduser(hostf, raddr, luser, ruser)
- FILE *hostf;
- u_long raddr;
- const char *luser, *ruser;
-{
- register char *user, *p;
- int ch;
- char buf[MAXHOSTNAMELEN + 128]; /* host + login */
- char hname[MAXHOSTNAMELEN];
- struct hostent *hp;
- /* Presumed guilty until proven innocent. */
- int userok = 0, hostok = 0;
-#ifdef YP
- char *ypdomain;
-
- if (yp_get_default_domain(&ypdomain))
- ypdomain = NULL;
-#else
-#define ypdomain NULL
-#endif
- /* We need to get the damn hostname back for netgroup matching. */
- if ((hp = gethostbyaddr((char *)&raddr, sizeof(u_long),
- AF_INET)) == NULL)
- return (-1);
- strncpy(hname, hp->h_name, sizeof(hname));
- hname[sizeof(hname) - 1] = '\0';
-
- while (fgets(buf, sizeof(buf), hostf)) {
- p = buf;
- /* Skip lines that are too long. */
- if (strchr(p, '\n') == NULL) {
- while ((ch = getc(hostf)) != '\n' && ch != EOF);
- continue;
- }
- if (*p == '\n' || *p == '#') {
- /* comment... */
- continue;
- }
- while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') {
- *p = isupper(*p) ? tolower(*p) : *p;
- p++;
- }
- if (*p == ' ' || *p == '\t') {
- *p++ = '\0';
- while (*p == ' ' || *p == '\t')
- p++;
- user = p;
- while (*p != '\n' && *p != ' ' &&
- *p != '\t' && *p != '\0')
- p++;
- } else
- user = p;
- *p = '\0';
- /*
- * Do +/- and +@/-@ checking. This looks really nasty,
- * but it matches SunOS's behavior so far as I can tell.
- */
- switch(buf[0]) {
- case '+':
- if (!buf[1]) { /* '+' matches all hosts */
- hostok = 1;
- break;
- }
- if (buf[1] == '@') /* match a host by netgroup */
- hostok = innetgr((char *)&buf[2],
- (char *)&hname, NULL, ypdomain);
- else /* match a host by addr */
- hostok = __icheckhost(raddr,(char *)&buf[1]);
- break;
- case '-': /* reject '-' hosts and all their users */
- if (buf[1] == '@') {
- if (innetgr((char *)&buf[2],
- (char *)&hname, NULL, ypdomain))
- return(-1);
- } else {
- if (__icheckhost(raddr,(char *)&buf[1]))
- return(-1);
- }
- break;
- default: /* if no '+' or '-', do a simple match */
- hostok = __icheckhost(raddr, buf);
- break;
- }
- switch(*user) {
- case '+':
- if (!*(user+1)) { /* '+' matches all users */
- userok = 1;
- break;
- }
- if (*(user+1) == '@') /* match a user by netgroup */
- userok = innetgr(user+2, NULL, ruser, ypdomain);
- else /* match a user by direct specification */
- userok = !(strcmp(ruser, user+1));
- break;
- case '-': /* if we matched a hostname, */
- if (hostok) { /* check for user field rejections */
- if (!*(user+1))
- return(-1);
- if (*(user+1) == '@') {
- if (innetgr(user+2, NULL,
- ruser, ypdomain))
- return(-1);
- } else {
- if (!strcmp(ruser, user+1))
- return(-1);
- }
- }
- break;
- default: /* no rejections: try to match the user */
- if (hostok)
- userok = !(strcmp(ruser,*user ? user : luser));
- break;
- }
- if (hostok && userok)
- return(0);
- }
- return (-1);
-}
-
-/*
- * Returns "true" if match, 0 if no match.
- */
-static int
-__icheckhost(raddr, lhost)
- u_long raddr;
- register char *lhost;
-{
- register struct hostent *hp;
- register u_long laddr;
- register char **pp;
-
- /* Try for raw ip address first. */
- if (isdigit(*lhost) && (long)(laddr = inet_addr(lhost)) != -1)
- return (raddr == laddr);
-
- /* Better be a hostname. */
- if ((hp = gethostbyname(lhost)) == NULL)
- return (0);
-
- /* Spin through ip addresses. */
- for (pp = hp->h_addr_list; *pp; ++pp)
- if (!bcmp(&raddr, *pp, sizeof(u_long)))
- return (1);
-
- /* No match. */
- return (0);
-}
diff --git a/c/src/libnetworking/libc/recv.c b/c/src/libnetworking/libc/recv.c
deleted file mode 100644
index a842244caf..0000000000
--- a/c/src/libnetworking/libc/recv.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)recv.c 8.2 (Berkeley) 2/21/94";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <stddef.h>
-
-ssize_t
-recv(s, buf, len, flags)
- int s, flags;
- size_t len;
- void *buf;
-{
- return (recvfrom(s, buf, len, flags, NULL, 0));
-}
diff --git a/c/src/libnetworking/libc/res_comp.c b/c/src/libnetworking/libc/res_comp.c
deleted file mode 100644
index 93043276f2..0000000000
--- a/c/src/libnetworking/libc/res_comp.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright (c) 1985, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: res_comp.c,v 8.11 1997/05/21 19:31:04 halley Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#define BIND_4_COMPAT
-
-/*
- * Expand compressed domain name 'comp_dn' to full domain name.
- * 'msg' is a pointer to the begining of the message,
- * 'eomorig' points to the first location after the message,
- * 'exp_dn' is a pointer to a buffer of size 'length' for the result.
- * Return size of compressed name or -1 if there was an error.
- */
-int
-dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
- char *dst, int dstsiz)
-{
- int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);
-
- if (n > 0 && dst[0] == '.')
- dst[0] = '\0';
- return (n);
-}
-
-/*
- * Pack domain name 'exp_dn' in presentation form into 'comp_dn'.
- * Return the size of the compressed name or -1.
- * 'length' is the size of the array pointed to by 'comp_dn'.
- */
-int
-dn_comp(const char *src, u_char *dst, int dstsiz,
- u_char **dnptrs, u_char **lastdnptr)
-{
- return (ns_name_compress(src, dst, (size_t)dstsiz,
- (const u_char **)dnptrs,
- (const u_char **)lastdnptr));
-}
-
-/*
- * Skip over a compressed domain name. Return the size or -1.
- */
-int
-dn_skipname(const u_char *ptr, const u_char *eom) {
- const u_char *saveptr = ptr;
-
- if (ns_name_skip(&ptr, eom) == -1)
- return (-1);
- return (ptr - saveptr);
-}
-
-/*
- * Verify that a domain name uses an acceptable character set.
- */
-
-/*
- * Note the conspicuous absence of ctype macros in these definitions. On
- * non-ASCII hosts, we can't depend on string literals or ctype macros to
- * tell us anything about network-format data. The rest of the BIND system
- * is not careful about this, but for some reason, we're doing it right here.
- */
-#define PERIOD 0x2e
-#define hyphenchar(c) ((c) == 0x2d)
-#define bslashchar(c) ((c) == 0x5c)
-#define periodchar(c) ((c) == PERIOD)
-#define asterchar(c) ((c) == 0x2a)
-#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \
- || ((c) >= 0x61 && (c) <= 0x7a))
-#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
-
-#define borderchar(c) (alphachar(c) || digitchar(c))
-#define middlechar(c) (borderchar(c) || hyphenchar(c))
-#define domainchar(c) ((c) > 0x20 && (c) < 0x7f)
-
-int
-res_hnok(dn)
- const char *dn;
-{
- int ppch = '\0', pch = PERIOD, ch = *dn++;
-
- while (ch != '\0') {
- int nch = *dn++;
-
- if (periodchar(ch)) {
- (void)NULL;
- } else if (periodchar(pch)) {
- if (!borderchar(ch))
- return (0);
- } else if (periodchar(nch) || nch == '\0') {
- if (!borderchar(ch))
- return (0);
- } else {
- if (!middlechar(ch))
- return (0);
- }
- ppch = pch, pch = ch, ch = nch;
- }
- return (1);
-}
-
-/*
- * hostname-like (A, MX, WKS) owners can have "*" as their first label
- * but must otherwise be as a host name.
- */
-int
-res_ownok(dn)
- const char *dn;
-{
- if (asterchar(dn[0])) {
- if (periodchar(dn[1]))
- return (res_hnok(dn+2));
- if (dn[1] == '\0')
- return (1);
- }
- return (res_hnok(dn));
-}
-
-/*
- * SOA RNAMEs and RP RNAMEs can have any printable character in their first
- * label, but the rest of the name has to look like a host name.
- */
-int
-res_mailok(dn)
- const char *dn;
-{
- int ch, escaped = 0;
-
- /* "." is a valid missing representation */
- if (*dn == '\0')
- return (1);
-
- /* otherwise <label>.<hostname> */
- while ((ch = *dn++) != '\0') {
- if (!domainchar(ch))
- return (0);
- if (!escaped && periodchar(ch))
- break;
- if (escaped)
- escaped = 0;
- else if (bslashchar(ch))
- escaped = 1;
- }
- if (periodchar(ch))
- return (res_hnok(dn));
- return (0);
-}
-
-/*
- * This function is quite liberal, since RFC 1034's character sets are only
- * recommendations.
- */
-int
-res_dnok(dn)
- const char *dn;
-{
- int ch;
-
- while ((ch = *dn++) != '\0')
- if (!domainchar(ch))
- return (0);
- return (1);
-}
-
-#ifdef BIND_4_COMPAT
-/*
- * This module must export the following externally-visible symbols:
- * ___putlong
- * ___putshort
- * __getlong
- * __getshort
- * Note that one _ comes from C and the others come from us.
- */
-void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); }
-void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); }
-u_int32_t _getlong(const u_char *src) { return (ns_get32(src)); }
-u_int16_t _getshort(const u_char *src) { return (ns_get16(src)); }
-#endif /*BIND_4_COMPAT*/
diff --git a/c/src/libnetworking/libc/res_config.h b/c/src/libnetworking/libc/res_config.h
deleted file mode 100644
index 57ec414226..0000000000
--- a/c/src/libnetworking/libc/res_config.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * $Id$
- */
-
-#define DEBUG 1 /* enable debugging code (needed for dig) */
-#define RESOLVSORT /* allow sorting of addresses in gethostbyname */
-#define RFC1535 /* comply with RFC1535 (STRONGLY reccomended by vixie)*/
-#undef USELOOPBACK /* res_init() bind to localhost */
-#undef SUNSECURITY /* verify gethostbyaddr() calls - WE DONT NEED IT */
-#define MULTI_PTRS_ARE_ALIASES 1 /* fold multiple PTR records into aliases */
-#define CHECK_SRVR_ADDR 1 /* confirm that the server requested sent the reply */
-#define BIND_UPDATE 1 /* update support */
-
-#if defined(__rtems__)
-u_int16_t _getshort(const u_char *src);
-u_int32_t _getlong(const u_char *src);
-int gethostname (char *name, int namelen);
-int sethostname (char *name, int namelen);
-int issetugid (void);
-#endif
diff --git a/c/src/libnetworking/libc/res_data.c b/c/src/libnetworking/libc/res_data.c
deleted file mode 100644
index fb7d2c66eb..0000000000
--- a/c/src/libnetworking/libc/res_data.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 1995,1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "res_config.h"
-
-const char *_res_opcodes[] = {
- "QUERY",
- "IQUERY",
- "CQUERYM",
- "CQUERYU", /* experimental */
- "NOTIFY", /* experimental */
- "UPDATE",
- "6",
- "7",
- "8",
- "9",
- "10",
- "11",
- "12",
- "13",
- "ZONEINIT",
- "ZONEREF",
-};
-
-const char *_res_resultcodes[] = {
- "NOERROR",
- "FORMERR",
- "SERVFAIL",
- "NXDOMAIN",
- "NOTIMP",
- "REFUSED",
- "YXDOMAIN",
- "YXRRSET",
- "NXRRSET",
- "NOTAUTH",
- "ZONEERR",
- "11",
- "12",
- "13",
- "14",
- "NOCHANGE",
-};
-
-#ifdef BIND_UPDATE
-const char *_res_sectioncodes[] = {
- "ZONE",
- "PREREQUISITES",
- "UPDATE",
- "ADDITIONAL",
-};
-#endif
diff --git a/c/src/libnetworking/libc/res_debug.c b/c/src/libnetworking/libc/res_debug.c
deleted file mode 100644
index b747b6e6d2..0000000000
--- a/c/src/libnetworking/libc/res_debug.c
+++ /dev/null
@@ -1,966 +0,0 @@
-/*
- * Copyright (c) 1985
- * 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1995 by International Business Machines, Inc.
- *
- * International Business Machines, Inc. (hereinafter called IBM) grants
- * permission under its copyrights to use, copy, modify, and distribute this
- * Software with or without fee, provided that the above copyright notice and
- * all paragraphs of this notice appear in all copies, and that the name of IBM
- * not be used in connection with the marketing of any product incorporating
- * the Software or modifications thereof, without specific, written prior
- * permission.
- *
- * To the extent it has a right to do so, IBM grants an immunity from suit
- * under its patents, if any, for the use, sale or manufacture of products to
- * the extent that such products are used for performing Domain Name System
- * dynamic updates in TCP/IP networks by means of the Software. No immunity is
- * granted for any product per se or for any other function of any product.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <math.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#define SPRINTF(x) sprintf x
-
-extern const char *_res_opcodes[];
-extern const char *_res_resultcodes[];
-extern const char *_res_sectioncodes[];
-
-/*
- * Print the current options.
- */
-void
-fp_resstat(struct __res_state *statp, FILE *file) {
- u_long mask;
-
- fprintf(file, ";; res options:");
- if (!statp)
- statp = &_res;
- for (mask = 1; mask != 0; mask <<= 1)
- if (statp->options & mask)
- fprintf(file, " %s", p_option(mask));
- putc('\n', file);
-}
-
-static void
-do_section(ns_msg *handle, ns_sect section, int pflag, FILE *file) {
- int n, sflag, rrnum;
- char buf[2048]; /* XXX need to malloc */
- ns_opcode opcode;
- ns_rr rr;
-
- /*
- * Print answer records.
- */
- sflag = (_res.pfcode & pflag);
- if (_res.pfcode && !sflag)
- return;
-
- opcode = ns_msg_getflag(*handle, ns_f_opcode);
- rrnum = 0;
- for (;;) {
- if (ns_parserr(handle, section, rrnum, &rr)) {
- if (errno != ENODEV)
- fprintf(file, ";; ns_parserr: %s\n",
- strerror(errno));
- else if (rrnum > 0 && sflag != 0 &&
- (_res.pfcode & RES_PRF_HEAD1))
- putc('\n', file);
- return;
- }
- if (rrnum == 0 && sflag != 0 && (_res.pfcode & RES_PRF_HEAD1))
- fprintf(file, ";; %s SECTION:\n",
- p_section(section, opcode));
- if (section == ns_s_qd)
- fprintf(file, ";;\t%s, type = %s, class = %s\n",
- ns_rr_name(rr),
- p_type(ns_rr_type(rr)),
- p_class(ns_rr_class(rr)));
- else {
- n = ns_sprintrr(handle, &rr, NULL, NULL,
- buf, sizeof buf);
- if (n < 0) {
- fprintf(file, ";; ns_sprintrr: %s\n",
- strerror(errno));
- return;
- }
- fputs(buf, file);
- fputc('\n', file);
- }
- rrnum++;
- }
-}
-
-void
-p_query(const u_char *msg) {
- fp_query(msg, stdout);
-}
-
-void
-fp_query(const u_char *msg, FILE *file) {
- fp_nquery(msg, PACKETSZ, file);
-}
-
-/*
- * Print the contents of a query.
- * This is intended to be primarily a debugging routine.
- */
-void
-fp_nquery(const u_char *msg, int len, FILE *file) {
- ns_msg handle;
- int qdcount, ancount, nscount, arcount;
- u_int opcode, rcode, id;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1)
- return;
-
- if (ns_initparse(msg, len, &handle) < 0) {
- fprintf(file, ";; ns_initparse: %s\n", strerror(errno));
- return;
- }
- opcode = ns_msg_getflag(handle, ns_f_opcode);
- rcode = ns_msg_getflag(handle, ns_f_rcode);
- id = ns_msg_id(handle);
- qdcount = ns_msg_count(handle, ns_s_qd);
- ancount = ns_msg_count(handle, ns_s_an);
- nscount = ns_msg_count(handle, ns_s_ns);
- arcount = ns_msg_count(handle, ns_s_ar);
-
- /*
- * Print header fields.
- */
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEADX) || rcode)
- fprintf(file,
- ";; ->>HEADER<<- opcode: %s, status: %s, id: %d\n",
- _res_opcodes[opcode], _res_resultcodes[rcode], id);
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEADX))
- putc(';', file);
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEAD2)) {
- fprintf(file, "; flags:");
- if (ns_msg_getflag(handle, ns_f_qr))
- fprintf(file, " qr");
- if (ns_msg_getflag(handle, ns_f_aa))
- fprintf(file, " aa");
- if (ns_msg_getflag(handle, ns_f_tc))
- fprintf(file, " tc");
- if (ns_msg_getflag(handle, ns_f_rd))
- fprintf(file, " rd");
- if (ns_msg_getflag(handle, ns_f_ra))
- fprintf(file, " ra");
- if (ns_msg_getflag(handle, ns_f_z))
- fprintf(file, " ??");
- if (ns_msg_getflag(handle, ns_f_ad))
- fprintf(file, " ad");
- if (ns_msg_getflag(handle, ns_f_cd))
- fprintf(file, " cd");
- }
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEAD1)) {
- fprintf(file, "; %s: %d",
- p_section(ns_s_qd, opcode), qdcount);
- fprintf(file, ", %s: %d",
- p_section(ns_s_an, opcode), ancount);
- fprintf(file, ", %s: %d",
- p_section(ns_s_ns, opcode), nscount);
- fprintf(file, ", %s: %d",
- p_section(ns_s_ar, opcode), arcount);
- }
- if ((!_res.pfcode) || (_res.pfcode &
- (RES_PRF_HEADX | RES_PRF_HEAD2 | RES_PRF_HEAD1))) {
- putc('\n',file);
- }
- /*
- * Print the various sections.
- */
- do_section(&handle, ns_s_qd, RES_PRF_QUES, file);
- do_section(&handle, ns_s_an, RES_PRF_ANS, file);
- do_section(&handle, ns_s_ns, RES_PRF_AUTH, file);
- do_section(&handle, ns_s_ar, RES_PRF_ADD, file);
- if (qdcount == 0 && ancount == 0 &&
- nscount == 0 && arcount == 0)
- putc('\n', file);
-}
-
-const u_char *
-p_cdnname(const u_char *cp, const u_char *msg, int len, FILE *file) {
- char name[MAXDNAME];
- int n;
-
- if ((n = dn_expand(msg, msg + len, cp, name, sizeof name)) < 0)
- return (NULL);
- if (name[0] == '\0')
- putc('.', file);
- else
- fputs(name, file);
- return (cp + n);
-}
-
-const u_char *
-p_cdname(const u_char *cp, const u_char *msg, FILE *file) {
- return (p_cdnname(cp, msg, PACKETSZ, file));
-}
-
-/* Return a fully-qualified domain name from a compressed name (with
- length supplied). */
-
-const u_char *
-p_fqnname(cp, msg, msglen, name, namelen)
- const u_char *cp, *msg;
- int msglen;
- char *name;
- int namelen;
-{
- int n, newlen;
-
- if ((n = dn_expand(msg, cp + msglen, cp, name, namelen)) < 0)
- return (NULL);
- newlen = strlen(name);
- if (newlen == 0 || name[newlen - 1] != '.') {
- if (newlen + 1 >= namelen) /* Lack space for final dot */
- return (NULL);
- else
- strcpy(name + newlen, ".");
- }
- return (cp + n);
-}
-
-/* XXX: the rest of these functions need to become length-limited, too. */
-
-const u_char *
-p_fqname(const u_char *cp, const u_char *msg, FILE *file) {
- char name[MAXDNAME];
- const u_char *n;
-
- n = p_fqnname(cp, msg, MAXCDNAME, name, sizeof name);
- if (n == NULL)
- return (NULL);
- fputs(name, file);
- return (n);
-}
-
-/*
- * Names of RR classes and qclasses. Classes and qclasses are the same, except
- * that C_ANY is a qclass but not a class. (You can ask for records of class
- * C_ANY, but you can't have any records of that class in the database.)
- */
-const struct res_sym __p_class_syms[] = {
- {C_IN, "IN"},
- {C_CHAOS, "CHAOS"},
- {C_HS, "HS"},
- {C_HS, "HESIOD"},
- {C_ANY, "ANY"},
- {C_NONE, "NONE"},
- {C_IN, (char *)0}
-};
-
-/*
- * Names of message sections.
- */
-const struct res_sym __p_default_section_syms[] = {
- {ns_s_qd, "QUERY"},
- {ns_s_an, "ANSWER"},
- {ns_s_ns, "AUTHORITY"},
- {ns_s_ar, "ADDITIONAL"},
- {0, (char *)0}
-};
-
-const struct res_sym __p_update_section_syms[] = {
- {S_ZONE, "ZONE"},
- {S_PREREQ, "PREREQUISITE"},
- {S_UPDATE, "UPDATE"},
- {S_ADDT, "ADDITIONAL"},
- {0, (char *)0}
-};
-
-/*
- * Names of RR types and qtypes. Types and qtypes are the same, except
- * that T_ANY is a qtype but not a type. (You can ask for records of type
- * T_ANY, but you can't have any records of that type in the database.)
- */
-const struct res_sym __p_type_syms[] = {
- {T_A, "A", "address"},
- {T_NS, "NS", "name server"},
- {T_MD, "MD", "mail destination (deprecated)"},
- {T_MF, "MF", "mail forwarder (deprecated)"},
- {T_CNAME, "CNAME", "canonical name"},
- {T_SOA, "SOA", "start of authority"},
- {T_MB, "MB", "mailbox"},
- {T_MG, "MG", "mail group member"},
- {T_MR, "MR", "mail rename"},
- {T_NULL, "NULL", "null"},
- {T_WKS, "WKS", "well-known service (deprecated)"},
- {T_PTR, "PTR", "domain name pointer"},
- {T_HINFO, "HINFO", "host information"},
- {T_MINFO, "MINFO", "mailbox information"},
- {T_MX, "MX", "mail exchanger"},
- {T_TXT, "TXT", "text"},
- {T_RP, "RP", "responsible person"},
- {T_AFSDB, "AFSDB", "DCE or AFS server"},
- {T_X25, "X25", "X25 address"},
- {T_ISDN, "ISDN", "ISDN address"},
- {T_RT, "RT", "router"},
- {T_NSAP, "NSAP", "nsap address"},
- {T_NSAP_PTR, "NSAP_PTR", "domain name pointer"},
- {T_SIG, "SIG", "signature"},
- {T_KEY, "KEY", "key"},
- {T_PX, "PX", "mapping information"},
- {T_GPOS, "GPOS", "geographical position (withdrawn)"},
- {T_AAAA, "AAAA", "IPv6 address"},
- {T_LOC, "LOC", "location"},
- {T_NXT, "NXT", "next valid name (unimplemented)"},
- {T_EID, "EID", "endpoint identifier (unimplemented)"},
- {T_NIMLOC, "NIMLOC", "NIMROD locator (unimplemented)"},
- {T_SRV, "SRV", "server selection"},
- {T_ATMA, "ATMA", "ATM address (unimplemented)"},
- {T_IXFR, "IXFR", "incremental zone transfer"},
- {T_AXFR, "AXFR", "zone transfer"},
- {T_MAILB, "MAILB", "mailbox-related data (deprecated)"},
- {T_MAILA, "MAILA", "mail agent (deprecated)"},
- {T_NAPTR, "NAPTR", "URN Naming Authority"},
- {T_ANY, "ANY", "\"any\""},
- {0, NULL, NULL}
-};
-
-int
-sym_ston(const struct res_sym *syms, const char *name, int *success) {
- for ((void)NULL; syms->name != 0; syms++) {
- if (strcasecmp (name, syms->name) == 0) {
- if (success)
- *success = 1;
- return (syms->number);
- }
- }
- if (success)
- *success = 0;
- return (syms->number); /* The default value. */
-}
-
-const char *
-sym_ntos(const struct res_sym *syms, int number, int *success) {
- static char unname[20];
-
- for ((void)NULL; syms->name != 0; syms++) {
- if (number == syms->number) {
- if (success)
- *success = 1;
- return (syms->name);
- }
- }
-
- sprintf(unname, "%d", number);
- if (success)
- *success = 0;
- return (unname);
-}
-
-const char *
-sym_ntop(const struct res_sym *syms, int number, int *success) {
- static char unname[20];
-
- for ((void)NULL; syms->name != 0; syms++) {
- if (number == syms->number) {
- if (success)
- *success = 1;
- return (syms->humanname);
- }
- }
- sprintf(unname, "%d", number);
- if (success)
- *success = 0;
- return (unname);
-}
-
-/*
- * Return a string for the type.
- */
-const char *
-p_type(int type) {
- return (sym_ntos(__p_type_syms, type, (int *)0));
-}
-
-/*
- * Return a string for the type.
- */
-const char *
-p_section(int section, int opcode) {
- const struct res_sym *symbols;
-
- switch (opcode) {
- case ns_o_update:
- symbols = __p_update_section_syms;
- break;
- default:
- symbols = __p_default_section_syms;
- break;
- }
- return (sym_ntos(symbols, section, (int *)0));
-}
-
-/*
- * Return a mnemonic for class.
- */
-const char *
-p_class(int class) {
- return (sym_ntos(__p_class_syms, class, (int *)0));
-}
-
-/*
- * Return a mnemonic for an option
- */
-const char *
-p_option(u_long option) {
- static char nbuf[40];
-
- switch (option) {
- case RES_INIT: return "init";
- case RES_DEBUG: return "debug";
- case RES_AAONLY: return "aaonly(unimpl)";
- case RES_USEVC: return "usevc";
- case RES_PRIMARY: return "primry(unimpl)";
- case RES_IGNTC: return "igntc";
- case RES_RECURSE: return "recurs";
- case RES_DEFNAMES: return "defnam";
- case RES_STAYOPEN: return "styopn";
- case RES_DNSRCH: return "dnsrch";
- case RES_INSECURE1: return "insecure1";
- case RES_INSECURE2: return "insecure2";
- default: sprintf(nbuf, "?0x%lx?", (u_long)option);
- return (nbuf);
- }
-}
-
-/*
- * Return a mnemonic for a time to live.
- */
-const char *
-p_time(u_int32_t value) {
- static char nbuf[40];
-
- if (ns_format_ttl(value, nbuf, sizeof nbuf) < 0)
- sprintf(nbuf, "%u", value);
- return (nbuf);
-}
-
-
-/*
- * routines to convert between on-the-wire RR format and zone file format.
- * Does not contain conversion to/from decimal degrees; divide or multiply
- * by 60*60*1000 for that.
- */
-
-static unsigned int poweroften[10] = {1, 10, 100, 1000, 10000, 100000,
- 1000000,10000000,100000000,1000000000};
-
-/* takes an XeY precision/size value, returns a string representation. */
-static const char *
-precsize_ntoa(prec)
- u_int8_t prec;
-{
- static char retbuf[sizeof "90000000.00"];
- unsigned long val;
- int mantissa, exponent;
-
- mantissa = (int)((prec >> 4) & 0x0f) % 10;
- exponent = (int)((prec >> 0) & 0x0f) % 10;
-
- val = mantissa * poweroften[exponent];
-
- (void) sprintf(retbuf, "%ld.%.2ld", val/100, val%100);
- return (retbuf);
-}
-
-/* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */
-static u_int8_t
-precsize_aton(strptr)
- char **strptr;
-{
- unsigned int mval = 0, cmval = 0;
- u_int8_t retval = 0;
- char *cp;
- int exponent;
- int mantissa;
-
- cp = *strptr;
-
- while (isdigit((int)*cp))
- mval = mval * 10 + (*cp++ - '0');
-
- if (*cp == '.') { /* centimeters */
- cp++;
- if (isdigit((int)*cp)) {
- cmval = (*cp++ - '0') * 10;
- if (isdigit((int)*cp)) {
- cmval += (*cp++ - '0');
- }
- }
- }
- cmval = (mval * 100) + cmval;
-
- for (exponent = 0; exponent < 9; exponent++)
- if (cmval < poweroften[exponent+1])
- break;
-
- mantissa = cmval / poweroften[exponent];
- if (mantissa > 9)
- mantissa = 9;
-
- retval = (mantissa << 4) | exponent;
-
- *strptr = cp;
-
- return (retval);
-}
-
-/* converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer. */
-static u_int32_t
-latlon2ul(latlonstrptr,which)
- char **latlonstrptr;
- int *which;
-{
- char *cp;
- u_int32_t retval;
- int deg = 0, min = 0, secs = 0, secsfrac = 0;
-
- cp = *latlonstrptr;
-
- while (isdigit((int)*cp))
- deg = deg * 10 + (*cp++ - '0');
-
- while (isspace((int)*cp))
- cp++;
-
- if (!(isdigit((int)*cp)))
- goto fndhemi;
-
- while (isdigit((int)*cp))
- min = min * 10 + (*cp++ - '0');
-
- while (isspace((int)*cp))
- cp++;
-
- if (!(isdigit((int)*cp)))
- goto fndhemi;
-
- while (isdigit((int)*cp))
- secs = secs * 10 + (*cp++ - '0');
-
- if (*cp == '.') { /* decimal seconds */
- cp++;
- if (isdigit((int)*cp)) {
- secsfrac = (*cp++ - '0') * 100;
- if (isdigit((int)*cp)) {
- secsfrac += (*cp++ - '0') * 10;
- if (isdigit((int)*cp)) {
- secsfrac += (*cp++ - '0');
- }
- }
- }
- }
-
- while (!isspace((int)*cp)) /* if any trailing garbage */
- cp++;
-
- while (isspace((int)*cp))
- cp++;
-
- fndhemi:
- switch (*cp) {
- case 'N': case 'n':
- case 'E': case 'e':
- retval = ((unsigned)1<<31)
- + (((((deg * 60) + min) * 60) + secs) * 1000)
- + secsfrac;
- break;
- case 'S': case 's':
- case 'W': case 'w':
- retval = ((unsigned)1<<31)
- - (((((deg * 60) + min) * 60) + secs) * 1000)
- - secsfrac;
- break;
- default:
- retval = 0; /* invalid value -- indicates error */
- break;
- }
-
- switch (*cp) {
- case 'N': case 'n':
- case 'S': case 's':
- *which = 1; /* latitude */
- break;
- case 'E': case 'e':
- case 'W': case 'w':
- *which = 2; /* longitude */
- break;
- default:
- *which = 0; /* error */
- break;
- }
-
- cp++; /* skip the hemisphere */
-
- while (!isspace((int)*cp)) /* if any trailing garbage */
- cp++;
-
- while (isspace((int)*cp)) /* move to next field */
- cp++;
-
- *latlonstrptr = cp;
-
- return (retval);
-}
-
-/* converts a zone file representation in a string to an RDATA on-the-wire
- * representation. */
-int
-loc_aton(ascii, binary)
- const char *ascii;
- u_char *binary;
-{
- const char *cp, *maxcp;
- u_char *bcp;
-
- u_int32_t latit = 0, longit = 0, alt = 0;
- u_int32_t lltemp1 = 0, lltemp2 = 0;
- int altmeters = 0, altfrac = 0, altsign = 1;
- u_int8_t hp = 0x16; /* default = 1e6 cm = 10000.00m = 10km */
- u_int8_t vp = 0x13; /* default = 1e3 cm = 10.00m */
- u_int8_t siz = 0x12; /* default = 1e2 cm = 1.00m */
- int which1 = 0, which2 = 0;
-
- cp = ascii;
- maxcp = cp + strlen(ascii);
-
- lltemp1 = latlon2ul(&cp, &which1);
-
- lltemp2 = latlon2ul(&cp, &which2);
-
- switch (which1 + which2) {
- case 3: /* 1 + 2, the only valid combination */
- if ((which1 == 1) && (which2 == 2)) { /* normal case */
- latit = lltemp1;
- longit = lltemp2;
- } else if ((which1 == 2) && (which2 == 1)) { /* reversed */
- longit = lltemp1;
- latit = lltemp2;
- } else { /* some kind of brokenness */
- return (0);
- }
- break;
- default: /* we didn't get one of each */
- return (0);
- }
-
- /* altitude */
- if (*cp == '-') {
- altsign = -1;
- cp++;
- }
-
- if (*cp == '+')
- cp++;
-
- while (isdigit((int)*cp))
- altmeters = altmeters * 10 + (*cp++ - '0');
-
- if (*cp == '.') { /* decimal meters */
- cp++;
- if (isdigit((int)*cp)) {
- altfrac = (*cp++ - '0') * 10;
- if (isdigit((int)*cp)) {
- altfrac += (*cp++ - '0');
- }
- }
- }
-
- alt = (10000000 + (altsign * (altmeters * 100 + altfrac)));
-
- while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
- cp++;
-
- while (isspace((int)*cp) && (cp < maxcp))
- cp++;
-
- if (cp >= maxcp)
- goto defaults;
-
- siz = precsize_aton(&cp);
-
- while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
- cp++;
-
- while (isspace((int)*cp) && (cp < maxcp))
- cp++;
-
- if (cp >= maxcp)
- goto defaults;
-
- hp = precsize_aton(&cp);
-
- while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
- cp++;
-
- while (isspace((int)*cp) && (cp < maxcp))
- cp++;
-
- if (cp >= maxcp)
- goto defaults;
-
- vp = precsize_aton(&cp);
-
- defaults:
-
- bcp = binary;
- *bcp++ = (u_int8_t) 0; /* version byte */
- *bcp++ = siz;
- *bcp++ = hp;
- *bcp++ = vp;
- PUTLONG(latit,bcp);
- PUTLONG(longit,bcp);
- PUTLONG(alt,bcp);
-
- return (16); /* size of RR in octets */
-}
-
-/* takes an on-the-wire LOC RR and formats it in a human readable format. */
-const char *
-loc_ntoa(binary, ascii)
- const u_char *binary;
- char *ascii;
-{
- static char *error = "?";
- const u_char *cp = binary;
-
- int latdeg, latmin, latsec, latsecfrac;
- int longdeg, longmin, longsec, longsecfrac;
- char northsouth, eastwest;
- int altmeters, altfrac, altsign;
-
- const u_int32_t referencealt = 100000 * 100;
-
- int32_t latval, longval, altval;
- u_int32_t templ;
- u_int8_t sizeval, hpval, vpval, versionval;
-
- char *sizestr, *hpstr, *vpstr;
-
- versionval = *cp++;
-
- if (versionval) {
- (void) sprintf(ascii, "; error: unknown LOC RR version");
- return (ascii);
- }
-
- sizeval = *cp++;
-
- hpval = *cp++;
- vpval = *cp++;
-
- GETLONG(templ, cp);
- latval = (templ - ((unsigned)1<<31));
-
- GETLONG(templ, cp);
- longval = (templ - ((unsigned)1<<31));
-
- GETLONG(templ, cp);
- if (templ < referencealt) { /* below WGS 84 spheroid */
- altval = referencealt - templ;
- altsign = -1;
- } else {
- altval = templ - referencealt;
- altsign = 1;
- }
-
- if (latval < 0) {
- northsouth = 'S';
- latval = -latval;
- } else
- northsouth = 'N';
-
- latsecfrac = latval % 1000;
- latval = latval / 1000;
- latsec = latval % 60;
- latval = latval / 60;
- latmin = latval % 60;
- latval = latval / 60;
- latdeg = latval;
-
- if (longval < 0) {
- eastwest = 'W';
- longval = -longval;
- } else
- eastwest = 'E';
-
- longsecfrac = longval % 1000;
- longval = longval / 1000;
- longsec = longval % 60;
- longval = longval / 60;
- longmin = longval % 60;
- longval = longval / 60;
- longdeg = longval;
-
- altfrac = altval % 100;
- altmeters = (altval / 100) * altsign;
-
- if ((sizestr = strdup(precsize_ntoa(sizeval))) == NULL)
- sizestr = error;
- if ((hpstr = strdup(precsize_ntoa(hpval))) == NULL)
- hpstr = error;
- if ((vpstr = strdup(precsize_ntoa(vpval))) == NULL)
- vpstr = error;
-
- sprintf(ascii,
- "%d %.2d %.2d.%.3d %c %d %.2d %.2d.%.3d %c %d.%.2dm %sm %sm %sm",
- latdeg, latmin, latsec, latsecfrac, northsouth,
- longdeg, longmin, longsec, longsecfrac, eastwest,
- altmeters, altfrac, sizestr, hpstr, vpstr);
-
- if (sizestr != error)
- free(sizestr);
- if (hpstr != error)
- free(hpstr);
- if (vpstr != error)
- free(vpstr);
-
- return (ascii);
-}
-
-
-/* Return the number of DNS hierarchy levels in the name. */
-int
-dn_count_labels(const char *name) {
- int i, len, count;
-
- len = strlen(name);
- for (i = 0, count = 0; i < len; i++) {
- /* XXX need to check for \. or use named's nlabels(). */
- if (name[i] == '.')
- count++;
- }
-
- /* don't count initial wildcard */
- if (name[0] == '*')
- if (count)
- count--;
-
- /* don't count the null label for root. */
- /* if terminating '.' not found, must adjust */
- /* count to include last label */
- if (len > 0 && name[len-1] != '.')
- count++;
- return (count);
-}
-
-
-/*
- * Make dates expressed in seconds-since-Jan-1-1970 easy to read.
- * SIG records are required to be printed like this, by the Secure DNS RFC.
- */
-char *
-p_secstodate (u_long secs) {
- static char output[15]; /* YYYYMMDDHHMMSS and null */
- time_t clock = secs;
- struct tm *time;
-
- time = gmtime(&clock);
- time->tm_year += 1900;
- time->tm_mon += 1;
- sprintf(output, "%04d%02d%02d%02d%02d%02d",
- time->tm_year, time->tm_mon, time->tm_mday,
- time->tm_hour, time->tm_min, time->tm_sec);
- return (output);
-}
diff --git a/c/src/libnetworking/libc/res_init.c b/c/src/libnetworking/libc/res_init.c
deleted file mode 100644
index 9371e9fa82..0000000000
--- a/c/src/libnetworking/libc/res_init.c
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
- * Copyright (c) 1985, 1989, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
-static char orig_rcsid[] = "From: Id: res_init.c,v 8.7 1996/11/18 09:10:04 vixie Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "res_config.h"
-
-static void res_setoptions __P((char *, char *));
-
-#ifdef RESOLVSORT
-static const char sort_mask[] = "/&";
-#define ISSORTMASK(ch) (strchr(sort_mask, ch) != NULL)
-static u_int32_t net_mask __P((struct in_addr));
-#endif
-
-#if !defined(isascii) /* XXX - could be a function */
-# define isascii(c) (!(c & 0200))
-#endif
-
-/*
- * Resolver state default settings.
- */
-
-struct __res_state _res
-# if defined(__BIND_RES_TEXT)
- = { RES_TIMEOUT, } /* Motorola, et al. */
-# endif
- ;
-
-
-/*
- * Set up default settings. If the configuration file exist, the values
- * there will have precedence. Otherwise, the server address is set to
- * INADDR_ANY and the default domain name comes from the gethostname().
- *
- * An interrim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1
- * rather than INADDR_ANY ("0.0.0.0") as the default name server address
- * since it was noted that INADDR_ANY actually meant ``the first interface
- * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface,
- * it had to be "up" in order for you to reach your own name server. It
- * was later decided that since the recommended practice is to always
- * install local static routes through 127.0.0.1 for all your network
- * interfaces, that we could solve this problem without a code change.
- *
- * The configuration file should always be used, since it is the only way
- * to specify a default domain. If you are running a server on your local
- * machine, you should say "nameserver 0.0.0.0" or "nameserver 127.0.0.1"
- * in the configuration file.
- *
- * Return 0 if completes successfully, -1 on error
- */
-int
-res_init()
-{
- register FILE *fp;
- register char *cp, **pp;
- register int n;
- char buf[MAXDNAME];
- int nserv = 0; /* number of nameserver records read from file */
- int haveenv = 0;
- int havesearch = 0;
-#ifdef RESOLVSORT
- int nsort = 0;
- char *net;
-#endif
-#ifndef RFC1535
- int dots;
-#endif
-
- /*
- * These three fields used to be statically initialized. This made
- * it hard to use this code in a shared library. It is necessary,
- * now that we're doing dynamic initialization here, that we preserve
- * the old semantics: if an application modifies one of these three
- * fields of _res before res_init() is called, res_init() will not
- * alter them. Of course, if an application is setting them to
- * _zero_ before calling res_init(), hoping to override what used
- * to be the static default, we can't detect it and unexpected results
- * will follow. Zero for any of these fields would make no sense,
- * so one can safely assume that the applications were already getting
- * unexpected results.
- *
- * _res.options is tricky since some apps were known to diddle the bits
- * before res_init() was first called. We can't replicate that semantic
- * with dynamic initialization (they may have turned bits off that are
- * set in RES_DEFAULT). Our solution is to declare such applications
- * "broken". They could fool us by setting RES_INIT but none do (yet).
- */
- if (!_res.retrans)
- _res.retrans = RES_TIMEOUT;
- if (!_res.retry)
- _res.retry = 4;
- if (!(_res.options & RES_INIT))
- _res.options = RES_DEFAULT;
-
- /*
- * This one used to initialize implicitly to zero, so unless the app
- * has set it to something in particular, we can randomize it now.
- */
- if (!_res.id)
- _res.id = res_randomid();
-
-#ifdef USELOOPBACK
- _res.nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
-#else
- _res.nsaddr.sin_addr.s_addr = INADDR_ANY;
-#endif
- _res.nsaddr.sin_family = AF_INET;
- _res.nsaddr.sin_port = htons(NAMESERVER_PORT);
- _res.nscount = 1;
- _res.ndots = 1;
- _res.pfcode = 0;
-
- /*
- * RTEMS -- Set up name servers
- */
- {
-#include <rtems/rtems_bsdnet_internal.h>
- int n = 0;
- while ((n < rtems_bsdnet_nameserver_count) && (nserv < MAXNS)) {
- _res.nsaddr_list[nserv].sin_addr = rtems_bsdnet_nameserver[n];
- _res.nsaddr_list[nserv].sin_family = AF_INET;
- _res.nsaddr_list[nserv].sin_port = htons(NAMESERVER_PORT);
- nserv++;
- n++;
- }
- if (rtems_bsdnet_domain_name)
- (void)strncpy(_res.defdname, rtems_bsdnet_domain_name, sizeof(_res.defdname) - 1);
- }
-
- /* Allow user to override the local domain definition */
- if ((cp = getenv("LOCALDOMAIN")) != NULL) {
- (void)strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
- haveenv++;
-
- /*
- * Set search list to be blank-separated strings
- * from rest of env value. Permits users of LOCALDOMAIN
- * to still have a search list, and anyone to set the
- * one that they want to use as an individual (even more
- * important now that the rfc1535 stuff restricts searches)
- */
- cp = _res.defdname;
- pp = _res.dnsrch;
- *pp++ = cp;
- for (n = 0; *cp && pp < _res.dnsrch + MAXDNSRCH; cp++) {
- if (*cp == '\n') /* silly backwards compat */
- break;
- else if (*cp == ' ' || *cp == '\t') {
- *cp = 0;
- n = 1;
- } else if (n) {
- *pp++ = cp;
- n = 0;
- havesearch = 1;
- }
- }
- /* null terminate last domain if there are excess */
- while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n')
- cp++;
- *cp = '\0';
- *pp++ = 0;
- }
-
-#define MATCH(line, name) \
- (!strncmp(line, name, sizeof(name) - 1) && \
- (line[sizeof(name) - 1] == ' ' || \
- line[sizeof(name) - 1] == '\t'))
-
- if ((fp = fopen(_PATH_RESCONF, "r")) != NULL) {
- /* read the config file */
- while (fgets(buf, sizeof(buf), fp) != NULL) {
- /* skip comments */
- if (*buf == ';' || *buf == '#')
- continue;
- /* read default domain name */
- if (MATCH(buf, "domain")) {
- if (haveenv) /* skip if have from environ */
- continue;
- cp = buf + sizeof("domain") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp == '\0') || (*cp == '\n'))
- continue;
- strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
- if ((cp = strpbrk(_res.defdname, " \t\n")) != NULL)
- *cp = '\0';
- havesearch = 0;
- continue;
- }
- /* set search list */
- if (MATCH(buf, "search")) {
- if (haveenv) /* skip if have from environ */
- continue;
- cp = buf + sizeof("search") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp == '\0') || (*cp == '\n'))
- continue;
- strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
- if ((cp = strchr(_res.defdname, '\n')) != NULL)
- *cp = '\0';
- /*
- * Set search list to be blank-separated strings
- * on rest of line.
- */
- cp = _res.defdname;
- pp = _res.dnsrch;
- *pp++ = cp;
- for (n = 0; *cp && pp < _res.dnsrch + MAXDNSRCH; cp++) {
- if (*cp == ' ' || *cp == '\t') {
- *cp = 0;
- n = 1;
- } else if (n) {
- *pp++ = cp;
- n = 0;
- }
- }
- /* null terminate last domain if there are excess */
- while (*cp != '\0' && *cp != ' ' && *cp != '\t')
- cp++;
- *cp = '\0';
- *pp++ = 0;
- havesearch = 1;
- continue;
- }
- /* read nameservers to query */
- if (MATCH(buf, "nameserver") && nserv < MAXNS) {
- struct in_addr a;
-
- cp = buf + sizeof("nameserver") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp != '\0') && (*cp != '\n') && inet_aton(cp, &a)) {
- _res.nsaddr_list[nserv].sin_addr = a;
- _res.nsaddr_list[nserv].sin_family = AF_INET;
- _res.nsaddr_list[nserv].sin_port =
- htons(NAMESERVER_PORT);
- nserv++;
- }
- continue;
- }
-#ifdef RESOLVSORT
- if (MATCH(buf, "sortlist")) {
- struct in_addr a;
-
- cp = buf + sizeof("sortlist") - 1;
- while (nsort < MAXRESOLVSORT) {
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if (*cp == '\0' || *cp == '\n' || *cp == ';')
- break;
- net = cp;
- while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&
- isascii((int)*cp) && !isspace((int)*cp))
- cp++;
- n = *cp;
- *cp = 0;
- if (inet_aton(net, &a)) {
- _res.sort_list[nsort].addr = a;
- if (ISSORTMASK(n)) {
- *cp++ = n;
- net = cp;
- while (*cp && *cp != ';' &&
- isascii((int)*cp) && !isspace((int)*cp))
- cp++;
- n = *cp;
- *cp = 0;
- if (inet_aton(net, &a)) {
- _res.sort_list[nsort].mask = a.s_addr;
- } else {
- _res.sort_list[nsort].mask =
- net_mask(_res.sort_list[nsort].addr);
- }
- } else {
- _res.sort_list[nsort].mask =
- net_mask(_res.sort_list[nsort].addr);
- }
- nsort++;
- }
- *cp = n;
- }
- continue;
- }
-#endif
- if (MATCH(buf, "options")) {
- res_setoptions(buf + sizeof("options") - 1, "conf");
- continue;
- }
- }
- if (nserv > 1)
- _res.nscount = nserv;
-#ifdef RESOLVSORT
- _res.nsort = nsort;
-#endif
- (void) fclose(fp);
- }
- if (_res.defdname[0] == 0 &&
- gethostname(buf, sizeof(_res.defdname) - 1) == 0 &&
- (cp = strchr(buf, '.')) != NULL)
- strcpy(_res.defdname, cp + 1);
-
- /* find components of local domain that might be searched */
- if (havesearch == 0) {
- pp = _res.dnsrch;
- *pp++ = _res.defdname;
- *pp = NULL;
-
-#ifndef RFC1535
- dots = 0;
- for (cp = _res.defdname; *cp; cp++)
- dots += (*cp == '.');
-
- cp = _res.defdname;
- while (pp < _res.dnsrch + MAXDFLSRCH) {
- if (dots < LOCALDOMAINPARTS)
- break;
- cp = strchr(cp, '.') + 1; /* we know there is one */
- *pp++ = cp;
- dots--;
- }
- *pp = NULL;
-#ifdef DEBUG
- if (_res.options & RES_DEBUG) {
- printf(";; res_init()... default dnsrch list:\n");
- for (pp = _res.dnsrch; *pp; pp++)
- printf(";;\t%s\n", *pp);
- printf(";;\t..END..\n");
- }
-#endif
-#endif /* !RFC1535 */
- }
-
- if ((cp = getenv("RES_OPTIONS")) != NULL)
- res_setoptions(cp, "env");
- _res.options |= RES_INIT;
- return (0);
-}
-
-static void
-res_setoptions(options, source)
- char *options, *source;
-{
- char *cp = options;
- int i;
-
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_setoptions(\"%s\", \"%s\")...\n",
- options, source);
-#endif
- while (*cp) {
- /* skip leading and inner runs of spaces */
- while (*cp == ' ' || *cp == '\t')
- cp++;
- /* search for and process individual options */
- if (!strncmp(cp, "ndots:", sizeof("ndots:") - 1)) {
- i = atoi(cp + sizeof("ndots:") - 1);
- if (i <= RES_MAXNDOTS)
- _res.ndots = i;
- else
- _res.ndots = RES_MAXNDOTS;
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";;\tndots=%d\n", _res.ndots);
-#endif
- } else if (!strncmp(cp, "debug", sizeof("debug") - 1)) {
-#ifdef DEBUG
- if (!(_res.options & RES_DEBUG)) {
- printf(";; res_setoptions(\"%s\", \"%s\")..\n",
- options, source);
- _res.options |= RES_DEBUG;
- }
- printf(";;\tdebug\n");
-#endif
- } else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) {
- _res.options |= RES_USE_INET6;
- } else if (!strncmp(cp, "no_tld_query", sizeof("no_tld_query") - 1)) {
- _res.options |= RES_NOTLDQUERY;
- } else {
- /* XXX - print a warning here? */
- }
- /* skip to next run of spaces */
- while (*cp && *cp != ' ' && *cp != '\t')
- cp++;
- }
-}
-
-#ifdef RESOLVSORT
-/* XXX - should really support CIDR which means explicit masks always. */
-static u_int32_t
-net_mask(in) /* XXX - should really use system's version of this */
- struct in_addr in;
-{
- register u_int32_t i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return (htonl(IN_CLASSA_NET));
- else if (IN_CLASSB(i))
- return (htonl(IN_CLASSB_NET));
- return (htonl(IN_CLASSC_NET));
-}
-#endif
-
-u_int
-res_randomid()
-{
- struct timeval now;
-
- gettimeofday(&now, NULL);
- return (0xffff & (now.tv_sec ^ now.tv_usec ^ getpid()));
-}
diff --git a/c/src/libnetworking/libc/res_mkquery.c b/c/src/libnetworking/libc/res_mkquery.c
deleted file mode 100644
index d3fabfa5ab..0000000000
--- a/c/src/libnetworking/libc/res_mkquery.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 1985, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: res_mkquery.c,v 8.9 1997/04/24 22:22:36 vixie Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "res_config.h"
-
-/*
- * Form all types of queries.
- * Returns the size of the result or -1.
- */
-int
-res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
- int op; /* opcode of query */
- const char *dname; /* domain name */
- int class, type; /* class and type of query */
- const u_char *data; /* resource record data */
- int datalen; /* length of data */
- const u_char *newrr_in; /* new rr for modify or append */
- u_char *buf; /* buffer to put query */
- int buflen; /* size of buffer */
-{
- register HEADER *hp;
- register u_char *cp;
- register int n;
- u_char *dnptrs[20], **dpp, **lastdnptr;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_mkquery(%d, %s, %d, %d)\n",
- op, dname, class, type);
-#endif
- /*
- * Initialize header fields.
- */
- if ((buf == NULL) || (buflen < HFIXEDSZ))
- return (-1);
- memset(buf, 0, HFIXEDSZ);
- hp = (HEADER *) buf;
- hp->id = htons(++_res.id);
- hp->opcode = op;
- hp->rd = (_res.options & RES_RECURSE) != 0;
- hp->rcode = NOERROR;
- cp = buf + HFIXEDSZ;
- buflen -= HFIXEDSZ;
- dpp = dnptrs;
- *dpp++ = buf;
- *dpp++ = NULL;
- lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
- /*
- * perform opcode specific processing
- */
- switch (op) {
- case QUERY: /*FALLTHROUGH*/
- case NS_NOTIFY_OP:
- if ((buflen -= QFIXEDSZ) < 0)
- return (-1);
- if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
- return (-1);
- cp += n;
- buflen -= n;
- __putshort(type, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- hp->qdcount = htons(1);
- if (op == QUERY || data == NULL)
- break;
- /*
- * Make an additional record for completion domain.
- */
- buflen -= RRFIXEDSZ;
- n = dn_comp((char *)data, cp, buflen, dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- buflen -= n;
- __putshort(T_NULL, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- __putlong(0, cp);
- cp += INT32SZ;
- __putshort(0, cp);
- cp += INT16SZ;
- hp->arcount = htons(1);
- break;
-
- case IQUERY:
- /*
- * Initialize answer section
- */
- if (buflen < 1 + RRFIXEDSZ + datalen)
- return (-1);
- *cp++ = '\0'; /* no domain name */
- __putshort(type, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- __putlong(0, cp);
- cp += INT32SZ;
- __putshort(datalen, cp);
- cp += INT16SZ;
- if (datalen) {
- memcpy(cp, data, datalen);
- cp += datalen;
- }
- hp->ancount = htons(1);
- break;
-
- default:
- return (-1);
- }
- return (cp - buf);
-}
diff --git a/c/src/libnetworking/libc/res_mkupdate.c b/c/src/libnetworking/libc/res_mkupdate.c
deleted file mode 100644
index 56362f650b..0000000000
--- a/c/src/libnetworking/libc/res_mkupdate.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Based on the Dynamic DNS reference implementation by Viraj Bais
- * <viraj_bais@ccm.fm.intel.com>
- */
-
-#if !defined(__rtems__)
-#if !defined(lint) && !defined(SABER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-#include <sys/param.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <limits.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <ctype.h>
-
-#include "res_config.h"
-
-static int getnum_str(u_char **, u_char *);
-static int getword_str(char *, int, u_char **, u_char *);
-
-#define ShrinkBuffer(x) if ((buflen -= x) < 0) return (-2);
-
-/*
- * Form update packets.
- * Returns the size of the resulting packet if no error
- * On error,
- * returns -1 if error in reading a word/number in rdata
- * portion for update packets
- * -2 if length of buffer passed is insufficient
- * -3 if zone section is not the first section in
- * the linked list, or section order has a problem
- * -4 on a number overflow
- * -5 unknown operation or no records
- */
-int
-res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
- ns_updrec *rrecp_start = rrecp_in;
- HEADER *hp;
- u_char *cp, *sp1, *sp2, *startp, *endp;
- int n, i, soanum, multiline;
- ns_updrec *rrecp;
- struct in_addr ina;
- char buf2[MAXDNAME];
- int section, numrrs = 0, counts[ns_s_max];
- u_int16_t rtype, rclass;
- u_int32_t n1, rttl;
- u_char *dnptrs[20], **dpp, **lastdnptr;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-
- /*
- * Initialize header fields.
- */
- if ((buf == NULL) || (buflen < HFIXEDSZ))
- return (-1);
- memset(buf, 0, HFIXEDSZ);
- hp = (HEADER *) buf;
- hp->id = htons(++_res.id);
- hp->opcode = ns_o_update;
- hp->rcode = NOERROR;
- sp1 = buf + 2*INT16SZ; /* save pointer to zocount */
- cp = buf + HFIXEDSZ;
- buflen -= HFIXEDSZ;
- dpp = dnptrs;
- *dpp++ = buf;
- *dpp++ = NULL;
- lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
-
- if (rrecp_start == NULL)
- return (-5);
- else if (rrecp_start->r_section != S_ZONE)
- return (-3);
-
- memset(counts, 0, sizeof counts);
- for (rrecp = rrecp_start; rrecp; rrecp = rrecp->r_grpnext) {
- numrrs++;
- section = rrecp->r_section;
- if (section < 0 || section >= ns_s_max)
- return (-1);
- counts[section]++;
- for (i = section + 1; i < ns_s_max; i++)
- if (counts[i])
- return (-3);
- rtype = rrecp->r_type;
- rclass = rrecp->r_class;
- rttl = rrecp->r_ttl;
- /* overload class and type */
- if (section == S_PREREQ) {
- rttl = 0;
- switch (rrecp->r_opcode) {
- case YXDOMAIN:
- rclass = C_ANY;
- rtype = T_ANY;
- rrecp->r_size = 0;
- break;
- case NXDOMAIN:
- rclass = C_NONE;
- rtype = T_ANY;
- rrecp->r_size = 0;
- break;
- case NXRRSET:
- rclass = C_NONE;
- rrecp->r_size = 0;
- break;
- case YXRRSET:
- if (rrecp->r_size == 0)
- rclass = C_ANY;
- break;
- default:
- fprintf(stderr,
- "res_mkupdate: incorrect opcode: %d\n",
- rrecp->r_opcode);
- fflush(stderr);
- return (-1);
- }
- } else if (section == S_UPDATE) {
- switch (rrecp->r_opcode) {
- case DELETE:
- rclass = rrecp->r_size == 0 ? C_ANY : C_NONE;
- break;
- case ADD:
- break;
- default:
- fprintf(stderr,
- "res_mkupdate: incorrect opcode: %d\n",
- rrecp->r_opcode);
- fflush(stderr);
- return (-1);
- }
- }
-
- /*
- * XXX appending default domain to owner name is omitted,
- * fqdn must be provided
- */
- if ((n = dn_comp(rrecp->r_dname, cp, buflen, dnptrs,
- lastdnptr)) < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n + 2*INT16SZ);
- PUTSHORT(rtype, cp);
- PUTSHORT(rclass, cp);
- if (section == S_ZONE) {
- if (numrrs != 1 || rrecp->r_type != T_SOA)
- return (-3);
- continue;
- }
- ShrinkBuffer(INT32SZ + INT16SZ);
- PUTLONG(rttl, cp);
- sp2 = cp; /* save pointer to length byte */
- cp += INT16SZ;
- if (rrecp->r_size == 0) {
- if (section == S_UPDATE && rclass != C_ANY)
- return (-1);
- else {
- PUTSHORT(0, sp2);
- continue;
- }
- }
- startp = rrecp->r_data;
- endp = startp + rrecp->r_size - 1;
- /* XXX this should be done centrally. */
- switch (rrecp->r_type) {
- case T_A:
- if (!getword_str(buf2, sizeof buf2, &startp, endp))
- return (-1);
- if (!inet_aton(buf2, &ina))
- return (-1);
- n1 = ntohl(ina.s_addr);
- ShrinkBuffer(INT32SZ);
- PUTLONG(n1, cp);
- break;
- case T_CNAME:
- case T_MB:
- case T_MG:
- case T_MR:
- case T_NS:
- case T_PTR:
- if (!getword_str(buf2, sizeof buf2, &startp, endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen, dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- break;
- case T_MINFO:
- case T_SOA:
- case T_RP:
- for (i = 0; i < 2; i++) {
- if (!getword_str(buf2, sizeof buf2, &startp,
- endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen,
- dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- }
- if (rrecp->r_type == T_SOA) {
- ShrinkBuffer(5 * INT32SZ);
- while (isspace(*startp) || !*startp)
- startp++;
- if (*startp == '(') {
- multiline = 1;
- startp++;
- } else
- multiline = 0;
- /* serial, refresh, retry, expire, minimum */
- for (i = 0; i < 5; i++) {
- soanum = getnum_str(&startp, endp);
- if (soanum < 0)
- return (-1);
- PUTLONG(soanum, cp);
- }
- if (multiline) {
- while (isspace(*startp) || !*startp)
- startp++;
- if (*startp != ')')
- return (-1);
- }
- }
- break;
- case T_MX:
- case T_AFSDB:
- case T_RT:
- n = getnum_str(&startp, endp);
- if (n < 0)
- return (-1);
- PUTSHORT(n, cp);
- ShrinkBuffer(INT16SZ);
- if (!getword_str(buf2, sizeof buf2, &startp, endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen, dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- break;
- case T_PX:
- n = getnum_str(&startp, endp);
- if (n < 0)
- return (-1);
- PUTSHORT(n, cp);
- ShrinkBuffer(INT16SZ);
- for (i = 0; i < 2; i++) {
- if (!getword_str(buf2, sizeof buf2, &startp,
- endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen, dnptrs,
- lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- }
- break;
- case T_WKS:
- case T_HINFO:
- case T_TXT:
- case T_X25:
- case T_ISDN:
- case T_NSAP:
- case T_LOC:
- /* XXX - more fine tuning needed here */
- ShrinkBuffer(rrecp->r_size);
- memcpy(cp, rrecp->r_data, rrecp->r_size);
- cp += rrecp->r_size;
- break;
- default:
- return (-1);
- } /*switch*/
- n = (u_int16_t)((cp - sp2) - INT16SZ);
- PUTSHORT(n, sp2);
- } /*for*/
-
- hp->qdcount = htons(counts[0]);
- hp->ancount = htons(counts[1]);
- hp->nscount = htons(counts[2]);
- hp->arcount = htons(counts[3]);
- return (cp - buf);
-}
-
-/*
- * Get a whitespace delimited word from a string (not file)
- * into buf. modify the start pointer to point after the
- * word in the string.
- */
-static int
-getword_str(char *buf, int size, u_char **startpp, u_char *endp) {
- char *cp;
- int c;
-
- for (cp = buf; *startpp <= endp; ) {
- c = **startpp;
- if (isspace(c) || c == '\0') {
- if (cp != buf) /* trailing whitespace */
- break;
- else { /* leading whitespace */
- (*startpp)++;
- continue;
- }
- }
- (*startpp)++;
- if (cp >= buf+size-1)
- break;
- *cp++ = (u_char)c;
- }
- *cp = '\0';
- return (cp != buf);
-}
-
-/*
- * Get a whitespace delimited number from a string (not file) into buf
- * update the start pointer to point after the number in the string.
- */
-static int
-getnum_str(u_char **startpp, u_char *endp) {
- int c, n;
- int seendigit = 0;
- int m = 0;
-
- for (n = 0; *startpp <= endp; ) {
- c = **startpp;
- if (isspace(c) || c == '\0') {
- if (seendigit) /* trailing whitespace */
- break;
- else { /* leading whitespace */
- (*startpp)++;
- continue;
- }
- }
- if (c == ';') {
- while ((*startpp <= endp) &&
- ((c = **startpp) != '\n'))
- (*startpp)++;
- if (seendigit)
- break;
- continue;
- }
- if (!isdigit(c)) {
- if (c == ')' && seendigit) {
- (*startpp)--;
- break;
- }
- return (-1);
- }
- (*startpp)++;
- n = n * 10 + (c - '0');
- seendigit = 1;
- }
- return (n + m);
-}
-
-/*
- * Allocate a resource record buffer & save rr info.
- */
-ns_updrec *
-res_mkupdrec(int section, const char *dname,
- u_int class, u_int type, u_long ttl) {
- ns_updrec *rrecp = (ns_updrec *)calloc(1, sizeof(ns_updrec));
-
- if (!rrecp || !(rrecp->r_dname = strdup(dname)))
- return (NULL);
- rrecp->r_class = class;
- rrecp->r_type = type;
- rrecp->r_ttl = ttl;
- rrecp->r_section = section;
- return (rrecp);
-}
-
-/*
- * Free a resource record buffer created by res_mkupdrec.
- */
-void
-res_freeupdrec(ns_updrec *rrecp) {
- /* Note: freeing r_dp is the caller's responsibility. */
- if (rrecp->r_dname != NULL)
- free(rrecp->r_dname);
- free(rrecp);
-}
diff --git a/c/src/libnetworking/libc/res_query.c b/c/src/libnetworking/libc/res_query.c
deleted file mode 100644
index 784fa433bc..0000000000
--- a/c/src/libnetworking/libc/res_query.c
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid = "From: Id: res_query.c,v 8.14 1997/06/09 17:47:05 halley Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <errno.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "res_config.h"
-
-#if PACKETSZ > 1024
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 1024
-#endif
-
-/*
- * Formulate a normal query, send, and await answer.
- * Returned answer is placed in supplied buffer "answer".
- * Perform preliminary check of answer, returning success only
- * if no error is indicated and the answer count is nonzero.
- * Return the size of the response on success, -1 on error.
- * Error number is left in h_errno.
- *
- * Caller must parse answer and determine whether it answers the question.
- */
-int
-res_query(name, class, type, answer, anslen)
- const char *name; /* domain name */
- int class, type; /* class and type of query */
- u_char *answer; /* buffer to put answer */
- int anslen; /* size of answer buffer */
-{
- u_char buf[MAXPACKET];
- HEADER *hp = (HEADER *) answer;
- int n;
-
- hp->rcode = NOERROR; /* default */
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_query(%s, %d, %d)\n", name, class, type);
-#endif
-
- n = res_mkquery(QUERY, name, class, type, NULL, 0, NULL,
- buf, sizeof(buf));
- if (n <= 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_query: mkquery failed\n");
-#endif
- h_errno = NO_RECOVERY;
- return (n);
- }
- n = res_send(buf, n, answer, anslen);
- if (n < 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_query: send error\n");
-#endif
- h_errno = TRY_AGAIN;
- return (n);
- }
-
- if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; rcode = %d, ancount=%d\n", hp->rcode,
- ntohs(hp->ancount));
-#endif
- switch (hp->rcode) {
- case NXDOMAIN:
- h_errno = HOST_NOT_FOUND;
- break;
- case SERVFAIL:
- h_errno = TRY_AGAIN;
- break;
- case NOERROR:
- h_errno = NO_DATA;
- break;
- case FORMERR:
- case NOTIMP:
- case REFUSED:
- default:
- h_errno = NO_RECOVERY;
- break;
- }
- return (-1);
- }
- return (n);
-}
-
-/*
- * Formulate a normal query, send, and retrieve answer in supplied buffer.
- * Return the size of the response on success, -1 on error.
- * If enabled, implement search rules until answer or unrecoverable failure
- * is detected. Error code, if any, is left in h_errno.
- */
-int
-res_search(name, class, type, answer, anslen)
- const char *name; /* domain name */
- int class, type; /* class and type of query */
- u_char *answer; /* buffer to put answer */
- int anslen; /* size of answer */
-{
- const char *cp, * const *domain;
- HEADER *hp = (HEADER *) answer;
- u_int dots;
- int trailing_dot, ret, saved_herrno;
- int got_nodata = 0, got_servfail = 0, tried_as_is = 0;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
- errno = 0;
- h_errno = HOST_NOT_FOUND; /* default, if we never query */
- dots = 0;
- for (cp = name; *cp; cp++)
- dots += (*cp == '.');
- trailing_dot = 0;
- if (cp > name && *--cp == '.')
- trailing_dot++;
-
- /* If there aren't any dots, it could be a user-level alias */
- if (!dots && (cp = hostalias(name)) != NULL)
- return (res_query(cp, class, type, answer, anslen));
-
- /*
- * If there are dots in the name already, let's just give it a try
- * 'as is'. The threshold can be set with the "ndots" option.
- */
- saved_herrno = -1;
- if (dots >= _res.ndots) {
- ret = res_querydomain(name, NULL, class, type, answer, anslen);
- if (ret > 0)
- return (ret);
- saved_herrno = h_errno;
- tried_as_is++;
- }
-
- /*
- * We do at least one level of search if
- * - there is no dot and RES_DEFNAME is set, or
- * - there is at least one dot, there is no trailing dot,
- * and RES_DNSRCH is set.
- */
- if ((!dots && (_res.options & RES_DEFNAMES)) ||
- (dots && !trailing_dot && (_res.options & RES_DNSRCH))) {
- int done = 0;
-
- for (domain = (const char * const *)_res.dnsrch;
- *domain && !done;
- domain++) {
-
- ret = res_querydomain(name, *domain, class, type,
- answer, anslen);
- if (ret > 0)
- return (ret);
-
- /*
- * If no server present, give up.
- * If name isn't found in this domain,
- * keep trying higher domains in the search list
- * (if that's enabled).
- * On a NO_DATA error, keep trying, otherwise
- * a wildcard entry of another type could keep us
- * from finding this entry higher in the domain.
- * If we get some other error (negative answer or
- * server failure), then stop searching up,
- * but try the input name below in case it's
- * fully-qualified.
- */
- if (errno == ECONNREFUSED) {
- h_errno = TRY_AGAIN;
- return (-1);
- }
-
- switch (h_errno) {
- case NO_DATA:
- got_nodata++;
- /* FALLTHROUGH */
- case HOST_NOT_FOUND:
- /* keep trying */
- break;
- case TRY_AGAIN:
- if (hp->rcode == SERVFAIL) {
- /* try next search element, if any */
- got_servfail++;
- break;
- }
- /* FALLTHROUGH */
- default:
- /* anything else implies that we're done */
- done++;
- }
-
- /* if we got here for some reason other than DNSRCH,
- * we only wanted one iteration of the loop, so stop.
- */
- if (!(_res.options & RES_DNSRCH))
- done++;
- }
- }
-
- /*
- * If we have not already tried the name "as is", do that now.
- * note that we do this regardless of how many dots were in the
- * name or whether it ends with a dot unless NOTLDQUERY is set.
- */
- if (!tried_as_is && (dots || !(_res.options & RES_NOTLDQUERY))) {
- ret = res_querydomain(name, NULL, class, type, answer, anslen);
- if (ret > 0)
- return (ret);
- }
-
- /* if we got here, we didn't satisfy the search.
- * if we did an initial full query, return that query's h_errno
- * (note that we wouldn't be here if that query had succeeded).
- * else if we ever got a nodata, send that back as the reason.
- * else send back meaningless h_errno, that being the one from
- * the last DNSRCH we did.
- */
- if (saved_herrno != -1)
- h_errno = saved_herrno;
- else if (got_nodata)
- h_errno = NO_DATA;
- else if (got_servfail)
- h_errno = TRY_AGAIN;
- return (-1);
-}
-
-/*
- * Perform a call on res_query on the concatenation of name and domain,
- * removing a trailing dot from name if domain is NULL.
- */
-int
-res_querydomain(name, domain, class, type, answer, anslen)
- const char *name, *domain;
- int class, type; /* class and type of query */
- u_char *answer; /* buffer to put answer */
- int anslen; /* size of answer */
-{
- char nbuf[MAXDNAME];
- const char *longname = nbuf;
- int n, d;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_querydomain(%s, %s, %d, %d)\n",
- name, domain?domain:"<Nil>", class, type);
-#endif
- if (domain == NULL) {
- /*
- * Check for trailing '.';
- * copy without '.' if present.
- */
- n = strlen(name);
- if (n >= MAXDNAME) {
- h_errno = NO_RECOVERY;
- return (-1);
- }
- n--;
- if (n >= 0 && name[n] == '.') {
- strncpy(nbuf, name, n);
- nbuf[n] = '\0';
- } else
- longname = name;
- } else {
- n = strlen(name);
- d = strlen(domain);
- if (n + d + 1 >= MAXDNAME) {
- h_errno = NO_RECOVERY;
- return (-1);
- }
- sprintf(nbuf, "%s.%s", name, domain);
- }
- return (res_query(longname, class, type, answer, anslen));
-}
-
-const char *
-hostalias(name)
- const char *name;
-{
- register char *cp1, *cp2;
- FILE *fp;
- char *file;
- char buf[BUFSIZ];
- static char abuf[MAXDNAME];
-
- if (_res.options & RES_NOALIASES)
- return (NULL);
- if (issetugid())
- return (NULL);
- file = getenv("HOSTALIASES");
- if (file == NULL || (fp = fopen(file, "r")) == NULL)
- return (NULL);
- setbuf(fp, NULL);
- buf[sizeof(buf) - 1] = '\0';
- while (fgets(buf, sizeof(buf), fp)) {
- for (cp1 = buf; *cp1 && !isspace((int)*cp1); ++cp1)
- ;
- if (!*cp1)
- break;
- *cp1 = '\0';
- if (!strcasecmp(buf, name)) {
- while (isspace((int)*++cp1))
- ;
- if (!*cp1)
- break;
- for (cp2 = cp1 + 1; *cp2 && !isspace((int)*cp2); ++cp2)
- ;
- abuf[sizeof(abuf) - 1] = *cp2 = '\0';
- strncpy(abuf, cp1, sizeof(abuf) - 1);
- fclose(fp);
- return (abuf);
- }
- }
- fclose(fp);
- return (NULL);
-}
diff --git a/c/src/libnetworking/libc/res_send.c b/c/src/libnetworking/libc/res_send.c
deleted file mode 100644
index 08cb78490f..0000000000
--- a/c/src/libnetworking/libc/res_send.c
+++ /dev/null
@@ -1,929 +0,0 @@
-/*
- * Copyright (c) 1985, 1989, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: res_send.c,v 8.20 1998/04/06 23:27:51 halley Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Send query to name server and wait for reply.
- */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <poll.h>
-
-#include "res_config.h"
-
-#if !defined(__rtems__)
-#ifdef NOPOLL /* libc_r doesn't wrap poll yet() */
-static int use_poll = 0;
-#else
-static int use_poll = 1; /* adapt to poll() syscall availability */
- /* 0 = not present, 1 = try it, 2 = exists */
-#endif
-#endif
-
-static int s = -1; /* socket used for communications */
-static int connected = 0; /* is the socket connected */
-static int vc = 0; /* is the socket a virtual circuit? */
-static res_send_qhook Qhook = NULL;
-static res_send_rhook Rhook = NULL;
-
-
-#define CAN_RECONNECT 1
-
-#ifndef DEBUG
-# define Dprint(cond, args) /*empty*/
-# define DprintQ(cond, args, query, size) /*empty*/
-# define Aerror(file, string, error, address) /*empty*/
-# define Perror(file, string, error) /*empty*/
-#else
-# define Dprint(cond, args) if (cond) {fprintf args;} else {}
-# define DprintQ(cond, args, query, size) if (cond) {\
- fprintf args;\
- __fp_nquery(query, size, stdout);\
- } else {}
- static void
- Aerror(file, string, error, address)
- FILE *file;
- char *string;
- int error;
- struct sockaddr_in address;
- {
- int save = errno;
-
- if (_res.options & RES_DEBUG) {
- fprintf(file, "res_send: %s ([%s].%u): %s\n",
- string,
- inet_ntoa(address.sin_addr),
- ntohs(address.sin_port),
- strerror(error));
- }
- errno = save;
- }
- static void
- Perror(file, string, error)
- FILE *file;
- char *string;
- int error;
- {
- int save = errno;
-
- if (_res.options & RES_DEBUG) {
- fprintf(file, "res_send: %s: %s\n",
- string, strerror(error));
- }
- errno = save;
- }
-#endif
-
-void
-res_send_setqhook(hook)
- res_send_qhook hook;
-{
-
- Qhook = hook;
-}
-
-void
-res_send_setrhook(hook)
- res_send_rhook hook;
-{
-
- Rhook = hook;
-}
-
-/* int
- * res_isourserver(ina)
- * looks up "ina" in _res.ns_addr_list[]
- * returns:
- * 0 : not found
- * >0 : found
- * author:
- * paul vixie, 29may94
- */
-int
-res_isourserver(inp)
- const struct sockaddr_in *inp;
-{
- struct sockaddr_in ina;
- int ns, ret;
-
- ina = *inp;
- ret = 0;
- for (ns = 0; ns < _res.nscount; ns++) {
- const struct sockaddr_in *srv = &_res.nsaddr_list[ns];
-
- if (srv->sin_family == ina.sin_family &&
- srv->sin_port == ina.sin_port &&
- (srv->sin_addr.s_addr == INADDR_ANY ||
- srv->sin_addr.s_addr == ina.sin_addr.s_addr)) {
- ret++;
- break;
- }
- }
- return (ret);
-}
-
-/* int
- * res_nameinquery(name, type, class, buf, eom)
- * look for (name,type,class) in the query section of packet (buf,eom)
- * requires:
- * buf + HFIXEDSZ <= eom
- * returns:
- * -1 : format error
- * 0 : not found
- * >0 : found
- * author:
- * paul vixie, 29may94
- */
-int
-res_nameinquery(name, type, class, buf, eom)
- const char *name;
- int type, class;
- const u_char *buf, *eom;
-{
- const u_char *cp = buf + HFIXEDSZ;
- int qdcount = ntohs(((HEADER*)buf)->qdcount);
-
- while (qdcount-- > 0) {
- char tname[MAXDNAME+1];
- int n, ttype, tclass;
-
- n = dn_expand(buf, eom, cp, tname, sizeof tname);
- if (n < 0)
- return (-1);
- cp += n;
- if (cp + 2 * INT16SZ > eom)
- return (-1);
- ttype = ns_get16(cp); cp += INT16SZ;
- tclass = ns_get16(cp); cp += INT16SZ;
- if (ttype == type &&
- tclass == class &&
- strcasecmp(tname, name) == 0)
- return (1);
- }
- return (0);
-}
-
-/* int
- * res_queriesmatch(buf1, eom1, buf2, eom2)
- * is there a 1:1 mapping of (name,type,class)
- * in (buf1,eom1) and (buf2,eom2)?
- * returns:
- * -1 : format error
- * 0 : not a 1:1 mapping
- * >0 : is a 1:1 mapping
- * author:
- * paul vixie, 29may94
- */
-int
-res_queriesmatch(buf1, eom1, buf2, eom2)
- const u_char *buf1, *eom1;
- const u_char *buf2, *eom2;
-{
- const u_char *cp = buf1 + HFIXEDSZ;
- int qdcount = ntohs(((HEADER*)buf1)->qdcount);
-
- if (buf1 + HFIXEDSZ > eom1 || buf2 + HFIXEDSZ > eom2)
- return (-1);
-
- /*
- * Only header section present in replies to
- * dynamic update packets.
- */
- if ( (((HEADER *)buf1)->opcode == ns_o_update) &&
- (((HEADER *)buf2)->opcode == ns_o_update) )
- return (1);
-
- if (qdcount != ntohs(((HEADER*)buf2)->qdcount))
- return (0);
- while (qdcount-- > 0) {
- char tname[MAXDNAME+1];
- int n, ttype, tclass;
-
- n = dn_expand(buf1, eom1, cp, tname, sizeof tname);
- if (n < 0)
- return (-1);
- cp += n;
- if (cp + 2 * INT16SZ > eom1)
- return (-1);
- ttype = ns_get16(cp); cp += INT16SZ;
- tclass = ns_get16(cp); cp += INT16SZ;
- if (!res_nameinquery(tname, ttype, tclass, buf2, eom2))
- return (0);
- }
- return (1);
-}
-
-int
-res_send(buf, buflen, ans, anssiz)
- const u_char *buf;
- int buflen;
- u_char *ans;
- int anssiz;
-{
- HEADER *hp = (HEADER *) buf;
- HEADER *anhp = (HEADER *) ans;
- int gotsomewhere, connreset, terrno, try, v_circuit, resplen, ns, n;
- u_int badns; /* XXX NSMAX can't exceed #/bits in this variable */
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- /* errno should have been set by res_init() in this case. */
- return (-1);
- }
- if (anssiz < HFIXEDSZ) {
- errno = EINVAL;
- return (-1);
- }
- DprintQ((_res.options & RES_DEBUG) || (_res.pfcode & RES_PRF_QUERY),
- (stdout, ";; res_send()\n"), buf, buflen);
- v_circuit = (_res.options & RES_USEVC) || buflen > PACKETSZ;
- gotsomewhere = 0;
- connreset = 0;
- terrno = ETIMEDOUT;
- badns = 0;
-
- /*
- * Send request, RETRY times, or until successful
- */
- for (try = 0; try < _res.retry; try++) {
- for (ns = 0; ns < _res.nscount; ns++) {
- struct sockaddr_in *nsap = &_res.nsaddr_list[ns];
- same_ns:
- if (badns & (1 << ns)) {
- res_close();
- goto next_ns;
- }
-
- if (Qhook) {
- int done = 0, loops = 0;
-
- do {
- res_sendhookact act;
-
- act = (*Qhook)(&nsap, &buf, &buflen,
- ans, anssiz, &resplen);
- switch (act) {
- case res_goahead:
- done = 1;
- break;
- case res_nextns:
- res_close();
- goto next_ns;
- case res_done:
- return (resplen);
- case res_modified:
- /* give the hook another try */
- if (++loops < 42) /*doug adams*/
- break;
- /*FALLTHROUGH*/
- case res_error:
- /*FALLTHROUGH*/
- default:
- return (-1);
- }
- } while (!done);
- }
-
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; Querying server (# %d) address = %s\n",
- ns + 1, inet_ntoa(nsap->sin_addr)));
-
- if (v_circuit) {
- int truncated;
-#if !defined(__rtems__)
- struct iovec iov[2];
-#endif
- u_short len;
- u_char *cp;
-
- /*
- * Use virtual circuit;
- * at most one attempt per server.
- */
- try = _res.retry;
- truncated = 0;
- if (s < 0 || !vc || hp->opcode == ns_o_update) {
- if (s >= 0)
- res_close();
-
- s = socket(PF_INET, SOCK_STREAM, 0);
- if (s < 0) {
- terrno = errno;
- Perror(stderr, "socket(vc)", errno);
- return (-1);
- }
- errno = 0;
- if (connect(s, (struct sockaddr *)nsap,
- sizeof *nsap) < 0) {
- terrno = errno;
- Aerror(stderr, "connect/vc",
- errno, *nsap);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- vc = 1;
- }
- /*
- * Send length & message
- */
- putshort((u_short)buflen, (u_char*)&len);
-#if !defined(__rtems__)
- iov[0].iov_base = (caddr_t)&len;
- iov[0].iov_len = INT16SZ;
- iov[1].iov_base = (caddr_t)buf;
- iov[1].iov_len = buflen;
- if (writev(s, iov, 2) != (INT16SZ + buflen)) {
-#else
- /*
- * RTEMS doesn't have writev (yet)
- */
- if ((write (s, &len, INT16SZ) != INT16SZ)
- || (write (s, buf, buflen) != buflen)) {
-#endif
- terrno = errno;
- Perror(stderr, "write failed", errno);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- /*
- * Receive length & response
- */
-read_len:
- cp = ans;
- len = INT16SZ;
- while ((n = read(s, (char *)cp, (int)len)) > 0) {
- cp += n;
- if ((len -= n) <= 0)
- break;
- }
- if (n <= 0) {
- terrno = errno;
- Perror(stderr, "read failed", errno);
- res_close();
- /*
- * A long running process might get its TCP
- * connection reset if the remote server was
- * restarted. Requery the server instead of
- * trying a new one. When there is only one
- * server, this means that a query might work
- * instead of failing. We only allow one reset
- * per query to prevent looping.
- */
- if (terrno == ECONNRESET && !connreset) {
- connreset = 1;
- res_close();
- goto same_ns;
- }
- res_close();
- goto next_ns;
- }
- resplen = ns_get16(ans);
- if (resplen > anssiz) {
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; response truncated\n")
- );
- truncated = 1;
- len = anssiz;
- } else
- len = resplen;
- if (len < HFIXEDSZ) {
- /*
- * Undersized message.
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; undersized: %d\n", len));
- terrno = EMSGSIZE;
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- cp = ans;
- while (len != 0 &&
- (n = read(s, (char *)cp, (int)len)) > 0) {
- cp += n;
- len -= n;
- }
- if (n <= 0) {
- terrno = errno;
- Perror(stderr, "read(vc)", errno);
- res_close();
- goto next_ns;
- }
- if (truncated) {
- /*
- * Flush rest of answer
- * so connection stays in synch.
- */
- anhp->tc = 1;
- len = resplen - anssiz;
- while (len != 0) {
- char junk[PACKETSZ];
-
- n = (len > sizeof(junk)
- ? sizeof(junk)
- : len);
- if ((n = read(s, junk, n)) > 0)
- len -= n;
- else
- break;
- }
- }
- /*
- * The calling applicating has bailed out of
- * a previous call and failed to arrange to have
- * the circuit closed or the server has got
- * itself confused. Anyway drop the packet and
- * wait for the correct one.
- */
- if (hp->id != anhp->id) {
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; old answer (unexpected):\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto read_len;
- }
- } else {
- /*
- * Use datagrams.
- */
-#ifndef NOPOLL
- struct pollfd pfd;
- int msec;
-#endif
- struct timeval timeout;
-#ifndef NOSELECT
- fd_set dsmask, *dsmaskp;
- int dsmasklen;
-#endif
- struct sockaddr_in from;
- int fromlen;
-
- if ((s < 0) || vc) {
- if (vc)
- res_close();
- s = socket(PF_INET, SOCK_DGRAM, 0);
- if (s < 0) {
-#ifndef CAN_RECONNECT
- bad_dg_sock:
-#endif
- terrno = errno;
- Perror(stderr, "socket(dg)", errno);
- return (-1);
- }
- connected = 0;
- }
-#ifndef CANNOT_CONNECT_DGRAM
- /*
- * On a 4.3BSD+ machine (client and server,
- * actually), sending to a nameserver datagram
- * port with no nameserver will cause an
- * ICMP port unreachable message to be returned.
- * If our datagram socket is "connected" to the
- * server, we get an ECONNREFUSED error on the next
- * socket operation, and select returns if the
- * error message is received. We can thus detect
- * the absence of a nameserver without timing out.
- * If we have sent queries to at least two servers,
- * however, we don't want to remain connected,
- * as we wish to receive answers from the first
- * server to respond.
- */
- if (_res.nscount == 1 || (try == 0 && ns == 0)) {
- /*
- * Connect only if we are sure we won't
- * receive a response from another server.
- */
- if (!connected) {
- if (connect(s, (struct sockaddr *)nsap,
- sizeof *nsap
- ) < 0) {
- Aerror(stderr,
- "connect(dg)",
- errno, *nsap);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- connected = 1;
- }
- if (send(s, (char*)buf, buflen, 0) != buflen) {
- Perror(stderr, "send", errno);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- } else {
- /*
- * Disconnect if we want to listen
- * for responses from more than one server.
- */
- if (connected) {
-#ifdef CAN_RECONNECT
- struct sockaddr_in no_addr;
-
- no_addr.sin_family = AF_INET;
- no_addr.sin_addr.s_addr = INADDR_ANY;
- no_addr.sin_port = 0;
- (void) connect(s,
- (struct sockaddr *)
- &no_addr,
- sizeof no_addr);
-#else
- int s1 = socket(PF_INET, SOCK_DGRAM,0);
- if (s1 < 0)
- goto bad_dg_sock;
- (void) dup2(s1, s);
- (void) close(s1);
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; new DG socket\n"))
-#endif /* CAN_RECONNECT */
- connected = 0;
- errno = 0;
- }
-#endif /* !CANNOT_CONNECT_DGRAM */
- if (sendto(s, (char*)buf, buflen, 0,
- (struct sockaddr *)nsap,
- sizeof *nsap)
- != buflen) {
- Aerror(stderr, "sendto", errno, *nsap);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
-#ifndef CANNOT_CONNECT_DGRAM
- }
-#endif /* !CANNOT_CONNECT_DGRAM */
-
- /*
- * Wait for reply
- */
-#ifndef NOPOLL
- othersyscall:
- if (use_poll) {
- msec = (_res.retrans << try) * 1000;
- if (try > 0)
- msec /= _res.nscount;
- if (msec <= 0)
- msec = 1000;
- } else {
-#endif
- timeout.tv_sec = (_res.retrans << try);
- if (try > 0)
- timeout.tv_sec /= _res.nscount;
- if ((long) timeout.tv_sec <= 0)
- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
-#ifndef NOPOLL
- }
-#endif
- wait:
- if (s < 0) {
- Perror(stderr, "s out-of-bounds", EMFILE);
- res_close();
- goto next_ns;
- }
-#ifndef NOPOLL
- if (use_poll) {
- struct sigaction sa, osa;
- int sigsys_installed = 0;
-
- pfd.fd = s;
- pfd.events = POLLIN;
- if (use_poll == 1) {
- bzero(&sa, sizeof(sa));
- sa.sa_handler = SIG_IGN;
- if (sigaction(SIGSYS, &sa, &osa) >= 0)
- sigsys_installed = 1;
- }
- n = poll(&pfd, 1, msec);
- if (sigsys_installed == 1) {
- int oerrno = errno;
- sigaction(SIGSYS, &osa, NULL);
- errno = oerrno;
- }
- /* XXX why does nosys() return EINVAL? */
- if (n < 0 && (errno == ENOSYS ||
- errno == EINVAL)) {
- use_poll = 0;
- goto othersyscall;
- } else if (use_poll == 1)
- use_poll = 2;
- if (n < 0) {
- if (errno == EINTR)
- goto wait;
- Perror(stderr, "poll", errno);
- res_close();
- goto next_ns;
- }
- } else {
-#endif
-#ifndef NOSELECT
- dsmasklen = howmany(s + 1, NFDBITS) *
- sizeof(fd_mask);
- if (dsmasklen > sizeof(fd_set)) {
- dsmaskp = (fd_set *)malloc(dsmasklen);
- if (dsmaskp == NULL) {
- res_close();
- goto next_ns;
- }
- } else
- dsmaskp = &dsmask;
- /* only zero what we need */
- bzero((char *)dsmaskp, dsmasklen);
- FD_SET(s, dsmaskp);
- n = select(s + 1, dsmaskp, (fd_set *)NULL,
- (fd_set *)NULL, &timeout);
- if (dsmaskp != &dsmask)
- free(dsmaskp);
- if (n < 0) {
- if (errno == EINTR)
- goto wait;
- Perror(stderr, "select", errno);
- res_close();
- goto next_ns;
- }
-#endif
-#ifndef NOPOLL
- }
-#endif
-
-#ifdef NOSELECT
- setsockopt (s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof timeout);
-#else
- if (n == 0) {
- /*
- * timeout
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; timeout\n"));
- gotsomewhere = 1;
- res_close();
- goto next_ns;
- }
-#endif
- errno = 0;
- fromlen = sizeof(struct sockaddr_in);
- resplen = recvfrom(s, (char*)ans, anssiz, 0,
- (struct sockaddr *)&from, &fromlen);
- if (resplen <= 0) {
-#ifdef NOSELECT
- if (errno == ETIMEDOUT) {
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; timeout\n"));
- gotsomewhere = 1;
- res_close();
- goto next_ns;
- }
-#endif
- Perror(stderr, "recvfrom", errno);
- res_close();
- goto next_ns;
- }
- gotsomewhere = 1;
- if (resplen < HFIXEDSZ) {
- /*
- * Undersized message.
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; undersized: %d\n",
- resplen));
- terrno = EMSGSIZE;
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- if (hp->id != anhp->id) {
- /*
- * response from old query, ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; old answer:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto wait;
- }
-#ifdef CHECK_SRVR_ADDR
- if (!(_res.options & RES_INSECURE1) &&
- !res_isourserver(&from)) {
- /*
- * response from wrong server? ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; not our server:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto wait;
- }
-#endif
- if (!(_res.options & RES_INSECURE2) &&
- !res_queriesmatch(buf, buf + buflen,
- ans, ans + anssiz)) {
- /*
- * response contains wrong query? ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; wrong query name:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto wait;
- }
- if (anhp->rcode == SERVFAIL ||
- anhp->rcode == NOTIMP ||
- anhp->rcode == REFUSED) {
- DprintQ(_res.options & RES_DEBUG,
- (stdout, "server rejected query:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- badns |= (1 << ns);
- res_close();
- /* don't retry if called from dig */
- if (!_res.pfcode)
- goto next_ns;
- }
- if (!(_res.options & RES_IGNTC) && anhp->tc) {
- /*
- * get rest of answer;
- * use TCP with same server.
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; truncated answer\n"));
- v_circuit = 1;
- res_close();
- goto same_ns;
- }
- } /*if vc/dg*/
- Dprint((_res.options & RES_DEBUG) ||
- ((_res.pfcode & RES_PRF_REPLY) &&
- (_res.pfcode & RES_PRF_HEAD1)),
- (stdout, ";; got answer:\n"));
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, "%s", ""),
- ans, (resplen>anssiz)?anssiz:resplen);
- /*
- * If using virtual circuits, we assume that the first server
- * is preferred over the rest (i.e. it is on the local
- * machine) and only keep that one open.
- * If we have temporarily opened a virtual circuit,
- * or if we haven't been asked to keep a socket open,
- * close the socket.
- */
- if ((v_circuit && (!(_res.options & RES_USEVC) || ns != 0)) ||
- !(_res.options & RES_STAYOPEN)) {
- res_close();
- }
- if (Rhook) {
- int done = 0, loops = 0;
-
- do {
- res_sendhookact act;
-
- act = (*Rhook)(nsap, buf, buflen,
- ans, anssiz, &resplen);
- switch (act) {
- case res_goahead:
- case res_done:
- done = 1;
- break;
- case res_nextns:
- res_close();
- goto next_ns;
- case res_modified:
- /* give the hook another try */
- if (++loops < 42) /*doug adams*/
- break;
- /*FALLTHROUGH*/
- case res_error:
- /*FALLTHROUGH*/
- default:
- return (-1);
- }
- } while (!done);
-
- }
- return (resplen);
- next_ns: ;
- } /*foreach ns*/
- } /*foreach retry*/
- res_close();
- if (!v_circuit) {
- if (!gotsomewhere)
- errno = ECONNREFUSED; /* no nameservers found */
- else
- errno = ETIMEDOUT; /* no answer obtained */
- } else
- errno = terrno;
- return (-1);
-}
-
-/*
- * This routine is for closing the socket if a virtual circuit is used and
- * the program wants to close it. This provides support for endhostent()
- * which expects to close the socket.
- *
- * This routine is not expected to be user visible.
- */
-void
-res_close()
-{
- if (s >= 0) {
- (void) close(s);
- s = -1;
- connected = 0;
- vc = 0;
- }
-}
diff --git a/c/src/libnetworking/libc/res_stubs.c b/c/src/libnetworking/libc/res_stubs.c
deleted file mode 100644
index 92cf0fac54..0000000000
--- a/c/src/libnetworking/libc/res_stubs.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 1996 Peter Wemm <peter@freebsd.org>.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- * $Id$
- */
-
-/*
- * This file is for FreeBSD-3.0 that has a bind-4.9.5-P1 derived
- * resolver in the libc. It provides aliases for functions that
- * have moved since 4.9.4-P1.
- *
- * I'll save everybody the trouble and say it now: *THIS IS A HACK*!
- *
- * Yes, many of these are private functions to the resolver, but some are
- * needed as there is no other way to provide the functionality and they've
- * turned up all over the place. :-(
- */
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-__weak_reference(__inet_addr, inet_addr);
-__weak_reference(__inet_aton, inet_aton);
-__weak_reference(__inet_lnaof, inet_lnaof);
-__weak_reference(__inet_makeaddr, inet_makeaddr);
-__weak_reference(__inet_neta, inet_neta);
-__weak_reference(__inet_netof, inet_netof);
-__weak_reference(__inet_network, inet_network);
-__weak_reference(__inet_net_ntop, inet_net_ntop);
-__weak_reference(__inet_net_pton, inet_net_pton);
-__weak_reference(__inet_ntoa, inet_ntoa);
-__weak_reference(__inet_pton, inet_pton);
-__weak_reference(__inet_ntop, inet_ntop);
-__weak_reference(__inet_nsap_addr, inet_nsap_addr);
-__weak_reference(__inet_nsap_ntoa, inet_nsap_ntoa);
-
-__weak_reference(__sym_ston, sym_ston);
-__weak_reference(__sym_ntos, sym_ntos);
-__weak_reference(__sym_ntop, sym_ntop);
-__weak_reference(__fp_resstat, fp_resstat);
-__weak_reference(__p_query, p_query);
-__weak_reference(__p_fqnname, p_fqnname);
-__weak_reference(__p_secstodate, p_secstodate);
-__weak_reference(__dn_count_labels, dn_count_labels);
-__weak_reference(__dn_comp, dn_comp);
-__weak_reference(__res_close, _res_close);
-__weak_reference(__dn_expand, dn_expand);
-__weak_reference(__res_init, res_init);
-__weak_reference(__res_query, res_query);
-__weak_reference(__res_search, res_search);
-__weak_reference(__res_querydomain, res_querydomain);
-__weak_reference(__res_mkquery, res_mkquery);
-__weak_reference(__res_send, res_send);
diff --git a/c/src/libnetworking/libc/res_update.c b/c/src/libnetworking/libc/res_update.c
deleted file mode 100644
index ef591e0674..0000000000
--- a/c/src/libnetworking/libc/res_update.c
+++ /dev/null
@@ -1,518 +0,0 @@
-#if !defined(__rtems__)
-#if !defined(lint) && !defined(SABER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Based on the Dynamic DNS reference implementation by Viraj Bais
- * <viraj_bais@ccm.fm.intel.com>
- */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <errno.h>
-#include <limits.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/*
- * Separate a linked list of records into groups so that all records
- * in a group will belong to a single zone on the nameserver.
- * Create a dynamic update packet for each zone and send it to the
- * nameservers for that zone, and await answer.
- * Abort if error occurs in updating any zone.
- * Return the number of zones updated on success, < 0 on error.
- *
- * On error, caller must deal with the unsynchronized zones
- * eg. an A record might have been successfully added to the forward
- * zone but the corresponding PTR record would be missing if error
- * was encountered while updating the reverse zone.
- */
-
-#define NSMAX 16
-
-struct ns1 {
- char nsname[MAXDNAME];
- struct in_addr nsaddr1;
-};
-
-struct zonegrp {
- char z_origin[MAXDNAME];
- int16_t z_class;
- char z_soardata[MAXDNAME + 5 * INT32SZ];
- struct ns1 z_ns[NSMAX];
- int z_nscount;
- ns_updrec * z_rr;
- struct zonegrp *z_next;
-};
-
-
-int
-res_update(ns_updrec *rrecp_in) {
- ns_updrec *rrecp, *tmprrecp;
- u_char buf[PACKETSZ], answer[PACKETSZ], packet[2*PACKETSZ];
- char name[MAXDNAME], zname[MAXDNAME], primary[MAXDNAME],
- mailaddr[MAXDNAME];
- u_char soardata[2*MAXCDNAME+5*INT32SZ];
- char *dname, *svdname, *cp1, *target;
- u_char *cp, *eom;
- HEADER *hp = (HEADER *) answer;
- struct zonegrp *zptr = NULL, *tmpzptr, *prevzptr, *zgrp_start = NULL;
- int i, j, k = 0, n, ancount, nscount, arcount, rcode, rdatasize,
- newgroup, done, myzone, seen_before, numzones = 0;
- u_int16_t dlen, class, qclass, type, qtype;
- u_int32_t ttl;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-
- for (rrecp = rrecp_in; rrecp; rrecp = rrecp->r_next) {
- dname = rrecp->r_dname;
- n = strlen(dname);
- if (dname[n-1] == '.')
- dname[n-1] = '\0';
- qtype = T_SOA;
- qclass = rrecp->r_class;
- done = 0;
- seen_before = 0;
-
- while (!done && dname) {
- if (qtype == T_SOA) {
- for (tmpzptr = zgrp_start;
- tmpzptr && !seen_before;
- tmpzptr = tmpzptr->z_next) {
- if (strcasecmp(dname,
- tmpzptr->z_origin) == 0 &&
- tmpzptr->z_class == qclass)
- seen_before++;
- for (tmprrecp = tmpzptr->z_rr;
- tmprrecp && !seen_before;
- tmprrecp = tmprrecp->r_grpnext)
- if (strcasecmp(dname, tmprrecp->r_dname) == 0
- && tmprrecp->r_class == qclass) {
- seen_before++;
- break;
- }
- if (seen_before) {
- /*
- * Append to the end of
- * current group.
- */
- for (tmprrecp = tmpzptr->z_rr;
- tmprrecp->r_grpnext;
- tmprrecp = tmprrecp->r_grpnext)
- (void)NULL;
- tmprrecp->r_grpnext = rrecp;
- rrecp->r_grpnext = NULL;
- done = 1;
- break;
- }
- }
- } else if (qtype == T_A) {
- for (tmpzptr = zgrp_start;
- tmpzptr && !done;
- tmpzptr = tmpzptr->z_next)
- for (i = 0; i < tmpzptr->z_nscount; i++)
- if (tmpzptr->z_class == qclass &&
- strcasecmp(tmpzptr->z_ns[i].nsname,
- dname) == 0 &&
- tmpzptr->z_ns[i].nsaddr1.s_addr != 0) {
- zptr->z_ns[k].nsaddr1.s_addr =
- tmpzptr->z_ns[i].nsaddr1.s_addr;
- done = 1;
- break;
- }
- }
- if (done)
- break;
- n = res_mkquery(QUERY, dname, qclass, qtype, NULL,
- 0, NULL, buf, sizeof buf);
- if (n <= 0) {
- fprintf(stderr, "res_update: mkquery failed\n");
- return (n);
- }
- n = res_send(buf, n, answer, sizeof answer);
- if (n < 0) {
- fprintf(stderr, "res_update: send error for %s\n",
- rrecp->r_dname);
- return (n);
- }
- if (n < HFIXEDSZ)
- return (-1);
- ancount = ntohs(hp->ancount);
- nscount = ntohs(hp->nscount);
- arcount = ntohs(hp->arcount);
- rcode = hp->rcode;
- cp = answer + HFIXEDSZ;
- eom = answer + n;
- /* skip the question section */
- n = dn_skipname(cp, eom);
- if (n < 0 || cp + n + 2 * INT16SZ > eom)
- return (-1);
- cp += n + 2 * INT16SZ;
-
- if (qtype == T_SOA) {
- if (ancount == 0 && nscount == 0 && arcount == 0) {
- /*
- * if (rcode == NOERROR) then the dname exists but
- * has no soa record associated with it.
- * if (rcode == NXDOMAIN) then the dname does not
- * exist and the server is replying out of NCACHE.
- * in either case, proceed with the next try
- */
- dname = strchr(dname, '.');
- if (dname != NULL)
- dname++;
- continue;
- } else if ((rcode == NOERROR || rcode == NXDOMAIN) &&
- ancount == 0 &&
- nscount == 1 && arcount == 0) {
- /*
- * name/data does not exist, soa record supplied in the
- * authority section
- */
- /* authority section must contain the soa record */
- if ((n = dn_expand(answer, eom, cp, zname,
- sizeof zname)) < 0)
- return (n);
- cp += n;
- if (cp + 2 * INT16SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- if (type != T_SOA || class != qclass) {
- fprintf(stderr, "unknown answer\n");
- return (-1);
- }
- myzone = 0;
- svdname = dname;
- while (dname)
- if (strcasecmp(dname, zname) == 0) {
- myzone = 1;
- break;
- } else if ((dname = strchr(dname, '.')) != NULL)
- dname++;
- if (!myzone) {
- dname = strchr(svdname, '.');
- if (dname != NULL)
- dname++;
- continue;
- }
- nscount = 0;
- /* fallthrough */
- } else if (rcode == NOERROR && ancount == 1) {
- /*
- * found the zone name
- * new servers will supply NS records for the zone
- * in authority section and A records for those
- * nameservers in the additional section
- * older servers have to be explicitly queried for
- * NS records for the zone
- */
- /* answer section must contain the soa record */
- if ((n = dn_expand(answer, eom, cp, zname,
- sizeof zname)) < 0)
- return (n);
- else
- cp += n;
- if (cp + 2 * INT16SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- if (type == T_CNAME) {
- dname = strchr(dname, '.');
- if (dname != NULL)
- dname++;
- continue;
- }
- if (strcasecmp(dname, zname) != 0 ||
- type != T_SOA ||
- class != rrecp->r_class) {
- fprintf(stderr, "unknown answer\n");
- return (-1);
- }
- /* FALLTHROUGH */
- } else {
- fprintf(stderr,
- "unknown response: ans=%d, auth=%d, add=%d, rcode=%d\n",
- ancount, nscount, arcount, hp->rcode);
- return (-1);
- }
- if (cp + INT32SZ + INT16SZ > eom)
- return (-1);
- /* continue processing the soa record */
- GETLONG(ttl, cp);
- GETSHORT(dlen, cp);
- if (cp + dlen > eom)
- return (-1);
- newgroup = 1;
- zptr = zgrp_start;
- prevzptr = NULL;
- while (zptr) {
- if (strcasecmp(zname, zptr->z_origin) == 0 &&
- type == T_SOA && class == qclass) {
- newgroup = 0;
- break;
- }
- prevzptr = zptr;
- zptr = zptr->z_next;
- }
- if (!newgroup) {
- for (tmprrecp = zptr->z_rr;
- tmprrecp->r_grpnext;
- tmprrecp = tmprrecp->r_grpnext)
- ;
- tmprrecp->r_grpnext = rrecp;
- rrecp->r_grpnext = NULL;
- done = 1;
- cp += dlen;
- break;
- } else {
- if ((n = dn_expand(answer, eom, cp, primary,
- sizeof primary)) < 0)
- return (n);
- cp += n;
- /*
- * We don't have to bounds check here because the
- * next use of 'cp' is in dn_expand().
- */
- cp1 = (char *)soardata;
- strcpy(cp1, primary);
- cp1 += strlen(cp1) + 1;
- if ((n = dn_expand(answer, eom, cp, mailaddr,
- sizeof mailaddr)) < 0)
- return (n);
- cp += n;
- strcpy(cp1, mailaddr);
- cp1 += strlen(cp1) + 1;
- if (cp + 5*INT32SZ > eom)
- return (-1);
- memcpy(cp1, cp, 5*INT32SZ);
- cp += 5*INT32SZ;
- cp1 += 5*INT32SZ;
- rdatasize = (u_char *)cp1 - soardata;
- zptr = calloc(1, sizeof(struct zonegrp));
- if (zptr == NULL)
- return (-1);
- if (zgrp_start == NULL)
- zgrp_start = zptr;
- else
- prevzptr->z_next = zptr;
- zptr->z_rr = rrecp;
- rrecp->r_grpnext = NULL;
- strcpy(zptr->z_origin, zname);
- zptr->z_class = class;
- memcpy(zptr->z_soardata, soardata, rdatasize);
- /* fallthrough to process NS and A records */
- }
- } else if (qtype == T_NS) {
- if (rcode == NOERROR && ancount > 0) {
- strcpy(zname, dname);
- for (zptr = zgrp_start; zptr; zptr = zptr->z_next) {
- if (strcasecmp(zname, zptr->z_origin) == 0)
- break;
- }
- if (zptr == NULL)
- /* should not happen */
- return (-1);
- if (nscount > 0) {
- /*
- * answer and authority sections contain
- * the same information, skip answer section
- */
- for (j = 0; j < ancount; j++) {
- n = dn_skipname(cp, eom);
- if (n < 0)
- return (-1);
- n += 2*INT16SZ + INT32SZ;
- if (cp + n + INT16SZ > eom)
- return (-1);
- cp += n;
- GETSHORT(dlen, cp);
- cp += dlen;
- }
- } else
- nscount = ancount;
- /* fallthrough to process NS and A records */
- } else {
- fprintf(stderr, "cannot determine nameservers for %s:\
-ans=%d, auth=%d, add=%d, rcode=%d\n",
- dname, ancount, nscount, arcount, hp->rcode);
- return (-1);
- }
- } else if (qtype == T_A) {
- if (rcode == NOERROR && ancount > 0) {
- arcount = ancount;
- ancount = nscount = 0;
- /* fallthrough to process A records */
- } else {
- fprintf(stderr, "cannot determine address for %s:\
-ans=%d, auth=%d, add=%d, rcode=%d\n",
- dname, ancount, nscount, arcount, hp->rcode);
- return (-1);
- }
- }
- /* process NS records for the zone */
- j = 0;
- for (i = 0; i < nscount; i++) {
- if ((n = dn_expand(answer, eom, cp, name,
- sizeof name)) < 0)
- return (n);
- cp += n;
- if (cp + 3 * INT16SZ + INT32SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- GETLONG(ttl, cp);
- GETSHORT(dlen, cp);
- if (cp + dlen > eom)
- return (-1);
- if (strcasecmp(name, zname) == 0 &&
- type == T_NS && class == qclass) {
- if ((n = dn_expand(answer, eom, cp,
- name, sizeof name)) < 0)
- return (n);
- target = zptr->z_ns[j++].nsname;
- strcpy(target, name);
- }
- cp += dlen;
- }
- if (zptr->z_nscount == 0)
- zptr->z_nscount = j;
- /* get addresses for the nameservers */
- for (i = 0; i < arcount; i++) {
- if ((n = dn_expand(answer, eom, cp, name,
- sizeof name)) < 0)
- return (n);
- cp += n;
- if (cp + 3 * INT16SZ + INT32SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- GETLONG(ttl, cp);
- GETSHORT(dlen, cp);
- if (cp + dlen > eom)
- return (-1);
- if (type == T_A && dlen == INT32SZ && class == qclass) {
- for (j = 0; j < zptr->z_nscount; j++)
- if (strcasecmp(name, zptr->z_ns[j].nsname) == 0) {
- memcpy(&zptr->z_ns[j].nsaddr1.s_addr, cp,
- INT32SZ);
- break;
- }
- }
- cp += dlen;
- }
- if (zptr->z_nscount == 0) {
- dname = zname;
- qtype = T_NS;
- continue;
- }
- done = 1;
- for (k = 0; k < zptr->z_nscount; k++)
- if (zptr->z_ns[k].nsaddr1.s_addr == 0) {
- done = 0;
- dname = zptr->z_ns[k].nsname;
- qtype = T_A;
- }
-
- } /* while */
- }
-
- _res.options |= RES_DEBUG;
- for (zptr = zgrp_start; zptr; zptr = zptr->z_next) {
-
- /* append zone section */
- rrecp = res_mkupdrec(ns_s_zn, zptr->z_origin,
- zptr->z_class, ns_t_soa, 0);
- if (rrecp == NULL) {
- fprintf(stderr, "saverrec error\n");
- fflush(stderr);
- return (-1);
- }
- rrecp->r_grpnext = zptr->z_rr;
- zptr->z_rr = rrecp;
-
- n = res_mkupdate(zptr->z_rr, packet, sizeof packet);
- if (n < 0) {
- fprintf(stderr, "res_mkupdate error\n");
- fflush(stderr);
- return (-1);
- } else
- fprintf(stdout, "res_mkupdate: packet size = %d\n", n);
-
- /*
- * Override the list of NS records from res_init() with
- * the authoritative nameservers for the zone being updated.
- * Sort primary to be the first in the list of nameservers.
- */
- for (i = 0; i < zptr->z_nscount; i++) {
- if (strcasecmp(zptr->z_ns[i].nsname,
- zptr->z_soardata) == 0) {
- struct in_addr tmpaddr;
-
- if (i != 0) {
- strcpy(zptr->z_ns[i].nsname,
- zptr->z_ns[0].nsname);
- strcpy(zptr->z_ns[0].nsname,
- zptr->z_soardata);
- tmpaddr = zptr->z_ns[i].nsaddr1;
- zptr->z_ns[i].nsaddr1 =
- zptr->z_ns[0].nsaddr1;
- zptr->z_ns[0].nsaddr1 = tmpaddr;
- }
- break;
- }
- }
- for (i = 0; i < MAXNS; i++) {
- _res.nsaddr_list[i].sin_addr = zptr->z_ns[i].nsaddr1;
- _res.nsaddr_list[i].sin_family = AF_INET;
- _res.nsaddr_list[i].sin_port = htons(NAMESERVER_PORT);
- }
- _res.nscount = (zptr->z_nscount < MAXNS) ?
- zptr->z_nscount : MAXNS;
- n = res_send(packet, n, answer, sizeof(answer));
- if (n < 0) {
- fprintf(stderr, "res_send: send error, n=%d\n", n);
- break;
- } else
- numzones++;
- }
-
- /* free malloc'ed memory */
- while(zgrp_start) {
- zptr = zgrp_start;
- zgrp_start = zgrp_start->z_next;
- res_freeupdrec(zptr->z_rr); /* Zone section we allocated. */
- free((char *)zptr);
- }
-
- return (numzones);
-}
diff --git a/c/src/libnetworking/libc/resolver.3 b/c/src/libnetworking/libc/resolver.3
deleted file mode 100644
index 8c6f18334f..0000000000
--- a/c/src/libnetworking/libc/resolver.3
+++ /dev/null
@@ -1,352 +0,0 @@
-.\" Copyright (c) 1985, 1991, 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.
-.\"
-.\" @(#)resolver.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt RESOLVER 3
-.Os BSD 4.3
-.Sh NAME
-.Nm res_query ,
-.Nm res_search ,
-.Nm res_mkquery ,
-.Nm res_send ,
-.Nm res_init ,
-.Nm dn_comp ,
-.Nm dn_expand
-.Nd resolver routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netinet/in.h>
-.Fd #include <arpa/nameser.h>
-.Fd #include <resolv.h>
-.Ft int
-.Fo res_query
-.Fa "const char *dname"
-.Fa "int class"
-.Fa "int type"
-.Fa "u_char *answer"
-.Fa "int anslen"
-.Fc
-.Ft int
-.Fo res_search
-.Fa "const char *dname"
-.Fa "int class"
-.Fa "int type"
-.Fa "u_char *answer"
-.Fa "int anslen"
-.Fc
-.Ft int
-.Fo res_mkquery
-.Fa "int op"
-.Fa "const char *dname"
-.Fa "int class"
-.Fa "int type"
-.Fa "const u_char *data"
-.Fa "int datalen"
-.Fa "const u_char *newrr_in"
-.Fa "u_char *buf"
-.Fa "int buflen"
-.Fc
-.Ft int
-.Fo res_send
-.Fa "const u_char *msg"
-.Fa "int msglen"
-.Fa "u_char *answer"
-.Fa "int anslen"
-.Fc
-.Ft int
-.Fn res_init
-.Fo dn_comp
-.Fa "const char *exp_dn"
-.Fa "u_char *comp_dn"
-.Fa "int length"
-.Fa "u_char **dnptrs"
-.Fa "u_char **lastdnptr"
-.Fc
-.Ft int
-.Fo dn_expand
-.Fa "const u_char *msg"
-.Fa "const u_char *eomorig"
-.Fa "const u_char *comp_dn"
-.Fa "char *exp_dn"
-.Fa "int length"
-.Fc
-.Sh DESCRIPTION
-These routines are used for making, sending and interpreting
-query and reply messages with Internet domain name servers.
-.Pp
-Global configuration and state information that is used by the
-resolver routines is kept in the structure
-.Em _res .
-Most of the values have reasonable defaults and can be ignored.
-Options
-stored in
-.Em _res.options
-are defined in
-.Pa resolv.h
-and are as follows.
-Options are stored as a simple bit mask containing the bitwise ``or''
-of the options enabled.
-.Bl -tag -width RES_DEFNAMES
-.It Dv RES_INIT
-True if the initial name server address and default domain name are
-initialized (i.e.,
-.Fn res_init
-has been called).
-.It Dv RES_DEBUG
-Print debugging messages.
-.It Dv RES_AAONLY
-Accept authoritative answers only.
-With this option,
-.Fn res_send
-should continue until it finds an authoritative answer or finds an error.
-Currently this is not implemented.
-.It Dv RES_USEVC
-Use
-.Tn TCP
-connections for queries instead of
-.Tn UDP
-datagrams.
-.It Dv RES_STAYOPEN
-Used with
-.Dv RES_USEVC
-to keep the
-.Tn TCP
-connection open between
-queries.
-This is useful only in programs that regularly do many queries.
-.Tn UDP
-should be the normal mode used.
-.It Dv RES_IGNTC
-Unused currently (ignore truncation errors, i.e., don't retry with
-.Tn TCP ) .
-.It Dv RES_RECURSE
-Set the recursion-desired bit in queries.
-This is the default.
-.Pf ( Fn res_send
-does not do iterative queries and expects the name server
-to handle recursion.)
-.It Dv RES_DEFNAMES
-If set,
-.Fn res_search
-will append the default domain name to single-component names
-(those that do not contain a dot).
-This option is enabled by default.
-.It Dv RES_DNSRCH
-If this option is set,
-.Fn res_search
-will search for host names in the current domain and in parent domains; see
-.Xr hostname 7 .
-This is used by the standard host lookup routine
-.Xr gethostbyname 3 .
-This option is enabled by default.
-.It Dv RES_NOALIASES
-This option turns off the user level aliasing feature controlled by the
-.Dq Ev HOSTALIASES
-environment variable. Network daemons should set this option.
-.El
-.Pp
-The
-.Fn res_init
-routine
-reads the configuration file (if any; see
-.Xr resolver 5 )
-to get the default domain name,
-search list and
-the Internet address of the local name server(s).
-If no server is configured, the host running
-the resolver is tried.
-The current domain name is defined by the hostname
-if not specified in the configuration file;
-it can be overridden by the environment variable
-.Ev LOCALDOMAIN .
-This environment variable may contain several blank-separated
-tokens if you wish to override the
-.Em "search list"
-on a per-process basis. This is similar to the
-.Em search
-command in the configuration file.
-Another environment variable (
-.Dq Ev RES_OPTIONS
-can be set to
-override certain internal resolver options which are otherwise
-set by changing fields in the
-.Em _res
-structure or are inherited from the configuration file's
-.Em options
-command. The syntax of the
-.Dq Ev RES_OPTIONS
-environment variable is explained in
-.Xr resolver 5 .
-Initialization normally occurs on the first call
-to one of the following routines.
-.Pp
-The
-.Fn res_query
-function provides an interface to the server query mechanism.
-It constructs a query, sends it to the local server,
-awaits a response, and makes preliminary checks on the reply.
-The query requests information of the specified
-.Fa type
-and
-.Fa class
-for the specified fully-qualified domain name
-.Fa dname .
-The reply message is left in the
-.Fa answer
-buffer with length
-.Fa anslen
-supplied by the caller.
-.Pp
-The
-.Fn res_search
-routine makes a query and awaits a response like
-.Fn res_query ,
-but in addition, it implements the default and search rules
-controlled by the
-.Dv RES_DEFNAMES
-and
-.Dv RES_DNSRCH
-options.
-It returns the first successful reply.
-.Pp
-The remaining routines are lower-level routines used by
-.Fn res_query .
-The
-.Fn res_mkquery
-function
-constructs a standard query message and places it in
-.Fa buf .
-It returns the size of the query, or \-1 if the query is
-larger than
-.Fa buflen .
-The query type
-.Fa op
-is usually
-.Dv QUERY ,
-but can be any of the query types defined in
-.Aq Pa arpa/nameser.h .
-The domain name for the query is given by
-.Fa dname .
-.Fa Newrr
-is currently unused but is intended for making update messages.
-.Pp
-The
-.Fn res_send
-routine
-sends a pre-formatted query and returns an answer.
-It will call
-.Fn res_init
-if
-.Dv RES_INIT
-is not set, send the query to the local name server, and
-handle timeouts and retries.
-The length of the reply message is returned, or
-\-1 if there were errors.
-.Pp
-The
-.Fn dn_comp
-function
-compresses the domain name
-.Fa exp_dn
-and stores it in
-.Fa comp_dn .
-The size of the compressed name is returned or \-1 if there were errors.
-The size of the array pointed to by
-.Fa comp_dn
-is given by
-.Fa length .
-The compression uses
-an array of pointers
-.Fa dnptrs
-to previously-compressed names in the current message.
-The first pointer points to
-to the beginning of the message and the list ends with
-.Dv NULL .
-The limit to the array is specified by
-.Fa lastdnptr .
-A side effect of
-.Fn dn_comp
-is to update the list of pointers for
-labels inserted into the message
-as the name is compressed.
-If
-.Em dnptr
-is
-.Dv NULL, names are not compressed.
-If
-.Fa lastdnptr
-is
-.Dv NULL ,
-the list of labels is not updated.
-.Pp
-The
-.Fn dn_expand
-entry
-expands the compressed domain name
-.Fa comp_dn
-to a full domain name
-The compressed name is contained in a query or reply message;
-.Fa msg
-is a pointer to the beginning of the message.
-The uncompressed name is placed in the buffer indicated by
-.Fa exp_dn
-which is of size
-.Fa length .
-The size of compressed name is returned or \-1 if there was an error.
-.Sh FILES
-.Bl -tag -width Pa
-/etc/resolv.conf
-The configuration file
-see
-.Xr resolver 5 .
-.El
-.Sh SEE ALSO
-.Xr gethostbyname 3 ,
-.Xr resolver 5 ,
-.Xr hostname 7 ,
-.Xr named 8
-.Pp
-.%T RFC1032 ,
-.%T RFC1033 ,
-.%T RFC1034 ,
-.%T RFC1035 ,
-.%T RFC974
-.Rs
-.%T "Name Server Operations Guide for BIND"
-.Re
-.Sh HISTORY
-The
-.Nm
-function appeared in
-.Bx 4.3 .
diff --git a/c/src/libnetworking/libc/send.c b/c/src/libnetworking/libc/send.c
deleted file mode 100644
index ad14bd3cd2..0000000000
--- a/c/src/libnetworking/libc/send.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)send.c 8.2 (Berkeley) 2/21/94";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <stddef.h>
-
-ssize_t
-send(s, msg, len, flags)
- int s, flags;
- size_t len;
- const void *msg;
-{
- return (sendto(s, msg, len, flags, NULL, 0));
-}
diff --git a/c/src/libnetworking/libc/strsep.c b/c/src/libnetworking/libc/strsep.c
deleted file mode 100644
index 182319493d..0000000000
--- a/c/src/libnetworking/libc/strsep.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * Copyright (c) 1990, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <string.h>
-#include <stdio.h>
-
-/*
- * Get next token from string *stringp, where tokens are possibly-empty
- * strings separated by characters from delim.
- *
- * Writes NULs into the string at *stringp to end tokens.
- * delim need not remain constant from call to call.
- * On return, *stringp points past the last NUL written (if there might
- * be further tokens), or is NULL (if there are definitely no more tokens).
- *
- * If *stringp is NULL, strsep returns NULL.
- *
- * PUBLIC: #ifndef HAVE_STRSEP
- * PUBLIC: char *strsep __P((char **, const char *));
- * PUBLIC: #endif
- */
-char *
-strsep(stringp, delim)
- register char **stringp;
- register const char *delim;
-{
- register char *s;
- register const char *spanp;
- register int c, sc;
- char *tok;
-
- if ((s = *stringp) == NULL)
- return (NULL);
- for (tok = s;;) {
- c = *s++;
- spanp = delim;
- do {
- if ((sc = *spanp++) == c) {
- if (c == 0)
- s = NULL;
- else
- s[-1] = 0;
- *stringp = s;
- return (tok);
- }
- } while (sc != 0);
- }
- /* NOTREACHED */
-}
diff --git a/c/src/libnetworking/loop.h b/c/src/libnetworking/loop.h
deleted file mode 100644
index 34e0b828e4..0000000000
--- a/c/src/libnetworking/loop.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-#define NLOOP 1
diff --git a/c/src/libnetworking/machine/conf.h b/c/src/libnetworking/machine/conf.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/libnetworking/machine/conf.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/libnetworking/machine/cpu.h b/c/src/libnetworking/machine/cpu.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/libnetworking/machine/cpu.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/libnetworking/machine/cpufunc.h b/c/src/libnetworking/machine/cpufunc.h
deleted file mode 100644
index 2b4c47e48f..0000000000
--- a/c/src/libnetworking/machine/cpufunc.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
diff --git a/c/src/libnetworking/machine/endian.h b/c/src/libnetworking/machine/endian.h
deleted file mode 100644
index 6b17da58d3..0000000000
--- a/c/src/libnetworking/machine/endian.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef _MACHINE_ENDIAN_H_
-#define _MACHINE_ENDIAN_H_
-
-#include <rtems/score/cpu.h>
-
-/*
- * BSD-style endian declaration
- */
-#define BIG_ENDIAN 4321
-#define LITTLE_ENDIAN 1234
-
-#if CPU_BIG_ENDIAN
-# define BYTE_ORDER BIG_ENDIAN
-#elif CPU_LITTLE_ENDIAN
-# define BYTE_ORDER LITTLE_ENDIAN
-#else
-# error "Can't decide which end is which!"
-#endif
-
-#if ( CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES == FALSE )
-
-#if ( CPU_BIG_ENDIAN == TRUE )
-
-/*
- * Very simply on big endian CPUs
- */
-
-#define ntohl(_x) (_x)
-#define ntohs(_x) (_x)
-#define htonl(_x) (_x)
-#define htons(_x) (_x)
-
-#define NTOHS(x)
-#define HTONS(x)
-#define NTOHL(x)
-#define HTONL(x)
-
-#elif ( CPU_LITTLE_ENDIAN == TRUE )
-
-/*
- * A little more complicated on little endian CPUs
- */
-
-#define ntohl(_x) ((long) CPU_swap_u32((unsigned32)_x))
-#define ntohs(_x) ((short) CPU_swap_u16((unsigned16)_x))
-#define htonl(_x) ((long) CPU_swap_u32((unsigned32)_x))
-#define htons(_x) ((short) CPU_swap_u16((unsigned16)_x))
-
-#define NTOHS(x) (x) = ntohs(x)
-#define HTONS(x) (x) = htons(x)
-#define NTOHL(x) (x) = ntohl(x)
-#define HTONL(x) (x) = htonl(x)
-
-#else
-#error "Unknown endian-ness for this cpu"
-#endif
-
-#endif /* CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES */
-
-#endif /* _MACHINE_ENDIAN_H_ */
diff --git a/c/src/libnetworking/machine/in_cksum.h b/c/src/libnetworking/machine/in_cksum.h
deleted file mode 100644
index 15509b3888..0000000000
--- a/c/src/libnetworking/machine/in_cksum.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * Copyright (c) 1990 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.
- *
- * from tahoe: in_cksum.c 1.2 86/01/05
- * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
- * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
- * $Id$
- */
-
-#ifndef _MACHINE_IN_CKSUM_H_
-#define _MACHINE_IN_CKSUM_H_ 1
-
-#include <sys/cdefs.h>
-
-/*
- * It it useful to have an Internet checksum routine which is inlineable
- * and optimized specifically for the task of computing IP header checksums
- * in the normal case (where there are no options and the header length is
- * therefore always exactly five 32-bit words.
- */
-#if (defined(__GNUC__) && defined(__i386__))
-static __inline u_int
-in_cksum_hdr(const struct ip *ip)
-{
- register u_int sum = 0;
-
-#define ADD(n) __asm("addl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (ip))
-#define ADDC(n) __asm("adcl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (ip))
-#define MOP __asm("adcl $0, %0" : "=r" (sum) : "0" (sum))
-
- ADD(0);
- ADDC(4);
- ADDC(8);
- ADDC(12);
- ADDC(16);
- MOP;
- sum = (sum & 0xffff) + (sum >> 16);
- if (sum > 0xffff)
- sum -= 0xffff;
-
- return ~sum & 0xffff;
-}
-
-static __inline void
-in_cksum_update(struct ip *ip)
-{
- int __tmpsum;
- __tmpsum = (int)ntohs(ip->ip_sum) + 256;
- ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
-}
-
-#elif (defined(__GNUC__) && (defined(__mc68000__) || defined(__m68k__)))
-
-static __inline__ u_int
-in_cksum_hdr(const struct ip *ip)
-{
- register u_int *ap = (u_int *)ip;
- register u_int sum = *ap++;
- register u_int tmp;
-
- __asm__("addl %2@+,%0\n\t"
- "movel %2@+,%1\n\t"
- "addxl %1,%0\n\t"
- "movel %2@+,%1\n\t"
- "addxl %1,%0\n\t"
- "movel %2@,%1\n\t"
- "addxl %1,%0\n\t"
- "moveq #0,%1\n\t"
- "addxl %1,%0\n" :
- "=d" (sum), "=d" (tmp), "=a" (ap) :
- "0" (sum), "2" (ap));
- sum = (sum & 0xffff) + (sum >> 16);
- if (sum > 0xffff)
- sum -= 0xffff;
- return ~sum & 0xffff;
-}
-
-#else
-u_int in_cksum_hdr __P((const struct ip *));
-#define in_cksum_update(ip) \
- do { \
- int __tmpsum; \
- __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
- ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
- } while(0)
-
-#endif
-
-#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/c/src/libnetworking/machine/limits.h b/c/src/libnetworking/machine/limits.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/libnetworking/machine/limits.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/libnetworking/machine/param.h b/c/src/libnetworking/machine/param.h
deleted file mode 100644
index 4168f1f6cf..0000000000
--- a/c/src/libnetworking/machine/param.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef _MACHINE_PARAM_H_
-#define _MACHINE_PARAM_H_
-
-/*
- * These aren't really machine-dependent for RTEMS.....
- */
-
-/*
-#define MACHINE "i386"
-#define MID_MACHINE MID_I386
-*/
-
-/*
- * Round p (pointer or byte index) up to a correctly-aligned value
- * for all data types (int, long, ...). The result is unsigned int
- * and must be cast to any desired pointer type.
- */
-#define ALIGNBYTES (sizeof(int) - 1)
-#define ALIGN(p) (((unsigned)(p) + ALIGNBYTES) & ~ALIGNBYTES)
-
-#define PAGE_SHIFT 12 /* LOG2(PAGE_SIZE) */
-#define PAGE_SIZE (1<<PAGE_SHIFT) /* bytes/page */
-#define PAGE_MASK (PAGE_SIZE-1)
-#define NPTEPG (PAGE_SIZE/(sizeof (pt_entry_t)))
-
-#define NPDEPG (PAGE_SIZE/(sizeof (pd_entry_t)))
-#define PDRSHIFT 22 /* LOG2(NBPDR) */
-#define NBPDR (1<<PDRSHIFT) /* bytes/page dir */
-
-#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
-#define DEV_BSIZE (1<<DEV_BSHIFT)
-
-#define BLKDEV_IOSIZE 2048
-#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
-
-#define UPAGES 2 /* pages of u-area */
-
-/*
- * Constants related to network buffer management.
- * MCLBYTES must be no larger than CLBYTES (the software page size), and,
- * on machines that exchange pages of input or output buffers with mbuf
- * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
- * of the hardware page size.
- */
-#ifndef MSIZE
-#define MSIZE 128 /* size of an mbuf */
-#endif /* MSIZE */
-
-#ifndef MCLSHIFT
-#define MCLSHIFT 11 /* convert bytes to m_buf clusters */
-#endif /* MCLSHIFT */
-#define MCLBYTES (1 << MCLSHIFT) /* size of an m_buf cluster */
-#define MCLOFSET (MCLBYTES - 1) /* offset within an m_buf cluster */
-
-/*
- * Some macros for units conversion
- */
-
-/* clicks to bytes */
-#define ctob(x) ((x)<<PAGE_SHIFT)
-
-/* bytes to clicks */
-#define btoc(x) (((unsigned)(x)+PAGE_MASK)>>PAGE_SHIFT)
-
-/*
- * btodb() is messy and perhaps slow because `bytes' may be an off_t. We
- * want to shift an unsigned type to avoid sign extension and we don't
- * want to widen `bytes' unnecessarily. Assume that the result fits in
- * a daddr_t.
- */
-#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
- (sizeof (bytes) > sizeof(long) \
- ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \
- : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT))
-
-#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
- ((off_t)(db) << DEV_BSHIFT)
-
-/*
- * Mach derived conversion macros
- */
-#define trunc_page(x) ((unsigned)(x) & ~PAGE_MASK)
-#define round_page(x) ((((unsigned)(x)) + PAGE_MASK) & ~PAGE_MASK)
-
-#define atop(x) ((unsigned)(x) >> PAGE_SHIFT)
-#define ptoa(x) ((unsigned)(x) << PAGE_SHIFT)
-
-#endif /* !_MACHINE_PARAM_H_ */
diff --git a/c/src/libnetworking/machine/types.h b/c/src/libnetworking/machine/types.h
deleted file mode 100644
index 730a6dec1d..0000000000
--- a/c/src/libnetworking/machine/types.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file will have to be incorparated into the RTEMS source
- * tree (probably in the existing <machine/types.h> so that these
- * contents are included when an application source file includes
- * <sys/types.h>.
- *
- * $Id$
- */
-
-#ifndef _MACHINE_TYPES_H_
-#define _MACHINE_TYPES_H_
-
-#include <rtems.h>
-#include <machine/endian.h>
-
-typedef rtems_signed64 int64_t;
-typedef rtems_signed32 int32_t;
-typedef rtems_signed16 int16_t;
-typedef rtems_signed8 int8_t;
-
-typedef rtems_unsigned64 u_int64_t;
-typedef rtems_unsigned32 u_int32_t;
-typedef rtems_unsigned16 u_int16_t;
-typedef rtems_unsigned8 u_int8_t;
-
-#define _CLOCK_T_ unsigned long
-#define _TIME_T_ long
-
-#ifdef _COMPILING_BSD_KERNEL_
-#include <rtems/rtems_bsdnet_internal.h>
-#include <rtems/rtems_bsdnet.h>
-#endif
-
-#endif /* _MACHINE_TYPES_H_ */
diff --git a/c/src/libnetworking/machine/vmparam.h b/c/src/libnetworking/machine/vmparam.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/libnetworking/machine/vmparam.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/libnetworking/net/Makefile.in b/c/src/libnetworking/net/Makefile.in
deleted file mode 100644
index 5a68c81ec0..0000000000
--- a/c/src/libnetworking/net/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=lib.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES=if if_ethersubr if_loop \
- radix route rtsock \
- raw_cb raw_usrreq
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \
- -DDIAGNOSTIC -DBOOTP_COMPAT
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
diff --git a/c/src/libnetworking/net/bpf.h b/c/src/libnetworking/net/bpf.h
deleted file mode 100644
index 7847d72470..0000000000
--- a/c/src/libnetworking/net/bpf.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 1990, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from the Stanford/CMU enet packet filter,
- * (net/enet.c) distributed as part of 4.3BSD, and code contributed
- * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
- * Berkeley Laboratory.
- *
- * 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.
- *
- * @(#)bpf.h 8.1 (Berkeley) 6/10/93
- * @(#)bpf.h 1.34 (LBL) 6/16/96
- *
- * $Id$
- */
-
-#ifndef _NET_BPF_H_
-#define _NET_BPF_H_
-
-/* BSD style release date */
-#define BPF_RELEASE 199606
-
-typedef int32_t bpf_int32;
-typedef u_int32_t bpf_u_int32;
-
-/*
- * Alignment macros. BPF_WORDALIGN rounds up to the next
- * even multiple of BPF_ALIGNMENT.
- */
-#define BPF_ALIGNMENT sizeof(bpf_int32)
-#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))
-
-#define BPF_MAXINSNS 512
-#define BPF_MAXBUFSIZE 0x8000
-#define BPF_MINBUFSIZE 32
-
-/*
- * Structure for BIOCSETF.
- */
-struct bpf_program {
- u_int bf_len;
- struct bpf_insn *bf_insns;
-};
-
-/*
- * Struct returned by BIOCGSTATS.
- */
-struct bpf_stat {
- u_int bs_recv; /* number of packets received */
- u_int bs_drop; /* number of packets dropped */
-};
-
-/*
- * Struct return by BIOCVERSION. This represents the version number of
- * the filter language described by the instruction encodings below.
- * bpf understands a program iff kernel_major == filter_major &&
- * kernel_minor >= filter_minor, that is, if the value returned by the
- * running kernel has the same major number and a minor number equal
- * equal to or less than the filter being downloaded. Otherwise, the
- * results are undefined, meaning an error may be returned or packets
- * may be accepted haphazardly.
- * It has nothing to do with the source code version.
- */
-struct bpf_version {
- u_short bv_major;
- u_short bv_minor;
-};
-/* Current version number of filter architecture. */
-#define BPF_MAJOR_VERSION 1
-#define BPF_MINOR_VERSION 1
-
-#define BIOCGBLEN _IOR('B',102, u_int)
-#define BIOCSBLEN _IOWR('B',102, u_int)
-#define BIOCSETF _IOW('B',103, struct bpf_program)
-#define BIOCFLUSH _IO('B',104)
-#define BIOCPROMISC _IO('B',105)
-#define BIOCGDLT _IOR('B',106, u_int)
-#define BIOCGETIF _IOR('B',107, struct ifreq)
-#define BIOCSETIF _IOW('B',108, struct ifreq)
-#define BIOCSRTIMEOUT _IOW('B',109, struct timeval)
-#define BIOCGRTIMEOUT _IOR('B',110, struct timeval)
-#define BIOCGSTATS _IOR('B',111, struct bpf_stat)
-#define BIOCIMMEDIATE _IOW('B',112, u_int)
-#define BIOCVERSION _IOR('B',113, struct bpf_version)
-#define BIOCGRSIG _IOR('B',114, u_int)
-#define BIOCSRSIG _IOW('B',115, u_int)
-
-/*
- * Structure prepended to each packet.
- */
-struct bpf_hdr {
- struct timeval bh_tstamp; /* time stamp */
- bpf_u_int32 bh_caplen; /* length of captured portion */
- bpf_u_int32 bh_datalen; /* original length of packet */
- u_short bh_hdrlen; /* length of bpf header (this struct
- plus alignment padding) */
-};
-/*
- * Because the structure above is not a multiple of 4 bytes, some compilers
- * will insist on inserting padding; hence, sizeof(struct bpf_hdr) won't work.
- * Only the kernel needs to know about it; applications use bh_hdrlen.
- */
-#ifdef KERNEL
-#define SIZEOF_BPF_HDR 18
-#endif
-
-/*
- * Data-link level type codes.
- */
-#define DLT_NULL 0 /* no link-layer encapsulation */
-#define DLT_EN10MB 1 /* Ethernet (10Mb) */
-#define DLT_EN3MB 2 /* Experimental Ethernet (3Mb) */
-#define DLT_AX25 3 /* Amateur Radio AX.25 */
-#define DLT_PRONET 4 /* Proteon ProNET Token Ring */
-#define DLT_CHAOS 5 /* Chaos */
-#define DLT_IEEE802 6 /* IEEE 802 Networks */
-#define DLT_ARCNET 7 /* ARCNET */
-#define DLT_SLIP 8 /* Serial Line IP */
-#define DLT_PPP 9 /* Point-to-point Protocol */
-#define DLT_FDDI 10 /* FDDI */
-#define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */
-
-/*
- * The instruction encodings.
- */
-/* instruction classes */
-#define BPF_CLASS(code) ((code) & 0x07)
-#define BPF_LD 0x00
-#define BPF_LDX 0x01
-#define BPF_ST 0x02
-#define BPF_STX 0x03
-#define BPF_ALU 0x04
-#define BPF_JMP 0x05
-#define BPF_RET 0x06
-#define BPF_MISC 0x07
-
-/* ld/ldx fields */
-#define BPF_SIZE(code) ((code) & 0x18)
-#define BPF_W 0x00
-#define BPF_H 0x08
-#define BPF_B 0x10
-#define BPF_MODE(code) ((code) & 0xe0)
-#define BPF_IMM 0x00
-#define BPF_ABS 0x20
-#define BPF_IND 0x40
-#define BPF_MEM 0x60
-#define BPF_LEN 0x80
-#define BPF_MSH 0xa0
-
-/* alu/jmp fields */
-#define BPF_OP(code) ((code) & 0xf0)
-#define BPF_ADD 0x00
-#define BPF_SUB 0x10
-#define BPF_MUL 0x20
-#define BPF_DIV 0x30
-#define BPF_OR 0x40
-#define BPF_AND 0x50
-#define BPF_LSH 0x60
-#define BPF_RSH 0x70
-#define BPF_NEG 0x80
-#define BPF_JA 0x00
-#define BPF_JEQ 0x10
-#define BPF_JGT 0x20
-#define BPF_JGE 0x30
-#define BPF_JSET 0x40
-#define BPF_SRC(code) ((code) & 0x08)
-#define BPF_K 0x00
-#define BPF_X 0x08
-
-/* ret - BPF_K and BPF_X also apply */
-#define BPF_RVAL(code) ((code) & 0x18)
-#define BPF_A 0x10
-
-/* misc */
-#define BPF_MISCOP(code) ((code) & 0xf8)
-#define BPF_TAX 0x00
-#define BPF_TXA 0x80
-
-/*
- * The instruction data structure.
- */
-struct bpf_insn {
- u_short code;
- u_char jt;
- u_char jf;
- bpf_u_int32 k;
-};
-
-/*
- * Macros for insn array initializers.
- */
-#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }
-#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }
-
-#ifdef KERNEL
-int bpf_validate __P((struct bpf_insn *, int));
-void bpf_tap __P((struct ifnet *, u_char *, u_int));
-void bpf_mtap __P((struct ifnet *, struct mbuf *));
-void bpfattach __P((struct ifnet *, u_int, u_int));
-void bpfilterattach __P((int));
-u_int bpf_filter __P((struct bpf_insn *, u_char *, u_int, u_int));
-#endif
-
-/*
- * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
- */
-#define BPF_MEMWORDS 16
-
-#endif
diff --git a/c/src/libnetworking/net/ethernet.h b/c/src/libnetworking/net/ethernet.h
deleted file mode 100644
index c6c07189ec..0000000000
--- a/c/src/libnetworking/net/ethernet.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Fundamental constants relating to ethernet.
- *
- * $Id$
- *
- */
-
-#ifndef _NET_ETHERNET_H_
-#define _NET_ETHERNET_H_
-
-/*
- * The number of bytes in an ethernet (MAC) address.
- */
-#define ETHER_ADDR_LEN 6
-
-/*
- * The number of bytes in the type field.
- */
-#define ETHER_TYPE_LEN 2
-
-/*
- * The number of bytes in the trailing CRC field.
- */
-#define ETHER_CRC_LEN 4
-
-/*
- * The length of the combined header.
- */
-#define ETHER_HDR_LEN (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
-
-/*
- * The minimum packet length.
- */
-#define ETHER_MIN_LEN 64
-
-/*
- * The maximum packet length.
- */
-#define ETHER_MAX_LEN 1518
-
-/*
- * A macro to validate a length with
- */
-#define ETHER_IS_VALID_LEN(foo) \
- ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
-
-/*
- * Structure of a 10Mb/s Ethernet header.
- */
-struct ether_header {
- u_char ether_dhost[ETHER_ADDR_LEN];
- u_char ether_shost[ETHER_ADDR_LEN];
- u_short ether_type;
-};
-
-/*
- * Structure of a 48-bit Ethernet address.
- */
-struct ether_addr {
- u_char octet[ETHER_ADDR_LEN];
-};
-
-#endif
diff --git a/c/src/libnetworking/net/if.c b/c/src/libnetworking/net/if.c
deleted file mode 100644
index af6f003de3..0000000000
--- a/c/src/libnetworking/net/if.c
+++ /dev/null
@@ -1,783 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)if.c 8.3 (Berkeley) 1/4/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/mbuf.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/kernel.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/if_types.h>
-#include <net/radix.h>
-
-/*
- * System initialization
- */
-
-static int ifconf __P((int, caddr_t));
- void ifinit __P((void *));
-static void if_qflush __P((struct ifqueue *));
-static void if_slowtimo __P((void *));
-static void link_rtrequest __P((int, struct rtentry *, struct sockaddr *));
-
-SYSINIT(interfaces, SI_SUB_PROTO_IF, SI_ORDER_FIRST, ifinit, NULL)
-
-
-int ifqmaxlen = IFQ_MAXLEN;
-struct ifnet *ifnet;
-
-/*
- * Network interface utility routines.
- *
- * Routines with ifa_ifwith* names take sockaddr *'s as
- * parameters.
- *
- * This routine assumes that it will be called at splimp() or higher.
- */
-/* ARGSUSED*/
-void
-ifinit(dummy)
- void *dummy;
-{
- register struct ifnet *ifp;
-
- for (ifp = ifnet; ifp; ifp = ifp->if_next)
- if (ifp->if_snd.ifq_maxlen == 0)
- ifp->if_snd.ifq_maxlen = ifqmaxlen;
- if_slowtimo(0);
-}
-
-int if_index = 0;
-struct ifaddr **ifnet_addrs;
-
-
-/*
- * Attach an interface to the
- * list of "active" interfaces.
- */
-void
-if_attach(ifp)
- struct ifnet *ifp;
-{
- unsigned socksize, ifasize;
- int namelen, masklen;
- char workbuf[64];
- register struct ifnet **p = &ifnet;
- register struct sockaddr_dl *sdl;
- register struct ifaddr *ifa;
- static int if_indexlim = 8;
-
-
- while (*p)
- p = &((*p)->if_next);
- *p = ifp;
- ifp->if_index = ++if_index;
- microtime(&ifp->if_lastchange);
- if (ifnet_addrs == 0 || if_index >= if_indexlim) {
- unsigned n = (if_indexlim <<= 1) * sizeof(ifa);
- struct ifaddr **q = (struct ifaddr **)
- malloc(n, M_IFADDR, M_WAITOK);
- bzero((caddr_t)q, n);
- if (ifnet_addrs) {
- bcopy((caddr_t)ifnet_addrs, (caddr_t)q, n/2);
- free((caddr_t)ifnet_addrs, M_IFADDR);
- }
- ifnet_addrs = q;
- }
- /*
- * create a Link Level name for this device
- */
- namelen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit);
-#define _offsetof(t, m) ((int)((caddr_t)&((t *)0)->m))
- masklen = _offsetof(struct sockaddr_dl, sdl_data[0]) + namelen;
- socksize = masklen + ifp->if_addrlen;
-#define ROUNDUP(a) (1 + (((a) - 1) | (sizeof(long) - 1)))
- socksize = ROUNDUP(socksize);
- if (socksize < sizeof(*sdl))
- socksize = sizeof(*sdl);
- ifasize = sizeof(*ifa) + 2 * socksize;
- ifa = (struct ifaddr *)malloc(ifasize, M_IFADDR, M_WAITOK);
- if (ifa) {
- bzero((caddr_t)ifa, ifasize);
- sdl = (struct sockaddr_dl *)(ifa + 1);
- sdl->sdl_len = socksize;
- sdl->sdl_family = AF_LINK;
- bcopy(workbuf, sdl->sdl_data, namelen);
- sdl->sdl_nlen = namelen;
- sdl->sdl_index = ifp->if_index;
- sdl->sdl_type = ifp->if_type;
- ifnet_addrs[if_index - 1] = ifa;
- ifa->ifa_ifp = ifp;
- ifa->ifa_next = ifp->if_addrlist;
- ifa->ifa_rtrequest = link_rtrequest;
- ifp->if_addrlist = ifa;
- ifa->ifa_addr = (struct sockaddr *)sdl;
-
- sdl = (struct sockaddr_dl *)(socksize + (caddr_t)sdl);
- ifa->ifa_netmask = (struct sockaddr *)sdl;
- sdl->sdl_len = masklen;
- while (namelen != 0)
- sdl->sdl_data[--namelen] = 0xff;
- }
-}
-/*
- * Locate an interface based on a complete address.
- */
-/*ARGSUSED*/
-struct ifaddr *
-ifa_ifwithaddr(addr)
- register struct sockaddr *addr;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
-
-#define equal(a1, a2) \
- (bcmp((caddr_t)(a1), (caddr_t)(a2), ((struct sockaddr *)(a1))->sa_len) == 0)
- for (ifp = ifnet; ifp; ifp = ifp->if_next)
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr->sa_family != addr->sa_family)
- continue;
- if (equal(addr, ifa->ifa_addr))
- return (ifa);
- if ((ifp->if_flags & IFF_BROADCAST) && ifa->ifa_broadaddr &&
- equal(ifa->ifa_broadaddr, addr))
- return (ifa);
- }
- return ((struct ifaddr *)0);
-}
-/*
- * Locate the point to point interface with a given destination address.
- */
-/*ARGSUSED*/
-struct ifaddr *
-ifa_ifwithdstaddr(addr)
- register struct sockaddr *addr;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
-
- for (ifp = ifnet; ifp; ifp = ifp->if_next)
- if (ifp->if_flags & IFF_POINTOPOINT)
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr->sa_family != addr->sa_family)
- continue;
- if (ifa->ifa_dstaddr && equal(addr, ifa->ifa_dstaddr))
- return (ifa);
- }
- return ((struct ifaddr *)0);
-}
-
-/*
- * Find an interface on a specific network. If many, choice
- * is most specific found.
- */
-struct ifaddr *
-ifa_ifwithnet(addr)
- struct sockaddr *addr;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
- struct ifaddr *ifa_maybe = (struct ifaddr *) 0;
- u_int af = addr->sa_family;
- char *addr_data = addr->sa_data, *cplim;
-
- if (af == AF_LINK) {
- register struct sockaddr_dl *sdl = (struct sockaddr_dl *)addr;
- if (sdl->sdl_index && sdl->sdl_index <= if_index)
- return (ifnet_addrs[sdl->sdl_index - 1]);
- }
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- register char *cp, *cp2, *cp3;
-
- if (ifa->ifa_addr->sa_family != af)
- next: continue;
- if (ifp->if_flags & IFF_POINTOPOINT) {
- if (ifa->ifa_dstaddr != 0
- && equal(addr, ifa->ifa_dstaddr))
- return (ifa);
- } else {
- /*
- * if we have a special address handler,
- * then use it instead of the generic one.
- */
- if (ifa->ifa_claim_addr) {
- if ((*ifa->ifa_claim_addr)(ifa, addr)) {
- return (ifa);
- } else {
- continue;
- }
- }
-
- /*
- * Scan all the bits in the ifa's address.
- * If a bit dissagrees with what we are
- * looking for, mask it with the netmask
- * to see if it really matters.
- * (A byte at a time)
- */
- if (ifa->ifa_netmask == 0)
- continue;
- cp = addr_data;
- cp2 = ifa->ifa_addr->sa_data;
- cp3 = ifa->ifa_netmask->sa_data;
- cplim = ifa->ifa_netmask->sa_len + (char *)ifa->ifa_netmask;
- while (cp3 < cplim)
- if ((*cp++ ^ *cp2++) & *cp3++)
- goto next;
- if (ifa_maybe == 0 ||
- rn_refines((caddr_t)ifa->ifa_netmask,
- (caddr_t)ifa_maybe->ifa_netmask))
- ifa_maybe = ifa;
- }
- }
- }
- return (ifa_maybe);
-}
-
-/*
- * Find an interface address specific to an interface best matching
- * a given address.
- */
-struct ifaddr *
-ifaof_ifpforaddr(addr, ifp)
- struct sockaddr *addr;
- register struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
- register char *cp, *cp2, *cp3;
- register char *cplim;
- struct ifaddr *ifa_maybe = 0;
- u_int af = addr->sa_family;
-
- if (af >= AF_MAX)
- return (0);
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr->sa_family != af)
- continue;
- if (ifa_maybe == 0)
- ifa_maybe = ifa;
- if (ifa->ifa_netmask == 0) {
- if (equal(addr, ifa->ifa_addr) ||
- (ifa->ifa_dstaddr && equal(addr, ifa->ifa_dstaddr)))
- return (ifa);
- continue;
- }
- if (ifp->if_flags & IFF_POINTOPOINT) {
- if (equal(addr, ifa->ifa_dstaddr))
- return (ifa);
- } else {
- cp = addr->sa_data;
- cp2 = ifa->ifa_addr->sa_data;
- cp3 = ifa->ifa_netmask->sa_data;
- cplim = ifa->ifa_netmask->sa_len + (char *)ifa->ifa_netmask;
- for (; cp3 < cplim; cp3++)
- if ((*cp++ ^ *cp2++) & *cp3)
- break;
- if (cp3 == cplim)
- return (ifa);
- }
- }
- return (ifa_maybe);
-}
-
-#include <net/route.h>
-
-/*
- * Default action when installing a route with a Link Level gateway.
- * Lookup an appropriate real ifa to point to.
- * This should be moved to /sys/net/link.c eventually.
- */
-static void
-link_rtrequest(cmd, rt, sa)
- int cmd;
- register struct rtentry *rt;
- struct sockaddr *sa;
-{
- register struct ifaddr *ifa;
- struct sockaddr *dst;
- struct ifnet *ifp;
-
- if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == 0) ||
- ((ifp = ifa->ifa_ifp) == 0) || ((dst = rt_key(rt)) == 0))
- return;
- ifa = ifaof_ifpforaddr(dst, ifp);
- if (ifa) {
- IFAFREE(rt->rt_ifa);
- rt->rt_ifa = ifa;
- ifa->ifa_refcnt++;
- if (ifa->ifa_rtrequest && ifa->ifa_rtrequest != link_rtrequest)
- ifa->ifa_rtrequest(cmd, rt, sa);
- }
-}
-
-/*
- * Mark an interface down and notify protocols of
- * the transition.
- * NOTE: must be called at splnet or eqivalent.
- */
-void
-if_down(ifp)
- register struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
-
- ifp->if_flags &= ~IFF_UP;
- microtime(&ifp->if_lastchange);
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
- if_qflush(&ifp->if_snd);
- rt_ifmsg(ifp);
-}
-
-/*
- * Mark an interface up and notify protocols of
- * the transition.
- * NOTE: must be called at splnet or eqivalent.
- */
-void
-if_up(ifp)
- register struct ifnet *ifp;
-{
-
- ifp->if_flags |= IFF_UP;
- microtime(&ifp->if_lastchange);
-#ifdef notyet
- register struct ifaddr *ifa;
- /* this has no effect on IP, and will kill all iso connections XXX */
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- pfctlinput(PRC_IFUP, ifa->ifa_addr);
-#endif
- rt_ifmsg(ifp);
-}
-
-/*
- * Flush an interface queue.
- */
-static void
-if_qflush(ifq)
- register struct ifqueue *ifq;
-{
- register struct mbuf *m, *n;
-
- n = ifq->ifq_head;
- while ((m = n) != 0) {
- n = m->m_act;
- m_freem(m);
- }
- ifq->ifq_head = 0;
- ifq->ifq_tail = 0;
- ifq->ifq_len = 0;
-}
-
-/*
- * Handle interface watchdog timer routines. Called
- * from softclock, we decrement timers (if set) and
- * call the appropriate interface routine on expiration.
- */
-static void
-if_slowtimo(arg)
- void *arg;
-{
- register struct ifnet *ifp;
- int s = splimp();
-
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- if (ifp->if_timer == 0 || --ifp->if_timer)
- continue;
- if (ifp->if_watchdog)
- (*ifp->if_watchdog)(ifp);
- }
- splx(s);
- timeout(if_slowtimo, (void *)0, hz / IFNET_SLOWHZ);
-}
-
-/*
- * Map interface name to
- * interface structure pointer.
- */
-struct ifnet *
-ifunit(name)
- register char *name;
-{
- register char *cp;
- register struct ifnet *ifp;
- int unit;
- unsigned len;
- char *ep, c;
-
- for (cp = name; cp < name + IFNAMSIZ && *cp; cp++)
- if (*cp >= '0' && *cp <= '9')
- break;
- if (*cp == '\0' || cp == name + IFNAMSIZ)
- return ((struct ifnet *)0);
- /*
- * Save first char of unit, and pointer to it,
- * so we can put a null there to avoid matching
- * initial substrings of interface names.
- */
- len = cp - name + 1;
- c = *cp;
- ep = cp;
- for (unit = 0; *cp >= '0' && *cp <= '9'; )
- unit = unit * 10 + *cp++ - '0';
- if (*cp != '\0')
- return 0; /* no trailing garbage allowed */
- *ep = 0;
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- if (bcmp(ifp->if_name, name, len))
- continue;
- if (unit == ifp->if_unit)
- break;
- }
- *ep = c;
- return (ifp);
-}
-
-/*
- * Interface ioctls.
- */
-int
-ifioctl(so, cmd, data, p)
- struct socket *so;
- int cmd;
- caddr_t data;
- struct proc *p;
-{
- register struct ifnet *ifp;
- register struct ifreq *ifr;
- int error;
-
- switch (cmd) {
-
- case SIOCGIFCONF:
- case OSIOCGIFCONF:
- return (ifconf(cmd, data));
- }
- ifr = (struct ifreq *)data;
- ifp = ifunit(ifr->ifr_name);
- if (ifp == 0)
- return (ENXIO);
- switch (cmd) {
-
- case SIOCGIFFLAGS:
- ifr->ifr_flags = ifp->if_flags;
- break;
-
- case SIOCGIFMETRIC:
- ifr->ifr_metric = ifp->if_metric;
- break;
-
- case SIOCGIFMTU:
- ifr->ifr_mtu = ifp->if_mtu;
- break;
-
- case SIOCGIFPHYS:
- ifr->ifr_phys = ifp->if_physical;
- break;
-
- case SIOCSIFFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_flags & IFF_UP && (ifr->ifr_flags & IFF_UP) == 0) {
- int s = splimp();
- if_down(ifp);
- splx(s);
- }
- if (ifr->ifr_flags & IFF_UP && (ifp->if_flags & IFF_UP) == 0) {
- int s = splimp();
- if_up(ifp);
- splx(s);
- }
- ifp->if_flags = (ifp->if_flags & IFF_CANTCHANGE) |
- (ifr->ifr_flags &~ IFF_CANTCHANGE);
- if (ifp->if_ioctl)
- (void) (*ifp->if_ioctl)(ifp, cmd, data);
- microtime(&ifp->if_lastchange);
- break;
-
- case SIOCSIFMETRIC:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- ifp->if_metric = ifr->ifr_metric;
- microtime(&ifp->if_lastchange);
- break;
-
- case SIOCSIFPHYS:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return error;
- if (!ifp->if_ioctl)
- return EOPNOTSUPP;
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0)
- microtime(&ifp->if_lastchange);
- return(error);
-
- case SIOCSIFMTU:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_ioctl == NULL)
- return (EOPNOTSUPP);
- /*
- * 72 was chosen below because it is the size of a TCP/IP
- * header (40) + the minimum mss (32).
- */
- if (ifr->ifr_mtu < 72 || ifr->ifr_mtu > 65535)
- return (EINVAL);
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0)
- microtime(&ifp->if_lastchange);
- return(error);
-
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_ioctl == NULL)
- return (EOPNOTSUPP);
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0 )
- microtime(&ifp->if_lastchange);
- return(error);
-
- case SIOCSIFMEDIA:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_ioctl == 0)
- return (EOPNOTSUPP);
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0)
- microtime(&ifp->if_lastchange);
- return error;
-
- case SIOCGIFMEDIA:
- if (ifp->if_ioctl == 0)
- return (EOPNOTSUPP);
- return ((*ifp->if_ioctl)(ifp, cmd, data));
-
- default:
- if (so->so_proto == 0)
- return (EOPNOTSUPP);
-#ifndef COMPAT_43
- return ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
- data,
- ifp));
-#else
- {
- int ocmd = cmd;
-
- switch (cmd) {
-
- case SIOCSIFDSTADDR:
- case SIOCSIFADDR:
- case SIOCSIFBRDADDR:
- case SIOCSIFNETMASK:
-#if BYTE_ORDER != BIG_ENDIAN
- if (ifr->ifr_addr.sa_family == 0 &&
- ifr->ifr_addr.sa_len < 16) {
- ifr->ifr_addr.sa_family = ifr->ifr_addr.sa_len;
- ifr->ifr_addr.sa_len = 16;
- }
-#else
- if (ifr->ifr_addr.sa_len == 0)
- ifr->ifr_addr.sa_len = 16;
-#endif
- break;
-
- case OSIOCGIFADDR:
- cmd = SIOCGIFADDR;
- break;
-
- case OSIOCGIFDSTADDR:
- cmd = SIOCGIFDSTADDR;
- break;
-
- case OSIOCGIFBRDADDR:
- cmd = SIOCGIFBRDADDR;
- break;
-
- case OSIOCGIFNETMASK:
- cmd = SIOCGIFNETMASK;
- }
- error = ((*so->so_proto->pr_usrreqs->pru_control)(so,
- cmd,
- data,
- ifp));
- switch (ocmd) {
-
- case OSIOCGIFADDR:
- case OSIOCGIFDSTADDR:
- case OSIOCGIFBRDADDR:
- case OSIOCGIFNETMASK:
- *(u_short *)&ifr->ifr_addr = ifr->ifr_addr.sa_family;
- }
- return (error);
-
- }
-#endif
- }
- return (0);
-}
-
-/*
- * Set/clear promiscuous mode on interface ifp based on the truth value
- * of pswitch. The calls are reference counted so that only the first
- * "on" request actually has an effect, as does the final "off" request.
- * Results are undefined if the "off" and "on" requests are not matched.
- */
-int
-ifpromisc(ifp, pswitch)
- struct ifnet *ifp;
- int pswitch;
-{
- struct ifreq ifr;
-
- if (pswitch) {
- /*
- * If the device is not configured up, we cannot put it in
- * promiscuous mode.
- */
- if ((ifp->if_flags & IFF_UP) == 0)
- return (ENETDOWN);
- if (ifp->if_pcount++ != 0)
- return (0);
- ifp->if_flags |= IFF_PROMISC;
- log(LOG_INFO, "%s%d: promiscuous mode enabled\n",
- ifp->if_name, ifp->if_unit);
- } else {
- if (--ifp->if_pcount > 0)
- return (0);
- ifp->if_flags &= ~IFF_PROMISC;
- }
- ifr.ifr_flags = ifp->if_flags;
- return ((*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr));
-}
-
-/*
- * Return interface configuration
- * of system. List may be used
- * in later ioctl's (above) to get
- * other information.
- */
-/*ARGSUSED*/
-static int
-ifconf(cmd, data)
- int cmd;
- caddr_t data;
-{
- register struct ifconf *ifc = (struct ifconf *)data;
- register struct ifnet *ifp = ifnet;
- register struct ifaddr *ifa;
- struct ifreq ifr, *ifrp;
- int space = ifc->ifc_len, error = 0;
-
- ifrp = ifc->ifc_req;
- for (; space > sizeof (ifr) && ifp; ifp = ifp->if_next) {
- char workbuf[64];
- int ifnlen;
-
- ifnlen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit);
- if(ifnlen + 1 > sizeof ifr.ifr_name) {
- error = ENAMETOOLONG;
- } else {
- strcpy(ifr.ifr_name, workbuf);
- }
-
- if ((ifa = ifp->if_addrlist) == 0) {
- bzero((caddr_t)&ifr.ifr_addr, sizeof(ifr.ifr_addr));
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr));
- if (error)
- break;
- space -= sizeof (ifr), ifrp++;
- } else
- for ( ; space > sizeof (ifr) && ifa; ifa = ifa->ifa_next) {
- register struct sockaddr *sa = ifa->ifa_addr;
-#ifdef COMPAT_43
- if (cmd == OSIOCGIFCONF) {
- struct osockaddr *osa =
- (struct osockaddr *)&ifr.ifr_addr;
- ifr.ifr_addr = *sa;
- osa->sa_family = sa->sa_family;
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr));
- ifrp++;
- } else
-#endif
- if (sa->sa_len <= sizeof(*sa)) {
- ifr.ifr_addr = *sa;
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr));
- ifrp++;
- } else {
- space -= sa->sa_len - sizeof(*sa);
- if (space < sizeof (ifr))
- break;
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr.ifr_name));
- if (error == 0)
- error = copyout((caddr_t)sa,
- (caddr_t)&ifrp->ifr_addr, sa->sa_len);
- ifrp = (struct ifreq *)
- (sa->sa_len + (caddr_t)&ifrp->ifr_addr);
- }
- if (error)
- break;
- space -= sizeof (ifr);
- }
- }
- ifc->ifc_len -= space;
- return (error);
-}
-
-SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers");
-SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management");
diff --git a/c/src/libnetworking/net/if.h b/c/src/libnetworking/net/if.h
deleted file mode 100644
index acddd4f095..0000000000
--- a/c/src/libnetworking/net/if.h
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 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.
- *
- * @(#)if.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_H_
-#define _NET_IF_H_
-
-/*
- * Structures defining a network interface, providing a packet
- * transport mechanism (ala level 0 of the PUP protocols).
- *
- * Each interface accepts output datagrams of a specified maximum
- * length, and provides higher level routines with input datagrams
- * received from its medium.
- *
- * Output occurs when the routine if_output is called, with three parameters:
- * (*ifp->if_output)(ifp, m, dst, rt)
- * Here m is the mbuf chain to be sent and dst is the destination address.
- * The output routine encapsulates the supplied datagram if necessary,
- * and then transmits it on its medium.
- *
- * On input, each interface unwraps the data received by it, and either
- * places it on the input queue of a internetwork datagram routine
- * and posts the associated software interrupt, or passes the datagram to a raw
- * packet input routine.
- *
- * Routines exist for locating interfaces by their addresses
- * or for locating a interface on a certain network, as well as more general
- * routing and gateway routines maintaining information used to locate
- * interfaces. These routines live in the files if.c and route.c
- */
-
-#ifndef _TIME_ /* XXX fast fix for SNMP, going away soon */
-#include <sys/time.h>
-#endif
-
-#ifdef __STDC__
-/*
- * Forward structure declarations for function prototypes [sic].
- */
-struct mbuf;
-struct proc;
-struct rtentry;
-struct socket;
-struct ether_header;
-#endif
-
-/*
- * Structure describing information about an interface
- * which may be of interest to management entities.
- */
-struct if_data {
- /* generic interface information */
- u_char ifi_type; /* ethernet, tokenring, etc */
- u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */
- u_char ifi_addrlen; /* media address length */
- u_char ifi_hdrlen; /* media header length */
- u_char ifi_recvquota; /* polling quota for receive intrs */
- u_char ifi_xmitquota; /* polling quota for xmit intrs */
- u_long ifi_mtu; /* maximum transmission unit */
- u_long ifi_metric; /* routing metric (external only) */
- u_long ifi_baudrate; /* linespeed */
- /* volatile statistics */
- u_long ifi_ipackets; /* packets received on interface */
- u_long ifi_ierrors; /* input errors on interface */
- u_long ifi_opackets; /* packets sent on interface */
- u_long ifi_oerrors; /* output errors on interface */
- u_long ifi_collisions; /* collisions on csma interfaces */
- u_long ifi_ibytes; /* total number of octets received */
- u_long ifi_obytes; /* total number of octets sent */
- u_long ifi_imcasts; /* packets received via multicast */
- u_long ifi_omcasts; /* packets sent via multicast */
- u_long ifi_iqdrops; /* dropped on input, this interface */
- u_long ifi_noproto; /* destined for unsupported protocol */
- u_long ifi_recvtiming; /* usec spent receiving when timing */
- u_long ifi_xmittiming; /* usec spent xmitting when timing */
- struct timeval ifi_lastchange; /* time of last administrative change */
-};
-
-/*
- * Structure defining a queue for a network interface.
- */
-struct ifqueue {
- struct mbuf *ifq_head;
- struct mbuf *ifq_tail;
- int ifq_len;
- int ifq_maxlen;
- int ifq_drops;
-};
-
-/*
- * Structure defining a network interface.
- *
- * (Would like to call this struct ``if'', but C isn't PL/1.)
- */
-struct ifnet {
- void *if_softc; /* pointer to driver state */
- char *if_name; /* name, e.g. ``en'' or ``lo'' */
- struct ifnet *if_next; /* all struct ifnets are chained */
- struct ifaddr *if_addrlist; /* linked list of addresses per if */
- int if_pcount; /* number of promiscuous listeners */
- struct bpf_if *if_bpf; /* packet filter structure */
- u_short if_index; /* numeric abbreviation for this if */
- short if_unit; /* sub-unit for lower level driver */
- short if_timer; /* time 'til if_watchdog called */
- short if_flags; /* up/down, broadcast, etc. */
- int if_ipending; /* interrupts pending */
- void *if_linkmib; /* link-type-specific MIB data */
- size_t if_linkmiblen; /* length of above data */
- struct if_data if_data;
-/* procedure handles */
- int (*if_output) /* output routine (enqueue) */
- __P((struct ifnet *, struct mbuf *, struct sockaddr *,
- struct rtentry *));
- void (*if_start) /* initiate output routine */
- __P((struct ifnet *));
- int (*if_done) /* output complete routine */
- __P((struct ifnet *)); /* (XXX not used; fake prototype) */
- int (*if_ioctl) /* ioctl routine */
- __P((struct ifnet *, int, caddr_t));
- void (*if_watchdog) /* timer routine */
- __P((struct ifnet *));
- int (*if_poll_recv) /* polled receive routine */
- __P((struct ifnet *, int *));
- int (*if_poll_xmit) /* polled transmit routine */
- __P((struct ifnet *, int *));
- void (*if_poll_intren) /* polled interrupt reenable routine */
- __P((struct ifnet *));
- void (*if_poll_slowinput) /* input routine for slow devices */
- __P((struct ifnet *, struct mbuf *));
- void (*if_init) /* Init routine */
- __P((void *));
- struct ifqueue if_snd; /* output queue */
- struct ifqueue *if_poll_slowq; /* input queue for slow devices */
-};
-typedef void if_init_f_t __P((void *));
-
-#define if_mtu if_data.ifi_mtu
-#define if_type if_data.ifi_type
-#define if_physical if_data.ifi_physical
-#define if_addrlen if_data.ifi_addrlen
-#define if_hdrlen if_data.ifi_hdrlen
-#define if_metric if_data.ifi_metric
-#define if_baudrate if_data.ifi_baudrate
-#define if_ipackets if_data.ifi_ipackets
-#define if_ierrors if_data.ifi_ierrors
-#define if_opackets if_data.ifi_opackets
-#define if_oerrors if_data.ifi_oerrors
-#define if_collisions if_data.ifi_collisions
-#define if_ibytes if_data.ifi_ibytes
-#define if_obytes if_data.ifi_obytes
-#define if_imcasts if_data.ifi_imcasts
-#define if_omcasts if_data.ifi_omcasts
-#define if_iqdrops if_data.ifi_iqdrops
-#define if_noproto if_data.ifi_noproto
-#define if_lastchange if_data.ifi_lastchange
-#define if_recvquota if_data.ifi_recvquota
-#define if_xmitquota if_data.ifi_xmitquota
-#define if_rawoutput(if, m, sa) if_output(if, m, sa, (struct rtentry *)0)
-
-#define IFF_UP 0x1 /* interface is up */
-#define IFF_BROADCAST 0x2 /* broadcast address valid */
-#define IFF_DEBUG 0x4 /* turn on debugging */
-#define IFF_LOOPBACK 0x8 /* is a loopback net */
-#define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */
-/*#define IFF_NOTRAILERS 0x20 * obsolete: avoid use of trailers */
-#define IFF_RUNNING 0x40 /* resources allocated */
-#define IFF_NOARP 0x80 /* no address resolution protocol */
-#define IFF_PROMISC 0x100 /* receive all packets */
-#define IFF_ALLMULTI 0x200 /* receive all multicast packets */
-#define IFF_OACTIVE 0x400 /* transmission in progress */
-#define IFF_SIMPLEX 0x800 /* can't hear own transmissions */
-#define IFF_LINK0 0x1000 /* per link layer defined bit */
-#define IFF_LINK1 0x2000 /* per link layer defined bit */
-#define IFF_LINK2 0x4000 /* per link layer defined bit */
-#define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */
-#define IFF_MULTICAST 0x8000 /* supports multicast */
-
-/* flags set internally only: */
-#define IFF_CANTCHANGE \
- (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\
- IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI)
-
-
-/*
- * These really don't belong here, but there's no other obviously appropriate
- * location.
- */
-#define IFP_AUI 0
-#define IFP_10BASE2 1
-#define IFP_10BASET 2
-/* etc. */
-
-/*
- * Bit values in if_ipending
- */
-#define IFI_RECV 1 /* I want to receive */
-#define IFI_XMIT 2 /* I want to transmit */
-
-/*
- * Output queues (ifp->if_snd) and slow device input queues (*ifp->if_slowq)
- * are queues of messages stored on ifqueue structures
- * (defined above). Entries are added to and deleted from these structures
- * by these macros, which should be called with ipl raised to splimp().
- */
-#define IF_QFULL(ifq) ((ifq)->ifq_len >= (ifq)->ifq_maxlen)
-#define IF_DROP(ifq) ((ifq)->ifq_drops++)
-#define IF_ENQUEUE(ifq, m) { \
- (m)->m_nextpkt = 0; \
- if ((ifq)->ifq_tail == 0) \
- (ifq)->ifq_head = m; \
- else \
- (ifq)->ifq_tail->m_nextpkt = m; \
- (ifq)->ifq_tail = m; \
- (ifq)->ifq_len++; \
-}
-#define IF_PREPEND(ifq, m) { \
- (m)->m_nextpkt = (ifq)->ifq_head; \
- if ((ifq)->ifq_tail == 0) \
- (ifq)->ifq_tail = (m); \
- (ifq)->ifq_head = (m); \
- (ifq)->ifq_len++; \
-}
-#define IF_DEQUEUE(ifq, m) { \
- (m) = (ifq)->ifq_head; \
- if (m) { \
- if (((ifq)->ifq_head = (m)->m_nextpkt) == 0) \
- (ifq)->ifq_tail = 0; \
- (m)->m_nextpkt = 0; \
- (ifq)->ifq_len--; \
- } \
-}
-
-#ifdef KERNEL
-#define IF_ENQ_DROP(ifq, m) if_enq_drop(ifq, m)
-
-#if defined(__GNUC__) && defined(MT_HEADER)
-static inline int
-if_queue_drop(struct ifqueue *ifq, struct mbuf *m)
-{
- IF_DROP(ifq);
- return 0;
-}
-
-static inline int
-if_enq_drop(struct ifqueue *ifq, struct mbuf *m)
-{
- if (IF_QFULL(ifq) &&
- !if_queue_drop(ifq, m))
- return 0;
- IF_ENQUEUE(ifq, m);
- return 1;
-}
-#else
-
-#ifdef MT_HEADER
-int if_enq_drop __P((struct ifqueue *, struct mbuf *));
-#endif
-
-#endif
-#endif /* KERNEL */
-
-#define IFQ_MAXLEN 50
-#define IFNET_SLOWHZ 1 /* granularity is 1 second */
-
-/*
- * The ifaddr structure contains information about one address
- * of an interface. They are maintained by the different address families,
- * are allocated and attached when an address is set, and are linked
- * together so all addresses for an interface can be located.
- */
-struct ifaddr {
- struct sockaddr *ifa_addr; /* address of interface */
- struct sockaddr *ifa_dstaddr; /* other end of p-to-p link */
-#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */
- struct sockaddr *ifa_netmask; /* used to determine subnet */
- struct ifnet *ifa_ifp; /* back-pointer to interface */
- struct ifaddr *ifa_next; /* next address for interface */
- void (*ifa_rtrequest) /* check or clean routes (+ or -)'d */
- __P((int, struct rtentry *, struct sockaddr *));
- u_short ifa_flags; /* mostly rt_flags for cloning */
- short ifa_refcnt; /* references to this structure */
- int ifa_metric; /* cost of going out this interface */
-#ifdef notdef
- struct rtentry *ifa_rt; /* XXXX for ROUTETOIF ????? */
-#endif
- int (*ifa_claim_addr) /* check if an addr goes to this if */
- __P((struct ifaddr *, struct sockaddr *));
-
-};
-#define IFA_ROUTE RTF_UP /* route installed */
-
-/*
- * Message format for use in obtaining information about interfaces
- * from getkerninfo and the routing socket
- */
-struct if_msghdr {
- u_short ifm_msglen; /* to skip over non-understood messages */
- u_char ifm_version; /* future binary compatability */
- u_char ifm_type; /* message type */
- int ifm_addrs; /* like rtm_addrs */
- int ifm_flags; /* value of if_flags */
- u_short ifm_index; /* index for associated ifp */
- struct if_data ifm_data;/* statistics and other data about if */
-};
-
-/*
- * Message format for use in obtaining information about interface addresses
- * from getkerninfo and the routing socket
- */
-struct ifa_msghdr {
- u_short ifam_msglen; /* to skip over non-understood messages */
- u_char ifam_version; /* future binary compatability */
- u_char ifam_type; /* message type */
- int ifam_addrs; /* like rtm_addrs */
- int ifam_flags; /* value of ifa_flags */
- u_short ifam_index; /* index for associated ifp */
- int ifam_metric; /* value of ifa_metric */
-};
-
-/*
- * Interface request structure used for socket
- * ioctl's. All interface ioctl's must have parameter
- * definitions which begin with ifr_name. The
- * remainder may be interface specific.
- */
-struct ifreq {
-#define IFNAMSIZ 16
- char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- union {
- struct sockaddr ifru_addr;
- struct sockaddr ifru_dstaddr;
- struct sockaddr ifru_broadaddr;
- short ifru_flags;
- int ifru_metric;
- int ifru_mtu;
- int ifru_phys;
- int ifru_media;
- caddr_t ifru_data;
- } ifr_ifru;
-#define ifr_addr ifr_ifru.ifru_addr /* address */
-#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
-#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
-#define ifr_flags ifr_ifru.ifru_flags /* flags */
-#define ifr_metric ifr_ifru.ifru_metric /* metric */
-#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
-#define ifr_phys ifr_ifru.ifru_phys /* physical wire */
-#define ifr_media ifr_ifru.ifru_media /* physical media */
-#define ifr_data ifr_ifru.ifru_data /* for use by interface */
-};
-
-struct ifaliasreq {
- char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- struct sockaddr ifra_addr;
- struct sockaddr ifra_broadaddr;
- struct sockaddr ifra_mask;
-};
-
-struct ifmediareq {
- char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- int ifm_current; /* current media options */
- int ifm_mask; /* don't care mask */
- int ifm_status; /* media status */
- int ifm_active; /* active options */
- int ifm_count; /* # entries in ifm_ulist array */
- int *ifm_ulist; /* media words */
-};
-/*
- * Structure used in SIOCGIFCONF request.
- * Used to retrieve interface configuration
- * for machine (useful for programs which
- * must know all networks accessible).
- */
-struct ifconf {
- int ifc_len; /* size of associated buffer */
- union {
- caddr_t ifcu_buf;
- struct ifreq *ifcu_req;
- } ifc_ifcu;
-#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
-#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
-};
-
-#include <net/if_arp.h>
-
-#ifdef KERNEL
-#define IFAFREE(ifa) \
- if ((ifa)->ifa_refcnt <= 0) \
- ifafree(ifa); \
- else \
- (ifa)->ifa_refcnt--;
-
-extern struct ifnet *ifnet;
-extern int ifqmaxlen;
-extern struct ifnet loif[];
-extern int if_index;
-extern struct ifaddr **ifnet_addrs;
-
-void ether_ifattach __P((struct ifnet *));
-void ether_input __P((struct ifnet *, struct ether_header *, struct mbuf *));
-int ether_output __P((struct ifnet *,
- struct mbuf *, struct sockaddr *, struct rtentry *));
-int ether_ioctl __P((struct ifnet *, int , caddr_t ));
-
-void if_attach __P((struct ifnet *));
-void if_down __P((struct ifnet *));
-void if_up __P((struct ifnet *));
-#ifdef vax
-void ifubareset __P((int));
-#endif
-/*void ifinit __P((void));*/ /* declared in systm.h for main() */
-int ifioctl __P((struct socket *, int, caddr_t, struct proc *));
-int ifpromisc __P((struct ifnet *, int));
-struct ifnet *ifunit __P((char *));
-
-int if_poll_recv_slow __P((struct ifnet *ifp, int *quotap));
-void if_poll_xmit_slow __P((struct ifnet *ifp, int *quotap));
-void if_poll_throttle __P((void));
-void if_poll_unthrottle __P((void *));
-void if_poll_init __P((void));
-void if_poll __P((void));
-
-struct ifaddr *ifa_ifwithaddr __P((struct sockaddr *));
-struct ifaddr *ifa_ifwithdstaddr __P((struct sockaddr *));
-struct ifaddr *ifa_ifwithnet __P((struct sockaddr *));
-struct ifaddr *ifa_ifwithroute __P((int, struct sockaddr *,
- struct sockaddr *));
-struct ifaddr *ifaof_ifpforaddr __P((struct sockaddr *, struct ifnet *));
-void ifafree __P((struct ifaddr *));
-
-int looutput __P((struct ifnet *,
- struct mbuf *, struct sockaddr *, struct rtentry *));
-#endif /* KERNEL */
-
-#endif /* !_NET_IF_H_ */
diff --git a/c/src/libnetworking/net/if_arp.h b/c/src/libnetworking/net/if_arp.h
deleted file mode 100644
index dd726bf856..0000000000
--- a/c/src/libnetworking/net/if_arp.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 1986, 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.
- *
- * @(#)if_arp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_ARP_H_
-#define _NET_IF_ARP_H_
-
-/*
- * Address Resolution Protocol.
- *
- * See RFC 826 for protocol description. ARP packets are variable
- * in size; the arphdr structure defines the fixed-length portion.
- * Protocol type values are the same as those for 10 Mb/s Ethernet.
- * It is followed by the variable-sized fields ar_sha, arp_spa,
- * arp_tha and arp_tpa in that order, according to the lengths
- * specified. Field names used correspond to RFC 826.
- */
-struct arphdr {
- u_short ar_hrd; /* format of hardware address */
-#define ARPHRD_ETHER 1 /* ethernet hardware format */
-#define ARPHRD_FRELAY 15 /* frame relay hardware format */
- u_short ar_pro; /* format of protocol address */
- u_char ar_hln; /* length of hardware address */
- u_char ar_pln; /* length of protocol address */
- u_short ar_op; /* one of: */
-#define ARPOP_REQUEST 1 /* request to resolve address */
-#define ARPOP_REPLY 2 /* response to previous request */
-#define ARPOP_REVREQUEST 3 /* request protocol address given hardware */
-#define ARPOP_REVREPLY 4 /* response giving protocol address */
-#define ARPOP_INVREQUEST 8 /* request to identify peer */
-#define ARPOP_INVREPLY 9 /* response identifying peer */
-/*
- * The remaining fields are variable in size,
- * according to the sizes above.
- */
-#ifdef COMMENT_ONLY
- u_char ar_sha[]; /* sender hardware address */
- u_char ar_spa[]; /* sender protocol address */
- u_char ar_tha[]; /* target hardware address */
- u_char ar_tpa[]; /* target protocol address */
-#endif
-};
-
-/*
- * ARP ioctl request
- */
-struct arpreq {
- struct sockaddr arp_pa; /* protocol address */
- struct sockaddr arp_ha; /* hardware address */
- int arp_flags; /* flags */
-};
-/* arp_flags and at_flags field values */
-#define ATF_INUSE 0x01 /* entry in use */
-#define ATF_COM 0x02 /* completed entry (enaddr valid) */
-#define ATF_PERM 0x04 /* permanent entry */
-#define ATF_PUBL 0x08 /* publish entry (respond for other host) */
-#define ATF_USETRAILERS 0x10 /* has requested trailers */
-
-#endif /* !_NET_IF_ARP_H_ */
diff --git a/c/src/libnetworking/net/if_dl.h b/c/src/libnetworking/net/if_dl.h
deleted file mode 100644
index 053ae3e92f..0000000000
--- a/c/src/libnetworking/net/if_dl.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 1990, 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.
- *
- * @(#)if_dl.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_DL_H_
-#define _NET_IF_DL_H_
-
-/*
- * A Link-Level Sockaddr may specify the interface in one of two
- * ways: either by means of a system-provided index number (computed
- * anew and possibly differently on every reboot), or by a human-readable
- * string such as "il0" (for managerial convenience).
- *
- * Census taking actions, such as something akin to SIOCGCONF would return
- * both the index and the human name.
- *
- * High volume transactions (such as giving a link-level ``from'' address
- * in a recvfrom or recvmsg call) may be likely only to provide the indexed
- * form, (which requires fewer copy operations and less space).
- *
- * The form and interpretation of the link-level address is purely a matter
- * of convention between the device driver and its consumers; however, it is
- * expected that all drivers for an interface of a given if_type will agree.
- */
-
-/*
- * Structure of a Link-Level sockaddr:
- */
-struct sockaddr_dl {
- u_char sdl_len; /* Total length of sockaddr */
- u_char sdl_family; /* AF_DLI */
- u_short sdl_index; /* if != 0, system given index for interface */
- u_char sdl_type; /* interface type */
- u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */
- u_char sdl_alen; /* link level address length */
- u_char sdl_slen; /* link layer selector length */
- char sdl_data[12]; /* minimum work area, can be larger;
- contains both if name and ll address */
-};
-
-#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-void link_addr __P((const char *, struct sockaddr_dl *));
-char *link_ntoa __P((const struct sockaddr_dl *));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif
diff --git a/c/src/libnetworking/net/if_ethersubr.c b/c/src/libnetworking/net/if_ethersubr.c
deleted file mode 100644
index 4d1675ca3c..0000000000
--- a/c/src/libnetworking/net/if_ethersubr.c
+++ /dev/null
@@ -1,988 +0,0 @@
-/*
- * Copyright (c) 1982, 1989, 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.
- *
- * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/netisr.h>
-#include <net/route.h>
-#include <net/if_llc.h>
-#include <net/if_dl.h>
-#include <net/if_types.h>
-#include <net/ethernet.h>
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#endif
-#include <netinet/if_ether.h>
-
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
-#ifdef NS
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-ushort ns_nettype;
-int ether_outputdebug = 0;
-int ether_inputdebug = 0;
-#endif
-
-#ifdef ISO
-#include <netiso/argo_debug.h>
-#include <netiso/iso.h>
-#include <netiso/iso_var.h>
-#include <netiso/iso_snpac.h>
-#endif
-
-/*#ifdef LLC
-#include <netccitt/dll.h>
-#include <netccitt/llc_var.h>
-#endif*/
-
-#if defined(LLC) && defined(CCITT)
-extern struct ifqueue pkintrq;
-#endif
-
-#ifdef NETATALK
-#include <netatalk/at.h>
-#include <netatalk/at_var.h>
-#include <netatalk/at_extern.h>
-
-#define llc_snap_org_code llc_un.type_snap.org_code
-#define llc_snap_ether_type llc_un.type_snap.ether_type
-
-extern u_char at_org_code[ 3 ];
-extern u_char aarp_org_code[ 3 ];
-#endif NETATALK
-
-u_char etherbroadcastaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-#define senderr(e) { error = (e); goto bad;}
-
-/*
- * Ethernet output routine.
- * Encapsulate a packet of type family for the local net.
- * Use trailer local net encapsulation if enough data in first
- * packet leaves a multiple of 512 bytes of data in remainder.
- * Assumes that ifp is actually pointer to arpcom structure.
- */
-int
-ether_output(ifp, m0, dst, rt0)
- register struct ifnet *ifp;
- struct mbuf *m0;
- struct sockaddr *dst;
- struct rtentry *rt0;
-{
- short type;
- int s, error = 0;
-#ifdef NS
- u_char *cp
- register struct ifqueue *inq;
- register struct mbuf *m2;
-#endif
- u_char edst[6];
- register struct mbuf *m = m0;
- register struct rtentry *rt;
- struct mbuf *mcopy = (struct mbuf *)0;
- register struct ether_header *eh;
- int off, len = m->m_pkthdr.len;
- struct arpcom *ac = (struct arpcom *)ifp;
-#ifdef NETATALK
- struct at_ifaddr *aa;
-#endif NETATALK
-
- if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
- senderr(ENETDOWN);
- rt = rt0;
- if (rt) {
- if ((rt->rt_flags & RTF_UP) == 0) {
- rt0 = rt = rtalloc1(dst, 1, 0UL);
- if (rt0)
- rt->rt_refcnt--;
- else
- senderr(EHOSTUNREACH);
- }
- if (rt->rt_flags & RTF_GATEWAY) {
- if (rt->rt_gwroute == 0)
- goto lookup;
- if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) {
- rtfree(rt); rt = rt0;
- lookup: rt->rt_gwroute = rtalloc1(rt->rt_gateway, 1,
- 0UL);
- if ((rt = rt->rt_gwroute) == 0)
- senderr(EHOSTUNREACH);
- }
- }
- if (rt->rt_flags & RTF_REJECT)
- if (rt->rt_rmx.rmx_expire == 0 ||
- rtems_bsdnet_seconds_since_boot() < rt->rt_rmx.rmx_expire)
- senderr(rt == rt0 ? EHOSTDOWN : EHOSTUNREACH);
- }
- switch (dst->sa_family) {
-
-#ifdef INET
- case AF_INET:
- if (!arpresolve(ac, rt, m, dst, edst, rt0))
- return (0); /* if not yet resolved */
- /* If broadcasting on a simplex interface, loopback a copy */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- off = m->m_pkthdr.len - m->m_len;
- type = htons(ETHERTYPE_IP);
- break;
-#endif
-#ifdef IPX
- case AF_IPX:
- {
- struct ifaddr *ia;
-
- type = htons(ETHERTYPE_IPX);
- bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host),
- (caddr_t)edst, sizeof (edst));
- for (ia = ifp->if_addrlist; ia != NULL; ia = ia->ifa_next)
- if(ia->ifa_addr->sa_family == AF_IPX &&
- !bcmp((caddr_t)edst,
- (caddr_t)&((struct ipx_ifaddr *)ia)->ia_addr.sipx_addr.x_host,
- sizeof(edst)))
- return (looutput(ifp, m, dst, rt));
- /* If broadcasting on a simplex interface, loopback a copy */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- break;
- }
-#endif
-#ifdef NETATALK
- case AF_APPLETALK:
- {
- struct sockaddr_at *sat = (struct sockaddr_at *)dst;
-
- /*
- * super hack..
- * Most of this loopback code should move into the appletalk
- * code, but it's here for now.. remember to move it! [JRE]
- * This may not get the same interface we started with
- * fix asap. XXX
- */
- aa = at_ifawithnet( sat );
- if (aa == NULL) {
- goto bad;
- }
- if( aa->aa_ifa.ifa_ifp != ifp ) {
- (*aa->aa_ifa.ifa_ifp->if_output)(aa->aa_ifa.ifa_ifp,
- m,dst,rt);
- }
- if (((sat->sat_addr.s_net == ATADDR_ANYNET)
- && (sat->sat_addr.s_node == ATADDR_ANYNODE))
- || ((sat->sat_addr.s_net == aa->aa_addr.sat_addr.s_net )
- && (sat->sat_addr.s_node == aa->aa_addr.sat_addr.s_node))) {
- (void) looutput(ifp, m, dst, rt);
- return(0);
- }
-
- if (!aarpresolve(ac, m, (struct sockaddr_at *)dst, edst)) {
-#ifdef NETATALKDEBUG
- extern char *prsockaddr(struct sockaddr *);
- printf("aarpresolv: failed for %s\n", prsockaddr(dst));
-#endif NETATALKDEBUG
- return (0);
- }
-
- /*
- * If broadcasting on a simplex interface, loopback a copy
- */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- }
- /*
- * In the phase 2 case, we need to prepend an mbuf for the llc header.
- * Since we must preserve the value of m, which is passed to us by
- * value, we m_copy() the first mbuf, and use it for our llc header.
- */
- if ( aa->aa_flags & AFA_PHASE2 ) {
- struct llc llc;
-
- M_PREPEND(m, sizeof(struct llc), M_WAIT);
- len += sizeof(struct llc);
- llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP;
- llc.llc_control = LLC_UI;
- bcopy(at_org_code, llc.llc_snap_org_code, sizeof(at_org_code));
- llc.llc_snap_ether_type = htons( ETHERTYPE_AT );
- bcopy(&llc, mtod(m, caddr_t), sizeof(struct llc));
- type = htons(m->m_pkthdr.len);
- } else {
- type = htons(ETHERTYPE_AT);
- }
- break;
-#endif NETATALK
-#ifdef NS
- case AF_NS:
- switch(ns_nettype){
- default:
- case 0x8137: /* Novell Ethernet_II Ethernet TYPE II */
- type = 0x8137;
- break;
- case 0x0: /* Novell 802.3 */
- type = htons( m->m_pkthdr.len);
- break;
- case 0xe0e0: /* Novell 802.2 and Token-Ring */
- M_PREPEND(m, 3, M_WAIT);
- type = htons( m->m_pkthdr.len);
- cp = mtod(m, u_char *);
- *cp++ = 0xE0;
- *cp++ = 0xE0;
- *cp++ = 0x03;
- break;
- }
- bcopy((caddr_t)&(((struct sockaddr_ns *)dst)->sns_addr.x_host),
- (caddr_t)edst, sizeof (edst));
- if (!bcmp((caddr_t)edst, (caddr_t)&ns_thishost, sizeof(edst))){
- m->m_pkthdr.rcvif = ifp;
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- s = splimp();
- if (IF_QFULL(inq)) {
- IF_DROP(inq);
- m_freem(m);
- } else
- IF_ENQUEUE(inq, m);
- splx(s);
- return (error);
- }
- if (!bcmp((caddr_t)edst, (caddr_t)&ns_broadhost, sizeof(edst))){
- m2 = m_copy(m, 0, (int)M_COPYALL);
- m2->m_pkthdr.rcvif = ifp;
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- s = splimp();
- if (IF_QFULL(inq)) {
- IF_DROP(inq);
- m_freem(m2);
- } else
- IF_ENQUEUE(inq, m2);
- splx(s);
- }
- /* If broadcasting on a simplex interface, loopback a copy */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX)){
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- }
- break;
-#endif /* NS */
-#ifdef ISO
- case AF_ISO: {
- int snpalen;
- struct llc *l;
- register struct sockaddr_dl *sdl;
-
- if (rt && (sdl = (struct sockaddr_dl *)rt->rt_gateway) &&
- sdl->sdl_family == AF_LINK && sdl->sdl_alen > 0) {
- bcopy(LLADDR(sdl), (caddr_t)edst, sizeof(edst));
- } else if (error =
- iso_snparesolve(ifp, (struct sockaddr_iso *)dst,
- (char *)edst, &snpalen))
- goto bad; /* Not Resolved */
- /* If broadcasting on a simplex interface, loopback a copy */
- if (*edst & 1)
- m->m_flags |= (M_BCAST|M_MCAST);
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX) &&
- (mcopy = m_copy(m, 0, (int)M_COPYALL))) {
- M_PREPEND(mcopy, sizeof (*eh), M_DONTWAIT);
- if (mcopy) {
- eh = mtod(mcopy, struct ether_header *);
- bcopy((caddr_t)edst,
- (caddr_t)eh->ether_dhost, sizeof (edst));
- bcopy((caddr_t)ac->ac_enaddr,
- (caddr_t)eh->ether_shost, sizeof (edst));
- }
- }
- M_PREPEND(m, 3, M_DONTWAIT);
- if (m == NULL)
- return (0);
- type = htons(m->m_pkthdr.len);
- l = mtod(m, struct llc *);
- l->llc_dsap = l->llc_ssap = LLC_ISO_LSAP;
- l->llc_control = LLC_UI;
- len += 3;
- IFDEBUG(D_ETHER)
- int i;
- printf("unoutput: sending pkt to: ");
- for (i=0; i<6; i++)
- printf("%x ", edst[i] & 0xff);
- printf("\n");
- ENDDEBUG
- } break;
-#endif /* ISO */
-#ifdef LLC
-/* case AF_NSAP: */
- case AF_CCITT: {
- register struct sockaddr_dl *sdl =
- (struct sockaddr_dl *) rt -> rt_gateway;
-
- if (sdl && sdl->sdl_family == AF_LINK
- && sdl->sdl_alen > 0) {
- bcopy(LLADDR(sdl), (char *)edst,
- sizeof(edst));
- } else goto bad; /* Not a link interface ? Funny ... */
- if ((ifp->if_flags & IFF_SIMPLEX) && (*edst & 1) &&
- (mcopy = m_copy(m, 0, (int)M_COPYALL))) {
- M_PREPEND(mcopy, sizeof (*eh), M_DONTWAIT);
- if (mcopy) {
- eh = mtod(mcopy, struct ether_header *);
- bcopy((caddr_t)edst,
- (caddr_t)eh->ether_dhost, sizeof (edst));
- bcopy((caddr_t)ac->ac_enaddr,
- (caddr_t)eh->ether_shost, sizeof (edst));
- }
- }
- type = htons(m->m_pkthdr.len);
-#ifdef LLC_DEBUG
- {
- int i;
- register struct llc *l = mtod(m, struct llc *);
-
- printf("ether_output: sending LLC2 pkt to: ");
- for (i=0; i<6; i++)
- printf("%x ", edst[i] & 0xff);
- printf(" len 0x%x dsap 0x%x ssap 0x%x control 0x%x\n",
- type & 0xff, l->llc_dsap & 0xff, l->llc_ssap &0xff,
- l->llc_control & 0xff);
-
- }
-#endif /* LLC_DEBUG */
- } break;
-#endif /* LLC */
-
- case AF_UNSPEC:
- eh = (struct ether_header *)dst->sa_data;
- (void)memcpy(edst, eh->ether_dhost, sizeof (edst));
- type = eh->ether_type;
- break;
-
- default:
- printf("%s%d: can't handle af%d\n", ifp->if_name, ifp->if_unit,
- dst->sa_family);
- senderr(EAFNOSUPPORT);
- }
-
-
- if (mcopy)
- (void) looutput(ifp, mcopy, dst, rt);
- /*
- * Add local net header. If no space in first mbuf,
- * allocate another.
- */
- M_PREPEND(m, sizeof (struct ether_header), M_DONTWAIT);
- if (m == 0)
- senderr(ENOBUFS);
- eh = mtod(m, struct ether_header *);
- (void)memcpy(&eh->ether_type, &type,
- sizeof(eh->ether_type));
- (void)memcpy(eh->ether_dhost, edst, sizeof (edst));
- (void)memcpy(eh->ether_shost, ac->ac_enaddr,
- sizeof(eh->ether_shost));
- s = splimp();
- /*
- * Queue message on interface, and start output if interface
- * not yet active.
- */
- if (IF_QFULL(&ifp->if_snd)) {
- IF_DROP(&ifp->if_snd);
- splx(s);
- senderr(ENOBUFS);
- }
- IF_ENQUEUE(&ifp->if_snd, m);
- if ((ifp->if_flags & IFF_OACTIVE) == 0)
- (*ifp->if_start)(ifp);
- splx(s);
- ifp->if_obytes += len + sizeof (struct ether_header);
- if (m->m_flags & M_MCAST)
- ifp->if_omcasts++;
- return (error);
-
-bad:
- if (m)
- m_freem(m);
- return (error);
-}
-
-/*
- * Process a received Ethernet packet;
- * the packet is in the mbuf chain m without
- * the ether header, which is provided separately.
- */
-void
-ether_input(ifp, eh, m)
- struct ifnet *ifp;
- register struct ether_header *eh;
- struct mbuf *m;
-{
- register struct ifqueue *inq;
- u_short ether_type;
-#ifdef NS
- u_short *checksum;
-#endif
- int s;
-#if defined (ISO) || defined (LLC) || defined(NETATALK)
- register struct llc *l;
-#endif
-
- if ((ifp->if_flags & IFF_UP) == 0) {
- m_freem(m);
- return;
- }
- ifp->if_ibytes += m->m_pkthdr.len + sizeof (*eh);
- if (bcmp((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
- sizeof(etherbroadcastaddr)) == 0)
- m->m_flags |= M_BCAST;
- else if (eh->ether_dhost[0] & 1)
- m->m_flags |= M_MCAST;
- if (m->m_flags & (M_BCAST|M_MCAST))
- ifp->if_imcasts++;
-
- ether_type = ntohs(eh->ether_type);
-
- switch (ether_type) {
-#ifdef INET
- case ETHERTYPE_IP:
- schednetisr(NETISR_IP);
- inq = &ipintrq;
- break;
-
- case ETHERTYPE_ARP:
- schednetisr(NETISR_ARP);
- inq = &arpintrq;
- break;
-#endif
-#ifdef IPX
- case ETHERTYPE_IPX:
- schednetisr(NETISR_IPX);
- inq = &ipxintrq;
- break;
-#endif
-#ifdef NS
- case 0x8137: /* Novell Ethernet_II Ethernet TYPE II */
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- break;
-
-#endif /* NS */
-#ifdef NETATALK
- case ETHERTYPE_AT:
- schednetisr(NETISR_ATALK);
- inq = &atintrq1;
- break;
- case ETHERTYPE_AARP:
- /* probably this should be done with a NETISR as well */
- aarpinput((struct arpcom *)ifp, m); /* XXX */
- return;
-#endif NETATALK
- default:
-#ifdef NS
- checksum = mtod(m, ushort *);
- /* Novell 802.3 */
- if ((ether_type <= ETHERMTU) &&
- ((*checksum == 0xffff) || (*checksum == 0xE0E0))){
- if(*checksum == 0xE0E0) {
- m->m_pkthdr.len -= 3;
- m->m_len -= 3;
- m->m_data += 3;
- }
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- break;
- }
-#endif /* NS */
-#if defined (ISO) || defined (LLC) || defined(NETATALK)
- if (ether_type > ETHERMTU)
- goto dropanyway;
- l = mtod(m, struct llc *);
- switch (l->llc_dsap) {
-#ifdef NETATALK
- case LLC_SNAP_LSAP:
- switch (l->llc_control) {
- case LLC_UI:
- if (l->llc_ssap != LLC_SNAP_LSAP)
- goto dropanyway;
-
- if (Bcmp(&(l->llc_snap_org_code)[0], at_org_code,
- sizeof(at_org_code)) == 0 &&
- ntohs(l->llc_snap_ether_type) == ETHERTYPE_AT) {
- inq = &atintrq2;
- m_adj( m, sizeof( struct llc ));
- schednetisr(NETISR_ATALK);
- break;
- }
-
- if (Bcmp(&(l->llc_snap_org_code)[0], aarp_org_code,
- sizeof(aarp_org_code)) == 0 &&
- ntohs(l->llc_snap_ether_type) == ETHERTYPE_AARP) {
- m_adj( m, sizeof( struct llc ));
- aarpinput((struct arpcom *)ifp, m); /* XXX */
- return;
- }
-
- default:
- goto dropanyway;
- }
- break;
-#endif NETATALK
-#ifdef ISO
- case LLC_ISO_LSAP:
- switch (l->llc_control) {
- case LLC_UI:
- /* LLC_UI_P forbidden in class 1 service */
- if ((l->llc_dsap == LLC_ISO_LSAP) &&
- (l->llc_ssap == LLC_ISO_LSAP)) {
- /* LSAP for ISO */
- if (m->m_pkthdr.len > ether_type)
- m_adj(m, ether_type - m->m_pkthdr.len);
- m->m_data += 3; /* XXX */
- m->m_len -= 3; /* XXX */
- m->m_pkthdr.len -= 3; /* XXX */
- M_PREPEND(m, sizeof *eh, M_DONTWAIT);
- if (m == 0)
- return;
- *mtod(m, struct ether_header *) = *eh;
- IFDEBUG(D_ETHER)
- printf("clnp packet");
- ENDDEBUG
- schednetisr(NETISR_ISO);
- inq = &clnlintrq;
- break;
- }
- goto dropanyway;
-
- case LLC_XID:
- case LLC_XID_P:
- if(m->m_len < 6)
- goto dropanyway;
- l->llc_window = 0;
- l->llc_fid = 9;
- l->llc_class = 1;
- l->llc_dsap = l->llc_ssap = 0;
- /* Fall through to */
- case LLC_TEST:
- case LLC_TEST_P:
- {
- struct sockaddr sa;
- register struct ether_header *eh2;
- int i;
- u_char c = l->llc_dsap;
-
- l->llc_dsap = l->llc_ssap;
- l->llc_ssap = c;
- if (m->m_flags & (M_BCAST | M_MCAST))
- bcopy((caddr_t)ac->ac_enaddr,
- (caddr_t)eh->ether_dhost, 6);
- sa.sa_family = AF_UNSPEC;
- sa.sa_len = sizeof(sa);
- eh2 = (struct ether_header *)sa.sa_data;
- for (i = 0; i < 6; i++) {
- eh2->ether_shost[i] = c = eh->ether_dhost[i];
- eh2->ether_dhost[i] =
- eh->ether_dhost[i] = eh->ether_shost[i];
- eh->ether_shost[i] = c;
- }
- ifp->if_output(ifp, m, &sa, NULL);
- return;
- }
- default:
- m_freem(m);
- return;
- }
- break;
-#endif /* ISO */
-#ifdef LLC
- case LLC_X25_LSAP:
- {
- if (m->m_pkthdr.len > ether_type)
- m_adj(m, ether_type - m->m_pkthdr.len);
- M_PREPEND(m, sizeof(struct sdl_hdr) , M_DONTWAIT);
- if (m == 0)
- return;
- if ( !sdl_sethdrif(ifp, eh->ether_shost, LLC_X25_LSAP,
- eh->ether_dhost, LLC_X25_LSAP, 6,
- mtod(m, struct sdl_hdr *)))
- panic("ETHER cons addr failure");
- mtod(m, struct sdl_hdr *)->sdlhdr_len = ether_type;
-#ifdef LLC_DEBUG
- printf("llc packet\n");
-#endif /* LLC_DEBUG */
- schednetisr(NETISR_CCITT);
- inq = &llcintrq;
- break;
- }
-#endif /* LLC */
- dropanyway:
- default:
- m_freem(m);
- return;
- }
-#else /* ISO || LLC || NETATALK */
- m_freem(m);
- return;
-#endif /* ISO || LLC || NETATALK */
- }
-
- s = splimp();
- if (IF_QFULL(inq)) {
- IF_DROP(inq);
- m_freem(m);
- } else
- IF_ENQUEUE(inq, m);
- splx(s);
-}
-
-/*
- * Perform common duties while attaching to interface list
- */
-void
-ether_ifattach(ifp)
- register struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
- register struct sockaddr_dl *sdl;
-
- ifp->if_type = IFT_ETHER;
- ifp->if_addrlen = 6;
- ifp->if_hdrlen = 14;
- ifp->if_mtu = ETHERMTU;
- if (ifp->if_baudrate == 0)
- ifp->if_baudrate = 10000000;
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- if ((sdl = (struct sockaddr_dl *)ifa->ifa_addr) &&
- sdl->sdl_family == AF_LINK) {
- sdl->sdl_type = IFT_ETHER;
- sdl->sdl_alen = ifp->if_addrlen;
- bcopy((caddr_t)((struct arpcom *)ifp)->ac_enaddr,
- LLADDR(sdl), ifp->if_addrlen);
- break;
- }
-}
-
-static u_char ether_ipmulticast_min[6] =
- { 0x01, 0x00, 0x5e, 0x00, 0x00, 0x00 };
-static u_char ether_ipmulticast_max[6] =
- { 0x01, 0x00, 0x5e, 0x7f, 0xff, 0xff };
-/*
- * Add an Ethernet multicast address or range of addresses to the list for a
- * given interface.
- */
-int
-ether_addmulti(ifr, ac)
- struct ifreq *ifr;
- register struct arpcom *ac;
-{
- register struct ether_multi *enm;
- struct sockaddr_in *sin;
- u_char addrlo[6];
- u_char addrhi[6];
- int set_allmulti = 0;
- int s = splimp();
-
- switch (ifr->ifr_addr.sa_family) {
-
- case AF_UNSPEC:
- bcopy(ifr->ifr_addr.sa_data, addrlo, 6);
- bcopy(addrlo, addrhi, 6);
- break;
-
-#ifdef INET
- case AF_INET:
- sin = (struct sockaddr_in *)&(ifr->ifr_addr);
- if (sin->sin_addr.s_addr == INADDR_ANY) {
- /*
- * An IP address of INADDR_ANY means listen to all
- * of the Ethernet multicast addresses used for IP.
- * (This is for the sake of IP multicast routers.)
- */
- bcopy(ether_ipmulticast_min, addrlo, 6);
- bcopy(ether_ipmulticast_max, addrhi, 6);
- set_allmulti = 1;
- }
- else {
- ETHER_MAP_IP_MULTICAST(&sin->sin_addr, addrlo);
- bcopy(addrlo, addrhi, 6);
- }
- break;
-#endif
-
- default:
- splx(s);
- return (EAFNOSUPPORT);
- }
-
- /*
- * Verify that we have valid Ethernet multicast addresses.
- */
- if ((addrlo[0] & 0x01) != 1 || (addrhi[0] & 0x01) != 1) {
- splx(s);
- return (EINVAL);
- }
- /*
- * See if the address range is already in the list.
- */
- ETHER_LOOKUP_MULTI(addrlo, addrhi, ac, enm);
- if (enm != NULL) {
- /*
- * Found it; just increment the reference count.
- */
- ++enm->enm_refcount;
- splx(s);
- return (0);
- }
- /*
- * New address or range; malloc a new multicast record
- * and link it into the interface's multicast list.
- */
- enm = (struct ether_multi *)malloc(sizeof(*enm), M_IFMADDR, M_NOWAIT);
- if (enm == NULL) {
- splx(s);
- return (ENOBUFS);
- }
- bcopy(addrlo, enm->enm_addrlo, 6);
- bcopy(addrhi, enm->enm_addrhi, 6);
- enm->enm_ac = ac;
- enm->enm_refcount = 1;
- enm->enm_next = ac->ac_multiaddrs;
- ac->ac_multiaddrs = enm;
- ac->ac_multicnt++;
- splx(s);
- if (set_allmulti)
- ac->ac_if.if_flags |= IFF_ALLMULTI;
-
- /*
- * Return ENETRESET to inform the driver that the list has changed
- * and its reception filter should be adjusted accordingly.
- */
- return (ENETRESET);
-}
-
-/*
- * Delete a multicast address record.
- */
-int
-ether_delmulti(ifr, ac)
- struct ifreq *ifr;
- register struct arpcom *ac;
-{
- register struct ether_multi *enm;
- register struct ether_multi **p;
- struct sockaddr_in *sin;
- u_char addrlo[6];
- u_char addrhi[6];
- int unset_allmulti = 0;
- int s = splimp();
-
- switch (ifr->ifr_addr.sa_family) {
-
- case AF_UNSPEC:
- bcopy(ifr->ifr_addr.sa_data, addrlo, 6);
- bcopy(addrlo, addrhi, 6);
- break;
-
-#ifdef INET
- case AF_INET:
- sin = (struct sockaddr_in *)&(ifr->ifr_addr);
- if (sin->sin_addr.s_addr == INADDR_ANY) {
- /*
- * An IP address of INADDR_ANY means stop listening
- * to the range of Ethernet multicast addresses used
- * for IP.
- */
- bcopy(ether_ipmulticast_min, addrlo, 6);
- bcopy(ether_ipmulticast_max, addrhi, 6);
- unset_allmulti = 1;
- }
- else {
- ETHER_MAP_IP_MULTICAST(&sin->sin_addr, addrlo);
- bcopy(addrlo, addrhi, 6);
- }
- break;
-#endif
-
- default:
- splx(s);
- return (EAFNOSUPPORT);
- }
-
- /*
- * Look up the address in our list.
- */
- ETHER_LOOKUP_MULTI(addrlo, addrhi, ac, enm);
- if (enm == NULL) {
- splx(s);
- return (ENXIO);
- }
- if (--enm->enm_refcount != 0) {
- /*
- * Still some claims to this record.
- */
- splx(s);
- return (0);
- }
- /*
- * No remaining claims to this record; unlink and free it.
- */
- for (p = &enm->enm_ac->ac_multiaddrs;
- *p != enm;
- p = &(*p)->enm_next)
- continue;
- *p = (*p)->enm_next;
- free(enm, M_IFMADDR);
- ac->ac_multicnt--;
- splx(s);
- if (unset_allmulti)
- ac->ac_if.if_flags &= ~IFF_ALLMULTI;
-
- /*
- * Return ENETRESET to inform the driver that the list has changed
- * and its reception filter should be adjusted accordingly.
- */
- return (ENETRESET);
-}
-
-SYSCTL_NODE(_net_link, IFT_ETHER, ether, CTLFLAG_RW, 0, "Ethernet");
-
-int
-ether_ioctl(struct ifnet *ifp, int command, caddr_t data)
-{
- struct ifaddr *ifa = (struct ifaddr *) data;
- struct ifreq *ifr = (struct ifreq *) data;
- int error = 0;
-
- switch (command) {
- case SIOCSIFADDR:
- ifp->if_flags |= IFF_UP;
-
- switch (ifa->ifa_addr->sa_family) {
-#ifdef INET
- case AF_INET:
- ifp->if_init(ifp->if_softc); /* before arpwhohas */
- arp_ifinit((struct arpcom *)ifp, ifa);
- break;
-#endif
-#ifdef IPX
- /*
- * XXX - This code is probably wrong
- */
- case AF_IPX:
- {
- register struct ipx_addr *ina = &(IA_SIPX(ifa)->sipx_addr);
- struct arpcom *ac = (struct arpcom *) (ifp->if_softc);
-
- if (ipx_nullhost(*ina))
- ina->x_host =
- *(union ipx_host *)
- ac->ac_enaddr;
- else {
- bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) ac->ac_enaddr,
- sizeof(ac->ac_enaddr));
- }
-
- /*
- * Set new address
- */
- ifp->if_init(ifp->if_softc);
- break;
- }
-#endif
-#ifdef NS
- /*
- * XXX - This code is probably wrong
- */
- case AF_NS:
- {
- register struct ns_addr *ina = &(IA_SNS(ifa)->sns_addr);
- struct arpcom *ac = (struct arpcom *) (ifp->if_softc);
-
- if (ns_nullhost(*ina))
- ina->x_host =
- *(union ns_host *) (ac->ac_enaddr);
- else {
- bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) ac->ac_enaddr,
- sizeof(ac->ac_enaddr));
- }
-
- /*
- * Set new address
- */
- ifp->if_init(ifp->if_softc);
- break;
- }
-#endif
- default:
- ifp->if_init(ifp->if_softc);
- break;
- }
- break;
-
- case SIOCGIFADDR:
- {
- struct sockaddr *sa;
-
- sa = (struct sockaddr *) & ifr->ifr_data;
- bcopy(((struct arpcom *)ifp->if_softc)->ac_enaddr,
- (caddr_t) sa->sa_data, ETHER_ADDR_LEN);
- }
- break;
-
- case SIOCSIFMTU:
- /*
- * Set the interface MTU.
- */
- if (ifr->ifr_mtu > ETHERMTU) {
- error = EINVAL;
- } else {
- ifp->if_mtu = ifr->ifr_mtu;
- }
- break;
- }
- return (error);
-}
diff --git a/c/src/libnetworking/net/if_llc.h b/c/src/libnetworking/net/if_llc.h
deleted file mode 100644
index 3cdf652167..0000000000
--- a/c/src/libnetworking/net/if_llc.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * @(#)if_llc.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_LLC_H_
-#define _NET_IF_LLC_H_
-
-/*
- * IEEE 802.2 Link Level Control headers, for use in conjunction with
- * 802.{3,4,5} media access control methods.
- *
- * Headers here do not use bit fields due to shortcomings in many
- * compilers.
- */
-
-struct llc {
- u_char llc_dsap;
- u_char llc_ssap;
- union {
- struct {
- u_char control;
- u_char format_id;
- u_char class;
- u_char window_x2;
- } type_u;
- struct {
- u_char num_snd_x2;
- u_char num_rcv_x2;
- } type_i;
- struct {
- u_char control;
- u_char num_rcv_x2;
- } type_s;
- struct {
- u_char control;
- struct frmrinfo {
- u_char rej_pdu_0;
- u_char rej_pdu_1;
- u_char frmr_control;
- u_char frmr_control_ext;
- u_char frmr_cause;
- } frmrinfo;
- } type_frmr;
- struct {
- u_char control;
- u_char org_code[3];
- u_short ether_type;
- } type_snap;
- struct {
- u_char control;
- u_char control_ext;
- } type_raw;
- } llc_un;
-};
-#define llc_control llc_un.type_u.control
-#define llc_control_ext llc_un.type_raw.control_ext
-#define llc_fid llc_un.type_u.format_id
-#define llc_class llc_un.type_u.class
-#define llc_window llc_un.type_u.window_x2
-#define llc_frmrinfo llc_un.type_frmr.frmrinfo
-#define llc_frmr_pdu0 llc_un.type_frmr.frmrinfo.rej_pdu0
-#define llc_frmr_pdu1 llc_un.type_frmr.frmrinfo.rej_pdu1
-#define llc_frmr_control llc_un.type_frmr.frmrinfo.frmr_control
-#define llc_frmr_control_ext llc_un.type_frmr.frmrinfo.frmr_control_ext
-#define llc_frmr_cause llc_un.type_frmr.frmrinfo.frmr_control_ext
-
-/*
- * Don't use sizeof(struct llc_un) for LLC header sizes
- */
-#define LLC_ISFRAMELEN 4
-#define LLC_UFRAMELEN 3
-#define LLC_FRMRLEN 7
-
-/*
- * Unnumbered LLC format commands
- */
-#define LLC_UI 0x3
-#define LLC_UI_P 0x13
-#define LLC_DISC 0x43
-#define LLC_DISC_P 0x53
-#define LLC_UA 0x63
-#define LLC_UA_P 0x73
-#define LLC_TEST 0xe3
-#define LLC_TEST_P 0xf3
-#define LLC_FRMR 0x87
-#define LLC_FRMR_P 0x97
-#define LLC_DM 0x0f
-#define LLC_DM_P 0x1f
-#define LLC_XID 0xaf
-#define LLC_XID_P 0xbf
-#define LLC_SABME 0x6f
-#define LLC_SABME_P 0x7f
-
-/*
- * Supervisory LLC commands
- */
-#define LLC_RR 0x01
-#define LLC_RNR 0x05
-#define LLC_REJ 0x09
-
-/*
- * Info format - dummy only
- */
-#define LLC_INFO 0x00
-
-/*
- * ISO PDTR 10178 contains among others
- */
-#define LLC_X25_LSAP 0x7e
-#define LLC_SNAP_LSAP 0xaa
-#define LLC_ISO_LSAP 0xfe
-
-#endif
diff --git a/c/src/libnetworking/net/if_loop.c b/c/src/libnetworking/net/if_loop.c
deleted file mode 100644
index 3823c28744..0000000000
--- a/c/src/libnetworking/net/if_loop.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)if_loop.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-/*
- * Loopback interface driver for protocol testing and timing.
- */
-#include "loop.h"
-#if NLOOP > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-
-#include <net/if.h>
-#include <net/if_types.h>
-#include <net/netisr.h>
-#include <net/route.h>
-#include <net/bpf.h>
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#endif
-
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
-#ifdef NS
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-#endif
-
-#ifdef ISO
-#include <netiso/iso.h>
-#include <netiso/iso_var.h>
-#endif
-
-#ifdef NETATALK
-#include <netinet/if_ether.h>
-#include <netatalk/at.h>
-#include <netatalk/at_var.h>
-#endif NETATALK
-
-#include "bpfilter.h"
-
-static int loioctl __P((struct ifnet *, int, caddr_t));
-static void lortrequest __P((int, struct rtentry *, struct sockaddr *));
-
- void rtems_bsdnet_loopattach __P((void *));
-PSEUDO_SET(loopattach, if_loop);
-
-#ifdef TINY_LOMTU
-#define LOMTU (1024+512)
-#else
-#define LOMTU 16384
-#endif
-
-struct ifnet loif[NLOOP];
-
-/* ARGSUSED */
-void
-rtems_bsdnet_loopattach(dummy)
- void *dummy;
-{
- register struct ifnet *ifp;
- register int i = 0;
-
- for (ifp = loif; i < NLOOP; ifp++) {
- ifp->if_name = "lo";
- ifp->if_next = NULL;
- ifp->if_unit = i++;
- ifp->if_mtu = LOMTU;
- ifp->if_flags = IFF_LOOPBACK | IFF_MULTICAST;
- ifp->if_ioctl = loioctl;
- ifp->if_output = looutput;
- ifp->if_type = IFT_LOOP;
- ifp->if_hdrlen = 0;
- ifp->if_addrlen = 0;
- if_attach(ifp);
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_NULL, sizeof(u_int));
-#endif
- }
-}
-
-int
-looutput(ifp, m, dst, rt)
- struct ifnet *ifp;
- register struct mbuf *m;
- struct sockaddr *dst;
- register struct rtentry *rt;
-{
- int s, isr;
- register struct ifqueue *ifq = 0;
-
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("looutput no HDR");
-#if NBPFILTER > 0
- /* BPF write needs to be handled specially */
- if (dst->sa_family == AF_UNSPEC) {
- dst->sa_family = *(mtod(m, int *));
- m->m_len -= sizeof(int);
- m->m_pkthdr.len -= sizeof(int);
- m->m_data += sizeof(int);
- }
-
- if (ifp->if_bpf) {
- /*
- * We need to prepend the address family as
- * a four byte field. Cons up a dummy header
- * to pacify bpf. This is safe because bpf
- * will only read from the mbuf (i.e., it won't
- * try to free it or keep a pointer a to it).
- */
- struct mbuf m0;
- u_int af = dst->sa_family;
-
- m0.m_next = m;
- m0.m_len = 4;
- m0.m_data = (char *)&af;
-
- bpf_mtap(ifp, &m0);
- }
-#endif
- m->m_pkthdr.rcvif = ifp;
-
- if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
- m_freem(m);
- return (rt->rt_flags & RTF_BLACKHOLE ? 0 :
- rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
- }
- ifp->if_opackets++;
- ifp->if_obytes += m->m_pkthdr.len;
- switch (dst->sa_family) {
-
-#ifdef INET
- case AF_INET:
- ifq = &ipintrq;
- isr = NETISR_IP;
- break;
-#endif
-#ifdef IPX
- case AF_IPX:
- ifq = &ipxintrq;
- isr = NETISR_IPX;
- break;
-#endif
-#ifdef NS
- case AF_NS:
- ifq = &nsintrq;
- isr = NETISR_NS;
- break;
-#endif
-#ifdef ISO
- case AF_ISO:
- ifq = &clnlintrq;
- isr = NETISR_ISO;
- break;
-#endif
-#ifdef NETATALK
- case AF_APPLETALK:
- ifq = &atintrq2;
- isr = NETISR_ATALK;
- break;
-#endif NETATALK
- default:
- printf("lo%d: can't handle af%d\n", ifp->if_unit,
- dst->sa_family);
- m_freem(m);
- return (EAFNOSUPPORT);
- }
- s = splimp();
- if (IF_QFULL(ifq)) {
- IF_DROP(ifq);
- m_freem(m);
- splx(s);
- return (ENOBUFS);
- }
- IF_ENQUEUE(ifq, m);
- schednetisr(isr);
- ifp->if_ipackets++;
- ifp->if_ibytes += m->m_pkthdr.len;
- splx(s);
- return (0);
-}
-
-/* ARGSUSED */
-static void
-lortrequest(cmd, rt, sa)
- int cmd;
- struct rtentry *rt;
- struct sockaddr *sa;
-{
- if (rt) {
- rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; /* for ISO */
- /*
- * For optimal performance, the send and receive buffers
- * should be at least twice the MTU plus a little more for
- * overhead.
- */
- rt->rt_rmx.rmx_recvpipe =
- rt->rt_rmx.rmx_sendpipe = 3 * LOMTU;
- }
-}
-
-/*
- * Process an ioctl request.
- */
-/* ARGSUSED */
-static int
-loioctl(ifp, cmd, data)
- register struct ifnet *ifp;
- int cmd;
- caddr_t data;
-{
- register struct ifaddr *ifa;
- register struct ifreq *ifr = (struct ifreq *)data;
- register int error = 0;
-
- switch (cmd) {
-
- case SIOCSIFADDR:
- ifp->if_flags |= IFF_UP | IFF_RUNNING;
- ifa = (struct ifaddr *)data;
- ifa->ifa_rtrequest = lortrequest;
- /*
- * Everything else is done at a higher level.
- */
- break;
-
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- if (ifr == 0) {
- error = EAFNOSUPPORT; /* XXX */
- break;
- }
- switch (ifr->ifr_addr.sa_family) {
-
-#ifdef INET
- case AF_INET:
- break;
-#endif
-
- default:
- error = EAFNOSUPPORT;
- break;
- }
- break;
-
- case SIOCSIFMTU:
- ifp->if_mtu = ifr->ifr_mtu;
- break;
-
- default:
- error = EINVAL;
- }
- return (error);
-}
-#endif /* NLOOP > 0 */
diff --git a/c/src/libnetworking/net/if_types.h b/c/src/libnetworking/net/if_types.h
deleted file mode 100644
index 833ba471c3..0000000000
--- a/c/src/libnetworking/net/if_types.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 1989, 1993, 1994
- * 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.
- *
- * @(#)if_types.h 8.2 (Berkeley) 4/20/94
- * $Id$
- */
-
-#ifndef _NET_IF_TYPES_H_
-#define _NET_IF_TYPES_H_
-
-/*
- * Interface types for benefit of parsing media address headers.
- * This list is derived from the SNMP list of ifTypes, currently
- * documented in RFC1573.
- */
-
-#define IFT_OTHER 0x1 /* none of the following */
-#define IFT_1822 0x2 /* old-style arpanet imp */
-#define IFT_HDH1822 0x3 /* HDH arpanet imp */
-#define IFT_X25DDN 0x4 /* x25 to imp */
-#define IFT_X25 0x5 /* PDN X25 interface (RFC877) */
-#define IFT_ETHER 0x6 /* Ethernet CSMACD */
-#define IFT_ISO88023 0x7 /* CMSA CD */
-#define IFT_ISO88024 0x8 /* Token Bus */
-#define IFT_ISO88025 0x9 /* Token Ring */
-#define IFT_ISO88026 0xa /* MAN */
-#define IFT_STARLAN 0xb
-#define IFT_P10 0xc /* Proteon 10MBit ring */
-#define IFT_P80 0xd /* Proteon 80MBit ring */
-#define IFT_HY 0xe /* Hyperchannel */
-#define IFT_FDDI 0xf
-#define IFT_LAPB 0x10
-#define IFT_SDLC 0x11
-#define IFT_T1 0x12
-#define IFT_CEPT 0x13 /* E1 - european T1 */
-#define IFT_ISDNBASIC 0x14
-#define IFT_ISDNPRIMARY 0x15
-#define IFT_PTPSERIAL 0x16 /* Proprietary PTP serial */
-#define IFT_PPP 0x17 /* RFC 1331 */
-#define IFT_LOOP 0x18 /* loopback */
-#define IFT_EON 0x19 /* ISO over IP */
-#define IFT_XETHER 0x1a /* obsolete 3MB experimental ethernet */
-#define IFT_NSIP 0x1b /* XNS over IP */
-#define IFT_SLIP 0x1c /* IP over generic TTY */
-#define IFT_ULTRA 0x1d /* Ultra Technologies */
-#define IFT_DS3 0x1e /* Generic T3 */
-#define IFT_SIP 0x1f /* SMDS */
-#define IFT_FRELAY 0x20 /* Frame Relay DTE only */
-#define IFT_RS232 0x21
-#define IFT_PARA 0x22 /* parallel-port */
-#define IFT_ARCNET 0x23
-#define IFT_ARCNETPLUS 0x24
-#define IFT_ATM 0x25 /* ATM cells */
-#define IFT_MIOX25 0x26
-#define IFT_SONET 0x27 /* SONET or SDH */
-#define IFT_X25PLE 0x28
-#define IFT_ISO88022LLC 0x29
-#define IFT_LOCALTALK 0x2a
-#define IFT_SMDSDXI 0x2b
-#define IFT_FRELAYDCE 0x2c /* Frame Relay DCE */
-#define IFT_V35 0x2d
-#define IFT_HSSI 0x2e
-#define IFT_HIPPI 0x2f
-#define IFT_MODEM 0x30 /* Generic Modem */
-#define IFT_AAL5 0x31 /* AAL5 over ATM */
-#define IFT_SONETPATH 0x32
-#define IFT_SONETVT 0x33
-#define IFT_SMDSICIP 0x34 /* SMDS InterCarrier Interface */
-#define IFT_PROPVIRTUAL 0x35 /* Proprietary Virtual/internal */
-#define IFT_PROPMUX 0x36 /* Proprietary Multiplexing */
-
-#endif
diff --git a/c/src/libnetworking/net/netisr.h b/c/src/libnetworking/net/netisr.h
deleted file mode 100644
index 73269a4442..0000000000
--- a/c/src/libnetworking/net/netisr.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 1989, 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.
- *
- * @(#)netisr.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_NETISR_H_
-#define _NET_NETISR_H_
-
-/*
- * The networking code runs off software interrupts.
- *
- * You can switch into the network by doing splnet() and return by splx().
- * The software interrupt level for the network is higher than the software
- * level for the clock (so you can enter the network in routines called
- * at timeout time).
- */
-#if defined(vax) || defined(tahoe)
-#define setsoftnet() mtpr(SIRR, 12)
-#endif
-
-/*
- * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status
- * word which is used to de-multiplex a single software
- * interrupt used for scheduling the network code to calls
- * on the lowest level routine of each protocol.
- */
-#define NETISR_RAW 0 /* same as AF_UNSPEC */
-#define NETISR_IP 2 /* same as AF_INET */
-#define NETISR_IMP 3 /* same as AF_IMPLINK */
-#define NETISR_NS 6 /* same as AF_NS */
-#define NETISR_ISO 7 /* same as AF_ISO */
-#define NETISR_CCITT 10 /* same as AF_CCITT */
-#define NETISR_ATALK 16 /* same as AF_APPLETALK */
-#define NETISR_ARP 18 /* same as AF_LINK */
-#define NETISR_IPX 23 /* same as AF_IPX */
-#define NETISR_ISDN 26 /* same as AF_E164 */
-#define NETISR_PPP 27 /* PPP soft interrupt */
-
-#define schednetisr(anisr) rtems_bsdnet_schednetisr(anisr)
-
-#ifndef LOCORE
-#ifdef KERNEL
-extern volatile unsigned int netisr; /* scheduling bits for network */
-
-typedef void netisr_t(void);
-
-struct netisrtab {
- int nit_num;
- netisr_t *nit_isr;
-};
-
-#define NETISR_SET(num, isr)
-
-int register_netisr __P((int, netisr_t *));
-
-#endif
-#endif
-
-#endif
diff --git a/c/src/libnetworking/net/radix.c b/c/src/libnetworking/net/radix.c
deleted file mode 100644
index bc1b7ee1d1..0000000000
--- a/c/src/libnetworking/net/radix.c
+++ /dev/null
@@ -1,1028 +0,0 @@
-/*
- * Copyright (c) 1988, 1989, 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.
- *
- * @(#)radix.c 8.4 (Berkeley) 11/2/94
- * $Id$
- */
-
-/*
- * Routines to build and maintain radix trees for routing lookups.
- */
-#ifndef _RADIX_H_
-#include <sys/param.h>
-#ifdef KERNEL
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#define M_DONTWAIT M_NOWAIT
-#include <sys/domain.h>
-#else
-#include <stdlib.h>
-#endif
-#include <sys/syslog.h>
-#include <net/radix.h>
-#endif
-
-static struct radix_node *
- rn_lookup __P((void *v_arg, void *m_arg,
- struct radix_node_head *head));
-static int rn_walktree_from __P((struct radix_node_head *h, void *a,
- void *m, walktree_f_t *f, void *w));
-static int rn_walktree __P((struct radix_node_head *, walktree_f_t *, void *));
-static struct radix_node
- *rn_delete __P((void *, void *, struct radix_node_head *)),
- *rn_insert __P((void *, struct radix_node_head *, int *,
- struct radix_node [2])),
- *rn_newpair __P((void *, int, struct radix_node[2])),
- *rn_search __P((void *, struct radix_node *)),
- *rn_search_m __P((void *, struct radix_node *, void *));
-
-static int max_keylen;
-static struct radix_mask *rn_mkfreelist;
-static struct radix_node_head *mask_rnhead;
-static char *addmask_key;
-static char normal_chars[] = {0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, -1};
-static char *rn_zeros, *rn_ones;
-
-#define rn_masktop (mask_rnhead->rnh_treetop)
-#undef Bcmp
-#define Bcmp(a, b, l) (l == 0 ? 0 : bcmp((caddr_t)(a), (caddr_t)(b), (u_long)l))
-
-static int rn_lexobetter __P((void *m_arg, void *n_arg));
-static struct radix_mask *
- rn_new_radix_mask __P((struct radix_node *tt,
- struct radix_mask *next));
-static int rn_satsifies_leaf __P((char *trial, struct radix_node *leaf,
- int skip));
-
-/*
- * The data structure for the keys is a radix tree with one way
- * branching removed. The index rn_b at an internal node n represents a bit
- * position to be tested. The tree is arranged so that all descendants
- * of a node n have keys whose bits all agree up to position rn_b - 1.
- * (We say the index of n is rn_b.)
- *
- * There is at least one descendant which has a one bit at position rn_b,
- * and at least one with a zero there.
- *
- * A route is determined by a pair of key and mask. We require that the
- * bit-wise logical and of the key and mask to be the key.
- * We define the index of a route to associated with the mask to be
- * the first bit number in the mask where 0 occurs (with bit number 0
- * representing the highest order bit).
- *
- * We say a mask is normal if every bit is 0, past the index of the mask.
- * If a node n has a descendant (k, m) with index(m) == index(n) == rn_b,
- * and m is a normal mask, then the route applies to every descendant of n.
- * If the index(m) < rn_b, this implies the trailing last few bits of k
- * before bit b are all 0, (and hence consequently true of every descendant
- * of n), so the route applies to all descendants of the node as well.
- *
- * Similar logic shows that a non-normal mask m such that
- * index(m) <= index(n) could potentially apply to many children of n.
- * Thus, for each non-host route, we attach its mask to a list at an internal
- * node as high in the tree as we can go.
- *
- * The present version of the code makes use of normal routes in short-
- * circuiting an explict mask and compare operation when testing whether
- * a key satisfies a normal route, and also in remembering the unique leaf
- * that governs a subtree.
- */
-
-static struct radix_node *
-rn_search(v_arg, head)
- void *v_arg;
- struct radix_node *head;
-{
- register struct radix_node *x;
- register caddr_t v;
-
- for (x = head, v = v_arg; x->rn_b >= 0;) {
- if (x->rn_bmask & v[x->rn_off])
- x = x->rn_r;
- else
- x = x->rn_l;
- }
- return (x);
-};
-
-static struct radix_node *
-rn_search_m(v_arg, head, m_arg)
- struct radix_node *head;
- void *v_arg, *m_arg;
-{
- register struct radix_node *x;
- register caddr_t v = v_arg, m = m_arg;
-
- for (x = head; x->rn_b >= 0;) {
- if ((x->rn_bmask & m[x->rn_off]) &&
- (x->rn_bmask & v[x->rn_off]))
- x = x->rn_r;
- else
- x = x->rn_l;
- }
- return x;
-};
-
-int
-rn_refines(m_arg, n_arg)
- void *m_arg, *n_arg;
-{
- register caddr_t m = m_arg, n = n_arg;
- register caddr_t lim, lim2 = lim = n + *(u_char *)n;
- int longer = (*(u_char *)n++) - (int)(*(u_char *)m++);
- int masks_are_equal = 1;
-
- if (longer > 0)
- lim -= longer;
- while (n < lim) {
- if (*n & ~(*m))
- return 0;
- if (*n++ != *m++)
- masks_are_equal = 0;
- }
- while (n < lim2)
- if (*n++)
- return 0;
- if (masks_are_equal && (longer < 0))
- for (lim2 = m - longer; m < lim2; )
- if (*m++)
- return 1;
- return (!masks_are_equal);
-}
-
-struct radix_node *
-rn_lookup(v_arg, m_arg, head)
- void *v_arg, *m_arg;
- struct radix_node_head *head;
-{
- register struct radix_node *x;
- caddr_t netmask = 0;
-
- if (m_arg) {
- if ((x = rn_addmask(m_arg, 1, head->rnh_treetop->rn_off)) == 0)
- return (0);
- netmask = x->rn_key;
- }
- x = rn_match(v_arg, head);
- if (x && netmask) {
- while (x && x->rn_mask != netmask)
- x = x->rn_dupedkey;
- }
- return x;
-}
-
-static int
-rn_satsifies_leaf(trial, leaf, skip)
- char *trial;
- register struct radix_node *leaf;
- int skip;
-{
- register char *cp = trial, *cp2 = leaf->rn_key, *cp3 = leaf->rn_mask;
- char *cplim;
- int length = min(*(u_char *)cp, *(u_char *)cp2);
-
- if (cp3 == 0)
- cp3 = rn_ones;
- else
- length = min(length, *(u_char *)cp3);
- cplim = cp + length; cp3 += skip; cp2 += skip;
- for (cp += skip; cp < cplim; cp++, cp2++, cp3++)
- if ((*cp ^ *cp2) & *cp3)
- return 0;
- return 1;
-}
-
-struct radix_node *
-rn_match(v_arg, head)
- void *v_arg;
- struct radix_node_head *head;
-{
- caddr_t v = v_arg;
- register struct radix_node *t = head->rnh_treetop, *x;
- register caddr_t cp = v, cp2;
- caddr_t cplim;
- struct radix_node *saved_t, *top = t;
- int off = t->rn_off, vlen = *(u_char *)cp, matched_off;
- register int test, b, rn_b;
-
- /*
- * Open code rn_search(v, top) to avoid overhead of extra
- * subroutine call.
- */
- for (; t->rn_b >= 0; ) {
- if (t->rn_bmask & cp[t->rn_off])
- t = t->rn_r;
- else
- t = t->rn_l;
- }
- /*
- * See if we match exactly as a host destination
- * or at least learn how many bits match, for normal mask finesse.
- *
- * It doesn't hurt us to limit how many bytes to check
- * to the length of the mask, since if it matches we had a genuine
- * match and the leaf we have is the most specific one anyway;
- * if it didn't match with a shorter length it would fail
- * with a long one. This wins big for class B&C netmasks which
- * are probably the most common case...
- */
- if (t->rn_mask)
- vlen = *(u_char *)t->rn_mask;
- cp += off; cp2 = t->rn_key + off; cplim = v + vlen;
- for (; cp < cplim; cp++, cp2++)
- if (*cp != *cp2)
- goto on1;
- /*
- * This extra grot is in case we are explicitly asked
- * to look up the default. Ugh!
- */
- if ((t->rn_flags & RNF_ROOT) && t->rn_dupedkey)
- t = t->rn_dupedkey;
- return t;
-on1:
- test = (*cp ^ *cp2) & 0xff; /* find first bit that differs */
- for (b = 7; (test >>= 1) > 0;)
- b--;
- matched_off = cp - v;
- b += matched_off << 3;
- rn_b = -1 - b;
- /*
- * If there is a host route in a duped-key chain, it will be first.
- */
- if ((saved_t = t)->rn_mask == 0)
- t = t->rn_dupedkey;
- for (; t; t = t->rn_dupedkey)
- /*
- * Even if we don't match exactly as a host,
- * we may match if the leaf we wound up at is
- * a route to a net.
- */
- if (t->rn_flags & RNF_NORMAL) {
- if (rn_b <= t->rn_b)
- return t;
- } else if (rn_satsifies_leaf(v, t, matched_off))
- return t;
- t = saved_t;
- /* start searching up the tree */
- do {
- register struct radix_mask *m;
- t = t->rn_p;
- m = t->rn_mklist;
- if (m) {
- /*
- * If non-contiguous masks ever become important
- * we can restore the masking and open coding of
- * the search and satisfaction test and put the
- * calculation of "off" back before the "do".
- */
- do {
- if (m->rm_flags & RNF_NORMAL) {
- if (rn_b <= m->rm_b)
- return (m->rm_leaf);
- } else {
- off = min(t->rn_off, matched_off);
- x = rn_search_m(v, t, m->rm_mask);
- while (x && x->rn_mask != m->rm_mask)
- x = x->rn_dupedkey;
- if (x && rn_satsifies_leaf(v, x, off))
- return x;
- }
- m = m->rm_mklist;
- } while (m);
- }
- } while (t != top);
- return 0;
-};
-
-#ifdef RN_DEBUG
-int rn_nodenum;
-struct radix_node *rn_clist;
-int rn_saveinfo;
-int rn_debug = 1;
-#endif
-
-static struct radix_node *
-rn_newpair(v, b, nodes)
- void *v;
- int b;
- struct radix_node nodes[2];
-{
- register struct radix_node *tt = nodes, *t = tt + 1;
- t->rn_b = b; t->rn_bmask = 0x80 >> (b & 7);
- t->rn_l = tt; t->rn_off = b >> 3;
- tt->rn_b = -1; tt->rn_key = (caddr_t)v; tt->rn_p = t;
- tt->rn_flags = t->rn_flags = RNF_ACTIVE;
-#ifdef RN_DEBUG
- tt->rn_info = rn_nodenum++; t->rn_info = rn_nodenum++;
- tt->rn_twin = t; tt->rn_ybro = rn_clist; rn_clist = tt;
-#endif
- return t;
-}
-
-static struct radix_node *
-rn_insert(v_arg, head, dupentry, nodes)
- void *v_arg;
- struct radix_node_head *head;
- int *dupentry;
- struct radix_node nodes[2];
-{
- caddr_t v = v_arg;
- struct radix_node *top = head->rnh_treetop;
- int head_off = top->rn_off, vlen = (int)*((u_char *)v);
- register struct radix_node *t = rn_search(v_arg, top);
- register caddr_t cp = v + head_off;
- register int b;
- struct radix_node *tt;
- /*
- * Find first bit at which v and t->rn_key differ
- */
- {
- register caddr_t cp2 = t->rn_key + head_off;
- register int cmp_res;
- caddr_t cplim = v + vlen;
-
- while (cp < cplim)
- if (*cp2++ != *cp++)
- goto on1;
- *dupentry = 1;
- return t;
-on1:
- *dupentry = 0;
- cmp_res = (cp[-1] ^ cp2[-1]) & 0xff;
- for (b = (cp - v) << 3; cmp_res; b--)
- cmp_res >>= 1;
- }
- {
- register struct radix_node *p, *x = top;
- cp = v;
- do {
- p = x;
- if (cp[x->rn_off] & x->rn_bmask)
- x = x->rn_r;
- else x = x->rn_l;
- } while (b > (unsigned) x->rn_b); /* x->rn_b < b && x->rn_b >= 0 */
-#ifdef RN_DEBUG
- if (rn_debug)
- log(LOG_DEBUG, "rn_insert: Going In:\n"), traverse(p);
-#endif
- t = rn_newpair(v_arg, b, nodes); tt = t->rn_l;
- if ((cp[p->rn_off] & p->rn_bmask) == 0)
- p->rn_l = t;
- else
- p->rn_r = t;
- x->rn_p = t; t->rn_p = p; /* frees x, p as temp vars below */
- if ((cp[t->rn_off] & t->rn_bmask) == 0) {
- t->rn_r = x;
- } else {
- t->rn_r = tt; t->rn_l = x;
- }
-#ifdef RN_DEBUG
- if (rn_debug)
- log(LOG_DEBUG, "rn_insert: Coming Out:\n"), traverse(p);
-#endif
- }
- return (tt);
-}
-
-struct radix_node *
-rn_addmask(n_arg, search, skip)
- int search, skip;
- void *n_arg;
-{
- caddr_t netmask = (caddr_t)n_arg;
- register struct radix_node *x;
- register caddr_t cp, cplim;
- register int b = 0, mlen, j;
- int maskduplicated, m0, isnormal;
- struct radix_node *saved_x;
- static int last_zeroed = 0;
-
- if ((mlen = *(u_char *)netmask) > max_keylen)
- mlen = max_keylen;
- if (skip == 0)
- skip = 1;
- if (mlen <= skip)
- return (mask_rnhead->rnh_nodes);
- if (skip > 1)
- Bcopy(rn_ones + 1, addmask_key + 1, skip - 1);
- if ((m0 = mlen) > skip)
- Bcopy(netmask + skip, addmask_key + skip, mlen - skip);
- /*
- * Trim trailing zeroes.
- */
- for (cp = addmask_key + mlen; (cp > addmask_key) && cp[-1] == 0;)
- cp--;
- mlen = cp - addmask_key;
- if (mlen <= skip) {
- if (m0 >= last_zeroed)
- last_zeroed = mlen;
- return (mask_rnhead->rnh_nodes);
- }
- if (m0 < last_zeroed)
- Bzero(addmask_key + m0, last_zeroed - m0);
- *addmask_key = last_zeroed = mlen;
- x = rn_search(addmask_key, rn_masktop);
- if (Bcmp(addmask_key, x->rn_key, mlen) != 0)
- x = 0;
- if (x || search)
- return (x);
- R_Malloc(x, struct radix_node *, max_keylen + 2 * sizeof (*x));
- if ((saved_x = x) == 0)
- return (0);
- Bzero(x, max_keylen + 2 * sizeof (*x));
- netmask = cp = (caddr_t)(x + 2);
- Bcopy(addmask_key, cp, mlen);
- x = rn_insert(cp, mask_rnhead, &maskduplicated, x);
- if (maskduplicated) {
- log(LOG_ERR, "rn_addmask: mask impossibly already in tree");
- Free(saved_x);
- return (x);
- }
- /*
- * Calculate index of mask, and check for normalcy.
- */
- cplim = netmask + mlen; isnormal = 1;
- for (cp = netmask + skip; (cp < cplim) && *(u_char *)cp == 0xff;)
- cp++;
- if (cp != cplim) {
- for (j = 0x80; (j & *cp) != 0; j >>= 1)
- b++;
- if (*cp != normal_chars[b] || cp != (cplim - 1))
- isnormal = 0;
- }
- b += (cp - netmask) << 3;
- x->rn_b = -1 - b;
- if (isnormal)
- x->rn_flags |= RNF_NORMAL;
- return (x);
-}
-
-static int /* XXX: arbitrary ordering for non-contiguous masks */
-rn_lexobetter(m_arg, n_arg)
- void *m_arg, *n_arg;
-{
- register u_char *mp = m_arg, *np = n_arg, *lim;
-
- if (*mp > *np)
- return 1; /* not really, but need to check longer one first */
- if (*mp == *np)
- for (lim = mp + *mp; mp < lim;)
- if (*mp++ > *np++)
- return 1;
- return 0;
-}
-
-static struct radix_mask *
-rn_new_radix_mask(tt, next)
- register struct radix_node *tt;
- register struct radix_mask *next;
-{
- register struct radix_mask *m;
-
- MKGet(m);
- if (m == 0) {
- log(LOG_ERR, "Mask for route not entered\n");
- return (0);
- }
- Bzero(m, sizeof *m);
- m->rm_b = tt->rn_b;
- m->rm_flags = tt->rn_flags;
- if (tt->rn_flags & RNF_NORMAL)
- m->rm_leaf = tt;
- else
- m->rm_mask = tt->rn_mask;
- m->rm_mklist = next;
- tt->rn_mklist = m;
- return m;
-}
-
-struct radix_node *
-rn_addroute(v_arg, n_arg, head, treenodes)
- void *v_arg, *n_arg;
- struct radix_node_head *head;
- struct radix_node treenodes[2];
-{
- caddr_t v = (caddr_t)v_arg, netmask = (caddr_t)n_arg;
- register struct radix_node *t, *x = 0, *tt;
- struct radix_node *saved_tt, *top = head->rnh_treetop;
- short b = 0, b_leaf = 0;
- int keyduplicated;
- caddr_t mmask;
- struct radix_mask *m, **mp;
-
- /*
- * In dealing with non-contiguous masks, there may be
- * many different routes which have the same mask.
- * We will find it useful to have a unique pointer to
- * the mask to speed avoiding duplicate references at
- * nodes and possibly save time in calculating indices.
- */
- if (netmask) {
- if ((x = rn_addmask(netmask, 0, top->rn_off)) == 0)
- return (0);
- b_leaf = x->rn_b;
- b = -1 - x->rn_b;
- netmask = x->rn_key;
- }
- /*
- * Deal with duplicated keys: attach node to previous instance
- */
- saved_tt = tt = rn_insert(v, head, &keyduplicated, treenodes);
- if (keyduplicated) {
- for (t = tt; tt; t = tt, tt = tt->rn_dupedkey) {
- if (tt->rn_mask == netmask)
- return (0);
- if (netmask == 0 ||
- (tt->rn_mask &&
- ((b_leaf < tt->rn_b) || /* index(netmask) > node */
- rn_refines(netmask, tt->rn_mask) ||
- rn_lexobetter(netmask, tt->rn_mask))))
- break;
- }
- /*
- * If the mask is not duplicated, we wouldn't
- * find it among possible duplicate key entries
- * anyway, so the above test doesn't hurt.
- *
- * We sort the masks for a duplicated key the same way as
- * in a masklist -- most specific to least specific.
- * This may require the unfortunate nuisance of relocating
- * the head of the list.
- */
- if (tt == saved_tt) {
- struct radix_node *xx = x;
- /* link in at head of list */
- (tt = treenodes)->rn_dupedkey = t;
- tt->rn_flags = t->rn_flags;
- tt->rn_p = x = t->rn_p;
- t->rn_p = tt; /* parent */
- if (x->rn_l == t) x->rn_l = tt; else x->rn_r = tt;
- saved_tt = tt; x = xx;
- } else {
- (tt = treenodes)->rn_dupedkey = t->rn_dupedkey;
- t->rn_dupedkey = tt;
- tt->rn_p = t; /* parent */
- if (tt->rn_dupedkey) /* parent */
- tt->rn_dupedkey->rn_p = tt; /* parent */
- }
-#ifdef RN_DEBUG
- t=tt+1; tt->rn_info = rn_nodenum++; t->rn_info = rn_nodenum++;
- tt->rn_twin = t; tt->rn_ybro = rn_clist; rn_clist = tt;
-#endif
- tt->rn_key = (caddr_t) v;
- tt->rn_b = -1;
- tt->rn_flags = RNF_ACTIVE;
- }
- /*
- * Put mask in tree.
- */
- if (netmask) {
- tt->rn_mask = netmask;
- tt->rn_b = x->rn_b;
- tt->rn_flags |= x->rn_flags & RNF_NORMAL;
- }
- t = saved_tt->rn_p;
- if (keyduplicated)
- goto on2;
- b_leaf = -1 - t->rn_b;
- if (t->rn_r == saved_tt) x = t->rn_l; else x = t->rn_r;
- /* Promote general routes from below */
- if (x->rn_b < 0) {
- for (mp = &t->rn_mklist; x; x = x->rn_dupedkey)
- if (x->rn_mask && (x->rn_b >= b_leaf) && x->rn_mklist == 0) {
- *mp = m = rn_new_radix_mask(x, 0);
- if (m)
- mp = &m->rm_mklist;
- }
- } else if (x->rn_mklist) {
- /*
- * Skip over masks whose index is > that of new node
- */
- for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist)
- if (m->rm_b >= b_leaf)
- break;
- t->rn_mklist = m; *mp = 0;
- }
-on2:
- /* Add new route to highest possible ancestor's list */
- if ((netmask == 0) || (b > t->rn_b ))
- return tt; /* can't lift at all */
- b_leaf = tt->rn_b;
- do {
- x = t;
- t = t->rn_p;
- } while (b <= t->rn_b && x != top);
- /*
- * Search through routes associated with node to
- * insert new route according to index.
- * Need same criteria as when sorting dupedkeys to avoid
- * double loop on deletion.
- */
- for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist) {
- if (m->rm_b < b_leaf)
- continue;
- if (m->rm_b > b_leaf)
- break;
- if (m->rm_flags & RNF_NORMAL) {
- mmask = m->rm_leaf->rn_mask;
- if (tt->rn_flags & RNF_NORMAL) {
- log(LOG_ERR,
- "Non-unique normal route, mask not entered");
- return tt;
- }
- } else
- mmask = m->rm_mask;
- if (mmask == netmask) {
- m->rm_refs++;
- tt->rn_mklist = m;
- return tt;
- }
- if (rn_refines(netmask, mmask) || rn_lexobetter(netmask, mmask))
- break;
- }
- *mp = rn_new_radix_mask(tt, *mp);
- return tt;
-}
-
-static struct radix_node *
-rn_delete(v_arg, netmask_arg, head)
- void *v_arg, *netmask_arg;
- struct radix_node_head *head;
-{
- register struct radix_node *t, *p, *x, *tt;
- struct radix_mask *m, *saved_m, **mp;
- struct radix_node *dupedkey, *saved_tt, *top;
- caddr_t v, netmask;
- int b, head_off, vlen;
-
- v = v_arg;
- netmask = netmask_arg;
- x = head->rnh_treetop;
- tt = rn_search(v, x);
- head_off = x->rn_off;
- vlen = *(u_char *)v;
- saved_tt = tt;
- top = x;
- if (tt == 0 ||
- Bcmp(v + head_off, tt->rn_key + head_off, vlen - head_off))
- return (0);
- /*
- * Delete our route from mask lists.
- */
- if (netmask) {
- if ((x = rn_addmask(netmask, 1, head_off)) == 0)
- return (0);
- netmask = x->rn_key;
- while (tt->rn_mask != netmask)
- if ((tt = tt->rn_dupedkey) == 0)
- return (0);
- }
- if (tt->rn_mask == 0 || (saved_m = m = tt->rn_mklist) == 0)
- goto on1;
- if (tt->rn_flags & RNF_NORMAL) {
- if (m->rm_leaf != tt || m->rm_refs > 0) {
- log(LOG_ERR, "rn_delete: inconsistent annotation\n");
- return 0; /* dangling ref could cause disaster */
- }
- } else {
- if (m->rm_mask != tt->rn_mask) {
- log(LOG_ERR, "rn_delete: inconsistent annotation\n");
- goto on1;
- }
- if (--m->rm_refs >= 0)
- goto on1;
- }
- b = -1 - tt->rn_b;
- t = saved_tt->rn_p;
- if (b > t->rn_b)
- goto on1; /* Wasn't lifted at all */
- do {
- x = t;
- t = t->rn_p;
- } while (b <= t->rn_b && x != top);
- for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist)
- if (m == saved_m) {
- *mp = m->rm_mklist;
- MKFree(m);
- break;
- }
- if (m == 0) {
- log(LOG_ERR, "rn_delete: couldn't find our annotation\n");
- if (tt->rn_flags & RNF_NORMAL)
- return (0); /* Dangling ref to us */
- }
-on1:
- /*
- * Eliminate us from tree
- */
- if (tt->rn_flags & RNF_ROOT)
- return (0);
-#ifdef RN_DEBUG
- /* Get us out of the creation list */
- for (t = rn_clist; t && t->rn_ybro != tt; t = t->rn_ybro) {}
- if (t) t->rn_ybro = tt->rn_ybro;
-#endif
- t = tt->rn_p;
- dupedkey = saved_tt->rn_dupedkey;
- if (dupedkey) {
- /*
- * at this point, tt is the deletion target and saved_tt
- * is the head of the dupekey chain
- */
- if (tt == saved_tt) {
- /* remove from head of chain */
- x = dupedkey; x->rn_p = t;
- if (t->rn_l == tt) t->rn_l = x; else t->rn_r = x;
- } else {
- /* find node in front of tt on the chain */
- for (x = p = saved_tt; p && p->rn_dupedkey != tt;)
- p = p->rn_dupedkey;
- if (p) {
- p->rn_dupedkey = tt->rn_dupedkey;
- if (tt->rn_dupedkey) /* parent */
- tt->rn_dupedkey->rn_p = p; /* parent */
- } else log(LOG_ERR, "rn_delete: couldn't find us\n");
- }
- t = tt + 1;
- if (t->rn_flags & RNF_ACTIVE) {
-#ifndef RN_DEBUG
- *++x = *t; p = t->rn_p;
-#else
- b = t->rn_info; *++x = *t; t->rn_info = b; p = t->rn_p;
-#endif
- if (p->rn_l == t) p->rn_l = x; else p->rn_r = x;
- x->rn_l->rn_p = x; x->rn_r->rn_p = x;
- }
- goto out;
- }
- if (t->rn_l == tt) x = t->rn_r; else x = t->rn_l;
- p = t->rn_p;
- if (p->rn_r == t) p->rn_r = x; else p->rn_l = x;
- x->rn_p = p;
- /*
- * Demote routes attached to us.
- */
- if (t->rn_mklist) {
- if (x->rn_b >= 0) {
- for (mp = &x->rn_mklist; (m = *mp);)
- mp = &m->rm_mklist;
- *mp = t->rn_mklist;
- } else {
- /* If there are any key,mask pairs in a sibling
- duped-key chain, some subset will appear sorted
- in the same order attached to our mklist */
- for (m = t->rn_mklist; m && x; x = x->rn_dupedkey)
- if (m == x->rn_mklist) {
- struct radix_mask *mm = m->rm_mklist;
- x->rn_mklist = 0;
- if (--(m->rm_refs) < 0)
- MKFree(m);
- m = mm;
- }
- if (m)
- log(LOG_ERR, "%s %p at %x\n",
- "rn_delete: Orphaned Mask", m, x);
- }
- }
- /*
- * We may be holding an active internal node in the tree.
- */
- x = tt + 1;
- if (t != x) {
-#ifndef RN_DEBUG
- *t = *x;
-#else
- b = t->rn_info; *t = *x; t->rn_info = b;
-#endif
- t->rn_l->rn_p = t; t->rn_r->rn_p = t;
- p = x->rn_p;
- if (p->rn_l == x) p->rn_l = t; else p->rn_r = t;
- }
-out:
- tt->rn_flags &= ~RNF_ACTIVE;
- tt[1].rn_flags &= ~RNF_ACTIVE;
- return (tt);
-}
-
-/*
- * This is the same as rn_walktree() except for the parameters and the
- * exit.
- */
-static int
-rn_walktree_from(h, a, m, f, w)
- struct radix_node_head *h;
- void *a, *m;
- walktree_f_t *f;
- void *w;
-{
- int error;
- struct radix_node *base, *next;
- u_char *xa = (u_char *)a;
- u_char *xm = (u_char *)m;
- register struct radix_node *rn, *last = 0 /* shut up gcc */;
- int stopping = 0;
- int lastb;
-
- /*
- * rn_search_m is sort-of-open-coded here.
- */
- /* printf("about to search\n"); */
- for (rn = h->rnh_treetop; rn->rn_b >= 0; ) {
- last = rn;
- /* printf("rn_b %d, rn_bmask %x, xm[rn_off] %x\n",
- rn->rn_b, rn->rn_bmask, xm[rn->rn_off]); */
- if (!(rn->rn_bmask & xm[rn->rn_off])) {
- break;
- }
- if (rn->rn_bmask & xa[rn->rn_off]) {
- rn = rn->rn_r;
- } else {
- rn = rn->rn_l;
- }
- }
- /* printf("done searching\n"); */
-
- /*
- * Two cases: either we stepped off the end of our mask,
- * in which case last == rn, or we reached a leaf, in which
- * case we want to start from the last node we looked at.
- * Either way, last is the node we want to start from.
- */
- rn = last;
- lastb = rn->rn_b;
-
- /* printf("rn %p, lastb %d\n", rn, lastb);*/
-
- /*
- * This gets complicated because we may delete the node
- * while applying the function f to it, so we need to calculate
- * the successor node in advance.
- */
- while (rn->rn_b >= 0)
- rn = rn->rn_l;
-
- while (!stopping) {
- /* printf("node %p (%d)\n", rn, rn->rn_b); */
- base = rn;
- /* If at right child go back up, otherwise, go right */
- while (rn->rn_p->rn_r == rn && !(rn->rn_flags & RNF_ROOT)) {
- rn = rn->rn_p;
-
- /* if went up beyond last, stop */
- if (rn->rn_b < lastb) {
- stopping = 1;
- /* printf("up too far\n"); */
- }
- }
-
- /* Find the next *leaf* since next node might vanish, too */
- for (rn = rn->rn_p->rn_r; rn->rn_b >= 0;)
- rn = rn->rn_l;
- next = rn;
- /* Process leaves */
- while ((rn = base) != 0) {
- base = rn->rn_dupedkey;
- /* printf("leaf %p\n", rn); */
- if (!(rn->rn_flags & RNF_ROOT)
- && (error = (*f)(rn, w)))
- return (error);
- }
- rn = next;
-
- if (rn->rn_flags & RNF_ROOT) {
- /* printf("root, stopping"); */
- stopping = 1;
- }
-
- }
- return 0;
-}
-
-static int
-rn_walktree(h, f, w)
- struct radix_node_head *h;
- walktree_f_t *f;
- void *w;
-{
- int error;
- struct radix_node *base, *next;
- register struct radix_node *rn = h->rnh_treetop;
- /*
- * This gets complicated because we may delete the node
- * while applying the function f to it, so we need to calculate
- * the successor node in advance.
- */
- /* First time through node, go left */
- while (rn->rn_b >= 0)
- rn = rn->rn_l;
- for (;;) {
- base = rn;
- /* If at right child go back up, otherwise, go right */
- while (rn->rn_p->rn_r == rn && (rn->rn_flags & RNF_ROOT) == 0)
- rn = rn->rn_p;
- /* Find the next *leaf* since next node might vanish, too */
- for (rn = rn->rn_p->rn_r; rn->rn_b >= 0;)
- rn = rn->rn_l;
- next = rn;
- /* Process leaves */
- while ((rn = base)) {
- base = rn->rn_dupedkey;
- if (!(rn->rn_flags & RNF_ROOT) && (error = (*f)(rn, w)))
- return (error);
- }
- rn = next;
- if (rn->rn_flags & RNF_ROOT)
- return (0);
- }
- /* NOTREACHED */
-}
-
-int
-rn_inithead(head, off)
- void **head;
- int off;
-{
- register struct radix_node_head *rnh;
- register struct radix_node *t, *tt, *ttt;
- if (*head)
- return (1);
- R_Malloc(rnh, struct radix_node_head *, sizeof (*rnh));
- if (rnh == 0)
- return (0);
- Bzero(rnh, sizeof (*rnh));
- *head = rnh;
- t = rn_newpair(rn_zeros, off, rnh->rnh_nodes);
- ttt = rnh->rnh_nodes + 2;
- t->rn_r = ttt;
- t->rn_p = t;
- tt = t->rn_l;
- tt->rn_flags = t->rn_flags = RNF_ROOT | RNF_ACTIVE;
- tt->rn_b = -1 - off;
- *ttt = *tt;
- ttt->rn_key = rn_ones;
- rnh->rnh_addaddr = rn_addroute;
- rnh->rnh_deladdr = rn_delete;
- rnh->rnh_matchaddr = rn_match;
- rnh->rnh_lookup = rn_lookup;
- rnh->rnh_walktree = rn_walktree;
- rnh->rnh_walktree_from = rn_walktree_from;
- rnh->rnh_treetop = t;
- return (1);
-}
-
-void
-rn_init()
-{
- char *cp, *cplim;
-#ifdef KERNEL
- struct domain *dom;
-
- for (dom = domains; dom; dom = dom->dom_next)
- if (dom->dom_maxrtkey > max_keylen)
- max_keylen = dom->dom_maxrtkey;
-#endif
- if (max_keylen == 0) {
- log(LOG_ERR,
- "rn_init: radix functions require max_keylen be set\n");
- return;
- }
- R_Malloc(rn_zeros, char *, 3 * max_keylen);
- if (rn_zeros == NULL)
- panic("rn_init");
- Bzero(rn_zeros, 3 * max_keylen);
- rn_ones = cp = rn_zeros + max_keylen;
- addmask_key = cplim = rn_ones + max_keylen;
- while (cp < cplim)
- *cp++ = -1;
- if (rn_inithead((void **)&mask_rnhead, 0) == 0)
- panic("rn_init 2");
-}
diff --git a/c/src/libnetworking/net/radix.h b/c/src/libnetworking/net/radix.h
deleted file mode 100644
index 6ef9aafbac..0000000000
--- a/c/src/libnetworking/net/radix.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 1988, 1989, 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.
- *
- * @(#)radix.h 8.2 (Berkeley) 10/31/94
- * $Id$
- */
-
-#ifndef _RADIX_H_
-#define _RADIX_H_
-
-/*
- * Radix search tree node layout.
- */
-
-struct radix_node {
- struct radix_mask *rn_mklist; /* list of masks contained in subtree */
- struct radix_node *rn_p; /* parent */
- short rn_b; /* bit offset; -1-index(netmask) */
- char rn_bmask; /* node: mask for bit test*/
- u_char rn_flags; /* enumerated next */
-#define RNF_NORMAL 1 /* leaf contains normal route */
-#define RNF_ROOT 2 /* leaf is root leaf for tree */
-#define RNF_ACTIVE 4 /* This node is alive (for rtfree) */
- union {
- struct { /* leaf only data: */
- caddr_t rn_Key; /* object of search */
- caddr_t rn_Mask; /* netmask, if present */
- struct radix_node *rn_Dupedkey;
- } rn_leaf;
- struct { /* node only data: */
- int rn_Off; /* where to start compare */
- struct radix_node *rn_L;/* progeny */
- struct radix_node *rn_R;/* progeny */
- } rn_node;
- } rn_u;
-#ifdef RN_DEBUG
- int rn_info;
- struct radix_node *rn_twin;
- struct radix_node *rn_ybro;
-#endif
-};
-
-#define rn_dupedkey rn_u.rn_leaf.rn_Dupedkey
-#define rn_key rn_u.rn_leaf.rn_Key
-#define rn_mask rn_u.rn_leaf.rn_Mask
-#define rn_off rn_u.rn_node.rn_Off
-#define rn_l rn_u.rn_node.rn_L
-#define rn_r rn_u.rn_node.rn_R
-
-/*
- * Annotations to tree concerning potential routes applying to subtrees.
- */
-
-extern struct radix_mask {
- short rm_b; /* bit offset; -1-index(netmask) */
- char rm_unused; /* cf. rn_bmask */
- u_char rm_flags; /* cf. rn_flags */
- struct radix_mask *rm_mklist; /* more masks to try */
- union {
- caddr_t rmu_mask; /* the mask */
- struct radix_node *rmu_leaf; /* for normal routes */
- } rm_rmu;
- int rm_refs; /* # of references to this struct */
-} *rn_mkfreelist;
-
-#define rm_mask rm_rmu.rmu_mask
-#define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */
-
-#define MKGet(m) {\
- if (rn_mkfreelist) {\
- m = rn_mkfreelist; \
- rn_mkfreelist = (m)->rm_mklist; \
- } else \
- R_Malloc(m, struct radix_mask *, sizeof (*(m))); }\
-
-#define MKFree(m) { (m)->rm_mklist = rn_mkfreelist; rn_mkfreelist = (m);}
-
-typedef int walktree_f_t __P((struct radix_node *, void *));
-
-struct radix_node_head {
- struct radix_node *rnh_treetop;
- int rnh_addrsize; /* permit, but not require fixed keys */
- int rnh_pktsize; /* permit, but not require fixed keys */
- struct radix_node *(*rnh_addaddr) /* add based on sockaddr */
- __P((void *v, void *mask,
- struct radix_node_head *head, struct radix_node nodes[]));
- struct radix_node *(*rnh_addpkt) /* add based on packet hdr */
- __P((void *v, void *mask,
- struct radix_node_head *head, struct radix_node nodes[]));
- struct radix_node *(*rnh_deladdr) /* remove based on sockaddr */
- __P((void *v, void *mask, struct radix_node_head *head));
- struct radix_node *(*rnh_delpkt) /* remove based on packet hdr */
- __P((void *v, void *mask, struct radix_node_head *head));
- struct radix_node *(*rnh_matchaddr) /* locate based on sockaddr */
- __P((void *v, struct radix_node_head *head));
- struct radix_node *(*rnh_lookup) /* locate based on sockaddr */
- __P((void *v, void *mask, struct radix_node_head *head));
- struct radix_node *(*rnh_matchpkt) /* locate based on packet hdr */
- __P((void *v, struct radix_node_head *head));
- int (*rnh_walktree) /* traverse tree */
- __P((struct radix_node_head *head, walktree_f_t *f, void *w));
- int (*rnh_walktree_from) /* traverse tree below a */
- __P((struct radix_node_head *head, void *a, void *m,
- walktree_f_t *f, void *w));
- void (*rnh_close) /* do something when the last ref drops */
- __P((struct radix_node *rn, struct radix_node_head *head));
- struct radix_node rnh_nodes[3]; /* empty tree for common case */
-};
-
-#ifndef KERNEL
-#define Bcmp(a, b, n) bcmp(((char *)(a)), ((char *)(b)), (n))
-#define Bcopy(a, b, n) bcopy(((char *)(a)), ((char *)(b)), (unsigned)(n))
-#define Bzero(p, n) bzero((char *)(p), (int)(n));
-#define R_Malloc(p, t, n) (p = (t) malloc((unsigned int)(n)))
-#define Free(p) free((char *)p);
-#else
-#define Bcmp(a, b, n) bcmp(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n))
-#define Bcopy(a, b, n) bcopy(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n))
-#define Bzero(p, n) bzero((caddr_t)(p), (unsigned)(n));
-#define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_DONTWAIT))
-#define Free(p) free((caddr_t)p, M_RTABLE);
-#endif /*KERNEL*/
-
-extern struct radix_node_head *mask_rnhead;
-
-void rn_init __P((void));
-int rn_inithead __P((void **, int));
-int rn_refines __P((void *, void *));
-struct radix_node
- *rn_addmask __P((void *, int, int)),
- *rn_addroute __P((void *, void *, struct radix_node_head *,
- struct radix_node [2])),
- *rn_match __P((void *, struct radix_node_head *));
-
-
-#endif /* _RADIX_H_ */
diff --git a/c/src/libnetworking/net/raw_cb.c b/c/src/libnetworking/net/raw_cb.c
deleted file mode 100644
index 0676931cdc..0000000000
--- a/c/src/libnetworking/net/raw_cb.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)raw_cb.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/raw_cb.h>
-#include <netinet/in.h>
-
-/*
- * Routines to manage the raw protocol control blocks.
- *
- * TODO:
- * hash lookups by protocol family/protocol + address family
- * take care of unique address problems per AF?
- * redo address binding to allow wildcards
- */
-
-struct rawcb rawcb;
-static u_long raw_sendspace = RAWSNDQ;
-static u_long raw_recvspace = RAWRCVQ;
-
-/*
- * Allocate a control block and a nominal amount
- * of buffer space for the socket.
- */
-int
-raw_attach(so, proto)
- register struct socket *so;
- int proto;
-{
- register struct rawcb *rp = sotorawcb(so);
- int error;
-
- /*
- * It is assumed that raw_attach is called
- * after space has been allocated for the
- * rawcb.
- */
- if (rp == 0)
- return (ENOBUFS);
- error = soreserve(so, raw_sendspace, raw_recvspace);
- if (error)
- return (error);
- rp->rcb_socket = so;
- rp->rcb_proto.sp_family = so->so_proto->pr_domain->dom_family;
- rp->rcb_proto.sp_protocol = proto;
- insque(rp, &rawcb);
- return (0);
-}
-
-/*
- * Detach the raw connection block and discard
- * socket resources.
- */
-void
-raw_detach(rp)
- register struct rawcb *rp;
-{
- struct socket *so = rp->rcb_socket;
-
- so->so_pcb = 0;
- sofree(so);
- remque(rp);
-#ifdef notdef
- if (rp->rcb_laddr)
- m_freem(dtom(rp->rcb_laddr));
- rp->rcb_laddr = 0;
-#endif
- free((caddr_t)(rp), M_PCB);
-}
-
-/*
- * Disconnect and possibly release resources.
- */
-void
-raw_disconnect(rp)
- struct rawcb *rp;
-{
-
-#ifdef notdef
- if (rp->rcb_faddr)
- m_freem(dtom(rp->rcb_faddr));
- rp->rcb_faddr = 0;
-#endif
- if (rp->rcb_socket->so_state & SS_NOFDREF)
- raw_detach(rp);
-}
-
-#ifdef notdef
-int
-raw_bind(so, nam)
- register struct socket *so;
- struct mbuf *nam;
-{
- struct sockaddr *addr = mtod(nam, struct sockaddr *);
- register struct rawcb *rp;
-
- if (ifnet == 0)
- return (EADDRNOTAVAIL);
- rp = sotorawcb(so);
- nam = m_copym(nam, 0, M_COPYALL, M_WAITOK);
- rp->rcb_laddr = mtod(nam, struct sockaddr *);
- return (0);
-}
-#endif
diff --git a/c/src/libnetworking/net/raw_cb.h b/c/src/libnetworking/net/raw_cb.h
deleted file mode 100644
index c1ed5e5e0a..0000000000
--- a/c/src/libnetworking/net/raw_cb.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)raw_cb.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_RAW_CB_H_
-#define _NET_RAW_CB_H_
-
-/*
- * Raw protocol interface control block. Used
- * to tie a socket to the generic raw interface.
- */
-struct rawcb {
- struct rawcb *rcb_next; /* doubly linked list */
- struct rawcb *rcb_prev;
- struct socket *rcb_socket; /* back pointer to socket */
- struct sockaddr *rcb_faddr; /* destination address */
- struct sockaddr *rcb_laddr; /* socket's address */
- struct sockproto rcb_proto; /* protocol family, protocol */
-};
-
-#define sotorawcb(so) ((struct rawcb *)(so)->so_pcb)
-
-/*
- * Nominal space allocated to a raw socket.
- */
-#define RAWSNDQ 8192
-#define RAWRCVQ 8192
-
-#ifdef KERNEL
-extern struct rawcb rawcb; /* head of list */
-
-int raw_attach __P((struct socket *, int));
-void raw_ctlinput __P((int, struct sockaddr *, void *));
-void raw_detach __P((struct rawcb *));
-void raw_disconnect __P((struct rawcb *));
-void raw_init __P((void));
-void raw_input __P((struct mbuf *,
- struct sockproto *, struct sockaddr *, struct sockaddr *));
-int raw_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-#endif
-
-#endif
diff --git a/c/src/libnetworking/net/raw_usrreq.c b/c/src/libnetworking/net/raw_usrreq.c
deleted file mode 100644
index fb4faf4d6d..0000000000
--- a/c/src/libnetworking/net/raw_usrreq.c
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)raw_usrreq.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/netisr.h>
-#include <net/raw_cb.h>
-
-/*
- * Initialize raw connection block q.
- */
-void
-raw_init()
-{
-
- rawcb.rcb_next = rawcb.rcb_prev = &rawcb;
-}
-
-
-/*
- * Raw protocol input routine. Find the socket
- * associated with the packet(s) and move them over. If
- * nothing exists for this packet, drop it.
- */
-/*
- * Raw protocol interface.
- */
-void
-raw_input(m0, proto, src, dst)
- struct mbuf *m0;
- register struct sockproto *proto;
- struct sockaddr *src, *dst;
-{
- register struct rawcb *rp;
- register struct mbuf *m = m0;
- register int sockets = 0;
- struct socket *last;
-
- last = 0;
- for (rp = rawcb.rcb_next; rp != &rawcb; rp = rp->rcb_next) {
- if (rp->rcb_proto.sp_family != proto->sp_family)
- continue;
- if (rp->rcb_proto.sp_protocol &&
- rp->rcb_proto.sp_protocol != proto->sp_protocol)
- continue;
- /*
- * We assume the lower level routines have
- * placed the address in a canonical format
- * suitable for a structure comparison.
- *
- * Note that if the lengths are not the same
- * the comparison will fail at the first byte.
- */
-#define equal(a1, a2) \
- (bcmp((caddr_t)(a1), (caddr_t)(a2), a1->sa_len) == 0)
- if (rp->rcb_laddr && !equal(rp->rcb_laddr, dst))
- continue;
- if (rp->rcb_faddr && !equal(rp->rcb_faddr, src))
- continue;
- if (last) {
- struct mbuf *n;
- n = m_copy(m, 0, (int)M_COPYALL);
- if (n) {
- if (sbappendaddr(&last->so_rcv, src,
- n, (struct mbuf *)0) == 0)
- /* should notify about lost packet */
- m_freem(n);
- else {
- sorwakeup(last);
- sockets++;
- }
- }
- }
- last = rp->rcb_socket;
- }
- if (last) {
- if (sbappendaddr(&last->so_rcv, src,
- m, (struct mbuf *)0) == 0)
- m_freem(m);
- else {
- sorwakeup(last);
- sockets++;
- }
- } else
- m_freem(m);
-}
-
-/*ARGSUSED*/
-void
-raw_ctlinput(cmd, arg, dummy)
- int cmd;
- struct sockaddr *arg;
- void *dummy;
-{
-
- if (cmd < 0 || cmd > PRC_NCMDS)
- return;
- /* INCOMPLETE */
-}
-
-/*ARGSUSED*/
-int
-raw_usrreq(so, req, m, nam, control)
- struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register struct rawcb *rp = sotorawcb(so);
- register int error = 0;
- int len;
-
- if (req == PRU_CONTROL)
- return (EOPNOTSUPP);
- if (control && control->m_len) {
- error = EOPNOTSUPP;
- goto release;
- }
- if (rp == 0) {
- error = EINVAL;
- goto release;
- }
- switch (req) {
-
- /*
- * Allocate a raw control block and fill in the
- * necessary info to allow packets to be routed to
- * the appropriate raw interface routine.
- */
- case PRU_ATTACH:
- if ((so->so_state & SS_PRIV) == 0) {
- error = EACCES;
- break;
- }
- error = raw_attach(so, (int)nam);
- break;
-
- /*
- * Destroy state just before socket deallocation.
- * Flush data or not depending on the options.
- */
- case PRU_DETACH:
- if (rp == 0) {
- error = ENOTCONN;
- break;
- }
- raw_detach(rp);
- break;
-
- /*
- * If a socket isn't bound to a single address,
- * the raw input routine will hand it anything
- * within that protocol family (assuming there's
- * nothing else around it should go to).
- */
- case PRU_CONNECT:
- error = EINVAL;
-#if 0
- if (rp->rcb_faddr) {
- error = EISCONN;
- break;
- }
- nam = m_copym(nam, 0, M_COPYALL, M_WAIT);
- rp->rcb_faddr = mtod(nam, struct sockaddr *);
- soisconnected(so);
-#endif
- break;
-
- case PRU_BIND:
- error = EINVAL;
-#if 0
- if (rp->rcb_laddr) {
- error = EINVAL; /* XXX */
- break;
- }
- error = raw_bind(so, nam);
-#endif
- break;
-
- case PRU_CONNECT2:
- error = EOPNOTSUPP;
- goto release;
-
- case PRU_DISCONNECT:
- if (rp->rcb_faddr == 0) {
- error = ENOTCONN;
- break;
- }
- raw_disconnect(rp);
- soisdisconnected(so);
- break;
-
- /*
- * Mark the connection as being incapable of further input.
- */
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- /*
- * Ship a packet out. The appropriate raw output
- * routine handles any massaging necessary.
- */
- case PRU_SEND:
- if (nam) {
- if (rp->rcb_faddr) {
- error = EISCONN;
- break;
- }
- rp->rcb_faddr = mtod(nam, struct sockaddr *);
- } else if (rp->rcb_faddr == 0) {
- error = ENOTCONN;
- break;
- }
- error = (*so->so_proto->pr_output)(m, so);
- m = NULL;
- if (nam)
- rp->rcb_faddr = 0;
- break;
-
- case PRU_ABORT:
- raw_disconnect(rp);
- sofree(so);
- soisdisconnected(so);
- break;
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- /*
- * Not supported.
- */
- case PRU_RCVOOB:
- case PRU_RCVD:
- return(EOPNOTSUPP);
-
- case PRU_LISTEN:
- case PRU_ACCEPT:
- case PRU_SENDOOB:
- error = EOPNOTSUPP;
- break;
-
- case PRU_SOCKADDR:
- if (rp->rcb_laddr == 0) {
- error = EINVAL;
- break;
- }
- len = rp->rcb_laddr->sa_len;
- bcopy((caddr_t)rp->rcb_laddr, mtod(nam, caddr_t), (unsigned)len);
- nam->m_len = len;
- break;
-
- case PRU_PEERADDR:
- if (rp->rcb_faddr == 0) {
- error = ENOTCONN;
- break;
- }
- len = rp->rcb_faddr->sa_len;
- bcopy((caddr_t)rp->rcb_faddr, mtod(nam, caddr_t), (unsigned)len);
- nam->m_len = len;
- break;
-
- default:
- panic("raw_usrreq");
- }
-release:
- if (m != NULL)
- m_freem(m);
- return (error);
-}
diff --git a/c/src/libnetworking/net/route.c b/c/src/libnetworking/net/route.c
deleted file mode 100644
index 683ddafee9..0000000000
--- a/c/src/libnetworking/net/route.c
+++ /dev/null
@@ -1,959 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 1991, 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.
- *
- * @(#)route.c 8.2 (Berkeley) 11/15/93
- * $Id$
- */
-
-#include "opt_mrouting.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/ioctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/raw_cb.h>
-
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_mroute.h>
-
-#define SA(p) ((struct sockaddr *)(p))
-
-struct route_cb route_cb;
-static struct rtstat rtstat;
-struct radix_node_head *rt_tables[AF_MAX+1];
-
-static int rttrash; /* routes not in table but not freed */
-
-static void rt_maskedcopy __P((struct sockaddr *,
- struct sockaddr *, struct sockaddr *));
-static void rtable_init __P((void **));
-
-static void
-rtable_init(table)
- void **table;
-{
- struct domain *dom;
- for (dom = domains; dom; dom = dom->dom_next)
- if (dom->dom_rtattach)
- dom->dom_rtattach(&table[dom->dom_family],
- dom->dom_rtoffset);
-}
-
-void
-route_init()
-{
- rn_init(); /* initialize all zeroes, all ones, mask table */
- rtable_init((void **)rt_tables);
-}
-
-/*
- * Packet routing routines.
- */
-void
-rtalloc(ro)
- register struct route *ro;
-{
- if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP))
- return; /* XXX */
- ro->ro_rt = rtalloc1(&ro->ro_dst, 1, 0UL);
-}
-
-void
-rtalloc_ign(ro, ignore)
- register struct route *ro;
- u_long ignore;
-{
- if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP))
- return; /* XXX */
- ro->ro_rt = rtalloc1(&ro->ro_dst, 1, ignore);
-}
-
-/*
- * Look up the route that matches the address given
- * Or, at least try.. Create a cloned route if needed.
- */
-struct rtentry *
-rtalloc1(dst, report, ignflags)
- register struct sockaddr *dst;
- int report;
- u_long ignflags;
-{
- register struct radix_node_head *rnh = rt_tables[dst->sa_family];
- register struct rtentry *rt;
- register struct radix_node *rn;
- struct rtentry *newrt = 0;
- struct rt_addrinfo info;
- u_long nflags;
- int s = splnet(), err = 0, msgtype = RTM_MISS;
-
- /*
- * Look up the address in the table for that Address Family
- */
- if (rnh && (rn = rnh->rnh_matchaddr((caddr_t)dst, rnh)) &&
- ((rn->rn_flags & RNF_ROOT) == 0)) {
- /*
- * If we find it and it's not the root node, then
- * get a refernce on the rtentry associated.
- */
- newrt = rt = (struct rtentry *)rn;
- nflags = rt->rt_flags & ~ignflags;
- if (report && (nflags & (RTF_CLONING | RTF_PRCLONING))) {
- /*
- * We are apparently adding (report = 0 in delete).
- * If it requires that it be cloned, do so.
- * (This implies it wasn't a HOST route.)
- */
- err = rtrequest(RTM_RESOLVE, dst, SA(0),
- SA(0), 0, &newrt);
- if (err) {
- /*
- * If the cloning didn't succeed, maybe
- * what we have will do. Return that.
- */
- newrt = rt;
- rt->rt_refcnt++;
- goto miss;
- }
- if ((rt = newrt) && (rt->rt_flags & RTF_XRESOLVE)) {
- /*
- * If the new route specifies it be
- * externally resolved, then go do that.
- */
- msgtype = RTM_RESOLVE;
- goto miss;
- }
- } else
- rt->rt_refcnt++;
- } else {
- /*
- * Either we hit the root or couldn't find any match,
- * Which basically means
- * "caint get there frm here"
- */
- rtstat.rts_unreach++;
- miss: if (report) {
- /*
- * If required, report the failure to the supervising
- * Authorities.
- * For a delete, this is not an error. (report == 0)
- */
- bzero((caddr_t)&info, sizeof(info));
- info.rti_info[RTAX_DST] = dst;
- rt_missmsg(msgtype, &info, 0, err);
- }
- }
- splx(s);
- return (newrt);
-}
-
-void
-rtfree(rt)
- register struct rtentry *rt;
-{
- register struct radix_node_head *rnh =
- rt_tables[rt_key(rt)->sa_family];
- register struct ifaddr *ifa;
-
- if (rt == 0 || rnh == 0)
- panic("rtfree");
- rt->rt_refcnt--;
- if(rnh->rnh_close && rt->rt_refcnt == 0) {
- rnh->rnh_close((struct radix_node *)rt, rnh);
- }
- if (rt->rt_refcnt <= 0 && (rt->rt_flags & RTF_UP) == 0) {
- if (rt->rt_nodes->rn_flags & (RNF_ACTIVE | RNF_ROOT))
- panic ("rtfree 2");
- rttrash--;
- if (rt->rt_refcnt < 0) {
- printf("rtfree: %p not freed (neg refs)\n", rt);
- return;
- }
- ifa = rt->rt_ifa;
- IFAFREE(ifa);
- if (rt->rt_parent) {
- RTFREE(rt->rt_parent);
- }
- Free(rt_key(rt));
- Free(rt);
- }
-}
-
-void
-ifafree(ifa)
- register struct ifaddr *ifa;
-{
- if (ifa == NULL)
- panic("ifafree");
- if (ifa->ifa_refcnt == 0)
- free(ifa, M_IFADDR);
- else
- ifa->ifa_refcnt--;
-}
-
-/*
- * Force a routing table entry to the specified
- * destination to go through the given gateway.
- * Normally called as a result of a routing redirect
- * message from the network layer.
- *
- * N.B.: must be called at splnet
- *
- */
-void
-rtredirect(dst, gateway, netmask, flags, src, rtp)
- struct sockaddr *dst, *gateway, *netmask, *src;
- int flags;
- struct rtentry **rtp;
-{
- register struct rtentry *rt;
- int error = 0;
- short *stat = 0;
- struct rt_addrinfo info;
- struct ifaddr *ifa;
-
- /* verify the gateway is directly reachable */
- if ((ifa = ifa_ifwithnet(gateway)) == 0) {
- error = ENETUNREACH;
- goto out;
- }
- rt = rtalloc1(dst, 0, 0UL);
- /*
- * If the redirect isn't from our current router for this dst,
- * it's either old or wrong. If it redirects us to ourselves,
- * we have a routing loop, perhaps as a result of an interface
- * going down recently.
- */
-#define equal(a1, a2) (bcmp((caddr_t)(a1), (caddr_t)(a2), (a1)->sa_len) == 0)
- if (!(flags & RTF_DONE) && rt &&
- (!equal(src, rt->rt_gateway) || rt->rt_ifa != ifa))
- error = EINVAL;
- else if (ifa_ifwithaddr(gateway))
- error = EHOSTUNREACH;
- if (error)
- goto done;
- /*
- * Create a new entry if we just got back a wildcard entry
- * or the the lookup failed. This is necessary for hosts
- * which use routing redirects generated by smart gateways
- * to dynamically build the routing tables.
- */
- if ((rt == 0) || (rt_mask(rt) && rt_mask(rt)->sa_len < 2))
- goto create;
- /*
- * Don't listen to the redirect if it's
- * for a route to an interface.
- */
- if (rt->rt_flags & RTF_GATEWAY) {
- if (((rt->rt_flags & RTF_HOST) == 0) && (flags & RTF_HOST)) {
- /*
- * Changing from route to net => route to host.
- * Create new route, rather than smashing route to net.
- */
- create:
- flags |= RTF_GATEWAY | RTF_DYNAMIC;
- error = rtrequest((int)RTM_ADD, dst, gateway,
- netmask, flags,
- (struct rtentry **)0);
- stat = &rtstat.rts_dynamic;
- } else {
- /*
- * Smash the current notion of the gateway to
- * this destination. Should check about netmask!!!
- */
- rt->rt_flags |= RTF_MODIFIED;
- flags |= RTF_MODIFIED;
- stat = &rtstat.rts_newgateway;
- rt_setgate(rt, rt_key(rt), gateway);
- }
- } else
- error = EHOSTUNREACH;
-done:
- if (rt) {
- if (rtp && !error)
- *rtp = rt;
- else
- rtfree(rt);
- }
-out:
- if (error)
- rtstat.rts_badredirect++;
- else if (stat != NULL)
- (*stat)++;
- bzero((caddr_t)&info, sizeof(info));
- info.rti_info[RTAX_DST] = dst;
- info.rti_info[RTAX_GATEWAY] = gateway;
- info.rti_info[RTAX_NETMASK] = netmask;
- info.rti_info[RTAX_AUTHOR] = src;
- rt_missmsg(RTM_REDIRECT, &info, flags, error);
-}
-
-/*
-* Routing table ioctl interface.
-*/
-int
-rtioctl(req, data, p)
- int req;
- caddr_t data;
- struct proc *p;
-{
-#ifdef INET
- /* Multicast goop, grrr... */
-#ifdef MROUTING
- return mrt_ioctl(req, data);
-#else
- return mrt_ioctl(req, data, p);
-#endif
-#else /* INET */
- return ENXIO;
-#endif /* INET */
-}
-
-struct ifaddr *
-ifa_ifwithroute(flags, dst, gateway)
- int flags;
- struct sockaddr *dst, *gateway;
-{
- register struct ifaddr *ifa;
- if ((flags & RTF_GATEWAY) == 0) {
- /*
- * If we are adding a route to an interface,
- * and the interface is a pt to pt link
- * we should search for the destination
- * as our clue to the interface. Otherwise
- * we can use the local address.
- */
- ifa = 0;
- if (flags & RTF_HOST) {
- ifa = ifa_ifwithdstaddr(dst);
- }
- if (ifa == 0)
- ifa = ifa_ifwithaddr(gateway);
- } else {
- /*
- * If we are adding a route to a remote net
- * or host, the gateway may still be on the
- * other end of a pt to pt link.
- */
- ifa = ifa_ifwithdstaddr(gateway);
- }
- if (ifa == 0)
- ifa = ifa_ifwithnet(gateway);
- if (ifa == 0) {
- struct rtentry *rt = rtalloc1(dst, 0, 0UL);
- if (rt == 0)
- return (0);
- rt->rt_refcnt--;
- if ((ifa = rt->rt_ifa) == 0)
- return (0);
- }
- if (ifa->ifa_addr->sa_family != dst->sa_family) {
- struct ifaddr *oifa = ifa;
- ifa = ifaof_ifpforaddr(dst, ifa->ifa_ifp);
- if (ifa == 0)
- ifa = oifa;
- }
- return (ifa);
-}
-
-#define ROUNDUP(a) (a>0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
-
-static int rt_fixdelete(struct radix_node *, void *);
-static int rt_fixchange(struct radix_node *, void *);
-
-struct rtfc_arg {
- struct rtentry *rt0;
- struct radix_node_head *rnh;
-};
-
-/*
- * Do appropriate manipulations of a routing tree given
- * all the bits of info needed
- */
-int
-rtrequest(req, dst, gateway, netmask, flags, ret_nrt)
- int req, flags;
- struct sockaddr *dst, *gateway, *netmask;
- struct rtentry **ret_nrt;
-{
- int s = splnet(); int error = 0;
- register struct rtentry *rt;
- register struct radix_node *rn;
- register struct radix_node_head *rnh;
- struct ifaddr *ifa;
- struct sockaddr *ndst;
-#define senderr(x) { error = x ; goto bad; }
-
- /*
- * Find the correct routing tree to use for this Address Family
- */
- if ((rnh = rt_tables[dst->sa_family]) == 0)
- senderr(ESRCH);
- /*
- * If we are adding a host route then we don't want to put
- * a netmask in the tree
- */
- if (flags & RTF_HOST)
- netmask = 0;
- switch (req) {
- case RTM_DELETE:
- /*
- * Remove the item from the tree and return it.
- * Complain if it is not there and do no more processing.
- */
- if ((rn = rnh->rnh_deladdr(dst, netmask, rnh)) == 0)
- senderr(ESRCH);
- if (rn->rn_flags & (RNF_ACTIVE | RNF_ROOT))
- panic ("rtrequest delete");
- rt = (struct rtentry *)rn;
-
- /*
- * Now search what's left of the subtree for any cloned
- * routes which might have been formed from this node.
- */
- if ((rt->rt_flags & RTF_PRCLONING) && netmask) {
- rnh->rnh_walktree_from(rnh, dst, netmask,
- rt_fixdelete, rt);
- }
-
- /*
- * Remove any external references we may have.
- * This might result in another rtentry being freed if
- * we held it's last reference.
- */
- if (rt->rt_gwroute) {
- rt = rt->rt_gwroute;
- RTFREE(rt);
- (rt = (struct rtentry *)rn)->rt_gwroute = 0;
- }
-
- /*
- * NB: RTF_UP must be set during the search above,
- * because we might delete the last ref, causing
- * rt to get freed prematurely.
- */
- rt->rt_flags &= ~RTF_UP;
-
- /*
- * If there is llinfo or similar associated with the
- * route, give the interface a chance to deal with it..
- */
- if ((ifa = rt->rt_ifa) && ifa->ifa_rtrequest)
- ifa->ifa_rtrequest(RTM_DELETE, rt, SA(0));
- rttrash++;
- /*
- * If the caller wants it, then it can have it, but it's up to it
- * to free the rtentry as we won't be doing it.
- */
- if (ret_nrt)
- *ret_nrt = rt;
- else if (rt->rt_refcnt <= 0) {
- rt->rt_refcnt++; /* make a 1->0 transition */
- rtfree(rt);
- }
- break;
-
- case RTM_RESOLVE:
- if (ret_nrt == 0 || (rt = *ret_nrt) == 0)
- senderr(EINVAL);
- ifa = rt->rt_ifa;
- flags = rt->rt_flags &
- ~(RTF_CLONING | RTF_PRCLONING | RTF_STATIC);
- flags |= RTF_WASCLONED;
- gateway = rt->rt_gateway;
- if ((netmask = rt->rt_genmask) == 0)
- flags |= RTF_HOST;
- goto makeroute;
-
- case RTM_ADD:
- if ((flags & RTF_GATEWAY) && !gateway)
- panic("rtrequest: GATEWAY but no gateway");
-
- if ((ifa = ifa_ifwithroute(flags, dst, gateway)) == 0)
- senderr(ENETUNREACH);
-
- makeroute:
- R_Malloc(rt, struct rtentry *, sizeof(*rt));
- if (rt == 0)
- senderr(ENOBUFS);
- Bzero(rt, sizeof(*rt));
- rt->rt_flags = RTF_UP | flags;
- if ((error = rt_setgate(rt, dst, gateway))) {
- Free(rt);
- senderr(error);
- }
- ndst = rt_key(rt);
- if (netmask) {
- rt_maskedcopy(dst, ndst, netmask);
- } else
- Bcopy(dst, ndst, dst->sa_len);
-
- /*
- * This moved from below so that rnh->rnh_addaddr() can
- * examine the ifa and ifp if it so desires.
- */
- ifa->ifa_refcnt++;
- rt->rt_ifa = ifa;
- rt->rt_ifp = ifa->ifa_ifp;
-
- rn = rnh->rnh_addaddr((caddr_t)ndst, (caddr_t)netmask,
- rnh, rt->rt_nodes);
- if (rn == 0) {
- struct rtentry *rt2;
- /*
- * Uh-oh, we already have one of these in the tree.
- * We do a special hack: if the route that's already
- * there was generated by the protocol-cloning
- * mechanism, then we just blow it away and retry
- * the insertion of the new one.
- */
- rt2 = rtalloc1(dst, 0, RTF_PRCLONING);
- if (rt2 && rt2->rt_parent) {
- rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt2),
- rt2->rt_gateway,
- rt_mask(rt2), rt2->rt_flags, 0);
- RTFREE(rt2);
- rn = rnh->rnh_addaddr((caddr_t)ndst,
- (caddr_t)netmask,
- rnh, rt->rt_nodes);
- } else if (rt2) {
- RTFREE(rt2);
- }
- }
-
- if (rn == 0) {
- if (rt->rt_gwroute)
- rtfree(rt->rt_gwroute);
- if (rt->rt_ifa) {
- IFAFREE(rt->rt_ifa);
- }
- Free(rt_key(rt));
- Free(rt);
- senderr(EEXIST);
- }
- rt->rt_parent = 0;
-
- if (req == RTM_RESOLVE) {
- rt->rt_rmx = (*ret_nrt)->rt_rmx; /* copy metrics */
- if ((*ret_nrt)->rt_flags & RTF_PRCLONING) {
- rt->rt_parent = (*ret_nrt);
- (*ret_nrt)->rt_refcnt++;
- }
- }
- if (ifa->ifa_rtrequest)
- ifa->ifa_rtrequest(req, rt, SA(ret_nrt ? *ret_nrt : 0));
- /*
- * We repeat the same procedure from rt_setgate() here because
- * it doesn't fire when we call it there because the node
- * hasn't been added to the tree yet.
- */
- if (!(rt->rt_flags & RTF_HOST) && rt_mask(rt) != 0) {
- struct rtfc_arg arg;
- arg.rnh = rnh;
- arg.rt0 = rt;
- rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt),
- rt_fixchange, &arg);
- }
-
- if (ret_nrt) {
- *ret_nrt = rt;
- rt->rt_refcnt++;
- }
- break;
- }
-bad:
- splx(s);
- return (error);
-}
-
-/*
- * Called from rtrequest(RTM_DELETE, ...) to fix up the route's ``family''
- * (i.e., the routes related to it by the operation of cloning). This
- * routine is iterated over all potential former-child-routes by way of
- * rnh->rnh_walktree_from() above, and those that actually are children of
- * the late parent (passed in as VP here) are themselves deleted.
- */
-static int
-rt_fixdelete(struct radix_node *rn, void *vp)
-{
- struct rtentry *rt = (struct rtentry *)rn;
- struct rtentry *rt0 = vp;
-
- if (rt->rt_parent == rt0 && !(rt->rt_flags & RTF_PINNED)) {
- return rtrequest(RTM_DELETE, rt_key(rt),
- (struct sockaddr *)0, rt_mask(rt),
- rt->rt_flags, (struct rtentry **)0);
- }
- return 0;
-}
-
-/*
- * This routine is called from rt_setgate() to do the analogous thing for
- * adds and changes. There is the added complication in this case of a
- * middle insert; i.e., insertion of a new network route between an older
- * network route and (cloned) host routes. For this reason, a simple check
- * of rt->rt_parent is insufficient; each candidate route must be tested
- * against the (mask, value) of the new route (passed as before in vp)
- * to see if the new route matches it. Unfortunately, this has the obnoxious
- * property of also triggering for insertion /above/ a pre-existing network
- * route and clones. Sigh. This may be fixed some day.
- *
- * XXX - it may be possible to do fixdelete() for changes and reserve this
- * routine just for adds. I'm not sure why I thought it was necessary to do
- * changes this way.
- */
-#ifdef DEBUG
-int rtfcdebug = 0;
-#endif
-
-static int
-rt_fixchange(struct radix_node *rn, void *vp)
-{
- struct rtentry *rt = (struct rtentry *)rn;
- struct rtfc_arg *ap = vp;
- struct rtentry *rt0 = ap->rt0;
- struct radix_node_head *rnh = ap->rnh;
- u_char *xk1, *xm1, *xk2;
- int i, len;
-
-#ifdef DEBUG
- if (rtfcdebug)
- printf("rt_fixchange: rt %p, rt0 %p\n", rt, rt0);
-#endif
-
- if (!rt->rt_parent || (rt->rt_flags & RTF_PINNED)) {
-#ifdef DEBUG
- if(rtfcdebug) printf("no parent or pinned\n");
-#endif
- return 0;
- }
-
- if (rt->rt_parent == rt0) {
-#ifdef DEBUG
- if(rtfcdebug) printf("parent match\n");
-#endif
- return rtrequest(RTM_DELETE, rt_key(rt),
- (struct sockaddr *)0, rt_mask(rt),
- rt->rt_flags, (struct rtentry **)0);
- }
-
- /*
- * There probably is a function somewhere which does this...
- * if not, there should be.
- */
- len = imin(((struct sockaddr *)rt_key(rt0))->sa_len,
- ((struct sockaddr *)rt_key(rt))->sa_len);
-
- xk1 = (u_char *)rt_key(rt0);
- xm1 = (u_char *)rt_mask(rt0);
- xk2 = (u_char *)rt_key(rt);
-
- for (i = rnh->rnh_treetop->rn_off; i < len; i++) {
- if ((xk2[i] & xm1[i]) != xk1[i]) {
-#ifdef DEBUG
- if(rtfcdebug) printf("no match\n");
-#endif
- return 0;
- }
- }
-
- /*
- * OK, this node is a clone, and matches the node currently being
- * changed/added under the node's mask. So, get rid of it.
- */
-#ifdef DEBUG
- if(rtfcdebug) printf("deleting\n");
-#endif
- return rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *)0,
- rt_mask(rt), rt->rt_flags, (struct rtentry **)0);
-}
-
-int
-rt_setgate(rt0, dst, gate)
- struct rtentry *rt0;
- struct sockaddr *dst, *gate;
-{
- caddr_t new, old;
- int dlen = ROUNDUP(dst->sa_len), glen = ROUNDUP(gate->sa_len);
- register struct rtentry *rt = rt0;
- struct radix_node_head *rnh = rt_tables[dst->sa_family];
-
- /*
- * A host route with the destination equal to the gateway
- * will interfere with keeping LLINFO in the routing
- * table, so disallow it.
- */
- if (((rt0->rt_flags & (RTF_HOST|RTF_GATEWAY|RTF_LLINFO)) ==
- (RTF_HOST|RTF_GATEWAY)) &&
- (dst->sa_len == gate->sa_len) &&
- (bcmp(dst, gate, dst->sa_len) == 0)) {
- /*
- * The route might already exist if this is an RTM_CHANGE
- * or a routing redirect, so try to delete it.
- */
- if (rt_key(rt0))
- rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt0),
- rt0->rt_gateway, rt_mask(rt0), rt0->rt_flags, 0);
- return EADDRNOTAVAIL;
- }
-
- if (rt->rt_gateway == 0 || glen > ROUNDUP(rt->rt_gateway->sa_len)) {
- old = (caddr_t)rt_key(rt);
- R_Malloc(new, caddr_t, dlen + glen);
- if (new == 0)
- return ENOBUFS;
- rt->rt_nodes->rn_key = new;
- } else {
- new = rt->rt_nodes->rn_key;
- old = 0;
- }
- Bcopy(gate, (rt->rt_gateway = (struct sockaddr *)(new + dlen)), glen);
- if (old) {
- Bcopy(dst, new, dlen);
- Free(old);
- }
- if (rt->rt_gwroute) {
- rt = rt->rt_gwroute; RTFREE(rt);
- rt = rt0; rt->rt_gwroute = 0;
- }
- /*
- * Cloning loop avoidance:
- * In the presence of protocol-cloning and bad configuration,
- * it is possible to get stuck in bottomless mutual recursion
- * (rtrequest rt_setgate rtalloc1). We avoid this by not allowing
- * protocol-cloning to operate for gateways (which is probably the
- * correct choice anyway), and avoid the resulting reference loops
- * by disallowing any route to run through itself as a gateway.
- * This is obviuosly mandatory when we get rt->rt_output().
- */
- if (rt->rt_flags & RTF_GATEWAY) {
- rt->rt_gwroute = rtalloc1(gate, 1, RTF_PRCLONING);
- if (rt->rt_gwroute == rt) {
- RTFREE(rt->rt_gwroute);
- rt->rt_gwroute = 0;
- return EDQUOT; /* failure */
- }
- }
-
- /*
- * This isn't going to do anything useful for host routes, so
- * don't bother. Also make sure we have a reasonable mask
- * (we don't yet have one during adds).
- */
- if (!(rt->rt_flags & RTF_HOST) && rt_mask(rt) != 0) {
- struct rtfc_arg arg;
- arg.rnh = rnh;
- arg.rt0 = rt;
- rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt),
- rt_fixchange, &arg);
- }
-
- return 0;
-}
-
-static void
-rt_maskedcopy(src, dst, netmask)
- struct sockaddr *src, *dst, *netmask;
-{
- register u_char *cp1 = (u_char *)src;
- register u_char *cp2 = (u_char *)dst;
- register u_char *cp3 = (u_char *)netmask;
- u_char *cplim = cp2 + *cp3;
- u_char *cplim2 = cp2 + *cp1;
-
- *cp2++ = *cp1++; *cp2++ = *cp1++; /* copies sa_len & sa_family */
- cp3 += 2;
- if (cplim > cplim2)
- cplim = cplim2;
- while (cp2 < cplim)
- *cp2++ = *cp1++ & *cp3++;
- if (cp2 < cplim2)
- bzero((caddr_t)cp2, (unsigned)(cplim2 - cp2));
-}
-
-/*
- * Set up a routing table entry, normally
- * for an interface.
- */
-int
-rtinit(ifa, cmd, flags)
- register struct ifaddr *ifa;
- int cmd, flags;
-{
- register struct rtentry *rt;
- register struct sockaddr *dst;
- register struct sockaddr *deldst;
- struct mbuf *m = 0;
- struct rtentry *nrt = 0;
- int error;
-
- dst = flags & RTF_HOST ? ifa->ifa_dstaddr : ifa->ifa_addr;
- /*
- * If it's a delete, check that if it exists, it's on the correct
- * interface or we might scrub a route to another ifa which would
- * be confusing at best and possibly worse.
- */
- if (cmd == RTM_DELETE) {
- /*
- * It's a delete, so it should already exist..
- * If it's a net, mask off the host bits
- * (Assuming we have a mask)
- */
- if ((flags & RTF_HOST) == 0 && ifa->ifa_netmask) {
- m = m_get(M_WAIT, MT_SONAME);
- deldst = mtod(m, struct sockaddr *);
- rt_maskedcopy(dst, deldst, ifa->ifa_netmask);
- dst = deldst;
- }
- /*
- * Get an rtentry that is in the routing tree and
- * contains the correct info. (if this fails we can't get there).
- * We set "report" to FALSE so that if it doesn't exist,
- * it doesn't report an error or clone a route, etc. etc.
- */
- rt = rtalloc1(dst, 0, 0UL);
- if (rt) {
- /*
- * Ok so we found the rtentry. it has an extra reference
- * for us at this stage. we won't need that so
- * lop that off now.
- */
- rt->rt_refcnt--;
- if (rt->rt_ifa != ifa) {
- /*
- * If the interface in the rtentry doesn't match
- * the interface we are using, then we don't
- * want to delete it, so return an error.
- * This seems to be the only point of
- * this whole RTM_DELETE clause.
- */
- if (m)
- (void) m_free(m);
- return (flags & RTF_HOST ? EHOSTUNREACH
- : ENETUNREACH);
- }
- }
- /* XXX */
-#if 0
- else {
- /*
- * One would think that as we are deleting, and we know
- * it doesn't exist, we could just return at this point
- * with an "ELSE" clause, but apparently not..
- */
- return (flags & RTF_HOST ? EHOSTUNREACH
- : ENETUNREACH);
- }
-#endif
- }
- /*
- * Do the actual request
- */
- error = rtrequest(cmd, dst, ifa->ifa_addr, ifa->ifa_netmask,
- flags | ifa->ifa_flags, &nrt);
- if (m)
- (void) m_free(m);
- /*
- * If we are deleting, and we found an entry, then
- * it's been removed from the tree.. now throw it away.
- */
- if (cmd == RTM_DELETE && error == 0 && (rt = nrt)) {
- /*
- * notify any listenning routing agents of the change
- */
- rt_newaddrmsg(cmd, ifa, error, nrt);
- if (rt->rt_refcnt <= 0) {
- rt->rt_refcnt++; /* need a 1->0 transition to free */
- rtfree(rt);
- }
- }
-
- /*
- * We are adding, and we have a returned routing entry.
- * We need to sanity check the result.
- */
- if (cmd == RTM_ADD && error == 0 && (rt = nrt)) {
- /*
- * We just wanted to add it.. we don't actually need a reference
- */
- rt->rt_refcnt--;
- /*
- * If it came back with an unexpected interface, then it must
- * have already existed or something. (XXX)
- */
- if (rt->rt_ifa != ifa) {
- printf("rtinit: wrong ifa (%p) was (%p)\n", ifa,
- rt->rt_ifa);
- /*
- * Ask that the route we got back be removed
- * from the routing tables as we are trying
- * to supersede it.
- */
- if (rt->rt_ifa->ifa_rtrequest)
- rt->rt_ifa->ifa_rtrequest(RTM_DELETE, rt, SA(0));
- /*
- * Remove the referenve to the it's ifaddr.
- */
- IFAFREE(rt->rt_ifa);
- /*
- * And substitute in references to the ifaddr
- * we are adding.
- */
- rt->rt_ifa = ifa;
- rt->rt_ifp = ifa->ifa_ifp;
- ifa->ifa_refcnt++;
- /*
- * Now add it to the routing table
- * XXX could we have just left it?
- * as it might have been in the right place..
- */
- if (ifa->ifa_rtrequest)
- ifa->ifa_rtrequest(RTM_ADD, rt, SA(0));
- }
- /*
- * notify any listenning routing agents of the change
- */
- rt_newaddrmsg(cmd, ifa, error, nrt);
- }
- return (error);
-}
diff --git a/c/src/libnetworking/net/route.h b/c/src/libnetworking/net/route.h
deleted file mode 100644
index 69d76909fc..0000000000
--- a/c/src/libnetworking/net/route.h
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)route.h 8.3 (Berkeley) 4/19/94
- * $Id$
- */
-
-#ifndef _NET_ROUTE_H_
-#define _NET_ROUTE_H_
-
-/*
- * Kernel resident routing tables.
- *
- * The routing tables are initialized when interface addresses
- * are set by making entries for all directly connected interfaces.
- */
-
-/*
- * A route consists of a destination address and a reference
- * to a routing entry. These are often held by protocols
- * in their control blocks, e.g. inpcb.
- */
-struct route {
- struct rtentry *ro_rt;
- struct sockaddr ro_dst;
-};
-
-/*
- * These numbers are used by reliable protocols for determining
- * retransmission behavior and are included in the routing structure.
- */
-struct rt_metrics {
- u_long rmx_locks; /* Kernel must leave these values alone */
- u_long rmx_mtu; /* MTU for this path */
- u_long rmx_hopcount; /* max hops expected */
- u_long rmx_expire; /* lifetime for route, e.g. redirect */
- u_long rmx_recvpipe; /* inbound delay-bandwidth product */
- u_long rmx_sendpipe; /* outbound delay-bandwidth product */
- u_long rmx_ssthresh; /* outbound gateway buffer limit */
- u_long rmx_rtt; /* estimated round trip time */
- u_long rmx_rttvar; /* estimated rtt variance */
- u_long rmx_pksent; /* packets sent using this route */
- u_long rmx_filler[4]; /* will be used for T/TCP later */
-};
-
-/*
- * rmx_rtt and rmx_rttvar are stored as microseconds;
- * RTTTOPRHZ(rtt) converts to a value suitable for use
- * by a protocol slowtimo counter.
- */
-#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */
-#define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ))
-
-/*
- * XXX kernel function pointer `rt_output' is visible to applications.
- */
-struct mbuf;
-
-/*
- * We distinguish between routes to hosts and routes to networks,
- * preferring the former if available. For each route we infer
- * the interface to use from the gateway address supplied when
- * the route was entered. Routes that forward packets through
- * gateways are marked so that the output routines know to address the
- * gateway rather than the ultimate destination.
- */
-#ifndef RNF_NORMAL
-#include <net/radix.h>
-#endif
-struct rtentry {
- struct radix_node rt_nodes[2]; /* tree glue, and other values */
-#define rt_key(r) ((struct sockaddr *)((r)->rt_nodes->rn_key))
-#define rt_mask(r) ((struct sockaddr *)((r)->rt_nodes->rn_mask))
- struct sockaddr *rt_gateway; /* value */
- short rt_filler; /* was short flags field */
- short rt_refcnt; /* # held references */
- u_long rt_flags; /* up/down?, host/net */
- struct ifnet *rt_ifp; /* the answer: interface to use */
- struct ifaddr *rt_ifa; /* the answer: interface to use */
- struct sockaddr *rt_genmask; /* for generation of cloned routes */
- caddr_t rt_llinfo; /* pointer to link level info cache */
- struct rt_metrics rt_rmx; /* metrics used by rx'ing protocols */
- struct rtentry *rt_gwroute; /* implied entry for gatewayed routes */
- int (*rt_output) __P((struct ifnet *, struct mbuf *,
- struct sockaddr *, struct rtentry *));
- /* output routine for this (rt,if) */
- struct rtentry *rt_parent; /* cloning parent of this route */
- void *rt_filler2; /* more filler */
-};
-
-/*
- * Following structure necessary for 4.3 compatibility;
- * We should eventually move it to a compat file.
- */
-struct ortentry {
- u_long rt_hash; /* to speed lookups */
- struct sockaddr rt_dst; /* key */
- struct sockaddr rt_gateway; /* value */
- short rt_flags; /* up/down?, host/net */
- short rt_refcnt; /* # held references */
- u_long rt_use; /* raw # packets forwarded */
- struct ifnet *rt_ifp; /* the answer: interface to use */
-};
-
-#define rt_use rt_rmx.rmx_pksent
-
-#define RTF_UP 0x1 /* route usable */
-#define RTF_GATEWAY 0x2 /* destination is a gateway */
-#define RTF_HOST 0x4 /* host entry (net otherwise) */
-#define RTF_REJECT 0x8 /* host or net unreachable */
-#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */
-#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */
-#define RTF_DONE 0x40 /* message confirmed */
-/* 0x80 unused */
-#define RTF_CLONING 0x100 /* generate new routes on use */
-#define RTF_XRESOLVE 0x200 /* external daemon resolves name */
-#define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP) */
-#define RTF_STATIC 0x800 /* manually added */
-#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */
-#define RTF_PROTO2 0x4000 /* protocol specific routing flag */
-#define RTF_PROTO1 0x8000 /* protocol specific routing flag */
-
-#define RTF_PRCLONING 0x10000 /* protocol requires cloning */
-#define RTF_WASCLONED 0x20000 /* route generated through cloning */
-#define RTF_PROTO3 0x40000 /* protocol specific routing flag */
-/* 0x80000 unused */
-#define RTF_PINNED 0x100000 /* future use */
-#define RTF_LOCAL 0x200000 /* route represents a local address */
-#define RTF_BROADCAST 0x400000 /* route represents a bcast address */
-#define RTF_MULTICAST 0x800000 /* route represents a mcast address */
- /* 0x1000000 and up unassigned */
-
-/*
- * Routing statistics.
- */
-struct rtstat {
- short rts_badredirect; /* bogus redirect calls */
- short rts_dynamic; /* routes created by redirects */
- short rts_newgateway; /* routes modified by redirects */
- short rts_unreach; /* lookups which failed */
- short rts_wildcard; /* lookups satisfied by a wildcard */
-};
-/*
- * Structures for routing messages.
- */
-struct rt_msghdr {
- u_short rtm_msglen; /* to skip over non-understood messages */
- u_char rtm_version; /* future binary compatibility */
- u_char rtm_type; /* message type */
- u_short rtm_index; /* index for associated ifp */
- int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
- int rtm_addrs; /* bitmask identifying sockaddrs in msg */
- pid_t rtm_pid; /* identify sender */
- int rtm_seq; /* for sender to identify action */
- int rtm_errno; /* why failed */
- int rtm_use; /* from rtentry */
- u_long rtm_inits; /* which metrics we are initializing */
- struct rt_metrics rtm_rmx; /* metrics themselves */
-};
-
-#define RTM_VERSION 5 /* Up the ante and ignore older versions */
-
-#define RTM_ADD 0x1 /* Add Route */
-#define RTM_DELETE 0x2 /* Delete Route */
-#define RTM_CHANGE 0x3 /* Change Metrics or flags */
-#define RTM_GET 0x4 /* Report Metrics */
-#define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */
-#define RTM_REDIRECT 0x6 /* Told to use different route */
-#define RTM_MISS 0x7 /* Lookup failed on this address */
-#define RTM_LOCK 0x8 /* fix specified metrics */
-#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */
-#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */
-#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */
-#define RTM_NEWADDR 0xc /* address being added to iface */
-#define RTM_DELADDR 0xd /* address being removed from iface */
-#define RTM_IFINFO 0xe /* iface going up/down etc. */
-
-#define RTV_MTU 0x1 /* init or lock _mtu */
-#define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */
-#define RTV_EXPIRE 0x4 /* init or lock _hopcount */
-#define RTV_RPIPE 0x8 /* init or lock _recvpipe */
-#define RTV_SPIPE 0x10 /* init or lock _sendpipe */
-#define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */
-#define RTV_RTT 0x40 /* init or lock _rtt */
-#define RTV_RTTVAR 0x80 /* init or lock _rttvar */
-
-/*
- * Bitmask values for rtm_addr.
- */
-#define RTA_DST 0x1 /* destination sockaddr present */
-#define RTA_GATEWAY 0x2 /* gateway sockaddr present */
-#define RTA_NETMASK 0x4 /* netmask sockaddr present */
-#define RTA_GENMASK 0x8 /* cloning mask sockaddr present */
-#define RTA_IFP 0x10 /* interface name sockaddr present */
-#define RTA_IFA 0x20 /* interface addr sockaddr present */
-#define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */
-#define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */
-
-/*
- * Index offsets for sockaddr array for alternate internal encoding.
- */
-#define RTAX_DST 0 /* destination sockaddr present */
-#define RTAX_GATEWAY 1 /* gateway sockaddr present */
-#define RTAX_NETMASK 2 /* netmask sockaddr present */
-#define RTAX_GENMASK 3 /* cloning mask sockaddr present */
-#define RTAX_IFP 4 /* interface name sockaddr present */
-#define RTAX_IFA 5 /* interface addr sockaddr present */
-#define RTAX_AUTHOR 6 /* sockaddr for author of redirect */
-#define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */
-#define RTAX_MAX 8 /* size of array to allocate */
-
-struct rt_addrinfo {
- int rti_addrs;
- struct sockaddr *rti_info[RTAX_MAX];
-};
-
-struct route_cb {
- int ip_count;
- int ipx_count;
- int ns_count;
- int iso_count;
- int any_count;
-};
-
-#ifdef KERNEL
-#define RTFREE(rt) \
- if ((rt)->rt_refcnt <= 1) \
- rtfree(rt); \
- else \
- (rt)->rt_refcnt--;
-
-extern struct route_cb route_cb;
-extern struct rtstat rtstat;
-extern struct radix_node_head *rt_tables[AF_MAX+1];
-
-void route_init __P((void));
-void rt_ifmsg __P((struct ifnet *));
-void rt_missmsg __P((int, struct rt_addrinfo *, int, int));
-void rt_newaddrmsg __P((int, struct ifaddr *, int, struct rtentry *));
-int rt_setgate __P((struct rtentry *,
- struct sockaddr *, struct sockaddr *));
-void rtalloc __P((struct route *));
-void rtalloc_ign __P((struct route *, unsigned long));
-struct rtentry *
- rtalloc1 __P((struct sockaddr *, int, unsigned long));
-void rtfree __P((struct rtentry *));
-int rtinit __P((struct ifaddr *, int, int));
-int rtioctl __P((int, caddr_t, struct proc *));
-void rtredirect __P((struct sockaddr *, struct sockaddr *,
- struct sockaddr *, int, struct sockaddr *, struct rtentry **));
-int rtrequest __P((int, struct sockaddr *,
- struct sockaddr *, struct sockaddr *, int, struct rtentry **));
-#endif
-
-#endif
diff --git a/c/src/libnetworking/net/rtsock.c b/c/src/libnetworking/net/rtsock.c
deleted file mode 100644
index 57e777906a..0000000000
--- a/c/src/libnetworking/net/rtsock.c
+++ /dev/null
@@ -1,829 +0,0 @@
-/*
- * Copyright (c) 1988, 1991, 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.
- *
- * @(#)rtsock.c 8.5 (Berkeley) 11/2/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/raw_cb.h>
-
-static struct sockaddr route_dst = { 2, PF_ROUTE, };
-static struct sockaddr route_src = { 2, PF_ROUTE, };
-static struct sockaddr sa_zero = { sizeof(sa_zero), AF_INET, };
-static struct sockproto route_proto = { PF_ROUTE, };
-
-struct walkarg {
- int w_tmemsize;
- int w_op, w_arg;
- caddr_t w_tmem;
- struct sysctl_req *w_req;
-};
-
-static struct mbuf *
- rt_msg1 __P((int, struct rt_addrinfo *));
-static int rt_msg2 __P((int,
- struct rt_addrinfo *, caddr_t, struct walkarg *));
-static int rt_xaddrs __P((caddr_t, caddr_t, struct rt_addrinfo *));
-static int sysctl_dumpentry __P((struct radix_node *rn, void *vw));
-static int sysctl_iflist __P((int af, struct walkarg *w));
-static int route_output __P((struct mbuf *, struct socket *));
-static int route_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-static void rt_setmetrics __P((u_long, struct rt_metrics *, struct rt_metrics *));
-
-/* Sleazy use of local variables throughout file, warning!!!! */
-#define dst info.rti_info[RTAX_DST]
-#define gate info.rti_info[RTAX_GATEWAY]
-#define netmask info.rti_info[RTAX_NETMASK]
-#define genmask info.rti_info[RTAX_GENMASK]
-#define ifpaddr info.rti_info[RTAX_IFP]
-#define ifaaddr info.rti_info[RTAX_IFA]
-#define brdaddr info.rti_info[RTAX_BRD]
-
-/*ARGSUSED*/
-static int
-route_usrreq(so, req, m, nam, control)
- register struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register int error = 0;
- register struct rawcb *rp = sotorawcb(so);
- int s;
-
- if (req == PRU_ATTACH) {
- MALLOC(rp, struct rawcb *, sizeof(*rp), M_PCB, M_WAITOK);
- so->so_pcb = (caddr_t)rp;
- if (so->so_pcb)
- bzero(so->so_pcb, sizeof(*rp));
- }
- if (req == PRU_DETACH && rp) {
- int af = rp->rcb_proto.sp_protocol;
- if (af == AF_INET)
- route_cb.ip_count--;
- else if (af == AF_IPX)
- route_cb.ipx_count--;
- else if (af == AF_NS)
- route_cb.ns_count--;
- else if (af == AF_ISO)
- route_cb.iso_count--;
- route_cb.any_count--;
- }
- s = splnet();
- error = raw_usrreq(so, req, m, nam, control);
- rp = sotorawcb(so);
- if (req == PRU_ATTACH && rp) {
- int af = rp->rcb_proto.sp_protocol;
- if (error) {
- free((caddr_t)rp, M_PCB);
- splx(s);
- return (error);
- }
- if (af == AF_INET)
- route_cb.ip_count++;
- else if (af == AF_IPX)
- route_cb.ipx_count++;
- else if (af == AF_NS)
- route_cb.ns_count++;
- else if (af == AF_ISO)
- route_cb.iso_count++;
- rp->rcb_faddr = &route_src;
- route_cb.any_count++;
- soisconnected(so);
- so->so_options |= SO_USELOOPBACK;
- }
- splx(s);
- return (error);
-}
-
-/*ARGSUSED*/
-static int
-route_output(m, so)
- register struct mbuf *m;
- struct socket *so;
-{
- register struct rt_msghdr *rtm = 0;
- register struct rtentry *rt = 0;
- struct rtentry *saved_nrt = 0;
- struct radix_node_head *rnh;
- struct rt_addrinfo info;
- int len, error = 0;
- struct ifnet *ifp = 0;
- struct ifaddr *ifa = 0;
-
-#define senderr(e) { error = e; goto flush;}
- if (m == 0 || ((m->m_len < sizeof(long)) &&
- (m = m_pullup(m, sizeof(long))) == 0))
- return (ENOBUFS);
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("route_output");
- len = m->m_pkthdr.len;
- if (len < sizeof(*rtm) ||
- len != mtod(m, struct rt_msghdr *)->rtm_msglen) {
- dst = 0;
- senderr(EINVAL);
- }
- R_Malloc(rtm, struct rt_msghdr *, len);
- if (rtm == 0) {
- dst = 0;
- senderr(ENOBUFS);
- }
- m_copydata(m, 0, len, (caddr_t)rtm);
- if (rtm->rtm_version != RTM_VERSION) {
- dst = 0;
- senderr(EPROTONOSUPPORT);
- }
- info.rti_addrs = rtm->rtm_addrs;
- if (rt_xaddrs((caddr_t)(rtm + 1), len + (caddr_t)rtm, &info)) {
- dst = 0;
- senderr(EINVAL);
- }
- if (dst == 0 || (dst->sa_family >= AF_MAX)
- || (gate != 0 && (gate->sa_family >= AF_MAX)))
- senderr(EINVAL);
- if (genmask) {
- struct radix_node *t;
- t = rn_addmask((caddr_t)genmask, 0, 1);
- if (t && Bcmp(genmask, t->rn_key, *(u_char *)genmask) == 0)
- genmask = (struct sockaddr *)(t->rn_key);
- else
- senderr(ENOBUFS);
- }
- switch (rtm->rtm_type) {
-
- case RTM_ADD:
- if (gate == 0)
- senderr(EINVAL);
- error = rtrequest(RTM_ADD, dst, gate, netmask,
- rtm->rtm_flags, &saved_nrt);
- if (error == 0 && saved_nrt) {
- rt_setmetrics(rtm->rtm_inits,
- &rtm->rtm_rmx, &saved_nrt->rt_rmx);
- saved_nrt->rt_rmx.rmx_locks &= ~(rtm->rtm_inits);
- saved_nrt->rt_rmx.rmx_locks |=
- (rtm->rtm_inits & rtm->rtm_rmx.rmx_locks);
- saved_nrt->rt_refcnt--;
- saved_nrt->rt_genmask = genmask;
- }
- break;
-
- case RTM_DELETE:
- error = rtrequest(RTM_DELETE, dst, gate, netmask,
- rtm->rtm_flags, &saved_nrt);
- if (error == 0) {
- if ((rt = saved_nrt))
- rt->rt_refcnt++;
- goto report;
- }
- break;
-
- case RTM_GET:
- case RTM_CHANGE:
- case RTM_LOCK:
- if ((rnh = rt_tables[dst->sa_family]) == 0) {
- senderr(EAFNOSUPPORT);
- } else if ((rt = (struct rtentry *)
- rnh->rnh_lookup(dst, netmask, rnh)))
- rt->rt_refcnt++;
- else
- senderr(ESRCH);
- switch(rtm->rtm_type) {
-
- case RTM_GET:
- report:
- dst = rt_key(rt);
- gate = rt->rt_gateway;
- netmask = rt_mask(rt);
- genmask = rt->rt_genmask;
- if (rtm->rtm_addrs & (RTA_IFP | RTA_IFA)) {
- ifp = rt->rt_ifp;
- if (ifp) {
- ifpaddr = ifp->if_addrlist->ifa_addr;
- ifaaddr = rt->rt_ifa->ifa_addr;
- rtm->rtm_index = ifp->if_index;
- } else {
- ifpaddr = 0;
- ifaaddr = 0;
- }
- }
- len = rt_msg2(rtm->rtm_type, &info, (caddr_t)0,
- (struct walkarg *)0);
- if (len > rtm->rtm_msglen) {
- struct rt_msghdr *new_rtm;
- R_Malloc(new_rtm, struct rt_msghdr *, len);
- if (new_rtm == 0)
- senderr(ENOBUFS);
- Bcopy(rtm, new_rtm, rtm->rtm_msglen);
- Free(rtm); rtm = new_rtm;
- }
- (void)rt_msg2(rtm->rtm_type, &info, (caddr_t)rtm,
- (struct walkarg *)0);
- rtm->rtm_flags = rt->rt_flags;
- rtm->rtm_rmx = rt->rt_rmx;
- rtm->rtm_addrs = info.rti_addrs;
- break;
-
- case RTM_CHANGE:
- if (gate && (error = rt_setgate(rt, rt_key(rt), gate)))
- senderr(error);
-
- /*
- * If they tried to change things but didn't specify
- * the required gateway, then just use the old one.
- * This can happen if the user tries to change the
- * flags on the default route without changing the
- * default gateway. Changing flags still doesn't work.
- */
- if ((rt->rt_flags & RTF_GATEWAY) && !gate)
- gate = rt->rt_gateway;
-
- /* new gateway could require new ifaddr, ifp;
- flags may also be different; ifp may be specified
- by ll sockaddr when protocol address is ambiguous */
- if (ifpaddr && (ifa = ifa_ifwithnet(ifpaddr)) &&
- (ifp = ifa->ifa_ifp) && (ifaaddr || gate))
- ifa = ifaof_ifpforaddr(ifaaddr ? ifaaddr : gate,
- ifp);
- else if ((ifaaddr && (ifa = ifa_ifwithaddr(ifaaddr))) ||
- (gate && (ifa = ifa_ifwithroute(rt->rt_flags,
- rt_key(rt), gate))))
- ifp = ifa->ifa_ifp;
- if (ifa) {
- register struct ifaddr *oifa = rt->rt_ifa;
- if (oifa != ifa) {
- if (oifa && oifa->ifa_rtrequest)
- oifa->ifa_rtrequest(RTM_DELETE,
- rt, gate);
- IFAFREE(rt->rt_ifa);
- rt->rt_ifa = ifa;
- ifa->ifa_refcnt++;
- rt->rt_ifp = ifp;
- }
- }
- rt_setmetrics(rtm->rtm_inits, &rtm->rtm_rmx,
- &rt->rt_rmx);
- if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest)
- rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, gate);
- if (genmask)
- rt->rt_genmask = genmask;
- /*
- * Fall into
- */
- case RTM_LOCK:
- rt->rt_rmx.rmx_locks &= ~(rtm->rtm_inits);
- rt->rt_rmx.rmx_locks |=
- (rtm->rtm_inits & rtm->rtm_rmx.rmx_locks);
- break;
- }
- break;
-
- default:
- senderr(EOPNOTSUPP);
- }
-
-flush:
- if (rtm) {
- if (error)
- rtm->rtm_errno = error;
- else
- rtm->rtm_flags |= RTF_DONE;
- }
- if (rt)
- rtfree(rt);
- {
- register struct rawcb *rp = 0;
- /*
- * Check to see if we don't want our own messages.
- */
- if ((so->so_options & SO_USELOOPBACK) == 0) {
- if (route_cb.any_count <= 1) {
- if (rtm)
- Free(rtm);
- m_freem(m);
- return (error);
- }
- /* There is another listener, so construct message */
- rp = sotorawcb(so);
- }
- if (rtm) {
- m_copyback(m, 0, rtm->rtm_msglen, (caddr_t)rtm);
- Free(rtm);
- }
- if (rp)
- rp->rcb_proto.sp_family = 0; /* Avoid us */
- if (dst)
- route_proto.sp_protocol = dst->sa_family;
- raw_input(m, &route_proto, &route_src, &route_dst);
- if (rp)
- rp->rcb_proto.sp_family = PF_ROUTE;
- }
- return (error);
-}
-
-static void
-rt_setmetrics(which, in, out)
- u_long which;
- register struct rt_metrics *in, *out;
-{
-#define metric(f, e) if (which & (f)) out->e = in->e;
- metric(RTV_RPIPE, rmx_recvpipe);
- metric(RTV_SPIPE, rmx_sendpipe);
- metric(RTV_SSTHRESH, rmx_ssthresh);
- metric(RTV_RTT, rmx_rtt);
- metric(RTV_RTTVAR, rmx_rttvar);
- metric(RTV_HOPCOUNT, rmx_hopcount);
- metric(RTV_MTU, rmx_mtu);
- metric(RTV_EXPIRE, rmx_expire);
-#undef metric
-}
-
-#define ROUNDUP(a) \
- ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
-#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
-
-
-/*
- * Extract the addresses of the passed sockaddrs.
- * Do a little sanity checking so as to avoid bad memory references.
- * This data is derived straight from userland.
- */
-static int
-rt_xaddrs(cp, cplim, rtinfo)
- register caddr_t cp, cplim;
- register struct rt_addrinfo *rtinfo;
-{
- register struct sockaddr *sa;
- register int i;
-
- bzero(rtinfo->rti_info, sizeof(rtinfo->rti_info));
- for (i = 0; (i < RTAX_MAX) && (cp < cplim); i++) {
- if ((rtinfo->rti_addrs & (1 << i)) == 0)
- continue;
- sa = (struct sockaddr *)cp;
- /*
- * It won't fit.
- */
- if ( (cp + sa->sa_len) > cplim ) {
- return (EINVAL);
- }
-
- /*
- * there are no more.. quit now
- * If there are more bits, they are in error.
- * I've seen this. route(1) can evidently generate these.
- * This causes kernel to core dump.
- * for compatibility, If we see this, point to a safe address.
- */
- if (sa->sa_len == 0) {
- rtinfo->rti_info[i] = &sa_zero;
- return (0); /* should be EINVAL but for compat */
- }
-
- /* accept it */
- rtinfo->rti_info[i] = sa;
- ADVANCE(cp, sa);
- }
- return (0);
-}
-
-static struct mbuf *
-rt_msg1(type, rtinfo)
- int type;
- register struct rt_addrinfo *rtinfo;
-{
- register struct rt_msghdr *rtm;
- register struct mbuf *m;
- register int i;
- register struct sockaddr *sa;
- int len, dlen;
-
- m = m_gethdr(M_DONTWAIT, MT_DATA);
- if (m == 0)
- return (m);
- switch (type) {
-
- case RTM_DELADDR:
- case RTM_NEWADDR:
- len = sizeof(struct ifa_msghdr);
- break;
-
- case RTM_IFINFO:
- len = sizeof(struct if_msghdr);
- break;
-
- default:
- len = sizeof(struct rt_msghdr);
- }
- if (len > MHLEN)
- panic("rt_msg1");
- m->m_pkthdr.len = m->m_len = len;
- m->m_pkthdr.rcvif = 0;
- rtm = mtod(m, struct rt_msghdr *);
- bzero((caddr_t)rtm, len);
- for (i = 0; i < RTAX_MAX; i++) {
- if ((sa = rtinfo->rti_info[i]) == NULL)
- continue;
- rtinfo->rti_addrs |= (1 << i);
- dlen = ROUNDUP(sa->sa_len);
- m_copyback(m, len, dlen, (caddr_t)sa);
- len += dlen;
- }
- if (m->m_pkthdr.len != len) {
- m_freem(m);
- return (NULL);
- }
- rtm->rtm_msglen = len;
- rtm->rtm_version = RTM_VERSION;
- rtm->rtm_type = type;
- return (m);
-}
-
-static int
-rt_msg2(type, rtinfo, cp, w)
- int type;
- register struct rt_addrinfo *rtinfo;
- caddr_t cp;
- struct walkarg *w;
-{
- register int i;
- int len, dlen, second_time = 0;
- caddr_t cp0;
-
- rtinfo->rti_addrs = 0;
-again:
- switch (type) {
-
- case RTM_DELADDR:
- case RTM_NEWADDR:
- len = sizeof(struct ifa_msghdr);
- break;
-
- case RTM_IFINFO:
- len = sizeof(struct if_msghdr);
- break;
-
- default:
- len = sizeof(struct rt_msghdr);
- }
- cp0 = cp;
- if (cp0)
- cp += len;
- for (i = 0; i < RTAX_MAX; i++) {
- register struct sockaddr *sa;
-
- if ((sa = rtinfo->rti_info[i]) == 0)
- continue;
- rtinfo->rti_addrs |= (1 << i);
- dlen = ROUNDUP(sa->sa_len);
- if (cp) {
- bcopy((caddr_t)sa, cp, (unsigned)dlen);
- cp += dlen;
- }
- len += dlen;
- }
- if (cp == 0 && w != NULL && !second_time) {
- register struct walkarg *rw = w;
-
- if (rw->w_req) {
- if (rw->w_tmemsize < len) {
- if (rw->w_tmem)
- free(rw->w_tmem, M_RTABLE);
- rw->w_tmem = (caddr_t)
- malloc(len, M_RTABLE, M_NOWAIT);
- if (rw->w_tmem)
- rw->w_tmemsize = len;
- }
- if (rw->w_tmem) {
- cp = rw->w_tmem;
- second_time = 1;
- goto again;
- }
- }
- }
- if (cp) {
- register struct rt_msghdr *rtm = (struct rt_msghdr *)cp0;
-
- rtm->rtm_version = RTM_VERSION;
- rtm->rtm_type = type;
- rtm->rtm_msglen = len;
- }
- return (len);
-}
-
-/*
- * This routine is called to generate a message from the routing
- * socket indicating that a redirect has occured, a routing lookup
- * has failed, or that a protocol has detected timeouts to a particular
- * destination.
- */
-void
-rt_missmsg(type, rtinfo, flags, error)
- int type, flags, error;
- register struct rt_addrinfo *rtinfo;
-{
- register struct rt_msghdr *rtm;
- register struct mbuf *m;
- struct sockaddr *sa = rtinfo->rti_info[RTAX_DST];
-
- if (route_cb.any_count == 0)
- return;
- m = rt_msg1(type, rtinfo);
- if (m == 0)
- return;
- rtm = mtod(m, struct rt_msghdr *);
- rtm->rtm_flags = RTF_DONE | flags;
- rtm->rtm_errno = error;
- rtm->rtm_addrs = rtinfo->rti_addrs;
- route_proto.sp_protocol = sa ? sa->sa_family : 0;
- raw_input(m, &route_proto, &route_src, &route_dst);
-}
-
-/*
- * This routine is called to generate a message from the routing
- * socket indicating that the status of a network interface has changed.
- */
-void
-rt_ifmsg(ifp)
- register struct ifnet *ifp;
-{
- register struct if_msghdr *ifm;
- struct mbuf *m;
- struct rt_addrinfo info;
-
- if (route_cb.any_count == 0)
- return;
- bzero((caddr_t)&info, sizeof(info));
- m = rt_msg1(RTM_IFINFO, &info);
- if (m == 0)
- return;
- ifm = mtod(m, struct if_msghdr *);
- ifm->ifm_index = ifp->if_index;
- ifm->ifm_flags = (u_short)ifp->if_flags;
- ifm->ifm_data = ifp->if_data;
- ifm->ifm_addrs = 0;
- route_proto.sp_protocol = 0;
- raw_input(m, &route_proto, &route_src, &route_dst);
-}
-
-/*
- * This is called to generate messages from the routing socket
- * indicating a network interface has had addresses associated with it.
- * if we ever reverse the logic and replace messages TO the routing
- * socket indicate a request to configure interfaces, then it will
- * be unnecessary as the routing socket will automatically generate
- * copies of it.
- */
-void
-rt_newaddrmsg(cmd, ifa, error, rt)
- int cmd, error;
- register struct ifaddr *ifa;
- register struct rtentry *rt;
-{
- struct rt_addrinfo info;
- struct sockaddr *sa = 0;
- int pass;
- struct mbuf *m = 0;
- struct ifnet *ifp = ifa->ifa_ifp;
-
- if (route_cb.any_count == 0)
- return;
- for (pass = 1; pass < 3; pass++) {
- bzero((caddr_t)&info, sizeof(info));
- if ((cmd == RTM_ADD && pass == 1) ||
- (cmd == RTM_DELETE && pass == 2)) {
- register struct ifa_msghdr *ifam;
- int ncmd = cmd == RTM_ADD ? RTM_NEWADDR : RTM_DELADDR;
-
- ifaaddr = sa = ifa->ifa_addr;
- ifpaddr = ifp->if_addrlist->ifa_addr;
- netmask = ifa->ifa_netmask;
- brdaddr = ifa->ifa_dstaddr;
- if ((m = rt_msg1(ncmd, &info)) == NULL)
- continue;
- ifam = mtod(m, struct ifa_msghdr *);
- ifam->ifam_index = ifp->if_index;
- ifam->ifam_metric = ifa->ifa_metric;
- ifam->ifam_flags = ifa->ifa_flags;
- ifam->ifam_addrs = info.rti_addrs;
- }
- if ((cmd == RTM_ADD && pass == 2) ||
- (cmd == RTM_DELETE && pass == 1)) {
- register struct rt_msghdr *rtm;
-
- if (rt == 0)
- continue;
- netmask = rt_mask(rt);
- dst = sa = rt_key(rt);
- gate = rt->rt_gateway;
- if ((m = rt_msg1(cmd, &info)) == NULL)
- continue;
- rtm = mtod(m, struct rt_msghdr *);
- rtm->rtm_index = ifp->if_index;
- rtm->rtm_flags |= rt->rt_flags;
- rtm->rtm_errno = error;
- rtm->rtm_addrs = info.rti_addrs;
- }
- route_proto.sp_protocol = sa ? sa->sa_family : 0;
- raw_input(m, &route_proto, &route_src, &route_dst);
- }
-}
-
-
-/*
- * This is used in dumping the kernel table via sysctl().
- */
-int
-sysctl_dumpentry(rn, vw)
- struct radix_node *rn;
- void *vw;
-{
- register struct walkarg *w = vw;
- register struct rtentry *rt = (struct rtentry *)rn;
- int error = 0, size;
- struct rt_addrinfo info;
-
- if (w->w_op == NET_RT_FLAGS && !(rt->rt_flags & w->w_arg))
- return 0;
- bzero((caddr_t)&info, sizeof(info));
- dst = rt_key(rt);
- gate = rt->rt_gateway;
- netmask = rt_mask(rt);
- genmask = rt->rt_genmask;
- size = rt_msg2(RTM_GET, &info, 0, w);
- if (w->w_req && w->w_tmem) {
- register struct rt_msghdr *rtm = (struct rt_msghdr *)w->w_tmem;
-
- rtm->rtm_flags = rt->rt_flags;
- rtm->rtm_use = rt->rt_use;
- rtm->rtm_rmx = rt->rt_rmx;
- rtm->rtm_index = rt->rt_ifp->if_index;
- rtm->rtm_errno = rtm->rtm_pid = rtm->rtm_seq = 0;
- rtm->rtm_addrs = info.rti_addrs;
- error = 0;
- return (error);
- }
- return (error);
-}
-
-int
-sysctl_iflist(af, w)
- int af;
- register struct walkarg *w;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
- struct rt_addrinfo info;
- int len, error = 0;
-
- bzero((caddr_t)&info, sizeof(info));
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- if (w->w_arg && w->w_arg != ifp->if_index)
- continue;
- ifa = ifp->if_addrlist;
- ifpaddr = ifa->ifa_addr;
- len = rt_msg2(RTM_IFINFO, &info, (caddr_t)0, w);
- ifpaddr = 0;
- if (w->w_req && w->w_tmem) {
- register struct if_msghdr *ifm;
-
- ifm = (struct if_msghdr *)w->w_tmem;
- ifm->ifm_index = ifp->if_index;
- ifm->ifm_flags = (u_short)ifp->if_flags;
- ifm->ifm_data = ifp->if_data;
- ifm->ifm_addrs = info.rti_addrs;
- error =0;
- if (error)
- return (error);
- }
- while ((ifa = ifa->ifa_next) != 0) {
- if (af && af != ifa->ifa_addr->sa_family)
- continue;
- ifaaddr = ifa->ifa_addr;
- netmask = ifa->ifa_netmask;
- brdaddr = ifa->ifa_dstaddr;
- len = rt_msg2(RTM_NEWADDR, &info, 0, w);
- if (w->w_req && w->w_tmem) {
- register struct ifa_msghdr *ifam;
-
- ifam = (struct ifa_msghdr *)w->w_tmem;
- ifam->ifam_index = ifa->ifa_ifp->if_index;
- ifam->ifam_flags = ifa->ifa_flags;
- ifam->ifam_metric = ifa->ifa_metric;
- ifam->ifam_addrs = info.rti_addrs;
- error = 0;
- if (error)
- return (error);
- }
- }
- ifaaddr = netmask = brdaddr = 0;
- }
- return (0);
-}
-
-static int
-sysctl_rtsock SYSCTL_HANDLER_ARGS
-{
- int *name = (int *)arg1;
- u_int namelen = arg2;
- register struct radix_node_head *rnh;
- int i, s, error = EINVAL;
- u_char af;
- struct walkarg w;
-
- name ++;
- namelen--;
- if (req->newptr)
- return (EPERM);
- if (namelen != 3)
- return (EINVAL);
- af = name[0];
- Bzero(&w, sizeof(w));
- w.w_op = name[1];
- w.w_arg = name[2];
- w.w_req = req;
-
- s = splnet();
- switch (w.w_op) {
-
- case NET_RT_DUMP:
- case NET_RT_FLAGS:
- for (i = 1; i <= AF_MAX; i++)
- if ((rnh = rt_tables[i]) && (af == 0 || af == i) &&
- (error = rnh->rnh_walktree(rnh,
- sysctl_dumpentry, &w)))
- break;
- break;
-
- case NET_RT_IFLIST:
- error = sysctl_iflist(af, &w);
- }
- splx(s);
- if (w.w_tmem)
- free(w.w_tmem, M_RTABLE);
- return (error);
-}
-
-SYSCTL_NODE(_net, PF_ROUTE, routetable, CTLFLAG_RD, sysctl_rtsock,"");
-
-/*
- * Definitions of protocols supported in the ROUTE domain.
- */
-
-extern struct domain routedomain; /* or at least forward */
-
-static struct protosw routesw[] = {
-{ SOCK_RAW, &routedomain, 0, PR_ATOMIC|PR_ADDR,
- 0, route_output, raw_ctlinput, 0,
- route_usrreq,
- raw_init
-}
-};
-
-struct domain routedomain =
- { PF_ROUTE, "route", route_init, 0, 0,
- routesw, &routesw[sizeof(routesw)/sizeof(routesw[0])] };
-
-DOMAIN_SET(route);
diff --git a/c/src/libnetworking/netdb.h b/c/src/libnetworking/netdb.h
deleted file mode 100644
index ec274f851f..0000000000
--- a/c/src/libnetworking/netdb.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*-
- * Copyright (c) 1980, 1983, 1988, 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.
- *
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-/*
- * @(#)netdb.h 8.1 (Berkeley) 6/2/93
- * From: Id: netdb.h,v 8.9 1996/11/19 08:39:29 vixie Exp $
- * $Id$
- */
-
-#ifndef _NETDB_H_
-#define _NETDB_H_
-
-#include <sys/cdefs.h>
-
-#ifndef _PATH_HEQUIV
-# define _PATH_HEQUIV "/etc/hosts.equiv"
-#endif
-#define _PATH_HOSTS "/etc/hosts"
-#define _PATH_NETWORKS "/etc/networks"
-#define _PATH_PROTOCOLS "/etc/protocols"
-#define _PATH_SERVICES "/etc/services"
-
-extern int h_errno;
-
-/*
- * Structures returned by network data base library. All addresses are
- * supplied in host order, and returned in network order (suitable for
- * use in system calls).
- */
-struct hostent {
- char *h_name; /* official name of host */
- char **h_aliases; /* alias list */
- int h_addrtype; /* host address type */
- int h_length; /* length of address */
- char **h_addr_list; /* list of addresses from name server */
-#define h_addr h_addr_list[0] /* address, for backward compatibility */
-};
-
-/*
- * Assumption here is that a network number
- * fits in an unsigned long -- probably a poor one.
- */
-struct netent {
- char *n_name; /* official name of net */
- char **n_aliases; /* alias list */
- int n_addrtype; /* net address type */
- unsigned long n_net; /* network # */
-};
-
-struct servent {
- char *s_name; /* official service name */
- char **s_aliases; /* alias list */
- int s_port; /* port # */
- char *s_proto; /* protocol to use */
-};
-
-struct protoent {
- char *p_name; /* official protocol name */
- char **p_aliases; /* alias list */
- int p_proto; /* protocol # */
-};
-
-/*
- * Error return codes from gethostbyname() and gethostbyaddr()
- * (left in extern int h_errno).
- */
-
-#define NETDB_INTERNAL -1 /* see errno */
-#define NETDB_SUCCESS 0 /* no problem */
-#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
-#define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */
-#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
-#define NO_DATA 4 /* Valid name, no data record of requested type */
-#define NO_ADDRESS NO_DATA /* no address, look for MX record */
-
-__BEGIN_DECLS
-void endhostent __P((void));
-void endnetent __P((void));
-void endprotoent __P((void));
-void endservent __P((void));
-struct hostent *gethostbyaddr __P((const char *, int, int));
-struct hostent *gethostbyname __P((const char *));
-struct hostent *gethostbyname2 __P((const char *, int));
-struct hostent *gethostent __P((void));
-struct netent *getnetbyaddr __P((unsigned long, int));
-struct netent *getnetbyname __P((const char *));
-struct netent *getnetent __P((void));
-struct protoent *getprotobyname __P((const char *));
-struct protoent *getprotobynumber __P((int));
-struct protoent *getprotoent __P((void));
-struct servent *getservbyname __P((const char *, const char *));
-struct servent *getservbyport __P((int, const char *));
-struct servent *getservent __P((void));
-void herror __P((const char *));
-__const char *hstrerror __P((int));
-void sethostent __P((int));
-/* void sethostfile __P((const char *)); */
-void setnetent __P((int));
-void setprotoent __P((int));
-void setservent __P((int));
-
-/*
- * PRIVATE functions specific to the FreeBSD implementation
- */
-
-/* DO NOT USE THESE, THEY ARE SUBJECT TO CHANGE AND ARE NOT PORTABLE!!! */
-void _sethosthtent __P((int));
-void _endhosthtent __P((void));
-void _sethostdnsent __P((int));
-void _endhostdnsent __P((void));
-void _setnethtent __P((int));
-void _endnethtent __P((void));
-void _setnetdnsent __P((int));
-void _endnetdnsent __P((void));
-struct hostent * _gethostbyhtname __P((const char *, int));
-struct hostent * _gethostbydnsname __P((const char *, int));
-struct hostent * _gethostbynisname __P((const char *, int));
-struct hostent * _gethostbyhtaddr __P((const char *, int, int));
-struct hostent * _gethostbydnsaddr __P((const char *, int, int));
-struct hostent * _gethostbynisaddr __P((const char *, int, int));
-struct netent * _getnetbyhtname __P((const char *));
-struct netent * _getnetbydnsname __P((const char *));
-struct netent * _getnetbynisname __P((const char *));
-struct netent * _getnetbyhtaddr __P((unsigned long, int));
-struct netent * _getnetbydnsaddr __P((unsigned long, int));
-struct netent * _getnetbynisaddr __P((unsigned long, int));
-void _map_v4v6_address __P((const char *src, char *dst));
-void _map_v4v6_hostent __P((struct hostent *hp, char **bp, int *len));
-__END_DECLS
-
-#endif /* !_NETDB_H_ */
diff --git a/c/src/libnetworking/netinet/Makefile.in b/c/src/libnetworking/netinet/Makefile.in
deleted file mode 100644
index 94a8f2f0b8..0000000000
--- a/c/src/libnetworking/netinet/Makefile.in
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=lib.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES=if_ether \
- igmp \
- in in_cksum in_pcb in_proto in_rmx \
- ip_divert ip_fw ip_icmp ip_input ip_mroute ip_output \
- raw_ip \
- tcp_debug tcp_input tcp_output tcp_subr tcp_timer tcp_usrreq \
- udp_usrreq
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \
- -DDIAGNOSTIC -DBOOTP_COMPAT
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
diff --git a/c/src/libnetworking/netinet/icmp_var.h b/c/src/libnetworking/netinet/icmp_var.h
deleted file mode 100644
index 7657f31acf..0000000000
--- a/c/src/libnetworking/netinet/icmp_var.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)icmp_var.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_ICMP_VAR_H_
-#define _NETINET_ICMP_VAR_H_
-
-/*
- * Variables related to this implementation
- * of the internet control message protocol.
- */
-struct icmpstat {
-/* statistics related to icmp packets generated */
- u_long icps_error; /* # of calls to icmp_error */
- u_long icps_oldshort; /* no error 'cuz old ip too short */
- u_long icps_oldicmp; /* no error 'cuz old was icmp */
- u_long icps_outhist[ICMP_MAXTYPE + 1];
-/* statistics related to input messages processed */
- u_long icps_badcode; /* icmp_code out of range */
- u_long icps_tooshort; /* packet < ICMP_MINLEN */
- u_long icps_checksum; /* bad checksum */
- u_long icps_badlen; /* calculated bound mismatch */
- u_long icps_reflect; /* number of responses */
- u_long icps_inhist[ICMP_MAXTYPE + 1];
- u_long icps_bmcastecho; /* b/mcast echo requests dropped */
- u_long icps_bmcasttstamp; /* b/mcast tstamp requests dropped */
-};
-
-/*
- * Names for ICMP sysctl objects
- */
-#define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */
-#define ICMPCTL_STATS 2 /* statistics (read-only) */
-#define ICMPCTL_MAXID 3
-
-#define ICMPCTL_NAMES { \
- { 0, 0 }, \
- { "maskrepl", CTLTYPE_INT }, \
- { "stats", CTLTYPE_STRUCT }, \
-}
-
-#ifdef KERNEL
-extern struct icmpstat icmpstat;
-#endif
-
-#endif
diff --git a/c/src/libnetworking/netinet/if_ether.c b/c/src/libnetworking/netinet/if_ether.c
deleted file mode 100644
index 985ce6e7d9..0000000000
--- a/c/src/libnetworking/netinet/if_ether.c
+++ /dev/null
@@ -1,638 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)if_ether.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-/*
- * Ethernet address resolution protocol.
- * TODO:
- * add "inuse/lock" bit (or ref. count) along with valid bit
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/socket.h>
-#include <sys/syslog.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/route.h>
-#include <net/netisr.h>
-
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/if_ether.h>
-
-#define SIN(s) ((struct sockaddr_in *)s)
-#define SDL(s) ((struct sockaddr_dl *)s)
-
-SYSCTL_NODE(_net_link_ether, PF_INET, inet, CTLFLAG_RW, 0, "");
-
-/* timer values */
-static int arpt_prune = (5*60*1); /* walk list every 5 minutes */
-static int arpt_keep = (20*60); /* once resolved, good for 20 more minutes */
-static int arpt_down = 20; /* once declared down, don't send for 20 sec */
-
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, prune_intvl, CTLFLAG_RW,
- &arpt_prune, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_RW,
- &arpt_keep, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, host_down_time, CTLFLAG_RW,
- &arpt_down, 0, "");
-
-#define rt_expire rt_rmx.rmx_expire
-
-struct llinfo_arp {
- LIST_ENTRY(llinfo_arp) la_le;
- struct rtentry *la_rt;
- struct mbuf *la_hold; /* last packet until resolved/timeout */
- long la_asked; /* last time we QUERIED for this addr */
-#define la_timer la_rt->rt_rmx.rmx_expire /* deletion time in seconds */
-};
-
-static LIST_HEAD(, llinfo_arp) llinfo_arp;
-
-struct ifqueue arpintrq = {0, 0, 0, 50};
-static int arp_inuse, arp_allocated;
-
-static int arp_maxtries = 5;
-static int useloopback = 1; /* use loopback interface for local traffic */
-static int arp_proxyall = 0;
-
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, maxtries, CTLFLAG_RW,
- &arp_maxtries, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, useloopback, CTLFLAG_RW,
- &useloopback, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, proxyall, CTLFLAG_RW,
- &arp_proxyall, 0, "");
-
-static void arp_rtrequest __P((int, struct rtentry *, struct sockaddr *));
-static void arprequest __P((struct arpcom *, u_long *, u_long *, u_char *));
-void arpintr __P((void));
-static void arptfree __P((struct llinfo_arp *));
-static void arptimer __P((void *));
-static struct llinfo_arp
- *arplookup __P((u_long, int, int));
-static void in_arpinput __P((struct mbuf *));
-
-/*
- * Timeout routine. Age arp_tab entries periodically.
- */
-/* ARGSUSED */
-static void
-arptimer(ignored_arg)
- void *ignored_arg;
-{
- int s = splnet();
- register struct llinfo_arp *la = llinfo_arp.lh_first;
- struct llinfo_arp *ola;
-
- timeout(arptimer, (caddr_t)0, arpt_prune * hz);
- while ((ola = la) != 0) {
- register struct rtentry *rt = la->la_rt;
- la = la->la_le.le_next;
- if (rt->rt_expire && rt->rt_expire <= rtems_bsdnet_seconds_since_boot())
- arptfree(ola); /* timer has expired, clear */
- }
- splx(s);
-}
-
-/*
- * Parallel to llc_rtrequest.
- */
-static void
-arp_rtrequest(req, rt, sa)
- int req;
- register struct rtentry *rt;
- struct sockaddr *sa;
-{
- register struct sockaddr *gate = rt->rt_gateway;
- register struct llinfo_arp *la = (struct llinfo_arp *)rt->rt_llinfo;
- static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK};
- static int arpinit_done;
-
- if (!arpinit_done) {
- arpinit_done = 1;
- LIST_INIT(&llinfo_arp);
- timeout(arptimer, (caddr_t)0, hz);
- }
- if (rt->rt_flags & RTF_GATEWAY)
- return;
- switch (req) {
-
- case RTM_ADD:
- /*
- * XXX: If this is a manually added route to interface
- * such as older version of routed or gated might provide,
- * restore cloning bit.
- */
- if ((rt->rt_flags & RTF_HOST) == 0 &&
- SIN(rt_mask(rt))->sin_addr.s_addr != 0xffffffff)
- rt->rt_flags |= RTF_CLONING;
- if (rt->rt_flags & RTF_CLONING) {
- /*
- * Case 1: This route should come from a route to iface.
- */
- rt_setgate(rt, rt_key(rt),
- (struct sockaddr *)&null_sdl);
- gate = rt->rt_gateway;
- SDL(gate)->sdl_type = rt->rt_ifp->if_type;
- SDL(gate)->sdl_index = rt->rt_ifp->if_index;
- rt->rt_expire = rtems_bsdnet_seconds_since_boot();
- break;
- }
- /* Announce a new entry if requested. */
- if (rt->rt_flags & RTF_ANNOUNCE)
- arprequest((struct arpcom *)rt->rt_ifp,
- &SIN(rt_key(rt))->sin_addr.s_addr,
- &SIN(rt_key(rt))->sin_addr.s_addr,
- (u_char *)LLADDR(SDL(gate)));
- /*FALLTHROUGH*/
- case RTM_RESOLVE:
- if (gate->sa_family != AF_LINK ||
- gate->sa_len < sizeof(null_sdl)) {
- log(LOG_DEBUG, "arp_rtrequest: bad gateway value\n");
- break;
- }
- SDL(gate)->sdl_type = rt->rt_ifp->if_type;
- SDL(gate)->sdl_index = rt->rt_ifp->if_index;
- if (la != 0)
- break; /* This happens on a route change */
- /*
- * Case 2: This route may come from cloning, or a manual route
- * add with a LL address.
- */
- R_Malloc(la, struct llinfo_arp *, sizeof(*la));
- rt->rt_llinfo = (caddr_t)la;
- if (la == 0) {
- log(LOG_DEBUG, "arp_rtrequest: malloc failed\n");
- break;
- }
- arp_inuse++, arp_allocated++;
- Bzero(la, sizeof(*la));
- la->la_rt = rt;
- rt->rt_flags |= RTF_LLINFO;
- LIST_INSERT_HEAD(&llinfo_arp, la, la_le);
-
- /*
- * This keeps the multicast addresses from showing up
- * in `arp -a' listings as unresolved. It's not actually
- * functional. Then the same for broadcast.
- */
- if (IN_MULTICAST(ntohl(SIN(rt_key(rt))->sin_addr.s_addr))) {
- ETHER_MAP_IP_MULTICAST(&SIN(rt_key(rt))->sin_addr,
- LLADDR(SDL(gate)));
- SDL(gate)->sdl_alen = 6;
- rt->rt_expire = 0;
- }
- if (in_broadcast(SIN(rt_key(rt))->sin_addr, rt->rt_ifp)) {
- memcpy(LLADDR(SDL(gate)), etherbroadcastaddr, 6);
- SDL(gate)->sdl_alen = 6;
- rt->rt_expire = 0;
- }
-
- if (SIN(rt_key(rt))->sin_addr.s_addr ==
- (IA_SIN(rt->rt_ifa))->sin_addr.s_addr) {
- /*
- * This test used to be
- * if (loif.if_flags & IFF_UP)
- * It allowed local traffic to be forced
- * through the hardware by configuring the loopback down.
- * However, it causes problems during network configuration
- * for boards that can't receive packets they send.
- * It is now necessary to clear "useloopback" and remove
- * the route to force traffic out to the hardware.
- */
- rt->rt_expire = 0;
- Bcopy(((struct arpcom *)rt->rt_ifp)->ac_enaddr,
- LLADDR(SDL(gate)), SDL(gate)->sdl_alen = 6);
- if (useloopback)
- rt->rt_ifp = loif;
-
- }
- break;
-
- case RTM_DELETE:
- if (la == 0)
- break;
- arp_inuse--;
- LIST_REMOVE(la, la_le);
- rt->rt_llinfo = 0;
- rt->rt_flags &= ~RTF_LLINFO;
- if (la->la_hold)
- m_freem(la->la_hold);
- Free((caddr_t)la);
- }
-}
-
-/*
- * Broadcast an ARP request. Caller specifies:
- * - arp header source ip address
- * - arp header target ip address
- * - arp header source ethernet address
- */
-static void
-arprequest(ac, sip, tip, enaddr)
- register struct arpcom *ac;
- register u_long *sip, *tip;
- register u_char *enaddr;
-{
- register struct mbuf *m;
- register struct ether_header *eh;
- register struct ether_arp *ea;
- struct sockaddr sa;
-
- if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL)
- return;
- m->m_len = sizeof(*ea);
- m->m_pkthdr.len = sizeof(*ea);
- MH_ALIGN(m, sizeof(*ea));
- ea = mtod(m, struct ether_arp *);
- eh = (struct ether_header *)sa.sa_data;
- bzero((caddr_t)ea, sizeof (*ea));
- (void)memcpy(eh->ether_dhost, etherbroadcastaddr, sizeof(eh->ether_dhost));
- eh->ether_type = htons(ETHERTYPE_ARP); /* if_output will not swap */
- ea->arp_hrd = htons(ARPHRD_ETHER);
- ea->arp_pro = htons(ETHERTYPE_IP);
- ea->arp_hln = sizeof(ea->arp_sha); /* hardware address length */
- ea->arp_pln = sizeof(ea->arp_spa); /* protocol address length */
- ea->arp_op = htons(ARPOP_REQUEST);
- (void)memcpy(ea->arp_sha, enaddr, sizeof(ea->arp_sha));
- (void)memcpy(ea->arp_spa, sip, sizeof(ea->arp_spa));
- (void)memcpy(ea->arp_tpa, tip, sizeof(ea->arp_tpa));
- sa.sa_family = AF_UNSPEC;
- sa.sa_len = sizeof(sa);
- (*ac->ac_if.if_output)(&ac->ac_if, m, &sa, (struct rtentry *)0);
-}
-
-/*
- * Resolve an IP address into an ethernet address. If success,
- * desten is filled in. If there is no entry in arptab,
- * set one up and broadcast a request for the IP address.
- * Hold onto this mbuf and resend it once the address
- * is finally resolved. A return value of 1 indicates
- * that desten has been filled in and the packet should be sent
- * normally; a 0 return indicates that the packet has been
- * taken over here, either now or for later transmission.
- */
-int
-arpresolve(ac, rt, m, dst, desten, rt0)
- register struct arpcom *ac;
- register struct rtentry *rt;
- struct mbuf *m;
- register struct sockaddr *dst;
- register u_char *desten;
- struct rtentry *rt0;
-{
- register struct llinfo_arp *la;
- struct sockaddr_dl *sdl;
-
- if (m->m_flags & M_BCAST) { /* broadcast */
- (void)memcpy(desten, etherbroadcastaddr, sizeof(etherbroadcastaddr));
- return (1);
- }
- if (m->m_flags & M_MCAST) { /* multicast */
- ETHER_MAP_IP_MULTICAST(&SIN(dst)->sin_addr, desten);
- return(1);
- }
- if (rt)
- la = (struct llinfo_arp *)rt->rt_llinfo;
- else {
- la = arplookup(SIN(dst)->sin_addr.s_addr, 1, 0);
- if (la)
- rt = la->la_rt;
- }
- if (la == 0 || rt == 0) {
- log(LOG_DEBUG, "arpresolve: can't allocate llinfo for %s\n",
- inet_ntoa(SIN(dst)->sin_addr));
- m_freem(m);
- return (0);
- }
- sdl = SDL(rt->rt_gateway);
- /*
- * Check the address family and length is valid, the address
- * is resolved; otherwise, try to resolve.
- */
- if ((rt->rt_expire == 0 || rt->rt_expire > rtems_bsdnet_seconds_since_boot()) &&
- sdl->sdl_family == AF_LINK && sdl->sdl_alen != 0) {
- bcopy(LLADDR(sdl), desten, sdl->sdl_alen);
- return 1;
- }
- /*
- * There is an arptab entry, but no ethernet address
- * response yet. Replace the held mbuf with this
- * latest one.
- */
- if (la->la_hold)
- m_freem(la->la_hold);
- la->la_hold = m;
- if (rt->rt_expire) {
- rt->rt_flags &= ~RTF_REJECT;
- if (la->la_asked == 0 || rt->rt_expire != rtems_bsdnet_seconds_since_boot()) {
- rt->rt_expire = rtems_bsdnet_seconds_since_boot();
- if (la->la_asked++ < arp_maxtries)
- arprequest(ac,
- &(SIN(rt->rt_ifa->ifa_addr)->sin_addr.s_addr),
- &(SIN(dst)->sin_addr.s_addr),
- ac->ac_enaddr);
- else {
- rt->rt_flags |= RTF_REJECT;
- rt->rt_expire += arpt_down;
- la->la_asked = 0;
- }
-
- }
- }
- return (0);
-}
-
-/*
- * Common length and type checks are done here,
- * then the protocol-specific routine is called.
- */
-void
-arpintr(void)
-{
- register struct mbuf *m;
- register struct arphdr *ar;
- int s;
-
- while (arpintrq.ifq_head) {
- s = splimp();
- IF_DEQUEUE(&arpintrq, m);
- splx(s);
- if (m == 0 || (m->m_flags & M_PKTHDR) == 0)
- panic("arpintr");
- if (m->m_len >= sizeof(struct arphdr) &&
- (ar = mtod(m, struct arphdr *)) &&
- ntohs(ar->ar_hrd) == ARPHRD_ETHER &&
- m->m_len >=
- sizeof(struct arphdr) + 2 * ar->ar_hln + 2 * ar->ar_pln)
-
- switch (ntohs(ar->ar_pro)) {
-
- case ETHERTYPE_IP:
- in_arpinput(m);
- continue;
- }
- m_freem(m);
- }
-}
-
-NETISR_SET(NETISR_ARP, arpintr);
-
-/*
- * ARP for Internet protocols on 10 Mb/s Ethernet.
- * Algorithm is that given in RFC 826.
- * In addition, a sanity check is performed on the sender
- * protocol address, to catch impersonators.
- * We no longer handle negotiations for use of trailer protocol:
- * Formerly, ARP replied for protocol type ETHERTYPE_TRAIL sent
- * along with IP replies if we wanted trailers sent to us,
- * and also sent them in response to IP replies.
- * This allowed either end to announce the desire to receive
- * trailer packets.
- * We no longer reply to requests for ETHERTYPE_TRAIL protocol either,
- * but formerly didn't normally send requests.
- */
-static void
-in_arpinput(m)
- struct mbuf *m;
-{
- register struct ether_arp *ea;
- register struct arpcom *ac = (struct arpcom *)m->m_pkthdr.rcvif;
- struct ether_header *eh;
- register struct llinfo_arp *la = 0;
- register struct rtentry *rt;
- struct in_ifaddr *ia, *maybe_ia = 0;
- struct sockaddr_dl *sdl;
- struct sockaddr sa;
- struct in_addr isaddr, itaddr, myaddr;
- int op;
-
- ea = mtod(m, struct ether_arp *);
- op = ntohs(ea->arp_op);
- (void)memcpy(&isaddr, ea->arp_spa, sizeof (isaddr));
- (void)memcpy(&itaddr, ea->arp_tpa, sizeof (itaddr));
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if (ia->ia_ifp == &ac->ac_if) {
- maybe_ia = ia;
- if ((itaddr.s_addr == ia->ia_addr.sin_addr.s_addr) ||
- (isaddr.s_addr == ia->ia_addr.sin_addr.s_addr))
- break;
- }
- if (maybe_ia == 0) {
- m_freem(m);
- return;
- }
- myaddr = ia ? ia->ia_addr.sin_addr : maybe_ia->ia_addr.sin_addr;
- if (!bcmp((caddr_t)ea->arp_sha, (caddr_t)ac->ac_enaddr,
- sizeof (ea->arp_sha))) {
- m_freem(m); /* it's from me, ignore it. */
- return;
- }
- if (!bcmp((caddr_t)ea->arp_sha, (caddr_t)etherbroadcastaddr,
- sizeof (ea->arp_sha))) {
- log(LOG_ERR,
- "arp: ether address is broadcast for IP address %s!\n",
- inet_ntoa(isaddr));
- m_freem(m);
- return;
- }
- if (isaddr.s_addr == myaddr.s_addr) {
- log(LOG_ERR,
- "arp: %6D is using my IP address %s!\n",
- ea->arp_sha, ":", inet_ntoa(isaddr));
- itaddr = myaddr;
- goto reply;
- }
- la = arplookup(isaddr.s_addr, itaddr.s_addr == myaddr.s_addr, 0);
- if (la && (rt = la->la_rt) && (sdl = SDL(rt->rt_gateway))) {
- if (sdl->sdl_alen &&
- bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen))
- log(LOG_INFO, "arp: %s moved from %6D to %6D\n",
- inet_ntoa(isaddr), (u_char *)LLADDR(sdl), ":",
- ea->arp_sha, ":");
- (void)memcpy(LLADDR(sdl), ea->arp_sha, sizeof(ea->arp_sha));
- sdl->sdl_alen = sizeof(ea->arp_sha);
- if (rt->rt_expire)
- rt->rt_expire = rtems_bsdnet_seconds_since_boot() + arpt_keep;
- rt->rt_flags &= ~RTF_REJECT;
- la->la_asked = 0;
- if (la->la_hold) {
- (*ac->ac_if.if_output)(&ac->ac_if, la->la_hold,
- rt_key(rt), rt);
- la->la_hold = 0;
- }
- }
-reply:
- if (op != ARPOP_REQUEST) {
- m_freem(m);
- return;
- }
- if (itaddr.s_addr == myaddr.s_addr) {
- /* I am the target */
- (void)memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha));
- (void)memcpy(ea->arp_sha, ac->ac_enaddr, sizeof(ea->arp_sha));
- } else {
- la = arplookup(itaddr.s_addr, 0, SIN_PROXY);
- if (la == NULL) {
- struct sockaddr_in sin;
-
- if (!arp_proxyall) {
- m_freem(m);
- return;
- }
-
- bzero(&sin, sizeof sin);
- sin.sin_family = AF_INET;
- sin.sin_len = sizeof sin;
- sin.sin_addr = itaddr;
-
- rt = rtalloc1((struct sockaddr *)&sin, 0, 0UL);
- if (!rt) {
- m_freem(m);
- return;
- }
- /*
- * Don't send proxies for nodes on the same interface
- * as this one came out of, or we'll get into a fight
- * over who claims what Ether address.
- */
- if (rt->rt_ifp == &ac->ac_if) {
- rtfree(rt);
- m_freem(m);
- return;
- }
- (void)memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha));
- (void)memcpy(ea->arp_sha, ac->ac_enaddr, sizeof(ea->arp_sha));
- rtfree(rt);
-#ifdef DEBUG_PROXY
- printf("arp: proxying for %s\n",
- inet_ntoa(itaddr));
-#endif
- } else {
- rt = la->la_rt;
- (void)memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha));
- sdl = SDL(rt->rt_gateway);
- (void)memcpy(ea->arp_sha, LLADDR(sdl), sizeof(ea->arp_sha));
- }
- }
-
- (void)memcpy(ea->arp_tpa, ea->arp_spa, sizeof(ea->arp_spa));
- (void)memcpy(ea->arp_spa, &itaddr, sizeof(ea->arp_spa));
- ea->arp_op = htons(ARPOP_REPLY);
- ea->arp_pro = htons(ETHERTYPE_IP); /* let's be sure! */
- eh = (struct ether_header *)sa.sa_data;
- (void)memcpy(eh->ether_dhost, ea->arp_tha, sizeof(eh->ether_dhost));
- eh->ether_type = htons(ETHERTYPE_ARP);
- sa.sa_family = AF_UNSPEC;
- sa.sa_len = sizeof(sa);
- (*ac->ac_if.if_output)(&ac->ac_if, m, &sa, (struct rtentry *)0);
- return;
-}
-
-/*
- * Free an arp entry.
- */
-static void
-arptfree(la)
- register struct llinfo_arp *la;
-{
- register struct rtentry *rt = la->la_rt;
- register struct sockaddr_dl *sdl;
- if (rt == 0)
- panic("arptfree");
- if (rt->rt_refcnt > 0 && (sdl = SDL(rt->rt_gateway)) &&
- sdl->sdl_family == AF_LINK) {
- sdl->sdl_alen = 0;
- la->la_asked = 0;
- rt->rt_flags &= ~RTF_REJECT;
- return;
- }
- rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *)0, rt_mask(rt),
- 0, (struct rtentry **)0);
-}
-/*
- * Lookup or enter a new address in arptab.
- */
-static struct llinfo_arp *
-arplookup(addr, create, proxy)
- u_long addr;
- int create, proxy;
-{
- register struct rtentry *rt;
- static struct sockaddr_inarp sin = {sizeof(sin), AF_INET };
- const char *why = 0;
-
- sin.sin_addr.s_addr = addr;
- sin.sin_other = proxy ? SIN_PROXY : 0;
- rt = rtalloc1((struct sockaddr *)&sin, create, 0UL);
- if (rt == 0)
- return (0);
- rt->rt_refcnt--;
-
- if (rt->rt_flags & RTF_GATEWAY)
- why = "host is not on local network";
- else if ((rt->rt_flags & RTF_LLINFO) == 0)
- why = "could not allocate llinfo";
- else if (rt->rt_gateway->sa_family != AF_LINK)
- why = "gateway route is not ours";
-
- if (why && create) {
- log(LOG_DEBUG, "arplookup %s failed: %s\n",
- inet_ntoa(sin.sin_addr), why);
- return 0;
- } else if (why) {
- return 0;
- }
- return ((struct llinfo_arp *)rt->rt_llinfo);
-}
-
-void
-arp_ifinit(ac, ifa)
- struct arpcom *ac;
- struct ifaddr *ifa;
-{
- if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) != INADDR_ANY)
- arprequest(ac, &(IA_SIN(ifa)->sin_addr.s_addr),
- &(IA_SIN(ifa)->sin_addr.s_addr), ac->ac_enaddr);
- ifa->ifa_rtrequest = arp_rtrequest;
- ifa->ifa_flags |= RTF_CLONING;
-}
diff --git a/c/src/libnetworking/netinet/if_ether.h b/c/src/libnetworking/netinet/if_ether.h
deleted file mode 100644
index 22c8e97187..0000000000
--- a/c/src/libnetworking/netinet/if_ether.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)if_ether.h 8.3 (Berkeley) 5/2/95
- * $Id$
- */
-
-#ifndef _NETINET_IF_ETHER_H_
-#define _NETINET_IF_ETHER_H_
-
-#include <net/ethernet.h>
-
-#define ETHERTYPE_PUP 0x0200 /* PUP protocol */
-#define ETHERTYPE_IP 0x0800 /* IP protocol */
-#define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */
-#define ETHERTYPE_REVARP 0x8035 /* reverse Addr. resolution protocol */
-
-/*
- * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
- * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
- * by an ETHER type (as given above) and then the (variable-length) header.
- */
-#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
-#define ETHERTYPE_NTRAILER 16
-
-#define ETHERMTU (ETHER_MAX_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-#define ETHERMIN (ETHER_MIN_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-
-#ifdef KERNEL
-/*
- * Macro to map an IP multicast address to an Ethernet multicast address.
- * The high-order 25 bits of the Ethernet address are statically assigned,
- * and the low-order 23 bits are taken from the low end of the IP address.
- */
-#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
- /* struct in_addr *ipaddr; */ \
- /* u_char enaddr[ETHER_ADDR_LEN]; */ \
-{ \
- (enaddr)[0] = 0x01; \
- (enaddr)[1] = 0x00; \
- (enaddr)[2] = 0x5e; \
- (enaddr)[3] = ((u_char *)ipaddr)[1] & 0x7f; \
- (enaddr)[4] = ((u_char *)ipaddr)[2]; \
- (enaddr)[5] = ((u_char *)ipaddr)[3]; \
-}
-#endif
-
-/*
- * Ethernet Address Resolution Protocol.
- *
- * See RFC 826 for protocol description. Structure below is adapted
- * to resolving internet addresses. Field names used correspond to
- * RFC 826.
- */
-struct ether_arp {
- struct arphdr ea_hdr; /* fixed-size header */
- u_char arp_sha[ETHER_ADDR_LEN]; /* sender hardware address */
- u_char arp_spa[4]; /* sender protocol address */
- u_char arp_tha[ETHER_ADDR_LEN]; /* target hardware address */
- u_char arp_tpa[4]; /* target protocol address */
-};
-#define arp_hrd ea_hdr.ar_hrd
-#define arp_pro ea_hdr.ar_pro
-#define arp_hln ea_hdr.ar_hln
-#define arp_pln ea_hdr.ar_pln
-#define arp_op ea_hdr.ar_op
-
-
-/*
- * Structure shared between the ethernet driver modules and
- * the address resolution code. For example, each ec_softc or il_softc
- * begins with this structure.
- */
-struct arpcom {
- /*
- * The ifnet struct _must_ be at the head of this structure.
- */
- struct ifnet ac_if; /* network-visible interface */
- u_char ac_enaddr[ETHER_ADDR_LEN]; /* ethernet hardware address */
- struct ether_multi *ac_multiaddrs; /* list of ether multicast addrs */
- int ac_multicnt; /* length of ac_multiaddrs list */
-};
-
-struct sockaddr_inarp {
- u_char sin_len;
- u_char sin_family;
- u_short sin_port;
- struct in_addr sin_addr;
- struct in_addr sin_srcaddr;
- u_short sin_tos;
- u_short sin_other;
-#define SIN_PROXY 1
-};
-/*
- * IP and ethernet specific routing flags
- */
-#define RTF_USETRAILERS RTF_PROTO1 /* use trailers */
-#define RTF_ANNOUNCE RTF_PROTO2 /* announce new arp entry */
-
-#ifdef KERNEL
-extern u_char etherbroadcastaddr[ETHER_ADDR_LEN];
-extern u_char ether_ipmulticast_min[ETHER_ADDR_LEN];
-extern u_char ether_ipmulticast_max[ETHER_ADDR_LEN];
-extern struct ifqueue arpintrq;
-
-int arpresolve __P((struct arpcom *, struct rtentry *, struct mbuf *,
- struct sockaddr *, u_char *, struct rtentry *));
-void arp_ifinit __P((struct arpcom *, struct ifaddr *));
-int ether_addmulti __P((struct ifreq *, struct arpcom *));
-int ether_delmulti __P((struct ifreq *, struct arpcom *));
-
-/*
- * Ethernet multicast address structure. There is one of these for each
- * multicast address or range of multicast addresses that we are supposed
- * to listen to on a particular interface. They are kept in a linked list,
- * rooted in the interface's arpcom structure. (This really has nothing to
- * do with ARP, or with the Internet address family, but this appears to be
- * the minimally-disrupting place to put it.)
- */
-struct ether_multi {
- u_char enm_addrlo[ETHER_ADDR_LEN]; /* low or only address of range */
- u_char enm_addrhi[ETHER_ADDR_LEN]; /* high or only address of range */
- struct arpcom *enm_ac; /* back pointer to arpcom */
- u_int enm_refcount; /* no. claims to this addr/range */
- struct ether_multi *enm_next; /* ptr to next ether_multi */
-};
-
-/*
- * Structure used by macros below to remember position when stepping through
- * all of the ether_multi records.
- */
-struct ether_multistep {
- struct ether_multi *e_enm;
-};
-
-/*
- * Macro for looking up the ether_multi record for a given range of Ethernet
- * multicast addresses connected to a given arpcom structure. If no matching
- * record is found, "enm" returns NULL.
- */
-#define ETHER_LOOKUP_MULTI(addrlo, addrhi, ac, enm) \
- /* u_char addrlo[ETHER_ADDR_LEN]; */ \
- /* u_char addrhi[ETHER_ADDR_LEN]; */ \
- /* struct arpcom *ac; */ \
- /* struct ether_multi *enm; */ \
-{ \
- for ((enm) = (ac)->ac_multiaddrs; \
- (enm) != NULL && \
- (bcmp((enm)->enm_addrlo, (addrlo), ETHER_ADDR_LEN) != 0 || \
- bcmp((enm)->enm_addrhi, (addrhi), ETHER_ADDR_LEN) != 0); \
- (enm) = (enm)->enm_next); \
-}
-
-/*
- * Macro to step through all of the ether_multi records, one at a time.
- * The current position is remembered in "step", which the caller must
- * provide. ETHER_FIRST_MULTI(), below, must be called to initialize "step"
- * and get the first record. Both macros return a NULL "enm" when there
- * are no remaining records.
- */
-#define ETHER_NEXT_MULTI(step, enm) \
- /* struct ether_multistep step; */ \
- /* struct ether_multi *enm; */ \
-{ \
- if (((enm) = (step).e_enm) != NULL) \
- (step).e_enm = (enm)->enm_next; \
-}
-
-#define ETHER_FIRST_MULTI(step, ac, enm) \
- /* struct ether_multistep step; */ \
- /* struct arpcom *ac; */ \
- /* struct ether_multi *enm; */ \
-{ \
- (step).e_enm = (ac)->ac_multiaddrs; \
- ETHER_NEXT_MULTI((step), (enm)); \
-}
-
-#endif
-
-#endif
diff --git a/c/src/libnetworking/netinet/igmp.c b/c/src/libnetworking/netinet/igmp.c
deleted file mode 100644
index 2af8b7038e..0000000000
--- a/c/src/libnetworking/netinet/igmp.c
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * Copyright (c) 1988 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)igmp.c 8.1 (Berkeley) 7/19/93
- * $Id$
- */
-
-/*
- * Internet Group Management Protocol (IGMP) routines.
- *
- * Written by Steve Deering, Stanford, May 1988.
- * Modified by Rosen Sharma, Stanford, Aug 1994.
- * Modified by Bill Fenner, Xerox PARC, Feb 1995.
- * Modified to fully comply to IGMPv2 by Bill Fenner, Oct 1995.
- *
- * MULTICAST Revision: 3.5.1.4
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/igmp.h>
-#include <netinet/igmp_var.h>
-
-static struct router_info *
- find_rti __P((struct ifnet *ifp));
-
-static struct igmpstat igmpstat;
-
-SYSCTL_STRUCT(_net_inet_igmp, IGMPCTL_STATS, stats, CTLFLAG_RD,
- &igmpstat, igmpstat, "");
-
-static int igmp_timers_are_running;
-static u_long igmp_all_hosts_group;
-static u_long igmp_all_rtrs_group;
-static struct mbuf *router_alert;
-static struct router_info *Head;
-
-static void igmp_sendpkt(struct in_multi *, int, unsigned long);
-
-void
-igmp_init()
-{
- struct ipoption *ra;
-
- /*
- * To avoid byte-swapping the same value over and over again.
- */
- igmp_all_hosts_group = htonl(INADDR_ALLHOSTS_GROUP);
- igmp_all_rtrs_group = htonl(INADDR_ALLRTRS_GROUP);
-
- igmp_timers_are_running = 0;
-
- /*
- * Construct a Router Alert option to use in outgoing packets
- */
- MGET(router_alert, M_DONTWAIT, MT_DATA);
- ra = mtod(router_alert, struct ipoption *);
- ra->ipopt_dst.s_addr = 0;
- ra->ipopt_list[0] = IPOPT_RA; /* Router Alert Option */
- ra->ipopt_list[1] = 0x04; /* 4 bytes long */
- ra->ipopt_list[2] = 0x00;
- ra->ipopt_list[3] = 0x00;
- router_alert->m_len = sizeof(ra->ipopt_dst) + ra->ipopt_list[1];
-
- Head = (struct router_info *) 0;
-}
-
-static struct router_info *
-find_rti(ifp)
- struct ifnet *ifp;
-{
- register struct router_info *rti = Head;
-
-#ifdef IGMP_DEBUG
- printf("[igmp.c, _find_rti] --> entering \n");
-#endif
- while (rti) {
- if (rti->rti_ifp == ifp) {
-#ifdef IGMP_DEBUG
- printf("[igmp.c, _find_rti] --> found old entry \n");
-#endif
- return rti;
- }
- rti = rti->rti_next;
- }
- MALLOC(rti, struct router_info *, sizeof *rti, M_MRTABLE, M_NOWAIT);
- rti->rti_ifp = ifp;
- rti->rti_type = IGMP_V2_ROUTER;
- rti->rti_time = 0;
- rti->rti_next = Head;
- Head = rti;
-#ifdef IGMP_DEBUG
- printf("[igmp.c, _find_rti] --> created an entry \n");
-#endif
- return rti;
-}
-
-void
-igmp_input(m, iphlen)
- register struct mbuf *m;
- register int iphlen;
-{
- register struct igmp *igmp;
- register struct ip *ip;
- register int igmplen;
- register struct ifnet *ifp = m->m_pkthdr.rcvif;
- register int minlen;
- register struct in_multi *inm;
- register struct in_ifaddr *ia;
- struct in_multistep step;
- struct router_info *rti;
-
- int timer; /** timer value in the igmp query header **/
-
- ++igmpstat.igps_rcv_total;
-
- ip = mtod(m, struct ip *);
- igmplen = ip->ip_len;
-
- /*
- * Validate lengths
- */
- if (igmplen < IGMP_MINLEN) {
- ++igmpstat.igps_rcv_tooshort;
- m_freem(m);
- return;
- }
- minlen = iphlen + IGMP_MINLEN;
- if ((m->m_flags & M_EXT || m->m_len < minlen) &&
- (m = m_pullup(m, minlen)) == 0) {
- ++igmpstat.igps_rcv_tooshort;
- return;
- }
-
- /*
- * Validate checksum
- */
- m->m_data += iphlen;
- m->m_len -= iphlen;
- igmp = mtod(m, struct igmp *);
- if (in_cksum(m, igmplen)) {
- ++igmpstat.igps_rcv_badsum;
- m_freem(m);
- return;
- }
- m->m_data -= iphlen;
- m->m_len += iphlen;
-
- ip = mtod(m, struct ip *);
- timer = igmp->igmp_code * PR_FASTHZ / IGMP_TIMER_SCALE;
- rti = find_rti(ifp);
-
- /*
- * In the IGMPv2 specification, there are 3 states and a flag.
- *
- * In Non-Member state, we simply don't have a membership record.
- * In Delaying Member state, our timer is running (inm->inm_timer)
- * In Idle Member state, our timer is not running (inm->inm_timer==0)
- *
- * The flag is inm->inm_state, it is set to IGMP_OTHERMEMBER if
- * we have heard a report from another member, or IGMP_IREPORTEDLAST
- * if I sent the last report.
- */
- switch (igmp->igmp_type) {
-
- case IGMP_MEMBERSHIP_QUERY:
- ++igmpstat.igps_rcv_queries;
-
- if (ifp->if_flags & IFF_LOOPBACK)
- break;
-
- if (igmp->igmp_code == 0) {
- /*
- * Old router. Remember that the querier on this
- * interface is old, and set the timer to the
- * value in RFC 1112.
- */
-
- rti->rti_type = IGMP_V1_ROUTER;
- rti->rti_time = 0;
-
- timer = IGMP_MAX_HOST_REPORT_DELAY * PR_FASTHZ;
-
- if (ip->ip_dst.s_addr != igmp_all_hosts_group ||
- igmp->igmp_group.s_addr != 0) {
- ++igmpstat.igps_rcv_badqueries;
- m_freem(m);
- return;
- }
- } else {
- /*
- * New router. Simply do the new validity check.
- */
-
- if (igmp->igmp_group.s_addr != 0 &&
- !IN_MULTICAST(ntohl(igmp->igmp_group.s_addr))) {
- ++igmpstat.igps_rcv_badqueries;
- m_freem(m);
- return;
- }
- }
-
- /*
- * - Start the timers in all of our membership records
- * that the query applies to for the interface on
- * which the query arrived excl. those that belong
- * to the "all-hosts" group (224.0.0.1).
- * - Restart any timer that is already running but has
- * a value longer than the requested timeout.
- * - Use the value specified in the query message as
- * the maximum timeout.
- */
- IN_FIRST_MULTI(step, inm);
- while (inm != NULL) {
- if (inm->inm_ifp == ifp &&
- inm->inm_addr.s_addr != igmp_all_hosts_group &&
- (igmp->igmp_group.s_addr == 0 ||
- igmp->igmp_group.s_addr == inm->inm_addr.s_addr)) {
- if (inm->inm_timer == 0 ||
- inm->inm_timer > timer) {
- inm->inm_timer =
- IGMP_RANDOM_DELAY(timer);
- igmp_timers_are_running = 1;
- }
- }
- IN_NEXT_MULTI(step, inm);
- }
-
- break;
-
- case IGMP_V1_MEMBERSHIP_REPORT:
- case IGMP_V2_MEMBERSHIP_REPORT:
- /*
- * For fast leave to work, we have to know that we are the
- * last person to send a report for this group. Reports
- * can potentially get looped back if we are a multicast
- * router, so discard reports sourced by me.
- */
- IFP_TO_IA(ifp, ia);
- if (ia && ip->ip_src.s_addr == IA_SIN(ia)->sin_addr.s_addr)
- break;
-
- ++igmpstat.igps_rcv_reports;
-
- if (ifp->if_flags & IFF_LOOPBACK)
- break;
-
- if (!IN_MULTICAST(ntohl(igmp->igmp_group.s_addr))) {
- ++igmpstat.igps_rcv_badreports;
- m_freem(m);
- return;
- }
-
- /*
- * KLUDGE: if the IP source address of the report has an
- * unspecified (i.e., zero) subnet number, as is allowed for
- * a booting host, replace it with the correct subnet number
- * so that a process-level multicast routing demon can
- * determine which subnet it arrived from. This is necessary
- * to compensate for the lack of any way for a process to
- * determine the arrival interface of an incoming packet.
- */
- if ((ntohl(ip->ip_src.s_addr) & IN_CLASSA_NET) == 0)
- if (ia) ip->ip_src.s_addr = htonl(ia->ia_subnet);
-
- /*
- * If we belong to the group being reported, stop
- * our timer for that group.
- */
- IN_LOOKUP_MULTI(igmp->igmp_group, ifp, inm);
-
- if (inm != NULL) {
- inm->inm_timer = 0;
- ++igmpstat.igps_rcv_ourreports;
-
- inm->inm_state = IGMP_OTHERMEMBER;
- }
-
- break;
- }
-
- /*
- * Pass all valid IGMP packets up to any process(es) listening
- * on a raw IGMP socket.
- */
- rip_input(m, iphlen);
-}
-
-void
-igmp_joingroup(inm)
- struct in_multi *inm;
-{
- int s = splnet();
-
- if (inm->inm_addr.s_addr == igmp_all_hosts_group
- || inm->inm_ifp->if_flags & IFF_LOOPBACK) {
- inm->inm_timer = 0;
- inm->inm_state = IGMP_OTHERMEMBER;
- } else {
- inm->inm_rti = find_rti(inm->inm_ifp);
- igmp_sendpkt(inm, inm->inm_rti->rti_type, 0);
- inm->inm_timer = IGMP_RANDOM_DELAY(
- IGMP_MAX_HOST_REPORT_DELAY*PR_FASTHZ);
- inm->inm_state = IGMP_IREPORTEDLAST;
- igmp_timers_are_running = 1;
- }
- splx(s);
-}
-
-void
-igmp_leavegroup(inm)
- struct in_multi *inm;
-{
- if (inm->inm_state == IGMP_IREPORTEDLAST &&
- inm->inm_addr.s_addr != igmp_all_hosts_group &&
- !(inm->inm_ifp->if_flags & IFF_LOOPBACK) &&
- inm->inm_rti->rti_type != IGMP_V1_ROUTER)
- igmp_sendpkt(inm, IGMP_V2_LEAVE_GROUP, igmp_all_rtrs_group);
-}
-
-void
-igmp_fasttimo()
-{
- register struct in_multi *inm;
- struct in_multistep step;
- int s;
-
- /*
- * Quick check to see if any work needs to be done, in order
- * to minimize the overhead of fasttimo processing.
- */
-
- if (!igmp_timers_are_running)
- return;
-
- s = splnet();
- igmp_timers_are_running = 0;
- IN_FIRST_MULTI(step, inm);
- while (inm != NULL) {
- if (inm->inm_timer == 0) {
- /* do nothing */
- } else if (--inm->inm_timer == 0) {
- igmp_sendpkt(inm, inm->inm_rti->rti_type, 0);
- inm->inm_state = IGMP_IREPORTEDLAST;
- } else {
- igmp_timers_are_running = 1;
- }
- IN_NEXT_MULTI(step, inm);
- }
- splx(s);
-}
-
-void
-igmp_slowtimo()
-{
- int s = splnet();
- register struct router_info *rti = Head;
-
-#ifdef IGMP_DEBUG
- printf("[igmp.c,_slowtimo] -- > entering \n");
-#endif
- while (rti) {
- if (rti->rti_type == IGMP_V1_ROUTER) {
- rti->rti_time++;
- if (rti->rti_time >= IGMP_AGE_THRESHOLD) {
- rti->rti_type = IGMP_V2_ROUTER;
- }
- }
- rti = rti->rti_next;
- }
-#ifdef IGMP_DEBUG
- printf("[igmp.c,_slowtimo] -- > exiting \n");
-#endif
- splx(s);
-}
-
-static struct route igmprt;
-
-static void
-igmp_sendpkt(inm, type, addr)
- struct in_multi *inm;
- int type;
- unsigned long addr;
-{
- struct mbuf *m;
- struct igmp *igmp;
- struct ip *ip;
- struct ip_moptions imo;
-
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- return;
-
- m->m_pkthdr.rcvif = loif;
- m->m_pkthdr.len = sizeof(struct ip) + IGMP_MINLEN;
- MH_ALIGN(m, IGMP_MINLEN + sizeof(struct ip));
- m->m_data += sizeof(struct ip);
- m->m_len = IGMP_MINLEN;
- igmp = mtod(m, struct igmp *);
- igmp->igmp_type = type;
- igmp->igmp_code = 0;
- igmp->igmp_group = inm->inm_addr;
- igmp->igmp_cksum = 0;
- igmp->igmp_cksum = in_cksum(m, IGMP_MINLEN);
-
- m->m_data -= sizeof(struct ip);
- m->m_len += sizeof(struct ip);
- ip = mtod(m, struct ip *);
- ip->ip_tos = 0;
- ip->ip_len = sizeof(struct ip) + IGMP_MINLEN;
- ip->ip_off = 0;
- ip->ip_p = IPPROTO_IGMP;
- ip->ip_src.s_addr = INADDR_ANY;
- ip->ip_dst.s_addr = addr ? addr : igmp->igmp_group.s_addr;
-
- imo.imo_multicast_ifp = inm->inm_ifp;
- imo.imo_multicast_ttl = 1;
- imo.imo_multicast_vif = -1;
- /*
- * Request loopback of the report if we are acting as a multicast
- * router, so that the process-level routing demon can hear it.
- */
- imo.imo_multicast_loop = (ip_mrouter != NULL);
-
- /*
- * XXX
- * Do we have to worry about reentrancy here? Don't think so.
- */
- ip_output(m, router_alert, &igmprt, 0, &imo);
-
- ++igmpstat.igps_snd_reports;
-}
diff --git a/c/src/libnetworking/netinet/igmp.h b/c/src/libnetworking/netinet/igmp.h
deleted file mode 100644
index 01d6d09179..0000000000
--- a/c/src/libnetworking/netinet/igmp.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 1988 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)igmp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IGMP_H_
-#define _NETINET_IGMP_H_
-
-/*
- * Internet Group Management Protocol (IGMP) definitions.
- *
- * Written by Steve Deering, Stanford, May 1988.
- *
- * MULTICAST Revision: 3.5.1.2
- */
-
-/*
- * IGMP packet format.
- */
-struct igmp {
- u_char igmp_type; /* version & type of IGMP message */
- u_char igmp_code; /* subtype for routing msgs */
- u_short igmp_cksum; /* IP-style checksum */
- struct in_addr igmp_group; /* group address being reported */
-}; /* (zero for queries) */
-
-#define IGMP_MINLEN 8
-
-/*
- * Message types, including version number.
- */
-#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */
-#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */
-#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */
-#define IGMP_V2_LEAVE_GROUP 0x17 /* Leave-group message */
-
-#define IGMP_DVMRP 0x13 /* DVMRP routing message */
-#define IGMP_PIM 0x14 /* PIM routing message */
-
-#define IGMP_MTRACE_RESP 0x1e /* traceroute resp.(to sender)*/
-#define IGMP_MTRACE 0x1f /* mcast traceroute messages */
-
-#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
- /* query (in seconds) according */
- /* to RFC1112 */
-
-
-#define IGMP_TIMER_SCALE 10 /* denotes that the igmp code field */
- /* specifies time in 10th of seconds*/
-
-/*
- * The following four defininitions are for backwards compatibility.
- * They should be removed as soon as all applications are updated to
- * use the new constant names.
- */
-#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
-#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
-#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
-#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
-
-#endif /* _NETINET_IGMP_H_ */
diff --git a/c/src/libnetworking/netinet/igmp_var.h b/c/src/libnetworking/netinet/igmp_var.h
deleted file mode 100644
index f408bf2bc1..0000000000
--- a/c/src/libnetworking/netinet/igmp_var.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 1988 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)igmp_var.h 8.1 (Berkeley) 7/19/93
- * $Id$
- */
-
-#ifndef _NETINET_IGMP_VAR_H_
-#define _NETINET_IGMP_VAR_H_
-
-/*
- * Internet Group Management Protocol (IGMP),
- * implementation-specific definitions.
- *
- * Written by Steve Deering, Stanford, May 1988.
- *
- * MULTICAST Revision: 3.5.1.3
- */
-
-struct igmpstat {
- u_int igps_rcv_total; /* total IGMP messages received */
- u_int igps_rcv_tooshort; /* received with too few bytes */
- u_int igps_rcv_badsum; /* received with bad checksum */
- u_int igps_rcv_queries; /* received membership queries */
- u_int igps_rcv_badqueries; /* received invalid queries */
- u_int igps_rcv_reports; /* received membership reports */
- u_int igps_rcv_badreports; /* received invalid reports */
- u_int igps_rcv_ourreports; /* received reports for our groups */
- u_int igps_snd_reports; /* sent membership reports */
-};
-
-#ifdef KERNEL
-extern struct igmpstat igmpstat;
-
-#define IGMP_RANDOM_DELAY(X) (random() % (X) + 1)
-
-/*
- * States for IGMPv2's leave processing
- */
-#define IGMP_OTHERMEMBER 0
-#define IGMP_IREPORTEDLAST 1
-
-/*
- * We must remember what version the subnet's querier is.
- * We conveniently use the IGMP message type for the proper
- * membership report to keep this state.
- */
-#define IGMP_V1_ROUTER IGMP_V1_MEMBERSHIP_REPORT
-#define IGMP_V2_ROUTER IGMP_V2_MEMBERSHIP_REPORT
-
-/*
- * Revert to new router if we haven't heard from an old router in
- * this amount of time.
- */
-#define IGMP_AGE_THRESHOLD 540
-
-void igmp_init __P((void));
-void igmp_input __P((struct mbuf *, int));
-void igmp_joingroup __P((struct in_multi *));
-void igmp_leavegroup __P((struct in_multi *));
-void igmp_fasttimo __P((void));
-void igmp_slowtimo __P((void));
-#endif
-
-/*
- * Names for IGMP sysctl objects
- */
-#define IGMPCTL_STATS 1 /* statistics (read-only) */
-#define IGMPCTL_MAXID 2
-
-#define IGMPCTL_NAMES { \
- { 0, 0 }, \
- { "stats", CTLTYPE_STRUCT }, \
-}
-
-#endif
-
-
diff --git a/c/src/libnetworking/netinet/in.c b/c/src/libnetworking/netinet/in.c
deleted file mode 100644
index 701406f207..0000000000
--- a/c/src/libnetworking/netinet/in.c
+++ /dev/null
@@ -1,728 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1991, 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.c 8.4 (Berkeley) 1/9/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/malloc.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/if_ether.h>
-
-#include <netinet/igmp_var.h>
-
-/*
- * This structure is used to keep track of in_multi chains which belong to
- * deleted interface addresses.
- */
-static LIST_HEAD(, multi_kludge) in_mk; /* XXX BSS initialization */
-
-struct multi_kludge {
- LIST_ENTRY(multi_kludge) mk_entry;
- struct ifnet *mk_ifp;
- struct in_multihead mk_head;
-};
-
-static void in_socktrim __P((struct sockaddr_in *));
-static int in_ifinit __P((struct ifnet *,
- struct in_ifaddr *, struct sockaddr_in *, int));
-static void in_ifscrub __P((struct ifnet *, struct in_ifaddr *));
-
-static int subnetsarelocal = 0;
-SYSCTL_INT(_net_inet_ip, OID_AUTO, subnets_are_local, CTLFLAG_RW,
- &subnetsarelocal, 0, "");
-/*
- * Return 1 if an internet address is for a ``local'' host
- * (one to which we have a connection). If subnetsarelocal
- * is true, this includes other subnets of the local net.
- * Otherwise, it includes only the directly-connected (sub)nets.
- */
-int
-in_localaddr(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
- register struct in_ifaddr *ia;
-
- if (subnetsarelocal) {
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if ((i & ia->ia_netmask) == ia->ia_net)
- return (1);
- } else {
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if ((i & ia->ia_subnetmask) == ia->ia_subnet)
- return (1);
- }
- return (0);
-}
-
-/*
- * Determine whether an IP address is in a reserved set of addresses
- * that may not be forwarded, or whether datagrams to that destination
- * may be forwarded.
- */
-int
-in_canforward(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
- register u_long net;
-
- if (IN_EXPERIMENTAL(i) || IN_MULTICAST(i))
- return (0);
- if (IN_CLASSA(i)) {
- net = i & IN_CLASSA_NET;
- if (net == 0 || net == (IN_LOOPBACKNET << IN_CLASSA_NSHIFT))
- return (0);
- }
- return (1);
-}
-
-/*
- * Trim a mask in a sockaddr
- */
-static void
-in_socktrim(ap)
-struct sockaddr_in *ap;
-{
- register char *cplim = (char *) &ap->sin_addr;
- register char *cp = (char *) (&ap->sin_addr + 1);
-
- ap->sin_len = 0;
- while (--cp >= cplim)
- if (*cp) {
- (ap)->sin_len = cp - (char *) (ap) + 1;
- break;
- }
-}
-
-static int in_interfaces; /* number of external internet interfaces */
-
-/*
- * Generic internet control operations (ioctl's).
- * Ifp is 0 if not an interface-specific ioctl.
- */
-/* ARGSUSED */
-int
-in_control(so, cmd, data, ifp)
- struct socket *so;
- u_long cmd;
- caddr_t data;
- register struct ifnet *ifp;
-{
- register struct ifreq *ifr = (struct ifreq *)data;
- register struct in_ifaddr *ia = 0, *iap;
- register struct ifaddr *ifa;
- struct in_ifaddr *oia;
- struct in_aliasreq *ifra = (struct in_aliasreq *)data;
- struct sockaddr_in oldaddr;
- int error, hostIsNew, maskIsNew, s;
- u_long i;
- struct multi_kludge *mk;
-
- /*
- * Find address for this interface, if it exists.
- *
- * If an alias address was specified, find that one instead of
- * the first one on the interface.
- */
- if (ifp)
- for (iap = in_ifaddr; iap; iap = iap->ia_next)
- if (iap->ia_ifp == ifp) {
- if (((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr.s_addr ==
- iap->ia_addr.sin_addr.s_addr) {
- ia = iap;
- break;
- } else if (ia == NULL) {
- ia = iap;
- if (ifr->ifr_addr.sa_family != AF_INET)
- break;
- }
- }
-
- switch (cmd) {
-
- case SIOCAIFADDR:
- case SIOCDIFADDR:
- if (ifra->ifra_addr.sin_family == AF_INET) {
- for (oia = ia; ia; ia = ia->ia_next) {
- if (ia->ia_ifp == ifp &&
- ia->ia_addr.sin_addr.s_addr ==
- ifra->ifra_addr.sin_addr.s_addr)
- break;
- }
- if ((ifp->if_flags & IFF_POINTOPOINT)
- && (cmd == SIOCAIFADDR)
- && (ifra->ifra_dstaddr.sin_addr.s_addr
- == INADDR_ANY)) {
- return EDESTADDRREQ;
- }
- }
- if (cmd == SIOCDIFADDR && ia == 0)
- return (EADDRNOTAVAIL);
- /* FALLTHROUGH */
- case SIOCSIFADDR:
- case SIOCSIFNETMASK:
- case SIOCSIFDSTADDR:
- if ((so->so_state & SS_PRIV) == 0)
- return (EPERM);
-
- if (ifp == 0)
- panic("in_control");
- if (ia == (struct in_ifaddr *)0) {
- oia = (struct in_ifaddr *)
- malloc(sizeof *oia, M_IFADDR, M_WAITOK);
- if (oia == (struct in_ifaddr *)NULL)
- return (ENOBUFS);
- bzero((caddr_t)oia, sizeof *oia);
- ia = in_ifaddr;
- /*
- * Protect from ipintr() traversing address list
- * while we're modifying it.
- */
- s = splnet();
-
- if (ia) {
- for ( ; ia->ia_next; ia = ia->ia_next)
- continue;
- ia->ia_next = oia;
- } else
- in_ifaddr = oia;
- ia = oia;
- ifa = ifp->if_addrlist;
- if (ifa) {
- for ( ; ifa->ifa_next; ifa = ifa->ifa_next)
- continue;
- ifa->ifa_next = (struct ifaddr *) ia;
- } else
- ifp->if_addrlist = (struct ifaddr *) ia;
- ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr;
- ia->ia_ifa.ifa_dstaddr
- = (struct sockaddr *)&ia->ia_dstaddr;
- ia->ia_ifa.ifa_netmask
- = (struct sockaddr *)&ia->ia_sockmask;
- ia->ia_sockmask.sin_len = 8;
- if (ifp->if_flags & IFF_BROADCAST) {
- ia->ia_broadaddr.sin_len = sizeof(ia->ia_addr);
- ia->ia_broadaddr.sin_family = AF_INET;
- }
- ia->ia_ifp = ifp;
- if (!(ifp->if_flags & IFF_LOOPBACK))
- in_interfaces++;
- splx(s);
- }
- break;
-
- case SIOCSIFBRDADDR:
- if ((so->so_state & SS_PRIV) == 0)
- return (EPERM);
- /* FALLTHROUGH */
-
- case SIOCGIFADDR:
- case SIOCGIFNETMASK:
- case SIOCGIFDSTADDR:
- case SIOCGIFBRDADDR:
- if (ia == (struct in_ifaddr *)0)
- return (EADDRNOTAVAIL);
- break;
- }
- switch (cmd) {
-
- case SIOCGIFADDR:
- *((struct sockaddr_in *)&ifr->ifr_addr) = ia->ia_addr;
- break;
-
- case SIOCGIFBRDADDR:
- if ((ifp->if_flags & IFF_BROADCAST) == 0)
- return (EINVAL);
- *((struct sockaddr_in *)&ifr->ifr_dstaddr) = ia->ia_broadaddr;
- break;
-
- case SIOCGIFDSTADDR:
- if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
- return (EINVAL);
- *((struct sockaddr_in *)&ifr->ifr_dstaddr) = ia->ia_dstaddr;
- break;
-
- case SIOCGIFNETMASK:
- *((struct sockaddr_in *)&ifr->ifr_addr) = ia->ia_sockmask;
- break;
-
- case SIOCSIFDSTADDR:
- if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
- return (EINVAL);
- oldaddr = ia->ia_dstaddr;
- ia->ia_dstaddr = *(struct sockaddr_in *)&ifr->ifr_dstaddr;
- if (ifp->if_ioctl && (error = (*ifp->if_ioctl)
- (ifp, SIOCSIFDSTADDR, (caddr_t)ia))) {
- ia->ia_dstaddr = oldaddr;
- return (error);
- }
- if (ia->ia_flags & IFA_ROUTE) {
- ia->ia_ifa.ifa_dstaddr = (struct sockaddr *)&oldaddr;
- rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST);
- ia->ia_ifa.ifa_dstaddr =
- (struct sockaddr *)&ia->ia_dstaddr;
- rtinit(&(ia->ia_ifa), (int)RTM_ADD, RTF_HOST|RTF_UP);
- }
- break;
-
- case SIOCSIFBRDADDR:
- if ((ifp->if_flags & IFF_BROADCAST) == 0)
- return (EINVAL);
- ia->ia_broadaddr = *(struct sockaddr_in *)&ifr->ifr_broadaddr;
- break;
-
- case SIOCSIFADDR:
- return (in_ifinit(ifp, ia,
- (struct sockaddr_in *) &ifr->ifr_addr, 1));
-
- case SIOCSIFNETMASK:
- i = ifra->ifra_addr.sin_addr.s_addr;
- ia->ia_subnetmask = ntohl(ia->ia_sockmask.sin_addr.s_addr = i);
- break;
-
- case SIOCAIFADDR:
- maskIsNew = 0;
- hostIsNew = 1;
- error = 0;
- if (ia->ia_addr.sin_family == AF_INET) {
- if (ifra->ifra_addr.sin_len == 0) {
- ifra->ifra_addr = ia->ia_addr;
- hostIsNew = 0;
- } else if (ifra->ifra_addr.sin_addr.s_addr ==
- ia->ia_addr.sin_addr.s_addr)
- hostIsNew = 0;
- }
- if (ifra->ifra_mask.sin_len) {
- in_ifscrub(ifp, ia);
- ia->ia_sockmask = ifra->ifra_mask;
- ia->ia_subnetmask =
- ntohl(ia->ia_sockmask.sin_addr.s_addr);
- maskIsNew = 1;
- }
- if ((ifp->if_flags & IFF_POINTOPOINT) &&
- (ifra->ifra_dstaddr.sin_family == AF_INET)) {
- in_ifscrub(ifp, ia);
- ia->ia_dstaddr = ifra->ifra_dstaddr;
- maskIsNew = 1; /* We lie; but the effect's the same */
- }
- if (ifra->ifra_addr.sin_family == AF_INET &&
- (hostIsNew || maskIsNew))
- error = in_ifinit(ifp, ia, &ifra->ifra_addr, 0);
- if ((ifp->if_flags & IFF_BROADCAST) &&
- (ifra->ifra_broadaddr.sin_family == AF_INET))
- ia->ia_broadaddr = ifra->ifra_broadaddr;
- return (error);
-
- case SIOCDIFADDR:
- mk = malloc(sizeof *mk, M_IPMADDR, M_WAITOK);
- if (!mk)
- return ENOBUFS;
-
- in_ifscrub(ifp, ia);
- /*
- * Protect from ipintr() traversing address list
- * while we're modifying it.
- */
- s = splnet();
-
- if ((ifa = ifp->if_addrlist) == (struct ifaddr *)ia)
- ifp->if_addrlist = ifa->ifa_next;
- else {
- while (ifa->ifa_next &&
- (ifa->ifa_next != (struct ifaddr *)ia))
- ifa = ifa->ifa_next;
- if (ifa->ifa_next)
- ifa->ifa_next = ((struct ifaddr *)ia)->ifa_next;
- else
- printf("Couldn't unlink inifaddr from ifp\n");
- }
- oia = ia;
- if (oia == (ia = in_ifaddr))
- in_ifaddr = ia->ia_next;
- else {
- while (ia->ia_next && (ia->ia_next != oia))
- ia = ia->ia_next;
- if (ia->ia_next)
- ia->ia_next = oia->ia_next;
- else
- printf("Didn't unlink inifadr from list\n");
- }
-
- if (!oia->ia_multiaddrs.lh_first) {
- IFAFREE(&oia->ia_ifa);
- FREE(mk, M_IPMADDR);
- splx(s);
- break;
- }
-
- /*
- * Multicast address kludge:
- * If there were any multicast addresses attached to this
- * interface address, either move them to another address
- * on this interface, or save them until such time as this
- * interface is reconfigured for IP.
- */
- IFP_TO_IA(oia->ia_ifp, ia);
- if (ia) { /* there is another address */
- struct in_multi *inm;
- for(inm = oia->ia_multiaddrs.lh_first; inm;
- inm = inm->inm_entry.le_next) {
- IFAFREE(&inm->inm_ia->ia_ifa);
- ia->ia_ifa.ifa_refcnt++;
- inm->inm_ia = ia;
- LIST_INSERT_HEAD(&ia->ia_multiaddrs, inm,
- inm_entry);
- }
- FREE(mk, M_IPMADDR);
- } else { /* last address on this if deleted, save */
- struct in_multi *inm;
-
- LIST_INIT(&mk->mk_head);
- mk->mk_ifp = ifp;
-
- for(inm = oia->ia_multiaddrs.lh_first; inm;
- inm = inm->inm_entry.le_next) {
- LIST_INSERT_HEAD(&mk->mk_head, inm, inm_entry);
- }
-
- if (mk->mk_head.lh_first) {
- LIST_INSERT_HEAD(&in_mk, mk, mk_entry);
- } else {
- FREE(mk, M_IPMADDR);
- }
- }
-
- IFAFREE((&oia->ia_ifa));
- splx(s);
- break;
-
- default:
- if (ifp == 0 || ifp->if_ioctl == 0)
- return (EOPNOTSUPP);
- return ((*ifp->if_ioctl)(ifp, cmd, data));
- }
- return (0);
-}
-
-/*
- * Delete any existing route for an interface.
- */
-static void
-in_ifscrub(ifp, ia)
- register struct ifnet *ifp;
- register struct in_ifaddr *ia;
-{
-
- if ((ia->ia_flags & IFA_ROUTE) == 0)
- return;
- if (ifp->if_flags & (IFF_LOOPBACK|IFF_POINTOPOINT))
- rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST);
- else
- rtinit(&(ia->ia_ifa), (int)RTM_DELETE, 0);
- ia->ia_flags &= ~IFA_ROUTE;
-}
-
-/*
- * Initialize an interface's internet address
- * and routing table entry.
- */
-static int
-in_ifinit(ifp, ia, sin, scrub)
- register struct ifnet *ifp;
- register struct in_ifaddr *ia;
- struct sockaddr_in *sin;
- int scrub;
-{
- register u_long i = ntohl(sin->sin_addr.s_addr);
- struct sockaddr_in oldaddr;
- int s = splimp(), flags = RTF_UP, error;
- struct multi_kludge *mk;
-
- oldaddr = ia->ia_addr;
- ia->ia_addr = *sin;
- /*
- * Give the interface a chance to initialize
- * if this is its first address,
- * and to validate the address if necessary.
- */
- if (ifp->if_ioctl &&
- (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia))) {
- splx(s);
- ia->ia_addr = oldaddr;
- return (error);
- }
- splx(s);
- if (scrub) {
- ia->ia_ifa.ifa_addr = (struct sockaddr *)&oldaddr;
- in_ifscrub(ifp, ia);
- ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr;
- }
- if (IN_CLASSA(i))
- ia->ia_netmask = IN_CLASSA_NET;
- else if (IN_CLASSB(i))
- ia->ia_netmask = IN_CLASSB_NET;
- else
- ia->ia_netmask = IN_CLASSC_NET;
- /*
- * The subnet mask usually includes at least the standard network part,
- * but may may be smaller in the case of supernetting.
- * If it is set, we believe it.
- */
- if (ia->ia_subnetmask == 0) {
- ia->ia_subnetmask = ia->ia_netmask;
- ia->ia_sockmask.sin_addr.s_addr = htonl(ia->ia_subnetmask);
- } else
- ia->ia_netmask &= ia->ia_subnetmask;
- ia->ia_net = i & ia->ia_netmask;
- ia->ia_subnet = i & ia->ia_subnetmask;
- in_socktrim(&ia->ia_sockmask);
- /*
- * Add route for the network.
- */
- ia->ia_ifa.ifa_metric = ifp->if_metric;
- if (ifp->if_flags & IFF_BROADCAST) {
- ia->ia_broadaddr.sin_addr.s_addr =
- htonl(ia->ia_subnet | ~ia->ia_subnetmask);
- ia->ia_netbroadcast.s_addr =
- htonl(ia->ia_net | ~ ia->ia_netmask);
- } else if (ifp->if_flags & IFF_LOOPBACK) {
- ia->ia_ifa.ifa_dstaddr = ia->ia_ifa.ifa_addr;
- flags |= RTF_HOST;
- } else if (ifp->if_flags & IFF_POINTOPOINT) {
- if (ia->ia_dstaddr.sin_family != AF_INET)
- return (0);
- flags |= RTF_HOST;
- }
- if ((error = rtinit(&(ia->ia_ifa), (int)RTM_ADD, flags)) == 0)
- ia->ia_flags |= IFA_ROUTE;
-
- LIST_INIT(&ia->ia_multiaddrs);
- /*
- * If the interface supports multicast, join the "all hosts"
- * multicast group on that interface.
- */
- if (ifp->if_flags & IFF_MULTICAST) {
- struct in_addr addr;
-
- /*
- * Continuation of multicast address hack:
- * If there was a multicast group list previously saved
- * for this interface, then we re-attach it to the first
- * address configured on the i/f.
- */
- for(mk = in_mk.lh_first; mk; mk = mk->mk_entry.le_next) {
- if(mk->mk_ifp == ifp) {
- struct in_multi *inm;
-
- for(inm = mk->mk_head.lh_first; inm;
- inm = inm->inm_entry.le_next) {
- IFAFREE(&inm->inm_ia->ia_ifa);
- ia->ia_ifa.ifa_refcnt++;
- inm->inm_ia = ia;
- LIST_INSERT_HEAD(&ia->ia_multiaddrs,
- inm, inm_entry);
- }
- LIST_REMOVE(mk, mk_entry);
- free(mk, M_IPMADDR);
- break;
- }
- }
-
- addr.s_addr = htonl(INADDR_ALLHOSTS_GROUP);
- in_addmulti(&addr, ifp);
- }
- return (error);
-}
-
-
-/*
- * Return 1 if the address might be a local broadcast address.
- */
-int
-in_broadcast(in, ifp)
- struct in_addr in;
- struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
- u_long t;
-
- if (in.s_addr == INADDR_BROADCAST ||
- in.s_addr == INADDR_ANY)
- return 1;
- if ((ifp->if_flags & IFF_BROADCAST) == 0)
- return 0;
- t = ntohl(in.s_addr);
- /*
- * Look through the list of addresses for a match
- * with a broadcast address.
- */
-#define ia ((struct in_ifaddr *)ifa)
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- if (ifa->ifa_addr->sa_family == AF_INET &&
- (in.s_addr == ia->ia_broadaddr.sin_addr.s_addr ||
- in.s_addr == ia->ia_netbroadcast.s_addr ||
- /*
- * Check for old-style (host 0) broadcast.
- */
- t == ia->ia_subnet || t == ia->ia_net) &&
- /*
- * Check for an all one subnetmask. These
- * only exist when an interface gets a secondary
- * address.
- */
- ia->ia_subnetmask != (u_long)0xffffffff)
- return 1;
- return (0);
-#undef ia
-}
-/*
- * Add an address to the list of IP multicast addresses for a given interface.
- */
-struct in_multi *
-in_addmulti(ap, ifp)
- register struct in_addr *ap;
- register struct ifnet *ifp;
-{
- register struct in_multi *inm;
- struct ifreq ifr;
- struct in_ifaddr *ia;
- int s = splnet();
-
- /*
- * See if address already in list.
- */
- IN_LOOKUP_MULTI(*ap, ifp, inm);
- if (inm != NULL) {
- /*
- * Found it; just increment the reference count.
- */
- ++inm->inm_refcount;
- }
- else {
- /*
- * New address; allocate a new multicast record
- * and link it into the interface's multicast list.
- */
- inm = (struct in_multi *)malloc(sizeof(*inm),
- M_IPMADDR, M_NOWAIT);
- if (inm == NULL) {
- splx(s);
- return (NULL);
- }
- inm->inm_addr = *ap;
- inm->inm_ifp = ifp;
- inm->inm_refcount = 1;
- IFP_TO_IA(ifp, ia);
- if (ia == NULL) {
- free(inm, M_IPMADDR);
- splx(s);
- return (NULL);
- }
- inm->inm_ia = ia;
- ia->ia_ifa.ifa_refcnt++; /* gain a reference */
- LIST_INSERT_HEAD(&ia->ia_multiaddrs, inm, inm_entry);
-
- /*
- * Ask the network driver to update its multicast reception
- * filter appropriately for the new address.
- */
- ((struct sockaddr_in *)&ifr.ifr_addr)->sin_family = AF_INET;
- ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr = *ap;
- if ((ifp->if_ioctl == NULL) ||
- (*ifp->if_ioctl)(ifp, SIOCADDMULTI,(caddr_t)&ifr) != 0) {
- LIST_REMOVE(inm, inm_entry);
- IFAFREE(&ia->ia_ifa); /* release reference */
- free(inm, M_IPMADDR);
- splx(s);
- return (NULL);
- }
- /*
- * Let IGMP know that we have joined a new IP multicast group.
- */
- igmp_joingroup(inm);
- }
- splx(s);
- return (inm);
-}
-
-/*
- * Delete a multicast address record.
- */
-void
-in_delmulti(inm)
- register struct in_multi *inm;
-{
- struct ifreq ifr;
- int s = splnet();
-
- if (--inm->inm_refcount == 0) {
- /*
- * No remaining claims to this record; let IGMP know that
- * we are leaving the multicast group.
- */
- igmp_leavegroup(inm);
- /*
- * Unlink from list.
- */
- LIST_REMOVE(inm, inm_entry);
- IFAFREE(&inm->inm_ia->ia_ifa); /* release reference */
-
- /*
- * Notify the network driver to update its multicast reception
- * filter.
- */
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr =
- inm->inm_addr;
- (*inm->inm_ifp->if_ioctl)(inm->inm_ifp, SIOCDELMULTI,
- (caddr_t)&ifr);
- free(inm, M_IPMADDR);
- }
- splx(s);
-}
diff --git a/c/src/libnetworking/netinet/in.h b/c/src/libnetworking/netinet/in.h
deleted file mode 100644
index ba3cbb21cc..0000000000
--- a/c/src/libnetworking/netinet/in.h
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1990, 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.h 8.3 (Berkeley) 1/3/94
- * $Id$
- */
-
-#ifndef _NETINET_IN_H_
-#define _NETINET_IN_H_
-
-/*
- * Constants and structures defined by the internet system,
- * Per RFC 790, September 1981, and numerous additions.
- */
-
-/*
- * Protocols (RFC 1700)
- */
-#define IPPROTO_IP 0 /* dummy for IP */
-#define IPPROTO_ICMP 1 /* control message protocol */
-#define IPPROTO_IGMP 2 /* group mgmt protocol */
-#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
-#define IPPROTO_IPIP 4 /* IP encapsulation in IP */
-#define IPPROTO_TCP 6 /* tcp */
-#define IPPROTO_ST 7 /* Stream protocol II */
-#define IPPROTO_EGP 8 /* exterior gateway protocol */
-#define IPPROTO_PIGP 9 /* private interior gateway */
-#define IPPROTO_RCCMON 10 /* BBN RCC Monitoring */
-#define IPPROTO_NVPII 11 /* network voice protocol*/
-#define IPPROTO_PUP 12 /* pup */
-#define IPPROTO_ARGUS 13 /* Argus */
-#define IPPROTO_EMCON 14 /* EMCON */
-#define IPPROTO_XNET 15 /* Cross Net Debugger */
-#define IPPROTO_CHAOS 16 /* Chaos*/
-#define IPPROTO_UDP 17 /* user datagram protocol */
-#define IPPROTO_MUX 18 /* Multiplexing */
-#define IPPROTO_MEAS 19 /* DCN Measurement Subsystems */
-#define IPPROTO_HMP 20 /* Host Monitoring */
-#define IPPROTO_PRM 21 /* Packet Radio Measurement */
-#define IPPROTO_IDP 22 /* xns idp */
-#define IPPROTO_TRUNK1 23 /* Trunk-1 */
-#define IPPROTO_TRUNK2 24 /* Trunk-2 */
-#define IPPROTO_LEAF1 25 /* Leaf-1 */
-#define IPPROTO_LEAF2 26 /* Leaf-2 */
-#define IPPROTO_RDP 27 /* Reliable Data */
-#define IPPROTO_IRTP 28 /* Reliable Transaction */
-#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */
-#define IPPROTO_BLT 30 /* Bulk Data Transfer */
-#define IPPROTO_NSP 31 /* Network Services */
-#define IPPROTO_INP 32 /* Merit Internodal */
-#define IPPROTO_SEP 33 /* Sequential Exchange */
-#define IPPROTO_3PC 34 /* Third Party Connect */
-#define IPPROTO_IDPR 35 /* InterDomain Policy Routing */
-#define IPPROTO_XTP 36 /* XTP */
-#define IPPROTO_DDP 37 /* Datagram Delivery */
-#define IPPROTO_CMTP 38 /* Control Message Transport */
-#define IPPROTO_TPXX 39 /* TP++ Transport */
-#define IPPROTO_IL 40 /* IL transport protocol */
-#define IPPROTO_SIP 41 /* Simple Internet Protocol */
-#define IPPROTO_SDRP 42 /* Source Demand Routing */
-#define IPPROTO_SIPSR 43 /* SIP Source Route */
-#define IPPROTO_SIPFRAG 44 /* SIP Fragment */
-#define IPPROTO_IDRP 45 /* InterDomain Routing*/
-#define IPPROTO_RSVP 46 /* resource reservation */
-#define IPPROTO_GRE 47 /* General Routing Encap. */
-#define IPPROTO_MHRP 48 /* Mobile Host Routing */
-#define IPPROTO_BHA 49 /* BHA */
-#define IPPROTO_ESP 50 /* SIPP Encap Sec. Payload */
-#define IPPROTO_AH 51 /* SIPP Auth Header */
-#define IPPROTO_INLSP 52 /* Integ. Net Layer Security */
-#define IPPROTO_SWIPE 53 /* IP with encryption */
-#define IPPROTO_NHRP 54 /* Next Hop Resolution */
-/* 55-60: Unassigned */
-#define IPPROTO_AHIP 61 /* any host internal protocol */
-#define IPPROTO_CFTP 62 /* CFTP */
-#define IPPROTO_HELLO 63 /* "hello" routing protocol */
-#define IPPROTO_SATEXPAK 64 /* SATNET/Backroom EXPAK */
-#define IPPROTO_KRYPTOLAN 65 /* Kryptolan */
-#define IPPROTO_RVD 66 /* Remote Virtual Disk */
-#define IPPROTO_IPPC 67 /* Pluribus Packet Core */
-#define IPPROTO_ADFS 68 /* Any distributed FS */
-#define IPPROTO_SATMON 69 /* Satnet Monitoring */
-#define IPPROTO_VISA 70 /* VISA Protocol */
-#define IPPROTO_IPCV 71 /* Packet Core Utility */
-#define IPPROTO_CPNX 72 /* Comp. Prot. Net. Executive */
-#define IPPROTO_CPHB 73 /* Comp. Prot. HeartBeat */
-#define IPPROTO_WSN 74 /* Wang Span Network */
-#define IPPROTO_PVP 75 /* Packet Video Protocol */
-#define IPPROTO_BRSATMON 76 /* BackRoom SATNET Monitoring */
-#define IPPROTO_ND 77 /* Sun net disk proto (temp.) */
-#define IPPROTO_WBMON 78 /* WIDEBAND Monitoring */
-#define IPPROTO_WBEXPAK 79 /* WIDEBAND EXPAK */
-#define IPPROTO_EON 80 /* ISO cnlp */
-#define IPPROTO_VMTP 81 /* VMTP */
-#define IPPROTO_SVMTP 82 /* Secure VMTP */
-#define IPPROTO_VINES 83 /* Banyon VINES */
-#define IPPROTO_TTP 84 /* TTP */
-#define IPPROTO_IGP 85 /* NSFNET-IGP */
-#define IPPROTO_DGP 86 /* dissimilar gateway prot. */
-#define IPPROTO_TCF 87 /* TCF */
-#define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */
-#define IPPROTO_OSPFIGP 89 /* OSPFIGP */
-#define IPPROTO_SRPC 90 /* Strite RPC protocol */
-#define IPPROTO_LARP 91 /* Locus Address Resoloution */
-#define IPPROTO_MTP 92 /* Multicast Transport */
-#define IPPROTO_AX25 93 /* AX.25 Frames */
-#define IPPROTO_IPEIP 94 /* IP encapsulated in IP */
-#define IPPROTO_MICP 95 /* Mobile Int.ing control */
-#define IPPROTO_SCCSP 96 /* Semaphore Comm. security */
-#define IPPROTO_ETHERIP 97 /* Ethernet IP encapsulation */
-#define IPPROTO_ENCAP 98 /* encapsulation header */
-#define IPPROTO_APES 99 /* any private encr. scheme */
-#define IPPROTO_GMTP 100 /* GMTP*/
-/* 101-254: Unassigned */
-/* 255: Reserved */
-/* BSD Private, local use, namespace incursion */
-#define IPPROTO_DIVERT 254 /* divert pseudo-protocol */
-#define IPPROTO_RAW 255 /* raw IP packet */
-#define IPPROTO_MAX 256
-
-
-/*
- * Local port number conventions:
- *
- * When a user does a bind(2) or connect(2) with a port number of zero,
- * a non-conflicting local port address is chosen.
- * The default range is IPPORT_RESERVED through
- * IPPORT_USERRESERVED, although that is settable by sysctl.
- *
- * A user may set the IPPROTO_IP option IP_PORTRANGE to change this
- * default assignment range.
- *
- * The value IP_PORTRANGE_DEFAULT causes the default behavior.
- *
- * The value IP_PORTRANGE_HIGH changes the range of candidate port numbers
- * into the "high" range. These are reserved for client outbound connections
- * which do not want to be filtered by any firewalls.
- *
- * The value IP_PORTRANGE_LOW changes the range to the "low" are
- * that is (by convention) restricted to privileged processes. This
- * convention is based on "vouchsafe" principles only. It is only secure
- * if you trust the remote host to restrict these ports.
- *
- * The default range of ports and the high range can be changed by
- * sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto)
- *
- * Changing those values has bad security implications if you are
- * using a a stateless firewall that is allowing packets outside of that
- * range in order to allow transparent outgoing connections.
- *
- * Such a firewall configuration will generally depend on the use of these
- * default values. If you change them, you may find your Security
- * Administrator looking for you with a heavy object.
- */
-
-/*
- * Ports < IPPORT_RESERVED are reserved for
- * privileged processes (e.g. root). (IP_PORTRANGE_LOW)
- * Ports > IPPORT_USERRESERVED are reserved
- * for servers, not necessarily privileged. (IP_PORTRANGE_DEFAULT)
- */
-#define IPPORT_RESERVED 1024
-#define IPPORT_USERRESERVED 5000
-
-/*
- * Default local port range to use by setting IP_PORTRANGE_HIGH
- */
-#define IPPORT_HIFIRSTAUTO 40000
-#define IPPORT_HILASTAUTO 44999
-
-/*
- * Scanning for a free reserved port return a value below IPPORT_RESERVED,
- * but higher than IPPORT_RESERVEDSTART. Traditionally the start value was
- * 512, but that conflicts with some well-known-services that firewalls may
- * have a fit if we use.
- */
-#define IPPORT_RESERVEDSTART 600
-
-/*
- * Internet address (a structure for historical reasons)
- */
-struct in_addr {
- u_long s_addr;
-};
-
-/*
- * Definitions of bits in internet address integers.
- * On subnets, the decomposition of addresses to host and net parts
- * is done according to subnet mask, not the masks here.
- */
-#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0)
-#define IN_CLASSA_NET 0xff000000
-#define IN_CLASSA_NSHIFT 24
-#define IN_CLASSA_HOST 0x00ffffff
-#define IN_CLASSA_MAX 128
-
-#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000)
-#define IN_CLASSB_NET 0xffff0000
-#define IN_CLASSB_NSHIFT 16
-#define IN_CLASSB_HOST 0x0000ffff
-#define IN_CLASSB_MAX 65536
-
-#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000)
-#define IN_CLASSC_NET 0xffffff00
-#define IN_CLASSC_NSHIFT 8
-#define IN_CLASSC_HOST 0x000000ff
-
-#define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000)
-#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */
-#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */
-#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */
-#define IN_MULTICAST(i) IN_CLASSD(i)
-
-#define IN_EXPERIMENTAL(i) (((long)(i) & 0xf0000000) == 0xf0000000)
-#define IN_BADCLASS(i) (((long)(i) & 0xf0000000) == 0xf0000000)
-
-#define INADDR_ANY (u_long)0x00000000
-#define INADDR_BROADCAST (u_long)0xffffffff /* must be masked */
-#ifndef KERNEL
-#define INADDR_NONE 0xffffffff /* -1 return */
-#endif
-
-#define INADDR_UNSPEC_GROUP (u_long)0xe0000000 /* 224.0.0.0 */
-#define INADDR_ALLHOSTS_GROUP (u_long)0xe0000001 /* 224.0.0.1 */
-#define INADDR_ALLRTRS_GROUP (u_long)0xe0000002 /* 224.0.0.2 */
-#define INADDR_MAX_LOCAL_GROUP (u_long)0xe00000ff /* 224.0.0.255 */
-
-#define IN_LOOPBACKNET 127 /* official! */
-
-/*
- * Socket address, internet style.
- */
-struct sockaddr_in {
- u_char sin_len;
- u_char sin_family;
- u_short sin_port;
- struct in_addr sin_addr;
- char sin_zero[8];
-};
-
-/*
- * Structure used to describe IP options.
- * Used to store options internally, to pass them to a process,
- * or to restore options retrieved earlier.
- * The ip_dst is used for the first-hop gateway when using a source route
- * (this gets put into the header proper).
- */
-struct ip_opts {
- struct in_addr ip_dst; /* first hop, 0 w/o src rt */
- char ip_opts[40]; /* actually variable in size */
-};
-
-/*
- * Options for use with [gs]etsockopt at the IP level.
- * First word of comment is data type; bool is stored in int.
- */
-#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */
-#define IP_HDRINCL 2 /* int; header is included with data */
-#define IP_TOS 3 /* int; IP type of service and preced. */
-#define IP_TTL 4 /* int; IP time to live */
-#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */
-#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */
-#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */
-#define IP_RETOPTS 8 /* ip_opts; set/get IP options */
-#define IP_MULTICAST_IF 9 /* u_char; set/get IP multicast i/f */
-#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
-#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */
-#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */
-#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */
-#define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */
-#define IP_RSVP_ON 15 /* enable RSVP in kernel */
-#define IP_RSVP_OFF 16 /* disable RSVP in kernel */
-#define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */
-#define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */
-#define IP_PORTRANGE 19 /* int; range to choose for unspec port */
-#define IP_RECVIF 20 /* bool; receive reception if w/dgram */
-
-#define IP_FW_ADD 50 /* add a firewall rule to chain */
-#define IP_FW_DEL 51 /* delete a firewall rule from chain */
-#define IP_FW_FLUSH 52 /* flush firewall rule chain */
-#define IP_FW_ZERO 53 /* clear single/all firewall counter(s) */
-#define IP_FW_GET 54 /* get entire firewall rule chain */
-#define IP_NAT 55 /* set/get NAT opts */
-
-/*
- * Defaults and limits for options
- */
-#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
-#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
-#define IP_MAX_MEMBERSHIPS 20 /* per socket */
-
-/*
- * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
- */
-struct ip_mreq {
- struct in_addr imr_multiaddr; /* IP multicast address of group */
- struct in_addr imr_interface; /* local IP address of interface */
-};
-
-/*
- * Argument for IP_PORTRANGE:
- * - which range to search when port is unspecified at bind() or connect()
- */
-#define IP_PORTRANGE_DEFAULT 0 /* default range */
-#define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
-#define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
-
-/*
- * Definitions for inet sysctl operations.
- *
- * Third level is protocol number.
- * Fourth level is desired variable within that protocol.
- */
-#define IPPROTO_MAXID (IPPROTO_IDP + 1) /* don't list to IPPROTO_MAX */
-
-#define CTL_IPPROTO_NAMES { \
- { "ip", CTLTYPE_NODE }, \
- { "icmp", CTLTYPE_NODE }, \
- { "igmp", CTLTYPE_NODE }, \
- { "ggp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "tcp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { "egp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "pup", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "udp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "idp", CTLTYPE_NODE }, \
-}
-
-/*
- * Names for IP sysctl objects
- */
-#define IPCTL_FORWARDING 1 /* act as router */
-#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */
-#define IPCTL_DEFTTL 3 /* default TTL */
-#ifdef notyet
-#define IPCTL_DEFMTU 4 /* default MTU */
-#endif
-#define IPCTL_RTEXPIRE 5 /* cloned route expiration time */
-#define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */
-#define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */
-#define IPCTL_SOURCEROUTE 8 /* may perform source routes */
-#define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */
-#define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */
-#define IPCTL_INTRQDROPS 11 /* number of netisr q drops */
-#define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */
-#define IPCTL_MAXID 13
-
-#define IPCTL_NAMES { \
- { 0, 0 }, \
- { "forwarding", CTLTYPE_INT }, \
- { "redirect", CTLTYPE_INT }, \
- { "ttl", CTLTYPE_INT }, \
- { "mtu", CTLTYPE_INT }, \
- { "rtexpire", CTLTYPE_INT }, \
- { "rtminexpire", CTLTYPE_INT }, \
- { "rtmaxcache", CTLTYPE_INT }, \
- { "sourceroute", CTLTYPE_INT }, \
- { "directed-broadcast", CTLTYPE_INT }, \
- { "intr-queue-maxlen", CTLTYPE_INT }, \
- { "intr-queue-drops", CTLTYPE_INT }, \
- { "accept_sourceroute", CTLTYPE_INT }, \
-}
-
-
-#ifdef KERNEL
-struct ifnet; struct mbuf; /* forward declarations for Standard C */
-
-int in_broadcast __P((struct in_addr, struct ifnet *));
-int in_canforward __P((struct in_addr));
-int in_cksum __P((struct mbuf *, int));
-int in_localaddr __P((struct in_addr));
-char *inet_ntoa __P((struct in_addr)); /* in libkern */
-
-/* Firewall hooks */
-struct ip;
-typedef int ip_fw_chk_t __P((struct ip**, int, struct ifnet*, int, struct mbuf**));
-typedef int ip_fw_ctl_t __P((int, struct mbuf**));
-extern ip_fw_chk_t *ip_fw_chk_ptr;
-extern ip_fw_ctl_t *ip_fw_ctl_ptr;
-
-/* IP NAT hooks */
-typedef int ip_nat_t __P((struct ip**, struct mbuf**, struct ifnet*, int));
-typedef int ip_nat_ctl_t __P((int, struct mbuf**));
-extern ip_nat_t *ip_nat_ptr;
-extern ip_nat_ctl_t *ip_nat_ctl_ptr;
-#define IP_NAT_IN 0x00000001
-#define IP_NAT_OUT 0x00000002
-
-#endif /* KERNEL */
-
-#endif
diff --git a/c/src/libnetworking/netinet/in_cksum.c b/c/src/libnetworking/netinet/in_cksum.c
deleted file mode 100644
index 9cffad3221..0000000000
--- a/c/src/libnetworking/netinet/in_cksum.c
+++ /dev/null
@@ -1,166 +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 <sys/param.h>
-#include <sys/mbuf.h>
-
-/*
- * Try to use a CPU specific version, then punt to the portable C one.
- */
-
-#if (defined(__GNUC__) && (defined(__mc68000__) || defined(__m68k__)))
-
-#include "in_cksum_m68k.c"
-
-#elif (defined(__GNUC__) && defined(__i386__))
-
-#include "in_cksum_i386.c"
-
-#else
-
-/*
- * Checksum routine for Internet Protocol family headers (Portable Version).
- *
- * This routine is very heavily used in the network
- * code and should be modified for each CPU to be as fast as possible.
- */
-
-#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
-#define REDUCE \
- {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);}
-
-int
-in_cksum(m, len)
- register struct mbuf *m;
- register int len;
-{
- register u_short *w;
- register int sum = 0;
- register int mlen = 0;
- int byte_swapped = 0;
-
- union {
- char c[2];
- u_short s;
- } s_util;
- union {
- u_short s[2];
- long l;
- } l_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 even boundary.
- */
- if ((1 & (int) w) && (mlen > 0)) {
- REDUCE;
- sum <<= 8;
- s_util.c[0] = *(u_char *)w;
- w = (u_short *)((char *)w + 1);
- mlen--;
- byte_swapped = 1;
- }
- /*
- * Unroll the loop to make overhead from
- * branches &c small.
- */
- while ((mlen -= 32) >= 0) {
- sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
- sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7];
- sum += w[8]; sum += w[9]; sum += w[10]; sum += w[11];
- sum += w[12]; sum += w[13]; sum += w[14]; sum += w[15];
- w += 16;
- }
- mlen += 32;
- while ((mlen -= 8) >= 0) {
- sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
- w += 4;
- }
- mlen += 8;
- if (mlen == 0 && byte_swapped == 0)
- continue;
- REDUCE;
- 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)
- printf("cksum: out of data\n");
- 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);
-}
-#endif
diff --git a/c/src/libnetworking/netinet/in_cksum_i386.c b/c/src/libnetworking/netinet/in_cksum_i386.c
deleted file mode 100644
index 2057ab3fd6..0000000000
--- a/c/src/libnetworking/netinet/in_cksum_i386.c
+++ /dev/null
@@ -1,198 +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$
- */
-
-#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("addl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (w))
-#define ADDC(n) asm("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("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)
- printf("cksum: out of data\n");
- 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/c/src/libnetworking/netinet/in_cksum_m68k.c b/c/src/libnetworking/netinet/in_cksum_m68k.c
deleted file mode 100644
index 58199c3adf..0000000000
--- a/c/src/libnetworking/netinet/in_cksum_m68k.c
+++ /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 <sys/param.h>
-#include <sys/mbuf.h>
-
-#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/c/src/libnetworking/netinet/in_pcb.c b/c/src/libnetworking/netinet/in_pcb.c
deleted file mode 100644
index 116f70eebf..0000000000
--- a/c/src/libnetworking/netinet/in_pcb.c
+++ /dev/null
@@ -1,757 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1991, 1993, 1995
- * 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_pcb.c 8.4 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/proc.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-
-struct in_addr zeroin_addr;
-
-static void in_pcbinshash __P((struct inpcb *));
-static void in_rtchange __P((struct inpcb *, int));
-
-/*
- * These configure the range of local port addresses assigned to
- * "unspecified" outgoing connections/packets/whatever.
- */
-static int ipport_lowfirstauto = IPPORT_RESERVED - 1; /* 1023 */
-static int ipport_lowlastauto = IPPORT_RESERVEDSTART; /* 600 */
-static int ipport_firstauto = IPPORT_RESERVED; /* 1024 */
-static int ipport_lastauto = IPPORT_USERRESERVED; /* 5000 */
-static int ipport_hifirstauto = IPPORT_HIFIRSTAUTO; /* 40000 */
-static int ipport_hilastauto = IPPORT_HILASTAUTO; /* 44999 */
-
-#define RANGECHK(var, min, max) \
- if ((var) < (min)) { (var) = (min); } \
- else if ((var) > (max)) { (var) = (max); }
-
-#if 0
-static int
-sysctl_net_ipport_check SYSCTL_HANDLER_ARGS
-{
- int error = sysctl_handle_int(oidp,
- oidp->oid_arg1, oidp->oid_arg2, req);
- if (!error) {
- RANGECHK(ipport_lowfirstauto, 1, IPPORT_RESERVED - 1);
- RANGECHK(ipport_lowlastauto, 1, IPPORT_RESERVED - 1);
- RANGECHK(ipport_firstauto, IPPORT_RESERVED, USHRT_MAX);
- RANGECHK(ipport_lastauto, IPPORT_RESERVED, USHRT_MAX);
- RANGECHK(ipport_hifirstauto, IPPORT_RESERVED, USHRT_MAX);
- RANGECHK(ipport_hilastauto, IPPORT_RESERVED, USHRT_MAX);
- }
- return error;
-}
-#endif
-
-#undef RANGECHK
-
-SYSCTL_NODE(_net_inet_ip, IPPROTO_IP, portrange, CTLFLAG_RW, 0, "IP Ports");
-
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, lowfirst, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_lowfirstauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, lowlast, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_lowlastauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, first, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_firstauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, last, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_lastauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, hifirst, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_hifirstauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, hilast, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_hilastauto, 0, &sysctl_net_ipport_check, "I", "");
-
-int
-in_pcballoc(so, pcbinfo)
- struct socket *so;
- struct inpcbinfo *pcbinfo;
-{
- register struct inpcb *inp;
- int s;
-
- MALLOC(inp, struct inpcb *, sizeof(*inp), M_PCB, M_NOWAIT);
- if (inp == NULL)
- return (ENOBUFS);
- bzero((caddr_t)inp, sizeof(*inp));
- inp->inp_pcbinfo = pcbinfo;
- inp->inp_socket = so;
- s = splnet();
- LIST_INSERT_HEAD(pcbinfo->listhead, inp, inp_list);
- in_pcbinshash(inp);
- splx(s);
- so->so_pcb = (caddr_t)inp;
- return (0);
-}
-
-int
-in_pcbbind(inp, nam)
- register struct inpcb *inp;
- struct mbuf *nam;
-{
- register struct socket *so = inp->inp_socket;
- unsigned short *lastport;
- struct sockaddr_in *sin;
- u_short lport = 0;
- int wild = 0, reuseport = (so->so_options & SO_REUSEPORT);
- int error;
-
- if (in_ifaddr == 0)
- return (EADDRNOTAVAIL);
- if (inp->inp_lport || inp->inp_laddr.s_addr != INADDR_ANY)
- return (EINVAL);
- if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0 &&
- ((so->so_proto->pr_flags & PR_CONNREQUIRED) == 0 ||
- (so->so_options & SO_ACCEPTCONN) == 0))
- wild = 1;
- if (nam) {
- sin = mtod(nam, struct sockaddr_in *);
- if (nam->m_len != sizeof (*sin))
- return (EINVAL);
-#ifdef notdef
- /*
- * We should check the family, but old programs
- * incorrectly fail to initialize it.
- */
- if (sin->sin_family != AF_INET)
- return (EAFNOSUPPORT);
-#endif
- lport = sin->sin_port;
- if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) {
- /*
- * Treat SO_REUSEADDR as SO_REUSEPORT for multicast;
- * allow complete duplication of binding if
- * SO_REUSEPORT is set, or if SO_REUSEADDR is set
- * and a multicast address is bound on both
- * new and duplicated sockets.
- */
- if (so->so_options & SO_REUSEADDR)
- reuseport = SO_REUSEADDR|SO_REUSEPORT;
- } else if (sin->sin_addr.s_addr != INADDR_ANY) {
- sin->sin_port = 0; /* yech... */
- if (ifa_ifwithaddr((struct sockaddr *)sin) == 0)
- return (EADDRNOTAVAIL);
- }
- if (lport) {
- struct inpcb *t;
-
- /* GROSS */
- if (ntohs(lport) < IPPORT_RESERVED &&
- (error = suser(p->p_ucred, &p->p_acflag)))
- return (EACCES);
- if (so->so_uid) {
- t = in_pcblookup(inp->inp_pcbinfo, zeroin_addr,
- 0, sin->sin_addr, lport,
- INPLOOKUP_WILDCARD);
- if (t && (so->so_uid != t->inp_socket->so_uid))
- return (EADDRINUSE);
- }
- t = in_pcblookup(inp->inp_pcbinfo, zeroin_addr, 0,
- sin->sin_addr, lport, wild);
- if (t && (reuseport & t->inp_socket->so_options) == 0)
- return (EADDRINUSE);
- }
- inp->inp_laddr = sin->sin_addr;
- }
- if (lport == 0) {
- ushort first, last;
- int count;
-
- inp->inp_flags |= INP_ANONPORT;
-
- if (inp->inp_flags & INP_HIGHPORT) {
- first = ipport_hifirstauto; /* sysctl */
- last = ipport_hilastauto;
- lastport = &inp->inp_pcbinfo->lasthi;
- } else if (inp->inp_flags & INP_LOWPORT) {
- if ((error = suser(p->p_ucred, &p->p_acflag)))
- return (EACCES);
- first = ipport_lowfirstauto; /* 1023 */
- last = ipport_lowlastauto; /* 600 */
- lastport = &inp->inp_pcbinfo->lastlow;
- } else {
- first = ipport_firstauto; /* sysctl */
- last = ipport_lastauto;
- lastport = &inp->inp_pcbinfo->lastport;
- }
- /*
- * Simple check to ensure all ports are not used up causing
- * a deadlock here.
- *
- * We split the two cases (up and down) so that the direction
- * is not being tested on each round of the loop.
- */
- if (first > last) {
- /*
- * counting down
- */
- count = first - last;
-
- do {
- if (count-- <= 0) /* completely used? */
- return (EADDRNOTAVAIL);
- --*lastport;
- if (*lastport > first || *lastport < last)
- *lastport = first;
- lport = htons(*lastport);
- } while (in_pcblookup(inp->inp_pcbinfo,
- zeroin_addr, 0, inp->inp_laddr, lport, wild));
- } else {
- /*
- * counting up
- */
- count = last - first;
-
- do {
- if (count-- <= 0) /* completely used? */
- return (EADDRNOTAVAIL);
- ++*lastport;
- if (*lastport < first || *lastport > last)
- *lastport = first;
- lport = htons(*lastport);
- } while (in_pcblookup(inp->inp_pcbinfo,
- zeroin_addr, 0, inp->inp_laddr, lport, wild));
- }
- }
- inp->inp_lport = lport;
- in_pcbrehash(inp);
- return (0);
-}
-
-/*
- * Transform old in_pcbconnect() into an inner subroutine for new
- * in_pcbconnect(): Do some validity-checking on the remote
- * address (in mbuf 'nam') and then determine local host address
- * (i.e., which interface) to use to access that remote host.
- *
- * This preserves definition of in_pcbconnect(), while supporting a
- * slightly different version for T/TCP. (This is more than
- * a bit of a kludge, but cleaning up the internal interfaces would
- * have forced minor changes in every protocol).
- */
-
-int
-in_pcbladdr(inp, nam, plocal_sin)
- register struct inpcb *inp;
- struct mbuf *nam;
- struct sockaddr_in **plocal_sin;
-{
- struct in_ifaddr *ia;
- register struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *);
-
- if (nam->m_len != sizeof (*sin))
- return (EINVAL);
- if (sin->sin_family != AF_INET)
- return (EAFNOSUPPORT);
- if (sin->sin_port == 0)
- return (EADDRNOTAVAIL);
- if (in_ifaddr) {
- /*
- * If the destination address is INADDR_ANY,
- * use the primary local address.
- * If the supplied address is INADDR_BROADCAST,
- * and the primary interface supports broadcast,
- * choose the broadcast address for that interface.
- */
-#define satosin(sa) ((struct sockaddr_in *)(sa))
-#define sintosa(sin) ((struct sockaddr *)(sin))
-#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
- if (sin->sin_addr.s_addr == INADDR_ANY)
- sin->sin_addr = IA_SIN(in_ifaddr)->sin_addr;
- else if (sin->sin_addr.s_addr == (u_long)INADDR_BROADCAST &&
- (in_ifaddr->ia_ifp->if_flags & IFF_BROADCAST))
- sin->sin_addr = satosin(&in_ifaddr->ia_broadaddr)->sin_addr;
- }
- if (inp->inp_laddr.s_addr == INADDR_ANY) {
- register struct route *ro;
-
- ia = (struct in_ifaddr *)0;
- /*
- * If route is known or can be allocated now,
- * our src addr is taken from the i/f, else punt.
- */
- ro = &inp->inp_route;
- if (ro->ro_rt &&
- (satosin(&ro->ro_dst)->sin_addr.s_addr !=
- sin->sin_addr.s_addr ||
- inp->inp_socket->so_options & SO_DONTROUTE)) {
- RTFREE(ro->ro_rt);
- ro->ro_rt = (struct rtentry *)0;
- }
- if ((inp->inp_socket->so_options & SO_DONTROUTE) == 0 && /*XXX*/
- (ro->ro_rt == (struct rtentry *)0 ||
- ro->ro_rt->rt_ifp == (struct ifnet *)0)) {
- /* No route yet, so try to acquire one */
- ro->ro_dst.sa_family = AF_INET;
- ro->ro_dst.sa_len = sizeof(struct sockaddr_in);
- ((struct sockaddr_in *) &ro->ro_dst)->sin_addr =
- sin->sin_addr;
- rtalloc(ro);
- }
- /*
- * If we found a route, use the address
- * corresponding to the outgoing interface
- * unless it is the loopback (in case a route
- * to our address on another net goes to loopback).
- */
- if (ro->ro_rt && !(ro->ro_rt->rt_ifp->if_flags & IFF_LOOPBACK))
- ia = ifatoia(ro->ro_rt->rt_ifa);
- if (ia == 0) {
- u_short fport = sin->sin_port;
-
- sin->sin_port = 0;
- ia = ifatoia(ifa_ifwithdstaddr(sintosa(sin)));
- if (ia == 0)
- ia = ifatoia(ifa_ifwithnet(sintosa(sin)));
- sin->sin_port = fport;
- if (ia == 0)
- ia = in_ifaddr;
- if (ia == 0)
- return (EADDRNOTAVAIL);
- }
- /*
- * If the destination address is multicast and an outgoing
- * interface has been set as a multicast option, use the
- * address of that interface as our source address.
- */
- if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr)) &&
- inp->inp_moptions != NULL) {
- struct ip_moptions *imo;
- struct ifnet *ifp;
-
- imo = inp->inp_moptions;
- if (imo->imo_multicast_ifp != NULL) {
- ifp = imo->imo_multicast_ifp;
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if (ia->ia_ifp == ifp)
- break;
- if (ia == 0)
- return (EADDRNOTAVAIL);
- }
- }
- /*
- * Don't do pcblookup call here; return interface in plocal_sin
- * and exit to caller, that will do the lookup.
- */
- *plocal_sin = &ia->ia_addr;
-
- }
- return(0);
-}
-
-/*
- * Outer subroutine:
- * Connect from a socket to a specified address.
- * Both address and port must be specified in argument sin.
- * If don't have a local address for this socket yet,
- * then pick one.
- */
-int
-in_pcbconnect(inp, nam)
- register struct inpcb *inp;
- struct mbuf *nam;
-{
- struct sockaddr_in *ifaddr;
- register struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *);
- int error;
-
- /*
- * Call inner routine, to assign local interface address.
- */
- if ((error = in_pcbladdr(inp, nam, &ifaddr)))
- return(error);
-
- if (in_pcblookuphash(inp->inp_pcbinfo, sin->sin_addr, sin->sin_port,
- inp->inp_laddr.s_addr ? inp->inp_laddr : ifaddr->sin_addr,
- inp->inp_lport, 0) != NULL)
- return (EADDRINUSE);
- if (inp->inp_laddr.s_addr == INADDR_ANY) {
- if (inp->inp_lport == 0)
- (void)in_pcbbind(inp, (struct mbuf *)0);
- inp->inp_laddr = ifaddr->sin_addr;
- }
- inp->inp_faddr = sin->sin_addr;
- inp->inp_fport = sin->sin_port;
- in_pcbrehash(inp);
- return (0);
-}
-
-void
-in_pcbdisconnect(inp)
- struct inpcb *inp;
-{
-
- inp->inp_faddr.s_addr = INADDR_ANY;
- inp->inp_fport = 0;
- in_pcbrehash(inp);
- if (inp->inp_socket->so_state & SS_NOFDREF)
- in_pcbdetach(inp);
-}
-
-void
-in_pcbdetach(inp)
- struct inpcb *inp;
-{
- struct socket *so = inp->inp_socket;
- int s;
-
- so->so_pcb = 0;
- sofree(so);
- if (inp->inp_options)
- (void)m_free(inp->inp_options);
- if (inp->inp_route.ro_rt)
- rtfree(inp->inp_route.ro_rt);
- ip_freemoptions(inp->inp_moptions);
- s = splnet();
- LIST_REMOVE(inp, inp_hash);
- LIST_REMOVE(inp, inp_list);
- splx(s);
- FREE(inp, M_PCB);
-}
-
-void
-in_setsockaddr(inp, nam)
- register struct inpcb *inp;
- struct mbuf *nam;
-{
- register struct sockaddr_in *sin;
-
- nam->m_len = sizeof (*sin);
- sin = mtod(nam, struct sockaddr_in *);
- bzero((caddr_t)sin, sizeof (*sin));
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_port = inp->inp_lport;
- sin->sin_addr = inp->inp_laddr;
-}
-
-void
-in_setpeeraddr(inp, nam)
- struct inpcb *inp;
- struct mbuf *nam;
-{
- register struct sockaddr_in *sin;
-
- nam->m_len = sizeof (*sin);
- sin = mtod(nam, struct sockaddr_in *);
- bzero((caddr_t)sin, sizeof (*sin));
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_port = inp->inp_fport;
- sin->sin_addr = inp->inp_faddr;
-}
-
-/*
- * Pass some notification to all connections of a protocol
- * associated with address dst. The local address and/or port numbers
- * may be specified to limit the search. The "usual action" will be
- * taken, depending on the ctlinput cmd. The caller must filter any
- * cmds that are uninteresting (e.g., no error in the map).
- * Call the protocol specific routine (if any) to report
- * any errors for each matching socket.
- *
- * Must be called at splnet.
- */
-void
-in_pcbnotify(head, dst, fport_arg, laddr, lport_arg, cmd, notify)
- struct inpcbhead *head;
- struct sockaddr *dst;
- u_int fport_arg, lport_arg;
- struct in_addr laddr;
- int cmd;
- void (*notify) __P((struct inpcb *, int));
-{
- register struct inpcb *inp, *oinp;
- struct in_addr faddr;
- u_short fport = fport_arg, lport = lport_arg;
- int errnum, s;
-
- if ((unsigned)cmd > PRC_NCMDS || dst->sa_family != AF_INET)
- return;
- faddr = ((struct sockaddr_in *)dst)->sin_addr;
- if (faddr.s_addr == INADDR_ANY)
- return;
-
- /*
- * Redirects go to all references to the destination,
- * and use in_rtchange to invalidate the route cache.
- * Dead host indications: notify all references to the destination.
- * Otherwise, if we have knowledge of the local port and address,
- * deliver only to that socket.
- */
- if (PRC_IS_REDIRECT(cmd) || cmd == PRC_HOSTDEAD) {
- fport = 0;
- lport = 0;
- laddr.s_addr = 0;
- if (cmd != PRC_HOSTDEAD)
- notify = in_rtchange;
- }
- errnum = inetctlerrmap[cmd];
- s = splnet();
- for (inp = head->lh_first; inp != NULL;) {
- if (inp->inp_faddr.s_addr != faddr.s_addr ||
- inp->inp_socket == 0 ||
- (lport && inp->inp_lport != lport) ||
- (laddr.s_addr && inp->inp_laddr.s_addr != laddr.s_addr) ||
- (fport && inp->inp_fport != fport)) {
- inp = inp->inp_list.le_next;
- continue;
- }
- oinp = inp;
- inp = inp->inp_list.le_next;
- if (notify)
- (*notify)(oinp, errnum);
- }
- splx(s);
-}
-
-/*
- * Check for alternatives when higher level complains
- * about service problems. For now, invalidate cached
- * routing information. If the route was created dynamically
- * (by a redirect), time to try a default gateway again.
- */
-void
-in_losing(inp)
- struct inpcb *inp;
-{
- register struct rtentry *rt;
- struct rt_addrinfo info;
-
- if ((rt = inp->inp_route.ro_rt)) {
- inp->inp_route.ro_rt = 0;
- bzero((caddr_t)&info, sizeof(info));
- info.rti_info[RTAX_DST] =
- (struct sockaddr *)&inp->inp_route.ro_dst;
- info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
- info.rti_info[RTAX_NETMASK] = rt_mask(rt);
- rt_missmsg(RTM_LOSING, &info, rt->rt_flags, 0);
- if (rt->rt_flags & RTF_DYNAMIC)
- (void) rtrequest(RTM_DELETE, rt_key(rt),
- rt->rt_gateway, rt_mask(rt), rt->rt_flags,
- (struct rtentry **)0);
- else
- /*
- * A new route can be allocated
- * the next time output is attempted.
- */
- rtfree(rt);
- }
-}
-
-/*
- * After a routing change, flush old routing
- * and allocate a (hopefully) better one.
- */
-static void
-in_rtchange(inp, errnum)
- register struct inpcb *inp;
- int errnum;
-{
- if (inp->inp_route.ro_rt) {
- rtfree(inp->inp_route.ro_rt);
- inp->inp_route.ro_rt = 0;
- /*
- * A new route can be allocated the next time
- * output is attempted.
- */
- }
-}
-
-struct inpcb *
-in_pcblookup(pcbinfo, faddr, fport_arg, laddr, lport_arg, wild_okay)
- struct inpcbinfo *pcbinfo;
- struct in_addr faddr, laddr;
- u_int fport_arg, lport_arg;
- int wild_okay;
-{
- register struct inpcb *inp, *match = NULL;
- int matchwild = 3, wildcard;
- u_short fport = fport_arg, lport = lport_arg;
- int s;
-
- s = splnet();
-
- for (inp = pcbinfo->listhead->lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_lport != lport)
- continue;
- wildcard = 0;
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- if (faddr.s_addr == INADDR_ANY)
- wildcard++;
- else if (inp->inp_faddr.s_addr != faddr.s_addr ||
- inp->inp_fport != fport)
- continue;
- } else {
- if (faddr.s_addr != INADDR_ANY)
- wildcard++;
- }
- if (inp->inp_laddr.s_addr != INADDR_ANY) {
- if (laddr.s_addr == INADDR_ANY)
- wildcard++;
- else if (inp->inp_laddr.s_addr != laddr.s_addr)
- continue;
- } else {
- if (laddr.s_addr != INADDR_ANY)
- wildcard++;
- }
- if (wildcard && wild_okay == 0)
- continue;
- if (wildcard < matchwild) {
- match = inp;
- matchwild = wildcard;
- if (matchwild == 0) {
- break;
- }
- }
- }
- splx(s);
- return (match);
-}
-
-/*
- * Lookup PCB in hash list.
- */
-struct inpcb *
-in_pcblookuphash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard)
- struct inpcbinfo *pcbinfo;
- struct in_addr faddr, laddr;
- u_int fport_arg, lport_arg;
- int wildcard;
-{
- struct inpcbhead *head;
- register struct inpcb *inp;
- u_short fport = fport_arg, lport = lport_arg;
- int s;
-
- s = splnet();
- /*
- * First look for an exact match.
- */
- head = &pcbinfo->hashbase[INP_PCBHASH(faddr.s_addr, lport, fport, pcbinfo->hashmask)];
- for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
- if (inp->inp_faddr.s_addr == faddr.s_addr &&
- inp->inp_laddr.s_addr == laddr.s_addr &&
- inp->inp_fport == fport &&
- inp->inp_lport == lport)
- goto found;
- }
- if (wildcard) {
- struct inpcb *local_wild = NULL;
-
- head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbinfo->hashmask)];
- for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
- if (inp->inp_faddr.s_addr == INADDR_ANY &&
- inp->inp_fport == 0 && inp->inp_lport == lport) {
- if (inp->inp_laddr.s_addr == laddr.s_addr)
- goto found;
- else if (inp->inp_laddr.s_addr == INADDR_ANY)
- local_wild = inp;
- }
- }
- if (local_wild != NULL) {
- inp = local_wild;
- goto found;
- }
- }
- splx(s);
- return (NULL);
-
-found:
- /*
- * Move PCB to head of this hash chain so that it can be
- * found more quickly in the future.
- * XXX - this is a pessimization on machines with few
- * concurrent connections.
- */
- if (inp != head->lh_first) {
- LIST_REMOVE(inp, inp_hash);
- LIST_INSERT_HEAD(head, inp, inp_hash);
- }
- splx(s);
- return (inp);
-}
-
-/*
- * Insert PCB into hash chain. Must be called at splnet.
- */
-static void
-in_pcbinshash(inp)
- struct inpcb *inp;
-{
- struct inpcbhead *head;
-
- head = &inp->inp_pcbinfo->hashbase[INP_PCBHASH(inp->inp_faddr.s_addr,
- inp->inp_lport, inp->inp_fport, inp->inp_pcbinfo->hashmask)];
-
- LIST_INSERT_HEAD(head, inp, inp_hash);
-}
-
-void
-in_pcbrehash(inp)
- struct inpcb *inp;
-{
- struct inpcbhead *head;
- int s;
-
- s = splnet();
- LIST_REMOVE(inp, inp_hash);
-
- head = &inp->inp_pcbinfo->hashbase[INP_PCBHASH(inp->inp_faddr.s_addr,
- inp->inp_lport, inp->inp_fport, inp->inp_pcbinfo->hashmask)];
-
- LIST_INSERT_HEAD(head, inp, inp_hash);
- splx(s);
-}
diff --git a/c/src/libnetworking/netinet/in_pcb.h b/c/src/libnetworking/netinet/in_pcb.h
deleted file mode 100644
index 9390cfda6c..0000000000
--- a/c/src/libnetworking/netinet/in_pcb.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1990, 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_pcb.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IN_PCB_H_
-#define _NETINET_IN_PCB_H_
-
-#include <sys/queue.h>
-
-/*
- * Common structure pcb for internet protocol implementation.
- * Here are stored pointers to local and foreign host table
- * entries, local and foreign socket numbers, and pointers
- * up (to a socket structure) and down (to a protocol-specific)
- * control block.
- */
-LIST_HEAD(inpcbhead, inpcb);
-
-struct inpcb {
- LIST_ENTRY(inpcb) inp_list; /* list for all PCBs of this proto */
- LIST_ENTRY(inpcb) inp_hash; /* hash list */
- struct inpcbinfo *inp_pcbinfo; /* PCB list info */
- struct in_addr inp_faddr; /* foreign host table entry */
- struct in_addr inp_laddr; /* local host table entry */
- u_short inp_fport; /* foreign port */
- u_short inp_lport; /* local port */
- caddr_t inp_ppcb; /* pointer to per-protocol pcb */
- struct socket *inp_socket; /* back pointer to socket */
- struct mbuf *inp_options; /* IP options */
- struct route inp_route; /* placeholder for routing entry */
- int inp_flags; /* generic IP/datagram flags */
- u_char inp_ip_tos; /* type of service proto */
- u_char inp_ip_ttl; /* time to live proto */
- u_char inp_ip_p; /* protocol proto */
- u_char pad[1]; /* alignment */
- struct ip_moptions *inp_moptions; /* IP multicast options */
-#if 0 /* Someday, perhaps... */
- struct ip inp_ip; /* header prototype; should have more */
-#endif
-};
-
-struct inpcbinfo {
- struct inpcbhead *listhead;
- struct inpcbhead *hashbase;
- unsigned long hashmask;
- unsigned short lastport;
- unsigned short lastlow;
- unsigned short lasthi;
-};
-
-#define INP_PCBHASH(faddr, lport, fport, mask) \
- (((faddr) ^ ((faddr) >> 16) ^ (lport) ^ (fport)) & (mask))
-
-/* flags in inp_flags: */
-#define INP_RECVOPTS 0x01 /* receive incoming IP options */
-#define INP_RECVRETOPTS 0x02 /* receive IP options for reply */
-#define INP_RECVDSTADDR 0x04 /* receive IP dst address */
-#define INP_HDRINCL 0x08 /* user supplies entire IP header */
-#define INP_HIGHPORT 0x10 /* user wants "high" port binding */
-#define INP_LOWPORT 0x20 /* user wants "low" port binding */
-#define INP_ANONPORT 0x40 /* port chosen for user */
-#define INP_RECVIF 0x80 /* receive incoming interface */
-#define INP_CONTROLOPTS (INP_RECVOPTS|INP_RECVRETOPTS|INP_RECVDSTADDR|\
- INP_RECVIF)
-
-#define INPLOOKUP_WILDCARD 1
-
-#define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb)
-
-#ifdef KERNEL
-void in_losing __P((struct inpcb *));
-int in_pcballoc __P((struct socket *, struct inpcbinfo *));
-int in_pcbbind __P((struct inpcb *, struct mbuf *));
-int in_pcbconnect __P((struct inpcb *, struct mbuf *));
-void in_pcbdetach __P((struct inpcb *));
-void in_pcbdisconnect __P((struct inpcb *));
-int in_pcbladdr __P((struct inpcb *, struct mbuf *,
- struct sockaddr_in **));
-struct inpcb *
- in_pcblookup __P((struct inpcbinfo *,
- struct in_addr, u_int, struct in_addr, u_int, int));
-struct inpcb *
- in_pcblookuphash __P((struct inpcbinfo *,
- struct in_addr, u_int, struct in_addr, u_int, int));
-void in_pcbnotify __P((struct inpcbhead *, struct sockaddr *,
- u_int, struct in_addr, u_int, int, void (*)(struct inpcb *, int)));
-void in_pcbrehash __P((struct inpcb *));
-void in_setpeeraddr __P((struct inpcb *, struct mbuf *));
-void in_setsockaddr __P((struct inpcb *, struct mbuf *));
-#endif
-
-#endif
diff --git a/c/src/libnetworking/netinet/in_proto.c b/c/src/libnetworking/netinet/in_proto.c
deleted file mode 100644
index 3fa845955e..0000000000
--- a/c/src/libnetworking/netinet/in_proto.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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_proto.c 8.2 (Berkeley) 2/9/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/radix.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/in_pcb.h>
-#include <netinet/igmp_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-/*
- * TCP/IP protocol family: IP, ICMP, UDP, TCP.
- */
-
-#ifdef IPXIP
-#include <netipx/ipx.h>
-#include <netipx/ipx_ip.h>
-#endif
-
-#ifdef NSIP
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-#endif
-
-#ifdef TPIP
-void tpip_input(), tpip_ctlinput(), tp_init(), tp_slowtimo(), tp_drain();
-int tp_ctloutput(), tp_usrreq();
-#endif
-
-#ifdef EON
-void eoninput(), eonctlinput(), eonprotoinit();
-#endif /* EON */
-
-extern struct domain inetdomain;
-
-struct protosw inetsw[] = {
-{ 0, &inetdomain, 0, 0,
- 0, 0, 0, 0,
- 0,
- ip_init, 0, ip_slowtimo, ip_drain
-},
-{ SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR,
- udp_input, 0, udp_ctlinput, ip_ctloutput,
- udp_usrreq,
- udp_init
-},
-{ SOCK_STREAM, &inetdomain, IPPROTO_TCP,
- PR_CONNREQUIRED|PR_IMPLOPCL|PR_WANTRCVD,
- tcp_input, 0, tcp_ctlinput, tcp_ctloutput,
- 0,
- tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain,
- &tcp_usrreqs
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR,
- rip_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR,
- icmp_input, 0, 0, rip_ctloutput,
- rip_usrreq
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_IGMP, PR_ATOMIC|PR_ADDR,
- igmp_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- igmp_init, igmp_fasttimo, igmp_slowtimo
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_RSVP, PR_ATOMIC|PR_ADDR,
- rsvp_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_IPIP, PR_ATOMIC|PR_ADDR,
- ipip_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-#ifdef IPDIVERT
-{ SOCK_RAW, &inetdomain, IPPROTO_DIVERT, PR_ATOMIC|PR_ADDR,
- div_input, 0, 0, ip_ctloutput,
- div_usrreq,
- div_init, 0, 0, 0,
-},
-#endif
-#ifdef TPIP
-{ SOCK_SEQPACKET,&inetdomain, IPPROTO_TP, PR_CONNREQUIRED|PR_WANTRCVD,
- tpip_input, 0, tpip_ctlinput, tp_ctloutput,
- tp_usrreq,
- tp_init, 0, tp_slowtimo, tp_drain,
-},
-#endif
-/* EON (ISO CLNL over IP) */
-#ifdef EON
-{ SOCK_RAW, &inetdomain, IPPROTO_EON, 0,
- eoninput, 0, eonctlinput, 0,
- 0,
- eonprotoinit, 0, 0, 0,
-},
-#endif
-#ifdef IPXIP
-{ SOCK_RAW, &inetdomain, IPPROTO_IDP, PR_ATOMIC|PR_ADDR,
- ipxip_input, 0, ipxip_ctlinput, 0,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-#endif
-#ifdef NSIP
-{ SOCK_RAW, &inetdomain, IPPROTO_IDP, PR_ATOMIC|PR_ADDR,
- idpip_input, 0, nsip_ctlinput, 0,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-#endif
- /* raw wildcard */
-{ SOCK_RAW, &inetdomain, 0, PR_ATOMIC|PR_ADDR,
- rip_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- rip_init, 0, 0, 0,
-},
-};
-
-extern int in_inithead(void **, int);
-
-struct domain inetdomain =
- { AF_INET, "internet", 0, 0, 0,
- inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])], 0,
- in_inithead, 32, sizeof(struct sockaddr_in)
- };
-
-DOMAIN_SET(inet);
-
-SYSCTL_NODE(_net, PF_INET, inet, CTLFLAG_RW, 0,
- "Internet Family");
-
-SYSCTL_NODE(_net_inet, IPPROTO_IP, ip, CTLFLAG_RW, 0, "IP");
-SYSCTL_NODE(_net_inet, IPPROTO_ICMP, icmp, CTLFLAG_RW, 0, "ICMP");
-SYSCTL_NODE(_net_inet, IPPROTO_UDP, udp, CTLFLAG_RW, 0, "UDP");
-SYSCTL_NODE(_net_inet, IPPROTO_TCP, tcp, CTLFLAG_RW, 0, "TCP");
-SYSCTL_NODE(_net_inet, IPPROTO_IGMP, igmp, CTLFLAG_RW, 0, "IGMP");
-#ifdef IPDIVERT
-SYSCTL_NODE(_net_inet, IPPROTO_DIVERT, div, CTLFLAG_RW, 0, "DIVERT");
-#endif
-
diff --git a/c/src/libnetworking/netinet/in_rmx.c b/c/src/libnetworking/netinet/in_rmx.c
deleted file mode 100644
index ba1793b3b4..0000000000
--- a/c/src/libnetworking/netinet/in_rmx.c
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
- * Copyright 1994, 1995 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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.
- *
- * $Id$
- */
-
-/*
- * This code does two things necessary for the enhanced TCP metrics to
- * function in a useful manner:
- * 1) It marks all non-host routes as `cloning', thus ensuring that
- * every actual reference to such a route actually gets turned
- * into a reference to a host route to the specific destination
- * requested.
- * 2) When such routes lose all their references, it arranges for them
- * to be deleted in some random collection of circumstances, so that
- * a large quantity of stale routing data is not kept in kernel memory
- * indefinitely. See in_rtqtimo() below for the exact mechanism.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/queue.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/mbuf.h>
-#include <sys/syslog.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-
-#include <netinet/tcp.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-
-extern int in_inithead __P((void **head, int off));
-
-#define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */
-
-/*
- * Do what we need to do when inserting a route.
- */
-static struct radix_node *
-in_addroute(void *v_arg, void *n_arg, struct radix_node_head *head,
- struct radix_node *treenodes)
-{
- struct rtentry *rt = (struct rtentry *)treenodes;
- struct sockaddr_in *sin = (struct sockaddr_in *)rt_key(rt);
- struct radix_node *ret;
-
- /*
- * For IP, all unicast non-host routes are automatically cloning.
- */
- if(IN_MULTICAST(ntohl(sin->sin_addr.s_addr)))
- rt->rt_flags |= RTF_MULTICAST;
-
- if(!(rt->rt_flags & (RTF_HOST | RTF_CLONING | RTF_MULTICAST))) {
- rt->rt_flags |= RTF_PRCLONING;
- }
-
- /*
- * A little bit of help for both IP output and input:
- * For host routes, we make sure that RTF_BROADCAST
- * is set for anything that looks like a broadcast address.
- * This way, we can avoid an expensive call to in_broadcast()
- * in ip_output() most of the time (because the route passed
- * to ip_output() is almost always a host route).
- *
- * We also do the same for local addresses, with the thought
- * that this might one day be used to speed up ip_input().
- *
- * We also mark routes to multicast addresses as such, because
- * it's easy to do and might be useful (but this is much more
- * dubious since it's so easy to inspect the address). (This
- * is done above.)
- */
- if (rt->rt_flags & RTF_HOST) {
- if (in_broadcast(sin->sin_addr, rt->rt_ifp)) {
- rt->rt_flags |= RTF_BROADCAST;
- } else {
-#define satosin(sa) ((struct sockaddr_in *)sa)
- if (satosin(rt->rt_ifa->ifa_addr)->sin_addr.s_addr
- == sin->sin_addr.s_addr)
- rt->rt_flags |= RTF_LOCAL;
-#undef satosin
- }
- }
-
- /*
- * We also specify a send and receive pipe size for every
- * route added, to help TCP a bit. TCP doesn't actually
- * want a true pipe size, which would be prohibitive in memory
- * costs and is hard to compute anyway; it simply uses these
- * values to size its buffers. So, we fill them in with the
- * same values that TCP would have used anyway, and allow the
- * installing program or the link layer to override these values
- * as it sees fit. This will hopefully allow TCP more
- * opportunities to save its ssthresh value.
- */
- if (!rt->rt_rmx.rmx_sendpipe && !(rt->rt_rmx.rmx_locks & RTV_SPIPE))
- rt->rt_rmx.rmx_sendpipe = tcp_sendspace;
-
- if (!rt->rt_rmx.rmx_recvpipe && !(rt->rt_rmx.rmx_locks & RTV_RPIPE))
- rt->rt_rmx.rmx_recvpipe = tcp_recvspace;
-
- if (!rt->rt_rmx.rmx_mtu && !(rt->rt_rmx.rmx_locks & RTV_MTU)
- && rt->rt_ifp)
- rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu;
-
- ret = rn_addroute(v_arg, n_arg, head, treenodes);
- if (ret == NULL && rt->rt_flags & RTF_HOST) {
- struct rtentry *rt2;
- /*
- * We are trying to add a host route, but can't.
- * Find out if it is because of an
- * ARP entry and delete it if so.
- */
- rt2 = rtalloc1((struct sockaddr *)sin, 0,
- RTF_CLONING | RTF_PRCLONING);
- if (rt2) {
- if (rt2->rt_flags & RTF_LLINFO &&
- rt2->rt_flags & RTF_HOST &&
- rt2->rt_gateway &&
- rt2->rt_gateway->sa_family == AF_LINK) {
- rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt2),
- rt2->rt_gateway,
- rt_mask(rt2), rt2->rt_flags, 0);
- ret = rn_addroute(v_arg, n_arg, head,
- treenodes);
- }
- RTFREE(rt2);
- }
- }
- return ret;
-}
-
-/*
- * This code is the inverse of in_clsroute: on first reference, if we
- * were managing the route, stop doing so and set the expiration timer
- * back off again.
- */
-static struct radix_node *
-in_matroute(void *v_arg, struct radix_node_head *head)
-{
- struct radix_node *rn = rn_match(v_arg, head);
- struct rtentry *rt = (struct rtentry *)rn;
-
- if(rt && rt->rt_refcnt == 0) { /* this is first reference */
- if(rt->rt_flags & RTPRF_OURS) {
- rt->rt_flags &= ~RTPRF_OURS;
- rt->rt_rmx.rmx_expire = 0;
- }
- }
- return rn;
-}
-
-static int rtq_reallyold = 60*60;
- /* one hour is ``really old'' */
-SYSCTL_INT(_net_inet_ip, IPCTL_RTEXPIRE, rtexpire,
- CTLFLAG_RW, &rtq_reallyold , 0, "");
-
-static int rtq_minreallyold = 10;
- /* never automatically crank down to less */
-SYSCTL_INT(_net_inet_ip, IPCTL_RTMINEXPIRE, rtminexpire,
- CTLFLAG_RW, &rtq_minreallyold , 0, "");
-
-static int rtq_toomany = 128;
- /* 128 cached routes is ``too many'' */
-SYSCTL_INT(_net_inet_ip, IPCTL_RTMAXCACHE, rtmaxcache,
- CTLFLAG_RW, &rtq_toomany , 0, "");
-
-
-/*
- * On last reference drop, mark the route as belong to us so that it can be
- * timed out.
- */
-static void
-in_clsroute(struct radix_node *rn, struct radix_node_head *head)
-{
- struct rtentry *rt = (struct rtentry *)rn;
-
- if(!(rt->rt_flags & RTF_UP))
- return; /* prophylactic measures */
-
- if((rt->rt_flags & (RTF_LLINFO | RTF_HOST)) != RTF_HOST)
- return;
-
- if((rt->rt_flags & (RTF_WASCLONED | RTPRF_OURS))
- != RTF_WASCLONED)
- return;
-
- /*
- * As requested by David Greenman:
- * If rtq_reallyold is 0, just delete the route without
- * waiting for a timeout cycle to kill it.
- */
- if(rtq_reallyold != 0) {
- rt->rt_flags |= RTPRF_OURS;
- rt->rt_rmx.rmx_expire = rtems_bsdnet_seconds_since_boot() + rtq_reallyold;
- } else {
- rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt),
- rt->rt_gateway, rt_mask(rt),
- rt->rt_flags, 0);
- }
-}
-
-struct rtqk_arg {
- struct radix_node_head *rnh;
- int draining;
- int killed;
- int found;
- int updating;
- time_t nextstop;
-};
-
-/*
- * Get rid of old routes. When draining, this deletes everything, even when
- * the timeout is not expired yet. When updating, this makes sure that
- * nothing has a timeout longer than the current value of rtq_reallyold.
- */
-static int
-in_rtqkill(struct radix_node *rn, void *rock)
-{
- struct rtqk_arg *ap = rock;
- struct rtentry *rt = (struct rtentry *)rn;
- int err;
-
- if(rt->rt_flags & RTPRF_OURS) {
- ap->found++;
-
- if(ap->draining || rt->rt_rmx.rmx_expire <= rtems_bsdnet_seconds_since_boot()) {
- if(rt->rt_refcnt > 0)
- panic("rtqkill route really not free");
-
- err = rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt),
- rt->rt_gateway, rt_mask(rt),
- rt->rt_flags, 0);
- if(err) {
- log(LOG_WARNING, "in_rtqkill: error %d\n", err);
- } else {
- ap->killed++;
- }
- } else {
- if(ap->updating
- && (rt->rt_rmx.rmx_expire - rtems_bsdnet_seconds_since_boot()
- > rtq_reallyold)) {
- rt->rt_rmx.rmx_expire = rtems_bsdnet_seconds_since_boot()
- + rtq_reallyold;
- }
- ap->nextstop = lmin(ap->nextstop,
- rt->rt_rmx.rmx_expire);
- }
- }
-
- return 0;
-}
-
-#define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */
-static int rtq_timeout = RTQ_TIMEOUT;
-
-static void
-in_rtqtimo(void *rock)
-{
- struct radix_node_head *rnh = rock;
- struct rtqk_arg arg;
- struct timeval atv;
- static time_t last_adjusted_timeout = 0;
- int s;
-
- arg.found = arg.killed = 0;
- arg.rnh = rnh;
- arg.nextstop = rtems_bsdnet_seconds_since_boot() + rtq_timeout;
- arg.draining = arg.updating = 0;
- s = splnet();
- rnh->rnh_walktree(rnh, in_rtqkill, &arg);
- splx(s);
-
- /*
- * Attempt to be somewhat dynamic about this:
- * If there are ``too many'' routes sitting around taking up space,
- * then crank down the timeout, and see if we can't make some more
- * go away. However, we make sure that we will never adjust more
- * than once in rtq_timeout seconds, to keep from cranking down too
- * hard.
- */
- if((arg.found - arg.killed > rtq_toomany)
- && (rtems_bsdnet_seconds_since_boot() - last_adjusted_timeout >= rtq_timeout)
- && rtq_reallyold > rtq_minreallyold) {
- rtq_reallyold = 2*rtq_reallyold / 3;
- if(rtq_reallyold < rtq_minreallyold) {
- rtq_reallyold = rtq_minreallyold;
- }
-
- last_adjusted_timeout = rtems_bsdnet_seconds_since_boot();
-#ifdef DIAGNOSTIC
- log(LOG_DEBUG, "in_rtqtimo: adjusted rtq_reallyold to %d\n",
- rtq_reallyold);
-#endif
- arg.found = arg.killed = 0;
- arg.updating = 1;
- s = splnet();
- rnh->rnh_walktree(rnh, in_rtqkill, &arg);
- splx(s);
- }
-
- atv.tv_usec = 0;
- atv.tv_sec = arg.nextstop;
- timeout(in_rtqtimo, rock, hzto(&atv));
-}
-
-void
-in_rtqdrain(void)
-{
- struct radix_node_head *rnh = rt_tables[AF_INET];
- struct rtqk_arg arg;
- int s;
- arg.found = arg.killed = 0;
- arg.rnh = rnh;
- arg.nextstop = 0;
- arg.draining = 1;
- arg.updating = 0;
- s = splnet();
- rnh->rnh_walktree(rnh, in_rtqkill, &arg);
- splx(s);
-}
-
-/*
- * Initialize our routing tree.
- */
-int
-in_inithead(void **head, int off)
-{
- struct radix_node_head *rnh;
-
- if(!rn_inithead(head, off))
- return 0;
-
- if(head != (void **)&rt_tables[AF_INET]) /* BOGUS! */
- return 1; /* only do this for the real routing table */
-
- rnh = *head;
- rnh->rnh_addaddr = in_addroute;
- rnh->rnh_matchaddr = in_matroute;
- rnh->rnh_close = in_clsroute;
- in_rtqtimo(rnh); /* kick off timeout first time */
- return 1;
-}
-
diff --git a/c/src/libnetworking/netinet/in_systm.h b/c/src/libnetworking/netinet/in_systm.h
deleted file mode 100644
index d72e9b4665..0000000000
--- a/c/src/libnetworking/netinet/in_systm.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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_systm.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IN_SYSTM_H_
-#define _NETINET_IN_SYSTM_H_
-
-/*
- * Miscellaneous internetwork
- * definitions for kernel.
- */
-
-/*
- * Network types.
- *
- * Internally the system keeps counters in the headers with the bytes
- * swapped so that VAX instructions will work on them. It reverses
- * the bytes before transmission at each protocol level. The n_ types
- * represent the types with the bytes in ``high-ender'' order.
- */
-typedef u_short n_short; /* short as received from the net */
-typedef u_long n_long; /* long as received from the net */
-
-typedef u_long n_time; /* ms since 00:00 GMT, byte rev */
-
-#ifdef KERNEL
-n_time iptime __P((void));
-#endif
-
-#endif
diff --git a/c/src/libnetworking/netinet/in_var.h b/c/src/libnetworking/netinet/in_var.h
deleted file mode 100644
index e7a54d5e85..0000000000
--- a/c/src/libnetworking/netinet/in_var.h
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 1985, 1986, 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_var.h 8.2 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _NETINET_IN_VAR_H_
-#define _NETINET_IN_VAR_H_
-
-#include <sys/queue.h>
-
-/*
- * Interface address, Internet version. One of these structures
- * is allocated for each interface with an Internet address.
- * The ifaddr structure contains the protocol-independent part
- * of the structure and is assumed to be first.
- */
-struct in_ifaddr {
- struct ifaddr ia_ifa; /* protocol-independent info */
-#define ia_ifp ia_ifa.ifa_ifp
-#define ia_flags ia_ifa.ifa_flags
- /* ia_{,sub}net{,mask} in host order */
- u_long ia_net; /* network number of interface */
- u_long ia_netmask; /* mask of net part */
- u_long ia_subnet; /* subnet number, including net */
- u_long ia_subnetmask; /* mask of subnet part */
- struct in_addr ia_netbroadcast; /* to recognize net broadcasts */
- struct in_ifaddr *ia_next; /* next in list of internet addresses */
- struct sockaddr_in ia_addr; /* reserve space for interface name */
- struct sockaddr_in ia_dstaddr; /* reserve space for broadcast addr */
-#define ia_broadaddr ia_dstaddr
- struct sockaddr_in ia_sockmask; /* reserve space for general netmask */
- LIST_HEAD(in_multihead, in_multi) ia_multiaddrs;
- /* list of multicast addresses */
-};
-
-struct in_aliasreq {
- char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- struct sockaddr_in ifra_addr;
- struct sockaddr_in ifra_broadaddr;
-#define ifra_dstaddr ifra_broadaddr
- struct sockaddr_in ifra_mask;
-};
-/*
- * Given a pointer to an in_ifaddr (ifaddr),
- * return a pointer to the addr as a sockaddr_in.
- */
-#define IA_SIN(ia) (&(((struct in_ifaddr *)(ia))->ia_addr))
-#define IA_DSTSIN(ia) (&(((struct in_ifaddr *)(ia))->ia_dstaddr))
-
-#define IN_LNAOF(in, ifa) \
- ((ntohl((in).s_addr) & ~((struct in_ifaddr *)(ifa)->ia_subnetmask))
-
-
-#ifdef KERNEL
-extern struct in_ifaddr *in_ifaddr;
-extern struct ifqueue ipintrq; /* ip packet input queue */
-extern struct in_addr zeroin_addr;
-extern u_char inetctlerrmap[];
-extern int rtq_reallyold; /* XXX */
-extern int rtq_minreallyold; /* XXX */
-extern int rtq_toomany; /* XXX */
-
-/*
- * Macro for finding the interface (ifnet structure) corresponding to one
- * of our IP addresses.
- */
-#define INADDR_TO_IFP(addr, ifp) \
- /* struct in_addr addr; */ \
- /* struct ifnet *ifp; */ \
-{ \
- register struct in_ifaddr *ia; \
-\
- for (ia = in_ifaddr; \
- ia != NULL && ((ia->ia_ifp->if_flags & IFF_POINTOPOINT)? \
- IA_DSTSIN(ia):IA_SIN(ia))->sin_addr.s_addr != (addr).s_addr; \
- ia = ia->ia_next) \
- continue; \
- if (ia == NULL) \
- for (ia = in_ifaddr; \
- ia != NULL; \
- ia = ia->ia_next) \
- if (ia->ia_ifp->if_flags & IFF_POINTOPOINT && \
- IA_SIN(ia)->sin_addr.s_addr == (addr).s_addr) \
- break; \
- (ifp) = (ia == NULL) ? NULL : ia->ia_ifp; \
-}
-
-/*
- * Macro for finding the internet address structure (in_ifaddr) corresponding
- * to a given interface (ifnet structure).
- */
-#define IFP_TO_IA(ifp, ia) \
- /* struct ifnet *ifp; */ \
- /* struct in_ifaddr *ia; */ \
-{ \
- for ((ia) = in_ifaddr; \
- (ia) != NULL && (ia)->ia_ifp != (ifp); \
- (ia) = (ia)->ia_next) \
- continue; \
-}
-#endif
-
-/*
- * This information should be part of the ifnet structure but we don't wish
- * to change that - as it might break a number of things
- */
-
-struct router_info {
- struct ifnet *rti_ifp;
- int rti_type; /* type of router which is querier on this interface */
- int rti_time; /* # of slow timeouts since last old query */
- struct router_info *rti_next;
-};
-
-/*
- * Internet multicast address structure. There is one of these for each IP
- * multicast group to which this host belongs on a given network interface.
- * They are kept in a linked list, rooted in the interface's in_ifaddr
- * structure.
- */
-struct in_multi {
- LIST_ENTRY(in_multi) inm_entry; /* list glue */
- struct in_addr inm_addr; /* IP multicast address */
- struct ifnet *inm_ifp; /* back pointer to ifnet */
- struct in_ifaddr *inm_ia; /* back pointer to in_ifaddr */
- u_int inm_refcount; /* no. membership claims by sockets */
- u_int inm_timer; /* IGMP membership report timer */
- u_int inm_state; /* state of the membership */
- struct router_info *inm_rti; /* router info*/
-};
-
-#ifdef KERNEL
-/*
- * Structure used by macros below to remember position when stepping through
- * all of the in_multi records.
- */
-struct in_multistep {
- struct in_ifaddr *i_ia;
- struct in_multi *i_inm;
-};
-
-/*
- * Macro for looking up the in_multi record for a given IP multicast address
- * on a given interface. If no matching record is found, "inm" returns NULL.
- */
-#define IN_LOOKUP_MULTI(addr, ifp, inm) \
- /* struct in_addr addr; */ \
- /* struct ifnet *ifp; */ \
- /* struct in_multi *inm; */ \
-{ \
- register struct in_ifaddr *ia; \
-\
- IFP_TO_IA((ifp), ia); \
- if (ia == NULL) \
- (inm) = NULL; \
- else \
- for ((inm) = ia->ia_multiaddrs.lh_first; \
- (inm) != NULL && (inm)->inm_addr.s_addr != (addr).s_addr; \
- (inm) = inm->inm_entry.le_next) \
- continue; \
-}
-
-/*
- * Macro to step through all of the in_multi records, one at a time.
- * The current position is remembered in "step", which the caller must
- * provide. IN_FIRST_MULTI(), below, must be called to initialize "step"
- * and get the first record. Both macros return a NULL "inm" when there
- * are no remaining records.
- */
-#define IN_NEXT_MULTI(step, inm) \
- /* struct in_multistep step; */ \
- /* struct in_multi *inm; */ \
-{ \
- if (((inm) = (step).i_inm) != NULL) \
- (step).i_inm = (inm)->inm_entry.le_next; \
- else \
- while ((step).i_ia != NULL) { \
- (inm) = (step).i_ia->ia_multiaddrs.lh_first; \
- (step).i_ia = (step).i_ia->ia_next; \
- if ((inm) != NULL) { \
- (step).i_inm = (inm)->inm_entry.le_next; \
- break; \
- } \
- } \
-}
-
-#define IN_FIRST_MULTI(step, inm) \
- /* struct in_multistep step; */ \
- /* struct in_multi *inm; */ \
-{ \
- (step).i_ia = in_ifaddr; \
- (step).i_inm = NULL; \
- IN_NEXT_MULTI((step), (inm)); \
-}
-
-struct in_multi *in_addmulti __P((struct in_addr *, struct ifnet *));
-void in_delmulti __P((struct in_multi *));
-int in_control __P((struct socket *, u_long, caddr_t, struct ifnet *));
-void in_rtqdrain __P((void));
-void ip_input __P((struct mbuf *));
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_IN_VAR_H_ */
diff --git a/c/src/libnetworking/netinet/ip.h b/c/src/libnetworking/netinet/ip.h
deleted file mode 100644
index e7f824ca6f..0000000000
--- a/c/src/libnetworking/netinet/ip.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)ip.h 8.2 (Berkeley) 6/1/94
- * $Id$
- */
-
-#ifndef _NETINET_IP_H_
-#define _NETINET_IP_H_
-
-/*
- * Definitions for internet protocol version 4.
- * Per RFC 791, September 1981.
- */
-#define IPVERSION 4
-
-/*
- * Structure of an internet header, naked of options.
- *
- * We declare ip_len and ip_off to be short, rather than u_short
- * pragmatically since otherwise unsigned comparisons can result
- * against negative integers quite easily, and fail in subtle ways.
- */
-struct ip {
-#ifdef _IP_VHL
- u_char ip_vhl; /* version << 4 | header length >> 2 */
-#else
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char ip_hl:4, /* header length */
- ip_v:4; /* version */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char ip_v:4, /* version */
- ip_hl:4; /* header length */
-#endif
-#endif /* not _IP_VHL */
- u_char ip_tos; /* type of service */
- u_short ip_len; /* total length */
- u_short ip_id; /* identification */
- u_short ip_off; /* fragment offset field */
-#define IP_RF 0x8000 /* reserved fragment flag */
-#define IP_DF 0x4000 /* dont fragment flag */
-#define IP_MF 0x2000 /* more fragments flag */
-#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
- u_char ip_ttl; /* time to live */
- u_char ip_p; /* protocol */
- u_short ip_sum; /* checksum */
- struct in_addr ip_src,ip_dst; /* source and dest address */
-};
-
-#ifdef _IP_VHL
-#define IP_MAKE_VHL(v, hl) ((v) << 4 | (hl))
-#define IP_VHL_HL(vhl) ((vhl) & 0x0f)
-#define IP_VHL_V(vhl) ((vhl) >> 4)
-#define IP_VHL_BORING 0x45
-#endif
-
-#define IP_MAXPACKET 65535 /* maximum packet size */
-
-/*
- * Definitions for IP type of service (ip_tos)
- */
-#define IPTOS_LOWDELAY 0x10
-#define IPTOS_THROUGHPUT 0x08
-#define IPTOS_RELIABILITY 0x04
-#define IPTOS_MINCOST 0x02
-
-/*
- * Definitions for IP precedence (also in ip_tos) (hopefully unused)
- */
-#define IPTOS_PREC_NETCONTROL 0xe0
-#define IPTOS_PREC_INTERNETCONTROL 0xc0
-#define IPTOS_PREC_CRITIC_ECP 0xa0
-#define IPTOS_PREC_FLASHOVERRIDE 0x80
-#define IPTOS_PREC_FLASH 0x60
-#define IPTOS_PREC_IMMEDIATE 0x40
-#define IPTOS_PREC_PRIORITY 0x20
-#define IPTOS_PREC_ROUTINE 0x00
-
-/*
- * Definitions for options.
- */
-#define IPOPT_COPIED(o) ((o)&0x80)
-#define IPOPT_CLASS(o) ((o)&0x60)
-#define IPOPT_NUMBER(o) ((o)&0x1f)
-
-#define IPOPT_CONTROL 0x00
-#define IPOPT_RESERVED1 0x20
-#define IPOPT_DEBMEAS 0x40
-#define IPOPT_RESERVED2 0x60
-
-#define IPOPT_EOL 0 /* end of option list */
-#define IPOPT_NOP 1 /* no operation */
-
-#define IPOPT_RR 7 /* record packet route */
-#define IPOPT_TS 68 /* timestamp */
-#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
-#define IPOPT_LSRR 131 /* loose source route */
-#define IPOPT_SATID 136 /* satnet id */
-#define IPOPT_SSRR 137 /* strict source route */
-#define IPOPT_RA 148 /* router alert */
-
-/*
- * Offsets to fields in options other than EOL and NOP.
- */
-#define IPOPT_OPTVAL 0 /* option ID */
-#define IPOPT_OLEN 1 /* option length */
-#define IPOPT_OFFSET 2 /* offset within option */
-#define IPOPT_MINOFF 4 /* min value of above */
-
-/*
- * Time stamp option structure.
- */
-struct ip_timestamp {
- u_char ipt_code; /* IPOPT_TS */
- u_char ipt_len; /* size of structure (variable) */
- u_char ipt_ptr; /* index of current entry */
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char ipt_flg:4, /* flags, see below */
- ipt_oflw:4; /* overflow counter */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char ipt_oflw:4, /* overflow counter */
- ipt_flg:4; /* flags, see below */
-#endif
- union ipt_timestamp {
- n_long ipt_time[1];
- struct ipt_ta {
- struct in_addr ipt_addr;
- n_long ipt_time;
- } ipt_ta[1];
- } ipt_timestamp;
-};
-
-#include <machine/in_cksum.h>
-
-/* flag bits for ipt_flg */
-#define IPOPT_TS_TSONLY 0 /* timestamps only */
-#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
-#define IPOPT_TS_PRESPEC 3 /* specified modules only */
-
-/* bits for security (not byte swapped) */
-#define IPOPT_SECUR_UNCLASS 0x0000
-#define IPOPT_SECUR_CONFID 0xf135
-#define IPOPT_SECUR_EFTO 0x789a
-#define IPOPT_SECUR_MMMM 0xbc4d
-#define IPOPT_SECUR_RESTR 0xaf13
-#define IPOPT_SECUR_SECRET 0xd788
-#define IPOPT_SECUR_TOPSECRET 0x6bc5
-
-/*
- * Internet implementation parameters.
- */
-#define MAXTTL 255 /* maximum time to live (seconds) */
-#define IPDEFTTL 64 /* default ttl, from RFC 1340 */
-#define IPFRAGTTL 60 /* time to live for frags, slowhz */
-#define IPTTLDEC 1 /* subtracted when forwarding */
-
-#define IP_MSS 576 /* default maximum segment size */
-
-#endif
diff --git a/c/src/libnetworking/netinet/ip_divert.c b/c/src/libnetworking/netinet/ip_divert.c
deleted file mode 100644
index 2955e811ad..0000000000
--- a/c/src/libnetworking/netinet/ip_divert.c
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/systm.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-
-/*
- * Divert sockets
- */
-
-/*
- * Allocate enough space to hold a full IP packet
- */
-#define DIVSNDQ (65536 + 100)
-#define DIVRCVQ (65536 + 100)
-
-/* Global variables */
-
-/*
- * ip_input() and ip_output() set this secret value before calling us to
- * let us know which divert port to divert a packet to; this is done so
- * we can use the existing prototype for struct protosw's pr_input().
- * This is stored in host order.
- */
-u_short ip_divert_port;
-
-/*
- * We set this value to a non-zero port number when we want the call to
- * ip_fw_chk() in ip_input() or ip_output() to ignore ``divert <port>''
- * chain entries. This is stored in host order.
- */
-u_short ip_divert_ignore;
-
-/* Internal variables */
-
-static struct inpcbhead divcb;
-static struct inpcbinfo divcbinfo;
-
-static u_long div_sendspace = DIVSNDQ; /* XXX sysctl ? */
-static u_long div_recvspace = DIVRCVQ; /* XXX sysctl ? */
-
-/* Optimization: have this preinitialized */
-static struct sockaddr_in divsrc = { sizeof(divsrc), AF_INET };
-
-/* Internal functions */
-
-static int div_output(struct socket *so,
- struct mbuf *m, struct mbuf *addr, struct mbuf *control);
-
-/*
- * Initialize divert connection block queue.
- */
-void
-div_init(void)
-{
- LIST_INIT(&divcb);
- divcbinfo.listhead = &divcb;
- /*
- * XXX We don't use the hash list for divert IP, but it's easier
- * to allocate a one entry hash list than it is to check all
- * over the place for hashbase == NULL.
- */
- divcbinfo.hashbase = hashinit(1, M_PCB, &divcbinfo.hashmask);
-}
-
-/*
- * Setup generic address and protocol structures
- * for div_input routine, then pass them along with
- * mbuf chain. ip->ip_len is assumed to have had
- * the header length (hlen) subtracted out already.
- * We tell whether the packet was incoming or outgoing
- * by seeing if hlen == 0, which is a hack.
- */
-void
-div_input(struct mbuf *m, int hlen)
-{
- struct ip *ip;
- struct inpcb *inp;
- struct socket *sa;
-
- /* Sanity check */
- if (ip_divert_port == 0)
- panic("div_input: port is 0");
-
- /* Assure header */
- if (m->m_len < sizeof(struct ip) &&
- (m = m_pullup(m, sizeof(struct ip))) == 0) {
- return;
- }
- ip = mtod(m, struct ip *);
-
- /* Record divert port */
- divsrc.sin_port = htons(ip_divert_port);
-
- /* Restore packet header fields */
- ip->ip_len += hlen;
- HTONS(ip->ip_len);
- HTONS(ip->ip_off);
-
- /* Record receive interface address, if any */
- divsrc.sin_addr.s_addr = 0;
- if (hlen) {
- struct ifaddr *ifa;
-
-#ifdef DIAGNOSTIC
- /* Sanity check */
- if (!(m->m_flags & M_PKTHDR))
- panic("div_input: no pkt hdr");
-#endif
-
- /* More fields affected by ip_input() */
- HTONS(ip->ip_id);
-
- /* Find IP address for recieve interface */
- for (ifa = m->m_pkthdr.rcvif->if_addrlist;
- ifa != NULL; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr == NULL)
- continue;
- if (ifa->ifa_addr->sa_family != AF_INET)
- continue;
- divsrc.sin_addr =
- ((struct sockaddr_in *) ifa->ifa_addr)->sin_addr;
- break;
- }
- }
-
- /* Put packet on socket queue, if any */
- sa = NULL;
- for (inp = divcb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_lport == htons(ip_divert_port))
- sa = inp->inp_socket;
- }
- if (sa) {
- if (sbappendaddr(&sa->so_rcv, (struct sockaddr *)&divsrc,
- m, (struct mbuf *)0) == 0)
- m_freem(m);
- else
- sorwakeup(sa);
- } else {
- m_freem(m);
- ipstat.ips_noproto++;
- ipstat.ips_delivered--;
- }
-}
-
-/*
- * Deliver packet back into the IP processing machinery.
- *
- * If no address specified, or address is 0.0.0.0, send to ip_output();
- * otherwise, send to ip_input() and mark as having been received on
- * the interface with that address.
- *
- * If no address specified, or dest port is 0, allow packet to divert
- * back to this socket; otherwise, don't.
- */
-static int
-div_output(so, m, addr, control)
- struct socket *so;
- register struct mbuf *m;
- struct mbuf *addr, *control;
-{
- register struct inpcb *const inp = sotoinpcb(so);
- register struct ip *const ip = mtod(m, struct ip *);
- struct sockaddr_in *sin = NULL;
- int error = 0;
-
- if (control)
- m_freem(control); /* XXX */
- if (addr)
- sin = mtod(addr, struct sockaddr_in *);
-
- /* Loopback avoidance option */
- ip_divert_ignore = ntohs(inp->inp_lport);
-
- /* Reinject packet into the system as incoming or outgoing */
- if (!sin || sin->sin_addr.s_addr == 0) {
- /* Don't allow both user specified and setsockopt options,
- and don't allow packet length sizes that will crash */
- if (((ip->ip_hl != (sizeof (*ip) >> 2)) && inp->inp_options) ||
- ((u_short)ntohs(ip->ip_len) > m->m_pkthdr.len)) {
- error = EINVAL;
- goto cantsend;
- }
-
- /* Convert fields to host order for ip_output() */
- NTOHS(ip->ip_len);
- NTOHS(ip->ip_off);
-
- /* Send packet to output processing */
- ipstat.ips_rawout++; /* XXX */
- error = ip_output(m, inp->inp_options, &inp->inp_route,
- (so->so_options & SO_DONTROUTE) |
- IP_ALLOWBROADCAST | IP_RAWOUTPUT, inp->inp_moptions);
- } else {
- struct ifaddr *ifa;
-
- /* Find receive interface with the given IP address */
- sin->sin_port = 0;
- if ((ifa = ifa_ifwithaddr((struct sockaddr *) sin)) == 0) {
- error = EADDRNOTAVAIL;
- goto cantsend;
- }
- m->m_pkthdr.rcvif = ifa->ifa_ifp;
-
- /* Send packet to input processing */
- ip_input(m);
- }
-
- /* Reset for next time (and other packets) */
- ip_divert_ignore = 0;
- return error;
-
-cantsend:
- ip_divert_ignore = 0;
- m_freem(m);
- return error;
-}
-
-/*ARGSUSED*/
-int
-div_usrreq(so, req, m, nam, control)
- register struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register int error = 0;
- register struct inpcb *inp = sotoinpcb(so);
- int s;
-
- if (inp == NULL && req != PRU_ATTACH) {
- error = EINVAL;
- goto release;
- }
- switch (req) {
-
- case PRU_ATTACH:
- if (inp)
- panic("div_attach");
- if ((so->so_state & SS_PRIV) == 0) {
- error = EACCES;
- break;
- }
- s = splnet();
- error = in_pcballoc(so, &divcbinfo);
- splx(s);
- if (error)
- break;
- error = soreserve(so, div_sendspace, div_recvspace);
- if (error)
- break;
- inp = (struct inpcb *)so->so_pcb;
- inp->inp_ip_p = (int)nam; /* XXX */
- inp->inp_flags |= INP_HDRINCL;
- /* The socket is always "connected" because
- we always know "where" to send the packet */
- so->so_state |= SS_ISCONNECTED;
- break;
-
- case PRU_DISCONNECT:
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- error = ENOTCONN;
- break;
- }
- /* FALLTHROUGH */
- case PRU_ABORT:
- soisdisconnected(so);
- /* FALLTHROUGH */
- case PRU_DETACH:
- if (inp == 0)
- panic("div_detach");
- in_pcbdetach(inp);
- break;
-
- case PRU_BIND:
- s = splnet();
- error = in_pcbbind(inp, nam);
- splx(s);
- break;
-
- /*
- * Mark the connection as being incapable of further input.
- */
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- case PRU_SEND:
- /* Packet must have a header (but that's about it) */
- if (m->m_len < sizeof (struct ip) ||
- (m = m_pullup(m, sizeof (struct ip))) == 0) {
- ipstat.ips_toosmall++;
- error = EINVAL;
- break;
- }
-
- /* Send packet */
- error = div_output(so, m, nam, control);
- m = NULL;
- break;
-
- case PRU_SOCKADDR:
- in_setsockaddr(inp, nam);
- break;
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- /*
- * Not supported.
- */
- case PRU_CONNECT:
- case PRU_CONNECT2:
- case PRU_CONTROL:
- case PRU_RCVOOB:
- case PRU_RCVD:
- case PRU_LISTEN:
- case PRU_ACCEPT:
- case PRU_SENDOOB:
- case PRU_PEERADDR:
- error = EOPNOTSUPP;
- break;
-
- default:
- panic("div_usrreq");
- }
-release:
- if (m)
- m_freem(m);
- return (error);
-}
diff --git a/c/src/libnetworking/netinet/ip_fw.c b/c/src/libnetworking/netinet/ip_fw.c
deleted file mode 100644
index aeb09b0bbe..0000000000
--- a/c/src/libnetworking/netinet/ip_fw.c
+++ /dev/null
@@ -1,1069 +0,0 @@
-/*
- * Copyright (c) 1996 Alex Nash
- * Copyright (c) 1993 Daniel Boulet
- * Copyright (c) 1994 Ugen J.S.Antsilevich
- *
- * Redistribution and use in source forms, with and without modification,
- * are permitted provided that this entire comment appears intact.
- *
- * Redistribution in binary form may occur without any restrictions.
- * Obviously, it would be nice if you gave credit where credit is due
- * but requiring it would be too onerous.
- *
- * This software is provided ``AS IS'' without any warranties of any kind.
- *
- * $Id$
- */
-
-/*
- * Implement IP packet firewall
- */
-
-#ifndef IPFIREWALL_MODULE
-#include "opt_ipfw.h"
-#endif
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/queue.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/sysctl.h>
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_fw.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#include <netinet/udp.h>
-
-static int fw_debug = 1;
-#ifdef IPFIREWALL_VERBOSE
-static int fw_verbose = 1;
-#else
-static int fw_verbose = 0;
-#endif
-#ifdef IPFIREWALL_VERBOSE_LIMIT
-static int fw_verbose_limit = IPFIREWALL_VERBOSE_LIMIT;
-#else
-static int fw_verbose_limit = 0;
-#endif
-
-LIST_HEAD (ip_fw_head, ip_fw_chain) ip_fw_chain;
-
-#ifdef SYSCTL_NODE
-SYSCTL_NODE(_net_inet_ip, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, debug, CTLFLAG_RW, &fw_debug, 0, "");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose, CTLFLAG_RW, &fw_verbose, 0, "");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose_limit, CTLFLAG_RW, &fw_verbose_limit, 0, "");
-#endif
-
-#define dprintf(a) if (!fw_debug); else printf a
-
-#define print_ip(a) printf("%ld.%ld.%ld.%ld",(ntohl(a.s_addr)>>24)&0xFF,\
- (ntohl(a.s_addr)>>16)&0xFF,\
- (ntohl(a.s_addr)>>8)&0xFF,\
- (ntohl(a.s_addr))&0xFF);
-
-#define dprint_ip(a) if (!fw_debug); else print_ip(a)
-
-static int add_entry __P((struct ip_fw_head *chainptr, struct ip_fw *frwl));
-static int del_entry __P((struct ip_fw_head *chainptr, u_short number));
-static int zero_entry __P((struct mbuf *m));
-static struct ip_fw *check_ipfw_struct __P((struct ip_fw *m));
-static struct ip_fw *check_ipfw_mbuf __P((struct mbuf *fw));
-static int ipopts_match __P((struct ip *ip, struct ip_fw *f));
-static int port_match __P((u_short *portptr, int nports, u_short port,
- int range_flag));
-static int tcpflg_match __P((struct tcphdr *tcp, struct ip_fw *f));
-static int icmptype_match __P((struct icmp * icmp, struct ip_fw * f));
-static void ipfw_report __P((struct ip_fw *f, struct ip *ip,
- struct ifnet *rif, struct ifnet *oif));
-
-#ifdef IPFIREWALL_MODULE
-static ip_fw_chk_t *old_chk_ptr;
-static ip_fw_ctl_t *old_ctl_ptr;
-#endif
-
-static int ip_fw_chk __P((struct ip **pip, int hlen,
- struct ifnet *oif, int ignport, struct mbuf **m));
-static int ip_fw_ctl __P((int stage, struct mbuf **mm));
-
-static char err_prefix[] = "ip_fw_ctl:";
-
-/*
- * Returns 1 if the port is matched by the vector, 0 otherwise
- */
-static inline int
-port_match(u_short *portptr, int nports, u_short port, int range_flag)
-{
- if (!nports)
- return 1;
- if (range_flag) {
- if (portptr[0] <= port && port <= portptr[1]) {
- return 1;
- }
- nports -= 2;
- portptr += 2;
- }
- while (nports-- > 0) {
- if (*portptr++ == port) {
- return 1;
- }
- }
- return 0;
-}
-
-static int
-tcpflg_match(struct tcphdr *tcp, struct ip_fw *f)
-{
- u_char flg_set, flg_clr;
-
- if ((f->fw_tcpf & IP_FW_TCPF_ESTAB) &&
- (tcp->th_flags & (IP_FW_TCPF_RST | IP_FW_TCPF_ACK)))
- return 1;
-
- flg_set = tcp->th_flags & f->fw_tcpf;
- flg_clr = tcp->th_flags & f->fw_tcpnf;
-
- if (flg_set != f->fw_tcpf)
- return 0;
- if (flg_clr)
- return 0;
-
- return 1;
-}
-
-static int
-icmptype_match(struct icmp *icmp, struct ip_fw *f)
-{
- int type;
-
- if (!(f->fw_flg & IP_FW_F_ICMPBIT))
- return(1);
-
- type = icmp->icmp_type;
-
- /* check for matching type in the bitmap */
- if (type < IP_FW_ICMPTYPES_DIM * sizeof(unsigned) * 8 &&
- (f->fw_icmptypes[type / (sizeof(unsigned) * 8)] &
- (1U << (type % (8 * sizeof(unsigned))))))
- return(1);
-
- return(0); /* no match */
-}
-
-static int
-ipopts_match(struct ip *ip, struct ip_fw *f)
-{
- register u_char *cp;
- int opt, optlen, cnt;
- u_char opts, nopts, nopts_sve;
-
- cp = (u_char *)(ip + 1);
- cnt = (ip->ip_hl << 2) - sizeof (struct ip);
- opts = f->fw_ipopt;
- nopts = nopts_sve = f->fw_ipnopt;
-
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[IPOPT_OLEN];
- if (optlen <= 0 || optlen > cnt) {
- return 0; /*XXX*/
- }
- }
- switch (opt) {
-
- default:
- break;
-
- case IPOPT_LSRR:
- opts &= ~IP_FW_IPOPT_LSRR;
- nopts &= ~IP_FW_IPOPT_LSRR;
- break;
-
- case IPOPT_SSRR:
- opts &= ~IP_FW_IPOPT_SSRR;
- nopts &= ~IP_FW_IPOPT_SSRR;
- break;
-
- case IPOPT_RR:
- opts &= ~IP_FW_IPOPT_RR;
- nopts &= ~IP_FW_IPOPT_RR;
- break;
- case IPOPT_TS:
- opts &= ~IP_FW_IPOPT_TS;
- nopts &= ~IP_FW_IPOPT_TS;
- break;
- }
- if (opts == nopts)
- break;
- }
- if (opts == 0 && nopts == nopts_sve)
- return 1;
- else
- return 0;
-}
-
-static inline int
-iface_match(struct ifnet *ifp, union ip_fw_if *ifu, int byname)
-{
- /* Check by name or by IP address */
- if (byname) {
- /* Check unit number (-1 is wildcard) */
- if (ifu->fu_via_if.unit != -1
- && ifp->if_unit != ifu->fu_via_if.unit)
- return(0);
- /* Check name */
- if (strncmp(ifp->if_name, ifu->fu_via_if.name, FW_IFNLEN))
- return(0);
- return(1);
- } else if (ifu->fu_via_ip.s_addr != 0) { /* Zero == wildcard */
- struct ifaddr *ia;
-
- for (ia = ifp->if_addrlist; ia; ia = ia->ifa_next) {
- if (ia->ifa_addr == NULL)
- continue;
- if (ia->ifa_addr->sa_family != AF_INET)
- continue;
- if (ifu->fu_via_ip.s_addr != ((struct sockaddr_in *)
- (ia->ifa_addr))->sin_addr.s_addr)
- continue;
- return(1);
- }
- return(0);
- }
- return(1);
-}
-
-static void
-ipfw_report(struct ip_fw *f, struct ip *ip,
- struct ifnet *rif, struct ifnet *oif)
-{
- static int counter;
- struct tcphdr *const tcp = (struct tcphdr *) ((u_long *) ip+ ip->ip_hl);
- struct udphdr *const udp = (struct udphdr *) ((u_long *) ip+ ip->ip_hl);
- struct icmp *const icmp = (struct icmp *) ((u_long *) ip + ip->ip_hl);
- int count;
-
- count = f ? f->fw_pcnt : ++counter;
- if (fw_verbose_limit != 0 && count > fw_verbose_limit)
- return;
-
- /* Print command name */
- printf("ipfw: %d ", f ? f->fw_number : -1);
- if (!f)
- printf("Refuse");
- else
- switch (f->fw_flg & IP_FW_F_COMMAND) {
- case IP_FW_F_DENY:
- printf("Deny");
- break;
- case IP_FW_F_REJECT:
- if (f->fw_reject_code == IP_FW_REJECT_RST)
- printf("Reset");
- else
- printf("Unreach");
- break;
- case IP_FW_F_ACCEPT:
- printf("Accept");
- break;
- case IP_FW_F_COUNT:
- printf("Count");
- break;
- case IP_FW_F_DIVERT:
- printf("Divert %d", f->fw_divert_port);
- break;
- case IP_FW_F_TEE:
- printf("Tee %d", f->fw_divert_port);
- break;
- case IP_FW_F_SKIPTO:
- printf("SkipTo %d", f->fw_skipto_rule);
- break;
- default:
- printf("UNKNOWN");
- break;
- }
- printf(" ");
-
- switch (ip->ip_p) {
- case IPPROTO_TCP:
- printf("TCP ");
- print_ip(ip->ip_src);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d ", ntohs(tcp->th_sport));
- else
- printf(" ");
- print_ip(ip->ip_dst);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d", ntohs(tcp->th_dport));
- break;
- case IPPROTO_UDP:
- printf("UDP ");
- print_ip(ip->ip_src);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d ", ntohs(udp->uh_sport));
- else
- printf(" ");
- print_ip(ip->ip_dst);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d", ntohs(udp->uh_dport));
- break;
- case IPPROTO_ICMP:
- printf("ICMP:%u.%u ", icmp->icmp_type, icmp->icmp_code);
- print_ip(ip->ip_src);
- printf(" ");
- print_ip(ip->ip_dst);
- break;
- default:
- printf("P:%d ", ip->ip_p);
- print_ip(ip->ip_src);
- printf(" ");
- print_ip(ip->ip_dst);
- break;
- }
- if (oif)
- printf(" out via %s%d", oif->if_name, oif->if_unit);
- else if (rif)
- printf(" in via %s%d", rif->if_name, rif->if_unit);
- if ((ip->ip_off & IP_OFFMASK))
- printf(" Fragment = %d",ip->ip_off & IP_OFFMASK);
- printf("\n");
- if (fw_verbose_limit != 0 && count == fw_verbose_limit)
- printf("ipfw: limit reached on rule #%d\n",
- f ? f->fw_number : -1);
-}
-
-/*
- * Parameters:
- *
- * ip Pointer to packet header (struct ip *)
- * hlen Packet header length
- * oif Outgoing interface, or NULL if packet is incoming
- * ignport Ignore all divert/tee rules to this port (if non-zero)
- * *m The packet; we set to NULL when/if we nuke it.
- *
- * Return value:
- *
- * 0 The packet is to be accepted and routed normally OR
- * the packet was denied/rejected and has been dropped;
- * in the latter case, *m is equal to NULL upon return.
- * port Divert the packet to port.
- */
-
-static int
-ip_fw_chk(struct ip **pip, int hlen,
- struct ifnet *oif, int ignport, struct mbuf **m)
-{
- struct ip_fw_chain *chain;
- struct ip_fw *rule = NULL;
- struct ip *ip = *pip;
- struct ifnet *const rif = (*m)->m_pkthdr.rcvif;
- u_short offset = (ip->ip_off & IP_OFFMASK);
- u_short src_port, dst_port;
-
- /*
- * Go down the chain, looking for enlightment
- */
- for (chain=ip_fw_chain.lh_first; chain; chain = chain->chain.le_next) {
- register struct ip_fw *const f = chain->rule;
-
- /* Check direction inbound */
- if (!oif && !(f->fw_flg & IP_FW_F_IN))
- continue;
-
- /* Check direction outbound */
- if (oif && !(f->fw_flg & IP_FW_F_OUT))
- continue;
-
- /* Fragments */
- if ((f->fw_flg & IP_FW_F_FRAG) && !(ip->ip_off & IP_OFFMASK))
- continue;
-
- /* If src-addr doesn't match, not this rule. */
- if (((f->fw_flg & IP_FW_F_INVSRC) != 0) ^ ((ip->ip_src.s_addr
- & f->fw_smsk.s_addr) != f->fw_src.s_addr))
- continue;
-
- /* If dest-addr doesn't match, not this rule. */
- if (((f->fw_flg & IP_FW_F_INVDST) != 0) ^ ((ip->ip_dst.s_addr
- & f->fw_dmsk.s_addr) != f->fw_dst.s_addr))
- continue;
-
- /* Interface check */
- if ((f->fw_flg & IF_FW_F_VIAHACK) == IF_FW_F_VIAHACK) {
- struct ifnet *const iface = oif ? oif : rif;
-
- /* Backwards compatibility hack for "via" */
- if (!iface || !iface_match(iface,
- &f->fw_in_if, f->fw_flg & IP_FW_F_OIFNAME))
- continue;
- } else {
- /* Check receive interface */
- if ((f->fw_flg & IP_FW_F_IIFACE)
- && (!rif || !iface_match(rif,
- &f->fw_in_if, f->fw_flg & IP_FW_F_IIFNAME)))
- continue;
- /* Check outgoing interface */
- if ((f->fw_flg & IP_FW_F_OIFACE)
- && (!oif || !iface_match(oif,
- &f->fw_out_if, f->fw_flg & IP_FW_F_OIFNAME)))
- continue;
- }
-
- /* Check IP options */
- if (f->fw_ipopt != f->fw_ipnopt && !ipopts_match(ip, f))
- continue;
-
- /* Check protocol; if wildcard, match */
- if (f->fw_prot == IPPROTO_IP)
- goto got_match;
-
- /* If different, don't match */
- if (ip->ip_p != f->fw_prot)
- continue;
-
-#define PULLUP_TO(len) do { \
- if ((*m)->m_len < (len) \
- && (*m = m_pullup(*m, (len))) == 0) { \
- goto bogusfrag; \
- } \
- *pip = ip = mtod(*m, struct ip *); \
- offset = (ip->ip_off & IP_OFFMASK); \
- } while (0)
-
- /* Protocol specific checks */
- switch (ip->ip_p) {
- case IPPROTO_TCP:
- {
- struct tcphdr *tcp;
-
- if (offset == 1) /* cf. RFC 1858 */
- goto bogusfrag;
- if (offset != 0) {
- /*
- * TCP flags and ports aren't available in this
- * packet -- if this rule specified either one,
- * we consider the rule a non-match.
- */
- if (f->fw_nports != 0 ||
- f->fw_tcpf != f->fw_tcpnf)
- continue;
-
- break;
- }
- PULLUP_TO(hlen + 14);
- tcp = (struct tcphdr *) ((u_long *)ip + ip->ip_hl);
- if (f->fw_tcpf != f->fw_tcpnf && !tcpflg_match(tcp, f))
- continue;
- src_port = ntohs(tcp->th_sport);
- dst_port = ntohs(tcp->th_dport);
- goto check_ports;
- }
-
- case IPPROTO_UDP:
- {
- struct udphdr *udp;
-
- if (offset != 0) {
- /*
- * Port specification is unavailable -- if this
- * rule specifies a port, we consider the rule
- * a non-match.
- */
- if (f->fw_nports != 0)
- continue;
-
- break;
- }
- PULLUP_TO(hlen + 4);
- udp = (struct udphdr *) ((u_long *)ip + ip->ip_hl);
- src_port = ntohs(udp->uh_sport);
- dst_port = ntohs(udp->uh_dport);
-check_ports:
- if (!port_match(&f->fw_pts[0],
- IP_FW_GETNSRCP(f), src_port,
- f->fw_flg & IP_FW_F_SRNG))
- continue;
- if (!port_match(&f->fw_pts[IP_FW_GETNSRCP(f)],
- IP_FW_GETNDSTP(f), dst_port,
- f->fw_flg & IP_FW_F_DRNG))
- continue;
- break;
- }
-
- case IPPROTO_ICMP:
- {
- struct icmp *icmp;
-
- if (offset != 0) /* Type isn't valid */
- break;
- PULLUP_TO(hlen + 2);
- icmp = (struct icmp *) ((u_long *)ip + ip->ip_hl);
- if (!icmptype_match(icmp, f))
- continue;
- break;
- }
-#undef PULLUP_TO
-
-bogusfrag:
- if (fw_verbose)
- ipfw_report(NULL, ip, rif, oif);
- goto dropit;
- }
-
-got_match:
- /* Ignore divert/tee rule if socket port is "ignport" */
- switch (f->fw_flg & IP_FW_F_COMMAND) {
- case IP_FW_F_DIVERT:
- case IP_FW_F_TEE:
- if (f->fw_divert_port == ignport)
- continue; /* ignore this rule */
- break;
- }
-
- /* Update statistics */
- f->fw_pcnt += 1;
- f->fw_bcnt += ip->ip_len;
- f->timestamp = rtems_bsdnet_seconds_since_boot();
-
- /* Log to console if desired */
- if ((f->fw_flg & IP_FW_F_PRN) && fw_verbose)
- ipfw_report(f, ip, rif, oif);
-
- /* Take appropriate action */
- switch (f->fw_flg & IP_FW_F_COMMAND) {
- case IP_FW_F_ACCEPT:
- return(0);
- case IP_FW_F_COUNT:
- continue;
- case IP_FW_F_DIVERT:
- return(f->fw_divert_port);
- case IP_FW_F_TEE:
- /*
- * XXX someday tee packet here, but beware that you
- * can't use m_copym() or m_copypacket() because
- * the divert input routine modifies the mbuf
- * (and these routines only increment reference
- * counts in the case of mbuf clusters), so need
- * to write custom routine.
- */
- continue;
- case IP_FW_F_SKIPTO:
-#ifdef DIAGNOSTIC
- while (chain->chain.le_next
- && chain->chain.le_next->rule->fw_number
- < f->fw_skipto_rule)
-#else
- while (chain->chain.le_next->rule->fw_number
- < f->fw_skipto_rule)
-#endif
- chain = chain->chain.le_next;
- continue;
- }
-
- /* Deny/reject this packet using this rule */
- rule = f;
- break;
- }
-
-#ifdef DIAGNOSTIC
- /* Rule 65535 should always be there and should always match */
- if (!chain)
- panic("ip_fw: chain");
-#endif
-
- /*
- * At this point, we're going to drop the packet.
- * Send a reject notice if all of the following are true:
- *
- * - The packet matched a reject rule
- * - The packet is not an ICMP packet
- * - The packet is not a multicast or broadcast packet
- */
- if ((rule->fw_flg & IP_FW_F_COMMAND) == IP_FW_F_REJECT
- && ip->ip_p != IPPROTO_ICMP
- && !((*m)->m_flags & (M_BCAST|M_MCAST))
- && !IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- switch (rule->fw_reject_code) {
- case IP_FW_REJECT_RST:
- {
- struct tcphdr *const tcp =
- (struct tcphdr *) ((u_long *)ip + ip->ip_hl);
- struct tcpiphdr ti, *const tip = (struct tcpiphdr *) ip;
-
- if (offset != 0 || (tcp->th_flags & TH_RST))
- break;
- ti.ti_i = *((struct ipovly *) ip);
- ti.ti_t = *tcp;
- bcopy(&ti, ip, sizeof(ti));
- NTOHL(tip->ti_seq);
- NTOHL(tip->ti_ack);
- tip->ti_len = ip->ip_len - hlen - (tip->ti_off << 2);
- if (tcp->th_flags & TH_ACK) {
- tcp_respond(NULL, tip, *m,
- (tcp_seq)0, ntohl(tcp->th_ack), TH_RST);
- } else {
- if (tcp->th_flags & TH_SYN)
- tip->ti_len++;
- tcp_respond(NULL, tip, *m, tip->ti_seq
- + tip->ti_len, (tcp_seq)0, TH_RST|TH_ACK);
- }
- *m = NULL;
- break;
- }
- default: /* Send an ICMP unreachable using code */
- icmp_error(*m, ICMP_UNREACH,
- rule->fw_reject_code, 0L, 0);
- *m = NULL;
- break;
- }
- }
-
-dropit:
- /*
- * Finally, drop the packet.
- */
- if (*m) {
- m_freem(*m);
- *m = NULL;
- }
- return(0);
-}
-
-static int
-add_entry(struct ip_fw_head *chainptr, struct ip_fw *frwl)
-{
- struct ip_fw *ftmp = 0;
- struct ip_fw_chain *fwc = 0, *fcp, *fcpl = 0;
- u_short nbr = 0;
- int s;
-
- fwc = malloc(sizeof *fwc, M_IPFW, M_DONTWAIT);
- ftmp = malloc(sizeof *ftmp, M_IPFW, M_DONTWAIT);
- if (!fwc || !ftmp) {
- dprintf(("%s malloc said no\n", err_prefix));
- if (fwc) free(fwc, M_IPFW);
- if (ftmp) free(ftmp, M_IPFW);
- return (ENOSPC);
- }
-
- bcopy(frwl, ftmp, sizeof(struct ip_fw));
- ftmp->fw_in_if.fu_via_if.name[FW_IFNLEN - 1] = '\0';
- ftmp->fw_pcnt = 0L;
- ftmp->fw_bcnt = 0L;
- fwc->rule = ftmp;
-
- s = splnet();
-
- if (!chainptr->lh_first) {
- LIST_INSERT_HEAD(chainptr, fwc, chain);
- splx(s);
- return(0);
- } else if (ftmp->fw_number == (u_short)-1) {
- if (fwc) free(fwc, M_IPFW);
- if (ftmp) free(ftmp, M_IPFW);
- splx(s);
- dprintf(("%s bad rule number\n", err_prefix));
- return (EINVAL);
- }
-
- /* If entry number is 0, find highest numbered rule and add 100 */
- if (ftmp->fw_number == 0) {
- for (fcp = chainptr->lh_first; fcp; fcp = fcp->chain.le_next) {
- if (fcp->rule->fw_number != (u_short)-1)
- nbr = fcp->rule->fw_number;
- else
- break;
- }
- if (nbr < (u_short)-1 - 100)
- nbr += 100;
- ftmp->fw_number = nbr;
- }
-
- /* Got a valid number; now insert it, keeping the list ordered */
- for (fcp = chainptr->lh_first; fcp; fcp = fcp->chain.le_next) {
- if (fcp->rule->fw_number > ftmp->fw_number) {
- if (fcpl) {
- LIST_INSERT_AFTER(fcpl, fwc, chain);
- } else {
- LIST_INSERT_HEAD(chainptr, fwc, chain);
- }
- break;
- } else {
- fcpl = fcp;
- }
- }
-
- splx(s);
- return (0);
-}
-
-static int
-del_entry(struct ip_fw_head *chainptr, u_short number)
-{
- struct ip_fw_chain *fcp;
- int s;
-
- s = splnet();
-
- fcp = chainptr->lh_first;
- if (number != (u_short)-1) {
- for (; fcp; fcp = fcp->chain.le_next) {
- if (fcp->rule->fw_number == number) {
- LIST_REMOVE(fcp, chain);
- splx(s);
- free(fcp->rule, M_IPFW);
- free(fcp, M_IPFW);
- return 0;
- }
- }
- }
-
- splx(s);
- return (EINVAL);
-}
-
-static int
-zero_entry(struct mbuf *m)
-{
- struct ip_fw *frwl;
- struct ip_fw_chain *fcp;
- int s;
-
- if (m) {
- if (m->m_len != sizeof(struct ip_fw))
- return(EINVAL);
- frwl = mtod(m, struct ip_fw *);
- }
- else
- frwl = NULL;
-
- /*
- * It's possible to insert multiple chain entries with the
- * same number, so we don't stop after finding the first
- * match if zeroing a specific entry.
- */
- s = splnet();
- for (fcp = ip_fw_chain.lh_first; fcp; fcp = fcp->chain.le_next)
- if (!frwl || frwl->fw_number == fcp->rule->fw_number) {
- fcp->rule->fw_bcnt = fcp->rule->fw_pcnt = 0;
- fcp->rule->timestamp = 0;
- }
- splx(s);
-
- if (fw_verbose) {
- if (frwl)
- printf("ipfw: Entry %d cleared.\n", frwl->fw_number);
- else
- printf("ipfw: Accounting cleared.\n");
- }
-
- return(0);
-}
-
-static struct ip_fw *
-check_ipfw_mbuf(struct mbuf *m)
-{
- /* Check length */
- if (m->m_len != sizeof(struct ip_fw)) {
- dprintf(("%s len=%d, want %d\n", err_prefix, m->m_len,
- (int)sizeof(struct ip_fw)));
- return (NULL);
- }
- return(check_ipfw_struct(mtod(m, struct ip_fw *)));
-}
-
-static struct ip_fw *
-check_ipfw_struct(struct ip_fw *frwl)
-{
- /* Check for invalid flag bits */
- if ((frwl->fw_flg & ~IP_FW_F_MASK) != 0) {
- dprintf(("%s undefined flag bits set (flags=%x)\n",
- err_prefix, frwl->fw_flg));
- return (NULL);
- }
- /* Must apply to incoming or outgoing (or both) */
- if (!(frwl->fw_flg & (IP_FW_F_IN | IP_FW_F_OUT))) {
- dprintf(("%s neither in nor out\n", err_prefix));
- return (NULL);
- }
- /* Empty interface name is no good */
- if (((frwl->fw_flg & IP_FW_F_IIFNAME)
- && !*frwl->fw_in_if.fu_via_if.name)
- || ((frwl->fw_flg & IP_FW_F_OIFNAME)
- && !*frwl->fw_out_if.fu_via_if.name)) {
- dprintf(("%s empty interface name\n", err_prefix));
- return (NULL);
- }
- /* Sanity check interface matching */
- if ((frwl->fw_flg & IF_FW_F_VIAHACK) == IF_FW_F_VIAHACK) {
- ; /* allow "via" backwards compatibility */
- } else if ((frwl->fw_flg & IP_FW_F_IN)
- && (frwl->fw_flg & IP_FW_F_OIFACE)) {
- dprintf(("%s outgoing interface check on incoming\n",
- err_prefix));
- return (NULL);
- }
- /* Sanity check port ranges */
- if ((frwl->fw_flg & IP_FW_F_SRNG) && IP_FW_GETNSRCP(frwl) < 2) {
- dprintf(("%s src range set but n_src_p=%d\n",
- err_prefix, IP_FW_GETNSRCP(frwl)));
- return (NULL);
- }
- if ((frwl->fw_flg & IP_FW_F_DRNG) && IP_FW_GETNDSTP(frwl) < 2) {
- dprintf(("%s dst range set but n_dst_p=%d\n",
- err_prefix, IP_FW_GETNDSTP(frwl)));
- return (NULL);
- }
- if (IP_FW_GETNSRCP(frwl) + IP_FW_GETNDSTP(frwl) > IP_FW_MAX_PORTS) {
- dprintf(("%s too many ports (%d+%d)\n",
- err_prefix, IP_FW_GETNSRCP(frwl), IP_FW_GETNDSTP(frwl)));
- return (NULL);
- }
- /*
- * Protocols other than TCP/UDP don't use port range
- */
- if ((frwl->fw_prot != IPPROTO_TCP) &&
- (frwl->fw_prot != IPPROTO_UDP) &&
- (IP_FW_GETNSRCP(frwl) || IP_FW_GETNDSTP(frwl))) {
- dprintf(("%s port(s) specified for non TCP/UDP rule\n",
- err_prefix));
- return(NULL);
- }
-
- /*
- * Rather than modify the entry to make such entries work,
- * we reject this rule and require user level utilities
- * to enforce whatever policy they deem appropriate.
- */
- if ((frwl->fw_src.s_addr & (~frwl->fw_smsk.s_addr)) ||
- (frwl->fw_dst.s_addr & (~frwl->fw_dmsk.s_addr))) {
- dprintf(("%s rule never matches\n", err_prefix));
- return(NULL);
- }
-
- if ((frwl->fw_flg & IP_FW_F_FRAG) &&
- (frwl->fw_prot == IPPROTO_UDP || frwl->fw_prot == IPPROTO_TCP)) {
- if (frwl->fw_nports) {
- dprintf(("%s cannot mix 'frag' and ports\n", err_prefix));
- return(NULL);
- }
- if (frwl->fw_prot == IPPROTO_TCP &&
- frwl->fw_tcpf != frwl->fw_tcpnf) {
- dprintf(("%s cannot mix 'frag' with TCP flags\n", err_prefix));
- return(NULL);
- }
- }
-
- /* Check command specific stuff */
- switch (frwl->fw_flg & IP_FW_F_COMMAND)
- {
- case IP_FW_F_REJECT:
- if (frwl->fw_reject_code >= 0x100
- && !(frwl->fw_prot == IPPROTO_TCP
- && frwl->fw_reject_code == IP_FW_REJECT_RST)) {
- dprintf(("%s unknown reject code\n", err_prefix));
- return(NULL);
- }
- break;
- case IP_FW_F_DIVERT: /* Diverting to port zero is invalid */
- case IP_FW_F_TEE:
- if (frwl->fw_divert_port == 0) {
- dprintf(("%s can't divert to port 0\n", err_prefix));
- return (NULL);
- }
- break;
- case IP_FW_F_DENY:
- case IP_FW_F_ACCEPT:
- case IP_FW_F_COUNT:
- case IP_FW_F_SKIPTO:
- break;
- default:
- dprintf(("%s invalid command\n", err_prefix));
- return(NULL);
- }
-
- return frwl;
-}
-
-static int
-ip_fw_ctl(int stage, struct mbuf **mm)
-{
- int error;
- struct mbuf *m;
-
- if (stage == IP_FW_GET) {
- struct ip_fw_chain *fcp = ip_fw_chain.lh_first;
- *mm = m = m_get(M_WAIT, MT_SOOPTS);
- for (; fcp; fcp = fcp->chain.le_next) {
- memcpy(m->m_data, fcp->rule, sizeof *(fcp->rule));
- m->m_len = sizeof *(fcp->rule);
- m->m_next = m_get(M_WAIT, MT_SOOPTS);
- m = m->m_next;
- m->m_len = 0;
- }
- return (0);
- }
- m = *mm;
- /* only allow get calls if secure mode > 2 */
- if (securelevel > 2) {
- if (m) (void)m_free(m);
- return(EPERM);
- }
- if (stage == IP_FW_FLUSH) {
- while (ip_fw_chain.lh_first != NULL &&
- ip_fw_chain.lh_first->rule->fw_number != (u_short)-1) {
- struct ip_fw_chain *fcp = ip_fw_chain.lh_first;
- int s = splnet();
- LIST_REMOVE(ip_fw_chain.lh_first, chain);
- splx(s);
- free(fcp->rule, M_IPFW);
- free(fcp, M_IPFW);
- }
- if (m) (void)m_free(m);
- return (0);
- }
- if (stage == IP_FW_ZERO) {
- error = zero_entry(m);
- if (m) (void)m_free(m);
- return (error);
- }
- if (m == NULL) {
- printf("%s NULL mbuf ptr\n", err_prefix);
- return (EINVAL);
- }
-
- if (stage == IP_FW_ADD) {
- struct ip_fw *frwl = check_ipfw_mbuf(m);
-
- if (!frwl)
- error = EINVAL;
- else
- error = add_entry(&ip_fw_chain, frwl);
- if (m) (void)m_free(m);
- return error;
- }
- if (stage == IP_FW_DEL) {
- if (m->m_len != sizeof(struct ip_fw)) {
- dprintf(("%s len=%d, want %d\n", err_prefix, m->m_len,
- (int)sizeof(struct ip_fw)));
- error = EINVAL;
- } else if (mtod(m, struct ip_fw *)->fw_number == (u_short)-1) {
- dprintf(("%s can't delete rule 65535\n", err_prefix));
- error = EINVAL;
- } else
- error = del_entry(&ip_fw_chain,
- mtod(m, struct ip_fw *)->fw_number);
- if (m) (void)m_free(m);
- return error;
- }
-
- dprintf(("%s unknown request %d\n", err_prefix, stage));
- if (m) (void)m_free(m);
- return (EINVAL);
-}
-
-void
-ip_fw_init(void)
-{
- struct ip_fw default_rule;
-
- ip_fw_chk_ptr = ip_fw_chk;
- ip_fw_ctl_ptr = ip_fw_ctl;
- LIST_INIT(&ip_fw_chain);
-
- bzero(&default_rule, sizeof default_rule);
- default_rule.fw_prot = IPPROTO_IP;
- default_rule.fw_number = (u_short)-1;
-#ifdef IPFIREWALL_DEFAULT_TO_ACCEPT
- default_rule.fw_flg |= IP_FW_F_ACCEPT;
-#else
- default_rule.fw_flg |= IP_FW_F_DENY;
-#endif
- default_rule.fw_flg |= IP_FW_F_IN | IP_FW_F_OUT;
- if (check_ipfw_struct(&default_rule) == NULL ||
- add_entry(&ip_fw_chain, &default_rule))
- panic(__FUNCTION__);
-
- printf("IP packet filtering initialized, "
-#ifdef IPDIVERT
- "divert enabled, ");
-#else
- "divert disabled, ");
-#endif
-#ifdef IPFIREWALL_DEFAULT_TO_ACCEPT
- printf("default to accept, ");
-#endif
-#ifndef IPFIREWALL_VERBOSE
- printf("logging disabled\n");
-#else
- if (fw_verbose_limit == 0)
- printf("unlimited logging\n");
- else
- printf("logging limited to %d packets/entry\n",
- fw_verbose_limit);
-#endif
-}
-
-#ifdef IPFIREWALL_MODULE
-
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-MOD_MISC(ipfw);
-
-static int
-ipfw_load(struct lkm_table *lkmtp, int cmd)
-{
- int s=splnet();
-
- old_chk_ptr = ip_fw_chk_ptr;
- old_ctl_ptr = ip_fw_ctl_ptr;
-
- ip_fw_init();
- splx(s);
- return 0;
-}
-
-static int
-ipfw_unload(struct lkm_table *lkmtp, int cmd)
-{
- int s=splnet();
-
- ip_fw_chk_ptr = old_chk_ptr;
- ip_fw_ctl_ptr = old_ctl_ptr;
-
- while (ip_fw_chain.lh_first != NULL) {
- struct ip_fw_chain *fcp = ip_fw_chain.lh_first;
- LIST_REMOVE(ip_fw_chain.lh_first, chain);
- free(fcp->rule, M_IPFW);
- free(fcp, M_IPFW);
- }
-
- splx(s);
- printf("IP firewall unloaded\n");
- return 0;
-}
-
-int
-ipfw_mod(struct lkm_table *lkmtp, int cmd, int ver)
-{
- DISPATCH(lkmtp, cmd, ver, ipfw_load, ipfw_unload, lkm_nullcmd);
-}
-#endif
diff --git a/c/src/libnetworking/netinet/ip_fw.h b/c/src/libnetworking/netinet/ip_fw.h
deleted file mode 100644
index cab7f4ac93..0000000000
--- a/c/src/libnetworking/netinet/ip_fw.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 1993 Daniel Boulet
- * Copyright (c) 1994 Ugen J.S.Antsilevich
- *
- * Redistribution and use in source forms, with and without modification,
- * are permitted provided that this entire comment appears intact.
- *
- * Redistribution in binary form may occur without any restrictions.
- * Obviously, it would be nice if you gave credit where credit is due
- * but requiring it would be too onerous.
- *
- * This software is provided ``AS IS'' without any warranties of any kind.
- *
- * $Id$
- */
-
-#ifndef _IP_FW_H
-#define _IP_FW_H
-
-#include <net/if.h>
-
-/*
- * This union structure identifies an interface, either explicitly
- * by name or implicitly by IP address. The flags IP_FW_F_IIFNAME
- * and IP_FW_F_OIFNAME say how to interpret this structure. An
- * interface unit number of -1 matches any unit number, while an
- * IP address of 0.0.0.0 indicates matches any interface.
- *
- * The receive and transmit interfaces are only compared against the
- * the packet if the corresponding bit (IP_FW_F_IIFACE or IP_FW_F_OIFACE)
- * is set. Note some packets lack a receive or transmit interface
- * (in which case the missing "interface" never matches).
- */
-
-union ip_fw_if {
- struct in_addr fu_via_ip; /* Specified by IP address */
- struct { /* Specified by interface name */
-#define FW_IFNLEN IFNAMSIZ
- char name[FW_IFNLEN];
- short unit; /* -1 means match any unit */
- } fu_via_if;
-};
-
-/*
- * Format of an IP firewall descriptor
- *
- * fw_src, fw_dst, fw_smsk, fw_dmsk are always stored in network byte order.
- * fw_flg and fw_n*p are stored in host byte order (of course).
- * Port numbers are stored in HOST byte order.
- * Warning: setsockopt() will fail if sizeof(struct ip_fw) > MLEN (108)
- */
-
-struct ip_fw {
- u_long fw_pcnt,fw_bcnt; /* Packet and byte counters */
- struct in_addr fw_src, fw_dst; /* Source and destination IP addr */
- struct in_addr fw_smsk, fw_dmsk; /* Mask for src and dest IP addr */
- u_short fw_number; /* Rule number */
- u_short fw_flg; /* Flags word */
-#define IP_FW_MAX_PORTS 10 /* A reasonable maximum */
- u_short fw_pts[IP_FW_MAX_PORTS]; /* Array of port numbers to match */
- u_char fw_ipopt,fw_ipnopt; /* IP options set/unset */
- u_char fw_tcpf,fw_tcpnf; /* TCP flags set/unset */
-#define IP_FW_ICMPTYPES_DIM (32 / (sizeof(unsigned) * 8))
- unsigned fw_icmptypes[IP_FW_ICMPTYPES_DIM]; /* ICMP types bitmap */
- long timestamp; /* timestamp (tv_sec) of last match */
- union ip_fw_if fw_in_if, fw_out_if; /* Incoming and outgoing interfaces */
- union {
- u_short fu_divert_port; /* Divert/tee port (options IPDIVERT) */
- u_short fu_skipto_rule; /* SKIPTO command rule number */
- u_short fu_reject_code; /* REJECT response code */
- } fw_un;
- u_char fw_prot; /* IP protocol */
- u_char fw_nports; /* N'of src ports and # of dst ports */
- /* in ports array (dst ports follow */
- /* src ports; max of 10 ports in all; */
- /* count of 0 means match all ports) */
-};
-
-#define IP_FW_GETNSRCP(rule) ((rule)->fw_nports & 0x0f)
-#define IP_FW_SETNSRCP(rule, n) do { \
- (rule)->fw_nports &= ~0x0f; \
- (rule)->fw_nports |= (n); \
- } while (0)
-#define IP_FW_GETNDSTP(rule) ((rule)->fw_nports >> 4)
-#define IP_FW_SETNDSTP(rule, n) do { \
- (rule)->fw_nports &= ~0xf0; \
- (rule)->fw_nports |= (n) << 4;\
- } while (0)
-
-#define fw_divert_port fw_un.fu_divert_port
-#define fw_skipto_rule fw_un.fu_skipto_rule
-#define fw_reject_code fw_un.fu_reject_code
-
-struct ip_fw_chain {
- LIST_ENTRY(ip_fw_chain) chain;
- struct ip_fw *rule;
-};
-
-/*
- * Values for "flags" field .
- */
-#define IP_FW_F_IN 0x0001 /* Check inbound packets */
-#define IP_FW_F_OUT 0x0002 /* Check outbound packets */
-#define IP_FW_F_IIFACE 0x0004 /* Apply inbound interface test */
-#define IP_FW_F_OIFACE 0x0008 /* Apply outbound interface test */
-
-#define IP_FW_F_COMMAND 0x0070 /* Mask for type of chain entry: */
-#define IP_FW_F_DENY 0x0000 /* This is a deny rule */
-#define IP_FW_F_REJECT 0x0010 /* Deny and send a response packet */
-#define IP_FW_F_ACCEPT 0x0020 /* This is an accept rule */
-#define IP_FW_F_COUNT 0x0030 /* This is a count rule */
-#define IP_FW_F_DIVERT 0x0040 /* This is a divert rule */
-#define IP_FW_F_TEE 0x0050 /* This is a tee rule */
-#define IP_FW_F_SKIPTO 0x0060 /* This is a skipto rule */
-
-#define IP_FW_F_PRN 0x0080 /* Print if this rule matches */
-
-#define IP_FW_F_SRNG 0x0100 /* The first two src ports are a min *
- * and max range (stored in host byte *
- * order). */
-
-#define IP_FW_F_DRNG 0x0200 /* The first two dst ports are a min *
- * and max range (stored in host byte *
- * order). */
-
-#define IP_FW_F_IIFNAME 0x0400 /* In interface by name/unit (not IP) */
-#define IP_FW_F_OIFNAME 0x0800 /* Out interface by name/unit (not IP) */
-
-#define IP_FW_F_INVSRC 0x1000 /* Invert sense of src check */
-#define IP_FW_F_INVDST 0x2000 /* Invert sense of dst check */
-
-#define IP_FW_F_FRAG 0x4000 /* Fragment */
-
-#define IP_FW_F_ICMPBIT 0x8000 /* ICMP type bitmap is valid */
-
-#define IP_FW_F_MASK 0xFFFF /* All possible flag bits mask */
-
-/*
- * For backwards compatibility with rules specifying "via iface" but
- * not restricted to only "in" or "out" packets, we define this combination
- * of bits to represent this configuration.
- */
-
-#define IF_FW_F_VIAHACK (IP_FW_F_IN|IP_FW_F_OUT|IP_FW_F_IIFACE|IP_FW_F_OIFACE)
-
-/*
- * Definitions for REJECT response codes.
- * Values less than 256 correspond to ICMP unreachable codes.
- */
-#define IP_FW_REJECT_RST 0x0100 /* TCP packets: send RST */
-
-/*
- * Definitions for IP option names.
- */
-#define IP_FW_IPOPT_LSRR 0x01
-#define IP_FW_IPOPT_SSRR 0x02
-#define IP_FW_IPOPT_RR 0x04
-#define IP_FW_IPOPT_TS 0x08
-
-/*
- * Definitions for TCP flags.
- */
-#define IP_FW_TCPF_FIN TH_FIN
-#define IP_FW_TCPF_SYN TH_SYN
-#define IP_FW_TCPF_RST TH_RST
-#define IP_FW_TCPF_PSH TH_PUSH
-#define IP_FW_TCPF_ACK TH_ACK
-#define IP_FW_TCPF_URG TH_URG
-#define IP_FW_TCPF_ESTAB 0x40
-
-/*
- * Main firewall chains definitions and global var's definitions.
- */
-#ifdef KERNEL
-
-/*
- * Function definitions.
- */
-void ip_fw_init(void);
-
-#endif /* KERNEL */
-
-#endif /* _IP_FW_H */
diff --git a/c/src/libnetworking/netinet/ip_icmp.c b/c/src/libnetworking/netinet/ip_icmp.c
deleted file mode 100644
index a18dacca99..0000000000
--- a/c/src/libnetworking/netinet/ip_icmp.c
+++ /dev/null
@@ -1,710 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#define _IP_VHL
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_var.h>
-#include <netinet/icmp_var.h>
-
-/*
- * ICMP routines: error generation, receive packet processing, and
- * routines to turnaround packets back to the originator, and
- * host table maintenance routines.
- */
-
- struct icmpstat icmpstat;
-SYSCTL_STRUCT(_net_inet_icmp, ICMPCTL_STATS, stats, CTLFLAG_RD,
- &icmpstat, icmpstat, "");
-
-static int icmpmaskrepl = 0;
-SYSCTL_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_RW,
- &icmpmaskrepl, 0, "");
-
-static int icmpbmcastecho = 1;
-SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, &icmpbmcastecho,
- 0, "");
-
-#ifdef ICMPPRINTFS
-int icmpprintfs = 0;
-#endif
-
-static void icmp_reflect __P((struct mbuf *));
-static void icmp_send __P((struct mbuf *, struct mbuf *));
-static int ip_next_mtu __P((int, int));
-
-extern struct protosw inetsw[];
-
-/*
- * Generate an error packet of type error
- * in response to bad packet ip.
- */
-void
-icmp_error(n, type, code, dest, destifp)
- struct mbuf *n;
- int type, code;
- n_long dest;
- struct ifnet *destifp;
-{
- register struct ip *oip = mtod(n, struct ip *), *nip;
- register unsigned oiplen = IP_VHL_HL(oip->ip_vhl) << 2;
- register struct icmp *icp;
- register struct mbuf *m;
- unsigned icmplen;
-
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("icmp_error(%p, %x, %d)\n", oip, type, code);
-#endif
- if (type != ICMP_REDIRECT)
- icmpstat.icps_error++;
- /*
- * Don't send error if not the first fragment of message.
- * Don't error if the old packet protocol was ICMP
- * error message, only known informational types.
- */
- if (oip->ip_off &~ (IP_MF|IP_DF))
- goto freeit;
- if (oip->ip_p == IPPROTO_ICMP && type != ICMP_REDIRECT &&
- n->m_len >= oiplen + ICMP_MINLEN &&
- !ICMP_INFOTYPE(((struct icmp *)((caddr_t)oip + oiplen))->icmp_type)) {
- icmpstat.icps_oldicmp++;
- goto freeit;
- }
- /* Don't send error in response to a multicast or broadcast packet */
- if (n->m_flags & (M_BCAST|M_MCAST))
- goto freeit;
- /*
- * First, formulate icmp message
- */
- m = m_gethdr(M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- goto freeit;
- icmplen = oiplen + min(8, oip->ip_len);
- m->m_len = icmplen + ICMP_MINLEN;
- MH_ALIGN(m, m->m_len);
- icp = mtod(m, struct icmp *);
- if ((u_int)type > ICMP_MAXTYPE)
- panic("icmp_error");
- icmpstat.icps_outhist[type]++;
- icp->icmp_type = type;
- if (type == ICMP_REDIRECT)
- icp->icmp_gwaddr.s_addr = dest;
- else {
- icp->icmp_void = 0;
- /*
- * The following assignments assume an overlay with the
- * zeroed icmp_void field.
- */
- if (type == ICMP_PARAMPROB) {
- icp->icmp_pptr = code;
- code = 0;
- } else if (type == ICMP_UNREACH &&
- code == ICMP_UNREACH_NEEDFRAG && destifp) {
- icp->icmp_nextmtu = htons(destifp->if_mtu);
- }
- }
-
- icp->icmp_code = code;
- bcopy((caddr_t)oip, (caddr_t)&icp->icmp_ip, icmplen);
- nip = &icp->icmp_ip;
- nip->ip_len = htons((u_short)(nip->ip_len + oiplen));
-
- /*
- * Now, copy old ip header (without options)
- * in front of icmp message.
- */
- if (m->m_data - sizeof(struct ip) < m->m_pktdat)
- panic("icmp len");
- m->m_data -= sizeof(struct ip);
- m->m_len += sizeof(struct ip);
- m->m_pkthdr.len = m->m_len;
- m->m_pkthdr.rcvif = n->m_pkthdr.rcvif;
- nip = mtod(m, struct ip *);
- bcopy((caddr_t)oip, (caddr_t)nip, sizeof(struct ip));
- nip->ip_len = m->m_len;
- nip->ip_vhl = IP_VHL_BORING;
- nip->ip_p = IPPROTO_ICMP;
- nip->ip_tos = 0;
- icmp_reflect(m);
-
-freeit:
- m_freem(n);
-}
-
-static struct sockaddr_in icmpsrc = { sizeof (struct sockaddr_in), AF_INET };
-static struct sockaddr_in icmpdst = { sizeof (struct sockaddr_in), AF_INET };
-static struct sockaddr_in icmpgw = { sizeof (struct sockaddr_in), AF_INET };
-
-/*
- * Process a received ICMP message.
- */
-void
-icmp_input(m, hlen)
- register struct mbuf *m;
- int hlen;
-{
- register struct icmp *icp;
- register struct ip *ip = mtod(m, struct ip *);
- int icmplen = ip->ip_len;
- register int i;
- struct in_ifaddr *ia;
- void (*ctlfunc) __P((int, struct sockaddr *, void *));
- int code;
-
- /*
- * Locate icmp structure in mbuf, and check
- * that not corrupted and of at least minimum length.
- */
-#ifdef ICMPPRINTFS
- if (icmpprintfs) {
- char buf[4 * sizeof "123"];
- strcpy(buf, inet_ntoa(ip->ip_src));
- printf("icmp_input from %s to %s, len %d\n",
- buf, inet_ntoa(ip->ip_dst), icmplen);
- }
-#endif
- if (icmplen < ICMP_MINLEN) {
- icmpstat.icps_tooshort++;
- goto freeit;
- }
- i = hlen + min(icmplen, ICMP_ADVLENMIN);
- if (m->m_len < i && (m = m_pullup(m, i)) == 0) {
- icmpstat.icps_tooshort++;
- return;
- }
- ip = mtod(m, struct ip *);
- m->m_len -= hlen;
- m->m_data += hlen;
- icp = mtod(m, struct icmp *);
- if (in_cksum(m, icmplen)) {
- icmpstat.icps_checksum++;
- goto freeit;
- }
- m->m_len += hlen;
- m->m_data -= hlen;
-
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("icmp_input, type %d code %d\n", icp->icmp_type,
- icp->icmp_code);
-#endif
-
- /*
- * Message type specific processing.
- */
- if (icp->icmp_type > ICMP_MAXTYPE)
- goto raw;
- icmpstat.icps_inhist[icp->icmp_type]++;
- code = icp->icmp_code;
- switch (icp->icmp_type) {
-
- case ICMP_UNREACH:
- switch (code) {
- case ICMP_UNREACH_NET:
- case ICMP_UNREACH_HOST:
- case ICMP_UNREACH_PROTOCOL:
- case ICMP_UNREACH_PORT:
- case ICMP_UNREACH_SRCFAIL:
- code += PRC_UNREACH_NET;
- break;
-
- case ICMP_UNREACH_NEEDFRAG:
- code = PRC_MSGSIZE;
- break;
-
- case ICMP_UNREACH_NET_UNKNOWN:
- case ICMP_UNREACH_NET_PROHIB:
- case ICMP_UNREACH_TOSNET:
- code = PRC_UNREACH_NET;
- break;
-
- case ICMP_UNREACH_HOST_UNKNOWN:
- case ICMP_UNREACH_ISOLATED:
- case ICMP_UNREACH_HOST_PROHIB:
- case ICMP_UNREACH_TOSHOST:
- code = PRC_UNREACH_HOST;
- break;
-
- case ICMP_UNREACH_FILTER_PROHIB:
- case ICMP_UNREACH_HOST_PRECEDENCE:
- case ICMP_UNREACH_PRECEDENCE_CUTOFF:
- code = PRC_UNREACH_PORT;
- break;
-
- default:
- goto badcode;
- }
- goto deliver;
-
- case ICMP_TIMXCEED:
- if (code > 1)
- goto badcode;
- code += PRC_TIMXCEED_INTRANS;
- goto deliver;
-
- case ICMP_PARAMPROB:
- if (code > 1)
- goto badcode;
- code = PRC_PARAMPROB;
- goto deliver;
-
- case ICMP_SOURCEQUENCH:
- if (code)
- goto badcode;
- code = PRC_QUENCH;
- deliver:
- /*
- * Problem with datagram; advise higher level routines.
- */
- if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
- IP_VHL_HL(icp->icmp_ip.ip_vhl) < (sizeof(struct ip) >> 2)) {
- icmpstat.icps_badlen++;
- goto freeit;
- }
- NTOHS(icp->icmp_ip.ip_len);
- /* Discard ICMP's in response to multicast packets */
- if (IN_MULTICAST(ntohl(icp->icmp_ip.ip_dst.s_addr)))
- goto badcode;
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("deliver to protocol %d\n", icp->icmp_ip.ip_p);
-#endif
- icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
-#if 1
- /*
- * MTU discovery:
- * If we got a needfrag and there is a host route to the
- * original destination, and the MTU is not locked, then
- * set the MTU in the route to the suggested new value
- * (if given) and then notify as usual. The ULPs will
- * notice that the MTU has changed and adapt accordingly.
- * If no new MTU was suggested, then we guess a new one
- * less than the current value. If the new MTU is
- * unreasonably small (arbitrarily set at 296), then
- * we reset the MTU to the interface value and enable the
- * lock bit, indicating that we are no longer doing MTU
- * discovery.
- */
- if (code == PRC_MSGSIZE) {
- struct rtentry *rt;
- int mtu;
-
- rt = rtalloc1((struct sockaddr *)&icmpsrc, 0,
- RTF_CLONING | RTF_PRCLONING);
- if (rt && (rt->rt_flags & RTF_HOST)
- && !(rt->rt_rmx.rmx_locks & RTV_MTU)) {
- mtu = ntohs(icp->icmp_nextmtu);
- if (!mtu)
- mtu = ip_next_mtu(rt->rt_rmx.rmx_mtu,
- 1);
-#ifdef DEBUG_MTUDISC
- printf("MTU for %s reduced to %d\n",
- inet_ntoa(icmpsrc.sin_addr), mtu);
-#endif
- if (mtu < 296) {
- /* rt->rt_rmx.rmx_mtu =
- rt->rt_ifp->if_mtu; */
- rt->rt_rmx.rmx_locks |= RTV_MTU;
- } else if (rt->rt_rmx.rmx_mtu > mtu) {
- rt->rt_rmx.rmx_mtu = mtu;
- }
- }
- if (rt)
- RTFREE(rt);
- }
-
-#endif
- ctlfunc = inetsw[ip_protox[icp->icmp_ip.ip_p]].pr_ctlinput;
- if (ctlfunc)
- (*ctlfunc)(code, (struct sockaddr *)&icmpsrc,
- (void *)&icp->icmp_ip);
- break;
-
- badcode:
- icmpstat.icps_badcode++;
- break;
-
- case ICMP_ECHO:
- if (!icmpbmcastecho
- && (m->m_flags & (M_MCAST | M_BCAST)) != 0
- && IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- icmpstat.icps_bmcastecho++;
- break;
- }
- icp->icmp_type = ICMP_ECHOREPLY;
- goto reflect;
-
- case ICMP_TSTAMP:
- if (!icmpbmcastecho
- && (m->m_flags & (M_MCAST | M_BCAST)) != 0
- && IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- icmpstat.icps_bmcasttstamp++;
- break;
- }
- if (icmplen < ICMP_TSLEN) {
- icmpstat.icps_badlen++;
- break;
- }
- icp->icmp_type = ICMP_TSTAMPREPLY;
- icp->icmp_rtime = iptime();
- icp->icmp_ttime = icp->icmp_rtime; /* bogus, do later! */
- goto reflect;
-
- case ICMP_MASKREQ:
-#define satosin(sa) ((struct sockaddr_in *)(sa))
- if (icmpmaskrepl == 0)
- break;
- /*
- * We are not able to respond with all ones broadcast
- * unless we receive it over a point-to-point interface.
- */
- if (icmplen < ICMP_MASKLEN)
- break;
- switch (ip->ip_dst.s_addr) {
-
- case INADDR_BROADCAST:
- case INADDR_ANY:
- icmpdst.sin_addr = ip->ip_src;
- break;
-
- default:
- icmpdst.sin_addr = ip->ip_dst;
- }
- ia = (struct in_ifaddr *)ifaof_ifpforaddr(
- (struct sockaddr *)&icmpdst, m->m_pkthdr.rcvif);
- if (ia == 0)
- break;
- if (ia->ia_ifp == 0)
- break;
- icp->icmp_type = ICMP_MASKREPLY;
- icp->icmp_mask = ia->ia_sockmask.sin_addr.s_addr;
- if (ip->ip_src.s_addr == 0) {
- if (ia->ia_ifp->if_flags & IFF_BROADCAST)
- ip->ip_src = satosin(&ia->ia_broadaddr)->sin_addr;
- else if (ia->ia_ifp->if_flags & IFF_POINTOPOINT)
- ip->ip_src = satosin(&ia->ia_dstaddr)->sin_addr;
- }
-reflect:
- ip->ip_len += hlen; /* since ip_input deducts this */
- icmpstat.icps_reflect++;
- icmpstat.icps_outhist[icp->icmp_type]++;
- icmp_reflect(m);
- return;
-
- case ICMP_REDIRECT:
- if (code > 3)
- goto badcode;
- if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
- IP_VHL_HL(icp->icmp_ip.ip_vhl) < (sizeof(struct ip) >> 2)) {
- icmpstat.icps_badlen++;
- break;
- }
- /*
- * Short circuit routing redirects to force
- * immediate change in the kernel's routing
- * tables. The message is also handed to anyone
- * listening on a raw socket (e.g. the routing
- * daemon for use in updating its tables).
- */
- icmpgw.sin_addr = ip->ip_src;
- icmpdst.sin_addr = icp->icmp_gwaddr;
-#ifdef ICMPPRINTFS
- if (icmpprintfs) {
- char buf[4 * sizeof "123"];
- strcpy(buf, inet_ntoa(icp->icmp_ip.ip_dst));
-
- printf("redirect dst %s to %s\n",
- buf, inet_ntoa(icp->icmp_gwaddr));
- }
-#endif
- icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
- rtredirect((struct sockaddr *)&icmpsrc,
- (struct sockaddr *)&icmpdst,
- (struct sockaddr *)0, RTF_GATEWAY | RTF_HOST,
- (struct sockaddr *)&icmpgw, (struct rtentry **)0);
- pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&icmpsrc);
- break;
-
- /*
- * No kernel processing for the following;
- * just fall through to send to raw listener.
- */
- case ICMP_ECHOREPLY:
- case ICMP_ROUTERADVERT:
- case ICMP_ROUTERSOLICIT:
- case ICMP_TSTAMPREPLY:
- case ICMP_IREQREPLY:
- case ICMP_MASKREPLY:
- default:
- break;
- }
-
-raw:
- rip_input(m, hlen);
- return;
-
-freeit:
- m_freem(m);
-}
-
-/*
- * Reflect the ip packet back to the source
- */
-static void
-icmp_reflect(m)
- struct mbuf *m;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register struct in_ifaddr *ia;
- struct in_addr t;
- struct mbuf *opts = 0;
- int optlen = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof(struct ip);
-
- if (!in_canforward(ip->ip_src) &&
- ((ntohl(ip->ip_src.s_addr) & IN_CLASSA_NET) !=
- (IN_LOOPBACKNET << IN_CLASSA_NSHIFT))) {
- m_freem(m); /* Bad return address */
- goto done; /* Ip_output() will check for broadcast */
- }
- t = ip->ip_dst;
- ip->ip_dst = ip->ip_src;
- /*
- * If the incoming packet was addressed directly to us,
- * use dst as the src for the reply. Otherwise (broadcast
- * or anonymous), use the address which corresponds
- * to the incoming interface.
- */
- for (ia = in_ifaddr; ia; ia = ia->ia_next) {
- if (t.s_addr == IA_SIN(ia)->sin_addr.s_addr)
- break;
- if (ia->ia_ifp && (ia->ia_ifp->if_flags & IFF_BROADCAST) &&
- t.s_addr == satosin(&ia->ia_broadaddr)->sin_addr.s_addr)
- break;
- }
- icmpdst.sin_addr = t;
- if ((ia == (struct in_ifaddr *)0) && m->m_pkthdr.rcvif)
- ia = (struct in_ifaddr *)ifaof_ifpforaddr(
- (struct sockaddr *)&icmpdst, m->m_pkthdr.rcvif);
- /*
- * The following happens if the packet was not addressed to us,
- * and was received on an interface with no IP address.
- */
- if (ia == (struct in_ifaddr *)0)
- ia = in_ifaddr;
- t = IA_SIN(ia)->sin_addr;
- ip->ip_src = t;
- ip->ip_ttl = MAXTTL;
-
- if (optlen > 0) {
- register u_char *cp;
- int opt, cnt;
- u_int len;
-
- /*
- * Retrieve any source routing from the incoming packet;
- * add on any record-route or timestamp options.
- */
- cp = (u_char *) (ip + 1);
- if ((opts = ip_srcroute()) == 0 &&
- (opts = m_gethdr(M_DONTWAIT, MT_HEADER))) {
- opts->m_len = sizeof(struct in_addr);
- mtod(opts, struct in_addr *)->s_addr = 0;
- }
- if (opts) {
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("icmp_reflect optlen %d rt %d => ",
- optlen, opts->m_len);
-#endif
- for (cnt = optlen; cnt > 0; cnt -= len, cp += len) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- len = 1;
- else {
- len = cp[IPOPT_OLEN];
- if (len <= 0 || len > cnt)
- break;
- }
- /*
- * Should check for overflow, but it "can't happen"
- */
- if (opt == IPOPT_RR || opt == IPOPT_TS ||
- opt == IPOPT_SECURITY) {
- bcopy((caddr_t)cp,
- mtod(opts, caddr_t) + opts->m_len, len);
- opts->m_len += len;
- }
- }
- /* Terminate & pad, if necessary */
- cnt = opts->m_len % 4;
- if (cnt) {
- for (; cnt < 4; cnt++) {
- *(mtod(opts, caddr_t) + opts->m_len) =
- IPOPT_EOL;
- opts->m_len++;
- }
- }
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("%d\n", opts->m_len);
-#endif
- }
- /*
- * Now strip out original options by copying rest of first
- * mbuf's data back, and adjust the IP length.
- */
- ip->ip_len -= optlen;
- ip->ip_vhl = IP_VHL_BORING;
- m->m_len -= optlen;
- if (m->m_flags & M_PKTHDR)
- m->m_pkthdr.len -= optlen;
- optlen += sizeof(struct ip);
- bcopy((caddr_t)ip + optlen, (caddr_t)(ip + 1),
- (unsigned)(m->m_len - sizeof(struct ip)));
- }
- m->m_flags &= ~(M_BCAST|M_MCAST);
- icmp_send(m, opts);
-done:
- if (opts)
- (void)m_free(opts);
-}
-
-/*
- * Send an icmp packet back to the ip level,
- * after supplying a checksum.
- */
-static void
-icmp_send(m, opts)
- register struct mbuf *m;
- struct mbuf *opts;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register int hlen;
- register struct icmp *icp;
- struct route ro;
-
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
- m->m_data += hlen;
- m->m_len -= hlen;
- icp = mtod(m, struct icmp *);
- icp->icmp_cksum = 0;
- icp->icmp_cksum = in_cksum(m, ip->ip_len - hlen);
- m->m_data -= hlen;
- m->m_len += hlen;
-#ifdef ICMPPRINTFS
- if (icmpprintfs) {
- char buf[4 * sizeof "123"];
- strcpy(buf, inet_ntoa(ip->ip_dst));
- printf("icmp_send dst %s src %s\n",
- buf, inet_ntoa(ip->ip_src));
- }
-#endif
- bzero(&ro, sizeof ro);
- (void) ip_output(m, opts, &ro, 0, NULL);
- if (ro.ro_rt)
- RTFREE(ro.ro_rt);
-}
-
-n_time
-iptime()
-{
- struct timeval atv;
- u_long t;
-
- microtime(&atv);
- t = (atv.tv_sec % (24*60*60)) * 1000 + atv.tv_usec / 1000;
- return (htonl(t));
-}
-
-#if 1
-/*
- * Return the next larger or smaller MTU plateau (table from RFC 1191)
- * given current value MTU. If DIR is less than zero, a larger plateau
- * is returned; otherwise, a smaller value is returned.
- */
-static int
-ip_next_mtu(mtu, dir)
- int mtu;
- int dir;
-{
- static int mtutab[] = {
- 65535, 32000, 17914, 8166, 4352, 2002, 1492, 1006, 508, 296,
- 68, 0
- };
- int i;
-
- for (i = 0; i < (sizeof mtutab) / (sizeof mtutab[0]); i++) {
- if (mtu >= mtutab[i])
- break;
- }
-
- if (dir < 0) {
- if (i == 0) {
- return 0;
- } else {
- return mtutab[i - 1];
- }
- } else {
- if (mtutab[i] == 0) {
- return 0;
- } else if(mtu > mtutab[i]) {
- return mtutab[i];
- } else {
- return mtutab[i + 1];
- }
- }
-}
-#endif
diff --git a/c/src/libnetworking/netinet/ip_icmp.h b/c/src/libnetworking/netinet/ip_icmp.h
deleted file mode 100644
index 9d07a682de..0000000000
--- a/c/src/libnetworking/netinet/ip_icmp.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IP_ICMP_H_
-#define _NETINET_IP_ICMP_H_
-
-/*
- * Interface Control Message Protocol Definitions.
- * Per RFC 792, September 1981.
- */
-
-/*
- * Internal of an ICMP Router Advertisement
- */
-struct icmp_ra_addr {
- u_int32_t ira_addr;
- u_int32_t ira_preference;
-};
-
-/*
- * Structure of an icmp header.
- */
-struct icmp {
- u_char icmp_type; /* type of message, see below */
- u_char icmp_code; /* type sub code */
- u_short icmp_cksum; /* ones complement cksum of struct */
- union {
- u_char ih_pptr; /* ICMP_PARAMPROB */
- struct in_addr ih_gwaddr; /* ICMP_REDIRECT */
- struct ih_idseq {
- n_short icd_id;
- n_short icd_seq;
- } ih_idseq;
- int ih_void;
-
- /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
- struct ih_pmtu {
- n_short ipm_void;
- n_short ipm_nextmtu;
- } ih_pmtu;
-
- struct ih_rtradv {
- u_char irt_num_addrs;
- u_char irt_wpa;
- u_int16_t irt_lifetime;
- } ih_rtradv;
- } icmp_hun;
-#define icmp_pptr icmp_hun.ih_pptr
-#define icmp_gwaddr icmp_hun.ih_gwaddr
-#define icmp_id icmp_hun.ih_idseq.icd_id
-#define icmp_seq icmp_hun.ih_idseq.icd_seq
-#define icmp_void icmp_hun.ih_void
-#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
-#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
-#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
-#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
-#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
- union {
- struct id_ts {
- n_time its_otime;
- n_time its_rtime;
- n_time its_ttime;
- } id_ts;
- struct id_ip {
- struct ip idi_ip;
- /* options and then 64 bits of data */
- } id_ip;
- struct icmp_ra_addr id_radv;
- u_long id_mask;
- char id_data[1];
- } icmp_dun;
-#define icmp_otime icmp_dun.id_ts.its_otime
-#define icmp_rtime icmp_dun.id_ts.its_rtime
-#define icmp_ttime icmp_dun.id_ts.its_ttime
-#define icmp_ip icmp_dun.id_ip.idi_ip
-#define icmp_radv icmp_dun.id_radv
-#define icmp_mask icmp_dun.id_mask
-#define icmp_data icmp_dun.id_data
-};
-
-/*
- * Lower bounds on packet lengths for various types.
- * For the error advice packets must first insure that the
- * packet is large enough to contain the returned ip header.
- * Only then can we do the check to see if 64 bits of packet
- * data have been returned, since we need to check the returned
- * ip header length.
- */
-#define ICMP_MINLEN 8 /* abs minimum */
-#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */
-#define ICMP_MASKLEN 12 /* address mask */
-#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
-#ifndef _IP_VHL
-#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
- /* N.B.: must separately check that ip_hl >= 5 */
-#else
-#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
- /* N.B.: must separately check that header length >= 5 */
-#endif
-
-/*
- * Definition of type and code field values.
- */
-#define ICMP_ECHOREPLY 0 /* echo reply */
-#define ICMP_UNREACH 3 /* dest unreachable, codes: */
-#define ICMP_UNREACH_NET 0 /* bad net */
-#define ICMP_UNREACH_HOST 1 /* bad host */
-#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
-#define ICMP_UNREACH_PORT 3 /* bad port */
-#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
-#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
-#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
-#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
-#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
-#define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */
-#define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */
-#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
-#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
-#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
-#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
-#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
-#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
-#define ICMP_REDIRECT 5 /* shorter route, codes: */
-#define ICMP_REDIRECT_NET 0 /* for network */
-#define ICMP_REDIRECT_HOST 1 /* for host */
-#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
-#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
-#define ICMP_ECHO 8 /* echo service */
-#define ICMP_ROUTERADVERT 9 /* router advertisement */
-#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
-#define ICMP_TIMXCEED 11 /* time exceeded, code: */
-#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
-#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
-#define ICMP_PARAMPROB 12 /* ip header bad */
-#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
-#define ICMP_TSTAMP 13 /* timestamp request */
-#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
-#define ICMP_IREQ 15 /* information request */
-#define ICMP_IREQREPLY 16 /* information reply */
-#define ICMP_MASKREQ 17 /* address mask request */
-#define ICMP_MASKREPLY 18 /* address mask reply */
-
-#define ICMP_MAXTYPE 18
-
-#define ICMP_INFOTYPE(type) \
- ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
- (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
- (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
- (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
- (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
-
-#ifdef KERNEL
-void icmp_error __P((struct mbuf *, int, int, n_long, struct ifnet *));
-void icmp_input __P((struct mbuf *, int));
-#endif
-
-#endif
diff --git a/c/src/libnetworking/netinet/ip_input.c b/c/src/libnetworking/netinet/ip_input.c
deleted file mode 100644
index 4cc141933f..0000000000
--- a/c/src/libnetworking/netinet/ip_input.c
+++ /dev/null
@@ -1,1488 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)ip_input.c 8.2 (Berkeley) 1/4/94
- * $Id$
- * $ANA: ip_input.c,v 1.5 1996/09/18 14:34:59 wollman Exp $
- */
-
-#define _IP_VHL
-
-#include "opt_ipfw.h"
-
-#include <stddef.h>
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/route.h>
-#include <net/netisr.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <machine/in_cksum.h>
-
-#include <sys/socketvar.h>
-
-#ifdef IPFIREWALL
-#include <netinet/ip_fw.h>
-#endif
-
-int rsvp_on = 0;
-static int ip_rsvp_on;
-struct socket *ip_rsvpd;
-
-static int ipforwarding = 0;
-SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_RW,
- &ipforwarding, 0, "");
-
-static int ipsendredirects = 1; /* XXX */
-SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_RW,
- &ipsendredirects, 0, "");
-
-int ip_defttl = IPDEFTTL;
-SYSCTL_INT(_net_inet_ip, IPCTL_DEFTTL, ttl, CTLFLAG_RW,
- &ip_defttl, 0, "");
-
-static int ip_dosourceroute = 0;
-SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW,
- &ip_dosourceroute, 0, "");
-
-static int ip_acceptsourceroute = 0;
-SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute,
- CTLFLAG_RW, &ip_acceptsourceroute, 0, "");
-#ifdef DIAGNOSTIC
-static int ipprintfs = 0;
-#endif
-
-extern struct domain inetdomain;
-extern struct protosw inetsw[];
-u_char ip_protox[IPPROTO_MAX];
-static int ipqmaxlen = IFQ_MAXLEN;
-struct in_ifaddr *in_ifaddr; /* first inet address */
-struct ifqueue ipintrq;
-SYSCTL_INT(_net_inet_ip, IPCTL_INTRQMAXLEN, intr_queue_maxlen, CTLFLAG_RD,
- &ipintrq.ifq_maxlen, 0, "");
-SYSCTL_INT(_net_inet_ip, IPCTL_INTRQDROPS, intr_queue_drops, CTLFLAG_RD,
- &ipintrq.ifq_drops, 0, "");
-
-struct ipstat ipstat;
-
-/* Packet reassembly stuff */
-#define IPREASS_NHASH_LOG2 6
-#define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2)
-#define IPREASS_HMASK (IPREASS_NHASH - 1)
-#define IPREASS_HASH(x,y) \
- (((((x) & 0xF) | ((((x) >> 8) & 0xF) << 4)) ^ (y)) & IPREASS_HMASK)
-
-static struct ipq ipq[IPREASS_NHASH];
-static int nipq = 0; /* total # of reass queues */
-static int maxnipq;
-
-#ifdef IPCTL_DEFMTU
-SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW,
- &ip_mtu, 0, "");
-#endif
-
-#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1
-#undef COMPAT_IPFW
-#define COMPAT_IPFW 1
-#else
-#undef COMPAT_IPFW
-#endif
-
-#ifdef COMPAT_IPFW
-/* Firewall hooks */
-ip_fw_chk_t *ip_fw_chk_ptr;
-ip_fw_ctl_t *ip_fw_ctl_ptr;
-
-/* IP Network Address Translation (NAT) hooks */
-ip_nat_t *ip_nat_ptr;
-ip_nat_ctl_t *ip_nat_ctl_ptr;
-#endif
-
-/*
- * We need to save the IP options in case a protocol wants to respond
- * to an incoming packet over the same route if the packet got here
- * using IP source routing. This allows connection establishment and
- * maintenance when the remote end is on a network that is not known
- * to us.
- */
-static int ip_nhops = 0;
-static struct ip_srcrt {
- struct in_addr dst; /* final destination */
- char nop; /* one NOP to align */
- char srcopt[IPOPT_OFFSET + 1]; /* OPTVAL, OLEN and OFFSET */
- struct in_addr route[MAX_IPOPTLEN/sizeof(struct in_addr)];
-} ip_srcrt;
-
-#ifdef IPDIVERT
-/*
- * Shared variable between ip_input() and ip_reass() to communicate
- * about which packets, once assembled from fragments, get diverted,
- * and to which port.
- */
-static u_short frag_divert_port;
-#endif
-
-static void save_rte __P((u_char *, struct in_addr));
-static void ip_deq __P((struct ipasfrag *));
-static int ip_dooptions __P((struct mbuf *));
-static void ip_enq __P((struct ipasfrag *, struct ipasfrag *));
-static void ip_forward __P((struct mbuf *, int));
-static void ip_freef __P((struct ipq *));
-static struct ip *
- ip_reass __P((struct ipasfrag *, struct ipq *, struct ipq *));
-static struct in_ifaddr *
- ip_rtaddr __P((struct in_addr));
-void ipintr __P((void));
-/*
- * IP initialization: fill in IP protocol switch table.
- * All protocols not implemented in kernel go to raw IP protocol handler.
- */
-void
-ip_init()
-{
- register struct protosw *pr;
- register int i;
-
- pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW);
- if (pr == 0)
- panic("ip_init");
- for (i = 0; i < IPPROTO_MAX; i++)
- ip_protox[i] = pr - inetsw;
- for (pr = inetdomain.dom_protosw;
- pr < inetdomain.dom_protoswNPROTOSW; pr++)
- if (pr->pr_domain->dom_family == PF_INET &&
- pr->pr_protocol && pr->pr_protocol != IPPROTO_RAW)
- ip_protox[pr->pr_protocol] = pr - inetsw;
-
- for (i = 0; i < IPREASS_NHASH; i++)
- ipq[i].next = ipq[i].prev = &ipq[i];
-
- maxnipq = nmbclusters/4;
-
- ip_id = rtems_bsdnet_seconds_since_boot() & 0xffff;
- ipintrq.ifq_maxlen = ipqmaxlen;
-#ifdef IPFIREWALL
- ip_fw_init();
-#endif
-#ifdef IPNAT
- ip_nat_init();
-#endif
-
-}
-
-static struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET };
-static struct route ipforward_rt;
-
-/*
- * Ip input routine. Checksum and byte swap header. If fragmented
- * try to reassemble. Process options. Pass to next level.
- */
-void
-ip_input(struct mbuf *m)
-{
- struct ip *ip;
- struct ipq *fp;
- struct in_ifaddr *ia;
- int i, hlen;
- u_short sum;
-
-#ifdef DIAGNOSTIC
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("ip_input no HDR");
-#endif
- /*
- * If no IP addresses have been set yet but the interfaces
- * are receiving, can't do anything with incoming packets yet.
- */
- if (in_ifaddr == NULL)
- goto bad;
- ipstat.ips_total++;
-
- if (m->m_pkthdr.len < sizeof(struct ip))
- goto tooshort;
-
-#ifdef DIAGNOSTIC
- if (m->m_len < sizeof(struct ip))
- panic("ipintr mbuf too short");
-#endif
-
- if (m->m_len < sizeof (struct ip) &&
- (m = m_pullup(m, sizeof (struct ip))) == 0) {
- ipstat.ips_toosmall++;
- return;
- }
- ip = mtod(m, struct ip *);
-
- if (IP_VHL_V(ip->ip_vhl) != IPVERSION) {
- ipstat.ips_badvers++;
- goto bad;
- }
-
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
- if (hlen < sizeof(struct ip)) { /* minimum header length */
- ipstat.ips_badhlen++;
- goto bad;
- }
- if (hlen > m->m_len) {
- if ((m = m_pullup(m, hlen)) == 0) {
- ipstat.ips_badhlen++;
- return;
- }
- ip = mtod(m, struct ip *);
- }
- if (hlen == sizeof(struct ip)) {
- sum = in_cksum_hdr(ip);
- } else {
- sum = in_cksum(m, hlen);
- }
- if (sum) {
- ipstat.ips_badsum++;
- goto bad;
- }
-
- /*
- * Convert fields to host representation.
- */
- NTOHS(ip->ip_len);
- if (ip->ip_len < hlen) {
- ipstat.ips_badlen++;
- goto bad;
- }
- NTOHS(ip->ip_id);
- NTOHS(ip->ip_off);
-
- /*
- * Check that the amount of data in the buffers
- * is as at least much as the IP header would have us expect.
- * Trim mbufs if longer than we expect.
- * Drop packet if shorter than we expect.
- */
- if (m->m_pkthdr.len < ip->ip_len) {
-tooshort:
- ipstat.ips_tooshort++;
- goto bad;
- }
- if (m->m_pkthdr.len > ip->ip_len) {
- if (m->m_len == m->m_pkthdr.len) {
- m->m_len = ip->ip_len;
- m->m_pkthdr.len = ip->ip_len;
- } else
- m_adj(m, ip->ip_len - m->m_pkthdr.len);
- }
- /*
- * IpHack's section.
- * Right now when no processing on packet has done
- * and it is still fresh out of network we do our black
- * deals with it.
- * - Firewall: deny/allow/divert
- * - Xlate: translate packet's addr/port (NAT).
- * - Wrap: fake packet's addr/port <unimpl.>
- * - Encapsulate: put it in another IP and send out. <unimp.>
- */
-
-#ifdef COMPAT_IPFW
- if (ip_fw_chk_ptr) {
-#ifdef IPDIVERT
- u_short port;
-
- port = (*ip_fw_chk_ptr)(&ip, hlen, NULL, ip_divert_ignore, &m);
- ip_divert_ignore = 0;
- if (port) { /* Divert packet */
- frag_divert_port = port;
- goto ours;
- }
-#else
- /* If ipfw says divert, we have to just drop packet */
- if ((*ip_fw_chk_ptr)(&ip, hlen, NULL, 0, &m)) {
- m_freem(m);
- m = NULL;
- }
-#endif
- if (!m)
- return;
- }
-
- if (ip_nat_ptr && !(*ip_nat_ptr)(&ip, &m, m->m_pkthdr.rcvif, IP_NAT_IN))
- return;
-#endif
-
- /*
- * Process options and, if not destined for us,
- * ship it on. ip_dooptions returns 1 when an
- * error was detected (causing an icmp message
- * to be sent and the original packet to be freed).
- */
- ip_nhops = 0; /* for source routed packets */
- if (hlen > sizeof (struct ip) && ip_dooptions(m))
- return;
-
- /* greedy RSVP, snatches any PATH packet of the RSVP protocol and no
- * matter if it is destined to another node, or whether it is
- * a multicast one, RSVP wants it! and prevents it from being forwarded
- * anywhere else. Also checks if the rsvp daemon is running before
- * grabbing the packet.
- */
- if (rsvp_on && ip->ip_p==IPPROTO_RSVP)
- goto ours;
-
- /*
- * Check our list of addresses, to see if the packet is for us.
- */
- for (ia = in_ifaddr; ia; ia = ia->ia_next) {
-#define satosin(sa) ((struct sockaddr_in *)(sa))
-
- if (IA_SIN(ia)->sin_addr.s_addr == ip->ip_dst.s_addr)
- goto ours;
-#ifdef BOOTP_COMPAT
- if (IA_SIN(ia)->sin_addr.s_addr == INADDR_ANY)
- goto ours;
-#endif
- if (ia->ia_ifp && ia->ia_ifp->if_flags & IFF_BROADCAST) {
- if (satosin(&ia->ia_broadaddr)->sin_addr.s_addr ==
- ip->ip_dst.s_addr)
- goto ours;
- if (ip->ip_dst.s_addr == ia->ia_netbroadcast.s_addr)
- goto ours;
- }
- }
- if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- struct in_multi *inm;
- if (ip_mrouter) {
- /*
- * If we are acting as a multicast router, all
- * incoming multicast packets are passed to the
- * kernel-level multicast forwarding function.
- * The packet is returned (relatively) intact; if
- * ip_mforward() returns a non-zero value, the packet
- * must be discarded, else it may be accepted below.
- *
- * (The IP ident field is put in the same byte order
- * as expected when ip_mforward() is called from
- * ip_output().)
- */
- ip->ip_id = htons(ip->ip_id);
- if (ip_mforward(ip, m->m_pkthdr.rcvif, m, 0) != 0) {
- ipstat.ips_cantforward++;
- m_freem(m);
- return;
- }
- ip->ip_id = ntohs(ip->ip_id);
-
- /*
- * The process-level routing demon needs to receive
- * all multicast IGMP packets, whether or not this
- * host belongs to their destination groups.
- */
- if (ip->ip_p == IPPROTO_IGMP)
- goto ours;
- ipstat.ips_forward++;
- }
- /*
- * See if we belong to the destination multicast group on the
- * arrival interface.
- */
- IN_LOOKUP_MULTI(ip->ip_dst, m->m_pkthdr.rcvif, inm);
- if (inm == NULL) {
- ipstat.ips_cantforward++;
- m_freem(m);
- return;
- }
- goto ours;
- }
- if (ip->ip_dst.s_addr == (u_long)INADDR_BROADCAST)
- goto ours;
- if (ip->ip_dst.s_addr == INADDR_ANY)
- goto ours;
-
- /*
- * Not for us; forward if possible and desirable.
- */
- if (ipforwarding == 0) {
- ipstat.ips_cantforward++;
- m_freem(m);
- } else
- ip_forward(m, 0);
- return;
-
-ours:
-
- /*
- * If offset or IP_MF are set, must reassemble.
- * Otherwise, nothing need be done.
- * (We could look in the reassembly queue to see
- * if the packet was previously fragmented,
- * but it's not worth the time; just let them time out.)
- */
- if (ip->ip_off &~ (IP_DF | IP_RF)) {
- if (m->m_flags & M_EXT) { /* XXX */
- if ((m = m_pullup(m, sizeof (struct ip))) == 0) {
- ipstat.ips_toosmall++;
-#ifdef IPDIVERT
- frag_divert_port = 0;
-#endif
- return;
- }
- ip = mtod(m, struct ip *);
- }
- sum = IPREASS_HASH(ip->ip_src.s_addr, ip->ip_id);
- /*
- * Look for queue of fragments
- * of this datagram.
- */
- for (fp = ipq[sum].next; fp != &ipq[sum]; fp = fp->next)
- if (ip->ip_id == fp->ipq_id &&
- ip->ip_src.s_addr == fp->ipq_src.s_addr &&
- ip->ip_dst.s_addr == fp->ipq_dst.s_addr &&
- ip->ip_p == fp->ipq_p)
- goto found;
-
- fp = 0;
-
- /* check if there's a place for the new queue */
- if (nipq > maxnipq) {
- /*
- * drop something from the tail of the current queue
- * before proceeding further
- */
- if (ipq[sum].prev == &ipq[sum]) { /* gak */
- for (i = 0; i < IPREASS_NHASH; i++) {
- if (ipq[i].prev != &ipq[i]) {
- ip_freef(ipq[i].prev);
- break;
- }
- }
- } else
- ip_freef(ipq[sum].prev);
- }
-found:
- /*
- * Adjust ip_len to not reflect header,
- * set ip_mff if more fragments are expected,
- * convert offset of this to bytes.
- */
- ip->ip_len -= hlen;
- ((struct ipasfrag *)ip)->ipf_mff &= ~1;
- if (ip->ip_off & IP_MF)
- ((struct ipasfrag *)ip)->ipf_mff |= 1;
- ip->ip_off <<= 3;
-
- /*
- * If datagram marked as having more fragments
- * or if this is not the first fragment,
- * attempt reassembly; if it succeeds, proceed.
- */
- if (((struct ipasfrag *)ip)->ipf_mff & 1 || ip->ip_off) {
- ipstat.ips_fragments++;
- ip = ip_reass((struct ipasfrag *)ip, fp, &ipq[sum]);
- if (ip == 0)
- return;
- ipstat.ips_reassembled++;
- m = dtom(ip);
-#ifdef IPDIVERT
- if (frag_divert_port) {
- ip->ip_len += hlen;
- HTONS(ip->ip_len);
- HTONS(ip->ip_off);
- HTONS(ip->ip_id);
- ip->ip_sum = 0;
- ip->ip_sum = in_cksum_hdr(ip);
- NTOHS(ip->ip_id);
- NTOHS(ip->ip_off);
- NTOHS(ip->ip_len);
- ip->ip_len -= hlen;
- }
-#endif
- } else
- if (fp)
- ip_freef(fp);
- } else
- ip->ip_len -= hlen;
-
-#ifdef IPDIVERT
- /*
- * Divert reassembled packets to the divert protocol if required
- */
- if (frag_divert_port) {
- ipstat.ips_delivered++;
- ip_divert_port = frag_divert_port;
- frag_divert_port = 0;
- (*inetsw[ip_protox[IPPROTO_DIVERT]].pr_input)(m, hlen);
- return;
- }
-
- /* Don't let packets divert themselves */
- if (ip->ip_p == IPPROTO_DIVERT) {
- ipstat.ips_noproto++;
- goto bad;
- }
-#endif
-
- /*
- * Switch out to protocol's input routine.
- */
- ipstat.ips_delivered++;
- (*inetsw[ip_protox[ip->ip_p]].pr_input)(m, hlen);
- return;
-bad:
- m_freem(m);
-}
-
-/*
- * IP software interrupt routine - to go away sometime soon
- */
-void
-ipintr(void)
-{
- int s;
- struct mbuf *m;
-
- while(1) {
- s = splimp();
- IF_DEQUEUE(&ipintrq, m);
- splx(s);
- if (m == 0)
- return;
- ip_input(m);
- }
-}
-
-NETISR_SET(NETISR_IP, ipintr);
-
-/*
- * Take incoming datagram fragment and try to
- * reassemble it into whole datagram. If a chain for
- * reassembly of this datagram already exists, then it
- * is given as fp; otherwise have to make a chain.
- */
-static struct ip *
-ip_reass(ip, fp, where)
- register struct ipasfrag *ip;
- register struct ipq *fp;
- struct ipq *where;
-{
- register struct mbuf *m = dtom(ip);
- register struct ipasfrag *q;
- struct mbuf *t;
- int hlen = ip->ip_hl << 2;
- int i, next;
-
- /*
- * Presence of header sizes in mbufs
- * would confuse code below.
- */
- m->m_data += hlen;
- m->m_len -= hlen;
-
- /*
- * If first fragment to arrive, create a reassembly queue.
- */
- if (fp == 0) {
- if ((t = m_get(M_DONTWAIT, MT_FTABLE)) == NULL)
- goto dropfrag;
- fp = mtod(t, struct ipq *);
- insque(fp, where);
- nipq++;
- fp->ipq_ttl = IPFRAGTTL;
- fp->ipq_p = ip->ip_p;
- fp->ipq_id = ip->ip_id;
- fp->ipq_next = fp->ipq_prev = (struct ipasfrag *)fp;
- fp->ipq_src = ((struct ip *)ip)->ip_src;
- fp->ipq_dst = ((struct ip *)ip)->ip_dst;
-#ifdef IPDIVERT
- fp->ipq_divert = 0;
-#endif
- q = (struct ipasfrag *)fp;
- goto insert;
- }
-
- /*
- * Find a segment which begins after this one does.
- */
- for (q = fp->ipq_next; q != (struct ipasfrag *)fp; q = q->ipf_next)
- if (q->ip_off > ip->ip_off)
- break;
-
- /*
- * If there is a preceding segment, it may provide some of
- * our data already. If so, drop the data from the incoming
- * segment. If it provides all of our data, drop us.
- */
- if (q->ipf_prev != (struct ipasfrag *)fp) {
- i = q->ipf_prev->ip_off + q->ipf_prev->ip_len - ip->ip_off;
- if (i > 0) {
- if (i >= ip->ip_len)
- goto dropfrag;
- m_adj(dtom(ip), i);
- ip->ip_off += i;
- ip->ip_len -= i;
- }
- }
-
- /*
- * While we overlap succeeding segments trim them or,
- * if they are completely covered, dequeue them.
- */
- while (q != (struct ipasfrag *)fp && ip->ip_off + ip->ip_len > q->ip_off) {
- struct mbuf *m0;
-
- i = (ip->ip_off + ip->ip_len) - q->ip_off;
- if (i < q->ip_len) {
- q->ip_len -= i;
- q->ip_off += i;
- m_adj(dtom(q), i);
- break;
- }
- m0 = dtom(q);
- q = q->ipf_next;
- ip_deq(q->ipf_prev);
- m_freem(m0);
- }
-
-insert:
-
-#ifdef IPDIVERT
- /*
- * Any fragment diverting causes the whole packet to divert
- */
- if (frag_divert_port != 0)
- fp->ipq_divert = frag_divert_port;
- frag_divert_port = 0;
-#endif
-
- /*
- * Stick new segment in its place;
- * check for complete reassembly.
- */
- ip_enq(ip, q->ipf_prev);
- next = 0;
- for (q = fp->ipq_next; q != (struct ipasfrag *)fp; q = q->ipf_next) {
- if (q->ip_off != next)
- return (0);
- next += q->ip_len;
- }
- if (q->ipf_prev->ipf_mff & 1)
- return (0);
-
- /*
- * Reassembly is complete. Make sure the packet is a sane size.
- */
- if (next + (IP_VHL_HL(((struct ip *)fp->ipq_next)->ip_vhl) << 2)
- > IP_MAXPACKET) {
- ipstat.ips_toolong++;
- ip_freef(fp);
- return (0);
- }
-
- /*
- * Concatenate fragments.
- */
- q = fp->ipq_next;
- m = dtom(q);
- t = m->m_next;
- m->m_next = 0;
- m_cat(m, t);
- q = q->ipf_next;
- while (q != (struct ipasfrag *)fp) {
- t = dtom(q);
- q = q->ipf_next;
- m_cat(m, t);
- }
-
-#ifdef IPDIVERT
- /*
- * Record divert port for packet, if any
- */
- frag_divert_port = fp->ipq_divert;
-#endif
-
- /*
- * Create header for new ip packet by
- * modifying header of first packet;
- * dequeue and discard fragment reassembly header.
- * Make header visible.
- */
- ip = fp->ipq_next;
- ip->ip_len = next;
- ip->ipf_mff &= ~1;
- ((struct ip *)ip)->ip_src = fp->ipq_src;
- ((struct ip *)ip)->ip_dst = fp->ipq_dst;
- remque(fp);
- nipq--;
- (void) m_free(dtom(fp));
- m = dtom(ip);
- m->m_len += (ip->ip_hl << 2);
- m->m_data -= (ip->ip_hl << 2);
- /* some debugging cruft by sklower, below, will go away soon */
- if (m->m_flags & M_PKTHDR) { /* XXX this should be done elsewhere */
- register int plen = 0;
- for (t = m; m; m = m->m_next)
- plen += m->m_len;
- t->m_pkthdr.len = plen;
- }
- return ((struct ip *)ip);
-
-dropfrag:
- ipstat.ips_fragdropped++;
- m_freem(m);
- return (0);
-}
-
-/*
- * Free a fragment reassembly header and all
- * associated datagrams.
- */
-static void
-ip_freef(fp)
- struct ipq *fp;
-{
- register struct ipasfrag *q, *p;
-
- for (q = fp->ipq_next; q != (struct ipasfrag *)fp; q = p) {
- p = q->ipf_next;
- ip_deq(q);
- m_freem(dtom(q));
- }
- remque(fp);
- (void) m_free(dtom(fp));
- nipq--;
-}
-
-/*
- * Put an ip fragment on a reassembly chain.
- * Like insque, but pointers in middle of structure.
- */
-static void
-ip_enq(p, prev)
- register struct ipasfrag *p, *prev;
-{
-
- p->ipf_prev = prev;
- p->ipf_next = prev->ipf_next;
- prev->ipf_next->ipf_prev = p;
- prev->ipf_next = p;
-}
-
-/*
- * To ip_enq as remque is to insque.
- */
-static void
-ip_deq(p)
- register struct ipasfrag *p;
-{
-
- p->ipf_prev->ipf_next = p->ipf_next;
- p->ipf_next->ipf_prev = p->ipf_prev;
-}
-
-/*
- * IP timer processing;
- * if a timer expires on a reassembly
- * queue, discard it.
- */
-void
-ip_slowtimo()
-{
- register struct ipq *fp;
- int s = splnet();
- int i;
-
- for (i = 0; i < IPREASS_NHASH; i++) {
- fp = ipq[i].next;
- if (fp == 0)
- continue;
- while (fp != &ipq[i]) {
- --fp->ipq_ttl;
- fp = fp->next;
- if (fp->prev->ipq_ttl == 0) {
- ipstat.ips_fragtimeout++;
- ip_freef(fp->prev);
- }
- }
- }
- splx(s);
-}
-
-/*
- * Drain off all datagram fragments.
- */
-void
-ip_drain()
-{
- int i;
-
- for (i = 0; i < IPREASS_NHASH; i++) {
- while (ipq[i].next != &ipq[i]) {
- ipstat.ips_fragdropped++;
- ip_freef(ipq[i].next);
- }
- }
- in_rtqdrain();
-}
-
-/*
- * Do option processing on a datagram,
- * possibly discarding it if bad options are encountered,
- * or forwarding it if source-routed.
- * Returns 1 if packet has been forwarded/freed,
- * 0 if the packet should be processed further.
- */
-static int
-ip_dooptions(m)
- struct mbuf *m;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register u_char *cp;
- register struct ip_timestamp *ipt;
- register struct in_ifaddr *ia;
- int opt, optlen, cnt, off, code, type = ICMP_PARAMPROB, forward = 0;
- struct in_addr *sin, dst;
- n_time ntime;
-
- dst = ip->ip_dst;
- cp = (u_char *)(ip + 1);
- cnt = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof (struct ip);
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[IPOPT_OLEN];
- if (optlen <= 0 || optlen > cnt) {
- code = &cp[IPOPT_OLEN] - (u_char *)ip;
- goto bad;
- }
- }
- switch (opt) {
-
- default:
- break;
-
- /*
- * Source routing with record.
- * Find interface with current destination address.
- * If none on this machine then drop if strictly routed,
- * or do nothing if loosely routed.
- * Record interface address and bring up next address
- * component. If strictly routed make sure next
- * address is on directly accessible net.
- */
- case IPOPT_LSRR:
- case IPOPT_SSRR:
- if ((off = cp[IPOPT_OFFSET]) < IPOPT_MINOFF) {
- code = &cp[IPOPT_OFFSET] - (u_char *)ip;
- goto bad;
- }
- ipaddr.sin_addr = ip->ip_dst;
- ia = (struct in_ifaddr *)
- ifa_ifwithaddr((struct sockaddr *)&ipaddr);
- if (ia == 0) {
- if (opt == IPOPT_SSRR) {
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_SRCFAIL;
- goto bad;
- }
- if (!ip_dosourceroute)
- goto nosourcerouting;
- /*
- * Loose routing, and not at next destination
- * yet; nothing to do except forward.
- */
- break;
- }
- off--; /* 0 origin */
- if (off > optlen - sizeof(struct in_addr)) {
- /*
- * End of source route. Should be for us.
- */
- if (!ip_acceptsourceroute)
- goto nosourcerouting;
- save_rte(cp, ip->ip_src);
- break;
- }
-
- if (!ip_dosourceroute) {
- char buf[4*sizeof "123"];
-
-nosourcerouting:
- strcpy(buf, inet_ntoa(ip->ip_dst));
- log(LOG_WARNING,
- "attempted source route from %s to %s\n",
- inet_ntoa(ip->ip_src), buf);
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_SRCFAIL;
- goto bad;
- }
-
- /*
- * locate outgoing interface
- */
- (void)memcpy(&ipaddr.sin_addr, cp + off,
- sizeof(ipaddr.sin_addr));
-
- if (opt == IPOPT_SSRR) {
-#define INA struct in_ifaddr *
-#define SA struct sockaddr *
- if ((ia = (INA)ifa_ifwithdstaddr((SA)&ipaddr)) == 0)
- ia = (INA)ifa_ifwithnet((SA)&ipaddr);
- } else
- ia = ip_rtaddr(ipaddr.sin_addr);
- if (ia == 0) {
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_SRCFAIL;
- goto bad;
- }
- ip->ip_dst = ipaddr.sin_addr;
- (void)memcpy(cp + off, &(IA_SIN(ia)->sin_addr),
- sizeof(struct in_addr));
- cp[IPOPT_OFFSET] += sizeof(struct in_addr);
- /*
- * Let ip_intr's mcast routing check handle mcast pkts
- */
- forward = !IN_MULTICAST(ntohl(ip->ip_dst.s_addr));
- break;
-
- case IPOPT_RR:
- if ((off = cp[IPOPT_OFFSET]) < IPOPT_MINOFF) {
- code = &cp[IPOPT_OFFSET] - (u_char *)ip;
- goto bad;
- }
- /*
- * If no space remains, ignore.
- */
- off--; /* 0 origin */
- if (off > optlen - sizeof(struct in_addr))
- break;
- (void)memcpy(&ipaddr.sin_addr, &ip->ip_dst,
- sizeof(ipaddr.sin_addr));
- /*
- * locate outgoing interface; if we're the destination,
- * use the incoming interface (should be same).
- */
- if ((ia = (INA)ifa_ifwithaddr((SA)&ipaddr)) == 0 &&
- (ia = ip_rtaddr(ipaddr.sin_addr)) == 0) {
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_HOST;
- goto bad;
- }
- (void)memcpy(cp + off, &(IA_SIN(ia)->sin_addr),
- sizeof(struct in_addr));
- cp[IPOPT_OFFSET] += sizeof(struct in_addr);
- break;
-
- case IPOPT_TS:
- code = cp - (u_char *)ip;
- ipt = (struct ip_timestamp *)cp;
- if (ipt->ipt_len < 5)
- goto bad;
- if (ipt->ipt_ptr > ipt->ipt_len - sizeof (long)) {
- if (++ipt->ipt_oflw == 0)
- goto bad;
- break;
- }
- sin = (struct in_addr *)(cp + ipt->ipt_ptr - 1);
- switch (ipt->ipt_flg) {
-
- case IPOPT_TS_TSONLY:
- break;
-
- case IPOPT_TS_TSANDADDR:
- if (ipt->ipt_ptr + sizeof(n_time) +
- sizeof(struct in_addr) > ipt->ipt_len)
- goto bad;
- ipaddr.sin_addr = dst;
- ia = (INA)ifaof_ifpforaddr((SA)&ipaddr,
- m->m_pkthdr.rcvif);
- if (ia == 0)
- continue;
- (void)memcpy(sin, &IA_SIN(ia)->sin_addr,
- sizeof(struct in_addr));
- ipt->ipt_ptr += sizeof(struct in_addr);
- break;
-
- case IPOPT_TS_PRESPEC:
- if (ipt->ipt_ptr + sizeof(n_time) +
- sizeof(struct in_addr) > ipt->ipt_len)
- goto bad;
- (void)memcpy(&ipaddr.sin_addr, sin,
- sizeof(struct in_addr));
- if (ifa_ifwithaddr((SA)&ipaddr) == 0)
- continue;
- ipt->ipt_ptr += sizeof(struct in_addr);
- break;
-
- default:
- goto bad;
- }
- ntime = iptime();
- (void)memcpy(cp + ipt->ipt_ptr - 1, &ntime,
- sizeof(n_time));
- ipt->ipt_ptr += sizeof(n_time);
- }
- }
- if (forward && ipforwarding) {
- ip_forward(m, 1);
- return (1);
- }
- return (0);
-bad:
- ip->ip_len -= IP_VHL_HL(ip->ip_vhl) << 2; /* XXX icmp_error adds in hdr length */
- icmp_error(m, type, code, 0, 0);
- ipstat.ips_badoptions++;
- return (1);
-}
-
-/*
- * Given address of next destination (final or next hop),
- * return internet address info of interface to be used to get there.
- */
-static struct in_ifaddr *
-ip_rtaddr(dst)
- struct in_addr dst;
-{
- register struct sockaddr_in *sin;
-
- sin = (struct sockaddr_in *) &ipforward_rt.ro_dst;
-
- if (ipforward_rt.ro_rt == 0 || dst.s_addr != sin->sin_addr.s_addr) {
- if (ipforward_rt.ro_rt) {
- RTFREE(ipforward_rt.ro_rt);
- ipforward_rt.ro_rt = 0;
- }
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_addr = dst;
-
- rtalloc_ign(&ipforward_rt, RTF_PRCLONING);
- }
- if (ipforward_rt.ro_rt == 0)
- return ((struct in_ifaddr *)0);
- return ((struct in_ifaddr *) ipforward_rt.ro_rt->rt_ifa);
-}
-
-/*
- * Save incoming source route for use in replies,
- * to be picked up later by ip_srcroute if the receiver is interested.
- */
-void
-save_rte(option, dst)
- u_char *option;
- struct in_addr dst;
-{
- unsigned olen;
-
- olen = option[IPOPT_OLEN];
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("save_rte: olen %d\n", olen);
-#endif
- if (olen > sizeof(ip_srcrt) - (1 + sizeof(dst)))
- return;
- bcopy(option, ip_srcrt.srcopt, olen);
- ip_nhops = (olen - IPOPT_OFFSET - 1) / sizeof(struct in_addr);
- ip_srcrt.dst = dst;
-}
-
-/*
- * Retrieve incoming source route for use in replies,
- * in the same form used by setsockopt.
- * The first hop is placed before the options, will be removed later.
- */
-struct mbuf *
-ip_srcroute()
-{
- register struct in_addr *p, *q;
- register struct mbuf *m;
-
- if (ip_nhops == 0)
- return ((struct mbuf *)0);
- m = m_get(M_DONTWAIT, MT_SOOPTS);
- if (m == 0)
- return ((struct mbuf *)0);
-
-#define OPTSIZ (sizeof(ip_srcrt.nop) + sizeof(ip_srcrt.srcopt))
-
- /* length is (nhops+1)*sizeof(addr) + sizeof(nop + srcrt header) */
- m->m_len = ip_nhops * sizeof(struct in_addr) + sizeof(struct in_addr) +
- OPTSIZ;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("ip_srcroute: nhops %d mlen %d", ip_nhops, m->m_len);
-#endif
-
- /*
- * First save first hop for return route
- */
- p = &ip_srcrt.route[ip_nhops - 1];
- *(mtod(m, struct in_addr *)) = *p--;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf(" hops %lx", ntohl(mtod(m, struct in_addr *)->s_addr));
-#endif
-
- /*
- * Copy option fields and padding (nop) to mbuf.
- */
- ip_srcrt.nop = IPOPT_NOP;
- ip_srcrt.srcopt[IPOPT_OFFSET] = IPOPT_MINOFF;
- (void)memcpy(mtod(m, caddr_t) + sizeof(struct in_addr),
- &ip_srcrt.nop, OPTSIZ);
- q = (struct in_addr *)(mtod(m, caddr_t) +
- sizeof(struct in_addr) + OPTSIZ);
-#undef OPTSIZ
- /*
- * Record return path as an IP source route,
- * reversing the path (pointers are now aligned).
- */
- while (p >= ip_srcrt.route) {
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf(" %lx", ntohl(q->s_addr));
-#endif
- *q++ = *p--;
- }
- /*
- * Last hop goes to final destination.
- */
- *q = ip_srcrt.dst;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf(" %lx\n", ntohl(q->s_addr));
-#endif
- return (m);
-}
-
-/*
- * Strip out IP options, at higher
- * level protocol in the kernel.
- * Second argument is buffer to which options
- * will be moved, and return value is their length.
- * XXX should be deleted; last arg currently ignored.
- */
-void
-ip_stripoptions(m, mopt)
- register struct mbuf *m;
- struct mbuf *mopt;
-{
- register int i;
- struct ip *ip = mtod(m, struct ip *);
- register caddr_t opts;
- int olen;
-
- olen = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof (struct ip);
- opts = (caddr_t)(ip + 1);
- i = m->m_len - (sizeof (struct ip) + olen);
- bcopy(opts + olen, opts, (unsigned)i);
- m->m_len -= olen;
- if (m->m_flags & M_PKTHDR)
- m->m_pkthdr.len -= olen;
- ip->ip_vhl = IP_MAKE_VHL(IPVERSION, sizeof(struct ip) >> 2);
-}
-
-u_char inetctlerrmap[PRC_NCMDS] = {
- 0, 0, 0, 0,
- 0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH,
- EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED,
- EMSGSIZE, EHOSTUNREACH, 0, 0,
- 0, 0, 0, 0,
- ENOPROTOOPT
-};
-
-/*
- * Forward a packet. If some error occurs return the sender
- * an icmp packet. Note we can't always generate a meaningful
- * icmp message because icmp doesn't have a large enough repertoire
- * of codes and types.
- *
- * If not forwarding, just drop the packet. This could be confusing
- * if ipforwarding was zero but some routing protocol was advancing
- * us as a gateway to somewhere. However, we must let the routing
- * protocol deal with that.
- *
- * The srcrt parameter indicates whether the packet is being forwarded
- * via a source route.
- */
-static void
-ip_forward(m, srcrt)
- struct mbuf *m;
- int srcrt;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register struct sockaddr_in *sin;
- register struct rtentry *rt;
- int error, type = 0, code = 0;
- struct mbuf *mcopy;
- n_long dest;
- struct ifnet *destifp;
-
- dest = 0;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("forward: src %lx dst %lx ttl %x\n",
- ip->ip_src.s_addr, ip->ip_dst.s_addr, ip->ip_ttl);
-#endif
-
-
- if (m->m_flags & M_BCAST || in_canforward(ip->ip_dst) == 0) {
- ipstat.ips_cantforward++;
- m_freem(m);
- return;
- }
- HTONS(ip->ip_id);
- if (ip->ip_ttl <= IPTTLDEC) {
- icmp_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, dest, 0);
- return;
- }
- ip->ip_ttl -= IPTTLDEC;
-
- sin = (struct sockaddr_in *)&ipforward_rt.ro_dst;
- if ((rt = ipforward_rt.ro_rt) == 0 ||
- ip->ip_dst.s_addr != sin->sin_addr.s_addr) {
- if (ipforward_rt.ro_rt) {
- RTFREE(ipforward_rt.ro_rt);
- ipforward_rt.ro_rt = 0;
- }
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_addr = ip->ip_dst;
-
- rtalloc_ign(&ipforward_rt, RTF_PRCLONING);
- if (ipforward_rt.ro_rt == 0) {
- icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, dest, 0);
- return;
- }
- rt = ipforward_rt.ro_rt;
- }
-
- /*
- * Save at most 64 bytes of the packet in case
- * we need to generate an ICMP message to the src.
- */
- mcopy = m_copy(m, 0, imin((int)ip->ip_len, 64));
-
- /*
- * If forwarding packet using same interface that it came in on,
- * perhaps should send a redirect to sender to shortcut a hop.
- * Only send redirect if source is sending directly to us,
- * and if packet was not source routed (or has any options).
- * Also, don't send redirect if forwarding using a default route
- * or a route modified by a redirect.
- */
-#define satosin(sa) ((struct sockaddr_in *)(sa))
- if (rt->rt_ifp == m->m_pkthdr.rcvif &&
- (rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0 &&
- satosin(rt_key(rt))->sin_addr.s_addr != 0 &&
- ipsendredirects && !srcrt) {
-#define RTA(rt) ((struct in_ifaddr *)(rt->rt_ifa))
- u_long src = ntohl(ip->ip_src.s_addr);
-
- if (RTA(rt) &&
- (src & RTA(rt)->ia_subnetmask) == RTA(rt)->ia_subnet) {
- if (rt->rt_flags & RTF_GATEWAY)
- dest = satosin(rt->rt_gateway)->sin_addr.s_addr;
- else
- dest = ip->ip_dst.s_addr;
- /* Router requirements says to only send host redirects */
- type = ICMP_REDIRECT;
- code = ICMP_REDIRECT_HOST;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("redirect (%d) to %lx\n", code, (u_long)dest);
-#endif
- }
- }
-
- error = ip_output(m, (struct mbuf *)0, &ipforward_rt,
- IP_FORWARDING, 0);
- if (error)
- ipstat.ips_cantforward++;
- else {
- ipstat.ips_forward++;
- if (type)
- ipstat.ips_redirectsent++;
- else {
- if (mcopy)
- m_freem(mcopy);
- return;
- }
- }
- if (mcopy == NULL)
- return;
- destifp = NULL;
-
- switch (error) {
-
- case 0: /* forwarded, but need redirect */
- /* type, code set above */
- break;
-
- case ENETUNREACH: /* shouldn't happen, checked above */
- case EHOSTUNREACH:
- case ENETDOWN:
- case EHOSTDOWN:
- default:
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_HOST;
- break;
-
- case EMSGSIZE:
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_NEEDFRAG;
- if (ipforward_rt.ro_rt)
- destifp = ipforward_rt.ro_rt->rt_ifp;
- ipstat.ips_cantfrag++;
- break;
-
- case ENOBUFS:
- type = ICMP_SOURCEQUENCH;
- code = 0;
- break;
- }
- icmp_error(mcopy, type, code, dest, destifp);
-}
-
-void
-ip_savecontrol(inp, mp, ip, m)
- register struct inpcb *inp;
- register struct mbuf **mp;
- register struct ip *ip;
- register struct mbuf *m;
-{
- if (inp->inp_socket->so_options & SO_TIMESTAMP) {
- struct timeval tv;
-
- microtime(&tv);
- *mp = sbcreatecontrol((caddr_t) &tv, sizeof(tv),
- SCM_TIMESTAMP, SOL_SOCKET);
- if (*mp)
- mp = &(*mp)->m_next;
- }
- if (inp->inp_flags & INP_RECVDSTADDR) {
- *mp = sbcreatecontrol((caddr_t) &ip->ip_dst,
- sizeof(struct in_addr), IP_RECVDSTADDR, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
-#ifdef notyet
- /* XXX
- * Moving these out of udp_input() made them even more broken
- * than they already were.
- */
- /* options were tossed already */
- if (inp->inp_flags & INP_RECVOPTS) {
- *mp = sbcreatecontrol((caddr_t) opts_deleted_above,
- sizeof(struct in_addr), IP_RECVOPTS, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
- /* ip_srcroute doesn't do what we want here, need to fix */
- if (inp->inp_flags & INP_RECVRETOPTS) {
- *mp = sbcreatecontrol((caddr_t) ip_srcroute(),
- sizeof(struct in_addr), IP_RECVRETOPTS, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
-#endif
- if (inp->inp_flags & INP_RECVIF) {
- struct sockaddr_dl sdl;
-
- sdl.sdl_len = offsetof(struct sockaddr_dl, sdl_data[0]);
- sdl.sdl_family = AF_LINK;
- sdl.sdl_index = m->m_pkthdr.rcvif ?
- m->m_pkthdr.rcvif->if_index : 0;
- sdl.sdl_nlen = sdl.sdl_alen = sdl.sdl_slen = 0;
- *mp = sbcreatecontrol((caddr_t) &sdl, sdl.sdl_len,
- IP_RECVIF, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
-}
-
-int
-ip_rsvp_init(struct socket *so)
-{
- if (so->so_type != SOCK_RAW ||
- so->so_proto->pr_protocol != IPPROTO_RSVP)
- return EOPNOTSUPP;
-
- if (ip_rsvpd != NULL)
- return EADDRINUSE;
-
- ip_rsvpd = so;
- /*
- * This may seem silly, but we need to be sure we don't over-increment
- * the RSVP counter, in case something slips up.
- */
- if (!ip_rsvp_on) {
- ip_rsvp_on = 1;
- rsvp_on++;
- }
-
- return 0;
-}
-
-int
-ip_rsvp_done(void)
-{
- ip_rsvpd = NULL;
- /*
- * This may seem silly, but we need to be sure we don't over-decrement
- * the RSVP counter, in case something slips up.
- */
- if (ip_rsvp_on) {
- ip_rsvp_on = 0;
- rsvp_on--;
- }
- return 0;
-}
diff --git a/c/src/libnetworking/netinet/ip_mroute.c b/c/src/libnetworking/netinet/ip_mroute.c
deleted file mode 100644
index 662d695dfe..0000000000
--- a/c/src/libnetworking/netinet/ip_mroute.c
+++ /dev/null
@@ -1,2302 +0,0 @@
-/*
- * IP multicast forwarding procedures
- *
- * Written by David Waitzman, BBN Labs, August 1988.
- * Modified by Steve Deering, Stanford, February 1989.
- * Modified by Mark J. Steiglitz, Stanford, May, 1991
- * Modified by Van Jacobson, LBL, January 1993
- * Modified by Ajit Thyagarajan, PARC, August 1993
- * Modified by Bill Fenner, PARC, April 1995
- *
- * MROUTING Revision: 3.5
- * $Id$
- */
-
-#include "opt_mrouting.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
-#include <sys/ioctl.h>
-#include <sys/syslog.h>
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/igmp.h>
-#include <netinet/igmp_var.h>
-#include <netinet/ip_mroute.h>
-#include <netinet/udp.h>
-
-#ifndef NTOHL
-#if BYTE_ORDER != BIG_ENDIAN
-#define NTOHL(d) ((d) = ntohl((d)))
-#define NTOHS(d) ((d) = ntohs((u_short)(d)))
-#define HTONL(d) ((d) = htonl((d)))
-#define HTONS(d) ((d) = htons((u_short)(d)))
-#else
-#define NTOHL(d)
-#define NTOHS(d)
-#define HTONL(d)
-#define HTONS(d)
-#endif
-#endif
-
-#ifndef MROUTING
-extern u_long _ip_mcast_src __P((int vifi));
-extern int _ip_mforward __P((struct ip *ip, struct ifnet *ifp,
- struct mbuf *m, struct ip_moptions *imo));
-extern int _ip_mrouter_done __P((void));
-extern int _ip_mrouter_get __P((int cmd, struct socket *so,
- struct mbuf **m));
-extern int _ip_mrouter_set __P((int cmd, struct socket *so,
- struct mbuf *m));
-extern int _mrt_ioctl __P((int req, caddr_t data, struct proc *p));
-
-/*
- * Dummy routines and globals used when multicast routing is not compiled in.
- */
-
-struct socket *ip_mrouter = NULL;
-/* static u_int ip_mrtproto = 0; */
-/* static struct mrtstat mrtstat; */
-u_int rsvpdebug = 0;
-
-int
-_ip_mrouter_set(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf *m;
-{
- return(EOPNOTSUPP);
-}
-
-int (*ip_mrouter_set)(int, struct socket *, struct mbuf *) = _ip_mrouter_set;
-
-
-int
-_ip_mrouter_get(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf **m;
-{
- return(EOPNOTSUPP);
-}
-
-int (*ip_mrouter_get)(int, struct socket *, struct mbuf **) = _ip_mrouter_get;
-
-int
-_ip_mrouter_done()
-{
- return(0);
-}
-
-int (*ip_mrouter_done)(void) = _ip_mrouter_done;
-
-int
-_ip_mforward(ip, ifp, m, imo)
- struct ip *ip;
- struct ifnet *ifp;
- struct mbuf *m;
- struct ip_moptions *imo;
-{
- return(0);
-}
-
-int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *,
- struct ip_moptions *) = _ip_mforward;
-
-int
-_mrt_ioctl(int req, caddr_t data, struct proc *p)
-{
- return EOPNOTSUPP;
-}
-
-int (*mrt_ioctl)(int, caddr_t, struct proc *) = _mrt_ioctl;
-
-void
-rsvp_input(m, iphlen) /* XXX must fixup manually */
- struct mbuf *m;
- int iphlen;
-{
- /* Can still get packets with rsvp_on = 0 if there is a local member
- * of the group to which the RSVP packet is addressed. But in this
- * case we want to throw the packet away.
- */
- if (!rsvp_on) {
- m_freem(m);
- return;
- }
-
- if (ip_rsvpd != NULL) {
- if (rsvpdebug)
- printf("rsvp_input: Sending packet up old-style socket\n");
- rip_input(m, iphlen);
- return;
- }
- /* Drop the packet */
- m_freem(m);
-}
-
-void ipip_input(struct mbuf *m, int iphlen) { /* XXX must fixup manually */
- rip_input(m, iphlen);
-}
-
-int (*legal_vif_num)(int) = 0;
-
-/*
- * This should never be called, since IP_MULTICAST_VIF should fail, but
- * just in case it does get called, the code a little lower in ip_output
- * will assign the packet a local address.
- */
-u_long
-_ip_mcast_src(int vifi) { return INADDR_ANY; }
-u_long (*ip_mcast_src)(int) = _ip_mcast_src;
-
-int
-ip_rsvp_vif_init(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- return(EINVAL);
-}
-
-int
-ip_rsvp_vif_done(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- return(EINVAL);
-}
-
-void
-ip_rsvp_force_done(so)
- struct socket *so;
-{
- return;
-}
-
-#else /* MROUTING */
-
-#define M_HASCL(m) ((m)->m_flags & M_EXT)
-
-#define INSIZ sizeof(struct in_addr)
-#define same(a1, a2) \
- (bcmp((caddr_t)(a1), (caddr_t)(a2), INSIZ) == 0)
-
-#define MT_MRTABLE MT_RTABLE /* since nothing else uses it */
-
-/*
- * Globals. All but ip_mrouter and ip_mrtproto could be static,
- * except for netstat or debugging purposes.
- */
-#ifndef MROUTE_LKM
-struct socket *ip_mrouter = NULL;
-struct mrtstat mrtstat;
-
-int ip_mrtproto = IGMP_DVMRP; /* for netstat only */
-#else /* MROUTE_LKM */
-extern void X_ipip_input __P((struct mbuf *m, int iphlen));
-extern struct mrtstat mrtstat;
-static int ip_mrtproto;
-#endif
-
-#define NO_RTE_FOUND 0x1
-#define RTE_FOUND 0x2
-
-static struct mbuf *mfctable[MFCTBLSIZ];
-static u_char nexpire[MFCTBLSIZ];
-static struct vif viftable[MAXVIFS];
-static u_int mrtdebug = 0; /* debug level */
-#define DEBUG_MFC 0x02
-#define DEBUG_FORWARD 0x04
-#define DEBUG_EXPIRE 0x08
-#define DEBUG_XMIT 0x10
-static u_int tbfdebug = 0; /* tbf debug level */
-static u_int rsvpdebug = 0; /* rsvp debug level */
-
-#define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */
-#define UPCALL_EXPIRE 6 /* number of timeouts */
-
-/*
- * Define the token bucket filter structures
- * tbftable -> each vif has one of these for storing info
- */
-
-static struct tbf tbftable[MAXVIFS];
-#define TBF_REPROCESS (hz / 100) /* 100x / second */
-
-/*
- * 'Interfaces' associated with decapsulator (so we can tell
- * packets that went through it from ones that get reflected
- * by a broken gateway). These interfaces are never linked into
- * the system ifnet list & no routes point to them. I.e., packets
- * can't be sent this way. They only exist as a placeholder for
- * multicast source verification.
- */
-static struct ifnet multicast_decap_if[MAXVIFS];
-
-#define ENCAP_TTL 64
-#define ENCAP_PROTO IPPROTO_IPIP /* 4 */
-
-/* prototype IP hdr for encapsulated packets */
-static struct ip multicast_encap_iphdr = {
-#if BYTE_ORDER == LITTLE_ENDIAN
- sizeof(struct ip) >> 2, IPVERSION,
-#else
- IPVERSION, sizeof(struct ip) >> 2,
-#endif
- 0, /* tos */
- sizeof(struct ip), /* total length */
- 0, /* id */
- 0, /* frag offset */
- ENCAP_TTL, ENCAP_PROTO,
- 0, /* checksum */
-};
-
-/*
- * Private variables.
- */
-static vifi_t numvifs = 0;
-static int have_encap_tunnel = 0;
-
-/*
- * one-back cache used by ipip_input to locate a tunnel's vif
- * given a datagram's src ip address.
- */
-static u_long last_encap_src;
-static struct vif *last_encap_vif;
-
-static u_long X_ip_mcast_src __P((int vifi));
-static int X_ip_mforward __P((struct ip *ip, struct ifnet *ifp, struct mbuf *m, struct ip_moptions *imo));
-static int X_ip_mrouter_done __P((void));
-static int X_ip_mrouter_get __P((int cmd, struct socket *so, struct mbuf **m));
-static int X_ip_mrouter_set __P((int cmd, struct socket *so, struct mbuf *m));
-static int X_legal_vif_num __P((int vif));
-static int X_mrt_ioctl __P((int cmd, caddr_t data));
-
-static int get_sg_cnt(struct sioc_sg_req *);
-static int get_vif_cnt(struct sioc_vif_req *);
-static int ip_mrouter_init(struct socket *, struct mbuf *);
-static int add_vif(struct vifctl *);
-static int del_vif(vifi_t *);
-static int add_mfc(struct mfcctl *);
-static int del_mfc(struct mfcctl *);
-static int socket_send(struct socket *, struct mbuf *, struct sockaddr_in *);
-static int get_version(struct mbuf *);
-static int get_assert(struct mbuf *);
-static int set_assert(int *);
-static void expire_upcalls(void *);
-static int ip_mdq(struct mbuf *, struct ifnet *, struct mfc *,
- vifi_t);
-static void phyint_send(struct ip *, struct vif *, struct mbuf *);
-static void encap_send(struct ip *, struct vif *, struct mbuf *);
-static void tbf_control(struct vif *, struct mbuf *, struct ip *, u_long);
-static void tbf_queue(struct vif *, struct mbuf *);
-static void tbf_process_q(struct vif *);
-static void tbf_reprocess_q(void *);
-static int tbf_dq_sel(struct vif *, struct ip *);
-static void tbf_send_packet(struct vif *, struct mbuf *);
-static void tbf_update_tokens(struct vif *);
-static int priority(struct vif *, struct ip *);
-void multiencap_decap(struct mbuf *);
-
-/*
- * whether or not special PIM assert processing is enabled.
- */
-static int pim_assert;
-/*
- * Rate limit for assert notification messages, in usec
- */
-#define ASSERT_MSG_TIME 3000000
-
-/*
- * Hash function for a source, group entry
- */
-#define MFCHASH(a, g) MFCHASHMOD(((a) >> 20) ^ ((a) >> 10) ^ (a) ^ \
- ((g) >> 20) ^ ((g) >> 10) ^ (g))
-
-/*
- * Find a route for a given origin IP address and Multicast group address
- * Type of service parameter to be added in the future!!!
- */
-
-#define MFCFIND(o, g, rt) { \
- register struct mbuf *_mb_rt = mfctable[MFCHASH(o,g)]; \
- register struct mfc *_rt = NULL; \
- rt = NULL; \
- ++mrtstat.mrts_mfc_lookups; \
- while (_mb_rt) { \
- _rt = mtod(_mb_rt, struct mfc *); \
- if ((_rt->mfc_origin.s_addr == o) && \
- (_rt->mfc_mcastgrp.s_addr == g) && \
- (_mb_rt->m_act == NULL)) { \
- rt = _rt; \
- break; \
- } \
- _mb_rt = _mb_rt->m_next; \
- } \
- if (rt == NULL) { \
- ++mrtstat.mrts_mfc_misses; \
- } \
-}
-
-
-/*
- * Macros to compute elapsed time efficiently
- * Borrowed from Van Jacobson's scheduling code
- */
-#define TV_DELTA(a, b, delta) { \
- register int xxs; \
- \
- delta = (a).tv_usec - (b).tv_usec; \
- if ((xxs = (a).tv_sec - (b).tv_sec)) { \
- switch (xxs) { \
- case 2: \
- delta += 1000000; \
- /* fall through */ \
- case 1: \
- delta += 1000000; \
- break; \
- default: \
- delta += (1000000 * xxs); \
- } \
- } \
-}
-
-#define TV_LT(a, b) (((a).tv_usec < (b).tv_usec && \
- (a).tv_sec <= (b).tv_sec) || (a).tv_sec < (b).tv_sec)
-
-#ifdef UPCALL_TIMING
-u_long upcall_data[51];
-static void collate(struct timeval *);
-#endif /* UPCALL_TIMING */
-
-
-/*
- * Handle MRT setsockopt commands to modify the multicast routing tables.
- */
-static int
-X_ip_mrouter_set(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf *m;
-{
- if (cmd != MRT_INIT && so != ip_mrouter) return EACCES;
-
- switch (cmd) {
- case MRT_INIT: return ip_mrouter_init(so, m);
- case MRT_DONE: return ip_mrouter_done();
- case MRT_ADD_VIF: return add_vif (mtod(m, struct vifctl *));
- case MRT_DEL_VIF: return del_vif (mtod(m, vifi_t *));
- case MRT_ADD_MFC: return add_mfc (mtod(m, struct mfcctl *));
- case MRT_DEL_MFC: return del_mfc (mtod(m, struct mfcctl *));
- case MRT_ASSERT: return set_assert(mtod(m, int *));
- default: return EOPNOTSUPP;
- }
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mrouter_set)(int, struct socket *, struct mbuf *) = X_ip_mrouter_set;
-#endif
-
-/*
- * Handle MRT getsockopt commands
- */
-static int
-X_ip_mrouter_get(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf **m;
-{
- struct mbuf *mb;
-
- if (so != ip_mrouter) return EACCES;
-
- *m = mb = m_get(M_WAIT, MT_SOOPTS);
-
- switch (cmd) {
- case MRT_VERSION: return get_version(mb);
- case MRT_ASSERT: return get_assert(mb);
- default: return EOPNOTSUPP;
- }
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mrouter_get)(int, struct socket *, struct mbuf **) = X_ip_mrouter_get;
-#endif
-
-/*
- * Handle ioctl commands to obtain information from the cache
- */
-static int
-X_mrt_ioctl(cmd, data)
- int cmd;
- caddr_t data;
-{
- int error = 0;
-
- switch (cmd) {
- case (SIOCGETVIFCNT):
- return (get_vif_cnt((struct sioc_vif_req *)data));
- break;
- case (SIOCGETSGCNT):
- return (get_sg_cnt((struct sioc_sg_req *)data));
- break;
- default:
- return (EINVAL);
- break;
- }
- return error;
-}
-
-#ifndef MROUTE_LKM
-int (*mrt_ioctl)(int, caddr_t) = X_mrt_ioctl;
-#endif
-
-/*
- * returns the packet, byte, rpf-failure count for the source group provided
- */
-static int
-get_sg_cnt(req)
- register struct sioc_sg_req *req;
-{
- register struct mfc *rt;
- int s;
-
- s = splnet();
- MFCFIND(req->src.s_addr, req->grp.s_addr, rt);
- splx(s);
- if (rt != NULL) {
- req->pktcnt = rt->mfc_pkt_cnt;
- req->bytecnt = rt->mfc_byte_cnt;
- req->wrong_if = rt->mfc_wrong_if;
- } else
- req->pktcnt = req->bytecnt = req->wrong_if = 0xffffffff;
-
- return 0;
-}
-
-/*
- * returns the input and output packet and byte counts on the vif provided
- */
-static int
-get_vif_cnt(req)
- register struct sioc_vif_req *req;
-{
- register vifi_t vifi = req->vifi;
-
- if (vifi >= numvifs) return EINVAL;
-
- req->icount = viftable[vifi].v_pkt_in;
- req->ocount = viftable[vifi].v_pkt_out;
- req->ibytes = viftable[vifi].v_bytes_in;
- req->obytes = viftable[vifi].v_bytes_out;
-
- return 0;
-}
-
-/*
- * Enable multicast routing
- */
-static int
-ip_mrouter_init(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- int *v;
-
- if (mrtdebug)
- log(LOG_DEBUG,"ip_mrouter_init: so_type = %d, pr_protocol = %d\n",
- so->so_type, so->so_proto->pr_protocol);
-
- if (so->so_type != SOCK_RAW ||
- so->so_proto->pr_protocol != IPPROTO_IGMP) return EOPNOTSUPP;
-
- if (!m || (m->m_len != sizeof(int *)))
- return ENOPROTOOPT;
-
- v = mtod(m, int *);
- if (*v != 1)
- return ENOPROTOOPT;
-
- if (ip_mrouter != NULL) return EADDRINUSE;
-
- ip_mrouter = so;
-
- bzero((caddr_t)mfctable, sizeof(mfctable));
- bzero((caddr_t)nexpire, sizeof(nexpire));
-
- pim_assert = 0;
-
- timeout(expire_upcalls, (caddr_t)NULL, EXPIRE_TIMEOUT);
-
- if (mrtdebug)
- log(LOG_DEBUG, "ip_mrouter_init\n");
-
- return 0;
-}
-
-/*
- * Disable multicast routing
- */
-static int
-X_ip_mrouter_done()
-{
- vifi_t vifi;
- int i;
- struct ifnet *ifp;
- struct ifreq ifr;
- struct mbuf *mb_rt;
- struct mbuf *m;
- struct rtdetq *rte;
- int s;
-
- s = splnet();
-
- /*
- * For each phyint in use, disable promiscuous reception of all IP
- * multicasts.
- */
- for (vifi = 0; vifi < numvifs; vifi++) {
- if (viftable[vifi].v_lcl_addr.s_addr != 0 &&
- !(viftable[vifi].v_flags & VIFF_TUNNEL)) {
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr.s_addr
- = INADDR_ANY;
- ifp = viftable[vifi].v_ifp;
- (*ifp->if_ioctl)(ifp, SIOCDELMULTI, (caddr_t)&ifr);
- }
- }
- bzero((caddr_t)tbftable, sizeof(tbftable));
- bzero((caddr_t)viftable, sizeof(viftable));
- numvifs = 0;
- pim_assert = 0;
-
- untimeout(expire_upcalls, (caddr_t)NULL);
-
- /*
- * Free all multicast forwarding cache entries.
- */
- for (i = 0; i < MFCTBLSIZ; i++) {
- mb_rt = mfctable[i];
- while (mb_rt) {
- if (mb_rt->m_act != NULL) {
- while (mb_rt->m_act) {
- m = mb_rt->m_act;
- mb_rt->m_act = m->m_act;
- rte = mtod(m, struct rtdetq *);
- m_freem(rte->m);
- m_free(m);
- }
- }
- mb_rt = m_free(mb_rt);
- }
- }
-
- bzero((caddr_t)mfctable, sizeof(mfctable));
-
- /*
- * Reset de-encapsulation cache
- */
- last_encap_src = 0;
- last_encap_vif = NULL;
- have_encap_tunnel = 0;
-
- ip_mrouter = NULL;
-
- splx(s);
-
- if (mrtdebug)
- log(LOG_DEBUG, "ip_mrouter_done\n");
-
- return 0;
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mrouter_done)(void) = X_ip_mrouter_done;
-#endif
-
-static int
-get_version(mb)
- struct mbuf *mb;
-{
- int *v;
-
- v = mtod(mb, int *);
-
- *v = 0x0305; /* XXX !!!! */
- mb->m_len = sizeof(int);
-
- return 0;
-}
-
-/*
- * Set PIM assert processing global
- */
-static int
-set_assert(i)
- int *i;
-{
- if ((*i != 1) && (*i != 0))
- return EINVAL;
-
- pim_assert = *i;
-
- return 0;
-}
-
-/*
- * Get PIM assert processing global
- */
-static int
-get_assert(m)
- struct mbuf *m;
-{
- int *i;
-
- i = mtod(m, int *);
-
- *i = pim_assert;
-
- return 0;
-}
-
-/*
- * Add a vif to the vif table
- */
-static int
-add_vif(vifcp)
- register struct vifctl *vifcp;
-{
- register struct vif *vifp = viftable + vifcp->vifc_vifi;
- static struct sockaddr_in sin = {sizeof sin, AF_INET};
- struct ifaddr *ifa;
- struct ifnet *ifp;
- struct ifreq ifr;
- int error, s;
- struct tbf *v_tbf = tbftable + vifcp->vifc_vifi;
-
- if (vifcp->vifc_vifi >= MAXVIFS) return EINVAL;
- if (vifp->v_lcl_addr.s_addr != 0) return EADDRINUSE;
-
- /* Find the interface with an address in AF_INET family */
- sin.sin_addr = vifcp->vifc_lcl_addr;
- ifa = ifa_ifwithaddr((struct sockaddr *)&sin);
- if (ifa == 0) return EADDRNOTAVAIL;
- ifp = ifa->ifa_ifp;
-
- if (vifcp->vifc_flags & VIFF_TUNNEL) {
- if ((vifcp->vifc_flags & VIFF_SRCRT) == 0) {
- /*
- * An encapsulating tunnel is wanted. Tell ipip_input() to
- * start paying attention to encapsulated packets.
- */
- if (have_encap_tunnel == 0) {
- have_encap_tunnel = 1;
- for (s = 0; s < MAXVIFS; ++s) {
- multicast_decap_if[s].if_name = "mdecap";
- multicast_decap_if[s].if_unit = s;
- }
- }
- /*
- * Set interface to fake encapsulator interface
- */
- ifp = &multicast_decap_if[vifcp->vifc_vifi];
- /*
- * Prepare cached route entry
- */
- bzero(&vifp->v_route, sizeof(vifp->v_route));
- } else {
- log(LOG_ERR, "source routed tunnels not supported\n");
- return EOPNOTSUPP;
- }
- } else {
- /* Make sure the interface supports multicast */
- if ((ifp->if_flags & IFF_MULTICAST) == 0)
- return EOPNOTSUPP;
-
- /* Enable promiscuous reception of all IP multicasts from the if */
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr.s_addr = INADDR_ANY;
- s = splnet();
- error = (*ifp->if_ioctl)(ifp, SIOCADDMULTI, (caddr_t)&ifr);
- splx(s);
- if (error)
- return error;
- }
-
- s = splnet();
- /* define parameters for the tbf structure */
- vifp->v_tbf = v_tbf;
- GET_TIME(vifp->v_tbf->tbf_last_pkt_t);
- vifp->v_tbf->tbf_n_tok = 0;
- vifp->v_tbf->tbf_q_len = 0;
- vifp->v_tbf->tbf_max_q_len = MAXQSIZE;
- vifp->v_tbf->tbf_q = vifp->v_tbf->tbf_t = NULL;
-
- vifp->v_flags = vifcp->vifc_flags;
- vifp->v_threshold = vifcp->vifc_threshold;
- vifp->v_lcl_addr = vifcp->vifc_lcl_addr;
- vifp->v_rmt_addr = vifcp->vifc_rmt_addr;
- vifp->v_ifp = ifp;
- /* scaling up here allows division by 1024 in critical code */
- vifp->v_rate_limit= vifcp->vifc_rate_limit * 1024 / 1000;
- vifp->v_rsvp_on = 0;
- vifp->v_rsvpd = NULL;
- /* initialize per vif pkt counters */
- vifp->v_pkt_in = 0;
- vifp->v_pkt_out = 0;
- vifp->v_bytes_in = 0;
- vifp->v_bytes_out = 0;
- splx(s);
-
- /* Adjust numvifs up if the vifi is higher than numvifs */
- if (numvifs <= vifcp->vifc_vifi) numvifs = vifcp->vifc_vifi + 1;
-
- if (mrtdebug)
- log(LOG_DEBUG, "add_vif #%d, lcladdr %x, %s %x, thresh %x, rate %d\n",
- vifcp->vifc_vifi,
- ntohl(vifcp->vifc_lcl_addr.s_addr),
- (vifcp->vifc_flags & VIFF_TUNNEL) ? "rmtaddr" : "mask",
- ntohl(vifcp->vifc_rmt_addr.s_addr),
- vifcp->vifc_threshold,
- vifcp->vifc_rate_limit);
-
- return 0;
-}
-
-/*
- * Delete a vif from the vif table
- */
-static int
-del_vif(vifip)
- vifi_t *vifip;
-{
- register struct vif *vifp = viftable + *vifip;
- register vifi_t vifi;
- register struct mbuf *m;
- struct ifnet *ifp;
- struct ifreq ifr;
- int s;
-
- if (*vifip >= numvifs) return EINVAL;
- if (vifp->v_lcl_addr.s_addr == 0) return EADDRNOTAVAIL;
-
- s = splnet();
-
- if (!(vifp->v_flags & VIFF_TUNNEL)) {
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr.s_addr = INADDR_ANY;
- ifp = vifp->v_ifp;
- (*ifp->if_ioctl)(ifp, SIOCDELMULTI, (caddr_t)&ifr);
- }
-
- if (vifp == last_encap_vif) {
- last_encap_vif = 0;
- last_encap_src = 0;
- }
-
- /*
- * Free packets queued at the interface
- */
- while (vifp->v_tbf->tbf_q) {
- m = vifp->v_tbf->tbf_q;
- vifp->v_tbf->tbf_q = m->m_act;
- m_freem(m);
- }
-
- bzero((caddr_t)vifp->v_tbf, sizeof(*(vifp->v_tbf)));
- bzero((caddr_t)vifp, sizeof (*vifp));
-
- /* Adjust numvifs down */
- for (vifi = numvifs; vifi > 0; vifi--)
- if (viftable[vifi-1].v_lcl_addr.s_addr != 0) break;
- numvifs = vifi;
-
- splx(s);
-
- if (mrtdebug)
- log(LOG_DEBUG, "del_vif %d, numvifs %d\n", *vifip, numvifs);
-
- return 0;
-}
-
-/*
- * Add an mfc entry
- */
-static int
-add_mfc(mfccp)
- struct mfcctl *mfccp;
-{
- struct mfc *rt;
- register struct mbuf *mb_rt;
- u_long hash;
- struct mbuf *mb_ntry;
- struct rtdetq *rte;
- register u_short nstl;
- int s;
- int i;
-
- MFCFIND(mfccp->mfcc_origin.s_addr, mfccp->mfcc_mcastgrp.s_addr, rt);
-
- /* If an entry already exists, just update the fields */
- if (rt) {
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"add_mfc update o %x g %x p %x\n",
- ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent);
-
- s = splnet();
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- splx(s);
- return 0;
- }
-
- /*
- * Find the entry for which the upcall was made and update
- */
- s = splnet();
- hash = MFCHASH(mfccp->mfcc_origin.s_addr, mfccp->mfcc_mcastgrp.s_addr);
- for (mb_rt = mfctable[hash], nstl = 0; mb_rt; mb_rt = mb_rt->m_next) {
-
- rt = mtod(mb_rt, struct mfc *);
- if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
- (rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr) &&
- (mb_rt->m_act != NULL)) {
-
- if (nstl++)
- log(LOG_ERR, "add_mfc %s o %x g %x p %x dbx %x\n",
- "multiple kernel entries",
- ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent, mb_rt->m_act);
-
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"add_mfc o %x g %x p %x dbg %x\n",
- ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent, mb_rt->m_act);
-
- rt->mfc_origin = mfccp->mfcc_origin;
- rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- /* initialize pkt counters per src-grp */
- rt->mfc_pkt_cnt = 0;
- rt->mfc_byte_cnt = 0;
- rt->mfc_wrong_if = 0;
- rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
-
- rt->mfc_expire = 0; /* Don't clean this guy up */
- nexpire[hash]--;
-
- /* free packets Qed at the end of this entry */
- while (mb_rt->m_act) {
- mb_ntry = mb_rt->m_act;
- rte = mtod(mb_ntry, struct rtdetq *);
-/* #ifdef RSVP_ISI */
- ip_mdq(rte->m, rte->ifp, rt, -1);
-/* #endif */
- mb_rt->m_act = mb_ntry->m_act;
- m_freem(rte->m);
-#ifdef UPCALL_TIMING
- collate(&(rte->t));
-#endif /* UPCALL_TIMING */
- m_free(mb_ntry);
- }
- }
- }
-
- /*
- * It is possible that an entry is being inserted without an upcall
- */
- if (nstl == 0) {
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"add_mfc no upcall h %d o %x g %x p %x\n",
- hash, ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent);
-
- for (mb_rt = mfctable[hash]; mb_rt; mb_rt = mb_rt->m_next) {
-
- rt = mtod(mb_rt, struct mfc *);
- if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
- (rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr)) {
-
- rt->mfc_origin = mfccp->mfcc_origin;
- rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- /* initialize pkt counters per src-grp */
- rt->mfc_pkt_cnt = 0;
- rt->mfc_byte_cnt = 0;
- rt->mfc_wrong_if = 0;
- rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
- if (rt->mfc_expire)
- nexpire[hash]--;
- rt->mfc_expire = 0;
- }
- }
- if (mb_rt == NULL) {
- /* no upcall, so make a new entry */
- MGET(mb_rt, M_DONTWAIT, MT_MRTABLE);
- if (mb_rt == NULL) {
- splx(s);
- return ENOBUFS;
- }
-
- rt = mtod(mb_rt, struct mfc *);
-
- /* insert new entry at head of hash chain */
- rt->mfc_origin = mfccp->mfcc_origin;
- rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- /* initialize pkt counters per src-grp */
- rt->mfc_pkt_cnt = 0;
- rt->mfc_byte_cnt = 0;
- rt->mfc_wrong_if = 0;
- rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
- rt->mfc_expire = 0;
-
- /* link into table */
- mb_rt->m_next = mfctable[hash];
- mfctable[hash] = mb_rt;
- mb_rt->m_act = NULL;
- }
- }
- splx(s);
- return 0;
-}
-
-#ifdef UPCALL_TIMING
-/*
- * collect delay statistics on the upcalls
- */
-static void collate(t)
-register struct timeval *t;
-{
- register u_long d;
- register struct timeval tp;
- register u_long delta;
-
- GET_TIME(tp);
-
- if (TV_LT(*t, tp))
- {
- TV_DELTA(tp, *t, delta);
-
- d = delta >> 10;
- if (d > 50)
- d = 50;
-
- ++upcall_data[d];
- }
-}
-#endif /* UPCALL_TIMING */
-
-/*
- * Delete an mfc entry
- */
-static int
-del_mfc(mfccp)
- struct mfcctl *mfccp;
-{
- struct in_addr origin;
- struct in_addr mcastgrp;
- struct mfc *rt;
- struct mbuf *mb_rt;
- struct mbuf **nptr;
- u_long hash;
- int s;
-
- origin = mfccp->mfcc_origin;
- mcastgrp = mfccp->mfcc_mcastgrp;
- hash = MFCHASH(origin.s_addr, mcastgrp.s_addr);
-
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"del_mfc orig %x mcastgrp %x\n",
- ntohl(origin.s_addr), ntohl(mcastgrp.s_addr));
-
- s = splnet();
-
- nptr = &mfctable[hash];
- while ((mb_rt = *nptr) != NULL) {
- rt = mtod(mb_rt, struct mfc *);
- if (origin.s_addr == rt->mfc_origin.s_addr &&
- mcastgrp.s_addr == rt->mfc_mcastgrp.s_addr &&
- mb_rt->m_act == NULL)
- break;
-
- nptr = &mb_rt->m_next;
- }
- if (mb_rt == NULL) {
- splx(s);
- return EADDRNOTAVAIL;
- }
-
- MFREE(mb_rt, *nptr);
-
- splx(s);
-
- return 0;
-}
-
-/*
- * Send a message to mrouted on the multicast routing socket
- */
-static int
-socket_send(s, mm, src)
- struct socket *s;
- struct mbuf *mm;
- struct sockaddr_in *src;
-{
- if (s) {
- if (sbappendaddr(&s->so_rcv,
- (struct sockaddr *)src,
- mm, (struct mbuf *)0) != 0) {
- sorwakeup(s);
- return 0;
- }
- }
- m_freem(mm);
- return -1;
-}
-
-/*
- * IP multicast forwarding function. This function assumes that the packet
- * pointed to by "ip" has arrived on (or is about to be sent to) the interface
- * pointed to by "ifp", and the packet is to be relayed to other networks
- * that have members of the packet's destination IP multicast group.
- *
- * The packet is returned unscathed to the caller, unless it is
- * erroneous, in which case a non-zero return value tells the caller to
- * discard it.
- */
-
-#define IP_HDR_LEN 20 /* # bytes of fixed IP header (excluding options) */
-#define TUNNEL_LEN 12 /* # bytes of IP option for tunnel encapsulation */
-
-static int
-X_ip_mforward(ip, ifp, m, imo)
- register struct ip *ip;
- struct ifnet *ifp;
- struct mbuf *m;
- struct ip_moptions *imo;
-{
- register struct mfc *rt;
- register u_char *ipoptions;
- static struct sockaddr_in k_igmpsrc = { sizeof k_igmpsrc, AF_INET };
- static int srctun = 0;
- register struct mbuf *mm;
- int s;
- vifi_t vifi;
- struct vif *vifp;
-
- if (mrtdebug & DEBUG_FORWARD)
- log(LOG_DEBUG, "ip_mforward: src %x, dst %x, ifp %x\n",
- ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr), ifp);
-
- if (ip->ip_hl < (IP_HDR_LEN + TUNNEL_LEN) >> 2 ||
- (ipoptions = (u_char *)(ip + 1))[1] != IPOPT_LSRR ) {
- /*
- * Packet arrived via a physical interface or
- * an encapsulated tunnel.
- */
- } else {
- /*
- * Packet arrived through a source-route tunnel.
- * Source-route tunnels are no longer supported.
- */
- if ((srctun++ % 1000) == 0)
- log(LOG_ERR, "ip_mforward: received source-routed packet from %x\n",
- ntohl(ip->ip_src.s_addr));
-
- return 1;
- }
-
- if ((imo) && ((vifi = imo->imo_multicast_vif) < numvifs)) {
- if (ip->ip_ttl < 255)
- ip->ip_ttl++; /* compensate for -1 in *_send routines */
- if (rsvpdebug && ip->ip_p == IPPROTO_RSVP) {
- vifp = viftable + vifi;
- printf("Sending IPPROTO_RSVP from %lx to %lx on vif %d (%s%s%d)\n",
- ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr), vifi,
- (vifp->v_flags & VIFF_TUNNEL) ? "tunnel on " : "",
- vifp->v_ifp->if_name, vifp->v_ifp->if_unit);
- }
- return (ip_mdq(m, ifp, NULL, vifi));
- }
- if (rsvpdebug && ip->ip_p == IPPROTO_RSVP) {
- printf("Warning: IPPROTO_RSVP from %lx to %lx without vif option\n",
- ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr));
- if(!imo)
- printf("In fact, no options were specified at all\n");
- }
-
- /*
- * Don't forward a packet with time-to-live of zero or one,
- * or a packet destined to a local-only group.
- */
- if (ip->ip_ttl <= 1 ||
- ntohl(ip->ip_dst.s_addr) <= INADDR_MAX_LOCAL_GROUP)
- return 0;
-
- /*
- * Determine forwarding vifs from the forwarding cache table
- */
- s = splnet();
- MFCFIND(ip->ip_src.s_addr, ip->ip_dst.s_addr, rt);
-
- /* Entry exists, so forward if necessary */
- if (rt != NULL) {
- splx(s);
- return (ip_mdq(m, ifp, rt, -1));
- } else {
- /*
- * If we don't have a route for packet's origin,
- * Make a copy of the packet &
- * send message to routing daemon
- */
-
- register struct mbuf *mb_rt;
- register struct mbuf *mb_ntry;
- register struct mbuf *mb0;
- register struct rtdetq *rte;
- register struct mbuf *rte_m;
- register u_long hash;
- register int npkts;
- int hlen = ip->ip_hl << 2;
-#ifdef UPCALL_TIMING
- struct timeval tp;
-
- GET_TIME(tp);
-#endif
-
- mrtstat.mrts_no_route++;
- if (mrtdebug & (DEBUG_FORWARD | DEBUG_MFC))
- log(LOG_DEBUG, "ip_mforward: no rte s %x g %x\n",
- ntohl(ip->ip_src.s_addr),
- ntohl(ip->ip_dst.s_addr));
-
- /*
- * Allocate mbufs early so that we don't do extra work if we are
- * just going to fail anyway. Make sure to pullup the header so
- * that other people can't step on it.
- */
- MGET(mb_ntry, M_DONTWAIT, MT_DATA);
- if (mb_ntry == NULL) {
- splx(s);
- return ENOBUFS;
- }
- mb0 = m_copy(m, 0, M_COPYALL);
- if (mb0 && (M_HASCL(mb0) || mb0->m_len < hlen))
- mb0 = m_pullup(mb0, hlen);
- if (mb0 == NULL) {
- m_free(mb_ntry);
- splx(s);
- return ENOBUFS;
- }
-
- /* is there an upcall waiting for this packet? */
- hash = MFCHASH(ip->ip_src.s_addr, ip->ip_dst.s_addr);
- for (mb_rt = mfctable[hash]; mb_rt; mb_rt = mb_rt->m_next) {
- rt = mtod(mb_rt, struct mfc *);
- if ((ip->ip_src.s_addr == rt->mfc_origin.s_addr) &&
- (ip->ip_dst.s_addr == rt->mfc_mcastgrp.s_addr) &&
- (mb_rt->m_act != NULL))
- break;
- }
-
- if (mb_rt == NULL) {
- int i;
- struct igmpmsg *im;
-
- /* no upcall, so make a new entry */
- MGET(mb_rt, M_DONTWAIT, MT_MRTABLE);
- if (mb_rt == NULL) {
- m_free(mb_ntry);
- m_freem(mb0);
- splx(s);
- return ENOBUFS;
- }
- /* Make a copy of the header to send to the user level process */
- mm = m_copy(mb0, 0, hlen);
- if (mm == NULL) {
- m_free(mb_ntry);
- m_freem(mb0);
- m_free(mb_rt);
- splx(s);
- return ENOBUFS;
- }
-
- /*
- * Send message to routing daemon to install
- * a route into the kernel table
- */
- k_igmpsrc.sin_addr = ip->ip_src;
-
- im = mtod(mm, struct igmpmsg *);
- im->im_msgtype = IGMPMSG_NOCACHE;
- im->im_mbz = 0;
-
- mrtstat.mrts_upcalls++;
-
- if (socket_send(ip_mrouter, mm, &k_igmpsrc) < 0) {
- log(LOG_WARNING, "ip_mforward: ip_mrouter socket queue full\n");
- ++mrtstat.mrts_upq_sockfull;
- m_free(mb_ntry);
- m_freem(mb0);
- m_free(mb_rt);
- splx(s);
- return ENOBUFS;
- }
-
- rt = mtod(mb_rt, struct mfc *);
-
- /* insert new entry at head of hash chain */
- rt->mfc_origin.s_addr = ip->ip_src.s_addr;
- rt->mfc_mcastgrp.s_addr = ip->ip_dst.s_addr;
- rt->mfc_expire = UPCALL_EXPIRE;
- nexpire[hash]++;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = 0;
- rt->mfc_parent = -1;
-
- /* link into table */
- mb_rt->m_next = mfctable[hash];
- mfctable[hash] = mb_rt;
- mb_rt->m_act = NULL;
-
- rte_m = mb_rt;
- } else {
- /* determine if q has overflowed */
- for (rte_m = mb_rt, npkts = 0; rte_m->m_act; rte_m = rte_m->m_act)
- npkts++;
-
- if (npkts > MAX_UPQ) {
- mrtstat.mrts_upq_ovflw++;
- m_free(mb_ntry);
- m_freem(mb0);
- splx(s);
- return 0;
- }
- }
-
- mb_ntry->m_act = NULL;
- rte = mtod(mb_ntry, struct rtdetq *);
-
- rte->m = mb0;
- rte->ifp = ifp;
-#ifdef UPCALL_TIMING
- rte->t = tp;
-#endif
-
- /* Add this entry to the end of the queue */
- rte_m->m_act = mb_ntry;
-
- splx(s);
-
- return 0;
- }
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *,
- struct ip_moptions *) = X_ip_mforward;
-#endif
-
-/*
- * Clean up the cache entry if upcall is not serviced
- */
-static void
-expire_upcalls(void *unused)
-{
- struct mbuf *mb_rt, *m, **nptr;
- struct rtdetq *rte;
- struct mfc *mfc;
- int i;
- int s;
-
- s = splnet();
- for (i = 0; i < MFCTBLSIZ; i++) {
- if (nexpire[i] == 0)
- continue;
- nptr = &mfctable[i];
- for (mb_rt = *nptr; mb_rt != NULL; mb_rt = *nptr) {
- mfc = mtod(mb_rt, struct mfc *);
-
- /*
- * Skip real cache entries
- * Make sure it wasn't marked to not expire (shouldn't happen)
- * If it expires now
- */
- if (mb_rt->m_act != NULL &&
- mfc->mfc_expire != 0 &&
- --mfc->mfc_expire == 0) {
- if (mrtdebug & DEBUG_EXPIRE)
- log(LOG_DEBUG, "expire_upcalls: expiring (%x %x)\n",
- ntohl(mfc->mfc_origin.s_addr),
- ntohl(mfc->mfc_mcastgrp.s_addr));
- /*
- * drop all the packets
- * free the mbuf with the pkt, if, timing info
- */
- while (mb_rt->m_act) {
- m = mb_rt->m_act;
- mb_rt->m_act = m->m_act;
-
- rte = mtod(m, struct rtdetq *);
- m_freem(rte->m);
- m_free(m);
- }
- ++mrtstat.mrts_cache_cleanups;
- nexpire[i]--;
-
- MFREE(mb_rt, *nptr);
- } else {
- nptr = &mb_rt->m_next;
- }
- }
- }
- splx(s);
- timeout(expire_upcalls, (caddr_t)NULL, EXPIRE_TIMEOUT);
-}
-
-/*
- * Packet forwarding routine once entry in the cache is made
- */
-static int
-ip_mdq(m, ifp, rt, xmt_vif)
- register struct mbuf *m;
- register struct ifnet *ifp;
- register struct mfc *rt;
- register vifi_t xmt_vif;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register vifi_t vifi;
- register struct vif *vifp;
- register int plen = ntohs(ip->ip_len);
-
-/*
- * Macro to send packet on vif. Since RSVP packets don't get counted on
- * input, they shouldn't get counted on output, so statistics keeping is
- * seperate.
- */
-#define MC_SEND(ip,vifp,m) { \
- if ((vifp)->v_flags & VIFF_TUNNEL) \
- encap_send((ip), (vifp), (m)); \
- else \
- phyint_send((ip), (vifp), (m)); \
-}
-
- /*
- * If xmt_vif is not -1, send on only the requested vif.
- *
- * (since vifi_t is u_short, -1 becomes MAXUSHORT, which > numvifs.)
- */
- if (xmt_vif < numvifs) {
- MC_SEND(ip, viftable + xmt_vif, m);
- return 1;
- }
-
- /*
- * Don't forward if it didn't arrive from the parent vif for its origin.
- */
- vifi = rt->mfc_parent;
- if ((vifi >= numvifs) || (viftable[vifi].v_ifp != ifp)) {
- /* came in the wrong interface */
- if (mrtdebug & DEBUG_FORWARD)
- log(LOG_DEBUG, "wrong if: ifp %x vifi %d vififp %x\n",
- ifp, vifi, viftable[vifi].v_ifp);
- ++mrtstat.mrts_wrong_if;
- ++rt->mfc_wrong_if;
- /*
- * If we are doing PIM assert processing, and we are forwarding
- * packets on this interface, and it is a broadcast medium
- * interface (and not a tunnel), send a message to the routing daemon.
- */
- if (pim_assert && rt->mfc_ttls[vifi] &&
- (ifp->if_flags & IFF_BROADCAST) &&
- !(viftable[vifi].v_flags & VIFF_TUNNEL)) {
- struct sockaddr_in k_igmpsrc;
- struct mbuf *mm;
- struct igmpmsg *im;
- int hlen = ip->ip_hl << 2;
- struct timeval now;
- register u_long delta;
-
- GET_TIME(now);
-
- TV_DELTA(rt->mfc_last_assert, now, delta);
-
- if (delta > ASSERT_MSG_TIME) {
- mm = m_copy(m, 0, hlen);
- if (mm && (M_HASCL(mm) || mm->m_len < hlen))
- mm = m_pullup(mm, hlen);
- if (mm == NULL) {
- return ENOBUFS;
- }
-
- rt->mfc_last_assert = now;
-
- im = mtod(mm, struct igmpmsg *);
- im->im_msgtype = IGMPMSG_WRONGVIF;
- im->im_mbz = 0;
- im->im_vif = vifi;
-
- k_igmpsrc.sin_addr = im->im_src;
-
- socket_send(ip_mrouter, mm, &k_igmpsrc);
- }
- }
- return 0;
- }
-
- /* If I sourced this packet, it counts as output, else it was input. */
- if (ip->ip_src.s_addr == viftable[vifi].v_lcl_addr.s_addr) {
- viftable[vifi].v_pkt_out++;
- viftable[vifi].v_bytes_out += plen;
- } else {
- viftable[vifi].v_pkt_in++;
- viftable[vifi].v_bytes_in += plen;
- }
- rt->mfc_pkt_cnt++;
- rt->mfc_byte_cnt += plen;
-
- /*
- * For each vif, decide if a copy of the packet should be forwarded.
- * Forward if:
- * - the ttl exceeds the vif's threshold
- * - there are group members downstream on interface
- */
- for (vifp = viftable, vifi = 0; vifi < numvifs; vifp++, vifi++)
- if ((rt->mfc_ttls[vifi] > 0) &&
- (ip->ip_ttl > rt->mfc_ttls[vifi])) {
- vifp->v_pkt_out++;
- vifp->v_bytes_out += plen;
- MC_SEND(ip, vifp, m);
- }
-
- return 0;
-}
-
-/*
- * check if a vif number is legal/ok. This is used by ip_output, to export
- * numvifs there,
- */
-static int
-X_legal_vif_num(vif)
- int vif;
-{
- if (vif >= 0 && vif < numvifs)
- return(1);
- else
- return(0);
-}
-
-#ifndef MROUTE_LKM
-int (*legal_vif_num)(int) = X_legal_vif_num;
-#endif
-
-/*
- * Return the local address used by this vif
- */
-static u_long
-X_ip_mcast_src(vifi)
- int vifi;
-{
- if (vifi >= 0 && vifi < numvifs)
- return viftable[vifi].v_lcl_addr.s_addr;
- else
- return INADDR_ANY;
-}
-
-#ifndef MROUTE_LKM
-u_long (*ip_mcast_src)(int) = X_ip_mcast_src;
-#endif
-
-static void
-phyint_send(ip, vifp, m)
- struct ip *ip;
- struct vif *vifp;
- struct mbuf *m;
-{
- register struct mbuf *mb_copy;
- register int hlen = ip->ip_hl << 2;
-
- /*
- * Make a new reference to the packet; make sure that
- * the IP header is actually copied, not just referenced,
- * so that ip_output() only scribbles on the copy.
- */
- mb_copy = m_copy(m, 0, M_COPYALL);
- if (mb_copy && (M_HASCL(mb_copy) || mb_copy->m_len < hlen))
- mb_copy = m_pullup(mb_copy, hlen);
- if (mb_copy == NULL)
- return;
-
- if (vifp->v_rate_limit <= 0)
- tbf_send_packet(vifp, mb_copy);
- else
- tbf_control(vifp, mb_copy, mtod(mb_copy, struct ip *), ip->ip_len);
-}
-
-static void
-encap_send(ip, vifp, m)
- register struct ip *ip;
- register struct vif *vifp;
- register struct mbuf *m;
-{
- register struct mbuf *mb_copy;
- register struct ip *ip_copy;
- register int i, len = ip->ip_len;
-
- /*
- * copy the old packet & pullup it's IP header into the
- * new mbuf so we can modify it. Try to fill the new
- * mbuf since if we don't the ethernet driver will.
- */
- MGETHDR(mb_copy, M_DONTWAIT, MT_HEADER);
- if (mb_copy == NULL)
- return;
- mb_copy->m_data += max_linkhdr;
- mb_copy->m_len = sizeof(multicast_encap_iphdr);
-
- if ((mb_copy->m_next = m_copy(m, 0, M_COPYALL)) == NULL) {
- m_freem(mb_copy);
- return;
- }
- i = MHLEN - M_LEADINGSPACE(mb_copy);
- if (i > len)
- i = len;
- mb_copy = m_pullup(mb_copy, i);
- if (mb_copy == NULL)
- return;
- mb_copy->m_pkthdr.len = len + sizeof(multicast_encap_iphdr);
-
- /*
- * fill in the encapsulating IP header.
- */
- ip_copy = mtod(mb_copy, struct ip *);
- *ip_copy = multicast_encap_iphdr;
- ip_copy->ip_id = htons(ip_id++);
- ip_copy->ip_len += len;
- ip_copy->ip_src = vifp->v_lcl_addr;
- ip_copy->ip_dst = vifp->v_rmt_addr;
-
- /*
- * turn the encapsulated IP header back into a valid one.
- */
- ip = (struct ip *)((caddr_t)ip_copy + sizeof(multicast_encap_iphdr));
- --ip->ip_ttl;
- HTONS(ip->ip_len);
- HTONS(ip->ip_off);
- ip->ip_sum = 0;
- mb_copy->m_data += sizeof(multicast_encap_iphdr);
- ip->ip_sum = in_cksum(mb_copy, ip->ip_hl << 2);
- mb_copy->m_data -= sizeof(multicast_encap_iphdr);
-
- if (vifp->v_rate_limit <= 0)
- tbf_send_packet(vifp, mb_copy);
- else
- tbf_control(vifp, mb_copy, ip, ip_copy->ip_len);
-}
-
-/*
- * De-encapsulate a packet and feed it back through ip input (this
- * routine is called whenever IP gets a packet with proto type
- * ENCAP_PROTO and a local destination address).
- */
-void
-#ifdef MROUTE_LKM
-X_ipip_input(m, iphlen)
-#else
-ipip_input(m, iphlen)
-#endif
- register struct mbuf *m;
- int iphlen;
-{
- struct ifnet *ifp = m->m_pkthdr.rcvif;
- register struct ip *ip = mtod(m, struct ip *);
- register int hlen = ip->ip_hl << 2;
- register int s;
- register struct ifqueue *ifq;
- register struct vif *vifp;
-
- if (!have_encap_tunnel) {
- rip_input(m, iphlen);
- return;
- }
- /*
- * dump the packet if it's not to a multicast destination or if
- * we don't have an encapsulating tunnel with the source.
- * Note: This code assumes that the remote site IP address
- * uniquely identifies the tunnel (i.e., that this site has
- * at most one tunnel with the remote site).
- */
- if (! IN_MULTICAST(ntohl(((struct ip *)((char *)ip + hlen))->ip_dst.s_addr))) {
- ++mrtstat.mrts_bad_tunnel;
- m_freem(m);
- return;
- }
- if (ip->ip_src.s_addr != last_encap_src) {
- register struct vif *vife;
-
- vifp = viftable;
- vife = vifp + numvifs;
- last_encap_src = ip->ip_src.s_addr;
- last_encap_vif = 0;
- for ( ; vifp < vife; ++vifp)
- if (vifp->v_rmt_addr.s_addr == ip->ip_src.s_addr) {
- if ((vifp->v_flags & (VIFF_TUNNEL|VIFF_SRCRT))
- == VIFF_TUNNEL)
- last_encap_vif = vifp;
- break;
- }
- }
- if ((vifp = last_encap_vif) == 0) {
- last_encap_src = 0;
- mrtstat.mrts_cant_tunnel++; /*XXX*/
- m_freem(m);
- if (mrtdebug)
- log(LOG_DEBUG, "ip_mforward: no tunnel with %x\n",
- ntohl(ip->ip_src.s_addr));
- return;
- }
- ifp = vifp->v_ifp;
-
- if (hlen > IP_HDR_LEN)
- ip_stripoptions(m, (struct mbuf *) 0);
- m->m_data += IP_HDR_LEN;
- m->m_len -= IP_HDR_LEN;
- m->m_pkthdr.len -= IP_HDR_LEN;
- m->m_pkthdr.rcvif = ifp;
-
- ifq = &ipintrq;
- s = splimp();
- if (IF_QFULL(ifq)) {
- IF_DROP(ifq);
- m_freem(m);
- } else {
- IF_ENQUEUE(ifq, m);
- /*
- * normally we would need a "schednetisr(NETISR_IP)"
- * here but we were called by ip_input and it is going
- * to loop back & try to dequeue the packet we just
- * queued as soon as we return so we avoid the
- * unnecessary software interrrupt.
- */
- }
- splx(s);
-}
-
-/*
- * Token bucket filter module
- */
-
-static void
-tbf_control(vifp, m, ip, p_len)
- register struct vif *vifp;
- register struct mbuf *m;
- register struct ip *ip;
- register u_long p_len;
-{
- register struct tbf *t = vifp->v_tbf;
-
- if (p_len > MAX_BKT_SIZE) {
- /* drop if packet is too large */
- mrtstat.mrts_pkt2large++;
- m_freem(m);
- return;
- }
-
- tbf_update_tokens(vifp);
-
- /* if there are enough tokens,
- * and the queue is empty,
- * send this packet out
- */
-
- if (t->tbf_q_len == 0) {
- /* queue empty, send packet if enough tokens */
- if (p_len <= t->tbf_n_tok) {
- t->tbf_n_tok -= p_len;
- tbf_send_packet(vifp, m);
- } else {
- /* queue packet and timeout till later */
- tbf_queue(vifp, m);
- timeout(tbf_reprocess_q, (caddr_t)vifp, TBF_REPROCESS);
- }
- } else if (t->tbf_q_len < t->tbf_max_q_len) {
- /* finite queue length, so queue pkts and process queue */
- tbf_queue(vifp, m);
- tbf_process_q(vifp);
- } else {
- /* queue length too much, try to dq and queue and process */
- if (!tbf_dq_sel(vifp, ip)) {
- mrtstat.mrts_q_overflow++;
- m_freem(m);
- return;
- } else {
- tbf_queue(vifp, m);
- tbf_process_q(vifp);
- }
- }
- return;
-}
-
-/*
- * adds a packet to the queue at the interface
- */
-static void
-tbf_queue(vifp, m)
- register struct vif *vifp;
- register struct mbuf *m;
-{
- register int s = splnet();
- register struct tbf *t = vifp->v_tbf;
-
- if (t->tbf_t == NULL) {
- /* Queue was empty */
- t->tbf_q = m;
- } else {
- /* Insert at tail */
- t->tbf_t->m_act = m;
- }
-
- /* Set new tail pointer */
- t->tbf_t = m;
-
-#ifdef DIAGNOSTIC
- /* Make sure we didn't get fed a bogus mbuf */
- if (m->m_act)
- panic("tbf_queue: m_act");
-#endif
- m->m_act = NULL;
-
- t->tbf_q_len++;
-
- splx(s);
-}
-
-
-/*
- * processes the queue at the interface
- */
-static void
-tbf_process_q(vifp)
- register struct vif *vifp;
-{
- register struct mbuf *m;
- register int len;
- register int s = splnet();
- register struct tbf *t = vifp->v_tbf;
-
- /* loop through the queue at the interface and send as many packets
- * as possible
- */
- while (t->tbf_q_len > 0) {
- m = t->tbf_q;
-
- len = mtod(m, struct ip *)->ip_len;
-
- /* determine if the packet can be sent */
- if (len <= t->tbf_n_tok) {
- /* if so,
- * reduce no of tokens, dequeue the packet,
- * send the packet.
- */
- t->tbf_n_tok -= len;
-
- t->tbf_q = m->m_act;
- if (--t->tbf_q_len == 0)
- t->tbf_t = NULL;
-
- m->m_act = NULL;
- tbf_send_packet(vifp, m);
-
- } else break;
- }
- splx(s);
-}
-
-static void
-tbf_reprocess_q(xvifp)
- void *xvifp;
-{
- register struct vif *vifp = xvifp;
- if (ip_mrouter == NULL)
- return;
-
- tbf_update_tokens(vifp);
-
- tbf_process_q(vifp);
-
- if (vifp->v_tbf->tbf_q_len)
- timeout(tbf_reprocess_q, (caddr_t)vifp, TBF_REPROCESS);
-}
-
-/* function that will selectively discard a member of the queue
- * based on the precedence value and the priority
- */
-static int
-tbf_dq_sel(vifp, ip)
- register struct vif *vifp;
- register struct ip *ip;
-{
- register int s = splnet();
- register u_int p;
- register struct mbuf *m, *last;
- register struct mbuf **np;
- register struct tbf *t = vifp->v_tbf;
-
- p = priority(vifp, ip);
-
- np = &t->tbf_q;
- last = NULL;
- while ((m = *np) != NULL) {
- if (p > priority(vifp, mtod(m, struct ip *))) {
- *np = m->m_act;
- /* If we're removing the last packet, fix the tail pointer */
- if (m == t->tbf_t)
- t->tbf_t = last;
- m_freem(m);
- /* it's impossible for the queue to be empty, but
- * we check anyway. */
- if (--t->tbf_q_len == 0)
- t->tbf_t = NULL;
- splx(s);
- mrtstat.mrts_drop_sel++;
- return(1);
- }
- np = &m->m_act;
- last = m;
- }
- splx(s);
- return(0);
-}
-
-static void
-tbf_send_packet(vifp, m)
- register struct vif *vifp;
- register struct mbuf *m;
-{
- struct ip_moptions imo;
- int error;
- static struct route ro;
- int s = splnet();
-
- if (vifp->v_flags & VIFF_TUNNEL) {
- /* If tunnel options */
- ip_output(m, (struct mbuf *)0, &vifp->v_route,
- IP_FORWARDING, (struct ip_moptions *)0);
- } else {
- imo.imo_multicast_ifp = vifp->v_ifp;
- imo.imo_multicast_ttl = mtod(m, struct ip *)->ip_ttl - 1;
- imo.imo_multicast_loop = 1;
- imo.imo_multicast_vif = -1;
-
- /*
- * Re-entrancy should not be a problem here, because
- * the packets that we send out and are looped back at us
- * should get rejected because they appear to come from
- * the loopback interface, thus preventing looping.
- */
- error = ip_output(m, (struct mbuf *)0, &ro,
- IP_FORWARDING, &imo);
-
- if (mrtdebug & DEBUG_XMIT)
- log(LOG_DEBUG, "phyint_send on vif %d err %d\n",
- vifp - viftable, error);
- }
- splx(s);
-}
-
-/* determine the current time and then
- * the elapsed time (between the last time and time now)
- * in milliseconds & update the no. of tokens in the bucket
- */
-static void
-tbf_update_tokens(vifp)
- register struct vif *vifp;
-{
- struct timeval tp;
- register u_long tm;
- register int s = splnet();
- register struct tbf *t = vifp->v_tbf;
-
- GET_TIME(tp);
-
- TV_DELTA(tp, t->tbf_last_pkt_t, tm);
-
- /*
- * This formula is actually
- * "time in seconds" * "bytes/second".
- *
- * (tm / 1000000) * (v_rate_limit * 1000 * (1000/1024) / 8)
- *
- * The (1000/1024) was introduced in add_vif to optimize
- * this divide into a shift.
- */
- t->tbf_n_tok += tm * vifp->v_rate_limit / 1024 / 8;
- t->tbf_last_pkt_t = tp;
-
- if (t->tbf_n_tok > MAX_BKT_SIZE)
- t->tbf_n_tok = MAX_BKT_SIZE;
-
- splx(s);
-}
-
-static int
-priority(vifp, ip)
- register struct vif *vifp;
- register struct ip *ip;
-{
- register int prio;
-
- /* temporary hack; may add general packet classifier some day */
-
- /*
- * The UDP port space is divided up into four priority ranges:
- * [0, 16384) : unclassified - lowest priority
- * [16384, 32768) : audio - highest priority
- * [32768, 49152) : whiteboard - medium priority
- * [49152, 65536) : video - low priority
- */
- if (ip->ip_p == IPPROTO_UDP) {
- struct udphdr *udp = (struct udphdr *)(((char *)ip) + (ip->ip_hl << 2));
- switch (ntohs(udp->uh_dport) & 0xc000) {
- case 0x4000:
- prio = 70;
- break;
- case 0x8000:
- prio = 60;
- break;
- case 0xc000:
- prio = 55;
- break;
- default:
- prio = 50;
- break;
- }
- if (tbfdebug > 1)
- log(LOG_DEBUG, "port %x prio%d\n", ntohs(udp->uh_dport), prio);
- } else {
- prio = 50;
- }
- return prio;
-}
-
-/*
- * End of token bucket filter modifications
- */
-
-int
-ip_rsvp_vif_init(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- int i;
- register int s;
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_init: so_type = %d, pr_protocol = %d\n",
- so->so_type, so->so_proto->pr_protocol);
-
- if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP)
- return EOPNOTSUPP;
-
- /* Check mbuf. */
- if (m == NULL || m->m_len != sizeof(int)) {
- return EINVAL;
- }
- i = *(mtod(m, int *));
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_init: vif = %d rsvp_on = %d\n",i,rsvp_on);
-
- s = splnet();
-
- /* Check vif. */
- if (!legal_vif_num(i)) {
- splx(s);
- return EADDRNOTAVAIL;
- }
-
- /* Check if socket is available. */
- if (viftable[i].v_rsvpd != NULL) {
- splx(s);
- return EADDRINUSE;
- }
-
- viftable[i].v_rsvpd = so;
- /* This may seem silly, but we need to be sure we don't over-increment
- * the RSVP counter, in case something slips up.
- */
- if (!viftable[i].v_rsvp_on) {
- viftable[i].v_rsvp_on = 1;
- rsvp_on++;
- }
-
- splx(s);
- return 0;
-}
-
-int
-ip_rsvp_vif_done(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- int i;
- register int s;
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_done: so_type = %d, pr_protocol = %d\n",
- so->so_type, so->so_proto->pr_protocol);
-
- if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP)
- return EOPNOTSUPP;
-
- /* Check mbuf. */
- if (m == NULL || m->m_len != sizeof(int)) {
- return EINVAL;
- }
- i = *(mtod(m, int *));
-
- s = splnet();
-
- /* Check vif. */
- if (!legal_vif_num(i)) {
- splx(s);
- return EADDRNOTAVAIL;
- }
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_done: v_rsvpd = %p so = %p\n",
- viftable[i].v_rsvpd, so);
-
- viftable[i].v_rsvpd = NULL;
- /* This may seem silly, but we need to be sure we don't over-decrement
- * the RSVP counter, in case something slips up.
- */
- if (viftable[i].v_rsvp_on) {
- viftable[i].v_rsvp_on = 0;
- rsvp_on--;
- }
-
- splx(s);
- return 0;
-}
-
-void
-ip_rsvp_force_done(so)
- struct socket *so;
-{
- int vifi;
- register int s;
-
- /* Don't bother if it is not the right type of socket. */
- if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP)
- return;
-
- s = splnet();
-
- /* The socket may be attached to more than one vif...this
- * is perfectly legal.
- */
- for (vifi = 0; vifi < numvifs; vifi++) {
- if (viftable[vifi].v_rsvpd == so) {
- viftable[vifi].v_rsvpd = NULL;
- /* This may seem silly, but we need to be sure we don't
- * over-decrement the RSVP counter, in case something slips up.
- */
- if (viftable[vifi].v_rsvp_on) {
- viftable[vifi].v_rsvp_on = 0;
- rsvp_on--;
- }
- }
- }
-
- splx(s);
- return;
-}
-
-void
-rsvp_input(m, iphlen)
- struct mbuf *m;
- int iphlen;
-{
- int vifi;
- register struct ip *ip = mtod(m, struct ip *);
- static struct sockaddr_in rsvp_src = { sizeof rsvp_src, AF_INET };
- register int s;
- struct ifnet *ifp;
-
- if (rsvpdebug)
- printf("rsvp_input: rsvp_on %d\n",rsvp_on);
-
- /* Can still get packets with rsvp_on = 0 if there is a local member
- * of the group to which the RSVP packet is addressed. But in this
- * case we want to throw the packet away.
- */
- if (!rsvp_on) {
- m_freem(m);
- return;
- }
-
- /* If the old-style non-vif-associated socket is set, then use
- * it and ignore the new ones.
- */
- if (ip_rsvpd != NULL) {
- if (rsvpdebug)
- printf("rsvp_input: Sending packet up old-style socket\n");
- rip_input(m, iphlen);
- return;
- }
-
- s = splnet();
-
- if (rsvpdebug)
- printf("rsvp_input: check vifs\n");
-
-#ifdef DIAGNOSTIC
- if (!(m->m_flags & M_PKTHDR))
- panic("rsvp_input no hdr");
-#endif
-
- ifp = m->m_pkthdr.rcvif;
- /* Find which vif the packet arrived on. */
- for (vifi = 0; vifi < numvifs; vifi++) {
- if (viftable[vifi].v_ifp == ifp)
- break;
- }
-
- if (vifi == numvifs) {
- /* Can't find vif packet arrived on. Drop packet. */
- if (rsvpdebug)
- printf("rsvp_input: Can't find vif for packet...dropping it.\n");
- m_freem(m);
- splx(s);
- return;
- }
-
- if (rsvpdebug)
- printf("rsvp_input: check socket\n");
-
- if (viftable[vifi].v_rsvpd == NULL) {
- /* drop packet, since there is no specific socket for this
- * interface */
- if (rsvpdebug)
- printf("rsvp_input: No socket defined for vif %d\n",vifi);
- m_freem(m);
- splx(s);
- return;
- }
- rsvp_src.sin_addr = ip->ip_src;
-
- if (rsvpdebug && m)
- printf("rsvp_input: m->m_len = %d, sbspace() = %ld\n",
- m->m_len,sbspace(&(viftable[vifi].v_rsvpd->so_rcv)));
-
- if (socket_send(viftable[vifi].v_rsvpd, m, &rsvp_src) < 0)
- if (rsvpdebug)
- printf("rsvp_input: Failed to append to socket\n");
- else
- if (rsvpdebug)
- printf("rsvp_input: send packet up\n");
-
- splx(s);
-}
-
-#ifdef MROUTE_LKM
-#include <sys/conf.h>
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-MOD_MISC("ip_mroute_mod")
-
-static int
-ip_mroute_mod_handle(struct lkm_table *lkmtp, int cmd)
-{
- int i;
- struct lkm_misc *args = lkmtp->private.lkm_misc;
- int err = 0;
-
- switch(cmd) {
- static int (*old_ip_mrouter_cmd)();
- static int (*old_ip_mrouter_done)();
- static int (*old_ip_mforward)();
- static int (*old_mrt_ioctl)();
- static void (*old_proto4_input)();
- static int (*old_legal_vif_num)();
- extern struct protosw inetsw[];
-
- case LKM_E_LOAD:
- if(lkmexists(lkmtp) || ip_mrtproto)
- return(EEXIST);
- old_ip_mrouter_cmd = ip_mrouter_cmd;
- ip_mrouter_cmd = X_ip_mrouter_cmd;
- old_ip_mrouter_done = ip_mrouter_done;
- ip_mrouter_done = X_ip_mrouter_done;
- old_ip_mforward = ip_mforward;
- ip_mforward = X_ip_mforward;
- old_mrt_ioctl = mrt_ioctl;
- mrt_ioctl = X_mrt_ioctl;
- old_proto4_input = inetsw[ip_protox[ENCAP_PROTO]].pr_input;
- inetsw[ip_protox[ENCAP_PROTO]].pr_input = X_ipip_input;
- old_legal_vif_num = legal_vif_num;
- legal_vif_num = X_legal_vif_num;
- ip_mrtproto = IGMP_DVMRP;
-
- printf("\nIP multicast routing loaded\n");
- break;
-
- case LKM_E_UNLOAD:
- if (ip_mrouter)
- return EINVAL;
-
- ip_mrouter_cmd = old_ip_mrouter_cmd;
- ip_mrouter_done = old_ip_mrouter_done;
- ip_mforward = old_ip_mforward;
- mrt_ioctl = old_mrt_ioctl;
- inetsw[ip_protox[ENCAP_PROTO]].pr_input = old_proto4_input;
- legal_vif_num = old_legal_vif_num;
- ip_mrtproto = 0;
- break;
-
- default:
- err = EINVAL;
- break;
- }
-
- return(err);
-}
-
-int
-ip_mroute_mod(struct lkm_table *lkmtp, int cmd, int ver) {
- DISPATCH(lkmtp, cmd, ver, ip_mroute_mod_handle, ip_mroute_mod_handle,
- nosys);
-}
-
-#endif /* MROUTE_LKM */
-#endif /* MROUTING */
diff --git a/c/src/libnetworking/netinet/ip_mroute.h b/c/src/libnetworking/netinet/ip_mroute.h
deleted file mode 100644
index 5ddd6799d2..0000000000
--- a/c/src/libnetworking/netinet/ip_mroute.h
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright (c) 1989 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)ip_mroute.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IP_MROUTE_H_
-#define _NETINET_IP_MROUTE_H_
-
-/*
- * Definitions for IP multicast forwarding.
- *
- * Written by David Waitzman, BBN Labs, August 1988.
- * Modified by Steve Deering, Stanford, February 1989.
- * Modified by Ajit Thyagarajan, PARC, August 1993.
- * Modified by Ajit Thyagarajan, PARC, August 1994.
- *
- * MROUTING Revision: 3.3.1.3
- */
-
-
-/*
- * Multicast Routing set/getsockopt commands.
- */
-#define MRT_INIT 100 /* initialize forwarder */
-#define MRT_DONE 101 /* shut down forwarder */
-#define MRT_ADD_VIF 102 /* create virtual interface */
-#define MRT_DEL_VIF 103 /* delete virtual interface */
-#define MRT_ADD_MFC 104 /* insert forwarding cache entry */
-#define MRT_DEL_MFC 105 /* delete forwarding cache entry */
-#define MRT_VERSION 106 /* get kernel version number */
-#define MRT_ASSERT 107 /* enable PIM assert processing */
-
-
-#define GET_TIME(t) microtime(&t)
-
-/*
- * Types and macros for handling bitmaps with one bit per virtual interface.
- */
-#define MAXVIFS 32
-typedef u_long vifbitmap_t;
-typedef u_short vifi_t; /* type of a vif index */
-#define ALL_VIFS (vifi_t)-1
-
-#define VIFM_SET(n, m) ((m) |= (1 << (n)))
-#define VIFM_CLR(n, m) ((m) &= ~(1 << (n)))
-#define VIFM_ISSET(n, m) ((m) & (1 << (n)))
-#define VIFM_CLRALL(m) ((m) = 0x00000000)
-#define VIFM_COPY(mfrom, mto) ((mto) = (mfrom))
-#define VIFM_SAME(m1, m2) ((m1) == (m2))
-
-
-/*
- * Argument structure for MRT_ADD_VIF.
- * (MRT_DEL_VIF takes a single vifi_t argument.)
- */
-struct vifctl {
- vifi_t vifc_vifi; /* the index of the vif to be added */
- u_char vifc_flags; /* VIFF_ flags defined below */
- u_char vifc_threshold; /* min ttl required to forward on vif */
- u_int vifc_rate_limit; /* max rate */
- struct in_addr vifc_lcl_addr; /* local interface address */
- struct in_addr vifc_rmt_addr; /* remote address (tunnels only) */
-};
-
-#define VIFF_TUNNEL 0x1 /* vif represents a tunnel end-point */
-#define VIFF_SRCRT 0x2 /* tunnel uses IP source routing */
-
-/*
- * Argument structure for MRT_ADD_MFC and MRT_DEL_MFC
- * (mfcc_tos to be added at a future point)
- */
-struct mfcctl {
- struct in_addr mfcc_origin; /* ip origin of mcasts */
- struct in_addr mfcc_mcastgrp; /* multicast group associated*/
- vifi_t mfcc_parent; /* incoming vif */
- u_char mfcc_ttls[MAXVIFS]; /* forwarding ttls on vifs */
-};
-
-/*
- * The kernel's multicast routing statistics.
- */
-struct mrtstat {
- u_long mrts_mfc_lookups; /* # forw. cache hash table hits */
- u_long mrts_mfc_misses; /* # forw. cache hash table misses */
- u_long mrts_upcalls; /* # calls to mrouted */
- u_long mrts_no_route; /* no route for packet's origin */
- u_long mrts_bad_tunnel; /* malformed tunnel options */
- u_long mrts_cant_tunnel; /* no room for tunnel options */
- u_long mrts_wrong_if; /* arrived on wrong interface */
- u_long mrts_upq_ovflw; /* upcall Q overflow */
- u_long mrts_cache_cleanups; /* # entries with no upcalls */
- u_long mrts_drop_sel; /* pkts dropped selectively */
- u_long mrts_q_overflow; /* pkts dropped - Q overflow */
- u_long mrts_pkt2large; /* pkts dropped - size > BKT SIZE */
- u_long mrts_upq_sockfull; /* upcalls dropped - socket full */
-};
-
-/*
- * Argument structure used by mrouted to get src-grp pkt counts
- */
-struct sioc_sg_req {
- struct in_addr src;
- struct in_addr grp;
- u_long pktcnt;
- u_long bytecnt;
- u_long wrong_if;
-};
-
-/*
- * Argument structure used by mrouted to get vif pkt counts
- */
-struct sioc_vif_req {
- vifi_t vifi; /* vif number */
- u_long icount; /* Input packet count on vif */
- u_long ocount; /* Output packet count on vif */
- u_long ibytes; /* Input byte count on vif */
- u_long obytes; /* Output byte count on vif */
-};
-
-
-/*
- * The kernel's virtual-interface structure.
- */
-struct vif {
- u_char v_flags; /* VIFF_ flags defined above */
- u_char v_threshold; /* min ttl required to forward on vif*/
- u_int v_rate_limit; /* max rate */
- struct tbf *v_tbf; /* token bucket structure at intf. */
- struct in_addr v_lcl_addr; /* local interface address */
- struct in_addr v_rmt_addr; /* remote address (tunnels only) */
- struct ifnet *v_ifp; /* pointer to interface */
- u_long v_pkt_in; /* # pkts in on interface */
- u_long v_pkt_out; /* # pkts out on interface */
- u_long v_bytes_in; /* # bytes in on interface */
- u_long v_bytes_out; /* # bytes out on interface */
- struct route v_route; /* cached route if this is a tunnel */
- u_int v_rsvp_on; /* RSVP listening on this vif */
- struct socket *v_rsvpd; /* RSVP daemon socket */
-};
-
-/*
- * The kernel's multicast forwarding cache entry structure
- * (A field for the type of service (mfc_tos) is to be added
- * at a future point)
- */
-struct mfc {
- struct in_addr mfc_origin; /* IP origin of mcasts */
- struct in_addr mfc_mcastgrp; /* multicast group associated*/
- vifi_t mfc_parent; /* incoming vif */
- u_char mfc_ttls[MAXVIFS]; /* forwarding ttls on vifs */
- u_long mfc_pkt_cnt; /* pkt count for src-grp */
- u_long mfc_byte_cnt; /* byte count for src-grp */
- u_long mfc_wrong_if; /* wrong if for src-grp */
- int mfc_expire; /* time to clean entry up */
- struct timeval mfc_last_assert; /* last time I sent an assert*/
-};
-
-/*
- * Struct used to communicate from kernel to multicast router
- * note the convenient similarity to an IP packet
- */
-struct igmpmsg {
- u_long unused1;
- u_long unused2;
- u_char im_msgtype; /* what type of message */
-#define IGMPMSG_NOCACHE 1
-#define IGMPMSG_WRONGVIF 2
- u_char im_mbz; /* must be zero */
- u_char im_vif; /* vif rec'd on */
- u_char unused3;
- struct in_addr im_src, im_dst;
-};
-
-/*
- * Argument structure used for pkt info. while upcall is made
- */
-struct rtdetq {
- struct mbuf *m; /* A copy of the packet */
- struct ifnet *ifp; /* Interface pkt came in on */
- vifi_t xmt_vif; /* Saved copy of imo_multicast_vif */
-#ifdef UPCALL_TIMING
- struct timeval t; /* Timestamp */
-#endif /* UPCALL_TIMING */
-};
-
-#define MFCTBLSIZ 256
-#if (MFCTBLSIZ & (MFCTBLSIZ - 1)) == 0 /* from sys:route.h */
-#define MFCHASHMOD(h) ((h) & (MFCTBLSIZ - 1))
-#else
-#define MFCHASHMOD(h) ((h) % MFCTBLSIZ)
-#endif
-
-#define MAX_UPQ 4 /* max. no of pkts in upcall Q */
-
-/*
- * Token Bucket filter code
- */
-#define MAX_BKT_SIZE 10000 /* 10K bytes size */
-#define MAXQSIZE 10 /* max # of pkts in queue */
-
-/*
- * the token bucket filter at each vif
- */
-struct tbf
-{
- struct timeval tbf_last_pkt_t; /* arr. time of last pkt */
- u_long tbf_n_tok; /* no of tokens in bucket */
- u_long tbf_q_len; /* length of queue at this vif */
- u_long tbf_max_q_len; /* max. queue length */
- struct mbuf *tbf_q; /* Packet queue */
- struct mbuf *tbf_t; /* tail-insertion pointer */
-};
-
-#ifdef KERNEL
-
-extern int (*ip_mrouter_set) __P((int, struct socket *, struct mbuf *));
-extern int (*ip_mrouter_get) __P((int, struct socket *, struct mbuf **));
-extern int (*ip_mrouter_done) __P((void));
-#ifdef MROUTING
-extern int (*mrt_ioctl) __P((int, caddr_t));
-#else
-extern int (*mrt_ioctl) __P((int, caddr_t, struct proc *));
-#endif
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_IP_MROUTE_H_ */
diff --git a/c/src/libnetworking/netinet/ip_output.c b/c/src/libnetworking/netinet/ip_output.c
deleted file mode 100644
index 810f6c7479..0000000000
--- a/c/src/libnetworking/netinet/ip_output.c
+++ /dev/null
@@ -1,1307 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 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.
- *
- * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
- * $Id$
- */
-
-#define _IP_VHL
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/errno.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-
-#ifdef vax
-#include <machine/mtpr.h>
-#endif
-#include <machine/in_cksum.h>
-
-#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1
-#undef COMPAT_IPFW
-#define COMPAT_IPFW 1
-#else
-#undef COMPAT_IPFW
-#endif
-
-u_short ip_id;
-
-static struct mbuf *ip_insertoptions __P((struct mbuf *, struct mbuf *, int *));
-static void ip_mloopback
- __P((struct ifnet *, struct mbuf *, struct sockaddr_in *, int));
-static int ip_getmoptions
- __P((int, struct ip_moptions *, struct mbuf **));
-static int ip_optcopy __P((struct ip *, struct ip *));
-static int ip_pcbopts __P((struct mbuf **, struct mbuf *));
-static int ip_setmoptions
- __P((int, struct ip_moptions **, struct mbuf *));
-
-extern struct protosw inetsw[];
-
-/*
- * IP output. The packet in mbuf chain m contains a skeletal IP
- * header (with len, off, ttl, proto, tos, src, dst).
- * The mbuf chain containing the packet will be freed.
- * The mbuf opt, if present, will not be freed.
- */
-int
-ip_output(m0, opt, ro, flags, imo)
- struct mbuf *m0;
- struct mbuf *opt;
- struct route *ro;
- int flags;
- struct ip_moptions *imo;
-{
- struct ip *ip, *mhip;
- struct ifnet *ifp;
- struct mbuf *m = m0;
- int hlen = sizeof (struct ip);
- int len, off, error = 0;
- struct sockaddr_in *dst;
- struct in_ifaddr *ia;
- int isbroadcast;
-
-#ifdef DIAGNOSTIC
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("ip_output no HDR");
- if (!ro)
- panic("ip_output no route, proto = %d",
- mtod(m, struct ip *)->ip_p);
-#endif
- if (opt) {
- m = ip_insertoptions(m, opt, &len);
- hlen = len;
- }
- ip = mtod(m, struct ip *);
- /*
- * Fill in IP header.
- */
- if ((flags & (IP_FORWARDING|IP_RAWOUTPUT)) == 0) {
- ip->ip_vhl = IP_MAKE_VHL(IPVERSION, hlen >> 2);
- ip->ip_off &= IP_DF;
- ip->ip_id = htons(ip_id++);
- ipstat.ips_localout++;
- } else {
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
- }
-
- dst = (struct sockaddr_in *)&ro->ro_dst;
- /*
- * If there is a cached route,
- * check that it is to the same destination
- * and is still up. If not, free it and try again.
- */
- if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 ||
- dst->sin_addr.s_addr != ip->ip_dst.s_addr)) {
- RTFREE(ro->ro_rt);
- ro->ro_rt = (struct rtentry *)0;
- }
- if (ro->ro_rt == 0) {
- dst->sin_family = AF_INET;
- dst->sin_len = sizeof(*dst);
- dst->sin_addr = ip->ip_dst;
- }
- /*
- * If routing to interface only,
- * short circuit routing lookup.
- */
-#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
-#define sintosa(sin) ((struct sockaddr *)(sin))
- if (flags & IP_ROUTETOIF) {
- if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == 0 &&
- (ia = ifatoia(ifa_ifwithnet(sintosa(dst)))) == 0) {
- ipstat.ips_noroute++;
- error = ENETUNREACH;
- goto bad;
- }
- ifp = ia->ia_ifp;
- ip->ip_ttl = 1;
- isbroadcast = in_broadcast(dst->sin_addr, ifp);
- } else {
- /*
- * If this is the case, we probably don't want to allocate
- * a protocol-cloned route since we didn't get one from the
- * ULP. This lets TCP do its thing, while not burdening
- * forwarding or ICMP with the overhead of cloning a route.
- * Of course, we still want to do any cloning requested by
- * the link layer, as this is probably required in all cases
- * for correct operation (as it is for ARP).
- */
- if (ro->ro_rt == 0)
- rtalloc_ign(ro, RTF_PRCLONING);
- if (ro->ro_rt == 0) {
- ipstat.ips_noroute++;
- error = EHOSTUNREACH;
- goto bad;
- }
- ia = ifatoia(ro->ro_rt->rt_ifa);
- ifp = ro->ro_rt->rt_ifp;
- ro->ro_rt->rt_use++;
- if (ro->ro_rt->rt_flags & RTF_GATEWAY)
- dst = (struct sockaddr_in *)ro->ro_rt->rt_gateway;
- if (ro->ro_rt->rt_flags & RTF_HOST)
- isbroadcast = (ro->ro_rt->rt_flags & RTF_BROADCAST);
- else
- isbroadcast = in_broadcast(dst->sin_addr, ifp);
- }
- if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- struct in_multi *inm;
-
- m->m_flags |= M_MCAST;
- /*
- * IP destination address is multicast. Make sure "dst"
- * still points to the address in "ro". (It may have been
- * changed to point to a gateway address, above.)
- */
- dst = (struct sockaddr_in *)&ro->ro_dst;
- /*
- * See if the caller provided any multicast options
- */
- if (imo != NULL) {
- ip->ip_ttl = imo->imo_multicast_ttl;
- if (imo->imo_multicast_ifp != NULL)
- ifp = imo->imo_multicast_ifp;
- if (imo->imo_multicast_vif != -1)
- ip->ip_src.s_addr =
- ip_mcast_src(imo->imo_multicast_vif);
- } else
- ip->ip_ttl = IP_DEFAULT_MULTICAST_TTL;
- /*
- * Confirm that the outgoing interface supports multicast.
- */
- if ((imo == NULL) || (imo->imo_multicast_vif == -1)) {
- if ((ifp->if_flags & IFF_MULTICAST) == 0) {
- ipstat.ips_noroute++;
- error = ENETUNREACH;
- goto bad;
- }
- }
- /*
- * If source address not specified yet, use address
- * of outgoing interface.
- */
- if (ip->ip_src.s_addr == INADDR_ANY) {
- register struct in_ifaddr *ia;
-
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if (ia->ia_ifp == ifp) {
- ip->ip_src = IA_SIN(ia)->sin_addr;
- break;
- }
- }
-
- IN_LOOKUP_MULTI(ip->ip_dst, ifp, inm);
- if (inm != NULL &&
- (imo == NULL || imo->imo_multicast_loop)) {
- /*
- * If we belong to the destination multicast group
- * on the outgoing interface, and the caller did not
- * forbid loopback, loop back a copy.
- */
- ip_mloopback(ifp, m, dst, hlen);
- }
- else {
- /*
- * If we are acting as a multicast router, perform
- * multicast forwarding as if the packet had just
- * arrived on the interface to which we are about
- * to send. The multicast forwarding function
- * recursively calls this function, using the
- * IP_FORWARDING flag to prevent infinite recursion.
- *
- * Multicasts that are looped back by ip_mloopback(),
- * above, will be forwarded by the ip_input() routine,
- * if necessary.
- */
- if (ip_mrouter && (flags & IP_FORWARDING) == 0) {
- /*
- * Check if rsvp daemon is running. If not, don't
- * set ip_moptions. This ensures that the packet
- * is multicast and not just sent down one link
- * as prescribed by rsvpd.
- */
- if (!rsvp_on)
- imo = NULL;
- if (ip_mforward(ip, ifp, m, imo) != 0) {
- m_freem(m);
- goto done;
- }
- }
- }
-
- /*
- * Multicasts with a time-to-live of zero may be looped-
- * back, above, but must not be transmitted on a network.
- * Also, multicasts addressed to the loopback interface
- * are not sent -- the above call to ip_mloopback() will
- * loop back a copy if this host actually belongs to the
- * destination group on the loopback interface.
- */
- if (ip->ip_ttl == 0 || ifp->if_flags & IFF_LOOPBACK) {
- m_freem(m);
- goto done;
- }
-
- goto sendit;
- }
-#ifndef notdef
- /*
- * If source address not specified yet, use address
- * of outgoing interface.
- */
- if (ip->ip_src.s_addr == INADDR_ANY)
- ip->ip_src = IA_SIN(ia)->sin_addr;
-#endif
- /*
- * Verify that we have any chance at all of being able to queue
- * the packet or packet fragments
- */
- if ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >=
- ifp->if_snd.ifq_maxlen) {
- error = ENOBUFS;
- goto bad;
- }
-
- /*
- * Look for broadcast address and
- * and verify user is allowed to send
- * such a packet.
- */
- if (isbroadcast) {
- if ((ifp->if_flags & IFF_BROADCAST) == 0) {
- error = EADDRNOTAVAIL;
- goto bad;
- }
- if ((flags & IP_ALLOWBROADCAST) == 0) {
- error = EACCES;
- goto bad;
- }
- /* don't allow broadcast messages to be fragmented */
- if ((u_short)ip->ip_len > ifp->if_mtu) {
- error = EMSGSIZE;
- goto bad;
- }
- m->m_flags |= M_BCAST;
- } else {
- m->m_flags &= ~M_BCAST;
- }
-
-sendit:
- /*
- * IpHack's section.
- * - Xlate: translate packet's addr/port (NAT).
- * - Firewall: deny/allow/etc.
- * - Wrap: fake packet's addr/port <unimpl.>
- * - Encapsulate: put it in another IP and send out. <unimp.>
- */
-
-#ifdef COMPAT_IPFW
- if (ip_nat_ptr && !(*ip_nat_ptr)(&ip, &m, ifp, IP_NAT_OUT)) {
- error = EACCES;
- goto done;
- }
-
- /*
- * Check with the firewall...
- */
- if (ip_fw_chk_ptr) {
-#ifdef IPDIVERT
- ip_divert_port = (*ip_fw_chk_ptr)(&ip,
- hlen, ifp, ip_divert_ignore, &m);
- ip_divert_ignore = 0;
- if (ip_divert_port) { /* Divert packet */
- (*inetsw[ip_protox[IPPROTO_DIVERT]].pr_input)(m, 0);
- goto done;
- }
-#else
- /* If ipfw says divert, we have to just drop packet */
- if ((*ip_fw_chk_ptr)(&ip, hlen, ifp, 0, &m)) {
- m_freem(m);
- goto done;
- }
-#endif
- if (!m) {
- error = EACCES;
- goto done;
- }
- }
-#endif /* COMPAT_IPFW */
-
- /*
- * If small enough for interface, can just send directly.
- */
- if ((u_short)ip->ip_len <= ifp->if_mtu) {
- ip->ip_len = htons((u_short)ip->ip_len);
- ip->ip_off = htons((u_short)ip->ip_off);
- ip->ip_sum = 0;
- if (ip->ip_vhl == IP_VHL_BORING) {
- ip->ip_sum = in_cksum_hdr(ip);
- } else {
- ip->ip_sum = in_cksum(m, hlen);
- }
- error = (*ifp->if_output)(ifp, m,
- (struct sockaddr *)dst, ro->ro_rt);
- goto done;
- }
- /*
- * Too large for interface; fragment if possible.
- * Must be able to put at least 8 bytes per fragment.
- */
- if (ip->ip_off & IP_DF) {
- error = EMSGSIZE;
- /*
- * This case can happen if the user changed the MTU
- * of an interface after enabling IP on it. Because
- * most netifs don't keep track of routes pointing to
- * them, there is no way for one to update all its
- * routes when the MTU is changed.
- */
- if ((ro->ro_rt->rt_flags & (RTF_UP | RTF_HOST))
- && !(ro->ro_rt->rt_rmx.rmx_locks & RTV_MTU)
- && (ro->ro_rt->rt_rmx.rmx_mtu > ifp->if_mtu)) {
- ro->ro_rt->rt_rmx.rmx_mtu = ifp->if_mtu;
- }
- ipstat.ips_cantfrag++;
- goto bad;
- }
- len = (ifp->if_mtu - hlen) &~ 7;
- if (len < 8) {
- error = EMSGSIZE;
- goto bad;
- }
-
- {
- int mhlen, firstlen = len;
- struct mbuf **mnext = &m->m_nextpkt;
-
- /*
- * Loop through length of segment after first fragment,
- * make new header and copy data of each part and link onto chain.
- */
- m0 = m;
- mhlen = sizeof (struct ip);
- for (off = hlen + len; off < (u_short)ip->ip_len; off += len) {
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == 0) {
- error = ENOBUFS;
- ipstat.ips_odropped++;
- goto sendorfree;
- }
- m->m_data += max_linkhdr;
- mhip = mtod(m, struct ip *);
- *mhip = *ip;
- if (hlen > sizeof (struct ip)) {
- mhlen = ip_optcopy(ip, mhip) + sizeof (struct ip);
- mhip->ip_vhl = IP_MAKE_VHL(IPVERSION, mhlen >> 2);
- }
- m->m_len = mhlen;
- mhip->ip_off = ((off - hlen) >> 3) + (ip->ip_off & ~IP_MF);
- if (ip->ip_off & IP_MF)
- mhip->ip_off |= IP_MF;
- if (off + len >= (u_short)ip->ip_len)
- len = (u_short)ip->ip_len - off;
- else
- mhip->ip_off |= IP_MF;
- mhip->ip_len = htons((u_short)(len + mhlen));
- m->m_next = m_copy(m0, off, len);
- if (m->m_next == 0) {
- (void) m_free(m);
- error = ENOBUFS; /* ??? */
- ipstat.ips_odropped++;
- goto sendorfree;
- }
- m->m_pkthdr.len = mhlen + len;
- m->m_pkthdr.rcvif = (struct ifnet *)0;
- mhip->ip_off = htons((u_short)mhip->ip_off);
- mhip->ip_sum = 0;
- if (mhip->ip_vhl == IP_VHL_BORING) {
- mhip->ip_sum = in_cksum_hdr(mhip);
- } else {
- mhip->ip_sum = in_cksum(m, mhlen);
- }
- *mnext = m;
- mnext = &m->m_nextpkt;
- ipstat.ips_ofragments++;
- }
- /*
- * Update first fragment by trimming what's been copied out
- * and updating header, then send each fragment (in order).
- */
- m = m0;
- m_adj(m, hlen + firstlen - (u_short)ip->ip_len);
- m->m_pkthdr.len = hlen + firstlen;
- ip->ip_len = htons((u_short)m->m_pkthdr.len);
- ip->ip_off = htons((u_short)(ip->ip_off | IP_MF));
- ip->ip_sum = 0;
- if (ip->ip_vhl == IP_VHL_BORING) {
- ip->ip_sum = in_cksum_hdr(ip);
- } else {
- ip->ip_sum = in_cksum(m, hlen);
- }
-sendorfree:
- for (m = m0; m; m = m0) {
- m0 = m->m_nextpkt;
- m->m_nextpkt = 0;
- if (error == 0)
- error = (*ifp->if_output)(ifp, m,
- (struct sockaddr *)dst, ro->ro_rt);
- else
- m_freem(m);
- }
-
- if (error == 0)
- ipstat.ips_fragmented++;
- }
-done:
- return (error);
-bad:
- m_freem(m0);
- goto done;
-}
-
-/*
- * Insert IP options into preformed packet.
- * Adjust IP destination as required for IP source routing,
- * as indicated by a non-zero in_addr at the start of the options.
- *
- * XXX This routine assumes that the packet has no options in place.
- */
-static struct mbuf *
-ip_insertoptions(m, opt, phlen)
- register struct mbuf *m;
- struct mbuf *opt;
- int *phlen;
-{
- register struct ipoption *p = mtod(opt, struct ipoption *);
- struct mbuf *n;
- register struct ip *ip = mtod(m, struct ip *);
- unsigned optlen;
-
- optlen = opt->m_len - sizeof(p->ipopt_dst);
- if (optlen + (u_short)ip->ip_len > IP_MAXPACKET)
- return (m); /* XXX should fail */
- if (p->ipopt_dst.s_addr)
- ip->ip_dst = p->ipopt_dst;
- if (m->m_flags & M_EXT || m->m_data - optlen < m->m_pktdat) {
- MGETHDR(n, M_DONTWAIT, MT_HEADER);
- if (n == 0)
- return (m);
- n->m_pkthdr.len = m->m_pkthdr.len + optlen;
- m->m_len -= sizeof(struct ip);
- m->m_data += sizeof(struct ip);
- n->m_next = m;
- m = n;
- m->m_len = optlen + sizeof(struct ip);
- m->m_data += max_linkhdr;
- (void)memcpy(mtod(m, void *), ip, sizeof(struct ip));
- } else {
- m->m_data -= optlen;
- m->m_len += optlen;
- m->m_pkthdr.len += optlen;
- ovbcopy((caddr_t)ip, mtod(m, caddr_t), sizeof(struct ip));
- }
- ip = mtod(m, struct ip *);
- bcopy(p->ipopt_list, ip + 1, optlen);
- *phlen = sizeof(struct ip) + optlen;
- ip->ip_vhl = IP_MAKE_VHL(IPVERSION, *phlen >> 2);
- ip->ip_len += optlen;
- return (m);
-}
-
-/*
- * Copy options from ip to jp,
- * omitting those not copied during fragmentation.
- */
-static int
-ip_optcopy(ip, jp)
- struct ip *ip, *jp;
-{
- register u_char *cp, *dp;
- int opt, optlen, cnt;
-
- cp = (u_char *)(ip + 1);
- dp = (u_char *)(jp + 1);
- cnt = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof (struct ip);
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[0];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP) {
- /* Preserve for IP mcast tunnel's LSRR alignment. */
- *dp++ = IPOPT_NOP;
- optlen = 1;
- continue;
- } else
- optlen = cp[IPOPT_OLEN];
- /* bogus lengths should have been caught by ip_dooptions */
- if (optlen > cnt)
- optlen = cnt;
- if (IPOPT_COPIED(opt)) {
- bcopy(cp, dp, optlen);
- dp += optlen;
- }
- }
- for (optlen = dp - (u_char *)(jp+1); optlen & 0x3; optlen++)
- *dp++ = IPOPT_EOL;
- return (optlen);
-}
-
-/*
- * IP socket option processing.
- */
-int
-ip_ctloutput(op, so, level, optname, mp)
- int op;
- struct socket *so;
- int level, optname;
- struct mbuf **mp;
-{
- register struct inpcb *inp = sotoinpcb(so);
- register struct mbuf *m = *mp;
- register int optval = 0;
- int error = 0;
-
- if (level != IPPROTO_IP) {
- error = EINVAL;
- if (op == PRCO_SETOPT && *mp)
- (void) m_free(*mp);
- } else switch (op) {
-
- case PRCO_SETOPT:
- switch (optname) {
- case IP_OPTIONS:
-#ifdef notyet
- case IP_RETOPTS:
- return (ip_pcbopts(optname, &inp->inp_options, m));
-#else
- return (ip_pcbopts(&inp->inp_options, m));
-#endif
-
- case IP_TOS:
- case IP_TTL:
- case IP_RECVOPTS:
- case IP_RECVRETOPTS:
- case IP_RECVDSTADDR:
- case IP_RECVIF:
- if (m == 0 || m->m_len != sizeof(int))
- error = EINVAL;
- else {
- optval = *mtod(m, int *);
- switch (optname) {
-
- case IP_TOS:
- inp->inp_ip_tos = optval;
- break;
-
- case IP_TTL:
- inp->inp_ip_ttl = optval;
- break;
-#define OPTSET(bit) \
- if (optval) \
- inp->inp_flags |= bit; \
- else \
- inp->inp_flags &= ~bit;
-
- case IP_RECVOPTS:
- OPTSET(INP_RECVOPTS);
- break;
-
- case IP_RECVRETOPTS:
- OPTSET(INP_RECVRETOPTS);
- break;
-
- case IP_RECVDSTADDR:
- OPTSET(INP_RECVDSTADDR);
- break;
-
- case IP_RECVIF:
- OPTSET(INP_RECVIF);
- break;
- }
- }
- break;
-#undef OPTSET
-
- case IP_MULTICAST_IF:
- case IP_MULTICAST_VIF:
- case IP_MULTICAST_TTL:
- case IP_MULTICAST_LOOP:
- case IP_ADD_MEMBERSHIP:
- case IP_DROP_MEMBERSHIP:
- error = ip_setmoptions(optname, &inp->inp_moptions, m);
- break;
-
- case IP_PORTRANGE:
- if (m == 0 || m->m_len != sizeof(int))
- error = EINVAL;
- else {
- optval = *mtod(m, int *);
-
- switch (optval) {
-
- case IP_PORTRANGE_DEFAULT:
- inp->inp_flags &= ~(INP_LOWPORT);
- inp->inp_flags &= ~(INP_HIGHPORT);
- break;
-
- case IP_PORTRANGE_HIGH:
- inp->inp_flags &= ~(INP_LOWPORT);
- inp->inp_flags |= INP_HIGHPORT;
- break;
-
- case IP_PORTRANGE_LOW:
- inp->inp_flags &= ~(INP_HIGHPORT);
- inp->inp_flags |= INP_LOWPORT;
- break;
-
- default:
- error = EINVAL;
- break;
- }
- }
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- if (m)
- (void)m_free(m);
- break;
-
- case PRCO_GETOPT:
- switch (optname) {
- case IP_OPTIONS:
- case IP_RETOPTS:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- if (inp->inp_options) {
- m->m_len = inp->inp_options->m_len;
- bcopy(mtod(inp->inp_options, void *),
- mtod(m, void *), m->m_len);
- } else
- m->m_len = 0;
- break;
-
- case IP_TOS:
- case IP_TTL:
- case IP_RECVOPTS:
- case IP_RECVRETOPTS:
- case IP_RECVDSTADDR:
- case IP_RECVIF:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof(int);
- switch (optname) {
-
- case IP_TOS:
- optval = inp->inp_ip_tos;
- break;
-
- case IP_TTL:
- optval = inp->inp_ip_ttl;
- break;
-
-#define OPTBIT(bit) (inp->inp_flags & bit ? 1 : 0)
-
- case IP_RECVOPTS:
- optval = OPTBIT(INP_RECVOPTS);
- break;
-
- case IP_RECVRETOPTS:
- optval = OPTBIT(INP_RECVRETOPTS);
- break;
-
- case IP_RECVDSTADDR:
- optval = OPTBIT(INP_RECVDSTADDR);
- break;
-
- case IP_RECVIF:
- optval = OPTBIT(INP_RECVIF);
- break;
- }
- *mtod(m, int *) = optval;
- break;
-
- case IP_MULTICAST_IF:
- case IP_MULTICAST_VIF:
- case IP_MULTICAST_TTL:
- case IP_MULTICAST_LOOP:
- case IP_ADD_MEMBERSHIP:
- case IP_DROP_MEMBERSHIP:
- error = ip_getmoptions(optname, inp->inp_moptions, mp);
- break;
-
- case IP_PORTRANGE:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof(int);
-
- if (inp->inp_flags & INP_HIGHPORT)
- optval = IP_PORTRANGE_HIGH;
- else if (inp->inp_flags & INP_LOWPORT)
- optval = IP_PORTRANGE_LOW;
- else
- optval = 0;
-
- *mtod(m, int *) = optval;
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- break;
- }
- return (error);
-}
-
-/*
- * Set up IP options in pcb for insertion in output packets.
- * Store in mbuf with pointer in pcbopt, adding pseudo-option
- * with destination address if source routed.
- */
-static int
-#ifdef notyet
-ip_pcbopts(optname, pcbopt, m)
- int optname;
-#else
-ip_pcbopts(pcbopt, m)
-#endif
- struct mbuf **pcbopt;
- register struct mbuf *m;
-{
- register int cnt, optlen;
- register u_char *cp;
- u_char opt;
-
- /* turn off any old options */
- if (*pcbopt)
- (void)m_free(*pcbopt);
- *pcbopt = 0;
- if (m == (struct mbuf *)0 || m->m_len == 0) {
- /*
- * Only turning off any previous options.
- */
- if (m)
- (void)m_free(m);
- return (0);
- }
-
-#ifndef vax
- if (m->m_len % sizeof(long))
- goto bad;
-#endif
- /*
- * IP first-hop destination address will be stored before
- * actual options; move other options back
- * and clear it when none present.
- */
- if (m->m_data + m->m_len + sizeof(struct in_addr) >= &m->m_dat[MLEN])
- goto bad;
- cnt = m->m_len;
- m->m_len += sizeof(struct in_addr);
- cp = mtod(m, u_char *) + sizeof(struct in_addr);
- ovbcopy(mtod(m, caddr_t), (caddr_t)cp, (unsigned)cnt);
- bzero(mtod(m, caddr_t), sizeof(struct in_addr));
-
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[IPOPT_OLEN];
- if (optlen <= IPOPT_OLEN || optlen > cnt)
- goto bad;
- }
- switch (opt) {
-
- default:
- break;
-
- case IPOPT_LSRR:
- case IPOPT_SSRR:
- /*
- * user process specifies route as:
- * ->A->B->C->D
- * D must be our final destination (but we can't
- * check that since we may not have connected yet).
- * A is first hop destination, which doesn't appear in
- * actual IP option, but is stored before the options.
- */
- if (optlen < IPOPT_MINOFF - 1 + sizeof(struct in_addr))
- goto bad;
- m->m_len -= sizeof(struct in_addr);
- cnt -= sizeof(struct in_addr);
- optlen -= sizeof(struct in_addr);
- cp[IPOPT_OLEN] = optlen;
- /*
- * Move first hop before start of options.
- */
- bcopy((caddr_t)&cp[IPOPT_OFFSET+1], mtod(m, caddr_t),
- sizeof(struct in_addr));
- /*
- * Then copy rest of options back
- * to close up the deleted entry.
- */
- ovbcopy((caddr_t)(&cp[IPOPT_OFFSET+1] +
- sizeof(struct in_addr)),
- (caddr_t)&cp[IPOPT_OFFSET+1],
- (unsigned)cnt + sizeof(struct in_addr));
- break;
- }
- }
- if (m->m_len > MAX_IPOPTLEN + sizeof(struct in_addr))
- goto bad;
- *pcbopt = m;
- return (0);
-
-bad:
- (void)m_free(m);
- return (EINVAL);
-}
-
-/*
- * Set the IP multicast options in response to user setsockopt().
- */
-static int
-ip_setmoptions(optname, imop, m)
- int optname;
- struct ip_moptions **imop;
- struct mbuf *m;
-{
- register int error = 0;
- u_char loop;
- register int i;
- struct in_addr addr;
- register struct ip_mreq *mreq;
- register struct ifnet *ifp;
- register struct ip_moptions *imo = *imop;
- struct route ro;
- register struct sockaddr_in *dst;
- int s;
-
- if (imo == NULL) {
- /*
- * No multicast option buffer attached to the pcb;
- * allocate one and initialize to default values.
- */
- imo = (struct ip_moptions*)malloc(sizeof(*imo), M_IPMOPTS,
- M_WAITOK);
-
- if (imo == NULL)
- return (ENOBUFS);
- *imop = imo;
- imo->imo_multicast_ifp = NULL;
- imo->imo_multicast_vif = -1;
- imo->imo_multicast_ttl = IP_DEFAULT_MULTICAST_TTL;
- imo->imo_multicast_loop = IP_DEFAULT_MULTICAST_LOOP;
- imo->imo_num_memberships = 0;
- }
-
- switch (optname) {
- /* store an index number for the vif you wanna use in the send */
- case IP_MULTICAST_VIF:
- if (!legal_vif_num) {
- error = EOPNOTSUPP;
- break;
- }
- if (m == NULL || m->m_len != sizeof(int)) {
- error = EINVAL;
- break;
- }
- i = *(mtod(m, int *));
- if (!legal_vif_num(i) && (i != -1)) {
- error = EINVAL;
- break;
- }
- imo->imo_multicast_vif = i;
- break;
-
- case IP_MULTICAST_IF:
- /*
- * Select the interface for outgoing multicast packets.
- */
- if (m == NULL || m->m_len != sizeof(struct in_addr)) {
- error = EINVAL;
- break;
- }
- addr = *(mtod(m, struct in_addr *));
- /*
- * INADDR_ANY is used to remove a previous selection.
- * When no interface is selected, a default one is
- * chosen every time a multicast packet is sent.
- */
- if (addr.s_addr == INADDR_ANY) {
- imo->imo_multicast_ifp = NULL;
- break;
- }
- /*
- * The selected interface is identified by its local
- * IP address. Find the interface and confirm that
- * it supports multicasting.
- */
- s = splimp();
- INADDR_TO_IFP(addr, ifp);
- if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) {
- splx(s);
- error = EADDRNOTAVAIL;
- break;
- }
- imo->imo_multicast_ifp = ifp;
- splx(s);
- break;
-
- case IP_MULTICAST_TTL:
- /*
- * Set the IP time-to-live for outgoing multicast packets.
- */
- if (m == NULL || m->m_len != 1) {
- error = EINVAL;
- break;
- }
- imo->imo_multicast_ttl = *(mtod(m, u_char *));
- break;
-
- case IP_MULTICAST_LOOP:
- /*
- * Set the loopback flag for outgoing multicast packets.
- * Must be zero or one.
- */
- if (m == NULL || m->m_len != 1 ||
- (loop = *(mtod(m, u_char *))) > 1) {
- error = EINVAL;
- break;
- }
- imo->imo_multicast_loop = loop;
- break;
-
- case IP_ADD_MEMBERSHIP:
- /*
- * Add a multicast group membership.
- * Group must be a valid IP multicast address.
- */
- if (m == NULL || m->m_len != sizeof(struct ip_mreq)) {
- error = EINVAL;
- break;
- }
- mreq = mtod(m, struct ip_mreq *);
- if (!IN_MULTICAST(ntohl(mreq->imr_multiaddr.s_addr))) {
- error = EINVAL;
- break;
- }
- s = splimp();
- /*
- * If no interface address was provided, use the interface of
- * the route to the given multicast address.
- */
- if (mreq->imr_interface.s_addr == INADDR_ANY) {
- bzero((caddr_t)&ro, sizeof(ro));
- dst = (struct sockaddr_in *)&ro.ro_dst;
- dst->sin_len = sizeof(*dst);
- dst->sin_family = AF_INET;
- dst->sin_addr = mreq->imr_multiaddr;
- rtalloc(&ro);
- if (ro.ro_rt == NULL) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- ifp = ro.ro_rt->rt_ifp;
- rtfree(ro.ro_rt);
- }
- else {
- INADDR_TO_IFP(mreq->imr_interface, ifp);
- }
-
- /*
- * See if we found an interface, and confirm that it
- * supports multicast.
- */
- if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- /*
- * See if the membership already exists or if all the
- * membership slots are full.
- */
- for (i = 0; i < imo->imo_num_memberships; ++i) {
- if (imo->imo_membership[i]->inm_ifp == ifp &&
- imo->imo_membership[i]->inm_addr.s_addr
- == mreq->imr_multiaddr.s_addr)
- break;
- }
- if (i < imo->imo_num_memberships) {
- error = EADDRINUSE;
- splx(s);
- break;
- }
- if (i == IP_MAX_MEMBERSHIPS) {
- error = ETOOMANYREFS;
- splx(s);
- break;
- }
- /*
- * Everything looks good; add a new record to the multicast
- * address list for the given interface.
- */
- if ((imo->imo_membership[i] =
- in_addmulti(&mreq->imr_multiaddr, ifp)) == NULL) {
- error = ENOBUFS;
- splx(s);
- break;
- }
- ++imo->imo_num_memberships;
- splx(s);
- break;
-
- case IP_DROP_MEMBERSHIP:
- /*
- * Drop a multicast group membership.
- * Group must be a valid IP multicast address.
- */
- if (m == NULL || m->m_len != sizeof(struct ip_mreq)) {
- error = EINVAL;
- break;
- }
- mreq = mtod(m, struct ip_mreq *);
- if (!IN_MULTICAST(ntohl(mreq->imr_multiaddr.s_addr))) {
- error = EINVAL;
- break;
- }
-
- s = splimp();
- /*
- * If an interface address was specified, get a pointer
- * to its ifnet structure.
- */
- if (mreq->imr_interface.s_addr == INADDR_ANY)
- ifp = NULL;
- else {
- INADDR_TO_IFP(mreq->imr_interface, ifp);
- if (ifp == NULL) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- }
- /*
- * Find the membership in the membership array.
- */
- for (i = 0; i < imo->imo_num_memberships; ++i) {
- if ((ifp == NULL ||
- imo->imo_membership[i]->inm_ifp == ifp) &&
- imo->imo_membership[i]->inm_addr.s_addr ==
- mreq->imr_multiaddr.s_addr)
- break;
- }
- if (i == imo->imo_num_memberships) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- /*
- * Give up the multicast address record to which the
- * membership points.
- */
- in_delmulti(imo->imo_membership[i]);
- /*
- * Remove the gap in the membership array.
- */
- for (++i; i < imo->imo_num_memberships; ++i)
- imo->imo_membership[i-1] = imo->imo_membership[i];
- --imo->imo_num_memberships;
- splx(s);
- break;
-
- default:
- error = EOPNOTSUPP;
- break;
- }
-
- /*
- * If all options have default values, no need to keep the mbuf.
- */
- if (imo->imo_multicast_ifp == NULL &&
- imo->imo_multicast_vif == -1 &&
- imo->imo_multicast_ttl == IP_DEFAULT_MULTICAST_TTL &&
- imo->imo_multicast_loop == IP_DEFAULT_MULTICAST_LOOP &&
- imo->imo_num_memberships == 0) {
- free(*imop, M_IPMOPTS);
- *imop = NULL;
- }
-
- return (error);
-}
-
-/*
- * Return the IP multicast options in response to user getsockopt().
- */
-static int
-ip_getmoptions(optname, imo, mp)
- int optname;
- register struct ip_moptions *imo;
- register struct mbuf **mp;
-{
- u_char *ttl;
- u_char *loop;
- struct in_addr *addr;
- struct in_ifaddr *ia;
-
- *mp = m_get(M_WAIT, MT_SOOPTS);
-
- switch (optname) {
-
- case IP_MULTICAST_VIF:
- if (imo != NULL)
- *(mtod(*mp, int *)) = imo->imo_multicast_vif;
- else
- *(mtod(*mp, int *)) = -1;
- (*mp)->m_len = sizeof(int);
- return(0);
-
- case IP_MULTICAST_IF:
- addr = mtod(*mp, struct in_addr *);
- (*mp)->m_len = sizeof(struct in_addr);
- if (imo == NULL || imo->imo_multicast_ifp == NULL)
- addr->s_addr = INADDR_ANY;
- else {
- IFP_TO_IA(imo->imo_multicast_ifp, ia);
- addr->s_addr = (ia == NULL) ? INADDR_ANY
- : IA_SIN(ia)->sin_addr.s_addr;
- }
- return (0);
-
- case IP_MULTICAST_TTL:
- ttl = mtod(*mp, u_char *);
- (*mp)->m_len = 1;
- *ttl = (imo == NULL) ? IP_DEFAULT_MULTICAST_TTL
- : imo->imo_multicast_ttl;
- return (0);
-
- case IP_MULTICAST_LOOP:
- loop = mtod(*mp, u_char *);
- (*mp)->m_len = 1;
- *loop = (imo == NULL) ? IP_DEFAULT_MULTICAST_LOOP
- : imo->imo_multicast_loop;
- return (0);
-
- default:
- return (EOPNOTSUPP);
- }
-}
-
-/*
- * Discard the IP multicast options.
- */
-void
-ip_freemoptions(imo)
- register struct ip_moptions *imo;
-{
- register int i;
-
- if (imo != NULL) {
- for (i = 0; i < imo->imo_num_memberships; ++i)
- in_delmulti(imo->imo_membership[i]);
- free(imo, M_IPMOPTS);
- }
-}
-
-/*
- * Routine called from ip_output() to loop back a copy of an IP multicast
- * packet to the input queue of a specified interface. Note that this
- * calls the output routine of the loopback "driver", but with an interface
- * pointer that might NOT be a loopback interface -- evil, but easier than
- * replicating that code here.
- */
-static void
-ip_mloopback(ifp, m, dst, hlen)
- struct ifnet *ifp;
- register struct mbuf *m;
- register struct sockaddr_in *dst;
- int hlen;
-{
- register struct ip *ip;
- struct mbuf *copym;
-
- copym = m_copy(m, 0, M_COPYALL);
- if (copym != NULL && (copym->m_flags & M_EXT || copym->m_len < hlen))
- copym = m_pullup(copym, hlen);
- if (copym != NULL) {
- /*
- * We don't bother to fragment if the IP length is greater
- * than the interface's MTU. Can this possibly matter?
- */
- ip = mtod(copym, struct ip *);
- ip->ip_len = htons((u_short)ip->ip_len);
- ip->ip_off = htons((u_short)ip->ip_off);
- ip->ip_sum = 0;
- if (ip->ip_vhl == IP_VHL_BORING) {
- ip->ip_sum = in_cksum_hdr(ip);
- } else {
- ip->ip_sum = in_cksum(copym, hlen);
- }
- /*
- * NB:
- * It's not clear whether there are any lingering
- * reentrancy problems in other areas which might
- * be exposed by using ip_input directly (in
- * particular, everything which modifies the packet
- * in-place). Yet another option is using the
- * protosw directly to deliver the looped back
- * packet. For the moment, we'll err on the side
- * of safety by continuing to abuse looutput().
- */
-#ifdef notdef
- copym->m_pkthdr.rcvif = ifp;
- ip_input(copym)
-#else
- (void) looutput(ifp, copym, (struct sockaddr *)dst, NULL);
-#endif
- }
-}
diff --git a/c/src/libnetworking/netinet/ip_var.h b/c/src/libnetworking/netinet/ip_var.h
deleted file mode 100644
index cc7908e9a3..0000000000
--- a/c/src/libnetworking/netinet/ip_var.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)ip_var.h 8.2 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _NETINET_IP_VAR_H_
-#define _NETINET_IP_VAR_H_
-
-/*
- * Overlay for ip header used by other protocols (tcp, udp).
- */
-struct ipovly {
- caddr_t ih_next, ih_prev; /* for protocol sequence q's */
- u_char ih_x1; /* (unused) */
- u_char ih_pr; /* protocol */
- u_short ih_len; /* protocol length */
- struct in_addr ih_src; /* source internet address */
- struct in_addr ih_dst; /* destination internet address */
-};
-
-/*
- * Ip reassembly queue structure. Each fragment
- * being reassembled is attached to one of these structures.
- * They are timed out after ipq_ttl drops to 0, and may also
- * be reclaimed if memory becomes tight.
- */
-struct ipq {
- struct ipq *next,*prev; /* to other reass headers */
- u_char ipq_ttl; /* time for reass q to live */
- u_char ipq_p; /* protocol of this fragment */
- u_short ipq_id; /* sequence id for reassembly */
- struct ipasfrag *ipq_next,*ipq_prev;
- /* to ip headers of fragments */
- struct in_addr ipq_src,ipq_dst;
-#ifdef IPDIVERT
- u_short ipq_divert; /* divert protocol port */
-#endif
-};
-
-/*
- * Ip header, when holding a fragment.
- *
- * Note: ipf_next must be at same offset as ipq_next above
- */
-struct ipasfrag {
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char ip_hl:4,
- ip_v:4;
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char ip_v:4,
- ip_hl:4;
-#endif
- u_char ipf_mff; /* XXX overlays ip_tos: use low bit
- * to avoid destroying tos;
- * copied from (ip_off&IP_MF) */
- u_short ip_len;
- u_short ip_id;
- u_short ip_off;
- u_char ip_ttl;
- u_char ip_p;
- u_short ip_sum;
- struct ipasfrag *ipf_next; /* next fragment */
- struct ipasfrag *ipf_prev; /* previous fragment */
-};
-
-/*
- * Structure stored in mbuf in inpcb.ip_options
- * and passed to ip_output when ip options are in use.
- * The actual length of the options (including ipopt_dst)
- * is in m_len.
- */
-#define MAX_IPOPTLEN 40
-
-struct ipoption {
- struct in_addr ipopt_dst; /* first-hop dst if source routed */
- char ipopt_list[MAX_IPOPTLEN]; /* options proper */
-};
-
-/*
- * Structure attached to inpcb.ip_moptions and
- * passed to ip_output when IP multicast options are in use.
- */
-struct ip_moptions {
- struct ifnet *imo_multicast_ifp; /* ifp for outgoing multicasts */
- u_char imo_multicast_ttl; /* TTL for outgoing multicasts */
- u_char imo_multicast_loop; /* 1 => hear sends if a member */
- u_short imo_num_memberships; /* no. memberships this socket */
- struct in_multi *imo_membership[IP_MAX_MEMBERSHIPS];
- u_long imo_multicast_vif; /* vif num outgoing multicasts */
-};
-
-struct ipstat {
- u_long ips_total; /* total packets received */
- u_long ips_badsum; /* checksum bad */
- u_long ips_tooshort; /* packet too short */
- u_long ips_toosmall; /* not enough data */
- u_long ips_badhlen; /* ip header length < data size */
- u_long ips_badlen; /* ip length < ip header length */
- u_long ips_fragments; /* fragments received */
- u_long ips_fragdropped; /* frags dropped (dups, out of space) */
- u_long ips_fragtimeout; /* fragments timed out */
- u_long ips_forward; /* packets forwarded */
- u_long ips_cantforward; /* packets rcvd for unreachable dest */
- u_long ips_redirectsent; /* packets forwarded on same net */
- u_long ips_noproto; /* unknown or unsupported protocol */
- u_long ips_delivered; /* datagrams delivered to upper level*/
- u_long ips_localout; /* total ip packets generated here */
- u_long ips_odropped; /* lost packets due to nobufs, etc. */
- u_long ips_reassembled; /* total packets reassembled ok */
- u_long ips_fragmented; /* datagrams successfully fragmented */
- u_long ips_ofragments; /* output fragments created */
- u_long ips_cantfrag; /* don't fragment flag was set, etc. */
- u_long ips_badoptions; /* error in option processing */
- u_long ips_noroute; /* packets discarded due to no route */
- u_long ips_badvers; /* ip version != 4 */
- u_long ips_rawout; /* total raw ip packets generated */
- u_long ips_toolong; /* ip length > max ip packet size */
-};
-
-#ifdef KERNEL
-/* flags passed to ip_output as last parameter */
-#define IP_FORWARDING 0x1 /* most of ip header exists */
-#define IP_RAWOUTPUT 0x2 /* raw ip header exists */
-#define IP_ROUTETOIF SO_DONTROUTE /* bypass routing tables */
-#define IP_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets */
-
-struct inpcb;
-struct route;
-
-extern struct ipstat ipstat;
-extern u_short ip_id; /* ip packet ctr, for ids */
-extern int ip_defttl; /* default IP ttl */
-extern u_char ip_protox[];
-extern struct socket *ip_rsvpd; /* reservation protocol daemon */
-extern struct socket *ip_mrouter; /* multicast routing daemon */
-extern int (*legal_vif_num) __P((int));
-extern u_long (*ip_mcast_src) __P((int));
-extern int rsvp_on;
-
-int ip_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
-void ip_drain __P((void));
-void ip_freemoptions __P((struct ip_moptions *));
-void ip_init __P((void));
-extern int (*ip_mforward) __P((struct ip *, struct ifnet *, struct mbuf *,
- struct ip_moptions *));
-int ip_output __P((struct mbuf *,
- struct mbuf *, struct route *, int, struct ip_moptions *));
-void ip_savecontrol __P((struct inpcb *, struct mbuf **, struct ip *,
- struct mbuf *));
-void ip_slowtimo __P((void));
-struct mbuf *
- ip_srcroute __P((void));
-void ip_stripoptions __P((struct mbuf *, struct mbuf *));
-int rip_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
-void rip_init __P((void));
-void rip_input __P((struct mbuf *, int));
-int rip_output __P((struct mbuf *, struct socket *, u_long));
-int rip_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-void ipip_input __P((struct mbuf *, int));
-void rsvp_input __P((struct mbuf *, int));
-int ip_rsvp_init __P((struct socket *));
-int ip_rsvp_done __P((void));
-int ip_rsvp_vif_init __P((struct socket *, struct mbuf *));
-int ip_rsvp_vif_done __P((struct socket *, struct mbuf *));
-void ip_rsvp_force_done __P((struct socket *));
-
-#ifdef IPDIVERT
-void div_init __P((void));
-void div_input __P((struct mbuf *, int));
-int div_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-extern u_short ip_divert_port;
-extern u_short ip_divert_ignore;
-#endif /* IPDIVERT */
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_IP_VAR_H_ */
diff --git a/c/src/libnetworking/netinet/raw_ip.c b/c/src/libnetworking/netinet/raw_ip.c
deleted file mode 100644
index 44d58f1844..0000000000
--- a/c/src/libnetworking/netinet/raw_ip.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/systm.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#define _IP_VHL
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_mroute.h>
-
-#include <netinet/ip_fw.h>
-
-#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1
-#undef COMPAT_IPFW
-#define COMPAT_IPFW 1
-#else
-#undef COMPAT_IPFW
-#endif
-
-static struct inpcbhead ripcb;
-static struct inpcbinfo ripcbinfo;
-
-/*
- * Nominal space allocated to a raw ip socket.
- */
-#define RIPSNDQ 8192
-#define RIPRCVQ 8192
-
-/*
- * Raw interface to IP protocol.
- */
-
-/*
- * Initialize raw connection block q.
- */
-void
-rip_init()
-{
- LIST_INIT(&ripcb);
- ripcbinfo.listhead = &ripcb;
- /*
- * XXX We don't use the hash list for raw IP, but it's easier
- * to allocate a one entry hash list than it is to check all
- * over the place for hashbase == NULL.
- */
- ripcbinfo.hashbase = hashinit(1, M_PCB, &ripcbinfo.hashmask);
-}
-
-static struct sockaddr_in ripsrc = { sizeof(ripsrc), AF_INET };
-/*
- * Setup generic address and protocol structures
- * for raw_input routine, then pass them along with
- * mbuf chain.
- */
-void
-rip_input(m, iphlen)
- struct mbuf *m;
- int iphlen;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register struct inpcb *inp;
- struct inpcb *last = 0;
- struct mbuf *opts = 0;
-
- ripsrc.sin_addr = ip->ip_src;
- for (inp = ripcb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_ip_p && inp->inp_ip_p != ip->ip_p)
- continue;
- if (inp->inp_laddr.s_addr &&
- inp->inp_laddr.s_addr != ip->ip_dst.s_addr)
- continue;
- if (inp->inp_faddr.s_addr &&
- inp->inp_faddr.s_addr != ip->ip_src.s_addr)
- continue;
- if (last) {
- struct mbuf *n = m_copy(m, 0, (int)M_COPYALL);
- if (n) {
- if (last->inp_flags & INP_CONTROLOPTS ||
- last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, n);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&ripsrc, n,
- opts) == 0) {
- /* should notify about lost packet */
- m_freem(n);
- if (opts)
- m_freem(opts);
- } else
- sorwakeup(last->inp_socket);
- opts = 0;
- }
- }
- last = inp;
- }
- if (last) {
- if (last->inp_flags & INP_CONTROLOPTS ||
- last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, m);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&ripsrc, m, opts) == 0) {
- m_freem(m);
- if (opts)
- m_freem(opts);
- } else
- sorwakeup(last->inp_socket);
- } else {
- m_freem(m);
- ipstat.ips_noproto++;
- ipstat.ips_delivered--;
- }
-}
-
-/*
- * Generate IP header and pass packet to ip_output.
- * Tack on options user may have setup with control call.
- */
-int
-rip_output(m, so, dst)
- register struct mbuf *m;
- struct socket *so;
- u_long dst;
-{
- register struct ip *ip;
- register struct inpcb *inp = sotoinpcb(so);
- int flags = (so->so_options & SO_DONTROUTE) | IP_ALLOWBROADCAST;
-
- /*
- * If the user handed us a complete IP packet, use it.
- * Otherwise, allocate an mbuf for a header and fill it in.
- */
- if ((inp->inp_flags & INP_HDRINCL) == 0) {
- if (m->m_pkthdr.len + sizeof(struct ip) > IP_MAXPACKET) {
- m_freem(m);
- return(EMSGSIZE);
- }
- M_PREPEND(m, sizeof(struct ip), M_WAIT);
- ip = mtod(m, struct ip *);
- ip->ip_tos = 0;
- ip->ip_off = 0;
- ip->ip_p = inp->inp_ip_p;
- ip->ip_len = m->m_pkthdr.len;
- ip->ip_src = inp->inp_laddr;
- ip->ip_dst.s_addr = dst;
- ip->ip_ttl = MAXTTL;
- } else {
- if (m->m_pkthdr.len > IP_MAXPACKET) {
- m_freem(m);
- return(EMSGSIZE);
- }
- ip = mtod(m, struct ip *);
- /* don't allow both user specified and setsockopt options,
- and don't allow packet length sizes that will crash */
- if (((IP_VHL_HL(ip->ip_vhl) != (sizeof (*ip) >> 2))
- && inp->inp_options)
- || (ip->ip_len > m->m_pkthdr.len)
- || (ip->ip_len < (IP_VHL_HL(ip->ip_vhl) << 2))) {
- m_freem(m);
- return EINVAL;
- }
- if (ip->ip_id == 0)
- ip->ip_id = htons(ip_id++);
- /* XXX prevent ip_output from overwriting header fields */
- flags |= IP_RAWOUTPUT;
- ipstat.ips_rawout++;
- }
- return (ip_output(m, inp->inp_options, &inp->inp_route, flags,
- inp->inp_moptions));
-}
-
-/*
- * Raw IP socket option processing.
- */
-int
-rip_ctloutput(op, so, level, optname, m)
- int op;
- struct socket *so;
- int level, optname;
- struct mbuf **m;
-{
- register struct inpcb *inp = sotoinpcb(so);
- register int error;
-
- if (level != IPPROTO_IP) {
- if (op == PRCO_SETOPT && *m)
- (void)m_free(*m);
- return (EINVAL);
- }
-
- switch (optname) {
-
- case IP_HDRINCL:
- error = 0;
- if (op == PRCO_SETOPT) {
- if (m == 0 || *m == 0 || (*m)->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(*m, int *))
- inp->inp_flags |= INP_HDRINCL;
- else
- inp->inp_flags &= ~INP_HDRINCL;
- if (*m)
- (void)m_free(*m);
- } else {
- *m = m_get(M_WAIT, MT_SOOPTS);
- (*m)->m_len = sizeof (int);
- *mtod(*m, int *) = inp->inp_flags & INP_HDRINCL;
- }
- return (error);
-
-#ifdef COMPAT_IPFW
- case IP_FW_GET:
- if (ip_fw_ctl_ptr == NULL || op == PRCO_SETOPT) {
- if (*m) (void)m_free(*m);
- return(EINVAL);
- }
- return (*ip_fw_ctl_ptr)(optname, m);
-
- case IP_FW_ADD:
- case IP_FW_DEL:
- case IP_FW_FLUSH:
- case IP_FW_ZERO:
- if (ip_fw_ctl_ptr == NULL || op != PRCO_SETOPT) {
- if (*m) (void)m_free(*m);
- return(EINVAL);
- }
- return (*ip_fw_ctl_ptr)(optname, m);
-
- case IP_NAT:
- if (ip_nat_ctl_ptr == NULL) {
- if (*m) (void)m_free(*m);
- return(EINVAL);
- }
- return (*ip_nat_ctl_ptr)(op, m);
-
-#endif
- case IP_RSVP_ON:
- return ip_rsvp_init(so);
- break;
-
- case IP_RSVP_OFF:
- return ip_rsvp_done();
- break;
-
- case IP_RSVP_VIF_ON:
- return ip_rsvp_vif_init(so, *m);
-
- case IP_RSVP_VIF_OFF:
- return ip_rsvp_vif_done(so, *m);
-
- case MRT_INIT:
- case MRT_DONE:
- case MRT_ADD_VIF:
- case MRT_DEL_VIF:
- case MRT_ADD_MFC:
- case MRT_DEL_MFC:
- case MRT_VERSION:
- case MRT_ASSERT:
- if (op == PRCO_SETOPT) {
- error = ip_mrouter_set(optname, so, *m);
- if (*m)
- (void)m_free(*m);
- } else if (op == PRCO_GETOPT) {
- error = ip_mrouter_get(optname, so, m);
- } else
- error = EINVAL;
- return (error);
- }
- return (ip_ctloutput(op, so, level, optname, m));
-}
-
-static u_long rip_sendspace = RIPSNDQ; /* XXX sysctl ? */
-static u_long rip_recvspace = RIPRCVQ; /* XXX sysctl ? */
-
-/*ARGSUSED*/
-int
-rip_usrreq(so, req, m, nam, control)
- register struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register int error = 0;
- register struct inpcb *inp = sotoinpcb(so);
- int s;
-
- if (req == PRU_CONTROL)
- return (in_control(so, (u_long)m, (caddr_t)nam,
- (struct ifnet *)control));
-
- switch (req) {
-
- case PRU_ATTACH:
- if (inp)
- panic("rip_attach");
- if ((so->so_state & SS_PRIV) == 0) {
- error = EACCES;
- break;
- }
- s = splnet();
- error = in_pcballoc(so, &ripcbinfo);
- splx(s);
- if (error)
- break;
- error = soreserve(so, rip_sendspace, rip_recvspace);
- if (error)
- break;
- inp = (struct inpcb *)so->so_pcb;
- inp->inp_ip_p = (int)nam;
- break;
-
- case PRU_DISCONNECT:
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- error = ENOTCONN;
- break;
- }
- /* FALLTHROUGH */
- case PRU_ABORT:
- soisdisconnected(so);
- /* FALLTHROUGH */
- case PRU_DETACH:
- if (inp == 0)
- panic("rip_detach");
- if (so == ip_mrouter)
- ip_mrouter_done();
- ip_rsvp_force_done(so);
- if (so == ip_rsvpd)
- ip_rsvp_done();
- in_pcbdetach(inp);
- break;
-
- case PRU_BIND:
- {
- struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *);
-
- if (nam->m_len != sizeof(*addr)) {
- error = EINVAL;
- break;
- }
- if ((ifnet == 0) ||
- ((addr->sin_family != AF_INET) &&
- (addr->sin_family != AF_IMPLINK)) ||
- (addr->sin_addr.s_addr &&
- ifa_ifwithaddr((struct sockaddr *)addr) == 0)) {
- error = EADDRNOTAVAIL;
- break;
- }
- inp->inp_laddr = addr->sin_addr;
- break;
- }
- case PRU_CONNECT:
- {
- struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *);
-
- if (nam->m_len != sizeof(*addr)) {
- error = EINVAL;
- break;
- }
- if (ifnet == 0) {
- error = EADDRNOTAVAIL;
- break;
- }
- if ((addr->sin_family != AF_INET) &&
- (addr->sin_family != AF_IMPLINK)) {
- error = EAFNOSUPPORT;
- break;
- }
- inp->inp_faddr = addr->sin_addr;
- soisconnected(so);
- break;
- }
-
- case PRU_CONNECT2:
- error = EOPNOTSUPP;
- break;
-
- /*
- * Mark the connection as being incapable of further input.
- */
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- /*
- * Ship a packet out. The appropriate raw output
- * routine handles any massaging necessary.
- */
- case PRU_SEND:
- {
- register u_long dst;
-
- if (so->so_state & SS_ISCONNECTED) {
- if (nam) {
- error = EISCONN;
- break;
- }
- dst = inp->inp_faddr.s_addr;
- } else {
- if (nam == NULL) {
- error = ENOTCONN;
- break;
- }
- dst = mtod(nam, struct sockaddr_in *)->sin_addr.s_addr;
- }
- error = rip_output(m, so, dst);
- m = NULL;
- break;
- }
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- /*
- * Not supported.
- */
- case PRU_RCVOOB:
- case PRU_RCVD:
- case PRU_LISTEN:
- case PRU_ACCEPT:
- case PRU_SENDOOB:
- error = EOPNOTSUPP;
- break;
-
- case PRU_SOCKADDR:
- in_setsockaddr(inp, nam);
- break;
-
- case PRU_PEERADDR:
- in_setpeeraddr(inp, nam);
- break;
-
- default:
- panic("rip_usrreq");
- }
- if (m != NULL)
- m_freem(m);
- return (error);
-}
diff --git a/c/src/libnetworking/netinet/tcp.h b/c/src/libnetworking/netinet/tcp.h
deleted file mode 100644
index 3585917aa3..0000000000
--- a/c/src/libnetworking/netinet/tcp.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_H_
-#define _NETINET_TCP_H_
-
-typedef u_long tcp_seq;
-typedef u_long tcp_cc; /* connection count per rfc1644 */
-
-/*
- * TCP header.
- * Per RFC 793, September, 1981.
- */
-struct tcphdr {
- u_short th_sport; /* source port */
- u_short th_dport; /* destination port */
- tcp_seq th_seq; /* sequence number */
- tcp_seq th_ack; /* acknowledgement number */
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char th_x2:4, /* (unused) */
- th_off:4; /* data offset */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char th_off:4, /* data offset */
- th_x2:4; /* (unused) */
-#endif
- u_char th_flags;
-#define TH_FIN 0x01
-#define TH_SYN 0x02
-#define TH_RST 0x04
-#define TH_PUSH 0x08
-#define TH_ACK 0x10
-#define TH_URG 0x20
-#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG)
-
- u_short th_win; /* window */
- u_short th_sum; /* checksum */
- u_short th_urp; /* urgent pointer */
-};
-
-#define TCPOPT_EOL 0
-#define TCPOPT_NOP 1
-#define TCPOPT_MAXSEG 2
-#define TCPOLEN_MAXSEG 4
-#define TCPOPT_WINDOW 3
-#define TCPOLEN_WINDOW 3
-#define TCPOPT_SACK_PERMITTED 4 /* Experimental */
-#define TCPOLEN_SACK_PERMITTED 2
-#define TCPOPT_SACK 5 /* Experimental */
-#define TCPOPT_TIMESTAMP 8
-#define TCPOLEN_TIMESTAMP 10
-#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
-#define TCPOPT_TSTAMP_HDR \
- (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
-
-#define TCPOPT_CC 11 /* CC options: RFC-1644 */
-#define TCPOPT_CCNEW 12
-#define TCPOPT_CCECHO 13
-#define TCPOLEN_CC 6
-#define TCPOLEN_CC_APPA (TCPOLEN_CC+2)
-#define TCPOPT_CC_HDR(ccopt) \
- (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC)
-
-/*
- * Default maximum segment size for TCP.
- * With an IP MSS of 576, this is 536,
- * but 512 is probably more convenient.
- * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
- */
-#define TCP_MSS 512
-
-#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
-#define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */
-
-#define TCP_MAX_WINSHIFT 14 /* maximum window shift */
-
-#define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */
-#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr))
- /* max space left for options */
-
-/*
- * User-settable options (used with setsockopt).
- */
-#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
-#define TCP_MAXSEG 0x02 /* set maximum segment size */
-#define TCP_NOPUSH 0x04 /* don't push last block of write */
-#define TCP_NOOPT 0x08 /* don't use TCP options */
-
-#endif
diff --git a/c/src/libnetworking/netinet/tcp_debug.c b/c/src/libnetworking/netinet/tcp_debug.c
deleted file mode 100644
index 864a01cb1a..0000000000
--- a/c/src/libnetworking/netinet/tcp_debug.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_debug.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#ifdef TCPDEBUG
-/* load symbolic names */
-#define PRUREQUESTS
-#define TCPSTATES
-#define TCPTIMERS
-#define TANAMES
-#endif
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <net/route.h>
-#include <net/if.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#include <netinet/tcp_debug.h>
-
-#ifdef TCPDEBUG
-static int tcpconsdebug = 0;
-#endif
-
-static struct tcp_debug tcp_debug[TCP_NDEBUG];
-static int tcp_debx;
-
-/*
- * Tcp debug routines
- */
-void
-tcp_trace(act, ostate, tp, ti, req)
- short act, ostate;
- struct tcpcb *tp;
- struct tcpiphdr *ti;
- int req;
-{
-#ifdef TCPDEBUG
- tcp_seq seq, ack;
- int len, flags;
-#endif
- struct tcp_debug *td = &tcp_debug[tcp_debx++];
-
- if (tcp_debx == TCP_NDEBUG)
- tcp_debx = 0;
- td->td_time = iptime();
- td->td_act = act;
- td->td_ostate = ostate;
- td->td_tcb = (caddr_t)tp;
- if (tp)
- td->td_cb = *tp;
- else
- bzero((caddr_t)&td->td_cb, sizeof (*tp));
- if (ti)
- td->td_ti = *ti;
- else
- bzero((caddr_t)&td->td_ti, sizeof (*ti));
- td->td_req = req;
-#ifdef TCPDEBUG
- if (tcpconsdebug == 0)
- return;
- if (tp)
- printf("%p %s:", tp, tcpstates[ostate]);
- else
- printf("???????? ");
- printf("%s ", tanames[act]);
- switch (act) {
-
- case TA_INPUT:
- case TA_OUTPUT:
- case TA_DROP:
- if (ti == 0)
- break;
- seq = ti->ti_seq;
- ack = ti->ti_ack;
- len = ti->ti_len;
- if (act == TA_OUTPUT) {
- seq = ntohl(seq);
- ack = ntohl(ack);
- len = ntohs((u_short)len);
- }
- if (act == TA_OUTPUT)
- len -= sizeof (struct tcphdr);
- if (len)
- printf("[%x..%x)", seq, seq+len);
- else
- printf("%x", seq);
- printf("@%x, urp=%x", ack, ti->ti_urp);
- flags = ti->ti_flags;
- if (flags) {
- char *cp = "<";
-#define pf(f) { \
- if (ti->ti_flags & TH_##f) { \
- printf("%s%s", cp, #f); \
- cp = ","; \
- } \
-}
- pf(SYN); pf(ACK); pf(FIN); pf(RST); pf(PUSH); pf(URG);
- printf(">");
- }
- break;
-
- case TA_USER:
- printf("%s", prurequests[req&0xff]);
- if ((req & 0xff) == PRU_SLOWTIMO)
- printf("<%s>", tcptimers[req>>8]);
- break;
- }
- if (tp)
- printf(" -> %s", tcpstates[tp->t_state]);
- /* print out internal state of tp !?! */
- printf("\n");
- if (tp == 0)
- return;
- printf("\trcv_(nxt,wnd,up) (%x,%x,%x) snd_(una,nxt,max) (%x,%x,%x)\n",
- tp->rcv_nxt, tp->rcv_wnd, tp->rcv_up, tp->snd_una, tp->snd_nxt,
- tp->snd_max);
- printf("\tsnd_(wl1,wl2,wnd) (%x,%x,%x)\n",
- tp->snd_wl1, tp->snd_wl2, tp->snd_wnd);
-#endif /* TCPDEBUG */
-}
diff --git a/c/src/libnetworking/netinet/tcp_debug.h b/c/src/libnetworking/netinet/tcp_debug.h
deleted file mode 100644
index a33743b077..0000000000
--- a/c/src/libnetworking/netinet/tcp_debug.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_debug.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_DEBUG_H_
-#define _NETINET_TCP_DEBUG_H_
-
-struct tcp_debug {
- n_time td_time;
- short td_act;
- short td_ostate;
- caddr_t td_tcb;
- struct tcpiphdr td_ti;
- short td_req;
- struct tcpcb td_cb;
-};
-
-#define TA_INPUT 0
-#define TA_OUTPUT 1
-#define TA_USER 2
-#define TA_RESPOND 3
-#define TA_DROP 4
-
-#ifdef TANAMES
-static char *tanames[] =
- { "input", "output", "user", "respond", "drop" };
-#endif
-
-#define TCP_NDEBUG 100
-
-#ifndef KERNEL
-/* XXX common variables for broken applications. */
-struct tcp_debug tcp_debug[TCP_NDEBUG];
-int tcp_debx;
-#endif
-
-#endif /* !_NETINET_TCP_DEBUG_H_ */
diff --git a/c/src/libnetworking/netinet/tcp_fsm.h b/c/src/libnetworking/netinet/tcp_fsm.h
deleted file mode 100644
index 3f2c12f54f..0000000000
--- a/c/src/libnetworking/netinet/tcp_fsm.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_fsm.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_FSM_H_
-#define _NETINET_TCP_FSM_H_
-
-/*
- * TCP FSM state definitions.
- * Per RFC793, September, 1981.
- */
-
-#define TCP_NSTATES 11
-
-#define TCPS_CLOSED 0 /* closed */
-#define TCPS_LISTEN 1 /* listening for connection */
-#define TCPS_SYN_SENT 2 /* active, have sent syn */
-#define TCPS_SYN_RECEIVED 3 /* have send and received syn */
-/* states < TCPS_ESTABLISHED are those where connections not established */
-#define TCPS_ESTABLISHED 4 /* established */
-#define TCPS_CLOSE_WAIT 5 /* rcvd fin, waiting for close */
-/* states > TCPS_CLOSE_WAIT are those where user has closed */
-#define TCPS_FIN_WAIT_1 6 /* have closed, sent fin */
-#define TCPS_CLOSING 7 /* closed xchd FIN; await FIN ACK */
-#define TCPS_LAST_ACK 8 /* had fin and close; await FIN ACK */
-/* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */
-#define TCPS_FIN_WAIT_2 9 /* have closed, fin is acked */
-#define TCPS_TIME_WAIT 10 /* in 2*msl quiet wait after close */
-
-#define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED)
-#define TCPS_HAVEESTABLISHED(s) ((s) >= TCPS_ESTABLISHED)
-#define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT)
-
-#ifdef TCPOUTFLAGS
-/*
- * Flags used when sending segments in tcp_output.
- * Basic flags (TH_RST,TH_ACK,TH_SYN,TH_FIN) are totally
- * determined by state, with the proviso that TH_FIN is sent only
- * if all data queued for output is included in the segment.
- */
-static u_char tcp_outflags[TCP_NSTATES] = {
- TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK,
- TH_ACK, TH_ACK,
- TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK,
-};
-#endif
-
-#ifdef KPROF
-int tcp_acounts[TCP_NSTATES][PRU_NREQ];
-#endif
-
-#ifdef TCPSTATES
-char *tcpstates[] = {
- "CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD",
- "ESTABLISHED", "CLOSE_WAIT", "FIN_WAIT_1", "CLOSING",
- "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT",
-};
-#endif
-
-#endif
diff --git a/c/src/libnetworking/netinet/tcp_input.c b/c/src/libnetworking/netinet/tcp_input.c
deleted file mode 100644
index bc55a79ae2..0000000000
--- a/c/src/libnetworking/netinet/tcp_input.c
+++ /dev/null
@@ -1,2149 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995
- * 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.
- *
- * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#ifndef TUBA_INCLUDE
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-
-#include <machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-static struct tcpiphdr tcp_saveti;
-#endif
-
-static int tcprexmtthresh = 3;
-tcp_seq tcp_iss;
-tcp_cc tcp_ccgen;
-
-struct tcpstat tcpstat;
-SYSCTL_STRUCT(_net_inet_tcp, TCPCTL_STATS, stats,
- CTLFLAG_RD, &tcpstat , tcpstat, "");
-
-static int log_in_vain = 0;
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_in_vain, CTLFLAG_RW,
- &log_in_vain, 0, "");
-
-u_long tcp_now;
-struct inpcbhead tcb;
-struct inpcbinfo tcbinfo;
-
-static void tcp_dooptions __P((struct tcpcb *,
- u_char *, int, struct tcpiphdr *, struct tcpopt *));
-static void tcp_pulloutofband __P((struct socket *,
- struct tcpiphdr *, struct mbuf *));
-static int tcp_reass __P((struct tcpcb *, struct tcpiphdr *, struct mbuf *));
-static void tcp_xmit_timer __P((struct tcpcb *, int));
-
-#endif /* TUBA_INCLUDE */
-
-/*
- * Insert segment ti into reassembly queue of tcp with
- * control block tp. Return TH_FIN if reassembly now includes
- * a segment with FIN. The macro form does the common case inline
- * (segment is the next to be received on an established connection,
- * and the queue is empty), avoiding linkage into and removal
- * from the queue and repetition of various conversions.
- * Set DELACK for segments received in order, but ack immediately
- * when segments are out of order (so fast retransmit can work).
- */
-#ifdef TCP_ACK_HACK
-#define TCP_REASS(tp, ti, m, so, flags) { \
- if ((ti)->ti_seq == (tp)->rcv_nxt && \
- (tp)->seg_next == (struct tcpiphdr *)(tp) && \
- (tp)->t_state == TCPS_ESTABLISHED) { \
- if (ti->ti_flags & TH_PUSH) \
- tp->t_flags |= TF_ACKNOW; \
- else \
- tp->t_flags |= TF_DELACK; \
- (tp)->rcv_nxt += (ti)->ti_len; \
- flags = (ti)->ti_flags & TH_FIN; \
- tcpstat.tcps_rcvpack++;\
- tcpstat.tcps_rcvbyte += (ti)->ti_len;\
- sbappend(&(so)->so_rcv, (m)); \
- sorwakeup(so); \
- } else { \
- (flags) = tcp_reass((tp), (ti), (m)); \
- tp->t_flags |= TF_ACKNOW; \
- } \
-}
-#else
-#define TCP_REASS(tp, ti, m, so, flags) { \
- if ((ti)->ti_seq == (tp)->rcv_nxt && \
- (tp)->seg_next == (struct tcpiphdr *)(tp) && \
- (tp)->t_state == TCPS_ESTABLISHED) { \
- tp->t_flags |= TF_DELACK; \
- (tp)->rcv_nxt += (ti)->ti_len; \
- flags = (ti)->ti_flags & TH_FIN; \
- tcpstat.tcps_rcvpack++;\
- tcpstat.tcps_rcvbyte += (ti)->ti_len;\
- sbappend(&(so)->so_rcv, (m)); \
- sorwakeup(so); \
- } else { \
- (flags) = tcp_reass((tp), (ti), (m)); \
- tp->t_flags |= TF_ACKNOW; \
- } \
-}
-#endif
-#ifndef TUBA_INCLUDE
-
-static int
-tcp_reass(tp, ti, m)
- register struct tcpcb *tp;
- register struct tcpiphdr *ti;
- struct mbuf *m;
-{
- register struct tcpiphdr *q;
- struct socket *so = tp->t_inpcb->inp_socket;
- int flags;
-
- /*
- * Call with ti==0 after become established to
- * force pre-ESTABLISHED data up to user socket.
- */
- if (ti == 0)
- goto present;
-
- /*
- * Find a segment which begins after this one does.
- */
- for (q = tp->seg_next; q != (struct tcpiphdr *)tp;
- q = (struct tcpiphdr *)q->ti_next)
- if (SEQ_GT(q->ti_seq, ti->ti_seq))
- break;
-
- /*
- * If there is a preceding segment, it may provide some of
- * our data already. If so, drop the data from the incoming
- * segment. If it provides all of our data, drop us.
- */
- if ((struct tcpiphdr *)q->ti_prev != (struct tcpiphdr *)tp) {
- register int i;
- q = (struct tcpiphdr *)q->ti_prev;
- /* conversion to int (in i) handles seq wraparound */
- i = q->ti_seq + q->ti_len - ti->ti_seq;
- if (i > 0) {
- if (i >= ti->ti_len) {
- tcpstat.tcps_rcvduppack++;
- tcpstat.tcps_rcvdupbyte += ti->ti_len;
- m_freem(m);
- /*
- * Try to present any queued data
- * at the left window edge to the user.
- * This is needed after the 3-WHS
- * completes.
- */
- goto present; /* ??? */
- }
- m_adj(m, i);
- ti->ti_len -= i;
- ti->ti_seq += i;
- }
- q = (struct tcpiphdr *)(q->ti_next);
- }
- tcpstat.tcps_rcvoopack++;
- tcpstat.tcps_rcvoobyte += ti->ti_len;
- REASS_MBUF(ti) = m; /* XXX */
-
- /*
- * While we overlap succeeding segments trim them or,
- * if they are completely covered, dequeue them.
- */
- while (q != (struct tcpiphdr *)tp) {
- register int i = (ti->ti_seq + ti->ti_len) - q->ti_seq;
- if (i <= 0)
- break;
- if (i < q->ti_len) {
- q->ti_seq += i;
- q->ti_len -= i;
- m_adj(REASS_MBUF(q), i);
- break;
- }
- q = (struct tcpiphdr *)q->ti_next;
- m = REASS_MBUF((struct tcpiphdr *)q->ti_prev);
- remque(q->ti_prev);
- m_freem(m);
- }
-
- /*
- * Stick new segment in its place.
- */
- insque(ti, q->ti_prev);
-
-present:
- /*
- * Present data to user, advancing rcv_nxt through
- * completed sequence space.
- */
- if (!TCPS_HAVEESTABLISHED(tp->t_state))
- return (0);
- ti = tp->seg_next;
- if (ti == (struct tcpiphdr *)tp || ti->ti_seq != tp->rcv_nxt)
- return (0);
- do {
- tp->rcv_nxt += ti->ti_len;
- flags = ti->ti_flags & TH_FIN;
- remque(ti);
- m = REASS_MBUF(ti);
- ti = (struct tcpiphdr *)ti->ti_next;
- if (so->so_state & SS_CANTRCVMORE)
- m_freem(m);
- else
- sbappend(&so->so_rcv, m);
- } while (ti != (struct tcpiphdr *)tp && ti->ti_seq == tp->rcv_nxt);
- sorwakeup(so);
- return (flags);
-}
-
-/*
- * TCP input routine, follows pages 65-76 of the
- * protocol specification dated September, 1981 very closely.
- */
-void
-tcp_input(m, iphlen)
- register struct mbuf *m;
- int iphlen;
-{
- register struct tcpiphdr *ti;
- register struct inpcb *inp;
- u_char *optp = NULL;
- int optlen = 0;
- int len, tlen, off;
- register struct tcpcb *tp = 0;
- register int tiflags;
- struct socket *so = 0;
- int todrop, acked, ourfinisacked, needoutput = 0;
- struct in_addr laddr;
- int dropsocket = 0;
- int iss = 0;
- u_long tiwin;
- struct tcpopt to; /* options in this segment */
- struct rmxp_tao *taop; /* pointer to our TAO cache entry */
- struct rmxp_tao tao_noncached; /* in case there's no cached entry */
-#ifdef TCPDEBUG
- short ostate = 0;
-#endif
-
- bzero((char *)&to, sizeof(to));
-
- tcpstat.tcps_rcvtotal++;
- /*
- * Get IP and TCP header together in first mbuf.
- * Note: IP leaves IP header in first mbuf.
- */
- ti = mtod(m, struct tcpiphdr *);
- if (iphlen > sizeof (struct ip))
- ip_stripoptions(m, (struct mbuf *)0);
- if (m->m_len < sizeof (struct tcpiphdr)) {
- if ((m = m_pullup(m, sizeof (struct tcpiphdr))) == 0) {
- tcpstat.tcps_rcvshort++;
- return;
- }
- ti = mtod(m, struct tcpiphdr *);
- }
-
- /*
- * Checksum extended TCP header and data.
- */
- tlen = ((struct ip *)ti)->ip_len;
- len = sizeof (struct ip) + tlen;
- ti->ti_next = ti->ti_prev = 0;
- ti->ti_x1 = 0;
- ti->ti_len = (u_short)tlen;
- HTONS(ti->ti_len);
- ti->ti_sum = in_cksum(m, len);
- if (ti->ti_sum) {
- tcpstat.tcps_rcvbadsum++;
- goto drop;
- }
-#endif /* TUBA_INCLUDE */
-
- /*
- * Check that TCP offset makes sense,
- * pull out TCP options and adjust length. XXX
- */
- off = ti->ti_off << 2;
- if (off < sizeof (struct tcphdr) || off > tlen) {
- tcpstat.tcps_rcvbadoff++;
- goto drop;
- }
- tlen -= off;
- ti->ti_len = tlen;
- if (off > sizeof (struct tcphdr)) {
- if (m->m_len < sizeof(struct ip) + off) {
- if ((m = m_pullup(m, sizeof (struct ip) + off)) == 0) {
- tcpstat.tcps_rcvshort++;
- return;
- }
- ti = mtod(m, struct tcpiphdr *);
- }
- optlen = off - sizeof (struct tcphdr);
- optp = mtod(m, u_char *) + sizeof (struct tcpiphdr);
- }
- tiflags = ti->ti_flags;
-
- /*
- * Convert TCP protocol specific fields to host format.
- */
- NTOHL(ti->ti_seq);
- NTOHL(ti->ti_ack);
- NTOHS(ti->ti_win);
- NTOHS(ti->ti_urp);
-
- /*
- * Drop TCP, IP headers and TCP options.
- */
- m->m_data += sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
- m->m_len -= sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
-
- /*
- * Locate pcb for segment.
- */
-findpcb:
- inp = in_pcblookuphash(&tcbinfo, ti->ti_src, ti->ti_sport,
- ti->ti_dst, ti->ti_dport, 1);
-
- /*
- * If the state is CLOSED (i.e., TCB does not exist) then
- * all data in the incoming segment is discarded.
- * If the TCB exists but is in CLOSED state, it is embryonic,
- * but should either do a listen or a connect soon.
- */
- if (inp == NULL) {
- if (log_in_vain && tiflags & TH_SYN) {
- char buf[4*sizeof "123"];
-
- strcpy(buf, inet_ntoa(ti->ti_dst));
- log(LOG_INFO, "Connection attempt to TCP %s:%d"
- " from %s:%d\n",
- buf, ntohs(ti->ti_dport),
- inet_ntoa(ti->ti_src), ntohs(ti->ti_sport));
- }
- goto dropwithreset;
- }
- tp = intotcpcb(inp);
- if (tp == 0)
- goto dropwithreset;
- if (tp->t_state == TCPS_CLOSED)
- goto drop;
-
- /* Unscale the window into a 32-bit value. */
- if ((tiflags & TH_SYN) == 0)
- tiwin = ti->ti_win << tp->snd_scale;
- else
- tiwin = ti->ti_win;
-
- so = inp->inp_socket;
- if (so->so_options & (SO_DEBUG|SO_ACCEPTCONN)) {
-#ifdef TCPDEBUG
- if (so->so_options & SO_DEBUG) {
- ostate = tp->t_state;
- tcp_saveti = *ti;
- }
-#endif
- if (so->so_options & SO_ACCEPTCONN) {
- register struct tcpcb *tp0 = tp;
- struct socket *so2;
- if ((tiflags & (TH_RST|TH_ACK|TH_SYN)) != TH_SYN) {
- /*
- * Note: dropwithreset makes sure we don't
- * send a RST in response to a RST.
- */
- if (tiflags & TH_ACK) {
- tcpstat.tcps_badsyn++;
- goto dropwithreset;
- }
- goto drop;
- }
- so2 = sonewconn(so, 0);
- if (so2 == 0) {
- tcpstat.tcps_listendrop++;
- so2 = sodropablereq(so);
- if (so2) {
- tcp_drop(sototcpcb(so2), ETIMEDOUT);
- so2 = sonewconn(so, 0);
- }
- if (!so2)
- goto drop;
- }
- so = so2;
- /*
- * This is ugly, but ....
- *
- * Mark socket as temporary until we're
- * committed to keeping it. The code at
- * ``drop'' and ``dropwithreset'' check the
- * flag dropsocket to see if the temporary
- * socket created here should be discarded.
- * We mark the socket as discardable until
- * we're committed to it below in TCPS_LISTEN.
- */
- dropsocket++;
- inp = (struct inpcb *)so->so_pcb;
- inp->inp_laddr = ti->ti_dst;
- inp->inp_lport = ti->ti_dport;
- in_pcbrehash(inp);
-#if BSD>=43
- inp->inp_options = ip_srcroute();
-#endif
- tp = intotcpcb(inp);
- tp->t_state = TCPS_LISTEN;
- tp->t_flags |= tp0->t_flags & (TF_NOPUSH|TF_NOOPT);
-
- /* Compute proper scaling value from buffer space */
- while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
- TCP_MAXWIN << tp->request_r_scale < so->so_rcv.sb_hiwat)
- tp->request_r_scale++;
- }
- }
-
- /*
- * Segment received on connection.
- * Reset idle time and keep-alive timer.
- */
- tp->t_idle = 0;
- if (TCPS_HAVEESTABLISHED(tp->t_state))
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
-
- /*
- * Process options if not in LISTEN state,
- * else do it below (after getting remote address).
- */
- if (tp->t_state != TCPS_LISTEN)
- tcp_dooptions(tp, optp, optlen, ti, &to);
-
- /*
- * Header prediction: check for the two common cases
- * of a uni-directional data xfer. If the packet has
- * no control flags, is in-sequence, the window didn't
- * change and we're not retransmitting, it's a
- * candidate. If the length is zero and the ack moved
- * forward, we're the sender side of the xfer. Just
- * free the data acked & wake any higher level process
- * that was blocked waiting for space. If the length
- * is non-zero and the ack didn't move, we're the
- * receiver side. If we're getting packets in-order
- * (the reassembly queue is empty), add the data to
- * the socket buffer and note that we need a delayed ack.
- * Make sure that the hidden state-flags are also off.
- * Since we check for TCPS_ESTABLISHED above, it can only
- * be TH_NEEDSYN.
- */
- if (tp->t_state == TCPS_ESTABLISHED &&
- (tiflags & (TH_SYN|TH_FIN|TH_RST|TH_URG|TH_ACK)) == TH_ACK &&
- ((tp->t_flags & (TF_NEEDSYN|TF_NEEDFIN)) == 0) &&
- ((to.to_flag & TOF_TS) == 0 ||
- TSTMP_GEQ(to.to_tsval, tp->ts_recent)) &&
- /*
- * Using the CC option is compulsory if once started:
- * the segment is OK if no T/TCP was negotiated or
- * if the segment has a CC option equal to CCrecv
- */
- ((tp->t_flags & (TF_REQ_CC|TF_RCVD_CC)) != (TF_REQ_CC|TF_RCVD_CC) ||
- ((to.to_flag & TOF_CC) != 0 && to.to_cc == tp->cc_recv)) &&
- ti->ti_seq == tp->rcv_nxt &&
- tiwin && tiwin == tp->snd_wnd &&
- tp->snd_nxt == tp->snd_max) {
-
- /*
- * If last ACK falls within this segment's sequence numbers,
- * record the timestamp.
- * NOTE that the test is modified according to the latest
- * proposal of the tcplw@cray.com list (Braden 1993/04/26).
- */
- if ((to.to_flag & TOF_TS) != 0 &&
- SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) {
- tp->ts_recent_age = tcp_now;
- tp->ts_recent = to.to_tsval;
- }
-
- if (ti->ti_len == 0) {
- if (SEQ_GT(ti->ti_ack, tp->snd_una) &&
- SEQ_LEQ(ti->ti_ack, tp->snd_max) &&
- tp->snd_cwnd >= tp->snd_wnd &&
- tp->t_dupacks < tcprexmtthresh) {
- /*
- * this is a pure ack for outstanding data.
- */
- ++tcpstat.tcps_predack;
- if ((to.to_flag & TOF_TS) != 0)
- tcp_xmit_timer(tp,
- tcp_now - to.to_tsecr + 1);
- else if (tp->t_rtt &&
- SEQ_GT(ti->ti_ack, tp->t_rtseq))
- tcp_xmit_timer(tp, tp->t_rtt);
- acked = ti->ti_ack - tp->snd_una;
- tcpstat.tcps_rcvackpack++;
- tcpstat.tcps_rcvackbyte += acked;
- sbdrop(&so->so_snd, acked);
- tp->snd_una = ti->ti_ack;
- m_freem(m);
-
- /*
- * If all outstanding data are acked, stop
- * retransmit timer, otherwise restart timer
- * using current (possibly backed-off) value.
- * If process is waiting for space,
- * wakeup/selwakeup/signal. If data
- * are ready to send, let tcp_output
- * decide between more output or persist.
- */
- if (tp->snd_una == tp->snd_max)
- tp->t_timer[TCPT_REXMT] = 0;
- else if (tp->t_timer[TCPT_PERSIST] == 0)
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
-
- if (so->so_snd.sb_flags & SB_NOTIFY)
- sowwakeup(so);
- if (so->so_snd.sb_cc)
- (void) tcp_output(tp);
- return;
- }
- } else if (ti->ti_ack == tp->snd_una &&
- tp->seg_next == (struct tcpiphdr *)tp &&
- ti->ti_len <= sbspace(&so->so_rcv)) {
- /*
- * this is a pure, in-sequence data packet
- * with nothing on the reassembly queue and
- * we have enough buffer space to take it.
- */
- ++tcpstat.tcps_preddat;
- tp->rcv_nxt += ti->ti_len;
- tcpstat.tcps_rcvpack++;
- tcpstat.tcps_rcvbyte += ti->ti_len;
- /*
- * Add data to socket buffer.
- */
- sbappend(&so->so_rcv, m);
- sorwakeup(so);
-#ifdef TCP_ACK_HACK
- /*
- * If this is a short packet, then ACK now - with Nagel
- * congestion avoidance sender won't send more until
- * he gets an ACK.
- */
- if (tiflags & TH_PUSH) {
- tp->t_flags |= TF_ACKNOW;
- tcp_output(tp);
- } else {
- tp->t_flags |= TF_DELACK;
- }
-#else
- tp->t_flags |= TF_DELACK;
-#endif
- return;
- }
- }
-
- /*
- * Calculate amount of space in receive window,
- * and then do TCP input processing.
- * Receive window is amount of space in rcv queue,
- * but not less than advertised window.
- */
- { int win;
-
- win = sbspace(&so->so_rcv);
- if (win < 0)
- win = 0;
- tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt));
- }
-
- switch (tp->t_state) {
-
- /*
- * If the state is LISTEN then ignore segment if it contains an RST.
- * If the segment contains an ACK then it is bad and send a RST.
- * If it does not contain a SYN then it is not interesting; drop it.
- * If it is from this socket, drop it, it must be forged.
- * Don't bother responding if the destination was a broadcast.
- * Otherwise initialize tp->rcv_nxt, and tp->irs, select an initial
- * tp->iss, and send a segment:
- * <SEQ=ISS><ACK=RCV_NXT><CTL=SYN,ACK>
- * Also initialize tp->snd_nxt to tp->iss+1 and tp->snd_una to tp->iss.
- * Fill in remote peer address fields if not previously specified.
- * Enter SYN_RECEIVED state, and process any other fields of this
- * segment in this state.
- */
- case TCPS_LISTEN: {
- struct mbuf *am;
- register struct sockaddr_in *sin;
-
- if (tiflags & TH_RST)
- goto drop;
- if (tiflags & TH_ACK)
- goto dropwithreset;
- if ((tiflags & TH_SYN) == 0)
- goto drop;
- if ((ti->ti_dport == ti->ti_sport) &&
- (ti->ti_dst.s_addr == ti->ti_src.s_addr))
- goto drop;
- /*
- * RFC1122 4.2.3.10, p. 104: discard bcast/mcast SYN
- * in_broadcast() should never return true on a received
- * packet with M_BCAST not set.
- */
- if (m->m_flags & (M_BCAST|M_MCAST) ||
- IN_MULTICAST(ntohl(ti->ti_dst.s_addr)))
- goto drop;
- am = m_get(M_DONTWAIT, MT_SONAME); /* XXX */
- if (am == NULL)
- goto drop;
- am->m_len = sizeof (struct sockaddr_in);
- sin = mtod(am, struct sockaddr_in *);
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_addr = ti->ti_src;
- sin->sin_port = ti->ti_sport;
- bzero((caddr_t)sin->sin_zero, sizeof(sin->sin_zero));
- laddr = inp->inp_laddr;
- if (inp->inp_laddr.s_addr == INADDR_ANY)
- inp->inp_laddr = ti->ti_dst;
- if (in_pcbconnect(inp, am)) {
- inp->inp_laddr = laddr;
- (void) m_free(am);
- goto drop;
- }
- (void) m_free(am);
- tp->t_template = tcp_template(tp);
- if (tp->t_template == 0) {
- tp = tcp_drop(tp, ENOBUFS);
- dropsocket = 0; /* socket is already gone */
- goto drop;
- }
- if ((taop = tcp_gettaocache(inp)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
- tcp_dooptions(tp, optp, optlen, ti, &to);
- if (iss)
- tp->iss = iss;
- else
- tp->iss = tcp_iss;
- tcp_iss += TCP_ISSINCR/4;
- tp->irs = ti->ti_seq;
- tcp_sendseqinit(tp);
- tcp_rcvseqinit(tp);
- /*
- * Initialization of the tcpcb for transaction;
- * set SND.WND = SEG.WND,
- * initialize CCsend and CCrecv.
- */
- tp->snd_wnd = tiwin; /* initial send-window */
- tp->cc_send = CC_INC(tcp_ccgen);
- tp->cc_recv = to.to_cc;
- /*
- * Perform TAO test on incoming CC (SEG.CC) option, if any.
- * - compare SEG.CC against cached CC from the same host,
- * if any.
- * - if SEG.CC > chached value, SYN must be new and is accepted
- * immediately: save new CC in the cache, mark the socket
- * connected, enter ESTABLISHED state, turn on flag to
- * send a SYN in the next segment.
- * A virtual advertised window is set in rcv_adv to
- * initialize SWS prevention. Then enter normal segment
- * processing: drop SYN, process data and FIN.
- * - otherwise do a normal 3-way handshake.
- */
- if ((to.to_flag & TOF_CC) != 0) {
- if (taop->tao_cc != 0 && CC_GT(to.to_cc, taop->tao_cc)) {
- taop->tao_cc = to.to_cc;
- tp->t_state = TCPS_ESTABLISHED;
-
- /*
- * If there is a FIN, or if there is data and the
- * connection is local, then delay SYN,ACK(SYN) in
- * the hope of piggy-backing it on a response
- * segment. Otherwise must send ACK now in case
- * the other side is slow starting.
- */
- if ((tiflags & TH_FIN) || (ti->ti_len != 0 &&
- in_localaddr(inp->inp_faddr)))
- tp->t_flags |= (TF_DELACK | TF_NEEDSYN);
- else
- tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN);
-
- /*
- * Limit the `virtual advertised window' to TCP_MAXWIN
- * here. Even if we requested window scaling, it will
- * become effective only later when our SYN is acked.
- */
- tp->rcv_adv += min(tp->rcv_wnd, TCP_MAXWIN);
- tcpstat.tcps_connects++;
- soisconnected(so);
- tp->t_timer[TCPT_KEEP] = tcp_keepinit;
- dropsocket = 0; /* committed to socket */
- tcpstat.tcps_accepts++;
- goto trimthenstep6;
- }
- /* else do standard 3-way handshake */
- } else {
- /*
- * No CC option, but maybe CC.NEW:
- * invalidate cached value.
- */
- taop->tao_cc = 0;
- }
- /*
- * TAO test failed or there was no CC option,
- * do a standard 3-way handshake.
- */
- tp->t_flags |= TF_ACKNOW;
- tp->t_state = TCPS_SYN_RECEIVED;
- tp->t_timer[TCPT_KEEP] = tcp_keepinit;
- dropsocket = 0; /* committed to socket */
- tcpstat.tcps_accepts++;
- goto trimthenstep6;
- }
-
- /*
- * If the state is SYN_RECEIVED:
- * if seg contains SYN/ACK, send a RST.
- * if seg contains an ACK, but not for our SYN/ACK, send a RST.
- */
- case TCPS_SYN_RECEIVED:
- if (tiflags & TH_ACK) {
- if (tiflags & TH_SYN) {
- tcpstat.tcps_badsyn++;
- goto dropwithreset;
- }
- if (SEQ_LEQ(ti->ti_ack, tp->snd_una) ||
- SEQ_GT(ti->ti_ack, tp->snd_max))
- goto dropwithreset;
- }
- break;
-
- /*
- * If the state is SYN_SENT:
- * if seg contains an ACK, but not for our SYN, drop the input.
- * if seg contains a RST, then drop the connection.
- * if seg does not contain SYN, then drop it.
- * Otherwise this is an acceptable SYN segment
- * initialize tp->rcv_nxt and tp->irs
- * if seg contains ack then advance tp->snd_una
- * if SYN has been acked change to ESTABLISHED else SYN_RCVD state
- * arrange for segment to be acked (eventually)
- * continue processing rest of data/controls, beginning with URG
- */
- case TCPS_SYN_SENT:
- if ((taop = tcp_gettaocache(inp)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
-
- if ((tiflags & TH_ACK) &&
- (SEQ_LEQ(ti->ti_ack, tp->iss) ||
- SEQ_GT(ti->ti_ack, tp->snd_max))) {
- /*
- * If we have a cached CCsent for the remote host,
- * hence we haven't just crashed and restarted,
- * do not send a RST. This may be a retransmission
- * from the other side after our earlier ACK was lost.
- * Our new SYN, when it arrives, will serve as the
- * needed ACK.
- */
- if (taop->tao_ccsent != 0)
- goto drop;
- else
- goto dropwithreset;
- }
- if (tiflags & TH_RST) {
- if (tiflags & TH_ACK)
- tp = tcp_drop(tp, ECONNREFUSED);
- goto drop;
- }
- if ((tiflags & TH_SYN) == 0)
- goto drop;
- tp->snd_wnd = ti->ti_win; /* initial send window */
- tp->cc_recv = to.to_cc; /* foreign CC */
-
- tp->irs = ti->ti_seq;
- tcp_rcvseqinit(tp);
- if (tiflags & TH_ACK) {
- /*
- * Our SYN was acked. If segment contains CC.ECHO
- * option, check it to make sure this segment really
- * matches our SYN. If not, just drop it as old
- * duplicate, but send an RST if we're still playing
- * by the old rules. If no CC.ECHO option, make sure
- * we don't get fooled into using T/TCP.
- */
- if (to.to_flag & TOF_CCECHO) {
- if (tp->cc_send != to.to_ccecho)
- if (taop->tao_ccsent != 0)
- goto drop;
- else
- goto dropwithreset;
- } else
- tp->t_flags &= ~TF_RCVD_CC;
- tcpstat.tcps_connects++;
- soisconnected(so);
- /* Do window scaling on this connection? */
- if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
- (TF_RCVD_SCALE|TF_REQ_SCALE)) {
- tp->snd_scale = tp->requested_s_scale;
- tp->rcv_scale = tp->request_r_scale;
- }
- /* Segment is acceptable, update cache if undefined. */
- if (taop->tao_ccsent == 0)
- taop->tao_ccsent = to.to_ccecho;
-
- tp->rcv_adv += tp->rcv_wnd;
- tp->snd_una++; /* SYN is acked */
- /*
- * If there's data, delay ACK; if there's also a FIN
- * ACKNOW will be turned on later.
- */
- if (ti->ti_len != 0)
- tp->t_flags |= TF_DELACK;
- else
- tp->t_flags |= TF_ACKNOW;
- /*
- * Received <SYN,ACK> in SYN_SENT[*] state.
- * Transitions:
- * SYN_SENT --> ESTABLISHED
- * SYN_SENT* --> FIN_WAIT_1
- */
- if (tp->t_flags & TF_NEEDFIN) {
- tp->t_state = TCPS_FIN_WAIT_1;
- tp->t_flags &= ~TF_NEEDFIN;
- tiflags &= ~TH_SYN;
- } else {
- tp->t_state = TCPS_ESTABLISHED;
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- }
- } else {
- /*
- * Received initial SYN in SYN-SENT[*] state => simul-
- * taneous open. If segment contains CC option and there is
- * a cached CC, apply TAO test; if it succeeds, connection is
- * half-synchronized. Otherwise, do 3-way handshake:
- * SYN-SENT -> SYN-RECEIVED
- * SYN-SENT* -> SYN-RECEIVED*
- * If there was no CC option, clear cached CC value.
- */
- tp->t_flags |= TF_ACKNOW;
- tp->t_timer[TCPT_REXMT] = 0;
- if (to.to_flag & TOF_CC) {
- if (taop->tao_cc != 0 &&
- CC_GT(to.to_cc, taop->tao_cc)) {
- /*
- * update cache and make transition:
- * SYN-SENT -> ESTABLISHED*
- * SYN-SENT* -> FIN-WAIT-1*
- */
- taop->tao_cc = to.to_cc;
- if (tp->t_flags & TF_NEEDFIN) {
- tp->t_state = TCPS_FIN_WAIT_1;
- tp->t_flags &= ~TF_NEEDFIN;
- } else {
- tp->t_state = TCPS_ESTABLISHED;
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- }
- tp->t_flags |= TF_NEEDSYN;
- } else
- tp->t_state = TCPS_SYN_RECEIVED;
- } else {
- /* CC.NEW or no option => invalidate cache */
- taop->tao_cc = 0;
- tp->t_state = TCPS_SYN_RECEIVED;
- }
- }
-
-trimthenstep6:
- /*
- * Advance ti->ti_seq to correspond to first data byte.
- * If data, trim to stay within window,
- * dropping FIN if necessary.
- */
- ti->ti_seq++;
- if (ti->ti_len > tp->rcv_wnd) {
- todrop = ti->ti_len - tp->rcv_wnd;
- m_adj(m, -todrop);
- ti->ti_len = tp->rcv_wnd;
- tiflags &= ~TH_FIN;
- tcpstat.tcps_rcvpackafterwin++;
- tcpstat.tcps_rcvbyteafterwin += todrop;
- }
- tp->snd_wl1 = ti->ti_seq - 1;
- tp->rcv_up = ti->ti_seq;
- /*
- * Client side of transaction: already sent SYN and data.
- * If the remote host used T/TCP to validate the SYN,
- * our data will be ACK'd; if so, enter normal data segment
- * processing in the middle of step 5, ack processing.
- * Otherwise, goto step 6.
- */
- if (tiflags & TH_ACK)
- goto process_ACK;
- goto step6;
- /*
- * If the state is LAST_ACK or CLOSING or TIME_WAIT:
- * if segment contains a SYN and CC [not CC.NEW] option:
- * if state == TIME_WAIT and connection duration > MSL,
- * drop packet and send RST;
- *
- * if SEG.CC > CCrecv then is new SYN, and can implicitly
- * ack the FIN (and data) in retransmission queue.
- * Complete close and delete TCPCB. Then reprocess
- * segment, hoping to find new TCPCB in LISTEN state;
- *
- * else must be old SYN; drop it.
- * else do normal processing.
- */
- case TCPS_LAST_ACK:
- case TCPS_CLOSING:
- case TCPS_TIME_WAIT:
- if ((tiflags & TH_SYN) &&
- (to.to_flag & TOF_CC) && tp->cc_recv != 0) {
- if (tp->t_state == TCPS_TIME_WAIT &&
- tp->t_duration > TCPTV_MSL)
- goto dropwithreset;
- if (CC_GT(to.to_cc, tp->cc_recv)) {
- tp = tcp_close(tp);
- goto findpcb;
- }
- else
- goto drop;
- }
- break; /* continue normal processing */
- }
-
- /*
- * States other than LISTEN or SYN_SENT.
- * First check timestamp, if present.
- * Then check the connection count, if present.
- * Then check that at least some bytes of segment are within
- * receive window. If segment begins before rcv_nxt,
- * drop leading data (and SYN); if nothing left, just ack.
- *
- * RFC 1323 PAWS: If we have a timestamp reply on this segment
- * and it's less than ts_recent, drop it.
- */
- if ((to.to_flag & TOF_TS) != 0 && (tiflags & TH_RST) == 0 &&
- tp->ts_recent && TSTMP_LT(to.to_tsval, tp->ts_recent)) {
-
- /* Check to see if ts_recent is over 24 days old. */
- if ((int)(tcp_now - tp->ts_recent_age) > TCP_PAWS_IDLE) {
- /*
- * Invalidate ts_recent. If this segment updates
- * ts_recent, the age will be reset later and ts_recent
- * will get a valid value. If it does not, setting
- * ts_recent to zero will at least satisfy the
- * requirement that zero be placed in the timestamp
- * echo reply when ts_recent isn't valid. The
- * age isn't reset until we get a valid ts_recent
- * because we don't want out-of-order segments to be
- * dropped when ts_recent is old.
- */
- tp->ts_recent = 0;
- } else {
- tcpstat.tcps_rcvduppack++;
- tcpstat.tcps_rcvdupbyte += ti->ti_len;
- tcpstat.tcps_pawsdrop++;
- goto dropafterack;
- }
- }
-
- /*
- * T/TCP mechanism
- * If T/TCP was negotiated and the segment doesn't have CC,
- * or if it's CC is wrong then drop the segment.
- * RST segments do not have to comply with this.
- */
- if ((tp->t_flags & (TF_REQ_CC|TF_RCVD_CC)) == (TF_REQ_CC|TF_RCVD_CC) &&
- ((to.to_flag & TOF_CC) == 0 || tp->cc_recv != to.to_cc) &&
- (tiflags & TH_RST) == 0)
- goto dropafterack;
-
- todrop = tp->rcv_nxt - ti->ti_seq;
- if (todrop > 0) {
- if (tiflags & TH_SYN) {
- tiflags &= ~TH_SYN;
- ti->ti_seq++;
- if (ti->ti_urp > 1)
- ti->ti_urp--;
- else
- tiflags &= ~TH_URG;
- todrop--;
- }
- /*
- * Following if statement from Stevens, vol. 2, p. 960.
- */
- if (todrop > ti->ti_len
- || (todrop == ti->ti_len && (tiflags & TH_FIN) == 0)) {
- /*
- * Any valid FIN must be to the left of the window.
- * At this point the FIN must be a duplicate or out
- * of sequence; drop it.
- */
- tiflags &= ~TH_FIN;
-
- /*
- * Send an ACK to resynchronize and drop any data.
- * But keep on processing for RST or ACK.
- */
- tp->t_flags |= TF_ACKNOW;
- todrop = ti->ti_len;
- tcpstat.tcps_rcvduppack++;
- tcpstat.tcps_rcvdupbyte += todrop;
- } else {
- tcpstat.tcps_rcvpartduppack++;
- tcpstat.tcps_rcvpartdupbyte += todrop;
- }
- m_adj(m, todrop);
- ti->ti_seq += todrop;
- ti->ti_len -= todrop;
- if (ti->ti_urp > todrop)
- ti->ti_urp -= todrop;
- else {
- tiflags &= ~TH_URG;
- ti->ti_urp = 0;
- }
- }
-
- /*
- * If new data are received on a connection after the
- * user processes are gone, then RST the other end.
- */
- if ((so->so_state & SS_NOFDREF) &&
- tp->t_state > TCPS_CLOSE_WAIT && ti->ti_len) {
- tp = tcp_close(tp);
- tcpstat.tcps_rcvafterclose++;
- goto dropwithreset;
- }
-
- /*
- * If segment ends after window, drop trailing data
- * (and PUSH and FIN); if nothing left, just ACK.
- */
- todrop = (ti->ti_seq+ti->ti_len) - (tp->rcv_nxt+tp->rcv_wnd);
- if (todrop > 0) {
- tcpstat.tcps_rcvpackafterwin++;
- if (todrop >= ti->ti_len) {
- tcpstat.tcps_rcvbyteafterwin += ti->ti_len;
- /*
- * If a new connection request is received
- * while in TIME_WAIT, drop the old connection
- * and start over if the sequence numbers
- * are above the previous ones.
- */
- if (tiflags & TH_SYN &&
- tp->t_state == TCPS_TIME_WAIT &&
- SEQ_GT(ti->ti_seq, tp->rcv_nxt)) {
- iss = tp->rcv_nxt + TCP_ISSINCR;
- tp = tcp_close(tp);
- goto findpcb;
- }
- /*
- * If window is closed can only take segments at
- * window edge, and have to drop data and PUSH from
- * incoming segments. Continue processing, but
- * remember to ack. Otherwise, drop segment
- * and ack.
- */
- if (tp->rcv_wnd == 0 && ti->ti_seq == tp->rcv_nxt) {
- tp->t_flags |= TF_ACKNOW;
- tcpstat.tcps_rcvwinprobe++;
- } else
- goto dropafterack;
- } else
- tcpstat.tcps_rcvbyteafterwin += todrop;
- m_adj(m, -todrop);
- ti->ti_len -= todrop;
- tiflags &= ~(TH_PUSH|TH_FIN);
- }
-
- /*
- * If last ACK falls within this segment's sequence numbers,
- * record its timestamp.
- * NOTE that the test is modified according to the latest
- * proposal of the tcplw@cray.com list (Braden 1993/04/26).
- */
- if ((to.to_flag & TOF_TS) != 0 &&
- SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) {
- tp->ts_recent_age = tcp_now;
- tp->ts_recent = to.to_tsval;
- }
-
- /*
- * If the RST bit is set examine the state:
- * SYN_RECEIVED STATE:
- * If passive open, return to LISTEN state.
- * If active open, inform user that connection was refused.
- * ESTABLISHED, FIN_WAIT_1, FIN_WAIT2, CLOSE_WAIT STATES:
- * Inform user that connection was reset, and close tcb.
- * CLOSING, LAST_ACK, TIME_WAIT STATES
- * Close the tcb.
- */
- if (tiflags&TH_RST) switch (tp->t_state) {
-
- case TCPS_SYN_RECEIVED:
- so->so_error = ECONNREFUSED;
- goto close;
-
- case TCPS_ESTABLISHED:
- case TCPS_FIN_WAIT_1:
- case TCPS_FIN_WAIT_2:
- case TCPS_CLOSE_WAIT:
- so->so_error = ECONNRESET;
- close:
- tp->t_state = TCPS_CLOSED;
- tcpstat.tcps_drops++;
- tp = tcp_close(tp);
- goto drop;
-
- case TCPS_CLOSING:
- case TCPS_LAST_ACK:
- case TCPS_TIME_WAIT:
- tp = tcp_close(tp);
- goto drop;
- }
-
- /*
- * If a SYN is in the window, then this is an
- * error and we send an RST and drop the connection.
- */
- if (tiflags & TH_SYN) {
- tp = tcp_drop(tp, ECONNRESET);
- goto dropwithreset;
- }
-
- /*
- * If the ACK bit is off: if in SYN-RECEIVED state or SENDSYN
- * flag is on (half-synchronized state), then queue data for
- * later processing; else drop segment and return.
- */
- if ((tiflags & TH_ACK) == 0) {
- if (tp->t_state == TCPS_SYN_RECEIVED ||
- (tp->t_flags & TF_NEEDSYN))
- goto step6;
- else
- goto drop;
- }
-
- /*
- * Ack processing.
- */
- switch (tp->t_state) {
-
- /*
- * In SYN_RECEIVED state, the ack ACKs our SYN, so enter
- * ESTABLISHED state and continue processing.
- * The ACK was checked above.
- */
- case TCPS_SYN_RECEIVED:
-
- tcpstat.tcps_connects++;
- soisconnected(so);
- /* Do window scaling? */
- if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
- (TF_RCVD_SCALE|TF_REQ_SCALE)) {
- tp->snd_scale = tp->requested_s_scale;
- tp->rcv_scale = tp->request_r_scale;
- }
- /*
- * Upon successful completion of 3-way handshake,
- * update cache.CC if it was undefined, pass any queued
- * data to the user, and advance state appropriately.
- */
- if ((taop = tcp_gettaocache(inp)) != NULL &&
- taop->tao_cc == 0)
- taop->tao_cc = tp->cc_recv;
-
- /*
- * Make transitions:
- * SYN-RECEIVED -> ESTABLISHED
- * SYN-RECEIVED* -> FIN-WAIT-1
- */
- if (tp->t_flags & TF_NEEDFIN) {
- tp->t_state = TCPS_FIN_WAIT_1;
- tp->t_flags &= ~TF_NEEDFIN;
- } else {
- tp->t_state = TCPS_ESTABLISHED;
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- }
- /*
- * If segment contains data or ACK, will call tcp_reass()
- * later; if not, do so now to pass queued data to user.
- */
- if (ti->ti_len == 0 && (tiflags & TH_FIN) == 0)
- (void) tcp_reass(tp, (struct tcpiphdr *)0,
- (struct mbuf *)0);
- tp->snd_wl1 = ti->ti_seq - 1;
- /* fall into ... */
-
- /*
- * In ESTABLISHED state: drop duplicate ACKs; ACK out of range
- * ACKs. If the ack is in the range
- * tp->snd_una < ti->ti_ack <= tp->snd_max
- * then advance tp->snd_una to ti->ti_ack and drop
- * data from the retransmission queue. If this ACK reflects
- * more up to date window information we update our window information.
- */
- case TCPS_ESTABLISHED:
- case TCPS_FIN_WAIT_1:
- case TCPS_FIN_WAIT_2:
- case TCPS_CLOSE_WAIT:
- case TCPS_CLOSING:
- case TCPS_LAST_ACK:
- case TCPS_TIME_WAIT:
-
- if (SEQ_LEQ(ti->ti_ack, tp->snd_una)) {
- if (ti->ti_len == 0 && tiwin == tp->snd_wnd) {
- tcpstat.tcps_rcvdupack++;
- /*
- * If we have outstanding data (other than
- * a window probe), this is a completely
- * duplicate ack (ie, window info didn't
- * change), the ack is the biggest we've
- * seen and we've seen exactly our rexmt
- * threshhold of them, assume a packet
- * has been dropped and retransmit it.
- * Kludge snd_nxt & the congestion
- * window so we send only this one
- * packet.
- *
- * We know we're losing at the current
- * window size so do congestion avoidance
- * (set ssthresh to half the current window
- * and pull our congestion window back to
- * the new ssthresh).
- *
- * Dup acks mean that packets have left the
- * network (they're now cached at the receiver)
- * so bump cwnd by the amount in the receiver
- * to keep a constant cwnd packets in the
- * network.
- */
- if (tp->t_timer[TCPT_REXMT] == 0 ||
- ti->ti_ack != tp->snd_una)
- tp->t_dupacks = 0;
- else if (++tp->t_dupacks == tcprexmtthresh) {
- tcp_seq onxt = tp->snd_nxt;
- u_int win =
- min(tp->snd_wnd, tp->snd_cwnd) / 2 /
- tp->t_maxseg;
-
- if (win < 2)
- win = 2;
- tp->snd_ssthresh = win * tp->t_maxseg;
- tp->t_timer[TCPT_REXMT] = 0;
- tp->t_rtt = 0;
- tp->snd_nxt = ti->ti_ack;
- tp->snd_cwnd = tp->t_maxseg;
- (void) tcp_output(tp);
- tp->snd_cwnd = tp->snd_ssthresh +
- tp->t_maxseg * tp->t_dupacks;
- if (SEQ_GT(onxt, tp->snd_nxt))
- tp->snd_nxt = onxt;
- goto drop;
- } else if (tp->t_dupacks > tcprexmtthresh) {
- tp->snd_cwnd += tp->t_maxseg;
- (void) tcp_output(tp);
- goto drop;
- }
- } else
- tp->t_dupacks = 0;
- break;
- }
- /*
- * If the congestion window was inflated to account
- * for the other side's cached packets, retract it.
- */
- if (tp->t_dupacks >= tcprexmtthresh &&
- tp->snd_cwnd > tp->snd_ssthresh)
- tp->snd_cwnd = tp->snd_ssthresh;
- tp->t_dupacks = 0;
- if (SEQ_GT(ti->ti_ack, tp->snd_max)) {
- tcpstat.tcps_rcvacktoomuch++;
- goto dropafterack;
- }
- /*
- * If we reach this point, ACK is not a duplicate,
- * i.e., it ACKs something we sent.
- */
- if (tp->t_flags & TF_NEEDSYN) {
- /*
- * T/TCP: Connection was half-synchronized, and our
- * SYN has been ACK'd (so connection is now fully
- * synchronized). Go to non-starred state,
- * increment snd_una for ACK of SYN, and check if
- * we can do window scaling.
- */
- tp->t_flags &= ~TF_NEEDSYN;
- tp->snd_una++;
- /* Do window scaling? */
- if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
- (TF_RCVD_SCALE|TF_REQ_SCALE)) {
- tp->snd_scale = tp->requested_s_scale;
- tp->rcv_scale = tp->request_r_scale;
- }
- }
-
-process_ACK:
- acked = ti->ti_ack - tp->snd_una;
- tcpstat.tcps_rcvackpack++;
- tcpstat.tcps_rcvackbyte += acked;
-
- /*
- * If we have a timestamp reply, update smoothed
- * round trip time. If no timestamp is present but
- * transmit timer is running and timed sequence
- * number was acked, update smoothed round trip time.
- * Since we now have an rtt measurement, cancel the
- * timer backoff (cf., Phil Karn's retransmit alg.).
- * Recompute the initial retransmit timer.
- */
- if (to.to_flag & TOF_TS)
- tcp_xmit_timer(tp, tcp_now - to.to_tsecr + 1);
- else if (tp->t_rtt && SEQ_GT(ti->ti_ack, tp->t_rtseq))
- tcp_xmit_timer(tp,tp->t_rtt);
-
- /*
- * If all outstanding data is acked, stop retransmit
- * timer and remember to restart (more output or persist).
- * If there is more data to be acked, restart retransmit
- * timer, using current (possibly backed-off) value.
- */
- if (ti->ti_ack == tp->snd_max) {
- tp->t_timer[TCPT_REXMT] = 0;
- needoutput = 1;
- } else if (tp->t_timer[TCPT_PERSIST] == 0)
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
-
- /*
- * If no data (only SYN) was ACK'd,
- * skip rest of ACK processing.
- */
- if (acked == 0)
- goto step6;
-
- /*
- * When new data is acked, open the congestion window.
- * If the window gives us less than ssthresh packets
- * in flight, open exponentially (maxseg per packet).
- * Otherwise open linearly: maxseg per window
- * (maxseg^2 / cwnd per packet).
- */
- {
- register u_int cw = tp->snd_cwnd;
- register u_int incr = tp->t_maxseg;
-
- if (cw > tp->snd_ssthresh)
- incr = incr * incr / cw;
- tp->snd_cwnd = min(cw + incr, TCP_MAXWIN<<tp->snd_scale);
- }
- if (acked > so->so_snd.sb_cc) {
- tp->snd_wnd -= so->so_snd.sb_cc;
- sbdrop(&so->so_snd, (int)so->so_snd.sb_cc);
- ourfinisacked = 1;
- } else {
- sbdrop(&so->so_snd, acked);
- tp->snd_wnd -= acked;
- ourfinisacked = 0;
- }
- if (so->so_snd.sb_flags & SB_NOTIFY)
- sowwakeup(so);
- tp->snd_una = ti->ti_ack;
- if (SEQ_LT(tp->snd_nxt, tp->snd_una))
- tp->snd_nxt = tp->snd_una;
-
- switch (tp->t_state) {
-
- /*
- * In FIN_WAIT_1 STATE in addition to the processing
- * for the ESTABLISHED state if our FIN is now acknowledged
- * then enter FIN_WAIT_2.
- */
- case TCPS_FIN_WAIT_1:
- if (ourfinisacked) {
- /*
- * If we can't receive any more
- * data, then closing user can proceed.
- * Starting the timer is contrary to the
- * specification, but if we don't get a FIN
- * we'll hang forever.
- */
- if (so->so_state & SS_CANTRCVMORE) {
- soisdisconnected(so);
- tp->t_timer[TCPT_2MSL] = tcp_maxidle;
- }
- tp->t_state = TCPS_FIN_WAIT_2;
- }
- break;
-
- /*
- * In CLOSING STATE in addition to the processing for
- * the ESTABLISHED state if the ACK acknowledges our FIN
- * then enter the TIME-WAIT state, otherwise ignore
- * the segment.
- */
- case TCPS_CLOSING:
- if (ourfinisacked) {
- tp->t_state = TCPS_TIME_WAIT;
- tcp_canceltimers(tp);
- /* Shorten TIME_WAIT [RFC-1644, p.28] */
- if (tp->cc_recv != 0 &&
- tp->t_duration < TCPTV_MSL)
- tp->t_timer[TCPT_2MSL] =
- tp->t_rxtcur * TCPTV_TWTRUNC;
- else
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- soisdisconnected(so);
- }
- break;
-
- /*
- * In LAST_ACK, we may still be waiting for data to drain
- * and/or to be acked, as well as for the ack of our FIN.
- * If our FIN is now acknowledged, delete the TCB,
- * enter the closed state and return.
- */
- case TCPS_LAST_ACK:
- if (ourfinisacked) {
- tp = tcp_close(tp);
- goto drop;
- }
- break;
-
- /*
- * In TIME_WAIT state the only thing that should arrive
- * is a retransmission of the remote FIN. Acknowledge
- * it and restart the finack timer.
- */
- case TCPS_TIME_WAIT:
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- goto dropafterack;
- }
- }
-
-step6:
- /*
- * Update window information.
- * Don't look at window if no ACK: TAC's send garbage on first SYN.
- */
- if ((tiflags & TH_ACK) &&
- (SEQ_LT(tp->snd_wl1, ti->ti_seq) ||
- (tp->snd_wl1 == ti->ti_seq && (SEQ_LT(tp->snd_wl2, ti->ti_ack) ||
- (tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd))))) {
- /* keep track of pure window updates */
- if (ti->ti_len == 0 &&
- tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd)
- tcpstat.tcps_rcvwinupd++;
- tp->snd_wnd = tiwin;
- tp->snd_wl1 = ti->ti_seq;
- tp->snd_wl2 = ti->ti_ack;
- if (tp->snd_wnd > tp->max_sndwnd)
- tp->max_sndwnd = tp->snd_wnd;
- needoutput = 1;
- }
-
- /*
- * Process segments with URG.
- */
- if ((tiflags & TH_URG) && ti->ti_urp &&
- TCPS_HAVERCVDFIN(tp->t_state) == 0) {
- /*
- * This is a kludge, but if we receive and accept
- * random urgent pointers, we'll crash in
- * soreceive. It's hard to imagine someone
- * actually wanting to send this much urgent data.
- */
- if (ti->ti_urp + so->so_rcv.sb_cc > sb_max) {
- ti->ti_urp = 0; /* XXX */
- tiflags &= ~TH_URG; /* XXX */
- goto dodata; /* XXX */
- }
- /*
- * If this segment advances the known urgent pointer,
- * then mark the data stream. This should not happen
- * in CLOSE_WAIT, CLOSING, LAST_ACK or TIME_WAIT STATES since
- * a FIN has been received from the remote side.
- * In these states we ignore the URG.
- *
- * According to RFC961 (Assigned Protocols),
- * the urgent pointer points to the last octet
- * of urgent data. We continue, however,
- * to consider it to indicate the first octet
- * of data past the urgent section as the original
- * spec states (in one of two places).
- */
- if (SEQ_GT(ti->ti_seq+ti->ti_urp, tp->rcv_up)) {
- tp->rcv_up = ti->ti_seq + ti->ti_urp;
- so->so_oobmark = so->so_rcv.sb_cc +
- (tp->rcv_up - tp->rcv_nxt) - 1;
- if (so->so_oobmark == 0)
- so->so_state |= SS_RCVATMARK;
- sohasoutofband(so);
- tp->t_oobflags &= ~(TCPOOB_HAVEDATA | TCPOOB_HADDATA);
- }
- /*
- * Remove out of band data so doesn't get presented to user.
- * This can happen independent of advancing the URG pointer,
- * but if two URG's are pending at once, some out-of-band
- * data may creep in... ick.
- */
- if (ti->ti_urp <= (u_long)ti->ti_len
-#ifdef SO_OOBINLINE
- && (so->so_options & SO_OOBINLINE) == 0
-#endif
- )
- tcp_pulloutofband(so, ti, m);
- } else
- /*
- * If no out of band data is expected,
- * pull receive urgent pointer along
- * with the receive window.
- */
- if (SEQ_GT(tp->rcv_nxt, tp->rcv_up))
- tp->rcv_up = tp->rcv_nxt;
-dodata: /* XXX */
-
- /*
- * Process the segment text, merging it into the TCP sequencing queue,
- * and arranging for acknowledgment of receipt if necessary.
- * This process logically involves adjusting tp->rcv_wnd as data
- * is presented to the user (this happens in tcp_usrreq.c,
- * case PRU_RCVD). If a FIN has already been received on this
- * connection then we just ignore the text.
- */
- if ((ti->ti_len || (tiflags&TH_FIN)) &&
- TCPS_HAVERCVDFIN(tp->t_state) == 0) {
- TCP_REASS(tp, ti, m, so, tiflags);
- /*
- * Note the amount of data that peer has sent into
- * our window, in order to estimate the sender's
- * buffer size.
- */
- len = so->so_rcv.sb_hiwat - (tp->rcv_adv - tp->rcv_nxt);
- } else {
- m_freem(m);
- tiflags &= ~TH_FIN;
- }
-
- /*
- * If FIN is received ACK the FIN and let the user know
- * that the connection is closing.
- */
- if (tiflags & TH_FIN) {
- if (TCPS_HAVERCVDFIN(tp->t_state) == 0) {
- socantrcvmore(so);
- /*
- * If connection is half-synchronized
- * (ie NEEDSYN flag on) then delay ACK,
- * so it may be piggybacked when SYN is sent.
- * Otherwise, since we received a FIN then no
- * more input can be expected, send ACK now.
- */
- if (tp->t_flags & TF_NEEDSYN)
- tp->t_flags |= TF_DELACK;
- else
- tp->t_flags |= TF_ACKNOW;
- tp->rcv_nxt++;
- }
- switch (tp->t_state) {
-
- /*
- * In SYN_RECEIVED and ESTABLISHED STATES
- * enter the CLOSE_WAIT state.
- */
- case TCPS_SYN_RECEIVED:
- case TCPS_ESTABLISHED:
- tp->t_state = TCPS_CLOSE_WAIT;
- break;
-
- /*
- * If still in FIN_WAIT_1 STATE FIN has not been acked so
- * enter the CLOSING state.
- */
- case TCPS_FIN_WAIT_1:
- tp->t_state = TCPS_CLOSING;
- break;
-
- /*
- * In FIN_WAIT_2 state enter the TIME_WAIT state,
- * starting the time-wait timer, turning off the other
- * standard timers.
- */
- case TCPS_FIN_WAIT_2:
- tp->t_state = TCPS_TIME_WAIT;
- tcp_canceltimers(tp);
- /* Shorten TIME_WAIT [RFC-1644, p.28] */
- if (tp->cc_recv != 0 &&
- tp->t_duration < TCPTV_MSL) {
- tp->t_timer[TCPT_2MSL] =
- tp->t_rxtcur * TCPTV_TWTRUNC;
- /* For transaction client, force ACK now. */
- tp->t_flags |= TF_ACKNOW;
- }
- else
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- soisdisconnected(so);
- break;
-
- /*
- * In TIME_WAIT state restart the 2 MSL time_wait timer.
- */
- case TCPS_TIME_WAIT:
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- break;
- }
- }
-#ifdef TCPDEBUG
- if (so->so_options & SO_DEBUG)
- tcp_trace(TA_INPUT, ostate, tp, &tcp_saveti, 0);
-#endif
-
- /*
- * Return any desired output.
- */
- if (needoutput || (tp->t_flags & TF_ACKNOW))
- (void) tcp_output(tp);
- return;
-
-dropafterack:
- /*
- * Generate an ACK dropping incoming segment if it occupies
- * sequence space, where the ACK reflects our state.
- */
- if (tiflags & TH_RST)
- goto drop;
-#ifdef TCPDEBUG
- if (so->so_options & SO_DEBUG)
- tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0);
-#endif
- m_freem(m);
- tp->t_flags |= TF_ACKNOW;
- (void) tcp_output(tp);
- return;
-
-dropwithreset:
- /*
- * Generate a RST, dropping incoming segment.
- * Make ACK acceptable to originator of segment.
- * Don't bother to respond if destination was broadcast/multicast.
- */
- if ((tiflags & TH_RST) || m->m_flags & (M_BCAST|M_MCAST) ||
- IN_MULTICAST(ntohl(ti->ti_dst.s_addr)))
- goto drop;
-#ifdef TCPDEBUG
- if (tp == 0 || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
- tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0);
-#endif
- if (tiflags & TH_ACK)
- tcp_respond(tp, ti, m, (tcp_seq)0, ti->ti_ack, TH_RST);
- else {
- if (tiflags & TH_SYN)
- ti->ti_len++;
- tcp_respond(tp, ti, m, ti->ti_seq+ti->ti_len, (tcp_seq)0,
- TH_RST|TH_ACK);
- }
- /* destroy temporarily created socket */
- if (dropsocket)
- (void) soabort(so);
- return;
-
-drop:
- /*
- * Drop space held by incoming segment and return.
- */
-#ifdef TCPDEBUG
- if (tp == 0 || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
- tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0);
-#endif
- m_freem(m);
- /* destroy temporarily created socket */
- if (dropsocket)
- (void) soabort(so);
- return;
-#ifndef TUBA_INCLUDE
-}
-
-static void
-tcp_dooptions(tp, cp, cnt, ti, to)
- struct tcpcb *tp;
- u_char *cp;
- int cnt;
- struct tcpiphdr *ti;
- struct tcpopt *to;
-{
- u_short mss = 0;
- int opt, optlen;
-
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[0];
- if (opt == TCPOPT_EOL)
- break;
- if (opt == TCPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[1];
- if (optlen <= 0)
- break;
- }
- switch (opt) {
-
- default:
- continue;
-
- case TCPOPT_MAXSEG:
- if (optlen != TCPOLEN_MAXSEG)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- bcopy((char *) cp + 2, (char *) &mss, sizeof(mss));
- NTOHS(mss);
- break;
-
- case TCPOPT_WINDOW:
- if (optlen != TCPOLEN_WINDOW)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- tp->t_flags |= TF_RCVD_SCALE;
- tp->requested_s_scale = min(cp[2], TCP_MAX_WINSHIFT);
- break;
-
- case TCPOPT_TIMESTAMP:
- if (optlen != TCPOLEN_TIMESTAMP)
- continue;
- to->to_flag |= TOF_TS;
- bcopy((char *)cp + 2,
- (char *)&to->to_tsval, sizeof(to->to_tsval));
- NTOHL(to->to_tsval);
- bcopy((char *)cp + 6,
- (char *)&to->to_tsecr, sizeof(to->to_tsecr));
- NTOHL(to->to_tsecr);
-
- /*
- * A timestamp received in a SYN makes
- * it ok to send timestamp requests and replies.
- */
- if (ti->ti_flags & TH_SYN) {
- tp->t_flags |= TF_RCVD_TSTMP;
- tp->ts_recent = to->to_tsval;
- tp->ts_recent_age = tcp_now;
- }
- break;
- case TCPOPT_CC:
- if (optlen != TCPOLEN_CC)
- continue;
- to->to_flag |= TOF_CC;
- bcopy((char *)cp + 2,
- (char *)&to->to_cc, sizeof(to->to_cc));
- NTOHL(to->to_cc);
- /*
- * A CC or CC.new option received in a SYN makes
- * it ok to send CC in subsequent segments.
- */
- if (ti->ti_flags & TH_SYN)
- tp->t_flags |= TF_RCVD_CC;
- break;
- case TCPOPT_CCNEW:
- if (optlen != TCPOLEN_CC)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- to->to_flag |= TOF_CCNEW;
- bcopy((char *)cp + 2,
- (char *)&to->to_cc, sizeof(to->to_cc));
- NTOHL(to->to_cc);
- /*
- * A CC or CC.new option received in a SYN makes
- * it ok to send CC in subsequent segments.
- */
- tp->t_flags |= TF_RCVD_CC;
- break;
- case TCPOPT_CCECHO:
- if (optlen != TCPOLEN_CC)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- to->to_flag |= TOF_CCECHO;
- bcopy((char *)cp + 2,
- (char *)&to->to_ccecho, sizeof(to->to_ccecho));
- NTOHL(to->to_ccecho);
- break;
- }
- }
- if (ti->ti_flags & TH_SYN)
- tcp_mss(tp, mss); /* sets t_maxseg */
-}
-
-/*
- * Pull out of band byte out of a segment so
- * it doesn't appear in the user's data queue.
- * It is still reflected in the segment length for
- * sequencing purposes.
- */
-static void
-tcp_pulloutofband(so, ti, m)
- struct socket *so;
- struct tcpiphdr *ti;
- register struct mbuf *m;
-{
- int cnt = ti->ti_urp - 1;
-
- while (cnt >= 0) {
- if (m->m_len > cnt) {
- char *cp = mtod(m, caddr_t) + cnt;
- struct tcpcb *tp = sototcpcb(so);
-
- tp->t_iobc = *cp;
- tp->t_oobflags |= TCPOOB_HAVEDATA;
- bcopy(cp+1, cp, (unsigned)(m->m_len - cnt - 1));
- m->m_len--;
- return;
- }
- cnt -= m->m_len;
- m = m->m_next;
- if (m == 0)
- break;
- }
- panic("tcp_pulloutofband");
-}
-
-/*
- * Collect new round-trip time estimate
- * and update averages and current timeout.
- */
-static void
-tcp_xmit_timer(tp, rtt)
- register struct tcpcb *tp;
- short rtt;
-{
- register int delta;
-
- tcpstat.tcps_rttupdated++;
- tp->t_rttupdated++;
- if (tp->t_srtt != 0) {
- /*
- * srtt is stored as fixed point with 5 bits after the
- * binary point (i.e., scaled by 8). The following magic
- * is equivalent to the smoothing algorithm in rfc793 with
- * an alpha of .875 (srtt = rtt/8 + srtt*7/8 in fixed
- * point). Adjust rtt to origin 0.
- */
- delta = ((rtt - 1) << TCP_DELTA_SHIFT)
- - (tp->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT));
-
- if ((tp->t_srtt += delta) <= 0)
- tp->t_srtt = 1;
-
- /*
- * We accumulate a smoothed rtt variance (actually, a
- * smoothed mean difference), then set the retransmit
- * timer to smoothed rtt + 4 times the smoothed variance.
- * rttvar is stored as fixed point with 4 bits after the
- * binary point (scaled by 16). The following is
- * equivalent to rfc793 smoothing with an alpha of .75
- * (rttvar = rttvar*3/4 + |delta| / 4). This replaces
- * rfc793's wired-in beta.
- */
- if (delta < 0)
- delta = -delta;
- delta -= tp->t_rttvar >> (TCP_RTTVAR_SHIFT - TCP_DELTA_SHIFT);
- if ((tp->t_rttvar += delta) <= 0)
- tp->t_rttvar = 1;
- } else {
- /*
- * No rtt measurement yet - use the unsmoothed rtt.
- * Set the variance to half the rtt (so our first
- * retransmit happens at 3*rtt).
- */
- tp->t_srtt = rtt << TCP_RTT_SHIFT;
- tp->t_rttvar = rtt << (TCP_RTTVAR_SHIFT - 1);
- }
- tp->t_rtt = 0;
- tp->t_rxtshift = 0;
-
- /*
- * the retransmit should happen at rtt + 4 * rttvar.
- * Because of the way we do the smoothing, srtt and rttvar
- * will each average +1/2 tick of bias. When we compute
- * the retransmit timer, we want 1/2 tick of rounding and
- * 1 extra tick because of +-1/2 tick uncertainty in the
- * firing of the timer. The bias will give us exactly the
- * 1.5 tick we need. But, because the bias is
- * statistical, we have to test that we don't drop below
- * the minimum feasible timer (which is 2 ticks).
- */
- TCPT_RANGESET(tp->t_rxtcur, TCP_REXMTVAL(tp),
- max(tp->t_rttmin, rtt + 2), TCPTV_REXMTMAX);
-
- /*
- * We received an ack for a packet that wasn't retransmitted;
- * it is probably safe to discard any error indications we've
- * received recently. This isn't quite right, but close enough
- * for now (a route might have failed after we sent a segment,
- * and the return path might not be symmetrical).
- */
- tp->t_softerror = 0;
-}
-
-/*
- * Determine a reasonable value for maxseg size.
- * If the route is known, check route for mtu.
- * If none, use an mss that can be handled on the outgoing
- * interface without forcing IP to fragment; if bigger than
- * an mbuf cluster (MCLBYTES), round down to nearest multiple of MCLBYTES
- * to utilize large mbufs. If no route is found, route has no mtu,
- * or the destination isn't local, use a default, hopefully conservative
- * size (usually 512 or the default IP max size, but no more than the mtu
- * of the interface), as we can't discover anything about intervening
- * gateways or networks. We also initialize the congestion/slow start
- * window to be a single segment if the destination isn't local.
- * While looking at the routing entry, we also initialize other path-dependent
- * parameters from pre-set or cached values in the routing entry.
- *
- * Also take into account the space needed for options that we
- * send regularly. Make maxseg shorter by that amount to assure
- * that we can send maxseg amount of data even when the options
- * are present. Store the upper limit of the length of options plus
- * data in maxopd.
- *
- * NOTE that this routine is only called when we process an incoming
- * segment, for outgoing segments only tcp_mssopt is called.
- *
- * In case of T/TCP, we call this routine during implicit connection
- * setup as well (offer = -1), to initialize maxseg from the cached
- * MSS of our peer.
- */
-void
-tcp_mss(tp, offer)
- struct tcpcb *tp;
- int offer;
-{
- register struct rtentry *rt;
- struct ifnet *ifp;
- register int rtt, mss;
- u_long bufsize;
- struct inpcb *inp;
- struct socket *so;
- struct rmxp_tao *taop;
- int origoffer = offer;
-
- inp = tp->t_inpcb;
- if ((rt = tcp_rtlookup(inp)) == NULL) {
- tp->t_maxopd = tp->t_maxseg = tcp_mssdflt;
- return;
- }
- ifp = rt->rt_ifp;
- so = inp->inp_socket;
-
- taop = rmx_taop(rt->rt_rmx);
- /*
- * Offer == -1 means that we didn't receive SYN yet,
- * use cached value in that case;
- */
- if (offer == -1)
- offer = taop->tao_mssopt;
- /*
- * Offer == 0 means that there was no MSS on the SYN segment,
- * in this case we use tcp_mssdflt.
- */
- if (offer == 0)
- offer = tcp_mssdflt;
- else
- /*
- * Sanity check: make sure that maxopd will be large
- * enough to allow some data on segments even is the
- * all the option space is used (40bytes). Otherwise
- * funny things may happen in tcp_output.
- */
- offer = max(offer, 64);
- taop->tao_mssopt = offer;
-
- /*
- * While we're here, check if there's an initial rtt
- * or rttvar. Convert from the route-table units
- * to scaled multiples of the slow timeout timer.
- */
- if (tp->t_srtt == 0 && (rtt = rt->rt_rmx.rmx_rtt)) {
- /*
- * XXX the lock bit for RTT indicates that the value
- * is also a minimum value; this is subject to time.
- */
- if (rt->rt_rmx.rmx_locks & RTV_RTT)
- tp->t_rttmin = rtt / (RTM_RTTUNIT / PR_SLOWHZ);
- tp->t_srtt = rtt / (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTT_SCALE));
- tcpstat.tcps_usedrtt++;
- if (rt->rt_rmx.rmx_rttvar) {
- tp->t_rttvar = rt->rt_rmx.rmx_rttvar /
- (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTTVAR_SCALE));
- tcpstat.tcps_usedrttvar++;
- } else {
- /* default variation is +- 1 rtt */
- tp->t_rttvar =
- tp->t_srtt * TCP_RTTVAR_SCALE / TCP_RTT_SCALE;
- }
- TCPT_RANGESET(tp->t_rxtcur,
- ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1,
- tp->t_rttmin, TCPTV_REXMTMAX);
- }
- /*
- * if there's an mtu associated with the route, use it
- */
- if (rt->rt_rmx.rmx_mtu)
- mss = rt->rt_rmx.rmx_mtu - sizeof(struct tcpiphdr);
- else
- {
- mss = ifp->if_mtu - sizeof(struct tcpiphdr);
- if (!in_localaddr(inp->inp_faddr))
- mss = min(mss, tcp_mssdflt);
- }
- mss = min(mss, offer);
- /*
- * maxopd stores the maximum length of data AND options
- * in a segment; maxseg is the amount of data in a normal
- * segment. We need to store this value (maxopd) apart
- * from maxseg, because now every segment carries options
- * and thus we normally have somewhat less data in segments.
- */
- tp->t_maxopd = mss;
-
- /*
- * In case of T/TCP, origoffer==-1 indicates, that no segments
- * were received yet. In this case we just guess, otherwise
- * we do the same as before T/TCP.
- */
- if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP &&
- (origoffer == -1 ||
- (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP))
- mss -= TCPOLEN_TSTAMP_APPA;
- if ((tp->t_flags & (TF_REQ_CC|TF_NOOPT)) == TF_REQ_CC &&
- (origoffer == -1 ||
- (tp->t_flags & TF_RCVD_CC) == TF_RCVD_CC))
- mss -= TCPOLEN_CC_APPA;
-
-#if (MCLBYTES & (MCLBYTES - 1)) == 0
- if (mss > MCLBYTES)
- mss &= ~(MCLBYTES-1);
-#else
- if (mss > MCLBYTES)
- mss = mss / MCLBYTES * MCLBYTES;
-#endif
- /*
- * If there's a pipesize, change the socket buffer
- * to that size. Make the socket buffers an integral
- * number of mss units; if the mss is larger than
- * the socket buffer, decrease the mss.
- */
-#ifdef RTV_SPIPE
- if ((bufsize = rt->rt_rmx.rmx_sendpipe) == 0)
-#endif
- bufsize = so->so_snd.sb_hiwat;
- if (bufsize < mss)
- mss = bufsize;
- else {
- bufsize = roundup(bufsize, mss);
- if (bufsize > sb_max)
- bufsize = sb_max;
- (void)sbreserve(&so->so_snd, bufsize);
- }
- tp->t_maxseg = mss;
-
-#ifdef RTV_RPIPE
- if ((bufsize = rt->rt_rmx.rmx_recvpipe) == 0)
-#endif
- bufsize = so->so_rcv.sb_hiwat;
- if (bufsize > mss) {
- bufsize = roundup(bufsize, mss);
- if (bufsize > sb_max)
- bufsize = sb_max;
- (void)sbreserve(&so->so_rcv, bufsize);
- }
- /*
- * Don't force slow-start on local network.
- */
- if (!in_localaddr(inp->inp_faddr))
- tp->snd_cwnd = mss;
-
- if (rt->rt_rmx.rmx_ssthresh) {
- /*
- * There's some sort of gateway or interface
- * buffer limit on the path. Use this to set
- * the slow start threshhold, but set the
- * threshold to no less than 2*mss.
- */
- tp->snd_ssthresh = max(2 * mss, rt->rt_rmx.rmx_ssthresh);
- tcpstat.tcps_usedssthresh++;
- }
-}
-
-/*
- * Determine the MSS option to send on an outgoing SYN.
- */
-int
-tcp_mssopt(tp)
- struct tcpcb *tp;
-{
- struct rtentry *rt;
-
- rt = tcp_rtlookup(tp->t_inpcb);
- if (rt == NULL)
- return tcp_mssdflt;
-
- return rt->rt_ifp->if_mtu - sizeof(struct tcpiphdr);
-}
-#endif /* TUBA_INCLUDE */
diff --git a/c/src/libnetworking/netinet/tcp_output.c b/c/src/libnetworking/netinet/tcp_output.c
deleted file mode 100644
index cbb5218dce..0000000000
--- a/c/src/libnetworking/netinet/tcp_output.c
+++ /dev/null
@@ -1,755 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#define TCPOUTFLAGS
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-#ifdef notyet
-extern struct mbuf *m_copypack();
-#endif
-
-
-/*
- * Tcp output routine: figure out what should be sent and send it.
- */
-int
-tcp_output(tp)
- register struct tcpcb *tp;
-{
- register struct socket *so = tp->t_inpcb->inp_socket;
- register long len, win;
- int off, flags, error;
- register struct mbuf *m;
- register struct tcpiphdr *ti;
- u_char opt[TCP_MAXOLEN];
- unsigned optlen, hdrlen;
- int idle, sendalot;
- struct rmxp_tao *taop;
- struct rmxp_tao tao_noncached;
-
- /*
- * Determine length of data that should be transmitted,
- * and flags that will be used.
- * If there is some data or critical controls (SYN, RST)
- * to send, then transmit; otherwise, investigate further.
- */
- idle = (tp->snd_max == tp->snd_una);
- if (idle && tp->t_idle >= tp->t_rxtcur)
- /*
- * We have been idle for "a while" and no acks are
- * expected to clock out any data we send --
- * slow start to get ack "clock" running again.
- */
- tp->snd_cwnd = tp->t_maxseg;
-again:
- sendalot = 0;
- off = tp->snd_nxt - tp->snd_una;
- win = min(tp->snd_wnd, tp->snd_cwnd);
-
- flags = tcp_outflags[tp->t_state];
- /*
- * Get standard flags, and add SYN or FIN if requested by 'hidden'
- * state flags.
- */
- if (tp->t_flags & TF_NEEDFIN)
- flags |= TH_FIN;
- if (tp->t_flags & TF_NEEDSYN)
- flags |= TH_SYN;
-
- /*
- * If in persist timeout with window of 0, send 1 byte.
- * Otherwise, if window is small but nonzero
- * and timer expired, we will send what we can
- * and go to transmit state.
- */
- if (tp->t_force) {
- if (win == 0) {
- /*
- * If we still have some data to send, then
- * clear the FIN bit. Usually this would
- * happen below when it realizes that we
- * aren't sending all the data. However,
- * if we have exactly 1 byte of unset data,
- * then it won't clear the FIN bit below,
- * and if we are in persist state, we wind
- * up sending the packet without recording
- * that we sent the FIN bit.
- *
- * We can't just blindly clear the FIN bit,
- * because if we don't have any more data
- * to send then the probe will be the FIN
- * itself.
- */
- if (off < so->so_snd.sb_cc)
- flags &= ~TH_FIN;
- win = 1;
- } else {
- tp->t_timer[TCPT_PERSIST] = 0;
- tp->t_rxtshift = 0;
- }
- }
-
- len = min(so->so_snd.sb_cc, win) - off;
-
- if ((taop = tcp_gettaocache(tp->t_inpcb)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
-
- /*
- * Lop off SYN bit if it has already been sent. However, if this
- * is SYN-SENT state and if segment contains data and if we don't
- * know that foreign host supports TAO, suppress sending segment.
- */
- if ((flags & TH_SYN) && SEQ_GT(tp->snd_nxt, tp->snd_una)) {
- flags &= ~TH_SYN;
- off--, len++;
- if (len > 0 && tp->t_state == TCPS_SYN_SENT &&
- taop->tao_ccsent == 0)
- return 0;
- }
-
- /*
- * Be careful not to send data and/or FIN on SYN segments
- * in cases when no CC option will be sent.
- * This measure is needed to prevent interoperability problems
- * with not fully conformant TCP implementations.
- */
- if ((flags & TH_SYN) &&
- ((tp->t_flags & TF_NOOPT) || !(tp->t_flags & TF_REQ_CC) ||
- ((flags & TH_ACK) && !(tp->t_flags & TF_RCVD_CC)))) {
- len = 0;
- flags &= ~TH_FIN;
- }
-
- if (len < 0) {
- /*
- * If FIN has been sent but not acked,
- * but we haven't been called to retransmit,
- * len will be -1. Otherwise, window shrank
- * after we sent into it. If window shrank to 0,
- * cancel pending retransmit, pull snd_nxt back
- * to (closed) window, and set the persist timer
- * if it isn't already going. If the window didn't
- * close completely, just wait for an ACK.
- */
- len = 0;
- if (win == 0) {
- tp->t_timer[TCPT_REXMT] = 0;
- tp->t_rxtshift = 0;
- tp->snd_nxt = tp->snd_una;
- if (tp->t_timer[TCPT_PERSIST] == 0)
- tcp_setpersist(tp);
- }
- }
- if (len > tp->t_maxseg) {
- len = tp->t_maxseg;
- sendalot = 1;
- }
- if (SEQ_LT(tp->snd_nxt + len, tp->snd_una + so->so_snd.sb_cc))
- flags &= ~TH_FIN;
-
- win = sbspace(&so->so_rcv);
-
- /*
- * Sender silly window avoidance. If connection is idle
- * and can send all data, a maximum segment,
- * at least a maximum default-size segment do it,
- * or are forced, do it; otherwise don't bother.
- * If peer's buffer is tiny, then send
- * when window is at least half open.
- * If retransmitting (possibly after persist timer forced us
- * to send into a small window), then must resend.
- */
- if (len) {
- if (len == tp->t_maxseg)
- goto send;
- if ((idle || tp->t_flags & TF_NODELAY) &&
- (tp->t_flags & TF_NOPUSH) == 0 &&
- len + off >= so->so_snd.sb_cc)
- goto send;
- if (tp->t_force)
- goto send;
- if (len >= tp->max_sndwnd / 2 && tp->max_sndwnd > 0)
- goto send;
- if (SEQ_LT(tp->snd_nxt, tp->snd_max))
- goto send;
- }
-
- /*
- * Compare available window to amount of window
- * known to peer (as advertised window less
- * next expected input). If the difference is at least two
- * max size segments, or at least 50% of the maximum possible
- * window, then want to send a window update to peer.
- */
- if (win > 0) {
- /*
- * "adv" is the amount we can increase the window,
- * taking into account that we are limited by
- * TCP_MAXWIN << tp->rcv_scale.
- */
- long adv = min(win, (long)TCP_MAXWIN << tp->rcv_scale) -
- (tp->rcv_adv - tp->rcv_nxt);
-
- if (adv >= (long) (2 * tp->t_maxseg))
- goto send;
- if (2 * adv >= (long) so->so_rcv.sb_hiwat)
- goto send;
- }
-
- /*
- * Send if we owe peer an ACK.
- */
- if (tp->t_flags & TF_ACKNOW)
- goto send;
- if ((flags & TH_RST) ||
- ((flags & TH_SYN) && (tp->t_flags & TF_NEEDSYN) == 0))
- goto send;
- if (SEQ_GT(tp->snd_up, tp->snd_una))
- goto send;
- /*
- * If our state indicates that FIN should be sent
- * and we have not yet done so, or we're retransmitting the FIN,
- * then we need to send.
- */
- if (flags & TH_FIN &&
- ((tp->t_flags & TF_SENTFIN) == 0 || tp->snd_nxt == tp->snd_una))
- goto send;
-
- /*
- * TCP window updates are not reliable, rather a polling protocol
- * using ``persist'' packets is used to insure receipt of window
- * updates. The three ``states'' for the output side are:
- * idle not doing retransmits or persists
- * persisting to move a small or zero window
- * (re)transmitting and thereby not persisting
- *
- * tp->t_timer[TCPT_PERSIST]
- * is set when we are in persist state.
- * tp->t_force
- * is set when we are called to send a persist packet.
- * tp->t_timer[TCPT_REXMT]
- * is set when we are retransmitting
- * The output side is idle when both timers are zero.
- *
- * If send window is too small, there is data to transmit, and no
- * retransmit or persist is pending, then go to persist state.
- * If nothing happens soon, send when timer expires:
- * if window is nonzero, transmit what we can,
- * otherwise force out a byte.
- */
- if (so->so_snd.sb_cc && tp->t_timer[TCPT_REXMT] == 0 &&
- tp->t_timer[TCPT_PERSIST] == 0) {
- tp->t_rxtshift = 0;
- tcp_setpersist(tp);
- }
-
- /*
- * No reason to send a segment, just return.
- */
- return (0);
-
-send:
- /*
- * Before ESTABLISHED, force sending of initial options
- * unless TCP set not to do any options.
- * NOTE: we assume that the IP/TCP header plus TCP options
- * always fit in a single mbuf, leaving room for a maximum
- * link header, i.e.
- * max_linkhdr + sizeof (struct tcpiphdr) + optlen <= MHLEN
- */
- optlen = 0;
- hdrlen = sizeof (struct tcpiphdr);
- if (flags & TH_SYN) {
- tp->snd_nxt = tp->iss;
- if ((tp->t_flags & TF_NOOPT) == 0) {
- u_short mss;
-
- opt[0] = TCPOPT_MAXSEG;
- opt[1] = TCPOLEN_MAXSEG;
- mss = htons((u_short) tcp_mssopt(tp));
- (void)memcpy(opt + 2, &mss, sizeof(mss));
- optlen = TCPOLEN_MAXSEG;
-
- if ((tp->t_flags & TF_REQ_SCALE) &&
- ((flags & TH_ACK) == 0 ||
- (tp->t_flags & TF_RCVD_SCALE))) {
- *((u_long *) (opt + optlen)) = htonl(
- TCPOPT_NOP << 24 |
- TCPOPT_WINDOW << 16 |
- TCPOLEN_WINDOW << 8 |
- tp->request_r_scale);
- optlen += 4;
- }
- }
- }
-
- /*
- * Send a timestamp and echo-reply if this is a SYN and our side
- * wants to use timestamps (TF_REQ_TSTMP is set) or both our side
- * and our peer have sent timestamps in our SYN's.
- */
- if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP &&
- (flags & TH_RST) == 0 &&
- ((flags & TH_ACK) == 0 ||
- (tp->t_flags & TF_RCVD_TSTMP))) {
- u_long *lp = (u_long *)(opt + optlen);
-
- /* Form timestamp option as shown in appendix A of RFC 1323. */
- *lp++ = htonl(TCPOPT_TSTAMP_HDR);
- *lp++ = htonl(tcp_now);
- *lp = htonl(tp->ts_recent);
- optlen += TCPOLEN_TSTAMP_APPA;
- }
-
- /*
- * Send `CC-family' options if our side wants to use them (TF_REQ_CC),
- * options are allowed (!TF_NOOPT) and it's not a RST.
- */
- if ((tp->t_flags & (TF_REQ_CC|TF_NOOPT)) == TF_REQ_CC &&
- (flags & TH_RST) == 0) {
- switch (flags & (TH_SYN|TH_ACK)) {
- /*
- * This is a normal ACK, send CC if we received CC before
- * from our peer.
- */
- case TH_ACK:
- if (!(tp->t_flags & TF_RCVD_CC))
- break;
- /*FALLTHROUGH*/
-
- /*
- * We can only get here in T/TCP's SYN_SENT* state, when
- * we're a sending a non-SYN segment without waiting for
- * the ACK of our SYN. A check above assures that we only
- * do this if our peer understands T/TCP.
- */
- case 0:
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_CC;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] = htonl(tp->cc_send);
-
- optlen += 4;
- break;
-
- /*
- * This is our initial SYN, check whether we have to use
- * CC or CC.new.
- */
- case TH_SYN:
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = tp->t_flags & TF_SENDCCNEW ?
- TCPOPT_CCNEW : TCPOPT_CC;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] = htonl(tp->cc_send);
- optlen += 4;
- break;
-
- /*
- * This is a SYN,ACK; send CC and CC.echo if we received
- * CC from our peer.
- */
- case (TH_SYN|TH_ACK):
- if (tp->t_flags & TF_RCVD_CC) {
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_CC;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] =
- htonl(tp->cc_send);
- optlen += 4;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_CCECHO;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] =
- htonl(tp->cc_recv);
- optlen += 4;
- }
- break;
- }
- }
-
- hdrlen += optlen;
-
- /*
- * Adjust data length if insertion of options will
- * bump the packet length beyond the t_maxopd length.
- * Clear the FIN bit because we cut off the tail of
- * the segment.
- */
- if (len + optlen > tp->t_maxopd) {
- /*
- * If there is still more to send, don't close the connection.
- */
- flags &= ~TH_FIN;
- len = tp->t_maxopd - optlen;
- sendalot = 1;
- }
-
-/*#ifdef DIAGNOSTIC*/
- if (max_linkhdr + hdrlen > MHLEN)
- panic("tcphdr too big");
-/*#endif*/
-
- /*
- * Grab a header mbuf, attaching a copy of data to
- * be transmitted, and initialize the header from
- * the template for sends on this connection.
- */
- if (len) {
- if (tp->t_force && len == 1)
- tcpstat.tcps_sndprobe++;
- else if (SEQ_LT(tp->snd_nxt, tp->snd_max)) {
- tcpstat.tcps_sndrexmitpack++;
- tcpstat.tcps_sndrexmitbyte += len;
- } else {
- tcpstat.tcps_sndpack++;
- tcpstat.tcps_sndbyte += len;
- }
-#ifdef notyet
- if ((m = m_copypack(so->so_snd.sb_mb, off,
- (int)len, max_linkhdr + hdrlen)) == 0) {
- error = ENOBUFS;
- goto out;
- }
- /*
- * m_copypack left space for our hdr; use it.
- */
- m->m_len += hdrlen;
- m->m_data -= hdrlen;
-#else
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- }
- m->m_data += max_linkhdr;
- m->m_len = hdrlen;
- if (len <= MHLEN - hdrlen - max_linkhdr) {
- m_copydata(so->so_snd.sb_mb, off, (int) len,
- mtod(m, caddr_t) + hdrlen);
- m->m_len += len;
- } else {
- m->m_next = m_copy(so->so_snd.sb_mb, off, (int) len);
- if (m->m_next == 0) {
- (void) m_free(m);
- error = ENOBUFS;
- goto out;
- }
- }
-#endif
- /*
- * If we're sending everything we've got, set PUSH.
- * (This will keep happy those implementations which only
- * give data to the user when a buffer fills or
- * a PUSH comes in.)
- */
- if (off + len == so->so_snd.sb_cc)
- flags |= TH_PUSH;
- } else {
- if (tp->t_flags & TF_ACKNOW)
- tcpstat.tcps_sndacks++;
- else if (flags & (TH_SYN|TH_FIN|TH_RST))
- tcpstat.tcps_sndctrl++;
- else if (SEQ_GT(tp->snd_up, tp->snd_una))
- tcpstat.tcps_sndurg++;
- else
- tcpstat.tcps_sndwinup++;
-
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- }
- m->m_data += max_linkhdr;
- m->m_len = hdrlen;
- }
- m->m_pkthdr.rcvif = (struct ifnet *)0;
- ti = mtod(m, struct tcpiphdr *);
- if (tp->t_template == 0)
- panic("tcp_output");
- (void)memcpy(ti, tp->t_template, sizeof (struct tcpiphdr));
-
- /*
- * Fill in fields, remembering maximum advertised
- * window for use in delaying messages about window sizes.
- * If resending a FIN, be sure not to use a new sequence number.
- */
- if (flags & TH_FIN && tp->t_flags & TF_SENTFIN &&
- tp->snd_nxt == tp->snd_max)
- tp->snd_nxt--;
- /*
- * If we are doing retransmissions, then snd_nxt will
- * not reflect the first unsent octet. For ACK only
- * packets, we do not want the sequence number of the
- * retransmitted packet, we want the sequence number
- * of the next unsent octet. So, if there is no data
- * (and no SYN or FIN), use snd_max instead of snd_nxt
- * when filling in ti_seq. But if we are in persist
- * state, snd_max might reflect one byte beyond the
- * right edge of the window, so use snd_nxt in that
- * case, since we know we aren't doing a retransmission.
- * (retransmit and persist are mutually exclusive...)
- */
- if (len || (flags & (TH_SYN|TH_FIN)) || tp->t_timer[TCPT_PERSIST])
- ti->ti_seq = htonl(tp->snd_nxt);
- else
- ti->ti_seq = htonl(tp->snd_max);
- ti->ti_ack = htonl(tp->rcv_nxt);
- if (optlen) {
- bcopy(opt, ti + 1, optlen);
- ti->ti_off = (sizeof (struct tcphdr) + optlen) >> 2;
- }
- ti->ti_flags = flags;
- /*
- * Calculate receive window. Don't shrink window,
- * but avoid silly window syndrome.
- */
- if (win < (long)(so->so_rcv.sb_hiwat / 4) && win < (long)tp->t_maxseg)
- win = 0;
- if (win < (long)(tp->rcv_adv - tp->rcv_nxt))
- win = (long)(tp->rcv_adv - tp->rcv_nxt);
- if (win > (long)TCP_MAXWIN << tp->rcv_scale)
- win = (long)TCP_MAXWIN << tp->rcv_scale;
- ti->ti_win = htons((u_short) (win>>tp->rcv_scale));
- if (SEQ_GT(tp->snd_up, tp->snd_nxt)) {
- ti->ti_urp = htons((u_short)(tp->snd_up - tp->snd_nxt));
- ti->ti_flags |= TH_URG;
- } else
- /*
- * If no urgent pointer to send, then we pull
- * the urgent pointer to the left edge of the send window
- * so that it doesn't drift into the send window on sequence
- * number wraparound.
- */
- tp->snd_up = tp->snd_una; /* drag it along */
-
- /*
- * Put TCP length in extended header, and then
- * checksum extended header and data.
- */
- if (len + optlen)
- ti->ti_len = htons((u_short)(sizeof (struct tcphdr) +
- optlen + len));
- ti->ti_sum = in_cksum(m, (int)(hdrlen + len));
-
- /*
- * In transmit state, time the transmission and arrange for
- * the retransmit. In persist state, just set snd_max.
- */
- if (tp->t_force == 0 || tp->t_timer[TCPT_PERSIST] == 0) {
- tcp_seq startseq = tp->snd_nxt;
-
- /*
- * Advance snd_nxt over sequence space of this segment.
- */
- if (flags & (TH_SYN|TH_FIN)) {
- if (flags & TH_SYN)
- tp->snd_nxt++;
- if (flags & TH_FIN) {
- tp->snd_nxt++;
- tp->t_flags |= TF_SENTFIN;
- }
- }
- tp->snd_nxt += len;
- if (SEQ_GT(tp->snd_nxt, tp->snd_max)) {
- tp->snd_max = tp->snd_nxt;
- /*
- * Time this transmission if not a retransmission and
- * not currently timing anything.
- */
- if (tp->t_rtt == 0) {
- tp->t_rtt = 1;
- tp->t_rtseq = startseq;
- tcpstat.tcps_segstimed++;
- }
- }
-
- /*
- * Set retransmit timer if not currently set,
- * and not doing an ack or a keep-alive probe.
- * Initial value for retransmit timer is smoothed
- * round-trip time + 2 * round-trip time variance.
- * Initialize shift counter which is used for backoff
- * of retransmit time.
- */
- if (tp->t_timer[TCPT_REXMT] == 0 &&
- tp->snd_nxt != tp->snd_una) {
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
- if (tp->t_timer[TCPT_PERSIST]) {
- tp->t_timer[TCPT_PERSIST] = 0;
- tp->t_rxtshift = 0;
- }
- }
- } else
- if (SEQ_GT(tp->snd_nxt + len, tp->snd_max))
- tp->snd_max = tp->snd_nxt + len;
-
-#ifdef TCPDEBUG
- /*
- * Trace.
- */
- if (so->so_options & SO_DEBUG)
- tcp_trace(TA_OUTPUT, tp->t_state, tp, ti, 0);
-#endif
-
- /*
- * Fill in IP length and desired time to live and
- * send to IP level. There should be a better way
- * to handle ttl and tos; we could keep them in
- * the template, but need a way to checksum without them.
- */
- m->m_pkthdr.len = hdrlen + len;
-#ifdef TUBA
- if (tp->t_tuba_pcb)
- error = tuba_output(m, tp);
- else
-#endif
- {
-#if 1
- struct rtentry *rt;
-#endif
- ((struct ip *)ti)->ip_len = m->m_pkthdr.len;
- ((struct ip *)ti)->ip_ttl = tp->t_inpcb->inp_ip_ttl; /* XXX */
- ((struct ip *)ti)->ip_tos = tp->t_inpcb->inp_ip_tos; /* XXX */
-#if 1
- /*
- * See if we should do MTU discovery. We do it only if the following
- * are true:
- * 1) we have a valid route to the destination
- * 2) the MTU is not locked (if it is, then discovery has been
- * disabled)
- */
- if ((rt = tp->t_inpcb->inp_route.ro_rt)
- && rt->rt_flags & RTF_UP
- && !(rt->rt_rmx.rmx_locks & RTV_MTU)) {
- ((struct ip *)ti)->ip_off |= IP_DF;
- }
-#endif
- error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route,
- so->so_options & SO_DONTROUTE, 0);
- }
- if (error) {
-out:
- if (error == ENOBUFS) {
- tcp_quench(tp->t_inpcb, 0);
- return (0);
- }
-#if 1
- if (error == EMSGSIZE) {
- /*
- * ip_output() will have already fixed the route
- * for us. tcp_mtudisc() will, as its last action,
- * initiate retransmission, so it is important to
- * not do so here.
- */
- tcp_mtudisc(tp->t_inpcb, 0);
- return 0;
- }
-#endif
- if ((error == EHOSTUNREACH || error == ENETDOWN)
- && TCPS_HAVERCVDSYN(tp->t_state)) {
- tp->t_softerror = error;
- return (0);
- }
- return (error);
- }
- tcpstat.tcps_sndtotal++;
-
- /*
- * Data sent (as far as we can tell).
- * If this advertises a larger window than any other segment,
- * then remember the size of the advertised window.
- * Any pending ACK has now been sent.
- */
- if (win > 0 && SEQ_GT(tp->rcv_nxt+win, tp->rcv_adv))
- tp->rcv_adv = tp->rcv_nxt + win;
- tp->last_ack_sent = tp->rcv_nxt;
- tp->t_flags &= ~(TF_ACKNOW|TF_DELACK);
- if (sendalot)
- goto again;
- return (0);
-}
-
-void
-tcp_setpersist(tp)
- register struct tcpcb *tp;
-{
- register int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1;
-
- if (tp->t_timer[TCPT_REXMT])
- panic("tcp_output REXMT");
- /*
- * Start/restart persistance timer.
- */
- TCPT_RANGESET(tp->t_timer[TCPT_PERSIST],
- t * tcp_backoff[tp->t_rxtshift],
- TCPTV_PERSMIN, TCPTV_PERSMAX);
- if (tp->t_rxtshift < TCP_MAXRXTSHIFT)
- tp->t_rxtshift++;
-}
diff --git a/c/src/libnetworking/netinet/tcp_seq.h b/c/src/libnetworking/netinet/tcp_seq.h
deleted file mode 100644
index 8cccf199e1..0000000000
--- a/c/src/libnetworking/netinet/tcp_seq.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993, 1995
- * 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.
- *
- * @(#)tcp_seq.h 8.3 (Berkeley) 6/21/95
- * $Id$
- */
-
-#ifndef _NETINET_TCP_SEQ_H_
-#define _NETINET_TCP_SEQ_H_
-/*
- * TCP sequence numbers are 32 bit integers operated
- * on with modular arithmetic. These macros can be
- * used to compare such integers.
- */
-#define SEQ_LT(a,b) ((int)((a)-(b)) < 0)
-#define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0)
-#define SEQ_GT(a,b) ((int)((a)-(b)) > 0)
-#define SEQ_GEQ(a,b) ((int)((a)-(b)) >= 0)
-
-/* for modulo comparisons of timestamps */
-#define TSTMP_LT(a,b) ((int)((a)-(b)) < 0)
-#define TSTMP_GEQ(a,b) ((int)((a)-(b)) >= 0)
-
-/*
- * TCP connection counts are 32 bit integers operated
- * on with modular arithmetic. These macros can be
- * used to compare such integers.
- */
-#define CC_LT(a,b) ((int)((a)-(b)) < 0)
-#define CC_LEQ(a,b) ((int)((a)-(b)) <= 0)
-#define CC_GT(a,b) ((int)((a)-(b)) > 0)
-#define CC_GEQ(a,b) ((int)((a)-(b)) >= 0)
-
-/* Macro to increment a CC: skip 0 which has a special meaning */
-#define CC_INC(c) (++(c) == 0 ? ++(c) : (c))
-
-/*
- * Macros to initialize tcp sequence numbers for
- * send and receive from initial send and receive
- * sequence numbers.
- */
-#define tcp_rcvseqinit(tp) \
- (tp)->rcv_adv = (tp)->rcv_nxt = (tp)->irs + 1
-
-#define tcp_sendseqinit(tp) \
- (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \
- (tp)->iss
-
-#define TCP_PAWS_IDLE (24 * 24 * 60 * 60 * PR_SLOWHZ)
- /* timestamp wrap-around time */
-
-#ifdef KERNEL
-extern tcp_cc tcp_ccgen; /* global connection count */
-
-/*
- * Increment for tcp_iss each second.
- * This is designed to increment at the standard 250 KB/s,
- * but with a random component averaging 128 KB.
- * We also increment tcp_iss by a quarter of this amount
- * each time we use the value for a new connection.
- * If defined, the tcp_random18() macro should produce a
- * number in the range [0-0x3ffff] that is hard to predict.
- */
-#ifndef tcp_random18
-#define tcp_random18() ((random() >> 14) & 0x3ffff)
-#endif
-#define TCP_ISSINCR (122*1024 + tcp_random18())
-
-extern tcp_seq tcp_iss; /* tcp initial send seq # */
-#else
-#define TCP_ISSINCR (250*1024) /* increment for tcp_iss each second */
-#endif /* KERNEL */
-#endif /* _NETINET_TCP_SEQ_H_ */
diff --git a/c/src/libnetworking/netinet/tcp_subr.c b/c/src/libnetworking/netinet/tcp_subr.c
deleted file mode 100644
index a9cde3fdf0..0000000000
--- a/c/src/libnetworking/netinet/tcp_subr.c
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/proc.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <net/route.h>
-#include <net/if.h>
-
-#define _IP_VHL
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-int tcp_mssdflt = TCP_MSS;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt,
- CTLFLAG_RW, &tcp_mssdflt , 0, "");
-
-static int tcp_do_rfc1323 = 1;
-static int tcp_do_rfc1644 = 1;
-#if !defined(__rtems__)
-static int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_RTTDFLT, rttdflt,
- CTLFLAG_RW, &tcp_rttdflt , 0, "");
-
-SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323,
- CTLFLAG_RW, &tcp_do_rfc1323 , 0, "");
-
-SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1644, rfc1644,
- CTLFLAG_RW, &tcp_do_rfc1644 , 0, "");
-#endif
-
-static void tcp_cleartaocache(void);
-static void tcp_notify __P((struct inpcb *, int));
-
-/*
- * Target size of TCP PCB hash table. Will be rounded down to a prime
- * number.
- */
-#ifndef TCBHASHSIZE
-#define TCBHASHSIZE 128
-#endif
-
-/*
- * Tcp initialization
- */
-void
-tcp_init()
-{
-
- tcp_iss = random(); /* wrong, but better than a constant */
- tcp_ccgen = 1;
- tcp_cleartaocache();
- LIST_INIT(&tcb);
- tcbinfo.listhead = &tcb;
- tcbinfo.hashbase = hashinit(TCBHASHSIZE, M_PCB, &tcbinfo.hashmask);
- if (max_protohdr < sizeof(struct tcpiphdr))
- max_protohdr = sizeof(struct tcpiphdr);
- if (max_linkhdr + sizeof(struct tcpiphdr) > MHLEN)
- panic("tcp_init");
-}
-
-/*
- * Create template to be used to send tcp packets on a connection.
- * Call after host entry created, allocates an mbuf and fills
- * in a skeletal tcp/ip header, minimizing the amount of work
- * necessary when the connection is used.
- */
-struct tcpiphdr *
-tcp_template(tp)
- struct tcpcb *tp;
-{
- register struct inpcb *inp = tp->t_inpcb;
- register struct mbuf *m;
- register struct tcpiphdr *n;
-
- if ((n = tp->t_template) == 0) {
- m = m_get(M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- return (0);
- m->m_len = sizeof (struct tcpiphdr);
- n = mtod(m, struct tcpiphdr *);
- }
- n->ti_next = n->ti_prev = 0;
- n->ti_x1 = 0;
- n->ti_pr = IPPROTO_TCP;
- n->ti_len = htons(sizeof (struct tcpiphdr) - sizeof (struct ip));
- n->ti_src = inp->inp_laddr;
- n->ti_dst = inp->inp_faddr;
- n->ti_sport = inp->inp_lport;
- n->ti_dport = inp->inp_fport;
- n->ti_seq = 0;
- n->ti_ack = 0;
- n->ti_x2 = 0;
- n->ti_off = 5;
- n->ti_flags = 0;
- n->ti_win = 0;
- n->ti_sum = 0;
- n->ti_urp = 0;
- return (n);
-}
-
-/*
- * Send a single message to the TCP at address specified by
- * the given TCP/IP header. If m == 0, then we make a copy
- * of the tcpiphdr at ti and send directly to the addressed host.
- * This is used to force keep alive messages out using the TCP
- * template for a connection tp->t_template. If flags are given
- * then we send a message back to the TCP which originated the
- * segment ti, and discard the mbuf containing it and any other
- * attached mbufs.
- *
- * In any case the ack and sequence number of the transmitted
- * segment are as specified by the parameters.
- *
- * NOTE: If m != NULL, then ti must point to *inside* the mbuf.
- */
-void
-tcp_respond(tp, ti, m, ack, seq, flags)
- struct tcpcb *tp;
- register struct tcpiphdr *ti;
- register struct mbuf *m;
- tcp_seq ack, seq;
- int flags;
-{
- register int tlen;
- int win = 0;
- struct route *ro = 0;
- struct route sro;
-
- if (tp) {
- win = sbspace(&tp->t_inpcb->inp_socket->so_rcv);
- ro = &tp->t_inpcb->inp_route;
- } else {
- ro = &sro;
- bzero(ro, sizeof *ro);
- }
- if (m == 0) {
- m = m_gethdr(M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- return;
-#ifdef TCP_COMPAT_42
- tlen = 1;
-#else
- tlen = 0;
-#endif
- m->m_data += max_linkhdr;
- *mtod(m, struct tcpiphdr *) = *ti;
- ti = mtod(m, struct tcpiphdr *);
- flags = TH_ACK;
- } else {
- m_freem(m->m_next);
- m->m_next = 0;
- m->m_data = (caddr_t)ti;
- m->m_len = sizeof (struct tcpiphdr);
- tlen = 0;
-#define xchg(a,b,type) { type t; t=a; a=b; b=t; }
- xchg(ti->ti_dst.s_addr, ti->ti_src.s_addr, u_long);
- xchg(ti->ti_dport, ti->ti_sport, u_short);
-#undef xchg
- }
- ti->ti_len = htons((u_short)(sizeof (struct tcphdr) + tlen));
- tlen += sizeof (struct tcpiphdr);
- m->m_len = tlen;
- m->m_pkthdr.len = tlen;
- m->m_pkthdr.rcvif = (struct ifnet *) 0;
- ti->ti_next = ti->ti_prev = 0;
- ti->ti_x1 = 0;
- ti->ti_seq = htonl(seq);
- ti->ti_ack = htonl(ack);
- ti->ti_x2 = 0;
- ti->ti_off = sizeof (struct tcphdr) >> 2;
- ti->ti_flags = flags;
- if (tp)
- ti->ti_win = htons((u_short) (win >> tp->rcv_scale));
- else
- ti->ti_win = htons((u_short)win);
- ti->ti_urp = 0;
- ti->ti_sum = 0;
- ti->ti_sum = in_cksum(m, tlen);
- ((struct ip *)ti)->ip_len = tlen;
- ((struct ip *)ti)->ip_ttl = ip_defttl;
-#ifdef TCPDEBUG
- if (tp == NULL || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
- tcp_trace(TA_OUTPUT, 0, tp, ti, 0);
-#endif
- (void) ip_output(m, NULL, ro, 0, NULL);
- if (ro == &sro && ro->ro_rt) {
- RTFREE(ro->ro_rt);
- }
-}
-
-/*
- * Create a new TCP control block, making an
- * empty reassembly queue and hooking it to the argument
- * protocol control block.
- */
-struct tcpcb *
-tcp_newtcpcb(inp)
- struct inpcb *inp;
-{
- register struct tcpcb *tp;
-
- tp = malloc(sizeof(*tp), M_PCB, M_NOWAIT);
- if (tp == NULL)
- return ((struct tcpcb *)0);
- bzero((char *) tp, sizeof(struct tcpcb));
- tp->seg_next = tp->seg_prev = (struct tcpiphdr *)tp;
- tp->t_maxseg = tp->t_maxopd = tcp_mssdflt;
-
- if (tcp_do_rfc1323)
- tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP);
- if (tcp_do_rfc1644)
- tp->t_flags |= TF_REQ_CC;
- tp->t_inpcb = inp;
- /*
- * Init srtt to TCPTV_SRTTBASE (0), so we can tell that we have no
- * rtt estimate. Set rttvar so that srtt + 4 * rttvar gives
- * reasonable initial retransmit time.
- */
- tp->t_srtt = TCPTV_SRTTBASE;
- tp->t_rttvar = ((TCPTV_RTOBASE - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4;
- tp->t_rttmin = TCPTV_MIN;
- tp->t_rxtcur = TCPTV_RTOBASE;
- tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT;
- tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT;
- inp->inp_ip_ttl = ip_defttl;
- inp->inp_ppcb = (caddr_t)tp;
- return (tp);
-}
-
-/*
- * Drop a TCP connection, reporting
- * the specified error. If connection is synchronized,
- * then send a RST to peer.
- */
-struct tcpcb *
-tcp_drop(tp, errnum)
- register struct tcpcb *tp;
- int errnum;
-{
- struct socket *so = tp->t_inpcb->inp_socket;
-
- if (TCPS_HAVERCVDSYN(tp->t_state)) {
- tp->t_state = TCPS_CLOSED;
- (void) tcp_output(tp);
- tcpstat.tcps_drops++;
- } else
- tcpstat.tcps_conndrops++;
- if (errnum == ETIMEDOUT && tp->t_softerror)
- errnum = tp->t_softerror;
- so->so_error = errnum;
- return (tcp_close(tp));
-}
-
-/*
- * Close a TCP control block:
- * discard all space held by the tcp
- * discard internet protocol block
- * wake up any sleepers
- */
-struct tcpcb *
-tcp_close(tp)
- register struct tcpcb *tp;
-{
- register struct tcpiphdr *t;
- struct inpcb *inp = tp->t_inpcb;
- struct socket *so = inp->inp_socket;
- register struct mbuf *m;
- register struct rtentry *rt;
-
- /*
- * If we got enough samples through the srtt filter,
- * save the rtt and rttvar in the routing entry.
- * 'Enough' is arbitrarily defined as the 16 samples.
- * 16 samples is enough for the srtt filter to converge
- * to within 5% of the correct value; fewer samples and
- * we could save a very bogus rtt.
- *
- * Don't update the default route's characteristics and don't
- * update anything that the user "locked".
- */
- if (tp->t_rttupdated >= 16 &&
- (rt = inp->inp_route.ro_rt) &&
- ((struct sockaddr_in *)rt_key(rt))->sin_addr.s_addr != INADDR_ANY) {
- register u_long i = 0;
-
- if ((rt->rt_rmx.rmx_locks & RTV_RTT) == 0) {
- i = tp->t_srtt *
- (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTT_SCALE));
- if (rt->rt_rmx.rmx_rtt && i)
- /*
- * filter this update to half the old & half
- * the new values, converting scale.
- * See route.h and tcp_var.h for a
- * description of the scaling constants.
- */
- rt->rt_rmx.rmx_rtt =
- (rt->rt_rmx.rmx_rtt + i) / 2;
- else
- rt->rt_rmx.rmx_rtt = i;
- tcpstat.tcps_cachedrtt++;
- }
- if ((rt->rt_rmx.rmx_locks & RTV_RTTVAR) == 0) {
- i = tp->t_rttvar *
- (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTTVAR_SCALE));
- if (rt->rt_rmx.rmx_rttvar && i)
- rt->rt_rmx.rmx_rttvar =
- (rt->rt_rmx.rmx_rttvar + i) / 2;
- else
- rt->rt_rmx.rmx_rttvar = i;
- tcpstat.tcps_cachedrttvar++;
- }
- /*
- * update the pipelimit (ssthresh) if it has been updated
- * already or if a pipesize was specified & the threshhold
- * got below half the pipesize. I.e., wait for bad news
- * before we start updating, then update on both good
- * and bad news.
- */
- if (((rt->rt_rmx.rmx_locks & RTV_SSTHRESH) == 0 &&
- ((i = tp->snd_ssthresh) != 0) && rt->rt_rmx.rmx_ssthresh) ||
- i < (rt->rt_rmx.rmx_sendpipe / 2)) {
- /*
- * convert the limit from user data bytes to
- * packets then to packet data bytes.
- */
- i = (i + tp->t_maxseg / 2) / tp->t_maxseg;
- if (i < 2)
- i = 2;
- i *= (u_long)(tp->t_maxseg + sizeof (struct tcpiphdr));
- if (rt->rt_rmx.rmx_ssthresh)
- rt->rt_rmx.rmx_ssthresh =
- (rt->rt_rmx.rmx_ssthresh + i) / 2;
- else
- rt->rt_rmx.rmx_ssthresh = i;
- tcpstat.tcps_cachedssthresh++;
- }
- }
- /* free the reassembly queue, if any */
- t = tp->seg_next;
- while (t != (struct tcpiphdr *)tp) {
- t = (struct tcpiphdr *)t->ti_next;
- m = REASS_MBUF((struct tcpiphdr *)t->ti_prev);
- remque(t->ti_prev);
- m_freem(m);
- }
- if (tp->t_template)
- (void) m_free(dtom(tp->t_template));
- free(tp, M_PCB);
- inp->inp_ppcb = 0;
- soisdisconnected(so);
- in_pcbdetach(inp);
- tcpstat.tcps_closed++;
- return ((struct tcpcb *)0);
-}
-
-void
-tcp_drain()
-{
-
-}
-
-/*
- * Notify a tcp user of an asynchronous error;
- * store error as soft error, but wake up user
- * (for now, won't do anything until can select for soft error).
- */
-static void
-tcp_notify(inp, error)
- struct inpcb *inp;
- int error;
-{
- register struct tcpcb *tp = (struct tcpcb *)inp->inp_ppcb;
- register struct socket *so = inp->inp_socket;
-
- /*
- * Ignore some errors if we are hooked up.
- * If connection hasn't completed, has retransmitted several times,
- * and receives a second error, give up now. This is better
- * than waiting a long time to establish a connection that
- * can never complete.
- */
- if (tp->t_state == TCPS_ESTABLISHED &&
- (error == EHOSTUNREACH || error == ENETUNREACH ||
- error == EHOSTDOWN)) {
- return;
- } else if (tp->t_state < TCPS_ESTABLISHED && tp->t_rxtshift > 3 &&
- tp->t_softerror)
- so->so_error = error;
- else
- tp->t_softerror = error;
- soconnwakeup (so);
- sorwakeup(so);
- sowwakeup(so);
-}
-
-void
-tcp_ctlinput(cmd, sa, vip)
- int cmd;
- struct sockaddr *sa;
- void *vip;
-{
- register struct ip *ip = vip;
- register struct tcphdr *th;
- void (*notify) __P((struct inpcb *, int)) = tcp_notify;
-
- if (cmd == PRC_QUENCH)
- notify = tcp_quench;
-#if 1
- else if (cmd == PRC_MSGSIZE)
- notify = tcp_mtudisc;
-#endif
- else if (!PRC_IS_REDIRECT(cmd) &&
- ((unsigned)cmd > PRC_NCMDS || inetctlerrmap[cmd] == 0))
- return;
- if (ip) {
- th = (struct tcphdr *)((caddr_t)ip
- + (IP_VHL_HL(ip->ip_vhl) << 2));
- in_pcbnotify(&tcb, sa, th->th_dport, ip->ip_src, th->th_sport,
- cmd, notify);
- } else
- in_pcbnotify(&tcb, sa, 0, zeroin_addr, 0, cmd, notify);
-}
-
-/*
- * When a source quench is received, close congestion window
- * to one segment. We will gradually open it again as we proceed.
- */
-void
-tcp_quench(inp, errnum)
- struct inpcb *inp;
- int errnum;
-{
- struct tcpcb *tp = intotcpcb(inp);
-
- if (tp)
- tp->snd_cwnd = tp->t_maxseg;
-}
-
-#if 1
-/*
- * When `need fragmentation' ICMP is received, update our idea of the MSS
- * based on the new value in the route. Also nudge TCP to send something,
- * since we know the packet we just sent was dropped.
- * This duplicates some code in the tcp_mss() function in tcp_input.c.
- */
-void
-tcp_mtudisc(inp, errnum)
- struct inpcb *inp;
- int errnum;
-{
- struct tcpcb *tp = intotcpcb(inp);
- struct rtentry *rt;
- struct rmxp_tao *taop;
- struct socket *so = inp->inp_socket;
- int offered;
- int mss;
-
- if (tp) {
- rt = tcp_rtlookup(inp);
- if (!rt || !rt->rt_rmx.rmx_mtu) {
- tp->t_maxopd = tp->t_maxseg = tcp_mssdflt;
- return;
- }
- taop = rmx_taop(rt->rt_rmx);
- offered = taop->tao_mssopt;
- mss = rt->rt_rmx.rmx_mtu - sizeof(struct tcpiphdr);
- if (offered)
- mss = min(mss, offered);
- /*
- * XXX - The above conditional probably violates the TCP
- * spec. The problem is that, since we don't know the
- * other end's MSS, we are supposed to use a conservative
- * default. But, if we do that, then MTU discovery will
- * never actually take place, because the conservative
- * default is much less than the MTUs typically seen
- * on the Internet today. For the moment, we'll sweep
- * this under the carpet.
- *
- * The conservative default might not actually be a problem
- * if the only case this occurs is when sending an initial
- * SYN with options and data to a host we've never talked
- * to before. Then, they will reply with an MSS value which
- * will get recorded and the new parameters should get
- * recomputed. For Further Study.
- */
- if (tp->t_maxopd <= mss)
- return;
- tp->t_maxopd = mss;
-
- if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP &&
- (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP)
- mss -= TCPOLEN_TSTAMP_APPA;
- if ((tp->t_flags & (TF_REQ_CC|TF_NOOPT)) == TF_REQ_CC &&
- (tp->t_flags & TF_RCVD_CC) == TF_RCVD_CC)
- mss -= TCPOLEN_CC_APPA;
-#if (MCLBYTES & (MCLBYTES - 1)) == 0
- if (mss > MCLBYTES)
- mss &= ~(MCLBYTES-1);
-#else
- if (mss > MCLBYTES)
- mss = mss / MCLBYTES * MCLBYTES;
-#endif
- if (so->so_snd.sb_hiwat < mss)
- mss = so->so_snd.sb_hiwat;
-
- tp->t_maxseg = mss;
-
- tcpstat.tcps_mturesent++;
- tp->t_rtt = 0;
- tp->snd_nxt = tp->snd_una;
- tcp_output(tp);
- }
-}
-#endif
-
-/*
- * Look-up the routing entry to the peer of this inpcb. If no route
- * is found and it cannot be allocated the return NULL. This routine
- * is called by TCP routines that access the rmx structure and by tcp_mss
- * to get the interface MTU.
- */
-struct rtentry *
-tcp_rtlookup(inp)
- struct inpcb *inp;
-{
- struct route *ro;
- struct rtentry *rt;
-
- ro = &inp->inp_route;
- rt = ro->ro_rt;
- if (rt == NULL || !(rt->rt_flags & RTF_UP)) {
- /* No route yet, so try to acquire one */
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- ro->ro_dst.sa_family = AF_INET;
- ro->ro_dst.sa_len = sizeof(ro->ro_dst);
- ((struct sockaddr_in *) &ro->ro_dst)->sin_addr =
- inp->inp_faddr;
- rtalloc(ro);
- rt = ro->ro_rt;
- }
- }
- return rt;
-}
-
-/*
- * Return a pointer to the cached information about the remote host.
- * The cached information is stored in the protocol specific part of
- * the route metrics.
- */
-struct rmxp_tao *
-tcp_gettaocache(inp)
- struct inpcb *inp;
-{
- struct rtentry *rt = tcp_rtlookup(inp);
-
- /* Make sure this is a host route and is up. */
- if (rt == NULL ||
- (rt->rt_flags & (RTF_UP|RTF_HOST)) != (RTF_UP|RTF_HOST))
- return NULL;
-
- return rmx_taop(rt->rt_rmx);
-}
-
-/*
- * Clear all the TAO cache entries, called from tcp_init.
- *
- * XXX
- * This routine is just an empty one, because we assume that the routing
- * routing tables are initialized at the same time when TCP, so there is
- * nothing in the cache left over.
- */
-static void
-tcp_cleartaocache(void)
-{ }
diff --git a/c/src/libnetworking/netinet/tcp_timer.c b/c/src/libnetworking/netinet/tcp_timer.c
deleted file mode 100644
index 04d3d604e2..0000000000
--- a/c/src/libnetworking/netinet/tcp_timer.c
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#ifndef TUBA_INCLUDE
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-int tcp_keepinit = TCPTV_KEEP_INIT;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit,
- CTLFLAG_RW, &tcp_keepinit , 0, "");
-
-int tcp_keepidle = TCPTV_KEEP_IDLE;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPIDLE, keepidle,
- CTLFLAG_RW, &tcp_keepidle , 0, "");
-
-static int tcp_keepintvl = TCPTV_KEEPINTVL;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPINTVL, keepintvl,
- CTLFLAG_RW, &tcp_keepintvl , 0, "");
-
-static int always_keepalive = 0;
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive,
- CTLFLAG_RW, &always_keepalive , 0, "");
-
-static int tcp_keepcnt = TCPTV_KEEPCNT;
- /* max idle probes */
-static int tcp_maxpersistidle = TCPTV_KEEP_IDLE;
- /* max idle time in persist */
-int tcp_maxidle;
-#else /* TUBA_INCLUDE */
-
-static int tcp_maxpersistidle;
-#endif /* TUBA_INCLUDE */
-
-/*
- * Fast timeout routine for processing delayed acks
- */
-void
-tcp_fasttimo()
-{
- register struct inpcb *inp;
- register struct tcpcb *tp;
- int s;
-
- s = splnet();
-
- for (inp = tcb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if ((tp = (struct tcpcb *)inp->inp_ppcb) &&
- (tp->t_flags & TF_DELACK)) {
- tp->t_flags &= ~TF_DELACK;
- tp->t_flags |= TF_ACKNOW;
- tcpstat.tcps_delack++;
- (void) tcp_output(tp);
- }
- }
- splx(s);
-}
-
-/*
- * Tcp protocol timeout routine called every 500 ms.
- * Updates the timers in all active tcb's and
- * causes finite state machine actions if timers expire.
- */
-void
-tcp_slowtimo()
-{
- register struct inpcb *ip, *ipnxt;
- register struct tcpcb *tp;
- register int i;
- int s;
-#ifdef TCPDEBUG
- int ostate;
-#endif
-
- s = splnet();
-
- tcp_maxidle = tcp_keepcnt * tcp_keepintvl;
-
- ip = tcb.lh_first;
- if (ip == NULL) {
- splx(s);
- return;
- }
- /*
- * Search through tcb's and update active timers.
- */
- for (; ip != NULL; ip = ipnxt) {
- ipnxt = ip->inp_list.le_next;
- tp = intotcpcb(ip);
- if (tp == 0 || tp->t_state == TCPS_LISTEN)
- continue;
- for (i = 0; i < TCPT_NTIMERS; i++) {
- if (tp->t_timer[i] && --tp->t_timer[i] == 0) {
-#ifdef TCPDEBUG
- ostate = tp->t_state;
-#endif
- tp = tcp_timers(tp, i);
- if (tp == NULL)
- goto tpgone;
-#ifdef TCPDEBUG
- if (tp->t_inpcb->inp_socket->so_options
- & SO_DEBUG)
- tcp_trace(TA_USER, ostate, tp,
- (struct tcpiphdr *)0,
- PRU_SLOWTIMO);
-#endif
- }
- }
- tp->t_idle++;
- tp->t_duration++;
- if (tp->t_rtt)
- tp->t_rtt++;
-tpgone:
- ;
- }
- tcp_iss += TCP_ISSINCR/PR_SLOWHZ; /* increment iss */
-#ifdef TCP_COMPAT_42
- if ((int)tcp_iss < 0)
- tcp_iss = TCP_ISSINCR; /* XXX */
-#endif
- tcp_now++; /* for timestamps */
- splx(s);
-}
-#ifndef TUBA_INCLUDE
-
-/*
- * Cancel all timers for TCP tp.
- */
-void
-tcp_canceltimers(tp)
- struct tcpcb *tp;
-{
- register int i;
-
- for (i = 0; i < TCPT_NTIMERS; i++)
- tp->t_timer[i] = 0;
-}
-
-int tcp_backoff[TCP_MAXRXTSHIFT + 1] =
- { 1, 2, 4, 8, 16, 32, 64, 64, 64, 64, 64, 64, 64 };
-
-static int tcp_totbackoff = 511; /* sum of tcp_backoff[] */
-
-/*
- * TCP timer processing.
- */
-struct tcpcb *
-tcp_timers(tp, timer)
- register struct tcpcb *tp;
- int timer;
-{
- register int rexmt;
-
- switch (timer) {
-
- /*
- * 2 MSL timeout in shutdown went off. If we're closed but
- * still waiting for peer to close and connection has been idle
- * too long, or if 2MSL time is up from TIME_WAIT, delete connection
- * control block. Otherwise, check again in a bit.
- */
- case TCPT_2MSL:
- if (tp->t_state != TCPS_TIME_WAIT &&
- tp->t_idle <= tcp_maxidle)
- tp->t_timer[TCPT_2MSL] = tcp_keepintvl;
- else
- tp = tcp_close(tp);
- break;
-
- /*
- * Retransmission timer went off. Message has not
- * been acked within retransmit interval. Back off
- * to a longer retransmit interval and retransmit one segment.
- */
- case TCPT_REXMT:
- if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) {
- tp->t_rxtshift = TCP_MAXRXTSHIFT;
- tcpstat.tcps_timeoutdrop++;
- tp = tcp_drop(tp, tp->t_softerror ?
- tp->t_softerror : ETIMEDOUT);
- break;
- }
- tcpstat.tcps_rexmttimeo++;
- rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
- TCPT_RANGESET(tp->t_rxtcur, rexmt,
- tp->t_rttmin, TCPTV_REXMTMAX);
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
- /*
- * If losing, let the lower level know and try for
- * a better route. Also, if we backed off this far,
- * our srtt estimate is probably bogus. Clobber it
- * so we'll take the next rtt measurement as our srtt;
- * move the current srtt into rttvar to keep the current
- * retransmit times until then.
- */
- if (tp->t_rxtshift > TCP_MAXRXTSHIFT / 4) {
- in_losing(tp->t_inpcb);
- tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT);
- tp->t_srtt = 0;
- }
- tp->snd_nxt = tp->snd_una;
- /*
- * Force a segment to be sent.
- */
- tp->t_flags |= TF_ACKNOW;
- /*
- * If timing a segment in this window, stop the timer.
- */
- tp->t_rtt = 0;
- /*
- * Close the congestion window down to one segment
- * (we'll open it by one segment for each ack we get).
- * Since we probably have a window's worth of unacked
- * data accumulated, this "slow start" keeps us from
- * dumping all that data as back-to-back packets (which
- * might overwhelm an intermediate gateway).
- *
- * There are two phases to the opening: Initially we
- * open by one mss on each ack. This makes the window
- * size increase exponentially with time. If the
- * window is larger than the path can handle, this
- * exponential growth results in dropped packet(s)
- * almost immediately. To get more time between
- * drops but still "push" the network to take advantage
- * of improving conditions, we switch from exponential
- * to linear window opening at some threshhold size.
- * For a threshhold, we use half the current window
- * size, truncated to a multiple of the mss.
- *
- * (the minimum cwnd that will give us exponential
- * growth is 2 mss. We don't allow the threshhold
- * to go below this.)
- */
- {
- u_int win = min(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg;
- if (win < 2)
- win = 2;
- tp->snd_cwnd = tp->t_maxseg;
- tp->snd_ssthresh = win * tp->t_maxseg;
- tp->t_dupacks = 0;
- }
- (void) tcp_output(tp);
- break;
-
- /*
- * Persistance timer into zero window.
- * Force a byte to be output, if possible.
- */
- case TCPT_PERSIST:
- tcpstat.tcps_persisttimeo++;
- /*
- * Hack: if the peer is dead/unreachable, we do not
- * time out if the window is closed. After a full
- * backoff, drop the connection if the idle time
- * (no responses to probes) reaches the maximum
- * backoff that we would use if retransmitting.
- */
- if (tp->t_rxtshift == TCP_MAXRXTSHIFT) {
- u_long maxidle = TCP_REXMTVAL(tp);
- if (maxidle < tp->t_rttmin)
- maxidle = tp->t_rttmin;
- maxidle *= tcp_totbackoff;
- if (tp->t_idle >= tcp_maxpersistidle ||
- tp->t_idle >= maxidle) {
- tcpstat.tcps_persistdrop++;
- tp = tcp_drop(tp, ETIMEDOUT);
- break;
- }
- }
- tcp_setpersist(tp);
- tp->t_force = 1;
- (void) tcp_output(tp);
- tp->t_force = 0;
- break;
-
- /*
- * Keep-alive timer went off; send something
- * or drop connection if idle for too long.
- */
- case TCPT_KEEP:
- tcpstat.tcps_keeptimeo++;
- if (tp->t_state < TCPS_ESTABLISHED)
- goto dropit;
- if ((always_keepalive ||
- tp->t_inpcb->inp_socket->so_options & SO_KEEPALIVE) &&
- tp->t_state <= TCPS_CLOSING) {
- if (tp->t_idle >= tcp_keepidle + tcp_maxidle)
- goto dropit;
- /*
- * Send a packet designed to force a response
- * if the peer is up and reachable:
- * either an ACK if the connection is still alive,
- * or an RST if the peer has closed the connection
- * due to timeout or reboot.
- * Using sequence number tp->snd_una-1
- * causes the transmitted zero-length segment
- * to lie outside the receive window;
- * by the protocol spec, this requires the
- * correspondent TCP to respond.
- */
- tcpstat.tcps_keepprobe++;
-#ifdef TCP_COMPAT_42
- /*
- * The keepalive packet must have nonzero length
- * to get a 4.2 host to respond.
- */
- tcp_respond(tp, tp->t_template, (struct mbuf *)NULL,
- tp->rcv_nxt - 1, tp->snd_una - 1, 0);
-#else
- tcp_respond(tp, tp->t_template, (struct mbuf *)NULL,
- tp->rcv_nxt, tp->snd_una - 1, 0);
-#endif
- tp->t_timer[TCPT_KEEP] = tcp_keepintvl;
- } else
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- break;
- dropit:
- tcpstat.tcps_keepdrops++;
- tp = tcp_drop(tp, ETIMEDOUT);
- break;
- }
- return (tp);
-}
-#endif /* TUBA_INCLUDE */
diff --git a/c/src/libnetworking/netinet/tcp_timer.h b/c/src/libnetworking/netinet/tcp_timer.h
deleted file mode 100644
index 38ffac4ee7..0000000000
--- a/c/src/libnetworking/netinet/tcp_timer.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_timer.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_TIMER_H_
-#define _NETINET_TCP_TIMER_H_
-
-/*
- * Definitions of the TCP timers. These timers are counted
- * down PR_SLOWHZ times a second.
- */
-#define TCPT_NTIMERS 4
-
-#define TCPT_REXMT 0 /* retransmit */
-#define TCPT_PERSIST 1 /* retransmit persistence */
-#define TCPT_KEEP 2 /* keep alive */
-#define TCPT_2MSL 3 /* 2*msl quiet time timer */
-
-/*
- * The TCPT_REXMT timer is used to force retransmissions.
- * The TCP has the TCPT_REXMT timer set whenever segments
- * have been sent for which ACKs are expected but not yet
- * received. If an ACK is received which advances tp->snd_una,
- * then the retransmit timer is cleared (if there are no more
- * outstanding segments) or reset to the base value (if there
- * are more ACKs expected). Whenever the retransmit timer goes off,
- * we retransmit one unacknowledged segment, and do a backoff
- * on the retransmit timer.
- *
- * The TCPT_PERSIST timer is used to keep window size information
- * flowing even if the window goes shut. If all previous transmissions
- * have been acknowledged (so that there are no retransmissions in progress),
- * and the window is too small to bother sending anything, then we start
- * the TCPT_PERSIST timer. When it expires, if the window is nonzero,
- * we go to transmit state. Otherwise, at intervals send a single byte
- * into the peer's window to force him to update our window information.
- * We do this at most as often as TCPT_PERSMIN time intervals,
- * but no more frequently than the current estimate of round-trip
- * packet time. The TCPT_PERSIST timer is cleared whenever we receive
- * a window update from the peer.
- *
- * The TCPT_KEEP timer is used to keep connections alive. If an
- * connection is idle (no segments received) for TCPTV_KEEP_INIT amount of time,
- * but not yet established, then we drop the connection. Once the connection
- * is established, if the connection is idle for TCPTV_KEEP_IDLE time
- * (and keepalives have been enabled on the socket), we begin to probe
- * the connection. We force the peer to send us a segment by sending:
- * <SEQ=SND.UNA-1><ACK=RCV.NXT><CTL=ACK>
- * This segment is (deliberately) outside the window, and should elicit
- * an ack segment in response from the peer. If, despite the TCPT_KEEP
- * initiated segments we cannot elicit a response from a peer in TCPT_MAXIDLE
- * amount of time probing, then we drop the connection.
- */
-
-/*
- * Time constants.
- */
-#define TCPTV_MSL ( 30*PR_SLOWHZ) /* max seg lifetime (hah!) */
-#define TCPTV_SRTTBASE 0 /* base roundtrip time;
- if 0, no idea yet */
-#define TCPTV_RTOBASE ( 3*PR_SLOWHZ) /* assumed RTO if no info */
-#define TCPTV_SRTTDFLT ( 3*PR_SLOWHZ) /* assumed RTT if no info */
-
-#define TCPTV_PERSMIN ( 5*PR_SLOWHZ) /* retransmit persistence */
-#define TCPTV_PERSMAX ( 60*PR_SLOWHZ) /* maximum persist interval */
-
-#define TCPTV_KEEP_INIT ( 75*PR_SLOWHZ) /* initial connect keep alive */
-#define TCPTV_KEEP_IDLE (120*60*PR_SLOWHZ) /* dflt time before probing */
-#define TCPTV_KEEPINTVL ( 75*PR_SLOWHZ) /* default probe interval */
-#define TCPTV_KEEPCNT 8 /* max probes before drop */
-
-#define TCPTV_MIN ( 1*PR_SLOWHZ) /* minimum allowable value */
-#define TCPTV_REXMTMAX ( 64*PR_SLOWHZ) /* max allowable REXMT value */
-
-#define TCPTV_TWTRUNC 8 /* RTO factor to truncate TW */
-
-#define TCP_LINGERTIME 120 /* linger at most 2 minutes */
-
-#define TCP_MAXRXTSHIFT 12 /* maximum retransmits */
-
-#ifdef TCPTIMERS
-static char *tcptimers[] =
- { "REXMT", "PERSIST", "KEEP", "2MSL" };
-#endif
-
-/*
- * Force a time value to be in a certain range.
- */
-#define TCPT_RANGESET(tv, value, tvmin, tvmax) { \
- (tv) = (value); \
- if ((u_long)(tv) < (u_long)(tvmin)) \
- (tv) = (tvmin); \
- else if ((u_long)(tv) > (u_long)(tvmax)) \
- (tv) = (tvmax); \
-}
-
-#ifdef KERNEL
-extern int tcp_keepinit; /* time to establish connection */
-extern int tcp_keepidle; /* time before keepalive probes begin */
-extern int tcp_keepintvl; /* time between keepalive probes */
-extern int tcp_maxidle; /* time to drop after starting probes */
-extern int tcp_ttl; /* time to live for TCP segs */
-extern int tcp_backoff[];
-#endif
-
-#endif
diff --git a/c/src/libnetworking/netinet/tcp_usrreq.c b/c/src/libnetworking/netinet/tcp_usrreq.c
deleted file mode 100644
index ecd9d95636..0000000000
--- a/c/src/libnetworking/netinet/tcp_usrreq.c
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-#include <sys/stat.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-/*
- * TCP protocol interface to socket abstraction.
- */
-extern char *tcpstates[];
-
-static int tcp_attach __P((struct socket *));
-static int tcp_connect __P((struct tcpcb *, struct mbuf *));
-static struct tcpcb *
- tcp_disconnect __P((struct tcpcb *));
-static struct tcpcb *
- tcp_usrclosed __P((struct tcpcb *));
-
-#ifdef TCPDEBUG
-#define TCPDEBUG0 int ostate
-#define TCPDEBUG1() ostate = tp ? tp->t_state : 0
-#define TCPDEBUG2(req) if (tp && (so->so_options & SO_DEBUG)) \
- tcp_trace(TA_USER, ostate, tp, 0, req)
-#else
-#define TCPDEBUG0
-#define TCPDEBUG1()
-#define TCPDEBUG2(req)
-#endif
-
-/*
- * TCP attaches to socket via pru_attach(), reserving space,
- * and an internet control block.
- */
-static int
-tcp_usr_attach(struct socket *so, int proto)
-{
- int s = splnet();
- int error;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp = 0;
- TCPDEBUG0;
-
- TCPDEBUG1();
- if (inp) {
- error = EISCONN;
- goto out;
- }
-
- error = tcp_attach(so);
- if (error)
- goto out;
-
- if ((so->so_options & SO_LINGER) && so->so_linger == 0)
- so->so_linger = TCP_LINGERTIME * hz;
- tp = sototcpcb(so);
-out:
- TCPDEBUG2(PRU_ATTACH);
- splx(s);
- return error;
-}
-
-/*
- * pru_detach() detaches the TCP protocol from the socket.
- * If the protocol state is non-embryonic, then can't
- * do this directly: have to initiate a pru_disconnect(),
- * which may finish later; embryonic TCB's can just
- * be discarded here.
- */
-static int
-tcp_usr_detach(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
- TCPDEBUG0;
-
- if (inp == 0) {
- splx(s);
- return EINVAL; /* XXX */
- }
- tp = intotcpcb(inp);
- TCPDEBUG1();
- if (tp->t_state > TCPS_LISTEN)
- tp = tcp_disconnect(tp);
- else
- tp = tcp_close(tp);
-
- TCPDEBUG2(PRU_DETACH);
- splx(s);
- return error;
-}
-
-#define COMMON_START() TCPDEBUG0; \
- do { \
- if (inp == 0) { \
- splx(s); \
- return EINVAL; \
- } \
- tp = intotcpcb(inp); \
- TCPDEBUG1(); \
- } while(0)
-
-#define COMMON_END(req) out: TCPDEBUG2(req); splx(s); return error; goto out
-
-
-/*
- * Give the socket an address.
- */
-static int
-tcp_usr_bind(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
- struct sockaddr_in *sinp;
-
- COMMON_START();
-
- /*
- * Must check for multicast addresses and disallow binding
- * to them.
- */
- sinp = mtod(nam, struct sockaddr_in *);
- if (sinp->sin_family == AF_INET &&
- IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) {
- error = EAFNOSUPPORT;
- goto out;
- }
- error = in_pcbbind(inp, nam);
- if (error)
- goto out;
- COMMON_END(PRU_BIND);
-
-}
-
-/*
- * Prepare to accept connections.
- */
-static int
-tcp_usr_listen(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- if (inp->inp_lport == 0)
- error = in_pcbbind(inp, NULL);
- if (error == 0)
- tp->t_state = TCPS_LISTEN;
- COMMON_END(PRU_LISTEN);
-}
-
-/*
- * Initiate connection to peer.
- * Create a template for use in transmissions on this connection.
- * Enter SYN_SENT state, and mark socket as connecting.
- * Start keep-alive timer, and seed output sequence space.
- * Send initial segment on connection.
- */
-static int
-tcp_usr_connect(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
- struct sockaddr_in *sinp;
-
- COMMON_START();
-
- /*
- * Must disallow TCP ``connections'' to multicast addresses.
- */
- sinp = mtod(nam, struct sockaddr_in *);
- if (sinp->sin_family == AF_INET
- && IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) {
- error = EAFNOSUPPORT;
- goto out;
- }
-
- if ((error = tcp_connect(tp, nam)) != 0)
- goto out;
- error = tcp_output(tp);
- COMMON_END(PRU_CONNECT);
-}
-
-/*
- * Initiate disconnect from peer.
- * If connection never passed embryonic stage, just drop;
- * else if don't need to let data drain, then can just drop anyways,
- * else have to begin TCP shutdown process: mark socket disconnecting,
- * drain unread data, state switch to reflect user close, and
- * send segment (e.g. FIN) to peer. Socket will be really disconnected
- * when peer sends FIN and acks ours.
- *
- * SHOULD IMPLEMENT LATER PRU_CONNECT VIA REALLOC TCPCB.
- */
-static int
-tcp_usr_disconnect(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- tp = tcp_disconnect(tp);
- COMMON_END(PRU_DISCONNECT);
-}
-
-/*
- * Accept a connection. Essentially all the work is
- * done at higher levels; just return the address
- * of the peer, storing through addr.
- */
-static int
-tcp_usr_accept(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- in_setpeeraddr(inp, nam);
- COMMON_END(PRU_ACCEPT);
-}
-
-/*
- * Mark the connection as being incapable of further output.
- */
-static int
-tcp_usr_shutdown(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- socantsendmore(so);
- tp = tcp_usrclosed(tp);
- if (tp)
- error = tcp_output(tp);
- COMMON_END(PRU_SHUTDOWN);
-}
-
-/*
- * After a receive, possibly send window update to peer.
- */
-static int
-tcp_usr_rcvd(struct socket *so, int flags)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- tcp_output(tp);
- COMMON_END(PRU_RCVD);
-}
-
-/*
- * Do a send by putting data in output queue and updating urgent
- * marker if URG set. Possibly send more data.
- */
-static int
-tcp_usr_send(struct socket *so, int flags, struct mbuf *m, struct mbuf *nam,
- struct mbuf *control)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- if (control && control->m_len) {
- m_freem(control); /* XXX shouldn't caller do this??? */
- if (m)
- m_freem(m);
- error = EINVAL;
- goto out;
- }
-
- if(!(flags & PRUS_OOB)) {
- sbappend(&so->so_snd, m);
- if (nam && tp->t_state < TCPS_SYN_SENT) {
- /*
- * Do implied connect if not yet connected,
- * initialize window to default value, and
- * initialize maxseg/maxopd using peer's cached
- * MSS.
- */
- error = tcp_connect(tp, nam);
- if (error)
- goto out;
- tp->snd_wnd = TTCP_CLIENT_SND_WND;
- tcp_mss(tp, -1);
- }
-
- if (flags & PRUS_EOF) {
- /*
- * Close the send side of the connection after
- * the data is sent.
- */
- socantsendmore(so);
- tp = tcp_usrclosed(tp);
- }
- if (tp != NULL)
- error = tcp_output(tp);
- } else {
- if (sbspace(&so->so_snd) < -512) {
- m_freem(m);
- error = ENOBUFS;
- goto out;
- }
- /*
- * According to RFC961 (Assigned Protocols),
- * the urgent pointer points to the last octet
- * of urgent data. We continue, however,
- * to consider it to indicate the first octet
- * of data past the urgent section.
- * Otherwise, snd_up should be one lower.
- */
- sbappend(&so->so_snd, m);
- if (nam && tp->t_state < TCPS_SYN_SENT) {
- /*
- * Do implied connect if not yet connected,
- * initialize window to default value, and
- * initialize maxseg/maxopd using peer's cached
- * MSS.
- */
- error = tcp_connect(tp, nam);
- if (error)
- goto out;
- tp->snd_wnd = TTCP_CLIENT_SND_WND;
- tcp_mss(tp, -1);
- }
- tp->snd_up = tp->snd_una + so->so_snd.sb_cc;
- tp->t_force = 1;
- error = tcp_output(tp);
- tp->t_force = 0;
- }
- COMMON_END((flags & PRUS_OOB) ? PRU_SENDOOB :
- ((flags & PRUS_EOF) ? PRU_SEND_EOF : PRU_SEND));
-}
-
-/*
- * Abort the TCP.
- */
-static int
-tcp_usr_abort(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- tp = tcp_drop(tp, ECONNABORTED);
- COMMON_END(PRU_ABORT);
-}
-
-/*
- * Fill in st_bklsize for fstat() operations on a socket.
- */
-static int
-tcp_usr_sense(struct socket *so, struct stat *sb)
-{
- int s = splnet();
-
- sb->st_blksize = so->so_snd.sb_hiwat;
- splx(s);
- return 0;
-}
-
-/*
- * Receive out-of-band data.
- */
-static int
-tcp_usr_rcvoob(struct socket *so, struct mbuf *m, int flags)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- if ((so->so_oobmark == 0 &&
- (so->so_state & SS_RCVATMARK) == 0) ||
- so->so_options & SO_OOBINLINE ||
- tp->t_oobflags & TCPOOB_HADDATA) {
- error = EINVAL;
- goto out;
- }
- if ((tp->t_oobflags & TCPOOB_HAVEDATA) == 0) {
- error = EWOULDBLOCK;
- goto out;
- }
- m->m_len = 1;
- *mtod(m, caddr_t) = tp->t_iobc;
- if ((flags & MSG_PEEK) == 0)
- tp->t_oobflags ^= (TCPOOB_HAVEDATA | TCPOOB_HADDATA);
- COMMON_END(PRU_RCVOOB);
-}
-
-static int
-tcp_usr_sockaddr(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- in_setsockaddr(inp, nam);
- COMMON_END(PRU_SOCKADDR);
-}
-
-static int
-tcp_usr_peeraddr(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- in_setpeeraddr(inp, nam);
- COMMON_END(PRU_PEERADDR);
-}
-
-/*
- * XXX - this should just be a call to in_control, but we need to get
- * the types worked out.
- */
-static int
-tcp_usr_control(struct socket *so, int cmd, caddr_t arg, struct ifnet *ifp)
-{
- return in_control(so, cmd, arg, ifp);
-}
-
-/* xxx - should be const */
-struct pr_usrreqs tcp_usrreqs = {
- tcp_usr_abort, tcp_usr_accept, tcp_usr_attach, tcp_usr_bind,
- tcp_usr_connect, pru_connect2_notsupp, tcp_usr_control, tcp_usr_detach,
- tcp_usr_disconnect, tcp_usr_listen, tcp_usr_peeraddr, tcp_usr_rcvd,
- tcp_usr_rcvoob, tcp_usr_send, tcp_usr_sense, tcp_usr_shutdown,
- tcp_usr_sockaddr
-};
-
-/*
- * Common subroutine to open a TCP connection to remote host specified
- * by struct sockaddr_in in mbuf *nam. Call in_pcbbind to assign a local
- * port number if needed. Call in_pcbladdr to do the routing and to choose
- * a local host address (interface). If there is an existing incarnation
- * of the same connection in TIME-WAIT state and if the remote host was
- * sending CC options and if the connection duration was < MSL, then
- * truncate the previous TIME-WAIT state and proceed.
- * Initialize connection parameters and enter SYN-SENT state.
- */
-static int
-tcp_connect(tp, nam)
- register struct tcpcb *tp;
- struct mbuf *nam;
-{
- struct inpcb *inp = tp->t_inpcb, *oinp;
- struct socket *so = inp->inp_socket;
- struct tcpcb *otp;
- struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *);
- struct sockaddr_in *ifaddr;
- int error;
- struct rmxp_tao *taop;
- struct rmxp_tao tao_noncached;
-
- if (inp->inp_lport == 0) {
- error = in_pcbbind(inp, NULL);
- if (error)
- return error;
- }
-
- /*
- * Cannot simply call in_pcbconnect, because there might be an
- * earlier incarnation of this same connection still in
- * TIME_WAIT state, creating an ADDRINUSE error.
- */
- error = in_pcbladdr(inp, nam, &ifaddr);
- if (error)
- return error;
- oinp = in_pcblookuphash(inp->inp_pcbinfo,
- sin->sin_addr, sin->sin_port,
- inp->inp_laddr.s_addr != INADDR_ANY ? inp->inp_laddr
- : ifaddr->sin_addr,
- inp->inp_lport, 0);
- if (oinp) {
- if (oinp != inp && (otp = intotcpcb(oinp)) != NULL &&
- otp->t_state == TCPS_TIME_WAIT &&
- otp->t_duration < TCPTV_MSL &&
- (otp->t_flags & TF_RCVD_CC))
- otp = tcp_close(otp);
- else
- return EADDRINUSE;
- }
- if (inp->inp_laddr.s_addr == INADDR_ANY)
- inp->inp_laddr = ifaddr->sin_addr;
- inp->inp_faddr = sin->sin_addr;
- inp->inp_fport = sin->sin_port;
- in_pcbrehash(inp);
-
- tp->t_template = tcp_template(tp);
- if (tp->t_template == 0) {
- in_pcbdisconnect(inp);
- return ENOBUFS;
- }
-
- /* Compute window scaling to request. */
- while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
- (TCP_MAXWIN << tp->request_r_scale) < so->so_rcv.sb_hiwat)
- tp->request_r_scale++;
-
- soisconnecting(so);
- tcpstat.tcps_connattempt++;
- tp->t_state = TCPS_SYN_SENT;
- tp->t_timer[TCPT_KEEP] = tcp_keepinit;
- tp->iss = tcp_iss; tcp_iss += TCP_ISSINCR/2;
- tcp_sendseqinit(tp);
-
- /*
- * Generate a CC value for this connection and
- * check whether CC or CCnew should be used.
- */
- if ((taop = tcp_gettaocache(tp->t_inpcb)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
-
- tp->cc_send = CC_INC(tcp_ccgen);
- if (taop->tao_ccsent != 0 &&
- CC_GEQ(tp->cc_send, taop->tao_ccsent)) {
- taop->tao_ccsent = tp->cc_send;
- } else {
- taop->tao_ccsent = 0;
- tp->t_flags |= TF_SENDCCNEW;
- }
-
- return 0;
-}
-
-int
-tcp_ctloutput(op, so, level, optname, mp)
- int op;
- struct socket *so;
- int level, optname;
- struct mbuf **mp;
-{
- int error = 0, s;
- struct inpcb *inp;
- register struct tcpcb *tp;
- register struct mbuf *m;
- register int i;
-
- s = splnet();
- inp = sotoinpcb(so);
- if (inp == NULL) {
- splx(s);
- if (op == PRCO_SETOPT && *mp)
- (void) m_free(*mp);
- return (ECONNRESET);
- }
- if (level != IPPROTO_TCP) {
- error = ip_ctloutput(op, so, level, optname, mp);
- splx(s);
- return (error);
- }
- tp = intotcpcb(inp);
-
- switch (op) {
-
- case PRCO_SETOPT:
- m = *mp;
- switch (optname) {
-
- case TCP_NODELAY:
- if (m == NULL || m->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(m, int *))
- tp->t_flags |= TF_NODELAY;
- else
- tp->t_flags &= ~TF_NODELAY;
- break;
-
- case TCP_MAXSEG:
- if (m && (i = *mtod(m, int *)) > 0 && i <= tp->t_maxseg)
- tp->t_maxseg = i;
- else
- error = EINVAL;
- break;
-
- case TCP_NOOPT:
- if (m == NULL || m->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(m, int *))
- tp->t_flags |= TF_NOOPT;
- else
- tp->t_flags &= ~TF_NOOPT;
- break;
-
- case TCP_NOPUSH:
- if (m == NULL || m->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(m, int *))
- tp->t_flags |= TF_NOPUSH;
- else
- tp->t_flags &= ~TF_NOPUSH;
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- if (m)
- (void) m_free(m);
- break;
-
- case PRCO_GETOPT:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof(int);
-
- switch (optname) {
- case TCP_NODELAY:
- *mtod(m, int *) = tp->t_flags & TF_NODELAY;
- break;
- case TCP_MAXSEG:
- *mtod(m, int *) = tp->t_maxseg;
- break;
- case TCP_NOOPT:
- *mtod(m, int *) = tp->t_flags & TF_NOOPT;
- break;
- case TCP_NOPUSH:
- *mtod(m, int *) = tp->t_flags & TF_NOPUSH;
- break;
- default:
- error = ENOPROTOOPT;
- break;
- }
- break;
- }
- splx(s);
- return (error);
-}
-
-/*
- * tcp_sendspace and tcp_recvspace are the default send and receive window
- * sizes, respectively. These are obsolescent (this information should
- * be set by the route).
- */
-u_long tcp_sendspace = 1024*16;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_SENDSPACE, sendspace,
- CTLFLAG_RW, &tcp_sendspace , 0, "");
-u_long tcp_recvspace = 1024*16;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace,
- CTLFLAG_RW, &tcp_recvspace , 0, "");
-
-/*
- * Attach TCP protocol to socket, allocating
- * internet protocol control block, tcp control block,
- * bufer space, and entering LISTEN state if to accept connections.
- */
-static int
-tcp_attach(so)
- struct socket *so;
-{
- register struct tcpcb *tp;
- struct inpcb *inp;
- int error;
-
- if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) {
- error = soreserve(so, tcp_sendspace, tcp_recvspace);
- if (error)
- return (error);
- }
- error = in_pcballoc(so, &tcbinfo);
- if (error)
- return (error);
- inp = sotoinpcb(so);
- tp = tcp_newtcpcb(inp);
- if (tp == 0) {
- int nofd = so->so_state & SS_NOFDREF; /* XXX */
-
- so->so_state &= ~SS_NOFDREF; /* don't free the socket yet */
- in_pcbdetach(inp);
- so->so_state |= nofd;
- return (ENOBUFS);
- }
- tp->t_state = TCPS_CLOSED;
- return (0);
-}
-
-/*
- * Initiate (or continue) disconnect.
- * If embryonic state, just send reset (once).
- * If in ``let data drain'' option and linger null, just drop.
- * Otherwise (hard), mark socket disconnecting and drop
- * current input data; switch states based on user close, and
- * send segment to peer (with FIN).
- */
-static struct tcpcb *
-tcp_disconnect(tp)
- register struct tcpcb *tp;
-{
- struct socket *so = tp->t_inpcb->inp_socket;
-
- if (tp->t_state < TCPS_ESTABLISHED)
- tp = tcp_close(tp);
- else if ((so->so_options & SO_LINGER) && so->so_linger == 0)
- tp = tcp_drop(tp, 0);
- else {
- soisdisconnecting(so);
- sbflush(&so->so_rcv);
- tp = tcp_usrclosed(tp);
- if (tp)
- (void) tcp_output(tp);
- }
- return (tp);
-}
-
-/*
- * User issued close, and wish to trail through shutdown states:
- * if never received SYN, just forget it. If got a SYN from peer,
- * but haven't sent FIN, then go to FIN_WAIT_1 state to send peer a FIN.
- * If already got a FIN from peer, then almost done; go to LAST_ACK
- * state. In all other cases, have already sent FIN to peer (e.g.
- * after PRU_SHUTDOWN), and just have to play tedious game waiting
- * for peer to send FIN or not respond to keep-alives, etc.
- * We can let the user exit from the close as soon as the FIN is acked.
- */
-static struct tcpcb *
-tcp_usrclosed(tp)
- register struct tcpcb *tp;
-{
-
- switch (tp->t_state) {
-
- case TCPS_CLOSED:
- case TCPS_LISTEN:
- tp->t_state = TCPS_CLOSED;
- tp = tcp_close(tp);
- break;
-
- case TCPS_SYN_SENT:
- case TCPS_SYN_RECEIVED:
- tp->t_flags |= TF_NEEDFIN;
- break;
-
- case TCPS_ESTABLISHED:
- tp->t_state = TCPS_FIN_WAIT_1;
- break;
-
- case TCPS_CLOSE_WAIT:
- tp->t_state = TCPS_LAST_ACK;
- break;
- }
- if (tp && tp->t_state >= TCPS_FIN_WAIT_2) {
- soisdisconnected(tp->t_inpcb->inp_socket);
- /* To prevent the connection hanging in FIN_WAIT_2 forever. */
- if (tp->t_state == TCPS_FIN_WAIT_2)
- tp->t_timer[TCPT_2MSL] = tcp_maxidle;
- }
- return (tp);
-}
-
diff --git a/c/src/libnetworking/netinet/tcp_var.h b/c/src/libnetworking/netinet/tcp_var.h
deleted file mode 100644
index 8e63a2cafe..0000000000
--- a/c/src/libnetworking/netinet/tcp_var.h
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993, 1994, 1995
- * 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.
- *
- * @(#)tcp_var.h 8.4 (Berkeley) 5/24/95
- * $Id$
- */
-
-#ifndef _NETINET_TCP_VAR_H_
-#define _NETINET_TCP_VAR_H_
-/*
- * Kernel variables for tcp.
- */
-
-/*
- * Tcp control block, one per tcp; fields:
- */
-struct tcpcb {
- struct tcpiphdr *seg_next; /* sequencing queue */
- struct tcpiphdr *seg_prev;
- int t_state; /* state of this connection */
- int t_timer[TCPT_NTIMERS]; /* tcp timers */
- int t_rxtshift; /* log(2) of rexmt exp. backoff */
- int t_rxtcur; /* current retransmit value */
- int t_dupacks; /* consecutive dup acks recd */
- u_int t_maxseg; /* maximum segment size */
- u_int t_maxopd; /* mss plus options */
- int t_force; /* 1 if forcing out a byte */
- u_int t_flags;
-#define TF_ACKNOW 0x0001 /* ack peer immediately */
-#define TF_DELACK 0x0002 /* ack, but try to delay it */
-#define TF_NODELAY 0x0004 /* don't delay packets to coalesce */
-#define TF_NOOPT 0x0008 /* don't use tcp options */
-#define TF_SENTFIN 0x0010 /* have sent FIN */
-#define TF_REQ_SCALE 0x0020 /* have/will request window scaling */
-#define TF_RCVD_SCALE 0x0040 /* other side has requested scaling */
-#define TF_REQ_TSTMP 0x0080 /* have/will request timestamps */
-#define TF_RCVD_TSTMP 0x0100 /* a timestamp was received in SYN */
-#define TF_SACK_PERMIT 0x0200 /* other side said I could SACK */
-#define TF_NEEDSYN 0x0400 /* send SYN (implicit state) */
-#define TF_NEEDFIN 0x0800 /* send FIN (implicit state) */
-#define TF_NOPUSH 0x1000 /* don't push */
-#define TF_REQ_CC 0x2000 /* have/will request CC */
-#define TF_RCVD_CC 0x4000 /* a CC was received in SYN */
-#define TF_SENDCCNEW 0x8000 /* send CCnew instead of CC in SYN */
-
- struct tcpiphdr *t_template; /* skeletal packet for transmit */
- struct inpcb *t_inpcb; /* back pointer to internet pcb */
-/*
- * The following fields are used as in the protocol specification.
- * See RFC783, Dec. 1981, page 21.
- */
-/* send sequence variables */
- tcp_seq snd_una; /* send unacknowledged */
- tcp_seq snd_nxt; /* send next */
- tcp_seq snd_up; /* send urgent pointer */
- tcp_seq snd_wl1; /* window update seg seq number */
- tcp_seq snd_wl2; /* window update seg ack number */
- tcp_seq iss; /* initial send sequence number */
- u_long snd_wnd; /* send window */
-/* receive sequence variables */
- u_long rcv_wnd; /* receive window */
- tcp_seq rcv_nxt; /* receive next */
- tcp_seq rcv_up; /* receive urgent pointer */
- tcp_seq irs; /* initial receive sequence number */
-/*
- * Additional variables for this implementation.
- */
-/* receive variables */
- tcp_seq rcv_adv; /* advertised window */
-/* retransmit variables */
- tcp_seq snd_max; /* highest sequence number sent;
- * used to recognize retransmits
- */
-/* congestion control (for slow start, source quench, retransmit after loss) */
- u_long snd_cwnd; /* congestion-controlled window */
- u_long snd_ssthresh; /* snd_cwnd size threshold for
- * for slow start exponential to
- * linear switch
- */
-/*
- * transmit timing stuff. See below for scale of srtt and rttvar.
- * "Variance" is actually smoothed difference.
- */
- u_int t_idle; /* inactivity time */
- int t_rtt; /* round trip time */
- tcp_seq t_rtseq; /* sequence number being timed */
- int t_srtt; /* smoothed round-trip time */
- int t_rttvar; /* variance in round-trip time */
- u_int t_rttmin; /* minimum rtt allowed */
- u_long max_sndwnd; /* largest window peer has offered */
-
-/* out-of-band data */
- char t_oobflags; /* have some */
- char t_iobc; /* input character */
-#define TCPOOB_HAVEDATA 0x01
-#define TCPOOB_HADDATA 0x02
- int t_softerror; /* possible error not yet reported */
-
-/* RFC 1323 variables */
- u_char snd_scale; /* window scaling for send window */
- u_char rcv_scale; /* window scaling for recv window */
- u_char request_r_scale; /* pending window scaling */
- u_char requested_s_scale;
- u_long ts_recent; /* timestamp echo data */
- u_long ts_recent_age; /* when last updated */
- tcp_seq last_ack_sent;
-/* RFC 1644 variables */
- tcp_cc cc_send; /* send connection count */
- tcp_cc cc_recv; /* receive connection count */
- u_long t_duration; /* connection duration */
-
-/* TUBA stuff */
- caddr_t t_tuba_pcb; /* next level down pcb for TCP over z */
-/* More RTT stuff */
- u_long t_rttupdated; /* number of times rtt sampled */
-};
-
-/*
- * Structure to hold TCP options that are only used during segment
- * processing (in tcp_input), but not held in the tcpcb.
- * It's basically used to reduce the number of parameters
- * to tcp_dooptions.
- */
-struct tcpopt {
- u_long to_flag; /* which options are present */
-#define TOF_TS 0x0001 /* timestamp */
-#define TOF_CC 0x0002 /* CC and CCnew are exclusive */
-#define TOF_CCNEW 0x0004
-#define TOF_CCECHO 0x0008
- u_long to_tsval;
- u_long to_tsecr;
- tcp_cc to_cc; /* holds CC or CCnew */
- tcp_cc to_ccecho;
-};
-
-/*
- * The TAO cache entry which is stored in the protocol family specific
- * portion of the route metrics.
- */
-struct rmxp_tao {
- tcp_cc tao_cc; /* latest CC in valid SYN */
- tcp_cc tao_ccsent; /* latest CC sent to peer */
- u_short tao_mssopt; /* peer's cached MSS */
-#ifdef notyet
- u_short tao_flags; /* cache status flags */
-#define TAOF_DONT 0x0001 /* peer doesn't understand rfc1644 */
-#define TAOF_OK 0x0002 /* peer does understand rfc1644 */
-#define TAOF_UNDEF 0 /* we don't know yet */
-#endif /* notyet */
-};
-#define rmx_taop(r) ((struct rmxp_tao *)(r).rmx_filler)
-
-#define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb)
-#define sototcpcb(so) (intotcpcb(sotoinpcb(so)))
-
-/*
- * The smoothed round-trip time and estimated variance
- * are stored as fixed point numbers scaled by the values below.
- * For convenience, these scales are also used in smoothing the average
- * (smoothed = (1/scale)sample + ((scale-1)/scale)smoothed).
- * With these scales, srtt has 3 bits to the right of the binary point,
- * and thus an "ALPHA" of 0.875. rttvar has 2 bits to the right of the
- * binary point, and is smoothed with an ALPHA of 0.75.
- */
-#define TCP_RTT_SCALE 32 /* multiplier for srtt; 3 bits frac. */
-#define TCP_RTT_SHIFT 5 /* shift for srtt; 3 bits frac. */
-#define TCP_RTTVAR_SCALE 16 /* multiplier for rttvar; 2 bits */
-#define TCP_RTTVAR_SHIFT 4 /* shift for rttvar; 2 bits */
-#define TCP_DELTA_SHIFT 2 /* see tcp_input.c */
-
-/*
- * The initial retransmission should happen at rtt + 4 * rttvar.
- * Because of the way we do the smoothing, srtt and rttvar
- * will each average +1/2 tick of bias. When we compute
- * the retransmit timer, we want 1/2 tick of rounding and
- * 1 extra tick because of +-1/2 tick uncertainty in the
- * firing of the timer. The bias will give us exactly the
- * 1.5 tick we need. But, because the bias is
- * statistical, we have to test that we don't drop below
- * the minimum feasible timer (which is 2 ticks).
- * This version of the macro adapted from a paper by Lawrence
- * Brakmo and Larry Peterson which outlines a problem caused
- * by insufficient precision in the original implementation,
- * which results in inappropriately large RTO values for very
- * fast networks.
- */
-#define TCP_REXMTVAL(tp) \
- ((((tp)->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT)) \
- + (tp)->t_rttvar) >> TCP_DELTA_SHIFT)
-
-/* XXX
- * We want to avoid doing m_pullup on incoming packets but that
- * means avoiding dtom on the tcp reassembly code. That in turn means
- * keeping an mbuf pointer in the reassembly queue (since we might
- * have a cluster). As a quick hack, the source & destination
- * port numbers (which are no longer needed once we've located the
- * tcpcb) are overlayed with an mbuf pointer.
- */
-#define REASS_MBUF(ti) (*(struct mbuf **)&((ti)->ti_t))
-
-/*
- * TCP statistics.
- * Many of these should be kept per connection,
- * but that's inconvenient at the moment.
- */
-struct tcpstat {
- u_long tcps_connattempt; /* connections initiated */
- u_long tcps_accepts; /* connections accepted */
- u_long tcps_connects; /* connections established */
- u_long tcps_drops; /* connections dropped */
- u_long tcps_conndrops; /* embryonic connections dropped */
- u_long tcps_closed; /* conn. closed (includes drops) */
- u_long tcps_segstimed; /* segs where we tried to get rtt */
- u_long tcps_rttupdated; /* times we succeeded */
- u_long tcps_delack; /* delayed acks sent */
- u_long tcps_timeoutdrop; /* conn. dropped in rxmt timeout */
- u_long tcps_rexmttimeo; /* retransmit timeouts */
- u_long tcps_persisttimeo; /* persist timeouts */
- u_long tcps_keeptimeo; /* keepalive timeouts */
- u_long tcps_keepprobe; /* keepalive probes sent */
- u_long tcps_keepdrops; /* connections dropped in keepalive */
-
- u_long tcps_sndtotal; /* total packets sent */
- u_long tcps_sndpack; /* data packets sent */
- u_long tcps_sndbyte; /* data bytes sent */
- u_long tcps_sndrexmitpack; /* data packets retransmitted */
- u_long tcps_sndrexmitbyte; /* data bytes retransmitted */
- u_long tcps_sndacks; /* ack-only packets sent */
- u_long tcps_sndprobe; /* window probes sent */
- u_long tcps_sndurg; /* packets sent with URG only */
- u_long tcps_sndwinup; /* window update-only packets sent */
- u_long tcps_sndctrl; /* control (SYN|FIN|RST) packets sent */
-
- u_long tcps_rcvtotal; /* total packets received */
- u_long tcps_rcvpack; /* packets received in sequence */
- u_long tcps_rcvbyte; /* bytes received in sequence */
- u_long tcps_rcvbadsum; /* packets received with ccksum errs */
- u_long tcps_rcvbadoff; /* packets received with bad offset */
- u_long tcps_rcvshort; /* packets received too short */
- u_long tcps_rcvduppack; /* duplicate-only packets received */
- u_long tcps_rcvdupbyte; /* duplicate-only bytes received */
- u_long tcps_rcvpartduppack; /* packets with some duplicate data */
- u_long tcps_rcvpartdupbyte; /* dup. bytes in part-dup. packets */
- u_long tcps_rcvoopack; /* out-of-order packets received */
- u_long tcps_rcvoobyte; /* out-of-order bytes received */
- u_long tcps_rcvpackafterwin; /* packets with data after window */
- u_long tcps_rcvbyteafterwin; /* bytes rcvd after window */
- u_long tcps_rcvafterclose; /* packets rcvd after "close" */
- u_long tcps_rcvwinprobe; /* rcvd window probe packets */
- u_long tcps_rcvdupack; /* rcvd duplicate acks */
- u_long tcps_rcvacktoomuch; /* rcvd acks for unsent data */
- u_long tcps_rcvackpack; /* rcvd ack packets */
- u_long tcps_rcvackbyte; /* bytes acked by rcvd acks */
- u_long tcps_rcvwinupd; /* rcvd window update packets */
- u_long tcps_pawsdrop; /* segments dropped due to PAWS */
- u_long tcps_predack; /* times hdr predict ok for acks */
- u_long tcps_preddat; /* times hdr predict ok for data pkts */
- u_long tcps_pcbcachemiss;
- u_long tcps_cachedrtt; /* times cached RTT in route updated */
- u_long tcps_cachedrttvar; /* times cached rttvar updated */
- u_long tcps_cachedssthresh; /* times cached ssthresh updated */
- u_long tcps_usedrtt; /* times RTT initialized from route */
- u_long tcps_usedrttvar; /* times RTTVAR initialized from rt */
- u_long tcps_usedssthresh; /* times ssthresh initialized from rt*/
- u_long tcps_persistdrop; /* timeout in persist state */
- u_long tcps_badsyn; /* bogus SYN, e.g. premature ACK */
- u_long tcps_mturesent; /* resends due to MTU discovery */
- u_long tcps_listendrop; /* listen queue overflows */
-};
-
-/*
- * Names for TCP sysctl objects
- */
-#define TCPCTL_DO_RFC1323 1 /* use RFC-1323 extensions */
-#define TCPCTL_DO_RFC1644 2 /* use RFC-1644 extensions */
-#define TCPCTL_MSSDFLT 3 /* MSS default */
-#define TCPCTL_STATS 4 /* statistics (read-only) */
-#define TCPCTL_RTTDFLT 5 /* default RTT estimate */
-#define TCPCTL_KEEPIDLE 6 /* keepalive idle timer */
-#define TCPCTL_KEEPINTVL 7 /* interval to send keepalives */
-#define TCPCTL_SENDSPACE 8 /* send buffer space */
-#define TCPCTL_RECVSPACE 9 /* receive buffer space */
-#define TCPCTL_KEEPINIT 10 /* receive buffer space */
-#define TCPCTL_MAXID 11
-
-#define TCPCTL_NAMES { \
- { 0, 0 }, \
- { "rfc1323", CTLTYPE_INT }, \
- { "rfc1644", CTLTYPE_INT }, \
- { "mssdflt", CTLTYPE_INT }, \
- { "stats", CTLTYPE_STRUCT }, \
- { "rttdflt", CTLTYPE_INT }, \
- { "keepidle", CTLTYPE_INT }, \
- { "keepintvl", CTLTYPE_INT }, \
- { "sendspace", CTLTYPE_INT }, \
- { "recvspace", CTLTYPE_INT }, \
- { "keepinit", CTLTYPE_INT }, \
-}
-
-#ifdef KERNEL
-extern struct inpcbhead tcb; /* head of queue of active tcpcb's */
-extern struct inpcbinfo tcbinfo;
-extern struct tcpstat tcpstat; /* tcp statistics */
-extern int tcp_mssdflt; /* XXX */
-extern u_long tcp_now; /* for RFC 1323 timestamps */
-
-void tcp_canceltimers __P((struct tcpcb *));
-struct tcpcb *
- tcp_close __P((struct tcpcb *));
-void tcp_ctlinput __P((int, struct sockaddr *, void *));
-int tcp_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
-struct tcpcb *
- tcp_drop __P((struct tcpcb *, int));
-void tcp_drain __P((void));
-void tcp_fasttimo __P((void));
-struct rmxp_tao *
- tcp_gettaocache __P((struct inpcb *));
-void tcp_init __P((void));
-void tcp_input __P((struct mbuf *, int));
-void tcp_mss __P((struct tcpcb *, int));
-int tcp_mssopt __P((struct tcpcb *));
-void tcp_mtudisc __P((struct inpcb *, int));
-struct tcpcb *
- tcp_newtcpcb __P((struct inpcb *));
-int tcp_output __P((struct tcpcb *));
-void tcp_quench __P((struct inpcb *, int));
-void tcp_respond __P((struct tcpcb *,
- struct tcpiphdr *, struct mbuf *, u_long, u_long, int));
-struct rtentry *
- tcp_rtlookup __P((struct inpcb *));
-void tcp_setpersist __P((struct tcpcb *));
-void tcp_slowtimo __P((void));
-struct tcpiphdr *
- tcp_template __P((struct tcpcb *));
-struct tcpcb *
- tcp_timers __P((struct tcpcb *, int));
-void tcp_trace __P((int, int, struct tcpcb *, struct tcpiphdr *, int));
-
-extern struct pr_usrreqs tcp_usrreqs;
-extern u_long tcp_sendspace;
-extern u_long tcp_recvspace;
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_TCP_VAR_H_ */
diff --git a/c/src/libnetworking/netinet/tcpip.h b/c/src/libnetworking/netinet/tcpip.h
deleted file mode 100644
index b8634bfd15..0000000000
--- a/c/src/libnetworking/netinet/tcpip.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcpip.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCPIP_H_
-#define _NETINET_TCPIP_H_
-
-/*
- * Tcp+ip header, after ip options removed.
- */
-struct tcpiphdr {
- struct ipovly ti_i; /* overlaid ip structure */
- struct tcphdr ti_t; /* tcp header */
-};
-#ifdef notyet
-/*
- * Tcp+ip header, after ip options removed but including TCP options.
- */
-struct full_tcpiphdr {
- struct ipovly ti_i; /* overlaid ip structure */
- struct tcphdr ti_t; /* tcp header */
- char ti_o[TCP_MAXOLEN]; /* space for tcp options */
-};
-#endif /* notyet */
-#define ti_next ti_i.ih_next
-#define ti_prev ti_i.ih_prev
-#define ti_x1 ti_i.ih_x1
-#define ti_pr ti_i.ih_pr
-#define ti_len ti_i.ih_len
-#define ti_src ti_i.ih_src
-#define ti_dst ti_i.ih_dst
-#define ti_sport ti_t.th_sport
-#define ti_dport ti_t.th_dport
-#define ti_seq ti_t.th_seq
-#define ti_ack ti_t.th_ack
-#define ti_x2 ti_t.th_x2
-#define ti_off ti_t.th_off
-#define ti_flags ti_t.th_flags
-#define ti_win ti_t.th_win
-#define ti_sum ti_t.th_sum
-#define ti_urp ti_t.th_urp
-
-#endif
diff --git a/c/src/libnetworking/netinet/udp.h b/c/src/libnetworking/netinet/udp.h
deleted file mode 100644
index e73e1f4ddb..0000000000
--- a/c/src/libnetworking/netinet/udp.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)udp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_UDP_H_
-#define _NETINET_UDP_H_
-
-/*
- * Udp protocol header.
- * Per RFC 768, September, 1981.
- */
-struct udphdr {
- u_short uh_sport; /* source port */
- u_short uh_dport; /* destination port */
- u_short uh_ulen; /* udp length */
- u_short uh_sum; /* udp checksum */
-};
-
-#endif
diff --git a/c/src/libnetworking/netinet/udp_usrreq.c b/c/src/libnetworking/netinet/udp_usrreq.c
deleted file mode 100644
index 16c5fce2df..0000000000
--- a/c/src/libnetworking/netinet/udp_usrreq.c
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/stat.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/syslog.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-
-/*
- * UDP protocol implementation.
- * Per RFC 768, August, 1980.
- */
-#ifndef COMPAT_42
-static int udpcksum = 1;
-#else
-static int udpcksum = 0; /* XXX */
-#endif
-SYSCTL_INT(_net_inet_udp, UDPCTL_CHECKSUM, checksum, CTLFLAG_RW,
- &udpcksum, 0, "");
-
-static int log_in_vain = 0;
-SYSCTL_INT(_net_inet_udp, OID_AUTO, log_in_vain, CTLFLAG_RW,
- &log_in_vain, 0, "");
-
-static struct inpcbhead udb; /* from udp_var.h */
-static struct inpcbinfo udbinfo;
-
-#ifndef UDBHASHSIZE
-#define UDBHASHSIZE 64
-#endif
-
- struct udpstat udpstat; /* from udp_var.h */
-SYSCTL_STRUCT(_net_inet_udp, UDPCTL_STATS, stats, CTLFLAG_RD,
- &udpstat, udpstat, "");
-
-static struct sockaddr_in udp_in = { sizeof(udp_in), AF_INET };
-
-static void udp_detach __P((struct inpcb *));
-static int udp_output __P((struct inpcb *, struct mbuf *, struct mbuf *,
- struct mbuf *));
-static void udp_notify __P((struct inpcb *, int));
-
-void
-udp_init()
-{
- LIST_INIT(&udb);
- udbinfo.listhead = &udb;
- udbinfo.hashbase = hashinit(UDBHASHSIZE, M_PCB, &udbinfo.hashmask);
-}
-
-void
-udp_input(m, iphlen)
- register struct mbuf *m;
- int iphlen;
-{
- register struct ip *ip;
- register struct udphdr *uh;
- register struct inpcb *inp;
- struct mbuf *opts = 0;
- int len;
- struct ip save_ip;
-
- udpstat.udps_ipackets++;
-
- /*
- * Strip IP options, if any; should skip this,
- * make available to user, and use on returned packets,
- * but we don't yet have a way to check the checksum
- * with options still present.
- */
- if (iphlen > sizeof (struct ip)) {
- ip_stripoptions(m, (struct mbuf *)0);
- iphlen = sizeof(struct ip);
- }
-
- /*
- * Get IP and UDP header together in first mbuf.
- */
- ip = mtod(m, struct ip *);
- if (m->m_len < iphlen + sizeof(struct udphdr)) {
- if ((m = m_pullup(m, iphlen + sizeof(struct udphdr))) == 0) {
- udpstat.udps_hdrops++;
- return;
- }
- ip = mtod(m, struct ip *);
- }
- uh = (struct udphdr *)((caddr_t)ip + iphlen);
-
- /*
- * Make mbuf data length reflect UDP length.
- * If not enough data to reflect UDP length, drop.
- */
- len = ntohs((u_short)uh->uh_ulen);
- if (ip->ip_len != len) {
- if (len > ip->ip_len || len < sizeof(struct udphdr)) {
- udpstat.udps_badlen++;
- goto bad;
- }
- m_adj(m, len - ip->ip_len);
- /* ip->ip_len = len; */
- }
- /*
- * Save a copy of the IP header in case we want restore it
- * for sending an ICMP error message in response.
- */
- save_ip = *ip;
-
- /*
- * Checksum extended UDP header and data.
- */
- if (uh->uh_sum) {
- ((struct ipovly *)ip)->ih_next = 0;
- ((struct ipovly *)ip)->ih_prev = 0;
- ((struct ipovly *)ip)->ih_x1 = 0;
- ((struct ipovly *)ip)->ih_len = uh->uh_ulen;
- uh->uh_sum = in_cksum(m, len + sizeof (struct ip));
- if (uh->uh_sum) {
- udpstat.udps_badsum++;
- m_freem(m);
- return;
- }
- }
-
- if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
- in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) {
- struct inpcb *last;
- /*
- * Deliver a multicast or broadcast datagram to *all* sockets
- * for which the local and remote addresses and ports match
- * those of the incoming datagram. This allows more than
- * one process to receive multi/broadcasts on the same port.
- * (This really ought to be done for unicast datagrams as
- * well, but that would cause problems with existing
- * applications that open both address-specific sockets and
- * a wildcard socket listening to the same port -- they would
- * end up receiving duplicates of every unicast datagram.
- * Those applications open the multiple sockets to overcome an
- * inadequacy of the UDP socket interface, but for backwards
- * compatibility we avoid the problem here rather than
- * fixing the interface. Maybe 4.5BSD will remedy this?)
- */
-
- /*
- * Construct sockaddr format source address.
- */
- udp_in.sin_port = uh->uh_sport;
- udp_in.sin_addr = ip->ip_src;
- m->m_len -= sizeof (struct udpiphdr);
- m->m_data += sizeof (struct udpiphdr);
- /*
- * Locate pcb(s) for datagram.
- * (Algorithm copied from raw_intr().)
- */
- last = NULL;
- for (inp = udb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_lport != uh->uh_dport)
- continue;
- if (inp->inp_laddr.s_addr != INADDR_ANY) {
- if (inp->inp_laddr.s_addr !=
- ip->ip_dst.s_addr)
- continue;
- }
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- if (inp->inp_faddr.s_addr !=
- ip->ip_src.s_addr ||
- inp->inp_fport != uh->uh_sport)
- continue;
- }
-
- if (last != NULL) {
- struct mbuf *n;
-
- if ((n = m_copy(m, 0, M_COPYALL)) != NULL) {
- if (last->inp_flags & INP_CONTROLOPTS
- || last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, n);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&udp_in,
- n, opts) == 0) {
- m_freem(n);
- if (opts)
- m_freem(opts);
- udpstat.udps_fullsock++;
- } else
- sorwakeup(last->inp_socket);
- opts = 0;
- }
- }
- last = inp;
- /*
- * Don't look for additional matches if this one does
- * not have either the SO_REUSEPORT or SO_REUSEADDR
- * socket options set. This heuristic avoids searching
- * through all pcbs in the common case of a non-shared
- * port. It * assumes that an application will never
- * clear these options after setting them.
- */
- if (((last->inp_socket->so_options&(SO_REUSEPORT|SO_REUSEADDR)) == 0))
- break;
- }
-
- if (last == NULL) {
- /*
- * No matching pcb found; discard datagram.
- * (No need to send an ICMP Port Unreachable
- * for a broadcast or multicast datgram.)
- */
- udpstat.udps_noportbcast++;
- goto bad;
- }
- if (last->inp_flags & INP_CONTROLOPTS
- || last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, m);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&udp_in,
- m, opts) == 0) {
- udpstat.udps_fullsock++;
- goto bad;
- }
- sorwakeup(last->inp_socket);
- return;
- }
- /*
- * Locate pcb for datagram.
- */
- inp = in_pcblookuphash(&udbinfo, ip->ip_src, uh->uh_sport,
- ip->ip_dst, uh->uh_dport, 1);
- if (inp == NULL) {
- if (log_in_vain) {
- char buf[4*sizeof "123"];
-
- strcpy(buf, inet_ntoa(ip->ip_dst));
- log(LOG_INFO, "Connection attempt to UDP %s:%d"
- " from %s:%d\n",
- buf, ntohs(uh->uh_dport),
- inet_ntoa(ip->ip_src), ntohs(uh->uh_sport));
- }
- udpstat.udps_noport++;
- if (m->m_flags & (M_BCAST | M_MCAST)) {
- udpstat.udps_noportbcast++;
- goto bad;
- }
- *ip = save_ip;
- icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0);
- return;
- }
-
- /*
- * Construct sockaddr format source address.
- * Stuff source address and datagram in user buffer.
- */
- udp_in.sin_port = uh->uh_sport;
- udp_in.sin_addr = ip->ip_src;
- if (inp->inp_flags & INP_CONTROLOPTS
- || inp->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(inp, &opts, ip, m);
- iphlen += sizeof(struct udphdr);
- m->m_len -= iphlen;
- m->m_pkthdr.len -= iphlen;
- m->m_data += iphlen;
- if (sbappendaddr(&inp->inp_socket->so_rcv, (struct sockaddr *)&udp_in,
- m, opts) == 0) {
- udpstat.udps_fullsock++;
- goto bad;
- }
- sorwakeup(inp->inp_socket);
- return;
-bad:
- m_freem(m);
- if (opts)
- m_freem(opts);
-}
-
-/*
- * Notify a udp user of an asynchronous error;
- * just wake up so that he can collect error status.
- */
-static void
-udp_notify(inp, errnum)
- register struct inpcb *inp;
- int errnum;
-{
- inp->inp_socket->so_error = errnum;
- sorwakeup(inp->inp_socket);
- sowwakeup(inp->inp_socket);
-}
-
-void
-udp_ctlinput(cmd, sa, vip)
- int cmd;
- struct sockaddr *sa;
- void *vip;
-{
- register struct ip *ip = vip;
- register struct udphdr *uh;
-
- if (!PRC_IS_REDIRECT(cmd) &&
- ((unsigned)cmd >= PRC_NCMDS || inetctlerrmap[cmd] == 0))
- return;
- if (ip) {
- uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2));
- in_pcbnotify(&udb, sa, uh->uh_dport, ip->ip_src, uh->uh_sport,
- cmd, udp_notify);
- } else
- in_pcbnotify(&udb, sa, 0, zeroin_addr, 0, cmd, udp_notify);
-}
-
-static int
-udp_output(inp, m, addr, control)
- register struct inpcb *inp;
- register struct mbuf *m;
- struct mbuf *addr, *control;
-{
- register struct udpiphdr *ui;
- register int len = m->m_pkthdr.len;
- struct in_addr laddr;
- int s = 0, error = 0;
-
- if (control)
- m_freem(control); /* XXX */
-
- if (len + sizeof(struct udpiphdr) > IP_MAXPACKET) {
- error = EMSGSIZE;
- goto release;
- }
-
- if (addr) {
- laddr = inp->inp_laddr;
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- error = EISCONN;
- goto release;
- }
- /*
- * Must block input while temporarily connected.
- */
- s = splnet();
- error = in_pcbconnect(inp, addr);
- if (error) {
- splx(s);
- goto release;
- }
- } else {
- if (inp->inp_faddr.s_addr == INADDR_ANY) {
- error = ENOTCONN;
- goto release;
- }
- }
- /*
- * Calculate data length and get a mbuf
- * for UDP and IP headers.
- */
- M_PREPEND(m, sizeof(struct udpiphdr), M_DONTWAIT);
- if (m == 0) {
- error = ENOBUFS;
- if (addr)
- splx(s);
- goto release;
- }
-
- /*
- * Fill in mbuf with extended UDP header
- * and addresses and length put into network format.
- */
- ui = mtod(m, struct udpiphdr *);
- ui->ui_next = ui->ui_prev = 0;
- ui->ui_x1 = 0;
- ui->ui_pr = IPPROTO_UDP;
- ui->ui_len = htons((u_short)len + sizeof (struct udphdr));
- ui->ui_src = inp->inp_laddr;
- ui->ui_dst = inp->inp_faddr;
- ui->ui_sport = inp->inp_lport;
- ui->ui_dport = inp->inp_fport;
- ui->ui_ulen = ui->ui_len;
-
- /*
- * Stuff checksum and output datagram.
- */
- ui->ui_sum = 0;
- if (udpcksum) {
- if ((ui->ui_sum = in_cksum(m, sizeof (struct udpiphdr) + len)) == 0)
- ui->ui_sum = 0xffff;
- }
- ((struct ip *)ui)->ip_len = sizeof (struct udpiphdr) + len;
- ((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; /* XXX */
- ((struct ip *)ui)->ip_tos = inp->inp_ip_tos; /* XXX */
- udpstat.udps_opackets++;
- error = ip_output(m, inp->inp_options, &inp->inp_route,
- inp->inp_socket->so_options & (SO_DONTROUTE | SO_BROADCAST),
- inp->inp_moptions);
-
- if (addr) {
- in_pcbdisconnect(inp);
- inp->inp_laddr = laddr;
- splx(s);
- }
- return (error);
-
-release:
- m_freem(m);
- return (error);
-}
-
-static u_long udp_sendspace = 9216; /* really max datagram size */
- /* 40 1K datagrams */
-SYSCTL_INT(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW,
- &udp_sendspace, 0, "");
-
-static u_long udp_recvspace = 40 * (1024 + sizeof(struct sockaddr_in));
-SYSCTL_INT(_net_inet_udp, UDPCTL_RECVSPACE, recvspace, CTLFLAG_RW,
- &udp_recvspace, 0, "");
-
-/*ARGSUSED*/
-int
-udp_usrreq(so, req, m, addr, control)
- struct socket *so;
- int req;
- struct mbuf *m, *addr, *control;
-{
- struct inpcb *inp = sotoinpcb(so);
- int error = 0;
- int s;
-
- if (req == PRU_CONTROL)
- return (in_control(so, (u_long)m, (caddr_t)addr,
- (struct ifnet *)control));
- if (inp == NULL && req != PRU_ATTACH) {
- error = EINVAL;
- goto release;
- }
- /*
- * Note: need to block udp_input while changing
- * the udp pcb queue and/or pcb addresses.
- */
- switch (req) {
-
- case PRU_ATTACH:
- if (inp != NULL) {
- error = EINVAL;
- break;
- }
- s = splnet();
- error = in_pcballoc(so, &udbinfo);
- splx(s);
- if (error)
- break;
- error = soreserve(so, udp_sendspace, udp_recvspace);
- if (error)
- break;
- ((struct inpcb *) so->so_pcb)->inp_ip_ttl = ip_defttl;
- break;
-
- case PRU_DETACH:
- udp_detach(inp);
- break;
-
- case PRU_BIND:
- s = splnet();
- error = in_pcbbind(inp, addr);
- splx(s);
- break;
-
- case PRU_LISTEN:
- error = EOPNOTSUPP;
- break;
-
- case PRU_CONNECT:
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- error = EISCONN;
- break;
- }
- s = splnet();
- error = in_pcbconnect(inp, addr);
- splx(s);
- if (error == 0)
- soisconnected(so);
- break;
-
- case PRU_CONNECT2:
- error = EOPNOTSUPP;
- break;
-
- case PRU_ACCEPT:
- error = EOPNOTSUPP;
- break;
-
- case PRU_DISCONNECT:
- if (inp->inp_faddr.s_addr == INADDR_ANY) {
- error = ENOTCONN;
- break;
- }
- s = splnet();
- in_pcbdisconnect(inp);
- inp->inp_laddr.s_addr = INADDR_ANY;
- splx(s);
- so->so_state &= ~SS_ISCONNECTED; /* XXX */
- break;
-
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- case PRU_SEND:
- return (udp_output(inp, m, addr, control));
-
- case PRU_ABORT:
- soisdisconnected(so);
- udp_detach(inp);
- break;
-
- case PRU_SOCKADDR:
- in_setsockaddr(inp, addr);
- break;
-
- case PRU_PEERADDR:
- in_setpeeraddr(inp, addr);
- break;
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- case PRU_SENDOOB:
- case PRU_FASTTIMO:
- case PRU_SLOWTIMO:
- case PRU_PROTORCV:
- case PRU_PROTOSEND:
- error = EOPNOTSUPP;
- break;
-
- case PRU_RCVD:
- case PRU_RCVOOB:
- return (EOPNOTSUPP); /* do not free mbuf's */
-
- default:
- panic("udp_usrreq");
- }
-
-release:
- if (control) {
- printf("udp control data unexpectedly retained\n");
- m_freem(control);
- }
- if (m)
- m_freem(m);
- return (error);
-}
-
-static void
-udp_detach(inp)
- struct inpcb *inp;
-{
- int s = splnet();
-
- in_pcbdetach(inp);
- splx(s);
-}
diff --git a/c/src/libnetworking/netinet/udp_var.h b/c/src/libnetworking/netinet/udp_var.h
deleted file mode 100644
index 90785b53de..0000000000
--- a/c/src/libnetworking/netinet/udp_var.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 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.
- *
- * @(#)udp_var.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_UDP_VAR_H_
-#define _NETINET_UDP_VAR_H_
-
-/*
- * UDP kernel structures and variables.
- */
-struct udpiphdr {
- struct ipovly ui_i; /* overlaid ip structure */
- struct udphdr ui_u; /* udp header */
-};
-#define ui_next ui_i.ih_next
-#define ui_prev ui_i.ih_prev
-#define ui_x1 ui_i.ih_x1
-#define ui_pr ui_i.ih_pr
-#define ui_len ui_i.ih_len
-#define ui_src ui_i.ih_src
-#define ui_dst ui_i.ih_dst
-#define ui_sport ui_u.uh_sport
-#define ui_dport ui_u.uh_dport
-#define ui_ulen ui_u.uh_ulen
-#define ui_sum ui_u.uh_sum
-
-struct udpstat {
- /* input statistics: */
- u_long udps_ipackets; /* total input packets */
- u_long udps_hdrops; /* packet shorter than header */
- u_long udps_badsum; /* checksum error */
- u_long udps_badlen; /* data length larger than packet */
- u_long udps_noport; /* no socket on port */
- u_long udps_noportbcast; /* of above, arrived as broadcast */
- u_long udps_fullsock; /* not delivered, input socket full */
- u_long udpps_pcbcachemiss; /* input packets missing pcb cache */
- u_long udpps_pcbhashmiss; /* input packets not for hashed pcb */
- /* output statistics: */
- u_long udps_opackets; /* total output packets */
-};
-
-/*
- * Names for UDP sysctl objects
- */
-#define UDPCTL_CHECKSUM 1 /* checksum UDP packets */
-#define UDPCTL_STATS 2 /* statistics (read-only) */
-#define UDPCTL_MAXDGRAM 3 /* max datagram size */
-#define UDPCTL_RECVSPACE 4 /* default receive buffer space */
-#define UDPCTL_MAXID 5
-
-#define UDPCTL_NAMES { \
- { 0, 0 }, \
- { "checksum", CTLTYPE_INT }, \
- { "stats", CTLTYPE_STRUCT }, \
- { "maxdgram", CTLTYPE_INT }, \
- { "recvspace", CTLTYPE_INT }, \
-}
-
-#ifdef KERNEL
-extern struct inpcbhead udb;
-extern struct inpcbinfo udbinfo;
-extern struct udpstat udpstat;
-
-void udp_ctlinput __P((int, struct sockaddr *, void *));
-void udp_init __P((void));
-void udp_input __P((struct mbuf *, int));
-int udp_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-#endif
-
-#endif
diff --git a/c/src/libnetworking/nfs/Makefile.in b/c/src/libnetworking/nfs/Makefile.in
deleted file mode 100644
index 404d85040a..0000000000
--- a/c/src/libnetworking/nfs/Makefile.in
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=lib.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES= bootp_subr
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \
- -DDIAGNOSTIC -DBOOTP_COMPAT
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
diff --git a/c/src/libnetworking/nfs/bootp_subr.c b/c/src/libnetworking/nfs/bootp_subr.c
deleted file mode 100644
index cb7d3d3407..0000000000
--- a/c/src/libnetworking/nfs/bootp_subr.c
+++ /dev/null
@@ -1,968 +0,0 @@
-/* $Id$ */
-
-/*
- * Copyright (c) 1995 Gordon Ross, Adam Glass
- * Copyright (c) 1992 Regents of the University of California.
- * All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * 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, Lawrence Berkeley Laboratory 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.
- *
- * based on:
- * nfs/krpc_subr.c
- * $NetBSD: krpc_subr.c,v 1.10 1995/08/08 20:43:43 gwr Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/conf.h>
-#include <sys/sockio.h>
-#include <sys/proc.h>
-#include <sys/mount.h>
-#include <sys/mbuf.h>
-#include <sys/reboot.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <net/if_types.h>
-#include <net/if_dl.h>
-#include <netinet/if_ether.h>
-
-#include <nfs/rpcv2.h>
-#include <nfs/nfsproto.h>
-#include <nfs/nfs.h>
-#include <nfs/nfsdiskless.h>
-#include <nfs/krpc.h>
-#include <nfs/xdr_subs.h>
-
-#define BOOTP_MIN_LEN 300 /* Minimum size of bootp udp packet */
-
-/*
- * What is the longest we will wait before re-sending a request?
- * Note this is also the frequency of "RPC timeout" messages.
- * The re-send loop count sup linearly to this maximum, so the
- * first complaint will happen after (1+2+3+4+5)=15 seconds.
- */
-#define MAX_RESEND_DELAY 5 /* seconds */
-
-/* Definitions from RFC951 */
-struct bootp_packet {
- u_int8_t op;
- u_int8_t htype;
- u_int8_t hlen;
- u_int8_t hops;
- u_int32_t xid;
- u_int16_t secs;
- u_int16_t flags;
- struct in_addr ciaddr;
- struct in_addr yiaddr;
- struct in_addr siaddr;
- struct in_addr giaddr;
- unsigned char chaddr[16];
- char sname[64];
- char file[128];
- unsigned char vend[256];
-};
-
-#define IPPORT_BOOTPC 68
-#define IPPORT_BOOTPS 67
-
-extern int nfs_diskless_valid;
-extern struct nfsv3_diskless nfsv3_diskless;
-
-/* mountd RPC */
-#if !defined(__rtems__)
-static int md_mount __P((struct sockaddr_in *mdsin, char *path,
- u_char *fhp, int *fhsizep, struct nfs_args *args,struct proc *procp));
-static int md_lookup_swap __P((struct sockaddr_in *mdsin,char *path,
- u_char *fhp, int *fhsizep,
- struct nfs_args *args,
- struct proc *procp));
-static int setfs __P((struct sockaddr_in *addr, char *path, char *p));
-#endif
-static int getdec __P((char **ptr));
-static char *substr __P((char *a,char *b));
-#if !defined(__rtems__)
-static void mountopts __P((struct nfs_args *args, char *p));
-static int xdr_opaque_decode __P((struct mbuf **ptr,u_char *buf,
- int len));
-static int xdr_int_decode __P((struct mbuf **ptr,int *iptr));
-#endif
-static void printip __P((char *prefix,struct in_addr addr));
-
-#ifdef BOOTP_DEBUG
-void bootpboot_p_sa(struct sockaddr *sa,struct sockaddr *ma);
-void bootpboot_p_ma(struct sockaddr *ma);
-void bootpboot_p_rtentry(struct rtentry *rt);
-void bootpboot_p_tree(struct radix_node *rn);
-void bootpboot_p_rtlist(void);
-void bootpboot_p_iflist(void);
-#endif
-
-int bootpc_call(struct bootp_packet *call,
- struct bootp_packet *reply,
- struct proc *procp);
-
-int bootpc_fakeup_interface(struct ifreq *ireq,struct socket *so,
- struct proc *procp);
-
-int
-bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
- struct sockaddr_in *myaddr,
- struct sockaddr_in *netmask,
- struct sockaddr_in *gw,
- struct proc *procp);
-
-void bootpc_init(void);
-
-#ifdef BOOTP_DEBUG
-void bootpboot_p_sa(sa,ma)
- struct sockaddr *sa;
- struct sockaddr *ma;
-{
- if (!sa) {
- printf("(sockaddr *) <null>");
- return;
- }
- switch (sa->sa_family) {
- case AF_INET:
- {
- struct sockaddr_in *sin = (struct sockaddr_in *) sa;
- printf("inet %x",ntohl(sin->sin_addr.s_addr));
- if (ma) {
- struct sockaddr_in *sin = (struct sockaddr_in *) ma;
- printf(" mask %x",ntohl(sin->sin_addr.s_addr));
- }
- }
- break;
- case AF_LINK:
- {
- struct sockaddr_dl *sli = (struct sockaddr_dl *) sa;
- int i;
- printf("link %.*s ",sli->sdl_nlen,sli->sdl_data);
- for (i=0;i<sli->sdl_alen;i++) {
- if (i>0)
- printf(":");
- printf("%x",(unsigned char) sli->sdl_data[i+sli->sdl_nlen]);
- }
- }
- break;
- default:
- printf("af%d",sa->sa_family);
- }
-}
-
-void bootpboot_p_ma(ma)
- struct sockaddr *ma;
-{
- if (!ma) {
- printf("<null>");
- return;
- }
- printf("%x",*(int*)ma);
-}
-
-void bootpboot_p_rtentry(rt)
- struct rtentry *rt;
-{
- bootpboot_p_sa(rt_key(rt),rt_mask(rt));
- printf(" ");
- bootpboot_p_ma(rt->rt_genmask);
- printf(" ");
- bootpboot_p_sa(rt->rt_gateway,NULL);
- printf(" ");
- printf("flags %x",(unsigned short) rt->rt_flags);
- printf(" %d",rt->rt_rmx.rmx_expire);
- printf(" %s%d\n",rt->rt_ifp->if_name,rt->rt_ifp->if_unit);
-}
-void bootpboot_p_tree(rn)
- struct radix_node *rn;
-{
- while (rn) {
- if (rn->rn_b < 0) {
- if (rn->rn_flags & RNF_ROOT) {
- } else {
- bootpboot_p_rtentry((struct rtentry *) rn);
- }
- rn = rn->rn_dupedkey;
- } else {
- bootpboot_p_tree(rn->rn_l);
- bootpboot_p_tree(rn->rn_r);
- return;
- }
-
- }
-}
-
-void bootpboot_p_rtlist(void)
-{
- printf("Routing table:\n");
- bootpboot_p_tree(rt_tables[AF_INET]->rnh_treetop);
-}
-
-void bootpboot_p_iflist(void)
-{
- struct ifnet *ifp;
- struct ifaddr *ifa;
- printf("Interface list:\n");
- for (ifp = TAILQ_FIRST(&ifnet); ifp != 0; ifp = TAILQ_NEXT(ifp,if_link))
- {
- for (ifa = TAILQ_FIRST(&ifp->if_addrhead) ;ifa;
- ifa=TAILQ_NEXT(ifa,ifa_link))
- if (ifa->ifa_addr->sa_family == AF_INET ) {
- printf("%s%d flags %x, addr %x, bcast %x, net %x\n",
- ifp->if_name,ifp->if_unit,
- (unsigned short) ifp->if_flags,
- ntohl(((struct sockaddr_in *) ifa->ifa_addr)->sin_addr.s_addr),
- ntohl(((struct sockaddr_in *) ifa->ifa_dstaddr)->sin_addr.s_addr),
- ntohl(((struct sockaddr_in *) ifa->ifa_netmask)->sin_addr.s_addr)
- );
- }
- }
-}
-#endif
-
-int
-bootpc_call(call,reply,procp)
- struct bootp_packet *call;
- struct bootp_packet *reply; /* output */
- struct proc *procp;
-{
- struct socket *so;
- struct sockaddr_in *sin;
- struct mbuf *m, *nam;
- struct uio auio;
- struct iovec aio;
- int error, rcvflg, timo, secs, len;
-
- /* Free at end if not null. */
- nam = NULL;
-
- /*
- * Create socket and set its recieve timeout.
- */
- if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0,procp)))
- goto out;
-
- m = m_get(M_WAIT, MT_SOOPTS);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- } else {
- struct timeval *tv;
- tv = mtod(m, struct timeval *);
- m->m_len = sizeof(*tv);
- tv->tv_sec = 1;
- tv->tv_usec = 0;
- if ((error = sosetopt(so, SOL_SOCKET, SO_RCVTIMEO, m)))
- goto out;
- }
-
- /*
- * Enable broadcast.
- */
- {
- int *on;
- m = m_get(M_WAIT, MT_SOOPTS);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- }
- on = mtod(m, int *);
- m->m_len = sizeof(*on);
- *on = 1;
- if ((error = sosetopt(so, SOL_SOCKET, SO_BROADCAST, m)))
- goto out;
- }
-
- /*
- * Bind the local endpoint to a bootp client port.
- */
- m = m_getclr(M_WAIT, MT_SONAME);
- sin = mtod(m, struct sockaddr_in *);
- sin->sin_len = m->m_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_ANY;
- sin->sin_port = htons(IPPORT_BOOTPC);
- error = sobind(so, m);
- m_freem(m);
- if (error) {
- printf("bind failed\n");
- goto out;
- }
-
- /*
- * Setup socket address for the server.
- */
- nam = m_get(M_WAIT, MT_SONAME);
- if (nam == NULL) {
- error = ENOBUFS;
- goto out;
- }
- sin = mtod(nam, struct sockaddr_in *);
- sin-> sin_len = sizeof(*sin);
- sin-> sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_BROADCAST;
- sin->sin_port = htons(IPPORT_BOOTPS);
-
- nam->m_len = sizeof(*sin);
-
- /*
- * Send it, repeatedly, until a reply is received,
- * but delay each re-send by an increasing amount.
- * If the delay hits the maximum, start complaining.
- */
- timo = 0;
- for (;;) {
- /* Send BOOTP request (or re-send). */
-
- aio.iov_base = (caddr_t) call;
- aio.iov_len = sizeof(*call);
-
- auio.uio_iov = &aio;
- auio.uio_iovcnt = 1;
- auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_rw = UIO_WRITE;
- auio.uio_offset = 0;
- auio.uio_resid = sizeof(*call);
- auio.uio_procp = procp;
-
- error = sosend(so, nam, &auio, NULL, NULL, 0);
- if (error) {
- printf("bootpc_call: sosend: %d\n", error);
- goto out;
- }
-
- /* Determine new timeout. */
- if (timo < MAX_RESEND_DELAY)
- timo++;
- else
- printf("BOOTP timeout for server 0x%x\n",
- (int)ntohl(sin->sin_addr.s_addr));
-
- /*
- * Wait for up to timo seconds for a reply.
- * The socket receive timeout was set to 1 second.
- */
- secs = timo;
- while (secs > 0) {
- aio.iov_base = (caddr_t) reply;
- aio.iov_len = sizeof(*reply);
-
- auio.uio_iov = &aio;
- auio.uio_iovcnt = 1;
- auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_rw = UIO_READ;
- auio.uio_offset = 0;
- auio.uio_resid = sizeof(*reply);
- auio.uio_procp = procp;
-
- rcvflg = 0;
- error = soreceive(so, NULL, &auio, NULL, NULL, &rcvflg);
- if (error == EWOULDBLOCK) {
- secs--;
- call->secs=htons(ntohs(call->secs)+1);
- continue;
- }
- if (error)
- goto out;
- len = sizeof(*reply) - auio.uio_resid;
-
- /* Do we have the required number of bytes ? */
- if (len < BOOTP_MIN_LEN)
- continue;
-
- /* Is it the right reply? */
- if (reply->op != 2)
- continue;
-
- if (reply->xid != call->xid)
- continue;
-
- if (reply->hlen != call->hlen)
- continue;
-
- if (bcmp(reply->chaddr,call->chaddr,call->hlen))
- continue;
-
- goto gotreply; /* break two levels */
-
- } /* while secs */
- } /* forever send/receive */
-
- error = ETIMEDOUT;
- goto out;
-
- gotreply:
- out:
- if (nam) m_freem(nam);
- soclose(so);
- return error;
-}
-
-int
-bootpc_fakeup_interface(struct ifreq *ireq,struct socket *so,
- struct proc *procp)
-{
- struct sockaddr_in *sin;
- int error;
- struct sockaddr_in dst;
- struct sockaddr_in gw;
- struct sockaddr_in mask;
-
- /*
- * Bring up the interface.
- *
- * Get the old interface flags and or IFF_UP into them; if
- * IFF_UP set blindly, interface selection can be clobbered.
- */
- error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: GIFFLAGS, error=%d", error);
- ireq->ifr_flags |= IFF_UP;
- error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: SIFFLAGS, error=%d", error);
-
- /*
- * Do enough of ifconfig(8) so that the chosen interface
- * can talk to the servers. (just set the address)
- */
-
- /* addr is 0.0.0.0 */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_ANY;
- error = ifioctl(so, SIOCSIFADDR, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: set if addr, error=%d", error);
-
- /* netmask is 0.0.0.0 */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_ANY;
- error = ifioctl(so, SIOCSIFNETMASK, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: set if net addr, error=%d", error);
-
- /* Broadcast is 255.255.255.255 */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_BROADCAST;
- error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: set if broadcast addr, error=%d", error);
-
- /* Add default route to 0.0.0.0 so we can send data */
-
- bzero((caddr_t) &dst, sizeof(dst));
- dst.sin_len=sizeof(dst);
- dst.sin_family=AF_INET;
- dst.sin_addr.s_addr = htonl(0);
-
- bzero((caddr_t) &gw, sizeof(gw));
- gw.sin_len=sizeof(gw);
- gw.sin_family=AF_INET;
- gw.sin_addr.s_addr = htonl(0x0);
-
- bzero((caddr_t) &mask, sizeof(mask));
- mask.sin_len=sizeof(mask);
- mask.sin_family=AF_INET;
- mask.sin_addr.s_addr = htonl(0);
-
- error = rtrequest(RTM_ADD,
- (struct sockaddr *) &dst,
- (struct sockaddr *) &gw,
- (struct sockaddr *) &mask,
- RTF_UP | RTF_STATIC
- , NULL);
- if (error)
- printf("bootpc_fakeup_interface: add default route, error=%d\n", error);
- return error;
-}
-
-int
-bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
- struct sockaddr_in *myaddr,
- struct sockaddr_in *netmask,
- struct sockaddr_in *gw,
- struct proc *procp)
-{
- int error;
- struct sockaddr_in oldgw;
- struct sockaddr_in olddst;
- struct sockaddr_in oldmask;
- struct sockaddr_in *sin;
-
- /* Remove old default route to 0.0.0.0 */
-
- bzero((caddr_t) &olddst, sizeof(olddst));
- olddst.sin_len=sizeof(olddst);
- olddst.sin_family=AF_INET;
- olddst.sin_addr.s_addr = INADDR_ANY;
-
- bzero((caddr_t) &oldgw, sizeof(oldgw));
- oldgw.sin_len=sizeof(oldgw);
- oldgw.sin_family=AF_INET;
- oldgw.sin_addr.s_addr = INADDR_ANY;
-
- bzero((caddr_t) &oldmask, sizeof(oldmask));
- oldmask.sin_len=sizeof(oldmask);
- oldmask.sin_family=AF_INET;
- oldmask.sin_addr.s_addr = INADDR_ANY;
-
- error = rtrequest(RTM_DELETE,
- (struct sockaddr *) &olddst,
- (struct sockaddr *) &oldgw,
- (struct sockaddr *) &oldmask,
- (RTF_UP | RTF_STATIC), NULL);
- if (error) {
- printf("nfs_boot: del default route, error=%d\n", error);
- return error;
- }
-
- /*
- * Do enough of ifconfig(8) so that the chosen interface
- * can talk to the servers. (just set the address)
- */
- bcopy(netmask,&ireq->ifr_addr,sizeof(*netmask));
- error = ifioctl(so, SIOCSIFNETMASK, (caddr_t)ireq, procp);
- if (error)
- panic("nfs_boot: set if netmask, error=%d", error);
-
- /* Broadcast is with host part of IP address all 1's */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = myaddr->sin_addr.s_addr | ~ netmask->sin_addr.s_addr;
- error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_call: set if broadcast addr, error=%d", error);
-
- bcopy(myaddr,&ireq->ifr_addr,sizeof(*myaddr));
- error = ifioctl(so, SIOCSIFADDR, (caddr_t)ireq, procp);
- if (error)
- panic("nfs_boot: set if addr, error=%d", error);
-
- /* Add new default route */
-
- error = rtrequest(RTM_ADD,
- (struct sockaddr *) &olddst,
- (struct sockaddr *) gw,
- (struct sockaddr *) &oldmask,
- (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL);
- if (error) {
- printf("nfs_boot: add net route, error=%d\n", error);
- return error;
- }
-
- return 0;
-}
-
-#if !defined(__rtems__)
-static int setfs(addr, path, p)
- struct sockaddr_in *addr;
- char *path;
- char *p;
-{
- unsigned ip = 0;
- int val;
-
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip = val << 24;
- if (*p != '.') return(0);
- p++;
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip |= (val << 16);
- if (*p != '.') return(0);
- p++;
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip |= (val << 8);
- if (*p != '.') return(0);
- p++;
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip |= val;
- if (*p != ':') return(0);
- p++;
-
- addr->sin_addr.s_addr = htonl(ip);
- addr->sin_len = sizeof(struct sockaddr_in);
- addr->sin_family = AF_INET;
-
- strncpy(path,p,MNAMELEN-1);
- return(1);
-}
-#endif
-
-static int getdec(ptr)
- char **ptr;
-{
- char *p = *ptr;
- int ret=0;
- if ((*p < '0') || (*p > '9')) return(-1);
- while ((*p >= '0') && (*p <= '9')) {
- ret = ret*10 + (*p - '0');
- p++;
- }
- *ptr = p;
- return(ret);
-}
-
-static char *substr(a,b)
- char *a,*b;
-{
- char *loc1;
- char *loc2;
-
- while (*a != '\0') {
- loc1 = a;
- loc2 = b;
- while (*loc1 == *loc2++) {
- if (*loc1 == '\0') return (0);
- loc1++;
- if (*loc2 == '\0') return (loc1);
- }
- a++;
- }
- return (0);
-}
-
-static void printip(char *prefix,struct in_addr addr)
-{
- unsigned int ip;
-
- ip = ntohl(addr.s_addr);
-
- printf("%s is %d.%d.%d.%d\n",prefix,
- ip >> 24, (ip >> 16) & 255 ,(ip >> 8) & 255 ,ip & 255 );
-}
-
-void
-bootpc_init(void)
-{
- struct bootp_packet call;
- struct bootp_packet reply;
- static u_int32_t xid = ~0xFF;
-
- struct ifreq ireq;
- struct ifnet *ifp;
- struct socket *so;
- int error;
- int code,ncode,len;
- int j;
- char *p;
- unsigned int ip;
-
- struct sockaddr_in myaddr;
- struct sockaddr_in netmask;
- struct sockaddr_in gw;
- int gotgw=0;
- int gotnetmask=0;
-#if !defined(__rtems__)
- int gotrootpath=0;
- int gotswappath=0;
-#endif
- char lookup_path[24];
-
-#define EALEN 6
-#if !defined(__rtems__)
- unsigned char ea[EALEN];
-#endif
- struct ifaddr *ifa;
- struct sockaddr_dl *sdl = NULL;
- char *delim;
- struct proc *procp = NULL;
-
- /*
- * If already filled in, don't touch it here
- */
- if (nfs_diskless_valid)
- return;
-
- /*
- * Bump time if 0.
- if (!time.tv_sec)
- time.tv_sec++;
- */
-
- /*
- * Find a network interface.
- */
- for (ifp = ifnet; ifp != 0; ifp = ifp->if_next)
- if ((ifp->if_flags &
- (IFF_LOOPBACK|IFF_POINTOPOINT)) == 0)
- break;
- if (ifp == NULL)
- panic("bootpc_init: no suitable interface");
- bzero(&ireq,sizeof(ireq));
- sprintf(ireq.ifr_name, "%s%d", ifp->if_name,ifp->if_unit);
- printf("bootpc_init: using network interface '%s'\n",
- ireq.ifr_name);
-
- if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0,procp)) != 0)
- panic("nfs_boot: socreate, error=%d", error);
-
- bootpc_fakeup_interface(&ireq,so,procp);
-
- printf("Bootpc testing starting\n");
-
- /* Get HW address */
-
- for (ifa = ifp->if_addrlist;ifa; ifa = ifa->ifa_next)
- if (ifa->ifa_addr->sa_family == AF_LINK &&
- (sdl = ((struct sockaddr_dl *) ifa->ifa_addr)) &&
- sdl->sdl_type == IFT_ETHER)
- break;
-
- if (!sdl)
- panic("bootpc: Unable to find HW address");
- if (sdl->sdl_alen != EALEN )
- panic("bootpc: HW address len is %d, expected value is %d",
- sdl->sdl_alen,EALEN);
-
- printf("bootpc hw address is ");
- delim="";
- for (j=0;j<sdl->sdl_alen;j++) {
- printf("%s%x",delim,((unsigned char *)LLADDR(sdl))[j]);
- delim=":";
- }
- printf("\n");
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
-
- bzero((caddr_t) &call, sizeof(call));
-
- /* bootpc part */
- call.op = 1; /* BOOTREQUEST */
- call.htype= 1; /* 10mb ethernet */
- call.hlen=sdl->sdl_alen; /* Hardware address length */
- call.hops=0;
- xid++;
- call.xid = txdr_unsigned(xid);
- bcopy(LLADDR(sdl),&call.chaddr,sdl->sdl_alen);
-
- call.vend[0]=99;
- call.vend[1]=130;
- call.vend[2]=83;
- call.vend[3]=99;
- call.vend[4]=255;
-
- call.secs = 0;
- call.flags = htons(0x8000); /* We need an broadcast answer */
-
- error = bootpc_call(&call,&reply,procp);
-
- if (error)
- panic("BOOTP call failed -- error %d", error);
-
- bzero(&myaddr,sizeof(myaddr));
- bzero(&netmask,sizeof(netmask));
- bzero(&gw,sizeof(gw));
-
- myaddr.sin_len = sizeof(myaddr);
- myaddr.sin_family = AF_INET;
-
- netmask.sin_len = sizeof(netmask);
- netmask.sin_family = AF_INET;
-
- gw.sin_len = sizeof(gw);
- gw.sin_family= AF_INET;
-
- rtems_bsdnet_bootp_server_address = reply.siaddr;
- rtems_bsdnet_log_host_address = reply.siaddr;
-
- myaddr.sin_addr = reply.yiaddr;
-
- ip = ntohl(myaddr.sin_addr.s_addr);
- sprintf(lookup_path,"swap.%d.%d.%d.%d",
- ip >> 24, (ip >> 16) & 255 ,(ip >> 8) & 255 ,ip & 255 );
-
- printip("My ip address",myaddr.sin_addr);
-
- printip("Server ip address",reply.siaddr);
-
- gw.sin_addr = reply.giaddr;
- printip("Gateway ip address",reply.giaddr);
-
- if (reply.sname[0])
- printf("Server name is %s\n",reply.sname);
- if (reply.file[0])
- printf("boot file is %s\n",reply.file);
- rtems_bsdnet_bootp_boot_file_name = strdup (reply.file);
- if (reply.vend[0]==99 && reply.vend[1]==130 &&
- reply.vend[2]==83 && reply.vend[3]==99) {
- j=4;
- ncode = reply.vend[j];
- while (j<sizeof(reply.vend)) {
- code = reply.vend[j] = ncode;
- if (code==255)
- break;
- if (code==0) {
- j++;
- continue;
- }
- len = reply.vend[j+1];
- j+=2;
- if (len+j>=sizeof(reply.vend)) {
- printf("Truncated field");
- break;
- }
- ncode = reply.vend[j+len];
- reply.vend[j+len]='\0';
- p = &reply.vend[j];
- switch (code) {
- case 1:
- if (len!=4)
- panic("bootpc: subnet mask len is %d",len);
- bcopy(&reply.vend[j],&netmask.sin_addr,4);
- gotnetmask=1;
- printip("Subnet mask",netmask.sin_addr);
- break;
- case 6:
- /* Domain Name servers */
- if (len % 4)
- panic("bootpc: DNS Len is %d",len);
- {
- int dlen = 0;
- while ((dlen < len) &&
- (rtems_bsdnet_nameserver_count < sizeof rtems_bsdnet_config.name_server /
- sizeof rtems_bsdnet_config.name_server[0])) {
- bcopy(&reply.vend[j+dlen],
- &rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count],
- 4);
- printip("Domain Name Server",
- rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count]);
- rtems_bsdnet_nameserver_count++;
- dlen += 4;
- }
- }
- break;
- case 16: /* Swap server IP address. unused */
- case 2:
- /* Time offset */
- break;
- case 3:
- /* Routers */
- if (len % 4)
- panic("bootpc: Router Len is %d",len);
- if (len > 0) {
- bcopy(&reply.vend[j],&gw.sin_addr,4);
- printip("Router",gw.sin_addr);
- gotgw=1;
- }
- break;
- case 7:
- /* Log servers */
- if (len % 4)
- panic("bootpc: Log server len is %d",len);
- if (len > 0) {
- bcopy(&reply.vend[j],&rtems_bsdnet_log_host_address,4);
- printip("Log server",rtems_bsdnet_log_host_address);
- }
- break;
- case 12:
- if (len>=MAXHOSTNAMELEN)
- panic("bootpc: hostname >=%d bytes",MAXHOSTNAMELEN);
- if (sethostname (&reply.vend[j], len) < 0)
- panic("Can't set host name");
- printf("Hostname is %.*s\n",len,&reply.vend[j]);
- break;
- case 15:
- /* Domain name */
- rtems_bsdnet_domain_name = strdup (&reply.vend[j]);
- if (rtems_bsdnet_domain_name)
- printf("Domain name is %s\n", rtems_bsdnet_domain_name);
- break;
- default:
- printf("Ignoring field type %d\n",code);
- }
- j+=len;
- }
- }
-
- if (!gotnetmask) {
- if (IN_CLASSA(ntohl(myaddr.sin_addr.s_addr)))
- netmask.sin_addr.s_addr = htonl(IN_CLASSA_NET);
- else if (IN_CLASSB(ntohl(myaddr.sin_addr.s_addr)))
- netmask.sin_addr.s_addr = htonl(IN_CLASSB_NET);
- else
- netmask.sin_addr.s_addr = htonl(IN_CLASSC_NET);
- }
- if (!gotgw) {
- /* Use proxyarp */
- gw.sin_addr.s_addr = myaddr.sin_addr.s_addr;
- }
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
- error = bootpc_adjust_interface(&ireq,so,
- &myaddr,&netmask,&gw,procp);
-
- soclose(so);
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
-
-
-#if 0
- myaddr.sin_addr.s_addr | ~ netmask.sin_addr.s_addr;
-#endif
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
- return;
-}
diff --git a/c/src/libnetworking/nfs/krpc.h b/c/src/libnetworking/nfs/krpc.h
deleted file mode 100644
index 8a21392657..0000000000
--- a/c/src/libnetworking/nfs/krpc.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* $NetBSD: krpc.h,v 1.4 1995/12/19 23:07:11 cgd Exp $ */
-/* $Id$ */
-
-#include <sys/cdefs.h>
-
-int krpc_call __P((struct sockaddr_in *sin,
- u_int prog, u_int vers, u_int func,
- struct mbuf **data, struct mbuf **from, struct proc *procp));
-
-int krpc_portmap __P((struct sockaddr_in *sin,
- u_int prog, u_int vers, u_int16_t *portp, struct proc *procp));
-
-struct mbuf *xdr_string_encode __P((char *str, int len));
-
-/*
- * RPC definitions for the portmapper
- */
-#define PMAPPORT 111
-#define PMAPPROG 100000
-#define PMAPVERS 2
-#define PMAPPROC_NULL 0
-#define PMAPPROC_SET 1
-#define PMAPPROC_UNSET 2
-#define PMAPPROC_GETPORT 3
-#define PMAPPROC_DUMP 4
-#define PMAPPROC_CALLIT 5
diff --git a/c/src/libnetworking/nfs/nfs.h b/c/src/libnetworking/nfs/nfs.h
deleted file mode 100644
index 68f206e213..0000000000
--- a/c/src/libnetworking/nfs/nfs.h
+++ /dev/null
@@ -1,620 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)nfs.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_NFS_H_
-#define _NFS_NFS_H_
-
-#include <nfs/rpcv2.h>
-
-/*
- * Tunable constants for nfs
- */
-
-#define NFS_MAXIOVEC 34
-#define NFS_TICKINTVL 5 /* Desired time for a tick (msec) */
-#define NFS_HZ (hz / nfs_ticks) /* Ticks/sec */
-#define NFS_TIMEO (1 * NFS_HZ) /* Default timeout = 1 second */
-#define NFS_MINTIMEO (1 * NFS_HZ) /* Min timeout to use */
-#define NFS_MAXTIMEO (60 * NFS_HZ) /* Max timeout to backoff to */
-#define NFS_MINIDEMTIMEO (5 * NFS_HZ) /* Min timeout for non-idempotent ops*/
-#define NFS_MAXREXMIT 100 /* Stop counting after this many */
-#define NFS_MAXWINDOW 1024 /* Max number of outstanding requests */
-#define NFS_RETRANS 10 /* Num of retrans for soft mounts */
-#define NFS_MAXGRPS 16 /* Max. size of groups list */
-#ifndef NFS_MINATTRTIMO
-#define NFS_MINATTRTIMO 5 /* Attribute cache timeout in sec */
-#endif
-#ifndef NFS_MAXATTRTIMO
-#define NFS_MAXATTRTIMO 60
-#endif
-#define NFS_WSIZE 8192 /* Def. write data size <= 8192 */
-#define NFS_RSIZE 8192 /* Def. read data size <= 8192 */
-#define NFS_READDIRSIZE 8192 /* Def. readdir size */
-#define NFS_DEFRAHEAD 1 /* Def. read ahead # blocks */
-#define NFS_MAXRAHEAD 4 /* Max. read ahead # blocks */
-#define NFS_MAXUIDHASH 64 /* Max. # of hashed uid entries/mp */
-#define NFS_MAXASYNCDAEMON 20 /* Max. number async_daemons runnable */
-#define NFS_MAXGATHERDELAY 100 /* Max. write gather delay (msec) */
-#ifndef NFS_GATHERDELAY
-#define NFS_GATHERDELAY 10 /* Default write gather delay (msec) */
-#endif
-#define NFS_DIRBLKSIZ 4096 /* Must be a multiple of DIRBLKSIZ */
-
-/*
- * Oddballs
- */
-#define NMOD(a) ((a) % nfs_asyncdaemons)
-#define NFS_CMPFH(n, f, s) \
- ((n)->n_fhsize == (s) && !bcmp((caddr_t)(n)->n_fhp, (caddr_t)(f), (s)))
-#define NFS_ISV3(v) (VFSTONFS((v)->v_mount)->nm_flag & NFSMNT_NFSV3)
-#define NFS_SRVMAXDATA(n) \
- (((n)->nd_flag & ND_NFSV3) ? (((n)->nd_nam2) ? \
- NFS_MAXDGRAMDATA : NFS_MAXDATA) : NFS_V2MAXDATA)
-
-/*
- * XXX
- * sys/buf.h should be edited to change B_APPENDWRITE --> B_NEEDCOMMIT, but
- * until then...
- * Same goes for sys/malloc.h, which needs M_NFSDIROFF,
- * M_NFSRVDESC and M_NFSBIGFH added.
- * The VA_EXCLUSIVE flag should be added for va_vaflags and set for an
- * exclusive create.
- * The B_INVAFTERWRITE flag should be set to whatever is required by the
- * buffer cache code to say "Invalidate the block after it is written back".
- */
-#ifndef B_NEEDCOMMIT
-#define B_NEEDCOMMIT B_APPENDWRITE
-#endif
-#ifndef M_NFSRVDESC
-#define M_NFSRVDESC M_TEMP
-#endif
-#ifndef M_NFSDIROFF
-#define M_NFSDIROFF M_TEMP
-#endif
-#ifndef M_NFSBIGFH
-#define M_NFSBIGFH M_TEMP
-#endif
-#ifndef VA_EXCLUSIVE
-#define VA_EXCLUSIVE 0
-#endif
-#ifdef __FreeBSD__
-#define B_INVAFTERWRITE B_NOCACHE
-#else
-#define B_INVAFTERWRITE B_INVAL
-#endif
-
-/*
- * These ifdefs try to handle the differences between the various 4.4BSD-Lite
- * based vfs interfaces.
- * btw: NetBSD-current does have a VOP_LEASDE(), but I don't know how to
- * differentiate between NetBSD-1.0 and NetBSD-current, so..
- * I also don't know about BSDi's 2.0 release.
- */
-#if !defined(HAS_VOPLEASE) && !defined(__FreeBSD__) && !defined(__NetBSD__)
-#define HAS_VOPLEASE 1
-#endif
-#if !defined(HAS_VOPREVOKE) && !defined(__FreeBSD__) && !defined(__NetBSD__)
-#define HAS_VOPREVOKE 1
-#endif
-
-/*
- * The IO_METASYNC flag should be implemented for local file systems.
- * (Until then, it is nothin at all.)
- */
-#ifndef IO_METASYNC
-#define IO_METASYNC 0
-#endif
-
-/*
- * Set the attribute timeout based on how recently the file has been modified.
- */
-#define NFS_ATTRTIMEO(np) \
- ((((np)->n_flag & NMODIFIED) || \
- (time.tv_sec - (np)->n_mtime) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \
- ((time.tv_sec - (np)->n_mtime) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \
- (time.tv_sec - (np)->n_mtime) / 10))
-
-/*
- * Expected allocation sizes for major data structures. If the actual size
- * of the structure exceeds these sizes, then malloc() will be allocating
- * almost twice the memory required. This is used in nfs_init() to warn
- * the sysadmin that the size of a structure should be reduced.
- * (These sizes are always a power of 2. If the kernel malloc() changes
- * to one that does not allocate space in powers of 2 size, then this all
- * becomes bunk!)
- */
-#define NFS_NODEALLOC 256
-#define NFS_MNTALLOC 512
-#define NFS_SVCALLOC 256
-#define NFS_UIDALLOC 128
-
-/*
- * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs
- * should ever try and use it.
- */
-struct nfsd_args {
- int sock; /* Socket to serve */
- caddr_t name; /* Client address for connection based sockets */
- int namelen; /* Length of name */
-};
-
-struct nfsd_srvargs {
- struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */
- uid_t nsd_uid; /* Effective uid mapped to cred */
- u_long nsd_haddr; /* Ip address of client */
- struct ucred nsd_cr; /* Cred. uid maps to */
- int nsd_authlen; /* Length of auth string (ret) */
- u_char *nsd_authstr; /* Auth string (ret) */
- int nsd_verflen; /* and the verfier */
- u_char *nsd_verfstr;
- struct timeval nsd_timestamp; /* timestamp from verifier */
- u_long nsd_ttl; /* credential ttl (sec) */
- NFSKERBKEY_T nsd_key; /* Session key */
-};
-
-struct nfsd_cargs {
- char *ncd_dirp; /* Mount dir path */
- uid_t ncd_authuid; /* Effective uid */
- int ncd_authtype; /* Type of authenticator */
- int ncd_authlen; /* Length of authenticator string */
- u_char *ncd_authstr; /* Authenticator string */
- int ncd_verflen; /* and the verifier */
- u_char *ncd_verfstr;
- NFSKERBKEY_T ncd_key; /* Session key */
-};
-
-/*
- * Stats structure
- */
-struct nfsstats {
- int attrcache_hits;
- int attrcache_misses;
- int lookupcache_hits;
- int lookupcache_misses;
- int direofcache_hits;
- int direofcache_misses;
- int biocache_reads;
- int read_bios;
- int read_physios;
- int biocache_writes;
- int write_bios;
- int write_physios;
- int biocache_readlinks;
- int readlink_bios;
- int biocache_readdirs;
- int readdir_bios;
- int rpccnt[NFS_NPROCS];
- int rpcretries;
- int srvrpccnt[NFS_NPROCS];
- int srvrpc_errs;
- int srv_errs;
- int rpcrequests;
- int rpctimeouts;
- int rpcunexpected;
- int rpcinvalid;
- int srvcache_inproghits;
- int srvcache_idemdonehits;
- int srvcache_nonidemdonehits;
- int srvcache_misses;
- int srvnqnfs_leases;
- int srvnqnfs_maxleases;
- int srvnqnfs_getleases;
- int srvvop_writes;
-};
-
-/*
- * Flags for nfssvc() system call.
- */
-#define NFSSVC_BIOD 0x002
-#define NFSSVC_NFSD 0x004
-#define NFSSVC_ADDSOCK 0x008
-#define NFSSVC_AUTHIN 0x010
-#define NFSSVC_GOTAUTH 0x040
-#define NFSSVC_AUTHINFAIL 0x080
-#define NFSSVC_MNTD 0x100
-
-/*
- * fs.nfs sysctl(3) identifiers
- */
-#define NFS_NFSSTATS 1 /* struct: struct nfsstats */
-#define NFS_NFSPRIVPORT 2 /* int: prohibit nfs to resvports */
-
-#define FS_NFS_NAMES { \
- { 0, 0 }, \
- { "nfsstats", CTLTYPE_STRUCT }, \
- { "nfsprivport", CTLTYPE_INT }, \
-}
-
-/*
- * The set of signals the interrupt an I/O in progress for NFSMNT_INT mounts.
- * What should be in this set is open to debate, but I believe that since
- * I/O system calls on ufs are never interrupted by signals the set should
- * be minimal. My reasoning is that many current programs that use signals
- * such as SIGALRM will not expect file I/O system calls to be interrupted
- * by them and break.
- */
-#if defined(KERNEL) || defined(_KERNEL)
-
-struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
-
-#define NFSINT_SIGMASK (sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGKILL)| \
- sigmask(SIGHUP)|sigmask(SIGQUIT))
-
-/*
- * Socket errors ignored for connectionless sockets??
- * For now, ignore them all
- */
-#define NFSIGNORE_SOERROR(s, e) \
- ((e) != EINTR && (e) != ERESTART && (e) != EWOULDBLOCK && \
- ((s) & PR_CONNREQUIRED) == 0)
-
-/*
- * Nfs outstanding request list element
- */
-struct nfsreq {
- TAILQ_ENTRY(nfsreq) r_chain;
- struct mbuf *r_mreq;
- struct mbuf *r_mrep;
- struct mbuf *r_md;
- caddr_t r_dpos;
- struct nfsmount *r_nmp;
- struct vnode *r_vp;
- u_long r_xid;
- int r_flags; /* flags on request, see below */
- int r_retry; /* max retransmission count */
- int r_rexmit; /* current retrans count */
- int r_timer; /* tick counter on reply */
- int r_procnum; /* NFS procedure number */
- int r_rtt; /* RTT for rpc */
- struct proc *r_procp; /* Proc that did I/O system call */
-};
-
-/*
- * Queue head for nfsreq's
- */
-extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
-
-/* Flag values for r_flags */
-#define R_TIMING 0x01 /* timing request (in mntp) */
-#define R_SENT 0x02 /* request has been sent */
-#define R_SOFTTERM 0x04 /* soft mnt, too many retries */
-#define R_INTR 0x08 /* intr mnt, signal pending */
-#define R_SOCKERR 0x10 /* Fatal error on socket */
-#define R_TPRINTFMSG 0x20 /* Did a tprintf msg. */
-#define R_MUSTRESEND 0x40 /* Must resend request */
-#define R_GETONEREP 0x80 /* Probe for one reply only */
-
-/*
- * A list of nfssvc_sock structures is maintained with all the sockets
- * that require service by the nfsd.
- * The nfsuid structs hang off of the nfssvc_sock structs in both lru
- * and uid hash lists.
- */
-#ifndef NFS_UIDHASHSIZ
-#define NFS_UIDHASHSIZ 29 /* Tune the size of nfssvc_sock with this */
-#endif
-#define NUIDHASH(sock, uid) \
- (&(sock)->ns_uidhashtbl[(uid) % NFS_UIDHASHSIZ])
-#ifndef NFS_WDELAYHASHSIZ
-#define NFS_WDELAYHASHSIZ 16 /* and with this */
-#endif
-#define NWDELAYHASH(sock, f) \
- (&(sock)->ns_wdelayhashtbl[(*((u_long *)(f))) % NFS_WDELAYHASHSIZ])
-#ifndef NFS_MUIDHASHSIZ
-#define NFS_MUIDHASHSIZ 63 /* Tune the size of nfsmount with this */
-#endif
-#define NMUIDHASH(nmp, uid) \
- (&(nmp)->nm_uidhashtbl[(uid) % NFS_MUIDHASHSIZ])
-#define NFSNOHASH(fhsum) \
- (&nfsnodehashtbl[(fhsum) & nfsnodehash])
-
-/*
- * Network address hash list element
- */
-union nethostaddr {
- u_long had_inetaddr;
- struct mbuf *had_nam;
-};
-
-struct nfsuid {
- TAILQ_ENTRY(nfsuid) nu_lru; /* LRU chain */
- LIST_ENTRY(nfsuid) nu_hash; /* Hash list */
- int nu_flag; /* Flags */
- union nethostaddr nu_haddr; /* Host addr. for dgram sockets */
- struct ucred nu_cr; /* Cred uid mapped to */
- int nu_expire; /* Expiry time (sec) */
- struct timeval nu_timestamp; /* Kerb. timestamp */
- u_long nu_nickname; /* Nickname on server */
- NFSKERBKEY_T nu_key; /* and session key */
-};
-
-#define nu_inetaddr nu_haddr.had_inetaddr
-#define nu_nam nu_haddr.had_nam
-/* Bits for nu_flag */
-#define NU_INETADDR 0x1
-#define NU_NAM 0x2
-#define NU_NETFAM(u) (((u)->nu_flag & NU_INETADDR) ? AF_INET : AF_ISO)
-
-struct nfssvc_sock {
- TAILQ_ENTRY(nfssvc_sock) ns_chain; /* List of all nfssvc_sock's */
- TAILQ_HEAD(, nfsuid) ns_uidlruhead;
- struct file *ns_fp;
- struct socket *ns_so;
- struct mbuf *ns_nam;
- struct mbuf *ns_raw;
- struct mbuf *ns_rawend;
- struct mbuf *ns_rec;
- struct mbuf *ns_recend;
- struct mbuf *ns_frag;
- int ns_flag;
- int ns_solock;
- int ns_cc;
- int ns_reclen;
- int ns_numuids;
- u_long ns_sref;
- LIST_HEAD(, nfsrv_descript) ns_tq; /* Write gather lists */
- LIST_HEAD(, nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ];
- LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ];
-};
-
-/* Bits for "ns_flag" */
-#define SLP_VALID 0x01
-#define SLP_DOREC 0x02
-#define SLP_NEEDQ 0x04
-#define SLP_DISCONN 0x08
-#define SLP_GETSTREAM 0x10
-#define SLP_LASTFRAG 0x20
-#define SLP_ALLFLAGS 0xff
-
-extern TAILQ_HEAD(nfssvc_sockhead, nfssvc_sock) nfssvc_sockhead;
-extern int nfssvc_sockhead_flag;
-#define SLP_INIT 0x01
-#define SLP_WANTINIT 0x02
-
-/*
- * One of these structures is allocated for each nfsd.
- */
-struct nfsd {
- TAILQ_ENTRY(nfsd) nfsd_chain; /* List of all nfsd's */
- int nfsd_flag; /* NFSD_ flags */
- struct nfssvc_sock *nfsd_slp; /* Current socket */
- int nfsd_authlen; /* Authenticator len */
- u_char nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */
- int nfsd_verflen; /* and the Verifier */
- u_char nfsd_verfstr[RPCVERF_MAXSIZ];
- struct proc *nfsd_procp; /* Proc ptr */
- struct nfsrv_descript *nfsd_nd; /* Associated nfsrv_descript */
-};
-
-/* Bits for "nfsd_flag" */
-#define NFSD_WAITING 0x01
-#define NFSD_REQINPROG 0x02
-#define NFSD_NEEDAUTH 0x04
-#define NFSD_AUTHFAIL 0x08
-
-/*
- * This structure is used by the server for describing each request.
- * Some fields are used only when write request gathering is performed.
- */
-struct nfsrv_descript {
- u_quad_t nd_time; /* Write deadline (usec) */
- off_t nd_off; /* Start byte offset */
- off_t nd_eoff; /* and end byte offset */
- LIST_ENTRY(nfsrv_descript) nd_hash; /* Hash list */
- LIST_ENTRY(nfsrv_descript) nd_tq; /* and timer list */
- LIST_HEAD(,nfsrv_descript) nd_coalesce; /* coalesced writes */
- struct mbuf *nd_mrep; /* Request mbuf list */
- struct mbuf *nd_md; /* Current dissect mbuf */
- struct mbuf *nd_mreq; /* Reply mbuf list */
- struct mbuf *nd_nam; /* and socket addr */
- struct mbuf *nd_nam2; /* return socket addr */
- caddr_t nd_dpos; /* Current dissect pos */
- int nd_procnum; /* RPC # */
- int nd_stable; /* storage type */
- int nd_flag; /* nd_flag */
- int nd_len; /* Length of this write */
- int nd_repstat; /* Reply status */
- u_long nd_retxid; /* Reply xid */
- u_long nd_duration; /* Lease duration */
- struct timeval nd_starttime; /* Time RPC initiated */
- fhandle_t nd_fh; /* File handle */
- struct ucred nd_cr; /* Credentials */
-};
-
-/* Bits for "nd_flag" */
-#define ND_READ LEASE_READ
-#define ND_WRITE LEASE_WRITE
-#define ND_CHECK 0x04
-#define ND_LEASE (ND_READ | ND_WRITE | ND_CHECK)
-#define ND_NFSV3 0x08
-#define ND_NQNFS 0x10
-#define ND_KERBNICK 0x20
-#define ND_KERBFULL 0x40
-#define ND_KERBAUTH (ND_KERBNICK | ND_KERBFULL)
-
-extern TAILQ_HEAD(nfsd_head, nfsd) nfsd_head;
-extern int nfsd_head_flag;
-#define NFSD_CHECKSLP 0x01
-
-/*
- * These macros compare nfsrv_descript structures.
- */
-#define NFSW_CONTIG(o, n) \
- ((o)->nd_eoff >= (n)->nd_off && \
- !bcmp((caddr_t)&(o)->nd_fh, (caddr_t)&(n)->nd_fh, NFSX_V3FH))
-
-#define NFSW_SAMECRED(o, n) \
- (((o)->nd_flag & ND_KERBAUTH) == ((n)->nd_flag & ND_KERBAUTH) && \
- !bcmp((caddr_t)&(o)->nd_cr, (caddr_t)&(n)->nd_cr, \
- sizeof (struct ucred)))
-
-int nfs_reply __P((struct nfsreq *));
-int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
-int nfs_send __P((struct socket *,struct mbuf *,struct mbuf *,struct nfsreq *));
-int nfs_rephead __P((int,struct nfsrv_descript *,struct nfssvc_sock *,int,int,u_quad_t *,struct mbuf **,struct mbuf **,caddr_t *));
-int nfs_sndlock __P((int *,struct nfsreq *));
-void nfs_sndunlock __P((int *flagp));
-int nfs_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *));
-int nfs_vinvalbuf __P((struct vnode *,int,struct ucred *,struct proc *,int));
-int nfs_readrpc __P((struct vnode *,struct uio *,struct ucred *));
-int nfs_writerpc __P((struct vnode *,struct uio *,struct ucred *,int *,int *));
-int nfs_readdirrpc __P((register struct vnode *,struct uio *,struct ucred *));
-int nfs_asyncio __P((struct buf *,struct ucred *));
-int nfs_doio __P((struct buf *,struct ucred *,struct proc *));
-int nfs_readlinkrpc __P((struct vnode *,struct uio *,struct ucred *));
-int nfs_sigintr __P((struct nfsmount *,struct nfsreq *r,struct proc *));
-int nfs_readdirplusrpc __P((struct vnode *,register struct uio *,struct ucred *));
-int nfsm_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *));
-void nfsm_srvfattr __P((struct nfsrv_descript *,struct vattr *,struct nfs_fattr *));
-void nfsm_srvwcc __P((struct nfsrv_descript *,int,struct vattr *,int,struct vattr *,struct mbuf **,char **));
-void nfsm_srvpostopattr __P((struct nfsrv_descript *,int,struct vattr *,struct mbuf **,char **));
-int netaddr_match __P((int,union nethostaddr *,struct mbuf *));
-int nfs_request __P((struct vnode *,struct mbuf *,int,struct proc *,struct ucred *,struct mbuf **,struct mbuf **,caddr_t *));
-int nfs_loadattrcache __P((struct vnode **,struct mbuf **,caddr_t *,struct vattr *));
-int nfs_namei __P((struct nameidata *,fhandle_t *,int,struct nfssvc_sock *,struct mbuf *,struct mbuf **,caddr_t *,struct vnode **,struct proc *,int));
-void nfsm_adj __P((struct mbuf *,int,int));
-int nfsm_mbuftouio __P((struct mbuf **,struct uio *,int,caddr_t *));
-void nfsrv_initcache __P((void));
-int nfs_getauth __P((struct nfsmount *,struct nfsreq *,struct ucred *,char **,int *,char *,int *,NFSKERBKEY_T));
-int nfs_getnickauth __P((struct nfsmount *,struct ucred *,char **,int *,char *,int));
-int nfs_savenickauth __P((struct nfsmount *,struct ucred *,int,NFSKERBKEY_T,struct mbuf **,char **,struct mbuf *));
-int nfs_adv __P((struct mbuf **,caddr_t *,int,int));
-void nfs_nhinit __P((void));
-void nfs_timer __P((void*));
-u_long nfs_hash __P((nfsfh_t *,int));
-void nfsrv_slpderef __P((struct nfssvc_sock *slp));
-int nfsrv_dorec __P((struct nfssvc_sock *,struct nfsd *,struct nfsrv_descript **));
-void nfsrv_cleancache __P((void));
-int nfsrv_getcache __P((struct nfsrv_descript *,struct nfssvc_sock *,struct mbuf **));
-int nfs_init __P((void));
-void nfsrv_updatecache __P((struct nfsrv_descript *,int,struct mbuf *));
-int nfs_connect __P((struct nfsmount *,struct nfsreq *));
-void nfs_disconnect __P((struct nfsmount *nmp));
-int nfs_getattrcache __P((struct vnode *,struct vattr *));
-int nfsm_strtmbuf __P((struct mbuf **,char **,char *,long));
-int nfs_bioread __P((struct vnode *,struct uio *,int,struct ucred *, int getpages));
-int nfsm_uiotombuf __P((struct uio *,struct mbuf **,int,caddr_t *));
-void nfsrv_init __P((int));
-void nfs_clearcommit __P((struct mount *));
-int nfsrv_errmap __P((struct nfsrv_descript *, int));
-void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag));
-void nfsrvw_sort __P((gid_t [],int));
-void nfsrv_setcred __P((struct ucred *,struct ucred *));
-int nfs_writebp __P((struct buf *,int));
-int nfsrv_object_create __P(( struct vnode * ));
-void nfsrv_wakenfsd __P((struct nfssvc_sock *slp));
-int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *,
- struct proc *, struct mbuf **));
-int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *,
- struct proc *p));
-
-int nfsrv3_access __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **,
- struct ucred *,struct nfssvc_sock *,struct mbuf *,
- int *,int));
-int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_link __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_lookup __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_mkdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_mknod __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_noop __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_null __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_pathconf __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_read __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_readdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_readdirplus __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_readlink __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_remove __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_rename __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_rmdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_setattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_statfs __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_symlink __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-
-#ifdef NFS_DEBUG
-
-extern int nfs_debug;
-#define NFS_DEBUG_ASYNCIO 1 /* asynchronous i/o */
-#define NFS_DEBUG_WG 2 /* server write gathering */
-#define NFS_DEBUG_RC 4 /* server request caching */
-
-#define NFS_DPF(cat, args) \
- do { \
- if (nfs_debug & NFS_DEBUG_##cat) printf args; \
- } while (0)
-
-#else
-
-#define NFS_DPF(cat, args)
-
-#endif
-
-#endif /* KERNEL */
-
-#endif
diff --git a/c/src/libnetworking/nfs/nfsdiskless.h b/c/src/libnetworking/nfs/nfsdiskless.h
deleted file mode 100644
index 0ed5c8f6f7..0000000000
--- a/c/src/libnetworking/nfs/nfsdiskless.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)nfsdiskless.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_NFSDISKLESS_H_
-#define _NFS_NFSDISKLESS_H_
-
-/*
- * Structure that must be initialized for a diskless nfs client.
- * This structure is used by nfs_mountroot() to set up the root and swap
- * vnodes plus do a partial ifconfig(8) and route(8) so that the critical net
- * interface can communicate with the server.
- * The primary bootstrap is expected to fill in the appropriate fields before
- * starting the kernel. Whether or not the swap area is nfs mounted is determined
- * by the value in swdevt[0]. (equal to NODEV --> swap over nfs)
- * Currently only works for AF_INET protocols.
- * NB: All fields are stored in net byte order to avoid hassles with
- * client/server byte ordering differences.
- */
-
-/*
- * I have defined a new structure that can handle an NFS Version 3 file handle
- * but the kernel still expects the old Version 2 one to be provided. The
- * changes required in nfs_vfsops.c for using the new are documented there in
- * comments. (I felt that breaking network booting code by changing this
- * structure would not be prudent at this time, since almost all servers are
- * still Version 2 anyhow.)
- */
-struct nfsv3_diskless {
- struct ifaliasreq myif; /* Default interface */
- struct sockaddr_in mygateway; /* Default gateway */
- struct nfs_args swap_args; /* Mount args for swap file */
- int swap_fhsize; /* Size of file handle */
- u_char swap_fh[NFSX_V3FHMAX]; /* Swap file's file handle */
- struct sockaddr_in swap_saddr; /* Address of swap server */
- char swap_hostnam[MNAMELEN]; /* Host name for mount pt */
- int swap_nblks; /* Size of server swap file */
- struct ucred swap_ucred; /* Swap credentials */
- struct nfs_args root_args; /* Mount args for root fs */
- int root_fhsize; /* Size of root file handle */
- u_char root_fh[NFSX_V3FHMAX]; /* File handle of root dir */
- struct sockaddr_in root_saddr; /* Address of root server */
- char root_hostnam[MNAMELEN]; /* Host name for mount pt */
- long root_time; /* Timestamp of root fs */
- char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */
-};
-
-struct nfs_diskless {
- struct ifaliasreq myif; /* Default interface */
- struct sockaddr_in mygateway; /* Default gateway */
- struct nfs_args swap_args; /* Mount args for swap file */
- u_char swap_fh[NFSX_V2FH]; /* Swap file's file handle */
- struct sockaddr_in swap_saddr; /* Address of swap server */
- char swap_hostnam[MNAMELEN]; /* Host name for mount pt */
- int swap_nblks; /* Size of server swap file */
- struct ucred swap_ucred; /* Swap credentials */
- struct nfs_args root_args; /* Mount args for root fs */
- u_char root_fh[NFSX_V2FH]; /* File handle of root dir */
- struct sockaddr_in root_saddr; /* Address of root server */
- char root_hostnam[MNAMELEN]; /* Host name for mount pt */
- long root_time; /* Timestamp of root fs */
- char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */
-};
-
-#endif
diff --git a/c/src/libnetworking/nfs/nfsproto.h b/c/src/libnetworking/nfs/nfsproto.h
deleted file mode 100644
index 6ce7c5b960..0000000000
--- a/c/src/libnetworking/nfs/nfsproto.h
+++ /dev/null
@@ -1,441 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)nfsproto.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_NFSPROTO_H_
-#define _NFS_NFSPROTO_H_
-
-/*
- * nfs definitions as per the Version 2 and 3 specs
- */
-
-/*
- * Constants as defined in the Sun NFS Version 2 and 3 specs.
- * "NFS: Network File System Protocol Specification" RFC1094
- * and in the "NFS: Network File System Version 3 Protocol
- * Specification"
- */
-
-#define NFS_PORT 2049
-#define NFS_PROG 100003
-#define NFS_VER2 2
-#define NFS_VER3 3
-#define NFS_V2MAXDATA 8192
-#define NFS_MAXDGRAMDATA 16384
-#define NFS_MAXDATA 32768
-#define NFS_MAXPATHLEN 1024
-#define NFS_MAXNAMLEN 255
-#define NFS_MAXPKTHDR 404
-#define NFS_MAXPACKET (NFS_MAXPKTHDR + NFS_MAXDATA)
-#define NFS_MINPACKET 20
-#define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */
-
-/* Stat numbers for rpc returns (version 2 and 3) */
-#define NFS_OK 0
-#define NFSERR_PERM 1
-#define NFSERR_NOENT 2
-#define NFSERR_IO 5
-#define NFSERR_NXIO 6
-#define NFSERR_ACCES 13
-#define NFSERR_EXIST 17
-#define NFSERR_XDEV 18 /* Version 3 only */
-#define NFSERR_NODEV 19
-#define NFSERR_NOTDIR 20
-#define NFSERR_ISDIR 21
-#define NFSERR_INVAL 22 /* Version 3 only */
-#define NFSERR_FBIG 27
-#define NFSERR_NOSPC 28
-#define NFSERR_ROFS 30
-#define NFSERR_MLINK 31 /* Version 3 only */
-#define NFSERR_NAMETOL 63
-#define NFSERR_NOTEMPTY 66
-#define NFSERR_DQUOT 69
-#define NFSERR_STALE 70
-#define NFSERR_REMOTE 71 /* Version 3 only */
-#define NFSERR_WFLUSH 99 /* Version 2 only */
-#define NFSERR_BADHANDLE 10001 /* The rest Version 3 only */
-#define NFSERR_NOT_SYNC 10002
-#define NFSERR_BAD_COOKIE 10003
-#define NFSERR_NOTSUPP 10004
-#define NFSERR_TOOSMALL 10005
-#define NFSERR_SERVERFAULT 10006
-#define NFSERR_BADTYPE 10007
-#define NFSERR_JUKEBOX 10008
-#define NFSERR_TRYLATER NFSERR_JUKEBOX
-#define NFSERR_STALEWRITEVERF 30001 /* Fake return for nfs_commit() */
-
-#define NFSERR_RETVOID 0x20000000 /* Return void, not error */
-#define NFSERR_AUTHERR 0x40000000 /* Mark an authentication error */
-#define NFSERR_RETERR 0x80000000 /* Mark an error return for V3 */
-
-/* Sizes in bytes of various nfs rpc components */
-#define NFSX_UNSIGNED 4
-
-/* specific to NFS Version 2 */
-#define NFSX_V2FH 32
-#define NFSX_V2FATTR 68
-#define NFSX_V2SATTR 32
-#define NFSX_V2COOKIE 4
-#define NFSX_V2STATFS 20
-
-/* specific to NFS Version 3 */
-#define NFSX_V3FH (sizeof (fhandle_t)) /* size this server uses */
-#define NFSX_V3FHMAX 64 /* max. allowed by protocol */
-#define NFSX_V3FATTR 84
-#define NFSX_V3SATTR 60 /* max. all fields filled in */
-#define NFSX_V3SRVSATTR (sizeof (struct nfsv3_sattr))
-#define NFSX_V3POSTOPATTR (NFSX_V3FATTR + NFSX_UNSIGNED)
-#define NFSX_V3WCCDATA (NFSX_V3POSTOPATTR + 8 * NFSX_UNSIGNED)
-#define NFSX_V3COOKIEVERF 8
-#define NFSX_V3WRITEVERF 8
-#define NFSX_V3CREATEVERF 8
-#define NFSX_V3STATFS 52
-#define NFSX_V3FSINFO 48
-#define NFSX_V3PATHCONF 24
-
-/* variants for both versions */
-#define NFSX_FH(v3) ((v3) ? (NFSX_V3FHMAX + NFSX_UNSIGNED) : \
- NFSX_V2FH)
-#define NFSX_SRVFH(v3) ((v3) ? NFSX_V3FH : NFSX_V2FH)
-#define NFSX_FATTR(v3) ((v3) ? NFSX_V3FATTR : NFSX_V2FATTR)
-#define NFSX_PREOPATTR(v3) ((v3) ? (7 * NFSX_UNSIGNED) : 0)
-#define NFSX_POSTOPATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : 0)
-#define NFSX_POSTOPORFATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : \
- NFSX_V2FATTR)
-#define NFSX_WCCDATA(v3) ((v3) ? NFSX_V3WCCDATA : 0)
-#define NFSX_WCCORFATTR(v3) ((v3) ? NFSX_V3WCCDATA : NFSX_V2FATTR)
-#define NFSX_SATTR(v3) ((v3) ? NFSX_V3SATTR : NFSX_V2SATTR)
-#define NFSX_COOKIEVERF(v3) ((v3) ? NFSX_V3COOKIEVERF : 0)
-#define NFSX_WRITEVERF(v3) ((v3) ? NFSX_V3WRITEVERF : 0)
-#define NFSX_READDIR(v3) ((v3) ? (5 * NFSX_UNSIGNED) : \
- (2 * NFSX_UNSIGNED))
-#define NFSX_STATFS(v3) ((v3) ? NFSX_V3STATFS : NFSX_V2STATFS)
-
-/* nfs rpc procedure numbers (before version mapping) */
-#define NFSPROC_NULL 0
-#define NFSPROC_GETATTR 1
-#define NFSPROC_SETATTR 2
-#define NFSPROC_LOOKUP 3
-#define NFSPROC_ACCESS 4
-#define NFSPROC_READLINK 5
-#define NFSPROC_READ 6
-#define NFSPROC_WRITE 7
-#define NFSPROC_CREATE 8
-#define NFSPROC_MKDIR 9
-#define NFSPROC_SYMLINK 10
-#define NFSPROC_MKNOD 11
-#define NFSPROC_REMOVE 12
-#define NFSPROC_RMDIR 13
-#define NFSPROC_RENAME 14
-#define NFSPROC_LINK 15
-#define NFSPROC_READDIR 16
-#define NFSPROC_READDIRPLUS 17
-#define NFSPROC_FSSTAT 18
-#define NFSPROC_FSINFO 19
-#define NFSPROC_PATHCONF 20
-#define NFSPROC_COMMIT 21
-
-/* And leasing (nqnfs) procedure numbers (must be last) */
-#define NQNFSPROC_GETLEASE 22
-#define NQNFSPROC_VACATED 23
-#define NQNFSPROC_EVICTED 24
-
-#define NFSPROC_NOOP 25
-#define NFS_NPROCS 26
-
-/* Actual Version 2 procedure numbers */
-#define NFSV2PROC_NULL 0
-#define NFSV2PROC_GETATTR 1
-#define NFSV2PROC_SETATTR 2
-#define NFSV2PROC_NOOP 3
-#define NFSV2PROC_ROOT NFSV2PROC_NOOP /* Obsolete */
-#define NFSV2PROC_LOOKUP 4
-#define NFSV2PROC_READLINK 5
-#define NFSV2PROC_READ 6
-#define NFSV2PROC_WRITECACHE NFSV2PROC_NOOP /* Obsolete */
-#define NFSV2PROC_WRITE 8
-#define NFSV2PROC_CREATE 9
-#define NFSV2PROC_REMOVE 10
-#define NFSV2PROC_RENAME 11
-#define NFSV2PROC_LINK 12
-#define NFSV2PROC_SYMLINK 13
-#define NFSV2PROC_MKDIR 14
-#define NFSV2PROC_RMDIR 15
-#define NFSV2PROC_READDIR 16
-#define NFSV2PROC_STATFS 17
-
-/*
- * Constants used by the Version 3 protocol for various RPCs
- */
-#define NFSV3SATTRTIME_DONTCHANGE 0
-#define NFSV3SATTRTIME_TOSERVER 1
-#define NFSV3SATTRTIME_TOCLIENT 2
-
-#define NFSV3ACCESS_READ 0x01
-#define NFSV3ACCESS_LOOKUP 0x02
-#define NFSV3ACCESS_MODIFY 0x04
-#define NFSV3ACCESS_EXTEND 0x08
-#define NFSV3ACCESS_DELETE 0x10
-#define NFSV3ACCESS_EXECUTE 0x20
-
-#define NFSV3WRITE_UNSTABLE 0
-#define NFSV3WRITE_DATASYNC 1
-#define NFSV3WRITE_FILESYNC 2
-
-#define NFSV3CREATE_UNCHECKED 0
-#define NFSV3CREATE_GUARDED 1
-#define NFSV3CREATE_EXCLUSIVE 2
-
-#define NFSV3FSINFO_LINK 0x01
-#define NFSV3FSINFO_SYMLINK 0x02
-#define NFSV3FSINFO_HOMOGENEOUS 0x08
-#define NFSV3FSINFO_CANSETTIME 0x10
-
-/* Conversion macros */
-#define vtonfsv2_mode(t,m) \
- txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \
- MAKEIMODE((t), (m)))
-#define vtonfsv3_mode(m) txdr_unsigned((m) & 07777)
-#define nfstov_mode(a) (fxdr_unsigned(u_short, (a))&07777)
-#define vtonfsv2_type(a) txdr_unsigned(nfsv2_type[((long)(a))])
-#define vtonfsv3_type(a) txdr_unsigned(nfsv3_type[((long)(a))])
-#define nfsv2tov_type(a) nv2tov_type[fxdr_unsigned(u_long,(a))&0x7]
-#define nfsv3tov_type(a) nv3tov_type[fxdr_unsigned(u_long,(a))&0x7]
-
-/* File types */
-typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5,
- NFSOCK=6, NFFIFO=7 } nfstype;
-
-/* Structs for common parts of the rpc's */
-/*
- * File Handle (32 bytes for version 2), variable up to 64 for version 3.
- * File Handles of up to NFS_SMALLFH in size are stored directly in the
- * nfs node, whereas larger ones are malloc'd. (This never happens when
- * NFS_SMALLFH is set to 64.)
- * NFS_SMALLFH should be in the range of 32 to 64 and be divisible by 4.
- */
-#ifndef NFS_SMALLFH
-#define NFS_SMALLFH 64
-#endif
-union nfsfh {
- fhandle_t fh_generic;
- u_char fh_bytes[NFS_SMALLFH];
-};
-typedef union nfsfh nfsfh_t;
-
-struct nfsv2_time {
- u_long nfsv2_sec;
- u_long nfsv2_usec;
-};
-typedef struct nfsv2_time nfstime2;
-
-struct nfsv3_time {
- u_long nfsv3_sec;
- u_long nfsv3_nsec;
-};
-typedef struct nfsv3_time nfstime3;
-
-/*
- * Quads are defined as arrays of 2 longs to ensure dense packing for the
- * protocol and to facilitate xdr conversion.
- */
-struct nfs_uquad {
- u_long nfsuquad[2];
-};
-typedef struct nfs_uquad nfsuint64;
-
-/*
- * Used to convert between two u_longs and a u_quad_t.
- */
-union nfs_quadconvert {
- u_long lval[2];
- u_quad_t qval;
-};
-typedef union nfs_quadconvert nfsquad_t;
-
-/*
- * NFS Version 3 special file number.
- */
-struct nfsv3_spec {
- u_long specdata1;
- u_long specdata2;
-};
-typedef struct nfsv3_spec nfsv3spec;
-
-/*
- * File attributes and setable attributes. These structures cover both
- * NFS version 2 and the version 3 protocol. Note that the union is only
- * used so that one pointer can refer to both variants. These structures
- * go out on the wire and must be densely packed, so no quad data types
- * are used. (all fields are longs or u_longs or structures of same)
- * NB: You can't do sizeof(struct nfs_fattr), you must use the
- * NFSX_FATTR(v3) macro.
- */
-struct nfs_fattr {
- u_long fa_type;
- u_long fa_mode;
- u_long fa_nlink;
- u_long fa_uid;
- u_long fa_gid;
- union {
- struct {
- u_long nfsv2fa_size;
- u_long nfsv2fa_blocksize;
- u_long nfsv2fa_rdev;
- u_long nfsv2fa_blocks;
- u_long nfsv2fa_fsid;
- u_long nfsv2fa_fileid;
- nfstime2 nfsv2fa_atime;
- nfstime2 nfsv2fa_mtime;
- nfstime2 nfsv2fa_ctime;
- } fa_nfsv2;
- struct {
- nfsuint64 nfsv3fa_size;
- nfsuint64 nfsv3fa_used;
- nfsv3spec nfsv3fa_rdev;
- nfsuint64 nfsv3fa_fsid;
- nfsuint64 nfsv3fa_fileid;
- nfstime3 nfsv3fa_atime;
- nfstime3 nfsv3fa_mtime;
- nfstime3 nfsv3fa_ctime;
- } fa_nfsv3;
- } fa_un;
-};
-
-/* and some ugly defines for accessing union components */
-#define fa2_size fa_un.fa_nfsv2.nfsv2fa_size
-#define fa2_blocksize fa_un.fa_nfsv2.nfsv2fa_blocksize
-#define fa2_rdev fa_un.fa_nfsv2.nfsv2fa_rdev
-#define fa2_blocks fa_un.fa_nfsv2.nfsv2fa_blocks
-#define fa2_fsid fa_un.fa_nfsv2.nfsv2fa_fsid
-#define fa2_fileid fa_un.fa_nfsv2.nfsv2fa_fileid
-#define fa2_atime fa_un.fa_nfsv2.nfsv2fa_atime
-#define fa2_mtime fa_un.fa_nfsv2.nfsv2fa_mtime
-#define fa2_ctime fa_un.fa_nfsv2.nfsv2fa_ctime
-#define fa3_size fa_un.fa_nfsv3.nfsv3fa_size
-#define fa3_used fa_un.fa_nfsv3.nfsv3fa_used
-#define fa3_rdev fa_un.fa_nfsv3.nfsv3fa_rdev
-#define fa3_fsid fa_un.fa_nfsv3.nfsv3fa_fsid
-#define fa3_fileid fa_un.fa_nfsv3.nfsv3fa_fileid
-#define fa3_atime fa_un.fa_nfsv3.nfsv3fa_atime
-#define fa3_mtime fa_un.fa_nfsv3.nfsv3fa_mtime
-#define fa3_ctime fa_un.fa_nfsv3.nfsv3fa_ctime
-
-struct nfsv2_sattr {
- u_long sa_mode;
- u_long sa_uid;
- u_long sa_gid;
- u_long sa_size;
- nfstime2 sa_atime;
- nfstime2 sa_mtime;
-};
-
-/*
- * NFS Version 3 sattr structure for the new node creation case.
- */
-struct nfsv3_sattr {
- u_long sa_modetrue;
- u_long sa_mode;
- u_long sa_uidtrue;
- u_long sa_uid;
- u_long sa_gidtrue;
- u_long sa_gid;
- u_long sa_sizefalse;
- u_long sa_atimetype;
- nfstime3 sa_atime;
- u_long sa_mtimetype;
- nfstime3 sa_mtime;
-};
-
-struct nfs_statfs {
- union {
- struct {
- u_long nfsv2sf_tsize;
- u_long nfsv2sf_bsize;
- u_long nfsv2sf_blocks;
- u_long nfsv2sf_bfree;
- u_long nfsv2sf_bavail;
- } sf_nfsv2;
- struct {
- nfsuint64 nfsv3sf_tbytes;
- nfsuint64 nfsv3sf_fbytes;
- nfsuint64 nfsv3sf_abytes;
- nfsuint64 nfsv3sf_tfiles;
- nfsuint64 nfsv3sf_ffiles;
- nfsuint64 nfsv3sf_afiles;
- u_long nfsv3sf_invarsec;
- } sf_nfsv3;
- } sf_un;
-};
-
-#define sf_tsize sf_un.sf_nfsv2.nfsv2sf_tsize
-#define sf_bsize sf_un.sf_nfsv2.nfsv2sf_bsize
-#define sf_blocks sf_un.sf_nfsv2.nfsv2sf_blocks
-#define sf_bfree sf_un.sf_nfsv2.nfsv2sf_bfree
-#define sf_bavail sf_un.sf_nfsv2.nfsv2sf_bavail
-#define sf_tbytes sf_un.sf_nfsv3.nfsv3sf_tbytes
-#define sf_fbytes sf_un.sf_nfsv3.nfsv3sf_fbytes
-#define sf_abytes sf_un.sf_nfsv3.nfsv3sf_abytes
-#define sf_tfiles sf_un.sf_nfsv3.nfsv3sf_tfiles
-#define sf_ffiles sf_un.sf_nfsv3.nfsv3sf_ffiles
-#define sf_afiles sf_un.sf_nfsv3.nfsv3sf_afiles
-#define sf_invarsec sf_un.sf_nfsv3.nfsv3sf_invarsec
-
-struct nfsv3_fsinfo {
- u_long fs_rtmax;
- u_long fs_rtpref;
- u_long fs_rtmult;
- u_long fs_wtmax;
- u_long fs_wtpref;
- u_long fs_wtmult;
- u_long fs_dtpref;
- nfsuint64 fs_maxfilesize;
- nfstime3 fs_timedelta;
- u_long fs_properties;
-};
-
-struct nfsv3_pathconf {
- u_long pc_linkmax;
- u_long pc_namemax;
- u_long pc_notrunc;
- u_long pc_chownrestricted;
- u_long pc_caseinsensitive;
- u_long pc_casepreserving;
-};
-
-#endif
diff --git a/c/src/libnetworking/nfs/rpcv2.h b/c/src/libnetworking/nfs/rpcv2.h
deleted file mode 100644
index 5fd6e7febf..0000000000
--- a/c/src/libnetworking/nfs/rpcv2.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)rpcv2.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_RPCV2_H_
-#define _NFS_RPCV2_H_
-
-/*
- * Definitions for Sun RPC Version 2, from
- * "RPC: Remote Procedure Call Protocol Specification" RFC1057
- */
-
-/* Version # */
-#define RPC_VER2 2
-
-/* Authentication */
-#define RPCAUTH_NULL 0
-#define RPCAUTH_UNIX 1
-#define RPCAUTH_SHORT 2
-#define RPCAUTH_KERB4 4
-#define RPCAUTH_NQNFS 300000
-#define RPCAUTH_MAXSIZ 400
-#define RPCVERF_MAXSIZ 12 /* For Kerb, can actually be 400 */
-#define RPCAUTH_UNIXGIDS 16
-
-/*
- * Constants associated with authentication flavours.
- */
-#define RPCAKN_FULLNAME 0
-#define RPCAKN_NICKNAME 1
-
-/* Rpc Constants */
-#define RPC_CALL 0
-#define RPC_REPLY 1
-#define RPC_MSGACCEPTED 0
-#define RPC_MSGDENIED 1
-#define RPC_PROGUNAVAIL 1
-#define RPC_PROGMISMATCH 2
-#define RPC_PROCUNAVAIL 3
-#define RPC_GARBAGE 4 /* I like this one */
-#define RPC_MISMATCH 0
-#define RPC_AUTHERR 1
-
-/* Authentication failures */
-#define AUTH_BADCRED 1
-#define AUTH_REJECTCRED 2
-#define AUTH_BADVERF 3
-#define AUTH_REJECTVERF 4
-#define AUTH_TOOWEAK 5 /* Give em wheaties */
-
-/* Sizes of rpc header parts */
-#define RPC_SIZ 24
-#define RPC_REPLYSIZ 28
-
-/* RPC Prog definitions */
-#define RPCPROG_MNT 100005
-#define RPCMNT_VER1 1
-#define RPCMNT_VER3 3
-#define RPCMNT_MOUNT 1
-#define RPCMNT_DUMP 2
-#define RPCMNT_UMOUNT 3
-#define RPCMNT_UMNTALL 4
-#define RPCMNT_EXPORT 5
-#define RPCMNT_NAMELEN 255
-#define RPCMNT_PATHLEN 1024
-#define RPCPROG_NFS 100003
-
-/*
- * Structures used for RPCAUTH_KERB4.
- */
-struct nfsrpc_fullverf {
- u_long t1;
- u_long t2;
- u_long w2;
-};
-
-struct nfsrpc_fullblock {
- u_long t1;
- u_long t2;
- u_long w1;
- u_long w2;
-};
-
-struct nfsrpc_nickverf {
- u_long kind;
- struct nfsrpc_fullverf verf;
-};
-
-/*
- * and their sizes in bytes.. If sizeof (struct nfsrpc_xx) != these
- * constants, well then things will break in mount_nfs and nfsd.
- */
-#define RPCX_FULLVERF 12
-#define RPCX_FULLBLOCK 16
-#define RPCX_NICKVERF 16
-
-#ifdef NFSKERB
-XXX
-#else
-typedef u_char NFSKERBKEY_T[2];
-typedef u_char NFSKERBKEYSCHED_T[2];
-#endif
-#define NFS_KERBSRV "rcmd" /* Kerberos Service for NFS */
-#define NFS_KERBTTL (30 * 60) /* Credential ttl (sec) */
-#define NFS_KERBCLOCKSKEW (5 * 60) /* Clock skew (sec) */
-#define NFS_KERBW1(t) (*((u_long *)(&((t).dat[((t).length + 3) & ~0x3]))))
-#endif
diff --git a/c/src/libnetworking/nfs/xdr_subs.h b/c/src/libnetworking/nfs/xdr_subs.h
deleted file mode 100644
index 874730378f..0000000000
--- a/c/src/libnetworking/nfs/xdr_subs.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)xdr_subs.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_XDR_SUBS_H_
-#define _NFS_XDR_SUBS_H_
-
-/*
- * Macros used for conversion to/from xdr representation by nfs...
- * These use the MACHINE DEPENDENT routines ntohl, htonl
- * As defined by "XDR: External Data Representation Standard" RFC1014
- *
- * To simplify the implementation, we use ntohl/htonl even on big-endian
- * machines, and count on them being `#define'd away. Some of these
- * might be slightly more efficient as quad_t copies on a big-endian,
- * but we cannot count on their alignment anyway.
- */
-
-#define fxdr_unsigned(t, v) ((t)ntohl((long)(v)))
-#define txdr_unsigned(v) (htonl((long)(v)))
-
-#define fxdr_nfsv2time(f, t) { \
- (t)->tv_sec = ntohl(((struct nfsv2_time *)(f))->nfsv2_sec); \
- if (((struct nfsv2_time *)(f))->nfsv2_usec != 0xffffffff) \
- (t)->tv_nsec = 1000 * ntohl(((struct nfsv2_time *)(f))->nfsv2_usec); \
- else \
- (t)->tv_nsec = 0; \
-}
-#define txdr_nfsv2time(f, t) { \
- ((struct nfsv2_time *)(t))->nfsv2_sec = htonl((f)->tv_sec); \
- if ((f)->tv_nsec != -1) \
- ((struct nfsv2_time *)(t))->nfsv2_usec = htonl((f)->tv_nsec / 1000); \
- else \
- ((struct nfsv2_time *)(t))->nfsv2_usec = 0xffffffff; \
-}
-
-#define fxdr_nfsv3time(f, t) { \
- (t)->tv_sec = ntohl(((struct nfsv3_time *)(f))->nfsv3_sec); \
- (t)->tv_nsec = ntohl(((struct nfsv3_time *)(f))->nfsv3_nsec); \
-}
-#define txdr_nfsv3time(f, t) { \
- ((struct nfsv3_time *)(t))->nfsv3_sec = htonl((f)->tv_sec); \
- ((struct nfsv3_time *)(t))->nfsv3_nsec = htonl((f)->tv_nsec); \
-}
-
-#define fxdr_hyper(f, t) { \
- ((long *)(t))[_QUAD_HIGHWORD] = ntohl(((long *)(f))[0]); \
- ((long *)(t))[_QUAD_LOWWORD] = ntohl(((long *)(f))[1]); \
-}
-#define txdr_hyper(f, t) { \
- ((long *)(t))[0] = htonl(((long *)(f))[_QUAD_HIGHWORD]); \
- ((long *)(t))[1] = htonl(((long *)(f))[_QUAD_LOWWORD]); \
-}
-
-#endif
diff --git a/c/src/libnetworking/opt_ipfw.h b/c/src/libnetworking/opt_ipfw.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/libnetworking/opt_ipfw.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/libnetworking/opt_mrouting.h b/c/src/libnetworking/opt_mrouting.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/libnetworking/opt_mrouting.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/libnetworking/opt_tcpdebug.h b/c/src/libnetworking/opt_tcpdebug.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/c/src/libnetworking/opt_tcpdebug.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/c/src/libnetworking/poll.h b/c/src/libnetworking/poll.h
deleted file mode 100644
index 74dfca76c1..0000000000
--- a/c/src/libnetworking/poll.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*-
- * Copyright (c) 1997 Peter Wemm <peter@freebsd.org>
- * 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. 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 BY THE AUTHOR 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 AUTHOR 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.
- *
- * $Id$
- */
-
-#ifndef _SYS_POLL_H_
-#define _SYS_POLL_H_
-
-/*
- * This file is intended to be compatable with the traditional poll.h.
- */
-
-/*
- * This structure is passed as an array to poll(2).
- */
-struct pollfd {
- int fd; /* which file descriptor to poll */
- short events; /* events we are interested in */
- short revents; /* events found on return */
-};
-
-/*
- * Requestable events. If poll(2) finds any of these set, they are
- * copied to revents on return.
- * XXX Note that FreeBSD doesn't make much distinction between POLLPRI
- * and POLLRDBAND since none of the file types have distinct priority
- * bands - and only some have an urgent "mode".
- * XXX Note POLLIN isn't really supported in true SVSV terms. Under SYSV
- * POLLIN includes all of normal, band and urgent data. Most poll handlers
- * on FreeBSD only treat it as "normal" data.
- */
-#define POLLIN 0x0001 /* any readable data available */
-#define POLLPRI 0x0002 /* OOB/Urgent readable data */
-#define POLLOUT 0x0004 /* file descriptor is writeable */
-#define POLLRDNORM 0x0040 /* non-OOB/URG data available */
-#define POLLWRNORM POLLOUT /* no write type differentiation */
-#define POLLRDBAND 0x0080 /* OOB/Urgent readable data */
-#define POLLWRBAND 0x0100 /* OOB/Urgent data can be written */
-
-/*
- * FreeBSD extensions: polling on a regular file might return one
- * of these events (currently only supported on UFS).
- */
-#define POLLEXTEND 0x0200 /* file may have been extended */
-#define POLLATTRIB 0x0400 /* file attributes may have changed */
-#define POLLNLINK 0x0800 /* (un)link/rename may have happened */
-#define POLLWRITE 0x1000 /* file's contents may have changed */
-
-/*
- * These events are set if they occur regardless of whether they were
- * requested.
- */
-#define POLLERR 0x0008 /* some poll error occurred */
-#define POLLHUP 0x0010 /* file descriptor was "hung up" */
-#define POLLNVAL 0x0020 /* requested events "invalid" */
-
-#define POLLSTANDARD (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|\
- POLLWRBAND|POLLERR|POLLHUP|POLLNVAL)
-
-/*
- * Request that poll() wait forever.
- * XXX in SYSV, this is defined in stropts.h, which is not included
- * by poll.h.
- */
-#define INFTIM (-1)
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-/*
- * XXX logically, poll() should be declared in <poll.h>, but SVR4 at
- * least has it here in <sys/poll.h>.
- * XXX poll() has "unsigned long" nfds on SVR4, not unsigned as on the
- * other BSDs.
- */
-int poll __P((struct pollfd *_pfd, unsigned _nfds, int _timeout));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif /* !_SYS_POLL_H_ */
diff --git a/c/src/libnetworking/resolv.h b/c/src/libnetworking/resolv.h
deleted file mode 100644
index 614f204706..0000000000
--- a/c/src/libnetworking/resolv.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/*-
- * Copyright (c) 1983, 1987, 1989, 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.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * @(#)resolv.h 8.1 (Berkeley) 6/2/93
- * From Id: resolv.h,v 8.12 1998/04/28 19:36:46 halley Exp $
- * $Id$
- */
-
-#ifndef _RESOLV_H_
-#define _RESOLV_H_
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/cdefs.h>
-#include <stdio.h>
-
-/*
- * Revision information. This is the release date in YYYYMMDD format.
- * It can change every day so the right thing to do with it is use it
- * in preprocessor commands such as "#if (__RES > 19931104)". Do not
- * compare for equality; rather, use it to determine whether your resolver
- * is new enough to contain a certain feature.
- */
-
-#define __RES 19960801
-
-/*
- * This used to be defined in res_query.c, now it's in herror.c. It was
- * never extern'd by any *.h file before it was placed here. herror.c is
- * part of libresolv.a even though it might make more sense in libnetdb.a
- * or even libnet.a.
- */
-
-extern int h_errno;
-
-/*
- * Resolver configuration file.
- * Normally not present, but may contain the address of the
- * inital name server(s) to query and the domain search list.
- */
-
-#ifndef _PATH_RESCONF
-#define _PATH_RESCONF "/etc/resolv.conf"
-#endif
-
-/*
- * Global defines and variables for resolver stub.
- */
-#define MAXNS 3 /* max # name servers we'll track */
-#define MAXDFLSRCH 3 /* # default domain levels to try */
-#define MAXDNSRCH 6 /* max # domains in search path */
-#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
-
-#define RES_TIMEOUT 5 /* min. seconds between retries */
-#define MAXRESOLVSORT 10 /* number of net to sort on */
-#define RES_MAXNDOTS 15 /* should reflect bit field size */
-
-struct __res_state {
- int retrans; /* retransmition time interval */
- int retry; /* number of times to retransmit */
- u_long options; /* option flags - see below. */
- int nscount; /* number of name servers */
- struct sockaddr_in
- nsaddr_list[MAXNS]; /* address of name server */
-#define nsaddr nsaddr_list[0] /* for backward compatibility */
- u_short id; /* current message id */
- char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
- char defdname[256]; /* default domain (deprecated) */
- u_long pfcode; /* RES_PRF_ flags - see below. */
- unsigned ndots:4; /* threshold for initial abs. query */
- unsigned nsort:4; /* number of elements in sort_list[] */
- char unused[3];
- struct {
- struct in_addr addr;
- u_int32_t mask;
- } sort_list[MAXRESOLVSORT];
- char pad[72]; /* on an i386 this means 512b total */
-};
-
-/*
- * Resolver options (keep these in synch with res_debug.c, please)
- */
-#define RES_INIT 0x00000001 /* address initialized */
-#define RES_DEBUG 0x00000002 /* print debug messages */
-#define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/
-#define RES_USEVC 0x00000008 /* use virtual circuit */
-#define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */
-#define RES_IGNTC 0x00000020 /* ignore truncation errors */
-#define RES_RECURSE 0x00000040 /* recursion desired */
-#define RES_DEFNAMES 0x00000080 /* use default domain name */
-#define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */
-#define RES_DNSRCH 0x00000200 /* search up local domain tree */
-#define RES_INSECURE1 0x00000400 /* type 1 security disabled */
-#define RES_INSECURE2 0x00000800 /* type 2 security disabled */
-#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
-#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
-#define RES_NOTLDQUERY 0x00004000 /* Don't query TLD names */
-
-#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
-
-/*
- * Resolver "pfcode" values. Used by dig.
- */
-#define RES_PRF_STATS 0x00000001
-#define RES_PRF_UPDATE 0x00000002
-#define RES_PRF_CLASS 0x00000004
-#define RES_PRF_CMD 0x00000008
-#define RES_PRF_QUES 0x00000010
-#define RES_PRF_ANS 0x00000020
-#define RES_PRF_AUTH 0x00000040
-#define RES_PRF_ADD 0x00000080
-#define RES_PRF_HEAD1 0x00000100
-#define RES_PRF_HEAD2 0x00000200
-#define RES_PRF_TTLID 0x00000400
-#define RES_PRF_HEADX 0x00000800
-#define RES_PRF_QUERY 0x00001000
-#define RES_PRF_REPLY 0x00002000
-#define RES_PRF_INIT 0x00004000
-/* 0x00008000 */
-
-typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
- res_sendhookact;
-
-typedef res_sendhookact (*res_send_qhook)__P((struct sockaddr_in * const *ns,
- const u_char **query,
- int *querylen,
- u_char *ans,
- int anssiz,
- int *resplen));
-
-typedef res_sendhookact (*res_send_rhook)__P((const struct sockaddr_in *ns,
- const u_char *query,
- int querylen,
- u_char *ans,
- int anssiz,
- int *resplen));
-
-struct res_sym {
- int number; /* Identifying number, like T_MX */
- char * name; /* Its symbolic name, like "MX" */
- char * humanname; /* Its fun name, like "mail exchanger" */
-};
-
-extern struct __res_state _res;
-extern const struct res_sym __p_class_syms[];
-extern const struct res_sym __p_type_syms[];
-
-/* Private routines shared between libc/net, named, nslookup and others. */
-#define res_hnok __res_hnok
-#define res_ownok __res_ownok
-#define res_mailok __res_mailok
-#define res_dnok __res_dnok
-#define sym_ston __sym_ston
-#define sym_ntos __sym_ntos
-#define sym_ntop __sym_ntop
-#define b64_ntop __b64_ntop
-#define b64_pton __b64_pton
-#define loc_ntoa __loc_ntoa
-#define loc_aton __loc_aton
-#define fp_resstat __fp_resstat
-#define p_query __p_query
-#define dn_skipname __dn_skipname
-#define fp_resstat __fp_resstat
-#define fp_query __fp_query
-#define fp_nquery __fp_nquery
-#define hostalias __hostalias
-#define putlong __putlong
-#define putshort __putshort
-#define p_class __p_class
-#define p_time __p_time
-#define p_type __p_type
-#define p_query __p_query
-#define p_cdnname __p_cdnname
-#define p_section __p_section
-#define p_cdname __p_cdname
-#define p_fqnname __p_fqnname
-#define p_fqname __p_fqname
-#define p_option __p_option
-#define p_secstodate __p_secstodate
-#define dn_count_labels __dn_count_labels
-#define dn_comp __dn_comp
-#define dn_expand __dn_expand
-#define res_init __res_init
-#define res_randomid __res_randomid
-#define res_query __res_query
-#define res_search __res_search
-#define res_querydomain __res_querydomain
-#define res_mkquery __res_mkquery
-#define res_send __res_send
-#define res_isourserver __res_isourserver
-#define res_nameinquery __res_nameinquery
-#define res_queriesmatch __res_queriesmatch
-#define res_close __res_close
-#define res_mkupdate __res_mkupdate
-#define res_mkupdrec __res_mkupdrec
-#define res_freeupdrec __res_freeupdrec
-
-__BEGIN_DECLS
-int res_hnok __P((const char *));
-int res_ownok __P((const char *));
-int res_mailok __P((const char *));
-int res_dnok __P((const char *));
-int sym_ston __P((const struct res_sym *, const char *, int *));
-const char * sym_ntos __P((const struct res_sym *, int, int *));
-const char * sym_ntop __P((const struct res_sym *, int, int *));
-int b64_ntop __P((u_char const *, size_t, char *, size_t));
-int b64_pton __P((char const *, u_char *, size_t));
-int loc_aton __P((const char *, u_char *));
-const char * loc_ntoa __P((const u_char *, char *));
-int dn_skipname __P((const u_char *, const u_char *));
-void fp_resstat __P((struct __res_state *, FILE *));
-void fp_query __P((const u_char *, FILE *));
-void fp_nquery __P((const u_char *, int, FILE *));
-const char * hostalias __P((const char *));
-void putlong __P((u_int32_t, u_char *));
-void putshort __P((u_int16_t, u_char *));
-const char * p_class __P((int));
-const char * p_time __P((u_int32_t));
-const char * p_type __P((int));
-void p_query __P((const u_char *));
-const u_char * p_cdnname __P((const u_char *, const u_char *, int, FILE *));
-const u_char * p_cdname __P((const u_char *, const u_char *, FILE *));
-const u_char * p_fqnname __P((const u_char *, const u_char *,
- int, char *, int));
-const u_char * p_fqname __P((const u_char *, const u_char *, FILE *));
-const char * p_option __P((u_long));
-char * p_secstodate __P((u_long));
-int dn_count_labels __P((const char *));
-int dn_comp __P((const char *, u_char *, int,
- u_char **, u_char **));
-int dn_expand __P((const u_char *, const u_char *, const u_char *,
- char *, int));
-int res_init __P((void));
-u_int res_randomid __P((void));
-int res_query __P((const char *, int, int, u_char *, int));
-int res_search __P((const char *, int, int, u_char *, int));
-int res_querydomain __P((const char *, const char *, int, int,
- u_char *, int));
-int res_mkquery __P((int, const char *, int, int, const u_char *,
- int, const u_char *, u_char *, int));
-int res_send __P((const u_char *, int, u_char *, int));
-int res_isourserver __P((const struct sockaddr_in *));
-int res_nameinquery __P((const char *, int, int,
- const u_char *, const u_char *));
-int res_queriesmatch __P((const u_char *, const u_char *,
- const u_char *, const u_char *));
-void res_close __P((void));
-const char * p_section __P((int, int));
-/* XXX The following depend on the ns_updrec typedef in arpa/nameser.h */
-#ifdef _ARPA_NAMESER_H_
-int res_update __P((ns_updrec *));
-int res_mkupdate __P((ns_updrec *, u_char *, int));
-ns_updrec * res_mkupdrec __P((int, const char *, u_int, u_int, u_long));
-void res_freeupdrec __P((ns_updrec *));
-#endif
-__END_DECLS
-
-#endif /* !_RESOLV_H_ */
diff --git a/c/src/libnetworking/rtems/Makefile.in b/c/src/libnetworking/rtems/Makefile.in
deleted file mode 100644
index 038fb5c68e..0000000000
--- a/c/src/libnetworking/rtems/Makefile.in
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=lib.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES=sghostname issetugid \
- rtems_glue rtems_syscall rtems_bootp \
- rtems_showmbuf rtems_showroute \
- rtems_showifstat rtems_showipstat rtems_showicmpstat \
- rtems_showtcpstat rtems_showudpstat
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(C_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \
- -DDIAGNOSTIC -DBOOTP_COMPAT
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
diff --git a/c/src/libnetworking/rtems/issetugid.c b/c/src/libnetworking/rtems/issetugid.c
deleted file mode 100644
index 3baf0ec88b..0000000000
--- a/c/src/libnetworking/rtems/issetugid.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Dummy version of BSD routine
- *
- * $Id$
- */
-
-int
-issetugid (void)
-{
- return 0;
-}
diff --git a/c/src/libnetworking/rtems/rtems_bootp.c b/c/src/libnetworking/rtems/rtems_bootp.c
deleted file mode 100644
index 47e3db758f..0000000000
--- a/c/src/libnetworking/rtems/rtems_bootp.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/error.h>
-#include <sys/types.h>
-#include <rtems/rtems_bsdnet.h>
-
-/*
- * Perform a BOOTP request
- */
-void
-rtems_bsdnet_do_bootp (void)
-{
- rtems_bsdnet_semaphore_obtain ();
- bootpc_init ();
- rtems_bsdnet_semaphore_release ();
-}
diff --git a/c/src/libnetworking/rtems/rtems_bsdnet.h b/c/src/libnetworking/rtems/rtems_bsdnet.h
deleted file mode 100644
index 73ad92fa30..0000000000
--- a/c/src/libnetworking/rtems/rtems_bsdnet.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef _RTEMS_BSDNET_
-#define _RTEMS_BSDNET_
-
-#include <rtems.h>
-
-/*
- * Values that may be obtained by BOOTP
- */
-extern struct in_addr rtems_bsdnet_bootp_server_address;
-extern char *rtems_bsdnet_bootp_boot_file_name;
-
-/*
- * Manipulate routing tables
- */
-struct sockaddr;
-struct rtentry;
-int rtems_bsdnet_rtrequest (
- int req,
- struct sockaddr *dst,
- struct sockaddr *gateway,
- struct sockaddr *netmask,
- int flags,
- struct rtentry **net_nrt);
-
-/*
- * Diagnostics
- */
-void rtems_bsdnet_show_inet_routes (void);
-void rtems_bsdnet_show_mbuf_stats (void);
-void rtems_bsdnet_show_if_stats (void);
-void rtems_bsdnet_show_ip_stats (void);
-void rtems_bsdnet_show_icmp_stats (void);
-void rtems_bsdnet_show_udp_stats (void);
-void rtems_bsdnet_show_tcp_stats (void);
-
-/*
- * Network configuration
- */
-struct rtems_bsdnet_ifconfig {
- /*
- * These two entries must be supplied for each interface.
- */
- char *name;
- int (*attach)(struct rtems_bsdnet_ifconfig *conf);
-
- /*
- * Link to next interface
- */
- struct rtems_bsdnet_ifconfig *next;
-
- /*
- * The following entries may be obtained
- * from BOOTP or explicitily supplied.
- */
- char *ip_address;
- char *ip_netmask;
- void *hardware_address;
-
- /*
- * The driver assigns defaults values to the following
- * entries if they are not explicitly supplied.
- */
- int ignore_broadcast;
- int mtu;
- int rbuf_count;
- int xbuf_count;
-
- /*
- * For external ethernet controller board the following
- * parameters are needed
- */
- unsigned int port; /* port of the board */
- unsigned int irno; /* irq of the board */
- unsigned int bpar; /* memory of the board */
-
-};
-
-struct rtems_bsdnet_config {
- /*
- * This entry points to the head of the ifconfig chain.
- */
- struct rtems_bsdnet_ifconfig *ifconfig;
-
- /*
- * This entry should be rtems_bsdnet_do_bootp if BOOTP
- * is being used to configure the network, and NULL
- * if BOOTP is not being used.
- */
- void (*bootp)(void);
-
- /*
- * The remaining items can be initialized to 0, in
- * which case the default value will be used.
- */
- rtems_task_priority network_task_priority; /* 100 */
- unsigned long mbuf_bytecount; /* 64 kbytes */
- unsigned long mbuf_cluster_bytecount; /* 128 kbytes */
- char *hostname; /* BOOTP */
- char *domainname; /* BOOTP */
- char *gateway; /* BOOTP */
- char *log_host; /* BOOTP */
- char *name_server[3]; /* BOOTP */
-};
-extern struct rtems_bsdnet_config rtems_bsdnet_config;
-int rtems_bsdnet_initialize_network (void);
-void rtems_bsdnet_do_bootp (void);
-
-#endif /* _RTEMS_BSDNET_ */
diff --git a/c/src/libnetworking/rtems/rtems_bsdnet_internal.h b/c/src/libnetworking/rtems/rtems_bsdnet_internal.h
deleted file mode 100644
index 559bafd4c5..0000000000
--- a/c/src/libnetworking/rtems/rtems_bsdnet_internal.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Declarations to fit FreeBSD to RTEMS.
- *
- *******************************************************************
- * WARNING *
- * This file should *never* be included by any application program *
- *******************************************************************
- *
- * $Id$
- */
-
-#ifndef _RTEMS_BSDNET_INTERNAL_H_
-#define _RTEMS_BSDNET_INTERNAL_H_
-
-typedef unsigned int vm_offset_t;
-typedef long long vm_ooffset_t;
-typedef unsigned int vm_pindex_t;
-typedef unsigned int vm_size_t;
-
-#define _BSD_OFF_T_ rtems_signed32
-#define _BSD_PID_T_ rtems_id
-#define _BSD_VA_LIST_ char *
-
-/* make sure we get the network versions of these */
-#include "../machine/types.h"
-#include "../machine/param.h"
-
-#include <sys/time.h>
-struct itimerval {
- struct timeval it_interval;
- struct timeval it_value;
-};
-struct mdproc {
- int md_flags;
- int *md_regs;
-};
-
-#define USHRT_MAX 65535
-
-/*
- * Other RTEMS/BSD glue
- */
-struct socket;
-extern void soconnsleep (struct socket *so);
-extern void soconnwakeup (struct socket *so);
-#define splnet() 0
-#define splimp() 0
-#define splx(_s) do { (_s) = 0; } while(0)
-
-#define ovbcopy(f,t,n) bcopy(f,t,n)
-#define copyout(f,t,n) (memcpy(t,f,n),0)
-#define copyin(f,t,n) (memcpy(t,f,n),0)
-
-#define random() rtems_bsdnet_random()
-#define panic rtems_panic
-#define suser(a,b) 0
-
-void microtime (struct timeval *tv);
-#define hz rtems_bsdnet_ticks_per_second
-#define tick rtems_bsdnet_microseconds_per_tick
-
-#define SHRT_MAX 65535
-
-#define log rtems_bsdnet_log
-
-/*
- * Since we can't have two sys/types.h files, we'll hack around
- * and copy the contents of the BSD sys/types.h to here....
- */
-#include <sys/cdefs.h>
-
-typedef u_int64_t u_quad_t; /* quads */
-typedef int64_t quad_t;
-typedef quad_t * qaddr_t;
-
-typedef void __sighandler_t __P((int));
-typedef __sighandler_t *sig_t; /* type of pointer to a signal function */
-#define NSIG 32
-struct sigaltstack {
- char *ss_sp; /* signal stack base */
- int ss_size; /* signal stack length */
- int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */
-};
-
-#ifdef KERNEL
-typedef int boolean_t;
-typedef struct vm_page *vm_page_t;
-#endif
-
-#ifndef _POSIX_SOURCE
-/*
- * minor() gives a cookie instead of an index since we don't want to
- * change the meanings of bits 0-15 or waste time and space shifting
- * bits 16-31 for devices that don't use them.
- */
-#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
-#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */
-#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */
-#endif
-
-#include <machine/endian.h>
-
-typedef quad_t rlim_t; /* resource limit */
-typedef u_int32_t fixpt_t; /* fixed point number */
-
-/*
- * Forward structure declarations for function prototypes. We include the
- * common structures that cross subsystem boundaries here; others are mostly
- * used in the same place that the structure is defined.
- */
-struct proc;
-struct pgrp;
-struct ucred;
-struct rusage;
-struct file;
-struct buf;
-struct tty;
-struct uio;
-
-/*
- * Redo kernel memory allocation
- */
-#define malloc rtems_bsdnet_malloc
-#define free rtems_bsdnet_free
-
-#define M_NOWAIT 0x0001
-void *rtems_bsdnet_malloc (unsigned long size, int type, int flags);
-void rtems_bsdnet_free (void *addr, int type);
-
-void rtems_bsdnet_semaphore_obtain (void);
-void rtems_bsdnet_semaphore_release (void);
-void rtems_bsdnet_schednetisr (int n);
-
-unsigned long rtems_bsdnet_seconds_since_boot (void);
-unsigned long rtems_bsdnet_random (void);
-
-rtems_id rtems_bsdnet_newproc (
- char *name,
- int stacksize,
- void (*entry)(void *),
- void *arg
-);
-
-rtems_status_code rtems_bsdnet_event_receive (
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-);
-
-/*
- * Network configuration
- */
-extern int rtems_bsdnet_ticks_per_second;
-extern int rtems_bsdnet_microseconds_per_tick;
-extern struct in_addr rtems_bsdnet_log_host_address;
-extern char *rtems_bsdnet_domain_name;
-extern struct in_addr rtems_bsdnet_nameserver[];
-extern int rtems_bsdnet_nameserver_count;
-
-/*
- * Internal IOCTL command
- */
-#define SIO_RTEMS_SHOW_STATS _IO('i', 250)
-
-/*
- * Some extra prototypes
- */
-int sethostname (char *name, int namelen);
-void domaininit (void *);
-void ifinit (void *);
-void ipintr (void);
-void arpintr (void);
-void bootpc_init(void);
-int socket (int, int, int);
-int ioctl (int, unsigned long, ...);
-
-#endif /* _RTEMS_BSDNET_INTERNAL_H_ */
diff --git a/c/src/libnetworking/rtems/rtems_glue.c b/c/src/libnetworking/rtems/rtems_glue.c
deleted file mode 100644
index dd80a13d08..0000000000
--- a/c/src/libnetworking/rtems/rtems_glue.c
+++ /dev/null
@@ -1,905 +0,0 @@
-/*
- * $Id$
- */
-
-#include <string.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <errno.h>
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/error.h>
-#include <rtems/rtems_bsdnet.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/domain.h>
-#include <sys/mbuf.h>
-#include <sys/socketvar.h>
-#include <sys/socket.h>
-#include <sys/sockio.h>
-#include <sys/callout.h>
-#include <sys/proc.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <vm/vm.h>
-#include <arpa/inet.h>
-
-#include <net/netisr.h>
-#include <net/route.h>
-
-/*
- * Events used by networking routines.
- * Everything will break if the application
- * tries to use these events or if the `sleep'
- * events are equal to any of the NETISR * events.
- */
-#define SBWAIT_EVENT RTEMS_EVENT_24
-#define SOSLEEP_EVENT RTEMS_EVENT_25
-#define NETISR_IP_EVENT (1 << NETISR_IP)
-#define NETISR_ARP_EVENT (1 << NETISR_ARP)
-#define NETISR_EVENTS (NETISR_IP_EVENT|NETISR_ARP_EVENT)
-
-
-/*
- * Memory allocation
- */
-static int nmbuf = (64 * 1024) / MSIZE;
- int nmbclusters = (128 * 1024) / MCLBYTES;
-
-/*
- * Socket buffering parameters
- */
-unsigned long sb_efficiency = 8;
-
-/*
- * Network task synchronization
- */
-static rtems_id networkSemaphore;
-static rtems_id networkDaemonTid;
-static rtems_unsigned32 networkDaemonPriority;
-static void networkDaemon (void *task_argument);
-
-/*
- * Network timing
- */
-int rtems_bsdnet_ticks_per_second;
-int rtems_bsdnet_microseconds_per_tick;
-
-/*
- * Callout processing
- */
-static rtems_interval ticksWhenCalloutsLastChecked;
-static struct callout *callfree, calltodo;
-
-/*
- * FreeBSD variables
- */
-int nfs_diskless_valid;
-
-/*
- * BOOTP values
- */
-struct in_addr rtems_bsdnet_log_host_address;
-struct in_addr rtems_bsdnet_bootp_server_address;
-char *rtems_bsdnet_bootp_boot_file_name;
-char *rtems_bsdnet_domain_name;
-struct in_addr rtems_bsdnet_nameserver[sizeof rtems_bsdnet_config.name_server /
- sizeof rtems_bsdnet_config.name_server[0]];
-int rtems_bsdnet_nameserver_count;
-
-extern rtems_libio_handler_t rtems_bsdnet_io_handler;
-
-/*
- * Perform FreeBSD memory allocation.
- * FIXME: This should be modified to keep memory allocation statistics.
- */
-#undef malloc
-#undef free
-extern void *malloc (size_t);
-extern void free (void *);
-void *
-rtems_bsdnet_malloc (unsigned long size, int type, int flags)
-{
- void *p;
-
- for (;;) {
- p = malloc (size);
- if (p)
- return p;
- if (flags & M_NOWAIT)
- return p;
- /*
- * FIXME: This should be redone as:
- * static volatile int rtems_bsdnet_need_memory;
- *
- * rtems_bsdnet_need_memory = 1;
- * message_queue_receive
- *
- * Then in rtems_bsdnet_freee:
- * free (....);
- * if (rtems_bsdnet_need_memory)
- * rtems_bsdnet_need_memory = 0;
- * message_queue_broadcast
- */
- rtems_task_wake_after (rtems_bsdnet_ticks_per_second);
- }
-}
-
-/*
- * Free FreeBSD memory
- * FIXME: This should be modified to keep memory allocation statistics.
- */
-void
-rtems_bsdnet_free (void *addr, int type)
-{
- free (addr);
-}
-
-/*
- * Do the initializations required by the BSD code
- * FIXME: Maybe we should use a different memory allocation scheme that
- * would let us share space between mbufs and mbuf clusters.
- * For now, we'll just take the easy way out!
- */
-static void
-bsd_init ()
-{
- /*
- * Set up mbuf data strutures
- * Cluster allocation *must* come first -- see comment on kmem_malloc().
- */
- m_clalloc (nmbclusters, M_DONTWAIT);
- mclrefcnt = malloc (nmbclusters);
- if (mclrefcnt == NULL)
- rtems_panic ("No memory for mbuf cluster reference counts.");
- memset (mclrefcnt, '\0', nmbclusters);
- m_mballoc (nmbuf, M_DONTWAIT);
- mbstat.m_mtypes[MT_FREE] = nmbuf;
-
-
- /*
- * Set up domains
- */
- {
- extern struct domain routedomain;
- extern struct domain inetdomain;
-
- routedomain.dom_next = domains;
- domains = &routedomain;
- inetdomain.dom_next = domains;
- domains = &inetdomain;
- domaininit (NULL);
- }
-
- /*
- * Set up interfaces
- */
- ifinit (NULL);
-}
-
-/*
- * Initialize and start network operations
- */
-static void
-rtems_bsdnet_initialize (void)
-{
- rtems_status_code sc;
-
- /*
- * Set the priority of all network tasks
- */
- if (rtems_bsdnet_config.network_task_priority == 0)
- networkDaemonPriority = 100;
- else
- networkDaemonPriority = rtems_bsdnet_config.network_task_priority;
-
- /*
- * Set the memory allocation limits
- */
- if (rtems_bsdnet_config.mbuf_bytecount)
- nmbuf = rtems_bsdnet_config.mbuf_bytecount / MSIZE;
- if (rtems_bsdnet_config.mbuf_cluster_bytecount)
- nmbclusters = rtems_bsdnet_config.mbuf_cluster_bytecount / MCLBYTES;
-
- /*
- * Create the task-synchronization semaphore
- */
- sc = rtems_semaphore_create (rtems_build_name('B', 'S', 'D', 'n'),
- 0,
- RTEMS_FIFO |
- RTEMS_BINARY_SEMAPHORE |
- RTEMS_NO_INHERIT_PRIORITY |
- RTEMS_NO_PRIORITY_CEILING |
- RTEMS_LOCAL,
- 0,
- &networkSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't create network seamphore: `%s'\n", rtems_status_text (sc));
-
- /*
- * Compute clock tick conversion factors
- */
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &rtems_bsdnet_ticks_per_second);
- if (rtems_bsdnet_ticks_per_second <= 0)
- rtems_bsdnet_ticks_per_second = 1;
- rtems_bsdnet_microseconds_per_tick = 1000000 / rtems_bsdnet_ticks_per_second;
-
- /*
- * Ensure that `seconds' is greater than 0
- */
- rtems_task_wake_after (rtems_bsdnet_ticks_per_second);
-
- /*
- * Set up BSD-style sockets
- */
- bsd_init ();
-
- /*
- * Start network daemon
- */
- networkDaemonTid = rtems_bsdnet_newproc ("ntwk", 4096, networkDaemon, NULL);
-
- /*
- * Register as an external I/O handler
- */
- rtems_register_libio_handler (RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET,
- &rtems_bsdnet_io_handler);
-
- /*
- * Let other network tasks begin
- */
- rtems_bsdnet_semaphore_release ();
-}
-
-rtems_id TaskWithSemaphore;
-/*
- * Obtain network mutex
- */
-void
-rtems_bsdnet_semaphore_obtain (void)
-{
- rtems_status_code sc;
-
- sc = rtems_semaphore_obtain (networkSemaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-rtems_task_ident (RTEMS_SELF, 0, &TaskWithSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't obtain network semaphore: `%s'\n", rtems_status_text (sc));
-}
-
-/*
- * Release network mutex
- */
-void
-rtems_bsdnet_semaphore_release (void)
-{
- rtems_status_code sc;
-
-TaskWithSemaphore = 0;
- sc = rtems_semaphore_release (networkSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't release network semaphore: `%s'\n", rtems_status_text (sc));
- }
-
-/*
- * Wait for something to happen to a socket buffer
- */
-int
-sbwait(sb)
- struct sockbuf *sb;
-{
- rtems_event_set events;
- rtems_id tid;
- rtems_status_code sc;
-
- /*
- * Soak up any pending events.
- * The sleep/wakeup synchronization in the FreeBSD
- * kernel has no memory.
- */
- rtems_event_receive (SBWAIT_EVENT, RTEMS_EVENT_ANY | RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Set this task as the target of the wakeup operation.
- */
- if (sb->sb_sel.si_pid)
- rtems_panic ("Another task is already sleeping on that socket buffer");
- rtems_task_ident (RTEMS_SELF, 0, &tid);
- sb->sb_sel.si_pid = tid;
-
- /*
- * Mark the socket buffer as waiting.
- */
- sb->sb_flags |= SB_WAIT;
-
- /*
- * Release the network semaphore.
- */
- rtems_bsdnet_semaphore_release ();
-
- /*
- * Wait for the wakeup event.
- */
- sc = rtems_event_receive (SBWAIT_EVENT, RTEMS_EVENT_ANY | RTEMS_WAIT, sb->sb_timeo, &events);
-
- /*
- * Reobtain the network semaphore.
- */
- rtems_bsdnet_semaphore_obtain ();
-
- /*
- * Relinquish ownership of the socket buffer
- */
- sb->sb_flags &= ~SB_WAIT;
- sb->sb_sel.si_pid = 0;
-
- /*
- * Return the status of the wait.
- */
- switch (sc) {
- case RTEMS_SUCCESSFUL: return 0;
- case RTEMS_TIMEOUT: return EWOULDBLOCK;
- default: return ENXIO;
- }
-}
-
-
-/*
- * Wake up the task waiting on a socket buffer.
- */
-void
-sowakeup(so, sb)
- register struct socket *so;
- register struct sockbuf *sb;
-{
- if (sb->sb_flags & SB_WAIT) {
- sb->sb_flags &= ~SB_WAIT;
- rtems_event_send (sb->sb_sel.si_pid, SBWAIT_EVENT);
- }
-}
-
-/*
- * For now, a socket can be used by only one task at a time.
- */
-int
-sb_lock(sb)
- register struct sockbuf *sb;
-{
- rtems_panic ("Socket buffer is already in use.");
- return 0;
-}
-void
-wakeup (void *p)
-{
- rtems_panic ("Wakeup called");
-}
-
-/*
- * Wait for a connection/disconnection event.
- */
-void
-soconnsleep (struct socket *so)
-{
- rtems_event_set events;
- rtems_id tid;
-
- /*
- * Soak up any pending events.
- * The sleep/wakeup synchronization in the FreeBSD
- * kernel has no memory.
- */
- rtems_event_receive (SOSLEEP_EVENT, RTEMS_EVENT_ANY | RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Set this task as the target of the wakeup operation.
- */
- if (so->so_pgid)
- rtems_panic ("Another task is already sleeping on that socket");
- rtems_task_ident (RTEMS_SELF, 0, &tid);
- so->so_pgid = tid;
-
- /*
- * Wait for the wakeup event.
- */
- rtems_bsdnet_event_receive (SOSLEEP_EVENT, RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Relinquish ownership of the socket.
- */
- so->so_pgid = 0;
-}
-
-/*
- * Wake up a task waiting for a connection/disconnection to complete.
- */
-void
-soconnwakeup (struct socket *so)
-{
- if (so->so_pgid)
- rtems_event_send (so->so_pgid, SOSLEEP_EVENT);
-}
-
-/*
- * Send an event to the network daemon.
- * This corresponds to sending a software interrupt in the BSD kernel.
- */
-void
-rtems_bsdnet_schednetisr (int n)
-{
- rtems_event_send (networkDaemonTid, 1 << n);
-}
-
-/*
- * The network daemon
- * This provides a context to run BSD software interrupts
- */
-static void
-networkDaemon (void *task_argument)
-{
- rtems_event_set events;
- rtems_interval now;
- int ticksPassed;
- unsigned32 timeout;
- struct callout *c;
-
- for (;;) {
- c = calltodo.c_next;
- if (c)
- timeout = c->c_time;
- else
- timeout = RTEMS_NO_TIMEOUT;
- rtems_bsdnet_event_receive (NETISR_EVENTS,
- RTEMS_EVENT_ANY | RTEMS_WAIT,
- timeout,
- &events);
- if (events & NETISR_IP_EVENT)
- ipintr ();
- if (events & NETISR_ARP_EVENT)
- arpintr ();
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- ticksPassed = now - ticksWhenCalloutsLastChecked;
- if (ticksPassed != 0) {
- ticksWhenCalloutsLastChecked = now;
-
- c = calltodo.c_next;
- if (c) {
- c->c_time -= ticksPassed;
- while ((c = calltodo.c_next) != NULL && c->c_time <= 0) {
- void *arg;
- void (*func) (void *);
-
- func = c->c_func;
- arg = c->c_arg;
- calltodo.c_next = c->c_next;
- c->c_next = callfree;
- callfree = c;
- (*func)(arg);
- }
- }
- }
- }
-}
-
-/*
- * Structure passed to task-start stub
- */
-struct newtask {
- void (*entry)(void *);
- void *arg;
-};
-
-/*
- * Task-start stub
- */
-static void
-taskEntry (rtems_task_argument arg)
-{
- struct newtask t;
-
- /*
- * Pick up task information and free
- * the memory allocated to pass the
- * information to this task.
- */
- t = *(struct newtask *)arg;
- free ((struct newtask *)arg);
-
- /*
- * Enter the competition for the network semaphore
- */
- rtems_bsdnet_semaphore_obtain ();
-
- /*
- * Enter the task
- */
- (*t.entry)(t.arg);
- rtems_panic ("Network task returned!\n");
-}
-
-/*
- * Start a network task
- */
-rtems_id
-rtems_bsdnet_newproc (char *name, int stacksize, void(*entry)(void *), void *arg)
-{
- struct newtask *t;
- char nm[4];
- rtems_id tid;
- rtems_status_code sc;
-
- strncpy (nm, name, 4);
- sc = rtems_task_create (rtems_build_name(nm[0], nm[1], nm[2], nm[3]),
- networkDaemonPriority,
- stacksize,
- RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
- RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
- &tid);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't create network daemon `%s': `%s'\n", name, rtems_status_text (sc));
-
- /*
- * Set up task arguments
- */
- t = malloc (sizeof *t);
- t->entry = entry;
- t->arg = arg;
-
- /*
- * Start the task
- */
- sc = rtems_task_start (tid, taskEntry, (rtems_task_argument)t);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't start network daemon `%s': `%s'\n", name, rtems_status_text (sc));
-
- /*
- * Let our caller know the i.d. of the new task
- */
- return tid;
-}
-
-rtems_status_code rtems_bsdnet_event_receive (
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out)
-{
- rtems_status_code sc;
-
- rtems_bsdnet_semaphore_release ();
- sc = rtems_event_receive (event_in, option_set, ticks, event_out);
- rtems_bsdnet_semaphore_obtain ();
- return sc;
-}
-
-/*
- * Return time since startup
- */
-void
-microtime (struct timeval *t)
-{
- rtems_interval now;
-
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- t->tv_sec = now / rtems_bsdnet_ticks_per_second;
- t->tv_usec = (now % rtems_bsdnet_ticks_per_second) * rtems_bsdnet_microseconds_per_tick;
-}
-
-unsigned long
-rtems_bsdnet_seconds_since_boot (void)
-{
- rtems_interval now;
-
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- return now / rtems_bsdnet_ticks_per_second;
-}
-
-/*
- * Fake random number generator
- */
-unsigned long
-rtems_bsdnet_random (void)
-{
- rtems_interval now;
-
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- return (now * 99991);
-}
-
-/*
- * Callout list processing
- */
-void
-timeout(void (*ftn)(void *), void *arg, int ticks)
-{
- register struct callout *new, *p, *t;
-
- if (ticks <= 0)
- ticks = 1;
-
- /* Fill in the next free callout structure. */
- if (callfree == NULL) {
- callfree = malloc (sizeof *callfree);
- if (callfree == NULL)
- rtems_panic ("No memory for timeout table entry");
- callfree->c_next = NULL;
- }
-
- new = callfree;
- callfree = new->c_next;
- new->c_arg = arg;
- new->c_func = ftn;
-
- /*
- * The time for each event is stored as a difference from the time
- * of the previous event on the queue. Walk the queue, correcting
- * the ticks argument for queue entries passed. Correct the ticks
- * value for the queue entry immediately after the insertion point
- * as well. Watch out for negative c_time values; these represent
- * overdue events.
- */
- for (p = &calltodo;
- (t = p->c_next) != NULL && ticks > t->c_time; p = t)
- if (t->c_time > 0)
- ticks -= t->c_time;
- new->c_time = ticks;
- if (t != NULL)
- t->c_time -= ticks;
-
- /* Insert the new entry into the queue. */
- p->c_next = new;
- new->c_next = t;
-}
-
-/*
- * Ticks till specified time
- * FIXME: This version worries only about seconds, but that's good
- * enough for the way the network code uses this routine.
- */
-int
-hzto(struct timeval *tv)
-{
- long diff = tv->tv_sec - rtems_bsdnet_seconds_since_boot();
-
- if (diff <= 0)
- return 1;
- return diff * rtems_bsdnet_ticks_per_second;
-}
-
-/*
- * Kernel debugging
- */
-int rtems_bsdnet_log_priority;
-void
-rtems_bsdnet_log (int priority, const char *fmt, ...)
-{
- va_list args;
-
- if (priority & rtems_bsdnet_log_priority) {
- va_start (args, fmt);
- vprintf (fmt, args);
- va_end (args);
- }
-}
-
-/*
- * Hack alert: kmem_malloc `knows' that its
- * first invocation is to get mbuf clusters!
- */
-int mb_map_full;
-vm_map_t mb_map;
-vm_offset_t
-kmem_malloc (vm_map_t *map, vm_size_t size, boolean_t waitflag)
-{
- void *p;
-
- /*
- * Can't get memory if we're already running.
- */
- if (networkDaemonTid) {
- if (waitflag == M_WAITOK)
- rtems_panic (
-"Network mbuf space can not be enlarged after rtems_bsdnet_initialize() has\n"
-"returned. Enlarge the initial mbuf/cluster size in rtems_bsdnet_config.");
- return 0;
- }
-
-#define ROUNDSIZE 2048
- p = malloc (size+ROUNDSIZE);
- p = (void *)((unsigned long)p & ~(ROUNDSIZE-1));
- if ((p == NULL) && (waitflag == M_WAITOK))
- rtems_panic ("Can't get initial network memory!");
- if (mbutl == NULL)
- mbutl = p;
- return (vm_offset_t)p;
-}
-
-/*
- * IP header checksum routine for processors which don't have an inline version
- */
-u_int
-in_cksum_hdr (const void *ip)
-{
- rtems_unsigned32 sum;
- const rtems_unsigned16 *sp;
- int i;
-
- sum = 0;
- sp = (rtems_unsigned16 *)ip;
- for (i = 0 ; i < 10 ; i++)
- sum += *sp++;
- while (sum > 0xFFFF)
- sum = (sum & 0xffff) + (sum >> 16);
- return ~sum & 0xFFFF;
-}
-
-/*
- * Manipulate routing tables
- */
-int rtems_bsdnet_rtrequest (
- int req,
- struct sockaddr *dst,
- struct sockaddr *gateway,
- struct sockaddr *netmask,
- int flags,
- struct rtentry **net_nrt)
-{
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- error = rtrequest (req, dst, gateway, netmask, flags, net_nrt);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- errno = error;
- return -1;
- }
- return 0;
-}
-
-static void
-rtems_bsdnet_setup (void)
-{
- struct rtems_bsdnet_ifconfig *ifp;
- int s;
- struct ifreq ifreq;
- struct sockaddr_in address;
- struct sockaddr_in netmask;
- struct sockaddr_in broadcast;
- struct sockaddr_in gateway;
- int i;
-
- /*
- * Set local parameters
- */
- if (rtems_bsdnet_config.hostname)
- sethostname (rtems_bsdnet_config.hostname,
- strlen (rtems_bsdnet_config.hostname));
- if (rtems_bsdnet_config.domainname)
- rtems_bsdnet_domain_name =
- strdup (rtems_bsdnet_config.domainname);
- if (rtems_bsdnet_config.log_host)
- rtems_bsdnet_log_host_address.s_addr =
- inet_addr (rtems_bsdnet_config.log_host);
- for (i = 0 ; i < sizeof rtems_bsdnet_config.name_server /
- sizeof rtems_bsdnet_config.name_server[0] ; i++) {
- if (!rtems_bsdnet_config.name_server[i])
- break;
- rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count++].s_addr
- = inet_addr (rtems_bsdnet_config.name_server[i]);
- }
-
- /*
- * Configure interfaces
- */
- s = socket (AF_INET, SOCK_DGRAM, 0);
- if (s < 0)
- rtems_panic ("Can't create initial socket: %s", strerror (errno));
- for (ifp = rtems_bsdnet_config.ifconfig ; ifp ; ifp = ifp->next) {
- if (ifp->ip_address == NULL)
- continue;
-
- /*
- * Get the interface flags
- */
- strcpy (ifreq.ifr_name, ifp->name);
- if (ioctl (s, SIOCGIFFLAGS, &ifreq) < 0)
- rtems_panic ("Can't get %s flags: %s", ifp->name, strerror (errno));
-
- /*
- * Bring interface up
- */
- ifreq.ifr_flags |= IFF_UP;
- if (ioctl (s, SIOCSIFFLAGS, &ifreq) < 0)
- rtems_panic ("Can't bring %s up: %s", ifp->name, strerror (errno));
-
- /*
- * Set interface netmask
- */
- memset (&netmask, '\0', sizeof netmask);
- netmask.sin_len = sizeof netmask;
- netmask.sin_family = AF_INET;
- netmask.sin_addr.s_addr = inet_addr (ifp->ip_netmask);
- memcpy (&ifreq.ifr_addr, &netmask, sizeof netmask);
- if (ioctl (s, SIOCSIFNETMASK, &ifreq) < 0)
- rtems_panic ("Can't set %s netmask: %s", ifp->name, strerror (errno));
-
- /*
- * Set interface address
- */
- memset (&address, '\0', sizeof address);
- address.sin_len = sizeof address;
- address.sin_family = AF_INET;
- address.sin_addr.s_addr = inet_addr (ifp->ip_address);
- memcpy (&ifreq.ifr_addr, &address, sizeof address);
- if (ioctl (s, SIOCSIFADDR, &ifreq) < 0)
- rtems_panic ("Can't set %s address: %s", ifp->name, strerror (errno));
-
- /*
- * Set interface broadcast address
- */
- memset (&broadcast, '\0', sizeof broadcast);
- broadcast.sin_len = sizeof broadcast;
- broadcast.sin_family = AF_INET;
- broadcast.sin_addr.s_addr = address.sin_addr.s_addr | ~netmask.sin_addr.s_addr;
- memcpy (&ifreq.ifr_broadaddr, &broadcast, sizeof broadcast);
- if (ioctl (s, SIOCSIFBRDADDR, &ifreq) < 0)
- rtems_panic ("Can't set %s broadcast address: %s", ifp->name, strerror (errno));
- }
-
- /*
- * We're done with the dummy socket
- */
- close (s);
-
- /*
- * Set default route
- */
- if (rtems_bsdnet_config.gateway) {
- address.sin_addr.s_addr = INADDR_ANY;
- netmask.sin_addr.s_addr = INADDR_ANY;
- memset (&gateway, '\0', sizeof gateway);
- gateway.sin_len = sizeof gateway;
- gateway.sin_family = AF_INET;
- gateway.sin_addr.s_addr = inet_addr (rtems_bsdnet_config.gateway);
- if (rtems_bsdnet_rtrequest (
- RTM_ADD,
- (struct sockaddr *)&address,
- (struct sockaddr *)&gateway,
- (struct sockaddr *)&netmask,
- (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL) < 0)
- rtems_panic ("Can't set default route: %s", strerror (errno));
- }
-}
-
-/*
- * Initialize the network
- */
-int
-rtems_bsdnet_initialize_network (void)
-{
- struct rtems_bsdnet_ifconfig *ifp;
-
- /*
- * Start network tasks.
- * Initialize BSD network data structures.
- */
- rtems_bsdnet_initialize ();
-
- /*
- * Attach interfaces
- */
- for (ifp = rtems_bsdnet_config.ifconfig ; ifp ; ifp = ifp->next) {
- rtems_bsdnet_semaphore_obtain ();
- (ifp->attach)(ifp);
- rtems_bsdnet_semaphore_release ();
- }
-
- /*
- * Bring up the network
- */
- rtems_bsdnet_setup ();
- if (rtems_bsdnet_config.bootp)
- (*rtems_bsdnet_config.bootp)();
- return 0;
-}
diff --git a/c/src/libnetworking/rtems/rtems_showicmpstat.c b/c/src/libnetworking/rtems/rtems_showicmpstat.c
deleted file mode 100644
index 1faea2512b..0000000000
--- a/c/src/libnetworking/rtems/rtems_showicmpstat.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/icmp_var.h>
-
-/*
- * Display ICMP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showicmpstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_icmp_stats (void)
-{
- int i;
- char cbuf[20];
-
- printf ("************ ICMP Statistics ************\n");
- showicmpstat ("Calls to icmp_error()", icmpstat.icps_error);
- showicmpstat ("Errors not sent -- old was icmp", icmpstat.icps_oldicmp);
- for (i = 0 ; i <= ICMP_MAXTYPE ; i++) {
- if (icmpstat.icps_outhist[i]) {
- sprintf (cbuf, "Type %d sent", i);
- showicmpstat (cbuf, icmpstat.icps_outhist[i]);
- }
- }
- showicmpstat ("icmp_code out of range", icmpstat.icps_badcode);
- showicmpstat ("packet < ICMP_MINLEN", icmpstat.icps_tooshort);
- showicmpstat ("bad checksum", icmpstat.icps_checksum);
- showicmpstat ("calculated bound mismatch", icmpstat.icps_badlen);
- showicmpstat ("number of responses", icmpstat.icps_reflect);
- showicmpstat ("b/mcast echo requests dropped", icmpstat.icps_bmcastecho);
- showicmpstat ("b/mcast tstamp requests dropped", icmpstat.icps_bmcasttstamp);
- for (i = 0 ; i <= ICMP_MAXTYPE ; i++) {
- if (icmpstat.icps_inhist[i]) {
- sprintf (cbuf, "Type %d received", i);
- showicmpstat (cbuf, icmpstat.icps_inhist[i]);
- }
- }
-
- printf ("\n");
-}
diff --git a/c/src/libnetworking/rtems/rtems_showifstat.c b/c/src/libnetworking/rtems/rtems_showifstat.c
deleted file mode 100644
index 9f9efc5ac2..0000000000
--- a/c/src/libnetworking/rtems/rtems_showifstat.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <netinet/in.h>
-
-/*
- * Display an address
- */
-static int
-showaddress (char *name, struct sockaddr *a)
-{
- struct sockaddr_in *sa;
-
- if (!a || (a->sa_family != AF_INET))
- return 0;
- printf ("%s:", name);
- sa = (struct sockaddr_in *)a;
- printf ("%-16s", inet_ntoa (sa->sin_addr));
- return 1;
-}
-
-/*
- * Display interface statistics
- */
-void
-rtems_bsdnet_show_if_stats (void)
-{
- struct ifnet *ifp;
- struct ifaddr *ifa;
- unsigned int bit, flags;
- int printed;
-
- printf ("************ INTERFACE STATISTICS ************\n");
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- printf ("***** %s%d *****\n", ifp->if_name, ifp->if_unit);
- for (ifa = ifp->if_addrlist ; ifa ; ifa = ifa->ifa_next) {
- printed = showaddress ("Address", ifa->ifa_addr);
- if (ifp->if_flags & IFF_BROADCAST)
- printed |= showaddress ("Broadcast Address", ifa->ifa_broadaddr);
- if (ifp->if_flags & IFF_POINTOPOINT)
- printed |= showaddress ("Destination Address", ifa->ifa_dstaddr);
- printed |= showaddress ("Net mask", ifa->ifa_netmask);
- if (printed)
- printf ("\n");
- }
-
- printf ("Flags:");
- for (bit = 1, flags = ifp->if_flags ; flags ; bit <<= 1) {
- char *cp;
- switch (flags & bit) {
- default: cp = NULL; break;
- case IFF_UP: cp = "Up"; break;
- case IFF_BROADCAST: cp = "Broadcast"; break;
- case IFF_DEBUG: cp = "Debug"; break;
- case IFF_LOOPBACK: cp = "Loopback"; break;
- case IFF_POINTOPOINT: cp = "Point-to-point"; break;
- case IFF_RUNNING: cp = "Running"; break;
- case IFF_NOARP: cp = "No-ARP"; break;
- case IFF_PROMISC: cp = "Promiscuous"; break;
- case IFF_ALLMULTI: cp = "All-multicast"; break;
- case IFF_OACTIVE: cp = "Active"; break;
- case IFF_SIMPLEX: cp = "Simplex"; break;
- case IFF_LINK0: cp = "Link0"; break;
- case IFF_LINK1: cp = "Link1"; break;
- case IFF_LINK2: cp = "Link2"; break;
- case IFF_MULTICAST: cp = "Multicast"; break;
- }
- if (cp) {
- flags &= ~bit;
- printf (" %s", cp);
- }
- }
- printf ("\n");
-
- printf ("Send queue limit:%-4d length:%-4d Dropped:%-8d\n",
- ifp->if_snd.ifq_maxlen,
- ifp->if_snd.ifq_len,
- ifp->if_snd.ifq_drops);
-
- /*
- * FIXME: Could print if_data statistics here,
- * but right now the drivers maintain their
- * own statistics.
- */
-
- /*
- * Grab the network semaphore.
- * In most cases this is not necessary, but it's
- * easier to always call the driver ioctl function
- * while holding the semaphore than to try
- * and explain why some ioctl commands are invoked
- * while holding the semaphore and others are
- * invoked while not holding the semaphore.
- */
- rtems_bsdnet_semaphore_obtain ();
- (*ifp->if_ioctl)(ifp, SIO_RTEMS_SHOW_STATS, NULL);
- rtems_bsdnet_semaphore_release ();
- }
- printf ("\n");
-}
diff --git a/c/src/libnetworking/rtems/rtems_showipstat.c b/c/src/libnetworking/rtems/rtems_showipstat.c
deleted file mode 100644
index 2dd499a8c0..0000000000
--- a/c/src/libnetworking/rtems/rtems_showipstat.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-
-/*
- * Display IP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showipstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_ip_stats (void)
-{
- printf ("************ IP Statistics ************\n");
- showipstat ("total packets received", ipstat.ips_total);
- showipstat ("checksum bad", ipstat.ips_badsum);
- showipstat ("packet too short", ipstat.ips_tooshort);
- showipstat ("not enough data", ipstat.ips_toosmall);
- showipstat ("ip header length < data size", ipstat.ips_badhlen);
- showipstat ("ip length < ip header length", ipstat.ips_badlen);
- showipstat ("fragments received", ipstat.ips_fragments);
- showipstat ("frags dropped (dups, out of space)", ipstat.ips_fragdropped);
- showipstat ("fragments timed out", ipstat.ips_fragtimeout);
- showipstat ("packets forwarded", ipstat.ips_forward);
- showipstat ("packets rcvd for unreachable dest", ipstat.ips_cantforward);
- showipstat ("packets forwarded on same net", ipstat.ips_redirectsent);
- showipstat ("unknown or unsupported protocol", ipstat.ips_noproto);
- showipstat ("datagrams delivered to upper level", ipstat.ips_delivered);
- showipstat ("total ip packets generated here", ipstat.ips_localout);
- showipstat ("lost packets due to nobufs, etc.", ipstat.ips_odropped);
- showipstat ("total packets reassembled ok", ipstat.ips_reassembled);
- showipstat ("datagrams successfully fragmented", ipstat.ips_fragmented);
- showipstat ("output fragments created", ipstat.ips_ofragments);
- showipstat ("don't fragment flag was set, etc.", ipstat.ips_cantfrag);
- showipstat ("error in option processing", ipstat.ips_badoptions);
- showipstat ("packets discarded due to no route", ipstat.ips_noroute);
- showipstat ("ip version != 4", ipstat.ips_badvers);
- showipstat ("total raw ip packets generated", ipstat.ips_rawout);
- showipstat ("ip length > max ip packet size", ipstat.ips_toolong);
- printf ("\n");
-}
diff --git a/c/src/libnetworking/rtems/rtems_showmbuf.c b/c/src/libnetworking/rtems/rtems_showmbuf.c
deleted file mode 100644
index 39523bd00a..0000000000
--- a/c/src/libnetworking/rtems/rtems_showmbuf.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-
-/*
- * Display MBUF statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-void
-rtems_bsdnet_show_mbuf_stats (void)
-{
- int i;
- int printed = 0;
- char *cp;
-
- printf ("************ MBUF STATISTICS ************\n");
- printf ("mbufs:%4lu clusters:%4lu free:%4lu\n",
- mbstat.m_mbufs, mbstat.m_clusters, mbstat.m_clfree);
- printf ("drops:%4lu waits:%4lu drains:%4lu\n",
- mbstat.m_drops, mbstat.m_wait, mbstat.m_drain);
- for (i = 0 ; i < 20 ; i++) {
- switch (i) {
- case MT_FREE: cp = "free"; break;
- case MT_DATA: cp = "data"; break;
- case MT_HEADER: cp = "header"; break;
- case MT_SOCKET: cp = "socket"; break;
- case MT_PCB: cp = "pcb"; break;
- case MT_RTABLE: cp = "rtable"; break;
- case MT_HTABLE: cp = "htable"; break;
- case MT_ATABLE: cp = "atable"; break;
- case MT_SONAME: cp = "soname"; break;
- case MT_SOOPTS: cp = "soopts"; break;
- case MT_FTABLE: cp = "ftable"; break;
- case MT_RIGHTS: cp = "rights"; break;
- case MT_IFADDR: cp = "ifaddr"; break;
- case MT_CONTROL: cp = "control"; break;
- case MT_OOBDATA: cp = "oobdata"; break;
- default: cp = NULL; break;
- }
- if ((cp != NULL) || (mbstat.m_mtypes[i] != 0)) {
- char cbuf[16];
- if (cp == NULL) {
- sprintf (cbuf, "Type %d", i);
- cp = cbuf;
- }
- printf ("%10s:%-8u", cp, mbstat.m_mtypes[i]);
- if (++printed == 4) {
- printf ("\n");
- printed = 0;
- }
- }
- }
- if (printed)
- printf ("\n");
- printf ("\n");
-}
diff --git a/c/src/libnetworking/rtems/rtems_showroute.c b/c/src/libnetworking/rtems/rtems_showroute.c
deleted file mode 100644
index b8196de8d3..0000000000
--- a/c/src/libnetworking/rtems/rtems_showroute.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * $Id$
- */
-
-#include <stdlib.h>
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-
-#include <arpa/inet.h>
-
-/*
- * We'll use the application versions of malloc and free.
- */
-#undef malloc
-#undef free
-
-/*
- * Information per route
- */
-struct rinfo {
- struct sockaddr dst;
- union {
- struct sockaddr sa;
- struct sockaddr_in sin;
- struct sockaddr_dl sdl;
- } un;
- unsigned long pksent;
- unsigned long expire;
- int flags;
- char ifname[16];
- short ifunit;
- short refcnt;
-};
-
-/*
- * Information per display
- */
-struct dinfo {
- int capacity;
- int count;
- struct rinfo *routes;
-};
-
-/*
- * Copy address
- */
-static void
-copyAddress (void *to, void *from, int tolen)
-{
- int ncopy;
- struct sockaddr dummy;
-
- if (from == NULL) {
- /*
- * Create a fake address of unspecified type
- */
- from = &dummy;
- dummy.sa_len = 4;
- dummy.sa_family = AF_UNSPEC;
- }
- ncopy = ((struct sockaddr *)from)->sa_len;
- if (ncopy > tolen)
- ncopy = tolen;
- memcpy (to, from, ncopy);
-}
-
-/*
- * Package everything up before printing it.
- * We don't want to block all network operations till
- * the printing completes!
- */
-static int
-show_inet_route (rn, vw)
- struct radix_node *rn;
- void *vw;
-{
- struct rtentry *rt = (struct rtentry *)rn;
- struct ifnet *ifp;
- struct dinfo *dp = (struct dinfo *)vw;
- struct rinfo *r;
-
- /*
- * Get a pointer to a new route info structure
- */
- if (dp->count >= dp->capacity) {
- r = realloc (dp->routes, (sizeof *r) * (dp->capacity + 20));
- if (r == 0)
- return ENOMEM;
- dp->capacity += 20;
- dp->routes = r;
- }
- r = dp->routes + dp->count++;
-
- /*
- * Fill in the route info structure
- */
- copyAddress (&r->dst, rt_key(rt), sizeof r->dst);
- if (rt->rt_flags & (RTF_GATEWAY | RTF_HOST)) {
- copyAddress (&r->un, rt->rt_gateway, sizeof r->un);
- }
- else {
- /*
- * Create a fake address to hold the mask
- */
- struct sockaddr_in dummy;
-
- dummy.sin_family = AF_INET;
- dummy.sin_len = sizeof dummy;
- dummy.sin_addr = ((struct sockaddr_in *)rt_mask(rt))->sin_addr;
- copyAddress (&r->un, &dummy, sizeof r->un);
- }
- r->flags = rt->rt_flags;
- r->refcnt = rt->rt_refcnt;
- r->pksent = rt->rt_rmx.rmx_pksent;
- r->expire = rt->rt_rmx.rmx_expire;
- ifp = rt->rt_ifp;
- strncpy (r->ifname, ifp->if_name, sizeof r->ifname);
- r->ifunit = ifp->if_unit;
- return 0;
-}
-
-/*
- * Convert link address to ASCII
- */
-static char *
-link_ascii (struct sockaddr_dl *sdl, char *buf, int bufsize)
-{
- char *cp;
- int i;
- int first = 1;
- int nleft = sdl->sdl_alen;
- unsigned char *ap = LLADDR (sdl);
- static const char hextab[16] = "0123456789ABCDEF";
-
- cp = buf;
- while (nleft && (bufsize > 4)) {
- if (first) {
- first = 0;
- }
- else {
- *cp++ = ':';
- bufsize--;
- }
- i = *ap++;
- *cp++ = hextab[(i >> 4) & 0xf];
- *cp++ = hextab[i & 0xf];
- nleft--;
- bufsize -= 2;
- }
- *cp = '\0';
- return buf;
-}
-
-void
-rtems_bsdnet_show_inet_routes (void)
-{
- struct radix_node_head *rnh;
- struct dinfo d;
- struct rinfo *r;
- int i, error;
-
- /*
- * For now we'll handle only AF_INET
- */
- rnh = rt_tables[AF_INET];
- if (!rnh)
- return;
- d.count = d.capacity = 0;
- d.routes = NULL;
- rtems_bsdnet_semaphore_obtain ();
- error = rnh->rnh_walktree(rnh, show_inet_route, &d);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- printf ("Can't get route info: %s\n", strerror (error));
- return;
- }
- if (d.count == 0) {
- printf ("No routes!\n");
- return;
- }
- printf ("Destination Gateway/Mask/Hw Flags Refs Use Expire Interface\n");
- for (i = 0, r = d.routes ; i < d.count ; i++, r++) {
- char buf[30];
- char *cp, *fc, flagbuf[10];
- const char *addr;
- unsigned long flagbit;
- struct sockaddr_in *sin;
-
- sin = (struct sockaddr_in *)&r->dst;
- if (sin->sin_addr.s_addr == INADDR_ANY)
- addr = "default";
- else
- addr = inet_ntop (AF_INET, &sin->sin_addr, buf, sizeof buf);
- printf ("%-16s", addr);
- switch (r->un.sa.sa_family) {
- case AF_INET:
- addr = inet_ntop (AF_INET, &r->un.sin.sin_addr, buf, sizeof buf);
- break;
-
- case AF_LINK:
- addr = link_ascii (&r->un.sdl, buf, sizeof buf);
- break;
-
- default:
- addr = "";
- break;
- }
- printf ("%-19s", addr);
- fc = "UGHRDM XLS";
- for (flagbit = 0x1, cp = flagbuf ; *fc ; flagbit <<= 1, fc++) {
- if ((r->flags & flagbit) && (*fc != ' '))
- *cp++ = *fc;
- }
- *cp = '\0';
- printf ("%-10s%3d%9ld%7ld %.*s%d\n", flagbuf,
- r->refcnt, r->pksent,
- r->expire,
- (int)sizeof r->ifname, r->ifname,
- r->ifunit);
- }
- free (d.routes);
-}
diff --git a/c/src/libnetworking/rtems/rtems_showtcpstat.c b/c/src/libnetworking/rtems/rtems_showtcpstat.c
deleted file mode 100644
index b9a0366819..0000000000
--- a/c/src/libnetworking/rtems/rtems_showtcpstat.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_var.h>
-
-/*
- * Display TCP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showtcpstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_tcp_stats (void)
-{
- printf ("************ TCP Statistics ************\n");
- showtcpstat ("connections initiated", tcpstat.tcps_connattempt);
- showtcpstat ("connections accepted", tcpstat.tcps_accepts);
- showtcpstat ("connections established", tcpstat.tcps_connects);
- showtcpstat ("connections dropped", tcpstat.tcps_drops);
- showtcpstat ("embryonic connections dropped", tcpstat.tcps_conndrops);
- showtcpstat ("conn. closed (includes drops)", tcpstat.tcps_closed);
- showtcpstat ("segs where we tried to get rtt", tcpstat.tcps_segstimed);
- showtcpstat ("times we succeeded", tcpstat.tcps_rttupdated);
- showtcpstat ("delayed acks sent", tcpstat.tcps_delack);
- showtcpstat ("conn. dropped in rxmt timeout", tcpstat.tcps_timeoutdrop);
- showtcpstat ("retransmit timeouts", tcpstat.tcps_rexmttimeo);
- showtcpstat ("persist timeouts", tcpstat.tcps_persisttimeo);
- showtcpstat ("keepalive timeouts", tcpstat.tcps_keeptimeo);
- showtcpstat ("keepalive probes sent", tcpstat.tcps_keepprobe);
- showtcpstat ("connections dropped in keepalive", tcpstat.tcps_keepdrops);
-
- showtcpstat ("total packets sent", tcpstat.tcps_sndtotal);
- showtcpstat ("data packets sent", tcpstat.tcps_sndpack);
- showtcpstat ("data bytes sent", tcpstat.tcps_sndbyte);
- showtcpstat ("data packets retransmitted", tcpstat.tcps_sndrexmitpack);
- showtcpstat ("data bytes retransmitted", tcpstat.tcps_sndrexmitbyte);
- showtcpstat ("ack-only packets sent", tcpstat.tcps_sndacks);
- showtcpstat ("window probes sent", tcpstat.tcps_sndprobe);
- showtcpstat ("packets sent with URG only", tcpstat.tcps_sndurg);
- showtcpstat ("window update-only packets sent", tcpstat.tcps_sndwinup);
- showtcpstat ("control (SYN|FIN|RST) packets sent", tcpstat.tcps_sndctrl);
-
- showtcpstat ("total packets received", tcpstat.tcps_rcvtotal);
- showtcpstat ("packets received in sequence", tcpstat.tcps_rcvpack);
- showtcpstat ("bytes received in sequence", tcpstat.tcps_rcvbyte);
- showtcpstat ("packets received with ccksum errs", tcpstat.tcps_rcvbadsum);
- showtcpstat ("packets received with bad offset", tcpstat.tcps_rcvbadoff);
- showtcpstat ("packets received too short", tcpstat.tcps_rcvshort);
- showtcpstat ("duplicate-only packets received", tcpstat.tcps_rcvduppack);
- showtcpstat ("duplicate-only bytes received", tcpstat.tcps_rcvdupbyte);
- showtcpstat ("packets with some duplicate data", tcpstat.tcps_rcvpartduppack);
- showtcpstat ("dup. bytes in part-dup. packets", tcpstat.tcps_rcvpartdupbyte);
- showtcpstat ("out-of-order packets received", tcpstat.tcps_rcvoopack);
- showtcpstat ("out-of-order bytes received", tcpstat.tcps_rcvoobyte);
- showtcpstat ("packets with data after window", tcpstat.tcps_rcvpackafterwin);
- showtcpstat ("bytes rcvd after window", tcpstat.tcps_rcvbyteafterwin);
- showtcpstat ("packets rcvd after \"close\"", tcpstat.tcps_rcvafterclose);
- showtcpstat ("rcvd window probe packets", tcpstat.tcps_rcvwinprobe);
- showtcpstat ("rcvd duplicate acks", tcpstat.tcps_rcvdupack);
- showtcpstat ("rcvd acks for unsent data", tcpstat.tcps_rcvacktoomuch);
- showtcpstat ("rcvd ack packets", tcpstat.tcps_rcvackpack);
- showtcpstat ("bytes acked by rcvd acks", tcpstat.tcps_rcvackbyte);
- showtcpstat ("rcvd window update packets", tcpstat.tcps_rcvwinupd);
- showtcpstat ("segments dropped due to PAWS", tcpstat.tcps_pawsdrop);
- showtcpstat ("times hdr predict ok for acks", tcpstat.tcps_predack);
- showtcpstat ("times hdr predict ok for data pkts", tcpstat.tcps_preddat);
- showtcpstat ("pcb cache misses", tcpstat.tcps_pcbcachemiss);
- showtcpstat ("times cached RTT in route updated", tcpstat.tcps_cachedrtt);
- showtcpstat ("times cached rttvar updated", tcpstat.tcps_cachedrttvar);
- showtcpstat ("times cached ssthresh updated", tcpstat.tcps_cachedssthresh);
- showtcpstat ("times RTT initialized from route", tcpstat.tcps_usedrtt);
- showtcpstat ("times RTTVAR initialized from rt", tcpstat.tcps_usedrttvar);
- showtcpstat ("times ssthresh initialized from rt", tcpstat.tcps_usedssthresh);
- showtcpstat ("timeout in persist state", tcpstat.tcps_persistdrop);
- showtcpstat ("bogus SYN, e.g. premature ACK", tcpstat.tcps_badsyn);
- showtcpstat ("resends due to MTU discovery", tcpstat.tcps_mturesent);
- showtcpstat ("listen queue overflows", tcpstat.tcps_listendrop);
- printf ("\n");
-}
diff --git a/c/src/libnetworking/rtems/rtems_showudpstat.c b/c/src/libnetworking/rtems/rtems_showudpstat.c
deleted file mode 100644
index 1fc2d15a0b..0000000000
--- a/c/src/libnetworking/rtems/rtems_showudpstat.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-
-/*
- * Display UDP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showudpstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_udp_stats (void)
-{
- printf ("************ UDP Statistics ************\n");
- showudpstat ("total input packets", udpstat.udps_ipackets);
- showudpstat ("packet shorter than header", udpstat.udps_hdrops);
- showudpstat ("checksum error", udpstat.udps_badsum);
- showudpstat ("data length larger than packet", udpstat.udps_badlen);
- showudpstat ("no socket on port", udpstat.udps_noport);
- showudpstat ("of above, arrived as broadcast", udpstat.udps_noportbcast);
- showudpstat ("not delivered, input socket full", udpstat.udps_fullsock);
- showudpstat ("input packets missing pcb cache", udpstat.udpps_pcbcachemiss);
- showudpstat ("input packets not for hashed pcb", udpstat.udpps_pcbhashmiss);
- showudpstat ("total output packets", udpstat.udps_opackets);
- printf ("\n");
-}
diff --git a/c/src/libnetworking/rtems/rtems_syscall.c b/c/src/libnetworking/rtems/rtems_syscall.c
deleted file mode 100644
index 782a2f907b..0000000000
--- a/c/src/libnetworking/rtems/rtems_syscall.c
+++ /dev/null
@@ -1,761 +0,0 @@
-/*
- * $Id$
- */
-
-#include <string.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/error.h>
-#include <rtems/rtems_bsdnet.h>
-
-#include <sys/errno.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/proc.h>
-#include <sys/filio.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-/*
- *********************************************************************
- * Map RTEMS file descriptor to BSD socket *
- *********************************************************************
- */
-struct fdsock {
- int indexFreeNext;
- struct socket *sock;
-};
-static struct fdsock *fdsock;
-static int fdsockCount;
-static int indexFreeHead = -1;
-
-/*
- * Convert an RTEMS file descriptor to a BSD socket pointer.
- */
-static struct socket *
-fdToSocket (int fd)
-{
- int i;
- struct socket *s;
-
- if ((fd < 0)
- || (rtems_file_descriptor_type(fd) != RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET)
- || ((i = rtems_file_descriptor_base(fd)) >= fdsockCount)
- || ((s = fdsock[i].sock) == NULL)) {
- errno = EBADF;
- return NULL;
- }
- return s;
-}
-
-/*
- * Enlarge the size of the file-descritor/socket pointer map.
- */
-static int
-enlargeFdMap (void)
-{
- struct fdsock *nfdsock;
- int i;
-
- nfdsock = realloc (fdsock, sizeof *fdsock * (fdsockCount + 20));
- if (nfdsock == NULL) {
- errno = ENFILE;
- return 0;
- }
- fdsock = nfdsock;
- for (i = fdsockCount, fdsockCount += 20 ; i < fdsockCount ; i++) {
- fdsock[i].sock = NULL;
- fdsock[i].indexFreeNext = indexFreeHead;
- indexFreeHead = i;
- }
- return 1;
-}
-
-/*
- * Create a file descriptor for a new socket
- */
-static int
-makeFd (struct socket *s)
-{
- int i;
-
- if ((indexFreeHead < 0) && !enlargeFdMap ())
- return -1;
- i = indexFreeHead;
- indexFreeHead = fdsock[i].indexFreeNext;
- fdsock[i].sock = s;
- return rtems_make_file_descriptor(i,RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET);
-}
-
-/*
- * Package system call argument into mbuf.
- */
-static int
-sockargstombuf (struct mbuf **mp, const void *buf, int buflen, int type)
-{
- struct mbuf *m;
-
- if ((u_int)buflen > MLEN)
- return (EINVAL);
- m = m_get(M_WAIT, type);
- if (m == NULL)
- return (ENOBUFS);
- m->m_len = buflen;
- memcpy (mtod(m, caddr_t), buf, buflen);
- *mp = m;
- if (type == MT_SONAME) {
- struct sockaddr *sa;
- sa = mtod(m, struct sockaddr *);
- sa->sa_len = buflen;
- }
- return 0;
-}
-
-/*
- *********************************************************************
- * BSD-style entry points *
- *********************************************************************
- */
-int
-socket (int domain, int type, int protocol)
-{
- int fd = -1;
- int error;
- struct socket *so;
-
- rtems_bsdnet_semaphore_obtain ();
- error = socreate(domain, &so, type, protocol, NULL);
- if (error == 0) {
- fd = makeFd (so);
- if (fd < 0)
- soclose (so);
- }
- else {
- errno = error;
- fd = -1;
- }
- rtems_bsdnet_semaphore_release ();
- return fd;
-}
-
-int
-bind (int s, struct sockaddr *name, int namelen)
-{
- int error;
- int ret = -1;
- struct socket *so;
- struct mbuf *nam;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) != NULL) {
- error = sockargstombuf (&nam, name, namelen, MT_SONAME);
- if (error == 0) {
- error = sobind (so, nam);
- if (error == 0)
- ret = 0;
- else
- errno = error;
- m_freem (nam);
- }
- else {
- errno = error;
- }
- }
- rtems_bsdnet_semaphore_release ();
- return ret;
-}
-
-int
-connect (int s, struct sockaddr *name, int namelen)
-{
- int error;
- int ret = -1;
- struct socket *so;
- struct mbuf *nam;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((so->so_state & SS_NBIO) && (so->so_state & SS_ISCONNECTING)) {
- errno = EALREADY;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- error = sockargstombuf (&nam, name, namelen, MT_SONAME);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- error = soconnect (so, nam);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((so->so_state & SS_NBIO) && (so->so_state & SS_ISCONNECTING)) {
- m_freem(nam);
- errno = EINPROGRESS;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) {
- soconnsleep (so);
- }
- if (error == 0) {
- error = so->so_error;
- so->so_error = 0;
- }
- so->so_state &= ~SS_ISCONNECTING;
- m_freem (nam);
- if (error == 0)
- ret = 0;
- rtems_bsdnet_semaphore_release ();
- return ret;
-}
-
-int
-listen (int s, int backlog)
-{
- int error;
- int ret = -1;
- struct socket *so;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) != NULL) {
- error = solisten (so, backlog);
- if (error == 0)
- ret = 0;
- else
- errno = error;
- }
- rtems_bsdnet_semaphore_release ();
- return ret;
-}
-
-int
-accept (int s, struct sockaddr *name, int *namelen)
-{
- int fd;
- struct socket *head, *so;
- struct mbuf *nam;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((head = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((head->so_options & SO_ACCEPTCONN) == 0) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((head->so_state & SS_NBIO) && head->so_comp.tqh_first == NULL) {
- errno = EWOULDBLOCK;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- while (head->so_comp.tqh_first == NULL && head->so_error == 0) {
- if (head->so_state & SS_CANTRCVMORE) {
- head->so_error = ECONNABORTED;
- break;
- }
- soconnsleep (head);
- }
- if (head->so_error) {
- errno = head->so_error;
- head->so_error = 0;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
-
- so = head->so_comp.tqh_first;
- TAILQ_REMOVE(&head->so_comp, so, so_list);
- head->so_qlen--;
-
- fd = makeFd (so);
- if (fd < 0) {
- TAILQ_INSERT_HEAD(&head->so_comp, so, so_list);
- head->so_qlen++;
- soconnwakeup (head);
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- so->so_state &= ~SS_COMP;
- so->so_head = NULL;
-
- nam = m_get(M_WAIT, MT_SONAME);
- (void) soaccept(so, nam);
- if (name) {
- /* check length before it is destroyed */
- if (*namelen > nam->m_len)
- *namelen = nam->m_len;
- memcpy (name, mtod(nam, caddr_t), *namelen);
- }
- m_freem(nam);
- rtems_bsdnet_semaphore_release ();
- return (fd);
-
-}
-
-/*
- * All `transmit' operations end up calling this routine.
- */
-ssize_t
-sendmsg (int s, const struct msghdr *mp, int flags)
-{
- int ret = -1;
- int error;
- struct uio auio;
- struct iovec *iov;
- struct socket *so;
- struct mbuf *to, *control;
- int i;
- int len;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- auio.uio_iov = mp->msg_iov;
- auio.uio_iovcnt = mp->msg_iovlen;
- auio.uio_segflg = UIO_USERSPACE;
- auio.uio_rw = UIO_WRITE;
- auio.uio_offset = 0;
- auio.uio_resid = 0;
- iov = mp->msg_iov;
- for (i = 0; i < mp->msg_iovlen; i++, iov++) {
- if ((auio.uio_resid += iov->iov_len) < 0) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- if (mp->msg_name) {
- error = sockargstombuf (&to, mp->msg_name, mp->msg_namelen, MT_SONAME);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- else {
- to = NULL;
- }
- if (mp->msg_control) {
- if (mp->msg_controllen < sizeof (struct cmsghdr)) {
- errno = EINVAL;
- if (to)
- m_freem(to);
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- sockargstombuf (&control, mp->msg_control, mp->msg_controllen, MT_CONTROL);
- }
- else {
- control = NULL;
- }
- len = auio.uio_resid;
- error = sosend (so, to, &auio, (struct mbuf *)0, control, flags);
- if (error) {
- if (auio.uio_resid != len && (error == EINTR || error == EWOULDBLOCK))
- error = 0;
- }
- if (error)
- errno = error;
- else
- ret = len - auio.uio_resid;
- if (to)
- m_freem(to);
- rtems_bsdnet_semaphore_release ();
- return (ret);
-}
-
-/*
- * Send a message to a host
- */
-ssize_t
-sendto (int s, const void *buf, size_t buflen, int flags, const struct sockaddr *to, int tolen)
-{
- struct msghdr msg;
- struct iovec iov;
-
- iov.iov_base = (void *)buf;
- iov.iov_len = buflen;
- msg.msg_name = (caddr_t)to;
- msg.msg_namelen = tolen;
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
- msg.msg_control = NULL;
- msg.msg_controllen = 0;
- return sendmsg (s, &msg, flags);
-}
-
-/*
- * Send a message to a connected host
- */
-ssize_t
-send (int s, const void *buf, size_t buflen, int flags)
-{
- return sendto (s, buf, buflen, flags, NULL, 0);
-}
-
-/*
- * All `receive' operations end up calling this routine.
- */
-ssize_t
-recvmsg (int s, struct msghdr *mp, int flags)
-{
- int ret = -1;
- int error;
- struct uio auio;
- struct iovec *iov;
- struct socket *so;
- struct mbuf *from = NULL, *control = NULL;
- int i;
- int len;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- auio.uio_iov = mp->msg_iov;
- auio.uio_iovcnt = mp->msg_iovlen;
- auio.uio_segflg = UIO_USERSPACE;
- auio.uio_rw = UIO_READ;
- auio.uio_offset = 0;
- auio.uio_resid = 0;
- iov = mp->msg_iov;
- for (i = 0; i < mp->msg_iovlen; i++, iov++) {
- if ((auio.uio_resid += iov->iov_len) < 0) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- len = auio.uio_resid;
- mp->msg_flags = flags;
- error = soreceive (so, &from, &auio, (struct mbuf **)NULL,
- mp->msg_control ? &control : (struct mbuf **)NULL,
- &mp->msg_flags);
- if (error) {
- if (auio.uio_resid != len && (error == EINTR || error == EWOULDBLOCK))
- error = 0;
- }
- if (error) {
- errno = error;
- }
- else {
- ret = len - auio.uio_resid;
- if (mp->msg_name) {
- len = mp->msg_namelen;
- if ((len <= 0) || (from == NULL)) {
- len = 0;
- }
- else {
- if (len > from->m_len)
- len = from->m_len;
- memcpy (mp->msg_name, mtod(from, caddr_t), len);
- }
- mp->msg_namelen = len;
- }
- if (mp->msg_control) {
- struct mbuf *m;
- caddr_t ctlbuf;
-
- len = mp->msg_controllen;
- m = control;
- mp->msg_controllen = 0;
- ctlbuf = (caddr_t) mp->msg_control;
-
- while (m && (len > 0)) {
- unsigned int tocopy;
-
- if (len >= m->m_len)
- tocopy = m->m_len;
- else {
- mp->msg_flags |= MSG_CTRUNC;
- tocopy = len;
- }
- memcpy(ctlbuf, mtod(m, caddr_t), tocopy);
- ctlbuf += tocopy;
- len -= tocopy;
- m = m->m_next;
- }
- mp->msg_controllen = ctlbuf - mp->msg_control;
- }
- }
- if (from)
- m_freem (from);
- if (control)
- m_freem (control);
- rtems_bsdnet_semaphore_release ();
- return (ret);
-}
-
-/*
- * Receive a message from a host
- */
-ssize_t
-recvfrom (int s, void *buf, size_t buflen, int flags, const struct sockaddr *from, int *fromlen)
-{
- struct msghdr msg;
- struct iovec iov;
- int ret;
-
- iov.iov_base = buf;
- iov.iov_len = buflen;
- msg.msg_name = (caddr_t)from;
- msg.msg_namelen = *fromlen;
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
- msg.msg_control = NULL;
- msg.msg_controllen = 0;
- ret = recvmsg (s, &msg, flags);
- if ((from != NULL) && (fromlen != NULL) && (ret >= 0))
- *fromlen = msg.msg_namelen;
- return ret;
-}
-
-/*
- * Receive a message from a connected host
- */
-ssize_t
-recv (int s, void *buf, size_t buflen, int flags)
-{
- return recvfrom (s, buf, buflen, flags, NULL, NULL);
-}
-
-int
-setsockopt (int s, int level, int name, const void *val, int len)
-{
- struct socket *so;
- struct mbuf *m = NULL;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (len > MLEN) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (val) {
- error = sockargstombuf (&m, val, len, MT_SOOPTS);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- error = sosetopt(so, level, name, m);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- rtems_bsdnet_semaphore_release ();
- return 0;
-}
-
-int
-getsockopt (int s, int level, int name, void *aval, int *avalsize)
-{
- struct socket *so;
- struct mbuf *m = NULL, *m0;
- char *val = aval;
- int i, op, valsize;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (val)
- valsize = *avalsize;
- else
- valsize = 0;
- if (((error = sogetopt(so, level, name, &m)) == 0) && val && valsize && m) {
- op = 0;
- while (m && op < valsize) {
- i = valsize - op;
- if (i > m->m_len)
- i = m->m_len;
- memcpy (val, mtod(m, caddr_t), i);
- op += i;
- val += i;
- m0 = m;
- MFREE (m0, m);
- }
- *avalsize = op;
- }
- if (m != NULL)
- (void) m_free(m);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- rtems_bsdnet_semaphore_release ();
- return 0;
-}
-
-static int
-getpeersockname (int s, struct sockaddr *name, int *namelen, int pflag)
-{
- struct socket *so;
- struct mbuf *m;
- int len = *namelen;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- m = m_getclr(M_WAIT, MT_SONAME);
- if (m == NULL) {
- errno = ENOBUFS;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (pflag)
- error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, m);
- else
- error = (*so->so_proto->pr_usrreqs->pru_sockaddr)(so, m);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (len > m->m_len) {
- len = m->m_len;
- *namelen = len;
- }
- memcpy (name, mtod(m, caddr_t), len);
- m_freem (m);
- rtems_bsdnet_semaphore_release ();
- return 0;
-}
-
-int
-getpeername (int s, struct sockaddr *name, int *namelen)
-{
- return getpeersockname (s, name, namelen, 1);
-}
-int
-getsockname (int s, struct sockaddr *name, int *namelen)
-{
- return getpeersockname (s, name, namelen, 0);
-}
-
-/*
- ************************************************************************
- * RTEMS EXTERNAL I/O HANDLER ROUTINES *
- ************************************************************************
- */
-static int
-rtems_bsdnet_close (int fd)
-{
- struct socket *so;
- int error;
- int i;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (fd)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- i = rtems_file_descriptor_base(fd);
- fdsock[i].indexFreeNext = indexFreeHead;;
- indexFreeHead = i;
- error = soclose (so);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- errno = error;
- return -1;
- }
- return 0;
-}
-
-static int
-rtems_bsdnet_read (int fd, void *buffer, unsigned32 count)
-{
- return recv (fd, buffer, count, 0);
-}
-
-static int
-rtems_bsdnet_write (int fd, const void *buffer, unsigned32 count)
-{
- return send (fd, buffer, count, 0);
-}
-
-static int
-so_ioctl (struct socket *so, unsigned32 command, void *buffer)
-{
- switch (command) {
- case FIONBIO:
- if (*(int *)buffer)
- so->so_state |= SS_NBIO;
- else
- so->so_state &= ~SS_NBIO;
- return 0;
-
- case FIONREAD:
- *(int *)buffer = so->so_rcv.sb_cc;
- return 0;
- }
-
- if (IOCGROUP(command) == 'i')
- return ifioctl (so, command, buffer, NULL);
- if (IOCGROUP(command) == 'r')
- return rtioctl (command, buffer, NULL);
- return (*so->so_proto->pr_usrreqs->pru_control)(so, command, buffer, 0);
-}
-
-static int
-rtems_bsdnet_ioctl (int fd, unsigned32 command, void *buffer)
-{
- struct socket *so;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (fd)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- error = so_ioctl (so, command, buffer);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- errno = error;
- return -1;
- }
- return 0;
-}
-
-rtems_libio_handler_t rtems_bsdnet_io_handler = {
- NULL, /* open */
- rtems_bsdnet_close, /* close */
- rtems_bsdnet_read, /* read */
- rtems_bsdnet_write, /* write */
- rtems_bsdnet_ioctl, /* ioctl */
- NULL, /* lseek */
-};
-
diff --git a/c/src/libnetworking/rtems/sghostname.c b/c/src/libnetworking/rtems/sghostname.c
deleted file mode 100644
index 36894caa86..0000000000
--- a/c/src/libnetworking/rtems/sghostname.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * RTEMS versions of hostname functions
- * FIXME: Not thread-safe
- *
- * $Id$
- */
-
-#include <string.h>
-#include <errno.h>
-#include <rtems/rtems_bsdnet.h>
-#include <sys/param.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-
-static char *rtems_hostname;
-
-int
-gethostname (char *name, int namelen)
-{
- char *cp = rtems_hostname;
-
- if (cp == NULL)
- cp = "";
- strncpy (name, cp, namelen);
- return 0;
-}
-
-int
-sethostname (char *name, int namelen)
-{
- char *old, *new;
-
- if (namelen >= MAXHOSTNAMELEN) {
- errno = EINVAL;
- return -1;
- }
- new = malloc (namelen + 1, M_HTABLE, M_NOWAIT);
- if (new == NULL) {
- errno = ENOMEM;
- return -1;
- }
- strncpy (new, name, namelen);
- new[namelen] = '\0';
- old = rtems_hostname;
- rtems_hostname = new;
- if (old)
- free (old, M_HTABLE);
- return 0;
-}
diff --git a/c/src/libnetworking/rtems/tftp.h b/c/src/libnetworking/rtems/tftp.h
deleted file mode 100644
index d09782e22b..0000000000
--- a/c/src/libnetworking/rtems/tftp.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * $Id$
- */
-
-/*
- * Trivial File Transfer Protocol (TFTP)
- *
- * Transfer file to/from remote host
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- */
-
-/*
- * Usage:
- *
- * To open `/bootfiles/image' on `hostname' for reading:
- * fd = open ("/TFTP/hostname/bootfiles/image", O_RDONLY);
- *
- * The `hostname' must be four dot-separated decimal values.
- *
- * To open a file on the host which supplied the BOOTP
- * information just leave the `hostname' part empty:
- * fd = open ("/TFTP//bootfiles/image", O_RDONLY);
- *
- */
-
-#ifndef _TFTP_DRIVER_h
-#define _TFTP_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Driver entry points
- */
-#define TFTP_DRIVER_TABLE_ENTRY \
- { rtems_tftp_initialize, rtems_tftp_open, rtems_tftp_close, \
- rtems_tftp_read, rtems_tftp_write, rtems_tftp_control }
-
-rtems_device_driver rtems_tftp_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_open(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_close(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_read(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_write(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_control(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/libnetworking/sys/buf.h b/c/src/libnetworking/sys/buf.h
deleted file mode 100644
index 6cca571141..0000000000
--- a/c/src/libnetworking/sys/buf.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)buf.h 8.9 (Berkeley) 3/30/95
- * $Id$
- */
-
-#ifndef _SYS_BUF_H_
-#define _SYS_BUF_H_
-
-#include <sys/queue.h>
-
-#define NOLIST ((struct buf *)0x87654321)
-
-struct buf;
-
-struct iodone_chain {
- long ic_prev_flags;
- void (*ic_prev_iodone) __P((struct buf *));
- void *ic_prev_iodone_chain;
- struct {
- long ia_long;
- void *ia_ptr;
- } ic_args[5];
-};
-
-typedef TAILQ_HEAD(buf_queue_head, buf) buf_queue_head, *buf_queue_head_t;
-
-/*
- * The buffer header describes an I/O operation in the kernel.
- */
-struct buf {
- LIST_ENTRY(buf) b_hash; /* Hash chain. */
- LIST_ENTRY(buf) b_vnbufs; /* Buffer's associated vnode. */
- TAILQ_ENTRY(buf) b_freelist; /* Free list position if not active. */
- TAILQ_ENTRY(buf) b_act; /* Device driver queue when active. *new* */
- struct proc *b_proc; /* Associated proc; NULL if kernel. */
- long b_flags; /* B_* flags. */
- unsigned short b_qindex; /* buffer queue index */
- unsigned char b_usecount; /* buffer use count */
- int b_error; /* Errno value. */
- long b_bufsize; /* Allocated buffer size. */
- long b_bcount; /* Valid bytes in buffer. */
- long b_resid; /* Remaining I/O. */
- dev_t b_dev; /* Device associated with buffer. */
- struct {
- caddr_t b_addr; /* Memory, superblocks, indirect etc. */
- } b_un;
- caddr_t b_kvabase; /* base kva for buffer */
- int b_kvasize; /* size of kva for buffer */
- void *b_saveaddr; /* Original b_addr for physio. */
- daddr_t b_lblkno; /* Logical block number. */
- daddr_t b_blkno; /* Underlying physical block number. */
- /* Function to call upon completion. */
- void (*b_iodone) __P((struct buf *));
- /* For nested b_iodone's. */
- struct iodone_chain *b_iodone_chain;
- struct vnode *b_vp; /* Device vnode. */
- int b_dirtyoff; /* Offset in buffer of dirty region. */
- int b_dirtyend; /* Offset of end of dirty region. */
- struct ucred *b_rcred; /* Read credentials reference. */
- struct ucred *b_wcred; /* Write credentials reference. */
- int b_validoff; /* Offset in buffer of valid region. */
- int b_validend; /* Offset of end of valid region. */
- daddr_t b_pblkno; /* physical block number */
- caddr_t b_savekva; /* saved kva for transfer while bouncing */
- void *b_driver1; /* for private use by the driver */
- void *b_driver2; /* for private use by the driver */
- void *b_spc;
- union cluster_info {
- TAILQ_HEAD(cluster_list_head, buf) cluster_head;
- TAILQ_ENTRY(buf) cluster_entry;
- } b_cluster;
- struct vm_page *b_pages[btoc(MAXPHYS)];
- int b_npages;
-};
-
-/* Device driver compatibility definitions. */
-#define b_data b_un.b_addr /* b_un.b_addr is not changeable. */
-
-/*
- * These flags are kept in b_flags.
- */
-#define B_AGE 0x00000001 /* Move to age queue when I/O done. */
-#define B_NEEDCOMMIT 0x00000002 /* Append-write in progress. */
-#define B_ASYNC 0x00000004 /* Start I/O, do not wait. */
-#define B_BAD 0x00000008 /* Bad block revectoring in progress. */
-#define B_BUSY 0x00000010 /* I/O in progress. */
-#define B_CACHE 0x00000020 /* Bread found us in the cache. */
-#define B_CALL 0x00000040 /* Call b_iodone from biodone. */
-#define B_DELWRI 0x00000080 /* Delay I/O until buffer reused. */
-#define B_DIRTY 0x00000100 /* Dirty page to be pushed out async. */
-#define B_DONE 0x00000200 /* I/O completed. */
-#define B_EINTR 0x00000400 /* I/O was interrupted */
-#define B_ERROR 0x00000800 /* I/O error occurred. */
-#define B_GATHERED 0x00001000 /* LFS: already in a segment. */
-#define B_INVAL 0x00002000 /* Does not contain valid info. */
-#define B_LOCKED 0x00004000 /* Locked in core (not reusable). */
-#define B_NOCACHE 0x00008000 /* Do not cache block after use. */
-#define B_MALLOC 0x00010000 /* malloced b_data */
-#define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */
-#define B_PHYS 0x00040000 /* I/O to user memory. */
-#define B_RAW 0x00080000 /* Set by physio for raw transfers. */
-#define B_READ 0x00100000 /* Read buffer. */
-#define B_TAPE 0x00200000 /* Magnetic tape I/O. */
-#define B_RELBUF 0x00400000 /* Release VMIO buffer. */
-#define B_WANTED 0x00800000 /* Process wants this buffer. */
-#define B_WRITE 0x00000000 /* Write buffer (pseudo flag). */
-#define B_WRITEINPROG 0x01000000 /* Write in progress. */
-#define B_XXX 0x02000000 /* Debugging flag. */
-#define B_PAGING 0x04000000 /* volatile paging I/O -- bypass VMIO */
-#define B_ORDERED 0x08000000 /* Must guarantee I/O ordering */
-#define B_VMIO 0x20000000 /* VMIO flag */
-#define B_CLUSTER 0x40000000 /* pagein op, so swap() can count it */
-#define B_BOUNCE 0x80000000 /* bounce buffer flag */
-
-/*
- * number of buffer hash entries
- */
-#define BUFHSZ 512
-
-/*
- * buffer hash table calculation, originally by David Greenman
- */
-#define BUFHASH(vnp, bn) \
- (&bufhashtbl[(((unsigned long)(vnp) >> 7)+(int)(bn)) % BUFHSZ])
-
-/*
- * Definitions for the buffer free lists.
- */
-#define BUFFER_QUEUES 6 /* number of free buffer queues */
-
-extern LIST_HEAD(bufhashhdr, buf) bufhashtbl[BUFHSZ], invalhash;
-extern TAILQ_HEAD(bqueues, buf) bufqueues[BUFFER_QUEUES];
-
-#define QUEUE_NONE 0 /* on no queue */
-#define QUEUE_LOCKED 1 /* locked buffers */
-#define QUEUE_LRU 2 /* useful buffers */
-#define QUEUE_VMIO 3 /* VMIO buffers */
-#define QUEUE_AGE 4 /* not-useful buffers */
-#define QUEUE_EMPTY 5 /* empty buffer headers*/
-
-/*
- * Zero out the buffer's data area.
- */
-#define clrbuf(bp) { \
- bzero((bp)->b_data, (u_int)(bp)->b_bcount); \
- (bp)->b_resid = 0; \
-}
-
-/* Flags to low-level allocation routines. */
-#define B_CLRBUF 0x01 /* Request allocated buffer be cleared. */
-#define B_SYNC 0x02 /* Do all allocations synchronously. */
-
-#ifdef KERNEL
-extern int nbuf; /* The number of buffer headers */
-extern struct buf *buf; /* The buffer headers. */
-extern char *buffers; /* The buffer contents. */
-extern int bufpages; /* Number of memory pages in the buffer pool. */
-extern struct buf *swbuf; /* Swap I/O buffer headers. */
-extern int nswbuf; /* Number of swap I/O buffer headers. */
-extern TAILQ_HEAD(swqueue, buf) bswlist;
-
-void bufinit __P((void));
-void bremfree __P((struct buf *));
-int bread __P((struct vnode *, daddr_t, int,
- struct ucred *, struct buf **));
-int breadn __P((struct vnode *, daddr_t, int, daddr_t *, int *, int,
- struct ucred *, struct buf **));
-int bwrite __P((struct buf *));
-void bdwrite __P((struct buf *));
-void bawrite __P((struct buf *));
-int bowrite __P((struct buf *));
-void brelse __P((struct buf *));
-void bqrelse __P((struct buf *));
-int vfs_bio_awrite __P((struct buf *));
-struct buf * getpbuf __P((void));
-struct buf *incore __P((struct vnode *, daddr_t));
-struct buf *gbincore __P((struct vnode *, daddr_t));
-int inmem __P((struct vnode *, daddr_t));
-struct buf *getblk __P((struct vnode *, daddr_t, int, int, int));
-struct buf *geteblk __P((int));
-int allocbuf __P((struct buf *, int));
-int biowait __P((struct buf *));
-void biodone __P((struct buf *));
-
-void cluster_callback __P((struct buf *));
-int cluster_read __P((struct vnode *, u_quad_t, daddr_t, long,
- struct ucred *, struct buf **));
-int cluster_wbuild __P((struct vnode *, long, daddr_t, int));
-void cluster_write __P((struct buf *, u_quad_t));
-int physio __P((void (*)(struct buf *), struct buf *, dev_t,
- int, u_int (*)(struct buf *), struct uio *));
-u_int minphys __P((struct buf *));
-void vfs_bio_clrbuf __P((struct buf *));
-void vfs_busy_pages __P((struct buf *, int clear_modify));
-void vfs_unbusy_pages(struct buf *);
-void vwakeup __P((struct buf *));
-void vmapbuf __P((struct buf *));
-void vunmapbuf __P((struct buf *));
-void relpbuf __P((struct buf *));
-void brelvp __P((struct buf *));
-void bgetvp __P((struct vnode *, struct buf *));
-void pbgetvp __P((struct vnode *, struct buf *));
-void pbrelvp __P((struct buf *));
-void reassignbuf __P((struct buf *, struct vnode *));
-struct buf *trypbuf __P((void));
-void vm_bounce_alloc __P((struct buf *));
-void vm_bounce_free __P((struct buf *));
-vm_offset_t vm_bounce_kva_alloc __P((int));
-void vm_bounce_kva_alloc_free __P((vm_offset_t, int));
-#endif /* KERNEL */
-
-#endif /* !_SYS_BUF_H_ */
diff --git a/c/src/libnetworking/sys/callout.h b/c/src/libnetworking/sys/callout.h
deleted file mode 100644
index 5fec98f28b..0000000000
--- a/c/src/libnetworking/sys/callout.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)callout.h 8.2 (Berkeley) 1/21/94
- * $Id$
- */
-
-#ifndef _SYS_CALLOUT_H_
-#define _SYS_CALLOUT_H_
-
-struct callout {
- struct callout *c_next; /* next callout in queue */
- void *c_arg; /* function argument */
- void (*c_func) __P((void *)); /* function to call */
- int c_time; /* ticks to the event */
-};
-
-#ifdef KERNEL
-extern struct callout *callfree, *callout, calltodo;
-extern int ncallout;
-#endif
-
-#endif
diff --git a/c/src/libnetworking/sys/cdefs.h b/c/src/libnetworking/sys/cdefs.h
deleted file mode 100644
index d089dc5894..0000000000
--- a/c/src/libnetworking/sys/cdefs.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Berkeley Software Design, Inc.
- *
- * 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.
- *
- * @(#)cdefs.h 8.8 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _SYS_CDEFS_H_
-#define _SYS_CDEFS_H_
-
-#if defined(__cplusplus)
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS };
-#else
-#define __BEGIN_DECLS
-#define __END_DECLS
-#endif
-
-/*
- * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
- * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
- * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
- * in between its arguments. __CONCAT can also concatenate double-quoted
- * strings produced by the __STRING macro, but this only works with ANSI C.
- *
- * __XSTRING is like __STRING, but it expands any macros in its argument
- * first. It is only available with ANSI C.
- */
-#if defined(__STDC__) || defined(__cplusplus)
-#define __P(protos) protos /* full-blown ANSI C */
-#define __CONCAT1(x,y) x ## y
-#define __CONCAT(x,y) __CONCAT1(x,y)
-#define __STRING(x) #x /* stringify without expanding x */
-#define __XSTRING(x) __STRING(x) /* expand x, then stringify */
-
-#define __const const /* define reserved names to standard */
-#define __signed signed
-#define __volatile volatile
-#if defined(__cplusplus)
-#define __inline inline /* convert to C++ keyword */
-#else
-#ifndef __GNUC__
-#define __inline /* delete GCC keyword */
-#endif /* !__GNUC__ */
-#endif /* !__cplusplus */
-
-#else /* !(__STDC__ || __cplusplus) */
-#define __P(protos) () /* traditional C preprocessor */
-#define __CONCAT(x,y) x/**/y
-#define __STRING(x) "x"
-
-#ifndef __GNUC__
-#define __const /* delete pseudo-ANSI C keywords */
-#define __inline
-#define __signed
-#define __volatile
-/*
- * In non-ANSI C environments, new programs will want ANSI-only C keywords
- * deleted from the program and old programs will want them left alone.
- * When using a compiler other than gcc, programs using the ANSI C keywords
- * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
- * When using "gcc -traditional", we assume that this is the intent; if
- * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
- */
-#ifndef NO_ANSI_KEYWORDS
-#define const /* delete ANSI C keywords */
-#define inline
-#define signed
-#define volatile
-#endif /* !NO_ANSI_KEYWORDS */
-#endif /* !__GNUC__ */
-#endif /* !(__STDC__ || __cplusplus) */
-
-/*
- * GCC1 and some versions of GCC2 declare dead (non-returning) and
- * pure (no side effects) functions using "volatile" and "const";
- * unfortunately, these then cause warnings under "-ansi -pedantic".
- * GCC2.5 uses a new, peculiar __attribute__((attrs)) style. All of
- * these work for GNU C++ (modulo a slight glitch in the C++ grammar
- * in the distribution version of 2.5.5).
- */
-#if __GNUC__ < 2
-#define __dead
-#define __dead2
-#define __pure
-#define __pure2
-#define __unused
-#define __attribute__(x)
-#endif
-#if __GNUC__ == 2 && __GNUC_MINOR__ < 5
-#define __dead __volatile
-#define __dead2
-#define __pure __const
-#define __pure2
-#define __unused
-#endif
-#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7
-#define __dead
-#define __dead2 __attribute__((__noreturn__))
-#define __pure
-#define __pure2 __attribute__((__const__))
-#define __unused
-#endif
-#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3
-#define __dead
-#define __dead2 __attribute__((__noreturn__))
-#define __pure
-#define __pure2 __attribute__((__const__))
-#define __unused __attribute__((__unused__))
-#endif
-
-#ifdef __GNUC__
-#ifdef __STDC__
-#define __weak_reference(sym,alias) \
- __asm__(".stabs \"_" #alias "\",11,0,0,0"); \
- __asm__(".stabs \"_" #sym "\",1,0,0,0")
-#define __warn_references(sym,msg) \
- __asm__(".stabs \"" msg "\",30,0,0,0"); \
- __asm__(".stabs \"_" #sym "\",1,0,0,0")
-#else
-#define __weak_reference(sym,alias) \
- __asm__(".stabs \"_/**/alias\",11,0,0,0"); \
- __asm__(".stabs \"_/**/sym\",1,0,0,0")
-#define __warn_references(sym,msg) \
- __asm__(".stabs msg,30,0,0,0"); \
- __asm__(".stabs \"_/**/sym\",1,0,0,0")
-#endif
-#endif
-
-#define __IDSTRING(name,string) \
- static const char name[] __attribute__((__unused__)) = string
-
-#ifndef __RCSID
-#define __RCSID(s) __IDSTRING(rcsid,s)
-#endif
-
-#ifndef __RCSID_SOURCE
-#define __RCSID_SOURCE(s) __IDSTRING(rcsid_source,s)
-#endif
-
-#ifndef __COPYRIGHT
-#define __COPYRIGHT(s) __IDSTRING(copyright,s)
-#endif
-
-#endif /* !_SYS_CDEFS_H_ */
diff --git a/c/src/libnetworking/sys/conf.h b/c/src/libnetworking/sys/conf.h
deleted file mode 100644
index 92d99d9d07..0000000000
--- a/c/src/libnetworking/sys/conf.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)conf.h 8.5 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _SYS_CONF_H_
-#define _SYS_CONF_H_
-
-/*
- * Definitions of device driver entry switches
- */
-
-struct buf;
-struct proc;
-struct tty;
-struct uio;
-struct vnode;
-
-typedef int d_open_t __P((dev_t dev, int oflags, int devtype, struct proc *p));
-typedef int d_close_t __P((dev_t dev, int fflag, int devtype, struct proc *p));
-typedef void d_strategy_t __P((struct buf *bp));
-typedef int d_ioctl_t __P((dev_t dev, int cmd, caddr_t data,
- int fflag, struct proc *p));
-typedef int d_dump_t __P((dev_t dev));
-typedef int d_psize_t __P((dev_t dev));
-
-typedef int d_read_t __P((dev_t dev, struct uio *uio, int ioflag));
-typedef int d_write_t __P((dev_t dev, struct uio *uio, int ioflag));
-typedef void d_stop_t __P((struct tty *tp, int rw));
-typedef int d_reset_t __P((dev_t dev));
-typedef struct tty *d_devtotty_t __P((dev_t dev));
-typedef int d_select_t __P((dev_t dev, int which, struct proc *p));
-typedef int d_mmap_t __P((dev_t dev, int offset, int nprot));
-
-typedef int l_open_t __P((dev_t dev, struct tty *tp));
-typedef int l_close_t __P((struct tty *tp, int flag));
-typedef int l_read_t __P((struct tty *tp, struct uio *uio, int flag));
-typedef int l_write_t __P((struct tty *tp, struct uio *uio, int flag));
-typedef int l_ioctl_t __P((struct tty *tp, int cmd, caddr_t data,
- int flag, struct proc *p));
-typedef int l_rint_t __P((int c, struct tty *tp));
-typedef int l_start_t __P((struct tty *tp));
-typedef int l_modem_t __P((struct tty *tp, int flag));
-
-/*
- * Block device switch table
- */
-struct bdevsw {
- d_open_t *d_open;
- d_close_t *d_close;
- d_strategy_t *d_strategy;
- d_ioctl_t *d_ioctl;
- d_dump_t *d_dump;
- d_psize_t *d_psize;
- int d_flags;
- char *d_name; /* name of the driver e.g. audio */
- struct cdevsw *d_cdev; /* cross pointer to the cdev */
- int d_maj; /* the major number we were assigned */
-};
-
-#ifdef KERNEL
-extern struct bdevsw *bdevsw[];
-#endif
-
-/*
- * Character device switch table
- */
-struct cdevsw {
- d_open_t *d_open;
- d_close_t *d_close;
- d_read_t *d_read;
- d_write_t *d_write;
- d_ioctl_t *d_ioctl;
- d_stop_t *d_stop;
- d_reset_t *d_reset; /* XXX not used */
- d_devtotty_t *d_devtotty;
- d_select_t *d_select;
- d_mmap_t *d_mmap;
- d_strategy_t *d_strategy;
- char *d_name; /* see above */
- struct bdevsw *d_bdev;
- int d_maj;
-};
-
-#ifdef KERNEL
-extern struct cdevsw *cdevsw[];
-#endif
-
-/*
- * Line discipline switch table
- */
-struct linesw {
- l_open_t *l_open;
- l_close_t *l_close;
- l_read_t *l_read;
- l_write_t *l_write;
- l_ioctl_t *l_ioctl;
- l_rint_t *l_rint;
- l_start_t *l_start;
- l_modem_t *l_modem;
-};
-
-#ifdef KERNEL
-extern struct linesw linesw[];
-extern int nlinesw;
-
-int ldisc_register __P((int , struct linesw *));
-void ldisc_deregister __P((int));
-#define LDISC_LOAD -1 /* Loadable line discipline */
-#endif
-
-/*
- * Swap device table
- */
-struct swdevt {
- dev_t sw_dev;
- int sw_flags;
- int sw_nblks;
- struct vnode *sw_vp;
-};
-#define SW_FREED 0x01
-#define SW_SEQUENTIAL 0x02
-#define sw_freed sw_flags /* XXX compat */
-
-#ifdef KERNEL
-d_open_t noopen;
-d_close_t noclose;
-d_read_t noread;
-d_write_t nowrite;
-d_ioctl_t noioctl;
-d_stop_t nostop;
-d_reset_t noreset;
-d_devtotty_t nodevtotty;
-d_select_t noselect;
-d_mmap_t nommap;
-
-/* Bogus defines for compatibility. */
-#define noioc noioctl
-#define nostrat nostrategy
-#define zerosize nopsize
-/*
- * XXX d_strategy seems to be unused for cdevs that aren't associated with
- * bdevs and called without checking for it being non-NULL for bdevs.
- */
-#define nostrategy ((d_strategy_t *)NULL)
-
-d_dump_t nodump;
-
-/*
- * nopsize is little used, so not worth having dummy functions for.
- */
-#define nopsize ((d_psize_t *)NULL)
-
-d_open_t nullopen;
-d_close_t nullclose;
-#define nullstop nostop /* one void return is as good as another */
-#define nullreset noreset /* one unused function is as good as another */
-
-d_open_t nxopen;
-d_close_t nxclose;
-d_read_t nxread;
-d_write_t nxwrite;
-d_ioctl_t nxioctl;
-#define nxstop nostop /* one void return is as good as another */
-#define nxreset noreset /* one unused function is as good as another */
-#define nxdevtotty nodevtotty /* one NULL return is as good as another */
-d_select_t nxselect;
-#define nxmmap nommap /* one -1 return is as good as another */
-#define nxstrategy nostrategy /* one NULL value is as good as another */
-d_dump_t nxdump;
-#define nxpsize nopsize /* one NULL value is as good as another */
-
-d_read_t rawread;
-d_write_t rawwrite;
-
-l_read_t l_noread;
-l_write_t l_nowrite;
-
-int bdevsw_add __P((dev_t *descrip,struct bdevsw *new,struct bdevsw **old));
-int cdevsw_add __P((dev_t *descrip,struct cdevsw *new,struct cdevsw **old));
-void cdevsw_make __P((struct bdevsw *from));
-void bdevsw_add_generic __P((int bdev, int cdev, struct bdevsw *bdevsw));
-dev_t chrtoblk __P((dev_t dev));
-int isdisk __P((dev_t dev, int type));
-int iskmemdev __P((dev_t dev));
-int iszerodev __P((dev_t dev));
-void setconf __P((void));
-#endif /* KERNEL */
-
-#include <machine/conf.h>
-
-#endif /* !_SYS_CONF_H_ */
diff --git a/c/src/libnetworking/sys/domain.h b/c/src/libnetworking/sys/domain.h
deleted file mode 100644
index 2ec8a5fb05..0000000000
--- a/c/src/libnetworking/sys/domain.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)domain.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_DOMAIN_H_
-#define _SYS_DOMAIN_H_
-
-/*
- * Structure per communications domain.
- */
-
-/*
- * Forward structure declarations for function prototypes [sic].
- */
-struct mbuf;
-
-struct domain {
- int dom_family; /* AF_xxx */
- char *dom_name;
- void (*dom_init) /* initialize domain data structures */
- __P((void));
- int (*dom_externalize) /* externalize access rights */
- __P((struct mbuf *));
- void (*dom_dispose) /* dispose of internalized rights */
- __P((struct mbuf *));
- struct protosw *dom_protosw, *dom_protoswNPROTOSW;
- struct domain *dom_next;
- int (*dom_rtattach) /* initialize routing table */
- __P((void **, int));
- int dom_rtoffset; /* an arg to rtattach, in bits */
- int dom_maxrtkey; /* for routing layer */
-};
-
-#ifdef KERNEL
-extern struct domain *domains;
-extern struct domain localdomain;
-
-#define DOMAIN_SET(name) \
- DATA_SET(domain_set, name ## domain);
-
-#endif
-
-#endif
diff --git a/c/src/libnetworking/sys/filio.h b/c/src/libnetworking/sys/filio.h
deleted file mode 100644
index b82a649c0f..0000000000
--- a/c/src/libnetworking/sys/filio.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)filio.h 8.1 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_FILIO_H_
-#define _SYS_FILIO_H_
-
-#include <sys/ioccom.h>
-
-/* Generic file-descriptor ioctl's. */
-#define FIOCLEX _IO('f', 1) /* set close on exec on fd */
-#define FIONCLEX _IO('f', 2) /* remove close on exec */
-#define FIONREAD _IOR('f', 127, int) /* get # bytes to read */
-#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */
-#define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */
-#define FIOSETOWN _IOW('f', 124, int) /* set owner */
-#define FIOGETOWN _IOR('f', 123, int) /* get owner */
-
-#endif /* !_SYS_FILIO_H_ */
diff --git a/c/src/libnetworking/sys/ioccom.h b/c/src/libnetworking/sys/ioccom.h
deleted file mode 100644
index 18c4b74741..0000000000
--- a/c/src/libnetworking/sys/ioccom.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * 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.
- *
- * @(#)ioccom.h 8.2 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_IOCCOM_H_
-#define _SYS_IOCCOM_H_
-
-/*
- * Ioctl's have the command encoded in the lower word, and the size of
- * any in or out parameters in the upper word. The high 3 bits of the
- * upper word are used to encode the in/out status of the parameter.
- */
-#define IOCPARM_MASK 0x1fff /* parameter length, at most 13 bits */
-#define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK)
-#define IOCBASECMD(x) ((x) & ~(IOCPARM_MASK << 16))
-#define IOCGROUP(x) (((x) >> 8) & 0xff)
-
-#define IOCPARM_MAX PAGE_SIZE /* max size of ioctl, mult. of PAGE_SIZE */
-#define IOC_VOID 0x20000000 /* no parameters */
-#define IOC_OUT 0x40000000 /* copy out parameters */
-#define IOC_IN 0x80000000 /* copy in parameters */
-#define IOC_INOUT (IOC_IN|IOC_OUT)
-#define IOC_DIRMASK 0xe0000000 /* mask for IN/OUT/VOID */
-
-#define _IOC(inout,group,num,len) \
- (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))
-#define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0)
-#define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t))
-#define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t))
-/* this should be _IORW, but stdio got there first */
-#define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t))
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int ioctl __P((int, unsigned long, ...));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif /* !_SYS_IOCCOM_H_ */
diff --git a/c/src/libnetworking/sys/ioctl.h b/c/src/libnetworking/sys/ioctl.h
deleted file mode 100644
index e3a69a5a7f..0000000000
--- a/c/src/libnetworking/sys/ioctl.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)ioctl.h 8.6 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_IOCTL_H_
-#define _SYS_IOCTL_H_
-
-#include <sys/ttycom.h>
-
-/*
- * Pun for SunOS prior to 3.2. SunOS 3.2 and later support TIOCGWINSZ
- * and TIOCSWINSZ (yes, even 3.2-3.5, the fact that it wasn't documented
- * notwithstanding).
- */
-struct ttysize {
- unsigned short ts_lines;
- unsigned short ts_cols;
- unsigned short ts_xxx;
- unsigned short ts_yyy;
-};
-#define TIOCGSIZE TIOCGWINSZ
-#define TIOCSSIZE TIOCSWINSZ
-
-#include <sys/ioccom.h>
-
-#include <sys/filio.h>
-#include <sys/sockio.h>
-
-#endif /* !_SYS_IOCTL_H_ */
-
-/*
- * Keep outside _SYS_IOCTL_H_
- * Compatibility with old terminal driver
- *
- * Source level -> #define USE_OLD_TTY
- * Kernel level -> options COMPAT_43 or COMPAT_SUNOS
- */
-#if defined(USE_OLD_TTY) || defined(COMPAT_43) || defined(COMPAT_SUNOS)
-#include <sys/ioctl_compat.h>
-#endif
diff --git a/c/src/libnetworking/sys/kernel.h b/c/src/libnetworking/sys/kernel.h
deleted file mode 100644
index 35bce70bd6..0000000000
--- a/c/src/libnetworking/sys/kernel.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/*-
- * Copyright (c) 1995 Terrence R. Lambert
- * All rights reserved.
- *
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)kernel.h 8.3 (Berkeley) 1/21/94
- * $Id$
- */
-
-#ifndef _SYS_KERNEL_H_
-#define _SYS_KERNEL_H_
-
-/* Global variables for the kernel. */
-
-/* 1.1 */
-extern long hostid;
-extern char hostname[MAXHOSTNAMELEN];
-extern int hostnamelen;
-extern char domainname[MAXHOSTNAMELEN];
-extern int domainnamelen;
-extern char kernelname[MAXPATHLEN];
-
-/* 1.2 */
-extern volatile struct timeval mono_time;
-extern struct timeval boottime;
-extern struct timeval runtime;
-/* extern volatile struct timeval time; */
-extern struct timezone tz; /* XXX */
-
-extern int tick; /* usec per tick (1000000 / hz) */
-extern int hz; /* system clock's frequency */
-extern int psratio; /* ratio: prof / stat */
-extern int stathz; /* statistics clock's frequency */
-extern int profhz; /* profiling clock's frequency */
-extern int ticks;
-extern int lbolt; /* once a second sleep address */
-extern int tickdelta;
-extern long timedelta;
-
-/*
- * The following macros are used to declare global sets of objects, which
- * are collected by the linker into a `struct linker_set' as defined below.
- *
- * NB: the constants defined below must match those defined in
- * ld/ld.h. Since their calculation requires arithmetic, we
- * can't name them symbolically (e.g., 23 is N_SETT | N_EXT).
- */
-#define MAKE_SET(set, sym, type)
-#define TEXT_SET(set, sym) MAKE_SET(set, sym, 23)
-#define DATA_SET(set, sym) MAKE_SET(set, sym, 25)
-#define BSS_SET(set, sym) MAKE_SET(set, sym, 27)
-#define ABS_SET(set, sym) MAKE_SET(set, sym, 21)
-
-
-/*
- * Enumerated types for known system startup interfaces.
- *
- * Startup occurs in ascending numeric order; the list entries are
- * sorted prior to attempting startup to guarantee order. Items
- * of the same level are arbitrated for order based on the 'order'
- * element.
- *
- * These numbers are arbitrary and are chosen ONLY for ordering; the
- * enumeration values are explicit rather than implicit to provide
- * for binary compatibility with inserted elements.
- *
- * The SI_SUB_RUN_SCHEDULER value must have the highest lexical value.
- *
- * The SI_SUB_CONSOLE and SI_SUB_SWAP values represent values used by
- * the BSD 4.4Lite but not by FreeBSD; they are maintained in dependent
- * order to support porting.
- *
- * The SI_SUB_PROTO_BEGIN and SI_SUB_PROTO_END bracket a range of
- * initializations to take place at splimp(). This is a historical
- * wart that should be removed -- probably running everything at
- * splimp() until the first init that doesn't want it is the correct
- * fix. They are currently present to ensure historical behavior.
- */
-enum sysinit_sub_id {
- SI_SUB_DUMMY = 0x00000000, /* not executed; for linker*/
- SI_SUB_CONSOLE = 0x08000000, /* console*/
- SI_SUB_COPYRIGHT = 0x08000001, /* first use of console*/
- SI_SUB_VM = 0x10000000, /* virtual memory system init*/
- SI_SUB_KMEM = 0x18000000, /* kernel memory*/
- SI_SUB_CPU = 0x20000000, /* CPU resource(s)*/
- SI_SUB_DEVFS = 0x22000000, /* get DEVFS ready */
- SI_SUB_DRIVERS = 0x23000000, /* Let Drivers initialize */
- SI_SUB_CONFIGURE = 0x24000000, /* Configure devices */
- SI_SUB_INTRINSIC = 0x28000000, /* proc 0*/
- SI_SUB_RUN_QUEUE = 0x30000000, /* the run queue*/
- SI_SUB_VM_CONF = 0x38000000, /* config VM, set limits*/
- SI_SUB_VFS = 0x40000000, /* virtual file system*/
- SI_SUB_CLOCKS = 0x48000000, /* real time and stat clocks*/
- SI_SUB_MBUF = 0x50000000, /* mbufs*/
- SI_SUB_CLIST = 0x58000000, /* clists*/
- SI_SUB_SYSV_SHM = 0x64000000, /* System V shared memory*/
- SI_SUB_SYSV_SEM = 0x68000000, /* System V semaphores*/
- SI_SUB_SYSV_MSG = 0x6C000000, /* System V message queues*/
- SI_SUB_PSEUDO = 0x70000000, /* pseudo devices*/
- SI_SUB_PROTO_BEGIN = 0x80000000, /* XXX: set splimp (kludge)*/
- SI_SUB_PROTO_IF = 0x84000000, /* interfaces*/
- SI_SUB_PROTO_DOMAIN = 0x88000000, /* domains (address families?)*/
- SI_SUB_PROTO_END = 0x8fffffff, /* XXX: set splx (kludge)*/
- SI_SUB_KPROF = 0x90000000, /* kernel profiling*/
- SI_SUB_KICK_SCHEDULER = 0xa0000000, /* start the timeout events*/
- SI_SUB_ROOT = 0xb0000000, /* root mount*/
- SI_SUB_ROOT_FDTAB = 0xb8000000, /* root vnode in fd table...*/
- SI_SUB_SWAP = 0xc0000000, /* swap*/
- SI_SUB_INTRINSIC_POST = 0xd0000000, /* proc 0 cleanup*/
- SI_SUB_KTHREAD_INIT = 0xe0000000, /* init process*/
- SI_SUB_KTHREAD_PAGE = 0xe4000000, /* pageout daemon*/
- SI_SUB_KTHREAD_VM = 0xe8000000, /* vm daemon*/
- SI_SUB_KTHREAD_UPDATE = 0xec000000, /* update daemon*/
- SI_SUB_RUN_SCHEDULER = 0xffffffff /* scheduler: no return*/
-};
-
-
-/*
- * Some enumerated orders; "ANY" sorts last.
- */
-enum sysinit_elem_order {
- SI_ORDER_FIRST = 0x00000000, /* first*/
- SI_ORDER_SECOND = 0x00000001, /* second*/
- SI_ORDER_THIRD = 0x00000002, /* third*/
- SI_ORDER_MIDDLE = 0x10000000, /* somewhere in the middle */
- SI_ORDER_ANY = 0xffffffff /* last*/
-};
-
-
-/*
- * System initialization call types; currently two are supported... one
- * to do a simple function call and one to cause a process to be started
- * by the kernel on the callers behalf.
- */
-typedef enum sysinit_elem_type {
- SI_TYPE_DEFAULT = 0x00000000, /* No special processing*/
- SI_TYPE_KTHREAD = 0x00000001 /* start kernel thread*/
-} si_elem_t;
-
-
-/*
- * A system initialization call instance
- *
- * The subsystem
- */
-struct sysinit {
- unsigned int subsystem; /* subsystem identifier*/
- unsigned int order; /* init order within subsystem*/
- void (*func) __P((void *)); /* init function*/
- void *udata; /* multiplexer/argument */
- si_elem_t type; /* sysinit_elem_type*/
-};
-
-
-/*
- * Default: no special processing
- */
-#define SYSINIT(uniquifier, subsystem, order, func, ident)
-
-/*
- * Call 'fork()' before calling '(*func)(ident)';
- * for making a kernel 'thread' (or builtin process.)
- */
-#define SYSINIT_KT(uniquifier, subsystem, order, func, ident)
-
-
-/*
- * A kernel process descriptor; used to start "internal" daemons
- *
- * Note: global_procpp may be NULL for no global save area
- */
-struct kproc_desc {
- char *arg0; /* arg 0 (for 'ps' listing)*/
- void (*func) __P((void)); /* "main" for kernel process*/
- struct proc **global_procpp; /* ptr to proc ptr save area*/
-};
-
-void kproc_start __P((void *udata));
-
-#ifdef PSEUDO_LKM
-#include <sys/conf.h>
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-#define PSEUDO_SET(init, name) \
- extern struct linker_set MODVNOPS; \
- MOD_MISC(name); \
- static int \
- name ## _load(struct lkm_table *lkmtp, int cmd) \
- { init((void *)NULL /* XXX unused (?) */); return 0; } \
- static int \
- name ## _unload(struct lkm_table *lkmtp, int cmd) \
- { return EINVAL; } \
- int \
- name ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \
- DISPATCH(lkmtp, cmd, ver, name ## _load, name ## _unload, \
- lkm_nullcmd); }
-#else /* PSEUDO_LKM */
-
-/*
- * Compatibility. To be deprecated after LKM is updated.
- */
-#define PSEUDO_SET(sym, name) SYSINIT(ps, SI_SUB_PSEUDO, SI_ORDER_ANY, sym, 0)
-
-#endif /* PSEUDO_LKM */
-
-struct linker_set {
- int ls_length;
- const void *ls_items[1]; /* really ls_length of them,
- * trailing NULL */
-};
-
-extern struct linker_set execsw_set;
-
-#endif /* !_SYS_KERNEL_H_*/
diff --git a/c/src/libnetworking/sys/libkern.h b/c/src/libnetworking/sys/libkern.h
deleted file mode 100644
index c01e35b273..0000000000
--- a/c/src/libnetworking/sys/libkern.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * 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.
- *
- * @(#)libkern.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _SYS_LIBKERN_H_
-#define _SYS_LIBKERN_H_
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-/* BCD conversions. */
-extern u_char const bcd2bin_data[];
-extern u_char const bin2bcd_data[];
-extern char const hex2ascii_data[];
-
-#define bcd2bin(bcd) (bcd2bin_data[bcd])
-#define bin2bcd(bin) (bin2bcd_data[bin])
-#define hex2ascii(hex) (hex2ascii_data[hex])
-
-static __inline int imax(int a, int b) { return (a > b ? a : b); }
-static __inline int imin(int a, int b) { return (a < b ? a : b); }
-static __inline long lmax(long a, long b) { return (a > b ? a : b); }
-static __inline long lmin(long a, long b) { return (a < b ? a : b); }
-static __inline u_int max(u_int a, u_int b) { return (a > b ? a : b); }
-static __inline u_int min(u_int a, u_int b) { return (a < b ? a : b); }
-static __inline quad_t qmax(quad_t a, quad_t b) { return (a > b ? a : b); }
-static __inline quad_t qmin(quad_t a, quad_t b) { return (a < b ? a : b); }
-static __inline u_long ulmax(u_long a, u_long b) { return (a > b ? a : b); }
-static __inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); }
-
-/* Prototypes for non-quad routines. */
-int bcmp __P((const void *, const void *, size_t));
-#ifndef HAVE_INLINE_FFS
-int ffs __P((int));
-#endif
-#ifndef HAVE_INLINE_FLS
-int fls __P((int));
-#endif
-int locc __P((int, char *, u_int));
-void qsort __P((void *base, size_t nmemb, size_t size,
- int (*compar)(const void *, const void *)));
-u_long random __P((void));
-char *index __P((const char *, int));
-char *rindex __P((const char *, int));
-int scanc __P((u_int, const u_char *, const u_char *, int));
-int skpc __P((int, int, char *));
-void srandom __P((u_long));
-char *strcat __P((char *, const char *));
-int strcmp __P((const char *, const char *));
-char *strdup __P((const char *s));
-char *strcpy __P((char *, const char *));
-size_t strlen __P((const char *));
-int strncmp __P((const char *, const char *, size_t));
-char *strncpy __P((char *, const char *, size_t));
-char *strerror __P((int errnum));
-
-#endif /* !_SYS_LIBKERN_H_ */
diff --git a/c/src/libnetworking/sys/malloc.h b/c/src/libnetworking/sys/malloc.h
deleted file mode 100644
index ec85c1814d..0000000000
--- a/c/src/libnetworking/sys/malloc.h
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Copyright (c) 1987, 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.
- *
- * @(#)malloc.h 8.5 (Berkeley) 5/3/95
- * $Id$
- */
-
-#ifndef _SYS_MALLOC_H_
-#define _SYS_MALLOC_H_
-
-#include <rtems/rtems_bsdnet_internal.h> /* Ensure we get RTEMS malloc hooks */
-#define KMEMSTATS
-
-/*
- * flags to malloc
- */
-#define M_WAITOK 0x0000
-#define M_NOWAIT 0x0001
-#define M_KERNEL 0x0002
-
-/*
- * Types of memory to be allocated
- */
-#define M_FREE 0 /* should be on free list */
-#define M_MBUF 1 /* mbuf */
-#define M_DEVBUF 2 /* device driver memory */
-#define M_SOCKET 3 /* socket structure */
-#define M_PCB 4 /* protocol control block */
-#define M_RTABLE 5 /* routing tables */
-#define M_HTABLE 6 /* IMP host tables */
-#define M_FTABLE 7 /* fragment reassembly header */
-#define M_ZOMBIE 8 /* zombie proc status */
-#define M_IFADDR 9 /* interface address */
-#define M_SOOPTS 10 /* socket options */
-#define M_SONAME 11 /* socket name */
-#define M_NAMEI 12 /* namei path name buffer */
-#define M_GPROF 13 /* kernel profiling buffer */
-#define M_IOCTLOPS 14 /* ioctl data buffer */
-#define M_MAPMEM 15 /* mapped memory descriptors */
-#define M_CRED 16 /* credentials */
-#define M_PGRP 17 /* process group header */
-#define M_SESSION 18 /* session header */
-#define M_IOV 19 /* large iov's */
-#define M_MOUNT 20 /* vfs mount struct */
-#define M_FHANDLE 21 /* network file handle */
-#define M_NFSREQ 22 /* NFS request header */
-#define M_NFSMNT 23 /* NFS mount structure */
-#define M_NFSNODE 24 /* NFS vnode private part */
-#define M_VNODE 25 /* Dynamically allocated vnodes */
-#define M_CACHE 26 /* Dynamically allocated cache entries */
-#define M_DQUOT 27 /* UFS quota entries */
-#define M_UFSMNT 28 /* UFS mount structure */
-#define M_SHM 29 /* SVID compatible shared memory segments */
-#define M_VMMAP 30 /* VM map structures */
-#define M_VMMAPENT 31 /* VM map entry structures */
-#define M_VMOBJ 32 /* VM object structure */
-#define M_VMOBJHASH 33 /* VM object hash structure */
-#define M_VMPMAP 34 /* VM pmap */
-#define M_VMPVENT 35 /* VM phys-virt mapping entry */
-#define M_VMPAGER 36 /* XXX: VM pager struct */
-#define M_VMPGDATA 37 /* XXX: VM pager private data */
-#define M_FILE 38 /* Open file structure */
-#define M_FILEDESC 39 /* Open file descriptor table */
-#define M_LOCKF 40 /* Byte-range locking structures */
-#define M_PROC 41 /* Proc structures */
-#define M_SUBPROC 42 /* Proc sub-structures */
-#define M_SEGMENT 43 /* Segment for LFS */
-#define M_LFSNODE 44 /* LFS vnode private part */
-#define M_FFSNODE 45 /* FFS vnode private part */
-#define M_MFSNODE 46 /* MFS vnode private part */
-#define M_NQLEASE 47 /* Nqnfs lease */
-#define M_NQMHOST 48 /* Nqnfs host address table */
-#define M_NETADDR 49 /* Export host address structure */
-#define M_NFSSVC 50 /* Nfs server structure */
-#define M_NFSUID 51 /* Nfs uid mapping structure */
-#define M_NFSD 52 /* Nfs server daemon structure */
-#define M_IPMOPTS 53 /* internet multicast options */
-#define M_IPMADDR 54 /* internet multicast address */
-#define M_IFMADDR 55 /* link-level multicast address */
-#define M_MRTABLE 56 /* multicast routing tables */
-#define M_ISOFSMNT 57 /* ISOFS mount structure */
-#define M_ISOFSNODE 58 /* ISOFS vnode private part */
-#define M_NFSRVDESC 59 /* NFS server socket descriptor */
-#define M_NFSDIROFF 60 /* NFS directory offset data */
-#define M_NFSBIGFH 61 /* NFS version 3 file handle */
-#define M_MSDOSFSMNT 67 /* MSDOSFS mount structure */
-#define M_MSDOSFSNODE 68 /* MSDOSFS vnode private part */
-#define M_MSDOSFSFAT 69 /* MSDOSFS file allocation table */
-#define M_DEVFSMNT 70 /* DEVFS mount structure */
-#define M_DEVFSBACK 71 /* DEVFS Back node */
-#define M_DEVFSFRONT 72 /* DEVFS Front node */
-#define M_DEVFSNODE 73 /* DEVFS node */
-#define M_TEMP 74 /* misc temporary data buffers */
-#define M_TTYS 75 /* tty data structures */
-#define M_GZIP 76 /* Gzip trees */
-#define M_IPFW 77 /* IpFw/IpAcct chain's */
-#define M_DEVL 78 /* isa_device lists in userconfig() */
-#define M_PKTCLASS 79 /* structures used in packet classifier */
-#define M_SYSCTL 80 /* sysctl internal magic */
-#define M_SECA 81 /* security associations, key management */
-#define M_BIOBUF 82 /* BIO buffer */
-#define M_KTRACE 83 /* KTRACE */
-#define M_SELECT 84 /* select() buffer */
-#define M_CFS 85 /* Coda */
-#define M_LAST 86 /* Must be last type + 1 */
-
-#define INITKMEMNAMES { \
- "free", /* 0 M_FREE */ \
- "mbuf", /* 1 M_MBUF */ \
- "devbuf", /* 2 M_DEVBUF */ \
- "socket", /* 3 M_SOCKET */ \
- "pcb", /* 4 M_PCB */ \
- "routetbl", /* 5 M_RTABLE */ \
- "hosttbl", /* 6 M_HTABLE */ \
- "fragtbl", /* 7 M_FTABLE */ \
- "zombie", /* 8 M_ZOMBIE */ \
- "ifaddr", /* 9 M_IFADDR */ \
- "soopts", /* 10 M_SOOPTS */ \
- "soname", /* 11 M_SONAME */ \
- "namei", /* 12 M_NAMEI */ \
- "gprof", /* 13 M_GPROF */ \
- "ioctlops", /* 14 M_IOCTLOPS */ \
- "mapmem", /* 15 M_MAPMEM */ \
- "cred", /* 16 M_CRED */ \
- "pgrp", /* 17 M_PGRP */ \
- "session", /* 18 M_SESSION */ \
- "iov", /* 19 M_IOV */ \
- "mount", /* 20 M_MOUNT */ \
- "fhandle", /* 21 M_FHANDLE */ \
- "NFS req", /* 22 M_NFSREQ */ \
- "NFS mount", /* 23 M_NFSMNT */ \
- "NFS node", /* 24 M_NFSNODE */ \
- "vnodes", /* 25 M_VNODE */ \
- "namecache", /* 26 M_CACHE */ \
- "UFS quota", /* 27 M_DQUOT */ \
- "UFS mount", /* 28 M_UFSMNT */ \
- "shm", /* 29 M_SHM */ \
- "VM map", /* 30 M_VMMAP */ \
- "VM mapent", /* 31 M_VMMAPENT */ \
- "VM object", /* 32 M_VMOBJ */ \
- "VM objhash", /* 33 M_VMOBJHASH */ \
- "VM pmap", /* 34 M_VMPMAP */ \
- "VM pvmap", /* 35 M_VMPVENT */ \
- "VM pager", /* 36 M_VMPAGER */ \
- "VM pgdata", /* 37 M_VMPGDATA */ \
- "file", /* 38 M_FILE */ \
- "file desc", /* 39 M_FILEDESC */ \
- "lockf", /* 40 M_LOCKF */ \
- "proc", /* 41 M_PROC */ \
- "subproc", /* 42 M_SUBPROC */ \
- "LFS segment", /* 43 M_SEGMENT */ \
- "LFS node", /* 44 M_LFSNODE */ \
- "FFS node", /* 45 M_FFSNODE */ \
- "MFS node", /* 46 M_MFSNODE */ \
- "NQNFS Lease", /* 47 M_NQLEASE */ \
- "NQNFS Host", /* 48 M_NQMHOST */ \
- "Export Host", /* 49 M_NETADDR */ \
- "NFS srvsock", /* 50 M_NFSSVC */ \
- "NFS uid", /* 51 M_NFSUID */ \
- "NFS daemon", /* 52 M_NFSD */ \
- "ip_moptions", /* 53 M_IPMOPTS */ \
- "in_multi", /* 54 M_IPMADDR */ \
- "ether_multi", /* 55 M_IFMADDR */ \
- "mrt", /* 56 M_MRTABLE */ \
- "ISOFS mount", /* 57 M_ISOFSMNT */ \
- "ISOFS node", /* 58 M_ISOFSNODE */ \
- "NFSV3 srvdesc",/* 59 M_NFSRVDESC */ \
- "NFSV3 diroff", /* 60 M_NFSDIROFF */ \
- "NFSV3 bigfh", /* 61 M_NFSBIGFH */ \
- NULL, \
- NULL, NULL, NULL, NULL, \
- "MSDOSFS mount",/* 67 M_MSDOSFSMNT */ \
- "MSDOSFS node", /* 68 M_MSDOSFSNODE */ \
- "MSDOSFS FAT", /* 69 M_MSDOSFSFAR */ \
- "DEVFS mount", /* 70 M_DEVFSMNT */ \
- "DEVFS back", /* 71 M_DEVFSBACK */ \
- "DEVFS front", /* 72 M_DEVFSFRONT */ \
- "DEVFS node", /* 73 M_DEVFSNODE */ \
- "temp", /* 74 M_TEMP */ \
- "ttys", /* 75 M_TTYS */ \
- "Gzip trees", /* 76 M_GZIP */ \
- "IpFw/IpAcct", /* 77 M_IPFW */ \
- "isa_devlist", /* 78 M_DEVL */ \
- "PktClass", /* 79 M_PKTCLASS */ \
- "sysctl", /* 80 M_SYSCTL */ \
- "key mgmt", /* 81 M_SECA */ \
- "BIO buffer", /* 82 M_BIOBUF */ \
- "KTRACE", /* 83 M_KTRACE */ \
- "select", /* 84 M_SELECT */ \
- "Coda", /* 85 M_CFS */ \
-}
-
-struct kmemstats {
- long ks_inuse; /* # of packets of this type currently in use */
- long ks_calls; /* total packets of this type ever allocated */
- long ks_memuse; /* total memory held in bytes */
- u_short ks_limblocks; /* number of times blocked for hitting limit */
- u_short ks_mapblocks; /* number of times blocked for kernel map */
- long ks_maxused; /* maximum number ever used */
- long ks_limit; /* most that are allowed to exist */
- long ks_size; /* sizes of this thing that are allocated */
- long ks_spare;
-};
-
-/*
- * Array of descriptors that describe the contents of each page
- */
-struct kmemusage {
- short ku_indx; /* bucket index */
- union {
- u_short freecnt;/* for small allocations, free pieces in page */
- u_short pagecnt;/* for large allocations, pages alloced */
- } ku_un;
-};
-#define ku_freecnt ku_un.freecnt
-#define ku_pagecnt ku_un.pagecnt
-
-/*
- * Set of buckets for each size of memory block that is retained
- */
-struct kmembuckets {
- caddr_t kb_next; /* list of free blocks */
- caddr_t kb_last; /* last free block */
- long kb_calls; /* total calls to allocate this size */
- long kb_total; /* total number of blocks allocated */
- long kb_totalfree; /* # of free elements in this bucket */
- long kb_elmpercl; /* # of elements in this sized allocation */
- long kb_highwat; /* high water mark */
- long kb_couldfree; /* over high water mark and could free */
-};
-
-#ifdef KERNEL
-#define MINALLOCSIZE (1 << MINBUCKET)
-#define BUCKETINDX(size) \
- ((size) <= (MINALLOCSIZE * 128) \
- ? (size) <= (MINALLOCSIZE * 8) \
- ? (size) <= (MINALLOCSIZE * 2) \
- ? (size) <= (MINALLOCSIZE * 1) \
- ? (MINBUCKET + 0) \
- : (MINBUCKET + 1) \
- : (size) <= (MINALLOCSIZE * 4) \
- ? (MINBUCKET + 2) \
- : (MINBUCKET + 3) \
- : (size) <= (MINALLOCSIZE* 32) \
- ? (size) <= (MINALLOCSIZE * 16) \
- ? (MINBUCKET + 4) \
- : (MINBUCKET + 5) \
- : (size) <= (MINALLOCSIZE * 64) \
- ? (MINBUCKET + 6) \
- : (MINBUCKET + 7) \
- : (size) <= (MINALLOCSIZE * 2048) \
- ? (size) <= (MINALLOCSIZE * 512) \
- ? (size) <= (MINALLOCSIZE * 256) \
- ? (MINBUCKET + 8) \
- : (MINBUCKET + 9) \
- : (size) <= (MINALLOCSIZE * 1024) \
- ? (MINBUCKET + 10) \
- : (MINBUCKET + 11) \
- : (size) <= (MINALLOCSIZE * 8192) \
- ? (size) <= (MINALLOCSIZE * 4096) \
- ? (MINBUCKET + 12) \
- : (MINBUCKET + 13) \
- : (size) <= (MINALLOCSIZE * 16384) \
- ? (MINBUCKET + 14) \
- : (MINBUCKET + 15))
-
-/*
- * Turn virtual addresses into kmem map indices
- */
-#define kmemxtob(alloc) (kmembase + (alloc) * PAGE_SIZE)
-#define btokmemx(addr) (((caddr_t)(addr) - kmembase) / PAGE_SIZE)
-#define btokup(addr) (&kmemusage[(caddr_t)(addr) - kmembase >> PAGE_SHIFT])
-
-/*
- * Macro versions for the usual cases of malloc/free
- */
-#if defined(KMEMSTATS) || defined(DIAGNOSTIC)
-#define MALLOC(space, cast, size, type, flags) \
- (space) = (cast)malloc((u_long)(size), type, flags)
-#define FREE(addr, type) free((addr), type)
-
-#else /* do not collect statistics */
-#define MALLOC(space, cast, size, type, flags) { \
- register struct kmembuckets *kbp = &bucket[BUCKETINDX(size)]; \
- long s = splimp(); \
- if (kbp->kb_next == NULL) { \
- (space) = (cast)malloc((u_long)(size), type, flags); \
- } else { \
- (space) = (cast)kbp->kb_next; \
- kbp->kb_next = *(caddr_t *)(space); \
- } \
- splx(s); \
-}
-
-#define FREE(addr, type) { \
- register struct kmembuckets *kbp; \
- register struct kmemusage *kup = btokup(addr); \
- long s = splimp(); \
- if (1 << kup->ku_indx > MAXALLOCSAVE) { \
- free((addr), type); \
- } else { \
- kbp = &bucket[kup->ku_indx]; \
- if (kbp->kb_next == NULL) \
- kbp->kb_next = (caddr_t)(addr); \
- else \
- *(caddr_t *)(kbp->kb_last) = (caddr_t)(addr); \
- *(caddr_t *)(addr) = NULL; \
- kbp->kb_last = (caddr_t)(addr); \
- } \
- splx(s); \
-}
-#endif /* do not collect statistics */
-
-extern struct kmemstats kmemstats[];
-extern struct kmemusage *kmemusage;
-extern char *kmembase;
-extern struct kmembuckets bucket[];
-
-void *contigmalloc __P((unsigned long size, int type, int flags,
- unsigned long low, unsigned long high,
- unsigned long alignment, unsigned long boundary));
-void free __P((void *addr, int type));
-void *malloc __P((unsigned long size, int type, int flags));
-#endif /* KERNEL */
-
-#endif /* !_SYS_MALLOC_H_ */
diff --git a/c/src/libnetworking/sys/mbuf.h b/c/src/libnetworking/sys/mbuf.h
deleted file mode 100644
index b380b3fca3..0000000000
--- a/c/src/libnetworking/sys/mbuf.h
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)mbuf.h 8.5 (Berkeley) 2/19/95
- * $Id$
- */
-
-#ifndef _SYS_MBUF_H_
-#define _SYS_MBUF_H_
-
-#ifndef M_WAITOK
-#include <sys/malloc.h>
-#endif
-
-/*
- * Mbufs are of a single size, MSIZE (machine/machparam.h), which
- * includes overhead. An mbuf may add a single "mbuf cluster" of size
- * MCLBYTES (also in machine/machparam.h), which has no additional overhead
- * and is used instead of the internal data area; this is done when
- * at least MINCLSIZE of data must be stored.
- */
-
-#define MLEN (MSIZE - sizeof(struct m_hdr)) /* normal data len */
-#define MHLEN (MLEN - sizeof(struct pkthdr)) /* data len w/pkthdr */
-
-#define MINCLSIZE (MHLEN + MLEN) /* smallest amount to put in cluster */
-#define M_MAXCOMPRESS (MHLEN / 2) /* max amount to copy for compression */
-
-/*
- * Macros for type conversion
- * mtod(m,t) - convert mbuf pointer to data pointer of correct type
- * dtom(x) - convert data pointer within mbuf to mbuf pointer (XXX)
- * mtocl(x) - convert pointer within cluster to cluster index #
- * cltom(x) - convert cluster # to ptr to beginning of cluster
- */
-#define mtod(m,t) ((t)((m)->m_data))
-#define dtom(x) ((struct mbuf *)((long)(x) & ~(MSIZE-1)))
-#define mtocl(x) (((u_long)(x) - (u_long)mbutl) >> MCLSHIFT)
-#define cltom(x) ((caddr_t)((u_long)mbutl + ((u_long)(x) << MCLSHIFT)))
-
-/* header at beginning of each mbuf: */
-struct m_hdr {
- struct mbuf *mh_next; /* next buffer in chain */
- struct mbuf *mh_nextpkt; /* next chain in queue/record */
- caddr_t mh_data; /* location of data */
- int mh_len; /* amount of data in this mbuf */
- short mh_type; /* type of data in this mbuf */
- short mh_flags; /* flags; see below */
-};
-
-/* record/packet header in first mbuf of chain; valid if M_PKTHDR set */
-struct pkthdr {
- struct ifnet *rcvif; /* rcv interface */
- int len; /* total packet length */
-};
-
-/* description of external storage mapped into mbuf, valid if M_EXT set */
-struct m_ext {
- caddr_t ext_buf; /* start of buffer */
- void (*ext_free) /* free routine if not the usual */
- __P((caddr_t, u_int));
- u_int ext_size; /* size of buffer, for ext_free */
- void (*ext_ref) /* add a reference to the ext object */
- __P((caddr_t, u_int));
-};
-
-struct mbuf {
- struct m_hdr m_hdr;
- union {
- struct {
- struct pkthdr MH_pkthdr; /* M_PKTHDR set */
- union {
- struct m_ext MH_ext; /* M_EXT set */
- char MH_databuf[MHLEN];
- } MH_dat;
- } MH;
- char M_databuf[MLEN]; /* !M_PKTHDR, !M_EXT */
- } M_dat;
-};
-#define m_next m_hdr.mh_next
-#define m_len m_hdr.mh_len
-#define m_data m_hdr.mh_data
-#define m_type m_hdr.mh_type
-#define m_flags m_hdr.mh_flags
-#define m_nextpkt m_hdr.mh_nextpkt
-#define m_act m_nextpkt
-#define m_pkthdr M_dat.MH.MH_pkthdr
-#define m_ext M_dat.MH.MH_dat.MH_ext
-#define m_pktdat M_dat.MH.MH_dat.MH_databuf
-#define m_dat M_dat.M_databuf
-
-/* mbuf flags */
-#define M_EXT 0x0001 /* has associated external storage */
-#define M_PKTHDR 0x0002 /* start of record */
-#define M_EOR 0x0004 /* end of record */
-#define M_PROTO1 0x0008 /* protocol-specific */
-
-/* mbuf pkthdr flags, also in m_flags */
-#define M_BCAST 0x0100 /* send/received as link-level broadcast */
-#define M_MCAST 0x0200 /* send/received as link-level multicast */
-
-/* flags copied when copying m_pkthdr */
-#define M_COPYFLAGS (M_PKTHDR|M_EOR|M_PROTO1|M_BCAST|M_MCAST)
-
-/* mbuf types */
-#define MT_FREE 0 /* should be on free list */
-#define MT_DATA 1 /* dynamic (data) allocation */
-#define MT_HEADER 2 /* packet header */
-#define MT_SOCKET 3 /* socket structure */
-#define MT_PCB 4 /* protocol control block */
-#define MT_RTABLE 5 /* routing tables */
-#define MT_HTABLE 6 /* IMP host tables */
-#define MT_ATABLE 7 /* address resolution tables */
-#define MT_SONAME 8 /* socket name */
-#define MT_SOOPTS 10 /* socket options */
-#define MT_FTABLE 11 /* fragment reassembly header */
-#define MT_RIGHTS 12 /* access rights */
-#define MT_IFADDR 13 /* interface address */
-#define MT_CONTROL 14 /* extra-data protocol message */
-#define MT_OOBDATA 15 /* expedited data */
-
-/* flags to m_get/MGET */
-#define M_DONTWAIT M_NOWAIT
-#define M_WAIT M_WAITOK
-
-/* Freelists:
- *
- * Normal mbuf clusters are normally treated as character arrays
- * after allocation, but use the first word of the buffer as a free list
- * pointer while on the free list.
- */
-union mcluster {
- union mcluster *mcl_next;
- char mcl_buf[MCLBYTES];
-};
-
-/*
- * mbuf utility macros:
- *
- * MBUFLOCK(code)
- * prevents a section of code from from being interrupted by network
- * drivers.
- */
-#define MBUFLOCK(code) \
- { int ms = splimp(); \
- { code } \
- splx(ms); \
- }
-
-/*
- * mbuf allocation/deallocation macros:
- *
- * MGET(struct mbuf *m, int how, int type)
- * allocates an mbuf and initializes it to contain internal data.
- *
- * MGETHDR(struct mbuf *m, int how, int type)
- * allocates an mbuf and initializes it to contain a packet header
- * and internal data.
- */
-#define MGET(m, how, type) { \
- int _ms = splimp(); \
- if (mmbfree == 0) \
- (void)m_mballoc(1, (how)); \
- if (((m) = mmbfree) != 0) { \
- mmbfree = (m)->m_next; \
- mbstat.m_mtypes[MT_FREE]--; \
- (m)->m_type = (type); \
- mbstat.m_mtypes[type]++; \
- (m)->m_next = (struct mbuf *)NULL; \
- (m)->m_nextpkt = (struct mbuf *)NULL; \
- (m)->m_data = (m)->m_dat; \
- (m)->m_flags = 0; \
- splx(_ms); \
- } else { \
- splx(_ms); \
- (m) = m_retry((how), (type)); \
- } \
-}
-
-#define MGETHDR(m, how, type) { \
- int _ms = splimp(); \
- if (mmbfree == 0) \
- (void)m_mballoc(1, (how)); \
- if (((m) = mmbfree) != 0) { \
- mmbfree = (m)->m_next; \
- mbstat.m_mtypes[MT_FREE]--; \
- (m)->m_type = (type); \
- mbstat.m_mtypes[type]++; \
- (m)->m_next = (struct mbuf *)NULL; \
- (m)->m_nextpkt = (struct mbuf *)NULL; \
- (m)->m_data = (m)->m_pktdat; \
- (m)->m_flags = M_PKTHDR; \
- splx(_ms); \
- } else { \
- splx(_ms); \
- (m) = m_retryhdr((how), (type)); \
- } \
-}
-
-/*
- * Mbuf cluster macros.
- * MCLALLOC(caddr_t p, int how) allocates an mbuf cluster.
- * MCLGET adds such clusters to a normal mbuf;
- * the flag M_EXT is set upon success.
- * MCLFREE releases a reference to a cluster allocated by MCLALLOC,
- * freeing the cluster if the reference count has reached 0.
- */
-#define MCLALLOC(p, how) \
- MBUFLOCK( \
- if (mclfree == 0) \
- (void)m_clalloc(1, (how)); \
- if (((p) = (caddr_t)mclfree) != 0) { \
- ++mclrefcnt[mtocl(p)]; \
- mbstat.m_clfree--; \
- mclfree = ((union mcluster *)(p))->mcl_next; \
- } \
- )
-
-#define MCLGET(m, how) \
- { MCLALLOC((m)->m_ext.ext_buf, (how)); \
- if ((m)->m_ext.ext_buf != NULL) { \
- (m)->m_data = (m)->m_ext.ext_buf; \
- (m)->m_flags |= M_EXT; \
- (m)->m_ext.ext_free = NULL; \
- (m)->m_ext.ext_ref = NULL; \
- (m)->m_ext.ext_size = MCLBYTES; \
- } \
- }
-
-#define MCLFREE(p) \
- MBUFLOCK ( \
- if (--mclrefcnt[mtocl(p)] == 0) { \
- ((union mcluster *)(p))->mcl_next = mclfree; \
- mclfree = (union mcluster *)(p); \
- mbstat.m_clfree++; \
- } \
- )
-
-/*
- * MFREE(struct mbuf *m, struct mbuf *n)
- * Free a single mbuf and associated external storage.
- * Place the successor, if any, in n.
- */
-#define MFREE(m, n) \
- MBUFLOCK( \
- mbstat.m_mtypes[(m)->m_type]--; \
- if ((m)->m_flags & M_EXT) { \
- if ((m)->m_ext.ext_free) \
- (*((m)->m_ext.ext_free))((m)->m_ext.ext_buf, \
- (m)->m_ext.ext_size); \
- else { \
- char *p = (m)->m_ext.ext_buf; \
- if (--mclrefcnt[mtocl(p)] == 0) { \
- ((union mcluster *)(p))->mcl_next = mclfree; \
- mclfree = (union mcluster *)(p); \
- mbstat.m_clfree++; \
- } \
- } \
- } \
- (n) = (m)->m_next; \
- (m)->m_type = MT_FREE; \
- mbstat.m_mtypes[MT_FREE]++; \
- (m)->m_next = mmbfree; \
- mmbfree = (m); \
- )
-
-/*
- * Copy mbuf pkthdr from from to to.
- * from must have M_PKTHDR set, and to must be empty.
- */
-#define M_COPY_PKTHDR(to, from) { \
- (to)->m_pkthdr = (from)->m_pkthdr; \
- (to)->m_flags = (from)->m_flags & M_COPYFLAGS; \
- (to)->m_data = (to)->m_pktdat; \
-}
-
-/*
- * Set the m_data pointer of a newly-allocated mbuf (m_get/MGET) to place
- * an object of the specified size at the end of the mbuf, longword aligned.
- */
-#define M_ALIGN(m, len) \
- { (m)->m_data += (MLEN - (len)) &~ (sizeof(long) - 1); }
-/*
- * As above, for mbufs allocated with m_gethdr/MGETHDR
- * or initialized by M_COPY_PKTHDR.
- */
-#define MH_ALIGN(m, len) \
- { (m)->m_data += (MHLEN - (len)) &~ (sizeof(long) - 1); }
-
-/*
- * Compute the amount of space available
- * before the current start of data in an mbuf.
- */
-#define M_LEADINGSPACE(m) \
- ((m)->m_flags & M_EXT ? /* (m)->m_data - (m)->m_ext.ext_buf */ 0 : \
- (m)->m_flags & M_PKTHDR ? (m)->m_data - (m)->m_pktdat : \
- (m)->m_data - (m)->m_dat)
-
-/*
- * Compute the amount of space available
- * after the end of data in an mbuf.
- */
-#define M_TRAILINGSPACE(m) \
- ((m)->m_flags & M_EXT ? (m)->m_ext.ext_buf + (m)->m_ext.ext_size - \
- ((m)->m_data + (m)->m_len) : \
- &(m)->m_dat[MLEN] - ((m)->m_data + (m)->m_len))
-
-/*
- * Arrange to prepend space of size plen to mbuf m.
- * If a new mbuf must be allocated, how specifies whether to wait.
- * If how is M_DONTWAIT and allocation fails, the original mbuf chain
- * is freed and m is set to NULL.
- */
-#define M_PREPEND(m, plen, how) { \
- if (M_LEADINGSPACE(m) >= (plen)) { \
- (m)->m_data -= (plen); \
- (m)->m_len += (plen); \
- } else \
- (m) = m_prepend((m), (plen), (how)); \
- if ((m) && (m)->m_flags & M_PKTHDR) \
- (m)->m_pkthdr.len += (plen); \
-}
-
-/* change mbuf to new type */
-#define MCHTYPE(m, t) { \
- MBUFLOCK(mbstat.m_mtypes[(m)->m_type]--; mbstat.m_mtypes[t]++;) \
- (m)->m_type = t;\
-}
-
-/* length to m_copy to copy all */
-#define M_COPYALL 1000000000
-
-/* compatibility with 4.3 */
-#define m_copy(m, o, l) m_copym((m), (o), (l), M_DONTWAIT)
-
-/*
- * Mbuf statistics.
- */
-struct mbstat {
- u_long m_mbufs; /* mbufs obtained from page pool */
- u_long m_clusters; /* clusters obtained from page pool */
- u_long m_spare; /* spare field */
- u_long m_clfree; /* free clusters */
- u_long m_drops; /* times failed to find space */
- u_long m_wait; /* times waited for space */
- u_long m_drain; /* times drained protocols for space */
- u_short m_mtypes[256]; /* type specific mbuf allocations */
-};
-
-#ifdef KERNEL
-extern struct mbuf *mbutl; /* virtual address of mclusters */
-extern char *mclrefcnt; /* cluster reference counts */
-extern struct mbstat mbstat;
-extern int nmbclusters;
-extern int nmbufs;
-extern struct mbuf *mmbfree;
-extern union mcluster *mclfree;
-extern int max_linkhdr; /* largest link-level header */
-extern int max_protohdr; /* largest protocol header */
-extern int max_hdr; /* largest link+protocol header */
-extern int max_datalen; /* MHLEN - max_hdr */
-extern int mbtypes[]; /* XXX */
-
-struct mbuf *m_copym __P((struct mbuf *, int, int, int));
-struct mbuf *m_copypacket __P((struct mbuf *, int));
-struct mbuf *m_devget __P((char *, int, int, struct ifnet *,
- void (*copy)(char *, caddr_t, u_int)));
-struct mbuf *m_free __P((struct mbuf *));
-struct mbuf *m_get __P((int, int));
-struct mbuf *m_getclr __P((int, int));
-struct mbuf *m_gethdr __P((int, int));
-struct mbuf *m_prepend __P((struct mbuf *,int,int));
-struct mbuf *m_pullup __P((struct mbuf *, int));
-struct mbuf *m_retry __P((int, int));
-struct mbuf *m_retryhdr __P((int, int));
-struct mbuf *m_split __P((struct mbuf *,int,int));
-void m_adj __P((struct mbuf *, int));
-void m_cat __P((struct mbuf *,struct mbuf *));
-int m_mballoc __P((int, int));
-int m_clalloc __P((int, int));
-void m_copyback __P((struct mbuf *, int, int, caddr_t));
-void m_copydata __P((struct mbuf *,int,int,caddr_t));
-void m_freem __P((struct mbuf *));
-
-#ifdef MBTYPES
-int mbtypes[] = { /* XXX */
- M_FREE, /* MT_FREE 0 should be on free list */
- M_MBUF, /* MT_DATA 1 dynamic (data) allocation */
- M_MBUF, /* MT_HEADER 2 packet header */
- M_SOCKET, /* MT_SOCKET 3 socket structure */
- M_PCB, /* MT_PCB 4 protocol control block */
- M_RTABLE, /* MT_RTABLE 5 routing tables */
- M_HTABLE, /* MT_HTABLE 6 IMP host tables */
- 0, /* MT_ATABLE 7 address resolution tables */
- M_MBUF, /* MT_SONAME 8 socket name */
- 0, /* 9 */
- M_SOOPTS, /* MT_SOOPTS 10 socket options */
- M_FTABLE, /* MT_FTABLE 11 fragment reassembly header */
- M_MBUF, /* MT_RIGHTS 12 access rights */
- M_IFADDR, /* MT_IFADDR 13 interface address */
- M_MBUF, /* MT_CONTROL 14 extra-data protocol message */
- M_MBUF, /* MT_OOBDATA 15 expedited data */
-#ifdef DATAKIT
- 25, 26, 27, 28, 29, 30, 31, 32 /* datakit ugliness */
-#endif
-};
-#endif
-#endif
-
-#endif /* !_SYS_MBUF_H_ */
diff --git a/c/src/libnetworking/sys/mount.h b/c/src/libnetworking/sys/mount.h
deleted file mode 100644
index a6254e302d..0000000000
--- a/c/src/libnetworking/sys/mount.h
+++ /dev/null
@@ -1,531 +0,0 @@
-/*
- * Copyright (c) 1989, 1991, 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.
- *
- * @(#)mount.h 8.13 (Berkeley) 3/27/94
- * $Id$
- */
-
-#ifndef _SYS_MOUNT_H_
-#define _SYS_MOUNT_H_
-
-#ifndef KERNEL
-#include <sys/ucred.h>
-#endif
-#include <sys/queue.h>
-
-typedef struct fsid { long val[2]; } fsid_t; /* file system id type */
-
-/*
- * File identifier.
- * These are unique per filesystem on a single machine.
- */
-#define MAXFIDSZ 16
-
-struct fid {
- u_short fid_len; /* length of data in bytes */
- u_short fid_reserved; /* force longword alignment */
- char fid_data[MAXFIDSZ]; /* data (variable length) */
-};
-
-/*
- * file system statistics
- */
-
-#define MNAMELEN 90 /* length of buffer for returned name */
-
-struct statfs {
- long f_spare2; /* placeholder */
- long f_bsize; /* fundamental file system block size */
- long f_iosize; /* optimal transfer block size */
- long f_blocks; /* total data blocks in file system */
- long f_bfree; /* free blocks in fs */
- long f_bavail; /* free blocks avail to non-superuser */
- long f_files; /* total file nodes in file system */
- long f_ffree; /* free file nodes in fs */
- fsid_t f_fsid; /* file system id */
- uid_t f_owner; /* user that mounted the filesystem */
- int f_type; /* type of filesystem (see below) */
- int f_flags; /* copy of mount flags */
- long f_spare[6]; /* spare for later */
- char f_mntonname[MNAMELEN]; /* directory on which mounted */
- char f_mntfromname[MNAMELEN];/* mounted filesystem */
-};
-
-/*
- * File system types.
- */
-#define MOUNT_NONE 0
-#define MOUNT_UFS 1 /* Fast Filesystem */
-#define MOUNT_NFS 2 /* Sun-compatible Network Filesystem */
-#define MOUNT_MFS 3 /* Memory-based Filesystem */
-#define MOUNT_MSDOS 4 /* MS/DOS Filesystem */
-#define MOUNT_LFS 5 /* Log-based Filesystem */
-#define MOUNT_LOFS 6 /* Loopback Filesystem */
-#define MOUNT_FDESC 7 /* File Descriptor Filesystem */
-#define MOUNT_PORTAL 8 /* Portal Filesystem */
-#define MOUNT_NULL 9 /* Minimal Filesystem Layer */
-#define MOUNT_UMAP 10 /* User/Group Identifier Remapping Filesystem */
-#define MOUNT_KERNFS 11 /* Kernel Information Filesystem */
-#define MOUNT_PROCFS 12 /* /proc Filesystem */
-#define MOUNT_AFS 13 /* Andrew Filesystem */
-#define MOUNT_CD9660 14 /* ISO9660 (aka CDROM) Filesystem */
-#define MOUNT_UNION 15 /* Union (translucent) Filesystem */
-#define MOUNT_DEVFS 16 /* existing device Filesystem */
-#define MOUNT_EXT2FS 17 /* Linux EXT2FS */
-#define MOUNT_TFS 18 /* Netcon Novell filesystem */
-#define MOUNT_CFS 19 /* Coda filesystem */
-#define MOUNT_MAXTYPE 19
-
-#define INITMOUNTNAMES { \
- "none", /* 0 MOUNT_NONE */ \
- "ufs", /* 1 MOUNT_UFS */ \
- "nfs", /* 2 MOUNT_NFS */ \
- "mfs", /* 3 MOUNT_MFS */ \
- "msdos", /* 4 MOUNT_MSDOS */ \
- "lfs", /* 5 MOUNT_LFS */ \
- "lofs", /* 6 MOUNT_LOFS */ \
- "fdesc", /* 7 MOUNT_FDESC */ \
- "portal", /* 8 MOUNT_PORTAL */ \
- "null", /* 9 MOUNT_NULL */ \
- "umap", /* 10 MOUNT_UMAP */ \
- "kernfs", /* 11 MOUNT_KERNFS */ \
- "procfs", /* 12 MOUNT_PROCFS */ \
- "afs", /* 13 MOUNT_AFS */ \
- "cd9660", /* 14 MOUNT_CD9660 */ \
- "union", /* 15 MOUNT_UNION */ \
- "devfs", /* 16 MOUNT_DEVFS */ \
- "ext2fs", /* 17 MOUNT_EXT2FS */ \
- "tfs", /* 18 MOUNT_TFS */ \
- "cfs", /* 19 MOUNT_CFS */ \
- 0, /* 20 MOUNT_SPARE */ \
-}
-
-/*
- * Structure per mounted file system. Each mounted file system has an
- * array of operations and an instance record. The file systems are
- * put on a doubly linked list.
- */
-LIST_HEAD(vnodelst, vnode);
-
-struct mount {
- CIRCLEQ_ENTRY(mount) mnt_list; /* mount list */
- struct vfsops *mnt_op; /* operations on fs */
- struct vfsconf *mnt_vfc; /* configuration info */
- struct vnode *mnt_vnodecovered; /* vnode we mounted on */
- struct vnodelst mnt_vnodelist; /* list of vnodes this mount */
- int mnt_flag; /* flags */
- int mnt_maxsymlinklen; /* max size of short symlink */
- struct statfs mnt_stat; /* cache of filesystem stats */
- qaddr_t mnt_data; /* private data */
-/* struct vfsconf *mnt_vfc; */ /* configuration info */
- time_t mnt_time; /* last time written*/
-};
-
-/*
- * Mount flags.
- *
- * Unmount uses MNT_FORCE flag.
- */
-#define MNT_RDONLY 0x00000001 /* read only filesystem */
-#define MNT_SYNCHRONOUS 0x00000002 /* file system written synchronously */
-#define MNT_NOEXEC 0x00000004 /* can't exec from filesystem */
-#define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */
-#define MNT_NODEV 0x00000010 /* don't interpret special files */
-#define MNT_UNION 0x00000020 /* union with underlying filesystem */
-#define MNT_ASYNC 0x00000040 /* file system written asynchronously */
-#define MNT_NOATIME 0x10000000 /* Disable update of file access times */
-
-/*
- * exported mount flags.
- */
-#define MNT_EXRDONLY 0x00000080 /* exported read only */
-#define MNT_EXPORTED 0x00000100 /* file system is exported */
-#define MNT_DEFEXPORTED 0x00000200 /* exported to the world */
-#define MNT_EXPORTANON 0x00000400 /* use anon uid mapping for everyone */
-#define MNT_EXKERB 0x00000800 /* exported with Kerberos uid mapping */
-
-/*
- * Flags set by internal operations.
- */
-#define MNT_LOCAL 0x00001000 /* filesystem is stored locally */
-#define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */
-#define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */
-#define MNT_USER 0x00008000 /* mounted by a user */
-
-/*
- * Mask of flags that are visible to statfs()
- */
-#define MNT_VISFLAGMASK (MNT_RDONLY|MNT_SYNCHRONOUS|MNT_NOEXEC|MNT_NOSUID| \
- MNT_NODEV|MNT_UNION|MNT_ASYNC|MNT_EXRDONLY|MNT_EXPORTED| \
- MNT_DEFEXPORTED|MNT_EXPORTANON|MNT_EXKERB|MNT_LOCAL| \
- MNT_QUOTA|MNT_ROOTFS|MNT_USER|MNT_NOATIME)
-
-/*
- * filesystem control flags.
- *
- * MNT_MLOCK lock the mount entry so that name lookup cannot proceed
- * past the mount point. This keeps the subtree stable during mounts
- * and unmounts.
- */
-#define MNT_UPDATE 0x00010000 /* not a real mount, just an update */
-#define MNT_DELEXPORT 0x00020000 /* delete export host lists */
-#define MNT_RELOAD 0x00040000 /* reload filesystem data */
-#define MNT_FORCE 0x00080000 /* force unmount or readonly change */
-#define MNT_MLOCK 0x00100000 /* lock so that subtree is stable */
-#define MNT_MWAIT 0x00200000 /* someone is waiting for lock */
-#define MNT_MPBUSY 0x00400000 /* scan of mount point in progress */
-#define MNT_MPWANT 0x00800000 /* waiting for mount point */
-#define MNT_UNMOUNT 0x01000000 /* unmount in progress */
-#define MNT_WANTRDWR 0x02000000 /* want upgrade to read/write */
-
-/*
- * used to get configured filesystems information
- */
-#define VFS_MAXNAMELEN 32
-struct vfsconf {
- void *vfc_vfsops;
- char vfc_name[VFS_MAXNAMELEN];
- int vfc_index;
- int vfc_refcount;
- int vfc_flags;
-};
-
-/*
- * NB: these flags refer to IMPLEMENTATION properties, not properties of
- * any actual mounts; i.e., it does not make sense to change the flags.
- */
-#define VFCF_STATIC 0x00000001 /* statically compiled into kernel */
-#define VFCF_NETWORK 0x00000002 /* may get data over the network */
-#define VFCF_READONLY 0x00000004 /* writes are not implemented */
-#define VFCF_SYNTHETIC 0x00000008 /* data does not represent real files */
-#define VFCF_LOOPBACK 0x00000010 /* aliases some other mounted FS */
-#define VFCF_UNICODE 0x00000020 /* stores file names as Unicode*/
-
-/*
- * Operations supported on mounted file system.
- */
-#ifdef KERNEL
-
-extern int doforce; /* Flag to permit forcible unmounting. */
-extern struct vfsconf void_vfsconf;
-extern struct vfsconf *vfsconf[];
-
-#ifdef __STDC__
-struct nameidata;
-struct mbuf;
-#endif
-
-struct vfsops {
- int (*vfs_mount) __P((struct mount *mp, char *path, caddr_t data,
- struct nameidata *ndp, struct proc *p));
- int (*vfs_start) __P((struct mount *mp, int flags,
- struct proc *p));
- int (*vfs_unmount) __P((struct mount *mp, int mntflags,
- struct proc *p));
- int (*vfs_root) __P((struct mount *mp, struct vnode **vpp));
- int (*vfs_quotactl) __P((struct mount *mp, int cmds, uid_t uid,
- caddr_t arg, struct proc *p));
- int (*vfs_statfs) __P((struct mount *mp, struct statfs *sbp,
- struct proc *p));
- int (*vfs_sync) __P((struct mount *mp, int waitfor,
- struct ucred *cred, struct proc *p));
- int (*vfs_vget) __P((struct mount *mp, ino_t ino,
- struct vnode **vpp));
- int (*vfs_fhtovp) __P((struct mount *mp, struct fid *fhp,
- struct mbuf *nam, struct vnode **vpp,
- int *exflagsp, struct ucred **credanonp));
- int (*vfs_vptofh) __P((struct vnode *vp, struct fid *fhp));
- int (*vfs_init) __P((void));
-};
-
-#define VFS_MOUNT(MP, PATH, DATA, NDP, P) \
- (*(MP)->mnt_op->vfs_mount)(MP, PATH, DATA, NDP, P)
-#define VFS_START(MP, FLAGS, P) (*(MP)->mnt_op->vfs_start)(MP, FLAGS, P)
-#define VFS_UNMOUNT(MP, FORCE, P) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE, P)
-#define VFS_ROOT(MP, VPP) (*(MP)->mnt_op->vfs_root)(MP, VPP)
-#define VFS_QUOTACTL(MP,C,U,A,P) (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A, P)
-#define VFS_STATFS(MP, SBP, P) (*(MP)->mnt_op->vfs_statfs)(MP, SBP, P)
-#define VFS_SYNC(MP, WAIT, C, P) (*(MP)->mnt_op->vfs_sync)(MP, WAIT, C, P)
-#define VFS_VGET(MP, INO, VPP) (*(MP)->mnt_op->vfs_vget)(MP, INO, VPP)
-#define VFS_FHTOVP(MP, FIDP, NAM, VPP, EXFLG, CRED) \
- (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, NAM, VPP, EXFLG, CRED)
-#define VFS_VPTOFH(VP, FIDP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP)
-
-#ifdef VFS_LKM
-#include <sys/conf.h>
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-#define VFS_SET(vfsops, fsname, index, flags) \
- static struct vfsconf _fs_vfsconf = { \
- &vfsops, \
- #fsname, \
- index, \
- 0, \
- flags \
- }; \
- extern struct linker_set MODVNOPS; \
- MOD_VFS(#fsname,index,&MODVNOPS,&_fs_vfsconf); \
- int \
- fsname ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \
- DISPATCH(lkmtp, cmd, ver, lkm_nullcmd, lkm_nullcmd, lkm_nullcmd); }
-#else
-
-#define VFS_SET(vfsops, fsname, index, flags) \
- static struct vfsconf _fs_vfsconf = { \
- &vfsops, \
- #fsname, \
- index, \
- 0, \
- flags | VFCF_STATIC \
- }; \
- DATA_SET(vfs_set,_fs_vfsconf)
-#endif /* VFS_LKM */
-
-#endif /* KERNEL */
-
-/*
- * Flags for various system call interfaces.
- *
- * waitfor flags to vfs_sync() and getfsstat()
- */
-#define MNT_WAIT 1
-#define MNT_NOWAIT 2
-
-/*
- * Generic file handle
- */
-struct fhandle {
- fsid_t fh_fsid; /* File system id of mount point */
- struct fid fh_fid; /* File sys specific id */
-};
-typedef struct fhandle fhandle_t;
-
-#ifdef KERNEL
-#include <net/radix.h>
-#include <sys/socket.h> /* XXX for AF_MAX */
-
-/*
- * Network address lookup element
- */
-struct netcred {
- struct radix_node netc_rnodes[2];
- int netc_exflags;
- struct ucred netc_anon;
-};
-
-/*
- * Network export information
- */
-struct netexport {
- struct netcred ne_defexported; /* Default export */
- struct radix_node_head *ne_rtable[AF_MAX+1]; /* Individual exports */
-};
-#endif /* KERNEL */
-
-/*
- * Export arguments for local filesystem mount calls.
- */
-struct export_args {
- int ex_flags; /* export related flags */
- uid_t ex_root; /* mapping for root uid */
- struct ucred ex_anon; /* mapping for anonymous user */
- struct sockaddr *ex_addr; /* net address to which exported */
- int ex_addrlen; /* and the net address length */
- struct sockaddr *ex_mask; /* mask of valid bits in saddr */
- int ex_masklen; /* and the smask length */
-};
-
-/*
- * Arguments to mount UFS-based filesystems
- */
-struct ufs_args {
- char *fspec; /* block special device to mount */
- struct export_args export; /* network export information */
-};
-
-#ifdef MFS
-/*
- * Arguments to mount MFS
- */
-struct mfs_args {
- char *fspec; /* name to export for statfs */
- struct export_args export; /* if exported MFSes are supported */
- caddr_t base; /* base of file system in memory */
- u_long size; /* size of file system */
-};
-#endif /* MFS */
-
-#ifdef MSDOSFS
-/*
- * Arguments to mount MSDOS filesystems.
- */
-struct msdosfs_args {
- char *fspec; /* blocks special holding the fs to mount */
- struct export_args export; /* network export information */
- uid_t uid; /* uid that owns msdosfs files */
- gid_t gid; /* gid that owns msdosfs files */
- mode_t mask; /* mask to be applied for msdosfs perms */
-};
-#endif
-
-#ifdef CD9660
-/*
- * Arguments to mount ISO 9660 filesystems.
- */
-struct iso_args {
- char *fspec; /* block special device to mount */
- struct export_args export; /* network export info */
- int flags; /* mounting flags, see below */
- int ssector; /* starting sector */
-
-};
-#define ISOFSMNT_NORRIP 0x00000001 /* disable Rock Ridge Ext.*/
-#define ISOFSMNT_GENS 0x00000002 /* enable generation numbers */
-#define ISOFSMNT_EXTATT 0x00000004 /* enable extended attributes */
-#endif /* CD9660 */
-
-#ifdef NFS
-/*
- * Arguments to mount NFS
- */
-struct nfs_args {
- struct sockaddr *addr; /* file server address */
- int addrlen; /* length of address */
- int sotype; /* Socket type */
- int proto; /* and Protocol */
- u_char *fh; /* File handle to be mounted */
- int fhsize; /* Size, in bytes, of fh */
- int flags; /* flags */
- int wsize; /* write size in bytes */
- int rsize; /* read size in bytes */
- int readdirsize; /* readdir size in bytes */
- int timeo; /* initial timeout in .1 secs */
- int retrans; /* times to retry send */
- int maxgrouplist; /* Max. size of group list */
- int readahead; /* # of blocks to readahead */
- int leaseterm; /* Term (sec) of lease */
- int deadthresh; /* Retrans threshold */
- char *hostname; /* server's name */
-};
-
-/*
- * NFS mount option flags
- */
-#define NFSMNT_SOFT 0x00000001 /* soft mount (hard is default) */
-#define NFSMNT_WSIZE 0x00000002 /* set write size */
-#define NFSMNT_RSIZE 0x00000004 /* set read size */
-#define NFSMNT_TIMEO 0x00000008 /* set initial timeout */
-#define NFSMNT_RETRANS 0x00000010 /* set number of request retrys */
-#define NFSMNT_MAXGRPS 0x00000020 /* set maximum grouplist size */
-#define NFSMNT_INT 0x00000040 /* allow interrupts on hard mount */
-#define NFSMNT_NOCONN 0x00000080 /* Don't Connect the socket */
-#define NFSMNT_NQNFS 0x00000100 /* Use Nqnfs protocol */
-#define NFSMNT_NFSV3 0x00000200 /* Use NFS Version 3 protocol */
-#define NFSMNT_KERB 0x00000400 /* Use Kerberos authentication */
-#define NFSMNT_DUMBTIMR 0x00000800 /* Don't estimate rtt dynamically */
-#define NFSMNT_LEASETERM 0x00001000 /* set lease term (nqnfs) */
-#define NFSMNT_READAHEAD 0x00002000 /* set read ahead */
-#define NFSMNT_DEADTHRESH 0x00004000 /* set dead server retry thresh */
-#define NFSMNT_RESVPORT 0x00008000 /* Allocate a reserved port */
-#define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */
-#define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */
-#define NFSMNT_INTERNAL 0xfffc0000 /* Bits set internally */
-#define NFSMNT_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */
-#define NFSMNT_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */
-#define NFSMNT_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */
-#define NFSMNT_MNTD 0x00200000 /* Mnt server for mnt point */
-#define NFSMNT_DISMINPROG 0x00400000 /* Dismount in progress */
-#define NFSMNT_DISMNT 0x00800000 /* Dismounted */
-#define NFSMNT_SNDLOCK 0x01000000 /* Send socket lock */
-#define NFSMNT_WANTSND 0x02000000 /* Want above */
-#define NFSMNT_RCVLOCK 0x04000000 /* Rcv socket lock */
-#define NFSMNT_WANTRCV 0x08000000 /* Want above */
-#define NFSMNT_WAITAUTH 0x10000000 /* Wait for authentication */
-#define NFSMNT_HASAUTH 0x20000000 /* Has authenticator */
-#define NFSMNT_WANTAUTH 0x40000000 /* Wants an authenticator */
-#define NFSMNT_AUTHERR 0x80000000 /* Authentication error */
-#endif /* NFS */
-
-#ifdef KERNEL
-extern int (*mountroot) __P((void *));
-extern struct vfsops *mountrootvfsops;
-
-/*
- * exported vnode operations
- */
-int dounmount __P((struct mount *, int, struct proc *));
-struct mount *getvfs __P((fsid_t *)); /* return vfs given fsid */
-void getnewfsid __P((struct mount *, int));
-int vflush __P((struct mount *, struct vnode *, int));
-int vfs_export /* process mount export info */
- __P((struct mount *, struct netexport *, struct export_args *));
-struct netcred *vfs_export_lookup /* lookup host in fs export list */
- __P((struct mount *, struct netexport *, struct mbuf *));
-int vfs_lock __P((struct mount *)); /* lock a vfs */
-int vfs_mountedon __P((struct vnode *)); /* is a vfs mounted on vp */
-int vfs_mountroot __P((void *)); /* XXX goes away? */
-void vfs_msync __P((struct mount *, int));
-void vfs_unlock __P((struct mount *)); /* unlock a vfs */
-void vfs_unmountall __P((void));
-int vfs_busy __P((struct mount *)); /* mark a vfs busy */
-void vfs_unbusy __P((struct mount *)); /* mark a vfs not busy */
-extern CIRCLEQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */
-extern struct vfsops *vfssw[]; /* filesystem type table */
-
-#else /* KERNEL */
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int fstatfs __P((int, struct statfs *));
-int getfh __P((const char *, fhandle_t *));
-int getfsstat __P((struct statfs *, long, int));
-int getmntinfo __P((struct statfs **, int));
-int mount __P((int, const char *, int, void *));
-int statfs __P((const char *, struct statfs *));
-int unmount __P((const char *, int));
-
-/* C library stuff */
-struct vfsconf *getvfsbyname __P((const char *));
-struct vfsconf *getvfsbytype __P((int));
-struct vfsconf *getvfsent __P((void));
-void setvfsent __P((int));
-void endvfsent __P((void));
-int vfsisloadable __P((const char *));
-int vfsload __P((const char *));
-__END_DECLS
-
-#endif /* KERNEL */
-
-#endif /* !_SYS_MOUNT_H_ */
diff --git a/c/src/libnetworking/sys/param.h b/c/src/libnetworking/sys/param.h
deleted file mode 100644
index 21a9758520..0000000000
--- a/c/src/libnetworking/sys/param.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)param.h 8.3 (Berkeley) 4/4/95
- * $Id$
- */
-
-#ifndef _SYS_PARAM_H_
-#define _SYS_PARAM_H_
-
-#include <unistd.h>
-
-#define BSD 199506 /* System version (year & month). */
-#define BSD4_3 1
-#define BSD4_4 1
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef LOCORE
-#include <sys/types.h>
-#endif
-
-/*
- * Machine-independent constants (some used in following include files).
- * Redefined constants are from POSIX 1003.1 limits file.
- *
- * MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>)
- * MAXLOGNAME should be >= UT_NAMESIZE (see <utmp.h>)
- */
-#include <sys/syslimits.h>
-
-#define MAXCOMLEN 16 /* max command name remembered */
-#define MAXINTERP 32 /* max interpreter file name length */
-#define MAXLOGNAME 12 /* max login name length */
-#define MAXUPRC CHILD_MAX /* max simultaneous processes */
-#define NCARGS ARG_MAX /* max bytes for an exec function */
-#define NGROUPS NGROUPS_MAX /* max number groups */
-#define NOFILE OPEN_MAX /* max open files per process */
-#define NOGROUP 65535 /* marker for empty group set member */
-#define MAXHOSTNAMELEN 256 /* max hostname size */
-
-/* More types and definitions used throughout the kernel. */
-#ifdef KERNEL
-#include <sys/cdefs.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/ucred.h>
-#include <sys/uio.h>
-#include <sys/rtprio.h>
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-#endif
-
-/* Signals. */
-#include <sys/signal.h>
-
-/* Machine type dependent parameters. */
-#include <machine/param.h>
-#include <machine/limits.h>
-
-/*
- * Priorities. Note that with 32 run queues, differences less than 4 are
- * insignificant.
- */
-#define PSWP 0
-#define PVM 4
-#define PINOD 8
-#define PRIBIO 16
-#define PVFS 20
-#define PZERO 22 /* No longer magic, shouldn't be here. XXX */
-#define PSOCK 24
-#define PWAIT 32
-#define PLOCK 36
-#define PPAUSE 40
-#define PUSER 50
-#define MAXPRI 127 /* Priorities range from 0 through MAXPRI. */
-
-#define PRIMASK 0x0ff
-#define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */
-
-#define NZERO 0 /* default "nice" */
-
-#define NBPW sizeof(int) /* number of bytes per word (integer) */
-
-#define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */
-#define NODEV (dev_t)(-1) /* non-existent device */
-
-/*
- * Clustering of hardware pages on machines with ridiculously small
- * page sizes is done here. The paging subsystem deals with units of
- * CLSIZE pte's describing PAGE_SIZE (from machine/machparam.h) pages each.
- */
-#if 0
-#define CLBYTES (CLSIZE*PAGE_SIZE)
-#endif
-
-#define CBLOCK 128 /* Clist block size, must be a power of 2. */
-#define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */
- /* Data chars/clist. */
-#define CBSIZE (CBLOCK - sizeof(struct cblock *) - CBQSIZE)
-#define CROUND (CBLOCK - 1) /* Clist rounding. */
-
-/*
- * File system parameters and macros.
- *
- * The file system is made out of blocks of at most MAXBSIZE units, with
- * smaller units (fragments) only in the last direct block. MAXBSIZE
- * primarily determines the size of buffers in the buffer pool. It may be
- * made larger without any effect on existing file systems; however making
- * it smaller make make some file systems unmountable. Also, MAXBSIZE
- * must be less than MAXPHYS!!! DFLTBSIZE is the average amount of
- * memory allocated by vfs_bio per nbuf. BKVASIZE is the average amount
- * of kernel virtual space allocated per nbuf. BKVASIZE should be >=
- * DFLTBSIZE. If it is significantly bigger than DFLTBSIZE, then
- * kva fragmentation causes fewer performance problems.
- */
-#define MAXBSIZE 65536
-#define BKVASIZE 8192
-#define DFLTBSIZE 4096
-#define MAXFRAG 8
-
-/*
- * MAXPATHLEN defines the longest permissible path length after expanding
- * symbolic links. It is used to allocate a temporary buffer from the buffer
- * pool in which to do the name expansion, hence should be a power of two,
- * and must be less than or equal to MAXBSIZE. MAXSYMLINKS defines the
- * maximum number of symbolic links that may be expanded in a path name.
- * It should be set high enough to allow all legitimate uses, but halt
- * infinite loops reasonably quickly.
- */
-#if !defined(__rtems__)
-#define MAXPATHLEN PATH_MAX
-#endif
-#define MAXSYMLINKS 32
-
-/* Bit map related macros. */
-#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
-#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
-#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
-#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
-
-/* Macros for counting and rounding. */
-#ifndef howmany
-#define howmany(x, y) (((x)+((y)-1))/(y))
-#endif
-#define rounddown(x, y) (((x)/(y))*(y))
-#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */
-#define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */
-#define powerof2(x) ((((x)-1)&(x))==0)
-
-/* Macros for min/max. */
-#ifndef KERNEL
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#endif
-
-/*
- * Constants for setting the parameters of the kernel memory allocator.
- *
- * 2 ** MINBUCKET is the smallest unit of memory that will be
- * allocated. It must be at least large enough to hold a pointer.
- *
- * Units of memory less or equal to MAXALLOCSAVE will permanently
- * allocate physical memory; requests for these size pieces of
- * memory are quite fast. Allocations greater than MAXALLOCSAVE must
- * always allocate and free physical memory; requests for these
- * size allocations should be done infrequently as they will be slow.
- *
- * Constraints: PAGE_SIZE <= MAXALLOCSAVE <= 2 ** (MINBUCKET + 14), and
- * MAXALLOCSIZE must be a power of two.
- */
-#define MINBUCKET 4 /* 4 => min allocation of 16 bytes */
-#define MAXALLOCSAVE (2 * PAGE_SIZE)
-
-/*
- * Scale factor for scaled integers used to count %cpu time and load avgs.
- *
- * The number of CPU `tick's that map to a unique `%age' can be expressed
- * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that
- * can be calculated (assuming 32 bits) can be closely approximated using
- * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15).
- *
- * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age',
- * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024.
- */
-#define FSHIFT 11 /* bits to right of fixed binary point */
-#define FSCALE (1<<FSHIFT)
-
-#endif /* _SYS_PARAM_H_ */
diff --git a/c/src/libnetworking/sys/proc.h b/c/src/libnetworking/sys/proc.h
deleted file mode 100644
index 2189a33b11..0000000000
--- a/c/src/libnetworking/sys/proc.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Dummy structure
- *
- * $Id$
- */
-struct proc {
- int this_should_never_be_referenced;
-};
diff --git a/c/src/libnetworking/sys/protosw.h b/c/src/libnetworking/sys/protosw.h
deleted file mode 100644
index a7aa52feea..0000000000
--- a/c/src/libnetworking/sys/protosw.h
+++ /dev/null
@@ -1,300 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)protosw.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_PROTOSW_H_
-#define _SYS_PROTOSW_H_
-
-struct ifnet;
-struct mbuf;
-struct sockaddr;
-struct socket;
-struct sockproto;
-struct stat;
-
-/*
- * Protocol switch table.
- *
- * Each protocol has a handle initializing one of these structures,
- * which is used for protocol-protocol and system-protocol communication.
- *
- * A protocol is called through the pr_init entry before any other.
- * Thereafter it is called every 200ms through the pr_fasttimo entry and
- * every 500ms through the pr_slowtimo for timer based actions.
- * The system will call the pr_drain entry if it is low on space and
- * this should throw away any non-critical data.
- *
- * Protocols pass data between themselves as chains of mbufs using
- * the pr_input and pr_output hooks. Pr_input passes data up (towards
- * UNIX) and pr_output passes it down (towards the imps); control
- * information passes up and down on pr_ctlinput and pr_ctloutput.
- * The protocol is responsible for the space occupied by any the
- * arguments to these entries and must dispose it.
- *
- * The userreq routine interfaces protocols to the system and is
- * described below.
- */
-struct protosw {
- short pr_type; /* socket type used for */
- struct domain *pr_domain; /* domain protocol a member of */
- short pr_protocol; /* protocol number */
- short pr_flags; /* see below */
-/* protocol-protocol hooks */
- void (*pr_input) __P((struct mbuf *, int len));
- /* input to protocol (from below) */
- int (*pr_output) __P((struct mbuf *m, struct socket *so));
- /* output to protocol (from above) */
- void (*pr_ctlinput)__P((int, struct sockaddr *, void *));
- /* control input (from below) */
- int (*pr_ctloutput)__P((int, struct socket *, int, int,
- struct mbuf **));
- /* control output (from above) */
-/* user-protocol hook */
- int (*pr_ousrreq) __P((struct socket *, int, struct mbuf *,
- struct mbuf *, struct mbuf *));
- /* user request: see list below */
-/* utility hooks */
- void (*pr_init) __P((void)); /* initialization hook */
- void (*pr_fasttimo) __P((void));
- /* fast timeout (200ms) */
- void (*pr_slowtimo) __P((void));
- /* slow timeout (500ms) */
- void (*pr_drain) __P((void));
- /* flush any excess space possible */
- struct pr_usrreqs *pr_usrreqs; /* supersedes pr_usrreq() */
-};
-
-#define PR_SLOWHZ 2 /* 2 slow timeouts per second */
-#define PR_FASTHZ 5 /* 5 fast timeouts per second */
-
-/*
- * Values for pr_flags.
- * PR_ADDR requires PR_ATOMIC;
- * PR_ADDR and PR_CONNREQUIRED are mutually exclusive.
- * PR_IMPLOPCL means that the protocol allows sendto without prior connect,
- * and the protocol understands the MSG_EOF flag. The first property is
- * is only relevant if PR_CONNREQUIRED is set (otherwise sendto is allowed
- * anyhow).
- */
-#define PR_ATOMIC 0x01 /* exchange atomic messages only */
-#define PR_ADDR 0x02 /* addresses given with messages */
-#define PR_CONNREQUIRED 0x04 /* connection required by protocol */
-#define PR_WANTRCVD 0x08 /* want PRU_RCVD calls */
-#define PR_RIGHTS 0x10 /* passes capabilities */
-#define PR_IMPLOPCL 0x20 /* implied open/close */
-
-/*
- * The arguments to usrreq are:
- * (*protosw[].pr_usrreq)(up, req, m, nam, opt);
- * where up is a (struct socket *), req is one of these requests,
- * m is a optional mbuf chain containing a message,
- * nam is an optional mbuf chain containing an address,
- * and opt is a pointer to a socketopt structure or nil.
- * The protocol is responsible for disposal of the mbuf chain m,
- * the caller is responsible for any space held by nam and opt.
- * A non-zero return from usrreq gives an
- * UNIX error number which should be passed to higher level software.
- */
-#define PRU_ATTACH 0 /* attach protocol to up */
-#define PRU_DETACH 1 /* detach protocol from up */
-#define PRU_BIND 2 /* bind socket to address */
-#define PRU_LISTEN 3 /* listen for connection */
-#define PRU_CONNECT 4 /* establish connection to peer */
-#define PRU_ACCEPT 5 /* accept connection from peer */
-#define PRU_DISCONNECT 6 /* disconnect from peer */
-#define PRU_SHUTDOWN 7 /* won't send any more data */
-#define PRU_RCVD 8 /* have taken data; more room now */
-#define PRU_SEND 9 /* send this data */
-#define PRU_ABORT 10 /* abort (fast DISCONNECT, DETATCH) */
-#define PRU_CONTROL 11 /* control operations on protocol */
-#define PRU_SENSE 12 /* return status into m */
-#define PRU_RCVOOB 13 /* retrieve out of band data */
-#define PRU_SENDOOB 14 /* send out of band data */
-#define PRU_SOCKADDR 15 /* fetch socket's address */
-#define PRU_PEERADDR 16 /* fetch peer's address */
-#define PRU_CONNECT2 17 /* connect two sockets */
-/* begin for protocols internal use */
-#define PRU_FASTTIMO 18 /* 200ms timeout */
-#define PRU_SLOWTIMO 19 /* 500ms timeout */
-#define PRU_PROTORCV 20 /* receive from below */
-#define PRU_PROTOSEND 21 /* send to below */
-/* end for protocol's internal use */
-#define PRU_SEND_EOF 22 /* send and close */
-#define PRU_NREQ 22
-
-#ifdef PRUREQUESTS
-char *prurequests[] = {
- "ATTACH", "DETACH", "BIND", "LISTEN",
- "CONNECT", "ACCEPT", "DISCONNECT", "SHUTDOWN",
- "RCVD", "SEND", "ABORT", "CONTROL",
- "SENSE", "RCVOOB", "SENDOOB", "SOCKADDR",
- "PEERADDR", "CONNECT2", "FASTTIMO", "SLOWTIMO",
- "PROTORCV", "PROTOSEND",
- "SEND_EOF",
-};
-#endif
-
-#ifdef KERNEL /* users shouldn't see this decl */
-struct stat;
-struct ifnet;
-
-/*
- * If the ordering here looks odd, that's because it's alphabetical.
- */
-struct pr_usrreqs {
- int (*pru_abort) __P((struct socket *so));
- int (*pru_accept) __P((struct socket *so, struct mbuf *nam));
- int (*pru_attach) __P((struct socket *so, int proto));
- int (*pru_bind) __P((struct socket *so, struct mbuf *nam));
- int (*pru_connect) __P((struct socket *so, struct mbuf *nam));
- int (*pru_connect2) __P((struct socket *so1, struct socket *so2));
- int (*pru_control) __P((struct socket *so, int cmd, caddr_t data,
- struct ifnet *ifp));
- int (*pru_detach) __P((struct socket *so));
- int (*pru_disconnect) __P((struct socket *so));
- int (*pru_listen) __P((struct socket *so));
- int (*pru_peeraddr) __P((struct socket *so, struct mbuf *nam));
- int (*pru_rcvd) __P((struct socket *so, int flags));
- int (*pru_rcvoob) __P((struct socket *so, struct mbuf *m,
- int flags));
- /*
- * The `m' parameter here is almost certainly going to become a
- * `struct uio' at some point in the future. Similar changes
- * will probably happen for the receive entry points.
- */
- int (*pru_send) __P((struct socket *so, int flags, struct mbuf *m,
- struct mbuf *addr, struct mbuf *control));
-#define PRUS_OOB 0x1
-#define PRUS_EOF 0x2
- int (*pru_sense) __P((struct socket *so, struct stat *sb));
- int (*pru_shutdown) __P((struct socket *so));
- int (*pru_sockaddr) __P((struct socket *so, struct mbuf *nam));
-};
-
-int pru_accept_notsupp __P((struct socket *so, struct mbuf *nam));
-int pru_connect2_notsupp __P((struct socket *so1, struct socket *so2));
-int pru_control_notsupp __P((struct socket *so, int cmd, caddr_t data,
- struct ifnet *ifp));
-int pru_listen_notsupp __P((struct socket *so));
-int pru_rcvd_notsupp __P((struct socket *so, int flags));
-int pru_rcvoob_notsupp __P((struct socket *so, struct mbuf *m, int flags));
-int pru_sense_null __P((struct socket *so, struct stat *sb));
-
-#define PRU_OLDSTYLE
-
-#ifdef PRU_OLDSTYLE
-/*
- * Protocols which don't yet implement pr_usrreqs can point it to this
- * structure, which will call the old pr_usrreq() entry point with the
- * appropriate arguments.
- */
-extern struct pr_usrreqs pru_oldstyle;
-#endif /* PRU_OLDSTYLE */
-
-#endif /* KERNEL */
-
-/*
- * The arguments to the ctlinput routine are
- * (*protosw[].pr_ctlinput)(cmd, sa, arg);
- * where cmd is one of the commands below, sa is a pointer to a sockaddr,
- * and arg is a `void *' argument used within a protocol family.
- */
-#define PRC_IFDOWN 0 /* interface transition */
-#define PRC_ROUTEDEAD 1 /* select new route if possible ??? */
-#define PRC_QUENCH2 3 /* DEC congestion bit says slow down */
-#define PRC_QUENCH 4 /* some one said to slow down */
-#define PRC_MSGSIZE 5 /* message size forced drop */
-#define PRC_HOSTDEAD 6 /* host appears to be down */
-#define PRC_HOSTUNREACH 7 /* deprecated (use PRC_UNREACH_HOST) */
-#define PRC_UNREACH_NET 8 /* no route to network */
-#define PRC_UNREACH_HOST 9 /* no route to host */
-#define PRC_UNREACH_PROTOCOL 10 /* dst says bad protocol */
-#define PRC_UNREACH_PORT 11 /* bad port # */
-/* was PRC_UNREACH_NEEDFRAG 12 (use PRC_MSGSIZE) */
-#define PRC_UNREACH_SRCFAIL 13 /* source route failed */
-#define PRC_REDIRECT_NET 14 /* net routing redirect */
-#define PRC_REDIRECT_HOST 15 /* host routing redirect */
-#define PRC_REDIRECT_TOSNET 16 /* redirect for type of service & net */
-#define PRC_REDIRECT_TOSHOST 17 /* redirect for tos & host */
-#define PRC_TIMXCEED_INTRANS 18 /* packet lifetime expired in transit */
-#define PRC_TIMXCEED_REASS 19 /* lifetime expired on reass q */
-#define PRC_PARAMPROB 20 /* header incorrect */
-
-#define PRC_NCMDS 21
-
-#define PRC_IS_REDIRECT(cmd) \
- ((cmd) >= PRC_REDIRECT_NET && (cmd) <= PRC_REDIRECT_TOSHOST)
-
-#ifdef PRCREQUESTS
-char *prcrequests[] = {
- "IFDOWN", "ROUTEDEAD", "#2", "DEC-BIT-QUENCH2",
- "QUENCH", "MSGSIZE", "HOSTDEAD", "#7",
- "NET-UNREACH", "HOST-UNREACH", "PROTO-UNREACH", "PORT-UNREACH",
- "#12", "SRCFAIL-UNREACH", "NET-REDIRECT", "HOST-REDIRECT",
- "TOSNET-REDIRECT", "TOSHOST-REDIRECT", "TX-INTRANS", "TX-REASS",
- "PARAMPROB"
-};
-#endif
-
-/*
- * The arguments to ctloutput are:
- * (*protosw[].pr_ctloutput)(req, so, level, optname, optval);
- * req is one of the actions listed below, so is a (struct socket *),
- * level is an indication of which protocol layer the option is intended.
- * optname is a protocol dependent socket option request,
- * optval is a pointer to a mbuf-chain pointer, for value-return results.
- * The protocol is responsible for disposal of the mbuf chain *optval
- * if supplied,
- * the caller is responsible for any space held by *optval, when returned.
- * A non-zero return from usrreq gives an
- * UNIX error number which should be passed to higher level software.
- */
-#define PRCO_GETOPT 0
-#define PRCO_SETOPT 1
-
-#define PRCO_NCMDS 2
-
-#ifdef PRCOREQUESTS
-char *prcorequests[] = {
- "GETOPT", "SETOPT",
-};
-#endif
-
-#ifdef KERNEL
-struct protosw *pffindproto __P((int family, int protocol, int type));
-struct protosw *pffindtype __P((int family, int type));
-#endif
-
-#endif
diff --git a/c/src/libnetworking/sys/queue.h b/c/src/libnetworking/sys/queue.h
deleted file mode 100644
index e8aa08cf5d..0000000000
--- a/c/src/libnetworking/sys/queue.h
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * Copyright (c) 1991, 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.
- *
- * @(#)queue.h 8.5 (Berkeley) 8/20/94
- * $Id$
- */
-
-#ifndef _SYS_QUEUE_H_
-#define _SYS_QUEUE_H_
-
-/*
- * This file defines five types of data structures: singly-linked lists,
- * slingly-linked tail queues, lists, tail queues, and circular queues.
- *
- * A singly-linked list is headed by a single forward pointer. The elements
- * are singly linked for minimum space and pointer manipulation overhead at
- * the expense of O(n) removal for arbitrary elements. New elements can be
- * added to the list after an existing element or at the head of the list.
- * Elements being removed from the head of the list should use the explicit
- * macro for this purpose for optimum efficiency. A singly-linked list may
- * only be traversed in the forward direction. Singly-linked lists are ideal
- * for applications with large datasets and few or no removals or for
- * implementing a LIFO queue.
- *
- * A singly-linked tail queue is headed by a pair of pointers, one to the
- * head of the list and the other to the tail of the list. The elements are
- * singly linked for minimum space and pointer manipulation overhead at the
- * expense of O(n) removal for arbitrary elements. New elements can be added
- * to the list after an existing element, at the head of the list, or at the
- * end of the list. Elements being removed from the head of the tail queue
- * should use the explicit macro for this purpose for optimum efficiency.
- * A singly-linked tail queue may only be traversed in the forward direction.
- * Singly-linked tail queues are ideal for applications with large datasets
- * and few or no removals or for implementing a FIFO queue.
- *
- * A list is headed by a single forward pointer (or an array of forward
- * pointers for a hash table header). The elements are doubly linked
- * so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before
- * or after an existing element or at the head of the list. A list
- * may only be traversed in the forward direction.
- *
- * A tail queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or
- * after an existing element, at the head of the list, or at the end of
- * the list. A tail queue may only be traversed in the forward direction.
- *
- * A circle queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or after
- * an existing element, at the head of the list, or at the end of the list.
- * A circle queue may be traversed in either direction, but has a more
- * complex end of list detection.
- *
- * For details on the use of these macros, see the queue(3) manual page.
- */
-
-/*
- * Singly-linked List definitions.
- */
-#define SLIST_HEAD(name, type) \
-struct name { \
- struct type *slh_first; /* first element */ \
-}
-
-#define SLIST_ENTRY(type) \
-struct { \
- struct type *sle_next; /* next element */ \
-}
-
-/*
- * Singly-linked List functions.
- */
-#define SLIST_INIT(head) { \
- (head)->slh_first = NULL; \
-}
-
-#define SLIST_INSERT_AFTER(slistelm, elm, field) { \
- (elm)->field.sle_next = (slistelm)->field.sle_next; \
- (slistelm)->field.sle_next = (elm); \
-}
-
-#define SLIST_INSERT_HEAD(head, elm, field) { \
- (elm)->field.sle_next = (head)->slh_first; \
- (head)->slh_first = (elm); \
-}
-
-#define SLIST_REMOVE_HEAD(head, field) { \
- (head)->slh_first = (head)->slh_first->field.sle_next; \
-}
-
-#define SLIST_REMOVE(head, elm, type, field) { \
- if ((head)->slh_first == (elm)) { \
- SLIST_REMOVE_HEAD((head), field); \
- } \
- else { \
- struct type *curelm = (head)->slh_first; \
- while( curelm->field.sle_next != (elm) ) \
- curelm = curelm->field.sle_next; \
- curelm->field.sle_next = \
- curelm->field.sle_next->field.sle_next; \
- } \
-}
-
-/*
- * Singly-linked Tail queue definitions.
- */
-#define STAILQ_HEAD(name, type) \
-struct name { \
- struct type *stqh_first;/* first element */ \
- struct type **stqh_last;/* addr of last next element */ \
-}
-
-#define STAILQ_ENTRY(type) \
-struct { \
- struct type *stqe_next; /* next element */ \
-}
-
-/*
- * Singly-linked Tail queue functions.
- */
-#define STAILQ_INIT(head) { \
- (head)->stqh_first = NULL; \
- (head)->stqh_last = &(head)->stqh_first; \
-}
-
-#define STAILQ_INSERT_HEAD(head, elm, field) { \
- if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
- (head)->stqh_last = &(elm)->field.stqe_next; \
- (head)->stqh_first = (elm); \
-}
-
-#define STAILQ_INSERT_TAIL(head, elm, field) { \
- (elm)->field.stqe_next = NULL; \
- *(head)->stqh_last = (elm); \
- (head)->stqh_last = &(elm)->field.stqe_next; \
-}
-
-#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) { \
- if (((elm)->field.stqe_next = (tqelm)->field.stqe_next) == NULL)\
- (head)->stqh_last = &(elm)->field.stqe_next; \
- (tqelm)->field.stqe_next = (elm); \
-}
-
-#define STAILQ_REMOVE_HEAD(head, field) { \
- if (((head)->stqh_first = \
- (head)->stqh_first->field.stqe_next) == NULL) \
- (head)->stqh_last = &(head)->stqh_first; \
-}
-
-#define STAILQ_REMOVE(head, elm, type, field) { \
- if ((head)->stqh_first == (elm)) { \
- STAILQ_REMOVE_HEAD(head, field); \
- } \
- else { \
- struct type *curelm = (head)->stqh_first; \
- while( curelm->field.stqe_next != (elm) ) \
- curelm = curelm->field.stqe_next; \
- if((curelm->field.stqe_next = \
- curelm->field.stqe_next->field.stqe_next) == NULL) \
- (head)->stqh_last = &(curelm)->field.stqe_next; \
- } \
-}
-
-/*
- * List definitions.
- */
-#define LIST_HEAD(name, type) \
-struct name { \
- struct type *lh_first; /* first element */ \
-}
-
-#define LIST_ENTRY(type) \
-struct { \
- struct type *le_next; /* next element */ \
- struct type **le_prev; /* address of previous next element */ \
-}
-
-/*
- * List functions.
- */
-#define LIST_INIT(head) { \
- (head)->lh_first = NULL; \
-}
-
-#define LIST_INSERT_AFTER(listelm, elm, field) { \
- if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
- (listelm)->field.le_next->field.le_prev = \
- &(elm)->field.le_next; \
- (listelm)->field.le_next = (elm); \
- (elm)->field.le_prev = &(listelm)->field.le_next; \
-}
-
-#define LIST_INSERT_BEFORE(listelm, elm, field) { \
- (elm)->field.le_prev = (listelm)->field.le_prev; \
- (elm)->field.le_next = (listelm); \
- *(listelm)->field.le_prev = (elm); \
- (listelm)->field.le_prev = &(elm)->field.le_next; \
-}
-
-#define LIST_INSERT_HEAD(head, elm, field) { \
- if (((elm)->field.le_next = (head)->lh_first) != NULL) \
- (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
- (head)->lh_first = (elm); \
- (elm)->field.le_prev = &(head)->lh_first; \
-}
-
-#define LIST_REMOVE(elm, field) { \
- if ((elm)->field.le_next != NULL) \
- (elm)->field.le_next->field.le_prev = \
- (elm)->field.le_prev; \
- *(elm)->field.le_prev = (elm)->field.le_next; \
-}
-
-/*
- * Tail queue definitions.
- */
-#define TAILQ_HEAD(name, type) \
-struct name { \
- struct type *tqh_first; /* first element */ \
- struct type **tqh_last; /* addr of last next element */ \
-}
-
-#define TAILQ_HEAD_INITIALIZER(head) \
- { NULL, &(head).tqh_first }
-
-#define TAILQ_ENTRY(type) \
-struct { \
- struct type *tqe_next; /* next element */ \
- struct type **tqe_prev; /* address of previous next element */ \
-}
-
-/*
- * Tail queue functions.
- */
-#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
-
-#define TAILQ_FIRST(head) ((head)->tqh_first)
-
-#define TAILQ_LAST(head) ((head)->tqh_last)
-
-#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
-
-#define TAILQ_PREV(elm, field) ((elm)->field.tqe_prev)
-
-#define TAILQ_INIT(head) { \
- (head)->tqh_first = NULL; \
- (head)->tqh_last = &(head)->tqh_first; \
-}
-
-#define TAILQ_INSERT_HEAD(head, elm, field) { \
- if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
- (head)->tqh_first->field.tqe_prev = \
- &(elm)->field.tqe_next; \
- else \
- (head)->tqh_last = &(elm)->field.tqe_next; \
- (head)->tqh_first = (elm); \
- (elm)->field.tqe_prev = &(head)->tqh_first; \
-}
-
-#define TAILQ_INSERT_TAIL(head, elm, field) { \
- (elm)->field.tqe_next = NULL; \
- (elm)->field.tqe_prev = (head)->tqh_last; \
- *(head)->tqh_last = (elm); \
- (head)->tqh_last = &(elm)->field.tqe_next; \
-}
-
-#define TAILQ_INSERT_AFTER(head, listelm, elm, field) { \
- if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
- (elm)->field.tqe_next->field.tqe_prev = \
- &(elm)->field.tqe_next; \
- else \
- (head)->tqh_last = &(elm)->field.tqe_next; \
- (listelm)->field.tqe_next = (elm); \
- (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
-}
-
-#define TAILQ_INSERT_BEFORE(listelm, elm, field) { \
- (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
- (elm)->field.tqe_next = (listelm); \
- *(listelm)->field.tqe_prev = (elm); \
- (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
-}
-
-#define TAILQ_REMOVE(head, elm, field) { \
- if (((elm)->field.tqe_next) != NULL) \
- (elm)->field.tqe_next->field.tqe_prev = \
- (elm)->field.tqe_prev; \
- else \
- (head)->tqh_last = (elm)->field.tqe_prev; \
- *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
-}
-
-/*
- * Circular queue definitions.
- */
-#define CIRCLEQ_HEAD(name, type) \
-struct name { \
- struct type *cqh_first; /* first element */ \
- struct type *cqh_last; /* last element */ \
-}
-
-#define CIRCLEQ_ENTRY(type) \
-struct { \
- struct type *cqe_next; /* next element */ \
- struct type *cqe_prev; /* previous element */ \
-}
-
-/*
- * Circular queue functions.
- */
-#define CIRCLEQ_INIT(head) { \
- (head)->cqh_first = (void *)(head); \
- (head)->cqh_last = (void *)(head); \
-}
-
-#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) { \
- (elm)->field.cqe_next = (listelm)->field.cqe_next; \
- (elm)->field.cqe_prev = (listelm); \
- if ((listelm)->field.cqe_next == (void *)(head)) \
- (head)->cqh_last = (elm); \
- else \
- (listelm)->field.cqe_next->field.cqe_prev = (elm); \
- (listelm)->field.cqe_next = (elm); \
-}
-
-#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) { \
- (elm)->field.cqe_next = (listelm); \
- (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
- if ((listelm)->field.cqe_prev == (void *)(head)) \
- (head)->cqh_first = (elm); \
- else \
- (listelm)->field.cqe_prev->field.cqe_next = (elm); \
- (listelm)->field.cqe_prev = (elm); \
-}
-
-#define CIRCLEQ_INSERT_HEAD(head, elm, field) { \
- (elm)->field.cqe_next = (head)->cqh_first; \
- (elm)->field.cqe_prev = (void *)(head); \
- if ((head)->cqh_last == (void *)(head)) \
- (head)->cqh_last = (elm); \
- else \
- (head)->cqh_first->field.cqe_prev = (elm); \
- (head)->cqh_first = (elm); \
-}
-
-#define CIRCLEQ_INSERT_TAIL(head, elm, field) { \
- (elm)->field.cqe_next = (void *)(head); \
- (elm)->field.cqe_prev = (head)->cqh_last; \
- if ((head)->cqh_first == (void *)(head)) \
- (head)->cqh_first = (elm); \
- else \
- (head)->cqh_last->field.cqe_next = (elm); \
- (head)->cqh_last = (elm); \
-}
-
-#define CIRCLEQ_REMOVE(head, elm, field) { \
- if ((elm)->field.cqe_next == (void *)(head)) \
- (head)->cqh_last = (elm)->field.cqe_prev; \
- else \
- (elm)->field.cqe_next->field.cqe_prev = \
- (elm)->field.cqe_prev; \
- if ((elm)->field.cqe_prev == (void *)(head)) \
- (head)->cqh_first = (elm)->field.cqe_next; \
- else \
- (elm)->field.cqe_prev->field.cqe_next = \
- (elm)->field.cqe_next; \
-}
-
-#ifdef KERNEL
-
-/*
- * XXX insque() and remque() are an old way of handling certain queues.
- * They bogusly assumes that all queue heads look alike.
- */
-
-struct quehead {
- struct quehead *qh_link;
- struct quehead *qh_rlink;
-};
-
-#ifdef __GNUC__
-
-static __inline void
-insque(void *a, void *b)
-{
- struct quehead *element = a, *head = b;
-
- element->qh_link = head->qh_link;
- element->qh_rlink = head;
- head->qh_link = element;
- element->qh_link->qh_rlink = element;
-}
-
-static __inline void
-remque(void *a)
-{
- struct quehead *element = a;
-
- element->qh_link->qh_rlink = element->qh_rlink;
- element->qh_rlink->qh_link = element->qh_link;
- element->qh_rlink = 0;
-}
-
-#else /* !__GNUC__ */
-
-void insque __P((void *a, void *b));
-void remque __P((void *a));
-
-#endif /* __GNUC__ */
-
-#endif /* KERNEL */
-
-#endif /* !_SYS_QUEUE_H_ */
diff --git a/c/src/libnetworking/sys/reboot.h b/c/src/libnetworking/sys/reboot.h
deleted file mode 100644
index 48a7f0f782..0000000000
--- a/c/src/libnetworking/sys/reboot.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1993, 1994
- * 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.
- *
- * @(#)reboot.h 8.3 (Berkeley) 12/13/94
- * $Id$
- */
-
-#ifndef _SYS_REBOOT_H_
-#define _SYS_REBOOT_H_
-
-/*
- * Arguments to reboot system call. These are passed to
- * the boot program and on to init.
- */
-#define RB_AUTOBOOT 0 /* flags for system auto-booting itself */
-
-#define RB_ASKNAME 0x001 /* ask for file name to reboot from */
-#define RB_SINGLE 0x002 /* reboot to single user only */
-#define RB_NOSYNC 0x004 /* dont sync before reboot */
-#define RB_HALT 0x008 /* don't reboot, just halt */
-#define RB_INITNAME 0x010 /* name given for /etc/init (unused) */
-#define RB_DFLTROOT 0x020 /* use compiled-in rootdev */
-#define RB_KDB 0x040 /* give control to kernel debugger */
-#define RB_RDONLY 0x080 /* mount root fs read-only */
-#define RB_DUMP 0x100 /* dump kernel memory before reboot */
-#define RB_MINIROOT 0x200 /* mini-root present in memory at boot time */
-#define RB_CONFIG 0x400 /* invoke user configuration routing */
-#define RB_VERBOSE 0x800 /* print all potentially useful info */
-#define RB_SERIAL 0x1000 /* user serial port as console */
-#define RB_CDROM 0x2000 /* use cdrom as root */
-#define RB_POWEROFF 0x4000 /* if you can, turn the power off */
-#define RB_GDB 0x8000 /* use GDB remote debugger instead of DDB */
-#define RB_MUTE 0x10000 /* Come up with the console muted */
-#define RB_SELFTEST 0x20000 /* don't boot to normal operation, do selftest */
-
-#define RB_BOOTINFO 0x80000000 /* have `struct bootinfo *' arg */
-
-/*
- * Constants for converting boot-style device number to type,
- * adaptor (uba, mba, etc), unit number and partition number.
- * Type (== major device number) is in the low byte
- * for backward compatibility. Except for that of the "magic
- * number", each mask applies to the shifted value.
- * Format:
- * (4) (4) (4) (4) (8) (8)
- * --------------------------------
- * |MA | AD| CT| UN| PART | TYPE |
- * --------------------------------
- */
-#define B_ADAPTORSHIFT 24
-#define B_ADAPTORMASK 0x0f
-#define B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
-#define B_CONTROLLERSHIFT 20
-#define B_CONTROLLERMASK 0xf
-#define B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
-#define B_SLICESHIFT 20
-#define B_SLICEMASK 0xff
-#define B_SLICE(val) (((val)>>B_SLICESHIFT) & B_SLICEMASK)
-#define B_UNITSHIFT 16
-#define B_UNITMASK 0xf
-#define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK)
-#define B_PARTITIONSHIFT 8
-#define B_PARTITIONMASK 0xff
-#define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
-#define B_TYPESHIFT 0
-#define B_TYPEMASK 0xff
-#define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK)
-
-#define B_MAGICMASK 0xf0000000
-#define B_DEVMAGIC 0xa0000000
-
-#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
- (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
- ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
- ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
-
-#endif
diff --git a/c/src/libnetworking/sys/resourcevar.h b/c/src/libnetworking/sys/resourcevar.h
deleted file mode 100644
index 2b4c47e48f..0000000000
--- a/c/src/libnetworking/sys/resourcevar.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
diff --git a/c/src/libnetworking/sys/rtprio.h b/c/src/libnetworking/sys/rtprio.h
deleted file mode 100644
index dd9521e7c8..0000000000
--- a/c/src/libnetworking/sys/rtprio.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 1994, Henrik Vestergaard Draboel
- * 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 (name).
- * 4. 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 BY THE AUTHOR 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 AUTHOR 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.
- *
- * $Id$
- */
-
-#ifndef _SYS_RTPRIO_H_
-#define _SYS_RTPRIO_H_
-
-/*
- * Process realtime-priority specifications to rtprio.
- */
-
-/* priority types */
-#define RTP_PRIO_REALTIME 0
-#define RTP_PRIO_NORMAL 1
-#define RTP_PRIO_IDLE 2
-
-/* priority range */
-#define RTP_PRIO_MIN 0 /* Highest priority */
-#define RTP_PRIO_MAX 31 /* Lowest priority */
-
-/*
- * rtprio() syscall functions
- */
-#define RTP_LOOKUP 0
-#define RTP_SET 1
-
-#ifndef LOCORE
-struct rtprio {
- u_short type;
- u_short prio;
-};
-#endif
-
-#ifndef KERNEL
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int rtprio __P((int, pid_t, struct rtprio *));
-__END_DECLS
-#endif /* !KERNEL */
-#endif /* !_SYS_RTPRIO_H_ */
diff --git a/c/src/libnetworking/sys/select.h b/c/src/libnetworking/sys/select.h
deleted file mode 100644
index e69971e3b6..0000000000
--- a/c/src/libnetworking/sys/select.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * 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.
- *
- * @(#)select.h 8.2 (Berkeley) 1/4/94
- * $Id$
- */
-
-#ifndef _SYS_SELECT_H_
-#define _SYS_SELECT_H_
-
-/*
- * Used to maintain information about processes that wish to be
- * notified when I/O becomes possible.
- */
-struct selinfo {
- pid_t si_pid; /* process to be notified */
- short si_flags; /* see below */
-};
-#define SI_COLL 0x0001 /* collision occurred */
-
-#ifdef KERNEL
-struct proc;
-
-void selrecord __P((struct proc *selector, struct selinfo *));
-void selwakeup __P((struct selinfo *));
-#endif
-
-#endif /* !_SYS_SELECT_H_ */
diff --git a/c/src/libnetworking/sys/signalvar.h b/c/src/libnetworking/sys/signalvar.h
deleted file mode 100644
index 8900458fdb..0000000000
--- a/c/src/libnetworking/sys/signalvar.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 1991, 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.
- *
- * @(#)signalvar.h 8.6 (Berkeley) 2/19/95
- * $Id$
- */
-
-#ifndef _SYS_SIGNALVAR_H_ /* tmp for user.h */
-#define _SYS_SIGNALVAR_H_
-
-/*
- * Kernel signal definitions and data structures,
- * not exported to user programs.
- */
-
-/*
- * Process signal actions and state, needed only within the process
- * (not necessarily resident).
- */
-struct sigacts {
- sig_t ps_sigact[NSIG]; /* disposition of signals */
- sigset_t ps_catchmask[NSIG]; /* signals to be blocked */
- sigset_t ps_sigonstack; /* signals to take on sigstack */
- sigset_t ps_sigintr; /* signals that interrupt syscalls */
- sigset_t ps_sigreset; /* signals that reset when caught */
- sigset_t ps_signodefer; /* signals not masked while handled */
- sigset_t ps_oldmask; /* saved mask from before sigpause */
- int ps_flags; /* signal flags, below */
- struct sigaltstack ps_sigstk; /* sp & on stack state variable */
- int ps_sig; /* for core dump/debugger XXX */
- u_long ps_code; /* for core dump/debugger XXX */
- sigset_t ps_usertramp; /* SunOS compat; libc sigtramp XXX */
-};
-
-/* signal flags */
-#define SAS_OLDMASK 0x01 /* need to restore mask before pause */
-#define SAS_ALTSTACK 0x02 /* have alternate signal stack */
-
-/* additional signal action values, used only temporarily/internally */
-#define SIG_CATCH ((__sighandler_t *)2)
-#define SIG_HOLD ((__sighandler_t *)3)
-
-/*
- * get signal action for process and signal; currently only for current process
- */
-#define SIGACTION(p, sig) (p->p_sigacts->ps_sigact[(sig)])
-
-/*
- * Determine signal that should be delivered to process p, the current
- * process, 0 if none. If there is a pending stop signal with default
- * action, the process stops in issignal().
- */
-#define CURSIG(p) \
- (((p)->p_siglist == 0 || \
- (((p)->p_flag & P_TRACED) == 0 && \
- ((p)->p_siglist & ~(p)->p_sigmask) == 0)) ? \
- 0 : issignal(p))
-
-/*
- * Clear a pending signal from a process.
- */
-#define CLRSIG(p, sig) { (p)->p_siglist &= ~sigmask(sig); }
-
-/*
- * Signal properties and actions.
- * The array below categorizes the signals and their default actions
- * according to the following properties:
- */
-#define SA_KILL 0x01 /* terminates process by default */
-#define SA_CORE 0x02 /* ditto and coredumps */
-#define SA_STOP 0x04 /* suspend process */
-#define SA_TTYSTOP 0x08 /* ditto, from tty */
-#define SA_IGNORE 0x10 /* ignore by default */
-#define SA_CONT 0x20 /* continue if suspended */
-#define SA_CANTMASK 0x40 /* non-maskable, catchable */
-
-#ifdef SIGPROP
-static int sigprop[NSIG + 1] = {
- 0, /* unused */
- SA_KILL, /* SIGHUP */
- SA_KILL, /* SIGINT */
- SA_KILL|SA_CORE, /* SIGQUIT */
- SA_KILL|SA_CORE, /* SIGILL */
- SA_KILL|SA_CORE, /* SIGTRAP */
- SA_KILL|SA_CORE, /* SIGABRT */
- SA_KILL|SA_CORE, /* SIGEMT */
- SA_KILL|SA_CORE, /* SIGFPE */
- SA_KILL, /* SIGKILL */
- SA_KILL|SA_CORE, /* SIGBUS */
- SA_KILL|SA_CORE, /* SIGSEGV */
- SA_KILL|SA_CORE, /* SIGSYS */
- SA_KILL, /* SIGPIPE */
- SA_KILL, /* SIGALRM */
- SA_KILL, /* SIGTERM */
- SA_IGNORE, /* SIGURG */
- SA_STOP, /* SIGSTOP */
- SA_STOP|SA_TTYSTOP, /* SIGTSTP */
- SA_IGNORE|SA_CONT, /* SIGCONT */
- SA_IGNORE, /* SIGCHLD */
- SA_STOP|SA_TTYSTOP, /* SIGTTIN */
- SA_STOP|SA_TTYSTOP, /* SIGTTOU */
- SA_IGNORE, /* SIGIO */
- SA_KILL, /* SIGXCPU */
- SA_KILL, /* SIGXFSZ */
- SA_KILL, /* SIGVTALRM */
- SA_KILL, /* SIGPROF */
- SA_IGNORE, /* SIGWINCH */
- SA_IGNORE, /* SIGINFO */
- SA_KILL, /* SIGUSR1 */
- SA_KILL, /* SIGUSR2 */
-};
-
-#define contsigmask (sigmask(SIGCONT))
-#define stopsigmask (sigmask(SIGSTOP) | sigmask(SIGTSTP) | \
- sigmask(SIGTTIN) | sigmask(SIGTTOU))
-
-#endif /* SIGPROP */
-
-#define sigcantmask (sigmask(SIGKILL) | sigmask(SIGSTOP))
-
-#ifdef KERNEL
-/*
- * Machine-independent functions:
- */
-void execsigs __P((struct proc *p));
-void gsignal __P((int pgid, int sig));
-int issignal __P((struct proc *p));
-void killproc __P((struct proc *p, char *why));
-void pgsignal __P((struct pgrp *pgrp, int sig, int checkctty));
-void postsig __P((int sig));
-void psignal __P((struct proc *p, int sig));
-void setsigvec __P((struct proc *p, int signum, struct sigaction *sa));
-void sigexit __P((struct proc *p, int signum));
-void siginit __P((struct proc *p));
-void trapsignal __P((struct proc *p, int sig, u_long code));
-
-/*
- * Machine-dependent functions:
- */
-void sendsig __P((sig_t action, int sig, int returnmask, u_long code));
-#endif /* KERNEL */
-#endif /* !_SYS_SIGNALVAR_H_ */
diff --git a/c/src/libnetworking/sys/socket.h b/c/src/libnetworking/sys/socket.h
deleted file mode 100644
index 7e0f6c7572..0000000000
--- a/c/src/libnetworking/sys/socket.h
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
- * 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.
- *
- * @(#)socket.h 8.4 (Berkeley) 2/21/94
- * $Id$
- */
-
-#ifndef _SYS_SOCKET_H_
-#define _SYS_SOCKET_H_
-
-/*
- * Definitions related to sockets: types, address families, options.
- */
-
-/*
- * Types
- */
-#define SOCK_STREAM 1 /* stream socket */
-#define SOCK_DGRAM 2 /* datagram socket */
-#define SOCK_RAW 3 /* raw-protocol interface */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */
-#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-#define SO_PRIVSTATE 0x1009 /* get/deny privileged state */
-
-/*
- * Structure used for manipulating linger option.
- */
-struct linger {
- int l_onoff; /* option on/off */
- int l_linger; /* linger time */
-};
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/*
- * Address families.
- */
-#define AF_UNSPEC 0 /* unspecified */
-#define AF_LOCAL 1 /* local to host (pipes, portals) */
-#define AF_UNIX AF_LOCAL /* backward compatibility */
-#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
-#define AF_IMPLINK 3 /* arpanet imp addresses */
-#define AF_PUP 4 /* pup protocols: e.g. BSP */
-#define AF_CHAOS 5 /* mit CHAOS protocols */
-#define AF_NS 6 /* XEROX NS protocols */
-#define AF_ISO 7 /* ISO protocols */
-#define AF_OSI AF_ISO
-#define AF_ECMA 8 /* European computer manufacturers */
-#define AF_DATAKIT 9 /* datakit protocols */
-#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
-#define AF_SNA 11 /* IBM SNA */
-#define AF_DECnet 12 /* DECnet */
-#define AF_DLI 13 /* DEC Direct data link interface */
-#define AF_LAT 14 /* LAT */
-#define AF_HYLINK 15 /* NSC Hyperchannel */
-#define AF_APPLETALK 16 /* Apple Talk */
-#define AF_ROUTE 17 /* Internal Routing Protocol */
-#define AF_LINK 18 /* Link layer interface */
-#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
-#define AF_COIP 20 /* connection-oriented IP, aka ST II */
-#define AF_CNT 21 /* Computer Network Technology */
-#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */
-#define AF_IPX 23 /* Novell Internet Protocol */
-#define AF_SIP 24 /* Simple Internet Protocol */
-#define pseudo_AF_PIP 25 /* Help Identify PIP packets */
-#define AF_ISDN 26 /* Integrated Services Digital Network*/
-#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */
-#define pseudo_AF_KEY 27 /* Internal key-management function */
-#define AF_INET6 28 /* IPv6 */
-
-#define AF_MAX 29
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- u_char sa_len; /* total length */
- u_char sa_family; /* address family */
- char sa_data[14]; /* actually longer; address value */
-};
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- u_short sp_family; /* address family */
- u_short sp_protocol; /* protocol */
-};
-
-/*
- * Protocol families, same as address families for now.
- */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_LOCAL AF_LOCAL
-#define PF_UNIX PF_LOCAL /* backward compatibility */
-#define PF_INET AF_INET
-#define PF_IMPLINK AF_IMPLINK
-#define PF_PUP AF_PUP
-#define PF_CHAOS AF_CHAOS
-#define PF_NS AF_NS
-#define PF_ISO AF_ISO
-#define PF_OSI AF_ISO
-#define PF_ECMA AF_ECMA
-#define PF_DATAKIT AF_DATAKIT
-#define PF_CCITT AF_CCITT
-#define PF_SNA AF_SNA
-#define PF_DECnet AF_DECnet
-#define PF_DLI AF_DLI
-#define PF_LAT AF_LAT
-#define PF_HYLINK AF_HYLINK
-#define PF_APPLETALK AF_APPLETALK
-#define PF_ROUTE AF_ROUTE
-#define PF_LINK AF_LINK
-#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
-#define PF_COIP AF_COIP
-#define PF_CNT AF_CNT
-#define PF_SIP AF_SIP
-#define PF_IPX AF_IPX /* same format as AF_NS */
-#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */
-#define PF_PIP pseudo_AF_PIP
-#define PF_ISDN AF_ISDN
-#define PF_KEY pseudo_AF_KEY
-#define PF_INET6 AF_INET6
-
-#define PF_MAX AF_MAX
-
-/*
- * Definitions for network related sysctl, CTL_NET.
- *
- * Second level is protocol family.
- * Third level is protocol number.
- *
- * Further levels are defined by the individual families below.
- */
-#define NET_MAXID AF_MAX
-
-#define CTL_NET_NAMES { \
- { 0, 0 }, \
- { "unix", CTLTYPE_NODE }, \
- { "inet", CTLTYPE_NODE }, \
- { "implink", CTLTYPE_NODE }, \
- { "pup", CTLTYPE_NODE }, \
- { "chaos", CTLTYPE_NODE }, \
- { "xerox_ns", CTLTYPE_NODE }, \
- { "iso", CTLTYPE_NODE }, \
- { "emca", CTLTYPE_NODE }, \
- { "datakit", CTLTYPE_NODE }, \
- { "ccitt", CTLTYPE_NODE }, \
- { "ibm_sna", CTLTYPE_NODE }, \
- { "decnet", CTLTYPE_NODE }, \
- { "dec_dli", CTLTYPE_NODE }, \
- { "lat", CTLTYPE_NODE }, \
- { "hylink", CTLTYPE_NODE }, \
- { "appletalk", CTLTYPE_NODE }, \
- { "route", CTLTYPE_NODE }, \
- { "link_layer", CTLTYPE_NODE }, \
- { "xtp", CTLTYPE_NODE }, \
- { "coip", CTLTYPE_NODE }, \
- { "cnt", CTLTYPE_NODE }, \
- { "rtip", CTLTYPE_NODE }, \
- { "ipx", CTLTYPE_NODE }, \
- { "sip", CTLTYPE_NODE }, \
- { "pip", CTLTYPE_NODE }, \
- { "isdn", CTLTYPE_NODE }, \
- { "key", CTLTYPE_NODE }, \
-}
-
-/*
- * PF_ROUTE - Routing table
- *
- * Three additional levels are defined:
- * Fourth: address family, 0 is wildcard
- * Fifth: type of info, defined below
- * Sixth: flag(s) to mask with for NET_RT_FLAGS
- */
-#define NET_RT_DUMP 1 /* dump; may limit to a.f. */
-#define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */
-#define NET_RT_IFLIST 3 /* survey interface list */
-#define NET_RT_MAXID 4
-
-#define CTL_NET_RT_NAMES { \
- { 0, 0 }, \
- { "dump", CTLTYPE_STRUCT }, \
- { "flags", CTLTYPE_STRUCT }, \
- { "iflist", CTLTYPE_STRUCT }, \
-}
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#define SOMAXCONN 128
-
-/*
- * Message header for recvmsg and sendmsg calls.
- * Used value-result for recvmsg, value only for sendmsg.
- */
-struct msghdr {
- caddr_t msg_name; /* optional address */
- u_int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- u_int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_control; /* ancillary data, see below */
- u_int msg_controllen; /* ancillary data buffer len */
- int msg_flags; /* flags on received message */
-};
-
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-#define MSG_EOR 0x8 /* data completes record */
-#define MSG_TRUNC 0x10 /* data discarded before delivery */
-#define MSG_CTRUNC 0x20 /* control data lost before delivery */
-#define MSG_WAITALL 0x40 /* wait for full request or error */
-#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */
-#define MSG_EOF 0x100 /* data completes connection */
-#define MSG_COMPAT 0x8000 /* used in sendit() */
-
-/*
- * Header for ancillary data objects in msg_control buffer.
- * Used for additional information with/about a datagram
- * not expressible by flags. The format is a sequence
- * of message elements headed by cmsghdr structures.
- */
-struct cmsghdr {
- u_int cmsg_len; /* data byte count, including hdr */
- int cmsg_level; /* originating protocol */
- int cmsg_type; /* protocol-specific type */
-/* followed by u_char cmsg_data[]; */
-};
-
-/* given pointer to struct cmsghdr, return pointer to data */
-#define CMSG_DATA(cmsg) ((u_char *)((cmsg) + 1))
-
-/* given pointer to struct cmsghdr, return pointer to next cmsghdr */
-#define CMSG_NXTHDR(mhdr, cmsg) \
- (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
- (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
- (struct cmsghdr *)NULL : \
- (struct cmsghdr *)((caddr_t)(cmsg) + ALIGN((cmsg)->cmsg_len)))
-
-#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
-
-/* "Socket"-level control message types: */
-#define SCM_RIGHTS 0x01 /* access rights (array of int) */
-#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */
-
-/*
- * 4.3 compat sockaddr, move to compat file later
- */
-struct osockaddr {
- u_short sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
-};
-
-/*
- * 4.3-compat message header (move to compat file later).
- */
-struct omsghdr {
- caddr_t msg_name; /* optional address */
- int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_accrights; /* access rights sent/received */
- int msg_accrightslen;
-};
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int accept __P((int, struct sockaddr *, int *));
-int bind __P((int, const struct sockaddr *, int));
-int connect __P((int, const struct sockaddr *, int));
-int getpeername __P((int, struct sockaddr *, int *));
-int getsockname __P((int, struct sockaddr *, int *));
-int getsockopt __P((int, int, int, void *, int *));
-int listen __P((int, int));
-ssize_t recv __P((int, void *, size_t, int));
-ssize_t recvfrom __P((int, void *, size_t, int, struct sockaddr *, int *));
-ssize_t recvmsg __P((int, struct msghdr *, int));
-ssize_t send __P((int, const void *, size_t, int));
-ssize_t sendto __P((int, const void *,
- size_t, int, const struct sockaddr *, int));
-ssize_t sendmsg __P((int, const struct msghdr *, int));
-int setsockopt __P((int, int, int, const void *, int));
-int shutdown __P((int, int));
-int socket __P((int, int, int));
-int socketpair __P((int, int, int, int *));
-__END_DECLS
-
-#else /* KERNEL */
-void pfctlinput __P((int, struct sockaddr *));
-#endif /* !KERNEL */
-#endif /* !_SYS_SOCKET_H_ */
diff --git a/c/src/libnetworking/sys/socketvar.h b/c/src/libnetworking/sys/socketvar.h
deleted file mode 100644
index 257fee012b..0000000000
--- a/c/src/libnetworking/sys/socketvar.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 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.
- *
- * @(#)socketvar.h 8.3 (Berkeley) 2/19/95
- * $Id$
- */
-
-#ifndef _SYS_SOCKETVAR_H_
-#define _SYS_SOCKETVAR_H_
-
-#include <sys/queue.h> /* for TAILQ macros */
-#include <sys/select.h> /* for struct selinfo */
-
-/*
- * Kernel structure per socket.
- * Contains send and receive buffer queues,
- * handle on protocol and pointer to protocol
- * private data and error information.
- */
-struct socket {
- short so_type; /* generic type, see socket.h */
- short so_options; /* from socket call, see socket.h */
- short so_linger; /* time to linger while closing */
- short so_state; /* internal state flags SS_*, below */
- caddr_t so_pcb; /* protocol control block */
- struct protosw *so_proto; /* protocol handle */
-/*
- * Variables for connection queuing.
- * Socket where accepts occur is so_head in all subsidiary sockets.
- * If so_head is 0, socket is not related to an accept.
- * For head socket so_q0 queues partially completed connections,
- * while so_q is a queue of connections ready to be accepted.
- * If a connection is aborted and it has so_head set, then
- * it has to be pulled out of either so_q0 or so_q.
- * We allow connections to queue up based on current queue lengths
- * and limit on number of queued connections for this socket.
- */
- struct socket *so_head; /* back pointer to accept socket */
- TAILQ_HEAD(, socket) so_incomp; /* queue of partial unaccepted connections */
- TAILQ_HEAD(, socket) so_comp; /* queue of complete unaccepted connections */
- TAILQ_ENTRY(socket) so_list; /* list of unaccepted connections */
- short so_qlen; /* number of unaccepted connections */
- short so_incqlen; /* number of unaccepted incomplete
- connections */
- short so_qlimit; /* max number queued connections */
- short so_timeo; /* connection timeout */
- u_short so_error; /* error affecting connection */
- pid_t so_pgid; /* pgid for signals */
- u_long so_oobmark; /* chars to oob mark */
-/*
- * Variables for socket buffering.
- */
- struct sockbuf {
- u_long sb_cc; /* actual chars in buffer */
- u_long sb_hiwat; /* max actual char count */
- u_long sb_mbcnt; /* chars of mbufs used */
- u_long sb_mbmax; /* max chars of mbufs to use */
- long sb_lowat; /* low water mark */
- struct mbuf *sb_mb; /* the mbuf chain */
- struct selinfo sb_sel; /* process selecting read/write */
- short sb_flags; /* flags, see below */
- short sb_timeo; /* timeout for read/write */
- } so_rcv, so_snd;
-#define SB_MAX (256*1024) /* default for max chars in sockbuf */
-#define SB_LOCK 0x01 /* lock on data queue */
-#define SB_WANT 0x02 /* someone is waiting to lock */
-#define SB_WAIT 0x04 /* someone is waiting for data/space */
-#define SB_SEL 0x08 /* someone is selecting */
-#define SB_ASYNC 0x10 /* ASYNC I/O, need signals */
-#define SB_NOTIFY (SB_WAIT|SB_SEL|SB_ASYNC)
-#define SB_NOINTR 0x40 /* operations not interruptible */
-
- caddr_t so_tpcb; /* Wisc. protocol control block XXX */
- void (*so_upcall) __P((struct socket *so, caddr_t arg, int waitf));
- caddr_t so_upcallarg; /* Arg for above */
- uid_t so_uid; /* who opened the socket */
-};
-
-/*
- * Socket state bits.
- */
-#define SS_NOFDREF 0x0001 /* no file table ref any more */
-#define SS_ISCONNECTED 0x0002 /* socket connected to a peer */
-#define SS_ISCONNECTING 0x0004 /* in process of connecting to peer */
-#define SS_ISDISCONNECTING 0x0008 /* in process of disconnecting */
-#define SS_CANTSENDMORE 0x0010 /* can't send more data to peer */
-#define SS_CANTRCVMORE 0x0020 /* can't receive more data from peer */
-#define SS_RCVATMARK 0x0040 /* at mark on input */
-
-#define SS_PRIV 0x0080 /* privileged for broadcast, raw... */
-#define SS_NBIO 0x0100 /* non-blocking ops */
-#define SS_ASYNC 0x0200 /* async i/o notify */
-#define SS_ISCONFIRMING 0x0400 /* deciding to accept connection req */
-
-#define SS_INCOMP 0x0800 /* unaccepted, incomplete connection */
-#define SS_COMP 0x1000 /* unaccepted, complete connection */
-
-
-/*
- * Macros for sockets and socket buffering.
- */
-
-/*
- * How much space is there in a socket buffer (so->so_snd or so->so_rcv)?
- * This is problematical if the fields are unsigned, as the space might
- * still be negative (cc > hiwat or mbcnt > mbmax). Should detect
- * overflow and return 0. Should use "lmin" but it doesn't exist now.
- */
-#define sbspace(sb) \
- ((long) imin((int)((sb)->sb_hiwat - (sb)->sb_cc), \
- (int)((sb)->sb_mbmax - (sb)->sb_mbcnt)))
-
-/* do we have to send all at once on a socket? */
-#define sosendallatonce(so) \
- ((so)->so_proto->pr_flags & PR_ATOMIC)
-
-/* can we read something from so? */
-#define soreadable(so) \
- ((so)->so_rcv.sb_cc >= (so)->so_rcv.sb_lowat || \
- ((so)->so_state & SS_CANTRCVMORE) || \
- (so)->so_comp.tqh_first || (so)->so_error)
-
-/* can we write something to so? */
-#define sowriteable(so) \
- ((sbspace(&(so)->so_snd) >= (so)->so_snd.sb_lowat && \
- (((so)->so_state&SS_ISCONNECTED) || \
- ((so)->so_proto->pr_flags&PR_CONNREQUIRED)==0)) || \
- ((so)->so_state & SS_CANTSENDMORE) || \
- (so)->so_error)
-
-/* adjust counters in sb reflecting allocation of m */
-#define sballoc(sb, m) { \
- (sb)->sb_cc += (m)->m_len; \
- (sb)->sb_mbcnt += MSIZE; \
- if ((m)->m_flags & M_EXT) \
- (sb)->sb_mbcnt += (m)->m_ext.ext_size; \
-}
-
-/* adjust counters in sb reflecting freeing of m */
-#define sbfree(sb, m) { \
- (sb)->sb_cc -= (m)->m_len; \
- (sb)->sb_mbcnt -= MSIZE; \
- if ((m)->m_flags & M_EXT) \
- (sb)->sb_mbcnt -= (m)->m_ext.ext_size; \
-}
-
-/*
- * Set lock on sockbuf sb; sleep if lock is already held.
- * Unless SB_NOINTR is set on sockbuf, sleep is interruptible.
- * Returns error without lock if sleep is interrupted.
- */
-#define sblock(sb, wf) ((sb)->sb_flags & SB_LOCK ? \
- (((wf) == M_WAITOK) ? sb_lock(sb) : EWOULDBLOCK) : \
- ((sb)->sb_flags |= SB_LOCK), 0)
-
-/* release lock on sockbuf sb */
-#define sbunlock(sb) { \
- (sb)->sb_flags &= ~SB_LOCK; \
- if ((sb)->sb_flags & SB_WANT) { \
- (sb)->sb_flags &= ~SB_WANT; \
- wakeup((caddr_t)&(sb)->sb_flags); \
- } \
-}
-
-#define sorwakeup(so) { sowakeup((so), &(so)->so_rcv); \
- if ((so)->so_upcall) \
- (*((so)->so_upcall))((so), (so)->so_upcallarg, M_DONTWAIT); \
- }
-
-#define sowwakeup(so) sowakeup((so), &(so)->so_snd)
-
-#ifdef KERNEL
-extern u_long sb_max;
-
-/* to catch callers missing new second argument to sonewconn: */
-#define sonewconn(head, connstatus) sonewconn1((head), (connstatus))
-
-struct filedesc;
-struct mbuf;
-struct sockaddr;
-struct stat;
-
-/*
- * File operations on sockets.
- */
-int soo_ioctl __P((struct file *fp, int cmd, caddr_t data,
- struct proc *p));
-int soo_select __P((struct file *fp, int which, struct proc *p));
-int soo_stat __P((struct socket *so, struct stat *ub));
-
-/*
- * From uipc_socket and friends
- */
-int getsock __P((struct filedesc *fdp, int fdes, struct file **fpp));
-int sockargs __P((struct mbuf **mp, caddr_t buf, int buflen, int type));
-void sbappend __P((struct sockbuf *sb, struct mbuf *m));
-int sbappendaddr __P((struct sockbuf *sb, struct sockaddr *asa,
- struct mbuf *m0, struct mbuf *control));
-int sbappendcontrol __P((struct sockbuf *sb, struct mbuf *m0,
- struct mbuf *control));
-void sbappendrecord __P((struct sockbuf *sb, struct mbuf *m0));
-void sbcheck __P((struct sockbuf *sb));
-void sbcompress __P((struct sockbuf *sb, struct mbuf *m, struct mbuf *n));
-struct mbuf *
- sbcreatecontrol __P((caddr_t p, int size, int type, int level));
-void sbdrop __P((struct sockbuf *sb, int len));
-void sbdroprecord __P((struct sockbuf *sb));
-void sbflush __P((struct sockbuf *sb));
-void sbinsertoob __P((struct sockbuf *sb, struct mbuf *m0));
-void sbrelease __P((struct sockbuf *sb));
-int sbreserve __P((struct sockbuf *sb, u_long cc));
-int sbwait __P((struct sockbuf *sb));
-int sb_lock __P((struct sockbuf *sb));
-int soabort __P((struct socket *so));
-int soaccept __P((struct socket *so, struct mbuf *nam));
-int sobind __P((struct socket *so, struct mbuf *nam));
-void socantrcvmore __P((struct socket *so));
-void socantsendmore __P((struct socket *so));
-int soclose __P((struct socket *so));
-int soconnect __P((struct socket *so, struct mbuf *nam));
-int soconnect2 __P((struct socket *so1, struct socket *so2));
-int socreate __P((int dom, struct socket **aso, int type, int proto,
- struct proc *p));
-int sodisconnect __P((struct socket *so));
-void sofree __P((struct socket *so));
-int sogetopt __P((struct socket *so, int level, int optname,
- struct mbuf **mp));
-void sohasoutofband __P((struct socket *so));
-void soisconnected __P((struct socket *so));
-void soisconnecting __P((struct socket *so));
-void soisdisconnected __P((struct socket *so));
-void soisdisconnecting __P((struct socket *so));
-int solisten __P((struct socket *so, int backlog));
-struct socket *
- sodropablereq __P((struct socket *head));
-struct socket *
- sonewconn1 __P((struct socket *head, int connstatus));
-int soreceive __P((struct socket *so, struct mbuf **paddr, struct uio *uio,
- struct mbuf **mp0, struct mbuf **controlp, int *flagsp));
-int soreserve __P((struct socket *so, u_long sndcc, u_long rcvcc));
-void sorflush __P((struct socket *so));
-int sosend __P((struct socket *so, struct mbuf *addr, struct uio *uio,
- struct mbuf *top, struct mbuf *control, int flags));
-int sosetopt __P((struct socket *so, int level, int optname,
- struct mbuf *m0));
-int soshutdown __P((struct socket *so, int how));
-void sowakeup __P((struct socket *so, struct sockbuf *sb));
-#endif /* KERNEL */
-
-#endif /* !_SYS_SOCKETVAR_H_ */
diff --git a/c/src/libnetworking/sys/sockio.h b/c/src/libnetworking/sys/sockio.h
deleted file mode 100644
index 020061170f..0000000000
--- a/c/src/libnetworking/sys/sockio.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * 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.
- *
- * @(#)sockio.h 8.1 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_SOCKIO_H_
-#define _SYS_SOCKIO_H_
-
-#include <sys/ioccom.h>
-
-/* Socket ioctl's. */
-#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */
-#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */
-#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */
-#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */
-#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */
-#define SIOCSPGRP _IOW('s', 8, int) /* set process group */
-#define SIOCGPGRP _IOR('s', 9, int) /* get process group */
-
-#define SIOCADDRT _IOW('r', 10, struct ortentry) /* add route */
-#define SIOCDELRT _IOW('r', 11, struct ortentry) /* delete route */
-#define SIOCGETVIFCNT _IOWR('r', 15, struct sioc_vif_req)/* get vif pkt cnt */
-#define SIOCGETSGCNT _IOWR('r', 16, struct sioc_sg_req) /* get s,g pkt cnt */
-
-#define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */
-#define OSIOCGIFADDR _IOWR('i', 13, struct ifreq) /* get ifnet address */
-#define SIOCGIFADDR _IOWR('i', 33, struct ifreq) /* get ifnet address */
-#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */
-#define OSIOCGIFDSTADDR _IOWR('i', 15, struct ifreq) /* get p-p address */
-#define SIOCGIFDSTADDR _IOWR('i', 34, struct ifreq) /* get p-p address */
-#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */
-#define SIOCGIFFLAGS _IOWR('i', 17, struct ifreq) /* get ifnet flags */
-#define OSIOCGIFBRDADDR _IOWR('i', 18, struct ifreq) /* get broadcast addr */
-#define SIOCGIFBRDADDR _IOWR('i', 35, struct ifreq) /* get broadcast addr */
-#define SIOCSIFBRDADDR _IOW('i', 19, struct ifreq) /* set broadcast addr */
-#define OSIOCGIFCONF _IOWR('i', 20, struct ifconf) /* get ifnet list */
-#define SIOCGIFCONF _IOWR('i', 36, struct ifconf) /* get ifnet list */
-#define OSIOCGIFNETMASK _IOWR('i', 21, struct ifreq) /* get net addr mask */
-#define SIOCGIFNETMASK _IOWR('i', 37, struct ifreq) /* get net addr mask */
-#define SIOCSIFNETMASK _IOW('i', 22, struct ifreq) /* set net addr mask */
-#define SIOCGIFMETRIC _IOWR('i', 23, struct ifreq) /* get IF metric */
-#define SIOCSIFMETRIC _IOW('i', 24, struct ifreq) /* set IF metric */
-#define SIOCDIFADDR _IOW('i', 25, struct ifreq) /* delete IF addr */
-#define SIOCAIFADDR _IOW('i', 26, struct ifaliasreq)/* add/chg IF alias */
-
-#define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */
-#define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */
-#define SIOCGIFMTU _IOWR('i', 51, struct ifreq) /* get IF mtu */
-#define SIOCSIFMTU _IOW('i', 52, struct ifreq) /* set IF mtu */
-#define SIOCGIFPHYS _IOWR('i', 53, struct ifreq) /* get IF wire */
-#define SIOCSIFPHYS _IOW('i', 54, struct ifreq) /* set IF wire */
-#define SIOCSIFMEDIA _IOWR('i', 55, struct ifreq) /* set net media */
-#define SIOCGIFMEDIA _IOWR('i', 56, struct ifmediareq) /* get net media */
-
-#endif /* !_SYS_SOCKIO_H_ */
diff --git a/c/src/libnetworking/sys/sysctl.h b/c/src/libnetworking/sys/sysctl.h
deleted file mode 100644
index b25ba43c4f..0000000000
--- a/c/src/libnetworking/sys/sysctl.h
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Mike Karels at Berkeley Software Design, Inc.
- *
- * 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.
- *
- * @(#)sysctl.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_SYSCTL_H_
-#define _SYS_SYSCTL_H_
-
-/*
- * Definitions for sysctl call. The sysctl call uses a hierarchical name
- * for objects that can be examined or modified. The name is expressed as
- * a sequence of integers. Like a file path name, the meaning of each
- * component depends on its place in the hierarchy. The top-level and kern
- * identifiers are defined here, and other identifiers are defined in the
- * respective subsystem header files.
- */
-
-#define CTL_MAXNAME 12 /* largest number of components supported */
-
-/*
- * Each subsystem defined by sysctl defines a list of variables
- * for that subsystem. Each name is either a node with further
- * levels defined below it, or it is a leaf of some particular
- * type given below. Each sysctl level defines a set of name/type
- * pairs to be used by sysctl(1) in manipulating the subsystem.
- */
-struct ctlname {
- char *ctl_name; /* subsystem name */
- int ctl_type; /* type of name */
-};
-
-#define CTLTYPE 0xf /* Mask for the type */
-#define CTLTYPE_NODE 1 /* name is a node */
-#define CTLTYPE_INT 2 /* name describes an integer */
-#define CTLTYPE_STRING 3 /* name describes a string */
-#define CTLTYPE_QUAD 4 /* name describes a 64-bit number */
-#define CTLTYPE_OPAQUE 5 /* name describes a structure */
-#define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */
-
-#define CTLFLAG_RD 0x80000000 /* Allow reads of variable */
-#define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */
-#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR)
-#define CTLFLAG_NOLOCK 0x20000000 /* XXX Don't Lock */
-#define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */
-
-/*
- * USE THIS instead of a hardwired number from the categories below
- * to get dynamically assigned sysctl entries using the linker-set
- * technology. This is the way nearly all new sysctl variables should
- * be implimented.
- * e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, "");
- */
-#define OID_AUTO (-1)
-
-#ifdef KERNEL
-#define SYSCTL_HANDLER_ARGS (struct sysctl_oid *oidp, void *arg1, int arg2, \
- struct sysctl_req *req)
-
-/*
- * This describes the access space for a sysctl request. This is needed
- * so that we can use the interface from the kernel or from user-space.
- */
-struct sysctl_req {
- struct proc *p;
- int lock;
- void *oldptr;
- int oldlen;
- int oldidx;
- int (*oldfunc)(struct sysctl_req *, const void *, int);
- void *newptr;
- int newlen;
- int newidx;
- int (*newfunc)(struct sysctl_req *, void *, int);
-};
-
-/*
- * This describes one "oid" in the MIB tree. Potentially more nodes can
- * be hidden behind it, expanded by the handler.
- */
-struct sysctl_oid {
- int oid_number;
- int oid_kind;
- void *oid_arg1;
- int oid_arg2;
- const char *oid_name;
- int (*oid_handler) SYSCTL_HANDLER_ARGS;
- const char *oid_fmt;
-};
-
-#define SYSCTL_IN(r, p, l)
-#define SYSCTL_OUT(r, p, l)
-
-int sysctl_handle_int SYSCTL_HANDLER_ARGS;
-int sysctl_handle_string SYSCTL_HANDLER_ARGS;
-int sysctl_handle_opaque SYSCTL_HANDLER_ARGS;
-
-/* This is the "raw" function for a mib-oid */
-#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr)
-
-/* This makes a node from which other oids can hang */
-#define SYSCTL_NODE(parent, nbr, name, access, handler, descr)
-
-/* This is a string len can be 0 to indicate '\0' termination */
-#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr)
-
-/* This is a integer, if ptr is NULL, val is returned */
-#define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr)
-
-/* This is anything, specified by a pointer and a lenth */
-#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr)
-
-/* This is a struct, specified by a pointer and type */
-#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr)
-
-/* Needs a proc. Specify by pointer and arg */
-#define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr)
-#endif /* KERNEL */
-
-/*
- * Top-level identifiers
- */
-#define CTL_UNSPEC 0 /* unused */
-#define CTL_KERN 1 /* "high kernel": proc, limits */
-#define CTL_VM 2 /* virtual memory */
-#define CTL_VFS 3 /* file system, mount type is next */
-#define CTL_NET 4 /* network, see socket.h */
-#define CTL_DEBUG 5 /* debugging parameters */
-#define CTL_HW 6 /* generic cpu/io */
-#define CTL_MACHDEP 7 /* machine dependent */
-#define CTL_USER 8 /* user-level */
-#define CTL_MAXID 9 /* number of valid top-level ids */
-
-#define CTL_NAMES { \
- { 0, 0 }, \
- { "kern", CTLTYPE_NODE }, \
- { "vm", CTLTYPE_NODE }, \
- { "vfs", CTLTYPE_NODE }, \
- { "net", CTLTYPE_NODE }, \
- { "debug", CTLTYPE_NODE }, \
- { "hw", CTLTYPE_NODE }, \
- { "machdep", CTLTYPE_NODE }, \
- { "user", CTLTYPE_NODE }, \
-}
-
-/*
- * CTL_KERN identifiers
- */
-#define KERN_OSTYPE 1 /* string: system version */
-#define KERN_OSRELEASE 2 /* string: system release */
-#define KERN_OSREV 3 /* int: system revision */
-#define KERN_VERSION 4 /* string: compile time info */
-#define KERN_MAXVNODES 5 /* int: max vnodes */
-#define KERN_MAXPROC 6 /* int: max processes */
-#define KERN_MAXFILES 7 /* int: max open files */
-#define KERN_ARGMAX 8 /* int: max arguments to exec */
-#define KERN_SECURELVL 9 /* int: system security level */
-#define KERN_HOSTNAME 10 /* string: hostname */
-#define KERN_HOSTID 11 /* int: host identifier */
-#define KERN_CLOCKRATE 12 /* struct: struct clockrate */
-#define KERN_VNODE 13 /* struct: vnode structures */
-#define KERN_PROC 14 /* struct: process entries */
-#define KERN_FILE 15 /* struct: file entries */
-#define KERN_PROF 16 /* node: kernel profiling info */
-#define KERN_POSIX1 17 /* int: POSIX.1 version */
-#define KERN_NGROUPS 18 /* int: # of supplemental group ids */
-#define KERN_JOB_CONTROL 19 /* int: is job control available */
-#define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */
-#define KERN_BOOTTIME 21 /* struct: time kernel was booted */
-#define KERN_NISDOMAINNAME 22 /* string: YP domain name */
-#define KERN_UPDATEINTERVAL 23 /* int: update process sleep time */
-#define KERN_OSRELDATE 24 /* int: OS release date */
-#define KERN_NTP_PLL 25 /* node: NTP PLL control */
-#define KERN_BOOTFILE 26 /* string: name of booted kernel */
-#define KERN_MAXFILESPERPROC 27 /* int: max open files per proc */
-#define KERN_MAXPROCPERUID 28 /* int: max processes per uid */
-#define KERN_DUMPDEV 29 /* dev_t: device to dump on */
-#define KERN_SOMAXCONN 30 /* int: max connections in listen q */
-#define KERN_MAXSOCKBUF 31 /* int: max size of a socket buffer */
-#define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */
-#define KERN_USRSTACK 33 /* int: address of USRSTACK */
-#define KERN_MAXID 34 /* number of valid kern ids */
-
-#define CTL_KERN_NAMES { \
- { 0, 0 }, \
- { "ostype", CTLTYPE_STRING }, \
- { "osrelease", CTLTYPE_STRING }, \
- { "osrevision", CTLTYPE_INT }, \
- { "version", CTLTYPE_STRING }, \
- { "maxvnodes", CTLTYPE_INT }, \
- { "maxproc", CTLTYPE_INT }, \
- { "maxfiles", CTLTYPE_INT }, \
- { "argmax", CTLTYPE_INT }, \
- { "securelevel", CTLTYPE_INT }, \
- { "hostname", CTLTYPE_STRING }, \
- { "hostid", CTLTYPE_INT }, \
- { "clockrate", CTLTYPE_STRUCT }, \
- { "vnode", CTLTYPE_STRUCT }, \
- { "proc", CTLTYPE_STRUCT }, \
- { "file", CTLTYPE_STRUCT }, \
- { "profiling", CTLTYPE_NODE }, \
- { "posix1version", CTLTYPE_INT }, \
- { "ngroups", CTLTYPE_INT }, \
- { "job_control", CTLTYPE_INT }, \
- { "saved_ids", CTLTYPE_INT }, \
- { "boottime", CTLTYPE_STRUCT }, \
- { "nisdomainname", CTLTYPE_STRING }, \
- { "update", CTLTYPE_INT }, \
- { "osreldate", CTLTYPE_INT }, \
- { "ntp_pll", CTLTYPE_NODE }, \
- { "bootfile", CTLTYPE_STRING }, \
- { "maxfilesperproc", CTLTYPE_INT }, \
- { "maxprocperuid", CTLTYPE_INT }, \
- { "dumpdev", CTLTYPE_STRUCT }, /* we lie; don't print as int */ \
- { "somaxconn", CTLTYPE_INT }, \
- { "maxsockbuf", CTLTYPE_INT }, \
- { "ps_strings", CTLTYPE_INT }, \
- { "usrstack", CTLTYPE_INT }, \
-}
-
-/*
- * CTL_VFS identifiers
- */
-#define VFS_VFSCONF 0 /* get configured filesystems */
-#define VFS_MAXID 1 /* number of items */
-
-#define CTL_VFS_NAMES { \
- { "vfsconf", CTLTYPE_STRUCT }, \
-}
-
-/*
- * KERN_PROC subtypes
- */
-#define KERN_PROC_ALL 0 /* everything */
-#define KERN_PROC_PID 1 /* by process id */
-#define KERN_PROC_PGRP 2 /* by process group id */
-#define KERN_PROC_SESSION 3 /* by session of pid */
-#define KERN_PROC_TTY 4 /* by controlling tty */
-#define KERN_PROC_UID 5 /* by effective uid */
-#define KERN_PROC_RUID 6 /* by real uid */
-
-/*
- * CTL_HW identifiers
- */
-#define HW_MACHINE 1 /* string: machine class */
-#define HW_MODEL 2 /* string: specific machine model */
-#define HW_NCPU 3 /* int: number of cpus */
-#define HW_BYTEORDER 4 /* int: machine byte order */
-#define HW_PHYSMEM 5 /* int: total memory */
-#define HW_USERMEM 6 /* int: non-kernel memory */
-#define HW_PAGESIZE 7 /* int: software page size */
-#define HW_DISKNAMES 8 /* strings: disk drive names */
-#define HW_DISKSTATS 9 /* struct: diskstats[] */
-#define HW_FLOATINGPT 10 /* int: has HW floating point? */
-#define HW_MACHINE_ARCH 11 /* string: machine architecture */
-#define HW_MAXID 12 /* number of valid hw ids */
-
-#define CTL_HW_NAMES { \
- { 0, 0 }, \
- { "machine", CTLTYPE_STRING }, \
- { "model", CTLTYPE_STRING }, \
- { "ncpu", CTLTYPE_INT }, \
- { "byteorder", CTLTYPE_INT }, \
- { "physmem", CTLTYPE_INT }, \
- { "usermem", CTLTYPE_INT }, \
- { "pagesize", CTLTYPE_INT }, \
- { "disknames", CTLTYPE_STRUCT }, \
- { "diskstats", CTLTYPE_STRUCT }, \
- { "floatingpoint", CTLTYPE_INT }, \
-}
-
-/*
- * CTL_USER definitions
- */
-#define USER_CS_PATH 1 /* string: _CS_PATH */
-#define USER_BC_BASE_MAX 2 /* int: BC_BASE_MAX */
-#define USER_BC_DIM_MAX 3 /* int: BC_DIM_MAX */
-#define USER_BC_SCALE_MAX 4 /* int: BC_SCALE_MAX */
-#define USER_BC_STRING_MAX 5 /* int: BC_STRING_MAX */
-#define USER_COLL_WEIGHTS_MAX 6 /* int: COLL_WEIGHTS_MAX */
-#define USER_EXPR_NEST_MAX 7 /* int: EXPR_NEST_MAX */
-#define USER_LINE_MAX 8 /* int: LINE_MAX */
-#define USER_RE_DUP_MAX 9 /* int: RE_DUP_MAX */
-#define USER_POSIX2_VERSION 10 /* int: POSIX2_VERSION */
-#define USER_POSIX2_C_BIND 11 /* int: POSIX2_C_BIND */
-#define USER_POSIX2_C_DEV 12 /* int: POSIX2_C_DEV */
-#define USER_POSIX2_CHAR_TERM 13 /* int: POSIX2_CHAR_TERM */
-#define USER_POSIX2_FORT_DEV 14 /* int: POSIX2_FORT_DEV */
-#define USER_POSIX2_FORT_RUN 15 /* int: POSIX2_FORT_RUN */
-#define USER_POSIX2_LOCALEDEF 16 /* int: POSIX2_LOCALEDEF */
-#define USER_POSIX2_SW_DEV 17 /* int: POSIX2_SW_DEV */
-#define USER_POSIX2_UPE 18 /* int: POSIX2_UPE */
-#define USER_STREAM_MAX 19 /* int: POSIX2_STREAM_MAX */
-#define USER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */
-#define USER_MAXID 21 /* number of valid user ids */
-
-#define CTL_USER_NAMES { \
- { 0, 0 }, \
- { "cs_path", CTLTYPE_STRING }, \
- { "bc_base_max", CTLTYPE_INT }, \
- { "bc_dim_max", CTLTYPE_INT }, \
- { "bc_scale_max", CTLTYPE_INT }, \
- { "bc_string_max", CTLTYPE_INT }, \
- { "coll_weights_max", CTLTYPE_INT }, \
- { "expr_nest_max", CTLTYPE_INT }, \
- { "line_max", CTLTYPE_INT }, \
- { "re_dup_max", CTLTYPE_INT }, \
- { "posix2_version", CTLTYPE_INT }, \
- { "posix2_c_bind", CTLTYPE_INT }, \
- { "posix2_c_dev", CTLTYPE_INT }, \
- { "posix2_char_term", CTLTYPE_INT }, \
- { "posix2_fort_dev", CTLTYPE_INT }, \
- { "posix2_fort_run", CTLTYPE_INT }, \
- { "posix2_localedef", CTLTYPE_INT }, \
- { "posix2_sw_dev", CTLTYPE_INT }, \
- { "posix2_upe", CTLTYPE_INT }, \
- { "stream_max", CTLTYPE_INT }, \
- { "tzname_max", CTLTYPE_INT }, \
-}
-
-#ifdef KERNEL
-
-extern char cpu_model[];
-extern char machine[];
-extern char osrelease[];
-extern char ostype[];
-
-int kernel_sysctl(struct proc *p, int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen, int *retval);
-int userland_sysctl(struct proc *p, int *name, u_int namelen, void *old, size_t *oldlenp, int inkernel, void *new, size_t newlen, int *retval);
-/*
-int sysctl_clockrate __P((char *, size_t*));
-int sysctl_file __P((char *, size_t*));
-int sysctl_doproc __P((int *, u_int, char *, size_t*));
-int sysctl_doprof __P((int *, u_int, void *, size_t *, void *, size_t));
-*/
-
-#else /* !KERNEL */
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int sysctl __P((int *, u_int, void *, size_t *, void *, size_t));
-int sysctlbyname __P((const char *, void *, size_t *, void *, size_t));
-__END_DECLS
-#endif /* KERNEL */
-
-#endif /* !_SYS_SYSCTL_H_ */
diff --git a/c/src/libnetworking/sys/syslimits.h b/c/src/libnetworking/sys/syslimits.h
deleted file mode 100644
index 283a0241e3..0000000000
--- a/c/src/libnetworking/sys/syslimits.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * @(#)syslimits.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_SYSLIMITS_H_
-#define _SYS_SYSLIMITS_H_
-
-#if !defined(__rtems__)
-#define ARG_MAX 65536 /* max bytes for an exec function */
-#endif
-
-#if !defined(__rtems__)
-#ifndef CHILD_MAX
-#define CHILD_MAX 40 /* max simultaneous processes */
-#endif
-#endif
-
-#if !defined(__rtems__)
-#define LINK_MAX 32767 /* max file link count */
-#endif
-
-#define MAX_CANON 255 /* max bytes in term canon input line */
-
-#define MAX_INPUT 255 /* max bytes in terminal input */
-
-#if !defined(__rtems__)
-#define NAME_MAX 255 /* max bytes in a file name */
-#endif
-
-#define NGROUPS_MAX 16 /* max supplemental group id's */
-
-#if !defined(__rtems__)
-#ifndef OPEN_MAX
-#define OPEN_MAX 64 /* max open files per process */
-#endif
-#endif
-
-#if !defined(__rtems__)
-#define PATH_MAX 1024 /* max bytes in pathname */
-#endif
-
-#define PIPE_BUF 512 /* max bytes for atomic pipe writes */
-
-#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */
-#define BC_DIM_MAX 2048 /* max array elements in bc(1) */
-#define BC_SCALE_MAX 99 /* max scale value in bc(1) */
-#define BC_STRING_MAX 1000 /* max const string length in bc(1) */
-#define COLL_WEIGHTS_MAX 0 /* max weights for order keyword */
-#define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */
-#define LINE_MAX 2048 /* max bytes in an input line */
-#define RE_DUP_MAX 255 /* max RE's in interval notation */
-
-#endif
diff --git a/c/src/libnetworking/sys/syslog.h b/c/src/libnetworking/sys/syslog.h
deleted file mode 100644
index 724bee62c7..0000000000
--- a/c/src/libnetworking/sys/syslog.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)syslog.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_SYSLOG_H_
-#define _SYS_SYSLOG_H_
-
-#define _PATH_LOG "/var/run/log"
-#define _PATH_OLDLOG "/dev/log" /* backward compatibility */
-
-/*
- * priorities/facilities are encoded into a single 32-bit quantity, where the
- * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
- * (0-big number). Both the priorities and the facilities map roughly
- * one-to-one to strings in the syslogd(8) source code. This mapping is
- * included in this file.
- *
- * priorities (these are ordered)
- */
-#define LOG_EMERG 0 /* system is unusable */
-#define LOG_ALERT 1 /* action must be taken immediately */
-#define LOG_CRIT 2 /* critical conditions */
-#define LOG_ERR 3 /* error conditions */
-#define LOG_WARNING 4 /* warning conditions */
-#define LOG_NOTICE 5 /* normal but significant condition */
-#define LOG_INFO 6 /* informational */
-#define LOG_DEBUG 7 /* debug-level messages */
-
-#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
- /* extract priority */
-#define LOG_PRI(p) ((p) & LOG_PRIMASK)
-#define LOG_MAKEPRI(fac, pri) ((fac) | (pri))
-
-#ifdef SYSLOG_NAMES
-#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
- /* mark "facility" */
-#define INTERNAL_MARK LOG_MAKEPRI((LOG_NFACILITIES<<3), 0)
-typedef struct _code {
- char *c_name;
- int c_val;
-} CODE;
-
-CODE prioritynames[] = {
- { "alert", LOG_ALERT, },
- { "crit", LOG_CRIT, },
- { "debug", LOG_DEBUG, },
- { "emerg", LOG_EMERG, },
- { "err", LOG_ERR, },
- { "error", LOG_ERR, }, /* DEPRECATED */
- { "info", LOG_INFO, },
- { "none", INTERNAL_NOPRI, }, /* INTERNAL */
- { "notice", LOG_NOTICE, },
- { "panic", LOG_EMERG, }, /* DEPRECATED */
- { "warn", LOG_WARNING, }, /* DEPRECATED */
- { "warning", LOG_WARNING, },
- { NULL, -1, }
-};
-#endif
-
-/* facility codes */
-#define LOG_KERN (0<<3) /* kernel messages */
-#define LOG_USER (1<<3) /* random user-level messages */
-#define LOG_MAIL (2<<3) /* mail system */
-#define LOG_DAEMON (3<<3) /* system daemons */
-#define LOG_AUTH (4<<3) /* security/authorization messages */
-#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
-#define LOG_LPR (6<<3) /* line printer subsystem */
-#define LOG_NEWS (7<<3) /* network news subsystem */
-#define LOG_UUCP (8<<3) /* UUCP subsystem */
-#define LOG_CRON (9<<3) /* clock daemon */
-#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
- /* Facility #10 clashes in DEC UNIX, where */
- /* it's defined as LOG_MEGASAFE for AdvFS */
- /* event logging. */
-#define LOG_FTP (11<<3) /* ftp daemon */
-#define LOG_NTP (12<<3) /* NTP subsystem */
-
- /* other codes through 15 reserved for system use */
-#define LOG_LOCAL0 (16<<3) /* reserved for local use */
-#define LOG_LOCAL1 (17<<3) /* reserved for local use */
-#define LOG_LOCAL2 (18<<3) /* reserved for local use */
-#define LOG_LOCAL3 (19<<3) /* reserved for local use */
-#define LOG_LOCAL4 (20<<3) /* reserved for local use */
-#define LOG_LOCAL5 (21<<3) /* reserved for local use */
-#define LOG_LOCAL6 (22<<3) /* reserved for local use */
-#define LOG_LOCAL7 (23<<3) /* reserved for local use */
-
-#define LOG_NFACILITIES 24 /* current number of facilities */
-#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
- /* facility of pri */
-#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
-
-#ifdef SYSLOG_NAMES
-CODE facilitynames[] = {
- { "auth", LOG_AUTH, },
- { "authpriv", LOG_AUTHPRIV, },
- { "cron", LOG_CRON, },
- { "daemon", LOG_DAEMON, },
- { "ftp", LOG_FTP, },
- { "kern", LOG_KERN, },
- { "lpr", LOG_LPR, },
- { "mail", LOG_MAIL, },
- { "mark", INTERNAL_MARK, }, /* INTERNAL */
- { "news", LOG_NEWS, },
- { "ntp", LOG_NTP, },
- { "security", LOG_AUTH, }, /* DEPRECATED */
- { "syslog", LOG_SYSLOG, },
- { "user", LOG_USER, },
- { "uucp", LOG_UUCP, },
- { "local0", LOG_LOCAL0, },
- { "local1", LOG_LOCAL1, },
- { "local2", LOG_LOCAL2, },
- { "local3", LOG_LOCAL3, },
- { "local4", LOG_LOCAL4, },
- { "local5", LOG_LOCAL5, },
- { "local6", LOG_LOCAL6, },
- { "local7", LOG_LOCAL7, },
- { NULL, -1, }
-};
-#endif
-
-#ifdef KERNEL
-#define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */
-#endif
-
-/*
- * arguments to setlogmask.
- */
-#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
-#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
-
-/*
- * Option flags for openlog.
- *
- * LOG_ODELAY no longer does anything.
- * LOG_NDELAY is the inverse of what it used to be.
- */
-#define LOG_PID 0x01 /* log the pid with each message */
-#define LOG_CONS 0x02 /* log on the console if errors in sending */
-#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
-#define LOG_NDELAY 0x08 /* don't delay open */
-#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
-#define LOG_PERROR 0x20 /* log to stderr as well */
-
-#ifdef KERNEL
-
-#else /* not KERNEL */
-
-#include <sys/cdefs.h>
-#include <stdarg.h>
-
-__BEGIN_DECLS
-void closelog __P((void));
-void openlog __P((const char *, int, int));
-int setlogmask __P((int));
-void syslog __P((int, const char *, ...));
-void vsyslog __P((int, const char *, va_list));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif
diff --git a/c/src/libnetworking/sys/systm.h b/c/src/libnetworking/sys/systm.h
deleted file mode 100644
index 7e14867e70..0000000000
--- a/c/src/libnetworking/sys/systm.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/*-
- * Copyright (c) 1982, 1988, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)systm.h 8.7 (Berkeley) 3/29/95
- * $Id$
- */
-
-#ifndef _SYS_SYSTM_H_
-#define _SYS_SYSTM_H_
-
-#include <machine/cpufunc.h>
-
-extern int securelevel; /* system security level (see init(8)) */
-
-extern int cold; /* nonzero if we are doing a cold boot */
-extern const char *panicstr; /* panic message */
-extern char version[]; /* system version */
-extern char copyright[]; /* system copyright */
-
-extern int nblkdev; /* number of entries in bdevsw */
-extern int nchrdev; /* number of entries in cdevsw */
-extern struct swdevt *swdevt; /* swap-device information */
-extern int nswdev; /* number of swap devices */
-extern int nswap; /* size of swap space */
-
-extern int selwait; /* select timeout address */
-
-extern u_char curpriority; /* priority of current process */
-
-extern int physmem; /* physical memory */
-
-extern dev_t dumpdev; /* dump device */
-extern long dumplo; /* offset into dumpdev */
-
-extern dev_t rootdev; /* root device */
-extern struct vnode *rootvp; /* vnode equivalent to above */
-
-extern dev_t swapdev; /* swapping device */
-extern struct vnode *swapdev_vp;/* vnode equivalent to above */
-
-extern int boothowto; /* reboot flags, from console subsystem */
-extern int bootverbose; /* nonzero to print verbose messages */
-
-/*
- * General function declarations.
- */
-void Debugger __P((const char *msg));
-int nullop __P((void));
-int eopnotsupp __P((void));
-int einval __P((void));
-int seltrue __P((dev_t dev, int which, struct proc *p));
-int ureadc __P((int, struct uio *));
-void *hashinit __P((int count, int type, u_long *hashmask));
-void *phashinit __P((int count, int type, u_long *nentries));
-
-void panic __P((const char *, ...)) __dead2;
-void boot __P((int)) __dead2;
-void cpu_boot __P((int));
-void tablefull __P((const char *));
-int addlog __P((const char *, ...));
-int kvprintf __P((char const *, void (*)(int, void*), void *, int,
- _BSD_VA_LIST_));
-void log __P((int, const char *, ...));
-int printf __P((const char *, ...));
-int sprintf __P((char *buf, const char *, ...));
-void uprintf __P((const char *, ...));
-void ttyprintf __P((struct tty *, const char *, ...));
-
-#define bcopy(f,t,n) memcpy((t),(f),(n))
-#define bzero(p,n) memset((p),(0),(n))
-
-int copystr __P((const void *kfaddr, void *kdaddr, size_t len,
- size_t *lencopied));
-int copyinstr __P((const void *udaddr, void *kaddr, size_t len,
- size_t *lencopied));
-int copyin __P((const void *udaddr, void *kaddr, size_t len));
-int copyout __P((const void *kaddr, void *udaddr, size_t len));
-
-int fubyte __P((const void *base));
-int fuibyte __P((const void *base));
-int subyte __P((void *base, int byte));
-int suibyte __P((void *base, int byte));
-int fuword __P((const void *base));
-int suword __P((void *base, int word));
-int susword __P((void *base, int word));
-
-int hzto __P((struct timeval *tv));
-void realitexpire __P((void *));
-
-struct clockframe;
-void hardclock __P((struct clockframe *frame));
-void softclock __P((void));
-void statclock __P((struct clockframe *frame));
-
-void startprofclock __P((struct proc *));
-void stopprofclock __P((struct proc *));
-void setstatclockrate __P((int hzrate));
-
-void hardupdate __P((long));
-void hardpps __P((struct timeval *tvp, long usec));
-
-#include <sys/libkern.h>
-
-/* Initialize the world */
-extern void consinit(void);
-extern void usrinfoinit(void);
-extern void cpu_initclocks(void);
-extern void vntblinit(void);
-extern void nchinit(void);
-
-/* Finalize the world. */
-void shutdown_nice __P((void));
-
-/*
- * Kernel to clock driver interface.
- */
-void inittodr __P((time_t base));
-void resettodr __P((void));
-void startrtclock __P((void));
-
-/* Timeouts */
-typedef void (timeout_t)(void *); /* actual timeout function type */
-typedef timeout_t *timeout_func_t; /* a pointer to this type */
-
-void timeout(timeout_func_t, void *, int);
-void untimeout(timeout_func_t, void *);
-void logwakeup __P((void));
-
-/* Various other callout lists that modules might want to know about */
-/* shutdown callout list definitions */
-typedef void (*bootlist_fn)(int,void *);
-int at_shutdown(bootlist_fn function, void *arg, int);
-int rm_at_shutdown(bootlist_fn function, void *arg);
-#define SHUTDOWN_PRE_SYNC 0
-#define SHUTDOWN_POST_SYNC 1
-
-/* forking */ /* XXX not yet */
-typedef void (*forklist_fn)(struct proc *parent,struct proc *child,int flags);
-int at_fork(forklist_fn function);
-int rm_at_fork(forklist_fn function);
-
-/* exiting */
-typedef void (*exitlist_fn)(struct proc *procp);
-int at_exit(exitlist_fn function);
-int rm_at_exit(exitlist_fn function);
-
-/* Not exactly a callout LIST, but a callout entry.. */
-/* Allow an external module to define a hardware watchdog tickler */
-/* Normally a process would do this, but there are times when the */
-/* kernel needs to be able to hold off the watchdog, when the process */
-/* is not active, e.g. when dumping core. Costs us a whole 4 bytes to */
-/* make this generic. the variable is in kern_shutdown.c */
-typedef void (*watchdog_tickle_fn)(void);
-extern watchdog_tickle_fn wdog_tickler;
-
-
-/*
- * Common `proc' functions are declared here so that proc.h can be included
- * less often.
- */
-int tsleep __P((void *chan, int pri, char *wmesg, int timo));
-void wakeup __P((void *chan));
-
-#endif /* !_SYS_SYSTM_H_ */
diff --git a/c/src/libnetworking/sys/ttycom.h b/c/src/libnetworking/sys/ttycom.h
deleted file mode 100644
index f2e491bc50..0000000000
--- a/c/src/libnetworking/sys/ttycom.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)ttycom.h 8.1 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_TTYCOM_H_
-#define _SYS_TTYCOM_H_
-
-#include <sys/ioccom.h>
-
-/*
- * Tty ioctl's except for those supported only for backwards compatibility
- * with the old tty driver.
- */
-
-/*
- * Window/terminal size structure. This information is stored by the kernel
- * in order to provide a consistent interface, but is not used by the kernel.
- */
-struct winsize {
- unsigned short ws_row; /* rows, in characters */
- unsigned short ws_col; /* columns, in characters */
- unsigned short ws_xpixel; /* horizontal size, pixels */
- unsigned short ws_ypixel; /* vertical size, pixels */
-};
-
-#define TIOCMODG _IOR('t', 3, int) /* get modem control state */
-#define TIOCMODS _IOW('t', 4, int) /* set modem control state */
-#define TIOCM_LE 0001 /* line enable */
-#define TIOCM_DTR 0002 /* data terminal ready */
-#define TIOCM_RTS 0004 /* request to send */
-#define TIOCM_ST 0010 /* secondary transmit */
-#define TIOCM_SR 0020 /* secondary receive */
-#define TIOCM_CTS 0040 /* clear to send */
-#define TIOCM_CAR 0100 /* carrier detect */
-#define TIOCM_CD TIOCM_CAR
-#define TIOCM_RNG 0200 /* ring */
-#define TIOCM_RI TIOCM_RNG
-#define TIOCM_DSR 0400 /* data set ready */
- /* 8-10 compat */
-#define TIOCEXCL _IO('t', 13) /* set exclusive use of tty */
-#define TIOCNXCL _IO('t', 14) /* reset exclusive use of tty */
- /* 15 unused */
-#define TIOCFLUSH _IOW('t', 16, int) /* flush buffers */
- /* 17-18 compat */
-#define TIOCGETA _IOR('t', 19, struct termios) /* get termios struct */
-#define TIOCSETA _IOW('t', 20, struct termios) /* set termios struct */
-#define TIOCSETAW _IOW('t', 21, struct termios) /* drain output, set */
-#define TIOCSETAF _IOW('t', 22, struct termios) /* drn out, fls in, set */
-#define TIOCGETD _IOR('t', 26, int) /* get line discipline */
-#define TIOCSETD _IOW('t', 27, int) /* set line discipline */
- /* 127-124 compat */
-#define TIOCSBRK _IO('t', 123) /* set break bit */
-#define TIOCCBRK _IO('t', 122) /* clear break bit */
-#define TIOCSDTR _IO('t', 121) /* set data terminal ready */
-#define TIOCCDTR _IO('t', 120) /* clear data terminal ready */
-#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */
-#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */
- /* 117-116 compat */
-#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
-#define TIOCSTI _IOW('t', 114, char) /* simulate terminal input */
-#define TIOCNOTTY _IO('t', 113) /* void tty association */
-#define TIOCPKT _IOW('t', 112, int) /* pty: set/clear packet mode */
-#define TIOCPKT_DATA 0x00 /* data packet */
-#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */
-#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */
-#define TIOCPKT_STOP 0x04 /* stop output */
-#define TIOCPKT_START 0x08 /* start output */
-#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */
-#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */
-#define TIOCPKT_IOCTL 0x40 /* state change of pty driver */
-#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
-#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
-#define TIOCMSET _IOW('t', 109, int) /* set all modem bits */
-#define TIOCMBIS _IOW('t', 108, int) /* bis modem bits */
-#define TIOCMBIC _IOW('t', 107, int) /* bic modem bits */
-#define TIOCMGET _IOR('t', 106, int) /* get all modem bits */
-#define TIOCREMOTE _IOW('t', 105, int) /* remote input editing */
-#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
-#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
-#define TIOCUCNTL _IOW('t', 102, int) /* pty: set/clr usr cntl mode */
-#define TIOCSTAT _IO('t', 101) /* simulate ^T status message */
-#define UIOCCMD(n) _IO('u', n) /* usr cntl op "n" */
-#define TIOCCONS _IOW('t', 98, int) /* become virtual console */
-#define TIOCSCTTY _IO('t', 97) /* become controlling tty */
-#define TIOCEXT _IOW('t', 96, int) /* pty: external processing */
-#define TIOCSIG _IO('t', 95) /* pty: generate signal */
-#define TIOCDRAIN _IO('t', 94) /* wait till output drained */
-#define TIOCMSDTRWAIT _IOW('t', 91, int) /* modem: set wait on close */
-#define TIOCMGDTRWAIT _IOR('t', 90, int) /* modem: get wait on close */
-#define TIOCTIMESTAMP _IOR('t', 89, struct timeval) /* enable/get timestamp
- * of last input event */
-#define TIOCDCDTIMESTAMP _IOR('t', 88, struct timeval) /* enable/get timestamp
- * of last DCd rise */
-#define TIOCSDRAINWAIT _IOW('t', 87, int) /* set ttywait timeout */
-#define TIOCGDRAINWAIT _IOR('t', 86, int) /* get ttywait timeout */
-#define TIOCDSIMICROCODE _IO('t', 85) /* download microcode to
- * DSI Softmodem */
-
-#define TTYDISC 0 /* termios tty line discipline */
-#define TABLDISC 3 /* tablet discipline */
-#define SLIPDISC 4 /* serial IP discipline */
-#define PPPDISC 5 /* PPP discipline */
-
-#endif /* !_SYS_TTYCOM_H_ */
diff --git a/c/src/libnetworking/sys/ttydefaults.h b/c/src/libnetworking/sys/ttydefaults.h
deleted file mode 100644
index 68f0ddbe77..0000000000
--- a/c/src/libnetworking/sys/ttydefaults.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94
- * $Id$
- */
-
-/*
- * System wide defaults for terminal state.
- */
-#ifndef _SYS_TTYDEFAULTS_H_
-#define _SYS_TTYDEFAULTS_H_
-
-/*
- * Defaults on "first" open.
- */
-#define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY)
-#define TTYDEF_OFLAG (OPOST | ONLCR)
-#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
-#define TTYDEF_CFLAG (CREAD | CS8 | HUPCL)
-#define TTYDEF_SPEED (B9600)
-
-/*
- * Control Character Defaults
- */
-#define CTRL(x) (x&037)
-#define CEOF CTRL('d')
-#define CEOL 0xff /* XXX avoid _POSIX_VDISABLE */
-#define CERASE 0177
-#define CINTR CTRL('c')
-#define CSTATUS CTRL('t')
-#define CKILL CTRL('u')
-#define CMIN 1
-#define CQUIT 034 /* FS, ^\ */
-#define CSUSP CTRL('z')
-#define CTIME 0
-#define CDSUSP CTRL('y')
-#define CSTART CTRL('q')
-#define CSTOP CTRL('s')
-#define CLNEXT CTRL('v')
-#define CDISCARD CTRL('o')
-#define CWERASE CTRL('w')
-#define CREPRINT CTRL('r')
-#define CEOT CEOF
-/* compat */
-#define CBRK CEOL
-#define CRPRNT CREPRINT
-#define CFLUSH CDISCARD
-
-/* PROTECTED INCLUSION ENDS HERE */
-#endif /* !_SYS_TTYDEFAULTS_H_ */
-
-/*
- * #define TTYDEFCHARS to include an array of default control characters.
- */
-#ifdef TTYDEFCHARS
-static cc_t ttydefchars[NCCS] = {
- CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
- _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
- CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE
-};
-#undef TTYDEFCHARS
-#endif
diff --git a/c/src/libnetworking/sys/ucred.h b/c/src/libnetworking/sys/ucred.h
deleted file mode 100644
index d3899c3b4c..0000000000
--- a/c/src/libnetworking/sys/ucred.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1989, 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.
- *
- * @(#)ucred.h 8.4 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _SYS_UCRED_H_
-#define _SYS_UCRED_H_
-
-/*
- * Credentials.
- */
-struct ucred {
- u_short cr_ref; /* reference count */
- uid_t cr_uid; /* effective user id */
- short cr_ngroups; /* number of groups */
- gid_t cr_groups[NGROUPS]; /* groups */
-};
-#define cr_gid cr_groups[0]
-#define NOCRED ((struct ucred *)0) /* no credential available */
-#define FSCRED ((struct ucred *)-1) /* filesystem credential */
-
-#ifdef KERNEL
-#define crhold(cr) (cr)->cr_ref++
-
-struct ucred *crcopy __P((struct ucred *cr));
-struct ucred *crdup __P((struct ucred *cr));
-void crfree __P((struct ucred *cr));
-struct ucred *crget __P((void));
-int suser __P((struct ucred *cred, u_short *acflag));
-int groupmember __P((gid_t gid, struct ucred *cred));
-#endif /* KERNEL */
-
-#endif /* !_SYS_UCRED_H_ */
diff --git a/c/src/libnetworking/sys/uio.h b/c/src/libnetworking/sys/uio.h
deleted file mode 100644
index 305941500d..0000000000
--- a/c/src/libnetworking/sys/uio.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993, 1994
- * 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.
- *
- * @(#)uio.h 8.5 (Berkeley) 2/22/94
- * $Id$
- */
-
-#ifndef _SYS_UIO_H_
-#define _SYS_UIO_H_
-
-/*
- * XXX
- * iov_base should be a void *.
- */
-struct iovec {
- char *iov_base; /* Base address. */
- size_t iov_len; /* Length. */
-};
-
-enum uio_rw { UIO_READ, UIO_WRITE };
-
-/* Segment flag values. */
-enum uio_seg {
- UIO_USERSPACE, /* from user data space */
- UIO_SYSSPACE, /* from system space */
- UIO_USERISPACE, /* from user I space */
- UIO_NOCOPY /* don't copy, already in object */
-};
-
-#ifdef KERNEL
-struct uio {
- struct iovec *uio_iov;
- int uio_iovcnt;
- off_t uio_offset;
- int uio_resid;
- enum uio_seg uio_segflg;
- enum uio_rw uio_rw;
- struct proc *uio_procp;
-};
-
-/*
- * Limits
- */
-#define UIO_MAXIOV 1024 /* max 1K of iov's */
-#define UIO_SMALLIOV 8 /* 8 on stack, else malloc */
-#endif /* KERNEL */
-
-#ifdef KERNEL
-
-int uiomove __P((caddr_t, int, struct uio *));
-
-#else /* !KERNEL */
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-ssize_t readv __P((int, const struct iovec *, int));
-ssize_t writev __P((int, const struct iovec *, int));
-__END_DECLS
-
-#endif /* KERNEL */
-
-#endif /* !_SYS_UIO_H_ */
diff --git a/c/src/libnetworking/syslog.h b/c/src/libnetworking/syslog.h
deleted file mode 100644
index 6d223d00b7..0000000000
--- a/c/src/libnetworking/syslog.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/syslog.h>
diff --git a/c/src/libnetworking/vm/vm.h b/c/src/libnetworking/vm/vm.h
deleted file mode 100644
index 19ea10e5eb..0000000000
--- a/c/src/libnetworking/vm/vm.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 1991, 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.
- *
- * @(#)vm.h 8.2 (Berkeley) 12/13/93
- * $Id$
- */
-
-#ifndef VM_H
-#define VM_H
-
-typedef char vm_inherit_t; /* XXX: inheritance codes */
-typedef u_char vm_prot_t; /* protection codes */
-
-union vm_map_object;
-typedef union vm_map_object vm_map_object_t;
-
-struct vm_map_entry;
-typedef struct vm_map_entry *vm_map_entry_t;
-
-struct vm_map;
-typedef struct vm_map *vm_map_t;
-
-struct vm_object;
-typedef struct vm_object *vm_object_t;
-
-#ifndef KERNEL
-/*
- * This is defined in <sys/types.h> for the kernel so that non-vm kernel
- * sources (mainly Mach-derived ones such as ddb) don't have to include
- * vm stuff. Defining it there for applications might break things.
- * Define it here for "applications" that include vm headers (e.g.,
- * genassym).
- */
-typedef int boolean_t;
-
-/*
- * This is defined in <sys/types.h> for the kernel so that vnode_if.h
- * doesn't have to include <vm/vm.h>.
- */
-struct vm_page;
-typedef struct vm_page *vm_page_t;
-#endif
-
-#endif /* VM_H */
diff --git a/c/src/libnetworking/vm/vm_extern.h b/c/src/libnetworking/vm/vm_extern.h
deleted file mode 100644
index 720d42dc28..0000000000
--- a/c/src/libnetworking/vm/vm_extern.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-
- * 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.
- *
- * @(#)vm_extern.h 8.2 (Berkeley) 1/12/94
- * $Id$
- */
-
-#ifndef _VM_EXTERN_H_
-#define _VM_EXTERN_H_
-
-struct buf;
-struct proc;
-struct vmspace;
-struct vmtotal;
-struct mount;
-struct vnode;
-
-#ifdef KERNEL
-
-#ifdef TYPEDEF_FOR_UAP
-int getpagesize __P((struct proc * p, void *, int *));
-int madvise __P((struct proc *, void *, int *));
-int mincore __P((struct proc *, void *, int *));
-int mprotect __P((struct proc *, void *, int *));
-int msync __P((struct proc *, void *, int *));
-int munmap __P((struct proc *, void *, int *));
-int obreak __P((struct proc *, void *, int *));
-int sbrk __P((struct proc *, void *, int *));
-int smmap __P((struct proc *, void *, int *));
-int sstk __P((struct proc *, void *, int *));
-int swapon __P((struct proc *, void *, int *));
-#endif
-
-void faultin __P((struct proc *p));
-int grow __P((struct proc *, u_int));
-int kernacc __P((caddr_t, int, int));
-vm_offset_t kmem_alloc __P((vm_map_t, vm_size_t));
-vm_offset_t kmem_alloc_pageable __P((vm_map_t, vm_size_t));
-vm_offset_t kmem_alloc_wait __P((vm_map_t, vm_size_t));
-void kmem_free __P((vm_map_t, vm_offset_t, vm_size_t));
-void kmem_free_wakeup __P((vm_map_t, vm_offset_t, vm_size_t));
-void kmem_init __P((vm_offset_t, vm_offset_t));
-vm_offset_t kmem_malloc __P((vm_map_t, vm_size_t, boolean_t));
-vm_map_t kmem_suballoc __P((vm_map_t, vm_offset_t *, vm_offset_t *, vm_size_t, boolean_t));
-void munmapfd __P((struct proc *, int));
-int pager_cache __P((vm_object_t, boolean_t));
-int swaponvp __P((struct proc *, struct vnode *, dev_t , u_long));
-void swapout_procs __P((void));
-int useracc __P((caddr_t, int, int));
-int vm_fault __P((vm_map_t, vm_offset_t, vm_prot_t, boolean_t));
-void vm_fault_copy_entry __P((vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t));
-void vm_fault_unwire __P((vm_map_t, vm_offset_t, vm_offset_t));
-int vm_fault_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
-int vm_fault_user_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
-int vm_fork __P((struct proc *, struct proc *));
-int vm_mmap __P((vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, caddr_t, vm_ooffset_t));
-vm_offset_t vm_page_alloc_contig __P((vm_offset_t, vm_offset_t, vm_offset_t, vm_offset_t));
-void vm_set_page_size __P((void));
-void vmmeter __P((void));
-struct vmspace *vmspace_alloc __P((vm_offset_t, vm_offset_t, int));
-struct vmspace *vmspace_fork __P((struct vmspace *));
-void vmspace_free __P((struct vmspace *));
-void vnode_pager_setsize __P((struct vnode *, vm_ooffset_t));
-void vnode_pager_umount __P((struct mount *));
-void vnode_pager_uncache __P((struct vnode *));
-void vslock __P((caddr_t, u_int));
-void vsunlock __P((caddr_t, u_int, int));
-void vm_object_print __P((/* db_expr_t */ int, boolean_t, /* db_expr_t */ int,
- char *));
-void vm_fault_quick __P((caddr_t v, int prot));
-
-#endif /* KERNEL */
-
-#endif /* !_VM_EXTERN_H_ */
diff --git a/c/src/libnetworking/vm/vm_kern.h b/c/src/libnetworking/vm/vm_kern.h
deleted file mode 100644
index b1e073dd3a..0000000000
--- a/c/src/libnetworking/vm/vm_kern.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * The Mach Operating System project at Carnegie-Mellon University.
- *
- * 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.
- *
- * from: @(#)vm_kern.h 8.1 (Berkeley) 6/11/93
- *
- *
- * Copyright (c) 1987, 1990 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Authors: Avadis Tevanian, Jr., Michael Wayne Young
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- *
- * $Id$
- */
-
-#ifndef _VM_VM_KERN_H_
-#define _VM_VM_KERN_H_ 1
-
-/* Kernel memory management definitions. */
-extern vm_map_t buffer_map;
-extern vm_map_t kernel_map;
-extern vm_map_t kmem_map;
-extern vm_map_t mb_map;
-extern int mb_map_full;
-extern vm_map_t io_map;
-extern vm_map_t clean_map;
-extern vm_map_t phys_map;
-extern vm_map_t exec_map;
-extern vm_map_t u_map;
-
-extern vm_offset_t kernel_vm_end;
-
-#endif /* _VM_VM_KERN_H_ */
diff --git a/c/src/libnetworking/vm/vm_param.h b/c/src/libnetworking/vm/vm_param.h
deleted file mode 100644
index f1cfca98ec..0000000000
--- a/c/src/libnetworking/vm/vm_param.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * The Mach Operating System project at Carnegie-Mellon University.
- *
- * 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.
- *
- * from: @(#)vm_param.h 8.1 (Berkeley) 6/11/93
- *
- *
- * Copyright (c) 1987, 1990 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Authors: Avadis Tevanian, Jr., Michael Wayne Young
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- *
- * $Id$
- */
-
-/*
- * Machine independent virtual memory parameters.
- */
-
-#ifndef _VM_PARAM_
-#define _VM_PARAM_
-
-#include <machine/vmparam.h>
-
-/*
- * The machine independent pages are refered to as PAGES. A page
- * is some number of hardware pages, depending on the target machine.
- */
-#define DEFAULT_PAGE_SIZE 4096
-
-#if 0
-
-/*
- * All references to the size of a page should be done with PAGE_SIZE
- * or PAGE_SHIFT. The fact they are variables is hidden here so that
- * we can easily make them constant if we so desire.
- */
-#ifndef PAGE_SIZE
-#define PAGE_SIZE cnt.v_page_size /* size of page */
-#endif
-#ifndef PAGE_MASK
-#define PAGE_MASK page_mask /* size of page - 1 */
-#endif
-#ifndef PAGE_SHIFT
-#define PAGE_SHIFT page_shift /* bits to shift for pages */
-#endif
-
-#endif
-
-#ifdef KERNEL
-extern vm_size_t page_mask;
-extern int page_shift;
-
-#endif
-
-/*
- * CTL_VM identifiers
- */
-#define VM_METER 1 /* struct vmmeter */
-#define VM_LOADAVG 2 /* struct loadavg */
-#define VM_V_FREE_MIN 3 /* cnt.v_free_min */
-#define VM_V_FREE_TARGET 4 /* cnt.v_free_target */
-#define VM_V_FREE_RESERVED 5 /* cnt.v_free_reserved */
-#define VM_V_INACTIVE_TARGET 6 /* cnt.v_inactive_target */
-#define VM_V_CACHE_MIN 7 /* cnt.v_cache_max */
-#define VM_V_CACHE_MAX 8 /* cnt.v_cache_min */
-#define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min */
-#define VM_PAGEOUT_ALGORITHM 10 /* pageout algorithm */
-#define VM_SWAPPING_ENABLED 11 /* swapping enabled */
-#define VM_MAXID 12 /* number of valid vm ids */
-
-#define CTL_VM_NAMES { \
- { 0, 0 }, \
- { "vmmeter", CTLTYPE_STRUCT }, \
- { "loadavg", CTLTYPE_STRUCT }, \
- { "v_free_min", CTLTYPE_INT }, \
- { "v_free_target", CTLTYPE_INT }, \
- { "v_free_reserved", CTLTYPE_INT }, \
- { "v_inactive_target", CTLTYPE_INT }, \
- { "v_cache_min", CTLTYPE_INT }, \
- { "v_cache_max", CTLTYPE_INT }, \
- { "v_pageout_free_min", CTLTYPE_INT}, \
- { "pageout_algorithm", CTLTYPE_INT}, \
- { "swapping_enabled", CTLTYPE_INT},\
-}
-
-/*
- * Return values from the VM routines.
- */
-#define KERN_SUCCESS 0
-#define KERN_INVALID_ADDRESS 1
-#define KERN_PROTECTION_FAILURE 2
-#define KERN_NO_SPACE 3
-#define KERN_INVALID_ARGUMENT 4
-#define KERN_FAILURE 5
-#define KERN_RESOURCE_SHORTAGE 6
-#define KERN_NOT_RECEIVER 7
-#define KERN_NO_ACCESS 8
-
-#ifndef ASSEMBLER
-/*
- * Convert addresses to pages and vice versa.
- * No rounding is used.
- */
-#ifdef KERNEL
-#define num_pages(x) \
- ((vm_offset_t)((((vm_offset_t)(x)) + PAGE_MASK) >> PAGE_SHIFT))
-
-extern vm_size_t mem_size; /* size of physical memory (bytes) */
-extern vm_offset_t first_addr; /* first physical page */
-extern vm_offset_t last_addr; /* last physical page */
-#endif /* KERNEL */
-#endif /* ASSEMBLER */
-#endif /* _VM_PARAM_ */
diff --git a/c/src/libnetworking/wrapup/Makefile.in b/c/src/libnetworking/wrapup/Makefile.in
deleted file mode 100644
index 55b9f618ed..0000000000
--- a/c/src/libnetworking/wrapup/Makefile.in
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NET_PIECES=kern lib libc net netinet nfs rtems
-OBJS=$(foreach piece, $(NET_PIECES), ../$(piece)/$(ARCH)/*.o)
-LIB=$(ARCH)/libnetworking.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/librtems++/README b/c/src/librtems++/README
deleted file mode 100644
index 65b0eb980e..0000000000
--- a/c/src/librtems++/README
+++ /dev/null
@@ -1,266 +0,0 @@
-#
-# $Id$
-#
-
-RTEMS C++ Library
-=================
-
-The RTEMS C++ Library or librtems++ is a wrapper for the RTEMS API.
-The classes provide as close a match to the RTEMS C API, for
-performance, to share the existing C documentation as much as
-possible, and to allow easy tracking of any changes to the RTEMS C
-API.
-
-The C++ interface only uses RTEMS API calls. No external references
-or internal interfaces are used. This allows the classes to be used
-in separately compiled modules or applications which link to the RTEMS
-trap interface.
-
-(This is the goal, which has not quite been reached. The TOD macro for
-micro-seconds to ticks is used, and this uses an internal global RTEMS
-variable)
-
-The C++ interface does not deal with RTEMS initialisation or the
-device driver interface. The current view is these parts of a system
-are best handled in the current manner. This means BSP for
-initialisation and the C API for drivers.
-
-RTEMS C++ Classes
-=================
-
-The classes map to the managers of RTEMS.
-
-The methods have default values selected which try to fit most cases
-or follow the documented RTEMS default values. Moving from left to
-right the parameters become less used, allowing the defaults to be
-selected. An example is the scope parameter for most classes. This
-can be local or global. I assume that most RTEMS objects are local,
-therefore it has been made the last parameter.
-
-Inline methods have been used for methods which are commonly used in
-applications. This tries to add the minimum of overhead. For
-example, the methods to send or receive events are inline, while all
-methods for control of a task are not.
-
-The RTEMS types, enumerations, and defines are used. If a new type,
-enumeration or define is made it will map directly to the RTEMS
-equivalent. For example the enumeration Scope is defined for various
-classes which can be local or global. The elements of the enumeration
-are forced to the same value as the RTEMS values. An enumeration is
-used in this case to allow the compiler to type check a little
-better. It saves having to check only RTEMS_LOCAL or RTEMS_GLOBAL is
-passed as a parameter (I am not convinced this is really needed as the
-goal was to not define anything and to only use what RTEMS provided).
-
-Where possible the various parts of an option bit set, or mode can be
-controlled separately or controlled as a group. An example is the
-task mode. The RTEMS C API allows a set of modes to be modified at
-once. The TaskMode class allows this to occur, while also providing
-methods to control a single mode item.
-
-The name of an object is always passed as a string. The classes turn
-the string into a rtems_name variable. The string does not have to be
-nul character terminated.
-
-The RTEMS C API uses 'delete' to remove or kill an RTEMS object. This
-is a reserved word in C++, so the word 'destroy' is used instead.
-
-Calling the classes from interrupts follows the rules of RTEMS. An
-exception introduced by the class library is the last status code.
-There is only one last status code for each instance of the library's
-classes and it is not protected. This needs to be watched for. Maybe
-a better solution needs to be found, such as interrupt calls do not set
-the last status code.
-
-RTEMS objects created by the C++ library can be operated on by C code
-just as any other RTEMS object. If limitations exist they should be
-documented in under the class.
-
-RTEMS Object Ownership
-======================
-
-The concept of ownership of an object is not defined as part of the
-RTEMS C API. A piece of code executing as part a task can create a
-message queue. Another piece of code running as part of a different
-task can destroy the message queue. Correct behavior between the code
-that creates the message queue and the code which destroy's the
-message queue must be provided by the programmer.
-
-The librtems++ supports the concept of ownership of an RTEMS object.
-Only the C++ object that creates the RTEMS object can destroy it. A
-C++ object can connect to an existing RTEMS object and control it,
-how-ever it can not destroy it.
-
-Copy constructors and assignment operators are provided to in-force
-this rule.
-
-Ownership only applies to classes that create RTEMS objects. These
-classes contain a flag which signals ownership of the id.
-
-Timeouts
-========
-
-The timeout value is specified in micro-seconds. The classes turn the
-micro-second timeout value into ticks required by the RTEMS C API.
-
-This causes a problem for timeout values which are less than one tick.
-This case is tested for and the timeout value is set to one tick. All
-other cases round down to the nearest tick.
-
-Status Codes
-============
-
-All classes which form the C++ API are derived from the StatusCode
-class. This class provides a common method for handling the status
-code returned by RTEMS.
-
-The last returned status code is held in the StatusCode object. It
-can be queried directly, or as a boolean. You can also obtain an
-error string for the status code.
-
-The setting of a status code is restricted to derived classes.
-
-The last status code attribute of the class is only ever set to an
-RTEMS defined status code.
-
-Event Class
-===========
-
-The event class allows users to send and receive events to and from
-tasks.
-
-Events objects are by default connected the RTEMS_SELF task. A send
-or receive will operate on the task currently executing.
-
-An Event object can be connected to a task using the connect method.
-The name is the name of the task. Connection can also be achieved by
-using the copy constructor or assignment operator.
-
-Events can be sent to a task by specifying an RTEMS task id, or by
-passing a reference to a Task object.
-
-Interrupt Class
-===============
-
-The interrupt class allows a protected virtual method of a derived
-class to be an interrupt handler.
-
-You derive from this class and provide the handler method. The next
-interrupt after the vector is caught will cause the handler method to
-be entered.
-
-You can chain the interrupt by calling the chain method. If the old
-handler is not an instance of this class the chain is passed as "void
-(*)(void)". If it is an instance of this class, the handler method is
-directly called. (Chaining has not been tested)
-
-This class implements a table of pointers to the last instance to
-catch the interrupt. A static method of the class catches the
-interrupt and re-directs the interrupt to the instance in the table.
-The re-direct adds a additional virtual function call and return to
-the overhead of the interrupt. For a i386 type processor this is
-about 12 instructions including the function call entry.
-
-Message Queue Class
-===================
-
-The MessageQueue class allows message queue's to be created, or
-connected too. Only the creator can destroy a message queue.
-
-The class implements, sending, urgent sending, broadcast, flushing,
-and receiving.
-
-Semaphore Class
-===============
-
-The Semaphore class allows semaphores to be created, or connected
-too. Only the creator can destroy a semaphore.
-
-All types of semaphores can be created.
-
-(Not tested in the test code)
-
-Task Class
-==========
-
-The Task class allows tasks to be created, or connected too. Only the
-creator can destroy a task.
-
-If creating a task, derive from the Task class and provide the body
-method. The body method is the entry point for a task. When
-connecting to an existing task, no body method is required to be
-provided. It is how-ever required if you create a task. This is not
-enforced by the compiler, how-ever the default body will be entered,
-and it contains no code. The RTEMS default behaviour for a task that
-returns occurs.
-
-The mode of a task is controlled using the TaskMode class.
-
-The Task class allows you to start, restart, suspend, and resume a
-task. You can control the priority, and access the note-pad
-registers. The task can also be slept using the wake_after and
-wake_when methods.
-
-Currently the task argument is used to pass the 'this' pointer to the
-libraries default task body. The actual argument is held in the class
-instance and passed to the virtual body method. This means of passing
-the 'this' pointer through RTEMS to the default task body requires the
-actual task object to perform a restart call. This is not really the
-best solution to the problem. Another solution is to remove a notpad
-register, say 31 from the task and use it. This would mean any Task
-object could stop and restart a task how-ever a notpad register is
-lost. Any other ideas are welcome.
-
-Task Mode Class
-===============
-
-The TaskMode class allows you to query or change the mode of a task.
-The object only operates on the currently executing task.
-
-The standard flags defined in RTEMS are used.
-
-Methods are provided to operate on a group of modes which are required
-to be changed in a single operation. The mode and mask is specified
-by ORing the required flags as documented in the RTEMS manual.
-
-Methods are provided for accessing and controlling a specific mode.
-The returned value will only contain the requested mode's flags, and
-only the that mode will be changed when setting a mode.
-
-Timer Class
-===========
-
-The Timer class allows timers to be created. You cannot connect to an
-existing timer.
-
-You derive from the Timer class and provide the trigger method. This
-method is called when the timer triggers or times out.
-
-You can request a single shot timer using the fire_after or fire_when
-methods, or a periodic timer by calling the repeat_file_at method.
-
-You cannot copy timer objects.
-
-Contact
-=======
-Send any question to me Chris Johns at cjohns@plessey.com.au, or the RTEMS
-mailing list.
-
-To Do
-=====
-
-1) Develop a complete test suite (under way, cjohns@plessey.com.au).
-
-2) Complete wrapping the remaining RTEMS C API.
-
-3) Provide light weight cout/cerr/clog classes based on printf for
-embedded systems.
-
-4) Provide a memory serial class which maps the <</>> operators onto
-raw memory in network byte order independent of CPU byte order.
-
-5) Fix the Task class so any Task object can restart a task.
-
-6) Provide some frame work classes which allow actor type objects that
-start in an ordered manner.
-
diff --git a/c/src/librtems++/include/rtems++/rtemsEvent.h b/c/src/librtems++/include/rtems++/rtemsEvent.h
deleted file mode 100644
index 3cc19eeb32..0000000000
--- a/c/src/librtems++/include/rtems++/rtemsEvent.h
+++ /dev/null
@@ -1,127 +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.
-
- ------------------------------------------------------------------------
-
- rtemsEvent class.
-
- This class allows the user to send and receive RTEMS events to a task.
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsEvent_h_)
-#define _rtemsEvent_h_
-
-#include <rtems++/rtemsStatusCode.h>
-#include <rtems++/rtemsTask.h>
-
-/* ----
- rtemsEvent
-*/
-
-class rtemsEvent
- : public rtemsStatusCode
-{
-public:
- // attribute a task can have
-
- enum WaitMode { wait = RTEMS_WAIT,
- no_wait = RTEMS_NO_WAIT};
- enum Condition { any = RTEMS_EVENT_ANY,
- all = RTEMS_EVENT_ALL};
-
- // only the first 4 characters of the name are taken
-
- // connect to a task
- rtemsEvent(const char* name, rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
-
- // copy and default constructors
- rtemsEvent(const rtemsEvent& event);
- rtemsEvent();
-
- virtual ~rtemsEvent();
-
- // connect to an existing task object, will not be the owner
- const rtemsEvent& operator=(const rtemsEvent& event);
- virtual const rtems_status_code connect(const char *name,
- const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
-
- // send an event
- inline const rtems_status_code send(const rtems_id task,
- const rtems_event_set events);
- inline const rtems_status_code send(const rtemsTask& task,
- const rtems_event_set events) ;
- inline const rtems_status_code send(const rtems_event_set events);
-
- // receive an event, can block a task if no events waiting
- inline const rtems_status_code receive(const rtems_event_set event_in,
- rtems_event_set& event_out,
- const rtems_interval micro_secs = 0,
- const WaitMode wait = wait,
- const Condition condition = any);
-
- // object id, and name
- const rtems_id task_id_is() const { return id; }
- const rtems_name task_name_is() const { return name; }
-
-private:
- // task name
- rtems_name name;
-
- // the rtems task id, object handle
- rtems_id id;
-
-};
-
-const rtems_status_code rtemsEvent::send(const rtems_id task,
- const rtems_event_set events)
-{
- set_status_code(rtems_event_send(task, events));
- return last_status_code();
-}
-
-const rtems_status_code rtemsEvent::send(const rtemsTask& task,
- const rtems_event_set events)
-{
- set_status_code(rtems_event_send(task.id_is(), events));
- return last_status_code();
-}
-
-const rtems_status_code rtemsEvent::send(const rtems_event_set events)
-{
- set_status_code(rtems_event_send(id, events));
- return last_status_code();
-}
-
-const rtems_status_code rtemsEvent::receive(const rtems_event_set event_in,
- rtems_event_set& event_out,
- const rtems_interval micro_secs,
- const WaitMode wait,
- const Condition condition)
-{
- rtems_interval usecs =
- micro_secs && (micro_secs < _TOD_Microseconds_per_tick) ?
- _TOD_Microseconds_per_tick : micro_secs;
- set_status_code(rtems_event_receive(event_in,
- wait | condition,
- TOD_MICROSECONDS_TO_TICKS(usecs),
- &event_out));
- return last_status_code();
-}
-
-#endif // _rtemsEvent_h_
-
-
-
-
-
diff --git a/c/src/librtems++/include/rtems++/rtemsInterrupt.h b/c/src/librtems++/include/rtems++/rtemsInterrupt.h
deleted file mode 100644
index f722eb7683..0000000000
--- a/c/src/librtems++/include/rtems++/rtemsInterrupt.h
+++ /dev/null
@@ -1,105 +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.
-
- ------------------------------------------------------------------------
-
- rtemsInterrupt class.
-
- This class catches an interrupt and passes control to the user's
- derived class throught the handler method.
-
- The interrupt is released back to the previous handler when this
- object destructs.
-
- The old handler can be chained to after the interrupt is
- caught. Watch the stack usage!
-
- More than one instance of this class can catch the same vector. The
- application will have to chain to the other objects if required. If
- the old handler is not an instance of this class the chain is passed
- as "void (*)(void)". If it is an instance of this class, the handler
- method is directly called.
-
- The isr catch extends the documented return codes with :
-
- RTEMS_RESOURCE_IN_USE = interrupt already caught
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsInterrupt_h_)
-#define _rtemsInterrupt_h_
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- rtemsInterrupt
-*/
-
-class rtemsInterrupt
- : public rtemsStatusCode
-{
-public:
- rtemsInterrupt();
- virtual ~rtemsInterrupt();
-
- // catch the interrupt
- virtual const rtems_status_code isr_catch(const rtems_vector_number vector);
-
- // release the interrupt back to the previous handle
- virtual const rtems_status_code release();
-
- // the old handler
- const rtems_isr_entry old_isr_handler() const { return old_handler; }
-
-protected:
-
- // called after the interrupt is caught and it goes off
- virtual void handler() = 0;
-
- // chain to the previous handler,
- inline void chain() const;
-
-private:
- const rtemsInterrupt& operator=(const rtemsInterrupt& );
- rtemsInterrupt(const rtemsInterrupt& );
-
- // the vector caught
- rtems_vector_number vector;
-
- // true when the interrupt is caught
- bool caught;
-
- // returned when catching the interrupt
- rtems_isr_entry old_handler;
-
- // old interrupt table entry
- rtemsInterrupt *old_interrupt;
-
- // common handler to redirect the interrupts
- static void redirector(rtems_vector_number vector);
-};
-
-void rtemsInterrupt::chain() const
-{
- if (old_interrupt)
- old_interrupt->handler();
- else if (old_handler)
- ((void(*)()) old_handler)();
-}
-
-#endif // _rtemsInterrupt_h_
-
-
-
-
-
diff --git a/c/src/librtems++/include/rtems++/rtemsMessageQueue.h b/c/src/librtems++/include/rtems++/rtemsMessageQueue.h
deleted file mode 100644
index 910c7279f7..0000000000
--- a/c/src/librtems++/include/rtems++/rtemsMessageQueue.h
+++ /dev/null
@@ -1,176 +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.
-
- ------------------------------------------------------------------------
-
- rtemsMessageQueue class.
-
- This class allows the user to create a RTEMS message queue, or to
- access and manage an already existing message queue.
-
- The first constructor with the message queue parameters creates a
- RTEMS message queue object. The destructor of this object also
- deletes the message queue object. The last status code should be
- checked after construction to see if the create completed
- successfully.
-
- The second constructor connects to an existing message queue
- object. The last status code should be checked after construction to
- see if the message queue existed.
-
- The third constructor is a copy constructor. Connects to an existing
- object which is in scope.
-
- The fourth constructor allows for the message queue to be created
- after construction, or to connect to a message queue later.
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsMessageQueue_h_)
-#define _rtemsMessageQueue_h_
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- rtemsMessageQueue
-*/
-
-class rtemsMessageQueue
- : public rtemsStatusCode
-{
-public:
- // attribute a message queue can have
- enum WaitMode { wait_by_fifo = RTEMS_FIFO,
- wait_by_priority = RTEMS_PRIORITY };
- enum Scope { local = RTEMS_LOCAL,
- global = RTEMS_GLOBAL };
-
- // only the first 4 characters of the name are taken
-
- // creates a message queue
- rtemsMessageQueue(const char* name,
- const rtems_unsigned32 count,
- const rtems_unsigned32 max_message_size,
- const WaitMode wait_mode = wait_by_fifo,
- const Scope scope = local);
-
- // connects to a message queue
- rtemsMessageQueue(const char *name, const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
-
- // copy and default constructors
- rtemsMessageQueue(const rtemsMessageQueue& message_queue);
- rtemsMessageQueue();
-
- // only the creator's destructor will delete the actual object
- virtual ~rtemsMessageQueue();
-
- // create or destroy (delete) the message queue
- virtual const rtems_status_code create(const char* name,
- const rtems_unsigned32 count,
- const rtems_unsigned32 max_message_size,
- const WaitMode wait_mode = wait_by_fifo,
- const Scope scope = local);
- virtual const rtems_status_code destroy();
-
- // connect to an existing message queue object, will not be the owner
- const rtemsMessageQueue& operator=(const rtemsMessageQueue& message_queue);
- virtual const rtems_status_code connect(const char *name,
- const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
-
- // send a message of size from the buffer
- inline const rtems_status_code send(const void *buffer,
- const rtems_unsigned32 size);
- inline const rtems_status_code urgent(const void *buffer,
- const rtems_unsigned32 size);
- inline const rtems_status_code broadcast(const void *buffer,
- const rtems_unsigned32 size,
- rtems_unsigned32& count);
-
- // receive a message of size, the timeout is in micro-secs
- inline const rtems_status_code receive(const void *buffer,
- rtems_unsigned32& size,
- rtems_interval micro_secs = RTEMS_NO_TIMEOUT,
- bool wait = true);
-
- // flush a message queue, returning the number of messages dropped
- inline const rtems_status_code flush(rtems_unsigned32& size);
-
- // object id, and name
- const rtems_id id_is() const { return id; }
- const rtems_name name_is() const { return name; }
- const char *name_string() const { return name_str; }
-
-private:
-
- // make this object reference an invalid RTEMS object
- void make_invalid();
-
- // message queue name
- rtems_name name;
- char name_str[5];
-
- // owner, true if this object owns the message queue
- // will delete the message queue when it destructs
- bool owner;
-
- // the rtems id, object handle
- rtems_id id;
-};
-
-const rtems_status_code rtemsMessageQueue::send(const void *buffer,
- const rtems_unsigned32 size)
-{
- return set_status_code(rtems_message_queue_send(id, (void*) buffer, size));
-}
-
-const rtems_status_code rtemsMessageQueue::urgent(const void *buffer,
- const rtems_unsigned32 size)
-{
- return set_status_code(rtems_message_queue_urgent(id, (void*) buffer, size));
-}
-
-const rtems_status_code rtemsMessageQueue::broadcast(const void *buffer,
- const rtems_unsigned32 size,
- rtems_unsigned32& count)
-{
- return set_status_code(rtems_message_queue_broadcast(id,
- (void*) buffer,
- size,
- &count));
-}
-
-const rtems_status_code rtemsMessageQueue::receive(const void *buffer,
- rtems_unsigned32& size,
- rtems_interval micro_secs,
- bool wait)
-{
- rtems_interval usecs =
- micro_secs && (micro_secs < _TOD_Microseconds_per_tick) ?
- _TOD_Microseconds_per_tick : micro_secs;
- return set_status_code(rtems_message_queue_receive(id,
- (void*) buffer,
- &size,
- wait ? RTEMS_WAIT : RTEMS_NO_WAIT,
- TOD_MICROSECONDS_TO_TICKS(usecs)));
-}
-
-const rtems_status_code rtemsMessageQueue::flush(rtems_unsigned32& count)
-{
- return set_status_code(rtems_message_queue_flush(id, &count));
-}
-
-#endif // _rtemsMessageQueue_h_
-
-
-
-
diff --git a/c/src/librtems++/include/rtems++/rtemsSemaphore.h b/c/src/librtems++/include/rtems++/rtemsSemaphore.h
deleted file mode 100644
index 9d4fdbeb58..0000000000
--- a/c/src/librtems++/include/rtems++/rtemsSemaphore.h
+++ /dev/null
@@ -1,145 +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.
-
- ------------------------------------------------------------------------
-
- rtemsSemaphore class.
-
- This class allows the user to create a RTEMS semaphore, or to use an
- already existing semaphore. The type of semaphore is decitated by
- the constructor used.
-
- The first constructor with the semaphore parameters creates a RTEMS
- semaphore object. The destructor of this object also deletes the
- semaphore object. The last status code should be checked after
- construction to see if the semaphore create was successfull.
-
- The second constructor connects to an existing. The last status code
- should be checked after construction to see if the semaphore
- existed.
-
- The third constructor is a copy constructor. Connects to an existing
- object which is in scope.
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsSemaphore_h_)
-#define _rtemsSemaphore_h_
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- rtemsSemaphore
-*/
-
-class rtemsSemaphore
- : public rtemsStatusCode
-{
-public:
- // attribute a semaphore can have
- enum WaitMode { wait_by_fifo = RTEMS_FIFO,
- wait_by_priority = RTEMS_PRIORITY };
- enum Type { binary = RTEMS_BINARY_SEMAPHORE,
- counting = RTEMS_COUNTING_SEMAPHORE };
- enum Priority { no_priority_inherit = RTEMS_NO_INHERIT_PRIORITY,
- inherit_priority = RTEMS_INHERIT_PRIORITY };
- enum Ceiling { no_priority_ceiling = RTEMS_NO_PRIORITY_CEILING,
- priority_ceiling = RTEMS_PRIORITY_CEILING };
- enum Scope { local = RTEMS_LOCAL,
- global = RTEMS_GLOBAL };
-
- // only the first 4 characters of the name are taken,
- // the counter must be set to 1 for binary semaphores
-
- // create a semaphore object
- rtemsSemaphore(const char* name,
- const Scope scope = local,
- const rtems_unsigned32 counter = 1,
- const WaitMode wait_mode = wait_by_fifo,
- const Type type = binary,
- const Priority priority = no_priority_inherit,
- const Ceiling ceiling = no_priority_ceiling,
- const rtems_task_priority priority_ceiling = 0);
-
- // connect to an existing semaphore object by name
- rtemsSemaphore(const char *name, const rtems_unsigned32 node);
-
- // attach this object to an other objects semaphore
- rtemsSemaphore(const rtemsSemaphore& semaphore);
- rtemsSemaphore();
-
- // only the creator's destructor will delete the actual object
- virtual ~rtemsSemaphore();
-
- // create or destroy (delete) a semaphore
- virtual const rtems_status_code create(const char* name,
- const Scope scope = local,
- const rtems_unsigned32 counter = 1,
- const WaitMode wait_mode = wait_by_fifo,
- const Type type = binary,
- const Priority priority = no_priority_inherit,
- const Ceiling ceiling = no_priority_ceiling,
- const rtems_task_priority priority_ceiling = 0);
- virtual const rtems_status_code destroy();
-
- // connect to an existing semaphore object, will not be the owner
- const rtemsSemaphore& operator=(const rtemsSemaphore& semaphore);
- virtual const rtems_status_code connect(const char *name, rtems_unsigned32 node);
-
- // obtain the semaphore, timeout is in micro-seconds
- inline const rtems_status_code obtain(bool wait = true,
- const rtems_unsigned32 micro_secs = RTEMS_NO_TIMEOUT);
-
- // release the semaphore, blocks threads eligble
- inline const rtems_status_code release();
-
- // object id, and name
- const rtems_id id_is() const { return id; }
- const rtems_name name_is() const { return name; }
- const char *name_string() const { return name_str; }
-
-private:
-
- // make the object reference no valid RTEMS object
- void make_invalid();
-
- // semaphore name
- rtems_name name;
- char name_str[5];
-
- // owner, true if this object owns the semaphore
- // will delete the semaphore when it destructs
- bool owner;
-
- // the rtems id, object handle
- rtems_id id;
-};
-
-const rtems_status_code rtemsSemaphore::obtain(const bool wait,
- const rtems_unsigned32 micro_secs)
-{
- rtems_interval usecs =
- micro_secs && (micro_secs < _TOD_Microseconds_per_tick) ?
- _TOD_Microseconds_per_tick : micro_secs;
- return
- set_status_code(rtems_semaphore_obtain(id,
- wait ? RTEMS_WAIT : RTEMS_NO_WAIT,
- TOD_MICROSECONDS_TO_TICKS(usecs)));
-}
-
-const rtems_status_code rtemsSemaphore::release(void)
-{
- return set_status_code(rtems_semaphore_release(id));
-}
-
-#endif // _rtemsSemaphore_h_
diff --git a/c/src/librtems++/include/rtems++/rtemsStatusCode.h b/c/src/librtems++/include/rtems++/rtemsStatusCode.h
deleted file mode 100644
index fee230868b..0000000000
--- a/c/src/librtems++/include/rtems++/rtemsStatusCode.h
+++ /dev/null
@@ -1,57 +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.
-
- ------------------------------------------------------------------------
-
- rtemsStatusCode controls and manages status codes from the RTEMS kernel.
-
- ------------------------------------------------------------------------
-*/
-
-#if !defined(_rtemsStatusCode_h_)
-#define _rtemsStatusCode_h_
-
-#include <rtems.h>
-
-/* ----
- rtemsStatusCode
-*/
-
-class rtemsStatusCode
-{
-public:
-
- rtemsStatusCode() { last_status = RTEMS_NOT_CONFIGURED; }
-
- const bool successful() { return last_status == RTEMS_SUCCESSFUL; }
- const bool unsuccessful() { return last_status != RTEMS_SUCCESSFUL; }
-
- // return the last status code
- const rtems_status_code last_status_code() { return last_status; }
-
- // return the last status as a string
- const char *last_status_string();
-
- const char *status_string(rtems_status_code status_code);
-
-protected:
- const rtems_status_code set_status_code(const rtems_status_code status)
- { return (last_status = status); }
-
-private:
-
- // public at the moment, this might change
- rtems_status_code last_status;
-};
-
-#endif // _rtemsStatusCode_h_
diff --git a/c/src/librtems++/include/rtems++/rtemsTask.h b/c/src/librtems++/include/rtems++/rtemsTask.h
deleted file mode 100644
index 08156428fb..0000000000
--- a/c/src/librtems++/include/rtems++/rtemsTask.h
+++ /dev/null
@@ -1,171 +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.
-
- ------------------------------------------------------------------------
-
- rtemsTask class.
-
- This class allows the user to create a RTEMS task, or to access and
- manage an already existing task.
-
- The first constructor with the task parameters creates a RTEMS task
- object. The destructor of this object also deletes the task
- object. The last status code should be checked after construction to
- see if the create completed successfully.
-
- The second constructor connects to an existing task object. The last
- status code should be checked after construction to see if the
- task existed.
-
- The third constructor is a copy constructor. Connects to an existing
- object which is in scope.
-
- The RTEMS id is set to self in the default construction.
-
- The creation of the task object can be defered until after
- construction. This allows for static task objects to be created.
-
- RTEMS should be initialised before static constructors run, how-ever
- threads will will not. You need to watch the start-order.
-
- A task object can change state from an owner of a task to being
- connected to a task.
-
- Task objects connected to another task do not receive notification
- when the task connected to changes state.
-
- The sleep methods operate on the current thread not the task
- reference by this object.
-
- Mode control is through the rtemsTaskMode class.
-
- The rtemsTask class reserved notepad register 31.
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsTask_h_)
-#define _rtemsTask_h_
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- rtemsTask
-*/
-
-class rtemsTask
- : public rtemsStatusCode
-{
-public:
- enum FloatingPoint { fpoff = RTEMS_NO_FLOATING_POINT,
- fpon = RTEMS_FLOATING_POINT };
- enum Scope { local = RTEMS_LOCAL,
- global = RTEMS_GLOBAL };
-
- // only the first 4 characters of the name are taken
-
- // creates a task
- rtemsTask(const char* name,
- const rtems_task_priority initial_priority,
- const rtems_unsigned32 stack_size,
- const rtems_mode preemption = RTEMS_NO_PREEMPT,
- const rtems_mode timeslice = RTEMS_NO_TIMESLICE,
- const rtems_mode asr = RTEMS_NO_ASR,
- const rtems_interrupt_level interrupt_level = 0,
- const FloatingPoint floating_point = fpoff,
- const Scope scope = local);
-
- // connects to a task
- rtemsTask(const char *name, const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
-
- // copy and default constructors
- rtemsTask(const rtemsTask& task);
- rtemsTask();
-
- // only the creator's destructor will delete the actual object
- virtual ~rtemsTask();
-
- // create or destroy (delete) the task
- virtual const rtems_status_code create(const char* name,
- const rtems_task_priority initial_priority,
- const rtems_unsigned32 stack_size,
- const rtems_mode preemption = RTEMS_NO_PREEMPT,
- const rtems_mode timeslice = RTEMS_NO_TIMESLICE,
- const rtems_mode asr = RTEMS_NO_ASR,
- const rtems_interrupt_level interrupt_level = 0,
- const FloatingPoint floating_point = fpoff,
- const Scope scope = local);
- virtual const rtems_status_code destroy();
-
- // connect to an existing task object, will not be the owner
- const rtemsTask& operator=(const rtemsTask& task);
- virtual const rtems_status_code connect(const char *name,
- const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
-
- // run control
- virtual const rtems_status_code start(const rtems_task_argument argument);
- virtual const rtems_status_code restart(const rtems_task_argument argument);
- virtual const rtems_status_code suspend();
- virtual const rtems_status_code resume();
-
- // sleep control, the timeout is in micro-seconds
- virtual const rtems_status_code wake_after(const rtems_interval micro_secs);
- virtual const rtems_status_code wake_when(const rtems_time_of_day& tod);
-
- // priority control
- const rtems_status_code get_priority(rtems_task_priority& priority);
- const rtems_status_code set_priority(const rtems_task_priority priority);
- const rtems_status_code set_priority(const rtems_task_priority priority,
- rtems_task_priority& old_priority);
-
- // notepad control
- const rtems_status_code get_note(const rtems_unsigned32 notepad,
- rtems_unsigned32& note);
- const rtems_status_code set_note(const rtems_unsigned32 notepad,
- const rtems_unsigned32 note);
-
- // object id, and name
- const rtems_id id_is() const { return id; }
- const rtems_name name_is() const { return name; }
- const char *name_string() const { return name_str; }
-
-protected:
-
- // task entry point
- virtual void body(rtems_task_argument argument);
-
-private:
-
- // make the object to point to RTEMS_SELF
- void make_self();
-
- // task name
- rtems_name name;
- char name_str[5];
-
- // owner, true if this object owns the task
- // will delete the task when it destructs
- bool owner;
-
- // the rtems id, object handle
- rtems_id id;
-
- // the argument for the task, this class uses the actual argument
- // passed to RTEMS
- rtems_task_argument argument;
-
- // common entry point to the task
- static rtems_task origin(rtems_task_argument argument);
-};
-
-#endif // _rtemsTask_h_
-
diff --git a/c/src/librtems++/include/rtems++/rtemsTaskMode.h b/c/src/librtems++/include/rtems++/rtemsTaskMode.h
deleted file mode 100644
index 6d32897cc0..0000000000
--- a/c/src/librtems++/include/rtems++/rtemsTaskMode.h
+++ /dev/null
@@ -1,210 +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.
-
- ------------------------------------------------------------------------
-
- rtemsTaskMode class.
-
- This class allows the user to query or change the mode of an RTEMS
- task.
-
- This object only operates on the currently executing task.
-
- The standard flags defined in RTEMS are used.
-
- Methods are provided to operate on a group of modes which are
- required to be changed in a single operation. The mode and mask is
- specified by ORing the required flags.
-
- Methods are provided for accessing and controlling a specific
- mode. The returned value will only contain the requested mode's flags,
- and only the that mode will be changed when setting a mode.
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsTaskMode_h_)
-#define _rtemsTaskMode_h_
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- rtemsTaskMode
-*/
-
-class rtemsTaskMode
- : public rtemsStatusCode
-{
-public:
-
- rtemsTaskMode() {};
-
- // group mode control, OR the values together
- inline const rtems_status_code get_mode(rtems_mode& mode);
- inline const rtems_status_code set_mode(const rtems_mode mode,
- const rtems_mode mask);
- inline const rtems_status_code set_mode(const rtems_mode mode,
- const rtems_mode mask,
- rtems_mode& old_mode);
-
- // preemption control
- inline const rtems_status_code get_preemption_state(rtems_mode& preemption);
- inline const rtems_status_code set_preemption_state(const rtems_mode preemption);
- inline const rtems_status_code set_preemption_state(const rtems_mode preemption,
- rtems_mode& old_preemption);
- inline const boolean preemption_set(const rtems_mode preemption);
-
- // timeslice control
- inline const rtems_status_code get_timeslice_state(rtems_mode& timeslice);
- inline const rtems_status_code set_timeslice_state(const rtems_mode timeslice);
- inline const rtems_status_code set_timeslice_state(const rtems_mode timeslice,
- rtems_mode& old_timeslice);
- inline const boolean timeslice_set(const rtems_mode preemption);
-
- // async-sub-routine control
- inline const rtems_status_code get_asr_state(rtems_mode& asr);
- inline const rtems_status_code set_asr_state(const rtems_mode asr);
- inline const rtems_status_code set_asr_state(const rtems_mode asr,
- rtems_mode& old_asr);
- inline const boolean asr_set(const rtems_mode preemption);
-
- // interrupt mask control
- inline const rtems_status_code get_interrupt_level(rtems_interrupt_level& level);
- inline const rtems_status_code set_interrupt_level(const rtems_interrupt_level level);
- inline const rtems_status_code set_interrupt_level(const rtems_interrupt_level level,
- rtems_interrupt_level& old_level);
-};
-
-const rtems_status_code rtemsTaskMode::get_mode(rtems_mode& mode)
-{
- return set_status_code(rtems_task_mode(0, RTEMS_CURRENT_MODE, &mode));
-}
-
-const rtems_status_code rtemsTaskMode::set_mode(const rtems_mode mode,
- const rtems_mode mask)
-{
- rtems_mode old_mode;
- return set_status_code(rtems_task_mode(mode, mask, &old_mode));
-}
-
-const rtems_status_code rtemsTaskMode::set_mode(const rtems_mode mode,
- const rtems_mode mask,
- rtems_mode& old_mode)
-{
- return set_status_code(rtems_task_mode(mode, mask, &old_mode));
-}
-
-const rtems_status_code rtemsTaskMode::get_preemption_state(rtems_mode& preemption)
-{
- set_status_code(rtems_task_mode(0, RTEMS_CURRENT_MODE, &preemption));
- preemption &= RTEMS_PREEMPT_MASK;
- return last_status_code();
-}
-
-const rtems_status_code rtemsTaskMode::set_preemption_state(const rtems_mode preemption)
-{
- rtems_mode old_mode;
- return set_status_code(rtems_task_mode(preemption, RTEMS_PREEMPT_MASK, &old_mode));
-}
-
-const rtems_status_code rtemsTaskMode::set_preemption_state(const rtems_mode preemption,
- rtems_mode& old_preemption)
-{
- set_status_code(rtems_task_mode(preemption, RTEMS_PREEMPT_MASK, &old_preemption));
- old_preemption &= RTEMS_PREEMPT_MASK;
- return last_status_code();
-}
-
-const boolean rtemsTaskMode::preemption_set(const rtems_mode preemption)
-{
- return (preemption & RTEMS_PREEMPT_MASK) ? false : true;
-}
-
-const rtems_status_code rtemsTaskMode::get_timeslice_state(rtems_mode& timeslice)
-{
- set_status_code(rtems_task_mode(0, RTEMS_CURRENT_MODE, &timeslice));
- timeslice &= RTEMS_TIMESLICE_MASK;
- return last_status_code();
-}
-
-const rtems_status_code rtemsTaskMode::set_timeslice_state(const rtems_mode timeslice)
-{
- rtems_mode old_mode;
- return set_status_code(rtems_task_mode(timeslice, RTEMS_TIMESLICE_MASK, &old_mode));
-}
-
-const rtems_status_code rtemsTaskMode::set_timeslice_state(const rtems_mode timeslice,
- rtems_mode& old_timeslice)
-{
- set_status_code(rtems_task_mode(timeslice, RTEMS_TIMESLICE_MASK, &old_timeslice));
- old_timeslice &= RTEMS_TIMESLICE_MASK;
- return last_status_code();
-}
-
-const boolean rtemsTaskMode::timeslice_set(const rtems_mode timeslice)
-{
- return (timeslice & RTEMS_TIMESLICE_MASK) ? true : false;
-}
-
-const rtems_status_code rtemsTaskMode::get_asr_state(rtems_mode& asr)
-{
- set_status_code(rtems_task_mode(0, RTEMS_CURRENT_MODE, &asr));
- asr &= RTEMS_ASR_MASK;
- return last_status_code();
-}
-
-const rtems_status_code rtemsTaskMode::set_asr_state(const rtems_mode asr)
-{
- rtems_mode old_mode;
- return set_status_code(rtems_task_mode(asr, RTEMS_ASR_MASK, &old_mode));
-}
-
-const rtems_status_code rtemsTaskMode::set_asr_state(const rtems_mode asr,
- rtems_mode& old_asr)
-{
- set_status_code(rtems_task_mode(asr, RTEMS_ASR_MASK, &old_asr));
- old_asr &= RTEMS_ASR_MASK;
- return last_status_code();
-}
-
-const boolean rtemsTaskMode::asr_set(const rtems_mode asr)
-{
- return (asr & RTEMS_ASR_MASK) ? true : false;
-}
-
-const rtems_status_code rtemsTaskMode::get_interrupt_level(rtems_interrupt_level& level)
-{
- rtems_mode mode;
- set_status_code(rtems_task_mode(0, RTEMS_CURRENT_MODE, &mode));
- level = mode & RTEMS_INTERRUPT_MASK;
- return last_status_code();
-}
-
-const rtems_status_code rtemsTaskMode::set_interrupt_level(const rtems_interrupt_level level)
-{
- rtems_mode old_mode;
- return set_status_code(rtems_task_mode(level, RTEMS_INTERRUPT_MASK, &old_mode));
-}
-
-const rtems_status_code rtemsTaskMode::set_interrupt_level(rtems_interrupt_level level,
- rtems_interrupt_level& old_level)
-{
- set_status_code(rtems_task_mode(level, RTEMS_INTERRUPT_MASK, &old_level));
- old_level = old_level & RTEMS_INTERRUPT_MASK;
- return last_status_code();
-}
-
-#endif // _rtemsTaskMode_h_
-
-
-
-
diff --git a/c/src/librtems++/include/rtems++/rtemsTimer.h b/c/src/librtems++/include/rtems++/rtemsTimer.h
deleted file mode 100644
index 43401bab73..0000000000
--- a/c/src/librtems++/include/rtems++/rtemsTimer.h
+++ /dev/null
@@ -1,145 +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.
-
- ------------------------------------------------------------------------
-
- rtemsTimer class.
-
- This class allows the user to create a RTEMS timer.
-
- The trigger method is called when the timer expires. The method is
- called using the thread which calls the RTEMS 'rtems_clock_tick'
- method.
-
- Timers are always local to a node.
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsTimer_h_)
-#define _rtemsTimer_h_
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- rtemsTimer
-*/
-
-class rtemsTimer
- : public rtemsStatusCode
-{
-public:
- // only the first 4 characters of the name are taken,
-
- // create a timer object
- rtemsTimer(const char* name);
- rtemsTimer();
-
- // destroies the actual object
- virtual ~rtemsTimer();
-
- // create or destroy (delete) the timer
- virtual const rtems_status_code create(const char* name);
- virtual const rtems_status_code destroy();
-
- // timer control
- inline const rtems_status_code fire_after(const rtems_interval micro_secs);
- inline const rtems_status_code repeat_fire_at(const rtems_interval micro_secs);
- inline const rtems_status_code fire_when(const rtems_time_of_day& when);
-
- inline const rtems_status_code cancel();
- inline const rtems_status_code reset();
-
- // object id, and name
- const rtems_id id_is() const { return id; }
- const rtems_name name_is() const { return name; }
- const char *name_string() const { return name_str; }
-
-protected:
-
- // triggered method is called when the timer fires
- virtual void triggered() = 0;
-
-private:
- // not permitted
- rtemsTimer(const rtemsTimer& timer);
- rtemsTimer& operator=(const rtemsTimer& timer);
-
- // make this object reference an invalid RTEMS object
- void make_invalid();
-
- // semaphore name
- rtems_name name;
- char name_str[5];
-
- // repeat true restart the timer when it fires
- bool repeat;
-
- // the rtems id, object handle
- rtems_id id;
-
- // common timer handler
- static void common_handler(rtems_id id, void *user_data);
-};
-
-const rtems_status_code rtemsTimer::fire_after(const rtems_interval micro_secs)
-{
- repeat = false;
- rtems_interval usecs =
- micro_secs && (micro_secs < _TOD_Microseconds_per_tick) ?
- _TOD_Microseconds_per_tick : micro_secs;
- return set_status_code(rtems_timer_fire_after(id,
- TOD_MICROSECONDS_TO_TICKS(usecs),
- common_handler,
- this));
-}
-
-const rtems_status_code rtemsTimer::repeat_fire_at(const rtems_interval micro_secs)
-{
- repeat = true;
- rtems_interval usecs =
- micro_secs && (micro_secs < _TOD_Microseconds_per_tick) ?
- _TOD_Microseconds_per_tick : micro_secs;
- return set_status_code(rtems_timer_fire_after(id,
- TOD_MICROSECONDS_TO_TICKS(usecs),
- common_handler,
- this));
-}
-
-const rtems_status_code rtemsTimer::fire_when(const rtems_time_of_day& when)
-{
- return set_status_code(rtems_timer_fire_when(id,
- (rtems_time_of_day*) &when,
- common_handler,
- this));
-}
-
-const rtems_status_code rtemsTimer::cancel()
-{
- repeat = false;
- return set_status_code(rtems_timer_cancel(id));
-}
-
-const rtems_status_code rtemsTimer::reset()
-{
- return set_status_code(rtems_timer_reset(id));
-}
-
-#endif // _rtemsTimer_h_
-
-
-
-
-
-
-
-
diff --git a/c/src/librtems++/src/Makefile.in b/c/src/librtems++/src/Makefile.in
deleted file mode 100644
index c69c34790a..0000000000
--- a/c/src/librtems++/src/Makefile.in
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-LIBNAME=librtems++.a
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-CC_PIECES=rtemsEvent rtemsInterrupt rtemsMessageQueue rtemsSemaphore \
- rtemsStatusCode rtemsTask rtemsTimer
-CC_FILES=$(CC_PIECES:%=%.cc)
-CC_O_FILES=$(CC_PIECES:%=${ARCH}/%.o)
-
-SRCS=$(CC_FILES)
-OBJS=$(CC_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(LIBC_DEFINES)
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(LIB)
- $(INSTALL_VARIANT) -m 644 ${LIB} ${PROJECT_RELEASE}/lib
-
-$(LIB): $(SRCS) ${OBJS}
- $(make-library)
-
-
diff --git a/c/src/librtems++/src/rtemsEvent.cc b/c/src/librtems++/src/rtemsEvent.cc
deleted file mode 100644
index a917f32836..0000000000
--- a/c/src/librtems++/src/rtemsEvent.cc
+++ /dev/null
@@ -1,75 +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.
-
- ------------------------------------------------------------------------
-
- See header file.
-
- ------------------------------------------------------------------------
-*/
-
-#include <rtems++/rtemsEvent.h>
-
-/* ----
- rtemsEvent
-*/
-
-rtemsEvent::rtemsEvent(const char *name_str, rtems_unsigned32 node)
- : name(rtems_build_name('S', 'E', 'L', 'F')),
- id(RTEMS_SELF)
-{
- connect(name_str, node);
-}
-
-rtemsEvent::rtemsEvent(const rtemsEvent& event)
-{
- name = event.name;
- id = event.id;
-}
-
-rtemsEvent::rtemsEvent()
- : name(rtems_build_name('S', 'E', 'L', 'F')),
- id(RTEMS_SELF)
-{
-}
-
-rtemsEvent::~rtemsEvent()
-{
-}
-
-const rtemsEvent& rtemsEvent::operator=(const rtemsEvent& event)
-{
- name = event.name;
- id = event.id;
-
- return *this;
-}
-
-const rtems_status_code rtemsEvent::connect(const char *name_str,
- const rtems_unsigned32 node)
-{
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- set_status_code(rtems_task_ident(name, node, &id));
-
- if (unsuccessful())
- {
- name = rtems_build_name('S', 'E', 'L', 'F');
- id = RTEMS_SELF;
- }
-
- return last_status_code();
-}
diff --git a/c/src/librtems++/src/rtemsInterrupt.cc b/c/src/librtems++/src/rtemsInterrupt.cc
deleted file mode 100644
index 4cd5d9afa9..0000000000
--- a/c/src/librtems++/src/rtemsInterrupt.cc
+++ /dev/null
@@ -1,115 +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.
-
- ------------------------------------------------------------------------
-
- See header file.
-
- ------------------------------------------------------------------------
-*/
-
-#include <rtems++/rtemsInterrupt.h>
-
-/* ----
- Interrupt Table
-
- This table is used to re-direct the call from RTEMS to a user
- object
-*/
-
-static rtemsInterrupt *interrupt_table[CPU_INTERRUPT_NUMBER_OF_VECTORS];
-
-// has the table been initialised
-static bool initialised = false;
-
-/* ----
- rtemsInterrupt
-*/
-
-rtemsInterrupt::rtemsInterrupt()
- : vector(0),
- caught(false),
- old_handler(0),
- old_interrupt(0)
-{
- if (!initialised)
- {
- for (rtems_vector_number vec = 0;
- vec < CPU_INTERRUPT_NUMBER_OF_VECTORS;
- vec++)
- {
- interrupt_table[vector] = 0;
- }
- initialised = true;
- }
-}
-
-rtemsInterrupt::~rtemsInterrupt()
-{
- release();
-}
-
-const rtems_status_code rtemsInterrupt::isr_catch(const rtems_vector_number vec)
-{
- if (vec >= CPU_INTERRUPT_NUMBER_OF_VECTORS)
- return set_status_code(RTEMS_INVALID_NUMBER);
-
- if (caught)
- return set_status_code(RTEMS_RESOURCE_IN_USE);
-
- old_interrupt = interrupt_table[vector];
- interrupt_table[vector] = this;
- vector = vec;
-
- set_status_code(rtems_interrupt_catch(redirector,
- vector,
- &old_handler));
-
- if (successful())
- caught = true;
- else
- {
- interrupt_table[vector] = old_interrupt;
- old_interrupt = 0;
- old_handler = 0;
- vector = 0;
- }
-
- return last_status_code();
-}
-
-const rtems_status_code rtemsInterrupt::release(void)
-{
- if (caught)
- {
- set_status_code(rtems_interrupt_catch(old_handler,
- vector,
- &old_handler));
-
- interrupt_table[vector] = old_interrupt;
- old_interrupt = 0;
- old_handler = 0;
- vector = 0;
- caught = false;
- }
- else
- set_status_code(RTEMS_SUCCESSFUL);
-
- return last_status_code();
-}
-
-void rtemsInterrupt::redirector(rtems_vector_number vector)
-{
- if (interrupt_table[vector])
- interrupt_table[vector]->handler();
-}
diff --git a/c/src/librtems++/src/rtemsMessageQueue.cc b/c/src/librtems++/src/rtemsMessageQueue.cc
deleted file mode 100644
index c3183dc2b0..0000000000
--- a/c/src/librtems++/src/rtemsMessageQueue.cc
+++ /dev/null
@@ -1,165 +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.
-
- ------------------------------------------------------------------------
-
- See header file.
-
- ------------------------------------------------------------------------
-*/
-
-#include <string.h>
-#include <rtems++/rtemsMessageQueue.h>
-
-/* ----
- rtemsMessageQueue
-*/
-
-rtemsMessageQueue::rtemsMessageQueue(const char* mqname,
- const rtems_unsigned32 count,
- const rtems_unsigned32 max_message_size,
- const WaitMode wait_mode,
- const Scope scope)
- : name(0),
- owner(true),
- id(0)
-{
- strcpy(name_str, "NOID");
- create(mqname, count, max_message_size, wait_mode, scope);
-}
-
-rtemsMessageQueue::rtemsMessageQueue(const char *mqname,
- const rtems_unsigned32 node)
- : name(0),
- owner(false),
- id(0)
-{
- strcpy(name_str, "NOID");
- connect(mqname, node);
-}
-
-rtemsMessageQueue::rtemsMessageQueue(const rtemsMessageQueue& message_queue)
- : name(0),
- owner(false),
- id(0)
-{
- name = message_queue.name;
- strcpy(name_str, message_queue.name_str);
- id = message_queue.id;
-}
-
-rtemsMessageQueue::rtemsMessageQueue()
- : name(0),
- owner(false),
- id(0)
-{
- strcpy(name_str, "NOID");
-}
-
-rtemsMessageQueue::~rtemsMessageQueue()
-{
- destroy();
-}
-
-void rtemsMessageQueue::make_invalid()
-{
- strcpy(name_str, "NOID");
- name = 0;
- id = 0;
- owner = false;
-}
-
-const rtems_status_code rtemsMessageQueue::create(const char* mqname,
- const rtems_unsigned32 count,
- const rtems_unsigned32 max_message_size,
- const WaitMode wait_mode,
- const Scope scope)
-{
- if (id)
- return set_status_code(RTEMS_ILLEGAL_ON_SELF);
-
- owner = true;
-
- strcpy(name_str, " ");
- for (int c = 0; (c < 4) && (mqname[c] != '\0'); c++)
- name_str[c] = mqname[c];
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- set_status_code(rtems_message_queue_create(name,
- count,
- max_message_size,
- scope | wait_mode,
- &id));
-
- if (unsuccessful())
- {
- make_invalid();
- }
-
- return last_status_code();
-}
-
-const rtems_status_code rtemsMessageQueue::destroy()
-{
- if (id && owner)
- {
- set_status_code(rtems_message_queue_delete(id));
- make_invalid();
- }
- else
- set_status_code(RTEMS_NOT_OWNER_OF_RESOURCE);
-
- return last_status_code();
-}
-
-const rtemsMessageQueue& rtemsMessageQueue::operator=(const rtemsMessageQueue& message_queue)
-{
- if (!owner)
- {
- name = message_queue.name;
- strcpy(name_str, message_queue.name_str);
- id = message_queue.id;
- }
-
- return *this;
-}
-
-const rtems_status_code rtemsMessageQueue::connect(const char *mqname,
- const rtems_unsigned32 node)
-{
- if (id && owner)
- return set_status_code(RTEMS_UNSATISFIED);
-
- // change state to not owner
- owner = false;
-
- strcpy(name_str, " ");
- for (int c = 0; (c < 4) && (mqname[c] != '\0'); c++)
- name_str[c] = mqname[c];
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- set_status_code(rtems_message_queue_ident(name, node, &id));
-
- if (unsuccessful())
- {
- make_invalid();
- }
-
- return last_status_code();
-}
diff --git a/c/src/librtems++/src/rtemsSemaphore.cc b/c/src/librtems++/src/rtemsSemaphore.cc
deleted file mode 100644
index 5821612618..0000000000
--- a/c/src/librtems++/src/rtemsSemaphore.cc
+++ /dev/null
@@ -1,175 +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.
-
- ------------------------------------------------------------------------
-
- See header file.
-
- ------------------------------------------------------------------------
-*/
-
-#include <string.h>
-#include <rtems++/rtemsSemaphore.h>
-
-/* ----
- rtemsSemaphore
-*/
-
-rtemsSemaphore::rtemsSemaphore(const char* sname,
- const Scope scope,
- const rtems_unsigned32 counter,
- const WaitMode wait_mode,
- const Type type,
- const Priority priority,
- const Ceiling ceiling,
- const rtems_task_priority priority_ceiling)
- : name(0),
- owner(true),
- id(0)
-{
- strcpy(name_str, "NOID");
- create(sname,
- scope,
- counter,
- wait_mode,
- type,
- priority,
- ceiling,
- priority_ceiling);
-}
-
-rtemsSemaphore::rtemsSemaphore(const char *sname, const rtems_unsigned32 node)
- : name(0),
- owner(false),
- id(0)
-{
- strcpy(name_str, "NOID");
- connect(sname, node);
-}
-
-rtemsSemaphore::rtemsSemaphore(const rtemsSemaphore& semaphore)
- : name(0),
- owner(false),
- id(0)
-{
- name = semaphore.name;
- strcpy(name_str, semaphore.name_str);
- id = semaphore.id;
-}
-
-rtemsSemaphore::rtemsSemaphore()
- : name(0),
- owner(false),
- id(0)
-{
- strcpy(name_str, "NOID");
-}
-
-rtemsSemaphore::~rtemsSemaphore()
-{
- destroy();
-}
-
-void rtemsSemaphore::make_invalid()
-{
- strcpy(name_str, "NOID");
- name = 0;
- id = 0;
- owner = false;
-}
-
-const rtems_status_code rtemsSemaphore::create(const char* sname,
- const Scope scope,
- const rtems_unsigned32 counter,
- const WaitMode wait_mode,
- const Type type,
- const Priority priority,
- const Ceiling ceiling,
- const rtems_task_priority priority_ceiling)
-{
- if (id)
- return set_status_code(RTEMS_ILLEGAL_ON_SELF);
-
- owner = true;
-
- strcpy(name_str, " ");
- for (int c = 0; (c < 4) && (sname[c] != '\0'); c++)
- name_str[c] = sname[c];
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- set_status_code(rtems_semaphore_create(name,
- counter,
- scope | wait_mode | type | priority | ceiling,
- priority_ceiling,
- &id));
-
- if (unsuccessful())
- {
- make_invalid();
- }
-
- return last_status_code();
-}
-
-const rtems_status_code rtemsSemaphore::destroy()
-{
- if (id && owner)
- {
- set_status_code(rtems_semaphore_delete(id));
- make_invalid();
- }
- else
- set_status_code(RTEMS_NOT_OWNER_OF_RESOURCE);
-
- return last_status_code();
-}
-
-const rtemsSemaphore& rtemsSemaphore::operator=(const rtemsSemaphore& semaphore)
-{
- if (!owner)
- {
- name = semaphore.name;
- id = semaphore.id;
- }
- return *this;
-}
-
-const rtems_status_code rtemsSemaphore::connect(const char *sname,
- const rtems_unsigned32 node)
-{
- if (id && owner)
- return set_status_code(RTEMS_UNSATISFIED);
-
- // change state to not owner
- owner = false;
-
- strcpy(name_str, " ");
- for (int c = 0; (c < 4) && (sname[c] != '\0'); c++)
- name_str[c] = sname[c];
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- set_status_code(rtems_semaphore_ident(name, node, &id));
-
- if (unsuccessful())
- {
- make_invalid();
- }
-
- return last_status_code();
-}
diff --git a/c/src/librtems++/src/rtemsStatusCode.cc b/c/src/librtems++/src/rtemsStatusCode.cc
deleted file mode 100644
index e8e3f965ba..0000000000
--- a/c/src/librtems++/src/rtemsStatusCode.cc
+++ /dev/null
@@ -1,77 +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.
-
- ------------------------------------------------------------------------
-
- See header file.
-
- ------------------------------------------------------------------------
-*/
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- Status Code string table
-*/
-
-static char *status_strings[RTEMS_STATUS_CODES_LAST + 1] =
-{
- "RTEMS[00] successful completion",
- "RTEMS[01] task exitted, returned from a thread",
- "RTEMS[02] multiprocessing not configured",
- "RTEMS[03] invalid object name",
- "RTEMS[04] invalid object id",
- "RTEMS[05] too many",
- "RTEMS[06] timed out waiting",
- "RTEMS[07] object deleted while waiting",
- "RTEMS[08] specified size was invalid",
- "RTEMS[09] address specified is invalid",
- "RTEMS[10] number was invalid",
- "RTEMS[11] item has not been initialized",
- "RTEMS[12] resources still outstanding",
- "RTEMS[13] request not satisfied",
- "RTEMS[14] thread is in wrong state",
- "RTEMS[15] thread already in state",
- "RTEMS[16] illegal on calling thread",
- "RTEMS[17] illegal for remote object",
- "RTEMS[18] called from wrong environment",
- "RTEMS[19] invalid thread priority",
- "RTEMS[20] invalid date/time",
- "RTEMS[21] invalid node id",
- "RTEMS[22] directive not configured",
- "RTEMS[23] not owner of resource",
- "RTEMS[24] directive not implemented",
- "RTEMS[25] RTEMS inconsistency detected",
- "RTEMS[26] could not get enough memory"
-};
-
-/* ----
- StatusCode
-*/
-
-const char *rtemsStatusCode::last_status_string()
-{
- return status_string(last_status);
-}
-
-const char *rtemsStatusCode::status_string(rtems_status_code status_code)
-{
- // mapped from "rtems/rtems/status.h"
- if (status_code <= RTEMS_STATUS_CODES_LAST)
- {
- return status_strings[status_code];
- }
-
- return "unknown status code";
-}
-
diff --git a/c/src/librtems++/src/rtemsTask.cc b/c/src/librtems++/src/rtemsTask.cc
deleted file mode 100644
index 619f7d4071..0000000000
--- a/c/src/librtems++/src/rtemsTask.cc
+++ /dev/null
@@ -1,288 +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.
-
- ------------------------------------------------------------------------
-
- See header file.
-
- ------------------------------------------------------------------------
-*/
-
-#include <string.h>
-#include <rtems++/rtemsTask.h>
-// include to allow it to be compiled
-#include <rtems++/rtemsTaskMode.h>
-
-/* ----
- rtemsTask
-*/
-
-rtemsTask::rtemsTask(const char* tname,
- const rtems_task_priority initial_priority,
- const rtems_unsigned32 stack_size,
- const rtems_mode preemption,
- const rtems_mode timeslice,
- const rtems_mode asr,
- const rtems_interrupt_level interrupt_level,
- const FloatingPoint floating_point,
- const Scope scope)
- : name(rtems_build_name('S', 'E', 'L', 'F')),
- owner(true),
- id(RTEMS_SELF),
- argument(0)
-{
- strcpy(name_str, "SELF");
- create(tname,
- initial_priority,
- stack_size,
- preemption,
- timeslice,
- asr,
- interrupt_level,
- floating_point,
- scope);
-}
-
-rtemsTask::rtemsTask(const char *tname, rtems_unsigned32 node)
- : name(rtems_build_name('S', 'E', 'L', 'F')),
- owner(false),
- id(RTEMS_SELF),
- argument(0)
-{
- strcpy(name_str, "SELF");
- connect(tname, node);
-}
-
-rtemsTask::rtemsTask(const rtemsTask& task)
- : name(rtems_build_name('S', 'E', 'L', 'F')),
- owner(false),
- id(RTEMS_SELF),
- argument(0)
-{
- name = task.name;
- strcpy(name_str, task.name_str);
- argument = task.argument;
- id = task.id;
-}
-
-rtemsTask::rtemsTask()
- : name(rtems_build_name('S', 'E', 'L', 'F')),
- owner(false),
- id(RTEMS_SELF),
- argument(0)
-{
- strcpy(name_str, "SELF");
-}
-
-rtemsTask::~rtemsTask()
-{
- destroy();
-}
-
-void rtemsTask::make_self()
-{
- strcpy(name_str, "SELF");
- name = rtems_build_name('S', 'E', 'L', 'F');
- id = RTEMS_SELF;
- owner = false;
-}
-
-const rtems_status_code rtemsTask::create(const char* tname,
- const rtems_task_priority initial_priority,
- const rtems_unsigned32 stack_size,
- const rtems_mode preemption,
- const rtems_mode timeslice,
- const rtems_mode asr,
- const rtems_interrupt_level interrupt_level,
- const FloatingPoint floating_point,
- const Scope scope)
-{
- if (id)
- return set_status_code(RTEMS_ILLEGAL_ON_SELF);
-
- owner = true;
-
- strcpy(name_str, " ");
- for (int c = 0; (c < 4) && (tname[c] != '\0'); c++)
- name_str[c] = tname[c];
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- // protect the values that be set as the parameters are not enums
- set_status_code(rtems_task_create(name,
- initial_priority,
- stack_size,
- (preemption & RTEMS_PREEMPT_MASK) |
- (timeslice & RTEMS_TIMESLICE_MASK) |
- (asr & RTEMS_ASR_MASK) |
- (interrupt_level & RTEMS_INTERRUPT_MASK),
- floating_point | scope,
- &id));
-
- if (unsuccessful())
- {
- make_self();
- }
-
- return last_status_code();
-}
-
-const rtems_status_code rtemsTask::destroy()
-{
- if (id && owner)
- {
- set_status_code(rtems_task_delete(id));
- make_self();
- }
- else
- set_status_code(RTEMS_NOT_OWNER_OF_RESOURCE);
-
- return last_status_code();
-}
-
-const rtemsTask& rtemsTask::operator=(const rtemsTask& task)
-{
- if (!owner)
- {
- name = task.name;
- strcpy(name_str, task.name_str);
- argument = task.argument;
- id = task.id;
- }
- return *this;
-}
-
-const rtems_status_code rtemsTask::connect(const char *sname,
- const rtems_unsigned32 node)
-{
- if (id && owner)
- return set_status_code(RTEMS_UNSATISFIED);
-
- // change state to not owner
- owner = false;
-
- strcpy(name_str, " ");
- for (int c = 0; (c < 4) && (sname[c] != '\0'); c++)
- name_str[c] = sname[c];
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- set_status_code(rtems_task_ident(name, node, &id));
-
- if (unsuccessful())
- {
- make_self();
- }
-
- return last_status_code();
-}
-
-const rtems_status_code rtemsTask::start(const rtems_task_argument arg)
-{
- if (owner)
- {
- argument = arg;
- // pass the this pointer as the argument
- set_status_code(rtems_task_start(id,
- origin,
- (rtems_task_argument) this));
- }
- else
- set_status_code(RTEMS_NOT_OWNER_OF_RESOURCE);
- return last_status_code();
-}
-
-const rtems_status_code rtemsTask::restart(const rtems_task_argument arg)
-{
- if (owner)
- {
- argument = arg;
- set_status_code(rtems_task_restart(id, (rtems_task_argument) this));
- }
- else
- set_status_code(RTEMS_NOT_OWNER_OF_RESOURCE);
-
- return last_status_code();
-}
-
-const rtems_status_code rtemsTask::suspend()
-{
- return set_status_code(rtems_task_suspend(id));
-}
-
-const rtems_status_code rtemsTask::resume()
-{
- return set_status_code(rtems_task_resume(id));
-}
-
-const rtems_status_code rtemsTask::wake_after(const rtems_interval micro_secs)
-{
- rtems_interval usecs =
- micro_secs && (micro_secs < _TOD_Microseconds_per_tick) ?
- _TOD_Microseconds_per_tick : micro_secs;
- return set_status_code(rtems_task_wake_after(TOD_MICROSECONDS_TO_TICKS(usecs)));
-}
-
-const rtems_status_code rtemsTask::wake_when(const rtems_time_of_day& tod)
-{
- return set_status_code(rtems_task_wake_when((rtems_time_of_day*) &tod));
-}
-
-const rtems_status_code rtemsTask::get_priority(rtems_task_priority& priority)
-{
- return set_status_code(rtems_task_set_priority(id,
- RTEMS_CURRENT_PRIORITY,
- &priority));
-}
-
-const rtems_status_code rtemsTask::set_priority(const rtems_task_priority priority)
-{
- rtems_task_priority old_priority;
- return set_status_code(rtems_task_set_priority(id,
- priority,
- &old_priority));
-}
-
-const rtems_status_code rtemsTask::set_priority(const rtems_task_priority priority,
- rtems_task_priority& old_priority)
-{
- return set_status_code(rtems_task_set_priority(id,
- priority,
- &old_priority));
-}
-
-const rtems_status_code rtemsTask::get_note(const rtems_unsigned32 notepad,
- rtems_unsigned32& note)
-{
- return set_status_code(rtems_task_get_note(id, notepad, &note));
-}
-
-const rtems_status_code rtemsTask::set_note(const rtems_unsigned32 notepad,
- const rtems_unsigned32 note)
-{
- return set_status_code(rtems_task_set_note(id, notepad, note));
-}
-
-void rtemsTask::body(rtems_task_argument )
-{
-}
-
-rtems_task rtemsTask::origin(rtems_task_argument argument)
-{
- rtemsTask *task = (rtemsTask*) argument;
- task->body(task->argument);
-}
diff --git a/c/src/librtems++/src/rtemsTimer.cc b/c/src/librtems++/src/rtemsTimer.cc
deleted file mode 100644
index 835bfd74ce..0000000000
--- a/c/src/librtems++/src/rtemsTimer.cc
+++ /dev/null
@@ -1,101 +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.
-
- ------------------------------------------------------------------------
-
- See header file.
-
- ------------------------------------------------------------------------
-*/
-
-#include <string.h>
-#include <rtems++/rtemsTimer.h>
-
-/* ----
- rtemsTimer
-*/
-
-rtemsTimer::rtemsTimer(const char* tname)
- : name(0),
- repeat(false),
- id(0)
-{
- strcpy(name_str, " ");
- create(tname);
-}
-
-rtemsTimer::rtemsTimer()
- : name(0),
- repeat(false),
- id(0)
-{
- strcpy(name_str, " ");
-}
-
-rtemsTimer::~rtemsTimer()
-{
- destroy();
-}
-
-void rtemsTimer::make_invalid()
-{
- strcpy(name_str, " ");
- name = 0;
- id = 0;
- repeat = false;
-}
-const rtems_status_code rtemsTimer::create(const char* tname)
-{
- if (id)
- return set_status_code(RTEMS_ILLEGAL_ON_SELF);
-
- strcpy(name_str, " ");
- for (int c = 0; (c < 4) && (tname[c] != '\0'); c++)
- name_str[c] = tname[c];
- name = rtems_build_name(name_str[0],
- name_str[1],
- name_str[2],
- name_str[3]);
-
- set_status_code(rtems_timer_create(name, &id));
-
- if (unsuccessful())
- {
- make_invalid();
- }
-
- return last_status_code();
-}
-
-const rtems_status_code rtemsTimer::destroy()
-{
- if (id)
- {
- set_status_code(rtems_timer_delete(id));
- make_invalid();
- }
- else
- set_status_code(RTEMS_NOT_OWNER_OF_RESOURCE);
-
- return last_status_code();
-}
-
-void rtemsTimer::common_handler(rtems_id , void *user_data)
-{
- rtemsTimer *timer = (rtemsTimer*) user_data;
-
- if (timer->repeat)
- timer->reset();
-
- timer->triggered();
-}
diff --git a/c/src/make/README b/c/src/make/README
deleted file mode 100644
index 6cdc4b2c6e..0000000000
--- a/c/src/make/README
+++ /dev/null
@@ -1,513 +0,0 @@
-#
-# $Id$
-#
-
- make/README
-
- This file describes the layout and conventions of the make tree used in
- the RTEMS software project and others.
- All of these "make" trees are substantially similar; however this
- file documents the current state of the rtems Makefile tree.
-
- This make tree was developed originally to simplify porting projects
- between various os's. The primary goals are:
-
- . simple *and* customizable individual makefiles
-
- . use widely available GNU make. There is no pre-processing or
- automatic generation of Makefiles.
-
- . Same makefiles work on *many* host os's due to portability
- of GNU make and the host os config files.
-
- . Support for different compilers and operating systems
- on a per-user basis. Using the same sources (including
- Makefiles) one developer can develop and test under SVR4,
- another under 4.x, another under HPUX.
-
- . Builtin support for compiling "variants" such as debug,
- profile, and tcov versions. These variants can be built
- recursively.
-
- . Control of system dependencies. "hidden" dependencies on
- environment variables (such as PATH)
- have been removed whenever possible. No matter what your
- PATH variable is set to, you should get the same thing
- when you 'make' as everyone else on the project.
-
- This description attempts to cover all aspects of the Makefile tree. Most
- of what is described here is maintained automatically by the configuration
- files.
-
- The example makefiles in make/Templates should be used as a starting
- point for new directories.
-
- There are 2 main types of Makefile:
-
- directory and leaf.
-
- Directory Makefiles
- -------------------
-
- A Makefile in a source directory with sub-directories is called a
- "directory" Makefile.
-
- Directory Makefile's are simply responsible for acting as "middle-men"
- and recursing into their sub-directories and propagating the make.
-
- For example, directory src/bin will contain only a Makefile and
- sub-directories. No actual source code will reside in the directory.
- The following commands:
-
- $ cd src/bin
- $ make all
-
- would descend into all the subdirectories of 'src/bin' and recursively
- perform a 'make all'.
-
- A 'make debug' will recurse thru sub-directories as a debug build.
-
- A template directory Makefile which should work in almost all
- cases is in make/Templates/Makefile.dir
-
-
- Leaf Makefiles
- --------------
-
- Source directories that contain source code for libraries or
- programs use a "leaf" Makefile.
-
- These makefiles contain the rules necessary to build programs
- (or libraries).
-
- A template leaf Makefile is in Templates/Makefile.leaf . A template
- leaf Makefile for building libraries is in Templates/Makefile.lib .
-
-
- NOTE: To simplify nested makefile's and source maintenance, we disallow
- combining source and directories (that make(1) would be expected to
- recurse into) in one source directory. Ie., a directory in the source
- tree may contain EITHER source files OR recursive sub directories, but NOT
- both.
-
- Variants (where objects go)
- ---------------------------
-
- All binary targets are placed in a sub-directory whose name is (for
- example):
-
- o-force386/ -- binaries (no debug, no profile)
- o-force386-debug/ -- debug binaries
- o-force386-profile/ -- profiling binaries
-
- Using the template Makefiles, this will all happen automatically.
-
- Within a Makefile, the ${ARCH} variable is set to o-force386,
- o-force386-debug, etc., as appropriate.
-
- Typing 'make' will place objects in o-force386.
- 'make debug' will place objects in o-force386-debug.
- 'make profile' will place objects in o-force386-profile.
-
- NOTE: For RTEMS work, the word 'force386' is the specified
- RTEMS_BSP (specified in the modules file)
-
- The debug and profile targets are equivalent to 'all' except that
- CFLAGS and/or LDFLAGS are modified as per the compiler config file for
- debug and profile support.
-
- Targets debug_install and profile_install are equivalent to 'make
- install' except that debug (or profile) variants are built and
- installed.
-
- The targets debug, profile, debug_install, profile_install, etc., can be
- invoked recursively at the directory make level. So from the top of a
- tree, one could install a debug version of everything under that point
- by:
-
- $ cd src/lib
- $ gmake debug_install
-
- When building a command that is linked with a generated library, the
- appropriate version of the library will be linked in.
-
- For example, the following fragments link the normal, debug, or
- profile version of "libmine.a" as appropriate:
-
- LDLIBS += $(LIBMINE)
- LIBMINE = ../libmine/${ARCH}/libmine.a
-
- ${ARCH}/pgm: $(LIBMINE) ${OBJS}
- $(LINK.c) -o $@ ${OBJS} $(LDLIBS)
-
- If we do 'gmake debug', then the library in
- ../libmine/sparc-debug/libmine.a will be linked in. If $(LIBMINE)
- might not exist (or might be out of date) at this point, we could add
-
- ${LIBMINE}: FORCEIT
- cd ../libmine; ${MAKE} ${VARIANT_VA}
-
- The above would generate the following command to build libmine.a:
-
- cd ../libmine; gmake debug
-
- The macro reference ${VARIANT_VA} converts ${ARCH} to the word 'debug'
- (in this example) and thus ensures the proper version of the library
- is built.
-
-
- Targets
- -------
-
- All Makefile's support the following targets:
-
- all -- make "everything"
- install -- install "everything"
-
- The following targets are provided automatically by
- the included config files:
-
- clean -- delete all targets
- clobber -- 'clean' plus delete sccs'd files
- lint -- run lint or lint-like tool
- get -- "sccs get" all sources
- depend -- build a make dependency file
- "variant targets" -- special variants, see below
-
-
- All directory Makefiles automatically propagate all these targets. If
- you don't wish to support 'all' or 'install' in your source directory,
- you must leave the rules section empty, as the parent directory Makefile
- will attempt it on recursive make's.
-
-
- Configuration
- -------------
-
- All the real work described here happens in file(s) included
- from your Makefile.
-
- All Makefiles include a customization file which is used to select
- compiler and host operating system. The environment variable
- RTEMS_CUSTOM must point to this file; eg:
-
- /.../make/custom/force386.cfg
-
- All leaf Makefile's also include either 'make/leaf.cfg' (or
- 'make/lib.cfg' for building libraries). These config files provide
- default rules and set up the command macros as appropriate.
-
- All directory Makefiles include 'make/directory.cfg'. directory.cfg
- provides all the rules for recursing through sub directories.
-
- The Makefile templates already perform these include's.
-
- 'make/leaf.cfg' (or directory.cfg) in turn includes:
-
- a file specifying general purpose rules appropriate for
- both leaf and directory makefiles.
- ( make/main.cfg )
-
- personality modules specified by the customization file for:
- compiler ( make/compilers/??.cfg )
-
-
- private customization files
- ---------------------------
-
- [ $(RTEMS_CUSTOM) ]
-
- Your own private configuration file. Specifies which of the above
- files you want to include.
-
- Example: custom/force386.cfg
-
- CONFIG.$(HOST_ARCH).OS = $(RTEMS_ROOT)/make/os/HPUX-9.0.cfg
-
- # HOST Compiler config file
- # You may also want to specify where the compiler resides here.
- CC_$(HOST_ARCH)_DIR=/usr/local
- CONFIG.$(HOST_ARCH).CC = $(RTEMS_ROOT)/make/compilers/gcc.cfg
-
- ## Target compiler config file, if any
- CC_$(TARGET_ARCH)_DIR=$(RTEMS_GNUTOOLS)
- CONFIG.$(TARGET_ARCH).CC = $(RTEMS_ROOT)/make/compilers/gcc-force386.cfg
-
- generic rules file
- ------------------
-
- [ make/main.cfg ]
- included by leaf.cfg or directory.cfg.
-
- This file contains some standard rules and variable assignments
- that all Makefiles need.
-
- It also includes the FORCEIT: pseudo target.
-
-
- OS config file for host machine
- -------------------------------
-
- [ make/os/OS-NAME.cfg ]
- included by main.cfg
-
- Figures out the target architecture and specifies command names
- for the OS tools including RCS/CVS (but NOT for the compiler tools).
-
-
- Compiler configuration for the target
- -------------------------------------
-
- [ compilers/COMPILER-NAME.cfg ]
- included by leaf.cfg
-
- Specifies the names of tools for compiling programs.
- Names in here should be fully qualified, and NOT depend on $PATH.
-
- Also specifies compiler flags to be used to generate optimized,
- debugging and profile versions, as well as rules to compile
- assembly language and make makefile dependencies.
-
-
- Configuration Variables
- -----------------------
-
- Variables you have to set in the environment or in your Makefile.
- Note: the rtems module files set RTEMS_ROOT and RTEMS_CUSTOM
- for you.
-
- Environment Variables
- ---------------------
-
- RTEMS_BSP -- name of your 'bsp' eg: force386
-
- RTEMS_ROOT -- The root of your source tree.
- All other file names are derived from this.
- [ eg: % setenv RTEMS_ROOT $HOME/work/rtems ]
-
- RTEMS_CUSTOM -- name of your config files in make/custom
- Example:
- $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-
- RTEMS_GNUTOOLS -- root of the gcc tools for the target
-
- The value RTEMS_ROOT is used in the custom
- files to generate the make(1) variables:
-
- PROJECT_ROOT
- PROJECT_RELEASE
- PROJECT_TOOLS
-
- etc., which are used within the make config files themselves.
- (The files in make/*.cfg try to avoid use of word RTEMS so
- they can be more easily shared by other projects)
-
- Preset variables
- ----------------
-
- Aside from command names set by the os and compiler config files,
- a number of MAKE variables are automatically set and maintained by
- the config files.
-
- CONFIG.$(HOST_ARCH).CC
- -- full path of C compilation config file, set by custom
- config file.
-
- PROJECT_RELEASE
- -- release/install directory
- [ $(PROJECT_ROOT) ]
-
- PROJECT_BIN
- -- directory for installed binaries
- [ $(PROJECT_ROOT)/bin ]
-
- PROJECT_TOOLS
- -- directory for build environment commands
- [ eg: $(PROJECT_ROOT)/build-tools ]
-
- TARCH -- ${TARGET_ARCH}
- [ eg: o-forc386 ]
- obsolete and should not be referenced
-
- ARCH -- target sub-directory for object code
- [ eg: o-force386 or o-force386-debug ]
-
- HOST_ARCH
- -- host machine architecture name
- [ eg: sun4, sparc on SVR4 ]
-
- VARIANTS -- full list of all possible values for $(ARCH);
- used mainly for 'make clean'
- [ eg: "o-force386 o-force386-debug o-force386-profile" ]
-
- VARIANT_VA -- Variant name.
- Normally "", but for 'make debug' it is "debug",
- for 'make profile', "profile, etc.
-
- see make/leaf.cfg for more info.
-
-
- Preset compilation variables
- ----------------------------
-
- This is a list of some of the compilation variables.
- Refer to the compiler config files for the complete list.
-
- CFLAGS_OPTIMIZE_V -- value of optimize flag for compiler
- [ eg: -O ]
-
- CFLAGS_DEBUG_V -- value of debug flag for compiler
- [ eg: -g ]
-
- CFLAGS_PROFILE_V -- compiler profile flags
- [ eg: -pg ]
-
- CFLAGS_DEBUG_OPTIMIZE_V
- -- optimize flag if compiling for debug
- [ eg: "" ]
-
- CFLAGS_DEBUG
- CFLAGS_PROFILE
- CFLAGS_OPTIMIZE -- current values for each depending
- on make variant.
-
- LDFLAGS_STATIC_LIBRARIES_V
- -- ld option for static libraries
- -Bstatic or -dy (svr4)
-
- LDFLAGS_SHARED_LIBRARIES_V
- -- ld option for dynamic libraries
- -Bdynamic or -dn (svr4)
-
- LIB_SOCKET
- -- ld(1) -l option(s) to provide
- socket support.
-
- LIB_MATH -- ld(1) -l option(s) to provide
- math library.
-
-
- Makefile Variables
- ------------------
-
- The following variables may be set in a typical Makefile.
-
- C_PIECES -- File names of your .c files without '.c' suffix.
- [ eg: C_PIECES=main funcs stuff ]
-
- CC_PIECES -- ditto, except for .cc files
-
- S_PIECES -- ditto, except for .S files.
-
- LIB -- target library name in leaf library makefiles.
- [ eg: LIB=${ARCH}/libmine.a ]
-
- H_FILES -- your .h files in this directory.
- [ eg: H_FILES=stuff.h extra.h ]
-
- DEFINES -- cc -D items. Included in CPPFLAGS.
- leaf Makefiles.
- [ eg: DEFINES += -DUNIX ]
-
- CPPFLAGS -- -I include directories.
- leaf Makefiles.
- [ eg: CPPFLAGS += -I../include ]
-
- YFLAGS -- Yacc flags.
- leaf Makefiles.
- [ eg: YFLAGS += -v ]
-
- LD_PATHS -- arguments to -L for ld.
- Will be prefixed with '-L' or '-L ' as appropriate
- and included in LDFLAGS.
-
- LDFLAGS -- -L arguments to ld; more may be ADDed.
-
- LD_LIBS -- libraries to be linked in.
- [ eg: LDLIBS += ../libfoo/${ARCH}/libfoo.a ]
-
- XCFLAGS -- "extra" CFLAGS for special needs. Pre-pended
- to CFLAGS.
- Not set or used by Makefiles.
- Can be set on command line to pass extra flags
- to the compiler.
-
- XCPPFLAGS -- ditto for CPPFLAGS
- Can be set on command line to pass extra flags
- to the preprocessor.
-
- XCCPPFLAGS -- same as XCPPFLAGS for C++.
-
- XCCFLAGS -- same as XCFLAGS for C++.
-
- SUB_DIRS -- list of sub directories for make recursion.
- directory Makefiles only.
- [ eg: SUB_DIRS=cpu bsp ]
-
- CLEAN_ADDITIONS
- -- list of files or directories that should
- be deleted by 'make clean'
- [ eg: CLEAN_ADDITIONS += y.tab.c ]
-
- See 'leaf.cfg' for the 'clean:' rule and its
- default deletions.
-
- CLOBBER_ADDITIONS
- -- list of files or directories that should
- be deleted by 'make clobber'
- Since 'make clobber' includes 'make clean',
- you don't need to duplicate items in both.
-
- TARGET_ARCH -- target architecture (eg: o-force386)
- leaf makefiles only.
- Should be specified before 'include leaf.cfg'.
- Only needs to be specified if your target is
- different from output of `arch`.
-
- Command names
- -------------
-
- The following commands should only be called
- as make variables:
-
- MAKE,INSTALL,SHELL
-
- ECHO,CAT,RM,CP,MV,LN,MKDIR,CHMOD
-
- ED,SED
-
- CC,CPP,AS,AR,LD,NM,SIZE,RANLIB,MKLIB,
- YACC,LEX,LINT,CTAGS,ETAGS
-
- Special Directory Makefile Targets
- ----------------------------------
-
- all_WRAPUP
- clean_WRAPUP
- install_WRAPUP
- clean_WRAPUP
- clobber_WRAPUP
- depend_WRAPUP
- -- Specify additional commands for recursive
- (directory level) targets.
-
- This is handy in certain cases where you need
- to do bit of work *after* a recursive make.
-
- make/Templates
- --------------
-
- This directory contains Makefile and source file templates that
- should help in creating or converting makefiles.
-
- Makefile.leaf
- Template leaf Makefiles.
-
- Makefile.lib
- Template leaf library Makefiles.
-
- Makefile.dir
- Template "directory" makefile.
-
-
-
diff --git a/c/src/make/compilers/gcc-target-default.cfg b/c/src/make/compilers/gcc-target-default.cfg
deleted file mode 100644
index c1b27435dc..0000000000
--- a/c/src/make/compilers/gcc-target-default.cfg
+++ /dev/null
@@ -1,330 +0,0 @@
-#
-# Shared compiler for all GNU tools configurations
-#
-# $Id$
-#
-
-CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
-
-CPLUS_CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
-
-##
-# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V, CFLAGS_PROFILE_V are the values we
-# would want the corresponding macros to be set to.
-#
-# CFLAGS_OPTIMIZE, CFLAGS_DEBUG, CFLAGS_PROFILE are set in the leaf
-# Makefiles by the 'debug:' and 'profile:' targets to their _V values.
-#
-
-# default flags
-
-# We only include the header files for networking if it is enabled.
-INCLUDE_NETWORKING_yes_V = -I$(PROJECT_INCLUDE)/networking
-INCLUDE_NETWORKING = $(INCLUDE_NETWORKING_$(HAS_NETWORKING)_V)
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-ifeq ($(RTEMS_CROSS_TARGET),no)
-
-ifdef RTEMS_LIBC_DIR
-RTEMS_LIBC_INCLUDES := -I$(RTEMS_LIBC_DIR)/include
-endif
-
-# Used for posix bsps
-CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
- -I$(PROJECT_INCLUDE) \
- $(INCLUDE_NETWORKING) \
- $(RTEMS_LIBC_INCLUDES) $(DEFINES)
-
-ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g \
- -I$(PROJECT_INCLUDE) \
- $(RTEMS_LIBC_INCLUDES) $(DEFINES)
-else
-# Used for embedded bsps
-# Ask gcc where it finds its own include files
-GCC_INCLUDE=$(shell $(CC) $(CPU_CFLAGS) -print-file-name=include $(GCCSED))
-
-CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
- -nostdinc -I$(PROJECT_INCLUDE) \
- $(INCLUDE_NETWORKING) \
- -I$(RTEMS_LIBC_DIR)/include -I$(GCC_INCLUDE) $(DEFINES)
-
-ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g \
- -nostdinc -I$(PROJECT_INCLUDE) \
- -I$(RTEMS_LIBC_DIR)/include -I$(GCC_INCLUDE) $(DEFINES)
-endif
-
-# default location of Standard C Library
-ifndef LIBC_LIBC
-LIBC_LIBC=$(RTEMS_LIBC_DIR)/lib/libc.a
-endif
-
-ifndef LIBC_LIBM
-LIBC_LIBM=$(RTEMS_LIBC_DIR)/lib/libm.a
-endif
-
-else
-CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
- -B$(PROJECT_RELEASE)/lib/ -specs bsp_specs -qrtems \
- $(INCLUDE_NETWORKING) $(DEFINES)
-
-ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g -I$(srcdir) \
- -B$(PROJECT_RELEASE)/lib/ -specs bsp_specs -qrtems $(DEFINES)
-
-# default location of Standard C Library
-ifndef LIBC_LIBC
-LIBC_LIBC=$(shell $(CC) $(CPU_CFLAGS) -print-file-name=libc.a $(GCCSED))
-endif
-
-ifndef LIBC_LIBM
-LIBC_LIBM=$(shell $(CC) $(CPU_CFLAGS) -print-file-name=libm.a $(GCCSED))
-endif
-endif
-
-# Define this to yes if C++ is included in the development environment.
-# This requires that at least the GNU C++ compiler and libg++ be installed.
-ifeq ($(RTEMS_HAS_CPLUSPLUS),yes)
-HAS_CPLUSPLUS=yes
-CPLUS_LD_LIBS += $(PROJECT_RELEASE)/lib/librtems++$(LIBSUFFIX_VA)
-else
-HAS_CPLUSPLUS=no
-endif
-
-# debug flag;
-CFLAGS_DEBUG_V+=-Wno-unused
-
-ifeq ($(RTEMS_USE_GCC272),no)
-CFLAGS_DEBUG_V+=-qrtems_debug
-endif
-
-# when debugging, optimize flag: typically empty
-# some compilers do allow optimization with their "-g"
-#CFLAGS_DEBUG_OPTIMIZE_V=
-
-# profile flag; use gprof(1)
-CFLAGS_PROFILE_V=-pg
-
-# default is to optimize
-CFLAGS_OPTIMIZE=$(CFLAGS_OPTIMIZE_V)
-
-# dynamic libraries
-CFLAGS_DYNAMIC_V=-fpic
-#ASFLAGS_DYNAMIC_V=
-
-CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE)
-
-# List of library paths without -L
-LD_PATHS= $(PROJECT_RELEASE)/lib
-
-# libraries you want EVERYONE to link with
-#LD_LIBS=
-
-# ld flag to ensure pure-text
-#LDFLAGS_MUST_BE_PURE_V =
-
-# ld flag for [un]shared objects
-#LDFLAGS_STATIC_LIBRARIES_V =
-#LDFLAGS_SHARED_LIBRARIES_V =
-
-# ld flag for incomplete link
-LDFLAGS_INCOMPLETE = -r
-
-# Special linker options when building lib.so
-LDFLAGS_DYNAMIC_V = ??
-
-# Some dynamic linking systems want the preferred name recorded in the binary
-# ref: src/libxil/Makefile
-LDFLAGS_DYNAMIC_LIBNAME_V = -h $(DYNAMIC_VERSION_LIBNAME)
-
-# ld flags for profiling, debugging
-LDFLAGS_PROFILE_V =
-LDFLAGS_DEBUG_V =
-
-LDFLAGS=$(LDFLAGS_PROFILE) $(LDFLAGS_DEBUG) $(LD_PATHS:%=-L %)
-
-#
-# Stuff to clean and clobber for the compiler and its tools
-#
-
-CLEAN_CC = a.out *.o *.BAK
-CLOBBER_CC =
-
-#
-# Client compiler and support tools
-#
-
-# CPP command to write file to standard output
-CPP=$(CC) -E -ansi -w -Wp,-$$
-
-# flags set by cc when running cpp
-CPP_CC_FLAGS=-D__STDC__
-
-ASFLAGS= $(CPU_ASFLAGS)
-ASM4FLAGS := -I $(PROJECT_INCLUDE)
-
-# egrep regexp to ignore symbol table entries in ar archives.
-# Only used to make sure we skip them when coalescing libraries.
-# skip __.SYMDEF and empty names (maybe bug in ranlib??).
-AR_SYMBOL_TABLE="HIGHLY-UNLIKELY-TO-CONFLICT"
-ARFLAGS=ruv
-
-#
-# Command to convert a normal archive to one searchable by $(LD)
-#
-# NOTE: Obsolete, use $(RANLIB) instead, MKLIB may disappear soon
-MKLIB=$(RANLIB)
-
-#
-# How to compile stuff into ${ARCH} subdirectory
-#
-# NOTE: we override COMPILE.c
-#
-
-COMPILE.c=$(CC) $(CFLAGS) $(XCFLAGS) -c
-COMPILE.cc=$(CXX) $(CFLAGS) $(CXXFLAGS) $(XCFLAGS) -c
-
-${ARCH}/%.o: %.c
- ${COMPILE.c} -o $@ $<
-
-${ARCH}/%.o: %.cc
- ${COMPILE.cc} -o $@ $<
-
-${ARCH}/%.o: %.S
- ${COMPILE.c} -DASM -o $@ $<
-
-# strip out C++ style comments.
-${ARCH}/%.o: %.s
- sed -e 's/\/\/.*$$//' < $< | \
- $(CPP) $(ASMFLAGS) -I. -I$(srcdir) -DASM - >$(ARCH)/$*.i
- $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i
-
-# $(CPP) $(CPPFLAGS) -DASM - < $< >$(ARCH)/$*.i
-# $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i
-# $(RM) $(ARCH)/$*.i
-
-# Specify our own default rule for this to prevent having CFLAGS and
-# CPPFLAGS being passed to linker
-#
-#
-# NOTE (Ralf): Having this rule is a bug, IMO.
-# I have only kept it for the moment because some (broken) Makefiles
-# might need it.
-#
-# ${ARCH}/%: ${ARCH}/%.o
-# ${CC} ${LDFLAGS} -o $@ $@.o ${LD_LIBS}
-#
-# Anyway, the rule above is wrong. The one below should be correct
-# (But this one should also not be necessary. If something breaks now,
-# have a look at the Makefile or custom/*.cfg :-)
-# $(ARCH)/%.exe: $(ARCH)/%.o
-# $(make-exe)
-
-# Make foo.rel from foo.o
-${ARCH}/%.rel: ${ARCH}/%.o
- ${LD} $(LDFLAGS_INCOMPLETE) -o $@ $^
-
-# create $(ARCH)/pgm from pgm.sh
-${ARCH}/%: %.sh
- $(RM) $@
- $(CP) $< $@
- $(CHMOD) +x $@
-
-# Dependency files for use by gmake
-# NOTE: we don't put in $(TARGET_ARCH)
-# so that 'make clean' doesn't blow it away
-
-DEPEND=Depends-$(TARGET_ARCH:o-%=%)
-
-CLEAN_DEPEND=$(DEPEND).tmp
-CLOBBER_DEPEND=$(DEPEND)
-
-# We deliberately don't have anything depend on the
-# $(DEPEND) file; otherwise it will get rebuilt even
-# on 'make clean'
-#
-
-depend: $(C_FILES) $(CC_FILES) $(S_FILES)
-ifneq ($(words $(C_FILES) $(CC_FILES) $(S_FILES)), 0)
-# Use gcc -M to generate dependencies
-# Replace foo.o with $(ARCH)/foo.o
-# Replace $(ARCH) value with string $(ARCH)
-# so that it will for debug and profile cases
- $(COMPILE.c) -M $^ | \
- $(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
- -e 's?$(ARCH)/?$$(ARCH)/?' >$(DEPEND).tmp
- $(MV) $(DEPEND).tmp $(DEPEND)
-endif
-
-# spell out all the LINK_FILE's, rather than using -lbsp, so
-# that $(LINK_FILES) can be a dependency
-
-# Start file must be one of
-# $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o
-# $(PROJECT_RELEASE)/lib/asmiface$(LIB_VARIANT).o
-# It defaults to start.o, but an app can override it.
-
-ifeq ($(START_BASE),)
- START_FILE=
-else
- START_FILE=$(PROJECT_RELEASE)/lib/$(START_BASE)$(LIB_VARIANT).o
-endif
-
-CONSTRUCTOR=
-
-LIBC_LOW=
-
-ifndef LIBGCC
-LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name $(GCCSED))
-endif
-
-#
-# NOTE: a rule to link an rtems' application should look similar to this
-# (cf. "make-exe" in make/custom/*.cfg):
-#
-# gcc27:
-# $(PGM): $(LINK_FILES)
-# $(LD) $(LDFLAGS) -o $@ $(LINK_OBJS) \
-# --start-group $(LINK_LIBS) --end-group
-#
-# gcc28:
-# $(PGM): $(LINK_FILES)
-# $(CC) $(CFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS)
-#
-
-LINK_OBJS =\
- $(CONSTRUCTOR) \
- $(OBJS) \
- $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel) \
- $(PROJECT_RELEASE)/lib/libtest$(LIBSUFFIX_VA)
-
-LINK_FILES =\
- $(START_FILE) \
- $(CONSTRUCTOR) \
- $(OBJS) \
- $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel) \
- $(PROJECT_RELEASE)/lib/libtest$(LIBSUFFIX_VA) \
- $(PROJECT_RELEASE)/lib/librtemsall$(LIBSUFFIX_VA)
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-LINK_LIBS = $(PROJECT_RELEASE)/lib/librtemsall$(LIBSUFFIX_VA)
-ifeq ($(RTEMS_CROSS_TARGET),yes)
-# NOTE: add libc and libgcc only for embedded targets
-# LIBC_LIBM should not be needed by rtems itself.
-# FIXME: If a BSP requires libm, its make/custom/*.cfg file should add
-# LIBC_LIBM to LINK_LIBS (untested)
-LINK_LIBS += $(LIBC_LIBC) $(LIBGCC)
-endif
-endif
-
-LINK_LIBS += $(LD_LIBS)
-
-#
-# Allow user to override link commands (to build a prom image, perhaps)
-#
-ifndef LINKCMDS
-LINKCMDS=$(PROJECT_RELEASE)/lib/linkcmds
-endif
-
-
-define make-rel
- $(LD) $(LDFLAGS_INCOMPLETE) $(XLDFLAGS) -o $@ $(OBJS)
-endef
diff --git a/c/src/make/directory.cfg b/c/src/make/directory.cfg
deleted file mode 100644
index 68b68d79e0..0000000000
--- a/c/src/make/directory.cfg
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# $Id$
-#
-# make/directory.cfg
-#
-# Make(1) configuration file include'd by all directory-level Makefile's.
-#
-# See also make/main.cfg
-#
-
-# include $(RTEMS_ROOT)/make/main.cfg
-
-# on a 'make -k' we don't want to bomb out of directory list
-EXIT_CMD=exit 1
-ifeq (k, $(findstring k, $(MAKEFLAGS)))
-EXIT_CMD=true
-endif
-
-RULE=$(shell echo $@ | $(SED) -e s/debug_// -e s/profile_//)
-
-ifeq ($(RTEMS_USE_OWN_PDIR),yes)
-$(RECURSE_TARGETS):
- @$(ECHO); \
- BASEDIR=`pwd`; \
- test -d $$BASEDIR || $(EXIT_CMD) ; \
- for subd in $(SUB_DIRS) xxx; \
- do if [ $$subd != xxx ] ; then \
- cd $$BASEDIR; \
- if [ ! -d $$subd ] ; then \
- $(ECHO) "*** ERROR -- Directory ($$subd) does not exist!!!"; \
- $(EXIT_CMD) ; \
- fi ; \
- $(ECHO); \
- $(ECHO) "*** $$BASEDIR/$$subd ($@)" ; \
- cmd="cd $$subd; $(MAKE) $(RULE)"; \
- $(ECHO) $$cmd; \
- eval $$cmd || $(EXIT_CMD); \
- fi; done; \
- $(ECHO); \
- $(ECHO) "*** $$BASEDIR/$@ ($@) Finished."; \
- $(ECHO)
- $($@_WRAPUP)
-else
-ifdef RECURSE_TARGETS
-$(RECURSE_TARGETS):
- @$(ECHO) ; set -e ; \
- if [ "$(SUB_DIRS)" != "" ] ; then \
- sdirs="$(SUB_DIRS)" ; \
- else \
- sdirs="xxx" ; \
- fi ; \
- if [ "$$sdirs" != "xxx" ] ; then \
- for subd in $$sdirs; do $(MAKE) -w -C $$subd $(RULE); done ;\
- fi
-endif
-endif
-
diff --git a/c/src/make/host.cfg.in b/c/src/make/host.cfg.in
deleted file mode 100644
index 0c8f9cf408..0000000000
--- a/c/src/make/host.cfg.in
+++ /dev/null
@@ -1,74 +0,0 @@
-#
-# $Id$
-#
-# OS-specific configuration
-#
-# Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de) 97/11/08
-#
-# Derived from rtems/c/make/os/*.cfg in previous RTEMS version.
-#
-
-RTEMS_HOST = @RTEMS_HOST@
-
-#
-# Stuff to clean and clobber for the OS
-#
-
-CLEAN_OS =
-CLOBBER_OS = *~ *.bak TAGS tags
-
-SHELL=/bin/sh
-ECHO=echo
-
-CAT=@CAT@
-RM=@RM@ -f
-CP=@CP@
-MV=@MV@
-LN=@LN@
-MKDIR=@MKDIR@
-CHMOD=@CHMOD@
-SED=@SED@
-M4=@M4@
-
-INSTALL=$(PROJECT_TOOLS)/install-if-change
-INSTALL_VARIANT=$(PROJECT_TOOLS)/install-if-change -V "$(LIB_VARIANT)"
-
-# FIXME: HACK for a bug in cygwin-hosted egcs which returns a mixture
-# of '\\' and '/' as path separators.
-# Should be removed as soon as this bug is fixed in egcs.
-GCCSED = @GCCSED@
-
-# ksh (or bash) is used by some shell scripts; ref build-tools/scripts/Makefile
-#
-# Must have shell functions. Some ksh's core dump mysteriously and
-# unreliably on RTEMS shell scripts. bash appears to be the most
-# reliable but late model ksh's are usually OK.
-KSH=@KSH@
-
-#
-# RCS support
-#
-RCS_CLEAN=$(PROJECT_TOOLS)/rcs-clean
-
-#
-# Rule to install a shell script with the proper shell to run it.
-#
-
-# when debugging, one may want to save the previous incarnation of the
-# installed script. Replace the first line of this rule to do this.
-#
-# -$(RM) $@.old
-# -$(MV) $@ $@.old >/dev/null 2>&1
-
-define make-script
- -$(RM) $@
- $(SED) -e '1,1s?^#!KSHELL?#!$(KSH)?' \
- -e '1,1s?^#!SHELL?#!$(SHELL)?' < $< > $@
- $(CHMOD) 0555 $@
-endef
-
-INSTBINFLAGS = -m 0755
-INSTDATAFLAGS = -m 0644
-INSTLIBFLAGS = -m 0644
-INSTDIRFLAGS = -m 0755 -d
-INSTINCFLAGS = -m 0644
diff --git a/c/src/make/lib.cfg b/c/src/make/lib.cfg
deleted file mode 100644
index 6d170efed4..0000000000
--- a/c/src/make/lib.cfg
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-# make/lib.cfg
-#
-# Make(1) configuration file include'd by all "library" Makefile
-# Assumes $(LIB) is set to $(ARCH)/libfoo.a
-#
-
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-define make-library
-$(RM) $@
-$(AR) $(ARFLAGS) $@ $(OBJS)
-$(MKLIB) $@
-endef
-
-CLEAN_ADDITIONS +=
-
-.PRECIOUS: $(LIB)
diff --git a/c/src/optman/rtems/no-dpmem.c b/c/src/optman/rtems/no-dpmem.c
deleted file mode 100644
index b3a122abb7..0000000000
--- a/c/src/optman/rtems/no-dpmem.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Dual Port Memory Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/address.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/dpmem.h>
-
-void _Dual_ported_memory_Manager_initialization(
- unsigned32 maximum_ports
-)
-{
-}
-
-rtems_status_code rtems_port_create(
- rtems_name name,
- void *internal_start,
- void *external_start,
- unsigned32 length,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_port_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_port_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_port_internal_to_external(
- Objects_Id id,
- void *internal,
- void **external
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_port_external_to_internal(
- Objects_Id id,
- void *external,
- void **internal
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/optman/rtems/no-event.c b/c/src/optman/rtems/no-event.c
deleted file mode 100644
index 5aa427ce73..0000000000
--- a/c/src/optman/rtems/no-event.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Event Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/event.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-void _Event_Manager_initialization( void )
-{
-}
-
-rtems_status_code rtems_event_send(
- Objects_Id id,
- rtems_event_set event_in
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_event_receive(
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
diff --git a/c/src/optman/rtems/no-mp.c b/c/src/optman/rtems/no-mp.c
deleted file mode 100644
index 71c38826f3..0000000000
--- a/c/src/optman/rtems/no-mp.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Multiprocessing Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/mp.h>
-#include <rtems/score/cpu.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/tqdata.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/interr.h>
-
-void _Multiprocessing_Manager_initialization ( void )
-{
-}
-
-void rtems_multiprocessing_announce ( void )
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-void _MPCI_Handler_initialization(
- MPCI_Control *users_mpci_table,
- unsigned32 timeout_status
-)
-{
-}
-
-void _MPCI_Create_server( void )
-{
-}
-
-void _MPCI_Initialization ( void )
-{
-}
-
-void _MPCI_Register_packet_processor(
- MP_packet_Classes the_class,
- MPCI_Packet_processor the_packet_processor
-
-)
-{
-}
-
-MP_packet_Prefix *_MPCI_Get_packet ( void )
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return NULL;
-}
-
-void _MPCI_Return_packet (
- MP_packet_Prefix *the_packet
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-void _MPCI_Send_process_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-unsigned32 _MPCI_Send_request_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet,
- States_Control extra_state
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return 0;
-}
-
-void _MPCI_Send_response_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-MP_packet_Prefix *_MPCI_Receive_packet ( void )
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return NULL;
-}
-
-Thread_Control *_MPCI_Process_response (
- MP_packet_Prefix *the_packet
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return NULL;
-}
-
-Thread _MPCI_Receive_server(
- unsigned32 ignore
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-void _MPCI_Announce ( void )
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-
-void _MPCI_Internal_packets_Send_process_packet (
- MPCI_Internal_Remote_operations operation
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-void _MPCI_Internal_packets_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void )
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return NULL;
-}
-
-/* end of file */
diff --git a/c/src/optman/rtems/no-msg.c b/c/src/optman/rtems/no-msg.c
deleted file mode 100644
index 65103dcb7d..0000000000
--- a/c/src/optman/rtems/no-msg.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Message Queue Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/isr.h>
-#include <rtems/rtems/message.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/interr.h>
-
-void _Message_queue_Manager_initialization(
- unsigned32 maximum_message_queues
-)
-{
-}
-
-rtems_status_code rtems_message_queue_create(
- rtems_name name,
- unsigned32 count,
- unsigned32 max_message_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_message_queue_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_message_queue_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_message_queue_send(
- Objects_Id id,
- void *buffer,
- unsigned32 size
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_message_queue_urgent(
- Objects_Id id,
- void *buffer,
- unsigned32 size
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_message_queue_broadcast(
- Objects_Id id,
- void *buffer,
- unsigned32 size,
- unsigned32 *count
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_message_queue_receive(
- Objects_Id id,
- void *buffer,
- unsigned32 *size_p,
- unsigned32 option_set,
- rtems_interval timeout
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_message_queue_flush(
- Objects_Id id,
- unsigned32 *count
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-unsigned32 _Message_queue_Flush_support(
- Message_queue_Control *the_message_queue
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
- return 0;
-}
-
-boolean _Message_queue_Seize(
- Message_queue_Control *the_message_queue,
- rtems_option option_set,
- void *buffer,
- unsigned32 *size_p
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
- _Thread_Executing->Wait.return_code = RTEMS_UNSATISFIED;
- return TRUE;
-}
-
-rtems_status_code _Message_queue_Submit(
- Objects_Id id,
- void *buffer,
- unsigned32 size,
- Message_queue_Submit_types submit_type
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/optman/rtems/no-part.c b/c/src/optman/rtems/no-part.c
deleted file mode 100644
index 56abcb7af1..0000000000
--- a/c/src/optman/rtems/no-part.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Partition Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/address.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/part.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-void _Partition_Manager_initialization(
- unsigned32 maximum_partitions
-)
-{
-}
-
-rtems_status_code rtems_partition_create(
- rtems_name name,
- void *starting_address,
- unsigned32 length,
- unsigned32 buffer_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_partition_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_partition_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_partition_get_buffer(
- Objects_Id id,
- void **buffer
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_partition_return_buffer(
- Objects_Id id,
- void *buffer
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/optman/rtems/no-region.c b/c/src/optman/rtems/no-region.c
deleted file mode 100644
index 3ae7c86f35..0000000000
--- a/c/src/optman/rtems/no-region.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Region Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/region.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-void _Region_Manager_initialization(
- unsigned32 maximum_regions
-)
-{
-}
-
-rtems_status_code rtems_region_create(
- rtems_name name,
- void *starting_address,
- unsigned32 length,
- unsigned32 page_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_region_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_region_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_region_get_segment(
- Objects_Id id,
- unsigned32 size,
- rtems_option option_set,
- rtems_interval timeout,
- void **segment
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_region_get_segment_size(
- Objects_Id id,
- void *segment,
- unsigned32 *size
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_region_return_segment(
- Objects_Id id,
- void *segment
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/optman/rtems/no-rtmon.c b/c/src/optman/rtems/no-rtmon.c
deleted file mode 100644
index 96e6fe8228..0000000000
--- a/c/src/optman/rtems/no-rtmon.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Rate Monotonic Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/ratemon.h>
-
-void _Rate_monotonic_Manager_initialization(
- unsigned32 maximum_periods
-)
-{
-}
-
-rtems_status_code rtems_rate_monotonic_create(
- rtems_name name,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_rate_monotonic_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_rate_monotonic_cancel(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_rate_monotonic_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_rate_monotonic_period(
- Objects_Id id,
- rtems_interval length
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-void _Rate_monotonic_Timeout(
- Objects_Id id,
- void *ignored
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
-}
-
-boolean _Rate_monotonic_Set_state(
-Rate_monotonic_Control *the_period
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return FALSE;
-}
diff --git a/c/src/optman/rtems/no-sem.c b/c/src/optman/rtems/no-sem.c
deleted file mode 100644
index 2f31e50cd9..0000000000
--- a/c/src/optman/rtems/no-sem.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Semaphore Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/interr.h>
-
-void _Semaphore_Manager_initialization(
- unsigned32 maximum_semaphores
-)
-{
-}
-
-rtems_status_code rtems_semaphore_create(
- rtems_name name,
- unsigned32 count,
- rtems_attribute attribute_set,
- rtems_task_priority priority_ceiling,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_semaphore_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_semaphore_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_semaphore_obtain(
- Objects_Id id,
- unsigned32 option_set,
- rtems_interval timeout
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_semaphore_release(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-boolean _Semaphore_Seize(
- Semaphore_Control *the_semaphore,
- rtems_option option_set
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- _Thread_Executing->Wait.return_code = RTEMS_UNSATISFIED;
- return TRUE;
-}
diff --git a/c/src/optman/rtems/no-signal.c b/c/src/optman/rtems/no-signal.c
deleted file mode 100644
index b73d12c97b..0000000000
--- a/c/src/optman/rtems/no-signal.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Signal Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-#include <rtems/rtems/asr.h>
-#include <rtems/rtems/modes.h>
-#include <rtems/rtems/signal.h>
-
-void _Signal_Manager_initialization( void )
-{
-}
-
-rtems_status_code rtems_signal_catch(
- rtems_asr_entry handler,
- rtems_mode mode_set
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_signal_send(
- rtems_id id,
- rtems_signal_set signal_set
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-/* end of file */
diff --git a/c/src/optman/rtems/no-timer.c b/c/src/optman/rtems/no-timer.c
deleted file mode 100644
index 5d6ec63d4e..0000000000
--- a/c/src/optman/rtems/no-timer.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Timer Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/score/interr.h>
-
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/timer.h>
-
-void _Timer_Manager_initialization(
- unsigned32 maximum_timers
-)
-{
-}
-
-rtems_status_code rtems_timer_create(
- rtems_name name,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_timer_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_timer_cancel(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_timer_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_timer_fire_after(
- Objects_Id id,
- rtems_interval ticks,
- rtems_timer_service_routine_entry routine,
- void *user_data
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_timer_fire_when(
- Objects_Id id,
- rtems_time_of_day *wall_time,
- rtems_timer_service_routine_entry routine,
- void *user_data
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_timer_reset(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/optman/sapi/no-ext.c b/c/src/optman/sapi/no-ext.c
deleted file mode 100644
index ae72a6e552..0000000000
--- a/c/src/optman/sapi/no-ext.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Extension Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/extension.h>
-#include <rtems/score/interr.h>
-
-void _Extension_Manager_initialization(
- unsigned32 maximum_extensions
-)
-{
-}
-
-rtems_status_code rtems_extension_create(
- rtems_name name,
- rtems_extensions_table *extension_table,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_extension_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_extension_delete(
- Objects_Id id
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/optman/sapi/no-io.c b/c/src/optman/sapi/no-io.c
deleted file mode 100644
index 7b38c436d4..0000000000
--- a/c/src/optman/sapi/no-io.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Input/Output Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/io.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/interr.h>
-
-void _IO_Manager_initialization(
- rtems_driver_address_table *driver_table,
- unsigned32 number_of_drivers,
- unsigned32 number_of_devices
-)
-{
-}
-
-void _IO_Initialize_all_drivers( void )
-{
-}
-
-rtems_status_code rtems_io_register_name(
- char *device_name,
- rtems_device_major_number major,
- rtems_device_minor_number minor
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_io_lookup_name(
- const char *pathname,
- rtems_driver_name_t **rnp
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_io_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_io_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_io_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_io_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_io_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_status_code rtems_io_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- _Internal_error_Occurred(
- INTERNAL_ERROR_RTEMS_API,
- FALSE,
- RTEMS_NOT_CONFIGURED
- );
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/c/src/tests/Makefile.in b/c/src/tests/Makefile.in
deleted file mode 100644
index 7eb4494b34..0000000000
--- a/c/src/tests/Makefile.in
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-all: README
-
-# mptests are the multiprocessing test suite
-# We only build them if HAS_MP was defined
-MP_TESTS_yes_V = mptests
-MP_TESTS = $(MP_TESTS_$(HAS_MP)_V)
-
-# psxtests are the POSIX API test suite
-# We only build them if HAS_POSIX_API was defined
-POSIX_TESTS_yes_V = psxtests
-POSIX_TESTS = $(POSIX_TESTS_$(HAS_POSIX_API)_V)
-
-# wildcard on this lets ALL test suites be optional
-SUB_DIRS=$(wildcard tools support samples libtests \
- sptests $(MP_TESTS) $(POSIX_TESTS) tmtests)
-
diff --git a/c/src/tests/PROBLEMS b/c/src/tests/PROBLEMS
deleted file mode 100644
index 6f3e2920be..0000000000
--- a/c/src/tests/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/c/src/tests/README b/c/src/tests/README
deleted file mode 100644
index f799370569..0000000000
--- a/c/src/tests/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/c/src/tests/libtests/Makefile.in b/c/src/tests/libtests/Makefile.in
deleted file mode 100644
index 004100a86e..0000000000
--- a/c/src/tests/libtests/Makefile.in
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# We only build the tests for the rtems++ library if HAS_CPLUSPLUS was defined
-LIBRTEMSCPLUSPLUS_yes_V = rtems++
-LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V)
-
-SUB_DIRS=cpuuse malloctest monitor rtmonuse stackchk \
- termios $(LIBRTEMSCPLUSPLUS)
diff --git a/c/src/tests/libtests/README b/c/src/tests/libtests/README
deleted file mode 100644
index bc4b217832..0000000000
--- a/c/src/tests/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/c/src/tests/libtests/cpuuse/Makefile.in b/c/src/tests/libtests/cpuuse/Makefile.in
deleted file mode 100644
index 22ef7819d2..0000000000
--- a/c/src/tests/libtests/cpuuse/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=cpuuse
-
-MANAGERS=io rate_monotonic
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2 task3 tswitch
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/libtests/cpuuse/cpuuse.scn b/c/src/tests/libtests/cpuuse/cpuuse.scn
deleted file mode 100644
index f104c0c482..0000000000
--- a/c/src/tests/libtests/cpuuse/cpuuse.scn
+++ /dev/null
@@ -1,24 +0,0 @@
-*** TEST 4 ***
-TA1 - 09:15:00 12/31/1988
-TA1 - rtems_task_suspend - on Task 2
-TA1 - rtems_task_suspend - on Task 3
-TA1 - killing time
-TA1 - rtems_task_resume - on Task 2
-TA1 - rtems_task_resume - on Task 3
-TA2 - 09:15:03 12/31/1988
-TA3 - 09:15:04 12/31/1988
-TA1 - 09:15:05 12/31/1988
-TA2 - 09:15:06 12/31/1988
-TA3 - 09:15:07 12/31/1988
-TA1 - 09:15:08 12/31/1988
-TA1 - rtems_task_mode - change mode to NO RTEMS_PREEMPT
-TA1 - 09:15:09 12/31/1988
-TA1 - 09:15:10 12/31/1988
-TA1 - 09:15:11 12/31/1988
-TA1 - 09:15:12 12/31/1988
-TA1 - 09:15:13 12/31/1988
-TA1 - 09:15:14 12/31/1988
-TA1 - rtems_task_mode - change mode to RTEMS_PREEMPT
-TA2 - 09:15:15 12/31/1988
-TA3 - 09:15:16 12/31/1988
-*** END OF TEST 4 ***
diff --git a/c/src/tests/libtests/cpuuse/init.c b/c/src/tests/libtests/cpuuse/init.c
deleted file mode 100644
index 31e017c698..0000000000
--- a/c/src/tests/libtests/cpuuse/init.c
+++ /dev/null
@@ -1,106 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/libtests/cpuuse/system.h b/c/src/tests/libtests/cpuuse/system.h
deleted file mode 100644
index 055d93a098..0000000000
--- a/c/src/tests/libtests/cpuuse/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 (6 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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 ];
-
-/* end of include file */
diff --git a/c/src/tests/libtests/cpuuse/task1.c b/c/src/tests/libtests/cpuuse/task1.c
deleted file mode 100644
index 53f0188ca0..0000000000
--- a/c/src/tests/libtests/cpuuse/task1.c
+++ /dev/null
@@ -1,103 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/libtests/cpuuse/task2.c b/c/src/tests/libtests/cpuuse/task2.c
deleted file mode 100644
index ff22274284..0000000000
--- a/c/src/tests/libtests/cpuuse/task2.c
+++ /dev/null
@@ -1,29 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/libtests/cpuuse/task3.c b/c/src/tests/libtests/cpuuse/task3.c
deleted file mode 100644
index a431a99f9d..0000000000
--- a/c/src/tests/libtests/cpuuse/task3.c
+++ /dev/null
@@ -1,29 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/libtests/cpuuse/tswitch.c b/c/src/tests/libtests/cpuuse/tswitch.c
deleted file mode 100644
index 9abd5f80cb..0000000000
--- a/c/src/tests/libtests/cpuuse/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 "cpuuse.h"
-
-rtems_extension Task_switch(
- rtems_tcb *unused,
- rtems_tcb *heir
-)
-{
- rtems_unsigned32 index;
- rtems_time_of_day time;
- rtems_status_code status;
-
- index = task_number( heir->Object.id );
-
- switch( index ) {
- case 1:
- case 2:
- case 3:
- Run_count[ index ] += 1;
-
- status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
- directive_failed( status, "rtems_clock_get" );
-
- put_name( Task_name[ index ], FALSE );
- print_time( "- ", &time, "\n" );
-
- if ( time.second >= 16 ) {
- CPU_usage_Dump();
- puts( "*** END OF CPU USAGE LIBRARY TEST ***" );
- exit( 0 );
- }
- break;
-
- case 0:
- default:
- break;
- }
-}
diff --git a/c/src/tests/libtests/malloctest/Makefile.in b/c/src/tests/libtests/malloctest/Makefile.in
deleted file mode 100644
index ca7c4cb1f6..0000000000
--- a/c/src/tests/libtests/malloctest/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=malloctest
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/libtests/malloctest/init.c b/c/src/tests/libtests/malloctest/init.c
deleted file mode 100644
index 643aa843b8..0000000000
--- a/c/src/tests/libtests/malloctest/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_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_create(
- Task_name[ 4 ],
- 1,
- TASK_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 ],
- 1,
- TASK_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[ 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/c/src/tests/libtests/malloctest/system.h b/c/src/tests/libtests/malloctest/system.h
deleted file mode 100644
index 7c95130900..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE*3)
-
-#define CONFIGURE_EXTRA_TASK_STACKS (10 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/c/src/tests/libtests/malloctest/task1.c b/c/src/tests/libtests/malloctest/task1.c
deleted file mode 100644
index aa47bd404b..0000000000
--- a/c/src/tests/libtests/malloctest/task1.c
+++ /dev/null
@@ -1,67 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <libcsupport.h> /* for malloc_dump, malloc_walk */
-#include <string.h> /* for memset */
-
-#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 )
- 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 = rand() * task_number( tid );
- printf("mallocing %d bytes\n",mem_amt);
- mem_ptr = malloc ( 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);
- exit(1);
- }
- }
- directive_failed( status, "rtems_task_wake_after" );
- free( mem_ptr );
- }
-}
diff --git a/c/src/tests/libtests/monitor/Makefile.in b/c/src/tests/libtests/monitor/Makefile.in
deleted file mode 100644
index e264fe9f9b..0000000000
--- a/c/src/tests/libtests/monitor/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=monitor
-
-MANAGERS=dpmem event io msg mp part region sem signal timer rate_monotonic ext
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/libtests/monitor/init.c b/c/src/tests/libtests/monitor/init.c
deleted file mode 100644
index 0766c5f8cc..0000000000
--- a/c/src/tests/libtests/monitor/init.c
+++ /dev/null
@@ -1,74 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/monitor.h>
-
-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/c/src/tests/libtests/monitor/system.h b/c/src/tests/libtests/monitor/system.h
deleted file mode 100644
index 75f5771161..0000000000
--- a/c/src/tests/libtests/monitor/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_INIT_TASK_PRIORITY 10
-#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
-#define CONFIGURE_MAXIMUM_PERIODS 10
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/libtests/rtems++/Init.cc b/c/src/tests/libtests/rtems++/Init.cc
deleted file mode 100644
index 4474580bc3..0000000000
--- a/c/src/tests/libtests/rtems++/Init.cc
+++ /dev/null
@@ -1,63 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/libtests/rtems++/Makefile.in b/c/src/tests/libtests/rtems++/Makefile.in
deleted file mode 100644
index f909b618b9..0000000000
--- a/c/src/tests/libtests/rtems++/Makefile.in
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=rtems++
-
-MANAGERS=event io msg sem signal timer rate_monotonic
-
-# C++ source names, if any, go here -- minus the .cc
-CC_PIECES=Init Task1 Task2 Task3
-CC_FILES=$(CC_PIECES:%=%.cc)
-CC_O_FILES=$(CC_PIECES:%=${ARCH}/%.o)
-
-H_FILES=System.h
-
-DOCTYPES=scn
-DOCS=$(DOCTYPES:%=$(TEST).%)
-
-SRCS=$(DOCS) $(C_FILES) $(H_FILES)
-OBJS=$(CC_O_FILES)
-
-PRINT_SRCS=$(DOCS)
-
-PGM=${ARCH}/$(TEST).exe
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=$(CPLUS_LD_LIBS)
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
-
-
-
-
-
-
diff --git a/c/src/tests/libtests/rtems++/System.h b/c/src/tests/libtests/rtems++/System.h
deleted file mode 100644
index 18668d3b9a..0000000000
--- a/c/src/tests/libtests/rtems++/System.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-#include <rtems++/rtemsEvent.h>
-#include <rtems++/rtemsMessageQueue.h>
-#include <rtems++/rtemsTask.h>
-#include <rtems++/rtemsTaskMode.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/libtests/rtems++/Task1.cc b/c/src/tests/libtests/rtems++/Task1.cc
deleted file mode 100644
index 0d334ca977..0000000000
--- a/c/src/tests/libtests/rtems++/Task1.cc
+++ /dev/null
@@ -1,682 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-#include <string.h>
-#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/c/src/tests/libtests/rtems++/Task2.cc b/c/src/tests/libtests/rtems++/Task2.cc
deleted file mode 100644
index afddbca67d..0000000000
--- a/c/src/tests/libtests/rtems++/Task2.cc
+++ /dev/null
@@ -1,81 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/libtests/rtems++/Task3.cc b/c/src/tests/libtests/rtems++/Task3.cc
deleted file mode 100644
index 73ddb3b6b2..0000000000
--- a/c/src/tests/libtests/rtems++/Task3.cc
+++ /dev/null
@@ -1,81 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/libtests/rtems++/rtems++.doc b/c/src/tests/libtests/rtems++/rtems++.doc
deleted file mode 100644
index 5834b4077d..0000000000
--- a/c/src/tests/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/c/src/tests/libtests/rtems++/rtems++.scn b/c/src/tests/libtests/rtems++/rtems++.scn
deleted file mode 100644
index 2b3682d6b6..0000000000
--- a/c/src/tests/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
-<pause - screen 1>
- * 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
-<pause - screen 2>
-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 *
-<pause - screen 3>
- * 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 *
-<pause - screen 4>
- * 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 *
-<pause - screen 5>
- * START Interrupt Class test *
- do not know a portable BSP type interrupt test
- * END Interrupt Class test *
-<pause - screen 6>
- * 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 *
-<pause - screen 7>
diff --git a/c/src/tests/libtests/rtmonuse/Makefile.in b/c/src/tests/libtests/rtmonuse/Makefile.in
deleted file mode 100644
index 9c9ea2e366..0000000000
--- a/c/src/tests/libtests/rtmonuse/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=rtmonuse
-
-MANAGERS=io rate_monotonic
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init getall task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/libtests/rtmonuse/getall.c b/c/src/tests/libtests/rtmonuse/getall.c
deleted file mode 100644
index 85f6470d1c..0000000000
--- a/c/src/tests/libtests/rtmonuse/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/libtests/rtmonuse/init.c b/c/src/tests/libtests/rtmonuse/init.c
deleted file mode 100644
index c599df3c5a..0000000000
--- a/c/src/tests/libtests/rtmonuse/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 "rtmonuse.h"
-
-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/c/src/tests/libtests/rtmonuse/rtmonuse.scn b/c/src/tests/libtests/rtmonuse/rtmonuse.scn
deleted file mode 100644
index bb4e8814da..0000000000
--- a/c/src/tests/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/c/src/tests/libtests/rtmonuse/system.h b/c/src/tests/libtests/rtmonuse/system.h
deleted file mode 100644
index b10fb1193b..0000000000
--- a/c/src/tests/libtests/rtmonuse/system.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_INIT_TASK_PRIORITY 10
-#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
-#define CONFIGURE_MAXIMUM_PERIODS 10
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (15 * RTEMS_MINIMUM_STACK_SIZE)
-#include <confdefs.h>
-
-/* 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/c/src/tests/libtests/rtmonuse/task1.c b/c/src/tests/libtests/rtmonuse/task1.c
deleted file mode 100644
index 92b22178af..0000000000
--- a/c/src/tests/libtests/rtmonuse/task1.c
+++ /dev/null
@@ -1,124 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <cpuuse.h>
-#include "rtmonuse.h"
-
-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 );
- 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 )
- 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();
- exit( 0 );
- }
-
- }
- break;
- }
-}
diff --git a/c/src/tests/libtests/stackchk/Makefile.in b/c/src/tests/libtests/stackchk/Makefile.in
deleted file mode 100644
index 462f83fb6c..0000000000
--- a/c/src/tests/libtests/stackchk/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=stackchk
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=blow init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/libtests/stackchk/blow.c b/c/src/tests/libtests/stackchk/blow.c
deleted file mode 100644
index 0be35308c8..0000000000
--- a/c/src/tests/libtests/stackchk/blow.c
+++ /dev/null
@@ -1,49 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-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/c/src/tests/libtests/stackchk/init.c b/c/src/tests/libtests/stackchk/init.c
deleted file mode 100644
index f4aab85d95..0000000000
--- a/c/src/tests/libtests/stackchk/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/libtests/stackchk/stackchk.scn b/c/src/tests/libtests/stackchk/stackchk.scn
deleted file mode 100644
index 84a5c5e342..0000000000
--- a/c/src/tests/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/c/src/tests/libtests/stackchk/system.h b/c/src/tests/libtests/stackchk/system.h
deleted file mode 100644
index a656d24e26..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* macros */
-
-#define TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE*3)
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define STACK_CHECKER_ON
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/c/src/tests/libtests/stackchk/task1.c b/c/src/tests/libtests/stackchk/task1.c
deleted file mode 100644
index 14cc35ae35..0000000000
--- a/c/src/tests/libtests/stackchk/task1.c
+++ /dev/null
@@ -1,44 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/libtests/termios/Makefile.in b/c/src/tests/libtests/termios/Makefile.in
deleted file mode 100644
index c575570f9e..0000000000
--- a/c/src/tests/libtests/termios/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-SAMPLE=termios
-PGM=${ARCH}/$(SAMPLE).exe
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-DOCTYPES=
-DOCS=$(DOCTYPES:%=$(SAMPLE).%)
-
-SRCS=$(DOCS) $(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-PRINT_SRCS=$(DOCS)
-
-PGM=${ARCH}/$(SAMPLE).exe
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/samples
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/libtests/termios/README b/c/src/tests/libtests/termios/README
deleted file mode 100644
index 6991d80309..0000000000
--- a/c/src/tests/libtests/termios/README
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# $Id$
-#
-
-These tests are brought to you by the letter `q'.
-
-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.
-
-Clear???
-
-Also, when testing the cooked mode input, try typing some tabs
-and/or control characters and make sure that you can backspace over
-them properly.
-
----
-Eric Norum
-eric@skatter.usask.ca
-Saskatchewan Accelerator Laboratory
-University of Saskatchewan
-Saskatoon, Canada.
-
diff --git a/c/src/tests/libtests/termios/init.c b/c/src/tests/libtests/termios/init.c
deleted file mode 100644
index 96c7e0934e..0000000000
--- a/c/src/tests/libtests/termios/init.c
+++ /dev/null
@@ -1,143 +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
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_MAXIMUM_SEMAPHORES 20
-#define CONFIGURE_MAXIMUM_TIMERS 5
-#define CONFIGURE_MAXIMUM_PERIODS 1
-
-#define CONFIGURE_MICROSECONDS_PER_TICK 1000
-
-#define CONFIGURE_INIT
-rtems_task Init (rtems_task_argument argument);
-
-#include <confdefs.h>
-
-#include <stdio.h>
-#include <unistd.h>
-#include <termios.h>
-#include <errno.h>
-#include <string.h>
-
-/*
- * Test raw (ICANON=0) input
- */
-static void
-testRawInput (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 VMIN=%d VTIME=%d ***\n", vmin, vtime);
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond);
- i = tcgetattr (fileno (stdin), &old);
- if (i < 0) {
- printf ("tcgetattr failed: %s\n", strerror (errno));
- return;
- }
- new = old;
- new.c_lflag &= ~(ICANON|ECHO|ECHONL|ECHOK|ECHOE|ECHOPRT|ECHOCTL);
- new.c_cc[VMIN] = vmin;
- new.c_cc[VTIME] = vtime;
- i = tcsetattr (fileno (stdin), TCSANOW, &new);
- if (i < 0) {
- printf ("tcsetattr failed: %s\n", strerror (errno));
- 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) {
- printf ("Read error: %s\n", strerror (errno));
- 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 (" %2.2x", cbuf[i]);
- printf ("\n");
- } while (cbuf[0] != 'q');
- out:
- i = tcsetattr (fileno (stdin), TCSANOW, &old);
- if (i < 0)
- printf ("tcsetattr failed: %s\n", strerror (errno));
- printf ("*** End of Raw input VMIN=%d VTIME=%d ***\n", vmin, vtime);
-}
-
-/*
- * RTEMS Startup Task
- */
-rtems_task
-Init (rtems_task_argument ignored)
-{
- int i, j;
-
- printf( "\n\n*** HELLO WORLD TEST ***\n" );
- printf( "Hello World\n" );
- printf( "*** END OF HELLO WORLD TEST ***\n" );
-
- printf( "\n\ntype 'q' to exit raw input tests\n\n" );
-
- for (;;) {
- /*
- * Test blocking, line-oriented input
- */
- do {
- printf (">>> ");
- fflush (stdout);
- i = scanf (" %d", &j);
- printf ("Return: %d Value: %d\n", i, j);
- } while (i != 0);
-
- /*
- * Consume what scanf rejected
- */
- while ((i = getchar ()) != '\n')
- if (i == EOF)
- break;
-
- /*
- * Test character-oriented input
- */
- testRawInput (0, 0);
- testRawInput (0, 20);
- testRawInput (5, 0);
- testRawInput (5, 20);
- }
- exit (1);
-}
diff --git a/c/src/tests/mptests/Makefile.in b/c/src/tests/mptests/Makefile.in
deleted file mode 100644
index aa1c166788..0000000000
--- a/c/src/tests/mptests/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-all: README
-
-SUB_DIRS=mp01 mp02 mp03 mp04 mp05 mp06 mp07 mp08 mp09 mp10 mp11 mp12 mp13 mp14
diff --git a/c/src/tests/mptests/README b/c/src/tests/mptests/README
deleted file mode 100644
index 68cb459b55..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp01/Makefile.in b/c/src/tests/mptests/mp01/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/mptests/mp01/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/mptests/mp01/init.c b/c/src/tests/mptests/mp01/init.c
deleted file mode 100644
index 4234ba1473..0000000000
--- a/c/src/tests/mptests/mp01/init.c
+++ /dev/null
@@ -1,96 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/mptests/mp01/node1/Makefile.in b/c/src/tests/mptests/mp01/node1/Makefile.in
deleted file mode 100644
index 3573ffbdf3..0000000000
--- a/c/src/tests/mptests/mp01/node1/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-TEST=mp01
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp01/node1/mp01.doc b/c/src/tests/mptests/mp01/node1/mp01.doc
deleted file mode 100644
index f2c86a4433..0000000000
--- a/c/src/tests/mptests/mp01/node1/mp01.doc
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp01/node1/mp01.scn b/c/src/tests/mptests/mp01/node1/mp01.scn
deleted file mode 100644
index d399f79b2a..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp01/node2/Makefile.in b/c/src/tests/mptests/mp01/node2/Makefile.in
deleted file mode 100644
index 33a7c559ba..0000000000
--- a/c/src/tests/mptests/mp01/node2/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-TEST=mp01
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp01/node2/mp01.doc b/c/src/tests/mptests/mp01/node2/mp01.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/mptests/mp01/node2/mp01.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp01/node2/mp01.scn b/c/src/tests/mptests/mp01/node2/mp01.scn
deleted file mode 100644
index c9831ff9db..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp01/system.h b/c/src/tests/mptests/mp01/system.h
deleted file mode 100644
index 2abd7fabfa..0000000000
--- a/c/src/tests/mptests/mp01/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_GLOBAL
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/mptests/mp01/task1.c b/c/src/tests/mptests/mp01/task1.c
deleted file mode 100644
index 559ef3781a..0000000000
--- a/c/src/tests/mptests/mp01/task1.c
+++ /dev/null
@@ -1,84 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit(0);
- }
-}
diff --git a/c/src/tests/mptests/mp02/Makefile.in b/c/src/tests/mptests/mp02/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/mptests/mp02/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/mptests/mp02/init.c b/c/src/tests/mptests/mp02/init.c
deleted file mode 100644
index 17ceff147a..0000000000
--- a/c/src/tests/mptests/mp02/init.c
+++ /dev/null
@@ -1,60 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/mptests/mp02/node1/Makefile.in b/c/src/tests/mptests/mp02/node1/Makefile.in
deleted file mode 100644
index fa102f135e..0000000000
--- a/c/src/tests/mptests/mp02/node1/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-TEST=mp02
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp02/node1/mp02.doc b/c/src/tests/mptests/mp02/node1/mp02.doc
deleted file mode 100644
index 532dad1f43..0000000000
--- a/c/src/tests/mptests/mp02/node1/mp02.doc
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp02/node1/mp02.scn b/c/src/tests/mptests/mp02/node1/mp02.scn
deleted file mode 100644
index 72fdefe69d..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp02/node2/Makefile.in b/c/src/tests/mptests/mp02/node2/Makefile.in
deleted file mode 100644
index ed3c8218a3..0000000000
--- a/c/src/tests/mptests/mp02/node2/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-TEST=mp02
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp02/node2/mp02.doc b/c/src/tests/mptests/mp02/node2/mp02.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/mptests/mp02/node2/mp02.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp02/node2/mp02.scn b/c/src/tests/mptests/mp02/node2/mp02.scn
deleted file mode 100644
index 233a910999..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp02/system.h b/c/src/tests/mptests/mp02/system.h
deleted file mode 100644
index 01abf230f6..0000000000
--- a/c/src/tests/mptests/mp02/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/mptests/mp02/task1.c b/c/src/tests/mptests/mp02/task1.c
deleted file mode 100644
index 854dcae9bc..0000000000
--- a/c/src/tests/mptests/mp02/task1.c
+++ /dev/null
@@ -1,118 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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), &note );
- directive_failed( status, "rtems_task_get_note" );
-
- if ( note == rtems_get_node(tid) )
- puts( "Remote notepad set and read correctly" );
- else
- printf(
- "FAILURE!! Remote notepad was not set and read correctly (%d, %d)\n",
- note,
- rtems_get_node( tid )
- );
-
- status = rtems_task_wake_after( TICKS_PER_SECOND );
- directive_failed( status, "rtems_task_wake_after" );
-
- puts( "*** END OF TEST 2 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/mptests/mp03/Makefile.in b/c/src/tests/mptests/mp03/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/mptests/mp03/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/mptests/mp03/delay.c b/c/src/tests/mptests/mp03/delay.c
deleted file mode 100644
index 06c329a254..0000000000
--- a/c/src/tests/mptests/mp03/delay.c
+++ /dev/null
@@ -1,31 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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( status, "rtems_event_send" );
-}
diff --git a/c/src/tests/mptests/mp03/init.c b/c/src/tests/mptests/mp03/init.c
deleted file mode 100644
index 2b178c972e..0000000000
--- a/c/src/tests/mptests/mp03/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/mptests/mp03/node1/Makefile.in b/c/src/tests/mptests/mp03/node1/Makefile.in
deleted file mode 100644
index fb171d0d8a..0000000000
--- a/c/src/tests/mptests/mp03/node1/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-TEST=mp03
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp timer event
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 delay
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp03/node1/mp03.doc b/c/src/tests/mptests/mp03/node1/mp03.doc
deleted file mode 100644
index 6a1d5517f5..0000000000
--- a/c/src/tests/mptests/mp03/node1/mp03.doc
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp03/node1/mp03.scn b/c/src/tests/mptests/mp03/node1/mp03.scn
deleted file mode 100644
index 129e5bccba..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp03/node2/Makefile.in b/c/src/tests/mptests/mp03/node2/Makefile.in
deleted file mode 100644
index c88e09a297..0000000000
--- a/c/src/tests/mptests/mp03/node2/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-TEST=mp03
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp timer event
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init delay task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp03/node2/mp03.doc b/c/src/tests/mptests/mp03/node2/mp03.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/mptests/mp03/node2/mp03.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp03/node2/mp03.scn b/c/src/tests/mptests/mp03/node2/mp03.scn
deleted file mode 100644
index d77c09e9f7..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp03/system.h b/c/src/tests/mptests/mp03/system.h
deleted file mode 100644
index a6f517ae1a..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/mptests/mp03/task1.c b/c/src/tests/mptests/mp03/task1.c
deleted file mode 100644
index 47a921e7b3..0000000000
--- a/c/src/tests/mptests/mp03/task1.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* Test_task
- *
- * This task suspends and resumes a remote task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/mptests/mp04/Makefile.in b/c/src/tests/mptests/mp04/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/mptests/mp04/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/mptests/mp04/init.c b/c/src/tests/mptests/mp04/init.c
deleted file mode 100644
index 0523bede6b..0000000000
--- a/c/src/tests/mptests/mp04/init.c
+++ /dev/null
@@ -1,60 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/mptests/mp04/node1/Makefile.in b/c/src/tests/mptests/mp04/node1/Makefile.in
deleted file mode 100644
index 7bb1301ebc..0000000000
--- a/c/src/tests/mptests/mp04/node1/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-TEST=mp04
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp04/node1/mp04.doc b/c/src/tests/mptests/mp04/node1/mp04.doc
deleted file mode 100644
index 7165e7c841..0000000000
--- a/c/src/tests/mptests/mp04/node1/mp04.doc
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp04/node1/mp04.scn b/c/src/tests/mptests/mp04/node1/mp04.scn
deleted file mode 100644
index e9518f3ac2..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp04/node2/Makefile.in b/c/src/tests/mptests/mp04/node2/Makefile.in
deleted file mode 100644
index ca4efd0c26..0000000000
--- a/c/src/tests/mptests/mp04/node2/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-TEST=mp04
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp04/node2/mp04.doc b/c/src/tests/mptests/mp04/node2/mp04.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/mptests/mp04/node2/mp04.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp04/node2/mp04.scn b/c/src/tests/mptests/mp04/node2/mp04.scn
deleted file mode 100644
index 8ccfcfef79..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp04/system.h b/c/src/tests/mptests/mp04/system.h
deleted file mode 100644
index f432fd6216..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/mptests/mp04/task1.c b/c/src/tests/mptests/mp04/task1.c
deleted file mode 100644
index ffa0d1b9a5..0000000000
--- a/c/src/tests/mptests/mp04/task1.c
+++ /dev/null
@@ -1,83 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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
- );
- exit( 0xf0000 );
- }
-
- do {
- status = rtems_task_set_priority(
- RTEMS_SELF,
- RTEMS_CURRENT_PRIORITY,
- &previous_priority_1
- );
- directive_failed( status, "rtems_task_set_priority" );
- } while ( previous_priority_1 != remote_node );
-
- puts( "Local task priority has been set" );
-
- puts( "*** END OF TEST 4 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/mptests/mp05/Makefile.in b/c/src/tests/mptests/mp05/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/mptests/mp05/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/mptests/mp05/asr.c b/c/src/tests/mptests/mp05/asr.c
deleted file mode 100644
index d90c5b0056..0000000000
--- a/c/src/tests/mptests/mp05/asr.c
+++ /dev/null
@@ -1,37 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/mptests/mp05/init.c b/c/src/tests/mptests/mp05/init.c
deleted file mode 100644
index 56a420752a..0000000000
--- a/c/src/tests/mptests/mp05/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/mptests/mp05/node1/Makefile.in b/c/src/tests/mptests/mp05/node1/Makefile.in
deleted file mode 100644
index ff8fdcb7f7..0000000000
--- a/c/src/tests/mptests/mp05/node1/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-TEST=mp05
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp signal timer
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init asr task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp05/node1/mp05.doc b/c/src/tests/mptests/mp05/node1/mp05.doc
deleted file mode 100644
index 508e664600..0000000000
--- a/c/src/tests/mptests/mp05/node1/mp05.doc
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp05/node1/mp05.scn b/c/src/tests/mptests/mp05/node1/mp05.scn
deleted file mode 100644
index 472740ba18..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp05/node2/Makefile.in b/c/src/tests/mptests/mp05/node2/Makefile.in
deleted file mode 100644
index 81efd27b68..0000000000
--- a/c/src/tests/mptests/mp05/node2/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-TEST=mp05
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp signal timer
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init asr task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp05/node2/mp05.doc b/c/src/tests/mptests/mp05/node2/mp05.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/mptests/mp05/node2/mp05.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp05/node2/mp05.scn b/c/src/tests/mptests/mp05/node2/mp05.scn
deleted file mode 100644
index 0c4b412f65..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp05/system.h b/c/src/tests/mptests/mp05/system.h
deleted file mode 100644
index a3d66bf338..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/mptests/mp05/task1.c b/c/src/tests/mptests/mp05/task1.c
deleted file mode 100644
index dd97f261c6..0000000000
--- a/c/src/tests/mptests/mp05/task1.c
+++ /dev/null
@@ -1,106 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/mptests/mp06/Makefile.in b/c/src/tests/mptests/mp06/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/mptests/mp06/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/mptests/mp06/init.c b/c/src/tests/mptests/mp06/init.c
deleted file mode 100644
index 9e33f8f284..0000000000
--- a/c/src/tests/mptests/mp06/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/mptests/mp06/node1/Makefile.in b/c/src/tests/mptests/mp06/node1/Makefile.in
deleted file mode 100644
index 80628ebbb4..0000000000
--- a/c/src/tests/mptests/mp06/node1/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-TEST=mp06
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp event timer
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp06/node1/mp06.doc b/c/src/tests/mptests/mp06/node1/mp06.doc
deleted file mode 100644
index 086434fcb7..0000000000
--- a/c/src/tests/mptests/mp06/node1/mp06.doc
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp06/node1/mp06.scn b/c/src/tests/mptests/mp06/node1/mp06.scn
deleted file mode 100644
index 592777e5d7..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp06/node2/Makefile.in b/c/src/tests/mptests/mp06/node2/Makefile.in
deleted file mode 100644
index ed9908f70c..0000000000
--- a/c/src/tests/mptests/mp06/node2/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-TEST=mp06
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp event timer
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp06/node2/mp06.doc b/c/src/tests/mptests/mp06/node2/mp06.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/mptests/mp06/node2/mp06.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp06/node2/mp06.scn b/c/src/tests/mptests/mp06/node2/mp06.scn
deleted file mode 100644
index 9cb653c2f3..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp06/system.h b/c/src/tests/mptests/mp06/system.h
deleted file mode 100644
index fa86b90798..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/mptests/mp06/task1.c b/c/src/tests/mptests/mp06/task1.c
deleted file mode 100644
index 6ec9a24534..0000000000
--- a/c/src/tests/mptests/mp06/task1.c
+++ /dev/null
@@ -1,176 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/mptests/mp07/Makefile.in b/c/src/tests/mptests/mp07/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/mptests/mp07/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/mptests/mp07/init.c b/c/src/tests/mptests/mp07/init.c
deleted file mode 100644
index 658b2dc5cf..0000000000
--- a/c/src/tests/mptests/mp07/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/mptests/mp07/node1/Makefile.in b/c/src/tests/mptests/mp07/node1/Makefile.in
deleted file mode 100644
index 8344b15c0e..0000000000
--- a/c/src/tests/mptests/mp07/node1/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-TEST=mp07
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp event timer
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp07/node1/mp07.doc b/c/src/tests/mptests/mp07/node1/mp07.doc
deleted file mode 100644
index 196a33defc..0000000000
--- a/c/src/tests/mptests/mp07/node1/mp07.doc
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp07/node1/mp07.scn b/c/src/tests/mptests/mp07/node1/mp07.scn
deleted file mode 100644
index d348f48612..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp07/node2/Makefile.in b/c/src/tests/mptests/mp07/node2/Makefile.in
deleted file mode 100644
index de4f73678d..0000000000
--- a/c/src/tests/mptests/mp07/node2/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-TEST=mp07
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp event timer
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp07/node2/mp07.doc b/c/src/tests/mptests/mp07/node2/mp07.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/mptests/mp07/node2/mp07.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp07/node2/mp07.scn b/c/src/tests/mptests/mp07/node2/mp07.scn
deleted file mode 100644
index 9e361d713c..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp07/system.h b/c/src/tests/mptests/mp07/system.h
deleted file mode 100644
index fa86b90798..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/mptests/mp07/task1.c b/c/src/tests/mptests/mp07/task1.c
deleted file mode 100644
index 8434f9d6f9..0000000000
--- a/c/src/tests/mptests/mp07/task1.c
+++ /dev/null
@@ -1,103 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/mptests/mp08/Makefile.in b/c/src/tests/mptests/mp08/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/mptests/mp08/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/mptests/mp08/init.c b/c/src/tests/mptests/mp08/init.c
deleted file mode 100644
index 499bbf166c..0000000000
--- a/c/src/tests/mptests/mp08/init.c
+++ /dev/null
@@ -1,74 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/mptests/mp08/node1/Makefile.in b/c/src/tests/mptests/mp08/node1/Makefile.in
deleted file mode 100644
index b87baa7e1c..0000000000
--- a/c/src/tests/mptests/mp08/node1/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-TEST=mp08
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp08/node1/mp08.doc b/c/src/tests/mptests/mp08/node1/mp08.doc
deleted file mode 100644
index 93cef0a0d7..0000000000
--- a/c/src/tests/mptests/mp08/node1/mp08.doc
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp08/node1/mp08.scn b/c/src/tests/mptests/mp08/node1/mp08.scn
deleted file mode 100644
index cde263420c..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp08/node2/Makefile.in b/c/src/tests/mptests/mp08/node2/Makefile.in
deleted file mode 100644
index f5fc63b7d9..0000000000
--- a/c/src/tests/mptests/mp08/node2/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-TEST=mp08
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp08/node2/mp08.doc b/c/src/tests/mptests/mp08/node2/mp08.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/mptests/mp08/node2/mp08.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp08/node2/mp08.scn b/c/src/tests/mptests/mp08/node2/mp08.scn
deleted file mode 100644
index 5a613f45e5..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp08/system.h b/c/src/tests/mptests/mp08/system.h
deleted file mode 100644
index 939c78fd9b..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/mptests/mp08/task1.c b/c/src/tests/mptests/mp08/task1.c
deleted file mode 100644
index 3fc914ee35..0000000000
--- a/c/src/tests/mptests/mp08/task1.c
+++ /dev/null
@@ -1,89 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
- }
-
- if ( Multiprocessing_configuration.node == 1 && ++count == 1000 ) {
- status = rtems_task_wake_after( TICKS_PER_SECOND );
- directive_failed( status, "rtems_task_wake_after" );
-
- puts( "\nDeleting global semaphore" );
- status = rtems_semaphore_delete( Semaphore_id[ 1 ] );
- directive_failed( status, "rtems_semaphore_delete" );
-
- puts( "*** END OF TEST 8 ***" );
- exit( 0 );
- }
- else {
- put_dot( 'v' );
- status = rtems_semaphore_release( Semaphore_id[ 1 ] );
- directive_failed( status, "rtems_semaphore_release FAILED!!" );
- }
- }
-}
diff --git a/c/src/tests/mptests/mp09/Makefile.in b/c/src/tests/mptests/mp09/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/mptests/mp09/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/mptests/mp09/init.c b/c/src/tests/mptests/mp09/init.c
deleted file mode 100644
index 85af601bce..0000000000
--- a/c/src/tests/mptests/mp09/init.c
+++ /dev/null
@@ -1,74 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/mptests/mp09/node1/Makefile.in b/c/src/tests/mptests/mp09/node1/Makefile.in
deleted file mode 100644
index 917530d146..0000000000
--- a/c/src/tests/mptests/mp09/node1/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-TEST=mp09
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp message
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 recvmsg sendmsg
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp09/node1/mp09.doc b/c/src/tests/mptests/mp09/node1/mp09.doc
deleted file mode 100644
index 239298cf4e..0000000000
--- a/c/src/tests/mptests/mp09/node1/mp09.doc
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp09/node1/mp09.scn b/c/src/tests/mptests/mp09/node1/mp09.scn
deleted file mode 100644
index 74cf06904d..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp09/node2/Makefile.in b/c/src/tests/mptests/mp09/node2/Makefile.in
deleted file mode 100644
index ff9bba00dd..0000000000
--- a/c/src/tests/mptests/mp09/node2/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-TEST=mp09
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp message
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 recvmsg sendmsg
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp09/node2/mp09.doc b/c/src/tests/mptests/mp09/node2/mp09.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/mptests/mp09/node2/mp09.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp09/node2/mp09.scn b/c/src/tests/mptests/mp09/node2/mp09.scn
deleted file mode 100644
index 1bd17cecd9..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp09/recvmsg.c b/c/src/tests/mptests/mp09/recvmsg.c
deleted file mode 100644
index 2de46306a7..0000000000
--- a/c/src/tests/mptests/mp09/recvmsg.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Receive_messages
- *
- * This routine receives and prints three messages.
- * an error condition.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/mptests/mp09/sendmsg.c b/c/src/tests/mptests/mp09/sendmsg.c
deleted file mode 100644
index 0992d21ae5..0000000000
--- a/c/src/tests/mptests/mp09/sendmsg.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Send_messages
- *
- * This routine sends a series of three messages.
- * an error condition.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/mptests/mp09/system.h b/c/src/tests/mptests/mp09/system.h
deleted file mode 100644
index 1115045c3e..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/mptests/mp09/task1.c b/c/src/tests/mptests/mp09/task1.c
deleted file mode 100644
index ab16e8b4eb..0000000000
--- a/c/src/tests/mptests/mp09/task1.c
+++ /dev/null
@@ -1,109 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/mptests/mp10/Makefile.in b/c/src/tests/mptests/mp10/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/mptests/mp10/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/mptests/mp10/init.c b/c/src/tests/mptests/mp10/init.c
deleted file mode 100644
index d5ab43d908..0000000000
--- a/c/src/tests/mptests/mp10/init.c
+++ /dev/null
@@ -1,143 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/mptests/mp10/node1/Makefile.in b/c/src/tests/mptests/mp10/node1/Makefile.in
deleted file mode 100644
index c1d24ea13a..0000000000
--- a/c/src/tests/mptests/mp10/node1/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-TEST=mp10
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp message semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2 task3
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp10/node1/mp10.doc b/c/src/tests/mptests/mp10/node1/mp10.doc
deleted file mode 100644
index fd264018d3..0000000000
--- a/c/src/tests/mptests/mp10/node1/mp10.doc
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp10/node1/mp10.scn b/c/src/tests/mptests/mp10/node1/mp10.scn
deleted file mode 100644
index deeafc0a9a..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp10/node2/Makefile.in b/c/src/tests/mptests/mp10/node2/Makefile.in
deleted file mode 100644
index bb8f49d980..0000000000
--- a/c/src/tests/mptests/mp10/node2/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-TEST=mp10
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp message semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2 task3
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp10/node2/mp10.doc b/c/src/tests/mptests/mp10/node2/mp10.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/mptests/mp10/node2/mp10.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp10/node2/mp10.scn b/c/src/tests/mptests/mp10/node2/mp10.scn
deleted file mode 100644
index 25c07e6202..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp10/system.h b/c/src/tests/mptests/mp10/system.h
deleted file mode 100644
index 669eff75ac..0000000000
--- a/c/src/tests/mptests/mp10/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.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#if ( NODE_NUMBER == 1 )
-#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#endif
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/mptests/mp10/task1.c b/c/src/tests/mptests/mp10/task1.c
deleted file mode 100644
index df7a8e9e03..0000000000
--- a/c/src/tests/mptests/mp10/task1.c
+++ /dev/null
@@ -1,52 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/mptests/mp10/task2.c b/c/src/tests/mptests/mp10/task2.c
deleted file mode 100644
index 86e944fb2f..0000000000
--- a/c/src/tests/mptests/mp10/task2.c
+++ /dev/null
@@ -1,47 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/mptests/mp10/task3.c b/c/src/tests/mptests/mp10/task3.c
deleted file mode 100644
index fe91319879..0000000000
--- a/c/src/tests/mptests/mp10/task3.c
+++ /dev/null
@@ -1,50 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/mptests/mp11/Makefile.in b/c/src/tests/mptests/mp11/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/mptests/mp11/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/mptests/mp11/init.c b/c/src/tests/mptests/mp11/init.c
deleted file mode 100644
index 7d74289ee4..0000000000
--- a/c/src/tests/mptests/mp11/init.c
+++ /dev/null
@@ -1,105 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/mptests/mp11/node1/Makefile.in b/c/src/tests/mptests/mp11/node1/Makefile.in
deleted file mode 100644
index ea6c2a2a81..0000000000
--- a/c/src/tests/mptests/mp11/node1/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-TEST=mp11
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp message partition semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp11/node1/mp11.doc b/c/src/tests/mptests/mp11/node1/mp11.doc
deleted file mode 100644
index bc525ffa30..0000000000
--- a/c/src/tests/mptests/mp11/node1/mp11.doc
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp11/node1/mp11.scn b/c/src/tests/mptests/mp11/node1/mp11.scn
deleted file mode 100644
index fb26583852..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp11/node2/Makefile.in b/c/src/tests/mptests/mp11/node2/Makefile.in
deleted file mode 100644
index 0073e6f1d9..0000000000
--- a/c/src/tests/mptests/mp11/node2/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-TEST=mp11
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp message partition semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp11/node2/mp11.doc b/c/src/tests/mptests/mp11/node2/mp11.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/mptests/mp11/node2/mp11.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp11/node2/mp11.scn b/c/src/tests/mptests/mp11/node2/mp11.scn
deleted file mode 100644
index 49bd8a3219..0000000000
--- a/c/src/tests/mptests/mp11/node2/mp11.scn
+++ /dev/null
@@ -1,2 +0,0 @@
-*** TEST 11 -- NODE 2 ***
-*** END OF TEST 11 ***
diff --git a/c/src/tests/mptests/mp11/system.h b/c/src/tests/mptests/mp11/system.h
deleted file mode 100644
index a7b1a2e5d8..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 0
-#define CONFIGURE_MP_MAXIMUM_PROXIES 0
-
-#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 <confdefs.h>
-
-/* 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/c/src/tests/mptests/mp12/Makefile.in b/c/src/tests/mptests/mp12/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/mptests/mp12/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/mptests/mp12/init.c b/c/src/tests/mptests/mp12/init.c
deleted file mode 100644
index b0e54bc8d9..0000000000
--- a/c/src/tests/mptests/mp12/init.c
+++ /dev/null
@@ -1,113 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/mptests/mp12/node1/Makefile.in b/c/src/tests/mptests/mp12/node1/Makefile.in
deleted file mode 100644
index 717cb67576..0000000000
--- a/c/src/tests/mptests/mp12/node1/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-TEST=mp12
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp partition
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp12/node1/mp12.doc b/c/src/tests/mptests/mp12/node1/mp12.doc
deleted file mode 100644
index 3ce94b73eb..0000000000
--- a/c/src/tests/mptests/mp12/node1/mp12.doc
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp12/node1/mp12.scn b/c/src/tests/mptests/mp12/node1/mp12.scn
deleted file mode 100644
index 605a2c11db..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp12/node2/Makefile.in b/c/src/tests/mptests/mp12/node2/Makefile.in
deleted file mode 100644
index 3d5865c98f..0000000000
--- a/c/src/tests/mptests/mp12/node2/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-TEST=mp12
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp partition
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp12/node2/mp12.doc b/c/src/tests/mptests/mp12/node2/mp12.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/mptests/mp12/node2/mp12.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp12/node2/mp12.scn b/c/src/tests/mptests/mp12/node2/mp12.scn
deleted file mode 100644
index ad65e9cb32..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp12/system.h b/c/src/tests/mptests/mp12/system.h
deleted file mode 100644
index 6469a7f12c..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-#define PT_NAME rtems_build_name( 'P', 'A', 'R', '\0' )
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 1
-#define CONFIGURE_MP_MAXIMUM_PROXIES 0
-
-#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 <confdefs.h>
-
-/* 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/c/src/tests/mptests/mp13/Makefile.in b/c/src/tests/mptests/mp13/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/mptests/mp13/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/mptests/mp13/init.c b/c/src/tests/mptests/mp13/init.c
deleted file mode 100644
index e33048ffcb..0000000000
--- a/c/src/tests/mptests/mp13/init.c
+++ /dev/null
@@ -1,115 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
- }
- puts( "Deleting initialization task" );
- status = rtems_task_delete( RTEMS_SELF );
- directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
-}
diff --git a/c/src/tests/mptests/mp13/node1/Makefile.in b/c/src/tests/mptests/mp13/node1/Makefile.in
deleted file mode 100644
index 6cf55facc8..0000000000
--- a/c/src/tests/mptests/mp13/node1/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-TEST=mp13
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp message semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp13/node1/mp13.doc b/c/src/tests/mptests/mp13/node1/mp13.doc
deleted file mode 100644
index 13b100e7fa..0000000000
--- a/c/src/tests/mptests/mp13/node1/mp13.doc
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp13/node1/mp13.scn b/c/src/tests/mptests/mp13/node1/mp13.scn
deleted file mode 100644
index d3bd11f65e..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp13/node2/Makefile.in b/c/src/tests/mptests/mp13/node2/Makefile.in
deleted file mode 100644
index fa5b35cb79..0000000000
--- a/c/src/tests/mptests/mp13/node2/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-TEST=mp13
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp message semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp13/node2/mp13.doc b/c/src/tests/mptests/mp13/node2/mp13.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/mptests/mp13/node2/mp13.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp13/node2/mp13.scn b/c/src/tests/mptests/mp13/node2/mp13.scn
deleted file mode 100644
index e9df202a94..0000000000
--- a/c/src/tests/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/c/src/tests/mptests/mp13/system.h b/c/src/tests/mptests/mp13/system.h
deleted file mode 100644
index 81c96b4f54..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#if ( NODE_NUMBER == 1 )
-#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#endif
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/mptests/mp13/task1.c b/c/src/tests/mptests/mp13/task1.c
deleted file mode 100644
index 5b6d3a9f89..0000000000
--- a/c/src/tests/mptests/mp13/task1.c
+++ /dev/null
@@ -1,73 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/mptests/mp13/task2.c b/c/src/tests/mptests/mp13/task2.c
deleted file mode 100644
index ab1f165788..0000000000
--- a/c/src/tests/mptests/mp13/task2.c
+++ /dev/null
@@ -1,106 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/mptests/mp14/Makefile.in b/c/src/tests/mptests/mp14/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/mptests/mp14/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/mptests/mp14/delay.c b/c/src/tests/mptests/mp14/delay.c
deleted file mode 100644
index 8c2d177ddf..0000000000
--- a/c/src/tests/mptests/mp14/delay.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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
- );
- directive_failed( status, "rtems_event_send" );
-}
diff --git a/c/src/tests/mptests/mp14/evtask1.c b/c/src/tests/mptests/mp14/evtask1.c
deleted file mode 100644
index 742aee2613..0000000000
--- a/c/src/tests/mptests/mp14/evtask1.c
+++ /dev/null
@@ -1,87 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/mptests/mp14/evtmtask.c b/c/src/tests/mptests/mp14/evtmtask.c
deleted file mode 100644
index 165274dc21..0000000000
--- a/c/src/tests/mptests/mp14/evtmtask.c
+++ /dev/null
@@ -1,65 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/mptests/mp14/exit.c b/c/src/tests/mptests/mp14/exit.c
deleted file mode 100644
index 6e944c2a18..0000000000
--- a/c/src/tests/mptests/mp14/exit.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Exit_test
- *
- * This routine safely stops the test and prints some information
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/mptests/mp14/init.c b/c/src/tests/mptests/mp14/init.c
deleted file mode 100644
index 6dace461aa..0000000000
--- a/c/src/tests/mptests/mp14/init.c
+++ /dev/null
@@ -1,191 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/mptests/mp14/msgtask1.c b/c/src/tests/mptests/mp14/msgtask1.c
deleted file mode 100644
index 0d698d58ef..0000000000
--- a/c/src/tests/mptests/mp14/msgtask1.c
+++ /dev/null
@@ -1,107 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/mptests/mp14/node1/Makefile.in b/c/src/tests/mptests/mp14/node1/Makefile.in
deleted file mode 100644
index 4129e7d526..0000000000
--- a/c/src/tests/mptests/mp14/node1/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-TEST=mp14
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp event partition semaphore timer message
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=exit init delay evtask1 evtmtask pttask1 smtask1 msgtask1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp14/node1/mp14.doc b/c/src/tests/mptests/mp14/node1/mp14.doc
deleted file mode 100644
index 6fbbe4b2cd..0000000000
--- a/c/src/tests/mptests/mp14/node1/mp14.doc
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp14/node1/mp14.scn b/c/src/tests/mptests/mp14/node1/mp14.scn
deleted file mode 100644
index f57c4f47b3..0000000000
--- a/c/src/tests/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
-<stream of following characters>
-
-. - indicates 100 iterations of
- tm_evafter of 1 tick and rtems_event_receive.
-
-e - indicates that 100
- events have been sent to the remote task.
-
-m - indicates 100 iterations of
- rtems_message_queue_send and rtems_message_queue_receive.
-
-p - indicates 100 iterations of
- rtems_partition_get_buffer and rtems_partition_return_buffer.
-
-s - indicates 100 iterations of
- rtems_semaphore_obtain and rtems_semaphore_release.
-
-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/c/src/tests/mptests/mp14/node2/Makefile.in b/c/src/tests/mptests/mp14/node2/Makefile.in
deleted file mode 100644
index 6ebe8cba4b..0000000000
--- a/c/src/tests/mptests/mp14/node2/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-TEST=mp14
-PGM=${ARCH}/$(TEST)-node$(NODE).exe
-
-MANAGERS=io mp event partition semaphore timer message
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=exit init delay evtask1 evtmtask pttask1 smtask1 msgtask1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/mptests/node$(NODE)/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/mptests/mp14/node2/mp14.doc b/c/src/tests/mptests/mp14/node2/mp14.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/mptests/mp14/node2/mp14.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/mptests/mp14/node2/mp14.scn b/c/src/tests/mptests/mp14/node2/mp14.scn
deleted file mode 100644
index d128c870e9..0000000000
--- a/c/src/tests/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
-<stream of following characters>
-
-. - indicates 100 iterations of
- tm_evafter of 1 tick and rtems_event_receive.
-
-e - indicates that 100
- events have been sent to the remote task.
-
-m - indicates 100 iterations of
- rtems_message_queue_send and rtems_message_queue_receive.
-
-p - indicates 100 iterations of
- rtems_partition_get_buffer and rtems_partition_return_buffer.
-
-s - indicates 100 iterations of
- rtems_semaphore_obtain and rtems_semaphore_release.
-
-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/c/src/tests/mptests/mp14/pttask1.c b/c/src/tests/mptests/mp14/pttask1.c
deleted file mode 100644
index f8933db339..0000000000
--- a/c/src/tests/mptests/mp14/pttask1.c
+++ /dev/null
@@ -1,71 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/mptests/mp14/smtask1.c b/c/src/tests/mptests/mp14/smtask1.c
deleted file mode 100644
index eeeb111352..0000000000
--- a/c/src/tests/mptests/mp14/smtask1.c
+++ /dev/null
@@ -1,73 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/mptests/mp14/system.h b/c/src/tests/mptests/mp14/system.h
deleted file mode 100644
index 1bbc8ca1e9..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_TICKS_PER_TIMESLICE 1
-#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(1)
-
-#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 <confdefs.h>
-
-/* 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/c/src/tests/psxtests/Makefile.in b/c/src/tests/psxtests/Makefile.in
deleted file mode 100644
index 87c597ebbd..0000000000
--- a/c/src/tests/psxtests/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=support psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 psx08 \
- psx09 psx10 psx11 psx12
-
diff --git a/c/src/tests/psxtests/include/pmacros.h b/c/src/tests/psxtests/include/pmacros.h
deleted file mode 100644
index 1f15dac9c0..0000000000
--- a/c/src/tests/psxtests/include/pmacros.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef __POSIX_TEST_MACROS_h
-#define __POSIX_TEST_MACROS_h
-
-#include <bsp.h>
-#include <pthread.h>
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-
-/*
- * 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
-
-#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; }
-
-#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 _buffer[32]; \
- int _status; \
- struct timespec _tv; \
- \
- _status = clock_gettime( CLOCK_REALTIME, &_tv ); \
- assert( !_status ); \
- \
- (void) ctime_r( &_tv.tv_sec, _buffer ); \
- _buffer[ strlen( _buffer ) - 1 ] = 0; \
- printf( "%s%s%s\n", s1, _buffer, s2 ); \
- fflush(stdout); \
- } while ( 0 )
-
-#define empty_line() puts( "" )
-
-#endif
-
-/* end of file */
diff --git a/c/src/tests/psxtests/psx01/Makefile.in b/c/src/tests/psxtests/psx01/Makefile.in
deleted file mode 100644
index e6508310f7..0000000000
--- a/c/src/tests/psxtests/psx01/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=psx01
-
-MANAGERS=all
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/psxtests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/psxtests/psx01/init.c b/c/src/tests/psxtests/psx01/init.c
deleted file mode 100644
index a2101a5f16..0000000000
--- a/c/src/tests/psxtests/psx01/init.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <sched.h>
-
-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;
-
- puts( "\n\n*** POSIX TEST 1 ***" );
-
- build_time( &tm, TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
-
- /* 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/c/src/tests/psxtests/psx01/psx01.scn b/c/src/tests/psxtests/psx01/psx01.scn
deleted file mode 100644
index 8f563dd26c..0000000000
--- a/c/src/tests/psxtests/psx01/psx01.scn
+++ /dev/null
@@ -1,46 +0,0 @@
-*** POSIX TEST 1 ***
-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 (100), nsec (0)
-
-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 - EAGAIN (negative seconds)
-Init: nanosleep - EINVAL (too many nanoseconds)
-Init: nanosleep - yield
-Init: nanosleep - 3.05 seconds
-Fri May 24 11:05:06 1996
-Init: sec (0), nsec (0) remaining
-Init: ID is 0x0c010001
-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 0x0c010002
-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/c/src/tests/psxtests/psx01/system.h b/c/src/tests/psxtests/psx01/system.h
deleted file mode 100644
index 9ff369cc01..0000000000
--- a/c/src/tests/psxtests/psx01/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sched.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1_through_3(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/psxtests/psx01/task.c b/c/src/tests/psxtests/psx01/task.c
deleted file mode 100644
index d6733a8a82..0000000000
--- a/c/src/tests/psxtests/psx01/task.c
+++ /dev/null
@@ -1,94 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx02/Makefile.in b/c/src/tests/psxtests/psx02/Makefile.in
deleted file mode 100644
index 4f8d77c334..0000000000
--- a/c/src/tests/psxtests/psx02/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=psx02
-
-MANAGERS=all
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/psxtests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/psxtests/psx02/init.c b/c/src/tests/psxtests/psx02/init.c
deleted file mode 100644
index 27a0778583..0000000000
--- a/c/src/tests/psxtests/psx02/init.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <signal.h>
-
-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 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx02/psx02.scn b/c/src/tests/psxtests/psx02/psx02.scn
deleted file mode 100644
index 3b0d373b16..0000000000
--- a/c/src/tests/psxtests/psx02/psx02.scn
+++ /dev/null
@@ -1,26 +0,0 @@
-*** POSIX TEST 2 ***
-Init's ID is 0x0c010001
-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/c/src/tests/psxtests/psx02/system.h b/c/src/tests/psxtests/psx02/system.h
deleted file mode 100644
index 862e5c80f1..0000000000
--- a/c/src/tests/psxtests/psx02/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-#include <errno.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1_through_3(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/psxtests/psx02/task.c b/c/src/tests/psxtests/psx02/task.c
deleted file mode 100644
index ce8f4b0a4d..0000000000
--- a/c/src/tests/psxtests/psx02/task.c
+++ /dev/null
@@ -1,45 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <signal.h>
-
-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 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx03/Makefile.in b/c/src/tests/psxtests/psx03/Makefile.in
deleted file mode 100644
index c3d0ef7fba..0000000000
--- a/c/src/tests/psxtests/psx03/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=psx03
-
-MANAGERS=all
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/psxtests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/psxtests/psx03/init.c b/c/src/tests/psxtests/psx03/init.c
deleted file mode 100644
index 4ccd89e3cc..0000000000
--- a/c/src/tests/psxtests/psx03/init.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <signal.h>
-#include <errno.h>
-
-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 */
-
- /* exit this thread */
-
- puts( "*** END OF POSIX TEST 3 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx03/psx03.scn b/c/src/tests/psxtests/psx03/psx03.scn
deleted file mode 100644
index 61ba36592a..0000000000
--- a/c/src/tests/psxtests/psx03/psx03.scn
+++ /dev/null
@@ -1,17 +0,0 @@
-*** POSIX TEST 3 ***
-Init's ID is 0x0c010001
-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
-*** END OF POSIX TEST 3 ***
diff --git a/c/src/tests/psxtests/psx03/system.h b/c/src/tests/psxtests/psx03/system.h
deleted file mode 100644
index a17b36812d..0000000000
--- a/c/src/tests/psxtests/psx03/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-void *Task_2(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/psxtests/psx03/task.c b/c/src/tests/psxtests/psx03/task.c
deleted file mode 100644
index be9b1ae96c..0000000000
--- a/c/src/tests/psxtests/psx03/task.c
+++ /dev/null
@@ -1,65 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <signal.h>
-
-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/c/src/tests/psxtests/psx04/Makefile.in b/c/src/tests/psxtests/psx04/Makefile.in
deleted file mode 100644
index 92aff63d8a..0000000000
--- a/c/src/tests/psxtests/psx04/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=psx04
-
-MANAGERS=all
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2 task3
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/psxtests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/psxtests/psx04/init.c b/c/src/tests/psxtests/psx04/init.c
deleted file mode 100644
index a1dfbd5ac5..0000000000
--- a/c/src/tests/psxtests/psx04/init.c
+++ /dev/null
@@ -1,564 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <signal.h>
-#include <errno.h>
-
-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, SIGUSR1 );
- if ( status != -1 )
- printf( "status = %d\n", status );
- assert( errno == ENOSYS );
- puts( "Init: pthread_kill - ENOSYS (signal SA_SIGINFO)" );
-
- 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 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx04/psx04.scn b/c/src/tests/psxtests/psx04/psx04.scn
deleted file mode 100644
index 83237ec768..0000000000
--- a/c/src/tests/psxtests/psx04/psx04.scn
+++ /dev/null
@@ -1,112 +0,0 @@
-*** POSIX TEST 4 ***
-Init's ID is 0x0c010001
-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
-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 - ENOSYS (signal SA_SIGINFO)
-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/c/src/tests/psxtests/psx04/system.h b/c/src/tests/psxtests/psx04/system.h
deleted file mode 100644
index 7128f0f807..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-void *Task_2(
- void *argument
-);
-
-void *Task_3(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 5
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/psxtests/psx04/task1.c b/c/src/tests/psxtests/psx04/task1.c
deleted file mode 100644
index 0f628b95d9..0000000000
--- a/c/src/tests/psxtests/psx04/task1.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Task_1
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <signal.h>
-
-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/c/src/tests/psxtests/psx04/task2.c b/c/src/tests/psxtests/psx04/task2.c
deleted file mode 100644
index fa19e36be9..0000000000
--- a/c/src/tests/psxtests/psx04/task2.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Task_2
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <signal.h>
-
-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/c/src/tests/psxtests/psx04/task3.c b/c/src/tests/psxtests/psx04/task3.c
deleted file mode 100644
index 0c169c099f..0000000000
--- a/c/src/tests/psxtests/psx04/task3.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/* Task_3
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <signal.h>
-
-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/c/src/tests/psxtests/psx05/Makefile.in b/c/src/tests/psxtests/psx05/Makefile.in
deleted file mode 100644
index af3157e227..0000000000
--- a/c/src/tests/psxtests/psx05/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=psx05
-
-MANAGERS=all
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task task2 task3
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/psxtests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/psxtests/psx05/init.c b/c/src/tests/psxtests/psx05/init.c
deleted file mode 100644
index 08b059310f..0000000000
--- a/c/src/tests/psxtests/psx05/init.c
+++ /dev/null
@@ -1,569 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <errno.h>
-
-#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 );
-
- puts( "Init: pthread_mutex_init - SUCCESSFUL" );
- status = pthread_mutex_init( &Mutex_id, &attr );
- if ( status )
- printf( "status = %d\n", status );
- assert( !status );
-
- puts( "Init: pthread_mutex_init - EBUSY (attempt to initialize an existing mutex)" );
- status = pthread_mutex_init( &Mutex_id, &attr );
- if ( !status )
- printf( "status = %d\n", status );
- assert( status == EBUSY );
-
- 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, &times );
- 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, &param );
- assert( !status );
-
- /* switching to Task2 */
-
- status = pthread_getschedparam( pthread_self(), &policy, &param );
- 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, &param );
- 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, &param );
- 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, &param );
- 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, &param );
- 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 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx05/psx05.scn b/c/src/tests/psxtests/psx05/psx05.scn
deleted file mode 100644
index 6e4bc7320d..0000000000
--- a/c/src/tests/psxtests/psx05/psx05.scn
+++ /dev/null
@@ -1,111 +0,0 @@
-*** POSIX TEST 5 ***
-Init's ID is 0x0c010001
-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 (attempt to initialize an existing mutex)
-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 = 1
-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/c/src/tests/psxtests/psx05/system.h b/c/src/tests/psxtests/psx05/system.h
deleted file mode 100644
index 271c7559f8..0000000000
--- a/c/src/tests/psxtests/psx05/system.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-void *Task_2(
- void *argument
-);
-
-void *Task_3(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/psxtests/psx05/task.c b/c/src/tests/psxtests/psx05/task.c
deleted file mode 100644
index 705d288ebe..0000000000
--- a/c/src/tests/psxtests/psx05/task.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <errno.h>
-
-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/c/src/tests/psxtests/psx05/task2.c b/c/src/tests/psxtests/psx05/task2.c
deleted file mode 100644
index 4b6a3e38c7..0000000000
--- a/c/src/tests/psxtests/psx05/task2.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Task_2
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <errno.h>
-
-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/c/src/tests/psxtests/psx05/task3.c b/c/src/tests/psxtests/psx05/task3.c
deleted file mode 100644
index 5b869ff96f..0000000000
--- a/c/src/tests/psxtests/psx05/task3.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Task_3
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <errno.h>
-
-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, &param );
- 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/c/src/tests/psxtests/psx06/Makefile.in b/c/src/tests/psxtests/psx06/Makefile.in
deleted file mode 100644
index 578fbeffd7..0000000000
--- a/c/src/tests/psxtests/psx06/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=psx06
-
-MANAGERS=all
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task task2
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/psxtests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/psxtests/psx06/init.c b/c/src/tests/psxtests/psx06/init.c
deleted file mode 100644
index 913ae2c1f3..0000000000
--- a/c/src/tests/psxtests/psx06/init.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <errno.h>
-
-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 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx06/psx06.scn b/c/src/tests/psxtests/psx06/psx06.scn
deleted file mode 100644
index a17fa043ee..0000000000
--- a/c/src/tests/psxtests/psx06/psx06.scn
+++ /dev/null
@@ -1,21 +0,0 @@
-*** POSIX TEST 6 ***
-Init's ID is 0x0c010001
-
-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/c/src/tests/psxtests/psx06/system.h b/c/src/tests/psxtests/psx06/system.h
deleted file mode 100644
index c6945ef23a..0000000000
--- a/c/src/tests/psxtests/psx06/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-void *Task_2(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 1
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/psxtests/psx06/task.c b/c/src/tests/psxtests/psx06/task.c
deleted file mode 100644
index 0918033b8d..0000000000
--- a/c/src/tests/psxtests/psx06/task.c
+++ /dev/null
@@ -1,51 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <errno.h>
-
-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/c/src/tests/psxtests/psx06/task2.c b/c/src/tests/psxtests/psx06/task2.c
deleted file mode 100644
index ef70e0f0f9..0000000000
--- a/c/src/tests/psxtests/psx06/task2.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Task_2
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <errno.h>
-
-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/c/src/tests/psxtests/psx07/Makefile.in b/c/src/tests/psxtests/psx07/Makefile.in
deleted file mode 100644
index 10f3b00851..0000000000
--- a/c/src/tests/psxtests/psx07/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=psx07
-
-MANAGERS=all
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/psxtests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/psxtests/psx07/init.c b/c/src/tests/psxtests/psx07/init.c
deleted file mode 100644
index f4da65213a..0000000000
--- a/c/src/tests/psxtests/psx07/init.c
+++ /dev/null
@@ -1,495 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <errno.h>
-
-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
-}
-
-extern rtems_configuration_table BSP_Configuration;
-
-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 = BSP_Configuration.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 );
- printf( "Init: current stack size attribute = %ld\n", (long) stacksize );
-
- /* 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 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx07/psx07.scn b/c/src/tests/psxtests/psx07/psx07.scn
deleted file mode 100644
index 33f5c68f6a..0000000000
--- a/c/src/tests/psxtests/psx07/psx07.scn
+++ /dev/null
@@ -1,105 +0,0 @@
-*** POSIX TEST 7 ***
-Init's ID is 0x0c010001
-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 = 5120
-
-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/c/src/tests/psxtests/psx07/system.h b/c/src/tests/psxtests/psx07/system.h
deleted file mode 100644
index a402b65128..0000000000
--- a/c/src/tests/psxtests/psx07/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/psxtests/psx07/task.c b/c/src/tests/psxtests/psx07/task.c
deleted file mode 100644
index a477e4ee88..0000000000
--- a/c/src/tests/psxtests/psx07/task.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <time.h>
-#include <sched.h>
-
-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/c/src/tests/psxtests/psx08/Makefile.in b/c/src/tests/psxtests/psx08/Makefile.in
deleted file mode 100644
index 3eba288f92..0000000000
--- a/c/src/tests/psxtests/psx08/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=psx08
-
-MANAGERS=all
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task task2
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/psxtests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/psxtests/psx08/init.c b/c/src/tests/psxtests/psx08/init.c
deleted file mode 100644
index f1ec5a6b09..0000000000
--- a/c/src/tests/psxtests/psx08/init.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <errno.h>
-
-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 */
-
- puts( "Init: creating two tasks" );
- status = pthread_create( &Task_id, NULL, Task_1, NULL );
- assert( !status );
-
- status = pthread_create( &Task2_id, NULL, Task_2, 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( Task_id, &return_pointer );
- /* assert is below comment */
-
- /* switch to Task 1 */
-
- puts( "Init: returned from pthread_join" );
- if ( status )
- printf( "status = %d\n", status );
- assert( !status );
-
- if ( return_pointer == &Task_id )
- puts( "Init: pthread_join returned correct pointer" );
- else
- printf(
- "Init: pthread_join returned incorrect pointer (%p != %p)\n",
- return_pointer,
- &Task_id
- );
-
- puts( "Init: exitting" );
- pthread_exit( NULL );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx08/psx08.scn b/c/src/tests/psxtests/psx08/psx08.scn
deleted file mode 100644
index 34c1934f59..0000000000
--- a/c/src/tests/psxtests/psx08/psx08.scn
+++ /dev/null
@@ -1,18 +0,0 @@
-*** POSIX TEST 8 ***
-Init's ID is 0x0c010001
-Init: pthread_detach - ESRCH (invalid id)
-Init: pthread_detach self
-Init: creating two tasks
-Init: pthread_join - ESRCH (invalid id)
-Init: pthread_join - SUCCESSFUL
-Task_1: sleep 1 second
-Task_2: join to Task_1
-Task_1: join to detached task (Init) -- EINVAL
-Task_1: join to self task (Init) -- EDEADLK
-Task_1: exitting
-Init: returned from pthread_join
-Init: pthread_join returned correct pointer
-Init: exitting
-Task_2: returned from pthread_join
-Task_2: pthread_join returned correct pointer
-*** END OF POSIX TEST 8 ***
diff --git a/c/src/tests/psxtests/psx08/system.h b/c/src/tests/psxtests/psx08/system.h
deleted file mode 100644
index 18c0c49f35..0000000000
--- a/c/src/tests/psxtests/psx08/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-void *Task_2(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#include <confdefs.h>
-
-/* 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;
-
-/* end of include file */
diff --git a/c/src/tests/psxtests/psx08/task.c b/c/src/tests/psxtests/psx08/task.c
deleted file mode 100644
index 555b0efeb5..0000000000
--- a/c/src/tests/psxtests/psx08/task.c
+++ /dev/null
@@ -1,56 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <errno.h>
-
-void *Task_1(
- void *argument
-)
-{
- int status;
-
- puts( "Task_1: sleep 1 second" );
-
- sleep( 1 );
-
- /* switch to task 2 */
-
- puts( "Task_1: 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_1: 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_1: exitting" );
-
- pthread_exit( &Task_id );
-
- /* switch to init task */
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx08/task2.c b/c/src/tests/psxtests/psx08/task2.c
deleted file mode 100644
index 028df4cb91..0000000000
--- a/c/src/tests/psxtests/psx08/task2.c
+++ /dev/null
@@ -1,52 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <errno.h>
-
-void *Task_2(
- void *argument
-)
-{
- int status;
- void *return_pointer;
-
- puts( "Task_2: join to Task_1" );
- status = pthread_join( Task_id, &return_pointer );
- puts( "Task_2: returned from pthread_join" );
- if ( status )
- printf( "status = %d\n", status );
- assert( !status );
-
- if ( return_pointer == &Task_id )
- puts( "Task_2: pthread_join returned correct pointer" );
- else
- printf(
- "Task_2: pthread_join returned incorrect pointer (%p != %p)\n",
- return_pointer,
- &Task_id
- );
-
- puts( "*** END OF POSIX TEST 8 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx09/Makefile.in b/c/src/tests/psxtests/psx09/Makefile.in
deleted file mode 100644
index 09eadef72d..0000000000
--- a/c/src/tests/psxtests/psx09/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=psx09
-
-MANAGERS=all
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/psxtests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/psxtests/psx09/init.c b/c/src/tests/psxtests/psx09/init.c
deleted file mode 100644
index b4856583cf..0000000000
--- a/c/src/tests/psxtests/psx09/init.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <errno.h>
-
-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 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx09/psx09.scn b/c/src/tests/psxtests/psx09/psx09.scn
deleted file mode 100644
index afc609c456..0000000000
--- a/c/src/tests/psxtests/psx09/psx09.scn
+++ /dev/null
@@ -1,23 +0,0 @@
-*** POSIX TEST 9 ***
-Init's ID is 0x0c010001
-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/c/src/tests/psxtests/psx09/system.h b/c/src/tests/psxtests/psx09/system.h
deleted file mode 100644
index 48197e1589..0000000000
--- a/c/src/tests/psxtests/psx09/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-void *Task_2(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 10
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/psxtests/psx10/Makefile.in b/c/src/tests/psxtests/psx10/Makefile.in
deleted file mode 100644
index a65b61bbd8..0000000000
--- a/c/src/tests/psxtests/psx10/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=psx10
-
-MANAGERS=all
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task task2 task3
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/psxtests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/psxtests/psx10/init.c b/c/src/tests/psxtests/psx10/init.c
deleted file mode 100644
index 940cfaa27e..0000000000
--- a/c/src/tests/psxtests/psx10/init.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <sched.h>
-
-
-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 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx10/psx10.scn b/c/src/tests/psxtests/psx10/psx10.scn
deleted file mode 100644
index a26432ac6e..0000000000
--- a/c/src/tests/psxtests/psx10/psx10.scn
+++ /dev/null
@@ -1,59 +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 0x0c010002
-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 0x0c010003
-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 0x0c010004
-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/c/src/tests/psxtests/psx10/system.h b/c/src/tests/psxtests/psx10/system.h
deleted file mode 100644
index 9bbdac0f25..0000000000
--- a/c/src/tests/psxtests/psx10/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-#include <unistd.h>
-#include <errno.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-void *Task_2(
- void *argument
-);
-
-void *Task_3(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 1
-
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/psxtests/psx10/task.c b/c/src/tests/psxtests/psx10/task.c
deleted file mode 100644
index 6419b13c3c..0000000000
--- a/c/src/tests/psxtests/psx10/task.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Task_1
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/psxtests/psx10/task2.c b/c/src/tests/psxtests/psx10/task2.c
deleted file mode 100644
index 5095178e6f..0000000000
--- a/c/src/tests/psxtests/psx10/task2.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Task_2
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/psxtests/psx10/task3.c b/c/src/tests/psxtests/psx10/task3.c
deleted file mode 100644
index d276bf86cb..0000000000
--- a/c/src/tests/psxtests/psx10/task3.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Task_3
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/psxtests/psx11/Makefile.in b/c/src/tests/psxtests/psx11/Makefile.in
deleted file mode 100644
index 96881f8a2b..0000000000
--- a/c/src/tests/psxtests/psx11/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=psx11
-
-MANAGERS=all
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/psxtests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/psxtests/psx11/init.c b/c/src/tests/psxtests/psx11/init.c
deleted file mode 100644
index 2a64517935..0000000000
--- a/c/src/tests/psxtests/psx11/init.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <errno.h>
-
-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, &param );
- assert( !status );
-
- param.sched_priority = 125;
-
- puts( "Init: Setting scheduling parameters to RR with priority 125" );
- status = pthread_setschedparam( Init_id, SCHED_RR, &param );
- assert( !status );
-
- param.sched_priority = 121;
-
- puts( "Init: Setting scheduling parameters to OTHER with priority 121" );
- status = pthread_setschedparam( Init_id, SCHED_OTHER, &param );
- 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 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx11/psx11.scn b/c/src/tests/psxtests/psx11/psx11.scn
deleted file mode 100644
index 69df5ec1b9..0000000000
--- a/c/src/tests/psxtests/psx11/psx11.scn
+++ /dev/null
@@ -1,18 +0,0 @@
-*** POSIX TEST 11 ***
-Init's ID is 0x0c010001
-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/c/src/tests/psxtests/psx11/system.h b/c/src/tests/psxtests/psx11/system.h
deleted file mode 100644
index a402b65128..0000000000
--- a/c/src/tests/psxtests/psx11/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/psxtests/psx11/task.c b/c/src/tests/psxtests/psx11/task.c
deleted file mode 100644
index dbc90cbc58..0000000000
--- a/c/src/tests/psxtests/psx11/task.c
+++ /dev/null
@@ -1,92 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <time.h>
-#include <sched.h>
-
-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, &current );
- assert( !status );
-
- diff_timespec( &start, &current, &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/c/src/tests/psxtests/psx12/Makefile.in b/c/src/tests/psxtests/psx12/Makefile.in
deleted file mode 100644
index f2ea2915bb..0000000000
--- a/c/src/tests/psxtests/psx12/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=psx12
-
-MANAGERS=all
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/psxtests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/psxtests/psx12/init.c b/c/src/tests/psxtests/psx12/init.c
deleted file mode 100644
index 17ca4e0f5d..0000000000
--- a/c/src/tests/psxtests/psx12/init.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <errno.h>
-
-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 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/c/src/tests/psxtests/psx12/psx12.scn b/c/src/tests/psxtests/psx12/psx12.scn
deleted file mode 100644
index fd969cb122..0000000000
--- a/c/src/tests/psxtests/psx12/psx12.scn
+++ /dev/null
@@ -1,11 +0,0 @@
-*** POSIX TEST 12 ***
-Init's ID is 0x0c010001
-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/c/src/tests/psxtests/psx12/system.h b/c/src/tests/psxtests/psx12/system.h
deleted file mode 100644
index ebdf74e20b..0000000000
--- a/c/src/tests/psxtests/psx12/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 10
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/psxtests/psx12/task.c b/c/src/tests/psxtests/psx12/task.c
deleted file mode 100644
index a477e4ee88..0000000000
--- a/c/src/tests/psxtests/psx12/task.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <time.h>
-#include <sched.h>
-
-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/c/src/tests/psxtests/psxhdrs/Makefile.in b/c/src/tests/psxtests/psxhdrs/Makefile.in
deleted file mode 100644
index a47ffccb4f..0000000000
--- a/c/src/tests/psxtests/psxhdrs/Makefile.in
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# C source names, if any, go here -- minus the
-C_PIECES=\
- clock01 clock02 clock03 clock04 clock05 \
- cond01 cond02 cond03 cond04 cond05 cond06 cond07 \
- cond08 cond09 cond10 \
- key01 key02 key03 key04 \
- mutex01 mutex02 mutex03 mutex04 mutex05 mutex06 mutex07 \
- mutex08 mutex09 mutex10 mutex11 mutex12 mutex13 mutex14 \
- mutex15 mutex16 \
- pthread01 pthread02 pthread03 pthread04 pthread05 pthread06 \
- pthread07 pthread08 pthread09 pthread10 pthread11 pthread12 \
- pthread13 pthread14 pthread15 pthread16 pthread17 pthread18 \
- pthread19 pthread20 pthread21 pthread22 pthread23 pthread24 \
- pthread25 pthread26 pthread27 pthread28 pthread29 pthread30 \
- pthread31 pthread32 pthread33 pthread34 pthread35 pthread36 \
- proc01 proc02 proc03 proc04 proc05 proc06 proc07 proc08 \
- proc09 proc10 proc11 proc12 proc13 proc14 \
- sched01 sched02 sched03 sched04 sched05 sched06 sched07 sched08 \
- signal01 signal02 signal03 signal04 signal05 signal06 signal07 \
- signal08 signal09 signal10 signal11 signal12 signal13 signal14 \
- signal15 signal16 signal17 signal18 signal19 signal20 signal21 \
- signal22 \
- time01 time02 time03 time04 time05 time06 time07 time08 time09 \
- time10 time11 time12 time13 \
- timer01 timer02 timer03 timer04 timer05 timer06
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(LIB)
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) ${OBJS}
diff --git a/c/src/tests/psxtests/psxhdrs/clock01.c b/c/src/tests/psxtests/psxhdrs/clock01.c
deleted file mode 100644
index 4677dac3f8..0000000000
--- a/c/src/tests/psxtests/psxhdrs/clock01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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/c/src/tests/psxtests/psxhdrs/clock02.c b/c/src/tests/psxtests/psxhdrs/clock02.c
deleted file mode 100644
index 9bd35c1be6..0000000000
--- a/c/src/tests/psxtests/psxhdrs/clock02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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/c/src/tests/psxtests/psxhdrs/clock03.c b/c/src/tests/psxtests/psxhdrs/clock03.c
deleted file mode 100644
index 489390fcec..0000000000
--- a/c/src/tests/psxtests/psxhdrs/clock03.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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/c/src/tests/psxtests/psxhdrs/clock04.c b/c/src/tests/psxtests/psxhdrs/clock04.c
deleted file mode 100644
index 721f73666b..0000000000
--- a/c/src/tests/psxtests/psxhdrs/clock04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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/c/src/tests/psxtests/psxhdrs/clock05.c b/c/src/tests/psxtests/psxhdrs/clock05.c
deleted file mode 100644
index 7c862db4a0..0000000000
--- a/c/src/tests/psxtests/psxhdrs/clock05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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/c/src/tests/psxtests/psxhdrs/clock06.c b/c/src/tests/psxtests/psxhdrs/clock06.c
deleted file mode 100644
index 614da056d5..0000000000
--- a/c/src/tests/psxtests/psxhdrs/clock06.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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/c/src/tests/psxtests/psxhdrs/cond01.c b/c/src/tests/psxtests/psxhdrs/cond01.c
deleted file mode 100644
index 3dfd686313..0000000000
--- a/c/src/tests/psxtests/psxhdrs/cond01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/cond02.c b/c/src/tests/psxtests/psxhdrs/cond02.c
deleted file mode 100644
index 0f0f84ba17..0000000000
--- a/c/src/tests/psxtests/psxhdrs/cond02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/cond03.c b/c/src/tests/psxtests/psxhdrs/cond03.c
deleted file mode 100644
index a1e848ff82..0000000000
--- a/c/src/tests/psxtests/psxhdrs/cond03.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/cond04.c b/c/src/tests/psxtests/psxhdrs/cond04.c
deleted file mode 100644
index ebf340182e..0000000000
--- a/c/src/tests/psxtests/psxhdrs/cond04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/cond05.c b/c/src/tests/psxtests/psxhdrs/cond05.c
deleted file mode 100644
index 3daf62c66b..0000000000
--- a/c/src/tests/psxtests/psxhdrs/cond05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/cond06.c b/c/src/tests/psxtests/psxhdrs/cond06.c
deleted file mode 100644
index e3a5466264..0000000000
--- a/c/src/tests/psxtests/psxhdrs/cond06.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/cond07.c b/c/src/tests/psxtests/psxhdrs/cond07.c
deleted file mode 100644
index e5551d2487..0000000000
--- a/c/src/tests/psxtests/psxhdrs/cond07.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/cond08.c b/c/src/tests/psxtests/psxhdrs/cond08.c
deleted file mode 100644
index ff4bc7d233..0000000000
--- a/c/src/tests/psxtests/psxhdrs/cond08.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/cond09.c b/c/src/tests/psxtests/psxhdrs/cond09.c
deleted file mode 100644
index c563c0a3ef..0000000000
--- a/c/src/tests/psxtests/psxhdrs/cond09.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/cond10.c b/c/src/tests/psxtests/psxhdrs/cond10.c
deleted file mode 100644
index 01ff0ba63f..0000000000
--- a/c/src/tests/psxtests/psxhdrs/cond10.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/key01.c b/c/src/tests/psxtests/psxhdrs/key01.c
deleted file mode 100644
index 513d81a7c3..0000000000
--- a/c/src/tests/psxtests/psxhdrs/key01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/key02.c b/c/src/tests/psxtests/psxhdrs/key02.c
deleted file mode 100644
index 85e5f07577..0000000000
--- a/c/src/tests/psxtests/psxhdrs/key02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/key03.c b/c/src/tests/psxtests/psxhdrs/key03.c
deleted file mode 100644
index 62ad1fdc0b..0000000000
--- a/c/src/tests/psxtests/psxhdrs/key03.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/key04.c b/c/src/tests/psxtests/psxhdrs/key04.c
deleted file mode 100644
index d3440106cf..0000000000
--- a/c/src/tests/psxtests/psxhdrs/key04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex01.c b/c/src/tests/psxtests/psxhdrs/mutex01.c
deleted file mode 100644
index 318b79b684..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex02.c b/c/src/tests/psxtests/psxhdrs/mutex02.c
deleted file mode 100644
index 0d53b8ba1d..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex03.c b/c/src/tests/psxtests/psxhdrs/mutex03.c
deleted file mode 100644
index 8d2d23b871..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex03.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex04.c b/c/src/tests/psxtests/psxhdrs/mutex04.c
deleted file mode 100644
index ca9b8b8abe..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex05.c b/c/src/tests/psxtests/psxhdrs/mutex05.c
deleted file mode 100644
index 6b0aa58296..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex06.c b/c/src/tests/psxtests/psxhdrs/mutex06.c
deleted file mode 100644
index 9773d02a27..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex06.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex07.c b/c/src/tests/psxtests/psxhdrs/mutex07.c
deleted file mode 100644
index 709b15093d..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex07.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex08.c b/c/src/tests/psxtests/psxhdrs/mutex08.c
deleted file mode 100644
index 119cccc190..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex08.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex09.c b/c/src/tests/psxtests/psxhdrs/mutex09.c
deleted file mode 100644
index 322b00060e..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex09.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex10.c b/c/src/tests/psxtests/psxhdrs/mutex10.c
deleted file mode 100644
index 11ee1ac294..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex10.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex11.c b/c/src/tests/psxtests/psxhdrs/mutex11.c
deleted file mode 100644
index 58fa2017cf..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex11.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex12.c b/c/src/tests/psxtests/psxhdrs/mutex12.c
deleted file mode 100644
index 2a0090e26e..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex12.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex13.c b/c/src/tests/psxtests/psxhdrs/mutex13.c
deleted file mode 100644
index b3ab3fb070..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex13.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex14.c b/c/src/tests/psxtests/psxhdrs/mutex14.c
deleted file mode 100644
index 6410e021a4..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex14.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex15.c b/c/src/tests/psxtests/psxhdrs/mutex15.c
deleted file mode 100644
index cbef40b0c9..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex15.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/mutex16.c b/c/src/tests/psxtests/psxhdrs/mutex16.c
deleted file mode 100644
index 8adbff564e..0000000000
--- a/c/src/tests/psxtests/psxhdrs/mutex16.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/proc01.c b/c/src/tests/psxtests/psxhdrs/proc01.c
deleted file mode 100644
index 52b286fd70..0000000000
--- a/c/src/tests/psxtests/psxhdrs/proc01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-void test( void )
-{
- pid_t pid;
-
- pid = getpid();
-}
diff --git a/c/src/tests/psxtests/psxhdrs/proc02.c b/c/src/tests/psxtests/psxhdrs/proc02.c
deleted file mode 100644
index 469ef59382..0000000000
--- a/c/src/tests/psxtests/psxhdrs/proc02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-void test( void )
-{
- pid_t pid;
-
- pid = getppid();
-}
diff --git a/c/src/tests/psxtests/psxhdrs/proc03.c b/c/src/tests/psxtests/psxhdrs/proc03.c
deleted file mode 100644
index 69a94d51af..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-void test( void )
-{
- uid_t uid;
-
- uid = getuid();
-}
diff --git a/c/src/tests/psxtests/psxhdrs/proc04.c b/c/src/tests/psxtests/psxhdrs/proc04.c
deleted file mode 100644
index 25809433c5..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-void test( void )
-{
- uid_t uid;
-
- uid = geteuid();
-}
diff --git a/c/src/tests/psxtests/psxhdrs/proc05.c b/c/src/tests/psxtests/psxhdrs/proc05.c
deleted file mode 100644
index d3cb7835cf..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-void test( void )
-{
- gid_t gid;
-
- gid = getgid();
-}
diff --git a/c/src/tests/psxtests/psxhdrs/proc06.c b/c/src/tests/psxtests/psxhdrs/proc06.c
deleted file mode 100644
index 9de56e6de3..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-void test( void )
-{
- gid_t gid;
-
- gid = getegid();
-}
diff --git a/c/src/tests/psxtests/psxhdrs/proc07.c b/c/src/tests/psxtests/psxhdrs/proc07.c
deleted file mode 100644
index 1f05103761..0000000000
--- a/c/src/tests/psxtests/psxhdrs/proc07.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-void test( void )
-{
- uid_t uid;
- int result;
-
- uid = 0;
-
- result = setuid( uid );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/proc08.c b/c/src/tests/psxtests/psxhdrs/proc08.c
deleted file mode 100644
index 9ef24d36c1..0000000000
--- a/c/src/tests/psxtests/psxhdrs/proc08.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-void test( void )
-{
- gid_t gid;
- int result;
-
- gid = 0;
-
- result = setgid( gid );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/proc09.c b/c/src/tests/psxtests/psxhdrs/proc09.c
deleted file mode 100644
index 10d90ada2f..0000000000
--- a/c/src/tests/psxtests/psxhdrs/proc09.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-void test( void )
-{
- gid_t grouplist[ 20 ];
- int gidsetsize;
- int result;
-
- gidsetsize = 20;
-
- result = getgroups( gidsetsize, grouplist );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/proc10.c b/c/src/tests/psxtests/psxhdrs/proc10.c
deleted file mode 100644
index c57d0cd05e..0000000000
--- a/c/src/tests/psxtests/psxhdrs/proc10.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-void test( void )
-{
- char *loginname;
-
- loginname = getlogin();
-}
diff --git a/c/src/tests/psxtests/psxhdrs/proc11.c b/c/src/tests/psxtests/psxhdrs/proc11.c
deleted file mode 100644
index 531139f8f7..0000000000
--- a/c/src/tests/psxtests/psxhdrs/proc11.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <limits.h> /* for LOGIN_NAME_MAX */
-
-void test( void )
-{
- char loginnamebuffer[ LOGIN_NAME_MAX ];
- int result;
-
- result = getlogin_r( loginnamebuffer, LOGIN_NAME_MAX );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/proc12.c b/c/src/tests/psxtests/psxhdrs/proc12.c
deleted file mode 100644
index 7437189dbe..0000000000
--- a/c/src/tests/psxtests/psxhdrs/proc12.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-void test( void )
-{
- pid_t pgrp;
-
- pgrp = getpgrp();
-}
diff --git a/c/src/tests/psxtests/psxhdrs/proc13.c b/c/src/tests/psxtests/psxhdrs/proc13.c
deleted file mode 100644
index 7982132e9b..0000000000
--- a/c/src/tests/psxtests/psxhdrs/proc13.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-void test( void )
-{
- pid_t pid;
-
- pid = setsid();
-}
diff --git a/c/src/tests/psxtests/psxhdrs/proc14.c b/c/src/tests/psxtests/psxhdrs/proc14.c
deleted file mode 100644
index b905d18ea1..0000000000
--- a/c/src/tests/psxtests/psxhdrs/proc14.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-void test( void )
-{
- pid_t pid = 0;
- pid_t pgid = 0;
- int result;
-
- result = setpgid( pid, pgid );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/pthread01.c b/c/src/tests/psxtests/psxhdrs/pthread01.c
deleted file mode 100644
index 9b95ecd5f9..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread02.c b/c/src/tests/psxtests/psxhdrs/pthread02.c
deleted file mode 100644
index a88a76b4a5..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread03.c b/c/src/tests/psxtests/psxhdrs/pthread03.c
deleted file mode 100644
index 28be165a5f..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread03.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread04.c b/c/src/tests/psxtests/psxhdrs/pthread04.c
deleted file mode 100644
index 84a4aad280..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread05.c b/c/src/tests/psxtests/psxhdrs/pthread05.c
deleted file mode 100644
index 669a356fbf..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-#include <limits.h> /* 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/c/src/tests/psxtests/psxhdrs/pthread06.c b/c/src/tests/psxtests/psxhdrs/pthread06.c
deleted file mode 100644
index 2140678008..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread06.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread07.c b/c/src/tests/psxtests/psxhdrs/pthread07.c
deleted file mode 100644
index 7b6b6c8c55..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread07.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread08.c b/c/src/tests/psxtests/psxhdrs/pthread08.c
deleted file mode 100644
index a3bab33ef1..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread08.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#ifndef _POSIX_THREADS
-#error "rtems is supposed to have pthread_exit"
-#endif
-
-void test( void )
-{
- void *status = NULL;
-
- pthread_exit( status );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/pthread09.c b/c/src/tests/psxtests/psxhdrs/pthread09.c
deleted file mode 100644
index d4a9754fb8..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread09.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#ifndef _POSIX_THREADS
-#error "rtems is supposed to have pthread_self"
-#endif
-
-void test( void )
-{
- pthread_t self;
-
- self = pthread_self();
-}
diff --git a/c/src/tests/psxtests/psxhdrs/pthread10.c b/c/src/tests/psxtests/psxhdrs/pthread10.c
deleted file mode 100644
index 8cb965ca87..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread10.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread11.c b/c/src/tests/psxtests/psxhdrs/pthread11.c
deleted file mode 100644
index 5a9faca6dd..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread11.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * This test file is used to verify that the header files associated with
- * invoking this function are correct.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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, &param );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/pthread12.c b/c/src/tests/psxtests/psxhdrs/pthread12.c
deleted file mode 100644
index 00b88a53ab..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread12.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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, &param );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/pthread13.c b/c/src/tests/psxtests/psxhdrs/pthread13.c
deleted file mode 100644
index 9126951486..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread13.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread14.c b/c/src/tests/psxtests/psxhdrs/pthread14.c
deleted file mode 100644
index 58a75a4f17..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread14.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread15.c b/c/src/tests/psxtests/psxhdrs/pthread15.c
deleted file mode 100644
index 10435a266b..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread15.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread16.c b/c/src/tests/psxtests/psxhdrs/pthread16.c
deleted file mode 100644
index 54960897ec..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread16.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread17.c b/c/src/tests/psxtests/psxhdrs/pthread17.c
deleted file mode 100644
index 24f6b0386f..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread17.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread18.c b/c/src/tests/psxtests/psxhdrs/pthread18.c
deleted file mode 100644
index b59860997d..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread18.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread19.c b/c/src/tests/psxtests/psxhdrs/pthread19.c
deleted file mode 100644
index fc968e065e..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread19.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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, &param );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/pthread20.c b/c/src/tests/psxtests/psxhdrs/pthread20.c
deleted file mode 100644
index d6432f25c4..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread20.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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, &param );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/pthread21.c b/c/src/tests/psxtests/psxhdrs/pthread21.c
deleted file mode 100644
index e94a5c5f29..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread21.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread22.c b/c/src/tests/psxtests/psxhdrs/pthread22.c
deleted file mode 100644
index d163cc3352..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread22.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * This test file is used to verify that the header files associated with
- * invoking this function are correct.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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, &param );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/pthread23.c b/c/src/tests/psxtests/psxhdrs/pthread23.c
deleted file mode 100644
index fc12a615cc..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread23.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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, &param );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/pthread24.c b/c/src/tests/psxtests/psxhdrs/pthread24.c
deleted file mode 100644
index afb8d3b2e9..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread24.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-#include <limits.h> /* 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/c/src/tests/psxtests/psxhdrs/pthread25.c b/c/src/tests/psxtests/psxhdrs/pthread25.c
deleted file mode 100644
index 48e01eaa53..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread25.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-#include <limits.h> /* 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/c/src/tests/psxtests/psxhdrs/pthread26.c b/c/src/tests/psxtests/psxhdrs/pthread26.c
deleted file mode 100644
index 6643454b6f..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread26.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread27.c b/c/src/tests/psxtests/psxhdrs/pthread27.c
deleted file mode 100644
index 2f80f1c098..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread27.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread28.c b/c/src/tests/psxtests/psxhdrs/pthread28.c
deleted file mode 100644
index a9d78e36fa..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread28.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread29.c b/c/src/tests/psxtests/psxhdrs/pthread29.c
deleted file mode 100644
index 45efbc0bb9..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread29.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread30.c b/c/src/tests/psxtests/psxhdrs/pthread30.c
deleted file mode 100644
index 44e885612e..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread30.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread31.c b/c/src/tests/psxtests/psxhdrs/pthread31.c
deleted file mode 100644
index d553a09e65..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread31.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#ifndef _POSIX_THREADS
-#error "rtems is supposed to have pthread_testcancel"
-#endif
-
-void init_routine( void )
-{
-}
-
-void test( void )
-{
- pthread_testcancel();
-}
diff --git a/c/src/tests/psxtests/psxhdrs/pthread32.c b/c/src/tests/psxtests/psxhdrs/pthread32.c
deleted file mode 100644
index 80990610ec..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread32.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread33.c b/c/src/tests/psxtests/psxhdrs/pthread33.c
deleted file mode 100644
index 7cff807ef0..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread33.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#ifndef _POSIX_THREADS
-#error "rtems is supposed to have pthread_cleanup_pop"
-#endif
-
-void test( void )
-{
- pthread_cleanup_pop( 1 );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/pthread34.c b/c/src/tests/psxtests/psxhdrs/pthread34.c
deleted file mode 100644
index fc575a6056..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread34.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread35.c b/c/src/tests/psxtests/psxhdrs/pthread35.c
deleted file mode 100644
index d9dd771c2c..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread35.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/pthread36.c b/c/src/tests/psxtests/psxhdrs/pthread36.c
deleted file mode 100644
index 80ddd64578..0000000000
--- a/c/src/tests/psxtests/psxhdrs/pthread36.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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/c/src/tests/psxtests/psxhdrs/sched01.c b/c/src/tests/psxtests/psxhdrs/sched01.c
deleted file mode 100644
index 7e1e9ca621..0000000000
--- a/c/src/tests/psxtests/psxhdrs/sched01.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * This test file is used to verify that the header files associated with
- * invoking this function are correct.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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, &param );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/sched02.c b/c/src/tests/psxtests/psxhdrs/sched02.c
deleted file mode 100644
index 5475b22382..0000000000
--- a/c/src/tests/psxtests/psxhdrs/sched02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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, &param );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/sched03.c b/c/src/tests/psxtests/psxhdrs/sched03.c
deleted file mode 100644
index 19a2774b94..0000000000
--- a/c/src/tests/psxtests/psxhdrs/sched03.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * This test file is used to verify that the header files associated with
- * invoking this function are correct.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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, &param );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/sched04.c b/c/src/tests/psxtests/psxhdrs/sched04.c
deleted file mode 100644
index bc002be98a..0000000000
--- a/c/src/tests/psxtests/psxhdrs/sched04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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/c/src/tests/psxtests/psxhdrs/sched05.c b/c/src/tests/psxtests/psxhdrs/sched05.c
deleted file mode 100644
index 179bc7b4e0..0000000000
--- a/c/src/tests/psxtests/psxhdrs/sched05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#ifndef _POSIX_PRIORITY_SCHEDULING
-#error "rtems is supposed to have sched_yield"
-#endif
-
-void test( void )
-{
- int result;
-
- result = sched_yield();
-}
diff --git a/c/src/tests/psxtests/psxhdrs/sched06.c b/c/src/tests/psxtests/psxhdrs/sched06.c
deleted file mode 100644
index 055b0d197f..0000000000
--- a/c/src/tests/psxtests/psxhdrs/sched06.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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/c/src/tests/psxtests/psxhdrs/sched07.c b/c/src/tests/psxtests/psxhdrs/sched07.c
deleted file mode 100644
index 5743359f6a..0000000000
--- a/c/src/tests/psxtests/psxhdrs/sched07.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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/c/src/tests/psxtests/psxhdrs/sched08.c b/c/src/tests/psxtests/psxhdrs/sched08.c
deleted file mode 100644
index 2fdadc2924..0000000000
--- a/c/src/tests/psxtests/psxhdrs/sched08.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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/c/src/tests/psxtests/psxhdrs/signal01.c b/c/src/tests/psxtests/psxhdrs/signal01.c
deleted file mode 100644
index adc7c43f4d..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-void test( void )
-{
- sigset_t signal_set;
- int signal_number;
- int result;
-
- signal_number = SIGALRM;
-
- result = sigaddset( &signal_set, signal_number );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal02.c b/c/src/tests/psxtests/psxhdrs/signal02.c
deleted file mode 100644
index a16ed63a6b..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-void test( void )
-{
- sigset_t signal_set;
- int signal_number;
- int result;
-
- signal_number = SIGALRM;
-
- result = sigdelset( &signal_set, signal_number );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal03.c b/c/src/tests/psxtests/psxhdrs/signal03.c
deleted file mode 100644
index 27c778b7c4..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal03.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-void test( void )
-{
- sigset_t signal_set;
- int result;
-
- result = sigfillset( &signal_set );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal04.c b/c/src/tests/psxtests/psxhdrs/signal04.c
deleted file mode 100644
index a0b22d39ca..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-void test( void )
-{
- sigset_t signal_set;
- int signal_number;
- int result;
-
- signal_number = SIGALRM;
-
- result = sigismember( &signal_set, signal_number );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal05.c b/c/src/tests/psxtests/psxhdrs/signal05.c
deleted file mode 100644
index b473c55f1e..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-void test( void )
-{
- sigset_t signal_set;
- int result;
-
- result = sigemptyset( &signal_set );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal06.c b/c/src/tests/psxtests/psxhdrs/signal06.c
deleted file mode 100644
index e90bc62e37..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal06.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This test file is used to verify that the header files associated with
- * invoking this function are correct.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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/c/src/tests/psxtests/psxhdrs/signal07.c b/c/src/tests/psxtests/psxhdrs/signal07.c
deleted file mode 100644
index e30a07791d..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal07.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-#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/c/src/tests/psxtests/psxhdrs/signal08.c b/c/src/tests/psxtests/psxhdrs/signal08.c
deleted file mode 100644
index 251c8d3af6..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal08.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-#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/c/src/tests/psxtests/psxhdrs/signal09.c b/c/src/tests/psxtests/psxhdrs/signal09.c
deleted file mode 100644
index b33647d147..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal09.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <signal.h>
-
-void test( void )
-{
- pid_t pid;
- int signal_number;
- int result;
-
- pid = 0;
- signal_number = SIGALRM;
-
- result = kill( pid, signal_number );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal10.c b/c/src/tests/psxtests/psxhdrs/signal10.c
deleted file mode 100644
index dc5f7c27d5..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal10.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-void test( void )
-{
- sigset_t set;
- int sig;
- int result;
-
- result = sigwait( &set, &sig );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal11.c b/c/src/tests/psxtests/psxhdrs/signal11.c
deleted file mode 100644
index 0af70d9ef5..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal11.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-void test( void )
-{
- int signal_number;
- int result;
-
- signal_number = SIGALRM;
-
- result = raise( signal_number );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal12.c b/c/src/tests/psxtests/psxhdrs/signal12.c
deleted file mode 100644
index 36926a98ea..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal12.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-void test( void )
-{
- void (*signal_function_pointer)();
- int signal_number;
-
- signal_number = SIGALRM;
-
- signal_function_pointer = signal( signal_number, SIG_IGN );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal13.c b/c/src/tests/psxtests/psxhdrs/signal13.c
deleted file mode 100644
index 2270066aaa..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal13.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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/c/src/tests/psxtests/psxhdrs/signal14.c b/c/src/tests/psxtests/psxhdrs/signal14.c
deleted file mode 100644
index 192b824655..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal14.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-void test( void )
-{
- sigset_t set;
- int result;
-
- (void) sigemptyset( &set );
-
- result = sigpending( &set );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal15.c b/c/src/tests/psxtests/psxhdrs/signal15.c
deleted file mode 100644
index 1dabed1945..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal15.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-void test( void )
-{
- sigset_t sigmask;
- int result;
-
- (void) sigemptyset( &sigmask );
-
- result = sigsuspend( &sigmask );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal16.c b/c/src/tests/psxtests/psxhdrs/signal16.c
deleted file mode 100644
index cc8bfe9bbb..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal16.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-#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/c/src/tests/psxtests/psxhdrs/signal17.c b/c/src/tests/psxtests/psxhdrs/signal17.c
deleted file mode 100644
index 152883d0bf..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal17.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-void test( void )
-{
- sigset_t set;
- siginfo_t info;
- int result;
-
- (void) sigemptyset( &set );
-
- result = sigwaitinfo( &set, &info );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal18.c b/c/src/tests/psxtests/psxhdrs/signal18.c
deleted file mode 100644
index 1deb450c27..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal18.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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/c/src/tests/psxtests/psxhdrs/signal19.c b/c/src/tests/psxtests/psxhdrs/signal19.c
deleted file mode 100644
index e4497623bb..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal19.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-void test( void )
-{
- sigset_t set;
- int sig;
- int result;
-
- (void) sigemptyset( &set );
-
- result = sigwait( &set, &sig );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal20.c b/c/src/tests/psxtests/psxhdrs/signal20.c
deleted file mode 100644
index 928b528906..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal20.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-void test( void )
-{
- unsigned int seconds;
- unsigned int result;
-
- seconds = 10;
-
- result = alarm( seconds );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal21.c b/c/src/tests/psxtests/psxhdrs/signal21.c
deleted file mode 100644
index 6572d5a9af..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal21.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-void test( void )
-{
- int result;
-
- result = pause();
-}
diff --git a/c/src/tests/psxtests/psxhdrs/signal22.c b/c/src/tests/psxtests/psxhdrs/signal22.c
deleted file mode 100644
index a944c79edd..0000000000
--- a/c/src/tests/psxtests/psxhdrs/signal22.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <unistd.h>
-
-void test( void )
-{
- unsigned int seconds;
- unsigned int result;
-
- seconds = 10;
-
- result = sleep( seconds );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/time01.c b/c/src/tests/psxtests/psxhdrs/time01.c
deleted file mode 100644
index 2c2a811ebd..0000000000
--- a/c/src/tests/psxtests/psxhdrs/time01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- clock_t clock_ticks;
-
- clock_ticks = clock();
-}
diff --git a/c/src/tests/psxtests/psxhdrs/time02.c b/c/src/tests/psxtests/psxhdrs/time02.c
deleted file mode 100644
index 233b33adbe..0000000000
--- a/c/src/tests/psxtests/psxhdrs/time02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- time_t time1;
- time_t time2;
- double difference;
-
- time1 = 0;
- time2 = 0;
-
- difference = difftime( time1, time2 );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/time03.c b/c/src/tests/psxtests/psxhdrs/time03.c
deleted file mode 100644
index 1d44f3d927..0000000000
--- a/c/src/tests/psxtests/psxhdrs/time03.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-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( &timestruct );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/time04.c b/c/src/tests/psxtests/psxhdrs/time04.c
deleted file mode 100644
index 9db332a605..0000000000
--- a/c/src/tests/psxtests/psxhdrs/time04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- time_t new_time;
-
- new_time = time( &new_time );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/time05.c b/c/src/tests/psxtests/psxhdrs/time05.c
deleted file mode 100644
index 817df63f30..0000000000
--- a/c/src/tests/psxtests/psxhdrs/time05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-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", &timestruct );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/time06.c b/c/src/tests/psxtests/psxhdrs/time06.c
deleted file mode 100644
index abdeee0d24..0000000000
--- a/c/src/tests/psxtests/psxhdrs/time06.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- char *buffer;
- struct tm timestruct;
-
- buffer = asctime( &timestruct );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/time07.c b/c/src/tests/psxtests/psxhdrs/time07.c
deleted file mode 100644
index 66eebe6d37..0000000000
--- a/c/src/tests/psxtests/psxhdrs/time07.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- char *buffer;
- time_t time;
-
- buffer = ctime( &time );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/time08.c b/c/src/tests/psxtests/psxhdrs/time08.c
deleted file mode 100644
index 8e0cd49bcd..0000000000
--- a/c/src/tests/psxtests/psxhdrs/time08.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- time_t time;
- struct tm *timestruct;
-
- timestruct = gmtime( &time );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/time09.c b/c/src/tests/psxtests/psxhdrs/time09.c
deleted file mode 100644
index 9069927fcc..0000000000
--- a/c/src/tests/psxtests/psxhdrs/time09.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- time_t time;
- struct tm *timestruct;
-
- timestruct = localtime( &time );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/time10.c b/c/src/tests/psxtests/psxhdrs/time10.c
deleted file mode 100644
index a87fa0079b..0000000000
--- a/c/src/tests/psxtests/psxhdrs/time10.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- char *buffer_pointer;
- struct tm timestruct;
- char buffer[ 80 ];
-
- buffer_pointer = asctime_r( &timestruct, buffer );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/time11.c b/c/src/tests/psxtests/psxhdrs/time11.c
deleted file mode 100644
index 8c5e4d8a7f..0000000000
--- a/c/src/tests/psxtests/psxhdrs/time11.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- char *buffer_pointer;
- char buffer[ 80 ];
- time_t time;
-
- buffer_pointer = ctime_r( &time, buffer );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/time12.c b/c/src/tests/psxtests/psxhdrs/time12.c
deleted file mode 100644
index 46ac4d44bf..0000000000
--- a/c/src/tests/psxtests/psxhdrs/time12.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- time_t time;
- struct tm *timestruct_pointer;
- struct tm timestruct;
-
- timestruct_pointer = gmtime_r( &time, &timestruct );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/time13.c b/c/src/tests/psxtests/psxhdrs/time13.c
deleted file mode 100644
index ff9a42eb96..0000000000
--- a/c/src/tests/psxtests/psxhdrs/time13.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- time_t time;
- struct tm *timestruct_pointer;
- struct tm timestruct;
-
- timestruct_pointer = localtime_r( &time, &timestruct );
-}
diff --git a/c/src/tests/psxtests/psxhdrs/timer01.c b/c/src/tests/psxtests/psxhdrs/timer01.c
deleted file mode 100644
index 02be02cff1..0000000000
--- a/c/src/tests/psxtests/psxhdrs/timer01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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/c/src/tests/psxtests/psxhdrs/timer02.c b/c/src/tests/psxtests/psxhdrs/timer02.c
deleted file mode 100644
index b312d2e143..0000000000
--- a/c/src/tests/psxtests/psxhdrs/timer02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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/c/src/tests/psxtests/psxhdrs/timer03.c b/c/src/tests/psxtests/psxhdrs/timer03.c
deleted file mode 100644
index 5ae0efe07f..0000000000
--- a/c/src/tests/psxtests/psxhdrs/timer03.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This test file is used to verify that the header files associated with
- * invoking this function are correct.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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/c/src/tests/psxtests/psxhdrs/timer04.c b/c/src/tests/psxtests/psxhdrs/timer04.c
deleted file mode 100644
index aea13743f0..0000000000
--- a/c/src/tests/psxtests/psxhdrs/timer04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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/c/src/tests/psxtests/psxhdrs/timer05.c b/c/src/tests/psxtests/psxhdrs/timer05.c
deleted file mode 100644
index f514857e12..0000000000
--- a/c/src/tests/psxtests/psxhdrs/timer05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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/c/src/tests/psxtests/psxhdrs/timer06.c b/c/src/tests/psxtests/psxhdrs/timer06.c
deleted file mode 100644
index 5d0274397c..0000000000
--- a/c/src/tests/psxtests/psxhdrs/timer06.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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/c/src/tests/psxtests/support/Makefile.in b/c/src/tests/psxtests/support/Makefile.in
deleted file mode 100644
index c6e08f919c..0000000000
--- a/c/src/tests/psxtests/support/Makefile.in
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-all:
-
-SUB_DIRS=include
-
diff --git a/c/src/tests/psxtests/support/include/Makefile.in b/c/src/tests/psxtests/support/include/Makefile.in
deleted file mode 100644
index bf79747aff..0000000000
--- a/c/src/tests/psxtests/support/include/Makefile.in
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES= $(srcdir)/pmacros.h
-
-SYS_H_FILES=
-
-SRCS=$(H_FILES) $(SYS_H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
-# $(INSTALL) -m 444 $(SYS_H_FILES) $(PROJECT_INCLUDE)/sys
-
diff --git a/c/src/tests/psxtests/support/include/pmacros.h b/c/src/tests/psxtests/support/include/pmacros.h
deleted file mode 100644
index 1f15dac9c0..0000000000
--- a/c/src/tests/psxtests/support/include/pmacros.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef __POSIX_TEST_MACROS_h
-#define __POSIX_TEST_MACROS_h
-
-#include <bsp.h>
-#include <pthread.h>
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-
-/*
- * 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
-
-#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; }
-
-#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 _buffer[32]; \
- int _status; \
- struct timespec _tv; \
- \
- _status = clock_gettime( CLOCK_REALTIME, &_tv ); \
- assert( !_status ); \
- \
- (void) ctime_r( &_tv.tv_sec, _buffer ); \
- _buffer[ strlen( _buffer ) - 1 ] = 0; \
- printf( "%s%s%s\n", s1, _buffer, s2 ); \
- fflush(stdout); \
- } while ( 0 )
-
-#define empty_line() puts( "" )
-
-#endif
-
-/* end of file */
diff --git a/c/src/tests/samples/Makefile.in b/c/src/tests/samples/Makefile.in
deleted file mode 100644
index a76b6478f7..0000000000
--- a/c/src/tests/samples/Makefile.in
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-# cdtest is a C++ constructor/destructor test
-# We only build it if HAS_CPLUSCPLUS was defined
-
-CPLUSPLUS_TESTS_yes_V = cdtest
-CPLUSPLUS_TESTS = $(CPLUSPLUS_TESTS_$(HAS_CPLUSPLUS)_V)
-
-# base_mp is a sample multiprocessing test
-# We only build it if HAS_MP was defined
-
-MP_TESTS_yes_V = base_mp
-MP_TESTS = $(MP_TESTS_$(HAS_MP)_V)
-
-FP_TESTS = paranoia
-
-SUB_DIRS=hello ticker base_sp \
- $(MP_TESTS) $(CPLUSPLUS_TESTS) $(FP_TESTS)
-
-
-
diff --git a/c/src/tests/samples/README b/c/src/tests/samples/README
deleted file mode 100644
index bc618c5cfd..0000000000
--- a/c/src/tests/samples/README
+++ /dev/null
@@ -1,73 +0,0 @@
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and distribution 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/c/src/tests/samples/base_mp/Makefile.in b/c/src/tests/samples/base_mp/Makefile.in
deleted file mode 100644
index 9090167761..0000000000
--- a/c/src/tests/samples/base_mp/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=node1 node2
diff --git a/c/src/tests/samples/base_mp/apptask.c b/c/src/tests/samples/base_mp/apptask.c
deleted file mode 100644
index c4ffaa1625..0000000000
--- a/c/src/tests/samples/base_mp/apptask.c
+++ /dev/null
@@ -1,37 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 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/c/src/tests/samples/base_mp/init.c b/c/src/tests/samples/base_mp/init.c
deleted file mode 100644
index 58f66e76e5..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_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/c/src/tests/samples/base_mp/node1/Makefile.in b/c/src/tests/samples/base_mp/node1/Makefile.in
deleted file mode 100644
index c0f6a761b5..0000000000
--- a/c/src/tests/samples/base_mp/node1/Makefile.in
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=1
-SAMPLE=base_mp
-PGM=${ARCH}/$(SAMPLE)-node$(NODE).exe
-
-MANAGERS=io mp
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init apptask
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/samples
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/samples/base_mp/node1/base_mp.doc b/c/src/tests/samples/base_mp/node1/base_mp.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/samples/base_mp/node1/base_mp.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/samples/base_mp/node1/base_mp.scn b/c/src/tests/samples/base_mp/node1/base_mp.scn
deleted file mode 100644
index a2d2f359be..0000000000
--- a/c/src/tests/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/c/src/tests/samples/base_mp/node2/Makefile.in b/c/src/tests/samples/base_mp/node2/Makefile.in
deleted file mode 100644
index 67c98aeeef..0000000000
--- a/c/src/tests/samples/base_mp/node2/Makefile.in
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@:@srcdir@/..
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-NODE=2
-SAMPLE=base_mp
-PGM=${ARCH}/$(SAMPLE)-node$(NODE).exe
-
-MANAGERS=io mp
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init apptask
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES += -DNODE_NUMBER=$(NODE)
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/samples
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/samples/base_mp/node2/base_mp.doc b/c/src/tests/samples/base_mp/node2/base_mp.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/samples/base_mp/node2/base_mp.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/samples/base_mp/node2/base_mp.scn b/c/src/tests/samples/base_mp/node2/base_mp.scn
deleted file mode 100644
index 95bc96a808..0000000000
--- a/c/src/tests/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/c/src/tests/samples/base_mp/system.h b/c/src/tests/samples/base_mp/system.h
deleted file mode 100644
index 27088d078c..0000000000
--- a/c/src/tests/samples/base_mp/system.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Application_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-/*
- * Put the overrides of default configuration parameters here.
- */
-
-#include <confdefs.h>
-
-/* variables */
-
-TEST_EXTERN rtems_id Global_variable; /* example global variable */
-
-/* end of include file */
diff --git a/c/src/tests/samples/base_sp/Makefile.in b/c/src/tests/samples/base_sp/Makefile.in
deleted file mode 100644
index 50630816f4..0000000000
--- a/c/src/tests/samples/base_sp/Makefile.in
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-SAMPLE=base_sp
-PGM=${ARCH}/$(SAMPLE).exe
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init apptask
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/samples
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
-
diff --git a/c/src/tests/samples/base_sp/apptask.c b/c/src/tests/samples/base_sp/apptask.c
deleted file mode 100644
index 2a3196a37f..0000000000
--- a/c/src/tests/samples/base_sp/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: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 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/c/src/tests/samples/base_sp/base_sp.doc b/c/src/tests/samples/base_sp/base_sp.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/samples/base_sp/base_sp.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/samples/base_sp/base_sp.scn b/c/src/tests/samples/base_sp/base_sp.scn
deleted file mode 100644
index 117ddaecb8..0000000000
--- a/c/src/tests/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/c/src/tests/samples/base_sp/init.c b/c/src/tests/samples/base_sp/init.c
deleted file mode 100644
index c3f1aabefc..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 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/c/src/tests/samples/base_sp/system.h b/c/src/tests/samples/base_sp/system.h
deleted file mode 100644
index b0c56044ae..0000000000
--- a/c/src/tests/samples/base_sp/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Application_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Global_variable; /* example global variable */
-
-/* end of include file */
diff --git a/c/src/tests/samples/cdtest/Makefile.in b/c/src/tests/samples/cdtest/Makefile.in
deleted file mode 100644
index f8619da48c..0000000000
--- a/c/src/tests/samples/cdtest/Makefile.in
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-SAMPLE=cdtest
-PGM=${ARCH}/$(SAMPLE).exe
-
-MANAGERS=all
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-# C++ source names, if any, go here -- minus the .cc
-CC_PIECES=main
-CC_FILES=$(CC_PIECES:%=%.cc)
-CC_O_FILES=$(CC_PIECES:%=${ARCH}/%.o)
-H_FILES=system.h
-
-DOCTYPES=
-DOCS=$(DOCTYPES:%=$(SAMPLE).%)
-
-SRCS=$(DOCS) $(C_FILES) $(CC_FILES) $(H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES)
-
-PRINT_SRCS=$(DOCS)
-
-PGM=${ARCH}/$(SAMPLE).exe
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I$(LIBCC_INCLUDE)
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS += $(CPLUS_LD_LIBS)
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/samples
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/samples/cdtest/cdtest.scn b/c/src/tests/samples/cdtest/cdtest.scn
deleted file mode 100644
index a832a72372..0000000000
--- a/c/src/tests/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/c/src/tests/samples/cdtest/init.c b/c/src/tests/samples/cdtest/init.c
deleted file mode 100644
index 4d408147cc..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <stdio.h>
diff --git a/c/src/tests/samples/cdtest/main.cc b/c/src/tests/samples/cdtest/main.cc
deleted file mode 100644
index 19f7d50174..0000000000
--- a/c/src/tests/samples/cdtest/main.cc
+++ /dev/null
@@ -1,142 +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.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef RTEMS_TEST_IO_STREAM
-#include <iostream.h>
-#endif
-
-extern "C" {
-extern rtems_task main_task(rtems_task_argument);
-}
-
-static int num_inst = 0;
-
-class A {
-public:
- A(void)
- {
- num_inst++;
- printf(
- "Hey I'm in base class constructor number %d for %p.\n",
- num_inst,
- this
- );
-
- /*
- * Make sure we use some space
- */
-
- string = new char[50];
- sprintf(string, "Instantiation order %d", num_inst);
- };
-
- virtual ~A()
- {
- printf(
- "Hey I'm in base class destructor number %d for %p.\n",
- num_inst,
- this
- );
- print();
- num_inst--;
- };
-
- virtual void print() { printf("%s\n", string); };
-
-protected:
- char *string;
-};
-
-class B : public A {
-public:
- B(void)
- {
- num_inst++;
- printf(
- "Hey I'm in derived class constructor number %d for %p.\n",
- num_inst,
- this
- );
-
- /*
- * Make sure we use some space
- */
-
- string = new char[50];
- sprintf(string, "Instantiation order %d", num_inst);
- };
-
- ~B()
- {
- printf(
- "Hey I'm in derived class destructor number %d for %p.\n",
- num_inst,
- this
- );
- print();
- num_inst--;
- };
-
- void print() { printf("Derived class - %s\n", string); }
-};
-
-
-A foo;
-B foobar;
-
-void
-cdtest(void)
-{
- A bar, blech, blah;
- B bleak;
-
-#ifdef RTEMS_TEST_IO_STREAM
- cout << "Testing a C++ I/O stream" << endl;
-#else
- printf("IO Stream not tested\n");
-#endif
-
- bar = blech;
-}
-
-//
-// main equivalent
-// It can not be called 'main' since the bsp owns that name
-// in many implementations in order to get global constructors
-// run.
-//
-
-
-rtems_task main_task(
- rtems_task_argument
-)
-{
- printf( "\n\n*** CONSTRUCTOR/DESTRUCTOR TEST ***\n" );
-
- cdtest();
-
- printf( "*** END OF CONSTRUCTOR/DESTRUCTOR TEST ***\n\n\n" );
-
- exit(0);
-}
diff --git a/c/src/tests/samples/cdtest/system.h b/c/src/tests/samples/cdtest/system.h
deleted file mode 100644
index 975be98a2f..0000000000
--- a/c/src/tests/samples/cdtest/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task main_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Global_variable; /* example global variable */
-
-/* end of include file */
diff --git a/c/src/tests/samples/hello/Makefile.in b/c/src/tests/samples/hello/Makefile.in
deleted file mode 100644
index f556dd49e3..0000000000
--- a/c/src/tests/samples/hello/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-SAMPLE=hello
-PGM=${ARCH}/$(SAMPLE).exe
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=doc scn
-DOCS=$(DOCTYPES:%=$(SAMPLE).%)
-
-SRCS=$(DOCS) $(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-PRINT_SRCS=$(DOCS)
-
-PGM=${ARCH}/$(SAMPLE).exe
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/samples
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/samples/hello/hello.doc b/c/src/tests/samples/hello/hello.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/samples/hello/hello.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/samples/hello/hello.scn b/c/src/tests/samples/hello/hello.scn
deleted file mode 100644
index d9e92d81d5..0000000000
--- a/c/src/tests/samples/hello/hello.scn
+++ /dev/null
@@ -1,3 +0,0 @@
-*** HELLO WORLD TEST ***
-Hello World
-*** END OF HELLO WORLD TEST ***
diff --git a/c/src/tests/samples/hello/init.c b/c/src/tests/samples/hello/init.c
deleted file mode 100644
index 3931c1a2bf..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <stdio.h>
-
-rtems_task Init(
- rtems_task_argument ignored
-)
-{
- printf( "\n\n*** HELLO WORLD TEST ***\n" );
- printf( "Hello World\n" );
- printf( "*** END OF HELLO WORLD TEST ***\n" );
- exit( 0 );
-}
diff --git a/c/src/tests/samples/hello/system.h b/c/src/tests/samples/hello/system.h
deleted file mode 100644
index 94a854da15..0000000000
--- a/c/src/tests/samples/hello/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Global_variable; /* example global variable */
-
-/* end of include file */
diff --git a/c/src/tests/samples/paranoia/Makefile.in b/c/src/tests/samples/paranoia/Makefile.in
deleted file mode 100644
index 907d4aeefe..0000000000
--- a/c/src/tests/samples/paranoia/Makefile.in
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-SAMPLE=paranoia
-PGM=${ARCH}/$(SAMPLE).exe
-
-MANAGERS=all
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init paranoia
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=doc
-DOCS=$(DOCTYPES:%=$(SAMPLE).%)
-
-SRCS=$(DOCS) $(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-PRINT_SRCS=$(DOCS)
-
-PGM=${ARCH}/$(SAMPLE).exe
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-# -DCYGNUS turns on more verbose msgs
-#
-
-DEFINES += -DNOSIGNAL -DCYGNUS -DNOMAIN
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS += $(LIBC_LIBM)
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/samples
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/samples/paranoia/init.c b/c/src/tests/samples/paranoia/init.c
deleted file mode 100644
index c562e9c44a..0000000000
--- a/c/src/tests/samples/paranoia/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 test, it should also be set to a known
- * value by this function.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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"
-
-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/c/src/tests/samples/paranoia/paranoia.c b/c/src/tests/samples/paranoia/paranoia.c
deleted file mode 100644
index 67228436e1..0000000000
--- a/c/src/tests/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 <stdio.h>
-#include <string.h>
-
-#if defined(solaris2)
-#include <math.h>
-#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 <reent.h>
-struct _reent libm_reent = _REENT_INIT(libm_reent);
-struct _reent *_impure_ptr = &libm_reent;
-#endif
-
-#ifndef NOSIGNAL
-#include <signal.h>
-#include <setjmp.h>
-#else /* NOSIGNAL */
-#define longjmp(e,v)
-#define setjmp(e) 0
-#define jmp_buf int
-#endif /* NOSIGNAL */
-
-#ifdef SINGLE_PRECISION
-#define FLOAT float
-#define FABS(x) (float)fabs((double)(x))
-#define FLOOR(x) (float)floor((double)(x))
-#define LOG(x) (float)log((double)(x))
-#define POW(x,y) (float)pow((double)(x),(double)(y))
-#define SQRT(x) (float)sqrt((double)(x))
-#else /* !SINGLE_PRECISION */
-#define FLOAT double
-#define FABS(x) fabs(x)
-#define FLOOR(x) floor(x)
-#define LOG(x) log(x)
-#define POW(x,y) pow(x,y)
-#define SQRT(x) sqrt(x)
-#endif /* SINGLE_PRECISION */
-
-jmp_buf ovfl_buf;
-extern double fabs (), floor (), log (), pow (), sqrt ();
-extern void exit ();
-typedef void (*Sig_type) ();
-FLOAT Sign (), Random ();
-extern void BadCond ();
-extern void SqXMinX ();
-extern void TstCond ();
-extern void notify ();
-extern int read ();
-extern void Characteristics ();
-extern void Heading ();
-extern void History ();
-extern void Instructions ();
-extern void IsYeqX ();
-extern void NewD ();
-extern void Pause ();
-extern void PrintIfNPositive ();
-extern void SR3750 ();
-extern void SR3980 ();
-extern void TstPtUf ();
-
-Sig_type sigsave;
-
-#define KEYBOARD 0
-
-FLOAT Radix, BInvrse, RadixD2, BMinusU2;
-
-/*Small floating point constants.*/
-FLOAT Zero = 0.0;
-FLOAT Half = 0.5;
-FLOAT One = 1.0;
-FLOAT Two = 2.0;
-FLOAT Three = 3.0;
-FLOAT Four = 4.0;
-FLOAT Five = 5.0;
-FLOAT Eight = 8.0;
-FLOAT Nine = 9.0;
-FLOAT TwentySeven = 27.0;
-FLOAT ThirtyTwo = 32.0;
-FLOAT TwoForty = 240.0;
-FLOAT MinusOne = -1.0;
-FLOAT OneAndHalf = 1.5;
-
-/*Integer constants*/
-int NoTrials = 20; /*Number of tests for commutativity. */
-#define False 0
-#define True 1
-
-/*
- * Definitions for declared types
- * Guard == (Yes, No);
- * Rounding == (Chopped, Rounded, Other);
- * Message == packed array [1..40] of char;
- * Class == (Flaw, Defect, Serious, Failure);
- */
-#define Yes 1
-#define No 0
-#define Chopped 2
-#define Rounded 1
-#define Other 0
-#define Flaw 3
-#define Defect 2
-#define Serious 1
-#define Failure 0
-typedef int Guard, Rounding, Class;
-typedef char Message;
-
-/* Declarations of Variables */
-int Indx;
-char ch[8];
-FLOAT AInvrse, A1;
-FLOAT C, CInvrse;
-FLOAT D, FourD;
-FLOAT E0, E1, Exp2, E3, MinSqEr;
-FLOAT SqEr, MaxSqEr, E9;
-FLOAT Third;
-FLOAT F6, F9;
-FLOAT H, HInvrse;
-int I;
-FLOAT StickyBit, J;
-FLOAT MyZero;
-FLOAT Precision;
-FLOAT Q, Q9;
-FLOAT R, Random9;
-FLOAT T, Underflow, S;
-FLOAT OneUlp, UfThold, U1, U2;
-FLOAT V, V0, V9;
-FLOAT W;
-FLOAT X, X1, X2, X8, Random1;
-FLOAT Y, Y1, Y2, Random2;
-FLOAT Z, PseudoZero, Z1, Z2, Z9;
-int ErrCnt[4];
-int fpecount;
-int Milestone;
-int PageNo;
-int M, N, N1;
-Guard GMult, GDiv, GAddSub;
-Rounding RMult, RDiv, RAddSub, RSqrt;
-int Break, Done, NotMonot, Monot, Anomaly, IEEE, SqRWrng, UfNGrad;
-
-/* Computed constants.
- * U1 gap below 1.0, i.e, 1.0 - U1 is next number below 1.0
- * U2 gap above 1.0, i.e, 1.0 + U2 is next number above 1.0
- */
-
-int batchmode; /* global batchmode test */
-
-/* program name and version variables and macro */
-char *temp;
-char *program_name;
-char *program_vers;
-
-#ifndef VERSION
-#define VERSION "1.1 [cygnus]"
-#endif /* VERSION */
-
-#define basename(cp) ((temp=(char *)strrchr((cp), '/')) ? temp+1 : (cp))
-
-#ifndef BATCHMODE
-# ifdef CYGNUS
-# define BATCHMODE
-# endif
-#endif
-
-/* floating point exception receiver */
-void
-_sigfpe (x)
-int x;
-{
- fpecount++;
- printf ("\n* * * FLOATING-POINT ERROR %d * * *\n", x);
- fflush (stdout);
- if (sigsave) {
-#ifndef NOSIGNAL
- signal (SIGFPE, sigsave);
-#endif /* NOSIGNAL */
- sigsave = 0;
- longjmp (ovfl_buf, 1);
- }
- exit (1);
-}
-
-#ifdef NOMAIN
-#define main paranoia
-#endif
-
-int
-main (argc, argv)
-int argc;
-char **argv;
-{
- /* First two assignments use integer right-hand sides. */
- Zero = 0;
- One = 1;
- Two = One + One;
- Three = Two + One;
- Four = Three + One;
- Five = Four + One;
- Eight = Four + Four;
- Nine = Three * Three;
- TwentySeven = Nine * Three;
- ThirtyTwo = Four * Eight;
- TwoForty = Four * Five * Three * Four;
- MinusOne = -One;
- Half = One / Two;
- OneAndHalf = One + Half;
- ErrCnt[Failure] = 0;
- ErrCnt[Serious] = 0;
- ErrCnt[Defect] = 0;
- ErrCnt[Flaw] = 0;
- PageNo = 1;
-
-#ifdef BATCHMODE
- batchmode = 1; /* run test in batchmode? */
-#else /* !BATCHMODE */
- batchmode = 0; /* run test interactively */
-#endif /* BATCHMODE */
-
- program_name = basename (argv[0]);
- program_vers = VERSION;
-
- printf ("%s version %s\n", program_name, program_vers);
-
- /*=============================================*/
- Milestone = 0;
- /*=============================================*/
-#ifndef NOSIGNAL
- signal (SIGFPE, _sigfpe);
-#endif
-
- if (!batchmode) {
- Instructions ();
- Pause ();
- Heading ();
- Instructions ();
- Pause ();
- Heading ();
- Pause ();
- Characteristics ();
- Pause ();
- History ();
- Pause ();
- }
-
- /*=============================================*/
- Milestone = 7;
- /*=============================================*/
- printf ("Program is now RUNNING tests on small integers:\n");
- TstCond (Failure, (Zero + Zero == Zero) && (One - One == Zero)
- && (One > Zero) && (One + One == Two),
- "0+0 != 0, 1-1 != 0, 1 <= 0, or 1+1 != 2");
- Z = -Zero;
- if (Z != 0.0) {
- ErrCnt[Failure] = ErrCnt[Failure] + 1;
- printf ("Comparison alleges that -0.0 is Non-zero!\n");
- U1 = 0.001;
- Radix = 1;
- TstPtUf ();
- }
- TstCond (Failure, (Three == Two + One) && (Four == Three + One)
- && (Four + Two * (-Two) == Zero)
- && (Four - Three - One == Zero),
- "3 != 2+1, 4 != 3+1, 4+2*(-2) != 0, or 4-3-1 != 0");
- TstCond (Failure, (MinusOne == (0 - One))
- && (MinusOne + One == Zero) && (One + MinusOne == Zero)
- && (MinusOne + FABS (One) == Zero)
- && (MinusOne + MinusOne * MinusOne == Zero),
- "-1+1 != 0, (-1)+abs(1) != 0, or -1+(-1)*(-1) != 0");
- TstCond (Failure, Half + MinusOne + Half == Zero,
- "1/2 + (-1) + 1/2 != 0");
- /*=============================================*/
- Milestone = 10;
- /*=============================================*/
- TstCond (Failure, (Nine == Three * Three)
- && (TwentySeven == Nine * Three) && (Eight == Four + Four)
- && (ThirtyTwo == Eight * Four)
- && (ThirtyTwo - TwentySeven - Four - One == Zero),
- "9 != 3*3, 27 != 9*3, 32 != 8*4, or 32-27-4-1 != 0");
- TstCond (Failure, (Five == Four + One) &&
- (TwoForty == Four * Five * Three * Four)
- && (TwoForty / Three - Four * Four * Five == Zero)
- && (TwoForty / Four - Five * Three * Four == Zero)
- && (TwoForty / Five - Four * Three * Four == Zero),
- "5 != 4+1, 240/3 != 80, 240/4 != 60, or 240/5 != 48");
- if (ErrCnt[Failure] == 0) {
- printf ("-1, 0, 1/2, 1, 2, 3, 4, 5, 9, 27, 32 & 240 are O.K.\n");
- printf ("\n");
- }
- printf ("Searching for Radix and Precision.\n");
- W = One;
- do {
- W = W + W;
- Y = W + One;
- Z = Y - W;
- Y = Z - One;
- }
- while (MinusOne + FABS (Y) < Zero);
- /*.. now W is just big enough that |((W+1)-W)-1| >= 1 ...*/
- Precision = Zero;
- Y = One;
- do {
- Radix = W + Y;
- Y = Y + Y;
- Radix = Radix - W;
- }
- while (Radix == Zero);
- if (Radix < Two)
- Radix = One;
- printf ("Radix = %f .\n", Radix);
- if (Radix != 1) {
- W = One;
- do {
- Precision = Precision + One;
- W = W * Radix;
- Y = W + One;
- }
- while ((Y - W) == One);
- }
- /*... now W == Radix^Precision is barely too big to satisfy (W+1)-W == 1
- ...*/
- U1 = One / W;
- U2 = Radix * U1;
- printf ("Closest relative separation found is U1 = %.7e .\n\n", U1);
- printf ("Recalculating radix and precision\n ");
-
- /*save old values*/
- E0 = Radix;
- E1 = U1;
- E9 = U2;
- E3 = Precision;
-
- X = Four / Three;
- Third = X - One;
- F6 = Half - Third;
- X = F6 + F6;
- X = FABS (X - Third);
- if (X < U2)
- X = U2;
-
- /*... now X = (unknown no.) ulps of 1+...*/
- do {
- U2 = X;
- Y = Half * U2 + ThirtyTwo * U2 * U2;
- Y = One + Y;
- X = Y - One;
- }
- while (!((U2 <= X) || (X <= Zero)));
-
- /*... now U2 == 1 ulp of 1 + ... */
- X = Two / Three;
- F6 = X - Half;
- Third = F6 + F6;
- X = Third - Half;
- X = FABS (X + F6);
- if (X < U1)
- X = U1;
-
- /*... now X == (unknown no.) ulps of 1 -... */
- do {
- U1 = X;
- Y = Half * U1 + ThirtyTwo * U1 * U1;
- Y = Half - Y;
- X = Half + Y;
- Y = Half - X;
- X = Half + Y;
- }
- while (!((U1 <= X) || (X <= Zero)));
- /*... now U1 == 1 ulp of 1 - ... */
- if (U1 == E1)
- printf ("confirms closest relative separation U1 .\n");
- else
- printf ("gets better closest relative separation U1 = %.7e .\n", U1);
- W = One / U1;
- F9 = (Half - U1) + Half;
- Radix = FLOOR (0.01 + U2 / U1);
- if (Radix == E0)
- printf ("Radix confirmed.\n");
- else
- printf ("MYSTERY: recalculated Radix = %.7e .\n", Radix);
- TstCond (Defect, Radix <= Eight + Eight,
- "Radix is too big: roundoff problems");
- TstCond (Flaw, (Radix == Two) || (Radix == 10)
- || (Radix == One), "Radix is not as good as 2 or 10");
- /*=============================================*/
- Milestone = 20;
- /*=============================================*/
- TstCond (Failure, F9 - Half < Half,
- "(1-U1)-1/2 < 1/2 is FALSE, prog. fails?");
- X = F9;
- I = 1;
- Y = X - Half;
- Z = Y - Half;
- TstCond (Failure, (X != One)
- || (Z == Zero), "Comparison is fuzzy,X=1 but X-1/2-1/2 != 0");
- X = One + U2;
- I = 0;
- /*=============================================*/
- Milestone = 25;
- /*=============================================*/
- /*... BMinusU2 = nextafter(Radix, 0) */
- BMinusU2 = Radix - One;
- BMinusU2 = (BMinusU2 - U2) + One;
- /* Purify Integers */
- if (Radix != One) {
- X = -TwoForty * LOG (U1) / LOG (Radix);
- Y = FLOOR (Half + X);
- if (FABS (X - Y) * Four < One)
- X = Y;
- Precision = X / TwoForty;
- Y = FLOOR (Half + Precision);
- if (FABS (Precision - Y) * TwoForty < Half)
- Precision = Y;
- }
- if ((Precision != FLOOR (Precision)) || (Radix == One)) {
- printf ("Precision cannot be characterized by an Integer number\n");
- printf ("of significant digits but, by itself, this is a minor flaw.\n");
- }
- if (Radix == One)
- printf ("logarithmic encoding has precision characterized solely by U1.\n");
- else
- printf ("The number of significant digits of the Radix is %f .\n",
- Precision);
- TstCond (Serious, U2 * Nine * Nine * TwoForty < One,
- "Precision worse than 5 decimal figures ");
- /*=============================================*/
- Milestone = 30;
- /*=============================================*/
- /* Test for extra-precise subepressions */
- X = FABS (((Four / Three - One) - One / Four) * Three - One / Four);
- do {
- Z2 = X;
- X = (One + (Half * Z2 + ThirtyTwo * Z2 * Z2)) - One;
- }
- while (!((Z2 <= X) || (X <= Zero)));
- X = Y = Z = FABS ((Three / Four - Two / Three) * Three - One / Four);
- do {
- Z1 = Z;
- Z = (One / Two - ((One / Two - (Half * Z1 + ThirtyTwo * Z1 * Z1))
- + One / Two)) + One / Two;
- }
- while (!((Z1 <= Z) || (Z <= Zero)));
- do {
- do {
- Y1 = Y;
- Y = (Half - ((Half - (Half * Y1 + ThirtyTwo * Y1 * Y1)) + Half
- )) + Half;
- }
- while (!((Y1 <= Y) || (Y <= Zero)));
- X1 = X;
- X = ((Half * X1 + ThirtyTwo * X1 * X1) - F9) + F9;
- }
- while (!((X1 <= X) || (X <= Zero)));
- if ((X1 != Y1) || (X1 != Z1)) {
- BadCond (Serious, "Disagreements among the values X1, Y1, Z1,\n");
- printf ("respectively %.7e, %.7e, %.7e,\n", X1, Y1, Z1);
- printf ("are symptoms of inconsistencies introduced\n");
- printf ("by extra-precise evaluation of arithmetic subexpressions.\n");
- notify ("Possibly some part of this");
- if ((X1 == U1) || (Y1 == U1) || (Z1 == U1))
- printf (
- "That feature is not tested further by this program.\n");
- } else {
- if ((Z1 != U1) || (Z2 != U2)) {
- if ((Z1 >= U1) || (Z2 >= U2)) {
- BadCond (Failure, "");
- notify ("Precision");
- printf ("\tU1 = %.7e, Z1 - U1 = %.7e\n", U1, Z1 - U1);
- printf ("\tU2 = %.7e, Z2 - U2 = %.7e\n", U2, Z2 - U2);
- } else {
- if ((Z1 <= Zero) || (Z2 <= Zero)) {
- printf ("Because of unusual Radix = %f", Radix);
- printf (", or exact rational arithmetic a result\n");
- printf ("Z1 = %.7e, or Z2 = %.7e ", Z1, Z2);
- notify ("of an\nextra-precision");
- }
- if (Z1 != Z2 || Z1 > Zero) {
- X = Z1 / U1;
- Y = Z2 / U2;
- if (Y > X)
- X = Y;
- Q = -LOG (X);
- printf ("Some subexpressions appear to be calculated extra\n");
- printf ("precisely with about %g extra B-digits, i.e.\n",
- (Q / LOG (Radix)));
- printf ("roughly %g extra significant decimals.\n",
- Q / LOG (10.));
- }
- printf ("That feature is not tested further by this program.\n");
- }
- }
- }
- Pause ();
- /*=============================================*/
- Milestone = 35;
- /*=============================================*/
- if (Radix >= Two) {
- X = W / (Radix * Radix);
- Y = X + One;
- Z = Y - X;
- T = Z + U2;
- X = T - Z;
- TstCond (Failure, X == U2,
- "Subtraction is not normalized X=Y,X+Z != Y+Z!");
- if (X == U2)
- printf (
- "Subtraction appears to be normalized, as it should be.");
- }
- printf ("\nChecking for guard digit in *, /, and -.\n");
- Y = F9 * One;
- Z = One * F9;
- X = F9 - Half;
- Y = (Y - Half) - X;
- Z = (Z - Half) - X;
- X = One + U2;
- T = X * Radix;
- R = Radix * X;
- X = T - Radix;
- X = X - Radix * U2;
- T = R - Radix;
- T = T - Radix * U2;
- X = X * (Radix - One);
- T = T * (Radix - One);
- if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T == Zero))
- GMult = Yes;
- else {
- GMult = No;
- TstCond (Serious, False,
- "* lacks a Guard Digit, so 1*X != X");
- }
- Z = Radix * U2;
- X = One + Z;
- Y = FABS ((X + Z) - X * X) - U2;
- X = One - U2;
- Z = FABS ((X - U2) - X * X) - U1;
- TstCond (Failure, (Y <= Zero)
- && (Z <= Zero), "* gets too many final digits wrong.\n");
- Y = One - U2;
- X = One + U2;
- Z = One / Y;
- Y = Z - X;
- X = One / Three;
- Z = Three / Nine;
- X = X - Z;
- T = Nine / TwentySeven;
- Z = Z - T;
- TstCond (Defect, X == Zero && Y == Zero && Z == Zero,
- "Division lacks a Guard Digit, so error can exceed 1 ulp\n\
-or 1/3 and 3/9 and 9/27 may disagree");
- Y = F9 / One;
- X = F9 - Half;
- Y = (Y - Half) - X;
- X = One + U2;
- T = X / One;
- X = T - X;
- if ((X == Zero) && (Y == Zero) && (Z == Zero))
- GDiv = Yes;
- else {
- GDiv = No;
- TstCond (Serious, False,
- "Division lacks a Guard Digit, so X/1 != X");
- }
- X = One / (One + U2);
- Y = X - Half - Half;
- TstCond (Serious, Y < Zero,
- "Computed value of 1/1.000..1 >= 1");
- X = One - U2;
- Y = One + Radix * U2;
- Z = X * Radix;
- T = Y * Radix;
- R = Z / Radix;
- StickyBit = T / Radix;
- X = R - X;
- Y = StickyBit - Y;
- TstCond (Failure, X == Zero && Y == Zero,
- "* and/or / gets too many last digits wrong");
- Y = One - U1;
- X = One - F9;
- Y = One - Y;
- T = Radix - U2;
- Z = Radix - BMinusU2;
- T = Radix - T;
- if ((X == U1) && (Y == U1) && (Z == U2) && (T == U2))
- GAddSub = Yes;
- else {
- GAddSub = No;
- TstCond (Serious, False,
- "- lacks Guard Digit, so cancellation is obscured");
- }
- if (F9 != One && F9 - One >= Zero) {
- BadCond (Serious, "comparison alleges (1-U1) < 1 although\n");
- printf (" subtraction yields (1-U1) - 1 = 0 , thereby vitiating\n");
- printf (" such precautions against division by zero as\n");
- printf (" ... if (X == 1.0) {.....} else {.../(X-1.0)...}\n");
- }
- if (GMult == Yes && GDiv == Yes && GAddSub == Yes)
- printf (
- " *, /, and - appear to have guard digits, as they should.\n");
- /*=============================================*/
- Milestone = 40;
- /*=============================================*/
- Pause ();
- printf ("Checking rounding on multiply, divide and add/subtract.\n");
- RMult = Other;
- RDiv = Other;
- RAddSub = Other;
- RadixD2 = Radix / Two;
- A1 = Two;
- Done = False;
- do {
- AInvrse = Radix;
- do {
- X = AInvrse;
- AInvrse = AInvrse / A1;
- }
- while (!(FLOOR (AInvrse) != AInvrse));
- Done = (X == One) || (A1 > Three);
- if (!Done)
- A1 = Nine + One;
- }
- while (!(Done));
- if (X == One)
- A1 = Radix;
- AInvrse = One / A1;
- X = A1;
- Y = AInvrse;
- Done = False;
- do {
- Z = X * Y - Half;
- TstCond (Failure, Z == Half,
- "X * (1/X) differs from 1");
- Done = X == Radix;
- X = Radix;
- Y = One / X;
- }
- while (!(Done));
- Y2 = One + U2;
- Y1 = One - U2;
- X = OneAndHalf - U2;
- Y = OneAndHalf + U2;
- Z = (X - U2) * Y2;
- T = Y * Y1;
- Z = Z - X;
- T = T - X;
- X = X * Y2;
- Y = (Y + U2) * Y1;
- X = X - OneAndHalf;
- Y = Y - OneAndHalf;
- if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T <= Zero)) {
- X = (OneAndHalf + U2) * Y2;
- Y = OneAndHalf - U2 - U2;
- Z = OneAndHalf + U2 + U2;
- T = (OneAndHalf - U2) * Y1;
- X = X - (Z + U2);
- StickyBit = Y * Y1;
- S = Z * Y2;
- T = T - Y;
- Y = (U2 - Y) + StickyBit;
- Z = S - (Z + U2 + U2);
- StickyBit = (Y2 + U2) * Y1;
- Y1 = Y2 * Y1;
- StickyBit = StickyBit - Y2;
- Y1 = Y1 - Half;
- if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T == Zero)
- && (StickyBit == Zero) && (Y1 == Half)) {
- RMult = Rounded;
- printf ("Multiplication appears to round correctly.\n");
- } else if ((X + U2 == Zero) && (Y < Zero) && (Z + U2 == Zero)
- && (T < Zero) && (StickyBit + U2 == Zero)
- && (Y1 < Half)) {
- RMult = Chopped;
- printf ("Multiplication appears to chop.\n");
- } else
- printf ("* is neither chopped nor correctly rounded.\n");
- if ((RMult == Rounded) && (GMult == No))
- notify ("Multiplication");
- } else
- printf ("* is neither chopped nor correctly rounded.\n");
- /*=============================================*/
- Milestone = 45;
- /*=============================================*/
- Y2 = One + U2;
- Y1 = One - U2;
- Z = OneAndHalf + U2 + U2;
- X = Z / Y2;
- T = OneAndHalf - U2 - U2;
- Y = (T - U2) / Y1;
- Z = (Z + U2) / Y2;
- X = X - OneAndHalf;
- Y = Y - T;
- T = T / Y1;
- Z = Z - (OneAndHalf + U2);
- T = (U2 - OneAndHalf) + T;
- if (!((X > Zero) || (Y > Zero) || (Z > Zero) || (T > Zero))) {
- X = OneAndHalf / Y2;
- Y = OneAndHalf - U2;
- Z = OneAndHalf + U2;
- X = X - Y;
- T = OneAndHalf / Y1;
- Y = Y / Y1;
- T = T - (Z + U2);
- Y = Y - Z;
- Z = Z / Y2;
- Y1 = (Y2 + U2) / Y2;
- Z = Z - OneAndHalf;
- Y2 = Y1 - Y2;
- Y1 = (F9 - U1) / F9;
- if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T == Zero)
- && (Y2 == Zero) && (Y2 == Zero)
- && (Y1 - Half == F9 - Half)) {
- RDiv = Rounded;
- printf ("Division appears to round correctly.\n");
- if (GDiv == No)
- notify ("Division");
- } else if ((X < Zero) && (Y < Zero) && (Z < Zero) && (T < Zero)
- && (Y2 < Zero) && (Y1 - Half < F9 - Half)) {
- RDiv = Chopped;
- printf ("Division appears to chop.\n");
- }
- }
- if (RDiv == Other)
- printf ("/ is neither chopped nor correctly rounded.\n");
- BInvrse = One / Radix;
- TstCond (Failure, (BInvrse * Radix - Half == Half),
- "Radix * ( 1 / Radix ) differs from 1");
- /*=============================================*/
- Milestone = 50;
- /*=============================================*/
- TstCond (Failure, ((F9 + U1) - Half == Half)
- && ((BMinusU2 + U2) - One == Radix - One),
- "Incomplete carry-propagation in Addition");
- X = One - U1 * U1;
- Y = One + U2 * (One - U2);
- Z = F9 - Half;
- X = (X - Half) - Z;
- Y = Y - One;
- if ((X == Zero) && (Y == Zero)) {
- RAddSub = Chopped;
- printf ("Add/Subtract appears to be chopped.\n");
- }
- if (GAddSub == Yes) {
- X = (Half + U2) * U2;
- Y = (Half - U2) * U2;
- X = One + X;
- Y = One + Y;
- X = (One + U2) - X;
- Y = One - Y;
- if ((X == Zero) && (Y == Zero)) {
- X = (Half + U2) * U1;
- Y = (Half - U2) * U1;
- X = One - X;
- Y = One - Y;
- X = F9 - X;
- Y = One - Y;
- if ((X == Zero) && (Y == Zero)) {
- RAddSub = Rounded;
- printf ("Addition/Subtraction appears to round correctly.\n");
- if (GAddSub == No)
- notify ("Add/Subtract");
- } else
- printf ("Addition/Subtraction neither rounds nor chops.\n");
- } else
- printf ("Addition/Subtraction neither rounds nor chops.\n");
- } else
- printf ("Addition/Subtraction neither rounds nor chops.\n");
- S = One;
- X = One + Half * (One + Half);
- Y = (One + U2) * Half;
- Z = X - Y;
- T = Y - X;
- StickyBit = Z + T;
- if (StickyBit != Zero) {
- S = Zero;
- BadCond (Flaw, "(X - Y) + (Y - X) is non zero!\n");
- }
- StickyBit = Zero;
- if ((GMult == Yes) && (GDiv == Yes) && (GAddSub == Yes)
- && (RMult == Rounded) && (RDiv == Rounded)
- && (RAddSub == Rounded) && (FLOOR (RadixD2) == RadixD2)) {
- printf ("Checking for sticky bit.\n");
- X = (Half + U1) * U2;
- Y = Half * U2;
- Z = One + Y;
- T = One + X;
- if ((Z - One <= Zero) && (T - One >= U2)) {
- Z = T + Y;
- Y = Z - X;
- if ((Z - T >= U2) && (Y - T == Zero)) {
- X = (Half + U1) * U1;
- Y = Half * U1;
- Z = One - Y;
- T = One - X;
- if ((Z - One == Zero) && (T - F9 == Zero)) {
- Z = (Half - U1) * U1;
- T = F9 - Z;
- Q = F9 - Y;
- if ((T - F9 == Zero) && (F9 - U1 - Q == Zero)) {
- Z = (One + U2) * OneAndHalf;
- T = (OneAndHalf + U2) - Z + U2;
- X = One + Half / Radix;
- Y = One + Radix * U2;
- Z = X * Y;
- if (T == Zero && X + Radix * U2 - Z == Zero) {
- if (Radix != Two) {
- X = Two + U2;
- Y = X / Two;
- if ((Y - One == Zero))
- StickyBit = S;
- } else
- StickyBit = S;
- }
- }
- }
- }
- }
- }
- if (StickyBit == One)
- printf ("Sticky bit apparently used correctly.\n");
- else
- printf ("Sticky bit used incorrectly or not at all.\n");
- TstCond (Flaw, !(GMult == No || GDiv == No || GAddSub == No ||
- RMult == Other || RDiv == Other || RAddSub == Other),
- "lack(s) of guard digits or failure(s) to correctly round or chop\n\
-(noted above) count as one flaw in the final tally below");
- /*=============================================*/
- Milestone = 60;
- /*=============================================*/
- printf ("\n");
- printf ("Does Multiplication commute? ");
- printf ("Testing on %d random pairs.\n", NoTrials);
- Random9 = SQRT (3.0);
- Random1 = Third;
- I = 1;
- do {
- X = Random ();
- Y = Random ();
- Z9 = Y * X;
- Z = X * Y;
- Z9 = Z - Z9;
- I = I + 1;
- }
- while (!((I > NoTrials) || (Z9 != Zero)));
- if (I == NoTrials) {
- Random1 = One + Half / Three;
- Random2 = (U2 + U1) + One;
- Z = Random1 * Random2;
- Y = Random2 * Random1;
- Z9 = (One + Half / Three) * ((U2 + U1) + One) - (One + Half /
- Three) * ((U2 + U1) + One);
- }
- if (!((I == NoTrials) || (Z9 == Zero)))
- BadCond (Defect, "X * Y == Y * X trial fails.\n");
- else
- printf (" No failures found in %d integer pairs.\n", NoTrials);
- /*=============================================*/
- Milestone = 70;
- /*=============================================*/
- printf ("\nRunning test of square root(x).\n");
- TstCond (Failure, (Zero == SQRT (Zero))
- && (-Zero == SQRT (-Zero))
- && (One == SQRT (One)), "Square root of 0.0, -0.0 or 1.0 wrong");
- MinSqEr = Zero;
- MaxSqEr = Zero;
- J = Zero;
- X = Radix;
- OneUlp = U2;
- SqXMinX (Serious);
- X = BInvrse;
- OneUlp = BInvrse * U1;
- SqXMinX (Serious);
- X = U1;
- OneUlp = U1 * U1;
- SqXMinX (Serious);
- if (J != Zero)
- Pause ();
- printf ("Testing if sqrt(X * X) == X for %d Integers X.\n", NoTrials);
- J = Zero;
- X = Two;
- Y = Radix;
- if ((Radix != One))
- do {
- X = Y;
- Y = Radix * Y;
- }
- while (!((Y - X >= NoTrials)));
- OneUlp = X * U2;
- I = 1;
- while (I <= NoTrials) {
- X = X + One;
- SqXMinX (Defect);
- if (J > Zero)
- break;
- I = I + 1;
- }
- printf ("Test for sqrt monotonicity.\n");
- I = -1;
- X = BMinusU2;
- Y = Radix;
- Z = Radix + Radix * U2;
- NotMonot = False;
- Monot = False;
- while (!(NotMonot || Monot)) {
- I = I + 1;
- X = SQRT (X);
- Q = SQRT (Y);
- Z = SQRT (Z);
- if ((X > Q) || (Q > Z))
- NotMonot = True;
- else {
- Q = FLOOR (Q + Half);
- if ((I > 0) || (Radix == Q * Q))
- Monot = True;
- else if (I > 0) {
- if (I > 1)
- Monot = True;
- else {
- Y = Y * BInvrse;
- X = Y - U1;
- Z = Y + U1;
- }
- } else {
- Y = Q;
- X = Y - U2;
- Z = Y + U2;
- }
- }
- }
- if (Monot)
- printf ("sqrt has passed a test for Monotonicity.\n");
- else {
- BadCond (Defect, "");
- printf ("sqrt(X) is non-monotonic for X near %.7e .\n", Y);
- }
- /*=============================================*/
- Milestone = 80;
- /*=============================================*/
- MinSqEr = MinSqEr + Half;
- MaxSqEr = MaxSqEr - Half;
- Y = (SQRT (One + U2) - One) / U2;
- SqEr = (Y - One) + U2 / Eight;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- SqEr = Y + U2 / Eight;
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- Y = ((SQRT (F9) - U2) - (One - U2)) / U1;
- SqEr = Y + U1 / Eight;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- SqEr = (Y + One) + U1 / Eight;
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- OneUlp = U2;
- X = OneUlp;
- for (Indx = 1; Indx <= 3; ++Indx) {
- Y = SQRT ((X + U1 + X) + F9);
- Y = ((Y - U2) - ((One - U2) + X)) / OneUlp;
- Z = ((U1 - X) + F9) * Half * X * X / OneUlp;
- SqEr = (Y + Half) + Z;
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- SqEr = (Y - Half) + Z;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- if (((Indx == 1) || (Indx == 3)))
- X = OneUlp * Sign (X) * FLOOR (Eight / (Nine * SQRT (OneUlp)));
- else {
- OneUlp = U1;
- X = -OneUlp;
- }
- }
- /*=============================================*/
- Milestone = 85;
- /*=============================================*/
- SqRWrng = False;
- Anomaly = False;
- RSqrt = Other; /* ~dgh */
- if (Radix != One) {
- printf ("Testing whether sqrt is rounded or chopped.\n");
- D = FLOOR (Half + POW (Radix, One + Precision - FLOOR (Precision)));
- /* ... == Radix^(1 + fract) if (Precision == Integer + fract. */
- X = D / Radix;
- Y = D / A1;
- if ((X != FLOOR (X)) || (Y != FLOOR (Y))) {
- Anomaly = True;
- } else {
- X = Zero;
- Z2 = X;
- Y = One;
- Y2 = Y;
- Z1 = Radix - One;
- FourD = Four * D;
- do {
- if (Y2 > Z2) {
- Q = Radix;
- Y1 = Y;
- do {
- X1 = FABS (Q + FLOOR (Half - Q / Y1) * Y1);
- Q = Y1;
- Y1 = X1;
- }
- while (!(X1 <= Zero));
- if (Q <= One) {
- Z2 = Y2;
- Z = Y;
- }
- }
- Y = Y + Two;
- X = X + Eight;
- Y2 = Y2 + X;
- if (Y2 >= FourD)
- Y2 = Y2 - FourD;
- }
- while (!(Y >= D));
- X8 = FourD - Z2;
- Q = (X8 + Z * Z) / FourD;
- X8 = X8 / Eight;
- if (Q != FLOOR (Q))
- Anomaly = True;
- else {
- Break = False;
- do {
- X = Z1 * Z;
- X = X - FLOOR (X / Radix) * Radix;
- if (X == One)
- Break = True;
- else
- Z1 = Z1 - One;
- }
- while (!(Break || (Z1 <= Zero)));
- if ((Z1 <= Zero) && (!Break))
- Anomaly = True;
- else {
- if (Z1 > RadixD2)
- Z1 = Z1 - Radix;
- do {
- NewD ();
- }
- while (!(U2 * D >= F9));
- if (D * Radix - D != W - D)
- Anomaly = True;
- else {
- Z2 = D;
- I = 0;
- Y = D + (One + Z) * Half;
- X = D + Z + Q;
- SR3750 ();
- Y = D + (One - Z) * Half + D;
- X = D - Z + D;
- X = X + Q + X;
- SR3750 ();
- NewD ();
- if (D - Z2 != W - Z2)
- Anomaly = True;
- else {
- Y = (D - Z2) + (Z2 + (One - Z) * Half);
- X = (D - Z2) + (Z2 - Z + Q);
- SR3750 ();
- Y = (One + Z) * Half;
- X = Q;
- SR3750 ();
- if (I == 0)
- Anomaly = True;
- }
- }
- }
- }
- }
- if ((I == 0) || Anomaly) {
- BadCond (Failure, "Anomalous arithmetic with Integer < ");
- printf ("Radix^Precision = %.7e\n", W);
- printf (" fails test whether sqrt rounds or chops.\n");
- SqRWrng = True;
- }
- }
- if (!Anomaly) {
- if (!((MinSqEr < Zero) || (MaxSqEr > Zero))) {
- RSqrt = Rounded;
- printf ("Square root appears to be correctly rounded.\n");
- } else {
- if ((MaxSqEr + U2 > U2 - Half) || (MinSqEr > Half)
- || (MinSqEr + Radix < Half))
- SqRWrng = True;
- else {
- RSqrt = Chopped;
- printf ("Square root appears to be chopped.\n");
- }
- }
- }
- if (SqRWrng) {
- printf ("Square root is neither chopped nor correctly rounded.\n");
- printf ("Observed errors run from %.7e ", MinSqEr - Half);
- printf ("to %.7e ulps.\n", Half + MaxSqEr);
- TstCond (Serious, MaxSqEr - MinSqEr < Radix * Radix,
- "sqrt gets too many last digits wrong");
- }
- /*=============================================*/
- Milestone = 90;
- /*=============================================*/
- Pause ();
- printf ("Testing powers Z^i for small Integers Z and i.\n");
- N = 0;
- /* ... test powers of zero. */
- I = 0;
- Z = -Zero;
- M = 3;
- Break = False;
- do {
- X = One;
- SR3980 ();
- if (I <= 10) {
- I = 1023;
- SR3980 ();
- }
- if (Z == MinusOne)
- Break = True;
- else {
- Z = MinusOne;
- /* .. if(-1)^N is invalid, replace MinusOne by One. */
- I = -4;
- }
- }
- while (!Break);
- PrintIfNPositive ();
- N1 = N;
- N = 0;
- Z = A1;
- M = (int) FLOOR (Two * LOG (W) / LOG (A1));
- Break = False;
- do {
- X = Z;
- I = 1;
- SR3980 ();
- if (Z == AInvrse)
- Break = True;
- else
- Z = AInvrse;
- }
- while (!(Break));
- /*=============================================*/
- Milestone = 100;
- /*=============================================*/
- /* Powers of Radix have been tested, */
- /* next try a few primes */
- M = NoTrials;
- Z = Three;
- do {
- X = Z;
- I = 1;
- SR3980 ();
- do {
- Z = Z + Two;
- }
- while (Three * FLOOR (Z / Three) == Z);
- }
- while (Z < Eight * Three);
- if (N > 0) {
- printf ("Errors like this may invalidate financial calculations\n");
- printf ("\tinvolving interest rates.\n");
- }
- PrintIfNPositive ();
- N += N1;
- if (N == 0)
- printf ("... no discrepancies found.\n");
- if (N > 0)
- Pause ();
- else
- printf ("\n");
- /*=============================================*/
- Milestone = 110;
- /*=============================================*/
- printf ("Seeking Underflow thresholds UfThold and E0.\n");
- D = U1;
- if (Precision != FLOOR (Precision)) {
- D = BInvrse;
- X = Precision;
- do {
- D = D * BInvrse;
- X = X - One;
- }
- while (X > Zero);
- }
- Y = One;
- Z = D;
- /* ... D is power of 1/Radix < 1. */
- do {
- C = Y;
- Y = Z;
- Z = Y * Y;
- }
- while ((Y > Z) && (Z + Z > Z));
- Y = C;
- Z = Y * D;
- do {
- C = Y;
- Y = Z;
- Z = Y * D;
- }
- while ((Y > Z) && (Z + Z > Z));
- if (Radix < Two)
- HInvrse = Two;
- else
- HInvrse = Radix;
- H = One / HInvrse;
- /* ... 1/HInvrse == H == Min(1/Radix, 1/2) */
- CInvrse = One / C;
- E0 = C;
- Z = E0 * H;
- /* ...1/Radix^(BIG Integer) << 1 << CInvrse == 1/C */
- do {
- Y = E0;
- E0 = Z;
- Z = E0 * H;
- }
- while ((E0 > Z) && (Z + Z > Z));
- UfThold = E0;
- E1 = Zero;
- Q = Zero;
- E9 = U2;
- S = One + E9;
- D = C * S;
- if (D <= C) {
- E9 = Radix * U2;
- S = One + E9;
- D = C * S;
- if (D <= C) {
- BadCond (Failure, "multiplication gets too many last digits wrong.\n");
- Underflow = E0;
- Y1 = Zero;
- PseudoZero = Z;
- Pause ();
- }
- } else {
- Underflow = D;
- PseudoZero = Underflow * H;
- UfThold = Zero;
- do {
- Y1 = Underflow;
- Underflow = PseudoZero;
- if (E1 + E1 <= E1) {
- Y2 = Underflow * HInvrse;
- E1 = FABS (Y1 - Y2);
- Q = Y1;
- if ((UfThold == Zero) && (Y1 != Y2))
- UfThold = Y1;
- }
- PseudoZero = PseudoZero * H;
- }
- while ((Underflow > PseudoZero)
- && (PseudoZero + PseudoZero > PseudoZero));
- }
- /* Comment line 4530 .. 4560 */
- if (PseudoZero != Zero) {
- printf ("\n");
- Z = PseudoZero;
- /* ... Test PseudoZero for "phoney- zero" violates */
- /* ... PseudoZero < Underflow or PseudoZero < PseudoZero + PseudoZero
- ... */
- if (PseudoZero <= Zero) {
- BadCond (Failure, "Positive expressions can underflow to an\n");
- printf ("allegedly negative value\n");
- printf ("PseudoZero that prints out as: %g .\n", PseudoZero);
- X = -PseudoZero;
- if (X <= Zero) {
- printf ("But -PseudoZero, which should be\n");
- printf ("positive, isn't; it prints out as %g .\n", X);
- }
- } else {
- BadCond (Flaw, "Underflow can stick at an allegedly positive\n");
- printf ("value PseudoZero that prints out as %g .\n", PseudoZero);
- }
- TstPtUf ();
- }
- /*=============================================*/
- Milestone = 120;
- /*=============================================*/
- if (CInvrse * Y > CInvrse * Y1) {
- S = H * S;
- E0 = Underflow;
- }
- if (!((E1 == Zero) || (E1 == E0))) {
- BadCond (Defect, "");
- if (E1 < E0) {
- printf ("Products underflow at a higher");
- printf (" threshold than differences.\n");
- if (PseudoZero == Zero)
- E0 = E1;
- } else {
- printf ("Difference underflows at a higher");
- printf (" threshold than products.\n");
- }
- }
- printf ("Smallest strictly positive number found is E0 = %g .\n", E0);
- Z = E0;
- TstPtUf ();
- Underflow = E0;
- if (N == 1)
- Underflow = Y;
- I = 4;
- if (E1 == Zero)
- I = 3;
- if (UfThold == Zero)
- I = I - 2;
- UfNGrad = True;
- switch (I) {
- case 1:
- UfThold = Underflow;
- if ((CInvrse * Q) != ((CInvrse * Y) * S)) {
- UfThold = Y;
- BadCond (Failure, "Either accuracy deteriorates as numbers\n");
- printf ("approach a threshold = %.17e\n", UfThold);;
- printf (" coming down from %.17e\n", C);
- printf (" or else multiplication gets too many last digits wrong.\n");
- }
- Pause ();
- break;
-
- case 2:
- BadCond (Failure, "Underflow confuses Comparison, which alleges that\n");
- printf ("Q == Y while denying that |Q - Y| == 0; these values\n");
- printf ("print out as Q = %.17e, Y = %.17e .\n", Q, Y2);
- printf ("|Q - Y| = %.17e .\n", FABS (Q - Y2));
- UfThold = Q;
- break;
-
- case 3:
- X = X;
- break;
-
- case 4:
- if ((Q == UfThold) && (E1 == E0)
- && (FABS (UfThold - E1 / E9) <= E1)) {
- UfNGrad = False;
- printf ("Underflow is gradual; it incurs Absolute Error =\n");
- printf ("(roundoff in UfThold) < E0.\n");
- Y = E0 * CInvrse;
- Y = Y * (OneAndHalf + U2);
- X = CInvrse * (One + U2);
- Y = Y / X;
- IEEE = (Y == E0);
- }
- }
- if (UfNGrad) {
- printf ("\n");
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf)) {
- printf ("Underflow / UfThold failed!\n");
- R = H + H;
- } else
- R = SQRT (Underflow / UfThold);
- sigsave = 0;
- if (R <= H) {
- Z = R * UfThold;
- X = Z * (One + R * H * (One + H));
- } else {
- Z = UfThold;
- X = Z * (One + H * H * (One + H));
- }
- if (!((X == Z) || (X - Z != Zero))) {
- BadCond (Flaw, "");
- printf ("X = %.17e\n\tis not equal to Z = %.17e .\n", X, Z);
- Z9 = X - Z;
- printf ("yet X - Z yields %.17e .\n", Z9);
- printf (" Should this NOT signal Underflow, ");
- printf ("this is a SERIOUS DEFECT\nthat causes ");
- printf ("confusion when innocent statements like\n");;
- printf (" if (X == Z) ... else");
- printf (" ... (f(X) - f(Z)) / (X - Z) ...\n");
- printf ("encounter Division by Zero although actually\n");
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf))
- printf ("X / Z fails!\n");
- else
- printf ("X / Z = 1 + %g .\n", (X / Z - Half) - Half);
- sigsave = 0;
- }
- }
- printf ("The Underflow threshold is %.17e, %s\n", UfThold,
- " below which");
- printf ("calculation may suffer larger Relative error than ");
- printf ("merely roundoff.\n");
- Y2 = U1 * U1;
- Y = Y2 * Y2;
- Y2 = Y * U1;
- if (Y2 <= UfThold) {
- if (Y > E0) {
- BadCond (Defect, "");
- I = 5;
- } else {
- BadCond (Serious, "");
- I = 4;
- }
- printf ("Range is too narrow; U1^%d Underflows.\n", I);
- }
- /*=============================================*/
- Milestone = 130;
- /*=============================================*/
- Y = -FLOOR (Half - TwoForty * LOG (UfThold) / LOG (HInvrse)) / TwoForty;
- Y2 = Y + Y;
- printf ("Since underflow occurs below the threshold\n");
- printf ("UfThold = (%.17e) ^ (%.17e)\nonly underflow ", HInvrse, Y);
- printf ("should afflict the expression\n\t(%.17e) ^ (%.17e);\n",
- HInvrse, Y2);
- printf ("actually calculating yields:");
- if (setjmp (ovfl_buf)) {
- sigsave = 0;
- BadCond (Serious, "trap on underflow.\n");
- } else {
- sigsave = _sigfpe;
- V9 = POW (HInvrse, Y2);
- sigsave = 0;
- printf (" %.17e .\n", V9);
- if (!((V9 >= Zero) && (V9 <= (Radix + Radix + E9) * UfThold))) {
- BadCond (Serious, "this is not between 0 and underflow\n");
- printf (" threshold = %.17e .\n", UfThold);
- } else if (!(V9 > UfThold * (One + E9)))
- printf ("This computed value is O.K.\n");
- else {
- BadCond (Defect, "this is not between 0 and underflow\n");
- printf (" threshold = %.17e .\n", UfThold);
- }
- }
- /*=============================================*/
- Milestone = 140;
- /*=============================================*/
- printf ("\n");
- /* ...calculate Exp2 == exp(2) == 7.389056099... */
- X = Zero;
- I = 2;
- Y = Two * Three;
- Q = Zero;
- N = 0;
- do {
- Z = X;
- I = I + 1;
- Y = Y / (I + I);
- R = Y + Q;
- X = Z + R;
- Q = (Z - X) + R;
- }
- while (X > Z);
- Z = (OneAndHalf + One / Eight) + X / (OneAndHalf * ThirtyTwo);
- X = Z * Z;
- Exp2 = X * X;
- X = F9;
- Y = X - U1;
- printf ("Testing X^((X + 1) / (X - 1)) vs. exp(2) = %.17e as X -> 1.\n",
- Exp2);
- for (I = 1;;) {
- Z = X - BInvrse;
- Z = (X + One) / (Z - (One - BInvrse));
- Q = POW (X, Z) - Exp2;
- if (FABS (Q) > TwoForty * U2) {
- N = 1;
- V9 = (X - BInvrse) - (One - BInvrse);
- BadCond (Defect, "Calculated");
- printf (" %.17e for\n", POW (X, Z));
- printf ("\t(1 + (%.17e) ^ (%.17e);\n", V9, Z);
- printf ("\tdiffers from correct value by %.17e .\n", Q);
- printf ("\tThis much error may spoil financial\n");
- printf ("\tcalculations involving tiny interest rates.\n");
- break;
- } else {
- Z = (Y - X) * Two + Y;
- X = Y;
- Y = Z;
- Z = One + (X - F9) * (X - F9);
- if (Z > One && I < NoTrials)
- I++;
- else {
- if (X > One) {
- if (N == 0)
- printf ("Accuracy seems adequate.\n");
- break;
- } else {
- X = One + U2;
- Y = U2 + U2;
- Y += X;
- I = 1;
- }
- }
- }
- }
- /*=============================================*/
- Milestone = 150;
- /*=============================================*/
- printf ("Testing powers Z^Q at four nearly extreme values.\n");
- N = 0;
- Z = A1;
- Q = FLOOR (Half - LOG (C) / LOG (A1));
- Break = False;
- do {
- X = CInvrse;
- Y = POW (Z, Q);
- IsYeqX ();
- Q = -Q;
- X = C;
- Y = POW (Z, Q);
- IsYeqX ();
- if (Z < One)
- Break = True;
- else
- Z = AInvrse;
- }
- while (!(Break));
- PrintIfNPositive ();
- if (N == 0)
- printf (" ... no discrepancies found.\n");
- printf ("\n");
-
- /*=============================================*/
- Milestone = 160;
- /*=============================================*/
- Pause ();
- printf ("Searching for Overflow threshold:\n");
- printf ("This may generate an error.\n");
- Y = -CInvrse;
- V9 = HInvrse * Y;
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf)) {
- I = 0;
- V9 = Y;
- goto overflow;
- }
- do {
- V = Y;
- Y = V9;
- V9 = HInvrse * Y;
- }
- while (V9 < Y);
- I = 1;
- overflow:
- sigsave = 0;
- Z = V9;
- printf ("Can `Z = -Y' overflow?\n");
- printf ("Trying it on Y = %.17e .\n", Y);
- V9 = -Y;
- V0 = V9;
- if (V - Y == V + V0)
- printf ("Seems O.K.\n");
- else {
- printf ("finds a ");
- BadCond (Flaw, "-(-Y) differs from Y.\n");
- }
- if (Z != Y) {
- BadCond (Serious, "");
- printf ("overflow past %.17e\n\tshrinks to %.17e .\n", Y, Z);
- }
- if (I) {
- Y = V * (HInvrse * U2 - HInvrse);
- Z = Y + ((One - HInvrse) * U2) * V;
- if (Z < V0)
- Y = Z;
- if (Y < V0)
- V = Y;
- if (V0 - V < V0)
- V = V0;
- } else {
- V = Y * (HInvrse * U2 - HInvrse);
- V = V + ((One - HInvrse) * U2) * Y;
- }
- printf ("Overflow threshold is V = %.17e .\n", V);
- if (I)
- printf ("Overflow saturates at V0 = %.17e .\n", V0);
- else
- printf ("There is no saturation value because \
-the system traps on overflow.\n");
- V9 = V * One;
- printf ("No Overflow should be signaled for V * 1 = %.17e\n", V9);
- V9 = V / One;
- printf (" nor for V / 1 = %.17e .\n", V9);
- printf ("Any overflow signal separating this * from the one\n");
- printf ("above is a DEFECT.\n");
- /*=============================================*/
- Milestone = 170;
- /*=============================================*/
- if (!(-V < V && -V0 < V0 && -UfThold < V && UfThold < V)) {
- BadCond (Failure, "Comparisons involving ");
- printf ("+-%g, +-%g\nand +-%g are confused by Overflow.",
- V, V0, UfThold);
- }
- /*=============================================*/
- Milestone = 175;
- /*=============================================*/
- printf ("\n");
- for (Indx = 1; Indx <= 3; ++Indx) {
- switch (Indx) {
- case 1:
- Z = UfThold;
- break;
- case 2:
- Z = E0;
- break;
- case 3:
- Z = PseudoZero;
- break;
- }
- if (Z != Zero) {
- V9 = SQRT (Z);
- Y = V9 * V9;
- if (Y / (One - Radix * E9) < Z
- || Y > (One + Radix * E9) * Z) { /* dgh: + E9 --> * E9 */
- if (V9 > U1)
- BadCond (Serious, "");
- else
- BadCond (Defect, "");
- printf ("Comparison alleges that what prints as Z = %.17e\n", Z);
- printf (" is too far from sqrt(Z) ^ 2 = %.17e .\n", Y);
- }
- }
- }
- /*=============================================*/
- Milestone = 180;
- /*=============================================*/
- for (Indx = 1; Indx <= 2; ++Indx) {
- if (Indx == 1)
- Z = V;
- else
- Z = V0;
- V9 = SQRT (Z);
- X = (One - Radix * E9) * V9;
- V9 = V9 * X;
- if (((V9 < (One - Two * Radix * E9) * Z) || (V9 > Z))) {
- Y = V9;
- if (X < W)
- BadCond (Serious, "");
- else
- BadCond (Defect, "");
- printf ("Comparison alleges that Z = %17e\n", Z);
- printf (" is too far from sqrt(Z) ^ 2 (%.17e) .\n", Y);
- }
- }
- /*=============================================*/
- Milestone = 190;
- /*=============================================*/
- Pause ();
- X = UfThold * V;
- Y = Radix * Radix;
- if (X * Y < One || X > Y) {
- if (X * Y < U1 || X > Y / U1)
- BadCond (Defect, "Badly");
- else
- BadCond (Flaw, "");
-
- printf (" unbalanced range; UfThold * V = %.17e\n\t%s\n",
- X, "is too far from 1.\n");
- }
- /*=============================================*/
- Milestone = 200;
- /*=============================================*/
- for (Indx = 1; Indx <= 5; ++Indx) {
- X = F9;
- switch (Indx) {
- case 2:
- X = One + U2;
- break;
- case 3:
- X = V;
- break;
- case 4:
- X = UfThold;
- break;
- case 5:
- X = Radix;
- }
- Y = X;
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf))
- printf (" X / X traps when X = %g\n", X);
- else {
- V9 = (Y / X - Half) - Half;
- if (V9 == Zero)
- continue;
- if (V9 == -U1 && Indx < 5)
- BadCond (Flaw, "");
- else
- BadCond (Serious, "");
- printf (" X / X differs from 1 when X = %.17e\n", X);
- printf (" instead, X / X - 1/2 - 1/2 = %.17e .\n", V9);
- }
- sigsave = 0;
- }
- /*=============================================*/
- Milestone = 210;
- /*=============================================*/
- MyZero = Zero;
- printf ("\n");
- printf ("What message and/or values does Division by Zero produce?\n");
-#ifndef BATCHMODE
- printf ("This can interupt your program. You can ");
- printf ("skip this part if you wish.\n");
- printf ("Do you wish to compute 1 / 0? ");
- fflush (stdout);
- read (KEYBOARD, ch, 8);
- if ((ch[0] == 'Y') || (ch[0] == 'y')) {
-#endif /* !BATCHMODE */
- sigsave = _sigfpe;
- printf (" Trying to compute 1 / 0 produces ...");
- if (!setjmp (ovfl_buf))
- printf (" %.7e .\n", One / MyZero);
- sigsave = 0;
-#ifndef BATCHMODE
- } else
- printf ("O.K.\n");
- printf ("\nDo you wish to compute 0 / 0? ");
- fflush (stdout);
- read (KEYBOARD, ch, 80);
- if ((ch[0] == 'Y') || (ch[0] == 'y')) {
-#endif /* !BATCHMODE */
- sigsave = _sigfpe;
- printf ("\n Trying to compute 0 / 0 produces ...");
- if (!setjmp (ovfl_buf))
- printf (" %.7e .\n", Zero / MyZero);
- sigsave = 0;
-#ifndef BATCHMODE
- } else
- printf ("O.K.\n");
-#endif /* !BATCHMODE */
- /*=============================================*/
- Milestone = 220;
- /*=============================================*/
-
- Pause ();
- printf ("\n");
- {
- static char *msg[] =
- {
- "FAILUREs encountered =",
- "SERIOUS DEFECTs discovered =",
- "DEFECTs discovered =",
- "FLAWs discovered ="};
- int i;
- for (i = 0; i < 4; i++)
- if (ErrCnt[i])
- printf ("The number of %-29s %d.\n",
- msg[i], ErrCnt[i]);
- }
-
- printf ("\n");
- if ((ErrCnt[Failure] + ErrCnt[Serious] + ErrCnt[Defect]
- + ErrCnt[Flaw]) > 0) {
- if ((ErrCnt[Failure] + ErrCnt[Serious] + ErrCnt[
- Defect] == 0) && (ErrCnt[Flaw] > 0)) {
- printf ("The arithmetic diagnosed seems ");
- printf ("Satisfactory though flawed.\n");
- }
- if ((ErrCnt[Failure] + ErrCnt[Serious] == 0)
- && (ErrCnt[Defect] > 0)) {
- printf ("The arithmetic diagnosed may be Acceptable\n");
- printf ("despite inconvenient Defects.\n");
- }
- if ((ErrCnt[Failure] + ErrCnt[Serious]) > 0) {
- printf ("The arithmetic diagnosed has ");
- printf ("unacceptable Serious Defects.\n");
- }
- if (ErrCnt[Failure] > 0) {
- printf ("Potentially fatal FAILURE may have spoiled this");
- printf (" program's subsequent diagnoses.\n");
- }
- } else {
-
- printf ("No failures, defects nor flaws have been discovered.\n");
- if (!((RMult == Rounded) && (RDiv == Rounded)
- && (RAddSub == Rounded) && (RSqrt == Rounded)))
- printf ("The arithmetic diagnosed seems Satisfactory.\n");
- else {
- if (StickyBit >= One &&
- (Radix - Two) * (Radix - Nine - One) == Zero) {
- printf ("Rounding appears to conform to ");
- printf ("the proposed IEEE standard P");
- if ((Radix == Two) &&
- ((Precision - Four * Three * Two) *
- (Precision - TwentySeven -
- TwentySeven + One) == Zero))
- printf ("754");
- else
- printf ("854");
- if (IEEE)
- printf (".\n");
- else {
- printf (",\nexcept for possibly Double Rounding");
- printf (" during Gradual Underflow.\n");
- }
- }
- printf ("The arithmetic diagnosed appears to be Excellent!\n");
- }
- }
-
- if (fpecount)
- printf ("\nA total of %d floating point exceptions were registered.\n",
- fpecount);
- printf ("END OF TEST.\n");
- return 0;
-}
-
-FLOAT
-Sign (X)
- FLOAT X;
-{
- return X >= 0. ? 1.0 : -1.0;
-}
-
-void
-Pause ()
-{
-#ifndef BATCHMODE
- char ch[8];
-
- printf ("\nTo continue, press RETURN");
- fflush (stdout);
- read (KEYBOARD, ch, 8);
-#endif /* !BATCHMODE */
-#ifndef CYGNUS
- printf ("\nDiagnosis resumes after milestone Number %d", Milestone);
- printf (" Page: %d\n\n", PageNo);
- ++Milestone;
- ++PageNo;
-#endif /* !CYGNUS */
-}
-
-void
-TstCond (K, Valid, T)
- int K, Valid;
- char *T;
-{
-#ifdef CYGNUS
- printf ("TEST: %s\n", T);
-#endif /* CYGNUS */
- if (!Valid) {
- BadCond (K, T);
- printf (".\n");
- }
-#ifdef CYGNUS
- printf ("PASS: %s\n", T);
-#endif /* CYGNUS */
-}
-
-void
-BadCond (K, T)
- int K;
- char *T;
-{
- static char *msg[] =
- {"FAILURE", "SERIOUS DEFECT", "DEFECT", "FLAW"};
-
- ErrCnt[K] = ErrCnt[K] + 1;
-#ifndef CYGNUS
- printf ("%s: %s", msg[K], T);
-#else
- printf ("ERROR: Severity: %s: %s", msg[K], T);
-#endif /* CYGNUS */
-}
-
-/*
- * Random computes
- * X = (Random1 + Random9)^5
- * Random1 = X - FLOOR(X) + 0.000005 * X;
- * and returns the new value of Random1
-*/
-FLOAT
-Random ()
-{
- FLOAT X, Y;
-
- X = Random1 + Random9;
- Y = X * X;
- Y = Y * Y;
- X = X * Y;
- Y = X - FLOOR (X);
- Random1 = Y + X * 0.000005;
- return (Random1);
-}
-
-void
-SqXMinX (ErrKind)
- int ErrKind;
-{
- FLOAT XA, XB;
-
- XB = X * BInvrse;
- XA = X - XB;
- SqEr = ((SQRT (X * X) - XB) - XA) / OneUlp;
- if (SqEr != Zero) {
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- J = J + 1.0;
- BadCond (ErrKind, "\n");
- printf ("sqrt( %.17e) - %.17e = %.17e\n", X * X, X, OneUlp * SqEr);
- printf ("\tinstead of correct value 0 .\n");
- }
-}
-
-void
-NewD ()
-{
- X = Z1 * Q;
- X = FLOOR (Half - X / Radix) * Radix + X;
- Q = (Q - X * Z) / Radix + X * X * (D / Radix);
- Z = Z - Two * X * D;
- if (Z <= Zero) {
- Z = -Z;
- Z1 = -Z1;
- }
- D = Radix * D;
-}
-
-void
-SR3750 ()
-{
- if (!((X - Radix < Z2 - Radix) || (X - Z2 > W - Z2))) {
- I = I + 1;
- X2 = SQRT (X * D);
- Y2 = (X2 - Z2) - (Y - Z2);
- X2 = X8 / (Y - Half);
- X2 = X2 - Half * X2 * X2;
- SqEr = (Y2 + Half) + (Half - X2);
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- SqEr = Y2 - X2;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- }
-}
-
-void
-IsYeqX ()
-{
- if (Y != X) {
- if (N <= 0) {
- if (Z == Zero && Q <= Zero)
- printf ("WARNING: computing\n");
- else
- BadCond (Defect, "computing\n");
- printf ("\t(%.17e) ^ (%.17e)\n", Z, Q);
- printf ("\tyielded %.17e;\n", Y);
- printf ("\twhich compared unequal to correct %.17e ;\n",
- X);
- printf ("\t\tthey differ by %.17e .\n", Y - X);
- }
- N = N + 1; /* ... count discrepancies. */
- }
-}
-
-void
-SR3980 ()
-{
- do {
- Q = (FLOAT) I;
- Y = POW (Z, Q);
- IsYeqX ();
- if (++I > M)
- break;
- X = Z * X;
- }
- while (X < W);
-}
-
-void
-PrintIfNPositive ()
-{
- if (N > 0)
- printf ("Similar discrepancies have occurred %d times.\n", N);
-}
-
-void
-TstPtUf ()
-{
- N = 0;
- if (Z != Zero) {
- printf ("Since comparison denies Z = 0, evaluating ");
- printf ("(Z + Z) / Z should be safe.\n");
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf))
- goto very_serious;
- Q9 = (Z + Z) / Z;
- printf ("What the machine gets for (Z + Z) / Z is %.17e .\n",
- Q9);
- if (FABS (Q9 - Two) < Radix * U2) {
- printf ("This is O.K., provided Over/Underflow");
- printf (" has NOT just been signaled.\n");
- } else {
- if ((Q9 < One) || (Q9 > Two)) {
- very_serious:
- N = 1;
- ErrCnt[Serious] = ErrCnt[Serious] + 1;
- printf ("This is a VERY SERIOUS DEFECT!\n");
- } else {
- N = 1;
- ErrCnt[Defect] = ErrCnt[Defect] + 1;
- printf ("This is a DEFECT!\n");
- }
- }
- sigsave = 0;
- V9 = Z * One;
- Random1 = V9;
- V9 = One * Z;
- Random2 = V9;
- V9 = Z / One;
- if ((Z == Random1) && (Z == Random2) && (Z == V9)) {
- if (N > 0)
- Pause ();
- } else {
- N = 1;
- BadCond (Defect, "What prints as Z = ");
- printf ("%.17e\n\tcompares different from ", Z);
- if (Z != Random1)
- printf ("Z * 1 = %.17e ", Random1);
- if (!((Z == Random2)
- || (Random2 == Random1)))
- printf ("1 * Z == %g\n", Random2);
- if (!(Z == V9))
- printf ("Z / 1 = %.17e\n", V9);
- if (Random2 != Random1) {
- ErrCnt[Defect] = ErrCnt[Defect] + 1;
- BadCond (Defect, "Multiplication does not commute!\n");
- printf ("\tComparison alleges that 1 * Z = %.17e\n",
- Random2);
- printf ("\tdiffers from Z * 1 = %.17e\n", Random1);
- }
- Pause ();
- }
- }
-}
-
-void
-notify (s)
- char *s;
-{
- printf ("%s test appears to be inconsistent...\n", s);
- printf (" PLEASE NOTIFY KARPINKSI!\n");
-}
-
-void
-msglist (s)
- char **s;
-{
- while (*s)
- printf ("%s\n", *s++);
-}
-
-void
-Instructions ()
-{
- static char *instr[] =
- {
- "Lest this program stop prematurely, i.e. before displaying\n",
- " `END OF TEST',\n",
- "try to persuade the computer NOT to terminate execution when an",
- "error like Over/Underflow or Division by Zero occurs, but rather",
- "to persevere with a surrogate value after, perhaps, displaying some",
- "warning. If persuasion avails naught, don't despair but run this",
- "program anyway to see how many milestones it passes, and then",
- "amend it to make further progress.\n",
- "Answer questions with Y, y, N or n (unless otherwise indicated).\n",
- 0};
-
- msglist (instr);
-}
-
-void
-Heading ()
-{
- static char *head[] =
- {
- "Users are invited to help debug and augment this program so it will",
- "cope with unanticipated and newly uncovered arithmetic pathologies.\n",
- "Please send suggestions and interesting results to",
- "\tRichard Karpinski",
- "\tComputer Center U-76",
- "\tUniversity of California",
- "\tSan Francisco, CA 94143-0704, USA\n",
- "In doing so, please include the following information:",
-#ifdef SINGLE_PRECISION
- "\tPrecision:\tsingle;",
-#else /* !SINGLE_PRECISION */
- "\tPrecision:\tdouble;",
-#endif /* SINGLE_PRECISION */
- "\tVersion:\t10 February 1989;",
- "\tComputer:\n",
- "\tCompiler:\n",
- "\tOptimization level:\n",
- "\tOther relevant compiler options:",
- 0};
-
- msglist (head);
-}
-
-void
-Characteristics ()
-{
- static char *chars[] =
- {
- "Running this program should reveal these characteristics:",
- " Radix = 1, 2, 4, 8, 10, 16, 100, 256 ...",
- " Precision = number of significant digits carried.",
- " U2 = Radix/Radix^Precision = One Ulp",
- "\t(OneUlpnit in the Last Place) of 1.000xxx .",
- " U1 = 1/Radix^Precision = One Ulp of numbers a little less than 1.0 .",
- " Adequacy of guard digits for Mult., Div. and Subt.",
- " Whether arithmetic is chopped, correctly rounded, or something else",
- "\tfor Mult., Div., Add/Subt. and Sqrt.",
- " Whether a Sticky Bit used correctly for rounding.",
- " UnderflowThreshold = an underflow threshold.",
- " E0 and PseudoZero tell whether underflow is abrupt, gradual, or fuzzy.",
- " V = an overflow threshold, roughly.",
- " V0 tells, roughly, whether Infinity is represented.",
- " Comparisions are checked for consistency with subtraction",
- "\tand for contamination with pseudo-zeros.",
- " Sqrt is tested. Y^X is not tested.",
- " Extra-precise subexpressions are revealed but NOT YET tested.",
- " Decimal-Binary conversion is NOT YET tested for accuracy.",
- 0};
-
- msglist (chars);
-}
-
-void
-History ()
-{ /* History */
- /* Converted from Brian Wichmann's Pascal version to C by Thos Sumner,
- with further massaging by David M. Gay. */
-
- static char *hist[] =
- {
- "The program attempts to discriminate among",
- " FLAWs, like lack of a sticky bit,",
- " Serious DEFECTs, like lack of a guard digit, and",
- " FAILUREs, like 2+2 == 5 .",
- "Failures may confound subsequent diagnoses.\n",
- "The diagnostic capabilities of this program go beyond an earlier",
- "program called `MACHAR', which can be found at the end of the",
- "book `Software Manual for the Elementary Functions' (1980) by",
- "W. J. Cody and W. Waite. Although both programs try to discover",
- "the Radix, Precision and range (over/underflow thresholds)",
- "of the arithmetic, this program tries to cope with a wider variety",
- "of pathologies, and to say how well the arithmetic is implemented.",
- "\nThe program is based upon a conventional radix representation for",
- "floating-point numbers, but also allows logarithmic encoding",
- "as used by certain early WANG machines.\n",
- "BASIC version of this program (C) 1983 by Prof. W. M. Kahan;",
- "see source comments for more history.",
- 0};
-
- msglist (hist);
-}
diff --git a/c/src/tests/samples/paranoia/paranoia.doc b/c/src/tests/samples/paranoia/paranoia.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/samples/paranoia/paranoia.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/samples/paranoia/system.h b/c/src/tests/samples/paranoia/system.h
deleted file mode 100644
index a3e79d92f4..0000000000
--- a/c/src/tests/samples/paranoia/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Global_variable; /* example global variable */
-
-/* end of include file */
diff --git a/c/src/tests/samples/ticker/Makefile.in b/c/src/tests/samples/ticker/Makefile.in
deleted file mode 100644
index 2a37a918a9..0000000000
--- a/c/src/tests/samples/ticker/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-SAMPLE=ticker
-PGM=${ARCH}/$(SAMPLE).exe
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init tasks
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=doc scn
-DOCS=$(DOCTYPES:%=$(SAMPLE).%)
-
-SRCS=$(DOCS) $(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-PRINT_SRCS=$(DOCS)
-
-PGM=${ARCH}/$(SAMPLE).exe
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/samples
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/samples/ticker/init.c b/c/src/tests/samples/ticker/init.c
deleted file mode 100644
index 47e086ff66..0000000000
--- a/c/src/tests/samples/ticker/init.c
+++ /dev/null
@@ -1,61 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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;
-
- puts( "\n\n*** CLOCK TICK TEST ***" );
-
- build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
- status = rtems_clock_set( &time );
-
- Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
- Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
- Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
-
- status = rtems_task_create(
- Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES,
- RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]
- );
- status = rtems_task_create(
- Task_name[ 2 ], 1, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES,
- RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 2 ]
- );
- status = rtems_task_create(
- Task_name[ 3 ], 1, RTEMS_MINIMUM_STACK_SIZE, 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/c/src/tests/samples/ticker/system.h b/c/src/tests/samples/ticker/system.h
deleted file mode 100644
index 99943044c1..0000000000
--- a/c/src/tests/samples/ticker/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/c/src/tests/samples/ticker/tasks.c b/c/src/tests/samples/ticker/tasks.c
deleted file mode 100644
index f5f9ea28ff..0000000000
--- a/c/src/tests/samples/ticker/tasks.c
+++ /dev/null
@@ -1,44 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 unused
-)
-{
- rtems_id tid;
- rtems_time_of_day time;
- rtems_unsigned32 task_index;
- rtems_status_code status;
-
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
- task_index = task_number( tid );
- while( FOREVER ) {
- status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
- if ( time.second >= 35 ) {
- puts( "*** END OF CLOCK TICK TEST ***" );
- exit( 0 );
- }
- put_name( Task_name[ task_index ], FALSE );
- print_time( " - rtems_clock_get - ", &time, "\n" );
- status = rtems_task_wake_after( task_index * 5 * TICKS_PER_SECOND );
- }
-}
diff --git a/c/src/tests/samples/ticker/ticker.doc b/c/src/tests/samples/ticker/ticker.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/samples/ticker/ticker.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/samples/ticker/ticker.scn b/c/src/tests/samples/ticker/ticker.scn
deleted file mode 100644
index 35952e6170..0000000000
--- a/c/src/tests/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/c/src/tests/sptests/Makefile.in b/c/src/tests/sptests/Makefile.in
deleted file mode 100644
index 618b080d54..0000000000
--- a/c/src/tests/sptests/Makefile.in
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-all: README
-
-# sp10 is not included for now
-SUB_DIRS=sp01 sp02 sp03 sp04 sp05 sp06 sp07 sp08 sp09 \
- sp11 sp12 sp13 sp14 sp15 sp16 sp17 sp19 \
- sp20 sp21 sp22 sp23 sp24 sp25 spfatal spsize
-
-
diff --git a/c/src/tests/sptests/README b/c/src/tests/sptests/README
deleted file mode 100644
index 2843063c31..0000000000
--- a/c/src/tests/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/c/src/tests/sptests/sp01/Makefile.in b/c/src/tests/sptests/sp01/Makefile.in
deleted file mode 100644
index 82f9a0292c..0000000000
--- a/c/src/tests/sptests/sp01/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp01
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp01/init.c b/c/src/tests/sptests/sp01/init.c
deleted file mode 100644
index 59b89d7c67..0000000000
--- a/c/src/tests/sptests/sp01/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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,
- 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/c/src/tests/sptests/sp01/sp01.doc b/c/src/tests/sptests/sp01/sp01.doc
deleted file mode 100644
index 019cc4d18a..0000000000
--- a/c/src/tests/sptests/sp01/sp01.doc
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp01/sp01.scn b/c/src/tests/sptests/sp01/sp01.scn
deleted file mode 100644
index 6d687d042a..0000000000
--- a/c/src/tests/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/c/src/tests/sptests/sp01/system.h b/c/src/tests/sptests/sp01/system.h
deleted file mode 100644
index ddcefc02a9..0000000000
--- a/c/src/tests/sptests/sp01/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Task_1_through_3(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/c/src/tests/sptests/sp01/task1.c b/c/src/tests/sptests/sp01/task1.c
deleted file mode 100644
index 88ec7c85f7..0000000000
--- a/c/src/tests/sptests/sp01/task1.c
+++ /dev/null
@@ -1,50 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- 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/c/src/tests/sptests/sp02/Makefile.in b/c/src/tests/sptests/sp02/Makefile.in
deleted file mode 100644
index c575cc532b..0000000000
--- a/c/src/tests/sptests/sp02/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp02
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2 task3 preempt
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp02/init.c b/c/src/tests/sptests/sp02/init.c
deleted file mode 100644
index dda2f9661c..0000000000
--- a/c/src/tests/sptests/sp02/init.c
+++ /dev/null
@@ -1,152 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp02/preempt.c b/c/src/tests/sptests/sp02/preempt.c
deleted file mode 100644
index 4ce362e8fa..0000000000
--- a/c/src/tests/sptests/sp02/preempt.c
+++ /dev/null
@@ -1,32 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp02/sp02.doc b/c/src/tests/sptests/sp02/sp02.doc
deleted file mode 100644
index 5e50b42f12..0000000000
--- a/c/src/tests/sptests/sp02/sp02.doc
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp02/sp02.scn b/c/src/tests/sptests/sp02/sp02.scn
deleted file mode 100644
index d3f3d61cd1..0000000000
--- a/c/src/tests/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 (0x08010007)
-TA1 - rtems_task_ident - tid of TA3 (0x08010008)
-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/c/src/tests/sptests/sp02/system.h b/c/src/tests/sptests/sp02/system.h
deleted file mode 100644
index aedcd2d375..0000000000
--- a/c/src/tests/sptests/sp02/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_id Preempt_task_id; /* preempt task id */
-TEST_EXTERN rtems_name Preempt_task_name; /* preempt task name */
-
-/* end of include file */
diff --git a/c/src/tests/sptests/sp02/task1.c b/c/src/tests/sptests/sp02/task1.c
deleted file mode 100644
index 2ab2caa7e8..0000000000
--- a/c/src/tests/sptests/sp02/task1.c
+++ /dev/null
@@ -1,66 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp02/task2.c b/c/src/tests/sptests/sp02/task2.c
deleted file mode 100644
index 0b10e3db53..0000000000
--- a/c/src/tests/sptests/sp02/task2.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp02/task3.c b/c/src/tests/sptests/sp02/task3.c
deleted file mode 100644
index ddc6b8e5bd..0000000000
--- a/c/src/tests/sptests/sp02/task3.c
+++ /dev/null
@@ -1,37 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp03/Makefile.in b/c/src/tests/sptests/sp03/Makefile.in
deleted file mode 100644
index aff787ea30..0000000000
--- a/c/src/tests/sptests/sp03/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp03
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp03/init.c b/c/src/tests/sptests/sp03/init.c
deleted file mode 100644
index c266cfd600..0000000000
--- a/c/src/tests/sptests/sp03/init.c
+++ /dev/null
@@ -1,67 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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,
- 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/c/src/tests/sptests/sp03/sp03.doc b/c/src/tests/sptests/sp03/sp03.doc
deleted file mode 100644
index b5182f2f94..0000000000
--- a/c/src/tests/sptests/sp03/sp03.doc
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp03/sp03.scn b/c/src/tests/sptests/sp03/sp03.scn
deleted file mode 100644
index 496982e86f..0000000000
--- a/c/src/tests/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/c/src/tests/sptests/sp03/system.h b/c/src/tests/sptests/sp03/system.h
deleted file mode 100644
index c52f7a9896..0000000000
--- a/c/src/tests/sptests/sp03/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/c/src/tests/sptests/sp03/task1.c b/c/src/tests/sptests/sp03/task1.c
deleted file mode 100644
index 9f39d26293..0000000000
--- a/c/src/tests/sptests/sp03/task1.c
+++ /dev/null
@@ -1,59 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp03/task2.c b/c/src/tests/sptests/sp03/task2.c
deleted file mode 100644
index 4f40582ab3..0000000000
--- a/c/src/tests/sptests/sp03/task2.c
+++ /dev/null
@@ -1,46 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 *** " );
- exit( 0 );
- }
-
- put_name( Task_name[ 2 ], FALSE );
- print_time( " ", &time, "\n" );
- }
-}
diff --git a/c/src/tests/sptests/sp04/Makefile.in b/c/src/tests/sptests/sp04/Makefile.in
deleted file mode 100644
index 381b5bd73a..0000000000
--- a/c/src/tests/sptests/sp04/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp04
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2 task3 tswitch
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp04/init.c b/c/src/tests/sptests/sp04/init.c
deleted file mode 100644
index 531b42af64..0000000000
--- a/c/src/tests/sptests/sp04/init.c
+++ /dev/null
@@ -1,110 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp04/sp04.doc b/c/src/tests/sptests/sp04/sp04.doc
deleted file mode 100644
index 13a235886a..0000000000
--- a/c/src/tests/sptests/sp04/sp04.doc
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp04/sp04.scn b/c/src/tests/sptests/sp04/sp04.scn
deleted file mode 100644
index 1acd83a82f..0000000000
--- a/c/src/tests/sptests/sp04/sp04.scn
+++ /dev/null
@@ -1,23 +0,0 @@
-*** TEST 4 ***
-TA1 - 09:15:00 12/31/1988
-TA1 - rtems_task_suspend - on Task 2
-TA1 - rtems_task_suspend - on Task 3
-TA1 - killing time
-TA1 - rtems_task_resume - on Task 2
-TA1 - rtems_task_resume - on Task 3
-TA2 - 09:15: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
-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
-TA2 - 09:15:16 12/31/1988
-*** END OF TEST 4 ***
diff --git a/c/src/tests/sptests/sp04/system.h b/c/src/tests/sptests/sp04/system.h
deleted file mode 100644
index cef8f5546b..0000000000
--- a/c/src/tests/sptests/sp04/system.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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/c/src/tests/sptests/sp04/task1.c b/c/src/tests/sptests/sp04/task1.c
deleted file mode 100644
index 40b7c175f4..0000000000
--- a/c/src/tests/sptests/sp04/task1.c
+++ /dev/null
@@ -1,118 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit (0);
- }
- }
-}
diff --git a/c/src/tests/sptests/sp04/task2.c b/c/src/tests/sptests/sp04/task2.c
deleted file mode 100644
index ff22274284..0000000000
--- a/c/src/tests/sptests/sp04/task2.c
+++ /dev/null
@@ -1,29 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp04/task3.c b/c/src/tests/sptests/sp04/task3.c
deleted file mode 100644
index a431a99f9d..0000000000
--- a/c/src/tests/sptests/sp04/task3.c
+++ /dev/null
@@ -1,29 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp04/tswitch.c b/c/src/tests/sptests/sp04/tswitch.c
deleted file mode 100644
index 1301507782..0000000000
--- a/c/src/tests/sptests/sp04/tswitch.c
+++ /dev/null
@@ -1,63 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 );
- directive_failed( status, "rtems_clock_get" );
-
- 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/c/src/tests/sptests/sp05/Makefile.in b/c/src/tests/sptests/sp05/Makefile.in
deleted file mode 100644
index f3cc475d57..0000000000
--- a/c/src/tests/sptests/sp05/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp05
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2 task3
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp05/init.c b/c/src/tests/sptests/sp05/init.c
deleted file mode 100644
index df81e48052..0000000000
--- a/c/src/tests/sptests/sp05/init.c
+++ /dev/null
@@ -1,81 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp05/sp05.doc b/c/src/tests/sptests/sp05/sp05.doc
deleted file mode 100644
index 0f005cf007..0000000000
--- a/c/src/tests/sptests/sp05/sp05.doc
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp05/sp05.scn b/c/src/tests/sptests/sp05/sp05.scn
deleted file mode 100644
index 40afb2d4b2..0000000000
--- a/c/src/tests/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/c/src/tests/sptests/sp05/system.h b/c/src/tests/sptests/sp05/system.h
deleted file mode 100644
index 785491d481..0000000000
--- a/c/src/tests/sptests/sp05/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/c/src/tests/sptests/sp05/task1.c b/c/src/tests/sptests/sp05/task1.c
deleted file mode 100644
index 8e67584e90..0000000000
--- a/c/src/tests/sptests/sp05/task1.c
+++ /dev/null
@@ -1,78 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp05/task2.c b/c/src/tests/sptests/sp05/task2.c
deleted file mode 100644
index 2d492746c4..0000000000
--- a/c/src/tests/sptests/sp05/task2.c
+++ /dev/null
@@ -1,39 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp05/task3.c b/c/src/tests/sptests/sp05/task3.c
deleted file mode 100644
index bc63d771d0..0000000000
--- a/c/src/tests/sptests/sp05/task3.c
+++ /dev/null
@@ -1,39 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp06/Makefile.in b/c/src/tests/sptests/sp06/Makefile.in
deleted file mode 100644
index 149767ba11..0000000000
--- a/c/src/tests/sptests/sp06/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp06
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2 task3
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp06/init.c b/c/src/tests/sptests/sp06/init.c
deleted file mode 100644
index 2b551e48b5..0000000000
--- a/c/src/tests/sptests/sp06/init.c
+++ /dev/null
@@ -1,87 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp06/sp06.doc b/c/src/tests/sptests/sp06/sp06.doc
deleted file mode 100644
index 6ec1bb23d7..0000000000
--- a/c/src/tests/sptests/sp06/sp06.doc
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp06/sp06.scn b/c/src/tests/sptests/sp06/sp06.scn
deleted file mode 100644
index 64f6489dc8..0000000000
--- a/c/src/tests/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/c/src/tests/sptests/sp06/system.h b/c/src/tests/sptests/sp06/system.h
deleted file mode 100644
index b3c2786832..0000000000
--- a/c/src/tests/sptests/sp06/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_task_argument Argument; /* generic task argument */
-TEST_EXTERN rtems_task_argument Restart_argument; /* task 1 restart argument */
-
-/* end of include file */
diff --git a/c/src/tests/sptests/sp06/task1.c b/c/src/tests/sptests/sp06/task1.c
deleted file mode 100644
index 63af3d680f..0000000000
--- a/c/src/tests/sptests/sp06/task1.c
+++ /dev/null
@@ -1,61 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- 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/c/src/tests/sptests/sp06/task2.c b/c/src/tests/sptests/sp06/task2.c
deleted file mode 100644
index 6a57b907e2..0000000000
--- a/c/src/tests/sptests/sp06/task2.c
+++ /dev/null
@@ -1,40 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp06/task3.c b/c/src/tests/sptests/sp06/task3.c
deleted file mode 100644
index af1a398da5..0000000000
--- a/c/src/tests/sptests/sp06/task3.c
+++ /dev/null
@@ -1,32 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp07/Makefile.in b/c/src/tests/sptests/sp07/Makefile.in
deleted file mode 100644
index bd56649dd7..0000000000
--- a/c/src/tests/sptests/sp07/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp07
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2 task3 task4 taskexit tcreate tdelete trestart tstart
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp07/init.c b/c/src/tests/sptests/sp07/init.c
deleted file mode 100644
index df627a2895..0000000000
--- a/c/src/tests/sptests/sp07/init.c
+++ /dev/null
@@ -1,128 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp07/sp07.doc b/c/src/tests/sptests/sp07/sp07.doc
deleted file mode 100644
index 6ecc0e0c20..0000000000
--- a/c/src/tests/sptests/sp07/sp07.doc
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp07/sp07.scn b/c/src/tests/sptests/sp07/sp07.scn
deleted file mode 100644
index 1f6de2d93d..0000000000
--- a/c/src/tests/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
-<pause>
-TA1 - rtems_task_set_priority - get initial priority of self: 04
-TA1 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: 04
-TA1 - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8: 03
-TA1 - rtems_task_set_priority - set TA2's priority: 03
-TA2 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: 03
-TA2 - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8: 02
-TA2 - rtems_task_set_priority - set TA1's priority: 02
-TA1 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: 02
-TA1 - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8: 01
-TA1 - rtems_task_set_priority - set TA2's priority: 01
-TA2 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: 01
-TA2 - rtems_task_suspend - suspend TA1
-TA2 - rtems_task_set_priority - set priority of TA1 ( blocked )
-TASK_DELETE - TA2 deleting TA1
-TASK_DELETE - TA2 deleting TA3
-TASK_DELETE - TA2 deleting TA2
-TA4 - exitting task
-RTEMS_TASK_EXITTED - extension invoked for TA4
-*** END OF TEST 7 ***
-TASK_DELETE - TA4 deleting TA4 <---- may not appear
diff --git a/c/src/tests/sptests/sp07/system.h b/c/src/tests/sptests/sp07/system.h
deleted file mode 100644
index 110f844957..0000000000
--- a/c/src/tests/sptests/sp07/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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)
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/sptests/sp07/task1.c b/c/src/tests/sptests/sp07/task1.c
deleted file mode 100644
index d6e5e4d1f1..0000000000
--- a/c/src/tests/sptests/sp07/task1.c
+++ /dev/null
@@ -1,85 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp07/task2.c b/c/src/tests/sptests/sp07/task2.c
deleted file mode 100644
index d528fa2dde..0000000000
--- a/c/src/tests/sptests/sp07/task2.c
+++ /dev/null
@@ -1,78 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp07/task3.c b/c/src/tests/sptests/sp07/task3.c
deleted file mode 100644
index 71aec743a4..0000000000
--- a/c/src/tests/sptests/sp07/task3.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp07/task4.c b/c/src/tests/sptests/sp07/task4.c
deleted file mode 100644
index 6ea75d42e6..0000000000
--- a/c/src/tests/sptests/sp07/task4.c
+++ /dev/null
@@ -1,30 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp07/taskexit.c b/c/src/tests/sptests/sp07/taskexit.c
deleted file mode 100644
index a7b0745f16..0000000000
--- a/c/src/tests/sptests/sp07/taskexit.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Task_exit_extension
- *
- * This routine is the task exitted user extension.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp07/tcreate.c b/c/src/tests/sptests/sp07/tcreate.c
deleted file mode 100644
index bba5b8d40d..0000000000
--- a/c/src/tests/sptests/sp07/tcreate.c
+++ /dev/null
@@ -1,35 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp07/tdelete.c b/c/src/tests/sptests/sp07/tdelete.c
deleted file mode 100644
index 5276369d47..0000000000
--- a/c/src/tests/sptests/sp07/tdelete.c
+++ /dev/null
@@ -1,37 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp07/trestart.c b/c/src/tests/sptests/sp07/trestart.c
deleted file mode 100644
index 9195ca7c3f..0000000000
--- a/c/src/tests/sptests/sp07/trestart.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp07/tstart.c b/c/src/tests/sptests/sp07/tstart.c
deleted file mode 100644
index 6fac296b87..0000000000
--- a/c/src/tests/sptests/sp07/tstart.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp08/Makefile.in b/c/src/tests/sptests/sp08/Makefile.in
deleted file mode 100644
index 3f77248cc8..0000000000
--- a/c/src/tests/sptests/sp08/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp08
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp08/init.c b/c/src/tests/sptests/sp08/init.c
deleted file mode 100644
index 260fec7f65..0000000000
--- a/c/src/tests/sptests/sp08/init.c
+++ /dev/null
@@ -1,53 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp08/sp08.doc b/c/src/tests/sptests/sp08/sp08.doc
deleted file mode 100644
index 734bfde9ca..0000000000
--- a/c/src/tests/sptests/sp08/sp08.doc
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp08/sp08.scn b/c/src/tests/sptests/sp08/sp08.scn
deleted file mode 100644
index d85ccc384f..0000000000
--- a/c/src/tests/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/c/src/tests/sptests/sp08/system.h b/c/src/tests/sptests/sp08/system.h
deleted file mode 100644
index 352bfe9a13..0000000000
--- a/c/src/tests/sptests/sp08/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/c/src/tests/sptests/sp08/task1.c b/c/src/tests/sptests/sp08/task1.c
deleted file mode 100644
index 257e9586a9..0000000000
--- a/c/src/tests/sptests/sp08/task1.c
+++ /dev/null
@@ -1,256 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp09/Makefile.in b/c/src/tests/sptests/sp09/Makefile.in
deleted file mode 100644
index 67da5d97bd..0000000000
--- a/c/src/tests/sptests/sp09/Makefile.in
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp09
-
-MANAGERS=io message dual_ported_memory event multi_processor \
- region semaphore signal rate_monotonic timer partition
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init delay isr screen01 screen02 screen03 screen04 screen05 screen06 \
- screen07 screen08 screen09 screen10 screen11 screen12 screen13 \
- screen14 task1 task2 task3 task4
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp09/delay.c b/c/src/tests/sptests/sp09/delay.c
deleted file mode 100644
index 23f1c8730f..0000000000
--- a/c/src/tests/sptests/sp09/delay.c
+++ /dev/null
@@ -1,28 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp09/init.c b/c/src/tests/sptests/sp09/init.c
deleted file mode 100644
index fb80e38d00..0000000000
--- a/c/src/tests/sptests/sp09/init.c
+++ /dev/null
@@ -1,120 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp09/isr.c b/c/src/tests/sptests/sp09/isr.c
deleted file mode 100644
index 4098dc0f95..0000000000
--- a/c/src/tests/sptests/sp09/isr.c
+++ /dev/null
@@ -1,27 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp09/screen01.c b/c/src/tests/sptests/sp09/screen01.c
deleted file mode 100644
index e3d0359837..0000000000
--- a/c/src/tests/sptests/sp09/screen01.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/* Screen1
- *
- * This routine generates error screen 1 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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, &notepad_value );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NUMBER,
- "rtems_task_get_note with illegal notepad"
- );
- puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_NUMBER" );
-
- status = rtems_task_get_note( 100, RTEMS_NOTEPAD_LAST, &notepad_value );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_task_get_note with illegal id"
- );
- puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID" );
-
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &self_id );
- directive_failed( status, "rtems_task_ident of self" );
-
- if ( self_id != Task_id[ 1 ] ) {
- puts( "ERROR - rtems_task_ident - incorrect ID returned!" );
- }
- puts( "TA1 - rtems_task_ident - current task RTEMS_SUCCESSFUL" );
-
- status = rtems_task_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NAME,
- "rtems_task_ident with illegal name (local)"
- );
- puts( "TA1 - rtems_task_ident - global RTEMS_INVALID_NAME" );
-
- status = rtems_task_ident( 100, 1, &Junk_id );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NAME,
- "rtems_task_ident with illegal name (global)"
- );
- puts( "TA1 - rtems_task_ident - local RTEMS_INVALID_NAME" );
-
- status = rtems_task_ident( 100, 2, &Junk_id );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NODE,
- "rtems_task_ident with illegal node"
- );
- puts( "TA1 - rtems_task_ident - RTEMS_INVALID_NODE" );
-
- status = rtems_task_restart( 100, 0 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_task_restart with illegal id"
- );
- puts( "TA1 - rtems_task_restart - RTEMS_INVALID_ID" );
-
- status = rtems_task_resume( 100 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_task_resume with illegal id"
- );
- puts( "TA1 - rtems_task_resume - RTEMS_INVALID_ID" );
-
- status = rtems_task_resume( RTEMS_SELF );
- fatal_directive_status(
- status,
- RTEMS_INCORRECT_STATE,
- "rtems_task_resume of ready task"
- );
- puts( "TA1 - rtems_task_resume - RTEMS_INCORRECT_STATE" );
-
- status = rtems_task_set_priority( RTEMS_SELF, 512, &previous_priority );
- fatal_directive_status(
- status,
- RTEMS_INVALID_PRIORITY,
- "rtems_task_set_priority with illegal priority"
- );
- puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_PRIORITY" );
-
- status = rtems_task_set_priority( 100, 8, &previous_priority );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_task_set_priority with illegal id"
- );
- puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_ID" );
-
- status = rtems_task_set_note(
- RTEMS_SELF,
- RTEMS_NOTEPAD_LAST+10,
- notepad_value
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NUMBER,
- "rtems_task_set_note with illegal notepad"
- );
- puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_NUMBER" );
-
- status = rtems_task_set_note( 100, RTEMS_NOTEPAD_LAST, notepad_value );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_task_set_note with illegal id"
- );
- puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_ID" );
-
- status = rtems_task_start( 100, Task_1, 0 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_task_start with illegal id"
- );
- puts( "TA1 - rtems_task_start - RTEMS_INVALID_ID" );
-
- status = rtems_task_start( 0, Task_1, 0 );
- fatal_directive_status(
- status,
- RTEMS_INCORRECT_STATE,
- "rtems_task_start of ready task"
- );
- puts( "TA1 - rtems_task_start - RTEMS_INCORRECT_STATE" );
-
- status = rtems_task_suspend( 100 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_task_suspend with illegal id"
- );
- puts( "TA1 - rtems_task_suspend - RTEMS_INVALID_ID" );
-}
diff --git a/c/src/tests/sptests/sp09/screen02.c b/c/src/tests/sptests/sp09/screen02.c
deleted file mode 100644
index 27982c0af7..0000000000
--- a/c/src/tests/sptests/sp09/screen02.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/* Screen2
- *
- * This routine generates error screen 2 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp09/screen03.c b/c/src/tests/sptests/sp09/screen03.c
deleted file mode 100644
index 713375cb52..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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_configuration_table BSP_Configuration;
-extern rtems_cpu_table _CPU_Table;
-
-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 (_CPU_Table.stack_allocate_hook)
- {
- puts( "TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED -- SKIPPED" );
- }
- else
- {
- status = rtems_task_create(
- task_name,
- 1,
- BSP_Configuration.work_space_size,
- RTEMS_DEFAULT_MODES,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_UNSATISFIED,
- "rtems_task_create with a stack size larger than the workspace"
- );
- puts( "TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED" );
- }
-
- status = rtems_task_create(
- Task_name[ 2 ],
- 4,
- 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" );
-
- 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"
- );
- puts( "TA1 - rtems_task_create - RTEMS_MP_NOT_CONFIGURED" );
-}
diff --git a/c/src/tests/sptests/sp09/screen04.c b/c/src/tests/sptests/sp09/screen04.c
deleted file mode 100644
index 3dcddf9581..0000000000
--- a/c/src/tests/sptests/sp09/screen04.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Screen4
- *
- * This routine generates error screen 4 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp09/screen05.c b/c/src/tests/sptests/sp09/screen05.c
deleted file mode 100644
index c5dfd1a067..0000000000
--- a/c/src/tests/sptests/sp09/screen05.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/* Screen5
- *
- * This routine generates error screen 5 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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" );
-
- 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"
- );
- 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/c/src/tests/sptests/sp09/screen06.c b/c/src/tests/sptests/sp09/screen06.c
deleted file mode 100644
index 948598dff3..0000000000
--- a/c/src/tests/sptests/sp09/screen06.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/* Screen6
- *
- * This routine generates error screen 6 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp09/screen07.c b/c/src/tests/sptests/sp09/screen07.c
deleted file mode 100644
index 14ba4ff2d2..0000000000
--- a/c/src/tests/sptests/sp09/screen07.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/* Screen7
- *
- * This routine generates error screen 7 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 Screen7()
-{
- long buffer[ 4 ];
- rtems_unsigned32 size;
- rtems_unsigned32 count;
- rtems_status_code status;
-
- status = rtems_message_queue_broadcast( 100, (long (*)[4]) buffer, 16, &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,
- 16,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NAME,
- "rtems_message_queue_create with illegal name"
- );
-
- puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_INVALID_NAME" );
- status = rtems_message_queue_create(
- Queue_name[ 1 ],
- 1,
- 16,
- RTEMS_GLOBAL,
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_MP_NOT_CONFIGURED,
- "rtems_message_queue_create of mp not configured"
- );
- puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_MP_NOT_CONFIGURED" );
-
- status = rtems_message_queue_create(
- Queue_name[ 1 ],
- 2,
- 16,
- 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,
- 16,
- 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, (long (*)[4]) buffer, 16 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_message_queue_send with illegal id"
- );
- puts( "TA1 - rtems_message_queue_send - RTEMS_INVALID_ID" );
-
- status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer, 16 );
- directive_failed( status, "rtems_message_queue_send" );
- puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" );
-
- status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer, 16 );
- directive_failed( status, "rtems_message_queue_send" );
- puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" );
-
- status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer, 16 );
- 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/c/src/tests/sptests/sp09/screen08.c b/c/src/tests/sptests/sp09/screen08.c
deleted file mode 100644
index 705b9111fa..0000000000
--- a/c/src/tests/sptests/sp09/screen08.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/* Screen8
- *
- * This routine generates error screen 8 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 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,
- 16,
- 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 ], (long (*)[4])buffer, 16 );
- directive_failed( status, "rtems_message_queue_send successful" );
- puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" );
-
- status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer, 16 );
- directive_failed( status, "rtems_message_queue_send successful" );
- puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" );
-
- status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer, 16 );
- 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,
- 16,
- 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 ], (long (*)[4])buffer, 16 );
- directive_failed( status, "rtems_message_queue_send successful" );
- puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" );
-
- status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer, 16 );
- directive_failed( status, "rtems_message_queue_send successful" );
- puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" );
-
- status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer, 16 );
- 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 ], (long (*)[4])buffer, 16 );
- 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,
- 16,
- 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/c/src/tests/sptests/sp09/screen09.c b/c/src/tests/sptests/sp09/screen09.c
deleted file mode 100644
index a932c38e7c..0000000000
--- a/c/src/tests/sptests/sp09/screen09.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* Screen9
- *
- * This routine generates error screen 9 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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" );
-
- 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" );
-
- 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" );
-
- status = rtems_signal_send( 100, RTEMS_SIGNAL_1 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_signal_send with illegal id"
- );
- puts( "TA1 - rtems_signal_send - RTEMS_INVALID_ID" );
-
- status = rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_16 );
- fatal_directive_status(
- status,
- RTEMS_NOT_DEFINED,
- "rtems_signal_send with no handler"
- );
- puts( "TA1 - rtems_signal_send - RTEMS_NOT_DEFINED" );
-
- status = rtems_port_create(
- 0,
- Internal_port_area,
- External_port_area,
- sizeof( Internal_port_area ),
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NAME,
- "rtems_port_create with illegal name"
- );
- puts( "TA1 - rtems_port_create - RTEMS_INVALID_NAME" );
-
- status = rtems_port_create(
- Port_name[ 1 ],
- &((char *)Internal_port_area)[ 1 ],
- External_port_area,
- sizeof( Internal_port_area ),
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ADDRESS,
- "rtems_port_create with illegal address"
- );
- puts( "TA1 - rtems_port_create - RTEMS_INVALID_ADDRESS" );
-
- status = rtems_port_create(
- Port_name[ 1 ],
- Internal_port_area,
- External_port_area,
- sizeof( Internal_port_area ),
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_TOO_MANY,
- "rtems_port_create of too many"
- );
- puts( "TA1 - rtems_port_create - RTEMS_TOO_MANY" );
-
- status = rtems_port_delete( 0 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_port_delete with illegal id"
- );
- puts( "TA1 - rtems_port_delete - RTEMS_INVALID_ID" );
-
- status = rtems_port_ident( 0, &Junk_id );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NAME,
- "rtems_port_ident with illegal name"
- );
- puts( "TA1 - rtems_port_ident - RTEMS_INVALID_NAME" );
-
- status = rtems_port_external_to_internal(
- 100,
- Internal_port_area,
- &converted
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_port_external_to_internal with illegal id"
- );
- puts( "TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ID" );
- status = rtems_port_internal_to_external(
- 100,
- Internal_port_area,
- &converted
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_port_internal_to_external with illegal id"
- );
- puts( "TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ID" );
-}
diff --git a/c/src/tests/sptests/sp09/screen10.c b/c/src/tests/sptests/sp09/screen10.c
deleted file mode 100644
index bb09ab2d7e..0000000000
--- a/c/src/tests/sptests/sp09/screen10.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/* Screen10
- *
- * This routine generates error screen 10 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp09/screen11.c b/c/src/tests/sptests/sp09/screen11.c
deleted file mode 100644
index 7857a98c95..0000000000
--- a/c/src/tests/sptests/sp09/screen11.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/* Screen11
- *
- * This routine generates error screen 11 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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"
- );
-
- status = rtems_partition_create(
- Partition_name[ 1 ],
- Partition_good_area,
- 128,
- 64,
- RTEMS_GLOBAL,
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_MP_NOT_CONFIGURED,
- "rtems_partition_create of global"
- );
- puts( "TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED" );
-
- status = rtems_partition_create(
- Partition_name[ 1 ],
- Partition_bad_area,
- 128,
- 64,
- RTEMS_GLOBAL,
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ADDRESS,
- "rtems_partition_create with bad address"
- );
- puts( "TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS" );
-
- status = rtems_partition_create(
- Partition_name[ 1 ],
- Partition_good_area,
- 128,
- 34,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_SIZE,
- "rtems_partition_create with unaligned buffer_size"
- );
- puts( "TA1 - rtems_partition_create - RTEMS_INVALID_SIZE" );
-
- status = rtems_partition_delete( 100 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_partition_delete with illegal id"
- );
- puts( "TA1 - rtems_partition_delete - unknown RTEMS_INVALID_ID" );
-
- status = rtems_partition_delete( 0x10100 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_partition_delete with illegal id"
- );
- puts( "TA1 - rtems_partition_delete - local RTEMS_INVALID_ID" );
-
- status = rtems_partition_get_buffer( 100, &buffer_address_1 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_partition_get_buffer with illegal id"
- );
- puts( "TA1 - rtems_partition_get_buffer - RTEMS_INVALID_ID" );
-
- status = rtems_partition_ident( 0, RTEMS_SEARCH_ALL_NODES, &Junk_id );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NAME,
- "rtems_partition_ident with illegal name"
- );
- puts( "TA1 - rtems_partition_ident - RTEMS_INVALID_NAME" );
-
- status = rtems_partition_return_buffer( 100, buffer_address_1 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_partition_return_buffer with illegal id"
- );
- puts( "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ID" );
-
- status = rtems_partition_create(
- Partition_name[ 1 ],
- Partition_good_area,
- 128,
- 64,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Partition_id[ 1 ]
- );
- directive_failed( status, "rtems_partition_create" );
- puts( "TA1 - rtems_partition_create - RTEMS_SUCCESSFUL" );
-
- status = rtems_partition_create(
- Partition_name[ 1 ],
- Partition_good_area,
- 128,
- 32,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_TOO_MANY,
- "rtems_partition_create of too many"
- );
- puts( "TA1 - rtems_partition_create - RTEMS_TOO_MANY" );
-
- status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_1 );
- directive_failed( status, "rtems_partition_get_buffer");
- puts( "TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL" );
-
- status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_2 );
- directive_failed( status, "rtems_partition_get_buffer" );
- puts( "TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL" );
-
- status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_3 );
- fatal_directive_status(
- status,
- RTEMS_UNSATISFIED,
- "rtems_partition_get_buffer unsatisfied"
- );
- puts( "TA1 - rtems_partition_get_buffer - RTEMS_UNSATISFIED" );
-
- status = rtems_partition_delete( Partition_id[ 1 ] );
- fatal_directive_status(
- status,
- RTEMS_RESOURCE_IN_USE,
- "rtems_partition_delete with buffers in use"
- );
- puts( "TA1 - rtems_partition_delete - RTEMS_RESOURCE_IN_USE" );
-
- status = rtems_partition_return_buffer(
- Partition_id[ 1 ],
- Region_good_area /* NOTE: Region Memory */
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ADDRESS,
- "rtems_partition_return_buffer with buffer address out of partition"
- );
- puts(
- "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - out of range"
- );
-
- status = rtems_partition_return_buffer(
- Partition_id[ 1 ],
- &Partition_good_area[ 7 ]
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ADDRESS,
- "rtems_partition_return_buffer with buffer address not on boundary"
- );
- puts_nocr( "TA1 - rtems_partition_return_buffer - " );
- puts ( "RTEMS_INVALID_ADDRESS - not on boundary");
-}
diff --git a/c/src/tests/sptests/sp09/screen12.c b/c/src/tests/sptests/sp09/screen12.c
deleted file mode 100644
index 281885994a..0000000000
--- a/c/src/tests/sptests/sp09/screen12.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/* Screen12
- *
- * This routine generates error screen 12 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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" );
-
- 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" );
-
- 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" );
-
- 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/c/src/tests/sptests/sp09/screen13.c b/c/src/tests/sptests/sp09/screen13.c
deleted file mode 100644
index 5aee5a3995..0000000000
--- a/c/src/tests/sptests/sp09/screen13.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Screen13
- *
- * This routine generates error screen 13 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp09/screen14.c b/c/src/tests/sptests/sp09/screen14.c
deleted file mode 100644
index a53ac99ee4..0000000000
--- a/c/src/tests/sptests/sp09/screen14.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/* Screen14
- *
- * This routine generates error screen 14 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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"
- );
-}
diff --git a/c/src/tests/sptests/sp09/sp09.doc b/c/src/tests/sptests/sp09/sp09.doc
deleted file mode 100644
index db8ec401bb..0000000000
--- a/c/src/tests/sptests/sp09/sp09.doc
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp09/sp09.scn b/c/src/tests/sptests/sp09/sp09.scn
deleted file mode 100644
index 67471b8d7d..0000000000
--- a/c/src/tests/sptests/sp09/sp09.scn
+++ /dev/null
@@ -1,251 +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
-<pause - screen 2>
-TA1 - rtems_clock_get - RTEMS_NOT_DEFINED
-TA1 - rtems_task_wake_when - RTEMS_NOT_DEFINED
-TA1 - rtems_timer_fire_when - RTEMS_NOT_DEFINED
-TA1 - rtems_clock_set - 08:30:45 02/05/1987 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_set - 08:30:45 15/05/1988 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_set - 08:30:45 02/32/1988 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_set - 25:30:45 02/05/1988 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_set - 08:61:45 02/05/1988 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_set - 08:30:61 02/05/1988 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_set - 08:30:45 02/05/1988 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_set - 08:30:45 02/05/1988 - RTEMS_SUCCESSFUL
-TA1 - rtems_task_wake_when - TICKINVALID - sleep about 3 seconds
-TA1 - rtems_task_wake_when - TICKINVALID - woke up RTEMS_SUCCESSFUL
-TA1 - rtems_task_wake_when - 08:30:48 02/05/1961 - RTEMS_INVALID_CLOCK
-TA1 - rtems_task_wake_when - 25:30:48 02/05/1988 - RTEMS_INVALID_CLOCK
-TA1 - current time - 08:30:51 02/05/1988
-TA1 - rtems_task_wake_when - 08:30:51 01/05/1988 - RTEMS_INVALID_CLOCK
-<pause - screen 3>
-TA1 - rtems_task_create - RTEMS_INVALID_NAME
-TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED
-TA1 - rtems_task_create - TA2 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_suspend - suspend TA2 - RTEMS_SUCCESSFUL
-TA1 - rtems_task_suspend - suspend TA2 - RTEMS_ALREADY_SUSPENDED
-TA1 - rtems_task_resume - TA2 resumed - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - TA3 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 4 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 5 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 6 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 7 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 8 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 9 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 10 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 11 - RTEMS_TOO_MANY
-TA1 - rtems_task_create - RTEMS_MP_NOT_CONFIGURED
-<pause - screen 4>
-TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( all conditions )
-TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( any condition )
-TA1 - rtems_event_receive - timeout in 3 seconds
-TA1 - rtems_event_receive - woke up with RTEMS_TIMEOUT
-TA1 - rtems_event_send - RTEMS_INVALID_ID
-TA1 - rtems_task_wake_after - sleep 1 second - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_set - 08:30:45 02/05/1988 - RTEMS_SUCCESSFUL
-<pause - screen 5>
-TA1 - rtems_semaphore_create - RTEMS_INVALID_NAME
-TA1 - rtems_semaphore_create - 1 - RTEMS_SUCCESSFUL
-TA1 - rtems_semaphore_create - 2 - RTEMS_SUCCESSFUL
-TA1 - rtems_semaphore_create - 3 - RTEMS_TOO_MANY
-TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED
-TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED
-TA1 - rtems_semaphore_create - RTEMS_INVALID_NUMBER
-TA1 - rtems_semaphore_create - RTEMS_MP_NOT_CONFIGURED
-TA1 - rtems_semaphore_delete - unknown RTEMS_INVALID_ID
-TA1 - rtems_semaphore_delete - local RTEMS_INVALID_ID
-TA1 - rtems_semaphore_ident - global RTEMS_INVALID_NAME
-TA1 - rtems_semaphore_ident - local RTEMS_INVALID_NAME
-<pause - screen 6>
-TA1 - rtems_semaphore_obtain - RTEMS_INVALID_ID
-TA1 - rtems_semaphore_obtain - got sem 1 - RTEMS_SUCCESSFUL
-TA1 - rtems_semaphore_obtain - RTEMS_UNSATISFIED
-TA1 - rtems_semaphore_obtain - timeout in 3 seconds
-TA1 - rtems_semaphore_obtain - woke up with RTEMS_TIMEOUT
-TA1 - rtems_semaphore_release - RTEMS_NOT_OWNER_OF_RESOURCE
-TA1 - rtems_semaphore_release - RTEMS_INVALID_ID
-TA1 - rtems_task_start - start TA2 - RTEMS_SUCCESSFUL
-TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL
-TA2 - rtems_semaphore_obtain - sem 1 - RTEMS_WAIT FOREVER
-TA1 - rtems_semaphore_delete - delete sem 1 - RTEMS_SUCCESSFUL
-TA1 - rtems_semaphore_obtain - binary semaphore
-TA1 - rtems_semaphore_delete - delete sem 2 - RTEMS_RESOURCE_IN_USE
-TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL
-TA2 - rtems_semaphore_obtain - woke up with RTEMS_OBJECT_WAS_DELETED
-TA2 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL
-<pause - screen 7>
-TA1 - rtems_message_queue_broadcast - RTEMS_INVALID_ID
-TA1 - rtems_message_queue_create - Q 1 - RTEMS_INVALID_NAME
-TA1 - rtems_message_queue_create - Q 1 - RTEMS_MP_NOT_CONFIGURED
-TA1 - rtems_message_queue_create - Q 1 - 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
-<pause - screen 8>
-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
-<pause - screen 9>
-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
-<pause - screen 10>
-TA1 - rtems_rate_monotonic_create - RTEMS_INVALID_NAME
-TA1 - rtems_rate_monotonic_create - RTEMS_SUCCESSFUL
-TA1 - rtems_rate_monotonic_create - RTEMS_TOO_MANY
-TA1 - rtems_rate_monotonic_ident - RTEMS_INVALID_NAME
-TA1 - rtems_rate_monotonic_period - unknown RTEMS_INVALID_ID
-TA1 - rtems_rate_monotonic_period - local RTEMS_INVALID_ID
-TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_NOT_DEFINED
-TA1 - rtems_rate_monotonic_period - 100 ticks - RTEMS_SUCCESSFUL
-TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_SUCCESSFUL
-TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_TIMEOUT
-TA1 - rtems_rate_monotonic_cancel - unknown RTEMS_INVALID_ID
-TA1 - rtems_rate_monotonic_cancel - local RTEMS_INVALID_ID
-TA1 - rtems_rate_monotonic_cancel - RTEMS_SUCCESSFUL
-TA1 - rtems_rate_monotonic_period - 5 ticks - RTEMS_TIMEOUT
-TA1 - yielding to TA4
-TA4 - rtems_rate_monotonic_cancel - RTEMS_NOT_OWNER_OF_RESOURCE
-TA4 - rtems_rate_monotonic_period - RTEMS_NOT_OWNER_OF_RESOURCE
-TA4 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL
-TA1 - rtems_rate_monotonic_delete - unknown RTEMS_INVALID_ID
-TA1 - rtems_rate_monotonic_delete - local RTEMS_INVALID_ID
-TA1 - rtems_rate_monotonic_delete - RTEMS_SUCCESSFUL
-<pause - screen 11>
-TA1 - rtems_partition_create - RTEMS_INVALID_NAME
-TA1 - rtems_partition_create - length - RTEMS_INVALID_SIZE
-TA1 - rtems_partition_create - buffer size - RTEMS_INVALID_SIZE
-TA1 - rtems_partition_create - length < buffer size - RTEMS_INVALID_SIZE
-TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED
-TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS
-TA1 - rtems_partition_create - RTEMS_INVALID_SIZE
-TA1 - rtems_partition_delete - unknown RTEMS_INVALID_ID
-TA1 - rtems_partition_delete - local RTEMS_INVALID_ID
-TA1 - rtems_partition_get_buffer - RTEMS_INVALID_ID
-TA1 - rtems_partition_ident - RTEMS_INVALID_NAME
-TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ID
-TA1 - rtems_partition_create - RTEMS_SUCCESSFUL
-TA1 - rtems_partition_create - RTEMS_TOO_MANY
-TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL
-TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL
-TA1 - rtems_partition_get_buffer - RTEMS_UNSATISFIED
-TA1 - rtems_partition_delete - RTEMS_RESOURCE_IN_USE
-TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - out of range
-TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - not on boundary
-<pause - screen 12>
-TA1 - rtems_region_create - RTEMS_INVALID_NAME
-TA1 - rtems_region_create - RTEMS_INVALID_ADDRESS
-TA1 - rtems_region_create - RTEMS_INVALID_SIZE
-TA1 - rtems_region_create - RTEMS_SUCCESSFUL
-TA1 - rtems_region_create - RTEMS_TOO_MANY
-TA1 - rtems_region_delete - unknown RTEMS_INVALID_ID
-TA1 - rtems_region_delete - local RTEMS_INVALID_ID
-TA1 - rtems_region_ident - RTEMS_INVALID_NAME
-TA1 - rtems_region_get_segment - RTEMS_INVALID_ID
-TA1 - rtems_region_get_segment - RTEMS_INVALID_SIZE
-TA1 - rtems_region_get_segment - RTEMS_SUCCESSFUL
-TA1 - rtems_region_get_segment - RTEMS_UNSATISFIED
-TA1 - rtems_region_get_segment - timeout in 3 seconds
-TA1 - rtems_region_get_segment - woke up with RTEMS_TIMEOUT
-TA1 - rtems_region_delete - RTEMS_RESOURCE_IN_USE
-TA1 - rtems_region_return_segment - RTEMS_INVALID_ID
-TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS
-TA1 - rtems_debug_disable - RTEMS_DEBUG_REGION
-TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS - 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
-<pause - screen 13>
-TA1 - rtems_io_close - RTEMS_INVALID_NUMBER
-TA1 - rtems_io_control - RTEMS_INVALID_NUMBER
-TA1 - rtems_io_initialize - RTEMS_INVALID_NUMBER
-TA1 - rtems_io_open - RTEMS_INVALID_NUMBER
-TA1 - rtems_io_read - RTEMS_INVALID_NUMBER
-TA1 - rtems_io_write - RTEMS_INVALID_NUMBER
-TA1 - rtems_clock_set - 23:59:59 12/31/2000 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_get - 00:00:00 01/01/2001 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_set - 23:59:59 12/31/1999 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_get - 00:00:00 01/01/2000 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_set - 23:59:59 12/31/2100 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_get - 00:00:00 01/01/2101 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_set - 23:59:59 12/31/2099 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_get - 00:00:00 01/01/2100 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_set - 23:59:59 12/31/1991 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_get - 00:00:00 01/01/1992 - RTEMS_SUCCESSFUL
-<pause - screen 14>
-TA1 - rtems_timer_create - RTEMS_INVALID_NAME
-TA1 - rtems_timer_create - 1 - RTEMS_SUCCESSFUL
-TA1 - rtems_timer_create - 2 - RTEMS_TOO_MANY
-TA1 - rtems_timer_delete - local RTEMS_INVALID_ID
-TA1 - rtems_timer_delete - global RTEMS_INVALID_ID
-TA1 - rtems_timer_ident - RTEMS_INVALID_NAME
-TA1 - rtems_timer_cancel - RTEMS_INVALID_ID
-TA1 - rtems_timer_reset - RTEMS_INVALID_ID
-TA1 - rtems_timer_reset - RTEMS_NOT_DEFINED
-TA1 - rtems_timer_fire_after - RTEMS_INVALID_ID
-TA1 - rtems_timer_fire_when - RTEMS_INVALID_ID
-TA1 - rtems_timer_fire_after - RTEMS_INVALID_NUMBER
-TA1 - rtems_timer_fire_when - 08:30:45 02/05/1987 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_get - 00:00:00 01/01/1992
-TA1 - rtems_timer_fire_when - 08:30:45 02/05/1990 - before RTEMS_INVALID_CLOCK
-*** END OF TEST 9 ***
diff --git a/c/src/tests/sptests/sp09/system.h b/c/src/tests/sptests/sp09/system.h
deleted file mode 100644
index 69b28b1b4d..0000000000
--- a/c/src/tests/sptests/sp09/system.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* 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/c/src/tests/sptests/sp09/task1.c b/c/src/tests/sptests/sp09/task1.c
deleted file mode 100644
index 997204674d..0000000000
--- a/c/src/tests/sptests/sp09/task1.c
+++ /dev/null
@@ -1,70 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp09/task2.c b/c/src/tests/sptests/sp09/task2.c
deleted file mode 100644
index 9fdd9160da..0000000000
--- a/c/src/tests/sptests/sp09/task2.c
+++ /dev/null
@@ -1,48 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp09/task3.c b/c/src/tests/sptests/sp09/task3.c
deleted file mode 100644
index 2f1a91f5d6..0000000000
--- a/c/src/tests/sptests/sp09/task3.c
+++ /dev/null
@@ -1,53 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp09/task4.c b/c/src/tests/sptests/sp09/task4.c
deleted file mode 100644
index 2b8c127a98..0000000000
--- a/c/src/tests/sptests/sp09/task4.c
+++ /dev/null
@@ -1,50 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp11/Makefile.in b/c/src/tests/sptests/sp11/Makefile.in
deleted file mode 100644
index 6d1eca6b35..0000000000
--- a/c/src/tests/sptests/sp11/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp11
-
-MANAGERS=io event timer
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2 timer
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp11/init.c b/c/src/tests/sptests/sp11/init.c
deleted file mode 100644
index 6382f31bae..0000000000
--- a/c/src/tests/sptests/sp11/init.c
+++ /dev/null
@@ -1,92 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp11/sp11.doc b/c/src/tests/sptests/sp11/sp11.doc
deleted file mode 100644
index 5bc0bae8bd..0000000000
--- a/c/src/tests/sptests/sp11/sp11.doc
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp11/sp11.scn b/c/src/tests/sptests/sp11/sp11.scn
deleted file mode 100644
index db0469eb60..0000000000
--- a/c/src/tests/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
-<pause>
-TA1 - rtems_event_send - send RTEMS_EVENT_18 to self after 5 seconds
-TA1 - rtems_event_receive - waiting forever on RTEMS_EVENT_18
-TA2 - RTEMS_EVENT_10 received - eventout => 00000400
-TA2 - rtems_clock_get - 08:15:05 02/12/1988
-TA2 - rtems_event_receive - RTEMS_PENDING_EVENTS
-TA2 - eventout => 00080000
-TA2 - rtems_event_receive - RTEMS_EVENT_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
-<pause>
-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
-<pause>
-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
-<pause>
-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/c/src/tests/sptests/sp11/system.h b/c/src/tests/sptests/sp11/system.h
deleted file mode 100644
index 113113969c..0000000000
--- a/c/src/tests/sptests/sp11/system.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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/c/src/tests/sptests/sp11/task1.c b/c/src/tests/sptests/sp11/task1.c
deleted file mode 100644
index b8d3530b04..0000000000
--- a/c/src/tests/sptests/sp11/task1.c
+++ /dev/null
@@ -1,410 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp11/task2.c b/c/src/tests/sptests/sp11/task2.c
deleted file mode 100644
index 8522334b9a..0000000000
--- a/c/src/tests/sptests/sp11/task2.c
+++ /dev/null
@@ -1,126 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp11/timer.c b/c/src/tests/sptests/sp11/timer.c
deleted file mode 100644
index 986b7b91ad..0000000000
--- a/c/src/tests/sptests/sp11/timer.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Timer_functions
- *
- * These routines are the timer service routines used by this test.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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( status, "rtems_event_send of 18" );
-}
-
-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( status, "rtems_event_send of 8" );
-}
-
-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( status, "rtems_event_send of 9" );
-}
-
-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( status, "rtems_event_send of 10" );
-}
-
-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( status, "rtems_event_send of 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( status, "rtems_event_send of 11" );
-}
-
-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( status, "rtems_event_send of 10" );
-}
diff --git a/c/src/tests/sptests/sp12/Makefile.in b/c/src/tests/sptests/sp12/Makefile.in
deleted file mode 100644
index b472a94841..0000000000
--- a/c/src/tests/sptests/sp12/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp12
-
-MANAGERS=io semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2 task3 task4 task5 pridrv pritask
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp12/init.c b/c/src/tests/sptests/sp12/init.c
deleted file mode 100644
index d610dc070b..0000000000
--- a/c/src/tests/sptests/sp12/init.c
+++ /dev/null
@@ -1,179 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp12/pridrv.c b/c/src/tests/sptests/sp12/pridrv.c
deleted file mode 100644
index 24c96c10ea..0000000000
--- a/c/src/tests/sptests/sp12/pridrv.c
+++ /dev/null
@@ -1,131 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp12/pritask.c b/c/src/tests/sptests/sp12/pritask.c
deleted file mode 100644
index eb5ac15603..0000000000
--- a/c/src/tests/sptests/sp12/pritask.c
+++ /dev/null
@@ -1,91 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 );
- 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,
- &current_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/c/src/tests/sptests/sp12/sp12.doc b/c/src/tests/sptests/sp12/sp12.doc
deleted file mode 100644
index a729ab0843..0000000000
--- a/c/src/tests/sptests/sp12/sp12.doc
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp12/sp12.scn b/c/src/tests/sptests/sp12/sp12.scn
deleted file mode 100644
index e87a729259..0000000000
--- a/c/src/tests/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
-<pause>
-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
-<pause>
-TA1 - rtems_semaphore_ident - smid => 14010002
-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
-<pause>
-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
-<pause>
-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/c/src/tests/sptests/sp12/system.h b/c/src/tests/sptests/sp12/system.h
deleted file mode 100644
index 08b43430a6..0000000000
--- a/c/src/tests/sptests/sp12/system.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2)
-#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 <confdefs.h>
-
-/* 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/c/src/tests/sptests/sp12/task1.c b/c/src/tests/sptests/sp12/task1.c
deleted file mode 100644
index 4b284ee364..0000000000
--- a/c/src/tests/sptests/sp12/task1.c
+++ /dev/null
@@ -1,153 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp12/task2.c b/c/src/tests/sptests/sp12/task2.c
deleted file mode 100644
index c83fd87b8a..0000000000
--- a/c/src/tests/sptests/sp12/task2.c
+++ /dev/null
@@ -1,65 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp12/task3.c b/c/src/tests/sptests/sp12/task3.c
deleted file mode 100644
index 5622df991f..0000000000
--- a/c/src/tests/sptests/sp12/task3.c
+++ /dev/null
@@ -1,50 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp12/task4.c b/c/src/tests/sptests/sp12/task4.c
deleted file mode 100644
index f392007fe2..0000000000
--- a/c/src/tests/sptests/sp12/task4.c
+++ /dev/null
@@ -1,37 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp12/task5.c b/c/src/tests/sptests/sp12/task5.c
deleted file mode 100644
index 263eed640b..0000000000
--- a/c/src/tests/sptests/sp12/task5.c
+++ /dev/null
@@ -1,55 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp13/Makefile.in b/c/src/tests/sptests/sp13/Makefile.in
deleted file mode 100644
index 2bee0da020..0000000000
--- a/c/src/tests/sptests/sp13/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp13
-
-MANAGERS=io message
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init fillbuff putbuff task1 task2 task3
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp13/fillbuff.c b/c/src/tests/sptests/sp13/fillbuff.c
deleted file mode 100644
index 2f821d6c1c..0000000000
--- a/c/src/tests/sptests/sp13/fillbuff.c
+++ /dev/null
@@ -1,31 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 Fill_buffer(
- char *source,
- long *buffer
-)
-{
- memcpy( buffer, source, 16 );
-}
diff --git a/c/src/tests/sptests/sp13/init.c b/c/src/tests/sptests/sp13/init.c
deleted file mode 100644
index 40b6574d68..0000000000
--- a/c/src/tests/sptests/sp13/init.c
+++ /dev/null
@@ -1,112 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 13 ***" );
-
- 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 ],
- 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 * 2,
- 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" );
-
- Queue_name[ 1 ] = rtems_build_name( 'Q', '1', ' ', ' ' );
- Queue_name[ 2 ] = rtems_build_name( 'Q', '2', ' ', ' ' );
- Queue_name[ 3 ] = rtems_build_name( 'Q', '3', ' ', ' ' );
-
- status = rtems_message_queue_create(
- Queue_name[ 1 ],
- 100,
- 16,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Queue_id[ 1 ]
- );
- directive_failed( status, "rtems_message_queue_create of Q1" );
-
- status = rtems_message_queue_create(
- Queue_name[ 2 ],
- 10,
- 16,
- RTEMS_PRIORITY,
- &Queue_id[ 2 ]
- );
- directive_failed( status, "rtems_message_queue_create of Q2" );
-
- status = rtems_message_queue_create(
- Queue_name[ 3 ],
- 100,
- 16,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Queue_id[ 3 ]
- );
- directive_failed( status, "rtems_message_queue_create of Q3" );
-
- status = rtems_task_delete( RTEMS_SELF );
- directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
-}
diff --git a/c/src/tests/sptests/sp13/putbuff.c b/c/src/tests/sptests/sp13/putbuff.c
deleted file mode 100644
index 154be5d400..0000000000
--- a/c/src/tests/sptests/sp13/putbuff.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Put_buffer
- *
- * This test routine prints the given buffer.
- * buffer.
- *
- * Input parameters:
- * buffer - pointer to message buffer to be printer
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 Put_buffer(
- long *buffer
-)
-{
- printf( "%16s", (char *)buffer );
-}
diff --git a/c/src/tests/sptests/sp13/sp13.doc b/c/src/tests/sptests/sp13/sp13.doc
deleted file mode 100644
index e46d8b6eed..0000000000
--- a/c/src/tests/sptests/sp13/sp13.doc
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp13/sp13.scn b/c/src/tests/sptests/sp13/sp13.scn
deleted file mode 100644
index cb34131eb9..0000000000
--- a/c/src/tests/sptests/sp13/sp13.scn
+++ /dev/null
@@ -1,76 +0,0 @@
-*** TEST 13 ***
-TA1 - rtems_message_queue_ident - qid => 18010001
-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
-<pause>
-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
-<pause>
-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
-<pause>
-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
-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
-<pause>
-TA1 - create message queue of 20 bytes on queue 1
-TA1 - rtems_message_queue_delete - delete queue 1
-<pause>
-TA1 - rtems_message_queue_create - variable sizes
-TA1 - rtems_message_queue_create and send - variable sizes
-*** END OF TEST 13 ***
diff --git a/c/src/tests/sptests/sp13/system.h b/c/src/tests/sptests/sp13/system.h
deleted file mode 100644
index e1efa42963..0000000000
--- a/c/src/tests/sptests/sp13/system.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 10
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (2 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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/c/src/tests/sptests/sp13/task1.c b/c/src/tests/sptests/sp13/task1.c
deleted file mode 100644
index 3ac0c398eb..0000000000
--- a/c/src/tests/sptests/sp13/task1.c
+++ /dev/null
@@ -1,352 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <string.h> /* for memcmp */
-
-extern rtems_configuration_table BSP_Configuration;
-
-char big_send_buffer[2048];
-char big_receive_buffer[2048];
-
-long buffer[ 4 ];
-
-void dope_buffer(unsigned char *buff,
- int buff_size,
- unsigned32 v)
-{
- int i;
- unsigned char ch;
-
- ch = (' ' + (v % (0x7f - ' ')));
-
- for (i=0; i<buff_size; i++)
- {
- *buff++ = ch++;
- if (ch >= 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- directive_failed( status, "rtems_message_queue_send" );
-
- 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, 16 );
- 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, 16 );
- 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");
- exit(1);
- }
-
- if (memcmp(big_send_buffer, big_receive_buffer, size) != 0)
- {
- puts("TA1 - exact size data match failed");
- 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");
- 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp13/task2.c b/c/src/tests/sptests/sp13/task2.c
deleted file mode 100644
index 1246e84d30..0000000000
--- a/c/src/tests/sptests/sp13/task2.c
+++ /dev/null
@@ -1,139 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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
-)
-{
- 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 ],
- (long (*)[4])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 ],
- (long (*)[4])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 ],
- (long (*)[4])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 ],
- (long (*)[4])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" );
- directive_failed( status, "rtems_message_queue_send" );
-
- status = rtems_message_queue_send( Queue_id[ 2 ], (long (*)[4])buffer, 16 );
- 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 ],
- (long (*)[4])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 ],
- (long (*)[4])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/c/src/tests/sptests/sp13/task3.c b/c/src/tests/sptests/sp13/task3.c
deleted file mode 100644
index 501bc01e3e..0000000000
--- a/c/src/tests/sptests/sp13/task3.c
+++ /dev/null
@@ -1,78 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp14/Makefile.in b/c/src/tests/sptests/sp14/Makefile.in
deleted file mode 100644
index 486c2ebc63..0000000000
--- a/c/src/tests/sptests/sp14/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp14
-
-MANAGERS=io signal timer
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init asr task1 task2
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp14/asr.c b/c/src/tests/sptests/sp14/asr.c
deleted file mode 100644
index 04902c605a..0000000000
--- a/c/src/tests/sptests/sp14/asr.c
+++ /dev/null
@@ -1,47 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp14/init.c b/c/src/tests/sptests/sp14/init.c
deleted file mode 100644
index bc59a52cb4..0000000000
--- a/c/src/tests/sptests/sp14/init.c
+++ /dev/null
@@ -1,72 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp14/sp14.doc b/c/src/tests/sptests/sp14/sp14.doc
deleted file mode 100644
index c5f06e136f..0000000000
--- a/c/src/tests/sptests/sp14/sp14.doc
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp14/sp14.scn b/c/src/tests/sptests/sp14/sp14.scn
deleted file mode 100644
index 31e6d067d2..0000000000
--- a/c/src/tests/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
-<pause>
-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/c/src/tests/sptests/sp14/system.h b/c/src/tests/sptests/sp14/system.h
deleted file mode 100644
index ecb34d21b7..0000000000
--- a/c/src/tests/sptests/sp14/system.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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/c/src/tests/sptests/sp14/task1.c b/c/src/tests/sptests/sp14/task1.c
deleted file mode 100644
index c46d833dde..0000000000
--- a/c/src/tests/sptests/sp14/task1.c
+++ /dev/null
@@ -1,116 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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( status, "rtems_signal_send of 3" );
-
- 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/c/src/tests/sptests/sp14/task2.c b/c/src/tests/sptests/sp14/task2.c
deleted file mode 100644
index 27d17dbe3c..0000000000
--- a/c/src/tests/sptests/sp14/task2.c
+++ /dev/null
@@ -1,48 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp15/Makefile.in b/c/src/tests/sptests/sp15/Makefile.in
deleted file mode 100644
index 8bc3f93e5c..0000000000
--- a/c/src/tests/sptests/sp15/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp15
-
-MANAGERS=io partition
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp15/init.c b/c/src/tests/sptests/sp15/init.c
deleted file mode 100644
index 489b387cc3..0000000000
--- a/c/src/tests/sptests/sp15/init.c
+++ /dev/null
@@ -1,78 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp15/sp15.doc b/c/src/tests/sptests/sp15/sp15.doc
deleted file mode 100644
index 261f9e7a49..0000000000
--- a/c/src/tests/sptests/sp15/sp15.doc
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp15/sp15.scn b/c/src/tests/sptests/sp15/sp15.scn
deleted file mode 100644
index f1a800dc0d..0000000000
--- a/c/src/tests/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 = 1c010001
-TA1 - rtems_partition_ident - partition 2 id = 1c010002
-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/c/src/tests/sptests/sp15/system.h b/c/src/tests/sptests/sp15/system.h
deleted file mode 100644
index ef5e481920..0000000000
--- a/c/src/tests/sptests/sp15/system.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Task_1(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_PARTITIONS 2
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_name Partition_id[ 4 ]; /* array of partition ids */
-TEST_EXTERN rtems_name Partition_name[ 4 ]; /* array of partition names */
-
-TEST_EXTERN rtems_unsigned8 Area_1[4096] CPU_STRUCTURE_ALIGNMENT;
-TEST_EXTERN rtems_unsigned8 Area_2[274] CPU_STRUCTURE_ALIGNMENT;
-
-#define Put_address_from_area_1( _to_be_printed ) \
- printf( "0x%08lx", \
- (unsigned long)((rtems_unsigned8 *)(_to_be_printed) - Area_1 ) )
-
-#define Put_address_from_area_2( _to_be_printed ) \
- printf( "0x%08lx", \
- (unsigned long)((rtems_unsigned8 *)(_to_be_printed) - Area_2 ) )
-
-/* end of include file */
diff --git a/c/src/tests/sptests/sp15/task1.c b/c/src/tests/sptests/sp15/task1.c
deleted file mode 100644
index da77cdf478..0000000000
--- a/c/src/tests/sptests/sp15/task1.c
+++ /dev/null
@@ -1,129 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp16/Makefile.in b/c/src/tests/sptests/sp16/Makefile.in
deleted file mode 100644
index f818b5a041..0000000000
--- a/c/src/tests/sptests/sp16/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp16
-
-MANAGERS=io region
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1 task2 task3 task4 task5
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp16/init.c b/c/src/tests/sptests/sp16/init.c
deleted file mode 100644
index d526b7d3e3..0000000000
--- a/c/src/tests/sptests/sp16/init.c
+++ /dev/null
@@ -1,128 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp16/sp16.doc b/c/src/tests/sptests/sp16/sp16.doc
deleted file mode 100644
index 1a208582dc..0000000000
--- a/c/src/tests/sptests/sp16/sp16.doc
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp16/sp16.scn b/c/src/tests/sptests/sp16/sp16.scn
deleted file mode 100644
index 36d533c2b4..0000000000
--- a/c/src/tests/sptests/sp16/sp16.scn
+++ /dev/null
@@ -1,58 +0,0 @@
-*** TEST 16 ***
-TA1 - rtems_region_ident - rnid => 20010002
-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
-<pause>
-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
-<pause>
-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/c/src/tests/sptests/sp16/system.h b/c/src/tests/sptests/sp16/system.h
deleted file mode 100644
index b507d2a562..0000000000
--- a/c/src/tests/sptests/sp16/system.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* 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/c/src/tests/sptests/sp16/task1.c b/c/src/tests/sptests/sp16/task1.c
deleted file mode 100644
index fdd2776e93..0000000000
--- a/c/src/tests/sptests/sp16/task1.c
+++ /dev/null
@@ -1,282 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp16/task2.c b/c/src/tests/sptests/sp16/task2.c
deleted file mode 100644
index 2f17952b09..0000000000
--- a/c/src/tests/sptests/sp16/task2.c
+++ /dev/null
@@ -1,86 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp16/task3.c b/c/src/tests/sptests/sp16/task3.c
deleted file mode 100644
index 09a3ec87ad..0000000000
--- a/c/src/tests/sptests/sp16/task3.c
+++ /dev/null
@@ -1,57 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp16/task4.c b/c/src/tests/sptests/sp16/task4.c
deleted file mode 100644
index 3f1eebeb28..0000000000
--- a/c/src/tests/sptests/sp16/task4.c
+++ /dev/null
@@ -1,60 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp16/task5.c b/c/src/tests/sptests/sp16/task5.c
deleted file mode 100644
index 0f36aec535..0000000000
--- a/c/src/tests/sptests/sp16/task5.c
+++ /dev/null
@@ -1,73 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp17/Makefile.in b/c/src/tests/sptests/sp17/Makefile.in
deleted file mode 100644
index c76375ccab..0000000000
--- a/c/src/tests/sptests/sp17/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp17
-
-MANAGERS=io signal
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init asr task1 task2
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp17/asr.c b/c/src/tests/sptests/sp17/asr.c
deleted file mode 100644
index d4384a0774..0000000000
--- a/c/src/tests/sptests/sp17/asr.c
+++ /dev/null
@@ -1,32 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp17/init.c b/c/src/tests/sptests/sp17/init.c
deleted file mode 100644
index 1a49b46c78..0000000000
--- a/c/src/tests/sptests/sp17/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp17/sp17.doc b/c/src/tests/sptests/sp17/sp17.doc
deleted file mode 100644
index dcff893039..0000000000
--- a/c/src/tests/sptests/sp17/sp17.doc
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp17/sp17.scn b/c/src/tests/sptests/sp17/sp17.scn
deleted file mode 100644
index 47fd140e2a..0000000000
--- a/c/src/tests/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/c/src/tests/sptests/sp17/system.h b/c/src/tests/sptests/sp17/system.h
deleted file mode 100644
index 8f595b3e6b..0000000000
--- a/c/src/tests/sptests/sp17/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(25)
-#define CONFIGURE_TICKS_PER_TIMESLICE 1000
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_unsigned32 Task_2_preempted;
-
-/* end of include file */
diff --git a/c/src/tests/sptests/sp17/task1.c b/c/src/tests/sptests/sp17/task1.c
deleted file mode 100644
index 9bd1a04e01..0000000000
--- a/c/src/tests/sptests/sp17/task1.c
+++ /dev/null
@@ -1,48 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp17/task2.c b/c/src/tests/sptests/sp17/task2.c
deleted file mode 100644
index 1b9759c9b6..0000000000
--- a/c/src/tests/sptests/sp17/task2.c
+++ /dev/null
@@ -1,45 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp19/Makefile.in b/c/src/tests/sptests/sp19/Makefile.in
deleted file mode 100644
index 606ab65d14..0000000000
--- a/c/src/tests/sptests/sp19/Makefile.in
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp19
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init first fptask task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp19/first.c b/c/src/tests/sptests/sp19/first.c
deleted file mode 100644
index 82348300ed..0000000000
--- a/c/src/tests/sptests/sp19/first.c
+++ /dev/null
@@ -1,66 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp19/fptask.c b/c/src/tests/sptests/sp19/fptask.c
deleted file mode 100644
index f80e0decca..0000000000
--- a/c/src/tests/sptests/sp19/fptask.c
+++ /dev/null
@@ -1,98 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 *** " );
- 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/c/src/tests/sptests/sp19/fptest.h b/c/src/tests/sptests/sp19/fptest.h
deleted file mode 100644
index a30f2cf451..0000000000
--- a/c/src/tests/sptests/sp19/fptest.h
+++ /dev/null
@@ -1,172 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <stdio.h>
-
-#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/c/src/tests/sptests/sp19/init.c b/c/src/tests/sptests/sp19/init.c
deleted file mode 100644
index 86c38134ef..0000000000
--- a/c/src/tests/sptests/sp19/init.c
+++ /dev/null
@@ -1,150 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp19/inttest.h b/c/src/tests/sptests/sp19/inttest.h
deleted file mode 100644
index 1da6c7d42a..0000000000
--- a/c/src/tests/sptests/sp19/inttest.h
+++ /dev/null
@@ -1,149 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <stdio.h>
-#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/c/src/tests/sptests/sp19/sp19.doc b/c/src/tests/sptests/sp19/sp19.doc
deleted file mode 100644
index 0b26e5d8b2..0000000000
--- a/c/src/tests/sptests/sp19/sp19.doc
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp19/sp19.scn b/c/src/tests/sptests/sp19/sp19.scn
deleted file mode 100644
index d70c8ad89a..0000000000
--- a/c/src/tests/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/c/src/tests/sptests/sp19/system.h b/c/src/tests/sptests/sp19/system.h
deleted file mode 100644
index fefd7ece07..0000000000
--- a/c/src/tests/sptests/sp19/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (18 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/sptests/sp19/task1.c b/c/src/tests/sptests/sp19/task1.c
deleted file mode 100644
index 9b271fac8f..0000000000
--- a/c/src/tests/sptests/sp19/task1.c
+++ /dev/null
@@ -1,59 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp20/Makefile.in b/c/src/tests/sptests/sp20/Makefile.in
deleted file mode 100644
index eb60bc8930..0000000000
--- a/c/src/tests/sptests/sp20/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp20
-
-MANAGERS=io rate_monotonic
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init getall task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp20/getall.c b/c/src/tests/sptests/sp20/getall.c
deleted file mode 100644
index 85f6470d1c..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp20/init.c b/c/src/tests/sptests/sp20/init.c
deleted file mode 100644
index e70df5aa47..0000000000
--- a/c/src/tests/sptests/sp20/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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', ' ' );
-
- for ( index = 1 ; index <= 5 ; 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 <= 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/c/src/tests/sptests/sp20/sp20.doc b/c/src/tests/sptests/sp20/sp20.doc
deleted file mode 100644
index 668aa4a844..0000000000
--- a/c/src/tests/sptests/sp20/sp20.doc
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp20/sp20.scn b/c/src/tests/sptests/sp20/sp20.scn
deleted file mode 100644
index bb4e8814da..0000000000
--- a/c/src/tests/sptests/sp20/sp20.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/c/src/tests/sptests/sp20/system.h b/c/src/tests/sptests/sp20/system.h
deleted file mode 100644
index 45d79b70d8..0000000000
--- a/c/src/tests/sptests/sp20/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_INIT_TASK_PRIORITY 10
-#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
-#define CONFIGURE_MAXIMUM_PERIODS 10
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (15 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/sptests/sp20/task1.c b/c/src/tests/sptests/sp20/task1.c
deleted file mode 100644
index dc80a405d5..0000000000
--- a/c/src/tests/sptests/sp20/task1.c
+++ /dev/null
@@ -1,116 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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_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 );
- 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 )
- exit( 0 );
-
- pass += 1;
-
- printf( "TA5 - PERIODS CHECK OK (%d)\n", pass );
-
- fflush( stdout );
-
- if ( pass == 10 ) {
- puts( "*** END OF TEST 20 ***" );
- exit( 0 );
- }
-
- }
- break;
- }
-}
diff --git a/c/src/tests/sptests/sp21/Makefile.in b/c/src/tests/sptests/sp21/Makefile.in
deleted file mode 100644
index c871405e79..0000000000
--- a/c/src/tests/sptests/sp21/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp21
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp21/init.c b/c/src/tests/sptests/sp21/init.c
deleted file mode 100644
index acfa626b6c..0000000000
--- a/c/src/tests/sptests/sp21/init.c
+++ /dev/null
@@ -1,53 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp21/sp21.doc b/c/src/tests/sptests/sp21/sp21.doc
deleted file mode 100644
index 6666e315f2..0000000000
--- a/c/src/tests/sptests/sp21/sp21.doc
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp21/sp21.scn b/c/src/tests/sptests/sp21/sp21.scn
deleted file mode 100644
index c6392e3ea3..0000000000
--- a/c/src/tests/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/c/src/tests/sptests/sp21/system.h b/c/src/tests/sptests/sp21/system.h
deleted file mode 100644
index 563ce8b63d..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Task_1(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-#define CONFIGURE_TEST_NEEDS_STUB_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/c/src/tests/sptests/sp21/task1.c b/c/src/tests/sptests/sp21/task1.c
deleted file mode 100644
index b961b2e0d6..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 0x5
-
-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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp22/Makefile.in b/c/src/tests/sptests/sp22/Makefile.in
deleted file mode 100644
index a53f032e32..0000000000
--- a/c/src/tests/sptests/sp22/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp22
-
-MANAGERS=io timer
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init prtime delay task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp22/delay.c b/c/src/tests/sptests/sp22/delay.c
deleted file mode 100644
index 17b8b8b412..0000000000
--- a/c/src/tests/sptests/sp22/delay.c
+++ /dev/null
@@ -1,32 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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( status, "rtems_task_resume of self" );
-}
diff --git a/c/src/tests/sptests/sp22/init.c b/c/src/tests/sptests/sp22/init.c
deleted file mode 100644
index 92dc031a25..0000000000
--- a/c/src/tests/sptests/sp22/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp22/prtime.c b/c/src/tests/sptests/sp22/prtime.c
deleted file mode 100644
index 9d36f1e0d8..0000000000
--- a/c/src/tests/sptests/sp22/prtime.c
+++ /dev/null
@@ -1,32 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/sp22/sp22.doc b/c/src/tests/sptests/sp22/sp22.doc
deleted file mode 100644
index 262f441342..0000000000
--- a/c/src/tests/sptests/sp22/sp22.doc
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp22/sp22.scn b/c/src/tests/sptests/sp22/sp22.scn
deleted file mode 100644
index 6fb08156c5..0000000000
--- a/c/src/tests/sptests/sp22/sp22.scn
+++ /dev/null
@@ -1,29 +0,0 @@
-*** TEST 22 ***
-INIT - rtems_timer_create - creating timer 1
-INIT - timer 1 has id (0x10010001)
-TA1 - rtems_timer_ident - identing timer 1
-TA1 - timer 1 has id (0x10010001)
-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
-<pause>
-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/c/src/tests/sptests/sp22/system.h b/c/src/tests/sptests/sp22/system.h
deleted file mode 100644
index 8e23bd3e02..0000000000
--- a/c/src/tests/sptests/sp22/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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/c/src/tests/sptests/sp22/task1.c b/c/src/tests/sptests/sp22/task1.c
deleted file mode 100644
index 38c20ad956..0000000000
--- a/c/src/tests/sptests/sp22/task1.c
+++ /dev/null
@@ -1,164 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <cr> 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 *** " );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp23/Makefile.in b/c/src/tests/sptests/sp23/Makefile.in
deleted file mode 100644
index b8d5dc89f0..0000000000
--- a/c/src/tests/sptests/sp23/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp23
-
-MANAGERS=io dual_ported_memory
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp23/init.c b/c/src/tests/sptests/sp23/init.c
deleted file mode 100644
index c91f107a4e..0000000000
--- a/c/src/tests/sptests/sp23/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp23/sp23.doc b/c/src/tests/sptests/sp23/sp23.doc
deleted file mode 100644
index 2ea35a714a..0000000000
--- a/c/src/tests/sptests/sp23/sp23.doc
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp23/sp23.scn b/c/src/tests/sptests/sp23/sp23.scn
deleted file mode 100644
index 7d9f8ff898..0000000000
--- a/c/src/tests/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 - 0x24010001
-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/c/src/tests/sptests/sp23/system.h b/c/src/tests/sptests/sp23/system.h
deleted file mode 100644
index e88f367859..0000000000
--- a/c/src/tests/sptests/sp23/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Task_1(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* 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/c/src/tests/sptests/sp23/task1.c b/c/src/tests/sptests/sp23/task1.c
deleted file mode 100644
index 886f7c8d04..0000000000
--- a/c/src/tests/sptests/sp23/task1.c
+++ /dev/null
@@ -1,96 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/sp24/Makefile.in b/c/src/tests/sptests/sp24/Makefile.in
deleted file mode 100644
index a30c1a475b..0000000000
--- a/c/src/tests/sptests/sp24/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp24
-
-MANAGERS=io event timer
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init resume task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp24/init.c b/c/src/tests/sptests/sp24/init.c
deleted file mode 100644
index 8cb39f3d34..0000000000
--- a/c/src/tests/sptests/sp24/init.c
+++ /dev/null
@@ -1,76 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp24/resume.c b/c/src/tests/sptests/sp24/resume.c
deleted file mode 100644
index 81e37c361f..0000000000
--- a/c/src/tests/sptests/sp24/resume.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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( status, "rtems_task_resume" );
-}
diff --git a/c/src/tests/sptests/sp24/sp24.doc b/c/src/tests/sptests/sp24/sp24.doc
deleted file mode 100644
index aecae8b27a..0000000000
--- a/c/src/tests/sptests/sp24/sp24.doc
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp24/sp24.scn b/c/src/tests/sptests/sp24/sp24.scn
deleted file mode 100644
index 96a58f35e3..0000000000
--- a/c/src/tests/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/c/src/tests/sptests/sp24/system.h b/c/src/tests/sptests/sp24/system.h
deleted file mode 100644
index c3775f4ee3..0000000000
--- a/c/src/tests/sptests/sp24/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 3
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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/c/src/tests/sptests/sp24/task1.c b/c/src/tests/sptests/sp24/task1.c
deleted file mode 100644
index 464286ae1f..0000000000
--- a/c/src/tests/sptests/sp24/task1.c
+++ /dev/null
@@ -1,58 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- 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/c/src/tests/sptests/sp25/Makefile.in b/c/src/tests/sptests/sp25/Makefile.in
deleted file mode 100644
index a065dbd6be..0000000000
--- a/c/src/tests/sptests/sp25/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=sp25
-
-MANAGERS=io region
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests/$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/sp25/init.c b/c/src/tests/sptests/sp25/init.c
deleted file mode 100644
index 6fb95bbb8f..0000000000
--- a/c/src/tests/sptests/sp25/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/sp25/sp25.doc b/c/src/tests/sptests/sp25/sp25.doc
deleted file mode 100644
index 9a0417dfea..0000000000
--- a/c/src/tests/sptests/sp25/sp25.doc
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/sp25/sp25.scn b/c/src/tests/sptests/sp25/sp25.scn
deleted file mode 100644
index af2599663d..0000000000
--- a/c/src/tests/sptests/sp25/sp25.scn
+++ /dev/null
@@ -1,29 +0,0 @@
-*** TEST 25 ***
-TA1 - rtems_region_ident - 0x20010002
-TA1 - rtems_region_get_segment - wait on 64 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000f9b8
-TA1 - rtems_region_get_segment - wait on 128 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000f930
-TA1 - rtems_region_get_segment - wait on 256 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000f828
-TA1 - rtems_region_get_segment - wait on 512 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000f620
-TA1 - rtems_region_get_segment - wait on 1024 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000f218
-TA1 - rtems_region_get_segment - wait on 2048 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000ea10
-TA1 - rtems_region_get_segment - wait on 4096 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000da08
-TA1 - rtems_region_get_segment - wait on 8192 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000ba00
-<pause>
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f828
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f620
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f9b8
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f930
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000da08
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000ea10
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000ba00
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f218
-TA1 - rtems_region_delete - walks heap if debug enabled
-*** END OF TEST 25 ***
diff --git a/c/src/tests/sptests/sp25/system.h b/c/src/tests/sptests/sp25/system.h
deleted file mode 100644
index 3435288228..0000000000
--- a/c/src/tests/sptests/sp25/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Task_1(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_REGIONS 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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/c/src/tests/sptests/sp25/task1.c b/c/src/tests/sptests/sp25/task1.c
deleted file mode 100644
index 45bf5780f4..0000000000
--- a/c/src/tests/sptests/sp25/task1.c
+++ /dev/null
@@ -1,241 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ], &region_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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/sptests/spfatal/Makefile.in b/c/src/tests/sptests/spfatal/Makefile.in
deleted file mode 100644
index e44b222619..0000000000
--- a/c/src/tests/sptests/spfatal/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=spfatal
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init puterr fatal task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-DOCTYPES=scn 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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
- $(INSTALL) $(srcdir)/$(TEST).scn \
- ${PROJECT_RELEASE}/tests/screens/sptests//$(TEST).scn
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/spfatal/fatal.c b/c/src/tests/sptests/spfatal/fatal.c
deleted file mode 100644
index aef4a159de..0000000000
--- a/c/src/tests/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <setjmp.h>
-
-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 = BSP_Configuration;
- 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, &Cpu_table );
-}
-
diff --git a/c/src/tests/sptests/spfatal/init.c b/c/src/tests/sptests/spfatal/init.c
deleted file mode 100644
index 1892975f29..0000000000
--- a/c/src/tests/sptests/spfatal/init.c
+++ /dev/null
@@ -1,51 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/sptests/spfatal/puterr.c b/c/src/tests/sptests/spfatal/puterr.c
deleted file mode 100644
index d5404d3d1b..0000000000
--- a/c/src/tests/sptests/spfatal/puterr.c
+++ /dev/null
@@ -1,68 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/spfatal/spfatal.doc b/c/src/tests/sptests/spfatal/spfatal.doc
deleted file mode 100644
index b6ff6b5504..0000000000
--- a/c/src/tests/sptests/spfatal/spfatal.doc
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/sptests/spfatal/spfatal.scn b/c/src/tests/sptests/spfatal/spfatal.scn
deleted file mode 100644
index ecb9f63597..0000000000
--- a/c/src/tests/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/c/src/tests/sptests/spfatal/system.h b/c/src/tests/sptests/spfatal/system.h
deleted file mode 100644
index f2391c2a94..0000000000
--- a/c/src/tests/sptests/spfatal/system.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_configuration_table New_Configuration;
-
-extern rtems_extensions_table Extensions;
-extern rtems_configuration_table BSP_Configuration;
-extern rtems_cpu_table Cpu_table;
-
-/* end of include file */
diff --git a/c/src/tests/sptests/spfatal/task1.c b/c/src/tests/sptests/spfatal/task1.c
deleted file mode 100644
index f7298ab2a4..0000000000
--- a/c/src/tests/sptests/spfatal/task1.c
+++ /dev/null
@@ -1,29 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/sptests/spsize/Makefile.in b/c/src/tests/sptests/spsize/Makefile.in
deleted file mode 100644
index bf8ae8f835..0000000000
--- a/c/src/tests/sptests/spsize/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=init getint size
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-SRCS=$(DOCS) $(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-PGM=${ARCH}/size.exe
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/sptests/spsize/getint.c b/c/src/tests/sptests/spsize/getint.c
deleted file mode 100644
index 01eae17fec..0000000000
--- a/c/src/tests/sptests/spsize/getint.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* getint
- *
- * This routine reads and returns an integer.
- * It assumes decimal.
- *
- * Input parameters: NONE
- *
- * Output parameters:
- * returns - number read
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-int getint( void )
-{
- char buff[16];
-
- gets(buff);
- return atoi(buff);
-}
diff --git a/c/src/tests/sptests/spsize/init.c b/c/src/tests/sptests/spsize/init.c
deleted file mode 100644
index f7d3b67fd6..0000000000
--- a/c/src/tests/sptests/spsize/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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: exit( 0 );
- default: continue;
- }
- } while ( FOREVER );
-#endif
-}
diff --git a/c/src/tests/sptests/spsize/size.c b/c/src/tests/sptests/spsize/size.c
deleted file mode 100644
index 9ebad1aad6..0000000000
--- a/c/src/tests/sptests/spsize/size.c
+++ /dev/null
@@ -1,650 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/config.h>
-#include <rtems/directives.h>
-#include <rtems/score/apiext.h>
-#include <rtems/score/copyrt.h>
-#include <rtems/rtems/clock.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/rtems/dpmem.h>
-#include <rtems/rtems/event.h>
-#include <rtems/extension.h>
-#include <rtems/fatal.h>
-#include <rtems/init.h>
-#include <rtems/score/isr.h>
-#include <rtems/rtems/intr.h>
-#include <rtems/io.h>
-#include <rtems/rtems/message.h>
-#include <rtems/rtems/mp.h>
-#include <rtems/score/mpci.h>
-#include <rtems/rtems/part.h>
-#include <rtems/score/priority.h>
-#include <rtems/rtems/ratemon.h>
-#include <rtems/rtems/region.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/rtems/signal.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/timer.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/userext.h>
-#include <rtems/score/wkspace.h>
-
-#include <stdlib.h>
-
-/* These are always defined by the executive.
- *
- * #include <rtems/copyrt.h>
- * #include <rtems/tables.h>
- * #include <rtems/sptables.h>
- */
-#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
-#define PER_GOBJECT (long) (sizeof (Objects_MP_Control))
-#define PER_PROXY (long) (sizeof (Thread_Proxy_control))
-
-#if (CPU_ALL_TASKS_ARE_FP == TRUE)
-#define MPCI_RECEIVE_SERVER_FP (long) (sizeof( Context_Control_fp ))
-#else
-#define MPCI_RECEIVE_SERVER_FP (long) 0
-#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
-
-#define SYSTEM_TASKS \
- (STACK_MINIMUM_SIZE + \
- MPCI_RECEIVE_SERVER_STACK_SIZE + \
- (2*sizeof(Thread_Control))) + \
- MPCI_RECEIVE_SERVER_FP + \
- SYSTEM_IDLE_FP
-
-#define rtems_unsigned32 unsigned32
-
-rtems_unsigned32 sys_req;
-
-/* to avoid warnings */
-int puts();
-int printf();
-int getint();
-#undef getchar
-int getchar();
-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) +
-
-/*eventmp.h*/ 0 +
-
-/*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 +
-
-/*mp.h*/ 0 +
-
-/*mpci.h*/ (sizeof _MPCI_Remote_blocked_threads) +
- (sizeof _MPCI_Semaphore) +
- (sizeof _MPCI_table) +
- (sizeof _MPCI_Receive_server_tcb) +
- (sizeof _MPCI_Packet_processors) +
-
-/*mppkt.h*/ 0 +
-
-/*mptables.h*/ 0 +
-
-/*msgmp.h*/ 0 +
-
-/*object.h*/ (sizeof _Objects_Local_node) +
- (sizeof _Objects_Maximum_nodes) +
- (sizeof _Objects_Information_table) +
-
-/*objectmp.h*/ (sizeof _Objects_MP_Maximum_global_objects) +
- (sizeof _Objects_MP_Inactive_global_objects) +
-
-/*options.h*/ 0 +
-
-/*part.h*/ (sizeof _Partition_Information) +
-
-/*partmp.h*/ 0 +
-
-/*priority.h*/ (sizeof _Priority_Major_bit_map) +
- (sizeof _Priority_Bit_map) +
-
-/*ratemon.h*/ (sizeof _Rate_monotonic_Information) +
-
-/*region.h*/ (sizeof _Region_Information) +
-
-/*regionmp.h*/ 0 +
-
-/*rtems.h*/ /* Not applicable */
-
-/*sem.h*/ (sizeof _Semaphore_Information) +
-
-/*semmp.h*/ 0 +
-
-/*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) +
-
-/*taskmp.h*/ 0 +
-
-/*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) +
- (sizeof _Thread_Allocated_fp) +
- (sizeof _Thread_Internal_information) +
- (sizeof _Thread_Idle) +
-
-/*threadmp.h*/ (sizeof _Thread_MP_Receive) +
- (sizeof _Thread_MP_Active_proxies) +
- (sizeof _Thread_MP_Inactive_proxies) +
-
-/*threadq.h*/ (sizeof _Thread_queue_Extract_table) +
-
-/*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) +
- (sizeof _CPU_Interrupt_stack_low) +
- (sizeof _CPU_Interrupt_stack_high);
-
-#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) +
-#ifndef 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);
-
-#ifndef NO_TABLE_MOVE
-uninitialized += (sizeof _CPU_Trap_Table_area);
-#endif
-
-#ifdef erc32
-uninitialized += (sizeof _ERC32_MEC_Timer_Control_Mirror);
-#endif
-
-
-#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) +
- (sizeof _Entry_points) +
-
-
-/*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/c/src/tests/sptests/spsize/system.h b/c/src/tests/sptests/spsize/system.h
deleted file mode 100644
index 21abdab2f7..0000000000
--- a/c/src/tests/sptests/spsize/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-int getint( void );
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/c/src/tests/support/Makefile.in b/c/src/tests/support/Makefile.in
deleted file mode 100644
index d67efb6814..0000000000
--- a/c/src/tests/support/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=include stubdr wrapup
diff --git a/c/src/tests/support/include/Makefile.in b/c/src/tests/support/include/Makefile.in
deleted file mode 100644
index 30e7468784..0000000000
--- a/c/src/tests/support/include/Makefile.in
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES= $(srcdir)/tmacros.h
-
-SYS_H_FILES=
-
-SRCS=$(H_FILES) $(SYS_H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(SYS_H_FILES) $(PROJECT_INCLUDE)/sys
-
diff --git a/c/src/tests/support/include/tmacros.h b/c/src/tests/support/include/tmacros.h
deleted file mode 100644
index ec2b5a0409..0000000000
--- a/c/src/tests/support/include/tmacros.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/* tmacros.h
- *
- * This include file contains macros which are useful in the RTEMS
- * test suites.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <bsp.h> /* includes <rtems.h> */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#define FOREVER 1 /* infinite loop */
-
-#ifdef TEST_INIT
-#define TEST_EXTERN
-#define CONFIGURE_INIT
-#else
-#define TEST_EXTERN extern
-#endif
-
-#define directive_failed( dirstat, failmsg ) \
- fatal_directive_status( dirstat, RTEMS_SUCCESSFUL, failmsg )
-
-#define fatal_directive_status( stat, desired, msg ) \
- do { \
- if ( (stat) != (desired) ) { \
- printf( "\n%s FAILED -- expected (%d) got (%d)\n", \
- (msg), (desired), (stat) ); \
- fflush(stdout); \
- exit( stat ); \
- } \
- } while ( 0 )
-
-#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 ); \
- fflush(stdout); \
- } while ( 0 )
-
-#define put_dot( c ) putchar( c ); fflush( stdout )
-
-#define new_line puts( "" )
-
-#define puts_nocr printf
-
-#ifdef RTEMS_TEST_NO_PAUSE
-#define rtems_test_pause() \
- do { \
- printf( "<pause>\n" ); fflush( stdout ); \
- } while ( 0 )
-
-#define rtems_test_pause_and_screen_number( _screen ) \
- do { \
- printf( "<pause - screen %d>\n", (_screen) ); fflush( stdout ); \
- } while ( 0 )
-#else
-#define rtems_test_pause() \
- do { \
- char buffer[ 80 ]; \
- printf( "<pause>" ); fflush( stdout ); \
- gets( buffer ); \
- puts( "" ); \
- } while ( 0 )
-
-#define rtems_test_pause_and_screen_number( _screen ) \
- do { \
- char buffer[ 80 ]; \
- printf( "<pause - screen %d>", (_screen) ); fflush( stdout ); \
- 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' ); \
-}
-
-#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; }
-
-#define task_number( tid ) \
- ( rtems_get_index( tid ) - \
- BSP_Configuration.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/c/src/tests/support/stubdr/Makefile.in b/c/src/tests/support/stubdr/Makefile.in
deleted file mode 100644
index 84dc839e9e..0000000000
--- a/c/src/tests/support/stubdr/Makefile.in
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-PGM=${ARCH}/stubdr.rel
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=open close read write init cntrl
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=$(srcdir)/stubdrv.h
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(DOCS) $(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${PGM}: ${SRCS} ${OBJS}
- $(make-rel)
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL_VARIANT) -m 644 $(PGM) ${PROJECT_RELEASE}/lib
diff --git a/c/src/tests/support/stubdr/close.c b/c/src/tests/support/stubdr/close.c
deleted file mode 100644
index 4397877894..0000000000
--- a/c/src/tests/support/stubdr/close.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Stub_close
- *
- * This routine is the terminal driver close routine.
- *
- * Input parameters:
- * major - device major number
- * minor - device minor number
- * pargb - pointer to close parameter block
- *
- * Output parameters:
- * rval - STUB_SUCCESSFUL
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "stubdrv.h"
-
-rtems_device_driver Stub_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return STUB_SUCCESSFUL;
-}
diff --git a/c/src/tests/support/stubdr/cntrl.c b/c/src/tests/support/stubdr/cntrl.c
deleted file mode 100644
index f3ecb378da..0000000000
--- a/c/src/tests/support/stubdr/cntrl.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Stub_control
- *
- * This routine is the terminal driver control routine.
- *
- * Input parameters:
- * major - device major number
- * minor - device minor number
- * pargp - pointer to cntrl parameter block
- *
- * Output parameters:
- * rval - STUB_SUCCESSFUL
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "stubdrv.h"
-
-rtems_device_driver Stub_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return STUB_SUCCESSFUL;
-}
diff --git a/c/src/tests/support/stubdr/init.c b/c/src/tests/support/stubdr/init.c
deleted file mode 100644
index bcda7f77cf..0000000000
--- a/c/src/tests/support/stubdr/init.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Stub_initialize
- *
- * This routine is the terminal driver init routine.
- *
- * Input parameters:
- * major - device major number
- * minor - device minor number
- * pargp - pointer to parameter block
- *
- * Output parameters:
- * rval - STUB_SUCCESSFUL
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "stubdrv.h"
-
-rtems_unsigned32 STUB_major;
-
-rtems_device_driver Stub_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- STUB_major = major;
- return STUB_SUCCESSFUL;
-}
diff --git a/c/src/tests/support/stubdr/open.c b/c/src/tests/support/stubdr/open.c
deleted file mode 100644
index acc88d5bfd..0000000000
--- a/c/src/tests/support/stubdr/open.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Stub_open
- *
- * This routine is the terminal driver open routine.
- *
- * Input parameters:
- * major - device major number
- * minor - device minor number
- * pargb - pointer to open parameter block
- *
- * Output parameters:
- * rval - STUB_SUCCESSFUL
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "stubdrv.h"
-
-rtems_device_driver Stub_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return STUB_SUCCESSFUL;
-}
diff --git a/c/src/tests/support/stubdr/read.c b/c/src/tests/support/stubdr/read.c
deleted file mode 100644
index b02ffc2e22..0000000000
--- a/c/src/tests/support/stubdr/read.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Stub_read
- *
- * This routine is the terminal driver read routine.
- *
- * Input parameters:
- * major - device major number
- * minor - device minor number
- * pargp - pointer to read parameter block
- *
- * Output parameters:
- * rval - STUB_SUCCESSFUL
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "stubdrv.h"
-
-rtems_device_driver Stub_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return STUB_SUCCESSFUL;
-}
diff --git a/c/src/tests/support/stubdr/stubdrv.h b/c/src/tests/support/stubdr/stubdrv.h
deleted file mode 100644
index c4544b6fc3..0000000000
--- a/c/src/tests/support/stubdr/stubdrv.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* stubdrv.h
- *
- * This file describes the Stub Driver for all boards.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STUB_DRIVER_h
-#define __STUB_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define STUB_DRIVER_TABLE_ENTRY \
- { Stub_initialize, NULL, NULL, NULL, NULL, NULL }
-
-#define STUB_SUCCESSFUL RTEMS_SUCCESSFUL
-
-rtems_device_driver Stub_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver Stub_open(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver Stub_close(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver Stub_read(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver Stub_write(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver Stub_control(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/c/src/tests/support/stubdr/write.c b/c/src/tests/support/stubdr/write.c
deleted file mode 100644
index fc7bca43c7..0000000000
--- a/c/src/tests/support/stubdr/write.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Stub_write
- *
- * This routine is the terminal driver write routine.
- *
- * Input parameters:
- * major - device major number
- * minor - device minor number
- * pargp - pointer to write parameter block
- *
- * Output parameters:
- * rval - STUB_SUCCESSFUL
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include "stubdrv.h"
-
-rtems_device_driver Stub_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return STUB_SUCCESSFUL;
-}
diff --git a/c/src/tests/support/wrapup/Makefile.in b/c/src/tests/support/wrapup/Makefile.in
deleted file mode 100644
index 31f78c914b..0000000000
--- a/c/src/tests/support/wrapup/Makefile.in
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-GENERIC_PIECES=stubdr
-
-# bummer; have to use $foreach since % pattern subst rules only replace 1x
-OBJS=$(foreach piece, $(GENERIC_PIECES), ../$(piece)/$(ARCH)/$(piece).rel)
-LIB=$(ARCH)/libtest.a
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-$(LIB): ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
-
diff --git a/c/src/tests/tmtests/Makefile.in b/c/src/tests/tmtests/Makefile.in
deleted file mode 100644
index c381a590c2..0000000000
--- a/c/src/tests/tmtests/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-all: README
-
-SUB_DIRS=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
diff --git a/c/src/tests/tmtests/README b/c/src/tests/tmtests/README
deleted file mode 100644
index c27617d5a3..0000000000
--- a/c/src/tests/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/c/src/tests/tmtests/include/Makefile.in b/c/src/tests/tmtests/include/Makefile.in
deleted file mode 100644
index ad9869bf96..0000000000
--- a/c/src/tests/tmtests/include/Makefile.in
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-H_FILES= $(srcdir)/timesys.h
-
-SYS_H_FILES=
-
-SRCS=$(H_FILES) $(SYS_H_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: $(SRCS)
- $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)
- $(INSTALL) -m 444 $(SYS_H_FILES) $(PROJECT_INCLUDE)/sys
-
diff --git a/c/src/tests/tmtests/include/timesys.h b/c/src/tests/tmtests/include/timesys.h
deleted file mode 100644
index 40337e9924..0000000000
--- a/c/src/tests/tmtests/include/timesys.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* timesys.h
- *
- * This header file contains the global variables for the Time
- * suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/*
- * How many times a particular operation is performed while timed.
- */
-
-#define OPERATION_COUNT 100
-#define IT_COUNT 100
-
-/* 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/c/src/tests/tmtests/tm01/Makefile.in b/c/src/tests/tmtests/tm01/Makefile.in
deleted file mode 100644
index 106ffc1074..0000000000
--- a/c/src/tests/tmtests/tm01/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm01
-
-MANAGERS=io semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm01/system.h b/c/src/tests/tmtests/tm01/system.h
deleted file mode 100644
index f66403dcdc..0000000000
--- a/c/src/tests/tmtests/tm01/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm01/task1.c b/c/src/tests/tmtests/tm01/task1.c
deleted file mode 100644
index e3a6b49dad..0000000000
--- a/c/src/tests/tmtests/tm01/task1.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm01/tm01.doc b/c/src/tests/tmtests/tm01/tm01.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm01/tm01.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm02/Makefile.in b/c/src/tests/tmtests/tm02/Makefile.in
deleted file mode 100644
index 00d88c3098..0000000000
--- a/c/src/tests/tmtests/tm02/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm02
-
-MANAGERS=io semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm02/system.h b/c/src/tests/tmtests/tm02/system.h
deleted file mode 100644
index 2fd0f720d0..0000000000
--- a/c/src/tests/tmtests/tm02/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm02/task1.c b/c/src/tests/tmtests/tm02/task1.c
deleted file mode 100644
index cd7d73e78d..0000000000
--- a/c/src/tests/tmtests/tm02/task1.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm02/tm02.doc b/c/src/tests/tmtests/tm02/tm02.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm02/tm02.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm03/Makefile.in b/c/src/tests/tmtests/tm03/Makefile.in
deleted file mode 100644
index b79d3779b0..0000000000
--- a/c/src/tests/tmtests/tm03/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm03
-
-MANAGERS=io semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm03/system.h b/c/src/tests/tmtests/tm03/system.h
deleted file mode 100644
index 2fd0f720d0..0000000000
--- a/c/src/tests/tmtests/tm03/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm03/task1.c b/c/src/tests/tmtests/tm03/task1.c
deleted file mode 100644
index 0b6d8e6263..0000000000
--- a/c/src/tests/tmtests/tm03/task1.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm03/tm03.doc b/c/src/tests/tmtests/tm03/tm03.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm03/tm03.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm04/Makefile.in b/c/src/tests/tmtests/tm04/Makefile.in
deleted file mode 100644
index 22af1721f4..0000000000
--- a/c/src/tests/tmtests/tm04/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm04
-
-MANAGERS=io semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm04/system.h b/c/src/tests/tmtests/tm04/system.h
deleted file mode 100644
index a31ee198f7..0000000000
--- a/c/src/tests/tmtests/tm04/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm04/task1.c b/c/src/tests/tmtests/tm04/task1.c
deleted file mode 100644
index 2ba3932016..0000000000
--- a/c/src/tests/tmtests/tm04/task1.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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/c/src/tests/tmtests/tm04/tm04.doc b/c/src/tests/tmtests/tm04/tm04.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm04/tm04.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm05/Makefile.in b/c/src/tests/tmtests/tm05/Makefile.in
deleted file mode 100644
index ca9177854f..0000000000
--- a/c/src/tests/tmtests/tm05/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm05
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm05/system.h b/c/src/tests/tmtests/tm05/system.h
deleted file mode 100644
index 2fd0f720d0..0000000000
--- a/c/src/tests/tmtests/tm05/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm05/task1.c b/c/src/tests/tmtests/tm05/task1.c
deleted file mode 100644
index 959bab006a..0000000000
--- a/c/src/tests/tmtests/tm05/task1.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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/c/src/tests/tmtests/tm05/tm05.doc b/c/src/tests/tmtests/tm05/tm05.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm05/tm05.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm06/Makefile.in b/c/src/tests/tmtests/tm06/Makefile.in
deleted file mode 100644
index 48f0041d95..0000000000
--- a/c/src/tests/tmtests/tm06/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm06
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm06/system.h b/c/src/tests/tmtests/tm06/system.h
deleted file mode 100644
index 2fd0f720d0..0000000000
--- a/c/src/tests/tmtests/tm06/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm06/task1.c b/c/src/tests/tmtests/tm06/task1.c
deleted file mode 100644
index 7b0a31efe9..0000000000
--- a/c/src/tests/tmtests/tm06/task1.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
-
-rtems_task null_task(
- rtems_task_argument argument
-)
-{
- while ( FOREVER )
- ;
-}
diff --git a/c/src/tests/tmtests/tm06/tm06.doc b/c/src/tests/tmtests/tm06/tm06.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm06/tm06.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm07/Makefile.in b/c/src/tests/tmtests/tm07/Makefile.in
deleted file mode 100644
index af170e9095..0000000000
--- a/c/src/tests/tmtests/tm07/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm07
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm07/system.h b/c/src/tests/tmtests/tm07/system.h
deleted file mode 100644
index 2fd0f720d0..0000000000
--- a/c/src/tests/tmtests/tm07/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm07/task1.c b/c/src/tests/tmtests/tm07/task1.c
deleted file mode 100644
index 09380a67c2..0000000000
--- a/c/src/tests/tmtests/tm07/task1.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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/c/src/tests/tmtests/tm07/tm07.doc b/c/src/tests/tmtests/tm07/tm07.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm07/tm07.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm08/Makefile.in b/c/src/tests/tmtests/tm08/Makefile.in
deleted file mode 100644
index 3080df91f4..0000000000
--- a/c/src/tests/tmtests/tm08/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm08
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm08/system.h b/c/src/tests/tmtests/tm08/system.h
deleted file mode 100644
index 2fd0f720d0..0000000000
--- a/c/src/tests/tmtests/tm08/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm08/task1.c b/c/src/tests/tmtests/tm08/task1.c
deleted file mode 100644
index e2527797ba..0000000000
--- a/c/src/tests/tmtests/tm08/task1.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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/c/src/tests/tmtests/tm08/tm08.doc b/c/src/tests/tmtests/tm08/tm08.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm08/tm08.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm09/Makefile.in b/c/src/tests/tmtests/tm09/Makefile.in
deleted file mode 100644
index d6af7f56fb..0000000000
--- a/c/src/tests/tmtests/tm09/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm09
-
-MANAGERS=io message
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm09/system.h b/c/src/tests/tmtests/tm09/system.h
deleted file mode 100644
index c973e40ffc..0000000000
--- a/c/src/tests/tmtests/tm09/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm09/task1.c b/c/src/tests/tmtests/tm09/task1.c
deleted file mode 100644
index 0df6233c6e..0000000000
--- a/c/src/tests/tmtests/tm09/task1.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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" );
-}
-
-rtems_task Test_task (
- rtems_task_argument argument
-)
-{
- Timer_initialize();
- rtems_message_queue_create(
- 1,
- OPERATION_COUNT,
- 16,
- 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 ***" );
- 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, (long (*)[4])buffer, 16 );
- 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, (long (*)[4])buffer, 16 );
- 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,
- 16
- );
- 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/c/src/tests/tmtests/tm09/tm09.doc b/c/src/tests/tmtests/tm09/tm09.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm09/tm09.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm10/Makefile.in b/c/src/tests/tmtests/tm10/Makefile.in
deleted file mode 100644
index 7d6654249e..0000000000
--- a/c/src/tests/tmtests/tm10/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm10
-
-MANAGERS=io message
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm10/system.h b/c/src/tests/tmtests/tm10/system.h
deleted file mode 100644
index e406249fd2..0000000000
--- a/c/src/tests/tmtests/tm10/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm10/task1.c b/c/src/tests/tmtests/tm10/task1.c
deleted file mode 100644
index 9177ed8b12..0000000000
--- a/c/src/tests/tmtests/tm10/task1.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm10/tm10.doc b/c/src/tests/tmtests/tm10/tm10.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm10/tm10.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm11/Makefile.in b/c/src/tests/tmtests/tm11/Makefile.in
deleted file mode 100644
index f9871da2d8..0000000000
--- a/c/src/tests/tmtests/tm11/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm11
-
-MANAGERS=io message
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm11/system.h b/c/src/tests/tmtests/tm11/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/c/src/tests/tmtests/tm11/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm11/task1.c b/c/src/tests/tmtests/tm11/task1.c
deleted file mode 100644
index e67852aca3..0000000000
--- a/c/src/tests/tmtests/tm11/task1.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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" );
-}
-
-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,
- 16,
- 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, (long (*)[4]) Buffer, 16 );
-}
-
-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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm11/tm11.doc b/c/src/tests/tmtests/tm11/tm11.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm11/tm11.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm12/Makefile.in b/c/src/tests/tmtests/tm12/Makefile.in
deleted file mode 100644
index dc09233b53..0000000000
--- a/c/src/tests/tmtests/tm12/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm12
-
-MANAGERS=io message
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm12/system.h b/c/src/tests/tmtests/tm12/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/c/src/tests/tmtests/tm12/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm12/task1.c b/c/src/tests/tmtests/tm12/task1.c
deleted file mode 100644
index d8a427c618..0000000000
--- a/c/src/tests/tmtests/tm12/task1.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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
-);
-
-
-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,
- 16,
- 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, (long (*)[4]) Buffer, 16 );
- 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 ***" );
- 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/c/src/tests/tmtests/tm12/tm12.doc b/c/src/tests/tmtests/tm12/tm12.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm12/tm12.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm13/Makefile.in b/c/src/tests/tmtests/tm13/Makefile.in
deleted file mode 100644
index b6242c7d08..0000000000
--- a/c/src/tests/tmtests/tm13/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm13
-
-MANAGERS=io message
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm13/system.h b/c/src/tests/tmtests/tm13/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/c/src/tests/tmtests/tm13/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm13/task1.c b/c/src/tests/tmtests/tm13/task1.c
deleted file mode 100644
index 4071ded7a8..0000000000
--- a/c/src/tests/tmtests/tm13/task1.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 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,
- 16,
- 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, (long (*)[4]) Buffer, 16 );
-}
-
-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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm13/tm13.doc b/c/src/tests/tmtests/tm13/tm13.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm13/tm13.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm14/Makefile.in b/c/src/tests/tmtests/tm14/Makefile.in
deleted file mode 100644
index 44fe651e53..0000000000
--- a/c/src/tests/tmtests/tm14/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm14
-
-MANAGERS=io message
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm14/system.h b/c/src/tests/tmtests/tm14/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/c/src/tests/tmtests/tm14/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm14/task1.c b/c/src/tests/tmtests/tm14/task1.c
deleted file mode 100644
index 30e1e8a38d..0000000000
--- a/c/src/tests/tmtests/tm14/task1.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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
-);
-
-
-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,
- 16,
- 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, (long (*)[4]) Buffer, 16 );
- 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 ***" );
- 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/c/src/tests/tmtests/tm14/tm14.doc b/c/src/tests/tmtests/tm14/tm14.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm14/tm14.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm15/Makefile.in b/c/src/tests/tmtests/tm15/Makefile.in
deleted file mode 100644
index 05f5d7696a..0000000000
--- a/c/src/tests/tmtests/tm15/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm15
-
-MANAGERS=io event
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm15/system.h b/c/src/tests/tmtests/tm15/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/c/src/tests/tmtests/tm15/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm15/task1.c b/c/src/tests/tmtests/tm15/task1.c
deleted file mode 100644
index c968f6d28c..0000000000
--- a/c/src/tests/tmtests/tm15/task1.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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/c/src/tests/tmtests/tm15/tm15.doc b/c/src/tests/tmtests/tm15/tm15.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm15/tm15.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm16/Makefile.in b/c/src/tests/tmtests/tm16/Makefile.in
deleted file mode 100644
index b42ea2af7b..0000000000
--- a/c/src/tests/tmtests/tm16/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm16
-
-MANAGERS=io event
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm16/system.h b/c/src/tests/tmtests/tm16/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/c/src/tests/tmtests/tm16/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm16/task1.c b/c/src/tests/tmtests/tm16/task1.c
deleted file mode 100644
index 93a65c17d9..0000000000
--- a/c/src/tests/tmtests/tm16/task1.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm16/tm16.doc b/c/src/tests/tmtests/tm16/tm16.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm16/tm16.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm17/Makefile.in b/c/src/tests/tmtests/tm17/Makefile.in
deleted file mode 100644
index 2e6a0bea66..0000000000
--- a/c/src/tests/tmtests/tm17/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm17
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm17/system.h b/c/src/tests/tmtests/tm17/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/c/src/tests/tmtests/tm17/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm17/task1.c b/c/src/tests/tmtests/tm17/task1.c
deleted file mode 100644
index 1ef373e61b..0000000000
--- a/c/src/tests/tmtests/tm17/task1.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm17/tm17.doc b/c/src/tests/tmtests/tm17/tm17.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm17/tm17.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm18/Makefile.in b/c/src/tests/tmtests/tm18/Makefile.in
deleted file mode 100644
index 6669ab25c9..0000000000
--- a/c/src/tests/tmtests/tm18/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm18
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm18/system.h b/c/src/tests/tmtests/tm18/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/c/src/tests/tmtests/tm18/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm18/task1.c b/c/src/tests/tmtests/tm18/task1.c
deleted file mode 100644
index e86b889848..0000000000
--- a/c/src/tests/tmtests/tm18/task1.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm18/tm18.doc b/c/src/tests/tmtests/tm18/tm18.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm18/tm18.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm19/Makefile.in b/c/src/tests/tmtests/tm19/Makefile.in
deleted file mode 100644
index 7b1d0c9bb6..0000000000
--- a/c/src/tests/tmtests/tm19/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm19
-
-MANAGERS=io signal
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm19/system.h b/c/src/tests/tmtests/tm19/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/c/src/tests/tmtests/tm19/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm19/task1.c b/c/src/tests/tmtests/tm19/task1.c
deleted file mode 100644
index 14bd4a9a9a..0000000000
--- a/c/src/tests/tmtests/tm19/task1.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm19/tm19.doc b/c/src/tests/tmtests/tm19/tm19.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm19/tm19.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm20/Makefile.in b/c/src/tests/tmtests/tm20/Makefile.in
deleted file mode 100644
index 534795e747..0000000000
--- a/c/src/tests/tmtests/tm20/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm20
-
-MANAGERS=io partition region
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm20/system.h b/c/src/tests/tmtests/tm20/system.h
deleted file mode 100644
index a96f77a41d..0000000000
--- a/c/src/tests/tmtests/tm20/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-#define CONFIGURE_TEST_NEEDS_STUB_DRIVER
-
-#define CONFIGURE_MAXIMUM_PARTITIONS 1
-#define CONFIGURE_MAXIMUM_REGIONS 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm20/task1.c b/c/src/tests/tmtests/tm20/task1.c
deleted file mode 100644
index 6f2505c7aa..0000000000
--- a/c/src/tests/tmtests/tm20/task1.c
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_device_major_number _STUB_major = 1;
-
-rtems_id Region_id;
-rtems_name Region_name;
-rtems_unsigned8 Region_area[ 2048 ] CPU_STRUCTURE_ALIGNMENT;
-
-rtems_id Partition_id;
-rtems_name Partition_name;
-rtems_unsigned8 Partition_area[ 2048 ] 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[ OPERATION_COUNT+1 ];
-
-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,
- 2048,
- 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++;
- }
-
- 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_semgent" );
-
- 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 ***" );
- 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/c/src/tests/tmtests/tm20/tm20.doc b/c/src/tests/tmtests/tm20/tm20.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm20/tm20.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm21/Makefile.in b/c/src/tests/tmtests/tm21/Makefile.in
deleted file mode 100644
index 020560c506..0000000000
--- a/c/src/tests/tmtests/tm21/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm21
-
-MANAGERS=io dpmem message partition region semaphore rate_monotonic timer
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm21/system.h b/c/src/tests/tmtests/tm21/system.h
deleted file mode 100644
index 28b5a31469..0000000000
--- a/c/src/tests/tmtests/tm21/system.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm21/task1.c b/c/src/tests/tmtests/tm21/task1.c
deleted file mode 100644
index f3fd4e04e3..0000000000
--- a/c/src/tests/tmtests/tm21/task1.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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" );
-}
-
-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 */
- 16,
- 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm21/tm21.doc b/c/src/tests/tmtests/tm21/tm21.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm21/tm21.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm22/Makefile.in b/c/src/tests/tmtests/tm22/Makefile.in
deleted file mode 100644
index 54e4aca990..0000000000
--- a/c/src/tests/tmtests/tm22/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm22
-
-MANAGERS=io message
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm22/system.h b/c/src/tests/tmtests/tm22/system.h
deleted file mode 100644
index 8884d8eaf6..0000000000
--- a/c/src/tests/tmtests/tm22/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm22/task1.c b/c/src/tests/tmtests/tm22/task1.c
deleted file mode 100644
index 817f3a71d6..0000000000
--- a/c/src/tests/tmtests/tm22/task1.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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
-);
-
-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,
- 16,
- 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,
- (long (*)[4]) Buffer,
- 16,
- &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,
- (long (*)[4]) Buffer,
- 16,
- &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 ***" );
- exit( 0 );
-}
-
-rtems_task Preempt_task(
- rtems_task_argument argument
-)
-{
- rtems_unsigned32 count;
-
- Timer_initialize();
- (void) rtems_message_queue_broadcast(
- Queue_id,
- (long (*)[4]) Buffer,
- 16,
- &count
- );
-
- /* should be preempted by low task */
-}
diff --git a/c/src/tests/tmtests/tm22/tm22.doc b/c/src/tests/tmtests/tm22/tm22.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm22/tm22.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm23/Makefile.in b/c/src/tests/tmtests/tm23/Makefile.in
deleted file mode 100644
index 6838580789..0000000000
--- a/c/src/tests/tmtests/tm23/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm23
-
-MANAGERS=io event timer
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm23/system.h b/c/src/tests/tmtests/tm23/system.h
deleted file mode 100644
index 246a14480d..0000000000
--- a/c/src/tests/tmtests/tm23/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm23/task1.c b/c/src/tests/tmtests/tm23/task1.c
deleted file mode 100644
index 70c59e93f5..0000000000
--- a/c/src/tests/tmtests/tm23/task1.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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<OPERATION_COUNT ; i++ )
- 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: inactive",
- end_time,
- OPERATION_COUNT,
- overhead,
- CALLING_OVERHEAD_TIMER_CANCEL
- );
-
- for ( Timer_initialize(), i=0 ; i<OPERATION_COUNT ; i++ )
- Timer_initialize();
- for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_timer_reset( Timer_id[ index ] );
- end_time = Read_timer();
-
- put_time(
- "rtems_timer_reset: inactive",
- end_time,
- OPERATION_COUNT,
- overhead,
- CALLING_OVERHEAD_TIMER_RESET
- );
-
- Timer_initialize();
- for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_timer_reset( Timer_id[ index ] );
- end_time = Read_timer();
-
- put_time(
- "rtems_timer_reset: active",
- end_time,
- OPERATION_COUNT,
- overhead,
- CALLING_OVERHEAD_TIMER_RESET
- );
-
- for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_timer_reset( Timer_id[ index ] );
-
- build_time( &time_of_day, 12, 31, 1988, 9, 0, 0, 0 );
-
- status = rtems_clock_set( &time_of_day );
- directive_failed( status, "rtems_clock_set" );
-
- time_of_day.year = 1989;
-
- Timer_initialize();
- for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_timer_fire_when(
- Timer_id[ index ], &time_of_day, null_delay, NULL );
- end_time = Read_timer();
-
- put_time(
- "rtems_timer_fire_when: inactive",
- end_time,
- OPERATION_COUNT,
- overhead,
- CALLING_OVERHEAD_TIMER_FIRE_WHEN
- );
-
- Timer_initialize();
- for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_timer_fire_when(
- Timer_id[ index ], &time_of_day, null_delay, NULL );
- end_time = Read_timer();
-
- put_time(
- "rtems_timer_fire_when: active",
- end_time,
- OPERATION_COUNT,
- overhead,
- CALLING_OVERHEAD_TIMER_FIRE_WHEN
- );
-
- Timer_initialize();
- for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_timer_delete( Timer_id[ index ] );
- end_time = Read_timer();
-
- put_time(
- "rtems_timer_delete: active",
- end_time,
- OPERATION_COUNT,
- overhead,
- CALLING_OVERHEAD_TIMER_DELETE
- );
-
- Timer_initialize();
- for ( index=1 ; index <= OPERATION_COUNT ; index++ ) {
- status = rtems_timer_create( index, &Timer_id[ index ] );
- directive_failed( status, "rtems_timer_create" );
-
- status = rtems_timer_fire_after( Timer_id[ index ], 500, null_delay, NULL );
- directive_failed( status, "rtems_timer_fire_after" );
-
- status = rtems_timer_cancel( Timer_id[ index ] );
- directive_failed( status, "rtems_timer_cancel" );
- }
-
- Timer_initialize();
- for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_timer_delete( Timer_id[ index ] );
- end_time = Read_timer();
-
- put_time(
- "rtems_timer_delete: inactive",
- end_time,
- OPERATION_COUNT,
- overhead,
- CALLING_OVERHEAD_TIMER_DELETE
- );
-
- Timer_initialize();
- (void) rtems_task_wake_when( &time_of_day );
-}
-
-rtems_task Middle_tasks(
- rtems_task_argument argument
-)
-{
- (void) rtems_task_wake_when( &time_of_day );
-}
-
-rtems_task Low_task(
- rtems_task_argument argument
-)
-{
- end_time = Read_timer();
-
- put_time(
- "rtems_task_wake_when",
- end_time,
- OPERATION_COUNT,
- 0,
- CALLING_OVERHEAD_TASK_WAKE_WHEN
- );
-
- puts( "*** END OF TEST 23 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm23/tm23.doc b/c/src/tests/tmtests/tm23/tm23.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm23/tm23.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm24/Makefile.in b/c/src/tests/tmtests/tm24/Makefile.in
deleted file mode 100644
index 1b7b463eb4..0000000000
--- a/c/src/tests/tmtests/tm24/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm24
-
-MANAGERS=io message
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm24/system.h b/c/src/tests/tmtests/tm24/system.h
deleted file mode 100644
index 51fbb131b8..0000000000
--- a/c/src/tests/tmtests/tm24/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm24/task1.c b/c/src/tests/tmtests/tm24/task1.c
deleted file mode 100644
index a4e78f126a..0000000000
--- a/c/src/tests/tmtests/tm24/task1.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
- }
- (void) rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
-}
diff --git a/c/src/tests/tmtests/tm24/tm24.doc b/c/src/tests/tmtests/tm24/tm24.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm24/tm24.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm25/Makefile.in b/c/src/tests/tmtests/tm25/Makefile.in
deleted file mode 100644
index 0a2809bf8d..0000000000
--- a/c/src/tests/tmtests/tm25/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm25
-
-MANAGERS=io semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm25/system.h b/c/src/tests/tmtests/tm25/system.h
deleted file mode 100644
index a31ee198f7..0000000000
--- a/c/src/tests/tmtests/tm25/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm25/task1.c b/c/src/tests/tmtests/tm25/task1.c
deleted file mode 100644
index 6d79ed46a0..0000000000
--- a/c/src/tests/tmtests/tm25/task1.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm25/tm25.doc b/c/src/tests/tmtests/tm25/tm25.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm25/tm25.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm26/Makefile.in b/c/src/tests/tmtests/tm26/Makefile.in
deleted file mode 100644
index cab9d13b1a..0000000000
--- a/c/src/tests/tmtests/tm26/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm26
-
-MANAGERS=io semaphore
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm26/fptest.h b/c/src/tests/tmtests/tm26/fptest.h
deleted file mode 100644
index 551aa0989e..0000000000
--- a/c/src/tests/tmtests/tm26/fptest.h
+++ /dev/null
@@ -1,165 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <stdio.h>
-
-#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/c/src/tests/tmtests/tm26/system.h b/c/src/tests/tmtests/tm26/system.h
deleted file mode 100644
index a31ee198f7..0000000000
--- a/c/src/tests/tmtests/tm26/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm26/task1.c b/c/src/tests/tmtests/tm26/task1.c
deleted file mode 100644
index 4eb40b09d7..0000000000
--- a/c/src/tests/tmtests/tm26/task1.c
+++ /dev/null
@@ -1,580 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <rtems.h>
-#include "system.h"
-#include "fptest.h"
-#include <coverhd.h>
-#include <tmacros.h>
-#include <timesys.h>
-
-
-/* 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();
- _Context_Restore_fp( &_Thread_Executing->fp_context );
- _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();
- _Context_Save_fp( &executing->fp_context );
- _Context_Restore_fp( &_Thread_Executing->fp_context );
- _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();
- _Context_Save_fp( &executing->fp_context );
- _Context_Restore_fp( &_Thread_Executing->fp_context );
- _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();
- _Context_Save_fp( &executing->fp_context );
- _Context_Restore_fp( &_Thread_Executing->fp_context );
- _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 );
- 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
- );
-
- 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
- );
-
- 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 ***" );
- exit( 0 );
-}
-
diff --git a/c/src/tests/tmtests/tm26/tm26.doc b/c/src/tests/tmtests/tm26/tm26.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm26/tm26.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm27/Makefile.in b/c/src/tests/tmtests/tm27/Makefile.in
deleted file mode 100644
index 87a08bbcf9..0000000000
--- a/c/src/tests/tmtests/tm27/Makefile.in
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm27
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-
-# since we essentially are building an interrupt handler, must use CFLAGS_OS_V
-
-CFLAGS += $(CFLAGS_OS_V)
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm27/system.h b/c/src/tests/tmtests/tm27/system.h
deleted file mode 100644
index 51fbb131b8..0000000000
--- a/c/src/tests/tmtests/tm27/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm27/task1.c b/c/src/tests/tmtests/tm27/task1.c
deleted file mode 100644
index a852979986..0000000000
--- a/c/src/tests/tmtests/tm27/task1.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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
-#include "system.h"
-
-#include <bsp.h>
-
-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_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" );
-
- 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,
- 0
- );
-
- put_time(
- "interrupt exit overhead: returns to interrupted task",
- Interrupt_return_time,
- 1,
- 0,
- 0
- );
-
- /*
- * 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 ***" );
- 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,
- 0
- );
-
- 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/c/src/tests/tmtests/tm27/tm27.doc b/c/src/tests/tmtests/tm27/tm27.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm27/tm27.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm28/Makefile.in b/c/src/tests/tmtests/tm28/Makefile.in
deleted file mode 100644
index 44bb5a21d7..0000000000
--- a/c/src/tests/tmtests/tm28/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm28
-
-MANAGERS=io dpmem
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm28/system.h b/c/src/tests/tmtests/tm28/system.h
deleted file mode 100644
index dbadf8b14c..0000000000
--- a/c/src/tests/tmtests/tm28/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm28/task1.c b/c/src/tests/tmtests/tm28/task1.c
deleted file mode 100644
index aa5df73865..0000000000
--- a/c/src/tests/tmtests/tm28/task1.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm28/tm28.doc b/c/src/tests/tmtests/tm28/tm28.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm28/tm28.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tm29/Makefile.in b/c/src/tests/tmtests/tm29/Makefile.in
deleted file mode 100644
index d55070a540..0000000000
--- a/c/src/tests/tmtests/tm29/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tm29
-
-MANAGERS=io rate_monotonic
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tm29/system.h b/c/src/tests/tmtests/tm29/system.h
deleted file mode 100644
index c2b1355153..0000000000
--- a/c/src/tests/tmtests/tm29/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tm29/task1.c b/c/src/tests/tmtests/tm29/task1.c
deleted file mode 100644
index 779a0df49b..0000000000
--- a/c/src/tests/tmtests/tm29/task1.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tm29/tm29.doc b/c/src/tests/tmtests/tm29/tm29.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tm29/tm29.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tmck/Makefile.in b/c/src/tests/tmtests/tmck/Makefile.in
deleted file mode 100644
index ed39cab9b6..0000000000
--- a/c/src/tests/tmtests/tmck/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tmck
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=task1
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tmck/system.h b/c/src/tests/tmtests/tmck/system.h
deleted file mode 100644
index 43d3be0fb5..0000000000
--- a/c/src/tests/tmtests/tmck/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 2
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tmck/task1.c b/c/src/tests/tmtests/tmck/task1.c
deleted file mode 100644
index bee3bf5f5b..0000000000
--- a/c/src/tests/tmtests/tmck/task1.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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) || defined(go32)
- index--;
- continue;
-#else
- 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/c/src/tests/tmtests/tmck/tmck.doc b/c/src/tests/tmtests/tmck/tmck.doc
deleted file mode 100644
index b8997c7b35..0000000000
--- a/c/src/tests/tmtests/tmck/tmck.doc
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tmtests/tmoverhd/Makefile.in b/c/src/tests/tmtests/tmoverhd/Makefile.in
deleted file mode 100644
index d16061a4f3..0000000000
--- a/c/src/tests/tmtests/tmoverhd/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-TEST=tmoverhd
-
-MANAGERS=io
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=testtask empty
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=system.h
-
-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 $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGM)
- $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests
-
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-exe)
diff --git a/c/src/tests/tmtests/tmoverhd/dumrtems.h b/c/src/tests/tmtests/tmoverhd/dumrtems.h
deleted file mode 100644
index 7eee650ebc..0000000000
--- a/c/src/tests/tmtests/tmoverhd/dumrtems.h
+++ /dev/null
@@ -1,255 +0,0 @@
-/* dumrtems.h
- *
- * This include file contains phony macros to map
- * executive calls to Empty_directive().
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/c/src/tests/tmtests/tmoverhd/empty.c b/c/src/tests/tmtests/tmoverhd/empty.c
deleted file mode 100644
index cef38f2e73..0000000000
--- a/c/src/tests/tmtests/tmoverhd/empty.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/c/src/tests/tmtests/tmoverhd/system.h b/c/src/tests/tmtests/tmoverhd/system.h
deleted file mode 100644
index ea369d97cb..0000000000
--- a/c/src/tests/tmtests/tmoverhd/system.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* 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 <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 2
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/c/src/tests/tmtests/tmoverhd/testtask.c b/c/src/tests/tmtests/tmoverhd/testtask.c
deleted file mode 100644
index 96413ac722..0000000000
--- a/c/src/tests/tmtests/tmoverhd/testtask.c
+++ /dev/null
@@ -1,1279 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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( &BSP_Configuration, &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 ***" );
-
- exit( 0 );
-}
diff --git a/c/src/tests/tmtests/tmoverhd/tmoverhd.doc b/c/src/tests/tmtests/tmoverhd/tmoverhd.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/c/src/tests/tmtests/tmoverhd/tmoverhd.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/c/src/tests/tools/Makefile.in b/c/src/tests/tools/Makefile.in
deleted file mode 100644
index 6dba1f38f6..0000000000
--- a/c/src/tests/tools/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=generic $(wildcard $(RTEMS_CPU))
diff --git a/c/src/tests/tools/generic/Makefile.in b/c/src/tests/tools/generic/Makefile.in
deleted file mode 100644
index 283fdd7740..0000000000
--- a/c/src/tests/tools/generic/Makefile.in
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-DESTDIR=$(PROJECT_RELEASE)/tests
-
-PGMS=difftest sorttimes
-
-INSTALLED=$(PGMS:%=$(DESTDIR)/%)
-
-all: $(DESTDIR) $(PGMS) install
-
-install: $(INSTALLED)
-
-# Install the program
-$(DESTDIR)/%: %
- $(make-script)
diff --git a/c/src/tests/tools/generic/difftest b/c/src/tests/tools/generic/difftest
deleted file mode 100644
index 9a35d4285e..0000000000
--- a/c/src/tests/tools/generic/difftest
+++ /dev/null
@@ -1,115 +0,0 @@
-#!KSHELL -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 -- `echo sp?? mp??_? psx?? sp??_g mp??_?_g psx??_g`
- 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;;
- *)
- 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/c/src/tests/tools/generic/sorttimes b/c/src/tests/tools/generic/sorttimes
deleted file mode 100644
index e52bf25936..0000000000
--- a/c/src/tests/tools/generic/sorttimes
+++ /dev/null
@@ -1,194 +0,0 @@
-#!KSHELL -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
diff --git a/c/src/wrapup/Makefile.in b/c/src/wrapup/Makefile.in
deleted file mode 100644
index d7c6fcdaf9..0000000000
--- a/c/src/wrapup/Makefile.in
+++ /dev/null
@@ -1,73 +0,0 @@
-#
-# $Id$
-#
-# build and install "glommed" librtemsall.a
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-LIB=$(PROJECT_RELEASE)/lib/librtemsall${LIB_VARIANT}.a
-
-SRCS=$(wildcard $(PROJECT_RELEASE)/lib/libbsp$(LIB_VARIANT).a) \
- $(PROJECT_RELEASE)/lib/librtems$(LIB_VARIANT).a \
- $(wildcard $(PROJECT_RELEASE)/lib/libposix$(LIB_VARIANT).a) \
- $(wildcard $(PROJECT_RELEASE)/lib/libnetworking$(LIB_VARIANT).a) \
- $(wildcard $(PROJECT_RELEASE)/lib/libcpu$(LIB_VARIANT).a) \
- $(wildcard $(PROJECT_RELEASE)/lib/librtcio$(LIB_VARIANT).a) \
- $(wildcard $(PROJECT_RELEASE)/lib/libserialio$(LIB_VARIANT).a) \
- $(PROJECT_RELEASE)/lib/libcsupport$(LIB_VARIANT).a \
- $(PROJECT_RELEASE)/lib/libmisc$(LIB_VARIANT).a \
- $(wildcard $(PROJECT_RELEASE)/lib/rtems-ctor$(LIB_VARIANT).o) \
- $(wildcard $(PROJECT_RELEASE)/lib/libno-ctor$(LIB_VARIANT).a)
-
-CLEAN_ADDITIONS += $(ARCH)/check
-CLOBBER_ADDITIONS +=
-
-all: $(ARCH) $(LIB)
-
-install: all
-
-$(ARCH)/check:: $(SRCS)
- @$(RM) $@; touch $@;
- @for f in $(SRCS); do \
- case $$f in \
- *.o) echo " `basename $$f`" >> $@ \
- ;; \
- *.rel) echo " `basename $$f`" >> $@ \
- ;; \
- *.a) \
- ( list=`$(AR) t $$f`;\
- for i in $$list; do \
- if grep " $$i" $@; then \
- echo "ERROR -- $$i in multiple files"; exit 1; \
- fi;\
- echo " $$i" >> $@;\
- done; ) \
- ;; \
- esac; \
- done;
-
-$(LIB):: $(ARCH)/check
- @for f in $(SRCS); do \
- case $$f in \
- *.o) $(AR) ru $@ $$f \
- ;;\
- *.rel) $(AR) ru $@ $$f \
- ;;\
- *.a) \
- (cd $(ARCH); \
- list=`$(AR) t $$f`; \
- $(AR) x $$f $$list; $(AR) ru $@ $$list; \
- $(RM) $$list ;)\
- ;; \
- esac; \
- done;
- @$(RANLIB) $@
- @echo "*** Glommed $@"
diff --git a/c/update-tools/310_to_320_list b/c/update-tools/310_to_320_list
deleted file mode 100644
index adb9882a5b..0000000000
--- a/c/update-tools/310_to_320_list
+++ /dev/null
@@ -1,545 +0,0 @@
-#
-# External API name
-#
-# $Id$
-#
-initialize_executive rtems_initialize_executive
-initialize_executive_early rtems_initialize_executive_early
-initialize_executive_late rtems_initialize_executive_late
-shutdown_executive rtems_shutdown_executive
-task_create rtems_task_create
-task_ident rtems_task_ident
-task_start rtems_task_start
-task_restart rtems_task_restart
-task_delete rtems_task_delete
-task_suspend rtems_task_suspend
-task_resume rtems_task_resume
-task_set_priority rtems_task_set_priority
-task_mode rtems_task_mode
-task_get_note rtems_task_get_note
-task_set_note rtems_task_set_note
-task_wake_after rtems_task_wake_after
-task_wake_when rtems_task_wake_when
-interrupt_catch rtems_interrupt_catch
-clock_set rtems_clock_set
-clock_get rtems_clock_get
-clock_tick rtems_clock_tick
-extension_create rtems_extension_create
-extension_ident rtems_extension_ident
-extension_delete rtems_extension_delete
-timer_create rtems_timer_create
-timer_ident rtems_timer_ident
-timer_cancel rtems_timer_cancel
-timer_delete rtems_timer_delete
-timer_fire_after rtems_timer_fire_after
-timer_fire_when rtems_timer_fire_when
-timer_reset rtems_timer_reset
-semaphore_create rtems_semaphore_create
-semaphore_ident rtems_semaphore_ident
-semaphore_delete rtems_semaphore_delete
-semaphore_obtain rtems_semaphore_obtain
-semaphore_release rtems_semaphore_release
-message_queue_create rtems_message_queue_create
-message_queue_ident rtems_message_queue_ident
-message_queue_delete rtems_message_queue_delete
-message_queue_send rtems_message_queue_send
-message_queue_urgent rtems_message_queue_urgent
-message_queue_broadcast rtems_message_queue_broadcast
-message_queue_receive rtems_message_queue_receive
-message_queue_flush rtems_message_queue_flush
-event_send rtems_event_send
-event_receive rtems_event_receive
-signal_catch rtems_signal_catch
-signal_send rtems_signal_send
-partition_create rtems_partition_create
-partition_ident rtems_partition_ident
-partition_delete rtems_partition_delete
-partition_get_buffer rtems_partition_get_buffer
-partition_return_buffer rtems_partition_return_buffer
-region_create rtems_region_create
-region_extend rtems_region_extend
-region_ident rtems_region_ident
-region_delete rtems_region_delete
-region_get_segment rtems_region_get_segment
-region_get_segment_size rtems_region_get_segment_size
-region_return_segment rtems_region_return_segment
-port_create rtems_port_create
-port_ident rtems_port_ident
-port_delete rtems_port_delete
-port_external_to_internal rtems_port_external_to_internal
-port_internal_to_external rtems_port_internal_to_external
-io_initialize rtems_io_initialize
-io_open rtems_io_open
-io_close rtems_io_close
-io_read rtems_io_read
-io_write rtems_io_write
-io_control rtems_io_control
-fatal_error_occurred rtems_fatal_error_occurred
-rate_monotonic_create rtems_rate_monotonic_create
-rate_monotonic_ident rtems_rate_monotonic_ident
-rate_monotonic_delete rtems_rate_monotonic_delete
-rate_monotonic_cancel rtems_rate_monotonic_cancel
-rate_monotonic_period rtems_rate_monotonic_period
-multiprocessing_announce rtems_multiprocessing_announce
-#
-# Internal Names for API
-#
-_Initialize_Executive rtems_initialize_executive
-_Initialize_Executive_early rtems_initialize_executive_early
-_Initialize_Executive_late rtems_initialize_executive_late
-_Shutdown_Executive rtems_shutdown_executive
-_RTEMS_tasks_Create rtems_task_create
-_RTEMS_tasks_Name_to_id rtems_task_ident
-_RTEMS_tasks_Start rtems_task_start
-_RTEMS_tasks_Restart rtems_task_restart
-_RTEMS_tasks_Delete rtems_task_delete
-_RTEMS_tasks_Suspend rtems_task_suspend
-_RTEMS_tasks_Resume rtems_task_resume
-_RTEMS_tasks_Set_priority rtems_task_set_priority
-_RTEMS_tasks_Mode rtems_task_mode
-_RTEMS_tasks_Get_note rtems_task_get_note
-_RTEMS_tasks_Set_note rtems_task_set_note
-_RTEMS_tasks_Wake_after rtems_task_wake_after
-_RTEMS_tasks_Wake_when rtems_task_wake_when
-_Interrupt_Catch rtems_interrupt_catch
-_Clock_Set rtems_clock_set
-_Clock_Get rtems_clock_get
-_Clock_Tick rtems_clock_tick
-_Extension_Create rtems_extension_create
-_Extension_Name_to_id rtems_extension_ident
-_Extension_Delete rtems_extension_delete
-_Timer_Create rtems_timer_create
-_Timer_Name_to_id rtems_timer_ident
-_Timer_Cancel rtems_timer_cancel
-_Timer_Delete rtems_timer_delete
-_Timer_Fire_after rtems_timer_fire_after
-_Timer_Fire_when rtems_timer_fire_when
-_Timer_Reset rtems_timer_reset
-_Semaphore_Create rtems_semaphore_create
-_Semaphore_Name_to_id rtems_semaphore_ident
-_Semaphore_Delete rtems_semaphore_delete
-_Semaphore_Obtain rtems_semaphore_obtain
-_Semaphore_Release rtems_semaphore_release
-_Message_queue_Create rtems_message_queue_create
-_Message_queue_Name_to_id rtems_message_queue_ident
-_Message_queue_Delete rtems_message_queue_delete
-_Message_queue_Send rtems_message_queue_send
-_Message_queue_Urgent rtems_message_queue_urgent
-_Message_queue_Broadcast rtems_message_queue_broadcast
-_Message_queue_Receive rtems_message_queue_receive
-_Message_queue_Flush rtems_message_queue_flush
-_Event_Send rtems_event_send
-_Event_Receive rtems_event_receive
-_Signal_Catch rtems_signal_catch
-_Signal_Send rtems_signal_send
-_Partition_Create rtems_partition_create
-_Partition_Name_to_id rtems_partition_ident
-_Partition_Delete rtems_partition_delete
-_Partition_Get_buffer rtems_partition_get_buffer
-_Partition_Return_buffer rtems_partition_return_buffer
-_Region_Create rtems_region_create
-_Region_Extend rtems_region_extend
-_Region_Name_to_id rtems_region_ident
-_Region_Delete rtems_region_delete
-_Region_Get_segment rtems_region_get_segment
-_Region_Get_segment_size rtems_region_get_segment_size
-_Region_Return_segment rtems_region_return_segment
-_Dual_ported_memory_Create rtems_port_create
-_Dual_ported_memory_Name_to_id rtems_port_ident
-_Dual_ported_memory_Delete rtems_port_delete
-_Dual_ported_memory_External_to_internal rtems_port_external_to_internal
-_Dual_ported_memory_Internal_to_external rtems_port_internal_to_external
-_IO_Initialize rtems_io_initialize
-_IO_Open rtems_io_open
-_IO_Close rtems_io_close
-_IO_Read rtems_io_read
-_IO_Write rtems_io_write
-_IO_Control rtems_io_control
-_Fatal_Error_occurred rtems_fatal_error_occurred
-_Rate_monotonic_Create rtems_rate_monotonic_create
-_Rate_monotonic_Name_to_id rtems_rate_monotonic_ident
-_Rate_monotonic_Delete rtems_rate_monotonic_delete
-_Rate_monotonic_Cancel rtems_rate_monotonic_cancel
-_Rate_monotonic_Period rtems_rate_monotonic_period
-_Multiprocessing_Announce rtems_multiprocessing_announce
-#
-# Status (API names)
-#
-SUCCESSFUL RTEMS_SUCCESSFUL
-TASK_EXITTED RTEMS_TASK_EXITTED
-MP_NOT_CONFIGURED RTEMS_MP_NOT_CONFIGURED
-INVALID_NAME RTEMS_INVALID_NAME
-INVALID_ID RTEMS_INVALID_ID
-TOO_MANY RTEMS_TOO_MANY
-TIMEOUT RTEMS_TIMEOUT
-OBJECT_WAS_DELETED RTEMS_OBJECT_WAS_DELETED
-INVALID_SIZE RTEMS_INVALID_SIZE
-INVALID_ADDRESS RTEMS_INVALID_ADDRESS
-INVALID_NUMBER RTEMS_INVALID_NUMBER
-NOT_DEFINED RTEMS_NOT_DEFINED
-RESOURCE_IN_USE RTEMS_RESOURCE_IN_USE
-UNSATISFIED RTEMS_UNSATISFIED
-INCORRECT_STATE RTEMS_INCORRECT_STATE
-ALREADY_SUSPENDED RTEMS_ALREADY_SUSPENDED
-ILLEGAL_ON_SELF RTEMS_ILLEGAL_ON_SELF
-ILLEGAL_ON_REMOTE_OBJECT RTEMS_ILLEGAL_ON_REMOTE_OBJECT
-CALLED_FROM_ISR RTEMS_CALLED_FROM_ISR
-INVALID_PRIORITY RTEMS_INVALID_PRIORITY
-INVALID_CLOCK RTEMS_INVALID_CLOCK
-INVALID_NODE RTEMS_INVALID_NODE
-NOT_CONFIGURED RTEMS_NOT_CONFIGURED
-NOT_OWNER_OF_RESOURCE RTEMS_NOT_OWNER_OF_RESOURCE
-NOT_IMPLEMENTED RTEMS_NOT_IMPLEMENTED
-INTERNAL_ERROR RTEMS_INTERNAL_ERROR
-PROXY_BLOCKING RTEMS_PROXY_BLOCKING
-NO_MEMORY RTEMS_NO_MEMORY
-STATUS_CODES_FIRST RTEMS_STATUS_CODES_FIRST
-STATUS_CODES_LAST RTEMS_STATUS_CODES_LAST
-#
-# Status (Internal names)
-#
-STATUS_SUCCESSFUL RTEMS_SUCCESSFUL
-STATUS_TASK_EXITTED RTEMS_TASK_EXITTED
-STATUS_MP_NOT_CONFIGURED RTEMS_MP_NOT_CONFIGURED
-STATUS_INVALID_NAME RTEMS_INVALID_NAME
-STATUS_INVALID_ID RTEMS_INVALID_ID
-STATUS_TOO_MANY RTEMS_TOO_MANY
-STATUS_TIMEOUT RTEMS_TIMEOUT
-STATUS_OBJECT_WAS_DELETED RTEMS_OBJECT_WAS_DELETED
-STATUS_INVALID_SIZE RTEMS_INVALID_SIZE
-STATUS_INVALID_ADDRESS RTEMS_INVALID_ADDRESS
-STATUS_INVALID_NUMBER RTEMS_INVALID_NUMBER
-STATUS_NOT_DEFINED RTEMS_NOT_DEFINED
-STATUS_RESOURCE_IN_USE RTEMS_RESOURCE_IN_USE
-STATUS_UNSATISFIED RTEMS_UNSATISFIED
-STATUS_INCORRECT_STATE RTEMS_INCORRECT_STATE
-STATUS_ALREADY_SUSPENDED RTEMS_ALREADY_SUSPENDED
-STATUS_ILLEGAL_ON_SELF RTEMS_ILLEGAL_ON_SELF
-STATUS_ILLEGAL_ON_REMOTE_OBJECT RTEMS_ILLEGAL_ON_REMOTE_OBJECT
-STATUS_CALLED_FROM_ISR RTEMS_CALLED_FROM_ISR
-STATUS_INVALID_PRIORITY RTEMS_INVALID_PRIORITY
-STATUS_INVALID_CLOCK RTEMS_INVALID_CLOCK
-STATUS_INVALID_NODE RTEMS_INVALID_NODE
-STATUS_NOT_CONFIGURED RTEMS_NOT_CONFIGURED
-STATUS_NOT_OWNER_OF_RESOURCE RTEMS_NOT_OWNER_OF_RESOURCE
-STATUS_NOT_IMPLEMENTED RTEMS_NOT_IMPLEMENTED
-STATUS_INTERNAL_ERROR RTEMS_INTERNAL_ERROR
-STATUS_PROXY_BLOCKING RTEMS_PROXY_BLOCKING
-STATUS_NO_MEMORY RTEMS_NO_MEMORY
-#
-# Attributes (External)
-#
-DEFAULT_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES
-NO_FLOATING_POINT RTEMS_NO_FLOATING_POINT
-FLOATING_POINT RTEMS_FLOATING_POINT
-LOCAL RTEMS_LOCAL
-GLOBAL RTEMS_GLOBAL
-FIFO RTEMS_FIFO
-PRIORITY RTEMS_PRIORITY
-NO_LIMIT RTEMS_NO_LIMIT
-LIMIT RTEMS_LIMIT
-COUNTING_SEMAPHORE RTEMS_COUNTING_SEMAPHORE
-BINARY_SEMAPHORE RTEMS_BINARY_SEMAPHORE
-NO_INHERIT_PRIORITY RTEMS_NO_INHERIT_PRIORITY
-INHERIT_PRIORITY RTEMS_INHERIT_PRIORITY
-#
-# Attributes (Internal)
-#
-ATTRIBUTES_DEFAULTS RTEMS_DEFAULT_ATTRIBUTES
-ATTRIBUTES_NO_FLOATING_POINT RTEMS_NO_FLOATING_POINT
-ATTRIBUTES_FLOATING_POINT RTEMS_FLOATING_POINT
-ATTRIBUTES_LOCAL RTEMS_LOCAL
-ATTRIBUTES_GLOBAL RTEMS_GLOBAL
-ATTRIBUTES_FIFO RTEMS_FIFO
-ATTRIBUTES_PRIORITY RTEMS_PRIORITY
-ATTRIBUTES_NO_LIMIT RTEMS_NO_LIMIT
-ATTRIBUTES_LIMIT RTEMS_LIMIT
-ATTRIBUTES_COUNTING_SEMAPHORE RTEMS_COUNTING_SEMAPHORE
-ATTRIBUTES_BINARY_SEMAPHORE RTEMS_BINARY_SEMAPHORE
-ATTRIBUTES_NO_INHERIT_PRIORITY RTEMS_NO_INHERIT_PRIORITY
-ATTRIBUTES_INHERIT_PRIORITY RTEMS_INHERIT_PRIORITY
-#
-# Options (External)
-#
-DEFAULT_OPTIONS RTEMS_DEFAULT_OPTIONS
-WAIT RTEMS_WAIT
-NO_WAIT RTEMS_NO_WAIT
-EVENT_ALL RTEMS_EVENT_ALL
-EVENT_ANY RTEMS_EVENT_ANY
-#
-# Options (Internal)
-#
-OPTIONS_DEFAULT RTEMS_DEFAULT_OPTIONS
-OPTIONS_WAIT RTEMS_WAIT
-OPTIONS_NO_WAIT RTEMS_NO_WAIT
-OPTIONS_EVENT_ALL RTEMS_EVENT_ALL
-OPTIONS_EVENT_ANY RTEMS_EVENT_ANY
-#
-# Masks (External)
-#
-ALL_MODE_MASKS RTEMS_ALL_MODE_MASKS
-PREEMPT_MASK RTEMS_PREEMPT_MASK
-TIMESLICE_MASK RTEMS_TIMESLICE_MASK
-ASR_MASK RTEMS_ASR_MASK
-INTERRUPT_MASK RTEMS_INTERRUPT_MASK
-#
-# Masks (Internal)
-#
-MODES_ALL_MASK RTEMS_ALL_MODE_MASKS
-MODES_PREEMPT_MASK RTEMS_PREEMPT_MASK
-MODES_TIMESLICE_MASK RTEMS_TIMESLICE_MASK
-MODES_ASR_MASK RTEMS_ASR_MASK
-MODES_INTERRUPT_MASK RTEMS_INTERRUPT_MASK
-#
-# Modes (Internal)
-#
-MODES_DEFAULTS RTEMS_DEFAULT_MODES
-MODES_PREEMPT RTEMS_PREEMPT
-MODES_NO_PREEMPT RTEMS_NO_PREEMPT
-MODES_NO_TIMESLICE RTEMS_NO_TIMESLICE
-MODES_TIMESLICE RTEMS_TIMESLICE
-MODES_ASR RTEMS_ASR
-MODES_NO_ASR RTEMS_NO_ASR
-_Modes_Interrupt_level RTEMS_INTERRUPT_LEVEL
-#
-# Modes (External)
-#
-DEFAULT_MODES RTEMS_DEFAULT_MODES
-PREEMPT RTEMS_PREEMPT
-NO_PREEMPT RTEMS_NO_PREEMPT
-NO_TIMESLICE RTEMS_NO_TIMESLICE
-TIMESLICE RTEMS_TIMESLICE
-ASR RTEMS_ASR
-NO_ASR RTEMS_NO_ASR
-INTERRUPT_LEVEL RTEMS_INTERRUPT_LEVEL
-#
-# Identification (External)
-#
-SEARCH_ALL_NODES RTEMS_SEARCH_ALL_NODES
-SEARCH_OTHER_NODES RTEMS_SEARCH_OTHER_NODES
-SEARCH_LOCAL_NODE RTEMS_SEARCH_LOCAL_NODE
-WHO_AM_I RTEMS_WHO_AM_I
-#
-# Identification (Internal)
-#
-OBJECTS_SEARCH_ALL_NODES RTEMS_SEARCH_ALL_NODES
-OBJECTS_SEARCH_OTHER_NODES RTEMS_SEARCH_OTHER_NODES
-OBJECTS_SEARCH_LOCAL_NODE RTEMS_SEARCH_LOCAL_NODE
-OBJECTS_WHO_AM_I RTEMS_WHO_AM_I
-#
-# Miscellaneous (External API)
-#
-CURRENT_MODE RTEMS_CURRENT_MODE
-CURRENT_PRIORITY RTEMS_CURRENT_PRIORITY
-PENDING_EVENTS RTEMS_PENDING_EVENTS
-NO_TIMEOUT RTEMS_NO_TIMEOUT
-SELF RTEMS_SELF
-PERIOD_STATUS RTEMS_PERIOD_STATUS
-YIELD_PROCESSOR RTEMS_YIELD_PROCESSOR
-MINIMUM_PRIORITY RTEMS_MINIMUM_PRIORITY
-MAXIMUM_PRIORITY RTEMS_MAXIMUM_PRIORITY
-MINIMUM_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
-#
-# Miscellaneous (External API)
-#
-MODES_CURRENT RTEMS_CURRENT_MODE
-PRIORITY_CURRENT RTEMS_CURRENT_PRIORITY
-#
-# Events
-#
-ALL_EVENTS RTEMS_ALL_EVENTS
-EVENT_0 RTEMS_EVENT_0
-EVENT_1 RTEMS_EVENT_1
-EVENT_2 RTEMS_EVENT_2
-EVENT_3 RTEMS_EVENT_3
-EVENT_4 RTEMS_EVENT_4
-EVENT_5 RTEMS_EVENT_5
-EVENT_6 RTEMS_EVENT_6
-EVENT_7 RTEMS_EVENT_7
-EVENT_8 RTEMS_EVENT_8
-EVENT_9 RTEMS_EVENT_9
-EVENT_10 RTEMS_EVENT_10
-EVENT_11 RTEMS_EVENT_11
-EVENT_12 RTEMS_EVENT_12
-EVENT_13 RTEMS_EVENT_13
-EVENT_14 RTEMS_EVENT_14
-EVENT_15 RTEMS_EVENT_15
-EVENT_16 RTEMS_EVENT_16
-EVENT_17 RTEMS_EVENT_17
-EVENT_18 RTEMS_EVENT_18
-EVENT_19 RTEMS_EVENT_19
-EVENT_20 RTEMS_EVENT_20
-EVENT_21 RTEMS_EVENT_21
-EVENT_22 RTEMS_EVENT_22
-EVENT_23 RTEMS_EVENT_23
-EVENT_24 RTEMS_EVENT_24
-EVENT_25 RTEMS_EVENT_25
-EVENT_26 RTEMS_EVENT_26
-EVENT_27 RTEMS_EVENT_27
-EVENT_28 RTEMS_EVENT_28
-EVENT_29 RTEMS_EVENT_29
-EVENT_30 RTEMS_EVENT_30
-EVENT_31 RTEMS_EVENT_31
-#
-# Signals
-#
-SIGNAL_0 RTEMS_SIGNAL_0
-SIGNAL_1 RTEMS_SIGNAL_1
-SIGNAL_2 RTEMS_SIGNAL_2
-SIGNAL_3 RTEMS_SIGNAL_3
-SIGNAL_4 RTEMS_SIGNAL_4
-SIGNAL_5 RTEMS_SIGNAL_5
-SIGNAL_6 RTEMS_SIGNAL_6
-SIGNAL_7 RTEMS_SIGNAL_7
-SIGNAL_8 RTEMS_SIGNAL_8
-SIGNAL_9 RTEMS_SIGNAL_9
-SIGNAL_10 RTEMS_SIGNAL_10
-SIGNAL_11 RTEMS_SIGNAL_11
-SIGNAL_12 RTEMS_SIGNAL_12
-SIGNAL_13 RTEMS_SIGNAL_13
-SIGNAL_14 RTEMS_SIGNAL_14
-SIGNAL_15 RTEMS_SIGNAL_15
-SIGNAL_16 RTEMS_SIGNAL_16
-SIGNAL_17 RTEMS_SIGNAL_17
-SIGNAL_18 RTEMS_SIGNAL_18
-SIGNAL_19 RTEMS_SIGNAL_19
-SIGNAL_20 RTEMS_SIGNAL_20
-SIGNAL_21 RTEMS_SIGNAL_21
-SIGNAL_22 RTEMS_SIGNAL_22
-SIGNAL_23 RTEMS_SIGNAL_23
-SIGNAL_24 RTEMS_SIGNAL_24
-SIGNAL_25 RTEMS_SIGNAL_25
-SIGNAL_26 RTEMS_SIGNAL_26
-SIGNAL_27 RTEMS_SIGNAL_27
-SIGNAL_28 RTEMS_SIGNAL_28
-SIGNAL_29 RTEMS_SIGNAL_29
-SIGNAL_30 RTEMS_SIGNAL_30
-SIGNAL_31 RTEMS_SIGNAL_31
-#
-# Notepads
-#
-NOTEPAD_FIRST RTEMS_NOTEPAD_FIRST
-NOTEPAD_0 RTEMS_NOTEPAD_0
-NOTEPAD_1 RTEMS_NOTEPAD_1
-NOTEPAD_2 RTEMS_NOTEPAD_2
-NOTEPAD_3 RTEMS_NOTEPAD_3
-NOTEPAD_4 RTEMS_NOTEPAD_4
-NOTEPAD_5 RTEMS_NOTEPAD_5
-NOTEPAD_6 RTEMS_NOTEPAD_6
-NOTEPAD_7 RTEMS_NOTEPAD_7
-NOTEPAD_8 RTEMS_NOTEPAD_8
-NOTEPAD_9 RTEMS_NOTEPAD_9
-NOTEPAD_10 RTEMS_NOTEPAD_10
-NOTEPAD_11 RTEMS_NOTEPAD_11
-NOTEPAD_12 RTEMS_NOTEPAD_12
-NOTEPAD_13 RTEMS_NOTEPAD_13
-NOTEPAD_14 RTEMS_NOTEPAD_14
-NOTEPAD_15 RTEMS_NOTEPAD_15
-NOTEPAD_LAST RTEMS_NOTEPAD_LAST
-#
-# Multiprocessing
-#
-MIN_PKTSIZE RTEMS_MINIMUM_PACKET_SIZE
-MIN_HETERO_CONV RTEMS_MINIMUN_HETERO_CONVERSION
-#
-# Name and ID External
-#
-get_node rtems_get_node
-get_index rtems_get_index
-build_name rtems_build_name
-name_to_characters rtems_name_to_characters
-#
-# Name and ID Internal
-#
-_Objects_Get_node rtems_get_node
-_Objects_Get_index rtems_get_index
-_Objects_Build_name rtems_build_name
-_Objects_Name_to_characters rtems_name_to_characters
-#
-# clock_get
-#
-CLOCK_GET_TOD RTEMS_CLOCK_GET_TOD
-CLOCK_GET_SECONDS_SINCE_EPOCH RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH
-CLOCK_GET_TICKS_SINCE_BOOT RTEMS_CLOCK_GET_TICKS_SINCE_BOOT
-CLOCK_GET_TICKS_PER_SECOND RTEMS_CLOCK_GET_TICKS_PER_SECOND
-CLOCK_GET_TIME_VALUE RTEMS_CLOCK_GET_TIME_VALUE
-#
-# Status Code Support Routines (External) -- NO CHANGES
-#
-#
-# Status Code Support Routines (Internal)
-#
-_Status_Is_successful rtems_is_status_successful
-_Status_Is_equal rtems_are_statuses_equal
-#
-# Time Conversion Support Routines (External) -- NO CHANGES
-#
-#
-# Time Conversion Support Routines (Internal)
-#
-_TOD_Milliseconds_to_microseconds RTEMS_MILLISECONDS_TO_MICROSECONDS
-_TOD_Milliseconds_to_ticks RTEMS_MILLISECONDS_TO_MICROSECONDS
-#
-# MP packet
-#
-MP_PACKET_INTERNAL_THREADS RTEMS_MP_PACKET_INTERNAL_THREADS
-MP_PACKET_RTEMS_TASKS RTEMS_MP_PACKET_TASKS
-MP_PACKET_MESSAGE_QUEUE RTEMS_MP_PACKET_MESSAGE_QUEUE
-MP_PACKET_SEMAPHORE RTEMS_MP_PACKET_SEMAPHORE
-MP_PACKET_PARTITION RTEMS_MP_PACKET_PARTITION
-MP_PACKET_REGION RTEMS_MP_PACKET_REGION
-MP_PACKET_EVENT RTEMS_MP_PACKET_EVENT
-MP_PACKET_SIGNAL RTEMS_MP_PACKET_SIGNAL
-#
-#
-#
-IO_Major_control rtems_device_major_number
-IO_Minor_control rtems_device_minor_number
-#
-# Configuration Info
-#
-Configuration_Table rtems_configuration_table
-Configuration_Initialization_tasks_table rtems_initialization_tasks_table
-Configuration_Driver_address_table rtems_driver_address_table
-Configuration_Extension_table rtems_extensions_table
-rtems_tasks_create_extension rtems_task_create_extension
-rtems_tasks_start_extension rtems_task_start_extension
-rtems_tasks_restart_extension rtems_task_restart_extension
-rtems_tasks_delete_extension rtems_task_delete_extension
-rtems_tasks_switch_extension rtems_task_switch_extension
-rtems_tasks_begin_extension rtems_task_begin_extension
-rtems_tasks_exitted_extension rtems_task_exitted_extension
-rtems_fatal_extension rtems_fatal_extension
-Configuration_MPCI_table rtems_mpci_table
-Configuration_Multiprocessing_table rtems_multiprocessing_table
-CPU_Table rtems_cpu_table
-#
-Clock_Get_options rtems_clock_get_options
-Clock_Time_value rtems_clock_time_value
-MP_packet_Prefix rtems_packet_prefix
-MP_packet_Classes rtems_mp_packet_classes
-TOD_Control rtems_time_of_day
-ISR_Vector rtems_vector_number
-Watchdog_Interval rtems_interval
-Watchdog_Service rtems_timer_service_routine_entry
-Attributes_Control rtems_attribute
-Modes_Control rtems_mode
-Options_Control rtems_option
-Priority_Control rtems_task_priority
-PRIORITY_MINIMUM RTEMS_MINIMUM_PRIORITY
-PRIORITY_MAXIMUM RTEMS_MAXIMUM_PRIORITY
-Event_sets_Control rtems_event_set
-ASR_Signal_set_control rtems_signal_set
-Status_Codes rtems_status_code
-RTEMS_TASKS_YIELD_PROCESSOR RTEMS_YIELD_PROCESSOR
-RATE_MONOTONIC_PERIOD_STATUS RTEMS_PERIOD_STATUS
-WATCHDOG_FOREVER RTEMS_NO_TIMEOUT
-STACK_MINIMUM_SIZE RTEMS_MINIMUM_STACK_SIZE
-#
-ASR_Handler rtems_asr_entry
-Thread_Entry rtems_task_entry
-#
-disable_intr rtems_interrupt_disable
-enable_intr rtems_interrupt_enable
-flash_intr rtems_interrupt_flash
-
diff --git a/c/update-tools/Makefile.in b/c/update-tools/Makefile.in
deleted file mode 100644
index 45e3e63515..0000000000
--- a/c/update-tools/Makefile.in
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-include $(RTEMS_ROOT)/make/rtems.cfg
-
-DESTDIR=$(PROJECT_RELEASE)/update-tools
-
-BUILD_PGMS = update
-ifneq (@PERL@,)
-BUILD_PGMS += word-replace
-endif
-
-PGMS = $(BUILD_PGMS)
-
-CLEAN_ADDITIONS += $(BUILD_PGMS)
-
-MISC_SUPPORT=310_to_320_list
-
-INSTALLED_PGMS=$(PGMS:%=$(DESTDIR)/%)
-INSTALLED_DATA=$(MISC_SUPPORT:%=$(DESTDIR)/%)
-
-all: $(PGMS)
-
-$(DESTDIR):
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-$(INSTALLED_PGMS): $(PGMS)
- @INSTALL@ $(INSTBINFLAGS) $^ $(DESTDIR)
-
-$(INSTALLED_DATA): $(MISC_SUPPORT)
- @INSTALL@ $(INSTDATAFLAGS) $^ $(DESTDIR)
-
-install: $(DESTDIR) $(INSTALLED_PGMS) $(INSTALLED_DATA)
-
diff --git a/c/update-tools/README b/c/update-tools/README
deleted file mode 100644
index bbf99cb71d..0000000000
--- a/c/update-tools/README
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# $Id$
-#
-
-This directory contains tools which aid in upgrading from RTEMS 3.1.0
-to RTEMS 3.2.0.
-
diff --git a/c/update-tools/update.in b/c/update-tools/update.in
deleted file mode 100644
index cdcb07655e..0000000000
--- a/c/update-tools/update.in
+++ /dev/null
@@ -1,216 +0,0 @@
-#!@KSH@ -p
-#
-# $Id$
-#
-# Either bash or ksh will be ok for this; requires 'test -ot'
-# (-p above just says to not parse $ENV file; makes it faster for
-# those of us who set $ENV)
-#
-# Update RTEMS applications for the API changes from 3.1.0 to 3.2.0
-#
-# NOTE
-#
-# This is potentially a very dangerous program.
-
-# progname=`basename $0`
-progname=${0##*/} # fast basename hack for ksh, bash
-
-USAGE=\
-"
-usage: $progname [ -vs ] [ -b base_directory ] [-p file] [-f] [files...]
- -v -- verbose
- -p -- file with replacement instructions
- -s -- skip prompt for backup verification
- -f -- do files at end of line
-
-base_directory is the root directory of the source code to update. It
-defaults to the current directory.
-
-This program updates C, H, and .inl files.
-"
-
-fatal() {
- if [ "$1" ]
- then
- echo >&2
- echo $* >&2
- echo >&2
- fi
- echo "$USAGE" 1>&2
- exit 1
-}
-
-#
-# KLUDGE to figure out at runtime how to echo a line without a
-# newline.
-#
-count=`echo "\\c" | wc -c`
-if [ ${count} -ne 0 ] ; then
- EARG="-n"
- EOL=""
-else
- EARG=""
- EOL="\\c"
-fi
-
-#
-# Function to make sure they do a backup
-#
-
-WARNING=\
-"
-
-*******************************************************************************
-*******************************************************************************
-*******************************************************************************
-**** ****
-**** WARNING!!! WARNING!!! WARNING!!! ****
-**** ****
-**** ALL SOURCE CODE SHOULD BE BACKED UP BEFORE RUNNING THIS PROGRAM!! ****
-**** ****
-**** WARNING!!! WARNING!!! WARNING!!! ****
-**** ****
-*******************************************************************************
-*******************************************************************************
-*******************************************************************************
-
-"
-
-verify_backup()
-{
- echo "$WARNING"
- continue="yes"
- while [ $continue = "yes" ]
- do
-echo ${EARG} "Do you wish to update the source tree at this time [y|n]? " ${EOL}
- read answer
- case $answer in
- [yY]*)
- continue="no"
- ;;
- [nN]*)
- echo
- echo "Exitting at user request"
- echo
- exit 0
- ;;
- esac
- done
-}
-
-#
-# Default tools to use...
-#
-# NOTE: The GNU versions of both of these are faster.
-#
-find_prog=find
-xargs_prog=xargs
-
-#
-# process the options
-#
-
-verbose=""
-suffix=""
-mode=""
-base_directory=.
-do_files="no"
-do_prompt="yes"
-replacement_file="${RTEMS_ROOT}/update-tools/310_to_320_list"
-
-while getopts sfp:b:v OPT
-do
- case "$OPT" in
- v)
- verbose="yes";;
- s)
- do_prompt="no";;
- b)
- base_directory=${OPTARG};;
- p)
- replacement_file=${OPTARG};;
- f)
- do_files="yes";;
- *)
- fatal
- esac
-done
-
-let $((shiftcount = $OPTIND - 1))
-shift $shiftcount
-
-args=$*
-
-#
-# Make sure they have done a backup
-#
-
-if [ ${do_prompt} = "yes" ]
-then
- verify_backup
-fi
-
-#
-# Validate the base directory
-#
-
-if [ ! -d $base_directory ]
-then
- fatal "${base_directory} does not exist"
-fi
-
-#
-# Validate the replacement file
-#
-
-if [ ! -r $replacement_file ]
-then
- fatal "${replacement_file} does not exist or is not readable"
-fi
-
-
-#
-# Verify enough of the RTEMS environment variables are set
-#
-
-if [ ! -d "${RTEMS_ROOT}" ]
-then
- fatal "RTEMS_ROOT environment variable is not initialized"
-fi
-
-#
-# Update the files
-#
-
-generate_list()
-{
- if [ ${do_files} = "yes" ]
- then
- for i in $args
- do
- echo $i
- done
- else
- ${find_prog} ${base_directory} \( -name "*.[ch]" -o -name "*.inl" \) -print
- fi
-}
-
-generate_list | ${xargs_prog} |
- while read line
- do
- ${RTEMS_ROOT}/update-tools/word-replace -p ${replacement_file} ${line}
- if [ $? -ne 0 ]
- then
- exit 1
- fi
- for file in ${line}
- do
- mv ${file}.fixed ${file}
- done
- done
-
-exit 0
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
diff --git a/c/update-tools/word-replace.in b/c/update-tools/word-replace.in
deleted file mode 100644
index 24c7c3a546..0000000000
--- a/c/update-tools/word-replace.in
+++ /dev/null
@@ -1,89 +0,0 @@
-#!@PERL@
-#
-# $Id$
-#
-
-eval "exec @PERL@ -S $0 $*"
- if $running_under_some_shell;
-
-require 'getopts.pl';
-&Getopts("p:vh"); # help, pattern file, verbose,
-
-if ($opt_h || ! $opt_p) {
- print STDERR <<NO_MORE_HELP;
-word-replace
-
- Replace *words* with patterns. Pattern file specifies which patterns
- to replace on each line. All patterns are wrapped with perl \\b regexp
- specifiers.
-
-Usage: $0 [-v] -p pattern-file files to replace
-
- -v -- possibly more verbose
- -p file -- pattern file
- -h -- help
-
- anything else == this help message
-
-Pattern file looks like this:
-
-# Example:
-# ignores all lines with beginning with # or not exactly 2 fields
-_Dorky_Name rtems_dorky_name # comments, and blank lines are cool
-_Dorky_Name2 rtems_dorky_name2 # comments, and blank lines are cool
-NO_MORE_HELP
- exit 0;
-}
-
-$verbose = $opt_v;
-$pattern_file = $opt_p;
-
-# make standard outputs unbuffered (so the '.'s come out ok)
-$oldfh = select(STDERR); $| = 1; select($oldfh);
-$oldfh = select(STDOUT); $| = 1; select($oldfh);
-
-# pull in the patterns
-open(PATTERNS, "<$pattern_file") ||
- die "could not open $pattern_file: $!, crapped out at";
-
-foreach (<PATTERNS>)
-{
- chop;
- s/#.*//;
- next if /^$/;
- ($orig, $new, $junk, @rest) = split;
- next if ( ! $orig || ! $new || $junk); # <2 or >2 patterns
- die "pattern appears 2x: '$orig' in '$pattern_file'--" if defined($patterns{$orig});
- $patterns{$orig} = $new;
-}
-close PATTERNS;
-
-# walk thru each line in each file
-foreach $file (@ARGV)
-{
- print "$file\t";
-
- open (INFILE, "<$file") ||
- die "could not open input file $file: $!";
-
- $outfile = $file . ".fixed";;
- open (OUTFILE, ">$outfile") ||
- die "could not open output file $outfile: $!";
-
- while (<INFILE>)
- {
- study; # maybe make s/// faster
- foreach $key (keys %patterns)
- {
- if ( s/\b$key\b/$patterns{$key}/ge )
- {
- print ".";
- }
- }
- print OUTFILE $_;
- }
- print "\n";
- close INFILE;
- close OUTFILE;
-}
-
diff --git a/config.guess b/config.guess
deleted file mode 100755
index 6d8bb0811d..0000000000
--- a/config.guess
+++ /dev/null
@@ -1,695 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
-#
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# 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. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Written by Per Bothner <bothner@cygnus.com>.
-# The master version of this file is at the FSF in /home/gd/gnu/lib.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit system type (host/target name).
-#
-# Only a few systems have been added to this list; please add others
-# (but try to keep the structure clean).
-#
-# $Id$
-#
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 8/24/94.)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- alpha:OSF1:*:*)
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
- exit 0 ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit 0 ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-cbm-sysv4
- exit 0;;
- amiga:NetBSD:*:*)
- echo m68k-cbm-netbsd${UNAME_RELEASE}
- exit 0 ;;
- amiga:OpenBSD:*:*)
- echo m68k-cbm-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
- Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit 0 ;;
- NILE:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit 0 ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
- atari*:NetBSD:*:*)
- echo m68k-atari-netbsd${UNAME_RELEASE}
- exit 0 ;;
- atari*:OpenBSD:*:*)
- echo m68k-atari-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3*:NetBSD:*:*)
- echo m68k-sun-netbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3*:OpenBSD:*:*)
- echo m68k-sun-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:NetBSD:*:*)
- echo m68k-apple-netbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-apple-openbsd${UNAME_RELEASE}
- exit 0 ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit 0 ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- sed 's/^ //' << EOF >dummy.c
- int main (argc, argv) int argc; char **argv; {
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- ${CC-cc} dummy.c -o dummy \
- && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit 0 ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit 0 ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit 0 ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit 0 ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
- -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit 0 ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit 0 ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit 0 ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit 0 ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit 0 ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i?86:AIX:*:*)
- echo i386-ibm-aix
- exit 0 ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- sed 's/^ //' << EOF >dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- echo rs6000-ibm-aix3.2.5
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit 0 ;;
- *:AIX:*:4)
- if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=4.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit 0 ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit 0 ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit 0 ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit 0 ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit 0 ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit 0 ;;
- 9000/[3478]??:HP-UX:*:*)
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
- 9000/8?? ) HP_ARCH=hppa1.0 ;;
- esac
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
- 3050*:HI-UX:*:*)
- sed 's/^ //' << EOF >dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- echo unknown-hitachi-hiuxwe2
- exit 0 ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit 0 ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit 0 ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit 0 ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit 0 ;;
- i?86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit 0 ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit 0 ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit 0 ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit 0 ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit 0 ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit 0 ;;
- CRAY*X-MP:*:*:*)
- echo xmp-cray-unicos
- exit 0 ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE}
- exit 0 ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
- exit 0 ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE}
- exit 0 ;;
- CRAY-2:*:*:*)
- echo cray2-cray-unicos
- exit 0 ;;
- F300:UNIX_System_V:*:*)
- FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
- F301:UNIX_System_V:*:*)
- echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
- exit 0 ;;
- hp3[0-9][05]:NetBSD:*:*)
- echo m68k-hp-netbsd${UNAME_RELEASE}
- exit 0 ;;
- hp3[0-9][05]:OpenBSD:*:*)
- echo m68k-hp-openbsd${UNAME_RELEASE}
- exit 0 ;;
- i?86:BSD/386:*:* | *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:FreeBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
- *:NetBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- exit 0 ;;
- *:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- exit 0 ;;
- i*:CYGWIN*:*)
- echo i386-pc-cygwin32
- exit 0 ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin32
- exit 0 ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- *:GNU:*:*)
- echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
- *:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us.
- ld_help_string=`ld --help 2>&1`
- if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then
- echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0
- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then
- echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then
- echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0
- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
- echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0
- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
- echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then
- echo "powerpc-unknown-linux-gnu" ; exit 0
- elif test "${UNAME_MACHINE}" = "alpha" ; then
- echo alpha-unknown-linux-gnu ; exit 0
- elif test "${UNAME_MACHINE}" = "sparc" ; then
- echo sparc-unknown-linux-gnu ; exit 0
- else
- # Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us
- # useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.
- test ! -d /usr/lib/ldscripts/. \
- && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
- # Determine whether the default compiler is a.out or elf
- cat >dummy.c <<EOF
-main(argc, argv)
-int argc;
-char *argv[];
-{
-#ifdef __ELF__
- printf ("%s-pc-linux-gnu\n", argv[1]);
-#else
- printf ("%s-pc-linux-gnuaout\n", argv[1]);
-#endif
- return 0;
-}
-EOF
- ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- fi ;;
-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
-# are messed up and put the nodename in both sysname and nodename.
- i?86:DYNIX/ptx:4*:*)
- echo i386-sequent-sysv4
- exit 0 ;;
- i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
- i?86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit 0 ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit 0 ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit 0 ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit 0 ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit 0 ;;
- M68*:*:R3V[567]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
- m68*:LynxOS:2.*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit 0 ;;
- i?86:LynxOS:2.*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit 0 ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit 0 ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit 0 ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
- R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
- PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit 0 ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-cat >dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-#if !defined (ultrix)
- printf ("vax-dec-bsd\n"); exit (0);
-#else
- printf ("vax-dec-ultrix\n"); exit (0);
-#endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
-rm -f dummy.c dummy
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit 0 ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- c34*)
- echo c34-convex-bsd
- exit 0 ;;
- c38*)
- echo c38-convex-bsd
- exit 0 ;;
- c4*)
- echo c4-convex-bsd
- exit 0 ;;
- esac
-fi
-
-#echo '(Unable to guess system type)' 1>&2
-
-exit 1
diff --git a/config.sub b/config.sub
deleted file mode 100755
index c771bc2cc7..0000000000
--- a/config.sub
+++ /dev/null
@@ -1,1178 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script, version 1.1.
-# Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# 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. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-if [ x$1 = x ]
-then
- echo Configuration name missing. 1>&2
- echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
- echo "or $0 ALIAS" 1>&2
- echo where ALIAS is a recognized configuration type. 1>&2
- exit 1
-fi
-
-# First pass through any local machine types.
-case $1 in
- *local*)
- echo $1
- exit 0
- ;;
- *)
- ;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- linux-gnu*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond ) # CYGNUS LOCAL
- os=
- basic_machine=$1
- ;;
- -scout) # CYGNUS LOCAL
- ;;
- -wrs) # CYGNUS LOCAL
- os=vxworks
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco5)
- os=sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
- | arme[lb] | pyramid | mn10200 | mn10300 \
- | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
- | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
- | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
- | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
- | mipstx39 | mipstx39el \
- | sparc | sparclet | sparclite | sparc64 | v850)
- basic_machine=$basic_machine-unknown
- ;;
- m88110 | m680[01234]0 | m683?2 | m68360 | z8k | v70 | h8500 | w65) # CYGNUS LOCAL
- basic_machine=$basic_machine-unknown
- ;;
- mips64vr4300 | mips64vr4300el) # CYGNUS LOCAL jsmith/vr4300
- basic_machine=$basic_machine-unknown
- ;;
- mips64vr4100 | mips64vr4100el) # CYGNUS LOCAL jsmith/vr4100
- basic_machine=$basic_machine-unknown
- ;;
- mips64vr5000 | mips64vr5000el) # CYGNUS LOCAL ian/vr5000
- basic_machine=$basic_machine-unknown
- ;;
- mips16) # CYGNUS LOCAL krk/mips16
- basic_machine=$basic_machine-unknown
- ;;
- d10v) # CYGNUS LOCAL meissner/d10v
- basic_machine=$basic_machine-unknown
- ;;
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i[3456]86)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
- | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
- | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
- | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
- | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
- | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
- | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
- | sparc64-* | mips64-* | mipsel-* \
- | mips64el-* | mips64orion-* | mips64orionel-* \
- | mipstx39-* | mipstx39el-* \
- | f301-*)
- ;;
- m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # CYGNUS LOCAL
- ;;
- mips64vr4300-* | mips64vr4300el-*) # CYGNUS LOCAL jsmith/vr4300
- ;;
- mips64vr4100-* | mips64vr4100el-*) # CYGNUS LOCAL jsmith/vr4100
- ;;
- mips16-*) # CYGNUS LOCAL krk/mips16
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd) # CYGNUS LOCAL
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif) # CYGNUS LOCAL
- basic_machine=a29k-amd
- os=-udi
- ;;
- adobe68k) # CYGNUS LOCAL
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-cbm
- ;;
- amigaos | amigados)
- basic_machine=m68k-cbm
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-cbm
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd) # CYGNUS LOCAL
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- cray2)
- basic_machine=cray2-cray
- os=-unicos
- ;;
- [ctj]90-cray)
- basic_machine=c90-cray
- os=-unicos
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE) # CYGNUS LOCAL
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray) # CYGNUS LOCAL
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms) # CYGNUS LOCAL
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- w89k-*) # CYGNUS LOCAL
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- op50n-*) # CYGNUS LOCAL
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- op60c-*) # CYGNUS LOCAL
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- hppro) # CYGNUS LOCAL
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf) # CYGNUS LOCAL
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- os=-mvs
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i[3456]86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i[3456]86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i[3456]86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i[3456]86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach) # CYGNUS LOCAL
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta) # CYGNUS LOCAL
- basic_machine=i386-unknown
- os=-vsta
- ;;
- i386-go32 | go32) # CYGNUS LOCAL
- basic_machine=i386-unknown
- os=-go32
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- mipsel*-linux*)
- basic_machine=mipsel-unknown
- os=-linux-gnu
- ;;
- mips*-linux*)
- basic_machine=mips-unknown
- os=-linux-gnu
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor) # CYGNUS LOCAL
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- msdos) # CYGNUS LOCAL
- basic_machine=i386-unknown
- os=-msdos
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown # CYGNUS LOCAL
- os=-netbsd
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70) # CYGNUS LOCAL
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960) # CYGNUS LOCAL
- basic_machine=i960-intel
- os=-mon960
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- OSE68000 | ose68000) # CYGNUS LOCAL
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k) # CYGNUS LOCAL
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pentium | p5)
- basic_machine=i586-intel
- ;;
- pentiumpro | p6)
- basic_machine=i686-intel
- ;;
- pentium-* | p5-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- k5)
- # We don't have specific support for AMD's K5 yet, so just call it a Pentium
- basic_machine=i586-amd
- ;;
- nexen)
- # We don't have specific support for Nexgen yet, so just call it a Pentium
- basic_machine=i586-nexgen
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=rs6000-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- rom68k) # CYGNUS LOCAL
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- sa29200) # CYGNUS LOCAL
- basic_machine=a29k-amd
- os=-udi
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sparclite-wrs) # CYGNUS LOCAL
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000) # CYGNUS LOCAL
- basic_machine=m68k-tandem
- ;;
- stratus) # CYGNUS LOCAL
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810) # CYGNUS LOCAL
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*) # CYGNUS LOCAL
- basic_machine=w65-wdc
- os=-none
- ;;
- xmp)
- basic_machine=xmp-cray
- os=-unicos
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- z8k-*-coff) # CYGNUS LOCAL
- basic_machine=z8k-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k) # CYGNUS LOCAL
- basic_machine=hppa1.1-winbond
- ;;
- op50n) # CYGNUS LOCAL
- basic_machine=hppa1.1-oki
- ;;
- op60c) # CYGNUS LOCAL
- basic_machine=hppa1.1-oki
- ;;
- mips)
- if [ x$os = x-linux-gnu ]; then
- basic_machine=mips-unknown
- else
- basic_machine=mips-mips
- fi
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sparc)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw) # CYGNUS LOCAL
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw) # CYGNUS LOCAL
- basic_machine=powerpc-apple
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -unixware* | svr4*)
- os=-sysv4
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -uxpv*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- # CYGNUS LOCAL
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
- | -macos* | -mpw* | -magic* | -mon960* | -lnews* )
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- # END CYGNUS LOCAL
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -386bsd) # CYGNUS LOCAL
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*) # CYGNUS LOCAL
- os=-ose
- ;;
- -es1800*) # CYGNUS LOCAL
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-semi)
- os=-aout
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco) # CYGNUS LOCAL
- os=-aout
- ;;
- mips*-cisco) # CYGNUS LOCAL
- os=-elf
- ;;
- mips*-*) # CYGNUS LOCAL
- os=-elf
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be) # CYGNUS LOCAL
- os=-beos
- ;;
- *-ibm)
- os=-aix
- ;;
- *-wec) # CYGNUS LOCAL
- os=-proelf
- ;;
- *-winbond) # CYGNUS LOCAL
- os=-proelf
- ;;
- *-oki) # CYGNUS LOCAL
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f301-fujitsu)
- os=-uxpv
- ;;
- *-rom68k) # CYGNUS LOCAL
- os=-coff
- ;;
- *-*bug) # CYGNUS LOCAL
- os=-coff
- ;;
- *-apple) # CYGNUS LOCAL
- os=-macos
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*) # CYGNUS LOCAL
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -vxsim* | -vxworks*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*) # CYGNUS LOCAL
- vendor=hitachi
- ;;
- -mpw* | -macos*) # CYGNUS LOCAL
- vendor=apple
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
diff --git a/configure b/configure
deleted file mode 100644
index a4271f0f51..0000000000
--- a/configure
+++ /dev/null
@@ -1,4149 +0,0 @@
-#! /bin/sh
-
-
-
-
-
-# Check to see if we're running under Cygwin32, without using
-# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
-# Otherwise set it to "no".
-
-
-
-
-
-# Check to see if we're running under Win32, without using
-# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
-# Otherwise set it to "".
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-
-# Defaults:
-ac_help=
-ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_help="$ac_help
- --with-cross-host=HOST host (cygnus)"
-ac_help="$ac_help
-\
- --enable-gmake-print-directory enable GNU Make's print directory"
-ac_help="$ac_help
-\
- --enable-posix enable posix interface"
-ac_help="$ac_help
-\
- --enable-networking enable TCP/IP stack"
-ac_help="$ac_help
-\
- --enable-rtems-inlines enable RTEMS inline functions (use macros)"
-ac_help="$ac_help
-\
- --enable-cxx enable C++ support, and build the rtems++ library"
-ac_help="$ac_help
-\
- --enable-gcc28 enable use of gcc 2.8.x features"
-ac_help="$ac_help
-\
- --enable-libcdir=directory set the directory for the C library"
-ac_help="$ac_help
- --enable-bare-cpu-cflags \
- specify a particular cpu cflag (bare bsp specific)"
-ac_help="$ac_help
- --enable-bare-cpu-model \
- specify a particular cpu model (bare bsp specific)"
-ac_help="$ac_help
-\
- --enable-rtemsbsp=bsp1 bsp2 .. BSPs to include in build"
-ac_help="$ac_help
-\
- --enable-tests enable tests"
-ac_help="$ac_help
-\
- --enable-hwapi enable hardware API library"
-
-# Initialize some variables set by options.
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
-exec_prefix=NONE
-host=NONE
-no_create=
-nonopt=NONE
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-target=NONE
-verbose=
-x_includes=NONE
-x_libraries=NONE
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
-ac_prev=
-for ac_option
-do
-
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case "$ac_option" in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir="$ac_optarg" ;;
-
- -disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12"
- exit 0 ;;
-
- -with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "with_${ac_package}='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
-
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
- ;;
-
- *)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
-
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
-do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
- esac
-done
-
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
-
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=README
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
- else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
- fi
-fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
-else
- echo "creating cache $cache_file"
- > $cache_file
-fi
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
-
-
-
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:596: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftestmake <<\EOF
-all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftestmake
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- SET_MAKE=
-else
- echo "$ac_t""no" 1>&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-
-# Do some error checking and defaulting for the host and target type.
-# The inputs are:
-# configure --host=HOST --target=TARGET --build=BUILD NONOPT
-#
-# The rules are:
-# 1. You are not allowed to specify --host, --target, and nonopt at the
-# same time.
-# 2. Host defaults to nonopt.
-# 3. If nonopt is not specified, then host defaults to the current host,
-# as determined by config.guess.
-# 4. Target and build default to nonopt.
-# 5. If nonopt is not specified, then target and build default to host.
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-case $host---$target---$nonopt in
-NONE---*---* | *---NONE---* | *---*---NONE) ;;
-*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
-esac
-
-
-# Make sure we can run config.sub.
-if $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:669: checking host system type" >&5
-
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE)
- if host_alias=`$ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
-
-host=`$ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
-
-echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:690: checking target system type" >&5
-
-target_alias=$target
-case "$target_alias" in
-NONE)
- case $nonopt in
- NONE) target_alias=$host_alias ;;
- *) target_alias=$nonopt ;;
- esac ;;
-esac
-
-target=`$ac_config_sub $target_alias`
-target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$target" 1>&6
-
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:708: checking build system type" >&5
-
-build_alias=$build
-case "$build_alias" in
-NONE)
- case $nonopt in
- NONE) build_alias=$host_alias ;;
- *) build_alias=$nonopt ;;
- esac ;;
-esac
-
-build=`$ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
-
-test "$host_alias" != "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
-
-# Check whether --with-cross-host or --without-cross-host was given.
-if test "${with_cross_host+set}" = set; then
- withval="$with_cross_host"
- \
-host=$withval
-fi
-
-
-# Check whether --enable-gmake-print-directory or --disable-gmake-print-directory was given.
-if test "${enable_gmake_print_directory+set}" = set; then
- enableval="$enable_gmake_print_directory"
- \
-case "${enableval}" in
- yes) RTEMS_USE_OWN_PDIR=no ;;
- no) RTEMS_USE_OWN_PDIR=yes ;;
- *) { echo "configure: error: bad value ${enableval} for gmake-print-directory option" 1>&2; exit 1; } ;;
-esac
-else
- RTEMS_USE_OWN_PDIR=yes
-fi
-
-
-# Check whether --enable-posix or --disable-posix was given.
-if test "${enable_posix+set}" = set; then
- enableval="$enable_posix"
- \
-case "${enableval}" in
- yes) RTEMS_HAS_POSIX_API=yes ;;
- no) RTEMS_HAS_POSIX_API=no ;;
- *) { echo "configure: error: bad value ${enableval} for enable-posix option" 1>&2; exit 1; } ;;
-esac
-else
- RTEMS_HAS_POSIX_API=yes
-fi
-
-
-# Check whether --enable-networking or --disable-networking was given.
-if test "${enable_networking+set}" = set; then
- enableval="$enable_networking"
- \
-case "${enableval}" in
- yes) RTEMS_HAS_NETWORKING=yes ;;
- no) RTEMS_HAS_NETWORKING=no ;;
- *) { echo "configure: error: bad value ${enableval} for enable-networking option" 1>&2; exit 1; } ;;
-esac
-else
- RTEMS_HAS_NETWORKING=yes
-fi
-
-
-# Check whether --enable-rtems-inlines or --disable-rtems-inlines was given.
-if test "${enable_rtems_inlines+set}" = set; then
- enableval="$enable_rtems_inlines"
- \
-case "${enableval}" in
- yes) RTEMS_USE_MACROS=no ;;
- no) RTEMS_USE_MACROS=yes ;;
- *) { echo "configure: error: bad value ${enableval} for disable-rtems-inlines option" 1>&2; exit 1; } ;;
-esac
-else
- RTEMS_USE_MACROS=no
-fi
-
-
-# Check whether --enable-cxx or --disable-cxx was given.
-if test "${enable_cxx+set}" = set; then
- enableval="$enable_cxx"
- \
-case "${enableval}" in
- yes) RTEMS_HAS_CPLUSPLUS=yes ;;
- no) RTEMS_HAS_CPLUSPLUS=no ;;
- *) { echo "configure: error: bad value ${enableval} for enable-cxx option" 1>&2; exit 1; } ;;
-esac
-else
- RTEMS_HAS_CPLUSPLUS=no
-fi
-
-
-# Check whether --enable-gcc28 or --disable-gcc28 was given.
-if test "${enable_gcc28+set}" = set; then
- enableval="$enable_gcc28"
- \
-case "${enableval}" in
- yes) RTEMS_USE_GCC272=no ;;
- no) RTEMS_USE_GCC272=yes ;;
- *) { echo "configure: error: bad value ${enableval} for gcc-28 option" 1>&2; exit 1; } ;;
-esac
-else
- RTEMS_USE_GCC272=no
-fi
-
-
-# Check whether --enable-libcdir or --disable-libcdir was given.
-if test "${enable_libcdir+set}" = set; then
- enableval="$enable_libcdir"
- \
- RTEMS_LIBC_DIR="${enableval}" ; \
-test -d ${enableval} || { echo "configure: error: "$enableval is not a directory" " 1>&2; exit 1; }
-fi
-
-
-# Check whether --enable-bare-cpu-cflags or --disable-bare-cpu-cflags was given.
-if test "${enable_bare_cpu_cflags+set}" = set; then
- enableval="$enable_bare_cpu_cflags"
- case "${enableval}" in
- no) BARE_CPU_CFLAGS="" ;;
- *) BARE_CPU_CFLAGS="${enableval}" ;;
-esac
-else
- BARE_CPU_CFLAGS=""
-fi
-
-
-# Check whether --enable-bare-cpu-model or --disable-bare-cpu-model was given.
-if test "${enable_bare_cpu_model+set}" = set; then
- enableval="$enable_bare_cpu_model"
- case "${enableval}" in
- no) BARE_CPU_MODEL="" ;;
- *) BARE_CPU_MODEL="${enableval}" ;;
-esac
-else
- BARE_CPU_MODEL=""
-fi
-
-
-RTEMS_PREFIX=${target_cpu}-${target_vendor}
-
-
-# Extract the first word of "cat", so it can be a program name with args.
-set dummy cat; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:861: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_CAT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$CAT" in
- /*)
- ac_cv_path_CAT="$CAT" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_CAT="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-CAT="$ac_cv_path_CAT"
-if test -n "$CAT"; then
- echo "$ac_t""$CAT" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-# Extract the first word of "rm", so it can be a program name with args.
-set dummy rm; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:892: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$RM" in
- /*)
- ac_cv_path_RM="$RM" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_RM="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-RM="$ac_cv_path_RM"
-if test -n "$RM"; then
- echo "$ac_t""$RM" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-# Extract the first word of "cp", so it can be a program name with args.
-set dummy cp; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:923: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_CP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$CP" in
- /*)
- ac_cv_path_CP="$CP" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_CP="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-CP="$ac_cv_path_CP"
-if test -n "$CP"; then
- echo "$ac_t""$CP" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-# Extract the first word of "mv", so it can be a program name with args.
-set dummy mv; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:954: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$MV" in
- /*)
- ac_cv_path_MV="$MV" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_MV="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-MV="$ac_cv_path_MV"
-if test -n "$MV"; then
- echo "$ac_t""$MV" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-# Extract the first word of "ln", so it can be a program name with args.
-set dummy ln; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:985: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_LN'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$LN" in
- /*)
- ac_cv_path_LN="$LN" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_LN="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-LN="$ac_cv_path_LN"
-if test -n "$LN"; then
- echo "$ac_t""$LN" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1014: checking whether ln -s works" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- rm -f conftestdata
-if ln -s X conftestdata 2>/dev/null
-then
- rm -f conftestdata
- ac_cv_prog_LN_S="ln -s"
-else
- ac_cv_prog_LN_S=ln
-fi
-fi
-LN_S="$ac_cv_prog_LN_S"
-if test "$ac_cv_prog_LN_S" = "ln -s"; then
- echo "$ac_t""yes" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-# Extract the first word of "chmod", so it can be a program name with args.
-set dummy chmod; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1037: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_CHMOD'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$CHMOD" in
- /*)
- ac_cv_path_CHMOD="$CHMOD" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_CHMOD="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-CHMOD="$ac_cv_path_CHMOD"
-if test -n "$CHMOD"; then
- echo "$ac_t""$CHMOD" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-# Extract the first word of "sort", so it can be a program name with args.
-set dummy sort; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1068: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_SORT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$SORT" in
- /*)
- ac_cv_path_SORT="$SORT" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_SORT="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-SORT="$ac_cv_path_SORT"
-if test -n "$SORT"; then
- echo "$ac_t""$SORT" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1107: checking for a BSD compatible install" >&5
-if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
- done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL="$ac_install_sh"
- fi
-fi
-echo "$ac_t""$INSTALL" 1>&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-# Extract the first word of "perl", so it can be a program name with args.
-set dummy perl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1159: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$PERL" in
- /*)
- ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_PERL="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-PERL="$ac_cv_path_PERL"
-if test -n "$PERL"; then
- echo "$ac_t""$PERL" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-if test -z "$PERL" ; then
-echo "configure: warning: ***
- perl was not found
- Note: Some tools will not be built." 1>&2
-fi
-
-# Extract the first word of "mkdir", so it can be a program name with args.
-set dummy mkdir; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1196: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_MKDIR'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$MKDIR" in
- /*)
- ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_MKDIR="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-MKDIR="$ac_cv_path_MKDIR"
-if test -n "$MKDIR"; then
- echo "$ac_t""$MKDIR" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-
-echo $ac_n "checking for working $MKDIR -m 0755""... $ac_c" 1>&6
-echo "configure:1228: checking for working $MKDIR -m 0755" >&5
-if eval "test \"`echo '$''{'rtems_cv_prog_MKDIR_P'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- rm -rf conftestdata
-if $MKDIR -m 0775 conftestdata 2>/dev/null; then
-rtems_cv_prog_MKDIR_M="yes"
-else
-rtems_cv_prog_MKDIR_M="no"
-fi
-fi
-rm -rf conftestdata
-echo "$ac_t""$rtems_cv_prog_MKDIR_M" 1>&6
-
-
-
-echo $ac_n "checking for working $MKDIR -p""... $ac_c" 1>&6
-echo "configure:1245: checking for working $MKDIR -p" >&5
-if eval "test \"`echo '$''{'rtems_cv_prog_mkdir_p'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- rm -rf conftestdata
-if $MKDIR -p conftestdata 2>/dev/null ;then
-rtems_cv_prog_MKDIR_P="yes"
-else
-rtems_cv_prog_MKDIR_P="no"
-fi
-fi
-rm -rf conftestdata
-echo "$ac_t""$rtems_cv_prog_MKDIR_P" 1>&6
-
-test "$rtems_cv_prog_MKDIR_P" = "yes" && MKDIR="$MKDIR -p"
-#test "$rtems_cv_prog_MKDIR_M" = "yes" && MKDIR="$MKDIR -m 0755"
-
-# Extract the first word of "touch", so it can be a program name with args.
-set dummy touch; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1265: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_TOUCH'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$TOUCH" in
- /*)
- ac_cv_path_TOUCH="$TOUCH" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_TOUCH="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-TOUCH="$ac_cv_path_TOUCH"
-if test -n "$TOUCH"; then
- echo "$ac_t""$TOUCH" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-# Extract the first word of "cmp", so it can be a program name with args.
-set dummy cmp; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1296: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_CMP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$CMP" in
- /*)
- ac_cv_path_CMP="$CMP" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_CMP="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-CMP="$ac_cv_path_CMP"
-if test -n "$CMP"; then
- echo "$ac_t""$CMP" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-# Extract the first word of "sed", so it can be a program name with args.
-set dummy sed; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1328: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_SED'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$SED" in
- /*)
- ac_cv_path_SED="$SED" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_SED="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-SED="$ac_cv_path_SED"
-if test -n "$SED"; then
- echo "$ac_t""$SED" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-for ac_prog in gm4 m4
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1361: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_M4'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$M4" in
- /*)
- ac_cv_path_M4="$M4" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_M4="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-M4="$ac_cv_path_M4"
-if test -n "$M4"; then
- echo "$ac_t""$M4" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-test -n "$M4" && break
-done
-
-
-for ac_prog in bash ksh sh
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1398: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_KSH'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$KSH" in
- /*)
- ac_cv_path_KSH="$KSH" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_KSH="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-KSH="$ac_cv_path_KSH"
-if test -n "$KSH"; then
- echo "$ac_t""$KSH" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-test -n "$KSH" && break
-done
-
-
-if test -z "$KSH"; then
-{ echo "configure: error: ***
- Cannot determine a usable shell bash/ksh/sh
- Please contact your system administrator " 1>&2; exit 1; };
-fi
-
-
-
-
-RTEMS_HOST=$host_os
-
-case "${target}" in
- # hpux unix port should go here
- i[3456]86-go32-rtems*)
- target_cpu=i386
- rtems_bsp="go32 go32_p5"
- skip_startfiles="yes"
- RTEMS_HAS_POSIX_API=no
- ;;
- i[3456]86-pc-linux*) # unix "simulator" port
- target_cpu=unix
- RTEMS_HOST=Linux
- # override these settings
- RTEMS_HAS_POSIX_API=no
- ;;
- i[3456]86-*freebsd2*) # unix "simulator" port
- target_cpu=unix
- RTEMS_HOST=FreeBSD
- # override these settings
- RTEMS_HAS_POSIX_API=no
- ;;
- no_cpu-*rtems*)
- target_cpu=no_cpu
- RTEMS_HAS_POSIX_API=no
- ;;
- ppc*-*rtems*)
- target_cpu=powerpc
- ;;
- sparc-sun-solaris*) # unix "simulator" port
- target_cpu=unix
- RTEMS_HOST=Solaris
- # override these settings
- RTEMS_HAS_POSIX_API=no
- ;;
- *)
- echo $ac_n "checking rtems target cpu""... $ac_c" 1>&6
-echo "configure:1476: checking rtems target cpu" >&5
-target_cpu=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'`
-echo "$ac_t""$target_cpu" 1>&6
-
- ;;
-esac
-
-# Override the set of BSPs to be built.
-# Check whether --enable-rtemsbsp or --disable-rtemsbsp was given.
-if test "${enable_rtemsbsp+set}" = set; then
- enableval="$enable_rtemsbsp"
- \
- rtems_bsp=$enableval \
-
-fi
-
-
-# Is this a supported CPU?
-echo $ac_n "checking if cpu $target_cpu is supported""... $ac_c" 1>&6
-echo "configure:1495: checking if cpu $target_cpu is supported" >&5
-if test -d "$srcdir/c/src/exec/score/cpu/$target_cpu"; then
- echo "$ac_t""yes" 1>&6
- makefiles="$makefiles c/src/exec/score/cpu/$target_cpu/Makefile"
-else
- { echo "configure: error: no" 1>&2; exit 1; }
-fi
-
-
-if [ "${program_prefix}" = "NONE" ] ; then
- if [ "${target}" = "${host}" ] ; then
- program_prefix=
- else
- program_prefix=${target}-
- fi
-fi
-
-
-
-
-for ac_prog in "$program_prefix"gcc "$program_prefix"cc
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1520: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_CC_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$CC_FOR_TARGET" in
- /*)
- ac_cv_path_CC_FOR_TARGET="$CC_FOR_TARGET" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_CC_FOR_TARGET="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-CC_FOR_TARGET="$ac_cv_path_CC_FOR_TARGET"
-if test -n "$CC_FOR_TARGET"; then
- echo "$ac_t""$CC_FOR_TARGET" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-test -n "$CC_FOR_TARGET" && break
-done
-
-test -z "$CC_FOR_TARGET" \
- && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
-
-rtems_save_CC=$CC
-rtems_save_CFLAGS=$CFLAGS
-
-CC=$CC_FOR_TARGET
-
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1560: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext <<EOF
-#line 1570 "configure"
-#include "confdefs.h"
-main(){return(0);}
-EOF
-if { (eval echo configure:1574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- ac_cv_prog_cc_works=yes
- # If we can't run a trivial program, we are probably using a cross compiler.
- if (./conftest; exit) 2>/dev/null; then
- ac_cv_prog_cc_cross=no
- else
- ac_cv_prog_cc_cross=yes
- fi
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cc_works=no
-fi
-rm -fr conftest*
-
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
-fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1594: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1599: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
-else
- ac_cv_prog_gcc=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1623: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_g=yes
-else
- ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- fi
-else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-
-rtems_cv_prog_gcc=$ac_cv_prog_gcc
-rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
-rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
-rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
-
-CC=$rtems_save_CC
-CFLAGS=$rtems_save_CFLAGS
-
-unset ac_cv_prog_gcc
-unset ac_cv_prog_cc_g
-unset ac_cv_prog_cc_works
-unset ac_cv_prog_cc_cross
-
-
-echo $ac_n "checking whether $CC_FOR_TARGET accepts -specs""... $ac_c" 1>&6
-echo "configure:1665: checking whether $CC_FOR_TARGET accepts -specs" >&5
-if eval "test \"`echo '$''{'rtems_cv_gcc_specs'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
-rtems_cv_gcc_specs=no
-if test "$rtems_cv_prog_gcc" = "yes"; then
- touch confspec
- echo 'void f(){}' >conftest.c
- if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
- rtems_cv_gcc_specs=yes
- fi
-fi
-rm -f confspec conftest*
-
-fi
-
-echo "$ac_t""$rtems_cv_gcc_specs" 1>&6
-
-
-echo $ac_n "checking whether $CC_FOR_TARGET accepts --pipe""... $ac_c" 1>&6
-echo "configure:1686: checking whether $CC_FOR_TARGET accepts --pipe" >&5
-if eval "test \"`echo '$''{'rtems_cv_gcc_pipe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
-rtems_cv_gcc_pipe=no
-if test "$rtems_cv_prog_gcc" = "yes"; then
-case "$host_os" in
- cygwin32*)
- ;;
- *)
- echo 'void f(){}' >conftest.c
- if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
- rtems_cv_gcc_pipe=yes
- fi
- rm -f conftest*
- ;;
-esac
-fi
-
-fi
-
-echo "$ac_t""$rtems_cv_gcc_pipe" 1>&6
-
-
-if test "$RTEMS_USE_GCC272" != "yes" ; then
- if test "$rtems_cv_gcc_specs" = "no"; then
- echo "configure: warning: *** disabling --enable-gcc28" 1>&2
- RTEMS_USE_GCC272=yes
- fi
-fi
-test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
-
-if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
-
-
-for ac_prog in "$program_prefix"g++ "$program_prefix"c++
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1727: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_CXX_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$CXX_FOR_TARGET" in
- /*)
- ac_cv_path_CXX_FOR_TARGET="$CXX_FOR_TARGET" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_CXX_FOR_TARGET="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-CXX_FOR_TARGET="$ac_cv_path_CXX_FOR_TARGET"
-if test -n "$CXX_FOR_TARGET"; then
- echo "$ac_t""$CXX_FOR_TARGET" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-test -n "$CXX_FOR_TARGET" && break
-done
-
-test -z "$CXX_FOR_TARGET" \
- && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; }
-
-rtems_save_CXX=$CXX
-rtems_save_CXXFLAGS=$CXXFLAGS
-
-CXX=$CXX_FOR_TARGET
-
-echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1767: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
-
-ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
-
-cat > conftest.$ac_ext <<EOF
-#line 1777 "configure"
-#include "confdefs.h"
-main(){return(0);}
-EOF
-if { (eval echo configure:1781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- ac_cv_prog_cxx_works=yes
- # If we can't run a trivial program, we are probably using a cross compiler.
- if (./conftest; exit) 2>/dev/null; then
- ac_cv_prog_cxx_cross=no
- else
- ac_cv_prog_cxx_cross=yes
- fi
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cxx_works=no
-fi
-rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
-if test $ac_cv_prog_cxx_works = no; then
- { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
-fi
-echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1807: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
-cross_compiling=$ac_cv_prog_cxx_cross
-
-echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:1812: checking whether we are using GNU C++" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.C <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1821: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gxx=yes
-else
- ac_cv_prog_gxx=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gxx" 1>&6
-
-if test $ac_cv_prog_gxx = yes; then
- GXX=yes
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=
- echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:1836: checking whether ${CXX-g++} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.cc
-if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
- ac_cv_prog_cxx_g=yes
-else
- ac_cv_prog_cxx_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
- if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS="$ac_save_CXXFLAGS"
- elif test $ac_cv_prog_cxx_g = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-O2"
- fi
-else
- GXX=
- test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
-fi
-
-rtems_cv_prog_gxx=$ac_cv_prog_gxx
-rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g
-rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works
-rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross
-
-CXX=$rtems_save_CXX
-CXXFLAGS=$rtems_save_CXXFLAGS
-
-unset ac_cv_prog_gxx
-unset ac_cv_prog_cc_g
-unset ac_cv_prog_cxx_works
-unset ac_cv_prog_cxx_cross
-
- if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then
- { echo "configure: error: ***
- Inconsistency in compiler configuration:
- Target C compiler and Target C++ compiler
- must both ether be cross compilers or native compilers
- Hint: If building a posix bsp: LD_LIBRARY_PATH? " 1>&2; exit 1; }
- fi
-else
- CXX_FOR_TARGET="no"
-fi
-
-
-
-echo $ac_n "checking target's ar""... $ac_c" 1>&6
-echo "configure:1890: checking target's ar" >&5
-if eval "test \"`echo '$''{'ac_cv_path_AR_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- :
-fi
-
-echo "$ac_t""$ac_cv_path_AR_FOR_TARGET" 1>&6
-
-if test -n "$ac_cv_path_AR_FOR_TARGET"; then
- AR_FOR_TARGET=$ac_cv_path_AR_FOR_TARGET
-else
- if test -z "$AR_FOR_TARGET" ; then
- if test "$rtems_cv_prog_gcc" = "yes"; then
- # We are using gcc, ask it about its tool
- # NOTE: Necessary if gcc was configured to use the target's
- # native tools or uses prefixes for gnutools (e.g. gas instead of as)
- case $host_os in
- *cygwin32*)
- AR_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=ar | sed -e 's%\\\\%/%g' `
- ;;
- *)
- AR_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=ar`
- ;;
- esac
-
- fi
- else
- # The user set an environment variable.
- # Check whether it is an absolute path, otherwise AC_PATH_PROG
- # will override the environment variable, which isn't what the user
- # intends
- echo $ac_n "checking whether environment variable AR_FOR_TARGET is an absolute path""... $ac_c" 1>&6
-echo "configure:1923: checking whether environment variable AR_FOR_TARGET is an absolute path" >&5
- case "$AR_FOR_TARGET" in
- /*) # valid
- echo "$ac_t"""yes"" 1>&6
- ;;
- *) # invalid for AC_PATH_PROG
- echo "$ac_t"""no"" 1>&6
- { echo "configure: error: ***
- Environment variable AR_FOR_TARGET should ether
- be unset (preferred) or contain an absolute path" 1>&2; exit 1; }
- ;;
- esac
- fi
-
- # Extract the first word of ""$program_prefix"ar", so it can be a program name with args.
-set dummy "$program_prefix"ar; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1940: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_AR_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$AR_FOR_TARGET" in
- /*)
- ac_cv_path_AR_FOR_TARGET="$AR_FOR_TARGET" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_AR_FOR_TARGET="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_AR_FOR_TARGET" && ac_cv_path_AR_FOR_TARGET="no"
- ;;
-esac
-fi
-AR_FOR_TARGET="$ac_cv_path_AR_FOR_TARGET"
-if test -n "$AR_FOR_TARGET"; then
- echo "$ac_t""$AR_FOR_TARGET" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-
-echo $ac_n "checking target's as""... $ac_c" 1>&6
-echo "configure:1973: checking target's as" >&5
-if eval "test \"`echo '$''{'ac_cv_path_AS_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- :
-fi
-
-echo "$ac_t""$ac_cv_path_AS_FOR_TARGET" 1>&6
-
-if test -n "$ac_cv_path_AS_FOR_TARGET"; then
- AS_FOR_TARGET=$ac_cv_path_AS_FOR_TARGET
-else
- if test -z "$AS_FOR_TARGET" ; then
- if test "$rtems_cv_prog_gcc" = "yes"; then
- # We are using gcc, ask it about its tool
- # NOTE: Necessary if gcc was configured to use the target's
- # native tools or uses prefixes for gnutools (e.g. gas instead of as)
- case $host_os in
- *cygwin32*)
- AS_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=as | sed -e 's%\\\\%/%g' `
- ;;
- *)
- AS_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=as`
- ;;
- esac
-
- fi
- else
- # The user set an environment variable.
- # Check whether it is an absolute path, otherwise AC_PATH_PROG
- # will override the environment variable, which isn't what the user
- # intends
- echo $ac_n "checking whether environment variable AS_FOR_TARGET is an absolute path""... $ac_c" 1>&6
-echo "configure:2006: checking whether environment variable AS_FOR_TARGET is an absolute path" >&5
- case "$AS_FOR_TARGET" in
- /*) # valid
- echo "$ac_t"""yes"" 1>&6
- ;;
- *) # invalid for AC_PATH_PROG
- echo "$ac_t"""no"" 1>&6
- { echo "configure: error: ***
- Environment variable AS_FOR_TARGET should ether
- be unset (preferred) or contain an absolute path" 1>&2; exit 1; }
- ;;
- esac
- fi
-
- # Extract the first word of ""$program_prefix"as", so it can be a program name with args.
-set dummy "$program_prefix"as; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2023: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_AS_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$AS_FOR_TARGET" in
- /*)
- ac_cv_path_AS_FOR_TARGET="$AS_FOR_TARGET" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_AS_FOR_TARGET="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_AS_FOR_TARGET" && ac_cv_path_AS_FOR_TARGET="no"
- ;;
-esac
-fi
-AS_FOR_TARGET="$ac_cv_path_AS_FOR_TARGET"
-if test -n "$AS_FOR_TARGET"; then
- echo "$ac_t""$AS_FOR_TARGET" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-
-echo $ac_n "checking target's ld""... $ac_c" 1>&6
-echo "configure:2056: checking target's ld" >&5
-if eval "test \"`echo '$''{'ac_cv_path_LD_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- :
-fi
-
-echo "$ac_t""$ac_cv_path_LD_FOR_TARGET" 1>&6
-
-if test -n "$ac_cv_path_LD_FOR_TARGET"; then
- LD_FOR_TARGET=$ac_cv_path_LD_FOR_TARGET
-else
- if test -z "$LD_FOR_TARGET" ; then
- if test "$rtems_cv_prog_gcc" = "yes"; then
- # We are using gcc, ask it about its tool
- # NOTE: Necessary if gcc was configured to use the target's
- # native tools or uses prefixes for gnutools (e.g. gas instead of as)
- case $host_os in
- *cygwin32*)
- LD_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=ld | sed -e 's%\\\\%/%g' `
- ;;
- *)
- LD_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=ld`
- ;;
- esac
-
- fi
- else
- # The user set an environment variable.
- # Check whether it is an absolute path, otherwise AC_PATH_PROG
- # will override the environment variable, which isn't what the user
- # intends
- echo $ac_n "checking whether environment variable LD_FOR_TARGET is an absolute path""... $ac_c" 1>&6
-echo "configure:2089: checking whether environment variable LD_FOR_TARGET is an absolute path" >&5
- case "$LD_FOR_TARGET" in
- /*) # valid
- echo "$ac_t"""yes"" 1>&6
- ;;
- *) # invalid for AC_PATH_PROG
- echo "$ac_t"""no"" 1>&6
- { echo "configure: error: ***
- Environment variable LD_FOR_TARGET should ether
- be unset (preferred) or contain an absolute path" 1>&2; exit 1; }
- ;;
- esac
- fi
-
- # Extract the first word of ""$program_prefix"ld", so it can be a program name with args.
-set dummy "$program_prefix"ld; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2106: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_LD_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$LD_FOR_TARGET" in
- /*)
- ac_cv_path_LD_FOR_TARGET="$LD_FOR_TARGET" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_LD_FOR_TARGET="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_LD_FOR_TARGET" && ac_cv_path_LD_FOR_TARGET="no"
- ;;
-esac
-fi
-LD_FOR_TARGET="$ac_cv_path_LD_FOR_TARGET"
-if test -n "$LD_FOR_TARGET"; then
- echo "$ac_t""$LD_FOR_TARGET" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-
-echo $ac_n "checking target's nm""... $ac_c" 1>&6
-echo "configure:2139: checking target's nm" >&5
-if eval "test \"`echo '$''{'ac_cv_path_NM_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- :
-fi
-
-echo "$ac_t""$ac_cv_path_NM_FOR_TARGET" 1>&6
-
-if test -n "$ac_cv_path_NM_FOR_TARGET"; then
- NM_FOR_TARGET=$ac_cv_path_NM_FOR_TARGET
-else
- if test -z "$NM_FOR_TARGET" ; then
- if test "$rtems_cv_prog_gcc" = "yes"; then
- # We are using gcc, ask it about its tool
- # NOTE: Necessary if gcc was configured to use the target's
- # native tools or uses prefixes for gnutools (e.g. gas instead of as)
- case $host_os in
- *cygwin32*)
- NM_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=nm | sed -e 's%\\\\%/%g' `
- ;;
- *)
- NM_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=nm`
- ;;
- esac
-
- fi
- else
- # The user set an environment variable.
- # Check whether it is an absolute path, otherwise AC_PATH_PROG
- # will override the environment variable, which isn't what the user
- # intends
- echo $ac_n "checking whether environment variable NM_FOR_TARGET is an absolute path""... $ac_c" 1>&6
-echo "configure:2172: checking whether environment variable NM_FOR_TARGET is an absolute path" >&5
- case "$NM_FOR_TARGET" in
- /*) # valid
- echo "$ac_t"""yes"" 1>&6
- ;;
- *) # invalid for AC_PATH_PROG
- echo "$ac_t"""no"" 1>&6
- { echo "configure: error: ***
- Environment variable NM_FOR_TARGET should ether
- be unset (preferred) or contain an absolute path" 1>&2; exit 1; }
- ;;
- esac
- fi
-
- # Extract the first word of ""$program_prefix"nm", so it can be a program name with args.
-set dummy "$program_prefix"nm; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2189: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_NM_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$NM_FOR_TARGET" in
- /*)
- ac_cv_path_NM_FOR_TARGET="$NM_FOR_TARGET" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_NM_FOR_TARGET="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_NM_FOR_TARGET" && ac_cv_path_NM_FOR_TARGET="no"
- ;;
-esac
-fi
-NM_FOR_TARGET="$ac_cv_path_NM_FOR_TARGET"
-if test -n "$NM_FOR_TARGET"; then
- echo "$ac_t""$NM_FOR_TARGET" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-
-
-echo $ac_n "checking target's ranlib""... $ac_c" 1>&6
-echo "configure:2223: checking target's ranlib" >&5
-if eval "test \"`echo '$''{'ac_cv_path_RANLIB_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- :
-fi
-
-echo "$ac_t""$ac_cv_path_RANLIB_FOR_TARGET" 1>&6
-
-if test -n "$ac_cv_path_RANLIB_FOR_TARGET"; then
- RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
-else
- if test -z "$RANLIB_FOR_TARGET" ; then
- if test "$rtems_cv_prog_gcc" = "yes"; then
- # We are using gcc, ask it about its tool
- # NOTE: Necessary if gcc was configured to use the target's
- # native tools or uses prefixes for gnutools (e.g. gas instead of as)
- case $host_os in
- *cygwin32*)
- RANLIB_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=ranlib | sed -e 's%\\\\%/%g' `
- ;;
- *)
- RANLIB_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=ranlib`
- ;;
- esac
-
- fi
- else
- # The user set an environment variable.
- # Check whether it is an absolute path, otherwise AC_PATH_PROG
- # will override the environment variable, which isn't what the user
- # intends
- echo $ac_n "checking whether environment variable RANLIB_FOR_TARGET is an absolute path""... $ac_c" 1>&6
-echo "configure:2256: checking whether environment variable RANLIB_FOR_TARGET is an absolute path" >&5
- case "$RANLIB_FOR_TARGET" in
- /*) # valid
- echo "$ac_t"""yes"" 1>&6
- ;;
- *) # invalid for AC_PATH_PROG
- echo "$ac_t"""no"" 1>&6
- { echo "configure: error: ***
- Environment variable RANLIB_FOR_TARGET should ether
- be unset (preferred) or contain an absolute path" 1>&2; exit 1; }
- ;;
- esac
- fi
-
- # Extract the first word of ""$program_prefix"ranlib", so it can be a program name with args.
-set dummy "$program_prefix"ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2273: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_RANLIB_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$RANLIB_FOR_TARGET" in
- /*)
- ac_cv_path_RANLIB_FOR_TARGET="$RANLIB_FOR_TARGET" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_RANLIB_FOR_TARGET="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_RANLIB_FOR_TARGET" && ac_cv_path_RANLIB_FOR_TARGET="no"
- ;;
-esac
-fi
-RANLIB_FOR_TARGET="$ac_cv_path_RANLIB_FOR_TARGET"
-if test -n "$RANLIB_FOR_TARGET"; then
- echo "$ac_t""$RANLIB_FOR_TARGET" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
- if test "$RANLIB_FOR_TARGET" = "no"; then
- # ranlib wasn't found; check if ar -s is available
-
-echo $ac_n "checking whether $AR_FOR_TARGET -s works""... $ac_c" 1>&6
-echo "configure:2308: checking whether $AR_FOR_TARGET -s works" >&5
-if eval "test \"`echo '$''{'rtems_cv_AR_FOR_TARGET_S'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
-cat > conftest.$ac_ext <<EOF
-int foo( int b )
-{ return b; }
-EOF
-if { ac_try='$CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext'; { (eval echo configure:2317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
- && { ac_try='$AR_FOR_TARGET -sr conftest.a conftest.o'; { (eval echo configure:2318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
- && test -s conftest.a ; \
-then
- rtems_cv_AR_FOR_TARGET_S="yes"
-else
- rtems_cv_AR_FOR_TARGET_S="no"
-fi
- rm -f conftest*
-
-fi
-
-echo "$ac_t""$rtems_cv_AR_FOR_TARGET_S" 1>&6
-
- if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
- ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
- RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
- else
- { echo "configure: error: ***
- Can't figure out how to build a library index
- Nether ranlib nor ar -s seem to be available " 1>&2; exit 1; }
- fi
- fi
-
-
-echo $ac_n "checking target's objcopy""... $ac_c" 1>&6
-echo "configure:2343: checking target's objcopy" >&5
-if eval "test \"`echo '$''{'ac_cv_path_OBJCOPY_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- :
-fi
-
-echo "$ac_t""$ac_cv_path_OBJCOPY_FOR_TARGET" 1>&6
-
-if test -n "$ac_cv_path_OBJCOPY_FOR_TARGET"; then
- OBJCOPY_FOR_TARGET=$ac_cv_path_OBJCOPY_FOR_TARGET
-else
- if test -z "$OBJCOPY_FOR_TARGET" ; then
- if test "$rtems_cv_prog_gcc" = "yes"; then
- # We are using gcc, ask it about its tool
- # NOTE: Necessary if gcc was configured to use the target's
- # native tools or uses prefixes for gnutools (e.g. gas instead of as)
- case $host_os in
- *cygwin32*)
- OBJCOPY_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=objcopy | sed -e 's%\\\\%/%g' `
- ;;
- *)
- OBJCOPY_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=objcopy`
- ;;
- esac
-
- fi
- else
- # The user set an environment variable.
- # Check whether it is an absolute path, otherwise AC_PATH_PROG
- # will override the environment variable, which isn't what the user
- # intends
- echo $ac_n "checking whether environment variable OBJCOPY_FOR_TARGET is an absolute path""... $ac_c" 1>&6
-echo "configure:2376: checking whether environment variable OBJCOPY_FOR_TARGET is an absolute path" >&5
- case "$OBJCOPY_FOR_TARGET" in
- /*) # valid
- echo "$ac_t"""yes"" 1>&6
- ;;
- *) # invalid for AC_PATH_PROG
- echo "$ac_t"""no"" 1>&6
- { echo "configure: error: ***
- Environment variable OBJCOPY_FOR_TARGET should ether
- be unset (preferred) or contain an absolute path" 1>&2; exit 1; }
- ;;
- esac
- fi
-
- # Extract the first word of ""$program_prefix"objcopy", so it can be a program name with args.
-set dummy "$program_prefix"objcopy; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2393: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_OBJCOPY_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$OBJCOPY_FOR_TARGET" in
- /*)
- ac_cv_path_OBJCOPY_FOR_TARGET="$OBJCOPY_FOR_TARGET" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_OBJCOPY_FOR_TARGET="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_OBJCOPY_FOR_TARGET" && ac_cv_path_OBJCOPY_FOR_TARGET="no"
- ;;
-esac
-fi
-OBJCOPY_FOR_TARGET="$ac_cv_path_OBJCOPY_FOR_TARGET"
-if test -n "$OBJCOPY_FOR_TARGET"; then
- echo "$ac_t""$OBJCOPY_FOR_TARGET" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-
-echo $ac_n "checking target's size""... $ac_c" 1>&6
-echo "configure:2426: checking target's size" >&5
-if eval "test \"`echo '$''{'ac_cv_path_SIZE_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- :
-fi
-
-echo "$ac_t""$ac_cv_path_SIZE_FOR_TARGET" 1>&6
-
-if test -n "$ac_cv_path_SIZE_FOR_TARGET"; then
- SIZE_FOR_TARGET=$ac_cv_path_SIZE_FOR_TARGET
-else
- if test -z "$SIZE_FOR_TARGET" ; then
- if test "$rtems_cv_prog_gcc" = "yes"; then
- # We are using gcc, ask it about its tool
- # NOTE: Necessary if gcc was configured to use the target's
- # native tools or uses prefixes for gnutools (e.g. gas instead of as)
- case $host_os in
- *cygwin32*)
- SIZE_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=size | sed -e 's%\\\\%/%g' `
- ;;
- *)
- SIZE_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=size`
- ;;
- esac
-
- fi
- else
- # The user set an environment variable.
- # Check whether it is an absolute path, otherwise AC_PATH_PROG
- # will override the environment variable, which isn't what the user
- # intends
- echo $ac_n "checking whether environment variable SIZE_FOR_TARGET is an absolute path""... $ac_c" 1>&6
-echo "configure:2459: checking whether environment variable SIZE_FOR_TARGET is an absolute path" >&5
- case "$SIZE_FOR_TARGET" in
- /*) # valid
- echo "$ac_t"""yes"" 1>&6
- ;;
- *) # invalid for AC_PATH_PROG
- echo "$ac_t"""no"" 1>&6
- { echo "configure: error: ***
- Environment variable SIZE_FOR_TARGET should ether
- be unset (preferred) or contain an absolute path" 1>&2; exit 1; }
- ;;
- esac
- fi
-
- # Extract the first word of ""$program_prefix"size", so it can be a program name with args.
-set dummy "$program_prefix"size; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2476: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_SIZE_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$SIZE_FOR_TARGET" in
- /*)
- ac_cv_path_SIZE_FOR_TARGET="$SIZE_FOR_TARGET" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_SIZE_FOR_TARGET="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_SIZE_FOR_TARGET" && ac_cv_path_SIZE_FOR_TARGET="no"
- ;;
-esac
-fi
-SIZE_FOR_TARGET="$ac_cv_path_SIZE_FOR_TARGET"
-if test -n "$SIZE_FOR_TARGET"; then
- echo "$ac_t""$SIZE_FOR_TARGET" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-
-echo $ac_n "checking target's strip""... $ac_c" 1>&6
-echo "configure:2509: checking target's strip" >&5
-if eval "test \"`echo '$''{'ac_cv_path_STRIP_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- :
-fi
-
-echo "$ac_t""$ac_cv_path_STRIP_FOR_TARGET" 1>&6
-
-if test -n "$ac_cv_path_STRIP_FOR_TARGET"; then
- STRIP_FOR_TARGET=$ac_cv_path_STRIP_FOR_TARGET
-else
- if test -z "$STRIP_FOR_TARGET" ; then
- if test "$rtems_cv_prog_gcc" = "yes"; then
- # We are using gcc, ask it about its tool
- # NOTE: Necessary if gcc was configured to use the target's
- # native tools or uses prefixes for gnutools (e.g. gas instead of as)
- case $host_os in
- *cygwin32*)
- STRIP_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=strip | sed -e 's%\\\\%/%g' `
- ;;
- *)
- STRIP_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=strip`
- ;;
- esac
-
- fi
- else
- # The user set an environment variable.
- # Check whether it is an absolute path, otherwise AC_PATH_PROG
- # will override the environment variable, which isn't what the user
- # intends
- echo $ac_n "checking whether environment variable STRIP_FOR_TARGET is an absolute path""... $ac_c" 1>&6
-echo "configure:2542: checking whether environment variable STRIP_FOR_TARGET is an absolute path" >&5
- case "$STRIP_FOR_TARGET" in
- /*) # valid
- echo "$ac_t"""yes"" 1>&6
- ;;
- *) # invalid for AC_PATH_PROG
- echo "$ac_t"""no"" 1>&6
- { echo "configure: error: ***
- Environment variable STRIP_FOR_TARGET should ether
- be unset (preferred) or contain an absolute path" 1>&2; exit 1; }
- ;;
- esac
- fi
-
- # Extract the first word of ""$program_prefix"strip", so it can be a program name with args.
-set dummy "$program_prefix"strip; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2559: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_STRIP_FOR_TARGET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$STRIP_FOR_TARGET" in
- /*)
- ac_cv_path_STRIP_FOR_TARGET="$STRIP_FOR_TARGET" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_STRIP_FOR_TARGET="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_STRIP_FOR_TARGET" && ac_cv_path_STRIP_FOR_TARGET="no"
- ;;
-esac
-fi
-STRIP_FOR_TARGET="$ac_cv_path_STRIP_FOR_TARGET"
-if test -n "$STRIP_FOR_TARGET"; then
- echo "$ac_t""$STRIP_FOR_TARGET" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-
-
-if test "${target_cpu}" = "i386"; then
- echo $ac_n "checking for 16 bit mode assembler support""... $ac_c" 1>&6
-echo "configure:2594: checking for 16 bit mode assembler support" >&5
-if eval "test \"`echo '$''{'rtems_cv_prog_gas_code16'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.s << EOF
- .code16
- data32
- addr32
- lgdt 0
-EOF
- if { ac_try='$AS_FOR_TARGET -o conftest.o conftest.s'; { (eval echo configure:2604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
- rtems_cv_prog_gas_code16=yes
- else
- rtems_cv_prog_gas_code16=no
- fi
-fi
-
-echo "$ac_t""$rtems_cv_prog_gas_code16" 1>&6
- RTEMS_GAS_CODE16="$rtems_cv_prog_gas_code16"
- fi
-
-
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2619: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2648: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- ac_prog_rejected=no
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# -gt 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- set dummy "$ac_dir/$ac_word" "$@"
- shift
- ac_cv_prog_CC="$@"
- fi
-fi
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2696: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext <<EOF
-#line 2706 "configure"
-#include "confdefs.h"
-main(){return(0);}
-EOF
-if { (eval echo configure:2710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- ac_cv_prog_cc_works=yes
- # If we can't run a trivial program, we are probably using a cross compiler.
- if (./conftest; exit) 2>/dev/null; then
- ac_cv_prog_cc_cross=no
- else
- ac_cv_prog_cc_cross=yes
- fi
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cc_works=no
-fi
-rm -fr conftest*
-
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
-fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2730: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2735: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
-else
- ac_cv_prog_gcc=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2759: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_g=yes
-else
- ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- fi
-else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-
-
-echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:2788: checking for Cygwin32 environment" >&5
-if eval "test \"`echo '$''{'rtems_cv_cygwin32'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2793 "configure"
-#include "confdefs.h"
-
-int main() {
-return __CYGWIN32__;
-; return 0; }
-EOF
-if { (eval echo configure:2800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- rtems_cv_cygwin32=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- rtems_cv_cygwin32=no
-fi
-rm -f conftest*
-rm -f conftest*
-fi
-
-echo "$ac_t""$rtems_cv_cygwin32" 1>&6
-CYGWIN32=
-test "$rtems_cv_cygwin32" = yes && CYGWIN32=yes
-
-echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2818: checking for executable suffix" >&5
-if eval "test \"`echo '$''{'rtems_cv_exeext'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$CYGWIN32" = yes; then
-rtems_cv_exeext=.exe
-else
-cat > rtems_c_test.c << 'EOF'
-int main() {
-/* Nothing needed here */
-}
-EOF
-${CC-cc} -o rtems_c_test $CFLAGS $CPPFLAGS $LDFLAGS rtems_c_test.c $LIBS 1>&5
-rtems_cv_exeext=`echo rtems_c_test.* | grep -v rtems_c_test.c | sed -e s/rtems_c_test//`
-rm -f rtems_c_test*
-fi
-
-test x"${rtems_cv_exeext}" = x && rtems_cv_exeext=no
-fi
-EXEEXT=""
-test x"${rtems_cv_exeext}" != xno && EXEEXT=${rtems_cv_exeext}
-echo "$ac_t""${rtems_cv_exeext}" 1>&6
-
-
-case $host_os in
-*cygwin32*) GCCSED="| sed 's%\\\\%/%g'" ;;
-*) ;;
-esac
-
-
-if test "$ac_cv_prog_gcc" = "yes"; then
- CC_CFLAGS_DEFAULT=-Wall
- CC_CFLAGS_PROFILE_V=${CC_CFLAGS_PROFILE_V-"-pg"}
- CC_LDFLAGS_PROFILE_V=${CC_LDFLAGS_PROFILE_V-$CC_CFLAGS_PROFILE_V}
-fi
-
-test "$ac_cv_prog_cc_g" = "yes" && CC_CFLAGS_DEBUG_V=${CC_CFLAGS_DEBUG_V-"-g"}
-
-for ac_func in strerror
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2859: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2864 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:2887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-
-if test "$target_cpu" = "unix" ; then
-
-
-echo $ac_n "checking whether $RTEMS_HOST supports System V semaphores""... $ac_c" 1>&6
-echo "configure:2916: checking whether $RTEMS_HOST supports System V semaphores" >&5
-if eval "test \"`echo '$''{'rtems_cv_sysv_sem'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
-if test "$cross_compiling" = yes; then
- :
-else
- cat > conftest.$ac_ext <<EOF
-#line 2925 "configure"
-#include "confdefs.h"
-
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-int main () {
-#if !defined(sun)
- union semun arg ;
-#else
- union semun {
- int val;
- struct semid_ds *buf;
- ushort *array;
- } arg;
-#endif
- int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
- if (id == -1)
- exit(1);
- arg.val = 0; /* avoid implicit type cast to union */
- if (semctl(id, 0, IPC_RMID, arg) == -1)
- exit(1);
- exit(0);
-}
-
-EOF
-if { (eval echo configure:2951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
- rtems_cv_sysv_sem="yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- rtems_cv_sysv_sem="no"
-fi
-rm -fr conftest*
-fi
-
-
-fi
-
-echo "$ac_t""$rtems_cv_sysv_sem" 1>&6
-
- if test "$rtems_cv_sysv_sem" != "yes" ; then
- { echo "configure: error: System V semaphores don't work, required by simulator" 1>&2; exit 1; }
- fi
-
-
-echo $ac_n "checking whether $RTEMS_HOST supports System V shared memory""... $ac_c" 1>&6
-echo "configure:2974: checking whether $RTEMS_HOST supports System V shared memory" >&5
-if eval "test \"`echo '$''{'rtems_cv_sysv_shm'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
-if test "$cross_compiling" = yes; then
- :
-else
- cat > conftest.$ac_ext <<EOF
-#line 2983 "configure"
-#include "confdefs.h"
-
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-int main () {
- int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
- if (id == -1)
- exit(1);
- if (shmctl(id, IPC_RMID, 0) == -1)
- exit(1);
- exit(0);
-}
-
-EOF
-if { (eval echo configure:2999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
- rtems_cv_sysv_shm="yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- rtems_cv_sysv_shm="no"
-fi
-rm -fr conftest*
-fi
-
-
-fi
-
-echo "$ac_t""$rtems_cv_sysv_shm" 1>&6
-
- if test "$rtems_cv_sysv_shm" != "yes" ; then
- { echo "configure: error: System V shared memory doesn't work, required by simulator" 1>&2; exit 1; }
- fi
-
-
-echo $ac_n "checking whether $RTEMS_HOST supports System V messages""... $ac_c" 1>&6
-echo "configure:3022: checking whether $RTEMS_HOST supports System V messages" >&5
-if eval "test \"`echo '$''{'rtems_cv_sysv_msg'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
-if test "$cross_compiling" = yes; then
- :
-else
- cat > conftest.$ac_ext <<EOF
-#line 3031 "configure"
-#include "confdefs.h"
-
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-int main () {
- int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
- if (id == -1)
- exit(1);
- if (msgctl(id, IPC_RMID, 0) == -1)
- exit(1);
- exit(0);
-}
-
-EOF
-if { (eval echo configure:3047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
- rtems_cv_sysv_msg="yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- rtems_cv_sysv_msg="no"
-fi
-rm -fr conftest*
-fi
-
-
-fi
-
-echo "$ac_t""$rtems_cv_sysv_msg" 1>&6
-
- if test "$rtems_cv_sysv_msg" != "yes" ; then
- { echo "configure: error: System V messages don't work, required by simulator" 1>&2; exit 1; }
- fi
-fi
-
-# find all the Executive Makefiles
-
-echo $ac_n "checking for Makefile.in in c/src/exec/score/tools/$target_cpu""... $ac_c" 1>&6
-echo "configure:3072: checking for Makefile.in in c/src/exec/score/tools/$target_cpu" >&5
-if test -d $srcdir/c/src/exec/score/tools/$target_cpu; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/exec/score/tools/$target_cpu -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/exec/rtems""... $ac_c" 1>&6
-echo "configure:3087: checking for Makefile.in in c/src/exec/rtems" >&5
-if test -d $srcdir/c/src/exec/rtems; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/exec/rtems -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/exec/sapi""... $ac_c" 1>&6
-echo "configure:3102: checking for Makefile.in in c/src/exec/sapi" >&5
-if test -d $srcdir/c/src/exec/sapi; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/exec/sapi -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-if test "$RTEMS_HAS_POSIX_API" = "yes"; then
-
-echo $ac_n "checking for Makefile.in in c/src/exec/posix""... $ac_c" 1>&6
-echo "configure:3119: checking for Makefile.in in c/src/exec/posix" >&5
-if test -d $srcdir/c/src/exec/posix; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/exec/posix -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
- makefiles="$makefiles c/src/exec/wrapup/posix/Makefile"
-fi
-
-# find all the Makefiles for the BSPs
-if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then
- makefiles="$makefiles c/src/lib/libbsp/$target_cpu/Makefile"
-
- if test -z "$rtems_bsp"; then
- echo $ac_n "checking for bsps""... $ac_c" 1>&6
-echo "configure:3141: checking for bsps" >&5
- files=`ls $srcdir/c/src/lib/libbsp/$target_cpu`
- for file in $files; do
- case $file in
- shared*);;
- Makefile*);;
- READ*);;
- CVS*);;
- pxfl*);;
- go32*);; # so the i386 port can pick up the other Makefiles
- # Now account for BSPs with build variants
- gen68360) rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
- p4000) rtems_bsp="$rtems_bsp p4600 p4650";;
- mvme162) rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
- *) rtems_bsp="$rtems_bsp $file";;
- esac;
- done
-
- makefiles="$makefiles c/src/lib/libbsp/bare/Makefile"
-
- echo "$ac_t""$rtems_bsp done" 1>&6
- fi
-
- # collect makefiles for each bsp
- for i in $rtems_bsp; do
- # make sure there is a make/custom file for the bsp
- if test ! -r "$srcdir/make/custom/${i}.cfg"; then
- { echo "configure: error: no make/custom/${i}.cfg file for BSP $i" 1>&2; exit 1; }
- fi
-
- # account for "aliased" bsps which share source code
- case $i in
- mvme162lx) bspdir=mvme162 ;; # mvme162 board variant
- gen68360_040) bspdir=gen68360 ;; # 68360 in companion mode
- go32_p5) bspdir=go32 ;; # go32 on Pentium class CPU
- p4600) bspdir=p4000 ;; # p4000 board with IDT 4600
- p4650) bspdir=p4000 ;; # p4000 board with IDT 4650
- *) bspdir=$i;;
- esac
-
- # Is there code where there should be for this BSP?
- # The bare bsp is a special case as it is not under the target_cpu path
- case $i in
- bare)
- bspcpudir=
- if test "X${BARE_CPU_CFLAGS}" = "X" ; then
- { echo "configure: error: --enable-bare-cpu-cflags not specified for bare bsp" 1>&2; exit 1; }
- fi
- if test "X${BARE_CPU_MODEL}" = "X" ; then
- { echo "configure: error: --enable-bare-cpu-model not specified for bare bsp" 1>&2; exit 1; }
- fi
- ;;
- *)
- bspcpudir=$target_cpu/
- ;;
- esac
-
- if test -d "$srcdir/c/src/lib/libbsp/$bspcpudir$bspdir"; then
- RTEMS_BSP_LIST="$RTEMS_BSP_LIST $i"
- # make sure the Makefiles in a bsp directory are only done once
- echo $bspdirs | grep $bspdir >/dev/null 2>&1
- if test $? -ne 0 ; then
- bspdirs="$bspdirs $bspdir"
-
-echo $ac_n "checking for Makefile.in in c/src/lib/libbsp/$bspcpudir$bspdir""... $ac_c" 1>&6
-echo "configure:3206: checking for Makefile.in in c/src/lib/libbsp/$bspcpudir$bspdir" >&5
-if test -d $srcdir/c/src/lib/libbsp/$bspcpudir$bspdir; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/lib/libbsp/$bspcpudir$bspdir -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/lib/libbsp/${bspcpudir}shared""... $ac_c" 1>&6
-echo "configure:3221: checking for Makefile.in in c/src/lib/libbsp/${bspcpudir}shared" >&5
-if test -d $srcdir/c/src/lib/libbsp/${bspcpudir}shared; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/lib/libbsp/${bspcpudir}shared -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
- fi
- else
- { echo "configure: error: unable to find libbsp directory ($bspdir) for $i" 1>&2; exit 1; }
- fi
- done
-fi
-
-# find all the CPU dependent library Makefiles
-
-echo $ac_n "checking for Makefile.in in c/src/lib/libcpu/$target_cpu""... $ac_c" 1>&6
-echo "configure:3244: checking for Makefile.in in c/src/lib/libcpu/$target_cpu" >&5
-if test -d $srcdir/c/src/lib/libcpu/$target_cpu; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/lib/libcpu/$target_cpu -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-if test "$skip_startfiles" != "yes"; then
-
-echo $ac_n "checking for Makefile.in in c/src/lib/start/$target_cpu""... $ac_c" 1>&6
-echo "configure:3261: checking for Makefile.in in c/src/lib/start/$target_cpu" >&5
-if test -d $srcdir/c/src/lib/start/$target_cpu; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/lib/start/$target_cpu -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-fi
-
-
-
-PROJECT_ROOT=`pwd;`
-
-# If RTEMS macros are enabled, then use them. Otherwise, use inlines.
-if test "$RTEMS_USE_MACROS" = "yes"; then
- inline_dir=macros
- if test "$RTEMS_HAS_POSIX_API" = "yes"; then
- # The problem is that there is currently no code in posix/macros :)
- { echo "configure: error: Macros are not implemented for the POSIX API" 1>&2; exit 1; }
- fi
-else
- inline_dir=inline
-fi
-
-# If the TCP/IP stack is enabled, then find all TCP/IP Makefiles
-echo $ac_n "checking if networking is enabled? ""... $ac_c" 1>&6
-echo "configure:3293: checking if networking is enabled? " >&5
-echo "$ac_t""$RTEMS_HAS_NETWORKING" 1>&6
-if test "$RTEMS_HAS_NETWORKING" = "yes"; then
-
-echo $ac_n "checking for Makefile.in in c/src/lib/libnetworking""... $ac_c" 1>&6
-echo "configure:3298: checking for Makefile.in in c/src/lib/libnetworking" >&5
-if test -d $srcdir/c/src/lib/libnetworking; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/lib/libnetworking -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-fi
-
-# If the C++ support is enabled, then include the Makefiles
-if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
- makefiles="$makefiles c/src/lib/librtems++/Makefile"
-fi
-
-# If the tests are enabled, then find all the test suite Makefiles
-echo $ac_n "checking if the test suites are enabled? ""... $ac_c" 1>&6
-echo "configure:3320: checking if the test suites are enabled? " >&5
-tests_enabled=yes
-# Check whether --enable-tests or --disable-tests was given.
-if test "${enable_tests+set}" = set; then
- enableval="$enable_tests"
- \
- case "${enableval}" in
- yes) echo "$ac_t""yes" 1>&6 ;;
- no) echo "$ac_t""no" 1>&6 ; tests_enabled=no ;;
- *) { echo "configure: error: bad value ${enableval} for tests option" 1>&2; exit 1; } ;;
- esac
-else
- echo "$ac_t""yes" 1>&6
-
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/tests/tools/$target_cpu""... $ac_c" 1>&6
-echo "configure:3339: checking for Makefile.in in c/src/tests/tools/$target_cpu" >&5
-if test -d $srcdir/c/src/tests/tools/$target_cpu; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/tests/tools/$target_cpu -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-if test "$tests_enabled" = "yes"; then
-
-echo $ac_n "checking for Makefile.in in c/src/tests/libtests""... $ac_c" 1>&6
-echo "configure:3356: checking for Makefile.in in c/src/tests/libtests" >&5
-if test -d $srcdir/c/src/tests/libtests; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/tests/libtests -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/tests/sptests""... $ac_c" 1>&6
-echo "configure:3371: checking for Makefile.in in c/src/tests/sptests" >&5
-if test -d $srcdir/c/src/tests/sptests; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/tests/sptests -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/tests/tmtests""... $ac_c" 1>&6
-echo "configure:3386: checking for Makefile.in in c/src/tests/tmtests" >&5
-if test -d $srcdir/c/src/tests/tmtests; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/tests/tmtests -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/tests/mptests""... $ac_c" 1>&6
-echo "configure:3401: checking for Makefile.in in c/src/tests/mptests" >&5
-if test -d $srcdir/c/src/tests/mptests; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/tests/mptests -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
- if test "$RTEMS_HAS_POSIX_API" = "yes"; then
-
-echo $ac_n "checking for Makefile.in in c/src/tests/psxtests""... $ac_c" 1>&6
-echo "configure:3417: checking for Makefile.in in c/src/tests/psxtests" >&5
-if test -d $srcdir/c/src/tests/psxtests; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/tests/psxtests -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
- fi
-fi
-
-# If the HWAPI is enabled, the find the HWAPI Makefiles
-echo $ac_n "checking if the HWAPI is enabled? ""... $ac_c" 1>&6
-echo "configure:3435: checking if the HWAPI is enabled? " >&5
-# Check whether --enable-hwapi or --disable-hwapi was given.
-if test "${enable_hwapi+set}" = set; then
- enableval="$enable_hwapi"
- \
- case "${enableval}" in
- yes) echo "$ac_t""yes" 1>&6
- if test -f ${srcdir}/c/src/lib/libhwapi/Makefile.in ; then
- makefiles="$makefiles c/src/lib/libhwapi/Makefile"
-
-echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/analog""... $ac_c" 1>&6
-echo "configure:3446: checking for Makefile.in in c/src/lib/libhwapi/analog" >&5
-if test -d $srcdir/c/src/lib/libhwapi/analog; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/lib/libhwapi/analog -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/discrete""... $ac_c" 1>&6
-echo "configure:3461: checking for Makefile.in in c/src/lib/libhwapi/discrete" >&5
-if test -d $srcdir/c/src/lib/libhwapi/discrete; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/lib/libhwapi/discrete -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/drivers""... $ac_c" 1>&6
-echo "configure:3476: checking for Makefile.in in c/src/lib/libhwapi/drivers" >&5
-if test -d $srcdir/c/src/lib/libhwapi/drivers; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/lib/libhwapi/drivers -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory""... $ac_c" 1>&6
-echo "configure:3491: checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory" >&5
-if test -d $srcdir/c/src/lib/libhwapi/non_volatile_memory; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/lib/libhwapi/non_volatile_memory -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/serial""... $ac_c" 1>&6
-echo "configure:3506: checking for Makefile.in in c/src/lib/libhwapi/serial" >&5
-if test -d $srcdir/c/src/lib/libhwapi/serial; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/lib/libhwapi/serial -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/support""... $ac_c" 1>&6
-echo "configure:3521: checking for Makefile.in in c/src/lib/libhwapi/support" >&5
-if test -d $srcdir/c/src/lib/libhwapi/support; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/lib/libhwapi/support -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/wrapup""... $ac_c" 1>&6
-echo "configure:3536: checking for Makefile.in in c/src/lib/libhwapi/wrapup" >&5
-if test -d $srcdir/c/src/lib/libhwapi/wrapup; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/lib/libhwapi/wrapup -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
- else
- { echo "configure: error: No source code found for the HWAPI" 1>&2; exit 1; }
- fi
- ;;
- no) echo "$ac_t""no" 1>&6 ;;
- *) { echo "configure: error: bad value ${enableval} for hwapi option" 1>&2; exit 1; } ;;
- esac
-else
- echo "$ac_t""no" 1>&6
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# pick up all the Makefiles in required parts of the tree
-
-echo $ac_n "checking for Makefile.in in c/build-tools""... $ac_c" 1>&6
-echo "configure:3586: checking for Makefile.in in c/build-tools" >&5
-if test -d $srcdir/c/build-tools; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/build-tools -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in make""... $ac_c" 1>&6
-echo "configure:3601: checking for Makefile.in in make" >&5
-if test -d $srcdir/make; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find make -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/lib/libchip""... $ac_c" 1>&6
-echo "configure:3616: checking for Makefile.in in c/src/lib/libchip" >&5
-if test -d $srcdir/c/src/lib/libchip; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/lib/libchip -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/lib/libmisc""... $ac_c" 1>&6
-echo "configure:3631: checking for Makefile.in in c/src/lib/libmisc" >&5
-if test -d $srcdir/c/src/lib/libmisc; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/lib/libmisc -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Makefile.in in c/src/tests/samples""... $ac_c" 1>&6
-echo "configure:3646: checking for Makefile.in in c/src/tests/samples" >&5
-if test -d $srcdir/c/src/tests/samples; then
- rtems_av_save_dir=`pwd`;
- cd $srcdir;
- rtems_av_tmp=`find c/src/tests/samples -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
- makefiles="$makefiles $rtems_av_tmp";
- cd $rtems_av_save_dir;
- echo "$ac_t""done" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-
-
-# try not to explicitly list a Makefile here
-trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
- if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
-fi
-
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
-DEFS=-DHAVE_CONFIG_H
-
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
-
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
-
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
-do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
-done
-
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
-
-trap 'rm -fr `echo "Makefile
-make/host.cfg
-make/target.cfg
-make/Templates/Makefile.inc
-make/compilers/gcc.cfg
-c/Makefile
-c/src/Makefile
-c/src/exec/Makefile
-c/src/exec/score/Makefile
-c/src/exec/score/cpu/Makefile
-c/src/exec/score/headers/Makefile
-c/src/exec/score/${inline_dir}/Makefile
-c/src/exec/score/src/Makefile
-c/src/exec/score/tools/Makefile
-c/src/exec/score/tools/generic/Makefile
-c/src/exec/wrapup/Makefile
-c/src/exec/wrapup/rtems/Makefile
-c/src/lib/Makefile
-c/src/lib/include/Makefile
-c/src/lib/libbsp/Makefile
-c/src/lib/libbsp/shmdr/Makefile
-c/src/lib/libc/Makefile
-c/src/lib/libcpu/Makefile
-c/src/lib/start/Makefile
-c/src/lib/wrapup/Makefile
-c/src/tests/Makefile
-c/src/tests/support/Makefile
-c/src/tests/support/include/Makefile
-c/src/tests/support/stubdr/Makefile
-c/src/tests/support/wrapup/Makefile
-c/src/tests/tools/Makefile
-c/src/tests/tools/generic/Makefile
-$makefiles
-c/update-tools/Makefile c/build-tools/src/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@host@%$host%g
-s%@host_alias@%$host_alias%g
-s%@host_cpu@%$host_cpu%g
-s%@host_vendor@%$host_vendor%g
-s%@host_os@%$host_os%g
-s%@target@%$target%g
-s%@target_alias@%$target_alias%g
-s%@target_cpu@%$target_cpu%g
-s%@target_vendor@%$target_vendor%g
-s%@target_os@%$target_os%g
-s%@build@%$build%g
-s%@build_alias@%$build_alias%g
-s%@build_cpu@%$build_cpu%g
-s%@build_vendor@%$build_vendor%g
-s%@build_os@%$build_os%g
-s%@CAT@%$CAT%g
-s%@RM@%$RM%g
-s%@CP@%$CP%g
-s%@MV@%$MV%g
-s%@LN@%$LN%g
-s%@LN_S@%$LN_S%g
-s%@CHMOD@%$CHMOD%g
-s%@SORT@%$SORT%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@PERL@%$PERL%g
-s%@MKDIR@%$MKDIR%g
-s%@TOUCH@%$TOUCH%g
-s%@CMP@%$CMP%g
-s%@SED@%$SED%g
-s%@M4@%$M4%g
-s%@KSH@%$KSH%g
-s%@CC_FOR_TARGET@%$CC_FOR_TARGET%g
-s%@CXX_FOR_TARGET@%$CXX_FOR_TARGET%g
-s%@AR_FOR_TARGET@%$AR_FOR_TARGET%g
-s%@AS_FOR_TARGET@%$AS_FOR_TARGET%g
-s%@LD_FOR_TARGET@%$LD_FOR_TARGET%g
-s%@NM_FOR_TARGET@%$NM_FOR_TARGET%g
-s%@RANLIB_FOR_TARGET@%$RANLIB_FOR_TARGET%g
-s%@OBJCOPY_FOR_TARGET@%$OBJCOPY_FOR_TARGET%g
-s%@SIZE_FOR_TARGET@%$SIZE_FOR_TARGET%g
-s%@STRIP_FOR_TARGET@%$STRIP_FOR_TARGET%g
-s%@CC@%$CC%g
-s%@EXEEXT@%$EXEEXT%g
-s%@GCCSED@%$GCCSED%g
-s%@RTEMS_GAS_CODE16@%$RTEMS_GAS_CODE16%g
-s%@rtems_cv_prog_cc_cross@%$rtems_cv_prog_cc_cross%g
-s%@RTEMS_BSP_LIST@%$RTEMS_BSP_LIST%g
-s%@RTEMS_HOST@%$RTEMS_HOST%g
-s%@RTEMS_LIBC_DIR@%$RTEMS_LIBC_DIR%g
-s%@RTEMS_USE_OWN_PDIR@%$RTEMS_USE_OWN_PDIR%g
-s%@RTEMS_HAS_POSIX_API@%$RTEMS_HAS_POSIX_API%g
-s%@RTEMS_HAS_NETWORKING@%$RTEMS_HAS_NETWORKING%g
-s%@RTEMS_USE_MACROS@%$RTEMS_USE_MACROS%g
-s%@RTEMS_HAS_CPLUSPLUS@%$RTEMS_HAS_CPLUSPLUS%g
-s%@RTEMS_USE_GCC272@%$RTEMS_USE_GCC272%g
-s%@BARE_CPU_CFLAGS@%$BARE_CPU_CFLAGS%g
-s%@BARE_CPU_MODEL@%$BARE_CPU_MODEL%g
-s%@PROJECT_ROOT@%$PROJECT_ROOT%g
-s%@program_prefix@%$program_prefix%g
-s%@CC_CFLAGS_DEFAULT@%$CC_CFLAGS_DEFAULT%g
-s%@CC_CFLAGS_DEBUG_V@%$CC_CFLAGS_DEBUG_V%g
-s%@CC_CFLAGS_PROFILE_V@%$CC_CFLAGS_PROFILE_V%g
-s%@CC_LDFLAGS_PROFILE_V@%$CC_LDFLAGS_PROFILE_V%g
-
-CEOF
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
- else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
- fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
- else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
- fi
-done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
-fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile
-make/host.cfg
-make/target.cfg
-make/Templates/Makefile.inc
-make/compilers/gcc.cfg
-c/Makefile
-c/src/Makefile
-c/src/exec/Makefile
-c/src/exec/score/Makefile
-c/src/exec/score/cpu/Makefile
-c/src/exec/score/headers/Makefile
-c/src/exec/score/${inline_dir}/Makefile
-c/src/exec/score/src/Makefile
-c/src/exec/score/tools/Makefile
-c/src/exec/score/tools/generic/Makefile
-c/src/exec/wrapup/Makefile
-c/src/exec/wrapup/rtems/Makefile
-c/src/lib/Makefile
-c/src/lib/include/Makefile
-c/src/lib/libbsp/Makefile
-c/src/lib/libbsp/shmdr/Makefile
-c/src/lib/libc/Makefile
-c/src/lib/libcpu/Makefile
-c/src/lib/start/Makefile
-c/src/lib/wrapup/Makefile
-c/src/tests/Makefile
-c/src/tests/support/Makefile
-c/src/tests/support/include/Makefile
-c/src/tests/support/stubdr/Makefile
-c/src/tests/support/wrapup/Makefile
-c/src/tests/tools/Makefile
-c/src/tests/tools/generic/Makefile
-$makefiles
-c/update-tools/Makefile"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
-
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
-
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
-
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
- esac
-
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='\([ ]\)%\1#\2define\3'
-ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
-
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="c/build-tools/src/config.h"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- echo creating $ac_file
-
- rm -f conftest.frag conftest.in conftest.out
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
-
-EOF
-
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h. And first:
-# Protect against being on the right side of a sed subst in config.status.
-# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
-
-# This sed command replaces #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-EOF
-
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
-
-rm -f conftest.tail
-while :
-do
- ac_lines=`grep -c . conftest.vals`
- # grep -c gives empty output for an empty file on some AIX systems.
- if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
- echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-' >> $CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
- rm -f conftest.vals
- mv conftest.tail conftest.vals
-done
-rm -f conftest.vals
-
-cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- echo "$ac_file is unchanged"
- rm -f conftest.h
- else
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- fi
- rm -f $ac_file
- mv conftest.h $ac_file
- fi
-fi; done
-
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
-
-echo
-echo target architecture: $target_cpu.
-echo available BSPs: $rtems_bsp.
-echo \'make all\' will build the following BSPs: $RTEMS_BSP_LIST.
-echo other BSPs can be built with \'make RTEMS_BSP=\"bsp1 bsp2 ...\"\'
-echo
diff --git a/configure.in b/configure.in
deleted file mode 100644
index fe1105b60d..0000000000
--- a/configure.in
+++ /dev/null
@@ -1,532 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-dnl
-dnl $Id$
-
-AC_PREREQ(2.12)
-AC_INIT(README)
-
-dnl Checks for programs.
-AC_PROG_MAKE_SET
-AC_CANONICAL_SYSTEM
-AC_ARG_WITH(cross-host,[ --with-cross-host=HOST host (cygnus)], \
-host=$withval)
-
-AC_ARG_ENABLE(gmake-print-directory, \
-[ --enable-gmake-print-directory enable GNU Make's print directory], \
-[case "${enableval}" in
- yes) RTEMS_USE_OWN_PDIR=no ;;
- no) RTEMS_USE_OWN_PDIR=yes ;;
- *) AC_MSG_ERROR(bad value ${enableval} for gmake-print-directory option) ;;
-esac],[RTEMS_USE_OWN_PDIR=yes])
-
-AC_ARG_ENABLE(posix, \
-[ --enable-posix enable posix interface], \
-[case "${enableval}" in
- yes) RTEMS_HAS_POSIX_API=yes ;;
- no) RTEMS_HAS_POSIX_API=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;;
-esac],[RTEMS_HAS_POSIX_API=yes])
-
-AC_ARG_ENABLE(networking, \
-[ --enable-networking enable TCP/IP stack], \
-[case "${enableval}" in
- yes) RTEMS_HAS_NETWORKING=yes ;;
- no) RTEMS_HAS_NETWORKING=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for enable-networking option) ;;
-esac],[RTEMS_HAS_NETWORKING=yes])
-
-AC_ARG_ENABLE(rtems-inlines, \
-[ --enable-rtems-inlines enable RTEMS inline functions (use macros)], \
-[case "${enableval}" in
- yes) RTEMS_USE_MACROS=no ;;
- no) RTEMS_USE_MACROS=yes ;;
- *) AC_MSG_ERROR(bad value ${enableval} for disable-rtems-inlines option) ;;
-esac],[RTEMS_USE_MACROS=no])
-
-AC_ARG_ENABLE(cxx, \
-[ --enable-cxx enable C++ support, and build the rtems++ library], \
-[case "${enableval}" in
- yes) RTEMS_HAS_CPLUSPLUS=yes ;;
- no) RTEMS_HAS_CPLUSPLUS=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for enable-cxx option) ;;
-esac], [RTEMS_HAS_CPLUSPLUS=no])
-
-AC_ARG_ENABLE(gcc28, \
-[ --enable-gcc28 enable use of gcc 2.8.x features], \
-[case "${enableval}" in
- yes) RTEMS_USE_GCC272=no ;;
- no) RTEMS_USE_GCC272=yes ;;
- *) AC_MSG_ERROR(bad value ${enableval} for gcc-28 option) ;;
-esac],[RTEMS_USE_GCC272=no])
-
-AC_ARG_ENABLE(libcdir, \
-[ --enable-libcdir=directory set the directory for the C library], \
-[ RTEMS_LIBC_DIR="${enableval}" ; \
-test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] )
-
-AC_ARG_ENABLE(bare-cpu-cflags,
-[ --enable-bare-cpu-cflags \
- specify a particular cpu cflag (bare bsp specific)],
-[case "${enableval}" in
- no) BARE_CPU_CFLAGS="" ;;
- *) BARE_CPU_CFLAGS="${enableval}" ;;
-esac],
-[BARE_CPU_CFLAGS=""])
-
-AC_ARG_ENABLE(bare-cpu-model,
-[ --enable-bare-cpu-model \
- specify a particular cpu model (bare bsp specific)],
-[case "${enableval}" in
- no) BARE_CPU_MODEL="" ;;
- *) BARE_CPU_MODEL="${enableval}" ;;
-esac],
-[BARE_CPU_MODEL=""])
-
-RTEMS_PREFIX=${target_cpu}-${target_vendor}
-
-dnl BEGIN configure.host.in
-
-AC_PATH_PROG(CAT,cat)
-AC_PATH_PROG(RM,rm)
-AC_PATH_PROG(CP,cp)
-AC_PATH_PROG(MV,mv)
-AC_PATH_PROG(LN,ln)
-AC_PROG_LN_S
-AC_PATH_PROG(CHMOD,chmod)
-AC_PATH_PROG(SORT,sort)
-AC_PROG_INSTALL
-AC_PATH_PROG(PERL,perl)
-if test -z "$PERL" ; then
-AC_MSG_WARN(
-[***]
-[ perl was not found]
-[ Note: Some tools will not be built.])
-fi
-
-dnl check mkdir behaviour, try to get mkdir -p -m 0755
-RTEMS_PATH_MKDIR
-RTEMS_PROG_MKDIR_M
-RTEMS_PROG_MKDIR_P
-test "$rtems_cv_prog_MKDIR_P" = "yes" && MKDIR="$MKDIR -p"
-#test "$rtems_cv_prog_MKDIR_M" = "yes" && MKDIR="$MKDIR -m 0755"
-
-AC_PATH_PROG(TOUCH,touch)
-AC_PATH_PROG(CMP,cmp)
-
-AC_PATH_PROG(SED,sed)
-AC_PATH_PROGS(M4,gm4 m4)
-
-dnl NOTE: prefer bash over ksh over sh
-AC_PATH_PROGS(KSH,bash ksh sh)
-
-if test -z "$KSH"; then
-dnl NOTE: This cannot happen -- /bin/sh must always exist
-AC_MSG_ERROR(
-[***]
-[ Cannot determine a usable shell bash/ksh/sh]
-[ Please contact your system administrator] );
-fi
-
-dnl BEGIN configure.target.in
-
-dnl echo "TARGET"
-dnl echo " cpu --> $target_cpu"
-dnl echo " os --> $target_os"
-dnl echo " vendor --> $target_vendor"
-
-dnl canonicalize target name
-dnl NOTE: Most rtems targets do not fullfil autoconf
-dnl targets naming conventions "processor-vendor-os"
-dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
-dnl and we have to fix it for rtems ourselves
-dnl
-dnl The original plan was to do CPU-BSP-rtems or CPU-rtems to
-dnl imply all BSPs. Eventually we would like to build a collection
-dnl of CPU model specific RTEMS libraries which in conjunction with
-dnl a BSP library would be used to link an application.
-
-RTEMS_HOST=$host_os
-
-case "${target}" in
- # hpux unix port should go here
- i[[3456]]86-go32-rtems*)
- target_cpu=i386
- rtems_bsp="go32 go32_p5"
- skip_startfiles="yes"
- RTEMS_HAS_POSIX_API=no
- ;;
- i[[3456]]86-pc-linux*) # unix "simulator" port
- target_cpu=unix
- RTEMS_HOST=Linux
- # override these settings
- RTEMS_HAS_POSIX_API=no
- ;;
- i[[3456]]86-*freebsd2*) # unix "simulator" port
- target_cpu=unix
- RTEMS_HOST=FreeBSD
- # override these settings
- RTEMS_HAS_POSIX_API=no
- ;;
- no_cpu-*rtems*)
- target_cpu=no_cpu
- RTEMS_HAS_POSIX_API=no
- ;;
- ppc*-*rtems*)
- target_cpu=powerpc
- ;;
- sparc-sun-solaris*) # unix "simulator" port
- target_cpu=unix
- RTEMS_HOST=Solaris
- # override these settings
- RTEMS_HAS_POSIX_API=no
- ;;
- *)
- RTEMS_CANONICAL_TARGET_CPU
- ;;
-esac
-
-# Override the set of BSPs to be built.
-AC_ARG_ENABLE(rtemsbsp, \
- [ --enable-rtemsbsp=bsp1 bsp2 .. BSPs to include in build], \
- rtems_bsp=$enableval \
-)
-
-# Is this a supported CPU?
-AC_MSG_CHECKING([if cpu $target_cpu is supported])
-if test -d "$srcdir/c/src/exec/score/cpu/$target_cpu"; then
- AC_MSG_RESULT(yes)
- makefiles="$makefiles c/src/exec/score/cpu/$target_cpu/Makefile"
-else
- AC_MSG_ERROR(no)
-fi
-
-RTEMS_TOOL_PREFIX
-
-dnl check target cc
-RTEMS_PROG_CC
-dnl check if the compiler supports --specs
-RTEMS_GCC_SPECS
-dnl check if the target compiler may use --pipe
-RTEMS_GCC_PIPE
-
-dnl check if the compiler supports --specs if gcc28 is requested
-if test "$RTEMS_USE_GCC272" != "yes" ; then
- if test "$rtems_cv_gcc_specs" = "no"; then
- AC_MSG_WARN([*** disabling --enable-gcc28])
- RTEMS_USE_GCC272=yes
- fi
-fi
-test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
-
-dnl check for g++
-if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
- RTEMS_PROG_CXX
- if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then
- AC_MSG_ERROR([***]
- [Inconsistency in compiler configuration:]
- [Target C compiler and Target C++ compiler]
- [must both ether be cross compilers or native compilers]
- [Hint: If building a posix bsp: LD_LIBRARY_PATH?] )
- fi
-else
- CXX_FOR_TARGET="no"
-fi
-
-RTEMS_CANONICALIZE_TOOLS
-
-dnl if this is an i386, does gas have good code16 support?
-RTEMS_I386_GAS_CODE16
-
-dnl check host cc
-AC_PROG_CC
-
-RTEMS_CYGWIN32
-RTEMS_EXEEXT
-
-dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-*
-case $host_os in
-*cygwin32*) GCCSED="| sed 's%\\\\%/%g'" ;;
-*) ;;
-esac
-AC_SUBST(GCCSED)
-
-dnl FIXME: This is a kludge
-dnl Set flags to settings all gcc variants are assumed to accept.
-if test "$ac_cv_prog_gcc" = "yes"; then
-dnl Add -Wall if using gcc as host compiler
- CC_CFLAGS_DEFAULT=-Wall
-dnl Add -pg to profile flags, unless specified in the environment
- CC_CFLAGS_PROFILE_V=${CC_CFLAGS_PROFILE_V-"-pg"}
-dnl propagate cflags to ldflags, unless specified in the environment
- CC_LDFLAGS_PROFILE_V=${CC_LDFLAGS_PROFILE_V-$CC_CFLAGS_PROFILE_V}
-fi
-
-dnl Add -g if the host compiler accepts -g, assume -g means debugging
-test "$ac_cv_prog_cc_g" = "yes" && CC_CFLAGS_DEBUG_V=${CC_CFLAGS_DEBUG_V-"-g"}
-
-dnl check for host library functions
-dnl NOTE: must be called after AC_PROG_CC
-AC_CHECK_FUNCS(strerror)
-
-dnl check for SysV IPC used by simulators
-if test "$target_cpu" = "unix" ; then
- RTEMS_SYSV_SEM
- if test "$rtems_cv_sysv_sem" != "yes" ; then
- AC_MSG_ERROR([System V semaphores don't work, required by simulator])
- fi
- RTEMS_SYSV_SHM
- if test "$rtems_cv_sysv_shm" != "yes" ; then
- AC_MSG_ERROR([System V shared memory doesn't work, required by simulator])
- fi
- RTEMS_SYSV_MSG
- if test "$rtems_cv_sysv_msg" != "yes" ; then
- AC_MSG_ERROR([System V messages don't work, required by simulator])
- fi
-fi
-
-# find all the Executive Makefiles
-RTEMS_CHECK_MAKEFILE(c/src/exec/score/tools/$target_cpu)
-RTEMS_CHECK_MAKEFILE(c/src/exec/rtems)
-RTEMS_CHECK_MAKEFILE(c/src/exec/sapi)
-
-if test "$RTEMS_HAS_POSIX_API" = "yes"; then
- RTEMS_CHECK_MAKEFILE(c/src/exec/posix)
- makefiles="$makefiles c/src/exec/wrapup/posix/Makefile"
-fi
-
-# find all the Makefiles for the BSPs
-if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then
- makefiles="$makefiles c/src/lib/libbsp/$target_cpu/Makefile"
-
- if test -z "$rtems_bsp"; then
- AC_MSG_CHECKING([for bsps])
- files=`ls $srcdir/c/src/lib/libbsp/$target_cpu`
- for file in $files; do
- case $file in
- shared*);;
- Makefile*);;
- READ*);;
- CVS*);;
- pxfl*);;
- go32*);; # so the i386 port can pick up the other Makefiles
- # Now account for BSPs with build variants
- gen68360) rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
- p4000) rtems_bsp="$rtems_bsp p4600 p4650";;
- mvme162) rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
- *) rtems_bsp="$rtems_bsp $file";;
- esac;
- done
-
- makefiles="$makefiles c/src/lib/libbsp/bare/Makefile"
-
- AC_MSG_RESULT([$rtems_bsp done])
- fi
-
- # collect makefiles for each bsp
- for i in $rtems_bsp; do
- # make sure there is a make/custom file for the bsp
- if test ! -r "$srcdir/make/custom/${i}.cfg"; then
- AC_MSG_ERROR([no make/custom/${i}.cfg file for BSP $i])
- fi
-
- # account for "aliased" bsps which share source code
- case $i in
- mvme162lx) bspdir=mvme162 ;; # mvme162 board variant
- gen68360_040) bspdir=gen68360 ;; # 68360 in companion mode
- go32_p5) bspdir=go32 ;; # go32 on Pentium class CPU
- p4600) bspdir=p4000 ;; # p4000 board with IDT 4600
- p4650) bspdir=p4000 ;; # p4000 board with IDT 4650
- *) bspdir=$i;;
- esac
-
- # Is there code where there should be for this BSP?
- # The bare bsp is a special case as it is not under the target_cpu path
- case $i in
- bare)
- bspcpudir=
- if test "X${BARE_CPU_CFLAGS}" = "X" ; then
- AC_MSG_ERROR([--enable-bare-cpu-cflags not specified for bare bsp])
- fi
- if test "X${BARE_CPU_MODEL}" = "X" ; then
- AC_MSG_ERROR([--enable-bare-cpu-model not specified for bare bsp])
- fi
- ;;
- *)
- bspcpudir=$target_cpu/
- ;;
- esac
-
- if test -d "$srcdir/c/src/lib/libbsp/$bspcpudir$bspdir"; then
- RTEMS_BSP_LIST="$RTEMS_BSP_LIST $i"
- # make sure the Makefiles in a bsp directory are only done once
- echo $bspdirs | grep $bspdir >/dev/null 2>&1
- if test $? -ne 0 ; then
- bspdirs="$bspdirs $bspdir"
- RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/$bspcpudir$bspdir)
- RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/${bspcpudir}shared)
- fi
- else
- AC_MSG_ERROR([unable to find libbsp directory ($bspdir) for $i])
- fi
- done
-fi
-
-# find all the CPU dependent library Makefiles
-RTEMS_CHECK_MAKEFILE(c/src/lib/libcpu/$target_cpu)
-
-dnl Workaround for go32
-if test "$skip_startfiles" != "yes"; then
- RTEMS_CHECK_MAKEFILE(c/src/lib/start/$target_cpu)
-fi
-
-dnl END configure.target.in
-
-
-PROJECT_ROOT=`pwd;`
-
-# If RTEMS macros are enabled, then use them. Otherwise, use inlines.
-if test "$RTEMS_USE_MACROS" = "yes"; then
- inline_dir=macros
- if test "$RTEMS_HAS_POSIX_API" = "yes"; then
- # The problem is that there is currently no code in posix/macros :)
- AC_MSG_ERROR(Macros are not implemented for the POSIX API)
- fi
-else
- inline_dir=inline
-fi
-
-# If the TCP/IP stack is enabled, then find all TCP/IP Makefiles
-AC_MSG_CHECKING([if networking is enabled? ])
-AC_MSG_RESULT($RTEMS_HAS_NETWORKING)
-if test "$RTEMS_HAS_NETWORKING" = "yes"; then
- RTEMS_CHECK_MAKEFILE(c/src/lib/libnetworking)
-fi
-
-# If the C++ support is enabled, then include the Makefiles
-if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
- makefiles="$makefiles c/src/lib/librtems++/Makefile"
-fi
-
-# If the tests are enabled, then find all the test suite Makefiles
-AC_MSG_CHECKING([if the test suites are enabled? ])
-tests_enabled=yes
-AC_ARG_ENABLE(tests, \
-[ --enable-tests enable tests], \
- [case "${enableval}" in
- yes) AC_MSG_RESULT(yes) ;;
- no) AC_MSG_RESULT(no) ; tests_enabled=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for tests option) ;;
- esac],
-AC_MSG_RESULT(yes)
-)
-
-RTEMS_CHECK_MAKEFILE(c/src/tests/tools/$target_cpu)
-
-if test "$tests_enabled" = "yes"; then
- RTEMS_CHECK_MAKEFILE(c/src/tests/libtests)
- RTEMS_CHECK_MAKEFILE(c/src/tests/sptests)
- RTEMS_CHECK_MAKEFILE(c/src/tests/tmtests)
- RTEMS_CHECK_MAKEFILE(c/src/tests/mptests)
- if test "$RTEMS_HAS_POSIX_API" = "yes"; then
- RTEMS_CHECK_MAKEFILE(c/src/tests/psxtests)
- fi
-fi
-
-# If the HWAPI is enabled, the find the HWAPI Makefiles
-AC_MSG_CHECKING([if the HWAPI is enabled? ])
-AC_ARG_ENABLE(hwapi, \
-[ --enable-hwapi enable hardware API library], \
- [case "${enableval}" in
- yes) AC_MSG_RESULT(yes)
- if test -f ${srcdir}/c/src/lib/libhwapi/Makefile.in ; then
- makefiles="$makefiles c/src/lib/libhwapi/Makefile"
- RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/analog)
- RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/discrete)
- RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/drivers)
- RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/non_volatile_memory)
- RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/serial)
- RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/support)
- RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/wrapup)
- else
- AC_MSG_ERROR(No source code found for the HWAPI)
- fi
- ;;
- no) AC_MSG_RESULT(no) ;;
- *) AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;;
- esac],
- AC_MSG_RESULT(no)
-)
-
-AC_SUBST(RTEMS_GAS_CODE16)
-AC_SUBST(rtems_cv_prog_cc_cross)
-AC_SUBST(RTEMS_BSP_LIST)
-AC_SUBST(RTEMS_HOST)
-AC_SUBST(RTEMS_LIBC_DIR)
-AC_SUBST(RTEMS_USE_OWN_PDIR)
-AC_SUBST(RTEMS_HAS_POSIX_API)
-AC_SUBST(RTEMS_HAS_NETWORKING)
-AC_SUBST(RTEMS_USE_MACROS)
-AC_SUBST(RTEMS_HAS_CPLUSPLUS)
-AC_SUBST(RTEMS_USE_GCC272)
-AC_SUBST(RTEMS_LIBC_DIR)
-AC_SUBST(BARE_CPU_CFLAGS)
-AC_SUBST(BARE_CPU_MODEL)
-AC_SUBST(PROJECT_ROOT)
-AC_SUBST(program_prefix)
-AC_SUBST(CC_CFLAGS_DEFAULT)
-AC_SUBST(CC_CFLAGS_DEBUG_V)
-AC_SUBST(CC_CFLAGS_PROFILE_V)
-AC_SUBST(CC_LDFLAGS_PROFILE_V)
-
-# pick up all the Makefiles in required parts of the tree
-RTEMS_CHECK_MAKEFILE(c/build-tools)
-RTEMS_CHECK_MAKEFILE(make)
-RTEMS_CHECK_MAKEFILE(c/src/lib/libchip)
-RTEMS_CHECK_MAKEFILE(c/src/lib/libmisc)
-RTEMS_CHECK_MAKEFILE(c/src/tests/samples)
-
-AC_CONFIG_HEADER(c/build-tools/src/config.h)
-
-# try not to explicitly list a Makefile here
-AC_OUTPUT(
-Makefile
-make/host.cfg
-make/target.cfg
-make/Templates/Makefile.inc
-make/compilers/gcc.cfg
-c/Makefile
-c/src/Makefile
-c/src/exec/Makefile
-c/src/exec/score/Makefile
-c/src/exec/score/cpu/Makefile
-c/src/exec/score/headers/Makefile
-c/src/exec/score/${inline_dir}/Makefile
-c/src/exec/score/src/Makefile
-c/src/exec/score/tools/Makefile
-c/src/exec/score/tools/generic/Makefile
-c/src/exec/wrapup/Makefile
-c/src/exec/wrapup/rtems/Makefile
-c/src/lib/Makefile
-c/src/lib/include/Makefile
-c/src/lib/libbsp/Makefile
-c/src/lib/libbsp/shmdr/Makefile
-c/src/lib/libc/Makefile
-c/src/lib/libcpu/Makefile
-c/src/lib/start/Makefile
-c/src/lib/wrapup/Makefile
-c/src/tests/Makefile
-c/src/tests/support/Makefile
-c/src/tests/support/include/Makefile
-c/src/tests/support/stubdr/Makefile
-c/src/tests/support/wrapup/Makefile
-c/src/tests/tools/Makefile
-c/src/tests/tools/generic/Makefile
-$makefiles
-c/update-tools/Makefile)
-
-echo
-echo target architecture: $target_cpu.
-echo available BSPs: $rtems_bsp.
-echo \'make all\' will build the following BSPs: $RTEMS_BSP_LIST.
-echo other BSPs can be built with \'make RTEMS_BSP=\"bsp1 bsp2 ...\"\'
-echo
diff --git a/cpukit/ada/rtems.adb b/cpukit/ada/rtems.adb
deleted file mode 100644
index 9bd7432be1..0000000000
--- a/cpukit/ada/rtems.adb
+++ /dev/null
@@ -1,2035 +0,0 @@
---
--- RTEMS / Body
--- 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 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;
-
- -- XXX
- function Interrupt_Disable
- return RTEMS.ISR_Level is
- begin
- return 0;
- end Interrupt_Disable;
-
- procedure Interrupt_Enable (
- Level : in RTEMS.ISR_Level
- ) is
- begin
- Null;
- end Interrupt_Enable;
-
- procedure Interrupt_Flash (
- Level : in RTEMS.ISR_Level
- ) is
- begin
- Null;
- end Interrupt_Flash;
-
- function Interrupt_Is_In_Progress
- return RTEMS.Boolean is
- begin
- return RTEMS.From_Ada_Boolean (Standard.True);
- end 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
- ) 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_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 (
- ID : RTEMS.ID;
- Wall_Time : in RTEMS.Time_Of_Day;
- Routine : RTEMS.Timer_Service_Routine;
- User_Data : RTEMS.Address
- ) return RTEMS.Status_Codes;
- pragma Import (C, Timer_Fire_When, "rtems_timer_fire_when");
- begin
-
- Result := Timer_Fire_When (
- ID,
- Wall_Time,
- Routine,
- User_Data
- );
-
- end Timer_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;
-
- --
- -- 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;
- Return_Value : out RTEMS.Unsigned32;
- Result : out RTEMS.Status_Codes
- ) is
- function IO_Initialize_Base (
- Major : RTEMS.Device_Major_Number;
- Minor : RTEMS.Device_Minor_Number;
- Argument : RTEMS.Address;
- Return_Value : access RTEMS.Unsigned32
- ) return RTEMS.Status_Codes;
- pragma Import (C, IO_Initialize_Base, "rtems_io_initialize");
- Return_Value_Base : aliased RTEMS.Unsigned32 := Return_Value;
- begin
-
- Result := IO_Initialize_Base (
- Major,
- Minor,
- Argument,
- Return_Value_Base'Unchecked_Access
- );
-
- Return_Value := Return_Value_Base;
-
- 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 : out RTEMS.Driver_Name_t;
- 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;
-
- --
- -- Multiprocessing Manager
- --
-
- procedure Multiprocessing_Announce is
- procedure Multiprocessing_Announce_Base;
- pragma Import (C, Multiprocessing_Announce_Base,
- "rtems_multiprocessing_announce");
- begin
-
- Multiprocessing_Announce_Base;
-
- end Multiprocessing_Announce;
-
-
- --
- -- 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/cpukit/ada/rtems.ads b/cpukit/ada/rtems.ads
deleted file mode 100644
index 508f24046f..0000000000
--- a/cpukit/ada/rtems.ads
+++ /dev/null
@@ -1,1430 +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
-
- 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;
-
- type Unsigned32_Pointer is access all RTEMS.Unsigned32;
- type Unsigned16_Pointer is access all RTEMS.Unsigned16;
- type Unsigned8_Pointer is access all RTEMS.Unsigned8;
-
- 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;
-
- --
- -- 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;
- 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;
- 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;
-
- procedure Interrupt_Enable (
- Level : in RTEMS.ISR_Level
- );
-
- procedure Interrupt_Flash (
- Level : in RTEMS.ISR_Level
- );
-
- function Interrupt_Is_In_Progress
- return RTEMS.Boolean;
-
- --
- -- 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_Fire_When (
- ID : in RTEMS.ID;
- Wall_Time : in RTEMS.Time_Of_Day;
- Routine : in RTEMS.Timer_Service_Routine;
- User_Data : in RTEMS.Address;
- Result : out RTEMS.Status_Codes
- );
-
- procedure Timer_Reset (
- ID : in RTEMS.ID;
- Result : out RTEMS.Status_Codes
- );
-
- procedure Timer_Cancel (
- ID : in RTEMS.ID;
- Result : out RTEMS.Status_Codes
- );
-
- --
- -- Semaphore Manager
- --
-
- procedure Semaphore_Create (
- Name : in RTEMS.Name;
- Count : in RTEMS.Unsigned32;
- Attribute_Set : in RTEMS.Attribute;
- Priority_Ceiling : in RTEMS.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;
- Return_Value : out RTEMS.Unsigned32;
- 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 : out RTEMS.Driver_Name_t;
- 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
- );
-
- --
- -- Multiprocessing Manager
- --
-
- procedure Multiprocessing_Announce;
-
-
- --
- -- 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");
-
-
-private
-end RTEMS;
diff --git a/cpukit/libcsupport/include/chain.h b/cpukit/libcsupport/include/chain.h
deleted file mode 100644
index 98cf2b1a86..0000000000
--- a/cpukit/libcsupport/include/chain.h
+++ /dev/null
@@ -1,362 +0,0 @@
-/* chain.h
- *
- * This include file contains all the constants and structures associated
- * with doubly linked chains. This file actually just provides an
- * interface to the chain object in rtems.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * 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.
- *
- * $ld:
- */
-
-#ifndef __CHAIN_h
-#define __CHAIN_h
-
-#include <rtems.h>
-
-/*
- * Chain_Initialize
- *
- * This routine initializes the_chain structure to manage the
- * contiguous array of number_nodes nodes which starts at
- * starting_address. Each node is of node_size bytes.
- *
- * Chain_Control *the_chain, * IN *
- * void *starting_address, * IN *
- * rtems_unsigned32 number_nodes, * IN *
- * rtems_unsigned32 node_size * IN *
- */
-
-#define Chain_Initialize( the_chain, starting_address, \
- number_nodes, node_size ) \
- _Chain_Initialize( the_chain, starting_address, \
- number_nodes, node_size ) \
-
-
-/*
- * Chain_Initialize_empty
- *
- * This routine initializes the specified chain to contain zero nodes.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Initialize_empty( the_chain ) \
- _Chain_Initialize_empty( the_chain )
-
-
-/*
- * Chain_Are_nodes_equal
- *
- * This function returns TRUE if LEFT and RIGHT are equal,
- * and FALSE otherwise.
- *
- * Chain_Node *left, * IN *
- * Chain_Node *right * IN *
- */
-
-#define Chain_Are_nodes_equal( left, right ) \
- _Chain_Are_nodes_equal( left, right )
-
-
-/*
- * Chain_Extract_unprotected
- *
- * This routine extracts the_node from the chain on which it resides.
- * It does NOT disable interrupts to insure the atomicity of the
- * extract operation.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Extract_unprotected( the_node ) \
- _Chain_Extract_unprotected( the_node )
-
-
-/*
- * Chain_Extract
- *
- * This routine extracts the_node from the chain on which it resides.
- * It disables interrupts to insure the atomicity of the
- * extract operation.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Extract( the_node ) \
- _Chain_Extract( the_node )
-
-
-/*
- * Chain_Get_unprotected
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. If the_chain is empty, then NULL is returned.
- * It does NOT disable interrupts to insure the atomicity of the
- * get operation.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Get_unprotected( the_chain ) \
- _Chain_Get_unprotected( the_chain )
-
-
-/*
- * Chain_Get
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. If the_chain is empty, then NULL is returned.
- * It disables interrupts to insure the atomicity of the
- * get operation.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Get( the_chain ) \
- _Chain_Get( the_chain )
-
-
-/*
- * Chain_Get_first_unprotected
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. It does NOT disable interrupts to insure
- * the atomicity of the get operation.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Get_first_unprotected( the_chain ) \
- _Chain_Get_first_unprotected( the_chain )
-
-
-/*
- * Chain_Insert_unprotected
- *
- * This routine inserts the_node on a chain immediately following
- * after_node. It does NOT disable interrupts to insure the atomicity
- * of the extract operation.
- *
- * Chain_Node *after_node, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Insert_unprotected( after_node, the_node ) \
- _Chain_Insert_unprotected( after_node, the_node )
-
-
-/*
- * Chain_Insert
- *
- * This routine inserts the_node on a chain immediately following
- * after_node. It disables interrupts to insure the atomicity
- * of the extract operation.
- *
- * Chain_Node *after_node, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Insert( after_node, the_node ) \
- _Chain_Insert( after_node, the_node )
-
-
-/*
- * Chain_Append_unprotected
- *
- * This routine appends the_node onto the end of the_chain.
- * It does NOT disable interrupts to insure the atomicity of the
- * append operation.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Append_unprotected( the_chain, the_node ) \
- _Chain_Append_unprotected( the_chain, the_node )
-
-
-/*
- * Chain_Append
- *
- * This routine appends the_node onto the end of the_chain.
- * It disables interrupts to insure the atomicity of the
- * append operation.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Append( the_chain, the_node ) \
- _Chain_Append( the_chain, the_node )
-
-
-/*
- * Chain_Prepend_unprotected
- *
- * This routine prepends the_node onto the front of the_chain.
- * It does NOT disable interrupts to insure the atomicity of the
- * prepend operation.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Prepend_unprotected( the_chain, the_node ) \
- _Chain_Prepend_unprotected( the_chain, the_node )
-
-
-/*
- * Chain_Prepend
- *
- * This routine prepends the_node onto the front of the_chain.
- * It disables interrupts to insure the atomicity of the
- * prepend operation.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Prepend( the_chain, the_node ) \
- _Chain_Prepend( the_chain, the_node )
-
-
-/*
- * Chain_Head
- *
- * This function returns a pointer to the first node on the chain.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Head( the_chain ) \
- _Chain_Head( the_chain )
-
-
-/*
- * Chain_Tail
- *
- * This function returns a pointer to the last node on the chain.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Tail( the_chain ) \
- _Chain_Tail( the_chain )
-
-
-/*
- * Chain_Is_head
- *
- * This function returns TRUE if the_node is the head of the_chain and
- * FALSE otherwise.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_head( the_chain, the_node ) \
- _Chain_Is_head( the_chain, the_node )
-
-
-/*
- * Chain_Is_tail
- *
- * This function returns TRUE if the_node is the tail of the_chain and
- * FALSE otherwise.
- *
- * Chain_Control *the_chain, * IN *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_tail( the_chain, the_node ) \
- _Chain_Is_tail( the_chain, the_node )
-
-
-/*
- * Chain_Is_first
- *
- * This function returns TRUE if the_node is the first node on a chain and
- * FALSE otherwise.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_first( the_node ) \
- _Chain_Is_first( the_node )
-
-
-/*
- * Chain_Is_last
- *
- * This function returns TRUE if the_node is the last node on a chain and
- * FALSE otherwise.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_last( the_node ) \
- _Chain_Is_last( the_node )
-
-
-/*
- * Chain_Is_empty
- *
- * This function returns TRUE if there are no nodes on the_chain and
- * FALSE otherwise.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Is_empty( the_chain ) \
- _Chain_Is_empty( the_chain )
-
-
-/*
- * Chain_Has_only_one_node
- *
- * This function returns TRUE if there is only one node on the_chain and
- * FALSE otherwise.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Has_only_one_node( the_chain ) \
- _Chain_Has_only_one_node( the_chain )
-
-
-/*
- * Chain_Is_null
- *
- * This function returns TRUE if the_chain is NULL and FALSE otherwise.
- *
- * Chain_Control *the_chain * IN *
- */
-
-#define Chain_Is_null( the_chain ) \
- _Chain_Is_null( the_chain )
-
-
-/*
- * Chain_Is_null_node
- *
- * This function returns TRUE if the_node is NULL and FALSE otherwise.
- *
- * Chain_Node *the_node * IN *
- */
-
-#define Chain_Is_null_node( the_node ) \
- _Chain_Is_null_node( the_node )
-
-
-#undef __RTEMS_APPLICATION__
-#include <rtems/score/chain.inl>
-#define __RTEMS_APPLICATION__
-#endif
-/* end of include file */
diff --git a/cpukit/libcsupport/include/clockdrv.h b/cpukit/libcsupport/include/clockdrv.h
deleted file mode 100644
index 74c9d5e9f7..0000000000
--- a/cpukit/libcsupport/include/clockdrv.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* clock.h
- *
- * This file describes the Clock Driver for all boards.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __CLOCK_DRIVER_h
-#define __CLOCK_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* variables */
-
-extern volatile rtems_unsigned32 Clock_driver_ticks;
-extern rtems_device_major_number rtems_clock_major;
-extern rtems_device_minor_number rtems_clock_minor;
-
-/* default clock driver entry */
-
-#define CLOCK_DRIVER_TABLE_ENTRY \
- { Clock_initialize, NULL, NULL, NULL, NULL, Clock_control }
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver Clock_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/libcsupport/include/console.h b/cpukit/libcsupport/include/console.h
deleted file mode 100644
index 2f5173d757..0000000000
--- a/cpukit/libcsupport/include/console.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* console.h
- *
- * This file describes the Console Device Driver for all boards.
- * This driver provides support for the standard C Library.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 _CONSOLE_DRIVER_h
-#define _CONSOLE_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CONSOLE_DRIVER_TABLE_ENTRY \
- { console_initialize, console_open, console_close, \
- console_read, console_write, console_control }
-
-void console_reserve_resources(
- rtems_configuration_table *configuration
-);
-
-rtems_device_driver console_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_open(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_close(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_read(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_write(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver console_control(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/libcsupport/include/iosupp.h b/cpukit/libcsupport/include/iosupp.h
deleted file mode 100644
index 97175e0a7b..0000000000
--- a/cpukit/libcsupport/include/iosupp.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* iosupp.h
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __IOSUPP_h
-#define __IOSUPP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* character constants */
-
-#define BS 0x08 /* backspace */
-#define LF 0x0a /* line feed */
-#define CR 0x0d /* carriage return */
-#define XON 0x11 /* control-Q */
-#define XOFF 0x13 /* control-S */
-
-/* structures */
-
-#ifdef IOSUPP_INIT
-#define IOSUPP_EXTERN
-#else
-#undef IOSUPP_EXTERN
-#define IOSUPP_EXTERN extern
-#endif
-
-/* functions */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/cpukit/libcsupport/include/motorola/mc68230.h b/cpukit/libcsupport/include/motorola/mc68230.h
deleted file mode 100644
index bde00c4cdd..0000000000
--- a/cpukit/libcsupport/include/motorola/mc68230.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * mc68230.h -- Low level support code for the Motorola 68230 Parallel
- * Interface/Timer (PIT)
- *
- * Modified by Doug McBride, Colorado Space Grant College
- *
- * Format taken partly from RTEMS code and mostly from Motorola IDP user's
- * manual. RTEMS copyright information below.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MC68230_H__
-#define __MC68230_H__
-
-/* Some Motorola IDP User manual defines: */
-#define PIT_ADDR 0x00c01003 /* base address of the PIT */
-#define REGOFF 0x04 /* Difference between addresses */
-#define VECT 64
-#define H1VECT 0x00
-#define H2VECT 0x01
-#define H3VECT 0x02
-#define H4VECT 0x03
-
-/*
- * mc68230 register offsets
- */
-#define PGCR 0x00
-#define PSRR 1*REGOFF
-#define PADDR 2*REGOFF
-#define PBDDR 3*REGOFF
-#define PCDDR 4*REGOFF
-#define PIVR 5*REGOFF
-#define PACR 6*REGOFF
-#define PBCR 7*REGOFF
-#define PADR 8*REGOFF
-#define PBDR 9*REGOFF
-#define PAAR 10*REGOFF
-#define PBAR 11*REGOFF
-#define PCDR 12*REGOFF
-#define PITSR 13*REGOFF
-#define TCR 16*REGOFF
-#define TIVR 17*REGOFF
-#define CPRH 19*REGOFF
-#define CPRM 20*REGOFF
-#define CPRL 21*REGOFF
-#define CNTRH 23*REGOFF
-#define CNTRM 24*REGOFF
-#define CNTRL 25*REGOFF
-#define TSR 26*REGOFF
-
-/* Some RTEMS style defines: */
-#ifndef VOL8
-#define VOL8( ptr ) ((volatile rtems_unsigned8 *)(ptr))
-#endif
-
-#define MC68230_WRITE( reg, data ) \
- *(VOL8(PIT_ADDR+reg)) = (data)
-
-#define MC68230_READ( reg, data ) \
- (data) = *(VOL8(PIT_ADDR+reg))
-
-#endif
diff --git a/cpukit/libcsupport/include/motorola/mc68681.h b/cpukit/libcsupport/include/motorola/mc68681.h
deleted file mode 100644
index 7602097fd8..0000000000
--- a/cpukit/libcsupport/include/motorola/mc68681.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * mc68681-duart.h -- Low level support code for the Motorola mc68681
- * DUART.
- *
- * Originally written by rob@cygnus.com (Rob Savoye) for the libgloss
- * IDP support.
- *
- * $Id$
- */
-
-#ifndef __MC68681_H__
-#define __MC68681_H__
-
-/*
- * In the dark ages when this controller was designed, it was actually
- * possible to access data on unaligned byte boundaries with no penalty.
- * Now we find this chip in configurations in which the registers are
- * at 16-bit, 32-bit, and 64-bit boundaries at the whim of the board
- * designer. If the registers are not at byte addresses, then
- * set this multiplier before including this file to correct the offsets.
- */
-
-#ifndef MC68681_OFFSET_MULTIPLIER
-#define MC68681_OFFSET_MULTIPLIER 1
-#endif
-
-#define __MC68681_REG(_R) ((_R) * MC68681_OFFSET_MULTIPLIER)
-
-/*
- * mc68681 register offsets Read/Write Addresses
- */
-#define MC68681_MODE_REG_1A __MC68681_REG(0) /* MR1A-MR Prior to Read */
-#define MC68681_MODE_REG_2A __MC68681_REG(0) /* MR2A-MR After Read */
-
-#define MC68681_COUNT_MODE_CURRENT_MSB __MC68681_REG(6) /* CTU */
-#define MC68681_COUNTER_TIMER_UPPER_REG __MC68681_REG(6) /* CTU */
-#define MC68681_COUNT_MODE_CURRENT_LSB __MC68681_REG(7) /* CTL */
-#define MC68681_COUNTER_TIMER_LOWER_REG __MC68681_REG(7) /* CTL */
-#define MC68681_INTERRUPT_VECTOR_REG __MC68681_REG(12) /* IVR */
-
-#define MC68681_MODE_REG_1B __MC68681_REG(8) /* MR1B-MR Prior to Read */
-#define MC68681_MODE_REG_2B __MC68681_REG(8) /* MR2BA-MR After Read */
-
-/*
- * mc68681 register offsets Read Only Addresses
- */
-#define MC68681_STATUS_REG_A __MC68681_REG(1) /* SRA */
-#define MC68681_MASK_ISR_REG __MC68681_REG(2) /* MISR */
-#define MC68681_RECEIVE_BUFFER_A __MC68681_REG(3) /* RHRA */
-#define MC68681_INPUT_PORT_CHANGE_REG __MC68681_REG(4) /* IPCR */
-#define MC68681_INTERRUPT_STATUS_REG __MC68681_REG(5) /* ISR */
-#define MC68681_STATUS_REG_B __MC68681_REG(9) /* SRB */
-#define MC68681_RECEIVE_BUFFER_B __MC68681_REG(11) /* RHRB */
-#define MC68681_INPUT_PORT __MC68681_REG(13) /* IP */
-#define MC68681_START_COUNT_CMD __MC68681_REG(14) /* SCC */
-#define MC68681_STOP_COUNT_CMD __MC68681_REG(15) /* STC */
-
-/*
- * mc68681 register offsets Write Only Addresses
- */
-#define MC68681_CLOCK_SELECT_REG_A __MC68681_REG(1) /* CSRA */
-#define MC68681_COMMAND_REG_A __MC68681_REG(2) /* CRA */
-#define MC68681_TRANSMIT_BUFFER_A __MC68681_REG(3) /* THRA */
-#define MC68681_AUX_CTRL_REG __MC68681_REG(4) /* ACR */
-#define MC68681_INTERRUPT_MASK_REG __MC68681_REG(5) /* IMR */
-#define MC68681_CLOCK_SELECT_REG_B __MC68681_REG(9) /* CSRB */
-#define MC68681_COMMAND_REG_B __MC68681_REG(10) /* CRB */
-#define MC68681_TRANSMIT_BUFFER_B __MC68681_REG(11) /* THRB */
-#define MC68681_OUTPUT_PORT_CONFIG_REG __MC68681_REG(13) /* OPCR */
-#define MC68681_OUTPUT_PORT_SET_REG __MC68681_REG(14) /* SOPBC */
-#define MC68681_OUTPUT_PORT_RESET_BITS __MC68681_REG(15) /* COPBC */
-
-
-#ifndef MC6681_VOL
-#define MC6681_VOL( ptr ) ((volatile unsigned char *)(ptr))
-#endif
-
-#define MC68681_WRITE( _base, _reg, _data ) \
- *((volatile unsigned char *)_base+_reg) = (_data)
-
-#define MC68681_READ( _base, _reg ) \
- *(((volatile unsigned char *)_base+_reg))
-
-
-
-#define MC68681_CLEAR 0x00
-
-#define MC68681_PORT_A 0
-#define MC68681_PORT_B 1
-
-/*
- * DUART Command Register Definitions:
- *
- * MC68681_COMMAND_REG_A,MC68681_COMMAND_REG_B
- */
-#define MC68681_MODE_REG_ENABLE_RX 0x01
-#define MC68681_MODE_REG_DISABLE_RX 0x02
-#define MC68681_MODE_REG_ENABLE_TX 0x04
-#define MC68681_MODE_REG_DISABLE_TX 0x08
-#define MC68681_MODE_REG_RESET_MR_PTR 0x10
-#define MC68681_MODE_REG_RESET_RX 0x20
-#define MC68681_MODE_REG_RESET_TX 0x30
-#define MC68681_MODE_REG_RESET_ERROR 0x40
-#define MC68681_MODE_REG_RESET_BREAK 0x50
-#define MC68681_MODE_REG_START_BREAK 0x60
-#define MC68681_MODE_REG_STOP_BREAK 0x70
-#define MC68681_MODE_REG_SET_RX_BRG 0x80
-#define MC68681_MODE_REG_CLEAR_RX_BRG 0x90
-#define MC68681_MODE_REG_SET_TX_BRG 0xa0
-#define MC68681_MODE_REG_CLEAR_TX_BRG 0xb0
-#define MC68681_MODE_REG_SET_STANDBY 0xc0
-#define MC68681_MODE_REG_SET_ACTIVE 0xd0
-
-/*
- * Mode Register Definitions
- *
- * MC68681_MODE_REG_1A
- * MC68681_MODE_REG_1B
- */
-#define MC68681_5BIT_CHARS 0x00
-#define MC68681_6BIT_CHARS 0x01
-#define MC68681_7BIT_CHARS 0x02
-#define MC68681_8BIT_CHARS 0x03
-
-#define MC68681_ODD_PARITY 0x00
-#define MC68681_EVEN_PARITY 0x04
-
-#define MC68681_WITH_PARITY 0x00
-#define MC68681_FORCE_PARITY 0x08
-#define MC68681_NO_PARITY 0x10
-#define MC68681_MULTI_DROP 0x18
-
-#define MC68681_ERR_MODE_CHAR 0x00
-#define MC68681_ERR_MODE_BLOCK 0x20
-
-#define MC68681_RX_INTR_RX_READY 0x00
-#define MC68681_RX_INTR_FFULL 0x40
-
-#define MC68681_NO_RX_RTS_CTL 0x00
-#define MC68681_RX_RTS_CTRL 0x80
-
-
-/*
- * Mode Register Definitions
- *
- * MC68681_MODE_REG_2A
- * MC68681_MODE_REG_2B
- */
-#define MC68681_STOP_BIT_LENGTH__563 0x00
-#define MC68681_STOP_BIT_LENGTH__625 0x01
-#define MC68681_STOP_BIT_LENGTH__688 0x02
-#define MC68681_STOP_BIT_LENGTH__75 0x03
-#define MC68681_STOP_BIT_LENGTH__813 0x04
-#define MC68681_STOP_BIT_LENGTH__875 0x05
-#define MC68681_STOP_BIT_LENGTH__938 0x06
-#define MC68681_STOP_BIT_LENGTH_1 0x07
-#define MC68681_STOP_BIT_LENGTH_1_563 0x08
-#define MC68681_STOP_BIT_LENGTH_1_625 0x09
-#define MC68681_STOP_BIT_LENGTH_1_688 0x0a
-#define MC68681_STOP_BIT_LENGTH_1_75 0x0b
-#define MC68681_STOP_BIT_LENGTH_1_813 0x0c
-#define MC68681_STOP_BIT_LENGTH_1_875 0x0d
-#define MC68681_STOP_BIT_LENGTH_1_938 0x0e
-#define MC68681_STOP_BIT_LENGTH_2 0x0f
-
-#define MC68681_CTS_ENABLE_TX 0x10
-#define MC68681_TX_RTS_CTRL 0x20
-
-#define MC68681_CHANNEL_MODE_NORMAL 0x00
-#define MC68681_CHANNEL_MODE_ECHO 0x40
-#define MC68681_CHANNEL_MODE_LOCAL_LOOP 0x80
-#define MC68681_CHANNEL_MODE_REMOTE_LOOP 0xc0
-
-/*
- * Status Register Definitions
- *
- * MC68681_STATUS_REG_A, MC68681_STATUS_REG_B
- */
-#define MC68681_RX_READY 0x01
-#define MC68681_FFULL 0x02
-#define MC68681_TX_READY 0x04
-#define MC68681_TX_EMPTY 0x08
-#define MC68681_OVERRUN_ERROR 0x10
-#define MC68681_PARITY_ERROR 0x20
-#define MC68681_FRAMING_ERROR 0x40
-#define MC68681_RECEIVED_BREAK 0x80
-
-
-/*
- * Interupt Status Register Definitions.
- *
- * MC68681_INTERRUPT_STATUS_REG
- */
-
-
-/*
- * Interupt Mask Register Definitions
- *
- * MC68681_INTERRUPT_MASK_REG
- */
-#define MC68681_IR_TX_READY_A 0x01
-#define MC68681_IR_RX_READY_A 0x02
-#define MC68681_IR_BREAK_A 0x04
-#define MC68681_IR_COUNTER_READY 0x08
-#define MC68681_IR_TX_READY_B 0x10
-#define MC68681_IR_RX_READY_B 0x20
-#define MC68681_IR_BREAK_B 0x40
-#define MC68681_IR_INPUT_PORT_CHANGE 0x80
-
-/*
- * Status Register Definitions.
- *
- * MC68681_STATUS_REG_A,MC68681_STATUS_REG_B
- */
-#define MC68681_STATUS_RXRDY 0x01
-#define MC68681_STATUS_FFULL 0x02
-#define MC68681_STATUS_TXRDY 0x04
-#define MC68681_STATUS_TXEMT 0x08
-#define MC68681_STATUS_OVERRUN_ERROR 0x10
-#define MC68681_STATUS_PARITY_ERROR 0x20
-#define MC68681_STATUS_FRAMING_ERROR 0x40
-#define MC68681_STATUS_RECEIVED_BREAK 0x80
-
-/*
- * Definitions for the Interrupt Vector Register:
- *
- * MC68681_INTERRUPT_VECTOR_REG
- */
-#define MC68681_INTERRUPT_VECTOR_INIT 0x0f
-
-/*
- * Definitions for the Auxiliary Control Register
- *
- * MC68681_AUX_CTRL_REG
- */
-#define MC68681_AUX_BRG_SET1 0x00
-#define MC68681_AUX_BRG_SET2 0x80
-
-
-/*
- * The following Baud rates assume the X1 clock pin is driven with a
- * 3.6864 MHz signal. If a different frequency is used the DUART channel
- * is running at the follwoing baud rate:
- * ((Table Baud Rate)*frequency)/3.6864 MHz
- */
-
-/*
- * Definitions for the Clock Select Register:
- *
- * MC68681_CLOCK_SELECT_REG_A,MC68681_CLOCK_SELECT_REG_A
- *
- * Note: ACR[7] is the MSB of the Auxiliary Control register
- * X is the extend bit.
- * CRA - 0x08 Set Rx BRG Select Extend Bit (X=1)
- * CRA - 0x09 Clear Rx BRG Select Extend Bit (X=0)
- * CRB - 0x0a Set Tx BRG Select Extend Bit (X=1)
- * CRB - 0x0b Clear Tx BRG Select Extend Bit (x=1)
- */
-#define MC68681_BAUD_RATE_MASK_50 0x00 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_75 0x00 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_110 0x01
-#define MC68681_BAUD_RATE_MASK_134_5 0x02
-#define MC68681_BAUD_RATE_MASK_150 0x03 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_200 0x03 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_300 0x04 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_600 0x05 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_1050 0x07 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_1200 0x06 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_1800 0x0a /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_2400 0x08 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_3600 0x04 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_4800 0x09
-#define MC68681_BAUD_RATE_MASK_7200 0x0a /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_9600 0xbb
-
-#define MC68681_BAUD_RATE_MASK_14_4K 0x05 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_19_2K 0xcc /* ACR[7]=1,X=0 */
- /* ARC[7]=0,X=1 */
-#define MC68681_BAUD_RATE_MASK_28_8K 0x06 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_38_4K 0xcc /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_57_6K 0x07 /* ACR[7]=0,X=0 */
- /* ARC[7]=1,X=1 */
-#define MC68681_BAUD_RATE_MASK_115_5K 0x08
-#define MC68681_BAUD_RATE_MASK_TIMER 0xdd
-#define MC68681_BAUD_RATE_MASK_TIMER_16X 0xee
-#define MC68681_BAUD_RATE_MASK_TIMER_1X 0xff
-
-#endif
-
-
-
diff --git a/cpukit/libcsupport/include/ringbuf.h b/cpukit/libcsupport/include/ringbuf.h
deleted file mode 100644
index 8c80aaf9c8..0000000000
--- a/cpukit/libcsupport/include/ringbuf.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * ringbuf.h
- *
- * This file provides simple ring buffer functionality.
- *
- * $Id$
- */
-
-#ifndef __RINGBUF_H__
-#define __RINGBUF_H__
-
-#ifndef RINGBUF_QUEUE_LENGTH
-#define RINGBUF_QUEUE_LENGTH 128
-#endif
-
-typedef struct {
- char buffer[RINGBUF_QUEUE_LENGTH];
- volatile int head;
- volatile int tail;
-} Ring_buffer_t;
-
-#define Ring_buffer_Initialize( _buffer ) \
- do { \
- (_buffer)->head = (_buffer)->tail = 0; \
- } while ( 0 )
-
-#define Ring_buffer_Is_empty( _buffer ) \
- ( (_buffer)->head == (_buffer)->tail )
-
-#define Ring_buffer_Is_full( _buffer ) \
- ( (_buffer)->head == ((_buffer)->tail + 1) % RINGBUF_QUEUE_LENGTH )
-
-#define Ring_buffer_Add_character( _buffer, _ch ) \
- do { \
- rtems_unsigned32 isrlevel; \
- \
- rtems_interrupt_disable( isrlevel ); \
- (_buffer)->tail = ((_buffer)->tail+1) % RINGBUF_QUEUE_LENGTH; \
- (_buffer)->buffer[ (_buffer)->tail ] = (_ch); \
- rtems_interrupt_enable( isrlevel ); \
- } while ( 0 )
-
-#define Ring_buffer_Remove_character( _buffer, _ch ) \
- do { \
- rtems_unsigned32 isrlevel; \
- \
- rtems_interrupt_disable( isrlevel ); \
- (_buffer)->head = ((_buffer)->head+1) % RINGBUF_QUEUE_LENGTH; \
- (_ch) = (_buffer)->buffer[ (_buffer)->head ]; \
- rtems_interrupt_enable( isrlevel ); \
- } while ( 0 )
-
-#endif
diff --git a/cpukit/libcsupport/include/rtems/assoc.h b/cpukit/libcsupport/include/rtems/assoc.h
deleted file mode 100644
index 1982d654ac..0000000000
--- a/cpukit/libcsupport/include/rtems/assoc.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Rtems associativity routines. Mainly used to convert a value from
- * one space to another (eg: our errno's to host errno's and v.v)
- *
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_ASSOC_H
-#define _INCLUDE_ASSOC_H
-
-typedef struct {
- const char *name;
- unsigned32 local_value;
- unsigned32 remote_value;
-} rtems_assoc_t;
-
-/*
- * Flag/marker for optional default value in each table
- */
-
-#define RTEMS_ASSOC_DEFAULT_NAME "(default)"
-
-const rtems_assoc_t *rtems_assoc_ptr_by_name(const rtems_assoc_t *, const char *);
-const rtems_assoc_t *rtems_assoc_ptr_by_value(const rtems_assoc_t *, unsigned32);
-const rtems_assoc_t *rtems_assoc_ptr_by_remote(const rtems_assoc_t *, unsigned32);
-
-unsigned32 rtems_assoc_remote_by_local(const rtems_assoc_t *, unsigned32);
-unsigned32 rtems_assoc_local_by_remote(const rtems_assoc_t *, unsigned32);
-unsigned32 rtems_assoc_remote_by_name(const rtems_assoc_t *, const char *);
-unsigned32 rtems_assoc_local_by_name(const rtems_assoc_t *, const char *);
-const char *rtems_assoc_name_by_local(const rtems_assoc_t *, unsigned32);
-const char *rtems_assoc_name_by_remote(const rtems_assoc_t *, unsigned32);
-
-unsigned32 rtems_assoc_remote_by_local_bitfield(const rtems_assoc_t *, unsigned32);
-char *rtems_assoc_name_by_local_bitfield(const rtems_assoc_t *, unsigned32, char *);
-char *rtems_assoc_name_by_remote_bitfield(const rtems_assoc_t *, unsigned32, char *);
-unsigned32 rtems_assoc_local_by_remote_bitfield(const rtems_assoc_t *, unsigned32);
-
-
-#endif /* ! _INCLUDE_ASSOC_H */
diff --git a/cpukit/libcsupport/include/rtems/error.h b/cpukit/libcsupport/include/rtems/error.h
deleted file mode 100644
index a0698afb5d..0000000000
--- a/cpukit/libcsupport/include/rtems/error.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Defines and externs for rtems error reporting
- *
- * $Id$
- */
-
-#ifndef __RTEMS_ERROR_h
-#define __RTEMS_ERROR_h
-
-/*
- * rtems_error() and rtems_panic() support
- */
-
-#define RTEMS_ERROR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define RTEMS_ERROR_PANIC (RTEMS_ERROR_ERRNO / 2) /* err fatal; no return */
-#define RTEMS_ERROR_ABORT (RTEMS_ERROR_ERRNO / 4) /* err is fatal; panic */
-
-#define RTEMS_ERROR_MASK (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | \
- RTEMS_ERROR_PANIC) /* all */
-
-const char *rtems_status_text(rtems_status_code);
-int rtems_error(int error_code, const char *printf_format, ...);
-#ifdef __GNUC__
-void rtems_panic(const char *printf_format, ...);
-/*
- * We should be able to use this attribute but gcc complains that
- * rtems_panic does in fact return. :(
- *
- * __attribute__ ((__noreturn__));
- */
-#else
-void rtems_panic(const char *printf_format, ...);
-#endif
-
-extern int rtems_panic_in_progress;
-
-#endif
-/* end of include file */
diff --git a/cpukit/libcsupport/include/rtems/libcsupport.h b/cpukit/libcsupport/include/rtems/libcsupport.h
deleted file mode 100644
index d007784526..0000000000
--- a/cpukit/libcsupport/include/rtems/libcsupport.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* libcsupport.h
- *
- * This include file contains the information regarding the
- * RTEMS specific support for the standard C library.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __LIBC_SUPPORT_h
-#define __LIBC_SUPPORT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <sys/types.h>
-
-void RTEMS_Malloc_Initialize(
- void *start,
- size_t length,
- size_t sbrk_amount
-);
-
-extern void malloc_dump(void);
-extern void malloc_walk(size_t source, size_t printf_enabled);
-extern void libc_init(int reentrant);
-extern int host_errno(void);
-extern void fix_syscall_errno(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h
deleted file mode 100644
index dcdda85aec..0000000000
--- a/cpukit/libcsupport/include/rtems/libio.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * General purpose communication channel for RTEMS to allow UNIX/POSIX
- * system call behavior on top of RTEMS IO devices.
- *
- * TODO
- * stat(2)
- * unlink(2)
- * rename(2)
- *
- * $Id$
- */
-
-#ifndef _RTEMS_LIBIO_H
-#define _RTEMS_LIBIO_H
-
-#include <sys/stat.h>
-
-typedef unsigned32 rtems_libio_offset_t;
-
-/*
- * An open file data structure, indexed by 'fd'
- * TODO:
- * should really have a separate per/file data structure that this
- * points to (eg: size, offset, driver, pathname should be in that)
- */
-
-typedef struct {
- rtems_driver_name_t *driver;
- rtems_libio_offset_t size; /* size of file */
- rtems_libio_offset_t offset; /* current offset into the file */
- unsigned32 flags;
- char *pathname; /* opened pathname */
- Objects_Id sem;
- unsigned32 data0; /* private to "driver" */
- void *data1; /* ... */
-} rtems_libio_t;
-
-
-/*
- * param block for read/write
- * Note: it must include 'offset' instead of using iop's offset since
- * we can have multiple outstanding i/o's on a device.
- */
-
-typedef struct {
- rtems_libio_t *iop;
- rtems_libio_offset_t offset;
- unsigned8 *buffer;
- unsigned32 count;
- unsigned32 flags;
- unsigned32 bytes_moved;
-} rtems_libio_rw_args_t;
-
-/*
- * param block for open/close
- */
-
-typedef struct {
- rtems_libio_t *iop;
- unsigned32 flags;
- unsigned32 mode;
-} rtems_libio_open_close_args_t;
-
-/*
- * param block for ioctl
- */
-
-typedef struct {
- rtems_libio_t *iop;
- unsigned32 command;
- void *buffer;
- unsigned32 ioctl_return;
-} rtems_libio_ioctl_args_t;
-
-
-/*
- * Values for 'flag'
- */
-
-#define LIBIO_FLAGS_NO_DELAY 0x0001 /* return immediately if no data */
-#define LIBIO_FLAGS_READ 0x0002 /* reading */
-#define LIBIO_FLAGS_WRITE 0x0004 /* writing */
-#define LIBIO_FLAGS_LINE_BUFFERED 0x0008 /* line buffered io (^h, ^u, etc) */
-#define LIBIO_FLAGS_OPEN 0x0100 /* device is open */
-#define LIBIO_FLAGS_APPEND 0x0200 /* all writes append */
-#define LIBIO_FLAGS_CREATE 0x0400 /* create file */
-
-#define LIBIO_FLAGS_READ_WRITE (LIBIO_FLAGS_READ | LIBIO_FLAGS_WRITE)
-
-void rtems_libio_init(void);
-
-int __rtems_open(const char *pathname, unsigned32 flag, unsigned32 mode);
-int __rtems_close(int fd);
-int __rtems_read(int fd, void *buffer, unsigned32 count);
-int __rtems_write(int fd, const void *buffer, unsigned32 count);
-int __rtems_ioctl(int fd, unsigned32 command, void *buffer);
-int __rtems_lseek(int fd, rtems_libio_offset_t offset, int whence);
-int __rtems_fstat(int _fd, struct stat* _sbuf);
-
-/*
- * External I/O handlers
- */
-typedef struct {
- int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode);
- int (*close)(int fd);
- int (*read)(int fd, void *buffer, unsigned32 count);
- int (*write)(int fd, const void *buffer, unsigned32 count);
- int (*ioctl)(int fd, unsigned32 command, void *buffer);
- int (*lseek)(int fd, rtems_libio_offset_t offset, int whence);
-} rtems_libio_handler_t;
-
-void rtems_register_libio_handler(int handler_flag,
- const rtems_libio_handler_t *handler);
-
-#define RTEMS_FILE_DESCRIPTOR_TYPE_FILE 0x0000
-#define RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET 0x1000
-#define rtems_make_file_descriptor(fd,flags) ((fd)|(flags))
-#define rtems_file_descriptor_base(fd) ((fd) & 0x0FFF)
-#define rtems_file_descriptor_type(fd) ((fd) & 0xF000)
-#define rtems_file_descriptor_type_index(fd) ((((fd) & 0xF000) >> 12) - 1)
-
-/*
- * IOCTL values
- */
-
-#define RTEMS_IO_GET_ATTRIBUTES 1
-#define RTEMS_IO_SET_ATTRIBUTES 2
-#define RTEMS_IO_TCDRAIN 3
-
-/*
- * Callbacks from TERMIOS routines to device-dependent code
- */
-#include <termios.h>
-typedef struct rtems_termios_callbacks {
- int (*firstOpen)(int major, int minor, void *arg);
- int (*lastClose)(int major, int minor, void *arg);
- int (*pollRead)(int minor);
- int (*write)(int minor, const char *buf, int len);
- int (*setAttributes)(int minor, const struct termios *t);
- int (*stopRemoteTx)(int minor);
- int (*startRemoteTx)(int minor);
- int outputUsesInterrupts;
-} rtems_termios_callbacks;
-
-/*
- * Device-independent TERMIOS routines
- */
-void rtems_termios_initialize (void);
-rtems_status_code rtems_termios_open (
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg,
- const rtems_termios_callbacks *callbacks
- );
-rtems_status_code rtems_termios_close (void *arg);
-rtems_status_code rtems_termios_read (void *arg);
-rtems_status_code rtems_termios_write (void *arg);
-rtems_status_code rtems_termios_ioctl (void *arg);
-int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len);
-int rtems_termios_dequeue_characters (void *ttyp, int len);
-void rtems_termios_reserve_resources(
- rtems_configuration_table *configuration,
- rtems_unsigned32 number_of_devices
-);
-
-#endif /* _RTEMS_LIBIO_H */
diff --git a/cpukit/libcsupport/include/spurious.h b/cpukit/libcsupport/include/spurious.h
deleted file mode 100644
index 36fcaba904..0000000000
--- a/cpukit/libcsupport/include/spurious.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* spurious.h
- *
- * This file describes the Spurious Interrupt Driver for all boards.
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution 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 __SPURIOUS_h
-#define __SPURIOUS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define SPURIOUS_DRIVER_TABLE_ENTRY \
- { Spurious_Initialize, NULL, NULL, NULL, NULL, NULL }
-
-rtems_device_driver Spurious_Initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *,
- rtems_id,
- rtems_unsigned32 *
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/libcsupport/include/sys/filio.h b/cpukit/libcsupport/include/sys/filio.h
deleted file mode 100644
index b82a649c0f..0000000000
--- a/cpukit/libcsupport/include/sys/filio.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)filio.h 8.1 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_FILIO_H_
-#define _SYS_FILIO_H_
-
-#include <sys/ioccom.h>
-
-/* Generic file-descriptor ioctl's. */
-#define FIOCLEX _IO('f', 1) /* set close on exec on fd */
-#define FIONCLEX _IO('f', 2) /* remove close on exec */
-#define FIONREAD _IOR('f', 127, int) /* get # bytes to read */
-#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */
-#define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */
-#define FIOSETOWN _IOW('f', 124, int) /* set owner */
-#define FIOGETOWN _IOR('f', 123, int) /* get owner */
-
-#endif /* !_SYS_FILIO_H_ */
diff --git a/cpukit/libcsupport/include/sys/ioctl.h b/cpukit/libcsupport/include/sys/ioctl.h
deleted file mode 100644
index e3a69a5a7f..0000000000
--- a/cpukit/libcsupport/include/sys/ioctl.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)ioctl.h 8.6 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_IOCTL_H_
-#define _SYS_IOCTL_H_
-
-#include <sys/ttycom.h>
-
-/*
- * Pun for SunOS prior to 3.2. SunOS 3.2 and later support TIOCGWINSZ
- * and TIOCSWINSZ (yes, even 3.2-3.5, the fact that it wasn't documented
- * notwithstanding).
- */
-struct ttysize {
- unsigned short ts_lines;
- unsigned short ts_cols;
- unsigned short ts_xxx;
- unsigned short ts_yyy;
-};
-#define TIOCGSIZE TIOCGWINSZ
-#define TIOCSSIZE TIOCSWINSZ
-
-#include <sys/ioccom.h>
-
-#include <sys/filio.h>
-#include <sys/sockio.h>
-
-#endif /* !_SYS_IOCTL_H_ */
-
-/*
- * Keep outside _SYS_IOCTL_H_
- * Compatibility with old terminal driver
- *
- * Source level -> #define USE_OLD_TTY
- * Kernel level -> options COMPAT_43 or COMPAT_SUNOS
- */
-#if defined(USE_OLD_TTY) || defined(COMPAT_43) || defined(COMPAT_SUNOS)
-#include <sys/ioctl_compat.h>
-#endif
diff --git a/cpukit/libcsupport/include/sys/sockio.h b/cpukit/libcsupport/include/sys/sockio.h
deleted file mode 100644
index 020061170f..0000000000
--- a/cpukit/libcsupport/include/sys/sockio.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * 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.
- *
- * @(#)sockio.h 8.1 (Berkeley) 3/28/94
- * $Id$
- */
-
-#ifndef _SYS_SOCKIO_H_
-#define _SYS_SOCKIO_H_
-
-#include <sys/ioccom.h>
-
-/* Socket ioctl's. */
-#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */
-#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */
-#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */
-#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */
-#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */
-#define SIOCSPGRP _IOW('s', 8, int) /* set process group */
-#define SIOCGPGRP _IOR('s', 9, int) /* get process group */
-
-#define SIOCADDRT _IOW('r', 10, struct ortentry) /* add route */
-#define SIOCDELRT _IOW('r', 11, struct ortentry) /* delete route */
-#define SIOCGETVIFCNT _IOWR('r', 15, struct sioc_vif_req)/* get vif pkt cnt */
-#define SIOCGETSGCNT _IOWR('r', 16, struct sioc_sg_req) /* get s,g pkt cnt */
-
-#define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */
-#define OSIOCGIFADDR _IOWR('i', 13, struct ifreq) /* get ifnet address */
-#define SIOCGIFADDR _IOWR('i', 33, struct ifreq) /* get ifnet address */
-#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */
-#define OSIOCGIFDSTADDR _IOWR('i', 15, struct ifreq) /* get p-p address */
-#define SIOCGIFDSTADDR _IOWR('i', 34, struct ifreq) /* get p-p address */
-#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */
-#define SIOCGIFFLAGS _IOWR('i', 17, struct ifreq) /* get ifnet flags */
-#define OSIOCGIFBRDADDR _IOWR('i', 18, struct ifreq) /* get broadcast addr */
-#define SIOCGIFBRDADDR _IOWR('i', 35, struct ifreq) /* get broadcast addr */
-#define SIOCSIFBRDADDR _IOW('i', 19, struct ifreq) /* set broadcast addr */
-#define OSIOCGIFCONF _IOWR('i', 20, struct ifconf) /* get ifnet list */
-#define SIOCGIFCONF _IOWR('i', 36, struct ifconf) /* get ifnet list */
-#define OSIOCGIFNETMASK _IOWR('i', 21, struct ifreq) /* get net addr mask */
-#define SIOCGIFNETMASK _IOWR('i', 37, struct ifreq) /* get net addr mask */
-#define SIOCSIFNETMASK _IOW('i', 22, struct ifreq) /* set net addr mask */
-#define SIOCGIFMETRIC _IOWR('i', 23, struct ifreq) /* get IF metric */
-#define SIOCSIFMETRIC _IOW('i', 24, struct ifreq) /* set IF metric */
-#define SIOCDIFADDR _IOW('i', 25, struct ifreq) /* delete IF addr */
-#define SIOCAIFADDR _IOW('i', 26, struct ifaliasreq)/* add/chg IF alias */
-
-#define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */
-#define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */
-#define SIOCGIFMTU _IOWR('i', 51, struct ifreq) /* get IF mtu */
-#define SIOCSIFMTU _IOW('i', 52, struct ifreq) /* set IF mtu */
-#define SIOCGIFPHYS _IOWR('i', 53, struct ifreq) /* get IF wire */
-#define SIOCSIFPHYS _IOW('i', 54, struct ifreq) /* set IF wire */
-#define SIOCSIFMEDIA _IOWR('i', 55, struct ifreq) /* set net media */
-#define SIOCGIFMEDIA _IOWR('i', 56, struct ifmediareq) /* get net media */
-
-#endif /* !_SYS_SOCKIO_H_ */
diff --git a/cpukit/libcsupport/include/sys/termios.h b/cpukit/libcsupport/include/sys/termios.h
deleted file mode 100644
index 71a2492724..0000000000
--- a/cpukit/libcsupport/include/sys/termios.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * POSIX termios implementation for RTEMS console device driver.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 TERMIOS_H
-#define TERMIOS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef unsigned char cc_t;
-typedef unsigned int speed_t;
-typedef unsigned int tcflag_t;
-
-#define NCCS 19
-struct termios {
- tcflag_t c_iflag; /* input mode flags */
- tcflag_t c_oflag; /* output mode flags */
- tcflag_t c_cflag; /* control mode flags */
- tcflag_t c_lflag; /* local mode flags */
- cc_t c_line; /* line discipline */
- cc_t c_cc[NCCS]; /* control characters */
-};
-
-/* c_cc characters */
-#define VINTR 0
-#define VQUIT 1
-#define VERASE 2
-#define VKILL 3
-#define VEOF 4
-#define VTIME 5
-#define VMIN 6
-#define VSWTC 7
-#define VSTART 8
-#define VSTOP 9
-#define VSUSP 10
-#define VEOL 11
-#define VREPRINT 12
-#define VDISCARD 13
-#define VWERASE 14
-#define VLNEXT 15
-#define VEOL2 16
-
-/* c_iflag bits */
-#define IGNBRK 0000001
-#define BRKINT 0000002
-#define IGNPAR 0000004
-#define PARMRK 0000010
-#define INPCK 0000020
-#define ISTRIP 0000040
-#define INLCR 0000100
-#define IGNCR 0000200
-#define ICRNL 0000400
-#define IUCLC 0001000
-#define IXON 0002000
-#define IXANY 0004000
-#define IXOFF 0010000
-#define IMAXBEL 0020000
-
-/* c_oflag bits */
-#define OPOST 0000001
-#define OLCUC 0000002
-#define ONLCR 0000004
-#define OCRNL 0000010
-#define ONOCR 0000020
-#define ONLRET 0000040
-#define OFILL 0000100
-#define OFDEL 0000200
-#define NLDLY 0000400
-#define NL0 0000000
-#define NL1 0000400
-#define CRDLY 0003000
-#define CR0 0000000
-#define CR1 0001000
-#define CR2 0002000
-#define CR3 0003000
-#define TABDLY 0014000
-#define TAB0 0000000
-#define TAB1 0004000
-#define TAB2 0010000
-#define TAB3 0014000
-#define XTABS 0014000
-#define BSDLY 0020000
-#define BS0 0000000
-#define BS1 0020000
-#define VTDLY 0040000
-#define VT0 0000000
-#define VT1 0040000
-#define FFDLY 0100000
-#define FF0 0000000
-#define FF1 0100000
-
-/* c_cflag bit meaning */
-#define CBAUD 0010017
-#define B0 0000000 /* hang up */
-#define B50 0000001
-#define B75 0000002
-#define B110 0000003
-#define B134 0000004
-#define B150 0000005
-#define B200 0000006
-#define B300 0000007
-#define B600 0000010
-#define B1200 0000011
-#define B1800 0000012
-#define B2400 0000013
-#define B4800 0000014
-#define B9600 0000015
-#define B19200 0000016
-#define B38400 0000017
-#define EXTA B19200
-#define EXTB B38400
-#define CSIZE 0000060
-#define CS5 0000000
-#define CS6 0000020
-#define CS7 0000040
-#define CS8 0000060
-#define CSTOPB 0000100
-#define CREAD 0000200
-#define PARENB 0000400
-#define PARODD 0001000
-#define HUPCL 0002000
-#define CLOCAL 0004000
-#define CBAUDEX 0010000
-#define B57600 0010001
-#define B115200 0010002
-#define B230400 0010003
-#define B460800 0010004
-#define CIBAUD 002003600000 /* input baud rate (not used) */
-#define CRTSCTS 020000000000 /* flow control */
-
-#define RTEMS_TERMIOS_NUMBER_BAUD_RATES 20
-
-/* c_lflag bits */
-#define ISIG 0000001
-#define ICANON 0000002
-#define XCASE 0000004
-#define ECHO 0000010
-#define ECHOE 0000020
-#define ECHOK 0000040
-#define ECHONL 0000100
-#define NOFLSH 0000200
-#define TOSTOP 0000400
-#define ECHOCTL 0001000
-#define ECHOPRT 0002000
-#define ECHOKE 0004000
-#define FLUSHO 0010000
-#define PENDIN 0040000
-#define IEXTEN 0100000
-
-/* tcflow() and TCXONC use these */
-#define TCOOFF 0
-#define TCOON 1
-#define TCIOFF 2
-#define TCION 3
-
-/* tcflush() and TCFLSH use these */
-#define TCIFLUSH 0
-#define TCOFLUSH 1
-#define TCIOFLUSH 2
-
-/* tcsetattr uses these */
-#define TCSANOW 0
-#define TCSADRAIN 1
-#define TCSAFLUSH 2
-
-int tcgetattr(int, struct termios *);
-int tcsetattr(int, int, struct termios *);
-int tcdrain(int);
-speed_t cfgetospeed(const struct termios *tp);
-int cfsetospeed(struct termios *tp, speed_t speed);
-speed_t cfgetispeed(const struct termios *tp);
-int cfsetispeed(struct termios *tp, speed_t speed);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* TERMIOS_H */
diff --git a/cpukit/libcsupport/include/sys/utsname.h b/cpukit/libcsupport/include/sys/utsname.h
deleted file mode 100644
index ca15230d40..0000000000
--- a/cpukit/libcsupport/include/sys/utsname.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* sys/utsname.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_SYS_UTSNAME_h
-#define __POSIX_SYS_UTSNAME_h
-
-#include <sys/times.h>
-#include <sys/types.h>
-
-/*
- * 4.4.1 Get System Name (Table 4-1), P1003.1b-1993, p. 90
- *
- * NOTE: The lengths of the strings in this structure are
- * just long enough to reliably contain the RTEMS information.
- * For example, the fields are not long enough to support
- * Internet hostnames.
- */
-
-struct utsname {
- char sysname[ 32 ]; /* Name of this implementation of the operating system */
- char nodename[ 32 ]; /* Name of this node within an implementation */
- /* specified communication network */
- char release[ 32 ]; /* Current release level of this implementation */
- char version[ 32 ]; /* Current version level of this release */
- char machine[ 32 ]; /* Name of the hardware type on which the system */
- /* is running */
-};
-
-/*
- * 4.4.1 Get System Name, P1003.1b-1993, p. 90
- */
-
-int uname(
- struct utsname *name
-);
-
-/*
- * 4.5.2 Get Process Times, P1003.1b-1993, p. 92
- */
-
-clock_t times(
- struct tms *buffer
-);
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/libcsupport/include/timerdrv.h b/cpukit/libcsupport/include/timerdrv.h
deleted file mode 100644
index ed1ce2b9a2..0000000000
--- a/cpukit/libcsupport/include/timerdrv.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* timerdrv.h
- *
- * This file describes the Timer Driver for all boards.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIMER_DRIVER_h
-#define __TIMER_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* functions */
-
-void Timer_initialize( void );
-
-rtems_unsigned32 Read_timer( void );
-
-rtems_status_code Empty_function( void );
-
-void Set_find_average_overhead(
- rtems_boolean find_flag
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/libcsupport/include/vmeintr.h b/cpukit/libcsupport/include/vmeintr.h
deleted file mode 100644
index 6593ba12a5..0000000000
--- a/cpukit/libcsupport/include/vmeintr.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * vmeintr.h
- *
- * This file is the specification for the VMEbus interface library
- * which should be provided by all BSPs for VMEbus Single Board
- * Computers but currently only a few do so.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __VME_INTERRUPT_h
-#define __VME_INTERRUPT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This defines the mask which is used to determine which
- * interrupt levels are affected by a call to this package.
- * The LSB corresponds to VME interrupt 0 and the MSB
- * to VME interrupt 7.
- *
- */
-
-typedef rtems_unsigned8 VME_interrupt_Mask;
-
-/*
- * VME_interrupt_Disable
- *
- */
-
-void VME_interrupt_Disable (
- VME_interrupt_Mask mask /* IN */
-);
-
-/*
- * VME_interrupt_Disable
- *
- */
-
-void VME_interrupt_Enable (
- VME_interrupt_Mask mask /* IN */
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* end of include file */
diff --git a/cpukit/libcsupport/include/zilog/z8036.h b/cpukit/libcsupport/include/zilog/z8036.h
deleted file mode 100644
index 1c53c8afac..0000000000
--- a/cpukit/libcsupport/include/zilog/z8036.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* z8036.h
- *
- * This include file defines information related to a Zilog Z8036
- * Counter/Timer/IO Chip. It is a memory mapped part.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: This file shares as much as possible with the include
- * file for the Z8536 via z8x36.h.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __Z8036_h
-#define __Z8036_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* macros */
-
-#define Z8036( ptr ) ((volatile struct z8036_map *)(ptr))
-
-#define Z8x36_STATE0 ( z8036 ) \
- { /*char *garbage = *(Z8036(z8036))->???; */ }
-
-
-#define Z8x36_WRITE( z8036, reg, data ) \
- (Z8036(z8036))->reg = (data)
-
-
-#define Z8x36_READ( z8036, reg, data ) \
- (Z8036(z8036))->reg = (data)
-
-/* structures */
-
-struct z8036_map {
-/* MAIN CONTROL REGISTERS (0x00-0x07) */
- rtems_unsigned8 MASTER_INTR; /* Master Interrupt Ctl Reg */
- rtems_unsigned8 MASTER_CFG; /* Master Configuration Ctl Reg */
- rtems_unsigned8 PORTA_VECTOR; /* Port A - Interrupt Vector */
- rtems_unsigned8 PORTB_VECTOR; /* Port B - Interrupt Vector */
- rtems_unsigned8 CNT_TMR_VECTOR; /* Counter/Timer Interrupt Vector */
- rtems_unsigned8 PORTC_DATA_POLARITY; /* Port C - Data Path Polarity */
- rtems_unsigned8 PORTC_DIRECTION; /* Port C - Data Direction */
- rtems_unsigned8 PORTC_SPECIAL_IO_CTL; /* Port C - Special IO Control */
-/* MOST OFTEN ACCESSED REGISTERS (0x08 - 0x0f) */
- rtems_unsigned8 PORTA_CMD_STATUS; /* Port A - Command Status Reg */
- rtems_unsigned8 PORTB_CMD_STATUS; /* Port B - Command Status Reg */
- rtems_unsigned8 CT1_CMD_STATUS; /* Ctr/Timer 1 - Command Status Reg */
- rtems_unsigned8 CT2_CMD_STATUS; /* Ctr/Timer 2 - Command Status Reg */
- rtems_unsigned8 CT3_CMD_STATUS; /* Ctr/Timer 3 - Command Status Reg */
- rtems_unsigned8 PORTA_DATA; /* Port A - Data */
- rtems_unsigned8 PORTB_DATA; /* Port B - Data */
- rtems_unsigned8 PORTC_DATA; /* Port C - Data */
-/* COUNTER/TIMER RELATED REGISTERS (0x10-0x1f) */
- rtems_unsigned8 CT1_CUR_CNT_MSB; /* Ctr/Timer 1 - Current Count (MSB) */
- rtems_unsigned8 CT1_CUR_CNT_LSB; /* Ctr/Timer 1 - Current Count (LSB) */
- rtems_unsigned8 CT2_CUR_CNT_MSB; /* Ctr/Timer 2 - Current Count (MSB) */
- rtems_unsigned8 CT2_CUR_CNT_LSB; /* Ctr/Timer 2 - Current Count (LSB) */
- rtems_unsigned8 CT3_CUR_CNT_MSB; /* Ctr/Timer 3 - Current Count (MSB) */
- rtems_unsigned8 CT3_CUR_CNT_LSB; /* Ctr/Timer 3 - Current Count (LSB) */
- rtems_unsigned8 CT1_TIME_CONST_MSB; /* Ctr/Timer 1 - Time Constant (MSB) */
- rtems_unsigned8 CT1_TIME_CONST_LSB; /* Ctr/Timer 1 - Time Constant (LSB) */
- rtems_unsigned8 CT2_TIME_CONST_MSB; /* Ctr/Timer 2 - Time Constant (MSB) */
- rtems_unsigned8 CT2_TIME_CONST_LSB; /* Ctr/Timer 2 - Time Constant (LSB) */
- rtems_unsigned8 CT3_TIME_CONST_MSB; /* Ctr/Timer 3 - Time Constant (MSB) */
- rtems_unsigned8 CT3_TIME_CONST_LSB; /* Ctr/Timer 3 - Time Constant (LSB) */
- rtems_unsigned8 CT1_MODE_SPEC; /* Ctr/Timer 1 - Mode Specification */
- rtems_unsigned8 CT2_MODE_SPEC; /* Ctr/Timer 2 - Mode Specification */
- rtems_unsigned8 CT3_MODE_SPEC; /* Ctr/Timer 3 - Mode Specification */
- rtems_unsigned8 CURRENT_VECTOR; /* Current Vector */
-/* PORT A SPECIFICATION REGISTERS (0x20 -0x27) */
- rtems_unsigned8 PORTA_MODE; /* Port A - Mode Specification */
- rtems_unsigned8 PORTA_HANDSHAKE; /* Port A - Handshake Specification */
- rtems_unsigned8 PORTA_DATA_POLARITY; /* Port A - Data Path Polarity */
- rtems_unsigned8 PORTA_DIRECTION; /* Port A - Data Direction */
- rtems_unsigned8 PORTA_SPECIAL_IO_CTL; /* Port A - Special IO Control */
- rtems_unsigned8 PORTA_PATT_POLARITY; /* Port A - Pattern Polarity */
- rtems_unsigned8 PORTA_PATT_TRANS; /* Port A - Pattern Transition */
- rtems_unsigned8 PORTA_PATT_MASK; /* Port A - Pattern Mask */
-/* PORT B SPECIFICATION REGISTERS (0x28-0x2f) */
- rtems_unsigned8 PORTB_MODE; /* Port B - Mode Specification */
- rtems_unsigned8 PORTB_HANDSHAKE; /* Port B - Handshake Specification */
- rtems_unsigned8 PORTB_DATA_POLARITY; /* Port B - Data Path Polarity */
- rtems_unsigned8 PORTB_DIRECTION; /* Port B - Data Direction */
- rtems_unsigned8 PORTB_SPECIAL_IO_CTL; /* Port B - Special IO Control */
- rtems_unsigned8 PORTB_PATT_POLARITY; /* Port B - Pattern Polarity */
- rtems_unsigned8 PORTB_PATT_TRANS; /* Port B - Pattern Transition */
- rtems_unsigned8 PORTB_PATT_MASK; /* Port B - Pattern Mask */
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/cpukit/libcsupport/include/zilog/z8530.h b/cpukit/libcsupport/include/zilog/z8530.h
deleted file mode 100644
index 60a3e3b771..0000000000
--- a/cpukit/libcsupport/include/zilog/z8530.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* z8530.h
- *
- * This include file defines information related to a Zilog Z8530
- * SCC Chip. It is a IO mapped part.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __Z8530_h
-#define __Z8530_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* macros */
-
-#define VOL8( ptr ) ((volatile rtems_unsigned8 *)(ptr))
-
-#define Z8x30_STATE0 ( z8530 ) \
- { char *garbage; \
- (garbage) = *(VOL8(z8530)) \
- }
-
-#define Z8x30_WRITE_CONTROL( z8530, reg, data ) \
- *(VOL8(z8530)) = (reg); \
- *(VOL8(z8530)) = (data)
-
-#define Z8x30_READ_CONTROL( z8530, reg, data ) \
- *(VOL8(z8530)) = (reg); \
- (data) = *(VOL8(z8530))
-
-#define Z8x30_WRITE_DATA( z8530, data ) \
- *(VOL8(z8530)) = (data);
-
-#define Z8x30_READ_DATA( z8530, data ) \
- (data) = *(VOL8(z8530));
-
-
-/* RR_0 Bit Definitions */
-
-#define RR_0_TX_BUFFER_EMPTY 0x04
-#define RR_0_RX_DATA_AVAILABLE 0x01
-
-/* read registers */
-
-#define RR_0 0x00
-#define RR_1 0x01
-#define RR_2 0x02
-#define RR_3 0x03
-#define RR_4 0x04
-#define RR_5 0x05
-#define RR_6 0x06
-#define RR_7 0x07
-#define RR_8 0x08
-#define RR_9 0x09
-#define RR_10 0x0A
-#define RR_11 0x0B
-#define RR_12 0x0C
-#define RR_13 0x0D
-#define RR_14 0x0E
-#define RR_15 0x0F
-
-/* write registers */
-
-#define WR_0 0x00
-#define WR_1 0x01
-#define WR_2 0x02
-#define WR_3 0x03
-#define WR_4 0x04
-#define WR_5 0x05
-#define WR_6 0x06
-#define WR_7 0x07
-#define WR_8 0x08
-#define WR_9 0x09
-#define WR_10 0x0A
-#define WR_11 0x0B
-#define WR_12 0x0C
-#define WR_13 0x0D
-#define WR_14 0x0E
-#define WR_15 0x0F
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/cpukit/libcsupport/include/zilog/z8536.h b/cpukit/libcsupport/include/zilog/z8536.h
deleted file mode 100644
index 0f0b5641e7..0000000000
--- a/cpukit/libcsupport/include/zilog/z8536.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* z8536.h
- *
- * This include file defines information related to a Zilog Z8536
- * Counter/Timer/IO Chip. It is a IO mapped part.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * NOTE: This file shares as much as possible with the include
- * file for the Z8036 via z8x36.h.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __Z8536_h
-#define __Z8536_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* macros */
-
-#define VOL8( ptr ) ((volatile rtems_unsigned8 *)(ptr))
-
-#define Z8x36_STATE0 ( z8536 ) \
- { char *garbage; \
- (garbage) = *(VOL8(z8536+0xC)) \
- }
-
-#define Z8x36_WRITE( z8536, reg, data ) \
- *(VOL8(z8536+0xC)) = (reg); \
- *(VOL8(z8536+0xC)) = (data)
-
-#define Z8x36_READ( z8536, reg, data ) \
- *(VOL8(z8536+0xC)) = (reg); \
- (data) = *(VOL8(z8536+0xC))
-
-/* structures */
-
-/* MAIN CONTROL REGISTERS (0x00-0x07) */
-#define MASTER_INTR 0x00 /* Master Interrupt Ctl Reg */
-#define MASTER_CFG 0x01 /* Master Configuration Ctl Reg */
-#define PORTA_VECTOR 0x02 /* Port A - Interrupt Vector */
-#define PORTB_VECTOR 0x03 /* Port B - Interrupt Vector */
-#define CNT_TMR_VECTOR 0x04 /* Counter/Timer Interrupt Vector */
-#define PORTC_DATA_POLARITY 0x05 /* Port C - Data Path Polarity */
-#define PORTC_DIRECTION 0x06 /* Port C - Data Direction */
-#define PORTC_SPECIAL_IO_CTL 0x07 /* Port C - Special IO Control */
-
-/* MOST OFTEN ACCESSED REGISTERS (0x08 - 0x0f) */
-#define PORTA_CMD_STATUS 0x08 /* Port A - Command Status Reg */
-#define PORTB_CMD_STATUS 0x09 /* Port B - Command Status Reg */
-#define CT1_CMD_STATUS 0x0a /* Ctr/Timer 1 - Command Status Reg */
-#define CT2_CMD_STATUS 0x0b /* Ctr/Timer 2 - Command Status Reg */
-#define CT3_CMD_STATUS 0x0c /* Ctr/Timer 3 - Command Status Reg */
-#define PORTA_DATA 0x0d /* Port A - Data */
-#define PORTB_DATA 0x0e /* Port B - Data */
-#define PORTC_DATA 0x0f /* Port C - Data */
-
-/* COUNTER/TIMER RELATED REGISTERS (0x10-0x1f) */
-#define CT1_CUR_CNT_MSB 0x10 /* Ctr/Timer 1 - Current Count (MSB) */
-#define CT1_CUR_CNT_LSB 0x11 /* Ctr/Timer 1 - Current Count (LSB) */
-#define CT2_CUR_CNT_MSB 0x12 /* Ctr/Timer 2 - Current Count (MSB) */
-#define CT2_CUR_CNT_LSB 0x13 /* Ctr/Timer 2 - Current Count (LSB) */
-#define CT3_CUR_CNT_MSB 0x14 /* Ctr/Timer 3 - Current Count (MSB) */
-#define CT3_CUR_CNT_LSB 0x15 /* Ctr/Timer 3 - Current Count (LSB) */
-#define CT1_TIME_CONST_MSB 0x16 /* Ctr/Timer 1 - Time Constant (MSB) */
-#define CT1_TIME_CONST_LSB 0x17 /* Ctr/Timer 1 - Time Constant (LSB) */
-#define CT2_TIME_CONST_MSB 0x18 /* Ctr/Timer 2 - Time Constant (MSB) */
-#define CT2_TIME_CONST_LSB 0x19 /* Ctr/Timer 2 - Time Constant (LSB) */
-#define CT3_TIME_CONST_MSB 0x1a /* Ctr/Timer 3 - Time Constant (MSB) */
-#define CT3_TIME_CONST_LSB 0x1b /* Ctr/Timer 3 - Time Constant (LSB) */
-#define CT1_MODE_SPEC 0x1c /* Ctr/Timer 1 - Mode Specification */
-#define CT2_MODE_SPEC 0x1d /* Ctr/Timer 2 - Mode Specification */
-#define CT3_MODE_SPEC 0x1e /* Ctr/Timer 3 - Mode Specification */
-#define CURRENT_VECTOR 0x1f /* Current Vector */
-
-/* PORT A SPECIFICATION REGISTERS (0x20 -0x27) */
-#define PORTA_MODE 0x20 /* Port A - Mode Specification */
-#define PORTA_HANDSHAKE 0x21 /* Port A - Handshake Specification */
-#define PORTA_DATA_POLARITY 0x22 /* Port A - Data Path Polarity */
-#define PORTA_DIRECTION 0x23 /* Port A - Data Direction */
-#define PORTA_SPECIAL_IO_CTL 0x24 /* Port A - Special IO Control */
-#define PORTA_PATT_POLARITY 0x25 /* Port A - Pattern Polarity */
-#define PORTA_PATT_TRANS 0x26 /* Port A - Pattern Transition */
-#define PORTA_PATT_MASK 0x27 /* Port A - Pattern Mask */
-
-/* PORT B SPECIFICATION REGISTERS (0x28-0x2f) */
-#define PORTB_MODE 0x28 /* Port B - Mode Specification */
-#define PORTB_HANDSHAKE 0x29 /* Port B - Handshake Specification */
-#define PORTB_DATA_POLARITY 0x2a /* Port B - Data Path Polarity */
-#define PORTB_DIRECTION 0x2b /* Port B - Data Direction */
-#define PORTB_SPECIAL_IO_CTL 0x2c /* Port B - Special IO Control */
-#define PORTB_PATT_POLARITY 0x2d /* Port B - Pattern Polarity */
-#define PORTB_PATT_TRANS 0x2e /* Port B - Pattern Transition */
-#define PORTB_PATT_MASK 0x2f /* Port B - Pattern Mask */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/cpukit/libcsupport/src/README b/cpukit/libcsupport/src/README
deleted file mode 100644
index ee7a90501e..0000000000
--- a/cpukit/libcsupport/src/README
+++ /dev/null
@@ -1,37 +0,0 @@
---
--- $Id$
---
-
-Overview of newlib support (newlib is from CYGNUS)
- Each task can have its own libc state including:
- open stdio files
- strtok
- multi precision arithmetic state
- etc.
-
- This is implemented by a reentrancy data structure for each task.
-
- When a task is "started" (in RTEMS sense) the reentrancy structure
- is allocated. Its address is stored in notepad[NOTEPAD_LAST].
-
- When task is switched to, the value of global variable _impure_ptr
- is changed to the value of the new tasks reentrancy structure.
-
- When a task is deleted
- atexit() processing (for that task) happens
- task's stdio buffers are flushed
-
- When exit(3) is called
- calling task's atexit processing done
- global libc state atexit processing done
- (this will include any atexit routines installed by drivers)
- executive is shutdown
- causes a context switch back to bsp land
-
-
-NOTE:
- libc extension are installed by bsp_libc_init()
- iff we are using clock interrupts.
- This hack is necessary to allow the tmtests to avoid
- timing the extensions.
-
diff --git a/cpukit/libcsupport/src/__brk.c b/cpukit/libcsupport/src/__brk.c
deleted file mode 100644
index 4dab22c729..0000000000
--- a/cpukit/libcsupport/src/__brk.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#if !defined(RTEMS_UNIX)
-
-/*
- * RTEMS "Broken" __brk/__sbrk Implementation
- *
- * NOTE: sbrk is BSP provided.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#include <signal.h>
-#include <errno.h>
-#include <sys/types.h>
-#ifdef RTEMS_NEWLIB
-#include <reent.h>
-#endif
-#include <unistd.h>
-
-/* we use RTEMS for memory management. We don't need sbrk */
-
-void * __sbrk(int incr)
-{
- errno = EINVAL;
- return (void *)0;
-}
-
-int __brk( const void *endds )
-{
- errno = EINVAL;
- return -1;
-}
-
-#endif
diff --git a/cpukit/libcsupport/src/__gettod.c b/cpukit/libcsupport/src/__gettod.c
deleted file mode 100644
index dc83c47ce4..0000000000
--- a/cpukit/libcsupport/src/__gettod.c
+++ /dev/null
@@ -1,118 +0,0 @@
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-
-#include <rtems.h>
-
-#if !defined(RTEMS_UNIX)
-/*
- * RTEMS gettimeofday Implementation
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#ifdef RTEMS_NEWLIB
-#include <sys/reent.h>
-#endif
-
-#include <sys/time.h>
-#include <time.h>
-
-#include <errno.h>
-#include <assert.h>
-
-/*
- * Seconds from January 1, 1970 to January 1, 1988. Used to account for
- * differences between POSIX API and RTEMS core.
- */
-
-#define POSIX_TIME_SECONDS_1970_THROUGH_1988 \
- (((1987 - 1970 + 1) * TOD_SECONDS_PER_NON_LEAP_YEAR) + \
- (4 * TOD_SECONDS_PER_DAY))
-
-/*
- * NOTE: The solaris gettimeofday does not have a second parameter.
- */
-
-int gettimeofday(
- struct timeval *tp,
- struct timezone *tzp
-)
-{
- rtems_interrupt_level level;
- rtems_unsigned32 seconds;
- rtems_unsigned32 microseconds;
-
- if ( !tp ) {
- errno = EFAULT;
- return -1;
- }
-
- /*
- * POSIX does not seem to allow for not having a TOD so we just
- * grab the time of day.
- *
- * NOTE: XXX this routine should really be in the executive proper.
- */
-
- rtems_interrupt_disable(level);
- seconds = _TOD_Seconds_since_epoch;
- microseconds = _TOD_Current.ticks;
- rtems_interrupt_enable(level);
-
- tp->tv_sec = seconds + POSIX_TIME_SECONDS_1970_THROUGH_1988;
- tp->tv_usec = microseconds * _TOD_Microseconds_per_tick;
-
- /*
- * newlib does not have timezone and daylight savings time
- * yet. When it does this needs to be fixed.
- */
-
-#if 0
- if ( tzp ) {
- tzp->tz_minuteswest = 0; /* at UTC */
- tzp->tz_dsttime = 0; /* no daylight savings */
- tzp->minuteswest = timezone / 60; /* from seconds to minutes */
- tzp->dsttime = daylight;
- }
-#endif
- return 0;
-}
-
-#if defined(RTEMS_NEWLIB)
-
-/*
- * "Reentrant" version
- */
-
-int _gettimeofday_r(
- struct _reent *ignored_reentrancy_stuff,
- struct timeval *tp,
- struct timezone *tzp
-)
-{
- return gettimeofday( tp, tzp );
-}
-
-/*
- * "System call" version
- */
-
-int _gettimeofday(
- struct timeval *tp,
- struct timezone *tzp
-)
-{
- return gettimeofday( tp, tzp );
-}
-
-#endif /* defined(RTEMS_NEWLIB) */
-
-#endif
diff --git a/cpukit/libcsupport/src/__times.c b/cpukit/libcsupport/src/__times.c
deleted file mode 100644
index 635bf8e062..0000000000
--- a/cpukit/libcsupport/src/__times.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * RTEMS _times Implementation
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-#include <sys/times.h>
-#include <time.h>
-#include <sys/time.h>
-#include <errno.h>
-#include <assert.h>
-
-clock_t _times(
- struct tms *ptms
-)
-{
- rtems_status_code status;
- rtems_interval ticks_since_boot;
-
- if ( !ptms ) {
- errno = EFAULT;
- return -1;
- }
-
- /* "POSIX" does not seem to allow for not having a TOD */
- status = rtems_clock_get(
- RTEMS_CLOCK_GET_TICKS_SINCE_BOOT,
- &ticks_since_boot
- );
- if ( status != RTEMS_SUCCESSFUL ) {
- assert( 0 );
- return -1;
- }
-
- /*
- * RTEMS has no notion of system versus user time and does
- * not (as of 3.2.0) keep track of CPU usage on a per task basis.
- */
-
- ptms->tms_utime = ticks_since_boot;
- ptms->tms_stime = 0;
- ptms->tms_cutime = 0;
- ptms->tms_cstime = 0;
-
- return 0;
-}
-
-clock_t times(
- struct tms *ptms
-)
-{
- return _times( ptms );
-}
-
-#if defined(RTEMS_NEWLIB)
-clock_t _times_r(
- struct _reent *ptr,
- struct tms *ptms
-)
-{
- return _times(ptms);
-}
-#endif
diff --git a/cpukit/libcsupport/src/assoc.c b/cpukit/libcsupport/src/assoc.c
deleted file mode 100644
index 74387a8c5b..0000000000
--- a/cpukit/libcsupport/src/assoc.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * assoc.c
- * rtems assoc routines
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include "assoc.h"
-
-#include <stdio.h> /* sprintf */
-#include <string.h> /* strcat, strcmp */
-
-#define STREQ(a,b) (strcmp((a), (b)) == 0)
-#define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME))
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (strcmp(ap->name, name) == 0)
- return ap;
-
- return default_ap;
-}
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (ap->local_value == local_value)
- return ap;
-
- return default_ap;
-}
-
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (ap->remote_value == remote_value)
- return ap;
-
- return default_ap;
-}
-
-
-/*
- * Get values
- */
-
-unsigned32
-rtems_assoc_remote_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_local(ap, local_value);
- if (nap)
- return nap->remote_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_local_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_remote(ap, remote_value);
- if (nap)
- return nap->local_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_remote_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_name(ap, name);
- if (nap)
- return nap->remote_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_local_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_name(ap, name);
- if (nap)
- return nap->local_value;
-
- return 0;
-}
-
-/*
- * what to return if a value is not found
- * this is not reentrant, but it really shouldn't be invoked anyway
- */
-
-const char *
-rtems_assoc_name_bad(
- unsigned32 bad_value
-)
-{
-#ifdef RTEMS_DEBUG
- static char bad_buffer[32];
-
- sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
-#else
- static char bad_buffer[32] = "<assoc.c: BAD NAME>";
-#endif
- return bad_buffer;
-}
-
-
-const char *
-rtems_assoc_name_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_local(ap, local_value);
- if (nap)
- return nap->name;
-
- return rtems_assoc_name_bad(local_value);
-}
-
-const char *
-rtems_assoc_name_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_remote(ap, remote_value);
- if (nap)
- return nap->name;
-
- return rtems_assoc_name_bad(remote_value);
-}
-
-/*
- * Bitfield functions assume just 1 bit set in each of remote and local
- * entries; they do not check for this.
- */
-
-unsigned32 rtems_assoc_remote_by_local_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- unsigned32 b;
- unsigned32 remote_value = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & local_value)
- remote_value |= rtems_assoc_remote_by_local(ap, b);
-
- return remote_value;
-}
-
-
-unsigned32 rtems_assoc_local_by_remote_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- unsigned32 b;
- unsigned32 local_value = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & remote_value)
- local_value |= rtems_assoc_local_by_remote(ap, b);
-
- return local_value;
-}
-
-char *
-rtems_assoc_name_by_remote_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 value,
- char *buffer
- )
-{
- unsigned32 b;
-
- *buffer = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (*buffer)
- strcat(buffer, " ");
- strcat(buffer, rtems_assoc_name_by_remote(ap, b));
- }
-
- return buffer;
-}
-
-char *
-rtems_assoc_name_by_local_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 value,
- char *buffer
- )
-{
- unsigned32 b;
-
- *buffer = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (*buffer)
- strcat(buffer, " ");
- strcat(buffer, rtems_assoc_name_by_local(ap, b));
- }
-
- return buffer;
-}
diff --git a/cpukit/libcsupport/src/closedir.c b/cpukit/libcsupport/src/closedir.c
deleted file mode 100644
index 5edb3499e6..0000000000
--- a/cpukit/libcsupport/src/closedir.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * closedir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-
-#include <sys/types.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-
-int closedir(
- register DIR *dirp
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/libcsupport/src/error.c b/cpukit/libcsupport/src/error.c
deleted file mode 100644
index dd32fb8b66..0000000000
--- a/cpukit/libcsupport/src/error.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * report errors and panics to RTEMS' stderr.
- * Currently just used by RTEMS monitor.
- *
- * $Id$
- */
-
-
-/*
- * These routines provide general purpose error reporting.
- * rtems_error reports an error to stderr and allows use of
- * printf style formatting. A newline is appended to all messages.
- *
- * error_flag can be specified as any of the following:
- *
- * RTEMS_ERROR_ERRNO -- include errno text in output
- * RTEMS_ERROR_PANIC -- halts local system after output
- * RTEMS_ERROR_ABORT -- abort after output
- *
- * It can also include a rtems_status value which can be OR'd
- * with the above flags. *
- *
- * EXAMPLE
- * #include <rtems.h>
- * #include <rtems/error.h>
- * rtems_error(0, "stray interrupt %d", intr);
- *
- * EXAMPLE
- * if ((status = rtems_task_create(...)) != RTEMS_SUCCCESSFUL)
- * {
- * rtems_error(status | RTEMS_ERROR_ABORT,
- * "could not create task");
- * }
- *
- * EXAMPLE
- * if ((fd = open(pathname, O_RDNLY)) < 0)
- * {
- * rtems_error(RTEMS_ERROR_ERRNO, "open of '%s' failed", pathname);
- * goto failed;
- * }
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-
-#include "error.h"
-#include <rtems/assoc.h>
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h> /* _exit() */
-
-/* bug in hpux <errno.h>: no prototypes unless you are C++ */
-#ifdef hpux9
-char *strerror(int);
-#endif
-
-extern char *rtems_progname;
-int rtems_panic_in_progress;
-
-rtems_assoc_t rtems_status_assoc[] = {
- { "successful completion", RTEMS_SUCCESSFUL, },
- { "returned from a thread", RTEMS_TASK_EXITTED, },
- { "multiprocessing not configured", RTEMS_MP_NOT_CONFIGURED, },
- { "invalid object name", RTEMS_INVALID_NAME, },
- { "invalid object id", RTEMS_INVALID_ID, },
- { "too many", RTEMS_TOO_MANY, },
- { "timed out waiting", RTEMS_TIMEOUT, },
- { "object deleted while waiting", RTEMS_OBJECT_WAS_DELETED, },
- { "specified size was invalid", RTEMS_INVALID_SIZE, },
- { "address specified is invalid", RTEMS_INVALID_ADDRESS, },
- { "number was invalid", RTEMS_INVALID_NUMBER, },
- { "item has not been initialized", RTEMS_NOT_DEFINED, },
- { "resources still outstanding", RTEMS_RESOURCE_IN_USE, },
- { "request not satisfied", RTEMS_UNSATISFIED, },
- { "thread is in wrong state", RTEMS_INCORRECT_STATE, },
- { "thread already in state", RTEMS_ALREADY_SUSPENDED, },
- { "illegal on calling thread", RTEMS_ILLEGAL_ON_SELF, },
- { "illegal for remote object", RTEMS_ILLEGAL_ON_REMOTE_OBJECT, },
- { "called from wrong environment", RTEMS_CALLED_FROM_ISR, },
- { "invalid thread priority", RTEMS_INVALID_PRIORITY, },
- { "invalid date/time", RTEMS_INVALID_CLOCK, },
- { "invalid node id", RTEMS_INVALID_NODE, },
- { "directive not configured", RTEMS_NOT_CONFIGURED, },
- { "not owner of resource", RTEMS_NOT_OWNER_OF_RESOURCE , },
- { "directive not implemented", RTEMS_NOT_IMPLEMENTED, },
- { "RTEMS inconsistency detected", RTEMS_INTERNAL_ERROR, },
- { "could not get enough memory", RTEMS_NO_MEMORY, },
- { "internal multiprocessing only", THREAD_STATUS_PROXY_BLOCKING, },
- { 0, 0, 0 },
-};
-
-
-const char *
-rtems_status_text(
- rtems_status_code status
-)
-{
- return rtems_assoc_name_by_local(rtems_status_assoc, status);
-}
-
-
-static int rtems_verror(
- unsigned32 error_flag,
- const char *printf_format,
- va_list arglist
-)
-{
- int local_errno = 0;
- int chars_written = 0;
- rtems_status_code status;
-
- if (error_flag & RTEMS_ERROR_PANIC)
- {
- if (rtems_panic_in_progress++)
- _Thread_Disable_dispatch(); /* disable task switches */
-
- /* don't aggravate things */
- if (rtems_panic_in_progress > 2)
- return 0;
- }
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- status = error_flag & ~RTEMS_ERROR_MASK;
- if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
- local_errno = errno;
-
- if (_System_state_Is_multiprocessing)
- fprintf(stderr, "[%d] ", _Configuration_MP_table->node);
-
- if (rtems_progname && *rtems_progname)
- chars_written += fprintf(stderr, "%s: ", rtems_progname);
- chars_written += vfprintf(stderr, printf_format, arglist);
-
- if (status)
- chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status));
-
- if (local_errno)
- {
- if ((local_errno > 0) && *strerror(local_errno))
- chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
- else
- chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
- }
-
- chars_written += fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (RTEMS_ERROR_PANIC | RTEMS_ERROR_ABORT))
- {
- if (error_flag & RTEMS_ERROR_PANIC)
- {
- rtems_error(0, "fatal error, exiting");
- _exit(local_errno);
- }
- else
- {
- rtems_error(0, "fatal error, aborting");
- abort();
- }
- }
- return chars_written;
-}
-
-
-/*
- * Report an error.
- * error_flag is as above; printf_format is a normal
- * printf(3) format string, with its concommitant arguments.
- *
- * Returns the number of characters written.
- */
-
-int rtems_error(
- int error_flag,
- const char *printf_format,
- ...
- )
-{
- va_list arglist;
- int chars_written;
-
- va_start(arglist, printf_format);
- chars_written = rtems_verror(error_flag, printf_format, arglist);
- va_end(arglist);
-
- return chars_written;
-}
-
-/*
- * rtems_panic is shorthand for rtems_error(RTEMS_ERROR_PANIC, ...)
- */
-
-void rtems_panic(
- const char *printf_format,
- ...
- )
-{
- va_list arglist;
-
- va_start(arglist, printf_format);
- (void) rtems_verror(RTEMS_ERROR_PANIC, printf_format, arglist);
- va_end(arglist);
-}
diff --git a/cpukit/libcsupport/src/getdents.c b/cpukit/libcsupport/src/getdents.c
deleted file mode 100644
index 9b16d82409..0000000000
--- a/cpukit/libcsupport/src/getdents.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Just enough to make newlib return an error.
- *
- * $Id$
- */
-
-int getdents(
- int fd,
- void *buf,
- int len
-)
-{
- return -1;
-}
diff --git a/cpukit/libcsupport/src/hosterr.c b/cpukit/libcsupport/src/hosterr.c
deleted file mode 100644
index a55e4a7e84..0000000000
--- a/cpukit/libcsupport/src/hosterr.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Routines to access a host errno
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <errno.h>
-
-int host_errno(void);
-
-/*
- * copy host errno, if any to thread aware errno, if any
- */
-
-void fix_syscall_errno(void)
-{
- errno = host_errno();
-}
-
-/*
- * Get the host system errno, if any
- * When using newlib (or possibly other libc's) on top of UNIX
- * the errno returned by system calls may be unavailable due
- * to trickery of making errno thread aware.
- * This provides a kludge of getting at it.
- */
-
-#undef errno
-extern int errno;
-int host_errno(void)
-{
- return errno;
-}
-
diff --git a/cpukit/libcsupport/src/libio.c b/cpukit/libcsupport/src/libio.c
deleted file mode 100644
index 12682c1190..0000000000
--- a/cpukit/libcsupport/src/libio.c
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
- * Provide UNIX/POSIX-like io system calls for RTEMS using the
- * RTEMS IO manager
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/assoc.h> /* assoc.h not included by rtems.h */
-
-#include <stdio.h> /* O_RDONLY, et.al. */
-#include <fcntl.h> /* O_RDONLY, et.al. */
-#include <assert.h>
-
-#if ! defined(O_NDELAY)
-# if defined(solaris2)
-# define O_NDELAY O_NONBLOCK
-# elif defined(RTEMS_NEWLIB)
-# define O_NDELAY _FNBIO
-# endif
-#endif
-
-
-#include <errno.h>
-#include <string.h> /* strcmp */
-#include <unistd.h>
-#include <stdlib.h> /* calloc() */
-
-#include "libio.h" /* libio.h not pulled in by rtems */
-
-/*
- * Semaphore to protect the io table
- */
-
-Objects_Id rtems_libio_semaphore;
-
-#define RTEMS_LIBIO_SEM rtems_build_name('L', 'B', 'I', 'O')
-#define RTEMS_LIBIO_IOP_SEM(n) rtems_build_name('L', 'B', 'I', n)
-
-extern unsigned32 rtems_libio_number_iops;
-rtems_libio_t *rtems_libio_iops;
-rtems_libio_t *rtems_libio_last_iop;
-
-#define rtems_libio_iop(fd) ((((unsigned32)(fd)) < rtems_libio_number_iops) ? \
- &rtems_libio_iops[fd] : 0)
-
-#define rtems_libio_check_fd(fd) \
- do { \
- if ((unsigned32) (fd) >= rtems_libio_number_iops) \
- { \
- errno = EBADF; \
- return -1; \
- } \
- } while (0)
-
-#define rtems_libio_check_buffer(buffer) \
- do { \
- if ((buffer) == 0) \
- { \
- errno = EINVAL; \
- return -1; \
- } \
- } while (0)
-
-#define rtems_libio_check_count(count) \
- do { \
- if ((count) == 0) \
- { \
- return 0; \
- } \
- } while (0)
-
-#define rtems_libio_check_permissions(iop, flag) \
- do { \
- if (((iop)->flags & (flag)) == 0) \
- { \
- errno = EINVAL; \
- return -1; \
- } \
- } while (0)
-
-/*
- * External I/O handlers
- *
- * Space for all possible handlers is preallocated
- * to speed up dispatch to external handlers.
- */
-
-static rtems_libio_handler_t handlers[15];
-
-void
-rtems_register_libio_handler(
- int handler_flag,
- const rtems_libio_handler_t *handler
-)
-{
- int handler_index = rtems_file_descriptor_type_index(handler_flag);
-
- if ((handler_index < 0) || (handler_index >= 15))
- rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER );
- handlers[handler_index] = *handler;
-}
-
-/*
- * Called by bsp startup code to init the libio area.
- */
-
-void
-rtems_libio_init(void)
-{
- rtems_status_code rc;
-
- if (rtems_libio_number_iops > 0)
- {
- rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops,
- sizeof(rtems_libio_t));
- if (rtems_libio_iops == NULL)
- rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
-
- rtems_libio_last_iop = rtems_libio_iops + (rtems_libio_number_iops - 1);
- }
-
- rc = rtems_semaphore_create(
- RTEMS_LIBIO_SEM,
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &rtems_libio_semaphore
- );
- if (rc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(rc);
-}
-
-/*
- * Convert RTEMS status to a UNIX errno
- */
-
-rtems_assoc_t errno_assoc[] = {
- { "OK", RTEMS_SUCCESSFUL, 0 },
- { "BUSY", RTEMS_RESOURCE_IN_USE, EBUSY },
- { "INVALID NAME", RTEMS_INVALID_NAME, EINVAL },
- { "NOT IMPLEMENTED", RTEMS_NOT_IMPLEMENTED, ENOSYS },
- { "TIMEOUT", RTEMS_TIMEOUT, ETIMEDOUT },
- { "NO MEMORY", RTEMS_NO_MEMORY, ENOMEM },
- { "NO DEVICE", RTEMS_UNSATISFIED, ENODEV },
- { "INVALID NUMBER", RTEMS_INVALID_NUMBER, EBADF},
- { "NOT RESOURCE OWNER", RTEMS_NOT_OWNER_OF_RESOURCE, EPERM},
- { "IO ERROR", RTEMS_IO_ERROR, EIO},
- { 0, 0, 0 },
-};
-
-static unsigned32
-rtems_libio_errno(rtems_status_code code)
-{
- int rc;
-
- if ((rc = rtems_assoc_remote_by_local(errno_assoc, (unsigned32) code)))
- {
- errno = rc;
- return -1;
- }
- return -1;
-}
-
-/*
- * Convert UNIX fnctl(2) flags to ones that RTEMS drivers understand
- */
-
-rtems_assoc_t access_modes_assoc[] = {
- { "READ", LIBIO_FLAGS_READ, O_RDONLY },
- { "WRITE", LIBIO_FLAGS_WRITE, O_WRONLY },
- { "READ/WRITE", LIBIO_FLAGS_READ_WRITE, O_RDWR },
- { 0, 0, 0 },
-};
-
-rtems_assoc_t status_flags_assoc[] = {
- { "NO DELAY", LIBIO_FLAGS_NO_DELAY, O_NDELAY },
- { "APPEND", LIBIO_FLAGS_APPEND, O_APPEND },
- { "CREATE", LIBIO_FLAGS_CREATE, O_CREAT },
- { 0, 0, 0 },
-};
-
-static unsigned32
-rtems_libio_fcntl_flags(unsigned32 fcntl_flags)
-{
- unsigned32 flags = 0;
- unsigned32 access_modes;
-
- /*
- * Access mode is a small integer
- */
-
- access_modes = fcntl_flags & O_ACCMODE;
- fcntl_flags &= ~O_ACCMODE;
- flags = rtems_assoc_local_by_remote(access_modes_assoc, access_modes);
-
- /*
- * Everything else is single bits
- */
-
- flags |= rtems_assoc_local_by_remote_bitfield(status_flags_assoc, fcntl_flags);
- return flags;
-}
-
-
-static rtems_libio_t *
-rtems_libio_allocate(void)
-{
- rtems_libio_t *iop;
- rtems_status_code rc;
-
- rtems_semaphore_obtain(rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-
- for (iop = rtems_libio_iops; iop <= rtems_libio_last_iop; iop++)
- if ((iop->flags & LIBIO_FLAGS_OPEN) == 0)
- {
- /*
- * Got one; create a semaphore for it
- */
-
- rc = rtems_semaphore_create(
- RTEMS_LIBIO_IOP_SEM(iop - rtems_libio_iops),
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &iop->sem
- );
- if (rc != RTEMS_SUCCESSFUL)
- goto failed;
-
- iop->flags = LIBIO_FLAGS_OPEN;
- goto done;
- }
-
-failed:
- iop = 0;
-
-done:
- rtems_semaphore_release(rtems_libio_semaphore);
- return iop;
-}
-
-static void
-rtems_libio_free(rtems_libio_t *iop)
-{
- rtems_semaphore_obtain(rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-
- if (iop->sem)
- rtems_semaphore_delete(iop->sem);
- (void) memset(iop, 0, sizeof(*iop));
-
- rtems_semaphore_release(rtems_libio_semaphore);
-}
-
-int
-__rtems_open(
- const char *pathname,
- unsigned32 flag,
- unsigned32 mode)
-{
- rtems_status_code rc;
- rtems_libio_t *iop = 0;
- rtems_driver_name_t *np;
- rtems_libio_open_close_args_t args;
-
- /*
- * Additional external I/O handlers would be supported by
- * adding code to pick apart the pathname appropriately.
- * The networking code does not require changes here since
- * network file descriptors are obtained using socket(), not
- * open().
- */
-
- if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL)
- goto done;
-
- iop = rtems_libio_allocate();
- if (iop == 0)
- {
- rc = RTEMS_TOO_MANY;
- goto done;
- }
-
- iop->driver = np;
- iop->pathname = (char *) pathname;
- iop->flags |= rtems_libio_fcntl_flags(flag);
-
- args.iop = iop;
- args.flags = iop->flags;
- args.mode = mode;
-
- rc = rtems_io_open(np->major, np->minor, (void *) &args);
-
-done:
-
- if (rc != RTEMS_SUCCESSFUL)
- {
- if (iop)
- rtems_libio_free(iop);
- return rtems_libio_errno(rc);
- }
-
- return iop - rtems_libio_iops;
-}
-
-int
-__rtems_close(
- int fd
- )
-{
- rtems_status_code rc;
- rtems_driver_name_t *np;
- rtems_libio_t *iop;
- rtems_libio_open_close_args_t args;
- int status;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].close;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- status = (*fp)(fd);
- return status;
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
-
- np = iop->driver;
-
- args.iop = iop;
- args.flags = 0;
- args.mode = 0;
-
- rc = rtems_io_close(np->major, np->minor, (void *) &args);
-
- rtems_libio_free(iop);
-
- if (rc != RTEMS_SUCCESSFUL)
- return rtems_libio_errno(rc);
- return 0;
-}
-
-int
-__rtems_read(
- int fd,
- void * buffer,
- unsigned32 count
- )
-{
- rtems_status_code rc;
- rtems_driver_name_t *np;
- rtems_libio_t *iop;
- rtems_libio_rw_args_t args;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd, void *buffer, unsigned32 count);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].read;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- return (*fp)(fd, buffer, count);
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
- rtems_libio_check_buffer(buffer);
- rtems_libio_check_count(count);
- rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ);
-
- np = iop->driver;
-
- args.iop = iop;
- args.offset = iop->offset;
- args.buffer = buffer;
- args.count = count;
- args.flags = iop->flags;
- args.bytes_moved = 0;
-
- rc = rtems_io_read(np->major, np->minor, (void *) &args);
-
- iop->offset += args.bytes_moved;
-
- if (rc != RTEMS_SUCCESSFUL)
- return rtems_libio_errno(rc);
-
- return args.bytes_moved;
-}
-
-int
-__rtems_write(
- int fd,
- const void *buffer,
- unsigned32 count
- )
-{
- rtems_status_code rc;
- rtems_driver_name_t *np;
- rtems_libio_t *iop;
- rtems_libio_rw_args_t args;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd, const void *buffer, unsigned32 count);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].write;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- return (*fp)(fd, buffer, count);
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
- rtems_libio_check_buffer(buffer);
- rtems_libio_check_count(count);
- rtems_libio_check_permissions(iop, LIBIO_FLAGS_WRITE);
-
- np = iop->driver;
-
- args.iop = iop;
- args.offset = iop->offset;
- args.buffer = (void *) buffer;
- args.count = count;
- args.flags = iop->flags;
- args.bytes_moved = 0;
-
- rc = rtems_io_write(np->major, np->minor, (void *) &args);
-
- iop->offset += args.bytes_moved;
-
- if (rc != RTEMS_SUCCESSFUL)
- return rtems_libio_errno(rc);
-
- return args.bytes_moved;
-}
-
-int
-__rtems_ioctl(
- int fd,
- unsigned32 command,
- void * buffer)
-{
- rtems_status_code rc;
- rtems_driver_name_t *np;
- rtems_libio_t *iop;
- rtems_libio_ioctl_args_t args;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd, unsigned32 command, void *buffer);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].ioctl;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- return (*fp)(fd, command, buffer);
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
-
- np = iop->driver;
-
- args.iop = iop;
- args.command = command;
- args.buffer = buffer;
-
- rc = rtems_io_control(np->major, np->minor, (void *) &args);
-
- if (rc != RTEMS_SUCCESSFUL)
- return rtems_libio_errno(rc);
-
- return args.ioctl_return;
-}
-
-/*
- * internal only??
- */
-
-
-int
-__rtems_lseek(
- int fd,
- rtems_libio_offset_t offset,
- int whence
- )
-{
- rtems_libio_t *iop;
-
- if (rtems_file_descriptor_type(fd)) {
- int (*fp)(int fd, rtems_libio_offset_t offset, int whence);
-
- fp = handlers[rtems_file_descriptor_type_index(fd)].lseek;
- if (fp == NULL) {
- errno = EBADF;
- return -1;
- }
- return (*fp)(fd, offset, whence);
- }
- iop = rtems_libio_iop(fd);
- rtems_libio_check_fd(fd);
-
- switch (whence)
- {
- case SEEK_SET:
- iop->offset = offset;
- break;
-
- case SEEK_CUR:
- iop->offset += offset;
- break;
-
- case SEEK_END:
- iop->offset = iop->size - offset;
- break;
-
- default:
- errno = EINVAL;
- return -1;
- }
- return 0;
-}
diff --git a/cpukit/libcsupport/src/malloc.c b/cpukit/libcsupport/src/malloc.c
deleted file mode 100644
index fac38585a7..0000000000
--- a/cpukit/libcsupport/src/malloc.c
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * RTEMS Malloc Family Implementation
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include "libcsupport.h"
-#ifdef RTEMS_NEWLIB
-#include <sys/reent.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <assert.h>
-#include <errno.h>
-#include <string.h>
-
-/* for sbrk prototype in linux */
-#if defined(__linux__)
-#define __USE_MISC
-#endif
-#include <unistd.h> /* sbrk(2) */
-
-rtems_id RTEMS_Malloc_Heap;
-size_t RTEMS_Malloc_Sbrk_amount;
-
-extern rtems_cpu_table Cpu_table;
-#ifdef RTEMS_DEBUG
-#define MALLOC_STATS
-#define MALLOC_DIRTY
-#endif
-
-#ifdef MALLOC_STATS
-#define MSBUMP(f,n) rtems_malloc_stats.f += (n)
-
-struct {
- unsigned32 space_available; /* current size of malloc area */
- unsigned32 malloc_calls; /* # calls to malloc */
- unsigned32 free_calls;
- unsigned32 realloc_calls;
- unsigned32 calloc_calls;
- unsigned32 max_depth; /* most ever malloc'd at 1 time */
- unsigned64 lifetime_allocated;
- unsigned64 lifetime_freed;
-} rtems_malloc_stats;
-
-#else /* No rtems_malloc_stats */
-#define MSBUMP(f,n)
-#endif
-
-void RTEMS_Malloc_Initialize(
- void *start,
- size_t length,
- size_t sbrk_amount
-)
-{
- rtems_status_code status;
- void *starting_address;
- rtems_unsigned32 old_address;
- rtems_unsigned32 u32_address;
-
- /*
- * If the starting address is 0 then we are to attempt to
- * get length worth of memory using sbrk. Make sure we
- * align the address that we get back.
- */
-
- starting_address = start;
- RTEMS_Malloc_Sbrk_amount = sbrk_amount;
-
- if (!starting_address) {
- u32_address = (unsigned int)sbrk(length);
-
- if (u32_address == (rtems_unsigned32) -1) {
- rtems_fatal_error_occurred( RTEMS_NO_MEMORY );
- /* DOES NOT RETURN!!! */
- }
-
- if (u32_address & (CPU_ALIGNMENT-1)) {
- old_address = u32_address;
- u32_address = (u32_address + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- /*
- * adjust the length by whatever we aligned by
- */
-
- length -= u32_address - old_address;
- }
-
- starting_address = (void *)u32_address;
- }
-
- /*
- * If the BSP is not clearing out the workspace, then it is most likely
- * not clearing out the initial memory for the heap. There is no
- * standard supporting zeroing out the heap memory. But much code
- * with UNIX history seems to assume that memory malloc'ed during
- * initialization (before any free's) is zero'ed. This is true most
- * of the time under UNIX because zero'ing memory when it is first
- * given to a process eliminates the chance of a process seeing data
- * left over from another process. This would be a security violation.
- */
-
- if ( Cpu_table.do_zero_of_workspace )
- memset( starting_address, 0, length );
-
- /*
- * Unfortunately we cannot use assert if this fails because if this
- * has failed we do not have a heap and if we do not have a heap
- * STDIO cannot work because there will be no buffers.
- */
-
- status = rtems_region_create(
- rtems_build_name( 'H', 'E', 'A', 'P' ),
- starting_address,
- length,
- CPU_ALIGNMENT,
- RTEMS_DEFAULT_ATTRIBUTES,
- &RTEMS_Malloc_Heap
- );
- if ( status != RTEMS_SUCCESSFUL )
- rtems_fatal_error_occurred( status );
-
-#ifdef MALLOC_STATS
- /* zero all the stats */
- (void) memset(&rtems_malloc_stats, 0, sizeof(rtems_malloc_stats));
-#endif
-
- MSBUMP(space_available, length);
-}
-
-#ifdef RTEMS_NEWLIB
-void *malloc(
- size_t size
-)
-{
- void *return_this;
- void *starting_address;
- rtems_unsigned32 the_size;
- rtems_unsigned32 sbrk_amount;
- rtems_status_code status;
-
- MSBUMP(malloc_calls, 1);
-
- if ( !size )
- return (void *) 0;
-
- /*
- * Try to give a segment in the current region if there is not
- * enough space then try to grow the region using rtems_region_extend().
- * If this fails then return a NULL pointer.
- */
-
- status = rtems_region_get_segment(
- RTEMS_Malloc_Heap,
- size,
- RTEMS_NO_WAIT,
- RTEMS_NO_TIMEOUT,
- &return_this
- );
-
- if ( status != RTEMS_SUCCESSFUL ) {
- /*
- * Round to the "requested sbrk amount" so hopefully we won't have
- * to grow again for a while. This effectively does sbrk() calls
- * in "page" amounts.
- */
-
- sbrk_amount = RTEMS_Malloc_Sbrk_amount;
-
- if ( sbrk_amount == 0 )
- return (void *) 0;
-
- the_size = ((size + sbrk_amount) / sbrk_amount * sbrk_amount);
-
- if (((rtems_unsigned32)starting_address = (void *)sbrk(the_size))
- == (rtems_unsigned32) -1)
- return (void *) 0;
-
- status = rtems_region_extend(
- RTEMS_Malloc_Heap,
- starting_address,
- the_size
- );
- if ( status != RTEMS_SUCCESSFUL ) {
- sbrk(-the_size);
- errno = ENOMEM;
- return (void *) 0;
- }
-
- MSBUMP(space_available, the_size);
-
- status = rtems_region_get_segment(
- RTEMS_Malloc_Heap,
- size,
- RTEMS_NO_WAIT,
- RTEMS_NO_TIMEOUT,
- &return_this
- );
- if ( status != RTEMS_SUCCESSFUL ) {
- errno = ENOMEM;
- return (void *) 0;
- }
- }
-
-#ifdef MALLOC_STATS
- if (return_this)
- {
- unsigned32 actual_size;
- unsigned32 current_depth;
- status = rtems_region_get_segment_size(RTEMS_Malloc_Heap, return_this, &actual_size);
- MSBUMP(lifetime_allocated, actual_size);
- current_depth = rtems_malloc_stats.lifetime_allocated - rtems_malloc_stats.lifetime_freed;
- if (current_depth > rtems_malloc_stats.max_depth)
- rtems_malloc_stats.max_depth = current_depth;
- }
-#endif
-
-#ifdef MALLOC_DIRTY
- (void) memset(return_this, 0xCF, size);
-#endif
-
- return return_this;
-}
-
-void *calloc(
- size_t nelem,
- size_t elsize
-)
-{
- register char *cptr;
- int length;
-
- MSBUMP(calloc_calls, 1);
-
- length = nelem * elsize;
- cptr = malloc( length );
- if ( cptr )
- memset( cptr, '\0', length );
-
- MSBUMP(malloc_calls, -1); /* subtract off the malloc */
-
- return cptr;
-}
-
-void *realloc(
- void *ptr,
- size_t size
-)
-{
- rtems_unsigned32 old_size;
- rtems_status_code status;
- char *new_area;
-
- MSBUMP(realloc_calls, 1);
-
- if ( !ptr )
- return malloc( size );
-
- if ( !size ) {
- free( ptr );
- return (void *) 0;
- }
-
- new_area = malloc( size );
-
- MSBUMP(malloc_calls, -1); /* subtract off the malloc */
-
- if ( !new_area ) {
- free( ptr );
- return (void *) 0;
- }
-
- status = rtems_region_get_segment_size( RTEMS_Malloc_Heap, ptr, &old_size );
- if ( status != RTEMS_SUCCESSFUL ) {
- errno = EINVAL;
- return (void *) 0;
- }
-
- memcpy( new_area, ptr, (size < old_size) ? size : old_size );
- free( ptr );
-
- return new_area;
-
-}
-
-void free(
- void *ptr
-)
-{
- rtems_status_code status;
-
- MSBUMP(free_calls, 1);
-
- if ( !ptr )
- return;
-
-#ifdef MALLOC_STATS
- {
- unsigned32 size;
- status = rtems_region_get_segment_size( RTEMS_Malloc_Heap, ptr, &size );
- if ( status == RTEMS_SUCCESSFUL ) {
- MSBUMP(lifetime_freed, size);
- }
- }
-#endif
-
- status = rtems_region_return_segment( RTEMS_Malloc_Heap, ptr );
- if ( status != RTEMS_SUCCESSFUL ) {
- errno = EINVAL;
- assert( 0 );
- }
-}
-/* end if RTEMS_NEWLIB */
-#endif
-
-#ifdef MALLOC_STATS
-/*
- * Dump the malloc statistics
- * May be called via atexit() (installable by our bsp) or
- * at any time by user
- */
-
-void malloc_dump(void)
-{
- unsigned32 allocated = rtems_malloc_stats.lifetime_allocated - rtems_malloc_stats.lifetime_freed;
-
- printf("Malloc stats\n");
- printf(" avail:%uk allocated:%uk (%d%%) max:%uk (%d%%) lifetime:%Luk freed:%Luk\n",
- (unsigned int) rtems_malloc_stats.space_available / 1024,
- (unsigned int) allocated / 1024,
- /* avoid float! */
- (allocated * 100) / rtems_malloc_stats.space_available,
- (unsigned int) rtems_malloc_stats.max_depth / 1024,
- (rtems_malloc_stats.max_depth * 100) / rtems_malloc_stats.space_available,
- (unsigned64) rtems_malloc_stats.lifetime_allocated / 1024,
- (unsigned64) rtems_malloc_stats.lifetime_freed / 1024);
- printf(" Call counts: malloc:%d free:%d realloc:%d calloc:%d\n",
- rtems_malloc_stats.malloc_calls,
- rtems_malloc_stats.free_calls,
- rtems_malloc_stats.realloc_calls,
- rtems_malloc_stats.calloc_calls);
-}
-
-
-void malloc_walk(size_t source, size_t printf_enabled)
-{
- register Region_Control *the_region;
- Objects_Locations location;
-
- the_region = _Region_Get( RTEMS_Malloc_Heap, &location );
- if ( location == OBJECTS_LOCAL )
- {
- _Heap_Walk( &the_region->Memory, source, printf_enabled );
- _Thread_Enable_dispatch();
- }
-}
-
-#else
-
-void malloc_dump(void)
-{
- return;
-}
-
-void malloc_walk(size_t source, size_t printf_enabled)
-{
- return;
-}
-
-#endif
-
-/*
- * "Reentrant" versions of the above routines implemented above.
- */
-
-#ifdef RTEMS_NEWLIB
-void *_malloc_r(
- struct _reent *ignored,
- size_t size
-)
-{
- return malloc( size );
-}
-
-void *_calloc_r(
- struct _reent *ignored,
- size_t nelem,
- size_t elsize
-)
-{
- return calloc( nelem, elsize );
-}
-
-void *_realloc_r(
- struct _reent *ignored,
- void *ptr,
- size_t size
-)
-{
- return realloc( ptr, size );
-}
-
-void _free_r(
- struct _reent *ignored,
- void *ptr
-)
-{
- free( ptr );
-}
-#endif
-
diff --git a/cpukit/libcsupport/src/newlibc.c b/cpukit/libcsupport/src/newlibc.c
deleted file mode 100644
index a6acc1c8d7..0000000000
--- a/cpukit/libcsupport/src/newlibc.c
+++ /dev/null
@@ -1,429 +0,0 @@
-
-/*
- * COPYRIGHT (c) 1994 by Division Incorporated
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Description:
- * Implementation of hooks for the CYGNUS newlib libc
- * These hooks set things up so that:
- * '_REENT' is switched at task switch time.
- *
- *
- * TODO:
- *
- * NOTE:
- *
- * $Id$
- *
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-
-#if defined(RTEMS_NEWLIB)
-#include <libcsupport.h>
-#include <stdlib.h> /* for free() */
-#include <string.h> /* for memset() */
-
-#include <sys/reent.h> /* for extern of _REENT (aka _impure_ptr) */
-#include <errno.h>
-
-/*
- * NOTE:
- * There is some problem with doing this on the hpux version
- * of the UNIX simulator (symptom is printf core dumps), so
- * we just don't for now.
- * Not sure if this is a problem with hpux, newlib, or something else.
- */
-
-#if defined(RTEMS_UNIX) && !defined(hpux)
-#define NEED_SETVBUF
-#endif
-
-#ifdef NEED_SETVBUF
-#include <stdio.h>
-#endif
-
-#include "internal.h"
-
-#define LIBC_NOTEPAD RTEMS_NOTEPAD_LAST
-
-
-int libc_reentrant; /* do we think we are reentrant? */
-struct _reent libc_global_reent = _REENT_INIT(libc_global_reent);
-
-/*
- * CYGNUS newlib routine that does atexit() processing and flushes
- * stdio streams
- * undocumented
- */
-
-extern void _wrapup_reent(struct _reent *);
-extern void _reclaim_reent(struct _reent *);
-
-#include <stdio.h>
-
-void
-libc_wrapup(void)
-{
- /*
- * In case RTEMS is already down, don't do this. It could be
- * dangerous.
- */
-
- if (!_System_state_Is_up(_System_state_Get()))
- return;
-
- _wrapup_reent(0);
- if (_REENT != &libc_global_reent)
- {
- _wrapup_reent(&libc_global_reent);
-#if 0
- /* don't reclaim this one, just in case we do printfs */
- /* on our way out to ROM */
- _reclaim_reent(&libc_global_reent);
-#endif
- _REENT = &libc_global_reent;
- }
-
- /*
- * Try to drain output buffers.
- *
- * Should this be changed to do *all* file streams?
- * _fwalk (_REENT, fclose);
- */
- fclose (stdin);
- fclose (stdout);
- fclose (stderr);
-}
-
-
-rtems_boolean
-libc_create_hook(rtems_tcb *current_task,
- rtems_tcb *creating_task)
-{
- MY_task_set_note(creating_task, LIBC_NOTEPAD, 0);
- return TRUE;
-}
-
-/*
- * Called for all user TASKS (system tasks are MPCI Receive Server and IDLE)
- */
-
-rtems_extension
-libc_start_hook(rtems_tcb *current_task,
- rtems_tcb *starting_task)
-{
- struct _reent *ptr;
-
- /* NOTE: our malloc is reentrant without a reent ptr since
- * it is based on region manager
- */
-
- ptr = (struct _reent *) calloc(1, sizeof(struct _reent));
-
- if (!ptr)
- rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
-
-#ifdef __GNUC__
- /* GCC extension: structure constants */
- *ptr = (struct _reent) _REENT_INIT((*ptr));
-#else
- /*
- * Warning: THIS IS VERY DEPENDENT ON NEWLIB!!! WRITTEN FOR 1.7.0
- */
- ptr->_errno=0;
- ptr->_stdin=&ptr->__sf[0];
- ptr->_stdout=&ptr->__sf[1];
- ptr->_stderr=&ptr->__sf[2];
- ptr->_scanpoint=0;
- ptr->_asctime[0]=0;
- ptr->_next=1;
- ptr->__sdidinit=0;
-#endif
-
- MY_task_set_note(starting_task, LIBC_NOTEPAD, (rtems_unsigned32) ptr);
-}
-
-/*
- * Called for all user TASKS (system tasks are MPCI Receive Server and IDLE)
- */
-
-#ifdef NEED_SETVBUF
-rtems_extension
-libc_begin_hook(rtems_tcb *current_task)
-{
- setvbuf( stdout, NULL, _IOLBF, BUFSIZ );
-}
-#endif
-
-rtems_extension
-libc_switch_hook(rtems_tcb *current_task,
- rtems_tcb *heir_task)
-{
- rtems_unsigned32 impure_value;
-
- /* XXX We can't use rtems_task_set_note() here since SYSI task has a
- * tid of 0, which is treated specially (optimized, actually)
- * by rtems_task_set_note
- *
- * NOTE: The above comment is no longer true and we need to use
- * the extension data areas added about the same time.
- */
-
- /*
- * Don't touch the outgoing task if it has been deleted.
- */
-
- if ( !_States_Is_transient( current_task->current_state ) ) {
- impure_value = (rtems_unsigned32) _REENT;
- MY_task_set_note(current_task, LIBC_NOTEPAD, impure_value);
- }
-
- _REENT = (struct _reent *) MY_task_get_note(heir_task, LIBC_NOTEPAD);
-
-}
-
-/*
- * Function: libc_delete_hook
- * Created: 94/12/10
- *
- * Description:
- * Called when a task is deleted.
- * Must restore the new lib reentrancy state for the new current
- * task.
- *
- * Parameters:
- *
- *
- * Returns:
- *
- *
- * Side Effects:
- *
- * Notes:
- *
- *
- * Deficiencies/ToDo:
- *
- *
- */
-rtems_extension
-libc_delete_hook(rtems_tcb *current_task,
- rtems_tcb *deleted_task)
-{
- struct _reent *ptr;
-
- /*
- * The reentrancy structure was allocated by newlib using malloc()
- */
-
- if (current_task == deleted_task)
- {
- ptr = _REENT;
- }
- else
- {
- ptr = (struct _reent *) MY_task_get_note(deleted_task, LIBC_NOTEPAD);
- }
-
- /* if (ptr) */
- if (ptr && ptr != &libc_global_reent)
- {
- _wrapup_reent(ptr);
- _reclaim_reent(ptr);
- free(ptr);
- }
-
- MY_task_set_note(deleted_task, LIBC_NOTEPAD, 0);
-
- /*
- * Require the switch back to another task to install its own
- */
-
- if (current_task == deleted_task)
- {
- _REENT = 0;
- }
-}
-
-/*
- * Function: libc_init
- * Created: 94/12/10
- *
- * Description:
- * Init libc for CYGNUS newlib
- * Set up _REENT to use our global libc_global_reent.
- * (newlib provides a global of its own, but we prefer our
- * own name for it)
- *
- * If reentrancy is desired (which it should be), then
- * we install the task extension hooks to maintain the
- * newlib reentrancy global variable _REENT on task
- * create, delete, switch, exit, etc.
- *
- * Parameters:
- * reentrant non-zero if reentrant library desired.
- *
- * Returns:
- *
- * Side Effects:
- * installs libc extensions if reentrant.
- *
- * Notes:
- *
- *
- * Deficiencies/ToDo:
- *
- */
-
-void
-libc_init(int reentrant)
-{
- rtems_extensions_table libc_extension;
- rtems_id extension_id;
- rtems_status_code rc;
-
- _REENT = &libc_global_reent;
-
- if (reentrant)
- {
- memset(&libc_extension, 0, sizeof(libc_extension));
-
- libc_extension.thread_create = libc_create_hook;
- libc_extension.thread_start = libc_start_hook;
-#ifdef NEED_SETVBUF
- libc_extension.thread_begin = libc_begin_hook;
-#endif
- libc_extension.thread_switch = libc_switch_hook;
- libc_extension.thread_delete = libc_delete_hook;
-
- rc = rtems_extension_create(rtems_build_name('L', 'I', 'B', 'C'),
- &libc_extension, &extension_id);
- if (rc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(rc);
-
- libc_reentrant = reentrant;
- }
-}
-
-#if 0
-/*
- * Routines required by the gnat runtime.
- */
-
-int get_errno()
-{
- return errno;
-}
-#endif
-
-/*
- * Function: _exit
- * Created: 94/12/10
- *
- * Description:
- * Called from exit() after it does atexit() processing and stdio fflush's
- *
- * called from bottom of exit() to really delete the task.
- * If we are using reentrant libc, then let the delete extension
- * do all the work, otherwise if a shutdown is in progress,
- * then just do it.
- *
- * Parameters:
- * exit status
- *
- * Returns:
- * does not return
- *
- * Side Effects:
- *
- * Notes:
- *
- *
- * Deficiencies/ToDo:
- *
- *
- */
-
-#include <stdio.h>
-
-/* #if !defined(RTEMS_UNIX) && !defined(__GO32__) && !defined(_AM29K) */
-#if !defined(RTEMS_UNIX) && !defined(_AM29K)
-void _exit(int status)
-{
- libc_wrapup(); /* Why? XXX */
- rtems_shutdown_executive(status);
-}
-#else
-
-void exit(int status)
-{
- libc_wrapup();
- rtems_shutdown_executive(status);
-}
-#endif
-
-
-/*
- * These are directly supported (and completely correct) in the posix api.
- */
-
-pid_t __getpid(void)
-{
- return getpid();
-}
-
-/* #if !defined(RTEMS_POSIX_API) || defined(__GO32__) */
-#if !defined(RTEMS_POSIX_API)
-pid_t getpid(void)
-{
- return (0);
-}
-#endif
-
-/* #if !defined(RTEMS_POSIX_API) || defined(__GO32__) */
-#if !defined(RTEMS_POSIX_API)
-int kill( pid_t pid, int sig )
-{
- return 0;
-}
-#endif
-
-int __kill( pid_t pid, int sig )
-{
- return 0;
-}
-
-#if !defined(RTEMS_POSIX_API)
-unsigned int sleep(
- unsigned int seconds
-)
-{
- rtems_status_code status;
- rtems_interval ticks_per_second;
- rtems_interval ticks;
-
- status = rtems_clock_get(
- RTEMS_CLOCK_GET_TICKS_PER_SECOND,
- &ticks_per_second
- );
-
- ticks = seconds * ticks_per_second;
-
- status = rtems_task_wake_after( ticks );
-
- /*
- * Returns the "unslept" amount of time. In RTEMS signals are not
- * interruptable, so tasks really sleep all of the requested time.
- */
-
- return 0;
-}
-#endif
-
-
-#endif
diff --git a/cpukit/libcsupport/src/no_libc.c b/cpukit/libcsupport/src/no_libc.c
deleted file mode 100644
index 5a58ba761c..0000000000
--- a/cpukit/libcsupport/src/no_libc.c
+++ /dev/null
@@ -1,55 +0,0 @@
-
-/* no_libc.h
- *
- * This file contains stubs for the reentrancy hooks when
- * an unknown C library is used.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#if !defined(RTEMS_NEWLIB) && !defined(RTEMS_UNIX)
-
-#include "libcsupport.h"
-#include "internal.h"
-
-#include <stdlib.h> /* for free() */
-
-void
-libc_init(int reentrant)
-{
-}
-
-void libc_suspend_main(void)
-{
-}
-
-
-void libc_global_exit(rtems_unsigned32 code)
-{
-}
-
-void _exit(int status)
-{
-}
-
-#else
-
-/* remove ANSI errors.
- * A program must contain at least one external-declaration
- * (X3.159-1989 p.82,L3).
- */
-void no_libc_dummy_function( void )
-{
-}
-
-#endif
diff --git a/cpukit/libcsupport/src/opendir.c b/cpukit/libcsupport/src/opendir.c
deleted file mode 100644
index e303eb28e5..0000000000
--- a/cpukit/libcsupport/src/opendir.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * opendir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <dirent.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-DIR *opendir(
- const char *name
-)
-{
- return NULL;
-}
diff --git a/cpukit/libcsupport/src/readdir.c b/cpukit/libcsupport/src/readdir.c
deleted file mode 100644
index d592a62b99..0000000000
--- a/cpukit/libcsupport/src/readdir.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * readdir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <dirent.h>
-
-struct dirent *readdir(
- register DIR *dirp
-)
-{
- return NULL;
-}
diff --git a/cpukit/libcsupport/src/rewinddir.c b/cpukit/libcsupport/src/rewinddir.c
deleted file mode 100644
index c85e6fd4d0..0000000000
--- a/cpukit/libcsupport/src/rewinddir.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * rewinddir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <assert.h>
-#include <dirent.h>
-#include <stdio.h>
-#include <errno.h>
-#include <unistd.h>
-
-void rewinddir(
- DIR *dirp
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/libcsupport/src/scandir.c b/cpukit/libcsupport/src/scandir.c
deleted file mode 100644
index 380415dd97..0000000000
--- a/cpukit/libcsupport/src/scandir.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * scandir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-int scandir(
- const char *dirname,
- struct dirent ***namelist,
- int (*select)(struct dirent *),
- int (*dcomp)(const void *, const void *)
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/libcsupport/src/seekdir.c b/cpukit/libcsupport/src/seekdir.c
deleted file mode 100644
index e591adbb9f..0000000000
--- a/cpukit/libcsupport/src/seekdir.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * seekdir() - POSIX 1003.1b - XXX
- *
- * $Id$
- */
-
-#include <sys/param.h>
-#include <assert.h>
-#include <dirent.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
-
-void seekdir(
- DIR *dirp,
- long loc
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/libcsupport/src/tcdrain.c b/cpukit/libcsupport/src/tcdrain.c
deleted file mode 100644
index 585871cc90..0000000000
--- a/cpukit/libcsupport/src/tcdrain.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file contains the RTEMS implementation of the POSIX API
- * routines tcdrain.
- *
- * $Id$
- *
- */
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-
-#include "internal.h"
-#include "libio.h"
-
-int
-tcdrain(int fd)
-{
- return __rtems_ioctl(fd,RTEMS_IO_TCDRAIN,0);
-}
-
-#endif
diff --git a/cpukit/libcsupport/src/telldir.c b/cpukit/libcsupport/src/telldir.c
deleted file mode 100644
index eee8d925ec..0000000000
--- a/cpukit/libcsupport/src/telldir.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * telldir() - XXX
- *
- * $Id$
- */
-
-#include <sys/param.h>
-#include <assert.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <rtems.h>
-#include "libio.h"
-
-long telldir(
- DIR *dirp
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c
deleted file mode 100644
index c2a43c7707..0000000000
--- a/cpukit/libcsupport/src/termios.c
+++ /dev/null
@@ -1,935 +0,0 @@
-/*
- * TERMIOS serial line support
- *
- * Author:
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * The license and distribution terms 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.h>
-#include <rtems/libio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <termios.h>
-#include <unistd.h>
-
-/*
- * FreeBSD does not support a full POSIX termios so we have to help it out
- */
-
-
-#if defined(__FreeBSD__)
-#define XTABS 0
-#define ONLRET 0
-#define ONOCR 0
-#define TABDLY 0
-#define OLCUC 0
-#define ILCUC 0
-#define OCRNL 0
-#define IUCLC 0
-#endif
-
-/*
- * The size of the cooked buffer
- */
-#define CBUFSIZE 256
-
-/*
- * The sizes of the raw message buffers.
- * On most architectures it is quite a bit more
- * efficient if these are powers of two.
- */
-#define RAW_INPUT_BUFFER_SIZE 128
-#define RAW_OUTPUT_BUFFER_SIZE 64
-
-/*
- * Variables associated with each termios instance.
- * One structure for each hardware I/O device.
- */
-struct rtems_termios_tty {
- /*
- * Linked-list of active TERMIOS devices
- */
- struct rtems_termios_tty *forw;
- struct rtems_termios_tty *back;
-
- /*
- * How many times has this device been opened
- */
- int refcount;
-
- /*
- * This device
- */
- rtems_device_major_number major;
- rtems_device_major_number minor;
-
- /*
- * Mutual-exclusion semaphores
- */
- rtems_id isem;
- rtems_id osem;
-
- /*
- * The canonical (cooked) character buffer
- */
- char cbuf[CBUFSIZE];
- int ccount;
- int cindex;
-
- /*
- * Keep track of cursor (printhead) position
- */
- int column;
- int read_start_column;
-
- /*
- * The ioctl settings
- */
- struct termios termios;
- rtems_interval vtimeTicks;
-
- /*
- * Raw input character buffer
- */
- volatile char rawInBuf[RAW_INPUT_BUFFER_SIZE];
- volatile unsigned int rawInBufHead;
- volatile unsigned int rawInBufTail;
- rtems_id rawInBufSemaphore;
- rtems_unsigned32 rawInBufSemaphoreOptions;
- rtems_interval rawInBufSemaphoreTimeout;
- rtems_interval rawInBufSemaphoreFirstTimeout;
- unsigned int rawInBufDropped; /* Statistics */
-
- /*
- * Raw output character buffer
- */
- volatile char rawOutBuf[RAW_OUTPUT_BUFFER_SIZE];
- volatile unsigned int rawOutBufHead;
- volatile unsigned int rawOutBufTail;
- rtems_id rawOutBufSemaphore;
- enum {rob_idle, rob_busy, rob_wait } rawOutBufState;
-
- /*
- * Callbacks to device-specific routines
- */
- rtems_termios_callbacks device;
-};
-
-static struct rtems_termios_tty *ttyHead, *ttyTail;
-static rtems_id ttyMutex;
-
-/*
- * Reserve enough resources to open every physical device once.
- */
-
-static int first_time; /* assumed to be zeroed by BSS initialization */
-
-void
-rtems_termios_reserve_resources (
- rtems_configuration_table *configuration,
- rtems_unsigned32 number_of_devices
- )
-{
- rtems_api_configuration_table *rtems_config;
-
- if (!configuration)
- rtems_fatal_error_occurred (0xFFF0F001);
- rtems_config = configuration->RTEMS_api_configuration;
- if (!rtems_config)
- rtems_fatal_error_occurred (0xFFF0F002);
- if (!first_time)
- rtems_config->maximum_semaphores += 1;
- first_time = 1;
- rtems_config->maximum_semaphores += (4 * number_of_devices);
-}
-
-void
-rtems_termios_initialize (void)
-{
- rtems_status_code sc;
-
- /*
- * Create the mutex semaphore for the tty list
- */
- if (!ttyMutex) {
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'm', 'i'),
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &ttyMutex);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- }
-}
-
-/*
- * Open a termios device
- */
-rtems_status_code
-rtems_termios_open (
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg,
- const rtems_termios_callbacks *callbacks
- )
-{
- rtems_status_code sc;
- rtems_libio_open_close_args_t *args = arg;
- struct rtems_termios_tty *tty;
-
- /*
- * See if the device has already been opened
- */
- sc = rtems_semaphore_obtain (ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- for (tty = ttyHead ; tty != NULL ; tty = tty->forw) {
- if ((tty->major == major) && (tty->minor == minor))
- break;
- }
- if (tty == NULL) {
- static char c = 'a';
-
- /*
- * Create a new device
- */
- tty = calloc (1, sizeof (struct rtems_termios_tty));
- if (tty == NULL) {
- rtems_semaphore_release (ttyMutex);
- return RTEMS_NO_MEMORY;
- }
- tty->forw = ttyHead;
- ttyHead = tty;
- if (ttyTail == NULL)
- ttyTail = tty;
-
- tty->minor = minor;
- tty->major = major;
-
- /*
- * Set up mutex semaphores
- */
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'i', c),
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &tty->isem);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'o', c),
- 1,
- RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &tty->osem);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'x', c),
- 0,
- RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &tty->rawOutBufSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- tty->rawOutBufState = rob_idle;
-
- /*
- * Set callbacks
- */
- tty->device = *callbacks;
- if (!tty->device.pollRead) {
- sc = rtems_semaphore_create (
- rtems_build_name ('T', 'R', 'r', c),
- 0,
- RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY,
- RTEMS_NO_PRIORITY,
- &tty->rawInBufSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- }
-
- /*
- * Set default parameters
- */
- tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
- tty->termios.c_oflag = OPOST | ONLCR | XTABS;
- tty->termios.c_cflag = B9600 | CS8 | CREAD;
- tty->termios.c_lflag = ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
- tty->termios.c_cc[VINTR] = '\003';
- tty->termios.c_cc[VQUIT] = '\034';
- tty->termios.c_cc[VERASE] = '\177';
- tty->termios.c_cc[VKILL] = '\025';
- tty->termios.c_cc[VEOF] = '\004';
- tty->termios.c_cc[VEOL] = '\000';
- tty->termios.c_cc[VEOL2] = '\000';
- tty->termios.c_cc[VSTART] = '\021';
- tty->termios.c_cc[VSTOP] = '\023';
- tty->termios.c_cc[VSUSP] = '\032';
- tty->termios.c_cc[VREPRINT] = '\022';
- tty->termios.c_cc[VDISCARD] = '\017';
- tty->termios.c_cc[VWERASE] = '\027';
- tty->termios.c_cc[VLNEXT] = '\026';
-
- /*
- * Bump name characer
- */
- if (c++ == 'z')
- c = 'a';
- }
- args->iop->data1 = tty;
- if (!tty->refcount++ && tty->device.firstOpen)
- (*tty->device.firstOpen)(major, minor, arg);
- rtems_semaphore_release (ttyMutex);
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Drain output queue
- */
-static void
-drainOutput (struct rtems_termios_tty *tty)
-{
- rtems_interrupt_level level;
- rtems_status_code sc;
-
- if (tty->device.outputUsesInterrupts) {
- rtems_interrupt_disable (level);
- while (tty->rawOutBufTail != tty->rawOutBufHead) {
- tty->rawOutBufState = rob_wait;
- rtems_interrupt_enable (level);
- sc = rtems_semaphore_obtain (tty->rawOutBufSemaphore,
- RTEMS_WAIT,
- RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- rtems_interrupt_disable (level);
- }
- rtems_interrupt_enable (level);
- }
-}
-
-rtems_status_code
-rtems_termios_close (void *arg)
-{
- rtems_libio_open_close_args_t *args = arg;
- struct rtems_termios_tty *tty = args->iop->data1;
- rtems_status_code sc;
-
- sc = rtems_semaphore_obtain (ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- if (--tty->refcount == 0) {
- drainOutput (tty);
- if (tty->device.lastClose)
- (*tty->device.lastClose)(tty->major, tty->minor, arg);
- if (tty->forw == NULL)
- ttyTail = tty->back;
- else
- tty->forw->back = tty->back;
- if (tty->back == NULL)
- ttyHead = tty->forw;
- else
- tty->back->forw = tty->forw;
- rtems_semaphore_delete (tty->isem);
- rtems_semaphore_delete (tty->osem);
- rtems_semaphore_delete (tty->rawOutBufSemaphore);
- if (!tty->device.pollRead)
- rtems_semaphore_delete (tty->rawInBufSemaphore);
- free (tty);
- }
- rtems_semaphore_release (ttyMutex);
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_status_code
-rtems_termios_ioctl (void *arg)
-{
- rtems_libio_ioctl_args_t *args = arg;
- struct rtems_termios_tty *tty = args->iop->data1;
- rtems_status_code sc;
-
- args->ioctl_return = 0;
- sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL) {
- args->ioctl_return = sc;
- return sc;
- }
- switch (args->command) {
- default:
- sc = RTEMS_INVALID_NUMBER;
- break;
-
- case RTEMS_IO_GET_ATTRIBUTES:
- *(struct termios *)args->buffer = tty->termios;
- break;
-
- case RTEMS_IO_SET_ATTRIBUTES:
- tty->termios = *(struct termios *)args->buffer;
- if (tty->termios.c_lflag & ICANON) {
- tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
- tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
- tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
- }
- else {
- rtems_interval ticksPerSecond;
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond);
- tty->vtimeTicks = tty->termios.c_cc[VTIME] * ticksPerSecond / 10;
- if (tty->termios.c_cc[VTIME]) {
- tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
- tty->rawInBufSemaphoreTimeout = tty->vtimeTicks;
- if (tty->termios.c_cc[VMIN])
- tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
- else
- tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
- }
- else {
- if (tty->termios.c_cc[VMIN]) {
- tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
- tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
- tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
- }
- else {
- tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
- }
- }
- }
- if (tty->device.setAttributes)
- (*tty->device.setAttributes)(tty->minor, &tty->termios);
- break;
-
- case RTEMS_IO_TCDRAIN:
- drainOutput (tty);
- break;
- }
- rtems_semaphore_release (tty->osem);
- args->ioctl_return = sc;
- return sc;
-}
-
-/*
- * Send characters to device-specific code
- */
-static void
-osend (const char *buf, int len, struct rtems_termios_tty *tty)
-{
- unsigned int newHead;
- rtems_interrupt_level level;
- rtems_status_code sc;
-
- if (!tty->device.outputUsesInterrupts) {
- (*tty->device.write)(tty->minor, buf, len);
- return;
- }
- newHead = tty->rawOutBufHead;
- while (len) {
- /*
- * Performance improvement could be made here.
- * Copy multiple bytes to raw buffer:
- * if (len > 1) && (space to buffer end, or tail > 1)
- * ncopy = MIN (len, space to buffer end or tail)
- * memcpy (raw buffer, buf, ncopy)
- * buf += ncopy
- * len -= ncopy
- *
- * To minimize latency, the memcpy should be done
- * with interrupts enabled.
- */
- newHead = (newHead + 1) % RAW_OUTPUT_BUFFER_SIZE;
- rtems_interrupt_disable (level);
- while (newHead == tty->rawOutBufTail) {
- tty->rawOutBufState = rob_wait;
- rtems_interrupt_enable (level);
- sc = rtems_semaphore_obtain (tty->rawOutBufSemaphore,
- RTEMS_WAIT,
- RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred (sc);
- rtems_interrupt_disable (level);
- }
- tty->rawOutBuf[tty->rawOutBufHead] = *buf++;
- tty->rawOutBufHead = newHead;
- if (tty->rawOutBufState == rob_idle) {
- (*tty->device.write)(tty->minor,
- (char *)&tty->rawOutBuf[tty->rawOutBufTail], 1);
- tty->rawOutBufState = rob_busy;
- }
- rtems_interrupt_enable (level);
- len--;
- }
-}
-
-/*
- * Handle output processing
- */
-static void
-oproc (unsigned char c, struct rtems_termios_tty *tty)
-{
- int i;
-
- if (tty->termios.c_oflag & OPOST) {
- switch (c) {
- case '\n':
- if (tty->termios.c_oflag & ONLRET)
- tty->column = 0;
- if (tty->termios.c_oflag & ONLCR) {
- osend ("\r", 1, tty);
- tty->column = 0;
- }
- break;
-
- case '\r':
- if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0))
- return;
- if (tty->termios.c_oflag & OCRNL) {
- c = '\n';
- if (tty->termios.c_oflag & ONLRET)
- tty->column = 0;
- break;
- }
- tty->column = 0;
- break;
-
- case '\t':
- i = 8 - (tty->column & 7);
- if ((tty->termios.c_oflag & TABDLY) == XTABS) {
- tty->column += i;
- osend ( " ", i, tty);
- return;
- }
- tty->column += i;
- break;
-
- case '\b':
- if (tty->column > 0)
- tty->column--;
- break;
-
- default:
- if (tty->termios.c_oflag & OLCUC)
- c = toupper(c);
- if (!iscntrl(c))
- tty->column++;
- break;
- }
- }
- osend (&c, 1, tty);
-}
-
-rtems_status_code
-rtems_termios_write (void *arg)
-{
- rtems_libio_rw_args_t *args = arg;
- struct rtems_termios_tty *tty = args->iop->data1;
- rtems_status_code sc;
-
- sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- if (tty->termios.c_oflag & OPOST) {
- unsigned32 count = args->count;
- unsigned8 *buffer = args->buffer;
- while (count--)
- oproc (*buffer++, tty);
- args->bytes_moved = args->count;
- }
- else {
- osend (args->buffer, args->count, tty);
- args->bytes_moved = args->count;
- }
- rtems_semaphore_release (tty->osem);
- return sc;
-}
-
-/*
- * Echo a typed character
- */
-static void
-echo (unsigned char c, struct rtems_termios_tty *tty)
-{
- if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) {
- char echobuf[2];
-
- echobuf[0] = '^';
- echobuf[1] = c ^ 0x40;
- osend (echobuf, 2, tty);
- tty->column += 2;
- }
- else {
- oproc (c, tty);
- }
-}
-
-/*
- * Erase a character or line
- * FIXME: Needs support for WERASE and ECHOPRT.
- * FIXME: Some of the tests should check for IEXTEN, too.
- */
-static void
-erase (struct rtems_termios_tty *tty, int lineFlag)
-{
- if (tty->ccount == 0)
- return;
- if (lineFlag) {
- if (!(tty->termios.c_lflag & ECHO)) {
- tty->ccount = 0;
- return;
- }
- if (!(tty->termios.c_lflag & ECHOE)) {
- tty->ccount = 0;
- echo (tty->termios.c_cc[VKILL], tty);
- if (tty->termios.c_lflag & ECHOK)
- echo ('\n', tty);
- return;
- }
- }
- while (tty->ccount) {
- unsigned char c = tty->cbuf[--tty->ccount];
-
- if (tty->termios.c_lflag & ECHO) {
- if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
- echo (tty->termios.c_cc[VERASE], tty);
- }
- else if (c == '\t') {
- int col = tty->read_start_column;
- int i = 0;
-
- /*
- * Find the character before the tab
- */
- while (i != tty->ccount) {
- c = tty->cbuf[i++];
- if (c == '\t') {
- col = (col | 7) + 1;
- }
- else if (iscntrl (c)) {
- if (tty->termios.c_lflag & ECHOCTL)
- col += 2;
- }
- else {
- col++;
- }
- }
-
- /*
- * Back up over the tab
- */
- while (tty->column > col) {
- osend ("\b", 1, tty);
- tty->column--;
- }
- }
- else {
- if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) {
- osend ("\b \b", 3, tty);
- if (tty->column)
- tty->column--;
- }
- if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) {
- osend ("\b \b", 3, tty);
- if (tty->column)
- tty->column--;
- }
- }
- }
- if (!lineFlag)
- break;
- }
-}
-
-/*
- * Process a single input character
- */
-static int
-iproc (unsigned char c, struct rtems_termios_tty *tty)
-{
- if (tty->termios.c_iflag & ISTRIP)
- c &= 0x7f;
- if (tty->termios.c_iflag & IUCLC)
- c = tolower (c);
- if (c == '\r') {
- if (tty->termios.c_iflag & IGNCR)
- return 0;
- if (tty->termios.c_iflag & ICRNL)
- c = '\n';
- }
- else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
- c = '\r';
- }
- if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
- if (c == tty->termios.c_cc[VERASE]) {
- erase (tty, 0);
- return 0;
- }
- else if (c == tty->termios.c_cc[VKILL]) {
- erase (tty, 1);
- return 0;
- }
- else if (c == tty->termios.c_cc[VEOF]) {
- return 1;
- }
- else if (c == '\n') {
- if (tty->termios.c_lflag & (ECHO | ECHONL))
- echo (c, tty);
- tty->cbuf[tty->ccount++] = c;
- return 1;
- }
- else if ((c == tty->termios.c_cc[VEOL])
- || (c == tty->termios.c_cc[VEOL2])) {
- if (tty->termios.c_lflag & ECHO)
- echo (c, tty);
- tty->cbuf[tty->ccount++] = c;
- return 1;
- }
- }
-
- /*
- * FIXME: Should do IMAXBEL handling somehow
- */
- if (tty->ccount < (CBUFSIZE-1)) {
- if (tty->termios.c_lflag & ECHO)
- echo (c, tty);
- tty->cbuf[tty->ccount++] = c;
- }
- return 0;
-}
-
-/*
- * Process input character, with semaphore.
- */
-static int
-siproc (unsigned char c, struct rtems_termios_tty *tty)
-{
- int i;
-
- /*
- * Obtain output semaphore if character will be echoed
- */
- if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) {
- rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- i = iproc (c, tty);
- rtems_semaphore_release (tty->osem);
- }
- else {
- i = iproc (c, tty);
- }
- return i;
-}
-
-/*
- * Fill the input buffer by polling the device
- */
-static rtems_status_code
-fillBufferPoll (struct rtems_termios_tty *tty)
-{
- int n;
-
- if (tty->termios.c_lflag & ICANON) {
- for (;;) {
- n = (*tty->device.pollRead)(tty->minor);
- if (n < 0) {
- rtems_task_wake_after (1);
- }
- else {
- if (siproc (n, tty))
- break;
- }
- }
- }
- else {
- rtems_interval then, now;
- if (!tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then);
- for (;;) {
- n = (*tty->device.pollRead)(tty->minor);
- if (n < 0) {
- if (tty->termios.c_cc[VMIN]) {
- if (tty->termios.c_cc[VTIME] && tty->ccount) {
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- if ((now - then) > tty->vtimeTicks) {
- break;
- }
- }
- }
- else {
- if (!tty->termios.c_cc[VTIME])
- break;
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- if ((now - then) > tty->vtimeTicks) {
- break;
- }
- }
- rtems_task_wake_after (1);
- }
- else {
- siproc (n, tty);
- if (tty->ccount >= tty->termios.c_cc[VMIN])
- break;
- if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then);
- }
- }
- }
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Fill the input buffer from the raw input queue
- */
-static rtems_status_code
-fillBufferQueue (struct rtems_termios_tty *tty)
-{
- rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout;
- rtems_status_code sc;
-
- for (;;) {
- /*
- * Process characters read from raw queue
- */
- while (tty->rawInBufHead != tty->rawInBufTail) {
- unsigned char c;
- unsigned int newHead;
-
- newHead = (tty->rawInBufHead + 1) % RAW_INPUT_BUFFER_SIZE;
- c = tty->rawInBuf[newHead];
- tty->rawInBufHead = newHead;
- if (tty->termios.c_lflag & ICANON) {
- if (siproc (c, tty))
- return RTEMS_SUCCESSFUL;
- }
- else {
- siproc (c, tty);
- if (tty->ccount >= tty->termios.c_cc[VMIN])
- return RTEMS_SUCCESSFUL;
- }
- timeout = tty->rawInBufSemaphoreTimeout;
- }
-
- /*
- * Wait for characters
- */
- sc = rtems_semaphore_obtain (tty->rawInBufSemaphore,
- tty->rawInBufSemaphoreOptions,
- timeout);
- if (sc != RTEMS_SUCCESSFUL)
- break;
- }
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_status_code
-rtems_termios_read (void *arg)
-{
- rtems_libio_rw_args_t *args = arg;
- struct rtems_termios_tty *tty = args->iop->data1;
- unsigned32 count = args->count;
- unsigned8 *buffer = args->buffer;
- rtems_status_code sc;
-
- sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- if (tty->cindex == tty->ccount) {
- tty->cindex = tty->ccount = 0;
- tty->read_start_column = tty->column;
- if (tty->device.pollRead)
- sc = fillBufferPoll (tty);
- else
- sc = fillBufferQueue (tty);
- if (sc != RTEMS_SUCCESSFUL)
- tty->cindex = tty->ccount = 0;
- }
- while (count && (tty->cindex < tty->ccount)) {
- *buffer++ = tty->cbuf[tty->cindex++];
- count--;
- }
- args->bytes_moved = args->count - count;
- rtems_semaphore_release (tty->isem);
- return sc;
-}
-
-/*
- * Place characters on raw queue.
- * NOTE: This routine runs in the context of the
- * device receive interrupt handler.
- * Returns the number of characters dropped because of overlow.
- */
-int
-rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len)
-{
- struct rtems_termios_tty *tty = ttyp;
- unsigned int newTail;
-
- while (len) {
- newTail = (tty->rawInBufTail + 1) % RAW_INPUT_BUFFER_SIZE;
- if (newTail == tty->rawInBufHead) {
- tty->rawInBufDropped += len;
- break;
- }
- tty->rawInBuf[newTail] = *buf++;
- len--;
- tty->rawInBufTail = newTail;
- }
- rtems_semaphore_release (tty->rawInBufSemaphore);
- return len;
-}
-
-/*
- * Characters have been transmitted
- * NOTE: This routine runs in the context of the
- * device transmit interrupt handler.
- * The second argument is the number of characters transmitted so far.
- * This value will always be 1 for devices which generate an interrupt
- * for each transmitted character.
- * It returns number of characters left to transmit
- */
-int
-rtems_termios_dequeue_characters (void *ttyp, int len)
-{
- struct rtems_termios_tty *tty = ttyp;
- unsigned int newTail;
- int nToSend;
-
- if (tty->rawOutBufState == rob_wait)
- rtems_semaphore_release (tty->rawOutBufSemaphore);
- if ( tty->rawOutBufHead == tty->rawOutBufTail )
- return 0;
- newTail = (tty->rawOutBufTail + len) % RAW_OUTPUT_BUFFER_SIZE;
- if (newTail == tty->rawOutBufHead) {
- /*
- * Buffer empty
- */
- tty->rawOutBufState = rob_idle;
- nToSend = 0;
- }
- else {
- /*
- * Buffer not empty, start tranmitter
- */
- if (newTail > tty->rawOutBufHead)
- nToSend = RAW_OUTPUT_BUFFER_SIZE - newTail;
- else
- nToSend = tty->rawOutBufHead - newTail;
- (*tty->device.write)(tty->minor, (char *)&tty->rawOutBuf[newTail], nToSend);
- tty->rawOutBufState = rob_busy;
- }
- tty->rawOutBufTail = newTail;
-
- return nToSend;
-}
-
-
diff --git a/cpukit/libcsupport/src/unixlibc.c b/cpukit/libcsupport/src/unixlibc.c
deleted file mode 100644
index 3e757e313d..0000000000
--- a/cpukit/libcsupport/src/unixlibc.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-
-#if defined(RTEMS_UNIXLIB)
-
-void libc_init(int reentrant)
-{
-}
-
-#else
-
-/* remove ANSI errors.
- * A program must contain at least one external-declaration
- * (X3.159-1989 p.82,L3).
- */
-void unixlibc_dummy_function( void )
-{
-}
-
-#endif
diff --git a/cpukit/libcsupport/src/utsname.c b/cpukit/libcsupport/src/utsname.c
deleted file mode 100644
index 7fba3d610f..0000000000
--- a/cpukit/libcsupport/src/utsname.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * $Id$
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <sys/utsname.h>
-
-#include <rtems/system.h>
-#include <rtems/score/system.h>
-#include <rtems/score/object.h>
-
-/*PAGE
- *
- * 4.4.1 Get System Name, P1003.1b-1993, p. 90
- */
-
-int uname(
- struct utsname *name
-)
-{
- /* XXX: Here is what Solaris returns...
- sysname = SunOS
- nodename = node_name
- release = 5.3
- version = Generic_101318-12
- machine = sun4m
- */
-
- strcpy( name->sysname, "RTEMS" );
-
- sprintf( name->nodename, "Node %d\n", _Objects_Local_node );
-
- /* XXX release string is in BAD format for this routine!!! */
- strcpy( name->release, "3.2.0" );
-
- /* XXX does this have any meaning for RTEMS */
-
- strcpy( name->release, "" );
-
- sprintf( name->machine, "%s/%s", CPU_NAME, CPU_MODEL_NAME );
-
- return 0;
-}
-
-/*PAGE
- *
- * 4.5.2 Get Process Times, P1003.1b-1993, p. 92
- */
-
-clock_t times(
- struct tms *buffer
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
diff --git a/cpukit/libmisc/README b/cpukit/libmisc/README
deleted file mode 100644
index bbde4feeae..0000000000
--- a/cpukit/libmisc/README
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# $Id$
-#
-
-This directory contains for the "miscellaneous" library. Currently
-this library contains a number of useful support libraries:
-
- + Task Stack Overflow Checker
- + Workspace Consistency Checker
- + Task Execution Time Monitor
- + Period Statistics Monitor
- + Debug Monitor
-
-The following ideas have been mentioned for items which could go
-in this library, but this list is not all inclusive:
-
- + there are no outstanding suggestions.
-
-The intent of this library is to provide a home for useful utility routines
-which are dependent upon RTEMS.
-
---joel
-16 Sept 97
diff --git a/cpukit/libmisc/cpuuse/README b/cpukit/libmisc/cpuuse/README
deleted file mode 100644
index 20e76f07bc..0000000000
--- a/cpukit/libmisc/cpuuse/README
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# $Id$
-#
-
-This directory contains a stack bounds checker. It provides two
-primary features:
-
- + check for stack overflow at each context switch
- + provides an educated guess at each task's stack usage
-
-The stack overflow check at context switch works by looking for
-a 16 byte pattern at the logical end of the stack to be corrupted.
-The "guesser" assumes that the entire stack was prefilled with a known
-pattern and assumes that the pattern is still in place if the memory
-has not been used as a stack.
-
-Both of these can be fooled by pushing large holes onto the stack
-and not writing to them... or (much more unlikely) writing the
-magic patterns into memory.
-
-This code has not been extensively tested. It is provided as a tool
-for RTEMS users to catch the most common mistake in multitasking
-systems ... too little stack space. Suggestions and comments are appreciated.
-
-NOTES:
-
-1. Stack usage information is questionable on CPUs which push
- large holes on stack.
-
-2. The stack checker has a tendency to generate a fault when
- trying to print the helpful diagnostic message. If it comes
- out, congratulations. If not, then the variable Stack_check_Blown_task
- contains a pointer to the TCB of the offending task. This
- is usually enough to go on.
-
-FUTURE:
-
-1. Determine how/if gcc will generate stack probe calls and support that.
-
-2. Get accurate stack usage numbers on i960.. it pushes very large
- holes on the stack.
diff --git a/cpukit/libmisc/cpuuse/cpuuse.c b/cpukit/libmisc/cpuuse/cpuuse.c
deleted file mode 100644
index db43fbf3ee..0000000000
--- a/cpukit/libmisc/cpuuse/cpuuse.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * CPU Usage Reporter
- *
- * COPYRIGHT (c) 1989-1998. 1996.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-extern rtems_configuration_table BSP_Configuration;
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "cpuuse.h"
-
-unsigned32 CPU_usage_Ticks_at_last_reset;
-
-/*PAGE
- *
- * CPU_usage_Dump
- */
-
-void CPU_usage_Dump( void )
-{
- unsigned32 i;
- unsigned32 class_index;
- Thread_Control *the_thread;
- Objects_Information *information;
- unsigned32 u32_name;
- char name[5];
- unsigned32 total_units = 0;
-
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
-
- if ( the_thread )
- total_units += the_thread->ticks_executed;
- }
- }
- }
-
- printf("CPU Usage by thread\n");
-#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
- printf( " ID NAME TICKS PERCENT\n" );
-#else
- printf( " ID NAME TICKS\n" );
-#endif
-
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
-
- if ( !the_thread )
- continue;
-
- u32_name = *(unsigned32 *)the_thread->Object.name;
-
- name[ 0 ] = (u32_name >> 24) & 0xff;
- name[ 1 ] = (u32_name >> 16) & 0xff;
- name[ 2 ] = (u32_name >> 8) & 0xff;
- name[ 3 ] = (u32_name >> 0) & 0xff;
- name[ 4 ] = '\0';
-
-#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
- printf( "0x%08x %4s %8d %5.3f\n",
- the_thread->Object.id,
- name,
- the_thread->ticks_executed,
- (total_units) ?
- (double)the_thread->ticks_executed / (double)total_units :
- (double)total_units
- );
-#else
- printf( "0x%08x %4s %8d\n",
- the_thread->Object.id,
- name,
- the_thread->ticks_executed
- );
-#endif
- }
- }
- }
-
- printf(
- "\nTicks since last reset = %d\n",
- _Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset
- );
- printf( "\nTotal Units = %d\n", total_units );
-}
-
-/*PAGE
- *
- * CPU_usage_Reset
- */
-
-void CPU_usage_Reset( void )
-{
- unsigned32 i;
- unsigned32 class_index;
- Thread_Control *the_thread;
- Objects_Information *information;
-
- CPU_usage_Ticks_at_last_reset = _Watchdog_Ticks_since_boot;
-
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
-
- if ( !the_thread )
- continue;
-
- the_thread->ticks_executed = 0;
- }
- }
- }
-
-}
-
diff --git a/cpukit/libmisc/cpuuse/cpuuse.h b/cpukit/libmisc/cpuuse/cpuuse.h
deleted file mode 100644
index bc678bb284..0000000000
--- a/cpukit/libmisc/cpuuse/cpuuse.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* cpuuse.h
- *
- * This include file contains information necessary to utilize
- * and install the cpu usage reporting mechanism.
- *
- * COPYRIGHT (c) 1989-1998. 1996.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_USE_h
-#define __CPU_USE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * CPU_usage_Dump
- */
-
-void CPU_usage_Dump( void );
-
-/*
- * CPU_usage_Reset
- */
-
-void CPU_usage_Reset( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/libmisc/monitor/README b/cpukit/libmisc/monitor/README
deleted file mode 100644
index d5a73da140..0000000000
--- a/cpukit/libmisc/monitor/README
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# $Id$
-#
-
-monitor task
-
-The monitor task is an optional task that knows about RTEMS
-data structures and can print out information about them.
-It is a work-in-progress and needs many more commands, but
-is useful now.
-
-The monitor works best when it is the highest priority task,
-so all your other tasks should ideally be at some priority
-greater than 1.
-
-To use the monitor:
--------------------
-
- #include <rtems/monitor.h>
-
- ...
-
- rtems_monitor_init(0);
-
- The parameter to rtems_monitor_init() tells the monitor whether
- to suspend itself on startup. A value of 0 causes the monitor
- to immediately enter command mode; a non-zero value causes the
- monitor to suspend itself after creation and wait for explicit
- wakeup.
-
-
- rtems_monitor_wakeup();
-
- wakes up a suspended monitor and causes it to reenter command mode.
-
-Monitor commands
-----------------
-
- The monitor prompt is 'rtems> '.
- Can abbreviate commands to "uniquity"
- There is a 'help' command. Here is the output from various
- help commands:
-
- Commands (may be abbreviated)
-
- help -- get this message or command specific help
- task -- show task information
- queue -- show message queue information
- symbol -- show entries from symbol table
- pause -- pause monitor for a specified number of ticks
- fatal -- invoke a fatal RTEMS error
-
- task [id [id ...] ]
- display information about the specified tasks.
- Default is to display information about all tasks on this node
-
- queue [id [id ... ] ]
- display information about the specified message queues
- Default is to display information about all queues on this node
-
- symbol [ symbolname [symbolname ... ] ]
- display value associated with specified symbol.
- Defaults to displaying all known symbols.
-
- pause [ticks]
- monitor goes to "sleep" for specified ticks (default is 1)
- monitor will resume at end of period or if explicitly awakened
-
- fatal [status]
- Invoke 'rtems_fatal_error_occurred' with 'status'
- (default is RTEMS_INTERNAL_ERROR)
-
- continue
- put the monitor to sleep waiting for an explicit wakeup from the
- program running.
-
-
-Sample output from 'task' command
----------------------------------
-
- rtems> task
- ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES
- ------------------------------------------------------------------------
- 00010001 UI1 2 READY P:T:nA NONE15: 0x40606348
- 00010002 RMON 1 READY nP NONE15: 0x40604110
-
- 'RMON' is the monitor itself, so we have 1 "user" task.
- Its modes are P:T:nA which translate to:
-
- preemptable
- timesliced
- no ASRS
-
- It has no events.
- It has a notepad value for notepad 15 which is 0x40606348
- (this is the libc thread state)
-
diff --git a/cpukit/libmisc/monitor/mon-command.c b/cpukit/libmisc/monitor/mon-command.c
deleted file mode 100644
index 1fe495e0ae..0000000000
--- a/cpukit/libmisc/monitor/mon-command.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Command parsing routines for RTEMS monitor
- *
- * TODO:
- *
- * $Id$
- */
-
-#include <rtems.h>
-
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <string.h>
-
-/*
- * make_argv(cp): token-count
- * Break up the command line in 'cp' into global argv[] and argc (return
- * value).
- */
-
-int
-rtems_monitor_make_argv(
- char *cp,
- int *argc_p,
- char **argv)
-{
- int argc = 0;
-
- while ((cp = strtok(cp, " \t\n\r")))
- {
- argv[argc++] = cp;
- cp = (char *) NULL;
- }
- argv[argc] = (char *) NULL; /* end of argv */
-
- return *argc_p = argc;
-}
-
-
-/*
- * Read and break up a monitor command
- *
- * We have to loop on the gets call, since it will return NULL under UNIX
- * RTEMS when we get a signal (eg: SIGALRM).
- */
-
-int
-rtems_monitor_command_read(char *command,
- int *argc,
- char **argv)
-{
- extern rtems_configuration_table BSP_Configuration;
- static char monitor_prompt[32];
-
- /*
- * put node number in the prompt if we are multiprocessing
- */
-
- if (BSP_Configuration.User_multiprocessing_table == 0)
- sprintf(monitor_prompt, "%s", MONITOR_PROMPT);
- else if (rtems_monitor_default_node != rtems_monitor_node)
- sprintf(monitor_prompt, "%d-%s-%d", rtems_monitor_node, MONITOR_PROMPT, rtems_monitor_default_node);
- else
- sprintf(monitor_prompt, "%d-%s", rtems_monitor_node, MONITOR_PROMPT);
-
-#ifdef RTEMS_UNIX
- /* RTEMS on unix gets so many interrupt system calls this is hosed */
- printf("%s> ", monitor_prompt);
- fflush(stdout);
- while (gets(command) == (char *) 0)
- ;
-#else
- do
- {
- printf("%s> ", monitor_prompt);
- fflush(stdout);
- } while (gets(command) == (char *) 0);
-#endif
-
- return rtems_monitor_make_argv(command, argc, argv);
-}
-
-/*
- * Look up a command in a command table
- *
- */
-
-rtems_monitor_command_entry_t *
-rtems_monitor_command_lookup(
- rtems_monitor_command_entry_t *table,
- int argc,
- char **argv
-)
-{
- rtems_monitor_command_entry_t *p;
- rtems_monitor_command_entry_t *abbreviated_match = 0;
- int abbreviated_matches = 0;
- char *command;
- int command_length;
-
- command = argv[0];
-
- if ((table == 0) || (command == 0))
- goto failed;
-
- command_length = strlen(command);
-
- for (p = table; p->command; p++)
- if (STREQ(command, p->command)) /* exact match */
- goto done;
- else if (STRNEQ(command, p->command, command_length))
- {
- abbreviated_matches++;
- abbreviated_match = p;
- }
-
- /* no perfect match; is there a non-ambigous abbreviated match? */
- if ( ! abbreviated_match)
- {
- printf("Unrecognized command '%s'; try 'help'\n", command);
- goto failed;
- }
-
- if (abbreviated_matches > 1)
- {
- printf("Command '%s' is ambiguous; try 'help'\n", command);
- goto failed;
- }
-
- p = abbreviated_match;
-
-done:
- if (p->command_function == 0)
- goto failed;
- return p;
-
-failed:
- return 0;
-}
-
-void
-rtems_monitor_command_usage(rtems_monitor_command_entry_t *table,
- char *command_string)
-{
- rtems_monitor_command_entry_t *help = 0;
- char *help_command_argv[2];
-
- /* if first entry in table is a usage, then print it out */
- if (command_string == 0)
- {
- if (STREQ(table->command, "--usage--") && table->usage)
- help = table;
- }
- else
- {
- help_command_argv[0] = command_string;
- help_command_argv[1] = 0;
- help = rtems_monitor_command_lookup(table, 1, help_command_argv);
- }
-
- if (help)
- printf("%s\n", help->usage);
-}
-
-
-void
-rtems_monitor_help_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- int arg;
- rtems_monitor_command_entry_t *command;
-
- command = (rtems_monitor_command_entry_t *) command_arg;
-
- if (argc == 1)
- rtems_monitor_command_usage(command, 0);
- else
- {
- for (arg=1; argv[arg]; arg++)
- rtems_monitor_command_usage(command, argv[arg]);
- }
-}
diff --git a/cpukit/libmisc/monitor/mon-config.c b/cpukit/libmisc/monitor/mon-config.c
deleted file mode 100644
index 5efd480b14..0000000000
--- a/cpukit/libmisc/monitor/mon-config.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * RTEMS Config display support
- *
- * TODO
- *
- * $Id$
- */
-
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-
-#define DATACOL 15
-#define CONTCOL DATACOL /* continued col */
-
-/*
- * Fill in entire monitor config table
- * for sending to a remote monitor or printing on the local system
- */
-
-void
-rtems_monitor_config_canonical(
- rtems_monitor_config_t *canonical_config,
- void *config_void
-)
-{
- rtems_configuration_table *c = (rtems_configuration_table *) config_void;
- rtems_api_configuration_table *r = c->RTEMS_api_configuration;
-
- canonical_config->work_space_start = c->work_space_start;
- canonical_config->work_space_size = c->work_space_size;
- canonical_config->maximum_tasks = r->maximum_tasks;
- canonical_config->maximum_timers = r->maximum_timers;
- canonical_config->maximum_semaphores = r->maximum_semaphores;
- canonical_config->maximum_message_queues = r->maximum_message_queues;
- canonical_config->maximum_partitions = r->maximum_partitions;
- canonical_config->maximum_regions = r->maximum_regions;
- canonical_config->maximum_ports = r->maximum_ports;
- canonical_config->maximum_periods = r->maximum_periods;
- canonical_config->maximum_extensions = c->maximum_extensions;
- canonical_config->microseconds_per_tick = c->microseconds_per_tick;
- canonical_config->ticks_per_timeslice = c->ticks_per_timeslice;
- canonical_config->number_of_initialization_tasks = r->number_of_initialization_tasks;
-}
-
-/*
- * This is easy, since there is only 1 (altho we could get them from
- * other nodes...)
- */
-
-void *
-rtems_monitor_config_next(
- void *object_info,
- rtems_monitor_config_t *canonical_config,
- rtems_id *next_id
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- int n = rtems_get_index(*next_id);
-
- if (n >= 1)
- goto failed;
-
- _Thread_Disable_dispatch();
-
- *next_id += 1;
- return (void *) c;
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-
-void
-rtems_monitor_config_dump_header(
- boolean verbose
-)
-{
- printf("\
-INITIAL (startup) Configuration Info\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-
-void
-rtems_monitor_config_dump(
- rtems_monitor_config_t *monitor_config,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length = 0;
- length += printf("WORKSPACE");
- length += rtems_monitor_pad(DATACOL, length);
- length += printf("start: 0x%x; size: 0x%x\n",
- (unsigned32) monitor_config->work_space_start,
- monitor_config->work_space_size);
-
- length = 0;
- length += printf("TIME");
- length += rtems_monitor_pad(DATACOL, length);
- length += printf("usec/tick: %d; tick/timeslice: %d; tick/sec: %d\n",
- monitor_config->microseconds_per_tick,
- monitor_config->ticks_per_timeslice,
- 1000000 / monitor_config->microseconds_per_tick);
-
- length = 0;
- length += printf("MAXIMUMS");
- length += rtems_monitor_pad(DATACOL, length);
- length += printf("tasks: %d; timers: %d; sems: %d; que's: %d; ext's: %d\n",
- monitor_config->maximum_tasks,
- monitor_config->maximum_timers,
- monitor_config->maximum_semaphores,
- monitor_config->maximum_message_queues,
- monitor_config->maximum_extensions);
- length = 0;
- length += rtems_monitor_pad(CONTCOL, length);
- length += printf("partitions: %d; regions: %d; ports: %d; periods: %d\n",
- monitor_config->maximum_partitions,
- monitor_config->maximum_regions,
- monitor_config->maximum_ports,
- monitor_config->maximum_periods);
-}
diff --git a/cpukit/libmisc/monitor/mon-dname.c b/cpukit/libmisc/monitor/mon-dname.c
deleted file mode 100644
index 45c28342ff..0000000000
--- a/cpukit/libmisc/monitor/mon-dname.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * RTEMS monitor driver names support.
- *
- * There are 2 "driver" things the monitor knows about.
- *
- * 1. Regular RTEMS drivers.
- * This is a table indexed by major device number and
- * containing driver entry points only.
- *
- * 2. Driver name table.
- * A separate table of names for drivers.
- * The table converts driver names to a major number
- * as index into the driver table and a minor number
- * for an argument to driver.
- *
- * Drivers are displayed with 'driver' command.
- * Names are displayed with 'dname' command.
- *
- * $Id$
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-#include <string.h> /* strncpy() */
-
-#define DATACOL 15
-#define CONTCOL DATACOL /* continued col */
-
-void
-rtems_monitor_dname_canonical(
- rtems_monitor_dname_t *canonical_dname,
- void *dname_void
-)
-{
- rtems_driver_name_t *np = (rtems_driver_name_t *) dname_void;
-
- (void) strncpy(canonical_dname->name_string, np->device_name, sizeof(canonical_dname->name_string));
- canonical_dname->major = np->major;
- canonical_dname->minor = np->minor;
-}
-
-void *
-rtems_monitor_dname_next(
- void *object_information,
- rtems_monitor_dname_t *canonical_dname,
- rtems_id *next_id
-)
-{
- rtems_unsigned32 n = rtems_get_index(*next_id);
- rtems_driver_name_t *table = _IO_Driver_name_table;
- rtems_driver_name_t *np = 0;
-
-/* XXX should we be using _IO_Number_of_devices */
- for (np = table + n ; n<_IO_Number_of_devices; n++, np++)
- if (np->device_name)
- goto done;
-
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-
-done:
- _Thread_Disable_dispatch();
-
- /*
- * dummy up a fake id and name for this item
- */
-
- canonical_dname->id = n;
- canonical_dname->name = rtems_build_name('-', '-', '-', '-');
-
- *next_id += 1;
- return np;
-}
-
-void
-rtems_monitor_dname_dump_header(
- boolean verbose
-)
-{
- printf("\
- Major:Minor Name\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-void
-rtems_monitor_dname_dump(
- rtems_monitor_dname_t *monitor_dname,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += rtems_monitor_pad(6, length);
- length += rtems_monitor_dump_hex(monitor_dname->major);
- length += printf(":");
- length += rtems_monitor_dump_hex(monitor_dname->minor);
-
- length += rtems_monitor_pad(16, length);
- length += printf("%.*s",
- (int) sizeof(monitor_dname->name_string),
- (char *) monitor_dname->name_string);
-
- length += printf("\n");
- length = 0;
-}
diff --git a/cpukit/libmisc/monitor/mon-driver.c b/cpukit/libmisc/monitor/mon-driver.c
deleted file mode 100644
index c8eb36ab4e..0000000000
--- a/cpukit/libmisc/monitor/mon-driver.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * RTEMS monitor IO (device drivers) support
- *
- * There are 2 "driver" things the monitor knows about.
- *
- * 1. Regular RTEMS drivers.
- * This is a table indexed by major device number and
- * containing driver entry points only.
- *
- * 2. Driver name table.
- * A separate table of names for drivers.
- * The table converts driver names to a major number
- * as index into the driver table and a minor number
- * for an argument to driver.
- *
- * Drivers are displayed with 'driver' command.
- * Names are displayed with 'name' command.
- *
- * $Id$
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-
-#define DATACOL 15
-#define CONTCOL DATACOL /* continued col */
-
-
-void
-rtems_monitor_driver_canonical(
- rtems_monitor_driver_t *canonical_driver,
- void *driver_void
-)
-{
- rtems_driver_address_table *d = (rtems_driver_address_table *) driver_void;
-
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->initialization,
- (void *) d->initialization);
-
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->open,
- (void *) d->open);
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->close,
- (void *) d->close);
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->read,
- (void *) d->read);
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->write,
- (void *) d->write);
- rtems_monitor_symbol_canonical_by_value(&canonical_driver->control,
- (void *) d->control);
-}
-
-
-void *
-rtems_monitor_driver_next(
- void *object_info,
- rtems_monitor_driver_t *canonical_driver,
- rtems_id *next_id
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- rtems_unsigned32 n = rtems_get_index(*next_id);
-
- if (n >= c->number_of_device_drivers)
- goto failed;
-
- _Thread_Disable_dispatch();
-
- /*
- * dummy up a fake id and name for this item
- */
-
- canonical_driver->id = n;
- canonical_driver->name = rtems_build_name('-', '-', '-', '-');
-
- *next_id += 1;
- return (void *) (c->Device_driver_table + n);
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-
-void
-rtems_monitor_driver_dump_header(
- boolean verbose
-)
-{
- printf("\
- Major Entry points\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-void
-rtems_monitor_driver_dump(
- rtems_monitor_driver_t *monitor_driver,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += printf(" %d", monitor_driver->id);
-
- length += rtems_monitor_pad(13, length);
- length += printf("init: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->initialization, verbose);
- length += printf("; control: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->control, verbose);
- length += printf("\n");
- length = 0;
-
- length += rtems_monitor_pad(13, length);
-
- length += printf("open: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->open, verbose);
- length += printf("; close: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->close, verbose);
- length += printf("\n");
- length = 0;
-
- length += rtems_monitor_pad(13, length);
-
- length += printf("read: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->read, verbose);
- length += printf("; write: ");
- length += rtems_monitor_symbol_dump(&monitor_driver->write, verbose);
- length += printf("\n");
- length = 0;
-}
diff --git a/cpukit/libmisc/monitor/mon-extension.c b/cpukit/libmisc/monitor/mon-extension.c
deleted file mode 100644
index 107fd5184e..0000000000
--- a/cpukit/libmisc/monitor/mon-extension.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * RTEMS Monitor extension support
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-
-void
-rtems_monitor_extension_canonical(
- rtems_monitor_extension_t *canonical_extension,
- void *extension_void
-)
-{
- Extension_Control *rtems_extension = (Extension_Control *) extension_void;
- rtems_extensions_table *e = &rtems_extension->Extension.Callouts;
-
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_create,
- (void *) e->thread_create);
-
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_start,
- (void *) e->thread_start);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_restart,
- (void *) e->thread_restart);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_delete,
- (void *) e->thread_delete);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_tswitch,
- (void *) e->thread_switch);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_begin,
- (void *) e->thread_begin);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_exitted,
- (void *) e->thread_exitted);
- rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_fatal,
- (void *) e->fatal);
-}
-
-void
-rtems_monitor_extension_dump_header(
- boolean verbose
-)
-{
- printf("\
- ID NAME\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
-
- rtems_monitor_separator();
-}
-
-
-/*
- * Dump out the canonical form
- */
-
-void
-rtems_monitor_extension_dump(
- rtems_monitor_extension_t *monitor_extension,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += rtems_monitor_dump_id(monitor_extension->id);
- length += rtems_monitor_pad(11, length);
- length += rtems_monitor_dump_name(monitor_extension->name);
-
- length += rtems_monitor_pad(18, length);
- length += printf("create: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_create, verbose);
- length += printf("; start: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_start, verbose);
- length += printf("; restart: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_restart, verbose);
- length += printf("\n");
- length = 0;
-
- length += rtems_monitor_pad(18, length);
- length += printf("delete: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_delete, verbose);
- length += printf("; switch: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_tswitch, verbose);
- length += printf("; begin: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_begin, verbose);
- length += printf("\n");
- length = 0;
-
- length += rtems_monitor_pad(18, length);
- length += printf("exitted: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_exitted, verbose);
- length += printf("; fatal: ");
- length += rtems_monitor_symbol_dump(&monitor_extension->e_fatal, verbose);
- length += printf("\n");
- length = 0;
- printf("\n");
-}
diff --git a/cpukit/libmisc/monitor/mon-itask.c b/cpukit/libmisc/monitor/mon-itask.c
deleted file mode 100644
index 59a3a4f284..0000000000
--- a/cpukit/libmisc/monitor/mon-itask.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * RTEMS Monitor init task support
- *
- * $Id$
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-
-/*
- * As above, but just for init tasks
- */
-void
-rtems_monitor_init_task_canonical(
- rtems_monitor_init_task_t *canonical_itask,
- void *itask_void
-)
-{
- rtems_initialization_tasks_table *rtems_itask = itask_void;
-
- rtems_monitor_symbol_canonical_by_value(&canonical_itask->entry,
- (void *) rtems_itask->entry_point);
-
- canonical_itask->argument = rtems_itask->argument;
- canonical_itask->stack_size = rtems_itask->stack_size;
- canonical_itask->priority = rtems_itask->initial_priority;
- canonical_itask->modes = rtems_itask->mode_set;
- canonical_itask->attributes = rtems_itask->attribute_set;
-}
-
-void *
-rtems_monitor_init_task_next(
- void *object_info,
- rtems_monitor_init_task_t *canonical_init_task,
- rtems_id *next_id
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- rtems_initialization_tasks_table *itask;
- rtems_unsigned32 n = rtems_get_index(*next_id);
-
- if (n >= c->RTEMS_api_configuration->number_of_initialization_tasks)
- goto failed;
-
- _Thread_Disable_dispatch();
-
- itask = c->RTEMS_api_configuration->User_initialization_tasks_table + n;
-
- /*
- * dummy up a fake id and name for this item
- */
-
- canonical_init_task->id = n;
- canonical_init_task->name = itask->name;
-
- *next_id += 1;
- return (void *) itask;
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-
-void
-rtems_monitor_init_task_dump_header(
- boolean verbose
-)
-{
- printf("\
- # NAME ENTRY ARGUMENT PRIO MODES ATTRIBUTES STACK SIZE\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-/*
- */
-
-void
-rtems_monitor_init_task_dump(
- rtems_monitor_init_task_t *monitor_itask,
- boolean verbose
-)
-{
- int length = 0;
-
- length += rtems_monitor_dump_decimal(monitor_itask->id);
-
- length += rtems_monitor_pad(7, length);
- length += rtems_monitor_dump_name(monitor_itask->name);
-
- length += rtems_monitor_pad(14, length);
- length += rtems_monitor_symbol_dump(&monitor_itask->entry, verbose);
-
- length += rtems_monitor_pad(25, length);
- length += printf("%d [0x%x]", monitor_itask->argument, monitor_itask->argument);
-
- length += rtems_monitor_pad(39, length);
- length += rtems_monitor_dump_priority(monitor_itask->priority);
-
- length += rtems_monitor_pad(46, length);
- length += rtems_monitor_dump_modes(monitor_itask->modes);
-
- length += rtems_monitor_pad(54, length);
- length += rtems_monitor_dump_attributes(monitor_itask->attributes);
-
- length += rtems_monitor_pad(66, length);
- length += printf("%d [0x%x]", monitor_itask->stack_size, monitor_itask->stack_size);
-
- printf("\n");
-}
diff --git a/cpukit/libmisc/monitor/mon-manager.c b/cpukit/libmisc/monitor/mon-manager.c
deleted file mode 100644
index 497f0255a0..0000000000
--- a/cpukit/libmisc/monitor/mon-manager.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * RTEMS Monitor "manager" support.
- * Used to traverse object (chain) lists and print them out.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-
-/*
- * "next" routine for all objects that are RTEMS manager objects
- */
-
-void *
-rtems_monitor_manager_next(
- void *table_void,
- void *canonical,
- rtems_id *next_id
-)
-{
- Objects_Information *table = table_void;
- rtems_monitor_generic_t *copy;
- Objects_Control *object = 0;
- Objects_Locations location;
-
- /*
- * When we are called, it must be local
- */
-
- if ( ! _Objects_Is_local_id(*next_id))
- goto done;
-
- object = _Objects_Get_next(table, *next_id, &location, next_id);
-
- if (object)
- {
- copy = (rtems_monitor_generic_t *) canonical;
- copy->id = object->id;
- _Objects_Copy_name_raw(object->name, &copy->name, sizeof(copy->name));
- }
-
-done:
- return object;
-}
-
diff --git a/cpukit/libmisc/monitor/mon-monitor.c b/cpukit/libmisc/monitor/mon-monitor.c
deleted file mode 100644
index 289425d8e4..0000000000
--- a/cpukit/libmisc/monitor/mon-monitor.c
+++ /dev/null
@@ -1,518 +0,0 @@
-/*
- * RTEMS monitor main body
- *
- * TODO:
- * add stuff to RTEMS api
- * rtems_get_name(id)
- * rtems_get_type(id)
- * rtems_build_id(node, type, num)
- * Add a command to dump out info about an arbitrary id when
- * types are added to id's
- * rtems> id idnum
- * idnum: node n, object: whatever, id: whatever
- * allow id's to be specified as n:t:id, where 'n:t' is optional
- * should have a separate monitor FILE stream (ala the debugger)
- * remote request/response stuff should be cleaned up
- * maybe we can use real rpc??
- * 'info' command to print out:
- * interrupt stack location, direction and size
- * floating point config stuff
- * interrupt config stuff
- *
- * $Id$
- */
-
-#include <rtems.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <rtems/monitor.h>
-
-/* set by trap handler */
-extern rtems_tcb *debugger_interrupted_task;
-extern rtems_context *debugger_interrupted_task_context;
-extern rtems_unsigned32 debugger_trap;
-
-/*
- * Various id's for the monitor
- * They need to be public variables for access by other agencies
- * such as debugger and remote servers'
- */
-
-rtems_id rtems_monitor_task_id;
-
-unsigned32 rtems_monitor_node; /* our node number */
-unsigned32 rtems_monitor_default_node; /* current default for commands */
-
-/*
- * The rtems symbol table
- */
-
-rtems_symbol_table_t *rtems_monitor_symbols;
-
-/*
- * The top-level commands
- */
-
-rtems_monitor_command_entry_t rtems_monitor_commands[] = {
- { "--usage--",
- "\n"
- "RTEMS monitor\n"
- "\n"
- "Commands (may be abbreviated)\n"
- "\n"
- " help -- get this message or command specific help\n"
- " pause -- pause monitor for a specified number of ticks\n"
- " exit -- invoke a fatal RTEMS error\n"
- " symbol -- show entries from symbol table\n"
- " continue -- put monitor to sleep waiting for explicit wakeup\n"
- " config -- show system configuration\n"
- " itask -- list init tasks\n"
- " mpci -- list mpci config\n"
- " task -- show task information\n"
- " queue -- show message queue information\n"
- " extension -- user extensions\n"
- " driver -- show information about named drivers\n"
- " dname -- show information about named drivers\n"
- " object -- generic object information\n"
- " node -- specify default node for commands that take id's\n"
-#ifdef CPU_INVOKE_DEBUGGER
- " debugger -- invoke system debugger\n"
-#endif
- ,
- 0,
- 0,
- (unsigned32) rtems_monitor_commands,
- },
- { "config",
- "config\n"
- " Show the system configuration.\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_CONFIG,
- },
- { "itask",
- "itask\n"
- " List init tasks for the system\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_INIT_TASK,
- },
- { "mpci",
- "mpci\n"
- " Show the MPCI system configuration, if configured.\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_MPCI,
- },
- { "pause",
- "pause [ticks]\n"
- " monitor goes to \"sleep\" for specified ticks (default is 1)\n"
- " monitor will resume at end of period or if explicitly awakened\n",
- 0,
- rtems_monitor_pause_cmd,
- 0,
- },
- { "continue",
- "continue\n"
- " put the monitor to sleep waiting for an explicit wakeup from the\n"
- " program running.\n",
- 0,
- rtems_monitor_continue_cmd,
- 0,
- },
- { "go",
- "go\n"
- " Alias for 'continue'\n",
- 0,
- rtems_monitor_continue_cmd,
- 0,
- },
- { "node",
- "node [ node number ]\n"
- " Specify default node number for commands that take id's\n",
- 0,
- rtems_monitor_node_cmd,
- 0,
- },
- { "symbol",
- "symbol [ symbolname [symbolname ... ] ]\n"
- " display value associated with specified symbol.\n"
- " Defaults to displaying all known symbols.\n",
- 0,
- rtems_monitor_symbol_cmd,
- (unsigned32) &rtems_monitor_symbols,
- },
- { "extension",
- "extension [id [id ...] ]\n"
- " display information about specified extensions.\n"
- " Default is to display information about all extensions on this node\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_EXTENSION,
- },
- { "task",
- "task [id [id ...] ]\n"
- " display information about the specified tasks.\n"
- " Default is to display information about all tasks on this node\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_TASK,
- },
- { "queue",
- "queue [id [id ... ] ]\n"
- " display information about the specified message queues\n"
- " Default is to display information about all queues on this node\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_QUEUE,
- },
- { "object",
- "object [id [id ...] ]\n"
- " display information about specified RTEMS objects.\n"
- " Object id's must include 'type' information.\n"
- " (which may normally be defaulted)\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_INVALID,
- },
- { "driver",
- "driver [ major [ major ... ] ]\n"
- " Display the RTEMS device driver table.\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_DRIVER,
- },
- { "dname",
- "dname\n"
- " Displays information about named drivers.\n",
- 0,
- rtems_monitor_object_cmd,
- RTEMS_MONITOR_OBJECT_DNAME,
- },
- { "exit",
- "exit [status]\n"
- " Invoke 'rtems_fatal_error_occurred' with 'status'\n"
- " (default is RTEMS_SUCCESSFUL)\n",
- 0,
- rtems_monitor_fatal_cmd,
- RTEMS_SUCCESSFUL,
- },
- { "fatal",
- "fatal [status]\n"
- " 'exit' with fatal error; default error is RTEMS_TASK_EXITTED\n",
- 0,
- rtems_monitor_fatal_cmd,
- RTEMS_TASK_EXITTED, /* exit value */
- },
- { "quit",
- "quit [status]\n"
- " Alias for 'exit'\n",
- 0,
- rtems_monitor_fatal_cmd,
- RTEMS_SUCCESSFUL, /* exit value */
- },
- { "help",
- "help [ command [ command ] ]\n"
- " provide information about commands\n"
- " Default is show basic command summary.\n",
- 0,
- rtems_monitor_help_cmd,
- (unsigned32) rtems_monitor_commands,
- },
-#ifdef CPU_INVOKE_DEBUGGER
- { "debugger",
- "debugger\n"
- " Enter the debugger, if possible.\n"
- " A continue from the debugger will return to the monitor.\n",
- 0,
- rtems_monitor_debugger_cmd,
- 0,
- },
-#endif
- { 0, 0, 0, 0, 0 },
-};
-
-
-rtems_status_code
-rtems_monitor_suspend(rtems_interval timeout)
-{
- rtems_event_set event_set;
- rtems_status_code status;
-
- status = rtems_event_receive(MONITOR_WAKEUP_EVENT,
- RTEMS_DEFAULT_OPTIONS,
- timeout,
- &event_set);
- return status;
-}
-
-void
-rtems_monitor_wakeup(void)
-{
- rtems_status_code status;
-
- status = rtems_event_send(rtems_monitor_task_id, MONITOR_WAKEUP_EVENT);
-}
-
-void
-rtems_monitor_debugger_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
-#ifdef CPU_INVOKE_DEBUGGER
- CPU_INVOKE_DEBUGGER;
-#endif
-}
-
-void
-rtems_monitor_pause_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- if (argc == 1)
- rtems_monitor_suspend(1);
- else
- rtems_monitor_suspend(strtoul(argv[1], 0, 0));
-}
-
-void
-rtems_monitor_fatal_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- if (argc == 1)
- rtems_fatal_error_occurred(command_arg);
- else
- rtems_fatal_error_occurred(strtoul(argv[1], 0, 0));
-}
-
-void
-rtems_monitor_continue_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- rtems_monitor_suspend(RTEMS_NO_TIMEOUT);
-}
-
-void
-rtems_monitor_node_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- unsigned32 new_node = rtems_monitor_default_node;
-
- switch (argc)
- {
- case 1: /* no node, just set back to ours */
- new_node = rtems_monitor_node;
- break;
-
- case 2:
- new_node = strtoul(argv[1], 0, 0);
- break;
-
- default:
- printf("invalid syntax, try 'help node'\n");
- break;
- }
-
- if ((new_node >= 1) &&
- _Configuration_MP_table &&
- (new_node <= _Configuration_MP_table->maximum_nodes))
- rtems_monitor_default_node = new_node;
-}
-
-
-/*
- * Function: rtems_monitor_symbols_loadup
- *
- * Description:
- * Create and load the monitor's symbol table.
- * We are reading the output format of 'gnm' which looks like this:
- *
- * 400a7068 ? _Rate_monotonic_Information
- * 400a708c ? _Thread_Dispatch_disable_level
- * 400a7090 ? _Configuration_Table
- *
- * We ignore the type field.
- *
- * Side Effects:
- * Creates and fills in 'rtems_monitor_symbols' table
- *
- * TODO
- * there should be a BSP #define or something like that
- * to do this; Assuming stdio is crazy.
- * Someday this should know BFD
- * Maybe we could get objcopy to just copy the symbol areas
- * and copy that down.
- *
- */
-
-void
-rtems_monitor_symbols_loadup(void)
-{
- FILE *fp;
- char buffer[128];
-
- if (rtems_monitor_symbols)
- rtems_symbol_table_destroy(rtems_monitor_symbols);
-
- rtems_monitor_symbols = rtems_symbol_table_create(10);
- if (rtems_monitor_symbols == 0)
- return;
-
- fp = fopen("symbols", "r");
-
- if (fp == 0)
- return;
-
- while (fgets(buffer, sizeof(buffer) - 1, fp))
- {
- char *symbol;
- char *value;
- char *ignored_type;
-
- value = strtok(buffer, " \t\n");
- ignored_type = strtok(0, " \t\n");
- symbol = strtok(0, " \t\n");
-
- if (symbol && ignored_type && value)
- {
- rtems_symbol_t *sp;
- sp = rtems_symbol_create(rtems_monitor_symbols,
- symbol,
- (rtems_unsigned32) strtoul(value, 0, 16));
- if (sp == 0)
- {
- printf("could not define symbol '%s'\n", symbol);
- goto done;
- }
- }
- else
- {
- printf("parsing error on '%s'\n", buffer);
- goto done;
- }
- }
-
-done:
- return;
-}
-
-
-/*
- * Main monitor command loop
- */
-
-void
-rtems_monitor_task(
- rtems_task_argument monitor_flags
-)
-{
- rtems_tcb *debugee = 0;
- rtems_context *rp;
- rtems_context_fp *fp;
- char command_buffer[513];
- int argc;
- char *argv[64];
- boolean verbose = FALSE;
-
- if (monitor_flags & RTEMS_MONITOR_SUSPEND)
- (void) rtems_monitor_suspend(RTEMS_NO_TIMEOUT);
-
- for (;;)
- {
- extern rtems_tcb * _Thread_Executing;
- rtems_monitor_command_entry_t *command;
-
- debugee = _Thread_Executing;
- rp = &debugee->Registers;
- fp = (rtems_context_fp *) debugee->fp_context; /* possibly 0 */
-
- if (0 == rtems_monitor_command_read(command_buffer, &argc, argv))
- continue;
- if ((command = rtems_monitor_command_lookup(rtems_monitor_commands,
- argc,
- argv)) == 0)
- continue;
-
- command->command_function(argc, argv, command->command_arg, verbose);
-
- fflush(stdout);
- }
-}
-
-
-void
-rtems_monitor_kill(void)
-{
- if (rtems_monitor_task_id)
- rtems_task_delete(rtems_monitor_task_id);
- rtems_monitor_task_id = 0;
-
- rtems_monitor_server_kill();
-}
-
-void
-rtems_monitor_init(
- unsigned32 monitor_flags
-)
-{
- rtems_status_code status;
-
- rtems_monitor_kill();
-
- status = rtems_task_create(RTEMS_MONITOR_NAME,
- 1,
- RTEMS_MINIMUM_STACK_SIZE * 2,
- RTEMS_INTERRUPT_LEVEL(0),
- RTEMS_DEFAULT_ATTRIBUTES,
- &rtems_monitor_task_id);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not create monitor task");
- goto done;
- }
-
- rtems_monitor_node = rtems_get_node(rtems_monitor_task_id);
- rtems_monitor_default_node = rtems_monitor_node;
-
- rtems_monitor_symbols_loadup();
-
- if (monitor_flags & RTEMS_MONITOR_GLOBAL)
- rtems_monitor_server_init(monitor_flags);
-
- /*
- * Start the monitor task itself
- */
-
- status = rtems_task_start(rtems_monitor_task_id,
- rtems_monitor_task,
- monitor_flags);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not start monitor");
- goto done;
- }
-
-done:
-}
diff --git a/cpukit/libmisc/monitor/mon-mpci.c b/cpukit/libmisc/monitor/mon-mpci.c
deleted file mode 100644
index 5399f37555..0000000000
--- a/cpukit/libmisc/monitor/mon-mpci.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * RTEMS MPCI Config display support
- *
- * TODO
- *
- * $Id$
- */
-
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-
-#define DATACOL 15
-
-/*
- * Fill in entire monitor config table
- * for sending to a remote monitor or printing on the local system
- */
-
-void
-rtems_monitor_mpci_canonical(
- rtems_monitor_mpci_t *canonical_mpci,
- void *config_void
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- rtems_multiprocessing_table *m;
- rtems_mpci_table *mt;
-
- m = c->User_multiprocessing_table;
- if (m == 0)
- return;
- mt = m->User_mpci_table;
-
- canonical_mpci->node = m->node;
- canonical_mpci->maximum_nodes = m->maximum_nodes;
- canonical_mpci->maximum_global_objects = m->maximum_global_objects;
- canonical_mpci->maximum_proxies = m->maximum_proxies;
-
- canonical_mpci->default_timeout = mt->default_timeout;
- canonical_mpci->maximum_packet_size = mt->maximum_packet_size;
-
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->initialization,
- (void *) mt->initialization);
-
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->get_packet,
- (void *) mt->get_packet);
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->return_packet,
- (void *) mt->return_packet);
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->send_packet,
- (void *) mt->send_packet);
- rtems_monitor_symbol_canonical_by_value(&canonical_mpci->receive_packet,
- (void *) mt->receive_packet);
-}
-
-/*
- * This is easy, since there is only 1 (altho we could get them from
- * other nodes...)
- */
-
-void *
-rtems_monitor_mpci_next(
- void *object_info,
- rtems_monitor_mpci_t *canonical_mpci,
- rtems_id *next_id
-)
-{
- rtems_configuration_table *c = _Configuration_Table;
- int n = rtems_get_index(*next_id);
-
- if (n >= 1)
- goto failed;
-
- if ( ! c->User_multiprocessing_table)
- goto failed;
-
- _Thread_Disable_dispatch();
-
- *next_id += 1;
- return (void *) c;
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-
-void
-rtems_monitor_mpci_dump_header(
- boolean verbose
-)
-{
- printf("\
- max max max default max\n\
- node nodes globals proxies timeout pktsize\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
-
- rtems_monitor_separator();
-}
-
-
-void
-rtems_monitor_mpci_dump(
- rtems_monitor_mpci_t *monitor_mpci,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += rtems_monitor_pad(2, length);
- length += printf(" %d", monitor_mpci->node);
- length += rtems_monitor_pad(11, length);
- length += printf("%d", monitor_mpci->maximum_nodes);
-
- length += rtems_monitor_pad(18, length);
- length += rtems_monitor_dump_decimal(monitor_mpci->maximum_global_objects);
-
- length += rtems_monitor_pad(28, length);
- length += rtems_monitor_dump_decimal(monitor_mpci->maximum_proxies);
-
- length += rtems_monitor_pad(37, length);
- length += rtems_monitor_dump_decimal(monitor_mpci->default_timeout);
-
- length += rtems_monitor_pad(46, length);
- length += rtems_monitor_dump_decimal(monitor_mpci->maximum_packet_size);
-
- printf("\n");
- length = 0;
- length += rtems_monitor_pad(DATACOL, length);
-
- length += printf("init: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->initialization, verbose);
-
- printf("\n");
- length = 0;
- length += rtems_monitor_pad(DATACOL, length);
-
- length += printf("get: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->get_packet, verbose);
- length += printf("; return: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->return_packet, verbose);
-
- printf("\n");
- length = 0;
- length += rtems_monitor_pad(DATACOL, length);
-
- length += printf("send: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->send_packet, verbose);
- length += printf("; receive: ");
- length += rtems_monitor_symbol_dump(&monitor_mpci->receive_packet, verbose);
-
- printf("\n");
- length = 0;
-}
diff --git a/cpukit/libmisc/monitor/mon-object.c b/cpukit/libmisc/monitor/mon-object.c
deleted file mode 100644
index 8d5a9c395f..0000000000
--- a/cpukit/libmisc/monitor/mon-object.c
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * RTEMS Monitor "object" support.
- *
- * Used to traverse object lists and print them out.
- * An object can be an RTEMS object (chain based stuff) or
- * a "misc" object such as a device driver.
- *
- * Each object has its own file in this directory (eg: extension.c)
- * That file provides routines to convert a "native" structure
- * to its canonical form, print a canonical structure, etc.
- *
- * TODO:
- * should allow for non-numeric id's???
- *
- * $Id$
- */
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <stdlib.h> /* strtoul() */
-#include <string.h> /* memcpy() */
-
-#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
-
-/*
- * add:
- * next
- */
-
-rtems_monitor_object_info_t rtems_monitor_object_info[] =
-{
- { RTEMS_MONITOR_OBJECT_CONFIG,
- (void *) 0,
- sizeof(rtems_monitor_config_t),
- (rtems_monitor_object_next_fn) rtems_monitor_config_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_config_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_config_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_config_dump,
- },
- { RTEMS_MONITOR_OBJECT_MPCI,
- (void *) 0,
- sizeof(rtems_monitor_mpci_t),
- (rtems_monitor_object_next_fn) rtems_monitor_mpci_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_mpci_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_mpci_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_mpci_dump,
- },
- { RTEMS_MONITOR_OBJECT_INIT_TASK,
- (void *) 0,
- sizeof(rtems_monitor_init_task_t),
- (rtems_monitor_object_next_fn) rtems_monitor_init_task_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_init_task_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_init_task_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_init_task_dump,
- },
- { RTEMS_MONITOR_OBJECT_TASK,
- (void *) &_RTEMS_tasks_Information,
- sizeof(rtems_monitor_task_t),
- (rtems_monitor_object_next_fn) rtems_monitor_manager_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_task_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_task_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_task_dump,
- },
- { RTEMS_MONITOR_OBJECT_QUEUE,
- (void *) &_Message_queue_Information,
- sizeof(rtems_monitor_queue_t),
- (rtems_monitor_object_next_fn) rtems_monitor_manager_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_queue_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_queue_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_queue_dump,
- },
- { RTEMS_MONITOR_OBJECT_EXTENSION,
- (void *) &_Extension_Information,
- sizeof(rtems_monitor_extension_t),
- (rtems_monitor_object_next_fn) rtems_monitor_manager_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_extension_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_extension_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_extension_dump,
- },
- { RTEMS_MONITOR_OBJECT_DRIVER,
- (void *) 0,
- sizeof(rtems_monitor_driver_t),
- (rtems_monitor_object_next_fn) rtems_monitor_driver_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_driver_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_driver_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_driver_dump,
- },
- { RTEMS_MONITOR_OBJECT_DNAME,
- /* XXX now that the driver name table is allocated from the */
- /* XXX Workspace, this does not work */
- (void *) 0,
- /* (void *) _IO_Driver_name_table, */
- sizeof(rtems_monitor_dname_t),
- (rtems_monitor_object_next_fn) rtems_monitor_dname_next,
- (rtems_monitor_object_canonical_fn) rtems_monitor_dname_canonical,
- (rtems_monitor_object_dump_header_fn) rtems_monitor_dname_dump_header,
- (rtems_monitor_object_dump_fn) rtems_monitor_dname_dump,
- },
-};
-
-/*
- * Allow id's to be specified without the node number or
- * type for convenience.
- */
-
-rtems_id
-rtems_monitor_id_fixup(
- rtems_id id,
- unsigned32 default_node,
- rtems_monitor_object_type_t type
-)
-{
- unsigned32 node;
-
- node = rtems_get_node(id);
- if (node == 0)
- {
- if (rtems_get_class(id) != OBJECTS_NO_CLASS)
- type = rtems_get_class(id);
-
- id = _Objects_Build_id(type, default_node, rtems_get_index(id));
- }
- return id;
-}
-
-
-rtems_monitor_object_info_t *
-rtems_monitor_object_lookup(
- rtems_monitor_object_type_t type
-)
-{
- rtems_monitor_object_info_t *p;
- for (p = &rtems_monitor_object_info[0];
- p < &rtems_monitor_object_info[NUMELEMS(rtems_monitor_object_info)];
- p++)
- {
- if (p->type == type)
- return p;
- }
- return 0;
-}
-
-rtems_id
-rtems_monitor_object_canonical_next_remote(
- rtems_monitor_object_type_t type,
- rtems_id id,
- void *canonical
-)
-{
- rtems_id next_id;
- rtems_status_code status;
- rtems_monitor_server_request_t request;
- rtems_monitor_server_response_t response;
-
- /*
- * Send request
- */
-
- request.command = RTEMS_MONITOR_SERVER_CANONICAL;
- request.argument0 = (unsigned32) type;
- request.argument1 = (unsigned32) id;
-
- status = rtems_monitor_server_request(rtems_get_node(id), &request, &response);
- if (status != RTEMS_SUCCESSFUL)
- goto failed;
-
- /*
- * process response
- */
-
- next_id = (rtems_id) response.result0;
- if (next_id != RTEMS_OBJECT_ID_FINAL)
- (void) memcpy(canonical, &response.payload, response.result1);
-
- return next_id;
-
-failed:
- return RTEMS_OBJECT_ID_FINAL;
-
-}
-
-
-rtems_id
-rtems_monitor_object_canonical_next(
- rtems_monitor_object_info_t *info,
- rtems_id id,
- void *canonical
-)
-{
- rtems_id next_id;
- void *raw_item;
-
- if ( ! _Objects_Is_local_id(id))
- next_id = rtems_monitor_object_canonical_next_remote(info->type,
- id,
- canonical);
- else
- {
- next_id = id;
-
- raw_item = (void *) info->next(info->object_information,
- canonical,
- &next_id);
-
- if (raw_item)
- {
- info->canonical(canonical, raw_item);
- _Thread_Enable_dispatch();
- }
- }
- return next_id;
-}
-
-
-/*
- * this is routine server invokes locally to get the type
- */
-
-rtems_id
-rtems_monitor_object_canonical_get(
- rtems_monitor_object_type_t type,
- rtems_id id,
- void *canonical,
- unsigned32 *size_p
-)
-{
- rtems_monitor_object_info_t *info;
- rtems_id next_id;
-
- *size_p = 0;
-
- info = rtems_monitor_object_lookup(type);
-
- if (info == 0)
- return RTEMS_OBJECT_ID_FINAL;
-
- next_id = rtems_monitor_object_canonical_next(info, id, canonical);
- *size_p = info->size;
-
- return next_id;
-}
-
-
-void
-rtems_monitor_object_dump_1(
- rtems_monitor_object_info_t *info,
- rtems_id id,
- boolean verbose
-)
-{
- rtems_id next_id;
- rtems_monitor_union_t canonical;
-
- if ((next_id = rtems_monitor_object_canonical_next(
- info,
- id,
- &canonical)) != RTEMS_OBJECT_ID_FINAL)
- {
- /*
- * If the one we actually got is the one we wanted, then
- * print it out.
- * For ones that have an id field, this works fine,
- * for all others, always dump it out.
- *
- * HACK: the way we determine whether there is an id is a hack.
- *
- * by the way: the reason we try to not have an id, is that some
- * of the canonical structures are almost too big for shared
- * memory driver (eg: mpci)
- */
-
- if ((info->next != rtems_monitor_manager_next) ||
- (id == canonical.generic.id))
- info->dump(&canonical, verbose);
- }
-}
-
-void
-rtems_monitor_object_dump_all(
- rtems_monitor_object_info_t *info,
- boolean verbose
-)
-{
- rtems_id next_id;
- rtems_monitor_union_t canonical;
-
- next_id = RTEMS_OBJECT_ID_INITIAL(info->type, rtems_monitor_default_node);
-
- while ((next_id = rtems_monitor_object_canonical_next(
- info,
- next_id,
- &canonical)) != RTEMS_OBJECT_ID_FINAL)
- {
- info->dump(&canonical, verbose);
- }
-}
-
-void
-rtems_monitor_object_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- int arg;
- rtems_monitor_object_info_t *info = 0;
- rtems_monitor_object_type_t type = (rtems_monitor_object_type_t) command_arg;
-
- /* what is the default type? */
- type = (rtems_monitor_object_type_t) command_arg;
-
- if (argc == 1)
- {
- if (type == RTEMS_MONITOR_OBJECT_INVALID)
- {
- printf("A type must be specified to \"dump all\"\n");
- goto done;
- }
-
- info = rtems_monitor_object_lookup(type);
- if (info == 0)
- goto not_found;
-
- if (info->dump_header)
- info->dump_header(verbose);
- rtems_monitor_object_dump_all(info, verbose);
- }
- else
- {
- unsigned32 default_node = rtems_monitor_default_node;
- rtems_monitor_object_type_t last_type = RTEMS_MONITOR_OBJECT_INVALID;
- rtems_id id;
-
- for (arg=1; argv[arg]; arg++)
- {
- id = (rtems_id) strtoul(argv[arg], 0, 16);
- id = rtems_monitor_id_fixup(id, default_node, type);
- type = (rtems_monitor_object_type_t) rtems_get_class(id);
-
- /*
- * Allow the item type to change in the middle
- * of the command. If the type changes, then
- * just dump out a new header and keep on going.
- */
- if (type != last_type)
- {
- info = rtems_monitor_object_lookup(type);
- if (info == 0)
- goto not_found;
-
- if (info->dump_header)
- info->dump_header(verbose);
- }
-
- if (info == 0)
- {
-not_found: printf("Invalid or unsupported type %d\n", type);
- goto done;
- }
-
- rtems_monitor_object_dump_1(info, id, verbose);
-
- default_node = rtems_get_node(id);
-
- last_type = type;
- }
- }
-done:
- return;
-}
diff --git a/cpukit/libmisc/monitor/mon-prmisc.c b/cpukit/libmisc/monitor/mon-prmisc.c
deleted file mode 100644
index ce9aa9a554..0000000000
--- a/cpukit/libmisc/monitor/mon-prmisc.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Print misc stuff for the monitor dump routines
- * Each routine returns the number of characters it output.
- *
- * TODO:
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <rtems/assoc.h>
-
-#include <stdio.h>
-#include <ctype.h>
-
-void
-rtems_monitor_separator(void)
-{
- printf("------------------------------------------------------------------------------\n");
-}
-
-unsigned32
-rtems_monitor_pad(
- unsigned32 destination_column,
- unsigned32 current_column
-)
-{
- int pad_length;
-
- if (destination_column <= current_column)
- pad_length = 1;
- else
- pad_length = destination_column - current_column;
-
- return printf("%*s", pad_length, "");
-}
-
-unsigned32
-rtems_monitor_dump_char(rtems_unsigned8 ch)
-{
- if (isprint(ch))
- return printf("%c", ch);
- else
- return printf("%02x", ch);
-}
-
-unsigned32
-rtems_monitor_dump_decimal(unsigned32 num)
-{
- return printf("%4d", num);
-}
-
-unsigned32
-rtems_monitor_dump_hex(unsigned32 num)
-{
- return printf("0x%x", num);
-}
-
-unsigned32
-rtems_monitor_dump_assoc_bitfield(
- rtems_assoc_t *ap,
- char *separator,
- unsigned32 value
- )
-{
- unsigned32 b;
- unsigned32 length = 0;
- const char *name;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (length)
- length += printf("%s", separator);
-
- name = rtems_assoc_name_by_local(ap, b);
-
- if (name)
- length += printf("%s", name);
- else
- length += printf("0x%x", b);
- }
-
- return length;
-}
-
-unsigned32
-rtems_monitor_dump_id(rtems_id id)
-{
- return printf("%08x", id);
-}
-
-unsigned32
-rtems_monitor_dump_name(rtems_name name)
-{
- unsigned32 i;
- unsigned32 length = 0;
- union {
- unsigned32 ui;
- char c[4];
- } u;
-
- u.ui = (rtems_unsigned32) name;
-
-#if (CPU_BIG_ENDIAN == TRUE)
- for (i=0; i<sizeof(u.c); i++)
- length += rtems_monitor_dump_char(u.c[i]);
-#else
- for (i=sizeof(u.c)-1; i ; i--)
- length += rtems_monitor_dump_char(u.c[i]);
-#endif
- return length;
-}
-
-unsigned32
-rtems_monitor_dump_priority(rtems_task_priority priority)
-{
- return printf("%3d", priority);
-}
-
-
-rtems_assoc_t rtems_monitor_state_assoc[] = {
- { "DORM", STATES_DORMANT },
- { "SUSP", STATES_SUSPENDED },
- { "TRANS", STATES_TRANSIENT },
- { "DELAY", STATES_DELAYING },
- { "Wbuf", STATES_WAITING_FOR_BUFFER },
- { "Wseg", STATES_WAITING_FOR_SEGMENT },
- { "Wmsg" , STATES_WAITING_FOR_MESSAGE },
- { "Wevnt", STATES_WAITING_FOR_EVENT },
- { "Wsem", STATES_WAITING_FOR_SEMAPHORE },
- { "Wtime", STATES_WAITING_FOR_TIME },
- { "Wrpc", STATES_WAITING_FOR_RPC_REPLY },
- { "WRATE", STATES_WAITING_FOR_PERIOD },
- { 0, 0, 0 },
-};
-
-unsigned32
-rtems_monitor_dump_state(States_Control state)
-{
- unsigned32 length = 0;
-
- if (state == STATES_READY) /* assoc doesn't deal with this as it is 0 */
- length += printf("READY");
-
- length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_state_assoc,
- ":",
- state);
- return length;
-}
-
-rtems_assoc_t rtems_monitor_attribute_assoc[] = {
- { "FL", RTEMS_FLOATING_POINT },
- { "GL", RTEMS_GLOBAL },
- { "PR", RTEMS_PRIORITY },
- { "BI", RTEMS_BINARY_SEMAPHORE },
- { "IN", RTEMS_INHERIT_PRIORITY },
- { 0, 0, 0 },
-};
-
-unsigned32
-rtems_monitor_dump_attributes(rtems_attribute attributes)
-{
- unsigned32 length = 0;
-
- if (attributes == RTEMS_DEFAULT_ATTRIBUTES) /* value is 0 */
- length += printf("DEFAULT");
-
- length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_attribute_assoc,
- ":",
- attributes);
- return length;
-}
-
-rtems_assoc_t rtems_monitor_modes_assoc[] = {
- { "nP", RTEMS_NO_PREEMPT },
- { "T", RTEMS_TIMESLICE },
- { "nA", RTEMS_NO_ASR },
- { 0, 0, 0 },
-};
-
-unsigned32
-rtems_monitor_dump_modes(rtems_mode modes)
-{
- unsigned32 length = 0;
-
- if (modes == RTEMS_DEFAULT_MODES) /* value is 0 */
- length += printf("P:T:nA");
-
- length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_modes_assoc,
- ":",
- modes);
- return length;
-}
-
-rtems_assoc_t rtems_monitor_events_assoc[] = {
- { "0", RTEMS_EVENT_0 },
- { "1", RTEMS_EVENT_1 },
- { "2", RTEMS_EVENT_2 },
- { "3", RTEMS_EVENT_3 },
- { "4", RTEMS_EVENT_4 },
- { "5", RTEMS_EVENT_5 },
- { "6", RTEMS_EVENT_6 },
- { "7", RTEMS_EVENT_7 },
- { "8", RTEMS_EVENT_8 },
- { "9", RTEMS_EVENT_9 },
- { "10", RTEMS_EVENT_10 },
- { "11", RTEMS_EVENT_11 },
- { "12", RTEMS_EVENT_12 },
- { "13", RTEMS_EVENT_13 },
- { "14", RTEMS_EVENT_14 },
- { "15", RTEMS_EVENT_15 },
- { "16", RTEMS_EVENT_16 },
- { "17", RTEMS_EVENT_17 },
- { "18", RTEMS_EVENT_18 },
- { "19", RTEMS_EVENT_19 },
- { "20", RTEMS_EVENT_20 },
- { "21", RTEMS_EVENT_21 },
- { "22", RTEMS_EVENT_22 },
- { "23", RTEMS_EVENT_23 },
- { "24", RTEMS_EVENT_24 },
- { "25", RTEMS_EVENT_25 },
- { "26", RTEMS_EVENT_26 },
- { "27", RTEMS_EVENT_27 },
- { "28", RTEMS_EVENT_28 },
- { "29", RTEMS_EVENT_29 },
- { "30", RTEMS_EVENT_30 },
- { "31", RTEMS_EVENT_31 },
- { 0, 0, 0 },
-};
-
-unsigned32
-rtems_monitor_dump_events(rtems_event_set events)
-{
- unsigned32 length = 0;
-
- if (events == EVENT_SETS_NONE_PENDING) /* value is 0 */
- length += printf("NONE");
-
- length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_events_assoc,
- ":",
- events);
- return length;
-}
-
-unsigned32
-rtems_monitor_dump_notepad(unsigned32 *notepad)
-{
- unsigned32 length = 0;
- int i;
-
- for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++)
- if (notepad[i])
- length += printf("%d: 0x%x ", i, notepad[i]);
-
- return length;
-}
diff --git a/cpukit/libmisc/monitor/mon-queue.c b/cpukit/libmisc/monitor/mon-queue.c
deleted file mode 100644
index b165062e28..0000000000
--- a/cpukit/libmisc/monitor/mon-queue.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-
-void
-rtems_monitor_queue_canonical(
- rtems_monitor_queue_t *canonical_queue,
- void *queue_void
-)
-{
- Message_queue_Control *rtems_queue = (Message_queue_Control *) queue_void;
-
- canonical_queue->attributes = rtems_queue->attribute_set;
- canonical_queue->maximum_message_size = rtems_queue->message_queue.maximum_message_size;
- canonical_queue->maximum_pending_messages = rtems_queue->message_queue.maximum_pending_messages;
- canonical_queue->number_of_pending_messages = rtems_queue->message_queue.number_of_pending_messages;
-}
-
-void
-rtems_monitor_queue_dump_header(
- boolean verbose
-)
-{
- printf("\
- ID NAME ATTRIBUTES PEND MAXPEND MAXSIZE\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
- rtems_monitor_separator();
-}
-
-
-/*
- * Dump out the "next" queue indicated by 'id'.
- * Returns next one to check.
- * Returns RTEMS_OBJECT_ID_FINAL when all done
- */
-
-void
-rtems_monitor_queue_dump(
- rtems_monitor_queue_t *monitor_queue,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- length += rtems_monitor_dump_id(monitor_queue->id);
- length += rtems_monitor_pad(11, length);
- length += rtems_monitor_dump_name(monitor_queue->name);
- length += rtems_monitor_pad(19, length);
- length += rtems_monitor_dump_attributes(monitor_queue->attributes);
- length += rtems_monitor_pad(31, length);
- length += rtems_monitor_dump_decimal(monitor_queue->number_of_pending_messages);
- length += rtems_monitor_pad(39, length);
- length += rtems_monitor_dump_decimal(monitor_queue->maximum_pending_messages);
- length += rtems_monitor_pad(48, length);
- length += rtems_monitor_dump_decimal(monitor_queue->maximum_message_size);
-
- printf("\n");
-}
diff --git a/cpukit/libmisc/monitor/mon-server.c b/cpukit/libmisc/monitor/mon-server.c
deleted file mode 100644
index 3ae56058d3..0000000000
--- a/cpukit/libmisc/monitor/mon-server.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * RTEMS monitor server (handles requests for info from RTEMS monitors
- * running on other nodes)
- *
- * $Id$
- */
-
-#include <rtems.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <rtems/monitor.h>
-
-/*
- * Various id's for the server
- */
-
-rtems_id rtems_monitor_server_task_id;
-rtems_id rtems_monitor_server_request_queue_id; /* our server */
-rtems_id *rtems_monitor_server_request_queue_ids; /* all servers */
-rtems_id rtems_monitor_server_response_queue_id; /* our server */
-
-
-/*
- * Send a request to a server task
- */
-
-rtems_status_code
-rtems_monitor_server_request(
- unsigned32 server_node,
- rtems_monitor_server_request_t *request,
- rtems_monitor_server_response_t *response
-)
-{
- rtems_id server_id;
- rtems_status_code status;
- unsigned32 size;
-
- /*
- * What is id of monitor on target node?
- * Look it up if we don't know it yet.
- */
-
- server_id = rtems_monitor_server_request_queue_ids[server_node];
- if (server_id == 0)
- {
- status = rtems_message_queue_ident(RTEMS_MONITOR_QUEUE_NAME,
- server_node,
- &server_id);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "ident of remote server failed");
- goto done;
- }
-
- rtems_monitor_server_request_queue_ids[server_node] = server_id;
- }
-
- request->return_id = rtems_monitor_server_response_queue_id;
-
- status = rtems_message_queue_send(server_id, request, sizeof(*request));
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "monitor server request send failed");
- goto done;
- }
-
- /*
- * Await response, if requested
- */
-
- if (response)
- {
- status = rtems_message_queue_receive(rtems_monitor_server_response_queue_id,
- response,
- &size,
- RTEMS_WAIT,
- 100);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "server did not respond");
-
- /* maybe server task was restarted; look it up again next time */
- rtems_monitor_server_request_queue_ids[server_node] = 0;
-
- goto done;
- }
-
- if (response->command != RTEMS_MONITOR_SERVER_RESPONSE)
- {
- status = RTEMS_INCORRECT_STATE;
- goto done;
- }
- }
-
-done:
- return status;
-}
-
-
-
-/*
- * monitor server task
- */
-
-void
-rtems_monitor_server_task(
- rtems_task_argument monitor_flags
-)
-{
- rtems_monitor_server_request_t request;
- rtems_monitor_server_response_t response;
- rtems_status_code status;
- unsigned32 size;
-
- for (;;)
- {
- status = rtems_message_queue_receive(
- rtems_monitor_server_request_queue_id,
- &request,
- &size,
- RTEMS_WAIT,
- (rtems_interval) 0);
-
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "monitor server msg queue receive error");
- goto failed;
- }
-
- if (size != sizeof(request))
- {
- rtems_error(0, "monitor server bad size on receive");
- goto failed;
- }
-
- switch (request.command)
- {
- case RTEMS_MONITOR_SERVER_CANONICAL:
- {
- rtems_monitor_object_type_t object_type;
- rtems_id id;
- rtems_id next_id;
-
- object_type = (rtems_monitor_object_type_t) request.argument0;
- id = (rtems_id) request.argument1;
- next_id = rtems_monitor_object_canonical_get(object_type,
- id,
- &response.payload,
- &size);
-
- response.command = RTEMS_MONITOR_SERVER_RESPONSE;
- response.result0 = next_id;
- response.result1 = size;
-
-#define SERVER_OVERHEAD (RTEMS_offsetof(rtems_monitor_server_response_t, \
- payload))
-
- status = rtems_message_queue_send(request.return_id,
- &response,
- size + SERVER_OVERHEAD);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "response send failed");
- goto failed;
- }
- break;
- }
-
- default:
- {
- rtems_error(0, "invalid command to monitor server: %d", request.command);
- goto failed;
- }
- }
- }
-
-failed:
- rtems_task_delete(RTEMS_SELF);
-}
-
-
-/*
- * Kill off any old server
- * Not sure if this is useful, but it doesn't help
- */
-
-void
-rtems_monitor_server_kill(void)
-{
- if (rtems_monitor_server_task_id)
- rtems_task_delete(rtems_monitor_server_task_id);
- rtems_monitor_task_id = 0;
-
- if (rtems_monitor_server_request_queue_id)
- rtems_message_queue_delete(rtems_monitor_server_request_queue_id);
- rtems_monitor_server_response_queue_id = 0;
-
- if (rtems_monitor_server_response_queue_id)
- rtems_message_queue_delete(rtems_monitor_server_response_queue_id);
- rtems_monitor_server_request_queue_ids = 0;
-
- if (rtems_monitor_server_request_queue_ids)
- free(rtems_monitor_server_request_queue_ids);
- rtems_monitor_server_request_queue_ids = 0;
-}
-
-
-void
-rtems_monitor_server_init(
- unsigned32 monitor_flags
-)
-{
- rtems_status_code status;
-
- if (_System_state_Is_multiprocessing &&
- (_Configuration_MP_table->maximum_nodes > 1))
- {
- unsigned32 maximum_nodes = _Configuration_MP_table->maximum_nodes;
-
- /*
- * create the msg que our server will listen
- * Since we only get msgs from other RTEMS monitors, we just
- * need reserve space for 1 msg from each node.
- */
-
- status = rtems_message_queue_create(
- RTEMS_MONITOR_QUEUE_NAME,
- maximum_nodes,
- sizeof(rtems_monitor_server_request_t),
- RTEMS_GLOBAL,
- &rtems_monitor_server_request_queue_id);
-
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not create monitor server message queue");
- goto done;
- }
-
- /*
- * create the msg que our responses will come on
- * Since monitor just does one thing at a time, we only need 1 item
- * message queue.
- */
-
- status = rtems_message_queue_create(
- RTEMS_MONITOR_RESPONSE_QUEUE_NAME,
- 1, /* depth */
- sizeof(rtems_monitor_server_response_t),
- RTEMS_GLOBAL,
- &rtems_monitor_server_response_queue_id);
-
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not create monitor response message queue");
- goto done;
- }
-
- /* need an id for queue of each other server we might talk to */
- /* indexed by node, so add 1 to maximum_nodes */
- rtems_monitor_server_request_queue_ids =
- (rtems_id *) malloc((maximum_nodes + 1) * sizeof(rtems_id));
- (void) memset(rtems_monitor_server_request_queue_ids,
- 0,
- (maximum_nodes + 1) * sizeof(rtems_id));
-
- rtems_monitor_server_request_queue_ids[rtems_monitor_node] =
- rtems_monitor_server_request_queue_id;
-
- /*
- * create the server task
- */
- status = rtems_task_create(RTEMS_MONITOR_SERVER_NAME,
- 1,
- 0 /* default stack */,
- RTEMS_INTERRUPT_LEVEL(0),
- RTEMS_DEFAULT_ATTRIBUTES,
- &rtems_monitor_server_task_id);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not create monitor server task");
- goto done;
- }
-
- /*
- * Start the server task
- */
- status = rtems_task_start(rtems_monitor_server_task_id,
- rtems_monitor_server_task,
- monitor_flags);
- if (status != RTEMS_SUCCESSFUL)
- {
- rtems_error(status, "could not start monitor server");
- goto done;
- }
- }
-
-done:
- return;
-}
diff --git a/cpukit/libmisc/monitor/mon-symbols.c b/cpukit/libmisc/monitor/mon-symbols.c
deleted file mode 100644
index 48781bb6cc..0000000000
--- a/cpukit/libmisc/monitor/mon-symbols.c
+++ /dev/null
@@ -1,487 +0,0 @@
-/*
- * File: symbols.c
- *
- * Description:
- * Symbol table manager for the RTEMS monitor.
- * These routines may be used by other system resources also.
- *
- *
- * TODO:
- *
- * $Id$
- */
-
-/* for strcasecmp in linux and solaris */
-#if defined(__linux__)
-#include <features.h>
-#define __USE_BSD
-#endif
-#include <string.h>
-
-#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <rtems.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <rtems/monitor.h>
-#include <rtems/symbols.h>
-
-
-rtems_symbol_table_t *
-rtems_symbol_table_create()
-{
- rtems_symbol_table_t *table;
-
- table = (rtems_symbol_table_t *) malloc(sizeof(rtems_symbol_table_t));
- memset((void *) table, 0, sizeof(*table));
-
- table->growth_factor = 30; /* 30 percent */
-
- return table;
-}
-
-void
-rtems_symbol_table_destroy(rtems_symbol_table_t *table)
-{
- rtems_symbol_string_block_t *p, *pnext;
-
- if (table)
- {
- if (table->addresses)
- (void) free(table->addresses);
- table->addresses = 0;
- p = table->string_buffer_head;
- while (p)
- {
- pnext = p->next;
- free(p);
- p = pnext;
- }
- table->string_buffer_head = 0;
- table->string_buffer_current = 0;
-
- free(table);
- }
-}
-
-rtems_symbol_t *
-rtems_symbol_create(
- rtems_symbol_table_t *table,
- char *name,
- rtems_unsigned32 value
- )
-{
- int symbol_length;
- size_t newsize;
- rtems_symbol_t *sp;
-
- symbol_length = strlen(name) + 1; /* include '\000' in length */
-
- /* need to grow the table? */
- if (table->next >= table->size)
- {
- if (table->size == 0)
- newsize = 100;
- else
- newsize = table->size + (table->size / (100 / table->growth_factor));
-
- table->addresses = (rtems_symbol_t *) realloc((void *) table->addresses, newsize * sizeof(rtems_symbol_t));
- if (table->addresses == 0) /* blew it; lost orig */
- goto failed;
- table->size = newsize;
- }
-
- sp = &table->addresses[table->next];
- sp->value = value;
-
- /* Have to add it to string pool */
- /* need to grow pool? */
-
- if ((table->string_buffer_head == 0) ||
- (table->strings_next + symbol_length) >= SYMBOL_STRING_BLOCK_SIZE)
- {
- rtems_symbol_string_block_t *p;
-
- p = (rtems_symbol_string_block_t *) malloc(sizeof(rtems_symbol_string_block_t));
- if (p == 0)
- goto failed;
- p->next = 0;
- if (table->string_buffer_head == 0)
- table->string_buffer_head = p;
- else
- table->string_buffer_current->next = p;
- table->string_buffer_current = p;
-
- table->strings_next = 0;
- }
-
- sp->name = table->string_buffer_current->buffer + table->strings_next;
- (void) strcpy(sp->name, name);
-
- table->strings_next += symbol_length;
- table->sorted = 0;
- table->next++;
-
- return sp;
-
-/* XXX Not sure what to do here. We've possibly destroyed the initial
- symbol table due to realloc failure */
-failed:
- return 0;
-}
-
-/*
- * Qsort entry point for compare by address
- */
-
-static int
-rtems_symbol_compare(const void *e1,
- const void *e2)
-{
- rtems_symbol_t *s1, *s2;
- s1 = (rtems_symbol_t *) e1;
- s2 = (rtems_symbol_t *) e2;
-
- if (s1->value < s2->value)
- return -1;
- if (s1->value > s2->value)
- return 1;
- return 0;
-}
-
-
-/*
- * Sort the symbol table using qsort
- */
-
-static void
-rtems_symbol_sort(rtems_symbol_table_t *table)
-{
- qsort((void *) table->addresses, (size_t) table->next,
- sizeof(rtems_symbol_t), rtems_symbol_compare);
- table->sorted = 1;
-}
-
-
-/*
- * Search the symbol table by address
- * This code based on CYGNUS newlib bsearch, but changed
- * to allow for finding closest symbol <= key
- */
-
-rtems_symbol_t *
-rtems_symbol_value_lookup(
- rtems_symbol_table_t *table,
- rtems_unsigned32 value
- )
-{
- rtems_symbol_t *sp;
- rtems_symbol_t *base;
- rtems_symbol_t *best = 0;
- rtems_unsigned32 distance;
- rtems_unsigned32 best_distance = ~0;
- rtems_unsigned32 elements;
-
- if (table == 0)
- table = rtems_monitor_symbols;
-
- if ((table == 0) || (table->size == 0))
- return 0;
-
- if (table->sorted == 0)
- rtems_symbol_sort(table);
-
- base = table->addresses;
- elements = table->next;
-
- while (elements)
- {
- sp = base + (elements / 2);
- if (value < sp->value)
- elements /= 2;
- else if (value > sp->value)
- {
- distance = value - sp->value;
- if (distance < best_distance)
- {
- best_distance = distance;
- best = sp;
- }
- base = sp + 1;
- elements = (elements / 2) - (elements % 2 ? 0 : 1);
- }
- else
- return sp;
- }
-
- if (value == base->value)
- return base;
-
- return best;
-}
-
-/*
- * Search the symbol table for the exact matching address.
- * If the symbol table has already been sorted, then
- * call the regular symbol value lookup, however, it it
- * has not yet been sorted, search it sequentially.
- * This routine is primarily used for low level symbol
- * lookups (eg. from exception handler and interrupt routines)
- * where the penality of sorted is not wanted and where
- * an exact match is needed such that symbol table order
- * is not important.
- */
-const rtems_symbol_t *
-rtems_symbol_value_lookup_exact(
- rtems_symbol_table_t *table,
- rtems_unsigned32 value
- )
-{
- rtems_unsigned32 s;
- rtems_symbol_t *sp;
-
- if (table == 0)
- {
- table = rtems_monitor_symbols;
- if (table == 0)
- return NULL;
- }
-
- if (table->sorted)
- {
- sp = rtems_symbol_value_lookup(table, value);
- if ( rtems_symbol_value(sp) == value )
- return sp;
- else
- return NULL; /* not an exact match */
- }
-
- for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
- {
- if ( sp->value == value )
- return sp;
- }
-
- return NULL;
-
-}
-
-
-/*
- * Search the symbol table by string name (case independent)
- */
-
-rtems_symbol_t *
-rtems_symbol_name_lookup(
- rtems_symbol_table_t *table,
- char *name
- )
-{
- rtems_unsigned32 s;
- rtems_symbol_t *sp;
-
- if (table == 0)
- {
- table = rtems_monitor_symbols;
- if (table == 0)
- return NULL;
- }
-
- for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
- {
- if ( strcasecmp(sp->name, name) == 0 )
- return sp;
- }
-
- return NULL;
-}
-
-void *
-rtems_monitor_symbol_next(
- void *object_info,
- rtems_monitor_symbol_t *canonical,
- rtems_id *next_id
-)
-{
- rtems_symbol_table_t *table;
- rtems_unsigned32 n = rtems_get_index(*next_id);
-
- table = *(rtems_symbol_table_t **) object_info;
- if (table == 0)
- goto failed;
-
- if (n >= table->next)
- goto failed;
-
- /* NOTE: symbols do not have id and name fields */
-
- if (table->sorted == 0)
- rtems_symbol_sort(table);
-
- _Thread_Disable_dispatch();
-
- *next_id += 1;
- return (void *) (table->addresses + n);
-
-failed:
- *next_id = RTEMS_OBJECT_ID_FINAL;
- return 0;
-}
-
-void
-rtems_monitor_symbol_canonical(
- rtems_monitor_symbol_t *canonical_symbol,
- rtems_symbol_t *sp
-)
-{
- canonical_symbol->value = sp->value;
- canonical_symbol->offset = 0;
- strncpy(canonical_symbol->name, sp->name, sizeof(canonical_symbol->name));
-}
-
-
-void
-rtems_monitor_symbol_canonical_by_name(
- rtems_monitor_symbol_t *canonical_symbol,
- char *name
-)
-{
- rtems_symbol_t *sp;
-
- sp = rtems_symbol_name_lookup(0, name);
-
- canonical_symbol->value = sp ? sp->value : 0;
-
- strncpy(canonical_symbol->name, name, sizeof(canonical_symbol->name));
- canonical_symbol->offset = 0;
-}
-
-void
-rtems_monitor_symbol_canonical_by_value(
- rtems_monitor_symbol_t *canonical_symbol,
- void *value_void_p
-)
-{
- unsigned32 value = (unsigned32) value_void_p;
- rtems_symbol_t *sp;
-
- sp = rtems_symbol_value_lookup(0, value);
- if (sp)
- {
- canonical_symbol->value = sp->value;
- canonical_symbol->offset = value - sp->value;
- strncpy(canonical_symbol->name, sp->name, sizeof(canonical_symbol->name));
- }
- else
- {
- canonical_symbol->value = value;
- canonical_symbol->offset = 0;
- canonical_symbol->name[0] = '\0';
- }
-}
-
-
-unsigned32
-rtems_monitor_symbol_dump(
- rtems_monitor_symbol_t *canonical_symbol,
- boolean verbose
-)
-{
- unsigned32 length = 0;
-
- /*
- * print the name if it exists AND if value is non-zero
- * Ie: don't print some garbage symbol for address 0
- */
-
- if (canonical_symbol->name[0] && (canonical_symbol->value != 0))
- {
- if (canonical_symbol->offset == 0)
- length += printf("%.*s",
- (int) sizeof(canonical_symbol->name),
- canonical_symbol->name);
- else
- length += printf("<%.*s+0x%x>",
- (int) sizeof(canonical_symbol->name),
- canonical_symbol->name,
- canonical_symbol->offset);
- if (verbose)
- length += printf(" [0x%x]", canonical_symbol->value);
- }
- else
- length += printf("[0x%x]", canonical_symbol->value);
-
- return length;
-}
-
-
-void
-rtems_monitor_symbol_dump_all(
- rtems_symbol_table_t *table,
- boolean verbose
-)
-{
- rtems_unsigned32 s;
- rtems_symbol_t *sp;
-
- if (table == 0)
- {
- table = rtems_monitor_symbols;
- if (table == 0)
- return;
- }
-
- if (table->sorted == 0)
- rtems_symbol_sort(table);
-
- for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
- {
- rtems_monitor_symbol_t canonical_symbol;
-
- rtems_monitor_symbol_canonical(&canonical_symbol, sp);
- rtems_monitor_symbol_dump(&canonical_symbol, TRUE);
- printf("\n");
- }
-}
-
-
-/*
- * 'symbol' command
- */
-
-void
-rtems_monitor_symbol_cmd(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
-)
-{
- int arg;
- rtems_symbol_table_t *table;
-
- table = *(rtems_symbol_table_t **) command_arg;
- if (table == 0)
- {
- table = rtems_monitor_symbols;
- if (table == 0)
- return;
- }
-
- /*
- * Use object command to dump out whole symbol table
- */
- if (argc == 1)
- rtems_monitor_symbol_dump_all(table, verbose);
- else
- {
- rtems_monitor_symbol_t canonical_symbol;
-
- for (arg=1; argv[arg]; arg++)
- {
- rtems_monitor_symbol_canonical_by_name(&canonical_symbol, argv[arg]);
- rtems_monitor_symbol_dump(&canonical_symbol, verbose);
- printf("\n");
- }
- }
-}
diff --git a/cpukit/libmisc/monitor/mon-task.c b/cpukit/libmisc/monitor/mon-task.c
deleted file mode 100644
index b6ca36ddd1..0000000000
--- a/cpukit/libmisc/monitor/mon-task.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * RTEMS Monitor task support
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/monitor.h>
-
-#include <stdio.h>
-#include <string.h> /* memcpy() */
-
-void
-rtems_monitor_task_canonical(
- rtems_monitor_task_t *canonical_task,
- void *thread_void
-)
-{
- Thread_Control *rtems_thread = (Thread_Control *) thread_void;
- RTEMS_API_Control *api;
-
- api = rtems_thread->API_Extensions[ THREAD_API_RTEMS ];
-
- canonical_task->entry = rtems_thread->Start.entry_point;
- canonical_task->argument = rtems_thread->Start.numeric_argument;
- canonical_task->stack = rtems_thread->Start.Initial_stack.area;
- canonical_task->stack_size = rtems_thread->Start.Initial_stack.size;
- canonical_task->priority = rtems_thread->current_priority;
- canonical_task->state = rtems_thread->current_state;
- canonical_task->wait_id = rtems_thread->Wait.id;
- canonical_task->events = api->pending_events;
-
-/* XXX modes and attributes only exist in the RTEMS API .. */
-/* XXX not directly in the core thread.. they will have to be derived */
-/* XXX if they are important enough to include anymore. */
- canonical_task->modes = 0; /* XXX FIX ME.... rtems_thread->current_modes; */
- canonical_task->attributes = 0 /* XXX FIX ME rtems_thread->API_Extensions[ THREAD_API_RTEMS ]->attribute_set */;
- (void) memcpy(canonical_task->notepad, api ->Notepads, sizeof(canonical_task->notepad));
-/* XXX more to fix */
-/*
- (void) memcpy(&canonical_task->wait_args, &rtems_thread->Wait.Extra, sizeof(canonical_task->wait_args));
-*/
-}
-
-
-void
-rtems_monitor_task_dump_header(
- boolean verbose
-)
-{
- printf("\
- ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES\n");
-/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-0 1 2 3 4 5 6 7 */
-
- rtems_monitor_separator();
-}
-
-/*
- */
-
-void
-rtems_monitor_task_dump(
- rtems_monitor_task_t *monitor_task,
- boolean verbose
-)
-{
- int length = 0;
-
- length += rtems_monitor_dump_id(monitor_task->id);
- length += rtems_monitor_pad(11, length);
- length += rtems_monitor_dump_name(monitor_task->name);
- length += rtems_monitor_pad(18, length);
- length += rtems_monitor_dump_priority(monitor_task->priority);
- length += rtems_monitor_pad(24, length);
- length += rtems_monitor_dump_state(monitor_task->state);
- length += rtems_monitor_pad(31, length);
- length += rtems_monitor_dump_modes(monitor_task->modes);
- length += rtems_monitor_pad(39, length);
- length += rtems_monitor_dump_events(monitor_task->events);
- if (monitor_task->wait_id)
- {
- length += rtems_monitor_pad(47, length);
- length += rtems_monitor_dump_id(monitor_task->wait_id);
- length += rtems_monitor_pad(57, length);
- length += rtems_monitor_dump_hex(monitor_task->wait_args);
- }
-
- length += rtems_monitor_pad(65, length);
- length += rtems_monitor_dump_notepad(monitor_task->notepad);
- printf("\n");
-}
-
diff --git a/cpukit/libmisc/monitor/monitor.h b/cpukit/libmisc/monitor/monitor.h
deleted file mode 100644
index 16efd7c41f..0000000000
--- a/cpukit/libmisc/monitor/monitor.h
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * File: monitor.h
- *
- * Description:
- * The RTEMS monitor task include file.
- *
- * TODO:
- *
- * $Id$
- */
-
-#ifndef __MONITOR_H
-#define __MONITOR_H
-
-#include <rtems/symbols.h>
-#include <rtems/error.h> /* rtems_error() */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Monitor types are derived from rtems object classes
- */
-
-typedef enum {
- RTEMS_MONITOR_OBJECT_INVALID = OBJECTS_NO_CLASS,
- RTEMS_MONITOR_OBJECT_TASK = OBJECTS_RTEMS_TASKS,
- RTEMS_MONITOR_OBJECT_EXTENSION = OBJECTS_RTEMS_EXTENSIONS,
- RTEMS_MONITOR_OBJECT_QUEUE = OBJECTS_RTEMS_MESSAGE_QUEUES,
- RTEMS_MONITOR_OBJECT_SEMAPHORE = OBJECTS_RTEMS_SEMAPHORES,
- RTEMS_MONITOR_OBJECT_PARTITION = OBJECTS_RTEMS_PARTITIONS,
- RTEMS_MONITOR_OBJECT_REGION = OBJECTS_RTEMS_REGIONS,
- RTEMS_MONITOR_OBJECT_PORT = OBJECTS_RTEMS_PORTS,
-
- /* following monitor objects are not known to RTEMS, but
- * we like to have "types" for them anyway */
-
- RTEMS_MONITOR_OBJECT_DRIVER = OBJECTS_CLASSES_LAST+1,
- RTEMS_MONITOR_OBJECT_DNAME,
- RTEMS_MONITOR_OBJECT_CONFIG,
- RTEMS_MONITOR_OBJECT_INIT_TASK,
- RTEMS_MONITOR_OBJECT_MPCI,
- RTEMS_MONITOR_OBJECT_SYMBOL
-} rtems_monitor_object_type_t;
-
-/*
- * rtems_monitor_init() flags
- */
-
-#define RTEMS_MONITOR_SUSPEND 0x0001 /* suspend monitor on startup */
-#define RTEMS_MONITOR_GLOBAL 0x0002 /* monitor should be global */
-
-
-/*
- * Public interfaces for RTEMS data structures monitor is aware of.
- * These are only used by the monitor.
- *
- * NOTE:
- * All the canonical objects that correspond to RTEMS managed "objects"
- * must have an identical first portion with 'id' and 'name' fields.
- *
- * Others do not have that restriction, even tho we would like them to.
- * This is because some of the canonical structures are almost too big
- * for shared memory driver (eg: mpci) and we are nickel and diming it.
- */
-
-/*
- * Type of a pointer that may be a symbol
- */
-
-#define MONITOR_SYMBOL_LEN 20
-typedef struct {
- char name[MONITOR_SYMBOL_LEN];
- unsigned32 value;
- unsigned32 offset;
-} rtems_monitor_symbol_t;
-
-typedef struct {
- rtems_id id;
- rtems_name name;
- /* end of common portion */
-} rtems_monitor_generic_t;
-
-/*
- * Task
- */
-typedef struct {
- rtems_id id;
- rtems_name name;
- /* end of common portion */
- Thread_Entry entry;
- unsigned32 argument;
- void *stack;
- unsigned32 stack_size;
- rtems_task_priority priority;
- States_Control state;
- rtems_event_set events;
- rtems_mode modes;
- rtems_attribute attributes;
- unsigned32 notepad[RTEMS_NUMBER_NOTEPADS];
- rtems_id wait_id;
- unsigned32 wait_args;
-} rtems_monitor_task_t;
-
-/*
- * Init task
- */
-
-typedef struct {
- rtems_id id; /* not really an id */
- rtems_name name;
- /* end of common portion */
- rtems_monitor_symbol_t entry;
- unsigned32 argument;
- unsigned32 stack_size;
- rtems_task_priority priority;
- rtems_mode modes;
- rtems_attribute attributes;
-} rtems_monitor_init_task_t;
-
-
-/*
- * Message queue
- */
-typedef struct {
- rtems_id id;
- rtems_name name;
- /* end of common portion */
- rtems_attribute attributes;
- unsigned32 number_of_pending_messages;
- unsigned32 maximum_pending_messages;
- unsigned32 maximum_message_size;
-} rtems_monitor_queue_t;
-
-/*
- * Extension
- */
-typedef struct {
- rtems_id id;
- rtems_name name;
- /* end of common portion */
- rtems_monitor_symbol_t e_create;
- rtems_monitor_symbol_t e_start;
- rtems_monitor_symbol_t e_restart;
- rtems_monitor_symbol_t e_delete;
- rtems_monitor_symbol_t e_tswitch;
- rtems_monitor_symbol_t e_begin;
- rtems_monitor_symbol_t e_exitted;
- rtems_monitor_symbol_t e_fatal;
-} rtems_monitor_extension_t;
-
-/*
- * Device driver
- */
-
-typedef struct {
- rtems_id id; /* not really an id (should be tho) */
- rtems_name name; /* ditto */
- /* end of common portion */
- rtems_monitor_symbol_t initialization; /* initialization procedure */
- rtems_monitor_symbol_t open; /* open request procedure */
- rtems_monitor_symbol_t close; /* close request procedure */
- rtems_monitor_symbol_t read; /* read request procedure */
- rtems_monitor_symbol_t write; /* write request procedure */
- rtems_monitor_symbol_t control; /* special functions procedure */
-} rtems_monitor_driver_t;
-
-typedef struct {
- rtems_id id; /* not used for drivers (yet) */
- rtems_name name; /* not used for drivers (yet) */
- /* end of common portion */
- unsigned32 major;
- unsigned32 minor;
- char name_string[64];
-} rtems_monitor_dname_t;
-
-/*
- * System config
- */
-
-typedef struct {
- void *work_space_start;
- unsigned32 work_space_size;
- unsigned32 maximum_tasks;
- unsigned32 maximum_timers;
- unsigned32 maximum_semaphores;
- unsigned32 maximum_message_queues;
- unsigned32 maximum_partitions;
- unsigned32 maximum_regions;
- unsigned32 maximum_ports;
- unsigned32 maximum_periods;
- unsigned32 maximum_extensions;
- unsigned32 microseconds_per_tick;
- unsigned32 ticks_per_timeslice;
- unsigned32 number_of_initialization_tasks;
-} rtems_monitor_config_t;
-
-/*
- * MPCI config
- */
-
-typedef struct {
- unsigned32 node; /* local node number */
- unsigned32 maximum_nodes; /* maximum # nodes in system */
- unsigned32 maximum_global_objects; /* maximum # global objects */
- unsigned32 maximum_proxies; /* maximum # proxies */
-
- unsigned32 default_timeout; /* in ticks */
- unsigned32 maximum_packet_size;
- rtems_monitor_symbol_t initialization;
- rtems_monitor_symbol_t get_packet;
- rtems_monitor_symbol_t return_packet;
- rtems_monitor_symbol_t send_packet;
- rtems_monitor_symbol_t receive_packet;
-} rtems_monitor_mpci_t;
-
-/*
- * The generic canonical information union
- */
-
-typedef union {
- rtems_monitor_generic_t generic;
- rtems_monitor_task_t task;
- rtems_monitor_queue_t queue;
- rtems_monitor_extension_t extension;
- rtems_monitor_driver_t driver;
- rtems_monitor_dname_t dname;
- rtems_monitor_config_t config;
- rtems_monitor_mpci_t mpci;
- rtems_monitor_init_task_t itask;
-} rtems_monitor_union_t;
-
-/*
- * Support for talking to other monitors
- */
-
-/*
- * Names of other monitors
- */
-
-#define RTEMS_MONITOR_NAME (rtems_build_name('R', 'M', 'O', 'N'))
-#define RTEMS_MONITOR_SERVER_NAME (rtems_build_name('R', 'M', 'S', 'V'))
-#define RTEMS_MONITOR_QUEUE_NAME (rtems_build_name('R', 'M', 'S', 'Q'))
-#define RTEMS_MONITOR_RESPONSE_QUEUE_NAME (rtems_build_name('R', 'M', 'R', 'Q'))
-
-#define RTEMS_MONITOR_SERVER_RESPONSE 0x0001
-#define RTEMS_MONITOR_SERVER_CANONICAL 0x0002
-
-typedef struct
-{
- unsigned32 command;
- rtems_id return_id;
- unsigned32 argument0;
- unsigned32 argument1;
- unsigned32 argument2;
- unsigned32 argument3;
- unsigned32 argument4;
- unsigned32 argument5;
-} rtems_monitor_server_request_t;
-
-typedef struct
-{
- unsigned32 command;
- unsigned32 result0;
- unsigned32 result1;
- rtems_monitor_union_t payload;
-} rtems_monitor_server_response_t;
-
-extern rtems_id rtems_monitor_task_id;
-
-extern unsigned32 rtems_monitor_node; /* our node number */
-extern unsigned32 rtems_monitor_default_node; /* current default for commands */
-
-/*
- * Monitor command function and table entry
- */
-
-typedef struct rtems_monitor_command_entry_s rtems_monitor_command_entry_t;
-
-typedef void ( *rtems_monitor_command_function_t )(
- int argc,
- char **argv,
- unsigned32 command_arg,
- boolean verbose
- );
-
-struct rtems_monitor_command_entry_s {
- char *command; /* command name */
- char *usage; /* usage string for the command */
- unsigned32 arguments_required; /* # of required args */
- rtems_monitor_command_function_t command_function;
-
- /* Some argument for the command */
- unsigned32 command_arg;
-};
-
-typedef void *(*rtems_monitor_object_next_fn)(void *, void *, rtems_id *);
-typedef void (*rtems_monitor_object_canonical_fn)(void *, void *);
-typedef void (*rtems_monitor_object_dump_header_fn)(boolean);
-typedef void (*rtems_monitor_object_dump_fn)(void *, boolean);
-
-typedef struct {
- rtems_monitor_object_type_t type;
- void *object_information;
- int size; /* of canonical object */
- rtems_monitor_object_next_fn next;
- rtems_monitor_object_canonical_fn canonical;
- rtems_monitor_object_dump_header_fn dump_header;
- rtems_monitor_object_dump_fn dump;
-} rtems_monitor_object_info_t;
-
-
-/* monitor.c */
-void rtems_monitor_kill(void);
-void rtems_monitor_init(unsigned32);
-void rtems_monitor_wakeup(void);
-void rtems_monitor_pause_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_fatal_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_continue_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_debugger_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_node_cmd(int, char **, unsigned32, boolean);
-void rtems_monitor_symbols_loadup(void);
-void rtems_monitor_task(rtems_task_argument);
-
-/* server.c */
-void rtems_monitor_server_kill(void);
-rtems_status_code rtems_monitor_server_request(unsigned32, rtems_monitor_server_request_t *, rtems_monitor_server_response_t *);
-void rtems_monitor_server_task(rtems_task_argument);
-void rtems_monitor_server_init(unsigned32);
-
-/* command.c */
-int rtems_monitor_make_argv(char *, int *, char **);
-int rtems_monitor_command_read(char *, int *, char **);
-rtems_monitor_command_entry_t *rtems_monitor_command_lookup(
- rtems_monitor_command_entry_t * table, int argc, char **argv);
-void rtems_monitor_command_usage(rtems_monitor_command_entry_t *, char *);
-void rtems_monitor_help_cmd(int, char **, unsigned32, boolean);
-
-/* prmisc.c */
-void rtems_monitor_separator(void);
-unsigned32 rtems_monitor_pad(unsigned32 dest_col, unsigned32 curr_col);
-unsigned32 rtems_monitor_dump_char(unsigned8 ch);
-unsigned32 rtems_monitor_dump_decimal(unsigned32 num);
-unsigned32 rtems_monitor_dump_hex(unsigned32 num);
-unsigned32 rtems_monitor_dump_id(rtems_id id);
-unsigned32 rtems_monitor_dump_name(rtems_name name);
-unsigned32 rtems_monitor_dump_priority(rtems_task_priority priority);
-unsigned32 rtems_monitor_dump_state(States_Control state);
-unsigned32 rtems_monitor_dump_modes(rtems_mode modes);
-unsigned32 rtems_monitor_dump_attributes(rtems_attribute attributes);
-unsigned32 rtems_monitor_dump_events(rtems_event_set events);
-unsigned32 rtems_monitor_dump_notepad(unsigned32 *notepad);
-
-/* object.c */
-rtems_id rtems_monitor_id_fixup(rtems_id, unsigned32, rtems_monitor_object_type_t);
-rtems_id rtems_monitor_object_canonical_get(rtems_monitor_object_type_t, rtems_id, void *, unsigned32 *size_p);
-rtems_id rtems_monitor_object_canonical_next(rtems_monitor_object_info_t *, rtems_id, void *);
-void *rtems_monitor_object_next(void *, void *, rtems_id, rtems_id *);
-rtems_id rtems_monitor_object_canonical(rtems_id, void *);
-void rtems_monitor_object_cmd(int, char **, unsigned32, boolean);
-
-/* manager.c */
-void *rtems_monitor_manager_next(void *, void *, rtems_id *);
-
-/* config.c */
-void rtems_monitor_config_canonical(rtems_monitor_config_t *, void *);
-void *rtems_monitor_config_next(void *, rtems_monitor_config_t *, rtems_id *);
-void rtems_monitor_config_dump_header(boolean);
-void rtems_monitor_config_dump(rtems_monitor_config_t *, boolean verbose);
-
-/* mpci.c */
-void rtems_monitor_mpci_canonical(rtems_monitor_mpci_t *, void *);
-void *rtems_monitor_mpci_next(void *, rtems_monitor_mpci_t *, rtems_id *);
-void rtems_monitor_mpci_dump_header(boolean);
-void rtems_monitor_mpci_dump(rtems_monitor_mpci_t *, boolean verbose);
-
-/* itask.c */
-void rtems_monitor_init_task_canonical(rtems_monitor_init_task_t *, void *);
-void *rtems_monitor_init_task_next(void *, rtems_monitor_init_task_t *, rtems_id *);
-void rtems_monitor_init_task_dump_header(boolean);
-void rtems_monitor_init_task_dump(rtems_monitor_init_task_t *, boolean verbose);
-
-/* extension.c */
-void rtems_monitor_extension_canonical(rtems_monitor_extension_t *, void *);
-void rtems_monitor_extension_dump_header(boolean verbose);
-void rtems_monitor_extension_dump(rtems_monitor_extension_t *, boolean);
-
-/* task.c */
-void rtems_monitor_task_canonical(rtems_monitor_task_t *, void *);
-void rtems_monitor_task_dump_header(boolean verbose);
-void rtems_monitor_task_dump(rtems_monitor_task_t *, boolean);
-
-/* queue.c */
-void rtems_monitor_queue_canonical(rtems_monitor_queue_t *, void *);
-void rtems_monitor_queue_dump_header(boolean verbose);
-void rtems_monitor_queue_dump(rtems_monitor_queue_t *, boolean);
-
-/* driver.c */
-void *rtems_monitor_driver_next(void *, rtems_monitor_driver_t *, rtems_id *);
-void rtems_monitor_driver_canonical(rtems_monitor_driver_t *, void *);
-void rtems_monitor_driver_dump_header(boolean);
-void rtems_monitor_driver_dump(rtems_monitor_driver_t *, boolean);
-
-/* dname.c */
-void *rtems_monitor_dname_next(void *, rtems_monitor_dname_t *, rtems_id *);
-void rtems_monitor_dname_canonical(rtems_monitor_dname_t *, void *);
-void rtems_monitor_dname_dump_header(boolean);
-void rtems_monitor_dname_dump(rtems_monitor_dname_t *, boolean);
-
-/* symbols.c */
-rtems_symbol_table_t *rtems_symbol_table_create();
-void rtems_symbol_table_destroy(rtems_symbol_table_t *table);
-
-rtems_symbol_t *rtems_symbol_create(rtems_symbol_table_t *, char *, unsigned32);
-rtems_symbol_t *rtems_symbol_value_lookup(rtems_symbol_table_t *, unsigned32);
-const rtems_symbol_t *rtems_symbol_value_lookup_exact(rtems_symbol_table_t *, unsigned32);
-rtems_symbol_t *rtems_symbol_name_lookup(rtems_symbol_table_t *, char *);
-void *rtems_monitor_symbol_next(void *object_info, rtems_monitor_symbol_t *, rtems_id *);
-void rtems_monitor_symbol_canonical(rtems_monitor_symbol_t *, rtems_symbol_t *);
-void rtems_monitor_symbol_canonical_by_name(rtems_monitor_symbol_t *, char *);
-void rtems_monitor_symbol_canonical_by_value(rtems_monitor_symbol_t *, void *);
-unsigned32 rtems_monitor_symbol_dump(rtems_monitor_symbol_t *, boolean);
-void rtems_monitor_symbol_cmd(int, char **, unsigned32, boolean);
-
-
-extern rtems_symbol_table_t *rtems_monitor_symbols;
-
-#ifndef MONITOR_PROMPT
-#define MONITOR_PROMPT "rtems" /* will have '> ' appended */
-#endif
-
-#define MONITOR_WAKEUP_EVENT RTEMS_EVENT_0
-
-
-#define STREQ(a,b) (strcmp(a,b) == 0)
-#define STRNEQ(a,b,n) (strncmp(a,b,n) == 0)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! __MONITOR_H */
diff --git a/cpukit/libmisc/monitor/symbols.h b/cpukit/libmisc/monitor/symbols.h
deleted file mode 100644
index 119c879d54..0000000000
--- a/cpukit/libmisc/monitor/symbols.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * RTEMS monitor symbol table functions
- *
- * Description:
- * Entry points for symbol table routines.
- *
- *
- *
- * TODO:
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_SYMBOLS_H
-#define _INCLUDE_SYMBOLS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct {
- rtems_unsigned32 value;
- char *name;
-} rtems_symbol_t;
-
-#define SYMBOL_STRING_BLOCK_SIZE 4080
-typedef struct rtems_symbol_string_block_s {
- struct rtems_symbol_string_block_s *next;
- char buffer[SYMBOL_STRING_BLOCK_SIZE];
-} rtems_symbol_string_block_t;
-
-typedef struct {
-
- rtems_unsigned32 sorted; /* are symbols sorted right now? */
- rtems_unsigned32 growth_factor; /* % to grow by when needed */
- rtems_unsigned32 next; /* next symbol slot to use when adding */
- rtems_unsigned32 size; /* max # of symbols */
-
- /*
- * Symbol list -- sorted by address (when we do a lookup)
- */
-
- rtems_symbol_t *addresses; /* symbol array by address */
-
- /*
- * String pool, unsorted, a list of blocks of string data
- */
-
- rtems_symbol_string_block_t *string_buffer_head;
- rtems_symbol_string_block_t *string_buffer_current;
- rtems_unsigned32 strings_next; /* next byte to use in this block */
-
-} rtems_symbol_table_t;
-
-#define rtems_symbol_name(sp) ((sp)->name)
-#define rtems_symbol_value(sp) ((sp)->value)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! _INCLUDE_SYMBOLS_H */
diff --git a/cpukit/libmisc/rtmonuse/rtmonuse.c b/cpukit/libmisc/rtmonuse/rtmonuse.c
deleted file mode 100644
index 843d29468e..0000000000
--- a/cpukit/libmisc/rtmonuse/rtmonuse.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <assert.h>
-
-#include "rtmonuse.h"
-
-typedef struct {
- rtems_id id;
- unsigned32 count;
- unsigned32 missed_count;
- unsigned32 min_cpu_time;
- unsigned32 max_cpu_time;
- unsigned32 total_cpu_time;
- unsigned32 min_wall_time;
- unsigned32 max_wall_time;
- unsigned32 total_wall_time;
-} Period_usage_t;
-
-Period_usage_t *Period_usage_Information;
-
-/*PAGE
- *
- * Period_usage_Initialize
- */
-
-void Period_usage_Initialize( void )
-{
- int maximum;
-
- maximum = _Configuration_Table->RTEMS_api_configuration->maximum_periods;
-
- Period_usage_Information = malloc( sizeof(Period_usage_t) * (maximum+1) );
-
- Period_usage_Reset();
-}
-
-/*PAGE
- *
- * Period_usage_Reset
- */
-
-void Period_usage_Reset( void )
-{
- unsigned32 i;
- Period_usage_t *the_usage;
-
- for ( i=0 ;
- i<_Configuration_Table->RTEMS_api_configuration->maximum_periods ;
- i++ ) {
- the_usage = &Period_usage_Information[ i ];
-
- the_usage->count = 0;
- the_usage->missed_count = 0;
- the_usage->min_cpu_time = 0xFFFFFFFF;
- the_usage->max_cpu_time = 0;
- the_usage->total_cpu_time = 0;
- the_usage->min_wall_time = 0xFFFFFFFF;
- the_usage->max_wall_time = 0;
- the_usage->total_wall_time = 0;
-
- }
-}
-
-/*PAGE
- *
- * Period_usage_Update
- */
-
-void Period_usage_Update(
- rtems_id id
-)
-{
- rtems_rate_monotonic_period_status rm_status;
- rtems_status_code status;
- Period_usage_t *the_usage;
-
- assert( Period_usage_Information );
-
- status = rtems_rate_monotonic_get_status( id, &rm_status );
- assert( status == RTEMS_SUCCESSFUL );
-
- the_usage = &Period_usage_Information[ rtems_get_index( id ) ];
-
- the_usage->id = id;
- the_usage->count++;
- if ( rm_status.state == RATE_MONOTONIC_EXPIRED )
- the_usage->missed_count++;
- the_usage->total_cpu_time += rm_status.ticks_executed_since_last_period;
- the_usage->total_wall_time += rm_status.ticks_since_last_period;
-
- /*
- * Update CPU time
- */
-
- if ( rm_status.ticks_executed_since_last_period < the_usage->min_cpu_time )
- the_usage->min_cpu_time = rm_status.ticks_executed_since_last_period;
-
- if ( rm_status.ticks_executed_since_last_period > the_usage->max_cpu_time )
- the_usage->max_cpu_time = rm_status.ticks_executed_since_last_period;
-
- /*
- * Update Wall time
- */
-
- if ( rm_status.ticks_since_last_period < the_usage->min_wall_time )
- the_usage->min_wall_time = rm_status.ticks_since_last_period;
-
- if ( rm_status.ticks_since_last_period > the_usage->max_wall_time )
- the_usage->max_wall_time = rm_status.ticks_since_last_period;
-
-}
-
-/*PAGE
- *
- * Period_usage_Dump
- */
-
-void Period_usage_Dump( void )
-{
- unsigned32 i;
- Period_usage_t *the_usage;
- Rate_monotonic_Control *the_period;
- unsigned32 u32_name;
- char name[5];
-
- if ( !Period_usage_Information ) {
- printf( "Period statistics library is not initialized\n" );
- return;
- }
-
- printf( "Period information by period\n" );
- printf( " ID OWNER PERIODS MISSED CPU TIME WALL TIME\n" );
-
- /*
- * RTEMS does not use an index of zero for object ids.
- */
-
- for ( i=1 ;
- i<_Configuration_Table->RTEMS_api_configuration->maximum_periods ;
- i++ ) {
- the_usage = &Period_usage_Information[ i ];
- if ( the_usage->count == 0 )
- continue;
-
- the_period =
- (Rate_monotonic_Control *)_Rate_monotonic_Information.local_table[ i ];
-
- if ( the_period->owner )
- u32_name = *(unsigned32 *)the_period->owner->Object.name;
- else
- u32_name = rtems_build_name(' ', ' ', ' ', ' ');
-
- name[ 0 ] = (u32_name >> 24) & 0xff;
- name[ 1 ] = (u32_name >> 16) & 0xff;
- name[ 2 ] = (u32_name >> 8) & 0xff;
- name[ 3 ] = (u32_name >> 0) & 0xff;
- name[ 4 ] = '\0';
-
- printf(
- "0x%08x %4s %6d %3d %d/%d/%5.2f %d/%d/%3.2f\n",
- the_usage->id,
- name,
- the_usage->count,
- the_usage->missed_count,
- the_usage->min_cpu_time,
- the_usage->max_cpu_time,
- (double) the_usage->total_cpu_time / (double) the_usage->count,
- the_usage->min_wall_time,
- the_usage->max_wall_time,
- (double) the_usage->total_wall_time / (double) the_usage->count
- );
- }
-}
diff --git a/cpukit/libmisc/rtmonuse/rtmonuse.h b/cpukit/libmisc/rtmonuse/rtmonuse.h
deleted file mode 100644
index f0580a4f0b..0000000000
--- a/cpukit/libmisc/rtmonuse/rtmonuse.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef __RATE_MONOTONIC_USAGE_h
-#define __RATE_MONOTONIC_USAGE_h
-
-void Period_usage_Initialize( void );
-
-void Period_usage_Reset( void );
-
-void Period_usage_Update(
- rtems_id id
-);
-
-void Period_usage_Dump( void );
-
-#endif
diff --git a/cpukit/libmisc/stackchk/README b/cpukit/libmisc/stackchk/README
deleted file mode 100644
index 0f6e2f2b10..0000000000
--- a/cpukit/libmisc/stackchk/README
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# $Id$
-#
-
-Introduction
-============
-
-This directory contains a stack bounds checker. It provides two
-primary features:
-
- + check for stack overflow at each context switch
- + provides an educated guess at each task's stack usage
-
-Enabling
-========
-
-Add the stack checker extension to the initial user extension set.
-If using confdefs.h to build your configuration table, this is
-as simple as adding -DSTACK_CHECK_ON to the gcc command line which
-compiles the file defining the configuration table. In the RTEMS
-test suites and samples, this is always init.c
-
-Background
-==========
-
-The stack overflow check at context switch works by looking for
-a 16 byte pattern at the logical end of the stack to be corrupted.
-The "guesser" assumes that the entire stack was prefilled with a known
-pattern and assumes that the pattern is still in place if the memory
-has not been used as a stack.
-
-Both of these can be fooled by pushing large holes onto the stack
-and not writing to them... or (much more unlikely) writing the
-magic patterns into memory.
-
-This code has not been extensively tested. It is provided as a tool
-for RTEMS users to catch the most common mistake in multitasking
-systems ... too little stack space. Suggestions and comments are appreciated.
-
-NOTES:
-
-1. Stack usage information is questionable on CPUs which push
- large holes on stack.
-
-2. The stack checker has a tendency to generate a fault when
- trying to print the helpful diagnostic message. If it comes
- out, congratulations. If not, then the variable Stack_check_Blown_task
- contains a pointer to the TCB of the offending task. This
- is usually enough to go on.
-
-FUTURE:
-
-1. Determine how/if gcc will generate stack probe calls and support that.
-
-2. Get accurate stack usage numbers on i960.. it pushes very large
- holes on the stack.
diff --git a/cpukit/libmisc/stackchk/check.c b/cpukit/libmisc/stackchk/check.c
deleted file mode 100644
index 5bfb69bfb6..0000000000
--- a/cpukit/libmisc/stackchk/check.c
+++ /dev/null
@@ -1,535 +0,0 @@
-/*
- * Stack Overflow Check User Extension Set
- *
- * NOTE: This extension set automatically determines at
- * initialization time whether the stack for this
- * CPU grows up or down and installs the correct
- * extension routines for that direction.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-/*
- * HACK
- * the stack dump information should be printed by a "fatal" extension.
- * Fatal extensions only get called via rtems_fatal_error_occurred()
- * and not when rtems_shutdown_executive() is called.
- * I hope/think this is changing so that fatal extensions are renamed
- * to "shutdown" extensions.
- * When that happens, this #define should be deleted and all the code
- * it marks.
- */
-#define DONT_USE_FATAL_EXTENSION
-
-
-extern rtems_configuration_table BSP_Configuration;
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "stackchk.h"
-#include "internal.h"
-
-/*
- * This variable contains the name of the task which "blew" the stack.
- * It is NULL if the system is all right.
- */
-
-Thread_Control *Stack_check_Blown_task;
-
-/*
- * The extension table for the stack checker.
- */
-
-rtems_extensions_table Stack_check_Extension_table = {
- Stack_check_Create_extension, /* rtems_task_create */
- 0, /* rtems_task_start */
- 0, /* rtems_task_restart */
- 0, /* rtems_task_delete */
- Stack_check_Switch_extension, /* task_switch */
- Stack_check_Begin_extension, /* task_begin */
- 0, /* task_exitted */
-#ifdef DONT_USE_FATAL_EXTENSION
- 0, /* fatal */
-#else
- Stack_check_Fatal_extension, /* fatal */
-#endif
-};
-
-/*
- * The "magic pattern" used to mark the end of the stack.
- */
-
-Stack_check_Control Stack_check_Pattern;
-
-/*
- * Where the pattern goes in the stack area is dependent upon
- * whether the stack grow to the high or low area of the memory.
- *
- */
-
-#if ( CPU_STACK_GROWS_UP == TRUE )
-
-#define Stack_check_Get_pattern_area( _the_stack ) \
- ((Stack_check_Control *) ((char *)(_the_stack)->area + \
- (_the_stack)->size - sizeof( Stack_check_Control ) ))
-
-#define Stack_check_Calculate_used( _low, _size, _high_water ) \
- ((char *)(_high_water) - (char *)(_low))
-
-#define Stack_check_usable_stack_start(_the_stack) \
- ((_the_stack)->area)
-
-#else
-
-#define Stack_check_Get_pattern_area( _the_stack ) \
- ((Stack_check_Control *) ((char *)(_the_stack)->area + HEAP_OVERHEAD))
-
-#define Stack_check_Calculate_used( _low, _size, _high_water) \
- ( ((char *)(_low) + (_size)) - (char *)(_high_water) )
-
-#define Stack_check_usable_stack_start(_the_stack) \
- ((char *)(_the_stack)->area + sizeof(Stack_check_Control))
-
-#endif
-
-#define Stack_check_usable_stack_size(_the_stack) \
- ((_the_stack)->size - sizeof(Stack_check_Control))
-
-
-/*
- * Do we have an interrupt stack?
- * XXX it would sure be nice if the interrupt stack were also
- * stored in a "stack" structure!
- */
-
-
-Stack_Control stack_check_interrupt_stack;
-
-/*
- * Prototypes necessary for forward references
- */
-
-void Stack_check_Dump_usage( void );
-
-/*
- * Fill an entire stack area with BYTE_PATTERN.
- * This will be used by a Fatal extension to check for
- * amount of actual stack used
- */
-
-void
-stack_check_dope_stack(Stack_Control *stack)
-{
- memset(stack->area, BYTE_PATTERN, stack->size);
-}
-
-
-/*PAGE
- *
- * Stack_check_Initialize
- */
-
-unsigned32 stack_check_initialized = 0;
-
-void Stack_check_Initialize( void )
-{
-#if 0
- rtems_status_code status;
- Objects_Id id_ignored;
-#endif
- unsigned32 *p;
-#if 0
- unsigned32 i;
- unsigned32 class_index;
- Thread_Control *the_thread;
- Objects_Information *information;
-#endif
-
- if (stack_check_initialized)
- return;
-
- /*
- * Dope the pattern and fill areas
- */
-
- for ( p = Stack_check_Pattern.pattern;
- p < &Stack_check_Pattern.pattern[PATTERN_SIZE_WORDS];
- p += 4
- )
- {
- p[0] = 0xFEEDF00D; /* FEED FOOD to BAD DOG */
- p[1] = 0x0BAD0D06;
- p[2] = 0xDEADF00D; /* DEAD FOOD GOOD DOG */
- p[3] = 0x600D0D06;
- };
-
-#if 0
- status = rtems_extension_create(
- rtems_build_name( 'S', 'T', 'C', 'K' ),
- &Stack_check_Extension_table,
- &id_ignored
- );
- assert ( status == RTEMS_SUCCESSFUL );
-#endif
-
- Stack_check_Blown_task = 0;
-
- /*
- * If installed by a task, that task will not get setup properly
- * since it missed out on the create hook. This will cause a
- * failure on first switch out of that task.
- * So pretend here that we actually ran create and begin extensions.
- */
-
- /* XXX
- *
- * Technically this has not been done for any task created before this
- * happened. So just run through them and fix the situation.
- */
-#if 0
- if (_Thread_Executing)
- {
- Stack_check_Create_extension(_Thread_Executing, _Thread_Executing);
- }
-#endif
-
-#if 0
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
- Stack_check_Create_extension( the_thread, the_thread );
- }
- }
- }
-#endif
-
- /*
- * If appropriate, setup the interrupt stack for high water testing
- * also.
- */
- if (_CPU_Interrupt_stack_low && _CPU_Interrupt_stack_high)
- {
- stack_check_interrupt_stack.area = _CPU_Interrupt_stack_low;
- stack_check_interrupt_stack.size = (char *) _CPU_Interrupt_stack_high -
- (char *) _CPU_Interrupt_stack_low;
-
- stack_check_dope_stack(&stack_check_interrupt_stack);
- }
-
-#ifdef DONT_USE_FATAL_EXTENSION
-#ifdef RTEMS_DEBUG
- /*
- * this would normally be called by a fatal extension
- * handler, but we don't run fatal extensions unless
- * we fatal error.
- */
- atexit(Stack_check_Dump_usage);
-#endif
-#endif
-
- stack_check_initialized = 1;
-}
-
-/*PAGE
- *
- * Stack_check_Create_extension
- */
-
-boolean Stack_check_Create_extension(
- Thread_Control *running,
- Thread_Control *the_thread
-)
-{
- if (!stack_check_initialized)
- Stack_check_Initialize();
-
- if (the_thread /* XXX && (the_thread != _Thread_Executing) */ )
- stack_check_dope_stack(&the_thread->Start.Initial_stack);
-
- return TRUE;
-}
-
-/*PAGE
- *
- * Stack_check_Begin_extension
- */
-
-void Stack_check_Begin_extension(
- Thread_Control *the_thread
-)
-{
- Stack_check_Control *the_pattern;
-
- if (!stack_check_initialized)
- Stack_check_Initialize();
-
- if ( the_thread->Object.id == 0 ) /* skip system tasks */
- return;
-
- the_pattern = Stack_check_Get_pattern_area(&the_thread->Start.Initial_stack);
-
- *the_pattern = Stack_check_Pattern;
-}
-
-/*PAGE
- *
- * Stack_check_report_blown_task
- * Report a blown stack. Needs to be a separate routine
- * so that interrupt handlers can use this too.
- *
- * Caller must have set the Stack_check_Blown_task.
- *
- * NOTE: The system is in a questionable state... we may not get
- * the following message out.
- */
-
-void Stack_check_report_blown_task(void)
-{
- Stack_Control *stack;
- Thread_Control *running;
-
- running = Stack_check_Blown_task;
- stack = &running->Start.Initial_stack;
-
- fprintf(
- stderr,
- "BLOWN STACK!!! Offending task(%p): id=0x%08x; name=0x%08x",
- running,
- running->Object.id,
- *(unsigned32 *)running->Object.name
- );
- fflush(stderr);
-
- if (BSP_Configuration.User_multiprocessing_table)
- fprintf(
- stderr,
- "; node=%d\n",
- BSP_Configuration.User_multiprocessing_table->node
- );
- else
- fprintf(stderr, "\n");
- fflush(stderr);
-
- fprintf(
- stderr,
- " stack covers range 0x%08x - 0x%08x (%d bytes)\n",
- (unsigned32) stack->area,
- (unsigned32) stack->area + stack->size - 1,
- (unsigned32) stack->size);
- fflush(stderr);
-
- fprintf(
- stderr,
- " Damaged pattern begins at 0x%08x and is %d bytes long\n",
- (unsigned32) Stack_check_Get_pattern_area(stack), PATTERN_SIZE_BYTES);
- fflush(stderr);
-
- rtems_fatal_error_occurred( (unsigned32) "STACK BLOWN" );
-}
-
-/*PAGE
- *
- * Stack_check_Switch_extension
- */
-
-void Stack_check_Switch_extension(
- Thread_Control *running,
- Thread_Control *heir
-)
-{
- if ( running->Object.id == 0 ) /* skip system tasks */
- return;
-
- if (0 != memcmp( (void *) Stack_check_Get_pattern_area( &running->Start.Initial_stack)->pattern,
- (void *) Stack_check_Pattern.pattern,
- PATTERN_SIZE_BYTES))
- {
- Stack_check_Blown_task = running;
- Stack_check_report_blown_task();
- }
-}
-
-void *Stack_check_find_high_water_mark(
- const void *s,
- size_t n
-)
-{
- const unsigned32 *base, *ebase;
- unsigned32 length;
-
- base = s;
- length = n/4;
-
-#if ( CPU_STACK_GROWS_UP == TRUE )
- /*
- * start at higher memory and find first word that does not
- * match pattern
- */
-
- base += length - 1;
- for (ebase = s; base > ebase; base--)
- if (*base != U32_PATTERN)
- return (void *) base;
-#else
- /*
- * start at lower memory and find first word that does not
- * match pattern
- */
-
- base += PATTERN_SIZE_WORDS;
- for (ebase = base + length; base < ebase; base++)
- if (*base != U32_PATTERN)
- return (void *) base;
-#endif
-
- return (void *)0;
-}
-
-/*PAGE
- *
- * Stack_check_Dump_threads_usage
- * Try to print out how much stack was actually used by the task.
- *
- */
-
-void Stack_check_Dump_threads_usage(
- Thread_Control *the_thread
-)
-{
- unsigned32 size, used;
- void *low;
- void *high_water_mark;
- Stack_Control *stack;
- unsigned32 u32_name;
- char name[5];
-
-
- if ( !the_thread )
- return;
-
- /*
- * XXX HACK to get to interrupt stack
- */
-
- if (the_thread == (Thread_Control *) -1)
- {
- if (stack_check_interrupt_stack.area)
- {
- stack = &stack_check_interrupt_stack;
- the_thread = 0;
- }
- else
- return;
- }
- else
- stack = &the_thread->Start.Initial_stack;
-
- low = Stack_check_usable_stack_start(stack);
- size = Stack_check_usable_stack_size(stack);
-
- high_water_mark = Stack_check_find_high_water_mark(low, size);
-
- if ( high_water_mark )
- used = Stack_check_Calculate_used( low, size, high_water_mark );
- else
- used = 0;
-
- if ( the_thread )
- u32_name = *(unsigned32 *)the_thread->Object.name;
- else
- u32_name = rtems_build_name('I', 'N', 'T', 'R');
-
- name[ 0 ] = (u32_name >> 24) & 0xff;
- name[ 1 ] = (u32_name >> 16) & 0xff;
- name[ 2 ] = (u32_name >> 8) & 0xff;
- name[ 3 ] = (u32_name >> 0) & 0xff;
- name[ 4 ] = '\0';
-
- printf( "0x%08x %4s 0x%08x 0x%08x %8d %8d\n",
- the_thread ? the_thread->Object.id : ~0,
- name,
- (unsigned32) stack->area,
- (unsigned32) stack->area + (unsigned32) stack->size - 1,
- size,
- used
- );
-}
-
-/*PAGE
- *
- * Stack_check_Fatal_extension
- */
-
-void Stack_check_Fatal_extension(
- Internal_errors_Source source,
- boolean is_internal,
- unsigned32 status
-)
-{
-#ifndef DONT_USE_FATAL_EXTENSION
- if (status == 0)
- Stack_check_Dump_usage();
-#endif
-}
-
-
-/*PAGE
- *
- * Stack_check_Dump_usage
- */
-
-void Stack_check_Dump_usage( void )
-{
- unsigned32 i;
- unsigned32 class_index;
- Thread_Control *the_thread;
- unsigned32 hit_running = 0;
- Objects_Information *information;
-
- if (stack_check_initialized == 0)
- return;
-
- printf("Stack usage by thread\n");
- printf(
- " ID NAME LOW HIGH AVAILABLE USED\n"
- );
-
- for ( class_index = OBJECTS_CLASSES_FIRST ;
- class_index <= OBJECTS_CLASSES_LAST ;
- class_index++ ) {
- information = _Objects_Information_table[ class_index ];
- if ( information && information->is_thread ) {
- for ( i=1 ; i <= information->maximum ; i++ ) {
- the_thread = (Thread_Control *)information->local_table[ i ];
- Stack_check_Dump_threads_usage( the_thread );
- if ( the_thread == _Thread_Executing )
- hit_running = 1;
- }
- }
- }
-
- if ( !hit_running )
- Stack_check_Dump_threads_usage( _Thread_Executing );
-
- /* dump interrupt stack info if any */
- Stack_check_Dump_threads_usage((Thread_Control *) -1);
-}
-
diff --git a/cpukit/libmisc/stackchk/internal.h b/cpukit/libmisc/stackchk/internal.h
deleted file mode 100644
index 96d0c3f10a..0000000000
--- a/cpukit/libmisc/stackchk/internal.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* internal.h
- *
- * This include file contains internal information
- * for the RTEMS stack checker.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INTERNAL_STACK_CHECK_h
-#define __INTERNAL_STACK_CHECK_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This structure is used to fill in and compare the "end of stack"
- * marker pattern.
- * pattern area must be a multiple of 4 words.
- */
-
-#ifdef CPU_STACK_CHECK_SIZE
-#define PATTERN_SIZE_WORDS (((CPU_STACK_CHECK_SIZE / 4) + 3) & ~0x3)
-#else
-#define PATTERN_SIZE_WORDS 4
-#endif
-
-#define PATTERN_SIZE_BYTES (PATTERN_SIZE_WORDS * 4)
-
-typedef struct {
- unsigned32 pattern[ PATTERN_SIZE_WORDS ];
-} Stack_check_Control;
-
-/*
- * The pattern used to fill the entire stack.
- */
-
-#define BYTE_PATTERN 0xA5
-#define U32_PATTERN 0xA5A5A5A5
-
-/*
- * Stack_check_Create_extension
- */
-
-boolean Stack_check_Create_extension(
- Thread_Control *running,
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Begin_extension
- */
-
-void Stack_check_Begin_extension(
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Switch_extension
- */
-
-void Stack_check_Switch_extension(
- Thread_Control *running,
- Thread_Control *heir
-);
-
-/*
- * Stack_check_Fatal_extension
- */
-
-void Stack_check_Fatal_extension(
- Internal_errors_Source source,
- boolean is_internal,
- unsigned32 status
-);
-
-/*
- * Stack_check_Dump_usage
- */
-
-void Stack_check_Dump_usage( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/libmisc/stackchk/stackchk.h b/cpukit/libmisc/stackchk/stackchk.h
deleted file mode 100644
index 1b40da5e0c..0000000000
--- a/cpukit/libmisc/stackchk/stackchk.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* stackchk.h
- *
- * This include file contains information necessary to utilize
- * and install the stack checker mechanism.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STACK_CHECK_h
-#define __STACK_CHECK_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Stack_check_Initialize
- */
-
-void Stack_check_Initialize( void );
-
-/*
- * Stack_check_Dump_usage
- */
-
-void Stack_check_Dump_usage( void );
-
-/*
- * Stack_check_Create_extension
- */
-
-boolean Stack_check_Create_extension(
- Thread_Control *running,
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Begin_extension
- */
-
-void Stack_check_Begin_extension(
- Thread_Control *the_thread
-);
-
-/*
- * Stack_check_Switch_extension
- */
-
-void Stack_check_Switch_extension(
- Thread_Control *running,
- Thread_Control *heir
-);
-
-/*
- * Extension set definition
- */
-
-#define STACK_CHECKER_EXTENSION \
-{ \
- Stack_check_Create_extension, /* rtems_task_create */ \
- 0, /* rtems_task_start */ \
- 0, /* rtems_task_restart */ \
- 0, /* rtems_task_delete */ \
- Stack_check_Switch_extension, /* task_switch */ \
- Stack_check_Begin_extension, /* task_begin */ \
- 0, /* task_exitted */ \
- 0 /* Stack_check_Fatal_extension */, /* fatal */ \
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/libnetworking/README b/cpukit/libnetworking/README
deleted file mode 100644
index d0c22ec688..0000000000
--- a/cpukit/libnetworking/README
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# $Id$
-#
-
-This is a snapshot of my attempt to fit the FreeBSD networking code into
-RTEMS. Things seem to be working!
-
-Things that need to be done:
- 1) More documentation!
- 2) Figure out what's still not working :-)
- 3) Rationalize the include files. Right now I have a special
- hack in the Makefile to ensure that I pick up the FreeBSD versions
- of the include files that are duplicated between RTEMS
- and FreeBSD.
- The network device driver source should move to the BSP source tree.
- 4) Have a look at all the FIXME comments.
- 5) Go through and make sure that all the source files are
- free of undesired copyright restrictions.
diff --git a/cpukit/libnetworking/arpa/ftp.h b/cpukit/libnetworking/arpa/ftp.h
deleted file mode 100644
index 584d290bc9..0000000000
--- a/cpukit/libnetworking/arpa/ftp.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 1983, 1989, 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.
- *
- * @(#)ftp.h 8.1 (Berkeley) 6/2/93
- *
- * $Id$
- */
-
-#ifndef _ARPA_FTP_H_
-#define _ARPA_FTP_H_
-
-/* Definitions for FTP; see RFC-765. */
-
-/*
- * 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 */
-
-/*
- * Type codes
- */
-#define TYPE_A 1 /* ASCII */
-#define TYPE_E 2 /* EBCDIC */
-#define TYPE_I 3 /* image */
-#define TYPE_L 4 /* local byte size */
-
-#ifdef FTP_NAMES
-char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
-#endif
-
-/*
- * Form codes
- */
-#define FORM_N 1 /* non-print */
-#define FORM_T 2 /* telnet format effectors */
-#define FORM_C 3 /* carriage control (ASA) */
-#ifdef FTP_NAMES
-char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
-#endif
-
-/*
- * Structure codes
- */
-#define STRU_F 1 /* file (no record structure) */
-#define STRU_R 2 /* record structure */
-#define STRU_P 3 /* page structure */
-#ifdef FTP_NAMES
-char *strunames[] = {"0", "File", "Record", "Page" };
-#endif
-
-/*
- * Mode types
- */
-#define MODE_S 1 /* stream */
-#define MODE_B 2 /* block */
-#define MODE_C 3 /* compressed */
-#ifdef FTP_NAMES
-char *modenames[] = {"0", "Stream", "Block", "Compressed" };
-#endif
-
-/*
- * Record Tokens
- */
-#define REC_ESC '\377' /* Record-mode Escape */
-#define REC_EOR '\001' /* Record-mode End-of-Record */
-#define REC_EOF '\002' /* Record-mode End-of-File */
-
-/*
- * Block Header
- */
-#define BLK_EOR 0x80 /* Block is End-of-Record */
-#define BLK_EOF 0x40 /* Block is End-of-File */
-#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
-#define BLK_RESTART 0x10 /* Block is Restart Marker */
-
-#define BLK_BYTECOUNT 2 /* Bytes in this block */
-
-#endif /* !_FTP_H_ */
diff --git a/cpukit/libnetworking/arpa/inet.h b/cpukit/libnetworking/arpa/inet.h
deleted file mode 100644
index ad5332e7ab..0000000000
--- a/cpukit/libnetworking/arpa/inet.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * @(#)inet.h 8.1 (Berkeley) 6/2/93
- * From: Id: inet.h,v 8.5 1997/01/29 08:48:09 vixie Exp $
- * $Id$
- */
-
-#ifndef _ARPA_INET_H_
-#define _ARPA_INET_H_
-
-/* External definitions for functions in inet(3), addr2ascii(3) */
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-struct in_addr;
-
-#if 0 /* RTEMS -- Why rename these? */
-/* XXX all new diversions!! argh!! */
-#define inet_addr __inet_addr
-#define inet_aton __inet_aton
-#define inet_lnaof __inet_lnaof
-#define inet_makeaddr __inet_makeaddr
-#define inet_neta __inet_neta
-#define inet_netof __inet_netof
-#define inet_network __inet_network
-#define inet_net_ntop __inet_net_ntop
-#define inet_net_pton __inet_net_pton
-#define inet_ntoa __inet_ntoa
-#define inet_pton __inet_pton
-#define inet_ntop __inet_ntop
-#define inet_nsap_addr __inet_nsap_addr
-#define inet_nsap_ntoa __inet_nsap_ntoa
-#endif
-
-__BEGIN_DECLS
-int ascii2addr __P((int, const char *, void *));
-char *addr2ascii __P((int, const void *, int, char *));
-unsigned long inet_addr __P((const char *));
-int inet_aton __P((const char *, struct in_addr *));
-unsigned long inet_lnaof __P((struct in_addr));
-struct in_addr inet_makeaddr __P((u_long , u_long));
-char * inet_neta __P((u_long, char *, size_t));
-unsigned long inet_netof __P((struct in_addr));
-unsigned long inet_network __P((const char *));
-char *inet_net_ntop __P((int, const void *, int, char *, size_t));
-int inet_net_pton __P((int, const char *, void *, size_t));
-char *inet_ntoa __P((struct in_addr));
-int inet_pton __P((int, const char *, void *));
-const char *inet_ntop __P((int, const void *, char *, size_t));
-u_int inet_nsap_addr __P((const char *, u_char *, int));
-char *inet_nsap_ntoa __P((int, const u_char *, char *));
-__END_DECLS
-
-#endif /* !_INET_H_ */
diff --git a/cpukit/libnetworking/arpa/nameser.h b/cpukit/libnetworking/arpa/nameser.h
deleted file mode 100644
index 634dece37b..0000000000
--- a/cpukit/libnetworking/arpa/nameser.h
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
- * Copyright (c) 1983, 1989, 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.
- */
-
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * From: Id: nameser.h,v 8.16 1998/02/06 00:35:58 halley Exp
- * $Id$
- */
-
-#ifndef _ARPA_NAMESER_H_
-#define _ARPA_NAMESER_H_
-
-#define BIND_4_COMPAT
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-/*
- * revision information. this is the release date in YYYYMMDD format.
- * it can change every day so the right thing to do with it is use it
- * in preprocessor commands such as "#if (__NAMESER > 19931104)". do not
- * compare for equality; rather, use it to determine whether your libnameser.a
- * is new enough to contain a certain feature.
- */
-
-/* XXXRTH I made this bigger than __BIND in 4.9.5 T6B */
-#define __NAMESER 19961001 /* New interface version stamp. */
-
-/*
- * Define constants based on RFC 883, RFC 1034, RFC 1035
- */
-#define NS_PACKETSZ 512 /* maximum packet size */
-#define NS_MAXDNAME 1025 /* maximum domain name */
-#define NS_MAXCDNAME 255 /* maximum compressed domain name */
-#define NS_MAXLABEL 63 /* maximum length of domain label */
-#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
-#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
-#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
-#define NS_INT32SZ 4 /* #/bytes of data in a u_int32_t */
-#define NS_INT16SZ 2 /* #/bytes of data in a u_int16_t */
-#define NS_INT8SZ 1 /* #/bytes of data in a u_int8_t */
-#define NS_INADDRSZ 4 /* IPv4 T_A */
-#define NS_IN6ADDRSZ 16 /* IPv6 T_AAAA */
-#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
-#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
-
-/*
- * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()
- * in synch with it.
- */
-typedef enum __ns_sect {
- ns_s_qd = 0, /* Query: Question. */
- ns_s_zn = 0, /* Update: Zone. */
- ns_s_an = 1, /* Query: Answer. */
- ns_s_pr = 1, /* Update: Prerequisites. */
- ns_s_ns = 2, /* Query: Name servers. */
- ns_s_ud = 2, /* Update: Update. */
- ns_s_ar = 3, /* Query|Update: Additional records. */
- ns_s_max = 4
-} ns_sect;
-
-/*
- * This is a message handle. It is caller allocated and has no dynamic data.
- * This structure is intended to be opaque to all but ns_parse.c, thus the
- * leading _'s on the member names. Use the accessor functions, not the _'s.
- */
-typedef struct __ns_msg {
- const u_char *_msg, *_eom;
- u_int16_t _id, _flags, _counts[ns_s_max];
- const u_char *_sections[ns_s_max];
- ns_sect _sect;
- int _rrnum;
- const u_char *_ptr;
-} ns_msg;
-
-/* Private data structure - do not use from outside library. */
-struct _ns_flagdata { int mask, shift; };
-extern struct _ns_flagdata _ns_flagdata[];
-
-/* Accessor macros - this is part of the public interface. */
-#define ns_msg_getflag(handle, flag) ( \
- ((handle)._flags & _ns_flagdata[flag].mask) \
- >> _ns_flagdata[flag].shift \
- )
-#define ns_msg_id(handle) ((handle)._id + 0)
-#define ns_msg_base(handle) ((handle)._msg + 0)
-#define ns_msg_end(handle) ((handle)._eom + 0)
-#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
-#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
-
-/*
- * This is a parsed record. It is caller allocated and has no dynamic data.
- */
-typedef struct __ns_rr {
- char name[NS_MAXDNAME]; /* XXX need to malloc */
- u_int16_t type;
- u_int16_t class;
- u_int32_t ttl;
- u_int16_t rdlength;
- const u_char *rdata;
-} ns_rr;
-
-/* Accessor macros - this is part of the public interface. */
-#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
-#define ns_rr_type(rr) ((rr).type + 0)
-#define ns_rr_class(rr) ((rr).class + 0)
-#define ns_rr_ttl(rr) ((rr).ttl + 0)
-#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
-#define ns_rr_rdata(rr) ((rr).rdata + 0)
-
-/*
- * These don't have to be in the same order as in the packet flags word,
- * and they can even overlap in some cases, but they will need to be kept
- * in synch with ns_parse.c:ns_flagdata[].
- */
-typedef enum __ns_flag {
- ns_f_qr, /* Question/Response. */
- ns_f_opcode, /* Operation code. */
- ns_f_aa, /* Authoritative Answer. */
- ns_f_tc, /* Truncation occurred. */
- ns_f_rd, /* Recursion Desired. */
- ns_f_ra, /* Recursion Available. */
- ns_f_z, /* MBZ. */
- ns_f_ad, /* Authentic Data (DNSSEC). */
- ns_f_cd, /* Checking Disabled (DNSSEC). */
- ns_f_rcode, /* Response code. */
- ns_f_max
-} ns_flag;
-
-/*
- * Currently defined opcodes.
- */
-typedef enum __ns_opcode {
- ns_o_query = 0, /* Standard query. */
- ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
- ns_o_status = 2, /* Name server status query (unsupported). */
- /* Opcode 3 is undefined/reserved. */
- ns_o_notify = 4, /* Zone change notification. */
- ns_o_update = 5, /* Zone update message. */
- ns_o_max = 6
-} ns_opcode;
-
-/*
- * Currently defined response codes.
- */
-typedef enum __ns_rcode {
- ns_r_noerror = 0, /* No error occurred. */
- ns_r_formerr = 1, /* Format error. */
- ns_r_servfail = 2, /* Server failure. */
- ns_r_nxdomain = 3, /* Name error. */
- ns_r_notimpl = 4, /* Unimplemented. */
- ns_r_refused = 5, /* Operation refused. */
- /* these are for BIND_UPDATE */
- ns_r_yxdomain = 6, /* Name exists */
- ns_r_yxrrset = 7, /* RRset exists */
- ns_r_nxrrset = 8, /* RRset does not exist */
- ns_r_notauth = 9, /* Not authoritative for zone */
- ns_r_notzone = 10, /* Zone of record different from zone section */
- ns_r_max = 11
-} ns_rcode;
-
-/* BIND_UPDATE */
-typedef enum __ns_update_operation {
- ns_uop_delete = 0,
- ns_uop_add = 1,
- ns_uop_max = 2
-} ns_update_operation;
-
-/*
- * This RR-like structure is particular to UPDATE.
- */
-struct ns_updrec {
- struct ns_updrec *r_prev; /* prev record */
- struct ns_updrec *r_next; /* next record */
- u_int8_t r_section; /* ZONE/PREREQUISITE/UPDATE */
- char * r_dname; /* owner of the RR */
- u_int16_t r_class; /* class number */
- u_int16_t r_type; /* type number */
- u_int32_t r_ttl; /* time to live */
- u_char * r_data; /* rdata fields as text string */
- u_int16_t r_size; /* size of r_data field */
- int r_opcode; /* type of operation */
- /* following fields for private use by the resolver/server routines */
- struct ns_updrec *r_grpnext; /* next record when grouped */
- struct databuf *r_dp; /* databuf to process */
- struct databuf *r_deldp; /* databuf's deleted/overwritten */
- u_int16_t r_zone; /* zone number on server */
-};
-typedef struct ns_updrec ns_updrec;
-
-/*
- * Currently defined type values for resources and queries.
- */
-typedef enum __ns_type {
- ns_t_a = 1, /* Host address. */
- ns_t_ns = 2, /* Authoritative server. */
- ns_t_md = 3, /* Mail destination. */
- ns_t_mf = 4, /* Mail forwarder. */
- ns_t_cname = 5, /* Canonical name. */
- ns_t_soa = 6, /* Start of authority zone. */
- ns_t_mb = 7, /* Mailbox domain name. */
- ns_t_mg = 8, /* Mail group member. */
- ns_t_mr = 9, /* Mail rename name. */
- ns_t_null = 10, /* Null resource record. */
- ns_t_wks = 11, /* Well known service. */
- ns_t_ptr = 12, /* Domain name pointer. */
- ns_t_hinfo = 13, /* Host information. */
- ns_t_minfo = 14, /* Mailbox information. */
- ns_t_mx = 15, /* Mail routing information. */
- ns_t_txt = 16, /* Text strings. */
- ns_t_rp = 17, /* Responsible person. */
- ns_t_afsdb = 18, /* AFS cell database. */
- ns_t_x25 = 19, /* X_25 calling address. */
- ns_t_isdn = 20, /* ISDN calling address. */
- ns_t_rt = 21, /* Router. */
- ns_t_nsap = 22, /* NSAP address. */
- ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
- ns_t_sig = 24, /* Security signature. */
- ns_t_key = 25, /* Security key. */
- ns_t_px = 26, /* X.400 mail mapping. */
- ns_t_gpos = 27, /* Geographical position (withdrawn). */
- ns_t_aaaa = 28, /* Ip6 Address. */
- ns_t_loc = 29, /* Location Information. */
- ns_t_nxt = 30, /* Next domain (security). */
- ns_t_eid = 31, /* Endpoint identifier. */
- ns_t_nimloc = 32, /* Nimrod Locator. */
- ns_t_srv = 33, /* Server Selection. */
- ns_t_atma = 34, /* ATM Address */
- ns_t_naptr = 35, /* Naming Authority PoinTeR */
- /* Query type values which do not appear in resource records. */
- ns_t_ixfr = 251, /* Incremental zone transfer. */
- ns_t_axfr = 252, /* Transfer zone of authority. */
- ns_t_mailb = 253, /* Transfer mailbox records. */
- ns_t_maila = 254, /* Transfer mail agent records. */
- ns_t_any = 255, /* Wildcard match. */
- ns_t_max = 65536
-} ns_type;
-
-/*
- * Values for class field
- */
-typedef enum __ns_class {
- ns_c_in = 1, /* Internet. */
- /* Class 2 unallocated/unsupported. */
- ns_c_chaos = 3, /* MIT Chaos-net. */
- ns_c_hs = 4, /* MIT Hesiod. */
- /* Query class values which do not appear in resource records */
- ns_c_none = 254, /* for prereq. sections in update requests */
- ns_c_any = 255, /* Wildcard match. */
- ns_c_max = 65536
-} ns_class;
-
-/*
- * Flags field of the KEY RR rdata
- */
-#define NS_KEY_TYPEMASK 0xC000 /* Mask for "type" bits */
-#define NS_KEY_TYPE_AUTH_CONF 0x0000 /* Key usable for both */
-#define NS_KEY_TYPE_CONF_ONLY 0x8000 /* Key usable for confidentiality */
-#define NS_KEY_TYPE_AUTH_ONLY 0x4000 /* Key usable for authentication */
-#define NS_KEY_TYPE_NO_KEY 0xC000 /* No key usable for either; no key */
-/* The type bits can also be interpreted independently, as single bits: */
-#define NS_KEY_NO_AUTH 0x8000 /* Key unusable for authentication */
-#define NS_KEY_NO_CONF 0x4000 /* Key unusable for confidentiality */
-#define NS_KEY_EXPERIMENTAL 0x2000 /* Security is *mandatory* if bit=0 */
-#define NS_KEY_RESERVED3 0x1000 /* reserved - must be zero */
-#define NS_KEY_RESERVED4 0x0800 /* reserved - must be zero */
-#define NS_KEY_USERACCOUNT 0x0400 /* key is assoc. with a user acct */
-#define NS_KEY_ENTITY 0x0200 /* key is assoc. with entity eg host */
-#define NS_KEY_ZONEKEY 0x0100 /* key is zone key */
-#define NS_KEY_IPSEC 0x0080 /* key is for IPSEC (host or user)*/
-#define NS_KEY_EMAIL 0x0040 /* key is for email (MIME security) */
-#define NS_KEY_RESERVED10 0x0020 /* reserved - must be zero */
-#define NS_KEY_RESERVED11 0x0010 /* reserved - must be zero */
-#define NS_KEY_SIGNATORYMASK 0x000F /* key can sign RR's of same name */
-
-#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED3 | \
- NS_KEY_RESERVED4 | \
- NS_KEY_RESERVED10 | \
- NS_KEY_RESERVED11 )
-
-/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
-#define NS_ALG_MD5RSA 1 /* MD5 with RSA */
-#define NS_ALG_EXPIRE_ONLY 253 /* No alg, no security */
-#define NS_ALG_PRIVATE_OID 254 /* Key begins with OID giving alg */
-
-/* Signatures */
-#define NS_MD5RSA_MIN_BITS 512 /* Size of a mod or exp in bits */
-#define NS_MD5RSA_MAX_BITS 2552
- /* Total of binary mod and exp */
-#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
- /* Max length of text sig block */
-#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
-
-/* Offsets into SIG record rdata to find various values */
-#define NS_SIG_TYPE 0 /* Type flags */
-#define NS_SIG_ALG 2 /* Algorithm */
-#define NS_SIG_LABELS 3 /* How many labels in name */
-#define NS_SIG_OTTL 4 /* Original TTL */
-#define NS_SIG_EXPIR 8 /* Expiration time */
-#define NS_SIG_SIGNED 12 /* Signature time */
-#define NS_SIG_FOOT 16 /* Key footprint */
-#define NS_SIG_SIGNER 18 /* Domain name of who signed it */
-
-/* How RR types are represented as bit-flags in NXT records */
-#define NS_NXT_BITS 8
-#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
-
-
-/*
- * Inline versions of get/put short/long. Pointer is advanced.
- */
-#define NS_GET16(s, cp) { \
- register u_char *t_cp = (u_char *)(cp); \
- (s) = ((u_int16_t)t_cp[0] << 8) \
- | ((u_int16_t)t_cp[1]) \
- ; \
- (cp) += NS_INT16SZ; \
-}
-
-#define NS_GET32(l, cp) { \
- register u_char *t_cp = (u_char *)(cp); \
- (l) = ((u_int32_t)t_cp[0] << 24) \
- | ((u_int32_t)t_cp[1] << 16) \
- | ((u_int32_t)t_cp[2] << 8) \
- | ((u_int32_t)t_cp[3]) \
- ; \
- (cp) += NS_INT32SZ; \
-}
-
-#define NS_PUT16(s, cp) { \
- register u_int16_t t_s = (u_int16_t)(s); \
- register u_char *t_cp = (u_char *)(cp); \
- *t_cp++ = t_s >> 8; \
- *t_cp = t_s; \
- (cp) += NS_INT16SZ; \
-}
-
-#define NS_PUT32(l, cp) { \
- register u_int32_t t_l = (u_int32_t)(l); \
- register u_char *t_cp = (u_char *)(cp); \
- *t_cp++ = t_l >> 24; \
- *t_cp++ = t_l >> 16; \
- *t_cp++ = t_l >> 8; \
- *t_cp = t_l; \
- (cp) += NS_INT32SZ; \
-}
-
-/*
- * ANSI C identifier hiding.
- */
-#define ns_get16 __ns_get16
-#define ns_get32 __ns_get32
-#define ns_put16 __ns_put16
-#define ns_put32 __ns_put32
-#define ns_initparse __ns_initparse
-#define ns_parserr __ns_parserr
-#define ns_sprintrr __ns_sprintrr
-#define ns_sprintrrf __ns_sprintrrf
-#define ns_format_ttl __ns_format_ttl
-#define ns_parse_ttl __ns_parse_ttl
-#define ns_name_ntop __ns_name_ntop
-#define ns_name_pton __ns_name_pton
-#define ns_name_unpack __ns_name_unpack
-#define ns_name_pack __ns_name_pack
-#define ns_name_compress __ns_name_compress
-#define ns_name_uncompress __ns_name_uncompress
-
-__BEGIN_DECLS
-u_int ns_get16 __P((const u_char *));
-u_long ns_get32 __P((const u_char *));
-void ns_put16 __P((u_int, u_char *));
-void ns_put32 __P((u_long, u_char *));
-int ns_initparse __P((const u_char *, int, ns_msg *));
-int ns_parserr __P((ns_msg *, ns_sect, int, ns_rr *));
-int ns_sprintrr __P((const ns_msg *, const ns_rr *,
- const char *, const char *, char *, size_t));
-int ns_sprintrrf __P((const u_char *, size_t, const char *,
- ns_class, ns_type, u_long, const u_char *,
- size_t, const char *, const char *,
- char *, size_t));
-int ns_format_ttl __P((u_long, char *, size_t));
-int ns_parse_ttl __P((const char *, u_long *));
-int ns_name_ntop __P((const u_char *, char *, size_t));
-int ns_name_pton __P((const char *, u_char *, size_t));
-int ns_name_unpack __P((const u_char *, const u_char *,
- const u_char *, u_char *, size_t));
-int ns_name_pack __P((const u_char *, u_char *, int,
- const u_char **, const u_char **));
-int ns_name_uncompress __P((const u_char *, const u_char *,
- const u_char *, char *, size_t));
-int ns_name_compress __P((const char *, u_char *, size_t,
- const u_char **, const u_char **));
-int ns_name_skip __P((const u_char **, const u_char *));
-__END_DECLS
-
-#ifdef BIND_4_COMPAT
-#include <arpa/nameser_compat.h>
-#endif
-
-#endif /* !_ARPA_NAMESER_H_ */
diff --git a/cpukit/libnetworking/arpa/nameser_compat.h b/cpukit/libnetworking/arpa/nameser_compat.h
deleted file mode 100644
index 2ab5b47386..0000000000
--- a/cpukit/libnetworking/arpa/nameser_compat.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/* Copyright (c) 1983, 1989
- * 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.
- */
-
-/*
- * from nameser.h 8.1 (Berkeley) 6/2/93
- * From: Id: nameser_compat.h,v 8.9 1998/03/20 23:25:10 halley Exp
- * $Id$
- */
-
-#ifndef _ARPA_NAMESER_COMPAT_
-#define _ARPA_NAMESER_COMPAT_
-
-#define __BIND 19950621 /* (DEAD) interface version stamp. */
-
-#include <machine/endian.h>
-
-#if !defined(BYTE_ORDER) || \
- (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
- BYTE_ORDER != PDP_ENDIAN)
- /* you must determine what the correct bit order is for
- * your compiler - the next line is an intentional error
- * which will force your compiles to bomb until you fix
- * the above macros.
- */
- error "Undefined or invalid BYTE_ORDER";
-#endif
-
-/*
- * Structure for query header. The order of the fields is machine- and
- * compiler-dependent, depending on the byte/bit order and the layout
- * of bit fields. We use bit fields only in int variables, as this
- * is all ANSI requires. This requires a somewhat confusing rearrangement.
- */
-
-typedef struct {
- unsigned id :16; /* query identification number */
-#if BYTE_ORDER == BIG_ENDIAN
- /* fields in third byte */
- unsigned qr: 1; /* response flag */
- unsigned opcode: 4; /* purpose of message */
- unsigned aa: 1; /* authoritive answer */
- unsigned tc: 1; /* truncated message */
- unsigned rd: 1; /* recursion desired */
- /* fields in fourth byte */
- unsigned ra: 1; /* recursion available */
- unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
- unsigned ad: 1; /* authentic data from named */
- unsigned cd: 1; /* checking disabled by resolver */
- unsigned rcode :4; /* response code */
-#endif
-#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
- /* fields in third byte */
- unsigned rd :1; /* recursion desired */
- unsigned tc :1; /* truncated message */
- unsigned aa :1; /* authoritive answer */
- unsigned opcode :4; /* purpose of message */
- unsigned qr :1; /* response flag */
- /* fields in fourth byte */
- unsigned rcode :4; /* response code */
- unsigned cd: 1; /* checking disabled by resolver */
- unsigned ad: 1; /* authentic data from named */
- unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
- unsigned ra :1; /* recursion available */
-#endif
- /* remaining bytes */
- unsigned qdcount :16; /* number of question entries */
- unsigned ancount :16; /* number of answer entries */
- unsigned nscount :16; /* number of authority entries */
- unsigned arcount :16; /* number of resource entries */
-} HEADER;
-
-#define PACKETSZ NS_PACKETSZ
-#define MAXDNAME NS_MAXDNAME
-#define MAXCDNAME NS_MAXCDNAME
-#define MAXLABEL NS_MAXLABEL
-#define HFIXEDSZ NS_HFIXEDSZ
-#define QFIXEDSZ NS_QFIXEDSZ
-#define RRFIXEDSZ NS_RRFIXEDSZ
-#define INT32SZ NS_INT32SZ
-#define INT16SZ NS_INT16SZ
-#define INADDRSZ NS_INADDRSZ
-#define IN6ADDRSZ NS_IN6ADDRSZ
-#define INDIR_MASK NS_CMPRSFLGS
-#define NAMESERVER_PORT NS_DEFAULTPORT
-
-#define S_ZONE ns_s_zn
-#define S_PREREQ ns_s_pr
-#define S_UPDATE ns_s_ud
-#define S_ADDT ns_s_ar
-
-#define QUERY ns_o_query
-#define IQUERY ns_o_iquery
-#define STATUS ns_o_status
-#define NS_NOTIFY_OP ns_o_notify
-#define NS_UPDATE_OP ns_o_update
-
-#define NOERROR ns_r_noerror
-#define FORMERR ns_r_formerr
-#define SERVFAIL ns_r_servfail
-#define NXDOMAIN ns_r_nxdomain
-#define NOTIMP ns_r_notimpl
-#define REFUSED ns_r_refused
-#define YXDOMAIN ns_r_yxdomain
-#define YXRRSET ns_r_yxrrset
-#define NXRRSET ns_r_nxrrset
-#define NOTAUTH ns_r_notauth
-#define NOTZONE ns_r_notzone
-
-#define DELETE ns_uop_delete
-#define ADD ns_uop_add
-
-#define T_A ns_t_a
-#define T_NS ns_t_ns
-#define T_MD ns_t_md
-#define T_MF ns_t_mf
-#define T_CNAME ns_t_cname
-#define T_SOA ns_t_soa
-#define T_MB ns_t_mb
-#define T_MG ns_t_mg
-#define T_MR ns_t_mr
-#define T_NULL ns_t_null
-#define T_WKS ns_t_wks
-#define T_PTR ns_t_ptr
-#define T_HINFO ns_t_hinfo
-#define T_MINFO ns_t_minfo
-#define T_MX ns_t_mx
-#define T_TXT ns_t_txt
-#define T_RP ns_t_rp
-#define T_AFSDB ns_t_afsdb
-#define T_X25 ns_t_x25
-#define T_ISDN ns_t_isdn
-#define T_RT ns_t_rt
-#define T_NSAP ns_t_nsap
-#define T_NSAP_PTR ns_t_nsap_ptr
-#define T_SIG ns_t_sig
-#define T_KEY ns_t_key
-#define T_PX ns_t_px
-#define T_GPOS ns_t_gpos
-#define T_AAAA ns_t_aaaa
-#define T_LOC ns_t_loc
-#define T_NXT ns_t_nxt
-#define T_EID ns_t_eid
-#define T_NIMLOC ns_t_nimloc
-#define T_SRV ns_t_srv
-#define T_ATMA ns_t_atma
-#define T_NAPTR ns_t_naptr
-#define T_IXFR ns_t_ixfr
-#define T_AXFR ns_t_axfr
-#define T_MAILB ns_t_mailb
-#define T_MAILA ns_t_maila
-#define T_ANY ns_t_any
-
-#define C_IN ns_c_in
-#define C_CHAOS ns_c_chaos
-#define C_HS ns_c_hs
-/* BIND_UPDATE */
-#define C_NONE ns_c_none
-#define C_ANY ns_c_any
-
-#define GETSHORT NS_GET16
-#define GETLONG NS_GET32
-#define PUTSHORT NS_PUT16
-#define PUTLONG NS_PUT32
-
-#endif /* _ARPA_NAMESER_COMPAT_ */
diff --git a/cpukit/libnetworking/arpa/telnet.h b/cpukit/libnetworking/arpa/telnet.h
deleted file mode 100644
index 09b85692da..0000000000
--- a/cpukit/libnetworking/arpa/telnet.h
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * @(#)telnet.h 8.2 (Berkeley) 12/15/93
- *
- * $Id$
- */
-
-#ifndef _ARPA_TELNET_H_
-#define _ARPA_TELNET_H_
-
-/*
- * Definitions for the TELNET protocol.
- */
-#define IAC 255 /* interpret as command: */
-#define DONT 254 /* you are not to use option */
-#define DO 253 /* please, you use option */
-#define WONT 252 /* I won't use option */
-#define WILL 251 /* I will use option */
-#define SB 250 /* interpret as subnegotiation */
-#define GA 249 /* you may reverse the line */
-#define EL 248 /* erase the current line */
-#define EC 247 /* erase the current character */
-#define AYT 246 /* are you there */
-#define AO 245 /* abort output--but let prog finish */
-#define IP 244 /* interrupt process--permanently */
-#define BREAK 243 /* break */
-#define DM 242 /* data mark--for connect. cleaning */
-#define NOP 241 /* nop */
-#define SE 240 /* end sub negotiation */
-#define EOR 239 /* end of record (transparent mode) */
-#define ABORT 238 /* Abort process */
-#define SUSP 237 /* Suspend process */
-#define xEOF 236 /* End of file: EOF is already used... */
-
-#define SYNCH 242 /* for telfunc calls */
-
-#ifdef TELCMDS
-char *telcmds[] = {
- "EOF", "SUSP", "ABORT", "EOR",
- "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
- "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC",
- 0
-};
-#else
-extern char *telcmds[];
-#endif
-
-#define TELCMD_FIRST xEOF
-#define TELCMD_LAST IAC
-#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
- (unsigned int)(x) >= TELCMD_FIRST)
-#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
-
-/* telnet options */
-#define TELOPT_BINARY 0 /* 8-bit data path */
-#define TELOPT_ECHO 1 /* echo */
-#define TELOPT_RCP 2 /* prepare to reconnect */
-#define TELOPT_SGA 3 /* suppress go ahead */
-#define TELOPT_NAMS 4 /* approximate message size */
-#define TELOPT_STATUS 5 /* give status */
-#define TELOPT_TM 6 /* timing mark */
-#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
-#define TELOPT_NAOL 8 /* negotiate about output line width */
-#define TELOPT_NAOP 9 /* negotiate about output page size */
-#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
-#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
-#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
-#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
-#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
-#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
-#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
-#define TELOPT_XASCII 17 /* extended ascic character set */
-#define TELOPT_LOGOUT 18 /* force logout */
-#define TELOPT_BM 19 /* byte macro */
-#define TELOPT_DET 20 /* data entry terminal */
-#define TELOPT_SUPDUP 21 /* supdup protocol */
-#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
-#define TELOPT_SNDLOC 23 /* send location */
-#define TELOPT_TTYPE 24 /* terminal type */
-#define TELOPT_EOR 25 /* end or record */
-#define TELOPT_TUID 26 /* TACACS user identification */
-#define TELOPT_OUTMRK 27 /* output marking */
-#define TELOPT_TTYLOC 28 /* terminal location number */
-#define TELOPT_3270REGIME 29 /* 3270 regime */
-#define TELOPT_X3PAD 30 /* X.3 PAD */
-#define TELOPT_NAWS 31 /* window size */
-#define TELOPT_TSPEED 32 /* terminal speed */
-#define TELOPT_LFLOW 33 /* remote flow control */
-#define TELOPT_LINEMODE 34 /* Linemode option */
-#define TELOPT_XDISPLOC 35 /* X Display Location */
-#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */
-#define TELOPT_AUTHENTICATION 37/* Authenticate */
-#define TELOPT_ENCRYPT 38 /* Encryption option */
-#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */
-#define TELOPT_EXOPL 255 /* extended-options-list */
-
-
-#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
-#ifdef TELOPTS
-char *telopts[NTELOPTS+1] = {
- "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
- "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
- "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
- "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
- "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
- "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
- "TACACS UID", "OUTPUT MARKING", "TTYLOC",
- "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
- "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
- "ENCRYPT", "NEW-ENVIRON",
- 0
-};
-#define TELOPT_FIRST TELOPT_BINARY
-#define TELOPT_LAST TELOPT_NEW_ENVIRON
-#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
-#define TELOPT(x) telopts[(x)-TELOPT_FIRST]
-#endif
-
-/* sub-option qualifiers */
-#define TELQUAL_IS 0 /* option is... */
-#define TELQUAL_SEND 1 /* send option */
-#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */
-#define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */
-#define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */
-
-#define LFLOW_OFF 0 /* Disable remote flow control */
-#define LFLOW_ON 1 /* Enable remote flow control */
-#define LFLOW_RESTART_ANY 2 /* Restart output on any char */
-#define LFLOW_RESTART_XON 3 /* Restart output only on XON */
-
-/*
- * LINEMODE suboptions
- */
-
-#define LM_MODE 1
-#define LM_FORWARDMASK 2
-#define LM_SLC 3
-
-#define MODE_EDIT 0x01
-#define MODE_TRAPSIG 0x02
-#define MODE_ACK 0x04
-#define MODE_SOFT_TAB 0x08
-#define MODE_LIT_ECHO 0x10
-
-#define MODE_MASK 0x1f
-
-/* Not part of protocol, but needed to simplify things... */
-#define MODE_FLOW 0x0100
-#define MODE_ECHO 0x0200
-#define MODE_INBIN 0x0400
-#define MODE_OUTBIN 0x0800
-#define MODE_FORCE 0x1000
-
-#define SLC_SYNCH 1
-#define SLC_BRK 2
-#define SLC_IP 3
-#define SLC_AO 4
-#define SLC_AYT 5
-#define SLC_EOR 6
-#define SLC_ABORT 7
-#define SLC_EOF 8
-#define SLC_SUSP 9
-#define SLC_EC 10
-#define SLC_EL 11
-#define SLC_EW 12
-#define SLC_RP 13
-#define SLC_LNEXT 14
-#define SLC_XON 15
-#define SLC_XOFF 16
-#define SLC_FORW1 17
-#define SLC_FORW2 18
-#define SLC_MCL 19
-#define SLC_MCR 20
-#define SLC_MCWL 21
-#define SLC_MCWR 22
-#define SLC_MCBOL 23
-#define SLC_MCEOL 24
-#define SLC_INSRT 25
-#define SLC_OVER 26
-#define SLC_ECR 27
-#define SLC_EWR 28
-#define SLC_EBOL 29
-#define SLC_EEOL 30
-
-#define NSLC 30
-
-/*
- * For backwards compatability, we define SLC_NAMES to be the
- * list of names if SLC_NAMES is not defined.
- */
-#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
- "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
- "LNEXT", "XON", "XOFF", "FORW1", "FORW2", \
- "MCL", "MCR", "MCWL", "MCWR", "MCBOL", \
- "MCEOL", "INSRT", "OVER", "ECR", "EWR", \
- "EBOL", "EEOL", \
- 0
-
-#ifdef SLC_NAMES
-char *slc_names[] = {
- SLC_NAMELIST
-};
-#else
-extern char *slc_names[];
-#define SLC_NAMES SLC_NAMELIST
-#endif
-
-#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
-#define SLC_NAME(x) slc_names[x]
-
-#define SLC_NOSUPPORT 0
-#define SLC_CANTCHANGE 1
-#define SLC_VARIABLE 2
-#define SLC_DEFAULT 3
-#define SLC_LEVELBITS 0x03
-
-#define SLC_FUNC 0
-#define SLC_FLAGS 1
-#define SLC_VALUE 2
-
-#define SLC_ACK 0x80
-#define SLC_FLUSHIN 0x40
-#define SLC_FLUSHOUT 0x20
-
-#define OLD_ENV_VAR 1
-#define OLD_ENV_VALUE 0
-#define NEW_ENV_VAR 0
-#define NEW_ENV_VALUE 1
-#define ENV_ESC 2
-#define ENV_USERVAR 3
-
-/*
- * AUTHENTICATION suboptions
- */
-
-/*
- * Who is authenticating who ...
- */
-#define AUTH_WHO_CLIENT 0 /* Client authenticating server */
-#define AUTH_WHO_SERVER 1 /* Server authenticating client */
-#define AUTH_WHO_MASK 1
-
-/*
- * amount of authentication done
- */
-#define AUTH_HOW_ONE_WAY 0
-#define AUTH_HOW_MUTUAL 2
-#define AUTH_HOW_MASK 2
-
-#define AUTHTYPE_NULL 0
-#define AUTHTYPE_KERBEROS_V4 1
-#define AUTHTYPE_KERBEROS_V5 2
-#define AUTHTYPE_SPX 3
-#define AUTHTYPE_MINK 4
-#define AUTHTYPE_CNT 5
-
-#define AUTHTYPE_TEST 99
-
-#ifdef AUTH_NAMES
-char *authtype_names[] = {
- "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK",
- 0
-};
-#else
-extern char *authtype_names[];
-#endif
-
-#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
-#define AUTHTYPE_NAME(x) authtype_names[x]
-
-/*
- * ENCRYPTion suboptions
- */
-#define ENCRYPT_IS 0 /* I pick encryption type ... */
-#define ENCRYPT_SUPPORT 1 /* I support encryption types ... */
-#define ENCRYPT_REPLY 2 /* Initial setup response */
-#define ENCRYPT_START 3 /* Am starting to send encrypted */
-#define ENCRYPT_END 4 /* Am ending encrypted */
-#define ENCRYPT_REQSTART 5 /* Request you start encrypting */
-#define ENCRYPT_REQEND 6 /* Request you end encrypting */
-#define ENCRYPT_ENC_KEYID 7
-#define ENCRYPT_DEC_KEYID 8
-#define ENCRYPT_CNT 9
-
-#define ENCTYPE_ANY 0
-#define ENCTYPE_DES_CFB64 1
-#define ENCTYPE_DES_OFB64 2
-#define ENCTYPE_CNT 3
-
-#ifdef ENCRYPT_NAMES
-char *encrypt_names[] = {
- "IS", "SUPPORT", "REPLY", "START", "END",
- "REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
- 0
-};
-char *enctype_names[] = {
- "ANY", "DES_CFB64", "DES_OFB64",
- 0
-};
-#else
-extern char *encrypt_names[];
-extern char *enctype_names[];
-#endif
-
-
-#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
-#define ENCRYPT_NAME(x) encrypt_names[x]
-
-#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
-#define ENCTYPE_NAME(x) enctype_names[x]
-
-#endif /* !_TELNET_H_ */
diff --git a/cpukit/libnetworking/bpfilter.h b/cpukit/libnetworking/bpfilter.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/cpukit/libnetworking/bpfilter.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/cpukit/libnetworking/kern/kern_subr.c b/cpukit/libnetworking/kern/kern_subr.c
deleted file mode 100644
index 71e51fc442..0000000000
--- a/cpukit/libnetworking/kern/kern_subr.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/malloc.h>
-#include <sys/queue.h>
-
-int
-uiomove(cp, n, uio)
- register caddr_t cp;
- register int n;
- register struct uio *uio;
-{
- register struct iovec *iov;
- u_int cnt;
- int error;
-
-#ifdef DIAGNOSTIC
- if (uio->uio_rw != UIO_READ && uio->uio_rw != UIO_WRITE)
- panic("uiomove: mode");
-#endif
- while (n > 0 && uio->uio_resid) {
- iov = uio->uio_iov;
- cnt = iov->iov_len;
- if (cnt == 0) {
- uio->uio_iov++;
- uio->uio_iovcnt--;
- continue;
- }
- if (cnt > n)
- cnt = n;
-
- switch (uio->uio_segflg) {
-
- case UIO_USERSPACE:
- case UIO_USERISPACE:
- if (uio->uio_rw == UIO_READ)
- error = copyout(cp, iov->iov_base, cnt);
- else
- error = copyin(iov->iov_base, cp, cnt);
- if (error)
- return (error);
- break;
-
- case UIO_SYSSPACE:
- if (uio->uio_rw == UIO_READ)
- bcopy((caddr_t)cp, iov->iov_base, cnt);
- else
- bcopy(iov->iov_base, (caddr_t)cp, cnt);
- break;
- case UIO_NOCOPY:
- break;
- }
- iov->iov_base += cnt;
- iov->iov_len -= cnt;
- uio->uio_resid -= cnt;
- uio->uio_offset += cnt;
- cp += cnt;
- n -= cnt;
- }
- return (0);
-}
-
-#ifdef vax /* unused except by ct.c, other oddities XXX */
-/*
- * Get next character written in by user from uio.
- */
-int
-uwritec(uio)
- struct uio *uio;
-{
- register struct iovec *iov;
- register int c;
-
- if (uio->uio_resid <= 0)
- return (-1);
-again:
- if (uio->uio_iovcnt <= 0)
- panic("uwritec");
- iov = uio->uio_iov;
- if (iov->iov_len == 0) {
- uio->uio_iov++;
- if (--uio->uio_iovcnt == 0)
- return (-1);
- goto again;
- }
- switch (uio->uio_segflg) {
-
- case UIO_USERSPACE:
- c = fubyte(iov->iov_base);
- break;
-
- case UIO_SYSSPACE:
- c = *(u_char *) iov->iov_base;
- break;
-
- case UIO_USERISPACE:
- c = fuibyte(iov->iov_base);
- break;
- }
- if (c < 0)
- return (-1);
- iov->iov_base++;
- iov->iov_len--;
- uio->uio_resid--;
- uio->uio_offset++;
- return (c);
-}
-#endif /* vax */
-
-/*
- * General routine to allocate a hash table.
- */
-void *
-hashinit(elements, type, hashmask)
- int elements, type;
- u_long *hashmask;
-{
- long hashsize;
- LIST_HEAD(generic, generic) *hashtbl;
- int i;
-
- if (elements <= 0)
- panic("hashinit: bad elements");
- for (hashsize = 1; hashsize <= elements; hashsize <<= 1)
- continue;
- hashsize >>= 1;
- hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, M_WAITOK);
- for (i = 0; i < hashsize; i++)
- LIST_INIT(&hashtbl[i]);
- *hashmask = hashsize - 1;
- return (hashtbl);
-}
-
-#define NPRIMES 27
-static int primes[] = { 1, 13, 31, 61, 127, 251, 509, 761, 1021, 1531, 2039,
- 2557, 3067, 3583, 4093, 4603, 5119, 5623, 6143, 6653,
- 7159, 7673, 8191, 12281, 16381, 24571, 32749 };
-
-/*
- * General routine to allocate a prime number sized hash table.
- */
-void *
-phashinit(elements, type, nentries)
- int elements, type;
- u_long *nentries;
-{
- long hashsize;
- LIST_HEAD(generic, generic) *hashtbl;
- int i;
-
- if (elements <= 0)
- panic("phashinit: bad elements");
- for (i = 1, hashsize = primes[1]; hashsize <= elements;) {
- i++;
- if (i == NPRIMES)
- break;
- hashsize = primes[i];
- }
- hashsize = primes[i - 1];
- hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, M_WAITOK);
- for (i = 0; i < hashsize; i++)
- LIST_INIT(&hashtbl[i]);
- *nentries = hashsize;
- return (hashtbl);
-}
diff --git a/cpukit/libnetworking/kern/uipc_domain.c b/cpukit/libnetworking/kern/uipc_domain.c
deleted file mode 100644
index 910007395c..0000000000
--- a/cpukit/libnetworking/kern/uipc_domain.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/domain.h>
-#include <sys/mbuf.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-
-/*
- * System initialization
- *
- * Note: domain initialization wants to take place on a per domain basis
- * as a result of traversing a linker set. Most likely, each domain
- * want to call a registration function rather than being handled here
- * in domaininit(). Probably this will look like:
- *
- * SYSINIT(unique, SI_SUB_PROTO_DOMAI, SI_ORDER_ANY, domain_add, xxx)
- *
- * Where 'xxx' is replaced by the address of a parameter struct to be
- * passed to the doamin_add() function.
- */
-
-#if !defined(__rtems__)
-static int x_save_spl; /* used by kludge*/
-static void kludge_splimp __P((void *));
-static void kludge_splx __P((void *));
- void domaininit __P((void *));
-SYSINIT(splimp, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, kludge_splimp, &x_save_spl)
-SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL)
-SYSINIT(splx, SI_SUB_PROTO_END, SI_ORDER_FIRST, kludge_splx, &x_save_spl)
-#endif
-
-static void pffasttimo __P((void *));
-static void pfslowtimo __P((void *));
-
-struct domain *domains;
-
-#define ADDDOMAIN(x) { \
- __CONCAT(x,domain.dom_next) = domains; \
- domains = &__CONCAT(x,domain); \
-}
-
-extern struct linker_set domain_set;
-
-/* ARGSUSED*/
-void
-domaininit(dummy)
- void *dummy;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
-/* - not in our sources
-#ifdef ISDN
- ADDDOMAIN(isdn);
-#endif
-*/
-
- for (dp = domains; dp; dp = dp->dom_next) {
- if (dp->dom_init)
- (*dp->dom_init)();
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++){
-#ifdef PRU_OLDSTYLE
- /* See comments in uipc_socket2.c. */
- if (pr->pr_usrreqs == 0 && pr->pr_ousrreq)
- pr->pr_usrreqs = &pru_oldstyle;
-#endif
- if (pr->pr_init)
- (*pr->pr_init)();
- }
- }
-
- if (max_linkhdr < 16) /* XXX */
- max_linkhdr = 16;
- max_hdr = max_linkhdr + max_protohdr;
- max_datalen = MHLEN - max_hdr;
- timeout(pffasttimo, (void *)0, 1);
- timeout(pfslowtimo, (void *)0, 1);
-}
-
-
-/*
- * The following two operations are kludge code. Most likely, they should
- * be done as a "domainpreinit()" for the first function and then rolled
- * in as the last act of "domaininit()" for the second.
- *
- * In point of fact, it is questionable why other initialization prior
- * to this does not also take place at splimp by default.
- */
-static void
-kludge_splimp(udata)
- void *udata;
-{
- int *savesplp = udata;
-
- *savesplp = splimp();
-}
-
-static void
-kludge_splx(udata)
- void *udata;
-{
- int *savesplp = udata;
-
- splx( *savesplp);
-}
-
-
-
-struct protosw *
-pffindtype(int family, int type)
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- if (dp->dom_family == family)
- goto found;
- return (0);
-found:
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_type && pr->pr_type == type)
- return (pr);
- return (0);
-}
-
-struct protosw *
-pffindproto(int family, int protocol, int type)
-{
- register struct domain *dp;
- register struct protosw *pr;
- struct protosw *maybe = 0;
-
- if (family == 0)
- return (0);
- for (dp = domains; dp; dp = dp->dom_next)
- if (dp->dom_family == family)
- goto found;
- return (0);
-found:
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) {
- if ((pr->pr_protocol == protocol) && (pr->pr_type == type))
- return (pr);
-
- if (type == SOCK_RAW && pr->pr_type == SOCK_RAW &&
- pr->pr_protocol == 0 && maybe == (struct protosw *)0)
- maybe = pr;
- }
- return (maybe);
-}
-
-void
-pfctlinput(cmd, sa)
- int cmd;
- struct sockaddr *sa;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_ctlinput)
- (*pr->pr_ctlinput)(cmd, sa, (void *)0);
-}
-
-static void
-pfslowtimo(arg)
- void *arg;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_slowtimo)
- (*pr->pr_slowtimo)();
- timeout(pfslowtimo, (void *)0, hz/2);
-}
-
-static void
-pffasttimo(arg)
- void *arg;
-{
- register struct domain *dp;
- register struct protosw *pr;
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_fasttimo)
- (*pr->pr_fasttimo)();
- timeout(pffasttimo, (void *)0, hz/5);
-}
diff --git a/cpukit/libnetworking/kern/uipc_mbuf.c b/cpukit/libnetworking/kern/uipc_mbuf.c
deleted file mode 100644
index f682be94a7..0000000000
--- a/cpukit/libnetworking/kern/uipc_mbuf.c
+++ /dev/null
@@ -1,851 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1991, 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.
- *
- * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/malloc.h>
-#define MBTYPES
-#include <sys/mbuf.h>
-#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/vm_kern.h>
-#include <vm/vm_extern.h>
-
-static void mbinit __P((void *));
-SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbinit, NULL)
-
-struct mbuf *mbutl;
-char *mclrefcnt;
-struct mbstat mbstat;
-struct mbuf *mmbfree;
-union mcluster *mclfree;
-int max_linkhdr;
-int max_protohdr;
-int max_hdr;
-int max_datalen;
-
-static void m_reclaim __P((void));
-
-/* "number of clusters of pages" */
-#define NCL_INIT 1
-
-#define NMB_INIT 16
-
-/* ARGSUSED*/
-static void
-mbinit(dummy)
- void *dummy;
-{
- int s;
-
- mmbfree = NULL; mclfree = NULL;
- s = splimp();
- if (m_mballoc(NMB_INIT, M_DONTWAIT) == 0)
- goto bad;
- if (m_clalloc(NCL_INIT, M_DONTWAIT) == 0)
- goto bad;
- splx(s);
- return;
-bad:
- panic("mbinit");
-}
-
-/*
- * Allocate at least nmb mbufs and place on mbuf free list.
- * Must be called at splimp.
- */
-/* ARGSUSED */
-int
-m_mballoc(nmb, nowait)
- register int nmb;
- int nowait;
-{
- register caddr_t p;
- register int i;
- int nbytes;
-
- /* Once we run out of map space, it will be impossible to get
- * any more (nothing is ever freed back to the map) (XXX which
- * is dumb). (however you are not dead as m_reclaim might
- * still be able to free a substantial amount of space).
- */
- if (mb_map_full)
- return (0);
-
- nbytes = round_page(nmb * MSIZE);
- p = (caddr_t)kmem_malloc(mb_map, nbytes, nowait ? M_NOWAIT : M_WAITOK);
- /*
- * Either the map is now full, or this is nowait and there
- * are no pages left.
- */
- if (p == NULL)
- return (0);
-
- nmb = nbytes / MSIZE;
- for (i = 0; i < nmb; i++) {
- ((struct mbuf *)p)->m_next = mmbfree;
- mmbfree = (struct mbuf *)p;
- p += MSIZE;
- }
- mbstat.m_mbufs += nmb;
- return (1);
-}
-
-/*
- * Allocate some number of mbuf clusters
- * and place on cluster free list.
- * Must be called at splimp.
- */
-/* ARGSUSED */
-int
-m_clalloc(ncl, nowait)
- register int ncl;
- int nowait;
-{
- register caddr_t p;
- register int i;
-
- /*
- * Once we run out of map space, it will be impossible
- * to get any more (nothing is ever freed back to the
- * map).
- */
- if (mb_map_full)
- return (0);
-
- p = (caddr_t)kmem_malloc(mb_map, ncl*MCLBYTES,
- nowait ? M_NOWAIT : M_WAITOK);
- /*
- * Either the map is now full, or this is nowait and there
- * are no pages left.
- */
- if (p == NULL)
- return (0);
-
- for (i = 0; i < ncl; i++) {
- ((union mcluster *)p)->mcl_next = mclfree;
- mclfree = (union mcluster *)p;
- p += MCLBYTES;
- mbstat.m_clfree++;
- }
- mbstat.m_clusters += ncl;
- return (1);
-}
-
-/*
- * When MGET failes, ask protocols to free space when short of memory,
- * then re-attempt to allocate an mbuf.
- */
-struct mbuf *
-m_retry(i, t)
- int i, t;
-{
- register struct mbuf *m;
-
- m_reclaim();
-#define m_retry(i, t) (struct mbuf *)0
- MGET(m, i, t);
-#undef m_retry
- if (m != NULL)
- mbstat.m_wait++;
- else
- mbstat.m_drops++;
- return (m);
-}
-
-/*
- * As above; retry an MGETHDR.
- */
-struct mbuf *
-m_retryhdr(i, t)
- int i, t;
-{
- register struct mbuf *m;
-
- m_reclaim();
-#define m_retryhdr(i, t) (struct mbuf *)0
- MGETHDR(m, i, t);
-#undef m_retryhdr
- if (m != NULL)
- mbstat.m_wait++;
- else
- mbstat.m_drops++;
- return (m);
-}
-
-static void
-m_reclaim()
-{
- register struct domain *dp;
- register struct protosw *pr;
- int s = splimp();
-
- for (dp = domains; dp; dp = dp->dom_next)
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
- if (pr->pr_drain)
- (*pr->pr_drain)();
- splx(s);
- mbstat.m_drain++;
-}
-
-/*
- * Space allocation routines.
- * These are also available as macros
- * for critical paths.
- */
-struct mbuf *
-m_get(nowait, type)
- int nowait, type;
-{
- register struct mbuf *m;
-
- MGET(m, nowait, type);
- return (m);
-}
-
-struct mbuf *
-m_gethdr(nowait, type)
- int nowait, type;
-{
- register struct mbuf *m;
-
- MGETHDR(m, nowait, type);
- return (m);
-}
-
-struct mbuf *
-m_getclr(nowait, type)
- int nowait, type;
-{
- register struct mbuf *m;
-
- MGET(m, nowait, type);
- if (m == 0)
- return (0);
- bzero(mtod(m, caddr_t), MLEN);
- return (m);
-}
-
-struct mbuf *
-m_free(m)
- struct mbuf *m;
-{
- register struct mbuf *n;
-
- MFREE(m, n);
- return (n);
-}
-
-void
-m_freem(m)
- register struct mbuf *m;
-{
- register struct mbuf *n;
-
- if (m == NULL)
- return;
- do {
- MFREE(m, n);
- m = n;
- } while (m);
-}
-
-/*
- * Mbuffer utility routines.
- */
-
-/*
- * Lesser-used path for M_PREPEND:
- * allocate new mbuf to prepend to chain,
- * copy junk along.
- */
-struct mbuf *
-m_prepend(m, len, how)
- register struct mbuf *m;
- int len, how;
-{
- struct mbuf *mn;
-
- MGET(mn, how, m->m_type);
- if (mn == (struct mbuf *)NULL) {
- m_freem(m);
- return ((struct mbuf *)NULL);
- }
- if (m->m_flags & M_PKTHDR) {
- M_COPY_PKTHDR(mn, m);
- m->m_flags &= ~M_PKTHDR;
- }
- mn->m_next = m;
- m = mn;
- if (len < MHLEN)
- MH_ALIGN(m, len);
- m->m_len = len;
- return (m);
-}
-
-/*
- * Make a copy of an mbuf chain starting "off0" bytes from the beginning,
- * continuing for "len" bytes. If len is M_COPYALL, copy to end of mbuf.
- * The wait parameter is a choice of M_WAIT/M_DONTWAIT from caller.
- */
-static int MCFail;
-
-struct mbuf *
-m_copym(m, off0, len, wait)
- register struct mbuf *m;
- int off0, wait;
- register int len;
-{
- register struct mbuf *n, **np;
- register int off = off0;
- struct mbuf *top;
- int copyhdr = 0;
-
- if (off < 0 || len < 0)
- panic("m_copym");
- if (off == 0 && m->m_flags & M_PKTHDR)
- copyhdr = 1;
- while (off > 0) {
- if (m == 0)
- panic("m_copym");
- if (off < m->m_len)
- break;
- off -= m->m_len;
- m = m->m_next;
- }
- np = &top;
- top = 0;
- while (len > 0) {
- if (m == 0) {
- if (len != M_COPYALL)
- panic("m_copym");
- break;
- }
- MGET(n, wait, m->m_type);
- *np = n;
- if (n == 0)
- goto nospace;
- if (copyhdr) {
- M_COPY_PKTHDR(n, m);
- if (len == M_COPYALL)
- n->m_pkthdr.len -= off0;
- else
- n->m_pkthdr.len = len;
- copyhdr = 0;
- }
- n->m_len = min(len, m->m_len - off);
- if (m->m_flags & M_EXT) {
- n->m_data = m->m_data + off;
- if(!m->m_ext.ext_ref)
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- else
- (*(m->m_ext.ext_ref))(m->m_ext.ext_buf,
- m->m_ext.ext_size);
- n->m_ext = m->m_ext;
- n->m_flags |= M_EXT;
- } else
- bcopy(mtod(m, caddr_t)+off, mtod(n, caddr_t),
- (unsigned)n->m_len);
- if (len != M_COPYALL)
- len -= n->m_len;
- off = 0;
- m = m->m_next;
- np = &n->m_next;
- }
- if (top == 0)
- MCFail++;
- return (top);
-nospace:
- m_freem(top);
- MCFail++;
- return (0);
-}
-
-/*
- * Copy an entire packet, including header (which must be present).
- * An optimization of the common case `m_copym(m, 0, M_COPYALL, how)'.
- */
-struct mbuf *
-m_copypacket(m, how)
- struct mbuf *m;
- int how;
-{
- struct mbuf *top, *n, *o;
-
- MGET(n, how, m->m_type);
- top = n;
- if (!n)
- goto nospace;
-
- M_COPY_PKTHDR(n, m);
- n->m_len = m->m_len;
- if (m->m_flags & M_EXT) {
- n->m_data = m->m_data;
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- n->m_ext = m->m_ext;
- n->m_flags |= M_EXT;
- } else {
- bcopy(mtod(m, char *), mtod(n, char *), n->m_len);
- }
-
- m = m->m_next;
- while (m) {
- MGET(o, how, m->m_type);
- if (!o)
- goto nospace;
-
- n->m_next = o;
- n = n->m_next;
-
- n->m_len = m->m_len;
- if (m->m_flags & M_EXT) {
- n->m_data = m->m_data;
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- n->m_ext = m->m_ext;
- n->m_flags |= M_EXT;
- } else {
- bcopy(mtod(m, char *), mtod(n, char *), n->m_len);
- }
-
- m = m->m_next;
- }
- return top;
-nospace:
- m_freem(top);
- MCFail++;
- return 0;
-}
-
-/*
- * Copy data from an mbuf chain starting "off" bytes from the beginning,
- * continuing for "len" bytes, into the indicated buffer.
- */
-void
-m_copydata(m, off, len, cp)
- register struct mbuf *m;
- register int off;
- register int len;
- caddr_t cp;
-{
- register unsigned count;
-
- if (off < 0 || len < 0)
- panic("m_copydata");
- while (off > 0) {
- if (m == 0)
- panic("m_copydata");
- if (off < m->m_len)
- break;
- off -= m->m_len;
- m = m->m_next;
- }
- while (len > 0) {
- if (m == 0)
- panic("m_copydata");
- count = min(m->m_len - off, len);
- bcopy(mtod(m, caddr_t) + off, cp, count);
- len -= count;
- cp += count;
- off = 0;
- m = m->m_next;
- }
-}
-
-/*
- * Concatenate mbuf chain n to m.
- * Both chains must be of the same type (e.g. MT_DATA).
- * Any m_pkthdr is not updated.
- */
-void
-m_cat(m, n)
- register struct mbuf *m, *n;
-{
- while (m->m_next)
- m = m->m_next;
- while (n) {
- if (m->m_flags & M_EXT ||
- m->m_data + m->m_len + n->m_len >= &m->m_dat[MLEN]) {
- /* just join the two chains */
- m->m_next = n;
- return;
- }
- /* splat the data from one into the other */
- bcopy(mtod(n, caddr_t), mtod(m, caddr_t) + m->m_len,
- (u_int)n->m_len);
- m->m_len += n->m_len;
- n = m_free(n);
- }
-}
-
-void
-m_adj(mp, req_len)
- struct mbuf *mp;
- int req_len;
-{
- register int len = req_len;
- register struct mbuf *m;
- register int count;
-
- if ((m = mp) == NULL)
- return;
- if (len >= 0) {
- /*
- * Trim from head.
- */
- while (m != NULL && len > 0) {
- if (m->m_len <= len) {
- len -= m->m_len;
- m->m_len = 0;
- m = m->m_next;
- } else {
- m->m_len -= len;
- m->m_data += len;
- len = 0;
- }
- }
- m = mp;
- if (mp->m_flags & M_PKTHDR)
- m->m_pkthdr.len -= (req_len - len);
- } else {
- /*
- * Trim from tail. Scan the mbuf chain,
- * calculating its length and finding the last mbuf.
- * If the adjustment only affects this mbuf, then just
- * adjust and return. Otherwise, rescan and truncate
- * after the remaining size.
- */
- len = -len;
- count = 0;
- for (;;) {
- count += m->m_len;
- if (m->m_next == (struct mbuf *)0)
- break;
- m = m->m_next;
- }
- if (m->m_len >= len) {
- m->m_len -= len;
- if (mp->m_flags & M_PKTHDR)
- mp->m_pkthdr.len -= len;
- return;
- }
- count -= len;
- if (count < 0)
- count = 0;
- /*
- * Correct length for chain is "count".
- * Find the mbuf with last data, adjust its length,
- * and toss data from remaining mbufs on chain.
- */
- m = mp;
- if (m->m_flags & M_PKTHDR)
- m->m_pkthdr.len = count;
- for (; m; m = m->m_next) {
- if (m->m_len >= count) {
- m->m_len = count;
- break;
- }
- count -= m->m_len;
- }
- while (m->m_next)
- (m = m->m_next) ->m_len = 0;
- }
-}
-
-/*
- * Rearange an mbuf chain so that len bytes are contiguous
- * and in the data area of an mbuf (so that mtod and dtom
- * will work for a structure of size len). Returns the resulting
- * mbuf chain on success, frees it and returns null on failure.
- * If there is room, it will add up to max_protohdr-len extra bytes to the
- * contiguous region in an attempt to avoid being called next time.
- */
-static int MPFail;
-
-struct mbuf *
-m_pullup(n, len)
- register struct mbuf *n;
- int len;
-{
- register struct mbuf *m;
- register int count;
- int space;
-
- /*
- * If first mbuf has no cluster, and has room for len bytes
- * without shifting current data, pullup into it,
- * otherwise allocate a new mbuf to prepend to the chain.
- */
- if ((n->m_flags & M_EXT) == 0 &&
- n->m_data + len < &n->m_dat[MLEN] && n->m_next) {
- if (n->m_len >= len)
- return (n);
- m = n;
- n = n->m_next;
- len -= m->m_len;
- } else {
- if (len > MHLEN)
- goto bad;
- MGET(m, M_DONTWAIT, n->m_type);
- if (m == 0)
- goto bad;
- m->m_len = 0;
- if (n->m_flags & M_PKTHDR) {
- M_COPY_PKTHDR(m, n);
- n->m_flags &= ~M_PKTHDR;
- }
- }
- space = &m->m_dat[MLEN] - (m->m_data + m->m_len);
- do {
- count = min(min(max(len, max_protohdr), space), n->m_len);
- bcopy(mtod(n, caddr_t), mtod(m, caddr_t) + m->m_len,
- (unsigned)count);
- len -= count;
- m->m_len += count;
- n->m_len -= count;
- space -= count;
- if (n->m_len)
- n->m_data += count;
- else
- n = m_free(n);
- } while (len > 0 && n);
- if (len > 0) {
- (void) m_free(m);
- goto bad;
- }
- m->m_next = n;
- return (m);
-bad:
- m_freem(n);
- MPFail++;
- return (0);
-}
-
-/*
- * Partition an mbuf chain in two pieces, returning the tail --
- * all but the first len0 bytes. In case of failure, it returns NULL and
- * attempts to restore the chain to its original state.
- */
-struct mbuf *
-m_split(m0, len0, wait)
- register struct mbuf *m0;
- int len0, wait;
-{
- register struct mbuf *m, *n;
- unsigned len = len0, remain;
-
- for (m = m0; m && len > m->m_len; m = m->m_next)
- len -= m->m_len;
- if (m == 0)
- return (0);
- remain = m->m_len - len;
- if (m0->m_flags & M_PKTHDR) {
- MGETHDR(n, wait, m0->m_type);
- if (n == 0)
- return (0);
- n->m_pkthdr.rcvif = m0->m_pkthdr.rcvif;
- n->m_pkthdr.len = m0->m_pkthdr.len - len0;
- m0->m_pkthdr.len = len0;
- if (m->m_flags & M_EXT)
- goto extpacket;
- if (remain > MHLEN) {
- /* m can't be the lead packet */
- MH_ALIGN(n, 0);
- n->m_next = m_split(m, len, wait);
- if (n->m_next == 0) {
- (void) m_free(n);
- return (0);
- } else
- return (n);
- } else
- MH_ALIGN(n, remain);
- } else if (remain == 0) {
- n = m->m_next;
- m->m_next = 0;
- return (n);
- } else {
- MGET(n, wait, m->m_type);
- if (n == 0)
- return (0);
- M_ALIGN(n, remain);
- }
-extpacket:
- if (m->m_flags & M_EXT) {
- n->m_flags |= M_EXT;
- n->m_ext = m->m_ext;
- if(!m->m_ext.ext_ref)
- mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
- else
- (*(m->m_ext.ext_ref))(m->m_ext.ext_buf,
- m->m_ext.ext_size);
- m->m_ext.ext_size = 0; /* For Accounting XXXXXX danger */
- n->m_data = m->m_data + len;
- } else {
- bcopy(mtod(m, caddr_t) + len, mtod(n, caddr_t), remain);
- }
- n->m_len = remain;
- m->m_len = len;
- n->m_next = m->m_next;
- m->m_next = 0;
- return (n);
-}
-/*
- * Routine to copy from device local memory into mbufs.
- */
-struct mbuf *
-m_devget(buf, totlen, off0, ifp, copy)
- char *buf;
- int totlen, off0;
- struct ifnet *ifp;
- void (*copy) __P((char *from, caddr_t to, u_int len));
-{
- register struct mbuf *m;
- struct mbuf *top = 0, **mp = &top;
- register int off = off0, len;
- register char *cp;
- char *epkt;
-
- cp = buf;
- epkt = cp + totlen;
- if (off) {
- cp += off + 2 * sizeof(u_short);
- totlen -= 2 * sizeof(u_short);
- }
- MGETHDR(m, M_DONTWAIT, MT_DATA);
- if (m == 0)
- return (0);
- m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = totlen;
- m->m_len = MHLEN;
-
- while (totlen > 0) {
- if (top) {
- MGET(m, M_DONTWAIT, MT_DATA);
- if (m == 0) {
- m_freem(top);
- return (0);
- }
- m->m_len = MLEN;
- }
- len = min(totlen, epkt - cp);
- if (len >= MINCLSIZE) {
- MCLGET(m, M_DONTWAIT);
- if (m->m_flags & M_EXT)
- m->m_len = len = min(len, MCLBYTES);
- else
- len = m->m_len;
- } else {
- /*
- * Place initial small packet/header at end of mbuf.
- */
- if (len < m->m_len) {
- if (top == 0 && len + max_linkhdr <= m->m_len)
- m->m_data += max_linkhdr;
- m->m_len = len;
- } else
- len = m->m_len;
- }
- if (copy)
- copy(cp, mtod(m, caddr_t), (unsigned)len);
- else
- bcopy(cp, mtod(m, caddr_t), (unsigned)len);
- cp += len;
- *mp = m;
- mp = &m->m_next;
- totlen -= len;
- if (cp == epkt)
- cp = buf;
- }
- return (top);
-}
-
-/*
- * Copy data from a buffer back into the indicated mbuf chain,
- * starting "off" bytes from the beginning, extending the mbuf
- * chain if necessary.
- */
-void
-m_copyback(m0, off, len, cp)
- struct mbuf *m0;
- register int off;
- register int len;
- caddr_t cp;
-{
- register int mlen;
- register struct mbuf *m = m0, *n;
- int totlen = 0;
-
- if (m0 == 0)
- return;
- while (off > (mlen = m->m_len)) {
- off -= mlen;
- totlen += mlen;
- if (m->m_next == 0) {
- n = m_getclr(M_DONTWAIT, m->m_type);
- if (n == 0)
- goto out;
- n->m_len = min(MLEN, len + off);
- m->m_next = n;
- }
- m = m->m_next;
- }
- while (len > 0) {
- mlen = min (m->m_len - off, len);
- bcopy(cp, off + mtod(m, caddr_t), (unsigned)mlen);
- cp += mlen;
- len -= mlen;
- mlen += off;
- off = 0;
- totlen += mlen;
- if (len == 0)
- break;
- if (m->m_next == 0) {
- n = m_get(M_DONTWAIT, m->m_type);
- if (n == 0)
- break;
- n->m_len = min(MLEN, len);
- m->m_next = n;
- }
- m = m->m_next;
- }
-out: if (((m = m0)->m_flags & M_PKTHDR) && (m->m_pkthdr.len < totlen))
- m->m_pkthdr.len = totlen;
-}
diff --git a/cpukit/libnetworking/kern/uipc_socket.c b/cpukit/libnetworking/kern/uipc_socket.c
deleted file mode 100644
index 895d1c7d45..0000000000
--- a/cpukit/libnetworking/kern/uipc_socket.c
+++ /dev/null
@@ -1,1100 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 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.
- *
- * @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/file.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/domain.h>
-#include <sys/kernel.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/resourcevar.h>
-#include <sys/signalvar.h>
-#include <sys/sysctl.h>
-
-static int somaxconn = SOMAXCONN;
-SYSCTL_INT(_kern, KERN_SOMAXCONN, somaxconn, CTLFLAG_RW, &somaxconn, 0, "");
-
-/*
- * Socket operation routines.
- * These routines are called by the routines in
- * sys_socket.c or from a system process, and
- * implement the semantics of socket operations by
- * switching out to the protocol specific routines.
- */
-/*ARGSUSED*/
-int
-socreate(dom, aso, type, proto, p)
- int dom;
- struct socket **aso;
- register int type;
- int proto;
- struct proc *p;
-{
- register struct protosw *prp;
- register struct socket *so;
- register int error;
-
- if (proto)
- prp = pffindproto(dom, proto, type);
- else
- prp = pffindtype(dom, type);
- if (prp == 0 || prp->pr_usrreqs == 0)
- return (EPROTONOSUPPORT);
- if (prp->pr_type != type)
- return (EPROTOTYPE);
- MALLOC(so, struct socket *, sizeof(*so), M_SOCKET, M_WAIT);
- bzero((caddr_t)so, sizeof(*so));
- TAILQ_INIT(&so->so_incomp);
- TAILQ_INIT(&so->so_comp);
- so->so_type = type;
- so->so_state = SS_PRIV;
- so->so_uid = 0;
- so->so_proto = prp;
- error = (*prp->pr_usrreqs->pru_attach)(so, proto);
- if (error) {
- so->so_state |= SS_NOFDREF;
- sofree(so);
- return (error);
- }
- *aso = so;
- return (0);
-}
-
-int
-sobind(so, nam)
- struct socket *so;
- struct mbuf *nam;
-{
- int s = splnet();
- int error;
-
- error = (*so->so_proto->pr_usrreqs->pru_bind)(so, nam);
- splx(s);
- return (error);
-}
-
-int
-solisten(so, backlog)
- register struct socket *so;
- int backlog;
-{
- int s = splnet(), error;
-
- error = (*so->so_proto->pr_usrreqs->pru_listen)(so);
- if (error) {
- splx(s);
- return (error);
- }
- if (so->so_comp.tqh_first == NULL)
- so->so_options |= SO_ACCEPTCONN;
- if (backlog < 0 || backlog > somaxconn)
- backlog = somaxconn;
- so->so_qlimit = backlog;
- splx(s);
- return (0);
-}
-
-void
-sofree(so)
- register struct socket *so;
-{
- struct socket *head = so->so_head;
-
- if (so->so_pcb || (so->so_state & SS_NOFDREF) == 0)
- return;
- if (head != NULL) {
- if (so->so_state & SS_INCOMP) {
- TAILQ_REMOVE(&head->so_incomp, so, so_list);
- head->so_incqlen--;
- } else if (so->so_state & SS_COMP) {
- TAILQ_REMOVE(&head->so_comp, so, so_list);
- } else {
- panic("sofree: not queued");
- }
- head->so_qlen--;
- so->so_state &= ~(SS_INCOMP|SS_COMP);
- so->so_head = NULL;
- }
- sbrelease(&so->so_snd);
- sorflush(so);
- FREE(so, M_SOCKET);
-}
-
-/*
- * Close a socket on last file table reference removal.
- * Initiate disconnect if connected.
- * Free socket when disconnect complete.
- */
-int
-soclose(so)
- register struct socket *so;
-{
- int s = splnet(); /* conservative */
- int error = 0;
-
- if (so->so_options & SO_ACCEPTCONN) {
- struct socket *sp, *sonext;
-
- for (sp = so->so_incomp.tqh_first; sp != NULL; sp = sonext) {
- sonext = sp->so_list.tqe_next;
- (void) soabort(sp);
- }
- for (sp = so->so_comp.tqh_first; sp != NULL; sp = sonext) {
- sonext = sp->so_list.tqe_next;
- (void) soabort(sp);
- }
- }
- if (so->so_pcb == 0)
- goto discard;
- if (so->so_state & SS_ISCONNECTED) {
- if ((so->so_state & SS_ISDISCONNECTING) == 0) {
- error = sodisconnect(so);
- if (error)
- goto drop;
- }
- if (so->so_options & SO_LINGER) {
- if ((so->so_state & SS_ISDISCONNECTING) &&
- (so->so_state & SS_NBIO))
- goto drop;
- while (so->so_state & SS_ISCONNECTED) {
- soconnsleep (so);
- }
- }
- }
-drop:
- if (so->so_pcb) {
- int error2 = (*so->so_proto->pr_usrreqs->pru_detach)(so);
- if (error == 0)
- error = error2;
- }
-discard:
- if (so->so_state & SS_NOFDREF)
- panic("soclose: NOFDREF");
- so->so_state |= SS_NOFDREF;
- sofree(so);
- splx(s);
- return (error);
-}
-
-/*
- * Must be called at splnet...
- */
-int
-soabort(so)
- struct socket *so;
-{
-
- return (*so->so_proto->pr_usrreqs->pru_abort)(so);
-}
-
-int
-soaccept(so, nam)
- register struct socket *so;
- struct mbuf *nam;
-{
- int s = splnet();
- int error;
-
- if ((so->so_state & SS_NOFDREF) == 0)
- panic("soaccept: !NOFDREF");
- so->so_state &= ~SS_NOFDREF;
- error = (*so->so_proto->pr_usrreqs->pru_accept)(so, nam);
- splx(s);
- return (error);
-}
-
-int
-soconnect(so, nam)
- register struct socket *so;
- struct mbuf *nam;
-{
- int s;
- int error;
-
- if (so->so_options & SO_ACCEPTCONN)
- return (EOPNOTSUPP);
- s = splnet();
- /*
- * If protocol is connection-based, can only connect once.
- * Otherwise, if connected, try to disconnect first.
- * This allows user to disconnect by connecting to, e.g.,
- * a null address.
- */
- if (so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING) &&
- ((so->so_proto->pr_flags & PR_CONNREQUIRED) ||
- (error = sodisconnect(so))))
- error = EISCONN;
- else
- error = (*so->so_proto->pr_usrreqs->pru_connect)(so, nam);
- splx(s);
- return (error);
-}
-
-int
-soconnect2(so1, so2)
- register struct socket *so1;
- struct socket *so2;
-{
- int s = splnet();
- int error;
-
- error = (*so1->so_proto->pr_usrreqs->pru_connect2)(so1, so2);
- splx(s);
- return (error);
-}
-
-int
-sodisconnect(so)
- register struct socket *so;
-{
- int s = splnet();
- int error;
-
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- error = ENOTCONN;
- goto bad;
- }
- if (so->so_state & SS_ISDISCONNECTING) {
- error = EALREADY;
- goto bad;
- }
- error = (*so->so_proto->pr_usrreqs->pru_disconnect)(so);
-bad:
- splx(s);
- return (error);
-}
-
-#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? M_NOWAIT : M_WAITOK)
-/*
- * Send on a socket.
- * If send must go all at once and message is larger than
- * send buffering, then hard error.
- * Lock against other senders.
- * If must go all at once and not enough room now, then
- * inform user that this would block and do nothing.
- * Otherwise, if nonblocking, send as much as possible.
- * The data to be sent is described by "uio" if nonzero,
- * otherwise by the mbuf chain "top" (which must be null
- * if uio is not). Data provided in mbuf chain must be small
- * enough to send all at once.
- *
- * Returns nonzero on error, timeout or signal; callers
- * must check for short counts if EINTR/ERESTART are returned.
- * Data and control buffers are freed on return.
- */
-int
-sosend(so, addr, uio, top, control, flags)
- register struct socket *so;
- struct mbuf *addr;
- struct uio *uio;
- struct mbuf *top;
- struct mbuf *control;
- int flags;
-{
- struct mbuf **mp;
- register struct mbuf *m;
- register long space, len, resid;
- int clen = 0, error, s, dontroute, mlen;
- int atomic = sosendallatonce(so) || top;
-
- if (uio)
- resid = uio->uio_resid;
- else
- resid = top->m_pkthdr.len;
- /*
- * In theory resid should be unsigned.
- * However, space must be signed, as it might be less than 0
- * if we over-committed, and we must use a signed comparison
- * of space and resid. On the other hand, a negative resid
- * causes us to loop sending 0-length segments to the protocol.
- *
- * Also check to make sure that MSG_EOR isn't used on SOCK_STREAM
- * type sockets since that's an error.
- */
- if ((resid < 0) || (so->so_type == SOCK_STREAM && (flags & MSG_EOR))) {
- error = EINVAL;
- goto out;
- }
-
- dontroute =
- (flags & MSG_DONTROUTE) && (so->so_options & SO_DONTROUTE) == 0 &&
- (so->so_proto->pr_flags & PR_ATOMIC);
- if (control)
- clen = control->m_len;
-#define snderr(errno) { error = errno; splx(s); goto release; }
-
-restart:
- error = sblock(&so->so_snd, SBLOCKWAIT(flags));
- if (error)
- goto out;
- do {
- s = splnet();
- if (so->so_state & SS_CANTSENDMORE)
- snderr(EPIPE);
- if (so->so_error) {
- error = so->so_error;
- so->so_error = 0;
- splx(s);
- goto release;
- }
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- /*
- * `sendto' and `sendmsg' is allowed on a connection-
- * based socket if it supports implied connect.
- * Return ENOTCONN if not connected and no address is
- * supplied.
- */
- if ((so->so_proto->pr_flags & PR_CONNREQUIRED) &&
- (so->so_proto->pr_flags & PR_IMPLOPCL) == 0) {
- if ((so->so_state & SS_ISCONFIRMING) == 0 &&
- !(resid == 0 && clen != 0))
- snderr(ENOTCONN);
- } else if (addr == 0)
- snderr(so->so_proto->pr_flags & PR_CONNREQUIRED ?
- ENOTCONN : EDESTADDRREQ);
- }
- space = sbspace(&so->so_snd);
- if (flags & MSG_OOB)
- space += 1024;
- if ((atomic && resid > so->so_snd.sb_hiwat) ||
- clen > so->so_snd.sb_hiwat)
- snderr(EMSGSIZE);
- if (space < resid + clen && uio &&
- (atomic || space < so->so_snd.sb_lowat || space < clen)) {
- if (so->so_state & SS_NBIO)
- snderr(EWOULDBLOCK);
- sbunlock(&so->so_snd);
- error = sbwait(&so->so_snd);
- splx(s);
- if (error)
- goto out;
- goto restart;
- }
- splx(s);
- mp = &top;
- space -= clen;
- do {
- if (uio == NULL) {
- /*
- * Data is prepackaged in "top".
- */
- resid = 0;
- if (flags & MSG_EOR)
- top->m_flags |= M_EOR;
- } else do {
- if (top == 0) {
- MGETHDR(m, M_WAIT, MT_DATA);
- mlen = MHLEN;
- m->m_pkthdr.len = 0;
- m->m_pkthdr.rcvif = (struct ifnet *)0;
- } else {
- MGET(m, M_WAIT, MT_DATA);
- mlen = MLEN;
- }
- if (resid >= MINCLSIZE) {
- MCLGET(m, M_WAIT);
- if ((m->m_flags & M_EXT) == 0)
- goto nopages;
- mlen = MCLBYTES;
- len = min(min(mlen, resid), space);
- } else {
-nopages:
- len = min(min(mlen, resid), space);
- /*
- * For datagram protocols, leave room
- * for protocol headers in first mbuf.
- */
- if (atomic && top == 0 && len < mlen)
- MH_ALIGN(m, len);
- }
- space -= len;
- error = uiomove(mtod(m, caddr_t), (int)len, uio);
- resid = uio->uio_resid;
- m->m_len = len;
- *mp = m;
- top->m_pkthdr.len += len;
- if (error)
- goto release;
- mp = &m->m_next;
- if (resid <= 0) {
- if (flags & MSG_EOR)
- top->m_flags |= M_EOR;
- break;
- }
- } while (space > 0 && atomic);
- if (dontroute)
- so->so_options |= SO_DONTROUTE;
- s = splnet(); /* XXX */
- error = (*so->so_proto->pr_usrreqs->pru_send)(so,
- (flags & MSG_OOB) ? PRUS_OOB :
- /*
- * If the user set MSG_EOF, the protocol
- * understands this flag and nothing left to
- * send then use PRU_SEND_EOF instead of PRU_SEND.
- */
- ((flags & MSG_EOF) &&
- (so->so_proto->pr_flags & PR_IMPLOPCL) &&
- (resid <= 0)) ?
- PRUS_EOF : 0,
- top, addr, control);
- splx(s);
- if (dontroute)
- so->so_options &= ~SO_DONTROUTE;
- clen = 0;
- control = 0;
- top = 0;
- mp = &top;
- if (error)
- goto release;
- } while (resid && space > 0);
- } while (resid);
-
-release:
- sbunlock(&so->so_snd);
-out:
- if (top)
- m_freem(top);
- if (control)
- m_freem(control);
- return (error);
-}
-
-/*
- * Implement receive operations on a socket.
- * We depend on the way that records are added to the sockbuf
- * by sbappend*. In particular, each record (mbufs linked through m_next)
- * must begin with an address if the protocol so specifies,
- * followed by an optional mbuf or mbufs containing ancillary data,
- * and then zero or more mbufs of data.
- * In order to avoid blocking network interrupts for the entire time here,
- * we splx() while doing the actual copy to user space.
- * Although the sockbuf is locked, new data may still be appended,
- * and thus we must maintain consistency of the sockbuf during that time.
- *
- * The caller may receive the data as a single mbuf chain by supplying
- * an mbuf **mp0 for use in returning the chain. The uio is then used
- * only for the count in uio_resid.
- */
-int
-soreceive(so, paddr, uio, mp0, controlp, flagsp)
- register struct socket *so;
- struct mbuf **paddr;
- struct uio *uio;
- struct mbuf **mp0;
- struct mbuf **controlp;
- int *flagsp;
-{
- register struct mbuf *m, **mp;
- register int flags, len, error, s, offset;
- struct protosw *pr = so->so_proto;
- struct mbuf *nextrecord;
- int moff, type = 0;
- int orig_resid = uio->uio_resid;
-
- mp = mp0;
- if (paddr)
- *paddr = 0;
- if (controlp)
- *controlp = 0;
- if (flagsp)
- flags = *flagsp &~ MSG_EOR;
- else
- flags = 0;
- if (flags & MSG_OOB) {
- m = m_get(M_WAIT, MT_DATA);
- error = (*pr->pr_usrreqs->pru_rcvoob)(so, m, flags & MSG_PEEK);
- if (error)
- goto bad;
- do {
- error = uiomove(mtod(m, caddr_t),
- (int) min(uio->uio_resid, m->m_len), uio);
- m = m_free(m);
- } while (uio->uio_resid && error == 0 && m);
-bad:
- if (m)
- m_freem(m);
- return (error);
- }
- if (mp)
- *mp = (struct mbuf *)0;
- if (so->so_state & SS_ISCONFIRMING && uio->uio_resid)
- (*pr->pr_usrreqs->pru_rcvd)(so, 0);
-
-restart:
- error = sblock(&so->so_rcv, SBLOCKWAIT(flags));
- if (error)
- return (error);
- s = splnet();
-
- m = so->so_rcv.sb_mb;
- /*
- * If we have less data than requested, block awaiting more
- * (subject to any timeout) if:
- * 1. the current count is less than the low water mark, or
- * 2. MSG_WAITALL is set, and it is possible to do the entire
- * receive operation at once if we block (resid <= hiwat).
- * 3. MSG_DONTWAIT is not set
- * If MSG_WAITALL is set but resid is larger than the receive buffer,
- * we have to do the receive in sections, and thus risk returning
- * a short count if a timeout or signal occurs after we start.
- */
- if (m == 0 || (((flags & MSG_DONTWAIT) == 0 &&
- so->so_rcv.sb_cc < uio->uio_resid) &&
- (so->so_rcv.sb_cc < so->so_rcv.sb_lowat ||
- ((flags & MSG_WAITALL) && uio->uio_resid <= so->so_rcv.sb_hiwat)) &&
- m->m_nextpkt == 0 && (pr->pr_flags & PR_ATOMIC) == 0)) {
-#ifdef DIAGNOSTIC
- if (m == 0 && so->so_rcv.sb_cc)
- panic("receive 1");
-#endif
- if (so->so_error) {
- if (m)
- goto dontblock;
- error = so->so_error;
- if ((flags & MSG_PEEK) == 0)
- so->so_error = 0;
- goto release;
- }
- if (so->so_state & SS_CANTRCVMORE) {
- if (m)
- goto dontblock;
- else
- goto release;
- }
- for (; m; m = m->m_next)
- if (m->m_type == MT_OOBDATA || (m->m_flags & M_EOR)) {
- m = so->so_rcv.sb_mb;
- goto dontblock;
- }
- if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 &&
- (so->so_proto->pr_flags & PR_CONNREQUIRED)) {
- error = ENOTCONN;
- goto release;
- }
- if (uio->uio_resid == 0)
- goto release;
- if ((so->so_state & SS_NBIO) || (flags & MSG_DONTWAIT)) {
- error = EWOULDBLOCK;
- goto release;
- }
- sbunlock(&so->so_rcv);
- error = sbwait(&so->so_rcv);
- splx(s);
- if (error)
- return (error);
- goto restart;
- }
-dontblock:
- nextrecord = m->m_nextpkt;
- if (pr->pr_flags & PR_ADDR) {
-#ifdef DIAGNOSTIC
- if (m->m_type != MT_SONAME)
- panic("receive 1a");
-#endif
- orig_resid = 0;
- if (flags & MSG_PEEK) {
- if (paddr)
- *paddr = m_copy(m, 0, m->m_len);
- m = m->m_next;
- } else {
- sbfree(&so->so_rcv, m);
- if (paddr) {
- *paddr = m;
- so->so_rcv.sb_mb = m->m_next;
- m->m_next = 0;
- m = so->so_rcv.sb_mb;
- } else {
- MFREE(m, so->so_rcv.sb_mb);
- m = so->so_rcv.sb_mb;
- }
- }
- }
- while (m && m->m_type == MT_CONTROL && error == 0) {
- if (flags & MSG_PEEK) {
- if (controlp)
- *controlp = m_copy(m, 0, m->m_len);
- m = m->m_next;
- } else {
- sbfree(&so->so_rcv, m);
- if (controlp) {
- if (pr->pr_domain->dom_externalize &&
- mtod(m, struct cmsghdr *)->cmsg_type ==
- SCM_RIGHTS)
- error = (*pr->pr_domain->dom_externalize)(m);
- *controlp = m;
- so->so_rcv.sb_mb = m->m_next;
- m->m_next = 0;
- m = so->so_rcv.sb_mb;
- } else {
- MFREE(m, so->so_rcv.sb_mb);
- m = so->so_rcv.sb_mb;
- }
- }
- if (controlp) {
- orig_resid = 0;
- controlp = &(*controlp)->m_next;
- }
- }
- if (m) {
- if ((flags & MSG_PEEK) == 0)
- m->m_nextpkt = nextrecord;
- type = m->m_type;
- if (type == MT_OOBDATA)
- flags |= MSG_OOB;
- }
- moff = 0;
- offset = 0;
- while (m && uio->uio_resid > 0 && error == 0) {
- if (m->m_type == MT_OOBDATA) {
- if (type != MT_OOBDATA)
- break;
- } else if (type == MT_OOBDATA)
- break;
-#ifdef DIAGNOSTIC
- else if (m->m_type != MT_DATA && m->m_type != MT_HEADER)
- panic("receive 3");
-#endif
- so->so_state &= ~SS_RCVATMARK;
- len = uio->uio_resid;
- if (so->so_oobmark && len > so->so_oobmark - offset)
- len = so->so_oobmark - offset;
- if (len > m->m_len - moff)
- len = m->m_len - moff;
- /*
- * If mp is set, just pass back the mbufs.
- * Otherwise copy them out via the uio, then free.
- * Sockbuf must be consistent here (points to current mbuf,
- * it points to next record) when we drop priority;
- * we must note any additions to the sockbuf when we
- * block interrupts again.
- */
- if (mp == 0) {
- splx(s);
- error = uiomove(mtod(m, caddr_t) + moff, (int)len, uio);
- s = splnet();
- if (error)
- goto release;
- } else
- uio->uio_resid -= len;
- if (len == m->m_len - moff) {
- if (m->m_flags & M_EOR)
- flags |= MSG_EOR;
- if (flags & MSG_PEEK) {
- m = m->m_next;
- moff = 0;
- } else {
- nextrecord = m->m_nextpkt;
- sbfree(&so->so_rcv, m);
- if (mp) {
- *mp = m;
- mp = &m->m_next;
- so->so_rcv.sb_mb = m = m->m_next;
- *mp = (struct mbuf *)0;
- } else {
- MFREE(m, so->so_rcv.sb_mb);
- m = so->so_rcv.sb_mb;
- }
- if (m)
- m->m_nextpkt = nextrecord;
- }
- } else {
- if (flags & MSG_PEEK)
- moff += len;
- else {
- if (mp)
- *mp = m_copym(m, 0, len, M_WAIT);
- m->m_data += len;
- m->m_len -= len;
- so->so_rcv.sb_cc -= len;
- }
- }
- if (so->so_oobmark) {
- if ((flags & MSG_PEEK) == 0) {
- so->so_oobmark -= len;
- if (so->so_oobmark == 0) {
- so->so_state |= SS_RCVATMARK;
- break;
- }
- } else {
- offset += len;
- if (offset == so->so_oobmark)
- break;
- }
- }
- if (flags & MSG_EOR)
- break;
- /*
- * If the MSG_WAITALL flag is set (for non-atomic socket),
- * we must not quit until "uio->uio_resid == 0" or an error
- * termination. If a signal/timeout occurs, return
- * with a short count but without error.
- * Keep sockbuf locked against other readers.
- */
- while (flags & MSG_WAITALL && m == 0 && uio->uio_resid > 0 &&
- !sosendallatonce(so) && !nextrecord) {
- if (so->so_error || so->so_state & SS_CANTRCVMORE)
- break;
- error = sbwait(&so->so_rcv);
- if (error) {
- sbunlock(&so->so_rcv);
- splx(s);
- return (0);
- }
- m = so->so_rcv.sb_mb;
- if (m)
- nextrecord = m->m_nextpkt;
- }
- }
-
- if (m && pr->pr_flags & PR_ATOMIC) {
- flags |= MSG_TRUNC;
- if ((flags & MSG_PEEK) == 0)
- (void) sbdroprecord(&so->so_rcv);
- }
- if ((flags & MSG_PEEK) == 0) {
- if (m == 0)
- so->so_rcv.sb_mb = nextrecord;
- if (pr->pr_flags & PR_WANTRCVD && so->so_pcb)
- (*pr->pr_usrreqs->pru_rcvd)(so, flags);
- }
- if (orig_resid == uio->uio_resid && orig_resid &&
- (flags & MSG_EOR) == 0 && (so->so_state & SS_CANTRCVMORE) == 0) {
- sbunlock(&so->so_rcv);
- splx(s);
- goto restart;
- }
-
- if (flagsp)
- *flagsp |= flags;
-release:
- sbunlock(&so->so_rcv);
- splx(s);
- return (error);
-}
-
-int
-soshutdown(so, how)
- register struct socket *so;
- register int how;
-{
- register struct protosw *pr = so->so_proto;
-
- how++;
- if (how & FREAD)
- sorflush(so);
- if (how & FWRITE)
- return ((*pr->pr_usrreqs->pru_shutdown)(so));
- return (0);
-}
-
-void
-sorflush(so)
- register struct socket *so;
-{
- register struct sockbuf *sb = &so->so_rcv;
- register struct protosw *pr = so->so_proto;
- register int s;
- struct sockbuf asb;
-
- sb->sb_flags |= SB_NOINTR;
- (void) sblock(sb, M_WAITOK);
- s = splimp();
- socantrcvmore(so);
- sbunlock(sb);
- asb = *sb;
- bzero((caddr_t)sb, sizeof (*sb));
- splx(s);
- if (pr->pr_flags & PR_RIGHTS && pr->pr_domain->dom_dispose)
- (*pr->pr_domain->dom_dispose)(asb.sb_mb);
- sbrelease(&asb);
-}
-
-int
-sosetopt(so, level, optname, m0)
- register struct socket *so;
- int level, optname;
- struct mbuf *m0;
-{
- int error = 0;
- register struct mbuf *m = m0;
-
- if (level != SOL_SOCKET) {
- if (so->so_proto && so->so_proto->pr_ctloutput)
- return ((*so->so_proto->pr_ctloutput)
- (PRCO_SETOPT, so, level, optname, &m0));
- error = ENOPROTOOPT;
- } else {
- switch (optname) {
-
- case SO_LINGER:
- if (m == NULL || m->m_len != sizeof (struct linger)) {
- error = EINVAL;
- goto bad;
- }
- so->so_linger = mtod(m, struct linger *)->l_linger;
- /* fall thru... */
-
- case SO_DEBUG:
- case SO_KEEPALIVE:
- case SO_DONTROUTE:
- case SO_USELOOPBACK:
- case SO_BROADCAST:
- case SO_REUSEADDR:
- case SO_REUSEPORT:
- case SO_OOBINLINE:
- case SO_TIMESTAMP:
- if (m == NULL || m->m_len < sizeof (int)) {
- error = EINVAL;
- goto bad;
- }
- if (*mtod(m, int *))
- so->so_options |= optname;
- else
- so->so_options &= ~optname;
- break;
-
- case SO_SNDBUF:
- case SO_RCVBUF:
- case SO_SNDLOWAT:
- case SO_RCVLOWAT:
- {
- int optval;
-
- if (m == NULL || m->m_len < sizeof (int)) {
- error = EINVAL;
- goto bad;
- }
-
- /*
- * Values < 1 make no sense for any of these
- * options, so disallow them.
- */
- optval = *mtod(m, int *);
- if (optval < 1) {
- error = EINVAL;
- goto bad;
- }
-
- switch (optname) {
-
- case SO_SNDBUF:
- case SO_RCVBUF:
- if (sbreserve(optname == SO_SNDBUF ?
- &so->so_snd : &so->so_rcv,
- (u_long) optval) == 0) {
- error = ENOBUFS;
- goto bad;
- }
- break;
-
- /*
- * Make sure the low-water is never greater than
- * the high-water.
- */
- case SO_SNDLOWAT:
- so->so_snd.sb_lowat =
- (optval > so->so_snd.sb_hiwat) ?
- so->so_snd.sb_hiwat : optval;
- break;
- case SO_RCVLOWAT:
- so->so_rcv.sb_lowat =
- (optval > so->so_rcv.sb_hiwat) ?
- so->so_rcv.sb_hiwat : optval;
- break;
- }
- break;
- }
-
- case SO_SNDTIMEO:
- case SO_RCVTIMEO:
- {
- struct timeval *tv;
- short val;
-
- if (m == NULL || m->m_len < sizeof (*tv)) {
- error = EINVAL;
- goto bad;
- }
- tv = mtod(m, struct timeval *);
- if (tv->tv_sec > SHRT_MAX / hz - hz) {
- error = EDOM;
- goto bad;
- }
- val = tv->tv_sec * hz + tv->tv_usec / tick;
-
- switch (optname) {
-
- case SO_SNDTIMEO:
- so->so_snd.sb_timeo = val;
- break;
- case SO_RCVTIMEO:
- so->so_rcv.sb_timeo = val;
- break;
- }
- break;
- }
-
- case SO_PRIVSTATE:
- /* we don't care what the parameter is... */
- so->so_state &= ~SS_PRIV;
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- if (error == 0 && so->so_proto && so->so_proto->pr_ctloutput) {
- (void) ((*so->so_proto->pr_ctloutput)
- (PRCO_SETOPT, so, level, optname, &m0));
- m = NULL; /* freed by protocol */
- }
- }
-bad:
- if (m)
- (void) m_free(m);
- return (error);
-}
-
-int
-sogetopt(so, level, optname, mp)
- register struct socket *so;
- int level, optname;
- struct mbuf **mp;
-{
- register struct mbuf *m;
-
- if (level != SOL_SOCKET) {
- if (so->so_proto && so->so_proto->pr_ctloutput) {
- return ((*so->so_proto->pr_ctloutput)
- (PRCO_GETOPT, so, level, optname, mp));
- } else
- return (ENOPROTOOPT);
- } else {
- m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof (int);
-
- switch (optname) {
-
- case SO_LINGER:
- m->m_len = sizeof (struct linger);
- mtod(m, struct linger *)->l_onoff =
- so->so_options & SO_LINGER;
- mtod(m, struct linger *)->l_linger = so->so_linger;
- break;
-
- case SO_USELOOPBACK:
- case SO_DONTROUTE:
- case SO_DEBUG:
- case SO_KEEPALIVE:
- case SO_REUSEADDR:
- case SO_REUSEPORT:
- case SO_BROADCAST:
- case SO_OOBINLINE:
- case SO_TIMESTAMP:
- *mtod(m, int *) = so->so_options & optname;
- break;
-
- case SO_PRIVSTATE:
- *mtod(m, int *) = so->so_state & SS_PRIV;
- break;
-
- case SO_TYPE:
- *mtod(m, int *) = so->so_type;
- break;
-
- case SO_ERROR:
- *mtod(m, int *) = so->so_error;
- so->so_error = 0;
- break;
-
- case SO_SNDBUF:
- *mtod(m, int *) = so->so_snd.sb_hiwat;
- break;
-
- case SO_RCVBUF:
- *mtod(m, int *) = so->so_rcv.sb_hiwat;
- break;
-
- case SO_SNDLOWAT:
- *mtod(m, int *) = so->so_snd.sb_lowat;
- break;
-
- case SO_RCVLOWAT:
- *mtod(m, int *) = so->so_rcv.sb_lowat;
- break;
-
- case SO_SNDTIMEO:
- case SO_RCVTIMEO:
- {
- int val = (optname == SO_SNDTIMEO ?
- so->so_snd.sb_timeo : so->so_rcv.sb_timeo);
-
- m->m_len = sizeof(struct timeval);
- mtod(m, struct timeval *)->tv_sec = val / hz;
- mtod(m, struct timeval *)->tv_usec =
- (val % hz) * tick;
- break;
- }
-
- default:
- (void)m_free(m);
- return (ENOPROTOOPT);
- }
- *mp = m;
- return (0);
- }
-}
-
-void
-sohasoutofband(so)
- register struct socket *so;
-{
-#if 0 /* FIXME: For now we just ignore out of band data */
- struct proc *p;
-
- if (so->so_pgid < 0)
- gsignal(-so->so_pgid, SIGURG);
- else if (so->so_pgid > 0 && (p = pfind(so->so_pgid)) != 0)
- psignal(p, SIGURG);
- selwakeup(&so->so_rcv.sb_sel);
-#endif
-}
diff --git a/cpukit/libnetworking/kern/uipc_socket2.c b/cpukit/libnetworking/kern/uipc_socket2.c
deleted file mode 100644
index 0539d2c5f3..0000000000
--- a/cpukit/libnetworking/kern/uipc_socket2.c
+++ /dev/null
@@ -1,965 +0,0 @@
-/*
- * This file has undergone several changes to reflect the
- * differences between the RTEMS and FreeBSD kernels.
- */
-
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 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.
- *
- * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
-#include <sys/file.h>
-#include <sys/buf.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/signalvar.h>
-#include <sys/sysctl.h>
-
-/*
- * Primitive routines for operating on sockets and socket buffers
- */
-
-u_long sb_max = SB_MAX; /* XXX should be static */
-SYSCTL_INT(_kern, KERN_MAXSOCKBUF, maxsockbuf, CTLFLAG_RW, &sb_max, 0, "")
-
-static u_long sb_efficiency = 8; /* parameter for sbreserve() */
-SYSCTL_INT(_kern, OID_AUTO, sockbuf_waste_factor, CTLFLAG_RW, &sb_efficiency,
- 0, "");
-
-/*
- * Procedures to manipulate state flags of socket
- * and do appropriate wakeups. Normal sequence from the
- * active (originating) side is that soisconnecting() is
- * called during processing of connect() call,
- * resulting in an eventual call to soisconnected() if/when the
- * connection is established. When the connection is torn down
- * soisdisconnecting() is called during processing of disconnect() call,
- * and soisdisconnected() is called when the connection to the peer
- * is totally severed. The semantics of these routines are such that
- * connectionless protocols can call soisconnected() and soisdisconnected()
- * only, bypassing the in-progress calls when setting up a ``connection''
- * takes no time.
- *
- * From the passive side, a socket is created with
- * two queues of sockets: so_q0 for connections in progress
- * and so_q for connections already made and awaiting user acceptance.
- * As a protocol is preparing incoming connections, it creates a socket
- * structure queued on so_q0 by calling sonewconn(). When the connection
- * is established, soisconnected() is called, and transfers the
- * socket structure to so_q, making it available to accept().
- *
- * If a socket is closed with sockets on either
- * so_q0 or so_q, these sockets are dropped.
- *
- * If higher level protocols are implemented in
- * the kernel, the wakeups done here will sometimes
- * cause software-interrupt process scheduling.
- */
-
-void
-soisconnecting(so)
- register struct socket *so;
-{
-
- so->so_state &= ~(SS_ISCONNECTED|SS_ISDISCONNECTING);
- so->so_state |= SS_ISCONNECTING;
-}
-
-void
-soisconnected(so)
- register struct socket *so;
-{
- register struct socket *head = so->so_head;
-
- so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING);
- so->so_state |= SS_ISCONNECTED;
- if (head && (so->so_state & SS_INCOMP)) {
- TAILQ_REMOVE(&head->so_incomp, so, so_list);
- head->so_incqlen--;
- so->so_state &= ~SS_INCOMP;
- TAILQ_INSERT_TAIL(&head->so_comp, so, so_list);
- so->so_state |= SS_COMP;
- sorwakeup(head);
- soconnwakeup(head);
- } else {
- soconnwakeup(so);
- sorwakeup(so);
- sowwakeup(so);
- }
-}
-
-void
-soisdisconnecting(so)
- register struct socket *so;
-{
-
- so->so_state &= ~SS_ISCONNECTING;
- so->so_state |= (SS_ISDISCONNECTING|SS_CANTRCVMORE|SS_CANTSENDMORE);
- soconnwakeup(so);
- sowwakeup(so);
- sorwakeup(so);
-}
-
-void
-soisdisconnected(so)
- register struct socket *so;
-{
-
- so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
- so->so_state |= (SS_CANTRCVMORE|SS_CANTSENDMORE);
- soconnwakeup(so);
- sowwakeup(so);
- sorwakeup(so);
-}
-
-/*
- * Return a random connection that hasn't been serviced yet and
- * is eligible for discard. There is a one in qlen chance that
- * we will return a null, saying that there are no dropable
- * requests. In this case, the protocol specific code should drop
- * the new request. This insures fairness.
- *
- * This may be used in conjunction with protocol specific queue
- * congestion routines.
- */
-struct socket *
-sodropablereq(head)
- register struct socket *head;
-{
- register struct socket *so;
- unsigned int i, j, qlen, m;
-
- static int rnd;
- static long old_mono_secs;
- static unsigned int cur_cnt, old_cnt;
-
- if ((i = (m = rtems_bsdnet_seconds_since_boot()) - old_mono_secs) != 0) {
- old_mono_secs = m;
- old_cnt = cur_cnt / i;
- cur_cnt = 0;
- }
-
- so = TAILQ_FIRST(&head->so_incomp);
- if (!so)
- return (so);
-
- qlen = head->so_incqlen;
- if (++cur_cnt > qlen || old_cnt > qlen) {
- rnd = (314159 * rnd + 66329) & 0xffff;
- j = ((qlen + 1) * rnd) >> 16;
-
- while (j-- && so)
- so = TAILQ_NEXT(so, so_list);
- }
-
- return (so);
-}
-
-/*
- * When an attempt at a new connection is noted on a socket
- * which accepts connections, sonewconn is called. If the
- * connection is possible (subject to space constraints, etc.)
- * then we allocate a new structure, propoerly linked into the
- * data structure of the original socket, and return this.
- * Connstatus may be 0, or SO_ISCONFIRMING, or SO_ISCONNECTED.
- *
- * Currently, sonewconn() is defined as sonewconn1() in socketvar.h
- * to catch calls that are missing the (new) second parameter.
- */
-struct socket *
-sonewconn1(head, connstatus)
- register struct socket *head;
- int connstatus;
-{
- register struct socket *so;
-
- if (head->so_qlen > 3 * head->so_qlimit / 2)
- return ((struct socket *)0);
- MALLOC(so, struct socket *, sizeof(*so), M_SOCKET, M_DONTWAIT);
- if (so == NULL)
- return ((struct socket *)0);
- bzero((caddr_t)so, sizeof(*so));
- so->so_head = head;
- so->so_type = head->so_type;
- so->so_options = head->so_options &~ SO_ACCEPTCONN;
- so->so_linger = head->so_linger;
- so->so_state = head->so_state | SS_NOFDREF;
- so->so_proto = head->so_proto;
- so->so_timeo = head->so_timeo;
- so->so_pgid = head->so_pgid;
- so->so_uid = head->so_uid;
- (void) soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat);
- if (connstatus) {
- TAILQ_INSERT_TAIL(&head->so_comp, so, so_list);
- so->so_state |= SS_COMP;
- } else {
- TAILQ_INSERT_TAIL(&head->so_incomp, so, so_list);
- so->so_state |= SS_INCOMP;
- head->so_incqlen++;
- }
- head->so_qlen++;
- if ((*so->so_proto->pr_usrreqs->pru_attach)(so, 0)) {
- if (so->so_state & SS_COMP) {
- TAILQ_REMOVE(&head->so_comp, so, so_list);
- } else {
- TAILQ_REMOVE(&head->so_incomp, so, so_list);
- head->so_incqlen--;
- }
- head->so_qlen--;
- (void) free((caddr_t)so, M_SOCKET);
- return ((struct socket *)0);
- }
- if (connstatus) {
- sorwakeup(head);
- soconnwakeup(head);
- so->so_state |= connstatus;
- }
- return (so);
-}
-
-/*
- * Socantsendmore indicates that no more data will be sent on the
- * socket; it would normally be applied to a socket when the user
- * informs the system that no more data is to be sent, by the protocol
- * code (in case PRU_SHUTDOWN). Socantrcvmore indicates that no more data
- * will be received, and will normally be applied to the socket by a
- * protocol when it detects that the peer will send no more data.
- * Data queued for reading in the socket may yet be read.
- */
-
-void
-socantsendmore(so)
- struct socket *so;
-{
-
- so->so_state |= SS_CANTSENDMORE;
- sowwakeup(so);
-}
-
-void
-socantrcvmore(so)
- struct socket *so;
-{
-
- so->so_state |= SS_CANTRCVMORE;
- sorwakeup(so);
-}
-
-/*
- * Socket buffer (struct sockbuf) utility routines.
- *
- * Each socket contains two socket buffers: one for sending data and
- * one for receiving data. Each buffer contains a queue of mbufs,
- * information about the number of mbufs and amount of data in the
- * queue, and other fields allowing select() statements and notification
- * on data availability to be implemented.
- *
- * Data stored in a socket buffer is maintained as a list of records.
- * Each record is a list of mbufs chained together with the m_next
- * field. Records are chained together with the m_nextpkt field. The upper
- * level routine soreceive() expects the following conventions to be
- * observed when placing information in the receive buffer:
- *
- * 1. If the protocol requires each message be preceded by the sender's
- * name, then a record containing that name must be present before
- * any associated data (mbuf's must be of type MT_SONAME).
- * 2. If the protocol supports the exchange of ``access rights'' (really
- * just additional data associated with the message), and there are
- * ``rights'' to be received, then a record containing this data
- * should be present (mbuf's must be of type MT_RIGHTS).
- * 3. If a name or rights record exists, then it must be followed by
- * a data record, perhaps of zero length.
- *
- * Before using a new socket structure it is first necessary to reserve
- * buffer space to the socket, by calling sbreserve(). This should commit
- * some of the available buffer space in the system buffer pool for the
- * socket (currently, it does nothing but enforce limits). The space
- * should be released by calling sbrelease() when the socket is destroyed.
- */
-
-int
-soreserve(so, sndcc, rcvcc)
- register struct socket *so;
- u_long sndcc, rcvcc;
-{
-
- if (sbreserve(&so->so_snd, sndcc) == 0)
- goto bad;
- if (sbreserve(&so->so_rcv, rcvcc) == 0)
- goto bad2;
- if (so->so_rcv.sb_lowat == 0)
- so->so_rcv.sb_lowat = 1;
- if (so->so_snd.sb_lowat == 0)
- so->so_snd.sb_lowat = MCLBYTES;
- if (so->so_snd.sb_lowat > so->so_snd.sb_hiwat)
- so->so_snd.sb_lowat = so->so_snd.sb_hiwat;
- return (0);
-bad2:
- sbrelease(&so->so_snd);
-bad:
- return (ENOBUFS);
-}
-
-/*
- * Allot mbufs to a sockbuf.
- * Attempt to scale mbmax so that mbcnt doesn't become limiting
- * if buffering efficiency is near the normal case.
- */
-int
-sbreserve(sb, cc)
- struct sockbuf *sb;
- u_long cc;
-{
-
- if (cc > sb_max * MCLBYTES / (MSIZE + MCLBYTES))
- return (0);
- sb->sb_hiwat = cc;
- sb->sb_mbmax = min(cc * sb_efficiency, sb_max);
- if (sb->sb_lowat > sb->sb_hiwat)
- sb->sb_lowat = sb->sb_hiwat;
- return (1);
-}
-
-/*
- * Free mbufs held by a socket, and reserved mbuf space.
- */
-void
-sbrelease(sb)
- struct sockbuf *sb;
-{
-
- sbflush(sb);
- sb->sb_hiwat = sb->sb_mbmax = 0;
-}
-
-/*
- * Routines to add and remove
- * data from an mbuf queue.
- *
- * The routines sbappend() or sbappendrecord() are normally called to
- * append new mbufs to a socket buffer, after checking that adequate
- * space is available, comparing the function sbspace() with the amount
- * of data to be added. sbappendrecord() differs from sbappend() in
- * that data supplied is treated as the beginning of a new record.
- * To place a sender's address, optional access rights, and data in a
- * socket receive buffer, sbappendaddr() should be used. To place
- * access rights and data in a socket receive buffer, sbappendrights()
- * should be used. In either case, the new data begins a new record.
- * Note that unlike sbappend() and sbappendrecord(), these routines check
- * for the caller that there will be enough space to store the data.
- * Each fails if there is not enough space, or if it cannot find mbufs
- * to store additional information in.
- *
- * Reliable protocols may use the socket send buffer to hold data
- * awaiting acknowledgement. Data is normally copied from a socket
- * send buffer in a protocol with m_copy for output to a peer,
- * and then removing the data from the socket buffer with sbdrop()
- * or sbdroprecord() when the data is acknowledged by the peer.
- */
-
-/*
- * Append mbuf chain m to the last record in the
- * socket buffer sb. The additional space associated
- * the mbuf chain is recorded in sb. Empty mbufs are
- * discarded and mbufs are compacted where possible.
- */
-void
-sbappend(sb, m)
- struct sockbuf *sb;
- struct mbuf *m;
-{
- register struct mbuf *n;
-
- if (m == 0)
- return;
- n = sb->sb_mb;
- if (n) {
- while (n->m_nextpkt)
- n = n->m_nextpkt;
- do {
- if (n->m_flags & M_EOR) {
- sbappendrecord(sb, m); /* XXXXXX!!!! */
- return;
- }
- } while (n->m_next && (n = n->m_next));
- }
- sbcompress(sb, m, n);
-}
-
-#ifdef SOCKBUF_DEBUG
-void
-sbcheck(sb)
- register struct sockbuf *sb;
-{
- register struct mbuf *m;
- register int len = 0, mbcnt = 0;
-
- for (m = sb->sb_mb; m; m = m->m_next) {
- len += m->m_len;
- mbcnt += MSIZE;
- if (m->m_flags & M_EXT) /*XXX*/ /* pretty sure this is bogus */
- mbcnt += m->m_ext.ext_size;
- if (m->m_nextpkt)
- panic("sbcheck nextpkt");
- }
- if (len != sb->sb_cc || mbcnt != sb->sb_mbcnt) {
- printf("cc %d != %d || mbcnt %d != %d\n", len, sb->sb_cc,
- mbcnt, sb->sb_mbcnt);
- panic("sbcheck");
- }
-}
-#endif
-
-/*
- * As above, except the mbuf chain
- * begins a new record.
- */
-void
-sbappendrecord(sb, m0)
- register struct sockbuf *sb;
- register struct mbuf *m0;
-{
- register struct mbuf *m;
-
- if (m0 == 0)
- return;
- m = sb->sb_mb;
- if (m)
- while (m->m_nextpkt)
- m = m->m_nextpkt;
- /*
- * Put the first mbuf on the queue.
- * Note this permits zero length records.
- */
- sballoc(sb, m0);
- if (m)
- m->m_nextpkt = m0;
- else
- sb->sb_mb = m0;
- m = m0->m_next;
- m0->m_next = 0;
- if (m && (m0->m_flags & M_EOR)) {
- m0->m_flags &= ~M_EOR;
- m->m_flags |= M_EOR;
- }
- sbcompress(sb, m, m0);
-}
-
-/*
- * As above except that OOB data
- * is inserted at the beginning of the sockbuf,
- * but after any other OOB data.
- */
-void
-sbinsertoob(sb, m0)
- register struct sockbuf *sb;
- register struct mbuf *m0;
-{
- register struct mbuf *m;
- register struct mbuf **mp;
-
- if (m0 == 0)
- return;
- for (mp = &sb->sb_mb; *mp ; mp = &((*mp)->m_nextpkt)) {
- m = *mp;
- again:
- switch (m->m_type) {
-
- case MT_OOBDATA:
- continue; /* WANT next train */
-
- case MT_CONTROL:
- m = m->m_next;
- if (m)
- goto again; /* inspect THIS train further */
- }
- break;
- }
- /*
- * Put the first mbuf on the queue.
- * Note this permits zero length records.
- */
- sballoc(sb, m0);
- m0->m_nextpkt = *mp;
- *mp = m0;
- m = m0->m_next;
- m0->m_next = 0;
- if (m && (m0->m_flags & M_EOR)) {
- m0->m_flags &= ~M_EOR;
- m->m_flags |= M_EOR;
- }
- sbcompress(sb, m, m0);
-}
-
-/*
- * Append address and data, and optionally, control (ancillary) data
- * to the receive queue of a socket. If present,
- * m0 must include a packet header with total length.
- * Returns 0 if no space in sockbuf or insufficient mbufs.
- */
-int
-sbappendaddr(sb, asa, m0, control)
- register struct sockbuf *sb;
- struct sockaddr *asa;
- struct mbuf *m0, *control;
-{
- register struct mbuf *m, *n;
- int space = asa->sa_len;
-
-if (m0 && (m0->m_flags & M_PKTHDR) == 0)
-panic("sbappendaddr");
- if (m0)
- space += m0->m_pkthdr.len;
- for (n = control; n; n = n->m_next) {
- space += n->m_len;
- if (n->m_next == 0) /* keep pointer to last control buf */
- break;
- }
- if (space > sbspace(sb))
- return (0);
- if (asa->sa_len > MLEN)
- return (0);
- MGET(m, M_DONTWAIT, MT_SONAME);
- if (m == 0)
- return (0);
- m->m_len = asa->sa_len;
- bcopy((caddr_t)asa, mtod(m, caddr_t), asa->sa_len);
- if (n)
- n->m_next = m0; /* concatenate data to control */
- else
- control = m0;
- m->m_next = control;
- for (n = m; n; n = n->m_next)
- sballoc(sb, n);
- n = sb->sb_mb;
- if (n) {
- while (n->m_nextpkt)
- n = n->m_nextpkt;
- n->m_nextpkt = m;
- } else
- sb->sb_mb = m;
- return (1);
-}
-
-int
-sbappendcontrol(sb, m0, control)
- struct sockbuf *sb;
- struct mbuf *control, *m0;
-{
- register struct mbuf *m, *n;
- int space = 0;
-
- if (control == 0)
- panic("sbappendcontrol");
- for (m = control; ; m = m->m_next) {
- space += m->m_len;
- if (m->m_next == 0)
- break;
- }
- n = m; /* save pointer to last control buffer */
- for (m = m0; m; m = m->m_next)
- space += m->m_len;
- if (space > sbspace(sb))
- return (0);
- n->m_next = m0; /* concatenate data to control */
- for (m = control; m; m = m->m_next)
- sballoc(sb, m);
- n = sb->sb_mb;
- if (n) {
- while (n->m_nextpkt)
- n = n->m_nextpkt;
- n->m_nextpkt = control;
- } else
- sb->sb_mb = control;
- return (1);
-}
-
-/*
- * Compress mbuf chain m into the socket
- * buffer sb following mbuf n. If n
- * is null, the buffer is presumed empty.
- */
-void
-sbcompress(sb, m, n)
- register struct sockbuf *sb;
- register struct mbuf *m, *n;
-{
- register int eor = 0;
- register struct mbuf *o;
-
- while (m) {
- eor |= m->m_flags & M_EOR;
- if (m->m_len == 0 &&
- (eor == 0 ||
- (((o = m->m_next) || (o = n)) &&
- o->m_type == m->m_type))) {
- m = m_free(m);
- continue;
- }
- if (n && (n->m_flags & (M_EXT | M_EOR)) == 0 &&
- (n->m_data + n->m_len + m->m_len) < &n->m_dat[MLEN] &&
- n->m_type == m->m_type) {
- bcopy(mtod(m, caddr_t), mtod(n, caddr_t) + n->m_len,
- (unsigned)m->m_len);
- n->m_len += m->m_len;
- sb->sb_cc += m->m_len;
- m = m_free(m);
- continue;
- }
- if (n)
- n->m_next = m;
- else
- sb->sb_mb = m;
- sballoc(sb, m);
- n = m;
- m->m_flags &= ~M_EOR;
- m = m->m_next;
- n->m_next = 0;
- }
- if (eor) {
- if (n)
- n->m_flags |= eor;
- else
- printf("semi-panic: sbcompress\n");
- }
-}
-
-/*
- * Free all mbufs in a sockbuf.
- * Check that all resources are reclaimed.
- */
-void
-sbflush(sb)
- register struct sockbuf *sb;
-{
-
- if (sb->sb_flags & SB_LOCK)
- panic("sbflush");
- while (sb->sb_mbcnt)
- sbdrop(sb, (int)sb->sb_cc);
- if (sb->sb_cc || sb->sb_mb)
- panic("sbflush 2");
-}
-
-/*
- * Drop data from (the front of) a sockbuf.
- */
-void
-sbdrop(sb, len)
- register struct sockbuf *sb;
- register int len;
-{
- register struct mbuf *m, *mn;
- struct mbuf *next;
-
- next = (m = sb->sb_mb) ? m->m_nextpkt : 0;
- while (len > 0) {
- if (m == 0) {
- if (next == 0)
- panic("sbdrop");
- m = next;
- next = m->m_nextpkt;
- continue;
- }
- if (m->m_len > len) {
- m->m_len -= len;
- m->m_data += len;
- sb->sb_cc -= len;
- break;
- }
- len -= m->m_len;
- sbfree(sb, m);
- MFREE(m, mn);
- m = mn;
- }
- while (m && m->m_len == 0) {
- sbfree(sb, m);
- MFREE(m, mn);
- m = mn;
- }
- if (m) {
- sb->sb_mb = m;
- m->m_nextpkt = next;
- } else
- sb->sb_mb = next;
-}
-
-/*
- * Drop a record off the front of a sockbuf
- * and move the next record to the front.
- */
-void
-sbdroprecord(sb)
- register struct sockbuf *sb;
-{
- register struct mbuf *m, *mn;
-
- m = sb->sb_mb;
- if (m) {
- sb->sb_mb = m->m_nextpkt;
- do {
- sbfree(sb, m);
- MFREE(m, mn);
- m = mn;
- } while (m);
- }
-}
-
-/*
- * Create a "control" mbuf containing the specified data
- * with the specified type for presentation on a socket buffer.
- */
-struct mbuf *
-sbcreatecontrol(p, size, type, level)
- caddr_t p;
- register int size;
- int type, level;
-{
- register struct cmsghdr *cp;
- struct mbuf *m;
-
- if ((m = m_get(M_DONTWAIT, MT_CONTROL)) == NULL)
- return ((struct mbuf *) NULL);
- cp = mtod(m, struct cmsghdr *);
- /* XXX check size? */
- (void)memcpy(CMSG_DATA(cp), p, size);
- size += sizeof(*cp);
- m->m_len = size;
- cp->cmsg_len = size;
- cp->cmsg_level = level;
- cp->cmsg_type = type;
- return (m);
-}
-
-#ifdef PRU_OLDSTYLE
-/*
- * The following routines mediate between the old-style `pr_usrreq'
- * protocol implementations and the new-style `struct pr_usrreqs'
- * calling convention.
- */
-
-/* syntactic sugar */
-#define nomb (struct mbuf *)0
-
-static int
-old_abort(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_ABORT, nomb, nomb, nomb);
-}
-
-static int
-old_accept(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_ACCEPT, nomb, nam, nomb);
-}
-
-static int
-old_attach(struct socket *so, int proto)
-{
- return so->so_proto->pr_ousrreq(so, PRU_ATTACH, nomb,
- (struct mbuf *)proto, /* XXX */
- nomb);
-}
-
-static int
-old_bind(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_BIND, nomb, nam, nomb);
-}
-
-static int
-old_connect(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_CONNECT, nomb, nam, nomb);
-}
-
-static int
-old_connect2(struct socket *so1, struct socket *so2)
-{
- return so1->so_proto->pr_ousrreq(so1, PRU_CONNECT2, nomb,
- (struct mbuf *)so2, nomb);
-}
-
-static int
-old_control(struct socket *so, int cmd, caddr_t data, struct ifnet *ifp)
-{
- return so->so_proto->pr_ousrreq(so, PRU_CONTROL, (struct mbuf *)cmd,
- (struct mbuf *)data,
- (struct mbuf *)ifp);
-}
-
-static int
-old_detach(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_DETACH, nomb, nomb, nomb);
-}
-
-static int
-old_disconnect(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_DISCONNECT, nomb, nomb, nomb);
-}
-
-static int
-old_listen(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_LISTEN, nomb, nomb, nomb);
-}
-
-static int
-old_peeraddr(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_PEERADDR, nomb, nam, nomb);
-}
-
-static int
-old_rcvd(struct socket *so, int flags)
-{
- return so->so_proto->pr_ousrreq(so, PRU_RCVD, nomb,
- (struct mbuf *)flags, /* XXX */
- nomb);
-}
-
-static int
-old_rcvoob(struct socket *so, struct mbuf *m, int flags)
-{
- return so->so_proto->pr_ousrreq(so, PRU_RCVOOB, m,
- (struct mbuf *)flags, /* XXX */
- nomb);
-}
-
-static int
-old_send(struct socket *so, int flags, struct mbuf *m, struct mbuf *addr,
- struct mbuf *control)
-{
- int req;
-
- if (flags & PRUS_OOB) {
- req = PRU_SENDOOB;
- } else if(flags & PRUS_EOF) {
- req = PRU_SEND_EOF;
- } else {
- req = PRU_SEND;
- }
- return so->so_proto->pr_ousrreq(so, req, m, addr, control);
-}
-
-static int
-old_sense(struct socket *so, struct stat *sb)
-{
- return so->so_proto->pr_ousrreq(so, PRU_SENSE, (struct mbuf *)sb,
- nomb, nomb);
-}
-
-static int
-old_shutdown(struct socket *so)
-{
- return so->so_proto->pr_ousrreq(so, PRU_SHUTDOWN, nomb, nomb, nomb);
-}
-
-static int
-old_sockaddr(struct socket *so, struct mbuf *nam)
-{
- return so->so_proto->pr_ousrreq(so, PRU_SOCKADDR, nomb, nam, nomb);
-}
-
-struct pr_usrreqs pru_oldstyle = {
- old_abort, old_accept, old_attach, old_bind, old_connect,
- old_connect2, old_control, old_detach, old_disconnect,
- old_listen, old_peeraddr, old_rcvd, old_rcvoob, old_send,
- old_sense, old_shutdown, old_sockaddr
-};
-
-#endif /* PRU_OLDSTYLE */
-
-/*
- * Some routines that return EOPNOTSUPP for entry points that are not
- * supported by a protocol. Fill in as needed.
- */
-int
-pru_accept_notsupp(struct socket *so, struct mbuf *nam)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_connect2_notsupp(struct socket *so1, struct socket *so2)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_control_notsupp(struct socket *so, int cmd, caddr_t data,
- struct ifnet *ifp)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_listen_notsupp(struct socket *so)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_rcvd_notsupp(struct socket *so, int flags)
-{
- return EOPNOTSUPP;
-}
-
-int
-pru_rcvoob_notsupp(struct socket *so, struct mbuf *m, int flags)
-{
- return EOPNOTSUPP;
-}
-
-/*
- * This isn't really a ``null'' operation, but it's the default one
- * and doesn't do anything destructive.
- */
-int
-pru_sense_null(struct socket *so, struct stat *sb)
-{
- sb->st_blksize = so->so_snd.sb_hiwat;
- return 0;
-}
-
diff --git a/cpukit/libnetworking/lib/README b/cpukit/libnetworking/lib/README
deleted file mode 100644
index 998bd5e708..0000000000
--- a/cpukit/libnetworking/lib/README
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# $Id$
-#
-
-Sources from application-level (as opposed to kernel-level) libraries.
diff --git a/cpukit/libnetworking/lib/getprotoby.c b/cpukit/libnetworking/lib/getprotoby.c
deleted file mode 100644
index fc8de6e402..0000000000
--- a/cpukit/libnetworking/lib/getprotoby.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * $Id$
- */
-
-#include <netdb.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-static const struct protoent prototab[] = {
- { "ip", NULL, IPPROTO_IP },
- { "icmp", NULL, IPPROTO_ICMP },
- { "tcp", NULL, IPPROTO_TCP },
- { "udp", NULL, IPPROTO_UDP },
- };
-
-/*
- * Dummy version of BSD getprotobyname()
- */
-struct protoent *
-getprotobyname (const char *name)
-{
- int i;
-
- for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
- if (strcmp (name, prototab[i].p_name) == 0)
- return (struct protoent *) &prototab[i];
- }
- return NULL;
-}
-
-/*
- * Dummy version of BSD getprotobynumber()
- */
-struct protoent *
-getprotobynumber (int proto)
-{
- int i;
-
- for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
- if (proto == prototab[i].p_proto)
- return (struct protoent *) &prototab[i];
- }
- return NULL;
-}
diff --git a/cpukit/libnetworking/lib/syslog.c b/cpukit/libnetworking/lib/syslog.c
deleted file mode 100644
index 0bb15bc78e..0000000000
--- a/cpukit/libnetworking/lib/syslog.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * RTEMS version of syslog and associated routines
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <syslog.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include <unistd.h>
-
-static int LogStatus = LOG_CONS;
-static const char *LogTag = "syslog";
-static int LogFacility = LOG_USER;
-static int LogMask = 0xff;
-
-static int LogFd = -1;
-static rtems_id LogSemaphore;
-extern struct in_addr rtems_bsdnet_log_host_address;
-
-#define SYSLOG_PORT 514
-
-void
-syslog (int pri, const char *fmt, ...)
-{
- va_list ap;
-
- va_start (ap, fmt);
- vsyslog (pri, fmt, ap);
- va_end (ap);
-}
-
-/*
- * FIXME: Should cbuf be static? It could be if we put the mutex
- * around the entire body of this routine. Then we wouldn't
- * have to worry about blowing stacks with a local variable
- * that large. Could make cbuf bigger, too.
- */
-void
-vsyslog (int pri, const char *fmt, va_list ap)
-{
- int cnt;
- char *cp;
- char *msgp, cbuf[200];
- int sent;
-
- if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) {
- syslog (LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID,
- "syslog: unknown facility/priority: %#x", pri);
- pri &= LOG_PRIMASK|LOG_FACMASK;
- }
-
- if (!LOG_MASK(LOG_PRI(pri)) & LogMask)
- return;
-
- if ((pri & LOG_FACMASK) == 0)
- pri |= LogFacility;
-
- cnt = sprintf (cbuf, "<%d>", pri);
- cp = msgp = cbuf + cnt;
- if (LogTag) {
- const char *lp = LogTag;
- while ((*cp = *lp++) != '\0')
- cp++;
- }
- if (LogStatus & LOG_PID) {
- rtems_id tid;
- rtems_task_ident (RTEMS_SELF, 0, &tid);
- cnt = sprintf (cp, "[%#lx]", (unsigned long)tid);
- cp += cnt;
- }
- if (LogTag) {
- *cp++ = ':';
- *cp++ = ' ';
- }
- cnt = vsprintf (cp, fmt, ap);
- cnt += cp - cbuf;
- if (cbuf[cnt-1] == '\n')
- cbuf[--cnt] = '\0';
-
- if (LogStatus & LOG_PERROR)
- printf ("%s\n", cbuf);
-
- /*
- * Grab the mutex
- */
- sent = 0;
- if ((rtems_bsdnet_log_host_address.s_addr != INADDR_ANY)
- && (LogFd >= 0)
- && (rtems_semaphore_obtain (LogSemaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT) == RTEMS_SUCCESSFUL)) {
- /*
- * Set the destination address/port
- */
- struct sockaddr_in farAddress;
- farAddress.sin_family = AF_INET;
- farAddress.sin_port = htons (SYSLOG_PORT);
- farAddress.sin_addr = rtems_bsdnet_log_host_address;
- memset (farAddress.sin_zero, '\0', sizeof farAddress.sin_zero);
-
- /*
- * Send the message
- */
- if (sendto (LogFd, cbuf, cnt, 0, (struct sockaddr *)&farAddress, sizeof farAddress) >= 0)
- sent = 1;
- rtems_semaphore_release (LogSemaphore);
- }
- if (!sent && (LogStatus & LOG_CONS) && !(LogStatus & LOG_PERROR))
- printf ("%s\n", msgp);
-}
-
-void
-openlog (const char *ident, int logstat, int logfac)
-{
- rtems_status_code sc;
- struct sockaddr_in myAddress;
-
- if (ident != NULL)
- LogTag = ident;
- LogStatus = logstat;
- if (logfac != 0 && (logfac & ~LOG_FACMASK) == 0)
- LogFacility = logfac;
-
- /*
- * Create the socket
- */
- if ((LogFd = socket (AF_INET, SOCK_DGRAM, 0)) < 0) {
- printf ("Can't create syslog socket: %d\n", errno);
- return;
- }
-
- /*
- * Bind socket to name
- */
- myAddress.sin_family = AF_INET;
- myAddress.sin_addr.s_addr = INADDR_ANY;
- myAddress.sin_port = 0;
- memset (myAddress.sin_zero, '\0', sizeof myAddress.sin_zero);
- if (bind (LogFd, (struct sockaddr *)&myAddress, sizeof (myAddress)) < 0) {
- close (LogFd);
- LogFd = -1;
- printf ("Can't bind syslog socket: %d\n", errno);
- return;
- }
-
- /*
- * Create the mutex
- */
- sc = rtems_semaphore_create (rtems_build_name('s', 'L', 'o', 'g'),
- 1,
- RTEMS_PRIORITY |
- RTEMS_BINARY_SEMAPHORE |
- RTEMS_INHERIT_PRIORITY |
- RTEMS_NO_PRIORITY_CEILING |
- RTEMS_LOCAL,
- 0,
- &LogSemaphore);
- if (sc != RTEMS_SUCCESSFUL) {
- printf ("Can't create syslog seamphore: %d\n", sc);
- close (LogFd);
- LogFd = -1;
- }
-}
-
-void
-closelog(void)
-{
- if (LogFd >= 0) {
- close (LogFd);
- LogFd = -1;
- rtems_semaphore_delete (LogSemaphore);
- }
-}
-
-int
-setlogmask (int pmask)
-{
- int omask;
-
- omask = LogMask;
- if (pmask != 0)
- LogMask = pmask;
- return (omask);
-}
diff --git a/cpukit/libnetworking/lib/tftpDriver.c b/cpukit/libnetworking/lib/tftpDriver.c
deleted file mode 100644
index cf75623580..0000000000
--- a/cpukit/libnetworking/lib/tftpDriver.c
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
- * Trivial File Transfer Protocol (RFC 1350)
- *
- * Transfer file to/from remote host
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- *
- * $Id$
- */
-
-#include <stdio.h>
-#include <errno.h>
-#include <malloc.h>
-#include <string.h>
-#include <unistd.h>
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/rtems_bsdnet.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Range of UDP ports to try
- */
-#define UDP_PORT_BASE 3180
-
-/*
- * Pathname prefix
- */
-#define TFTP_PATHNAME_PREFIX "/TFTP/"
-
-/*
- * Default limits
- */
-#define PACKET_REPLY_MILLISECONDS 6000
-#define OPEN_RETRY_LIMIT 10
-#define IO_RETRY_LIMIT 10
-
-/*
- * TFTP opcodes
- */
-#define TFTP_OPCODE_RRQ 1
-#define TFTP_OPCODE_WRQ 2
-#define TFTP_OPCODE_DATA 3
-#define TFTP_OPCODE_ACK 4
-#define TFTP_OPCODE_ERROR 5
-
-/*
- * Largest data transfer
- */
-#define TFTP_BUFSIZE 512
-
-/*
- * Packets transferred between machines
- */
-union tftpPacket {
- /*
- * RRQ/WRQ packet
- */
- struct tftpRWRQ {
- rtems_unsigned16 opcode;
- char filename_mode[TFTP_BUFSIZE];
- } tftpRWRQ;
-
- /*
- * DATA packet
- */
- struct tftpDATA {
- rtems_unsigned16 opcode;
- rtems_unsigned16 blocknum;
- rtems_unsigned8 data[TFTP_BUFSIZE];
- } tftpDATA;
-
- /*
- * ACK packet
- */
- struct tftpACK {
- rtems_unsigned16 opcode;
- rtems_unsigned16 blocknum;
- } tftpACK;
-
- /*
- * ERROR packet
- */
- struct tftpERROR {
- rtems_unsigned16 opcode;
- rtems_unsigned16 errorCode;
- char errorMessage[TFTP_BUFSIZE];
- } tftpERROR;
-};
-
-/*
- * State of each TFTP stream
- */
-struct tftpStream {
- /*
- * Buffer for storing most recently-received packet
- */
- union tftpPacket pkbuf;
-
- /*
- * Last block number received
- */
- rtems_unsigned16 blocknum;
-
- /*
- * Data transfer socket
- */
- int socket;
- struct sockaddr_in myAddress;
- struct sockaddr_in farAddress;
-
- /*
- * Indices into buffer
- */
- int nleft;
- int nused;
-
- /*
- * Flags
- */
- int firstReply;
- int eof;
-};
-
-/*
- * Number of streams open at the same time
- */
-static rtems_id tftp_mutex;
-static int nStreams;
-static struct tftpStream ** volatile tftpStreams;
-
-/*
- * Initialize the TFTP driver
- */
-rtems_device_driver rtems_tftp_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_status_code sc;
-
- sc = rtems_semaphore_create (rtems_build_name('T', 'F', 'T', 'P'),
- 1,
- RTEMS_FIFO |
- RTEMS_BINARY_SEMAPHORE |
- RTEMS_NO_INHERIT_PRIORITY |
- RTEMS_NO_PRIORITY_CEILING |
- RTEMS_LOCAL,
- 0,
- &tftp_mutex);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- rtems_io_register_name (TFTP_PATHNAME_PREFIX, major, minor);
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Set error message
- * This RTEMS/UNIX error mapping needs to be fixed!
- */
-static void
-tftpSetErrno (struct tftpStream *tp)
-{
- unsigned int tftpError;
- static const int errorMap[] = {
- 0,
- ENOENT,
- EPERM,
- ENOSPC,
- EINVAL,
- ENXIO,
- EEXIST,
- ESRCH,
- 0,
- };
-
- tftpError = ntohs (tp->pkbuf.tftpERROR.errorCode);
- if (tftpError < (sizeof errorMap / sizeof errorMap[0]))
- errno = errorMap[tftpError];
- else
- errno = 1000 + tftpError;
-}
-
-/*
- * Send a message to make the other end shut up
- */
-static void
-sendStifle (struct tftpStream *tp, struct sockaddr_in *to)
-{
- int len;
-
- /*
- * Create the error packet (Unknown transfer ID).
- */
- tp->pkbuf.tftpERROR.opcode = htons (TFTP_OPCODE_ERROR);
- tp->pkbuf.tftpERROR.errorCode = htons (5);
- len = sizeof tp->pkbuf.tftpERROR.opcode +
- sizeof tp->pkbuf.tftpERROR.errorCode + 1;
- len += sprintf (tp->pkbuf.tftpERROR.errorMessage, "GO AWAY");
-
- /*
- * Send it
- */
- sendto (tp->socket, (char *)&tp->pkbuf, len, 0,
- (struct sockaddr *)to, sizeof *to);
-}
-
-/*
- * Wait for a data packet
- */
-static int
-getPacket (struct tftpStream *tp)
-{
- int len;
- struct timeval tv;
-
- tv.tv_sec = 6;
- tv.tv_usec = 0;
- setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
- for (;;) {
- union {
- struct sockaddr s;
- struct sockaddr_in i;
- } from;
- int fromlen = sizeof from;
- len = recvfrom (tp->socket, (char *)&tp->pkbuf,
- sizeof tp->pkbuf, 0,
- &from.s, &fromlen);
- if (len < 0)
- break;
- if (from.i.sin_addr.s_addr == tp->farAddress.sin_addr.s_addr) {
- if (tp->firstReply) {
- tp->firstReply = 0;
- tp->farAddress.sin_port = from.i.sin_port;
- }
- if (tp->farAddress.sin_port == from.i.sin_port)
- break;
- }
-
- /*
- * Packet is from someone with whom we are
- * not interested. Tell them to go away.
- */
- sendStifle (tp, &from.i);
- }
- tv.tv_sec = 0;
- setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
- return len;
-}
-
-/*
- * Send an acknowledgement
- */
-static int
-sendAck (struct tftpStream *tp)
-{
- /*
- * Create the acknowledgement
- */
- tp->pkbuf.tftpACK.opcode = htons (TFTP_OPCODE_ACK);
- tp->pkbuf.tftpACK.blocknum = htons (tp->blocknum);
-
- /*
- * Send it
- */
- if (sendto (tp->socket, (char *)&tp->pkbuf, sizeof tp->pkbuf.tftpACK, 0,
- (struct sockaddr *)&tp->farAddress,
- sizeof tp->farAddress) < 0)
- return errno;
- return 0;
-}
-
-/*
- * Release a stream and clear the pointer to it
- */
-static void
-releaseStream (int s)
-{
- rtems_semaphore_obtain (tftp_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- free (tftpStreams[s]);
- tftpStreams[s] = NULL;
- rtems_semaphore_release (tftp_mutex);
-}
-
-/*
- * Open a TFTP stream
- */
-rtems_device_driver rtems_tftp_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_open_close_args_t *ap = pargp;
- struct tftpStream *tp;
- int retryCount;
- rtems_unsigned32 farAddress;
- int s;
- int len;
- char *cp1, *cp2;
- char *remoteFilename;
- rtems_interval now;
- rtems_status_code sc;
-
- /*
- * Read-only for now
- */
- if (ap->flags & LIBIO_FLAGS_WRITE)
- return RTEMS_NOT_IMPLEMENTED;
-
- /*
- * Pick apart the name into a host:pathname pair
- */
- if (strlen (ap->iop->pathname) <= strlen (TFTP_PATHNAME_PREFIX))
- return RTEMS_INVALID_NAME;
- cp2 = ap->iop->pathname + strlen (TFTP_PATHNAME_PREFIX);
- if (*cp2 == '/') {
- farAddress = rtems_bsdnet_bootp_server_address.s_addr;
- }
- else {
- char *hostname;
-
- cp1 = cp2;
- while (*cp2 != '/') {
- if (*cp2 == '\0')
- return RTEMS_INVALID_NAME;
- cp2++;
- }
- len = cp2 - cp1;
- hostname = malloc (len + 1);
- if (hostname == NULL)
- return RTEMS_NO_MEMORY;
- strncpy (hostname, cp1, len);
- hostname[len] = '\0';
- farAddress = inet_addr (hostname);
- free (hostname);
- }
- if ((farAddress == 0) || (farAddress == ~0))
- return RTEMS_INVALID_NAME;
- if (*++cp2 == '\0')
- return RTEMS_INVALID_NAME;
- remoteFilename = cp2;
- if (strlen (remoteFilename) > (TFTP_BUFSIZE - 10))
- return RTEMS_INVALID_NAME;
-
- /*
- * Find a free stream
- */
- sc = rtems_semaphore_obtain (tftp_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
- if (sc != RTEMS_SUCCESSFUL)
- return sc;
- for (s = 0 ; s < nStreams ; s++) {
- if (tftpStreams[s] == NULL)
- break;
- }
- if (s == nStreams) {
- /*
- * Reallocate stream pointers
- * Guard against the case where realloc() returns NULL.
- */
- struct tftpStream **np;
-
- np = realloc (tftpStreams, ++nStreams * sizeof *tftpStreams);
- if (np == NULL) {
- rtems_semaphore_release (tftp_mutex);
- return RTEMS_NO_MEMORY;
- }
- tftpStreams = np;
- }
- tp = tftpStreams[s] = malloc (sizeof (struct tftpStream));
- rtems_semaphore_release (tftp_mutex);
- if (tp == NULL)
- return RTEMS_NO_MEMORY;
- ap->iop->data0 = s;
- ap->iop->data1 = tp;
-
- /*
- * Create the socket
- */
- if ((tp->socket = socket (AF_INET, SOCK_DGRAM, 0)) < 0) {
- releaseStream (s);
- return RTEMS_TOO_MANY;
- }
-
- /*
- * Bind the socket to a local address
- */
- retryCount = 0;
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- for (;;) {
- int try = (now + retryCount) % 10;
-
- tp->myAddress.sin_family = AF_INET;
- tp->myAddress.sin_port = htons (UDP_PORT_BASE + nStreams * try + minor);
- tp->myAddress.sin_addr.s_addr = htonl (INADDR_ANY);
- if (bind (tp->socket, (struct sockaddr *)&tp->myAddress, sizeof tp->myAddress) >= 0)
- break;
- if (++retryCount == 10) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_RESOURCE_IN_USE;
- }
- }
-
- /*
- * Set the UDP destination to the TFTP server
- * port on the remote machine.
- */
- tp->farAddress.sin_family = AF_INET;
- tp->farAddress.sin_addr.s_addr = farAddress;
- tp->farAddress.sin_port = htons (69);
-
- /*
- * Start the transfer
- */
- tp->firstReply = 1;
- for (;;) {
- /*
- * Create the request
- */
- tp->pkbuf.tftpRWRQ.opcode = htons (TFTP_OPCODE_RRQ);
- cp1 = tp->pkbuf.tftpRWRQ.filename_mode;
- cp2 = remoteFilename;
- while ((*cp1++ = *cp2++) != '\0')
- continue;
- cp2 = "octet";
- while ((*cp1++ = *cp2++) != '\0')
- continue;
- len = cp1 - (char *)&tp->pkbuf.tftpRWRQ;
-
- /*
- * Send the request
- */
- if (sendto (tp->socket, (char *)&tp->pkbuf, len, 0,
- (struct sockaddr *)&tp->farAddress,
- sizeof tp->farAddress) < 0) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_UNSATISFIED;
- }
-
- /*
- * Get reply
- */
- len = getPacket (tp);
- if (len >= (int) sizeof tp->pkbuf.tftpACK) {
- int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
- if ((opcode == TFTP_OPCODE_DATA)
- && (ntohs (tp->pkbuf.tftpDATA.blocknum) == 1)) {
- tp->nused = 0;
- tp->blocknum = 1;
- tp->nleft = len - 2 * sizeof (rtems_unsigned16);
- tp->eof = (tp->nleft < TFTP_BUFSIZE);
- if (sendAck (tp) != 0) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_UNSATISFIED;
- }
- break;
- }
- if (opcode == TFTP_OPCODE_ERROR) {
- tftpSetErrno (tp);
- close (tp->socket);
- releaseStream (ap->iop->data0);
- return RTEMS_INTERNAL_ERROR;
- }
- }
-
- /*
- * Keep trying
- */
- if (++retryCount >= OPEN_RETRY_LIMIT) {
- close (tp->socket);
- releaseStream (minor);
- return RTEMS_UNSATISFIED;
- }
- }
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Read from a TFTP stream
- */
-rtems_device_driver rtems_tftp_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_rw_args_t *ap = pargp;
- char *bp;
- struct tftpStream *tp;
- int retryCount;
- int nwant;
-
- tp = ap->iop->data1;
-
- /*
- * Read till user request is satisfied or EOF is reached
- */
- bp = ap->buffer;
- nwant = ap->count;
- while (nwant) {
- if (tp->nleft) {
- int count;
- if (nwant < tp->nleft)
- count = nwant;
- else
- count = tp->nleft;
- memcpy (bp, &tp->pkbuf.tftpDATA.data[tp->nused], count);
- tp->nused += count;
- tp->nleft -= count;
- bp += count;
- nwant -= count;
- if (nwant == 0)
- break;
- }
- if (tp->eof)
- break;
-
- /*
- * Wait for the next packet
- */
- retryCount = 0;
- for (;;) {
- int len = getPacket (tp);
- if (len >= (int)sizeof tp->pkbuf.tftpACK) {
- int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
- rtems_unsigned16 nextBlock = tp->blocknum + 1;
- if ((opcode == TFTP_OPCODE_DATA)
- && (ntohs (tp->pkbuf.tftpDATA.blocknum) == nextBlock)) {
- tp->nused = 0;
- tp->nleft = len - 2 * sizeof (rtems_unsigned16);
- tp->eof = (tp->nleft < TFTP_BUFSIZE);
- tp->blocknum++;
- if (sendAck (tp) != 0)
- return RTEMS_IO_ERROR;
- break;
- }
- if (opcode == TFTP_OPCODE_ERROR) {
- tftpSetErrno (tp);
- return RTEMS_INTERNAL_ERROR;
- }
- }
-
- /*
- * Keep trying?
- */
- if (++retryCount == IO_RETRY_LIMIT)
- return RTEMS_IO_ERROR;
- if (sendAck (tp) != 0)
- return RTEMS_IO_ERROR;
- }
- }
- ap->bytes_moved = ap->count - nwant;
- return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Close a TFTP stream
- */
-rtems_device_driver rtems_tftp_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- rtems_libio_open_close_args_t *ap = pargp;
- struct tftpStream *tp = ap->iop->data1;;
-
- if (!tp->eof && !tp->firstReply) {
- /*
- * Tell the other end to stop
- */
- rtems_interval ticksPerSecond;
- sendStifle (tp, &tp->farAddress);
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond);
- rtems_task_wake_after (1 + ticksPerSecond / 10);
- }
- close (tp->socket);
- releaseStream (ap->iop->data0);
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_device_driver rtems_tftp_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return RTEMS_NOT_CONFIGURED;
-}
-
-rtems_device_driver rtems_tftp_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- return RTEMS_NOT_CONFIGURED;
-}
diff --git a/cpukit/libnetworking/libc/addr2ascii.3 b/cpukit/libnetworking/libc/addr2ascii.3
deleted file mode 100644
index 10c839ea74..0000000000
--- a/cpukit/libnetworking/libc/addr2ascii.3
+++ /dev/null
@@ -1,217 +0,0 @@
-.\"
-.\" Copyright 1996 Massachusetts Institute of Technology
-.\"
-.\" Permission to use, copy, modify, and distribute this software and
-.\" its documentation for any purpose and without fee is hereby
-.\" granted, provided that both the above copyright notice and this
-.\" permission notice appear in all copies, that both the above
-.\" copyright notice and this permission notice appear in all
-.\" supporting documentation, and that the name of M.I.T. not be used
-.\" in advertising or publicity pertaining to distribution of the
-.\" software without specific, written prior permission. M.I.T. makes
-.\" no representations about the suitability of this software for any
-.\" purpose. It is provided "as is" without express or implied
-.\" warranty.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
-.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
-.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
-.\" SHALL M.I.T. 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.
-.\"
-.\" $ANA: addr2ascii.3,v 1.1 1996/06/13 18:41:46 wollman Exp $
-.\" $Id$
-.\"
-.Dd June 13, 1996
-.Dt ADDR2ASCII 3
-.Os
-.Sh NAME
-.Nm addr2ascii ,
-.Nm ascii2addr
-.Nd Generic address formatting routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netinet/in.h>
-.Fd #include <arpa/inet.h>
-.Ft "char *"
-.Fn addr2ascii "int af" "const void *addrp" "int len" "char *buf"
-.Ft int
-.Fn ascii2addr "int af" "const char *ascii" "void *result"
-.Sh DESCRIPTION
-The routines
-.Fn addr2ascii
-and
-.Fn ascii2addr
-are used to convert network addresses between binary form and a
-printable form appropriate to the address family. Both functions take
-an
-.Fa af
-argument, specifying the address family to be used in the conversion
-process.
-(Currently, only the
-.Dv AF_INET
-and
-.Dv AF_LINK
-address families are supported.)
-.Pp
-The
-.Fn addr2ascii
-function
-is used to convert binary, network-format addresses into printable
-form. In addition to
-.Fa af ,
-there are three other arguments. The
-.Fa addrp
-argument is a pointer to the network address to be converted.
-The
-.Fa len
-argument is the length of the address. The
-.Fa buf
-argument is an optional pointer to a caller-allocated buffer to hold
-the result; if a null pointer is passed,
-.Fn addr2ascii
-uses a statically-allocated buffer.
-.Pp
-The
-.Fn ascii2addr
-function performs the inverse operation to
-.Fn addr2ascii .
-In addition to
-.Fa af ,
-it takes two parameters,
-.Fa ascii
-and
-.Fa result .
-The
-.Fa ascii
-parameter is a pointer to the string which is to be converted into
-binary. The
-.Fa result
-parameter is a pointer to an appropriate network address structure for
-the specified family.
-.Pp
-The following gives the appropriate structure to use for binary
-addresses in the specified family:
-.Pp
-.Bl -tag -width AF_INETxxxx -compact
-.It Dv AF_INET
-.Li struct in_addr
-.Pq in Aq Pa netinet/in.h
-.It Dv AF_LINK
-.Li struct sockaddr_dl
-.Pq in Aq Pa net/if_dl.h
-.\" .It Dv AF_INET6
-.\" .Li struct in6_addr
-.\" .Pq in Aq Pa netinet6/in6.h
-.El
-.Sh RETURN VALUES
-The
-.Fn addr2ascii
-function returns the address of the buffer it was passed, or a static
-buffer if the a null pointer was passed; on failure, it returns a null
-pointer.
-The
-.Fn ascii2addr
-function returns the length of the binary address in bytes, or -1 on
-failure.
-.Sh EXAMPLES
-The
-.Xr inet 3
-functions
-.Fn inet_ntoa
-and
-.Fn inet_aton
-could be implemented thusly:
-.Bd -literal -offset indent
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-char *
-inet_ntoa(struct in_addr addr)
-{
- return addr2ascii(AF_INET, &addr, sizeof addr, 0);
-}
-
-int
-inet_aton(const char *ascii, struct in_addr *addr)
-{
- return (ascii2addr(AF_INET, ascii, addr)
- == sizeof(*addr));
-}
-.Ed
-.Pp
-In actuality, this cannot be done because
-.Fn addr2ascii
-and
-.Fn ascii2addr
-are implemented in terms of the
-.Xr inet 3
-functions, rather than the other way around.
-.Sh ERRORS
-When a failure is returned,
-.Li errno
-is set to one of the following values:
-.Bl -tag -width [EPROTONOSUPPORT]
-.It Bq Er ENAMETOOLONG
-The
-.Fn addr2ascii
-routine was passed a
-.Fa len
-parameter which was inappropriate for the address family given by
-.Fa af .
-.It Bq Er EPROTONOSUPPORT
-Either routine was passed an
-.Fa af
-parameter other than
-.Dv AF_INET
-or
-.Dv AF_LINK .
-.It Bq Er EINVAL
-The string passed to
-.Fn ascii2addr
-was improperly formatted for address family
-.Fa af .
-.El
-.Sh SEE ALSO
-.Xr inet 3 ,
-.Xr linkaddr 3 ,
-.Xr inet 4
-.Sh HISTORY
-An interface close to this one was originally suggested by Craig
-Partridge. This particular interface originally appeared in the
-.Tn INRIA
-.Tn IPv6
-implementation.
-.Sh AUTHORS
-Code and documentation by
-.An Garrett A. Wollman ,
-MIT Laboratory for Computer Science.
-.Sh BUGS
-The original implementations supported IPv6. This support should
-eventually be resurrected. The
-.Tn NRL
-implementation also included support for the
-.Dv AF_ISO
-and
-.Dv AF_NS
-address families.
-.Pp
-The genericity of this interface is somewhat questionable. A truly
-generic interface would provide a means for determining the length of
-the buffer to be used so that it could be dynamically allocated, and
-would always require a
-.Dq Li "struct sockaddr"
-to hold the binary address. Unfortunately, this is incompatible with existing
-practice. This limitation means that a routine for printing network
-addresses from arbitrary address families must still have internal
-knowledge of the maximum buffer length needed and the appropriate part
-of the address to use as the binary address.
diff --git a/cpukit/libnetworking/libc/addr2ascii.c b/cpukit/libnetworking/libc/addr2ascii.c
deleted file mode 100644
index dc651743b6..0000000000
--- a/cpukit/libnetworking/libc/addr2ascii.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 1996 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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.
- *
- * $ANA: addr2ascii.c,v 1.1 1996/06/13 18:41:46 wollman Exp $
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <errno.h>
-#include <string.h>
-
-#include <net/if_dl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*-
- * Convert a network address from binary to printable numeric format.
- * This API is copied from INRIA's IPv6 implementation, but it is a
- * bit bogus in two ways:
- *
- * 1) There is no value in passing both an address family and
- * an address length; either one should imply the other,
- * or we should be passing sockaddrs instead.
- * 2) There should by contrast be /added/ a length for the buffer
- * that we pass in, so that programmers are spared the need to
- * manually calculate (read: ``guess'') the maximum length.
- *
- * Flash: the API is also the same in the NRL implementation, and seems to
- * be some sort of standard, so we appear to be stuck with both the bad
- * naming and the poor choice of arguments.
- */
-char *
-addr2ascii(af, addrp, len, buf)
- int af;
- const void *addrp;
- int len; /* should be size_t XXX */
- char *buf; /* XXX should pass length of buffer */
-{
- static char staticbuf[64]; /* 64 for AF_LINK > 16 for AF_INET */
-
- if (!buf)
- buf = staticbuf;
-
- switch(af) {
- case AF_INET:
- if (len != sizeof(struct in_addr)) {
- errno = ENAMETOOLONG;
- return 0;
- }
- strcpy(buf, inet_ntoa(*(const struct in_addr *)addrp));
- break;
-
- case AF_LINK:
- if (len != sizeof(struct sockaddr_dl)) {
- errno = ENAMETOOLONG;
- return 0;
- }
- strcpy(buf, link_ntoa((const struct sockaddr_dl *)addrp));
- break;
-
- default:
- errno = EPROTONOSUPPORT;
- return 0;
- }
- return buf;
-}
diff --git a/cpukit/libnetworking/libc/ascii2addr.c b/cpukit/libnetworking/libc/ascii2addr.c
deleted file mode 100644
index e140244737..0000000000
--- a/cpukit/libnetworking/libc/ascii2addr.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 1996 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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.
- *
- * $ANA: ascii2addr.c,v 1.2 1996/06/13 18:46:02 wollman Exp $
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <errno.h>
-#include <string.h>
-
-#include <net/if_dl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-int
-ascii2addr(af, ascii, result)
- int af;
- const char *ascii;
- void *result;
-{
- struct in_addr *ina;
- char strbuf[4*sizeof("123")]; /* long enough for V4 only */
-
- switch(af) {
- case AF_INET:
- ina = result;
- strbuf[0] = '\0';
- strncat(strbuf, ascii, (sizeof strbuf)-1);
- if (inet_aton(strbuf, ina))
- return sizeof(struct in_addr);
- errno = EINVAL;
- break;
-
- case AF_LINK:
- link_addr(ascii, result);
- /* oops... no way to detect failure */
- return sizeof(struct sockaddr_dl);
-
- default:
- errno = EPROTONOSUPPORT;
- break;
- }
-
- return -1;
-}
diff --git a/cpukit/libnetworking/libc/base64.c b/cpukit/libnetworking/libc/base64.c
deleted file mode 100644
index 3017ccc01c..0000000000
--- a/cpukit/libnetworking/libc/base64.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1995 by International Business Machines, Inc.
- *
- * International Business Machines, Inc. (hereinafter called IBM) grants
- * permission under its copyrights to use, copy, modify, and distribute this
- * Software with or without fee, provided that the above copyright notice and
- * all paragraphs of this notice appear in all copies, and that the name of IBM
- * not be used in connection with the marketing of any product incorporating
- * the Software or modifications thereof, without specific, written prior
- * permission.
- *
- * To the extent it has a right to do so, IBM grants an immunity from suit
- * under its patents, if any, for the use, sale or manufacture of products to
- * the extent that such products are used for performing Domain Name System
- * dynamic updates in TCP/IP networks by means of the Software. No immunity is
- * granted for any product per se or for any other function of any product.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define Assert(Cond) if (!(Cond)) abort()
-
-static const char Base64[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-static const char Pad64 = '=';
-
-/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
- The following encoding technique is taken from RFC 1521 by Borenstein
- and Freed. It is reproduced here in a slightly edited form for
- convenience.
-
- A 65-character subset of US-ASCII is used, enabling 6 bits to be
- represented per printable character. (The extra 65th character, "=",
- is used to signify a special processing function.)
-
- The encoding process represents 24-bit groups of input bits as output
- strings of 4 encoded characters. Proceeding from left to right, a
- 24-bit input group is formed by concatenating 3 8-bit input groups.
- These 24 bits are then treated as 4 concatenated 6-bit groups, each
- of which is translated into a single digit in the base64 alphabet.
-
- Each 6-bit group is used as an index into an array of 64 printable
- characters. The character referenced by the index is placed in the
- output string.
-
- Table 1: The Base64 Alphabet
-
- Value Encoding Value Encoding Value Encoding Value Encoding
- 0 A 17 R 34 i 51 z
- 1 B 18 S 35 j 52 0
- 2 C 19 T 36 k 53 1
- 3 D 20 U 37 l 54 2
- 4 E 21 V 38 m 55 3
- 5 F 22 W 39 n 56 4
- 6 G 23 X 40 o 57 5
- 7 H 24 Y 41 p 58 6
- 8 I 25 Z 42 q 59 7
- 9 J 26 a 43 r 60 8
- 10 K 27 b 44 s 61 9
- 11 L 28 c 45 t 62 +
- 12 M 29 d 46 u 63 /
- 13 N 30 e 47 v
- 14 O 31 f 48 w (pad) =
- 15 P 32 g 49 x
- 16 Q 33 h 50 y
-
- Special processing is performed if fewer than 24 bits are available
- at the end of the data being encoded. A full encoding quantum is
- always completed at the end of a quantity. When fewer than 24 input
- bits are available in an input group, zero bits are added (on the
- right) to form an integral number of 6-bit groups. Padding at the
- end of the data is performed using the '=' character.
-
- Since all base64 input is an integral number of octets, only the
- -------------------------------------------------
- following cases can arise:
-
- (1) the final quantum of encoding input is an integral
- multiple of 24 bits; here, the final unit of encoded
- output will be an integral multiple of 4 characters
- with no "=" padding,
- (2) the final quantum of encoding input is exactly 8 bits;
- here, the final unit of encoded output will be two
- characters followed by two "=" padding characters, or
- (3) the final quantum of encoding input is exactly 16 bits;
- here, the final unit of encoded output will be three
- characters followed by one "=" padding character.
- */
-
-int
-b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) {
- size_t datalength = 0;
- u_char input[3];
- u_char output[4];
- size_t i;
-
- while (2 < srclength) {
- input[0] = *src++;
- input[1] = *src++;
- input[2] = *src++;
- srclength -= 3;
-
- output[0] = input[0] >> 2;
- output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
- output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
- output[3] = input[2] & 0x3f;
- Assert(output[0] < 64);
- Assert(output[1] < 64);
- Assert(output[2] < 64);
- Assert(output[3] < 64);
-
- if (datalength + 4 > targsize)
- return (-1);
- target[datalength++] = Base64[output[0]];
- target[datalength++] = Base64[output[1]];
- target[datalength++] = Base64[output[2]];
- target[datalength++] = Base64[output[3]];
- }
-
- /* Now we worry about padding. */
- if (0 != srclength) {
- /* Get what's left. */
- input[0] = input[1] = input[2] = '\0';
- for (i = 0; i < srclength; i++)
- input[i] = *src++;
-
- output[0] = input[0] >> 2;
- output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
- output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
- Assert(output[0] < 64);
- Assert(output[1] < 64);
- Assert(output[2] < 64);
-
- if (datalength + 4 > targsize)
- return (-1);
- target[datalength++] = Base64[output[0]];
- target[datalength++] = Base64[output[1]];
- if (srclength == 1)
- target[datalength++] = Pad64;
- else
- target[datalength++] = Base64[output[2]];
- target[datalength++] = Pad64;
- }
- if (datalength >= targsize)
- return (-1);
- target[datalength] = '\0'; /* Returned value doesn't count \0. */
- return (datalength);
-}
-
-/* skips all whitespace anywhere.
- converts characters, four at a time, starting at (or after)
- src from base - 64 numbers into three 8 bit bytes in the target area.
- it returns the number of data bytes stored at the target, or -1 on error.
- */
-
-int
-b64_pton(src, target, targsize)
- char const *src;
- u_char *target;
- size_t targsize;
-{
- int tarindex, state, ch;
- char *pos;
-
- state = 0;
- tarindex = 0;
-
- while ((ch = *src++) != '\0') {
- if (isspace(ch)) /* Skip whitespace anywhere. */
- continue;
-
- if (ch == Pad64)
- break;
-
- pos = strchr(Base64, ch);
- if (pos == 0) /* A non-base64 character. */
- return (-1);
-
- switch (state) {
- case 0:
- if (target) {
- if ((size_t)tarindex >= targsize)
- return (-1);
- target[tarindex] = (pos - Base64) << 2;
- }
- state = 1;
- break;
- case 1:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize)
- return (-1);
- target[tarindex] |= (pos - Base64) >> 4;
- target[tarindex+1] = ((pos - Base64) & 0x0f)
- << 4 ;
- }
- tarindex++;
- state = 2;
- break;
- case 2:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize)
- return (-1);
- target[tarindex] |= (pos - Base64) >> 2;
- target[tarindex+1] = ((pos - Base64) & 0x03)
- << 6;
- }
- tarindex++;
- state = 3;
- break;
- case 3:
- if (target) {
- if ((size_t)tarindex >= targsize)
- return (-1);
- target[tarindex] |= (pos - Base64);
- }
- tarindex++;
- state = 0;
- break;
- default:
- abort();
- }
- }
-
- /*
- * We are done decoding Base-64 chars. Let's see if we ended
- * on a byte boundary, and/or with erroneous trailing characters.
- */
-
- if (ch == Pad64) { /* We got a pad char. */
- ch = *src++; /* Skip it, get next. */
- switch (state) {
- case 0: /* Invalid = in first position */
- case 1: /* Invalid = in second position */
- return (-1);
-
- case 2: /* Valid, means one byte of info */
- /* Skip any number of spaces. */
- for ((void)NULL; ch != '\0'; ch = *src++)
- if (!isspace(ch))
- break;
- /* Make sure there is another trailing = sign. */
- if (ch != Pad64)
- return (-1);
- ch = *src++; /* Skip the = */
- /* Fall through to "single trailing =" case. */
- /* FALLTHROUGH */
-
- case 3: /* Valid, means two bytes of info */
- /*
- * We know this char is an =. Is there anything but
- * whitespace after it?
- */
- for ((void)NULL; ch != '\0'; ch = *src++)
- if (!isspace(ch))
- return (-1);
-
- /*
- * Now make sure for cases 2 and 3 that the "extra"
- * bits that slopped past the last full byte were
- * zeros. If we don't check them, they become a
- * subliminal channel.
- */
- if (target && target[tarindex] != 0)
- return (-1);
- }
- } else {
- /*
- * We ended by seeing the end of the string. Make sure we
- * have no partial bytes lying around.
- */
- if (state != 0)
- return (-1);
- }
-
- return (tarindex);
-}
diff --git a/cpukit/libnetworking/libc/byteorder.3 b/cpukit/libnetworking/libc/byteorder.3
deleted file mode 100644
index 81bf604867..0000000000
--- a/cpukit/libnetworking/libc/byteorder.3
+++ /dev/null
@@ -1,77 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" @(#)byteorder.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt BYTEORDER 3
-.Os BSD 4.2
-.Sh NAME
-.Nm htonl ,
-.Nm htons ,
-.Nm ntohl ,
-.Nm ntohs
-.Nd convert values between host and network byte order
-.Sh SYNOPSIS
-.Fd #include <sys/param.h>
-.Ft u_long
-.Fn htonl "u_long hostlong"
-.Ft u_short
-.Fn htons "u_short hostshort"
-.Ft u_long
-.Fn ntohl "u_long netlong"
-.Ft u_short
-.Fn ntohs "u_short netshort"
-.Sh DESCRIPTION
-These routines convert 16 and 32 bit quantities between network
-byte order and host byte order.
-On machines which have a byte order which is the same as the network
-order, routines are defined as null macros.
-.Pp
-These routines are most often used in conjunction with Internet
-addresses and ports as returned by
-.Xr gethostbyname 3
-and
-.Xr getservent 3 .
-.Sh SEE ALSO
-.Xr gethostbyname 3 ,
-.Xr getservent 3
-.Sh HISTORY
-The
-.Nm byteorder
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-On the
-.Tn VAX
-bytes are handled backwards from most everyone else in
-the world. This is not expected to be fixed in the near future.
diff --git a/cpukit/libnetworking/libc/ether_addr.c b/cpukit/libnetworking/libc/ether_addr.c
deleted file mode 100644
index 9b7a9abf44..0000000000
--- a/cpukit/libnetworking/libc/ether_addr.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 1995
- * Bill Paul <wpaul@ctr.columbia.edu>. 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 Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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.
- *
- * ethernet address conversion and lookup routines
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Center for Telecommunications Research
- * Columbia University, New York City
- *
- * $Id$
- */
-
-
-#include <stdio.h>
-#include <paths.h>
-#include <sys/types.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <net/ethernet.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-#ifndef _PATH_ETHERS
-#define _PATH_ETHERS "/etc/ethers"
-#endif
-
-/*
- * Parse a string of text containing an ethernet address and hostname
- * and separate it into its component parts.
- */
-int ether_line(l, e, hostname)
- char *l;
- struct ether_addr *e;
- char *hostname;
-{
- int i, o[6];
-
- i = sscanf(l, "%x:%x:%x:%x:%x:%x %s", &o[0], &o[1], &o[2],
- &o[3], &o[4], &o[5],
- hostname);
- if (i != 7)
- return (i);
-
- for (i=0; i<6; i++)
- e->octet[i] = o[i];
- return (0);
-}
-
-/*
- * Convert an ASCII representation of an ethernet address to
- * binary form.
- */
-struct ether_addr *ether_aton(a)
- char *a;
-{
- int i;
- static struct ether_addr o;
- unsigned int o0, o1, o2, o3, o4, o5;
-
- i = sscanf(a, "%x:%x:%x:%x:%x:%x", &o0, &o1, &o2, &o3, &o4, &o5);
-
- if (i != 6)
- return (NULL);
-
- o.octet[0]=o0;
- o.octet[1]=o1;
- o.octet[2]=o2;
- o.octet[3]=o3;
- o.octet[4]=o4;
- o.octet[5]=o5;
-
- return ((struct ether_addr *)&o);
-}
-
-/*
- * Convert a binary representation of an ethernet address to
- * an ASCII string.
- */
-char *ether_ntoa(n)
- struct ether_addr *n;
-{
- int i;
- static char a[18];
-
- i = sprintf(a,"%x:%x:%x:%x:%x:%x",n->octet[0],n->octet[1],n->octet[2],
- n->octet[3],n->octet[4],n->octet[5]);
- if (i < 11)
- return (NULL);
- return ((char *)&a);
-}
-
-/*
- * Map an ethernet address to a hostname. Use either /etc/ethers or
- * NIS/YP.
- */
-
-int ether_ntohost(hostname, e)
- char *hostname;
- struct ether_addr *e;
-{
- FILE *fp;
- char buf[BUFSIZ + 2];
- struct ether_addr local_ether;
- char local_host[MAXHOSTNAMELEN];
-#ifdef YP
- char *result;
- int resultlen;
- char *ether_a;
- char *yp_domain;
-#endif
- if ((fp = fopen(_PATH_ETHERS, "r")) == NULL)
- return (1);
-
- while (fgets(buf,BUFSIZ,fp)) {
- if (buf[0] == '#')
- continue;
-#ifdef YP
- if (buf[0] == '+') {
- if (yp_get_default_domain(&yp_domain))
- continue;
- ether_a = ether_ntoa(e);
- if (yp_match(yp_domain, "ethers.byaddr", ether_a,
- strlen(ether_a), &result, &resultlen)) {
- continue;
- }
- strncpy(buf, result, resultlen);
- buf[resultlen] = '\0';
- free(result);
- }
-#endif
- if (!ether_line(buf, &local_ether, local_host)) {
- if (!bcmp((char *)&local_ether.octet[0],
- (char *)&e->octet[0], 6)) {
- /* We have a match */
- strcpy(hostname, local_host);
- fclose(fp);
- return(0);
- }
- }
- }
- fclose(fp);
- return (1);
-}
-
-/*
- * Map a hostname to an ethernet address using /etc/ethers or
- * NIS/YP.
- */
-int ether_hostton(hostname, e)
- char *hostname;
- struct ether_addr *e;
-{
- FILE *fp;
- char buf[BUFSIZ + 2];
- struct ether_addr local_ether;
- char local_host[MAXHOSTNAMELEN];
-#ifdef YP
- char *result;
- int resultlen;
- char *yp_domain;
-#endif
- if ((fp = fopen(_PATH_ETHERS, "r")) == NULL)
- return (1);
-
- while (fgets(buf,BUFSIZ,fp)) {
- if (buf[0] == '#')
- continue;
-#ifdef YP
- if (buf[0] == '+') {
- if (yp_get_default_domain(&yp_domain))
- continue;
- if (yp_match(yp_domain, "ethers.byname", hostname,
- strlen(hostname), &result, &resultlen)) {
- continue;
- }
- strncpy(buf, result, resultlen);
- buf[resultlen] = '\0';
- free(result);
- }
-#endif
- if (!ether_line(buf, &local_ether, local_host)) {
- if (!strcmp(hostname, local_host)) {
- /* We have a match */
- bcopy((char *)&local_ether.octet[0],
- (char *)&e->octet[0], 6);
- fclose(fp);
- return(0);
- }
- }
- }
- fclose(fp);
- return (1);
-}
diff --git a/cpukit/libnetworking/libc/ethers.3 b/cpukit/libnetworking/libc/ethers.3
deleted file mode 100644
index afea48320a..0000000000
--- a/cpukit/libnetworking/libc/ethers.3
+++ /dev/null
@@ -1,193 +0,0 @@
-.\" Copyright (c) 1995
-.\" Bill Paul <wpaul@ctr.columbia.edu>. 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 Bill Paul.
-.\" 4. Neither the name of the author nor the names of any co-contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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.
-.\"
-.\" $Id$
-.\"
-.Dd April 12, 1995
-.Dt ETHERS 3
-.Os FreeBSD 2.1
-.Sh NAME
-.Nm ethers ,
-.Nm ether_line ,
-.Nm ether_aton ,
-.Nm ether_ntoa ,
-.Nm ether_ntohost ,
-.Nm ether_hostton
-.Nd Ethernet address conversion and lookup routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/socket.h>
-.Fd #include <net/ethernet.h>
-.Ft int
-.Fn ether_line "char *l" "struct ether_addr *e" "char *hostname"
-.Ft struct ether_addr *
-.Fn ether_aton "char *a"
-.Ft char *
-.Fn ether_ntoa "struct ether_addr *n"
-.Ft int
-.Fn ether_ntohost "char *hostname" "struct ether_addr *e"
-.Ft int
-.Fn ether_hostton "char *hostname" "struct ether_addr *e"
-.Sh DESCRIPTION
-These functions operate on ethernet addresses using an
-.Ar ether_addr
-structure, which is defined in the header file
-.Aq Pa netinet/if_ether.h :
-.Bd -literal -offset indent
-/*
- * The number of bytes in an ethernet (MAC) address.
- */
-#define ETHER_ADDR_LEN 6
-
-/*
- * Structure of a 48-bit Ethernet address.
- */
-struct ether_addr {
- u_char octet[ETHER_ADDR_LEN];
-};
-.Ed
-.Pp
-The function
-.Fn ether_line
-scans
-.Ar l ,
-an
-.Tn ASCII
-string in
-.Xr ethers 5
-format and sets
-.Ar e
-to the ethernet address specified in the string and
-.Ar h
-to the hostname. This function is used to parse lines from
-.Pa /etc/ethers
-into their component parts.
-.Pp
-The
-.Fn ether_aton
-function converts an
-.Tn ASCII
-representation of an ethernet address into an
-.Ar ether_addr
-structure. Likewise,
-.Fn ether_ntoa
-converts an ethernet address specified as an
-.Ar ether_addr
-structure into an
-.Tn ASCII
-string.
-.Pp
-The
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions map ethernet addresses to their corresponding hostnames
-as specified in the
-.Pa /etc/ethers
-database.
-.Fn ether_ntohost
-converts from ethernet address to hostname, and
-.Fn ether_hostton
-converts from hostname to ethernet address.
-.Sh RETURN VALUES
-.Fn ether_line
-returns zero on success and non-zero if it was unable to parse
-any part of the supplied line
-.Ar l .
-It returns the extracted ethernet address in the supplied
-.Ar ether_addr
-structure
-.Ar e
-and the hostname in the supplied string
-.Ar h .
-.Pp
-On success,
-.Fn ether_ntoa
-returns a pointer to a string containing an
-.Tn ASCII
-representation of an ethernet address. If it is unable to convert
-the supplied
-.Ar ether_addr
-structure, it returns a
-.Dv NULL
-pointer. Likewise,
-.Fn ether_aton
-returns a pointer to an
-.Ar ether_addr
-structure on success and a
-.Dv NULL
-pointer on failure.
-.Pp
-The
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions both return zero on success or non-zero if they were
-unable to find a match in the
-.Pa /etc/ethers
-database.
-.Sh NOTES
-The user must insure that the hostname strings passed to the
-the
-.Fn ether_line ,
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions are large enough to contain the returned hostnames.
-.Sh NIS INTERACTION
-If the
-.Pa /etc/ethers
-contains a line with a single + in it, the
-.Fn ether_ntohost
-and
-.Fn ether_hostton
-functions will attempt to consult the NIS
-.Pa ethers.byname
-and
-.Pa ethers.byaddr
-maps in addition to the data in the
-.Pa /etc/ethers
-file.
-.Sh SEE ALSO
-.Xr yp 4 ,
-.Xr ethers 5
-.Sh BUGS
-.Pp
-The
-.Fn ether_aton
-and
-.Fn ether_ntoa
-functions returns values that are stored in static memory areas
-which may be overwritten the next time they are called.
-.Sh HISTORY
-This particular implementation of the
-.Nm ethers
-library functions were written for and first appeared in
-.Fx 2.1 .
diff --git a/cpukit/libnetworking/libc/gethostbydns.c b/cpukit/libnetworking/libc/gethostbydns.c
deleted file mode 100644
index 3d80ffde7a..0000000000
--- a/cpukit/libnetworking/libc/gethostbydns.c
+++ /dev/null
@@ -1,773 +0,0 @@
-/*
- * ++Copyright++ 1985, 1988, 1993
- * -
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char fromrcsid[] = "From: Id: gethnamaddr.c,v 8.23 1998/04/07 04:59:46 vixie Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <ctype.h>
-#include <errno.h>
-#include <syslog.h>
-
-#include "res_config.h"
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-#define MAXALIASES 35
-#define MAXADDRS 35
-
-static const char AskedForGot[] =
- "gethostby*.gethostanswer: asked for \"%s\", got \"%s\"";
-
-static char *h_addr_ptrs[MAXADDRS + 1];
-
-static struct hostent host;
-static char *host_aliases[MAXALIASES];
-static char hostbuf[8*1024];
-static u_char host_addr[16]; /* IPv4 or IPv6 */
-
-#ifdef RESOLVSORT
-static void addrsort __P((char **, int));
-#endif
-
-#if PACKETSZ > 1024
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 1024
-#endif
-
-typedef union {
- HEADER hdr;
- u_char buf[MAXPACKET];
-} querybuf;
-
-typedef union {
- int32_t al;
- char ac;
-} align;
-
-extern int h_errno;
-int _dns_ttl_;
-
-#ifdef DEBUG
-static void
-dprintf(msg, num)
- char *msg;
- int num;
-{
- if (_res.options & RES_DEBUG) {
- int save = errno;
-
- printf(msg, num);
- errno = save;
- }
-}
-#else
-# define dprintf(msg, num) /*nada*/
-#endif
-
-#define BOUNDED_INCR(x) \
- do { \
- cp += x; \
- if (cp > eom) { \
- h_errno = NO_RECOVERY; \
- return (NULL); \
- } \
- } while (0)
-
-#define BOUNDS_CHECK(ptr, count) \
- do { \
- if ((ptr) + (count) > eom) { \
- h_errno = NO_RECOVERY; \
- return (NULL); \
- } \
- } while (0)
-
-static struct hostent *
-gethostanswer(answer, anslen, qname, qtype)
- const querybuf *answer;
- int anslen;
- const char *qname;
- int qtype;
-{
- register const HEADER *hp;
- register const u_char *cp;
- register int n;
- const u_char *eom, *erdata;
- char *bp, **ap, **hap;
- int type, class, buflen, ancount, qdcount;
- int haveanswer, had_error;
- int toobig = 0;
- char tbuf[MAXDNAME];
- const char *tname;
- int (*name_ok) __P((const char *));
-
- tname = qname;
- host.h_name = NULL;
- eom = answer->buf + anslen;
- switch (qtype) {
- case T_A:
- case T_AAAA:
- name_ok = res_hnok;
- break;
- case T_PTR:
- name_ok = res_dnok;
- break;
- default:
- h_errno = NO_RECOVERY;
- return (NULL); /* XXX should be abort(); */
- }
- /*
- * find first satisfactory answer
- */
- hp = &answer->hdr;
- ancount = ntohs(hp->ancount);
- qdcount = ntohs(hp->qdcount);
- bp = hostbuf;
- buflen = sizeof hostbuf;
- cp = answer->buf;
- BOUNDED_INCR(HFIXEDSZ);
- if (qdcount != 1) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !(*name_ok)(bp)) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- BOUNDED_INCR(n + QFIXEDSZ);
- if (qtype == T_A || qtype == T_AAAA) {
- /* res_send() has already verified that the query name is the
- * same as the one we sent; this just gets the expanded name
- * (i.e., with the succeeding search-domain tacked on).
- */
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- host.h_name = bp;
- bp += n;
- buflen -= n;
- /* The qname can be abbreviated, but h_name is now absolute. */
- qname = host.h_name;
- }
- ap = host_aliases;
- *ap = NULL;
- host.h_aliases = host_aliases;
- hap = h_addr_ptrs;
- *hap = NULL;
- host.h_addr_list = h_addr_ptrs;
- haveanswer = 0;
- had_error = 0;
- _dns_ttl_ = -1;
- while (ancount-- > 0 && cp < eom && !had_error) {
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !(*name_ok)(bp)) {
- had_error++;
- continue;
- }
- cp += n; /* name */
- BOUNDS_CHECK(cp, 3 * INT16SZ + INT32SZ);
- type = _getshort(cp);
- cp += INT16SZ; /* type */
- class = _getshort(cp);
- cp += INT16SZ; /* class */
- if (qtype == T_A && type == T_A)
- _dns_ttl_ = _getlong(cp);
- cp += INT32SZ; /* TTL */
- n = _getshort(cp);
- cp += INT16SZ; /* len */
- BOUNDS_CHECK(cp, n);
- erdata = cp + n;
- if (class != C_IN) {
- /* XXX - debug? syslog? */
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- if ((qtype == T_A || qtype == T_AAAA) && type == T_CNAME) {
- if (ap >= &host_aliases[MAXALIASES-1])
- continue;
- n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf);
- if ((n < 0) || !(*name_ok)(tbuf)) {
- had_error++;
- continue;
- }
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- /* Store alias. */
- *ap++ = bp;
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- had_error++;
- continue;
- }
- bp += n;
- buflen -= n;
- /* Get canonical name. */
- n = strlen(tbuf) + 1; /* for the \0 */
- if (n > buflen || n >= MAXHOSTNAMELEN) {
- had_error++;
- continue;
- }
- strcpy(bp, tbuf);
- host.h_name = bp;
- bp += n;
- buflen -= n;
- continue;
- }
- if (qtype == T_PTR && type == T_CNAME) {
- n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf);
- if (n < 0 || !res_dnok(tbuf)) {
- had_error++;
- continue;
- }
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- /* Get canonical name. */
- n = strlen(tbuf) + 1; /* for the \0 */
- if (n > buflen || n >= MAXHOSTNAMELEN) {
- had_error++;
- continue;
- }
- strcpy(bp, tbuf);
- tname = bp;
- bp += n;
- buflen -= n;
- continue;
- }
- if (type != qtype) {
- syslog(LOG_NOTICE|LOG_AUTH,
- "gethostby*.gethostanswer: asked for \"%s %s %s\", got type \"%s\"",
- qname, p_class(C_IN), p_type(qtype),
- p_type(type));
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- switch (type) {
- case T_PTR:
- if (strcasecmp(tname, bp) != 0) {
- syslog(LOG_NOTICE|LOG_AUTH,
- AskedForGot, qname, bp);
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !res_hnok(bp)) {
- had_error++;
- break;
- }
-#if MULTI_PTRS_ARE_ALIASES
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- if (!haveanswer)
- host.h_name = bp;
- else if (ap < &host_aliases[MAXALIASES-1])
- *ap++ = bp;
- else
- n = -1;
- if (n != -1) {
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- had_error++;
- break;
- }
- bp += n;
- buflen -= n;
- }
- break;
-#else
- host.h_name = bp;
- if (_res.options & RES_USE_INET6) {
- n = strlen(bp) + 1; /* for the \0 */
- if (n >= MAXHOSTNAMELEN) {
- had_error++;
- break;
- }
- bp += n;
- buflen -= n;
- _map_v4v6_hostent(&host, &bp, &buflen);
- }
- h_errno = NETDB_SUCCESS;
- return (&host);
-#endif
- case T_A:
- case T_AAAA:
- if (strcasecmp(host.h_name, bp) != 0) {
- syslog(LOG_NOTICE|LOG_AUTH,
- AskedForGot, host.h_name, bp);
- cp += n;
- continue; /* XXX - had_error++ ? */
- }
- if (n != host.h_length) {
- cp += n;
- continue;
- }
- if (!haveanswer) {
- register int nn;
-
- host.h_name = bp;
- nn = strlen(bp) + 1; /* for the \0 */
- bp += nn;
- buflen -= nn;
- }
-
- bp += sizeof(align) - ((u_long)bp % sizeof(align));
-
- if (bp + n >= &hostbuf[sizeof hostbuf]) {
- dprintf("size (%d) too big\n", n);
- had_error++;
- continue;
- }
- if (hap >= &h_addr_ptrs[MAXADDRS-1]) {
- if (!toobig++)
- dprintf("Too many addresses (%d)\n",
- MAXADDRS);
- cp += n;
- continue;
- }
- bcopy(cp, *hap++ = bp, n);
- bp += n;
- buflen -= n;
- cp += n;
- if (cp != erdata) {
- h_errno = NO_RECOVERY;
- return (NULL);
- }
- break;
- default:
- dprintf("Impossible condition (type=%d)\n", type);
- h_errno = NO_RECOVERY;
- return (NULL);
- /* BIND has abort() here, too risky on bad data */
- }
- if (!had_error)
- haveanswer++;
- }
- if (haveanswer) {
- *ap = NULL;
- *hap = NULL;
-# if defined(RESOLVSORT)
- /*
- * Note: we sort even if host can take only one address
- * in its return structures - should give it the "best"
- * address in that case, not some random one
- */
- if (_res.nsort && haveanswer > 1 && qtype == T_A)
- addrsort(h_addr_ptrs, haveanswer);
-# endif /*RESOLVSORT*/
- if (!host.h_name) {
- n = strlen(qname) + 1; /* for the \0 */
- if (n > buflen || n >= MAXHOSTNAMELEN)
- goto no_recovery;
- strcpy(bp, qname);
- host.h_name = bp;
- bp += n;
- buflen -= n;
- }
- if (_res.options & RES_USE_INET6)
- _map_v4v6_hostent(&host, &bp, &buflen);
- h_errno = NETDB_SUCCESS;
- return (&host);
- }
- no_recovery:
- h_errno = NO_RECOVERY;
- return (NULL);
-}
-
-struct hostent *
-__dns_getanswer(answer, anslen, qname, qtype)
- const char *answer;
- int anslen;
- const char *qname;
- int qtype;
-{
- switch(qtype) {
- case T_AAAA:
- host.h_addrtype = AF_INET6;
- host.h_length = IN6ADDRSZ;
- break;
- case T_A:
- default:
- host.h_addrtype = AF_INET;
- host.h_length = INADDRSZ;
- break;
- }
-
- return(gethostanswer((const querybuf *)answer, anslen, qname, qtype));
-}
-
-struct hostent *
-_gethostbydnsname(name, af)
- const char *name;
- int af;
-{
- querybuf buf;
- register const char *cp;
- char *bp;
- int n, size, type, len;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
-
- switch (af) {
- case AF_INET:
- size = INADDRSZ;
- type = T_A;
- break;
- case AF_INET6:
- size = IN6ADDRSZ;
- type = T_AAAA;
- break;
- default:
- h_errno = NETDB_INTERNAL;
- errno = EAFNOSUPPORT;
- return (NULL);
- }
-
- host.h_addrtype = af;
- host.h_length = size;
-
- /*
- * if there aren't any dots, it could be a user-level alias.
- * this is also done in res_query() since we are not the only
- * function that looks up host names.
- */
- if (!strchr(name, '.') && (cp = __hostalias(name)))
- name = cp;
-
- /*
- * disallow names consisting only of digits/dots, unless
- * they end in a dot.
- */
- if (isdigit((int)name[0]))
- for (cp = name;; ++cp) {
- if (!*cp) {
- if (*--cp == '.')
- break;
- /*
- * All-numeric, no dot at the end.
- * Fake up a hostent as if we'd actually
- * done a lookup.
- */
- if (inet_pton(af, name, host_addr) <= 0) {
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- strncpy(hostbuf, name, MAXDNAME);
- hostbuf[MAXDNAME] = '\0';
- bp = hostbuf + MAXDNAME;
- len = sizeof hostbuf - MAXDNAME;
- host.h_name = hostbuf;
- host.h_aliases = host_aliases;
- host_aliases[0] = NULL;
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- host.h_addr_list = h_addr_ptrs;
- if (_res.options & RES_USE_INET6)
- _map_v4v6_hostent(&host, &bp, &len);
- h_errno = NETDB_SUCCESS;
- return (&host);
- }
- if (!isdigit((int)*cp) && *cp != '.')
- break;
- }
- if ((isxdigit((int)name[0]) && strchr(name, ':') != NULL) ||
- name[0] == ':')
- for (cp = name;; ++cp) {
- if (!*cp) {
- if (*--cp == '.')
- break;
- /*
- * All-IPv6-legal, no dot at the end.
- * Fake up a hostent as if we'd actually
- * done a lookup.
- */
- if (inet_pton(af, name, host_addr) <= 0) {
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- strncpy(hostbuf, name, MAXDNAME);
- hostbuf[MAXDNAME] = '\0';
- bp = hostbuf + MAXDNAME;
- len = sizeof hostbuf - MAXDNAME;
- host.h_name = hostbuf;
- host.h_aliases = host_aliases;
- host_aliases[0] = NULL;
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- host.h_addr_list = h_addr_ptrs;
- h_errno = NETDB_SUCCESS;
- return (&host);
- }
- if (!isxdigit((int)*cp) && *cp != ':' && *cp != '.')
- break;
- }
-
- if ((n = res_search(name, C_IN, type, buf.buf, sizeof(buf))) < 0) {
- dprintf("res_search failed (%d)\n", n);
- return (NULL);
- }
- return (gethostanswer(&buf, n, name, type));
-}
-
-struct hostent *
-_gethostbydnsaddr(addr, len, af)
- const char *addr; /* XXX should have been def'd as u_char! */
- int len, af;
-{
- const u_char *uaddr = (const u_char *)addr;
- static const u_char mapped[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0xff,0xff };
- static const u_char tunnelled[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 };
- int n, size;
- querybuf buf;
- register struct hostent *hp;
- char qbuf[MAXDNAME+1], *qp;
-#ifdef SUNSECURITY
- register struct hostent *rhp;
- char **haddr;
- u_long old_options;
- char hname2[MAXDNAME+1];
-#endif /*SUNSECURITY*/
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- if (af == AF_INET6 && len == IN6ADDRSZ &&
- (!bcmp(uaddr, mapped, sizeof mapped) ||
- !bcmp(uaddr, tunnelled, sizeof tunnelled))) {
- /* Unmap. */
- addr += sizeof mapped;
- uaddr += sizeof mapped;
- af = AF_INET;
- len = INADDRSZ;
- }
- switch (af) {
- case AF_INET:
- size = INADDRSZ;
- break;
- case AF_INET6:
- size = IN6ADDRSZ;
- break;
- default:
- errno = EAFNOSUPPORT;
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- if (size != len) {
- errno = EINVAL;
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- switch (af) {
- case AF_INET:
- (void) sprintf(qbuf, "%u.%u.%u.%u.in-addr.arpa",
- (uaddr[3] & 0xff),
- (uaddr[2] & 0xff),
- (uaddr[1] & 0xff),
- (uaddr[0] & 0xff));
- break;
- case AF_INET6:
- qp = qbuf;
- for (n = IN6ADDRSZ - 1; n >= 0; n--) {
- qp += SPRINTF((qp, "%x.%x.",
- uaddr[n] & 0xf,
- (uaddr[n] >> 4) & 0xf));
- }
- strcpy(qp, "ip6.int");
- break;
- default:
- abort();
- }
- n = res_query(qbuf, C_IN, T_PTR, (u_char *)buf.buf, sizeof buf.buf);
- if (n < 0) {
- dprintf("res_query failed (%d)\n", n);
- return (NULL);
- }
- if (!(hp = gethostanswer(&buf, n, qbuf, T_PTR)))
- return (NULL); /* h_errno was set by gethostanswer() */
-#ifdef SUNSECURITY
- if (af == AF_INET) {
- /*
- * turn off search as the name should be absolute,
- * 'localhost' should be matched by defnames
- */
- strncpy(hname2, hp->h_name, MAXDNAME);
- hname2[MAXDNAME] = '\0';
- old_options = _res.options;
- _res.options &= ~RES_DNSRCH;
- _res.options |= RES_DEFNAMES;
- if (!(rhp = gethostbyname(hname2))) {
- syslog(LOG_NOTICE|LOG_AUTH,
- "gethostbyaddr: No A record for %s (verifying [%s])",
- hname2, inet_ntoa(*((struct in_addr *)addr)));
- _res.options = old_options;
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- _res.options = old_options;
- for (haddr = rhp->h_addr_list; *haddr; haddr++)
- if (!memcmp(*haddr, addr, INADDRSZ))
- break;
- if (!*haddr) {
- syslog(LOG_NOTICE|LOG_AUTH,
- "gethostbyaddr: A record of %s != PTR record [%s]",
- hname2, inet_ntoa(*((struct in_addr *)addr)));
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- }
-#endif /*SUNSECURITY*/
- hp->h_addrtype = af;
- hp->h_length = len;
- bcopy(addr, host_addr, len);
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- if (af == AF_INET && (_res.options & RES_USE_INET6)) {
- _map_v4v6_address((char*)host_addr, (char*)host_addr);
- hp->h_addrtype = AF_INET6;
- hp->h_length = IN6ADDRSZ;
- }
- h_errno = NETDB_SUCCESS;
- return (hp);
-}
-
-#ifdef RESOLVSORT
-static void
-addrsort(ap, num)
- char **ap;
- int num;
-{
- int i, j;
- char **p;
- short aval[MAXADDRS];
- int needsort = 0;
-
- p = ap;
- for (i = 0; i < num; i++, p++) {
- for (j = 0 ; (unsigned)j < _res.nsort; j++)
- if (_res.sort_list[j].addr.s_addr ==
- (((struct in_addr *)(*p))->s_addr & _res.sort_list[j].mask))
- break;
- aval[i] = j;
- if (needsort == 0 && i > 0 && j < aval[i-1])
- needsort = i;
- }
- if (!needsort)
- return;
-
- while (needsort < num) {
- for (j = needsort - 1; j >= 0; j--) {
- if (aval[j] > aval[j+1]) {
- char *hp;
-
- i = aval[j];
- aval[j] = aval[j+1];
- aval[j+1] = i;
-
- hp = ap[j];
- ap[j] = ap[j+1];
- ap[j+1] = hp;
-
- } else
- break;
- }
- needsort++;
- }
-}
-#endif
-void
-_sethostdnsent(stayopen)
- int stayopen;
-{
- if ((_res.options & RES_INIT) == 0 && res_init() == -1)
- return;
- if (stayopen)
- _res.options |= RES_STAYOPEN | RES_USEVC;
-}
-
-void
-_endhostdnsent()
-{
- _res.options &= ~(RES_STAYOPEN | RES_USEVC);
- res_close();
-}
diff --git a/cpukit/libnetworking/libc/gethostbyht.c b/cpukit/libnetworking/libc/gethostbyht.c
deleted file mode 100644
index 29f2805367..0000000000
--- a/cpukit/libnetworking/libc/gethostbyht.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*-
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <arpa/nameser.h> /* XXX */
-#include <resolv.h> /* XXX */
-
-#define MAXALIASES 35
-
-static struct hostent host;
-static char *host_aliases[MAXALIASES];
-static char hostbuf[BUFSIZ+1];
-static FILE *hostf = NULL;
-static u_char host_addr[16]; /* IPv4 or IPv6 */
-static char *h_addr_ptrs[2];
-static int stayopen = 0;
-
-void
-_sethosthtent(f)
- int f;
-{
- if (!hostf)
- hostf = fopen(_PATH_HOSTS, "r" );
- else
- rewind(hostf);
- stayopen = f;
-}
-
-void
-_endhosthtent()
-{
- if (hostf && !stayopen) {
- (void) fclose(hostf);
- hostf = NULL;
- }
-}
-
-struct hostent *
-gethostent()
-{
- char *p;
- register char *cp, **q;
- int af, len;
-
- if (!hostf && !(hostf = fopen(_PATH_HOSTS, "r" ))) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- again:
- if (!(p = fgets(hostbuf, sizeof hostbuf, hostf))) {
- h_errno = HOST_NOT_FOUND;
- return (NULL);
- }
- if (*p == '#')
- goto again;
- if (!(cp = strpbrk(p, "#\n")))
- goto again;
- *cp = '\0';
- if (!(cp = strpbrk(p, " \t")))
- goto again;
- *cp++ = '\0';
- if (inet_pton(AF_INET6, p, host_addr) > 0) {
- af = AF_INET6;
- len = IN6ADDRSZ;
- } else if (inet_pton(AF_INET, p, host_addr) > 0) {
- if (_res.options & RES_USE_INET6) {
- _map_v4v6_address((char*)host_addr, (char*)host_addr);
- af = AF_INET6;
- len = IN6ADDRSZ;
- } else {
- af = AF_INET;
- len = INADDRSZ;
- }
- } else {
- goto again;
- }
- h_addr_ptrs[0] = (char *)host_addr;
- h_addr_ptrs[1] = NULL;
- host.h_addr_list = h_addr_ptrs;
- host.h_length = len;
- host.h_addrtype = af;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- host.h_name = cp;
- q = host.h_aliases = host_aliases;
- if ((cp = strpbrk(cp, " \t")) != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &host_aliases[MAXALIASES - 1])
- *q++ = cp;
- if ((cp = strpbrk(cp, " \t")) != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- h_errno = NETDB_SUCCESS;
- return (&host);
-}
-
-struct hostent *
-_gethostbyhtname(name, af)
- const char *name;
- int af;
-{
- register struct hostent *p;
- register char **cp;
-
- sethostent(0);
- while ((p = gethostent()) != NULL) {
- if (p->h_addrtype != af)
- continue;
- if (strcasecmp(p->h_name, name) == 0)
- break;
- for (cp = p->h_aliases; *cp != 0; cp++)
- if (strcasecmp(*cp, name) == 0)
- goto found;
- }
-found:
- endhostent();
- return (p);
-}
-
-struct hostent *
-_gethostbyhtaddr(addr, len, af)
- const char *addr;
- int len, af;
-{
- register struct hostent *p;
-
- sethostent(0);
- while ((p = gethostent()) != NULL)
- if (p->h_addrtype == af && !bcmp(p->h_addr, addr, len))
- break;
- endhostent();
- return (p);
-}
diff --git a/cpukit/libnetworking/libc/gethostbyname.3 b/cpukit/libnetworking/libc/gethostbyname.3
deleted file mode 100644
index e21dc79f1d..0000000000
--- a/cpukit/libnetworking/libc/gethostbyname.3
+++ /dev/null
@@ -1,305 +0,0 @@
-.\" Copyright (c) 1983, 1987, 1991, 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.
-.\"
-.\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95
-.\" $Id$
-.\"
-.Dd May 25, 1995
-.Dt GETHOSTBYNAME 3
-.Os BSD 4.2
-.Sh NAME
-.Nm gethostbyname ,
-.Nm gethostbyname2 ,
-.Nm gethostbyaddr ,
-.Nm gethostent ,
-.Nm sethostent ,
-.Nm endhostent ,
-.Nm herror ,
-.Nm hstrerror
-.Nd get network host entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Vt extern int h_errno;
-.Ft struct hostent *
-.Fn gethostbyname "const char *name"
-.Ft struct hostent *
-.Fn gethostbyname2 "const char *name" "int af"
-.Ft struct hostent *
-.Fn gethostbyaddr "const char *addr" "int len" "int type"
-.Ft struct hostent *
-.Fn gethostent void
-.Ft void
-.Fn sethostent "int stayopen"
-.Ft void
-.Fn endhostent void
-.Ft void
-.Fn herror "const char *string"
-.Ft const char *
-.Fn hstrerror "int err"
-.Sh DESCRIPTION
-The
-.Fn gethostbyname ,
-.Fn gethostbyname2
-and
-.Fn gethostbyaddr
-functions
-each return a pointer to an object with the
-following structure describing an internet host
-referenced by name or by address, respectively.
-This structure contains either the information obtained from the name server,
-.Xr named 8 ,
-or broken-out fields from a line in
-.Pa /etc/hosts .
-If the local name server is not running these routines do a lookup in
-.Pa /etc/hosts .
-.Bd -literal
-struct hostent {
- char *h_name; /* official name of host */
- char **h_aliases; /* alias list */
- int h_addrtype; /* host address type */
- int h_length; /* length of address */
- char **h_addr_list; /* list of addresses from name server */
-};
-#define h_addr h_addr_list[0] /* address, for backward compatibility */
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width h_addr_list
-.It Fa h_name
-Official name of the host.
-.It Fa h_aliases
-A NULL-terminated array of alternate names for the host.
-.It Fa h_addrtype
-The type of address being returned; usually
-.Dv AF_INET .
-.It Fa h_length
-The length, in bytes, of the address.
-.It Fa h_addr_list
-A NULL-terminated array of network addresses for the host.
-Host addresses are returned in network byte order.
-.It Fa h_addr
-The first address in
-.Fa h_addr_list ;
-this is for backward compatibility.
-.El
-.Pp
-When using the nameserver,
-.Fn gethostbyname
-and
-.Fn gethostbyname
-will search for the named host in the current domain and its parents
-unless the name ends in a dot.
-If the name contains no dot, and if the environment variable
-.Dq Ev HOSTALIASES
-contains the name of an alias file, the alias file will first be searched
-for an alias matching the input name.
-See
-.Xr hostname 7
-for the domain search procedure and the alias file format.
-.Pp
-The
-.Fn gethostbyname2
-function is an evolution of
-.Fn gethostbyname
-which is intended to allow lookups in address families other than
-.Dv AF_INET ,
-for example
-.Dv AF_INET6 .
-Currently the
-.Fa af
-argument must be specified as
-.Dv AF_INET
-else the function will return
-.Dv NULL
-after having set
-.Va h_errno
-to
-.Dv NETDB_INTERNAL
-.Pp
-The
-.Fn sethostent
-function
-may be used to request the use of a connected
-.Tn TCP
-socket for queries.
-If the
-.Fa stayopen
-flag is non-zero,
-this sets the option to send all queries to the name server using
-.Tn TCP
-and to retain the connection after each call to
-.Fn gethostbyname ,
-.Fn gethostbyname2
-or
-.Fn gethostbyaddr .
-Otherwise, queries are performed using
-.Tn UDP
-datagrams.
-.Pp
-The
-.Fn endhostent
-function
-closes the
-.Tn TCP
-connection.
-.Pp
-The
-.Fn herror
-function writes a message to the diagnostic output consisting of the
-string parameter
-.Fa s ,
-the constant string ": ", and a message corresponding to the value of
-.Va h_errno .
-.Pp
-The
-.Fn hstrerror
-function returns a string which is the message text corresponding to the
-value of the
-.Fa err
-parameter.
-.Sh FILES
-.Bl -tag -width /etc/resolv.conf -compact
-.It Pa /etc/hosts
-.It Pa /etc/host.conf
-.It Pa /etc/resolv.conf
-.El
-.Sh DIAGNOSTICS
-Error return status from
-.Fn gethostbyname ,
-.Fn gethostbyname2
-and
-.Fn gethostbyaddr
-is indicated by return of a null pointer.
-The external integer
-.Va h_errno
-may then be checked to see whether this is a temporary failure
-or an invalid or unknown host.
-The routine
-.Fn herror
-can be used to print an error message describing the failure.
-If its argument
-.Fa string
-is
-.Pf non Dv -NULL ,
-it is printed, followed by a colon and a space.
-The error message is printed with a trailing newline.
-.Pp
-The variable
-.Va h_errno
-can have the following values:
-.Bl -tag -width HOST_NOT_FOUND
-.It Dv HOST_NOT_FOUND
-No such host is known.
-.It Dv TRY_AGAIN
-This is usually a temporary error
-and means that the local server did not receive
-a response from an authoritative server.
-A retry at some later time may succeed.
-.It Dv NO_RECOVERY
-Some unexpected server failure was encountered.
-This is a non-recoverable error.
-.It Dv NO_DATA
-The requested name is valid but does not have an IP address;
-this is not a temporary error.
-This means that the name is known to the name server but there is no address
-associated with this name.
-Another type of request to the name server using this domain name
-will result in an answer;
-for example, a mail-forwarder may be registered for this domain.
-.El
-.Sh SEE ALSO
-.Xr resolver 3 ,
-.Xr hosts 5 ,
-.Xr hostname 7 ,
-.Xr named 8
-.Sh CAVEAT
-The
-.Fn gethostent
-function
-is defined, and
-.Fn sethostent
-and
-.Fn endhostent
-are redefined,
-when
-.Xr libc 3
-is built to use only the routines to lookup in
-.Pa /etc/hosts
-and not the name server.
-.Pp
-The
-.Fn gethostent
-function
-reads the next line of
-.Pa /etc/hosts ,
-opening the file if necessary.
-.Pp
-The
-.Fn sethostent
-function
-opens and/or rewinds the file
-.Pa /etc/hosts .
-If the
-.Fa stayopen
-argument is non-zero,
-the file will not be closed after each call to
-.Fn gethostbyname ,
-.Fn gethostbyname2
-or
-.Fn gethostbyaddr .
-.Pp
-The
-.Fn endhostent
-function
-closes the file.
-.Sh HISTORY
-The
-.Fn herror
-function appeared in
-.Bx 4.3 .
-The
-.Fn endhostent ,
-.Fn gethostbyaddr ,
-.Fn gethostbyname ,
-.Fn gethostent ,
-and
-.Fn sethostent
-functions appeared in
-.Bx 4.2 .
-The
-.Fn gethostbyname2
-function first appeared in bind-4.9.4.
-.Sh BUGS
-These functions use static data storage;
-if the data is needed for future use, it should be
-copied before any subsequent calls overwrite it.
-Only the Internet
-address format is currently understood.
diff --git a/cpukit/libnetworking/libc/gethostbynis.c b/cpukit/libnetworking/libc/gethostbynis.c
deleted file mode 100644
index 45dbe5a85d..0000000000
--- a/cpukit/libnetworking/libc/gethostbynis.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id$";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-#define MAXALIASES 35
-#define MAXADDRS 35
-
-#ifdef YP
-static char *host_aliases[MAXALIASES];
-static char hostaddr[MAXADDRS];
-static char *host_addrs[2];
-#endif /* YP */
-
-static struct hostent *
-_gethostbynis(name, map, af)
- const char *name;
- char *map;
- int af;
-{
-#ifdef YP
- register char *cp, **q;
- char *result;
- int resultlen;
- static struct hostent h;
- static char *domain = (char *)NULL;
- static char ypbuf[YPMAXRECORD + 2];
-
- switch(af) {
- case AF_INET:
- break;
- default:
- case AF_INET6:
- errno = EAFNOSUPPORT;
- return NULL;
- }
-
- if (domain == (char *)NULL)
- if (yp_get_default_domain (&domain))
- return ((struct hostent *)NULL);
-
- if (yp_match(domain, map, name, strlen(name), &result, &resultlen))
- return ((struct hostent *)NULL);
-
- /* avoid potential memory leak */
- bcopy((char *)result, (char *)&ypbuf, resultlen);
- ypbuf[resultlen] = '\0';
- free(result);
- result = (char *)&ypbuf;
-
- if ((cp = index(result, '\n')))
- *cp = '\0';
-
- cp = strpbrk(result, " \t");
- *cp++ = '\0';
- h.h_addr_list = host_addrs;
- h.h_addr = hostaddr;
- *((u_long *)h.h_addr) = inet_addr(result);
- h.h_length = sizeof(u_long);
- h.h_addrtype = AF_INET;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- h.h_name = cp;
- q = h.h_aliases = host_aliases;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &host_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&h);
-#else
- return (NULL);
-#endif /* YP */
-}
-
-struct hostent *
-_gethostbynisname(name, af)
- const char *name;
- int af;
-{
- return _gethostbynis(name, "hosts.byname", af);
-}
-
-struct hostent *
-_gethostbynisaddr(addr, len, af)
- const char *addr;
- int len;
- int af;
-{
- return _gethostbynis(inet_ntoa(*(struct in_addr *)addr),"hosts.byaddr", af);
-}
diff --git a/cpukit/libnetworking/libc/gethostnamadr.c b/cpukit/libnetworking/libc/gethostnamadr.c
deleted file mode 100644
index 92f7a21014..0000000000
--- a/cpukit/libnetworking/libc/gethostnamadr.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id$";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <arpa/nameser.h> /* XXX hack for _res */
-#include <resolv.h> /* XXX hack for _res */
-
-#define _PATH_HOSTCONF "/etc/host.conf"
-
-enum service_type {
- SERVICE_NONE = 0,
- SERVICE_BIND,
- SERVICE_HOSTS,
- SERVICE_NIS };
-#define SERVICE_MAX SERVICE_NIS
-
-static struct {
- const char *name;
- enum service_type type;
-} service_names[] = {
- { "hosts", SERVICE_HOSTS },
- { "/etc/hosts", SERVICE_HOSTS },
- { "hosttable", SERVICE_HOSTS },
- { "htable", SERVICE_HOSTS },
- { "bind", SERVICE_BIND },
- { "dns", SERVICE_BIND },
- { "domain", SERVICE_BIND },
- { "yp", SERVICE_NIS },
- { "yellowpages", SERVICE_NIS },
- { "nis", SERVICE_NIS },
- { 0, SERVICE_NONE }
-};
-
-static enum service_type service_order[SERVICE_MAX + 1];
-static int service_done = 0;
-
-static enum service_type
-get_service_name(const char *name) {
- int i;
- for(i = 0; service_names[i].type != SERVICE_NONE; i++) {
- if(!strcasecmp(name, service_names[i].name)) {
- return service_names[i].type;
- }
- }
- return SERVICE_NONE;
-}
-
-static void
-init_services()
-{
- char *cp, *p, buf[BUFSIZ];
- register int cc = 0;
- FILE *fd;
-
- if ((fd = (FILE *)fopen(_PATH_HOSTCONF, "r")) == NULL) {
- /* make some assumptions */
- service_order[0] = SERVICE_BIND;
- service_order[1] = SERVICE_HOSTS;
- service_order[2] = SERVICE_NONE;
- } else {
- while (fgets(buf, BUFSIZ, fd) != NULL && cc < SERVICE_MAX) {
- if(buf[0] == '#')
- continue;
-
- p = buf;
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- if (cp == NULL)
- continue;
- do {
- if (isalpha((int)cp[0])) {
- service_order[cc] = get_service_name(cp);
- if(service_order[cc] != SERVICE_NONE)
- cc++;
- }
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- } while(cp != NULL && cc < SERVICE_MAX);
- }
- service_order[cc] = SERVICE_NONE;
- fclose(fd);
- }
- service_done = 1;
-}
-
-struct hostent *
-gethostbyname(const char *name)
-{
- struct hostent *hp;
-
- if (_res.options & RES_USE_INET6) { /* XXX */
- hp = gethostbyname2(name, AF_INET6); /* XXX */
- if (hp) /* XXX */
- return (hp); /* XXX */
- } /* XXX */
- return (gethostbyname2(name, AF_INET));
-}
-
-struct hostent *
-gethostbyname2(const char *name, int type)
-{
- struct hostent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return NULL;
- case SERVICE_HOSTS:
- hp = _gethostbyhtname(name, type);
- break;
- case SERVICE_BIND:
- hp = _gethostbydnsname(name, type);
- break;
- case SERVICE_NIS:
- hp = _gethostbynisname(name, type);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-struct hostent *
-gethostbyaddr(const char *addr, int len, int type)
-{
- struct hostent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return 0;
- case SERVICE_HOSTS:
- hp = _gethostbyhtaddr(addr, len, type);
- break;
- case SERVICE_BIND:
- hp = _gethostbydnsaddr(addr, len, type);
- break;
- case SERVICE_NIS:
- hp = _gethostbynisaddr(addr, len, type);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-#ifdef _THREAD_SAFE
-struct hostent_data;
-
-/*
- * Temporary function (not thread safe)
- */
-int gethostbyaddr_r(const char *addr, int len, int type,
- struct hostent *result, struct hostent_data *buffer)
-{
- struct hostent *hp;
- int ret;
- if ((hp = gethostbyaddr(addr, len, type)) == NULL) {
- ret = -1;
- } else {
- memcpy(result, hp, sizeof(struct hostent));
- ret = 0;
- }
- return(ret);
-}
-#endif
-
-void
-sethostent(stayopen)
- int stayopen;
-{
- _sethosthtent(stayopen);
- _sethostdnsent(stayopen);
-}
-
-void
-endhostent()
-{
- _endhosthtent();
- _endhostdnsent();
-}
diff --git a/cpukit/libnetworking/libc/gethostname.c b/cpukit/libnetworking/libc/gethostname.c
deleted file mode 100644
index 81dc2267c2..0000000000
--- a/cpukit/libnetworking/libc/gethostname.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * $Id$
- */
-
-#include "config.h"
-
-/*
- * Solaris doesn't include the gethostname call by default.
- */
-#include <sys/utsname.h>
-#include <sys/systeminfo.h>
-
-#include <netdb.h>
-
-/*
- * PUBLIC: #ifndef HAVE_GETHOSTNAME
- * PUBLIC: int gethostname __P((char *, int));
- * PUBLIC: #endif
- */
-int
-gethostname(host, len)
- char *host;
- int len;
-{
- return (sysinfo(SI_HOSTNAME, host, len) == -1 ? -1 : 0);
-}
diff --git a/cpukit/libnetworking/libc/getnetbydns.c b/cpukit/libnetworking/libc/getnetbydns.c
deleted file mode 100644
index 8f8c576332..0000000000
--- a/cpukit/libnetworking/libc/getnetbydns.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/*-
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-/* Portions Copyright (c) 1993 Carlos Leandro and Rui Salgueiro
- * Dep. Matematica Universidade de Coimbra, Portugal, Europe
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <stdio.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <syslog.h>
-
-#include "res_config.h"
-
-extern int h_errno;
-
-#define BYADDR 0
-#define BYNAME 1
-#define MAXALIASES 35
-
-#if PACKETSZ > 1024
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 1024
-#endif
-
-typedef union {
- HEADER hdr;
- u_char buf[MAXPACKET];
-} querybuf;
-
-typedef union {
- long al;
- char ac;
-} align;
-
-static struct netent *
-getnetanswer(answer, anslen, net_i)
- querybuf *answer;
- int anslen;
- int net_i;
-{
-
- register HEADER *hp;
- register u_char *cp;
- register int n;
- u_char *eom;
- int type, class, buflen, ancount, qdcount, haveanswer, i, nchar;
- char aux1[MAXHOSTNAMELEN], aux2[MAXHOSTNAMELEN], ans[MAXHOSTNAMELEN];
- char *in, *st, *pauxt, *bp, **ap;
- char *paux1 = &aux1[0], *paux2 = &aux2[0], flag = 0;
-static struct netent net_entry;
-static char *net_aliases[MAXALIASES], netbuf[PACKETSZ];
-
- /*
- * find first satisfactory answer
- *
- * answer --> +------------+ ( MESSAGE )
- * | Header |
- * +------------+
- * | Question | the question for the name server
- * +------------+
- * | Answer | RRs answering the question
- * +------------+
- * | Authority | RRs pointing toward an authority
- * | Additional | RRs holding additional information
- * +------------+
- */
- eom = answer->buf + anslen;
- hp = &answer->hdr;
- ancount = ntohs(hp->ancount); /* #/records in the answer section */
- qdcount = ntohs(hp->qdcount); /* #/entries in the question section */
- bp = netbuf;
- buflen = sizeof(netbuf);
- cp = answer->buf + HFIXEDSZ;
- if (!qdcount) {
- if (hp->aa)
- h_errno = HOST_NOT_FOUND;
- else
- h_errno = TRY_AGAIN;
- return (NULL);
- }
- while (qdcount-- > 0)
- cp += __dn_skipname(cp, eom) + QFIXEDSZ;
- ap = net_aliases;
- *ap = NULL;
- net_entry.n_aliases = net_aliases;
- haveanswer = 0;
- while (--ancount >= 0 && cp < eom) {
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !res_dnok(bp))
- break;
- cp += n;
- ans[0] = '\0';
- (void)strncpy(&ans[0], bp, sizeof(ans) - 1);
- ans[sizeof(ans) - 1] = '\0';
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- cp += INT32SZ; /* TTL */
- GETSHORT(n, cp);
- if (class == C_IN && type == T_PTR) {
- n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !res_hnok(bp)) {
- cp += n;
- return (NULL);
- }
- cp += n;
- *ap++ = bp;
- bp += strlen(bp) + 1;
- net_entry.n_addrtype =
- (class == C_IN) ? AF_INET : AF_UNSPEC;
- haveanswer++;
- }
- }
- if (haveanswer) {
- *ap = NULL;
- switch (net_i) {
- case BYADDR:
- net_entry.n_name = *net_entry.n_aliases;
- net_entry.n_net = 0L;
- break;
- case BYNAME:
- in = *net_entry.n_aliases;
- net_entry.n_name = &ans[0];
- aux2[0] = '\0';
- for (i = 0; i < 4; i++) {
- for (st = in, nchar = 0;
- *st != '.';
- st++, nchar++)
- ;
- if (nchar != 1 || *in != '0' || flag) {
- flag = 1;
- (void)strncpy(paux1,
- (i==0) ? in : in-1,
- (i==0) ?nchar : nchar+1);
- paux1[(i==0) ? nchar : nchar+1] = '\0';
- pauxt = paux2;
- paux2 = strcat(paux1, paux2);
- paux1 = pauxt;
- }
- in = ++st;
- }
- net_entry.n_net = inet_network(paux2);
- break;
- }
- net_entry.n_aliases++;
- return (&net_entry);
- }
- h_errno = TRY_AGAIN;
- return (NULL);
-}
-
-struct netent *
-_getnetbydnsaddr(net, net_type)
- register unsigned long net;
- register int net_type;
-{
- unsigned int netbr[4];
- int nn, anslen;
- querybuf buf;
- char qbuf[MAXDNAME];
- unsigned long net2;
- struct netent *net_entry;
-
- if (net_type != AF_INET)
- return (NULL);
-
- for (nn = 4, net2 = net; net2; net2 >>= 8)
- netbr[--nn] = net2 & 0xff;
- switch (nn) {
- case 3: /* Class A */
- sprintf(qbuf, "0.0.0.%u.in-addr.arpa", netbr[3]);
- break;
- case 2: /* Class B */
- sprintf(qbuf, "0.0.%u.%u.in-addr.arpa", netbr[3], netbr[2]);
- break;
- case 1: /* Class C */
- sprintf(qbuf, "0.%u.%u.%u.in-addr.arpa", netbr[3], netbr[2],
- netbr[1]);
- break;
- case 0: /* Class D - E */
- sprintf(qbuf, "%u.%u.%u.%u.in-addr.arpa", netbr[3], netbr[2],
- netbr[1], netbr[0]);
- break;
- }
- anslen = res_query(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof(buf));
- if (anslen < 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf("res_query failed\n");
-#endif
- return (NULL);
- }
- net_entry = getnetanswer(&buf, anslen, BYADDR);
- if (net_entry) {
- unsigned u_net = net; /* maybe net should be unsigned ? */
-
- /* Strip trailing zeros */
- while ((u_net & 0xff) == 0 && u_net != 0)
- u_net >>= 8;
- net_entry->n_net = u_net;
- return (net_entry);
- }
- return (NULL);
-}
-
-struct netent *
-_getnetbydnsname(net)
- register const char *net;
-{
- int anslen;
- querybuf buf;
- char qbuf[MAXDNAME];
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (NULL);
- }
- strncpy(qbuf, net, sizeof(qbuf) - 1);
- qbuf[sizeof(qbuf) - 1] = '\0';
- anslen = res_search(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof(buf));
- if (anslen < 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf("res_query failed\n");
-#endif
- return (NULL);
- }
- return getnetanswer(&buf, anslen, BYNAME);
-}
-
-void
-_setnetdnsent(stayopen)
- int stayopen;
-{
- if (stayopen)
- _res.options |= RES_STAYOPEN | RES_USEVC;
-}
-
-void
-_endnetdnsent()
-{
- _res.options &= ~(RES_STAYOPEN | RES_USEVC);
- res_close();
-}
diff --git a/cpukit/libnetworking/libc/getnetbyht.c b/cpukit/libnetworking/libc/getnetbyht.c
deleted file mode 100644
index f7b7b1091d..0000000000
--- a/cpukit/libnetworking/libc/getnetbyht.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- */
-
-/* Portions Copyright (c) 1993 Carlos Leandro and Rui Salgueiro
- * Dep. Matematica Universidade de Coimbra, Portugal, Europe
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * from getnetent.c 1.1 (Coimbra) 93/06/02
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getnetent.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: getnetent.c,v 8.4 1997/06/01 20:34:37 vixie Exp";
-static chat rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <string.h>
-
-#define MAXALIASES 35
-
-static FILE *netf;
-static char line[BUFSIZ+1];
-static struct netent net;
-static char *net_aliases[MAXALIASES];
-static int _net_stayopen;
-
-void
-_setnethtent(f)
- int f;
-{
-
- if (netf == NULL)
- netf = fopen(_PATH_NETWORKS, "r" );
- else
- rewind(netf);
- _net_stayopen |= f;
-}
-
-void
-_endnethtent()
-{
-
- if (netf) {
- fclose(netf);
- netf = NULL;
- }
- _net_stayopen = 0;
-}
-
-struct netent *
-getnetent()
-{
- char *p;
- register char *cp, **q;
-
- if (netf == NULL && (netf = fopen(_PATH_NETWORKS, "r" )) == NULL)
- return (NULL);
-again:
- p = fgets(line, sizeof line, netf);
- if (p == NULL)
- return (NULL);
- if (*p == '#')
- goto again;
- cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
- net.n_name = p;
- cp = strpbrk(p, " \t");
- if (cp == NULL)
- goto again;
- *cp++ = '\0';
- while (*cp == ' ' || *cp == '\t')
- cp++;
- p = strpbrk(cp, " \t");
- if (p != NULL)
- *p++ = '\0';
- net.n_net = inet_network(cp);
- net.n_addrtype = AF_INET;
- q = net.n_aliases = net_aliases;
- if (p != NULL)
- cp = p;
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &net_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&net);
-}
-
-struct netent *
-_getnetbyhtname(name)
- register const char *name;
-{
- register struct netent *p;
- register char **cp;
-
- setnetent(_net_stayopen);
- while ( (p = getnetent()) ) {
- if (strcasecmp(p->n_name, name) == 0)
- break;
- for (cp = p->n_aliases; *cp != 0; cp++)
- if (strcasecmp(*cp, name) == 0)
- goto found;
- }
-found:
- if (!_net_stayopen)
- endnetent();
- return (p);
-}
-
-struct netent *
-_getnetbyhtaddr(net, type)
- register unsigned long net;
- register int type;
-{
- register struct netent *p;
-
- setnetent(_net_stayopen);
- while ( (p = getnetent()) )
- if (p->n_addrtype == type && p->n_net == net)
- break;
- if (!_net_stayopen)
- endnetent();
- return (p);
-}
diff --git a/cpukit/libnetworking/libc/getnetbynis.c b/cpukit/libnetworking/libc/getnetbynis.c
deleted file mode 100644
index 0549016ba2..0000000000
--- a/cpukit/libnetworking/libc/getnetbynis.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id$";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <arpa/nameser.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-#define MAXALIASES 35
-#define MAXADDRS 35
-
-#ifdef YP
-static char *host_aliases[MAXALIASES];
-#endif /* YP */
-
-static struct netent *
-_getnetbynis(name, map, af)
- const char *name;
- char *map;
- int af;
-{
-#ifdef YP
- register char *cp, **q;
- static char *result;
- int resultlen;
- static struct netent h;
- static char *domain = (char *)NULL;
- static char ypbuf[YPMAXRECORD + 2];
-
- switch(af) {
- case AF_INET:
- break;
- default:
- case AF_INET6:
- errno = EAFNOSUPPORT;
- return NULL;
- }
-
- if (domain == (char *)NULL)
- if (yp_get_default_domain (&domain))
- return (NULL);
-
- if (yp_match(domain, map, name, strlen(name), &result, &resultlen))
- return (NULL);
-
- bcopy((char *)result, (char *)&ypbuf, resultlen);
- ypbuf[resultlen] = '\0';
- free(result);
- result = (char *)&ypbuf;
-
- if ((cp = index(result, '\n')))
- *cp = '\0';
-
- cp = strpbrk(result, " \t");
- *cp++ = '\0';
- h.n_name = result;
-
- while (*cp == ' ' || *cp == '\t')
- cp++;
-
- h.n_net = inet_network(cp);
- h.n_addrtype = AF_INET;
-
- q = h.n_aliases = host_aliases;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &host_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&h);
-#else
- return (NULL);
-#endif
-}
-
-struct netent *
-_getnetbynisname(name)
- const char *name;
-{
- return _getnetbynis(name, "networks.byname", AF_INET);
-}
-
-struct netent *
-_getnetbynisaddr(addr, af)
- unsigned long addr;
- int af;
-{
- char *str, *cp;
- unsigned long net2;
- int nn;
- unsigned int netbr[4];
- char buf[MAXDNAME];
-
- if (af != AF_INET) {
- errno = EAFNOSUPPORT;
- return (NULL);
- }
-
- for (nn = 4, net2 = addr; net2; net2 >>= 8) {
- netbr[--nn] = net2 & 0xff;
- }
-
- switch (nn) {
- case 3: /* Class A */
- sprintf(buf, "%u", netbr[3]);
- break;
- case 2: /* Class B */
- sprintf(buf, "%u.%u", netbr[2], netbr[3]);
- break;
- case 1: /* Class C */
- sprintf(buf, "%u.%u.%u", netbr[1], netbr[2], netbr[3]);
- break;
- case 0: /* Class D - E */
- sprintf(buf, "%u.%u.%u.%u", netbr[0], netbr[1],
- netbr[2], netbr[3]);
- break;
- }
-
- str = (char *)&buf;
- cp = str + (strlen(str) - 2);
-
- while(!strcmp(cp, ".0")) {
- *cp = '\0';
- cp = str + (strlen(str) - 2);
- }
-
- return _getnetbynis(str, "networks.byaddr", af);
-}
diff --git a/cpukit/libnetworking/libc/getnetent.3 b/cpukit/libnetworking/libc/getnetent.3
deleted file mode 100644
index aec93b5876..0000000000
--- a/cpukit/libnetworking/libc/getnetent.3
+++ /dev/null
@@ -1,159 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" @(#)getnetent.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt GETNETENT 3
-.Os BSD 4.2
-.Sh NAME
-.Nm getnetent ,
-.Nm getnetbyaddr ,
-.Nm getnetbyname ,
-.Nm setnetent ,
-.Nm endnetent
-.Nd get network entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Ft struct netent *
-.Fn getnetent void
-.Ft struct netent *
-.Fn getnetbyname "const char *name"
-.Ft struct netent *
-.Fn getnetbyaddr "unsigned long net" "int type"
-.Ft void
-.Fn setnetent "int stayopen"
-.Ft void
-.Fn endnetent void
-.Sh DESCRIPTION
-The
-.Fn getnetent ,
-.Fn getnetbyname ,
-and
-.Fn getnetbyaddr
-functions
-each return a pointer to an object with the
-following structure
-containing the broken-out
-fields of a line in the network data base,
-.Pa /etc/networks .
-.Bd -literal -offset indent
-struct netent {
- char *n_name; /* official name of net */
- char **n_aliases; /* alias list */
- int n_addrtype; /* net number type */
- unsigned long n_net; /* net number */
-};
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width n_addrtype
-.It Fa n_name
-The official name of the network.
-.It Fa n_aliases
-A zero terminated list of alternate names for the network.
-.It Fa n_addrtype
-The type of the network number returned; currently only AF_INET.
-.It Fa n_net
-The network number. Network numbers are returned in machine byte
-order.
-.El
-.Pp
-The
-.Fn getnetent
-function
-reads the next line of the file, opening the file if necessary.
-.Pp
-The
-.Fn setnetent
-function
-opens and rewinds the file. If the
-.Fa stayopen
-flag is non-zero,
-the net data base will not be closed after each call to
-.Fn getnetbyname
-or
-.Fn getnetbyaddr .
-.Pp
-The
-.Fn endnetent
-function
-closes the file.
-.Pp
-The
-.Fn getnetbyname
-function
-and
-.Fn getnetbyaddr
-sequentially search from the beginning
-of the file until a matching
-net name or
-net address and type is found,
-or until
-.Dv EOF
-is encountered. The
-.Fa type
-must be
-.Dv AF_INET .
-Network numbers are supplied in host order.
-.Sh FILES
-.Bl -tag -width /etc/networks -compact
-.It Pa /etc/networks
-.El
-.Sh DIAGNOSTICS
-Null pointer
-(0) returned on
-.Dv EOF
-or error.
-.Sh SEE ALSO
-.Xr networks 5
-.Pp
-.%T RFC 1101
-.Sh HISTORY
-The
-.Fn getnetent ,
-.Fn getnetbyaddr ,
-.Fn getnetbyname ,
-.Fn setnetent ,
-and
-.Fn endnetent
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-The data space used by
-these functions is static; if future use requires the data, it should be
-copied before any subsequent calls to these functions overwrite it.
-Only Internet network
-numbers are currently understood.
-Expecting network numbers to fit
-in no more than 32 bits is probably
-naive.
diff --git a/cpukit/libnetworking/libc/getnetnamadr.c b/cpukit/libnetworking/libc/getnetnamadr.c
deleted file mode 100644
index 4d6597f98c..0000000000
--- a/cpukit/libnetworking/libc/getnetnamadr.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*-
- * Copyright (c) 1994, Garrett Wollman
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-
-#ifndef _PATH_NETCONF
-#define _PATH_NETCONF "/etc/host.conf"
-#endif
-
-enum service_type {
- SERVICE_NONE = 0,
- SERVICE_BIND,
- SERVICE_TABLE,
- SERVICE_NIS };
-#define SERVICE_MAX SERVICE_NIS
-
-static struct {
- const char *name;
- enum service_type type;
-} service_names[] = {
- { "hosts", SERVICE_TABLE },
- { "/etc/hosts", SERVICE_TABLE },
- { "hosttable", SERVICE_TABLE },
- { "htable", SERVICE_TABLE },
- { "bind", SERVICE_BIND },
- { "dns", SERVICE_BIND },
- { "domain", SERVICE_BIND },
- { "yp", SERVICE_NIS },
- { "yellowpages", SERVICE_NIS },
- { "nis", SERVICE_NIS },
- { 0, SERVICE_NONE }
-};
-
-static enum service_type service_order[SERVICE_MAX + 1];
-static int service_done = 0;
-
-static enum service_type
-get_service_name(const char *name) {
- int i;
- for(i = 0; service_names[i].type != SERVICE_NONE; i++) {
- if(!strcasecmp(name, service_names[i].name)) {
- return service_names[i].type;
- }
- }
- return SERVICE_NONE;
-}
-
-static void
-init_services()
-{
- char *cp, *p, buf[BUFSIZ];
- register int cc = 0;
- FILE *fd;
-
- if ((fd = (FILE *)fopen(_PATH_NETCONF, "r")) == NULL) {
- /* make some assumptions */
- service_order[0] = SERVICE_TABLE;
- service_order[1] = SERVICE_NONE;
- } else {
- while (fgets(buf, BUFSIZ, fd) != NULL && cc < SERVICE_MAX) {
- if(buf[0] == '#')
- continue;
-
- p = buf;
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- if (cp == NULL)
- continue;
- do {
- if (isalpha(cp[0])) {
- service_order[cc] = get_service_name(cp);
- if(service_order[cc] != SERVICE_NONE)
- cc++;
- }
- while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
- ;
- } while(cp != NULL && cc < SERVICE_MAX);
- }
- service_order[cc] = SERVICE_NONE;
- fclose(fd);
- }
- service_done = 1;
-}
-
-struct netent *
-getnetbyname(const char *name)
-{
- struct netent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return NULL;
- case SERVICE_TABLE:
- hp = _getnetbyhtname(name);
- break;
- case SERVICE_BIND:
- hp = _getnetbydnsname(name);
- break;
- case SERVICE_NIS:
- hp = _getnetbynisname(name);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-struct netent *
-getnetbyaddr(addr, af)
- u_long addr;
- int af;
-{
- struct netent *hp = 0;
- int nserv = 0;
-
- if (!service_done)
- init_services();
-
- while (!hp) {
- switch (service_order[nserv]) {
- case SERVICE_NONE:
- return 0;
- case SERVICE_TABLE:
- hp = _getnetbyhtaddr(addr, af);
- break;
- case SERVICE_BIND:
- hp = _getnetbydnsaddr(addr, af);
- break;
- case SERVICE_NIS:
- hp = _getnetbynisaddr(addr, af);
- break;
- }
- nserv++;
- }
- return hp;
-}
-
-void
-setnetent(stayopen)
- int stayopen;
-{
- _setnethtent(stayopen);
- _setnetdnsent(stayopen);
-}
-
-void
-endnetent()
-{
- _endnethtent();
- _endnetdnsent();
-}
diff --git a/cpukit/libnetworking/libc/getproto.c b/cpukit/libnetworking/libc/getproto.c
deleted file mode 100644
index c2a653f4b4..0000000000
--- a/cpukit/libnetworking/libc/getproto.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getproto.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-
-extern int _proto_stayopen;
-
-struct protoent *
-getprotobynumber(proto)
- register int proto;
-{
- register struct protoent *p;
-
- setprotoent(_proto_stayopen);
- while ( (p = getprotoent()) )
- if (p->p_proto == proto)
- break;
- if (!_proto_stayopen)
- endprotoent();
- return (p);
-}
diff --git a/cpukit/libnetworking/libc/getprotoent.3 b/cpukit/libnetworking/libc/getprotoent.3
deleted file mode 100644
index 784461d7e3..0000000000
--- a/cpukit/libnetworking/libc/getprotoent.3
+++ /dev/null
@@ -1,147 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" @(#)getprotoent.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt GETPROTOENT 3
-.Os BSD 4.2
-.Sh NAME
-.Nm getprotoent ,
-.Nm getprotobynumber ,
-.Nm getprotobyname ,
-.Nm setprotoent ,
-.Nm endprotoent
-.Nd get protocol entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Ft struct protoent *
-.Fn getprotoent void
-.Ft struct protoent *
-.Fn getprotobyname "const char *name"
-.Ft struct protoent *
-.Fn getprotobynumber "int proto"
-.Ft void
-.Fn setprotoent "int stayopen"
-.Ft void
-.Fn endprotoent void
-.Sh DESCRIPTION
-The
-.Fn getprotoent ,
-.Fn getprotobyname ,
-and
-.Fn getprotobynumber
-functions
-each return a pointer to an object with the
-following structure
-containing the broken-out
-fields of a line in the network protocol data base,
-.Pa /etc/protocols .
-.Bd -literal -offset indent
-.Pp
-struct protoent {
- char *p_name; /* official name of protocol */
- char **p_aliases; /* alias list */
- int p_proto; /* protocol number */
-};
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width p_aliases
-.It Fa p_name
-The official name of the protocol.
-.It Fa p_aliases
-A zero terminated list of alternate names for the protocol.
-.It Fa p_proto
-The protocol number.
-.El
-.Pp
-The
-.Fn getprotoent
-function
-reads the next line of the file, opening the file if necessary.
-.Pp
-The
-.Fn setprotoent
-function
-opens and rewinds the file. If the
-.Fa stayopen
-flag is non-zero,
-the net data base will not be closed after each call to
-.Fn getprotobyname
-or
-.Fn getprotobynumber .
-.Pp
-The
-.Fn endprotoent
-function
-closes the file.
-.Pp
-The
-.Fn getprotobyname
-function
-and
-.Fn getprotobynumber
-sequentially search from the beginning
-of the file until a matching
-protocol name or
-protocol number is found,
-or until
-.Dv EOF
-is encountered.
-.Sh RETURN VALUES
-Null pointer
-(0) returned on
-.Dv EOF
-or error.
-.Sh FILES
-.Bl -tag -width /etc/protocols -compact
-.It Pa /etc/protocols
-.El
-.Sh SEE ALSO
-.Xr protocols 5
-.Sh HISTORY
-The
-.Fn getprotoent ,
-.Fn getprotobynumber ,
-.Fn getprotobyname ,
-.Fn setprotoent ,
-and
-.Fn endprotoent
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-These functions use a static data space;
-if the data is needed for future use, it should be
-copied before any subsequent calls overwrite it.
-Only the Internet
-protocols are currently understood.
diff --git a/cpukit/libnetworking/libc/getprotoent.c b/cpukit/libnetworking/libc/getprotoent.c
deleted file mode 100644
index 0b9cefec68..0000000000
--- a/cpukit/libnetworking/libc/getprotoent.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getprotoent.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define MAXALIASES 35
-
-static FILE *protof = NULL;
-static char line[BUFSIZ+1];
-static struct protoent proto;
-static char *proto_aliases[MAXALIASES];
-int _proto_stayopen;
-
-void
-setprotoent(f)
- int f;
-{
- if (protof == NULL)
- protof = fopen(_PATH_PROTOCOLS, "r" );
- else
- rewind(protof);
- _proto_stayopen |= f;
-}
-
-void
-endprotoent()
-{
- if (protof) {
- fclose(protof);
- protof = NULL;
- }
- _proto_stayopen = 0;
-}
-
-struct protoent *
-getprotoent()
-{
- char *p;
- register char *cp, **q;
-
- if (protof == NULL && (protof = fopen(_PATH_PROTOCOLS, "r" )) == NULL)
- return (NULL);
-again:
- if ((p = fgets(line, BUFSIZ, protof)) == NULL)
- return (NULL);
- if (*p == '#')
- goto again;
- cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
- proto.p_name = p;
- cp = strpbrk(p, " \t");
- if (cp == NULL)
- goto again;
- *cp++ = '\0';
- while (*cp == ' ' || *cp == '\t')
- cp++;
- p = strpbrk(cp, " \t");
- if (p != NULL)
- *p++ = '\0';
- proto.p_proto = atoi(cp);
- q = proto.p_aliases = proto_aliases;
- if (p != NULL) {
- cp = p;
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &proto_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- }
- *q = NULL;
- return (&proto);
-}
diff --git a/cpukit/libnetworking/libc/getprotoname.c b/cpukit/libnetworking/libc/getprotoname.c
deleted file mode 100644
index 46880eb005..0000000000
--- a/cpukit/libnetworking/libc/getprotoname.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getprotoname.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-#include <string.h>
-
-extern int _proto_stayopen;
-
-struct protoent *
-getprotobyname(name)
- register const char *name;
-{
- register struct protoent *p;
- register char **cp;
-
- setprotoent(_proto_stayopen);
- while ( (p = getprotoent()) ) {
- if (strcmp(p->p_name, name) == 0)
- break;
- for (cp = p->p_aliases; *cp != 0; cp++)
- if (strcmp(*cp, name) == 0)
- goto found;
- }
-found:
- if (!_proto_stayopen)
- endprotoent();
- return (p);
-}
diff --git a/cpukit/libnetworking/libc/getservbyname.c b/cpukit/libnetworking/libc/getservbyname.c
deleted file mode 100644
index 19936907d3..0000000000
--- a/cpukit/libnetworking/libc/getservbyname.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getservbyname.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-#include <string.h>
-
-extern int _serv_stayopen;
-
-struct servent *
-getservbyname(name, proto)
- const char *name, *proto;
-{
- register struct servent *p;
- register char **cp;
-
-#ifdef YP
- extern char *___getservbyname_yp;
- extern char *___getservbyproto_yp;
-
- ___getservbyname_yp = (char *)name;
- ___getservbyproto_yp = (char *)proto;
-#endif
-
- setservent(_serv_stayopen);
- while ( (p = getservent()) ) {
- if (strcmp(name, p->s_name) == 0)
- goto gotname;
- for (cp = p->s_aliases; *cp; cp++)
- if (strcmp(name, *cp) == 0)
- goto gotname;
- continue;
-gotname:
- if (proto == 0 || strcmp(p->s_proto, proto) == 0)
- break;
- }
- if (!_serv_stayopen)
- endservent();
-
-#ifdef YP
- ___getservbyname_yp = NULL;
- ___getservbyproto_yp = NULL;
-#endif
-
- return (p);
-}
diff --git a/cpukit/libnetworking/libc/getservbyport.c b/cpukit/libnetworking/libc/getservbyport.c
deleted file mode 100644
index c8433954e1..0000000000
--- a/cpukit/libnetworking/libc/getservbyport.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getservbyport.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-#include <string.h>
-
-extern int _serv_stayopen;
-
-struct servent *
-getservbyport(port, proto)
- int port;
- const char *proto;
-{
- register struct servent *p;
-
-#ifdef YP
- extern int ___getservbyport_yp;
- extern char *___getservbyproto_yp;
-
- ___getservbyport_yp = port;
- ___getservbyproto_yp = (char *)proto;
-#endif
-
- setservent(_serv_stayopen);
- while ( (p = getservent()) ) {
- if (p->s_port != port)
- continue;
- if (proto == 0 || strcmp(p->s_proto, proto) == 0)
- break;
- }
- if (!_serv_stayopen)
- endservent();
-
-#ifdef YP
- ___getservbyport_yp = 0;
- ___getservbyproto_yp = NULL;
-#endif
-
- return (p);
-}
diff --git a/cpukit/libnetworking/libc/getservent.3 b/cpukit/libnetworking/libc/getservent.3
deleted file mode 100644
index 79c18a3beb..0000000000
--- a/cpukit/libnetworking/libc/getservent.3
+++ /dev/null
@@ -1,156 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" From: @(#)getservent.3 8.3 (Berkeley) 1/12/94
-.\" $Id$
-.\"
-.Dd July 9, 1995
-.Dt GETSERVENT 3
-.Os BSD 4.2
-.Sh NAME
-.Nm getservent ,
-.Nm getservbyport ,
-.Nm getservbyname ,
-.Nm setservent ,
-.Nm endservent
-.Nd get service entry
-.Sh SYNOPSIS
-.Fd #include <netdb.h>
-.Ft struct servent *
-.Fn getservent
-.Ft struct servent *
-.Fn getservbyname "const char *name" "const char *proto"
-.Ft struct servent *
-.Fn getservbyport "int port" "const char *proto"
-.Ft void
-.Fn setservent "int stayopen"
-.Ft void
-.Fn endservent void
-.Sh DESCRIPTION
-The
-.Fn getservent ,
-.Fn getservbyname ,
-and
-.Fn getservbyport
-functions
-each return a pointer to an object with the
-following structure
-containing the broken-out
-fields of a line in the network services data base,
-.Pa /etc/services .
-.Bd -literal -offset indent
-struct servent {
- char *s_name; /* official name of service */
- char **s_aliases; /* alias list */
- int s_port; /* port service resides at */
- char *s_proto; /* protocol to use */
-};
-.Ed
-.Pp
-The members of this structure are:
-.Bl -tag -width s_aliases
-.It Fa s_name
-The official name of the service.
-.It Fa s_aliases
-A zero terminated list of alternate names for the service.
-.It Fa s_port
-The port number at which the service resides.
-Port numbers are returned in network byte order.
-.It Fa s_proto
-The name of the protocol to use when contacting the
-service.
-.El
-.Pp
-The
-.Fn getservent
-function
-reads the next line of the file, opening the file if necessary.
-.Pp
-The
-.Fn setservent
-function
-opens and rewinds the file. If the
-.Fa stayopen
-flag is non-zero,
-the net data base will not be closed after each call to
-.Fn getservbyname
-or
-.Fn getservbyport .
-.Pp
-The
-.Fn endservent
-function
-closes the file.
-.Pp
-The
-.Fn getservbyname
-and
-.Fn getservbyport
-functions
-sequentially search from the beginning
-of the file until a matching
-protocol name or
-port number is found,
-or until
-.Dv EOF
-is encountered.
-If a protocol name is also supplied (non-
-.Dv NULL ) ,
-searches must also match the protocol.
-.ne 1i
-.Sh FILES
-.Bl -tag -width /etc/services -compact
-.It Pa /etc/services
-.El
-.Sh DIAGNOSTICS
-Null pointer
-(0) returned on
-.Dv EOF
-or error.
-.Sh SEE ALSO
-.Xr getprotoent 3 ,
-.Xr services 5
-.Sh HISTORY
-The
-.Fn getservent ,
-.Fn getservbyport ,
-.Fn getservbyname ,
-.Fn setservent ,
-and
-.Fn endservent
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-These functions use static data storage;
-if the data is needed for future use, it should be
-copied before any subsequent calls overwrite it.
-Expecting port numbers to fit in a 32 bit
-quantity is probably naive.
diff --git a/cpukit/libnetworking/libc/getservent.c b/cpukit/libnetworking/libc/getservent.c
deleted file mode 100644
index 08a05c0975..0000000000
--- a/cpukit/libnetworking/libc/getservent.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-static int serv_stepping_yp = 0;
-extern int _yp_check __P(( char ** ));
-#endif
-
-
-#define MAXALIASES 35
-
-static FILE *servf = NULL;
-static char line[BUFSIZ+1];
-static struct servent serv;
-static char *serv_aliases[MAXALIASES];
-int _serv_stayopen;
-
-#ifdef YP
-char *___getservbyname_yp = NULL;
-char *___getservbyproto_yp = NULL;
-int ___getservbyport_yp = 0;
-static char *yp_domain = NULL;
-
-static int
-_getservbyport_yp(line)
- char *line;
-{
- char *result;
- int resultlen;
- char buf[YPMAXRECORD + 2];
- int rv;
-
- snprintf(buf, sizeof(buf), "%d/%s", ntohs(___getservbyport_yp),
- ___getservbyproto_yp);
-
- ___getservbyport_yp = 0;
- ___getservbyproto_yp = NULL;
-
- if(!yp_domain) {
- if(yp_get_default_domain(&yp_domain))
- return (0);
- }
-
- /*
- * We have to be a little flexible here. Ideally you're supposed
- * to have both a services.byname and a services.byport map, but
- * some systems have only services.byname. FreeBSD cheats a little
- * by putting the services.byport information in the same map as
- * services.byname so that either case will work. We allow for both
- * possibilities here: if there is no services.byport map, we try
- * services.byname instead.
- */
- if ((rv = yp_match(yp_domain, "services.byport", buf, strlen(buf),
- &result, &resultlen))) {
- if (rv == YPERR_MAP) {
- if (yp_match(yp_domain, "services.byname", buf,
- strlen(buf), &result, &resultlen))
- return(0);
- } else
- return(0);
- }
-
- /* getservent() expects lines terminated with \n -- make it happy */
- snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
-
- free(result);
- return(1);
-}
-
-static int
-_getservbyname_yp(line)
- char *line;
-{
- char *result;
- int resultlen;
- char buf[YPMAXRECORD + 2];
-
- if(!yp_domain) {
- if(yp_get_default_domain(&yp_domain))
- return (0);
- }
-
- snprintf(buf, sizeof(buf), "%s/%s", ___getservbyname_yp,
- ___getservbyproto_yp);
-
- ___getservbyname_yp = 0;
- ___getservbyproto_yp = NULL;
-
- if (yp_match(yp_domain, "services.byname", buf, strlen(buf),
- &result, &resultlen)) {
- return(0);
- }
-
- /* getservent() expects lines terminated with \n -- make it happy */
- snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
-
- free(result);
- return(1);
-}
-
-static int
-_getservent_yp(line)
- char *line;
-{
- static char *key = NULL;
- static int keylen;
- char *lastkey, *result;
- int resultlen;
- int rv;
-
- if(!yp_domain) {
- if(yp_get_default_domain(&yp_domain))
- return (0);
- }
-
- if (!serv_stepping_yp) {
- if (key)
- free(key);
- if ((rv = yp_first(yp_domain, "services.byname", &key, &keylen,
- &result, &resultlen))) {
- serv_stepping_yp = 0;
- return(0);
- }
- serv_stepping_yp = 1;
- } else {
- lastkey = key;
- rv = yp_next(yp_domain, "services.byname", key, keylen, &key,
- &keylen, &result, &resultlen);
- free(lastkey);
- if (rv) {
- serv_stepping_yp = 0;
- return (0);
- }
- }
-
- /* getservent() expects lines terminated with \n -- make it happy */
- snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
-
- free(result);
-
- return(1);
-}
-#endif
-
-void
-setservent(f)
- int f;
-{
- if (servf == NULL)
- servf = fopen(_PATH_SERVICES, "r" );
- else
- rewind(servf);
- _serv_stayopen |= f;
-}
-
-void
-endservent()
-{
- if (servf) {
- fclose(servf);
- servf = NULL;
- }
- _serv_stayopen = 0;
-}
-
-struct servent *
-getservent()
-{
- char *p;
- register char *cp, **q;
-
-#ifdef YP
- if (serv_stepping_yp && _getservent_yp(line)) {
- p = (char *)&line;
- goto unpack;
- }
-tryagain:
-#endif
- if (servf == NULL && (servf = fopen(_PATH_SERVICES, "r" )) == NULL)
- return (NULL);
-again:
- if ((p = fgets(line, BUFSIZ, servf)) == NULL)
- return (NULL);
-#ifdef YP
- if (*p == '+' && _yp_check(NULL)) {
- if (___getservbyname_yp != NULL) {
- if (!_getservbyname_yp(line))
- goto tryagain;
- }
- else if (___getservbyport_yp != 0) {
- if (!_getservbyport_yp(line))
- goto tryagain;
- }
- else if (!_getservent_yp(line))
- goto tryagain;
- }
-unpack:
-#endif
- if (*p == '#')
- goto again;
- cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
- serv.s_name = p;
- p = strpbrk(p, " \t");
- if (p == NULL)
- goto again;
- *p++ = '\0';
- while (*p == ' ' || *p == '\t')
- p++;
- cp = strpbrk(p, ",/");
- if (cp == NULL)
- goto again;
- *cp++ = '\0';
- serv.s_port = htons((u_short)atoi(p));
- serv.s_proto = cp;
- q = serv.s_aliases = serv_aliases;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &serv_aliases[MAXALIASES - 1])
- *q++ = cp;
- cp = strpbrk(cp, " \t");
- if (cp != NULL)
- *cp++ = '\0';
- }
- *q = NULL;
- return (&serv);
-}
diff --git a/cpukit/libnetworking/libc/herror.c b/cpukit/libnetworking/libc/herror.c
deleted file mode 100644
index ba1dae934d..0000000000
--- a/cpukit/libnetworking/libc/herror.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 1987, 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.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <netdb.h>
-#include <string.h>
-#include <unistd.h>
-
-const char *h_errlist[] = {
- "Resolver Error 0 (no error)",
- "Unknown host", /* 1 HOST_NOT_FOUND */
- "Host name lookup failure", /* 2 TRY_AGAIN */
- "Unknown server error", /* 3 NO_RECOVERY */
- "No address associated with name", /* 4 NO_ADDRESS */
-};
-int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] };
-
-int h_errno;
-
-/*
- * herror --
- * print the error indicated by the h_errno value.
- */
-void
-herror(s)
- const char *s;
-{
-#if 0
- struct iovec iov[4];
- register struct iovec *v = iov;
-
- if (s && *s) {
- v->iov_base = (char *)s;
- v->iov_len = strlen(s);
- v++;
- v->iov_base = ": ";
- v->iov_len = 2;
- v++;
- }
- v->iov_base = (char *)hstrerror(h_errno);
- v->iov_len = strlen(v->iov_base);
- v++;
- v->iov_base = "\n";
- v->iov_len = 1;
- writev(STDERR_FILENO, iov, (v - iov) + 1);
-#else
- /*
- * RTEMS: no writev yet
- */
- if (s && *s) {
- write (2, s, strlen (s));
- write (2, ": ", 2);
- }
- s = (char *)hstrerror(h_errno);
- write (2, s, strlen (s));
- write (2, "\n", 1);
-#endif
-}
-
-const char *
-hstrerror(err)
- int err;
-{
- if (err < 0)
- return ("Resolver internal error");
- else if (err < h_nerr)
- return (h_errlist[err]);
- return ("Unknown resolver error");
-}
diff --git a/cpukit/libnetworking/libc/inet.3 b/cpukit/libnetworking/libc/inet.3
deleted file mode 100644
index 1052f538f2..0000000000
--- a/cpukit/libnetworking/libc/inet.3
+++ /dev/null
@@ -1,210 +0,0 @@
-.\" Copyright (c) 1983, 1990, 1991, 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.
-.\"
-.\" From: @(#)inet.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 17, 1996
-.Dt INET 3
-.Os BSD 4.2
-.Sh NAME
-.Nm inet_aton ,
-.Nm inet_addr ,
-.Nm inet_network ,
-.Nm inet_ntoa ,
-.Nm inet_makeaddr ,
-.Nm inet_lnaof ,
-.Nm inet_netof
-.Nd Internet address manipulation routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/socket.h>
-.Fd #include <netinet/in.h>
-.Fd #include <arpa/inet.h>
-.Ft int
-.Fn inet_aton "const char *cp" "struct in_addr *pin"
-.Ft unsigned long
-.Fn inet_addr "const char *cp"
-.Ft unsigned long
-.Fn inet_network "const char *cp"
-.Ft char *
-.Fn inet_ntoa "struct in_addr in"
-.Ft struct in_addr
-.Fn inet_makeaddr "unsigned long net" "unsigned long lna"
-.Ft unsigned long
-.Fn inet_lnaof "struct in_addr in"
-.Ft unsigned long
-.Fn inet_netof "struct in_addr in"
-.Sh DESCRIPTION
-The routines
-.Fn inet_aton ,
-.Fn inet_addr
-and
-.Fn inet_network
-interpret character strings representing
-numbers expressed in the Internet standard
-.Ql \&.
-notation.
-The
-.Fn inet_aton
-routine interprets the specified character string as an Internet address,
-placing the address into the structure provided.
-It returns 1 if the string was successfully interpreted,
-or 0 if the string is invalid.
-The
-.Fn inet_addr
-and
-.Fn inet_network
-functions return numbers suitable for use
-as Internet addresses and Internet network
-numbers, respectively.
-The routine
-.Fn inet_ntoa
-takes an Internet address and returns an
-.Tn ASCII
-string representing the address in
-.Ql \&.
-notation. The routine
-.Fn inet_makeaddr
-takes an Internet network number and a local
-network address and constructs an Internet address
-from it. The routines
-.Fn inet_netof
-and
-.Fn inet_lnaof
-break apart Internet host addresses, returning
-the network number and local network address part,
-respectively.
-.Pp
-All Internet addresses are returned in network
-order (bytes ordered from left to right).
-All network numbers and local address parts are
-returned as machine format integer values.
-.Sh INTERNET ADDRESSES
-Values specified using the
-.Ql \&.
-notation take one
-of the following forms:
-.Bd -literal -offset indent
-a.b.c.d
-a.b.c
-a.b
-a
-.Ed
-.Pp
-When four parts are specified, each is interpreted
-as a byte of data and assigned, from left to right,
-to the four bytes of an Internet address. Note
-that when an Internet address is viewed as a 32-bit
-integer quantity on the
-.Tn VAX
-the bytes referred to
-above appear as
-.Dq Li d.c.b.a .
-That is,
-.Tn VAX
-bytes are
-ordered from right to left.
-.Pp
-When a three part address is specified, the last
-part is interpreted as a 16-bit quantity and placed
-in the right-most two bytes of the network address.
-This makes the three part address format convenient
-for specifying Class B network addresses as
-.Dq Li 128.net.host .
-.Pp
-When a two part address is supplied, the last part
-is interpreted as a 24-bit quantity and placed in
-the right most three bytes of the network address.
-This makes the two part address format convenient
-for specifying Class A network addresses as
-.Dq Li net.host .
-.Pp
-When only one part is given, the value is stored
-directly in the network address without any byte
-rearrangement.
-.Pp
-All numbers supplied as
-.Dq parts
-in a
-.Ql \&.
-notation
-may be decimal, octal, or hexadecimal, as specified
-in the C language (i.e., a leading 0x or 0X implies
-hexadecimal; otherwise, a leading 0 implies octal;
-otherwise, the number is interpreted as decimal).
-.Pp
-The
-.Fn inet_aton
-and
-.Fn inet_ntoa
-functions are semi-deprecated in favor of the
-.Xr addr2ascii 3
-family. However, since those functions are not yet widely implemented,
-portable programs cannot rely on their presence and will continue
-to use the
-.Xr inet 3
-functions for some time.
-.Sh DIAGNOSTICS
-The constant
-.Dv INADDR_NONE
-is returned by
-.Fn inet_addr
-and
-.Fn inet_network
-for malformed requests.
-.Sh SEE ALSO
-.Xr addr2ascii 3 ,
-.Xr gethostbyname 3 ,
-.Xr getnetent 3 ,
-.Xr hosts 5 ,
-.Xr networks 5
-.Sh HISTORY
-These
-functions appeared in
-.Bx 4.2 .
-.Sh BUGS
-The value
-.Dv INADDR_NONE
-(0xffffffff) is a valid broadcast address, but
-.Fn inet_addr
-cannot return that value without indicating failure.
-The newer
-.Fn inet_aton
-function does not share this problem.
-The problem of host byte ordering versus network byte ordering is
-confusing.
-The string returned by
-.Fn inet_ntoa
-resides in a static memory area.
-.Pp
-Inet_addr should return a
-.Fa struct in_addr .
diff --git a/cpukit/libnetworking/libc/inet_addr.c b/cpukit/libnetworking/libc/inet_addr.c
deleted file mode 100644
index 225ccc1269..0000000000
--- a/cpukit/libnetworking/libc/inet_addr.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * ++Copyright++ 1983, 1990, 1993
- * -
- * Copyright (c) 1983, 1990, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <ctype.h>
-
-/*
- * Ascii internet address interpretation routine.
- * The value returned is in network order.
- */
-u_long
-inet_addr(cp)
- register const char *cp;
-{
- struct in_addr val;
-
- if (inet_aton(cp, &val))
- return (val.s_addr);
- return (INADDR_NONE);
-}
-
-/*
- * Check whether "cp" is a valid ascii representation
- * of an Internet address and convert to a binary address.
- * Returns 1 if the address is valid, 0 if not.
- * This replaces inet_addr, the return value from which
- * cannot distinguish between failure and a local broadcast address.
- */
-int
-inet_aton(cp, addr)
- register const char *cp;
- struct in_addr *addr;
-{
- register u_long val;
- register int base, n;
- register char c;
- u_int parts[4];
- register u_int *pp = parts;
-
- c = *cp;
- for (;;) {
- /*
- * Collect number up to ``.''.
- * Values are specified as for C:
- * 0x=hex, 0=octal, isdigit=decimal.
- */
- if (!isdigit((int)c))
- return (0);
- val = 0; base = 10;
- if (c == '0') {
- c = *++cp;
- if (c == 'x' || c == 'X')
- base = 16, c = *++cp;
- else
- base = 8;
- }
- for (;;) {
- if (isascii((int)c) && isdigit((int)c)) {
- val = (val * base) + (c - '0');
- c = *++cp;
- } else if (base == 16 && isascii((int)c) && isxdigit((int)c)) {
- val = (val << 4) |
- (c + 10 - (islower((int)c) ? 'a' : 'A'));
- c = *++cp;
- } else
- break;
- }
- if (c == '.') {
- /*
- * Internet format:
- * a.b.c.d
- * a.b.c (with c treated as 16 bits)
- * a.b (with b treated as 24 bits)
- */
- if (pp >= parts + 3)
- return (0);
- *pp++ = val;
- c = *++cp;
- } else
- break;
- }
- /*
- * Check for trailing characters.
- */
- if (c != '\0' && (!isascii((int)c) || !isspace((int)c)))
- return (0);
- /*
- * Concoct the address according to
- * the number of parts specified.
- */
- n = pp - parts + 1;
- switch (n) {
-
- case 0:
- return (0); /* initial nondigit */
-
- case 1: /* a -- 32 bits */
- break;
-
- case 2: /* a.b -- 8.24 bits */
- if (val > 0xffffff)
- return (0);
- val |= parts[0] << 24;
- break;
-
- case 3: /* a.b.c -- 8.8.16 bits */
- if (val > 0xffff)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16);
- break;
-
- case 4: /* a.b.c.d -- 8.8.8.8 bits */
- if (val > 0xff)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
- break;
- }
- if (addr)
- addr->s_addr = htonl(val);
- return (1);
-}
diff --git a/cpukit/libnetworking/libc/inet_lnaof.c b/cpukit/libnetworking/libc/inet_lnaof.c
deleted file mode 100644
index 6ec6a9aef1..0000000000
--- a/cpukit/libnetworking/libc/inet_lnaof.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_lnaof.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Return the local network address portion of an
- * internet address; handles class a/b/c network
- * number formats.
- */
-u_long
-inet_lnaof(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return ((i)&IN_CLASSA_HOST);
- else if (IN_CLASSB(i))
- return ((i)&IN_CLASSB_HOST);
- else
- return ((i)&IN_CLASSC_HOST);
-}
diff --git a/cpukit/libnetworking/libc/inet_makeaddr.c b/cpukit/libnetworking/libc/inet_makeaddr.c
deleted file mode 100644
index ce84170ed9..0000000000
--- a/cpukit/libnetworking/libc/inet_makeaddr.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_makeaddr.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Formulate an Internet address from network + host. Used in
- * building addresses stored in the ifnet structure.
- */
-struct in_addr
-inet_makeaddr(net, host)
- u_long net, host;
-{
- u_long addr;
-
- if (net < 128)
- addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
- else if (net < 65536)
- addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
- else if (net < 16777216L)
- addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
- else
- addr = net | host;
- addr = htonl(addr);
- return (*(struct in_addr *)&addr);
-}
diff --git a/cpukit/libnetworking/libc/inet_net_ntop.c b/cpukit/libnetworking/libc/inet_net_ntop.c
deleted file mode 100644
index 4c7893d417..0000000000
--- a/cpukit/libnetworking/libc/inet_net_ntop.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char orig_rcsid[] = "From Id: inet_net_ntop.c,v 8.2 1996/08/08 06:54:44 vixie Exp";
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-static char * inet_net_ntop_ipv4 __P((const u_char *src, int bits,
- char *dst, size_t size));
-
-/*
- * char *
- * inet_net_ntop(af, src, bits, dst, size)
- * convert network number from network to presentation format.
- * generates CIDR style result always.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * author:
- * Paul Vixie (ISC), July 1996
- */
-char *
-inet_net_ntop(af, src, bits, dst, size)
- int af;
- const void *src;
- int bits;
- char *dst;
- size_t size;
-{
- switch (af) {
- case AF_INET:
- return (inet_net_ntop_ipv4(src, bits, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (NULL);
- }
-}
-
-/*
- * static char *
- * inet_net_ntop_ipv4(src, bits, dst, size)
- * convert IPv4 network number from network to presentation format.
- * generates CIDR style result always.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * note:
- * network byte order assumed. this means 192.5.5.240/28 has
- * 0x11110000 in its fourth octet.
- * author:
- * Paul Vixie (ISC), July 1996
- */
-static char *
-inet_net_ntop_ipv4(src, bits, dst, size)
- const u_char *src;
- int bits;
- char *dst;
- size_t size;
-{
- char *odst = dst;
- char *t;
- u_int m;
- int b;
-
- if (bits < 0 || bits > 32) {
- errno = EINVAL;
- return (NULL);
- }
- if (bits == 0) {
- if (size < sizeof "0")
- goto emsgsize;
- *dst++ = '0';
- *dst = '\0';
- }
-
- /* Format whole octets. */
- for (b = bits / 8; b > 0; b--) {
- if (size < sizeof "255.")
- goto emsgsize;
- t = dst;
- dst += SPRINTF((dst, "%u", *src++));
- if (b > 1) {
- *dst++ = '.';
- *dst = '\0';
- }
- size -= (size_t)(dst - t);
- }
-
- /* Format partial octet. */
- b = bits % 8;
- if (b > 0) {
- if (size < sizeof ".255")
- goto emsgsize;
- t = dst;
- if (dst != odst)
- *dst++ = '.';
- m = ((1 << b) - 1) << (8 - b);
- dst += SPRINTF((dst, "%u", *src & m));
- size -= (size_t)(dst - t);
- }
-
- /* Format CIDR /width. */
- if (size < sizeof "/32")
- goto emsgsize;
- dst += SPRINTF((dst, "/%u", bits));
- return (odst);
-
- emsgsize:
- errno = EMSGSIZE;
- return (NULL);
-}
diff --git a/cpukit/libnetworking/libc/inet_net_pton.c b/cpukit/libnetworking/libc/inet_net_pton.c
deleted file mode 100644
index 8915c2a5be..0000000000
--- a/cpukit/libnetworking/libc/inet_net_pton.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char orig_rcsid[] = "From Id: inet_net_pton.c,v 1.8 1996/11/21 10:28:12 vixie Exp $";
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-static int inet_net_pton_ipv4 __P((const char *src, u_char *dst,
- size_t size));
-
-/*
- * static int
- * inet_net_pton(af, src, dst, size)
- * convert network number from presentation to network format.
- * accepts hex octets, hex strings, decimal octets, and /CIDR.
- * "size" is in bytes and describes "dst".
- * return:
- * number of bits, either imputed classfully or specified with /CIDR,
- * or -1 if some failure occurred (check errno). ENOENT means it was
- * not a valid network specification.
- * author:
- * Paul Vixie (ISC), June 1996
- */
-int
-inet_net_pton(af, src, dst, size)
- int af;
- const char *src;
- void *dst;
- size_t size;
-{
- switch (af) {
- case AF_INET:
- return (inet_net_pton_ipv4(src, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (-1);
- }
-}
-
-/*
- * static int
- * inet_net_pton_ipv4(src, dst, size)
- * convert IPv4 network number from presentation to network format.
- * accepts hex octets, hex strings, decimal octets, and /CIDR.
- * "size" is in bytes and describes "dst".
- * return:
- * number of bits, either imputed classfully or specified with /CIDR,
- * or -1 if some failure occurred (check errno). ENOENT means it was
- * not an IPv4 network specification.
- * note:
- * network byte order assumed. this means 192.5.5.240/28 has
- * 0x11110000 in its fourth octet.
- * author:
- * Paul Vixie (ISC), June 1996
- */
-static int
-inet_net_pton_ipv4(src, dst, size)
- const char *src;
- u_char *dst;
- size_t size;
-{
- static const char
- xdigits[] = "0123456789abcdef",
- digits[] = "0123456789";
- int n, ch, tmp, dirty, bits;
- const u_char *odst = dst;
-
- ch = *src++;
- if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
- && isascii(src[1]) && isxdigit(src[1])) {
- /* Hexadecimal: Eat nybble string. */
- if (size <= 0)
- goto emsgsize;
- *dst = 0, dirty = 0;
- src++; /* skip x or X. */
- while ((ch = *src++) != '\0' &&
- isascii(ch) && isxdigit(ch)) {
- if (isupper(ch))
- ch = tolower(ch);
- n = strchr(xdigits, ch) - xdigits;
- assert(n >= 0 && n <= 15);
- *dst |= n;
- if (!dirty++)
- *dst <<= 4;
- else if (size-- > 0)
- *++dst = 0, dirty = 0;
- else
- goto emsgsize;
- }
- if (dirty)
- size--;
- } else if (isascii(ch) && isdigit(ch)) {
- /* Decimal: eat dotted digit string. */
- for (;;) {
- tmp = 0;
- do {
- n = strchr(digits, ch) - digits;
- assert(n >= 0 && n <= 9);
- tmp *= 10;
- tmp += n;
- if (tmp > 255)
- goto enoent;
- } while ((ch = *src++) != '\0' &&
- isascii(ch) && isdigit(ch));
- if (size-- <= 0)
- goto emsgsize;
- *dst++ = (u_char) tmp;
- if (ch == '\0' || ch == '/')
- break;
- if (ch != '.')
- goto enoent;
- ch = *src++;
- if (!isascii(ch) || !isdigit(ch))
- goto enoent;
- }
- } else
- goto enoent;
-
- bits = -1;
- if (ch == '/' && isascii(src[0]) && isdigit(src[0]) && dst > odst) {
- /* CIDR width specifier. Nothing can follow it. */
- ch = *src++; /* Skip over the /. */
- bits = 0;
- do {
- n = strchr(digits, ch) - digits;
- assert(n >= 0 && n <= 9);
- bits *= 10;
- bits += n;
- } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
- if (ch != '\0')
- goto enoent;
- if (bits > 32)
- goto emsgsize;
- }
-
- /* Firey death and destruction unless we prefetched EOS. */
- if (ch != '\0')
- goto enoent;
-
- /* If nothing was written to the destination, we found no address. */
- if (dst == odst)
- goto enoent;
- /* If no CIDR spec was given, infer width from net class. */
- if (bits == -1) {
- if (*odst >= 240) /* Class E */
- bits = 32;
- else if (*odst >= 224) /* Class D */
- bits = 4;
- else if (*odst >= 192) /* Class C */
- bits = 24;
- else if (*odst >= 128) /* Class B */
- bits = 16;
- else /* Class A */
- bits = 8;
- /* If imputed mask is narrower than specified octets, widen. */
- if (bits >= 8 && bits < ((dst - odst) * 8))
- bits = (dst - odst) * 8;
- }
- /* Extend network to cover the actual mask. */
- while (bits > ((dst - odst) * 8)) {
- if (size-- <= 0)
- goto emsgsize;
- *dst++ = '\0';
- }
- return (bits);
-
- enoent:
- errno = ENOENT;
- return (-1);
-
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
diff --git a/cpukit/libnetworking/libc/inet_neta.c b/cpukit/libnetworking/libc/inet_neta.c
deleted file mode 100644
index 59b156f7f6..0000000000
--- a/cpukit/libnetworking/libc/inet_neta.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char orig_rcsid[] = "From Id: inet_neta.c,v 8.2 1996/08/08 06:54:44 vixie Exp";
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-/*
- * char *
- * inet_neta(src, dst, size)
- * format a u_long network number into presentation format.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * note:
- * format of ``src'' is as for inet_network().
- * author:
- * Paul Vixie (ISC), July 1996
- */
-char *
-inet_neta(src, dst, size)
- u_long src;
- char *dst;
- size_t size;
-{
- char *odst = dst;
- char *tp;
-
- while (src & 0xffffffff) {
- u_char b = (src & 0xff000000) >> 24;
-
- src <<= 8;
- if (b) {
- if (size < sizeof "255.")
- goto emsgsize;
- tp = dst;
- dst += SPRINTF((dst, "%u", b));
- if (src != 0L) {
- *dst++ = '.';
- *dst = '\0';
- }
- size -= (size_t)(dst - tp);
- }
- }
- if (dst == odst) {
- if (size < sizeof "0.0.0.0")
- goto emsgsize;
- strcpy(dst, "0.0.0.0");
- }
- return (odst);
-
- emsgsize:
- errno = EMSGSIZE;
- return (NULL);
-}
diff --git a/cpukit/libnetworking/libc/inet_netof.c b/cpukit/libnetworking/libc/inet_netof.c
deleted file mode 100644
index 179731efc3..0000000000
--- a/cpukit/libnetworking/libc/inet_netof.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_netof.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Return the network number from an internet
- * address; handles class a/b/c network #'s.
- */
-u_long
-inet_netof(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
- else if (IN_CLASSB(i))
- return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT);
- else
- return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
-}
diff --git a/cpukit/libnetworking/libc/inet_network.c b/cpukit/libnetworking/libc/inet_network.c
deleted file mode 100644
index ac0073bf0a..0000000000
--- a/cpukit/libnetworking/libc/inet_network.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_network.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <ctype.h>
-
-/*
- * Internet network address interpretation routine.
- * The library routines call this routine to interpret
- * network numbers.
- */
-u_long
-inet_network(cp)
- register const char *cp;
-{
- register u_long val, base, n, i;
- register char c;
- u_long parts[4], *pp = parts;
-
-again:
- val = 0; base = 10;
- if (*cp == '0')
- base = 8, cp++;
- if (*cp == 'x' || *cp == 'X')
- base = 16, cp++;
- while ((c = *cp) != 0) {
- if (isdigit(c)) {
- val = (val * base) + (c - '0');
- cp++;
- continue;
- }
- if (base == 16 && isxdigit(c)) {
- val = (val << 4) + (c + 10 - (islower(c) ? 'a' : 'A'));
- cp++;
- continue;
- }
- break;
- }
- if (*cp == '.') {
- if (pp >= parts + 3)
- return (INADDR_NONE);
- *pp++ = val, cp++;
- goto again;
- }
- if (*cp && !isspace(*cp))
- return (INADDR_NONE);
- *pp++ = val;
- n = pp - parts;
- for (val = 0, i = 0; i < n; i++) {
- val <<= 8;
- val |= parts[i] & 0xff;
- }
- return (val);
-}
diff --git a/cpukit/libnetworking/libc/inet_ntoa.c b/cpukit/libnetworking/libc/inet_ntoa.c
deleted file mode 100644
index 44b686f0b3..0000000000
--- a/cpukit/libnetworking/libc/inet_ntoa.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 1983, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_ntoa.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <stdio.h>
-
-/*
- * Convert network-format internet address
- * to base 256 d.d.d.d representation.
- */
-char *
-inet_ntoa(in)
- struct in_addr in;
-{
- static char ret[18];
-
- strcpy(ret, "[inet_ntoa error]");
- (void) inet_ntop(AF_INET, &in, ret, sizeof ret);
- return (ret);
-}
diff --git a/cpukit/libnetworking/libc/inet_ntop.c b/cpukit/libnetworking/libc/inet_ntop.c
deleted file mode 100644
index 76a538755a..0000000000
--- a/cpukit/libnetworking/libc/inet_ntop.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/* Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-/*
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static const char *inet_ntop4 __P((const u_char *src, char *dst, size_t size));
-static const char *inet_ntop6 __P((const u_char *src, char *dst, size_t size));
-
-/* char *
- * inet_ntop(af, src, dst, size)
- * convert a network format address to presentation format.
- * return:
- * pointer to presentation format address (`dst'), or NULL (see errno).
- * author:
- * Paul Vixie, 1996.
- */
-const char *
-inet_ntop(af, src, dst, size)
- int af;
- const void *src;
- char *dst;
- size_t size;
-{
- switch (af) {
- case AF_INET:
- return (inet_ntop4(src, dst, size));
- case AF_INET6:
- return (inet_ntop6(src, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (NULL);
- }
- /* NOTREACHED */
-}
-
-/* const char *
- * inet_ntop4(src, dst, size)
- * format an IPv4 address, more or less like inet_ntoa()
- * return:
- * `dst' (as a const)
- * notes:
- * (1) uses no statics
- * (2) takes a u_char* not an in_addr as input
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop4(src, dst, size)
- const u_char *src;
- char *dst;
- size_t size;
-{
- static const char fmt[] = "%u.%u.%u.%u";
- char tmp[sizeof "255.255.255.255"];
-
- if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
- errno = ENOSPC;
- return (NULL);
- }
- strcpy(dst, tmp);
- return (dst);
-}
-
-/* const char *
- * inet_ntop6(src, dst, size)
- * convert IPv6 binary address into presentation (printable) format
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop6(src, dst, size)
- const u_char *src;
- char *dst;
- size_t size;
-{
- /*
- * Note that int32_t and int16_t need only be "at least" large enough
- * to contain a value of the specified size. On some systems, like
- * Crays, there is no such thing as an integer variable with 16 bits.
- * Keep this in mind if you think this function should have been coded
- * to use pointer overlays. All the world's not a VAX.
- */
- char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
- struct { int base, len; } best, cur;
- u_int words[NS_IN6ADDRSZ / NS_INT16SZ];
- int i;
-
- /*
- * Preprocess:
- * Copy the input (bytewise) array into a wordwise array.
- * Find the longest run of 0x00's in src[] for :: shorthanding.
- */
- memset(words, '\0', sizeof words);
- for (i = 0; i < NS_IN6ADDRSZ; i++)
- words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
- best.base = -1;
- cur.base = -1;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
- if (words[i] == 0) {
- if (cur.base == -1)
- cur.base = i, cur.len = 1;
- else
- cur.len++;
- } else {
- if (cur.base != -1) {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- cur.base = -1;
- }
- }
- }
- if (cur.base != -1) {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- }
- if (best.base != -1 && best.len < 2)
- best.base = -1;
-
- /*
- * Format the result.
- */
- tp = tmp;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
- /* Are we inside the best run of 0x00's? */
- if (best.base != -1 && i >= best.base &&
- i < (best.base + best.len)) {
- if (i == best.base)
- *tp++ = ':';
- continue;
- }
- /* Are we following an initial run of 0x00s or any real hex? */
- if (i != 0)
- *tp++ = ':';
- /* Is this address an encapsulated IPv4? */
- if (i == 6 && best.base == 0 &&
- (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
- if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
- return (NULL);
- tp += strlen(tp);
- break;
- }
- tp += SPRINTF((tp, "%x", words[i]));
- }
- /* Was it a trailing run of 0x00's? */
- if (best.base != -1 && (best.base + best.len) ==
- (NS_IN6ADDRSZ / NS_INT16SZ))
- *tp++ = ':';
- *tp++ = '\0';
-
- /*
- * Check for overflow, copy, and we're done.
- */
- if ((size_t)(tp - tmp) > size) {
- errno = ENOSPC;
- return (NULL);
- }
- strcpy(dst, tmp);
- return (dst);
-}
diff --git a/cpukit/libnetworking/libc/inet_pton.c b/cpukit/libnetworking/libc/inet_pton.c
deleted file mode 100644
index 8d21111cfa..0000000000
--- a/cpukit/libnetworking/libc/inet_pton.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/* Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <string.h>
-#include <errno.h>
-
-/*
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static int inet_pton4 __P((const char *src, u_char *dst));
-static int inet_pton6 __P((const char *src, u_char *dst));
-
-/* int
- * inet_pton(af, src, dst)
- * convert from presentation format (which usually means ASCII printable)
- * to network format (which is usually some kind of binary format).
- * return:
- * 1 if the address was valid for the specified address family
- * 0 if the address wasn't valid (`dst' is untouched in this case)
- * -1 if some other error occurred (`dst' is untouched in this case, too)
- * author:
- * Paul Vixie, 1996.
- */
-int
-inet_pton(af, src, dst)
- int af;
- const char *src;
- void *dst;
-{
- switch (af) {
- case AF_INET:
- return (inet_pton4(src, dst));
- case AF_INET6:
- return (inet_pton6(src, dst));
- default:
- errno = EAFNOSUPPORT;
- return (-1);
- }
- /* NOTREACHED */
-}
-
-/* int
- * inet_pton4(src, dst)
- * like inet_aton() but without all the hexadecimal and shorthand.
- * return:
- * 1 if `src' is a valid dotted quad, else 0.
- * notice:
- * does not touch `dst' unless it's returning 1.
- * author:
- * Paul Vixie, 1996.
- */
-static int
-inet_pton4(src, dst)
- const char *src;
- u_char *dst;
-{
- static const char digits[] = "0123456789";
- int saw_digit, octets, ch;
- u_char tmp[NS_INADDRSZ], *tp;
-
- saw_digit = 0;
- octets = 0;
- *(tp = tmp) = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr(digits, ch)) != NULL) {
- u_int new = *tp * 10 + (pch - digits);
-
- if (new > 255)
- return (0);
- *tp = new;
- if (! saw_digit) {
- if (++octets > 4)
- return (0);
- saw_digit = 1;
- }
- } else if (ch == '.' && saw_digit) {
- if (octets == 4)
- return (0);
- *++tp = 0;
- saw_digit = 0;
- } else
- return (0);
- }
- if (octets < 4)
- return (0);
-
- memcpy(dst, tmp, NS_INADDRSZ);
- return (1);
-}
-
-/* int
- * inet_pton6(src, dst)
- * convert presentation level address to network order binary form.
- * return:
- * 1 if `src' is a valid [RFC1884 2.2] address, else 0.
- * notice:
- * (1) does not touch `dst' unless it's returning 1.
- * (2) :: in a full address is silently ignored.
- * credit:
- * inspired by Mark Andrews.
- * author:
- * Paul Vixie, 1996.
- */
-static int
-inet_pton6(src, dst)
- const char *src;
- u_char *dst;
-{
- static const char xdigits_l[] = "0123456789abcdef",
- xdigits_u[] = "0123456789ABCDEF";
- u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
- const char *xdigits, *curtok;
- int ch, saw_xdigit;
- u_int val;
-
- memset((tp = tmp), '\0', NS_IN6ADDRSZ);
- endp = tp + NS_IN6ADDRSZ;
- colonp = NULL;
- /* Leading :: requires some special handling. */
- if (*src == ':')
- if (*++src != ':')
- return (0);
- curtok = src;
- saw_xdigit = 0;
- val = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
- pch = strchr((xdigits = xdigits_u), ch);
- if (pch != NULL) {
- val <<= 4;
- val |= (pch - xdigits);
- if (val > 0xffff)
- return (0);
- saw_xdigit = 1;
- continue;
- }
- if (ch == ':') {
- curtok = src;
- if (!saw_xdigit) {
- if (colonp)
- return (0);
- colonp = tp;
- continue;
- }
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- saw_xdigit = 0;
- val = 0;
- continue;
- }
- if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
- inet_pton4(curtok, tp) > 0) {
- tp += NS_INADDRSZ;
- saw_xdigit = 0;
- break; /* '\0' was seen by inet_pton4(). */
- }
- return (0);
- }
- if (saw_xdigit) {
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- }
- if (colonp != NULL) {
- /*
- * Since some memmove()'s erroneously fail to handle
- * overlapping regions, we'll do the shift by hand.
- */
- const int n = tp - colonp;
- int i;
-
- for (i = 1; i <= n; i++) {
- endp[- i] = colonp[n - i];
- colonp[n - i] = 0;
- }
- tp = endp;
- }
- if (tp != endp)
- return (0);
- memcpy(dst, tmp, NS_IN6ADDRSZ);
- return (1);
-}
diff --git a/cpukit/libnetworking/libc/iso_addr.3 b/cpukit/libnetworking/libc/iso_addr.3
deleted file mode 100644
index 0c9973bef4..0000000000
--- a/cpukit/libnetworking/libc/iso_addr.3
+++ /dev/null
@@ -1,111 +0,0 @@
-.\" Copyright (c) 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.
-.\"
-.\" @(#)iso_addr.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt ISO_ADDR 3
-.Os
-.Sh NAME
-.Nm iso_addr ,
-.Nm iso_ntoa
-.Nd "elementary network address conversion routines for Open System Interconnection
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netiso/iso.h>
-.Ft struct iso_addr *
-.Fn iso_addr "char *cp"
-.Ft char *
-.Fn iso_ntoa "struct iso_addr *isoa"
-.Sh DESCRIPTION
-The routine
-.Fn iso_addr
-interprets character strings representing
-.Tn OSI
-addresses, returning binary information suitable
-for use in system calls.
-The routine
-.Fn iso_ntoa
-takes
-.Tn OSI
-addresses and returns
-.Tn ASCII
-strings representing NSAPs (network service
-access points) in a
-notation inverse to that accepted by
-.Fn iso_addr .
-.Pp
-Unfortunately, no universal standard exists for representing
-.Tn OSI
-network addresses.
-.Pp
-The format employed by
-.Fn iso_addr
-is a sequence of hexadecimal
-.Dq digits
-(optionally separated by periods),
-of the form:
-.Bd -filled -offset indent
-<hex digits>.<hex digits>.<hex digits>
-.Ed
-.Pp
-Each pair of hexadecimal digits represents a byte
-with the leading digit indicating the higher-ordered bits.
-A period following an even number of bytes has no
-effect (but may be used to increase legibility).
-A period following an odd number of bytes has the
-effect of causing the byte of address being translated
-to have its higher order bits filled with zeros.
-.Sh RETURN VALUES
-.Fn iso_ntoa
-always returns a null terminated string.
-.Fn iso_addr
-always returns a pointer to a struct iso_addr.
-(See
-.Sx BUGS . )
-.Sh SEE ALSO
-.Xr iso 4
-.Sh HISTORY
-The
-.Fn iso_addr
-and
-.Fn iso_ntoa
-functions appeared in
-.Bx 4.3 Reno .
-.Sh BUGS
-The returned values
-reside in a static memory area.
-.Pp
-The function
-.Fn iso_addr
-should diagnose improperly formed input, and there should be an unambiguous
-way to recognize this.
diff --git a/cpukit/libnetworking/libc/iso_addr.c b/cpukit/libnetworking/libc/iso_addr.c
deleted file mode 100644
index eb14e8a72b..0000000000
--- a/cpukit/libnetworking/libc/iso_addr.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 1989, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)iso_addr.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <netiso/iso.h>
-#include <string.h>
-
-/* States*/
-#define VIRGIN 0
-#define GOTONE 1
-#define GOTTWO 2
-/* Inputs */
-#define DIGIT (4*0)
-#define END (4*1)
-#define DELIM (4*2)
-
-struct iso_addr *
-iso_addr(addr)
- register const char *addr;
-{
- static struct iso_addr out_addr;
- register char *cp = out_addr.isoa_genaddr;
- char *cplim = cp + sizeof(out_addr.isoa_genaddr);
- register int byte = 0, state = VIRGIN, new;
-
- bzero((char *)&out_addr, sizeof(out_addr));
- do {
- if ((*addr >= '0') && (*addr <= '9')) {
- new = *addr - '0';
- } else if ((*addr >= 'a') && (*addr <= 'f')) {
- new = *addr - 'a' + 10;
- } else if ((*addr >= 'A') && (*addr <= 'F')) {
- new = *addr - 'A' + 10;
- } else if (*addr == 0)
- state |= END;
- else
- state |= DELIM;
- addr++;
- switch (state /* | INPUT */) {
- case GOTTWO | DIGIT:
- *cp++ = byte; /*FALLTHROUGH*/
- case VIRGIN | DIGIT:
- state = GOTONE; byte = new; continue;
- case GOTONE | DIGIT:
- state = GOTTWO; byte = new + (byte << 4); continue;
- default: /* | DELIM */
- state = VIRGIN; *cp++ = byte; byte = 0; continue;
- case GOTONE | END:
- case GOTTWO | END:
- *cp++ = byte; /* FALLTHROUGH */
- case VIRGIN | END:
- break;
- }
- break;
- } while (cp < cplim);
- out_addr.isoa_len = cp - out_addr.isoa_genaddr;
- return (&out_addr);
-}
-
-static char hexlist[] = "0123456789abcdef";
-
-char *
-iso_ntoa(isoa)
- const struct iso_addr *isoa;
-{
- static char tmpbuf[sizeof(isoa->isoa_genaddr)*3];
- const u_char *binary;
- char *cp;
- int i;
-
- binary = isoa->isoa_genaddr;
- cp = tmpbuf;
-
- for (i = 0; i < isoa->isoa_len; i++) {
- *cp++ = hexlist[*binary >> 4];
- *cp++ = hexlist[*binary++ & 0xf];
-
- if ((((i % 2) == 0) && ((i + 1) < isoa->isoa_len)))
- *cp++ = '.';
- }
- *cp = '\0';
- return tmpbuf;
-}
diff --git a/cpukit/libnetworking/libc/linkaddr.3 b/cpukit/libnetworking/libc/linkaddr.3
deleted file mode 100644
index 6999add0e8..0000000000
--- a/cpukit/libnetworking/libc/linkaddr.3
+++ /dev/null
@@ -1,138 +0,0 @@
-.\" Copyright (c) 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" This code is derived from software contributed to Berkeley by
-.\" Donn Seeley at BSDI.
-.\"
-.\" 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.
-.\"
-.\" From: @(#)linkaddr.3 8.1 (Berkeley) 7/28/93
-.\" $Id$
-.\"
-.Dd June 17, 1996
-.Dt LINK_ADDR 3
-.Os BSD 4.4
-.Sh NAME
-.Nm link_addr ,
-.Nm link_ntoa
-.Nd elementary address specification routines for link level access
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/socket.h>
-.Fd #include <net/if_dl.h>
-.Ft void
-.Fn link_addr "const char *addr" "struct sockaddr_dl *sdl"
-.Ft char *
-.Fn link_ntoa "const struct sockaddr_dl *sdl"
-.Sh DESCRIPTION
-The routine
-.Fn link_addr
-interprets character strings representing
-link-level addresses, returning binary information suitable
-for use in system calls.
-The routine
-.Fn link_ntoa
-takes
-a link-level
-address and returns an
-.Tn ASCII
-string representing some of the information present,
-including the link level address itself, and the interface name
-or number, if present.
-This facility is experimental and is
-still subject to change.
-.Pp
-For
-.Fn link_addr ,
-the string
-.Fa addr
-may contain
-an optional network interface identifier of the form
-.Dq "name unit-number" ,
-suitable for the first argument to
-.Xr ifconfig 8 ,
-followed in all cases by a colon and
-an interface address in the form of
-groups of hexadecimal digits
-separated by periods.
-Each group represents a byte of address;
-address bytes are filled left to right from
-low order bytes through high order bytes.
-.Pp
-.\" A regular expression may make this format clearer:
-.\" .Bd -literal -offset indent
-.\" ([a-z]+[0-9]+:)?[0-9a-f]+(\e.[0-9a-f]+)*
-.\" .Ed
-.\" .Pp
-Thus
-.Li le0:8.0.9.13.d.30
-represents an ethernet address
-to be transmitted on the first Lance ethernet interface.
-.Pp
-The direct use of these functions is deprecated in favor of the
-.Xr addr2ascii 3
-interface; however, portable programs cannot rely on the latter as it is
-not yet widely implemented.
-.Sh RETURN VALUES
-.Fn link_ntoa
-always returns a null terminated string.
-.Fn link_addr
-has no return value.
-(See
-.Sx BUGS . )
-.Sh SEE ALSO
-.Xr addr2ascii 3
-.\" .Xr iso 4
-.Sh HISTORY
-The
-.Fn link_addr
-and
-.Fn link_ntoa
-functions appeared in
-.Bx 4.3 Reno .
-.Sh BUGS
-The returned values for link_ntoa
-reside in a static memory area.
-.Pp
-The function
-.Fn link_addr
-should diagnose improperly formed input, and there should be an unambiguous
-way to recognize this.
-.Pp
-If the
-.Va sdl_len
-field of the link socket address
-.Fa sdl
-is 0,
-.Fn link_ntoa
-will not insert a colon before the interface address bytes.
-If this translated address is given to
-.Fn link_addr
-without inserting an initial colon,
-the latter will not interpret it correctly.
diff --git a/cpukit/libnetworking/libc/linkaddr.c b/cpukit/libnetworking/libc/linkaddr.c
deleted file mode 100644
index 28c16cff05..0000000000
--- a/cpukit/libnetworking/libc/linkaddr.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*-
- * Copyright (c) 1990, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)linkaddr.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <net/if_dl.h>
-#include <string.h>
-
-/* States*/
-#define NAMING 0
-#define GOTONE 1
-#define GOTTWO 2
-#define RESET 3
-/* Inputs */
-#define DIGIT (4*0)
-#define END (4*1)
-#define DELIM (4*2)
-#define LETTER (4*3)
-
-void
-link_addr(addr, sdl)
- register const char *addr;
- register struct sockaddr_dl *sdl;
-{
- register char *cp = sdl->sdl_data;
- char *cplim = sdl->sdl_len + (char *)sdl;
- register int byte = 0, state = NAMING, new;
-
- bzero((char *)&sdl->sdl_family, sdl->sdl_len - 1);
- sdl->sdl_family = AF_LINK;
- do {
- state &= ~LETTER;
- if ((*addr >= '0') && (*addr <= '9')) {
- new = *addr - '0';
- } else if ((*addr >= 'a') && (*addr <= 'f')) {
- new = *addr - 'a' + 10;
- } else if ((*addr >= 'A') && (*addr <= 'F')) {
- new = *addr - 'A' + 10;
- } else if (*addr == 0) {
- state |= END;
- } else if (state == NAMING &&
- (((*addr >= 'A') && (*addr <= 'Z')) ||
- ((*addr >= 'a') && (*addr <= 'z'))))
- state |= LETTER;
- else
- state |= DELIM;
- addr++;
- switch (state /* | INPUT */) {
- case NAMING | DIGIT:
- case NAMING | LETTER:
- *cp++ = addr[-1];
- continue;
- case NAMING | DELIM:
- state = RESET;
- sdl->sdl_nlen = cp - sdl->sdl_data;
- continue;
- case GOTTWO | DIGIT:
- *cp++ = byte;
- /* FALLTHROUGH */
- case RESET | DIGIT:
- state = GOTONE;
- byte = new;
- continue;
- case GOTONE | DIGIT:
- state = GOTTWO;
- byte = new + (byte << 4);
- continue;
- default: /* | DELIM */
- state = RESET;
- *cp++ = byte;
- byte = 0;
- continue;
- case GOTONE | END:
- case GOTTWO | END:
- *cp++ = byte;
- /* FALLTHROUGH */
- case RESET | END:
- break;
- }
- break;
- } while (cp < cplim);
- sdl->sdl_alen = cp - LLADDR(sdl);
- new = cp - (char *)sdl;
- if (new > sizeof(*sdl))
- sdl->sdl_len = new;
- return;
-}
-
-static char hexlist[] = "0123456789abcdef";
-
-char *
-link_ntoa(sdl)
- register const struct sockaddr_dl *sdl;
-{
- static char obuf[64];
- register char *out = obuf;
- register int i;
- register u_char *in = (u_char *)LLADDR(sdl);
- u_char *inlim = in + sdl->sdl_alen;
- int firsttime = 1;
-
- if (sdl->sdl_nlen) {
- bcopy(sdl->sdl_data, obuf, sdl->sdl_nlen);
- out += sdl->sdl_nlen;
- if (sdl->sdl_alen)
- *out++ = ':';
- }
- while (in < inlim) {
- if (firsttime)
- firsttime = 0;
- else
- *out++ = '.';
- i = *in++;
- if (i > 0xf) {
- out[1] = hexlist[i & 0xf];
- i >>= 4;
- out[0] = hexlist[i];
- out += 2;
- } else
- *out++ = hexlist[i];
- }
- *out = 0;
- return (obuf);
-}
diff --git a/cpukit/libnetworking/libc/map_v4v6.c b/cpukit/libnetworking/libc/map_v4v6.c
deleted file mode 100644
index 0f8658e117..0000000000
--- a/cpukit/libnetworking/libc/map_v4v6.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * ++Copyright++ 1985, 1988, 1993
- * -
- * Copyright (c) 1985, 1988, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <ctype.h>
-#include <errno.h>
-#include <syslog.h>
-
-typedef union {
- int32_t al;
- char ac;
-} align;
-
-void
-_map_v4v6_address(src, dst)
- const char *src;
- char *dst;
-{
- u_char *p = (u_char *)dst;
- char tmp[INADDRSZ];
- int i;
-
- /* Stash a temporary copy so our caller can update in place. */
- bcopy(src, tmp, INADDRSZ);
- /* Mark this ipv6 addr as a mapped ipv4. */
- for (i = 0; i < 10; i++)
- *p++ = 0x00;
- *p++ = 0xff;
- *p++ = 0xff;
- /* Retrieve the saved copy and we're done. */
- bcopy(tmp, (void*)p, INADDRSZ);
-}
-
-void
-_map_v4v6_hostent(hp, bpp, lenp)
- struct hostent *hp;
- char **bpp;
- int *lenp;
-{
- char **ap;
-
- if (hp->h_addrtype != AF_INET || hp->h_length != INADDRSZ)
- return;
- hp->h_addrtype = AF_INET6;
- hp->h_length = IN6ADDRSZ;
- for (ap = hp->h_addr_list; *ap; ap++) {
- int i = sizeof(align) - ((u_long)*bpp % sizeof(align));
-
- if (*lenp < (i + IN6ADDRSZ)) {
- /* Out of memory. Truncate address list here. XXX */
- *ap = NULL;
- return;
- }
- *bpp += i;
- *lenp -= i;
- _map_v4v6_address(*ap, *bpp);
- *ap = *bpp;
- *bpp += IN6ADDRSZ;
- *lenp -= IN6ADDRSZ;
- }
-}
diff --git a/cpukit/libnetworking/libc/ns.3 b/cpukit/libnetworking/libc/ns.3
deleted file mode 100644
index e621ad2d90..0000000000
--- a/cpukit/libnetworking/libc/ns.3
+++ /dev/null
@@ -1,131 +0,0 @@
-.\" Copyright (c) 1986, 1991, 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.
-.\"
-.\" @(#)ns.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt NS 3
-.Os BSD 4.3
-.Sh NAME
-.Nm ns_addr ,
-.Nm ns_ntoa
-.Nd Xerox
-.Tn NS Ns (tm)
-address conversion routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netns/ns.h>
-.Ft struct ns_addr
-.Fn ns_addr "char *cp"
-.Ft char *
-.Fn ns_ntoa "struct ns_addr ns"
-.Sh DESCRIPTION
-The routine
-.Fn ns_addr
-interprets character strings representing
-.Tn XNS
-addresses, returning binary information suitable
-for use in system calls.
-The routine
-.Fn ns_ntoa
-takes
-.Tn XNS
-addresses and returns
-.Tn ASCII
-strings representing the address in a
-notation in common use in the Xerox Development Environment:
-.Bd -filled -offset indent
-<network number>.<host number>.<port number>
-.Ed
-.Pp
-Trailing zero fields are suppressed, and each number is printed in hexadecimal,
-in a format suitable for input to
-.Fn ns_addr .
-Any fields lacking super-decimal digits will have a
-trailing
-.Ql H
-appended.
-.Pp
-Unfortunately, no universal standard exists for representing
-.Tn XNS
-addresses.
-An effort has been made to insure that
-.Fn ns_addr
-be compatible with most formats in common use.
-It will first separate an address into 1 to 3 fields using a single delimiter
-chosen from
-period
-.Ql \&. ,
-colon
-.Ql \&:
-or pound-sign
-.Ql \&# .
-Each field is then examined for byte separators (colon or period).
-If there are byte separators, each subfield separated is taken to be
-a small hexadecimal number, and the entirety is taken as a network-byte-ordered
-quantity to be zero extended in the high-network-order bytes.
-Next, the field is inspected for hyphens, in which case
-the field is assumed to be a number in decimal notation
-with hyphens separating the millenia.
-Next, the field is assumed to be a number:
-It is interpreted
-as hexadecimal if there is a leading
-.Ql 0x
-(as in C),
-a trailing
-.Ql H
-(as in Mesa), or there are any super-decimal digits present.
-It is interpreted as octal is there is a leading
-.Ql 0
-and there are no super-octal digits.
-Otherwise, it is converted as a decimal number.
-.Sh RETURN VALUES
-None. (See
-.Sx BUGS . )
-.Sh SEE ALSO
-.Xr hosts 5 ,
-.Xr networks 5
-.Sh HISTORY
-The
-.Fn ns_addr
-and
-.Fn ns_toa
-functions appeared in
-.Bx 4.3 .
-.Sh BUGS
-The string returned by
-.Fn ns_ntoa
-resides in a static memory area.
-The function
-.Fn ns_addr
-should diagnose improperly formed input, and there should be an unambiguous
-way to recognize this.
diff --git a/cpukit/libnetworking/libc/ns_addr.c b/cpukit/libnetworking/libc/ns_addr.c
deleted file mode 100644
index 18fabe91f1..0000000000
--- a/cpukit/libnetworking/libc/ns_addr.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright (c) 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * J.Q. Johnson.
- *
- * 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ns_addr.c 8.1 (Berkeley) 6/7/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netns/ns.h>
-#include <stdio.h>
-#include <string.h>
-
-static struct ns_addr addr, zero_addr;
-
-static void Field(), cvtbase();
-
-struct ns_addr
-ns_addr(name)
- const char *name;
-{
- char separator;
- char *hostname, *socketname, *cp;
- char buf[50];
-
- (void)strncpy(buf, name, sizeof(buf) - 1);
- buf[sizeof(buf) - 1] = '\0';
-
- /*
- * First, figure out what he intends as a field separtor.
- * Despite the way this routine is written, the prefered
- * form 2-272.AA001234H.01777, i.e. XDE standard.
- * Great efforts are made to insure backward compatability.
- */
- if ((hostname = strchr(buf, '#')) != NULL)
- separator = '#';
- else {
- hostname = strchr(buf, '.');
- if ((cp = strchr(buf, ':')) &&
- ((hostname && cp < hostname) || (hostname == 0))) {
- hostname = cp;
- separator = ':';
- } else
- separator = '.';
- }
- if (hostname)
- *hostname++ = 0;
-
- addr = zero_addr;
- Field(buf, addr.x_net.c_net, 4);
- if (hostname == 0)
- return (addr); /* No separator means net only */
-
- socketname = strchr(hostname, separator);
- if (socketname) {
- *socketname++ = 0;
- Field(socketname, (u_char *)&addr.x_port, 2);
- }
-
- Field(hostname, addr.x_host.c_host, 6);
-
- return (addr);
-}
-
-static void
-Field(buf, out, len)
- char *buf;
- u_char *out;
- int len;
-{
- register char *bp = buf;
- int i, ibase, base16 = 0, base10 = 0, clen = 0;
- int hb[6], *hp;
- char *fmt;
-
- /*
- * first try 2-273#2-852-151-014#socket
- */
- if ((*buf != '-') &&
- (1 < (i = sscanf(buf, "%d-%d-%d-%d-%d",
- &hb[0], &hb[1], &hb[2], &hb[3], &hb[4])))) {
- cvtbase(1000L, 256, hb, i, out, len);
- return;
- }
- /*
- * try form 8E1#0.0.AA.0.5E.E6#socket
- */
- if (1 < (i = sscanf(buf,"%x.%x.%x.%x.%x.%x",
- &hb[0], &hb[1], &hb[2], &hb[3], &hb[4], &hb[5]))) {
- cvtbase(256L, 256, hb, i, out, len);
- return;
- }
- /*
- * try form 8E1#0:0:AA:0:5E:E6#socket
- */
- if (1 < (i = sscanf(buf,"%x:%x:%x:%x:%x:%x",
- &hb[0], &hb[1], &hb[2], &hb[3], &hb[4], &hb[5]))) {
- cvtbase(256L, 256, hb, i, out, len);
- return;
- }
- /*
- * This is REALLY stretching it but there was a
- * comma notation separting shorts -- definitely non standard
- */
- if (1 < (i = sscanf(buf,"%x,%x,%x",
- &hb[0], &hb[1], &hb[2]))) {
- hb[0] = htons(hb[0]); hb[1] = htons(hb[1]);
- hb[2] = htons(hb[2]);
- cvtbase(65536L, 256, hb, i, out, len);
- return;
- }
-
- /* Need to decide if base 10, 16 or 8 */
- while (*bp) switch (*bp++) {
-
- case '0': case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '-':
- break;
-
- case '8': case '9':
- base10 = 1;
- break;
-
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- base16 = 1;
- break;
-
- case 'x': case 'X':
- *--bp = '0';
- base16 = 1;
- break;
-
- case 'h': case 'H':
- base16 = 1;
- /* fall into */
-
- default:
- *--bp = 0; /* Ends Loop */
- }
- if (base16) {
- fmt = "%3x";
- ibase = 4096;
- } else if (base10 == 0 && *buf == '0') {
- fmt = "%3o";
- ibase = 512;
- } else {
- fmt = "%3d";
- ibase = 1000;
- }
-
- for (bp = buf; *bp++; ) clen++;
- if (clen == 0) clen++;
- if (clen > 18) clen = 18;
- i = ((clen - 1) / 3) + 1;
- bp = clen + buf - 3;
- hp = hb + i - 1;
-
- while (hp > hb) {
- (void)sscanf(bp, fmt, hp);
- bp[0] = 0;
- hp--;
- bp -= 3;
- }
- (void)sscanf(buf, fmt, hp);
- cvtbase((long)ibase, 256, hb, i, out, len);
-}
-
-static void
-cvtbase(oldbase,newbase,input,inlen,result,reslen)
- long oldbase;
- int newbase;
- int input[];
- int inlen;
- unsigned char result[];
- int reslen;
-{
- int d, e;
- long sum;
-
- e = 1;
- while (e > 0 && reslen > 0) {
- d = 0; e = 0; sum = 0;
- /* long division: input=input/newbase */
- while (d < inlen) {
- sum = sum*oldbase + (long) input[d];
- e += (sum > 0);
- input[d++] = sum / newbase;
- sum %= newbase;
- }
- result[--reslen] = sum; /* accumulate remainder */
- }
- for (d=0; d < reslen; d++)
- result[d] = 0;
-}
diff --git a/cpukit/libnetworking/libc/ns_name.c b/cpukit/libnetworking/libc/ns_name.c
deleted file mode 100644
index af10d2f062..0000000000
--- a/cpukit/libnetworking/libc/ns_name.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-
-#include <errno.h>
-#include <resolv.h>
-#include <string.h>
-
-/* Data. */
-
-static char digits[] = "0123456789";
-
-/* Forward. */
-
-static int special(int);
-static int printable(int);
-static int dn_find(const u_char *, const u_char *,
- const u_char * const *,
- const u_char * const *);
-
-/* Public. */
-
-/*
- * ns_name_ntop(src, dst, dstsiz)
- * Convert an encoded domain name to printable ascii as per RFC1035.
- * return:
- * Number of bytes written to buffer, or -1 (with errno set)
- * notes:
- * The root is returned as "."
- * All other domains are returned in non absolute form
- */
-int
-ns_name_ntop(const u_char *src, char *dst, size_t dstsiz) {
- const u_char *cp;
- char *dn, *eom;
- u_char c;
- u_int n;
-
- cp = src;
- dn = dst;
- eom = dst + dstsiz;
-
- while ((n = *cp++) != 0) {
- if ((n & NS_CMPRSFLGS) != 0) {
- /* Some kind of compression pointer. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (dn != dst) {
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '.';
- }
- if (dn + n >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- for ((void)NULL; n > 0; n--) {
- c = *cp++;
- if (special(c)) {
- if (dn + 1 >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '\\';
- *dn++ = (char)c;
- } else if (!printable(c)) {
- if (dn + 3 >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '\\';
- *dn++ = digits[c / 100];
- *dn++ = digits[(c % 100) / 10];
- *dn++ = digits[c % 10];
- } else {
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = (char)c;
- }
- }
- }
- if (dn == dst) {
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '.';
- }
- if (dn >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dn++ = '\0';
- return (dn - dst);
-}
-
-/*
- * ns_name_pton(src, dst, dstsiz)
- * Convert a ascii string into an encoded domain name as per RFC1035.
- * return:
- * -1 if it fails
- * 1 if string was fully qualified
- * 0 is string was not fully qualified
- * notes:
- * Enforces label and domain length limits.
- */
-
-int
-ns_name_pton(const char *src, u_char *dst, size_t dstsiz) {
- u_char *label, *bp, *eom;
- int c, n, escaped;
- char *cp;
-
- escaped = 0;
- bp = dst;
- eom = dst + dstsiz;
- label = bp++;
-
- while ((c = *src++) != 0) {
- if (escaped) {
- if ((cp = strchr(digits, c)) != NULL) {
- n = (cp - digits) * 100;
- if ((c = *src++) == 0 ||
- (cp = strchr(digits, c)) == NULL) {
- errno = EMSGSIZE;
- return (-1);
- }
- n += (cp - digits) * 10;
- if ((c = *src++) == 0 ||
- (cp = strchr(digits, c)) == NULL) {
- errno = EMSGSIZE;
- return (-1);
- }
- n += (cp - digits);
- if (n > 255) {
- errno = EMSGSIZE;
- return (-1);
- }
- c = n;
- }
- escaped = 0;
- } else if (c == '\\') {
- escaped = 1;
- continue;
- } else if (c == '.') {
- c = (bp - label - 1);
- if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (label >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *label = c;
- /* Fully qualified ? */
- if (*src == '\0') {
- if (c != 0) {
- if (bp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *bp++ = '\0';
- }
- if ((bp - dst) > MAXCDNAME) {
- errno = EMSGSIZE;
- return (-1);
- }
- return (1);
- }
- if (c == 0) {
- errno = EMSGSIZE;
- return (-1);
- }
- label = bp++;
- continue;
- }
- if (bp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *bp++ = (u_char)c;
- }
- c = (bp - label - 1);
- if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (label >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *label = c;
- if (c != 0) {
- if (bp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *bp++ = 0;
- }
- if ((bp - dst) > MAXCDNAME) { /* src too big */
- errno = EMSGSIZE;
- return (-1);
- }
- return (0);
-}
-
-/*
- * ns_name_unpack(msg, eom, src, dst, dstsiz)
- * Unpack a domain name from a message, source may be compressed.
- * return:
- * -1 if it fails, or consumed octets if it succeeds.
- */
-int
-ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
- u_char *dst, size_t dstsiz)
-{
- const u_char *srcp, *dstlim;
- u_char *dstp;
- int n, len, checked;
-
- len = -1;
- checked = 0;
- dstp = dst;
- srcp = src;
- dstlim = dst + dstsiz;
- if (srcp < msg || srcp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- /* Fetch next label in domain name. */
- while ((n = *srcp++) != 0) {
- /* Check for indirection. */
- switch (n & NS_CMPRSFLGS) {
- case 0:
- /* Limit checks. */
- if (dstp + n + 1 >= dstlim || srcp + n >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- checked += n + 1;
- *dstp++ = n;
- memcpy(dstp, srcp, n);
- dstp += n;
- srcp += n;
- break;
-
- case NS_CMPRSFLGS:
- if (srcp >= eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- if (len < 0)
- len = srcp - src + 1;
- srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff));
- if (srcp < msg || srcp >= eom) { /* Out of range. */
- errno = EMSGSIZE;
- return (-1);
- }
- checked += 2;
- /*
- * Check for loops in the compressed name;
- * if we've looked at the whole message,
- * there must be a loop.
- */
- if (checked >= eom - msg) {
- errno = EMSGSIZE;
- return (-1);
- }
- break;
-
- default:
- errno = EMSGSIZE;
- return (-1); /* flag error */
- }
- }
- *dstp = '\0';
- if (len < 0)
- len = srcp - src;
- return (len);
-}
-
-/*
- * ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr)
- * Pack domain name 'domain' into 'comp_dn'.
- * return:
- * Size of the compressed name, or -1.
- * notes:
- * 'dnptrs' is an array of pointers to previous compressed names.
- * dnptrs[0] is a pointer to the beginning of the message. The array
- * ends with NULL.
- * 'lastdnptr' is a pointer to the end of the array pointed to
- * by 'dnptrs'.
- * Side effects:
- * The list of pointers in dnptrs is updated for labels inserted into
- * the message as we compress the name. If 'dnptr' is NULL, we don't
- * try to compress names. If 'lastdnptr' is NULL, we don't update the
- * list.
- */
-int
-ns_name_pack(const u_char *src, u_char *dst, int dstsiz,
- const u_char **dnptrs, const u_char **lastdnptr)
-{
- u_char *dstp;
- const u_char **cpp, **lpp, *eob, *msg;
- const u_char *srcp;
- int n, l;
-
- srcp = src;
- dstp = dst;
- eob = dstp + dstsiz;
- lpp = cpp = NULL;
- if (dnptrs != NULL) {
- if ((msg = *dnptrs++) != NULL) {
- for (cpp = dnptrs; *cpp != NULL; cpp++)
- (void)NULL;
- lpp = cpp; /* end of list to search */
- }
- } else
- msg = NULL;
-
- /* make sure the domain we are about to add is legal */
- l = 0;
- do {
- n = *srcp;
- if ((n & NS_CMPRSFLGS) != 0) {
- errno = EMSGSIZE;
- return (-1);
- }
- l += n + 1;
- if (l > MAXCDNAME) {
- errno = EMSGSIZE;
- return (-1);
- }
- srcp += n + 1;
- } while (n != 0);
-
- srcp = src;
- do {
- /* Look to see if we can use pointers. */
- n = *srcp;
- if (n != 0 && msg != NULL) {
- l = dn_find(srcp, msg, (const u_char * const *)dnptrs,
- (const u_char * const *)lpp);
- if (l >= 0) {
- if (dstp + 1 >= eob) {
- errno = EMSGSIZE;
- return (-1);
- }
- *dstp++ = (l >> 8) | NS_CMPRSFLGS;
- *dstp++ = l % 256;
- return (dstp - dst);
- }
- /* Not found, save it. */
- if (lastdnptr != NULL && cpp < lastdnptr - 1 &&
- (dstp - msg) < 0x4000) {
- *cpp++ = dstp;
- *cpp = NULL;
- }
- }
- /* copy label to buffer */
- if (n & NS_CMPRSFLGS) { /* Should not happen. */
- errno = EMSGSIZE;
- return (-1);
- }
- if (dstp + 1 + n >= eob) {
- errno = EMSGSIZE;
- return (-1);
- }
- memcpy(dstp, srcp, n + 1);
- srcp += n + 1;
- dstp += n + 1;
- } while (n != 0);
-
- if (dstp > eob) {
- if (msg != NULL)
- *lpp = NULL;
- errno = EMSGSIZE;
- return (-1);
- }
- return (dstp - dst);
-}
-
-/*
- * ns_name_uncompress(msg, eom, src, dst, dstsiz)
- * Expand compressed domain name to presentation format.
- * return:
- * Number of bytes read out of `src', or -1 (with errno set).
- * note:
- * Root domain returns as "." not "".
- */
-int
-ns_name_uncompress(const u_char *msg, const u_char *eom, const u_char *src,
- char *dst, size_t dstsiz)
-{
- u_char tmp[NS_MAXCDNAME];
- int n;
-
- if ((n = ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1)
- return (-1);
- if (ns_name_ntop(tmp, dst, dstsiz) == -1)
- return (-1);
- return (n);
-}
-
-/*
- * ns_name_compress(src, dst, dstsiz, dnptrs, lastdnptr)
- * Compress a domain name into wire format, using compression pointers.
- * return:
- * Number of bytes consumed in `dst' or -1 (with errno set).
- * notes:
- * 'dnptrs' is an array of pointers to previous compressed names.
- * dnptrs[0] is a pointer to the beginning of the message.
- * The list ends with NULL. 'lastdnptr' is a pointer to the end of the
- * array pointed to by 'dnptrs'. Side effect is to update the list of
- * pointers for labels inserted into the message as we compress the name.
- * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr'
- * is NULL, we don't update the list.
- */
-int
-ns_name_compress(const char *src, u_char *dst, size_t dstsiz,
- const u_char **dnptrs, const u_char **lastdnptr)
-{
- u_char tmp[NS_MAXCDNAME];
-
- if (ns_name_pton(src, tmp, sizeof tmp) == -1)
- return (-1);
- return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr));
-}
-
-/*
- * ns_name_skip(ptrptr, eom)
- * Advance *ptrptr to skip over the compressed name it points at.
- * return:
- * 0 on success, -1 (with errno set) on failure.
- */
-int
-ns_name_skip(const u_char **ptrptr, const u_char *eom) {
- const u_char *cp;
- u_int n;
-
- cp = *ptrptr;
- while (cp < eom && (n = *cp++) != 0) {
- /* Check for indirection. */
- switch (n & NS_CMPRSFLGS) {
- case 0: /* normal case, n == len */
- cp += n;
- continue;
- case NS_CMPRSFLGS: /* indirection */
- cp++;
- break;
- default: /* illegal type */
- errno = EMSGSIZE;
- return (-1);
- }
- break;
- }
- if (cp > eom) {
- errno = EMSGSIZE;
- return (-1);
- }
- *ptrptr = cp;
- return (0);
-}
-
-/* Private. */
-
-/*
- * special(ch)
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * is this characted special ("in need of quoting") ?
- * return:
- * boolean.
- */
-static int
-special(int ch) {
- switch (ch) {
- case 0x22: /* '"' */
- case 0x2E: /* '.' */
- case 0x3B: /* ';' */
- case 0x5C: /* '\\' */
- /* Special modifiers in zone files. */
- case 0x40: /* '@' */
- case 0x24: /* '$' */
- return (1);
- default:
- return (0);
- }
-}
-
-/*
- * printable(ch)
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * is this character visible and not a space when printed ?
- * return:
- * boolean.
- */
-static int
-printable(int ch) {
- return (ch > 0x20 && ch < 0x7f);
-}
-
-/*
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * convert this character to lower case if it's upper case.
- */
-static int
-mklower(int ch) {
- if (ch >= 0x41 && ch <= 0x5A)
- return (ch + 0x20);
- return (ch);
-}
-
-/*
- * dn_find(domain, msg, dnptrs, lastdnptr)
- * Search for the counted-label name in an array of compressed names.
- * return:
- * offset from msg if found, or -1.
- * notes:
- * dnptrs is the pointer to the first name on the list,
- * not the pointer to the start of the message.
- */
-static int
-dn_find(const u_char *domain, const u_char *msg,
- const u_char * const *dnptrs,
- const u_char * const *lastdnptr)
-{
- const u_char *dn, *cp, *sp;
- const u_char * const *cpp;
- u_int n;
-
- for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
- dn = domain;
- sp = cp = *cpp;
- while ((n = *cp++) != 0) {
- /*
- * check for indirection
- */
- switch (n & NS_CMPRSFLGS) {
- case 0: /* normal case, n == len */
- if (n != *dn++)
- goto next;
- for ((void)NULL; n > 0; n--)
- if (mklower(*dn++) != mklower(*cp++))
- goto next;
- /* Is next root for both ? */
- if (*dn == '\0' && *cp == '\0')
- return (sp - msg);
- if (*dn)
- continue;
- goto next;
-
- case NS_CMPRSFLGS: /* indirection */
- cp = msg + (((n & 0x3f) << 8) | *cp);
- break;
-
- default: /* illegal type */
- errno = EMSGSIZE;
- return (-1);
- }
- }
- next: ;
- }
- errno = ENOENT;
- return (-1);
-}
diff --git a/cpukit/libnetworking/libc/ns_netint.c b/cpukit/libnetworking/libc/ns_netint.c
deleted file mode 100644
index 3c09da8f8c..0000000000
--- a/cpukit/libnetworking/libc/ns_netint.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/* Import. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-
-u_int
-ns_get16(const u_char *src) {
- u_int dst;
-
- NS_GET16(dst, src);
- return (dst);
-}
-
-u_long
-ns_get32(const u_char *src) {
- u_long dst;
-
- NS_GET32(dst, src);
- return (dst);
-}
-
-void
-ns_put16(u_int src, u_char *dst) {
- NS_PUT16(src, dst);
-}
-
-void
-ns_put32(u_long src, u_char *dst) {
- NS_PUT32(src, dst);
-}
diff --git a/cpukit/libnetworking/libc/ns_ntoa.c b/cpukit/libnetworking/libc/ns_ntoa.c
deleted file mode 100644
index 9d0be2e1dc..0000000000
--- a/cpukit/libnetworking/libc/ns_ntoa.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 1986, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ns_ntoa.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <netns/ns.h>
-#include <stdio.h>
-
-char *
-ns_ntoa(addr)
- struct ns_addr addr;
-{
- static char obuf[40];
- union { union ns_net net_e; u_long long_e; } net;
- u_short port = htons(addr.x_port);
- register char *cp;
- char *cp2;
- register u_char *up = addr.x_host.c_host;
- u_char *uplim = up + 6;
- static char *spectHex();
-
- net.net_e = addr.x_net;
- sprintf(obuf, "%lx", (u_long)ntohl(net.long_e));
- cp = spectHex(obuf);
- cp2 = cp + 1;
- while (*up==0 && up < uplim) up++;
- if (up == uplim) {
- if (port) {
- sprintf(cp, ".0");
- cp += 2;
- }
- } else {
- sprintf(cp, ".%x", *up++);
- while (up < uplim) {
- while (*cp) cp++;
- sprintf(cp, "%02x", *up++);
- }
- cp = spectHex(cp2);
- }
- if (port) {
- sprintf(cp, ".%x", port);
- spectHex(cp + 1);
- }
- return (obuf);
-}
-
-static char *
-spectHex(p0)
- char *p0;
-{
- int ok = 0;
- int nonzero = 0;
- register char *p = p0;
- for (; *p; p++) switch (*p) {
-
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- *p += ('A' - 'a');
- /* fall into . . . */
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- ok = 1;
- case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
- nonzero = 1;
- }
- if (nonzero && !ok) { *p++ = 'H'; *p = 0; }
- return (p);
-}
diff --git a/cpukit/libnetworking/libc/ns_parse.c b/cpukit/libnetworking/libc/ns_parse.c
deleted file mode 100644
index cc1f070156..0000000000
--- a/cpukit/libnetworking/libc/ns_parse.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-
-#include <errno.h>
-#include <resolv.h>
-#include <string.h>
-
-/* These need to be in the same order as the nres.h:ns_flag enum. */
-struct _ns_flagdata _ns_flagdata[16] = {
- { 0x8000, 15 }, /* qr. */
- { 0x7800, 11 }, /* opcode. */
- { 0x0400, 10 }, /* aa. */
- { 0x0200, 9 }, /* tc. */
- { 0x0100, 8 }, /* rd. */
- { 0x0080, 7 }, /* ra. */
- { 0x0040, 6 }, /* z. */
- { 0x0020, 5 }, /* ad. */
- { 0x0010, 4 }, /* cd. */
- { 0x000f, 0 }, /* rcode. */
- { 0x0000, 0 }, /* expansion (1/6). */
- { 0x0000, 0 }, /* expansion (2/6). */
- { 0x0000, 0 }, /* expansion (3/6). */
- { 0x0000, 0 }, /* expansion (4/6). */
- { 0x0000, 0 }, /* expansion (5/6). */
- { 0x0000, 0 }, /* expansion (6/6). */
-};
-
-static int
-skiprr(const u_char *ptr, const u_char *eom, ns_sect section, int count) {
- const u_char *optr = ptr;
-
- for ((void)NULL; count > 0; count--) {
- int b, rdlength;
-
- b = dn_skipname(ptr, eom);
- if (b < 0)
- goto emsgsize;
- ptr += b/*Name*/ + NS_INT16SZ/*Type*/ + NS_INT16SZ/*Class*/;
- if (section != ns_s_qd) {
- if (ptr + NS_INT32SZ > eom)
- goto emsgsize;
- ptr += NS_INT32SZ/*TTL*/;
- if (ptr + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(rdlength, ptr);
- ptr += rdlength/*RData*/;
- }
- }
- if (ptr > eom)
- goto emsgsize;
- return (ptr - optr);
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
-
-int
-ns_initparse(const u_char *msg, int msglen, ns_msg *handle) {
- const u_char *eom = msg + msglen;
- int i;
-
- memset(handle, 0x5e, sizeof *handle);
- handle->_msg = msg;
- handle->_eom = eom;
- if (msg + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(handle->_id, msg);
- if (msg + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(handle->_flags, msg);
- for (i = 0; i < ns_s_max; i++) {
- if (msg + NS_INT16SZ > eom)
- goto emsgsize;
- NS_GET16(handle->_counts[i], msg);
- }
- for (i = 0; i < ns_s_max; i++)
- if (handle->_counts[i] == 0)
- handle->_sections[i] = NULL;
- else {
- int b = skiprr(msg, eom, (ns_sect)i,
- handle->_counts[i]);
-
- if (b < 0)
- return (-1);
- handle->_sections[i] = msg;
- msg += b;
- }
- if (msg != eom)
- goto emsgsize;
- handle->_sect = ns_s_max;
- handle->_rrnum = -1;
- handle->_ptr = NULL;
- return (0);
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
-
-int
-ns_parserr(ns_msg *handle, ns_sect section, int rrnum, ns_rr *rr) {
- int b;
-
- /* Make section right. */
- if (section < 0 || section >= ns_s_max)
- goto enodev;
- if ((int)section != (int)handle->_sect) {
- handle->_sect = section;
- handle->_rrnum = 0;
- handle->_ptr = handle->_sections[(int)section];
- }
-
- /* Make rrnum right. */
- if (rrnum == -1)
- rrnum = handle->_rrnum;
- if (rrnum < 0 || rrnum >= handle->_counts[(int)section])
- goto enodev;
- if (rrnum < handle->_rrnum) {
- handle->_rrnum = 0;
- handle->_ptr = handle->_sections[(int)section];
- }
-
- b = skiprr(handle->_msg, handle->_eom, section,
- rrnum - handle->_rrnum);
- if (b < 0)
- return (-1);
- handle->_ptr += b;
- handle->_rrnum = rrnum;
-
- /* Do the parse. */
- b = dn_expand(handle->_msg, handle->_eom,
- handle->_ptr, rr->name, NS_MAXDNAME);
- if (b < 0)
- return (-1);
- handle->_ptr += b;
- if (handle->_ptr + NS_INT16SZ > handle->_eom)
- goto emsgsize;
- NS_GET16(rr->type, handle->_ptr);
- if (handle->_ptr + NS_INT16SZ > handle->_eom)
- goto emsgsize;
- NS_GET16(rr->class, handle->_ptr);
- if (section == ns_s_qd) {
- rr->ttl = 0;
- rr->rdlength = 0;
- rr->rdata = NULL;
- } else {
- if (handle->_ptr + NS_INT32SZ > handle->_eom)
- goto emsgsize;
- NS_GET32(rr->ttl, handle->_ptr);
- if (handle->_ptr + NS_INT16SZ > handle->_eom)
- goto emsgsize;
- NS_GET16(rr->rdlength, handle->_ptr);
- if (handle->_ptr + rr->rdlength > handle->_eom)
- goto emsgsize;
- rr->rdata = handle->_ptr;
- handle->_ptr += rr->rdlength;
- }
- handle->_rrnum++;
-
- /* All done. */
- return (0);
- enodev:
- errno = ENODEV;
- return (-1);
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
diff --git a/cpukit/libnetworking/libc/ns_print.c b/cpukit/libnetworking/libc/ns_print.c
deleted file mode 100644
index f7d7d16c64..0000000000
--- a/cpukit/libnetworking/libc/ns_print.c
+++ /dev/null
@@ -1,745 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/* Import. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <assert.h>
-#include <errno.h>
-#include <resolv.h>
-#include <string.h>
-#include <ctype.h>
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-/* Forward. */
-
-static size_t prune_origin(const char *name, const char *origin);
-static int charstr(const u_char *rdata, const u_char *edata,
- char **buf, size_t *buflen);
-static int addname(const u_char *msg, size_t msglen,
- const u_char **p, const char *origin,
- char **buf, size_t *buflen);
-static void addlen(size_t len, char **buf, size_t *buflen);
-static int addstr(const char *src, size_t len,
- char **buf, size_t *buflen);
-static int addtab(size_t len, size_t target, int spaced,
- char **buf, size_t *buflen);
-
-/* Macros. */
-
-#define T(x) \
- do { \
- if ((x) < 0) \
- return (-1); \
- } while (0)
-
-/* Public. */
-
-/*
- * int
- * ns_sprintrr(handle, rr, name_ctx, origin, buf, buflen)
- * Convert an RR to presentation format.
- * return:
- * Number of characters written to buf, or -1 (check errno).
- */
-int
-ns_sprintrr(const ns_msg *handle, const ns_rr *rr,
- const char *name_ctx, const char *origin,
- char *buf, size_t buflen)
-{
- int n;
-
- n = ns_sprintrrf(ns_msg_base(*handle), ns_msg_size(*handle),
- ns_rr_name(*rr), ns_rr_class(*rr), ns_rr_type(*rr),
- ns_rr_ttl(*rr), ns_rr_rdata(*rr), ns_rr_rdlen(*rr),
- name_ctx, origin, buf, buflen);
- return (n);
-}
-
-/*
- * int
- * ns_sprintrrf(msg, msglen, name, class, type, ttl, rdata, rdlen,
- * name_ctx, origin, buf, buflen)
- * Convert the fields of an RR into presentation format.
- * return:
- * Number of characters written to buf, or -1 (check errno).
- */
-int
-ns_sprintrrf(const u_char *msg, size_t msglen,
- const char *name, ns_class class, ns_type type,
- u_long ttl, const u_char *rdata, size_t rdlen,
- const char *name_ctx, const char *origin,
- char *buf, size_t buflen)
-{
- const char *obuf = buf;
- const u_char *edata = rdata + rdlen;
- int spaced = 0;
-
- const char *comment;
- char tmp[100];
- int len, x;
-
- /*
- * Owner.
- */
- if (name_ctx != NULL && strcasecmp(name_ctx, name) == 0) {
- T(addstr("\t\t\t", 3, &buf, &buflen));
- } else {
- len = prune_origin(name, origin);
- if (len == 0) {
- T(addstr("@\t\t\t", 4, &buf, &buflen));
- } else {
- T(addstr(name, len, &buf, &buflen));
- /* Origin not used and no trailing dot? */
- if ((!origin || !origin[0] || name[len] == '\0') &&
- name[len - 1] != '.') {
- T(addstr(".", 1, &buf, &buflen));
- len++;
- }
- T(spaced = addtab(len, 24, spaced, &buf, &buflen));
- }
- }
-
- /*
- * TTL, Class, Type.
- */
- T(x = ns_format_ttl(ttl, buf, buflen));
- addlen(x, &buf, &buflen);
- len = SPRINTF((tmp, " %s %s", p_class(class), p_type(type)));
- T(addstr(tmp, len, &buf, &buflen));
- T(spaced = addtab(x + len, 16, spaced, &buf, &buflen));
-
- /*
- * RData.
- */
- switch (type) {
- case ns_t_a:
- if (rdlen != NS_INADDRSZ)
- goto formerr;
- (void) inet_ntop(AF_INET, rdata, buf, buflen);
- addlen(strlen(buf), &buf, &buflen);
- break;
-
- case ns_t_cname:
- case ns_t_mb:
- case ns_t_mg:
- case ns_t_mr:
- case ns_t_ns:
- case ns_t_ptr:
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- break;
-
- case ns_t_hinfo:
- case ns_t_isdn:
- /* First word. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Second word. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- break;
-
- case ns_t_soa: {
- u_long t;
-
- /* Server name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Administrator name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" (\n", 3, &buf, &buflen));
- spaced = 0;
-
- if ((edata - rdata) != 5*NS_INT32SZ)
- goto formerr;
-
- /* Serial number. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- len = SPRINTF((tmp, "%lu", t));
- T(addstr(tmp, len, &buf, &buflen));
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; serial\n", 9, &buf, &buflen));
- spaced = 0;
-
- /* Refresh interval. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; refresh\n", 10, &buf, &buflen));
- spaced = 0;
-
- /* Retry interval. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; retry\n", 8, &buf, &buflen));
- spaced = 0;
-
- /* Expiry. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; expiry\n", 9, &buf, &buflen));
- spaced = 0;
-
- /* Minimum TTL. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
- T(len = ns_format_ttl(t, buf, buflen));
- addlen(len, &buf, &buflen);
- T(addstr(" )", 2, &buf, &buflen));
- T(spaced = addtab(len, 16, spaced, &buf, &buflen));
- T(addstr("; minimum\n", 10, &buf, &buflen));
-
- break;
- }
-
- case ns_t_mx:
- case ns_t_afsdb:
- case ns_t_rt: {
- u_int t;
-
- if (rdlen < NS_INT16SZ)
- goto formerr;
-
- /* Priority. */
- t = ns_get16(rdata);
- rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", t));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Target. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- break;
- }
-
- case ns_t_px: {
- u_int t;
-
- if (rdlen < NS_INT16SZ)
- goto formerr;
-
- /* Priority. */
- t = ns_get16(rdata);
- rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", t));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Name1. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Name2. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- break;
- }
-
- case ns_t_x25:
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- break;
-
- case ns_t_txt:
- while (rdata < edata) {
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- if (rdata < edata)
- T(addstr(" ", 1, &buf, &buflen));
- }
- break;
-
- case ns_t_nsap: {
- char t[255*3];
-
- (void) inet_nsap_ntoa(rdlen, rdata, t);
- T(addstr(t, strlen(t), &buf, &buflen));
- break;
- }
-
- case ns_t_aaaa:
- if (rdlen != NS_IN6ADDRSZ)
- goto formerr;
- (void) inet_ntop(AF_INET6, rdata, buf, buflen);
- addlen(strlen(buf), &buf, &buflen);
- break;
-
- case ns_t_loc: {
- char t[255];
-
- /* XXX protocol format checking? */
- (void) loc_ntoa(rdata, t);
- T(addstr(t, strlen(t), &buf, &buflen));
- break;
- }
-
- case ns_t_naptr: {
- u_int order, preference;
- char t[50];
-
- if (rdlen < 2*NS_INT16SZ)
- goto formerr;
-
- /* Order, Precedence. */
- order = ns_get16(rdata); rdata += NS_INT16SZ;
- preference = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((t, "%u %u ", order, preference));
- T(addstr(t, len, &buf, &buflen));
-
- /* Flags. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Service. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Regexp. */
- T(len = charstr(rdata, edata, &buf, &buflen));
- if (len < 0)
- return (-1);
- if (len == 0)
- goto formerr;
- rdata += len;
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Server. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- break;
- }
-
- case ns_t_srv: {
- u_int priority, weight, port;
- char t[50];
-
- if (rdlen < NS_INT16SZ*3)
- goto formerr;
-
- /* Priority, Weight, Port. */
- priority = ns_get16(rdata); rdata += NS_INT16SZ;
- weight = ns_get16(rdata); rdata += NS_INT16SZ;
- port = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((t, "%u %u %u ", priority, weight, port));
- T(addstr(t, len, &buf, &buflen));
-
- /* Server. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- break;
- }
-
- case ns_t_minfo:
- case ns_t_rp:
- /* Name1. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
- T(addstr(" ", 1, &buf, &buflen));
-
- /* Name2. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- break;
-
- case ns_t_wks: {
- int n, lcnt;
-
- if (rdlen < NS_INT32SZ + 1)
- goto formerr;
-
- /* Address. */
- (void) inet_ntop(AF_INET, rdata, buf, buflen);
- addlen(strlen(buf), &buf, &buflen);
- rdata += NS_INADDRSZ;
-
- /* Protocol. */
- len = SPRINTF((tmp, " %u ( ", *rdata));
- T(addstr(tmp, len, &buf, &buflen));
- rdata += NS_INT8SZ;
-
- /* Bit map. */
- n = 0;
- lcnt = 0;
- while (rdata < edata) {
- u_int c = *rdata++;
- do {
- if (c & 0200) {
- if (lcnt == 0) {
- T(addstr("\n\t\t\t\t", 5,
- &buf, &buflen));
- lcnt = 10;
- spaced = 0;
- }
- len = SPRINTF((tmp, "%d ", n));
- T(addstr(tmp, len, &buf, &buflen));
- lcnt--;
- }
- c <<= 1;
- } while (++n & 07);
- }
- T(addstr(")", 1, &buf, &buflen));
-
- break;
- }
-
- case ns_t_key: {
- char base64_key[NS_MD5RSA_MAX_BASE64];
- u_int keyflags, protocol, algorithm;
- const char *leader;
- int n;
-
- if (rdlen < NS_INT16SZ + NS_INT8SZ + NS_INT8SZ)
- goto formerr;
-
- /* Key flags, Protocol, Algorithm. */
- keyflags = ns_get16(rdata); rdata += NS_INT16SZ;
- protocol = *rdata++;
- algorithm = *rdata++;
- len = SPRINTF((tmp, "0x%04x %u %u",
- keyflags, protocol, algorithm));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Public key data. */
- len = b64_ntop(rdata, edata - rdata,
- base64_key, sizeof base64_key);
- if (len < 0)
- goto formerr;
- if (len > 15) {
- T(addstr(" (", 2, &buf, &buflen));
- leader = "\n\t\t";
- spaced = 0;
- } else
- leader = " ";
- for (n = 0; n < len; n += 48) {
- T(addstr(leader, strlen(leader), &buf, &buflen));
- T(addstr(base64_key + n, MIN(len - n, 48),
- &buf, &buflen));
- }
- if (len > 15)
- T(addstr(" )", 2, &buf, &buflen));
-
- break;
- }
-
- case ns_t_sig: {
- char base64_key[NS_MD5RSA_MAX_BASE64];
- u_int type, algorithm, labels, footprint;
- const char *leader;
- u_long t;
- int n;
-
- if (rdlen < 22)
- goto formerr;
-
- /* Type covered, Algorithm, Label count, Original TTL. */
- type = ns_get16(rdata); rdata += NS_INT16SZ;
- algorithm = *rdata++;
- labels = *rdata++;
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, " %s %d %lu ",
- p_type(type), algorithm, t));
- T(addstr(tmp, len, &buf, &buflen));
- if (labels != (u_int)dn_count_labels(name))
- goto formerr;
-
- /* Signature expiry. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s ", p_secstodate(t)));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Time signed. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s ", p_secstodate(t)));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Signature Footprint. */
- footprint = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", footprint));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Signer's name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- /* Signature. */
- len = b64_ntop(rdata, edata - rdata,
- base64_key, sizeof base64_key);
- if (len > 15) {
- T(addstr(" (", 2, &buf, &buflen));
- leader = "\n\t\t";
- spaced = 0;
- } else
- leader = " ";
- if (len < 0)
- goto formerr;
- for (n = 0; n < len; n += 48) {
- T(addstr(leader, strlen(leader), &buf, &buflen));
- T(addstr(base64_key + n, MIN(len - n, 48),
- &buf, &buflen));
- }
- if (len > 15)
- T(addstr(" )", 2, &buf, &buflen));
-
- break;
- }
-
- case ns_t_nxt: {
- int n, c;
-
- /* Next domain name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- /* Type bit map. */
- n = edata - rdata;
- for (c = 0; c < n*8; c++)
- if (NS_NXT_BIT_ISSET(c, rdata)) {
- len = SPRINTF((tmp, " %s", p_type(c)));
- T(addstr(tmp, len, &buf, &buflen));
- }
- break;
- }
-
- default:
- comment = "unknown RR type";
- goto hexify;
- }
- return (buf - obuf);
- formerr:
- comment = "RR format error";
- hexify: {
- int n, m;
- char *p;
-
- len = SPRINTF((tmp, "\\#(\t\t; %s", comment));
- T(addstr(tmp, len, &buf, &buflen));
- while (rdata < edata) {
- p = tmp;
- p += SPRINTF((p, "\n\t"));
- spaced = 0;
- n = MIN(16, edata - rdata);
- for (m = 0; m < n; m++)
- p += SPRINTF((p, "%02x ", rdata[m]));
- T(addstr(tmp, p - tmp, &buf, &buflen));
- if (n < 16) {
- T(addstr(")", 1, &buf, &buflen));
- T(addtab(p - tmp + 1, 48, spaced, &buf, &buflen));
- }
- p = tmp;
- p += SPRINTF((p, "; "));
- for (m = 0; m < n; m++)
- *p++ = (isascii(rdata[m]) && isprint(rdata[m]))
- ? rdata[m]
- : '.';
- T(addstr(tmp, p - tmp, &buf, &buflen));
- rdata += n;
- }
- return (buf - obuf);
- }
-}
-
-/* Private. */
-
-/*
- * size_t
- * prune_origin(name, origin)
- * Find out if the name is at or under the current origin.
- * return:
- * Number of characters in name before start of origin,
- * or length of name if origin does not match.
- * notes:
- * This function should share code with samedomain().
- */
-static size_t
-prune_origin(const char *name, const char *origin) {
- const char *oname = name;
-
- while (*name != '\0') {
- if (origin != NULL && strcasecmp(name, origin) == 0)
- return (name - oname - (name > oname));
- while (*name != '\0') {
- if (*name == '\\') {
- name++;
- /* XXX need to handle \nnn form. */
- if (*name == '\0')
- break;
- } else if (*name == '.') {
- name++;
- break;
- }
- name++;
- }
- }
- return (name - oname);
-}
-
-/*
- * int
- * charstr(rdata, edata, buf, buflen)
- * Format a <character-string> into the presentation buffer.
- * return:
- * Number of rdata octets consumed
- * 0 for protocol format error
- * -1 for output buffer error
- * side effects:
- * buffer is advanced on success.
- */
-static int
-charstr(const u_char *rdata, const u_char *edata, char **buf, size_t *buflen) {
- const u_char *odata = rdata;
- size_t save_buflen = *buflen;
- char *save_buf = *buf;
-
- if (addstr("\"", 1, buf, buflen) < 0)
- goto enospc;
- if (rdata < edata) {
- int n = *rdata;
-
- if (rdata + 1 + n <= edata) {
- rdata++;
- while (n-- > 0) {
- if (strchr("\n\"\\", *rdata) != NULL)
- if (addstr("\\", 1, buf, buflen) < 0)
- goto enospc;
- if (addstr((const char *)rdata, 1,
- buf, buflen) < 0)
- goto enospc;
- rdata++;
- }
- }
- }
- if (addstr("\"", 1, buf, buflen) < 0)
- goto enospc;
- return (rdata - odata);
- enospc:
- errno = ENOSPC;
- *buf = save_buf;
- *buflen = save_buflen;
- return (-1);
-}
-
-static int
-addname(const u_char *msg, size_t msglen,
- const u_char **pp, const char *origin,
- char **buf, size_t *buflen)
-{
- size_t newlen, save_buflen = *buflen;
- char *save_buf = *buf;
- int n;
-
- n = dn_expand(msg, msg + msglen, *pp, *buf, *buflen);
- if (n < 0)
- goto enospc; /* Guess. */
- newlen = prune_origin(*buf, origin);
- if ((origin == NULL || origin[0] == '\0' || (*buf)[newlen] == '\0') &&
- (newlen == 0 || (*buf)[newlen - 1] != '.')) {
- /* No trailing dot. */
- if (newlen + 2 > *buflen)
- goto enospc; /* No room for ".\0". */
- (*buf)[newlen++] = '.';
- (*buf)[newlen] = '\0';
- }
- if (newlen == 0) {
- /* Use "@" instead of name. */
- if (newlen + 2 > *buflen)
- goto enospc; /* No room for "@\0". */
- (*buf)[newlen++] = '@';
- (*buf)[newlen] = '\0';
- }
- *pp += n;
- addlen(newlen, buf, buflen);
- **buf = '\0';
- return (newlen);
- enospc:
- errno = ENOSPC;
- *buf = save_buf;
- *buflen = save_buflen;
- return (-1);
-}
-
-static void
-addlen(size_t len, char **buf, size_t *buflen) {
- assert(len <= *buflen);
- *buf += len;
- *buflen -= len;
-}
-
-static int
-addstr(const char *src, size_t len, char **buf, size_t *buflen) {
- if (len > *buflen) {
- errno = ENOSPC;
- return (-1);
- }
- memcpy(*buf, src, len);
- addlen(len, buf, buflen);
- **buf = '\0';
- return (0);
-}
-
-static int
-addtab(size_t len, size_t target, int spaced, char **buf, size_t *buflen) {
- size_t save_buflen = *buflen;
- char *save_buf = *buf;
- int t;
-
- if (spaced || len >= target - 1) {
- T(addstr(" ", 2, buf, buflen));
- spaced = 1;
- } else {
- for (t = (target - len - 1) / 8; t >= 0; t--)
- if (addstr("\t", 1, buf, buflen) < 0) {
- *buflen = save_buflen;
- *buf = save_buf;
- return (-1);
- }
- spaced = 0;
- }
- return (spaced);
-}
diff --git a/cpukit/libnetworking/libc/ns_ttl.c b/cpukit/libnetworking/libc/ns_ttl.c
deleted file mode 100644
index 75093c1dbc..0000000000
--- a/cpukit/libnetworking/libc/ns_ttl.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(__rtems__)
-#if !defined(LINT) && !defined(CODECENTER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/* Import. */
-
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#define SPRINTF(x) ((size_t)sprintf x)
-
-/* Forward. */
-
-static int fmt1(int t, char s, char **buf, size_t *buflen);
-
-/* Macros. */
-
-#define T(x) if ((x) < 0) return (-1); else (void)NULL
-
-/* Public. */
-
-int
-ns_format_ttl(u_long src, char *dst, size_t dstlen) {
- char *odst = dst;
- int secs, mins, hours, days, weeks, x;
- char *p;
-
- secs = src % 60; src /= 60;
- mins = src % 60; src /= 60;
- hours = src % 24; src /= 24;
- days = src % 7; src /= 7;
- weeks = src; src = 0;
-
- x = 0;
- if (weeks) {
- T(fmt1(weeks, 'W', &dst, &dstlen));
- x++;
- }
- if (days) {
- T(fmt1(days, 'D', &dst, &dstlen));
- x++;
- }
- if (hours) {
- T(fmt1(hours, 'H', &dst, &dstlen));
- x++;
- }
- if (mins) {
- T(fmt1(mins, 'M', &dst, &dstlen));
- x++;
- }
- if (secs || !(weeks || days || hours || mins)) {
- T(fmt1(secs, 'S', &dst, &dstlen));
- x++;
- }
-
- if (x > 1) {
- int ch;
-
- for (p = odst; (ch = *p) != '\0'; p++)
- if (isascii(ch) && isupper(ch))
- *p = tolower(ch);
- }
-
- return (dst - odst);
-}
-
-int
-ns_parse_ttl(const char *src, u_long *dst) {
- u_long ttl, tmp;
- int ch, digits, dirty;
-
- ttl = 0;
- tmp = 0;
- digits = 0;
- dirty = 0;
- while ((ch = *src++) != '\0') {
- if (!isascii(ch) || !isprint(ch))
- goto einval;
- if (isdigit(ch)) {
- tmp *= 10;
- tmp += (ch - '0');
- digits++;
- continue;
- }
- if (digits == 0)
- goto einval;
- if (islower(ch))
- ch = toupper(ch);
- switch (ch) {
- case 'W': tmp *= 7;
- case 'D': tmp *= 24;
- case 'H': tmp *= 60;
- case 'M': tmp *= 60;
- case 'S': break;
- default: goto einval;
- }
- ttl += tmp;
- tmp = 0;
- digits = 0;
- dirty = 1;
- }
- if (digits > 0) {
- if (dirty)
- goto einval;
- else
- ttl += tmp;
- }
- *dst = ttl;
- return (0);
-
- einval:
- errno = EINVAL;
- return (-1);
-}
-
-/* Private. */
-
-static int
-fmt1(int t, char s, char **buf, size_t *buflen) {
- char tmp[50];
- size_t len;
-
- len = SPRINTF((tmp, "%d%c", t, s));
- if (len + 1 > *buflen)
- return (-1);
- strcpy(*buf, tmp);
- *buf += len;
- *buflen -= len;
- return (0);
-}
diff --git a/cpukit/libnetworking/libc/nsap_addr.c b/cpukit/libnetworking/libc/nsap_addr.c
deleted file mode 100644
index a7af57a266..0000000000
--- a/cpukit/libnetworking/libc/nsap_addr.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-
-static char
-xtob(c)
- register int c;
-{
- return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
-}
-
-u_int
-inet_nsap_addr(ascii, binary, maxlen)
- const char *ascii;
- u_char *binary;
- int maxlen;
-{
- u_char c, nib;
- u_int len = 0;
-
- while ((c = *ascii++) != '\0' && len < (u_int)maxlen) {
- if (c == '.' || c == '+' || c == '/')
- continue;
- if (!isascii(c))
- return (0);
- if (islower(c))
- c = toupper(c);
- if (isxdigit(c)) {
- nib = xtob(c);
- c = *ascii++;
- if (c != '\0') {
- c = toupper(c);
- if (isxdigit(c)) {
- *binary++ = (nib << 4) | xtob(c);
- len++;
- } else
- return (0);
- }
- else
- return (0);
- }
- else
- return (0);
- }
- return (len);
-}
-
-char *
-inet_nsap_ntoa(binlen, binary, ascii)
- int binlen;
- register const u_char *binary;
- register char *ascii;
-{
- register int nib;
- int i;
- static char tmpbuf[255*3];
- char *start;
-
- if (ascii)
- start = ascii;
- else {
- ascii = tmpbuf;
- start = tmpbuf;
- }
-
- if (binlen > 255)
- binlen = 255;
-
- for (i = 0; i < binlen; i++) {
- nib = *binary >> 4;
- *ascii++ = nib + (nib < 10 ? '0' : '7');
- nib = *binary++ & 0x0f;
- *ascii++ = nib + (nib < 10 ? '0' : '7');
- if (((i % 2) == 0 && (i + 1) < binlen))
- *ascii++ = '.';
- }
- *ascii = '\0';
- return (start);
-}
diff --git a/cpukit/libnetworking/libc/rcmd.3 b/cpukit/libnetworking/libc/rcmd.3
deleted file mode 100644
index e25057fa4e..0000000000
--- a/cpukit/libnetworking/libc/rcmd.3
+++ /dev/null
@@ -1,204 +0,0 @@
-.\" Copyright (c) 1983, 1991, 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.
-.\"
-.\" From: @(#)rcmd.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd February 15, 1996
-.Dt RCMD 3
-.Os BSD 4.2
-.Sh NAME
-.Nm rcmd ,
-.Nm rresvport ,
-.Nm iruserok ,
-.Nm ruserok
-.Nd routines for returning a stream to a remote command
-.Sh SYNOPSIS
-.Fd #include <unistd.h>
-.Ft int
-.Fn rcmd "char **ahost" "int inport" "const char *locuser" "const char *remuser" "const char *cmd" "int *fd2p"
-.Ft int
-.Fn rresvport "int *port"
-.Ft int
-.Fn iruserok "u_long raddr" "int superuser" "const char *ruser" "const char *luser"
-.Ft int
-.Fn ruserok "const char *rhost" "int superuser" "const char *ruser" "const char *luser"
-.Sh DESCRIPTION
-The
-.Fn rcmd
-function
-is used by the super-user to execute a command on
-a remote machine using an authentication scheme based
-on reserved port numbers.
-The
-.Fn rresvport
-function
-returns a descriptor to a socket
-with an address in the privileged port space.
-The
-.Fn ruserok
-function
-is used by servers
-to authenticate clients requesting service with
-.Fn rcmd .
-All three functions are present in the same file and are used
-by the
-.Xr rshd 8
-server (among others).
-.Pp
-The
-.Fn rcmd
-function
-looks up the host
-.Fa *ahost
-using
-.Xr gethostbyname 3 ,
-returning \-1 if the host does not exist.
-Otherwise
-.Fa *ahost
-is set to the standard name of the host
-and a connection is established to a server
-residing at the well-known Internet port
-.Fa inport .
-.Pp
-If the connection succeeds,
-a socket in the Internet domain of type
-.Dv SOCK_STREAM
-is returned to the caller, and given to the remote
-command as
-.Em stdin
-and
-.Em stdout .
-If
-.Fa fd2p
-is non-zero, then an auxiliary channel to a control
-process will be set up, and a descriptor for it will be placed
-in
-.Fa *fd2p .
-The control process will return diagnostic
-output from the command (unit 2) on this channel, and will also
-accept bytes on this channel as being
-.Tn UNIX
-signal numbers, to be
-forwarded to the process group of the command.
-If
-.Fa fd2p
-is 0, then the
-.Em stderr
-(unit 2 of the remote
-command) will be made the same as the
-.Em stdout
-and no
-provision is made for sending arbitrary signals to the remote process,
-although you may be able to get its attention by using out-of-band data.
-.Pp
-The protocol is described in detail in
-.Xr rshd 8 .
-.Pp
-The
-.Fn rresvport
-function is used to obtain a socket with a privileged
-address bound to it. This socket is suitable for use
-by
-.Fn rcmd
-and several other functions. Privileged Internet ports are those
-in the range 0 to 1023. Only the super-user
-is allowed to bind an address of this sort to a socket.
-.Pp
-The
-.Fn iruserok
-and
-.Fn ruserok
-functions take a remote host's IP address or name, as returned by the
-.Xr gethostbyname 3
-routines, two user names and a flag indicating whether the local user's
-name is that of the super-user.
-Then, if the user is
-.Em NOT
-the super-user, it checks the
-.Pa /etc/hosts.equiv
-file.
-If that lookup is not done, or is unsuccessful, the
-.Pa .rhosts
-in the local user's home directory is checked to see if the request for
-service is allowed.
-.Pp
-If this file does not exist, is not a regular file, is owned by anyone
-other than the user or the super-user, or is writable by anyone other
-than the owner, the check automatically fails.
-Zero is returned if the machine name is listed in the
-.Dq Pa hosts.equiv
-file, or the host and remote user name are found in the
-.Dq Pa .rhosts
-file; otherwise
-.Fn iruserok
-and
-.Fn ruserok
-return \-1.
-If the local domain (as obtained from
-.Xr gethostname 3 )
-is the same as the remote domain, only the machine name need be specified.
-.Pp
-The
-.Fn iruserok
-function is strongly preferred for security reasons.
-It requires trusting the local DNS at most, while the
-.Fn ruserok
-function requires trusting the entire DNS, which can be spoofed.
-.Sh DIAGNOSTICS
-The
-.Fn rcmd
-function
-returns a valid socket descriptor on success.
-It returns \-1 on error and prints a diagnostic message on the standard error.
-.Pp
-The
-.Fn rresvport
-function
-returns a valid, bound socket descriptor on success.
-It returns \-1 on error with the global value
-.Va errno
-set according to the reason for failure.
-The error code
-.Dv EAGAIN
-is overloaded to mean ``All network ports in use.''
-.Sh SEE ALSO
-.Xr rlogin 1 ,
-.Xr rsh 1 ,
-.Xr intro 2 ,
-.Xr rexec 3 ,
-.Xr rexecd 8 ,
-.Xr rlogind 8 ,
-.Xr rshd 8
-.Sh HISTORY
-These
-functions appeared in
-.Bx 4.2 .
diff --git a/cpukit/libnetworking/libc/rcmd.c b/cpukit/libnetworking/libc/rcmd.c
deleted file mode 100644
index 32e4953e9b..0000000000
--- a/cpukit/libnetworking/libc/rcmd.c
+++ /dev/null
@@ -1,520 +0,0 @@
-/*
- * Copyright (c) 1983, 1993, 1994
- * 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <signal.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <unistd.h>
-#include <pwd.h>
-#include <errno.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#ifdef YP
-#include <rpc/rpc.h>
-#include <rpcsvc/yp_prot.h>
-#include <rpcsvc/ypclnt.h>
-#endif
-
-extern int innetgr __P(( const char *, const char *, const char *, const char * ));
-
-#define max(a, b) ((a > b) ? a : b)
-
-int __ivaliduser __P((FILE *, u_long, const char *, const char *));
-static int __icheckhost __P((u_long, char *));
-
-int
-rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
- char **ahost;
- u_short rport;
- const char *locuser, *remuser, *cmd;
- int *fd2p;
-{
- struct hostent *hp;
- struct sockaddr_in sin, from;
- fd_set reads;
- long oldmask;
- pid_t pid;
- int s, lport, timo;
- char c;
-
- pid = getpid();
- hp = gethostbyname(*ahost);
- if (hp == NULL) {
- herror(*ahost);
- return (-1);
- }
- *ahost = hp->h_name;
- oldmask = sigblock(sigmask(SIGURG));
- for (timo = 1, lport = IPPORT_RESERVED - 1;;) {
- s = rresvport(&lport);
- if (s < 0) {
- if (errno == EAGAIN)
- (void)fprintf(stderr,
- "rcmd: socket: All ports in use\n");
- else
- (void)fprintf(stderr, "rcmd: socket: %s\n",
- strerror(errno));
- sigsetmask(oldmask);
- return (-1);
- }
- fcntl(s, F_SETOWN, pid);
- bzero(&sin, sizeof sin);
- sin.sin_len = sizeof(struct sockaddr_in);
- sin.sin_family = hp->h_addrtype;
- sin.sin_port = rport;
- bcopy(hp->h_addr_list[0], &sin.sin_addr, MIN(hp->h_length, sizeof sin.sin_addr));
- if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
- break;
- (void)close(s);
- if (errno == EADDRINUSE) {
- lport--;
- continue;
- }
- if (errno == ECONNREFUSED && timo <= 16) {
- (void)sleep(timo);
- timo *= 2;
- continue;
- }
- if (hp->h_addr_list[1] != NULL) {
- int oerrno = errno;
-
- (void)fprintf(stderr, "connect to address %s: ",
- inet_ntoa(sin.sin_addr));
- errno = oerrno;
- perror(0);
- hp->h_addr_list++;
- bcopy(hp->h_addr_list[0], &sin.sin_addr, MIN(hp->h_length, sizeof sin.sin_addr));
- (void)fprintf(stderr, "Trying %s...\n",
- inet_ntoa(sin.sin_addr));
- continue;
- }
- (void)fprintf(stderr, "%s: %s\n", hp->h_name, strerror(errno));
- sigsetmask(oldmask);
- return (-1);
- }
- lport--;
- if (fd2p == 0) {
- write(s, "", 1);
- lport = 0;
- } else {
- char num[8];
- int s2 = rresvport(&lport), s3;
- int len = sizeof(from);
- int nfds;
-
- if (s2 < 0)
- goto bad;
- listen(s2, 1);
- (void)snprintf(num, sizeof(num), "%d", lport);
- if (write(s, num, strlen(num)+1) != strlen(num)+1) {
- (void)fprintf(stderr,
- "rcmd: write (setting up stderr): %s\n",
- strerror(errno));
- (void)close(s2);
- goto bad;
- }
- nfds = max(s, s2)+1;
- if(nfds > FD_SETSIZE) {
- fprintf(stderr, "rcmd: too many files\n");
- (void)close(s2);
- goto bad;
- }
-again:
- FD_ZERO(&reads);
- FD_SET(s, &reads);
- FD_SET(s2, &reads);
- errno = 0;
- if (select(nfds, &reads, 0, 0, 0) < 1 || !FD_ISSET(s2, &reads)){
- if (errno != 0)
- (void)fprintf(stderr,
- "rcmd: select (setting up stderr): %s\n",
- strerror(errno));
- else
- (void)fprintf(stderr,
- "select: protocol failure in circuit setup\n");
- (void)close(s2);
- goto bad;
- }
- s3 = accept(s2, (struct sockaddr *)&from, &len);
- /*
- * XXX careful for ftp bounce attacks. If discovered, shut them
- * down and check for the real auxiliary channel to connect.
- */
- if (from.sin_family == AF_INET && from.sin_port == htons(20)) {
- close(s3);
- goto again;
- }
- (void)close(s2);
- if (s3 < 0) {
- (void)fprintf(stderr,
- "rcmd: accept: %s\n", strerror(errno));
- lport = 0;
- goto bad;
- }
- *fd2p = s3;
- from.sin_port = ntohs((u_short)from.sin_port);
- if (from.sin_family != AF_INET ||
- from.sin_port >= IPPORT_RESERVED ||
- from.sin_port < IPPORT_RESERVED / 2) {
- (void)fprintf(stderr,
- "socket: protocol failure in circuit setup.\n");
- goto bad2;
- }
- }
- (void)write(s, locuser, strlen(locuser)+1);
- (void)write(s, remuser, strlen(remuser)+1);
- (void)write(s, cmd, strlen(cmd)+1);
- if (read(s, &c, 1) != 1) {
- (void)fprintf(stderr,
- "rcmd: %s: %s\n", *ahost, strerror(errno));
- goto bad2;
- }
- if (c != 0) {
- while (read(s, &c, 1) == 1) {
- (void)write(STDERR_FILENO, &c, 1);
- if (c == '\n')
- break;
- }
- goto bad2;
- }
- sigsetmask(oldmask);
- return (s);
-bad2:
- if (lport)
- (void)close(*fd2p);
-bad:
- (void)close(s);
- sigsetmask(oldmask);
- return (-1);
-}
-
-int
-rresvport(alport)
- int *alport;
-{
- struct sockaddr_in sin;
- int s;
-
- bzero(&sin, sizeof sin);
- sin.sin_len = sizeof(struct sockaddr_in);
- sin.sin_family = AF_INET;
- sin.sin_addr.s_addr = INADDR_ANY;
- s = socket(AF_INET, SOCK_STREAM, 0);
- if (s < 0)
- return (-1);
-#if 0 /* compat_exact_traditional_rresvport_semantics */
- sin.sin_port = htons((u_short)*alport);
- if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
- return (s);
- if (errno != EADDRINUSE) {
- (void)close(s);
- return (-1);
- }
-#endif
- sin.sin_port = 0;
- if (bindresvport(s, &sin) == -1) {
- (void)close(s);
- return (-1);
- }
- *alport = (int)ntohs(sin.sin_port);
- return (s);
-}
-
-int __check_rhosts_file = 1;
-char *__rcmd_errstr;
-
-int
-ruserok(rhost, superuser, ruser, luser)
- const char *rhost, *ruser, *luser;
- int superuser;
-{
- struct hostent *hp;
- u_long addr;
- char **ap;
-
- if ((hp = gethostbyname(rhost)) == NULL)
- return (-1);
- for (ap = hp->h_addr_list; *ap; ++ap) {
- bcopy(*ap, &addr, sizeof(addr));
- if (iruserok(addr, superuser, ruser, luser) == 0)
- return (0);
- }
- return (-1);
-}
-
-/*
- * New .rhosts strategy: We are passed an ip address. We spin through
- * hosts.equiv and .rhosts looking for a match. When the .rhosts only
- * has ip addresses, we don't have to trust a nameserver. When it
- * contains hostnames, we spin through the list of addresses the nameserver
- * gives us and look for a match.
- *
- * Returns 0 if ok, -1 if not ok.
- */
-int
-iruserok(raddr, superuser, ruser, luser)
- u_long raddr;
- int superuser;
- const char *ruser, *luser;
-{
- register char *cp;
- struct stat sbuf;
- struct passwd *pwd;
- FILE *hostf;
- uid_t uid;
- int first;
- char pbuf[MAXPATHLEN];
-
- first = 1;
- hostf = superuser ? NULL : fopen(_PATH_HEQUIV, "r");
-again:
- if (hostf) {
- if (__ivaliduser(hostf, raddr, luser, ruser) == 0) {
- (void)fclose(hostf);
- return (0);
- }
- (void)fclose(hostf);
- }
- if (first == 1 && (__check_rhosts_file || superuser)) {
- first = 0;
- if ((pwd = getpwnam(luser)) == NULL)
- return (-1);
- (void)strcpy(pbuf, pwd->pw_dir);
- (void)strcat(pbuf, "/.rhosts");
-
- /*
- * Change effective uid while opening .rhosts. If root and
- * reading an NFS mounted file system, can't read files that
- * are protected read/write owner only.
- */
- uid = geteuid();
- (void)seteuid(pwd->pw_uid);
- hostf = fopen(pbuf, "r");
- (void)seteuid(uid);
-
- if (hostf == NULL)
- return (-1);
- /*
- * If not a regular file, or is owned by someone other than
- * user or root or if writeable by anyone but the owner, quit.
- */
- cp = NULL;
- if (lstat(pbuf, &sbuf) < 0)
- cp = ".rhosts lstat failed";
- else if (!S_ISREG(sbuf.st_mode))
- cp = ".rhosts not regular file";
- else if (fstat(fileno(hostf), &sbuf) < 0)
- cp = ".rhosts fstat failed";
- else if (sbuf.st_uid && sbuf.st_uid != pwd->pw_uid)
- cp = "bad .rhosts owner";
- else if (sbuf.st_mode & (S_IWGRP|S_IWOTH))
- cp = ".rhosts writeable by other than owner";
- /* If there were any problems, quit. */
- if (cp) {
- __rcmd_errstr = cp;
- (void)fclose(hostf);
- return (-1);
- }
- goto again;
- }
- return (-1);
-}
-
-/*
- * XXX
- * Don't make static, used by lpd(8).
- *
- * Returns 0 if ok, -1 if not ok.
- */
-int
-__ivaliduser(hostf, raddr, luser, ruser)
- FILE *hostf;
- u_long raddr;
- const char *luser, *ruser;
-{
- register char *user, *p;
- int ch;
- char buf[MAXHOSTNAMELEN + 128]; /* host + login */
- char hname[MAXHOSTNAMELEN];
- struct hostent *hp;
- /* Presumed guilty until proven innocent. */
- int userok = 0, hostok = 0;
-#ifdef YP
- char *ypdomain;
-
- if (yp_get_default_domain(&ypdomain))
- ypdomain = NULL;
-#else
-#define ypdomain NULL
-#endif
- /* We need to get the damn hostname back for netgroup matching. */
- if ((hp = gethostbyaddr((char *)&raddr, sizeof(u_long),
- AF_INET)) == NULL)
- return (-1);
- strncpy(hname, hp->h_name, sizeof(hname));
- hname[sizeof(hname) - 1] = '\0';
-
- while (fgets(buf, sizeof(buf), hostf)) {
- p = buf;
- /* Skip lines that are too long. */
- if (strchr(p, '\n') == NULL) {
- while ((ch = getc(hostf)) != '\n' && ch != EOF);
- continue;
- }
- if (*p == '\n' || *p == '#') {
- /* comment... */
- continue;
- }
- while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') {
- *p = isupper(*p) ? tolower(*p) : *p;
- p++;
- }
- if (*p == ' ' || *p == '\t') {
- *p++ = '\0';
- while (*p == ' ' || *p == '\t')
- p++;
- user = p;
- while (*p != '\n' && *p != ' ' &&
- *p != '\t' && *p != '\0')
- p++;
- } else
- user = p;
- *p = '\0';
- /*
- * Do +/- and +@/-@ checking. This looks really nasty,
- * but it matches SunOS's behavior so far as I can tell.
- */
- switch(buf[0]) {
- case '+':
- if (!buf[1]) { /* '+' matches all hosts */
- hostok = 1;
- break;
- }
- if (buf[1] == '@') /* match a host by netgroup */
- hostok = innetgr((char *)&buf[2],
- (char *)&hname, NULL, ypdomain);
- else /* match a host by addr */
- hostok = __icheckhost(raddr,(char *)&buf[1]);
- break;
- case '-': /* reject '-' hosts and all their users */
- if (buf[1] == '@') {
- if (innetgr((char *)&buf[2],
- (char *)&hname, NULL, ypdomain))
- return(-1);
- } else {
- if (__icheckhost(raddr,(char *)&buf[1]))
- return(-1);
- }
- break;
- default: /* if no '+' or '-', do a simple match */
- hostok = __icheckhost(raddr, buf);
- break;
- }
- switch(*user) {
- case '+':
- if (!*(user+1)) { /* '+' matches all users */
- userok = 1;
- break;
- }
- if (*(user+1) == '@') /* match a user by netgroup */
- userok = innetgr(user+2, NULL, ruser, ypdomain);
- else /* match a user by direct specification */
- userok = !(strcmp(ruser, user+1));
- break;
- case '-': /* if we matched a hostname, */
- if (hostok) { /* check for user field rejections */
- if (!*(user+1))
- return(-1);
- if (*(user+1) == '@') {
- if (innetgr(user+2, NULL,
- ruser, ypdomain))
- return(-1);
- } else {
- if (!strcmp(ruser, user+1))
- return(-1);
- }
- }
- break;
- default: /* no rejections: try to match the user */
- if (hostok)
- userok = !(strcmp(ruser,*user ? user : luser));
- break;
- }
- if (hostok && userok)
- return(0);
- }
- return (-1);
-}
-
-/*
- * Returns "true" if match, 0 if no match.
- */
-static int
-__icheckhost(raddr, lhost)
- u_long raddr;
- register char *lhost;
-{
- register struct hostent *hp;
- register u_long laddr;
- register char **pp;
-
- /* Try for raw ip address first. */
- if (isdigit(*lhost) && (long)(laddr = inet_addr(lhost)) != -1)
- return (raddr == laddr);
-
- /* Better be a hostname. */
- if ((hp = gethostbyname(lhost)) == NULL)
- return (0);
-
- /* Spin through ip addresses. */
- for (pp = hp->h_addr_list; *pp; ++pp)
- if (!bcmp(&raddr, *pp, sizeof(u_long)))
- return (1);
-
- /* No match. */
- return (0);
-}
diff --git a/cpukit/libnetworking/libc/recv.c b/cpukit/libnetworking/libc/recv.c
deleted file mode 100644
index a842244caf..0000000000
--- a/cpukit/libnetworking/libc/recv.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)recv.c 8.2 (Berkeley) 2/21/94";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <stddef.h>
-
-ssize_t
-recv(s, buf, len, flags)
- int s, flags;
- size_t len;
- void *buf;
-{
- return (recvfrom(s, buf, len, flags, NULL, 0));
-}
diff --git a/cpukit/libnetworking/libc/res_comp.c b/cpukit/libnetworking/libc/res_comp.c
deleted file mode 100644
index 93043276f2..0000000000
--- a/cpukit/libnetworking/libc/res_comp.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright (c) 1985, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: res_comp.c,v 8.11 1997/05/21 19:31:04 halley Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#define BIND_4_COMPAT
-
-/*
- * Expand compressed domain name 'comp_dn' to full domain name.
- * 'msg' is a pointer to the begining of the message,
- * 'eomorig' points to the first location after the message,
- * 'exp_dn' is a pointer to a buffer of size 'length' for the result.
- * Return size of compressed name or -1 if there was an error.
- */
-int
-dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
- char *dst, int dstsiz)
-{
- int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);
-
- if (n > 0 && dst[0] == '.')
- dst[0] = '\0';
- return (n);
-}
-
-/*
- * Pack domain name 'exp_dn' in presentation form into 'comp_dn'.
- * Return the size of the compressed name or -1.
- * 'length' is the size of the array pointed to by 'comp_dn'.
- */
-int
-dn_comp(const char *src, u_char *dst, int dstsiz,
- u_char **dnptrs, u_char **lastdnptr)
-{
- return (ns_name_compress(src, dst, (size_t)dstsiz,
- (const u_char **)dnptrs,
- (const u_char **)lastdnptr));
-}
-
-/*
- * Skip over a compressed domain name. Return the size or -1.
- */
-int
-dn_skipname(const u_char *ptr, const u_char *eom) {
- const u_char *saveptr = ptr;
-
- if (ns_name_skip(&ptr, eom) == -1)
- return (-1);
- return (ptr - saveptr);
-}
-
-/*
- * Verify that a domain name uses an acceptable character set.
- */
-
-/*
- * Note the conspicuous absence of ctype macros in these definitions. On
- * non-ASCII hosts, we can't depend on string literals or ctype macros to
- * tell us anything about network-format data. The rest of the BIND system
- * is not careful about this, but for some reason, we're doing it right here.
- */
-#define PERIOD 0x2e
-#define hyphenchar(c) ((c) == 0x2d)
-#define bslashchar(c) ((c) == 0x5c)
-#define periodchar(c) ((c) == PERIOD)
-#define asterchar(c) ((c) == 0x2a)
-#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \
- || ((c) >= 0x61 && (c) <= 0x7a))
-#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
-
-#define borderchar(c) (alphachar(c) || digitchar(c))
-#define middlechar(c) (borderchar(c) || hyphenchar(c))
-#define domainchar(c) ((c) > 0x20 && (c) < 0x7f)
-
-int
-res_hnok(dn)
- const char *dn;
-{
- int ppch = '\0', pch = PERIOD, ch = *dn++;
-
- while (ch != '\0') {
- int nch = *dn++;
-
- if (periodchar(ch)) {
- (void)NULL;
- } else if (periodchar(pch)) {
- if (!borderchar(ch))
- return (0);
- } else if (periodchar(nch) || nch == '\0') {
- if (!borderchar(ch))
- return (0);
- } else {
- if (!middlechar(ch))
- return (0);
- }
- ppch = pch, pch = ch, ch = nch;
- }
- return (1);
-}
-
-/*
- * hostname-like (A, MX, WKS) owners can have "*" as their first label
- * but must otherwise be as a host name.
- */
-int
-res_ownok(dn)
- const char *dn;
-{
- if (asterchar(dn[0])) {
- if (periodchar(dn[1]))
- return (res_hnok(dn+2));
- if (dn[1] == '\0')
- return (1);
- }
- return (res_hnok(dn));
-}
-
-/*
- * SOA RNAMEs and RP RNAMEs can have any printable character in their first
- * label, but the rest of the name has to look like a host name.
- */
-int
-res_mailok(dn)
- const char *dn;
-{
- int ch, escaped = 0;
-
- /* "." is a valid missing representation */
- if (*dn == '\0')
- return (1);
-
- /* otherwise <label>.<hostname> */
- while ((ch = *dn++) != '\0') {
- if (!domainchar(ch))
- return (0);
- if (!escaped && periodchar(ch))
- break;
- if (escaped)
- escaped = 0;
- else if (bslashchar(ch))
- escaped = 1;
- }
- if (periodchar(ch))
- return (res_hnok(dn));
- return (0);
-}
-
-/*
- * This function is quite liberal, since RFC 1034's character sets are only
- * recommendations.
- */
-int
-res_dnok(dn)
- const char *dn;
-{
- int ch;
-
- while ((ch = *dn++) != '\0')
- if (!domainchar(ch))
- return (0);
- return (1);
-}
-
-#ifdef BIND_4_COMPAT
-/*
- * This module must export the following externally-visible symbols:
- * ___putlong
- * ___putshort
- * __getlong
- * __getshort
- * Note that one _ comes from C and the others come from us.
- */
-void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); }
-void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); }
-u_int32_t _getlong(const u_char *src) { return (ns_get32(src)); }
-u_int16_t _getshort(const u_char *src) { return (ns_get16(src)); }
-#endif /*BIND_4_COMPAT*/
diff --git a/cpukit/libnetworking/libc/res_config.h b/cpukit/libnetworking/libc/res_config.h
deleted file mode 100644
index 57ec414226..0000000000
--- a/cpukit/libnetworking/libc/res_config.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * $Id$
- */
-
-#define DEBUG 1 /* enable debugging code (needed for dig) */
-#define RESOLVSORT /* allow sorting of addresses in gethostbyname */
-#define RFC1535 /* comply with RFC1535 (STRONGLY reccomended by vixie)*/
-#undef USELOOPBACK /* res_init() bind to localhost */
-#undef SUNSECURITY /* verify gethostbyaddr() calls - WE DONT NEED IT */
-#define MULTI_PTRS_ARE_ALIASES 1 /* fold multiple PTR records into aliases */
-#define CHECK_SRVR_ADDR 1 /* confirm that the server requested sent the reply */
-#define BIND_UPDATE 1 /* update support */
-
-#if defined(__rtems__)
-u_int16_t _getshort(const u_char *src);
-u_int32_t _getlong(const u_char *src);
-int gethostname (char *name, int namelen);
-int sethostname (char *name, int namelen);
-int issetugid (void);
-#endif
diff --git a/cpukit/libnetworking/libc/res_data.c b/cpukit/libnetworking/libc/res_data.c
deleted file mode 100644
index fb7d2c66eb..0000000000
--- a/cpukit/libnetworking/libc/res_data.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 1995,1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "res_config.h"
-
-const char *_res_opcodes[] = {
- "QUERY",
- "IQUERY",
- "CQUERYM",
- "CQUERYU", /* experimental */
- "NOTIFY", /* experimental */
- "UPDATE",
- "6",
- "7",
- "8",
- "9",
- "10",
- "11",
- "12",
- "13",
- "ZONEINIT",
- "ZONEREF",
-};
-
-const char *_res_resultcodes[] = {
- "NOERROR",
- "FORMERR",
- "SERVFAIL",
- "NXDOMAIN",
- "NOTIMP",
- "REFUSED",
- "YXDOMAIN",
- "YXRRSET",
- "NXRRSET",
- "NOTAUTH",
- "ZONEERR",
- "11",
- "12",
- "13",
- "14",
- "NOCHANGE",
-};
-
-#ifdef BIND_UPDATE
-const char *_res_sectioncodes[] = {
- "ZONE",
- "PREREQUISITES",
- "UPDATE",
- "ADDITIONAL",
-};
-#endif
diff --git a/cpukit/libnetworking/libc/res_debug.c b/cpukit/libnetworking/libc/res_debug.c
deleted file mode 100644
index b747b6e6d2..0000000000
--- a/cpukit/libnetworking/libc/res_debug.c
+++ /dev/null
@@ -1,966 +0,0 @@
-/*
- * Copyright (c) 1985
- * 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1995 by International Business Machines, Inc.
- *
- * International Business Machines, Inc. (hereinafter called IBM) grants
- * permission under its copyrights to use, copy, modify, and distribute this
- * Software with or without fee, provided that the above copyright notice and
- * all paragraphs of this notice appear in all copies, and that the name of IBM
- * not be used in connection with the marketing of any product incorporating
- * the Software or modifications thereof, without specific, written prior
- * permission.
- *
- * To the extent it has a right to do so, IBM grants an immunity from suit
- * under its patents, if any, for the use, sale or manufacture of products to
- * the extent that such products are used for performing Domain Name System
- * dynamic updates in TCP/IP networks by means of the Software. No immunity is
- * granted for any product per se or for any other function of any product.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <math.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#define SPRINTF(x) sprintf x
-
-extern const char *_res_opcodes[];
-extern const char *_res_resultcodes[];
-extern const char *_res_sectioncodes[];
-
-/*
- * Print the current options.
- */
-void
-fp_resstat(struct __res_state *statp, FILE *file) {
- u_long mask;
-
- fprintf(file, ";; res options:");
- if (!statp)
- statp = &_res;
- for (mask = 1; mask != 0; mask <<= 1)
- if (statp->options & mask)
- fprintf(file, " %s", p_option(mask));
- putc('\n', file);
-}
-
-static void
-do_section(ns_msg *handle, ns_sect section, int pflag, FILE *file) {
- int n, sflag, rrnum;
- char buf[2048]; /* XXX need to malloc */
- ns_opcode opcode;
- ns_rr rr;
-
- /*
- * Print answer records.
- */
- sflag = (_res.pfcode & pflag);
- if (_res.pfcode && !sflag)
- return;
-
- opcode = ns_msg_getflag(*handle, ns_f_opcode);
- rrnum = 0;
- for (;;) {
- if (ns_parserr(handle, section, rrnum, &rr)) {
- if (errno != ENODEV)
- fprintf(file, ";; ns_parserr: %s\n",
- strerror(errno));
- else if (rrnum > 0 && sflag != 0 &&
- (_res.pfcode & RES_PRF_HEAD1))
- putc('\n', file);
- return;
- }
- if (rrnum == 0 && sflag != 0 && (_res.pfcode & RES_PRF_HEAD1))
- fprintf(file, ";; %s SECTION:\n",
- p_section(section, opcode));
- if (section == ns_s_qd)
- fprintf(file, ";;\t%s, type = %s, class = %s\n",
- ns_rr_name(rr),
- p_type(ns_rr_type(rr)),
- p_class(ns_rr_class(rr)));
- else {
- n = ns_sprintrr(handle, &rr, NULL, NULL,
- buf, sizeof buf);
- if (n < 0) {
- fprintf(file, ";; ns_sprintrr: %s\n",
- strerror(errno));
- return;
- }
- fputs(buf, file);
- fputc('\n', file);
- }
- rrnum++;
- }
-}
-
-void
-p_query(const u_char *msg) {
- fp_query(msg, stdout);
-}
-
-void
-fp_query(const u_char *msg, FILE *file) {
- fp_nquery(msg, PACKETSZ, file);
-}
-
-/*
- * Print the contents of a query.
- * This is intended to be primarily a debugging routine.
- */
-void
-fp_nquery(const u_char *msg, int len, FILE *file) {
- ns_msg handle;
- int qdcount, ancount, nscount, arcount;
- u_int opcode, rcode, id;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1)
- return;
-
- if (ns_initparse(msg, len, &handle) < 0) {
- fprintf(file, ";; ns_initparse: %s\n", strerror(errno));
- return;
- }
- opcode = ns_msg_getflag(handle, ns_f_opcode);
- rcode = ns_msg_getflag(handle, ns_f_rcode);
- id = ns_msg_id(handle);
- qdcount = ns_msg_count(handle, ns_s_qd);
- ancount = ns_msg_count(handle, ns_s_an);
- nscount = ns_msg_count(handle, ns_s_ns);
- arcount = ns_msg_count(handle, ns_s_ar);
-
- /*
- * Print header fields.
- */
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEADX) || rcode)
- fprintf(file,
- ";; ->>HEADER<<- opcode: %s, status: %s, id: %d\n",
- _res_opcodes[opcode], _res_resultcodes[rcode], id);
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEADX))
- putc(';', file);
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEAD2)) {
- fprintf(file, "; flags:");
- if (ns_msg_getflag(handle, ns_f_qr))
- fprintf(file, " qr");
- if (ns_msg_getflag(handle, ns_f_aa))
- fprintf(file, " aa");
- if (ns_msg_getflag(handle, ns_f_tc))
- fprintf(file, " tc");
- if (ns_msg_getflag(handle, ns_f_rd))
- fprintf(file, " rd");
- if (ns_msg_getflag(handle, ns_f_ra))
- fprintf(file, " ra");
- if (ns_msg_getflag(handle, ns_f_z))
- fprintf(file, " ??");
- if (ns_msg_getflag(handle, ns_f_ad))
- fprintf(file, " ad");
- if (ns_msg_getflag(handle, ns_f_cd))
- fprintf(file, " cd");
- }
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEAD1)) {
- fprintf(file, "; %s: %d",
- p_section(ns_s_qd, opcode), qdcount);
- fprintf(file, ", %s: %d",
- p_section(ns_s_an, opcode), ancount);
- fprintf(file, ", %s: %d",
- p_section(ns_s_ns, opcode), nscount);
- fprintf(file, ", %s: %d",
- p_section(ns_s_ar, opcode), arcount);
- }
- if ((!_res.pfcode) || (_res.pfcode &
- (RES_PRF_HEADX | RES_PRF_HEAD2 | RES_PRF_HEAD1))) {
- putc('\n',file);
- }
- /*
- * Print the various sections.
- */
- do_section(&handle, ns_s_qd, RES_PRF_QUES, file);
- do_section(&handle, ns_s_an, RES_PRF_ANS, file);
- do_section(&handle, ns_s_ns, RES_PRF_AUTH, file);
- do_section(&handle, ns_s_ar, RES_PRF_ADD, file);
- if (qdcount == 0 && ancount == 0 &&
- nscount == 0 && arcount == 0)
- putc('\n', file);
-}
-
-const u_char *
-p_cdnname(const u_char *cp, const u_char *msg, int len, FILE *file) {
- char name[MAXDNAME];
- int n;
-
- if ((n = dn_expand(msg, msg + len, cp, name, sizeof name)) < 0)
- return (NULL);
- if (name[0] == '\0')
- putc('.', file);
- else
- fputs(name, file);
- return (cp + n);
-}
-
-const u_char *
-p_cdname(const u_char *cp, const u_char *msg, FILE *file) {
- return (p_cdnname(cp, msg, PACKETSZ, file));
-}
-
-/* Return a fully-qualified domain name from a compressed name (with
- length supplied). */
-
-const u_char *
-p_fqnname(cp, msg, msglen, name, namelen)
- const u_char *cp, *msg;
- int msglen;
- char *name;
- int namelen;
-{
- int n, newlen;
-
- if ((n = dn_expand(msg, cp + msglen, cp, name, namelen)) < 0)
- return (NULL);
- newlen = strlen(name);
- if (newlen == 0 || name[newlen - 1] != '.') {
- if (newlen + 1 >= namelen) /* Lack space for final dot */
- return (NULL);
- else
- strcpy(name + newlen, ".");
- }
- return (cp + n);
-}
-
-/* XXX: the rest of these functions need to become length-limited, too. */
-
-const u_char *
-p_fqname(const u_char *cp, const u_char *msg, FILE *file) {
- char name[MAXDNAME];
- const u_char *n;
-
- n = p_fqnname(cp, msg, MAXCDNAME, name, sizeof name);
- if (n == NULL)
- return (NULL);
- fputs(name, file);
- return (n);
-}
-
-/*
- * Names of RR classes and qclasses. Classes and qclasses are the same, except
- * that C_ANY is a qclass but not a class. (You can ask for records of class
- * C_ANY, but you can't have any records of that class in the database.)
- */
-const struct res_sym __p_class_syms[] = {
- {C_IN, "IN"},
- {C_CHAOS, "CHAOS"},
- {C_HS, "HS"},
- {C_HS, "HESIOD"},
- {C_ANY, "ANY"},
- {C_NONE, "NONE"},
- {C_IN, (char *)0}
-};
-
-/*
- * Names of message sections.
- */
-const struct res_sym __p_default_section_syms[] = {
- {ns_s_qd, "QUERY"},
- {ns_s_an, "ANSWER"},
- {ns_s_ns, "AUTHORITY"},
- {ns_s_ar, "ADDITIONAL"},
- {0, (char *)0}
-};
-
-const struct res_sym __p_update_section_syms[] = {
- {S_ZONE, "ZONE"},
- {S_PREREQ, "PREREQUISITE"},
- {S_UPDATE, "UPDATE"},
- {S_ADDT, "ADDITIONAL"},
- {0, (char *)0}
-};
-
-/*
- * Names of RR types and qtypes. Types and qtypes are the same, except
- * that T_ANY is a qtype but not a type. (You can ask for records of type
- * T_ANY, but you can't have any records of that type in the database.)
- */
-const struct res_sym __p_type_syms[] = {
- {T_A, "A", "address"},
- {T_NS, "NS", "name server"},
- {T_MD, "MD", "mail destination (deprecated)"},
- {T_MF, "MF", "mail forwarder (deprecated)"},
- {T_CNAME, "CNAME", "canonical name"},
- {T_SOA, "SOA", "start of authority"},
- {T_MB, "MB", "mailbox"},
- {T_MG, "MG", "mail group member"},
- {T_MR, "MR", "mail rename"},
- {T_NULL, "NULL", "null"},
- {T_WKS, "WKS", "well-known service (deprecated)"},
- {T_PTR, "PTR", "domain name pointer"},
- {T_HINFO, "HINFO", "host information"},
- {T_MINFO, "MINFO", "mailbox information"},
- {T_MX, "MX", "mail exchanger"},
- {T_TXT, "TXT", "text"},
- {T_RP, "RP", "responsible person"},
- {T_AFSDB, "AFSDB", "DCE or AFS server"},
- {T_X25, "X25", "X25 address"},
- {T_ISDN, "ISDN", "ISDN address"},
- {T_RT, "RT", "router"},
- {T_NSAP, "NSAP", "nsap address"},
- {T_NSAP_PTR, "NSAP_PTR", "domain name pointer"},
- {T_SIG, "SIG", "signature"},
- {T_KEY, "KEY", "key"},
- {T_PX, "PX", "mapping information"},
- {T_GPOS, "GPOS", "geographical position (withdrawn)"},
- {T_AAAA, "AAAA", "IPv6 address"},
- {T_LOC, "LOC", "location"},
- {T_NXT, "NXT", "next valid name (unimplemented)"},
- {T_EID, "EID", "endpoint identifier (unimplemented)"},
- {T_NIMLOC, "NIMLOC", "NIMROD locator (unimplemented)"},
- {T_SRV, "SRV", "server selection"},
- {T_ATMA, "ATMA", "ATM address (unimplemented)"},
- {T_IXFR, "IXFR", "incremental zone transfer"},
- {T_AXFR, "AXFR", "zone transfer"},
- {T_MAILB, "MAILB", "mailbox-related data (deprecated)"},
- {T_MAILA, "MAILA", "mail agent (deprecated)"},
- {T_NAPTR, "NAPTR", "URN Naming Authority"},
- {T_ANY, "ANY", "\"any\""},
- {0, NULL, NULL}
-};
-
-int
-sym_ston(const struct res_sym *syms, const char *name, int *success) {
- for ((void)NULL; syms->name != 0; syms++) {
- if (strcasecmp (name, syms->name) == 0) {
- if (success)
- *success = 1;
- return (syms->number);
- }
- }
- if (success)
- *success = 0;
- return (syms->number); /* The default value. */
-}
-
-const char *
-sym_ntos(const struct res_sym *syms, int number, int *success) {
- static char unname[20];
-
- for ((void)NULL; syms->name != 0; syms++) {
- if (number == syms->number) {
- if (success)
- *success = 1;
- return (syms->name);
- }
- }
-
- sprintf(unname, "%d", number);
- if (success)
- *success = 0;
- return (unname);
-}
-
-const char *
-sym_ntop(const struct res_sym *syms, int number, int *success) {
- static char unname[20];
-
- for ((void)NULL; syms->name != 0; syms++) {
- if (number == syms->number) {
- if (success)
- *success = 1;
- return (syms->humanname);
- }
- }
- sprintf(unname, "%d", number);
- if (success)
- *success = 0;
- return (unname);
-}
-
-/*
- * Return a string for the type.
- */
-const char *
-p_type(int type) {
- return (sym_ntos(__p_type_syms, type, (int *)0));
-}
-
-/*
- * Return a string for the type.
- */
-const char *
-p_section(int section, int opcode) {
- const struct res_sym *symbols;
-
- switch (opcode) {
- case ns_o_update:
- symbols = __p_update_section_syms;
- break;
- default:
- symbols = __p_default_section_syms;
- break;
- }
- return (sym_ntos(symbols, section, (int *)0));
-}
-
-/*
- * Return a mnemonic for class.
- */
-const char *
-p_class(int class) {
- return (sym_ntos(__p_class_syms, class, (int *)0));
-}
-
-/*
- * Return a mnemonic for an option
- */
-const char *
-p_option(u_long option) {
- static char nbuf[40];
-
- switch (option) {
- case RES_INIT: return "init";
- case RES_DEBUG: return "debug";
- case RES_AAONLY: return "aaonly(unimpl)";
- case RES_USEVC: return "usevc";
- case RES_PRIMARY: return "primry(unimpl)";
- case RES_IGNTC: return "igntc";
- case RES_RECURSE: return "recurs";
- case RES_DEFNAMES: return "defnam";
- case RES_STAYOPEN: return "styopn";
- case RES_DNSRCH: return "dnsrch";
- case RES_INSECURE1: return "insecure1";
- case RES_INSECURE2: return "insecure2";
- default: sprintf(nbuf, "?0x%lx?", (u_long)option);
- return (nbuf);
- }
-}
-
-/*
- * Return a mnemonic for a time to live.
- */
-const char *
-p_time(u_int32_t value) {
- static char nbuf[40];
-
- if (ns_format_ttl(value, nbuf, sizeof nbuf) < 0)
- sprintf(nbuf, "%u", value);
- return (nbuf);
-}
-
-
-/*
- * routines to convert between on-the-wire RR format and zone file format.
- * Does not contain conversion to/from decimal degrees; divide or multiply
- * by 60*60*1000 for that.
- */
-
-static unsigned int poweroften[10] = {1, 10, 100, 1000, 10000, 100000,
- 1000000,10000000,100000000,1000000000};
-
-/* takes an XeY precision/size value, returns a string representation. */
-static const char *
-precsize_ntoa(prec)
- u_int8_t prec;
-{
- static char retbuf[sizeof "90000000.00"];
- unsigned long val;
- int mantissa, exponent;
-
- mantissa = (int)((prec >> 4) & 0x0f) % 10;
- exponent = (int)((prec >> 0) & 0x0f) % 10;
-
- val = mantissa * poweroften[exponent];
-
- (void) sprintf(retbuf, "%ld.%.2ld", val/100, val%100);
- return (retbuf);
-}
-
-/* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */
-static u_int8_t
-precsize_aton(strptr)
- char **strptr;
-{
- unsigned int mval = 0, cmval = 0;
- u_int8_t retval = 0;
- char *cp;
- int exponent;
- int mantissa;
-
- cp = *strptr;
-
- while (isdigit((int)*cp))
- mval = mval * 10 + (*cp++ - '0');
-
- if (*cp == '.') { /* centimeters */
- cp++;
- if (isdigit((int)*cp)) {
- cmval = (*cp++ - '0') * 10;
- if (isdigit((int)*cp)) {
- cmval += (*cp++ - '0');
- }
- }
- }
- cmval = (mval * 100) + cmval;
-
- for (exponent = 0; exponent < 9; exponent++)
- if (cmval < poweroften[exponent+1])
- break;
-
- mantissa = cmval / poweroften[exponent];
- if (mantissa > 9)
- mantissa = 9;
-
- retval = (mantissa << 4) | exponent;
-
- *strptr = cp;
-
- return (retval);
-}
-
-/* converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer. */
-static u_int32_t
-latlon2ul(latlonstrptr,which)
- char **latlonstrptr;
- int *which;
-{
- char *cp;
- u_int32_t retval;
- int deg = 0, min = 0, secs = 0, secsfrac = 0;
-
- cp = *latlonstrptr;
-
- while (isdigit((int)*cp))
- deg = deg * 10 + (*cp++ - '0');
-
- while (isspace((int)*cp))
- cp++;
-
- if (!(isdigit((int)*cp)))
- goto fndhemi;
-
- while (isdigit((int)*cp))
- min = min * 10 + (*cp++ - '0');
-
- while (isspace((int)*cp))
- cp++;
-
- if (!(isdigit((int)*cp)))
- goto fndhemi;
-
- while (isdigit((int)*cp))
- secs = secs * 10 + (*cp++ - '0');
-
- if (*cp == '.') { /* decimal seconds */
- cp++;
- if (isdigit((int)*cp)) {
- secsfrac = (*cp++ - '0') * 100;
- if (isdigit((int)*cp)) {
- secsfrac += (*cp++ - '0') * 10;
- if (isdigit((int)*cp)) {
- secsfrac += (*cp++ - '0');
- }
- }
- }
- }
-
- while (!isspace((int)*cp)) /* if any trailing garbage */
- cp++;
-
- while (isspace((int)*cp))
- cp++;
-
- fndhemi:
- switch (*cp) {
- case 'N': case 'n':
- case 'E': case 'e':
- retval = ((unsigned)1<<31)
- + (((((deg * 60) + min) * 60) + secs) * 1000)
- + secsfrac;
- break;
- case 'S': case 's':
- case 'W': case 'w':
- retval = ((unsigned)1<<31)
- - (((((deg * 60) + min) * 60) + secs) * 1000)
- - secsfrac;
- break;
- default:
- retval = 0; /* invalid value -- indicates error */
- break;
- }
-
- switch (*cp) {
- case 'N': case 'n':
- case 'S': case 's':
- *which = 1; /* latitude */
- break;
- case 'E': case 'e':
- case 'W': case 'w':
- *which = 2; /* longitude */
- break;
- default:
- *which = 0; /* error */
- break;
- }
-
- cp++; /* skip the hemisphere */
-
- while (!isspace((int)*cp)) /* if any trailing garbage */
- cp++;
-
- while (isspace((int)*cp)) /* move to next field */
- cp++;
-
- *latlonstrptr = cp;
-
- return (retval);
-}
-
-/* converts a zone file representation in a string to an RDATA on-the-wire
- * representation. */
-int
-loc_aton(ascii, binary)
- const char *ascii;
- u_char *binary;
-{
- const char *cp, *maxcp;
- u_char *bcp;
-
- u_int32_t latit = 0, longit = 0, alt = 0;
- u_int32_t lltemp1 = 0, lltemp2 = 0;
- int altmeters = 0, altfrac = 0, altsign = 1;
- u_int8_t hp = 0x16; /* default = 1e6 cm = 10000.00m = 10km */
- u_int8_t vp = 0x13; /* default = 1e3 cm = 10.00m */
- u_int8_t siz = 0x12; /* default = 1e2 cm = 1.00m */
- int which1 = 0, which2 = 0;
-
- cp = ascii;
- maxcp = cp + strlen(ascii);
-
- lltemp1 = latlon2ul(&cp, &which1);
-
- lltemp2 = latlon2ul(&cp, &which2);
-
- switch (which1 + which2) {
- case 3: /* 1 + 2, the only valid combination */
- if ((which1 == 1) && (which2 == 2)) { /* normal case */
- latit = lltemp1;
- longit = lltemp2;
- } else if ((which1 == 2) && (which2 == 1)) { /* reversed */
- longit = lltemp1;
- latit = lltemp2;
- } else { /* some kind of brokenness */
- return (0);
- }
- break;
- default: /* we didn't get one of each */
- return (0);
- }
-
- /* altitude */
- if (*cp == '-') {
- altsign = -1;
- cp++;
- }
-
- if (*cp == '+')
- cp++;
-
- while (isdigit((int)*cp))
- altmeters = altmeters * 10 + (*cp++ - '0');
-
- if (*cp == '.') { /* decimal meters */
- cp++;
- if (isdigit((int)*cp)) {
- altfrac = (*cp++ - '0') * 10;
- if (isdigit((int)*cp)) {
- altfrac += (*cp++ - '0');
- }
- }
- }
-
- alt = (10000000 + (altsign * (altmeters * 100 + altfrac)));
-
- while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
- cp++;
-
- while (isspace((int)*cp) && (cp < maxcp))
- cp++;
-
- if (cp >= maxcp)
- goto defaults;
-
- siz = precsize_aton(&cp);
-
- while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
- cp++;
-
- while (isspace((int)*cp) && (cp < maxcp))
- cp++;
-
- if (cp >= maxcp)
- goto defaults;
-
- hp = precsize_aton(&cp);
-
- while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
- cp++;
-
- while (isspace((int)*cp) && (cp < maxcp))
- cp++;
-
- if (cp >= maxcp)
- goto defaults;
-
- vp = precsize_aton(&cp);
-
- defaults:
-
- bcp = binary;
- *bcp++ = (u_int8_t) 0; /* version byte */
- *bcp++ = siz;
- *bcp++ = hp;
- *bcp++ = vp;
- PUTLONG(latit,bcp);
- PUTLONG(longit,bcp);
- PUTLONG(alt,bcp);
-
- return (16); /* size of RR in octets */
-}
-
-/* takes an on-the-wire LOC RR and formats it in a human readable format. */
-const char *
-loc_ntoa(binary, ascii)
- const u_char *binary;
- char *ascii;
-{
- static char *error = "?";
- const u_char *cp = binary;
-
- int latdeg, latmin, latsec, latsecfrac;
- int longdeg, longmin, longsec, longsecfrac;
- char northsouth, eastwest;
- int altmeters, altfrac, altsign;
-
- const u_int32_t referencealt = 100000 * 100;
-
- int32_t latval, longval, altval;
- u_int32_t templ;
- u_int8_t sizeval, hpval, vpval, versionval;
-
- char *sizestr, *hpstr, *vpstr;
-
- versionval = *cp++;
-
- if (versionval) {
- (void) sprintf(ascii, "; error: unknown LOC RR version");
- return (ascii);
- }
-
- sizeval = *cp++;
-
- hpval = *cp++;
- vpval = *cp++;
-
- GETLONG(templ, cp);
- latval = (templ - ((unsigned)1<<31));
-
- GETLONG(templ, cp);
- longval = (templ - ((unsigned)1<<31));
-
- GETLONG(templ, cp);
- if (templ < referencealt) { /* below WGS 84 spheroid */
- altval = referencealt - templ;
- altsign = -1;
- } else {
- altval = templ - referencealt;
- altsign = 1;
- }
-
- if (latval < 0) {
- northsouth = 'S';
- latval = -latval;
- } else
- northsouth = 'N';
-
- latsecfrac = latval % 1000;
- latval = latval / 1000;
- latsec = latval % 60;
- latval = latval / 60;
- latmin = latval % 60;
- latval = latval / 60;
- latdeg = latval;
-
- if (longval < 0) {
- eastwest = 'W';
- longval = -longval;
- } else
- eastwest = 'E';
-
- longsecfrac = longval % 1000;
- longval = longval / 1000;
- longsec = longval % 60;
- longval = longval / 60;
- longmin = longval % 60;
- longval = longval / 60;
- longdeg = longval;
-
- altfrac = altval % 100;
- altmeters = (altval / 100) * altsign;
-
- if ((sizestr = strdup(precsize_ntoa(sizeval))) == NULL)
- sizestr = error;
- if ((hpstr = strdup(precsize_ntoa(hpval))) == NULL)
- hpstr = error;
- if ((vpstr = strdup(precsize_ntoa(vpval))) == NULL)
- vpstr = error;
-
- sprintf(ascii,
- "%d %.2d %.2d.%.3d %c %d %.2d %.2d.%.3d %c %d.%.2dm %sm %sm %sm",
- latdeg, latmin, latsec, latsecfrac, northsouth,
- longdeg, longmin, longsec, longsecfrac, eastwest,
- altmeters, altfrac, sizestr, hpstr, vpstr);
-
- if (sizestr != error)
- free(sizestr);
- if (hpstr != error)
- free(hpstr);
- if (vpstr != error)
- free(vpstr);
-
- return (ascii);
-}
-
-
-/* Return the number of DNS hierarchy levels in the name. */
-int
-dn_count_labels(const char *name) {
- int i, len, count;
-
- len = strlen(name);
- for (i = 0, count = 0; i < len; i++) {
- /* XXX need to check for \. or use named's nlabels(). */
- if (name[i] == '.')
- count++;
- }
-
- /* don't count initial wildcard */
- if (name[0] == '*')
- if (count)
- count--;
-
- /* don't count the null label for root. */
- /* if terminating '.' not found, must adjust */
- /* count to include last label */
- if (len > 0 && name[len-1] != '.')
- count++;
- return (count);
-}
-
-
-/*
- * Make dates expressed in seconds-since-Jan-1-1970 easy to read.
- * SIG records are required to be printed like this, by the Secure DNS RFC.
- */
-char *
-p_secstodate (u_long secs) {
- static char output[15]; /* YYYYMMDDHHMMSS and null */
- time_t clock = secs;
- struct tm *time;
-
- time = gmtime(&clock);
- time->tm_year += 1900;
- time->tm_mon += 1;
- sprintf(output, "%04d%02d%02d%02d%02d%02d",
- time->tm_year, time->tm_mon, time->tm_mday,
- time->tm_hour, time->tm_min, time->tm_sec);
- return (output);
-}
diff --git a/cpukit/libnetworking/libc/res_init.c b/cpukit/libnetworking/libc/res_init.c
deleted file mode 100644
index 9371e9fa82..0000000000
--- a/cpukit/libnetworking/libc/res_init.c
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
- * Copyright (c) 1985, 1989, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
-static char orig_rcsid[] = "From: Id: res_init.c,v 8.7 1996/11/18 09:10:04 vixie Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "res_config.h"
-
-static void res_setoptions __P((char *, char *));
-
-#ifdef RESOLVSORT
-static const char sort_mask[] = "/&";
-#define ISSORTMASK(ch) (strchr(sort_mask, ch) != NULL)
-static u_int32_t net_mask __P((struct in_addr));
-#endif
-
-#if !defined(isascii) /* XXX - could be a function */
-# define isascii(c) (!(c & 0200))
-#endif
-
-/*
- * Resolver state default settings.
- */
-
-struct __res_state _res
-# if defined(__BIND_RES_TEXT)
- = { RES_TIMEOUT, } /* Motorola, et al. */
-# endif
- ;
-
-
-/*
- * Set up default settings. If the configuration file exist, the values
- * there will have precedence. Otherwise, the server address is set to
- * INADDR_ANY and the default domain name comes from the gethostname().
- *
- * An interrim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1
- * rather than INADDR_ANY ("0.0.0.0") as the default name server address
- * since it was noted that INADDR_ANY actually meant ``the first interface
- * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface,
- * it had to be "up" in order for you to reach your own name server. It
- * was later decided that since the recommended practice is to always
- * install local static routes through 127.0.0.1 for all your network
- * interfaces, that we could solve this problem without a code change.
- *
- * The configuration file should always be used, since it is the only way
- * to specify a default domain. If you are running a server on your local
- * machine, you should say "nameserver 0.0.0.0" or "nameserver 127.0.0.1"
- * in the configuration file.
- *
- * Return 0 if completes successfully, -1 on error
- */
-int
-res_init()
-{
- register FILE *fp;
- register char *cp, **pp;
- register int n;
- char buf[MAXDNAME];
- int nserv = 0; /* number of nameserver records read from file */
- int haveenv = 0;
- int havesearch = 0;
-#ifdef RESOLVSORT
- int nsort = 0;
- char *net;
-#endif
-#ifndef RFC1535
- int dots;
-#endif
-
- /*
- * These three fields used to be statically initialized. This made
- * it hard to use this code in a shared library. It is necessary,
- * now that we're doing dynamic initialization here, that we preserve
- * the old semantics: if an application modifies one of these three
- * fields of _res before res_init() is called, res_init() will not
- * alter them. Of course, if an application is setting them to
- * _zero_ before calling res_init(), hoping to override what used
- * to be the static default, we can't detect it and unexpected results
- * will follow. Zero for any of these fields would make no sense,
- * so one can safely assume that the applications were already getting
- * unexpected results.
- *
- * _res.options is tricky since some apps were known to diddle the bits
- * before res_init() was first called. We can't replicate that semantic
- * with dynamic initialization (they may have turned bits off that are
- * set in RES_DEFAULT). Our solution is to declare such applications
- * "broken". They could fool us by setting RES_INIT but none do (yet).
- */
- if (!_res.retrans)
- _res.retrans = RES_TIMEOUT;
- if (!_res.retry)
- _res.retry = 4;
- if (!(_res.options & RES_INIT))
- _res.options = RES_DEFAULT;
-
- /*
- * This one used to initialize implicitly to zero, so unless the app
- * has set it to something in particular, we can randomize it now.
- */
- if (!_res.id)
- _res.id = res_randomid();
-
-#ifdef USELOOPBACK
- _res.nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
-#else
- _res.nsaddr.sin_addr.s_addr = INADDR_ANY;
-#endif
- _res.nsaddr.sin_family = AF_INET;
- _res.nsaddr.sin_port = htons(NAMESERVER_PORT);
- _res.nscount = 1;
- _res.ndots = 1;
- _res.pfcode = 0;
-
- /*
- * RTEMS -- Set up name servers
- */
- {
-#include <rtems/rtems_bsdnet_internal.h>
- int n = 0;
- while ((n < rtems_bsdnet_nameserver_count) && (nserv < MAXNS)) {
- _res.nsaddr_list[nserv].sin_addr = rtems_bsdnet_nameserver[n];
- _res.nsaddr_list[nserv].sin_family = AF_INET;
- _res.nsaddr_list[nserv].sin_port = htons(NAMESERVER_PORT);
- nserv++;
- n++;
- }
- if (rtems_bsdnet_domain_name)
- (void)strncpy(_res.defdname, rtems_bsdnet_domain_name, sizeof(_res.defdname) - 1);
- }
-
- /* Allow user to override the local domain definition */
- if ((cp = getenv("LOCALDOMAIN")) != NULL) {
- (void)strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
- haveenv++;
-
- /*
- * Set search list to be blank-separated strings
- * from rest of env value. Permits users of LOCALDOMAIN
- * to still have a search list, and anyone to set the
- * one that they want to use as an individual (even more
- * important now that the rfc1535 stuff restricts searches)
- */
- cp = _res.defdname;
- pp = _res.dnsrch;
- *pp++ = cp;
- for (n = 0; *cp && pp < _res.dnsrch + MAXDNSRCH; cp++) {
- if (*cp == '\n') /* silly backwards compat */
- break;
- else if (*cp == ' ' || *cp == '\t') {
- *cp = 0;
- n = 1;
- } else if (n) {
- *pp++ = cp;
- n = 0;
- havesearch = 1;
- }
- }
- /* null terminate last domain if there are excess */
- while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n')
- cp++;
- *cp = '\0';
- *pp++ = 0;
- }
-
-#define MATCH(line, name) \
- (!strncmp(line, name, sizeof(name) - 1) && \
- (line[sizeof(name) - 1] == ' ' || \
- line[sizeof(name) - 1] == '\t'))
-
- if ((fp = fopen(_PATH_RESCONF, "r")) != NULL) {
- /* read the config file */
- while (fgets(buf, sizeof(buf), fp) != NULL) {
- /* skip comments */
- if (*buf == ';' || *buf == '#')
- continue;
- /* read default domain name */
- if (MATCH(buf, "domain")) {
- if (haveenv) /* skip if have from environ */
- continue;
- cp = buf + sizeof("domain") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp == '\0') || (*cp == '\n'))
- continue;
- strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
- if ((cp = strpbrk(_res.defdname, " \t\n")) != NULL)
- *cp = '\0';
- havesearch = 0;
- continue;
- }
- /* set search list */
- if (MATCH(buf, "search")) {
- if (haveenv) /* skip if have from environ */
- continue;
- cp = buf + sizeof("search") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp == '\0') || (*cp == '\n'))
- continue;
- strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
- if ((cp = strchr(_res.defdname, '\n')) != NULL)
- *cp = '\0';
- /*
- * Set search list to be blank-separated strings
- * on rest of line.
- */
- cp = _res.defdname;
- pp = _res.dnsrch;
- *pp++ = cp;
- for (n = 0; *cp && pp < _res.dnsrch + MAXDNSRCH; cp++) {
- if (*cp == ' ' || *cp == '\t') {
- *cp = 0;
- n = 1;
- } else if (n) {
- *pp++ = cp;
- n = 0;
- }
- }
- /* null terminate last domain if there are excess */
- while (*cp != '\0' && *cp != ' ' && *cp != '\t')
- cp++;
- *cp = '\0';
- *pp++ = 0;
- havesearch = 1;
- continue;
- }
- /* read nameservers to query */
- if (MATCH(buf, "nameserver") && nserv < MAXNS) {
- struct in_addr a;
-
- cp = buf + sizeof("nameserver") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp != '\0') && (*cp != '\n') && inet_aton(cp, &a)) {
- _res.nsaddr_list[nserv].sin_addr = a;
- _res.nsaddr_list[nserv].sin_family = AF_INET;
- _res.nsaddr_list[nserv].sin_port =
- htons(NAMESERVER_PORT);
- nserv++;
- }
- continue;
- }
-#ifdef RESOLVSORT
- if (MATCH(buf, "sortlist")) {
- struct in_addr a;
-
- cp = buf + sizeof("sortlist") - 1;
- while (nsort < MAXRESOLVSORT) {
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if (*cp == '\0' || *cp == '\n' || *cp == ';')
- break;
- net = cp;
- while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&
- isascii((int)*cp) && !isspace((int)*cp))
- cp++;
- n = *cp;
- *cp = 0;
- if (inet_aton(net, &a)) {
- _res.sort_list[nsort].addr = a;
- if (ISSORTMASK(n)) {
- *cp++ = n;
- net = cp;
- while (*cp && *cp != ';' &&
- isascii((int)*cp) && !isspace((int)*cp))
- cp++;
- n = *cp;
- *cp = 0;
- if (inet_aton(net, &a)) {
- _res.sort_list[nsort].mask = a.s_addr;
- } else {
- _res.sort_list[nsort].mask =
- net_mask(_res.sort_list[nsort].addr);
- }
- } else {
- _res.sort_list[nsort].mask =
- net_mask(_res.sort_list[nsort].addr);
- }
- nsort++;
- }
- *cp = n;
- }
- continue;
- }
-#endif
- if (MATCH(buf, "options")) {
- res_setoptions(buf + sizeof("options") - 1, "conf");
- continue;
- }
- }
- if (nserv > 1)
- _res.nscount = nserv;
-#ifdef RESOLVSORT
- _res.nsort = nsort;
-#endif
- (void) fclose(fp);
- }
- if (_res.defdname[0] == 0 &&
- gethostname(buf, sizeof(_res.defdname) - 1) == 0 &&
- (cp = strchr(buf, '.')) != NULL)
- strcpy(_res.defdname, cp + 1);
-
- /* find components of local domain that might be searched */
- if (havesearch == 0) {
- pp = _res.dnsrch;
- *pp++ = _res.defdname;
- *pp = NULL;
-
-#ifndef RFC1535
- dots = 0;
- for (cp = _res.defdname; *cp; cp++)
- dots += (*cp == '.');
-
- cp = _res.defdname;
- while (pp < _res.dnsrch + MAXDFLSRCH) {
- if (dots < LOCALDOMAINPARTS)
- break;
- cp = strchr(cp, '.') + 1; /* we know there is one */
- *pp++ = cp;
- dots--;
- }
- *pp = NULL;
-#ifdef DEBUG
- if (_res.options & RES_DEBUG) {
- printf(";; res_init()... default dnsrch list:\n");
- for (pp = _res.dnsrch; *pp; pp++)
- printf(";;\t%s\n", *pp);
- printf(";;\t..END..\n");
- }
-#endif
-#endif /* !RFC1535 */
- }
-
- if ((cp = getenv("RES_OPTIONS")) != NULL)
- res_setoptions(cp, "env");
- _res.options |= RES_INIT;
- return (0);
-}
-
-static void
-res_setoptions(options, source)
- char *options, *source;
-{
- char *cp = options;
- int i;
-
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_setoptions(\"%s\", \"%s\")...\n",
- options, source);
-#endif
- while (*cp) {
- /* skip leading and inner runs of spaces */
- while (*cp == ' ' || *cp == '\t')
- cp++;
- /* search for and process individual options */
- if (!strncmp(cp, "ndots:", sizeof("ndots:") - 1)) {
- i = atoi(cp + sizeof("ndots:") - 1);
- if (i <= RES_MAXNDOTS)
- _res.ndots = i;
- else
- _res.ndots = RES_MAXNDOTS;
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";;\tndots=%d\n", _res.ndots);
-#endif
- } else if (!strncmp(cp, "debug", sizeof("debug") - 1)) {
-#ifdef DEBUG
- if (!(_res.options & RES_DEBUG)) {
- printf(";; res_setoptions(\"%s\", \"%s\")..\n",
- options, source);
- _res.options |= RES_DEBUG;
- }
- printf(";;\tdebug\n");
-#endif
- } else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) {
- _res.options |= RES_USE_INET6;
- } else if (!strncmp(cp, "no_tld_query", sizeof("no_tld_query") - 1)) {
- _res.options |= RES_NOTLDQUERY;
- } else {
- /* XXX - print a warning here? */
- }
- /* skip to next run of spaces */
- while (*cp && *cp != ' ' && *cp != '\t')
- cp++;
- }
-}
-
-#ifdef RESOLVSORT
-/* XXX - should really support CIDR which means explicit masks always. */
-static u_int32_t
-net_mask(in) /* XXX - should really use system's version of this */
- struct in_addr in;
-{
- register u_int32_t i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return (htonl(IN_CLASSA_NET));
- else if (IN_CLASSB(i))
- return (htonl(IN_CLASSB_NET));
- return (htonl(IN_CLASSC_NET));
-}
-#endif
-
-u_int
-res_randomid()
-{
- struct timeval now;
-
- gettimeofday(&now, NULL);
- return (0xffff & (now.tv_sec ^ now.tv_usec ^ getpid()));
-}
diff --git a/cpukit/libnetworking/libc/res_mkquery.c b/cpukit/libnetworking/libc/res_mkquery.c
deleted file mode 100644
index d3fabfa5ab..0000000000
--- a/cpukit/libnetworking/libc/res_mkquery.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 1985, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: res_mkquery.c,v 8.9 1997/04/24 22:22:36 vixie Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "res_config.h"
-
-/*
- * Form all types of queries.
- * Returns the size of the result or -1.
- */
-int
-res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
- int op; /* opcode of query */
- const char *dname; /* domain name */
- int class, type; /* class and type of query */
- const u_char *data; /* resource record data */
- int datalen; /* length of data */
- const u_char *newrr_in; /* new rr for modify or append */
- u_char *buf; /* buffer to put query */
- int buflen; /* size of buffer */
-{
- register HEADER *hp;
- register u_char *cp;
- register int n;
- u_char *dnptrs[20], **dpp, **lastdnptr;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_mkquery(%d, %s, %d, %d)\n",
- op, dname, class, type);
-#endif
- /*
- * Initialize header fields.
- */
- if ((buf == NULL) || (buflen < HFIXEDSZ))
- return (-1);
- memset(buf, 0, HFIXEDSZ);
- hp = (HEADER *) buf;
- hp->id = htons(++_res.id);
- hp->opcode = op;
- hp->rd = (_res.options & RES_RECURSE) != 0;
- hp->rcode = NOERROR;
- cp = buf + HFIXEDSZ;
- buflen -= HFIXEDSZ;
- dpp = dnptrs;
- *dpp++ = buf;
- *dpp++ = NULL;
- lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
- /*
- * perform opcode specific processing
- */
- switch (op) {
- case QUERY: /*FALLTHROUGH*/
- case NS_NOTIFY_OP:
- if ((buflen -= QFIXEDSZ) < 0)
- return (-1);
- if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
- return (-1);
- cp += n;
- buflen -= n;
- __putshort(type, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- hp->qdcount = htons(1);
- if (op == QUERY || data == NULL)
- break;
- /*
- * Make an additional record for completion domain.
- */
- buflen -= RRFIXEDSZ;
- n = dn_comp((char *)data, cp, buflen, dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- buflen -= n;
- __putshort(T_NULL, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- __putlong(0, cp);
- cp += INT32SZ;
- __putshort(0, cp);
- cp += INT16SZ;
- hp->arcount = htons(1);
- break;
-
- case IQUERY:
- /*
- * Initialize answer section
- */
- if (buflen < 1 + RRFIXEDSZ + datalen)
- return (-1);
- *cp++ = '\0'; /* no domain name */
- __putshort(type, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- __putlong(0, cp);
- cp += INT32SZ;
- __putshort(datalen, cp);
- cp += INT16SZ;
- if (datalen) {
- memcpy(cp, data, datalen);
- cp += datalen;
- }
- hp->ancount = htons(1);
- break;
-
- default:
- return (-1);
- }
- return (cp - buf);
-}
diff --git a/cpukit/libnetworking/libc/res_mkupdate.c b/cpukit/libnetworking/libc/res_mkupdate.c
deleted file mode 100644
index 56362f650b..0000000000
--- a/cpukit/libnetworking/libc/res_mkupdate.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Based on the Dynamic DNS reference implementation by Viraj Bais
- * <viraj_bais@ccm.fm.intel.com>
- */
-
-#if !defined(__rtems__)
-#if !defined(lint) && !defined(SABER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-#include <sys/types.h>
-#include <sys/param.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <limits.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <ctype.h>
-
-#include "res_config.h"
-
-static int getnum_str(u_char **, u_char *);
-static int getword_str(char *, int, u_char **, u_char *);
-
-#define ShrinkBuffer(x) if ((buflen -= x) < 0) return (-2);
-
-/*
- * Form update packets.
- * Returns the size of the resulting packet if no error
- * On error,
- * returns -1 if error in reading a word/number in rdata
- * portion for update packets
- * -2 if length of buffer passed is insufficient
- * -3 if zone section is not the first section in
- * the linked list, or section order has a problem
- * -4 on a number overflow
- * -5 unknown operation or no records
- */
-int
-res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
- ns_updrec *rrecp_start = rrecp_in;
- HEADER *hp;
- u_char *cp, *sp1, *sp2, *startp, *endp;
- int n, i, soanum, multiline;
- ns_updrec *rrecp;
- struct in_addr ina;
- char buf2[MAXDNAME];
- int section, numrrs = 0, counts[ns_s_max];
- u_int16_t rtype, rclass;
- u_int32_t n1, rttl;
- u_char *dnptrs[20], **dpp, **lastdnptr;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-
- /*
- * Initialize header fields.
- */
- if ((buf == NULL) || (buflen < HFIXEDSZ))
- return (-1);
- memset(buf, 0, HFIXEDSZ);
- hp = (HEADER *) buf;
- hp->id = htons(++_res.id);
- hp->opcode = ns_o_update;
- hp->rcode = NOERROR;
- sp1 = buf + 2*INT16SZ; /* save pointer to zocount */
- cp = buf + HFIXEDSZ;
- buflen -= HFIXEDSZ;
- dpp = dnptrs;
- *dpp++ = buf;
- *dpp++ = NULL;
- lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
-
- if (rrecp_start == NULL)
- return (-5);
- else if (rrecp_start->r_section != S_ZONE)
- return (-3);
-
- memset(counts, 0, sizeof counts);
- for (rrecp = rrecp_start; rrecp; rrecp = rrecp->r_grpnext) {
- numrrs++;
- section = rrecp->r_section;
- if (section < 0 || section >= ns_s_max)
- return (-1);
- counts[section]++;
- for (i = section + 1; i < ns_s_max; i++)
- if (counts[i])
- return (-3);
- rtype = rrecp->r_type;
- rclass = rrecp->r_class;
- rttl = rrecp->r_ttl;
- /* overload class and type */
- if (section == S_PREREQ) {
- rttl = 0;
- switch (rrecp->r_opcode) {
- case YXDOMAIN:
- rclass = C_ANY;
- rtype = T_ANY;
- rrecp->r_size = 0;
- break;
- case NXDOMAIN:
- rclass = C_NONE;
- rtype = T_ANY;
- rrecp->r_size = 0;
- break;
- case NXRRSET:
- rclass = C_NONE;
- rrecp->r_size = 0;
- break;
- case YXRRSET:
- if (rrecp->r_size == 0)
- rclass = C_ANY;
- break;
- default:
- fprintf(stderr,
- "res_mkupdate: incorrect opcode: %d\n",
- rrecp->r_opcode);
- fflush(stderr);
- return (-1);
- }
- } else if (section == S_UPDATE) {
- switch (rrecp->r_opcode) {
- case DELETE:
- rclass = rrecp->r_size == 0 ? C_ANY : C_NONE;
- break;
- case ADD:
- break;
- default:
- fprintf(stderr,
- "res_mkupdate: incorrect opcode: %d\n",
- rrecp->r_opcode);
- fflush(stderr);
- return (-1);
- }
- }
-
- /*
- * XXX appending default domain to owner name is omitted,
- * fqdn must be provided
- */
- if ((n = dn_comp(rrecp->r_dname, cp, buflen, dnptrs,
- lastdnptr)) < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n + 2*INT16SZ);
- PUTSHORT(rtype, cp);
- PUTSHORT(rclass, cp);
- if (section == S_ZONE) {
- if (numrrs != 1 || rrecp->r_type != T_SOA)
- return (-3);
- continue;
- }
- ShrinkBuffer(INT32SZ + INT16SZ);
- PUTLONG(rttl, cp);
- sp2 = cp; /* save pointer to length byte */
- cp += INT16SZ;
- if (rrecp->r_size == 0) {
- if (section == S_UPDATE && rclass != C_ANY)
- return (-1);
- else {
- PUTSHORT(0, sp2);
- continue;
- }
- }
- startp = rrecp->r_data;
- endp = startp + rrecp->r_size - 1;
- /* XXX this should be done centrally. */
- switch (rrecp->r_type) {
- case T_A:
- if (!getword_str(buf2, sizeof buf2, &startp, endp))
- return (-1);
- if (!inet_aton(buf2, &ina))
- return (-1);
- n1 = ntohl(ina.s_addr);
- ShrinkBuffer(INT32SZ);
- PUTLONG(n1, cp);
- break;
- case T_CNAME:
- case T_MB:
- case T_MG:
- case T_MR:
- case T_NS:
- case T_PTR:
- if (!getword_str(buf2, sizeof buf2, &startp, endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen, dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- break;
- case T_MINFO:
- case T_SOA:
- case T_RP:
- for (i = 0; i < 2; i++) {
- if (!getword_str(buf2, sizeof buf2, &startp,
- endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen,
- dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- }
- if (rrecp->r_type == T_SOA) {
- ShrinkBuffer(5 * INT32SZ);
- while (isspace(*startp) || !*startp)
- startp++;
- if (*startp == '(') {
- multiline = 1;
- startp++;
- } else
- multiline = 0;
- /* serial, refresh, retry, expire, minimum */
- for (i = 0; i < 5; i++) {
- soanum = getnum_str(&startp, endp);
- if (soanum < 0)
- return (-1);
- PUTLONG(soanum, cp);
- }
- if (multiline) {
- while (isspace(*startp) || !*startp)
- startp++;
- if (*startp != ')')
- return (-1);
- }
- }
- break;
- case T_MX:
- case T_AFSDB:
- case T_RT:
- n = getnum_str(&startp, endp);
- if (n < 0)
- return (-1);
- PUTSHORT(n, cp);
- ShrinkBuffer(INT16SZ);
- if (!getword_str(buf2, sizeof buf2, &startp, endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen, dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- break;
- case T_PX:
- n = getnum_str(&startp, endp);
- if (n < 0)
- return (-1);
- PUTSHORT(n, cp);
- ShrinkBuffer(INT16SZ);
- for (i = 0; i < 2; i++) {
- if (!getword_str(buf2, sizeof buf2, &startp,
- endp))
- return (-1);
- n = dn_comp(buf2, cp, buflen, dnptrs,
- lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- ShrinkBuffer(n);
- }
- break;
- case T_WKS:
- case T_HINFO:
- case T_TXT:
- case T_X25:
- case T_ISDN:
- case T_NSAP:
- case T_LOC:
- /* XXX - more fine tuning needed here */
- ShrinkBuffer(rrecp->r_size);
- memcpy(cp, rrecp->r_data, rrecp->r_size);
- cp += rrecp->r_size;
- break;
- default:
- return (-1);
- } /*switch*/
- n = (u_int16_t)((cp - sp2) - INT16SZ);
- PUTSHORT(n, sp2);
- } /*for*/
-
- hp->qdcount = htons(counts[0]);
- hp->ancount = htons(counts[1]);
- hp->nscount = htons(counts[2]);
- hp->arcount = htons(counts[3]);
- return (cp - buf);
-}
-
-/*
- * Get a whitespace delimited word from a string (not file)
- * into buf. modify the start pointer to point after the
- * word in the string.
- */
-static int
-getword_str(char *buf, int size, u_char **startpp, u_char *endp) {
- char *cp;
- int c;
-
- for (cp = buf; *startpp <= endp; ) {
- c = **startpp;
- if (isspace(c) || c == '\0') {
- if (cp != buf) /* trailing whitespace */
- break;
- else { /* leading whitespace */
- (*startpp)++;
- continue;
- }
- }
- (*startpp)++;
- if (cp >= buf+size-1)
- break;
- *cp++ = (u_char)c;
- }
- *cp = '\0';
- return (cp != buf);
-}
-
-/*
- * Get a whitespace delimited number from a string (not file) into buf
- * update the start pointer to point after the number in the string.
- */
-static int
-getnum_str(u_char **startpp, u_char *endp) {
- int c, n;
- int seendigit = 0;
- int m = 0;
-
- for (n = 0; *startpp <= endp; ) {
- c = **startpp;
- if (isspace(c) || c == '\0') {
- if (seendigit) /* trailing whitespace */
- break;
- else { /* leading whitespace */
- (*startpp)++;
- continue;
- }
- }
- if (c == ';') {
- while ((*startpp <= endp) &&
- ((c = **startpp) != '\n'))
- (*startpp)++;
- if (seendigit)
- break;
- continue;
- }
- if (!isdigit(c)) {
- if (c == ')' && seendigit) {
- (*startpp)--;
- break;
- }
- return (-1);
- }
- (*startpp)++;
- n = n * 10 + (c - '0');
- seendigit = 1;
- }
- return (n + m);
-}
-
-/*
- * Allocate a resource record buffer & save rr info.
- */
-ns_updrec *
-res_mkupdrec(int section, const char *dname,
- u_int class, u_int type, u_long ttl) {
- ns_updrec *rrecp = (ns_updrec *)calloc(1, sizeof(ns_updrec));
-
- if (!rrecp || !(rrecp->r_dname = strdup(dname)))
- return (NULL);
- rrecp->r_class = class;
- rrecp->r_type = type;
- rrecp->r_ttl = ttl;
- rrecp->r_section = section;
- return (rrecp);
-}
-
-/*
- * Free a resource record buffer created by res_mkupdrec.
- */
-void
-res_freeupdrec(ns_updrec *rrecp) {
- /* Note: freeing r_dp is the caller's responsibility. */
- if (rrecp->r_dname != NULL)
- free(rrecp->r_dname);
- free(rrecp);
-}
diff --git a/cpukit/libnetworking/libc/res_query.c b/cpukit/libnetworking/libc/res_query.c
deleted file mode 100644
index 784fa433bc..0000000000
--- a/cpukit/libnetworking/libc/res_query.c
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid = "From: Id: res_query.c,v 8.14 1997/06/09 17:47:05 halley Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <errno.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "res_config.h"
-
-#if PACKETSZ > 1024
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 1024
-#endif
-
-/*
- * Formulate a normal query, send, and await answer.
- * Returned answer is placed in supplied buffer "answer".
- * Perform preliminary check of answer, returning success only
- * if no error is indicated and the answer count is nonzero.
- * Return the size of the response on success, -1 on error.
- * Error number is left in h_errno.
- *
- * Caller must parse answer and determine whether it answers the question.
- */
-int
-res_query(name, class, type, answer, anslen)
- const char *name; /* domain name */
- int class, type; /* class and type of query */
- u_char *answer; /* buffer to put answer */
- int anslen; /* size of answer buffer */
-{
- u_char buf[MAXPACKET];
- HEADER *hp = (HEADER *) answer;
- int n;
-
- hp->rcode = NOERROR; /* default */
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_query(%s, %d, %d)\n", name, class, type);
-#endif
-
- n = res_mkquery(QUERY, name, class, type, NULL, 0, NULL,
- buf, sizeof(buf));
- if (n <= 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_query: mkquery failed\n");
-#endif
- h_errno = NO_RECOVERY;
- return (n);
- }
- n = res_send(buf, n, answer, anslen);
- if (n < 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_query: send error\n");
-#endif
- h_errno = TRY_AGAIN;
- return (n);
- }
-
- if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) {
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; rcode = %d, ancount=%d\n", hp->rcode,
- ntohs(hp->ancount));
-#endif
- switch (hp->rcode) {
- case NXDOMAIN:
- h_errno = HOST_NOT_FOUND;
- break;
- case SERVFAIL:
- h_errno = TRY_AGAIN;
- break;
- case NOERROR:
- h_errno = NO_DATA;
- break;
- case FORMERR:
- case NOTIMP:
- case REFUSED:
- default:
- h_errno = NO_RECOVERY;
- break;
- }
- return (-1);
- }
- return (n);
-}
-
-/*
- * Formulate a normal query, send, and retrieve answer in supplied buffer.
- * Return the size of the response on success, -1 on error.
- * If enabled, implement search rules until answer or unrecoverable failure
- * is detected. Error code, if any, is left in h_errno.
- */
-int
-res_search(name, class, type, answer, anslen)
- const char *name; /* domain name */
- int class, type; /* class and type of query */
- u_char *answer; /* buffer to put answer */
- int anslen; /* size of answer */
-{
- const char *cp, * const *domain;
- HEADER *hp = (HEADER *) answer;
- u_int dots;
- int trailing_dot, ret, saved_herrno;
- int got_nodata = 0, got_servfail = 0, tried_as_is = 0;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
- errno = 0;
- h_errno = HOST_NOT_FOUND; /* default, if we never query */
- dots = 0;
- for (cp = name; *cp; cp++)
- dots += (*cp == '.');
- trailing_dot = 0;
- if (cp > name && *--cp == '.')
- trailing_dot++;
-
- /* If there aren't any dots, it could be a user-level alias */
- if (!dots && (cp = hostalias(name)) != NULL)
- return (res_query(cp, class, type, answer, anslen));
-
- /*
- * If there are dots in the name already, let's just give it a try
- * 'as is'. The threshold can be set with the "ndots" option.
- */
- saved_herrno = -1;
- if (dots >= _res.ndots) {
- ret = res_querydomain(name, NULL, class, type, answer, anslen);
- if (ret > 0)
- return (ret);
- saved_herrno = h_errno;
- tried_as_is++;
- }
-
- /*
- * We do at least one level of search if
- * - there is no dot and RES_DEFNAME is set, or
- * - there is at least one dot, there is no trailing dot,
- * and RES_DNSRCH is set.
- */
- if ((!dots && (_res.options & RES_DEFNAMES)) ||
- (dots && !trailing_dot && (_res.options & RES_DNSRCH))) {
- int done = 0;
-
- for (domain = (const char * const *)_res.dnsrch;
- *domain && !done;
- domain++) {
-
- ret = res_querydomain(name, *domain, class, type,
- answer, anslen);
- if (ret > 0)
- return (ret);
-
- /*
- * If no server present, give up.
- * If name isn't found in this domain,
- * keep trying higher domains in the search list
- * (if that's enabled).
- * On a NO_DATA error, keep trying, otherwise
- * a wildcard entry of another type could keep us
- * from finding this entry higher in the domain.
- * If we get some other error (negative answer or
- * server failure), then stop searching up,
- * but try the input name below in case it's
- * fully-qualified.
- */
- if (errno == ECONNREFUSED) {
- h_errno = TRY_AGAIN;
- return (-1);
- }
-
- switch (h_errno) {
- case NO_DATA:
- got_nodata++;
- /* FALLTHROUGH */
- case HOST_NOT_FOUND:
- /* keep trying */
- break;
- case TRY_AGAIN:
- if (hp->rcode == SERVFAIL) {
- /* try next search element, if any */
- got_servfail++;
- break;
- }
- /* FALLTHROUGH */
- default:
- /* anything else implies that we're done */
- done++;
- }
-
- /* if we got here for some reason other than DNSRCH,
- * we only wanted one iteration of the loop, so stop.
- */
- if (!(_res.options & RES_DNSRCH))
- done++;
- }
- }
-
- /*
- * If we have not already tried the name "as is", do that now.
- * note that we do this regardless of how many dots were in the
- * name or whether it ends with a dot unless NOTLDQUERY is set.
- */
- if (!tried_as_is && (dots || !(_res.options & RES_NOTLDQUERY))) {
- ret = res_querydomain(name, NULL, class, type, answer, anslen);
- if (ret > 0)
- return (ret);
- }
-
- /* if we got here, we didn't satisfy the search.
- * if we did an initial full query, return that query's h_errno
- * (note that we wouldn't be here if that query had succeeded).
- * else if we ever got a nodata, send that back as the reason.
- * else send back meaningless h_errno, that being the one from
- * the last DNSRCH we did.
- */
- if (saved_herrno != -1)
- h_errno = saved_herrno;
- else if (got_nodata)
- h_errno = NO_DATA;
- else if (got_servfail)
- h_errno = TRY_AGAIN;
- return (-1);
-}
-
-/*
- * Perform a call on res_query on the concatenation of name and domain,
- * removing a trailing dot from name if domain is NULL.
- */
-int
-res_querydomain(name, domain, class, type, answer, anslen)
- const char *name, *domain;
- int class, type; /* class and type of query */
- u_char *answer; /* buffer to put answer */
- int anslen; /* size of answer */
-{
- char nbuf[MAXDNAME];
- const char *longname = nbuf;
- int n, d;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-#ifdef DEBUG
- if (_res.options & RES_DEBUG)
- printf(";; res_querydomain(%s, %s, %d, %d)\n",
- name, domain?domain:"<Nil>", class, type);
-#endif
- if (domain == NULL) {
- /*
- * Check for trailing '.';
- * copy without '.' if present.
- */
- n = strlen(name);
- if (n >= MAXDNAME) {
- h_errno = NO_RECOVERY;
- return (-1);
- }
- n--;
- if (n >= 0 && name[n] == '.') {
- strncpy(nbuf, name, n);
- nbuf[n] = '\0';
- } else
- longname = name;
- } else {
- n = strlen(name);
- d = strlen(domain);
- if (n + d + 1 >= MAXDNAME) {
- h_errno = NO_RECOVERY;
- return (-1);
- }
- sprintf(nbuf, "%s.%s", name, domain);
- }
- return (res_query(longname, class, type, answer, anslen));
-}
-
-const char *
-hostalias(name)
- const char *name;
-{
- register char *cp1, *cp2;
- FILE *fp;
- char *file;
- char buf[BUFSIZ];
- static char abuf[MAXDNAME];
-
- if (_res.options & RES_NOALIASES)
- return (NULL);
- if (issetugid())
- return (NULL);
- file = getenv("HOSTALIASES");
- if (file == NULL || (fp = fopen(file, "r")) == NULL)
- return (NULL);
- setbuf(fp, NULL);
- buf[sizeof(buf) - 1] = '\0';
- while (fgets(buf, sizeof(buf), fp)) {
- for (cp1 = buf; *cp1 && !isspace((int)*cp1); ++cp1)
- ;
- if (!*cp1)
- break;
- *cp1 = '\0';
- if (!strcasecmp(buf, name)) {
- while (isspace((int)*++cp1))
- ;
- if (!*cp1)
- break;
- for (cp2 = cp1 + 1; *cp2 && !isspace((int)*cp2); ++cp2)
- ;
- abuf[sizeof(abuf) - 1] = *cp2 = '\0';
- strncpy(abuf, cp1, sizeof(abuf) - 1);
- fclose(fp);
- return (abuf);
- }
- }
- fclose(fp);
- return (NULL);
-}
diff --git a/cpukit/libnetworking/libc/res_send.c b/cpukit/libnetworking/libc/res_send.c
deleted file mode 100644
index 08cb78490f..0000000000
--- a/cpukit/libnetworking/libc/res_send.c
+++ /dev/null
@@ -1,929 +0,0 @@
-/*
- * Copyright (c) 1985, 1989, 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.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
-static char orig_rcsid[] = "From: Id: res_send.c,v 8.20 1998/04/06 23:27:51 halley Exp $";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Send query to name server and wait for reply.
- */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <poll.h>
-
-#include "res_config.h"
-
-#if !defined(__rtems__)
-#ifdef NOPOLL /* libc_r doesn't wrap poll yet() */
-static int use_poll = 0;
-#else
-static int use_poll = 1; /* adapt to poll() syscall availability */
- /* 0 = not present, 1 = try it, 2 = exists */
-#endif
-#endif
-
-static int s = -1; /* socket used for communications */
-static int connected = 0; /* is the socket connected */
-static int vc = 0; /* is the socket a virtual circuit? */
-static res_send_qhook Qhook = NULL;
-static res_send_rhook Rhook = NULL;
-
-
-#define CAN_RECONNECT 1
-
-#ifndef DEBUG
-# define Dprint(cond, args) /*empty*/
-# define DprintQ(cond, args, query, size) /*empty*/
-# define Aerror(file, string, error, address) /*empty*/
-# define Perror(file, string, error) /*empty*/
-#else
-# define Dprint(cond, args) if (cond) {fprintf args;} else {}
-# define DprintQ(cond, args, query, size) if (cond) {\
- fprintf args;\
- __fp_nquery(query, size, stdout);\
- } else {}
- static void
- Aerror(file, string, error, address)
- FILE *file;
- char *string;
- int error;
- struct sockaddr_in address;
- {
- int save = errno;
-
- if (_res.options & RES_DEBUG) {
- fprintf(file, "res_send: %s ([%s].%u): %s\n",
- string,
- inet_ntoa(address.sin_addr),
- ntohs(address.sin_port),
- strerror(error));
- }
- errno = save;
- }
- static void
- Perror(file, string, error)
- FILE *file;
- char *string;
- int error;
- {
- int save = errno;
-
- if (_res.options & RES_DEBUG) {
- fprintf(file, "res_send: %s: %s\n",
- string, strerror(error));
- }
- errno = save;
- }
-#endif
-
-void
-res_send_setqhook(hook)
- res_send_qhook hook;
-{
-
- Qhook = hook;
-}
-
-void
-res_send_setrhook(hook)
- res_send_rhook hook;
-{
-
- Rhook = hook;
-}
-
-/* int
- * res_isourserver(ina)
- * looks up "ina" in _res.ns_addr_list[]
- * returns:
- * 0 : not found
- * >0 : found
- * author:
- * paul vixie, 29may94
- */
-int
-res_isourserver(inp)
- const struct sockaddr_in *inp;
-{
- struct sockaddr_in ina;
- int ns, ret;
-
- ina = *inp;
- ret = 0;
- for (ns = 0; ns < _res.nscount; ns++) {
- const struct sockaddr_in *srv = &_res.nsaddr_list[ns];
-
- if (srv->sin_family == ina.sin_family &&
- srv->sin_port == ina.sin_port &&
- (srv->sin_addr.s_addr == INADDR_ANY ||
- srv->sin_addr.s_addr == ina.sin_addr.s_addr)) {
- ret++;
- break;
- }
- }
- return (ret);
-}
-
-/* int
- * res_nameinquery(name, type, class, buf, eom)
- * look for (name,type,class) in the query section of packet (buf,eom)
- * requires:
- * buf + HFIXEDSZ <= eom
- * returns:
- * -1 : format error
- * 0 : not found
- * >0 : found
- * author:
- * paul vixie, 29may94
- */
-int
-res_nameinquery(name, type, class, buf, eom)
- const char *name;
- int type, class;
- const u_char *buf, *eom;
-{
- const u_char *cp = buf + HFIXEDSZ;
- int qdcount = ntohs(((HEADER*)buf)->qdcount);
-
- while (qdcount-- > 0) {
- char tname[MAXDNAME+1];
- int n, ttype, tclass;
-
- n = dn_expand(buf, eom, cp, tname, sizeof tname);
- if (n < 0)
- return (-1);
- cp += n;
- if (cp + 2 * INT16SZ > eom)
- return (-1);
- ttype = ns_get16(cp); cp += INT16SZ;
- tclass = ns_get16(cp); cp += INT16SZ;
- if (ttype == type &&
- tclass == class &&
- strcasecmp(tname, name) == 0)
- return (1);
- }
- return (0);
-}
-
-/* int
- * res_queriesmatch(buf1, eom1, buf2, eom2)
- * is there a 1:1 mapping of (name,type,class)
- * in (buf1,eom1) and (buf2,eom2)?
- * returns:
- * -1 : format error
- * 0 : not a 1:1 mapping
- * >0 : is a 1:1 mapping
- * author:
- * paul vixie, 29may94
- */
-int
-res_queriesmatch(buf1, eom1, buf2, eom2)
- const u_char *buf1, *eom1;
- const u_char *buf2, *eom2;
-{
- const u_char *cp = buf1 + HFIXEDSZ;
- int qdcount = ntohs(((HEADER*)buf1)->qdcount);
-
- if (buf1 + HFIXEDSZ > eom1 || buf2 + HFIXEDSZ > eom2)
- return (-1);
-
- /*
- * Only header section present in replies to
- * dynamic update packets.
- */
- if ( (((HEADER *)buf1)->opcode == ns_o_update) &&
- (((HEADER *)buf2)->opcode == ns_o_update) )
- return (1);
-
- if (qdcount != ntohs(((HEADER*)buf2)->qdcount))
- return (0);
- while (qdcount-- > 0) {
- char tname[MAXDNAME+1];
- int n, ttype, tclass;
-
- n = dn_expand(buf1, eom1, cp, tname, sizeof tname);
- if (n < 0)
- return (-1);
- cp += n;
- if (cp + 2 * INT16SZ > eom1)
- return (-1);
- ttype = ns_get16(cp); cp += INT16SZ;
- tclass = ns_get16(cp); cp += INT16SZ;
- if (!res_nameinquery(tname, ttype, tclass, buf2, eom2))
- return (0);
- }
- return (1);
-}
-
-int
-res_send(buf, buflen, ans, anssiz)
- const u_char *buf;
- int buflen;
- u_char *ans;
- int anssiz;
-{
- HEADER *hp = (HEADER *) buf;
- HEADER *anhp = (HEADER *) ans;
- int gotsomewhere, connreset, terrno, try, v_circuit, resplen, ns, n;
- u_int badns; /* XXX NSMAX can't exceed #/bits in this variable */
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- /* errno should have been set by res_init() in this case. */
- return (-1);
- }
- if (anssiz < HFIXEDSZ) {
- errno = EINVAL;
- return (-1);
- }
- DprintQ((_res.options & RES_DEBUG) || (_res.pfcode & RES_PRF_QUERY),
- (stdout, ";; res_send()\n"), buf, buflen);
- v_circuit = (_res.options & RES_USEVC) || buflen > PACKETSZ;
- gotsomewhere = 0;
- connreset = 0;
- terrno = ETIMEDOUT;
- badns = 0;
-
- /*
- * Send request, RETRY times, or until successful
- */
- for (try = 0; try < _res.retry; try++) {
- for (ns = 0; ns < _res.nscount; ns++) {
- struct sockaddr_in *nsap = &_res.nsaddr_list[ns];
- same_ns:
- if (badns & (1 << ns)) {
- res_close();
- goto next_ns;
- }
-
- if (Qhook) {
- int done = 0, loops = 0;
-
- do {
- res_sendhookact act;
-
- act = (*Qhook)(&nsap, &buf, &buflen,
- ans, anssiz, &resplen);
- switch (act) {
- case res_goahead:
- done = 1;
- break;
- case res_nextns:
- res_close();
- goto next_ns;
- case res_done:
- return (resplen);
- case res_modified:
- /* give the hook another try */
- if (++loops < 42) /*doug adams*/
- break;
- /*FALLTHROUGH*/
- case res_error:
- /*FALLTHROUGH*/
- default:
- return (-1);
- }
- } while (!done);
- }
-
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; Querying server (# %d) address = %s\n",
- ns + 1, inet_ntoa(nsap->sin_addr)));
-
- if (v_circuit) {
- int truncated;
-#if !defined(__rtems__)
- struct iovec iov[2];
-#endif
- u_short len;
- u_char *cp;
-
- /*
- * Use virtual circuit;
- * at most one attempt per server.
- */
- try = _res.retry;
- truncated = 0;
- if (s < 0 || !vc || hp->opcode == ns_o_update) {
- if (s >= 0)
- res_close();
-
- s = socket(PF_INET, SOCK_STREAM, 0);
- if (s < 0) {
- terrno = errno;
- Perror(stderr, "socket(vc)", errno);
- return (-1);
- }
- errno = 0;
- if (connect(s, (struct sockaddr *)nsap,
- sizeof *nsap) < 0) {
- terrno = errno;
- Aerror(stderr, "connect/vc",
- errno, *nsap);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- vc = 1;
- }
- /*
- * Send length & message
- */
- putshort((u_short)buflen, (u_char*)&len);
-#if !defined(__rtems__)
- iov[0].iov_base = (caddr_t)&len;
- iov[0].iov_len = INT16SZ;
- iov[1].iov_base = (caddr_t)buf;
- iov[1].iov_len = buflen;
- if (writev(s, iov, 2) != (INT16SZ + buflen)) {
-#else
- /*
- * RTEMS doesn't have writev (yet)
- */
- if ((write (s, &len, INT16SZ) != INT16SZ)
- || (write (s, buf, buflen) != buflen)) {
-#endif
- terrno = errno;
- Perror(stderr, "write failed", errno);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- /*
- * Receive length & response
- */
-read_len:
- cp = ans;
- len = INT16SZ;
- while ((n = read(s, (char *)cp, (int)len)) > 0) {
- cp += n;
- if ((len -= n) <= 0)
- break;
- }
- if (n <= 0) {
- terrno = errno;
- Perror(stderr, "read failed", errno);
- res_close();
- /*
- * A long running process might get its TCP
- * connection reset if the remote server was
- * restarted. Requery the server instead of
- * trying a new one. When there is only one
- * server, this means that a query might work
- * instead of failing. We only allow one reset
- * per query to prevent looping.
- */
- if (terrno == ECONNRESET && !connreset) {
- connreset = 1;
- res_close();
- goto same_ns;
- }
- res_close();
- goto next_ns;
- }
- resplen = ns_get16(ans);
- if (resplen > anssiz) {
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; response truncated\n")
- );
- truncated = 1;
- len = anssiz;
- } else
- len = resplen;
- if (len < HFIXEDSZ) {
- /*
- * Undersized message.
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; undersized: %d\n", len));
- terrno = EMSGSIZE;
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- cp = ans;
- while (len != 0 &&
- (n = read(s, (char *)cp, (int)len)) > 0) {
- cp += n;
- len -= n;
- }
- if (n <= 0) {
- terrno = errno;
- Perror(stderr, "read(vc)", errno);
- res_close();
- goto next_ns;
- }
- if (truncated) {
- /*
- * Flush rest of answer
- * so connection stays in synch.
- */
- anhp->tc = 1;
- len = resplen - anssiz;
- while (len != 0) {
- char junk[PACKETSZ];
-
- n = (len > sizeof(junk)
- ? sizeof(junk)
- : len);
- if ((n = read(s, junk, n)) > 0)
- len -= n;
- else
- break;
- }
- }
- /*
- * The calling applicating has bailed out of
- * a previous call and failed to arrange to have
- * the circuit closed or the server has got
- * itself confused. Anyway drop the packet and
- * wait for the correct one.
- */
- if (hp->id != anhp->id) {
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; old answer (unexpected):\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto read_len;
- }
- } else {
- /*
- * Use datagrams.
- */
-#ifndef NOPOLL
- struct pollfd pfd;
- int msec;
-#endif
- struct timeval timeout;
-#ifndef NOSELECT
- fd_set dsmask, *dsmaskp;
- int dsmasklen;
-#endif
- struct sockaddr_in from;
- int fromlen;
-
- if ((s < 0) || vc) {
- if (vc)
- res_close();
- s = socket(PF_INET, SOCK_DGRAM, 0);
- if (s < 0) {
-#ifndef CAN_RECONNECT
- bad_dg_sock:
-#endif
- terrno = errno;
- Perror(stderr, "socket(dg)", errno);
- return (-1);
- }
- connected = 0;
- }
-#ifndef CANNOT_CONNECT_DGRAM
- /*
- * On a 4.3BSD+ machine (client and server,
- * actually), sending to a nameserver datagram
- * port with no nameserver will cause an
- * ICMP port unreachable message to be returned.
- * If our datagram socket is "connected" to the
- * server, we get an ECONNREFUSED error on the next
- * socket operation, and select returns if the
- * error message is received. We can thus detect
- * the absence of a nameserver without timing out.
- * If we have sent queries to at least two servers,
- * however, we don't want to remain connected,
- * as we wish to receive answers from the first
- * server to respond.
- */
- if (_res.nscount == 1 || (try == 0 && ns == 0)) {
- /*
- * Connect only if we are sure we won't
- * receive a response from another server.
- */
- if (!connected) {
- if (connect(s, (struct sockaddr *)nsap,
- sizeof *nsap
- ) < 0) {
- Aerror(stderr,
- "connect(dg)",
- errno, *nsap);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- connected = 1;
- }
- if (send(s, (char*)buf, buflen, 0) != buflen) {
- Perror(stderr, "send", errno);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- } else {
- /*
- * Disconnect if we want to listen
- * for responses from more than one server.
- */
- if (connected) {
-#ifdef CAN_RECONNECT
- struct sockaddr_in no_addr;
-
- no_addr.sin_family = AF_INET;
- no_addr.sin_addr.s_addr = INADDR_ANY;
- no_addr.sin_port = 0;
- (void) connect(s,
- (struct sockaddr *)
- &no_addr,
- sizeof no_addr);
-#else
- int s1 = socket(PF_INET, SOCK_DGRAM,0);
- if (s1 < 0)
- goto bad_dg_sock;
- (void) dup2(s1, s);
- (void) close(s1);
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; new DG socket\n"))
-#endif /* CAN_RECONNECT */
- connected = 0;
- errno = 0;
- }
-#endif /* !CANNOT_CONNECT_DGRAM */
- if (sendto(s, (char*)buf, buflen, 0,
- (struct sockaddr *)nsap,
- sizeof *nsap)
- != buflen) {
- Aerror(stderr, "sendto", errno, *nsap);
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
-#ifndef CANNOT_CONNECT_DGRAM
- }
-#endif /* !CANNOT_CONNECT_DGRAM */
-
- /*
- * Wait for reply
- */
-#ifndef NOPOLL
- othersyscall:
- if (use_poll) {
- msec = (_res.retrans << try) * 1000;
- if (try > 0)
- msec /= _res.nscount;
- if (msec <= 0)
- msec = 1000;
- } else {
-#endif
- timeout.tv_sec = (_res.retrans << try);
- if (try > 0)
- timeout.tv_sec /= _res.nscount;
- if ((long) timeout.tv_sec <= 0)
- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
-#ifndef NOPOLL
- }
-#endif
- wait:
- if (s < 0) {
- Perror(stderr, "s out-of-bounds", EMFILE);
- res_close();
- goto next_ns;
- }
-#ifndef NOPOLL
- if (use_poll) {
- struct sigaction sa, osa;
- int sigsys_installed = 0;
-
- pfd.fd = s;
- pfd.events = POLLIN;
- if (use_poll == 1) {
- bzero(&sa, sizeof(sa));
- sa.sa_handler = SIG_IGN;
- if (sigaction(SIGSYS, &sa, &osa) >= 0)
- sigsys_installed = 1;
- }
- n = poll(&pfd, 1, msec);
- if (sigsys_installed == 1) {
- int oerrno = errno;
- sigaction(SIGSYS, &osa, NULL);
- errno = oerrno;
- }
- /* XXX why does nosys() return EINVAL? */
- if (n < 0 && (errno == ENOSYS ||
- errno == EINVAL)) {
- use_poll = 0;
- goto othersyscall;
- } else if (use_poll == 1)
- use_poll = 2;
- if (n < 0) {
- if (errno == EINTR)
- goto wait;
- Perror(stderr, "poll", errno);
- res_close();
- goto next_ns;
- }
- } else {
-#endif
-#ifndef NOSELECT
- dsmasklen = howmany(s + 1, NFDBITS) *
- sizeof(fd_mask);
- if (dsmasklen > sizeof(fd_set)) {
- dsmaskp = (fd_set *)malloc(dsmasklen);
- if (dsmaskp == NULL) {
- res_close();
- goto next_ns;
- }
- } else
- dsmaskp = &dsmask;
- /* only zero what we need */
- bzero((char *)dsmaskp, dsmasklen);
- FD_SET(s, dsmaskp);
- n = select(s + 1, dsmaskp, (fd_set *)NULL,
- (fd_set *)NULL, &timeout);
- if (dsmaskp != &dsmask)
- free(dsmaskp);
- if (n < 0) {
- if (errno == EINTR)
- goto wait;
- Perror(stderr, "select", errno);
- res_close();
- goto next_ns;
- }
-#endif
-#ifndef NOPOLL
- }
-#endif
-
-#ifdef NOSELECT
- setsockopt (s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof timeout);
-#else
- if (n == 0) {
- /*
- * timeout
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; timeout\n"));
- gotsomewhere = 1;
- res_close();
- goto next_ns;
- }
-#endif
- errno = 0;
- fromlen = sizeof(struct sockaddr_in);
- resplen = recvfrom(s, (char*)ans, anssiz, 0,
- (struct sockaddr *)&from, &fromlen);
- if (resplen <= 0) {
-#ifdef NOSELECT
- if (errno == ETIMEDOUT) {
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; timeout\n"));
- gotsomewhere = 1;
- res_close();
- goto next_ns;
- }
-#endif
- Perror(stderr, "recvfrom", errno);
- res_close();
- goto next_ns;
- }
- gotsomewhere = 1;
- if (resplen < HFIXEDSZ) {
- /*
- * Undersized message.
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; undersized: %d\n",
- resplen));
- terrno = EMSGSIZE;
- badns |= (1 << ns);
- res_close();
- goto next_ns;
- }
- if (hp->id != anhp->id) {
- /*
- * response from old query, ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; old answer:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto wait;
- }
-#ifdef CHECK_SRVR_ADDR
- if (!(_res.options & RES_INSECURE1) &&
- !res_isourserver(&from)) {
- /*
- * response from wrong server? ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; not our server:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto wait;
- }
-#endif
- if (!(_res.options & RES_INSECURE2) &&
- !res_queriesmatch(buf, buf + buflen,
- ans, ans + anssiz)) {
- /*
- * response contains wrong query? ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, ";; wrong query name:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- goto wait;
- }
- if (anhp->rcode == SERVFAIL ||
- anhp->rcode == NOTIMP ||
- anhp->rcode == REFUSED) {
- DprintQ(_res.options & RES_DEBUG,
- (stdout, "server rejected query:\n"),
- ans, (resplen>anssiz)?anssiz:resplen);
- badns |= (1 << ns);
- res_close();
- /* don't retry if called from dig */
- if (!_res.pfcode)
- goto next_ns;
- }
- if (!(_res.options & RES_IGNTC) && anhp->tc) {
- /*
- * get rest of answer;
- * use TCP with same server.
- */
- Dprint(_res.options & RES_DEBUG,
- (stdout, ";; truncated answer\n"));
- v_circuit = 1;
- res_close();
- goto same_ns;
- }
- } /*if vc/dg*/
- Dprint((_res.options & RES_DEBUG) ||
- ((_res.pfcode & RES_PRF_REPLY) &&
- (_res.pfcode & RES_PRF_HEAD1)),
- (stdout, ";; got answer:\n"));
- DprintQ((_res.options & RES_DEBUG) ||
- (_res.pfcode & RES_PRF_REPLY),
- (stdout, "%s", ""),
- ans, (resplen>anssiz)?anssiz:resplen);
- /*
- * If using virtual circuits, we assume that the first server
- * is preferred over the rest (i.e. it is on the local
- * machine) and only keep that one open.
- * If we have temporarily opened a virtual circuit,
- * or if we haven't been asked to keep a socket open,
- * close the socket.
- */
- if ((v_circuit && (!(_res.options & RES_USEVC) || ns != 0)) ||
- !(_res.options & RES_STAYOPEN)) {
- res_close();
- }
- if (Rhook) {
- int done = 0, loops = 0;
-
- do {
- res_sendhookact act;
-
- act = (*Rhook)(nsap, buf, buflen,
- ans, anssiz, &resplen);
- switch (act) {
- case res_goahead:
- case res_done:
- done = 1;
- break;
- case res_nextns:
- res_close();
- goto next_ns;
- case res_modified:
- /* give the hook another try */
- if (++loops < 42) /*doug adams*/
- break;
- /*FALLTHROUGH*/
- case res_error:
- /*FALLTHROUGH*/
- default:
- return (-1);
- }
- } while (!done);
-
- }
- return (resplen);
- next_ns: ;
- } /*foreach ns*/
- } /*foreach retry*/
- res_close();
- if (!v_circuit) {
- if (!gotsomewhere)
- errno = ECONNREFUSED; /* no nameservers found */
- else
- errno = ETIMEDOUT; /* no answer obtained */
- } else
- errno = terrno;
- return (-1);
-}
-
-/*
- * This routine is for closing the socket if a virtual circuit is used and
- * the program wants to close it. This provides support for endhostent()
- * which expects to close the socket.
- *
- * This routine is not expected to be user visible.
- */
-void
-res_close()
-{
- if (s >= 0) {
- (void) close(s);
- s = -1;
- connected = 0;
- vc = 0;
- }
-}
diff --git a/cpukit/libnetworking/libc/res_stubs.c b/cpukit/libnetworking/libc/res_stubs.c
deleted file mode 100644
index 92cf0fac54..0000000000
--- a/cpukit/libnetworking/libc/res_stubs.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 1996 Peter Wemm <peter@freebsd.org>.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- * $Id$
- */
-
-/*
- * This file is for FreeBSD-3.0 that has a bind-4.9.5-P1 derived
- * resolver in the libc. It provides aliases for functions that
- * have moved since 4.9.4-P1.
- *
- * I'll save everybody the trouble and say it now: *THIS IS A HACK*!
- *
- * Yes, many of these are private functions to the resolver, but some are
- * needed as there is no other way to provide the functionality and they've
- * turned up all over the place. :-(
- */
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-__weak_reference(__inet_addr, inet_addr);
-__weak_reference(__inet_aton, inet_aton);
-__weak_reference(__inet_lnaof, inet_lnaof);
-__weak_reference(__inet_makeaddr, inet_makeaddr);
-__weak_reference(__inet_neta, inet_neta);
-__weak_reference(__inet_netof, inet_netof);
-__weak_reference(__inet_network, inet_network);
-__weak_reference(__inet_net_ntop, inet_net_ntop);
-__weak_reference(__inet_net_pton, inet_net_pton);
-__weak_reference(__inet_ntoa, inet_ntoa);
-__weak_reference(__inet_pton, inet_pton);
-__weak_reference(__inet_ntop, inet_ntop);
-__weak_reference(__inet_nsap_addr, inet_nsap_addr);
-__weak_reference(__inet_nsap_ntoa, inet_nsap_ntoa);
-
-__weak_reference(__sym_ston, sym_ston);
-__weak_reference(__sym_ntos, sym_ntos);
-__weak_reference(__sym_ntop, sym_ntop);
-__weak_reference(__fp_resstat, fp_resstat);
-__weak_reference(__p_query, p_query);
-__weak_reference(__p_fqnname, p_fqnname);
-__weak_reference(__p_secstodate, p_secstodate);
-__weak_reference(__dn_count_labels, dn_count_labels);
-__weak_reference(__dn_comp, dn_comp);
-__weak_reference(__res_close, _res_close);
-__weak_reference(__dn_expand, dn_expand);
-__weak_reference(__res_init, res_init);
-__weak_reference(__res_query, res_query);
-__weak_reference(__res_search, res_search);
-__weak_reference(__res_querydomain, res_querydomain);
-__weak_reference(__res_mkquery, res_mkquery);
-__weak_reference(__res_send, res_send);
diff --git a/cpukit/libnetworking/libc/res_update.c b/cpukit/libnetworking/libc/res_update.c
deleted file mode 100644
index ef591e0674..0000000000
--- a/cpukit/libnetworking/libc/res_update.c
+++ /dev/null
@@ -1,518 +0,0 @@
-#if !defined(__rtems__)
-#if !defined(lint) && !defined(SABER)
-static char rcsid[] = "$Id$";
-#endif /* not lint */
-#endif /* not rtems */
-
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Based on the Dynamic DNS reference implementation by Viraj Bais
- * <viraj_bais@ccm.fm.intel.com>
- */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <errno.h>
-#include <limits.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/*
- * Separate a linked list of records into groups so that all records
- * in a group will belong to a single zone on the nameserver.
- * Create a dynamic update packet for each zone and send it to the
- * nameservers for that zone, and await answer.
- * Abort if error occurs in updating any zone.
- * Return the number of zones updated on success, < 0 on error.
- *
- * On error, caller must deal with the unsynchronized zones
- * eg. an A record might have been successfully added to the forward
- * zone but the corresponding PTR record would be missing if error
- * was encountered while updating the reverse zone.
- */
-
-#define NSMAX 16
-
-struct ns1 {
- char nsname[MAXDNAME];
- struct in_addr nsaddr1;
-};
-
-struct zonegrp {
- char z_origin[MAXDNAME];
- int16_t z_class;
- char z_soardata[MAXDNAME + 5 * INT32SZ];
- struct ns1 z_ns[NSMAX];
- int z_nscount;
- ns_updrec * z_rr;
- struct zonegrp *z_next;
-};
-
-
-int
-res_update(ns_updrec *rrecp_in) {
- ns_updrec *rrecp, *tmprrecp;
- u_char buf[PACKETSZ], answer[PACKETSZ], packet[2*PACKETSZ];
- char name[MAXDNAME], zname[MAXDNAME], primary[MAXDNAME],
- mailaddr[MAXDNAME];
- u_char soardata[2*MAXCDNAME+5*INT32SZ];
- char *dname, *svdname, *cp1, *target;
- u_char *cp, *eom;
- HEADER *hp = (HEADER *) answer;
- struct zonegrp *zptr = NULL, *tmpzptr, *prevzptr, *zgrp_start = NULL;
- int i, j, k = 0, n, ancount, nscount, arcount, rcode, rdatasize,
- newgroup, done, myzone, seen_before, numzones = 0;
- u_int16_t dlen, class, qclass, type, qtype;
- u_int32_t ttl;
-
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
- return (-1);
- }
-
- for (rrecp = rrecp_in; rrecp; rrecp = rrecp->r_next) {
- dname = rrecp->r_dname;
- n = strlen(dname);
- if (dname[n-1] == '.')
- dname[n-1] = '\0';
- qtype = T_SOA;
- qclass = rrecp->r_class;
- done = 0;
- seen_before = 0;
-
- while (!done && dname) {
- if (qtype == T_SOA) {
- for (tmpzptr = zgrp_start;
- tmpzptr && !seen_before;
- tmpzptr = tmpzptr->z_next) {
- if (strcasecmp(dname,
- tmpzptr->z_origin) == 0 &&
- tmpzptr->z_class == qclass)
- seen_before++;
- for (tmprrecp = tmpzptr->z_rr;
- tmprrecp && !seen_before;
- tmprrecp = tmprrecp->r_grpnext)
- if (strcasecmp(dname, tmprrecp->r_dname) == 0
- && tmprrecp->r_class == qclass) {
- seen_before++;
- break;
- }
- if (seen_before) {
- /*
- * Append to the end of
- * current group.
- */
- for (tmprrecp = tmpzptr->z_rr;
- tmprrecp->r_grpnext;
- tmprrecp = tmprrecp->r_grpnext)
- (void)NULL;
- tmprrecp->r_grpnext = rrecp;
- rrecp->r_grpnext = NULL;
- done = 1;
- break;
- }
- }
- } else if (qtype == T_A) {
- for (tmpzptr = zgrp_start;
- tmpzptr && !done;
- tmpzptr = tmpzptr->z_next)
- for (i = 0; i < tmpzptr->z_nscount; i++)
- if (tmpzptr->z_class == qclass &&
- strcasecmp(tmpzptr->z_ns[i].nsname,
- dname) == 0 &&
- tmpzptr->z_ns[i].nsaddr1.s_addr != 0) {
- zptr->z_ns[k].nsaddr1.s_addr =
- tmpzptr->z_ns[i].nsaddr1.s_addr;
- done = 1;
- break;
- }
- }
- if (done)
- break;
- n = res_mkquery(QUERY, dname, qclass, qtype, NULL,
- 0, NULL, buf, sizeof buf);
- if (n <= 0) {
- fprintf(stderr, "res_update: mkquery failed\n");
- return (n);
- }
- n = res_send(buf, n, answer, sizeof answer);
- if (n < 0) {
- fprintf(stderr, "res_update: send error for %s\n",
- rrecp->r_dname);
- return (n);
- }
- if (n < HFIXEDSZ)
- return (-1);
- ancount = ntohs(hp->ancount);
- nscount = ntohs(hp->nscount);
- arcount = ntohs(hp->arcount);
- rcode = hp->rcode;
- cp = answer + HFIXEDSZ;
- eom = answer + n;
- /* skip the question section */
- n = dn_skipname(cp, eom);
- if (n < 0 || cp + n + 2 * INT16SZ > eom)
- return (-1);
- cp += n + 2 * INT16SZ;
-
- if (qtype == T_SOA) {
- if (ancount == 0 && nscount == 0 && arcount == 0) {
- /*
- * if (rcode == NOERROR) then the dname exists but
- * has no soa record associated with it.
- * if (rcode == NXDOMAIN) then the dname does not
- * exist and the server is replying out of NCACHE.
- * in either case, proceed with the next try
- */
- dname = strchr(dname, '.');
- if (dname != NULL)
- dname++;
- continue;
- } else if ((rcode == NOERROR || rcode == NXDOMAIN) &&
- ancount == 0 &&
- nscount == 1 && arcount == 0) {
- /*
- * name/data does not exist, soa record supplied in the
- * authority section
- */
- /* authority section must contain the soa record */
- if ((n = dn_expand(answer, eom, cp, zname,
- sizeof zname)) < 0)
- return (n);
- cp += n;
- if (cp + 2 * INT16SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- if (type != T_SOA || class != qclass) {
- fprintf(stderr, "unknown answer\n");
- return (-1);
- }
- myzone = 0;
- svdname = dname;
- while (dname)
- if (strcasecmp(dname, zname) == 0) {
- myzone = 1;
- break;
- } else if ((dname = strchr(dname, '.')) != NULL)
- dname++;
- if (!myzone) {
- dname = strchr(svdname, '.');
- if (dname != NULL)
- dname++;
- continue;
- }
- nscount = 0;
- /* fallthrough */
- } else if (rcode == NOERROR && ancount == 1) {
- /*
- * found the zone name
- * new servers will supply NS records for the zone
- * in authority section and A records for those
- * nameservers in the additional section
- * older servers have to be explicitly queried for
- * NS records for the zone
- */
- /* answer section must contain the soa record */
- if ((n = dn_expand(answer, eom, cp, zname,
- sizeof zname)) < 0)
- return (n);
- else
- cp += n;
- if (cp + 2 * INT16SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- if (type == T_CNAME) {
- dname = strchr(dname, '.');
- if (dname != NULL)
- dname++;
- continue;
- }
- if (strcasecmp(dname, zname) != 0 ||
- type != T_SOA ||
- class != rrecp->r_class) {
- fprintf(stderr, "unknown answer\n");
- return (-1);
- }
- /* FALLTHROUGH */
- } else {
- fprintf(stderr,
- "unknown response: ans=%d, auth=%d, add=%d, rcode=%d\n",
- ancount, nscount, arcount, hp->rcode);
- return (-1);
- }
- if (cp + INT32SZ + INT16SZ > eom)
- return (-1);
- /* continue processing the soa record */
- GETLONG(ttl, cp);
- GETSHORT(dlen, cp);
- if (cp + dlen > eom)
- return (-1);
- newgroup = 1;
- zptr = zgrp_start;
- prevzptr = NULL;
- while (zptr) {
- if (strcasecmp(zname, zptr->z_origin) == 0 &&
- type == T_SOA && class == qclass) {
- newgroup = 0;
- break;
- }
- prevzptr = zptr;
- zptr = zptr->z_next;
- }
- if (!newgroup) {
- for (tmprrecp = zptr->z_rr;
- tmprrecp->r_grpnext;
- tmprrecp = tmprrecp->r_grpnext)
- ;
- tmprrecp->r_grpnext = rrecp;
- rrecp->r_grpnext = NULL;
- done = 1;
- cp += dlen;
- break;
- } else {
- if ((n = dn_expand(answer, eom, cp, primary,
- sizeof primary)) < 0)
- return (n);
- cp += n;
- /*
- * We don't have to bounds check here because the
- * next use of 'cp' is in dn_expand().
- */
- cp1 = (char *)soardata;
- strcpy(cp1, primary);
- cp1 += strlen(cp1) + 1;
- if ((n = dn_expand(answer, eom, cp, mailaddr,
- sizeof mailaddr)) < 0)
- return (n);
- cp += n;
- strcpy(cp1, mailaddr);
- cp1 += strlen(cp1) + 1;
- if (cp + 5*INT32SZ > eom)
- return (-1);
- memcpy(cp1, cp, 5*INT32SZ);
- cp += 5*INT32SZ;
- cp1 += 5*INT32SZ;
- rdatasize = (u_char *)cp1 - soardata;
- zptr = calloc(1, sizeof(struct zonegrp));
- if (zptr == NULL)
- return (-1);
- if (zgrp_start == NULL)
- zgrp_start = zptr;
- else
- prevzptr->z_next = zptr;
- zptr->z_rr = rrecp;
- rrecp->r_grpnext = NULL;
- strcpy(zptr->z_origin, zname);
- zptr->z_class = class;
- memcpy(zptr->z_soardata, soardata, rdatasize);
- /* fallthrough to process NS and A records */
- }
- } else if (qtype == T_NS) {
- if (rcode == NOERROR && ancount > 0) {
- strcpy(zname, dname);
- for (zptr = zgrp_start; zptr; zptr = zptr->z_next) {
- if (strcasecmp(zname, zptr->z_origin) == 0)
- break;
- }
- if (zptr == NULL)
- /* should not happen */
- return (-1);
- if (nscount > 0) {
- /*
- * answer and authority sections contain
- * the same information, skip answer section
- */
- for (j = 0; j < ancount; j++) {
- n = dn_skipname(cp, eom);
- if (n < 0)
- return (-1);
- n += 2*INT16SZ + INT32SZ;
- if (cp + n + INT16SZ > eom)
- return (-1);
- cp += n;
- GETSHORT(dlen, cp);
- cp += dlen;
- }
- } else
- nscount = ancount;
- /* fallthrough to process NS and A records */
- } else {
- fprintf(stderr, "cannot determine nameservers for %s:\
-ans=%d, auth=%d, add=%d, rcode=%d\n",
- dname, ancount, nscount, arcount, hp->rcode);
- return (-1);
- }
- } else if (qtype == T_A) {
- if (rcode == NOERROR && ancount > 0) {
- arcount = ancount;
- ancount = nscount = 0;
- /* fallthrough to process A records */
- } else {
- fprintf(stderr, "cannot determine address for %s:\
-ans=%d, auth=%d, add=%d, rcode=%d\n",
- dname, ancount, nscount, arcount, hp->rcode);
- return (-1);
- }
- }
- /* process NS records for the zone */
- j = 0;
- for (i = 0; i < nscount; i++) {
- if ((n = dn_expand(answer, eom, cp, name,
- sizeof name)) < 0)
- return (n);
- cp += n;
- if (cp + 3 * INT16SZ + INT32SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- GETLONG(ttl, cp);
- GETSHORT(dlen, cp);
- if (cp + dlen > eom)
- return (-1);
- if (strcasecmp(name, zname) == 0 &&
- type == T_NS && class == qclass) {
- if ((n = dn_expand(answer, eom, cp,
- name, sizeof name)) < 0)
- return (n);
- target = zptr->z_ns[j++].nsname;
- strcpy(target, name);
- }
- cp += dlen;
- }
- if (zptr->z_nscount == 0)
- zptr->z_nscount = j;
- /* get addresses for the nameservers */
- for (i = 0; i < arcount; i++) {
- if ((n = dn_expand(answer, eom, cp, name,
- sizeof name)) < 0)
- return (n);
- cp += n;
- if (cp + 3 * INT16SZ + INT32SZ > eom)
- return (-1);
- GETSHORT(type, cp);
- GETSHORT(class, cp);
- GETLONG(ttl, cp);
- GETSHORT(dlen, cp);
- if (cp + dlen > eom)
- return (-1);
- if (type == T_A && dlen == INT32SZ && class == qclass) {
- for (j = 0; j < zptr->z_nscount; j++)
- if (strcasecmp(name, zptr->z_ns[j].nsname) == 0) {
- memcpy(&zptr->z_ns[j].nsaddr1.s_addr, cp,
- INT32SZ);
- break;
- }
- }
- cp += dlen;
- }
- if (zptr->z_nscount == 0) {
- dname = zname;
- qtype = T_NS;
- continue;
- }
- done = 1;
- for (k = 0; k < zptr->z_nscount; k++)
- if (zptr->z_ns[k].nsaddr1.s_addr == 0) {
- done = 0;
- dname = zptr->z_ns[k].nsname;
- qtype = T_A;
- }
-
- } /* while */
- }
-
- _res.options |= RES_DEBUG;
- for (zptr = zgrp_start; zptr; zptr = zptr->z_next) {
-
- /* append zone section */
- rrecp = res_mkupdrec(ns_s_zn, zptr->z_origin,
- zptr->z_class, ns_t_soa, 0);
- if (rrecp == NULL) {
- fprintf(stderr, "saverrec error\n");
- fflush(stderr);
- return (-1);
- }
- rrecp->r_grpnext = zptr->z_rr;
- zptr->z_rr = rrecp;
-
- n = res_mkupdate(zptr->z_rr, packet, sizeof packet);
- if (n < 0) {
- fprintf(stderr, "res_mkupdate error\n");
- fflush(stderr);
- return (-1);
- } else
- fprintf(stdout, "res_mkupdate: packet size = %d\n", n);
-
- /*
- * Override the list of NS records from res_init() with
- * the authoritative nameservers for the zone being updated.
- * Sort primary to be the first in the list of nameservers.
- */
- for (i = 0; i < zptr->z_nscount; i++) {
- if (strcasecmp(zptr->z_ns[i].nsname,
- zptr->z_soardata) == 0) {
- struct in_addr tmpaddr;
-
- if (i != 0) {
- strcpy(zptr->z_ns[i].nsname,
- zptr->z_ns[0].nsname);
- strcpy(zptr->z_ns[0].nsname,
- zptr->z_soardata);
- tmpaddr = zptr->z_ns[i].nsaddr1;
- zptr->z_ns[i].nsaddr1 =
- zptr->z_ns[0].nsaddr1;
- zptr->z_ns[0].nsaddr1 = tmpaddr;
- }
- break;
- }
- }
- for (i = 0; i < MAXNS; i++) {
- _res.nsaddr_list[i].sin_addr = zptr->z_ns[i].nsaddr1;
- _res.nsaddr_list[i].sin_family = AF_INET;
- _res.nsaddr_list[i].sin_port = htons(NAMESERVER_PORT);
- }
- _res.nscount = (zptr->z_nscount < MAXNS) ?
- zptr->z_nscount : MAXNS;
- n = res_send(packet, n, answer, sizeof(answer));
- if (n < 0) {
- fprintf(stderr, "res_send: send error, n=%d\n", n);
- break;
- } else
- numzones++;
- }
-
- /* free malloc'ed memory */
- while(zgrp_start) {
- zptr = zgrp_start;
- zgrp_start = zgrp_start->z_next;
- res_freeupdrec(zptr->z_rr); /* Zone section we allocated. */
- free((char *)zptr);
- }
-
- return (numzones);
-}
diff --git a/cpukit/libnetworking/libc/resolver.3 b/cpukit/libnetworking/libc/resolver.3
deleted file mode 100644
index 8c6f18334f..0000000000
--- a/cpukit/libnetworking/libc/resolver.3
+++ /dev/null
@@ -1,352 +0,0 @@
-.\" Copyright (c) 1985, 1991, 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.
-.\"
-.\" @(#)resolver.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
-.\"
-.Dd June 4, 1993
-.Dt RESOLVER 3
-.Os BSD 4.3
-.Sh NAME
-.Nm res_query ,
-.Nm res_search ,
-.Nm res_mkquery ,
-.Nm res_send ,
-.Nm res_init ,
-.Nm dn_comp ,
-.Nm dn_expand
-.Nd resolver routines
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <netinet/in.h>
-.Fd #include <arpa/nameser.h>
-.Fd #include <resolv.h>
-.Ft int
-.Fo res_query
-.Fa "const char *dname"
-.Fa "int class"
-.Fa "int type"
-.Fa "u_char *answer"
-.Fa "int anslen"
-.Fc
-.Ft int
-.Fo res_search
-.Fa "const char *dname"
-.Fa "int class"
-.Fa "int type"
-.Fa "u_char *answer"
-.Fa "int anslen"
-.Fc
-.Ft int
-.Fo res_mkquery
-.Fa "int op"
-.Fa "const char *dname"
-.Fa "int class"
-.Fa "int type"
-.Fa "const u_char *data"
-.Fa "int datalen"
-.Fa "const u_char *newrr_in"
-.Fa "u_char *buf"
-.Fa "int buflen"
-.Fc
-.Ft int
-.Fo res_send
-.Fa "const u_char *msg"
-.Fa "int msglen"
-.Fa "u_char *answer"
-.Fa "int anslen"
-.Fc
-.Ft int
-.Fn res_init
-.Fo dn_comp
-.Fa "const char *exp_dn"
-.Fa "u_char *comp_dn"
-.Fa "int length"
-.Fa "u_char **dnptrs"
-.Fa "u_char **lastdnptr"
-.Fc
-.Ft int
-.Fo dn_expand
-.Fa "const u_char *msg"
-.Fa "const u_char *eomorig"
-.Fa "const u_char *comp_dn"
-.Fa "char *exp_dn"
-.Fa "int length"
-.Fc
-.Sh DESCRIPTION
-These routines are used for making, sending and interpreting
-query and reply messages with Internet domain name servers.
-.Pp
-Global configuration and state information that is used by the
-resolver routines is kept in the structure
-.Em _res .
-Most of the values have reasonable defaults and can be ignored.
-Options
-stored in
-.Em _res.options
-are defined in
-.Pa resolv.h
-and are as follows.
-Options are stored as a simple bit mask containing the bitwise ``or''
-of the options enabled.
-.Bl -tag -width RES_DEFNAMES
-.It Dv RES_INIT
-True if the initial name server address and default domain name are
-initialized (i.e.,
-.Fn res_init
-has been called).
-.It Dv RES_DEBUG
-Print debugging messages.
-.It Dv RES_AAONLY
-Accept authoritative answers only.
-With this option,
-.Fn res_send
-should continue until it finds an authoritative answer or finds an error.
-Currently this is not implemented.
-.It Dv RES_USEVC
-Use
-.Tn TCP
-connections for queries instead of
-.Tn UDP
-datagrams.
-.It Dv RES_STAYOPEN
-Used with
-.Dv RES_USEVC
-to keep the
-.Tn TCP
-connection open between
-queries.
-This is useful only in programs that regularly do many queries.
-.Tn UDP
-should be the normal mode used.
-.It Dv RES_IGNTC
-Unused currently (ignore truncation errors, i.e., don't retry with
-.Tn TCP ) .
-.It Dv RES_RECURSE
-Set the recursion-desired bit in queries.
-This is the default.
-.Pf ( Fn res_send
-does not do iterative queries and expects the name server
-to handle recursion.)
-.It Dv RES_DEFNAMES
-If set,
-.Fn res_search
-will append the default domain name to single-component names
-(those that do not contain a dot).
-This option is enabled by default.
-.It Dv RES_DNSRCH
-If this option is set,
-.Fn res_search
-will search for host names in the current domain and in parent domains; see
-.Xr hostname 7 .
-This is used by the standard host lookup routine
-.Xr gethostbyname 3 .
-This option is enabled by default.
-.It Dv RES_NOALIASES
-This option turns off the user level aliasing feature controlled by the
-.Dq Ev HOSTALIASES
-environment variable. Network daemons should set this option.
-.El
-.Pp
-The
-.Fn res_init
-routine
-reads the configuration file (if any; see
-.Xr resolver 5 )
-to get the default domain name,
-search list and
-the Internet address of the local name server(s).
-If no server is configured, the host running
-the resolver is tried.
-The current domain name is defined by the hostname
-if not specified in the configuration file;
-it can be overridden by the environment variable
-.Ev LOCALDOMAIN .
-This environment variable may contain several blank-separated
-tokens if you wish to override the
-.Em "search list"
-on a per-process basis. This is similar to the
-.Em search
-command in the configuration file.
-Another environment variable (
-.Dq Ev RES_OPTIONS
-can be set to
-override certain internal resolver options which are otherwise
-set by changing fields in the
-.Em _res
-structure or are inherited from the configuration file's
-.Em options
-command. The syntax of the
-.Dq Ev RES_OPTIONS
-environment variable is explained in
-.Xr resolver 5 .
-Initialization normally occurs on the first call
-to one of the following routines.
-.Pp
-The
-.Fn res_query
-function provides an interface to the server query mechanism.
-It constructs a query, sends it to the local server,
-awaits a response, and makes preliminary checks on the reply.
-The query requests information of the specified
-.Fa type
-and
-.Fa class
-for the specified fully-qualified domain name
-.Fa dname .
-The reply message is left in the
-.Fa answer
-buffer with length
-.Fa anslen
-supplied by the caller.
-.Pp
-The
-.Fn res_search
-routine makes a query and awaits a response like
-.Fn res_query ,
-but in addition, it implements the default and search rules
-controlled by the
-.Dv RES_DEFNAMES
-and
-.Dv RES_DNSRCH
-options.
-It returns the first successful reply.
-.Pp
-The remaining routines are lower-level routines used by
-.Fn res_query .
-The
-.Fn res_mkquery
-function
-constructs a standard query message and places it in
-.Fa buf .
-It returns the size of the query, or \-1 if the query is
-larger than
-.Fa buflen .
-The query type
-.Fa op
-is usually
-.Dv QUERY ,
-but can be any of the query types defined in
-.Aq Pa arpa/nameser.h .
-The domain name for the query is given by
-.Fa dname .
-.Fa Newrr
-is currently unused but is intended for making update messages.
-.Pp
-The
-.Fn res_send
-routine
-sends a pre-formatted query and returns an answer.
-It will call
-.Fn res_init
-if
-.Dv RES_INIT
-is not set, send the query to the local name server, and
-handle timeouts and retries.
-The length of the reply message is returned, or
-\-1 if there were errors.
-.Pp
-The
-.Fn dn_comp
-function
-compresses the domain name
-.Fa exp_dn
-and stores it in
-.Fa comp_dn .
-The size of the compressed name is returned or \-1 if there were errors.
-The size of the array pointed to by
-.Fa comp_dn
-is given by
-.Fa length .
-The compression uses
-an array of pointers
-.Fa dnptrs
-to previously-compressed names in the current message.
-The first pointer points to
-to the beginning of the message and the list ends with
-.Dv NULL .
-The limit to the array is specified by
-.Fa lastdnptr .
-A side effect of
-.Fn dn_comp
-is to update the list of pointers for
-labels inserted into the message
-as the name is compressed.
-If
-.Em dnptr
-is
-.Dv NULL, names are not compressed.
-If
-.Fa lastdnptr
-is
-.Dv NULL ,
-the list of labels is not updated.
-.Pp
-The
-.Fn dn_expand
-entry
-expands the compressed domain name
-.Fa comp_dn
-to a full domain name
-The compressed name is contained in a query or reply message;
-.Fa msg
-is a pointer to the beginning of the message.
-The uncompressed name is placed in the buffer indicated by
-.Fa exp_dn
-which is of size
-.Fa length .
-The size of compressed name is returned or \-1 if there was an error.
-.Sh FILES
-.Bl -tag -width Pa
-/etc/resolv.conf
-The configuration file
-see
-.Xr resolver 5 .
-.El
-.Sh SEE ALSO
-.Xr gethostbyname 3 ,
-.Xr resolver 5 ,
-.Xr hostname 7 ,
-.Xr named 8
-.Pp
-.%T RFC1032 ,
-.%T RFC1033 ,
-.%T RFC1034 ,
-.%T RFC1035 ,
-.%T RFC974
-.Rs
-.%T "Name Server Operations Guide for BIND"
-.Re
-.Sh HISTORY
-The
-.Nm
-function appeared in
-.Bx 4.3 .
diff --git a/cpukit/libnetworking/libc/send.c b/cpukit/libnetworking/libc/send.c
deleted file mode 100644
index ad14bd3cd2..0000000000
--- a/cpukit/libnetworking/libc/send.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)send.c 8.2 (Berkeley) 2/21/94";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <stddef.h>
-
-ssize_t
-send(s, msg, len, flags)
- int s, flags;
- size_t len;
- const void *msg;
-{
- return (sendto(s, msg, len, flags, NULL, 0));
-}
diff --git a/cpukit/libnetworking/libc/strsep.c b/cpukit/libnetworking/libc/strsep.c
deleted file mode 100644
index 182319493d..0000000000
--- a/cpukit/libnetworking/libc/strsep.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * Copyright (c) 1990, 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <string.h>
-#include <stdio.h>
-
-/*
- * Get next token from string *stringp, where tokens are possibly-empty
- * strings separated by characters from delim.
- *
- * Writes NULs into the string at *stringp to end tokens.
- * delim need not remain constant from call to call.
- * On return, *stringp points past the last NUL written (if there might
- * be further tokens), or is NULL (if there are definitely no more tokens).
- *
- * If *stringp is NULL, strsep returns NULL.
- *
- * PUBLIC: #ifndef HAVE_STRSEP
- * PUBLIC: char *strsep __P((char **, const char *));
- * PUBLIC: #endif
- */
-char *
-strsep(stringp, delim)
- register char **stringp;
- register const char *delim;
-{
- register char *s;
- register const char *spanp;
- register int c, sc;
- char *tok;
-
- if ((s = *stringp) == NULL)
- return (NULL);
- for (tok = s;;) {
- c = *s++;
- spanp = delim;
- do {
- if ((sc = *spanp++) == c) {
- if (c == 0)
- s = NULL;
- else
- s[-1] = 0;
- *stringp = s;
- return (tok);
- }
- } while (sc != 0);
- }
- /* NOTREACHED */
-}
diff --git a/cpukit/libnetworking/loop.h b/cpukit/libnetworking/loop.h
deleted file mode 100644
index 34e0b828e4..0000000000
--- a/cpukit/libnetworking/loop.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-#define NLOOP 1
diff --git a/cpukit/libnetworking/machine/conf.h b/cpukit/libnetworking/machine/conf.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/cpukit/libnetworking/machine/conf.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/cpukit/libnetworking/machine/cpu.h b/cpukit/libnetworking/machine/cpu.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/cpukit/libnetworking/machine/cpu.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/cpukit/libnetworking/machine/cpufunc.h b/cpukit/libnetworking/machine/cpufunc.h
deleted file mode 100644
index 2b4c47e48f..0000000000
--- a/cpukit/libnetworking/machine/cpufunc.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
diff --git a/cpukit/libnetworking/machine/endian.h b/cpukit/libnetworking/machine/endian.h
deleted file mode 100644
index 6b17da58d3..0000000000
--- a/cpukit/libnetworking/machine/endian.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef _MACHINE_ENDIAN_H_
-#define _MACHINE_ENDIAN_H_
-
-#include <rtems/score/cpu.h>
-
-/*
- * BSD-style endian declaration
- */
-#define BIG_ENDIAN 4321
-#define LITTLE_ENDIAN 1234
-
-#if CPU_BIG_ENDIAN
-# define BYTE_ORDER BIG_ENDIAN
-#elif CPU_LITTLE_ENDIAN
-# define BYTE_ORDER LITTLE_ENDIAN
-#else
-# error "Can't decide which end is which!"
-#endif
-
-#if ( CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES == FALSE )
-
-#if ( CPU_BIG_ENDIAN == TRUE )
-
-/*
- * Very simply on big endian CPUs
- */
-
-#define ntohl(_x) (_x)
-#define ntohs(_x) (_x)
-#define htonl(_x) (_x)
-#define htons(_x) (_x)
-
-#define NTOHS(x)
-#define HTONS(x)
-#define NTOHL(x)
-#define HTONL(x)
-
-#elif ( CPU_LITTLE_ENDIAN == TRUE )
-
-/*
- * A little more complicated on little endian CPUs
- */
-
-#define ntohl(_x) ((long) CPU_swap_u32((unsigned32)_x))
-#define ntohs(_x) ((short) CPU_swap_u16((unsigned16)_x))
-#define htonl(_x) ((long) CPU_swap_u32((unsigned32)_x))
-#define htons(_x) ((short) CPU_swap_u16((unsigned16)_x))
-
-#define NTOHS(x) (x) = ntohs(x)
-#define HTONS(x) (x) = htons(x)
-#define NTOHL(x) (x) = ntohl(x)
-#define HTONL(x) (x) = htonl(x)
-
-#else
-#error "Unknown endian-ness for this cpu"
-#endif
-
-#endif /* CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES */
-
-#endif /* _MACHINE_ENDIAN_H_ */
diff --git a/cpukit/libnetworking/machine/in_cksum.h b/cpukit/libnetworking/machine/in_cksum.h
deleted file mode 100644
index 15509b3888..0000000000
--- a/cpukit/libnetworking/machine/in_cksum.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * Copyright (c) 1990 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.
- *
- * from tahoe: in_cksum.c 1.2 86/01/05
- * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
- * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
- * $Id$
- */
-
-#ifndef _MACHINE_IN_CKSUM_H_
-#define _MACHINE_IN_CKSUM_H_ 1
-
-#include <sys/cdefs.h>
-
-/*
- * It it useful to have an Internet checksum routine which is inlineable
- * and optimized specifically for the task of computing IP header checksums
- * in the normal case (where there are no options and the header length is
- * therefore always exactly five 32-bit words.
- */
-#if (defined(__GNUC__) && defined(__i386__))
-static __inline u_int
-in_cksum_hdr(const struct ip *ip)
-{
- register u_int sum = 0;
-
-#define ADD(n) __asm("addl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (ip))
-#define ADDC(n) __asm("adcl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (ip))
-#define MOP __asm("adcl $0, %0" : "=r" (sum) : "0" (sum))
-
- ADD(0);
- ADDC(4);
- ADDC(8);
- ADDC(12);
- ADDC(16);
- MOP;
- sum = (sum & 0xffff) + (sum >> 16);
- if (sum > 0xffff)
- sum -= 0xffff;
-
- return ~sum & 0xffff;
-}
-
-static __inline void
-in_cksum_update(struct ip *ip)
-{
- int __tmpsum;
- __tmpsum = (int)ntohs(ip->ip_sum) + 256;
- ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
-}
-
-#elif (defined(__GNUC__) && (defined(__mc68000__) || defined(__m68k__)))
-
-static __inline__ u_int
-in_cksum_hdr(const struct ip *ip)
-{
- register u_int *ap = (u_int *)ip;
- register u_int sum = *ap++;
- register u_int tmp;
-
- __asm__("addl %2@+,%0\n\t"
- "movel %2@+,%1\n\t"
- "addxl %1,%0\n\t"
- "movel %2@+,%1\n\t"
- "addxl %1,%0\n\t"
- "movel %2@,%1\n\t"
- "addxl %1,%0\n\t"
- "moveq #0,%1\n\t"
- "addxl %1,%0\n" :
- "=d" (sum), "=d" (tmp), "=a" (ap) :
- "0" (sum), "2" (ap));
- sum = (sum & 0xffff) + (sum >> 16);
- if (sum > 0xffff)
- sum -= 0xffff;
- return ~sum & 0xffff;
-}
-
-#else
-u_int in_cksum_hdr __P((const struct ip *));
-#define in_cksum_update(ip) \
- do { \
- int __tmpsum; \
- __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
- ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
- } while(0)
-
-#endif
-
-#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/cpukit/libnetworking/machine/limits.h b/cpukit/libnetworking/machine/limits.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/cpukit/libnetworking/machine/limits.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/cpukit/libnetworking/machine/param.h b/cpukit/libnetworking/machine/param.h
deleted file mode 100644
index 4168f1f6cf..0000000000
--- a/cpukit/libnetworking/machine/param.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef _MACHINE_PARAM_H_
-#define _MACHINE_PARAM_H_
-
-/*
- * These aren't really machine-dependent for RTEMS.....
- */
-
-/*
-#define MACHINE "i386"
-#define MID_MACHINE MID_I386
-*/
-
-/*
- * Round p (pointer or byte index) up to a correctly-aligned value
- * for all data types (int, long, ...). The result is unsigned int
- * and must be cast to any desired pointer type.
- */
-#define ALIGNBYTES (sizeof(int) - 1)
-#define ALIGN(p) (((unsigned)(p) + ALIGNBYTES) & ~ALIGNBYTES)
-
-#define PAGE_SHIFT 12 /* LOG2(PAGE_SIZE) */
-#define PAGE_SIZE (1<<PAGE_SHIFT) /* bytes/page */
-#define PAGE_MASK (PAGE_SIZE-1)
-#define NPTEPG (PAGE_SIZE/(sizeof (pt_entry_t)))
-
-#define NPDEPG (PAGE_SIZE/(sizeof (pd_entry_t)))
-#define PDRSHIFT 22 /* LOG2(NBPDR) */
-#define NBPDR (1<<PDRSHIFT) /* bytes/page dir */
-
-#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
-#define DEV_BSIZE (1<<DEV_BSHIFT)
-
-#define BLKDEV_IOSIZE 2048
-#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
-
-#define UPAGES 2 /* pages of u-area */
-
-/*
- * Constants related to network buffer management.
- * MCLBYTES must be no larger than CLBYTES (the software page size), and,
- * on machines that exchange pages of input or output buffers with mbuf
- * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
- * of the hardware page size.
- */
-#ifndef MSIZE
-#define MSIZE 128 /* size of an mbuf */
-#endif /* MSIZE */
-
-#ifndef MCLSHIFT
-#define MCLSHIFT 11 /* convert bytes to m_buf clusters */
-#endif /* MCLSHIFT */
-#define MCLBYTES (1 << MCLSHIFT) /* size of an m_buf cluster */
-#define MCLOFSET (MCLBYTES - 1) /* offset within an m_buf cluster */
-
-/*
- * Some macros for units conversion
- */
-
-/* clicks to bytes */
-#define ctob(x) ((x)<<PAGE_SHIFT)
-
-/* bytes to clicks */
-#define btoc(x) (((unsigned)(x)+PAGE_MASK)>>PAGE_SHIFT)
-
-/*
- * btodb() is messy and perhaps slow because `bytes' may be an off_t. We
- * want to shift an unsigned type to avoid sign extension and we don't
- * want to widen `bytes' unnecessarily. Assume that the result fits in
- * a daddr_t.
- */
-#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
- (sizeof (bytes) > sizeof(long) \
- ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \
- : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT))
-
-#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
- ((off_t)(db) << DEV_BSHIFT)
-
-/*
- * Mach derived conversion macros
- */
-#define trunc_page(x) ((unsigned)(x) & ~PAGE_MASK)
-#define round_page(x) ((((unsigned)(x)) + PAGE_MASK) & ~PAGE_MASK)
-
-#define atop(x) ((unsigned)(x) >> PAGE_SHIFT)
-#define ptoa(x) ((unsigned)(x) << PAGE_SHIFT)
-
-#endif /* !_MACHINE_PARAM_H_ */
diff --git a/cpukit/libnetworking/machine/types.h b/cpukit/libnetworking/machine/types.h
deleted file mode 100644
index 730a6dec1d..0000000000
--- a/cpukit/libnetworking/machine/types.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file will have to be incorparated into the RTEMS source
- * tree (probably in the existing <machine/types.h> so that these
- * contents are included when an application source file includes
- * <sys/types.h>.
- *
- * $Id$
- */
-
-#ifndef _MACHINE_TYPES_H_
-#define _MACHINE_TYPES_H_
-
-#include <rtems.h>
-#include <machine/endian.h>
-
-typedef rtems_signed64 int64_t;
-typedef rtems_signed32 int32_t;
-typedef rtems_signed16 int16_t;
-typedef rtems_signed8 int8_t;
-
-typedef rtems_unsigned64 u_int64_t;
-typedef rtems_unsigned32 u_int32_t;
-typedef rtems_unsigned16 u_int16_t;
-typedef rtems_unsigned8 u_int8_t;
-
-#define _CLOCK_T_ unsigned long
-#define _TIME_T_ long
-
-#ifdef _COMPILING_BSD_KERNEL_
-#include <rtems/rtems_bsdnet_internal.h>
-#include <rtems/rtems_bsdnet.h>
-#endif
-
-#endif /* _MACHINE_TYPES_H_ */
diff --git a/cpukit/libnetworking/machine/vmparam.h b/cpukit/libnetworking/machine/vmparam.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/cpukit/libnetworking/machine/vmparam.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/cpukit/libnetworking/net/bpf.h b/cpukit/libnetworking/net/bpf.h
deleted file mode 100644
index 7847d72470..0000000000
--- a/cpukit/libnetworking/net/bpf.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 1990, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from the Stanford/CMU enet packet filter,
- * (net/enet.c) distributed as part of 4.3BSD, and code contributed
- * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
- * Berkeley Laboratory.
- *
- * 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.
- *
- * @(#)bpf.h 8.1 (Berkeley) 6/10/93
- * @(#)bpf.h 1.34 (LBL) 6/16/96
- *
- * $Id$
- */
-
-#ifndef _NET_BPF_H_
-#define _NET_BPF_H_
-
-/* BSD style release date */
-#define BPF_RELEASE 199606
-
-typedef int32_t bpf_int32;
-typedef u_int32_t bpf_u_int32;
-
-/*
- * Alignment macros. BPF_WORDALIGN rounds up to the next
- * even multiple of BPF_ALIGNMENT.
- */
-#define BPF_ALIGNMENT sizeof(bpf_int32)
-#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))
-
-#define BPF_MAXINSNS 512
-#define BPF_MAXBUFSIZE 0x8000
-#define BPF_MINBUFSIZE 32
-
-/*
- * Structure for BIOCSETF.
- */
-struct bpf_program {
- u_int bf_len;
- struct bpf_insn *bf_insns;
-};
-
-/*
- * Struct returned by BIOCGSTATS.
- */
-struct bpf_stat {
- u_int bs_recv; /* number of packets received */
- u_int bs_drop; /* number of packets dropped */
-};
-
-/*
- * Struct return by BIOCVERSION. This represents the version number of
- * the filter language described by the instruction encodings below.
- * bpf understands a program iff kernel_major == filter_major &&
- * kernel_minor >= filter_minor, that is, if the value returned by the
- * running kernel has the same major number and a minor number equal
- * equal to or less than the filter being downloaded. Otherwise, the
- * results are undefined, meaning an error may be returned or packets
- * may be accepted haphazardly.
- * It has nothing to do with the source code version.
- */
-struct bpf_version {
- u_short bv_major;
- u_short bv_minor;
-};
-/* Current version number of filter architecture. */
-#define BPF_MAJOR_VERSION 1
-#define BPF_MINOR_VERSION 1
-
-#define BIOCGBLEN _IOR('B',102, u_int)
-#define BIOCSBLEN _IOWR('B',102, u_int)
-#define BIOCSETF _IOW('B',103, struct bpf_program)
-#define BIOCFLUSH _IO('B',104)
-#define BIOCPROMISC _IO('B',105)
-#define BIOCGDLT _IOR('B',106, u_int)
-#define BIOCGETIF _IOR('B',107, struct ifreq)
-#define BIOCSETIF _IOW('B',108, struct ifreq)
-#define BIOCSRTIMEOUT _IOW('B',109, struct timeval)
-#define BIOCGRTIMEOUT _IOR('B',110, struct timeval)
-#define BIOCGSTATS _IOR('B',111, struct bpf_stat)
-#define BIOCIMMEDIATE _IOW('B',112, u_int)
-#define BIOCVERSION _IOR('B',113, struct bpf_version)
-#define BIOCGRSIG _IOR('B',114, u_int)
-#define BIOCSRSIG _IOW('B',115, u_int)
-
-/*
- * Structure prepended to each packet.
- */
-struct bpf_hdr {
- struct timeval bh_tstamp; /* time stamp */
- bpf_u_int32 bh_caplen; /* length of captured portion */
- bpf_u_int32 bh_datalen; /* original length of packet */
- u_short bh_hdrlen; /* length of bpf header (this struct
- plus alignment padding) */
-};
-/*
- * Because the structure above is not a multiple of 4 bytes, some compilers
- * will insist on inserting padding; hence, sizeof(struct bpf_hdr) won't work.
- * Only the kernel needs to know about it; applications use bh_hdrlen.
- */
-#ifdef KERNEL
-#define SIZEOF_BPF_HDR 18
-#endif
-
-/*
- * Data-link level type codes.
- */
-#define DLT_NULL 0 /* no link-layer encapsulation */
-#define DLT_EN10MB 1 /* Ethernet (10Mb) */
-#define DLT_EN3MB 2 /* Experimental Ethernet (3Mb) */
-#define DLT_AX25 3 /* Amateur Radio AX.25 */
-#define DLT_PRONET 4 /* Proteon ProNET Token Ring */
-#define DLT_CHAOS 5 /* Chaos */
-#define DLT_IEEE802 6 /* IEEE 802 Networks */
-#define DLT_ARCNET 7 /* ARCNET */
-#define DLT_SLIP 8 /* Serial Line IP */
-#define DLT_PPP 9 /* Point-to-point Protocol */
-#define DLT_FDDI 10 /* FDDI */
-#define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */
-
-/*
- * The instruction encodings.
- */
-/* instruction classes */
-#define BPF_CLASS(code) ((code) & 0x07)
-#define BPF_LD 0x00
-#define BPF_LDX 0x01
-#define BPF_ST 0x02
-#define BPF_STX 0x03
-#define BPF_ALU 0x04
-#define BPF_JMP 0x05
-#define BPF_RET 0x06
-#define BPF_MISC 0x07
-
-/* ld/ldx fields */
-#define BPF_SIZE(code) ((code) & 0x18)
-#define BPF_W 0x00
-#define BPF_H 0x08
-#define BPF_B 0x10
-#define BPF_MODE(code) ((code) & 0xe0)
-#define BPF_IMM 0x00
-#define BPF_ABS 0x20
-#define BPF_IND 0x40
-#define BPF_MEM 0x60
-#define BPF_LEN 0x80
-#define BPF_MSH 0xa0
-
-/* alu/jmp fields */
-#define BPF_OP(code) ((code) & 0xf0)
-#define BPF_ADD 0x00
-#define BPF_SUB 0x10
-#define BPF_MUL 0x20
-#define BPF_DIV 0x30
-#define BPF_OR 0x40
-#define BPF_AND 0x50
-#define BPF_LSH 0x60
-#define BPF_RSH 0x70
-#define BPF_NEG 0x80
-#define BPF_JA 0x00
-#define BPF_JEQ 0x10
-#define BPF_JGT 0x20
-#define BPF_JGE 0x30
-#define BPF_JSET 0x40
-#define BPF_SRC(code) ((code) & 0x08)
-#define BPF_K 0x00
-#define BPF_X 0x08
-
-/* ret - BPF_K and BPF_X also apply */
-#define BPF_RVAL(code) ((code) & 0x18)
-#define BPF_A 0x10
-
-/* misc */
-#define BPF_MISCOP(code) ((code) & 0xf8)
-#define BPF_TAX 0x00
-#define BPF_TXA 0x80
-
-/*
- * The instruction data structure.
- */
-struct bpf_insn {
- u_short code;
- u_char jt;
- u_char jf;
- bpf_u_int32 k;
-};
-
-/*
- * Macros for insn array initializers.
- */
-#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }
-#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }
-
-#ifdef KERNEL
-int bpf_validate __P((struct bpf_insn *, int));
-void bpf_tap __P((struct ifnet *, u_char *, u_int));
-void bpf_mtap __P((struct ifnet *, struct mbuf *));
-void bpfattach __P((struct ifnet *, u_int, u_int));
-void bpfilterattach __P((int));
-u_int bpf_filter __P((struct bpf_insn *, u_char *, u_int, u_int));
-#endif
-
-/*
- * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
- */
-#define BPF_MEMWORDS 16
-
-#endif
diff --git a/cpukit/libnetworking/net/ethernet.h b/cpukit/libnetworking/net/ethernet.h
deleted file mode 100644
index c6c07189ec..0000000000
--- a/cpukit/libnetworking/net/ethernet.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Fundamental constants relating to ethernet.
- *
- * $Id$
- *
- */
-
-#ifndef _NET_ETHERNET_H_
-#define _NET_ETHERNET_H_
-
-/*
- * The number of bytes in an ethernet (MAC) address.
- */
-#define ETHER_ADDR_LEN 6
-
-/*
- * The number of bytes in the type field.
- */
-#define ETHER_TYPE_LEN 2
-
-/*
- * The number of bytes in the trailing CRC field.
- */
-#define ETHER_CRC_LEN 4
-
-/*
- * The length of the combined header.
- */
-#define ETHER_HDR_LEN (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
-
-/*
- * The minimum packet length.
- */
-#define ETHER_MIN_LEN 64
-
-/*
- * The maximum packet length.
- */
-#define ETHER_MAX_LEN 1518
-
-/*
- * A macro to validate a length with
- */
-#define ETHER_IS_VALID_LEN(foo) \
- ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
-
-/*
- * Structure of a 10Mb/s Ethernet header.
- */
-struct ether_header {
- u_char ether_dhost[ETHER_ADDR_LEN];
- u_char ether_shost[ETHER_ADDR_LEN];
- u_short ether_type;
-};
-
-/*
- * Structure of a 48-bit Ethernet address.
- */
-struct ether_addr {
- u_char octet[ETHER_ADDR_LEN];
-};
-
-#endif
diff --git a/cpukit/libnetworking/net/if.c b/cpukit/libnetworking/net/if.c
deleted file mode 100644
index af6f003de3..0000000000
--- a/cpukit/libnetworking/net/if.c
+++ /dev/null
@@ -1,783 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)if.c 8.3 (Berkeley) 1/4/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/mbuf.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/kernel.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/if_types.h>
-#include <net/radix.h>
-
-/*
- * System initialization
- */
-
-static int ifconf __P((int, caddr_t));
- void ifinit __P((void *));
-static void if_qflush __P((struct ifqueue *));
-static void if_slowtimo __P((void *));
-static void link_rtrequest __P((int, struct rtentry *, struct sockaddr *));
-
-SYSINIT(interfaces, SI_SUB_PROTO_IF, SI_ORDER_FIRST, ifinit, NULL)
-
-
-int ifqmaxlen = IFQ_MAXLEN;
-struct ifnet *ifnet;
-
-/*
- * Network interface utility routines.
- *
- * Routines with ifa_ifwith* names take sockaddr *'s as
- * parameters.
- *
- * This routine assumes that it will be called at splimp() or higher.
- */
-/* ARGSUSED*/
-void
-ifinit(dummy)
- void *dummy;
-{
- register struct ifnet *ifp;
-
- for (ifp = ifnet; ifp; ifp = ifp->if_next)
- if (ifp->if_snd.ifq_maxlen == 0)
- ifp->if_snd.ifq_maxlen = ifqmaxlen;
- if_slowtimo(0);
-}
-
-int if_index = 0;
-struct ifaddr **ifnet_addrs;
-
-
-/*
- * Attach an interface to the
- * list of "active" interfaces.
- */
-void
-if_attach(ifp)
- struct ifnet *ifp;
-{
- unsigned socksize, ifasize;
- int namelen, masklen;
- char workbuf[64];
- register struct ifnet **p = &ifnet;
- register struct sockaddr_dl *sdl;
- register struct ifaddr *ifa;
- static int if_indexlim = 8;
-
-
- while (*p)
- p = &((*p)->if_next);
- *p = ifp;
- ifp->if_index = ++if_index;
- microtime(&ifp->if_lastchange);
- if (ifnet_addrs == 0 || if_index >= if_indexlim) {
- unsigned n = (if_indexlim <<= 1) * sizeof(ifa);
- struct ifaddr **q = (struct ifaddr **)
- malloc(n, M_IFADDR, M_WAITOK);
- bzero((caddr_t)q, n);
- if (ifnet_addrs) {
- bcopy((caddr_t)ifnet_addrs, (caddr_t)q, n/2);
- free((caddr_t)ifnet_addrs, M_IFADDR);
- }
- ifnet_addrs = q;
- }
- /*
- * create a Link Level name for this device
- */
- namelen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit);
-#define _offsetof(t, m) ((int)((caddr_t)&((t *)0)->m))
- masklen = _offsetof(struct sockaddr_dl, sdl_data[0]) + namelen;
- socksize = masklen + ifp->if_addrlen;
-#define ROUNDUP(a) (1 + (((a) - 1) | (sizeof(long) - 1)))
- socksize = ROUNDUP(socksize);
- if (socksize < sizeof(*sdl))
- socksize = sizeof(*sdl);
- ifasize = sizeof(*ifa) + 2 * socksize;
- ifa = (struct ifaddr *)malloc(ifasize, M_IFADDR, M_WAITOK);
- if (ifa) {
- bzero((caddr_t)ifa, ifasize);
- sdl = (struct sockaddr_dl *)(ifa + 1);
- sdl->sdl_len = socksize;
- sdl->sdl_family = AF_LINK;
- bcopy(workbuf, sdl->sdl_data, namelen);
- sdl->sdl_nlen = namelen;
- sdl->sdl_index = ifp->if_index;
- sdl->sdl_type = ifp->if_type;
- ifnet_addrs[if_index - 1] = ifa;
- ifa->ifa_ifp = ifp;
- ifa->ifa_next = ifp->if_addrlist;
- ifa->ifa_rtrequest = link_rtrequest;
- ifp->if_addrlist = ifa;
- ifa->ifa_addr = (struct sockaddr *)sdl;
-
- sdl = (struct sockaddr_dl *)(socksize + (caddr_t)sdl);
- ifa->ifa_netmask = (struct sockaddr *)sdl;
- sdl->sdl_len = masklen;
- while (namelen != 0)
- sdl->sdl_data[--namelen] = 0xff;
- }
-}
-/*
- * Locate an interface based on a complete address.
- */
-/*ARGSUSED*/
-struct ifaddr *
-ifa_ifwithaddr(addr)
- register struct sockaddr *addr;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
-
-#define equal(a1, a2) \
- (bcmp((caddr_t)(a1), (caddr_t)(a2), ((struct sockaddr *)(a1))->sa_len) == 0)
- for (ifp = ifnet; ifp; ifp = ifp->if_next)
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr->sa_family != addr->sa_family)
- continue;
- if (equal(addr, ifa->ifa_addr))
- return (ifa);
- if ((ifp->if_flags & IFF_BROADCAST) && ifa->ifa_broadaddr &&
- equal(ifa->ifa_broadaddr, addr))
- return (ifa);
- }
- return ((struct ifaddr *)0);
-}
-/*
- * Locate the point to point interface with a given destination address.
- */
-/*ARGSUSED*/
-struct ifaddr *
-ifa_ifwithdstaddr(addr)
- register struct sockaddr *addr;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
-
- for (ifp = ifnet; ifp; ifp = ifp->if_next)
- if (ifp->if_flags & IFF_POINTOPOINT)
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr->sa_family != addr->sa_family)
- continue;
- if (ifa->ifa_dstaddr && equal(addr, ifa->ifa_dstaddr))
- return (ifa);
- }
- return ((struct ifaddr *)0);
-}
-
-/*
- * Find an interface on a specific network. If many, choice
- * is most specific found.
- */
-struct ifaddr *
-ifa_ifwithnet(addr)
- struct sockaddr *addr;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
- struct ifaddr *ifa_maybe = (struct ifaddr *) 0;
- u_int af = addr->sa_family;
- char *addr_data = addr->sa_data, *cplim;
-
- if (af == AF_LINK) {
- register struct sockaddr_dl *sdl = (struct sockaddr_dl *)addr;
- if (sdl->sdl_index && sdl->sdl_index <= if_index)
- return (ifnet_addrs[sdl->sdl_index - 1]);
- }
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- register char *cp, *cp2, *cp3;
-
- if (ifa->ifa_addr->sa_family != af)
- next: continue;
- if (ifp->if_flags & IFF_POINTOPOINT) {
- if (ifa->ifa_dstaddr != 0
- && equal(addr, ifa->ifa_dstaddr))
- return (ifa);
- } else {
- /*
- * if we have a special address handler,
- * then use it instead of the generic one.
- */
- if (ifa->ifa_claim_addr) {
- if ((*ifa->ifa_claim_addr)(ifa, addr)) {
- return (ifa);
- } else {
- continue;
- }
- }
-
- /*
- * Scan all the bits in the ifa's address.
- * If a bit dissagrees with what we are
- * looking for, mask it with the netmask
- * to see if it really matters.
- * (A byte at a time)
- */
- if (ifa->ifa_netmask == 0)
- continue;
- cp = addr_data;
- cp2 = ifa->ifa_addr->sa_data;
- cp3 = ifa->ifa_netmask->sa_data;
- cplim = ifa->ifa_netmask->sa_len + (char *)ifa->ifa_netmask;
- while (cp3 < cplim)
- if ((*cp++ ^ *cp2++) & *cp3++)
- goto next;
- if (ifa_maybe == 0 ||
- rn_refines((caddr_t)ifa->ifa_netmask,
- (caddr_t)ifa_maybe->ifa_netmask))
- ifa_maybe = ifa;
- }
- }
- }
- return (ifa_maybe);
-}
-
-/*
- * Find an interface address specific to an interface best matching
- * a given address.
- */
-struct ifaddr *
-ifaof_ifpforaddr(addr, ifp)
- struct sockaddr *addr;
- register struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
- register char *cp, *cp2, *cp3;
- register char *cplim;
- struct ifaddr *ifa_maybe = 0;
- u_int af = addr->sa_family;
-
- if (af >= AF_MAX)
- return (0);
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr->sa_family != af)
- continue;
- if (ifa_maybe == 0)
- ifa_maybe = ifa;
- if (ifa->ifa_netmask == 0) {
- if (equal(addr, ifa->ifa_addr) ||
- (ifa->ifa_dstaddr && equal(addr, ifa->ifa_dstaddr)))
- return (ifa);
- continue;
- }
- if (ifp->if_flags & IFF_POINTOPOINT) {
- if (equal(addr, ifa->ifa_dstaddr))
- return (ifa);
- } else {
- cp = addr->sa_data;
- cp2 = ifa->ifa_addr->sa_data;
- cp3 = ifa->ifa_netmask->sa_data;
- cplim = ifa->ifa_netmask->sa_len + (char *)ifa->ifa_netmask;
- for (; cp3 < cplim; cp3++)
- if ((*cp++ ^ *cp2++) & *cp3)
- break;
- if (cp3 == cplim)
- return (ifa);
- }
- }
- return (ifa_maybe);
-}
-
-#include <net/route.h>
-
-/*
- * Default action when installing a route with a Link Level gateway.
- * Lookup an appropriate real ifa to point to.
- * This should be moved to /sys/net/link.c eventually.
- */
-static void
-link_rtrequest(cmd, rt, sa)
- int cmd;
- register struct rtentry *rt;
- struct sockaddr *sa;
-{
- register struct ifaddr *ifa;
- struct sockaddr *dst;
- struct ifnet *ifp;
-
- if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == 0) ||
- ((ifp = ifa->ifa_ifp) == 0) || ((dst = rt_key(rt)) == 0))
- return;
- ifa = ifaof_ifpforaddr(dst, ifp);
- if (ifa) {
- IFAFREE(rt->rt_ifa);
- rt->rt_ifa = ifa;
- ifa->ifa_refcnt++;
- if (ifa->ifa_rtrequest && ifa->ifa_rtrequest != link_rtrequest)
- ifa->ifa_rtrequest(cmd, rt, sa);
- }
-}
-
-/*
- * Mark an interface down and notify protocols of
- * the transition.
- * NOTE: must be called at splnet or eqivalent.
- */
-void
-if_down(ifp)
- register struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
-
- ifp->if_flags &= ~IFF_UP;
- microtime(&ifp->if_lastchange);
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
- if_qflush(&ifp->if_snd);
- rt_ifmsg(ifp);
-}
-
-/*
- * Mark an interface up and notify protocols of
- * the transition.
- * NOTE: must be called at splnet or eqivalent.
- */
-void
-if_up(ifp)
- register struct ifnet *ifp;
-{
-
- ifp->if_flags |= IFF_UP;
- microtime(&ifp->if_lastchange);
-#ifdef notyet
- register struct ifaddr *ifa;
- /* this has no effect on IP, and will kill all iso connections XXX */
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- pfctlinput(PRC_IFUP, ifa->ifa_addr);
-#endif
- rt_ifmsg(ifp);
-}
-
-/*
- * Flush an interface queue.
- */
-static void
-if_qflush(ifq)
- register struct ifqueue *ifq;
-{
- register struct mbuf *m, *n;
-
- n = ifq->ifq_head;
- while ((m = n) != 0) {
- n = m->m_act;
- m_freem(m);
- }
- ifq->ifq_head = 0;
- ifq->ifq_tail = 0;
- ifq->ifq_len = 0;
-}
-
-/*
- * Handle interface watchdog timer routines. Called
- * from softclock, we decrement timers (if set) and
- * call the appropriate interface routine on expiration.
- */
-static void
-if_slowtimo(arg)
- void *arg;
-{
- register struct ifnet *ifp;
- int s = splimp();
-
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- if (ifp->if_timer == 0 || --ifp->if_timer)
- continue;
- if (ifp->if_watchdog)
- (*ifp->if_watchdog)(ifp);
- }
- splx(s);
- timeout(if_slowtimo, (void *)0, hz / IFNET_SLOWHZ);
-}
-
-/*
- * Map interface name to
- * interface structure pointer.
- */
-struct ifnet *
-ifunit(name)
- register char *name;
-{
- register char *cp;
- register struct ifnet *ifp;
- int unit;
- unsigned len;
- char *ep, c;
-
- for (cp = name; cp < name + IFNAMSIZ && *cp; cp++)
- if (*cp >= '0' && *cp <= '9')
- break;
- if (*cp == '\0' || cp == name + IFNAMSIZ)
- return ((struct ifnet *)0);
- /*
- * Save first char of unit, and pointer to it,
- * so we can put a null there to avoid matching
- * initial substrings of interface names.
- */
- len = cp - name + 1;
- c = *cp;
- ep = cp;
- for (unit = 0; *cp >= '0' && *cp <= '9'; )
- unit = unit * 10 + *cp++ - '0';
- if (*cp != '\0')
- return 0; /* no trailing garbage allowed */
- *ep = 0;
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- if (bcmp(ifp->if_name, name, len))
- continue;
- if (unit == ifp->if_unit)
- break;
- }
- *ep = c;
- return (ifp);
-}
-
-/*
- * Interface ioctls.
- */
-int
-ifioctl(so, cmd, data, p)
- struct socket *so;
- int cmd;
- caddr_t data;
- struct proc *p;
-{
- register struct ifnet *ifp;
- register struct ifreq *ifr;
- int error;
-
- switch (cmd) {
-
- case SIOCGIFCONF:
- case OSIOCGIFCONF:
- return (ifconf(cmd, data));
- }
- ifr = (struct ifreq *)data;
- ifp = ifunit(ifr->ifr_name);
- if (ifp == 0)
- return (ENXIO);
- switch (cmd) {
-
- case SIOCGIFFLAGS:
- ifr->ifr_flags = ifp->if_flags;
- break;
-
- case SIOCGIFMETRIC:
- ifr->ifr_metric = ifp->if_metric;
- break;
-
- case SIOCGIFMTU:
- ifr->ifr_mtu = ifp->if_mtu;
- break;
-
- case SIOCGIFPHYS:
- ifr->ifr_phys = ifp->if_physical;
- break;
-
- case SIOCSIFFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_flags & IFF_UP && (ifr->ifr_flags & IFF_UP) == 0) {
- int s = splimp();
- if_down(ifp);
- splx(s);
- }
- if (ifr->ifr_flags & IFF_UP && (ifp->if_flags & IFF_UP) == 0) {
- int s = splimp();
- if_up(ifp);
- splx(s);
- }
- ifp->if_flags = (ifp->if_flags & IFF_CANTCHANGE) |
- (ifr->ifr_flags &~ IFF_CANTCHANGE);
- if (ifp->if_ioctl)
- (void) (*ifp->if_ioctl)(ifp, cmd, data);
- microtime(&ifp->if_lastchange);
- break;
-
- case SIOCSIFMETRIC:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- ifp->if_metric = ifr->ifr_metric;
- microtime(&ifp->if_lastchange);
- break;
-
- case SIOCSIFPHYS:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return error;
- if (!ifp->if_ioctl)
- return EOPNOTSUPP;
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0)
- microtime(&ifp->if_lastchange);
- return(error);
-
- case SIOCSIFMTU:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_ioctl == NULL)
- return (EOPNOTSUPP);
- /*
- * 72 was chosen below because it is the size of a TCP/IP
- * header (40) + the minimum mss (32).
- */
- if (ifr->ifr_mtu < 72 || ifr->ifr_mtu > 65535)
- return (EINVAL);
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0)
- microtime(&ifp->if_lastchange);
- return(error);
-
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_ioctl == NULL)
- return (EOPNOTSUPP);
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0 )
- microtime(&ifp->if_lastchange);
- return(error);
-
- case SIOCSIFMEDIA:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- return (error);
- if (ifp->if_ioctl == 0)
- return (EOPNOTSUPP);
- error = (*ifp->if_ioctl)(ifp, cmd, data);
- if (error == 0)
- microtime(&ifp->if_lastchange);
- return error;
-
- case SIOCGIFMEDIA:
- if (ifp->if_ioctl == 0)
- return (EOPNOTSUPP);
- return ((*ifp->if_ioctl)(ifp, cmd, data));
-
- default:
- if (so->so_proto == 0)
- return (EOPNOTSUPP);
-#ifndef COMPAT_43
- return ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
- data,
- ifp));
-#else
- {
- int ocmd = cmd;
-
- switch (cmd) {
-
- case SIOCSIFDSTADDR:
- case SIOCSIFADDR:
- case SIOCSIFBRDADDR:
- case SIOCSIFNETMASK:
-#if BYTE_ORDER != BIG_ENDIAN
- if (ifr->ifr_addr.sa_family == 0 &&
- ifr->ifr_addr.sa_len < 16) {
- ifr->ifr_addr.sa_family = ifr->ifr_addr.sa_len;
- ifr->ifr_addr.sa_len = 16;
- }
-#else
- if (ifr->ifr_addr.sa_len == 0)
- ifr->ifr_addr.sa_len = 16;
-#endif
- break;
-
- case OSIOCGIFADDR:
- cmd = SIOCGIFADDR;
- break;
-
- case OSIOCGIFDSTADDR:
- cmd = SIOCGIFDSTADDR;
- break;
-
- case OSIOCGIFBRDADDR:
- cmd = SIOCGIFBRDADDR;
- break;
-
- case OSIOCGIFNETMASK:
- cmd = SIOCGIFNETMASK;
- }
- error = ((*so->so_proto->pr_usrreqs->pru_control)(so,
- cmd,
- data,
- ifp));
- switch (ocmd) {
-
- case OSIOCGIFADDR:
- case OSIOCGIFDSTADDR:
- case OSIOCGIFBRDADDR:
- case OSIOCGIFNETMASK:
- *(u_short *)&ifr->ifr_addr = ifr->ifr_addr.sa_family;
- }
- return (error);
-
- }
-#endif
- }
- return (0);
-}
-
-/*
- * Set/clear promiscuous mode on interface ifp based on the truth value
- * of pswitch. The calls are reference counted so that only the first
- * "on" request actually has an effect, as does the final "off" request.
- * Results are undefined if the "off" and "on" requests are not matched.
- */
-int
-ifpromisc(ifp, pswitch)
- struct ifnet *ifp;
- int pswitch;
-{
- struct ifreq ifr;
-
- if (pswitch) {
- /*
- * If the device is not configured up, we cannot put it in
- * promiscuous mode.
- */
- if ((ifp->if_flags & IFF_UP) == 0)
- return (ENETDOWN);
- if (ifp->if_pcount++ != 0)
- return (0);
- ifp->if_flags |= IFF_PROMISC;
- log(LOG_INFO, "%s%d: promiscuous mode enabled\n",
- ifp->if_name, ifp->if_unit);
- } else {
- if (--ifp->if_pcount > 0)
- return (0);
- ifp->if_flags &= ~IFF_PROMISC;
- }
- ifr.ifr_flags = ifp->if_flags;
- return ((*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr));
-}
-
-/*
- * Return interface configuration
- * of system. List may be used
- * in later ioctl's (above) to get
- * other information.
- */
-/*ARGSUSED*/
-static int
-ifconf(cmd, data)
- int cmd;
- caddr_t data;
-{
- register struct ifconf *ifc = (struct ifconf *)data;
- register struct ifnet *ifp = ifnet;
- register struct ifaddr *ifa;
- struct ifreq ifr, *ifrp;
- int space = ifc->ifc_len, error = 0;
-
- ifrp = ifc->ifc_req;
- for (; space > sizeof (ifr) && ifp; ifp = ifp->if_next) {
- char workbuf[64];
- int ifnlen;
-
- ifnlen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit);
- if(ifnlen + 1 > sizeof ifr.ifr_name) {
- error = ENAMETOOLONG;
- } else {
- strcpy(ifr.ifr_name, workbuf);
- }
-
- if ((ifa = ifp->if_addrlist) == 0) {
- bzero((caddr_t)&ifr.ifr_addr, sizeof(ifr.ifr_addr));
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr));
- if (error)
- break;
- space -= sizeof (ifr), ifrp++;
- } else
- for ( ; space > sizeof (ifr) && ifa; ifa = ifa->ifa_next) {
- register struct sockaddr *sa = ifa->ifa_addr;
-#ifdef COMPAT_43
- if (cmd == OSIOCGIFCONF) {
- struct osockaddr *osa =
- (struct osockaddr *)&ifr.ifr_addr;
- ifr.ifr_addr = *sa;
- osa->sa_family = sa->sa_family;
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr));
- ifrp++;
- } else
-#endif
- if (sa->sa_len <= sizeof(*sa)) {
- ifr.ifr_addr = *sa;
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr));
- ifrp++;
- } else {
- space -= sa->sa_len - sizeof(*sa);
- if (space < sizeof (ifr))
- break;
- error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
- sizeof (ifr.ifr_name));
- if (error == 0)
- error = copyout((caddr_t)sa,
- (caddr_t)&ifrp->ifr_addr, sa->sa_len);
- ifrp = (struct ifreq *)
- (sa->sa_len + (caddr_t)&ifrp->ifr_addr);
- }
- if (error)
- break;
- space -= sizeof (ifr);
- }
- }
- ifc->ifc_len -= space;
- return (error);
-}
-
-SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers");
-SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management");
diff --git a/cpukit/libnetworking/net/if.h b/cpukit/libnetworking/net/if.h
deleted file mode 100644
index acddd4f095..0000000000
--- a/cpukit/libnetworking/net/if.h
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 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.
- *
- * @(#)if.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_H_
-#define _NET_IF_H_
-
-/*
- * Structures defining a network interface, providing a packet
- * transport mechanism (ala level 0 of the PUP protocols).
- *
- * Each interface accepts output datagrams of a specified maximum
- * length, and provides higher level routines with input datagrams
- * received from its medium.
- *
- * Output occurs when the routine if_output is called, with three parameters:
- * (*ifp->if_output)(ifp, m, dst, rt)
- * Here m is the mbuf chain to be sent and dst is the destination address.
- * The output routine encapsulates the supplied datagram if necessary,
- * and then transmits it on its medium.
- *
- * On input, each interface unwraps the data received by it, and either
- * places it on the input queue of a internetwork datagram routine
- * and posts the associated software interrupt, or passes the datagram to a raw
- * packet input routine.
- *
- * Routines exist for locating interfaces by their addresses
- * or for locating a interface on a certain network, as well as more general
- * routing and gateway routines maintaining information used to locate
- * interfaces. These routines live in the files if.c and route.c
- */
-
-#ifndef _TIME_ /* XXX fast fix for SNMP, going away soon */
-#include <sys/time.h>
-#endif
-
-#ifdef __STDC__
-/*
- * Forward structure declarations for function prototypes [sic].
- */
-struct mbuf;
-struct proc;
-struct rtentry;
-struct socket;
-struct ether_header;
-#endif
-
-/*
- * Structure describing information about an interface
- * which may be of interest to management entities.
- */
-struct if_data {
- /* generic interface information */
- u_char ifi_type; /* ethernet, tokenring, etc */
- u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */
- u_char ifi_addrlen; /* media address length */
- u_char ifi_hdrlen; /* media header length */
- u_char ifi_recvquota; /* polling quota for receive intrs */
- u_char ifi_xmitquota; /* polling quota for xmit intrs */
- u_long ifi_mtu; /* maximum transmission unit */
- u_long ifi_metric; /* routing metric (external only) */
- u_long ifi_baudrate; /* linespeed */
- /* volatile statistics */
- u_long ifi_ipackets; /* packets received on interface */
- u_long ifi_ierrors; /* input errors on interface */
- u_long ifi_opackets; /* packets sent on interface */
- u_long ifi_oerrors; /* output errors on interface */
- u_long ifi_collisions; /* collisions on csma interfaces */
- u_long ifi_ibytes; /* total number of octets received */
- u_long ifi_obytes; /* total number of octets sent */
- u_long ifi_imcasts; /* packets received via multicast */
- u_long ifi_omcasts; /* packets sent via multicast */
- u_long ifi_iqdrops; /* dropped on input, this interface */
- u_long ifi_noproto; /* destined for unsupported protocol */
- u_long ifi_recvtiming; /* usec spent receiving when timing */
- u_long ifi_xmittiming; /* usec spent xmitting when timing */
- struct timeval ifi_lastchange; /* time of last administrative change */
-};
-
-/*
- * Structure defining a queue for a network interface.
- */
-struct ifqueue {
- struct mbuf *ifq_head;
- struct mbuf *ifq_tail;
- int ifq_len;
- int ifq_maxlen;
- int ifq_drops;
-};
-
-/*
- * Structure defining a network interface.
- *
- * (Would like to call this struct ``if'', but C isn't PL/1.)
- */
-struct ifnet {
- void *if_softc; /* pointer to driver state */
- char *if_name; /* name, e.g. ``en'' or ``lo'' */
- struct ifnet *if_next; /* all struct ifnets are chained */
- struct ifaddr *if_addrlist; /* linked list of addresses per if */
- int if_pcount; /* number of promiscuous listeners */
- struct bpf_if *if_bpf; /* packet filter structure */
- u_short if_index; /* numeric abbreviation for this if */
- short if_unit; /* sub-unit for lower level driver */
- short if_timer; /* time 'til if_watchdog called */
- short if_flags; /* up/down, broadcast, etc. */
- int if_ipending; /* interrupts pending */
- void *if_linkmib; /* link-type-specific MIB data */
- size_t if_linkmiblen; /* length of above data */
- struct if_data if_data;
-/* procedure handles */
- int (*if_output) /* output routine (enqueue) */
- __P((struct ifnet *, struct mbuf *, struct sockaddr *,
- struct rtentry *));
- void (*if_start) /* initiate output routine */
- __P((struct ifnet *));
- int (*if_done) /* output complete routine */
- __P((struct ifnet *)); /* (XXX not used; fake prototype) */
- int (*if_ioctl) /* ioctl routine */
- __P((struct ifnet *, int, caddr_t));
- void (*if_watchdog) /* timer routine */
- __P((struct ifnet *));
- int (*if_poll_recv) /* polled receive routine */
- __P((struct ifnet *, int *));
- int (*if_poll_xmit) /* polled transmit routine */
- __P((struct ifnet *, int *));
- void (*if_poll_intren) /* polled interrupt reenable routine */
- __P((struct ifnet *));
- void (*if_poll_slowinput) /* input routine for slow devices */
- __P((struct ifnet *, struct mbuf *));
- void (*if_init) /* Init routine */
- __P((void *));
- struct ifqueue if_snd; /* output queue */
- struct ifqueue *if_poll_slowq; /* input queue for slow devices */
-};
-typedef void if_init_f_t __P((void *));
-
-#define if_mtu if_data.ifi_mtu
-#define if_type if_data.ifi_type
-#define if_physical if_data.ifi_physical
-#define if_addrlen if_data.ifi_addrlen
-#define if_hdrlen if_data.ifi_hdrlen
-#define if_metric if_data.ifi_metric
-#define if_baudrate if_data.ifi_baudrate
-#define if_ipackets if_data.ifi_ipackets
-#define if_ierrors if_data.ifi_ierrors
-#define if_opackets if_data.ifi_opackets
-#define if_oerrors if_data.ifi_oerrors
-#define if_collisions if_data.ifi_collisions
-#define if_ibytes if_data.ifi_ibytes
-#define if_obytes if_data.ifi_obytes
-#define if_imcasts if_data.ifi_imcasts
-#define if_omcasts if_data.ifi_omcasts
-#define if_iqdrops if_data.ifi_iqdrops
-#define if_noproto if_data.ifi_noproto
-#define if_lastchange if_data.ifi_lastchange
-#define if_recvquota if_data.ifi_recvquota
-#define if_xmitquota if_data.ifi_xmitquota
-#define if_rawoutput(if, m, sa) if_output(if, m, sa, (struct rtentry *)0)
-
-#define IFF_UP 0x1 /* interface is up */
-#define IFF_BROADCAST 0x2 /* broadcast address valid */
-#define IFF_DEBUG 0x4 /* turn on debugging */
-#define IFF_LOOPBACK 0x8 /* is a loopback net */
-#define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */
-/*#define IFF_NOTRAILERS 0x20 * obsolete: avoid use of trailers */
-#define IFF_RUNNING 0x40 /* resources allocated */
-#define IFF_NOARP 0x80 /* no address resolution protocol */
-#define IFF_PROMISC 0x100 /* receive all packets */
-#define IFF_ALLMULTI 0x200 /* receive all multicast packets */
-#define IFF_OACTIVE 0x400 /* transmission in progress */
-#define IFF_SIMPLEX 0x800 /* can't hear own transmissions */
-#define IFF_LINK0 0x1000 /* per link layer defined bit */
-#define IFF_LINK1 0x2000 /* per link layer defined bit */
-#define IFF_LINK2 0x4000 /* per link layer defined bit */
-#define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */
-#define IFF_MULTICAST 0x8000 /* supports multicast */
-
-/* flags set internally only: */
-#define IFF_CANTCHANGE \
- (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\
- IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI)
-
-
-/*
- * These really don't belong here, but there's no other obviously appropriate
- * location.
- */
-#define IFP_AUI 0
-#define IFP_10BASE2 1
-#define IFP_10BASET 2
-/* etc. */
-
-/*
- * Bit values in if_ipending
- */
-#define IFI_RECV 1 /* I want to receive */
-#define IFI_XMIT 2 /* I want to transmit */
-
-/*
- * Output queues (ifp->if_snd) and slow device input queues (*ifp->if_slowq)
- * are queues of messages stored on ifqueue structures
- * (defined above). Entries are added to and deleted from these structures
- * by these macros, which should be called with ipl raised to splimp().
- */
-#define IF_QFULL(ifq) ((ifq)->ifq_len >= (ifq)->ifq_maxlen)
-#define IF_DROP(ifq) ((ifq)->ifq_drops++)
-#define IF_ENQUEUE(ifq, m) { \
- (m)->m_nextpkt = 0; \
- if ((ifq)->ifq_tail == 0) \
- (ifq)->ifq_head = m; \
- else \
- (ifq)->ifq_tail->m_nextpkt = m; \
- (ifq)->ifq_tail = m; \
- (ifq)->ifq_len++; \
-}
-#define IF_PREPEND(ifq, m) { \
- (m)->m_nextpkt = (ifq)->ifq_head; \
- if ((ifq)->ifq_tail == 0) \
- (ifq)->ifq_tail = (m); \
- (ifq)->ifq_head = (m); \
- (ifq)->ifq_len++; \
-}
-#define IF_DEQUEUE(ifq, m) { \
- (m) = (ifq)->ifq_head; \
- if (m) { \
- if (((ifq)->ifq_head = (m)->m_nextpkt) == 0) \
- (ifq)->ifq_tail = 0; \
- (m)->m_nextpkt = 0; \
- (ifq)->ifq_len--; \
- } \
-}
-
-#ifdef KERNEL
-#define IF_ENQ_DROP(ifq, m) if_enq_drop(ifq, m)
-
-#if defined(__GNUC__) && defined(MT_HEADER)
-static inline int
-if_queue_drop(struct ifqueue *ifq, struct mbuf *m)
-{
- IF_DROP(ifq);
- return 0;
-}
-
-static inline int
-if_enq_drop(struct ifqueue *ifq, struct mbuf *m)
-{
- if (IF_QFULL(ifq) &&
- !if_queue_drop(ifq, m))
- return 0;
- IF_ENQUEUE(ifq, m);
- return 1;
-}
-#else
-
-#ifdef MT_HEADER
-int if_enq_drop __P((struct ifqueue *, struct mbuf *));
-#endif
-
-#endif
-#endif /* KERNEL */
-
-#define IFQ_MAXLEN 50
-#define IFNET_SLOWHZ 1 /* granularity is 1 second */
-
-/*
- * The ifaddr structure contains information about one address
- * of an interface. They are maintained by the different address families,
- * are allocated and attached when an address is set, and are linked
- * together so all addresses for an interface can be located.
- */
-struct ifaddr {
- struct sockaddr *ifa_addr; /* address of interface */
- struct sockaddr *ifa_dstaddr; /* other end of p-to-p link */
-#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */
- struct sockaddr *ifa_netmask; /* used to determine subnet */
- struct ifnet *ifa_ifp; /* back-pointer to interface */
- struct ifaddr *ifa_next; /* next address for interface */
- void (*ifa_rtrequest) /* check or clean routes (+ or -)'d */
- __P((int, struct rtentry *, struct sockaddr *));
- u_short ifa_flags; /* mostly rt_flags for cloning */
- short ifa_refcnt; /* references to this structure */
- int ifa_metric; /* cost of going out this interface */
-#ifdef notdef
- struct rtentry *ifa_rt; /* XXXX for ROUTETOIF ????? */
-#endif
- int (*ifa_claim_addr) /* check if an addr goes to this if */
- __P((struct ifaddr *, struct sockaddr *));
-
-};
-#define IFA_ROUTE RTF_UP /* route installed */
-
-/*
- * Message format for use in obtaining information about interfaces
- * from getkerninfo and the routing socket
- */
-struct if_msghdr {
- u_short ifm_msglen; /* to skip over non-understood messages */
- u_char ifm_version; /* future binary compatability */
- u_char ifm_type; /* message type */
- int ifm_addrs; /* like rtm_addrs */
- int ifm_flags; /* value of if_flags */
- u_short ifm_index; /* index for associated ifp */
- struct if_data ifm_data;/* statistics and other data about if */
-};
-
-/*
- * Message format for use in obtaining information about interface addresses
- * from getkerninfo and the routing socket
- */
-struct ifa_msghdr {
- u_short ifam_msglen; /* to skip over non-understood messages */
- u_char ifam_version; /* future binary compatability */
- u_char ifam_type; /* message type */
- int ifam_addrs; /* like rtm_addrs */
- int ifam_flags; /* value of ifa_flags */
- u_short ifam_index; /* index for associated ifp */
- int ifam_metric; /* value of ifa_metric */
-};
-
-/*
- * Interface request structure used for socket
- * ioctl's. All interface ioctl's must have parameter
- * definitions which begin with ifr_name. The
- * remainder may be interface specific.
- */
-struct ifreq {
-#define IFNAMSIZ 16
- char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- union {
- struct sockaddr ifru_addr;
- struct sockaddr ifru_dstaddr;
- struct sockaddr ifru_broadaddr;
- short ifru_flags;
- int ifru_metric;
- int ifru_mtu;
- int ifru_phys;
- int ifru_media;
- caddr_t ifru_data;
- } ifr_ifru;
-#define ifr_addr ifr_ifru.ifru_addr /* address */
-#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
-#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
-#define ifr_flags ifr_ifru.ifru_flags /* flags */
-#define ifr_metric ifr_ifru.ifru_metric /* metric */
-#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
-#define ifr_phys ifr_ifru.ifru_phys /* physical wire */
-#define ifr_media ifr_ifru.ifru_media /* physical media */
-#define ifr_data ifr_ifru.ifru_data /* for use by interface */
-};
-
-struct ifaliasreq {
- char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- struct sockaddr ifra_addr;
- struct sockaddr ifra_broadaddr;
- struct sockaddr ifra_mask;
-};
-
-struct ifmediareq {
- char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- int ifm_current; /* current media options */
- int ifm_mask; /* don't care mask */
- int ifm_status; /* media status */
- int ifm_active; /* active options */
- int ifm_count; /* # entries in ifm_ulist array */
- int *ifm_ulist; /* media words */
-};
-/*
- * Structure used in SIOCGIFCONF request.
- * Used to retrieve interface configuration
- * for machine (useful for programs which
- * must know all networks accessible).
- */
-struct ifconf {
- int ifc_len; /* size of associated buffer */
- union {
- caddr_t ifcu_buf;
- struct ifreq *ifcu_req;
- } ifc_ifcu;
-#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
-#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
-};
-
-#include <net/if_arp.h>
-
-#ifdef KERNEL
-#define IFAFREE(ifa) \
- if ((ifa)->ifa_refcnt <= 0) \
- ifafree(ifa); \
- else \
- (ifa)->ifa_refcnt--;
-
-extern struct ifnet *ifnet;
-extern int ifqmaxlen;
-extern struct ifnet loif[];
-extern int if_index;
-extern struct ifaddr **ifnet_addrs;
-
-void ether_ifattach __P((struct ifnet *));
-void ether_input __P((struct ifnet *, struct ether_header *, struct mbuf *));
-int ether_output __P((struct ifnet *,
- struct mbuf *, struct sockaddr *, struct rtentry *));
-int ether_ioctl __P((struct ifnet *, int , caddr_t ));
-
-void if_attach __P((struct ifnet *));
-void if_down __P((struct ifnet *));
-void if_up __P((struct ifnet *));
-#ifdef vax
-void ifubareset __P((int));
-#endif
-/*void ifinit __P((void));*/ /* declared in systm.h for main() */
-int ifioctl __P((struct socket *, int, caddr_t, struct proc *));
-int ifpromisc __P((struct ifnet *, int));
-struct ifnet *ifunit __P((char *));
-
-int if_poll_recv_slow __P((struct ifnet *ifp, int *quotap));
-void if_poll_xmit_slow __P((struct ifnet *ifp, int *quotap));
-void if_poll_throttle __P((void));
-void if_poll_unthrottle __P((void *));
-void if_poll_init __P((void));
-void if_poll __P((void));
-
-struct ifaddr *ifa_ifwithaddr __P((struct sockaddr *));
-struct ifaddr *ifa_ifwithdstaddr __P((struct sockaddr *));
-struct ifaddr *ifa_ifwithnet __P((struct sockaddr *));
-struct ifaddr *ifa_ifwithroute __P((int, struct sockaddr *,
- struct sockaddr *));
-struct ifaddr *ifaof_ifpforaddr __P((struct sockaddr *, struct ifnet *));
-void ifafree __P((struct ifaddr *));
-
-int looutput __P((struct ifnet *,
- struct mbuf *, struct sockaddr *, struct rtentry *));
-#endif /* KERNEL */
-
-#endif /* !_NET_IF_H_ */
diff --git a/cpukit/libnetworking/net/if_arp.h b/cpukit/libnetworking/net/if_arp.h
deleted file mode 100644
index dd726bf856..0000000000
--- a/cpukit/libnetworking/net/if_arp.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 1986, 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.
- *
- * @(#)if_arp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_ARP_H_
-#define _NET_IF_ARP_H_
-
-/*
- * Address Resolution Protocol.
- *
- * See RFC 826 for protocol description. ARP packets are variable
- * in size; the arphdr structure defines the fixed-length portion.
- * Protocol type values are the same as those for 10 Mb/s Ethernet.
- * It is followed by the variable-sized fields ar_sha, arp_spa,
- * arp_tha and arp_tpa in that order, according to the lengths
- * specified. Field names used correspond to RFC 826.
- */
-struct arphdr {
- u_short ar_hrd; /* format of hardware address */
-#define ARPHRD_ETHER 1 /* ethernet hardware format */
-#define ARPHRD_FRELAY 15 /* frame relay hardware format */
- u_short ar_pro; /* format of protocol address */
- u_char ar_hln; /* length of hardware address */
- u_char ar_pln; /* length of protocol address */
- u_short ar_op; /* one of: */
-#define ARPOP_REQUEST 1 /* request to resolve address */
-#define ARPOP_REPLY 2 /* response to previous request */
-#define ARPOP_REVREQUEST 3 /* request protocol address given hardware */
-#define ARPOP_REVREPLY 4 /* response giving protocol address */
-#define ARPOP_INVREQUEST 8 /* request to identify peer */
-#define ARPOP_INVREPLY 9 /* response identifying peer */
-/*
- * The remaining fields are variable in size,
- * according to the sizes above.
- */
-#ifdef COMMENT_ONLY
- u_char ar_sha[]; /* sender hardware address */
- u_char ar_spa[]; /* sender protocol address */
- u_char ar_tha[]; /* target hardware address */
- u_char ar_tpa[]; /* target protocol address */
-#endif
-};
-
-/*
- * ARP ioctl request
- */
-struct arpreq {
- struct sockaddr arp_pa; /* protocol address */
- struct sockaddr arp_ha; /* hardware address */
- int arp_flags; /* flags */
-};
-/* arp_flags and at_flags field values */
-#define ATF_INUSE 0x01 /* entry in use */
-#define ATF_COM 0x02 /* completed entry (enaddr valid) */
-#define ATF_PERM 0x04 /* permanent entry */
-#define ATF_PUBL 0x08 /* publish entry (respond for other host) */
-#define ATF_USETRAILERS 0x10 /* has requested trailers */
-
-#endif /* !_NET_IF_ARP_H_ */
diff --git a/cpukit/libnetworking/net/if_dl.h b/cpukit/libnetworking/net/if_dl.h
deleted file mode 100644
index 053ae3e92f..0000000000
--- a/cpukit/libnetworking/net/if_dl.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 1990, 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.
- *
- * @(#)if_dl.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_DL_H_
-#define _NET_IF_DL_H_
-
-/*
- * A Link-Level Sockaddr may specify the interface in one of two
- * ways: either by means of a system-provided index number (computed
- * anew and possibly differently on every reboot), or by a human-readable
- * string such as "il0" (for managerial convenience).
- *
- * Census taking actions, such as something akin to SIOCGCONF would return
- * both the index and the human name.
- *
- * High volume transactions (such as giving a link-level ``from'' address
- * in a recvfrom or recvmsg call) may be likely only to provide the indexed
- * form, (which requires fewer copy operations and less space).
- *
- * The form and interpretation of the link-level address is purely a matter
- * of convention between the device driver and its consumers; however, it is
- * expected that all drivers for an interface of a given if_type will agree.
- */
-
-/*
- * Structure of a Link-Level sockaddr:
- */
-struct sockaddr_dl {
- u_char sdl_len; /* Total length of sockaddr */
- u_char sdl_family; /* AF_DLI */
- u_short sdl_index; /* if != 0, system given index for interface */
- u_char sdl_type; /* interface type */
- u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */
- u_char sdl_alen; /* link level address length */
- u_char sdl_slen; /* link layer selector length */
- char sdl_data[12]; /* minimum work area, can be larger;
- contains both if name and ll address */
-};
-
-#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-void link_addr __P((const char *, struct sockaddr_dl *));
-char *link_ntoa __P((const struct sockaddr_dl *));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif
diff --git a/cpukit/libnetworking/net/if_ethersubr.c b/cpukit/libnetworking/net/if_ethersubr.c
deleted file mode 100644
index 4d1675ca3c..0000000000
--- a/cpukit/libnetworking/net/if_ethersubr.c
+++ /dev/null
@@ -1,988 +0,0 @@
-/*
- * Copyright (c) 1982, 1989, 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.
- *
- * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/netisr.h>
-#include <net/route.h>
-#include <net/if_llc.h>
-#include <net/if_dl.h>
-#include <net/if_types.h>
-#include <net/ethernet.h>
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#endif
-#include <netinet/if_ether.h>
-
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
-#ifdef NS
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-ushort ns_nettype;
-int ether_outputdebug = 0;
-int ether_inputdebug = 0;
-#endif
-
-#ifdef ISO
-#include <netiso/argo_debug.h>
-#include <netiso/iso.h>
-#include <netiso/iso_var.h>
-#include <netiso/iso_snpac.h>
-#endif
-
-/*#ifdef LLC
-#include <netccitt/dll.h>
-#include <netccitt/llc_var.h>
-#endif*/
-
-#if defined(LLC) && defined(CCITT)
-extern struct ifqueue pkintrq;
-#endif
-
-#ifdef NETATALK
-#include <netatalk/at.h>
-#include <netatalk/at_var.h>
-#include <netatalk/at_extern.h>
-
-#define llc_snap_org_code llc_un.type_snap.org_code
-#define llc_snap_ether_type llc_un.type_snap.ether_type
-
-extern u_char at_org_code[ 3 ];
-extern u_char aarp_org_code[ 3 ];
-#endif NETATALK
-
-u_char etherbroadcastaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-#define senderr(e) { error = (e); goto bad;}
-
-/*
- * Ethernet output routine.
- * Encapsulate a packet of type family for the local net.
- * Use trailer local net encapsulation if enough data in first
- * packet leaves a multiple of 512 bytes of data in remainder.
- * Assumes that ifp is actually pointer to arpcom structure.
- */
-int
-ether_output(ifp, m0, dst, rt0)
- register struct ifnet *ifp;
- struct mbuf *m0;
- struct sockaddr *dst;
- struct rtentry *rt0;
-{
- short type;
- int s, error = 0;
-#ifdef NS
- u_char *cp
- register struct ifqueue *inq;
- register struct mbuf *m2;
-#endif
- u_char edst[6];
- register struct mbuf *m = m0;
- register struct rtentry *rt;
- struct mbuf *mcopy = (struct mbuf *)0;
- register struct ether_header *eh;
- int off, len = m->m_pkthdr.len;
- struct arpcom *ac = (struct arpcom *)ifp;
-#ifdef NETATALK
- struct at_ifaddr *aa;
-#endif NETATALK
-
- if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
- senderr(ENETDOWN);
- rt = rt0;
- if (rt) {
- if ((rt->rt_flags & RTF_UP) == 0) {
- rt0 = rt = rtalloc1(dst, 1, 0UL);
- if (rt0)
- rt->rt_refcnt--;
- else
- senderr(EHOSTUNREACH);
- }
- if (rt->rt_flags & RTF_GATEWAY) {
- if (rt->rt_gwroute == 0)
- goto lookup;
- if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) {
- rtfree(rt); rt = rt0;
- lookup: rt->rt_gwroute = rtalloc1(rt->rt_gateway, 1,
- 0UL);
- if ((rt = rt->rt_gwroute) == 0)
- senderr(EHOSTUNREACH);
- }
- }
- if (rt->rt_flags & RTF_REJECT)
- if (rt->rt_rmx.rmx_expire == 0 ||
- rtems_bsdnet_seconds_since_boot() < rt->rt_rmx.rmx_expire)
- senderr(rt == rt0 ? EHOSTDOWN : EHOSTUNREACH);
- }
- switch (dst->sa_family) {
-
-#ifdef INET
- case AF_INET:
- if (!arpresolve(ac, rt, m, dst, edst, rt0))
- return (0); /* if not yet resolved */
- /* If broadcasting on a simplex interface, loopback a copy */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- off = m->m_pkthdr.len - m->m_len;
- type = htons(ETHERTYPE_IP);
- break;
-#endif
-#ifdef IPX
- case AF_IPX:
- {
- struct ifaddr *ia;
-
- type = htons(ETHERTYPE_IPX);
- bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host),
- (caddr_t)edst, sizeof (edst));
- for (ia = ifp->if_addrlist; ia != NULL; ia = ia->ifa_next)
- if(ia->ifa_addr->sa_family == AF_IPX &&
- !bcmp((caddr_t)edst,
- (caddr_t)&((struct ipx_ifaddr *)ia)->ia_addr.sipx_addr.x_host,
- sizeof(edst)))
- return (looutput(ifp, m, dst, rt));
- /* If broadcasting on a simplex interface, loopback a copy */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- break;
- }
-#endif
-#ifdef NETATALK
- case AF_APPLETALK:
- {
- struct sockaddr_at *sat = (struct sockaddr_at *)dst;
-
- /*
- * super hack..
- * Most of this loopback code should move into the appletalk
- * code, but it's here for now.. remember to move it! [JRE]
- * This may not get the same interface we started with
- * fix asap. XXX
- */
- aa = at_ifawithnet( sat );
- if (aa == NULL) {
- goto bad;
- }
- if( aa->aa_ifa.ifa_ifp != ifp ) {
- (*aa->aa_ifa.ifa_ifp->if_output)(aa->aa_ifa.ifa_ifp,
- m,dst,rt);
- }
- if (((sat->sat_addr.s_net == ATADDR_ANYNET)
- && (sat->sat_addr.s_node == ATADDR_ANYNODE))
- || ((sat->sat_addr.s_net == aa->aa_addr.sat_addr.s_net )
- && (sat->sat_addr.s_node == aa->aa_addr.sat_addr.s_node))) {
- (void) looutput(ifp, m, dst, rt);
- return(0);
- }
-
- if (!aarpresolve(ac, m, (struct sockaddr_at *)dst, edst)) {
-#ifdef NETATALKDEBUG
- extern char *prsockaddr(struct sockaddr *);
- printf("aarpresolv: failed for %s\n", prsockaddr(dst));
-#endif NETATALKDEBUG
- return (0);
- }
-
- /*
- * If broadcasting on a simplex interface, loopback a copy
- */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- }
- /*
- * In the phase 2 case, we need to prepend an mbuf for the llc header.
- * Since we must preserve the value of m, which is passed to us by
- * value, we m_copy() the first mbuf, and use it for our llc header.
- */
- if ( aa->aa_flags & AFA_PHASE2 ) {
- struct llc llc;
-
- M_PREPEND(m, sizeof(struct llc), M_WAIT);
- len += sizeof(struct llc);
- llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP;
- llc.llc_control = LLC_UI;
- bcopy(at_org_code, llc.llc_snap_org_code, sizeof(at_org_code));
- llc.llc_snap_ether_type = htons( ETHERTYPE_AT );
- bcopy(&llc, mtod(m, caddr_t), sizeof(struct llc));
- type = htons(m->m_pkthdr.len);
- } else {
- type = htons(ETHERTYPE_AT);
- }
- break;
-#endif NETATALK
-#ifdef NS
- case AF_NS:
- switch(ns_nettype){
- default:
- case 0x8137: /* Novell Ethernet_II Ethernet TYPE II */
- type = 0x8137;
- break;
- case 0x0: /* Novell 802.3 */
- type = htons( m->m_pkthdr.len);
- break;
- case 0xe0e0: /* Novell 802.2 and Token-Ring */
- M_PREPEND(m, 3, M_WAIT);
- type = htons( m->m_pkthdr.len);
- cp = mtod(m, u_char *);
- *cp++ = 0xE0;
- *cp++ = 0xE0;
- *cp++ = 0x03;
- break;
- }
- bcopy((caddr_t)&(((struct sockaddr_ns *)dst)->sns_addr.x_host),
- (caddr_t)edst, sizeof (edst));
- if (!bcmp((caddr_t)edst, (caddr_t)&ns_thishost, sizeof(edst))){
- m->m_pkthdr.rcvif = ifp;
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- s = splimp();
- if (IF_QFULL(inq)) {
- IF_DROP(inq);
- m_freem(m);
- } else
- IF_ENQUEUE(inq, m);
- splx(s);
- return (error);
- }
- if (!bcmp((caddr_t)edst, (caddr_t)&ns_broadhost, sizeof(edst))){
- m2 = m_copy(m, 0, (int)M_COPYALL);
- m2->m_pkthdr.rcvif = ifp;
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- s = splimp();
- if (IF_QFULL(inq)) {
- IF_DROP(inq);
- m_freem(m2);
- } else
- IF_ENQUEUE(inq, m2);
- splx(s);
- }
- /* If broadcasting on a simplex interface, loopback a copy */
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX)){
- mcopy = m_copy(m, 0, (int)M_COPYALL);
- }
- break;
-#endif /* NS */
-#ifdef ISO
- case AF_ISO: {
- int snpalen;
- struct llc *l;
- register struct sockaddr_dl *sdl;
-
- if (rt && (sdl = (struct sockaddr_dl *)rt->rt_gateway) &&
- sdl->sdl_family == AF_LINK && sdl->sdl_alen > 0) {
- bcopy(LLADDR(sdl), (caddr_t)edst, sizeof(edst));
- } else if (error =
- iso_snparesolve(ifp, (struct sockaddr_iso *)dst,
- (char *)edst, &snpalen))
- goto bad; /* Not Resolved */
- /* If broadcasting on a simplex interface, loopback a copy */
- if (*edst & 1)
- m->m_flags |= (M_BCAST|M_MCAST);
- if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX) &&
- (mcopy = m_copy(m, 0, (int)M_COPYALL))) {
- M_PREPEND(mcopy, sizeof (*eh), M_DONTWAIT);
- if (mcopy) {
- eh = mtod(mcopy, struct ether_header *);
- bcopy((caddr_t)edst,
- (caddr_t)eh->ether_dhost, sizeof (edst));
- bcopy((caddr_t)ac->ac_enaddr,
- (caddr_t)eh->ether_shost, sizeof (edst));
- }
- }
- M_PREPEND(m, 3, M_DONTWAIT);
- if (m == NULL)
- return (0);
- type = htons(m->m_pkthdr.len);
- l = mtod(m, struct llc *);
- l->llc_dsap = l->llc_ssap = LLC_ISO_LSAP;
- l->llc_control = LLC_UI;
- len += 3;
- IFDEBUG(D_ETHER)
- int i;
- printf("unoutput: sending pkt to: ");
- for (i=0; i<6; i++)
- printf("%x ", edst[i] & 0xff);
- printf("\n");
- ENDDEBUG
- } break;
-#endif /* ISO */
-#ifdef LLC
-/* case AF_NSAP: */
- case AF_CCITT: {
- register struct sockaddr_dl *sdl =
- (struct sockaddr_dl *) rt -> rt_gateway;
-
- if (sdl && sdl->sdl_family == AF_LINK
- && sdl->sdl_alen > 0) {
- bcopy(LLADDR(sdl), (char *)edst,
- sizeof(edst));
- } else goto bad; /* Not a link interface ? Funny ... */
- if ((ifp->if_flags & IFF_SIMPLEX) && (*edst & 1) &&
- (mcopy = m_copy(m, 0, (int)M_COPYALL))) {
- M_PREPEND(mcopy, sizeof (*eh), M_DONTWAIT);
- if (mcopy) {
- eh = mtod(mcopy, struct ether_header *);
- bcopy((caddr_t)edst,
- (caddr_t)eh->ether_dhost, sizeof (edst));
- bcopy((caddr_t)ac->ac_enaddr,
- (caddr_t)eh->ether_shost, sizeof (edst));
- }
- }
- type = htons(m->m_pkthdr.len);
-#ifdef LLC_DEBUG
- {
- int i;
- register struct llc *l = mtod(m, struct llc *);
-
- printf("ether_output: sending LLC2 pkt to: ");
- for (i=0; i<6; i++)
- printf("%x ", edst[i] & 0xff);
- printf(" len 0x%x dsap 0x%x ssap 0x%x control 0x%x\n",
- type & 0xff, l->llc_dsap & 0xff, l->llc_ssap &0xff,
- l->llc_control & 0xff);
-
- }
-#endif /* LLC_DEBUG */
- } break;
-#endif /* LLC */
-
- case AF_UNSPEC:
- eh = (struct ether_header *)dst->sa_data;
- (void)memcpy(edst, eh->ether_dhost, sizeof (edst));
- type = eh->ether_type;
- break;
-
- default:
- printf("%s%d: can't handle af%d\n", ifp->if_name, ifp->if_unit,
- dst->sa_family);
- senderr(EAFNOSUPPORT);
- }
-
-
- if (mcopy)
- (void) looutput(ifp, mcopy, dst, rt);
- /*
- * Add local net header. If no space in first mbuf,
- * allocate another.
- */
- M_PREPEND(m, sizeof (struct ether_header), M_DONTWAIT);
- if (m == 0)
- senderr(ENOBUFS);
- eh = mtod(m, struct ether_header *);
- (void)memcpy(&eh->ether_type, &type,
- sizeof(eh->ether_type));
- (void)memcpy(eh->ether_dhost, edst, sizeof (edst));
- (void)memcpy(eh->ether_shost, ac->ac_enaddr,
- sizeof(eh->ether_shost));
- s = splimp();
- /*
- * Queue message on interface, and start output if interface
- * not yet active.
- */
- if (IF_QFULL(&ifp->if_snd)) {
- IF_DROP(&ifp->if_snd);
- splx(s);
- senderr(ENOBUFS);
- }
- IF_ENQUEUE(&ifp->if_snd, m);
- if ((ifp->if_flags & IFF_OACTIVE) == 0)
- (*ifp->if_start)(ifp);
- splx(s);
- ifp->if_obytes += len + sizeof (struct ether_header);
- if (m->m_flags & M_MCAST)
- ifp->if_omcasts++;
- return (error);
-
-bad:
- if (m)
- m_freem(m);
- return (error);
-}
-
-/*
- * Process a received Ethernet packet;
- * the packet is in the mbuf chain m without
- * the ether header, which is provided separately.
- */
-void
-ether_input(ifp, eh, m)
- struct ifnet *ifp;
- register struct ether_header *eh;
- struct mbuf *m;
-{
- register struct ifqueue *inq;
- u_short ether_type;
-#ifdef NS
- u_short *checksum;
-#endif
- int s;
-#if defined (ISO) || defined (LLC) || defined(NETATALK)
- register struct llc *l;
-#endif
-
- if ((ifp->if_flags & IFF_UP) == 0) {
- m_freem(m);
- return;
- }
- ifp->if_ibytes += m->m_pkthdr.len + sizeof (*eh);
- if (bcmp((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
- sizeof(etherbroadcastaddr)) == 0)
- m->m_flags |= M_BCAST;
- else if (eh->ether_dhost[0] & 1)
- m->m_flags |= M_MCAST;
- if (m->m_flags & (M_BCAST|M_MCAST))
- ifp->if_imcasts++;
-
- ether_type = ntohs(eh->ether_type);
-
- switch (ether_type) {
-#ifdef INET
- case ETHERTYPE_IP:
- schednetisr(NETISR_IP);
- inq = &ipintrq;
- break;
-
- case ETHERTYPE_ARP:
- schednetisr(NETISR_ARP);
- inq = &arpintrq;
- break;
-#endif
-#ifdef IPX
- case ETHERTYPE_IPX:
- schednetisr(NETISR_IPX);
- inq = &ipxintrq;
- break;
-#endif
-#ifdef NS
- case 0x8137: /* Novell Ethernet_II Ethernet TYPE II */
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- break;
-
-#endif /* NS */
-#ifdef NETATALK
- case ETHERTYPE_AT:
- schednetisr(NETISR_ATALK);
- inq = &atintrq1;
- break;
- case ETHERTYPE_AARP:
- /* probably this should be done with a NETISR as well */
- aarpinput((struct arpcom *)ifp, m); /* XXX */
- return;
-#endif NETATALK
- default:
-#ifdef NS
- checksum = mtod(m, ushort *);
- /* Novell 802.3 */
- if ((ether_type <= ETHERMTU) &&
- ((*checksum == 0xffff) || (*checksum == 0xE0E0))){
- if(*checksum == 0xE0E0) {
- m->m_pkthdr.len -= 3;
- m->m_len -= 3;
- m->m_data += 3;
- }
- schednetisr(NETISR_NS);
- inq = &nsintrq;
- break;
- }
-#endif /* NS */
-#if defined (ISO) || defined (LLC) || defined(NETATALK)
- if (ether_type > ETHERMTU)
- goto dropanyway;
- l = mtod(m, struct llc *);
- switch (l->llc_dsap) {
-#ifdef NETATALK
- case LLC_SNAP_LSAP:
- switch (l->llc_control) {
- case LLC_UI:
- if (l->llc_ssap != LLC_SNAP_LSAP)
- goto dropanyway;
-
- if (Bcmp(&(l->llc_snap_org_code)[0], at_org_code,
- sizeof(at_org_code)) == 0 &&
- ntohs(l->llc_snap_ether_type) == ETHERTYPE_AT) {
- inq = &atintrq2;
- m_adj( m, sizeof( struct llc ));
- schednetisr(NETISR_ATALK);
- break;
- }
-
- if (Bcmp(&(l->llc_snap_org_code)[0], aarp_org_code,
- sizeof(aarp_org_code)) == 0 &&
- ntohs(l->llc_snap_ether_type) == ETHERTYPE_AARP) {
- m_adj( m, sizeof( struct llc ));
- aarpinput((struct arpcom *)ifp, m); /* XXX */
- return;
- }
-
- default:
- goto dropanyway;
- }
- break;
-#endif NETATALK
-#ifdef ISO
- case LLC_ISO_LSAP:
- switch (l->llc_control) {
- case LLC_UI:
- /* LLC_UI_P forbidden in class 1 service */
- if ((l->llc_dsap == LLC_ISO_LSAP) &&
- (l->llc_ssap == LLC_ISO_LSAP)) {
- /* LSAP for ISO */
- if (m->m_pkthdr.len > ether_type)
- m_adj(m, ether_type - m->m_pkthdr.len);
- m->m_data += 3; /* XXX */
- m->m_len -= 3; /* XXX */
- m->m_pkthdr.len -= 3; /* XXX */
- M_PREPEND(m, sizeof *eh, M_DONTWAIT);
- if (m == 0)
- return;
- *mtod(m, struct ether_header *) = *eh;
- IFDEBUG(D_ETHER)
- printf("clnp packet");
- ENDDEBUG
- schednetisr(NETISR_ISO);
- inq = &clnlintrq;
- break;
- }
- goto dropanyway;
-
- case LLC_XID:
- case LLC_XID_P:
- if(m->m_len < 6)
- goto dropanyway;
- l->llc_window = 0;
- l->llc_fid = 9;
- l->llc_class = 1;
- l->llc_dsap = l->llc_ssap = 0;
- /* Fall through to */
- case LLC_TEST:
- case LLC_TEST_P:
- {
- struct sockaddr sa;
- register struct ether_header *eh2;
- int i;
- u_char c = l->llc_dsap;
-
- l->llc_dsap = l->llc_ssap;
- l->llc_ssap = c;
- if (m->m_flags & (M_BCAST | M_MCAST))
- bcopy((caddr_t)ac->ac_enaddr,
- (caddr_t)eh->ether_dhost, 6);
- sa.sa_family = AF_UNSPEC;
- sa.sa_len = sizeof(sa);
- eh2 = (struct ether_header *)sa.sa_data;
- for (i = 0; i < 6; i++) {
- eh2->ether_shost[i] = c = eh->ether_dhost[i];
- eh2->ether_dhost[i] =
- eh->ether_dhost[i] = eh->ether_shost[i];
- eh->ether_shost[i] = c;
- }
- ifp->if_output(ifp, m, &sa, NULL);
- return;
- }
- default:
- m_freem(m);
- return;
- }
- break;
-#endif /* ISO */
-#ifdef LLC
- case LLC_X25_LSAP:
- {
- if (m->m_pkthdr.len > ether_type)
- m_adj(m, ether_type - m->m_pkthdr.len);
- M_PREPEND(m, sizeof(struct sdl_hdr) , M_DONTWAIT);
- if (m == 0)
- return;
- if ( !sdl_sethdrif(ifp, eh->ether_shost, LLC_X25_LSAP,
- eh->ether_dhost, LLC_X25_LSAP, 6,
- mtod(m, struct sdl_hdr *)))
- panic("ETHER cons addr failure");
- mtod(m, struct sdl_hdr *)->sdlhdr_len = ether_type;
-#ifdef LLC_DEBUG
- printf("llc packet\n");
-#endif /* LLC_DEBUG */
- schednetisr(NETISR_CCITT);
- inq = &llcintrq;
- break;
- }
-#endif /* LLC */
- dropanyway:
- default:
- m_freem(m);
- return;
- }
-#else /* ISO || LLC || NETATALK */
- m_freem(m);
- return;
-#endif /* ISO || LLC || NETATALK */
- }
-
- s = splimp();
- if (IF_QFULL(inq)) {
- IF_DROP(inq);
- m_freem(m);
- } else
- IF_ENQUEUE(inq, m);
- splx(s);
-}
-
-/*
- * Perform common duties while attaching to interface list
- */
-void
-ether_ifattach(ifp)
- register struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
- register struct sockaddr_dl *sdl;
-
- ifp->if_type = IFT_ETHER;
- ifp->if_addrlen = 6;
- ifp->if_hdrlen = 14;
- ifp->if_mtu = ETHERMTU;
- if (ifp->if_baudrate == 0)
- ifp->if_baudrate = 10000000;
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- if ((sdl = (struct sockaddr_dl *)ifa->ifa_addr) &&
- sdl->sdl_family == AF_LINK) {
- sdl->sdl_type = IFT_ETHER;
- sdl->sdl_alen = ifp->if_addrlen;
- bcopy((caddr_t)((struct arpcom *)ifp)->ac_enaddr,
- LLADDR(sdl), ifp->if_addrlen);
- break;
- }
-}
-
-static u_char ether_ipmulticast_min[6] =
- { 0x01, 0x00, 0x5e, 0x00, 0x00, 0x00 };
-static u_char ether_ipmulticast_max[6] =
- { 0x01, 0x00, 0x5e, 0x7f, 0xff, 0xff };
-/*
- * Add an Ethernet multicast address or range of addresses to the list for a
- * given interface.
- */
-int
-ether_addmulti(ifr, ac)
- struct ifreq *ifr;
- register struct arpcom *ac;
-{
- register struct ether_multi *enm;
- struct sockaddr_in *sin;
- u_char addrlo[6];
- u_char addrhi[6];
- int set_allmulti = 0;
- int s = splimp();
-
- switch (ifr->ifr_addr.sa_family) {
-
- case AF_UNSPEC:
- bcopy(ifr->ifr_addr.sa_data, addrlo, 6);
- bcopy(addrlo, addrhi, 6);
- break;
-
-#ifdef INET
- case AF_INET:
- sin = (struct sockaddr_in *)&(ifr->ifr_addr);
- if (sin->sin_addr.s_addr == INADDR_ANY) {
- /*
- * An IP address of INADDR_ANY means listen to all
- * of the Ethernet multicast addresses used for IP.
- * (This is for the sake of IP multicast routers.)
- */
- bcopy(ether_ipmulticast_min, addrlo, 6);
- bcopy(ether_ipmulticast_max, addrhi, 6);
- set_allmulti = 1;
- }
- else {
- ETHER_MAP_IP_MULTICAST(&sin->sin_addr, addrlo);
- bcopy(addrlo, addrhi, 6);
- }
- break;
-#endif
-
- default:
- splx(s);
- return (EAFNOSUPPORT);
- }
-
- /*
- * Verify that we have valid Ethernet multicast addresses.
- */
- if ((addrlo[0] & 0x01) != 1 || (addrhi[0] & 0x01) != 1) {
- splx(s);
- return (EINVAL);
- }
- /*
- * See if the address range is already in the list.
- */
- ETHER_LOOKUP_MULTI(addrlo, addrhi, ac, enm);
- if (enm != NULL) {
- /*
- * Found it; just increment the reference count.
- */
- ++enm->enm_refcount;
- splx(s);
- return (0);
- }
- /*
- * New address or range; malloc a new multicast record
- * and link it into the interface's multicast list.
- */
- enm = (struct ether_multi *)malloc(sizeof(*enm), M_IFMADDR, M_NOWAIT);
- if (enm == NULL) {
- splx(s);
- return (ENOBUFS);
- }
- bcopy(addrlo, enm->enm_addrlo, 6);
- bcopy(addrhi, enm->enm_addrhi, 6);
- enm->enm_ac = ac;
- enm->enm_refcount = 1;
- enm->enm_next = ac->ac_multiaddrs;
- ac->ac_multiaddrs = enm;
- ac->ac_multicnt++;
- splx(s);
- if (set_allmulti)
- ac->ac_if.if_flags |= IFF_ALLMULTI;
-
- /*
- * Return ENETRESET to inform the driver that the list has changed
- * and its reception filter should be adjusted accordingly.
- */
- return (ENETRESET);
-}
-
-/*
- * Delete a multicast address record.
- */
-int
-ether_delmulti(ifr, ac)
- struct ifreq *ifr;
- register struct arpcom *ac;
-{
- register struct ether_multi *enm;
- register struct ether_multi **p;
- struct sockaddr_in *sin;
- u_char addrlo[6];
- u_char addrhi[6];
- int unset_allmulti = 0;
- int s = splimp();
-
- switch (ifr->ifr_addr.sa_family) {
-
- case AF_UNSPEC:
- bcopy(ifr->ifr_addr.sa_data, addrlo, 6);
- bcopy(addrlo, addrhi, 6);
- break;
-
-#ifdef INET
- case AF_INET:
- sin = (struct sockaddr_in *)&(ifr->ifr_addr);
- if (sin->sin_addr.s_addr == INADDR_ANY) {
- /*
- * An IP address of INADDR_ANY means stop listening
- * to the range of Ethernet multicast addresses used
- * for IP.
- */
- bcopy(ether_ipmulticast_min, addrlo, 6);
- bcopy(ether_ipmulticast_max, addrhi, 6);
- unset_allmulti = 1;
- }
- else {
- ETHER_MAP_IP_MULTICAST(&sin->sin_addr, addrlo);
- bcopy(addrlo, addrhi, 6);
- }
- break;
-#endif
-
- default:
- splx(s);
- return (EAFNOSUPPORT);
- }
-
- /*
- * Look up the address in our list.
- */
- ETHER_LOOKUP_MULTI(addrlo, addrhi, ac, enm);
- if (enm == NULL) {
- splx(s);
- return (ENXIO);
- }
- if (--enm->enm_refcount != 0) {
- /*
- * Still some claims to this record.
- */
- splx(s);
- return (0);
- }
- /*
- * No remaining claims to this record; unlink and free it.
- */
- for (p = &enm->enm_ac->ac_multiaddrs;
- *p != enm;
- p = &(*p)->enm_next)
- continue;
- *p = (*p)->enm_next;
- free(enm, M_IFMADDR);
- ac->ac_multicnt--;
- splx(s);
- if (unset_allmulti)
- ac->ac_if.if_flags &= ~IFF_ALLMULTI;
-
- /*
- * Return ENETRESET to inform the driver that the list has changed
- * and its reception filter should be adjusted accordingly.
- */
- return (ENETRESET);
-}
-
-SYSCTL_NODE(_net_link, IFT_ETHER, ether, CTLFLAG_RW, 0, "Ethernet");
-
-int
-ether_ioctl(struct ifnet *ifp, int command, caddr_t data)
-{
- struct ifaddr *ifa = (struct ifaddr *) data;
- struct ifreq *ifr = (struct ifreq *) data;
- int error = 0;
-
- switch (command) {
- case SIOCSIFADDR:
- ifp->if_flags |= IFF_UP;
-
- switch (ifa->ifa_addr->sa_family) {
-#ifdef INET
- case AF_INET:
- ifp->if_init(ifp->if_softc); /* before arpwhohas */
- arp_ifinit((struct arpcom *)ifp, ifa);
- break;
-#endif
-#ifdef IPX
- /*
- * XXX - This code is probably wrong
- */
- case AF_IPX:
- {
- register struct ipx_addr *ina = &(IA_SIPX(ifa)->sipx_addr);
- struct arpcom *ac = (struct arpcom *) (ifp->if_softc);
-
- if (ipx_nullhost(*ina))
- ina->x_host =
- *(union ipx_host *)
- ac->ac_enaddr;
- else {
- bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) ac->ac_enaddr,
- sizeof(ac->ac_enaddr));
- }
-
- /*
- * Set new address
- */
- ifp->if_init(ifp->if_softc);
- break;
- }
-#endif
-#ifdef NS
- /*
- * XXX - This code is probably wrong
- */
- case AF_NS:
- {
- register struct ns_addr *ina = &(IA_SNS(ifa)->sns_addr);
- struct arpcom *ac = (struct arpcom *) (ifp->if_softc);
-
- if (ns_nullhost(*ina))
- ina->x_host =
- *(union ns_host *) (ac->ac_enaddr);
- else {
- bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) ac->ac_enaddr,
- sizeof(ac->ac_enaddr));
- }
-
- /*
- * Set new address
- */
- ifp->if_init(ifp->if_softc);
- break;
- }
-#endif
- default:
- ifp->if_init(ifp->if_softc);
- break;
- }
- break;
-
- case SIOCGIFADDR:
- {
- struct sockaddr *sa;
-
- sa = (struct sockaddr *) & ifr->ifr_data;
- bcopy(((struct arpcom *)ifp->if_softc)->ac_enaddr,
- (caddr_t) sa->sa_data, ETHER_ADDR_LEN);
- }
- break;
-
- case SIOCSIFMTU:
- /*
- * Set the interface MTU.
- */
- if (ifr->ifr_mtu > ETHERMTU) {
- error = EINVAL;
- } else {
- ifp->if_mtu = ifr->ifr_mtu;
- }
- break;
- }
- return (error);
-}
diff --git a/cpukit/libnetworking/net/if_llc.h b/cpukit/libnetworking/net/if_llc.h
deleted file mode 100644
index 3cdf652167..0000000000
--- a/cpukit/libnetworking/net/if_llc.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * @(#)if_llc.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_IF_LLC_H_
-#define _NET_IF_LLC_H_
-
-/*
- * IEEE 802.2 Link Level Control headers, for use in conjunction with
- * 802.{3,4,5} media access control methods.
- *
- * Headers here do not use bit fields due to shortcomings in many
- * compilers.
- */
-
-struct llc {
- u_char llc_dsap;
- u_char llc_ssap;
- union {
- struct {
- u_char control;
- u_char format_id;
- u_char class;
- u_char window_x2;
- } type_u;
- struct {
- u_char num_snd_x2;
- u_char num_rcv_x2;
- } type_i;
- struct {
- u_char control;
- u_char num_rcv_x2;
- } type_s;
- struct {
- u_char control;
- struct frmrinfo {
- u_char rej_pdu_0;
- u_char rej_pdu_1;
- u_char frmr_control;
- u_char frmr_control_ext;
- u_char frmr_cause;
- } frmrinfo;
- } type_frmr;
- struct {
- u_char control;
- u_char org_code[3];
- u_short ether_type;
- } type_snap;
- struct {
- u_char control;
- u_char control_ext;
- } type_raw;
- } llc_un;
-};
-#define llc_control llc_un.type_u.control
-#define llc_control_ext llc_un.type_raw.control_ext
-#define llc_fid llc_un.type_u.format_id
-#define llc_class llc_un.type_u.class
-#define llc_window llc_un.type_u.window_x2
-#define llc_frmrinfo llc_un.type_frmr.frmrinfo
-#define llc_frmr_pdu0 llc_un.type_frmr.frmrinfo.rej_pdu0
-#define llc_frmr_pdu1 llc_un.type_frmr.frmrinfo.rej_pdu1
-#define llc_frmr_control llc_un.type_frmr.frmrinfo.frmr_control
-#define llc_frmr_control_ext llc_un.type_frmr.frmrinfo.frmr_control_ext
-#define llc_frmr_cause llc_un.type_frmr.frmrinfo.frmr_control_ext
-
-/*
- * Don't use sizeof(struct llc_un) for LLC header sizes
- */
-#define LLC_ISFRAMELEN 4
-#define LLC_UFRAMELEN 3
-#define LLC_FRMRLEN 7
-
-/*
- * Unnumbered LLC format commands
- */
-#define LLC_UI 0x3
-#define LLC_UI_P 0x13
-#define LLC_DISC 0x43
-#define LLC_DISC_P 0x53
-#define LLC_UA 0x63
-#define LLC_UA_P 0x73
-#define LLC_TEST 0xe3
-#define LLC_TEST_P 0xf3
-#define LLC_FRMR 0x87
-#define LLC_FRMR_P 0x97
-#define LLC_DM 0x0f
-#define LLC_DM_P 0x1f
-#define LLC_XID 0xaf
-#define LLC_XID_P 0xbf
-#define LLC_SABME 0x6f
-#define LLC_SABME_P 0x7f
-
-/*
- * Supervisory LLC commands
- */
-#define LLC_RR 0x01
-#define LLC_RNR 0x05
-#define LLC_REJ 0x09
-
-/*
- * Info format - dummy only
- */
-#define LLC_INFO 0x00
-
-/*
- * ISO PDTR 10178 contains among others
- */
-#define LLC_X25_LSAP 0x7e
-#define LLC_SNAP_LSAP 0xaa
-#define LLC_ISO_LSAP 0xfe
-
-#endif
diff --git a/cpukit/libnetworking/net/if_loop.c b/cpukit/libnetworking/net/if_loop.c
deleted file mode 100644
index 3823c28744..0000000000
--- a/cpukit/libnetworking/net/if_loop.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)if_loop.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-/*
- * Loopback interface driver for protocol testing and timing.
- */
-#include "loop.h"
-#if NLOOP > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-
-#include <net/if.h>
-#include <net/if_types.h>
-#include <net/netisr.h>
-#include <net/route.h>
-#include <net/bpf.h>
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#endif
-
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
-#ifdef NS
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-#endif
-
-#ifdef ISO
-#include <netiso/iso.h>
-#include <netiso/iso_var.h>
-#endif
-
-#ifdef NETATALK
-#include <netinet/if_ether.h>
-#include <netatalk/at.h>
-#include <netatalk/at_var.h>
-#endif NETATALK
-
-#include "bpfilter.h"
-
-static int loioctl __P((struct ifnet *, int, caddr_t));
-static void lortrequest __P((int, struct rtentry *, struct sockaddr *));
-
- void rtems_bsdnet_loopattach __P((void *));
-PSEUDO_SET(loopattach, if_loop);
-
-#ifdef TINY_LOMTU
-#define LOMTU (1024+512)
-#else
-#define LOMTU 16384
-#endif
-
-struct ifnet loif[NLOOP];
-
-/* ARGSUSED */
-void
-rtems_bsdnet_loopattach(dummy)
- void *dummy;
-{
- register struct ifnet *ifp;
- register int i = 0;
-
- for (ifp = loif; i < NLOOP; ifp++) {
- ifp->if_name = "lo";
- ifp->if_next = NULL;
- ifp->if_unit = i++;
- ifp->if_mtu = LOMTU;
- ifp->if_flags = IFF_LOOPBACK | IFF_MULTICAST;
- ifp->if_ioctl = loioctl;
- ifp->if_output = looutput;
- ifp->if_type = IFT_LOOP;
- ifp->if_hdrlen = 0;
- ifp->if_addrlen = 0;
- if_attach(ifp);
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_NULL, sizeof(u_int));
-#endif
- }
-}
-
-int
-looutput(ifp, m, dst, rt)
- struct ifnet *ifp;
- register struct mbuf *m;
- struct sockaddr *dst;
- register struct rtentry *rt;
-{
- int s, isr;
- register struct ifqueue *ifq = 0;
-
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("looutput no HDR");
-#if NBPFILTER > 0
- /* BPF write needs to be handled specially */
- if (dst->sa_family == AF_UNSPEC) {
- dst->sa_family = *(mtod(m, int *));
- m->m_len -= sizeof(int);
- m->m_pkthdr.len -= sizeof(int);
- m->m_data += sizeof(int);
- }
-
- if (ifp->if_bpf) {
- /*
- * We need to prepend the address family as
- * a four byte field. Cons up a dummy header
- * to pacify bpf. This is safe because bpf
- * will only read from the mbuf (i.e., it won't
- * try to free it or keep a pointer a to it).
- */
- struct mbuf m0;
- u_int af = dst->sa_family;
-
- m0.m_next = m;
- m0.m_len = 4;
- m0.m_data = (char *)&af;
-
- bpf_mtap(ifp, &m0);
- }
-#endif
- m->m_pkthdr.rcvif = ifp;
-
- if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
- m_freem(m);
- return (rt->rt_flags & RTF_BLACKHOLE ? 0 :
- rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
- }
- ifp->if_opackets++;
- ifp->if_obytes += m->m_pkthdr.len;
- switch (dst->sa_family) {
-
-#ifdef INET
- case AF_INET:
- ifq = &ipintrq;
- isr = NETISR_IP;
- break;
-#endif
-#ifdef IPX
- case AF_IPX:
- ifq = &ipxintrq;
- isr = NETISR_IPX;
- break;
-#endif
-#ifdef NS
- case AF_NS:
- ifq = &nsintrq;
- isr = NETISR_NS;
- break;
-#endif
-#ifdef ISO
- case AF_ISO:
- ifq = &clnlintrq;
- isr = NETISR_ISO;
- break;
-#endif
-#ifdef NETATALK
- case AF_APPLETALK:
- ifq = &atintrq2;
- isr = NETISR_ATALK;
- break;
-#endif NETATALK
- default:
- printf("lo%d: can't handle af%d\n", ifp->if_unit,
- dst->sa_family);
- m_freem(m);
- return (EAFNOSUPPORT);
- }
- s = splimp();
- if (IF_QFULL(ifq)) {
- IF_DROP(ifq);
- m_freem(m);
- splx(s);
- return (ENOBUFS);
- }
- IF_ENQUEUE(ifq, m);
- schednetisr(isr);
- ifp->if_ipackets++;
- ifp->if_ibytes += m->m_pkthdr.len;
- splx(s);
- return (0);
-}
-
-/* ARGSUSED */
-static void
-lortrequest(cmd, rt, sa)
- int cmd;
- struct rtentry *rt;
- struct sockaddr *sa;
-{
- if (rt) {
- rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; /* for ISO */
- /*
- * For optimal performance, the send and receive buffers
- * should be at least twice the MTU plus a little more for
- * overhead.
- */
- rt->rt_rmx.rmx_recvpipe =
- rt->rt_rmx.rmx_sendpipe = 3 * LOMTU;
- }
-}
-
-/*
- * Process an ioctl request.
- */
-/* ARGSUSED */
-static int
-loioctl(ifp, cmd, data)
- register struct ifnet *ifp;
- int cmd;
- caddr_t data;
-{
- register struct ifaddr *ifa;
- register struct ifreq *ifr = (struct ifreq *)data;
- register int error = 0;
-
- switch (cmd) {
-
- case SIOCSIFADDR:
- ifp->if_flags |= IFF_UP | IFF_RUNNING;
- ifa = (struct ifaddr *)data;
- ifa->ifa_rtrequest = lortrequest;
- /*
- * Everything else is done at a higher level.
- */
- break;
-
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- if (ifr == 0) {
- error = EAFNOSUPPORT; /* XXX */
- break;
- }
- switch (ifr->ifr_addr.sa_family) {
-
-#ifdef INET
- case AF_INET:
- break;
-#endif
-
- default:
- error = EAFNOSUPPORT;
- break;
- }
- break;
-
- case SIOCSIFMTU:
- ifp->if_mtu = ifr->ifr_mtu;
- break;
-
- default:
- error = EINVAL;
- }
- return (error);
-}
-#endif /* NLOOP > 0 */
diff --git a/cpukit/libnetworking/net/if_types.h b/cpukit/libnetworking/net/if_types.h
deleted file mode 100644
index 833ba471c3..0000000000
--- a/cpukit/libnetworking/net/if_types.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 1989, 1993, 1994
- * 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.
- *
- * @(#)if_types.h 8.2 (Berkeley) 4/20/94
- * $Id$
- */
-
-#ifndef _NET_IF_TYPES_H_
-#define _NET_IF_TYPES_H_
-
-/*
- * Interface types for benefit of parsing media address headers.
- * This list is derived from the SNMP list of ifTypes, currently
- * documented in RFC1573.
- */
-
-#define IFT_OTHER 0x1 /* none of the following */
-#define IFT_1822 0x2 /* old-style arpanet imp */
-#define IFT_HDH1822 0x3 /* HDH arpanet imp */
-#define IFT_X25DDN 0x4 /* x25 to imp */
-#define IFT_X25 0x5 /* PDN X25 interface (RFC877) */
-#define IFT_ETHER 0x6 /* Ethernet CSMACD */
-#define IFT_ISO88023 0x7 /* CMSA CD */
-#define IFT_ISO88024 0x8 /* Token Bus */
-#define IFT_ISO88025 0x9 /* Token Ring */
-#define IFT_ISO88026 0xa /* MAN */
-#define IFT_STARLAN 0xb
-#define IFT_P10 0xc /* Proteon 10MBit ring */
-#define IFT_P80 0xd /* Proteon 80MBit ring */
-#define IFT_HY 0xe /* Hyperchannel */
-#define IFT_FDDI 0xf
-#define IFT_LAPB 0x10
-#define IFT_SDLC 0x11
-#define IFT_T1 0x12
-#define IFT_CEPT 0x13 /* E1 - european T1 */
-#define IFT_ISDNBASIC 0x14
-#define IFT_ISDNPRIMARY 0x15
-#define IFT_PTPSERIAL 0x16 /* Proprietary PTP serial */
-#define IFT_PPP 0x17 /* RFC 1331 */
-#define IFT_LOOP 0x18 /* loopback */
-#define IFT_EON 0x19 /* ISO over IP */
-#define IFT_XETHER 0x1a /* obsolete 3MB experimental ethernet */
-#define IFT_NSIP 0x1b /* XNS over IP */
-#define IFT_SLIP 0x1c /* IP over generic TTY */
-#define IFT_ULTRA 0x1d /* Ultra Technologies */
-#define IFT_DS3 0x1e /* Generic T3 */
-#define IFT_SIP 0x1f /* SMDS */
-#define IFT_FRELAY 0x20 /* Frame Relay DTE only */
-#define IFT_RS232 0x21
-#define IFT_PARA 0x22 /* parallel-port */
-#define IFT_ARCNET 0x23
-#define IFT_ARCNETPLUS 0x24
-#define IFT_ATM 0x25 /* ATM cells */
-#define IFT_MIOX25 0x26
-#define IFT_SONET 0x27 /* SONET or SDH */
-#define IFT_X25PLE 0x28
-#define IFT_ISO88022LLC 0x29
-#define IFT_LOCALTALK 0x2a
-#define IFT_SMDSDXI 0x2b
-#define IFT_FRELAYDCE 0x2c /* Frame Relay DCE */
-#define IFT_V35 0x2d
-#define IFT_HSSI 0x2e
-#define IFT_HIPPI 0x2f
-#define IFT_MODEM 0x30 /* Generic Modem */
-#define IFT_AAL5 0x31 /* AAL5 over ATM */
-#define IFT_SONETPATH 0x32
-#define IFT_SONETVT 0x33
-#define IFT_SMDSICIP 0x34 /* SMDS InterCarrier Interface */
-#define IFT_PROPVIRTUAL 0x35 /* Proprietary Virtual/internal */
-#define IFT_PROPMUX 0x36 /* Proprietary Multiplexing */
-
-#endif
diff --git a/cpukit/libnetworking/net/netisr.h b/cpukit/libnetworking/net/netisr.h
deleted file mode 100644
index 73269a4442..0000000000
--- a/cpukit/libnetworking/net/netisr.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 1989, 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.
- *
- * @(#)netisr.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_NETISR_H_
-#define _NET_NETISR_H_
-
-/*
- * The networking code runs off software interrupts.
- *
- * You can switch into the network by doing splnet() and return by splx().
- * The software interrupt level for the network is higher than the software
- * level for the clock (so you can enter the network in routines called
- * at timeout time).
- */
-#if defined(vax) || defined(tahoe)
-#define setsoftnet() mtpr(SIRR, 12)
-#endif
-
-/*
- * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status
- * word which is used to de-multiplex a single software
- * interrupt used for scheduling the network code to calls
- * on the lowest level routine of each protocol.
- */
-#define NETISR_RAW 0 /* same as AF_UNSPEC */
-#define NETISR_IP 2 /* same as AF_INET */
-#define NETISR_IMP 3 /* same as AF_IMPLINK */
-#define NETISR_NS 6 /* same as AF_NS */
-#define NETISR_ISO 7 /* same as AF_ISO */
-#define NETISR_CCITT 10 /* same as AF_CCITT */
-#define NETISR_ATALK 16 /* same as AF_APPLETALK */
-#define NETISR_ARP 18 /* same as AF_LINK */
-#define NETISR_IPX 23 /* same as AF_IPX */
-#define NETISR_ISDN 26 /* same as AF_E164 */
-#define NETISR_PPP 27 /* PPP soft interrupt */
-
-#define schednetisr(anisr) rtems_bsdnet_schednetisr(anisr)
-
-#ifndef LOCORE
-#ifdef KERNEL
-extern volatile unsigned int netisr; /* scheduling bits for network */
-
-typedef void netisr_t(void);
-
-struct netisrtab {
- int nit_num;
- netisr_t *nit_isr;
-};
-
-#define NETISR_SET(num, isr)
-
-int register_netisr __P((int, netisr_t *));
-
-#endif
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/net/radix.c b/cpukit/libnetworking/net/radix.c
deleted file mode 100644
index bc1b7ee1d1..0000000000
--- a/cpukit/libnetworking/net/radix.c
+++ /dev/null
@@ -1,1028 +0,0 @@
-/*
- * Copyright (c) 1988, 1989, 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.
- *
- * @(#)radix.c 8.4 (Berkeley) 11/2/94
- * $Id$
- */
-
-/*
- * Routines to build and maintain radix trees for routing lookups.
- */
-#ifndef _RADIX_H_
-#include <sys/param.h>
-#ifdef KERNEL
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#define M_DONTWAIT M_NOWAIT
-#include <sys/domain.h>
-#else
-#include <stdlib.h>
-#endif
-#include <sys/syslog.h>
-#include <net/radix.h>
-#endif
-
-static struct radix_node *
- rn_lookup __P((void *v_arg, void *m_arg,
- struct radix_node_head *head));
-static int rn_walktree_from __P((struct radix_node_head *h, void *a,
- void *m, walktree_f_t *f, void *w));
-static int rn_walktree __P((struct radix_node_head *, walktree_f_t *, void *));
-static struct radix_node
- *rn_delete __P((void *, void *, struct radix_node_head *)),
- *rn_insert __P((void *, struct radix_node_head *, int *,
- struct radix_node [2])),
- *rn_newpair __P((void *, int, struct radix_node[2])),
- *rn_search __P((void *, struct radix_node *)),
- *rn_search_m __P((void *, struct radix_node *, void *));
-
-static int max_keylen;
-static struct radix_mask *rn_mkfreelist;
-static struct radix_node_head *mask_rnhead;
-static char *addmask_key;
-static char normal_chars[] = {0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, -1};
-static char *rn_zeros, *rn_ones;
-
-#define rn_masktop (mask_rnhead->rnh_treetop)
-#undef Bcmp
-#define Bcmp(a, b, l) (l == 0 ? 0 : bcmp((caddr_t)(a), (caddr_t)(b), (u_long)l))
-
-static int rn_lexobetter __P((void *m_arg, void *n_arg));
-static struct radix_mask *
- rn_new_radix_mask __P((struct radix_node *tt,
- struct radix_mask *next));
-static int rn_satsifies_leaf __P((char *trial, struct radix_node *leaf,
- int skip));
-
-/*
- * The data structure for the keys is a radix tree with one way
- * branching removed. The index rn_b at an internal node n represents a bit
- * position to be tested. The tree is arranged so that all descendants
- * of a node n have keys whose bits all agree up to position rn_b - 1.
- * (We say the index of n is rn_b.)
- *
- * There is at least one descendant which has a one bit at position rn_b,
- * and at least one with a zero there.
- *
- * A route is determined by a pair of key and mask. We require that the
- * bit-wise logical and of the key and mask to be the key.
- * We define the index of a route to associated with the mask to be
- * the first bit number in the mask where 0 occurs (with bit number 0
- * representing the highest order bit).
- *
- * We say a mask is normal if every bit is 0, past the index of the mask.
- * If a node n has a descendant (k, m) with index(m) == index(n) == rn_b,
- * and m is a normal mask, then the route applies to every descendant of n.
- * If the index(m) < rn_b, this implies the trailing last few bits of k
- * before bit b are all 0, (and hence consequently true of every descendant
- * of n), so the route applies to all descendants of the node as well.
- *
- * Similar logic shows that a non-normal mask m such that
- * index(m) <= index(n) could potentially apply to many children of n.
- * Thus, for each non-host route, we attach its mask to a list at an internal
- * node as high in the tree as we can go.
- *
- * The present version of the code makes use of normal routes in short-
- * circuiting an explict mask and compare operation when testing whether
- * a key satisfies a normal route, and also in remembering the unique leaf
- * that governs a subtree.
- */
-
-static struct radix_node *
-rn_search(v_arg, head)
- void *v_arg;
- struct radix_node *head;
-{
- register struct radix_node *x;
- register caddr_t v;
-
- for (x = head, v = v_arg; x->rn_b >= 0;) {
- if (x->rn_bmask & v[x->rn_off])
- x = x->rn_r;
- else
- x = x->rn_l;
- }
- return (x);
-};
-
-static struct radix_node *
-rn_search_m(v_arg, head, m_arg)
- struct radix_node *head;
- void *v_arg, *m_arg;
-{
- register struct radix_node *x;
- register caddr_t v = v_arg, m = m_arg;
-
- for (x = head; x->rn_b >= 0;) {
- if ((x->rn_bmask & m[x->rn_off]) &&
- (x->rn_bmask & v[x->rn_off]))
- x = x->rn_r;
- else
- x = x->rn_l;
- }
- return x;
-};
-
-int
-rn_refines(m_arg, n_arg)
- void *m_arg, *n_arg;
-{
- register caddr_t m = m_arg, n = n_arg;
- register caddr_t lim, lim2 = lim = n + *(u_char *)n;
- int longer = (*(u_char *)n++) - (int)(*(u_char *)m++);
- int masks_are_equal = 1;
-
- if (longer > 0)
- lim -= longer;
- while (n < lim) {
- if (*n & ~(*m))
- return 0;
- if (*n++ != *m++)
- masks_are_equal = 0;
- }
- while (n < lim2)
- if (*n++)
- return 0;
- if (masks_are_equal && (longer < 0))
- for (lim2 = m - longer; m < lim2; )
- if (*m++)
- return 1;
- return (!masks_are_equal);
-}
-
-struct radix_node *
-rn_lookup(v_arg, m_arg, head)
- void *v_arg, *m_arg;
- struct radix_node_head *head;
-{
- register struct radix_node *x;
- caddr_t netmask = 0;
-
- if (m_arg) {
- if ((x = rn_addmask(m_arg, 1, head->rnh_treetop->rn_off)) == 0)
- return (0);
- netmask = x->rn_key;
- }
- x = rn_match(v_arg, head);
- if (x && netmask) {
- while (x && x->rn_mask != netmask)
- x = x->rn_dupedkey;
- }
- return x;
-}
-
-static int
-rn_satsifies_leaf(trial, leaf, skip)
- char *trial;
- register struct radix_node *leaf;
- int skip;
-{
- register char *cp = trial, *cp2 = leaf->rn_key, *cp3 = leaf->rn_mask;
- char *cplim;
- int length = min(*(u_char *)cp, *(u_char *)cp2);
-
- if (cp3 == 0)
- cp3 = rn_ones;
- else
- length = min(length, *(u_char *)cp3);
- cplim = cp + length; cp3 += skip; cp2 += skip;
- for (cp += skip; cp < cplim; cp++, cp2++, cp3++)
- if ((*cp ^ *cp2) & *cp3)
- return 0;
- return 1;
-}
-
-struct radix_node *
-rn_match(v_arg, head)
- void *v_arg;
- struct radix_node_head *head;
-{
- caddr_t v = v_arg;
- register struct radix_node *t = head->rnh_treetop, *x;
- register caddr_t cp = v, cp2;
- caddr_t cplim;
- struct radix_node *saved_t, *top = t;
- int off = t->rn_off, vlen = *(u_char *)cp, matched_off;
- register int test, b, rn_b;
-
- /*
- * Open code rn_search(v, top) to avoid overhead of extra
- * subroutine call.
- */
- for (; t->rn_b >= 0; ) {
- if (t->rn_bmask & cp[t->rn_off])
- t = t->rn_r;
- else
- t = t->rn_l;
- }
- /*
- * See if we match exactly as a host destination
- * or at least learn how many bits match, for normal mask finesse.
- *
- * It doesn't hurt us to limit how many bytes to check
- * to the length of the mask, since if it matches we had a genuine
- * match and the leaf we have is the most specific one anyway;
- * if it didn't match with a shorter length it would fail
- * with a long one. This wins big for class B&C netmasks which
- * are probably the most common case...
- */
- if (t->rn_mask)
- vlen = *(u_char *)t->rn_mask;
- cp += off; cp2 = t->rn_key + off; cplim = v + vlen;
- for (; cp < cplim; cp++, cp2++)
- if (*cp != *cp2)
- goto on1;
- /*
- * This extra grot is in case we are explicitly asked
- * to look up the default. Ugh!
- */
- if ((t->rn_flags & RNF_ROOT) && t->rn_dupedkey)
- t = t->rn_dupedkey;
- return t;
-on1:
- test = (*cp ^ *cp2) & 0xff; /* find first bit that differs */
- for (b = 7; (test >>= 1) > 0;)
- b--;
- matched_off = cp - v;
- b += matched_off << 3;
- rn_b = -1 - b;
- /*
- * If there is a host route in a duped-key chain, it will be first.
- */
- if ((saved_t = t)->rn_mask == 0)
- t = t->rn_dupedkey;
- for (; t; t = t->rn_dupedkey)
- /*
- * Even if we don't match exactly as a host,
- * we may match if the leaf we wound up at is
- * a route to a net.
- */
- if (t->rn_flags & RNF_NORMAL) {
- if (rn_b <= t->rn_b)
- return t;
- } else if (rn_satsifies_leaf(v, t, matched_off))
- return t;
- t = saved_t;
- /* start searching up the tree */
- do {
- register struct radix_mask *m;
- t = t->rn_p;
- m = t->rn_mklist;
- if (m) {
- /*
- * If non-contiguous masks ever become important
- * we can restore the masking and open coding of
- * the search and satisfaction test and put the
- * calculation of "off" back before the "do".
- */
- do {
- if (m->rm_flags & RNF_NORMAL) {
- if (rn_b <= m->rm_b)
- return (m->rm_leaf);
- } else {
- off = min(t->rn_off, matched_off);
- x = rn_search_m(v, t, m->rm_mask);
- while (x && x->rn_mask != m->rm_mask)
- x = x->rn_dupedkey;
- if (x && rn_satsifies_leaf(v, x, off))
- return x;
- }
- m = m->rm_mklist;
- } while (m);
- }
- } while (t != top);
- return 0;
-};
-
-#ifdef RN_DEBUG
-int rn_nodenum;
-struct radix_node *rn_clist;
-int rn_saveinfo;
-int rn_debug = 1;
-#endif
-
-static struct radix_node *
-rn_newpair(v, b, nodes)
- void *v;
- int b;
- struct radix_node nodes[2];
-{
- register struct radix_node *tt = nodes, *t = tt + 1;
- t->rn_b = b; t->rn_bmask = 0x80 >> (b & 7);
- t->rn_l = tt; t->rn_off = b >> 3;
- tt->rn_b = -1; tt->rn_key = (caddr_t)v; tt->rn_p = t;
- tt->rn_flags = t->rn_flags = RNF_ACTIVE;
-#ifdef RN_DEBUG
- tt->rn_info = rn_nodenum++; t->rn_info = rn_nodenum++;
- tt->rn_twin = t; tt->rn_ybro = rn_clist; rn_clist = tt;
-#endif
- return t;
-}
-
-static struct radix_node *
-rn_insert(v_arg, head, dupentry, nodes)
- void *v_arg;
- struct radix_node_head *head;
- int *dupentry;
- struct radix_node nodes[2];
-{
- caddr_t v = v_arg;
- struct radix_node *top = head->rnh_treetop;
- int head_off = top->rn_off, vlen = (int)*((u_char *)v);
- register struct radix_node *t = rn_search(v_arg, top);
- register caddr_t cp = v + head_off;
- register int b;
- struct radix_node *tt;
- /*
- * Find first bit at which v and t->rn_key differ
- */
- {
- register caddr_t cp2 = t->rn_key + head_off;
- register int cmp_res;
- caddr_t cplim = v + vlen;
-
- while (cp < cplim)
- if (*cp2++ != *cp++)
- goto on1;
- *dupentry = 1;
- return t;
-on1:
- *dupentry = 0;
- cmp_res = (cp[-1] ^ cp2[-1]) & 0xff;
- for (b = (cp - v) << 3; cmp_res; b--)
- cmp_res >>= 1;
- }
- {
- register struct radix_node *p, *x = top;
- cp = v;
- do {
- p = x;
- if (cp[x->rn_off] & x->rn_bmask)
- x = x->rn_r;
- else x = x->rn_l;
- } while (b > (unsigned) x->rn_b); /* x->rn_b < b && x->rn_b >= 0 */
-#ifdef RN_DEBUG
- if (rn_debug)
- log(LOG_DEBUG, "rn_insert: Going In:\n"), traverse(p);
-#endif
- t = rn_newpair(v_arg, b, nodes); tt = t->rn_l;
- if ((cp[p->rn_off] & p->rn_bmask) == 0)
- p->rn_l = t;
- else
- p->rn_r = t;
- x->rn_p = t; t->rn_p = p; /* frees x, p as temp vars below */
- if ((cp[t->rn_off] & t->rn_bmask) == 0) {
- t->rn_r = x;
- } else {
- t->rn_r = tt; t->rn_l = x;
- }
-#ifdef RN_DEBUG
- if (rn_debug)
- log(LOG_DEBUG, "rn_insert: Coming Out:\n"), traverse(p);
-#endif
- }
- return (tt);
-}
-
-struct radix_node *
-rn_addmask(n_arg, search, skip)
- int search, skip;
- void *n_arg;
-{
- caddr_t netmask = (caddr_t)n_arg;
- register struct radix_node *x;
- register caddr_t cp, cplim;
- register int b = 0, mlen, j;
- int maskduplicated, m0, isnormal;
- struct radix_node *saved_x;
- static int last_zeroed = 0;
-
- if ((mlen = *(u_char *)netmask) > max_keylen)
- mlen = max_keylen;
- if (skip == 0)
- skip = 1;
- if (mlen <= skip)
- return (mask_rnhead->rnh_nodes);
- if (skip > 1)
- Bcopy(rn_ones + 1, addmask_key + 1, skip - 1);
- if ((m0 = mlen) > skip)
- Bcopy(netmask + skip, addmask_key + skip, mlen - skip);
- /*
- * Trim trailing zeroes.
- */
- for (cp = addmask_key + mlen; (cp > addmask_key) && cp[-1] == 0;)
- cp--;
- mlen = cp - addmask_key;
- if (mlen <= skip) {
- if (m0 >= last_zeroed)
- last_zeroed = mlen;
- return (mask_rnhead->rnh_nodes);
- }
- if (m0 < last_zeroed)
- Bzero(addmask_key + m0, last_zeroed - m0);
- *addmask_key = last_zeroed = mlen;
- x = rn_search(addmask_key, rn_masktop);
- if (Bcmp(addmask_key, x->rn_key, mlen) != 0)
- x = 0;
- if (x || search)
- return (x);
- R_Malloc(x, struct radix_node *, max_keylen + 2 * sizeof (*x));
- if ((saved_x = x) == 0)
- return (0);
- Bzero(x, max_keylen + 2 * sizeof (*x));
- netmask = cp = (caddr_t)(x + 2);
- Bcopy(addmask_key, cp, mlen);
- x = rn_insert(cp, mask_rnhead, &maskduplicated, x);
- if (maskduplicated) {
- log(LOG_ERR, "rn_addmask: mask impossibly already in tree");
- Free(saved_x);
- return (x);
- }
- /*
- * Calculate index of mask, and check for normalcy.
- */
- cplim = netmask + mlen; isnormal = 1;
- for (cp = netmask + skip; (cp < cplim) && *(u_char *)cp == 0xff;)
- cp++;
- if (cp != cplim) {
- for (j = 0x80; (j & *cp) != 0; j >>= 1)
- b++;
- if (*cp != normal_chars[b] || cp != (cplim - 1))
- isnormal = 0;
- }
- b += (cp - netmask) << 3;
- x->rn_b = -1 - b;
- if (isnormal)
- x->rn_flags |= RNF_NORMAL;
- return (x);
-}
-
-static int /* XXX: arbitrary ordering for non-contiguous masks */
-rn_lexobetter(m_arg, n_arg)
- void *m_arg, *n_arg;
-{
- register u_char *mp = m_arg, *np = n_arg, *lim;
-
- if (*mp > *np)
- return 1; /* not really, but need to check longer one first */
- if (*mp == *np)
- for (lim = mp + *mp; mp < lim;)
- if (*mp++ > *np++)
- return 1;
- return 0;
-}
-
-static struct radix_mask *
-rn_new_radix_mask(tt, next)
- register struct radix_node *tt;
- register struct radix_mask *next;
-{
- register struct radix_mask *m;
-
- MKGet(m);
- if (m == 0) {
- log(LOG_ERR, "Mask for route not entered\n");
- return (0);
- }
- Bzero(m, sizeof *m);
- m->rm_b = tt->rn_b;
- m->rm_flags = tt->rn_flags;
- if (tt->rn_flags & RNF_NORMAL)
- m->rm_leaf = tt;
- else
- m->rm_mask = tt->rn_mask;
- m->rm_mklist = next;
- tt->rn_mklist = m;
- return m;
-}
-
-struct radix_node *
-rn_addroute(v_arg, n_arg, head, treenodes)
- void *v_arg, *n_arg;
- struct radix_node_head *head;
- struct radix_node treenodes[2];
-{
- caddr_t v = (caddr_t)v_arg, netmask = (caddr_t)n_arg;
- register struct radix_node *t, *x = 0, *tt;
- struct radix_node *saved_tt, *top = head->rnh_treetop;
- short b = 0, b_leaf = 0;
- int keyduplicated;
- caddr_t mmask;
- struct radix_mask *m, **mp;
-
- /*
- * In dealing with non-contiguous masks, there may be
- * many different routes which have the same mask.
- * We will find it useful to have a unique pointer to
- * the mask to speed avoiding duplicate references at
- * nodes and possibly save time in calculating indices.
- */
- if (netmask) {
- if ((x = rn_addmask(netmask, 0, top->rn_off)) == 0)
- return (0);
- b_leaf = x->rn_b;
- b = -1 - x->rn_b;
- netmask = x->rn_key;
- }
- /*
- * Deal with duplicated keys: attach node to previous instance
- */
- saved_tt = tt = rn_insert(v, head, &keyduplicated, treenodes);
- if (keyduplicated) {
- for (t = tt; tt; t = tt, tt = tt->rn_dupedkey) {
- if (tt->rn_mask == netmask)
- return (0);
- if (netmask == 0 ||
- (tt->rn_mask &&
- ((b_leaf < tt->rn_b) || /* index(netmask) > node */
- rn_refines(netmask, tt->rn_mask) ||
- rn_lexobetter(netmask, tt->rn_mask))))
- break;
- }
- /*
- * If the mask is not duplicated, we wouldn't
- * find it among possible duplicate key entries
- * anyway, so the above test doesn't hurt.
- *
- * We sort the masks for a duplicated key the same way as
- * in a masklist -- most specific to least specific.
- * This may require the unfortunate nuisance of relocating
- * the head of the list.
- */
- if (tt == saved_tt) {
- struct radix_node *xx = x;
- /* link in at head of list */
- (tt = treenodes)->rn_dupedkey = t;
- tt->rn_flags = t->rn_flags;
- tt->rn_p = x = t->rn_p;
- t->rn_p = tt; /* parent */
- if (x->rn_l == t) x->rn_l = tt; else x->rn_r = tt;
- saved_tt = tt; x = xx;
- } else {
- (tt = treenodes)->rn_dupedkey = t->rn_dupedkey;
- t->rn_dupedkey = tt;
- tt->rn_p = t; /* parent */
- if (tt->rn_dupedkey) /* parent */
- tt->rn_dupedkey->rn_p = tt; /* parent */
- }
-#ifdef RN_DEBUG
- t=tt+1; tt->rn_info = rn_nodenum++; t->rn_info = rn_nodenum++;
- tt->rn_twin = t; tt->rn_ybro = rn_clist; rn_clist = tt;
-#endif
- tt->rn_key = (caddr_t) v;
- tt->rn_b = -1;
- tt->rn_flags = RNF_ACTIVE;
- }
- /*
- * Put mask in tree.
- */
- if (netmask) {
- tt->rn_mask = netmask;
- tt->rn_b = x->rn_b;
- tt->rn_flags |= x->rn_flags & RNF_NORMAL;
- }
- t = saved_tt->rn_p;
- if (keyduplicated)
- goto on2;
- b_leaf = -1 - t->rn_b;
- if (t->rn_r == saved_tt) x = t->rn_l; else x = t->rn_r;
- /* Promote general routes from below */
- if (x->rn_b < 0) {
- for (mp = &t->rn_mklist; x; x = x->rn_dupedkey)
- if (x->rn_mask && (x->rn_b >= b_leaf) && x->rn_mklist == 0) {
- *mp = m = rn_new_radix_mask(x, 0);
- if (m)
- mp = &m->rm_mklist;
- }
- } else if (x->rn_mklist) {
- /*
- * Skip over masks whose index is > that of new node
- */
- for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist)
- if (m->rm_b >= b_leaf)
- break;
- t->rn_mklist = m; *mp = 0;
- }
-on2:
- /* Add new route to highest possible ancestor's list */
- if ((netmask == 0) || (b > t->rn_b ))
- return tt; /* can't lift at all */
- b_leaf = tt->rn_b;
- do {
- x = t;
- t = t->rn_p;
- } while (b <= t->rn_b && x != top);
- /*
- * Search through routes associated with node to
- * insert new route according to index.
- * Need same criteria as when sorting dupedkeys to avoid
- * double loop on deletion.
- */
- for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist) {
- if (m->rm_b < b_leaf)
- continue;
- if (m->rm_b > b_leaf)
- break;
- if (m->rm_flags & RNF_NORMAL) {
- mmask = m->rm_leaf->rn_mask;
- if (tt->rn_flags & RNF_NORMAL) {
- log(LOG_ERR,
- "Non-unique normal route, mask not entered");
- return tt;
- }
- } else
- mmask = m->rm_mask;
- if (mmask == netmask) {
- m->rm_refs++;
- tt->rn_mklist = m;
- return tt;
- }
- if (rn_refines(netmask, mmask) || rn_lexobetter(netmask, mmask))
- break;
- }
- *mp = rn_new_radix_mask(tt, *mp);
- return tt;
-}
-
-static struct radix_node *
-rn_delete(v_arg, netmask_arg, head)
- void *v_arg, *netmask_arg;
- struct radix_node_head *head;
-{
- register struct radix_node *t, *p, *x, *tt;
- struct radix_mask *m, *saved_m, **mp;
- struct radix_node *dupedkey, *saved_tt, *top;
- caddr_t v, netmask;
- int b, head_off, vlen;
-
- v = v_arg;
- netmask = netmask_arg;
- x = head->rnh_treetop;
- tt = rn_search(v, x);
- head_off = x->rn_off;
- vlen = *(u_char *)v;
- saved_tt = tt;
- top = x;
- if (tt == 0 ||
- Bcmp(v + head_off, tt->rn_key + head_off, vlen - head_off))
- return (0);
- /*
- * Delete our route from mask lists.
- */
- if (netmask) {
- if ((x = rn_addmask(netmask, 1, head_off)) == 0)
- return (0);
- netmask = x->rn_key;
- while (tt->rn_mask != netmask)
- if ((tt = tt->rn_dupedkey) == 0)
- return (0);
- }
- if (tt->rn_mask == 0 || (saved_m = m = tt->rn_mklist) == 0)
- goto on1;
- if (tt->rn_flags & RNF_NORMAL) {
- if (m->rm_leaf != tt || m->rm_refs > 0) {
- log(LOG_ERR, "rn_delete: inconsistent annotation\n");
- return 0; /* dangling ref could cause disaster */
- }
- } else {
- if (m->rm_mask != tt->rn_mask) {
- log(LOG_ERR, "rn_delete: inconsistent annotation\n");
- goto on1;
- }
- if (--m->rm_refs >= 0)
- goto on1;
- }
- b = -1 - tt->rn_b;
- t = saved_tt->rn_p;
- if (b > t->rn_b)
- goto on1; /* Wasn't lifted at all */
- do {
- x = t;
- t = t->rn_p;
- } while (b <= t->rn_b && x != top);
- for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist)
- if (m == saved_m) {
- *mp = m->rm_mklist;
- MKFree(m);
- break;
- }
- if (m == 0) {
- log(LOG_ERR, "rn_delete: couldn't find our annotation\n");
- if (tt->rn_flags & RNF_NORMAL)
- return (0); /* Dangling ref to us */
- }
-on1:
- /*
- * Eliminate us from tree
- */
- if (tt->rn_flags & RNF_ROOT)
- return (0);
-#ifdef RN_DEBUG
- /* Get us out of the creation list */
- for (t = rn_clist; t && t->rn_ybro != tt; t = t->rn_ybro) {}
- if (t) t->rn_ybro = tt->rn_ybro;
-#endif
- t = tt->rn_p;
- dupedkey = saved_tt->rn_dupedkey;
- if (dupedkey) {
- /*
- * at this point, tt is the deletion target and saved_tt
- * is the head of the dupekey chain
- */
- if (tt == saved_tt) {
- /* remove from head of chain */
- x = dupedkey; x->rn_p = t;
- if (t->rn_l == tt) t->rn_l = x; else t->rn_r = x;
- } else {
- /* find node in front of tt on the chain */
- for (x = p = saved_tt; p && p->rn_dupedkey != tt;)
- p = p->rn_dupedkey;
- if (p) {
- p->rn_dupedkey = tt->rn_dupedkey;
- if (tt->rn_dupedkey) /* parent */
- tt->rn_dupedkey->rn_p = p; /* parent */
- } else log(LOG_ERR, "rn_delete: couldn't find us\n");
- }
- t = tt + 1;
- if (t->rn_flags & RNF_ACTIVE) {
-#ifndef RN_DEBUG
- *++x = *t; p = t->rn_p;
-#else
- b = t->rn_info; *++x = *t; t->rn_info = b; p = t->rn_p;
-#endif
- if (p->rn_l == t) p->rn_l = x; else p->rn_r = x;
- x->rn_l->rn_p = x; x->rn_r->rn_p = x;
- }
- goto out;
- }
- if (t->rn_l == tt) x = t->rn_r; else x = t->rn_l;
- p = t->rn_p;
- if (p->rn_r == t) p->rn_r = x; else p->rn_l = x;
- x->rn_p = p;
- /*
- * Demote routes attached to us.
- */
- if (t->rn_mklist) {
- if (x->rn_b >= 0) {
- for (mp = &x->rn_mklist; (m = *mp);)
- mp = &m->rm_mklist;
- *mp = t->rn_mklist;
- } else {
- /* If there are any key,mask pairs in a sibling
- duped-key chain, some subset will appear sorted
- in the same order attached to our mklist */
- for (m = t->rn_mklist; m && x; x = x->rn_dupedkey)
- if (m == x->rn_mklist) {
- struct radix_mask *mm = m->rm_mklist;
- x->rn_mklist = 0;
- if (--(m->rm_refs) < 0)
- MKFree(m);
- m = mm;
- }
- if (m)
- log(LOG_ERR, "%s %p at %x\n",
- "rn_delete: Orphaned Mask", m, x);
- }
- }
- /*
- * We may be holding an active internal node in the tree.
- */
- x = tt + 1;
- if (t != x) {
-#ifndef RN_DEBUG
- *t = *x;
-#else
- b = t->rn_info; *t = *x; t->rn_info = b;
-#endif
- t->rn_l->rn_p = t; t->rn_r->rn_p = t;
- p = x->rn_p;
- if (p->rn_l == x) p->rn_l = t; else p->rn_r = t;
- }
-out:
- tt->rn_flags &= ~RNF_ACTIVE;
- tt[1].rn_flags &= ~RNF_ACTIVE;
- return (tt);
-}
-
-/*
- * This is the same as rn_walktree() except for the parameters and the
- * exit.
- */
-static int
-rn_walktree_from(h, a, m, f, w)
- struct radix_node_head *h;
- void *a, *m;
- walktree_f_t *f;
- void *w;
-{
- int error;
- struct radix_node *base, *next;
- u_char *xa = (u_char *)a;
- u_char *xm = (u_char *)m;
- register struct radix_node *rn, *last = 0 /* shut up gcc */;
- int stopping = 0;
- int lastb;
-
- /*
- * rn_search_m is sort-of-open-coded here.
- */
- /* printf("about to search\n"); */
- for (rn = h->rnh_treetop; rn->rn_b >= 0; ) {
- last = rn;
- /* printf("rn_b %d, rn_bmask %x, xm[rn_off] %x\n",
- rn->rn_b, rn->rn_bmask, xm[rn->rn_off]); */
- if (!(rn->rn_bmask & xm[rn->rn_off])) {
- break;
- }
- if (rn->rn_bmask & xa[rn->rn_off]) {
- rn = rn->rn_r;
- } else {
- rn = rn->rn_l;
- }
- }
- /* printf("done searching\n"); */
-
- /*
- * Two cases: either we stepped off the end of our mask,
- * in which case last == rn, or we reached a leaf, in which
- * case we want to start from the last node we looked at.
- * Either way, last is the node we want to start from.
- */
- rn = last;
- lastb = rn->rn_b;
-
- /* printf("rn %p, lastb %d\n", rn, lastb);*/
-
- /*
- * This gets complicated because we may delete the node
- * while applying the function f to it, so we need to calculate
- * the successor node in advance.
- */
- while (rn->rn_b >= 0)
- rn = rn->rn_l;
-
- while (!stopping) {
- /* printf("node %p (%d)\n", rn, rn->rn_b); */
- base = rn;
- /* If at right child go back up, otherwise, go right */
- while (rn->rn_p->rn_r == rn && !(rn->rn_flags & RNF_ROOT)) {
- rn = rn->rn_p;
-
- /* if went up beyond last, stop */
- if (rn->rn_b < lastb) {
- stopping = 1;
- /* printf("up too far\n"); */
- }
- }
-
- /* Find the next *leaf* since next node might vanish, too */
- for (rn = rn->rn_p->rn_r; rn->rn_b >= 0;)
- rn = rn->rn_l;
- next = rn;
- /* Process leaves */
- while ((rn = base) != 0) {
- base = rn->rn_dupedkey;
- /* printf("leaf %p\n", rn); */
- if (!(rn->rn_flags & RNF_ROOT)
- && (error = (*f)(rn, w)))
- return (error);
- }
- rn = next;
-
- if (rn->rn_flags & RNF_ROOT) {
- /* printf("root, stopping"); */
- stopping = 1;
- }
-
- }
- return 0;
-}
-
-static int
-rn_walktree(h, f, w)
- struct radix_node_head *h;
- walktree_f_t *f;
- void *w;
-{
- int error;
- struct radix_node *base, *next;
- register struct radix_node *rn = h->rnh_treetop;
- /*
- * This gets complicated because we may delete the node
- * while applying the function f to it, so we need to calculate
- * the successor node in advance.
- */
- /* First time through node, go left */
- while (rn->rn_b >= 0)
- rn = rn->rn_l;
- for (;;) {
- base = rn;
- /* If at right child go back up, otherwise, go right */
- while (rn->rn_p->rn_r == rn && (rn->rn_flags & RNF_ROOT) == 0)
- rn = rn->rn_p;
- /* Find the next *leaf* since next node might vanish, too */
- for (rn = rn->rn_p->rn_r; rn->rn_b >= 0;)
- rn = rn->rn_l;
- next = rn;
- /* Process leaves */
- while ((rn = base)) {
- base = rn->rn_dupedkey;
- if (!(rn->rn_flags & RNF_ROOT) && (error = (*f)(rn, w)))
- return (error);
- }
- rn = next;
- if (rn->rn_flags & RNF_ROOT)
- return (0);
- }
- /* NOTREACHED */
-}
-
-int
-rn_inithead(head, off)
- void **head;
- int off;
-{
- register struct radix_node_head *rnh;
- register struct radix_node *t, *tt, *ttt;
- if (*head)
- return (1);
- R_Malloc(rnh, struct radix_node_head *, sizeof (*rnh));
- if (rnh == 0)
- return (0);
- Bzero(rnh, sizeof (*rnh));
- *head = rnh;
- t = rn_newpair(rn_zeros, off, rnh->rnh_nodes);
- ttt = rnh->rnh_nodes + 2;
- t->rn_r = ttt;
- t->rn_p = t;
- tt = t->rn_l;
- tt->rn_flags = t->rn_flags = RNF_ROOT | RNF_ACTIVE;
- tt->rn_b = -1 - off;
- *ttt = *tt;
- ttt->rn_key = rn_ones;
- rnh->rnh_addaddr = rn_addroute;
- rnh->rnh_deladdr = rn_delete;
- rnh->rnh_matchaddr = rn_match;
- rnh->rnh_lookup = rn_lookup;
- rnh->rnh_walktree = rn_walktree;
- rnh->rnh_walktree_from = rn_walktree_from;
- rnh->rnh_treetop = t;
- return (1);
-}
-
-void
-rn_init()
-{
- char *cp, *cplim;
-#ifdef KERNEL
- struct domain *dom;
-
- for (dom = domains; dom; dom = dom->dom_next)
- if (dom->dom_maxrtkey > max_keylen)
- max_keylen = dom->dom_maxrtkey;
-#endif
- if (max_keylen == 0) {
- log(LOG_ERR,
- "rn_init: radix functions require max_keylen be set\n");
- return;
- }
- R_Malloc(rn_zeros, char *, 3 * max_keylen);
- if (rn_zeros == NULL)
- panic("rn_init");
- Bzero(rn_zeros, 3 * max_keylen);
- rn_ones = cp = rn_zeros + max_keylen;
- addmask_key = cplim = rn_ones + max_keylen;
- while (cp < cplim)
- *cp++ = -1;
- if (rn_inithead((void **)&mask_rnhead, 0) == 0)
- panic("rn_init 2");
-}
diff --git a/cpukit/libnetworking/net/radix.h b/cpukit/libnetworking/net/radix.h
deleted file mode 100644
index 6ef9aafbac..0000000000
--- a/cpukit/libnetworking/net/radix.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 1988, 1989, 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.
- *
- * @(#)radix.h 8.2 (Berkeley) 10/31/94
- * $Id$
- */
-
-#ifndef _RADIX_H_
-#define _RADIX_H_
-
-/*
- * Radix search tree node layout.
- */
-
-struct radix_node {
- struct radix_mask *rn_mklist; /* list of masks contained in subtree */
- struct radix_node *rn_p; /* parent */
- short rn_b; /* bit offset; -1-index(netmask) */
- char rn_bmask; /* node: mask for bit test*/
- u_char rn_flags; /* enumerated next */
-#define RNF_NORMAL 1 /* leaf contains normal route */
-#define RNF_ROOT 2 /* leaf is root leaf for tree */
-#define RNF_ACTIVE 4 /* This node is alive (for rtfree) */
- union {
- struct { /* leaf only data: */
- caddr_t rn_Key; /* object of search */
- caddr_t rn_Mask; /* netmask, if present */
- struct radix_node *rn_Dupedkey;
- } rn_leaf;
- struct { /* node only data: */
- int rn_Off; /* where to start compare */
- struct radix_node *rn_L;/* progeny */
- struct radix_node *rn_R;/* progeny */
- } rn_node;
- } rn_u;
-#ifdef RN_DEBUG
- int rn_info;
- struct radix_node *rn_twin;
- struct radix_node *rn_ybro;
-#endif
-};
-
-#define rn_dupedkey rn_u.rn_leaf.rn_Dupedkey
-#define rn_key rn_u.rn_leaf.rn_Key
-#define rn_mask rn_u.rn_leaf.rn_Mask
-#define rn_off rn_u.rn_node.rn_Off
-#define rn_l rn_u.rn_node.rn_L
-#define rn_r rn_u.rn_node.rn_R
-
-/*
- * Annotations to tree concerning potential routes applying to subtrees.
- */
-
-extern struct radix_mask {
- short rm_b; /* bit offset; -1-index(netmask) */
- char rm_unused; /* cf. rn_bmask */
- u_char rm_flags; /* cf. rn_flags */
- struct radix_mask *rm_mklist; /* more masks to try */
- union {
- caddr_t rmu_mask; /* the mask */
- struct radix_node *rmu_leaf; /* for normal routes */
- } rm_rmu;
- int rm_refs; /* # of references to this struct */
-} *rn_mkfreelist;
-
-#define rm_mask rm_rmu.rmu_mask
-#define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */
-
-#define MKGet(m) {\
- if (rn_mkfreelist) {\
- m = rn_mkfreelist; \
- rn_mkfreelist = (m)->rm_mklist; \
- } else \
- R_Malloc(m, struct radix_mask *, sizeof (*(m))); }\
-
-#define MKFree(m) { (m)->rm_mklist = rn_mkfreelist; rn_mkfreelist = (m);}
-
-typedef int walktree_f_t __P((struct radix_node *, void *));
-
-struct radix_node_head {
- struct radix_node *rnh_treetop;
- int rnh_addrsize; /* permit, but not require fixed keys */
- int rnh_pktsize; /* permit, but not require fixed keys */
- struct radix_node *(*rnh_addaddr) /* add based on sockaddr */
- __P((void *v, void *mask,
- struct radix_node_head *head, struct radix_node nodes[]));
- struct radix_node *(*rnh_addpkt) /* add based on packet hdr */
- __P((void *v, void *mask,
- struct radix_node_head *head, struct radix_node nodes[]));
- struct radix_node *(*rnh_deladdr) /* remove based on sockaddr */
- __P((void *v, void *mask, struct radix_node_head *head));
- struct radix_node *(*rnh_delpkt) /* remove based on packet hdr */
- __P((void *v, void *mask, struct radix_node_head *head));
- struct radix_node *(*rnh_matchaddr) /* locate based on sockaddr */
- __P((void *v, struct radix_node_head *head));
- struct radix_node *(*rnh_lookup) /* locate based on sockaddr */
- __P((void *v, void *mask, struct radix_node_head *head));
- struct radix_node *(*rnh_matchpkt) /* locate based on packet hdr */
- __P((void *v, struct radix_node_head *head));
- int (*rnh_walktree) /* traverse tree */
- __P((struct radix_node_head *head, walktree_f_t *f, void *w));
- int (*rnh_walktree_from) /* traverse tree below a */
- __P((struct radix_node_head *head, void *a, void *m,
- walktree_f_t *f, void *w));
- void (*rnh_close) /* do something when the last ref drops */
- __P((struct radix_node *rn, struct radix_node_head *head));
- struct radix_node rnh_nodes[3]; /* empty tree for common case */
-};
-
-#ifndef KERNEL
-#define Bcmp(a, b, n) bcmp(((char *)(a)), ((char *)(b)), (n))
-#define Bcopy(a, b, n) bcopy(((char *)(a)), ((char *)(b)), (unsigned)(n))
-#define Bzero(p, n) bzero((char *)(p), (int)(n));
-#define R_Malloc(p, t, n) (p = (t) malloc((unsigned int)(n)))
-#define Free(p) free((char *)p);
-#else
-#define Bcmp(a, b, n) bcmp(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n))
-#define Bcopy(a, b, n) bcopy(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n))
-#define Bzero(p, n) bzero((caddr_t)(p), (unsigned)(n));
-#define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_DONTWAIT))
-#define Free(p) free((caddr_t)p, M_RTABLE);
-#endif /*KERNEL*/
-
-extern struct radix_node_head *mask_rnhead;
-
-void rn_init __P((void));
-int rn_inithead __P((void **, int));
-int rn_refines __P((void *, void *));
-struct radix_node
- *rn_addmask __P((void *, int, int)),
- *rn_addroute __P((void *, void *, struct radix_node_head *,
- struct radix_node [2])),
- *rn_match __P((void *, struct radix_node_head *));
-
-
-#endif /* _RADIX_H_ */
diff --git a/cpukit/libnetworking/net/raw_cb.c b/cpukit/libnetworking/net/raw_cb.c
deleted file mode 100644
index 0676931cdc..0000000000
--- a/cpukit/libnetworking/net/raw_cb.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)raw_cb.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/raw_cb.h>
-#include <netinet/in.h>
-
-/*
- * Routines to manage the raw protocol control blocks.
- *
- * TODO:
- * hash lookups by protocol family/protocol + address family
- * take care of unique address problems per AF?
- * redo address binding to allow wildcards
- */
-
-struct rawcb rawcb;
-static u_long raw_sendspace = RAWSNDQ;
-static u_long raw_recvspace = RAWRCVQ;
-
-/*
- * Allocate a control block and a nominal amount
- * of buffer space for the socket.
- */
-int
-raw_attach(so, proto)
- register struct socket *so;
- int proto;
-{
- register struct rawcb *rp = sotorawcb(so);
- int error;
-
- /*
- * It is assumed that raw_attach is called
- * after space has been allocated for the
- * rawcb.
- */
- if (rp == 0)
- return (ENOBUFS);
- error = soreserve(so, raw_sendspace, raw_recvspace);
- if (error)
- return (error);
- rp->rcb_socket = so;
- rp->rcb_proto.sp_family = so->so_proto->pr_domain->dom_family;
- rp->rcb_proto.sp_protocol = proto;
- insque(rp, &rawcb);
- return (0);
-}
-
-/*
- * Detach the raw connection block and discard
- * socket resources.
- */
-void
-raw_detach(rp)
- register struct rawcb *rp;
-{
- struct socket *so = rp->rcb_socket;
-
- so->so_pcb = 0;
- sofree(so);
- remque(rp);
-#ifdef notdef
- if (rp->rcb_laddr)
- m_freem(dtom(rp->rcb_laddr));
- rp->rcb_laddr = 0;
-#endif
- free((caddr_t)(rp), M_PCB);
-}
-
-/*
- * Disconnect and possibly release resources.
- */
-void
-raw_disconnect(rp)
- struct rawcb *rp;
-{
-
-#ifdef notdef
- if (rp->rcb_faddr)
- m_freem(dtom(rp->rcb_faddr));
- rp->rcb_faddr = 0;
-#endif
- if (rp->rcb_socket->so_state & SS_NOFDREF)
- raw_detach(rp);
-}
-
-#ifdef notdef
-int
-raw_bind(so, nam)
- register struct socket *so;
- struct mbuf *nam;
-{
- struct sockaddr *addr = mtod(nam, struct sockaddr *);
- register struct rawcb *rp;
-
- if (ifnet == 0)
- return (EADDRNOTAVAIL);
- rp = sotorawcb(so);
- nam = m_copym(nam, 0, M_COPYALL, M_WAITOK);
- rp->rcb_laddr = mtod(nam, struct sockaddr *);
- return (0);
-}
-#endif
diff --git a/cpukit/libnetworking/net/raw_cb.h b/cpukit/libnetworking/net/raw_cb.h
deleted file mode 100644
index c1ed5e5e0a..0000000000
--- a/cpukit/libnetworking/net/raw_cb.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)raw_cb.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NET_RAW_CB_H_
-#define _NET_RAW_CB_H_
-
-/*
- * Raw protocol interface control block. Used
- * to tie a socket to the generic raw interface.
- */
-struct rawcb {
- struct rawcb *rcb_next; /* doubly linked list */
- struct rawcb *rcb_prev;
- struct socket *rcb_socket; /* back pointer to socket */
- struct sockaddr *rcb_faddr; /* destination address */
- struct sockaddr *rcb_laddr; /* socket's address */
- struct sockproto rcb_proto; /* protocol family, protocol */
-};
-
-#define sotorawcb(so) ((struct rawcb *)(so)->so_pcb)
-
-/*
- * Nominal space allocated to a raw socket.
- */
-#define RAWSNDQ 8192
-#define RAWRCVQ 8192
-
-#ifdef KERNEL
-extern struct rawcb rawcb; /* head of list */
-
-int raw_attach __P((struct socket *, int));
-void raw_ctlinput __P((int, struct sockaddr *, void *));
-void raw_detach __P((struct rawcb *));
-void raw_disconnect __P((struct rawcb *));
-void raw_init __P((void));
-void raw_input __P((struct mbuf *,
- struct sockproto *, struct sockaddr *, struct sockaddr *));
-int raw_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/net/raw_usrreq.c b/cpukit/libnetworking/net/raw_usrreq.c
deleted file mode 100644
index fb4faf4d6d..0000000000
--- a/cpukit/libnetworking/net/raw_usrreq.c
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)raw_usrreq.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/netisr.h>
-#include <net/raw_cb.h>
-
-/*
- * Initialize raw connection block q.
- */
-void
-raw_init()
-{
-
- rawcb.rcb_next = rawcb.rcb_prev = &rawcb;
-}
-
-
-/*
- * Raw protocol input routine. Find the socket
- * associated with the packet(s) and move them over. If
- * nothing exists for this packet, drop it.
- */
-/*
- * Raw protocol interface.
- */
-void
-raw_input(m0, proto, src, dst)
- struct mbuf *m0;
- register struct sockproto *proto;
- struct sockaddr *src, *dst;
-{
- register struct rawcb *rp;
- register struct mbuf *m = m0;
- register int sockets = 0;
- struct socket *last;
-
- last = 0;
- for (rp = rawcb.rcb_next; rp != &rawcb; rp = rp->rcb_next) {
- if (rp->rcb_proto.sp_family != proto->sp_family)
- continue;
- if (rp->rcb_proto.sp_protocol &&
- rp->rcb_proto.sp_protocol != proto->sp_protocol)
- continue;
- /*
- * We assume the lower level routines have
- * placed the address in a canonical format
- * suitable for a structure comparison.
- *
- * Note that if the lengths are not the same
- * the comparison will fail at the first byte.
- */
-#define equal(a1, a2) \
- (bcmp((caddr_t)(a1), (caddr_t)(a2), a1->sa_len) == 0)
- if (rp->rcb_laddr && !equal(rp->rcb_laddr, dst))
- continue;
- if (rp->rcb_faddr && !equal(rp->rcb_faddr, src))
- continue;
- if (last) {
- struct mbuf *n;
- n = m_copy(m, 0, (int)M_COPYALL);
- if (n) {
- if (sbappendaddr(&last->so_rcv, src,
- n, (struct mbuf *)0) == 0)
- /* should notify about lost packet */
- m_freem(n);
- else {
- sorwakeup(last);
- sockets++;
- }
- }
- }
- last = rp->rcb_socket;
- }
- if (last) {
- if (sbappendaddr(&last->so_rcv, src,
- m, (struct mbuf *)0) == 0)
- m_freem(m);
- else {
- sorwakeup(last);
- sockets++;
- }
- } else
- m_freem(m);
-}
-
-/*ARGSUSED*/
-void
-raw_ctlinput(cmd, arg, dummy)
- int cmd;
- struct sockaddr *arg;
- void *dummy;
-{
-
- if (cmd < 0 || cmd > PRC_NCMDS)
- return;
- /* INCOMPLETE */
-}
-
-/*ARGSUSED*/
-int
-raw_usrreq(so, req, m, nam, control)
- struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register struct rawcb *rp = sotorawcb(so);
- register int error = 0;
- int len;
-
- if (req == PRU_CONTROL)
- return (EOPNOTSUPP);
- if (control && control->m_len) {
- error = EOPNOTSUPP;
- goto release;
- }
- if (rp == 0) {
- error = EINVAL;
- goto release;
- }
- switch (req) {
-
- /*
- * Allocate a raw control block and fill in the
- * necessary info to allow packets to be routed to
- * the appropriate raw interface routine.
- */
- case PRU_ATTACH:
- if ((so->so_state & SS_PRIV) == 0) {
- error = EACCES;
- break;
- }
- error = raw_attach(so, (int)nam);
- break;
-
- /*
- * Destroy state just before socket deallocation.
- * Flush data or not depending on the options.
- */
- case PRU_DETACH:
- if (rp == 0) {
- error = ENOTCONN;
- break;
- }
- raw_detach(rp);
- break;
-
- /*
- * If a socket isn't bound to a single address,
- * the raw input routine will hand it anything
- * within that protocol family (assuming there's
- * nothing else around it should go to).
- */
- case PRU_CONNECT:
- error = EINVAL;
-#if 0
- if (rp->rcb_faddr) {
- error = EISCONN;
- break;
- }
- nam = m_copym(nam, 0, M_COPYALL, M_WAIT);
- rp->rcb_faddr = mtod(nam, struct sockaddr *);
- soisconnected(so);
-#endif
- break;
-
- case PRU_BIND:
- error = EINVAL;
-#if 0
- if (rp->rcb_laddr) {
- error = EINVAL; /* XXX */
- break;
- }
- error = raw_bind(so, nam);
-#endif
- break;
-
- case PRU_CONNECT2:
- error = EOPNOTSUPP;
- goto release;
-
- case PRU_DISCONNECT:
- if (rp->rcb_faddr == 0) {
- error = ENOTCONN;
- break;
- }
- raw_disconnect(rp);
- soisdisconnected(so);
- break;
-
- /*
- * Mark the connection as being incapable of further input.
- */
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- /*
- * Ship a packet out. The appropriate raw output
- * routine handles any massaging necessary.
- */
- case PRU_SEND:
- if (nam) {
- if (rp->rcb_faddr) {
- error = EISCONN;
- break;
- }
- rp->rcb_faddr = mtod(nam, struct sockaddr *);
- } else if (rp->rcb_faddr == 0) {
- error = ENOTCONN;
- break;
- }
- error = (*so->so_proto->pr_output)(m, so);
- m = NULL;
- if (nam)
- rp->rcb_faddr = 0;
- break;
-
- case PRU_ABORT:
- raw_disconnect(rp);
- sofree(so);
- soisdisconnected(so);
- break;
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- /*
- * Not supported.
- */
- case PRU_RCVOOB:
- case PRU_RCVD:
- return(EOPNOTSUPP);
-
- case PRU_LISTEN:
- case PRU_ACCEPT:
- case PRU_SENDOOB:
- error = EOPNOTSUPP;
- break;
-
- case PRU_SOCKADDR:
- if (rp->rcb_laddr == 0) {
- error = EINVAL;
- break;
- }
- len = rp->rcb_laddr->sa_len;
- bcopy((caddr_t)rp->rcb_laddr, mtod(nam, caddr_t), (unsigned)len);
- nam->m_len = len;
- break;
-
- case PRU_PEERADDR:
- if (rp->rcb_faddr == 0) {
- error = ENOTCONN;
- break;
- }
- len = rp->rcb_faddr->sa_len;
- bcopy((caddr_t)rp->rcb_faddr, mtod(nam, caddr_t), (unsigned)len);
- nam->m_len = len;
- break;
-
- default:
- panic("raw_usrreq");
- }
-release:
- if (m != NULL)
- m_freem(m);
- return (error);
-}
diff --git a/cpukit/libnetworking/net/route.c b/cpukit/libnetworking/net/route.c
deleted file mode 100644
index 683ddafee9..0000000000
--- a/cpukit/libnetworking/net/route.c
+++ /dev/null
@@ -1,959 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 1991, 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.
- *
- * @(#)route.c 8.2 (Berkeley) 11/15/93
- * $Id$
- */
-
-#include "opt_mrouting.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/ioctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/raw_cb.h>
-
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_mroute.h>
-
-#define SA(p) ((struct sockaddr *)(p))
-
-struct route_cb route_cb;
-static struct rtstat rtstat;
-struct radix_node_head *rt_tables[AF_MAX+1];
-
-static int rttrash; /* routes not in table but not freed */
-
-static void rt_maskedcopy __P((struct sockaddr *,
- struct sockaddr *, struct sockaddr *));
-static void rtable_init __P((void **));
-
-static void
-rtable_init(table)
- void **table;
-{
- struct domain *dom;
- for (dom = domains; dom; dom = dom->dom_next)
- if (dom->dom_rtattach)
- dom->dom_rtattach(&table[dom->dom_family],
- dom->dom_rtoffset);
-}
-
-void
-route_init()
-{
- rn_init(); /* initialize all zeroes, all ones, mask table */
- rtable_init((void **)rt_tables);
-}
-
-/*
- * Packet routing routines.
- */
-void
-rtalloc(ro)
- register struct route *ro;
-{
- if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP))
- return; /* XXX */
- ro->ro_rt = rtalloc1(&ro->ro_dst, 1, 0UL);
-}
-
-void
-rtalloc_ign(ro, ignore)
- register struct route *ro;
- u_long ignore;
-{
- if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP))
- return; /* XXX */
- ro->ro_rt = rtalloc1(&ro->ro_dst, 1, ignore);
-}
-
-/*
- * Look up the route that matches the address given
- * Or, at least try.. Create a cloned route if needed.
- */
-struct rtentry *
-rtalloc1(dst, report, ignflags)
- register struct sockaddr *dst;
- int report;
- u_long ignflags;
-{
- register struct radix_node_head *rnh = rt_tables[dst->sa_family];
- register struct rtentry *rt;
- register struct radix_node *rn;
- struct rtentry *newrt = 0;
- struct rt_addrinfo info;
- u_long nflags;
- int s = splnet(), err = 0, msgtype = RTM_MISS;
-
- /*
- * Look up the address in the table for that Address Family
- */
- if (rnh && (rn = rnh->rnh_matchaddr((caddr_t)dst, rnh)) &&
- ((rn->rn_flags & RNF_ROOT) == 0)) {
- /*
- * If we find it and it's not the root node, then
- * get a refernce on the rtentry associated.
- */
- newrt = rt = (struct rtentry *)rn;
- nflags = rt->rt_flags & ~ignflags;
- if (report && (nflags & (RTF_CLONING | RTF_PRCLONING))) {
- /*
- * We are apparently adding (report = 0 in delete).
- * If it requires that it be cloned, do so.
- * (This implies it wasn't a HOST route.)
- */
- err = rtrequest(RTM_RESOLVE, dst, SA(0),
- SA(0), 0, &newrt);
- if (err) {
- /*
- * If the cloning didn't succeed, maybe
- * what we have will do. Return that.
- */
- newrt = rt;
- rt->rt_refcnt++;
- goto miss;
- }
- if ((rt = newrt) && (rt->rt_flags & RTF_XRESOLVE)) {
- /*
- * If the new route specifies it be
- * externally resolved, then go do that.
- */
- msgtype = RTM_RESOLVE;
- goto miss;
- }
- } else
- rt->rt_refcnt++;
- } else {
- /*
- * Either we hit the root or couldn't find any match,
- * Which basically means
- * "caint get there frm here"
- */
- rtstat.rts_unreach++;
- miss: if (report) {
- /*
- * If required, report the failure to the supervising
- * Authorities.
- * For a delete, this is not an error. (report == 0)
- */
- bzero((caddr_t)&info, sizeof(info));
- info.rti_info[RTAX_DST] = dst;
- rt_missmsg(msgtype, &info, 0, err);
- }
- }
- splx(s);
- return (newrt);
-}
-
-void
-rtfree(rt)
- register struct rtentry *rt;
-{
- register struct radix_node_head *rnh =
- rt_tables[rt_key(rt)->sa_family];
- register struct ifaddr *ifa;
-
- if (rt == 0 || rnh == 0)
- panic("rtfree");
- rt->rt_refcnt--;
- if(rnh->rnh_close && rt->rt_refcnt == 0) {
- rnh->rnh_close((struct radix_node *)rt, rnh);
- }
- if (rt->rt_refcnt <= 0 && (rt->rt_flags & RTF_UP) == 0) {
- if (rt->rt_nodes->rn_flags & (RNF_ACTIVE | RNF_ROOT))
- panic ("rtfree 2");
- rttrash--;
- if (rt->rt_refcnt < 0) {
- printf("rtfree: %p not freed (neg refs)\n", rt);
- return;
- }
- ifa = rt->rt_ifa;
- IFAFREE(ifa);
- if (rt->rt_parent) {
- RTFREE(rt->rt_parent);
- }
- Free(rt_key(rt));
- Free(rt);
- }
-}
-
-void
-ifafree(ifa)
- register struct ifaddr *ifa;
-{
- if (ifa == NULL)
- panic("ifafree");
- if (ifa->ifa_refcnt == 0)
- free(ifa, M_IFADDR);
- else
- ifa->ifa_refcnt--;
-}
-
-/*
- * Force a routing table entry to the specified
- * destination to go through the given gateway.
- * Normally called as a result of a routing redirect
- * message from the network layer.
- *
- * N.B.: must be called at splnet
- *
- */
-void
-rtredirect(dst, gateway, netmask, flags, src, rtp)
- struct sockaddr *dst, *gateway, *netmask, *src;
- int flags;
- struct rtentry **rtp;
-{
- register struct rtentry *rt;
- int error = 0;
- short *stat = 0;
- struct rt_addrinfo info;
- struct ifaddr *ifa;
-
- /* verify the gateway is directly reachable */
- if ((ifa = ifa_ifwithnet(gateway)) == 0) {
- error = ENETUNREACH;
- goto out;
- }
- rt = rtalloc1(dst, 0, 0UL);
- /*
- * If the redirect isn't from our current router for this dst,
- * it's either old or wrong. If it redirects us to ourselves,
- * we have a routing loop, perhaps as a result of an interface
- * going down recently.
- */
-#define equal(a1, a2) (bcmp((caddr_t)(a1), (caddr_t)(a2), (a1)->sa_len) == 0)
- if (!(flags & RTF_DONE) && rt &&
- (!equal(src, rt->rt_gateway) || rt->rt_ifa != ifa))
- error = EINVAL;
- else if (ifa_ifwithaddr(gateway))
- error = EHOSTUNREACH;
- if (error)
- goto done;
- /*
- * Create a new entry if we just got back a wildcard entry
- * or the the lookup failed. This is necessary for hosts
- * which use routing redirects generated by smart gateways
- * to dynamically build the routing tables.
- */
- if ((rt == 0) || (rt_mask(rt) && rt_mask(rt)->sa_len < 2))
- goto create;
- /*
- * Don't listen to the redirect if it's
- * for a route to an interface.
- */
- if (rt->rt_flags & RTF_GATEWAY) {
- if (((rt->rt_flags & RTF_HOST) == 0) && (flags & RTF_HOST)) {
- /*
- * Changing from route to net => route to host.
- * Create new route, rather than smashing route to net.
- */
- create:
- flags |= RTF_GATEWAY | RTF_DYNAMIC;
- error = rtrequest((int)RTM_ADD, dst, gateway,
- netmask, flags,
- (struct rtentry **)0);
- stat = &rtstat.rts_dynamic;
- } else {
- /*
- * Smash the current notion of the gateway to
- * this destination. Should check about netmask!!!
- */
- rt->rt_flags |= RTF_MODIFIED;
- flags |= RTF_MODIFIED;
- stat = &rtstat.rts_newgateway;
- rt_setgate(rt, rt_key(rt), gateway);
- }
- } else
- error = EHOSTUNREACH;
-done:
- if (rt) {
- if (rtp && !error)
- *rtp = rt;
- else
- rtfree(rt);
- }
-out:
- if (error)
- rtstat.rts_badredirect++;
- else if (stat != NULL)
- (*stat)++;
- bzero((caddr_t)&info, sizeof(info));
- info.rti_info[RTAX_DST] = dst;
- info.rti_info[RTAX_GATEWAY] = gateway;
- info.rti_info[RTAX_NETMASK] = netmask;
- info.rti_info[RTAX_AUTHOR] = src;
- rt_missmsg(RTM_REDIRECT, &info, flags, error);
-}
-
-/*
-* Routing table ioctl interface.
-*/
-int
-rtioctl(req, data, p)
- int req;
- caddr_t data;
- struct proc *p;
-{
-#ifdef INET
- /* Multicast goop, grrr... */
-#ifdef MROUTING
- return mrt_ioctl(req, data);
-#else
- return mrt_ioctl(req, data, p);
-#endif
-#else /* INET */
- return ENXIO;
-#endif /* INET */
-}
-
-struct ifaddr *
-ifa_ifwithroute(flags, dst, gateway)
- int flags;
- struct sockaddr *dst, *gateway;
-{
- register struct ifaddr *ifa;
- if ((flags & RTF_GATEWAY) == 0) {
- /*
- * If we are adding a route to an interface,
- * and the interface is a pt to pt link
- * we should search for the destination
- * as our clue to the interface. Otherwise
- * we can use the local address.
- */
- ifa = 0;
- if (flags & RTF_HOST) {
- ifa = ifa_ifwithdstaddr(dst);
- }
- if (ifa == 0)
- ifa = ifa_ifwithaddr(gateway);
- } else {
- /*
- * If we are adding a route to a remote net
- * or host, the gateway may still be on the
- * other end of a pt to pt link.
- */
- ifa = ifa_ifwithdstaddr(gateway);
- }
- if (ifa == 0)
- ifa = ifa_ifwithnet(gateway);
- if (ifa == 0) {
- struct rtentry *rt = rtalloc1(dst, 0, 0UL);
- if (rt == 0)
- return (0);
- rt->rt_refcnt--;
- if ((ifa = rt->rt_ifa) == 0)
- return (0);
- }
- if (ifa->ifa_addr->sa_family != dst->sa_family) {
- struct ifaddr *oifa = ifa;
- ifa = ifaof_ifpforaddr(dst, ifa->ifa_ifp);
- if (ifa == 0)
- ifa = oifa;
- }
- return (ifa);
-}
-
-#define ROUNDUP(a) (a>0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
-
-static int rt_fixdelete(struct radix_node *, void *);
-static int rt_fixchange(struct radix_node *, void *);
-
-struct rtfc_arg {
- struct rtentry *rt0;
- struct radix_node_head *rnh;
-};
-
-/*
- * Do appropriate manipulations of a routing tree given
- * all the bits of info needed
- */
-int
-rtrequest(req, dst, gateway, netmask, flags, ret_nrt)
- int req, flags;
- struct sockaddr *dst, *gateway, *netmask;
- struct rtentry **ret_nrt;
-{
- int s = splnet(); int error = 0;
- register struct rtentry *rt;
- register struct radix_node *rn;
- register struct radix_node_head *rnh;
- struct ifaddr *ifa;
- struct sockaddr *ndst;
-#define senderr(x) { error = x ; goto bad; }
-
- /*
- * Find the correct routing tree to use for this Address Family
- */
- if ((rnh = rt_tables[dst->sa_family]) == 0)
- senderr(ESRCH);
- /*
- * If we are adding a host route then we don't want to put
- * a netmask in the tree
- */
- if (flags & RTF_HOST)
- netmask = 0;
- switch (req) {
- case RTM_DELETE:
- /*
- * Remove the item from the tree and return it.
- * Complain if it is not there and do no more processing.
- */
- if ((rn = rnh->rnh_deladdr(dst, netmask, rnh)) == 0)
- senderr(ESRCH);
- if (rn->rn_flags & (RNF_ACTIVE | RNF_ROOT))
- panic ("rtrequest delete");
- rt = (struct rtentry *)rn;
-
- /*
- * Now search what's left of the subtree for any cloned
- * routes which might have been formed from this node.
- */
- if ((rt->rt_flags & RTF_PRCLONING) && netmask) {
- rnh->rnh_walktree_from(rnh, dst, netmask,
- rt_fixdelete, rt);
- }
-
- /*
- * Remove any external references we may have.
- * This might result in another rtentry being freed if
- * we held it's last reference.
- */
- if (rt->rt_gwroute) {
- rt = rt->rt_gwroute;
- RTFREE(rt);
- (rt = (struct rtentry *)rn)->rt_gwroute = 0;
- }
-
- /*
- * NB: RTF_UP must be set during the search above,
- * because we might delete the last ref, causing
- * rt to get freed prematurely.
- */
- rt->rt_flags &= ~RTF_UP;
-
- /*
- * If there is llinfo or similar associated with the
- * route, give the interface a chance to deal with it..
- */
- if ((ifa = rt->rt_ifa) && ifa->ifa_rtrequest)
- ifa->ifa_rtrequest(RTM_DELETE, rt, SA(0));
- rttrash++;
- /*
- * If the caller wants it, then it can have it, but it's up to it
- * to free the rtentry as we won't be doing it.
- */
- if (ret_nrt)
- *ret_nrt = rt;
- else if (rt->rt_refcnt <= 0) {
- rt->rt_refcnt++; /* make a 1->0 transition */
- rtfree(rt);
- }
- break;
-
- case RTM_RESOLVE:
- if (ret_nrt == 0 || (rt = *ret_nrt) == 0)
- senderr(EINVAL);
- ifa = rt->rt_ifa;
- flags = rt->rt_flags &
- ~(RTF_CLONING | RTF_PRCLONING | RTF_STATIC);
- flags |= RTF_WASCLONED;
- gateway = rt->rt_gateway;
- if ((netmask = rt->rt_genmask) == 0)
- flags |= RTF_HOST;
- goto makeroute;
-
- case RTM_ADD:
- if ((flags & RTF_GATEWAY) && !gateway)
- panic("rtrequest: GATEWAY but no gateway");
-
- if ((ifa = ifa_ifwithroute(flags, dst, gateway)) == 0)
- senderr(ENETUNREACH);
-
- makeroute:
- R_Malloc(rt, struct rtentry *, sizeof(*rt));
- if (rt == 0)
- senderr(ENOBUFS);
- Bzero(rt, sizeof(*rt));
- rt->rt_flags = RTF_UP | flags;
- if ((error = rt_setgate(rt, dst, gateway))) {
- Free(rt);
- senderr(error);
- }
- ndst = rt_key(rt);
- if (netmask) {
- rt_maskedcopy(dst, ndst, netmask);
- } else
- Bcopy(dst, ndst, dst->sa_len);
-
- /*
- * This moved from below so that rnh->rnh_addaddr() can
- * examine the ifa and ifp if it so desires.
- */
- ifa->ifa_refcnt++;
- rt->rt_ifa = ifa;
- rt->rt_ifp = ifa->ifa_ifp;
-
- rn = rnh->rnh_addaddr((caddr_t)ndst, (caddr_t)netmask,
- rnh, rt->rt_nodes);
- if (rn == 0) {
- struct rtentry *rt2;
- /*
- * Uh-oh, we already have one of these in the tree.
- * We do a special hack: if the route that's already
- * there was generated by the protocol-cloning
- * mechanism, then we just blow it away and retry
- * the insertion of the new one.
- */
- rt2 = rtalloc1(dst, 0, RTF_PRCLONING);
- if (rt2 && rt2->rt_parent) {
- rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt2),
- rt2->rt_gateway,
- rt_mask(rt2), rt2->rt_flags, 0);
- RTFREE(rt2);
- rn = rnh->rnh_addaddr((caddr_t)ndst,
- (caddr_t)netmask,
- rnh, rt->rt_nodes);
- } else if (rt2) {
- RTFREE(rt2);
- }
- }
-
- if (rn == 0) {
- if (rt->rt_gwroute)
- rtfree(rt->rt_gwroute);
- if (rt->rt_ifa) {
- IFAFREE(rt->rt_ifa);
- }
- Free(rt_key(rt));
- Free(rt);
- senderr(EEXIST);
- }
- rt->rt_parent = 0;
-
- if (req == RTM_RESOLVE) {
- rt->rt_rmx = (*ret_nrt)->rt_rmx; /* copy metrics */
- if ((*ret_nrt)->rt_flags & RTF_PRCLONING) {
- rt->rt_parent = (*ret_nrt);
- (*ret_nrt)->rt_refcnt++;
- }
- }
- if (ifa->ifa_rtrequest)
- ifa->ifa_rtrequest(req, rt, SA(ret_nrt ? *ret_nrt : 0));
- /*
- * We repeat the same procedure from rt_setgate() here because
- * it doesn't fire when we call it there because the node
- * hasn't been added to the tree yet.
- */
- if (!(rt->rt_flags & RTF_HOST) && rt_mask(rt) != 0) {
- struct rtfc_arg arg;
- arg.rnh = rnh;
- arg.rt0 = rt;
- rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt),
- rt_fixchange, &arg);
- }
-
- if (ret_nrt) {
- *ret_nrt = rt;
- rt->rt_refcnt++;
- }
- break;
- }
-bad:
- splx(s);
- return (error);
-}
-
-/*
- * Called from rtrequest(RTM_DELETE, ...) to fix up the route's ``family''
- * (i.e., the routes related to it by the operation of cloning). This
- * routine is iterated over all potential former-child-routes by way of
- * rnh->rnh_walktree_from() above, and those that actually are children of
- * the late parent (passed in as VP here) are themselves deleted.
- */
-static int
-rt_fixdelete(struct radix_node *rn, void *vp)
-{
- struct rtentry *rt = (struct rtentry *)rn;
- struct rtentry *rt0 = vp;
-
- if (rt->rt_parent == rt0 && !(rt->rt_flags & RTF_PINNED)) {
- return rtrequest(RTM_DELETE, rt_key(rt),
- (struct sockaddr *)0, rt_mask(rt),
- rt->rt_flags, (struct rtentry **)0);
- }
- return 0;
-}
-
-/*
- * This routine is called from rt_setgate() to do the analogous thing for
- * adds and changes. There is the added complication in this case of a
- * middle insert; i.e., insertion of a new network route between an older
- * network route and (cloned) host routes. For this reason, a simple check
- * of rt->rt_parent is insufficient; each candidate route must be tested
- * against the (mask, value) of the new route (passed as before in vp)
- * to see if the new route matches it. Unfortunately, this has the obnoxious
- * property of also triggering for insertion /above/ a pre-existing network
- * route and clones. Sigh. This may be fixed some day.
- *
- * XXX - it may be possible to do fixdelete() for changes and reserve this
- * routine just for adds. I'm not sure why I thought it was necessary to do
- * changes this way.
- */
-#ifdef DEBUG
-int rtfcdebug = 0;
-#endif
-
-static int
-rt_fixchange(struct radix_node *rn, void *vp)
-{
- struct rtentry *rt = (struct rtentry *)rn;
- struct rtfc_arg *ap = vp;
- struct rtentry *rt0 = ap->rt0;
- struct radix_node_head *rnh = ap->rnh;
- u_char *xk1, *xm1, *xk2;
- int i, len;
-
-#ifdef DEBUG
- if (rtfcdebug)
- printf("rt_fixchange: rt %p, rt0 %p\n", rt, rt0);
-#endif
-
- if (!rt->rt_parent || (rt->rt_flags & RTF_PINNED)) {
-#ifdef DEBUG
- if(rtfcdebug) printf("no parent or pinned\n");
-#endif
- return 0;
- }
-
- if (rt->rt_parent == rt0) {
-#ifdef DEBUG
- if(rtfcdebug) printf("parent match\n");
-#endif
- return rtrequest(RTM_DELETE, rt_key(rt),
- (struct sockaddr *)0, rt_mask(rt),
- rt->rt_flags, (struct rtentry **)0);
- }
-
- /*
- * There probably is a function somewhere which does this...
- * if not, there should be.
- */
- len = imin(((struct sockaddr *)rt_key(rt0))->sa_len,
- ((struct sockaddr *)rt_key(rt))->sa_len);
-
- xk1 = (u_char *)rt_key(rt0);
- xm1 = (u_char *)rt_mask(rt0);
- xk2 = (u_char *)rt_key(rt);
-
- for (i = rnh->rnh_treetop->rn_off; i < len; i++) {
- if ((xk2[i] & xm1[i]) != xk1[i]) {
-#ifdef DEBUG
- if(rtfcdebug) printf("no match\n");
-#endif
- return 0;
- }
- }
-
- /*
- * OK, this node is a clone, and matches the node currently being
- * changed/added under the node's mask. So, get rid of it.
- */
-#ifdef DEBUG
- if(rtfcdebug) printf("deleting\n");
-#endif
- return rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *)0,
- rt_mask(rt), rt->rt_flags, (struct rtentry **)0);
-}
-
-int
-rt_setgate(rt0, dst, gate)
- struct rtentry *rt0;
- struct sockaddr *dst, *gate;
-{
- caddr_t new, old;
- int dlen = ROUNDUP(dst->sa_len), glen = ROUNDUP(gate->sa_len);
- register struct rtentry *rt = rt0;
- struct radix_node_head *rnh = rt_tables[dst->sa_family];
-
- /*
- * A host route with the destination equal to the gateway
- * will interfere with keeping LLINFO in the routing
- * table, so disallow it.
- */
- if (((rt0->rt_flags & (RTF_HOST|RTF_GATEWAY|RTF_LLINFO)) ==
- (RTF_HOST|RTF_GATEWAY)) &&
- (dst->sa_len == gate->sa_len) &&
- (bcmp(dst, gate, dst->sa_len) == 0)) {
- /*
- * The route might already exist if this is an RTM_CHANGE
- * or a routing redirect, so try to delete it.
- */
- if (rt_key(rt0))
- rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt0),
- rt0->rt_gateway, rt_mask(rt0), rt0->rt_flags, 0);
- return EADDRNOTAVAIL;
- }
-
- if (rt->rt_gateway == 0 || glen > ROUNDUP(rt->rt_gateway->sa_len)) {
- old = (caddr_t)rt_key(rt);
- R_Malloc(new, caddr_t, dlen + glen);
- if (new == 0)
- return ENOBUFS;
- rt->rt_nodes->rn_key = new;
- } else {
- new = rt->rt_nodes->rn_key;
- old = 0;
- }
- Bcopy(gate, (rt->rt_gateway = (struct sockaddr *)(new + dlen)), glen);
- if (old) {
- Bcopy(dst, new, dlen);
- Free(old);
- }
- if (rt->rt_gwroute) {
- rt = rt->rt_gwroute; RTFREE(rt);
- rt = rt0; rt->rt_gwroute = 0;
- }
- /*
- * Cloning loop avoidance:
- * In the presence of protocol-cloning and bad configuration,
- * it is possible to get stuck in bottomless mutual recursion
- * (rtrequest rt_setgate rtalloc1). We avoid this by not allowing
- * protocol-cloning to operate for gateways (which is probably the
- * correct choice anyway), and avoid the resulting reference loops
- * by disallowing any route to run through itself as a gateway.
- * This is obviuosly mandatory when we get rt->rt_output().
- */
- if (rt->rt_flags & RTF_GATEWAY) {
- rt->rt_gwroute = rtalloc1(gate, 1, RTF_PRCLONING);
- if (rt->rt_gwroute == rt) {
- RTFREE(rt->rt_gwroute);
- rt->rt_gwroute = 0;
- return EDQUOT; /* failure */
- }
- }
-
- /*
- * This isn't going to do anything useful for host routes, so
- * don't bother. Also make sure we have a reasonable mask
- * (we don't yet have one during adds).
- */
- if (!(rt->rt_flags & RTF_HOST) && rt_mask(rt) != 0) {
- struct rtfc_arg arg;
- arg.rnh = rnh;
- arg.rt0 = rt;
- rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt),
- rt_fixchange, &arg);
- }
-
- return 0;
-}
-
-static void
-rt_maskedcopy(src, dst, netmask)
- struct sockaddr *src, *dst, *netmask;
-{
- register u_char *cp1 = (u_char *)src;
- register u_char *cp2 = (u_char *)dst;
- register u_char *cp3 = (u_char *)netmask;
- u_char *cplim = cp2 + *cp3;
- u_char *cplim2 = cp2 + *cp1;
-
- *cp2++ = *cp1++; *cp2++ = *cp1++; /* copies sa_len & sa_family */
- cp3 += 2;
- if (cplim > cplim2)
- cplim = cplim2;
- while (cp2 < cplim)
- *cp2++ = *cp1++ & *cp3++;
- if (cp2 < cplim2)
- bzero((caddr_t)cp2, (unsigned)(cplim2 - cp2));
-}
-
-/*
- * Set up a routing table entry, normally
- * for an interface.
- */
-int
-rtinit(ifa, cmd, flags)
- register struct ifaddr *ifa;
- int cmd, flags;
-{
- register struct rtentry *rt;
- register struct sockaddr *dst;
- register struct sockaddr *deldst;
- struct mbuf *m = 0;
- struct rtentry *nrt = 0;
- int error;
-
- dst = flags & RTF_HOST ? ifa->ifa_dstaddr : ifa->ifa_addr;
- /*
- * If it's a delete, check that if it exists, it's on the correct
- * interface or we might scrub a route to another ifa which would
- * be confusing at best and possibly worse.
- */
- if (cmd == RTM_DELETE) {
- /*
- * It's a delete, so it should already exist..
- * If it's a net, mask off the host bits
- * (Assuming we have a mask)
- */
- if ((flags & RTF_HOST) == 0 && ifa->ifa_netmask) {
- m = m_get(M_WAIT, MT_SONAME);
- deldst = mtod(m, struct sockaddr *);
- rt_maskedcopy(dst, deldst, ifa->ifa_netmask);
- dst = deldst;
- }
- /*
- * Get an rtentry that is in the routing tree and
- * contains the correct info. (if this fails we can't get there).
- * We set "report" to FALSE so that if it doesn't exist,
- * it doesn't report an error or clone a route, etc. etc.
- */
- rt = rtalloc1(dst, 0, 0UL);
- if (rt) {
- /*
- * Ok so we found the rtentry. it has an extra reference
- * for us at this stage. we won't need that so
- * lop that off now.
- */
- rt->rt_refcnt--;
- if (rt->rt_ifa != ifa) {
- /*
- * If the interface in the rtentry doesn't match
- * the interface we are using, then we don't
- * want to delete it, so return an error.
- * This seems to be the only point of
- * this whole RTM_DELETE clause.
- */
- if (m)
- (void) m_free(m);
- return (flags & RTF_HOST ? EHOSTUNREACH
- : ENETUNREACH);
- }
- }
- /* XXX */
-#if 0
- else {
- /*
- * One would think that as we are deleting, and we know
- * it doesn't exist, we could just return at this point
- * with an "ELSE" clause, but apparently not..
- */
- return (flags & RTF_HOST ? EHOSTUNREACH
- : ENETUNREACH);
- }
-#endif
- }
- /*
- * Do the actual request
- */
- error = rtrequest(cmd, dst, ifa->ifa_addr, ifa->ifa_netmask,
- flags | ifa->ifa_flags, &nrt);
- if (m)
- (void) m_free(m);
- /*
- * If we are deleting, and we found an entry, then
- * it's been removed from the tree.. now throw it away.
- */
- if (cmd == RTM_DELETE && error == 0 && (rt = nrt)) {
- /*
- * notify any listenning routing agents of the change
- */
- rt_newaddrmsg(cmd, ifa, error, nrt);
- if (rt->rt_refcnt <= 0) {
- rt->rt_refcnt++; /* need a 1->0 transition to free */
- rtfree(rt);
- }
- }
-
- /*
- * We are adding, and we have a returned routing entry.
- * We need to sanity check the result.
- */
- if (cmd == RTM_ADD && error == 0 && (rt = nrt)) {
- /*
- * We just wanted to add it.. we don't actually need a reference
- */
- rt->rt_refcnt--;
- /*
- * If it came back with an unexpected interface, then it must
- * have already existed or something. (XXX)
- */
- if (rt->rt_ifa != ifa) {
- printf("rtinit: wrong ifa (%p) was (%p)\n", ifa,
- rt->rt_ifa);
- /*
- * Ask that the route we got back be removed
- * from the routing tables as we are trying
- * to supersede it.
- */
- if (rt->rt_ifa->ifa_rtrequest)
- rt->rt_ifa->ifa_rtrequest(RTM_DELETE, rt, SA(0));
- /*
- * Remove the referenve to the it's ifaddr.
- */
- IFAFREE(rt->rt_ifa);
- /*
- * And substitute in references to the ifaddr
- * we are adding.
- */
- rt->rt_ifa = ifa;
- rt->rt_ifp = ifa->ifa_ifp;
- ifa->ifa_refcnt++;
- /*
- * Now add it to the routing table
- * XXX could we have just left it?
- * as it might have been in the right place..
- */
- if (ifa->ifa_rtrequest)
- ifa->ifa_rtrequest(RTM_ADD, rt, SA(0));
- }
- /*
- * notify any listenning routing agents of the change
- */
- rt_newaddrmsg(cmd, ifa, error, nrt);
- }
- return (error);
-}
diff --git a/cpukit/libnetworking/net/route.h b/cpukit/libnetworking/net/route.h
deleted file mode 100644
index 69d76909fc..0000000000
--- a/cpukit/libnetworking/net/route.h
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (c) 1980, 1986, 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.
- *
- * @(#)route.h 8.3 (Berkeley) 4/19/94
- * $Id$
- */
-
-#ifndef _NET_ROUTE_H_
-#define _NET_ROUTE_H_
-
-/*
- * Kernel resident routing tables.
- *
- * The routing tables are initialized when interface addresses
- * are set by making entries for all directly connected interfaces.
- */
-
-/*
- * A route consists of a destination address and a reference
- * to a routing entry. These are often held by protocols
- * in their control blocks, e.g. inpcb.
- */
-struct route {
- struct rtentry *ro_rt;
- struct sockaddr ro_dst;
-};
-
-/*
- * These numbers are used by reliable protocols for determining
- * retransmission behavior and are included in the routing structure.
- */
-struct rt_metrics {
- u_long rmx_locks; /* Kernel must leave these values alone */
- u_long rmx_mtu; /* MTU for this path */
- u_long rmx_hopcount; /* max hops expected */
- u_long rmx_expire; /* lifetime for route, e.g. redirect */
- u_long rmx_recvpipe; /* inbound delay-bandwidth product */
- u_long rmx_sendpipe; /* outbound delay-bandwidth product */
- u_long rmx_ssthresh; /* outbound gateway buffer limit */
- u_long rmx_rtt; /* estimated round trip time */
- u_long rmx_rttvar; /* estimated rtt variance */
- u_long rmx_pksent; /* packets sent using this route */
- u_long rmx_filler[4]; /* will be used for T/TCP later */
-};
-
-/*
- * rmx_rtt and rmx_rttvar are stored as microseconds;
- * RTTTOPRHZ(rtt) converts to a value suitable for use
- * by a protocol slowtimo counter.
- */
-#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */
-#define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ))
-
-/*
- * XXX kernel function pointer `rt_output' is visible to applications.
- */
-struct mbuf;
-
-/*
- * We distinguish between routes to hosts and routes to networks,
- * preferring the former if available. For each route we infer
- * the interface to use from the gateway address supplied when
- * the route was entered. Routes that forward packets through
- * gateways are marked so that the output routines know to address the
- * gateway rather than the ultimate destination.
- */
-#ifndef RNF_NORMAL
-#include <net/radix.h>
-#endif
-struct rtentry {
- struct radix_node rt_nodes[2]; /* tree glue, and other values */
-#define rt_key(r) ((struct sockaddr *)((r)->rt_nodes->rn_key))
-#define rt_mask(r) ((struct sockaddr *)((r)->rt_nodes->rn_mask))
- struct sockaddr *rt_gateway; /* value */
- short rt_filler; /* was short flags field */
- short rt_refcnt; /* # held references */
- u_long rt_flags; /* up/down?, host/net */
- struct ifnet *rt_ifp; /* the answer: interface to use */
- struct ifaddr *rt_ifa; /* the answer: interface to use */
- struct sockaddr *rt_genmask; /* for generation of cloned routes */
- caddr_t rt_llinfo; /* pointer to link level info cache */
- struct rt_metrics rt_rmx; /* metrics used by rx'ing protocols */
- struct rtentry *rt_gwroute; /* implied entry for gatewayed routes */
- int (*rt_output) __P((struct ifnet *, struct mbuf *,
- struct sockaddr *, struct rtentry *));
- /* output routine for this (rt,if) */
- struct rtentry *rt_parent; /* cloning parent of this route */
- void *rt_filler2; /* more filler */
-};
-
-/*
- * Following structure necessary for 4.3 compatibility;
- * We should eventually move it to a compat file.
- */
-struct ortentry {
- u_long rt_hash; /* to speed lookups */
- struct sockaddr rt_dst; /* key */
- struct sockaddr rt_gateway; /* value */
- short rt_flags; /* up/down?, host/net */
- short rt_refcnt; /* # held references */
- u_long rt_use; /* raw # packets forwarded */
- struct ifnet *rt_ifp; /* the answer: interface to use */
-};
-
-#define rt_use rt_rmx.rmx_pksent
-
-#define RTF_UP 0x1 /* route usable */
-#define RTF_GATEWAY 0x2 /* destination is a gateway */
-#define RTF_HOST 0x4 /* host entry (net otherwise) */
-#define RTF_REJECT 0x8 /* host or net unreachable */
-#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */
-#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */
-#define RTF_DONE 0x40 /* message confirmed */
-/* 0x80 unused */
-#define RTF_CLONING 0x100 /* generate new routes on use */
-#define RTF_XRESOLVE 0x200 /* external daemon resolves name */
-#define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP) */
-#define RTF_STATIC 0x800 /* manually added */
-#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */
-#define RTF_PROTO2 0x4000 /* protocol specific routing flag */
-#define RTF_PROTO1 0x8000 /* protocol specific routing flag */
-
-#define RTF_PRCLONING 0x10000 /* protocol requires cloning */
-#define RTF_WASCLONED 0x20000 /* route generated through cloning */
-#define RTF_PROTO3 0x40000 /* protocol specific routing flag */
-/* 0x80000 unused */
-#define RTF_PINNED 0x100000 /* future use */
-#define RTF_LOCAL 0x200000 /* route represents a local address */
-#define RTF_BROADCAST 0x400000 /* route represents a bcast address */
-#define RTF_MULTICAST 0x800000 /* route represents a mcast address */
- /* 0x1000000 and up unassigned */
-
-/*
- * Routing statistics.
- */
-struct rtstat {
- short rts_badredirect; /* bogus redirect calls */
- short rts_dynamic; /* routes created by redirects */
- short rts_newgateway; /* routes modified by redirects */
- short rts_unreach; /* lookups which failed */
- short rts_wildcard; /* lookups satisfied by a wildcard */
-};
-/*
- * Structures for routing messages.
- */
-struct rt_msghdr {
- u_short rtm_msglen; /* to skip over non-understood messages */
- u_char rtm_version; /* future binary compatibility */
- u_char rtm_type; /* message type */
- u_short rtm_index; /* index for associated ifp */
- int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
- int rtm_addrs; /* bitmask identifying sockaddrs in msg */
- pid_t rtm_pid; /* identify sender */
- int rtm_seq; /* for sender to identify action */
- int rtm_errno; /* why failed */
- int rtm_use; /* from rtentry */
- u_long rtm_inits; /* which metrics we are initializing */
- struct rt_metrics rtm_rmx; /* metrics themselves */
-};
-
-#define RTM_VERSION 5 /* Up the ante and ignore older versions */
-
-#define RTM_ADD 0x1 /* Add Route */
-#define RTM_DELETE 0x2 /* Delete Route */
-#define RTM_CHANGE 0x3 /* Change Metrics or flags */
-#define RTM_GET 0x4 /* Report Metrics */
-#define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */
-#define RTM_REDIRECT 0x6 /* Told to use different route */
-#define RTM_MISS 0x7 /* Lookup failed on this address */
-#define RTM_LOCK 0x8 /* fix specified metrics */
-#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */
-#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */
-#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */
-#define RTM_NEWADDR 0xc /* address being added to iface */
-#define RTM_DELADDR 0xd /* address being removed from iface */
-#define RTM_IFINFO 0xe /* iface going up/down etc. */
-
-#define RTV_MTU 0x1 /* init or lock _mtu */
-#define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */
-#define RTV_EXPIRE 0x4 /* init or lock _hopcount */
-#define RTV_RPIPE 0x8 /* init or lock _recvpipe */
-#define RTV_SPIPE 0x10 /* init or lock _sendpipe */
-#define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */
-#define RTV_RTT 0x40 /* init or lock _rtt */
-#define RTV_RTTVAR 0x80 /* init or lock _rttvar */
-
-/*
- * Bitmask values for rtm_addr.
- */
-#define RTA_DST 0x1 /* destination sockaddr present */
-#define RTA_GATEWAY 0x2 /* gateway sockaddr present */
-#define RTA_NETMASK 0x4 /* netmask sockaddr present */
-#define RTA_GENMASK 0x8 /* cloning mask sockaddr present */
-#define RTA_IFP 0x10 /* interface name sockaddr present */
-#define RTA_IFA 0x20 /* interface addr sockaddr present */
-#define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */
-#define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */
-
-/*
- * Index offsets for sockaddr array for alternate internal encoding.
- */
-#define RTAX_DST 0 /* destination sockaddr present */
-#define RTAX_GATEWAY 1 /* gateway sockaddr present */
-#define RTAX_NETMASK 2 /* netmask sockaddr present */
-#define RTAX_GENMASK 3 /* cloning mask sockaddr present */
-#define RTAX_IFP 4 /* interface name sockaddr present */
-#define RTAX_IFA 5 /* interface addr sockaddr present */
-#define RTAX_AUTHOR 6 /* sockaddr for author of redirect */
-#define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */
-#define RTAX_MAX 8 /* size of array to allocate */
-
-struct rt_addrinfo {
- int rti_addrs;
- struct sockaddr *rti_info[RTAX_MAX];
-};
-
-struct route_cb {
- int ip_count;
- int ipx_count;
- int ns_count;
- int iso_count;
- int any_count;
-};
-
-#ifdef KERNEL
-#define RTFREE(rt) \
- if ((rt)->rt_refcnt <= 1) \
- rtfree(rt); \
- else \
- (rt)->rt_refcnt--;
-
-extern struct route_cb route_cb;
-extern struct rtstat rtstat;
-extern struct radix_node_head *rt_tables[AF_MAX+1];
-
-void route_init __P((void));
-void rt_ifmsg __P((struct ifnet *));
-void rt_missmsg __P((int, struct rt_addrinfo *, int, int));
-void rt_newaddrmsg __P((int, struct ifaddr *, int, struct rtentry *));
-int rt_setgate __P((struct rtentry *,
- struct sockaddr *, struct sockaddr *));
-void rtalloc __P((struct route *));
-void rtalloc_ign __P((struct route *, unsigned long));
-struct rtentry *
- rtalloc1 __P((struct sockaddr *, int, unsigned long));
-void rtfree __P((struct rtentry *));
-int rtinit __P((struct ifaddr *, int, int));
-int rtioctl __P((int, caddr_t, struct proc *));
-void rtredirect __P((struct sockaddr *, struct sockaddr *,
- struct sockaddr *, int, struct sockaddr *, struct rtentry **));
-int rtrequest __P((int, struct sockaddr *,
- struct sockaddr *, struct sockaddr *, int, struct rtentry **));
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/net/rtsock.c b/cpukit/libnetworking/net/rtsock.c
deleted file mode 100644
index 57e777906a..0000000000
--- a/cpukit/libnetworking/net/rtsock.c
+++ /dev/null
@@ -1,829 +0,0 @@
-/*
- * Copyright (c) 1988, 1991, 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.
- *
- * @(#)rtsock.c 8.5 (Berkeley) 11/2/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <net/raw_cb.h>
-
-static struct sockaddr route_dst = { 2, PF_ROUTE, };
-static struct sockaddr route_src = { 2, PF_ROUTE, };
-static struct sockaddr sa_zero = { sizeof(sa_zero), AF_INET, };
-static struct sockproto route_proto = { PF_ROUTE, };
-
-struct walkarg {
- int w_tmemsize;
- int w_op, w_arg;
- caddr_t w_tmem;
- struct sysctl_req *w_req;
-};
-
-static struct mbuf *
- rt_msg1 __P((int, struct rt_addrinfo *));
-static int rt_msg2 __P((int,
- struct rt_addrinfo *, caddr_t, struct walkarg *));
-static int rt_xaddrs __P((caddr_t, caddr_t, struct rt_addrinfo *));
-static int sysctl_dumpentry __P((struct radix_node *rn, void *vw));
-static int sysctl_iflist __P((int af, struct walkarg *w));
-static int route_output __P((struct mbuf *, struct socket *));
-static int route_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-static void rt_setmetrics __P((u_long, struct rt_metrics *, struct rt_metrics *));
-
-/* Sleazy use of local variables throughout file, warning!!!! */
-#define dst info.rti_info[RTAX_DST]
-#define gate info.rti_info[RTAX_GATEWAY]
-#define netmask info.rti_info[RTAX_NETMASK]
-#define genmask info.rti_info[RTAX_GENMASK]
-#define ifpaddr info.rti_info[RTAX_IFP]
-#define ifaaddr info.rti_info[RTAX_IFA]
-#define brdaddr info.rti_info[RTAX_BRD]
-
-/*ARGSUSED*/
-static int
-route_usrreq(so, req, m, nam, control)
- register struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register int error = 0;
- register struct rawcb *rp = sotorawcb(so);
- int s;
-
- if (req == PRU_ATTACH) {
- MALLOC(rp, struct rawcb *, sizeof(*rp), M_PCB, M_WAITOK);
- so->so_pcb = (caddr_t)rp;
- if (so->so_pcb)
- bzero(so->so_pcb, sizeof(*rp));
- }
- if (req == PRU_DETACH && rp) {
- int af = rp->rcb_proto.sp_protocol;
- if (af == AF_INET)
- route_cb.ip_count--;
- else if (af == AF_IPX)
- route_cb.ipx_count--;
- else if (af == AF_NS)
- route_cb.ns_count--;
- else if (af == AF_ISO)
- route_cb.iso_count--;
- route_cb.any_count--;
- }
- s = splnet();
- error = raw_usrreq(so, req, m, nam, control);
- rp = sotorawcb(so);
- if (req == PRU_ATTACH && rp) {
- int af = rp->rcb_proto.sp_protocol;
- if (error) {
- free((caddr_t)rp, M_PCB);
- splx(s);
- return (error);
- }
- if (af == AF_INET)
- route_cb.ip_count++;
- else if (af == AF_IPX)
- route_cb.ipx_count++;
- else if (af == AF_NS)
- route_cb.ns_count++;
- else if (af == AF_ISO)
- route_cb.iso_count++;
- rp->rcb_faddr = &route_src;
- route_cb.any_count++;
- soisconnected(so);
- so->so_options |= SO_USELOOPBACK;
- }
- splx(s);
- return (error);
-}
-
-/*ARGSUSED*/
-static int
-route_output(m, so)
- register struct mbuf *m;
- struct socket *so;
-{
- register struct rt_msghdr *rtm = 0;
- register struct rtentry *rt = 0;
- struct rtentry *saved_nrt = 0;
- struct radix_node_head *rnh;
- struct rt_addrinfo info;
- int len, error = 0;
- struct ifnet *ifp = 0;
- struct ifaddr *ifa = 0;
-
-#define senderr(e) { error = e; goto flush;}
- if (m == 0 || ((m->m_len < sizeof(long)) &&
- (m = m_pullup(m, sizeof(long))) == 0))
- return (ENOBUFS);
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("route_output");
- len = m->m_pkthdr.len;
- if (len < sizeof(*rtm) ||
- len != mtod(m, struct rt_msghdr *)->rtm_msglen) {
- dst = 0;
- senderr(EINVAL);
- }
- R_Malloc(rtm, struct rt_msghdr *, len);
- if (rtm == 0) {
- dst = 0;
- senderr(ENOBUFS);
- }
- m_copydata(m, 0, len, (caddr_t)rtm);
- if (rtm->rtm_version != RTM_VERSION) {
- dst = 0;
- senderr(EPROTONOSUPPORT);
- }
- info.rti_addrs = rtm->rtm_addrs;
- if (rt_xaddrs((caddr_t)(rtm + 1), len + (caddr_t)rtm, &info)) {
- dst = 0;
- senderr(EINVAL);
- }
- if (dst == 0 || (dst->sa_family >= AF_MAX)
- || (gate != 0 && (gate->sa_family >= AF_MAX)))
- senderr(EINVAL);
- if (genmask) {
- struct radix_node *t;
- t = rn_addmask((caddr_t)genmask, 0, 1);
- if (t && Bcmp(genmask, t->rn_key, *(u_char *)genmask) == 0)
- genmask = (struct sockaddr *)(t->rn_key);
- else
- senderr(ENOBUFS);
- }
- switch (rtm->rtm_type) {
-
- case RTM_ADD:
- if (gate == 0)
- senderr(EINVAL);
- error = rtrequest(RTM_ADD, dst, gate, netmask,
- rtm->rtm_flags, &saved_nrt);
- if (error == 0 && saved_nrt) {
- rt_setmetrics(rtm->rtm_inits,
- &rtm->rtm_rmx, &saved_nrt->rt_rmx);
- saved_nrt->rt_rmx.rmx_locks &= ~(rtm->rtm_inits);
- saved_nrt->rt_rmx.rmx_locks |=
- (rtm->rtm_inits & rtm->rtm_rmx.rmx_locks);
- saved_nrt->rt_refcnt--;
- saved_nrt->rt_genmask = genmask;
- }
- break;
-
- case RTM_DELETE:
- error = rtrequest(RTM_DELETE, dst, gate, netmask,
- rtm->rtm_flags, &saved_nrt);
- if (error == 0) {
- if ((rt = saved_nrt))
- rt->rt_refcnt++;
- goto report;
- }
- break;
-
- case RTM_GET:
- case RTM_CHANGE:
- case RTM_LOCK:
- if ((rnh = rt_tables[dst->sa_family]) == 0) {
- senderr(EAFNOSUPPORT);
- } else if ((rt = (struct rtentry *)
- rnh->rnh_lookup(dst, netmask, rnh)))
- rt->rt_refcnt++;
- else
- senderr(ESRCH);
- switch(rtm->rtm_type) {
-
- case RTM_GET:
- report:
- dst = rt_key(rt);
- gate = rt->rt_gateway;
- netmask = rt_mask(rt);
- genmask = rt->rt_genmask;
- if (rtm->rtm_addrs & (RTA_IFP | RTA_IFA)) {
- ifp = rt->rt_ifp;
- if (ifp) {
- ifpaddr = ifp->if_addrlist->ifa_addr;
- ifaaddr = rt->rt_ifa->ifa_addr;
- rtm->rtm_index = ifp->if_index;
- } else {
- ifpaddr = 0;
- ifaaddr = 0;
- }
- }
- len = rt_msg2(rtm->rtm_type, &info, (caddr_t)0,
- (struct walkarg *)0);
- if (len > rtm->rtm_msglen) {
- struct rt_msghdr *new_rtm;
- R_Malloc(new_rtm, struct rt_msghdr *, len);
- if (new_rtm == 0)
- senderr(ENOBUFS);
- Bcopy(rtm, new_rtm, rtm->rtm_msglen);
- Free(rtm); rtm = new_rtm;
- }
- (void)rt_msg2(rtm->rtm_type, &info, (caddr_t)rtm,
- (struct walkarg *)0);
- rtm->rtm_flags = rt->rt_flags;
- rtm->rtm_rmx = rt->rt_rmx;
- rtm->rtm_addrs = info.rti_addrs;
- break;
-
- case RTM_CHANGE:
- if (gate && (error = rt_setgate(rt, rt_key(rt), gate)))
- senderr(error);
-
- /*
- * If they tried to change things but didn't specify
- * the required gateway, then just use the old one.
- * This can happen if the user tries to change the
- * flags on the default route without changing the
- * default gateway. Changing flags still doesn't work.
- */
- if ((rt->rt_flags & RTF_GATEWAY) && !gate)
- gate = rt->rt_gateway;
-
- /* new gateway could require new ifaddr, ifp;
- flags may also be different; ifp may be specified
- by ll sockaddr when protocol address is ambiguous */
- if (ifpaddr && (ifa = ifa_ifwithnet(ifpaddr)) &&
- (ifp = ifa->ifa_ifp) && (ifaaddr || gate))
- ifa = ifaof_ifpforaddr(ifaaddr ? ifaaddr : gate,
- ifp);
- else if ((ifaaddr && (ifa = ifa_ifwithaddr(ifaaddr))) ||
- (gate && (ifa = ifa_ifwithroute(rt->rt_flags,
- rt_key(rt), gate))))
- ifp = ifa->ifa_ifp;
- if (ifa) {
- register struct ifaddr *oifa = rt->rt_ifa;
- if (oifa != ifa) {
- if (oifa && oifa->ifa_rtrequest)
- oifa->ifa_rtrequest(RTM_DELETE,
- rt, gate);
- IFAFREE(rt->rt_ifa);
- rt->rt_ifa = ifa;
- ifa->ifa_refcnt++;
- rt->rt_ifp = ifp;
- }
- }
- rt_setmetrics(rtm->rtm_inits, &rtm->rtm_rmx,
- &rt->rt_rmx);
- if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest)
- rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, gate);
- if (genmask)
- rt->rt_genmask = genmask;
- /*
- * Fall into
- */
- case RTM_LOCK:
- rt->rt_rmx.rmx_locks &= ~(rtm->rtm_inits);
- rt->rt_rmx.rmx_locks |=
- (rtm->rtm_inits & rtm->rtm_rmx.rmx_locks);
- break;
- }
- break;
-
- default:
- senderr(EOPNOTSUPP);
- }
-
-flush:
- if (rtm) {
- if (error)
- rtm->rtm_errno = error;
- else
- rtm->rtm_flags |= RTF_DONE;
- }
- if (rt)
- rtfree(rt);
- {
- register struct rawcb *rp = 0;
- /*
- * Check to see if we don't want our own messages.
- */
- if ((so->so_options & SO_USELOOPBACK) == 0) {
- if (route_cb.any_count <= 1) {
- if (rtm)
- Free(rtm);
- m_freem(m);
- return (error);
- }
- /* There is another listener, so construct message */
- rp = sotorawcb(so);
- }
- if (rtm) {
- m_copyback(m, 0, rtm->rtm_msglen, (caddr_t)rtm);
- Free(rtm);
- }
- if (rp)
- rp->rcb_proto.sp_family = 0; /* Avoid us */
- if (dst)
- route_proto.sp_protocol = dst->sa_family;
- raw_input(m, &route_proto, &route_src, &route_dst);
- if (rp)
- rp->rcb_proto.sp_family = PF_ROUTE;
- }
- return (error);
-}
-
-static void
-rt_setmetrics(which, in, out)
- u_long which;
- register struct rt_metrics *in, *out;
-{
-#define metric(f, e) if (which & (f)) out->e = in->e;
- metric(RTV_RPIPE, rmx_recvpipe);
- metric(RTV_SPIPE, rmx_sendpipe);
- metric(RTV_SSTHRESH, rmx_ssthresh);
- metric(RTV_RTT, rmx_rtt);
- metric(RTV_RTTVAR, rmx_rttvar);
- metric(RTV_HOPCOUNT, rmx_hopcount);
- metric(RTV_MTU, rmx_mtu);
- metric(RTV_EXPIRE, rmx_expire);
-#undef metric
-}
-
-#define ROUNDUP(a) \
- ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
-#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
-
-
-/*
- * Extract the addresses of the passed sockaddrs.
- * Do a little sanity checking so as to avoid bad memory references.
- * This data is derived straight from userland.
- */
-static int
-rt_xaddrs(cp, cplim, rtinfo)
- register caddr_t cp, cplim;
- register struct rt_addrinfo *rtinfo;
-{
- register struct sockaddr *sa;
- register int i;
-
- bzero(rtinfo->rti_info, sizeof(rtinfo->rti_info));
- for (i = 0; (i < RTAX_MAX) && (cp < cplim); i++) {
- if ((rtinfo->rti_addrs & (1 << i)) == 0)
- continue;
- sa = (struct sockaddr *)cp;
- /*
- * It won't fit.
- */
- if ( (cp + sa->sa_len) > cplim ) {
- return (EINVAL);
- }
-
- /*
- * there are no more.. quit now
- * If there are more bits, they are in error.
- * I've seen this. route(1) can evidently generate these.
- * This causes kernel to core dump.
- * for compatibility, If we see this, point to a safe address.
- */
- if (sa->sa_len == 0) {
- rtinfo->rti_info[i] = &sa_zero;
- return (0); /* should be EINVAL but for compat */
- }
-
- /* accept it */
- rtinfo->rti_info[i] = sa;
- ADVANCE(cp, sa);
- }
- return (0);
-}
-
-static struct mbuf *
-rt_msg1(type, rtinfo)
- int type;
- register struct rt_addrinfo *rtinfo;
-{
- register struct rt_msghdr *rtm;
- register struct mbuf *m;
- register int i;
- register struct sockaddr *sa;
- int len, dlen;
-
- m = m_gethdr(M_DONTWAIT, MT_DATA);
- if (m == 0)
- return (m);
- switch (type) {
-
- case RTM_DELADDR:
- case RTM_NEWADDR:
- len = sizeof(struct ifa_msghdr);
- break;
-
- case RTM_IFINFO:
- len = sizeof(struct if_msghdr);
- break;
-
- default:
- len = sizeof(struct rt_msghdr);
- }
- if (len > MHLEN)
- panic("rt_msg1");
- m->m_pkthdr.len = m->m_len = len;
- m->m_pkthdr.rcvif = 0;
- rtm = mtod(m, struct rt_msghdr *);
- bzero((caddr_t)rtm, len);
- for (i = 0; i < RTAX_MAX; i++) {
- if ((sa = rtinfo->rti_info[i]) == NULL)
- continue;
- rtinfo->rti_addrs |= (1 << i);
- dlen = ROUNDUP(sa->sa_len);
- m_copyback(m, len, dlen, (caddr_t)sa);
- len += dlen;
- }
- if (m->m_pkthdr.len != len) {
- m_freem(m);
- return (NULL);
- }
- rtm->rtm_msglen = len;
- rtm->rtm_version = RTM_VERSION;
- rtm->rtm_type = type;
- return (m);
-}
-
-static int
-rt_msg2(type, rtinfo, cp, w)
- int type;
- register struct rt_addrinfo *rtinfo;
- caddr_t cp;
- struct walkarg *w;
-{
- register int i;
- int len, dlen, second_time = 0;
- caddr_t cp0;
-
- rtinfo->rti_addrs = 0;
-again:
- switch (type) {
-
- case RTM_DELADDR:
- case RTM_NEWADDR:
- len = sizeof(struct ifa_msghdr);
- break;
-
- case RTM_IFINFO:
- len = sizeof(struct if_msghdr);
- break;
-
- default:
- len = sizeof(struct rt_msghdr);
- }
- cp0 = cp;
- if (cp0)
- cp += len;
- for (i = 0; i < RTAX_MAX; i++) {
- register struct sockaddr *sa;
-
- if ((sa = rtinfo->rti_info[i]) == 0)
- continue;
- rtinfo->rti_addrs |= (1 << i);
- dlen = ROUNDUP(sa->sa_len);
- if (cp) {
- bcopy((caddr_t)sa, cp, (unsigned)dlen);
- cp += dlen;
- }
- len += dlen;
- }
- if (cp == 0 && w != NULL && !second_time) {
- register struct walkarg *rw = w;
-
- if (rw->w_req) {
- if (rw->w_tmemsize < len) {
- if (rw->w_tmem)
- free(rw->w_tmem, M_RTABLE);
- rw->w_tmem = (caddr_t)
- malloc(len, M_RTABLE, M_NOWAIT);
- if (rw->w_tmem)
- rw->w_tmemsize = len;
- }
- if (rw->w_tmem) {
- cp = rw->w_tmem;
- second_time = 1;
- goto again;
- }
- }
- }
- if (cp) {
- register struct rt_msghdr *rtm = (struct rt_msghdr *)cp0;
-
- rtm->rtm_version = RTM_VERSION;
- rtm->rtm_type = type;
- rtm->rtm_msglen = len;
- }
- return (len);
-}
-
-/*
- * This routine is called to generate a message from the routing
- * socket indicating that a redirect has occured, a routing lookup
- * has failed, or that a protocol has detected timeouts to a particular
- * destination.
- */
-void
-rt_missmsg(type, rtinfo, flags, error)
- int type, flags, error;
- register struct rt_addrinfo *rtinfo;
-{
- register struct rt_msghdr *rtm;
- register struct mbuf *m;
- struct sockaddr *sa = rtinfo->rti_info[RTAX_DST];
-
- if (route_cb.any_count == 0)
- return;
- m = rt_msg1(type, rtinfo);
- if (m == 0)
- return;
- rtm = mtod(m, struct rt_msghdr *);
- rtm->rtm_flags = RTF_DONE | flags;
- rtm->rtm_errno = error;
- rtm->rtm_addrs = rtinfo->rti_addrs;
- route_proto.sp_protocol = sa ? sa->sa_family : 0;
- raw_input(m, &route_proto, &route_src, &route_dst);
-}
-
-/*
- * This routine is called to generate a message from the routing
- * socket indicating that the status of a network interface has changed.
- */
-void
-rt_ifmsg(ifp)
- register struct ifnet *ifp;
-{
- register struct if_msghdr *ifm;
- struct mbuf *m;
- struct rt_addrinfo info;
-
- if (route_cb.any_count == 0)
- return;
- bzero((caddr_t)&info, sizeof(info));
- m = rt_msg1(RTM_IFINFO, &info);
- if (m == 0)
- return;
- ifm = mtod(m, struct if_msghdr *);
- ifm->ifm_index = ifp->if_index;
- ifm->ifm_flags = (u_short)ifp->if_flags;
- ifm->ifm_data = ifp->if_data;
- ifm->ifm_addrs = 0;
- route_proto.sp_protocol = 0;
- raw_input(m, &route_proto, &route_src, &route_dst);
-}
-
-/*
- * This is called to generate messages from the routing socket
- * indicating a network interface has had addresses associated with it.
- * if we ever reverse the logic and replace messages TO the routing
- * socket indicate a request to configure interfaces, then it will
- * be unnecessary as the routing socket will automatically generate
- * copies of it.
- */
-void
-rt_newaddrmsg(cmd, ifa, error, rt)
- int cmd, error;
- register struct ifaddr *ifa;
- register struct rtentry *rt;
-{
- struct rt_addrinfo info;
- struct sockaddr *sa = 0;
- int pass;
- struct mbuf *m = 0;
- struct ifnet *ifp = ifa->ifa_ifp;
-
- if (route_cb.any_count == 0)
- return;
- for (pass = 1; pass < 3; pass++) {
- bzero((caddr_t)&info, sizeof(info));
- if ((cmd == RTM_ADD && pass == 1) ||
- (cmd == RTM_DELETE && pass == 2)) {
- register struct ifa_msghdr *ifam;
- int ncmd = cmd == RTM_ADD ? RTM_NEWADDR : RTM_DELADDR;
-
- ifaaddr = sa = ifa->ifa_addr;
- ifpaddr = ifp->if_addrlist->ifa_addr;
- netmask = ifa->ifa_netmask;
- brdaddr = ifa->ifa_dstaddr;
- if ((m = rt_msg1(ncmd, &info)) == NULL)
- continue;
- ifam = mtod(m, struct ifa_msghdr *);
- ifam->ifam_index = ifp->if_index;
- ifam->ifam_metric = ifa->ifa_metric;
- ifam->ifam_flags = ifa->ifa_flags;
- ifam->ifam_addrs = info.rti_addrs;
- }
- if ((cmd == RTM_ADD && pass == 2) ||
- (cmd == RTM_DELETE && pass == 1)) {
- register struct rt_msghdr *rtm;
-
- if (rt == 0)
- continue;
- netmask = rt_mask(rt);
- dst = sa = rt_key(rt);
- gate = rt->rt_gateway;
- if ((m = rt_msg1(cmd, &info)) == NULL)
- continue;
- rtm = mtod(m, struct rt_msghdr *);
- rtm->rtm_index = ifp->if_index;
- rtm->rtm_flags |= rt->rt_flags;
- rtm->rtm_errno = error;
- rtm->rtm_addrs = info.rti_addrs;
- }
- route_proto.sp_protocol = sa ? sa->sa_family : 0;
- raw_input(m, &route_proto, &route_src, &route_dst);
- }
-}
-
-
-/*
- * This is used in dumping the kernel table via sysctl().
- */
-int
-sysctl_dumpentry(rn, vw)
- struct radix_node *rn;
- void *vw;
-{
- register struct walkarg *w = vw;
- register struct rtentry *rt = (struct rtentry *)rn;
- int error = 0, size;
- struct rt_addrinfo info;
-
- if (w->w_op == NET_RT_FLAGS && !(rt->rt_flags & w->w_arg))
- return 0;
- bzero((caddr_t)&info, sizeof(info));
- dst = rt_key(rt);
- gate = rt->rt_gateway;
- netmask = rt_mask(rt);
- genmask = rt->rt_genmask;
- size = rt_msg2(RTM_GET, &info, 0, w);
- if (w->w_req && w->w_tmem) {
- register struct rt_msghdr *rtm = (struct rt_msghdr *)w->w_tmem;
-
- rtm->rtm_flags = rt->rt_flags;
- rtm->rtm_use = rt->rt_use;
- rtm->rtm_rmx = rt->rt_rmx;
- rtm->rtm_index = rt->rt_ifp->if_index;
- rtm->rtm_errno = rtm->rtm_pid = rtm->rtm_seq = 0;
- rtm->rtm_addrs = info.rti_addrs;
- error = 0;
- return (error);
- }
- return (error);
-}
-
-int
-sysctl_iflist(af, w)
- int af;
- register struct walkarg *w;
-{
- register struct ifnet *ifp;
- register struct ifaddr *ifa;
- struct rt_addrinfo info;
- int len, error = 0;
-
- bzero((caddr_t)&info, sizeof(info));
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- if (w->w_arg && w->w_arg != ifp->if_index)
- continue;
- ifa = ifp->if_addrlist;
- ifpaddr = ifa->ifa_addr;
- len = rt_msg2(RTM_IFINFO, &info, (caddr_t)0, w);
- ifpaddr = 0;
- if (w->w_req && w->w_tmem) {
- register struct if_msghdr *ifm;
-
- ifm = (struct if_msghdr *)w->w_tmem;
- ifm->ifm_index = ifp->if_index;
- ifm->ifm_flags = (u_short)ifp->if_flags;
- ifm->ifm_data = ifp->if_data;
- ifm->ifm_addrs = info.rti_addrs;
- error =0;
- if (error)
- return (error);
- }
- while ((ifa = ifa->ifa_next) != 0) {
- if (af && af != ifa->ifa_addr->sa_family)
- continue;
- ifaaddr = ifa->ifa_addr;
- netmask = ifa->ifa_netmask;
- brdaddr = ifa->ifa_dstaddr;
- len = rt_msg2(RTM_NEWADDR, &info, 0, w);
- if (w->w_req && w->w_tmem) {
- register struct ifa_msghdr *ifam;
-
- ifam = (struct ifa_msghdr *)w->w_tmem;
- ifam->ifam_index = ifa->ifa_ifp->if_index;
- ifam->ifam_flags = ifa->ifa_flags;
- ifam->ifam_metric = ifa->ifa_metric;
- ifam->ifam_addrs = info.rti_addrs;
- error = 0;
- if (error)
- return (error);
- }
- }
- ifaaddr = netmask = brdaddr = 0;
- }
- return (0);
-}
-
-static int
-sysctl_rtsock SYSCTL_HANDLER_ARGS
-{
- int *name = (int *)arg1;
- u_int namelen = arg2;
- register struct radix_node_head *rnh;
- int i, s, error = EINVAL;
- u_char af;
- struct walkarg w;
-
- name ++;
- namelen--;
- if (req->newptr)
- return (EPERM);
- if (namelen != 3)
- return (EINVAL);
- af = name[0];
- Bzero(&w, sizeof(w));
- w.w_op = name[1];
- w.w_arg = name[2];
- w.w_req = req;
-
- s = splnet();
- switch (w.w_op) {
-
- case NET_RT_DUMP:
- case NET_RT_FLAGS:
- for (i = 1; i <= AF_MAX; i++)
- if ((rnh = rt_tables[i]) && (af == 0 || af == i) &&
- (error = rnh->rnh_walktree(rnh,
- sysctl_dumpentry, &w)))
- break;
- break;
-
- case NET_RT_IFLIST:
- error = sysctl_iflist(af, &w);
- }
- splx(s);
- if (w.w_tmem)
- free(w.w_tmem, M_RTABLE);
- return (error);
-}
-
-SYSCTL_NODE(_net, PF_ROUTE, routetable, CTLFLAG_RD, sysctl_rtsock,"");
-
-/*
- * Definitions of protocols supported in the ROUTE domain.
- */
-
-extern struct domain routedomain; /* or at least forward */
-
-static struct protosw routesw[] = {
-{ SOCK_RAW, &routedomain, 0, PR_ATOMIC|PR_ADDR,
- 0, route_output, raw_ctlinput, 0,
- route_usrreq,
- raw_init
-}
-};
-
-struct domain routedomain =
- { PF_ROUTE, "route", route_init, 0, 0,
- routesw, &routesw[sizeof(routesw)/sizeof(routesw[0])] };
-
-DOMAIN_SET(route);
diff --git a/cpukit/libnetworking/netdb.h b/cpukit/libnetworking/netdb.h
deleted file mode 100644
index ec274f851f..0000000000
--- a/cpukit/libnetworking/netdb.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*-
- * Copyright (c) 1980, 1983, 1988, 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.
- *
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-/*
- * @(#)netdb.h 8.1 (Berkeley) 6/2/93
- * From: Id: netdb.h,v 8.9 1996/11/19 08:39:29 vixie Exp $
- * $Id$
- */
-
-#ifndef _NETDB_H_
-#define _NETDB_H_
-
-#include <sys/cdefs.h>
-
-#ifndef _PATH_HEQUIV
-# define _PATH_HEQUIV "/etc/hosts.equiv"
-#endif
-#define _PATH_HOSTS "/etc/hosts"
-#define _PATH_NETWORKS "/etc/networks"
-#define _PATH_PROTOCOLS "/etc/protocols"
-#define _PATH_SERVICES "/etc/services"
-
-extern int h_errno;
-
-/*
- * Structures returned by network data base library. All addresses are
- * supplied in host order, and returned in network order (suitable for
- * use in system calls).
- */
-struct hostent {
- char *h_name; /* official name of host */
- char **h_aliases; /* alias list */
- int h_addrtype; /* host address type */
- int h_length; /* length of address */
- char **h_addr_list; /* list of addresses from name server */
-#define h_addr h_addr_list[0] /* address, for backward compatibility */
-};
-
-/*
- * Assumption here is that a network number
- * fits in an unsigned long -- probably a poor one.
- */
-struct netent {
- char *n_name; /* official name of net */
- char **n_aliases; /* alias list */
- int n_addrtype; /* net address type */
- unsigned long n_net; /* network # */
-};
-
-struct servent {
- char *s_name; /* official service name */
- char **s_aliases; /* alias list */
- int s_port; /* port # */
- char *s_proto; /* protocol to use */
-};
-
-struct protoent {
- char *p_name; /* official protocol name */
- char **p_aliases; /* alias list */
- int p_proto; /* protocol # */
-};
-
-/*
- * Error return codes from gethostbyname() and gethostbyaddr()
- * (left in extern int h_errno).
- */
-
-#define NETDB_INTERNAL -1 /* see errno */
-#define NETDB_SUCCESS 0 /* no problem */
-#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
-#define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */
-#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
-#define NO_DATA 4 /* Valid name, no data record of requested type */
-#define NO_ADDRESS NO_DATA /* no address, look for MX record */
-
-__BEGIN_DECLS
-void endhostent __P((void));
-void endnetent __P((void));
-void endprotoent __P((void));
-void endservent __P((void));
-struct hostent *gethostbyaddr __P((const char *, int, int));
-struct hostent *gethostbyname __P((const char *));
-struct hostent *gethostbyname2 __P((const char *, int));
-struct hostent *gethostent __P((void));
-struct netent *getnetbyaddr __P((unsigned long, int));
-struct netent *getnetbyname __P((const char *));
-struct netent *getnetent __P((void));
-struct protoent *getprotobyname __P((const char *));
-struct protoent *getprotobynumber __P((int));
-struct protoent *getprotoent __P((void));
-struct servent *getservbyname __P((const char *, const char *));
-struct servent *getservbyport __P((int, const char *));
-struct servent *getservent __P((void));
-void herror __P((const char *));
-__const char *hstrerror __P((int));
-void sethostent __P((int));
-/* void sethostfile __P((const char *)); */
-void setnetent __P((int));
-void setprotoent __P((int));
-void setservent __P((int));
-
-/*
- * PRIVATE functions specific to the FreeBSD implementation
- */
-
-/* DO NOT USE THESE, THEY ARE SUBJECT TO CHANGE AND ARE NOT PORTABLE!!! */
-void _sethosthtent __P((int));
-void _endhosthtent __P((void));
-void _sethostdnsent __P((int));
-void _endhostdnsent __P((void));
-void _setnethtent __P((int));
-void _endnethtent __P((void));
-void _setnetdnsent __P((int));
-void _endnetdnsent __P((void));
-struct hostent * _gethostbyhtname __P((const char *, int));
-struct hostent * _gethostbydnsname __P((const char *, int));
-struct hostent * _gethostbynisname __P((const char *, int));
-struct hostent * _gethostbyhtaddr __P((const char *, int, int));
-struct hostent * _gethostbydnsaddr __P((const char *, int, int));
-struct hostent * _gethostbynisaddr __P((const char *, int, int));
-struct netent * _getnetbyhtname __P((const char *));
-struct netent * _getnetbydnsname __P((const char *));
-struct netent * _getnetbynisname __P((const char *));
-struct netent * _getnetbyhtaddr __P((unsigned long, int));
-struct netent * _getnetbydnsaddr __P((unsigned long, int));
-struct netent * _getnetbynisaddr __P((unsigned long, int));
-void _map_v4v6_address __P((const char *src, char *dst));
-void _map_v4v6_hostent __P((struct hostent *hp, char **bp, int *len));
-__END_DECLS
-
-#endif /* !_NETDB_H_ */
diff --git a/cpukit/libnetworking/netinet/icmp_var.h b/cpukit/libnetworking/netinet/icmp_var.h
deleted file mode 100644
index 7657f31acf..0000000000
--- a/cpukit/libnetworking/netinet/icmp_var.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)icmp_var.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_ICMP_VAR_H_
-#define _NETINET_ICMP_VAR_H_
-
-/*
- * Variables related to this implementation
- * of the internet control message protocol.
- */
-struct icmpstat {
-/* statistics related to icmp packets generated */
- u_long icps_error; /* # of calls to icmp_error */
- u_long icps_oldshort; /* no error 'cuz old ip too short */
- u_long icps_oldicmp; /* no error 'cuz old was icmp */
- u_long icps_outhist[ICMP_MAXTYPE + 1];
-/* statistics related to input messages processed */
- u_long icps_badcode; /* icmp_code out of range */
- u_long icps_tooshort; /* packet < ICMP_MINLEN */
- u_long icps_checksum; /* bad checksum */
- u_long icps_badlen; /* calculated bound mismatch */
- u_long icps_reflect; /* number of responses */
- u_long icps_inhist[ICMP_MAXTYPE + 1];
- u_long icps_bmcastecho; /* b/mcast echo requests dropped */
- u_long icps_bmcasttstamp; /* b/mcast tstamp requests dropped */
-};
-
-/*
- * Names for ICMP sysctl objects
- */
-#define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */
-#define ICMPCTL_STATS 2 /* statistics (read-only) */
-#define ICMPCTL_MAXID 3
-
-#define ICMPCTL_NAMES { \
- { 0, 0 }, \
- { "maskrepl", CTLTYPE_INT }, \
- { "stats", CTLTYPE_STRUCT }, \
-}
-
-#ifdef KERNEL
-extern struct icmpstat icmpstat;
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/netinet/if_ether.c b/cpukit/libnetworking/netinet/if_ether.c
deleted file mode 100644
index 985ce6e7d9..0000000000
--- a/cpukit/libnetworking/netinet/if_ether.c
+++ /dev/null
@@ -1,638 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)if_ether.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-/*
- * Ethernet address resolution protocol.
- * TODO:
- * add "inuse/lock" bit (or ref. count) along with valid bit
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/socket.h>
-#include <sys/syslog.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/route.h>
-#include <net/netisr.h>
-
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/if_ether.h>
-
-#define SIN(s) ((struct sockaddr_in *)s)
-#define SDL(s) ((struct sockaddr_dl *)s)
-
-SYSCTL_NODE(_net_link_ether, PF_INET, inet, CTLFLAG_RW, 0, "");
-
-/* timer values */
-static int arpt_prune = (5*60*1); /* walk list every 5 minutes */
-static int arpt_keep = (20*60); /* once resolved, good for 20 more minutes */
-static int arpt_down = 20; /* once declared down, don't send for 20 sec */
-
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, prune_intvl, CTLFLAG_RW,
- &arpt_prune, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_RW,
- &arpt_keep, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, host_down_time, CTLFLAG_RW,
- &arpt_down, 0, "");
-
-#define rt_expire rt_rmx.rmx_expire
-
-struct llinfo_arp {
- LIST_ENTRY(llinfo_arp) la_le;
- struct rtentry *la_rt;
- struct mbuf *la_hold; /* last packet until resolved/timeout */
- long la_asked; /* last time we QUERIED for this addr */
-#define la_timer la_rt->rt_rmx.rmx_expire /* deletion time in seconds */
-};
-
-static LIST_HEAD(, llinfo_arp) llinfo_arp;
-
-struct ifqueue arpintrq = {0, 0, 0, 50};
-static int arp_inuse, arp_allocated;
-
-static int arp_maxtries = 5;
-static int useloopback = 1; /* use loopback interface for local traffic */
-static int arp_proxyall = 0;
-
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, maxtries, CTLFLAG_RW,
- &arp_maxtries, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, useloopback, CTLFLAG_RW,
- &useloopback, 0, "");
-SYSCTL_INT(_net_link_ether_inet, OID_AUTO, proxyall, CTLFLAG_RW,
- &arp_proxyall, 0, "");
-
-static void arp_rtrequest __P((int, struct rtentry *, struct sockaddr *));
-static void arprequest __P((struct arpcom *, u_long *, u_long *, u_char *));
-void arpintr __P((void));
-static void arptfree __P((struct llinfo_arp *));
-static void arptimer __P((void *));
-static struct llinfo_arp
- *arplookup __P((u_long, int, int));
-static void in_arpinput __P((struct mbuf *));
-
-/*
- * Timeout routine. Age arp_tab entries periodically.
- */
-/* ARGSUSED */
-static void
-arptimer(ignored_arg)
- void *ignored_arg;
-{
- int s = splnet();
- register struct llinfo_arp *la = llinfo_arp.lh_first;
- struct llinfo_arp *ola;
-
- timeout(arptimer, (caddr_t)0, arpt_prune * hz);
- while ((ola = la) != 0) {
- register struct rtentry *rt = la->la_rt;
- la = la->la_le.le_next;
- if (rt->rt_expire && rt->rt_expire <= rtems_bsdnet_seconds_since_boot())
- arptfree(ola); /* timer has expired, clear */
- }
- splx(s);
-}
-
-/*
- * Parallel to llc_rtrequest.
- */
-static void
-arp_rtrequest(req, rt, sa)
- int req;
- register struct rtentry *rt;
- struct sockaddr *sa;
-{
- register struct sockaddr *gate = rt->rt_gateway;
- register struct llinfo_arp *la = (struct llinfo_arp *)rt->rt_llinfo;
- static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK};
- static int arpinit_done;
-
- if (!arpinit_done) {
- arpinit_done = 1;
- LIST_INIT(&llinfo_arp);
- timeout(arptimer, (caddr_t)0, hz);
- }
- if (rt->rt_flags & RTF_GATEWAY)
- return;
- switch (req) {
-
- case RTM_ADD:
- /*
- * XXX: If this is a manually added route to interface
- * such as older version of routed or gated might provide,
- * restore cloning bit.
- */
- if ((rt->rt_flags & RTF_HOST) == 0 &&
- SIN(rt_mask(rt))->sin_addr.s_addr != 0xffffffff)
- rt->rt_flags |= RTF_CLONING;
- if (rt->rt_flags & RTF_CLONING) {
- /*
- * Case 1: This route should come from a route to iface.
- */
- rt_setgate(rt, rt_key(rt),
- (struct sockaddr *)&null_sdl);
- gate = rt->rt_gateway;
- SDL(gate)->sdl_type = rt->rt_ifp->if_type;
- SDL(gate)->sdl_index = rt->rt_ifp->if_index;
- rt->rt_expire = rtems_bsdnet_seconds_since_boot();
- break;
- }
- /* Announce a new entry if requested. */
- if (rt->rt_flags & RTF_ANNOUNCE)
- arprequest((struct arpcom *)rt->rt_ifp,
- &SIN(rt_key(rt))->sin_addr.s_addr,
- &SIN(rt_key(rt))->sin_addr.s_addr,
- (u_char *)LLADDR(SDL(gate)));
- /*FALLTHROUGH*/
- case RTM_RESOLVE:
- if (gate->sa_family != AF_LINK ||
- gate->sa_len < sizeof(null_sdl)) {
- log(LOG_DEBUG, "arp_rtrequest: bad gateway value\n");
- break;
- }
- SDL(gate)->sdl_type = rt->rt_ifp->if_type;
- SDL(gate)->sdl_index = rt->rt_ifp->if_index;
- if (la != 0)
- break; /* This happens on a route change */
- /*
- * Case 2: This route may come from cloning, or a manual route
- * add with a LL address.
- */
- R_Malloc(la, struct llinfo_arp *, sizeof(*la));
- rt->rt_llinfo = (caddr_t)la;
- if (la == 0) {
- log(LOG_DEBUG, "arp_rtrequest: malloc failed\n");
- break;
- }
- arp_inuse++, arp_allocated++;
- Bzero(la, sizeof(*la));
- la->la_rt = rt;
- rt->rt_flags |= RTF_LLINFO;
- LIST_INSERT_HEAD(&llinfo_arp, la, la_le);
-
- /*
- * This keeps the multicast addresses from showing up
- * in `arp -a' listings as unresolved. It's not actually
- * functional. Then the same for broadcast.
- */
- if (IN_MULTICAST(ntohl(SIN(rt_key(rt))->sin_addr.s_addr))) {
- ETHER_MAP_IP_MULTICAST(&SIN(rt_key(rt))->sin_addr,
- LLADDR(SDL(gate)));
- SDL(gate)->sdl_alen = 6;
- rt->rt_expire = 0;
- }
- if (in_broadcast(SIN(rt_key(rt))->sin_addr, rt->rt_ifp)) {
- memcpy(LLADDR(SDL(gate)), etherbroadcastaddr, 6);
- SDL(gate)->sdl_alen = 6;
- rt->rt_expire = 0;
- }
-
- if (SIN(rt_key(rt))->sin_addr.s_addr ==
- (IA_SIN(rt->rt_ifa))->sin_addr.s_addr) {
- /*
- * This test used to be
- * if (loif.if_flags & IFF_UP)
- * It allowed local traffic to be forced
- * through the hardware by configuring the loopback down.
- * However, it causes problems during network configuration
- * for boards that can't receive packets they send.
- * It is now necessary to clear "useloopback" and remove
- * the route to force traffic out to the hardware.
- */
- rt->rt_expire = 0;
- Bcopy(((struct arpcom *)rt->rt_ifp)->ac_enaddr,
- LLADDR(SDL(gate)), SDL(gate)->sdl_alen = 6);
- if (useloopback)
- rt->rt_ifp = loif;
-
- }
- break;
-
- case RTM_DELETE:
- if (la == 0)
- break;
- arp_inuse--;
- LIST_REMOVE(la, la_le);
- rt->rt_llinfo = 0;
- rt->rt_flags &= ~RTF_LLINFO;
- if (la->la_hold)
- m_freem(la->la_hold);
- Free((caddr_t)la);
- }
-}
-
-/*
- * Broadcast an ARP request. Caller specifies:
- * - arp header source ip address
- * - arp header target ip address
- * - arp header source ethernet address
- */
-static void
-arprequest(ac, sip, tip, enaddr)
- register struct arpcom *ac;
- register u_long *sip, *tip;
- register u_char *enaddr;
-{
- register struct mbuf *m;
- register struct ether_header *eh;
- register struct ether_arp *ea;
- struct sockaddr sa;
-
- if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL)
- return;
- m->m_len = sizeof(*ea);
- m->m_pkthdr.len = sizeof(*ea);
- MH_ALIGN(m, sizeof(*ea));
- ea = mtod(m, struct ether_arp *);
- eh = (struct ether_header *)sa.sa_data;
- bzero((caddr_t)ea, sizeof (*ea));
- (void)memcpy(eh->ether_dhost, etherbroadcastaddr, sizeof(eh->ether_dhost));
- eh->ether_type = htons(ETHERTYPE_ARP); /* if_output will not swap */
- ea->arp_hrd = htons(ARPHRD_ETHER);
- ea->arp_pro = htons(ETHERTYPE_IP);
- ea->arp_hln = sizeof(ea->arp_sha); /* hardware address length */
- ea->arp_pln = sizeof(ea->arp_spa); /* protocol address length */
- ea->arp_op = htons(ARPOP_REQUEST);
- (void)memcpy(ea->arp_sha, enaddr, sizeof(ea->arp_sha));
- (void)memcpy(ea->arp_spa, sip, sizeof(ea->arp_spa));
- (void)memcpy(ea->arp_tpa, tip, sizeof(ea->arp_tpa));
- sa.sa_family = AF_UNSPEC;
- sa.sa_len = sizeof(sa);
- (*ac->ac_if.if_output)(&ac->ac_if, m, &sa, (struct rtentry *)0);
-}
-
-/*
- * Resolve an IP address into an ethernet address. If success,
- * desten is filled in. If there is no entry in arptab,
- * set one up and broadcast a request for the IP address.
- * Hold onto this mbuf and resend it once the address
- * is finally resolved. A return value of 1 indicates
- * that desten has been filled in and the packet should be sent
- * normally; a 0 return indicates that the packet has been
- * taken over here, either now or for later transmission.
- */
-int
-arpresolve(ac, rt, m, dst, desten, rt0)
- register struct arpcom *ac;
- register struct rtentry *rt;
- struct mbuf *m;
- register struct sockaddr *dst;
- register u_char *desten;
- struct rtentry *rt0;
-{
- register struct llinfo_arp *la;
- struct sockaddr_dl *sdl;
-
- if (m->m_flags & M_BCAST) { /* broadcast */
- (void)memcpy(desten, etherbroadcastaddr, sizeof(etherbroadcastaddr));
- return (1);
- }
- if (m->m_flags & M_MCAST) { /* multicast */
- ETHER_MAP_IP_MULTICAST(&SIN(dst)->sin_addr, desten);
- return(1);
- }
- if (rt)
- la = (struct llinfo_arp *)rt->rt_llinfo;
- else {
- la = arplookup(SIN(dst)->sin_addr.s_addr, 1, 0);
- if (la)
- rt = la->la_rt;
- }
- if (la == 0 || rt == 0) {
- log(LOG_DEBUG, "arpresolve: can't allocate llinfo for %s\n",
- inet_ntoa(SIN(dst)->sin_addr));
- m_freem(m);
- return (0);
- }
- sdl = SDL(rt->rt_gateway);
- /*
- * Check the address family and length is valid, the address
- * is resolved; otherwise, try to resolve.
- */
- if ((rt->rt_expire == 0 || rt->rt_expire > rtems_bsdnet_seconds_since_boot()) &&
- sdl->sdl_family == AF_LINK && sdl->sdl_alen != 0) {
- bcopy(LLADDR(sdl), desten, sdl->sdl_alen);
- return 1;
- }
- /*
- * There is an arptab entry, but no ethernet address
- * response yet. Replace the held mbuf with this
- * latest one.
- */
- if (la->la_hold)
- m_freem(la->la_hold);
- la->la_hold = m;
- if (rt->rt_expire) {
- rt->rt_flags &= ~RTF_REJECT;
- if (la->la_asked == 0 || rt->rt_expire != rtems_bsdnet_seconds_since_boot()) {
- rt->rt_expire = rtems_bsdnet_seconds_since_boot();
- if (la->la_asked++ < arp_maxtries)
- arprequest(ac,
- &(SIN(rt->rt_ifa->ifa_addr)->sin_addr.s_addr),
- &(SIN(dst)->sin_addr.s_addr),
- ac->ac_enaddr);
- else {
- rt->rt_flags |= RTF_REJECT;
- rt->rt_expire += arpt_down;
- la->la_asked = 0;
- }
-
- }
- }
- return (0);
-}
-
-/*
- * Common length and type checks are done here,
- * then the protocol-specific routine is called.
- */
-void
-arpintr(void)
-{
- register struct mbuf *m;
- register struct arphdr *ar;
- int s;
-
- while (arpintrq.ifq_head) {
- s = splimp();
- IF_DEQUEUE(&arpintrq, m);
- splx(s);
- if (m == 0 || (m->m_flags & M_PKTHDR) == 0)
- panic("arpintr");
- if (m->m_len >= sizeof(struct arphdr) &&
- (ar = mtod(m, struct arphdr *)) &&
- ntohs(ar->ar_hrd) == ARPHRD_ETHER &&
- m->m_len >=
- sizeof(struct arphdr) + 2 * ar->ar_hln + 2 * ar->ar_pln)
-
- switch (ntohs(ar->ar_pro)) {
-
- case ETHERTYPE_IP:
- in_arpinput(m);
- continue;
- }
- m_freem(m);
- }
-}
-
-NETISR_SET(NETISR_ARP, arpintr);
-
-/*
- * ARP for Internet protocols on 10 Mb/s Ethernet.
- * Algorithm is that given in RFC 826.
- * In addition, a sanity check is performed on the sender
- * protocol address, to catch impersonators.
- * We no longer handle negotiations for use of trailer protocol:
- * Formerly, ARP replied for protocol type ETHERTYPE_TRAIL sent
- * along with IP replies if we wanted trailers sent to us,
- * and also sent them in response to IP replies.
- * This allowed either end to announce the desire to receive
- * trailer packets.
- * We no longer reply to requests for ETHERTYPE_TRAIL protocol either,
- * but formerly didn't normally send requests.
- */
-static void
-in_arpinput(m)
- struct mbuf *m;
-{
- register struct ether_arp *ea;
- register struct arpcom *ac = (struct arpcom *)m->m_pkthdr.rcvif;
- struct ether_header *eh;
- register struct llinfo_arp *la = 0;
- register struct rtentry *rt;
- struct in_ifaddr *ia, *maybe_ia = 0;
- struct sockaddr_dl *sdl;
- struct sockaddr sa;
- struct in_addr isaddr, itaddr, myaddr;
- int op;
-
- ea = mtod(m, struct ether_arp *);
- op = ntohs(ea->arp_op);
- (void)memcpy(&isaddr, ea->arp_spa, sizeof (isaddr));
- (void)memcpy(&itaddr, ea->arp_tpa, sizeof (itaddr));
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if (ia->ia_ifp == &ac->ac_if) {
- maybe_ia = ia;
- if ((itaddr.s_addr == ia->ia_addr.sin_addr.s_addr) ||
- (isaddr.s_addr == ia->ia_addr.sin_addr.s_addr))
- break;
- }
- if (maybe_ia == 0) {
- m_freem(m);
- return;
- }
- myaddr = ia ? ia->ia_addr.sin_addr : maybe_ia->ia_addr.sin_addr;
- if (!bcmp((caddr_t)ea->arp_sha, (caddr_t)ac->ac_enaddr,
- sizeof (ea->arp_sha))) {
- m_freem(m); /* it's from me, ignore it. */
- return;
- }
- if (!bcmp((caddr_t)ea->arp_sha, (caddr_t)etherbroadcastaddr,
- sizeof (ea->arp_sha))) {
- log(LOG_ERR,
- "arp: ether address is broadcast for IP address %s!\n",
- inet_ntoa(isaddr));
- m_freem(m);
- return;
- }
- if (isaddr.s_addr == myaddr.s_addr) {
- log(LOG_ERR,
- "arp: %6D is using my IP address %s!\n",
- ea->arp_sha, ":", inet_ntoa(isaddr));
- itaddr = myaddr;
- goto reply;
- }
- la = arplookup(isaddr.s_addr, itaddr.s_addr == myaddr.s_addr, 0);
- if (la && (rt = la->la_rt) && (sdl = SDL(rt->rt_gateway))) {
- if (sdl->sdl_alen &&
- bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen))
- log(LOG_INFO, "arp: %s moved from %6D to %6D\n",
- inet_ntoa(isaddr), (u_char *)LLADDR(sdl), ":",
- ea->arp_sha, ":");
- (void)memcpy(LLADDR(sdl), ea->arp_sha, sizeof(ea->arp_sha));
- sdl->sdl_alen = sizeof(ea->arp_sha);
- if (rt->rt_expire)
- rt->rt_expire = rtems_bsdnet_seconds_since_boot() + arpt_keep;
- rt->rt_flags &= ~RTF_REJECT;
- la->la_asked = 0;
- if (la->la_hold) {
- (*ac->ac_if.if_output)(&ac->ac_if, la->la_hold,
- rt_key(rt), rt);
- la->la_hold = 0;
- }
- }
-reply:
- if (op != ARPOP_REQUEST) {
- m_freem(m);
- return;
- }
- if (itaddr.s_addr == myaddr.s_addr) {
- /* I am the target */
- (void)memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha));
- (void)memcpy(ea->arp_sha, ac->ac_enaddr, sizeof(ea->arp_sha));
- } else {
- la = arplookup(itaddr.s_addr, 0, SIN_PROXY);
- if (la == NULL) {
- struct sockaddr_in sin;
-
- if (!arp_proxyall) {
- m_freem(m);
- return;
- }
-
- bzero(&sin, sizeof sin);
- sin.sin_family = AF_INET;
- sin.sin_len = sizeof sin;
- sin.sin_addr = itaddr;
-
- rt = rtalloc1((struct sockaddr *)&sin, 0, 0UL);
- if (!rt) {
- m_freem(m);
- return;
- }
- /*
- * Don't send proxies for nodes on the same interface
- * as this one came out of, or we'll get into a fight
- * over who claims what Ether address.
- */
- if (rt->rt_ifp == &ac->ac_if) {
- rtfree(rt);
- m_freem(m);
- return;
- }
- (void)memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha));
- (void)memcpy(ea->arp_sha, ac->ac_enaddr, sizeof(ea->arp_sha));
- rtfree(rt);
-#ifdef DEBUG_PROXY
- printf("arp: proxying for %s\n",
- inet_ntoa(itaddr));
-#endif
- } else {
- rt = la->la_rt;
- (void)memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha));
- sdl = SDL(rt->rt_gateway);
- (void)memcpy(ea->arp_sha, LLADDR(sdl), sizeof(ea->arp_sha));
- }
- }
-
- (void)memcpy(ea->arp_tpa, ea->arp_spa, sizeof(ea->arp_spa));
- (void)memcpy(ea->arp_spa, &itaddr, sizeof(ea->arp_spa));
- ea->arp_op = htons(ARPOP_REPLY);
- ea->arp_pro = htons(ETHERTYPE_IP); /* let's be sure! */
- eh = (struct ether_header *)sa.sa_data;
- (void)memcpy(eh->ether_dhost, ea->arp_tha, sizeof(eh->ether_dhost));
- eh->ether_type = htons(ETHERTYPE_ARP);
- sa.sa_family = AF_UNSPEC;
- sa.sa_len = sizeof(sa);
- (*ac->ac_if.if_output)(&ac->ac_if, m, &sa, (struct rtentry *)0);
- return;
-}
-
-/*
- * Free an arp entry.
- */
-static void
-arptfree(la)
- register struct llinfo_arp *la;
-{
- register struct rtentry *rt = la->la_rt;
- register struct sockaddr_dl *sdl;
- if (rt == 0)
- panic("arptfree");
- if (rt->rt_refcnt > 0 && (sdl = SDL(rt->rt_gateway)) &&
- sdl->sdl_family == AF_LINK) {
- sdl->sdl_alen = 0;
- la->la_asked = 0;
- rt->rt_flags &= ~RTF_REJECT;
- return;
- }
- rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *)0, rt_mask(rt),
- 0, (struct rtentry **)0);
-}
-/*
- * Lookup or enter a new address in arptab.
- */
-static struct llinfo_arp *
-arplookup(addr, create, proxy)
- u_long addr;
- int create, proxy;
-{
- register struct rtentry *rt;
- static struct sockaddr_inarp sin = {sizeof(sin), AF_INET };
- const char *why = 0;
-
- sin.sin_addr.s_addr = addr;
- sin.sin_other = proxy ? SIN_PROXY : 0;
- rt = rtalloc1((struct sockaddr *)&sin, create, 0UL);
- if (rt == 0)
- return (0);
- rt->rt_refcnt--;
-
- if (rt->rt_flags & RTF_GATEWAY)
- why = "host is not on local network";
- else if ((rt->rt_flags & RTF_LLINFO) == 0)
- why = "could not allocate llinfo";
- else if (rt->rt_gateway->sa_family != AF_LINK)
- why = "gateway route is not ours";
-
- if (why && create) {
- log(LOG_DEBUG, "arplookup %s failed: %s\n",
- inet_ntoa(sin.sin_addr), why);
- return 0;
- } else if (why) {
- return 0;
- }
- return ((struct llinfo_arp *)rt->rt_llinfo);
-}
-
-void
-arp_ifinit(ac, ifa)
- struct arpcom *ac;
- struct ifaddr *ifa;
-{
- if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) != INADDR_ANY)
- arprequest(ac, &(IA_SIN(ifa)->sin_addr.s_addr),
- &(IA_SIN(ifa)->sin_addr.s_addr), ac->ac_enaddr);
- ifa->ifa_rtrequest = arp_rtrequest;
- ifa->ifa_flags |= RTF_CLONING;
-}
diff --git a/cpukit/libnetworking/netinet/if_ether.h b/cpukit/libnetworking/netinet/if_ether.h
deleted file mode 100644
index 22c8e97187..0000000000
--- a/cpukit/libnetworking/netinet/if_ether.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)if_ether.h 8.3 (Berkeley) 5/2/95
- * $Id$
- */
-
-#ifndef _NETINET_IF_ETHER_H_
-#define _NETINET_IF_ETHER_H_
-
-#include <net/ethernet.h>
-
-#define ETHERTYPE_PUP 0x0200 /* PUP protocol */
-#define ETHERTYPE_IP 0x0800 /* IP protocol */
-#define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */
-#define ETHERTYPE_REVARP 0x8035 /* reverse Addr. resolution protocol */
-
-/*
- * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
- * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
- * by an ETHER type (as given above) and then the (variable-length) header.
- */
-#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
-#define ETHERTYPE_NTRAILER 16
-
-#define ETHERMTU (ETHER_MAX_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-#define ETHERMIN (ETHER_MIN_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-
-#ifdef KERNEL
-/*
- * Macro to map an IP multicast address to an Ethernet multicast address.
- * The high-order 25 bits of the Ethernet address are statically assigned,
- * and the low-order 23 bits are taken from the low end of the IP address.
- */
-#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
- /* struct in_addr *ipaddr; */ \
- /* u_char enaddr[ETHER_ADDR_LEN]; */ \
-{ \
- (enaddr)[0] = 0x01; \
- (enaddr)[1] = 0x00; \
- (enaddr)[2] = 0x5e; \
- (enaddr)[3] = ((u_char *)ipaddr)[1] & 0x7f; \
- (enaddr)[4] = ((u_char *)ipaddr)[2]; \
- (enaddr)[5] = ((u_char *)ipaddr)[3]; \
-}
-#endif
-
-/*
- * Ethernet Address Resolution Protocol.
- *
- * See RFC 826 for protocol description. Structure below is adapted
- * to resolving internet addresses. Field names used correspond to
- * RFC 826.
- */
-struct ether_arp {
- struct arphdr ea_hdr; /* fixed-size header */
- u_char arp_sha[ETHER_ADDR_LEN]; /* sender hardware address */
- u_char arp_spa[4]; /* sender protocol address */
- u_char arp_tha[ETHER_ADDR_LEN]; /* target hardware address */
- u_char arp_tpa[4]; /* target protocol address */
-};
-#define arp_hrd ea_hdr.ar_hrd
-#define arp_pro ea_hdr.ar_pro
-#define arp_hln ea_hdr.ar_hln
-#define arp_pln ea_hdr.ar_pln
-#define arp_op ea_hdr.ar_op
-
-
-/*
- * Structure shared between the ethernet driver modules and
- * the address resolution code. For example, each ec_softc or il_softc
- * begins with this structure.
- */
-struct arpcom {
- /*
- * The ifnet struct _must_ be at the head of this structure.
- */
- struct ifnet ac_if; /* network-visible interface */
- u_char ac_enaddr[ETHER_ADDR_LEN]; /* ethernet hardware address */
- struct ether_multi *ac_multiaddrs; /* list of ether multicast addrs */
- int ac_multicnt; /* length of ac_multiaddrs list */
-};
-
-struct sockaddr_inarp {
- u_char sin_len;
- u_char sin_family;
- u_short sin_port;
- struct in_addr sin_addr;
- struct in_addr sin_srcaddr;
- u_short sin_tos;
- u_short sin_other;
-#define SIN_PROXY 1
-};
-/*
- * IP and ethernet specific routing flags
- */
-#define RTF_USETRAILERS RTF_PROTO1 /* use trailers */
-#define RTF_ANNOUNCE RTF_PROTO2 /* announce new arp entry */
-
-#ifdef KERNEL
-extern u_char etherbroadcastaddr[ETHER_ADDR_LEN];
-extern u_char ether_ipmulticast_min[ETHER_ADDR_LEN];
-extern u_char ether_ipmulticast_max[ETHER_ADDR_LEN];
-extern struct ifqueue arpintrq;
-
-int arpresolve __P((struct arpcom *, struct rtentry *, struct mbuf *,
- struct sockaddr *, u_char *, struct rtentry *));
-void arp_ifinit __P((struct arpcom *, struct ifaddr *));
-int ether_addmulti __P((struct ifreq *, struct arpcom *));
-int ether_delmulti __P((struct ifreq *, struct arpcom *));
-
-/*
- * Ethernet multicast address structure. There is one of these for each
- * multicast address or range of multicast addresses that we are supposed
- * to listen to on a particular interface. They are kept in a linked list,
- * rooted in the interface's arpcom structure. (This really has nothing to
- * do with ARP, or with the Internet address family, but this appears to be
- * the minimally-disrupting place to put it.)
- */
-struct ether_multi {
- u_char enm_addrlo[ETHER_ADDR_LEN]; /* low or only address of range */
- u_char enm_addrhi[ETHER_ADDR_LEN]; /* high or only address of range */
- struct arpcom *enm_ac; /* back pointer to arpcom */
- u_int enm_refcount; /* no. claims to this addr/range */
- struct ether_multi *enm_next; /* ptr to next ether_multi */
-};
-
-/*
- * Structure used by macros below to remember position when stepping through
- * all of the ether_multi records.
- */
-struct ether_multistep {
- struct ether_multi *e_enm;
-};
-
-/*
- * Macro for looking up the ether_multi record for a given range of Ethernet
- * multicast addresses connected to a given arpcom structure. If no matching
- * record is found, "enm" returns NULL.
- */
-#define ETHER_LOOKUP_MULTI(addrlo, addrhi, ac, enm) \
- /* u_char addrlo[ETHER_ADDR_LEN]; */ \
- /* u_char addrhi[ETHER_ADDR_LEN]; */ \
- /* struct arpcom *ac; */ \
- /* struct ether_multi *enm; */ \
-{ \
- for ((enm) = (ac)->ac_multiaddrs; \
- (enm) != NULL && \
- (bcmp((enm)->enm_addrlo, (addrlo), ETHER_ADDR_LEN) != 0 || \
- bcmp((enm)->enm_addrhi, (addrhi), ETHER_ADDR_LEN) != 0); \
- (enm) = (enm)->enm_next); \
-}
-
-/*
- * Macro to step through all of the ether_multi records, one at a time.
- * The current position is remembered in "step", which the caller must
- * provide. ETHER_FIRST_MULTI(), below, must be called to initialize "step"
- * and get the first record. Both macros return a NULL "enm" when there
- * are no remaining records.
- */
-#define ETHER_NEXT_MULTI(step, enm) \
- /* struct ether_multistep step; */ \
- /* struct ether_multi *enm; */ \
-{ \
- if (((enm) = (step).e_enm) != NULL) \
- (step).e_enm = (enm)->enm_next; \
-}
-
-#define ETHER_FIRST_MULTI(step, ac, enm) \
- /* struct ether_multistep step; */ \
- /* struct arpcom *ac; */ \
- /* struct ether_multi *enm; */ \
-{ \
- (step).e_enm = (ac)->ac_multiaddrs; \
- ETHER_NEXT_MULTI((step), (enm)); \
-}
-
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/netinet/igmp.c b/cpukit/libnetworking/netinet/igmp.c
deleted file mode 100644
index 2af8b7038e..0000000000
--- a/cpukit/libnetworking/netinet/igmp.c
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * Copyright (c) 1988 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)igmp.c 8.1 (Berkeley) 7/19/93
- * $Id$
- */
-
-/*
- * Internet Group Management Protocol (IGMP) routines.
- *
- * Written by Steve Deering, Stanford, May 1988.
- * Modified by Rosen Sharma, Stanford, Aug 1994.
- * Modified by Bill Fenner, Xerox PARC, Feb 1995.
- * Modified to fully comply to IGMPv2 by Bill Fenner, Oct 1995.
- *
- * MULTICAST Revision: 3.5.1.4
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/igmp.h>
-#include <netinet/igmp_var.h>
-
-static struct router_info *
- find_rti __P((struct ifnet *ifp));
-
-static struct igmpstat igmpstat;
-
-SYSCTL_STRUCT(_net_inet_igmp, IGMPCTL_STATS, stats, CTLFLAG_RD,
- &igmpstat, igmpstat, "");
-
-static int igmp_timers_are_running;
-static u_long igmp_all_hosts_group;
-static u_long igmp_all_rtrs_group;
-static struct mbuf *router_alert;
-static struct router_info *Head;
-
-static void igmp_sendpkt(struct in_multi *, int, unsigned long);
-
-void
-igmp_init()
-{
- struct ipoption *ra;
-
- /*
- * To avoid byte-swapping the same value over and over again.
- */
- igmp_all_hosts_group = htonl(INADDR_ALLHOSTS_GROUP);
- igmp_all_rtrs_group = htonl(INADDR_ALLRTRS_GROUP);
-
- igmp_timers_are_running = 0;
-
- /*
- * Construct a Router Alert option to use in outgoing packets
- */
- MGET(router_alert, M_DONTWAIT, MT_DATA);
- ra = mtod(router_alert, struct ipoption *);
- ra->ipopt_dst.s_addr = 0;
- ra->ipopt_list[0] = IPOPT_RA; /* Router Alert Option */
- ra->ipopt_list[1] = 0x04; /* 4 bytes long */
- ra->ipopt_list[2] = 0x00;
- ra->ipopt_list[3] = 0x00;
- router_alert->m_len = sizeof(ra->ipopt_dst) + ra->ipopt_list[1];
-
- Head = (struct router_info *) 0;
-}
-
-static struct router_info *
-find_rti(ifp)
- struct ifnet *ifp;
-{
- register struct router_info *rti = Head;
-
-#ifdef IGMP_DEBUG
- printf("[igmp.c, _find_rti] --> entering \n");
-#endif
- while (rti) {
- if (rti->rti_ifp == ifp) {
-#ifdef IGMP_DEBUG
- printf("[igmp.c, _find_rti] --> found old entry \n");
-#endif
- return rti;
- }
- rti = rti->rti_next;
- }
- MALLOC(rti, struct router_info *, sizeof *rti, M_MRTABLE, M_NOWAIT);
- rti->rti_ifp = ifp;
- rti->rti_type = IGMP_V2_ROUTER;
- rti->rti_time = 0;
- rti->rti_next = Head;
- Head = rti;
-#ifdef IGMP_DEBUG
- printf("[igmp.c, _find_rti] --> created an entry \n");
-#endif
- return rti;
-}
-
-void
-igmp_input(m, iphlen)
- register struct mbuf *m;
- register int iphlen;
-{
- register struct igmp *igmp;
- register struct ip *ip;
- register int igmplen;
- register struct ifnet *ifp = m->m_pkthdr.rcvif;
- register int minlen;
- register struct in_multi *inm;
- register struct in_ifaddr *ia;
- struct in_multistep step;
- struct router_info *rti;
-
- int timer; /** timer value in the igmp query header **/
-
- ++igmpstat.igps_rcv_total;
-
- ip = mtod(m, struct ip *);
- igmplen = ip->ip_len;
-
- /*
- * Validate lengths
- */
- if (igmplen < IGMP_MINLEN) {
- ++igmpstat.igps_rcv_tooshort;
- m_freem(m);
- return;
- }
- minlen = iphlen + IGMP_MINLEN;
- if ((m->m_flags & M_EXT || m->m_len < minlen) &&
- (m = m_pullup(m, minlen)) == 0) {
- ++igmpstat.igps_rcv_tooshort;
- return;
- }
-
- /*
- * Validate checksum
- */
- m->m_data += iphlen;
- m->m_len -= iphlen;
- igmp = mtod(m, struct igmp *);
- if (in_cksum(m, igmplen)) {
- ++igmpstat.igps_rcv_badsum;
- m_freem(m);
- return;
- }
- m->m_data -= iphlen;
- m->m_len += iphlen;
-
- ip = mtod(m, struct ip *);
- timer = igmp->igmp_code * PR_FASTHZ / IGMP_TIMER_SCALE;
- rti = find_rti(ifp);
-
- /*
- * In the IGMPv2 specification, there are 3 states and a flag.
- *
- * In Non-Member state, we simply don't have a membership record.
- * In Delaying Member state, our timer is running (inm->inm_timer)
- * In Idle Member state, our timer is not running (inm->inm_timer==0)
- *
- * The flag is inm->inm_state, it is set to IGMP_OTHERMEMBER if
- * we have heard a report from another member, or IGMP_IREPORTEDLAST
- * if I sent the last report.
- */
- switch (igmp->igmp_type) {
-
- case IGMP_MEMBERSHIP_QUERY:
- ++igmpstat.igps_rcv_queries;
-
- if (ifp->if_flags & IFF_LOOPBACK)
- break;
-
- if (igmp->igmp_code == 0) {
- /*
- * Old router. Remember that the querier on this
- * interface is old, and set the timer to the
- * value in RFC 1112.
- */
-
- rti->rti_type = IGMP_V1_ROUTER;
- rti->rti_time = 0;
-
- timer = IGMP_MAX_HOST_REPORT_DELAY * PR_FASTHZ;
-
- if (ip->ip_dst.s_addr != igmp_all_hosts_group ||
- igmp->igmp_group.s_addr != 0) {
- ++igmpstat.igps_rcv_badqueries;
- m_freem(m);
- return;
- }
- } else {
- /*
- * New router. Simply do the new validity check.
- */
-
- if (igmp->igmp_group.s_addr != 0 &&
- !IN_MULTICAST(ntohl(igmp->igmp_group.s_addr))) {
- ++igmpstat.igps_rcv_badqueries;
- m_freem(m);
- return;
- }
- }
-
- /*
- * - Start the timers in all of our membership records
- * that the query applies to for the interface on
- * which the query arrived excl. those that belong
- * to the "all-hosts" group (224.0.0.1).
- * - Restart any timer that is already running but has
- * a value longer than the requested timeout.
- * - Use the value specified in the query message as
- * the maximum timeout.
- */
- IN_FIRST_MULTI(step, inm);
- while (inm != NULL) {
- if (inm->inm_ifp == ifp &&
- inm->inm_addr.s_addr != igmp_all_hosts_group &&
- (igmp->igmp_group.s_addr == 0 ||
- igmp->igmp_group.s_addr == inm->inm_addr.s_addr)) {
- if (inm->inm_timer == 0 ||
- inm->inm_timer > timer) {
- inm->inm_timer =
- IGMP_RANDOM_DELAY(timer);
- igmp_timers_are_running = 1;
- }
- }
- IN_NEXT_MULTI(step, inm);
- }
-
- break;
-
- case IGMP_V1_MEMBERSHIP_REPORT:
- case IGMP_V2_MEMBERSHIP_REPORT:
- /*
- * For fast leave to work, we have to know that we are the
- * last person to send a report for this group. Reports
- * can potentially get looped back if we are a multicast
- * router, so discard reports sourced by me.
- */
- IFP_TO_IA(ifp, ia);
- if (ia && ip->ip_src.s_addr == IA_SIN(ia)->sin_addr.s_addr)
- break;
-
- ++igmpstat.igps_rcv_reports;
-
- if (ifp->if_flags & IFF_LOOPBACK)
- break;
-
- if (!IN_MULTICAST(ntohl(igmp->igmp_group.s_addr))) {
- ++igmpstat.igps_rcv_badreports;
- m_freem(m);
- return;
- }
-
- /*
- * KLUDGE: if the IP source address of the report has an
- * unspecified (i.e., zero) subnet number, as is allowed for
- * a booting host, replace it with the correct subnet number
- * so that a process-level multicast routing demon can
- * determine which subnet it arrived from. This is necessary
- * to compensate for the lack of any way for a process to
- * determine the arrival interface of an incoming packet.
- */
- if ((ntohl(ip->ip_src.s_addr) & IN_CLASSA_NET) == 0)
- if (ia) ip->ip_src.s_addr = htonl(ia->ia_subnet);
-
- /*
- * If we belong to the group being reported, stop
- * our timer for that group.
- */
- IN_LOOKUP_MULTI(igmp->igmp_group, ifp, inm);
-
- if (inm != NULL) {
- inm->inm_timer = 0;
- ++igmpstat.igps_rcv_ourreports;
-
- inm->inm_state = IGMP_OTHERMEMBER;
- }
-
- break;
- }
-
- /*
- * Pass all valid IGMP packets up to any process(es) listening
- * on a raw IGMP socket.
- */
- rip_input(m, iphlen);
-}
-
-void
-igmp_joingroup(inm)
- struct in_multi *inm;
-{
- int s = splnet();
-
- if (inm->inm_addr.s_addr == igmp_all_hosts_group
- || inm->inm_ifp->if_flags & IFF_LOOPBACK) {
- inm->inm_timer = 0;
- inm->inm_state = IGMP_OTHERMEMBER;
- } else {
- inm->inm_rti = find_rti(inm->inm_ifp);
- igmp_sendpkt(inm, inm->inm_rti->rti_type, 0);
- inm->inm_timer = IGMP_RANDOM_DELAY(
- IGMP_MAX_HOST_REPORT_DELAY*PR_FASTHZ);
- inm->inm_state = IGMP_IREPORTEDLAST;
- igmp_timers_are_running = 1;
- }
- splx(s);
-}
-
-void
-igmp_leavegroup(inm)
- struct in_multi *inm;
-{
- if (inm->inm_state == IGMP_IREPORTEDLAST &&
- inm->inm_addr.s_addr != igmp_all_hosts_group &&
- !(inm->inm_ifp->if_flags & IFF_LOOPBACK) &&
- inm->inm_rti->rti_type != IGMP_V1_ROUTER)
- igmp_sendpkt(inm, IGMP_V2_LEAVE_GROUP, igmp_all_rtrs_group);
-}
-
-void
-igmp_fasttimo()
-{
- register struct in_multi *inm;
- struct in_multistep step;
- int s;
-
- /*
- * Quick check to see if any work needs to be done, in order
- * to minimize the overhead of fasttimo processing.
- */
-
- if (!igmp_timers_are_running)
- return;
-
- s = splnet();
- igmp_timers_are_running = 0;
- IN_FIRST_MULTI(step, inm);
- while (inm != NULL) {
- if (inm->inm_timer == 0) {
- /* do nothing */
- } else if (--inm->inm_timer == 0) {
- igmp_sendpkt(inm, inm->inm_rti->rti_type, 0);
- inm->inm_state = IGMP_IREPORTEDLAST;
- } else {
- igmp_timers_are_running = 1;
- }
- IN_NEXT_MULTI(step, inm);
- }
- splx(s);
-}
-
-void
-igmp_slowtimo()
-{
- int s = splnet();
- register struct router_info *rti = Head;
-
-#ifdef IGMP_DEBUG
- printf("[igmp.c,_slowtimo] -- > entering \n");
-#endif
- while (rti) {
- if (rti->rti_type == IGMP_V1_ROUTER) {
- rti->rti_time++;
- if (rti->rti_time >= IGMP_AGE_THRESHOLD) {
- rti->rti_type = IGMP_V2_ROUTER;
- }
- }
- rti = rti->rti_next;
- }
-#ifdef IGMP_DEBUG
- printf("[igmp.c,_slowtimo] -- > exiting \n");
-#endif
- splx(s);
-}
-
-static struct route igmprt;
-
-static void
-igmp_sendpkt(inm, type, addr)
- struct in_multi *inm;
- int type;
- unsigned long addr;
-{
- struct mbuf *m;
- struct igmp *igmp;
- struct ip *ip;
- struct ip_moptions imo;
-
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- return;
-
- m->m_pkthdr.rcvif = loif;
- m->m_pkthdr.len = sizeof(struct ip) + IGMP_MINLEN;
- MH_ALIGN(m, IGMP_MINLEN + sizeof(struct ip));
- m->m_data += sizeof(struct ip);
- m->m_len = IGMP_MINLEN;
- igmp = mtod(m, struct igmp *);
- igmp->igmp_type = type;
- igmp->igmp_code = 0;
- igmp->igmp_group = inm->inm_addr;
- igmp->igmp_cksum = 0;
- igmp->igmp_cksum = in_cksum(m, IGMP_MINLEN);
-
- m->m_data -= sizeof(struct ip);
- m->m_len += sizeof(struct ip);
- ip = mtod(m, struct ip *);
- ip->ip_tos = 0;
- ip->ip_len = sizeof(struct ip) + IGMP_MINLEN;
- ip->ip_off = 0;
- ip->ip_p = IPPROTO_IGMP;
- ip->ip_src.s_addr = INADDR_ANY;
- ip->ip_dst.s_addr = addr ? addr : igmp->igmp_group.s_addr;
-
- imo.imo_multicast_ifp = inm->inm_ifp;
- imo.imo_multicast_ttl = 1;
- imo.imo_multicast_vif = -1;
- /*
- * Request loopback of the report if we are acting as a multicast
- * router, so that the process-level routing demon can hear it.
- */
- imo.imo_multicast_loop = (ip_mrouter != NULL);
-
- /*
- * XXX
- * Do we have to worry about reentrancy here? Don't think so.
- */
- ip_output(m, router_alert, &igmprt, 0, &imo);
-
- ++igmpstat.igps_snd_reports;
-}
diff --git a/cpukit/libnetworking/netinet/igmp.h b/cpukit/libnetworking/netinet/igmp.h
deleted file mode 100644
index 01d6d09179..0000000000
--- a/cpukit/libnetworking/netinet/igmp.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 1988 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)igmp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IGMP_H_
-#define _NETINET_IGMP_H_
-
-/*
- * Internet Group Management Protocol (IGMP) definitions.
- *
- * Written by Steve Deering, Stanford, May 1988.
- *
- * MULTICAST Revision: 3.5.1.2
- */
-
-/*
- * IGMP packet format.
- */
-struct igmp {
- u_char igmp_type; /* version & type of IGMP message */
- u_char igmp_code; /* subtype for routing msgs */
- u_short igmp_cksum; /* IP-style checksum */
- struct in_addr igmp_group; /* group address being reported */
-}; /* (zero for queries) */
-
-#define IGMP_MINLEN 8
-
-/*
- * Message types, including version number.
- */
-#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */
-#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */
-#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */
-#define IGMP_V2_LEAVE_GROUP 0x17 /* Leave-group message */
-
-#define IGMP_DVMRP 0x13 /* DVMRP routing message */
-#define IGMP_PIM 0x14 /* PIM routing message */
-
-#define IGMP_MTRACE_RESP 0x1e /* traceroute resp.(to sender)*/
-#define IGMP_MTRACE 0x1f /* mcast traceroute messages */
-
-#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
- /* query (in seconds) according */
- /* to RFC1112 */
-
-
-#define IGMP_TIMER_SCALE 10 /* denotes that the igmp code field */
- /* specifies time in 10th of seconds*/
-
-/*
- * The following four defininitions are for backwards compatibility.
- * They should be removed as soon as all applications are updated to
- * use the new constant names.
- */
-#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
-#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
-#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
-#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
-
-#endif /* _NETINET_IGMP_H_ */
diff --git a/cpukit/libnetworking/netinet/igmp_var.h b/cpukit/libnetworking/netinet/igmp_var.h
deleted file mode 100644
index f408bf2bc1..0000000000
--- a/cpukit/libnetworking/netinet/igmp_var.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 1988 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)igmp_var.h 8.1 (Berkeley) 7/19/93
- * $Id$
- */
-
-#ifndef _NETINET_IGMP_VAR_H_
-#define _NETINET_IGMP_VAR_H_
-
-/*
- * Internet Group Management Protocol (IGMP),
- * implementation-specific definitions.
- *
- * Written by Steve Deering, Stanford, May 1988.
- *
- * MULTICAST Revision: 3.5.1.3
- */
-
-struct igmpstat {
- u_int igps_rcv_total; /* total IGMP messages received */
- u_int igps_rcv_tooshort; /* received with too few bytes */
- u_int igps_rcv_badsum; /* received with bad checksum */
- u_int igps_rcv_queries; /* received membership queries */
- u_int igps_rcv_badqueries; /* received invalid queries */
- u_int igps_rcv_reports; /* received membership reports */
- u_int igps_rcv_badreports; /* received invalid reports */
- u_int igps_rcv_ourreports; /* received reports for our groups */
- u_int igps_snd_reports; /* sent membership reports */
-};
-
-#ifdef KERNEL
-extern struct igmpstat igmpstat;
-
-#define IGMP_RANDOM_DELAY(X) (random() % (X) + 1)
-
-/*
- * States for IGMPv2's leave processing
- */
-#define IGMP_OTHERMEMBER 0
-#define IGMP_IREPORTEDLAST 1
-
-/*
- * We must remember what version the subnet's querier is.
- * We conveniently use the IGMP message type for the proper
- * membership report to keep this state.
- */
-#define IGMP_V1_ROUTER IGMP_V1_MEMBERSHIP_REPORT
-#define IGMP_V2_ROUTER IGMP_V2_MEMBERSHIP_REPORT
-
-/*
- * Revert to new router if we haven't heard from an old router in
- * this amount of time.
- */
-#define IGMP_AGE_THRESHOLD 540
-
-void igmp_init __P((void));
-void igmp_input __P((struct mbuf *, int));
-void igmp_joingroup __P((struct in_multi *));
-void igmp_leavegroup __P((struct in_multi *));
-void igmp_fasttimo __P((void));
-void igmp_slowtimo __P((void));
-#endif
-
-/*
- * Names for IGMP sysctl objects
- */
-#define IGMPCTL_STATS 1 /* statistics (read-only) */
-#define IGMPCTL_MAXID 2
-
-#define IGMPCTL_NAMES { \
- { 0, 0 }, \
- { "stats", CTLTYPE_STRUCT }, \
-}
-
-#endif
-
-
diff --git a/cpukit/libnetworking/netinet/in.c b/cpukit/libnetworking/netinet/in.c
deleted file mode 100644
index 701406f207..0000000000
--- a/cpukit/libnetworking/netinet/in.c
+++ /dev/null
@@ -1,728 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1991, 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.c 8.4 (Berkeley) 1/9/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/malloc.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/if_ether.h>
-
-#include <netinet/igmp_var.h>
-
-/*
- * This structure is used to keep track of in_multi chains which belong to
- * deleted interface addresses.
- */
-static LIST_HEAD(, multi_kludge) in_mk; /* XXX BSS initialization */
-
-struct multi_kludge {
- LIST_ENTRY(multi_kludge) mk_entry;
- struct ifnet *mk_ifp;
- struct in_multihead mk_head;
-};
-
-static void in_socktrim __P((struct sockaddr_in *));
-static int in_ifinit __P((struct ifnet *,
- struct in_ifaddr *, struct sockaddr_in *, int));
-static void in_ifscrub __P((struct ifnet *, struct in_ifaddr *));
-
-static int subnetsarelocal = 0;
-SYSCTL_INT(_net_inet_ip, OID_AUTO, subnets_are_local, CTLFLAG_RW,
- &subnetsarelocal, 0, "");
-/*
- * Return 1 if an internet address is for a ``local'' host
- * (one to which we have a connection). If subnetsarelocal
- * is true, this includes other subnets of the local net.
- * Otherwise, it includes only the directly-connected (sub)nets.
- */
-int
-in_localaddr(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
- register struct in_ifaddr *ia;
-
- if (subnetsarelocal) {
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if ((i & ia->ia_netmask) == ia->ia_net)
- return (1);
- } else {
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if ((i & ia->ia_subnetmask) == ia->ia_subnet)
- return (1);
- }
- return (0);
-}
-
-/*
- * Determine whether an IP address is in a reserved set of addresses
- * that may not be forwarded, or whether datagrams to that destination
- * may be forwarded.
- */
-int
-in_canforward(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
- register u_long net;
-
- if (IN_EXPERIMENTAL(i) || IN_MULTICAST(i))
- return (0);
- if (IN_CLASSA(i)) {
- net = i & IN_CLASSA_NET;
- if (net == 0 || net == (IN_LOOPBACKNET << IN_CLASSA_NSHIFT))
- return (0);
- }
- return (1);
-}
-
-/*
- * Trim a mask in a sockaddr
- */
-static void
-in_socktrim(ap)
-struct sockaddr_in *ap;
-{
- register char *cplim = (char *) &ap->sin_addr;
- register char *cp = (char *) (&ap->sin_addr + 1);
-
- ap->sin_len = 0;
- while (--cp >= cplim)
- if (*cp) {
- (ap)->sin_len = cp - (char *) (ap) + 1;
- break;
- }
-}
-
-static int in_interfaces; /* number of external internet interfaces */
-
-/*
- * Generic internet control operations (ioctl's).
- * Ifp is 0 if not an interface-specific ioctl.
- */
-/* ARGSUSED */
-int
-in_control(so, cmd, data, ifp)
- struct socket *so;
- u_long cmd;
- caddr_t data;
- register struct ifnet *ifp;
-{
- register struct ifreq *ifr = (struct ifreq *)data;
- register struct in_ifaddr *ia = 0, *iap;
- register struct ifaddr *ifa;
- struct in_ifaddr *oia;
- struct in_aliasreq *ifra = (struct in_aliasreq *)data;
- struct sockaddr_in oldaddr;
- int error, hostIsNew, maskIsNew, s;
- u_long i;
- struct multi_kludge *mk;
-
- /*
- * Find address for this interface, if it exists.
- *
- * If an alias address was specified, find that one instead of
- * the first one on the interface.
- */
- if (ifp)
- for (iap = in_ifaddr; iap; iap = iap->ia_next)
- if (iap->ia_ifp == ifp) {
- if (((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr.s_addr ==
- iap->ia_addr.sin_addr.s_addr) {
- ia = iap;
- break;
- } else if (ia == NULL) {
- ia = iap;
- if (ifr->ifr_addr.sa_family != AF_INET)
- break;
- }
- }
-
- switch (cmd) {
-
- case SIOCAIFADDR:
- case SIOCDIFADDR:
- if (ifra->ifra_addr.sin_family == AF_INET) {
- for (oia = ia; ia; ia = ia->ia_next) {
- if (ia->ia_ifp == ifp &&
- ia->ia_addr.sin_addr.s_addr ==
- ifra->ifra_addr.sin_addr.s_addr)
- break;
- }
- if ((ifp->if_flags & IFF_POINTOPOINT)
- && (cmd == SIOCAIFADDR)
- && (ifra->ifra_dstaddr.sin_addr.s_addr
- == INADDR_ANY)) {
- return EDESTADDRREQ;
- }
- }
- if (cmd == SIOCDIFADDR && ia == 0)
- return (EADDRNOTAVAIL);
- /* FALLTHROUGH */
- case SIOCSIFADDR:
- case SIOCSIFNETMASK:
- case SIOCSIFDSTADDR:
- if ((so->so_state & SS_PRIV) == 0)
- return (EPERM);
-
- if (ifp == 0)
- panic("in_control");
- if (ia == (struct in_ifaddr *)0) {
- oia = (struct in_ifaddr *)
- malloc(sizeof *oia, M_IFADDR, M_WAITOK);
- if (oia == (struct in_ifaddr *)NULL)
- return (ENOBUFS);
- bzero((caddr_t)oia, sizeof *oia);
- ia = in_ifaddr;
- /*
- * Protect from ipintr() traversing address list
- * while we're modifying it.
- */
- s = splnet();
-
- if (ia) {
- for ( ; ia->ia_next; ia = ia->ia_next)
- continue;
- ia->ia_next = oia;
- } else
- in_ifaddr = oia;
- ia = oia;
- ifa = ifp->if_addrlist;
- if (ifa) {
- for ( ; ifa->ifa_next; ifa = ifa->ifa_next)
- continue;
- ifa->ifa_next = (struct ifaddr *) ia;
- } else
- ifp->if_addrlist = (struct ifaddr *) ia;
- ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr;
- ia->ia_ifa.ifa_dstaddr
- = (struct sockaddr *)&ia->ia_dstaddr;
- ia->ia_ifa.ifa_netmask
- = (struct sockaddr *)&ia->ia_sockmask;
- ia->ia_sockmask.sin_len = 8;
- if (ifp->if_flags & IFF_BROADCAST) {
- ia->ia_broadaddr.sin_len = sizeof(ia->ia_addr);
- ia->ia_broadaddr.sin_family = AF_INET;
- }
- ia->ia_ifp = ifp;
- if (!(ifp->if_flags & IFF_LOOPBACK))
- in_interfaces++;
- splx(s);
- }
- break;
-
- case SIOCSIFBRDADDR:
- if ((so->so_state & SS_PRIV) == 0)
- return (EPERM);
- /* FALLTHROUGH */
-
- case SIOCGIFADDR:
- case SIOCGIFNETMASK:
- case SIOCGIFDSTADDR:
- case SIOCGIFBRDADDR:
- if (ia == (struct in_ifaddr *)0)
- return (EADDRNOTAVAIL);
- break;
- }
- switch (cmd) {
-
- case SIOCGIFADDR:
- *((struct sockaddr_in *)&ifr->ifr_addr) = ia->ia_addr;
- break;
-
- case SIOCGIFBRDADDR:
- if ((ifp->if_flags & IFF_BROADCAST) == 0)
- return (EINVAL);
- *((struct sockaddr_in *)&ifr->ifr_dstaddr) = ia->ia_broadaddr;
- break;
-
- case SIOCGIFDSTADDR:
- if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
- return (EINVAL);
- *((struct sockaddr_in *)&ifr->ifr_dstaddr) = ia->ia_dstaddr;
- break;
-
- case SIOCGIFNETMASK:
- *((struct sockaddr_in *)&ifr->ifr_addr) = ia->ia_sockmask;
- break;
-
- case SIOCSIFDSTADDR:
- if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
- return (EINVAL);
- oldaddr = ia->ia_dstaddr;
- ia->ia_dstaddr = *(struct sockaddr_in *)&ifr->ifr_dstaddr;
- if (ifp->if_ioctl && (error = (*ifp->if_ioctl)
- (ifp, SIOCSIFDSTADDR, (caddr_t)ia))) {
- ia->ia_dstaddr = oldaddr;
- return (error);
- }
- if (ia->ia_flags & IFA_ROUTE) {
- ia->ia_ifa.ifa_dstaddr = (struct sockaddr *)&oldaddr;
- rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST);
- ia->ia_ifa.ifa_dstaddr =
- (struct sockaddr *)&ia->ia_dstaddr;
- rtinit(&(ia->ia_ifa), (int)RTM_ADD, RTF_HOST|RTF_UP);
- }
- break;
-
- case SIOCSIFBRDADDR:
- if ((ifp->if_flags & IFF_BROADCAST) == 0)
- return (EINVAL);
- ia->ia_broadaddr = *(struct sockaddr_in *)&ifr->ifr_broadaddr;
- break;
-
- case SIOCSIFADDR:
- return (in_ifinit(ifp, ia,
- (struct sockaddr_in *) &ifr->ifr_addr, 1));
-
- case SIOCSIFNETMASK:
- i = ifra->ifra_addr.sin_addr.s_addr;
- ia->ia_subnetmask = ntohl(ia->ia_sockmask.sin_addr.s_addr = i);
- break;
-
- case SIOCAIFADDR:
- maskIsNew = 0;
- hostIsNew = 1;
- error = 0;
- if (ia->ia_addr.sin_family == AF_INET) {
- if (ifra->ifra_addr.sin_len == 0) {
- ifra->ifra_addr = ia->ia_addr;
- hostIsNew = 0;
- } else if (ifra->ifra_addr.sin_addr.s_addr ==
- ia->ia_addr.sin_addr.s_addr)
- hostIsNew = 0;
- }
- if (ifra->ifra_mask.sin_len) {
- in_ifscrub(ifp, ia);
- ia->ia_sockmask = ifra->ifra_mask;
- ia->ia_subnetmask =
- ntohl(ia->ia_sockmask.sin_addr.s_addr);
- maskIsNew = 1;
- }
- if ((ifp->if_flags & IFF_POINTOPOINT) &&
- (ifra->ifra_dstaddr.sin_family == AF_INET)) {
- in_ifscrub(ifp, ia);
- ia->ia_dstaddr = ifra->ifra_dstaddr;
- maskIsNew = 1; /* We lie; but the effect's the same */
- }
- if (ifra->ifra_addr.sin_family == AF_INET &&
- (hostIsNew || maskIsNew))
- error = in_ifinit(ifp, ia, &ifra->ifra_addr, 0);
- if ((ifp->if_flags & IFF_BROADCAST) &&
- (ifra->ifra_broadaddr.sin_family == AF_INET))
- ia->ia_broadaddr = ifra->ifra_broadaddr;
- return (error);
-
- case SIOCDIFADDR:
- mk = malloc(sizeof *mk, M_IPMADDR, M_WAITOK);
- if (!mk)
- return ENOBUFS;
-
- in_ifscrub(ifp, ia);
- /*
- * Protect from ipintr() traversing address list
- * while we're modifying it.
- */
- s = splnet();
-
- if ((ifa = ifp->if_addrlist) == (struct ifaddr *)ia)
- ifp->if_addrlist = ifa->ifa_next;
- else {
- while (ifa->ifa_next &&
- (ifa->ifa_next != (struct ifaddr *)ia))
- ifa = ifa->ifa_next;
- if (ifa->ifa_next)
- ifa->ifa_next = ((struct ifaddr *)ia)->ifa_next;
- else
- printf("Couldn't unlink inifaddr from ifp\n");
- }
- oia = ia;
- if (oia == (ia = in_ifaddr))
- in_ifaddr = ia->ia_next;
- else {
- while (ia->ia_next && (ia->ia_next != oia))
- ia = ia->ia_next;
- if (ia->ia_next)
- ia->ia_next = oia->ia_next;
- else
- printf("Didn't unlink inifadr from list\n");
- }
-
- if (!oia->ia_multiaddrs.lh_first) {
- IFAFREE(&oia->ia_ifa);
- FREE(mk, M_IPMADDR);
- splx(s);
- break;
- }
-
- /*
- * Multicast address kludge:
- * If there were any multicast addresses attached to this
- * interface address, either move them to another address
- * on this interface, or save them until such time as this
- * interface is reconfigured for IP.
- */
- IFP_TO_IA(oia->ia_ifp, ia);
- if (ia) { /* there is another address */
- struct in_multi *inm;
- for(inm = oia->ia_multiaddrs.lh_first; inm;
- inm = inm->inm_entry.le_next) {
- IFAFREE(&inm->inm_ia->ia_ifa);
- ia->ia_ifa.ifa_refcnt++;
- inm->inm_ia = ia;
- LIST_INSERT_HEAD(&ia->ia_multiaddrs, inm,
- inm_entry);
- }
- FREE(mk, M_IPMADDR);
- } else { /* last address on this if deleted, save */
- struct in_multi *inm;
-
- LIST_INIT(&mk->mk_head);
- mk->mk_ifp = ifp;
-
- for(inm = oia->ia_multiaddrs.lh_first; inm;
- inm = inm->inm_entry.le_next) {
- LIST_INSERT_HEAD(&mk->mk_head, inm, inm_entry);
- }
-
- if (mk->mk_head.lh_first) {
- LIST_INSERT_HEAD(&in_mk, mk, mk_entry);
- } else {
- FREE(mk, M_IPMADDR);
- }
- }
-
- IFAFREE((&oia->ia_ifa));
- splx(s);
- break;
-
- default:
- if (ifp == 0 || ifp->if_ioctl == 0)
- return (EOPNOTSUPP);
- return ((*ifp->if_ioctl)(ifp, cmd, data));
- }
- return (0);
-}
-
-/*
- * Delete any existing route for an interface.
- */
-static void
-in_ifscrub(ifp, ia)
- register struct ifnet *ifp;
- register struct in_ifaddr *ia;
-{
-
- if ((ia->ia_flags & IFA_ROUTE) == 0)
- return;
- if (ifp->if_flags & (IFF_LOOPBACK|IFF_POINTOPOINT))
- rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST);
- else
- rtinit(&(ia->ia_ifa), (int)RTM_DELETE, 0);
- ia->ia_flags &= ~IFA_ROUTE;
-}
-
-/*
- * Initialize an interface's internet address
- * and routing table entry.
- */
-static int
-in_ifinit(ifp, ia, sin, scrub)
- register struct ifnet *ifp;
- register struct in_ifaddr *ia;
- struct sockaddr_in *sin;
- int scrub;
-{
- register u_long i = ntohl(sin->sin_addr.s_addr);
- struct sockaddr_in oldaddr;
- int s = splimp(), flags = RTF_UP, error;
- struct multi_kludge *mk;
-
- oldaddr = ia->ia_addr;
- ia->ia_addr = *sin;
- /*
- * Give the interface a chance to initialize
- * if this is its first address,
- * and to validate the address if necessary.
- */
- if (ifp->if_ioctl &&
- (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia))) {
- splx(s);
- ia->ia_addr = oldaddr;
- return (error);
- }
- splx(s);
- if (scrub) {
- ia->ia_ifa.ifa_addr = (struct sockaddr *)&oldaddr;
- in_ifscrub(ifp, ia);
- ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr;
- }
- if (IN_CLASSA(i))
- ia->ia_netmask = IN_CLASSA_NET;
- else if (IN_CLASSB(i))
- ia->ia_netmask = IN_CLASSB_NET;
- else
- ia->ia_netmask = IN_CLASSC_NET;
- /*
- * The subnet mask usually includes at least the standard network part,
- * but may may be smaller in the case of supernetting.
- * If it is set, we believe it.
- */
- if (ia->ia_subnetmask == 0) {
- ia->ia_subnetmask = ia->ia_netmask;
- ia->ia_sockmask.sin_addr.s_addr = htonl(ia->ia_subnetmask);
- } else
- ia->ia_netmask &= ia->ia_subnetmask;
- ia->ia_net = i & ia->ia_netmask;
- ia->ia_subnet = i & ia->ia_subnetmask;
- in_socktrim(&ia->ia_sockmask);
- /*
- * Add route for the network.
- */
- ia->ia_ifa.ifa_metric = ifp->if_metric;
- if (ifp->if_flags & IFF_BROADCAST) {
- ia->ia_broadaddr.sin_addr.s_addr =
- htonl(ia->ia_subnet | ~ia->ia_subnetmask);
- ia->ia_netbroadcast.s_addr =
- htonl(ia->ia_net | ~ ia->ia_netmask);
- } else if (ifp->if_flags & IFF_LOOPBACK) {
- ia->ia_ifa.ifa_dstaddr = ia->ia_ifa.ifa_addr;
- flags |= RTF_HOST;
- } else if (ifp->if_flags & IFF_POINTOPOINT) {
- if (ia->ia_dstaddr.sin_family != AF_INET)
- return (0);
- flags |= RTF_HOST;
- }
- if ((error = rtinit(&(ia->ia_ifa), (int)RTM_ADD, flags)) == 0)
- ia->ia_flags |= IFA_ROUTE;
-
- LIST_INIT(&ia->ia_multiaddrs);
- /*
- * If the interface supports multicast, join the "all hosts"
- * multicast group on that interface.
- */
- if (ifp->if_flags & IFF_MULTICAST) {
- struct in_addr addr;
-
- /*
- * Continuation of multicast address hack:
- * If there was a multicast group list previously saved
- * for this interface, then we re-attach it to the first
- * address configured on the i/f.
- */
- for(mk = in_mk.lh_first; mk; mk = mk->mk_entry.le_next) {
- if(mk->mk_ifp == ifp) {
- struct in_multi *inm;
-
- for(inm = mk->mk_head.lh_first; inm;
- inm = inm->inm_entry.le_next) {
- IFAFREE(&inm->inm_ia->ia_ifa);
- ia->ia_ifa.ifa_refcnt++;
- inm->inm_ia = ia;
- LIST_INSERT_HEAD(&ia->ia_multiaddrs,
- inm, inm_entry);
- }
- LIST_REMOVE(mk, mk_entry);
- free(mk, M_IPMADDR);
- break;
- }
- }
-
- addr.s_addr = htonl(INADDR_ALLHOSTS_GROUP);
- in_addmulti(&addr, ifp);
- }
- return (error);
-}
-
-
-/*
- * Return 1 if the address might be a local broadcast address.
- */
-int
-in_broadcast(in, ifp)
- struct in_addr in;
- struct ifnet *ifp;
-{
- register struct ifaddr *ifa;
- u_long t;
-
- if (in.s_addr == INADDR_BROADCAST ||
- in.s_addr == INADDR_ANY)
- return 1;
- if ((ifp->if_flags & IFF_BROADCAST) == 0)
- return 0;
- t = ntohl(in.s_addr);
- /*
- * Look through the list of addresses for a match
- * with a broadcast address.
- */
-#define ia ((struct in_ifaddr *)ifa)
- for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
- if (ifa->ifa_addr->sa_family == AF_INET &&
- (in.s_addr == ia->ia_broadaddr.sin_addr.s_addr ||
- in.s_addr == ia->ia_netbroadcast.s_addr ||
- /*
- * Check for old-style (host 0) broadcast.
- */
- t == ia->ia_subnet || t == ia->ia_net) &&
- /*
- * Check for an all one subnetmask. These
- * only exist when an interface gets a secondary
- * address.
- */
- ia->ia_subnetmask != (u_long)0xffffffff)
- return 1;
- return (0);
-#undef ia
-}
-/*
- * Add an address to the list of IP multicast addresses for a given interface.
- */
-struct in_multi *
-in_addmulti(ap, ifp)
- register struct in_addr *ap;
- register struct ifnet *ifp;
-{
- register struct in_multi *inm;
- struct ifreq ifr;
- struct in_ifaddr *ia;
- int s = splnet();
-
- /*
- * See if address already in list.
- */
- IN_LOOKUP_MULTI(*ap, ifp, inm);
- if (inm != NULL) {
- /*
- * Found it; just increment the reference count.
- */
- ++inm->inm_refcount;
- }
- else {
- /*
- * New address; allocate a new multicast record
- * and link it into the interface's multicast list.
- */
- inm = (struct in_multi *)malloc(sizeof(*inm),
- M_IPMADDR, M_NOWAIT);
- if (inm == NULL) {
- splx(s);
- return (NULL);
- }
- inm->inm_addr = *ap;
- inm->inm_ifp = ifp;
- inm->inm_refcount = 1;
- IFP_TO_IA(ifp, ia);
- if (ia == NULL) {
- free(inm, M_IPMADDR);
- splx(s);
- return (NULL);
- }
- inm->inm_ia = ia;
- ia->ia_ifa.ifa_refcnt++; /* gain a reference */
- LIST_INSERT_HEAD(&ia->ia_multiaddrs, inm, inm_entry);
-
- /*
- * Ask the network driver to update its multicast reception
- * filter appropriately for the new address.
- */
- ((struct sockaddr_in *)&ifr.ifr_addr)->sin_family = AF_INET;
- ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr = *ap;
- if ((ifp->if_ioctl == NULL) ||
- (*ifp->if_ioctl)(ifp, SIOCADDMULTI,(caddr_t)&ifr) != 0) {
- LIST_REMOVE(inm, inm_entry);
- IFAFREE(&ia->ia_ifa); /* release reference */
- free(inm, M_IPMADDR);
- splx(s);
- return (NULL);
- }
- /*
- * Let IGMP know that we have joined a new IP multicast group.
- */
- igmp_joingroup(inm);
- }
- splx(s);
- return (inm);
-}
-
-/*
- * Delete a multicast address record.
- */
-void
-in_delmulti(inm)
- register struct in_multi *inm;
-{
- struct ifreq ifr;
- int s = splnet();
-
- if (--inm->inm_refcount == 0) {
- /*
- * No remaining claims to this record; let IGMP know that
- * we are leaving the multicast group.
- */
- igmp_leavegroup(inm);
- /*
- * Unlink from list.
- */
- LIST_REMOVE(inm, inm_entry);
- IFAFREE(&inm->inm_ia->ia_ifa); /* release reference */
-
- /*
- * Notify the network driver to update its multicast reception
- * filter.
- */
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr =
- inm->inm_addr;
- (*inm->inm_ifp->if_ioctl)(inm->inm_ifp, SIOCDELMULTI,
- (caddr_t)&ifr);
- free(inm, M_IPMADDR);
- }
- splx(s);
-}
diff --git a/cpukit/libnetworking/netinet/in.h b/cpukit/libnetworking/netinet/in.h
deleted file mode 100644
index ba3cbb21cc..0000000000
--- a/cpukit/libnetworking/netinet/in.h
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1990, 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.h 8.3 (Berkeley) 1/3/94
- * $Id$
- */
-
-#ifndef _NETINET_IN_H_
-#define _NETINET_IN_H_
-
-/*
- * Constants and structures defined by the internet system,
- * Per RFC 790, September 1981, and numerous additions.
- */
-
-/*
- * Protocols (RFC 1700)
- */
-#define IPPROTO_IP 0 /* dummy for IP */
-#define IPPROTO_ICMP 1 /* control message protocol */
-#define IPPROTO_IGMP 2 /* group mgmt protocol */
-#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
-#define IPPROTO_IPIP 4 /* IP encapsulation in IP */
-#define IPPROTO_TCP 6 /* tcp */
-#define IPPROTO_ST 7 /* Stream protocol II */
-#define IPPROTO_EGP 8 /* exterior gateway protocol */
-#define IPPROTO_PIGP 9 /* private interior gateway */
-#define IPPROTO_RCCMON 10 /* BBN RCC Monitoring */
-#define IPPROTO_NVPII 11 /* network voice protocol*/
-#define IPPROTO_PUP 12 /* pup */
-#define IPPROTO_ARGUS 13 /* Argus */
-#define IPPROTO_EMCON 14 /* EMCON */
-#define IPPROTO_XNET 15 /* Cross Net Debugger */
-#define IPPROTO_CHAOS 16 /* Chaos*/
-#define IPPROTO_UDP 17 /* user datagram protocol */
-#define IPPROTO_MUX 18 /* Multiplexing */
-#define IPPROTO_MEAS 19 /* DCN Measurement Subsystems */
-#define IPPROTO_HMP 20 /* Host Monitoring */
-#define IPPROTO_PRM 21 /* Packet Radio Measurement */
-#define IPPROTO_IDP 22 /* xns idp */
-#define IPPROTO_TRUNK1 23 /* Trunk-1 */
-#define IPPROTO_TRUNK2 24 /* Trunk-2 */
-#define IPPROTO_LEAF1 25 /* Leaf-1 */
-#define IPPROTO_LEAF2 26 /* Leaf-2 */
-#define IPPROTO_RDP 27 /* Reliable Data */
-#define IPPROTO_IRTP 28 /* Reliable Transaction */
-#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */
-#define IPPROTO_BLT 30 /* Bulk Data Transfer */
-#define IPPROTO_NSP 31 /* Network Services */
-#define IPPROTO_INP 32 /* Merit Internodal */
-#define IPPROTO_SEP 33 /* Sequential Exchange */
-#define IPPROTO_3PC 34 /* Third Party Connect */
-#define IPPROTO_IDPR 35 /* InterDomain Policy Routing */
-#define IPPROTO_XTP 36 /* XTP */
-#define IPPROTO_DDP 37 /* Datagram Delivery */
-#define IPPROTO_CMTP 38 /* Control Message Transport */
-#define IPPROTO_TPXX 39 /* TP++ Transport */
-#define IPPROTO_IL 40 /* IL transport protocol */
-#define IPPROTO_SIP 41 /* Simple Internet Protocol */
-#define IPPROTO_SDRP 42 /* Source Demand Routing */
-#define IPPROTO_SIPSR 43 /* SIP Source Route */
-#define IPPROTO_SIPFRAG 44 /* SIP Fragment */
-#define IPPROTO_IDRP 45 /* InterDomain Routing*/
-#define IPPROTO_RSVP 46 /* resource reservation */
-#define IPPROTO_GRE 47 /* General Routing Encap. */
-#define IPPROTO_MHRP 48 /* Mobile Host Routing */
-#define IPPROTO_BHA 49 /* BHA */
-#define IPPROTO_ESP 50 /* SIPP Encap Sec. Payload */
-#define IPPROTO_AH 51 /* SIPP Auth Header */
-#define IPPROTO_INLSP 52 /* Integ. Net Layer Security */
-#define IPPROTO_SWIPE 53 /* IP with encryption */
-#define IPPROTO_NHRP 54 /* Next Hop Resolution */
-/* 55-60: Unassigned */
-#define IPPROTO_AHIP 61 /* any host internal protocol */
-#define IPPROTO_CFTP 62 /* CFTP */
-#define IPPROTO_HELLO 63 /* "hello" routing protocol */
-#define IPPROTO_SATEXPAK 64 /* SATNET/Backroom EXPAK */
-#define IPPROTO_KRYPTOLAN 65 /* Kryptolan */
-#define IPPROTO_RVD 66 /* Remote Virtual Disk */
-#define IPPROTO_IPPC 67 /* Pluribus Packet Core */
-#define IPPROTO_ADFS 68 /* Any distributed FS */
-#define IPPROTO_SATMON 69 /* Satnet Monitoring */
-#define IPPROTO_VISA 70 /* VISA Protocol */
-#define IPPROTO_IPCV 71 /* Packet Core Utility */
-#define IPPROTO_CPNX 72 /* Comp. Prot. Net. Executive */
-#define IPPROTO_CPHB 73 /* Comp. Prot. HeartBeat */
-#define IPPROTO_WSN 74 /* Wang Span Network */
-#define IPPROTO_PVP 75 /* Packet Video Protocol */
-#define IPPROTO_BRSATMON 76 /* BackRoom SATNET Monitoring */
-#define IPPROTO_ND 77 /* Sun net disk proto (temp.) */
-#define IPPROTO_WBMON 78 /* WIDEBAND Monitoring */
-#define IPPROTO_WBEXPAK 79 /* WIDEBAND EXPAK */
-#define IPPROTO_EON 80 /* ISO cnlp */
-#define IPPROTO_VMTP 81 /* VMTP */
-#define IPPROTO_SVMTP 82 /* Secure VMTP */
-#define IPPROTO_VINES 83 /* Banyon VINES */
-#define IPPROTO_TTP 84 /* TTP */
-#define IPPROTO_IGP 85 /* NSFNET-IGP */
-#define IPPROTO_DGP 86 /* dissimilar gateway prot. */
-#define IPPROTO_TCF 87 /* TCF */
-#define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */
-#define IPPROTO_OSPFIGP 89 /* OSPFIGP */
-#define IPPROTO_SRPC 90 /* Strite RPC protocol */
-#define IPPROTO_LARP 91 /* Locus Address Resoloution */
-#define IPPROTO_MTP 92 /* Multicast Transport */
-#define IPPROTO_AX25 93 /* AX.25 Frames */
-#define IPPROTO_IPEIP 94 /* IP encapsulated in IP */
-#define IPPROTO_MICP 95 /* Mobile Int.ing control */
-#define IPPROTO_SCCSP 96 /* Semaphore Comm. security */
-#define IPPROTO_ETHERIP 97 /* Ethernet IP encapsulation */
-#define IPPROTO_ENCAP 98 /* encapsulation header */
-#define IPPROTO_APES 99 /* any private encr. scheme */
-#define IPPROTO_GMTP 100 /* GMTP*/
-/* 101-254: Unassigned */
-/* 255: Reserved */
-/* BSD Private, local use, namespace incursion */
-#define IPPROTO_DIVERT 254 /* divert pseudo-protocol */
-#define IPPROTO_RAW 255 /* raw IP packet */
-#define IPPROTO_MAX 256
-
-
-/*
- * Local port number conventions:
- *
- * When a user does a bind(2) or connect(2) with a port number of zero,
- * a non-conflicting local port address is chosen.
- * The default range is IPPORT_RESERVED through
- * IPPORT_USERRESERVED, although that is settable by sysctl.
- *
- * A user may set the IPPROTO_IP option IP_PORTRANGE to change this
- * default assignment range.
- *
- * The value IP_PORTRANGE_DEFAULT causes the default behavior.
- *
- * The value IP_PORTRANGE_HIGH changes the range of candidate port numbers
- * into the "high" range. These are reserved for client outbound connections
- * which do not want to be filtered by any firewalls.
- *
- * The value IP_PORTRANGE_LOW changes the range to the "low" are
- * that is (by convention) restricted to privileged processes. This
- * convention is based on "vouchsafe" principles only. It is only secure
- * if you trust the remote host to restrict these ports.
- *
- * The default range of ports and the high range can be changed by
- * sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto)
- *
- * Changing those values has bad security implications if you are
- * using a a stateless firewall that is allowing packets outside of that
- * range in order to allow transparent outgoing connections.
- *
- * Such a firewall configuration will generally depend on the use of these
- * default values. If you change them, you may find your Security
- * Administrator looking for you with a heavy object.
- */
-
-/*
- * Ports < IPPORT_RESERVED are reserved for
- * privileged processes (e.g. root). (IP_PORTRANGE_LOW)
- * Ports > IPPORT_USERRESERVED are reserved
- * for servers, not necessarily privileged. (IP_PORTRANGE_DEFAULT)
- */
-#define IPPORT_RESERVED 1024
-#define IPPORT_USERRESERVED 5000
-
-/*
- * Default local port range to use by setting IP_PORTRANGE_HIGH
- */
-#define IPPORT_HIFIRSTAUTO 40000
-#define IPPORT_HILASTAUTO 44999
-
-/*
- * Scanning for a free reserved port return a value below IPPORT_RESERVED,
- * but higher than IPPORT_RESERVEDSTART. Traditionally the start value was
- * 512, but that conflicts with some well-known-services that firewalls may
- * have a fit if we use.
- */
-#define IPPORT_RESERVEDSTART 600
-
-/*
- * Internet address (a structure for historical reasons)
- */
-struct in_addr {
- u_long s_addr;
-};
-
-/*
- * Definitions of bits in internet address integers.
- * On subnets, the decomposition of addresses to host and net parts
- * is done according to subnet mask, not the masks here.
- */
-#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0)
-#define IN_CLASSA_NET 0xff000000
-#define IN_CLASSA_NSHIFT 24
-#define IN_CLASSA_HOST 0x00ffffff
-#define IN_CLASSA_MAX 128
-
-#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000)
-#define IN_CLASSB_NET 0xffff0000
-#define IN_CLASSB_NSHIFT 16
-#define IN_CLASSB_HOST 0x0000ffff
-#define IN_CLASSB_MAX 65536
-
-#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000)
-#define IN_CLASSC_NET 0xffffff00
-#define IN_CLASSC_NSHIFT 8
-#define IN_CLASSC_HOST 0x000000ff
-
-#define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000)
-#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */
-#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */
-#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */
-#define IN_MULTICAST(i) IN_CLASSD(i)
-
-#define IN_EXPERIMENTAL(i) (((long)(i) & 0xf0000000) == 0xf0000000)
-#define IN_BADCLASS(i) (((long)(i) & 0xf0000000) == 0xf0000000)
-
-#define INADDR_ANY (u_long)0x00000000
-#define INADDR_BROADCAST (u_long)0xffffffff /* must be masked */
-#ifndef KERNEL
-#define INADDR_NONE 0xffffffff /* -1 return */
-#endif
-
-#define INADDR_UNSPEC_GROUP (u_long)0xe0000000 /* 224.0.0.0 */
-#define INADDR_ALLHOSTS_GROUP (u_long)0xe0000001 /* 224.0.0.1 */
-#define INADDR_ALLRTRS_GROUP (u_long)0xe0000002 /* 224.0.0.2 */
-#define INADDR_MAX_LOCAL_GROUP (u_long)0xe00000ff /* 224.0.0.255 */
-
-#define IN_LOOPBACKNET 127 /* official! */
-
-/*
- * Socket address, internet style.
- */
-struct sockaddr_in {
- u_char sin_len;
- u_char sin_family;
- u_short sin_port;
- struct in_addr sin_addr;
- char sin_zero[8];
-};
-
-/*
- * Structure used to describe IP options.
- * Used to store options internally, to pass them to a process,
- * or to restore options retrieved earlier.
- * The ip_dst is used for the first-hop gateway when using a source route
- * (this gets put into the header proper).
- */
-struct ip_opts {
- struct in_addr ip_dst; /* first hop, 0 w/o src rt */
- char ip_opts[40]; /* actually variable in size */
-};
-
-/*
- * Options for use with [gs]etsockopt at the IP level.
- * First word of comment is data type; bool is stored in int.
- */
-#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */
-#define IP_HDRINCL 2 /* int; header is included with data */
-#define IP_TOS 3 /* int; IP type of service and preced. */
-#define IP_TTL 4 /* int; IP time to live */
-#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */
-#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */
-#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */
-#define IP_RETOPTS 8 /* ip_opts; set/get IP options */
-#define IP_MULTICAST_IF 9 /* u_char; set/get IP multicast i/f */
-#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
-#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */
-#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */
-#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */
-#define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */
-#define IP_RSVP_ON 15 /* enable RSVP in kernel */
-#define IP_RSVP_OFF 16 /* disable RSVP in kernel */
-#define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */
-#define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */
-#define IP_PORTRANGE 19 /* int; range to choose for unspec port */
-#define IP_RECVIF 20 /* bool; receive reception if w/dgram */
-
-#define IP_FW_ADD 50 /* add a firewall rule to chain */
-#define IP_FW_DEL 51 /* delete a firewall rule from chain */
-#define IP_FW_FLUSH 52 /* flush firewall rule chain */
-#define IP_FW_ZERO 53 /* clear single/all firewall counter(s) */
-#define IP_FW_GET 54 /* get entire firewall rule chain */
-#define IP_NAT 55 /* set/get NAT opts */
-
-/*
- * Defaults and limits for options
- */
-#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
-#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
-#define IP_MAX_MEMBERSHIPS 20 /* per socket */
-
-/*
- * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
- */
-struct ip_mreq {
- struct in_addr imr_multiaddr; /* IP multicast address of group */
- struct in_addr imr_interface; /* local IP address of interface */
-};
-
-/*
- * Argument for IP_PORTRANGE:
- * - which range to search when port is unspecified at bind() or connect()
- */
-#define IP_PORTRANGE_DEFAULT 0 /* default range */
-#define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
-#define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
-
-/*
- * Definitions for inet sysctl operations.
- *
- * Third level is protocol number.
- * Fourth level is desired variable within that protocol.
- */
-#define IPPROTO_MAXID (IPPROTO_IDP + 1) /* don't list to IPPROTO_MAX */
-
-#define CTL_IPPROTO_NAMES { \
- { "ip", CTLTYPE_NODE }, \
- { "icmp", CTLTYPE_NODE }, \
- { "igmp", CTLTYPE_NODE }, \
- { "ggp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "tcp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { "egp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "pup", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "udp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "idp", CTLTYPE_NODE }, \
-}
-
-/*
- * Names for IP sysctl objects
- */
-#define IPCTL_FORWARDING 1 /* act as router */
-#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */
-#define IPCTL_DEFTTL 3 /* default TTL */
-#ifdef notyet
-#define IPCTL_DEFMTU 4 /* default MTU */
-#endif
-#define IPCTL_RTEXPIRE 5 /* cloned route expiration time */
-#define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */
-#define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */
-#define IPCTL_SOURCEROUTE 8 /* may perform source routes */
-#define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */
-#define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */
-#define IPCTL_INTRQDROPS 11 /* number of netisr q drops */
-#define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */
-#define IPCTL_MAXID 13
-
-#define IPCTL_NAMES { \
- { 0, 0 }, \
- { "forwarding", CTLTYPE_INT }, \
- { "redirect", CTLTYPE_INT }, \
- { "ttl", CTLTYPE_INT }, \
- { "mtu", CTLTYPE_INT }, \
- { "rtexpire", CTLTYPE_INT }, \
- { "rtminexpire", CTLTYPE_INT }, \
- { "rtmaxcache", CTLTYPE_INT }, \
- { "sourceroute", CTLTYPE_INT }, \
- { "directed-broadcast", CTLTYPE_INT }, \
- { "intr-queue-maxlen", CTLTYPE_INT }, \
- { "intr-queue-drops", CTLTYPE_INT }, \
- { "accept_sourceroute", CTLTYPE_INT }, \
-}
-
-
-#ifdef KERNEL
-struct ifnet; struct mbuf; /* forward declarations for Standard C */
-
-int in_broadcast __P((struct in_addr, struct ifnet *));
-int in_canforward __P((struct in_addr));
-int in_cksum __P((struct mbuf *, int));
-int in_localaddr __P((struct in_addr));
-char *inet_ntoa __P((struct in_addr)); /* in libkern */
-
-/* Firewall hooks */
-struct ip;
-typedef int ip_fw_chk_t __P((struct ip**, int, struct ifnet*, int, struct mbuf**));
-typedef int ip_fw_ctl_t __P((int, struct mbuf**));
-extern ip_fw_chk_t *ip_fw_chk_ptr;
-extern ip_fw_ctl_t *ip_fw_ctl_ptr;
-
-/* IP NAT hooks */
-typedef int ip_nat_t __P((struct ip**, struct mbuf**, struct ifnet*, int));
-typedef int ip_nat_ctl_t __P((int, struct mbuf**));
-extern ip_nat_t *ip_nat_ptr;
-extern ip_nat_ctl_t *ip_nat_ctl_ptr;
-#define IP_NAT_IN 0x00000001
-#define IP_NAT_OUT 0x00000002
-
-#endif /* KERNEL */
-
-#endif
diff --git a/cpukit/libnetworking/netinet/in_cksum.c b/cpukit/libnetworking/netinet/in_cksum.c
deleted file mode 100644
index 9cffad3221..0000000000
--- a/cpukit/libnetworking/netinet/in_cksum.c
+++ /dev/null
@@ -1,166 +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 <sys/param.h>
-#include <sys/mbuf.h>
-
-/*
- * Try to use a CPU specific version, then punt to the portable C one.
- */
-
-#if (defined(__GNUC__) && (defined(__mc68000__) || defined(__m68k__)))
-
-#include "in_cksum_m68k.c"
-
-#elif (defined(__GNUC__) && defined(__i386__))
-
-#include "in_cksum_i386.c"
-
-#else
-
-/*
- * Checksum routine for Internet Protocol family headers (Portable Version).
- *
- * This routine is very heavily used in the network
- * code and should be modified for each CPU to be as fast as possible.
- */
-
-#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
-#define REDUCE \
- {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);}
-
-int
-in_cksum(m, len)
- register struct mbuf *m;
- register int len;
-{
- register u_short *w;
- register int sum = 0;
- register int mlen = 0;
- int byte_swapped = 0;
-
- union {
- char c[2];
- u_short s;
- } s_util;
- union {
- u_short s[2];
- long l;
- } l_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 even boundary.
- */
- if ((1 & (int) w) && (mlen > 0)) {
- REDUCE;
- sum <<= 8;
- s_util.c[0] = *(u_char *)w;
- w = (u_short *)((char *)w + 1);
- mlen--;
- byte_swapped = 1;
- }
- /*
- * Unroll the loop to make overhead from
- * branches &c small.
- */
- while ((mlen -= 32) >= 0) {
- sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
- sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7];
- sum += w[8]; sum += w[9]; sum += w[10]; sum += w[11];
- sum += w[12]; sum += w[13]; sum += w[14]; sum += w[15];
- w += 16;
- }
- mlen += 32;
- while ((mlen -= 8) >= 0) {
- sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
- w += 4;
- }
- mlen += 8;
- if (mlen == 0 && byte_swapped == 0)
- continue;
- REDUCE;
- 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)
- printf("cksum: out of data\n");
- 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);
-}
-#endif
diff --git a/cpukit/libnetworking/netinet/in_cksum_i386.c b/cpukit/libnetworking/netinet/in_cksum_i386.c
deleted file mode 100644
index 2057ab3fd6..0000000000
--- a/cpukit/libnetworking/netinet/in_cksum_i386.c
+++ /dev/null
@@ -1,198 +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$
- */
-
-#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("addl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (w))
-#define ADDC(n) asm("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("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)
- printf("cksum: out of data\n");
- 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_i386.h b/cpukit/libnetworking/netinet/in_cksum_i386.h
deleted file mode 100644
index 2057ab3fd6..0000000000
--- a/cpukit/libnetworking/netinet/in_cksum_i386.h
+++ /dev/null
@@ -1,198 +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$
- */
-
-#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("addl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (w))
-#define ADDC(n) asm("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("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)
- printf("cksum: out of data\n");
- 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.c b/cpukit/libnetworking/netinet/in_cksum_m68k.c
deleted file mode 100644
index 58199c3adf..0000000000
--- a/cpukit/libnetworking/netinet/in_cksum_m68k.c
+++ /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 <sys/param.h>
-#include <sys/mbuf.h>
-
-#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_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 <sys/param.h>
-#include <sys/mbuf.h>
-
-#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_pcb.c b/cpukit/libnetworking/netinet/in_pcb.c
deleted file mode 100644
index 116f70eebf..0000000000
--- a/cpukit/libnetworking/netinet/in_pcb.c
+++ /dev/null
@@ -1,757 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1991, 1993, 1995
- * 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_pcb.c 8.4 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/proc.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-
-struct in_addr zeroin_addr;
-
-static void in_pcbinshash __P((struct inpcb *));
-static void in_rtchange __P((struct inpcb *, int));
-
-/*
- * These configure the range of local port addresses assigned to
- * "unspecified" outgoing connections/packets/whatever.
- */
-static int ipport_lowfirstauto = IPPORT_RESERVED - 1; /* 1023 */
-static int ipport_lowlastauto = IPPORT_RESERVEDSTART; /* 600 */
-static int ipport_firstauto = IPPORT_RESERVED; /* 1024 */
-static int ipport_lastauto = IPPORT_USERRESERVED; /* 5000 */
-static int ipport_hifirstauto = IPPORT_HIFIRSTAUTO; /* 40000 */
-static int ipport_hilastauto = IPPORT_HILASTAUTO; /* 44999 */
-
-#define RANGECHK(var, min, max) \
- if ((var) < (min)) { (var) = (min); } \
- else if ((var) > (max)) { (var) = (max); }
-
-#if 0
-static int
-sysctl_net_ipport_check SYSCTL_HANDLER_ARGS
-{
- int error = sysctl_handle_int(oidp,
- oidp->oid_arg1, oidp->oid_arg2, req);
- if (!error) {
- RANGECHK(ipport_lowfirstauto, 1, IPPORT_RESERVED - 1);
- RANGECHK(ipport_lowlastauto, 1, IPPORT_RESERVED - 1);
- RANGECHK(ipport_firstauto, IPPORT_RESERVED, USHRT_MAX);
- RANGECHK(ipport_lastauto, IPPORT_RESERVED, USHRT_MAX);
- RANGECHK(ipport_hifirstauto, IPPORT_RESERVED, USHRT_MAX);
- RANGECHK(ipport_hilastauto, IPPORT_RESERVED, USHRT_MAX);
- }
- return error;
-}
-#endif
-
-#undef RANGECHK
-
-SYSCTL_NODE(_net_inet_ip, IPPROTO_IP, portrange, CTLFLAG_RW, 0, "IP Ports");
-
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, lowfirst, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_lowfirstauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, lowlast, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_lowlastauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, first, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_firstauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, last, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_lastauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, hifirst, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_hifirstauto, 0, &sysctl_net_ipport_check, "I", "");
-SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, hilast, CTLTYPE_INT|CTLFLAG_RW,
- &ipport_hilastauto, 0, &sysctl_net_ipport_check, "I", "");
-
-int
-in_pcballoc(so, pcbinfo)
- struct socket *so;
- struct inpcbinfo *pcbinfo;
-{
- register struct inpcb *inp;
- int s;
-
- MALLOC(inp, struct inpcb *, sizeof(*inp), M_PCB, M_NOWAIT);
- if (inp == NULL)
- return (ENOBUFS);
- bzero((caddr_t)inp, sizeof(*inp));
- inp->inp_pcbinfo = pcbinfo;
- inp->inp_socket = so;
- s = splnet();
- LIST_INSERT_HEAD(pcbinfo->listhead, inp, inp_list);
- in_pcbinshash(inp);
- splx(s);
- so->so_pcb = (caddr_t)inp;
- return (0);
-}
-
-int
-in_pcbbind(inp, nam)
- register struct inpcb *inp;
- struct mbuf *nam;
-{
- register struct socket *so = inp->inp_socket;
- unsigned short *lastport;
- struct sockaddr_in *sin;
- u_short lport = 0;
- int wild = 0, reuseport = (so->so_options & SO_REUSEPORT);
- int error;
-
- if (in_ifaddr == 0)
- return (EADDRNOTAVAIL);
- if (inp->inp_lport || inp->inp_laddr.s_addr != INADDR_ANY)
- return (EINVAL);
- if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0 &&
- ((so->so_proto->pr_flags & PR_CONNREQUIRED) == 0 ||
- (so->so_options & SO_ACCEPTCONN) == 0))
- wild = 1;
- if (nam) {
- sin = mtod(nam, struct sockaddr_in *);
- if (nam->m_len != sizeof (*sin))
- return (EINVAL);
-#ifdef notdef
- /*
- * We should check the family, but old programs
- * incorrectly fail to initialize it.
- */
- if (sin->sin_family != AF_INET)
- return (EAFNOSUPPORT);
-#endif
- lport = sin->sin_port;
- if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) {
- /*
- * Treat SO_REUSEADDR as SO_REUSEPORT for multicast;
- * allow complete duplication of binding if
- * SO_REUSEPORT is set, or if SO_REUSEADDR is set
- * and a multicast address is bound on both
- * new and duplicated sockets.
- */
- if (so->so_options & SO_REUSEADDR)
- reuseport = SO_REUSEADDR|SO_REUSEPORT;
- } else if (sin->sin_addr.s_addr != INADDR_ANY) {
- sin->sin_port = 0; /* yech... */
- if (ifa_ifwithaddr((struct sockaddr *)sin) == 0)
- return (EADDRNOTAVAIL);
- }
- if (lport) {
- struct inpcb *t;
-
- /* GROSS */
- if (ntohs(lport) < IPPORT_RESERVED &&
- (error = suser(p->p_ucred, &p->p_acflag)))
- return (EACCES);
- if (so->so_uid) {
- t = in_pcblookup(inp->inp_pcbinfo, zeroin_addr,
- 0, sin->sin_addr, lport,
- INPLOOKUP_WILDCARD);
- if (t && (so->so_uid != t->inp_socket->so_uid))
- return (EADDRINUSE);
- }
- t = in_pcblookup(inp->inp_pcbinfo, zeroin_addr, 0,
- sin->sin_addr, lport, wild);
- if (t && (reuseport & t->inp_socket->so_options) == 0)
- return (EADDRINUSE);
- }
- inp->inp_laddr = sin->sin_addr;
- }
- if (lport == 0) {
- ushort first, last;
- int count;
-
- inp->inp_flags |= INP_ANONPORT;
-
- if (inp->inp_flags & INP_HIGHPORT) {
- first = ipport_hifirstauto; /* sysctl */
- last = ipport_hilastauto;
- lastport = &inp->inp_pcbinfo->lasthi;
- } else if (inp->inp_flags & INP_LOWPORT) {
- if ((error = suser(p->p_ucred, &p->p_acflag)))
- return (EACCES);
- first = ipport_lowfirstauto; /* 1023 */
- last = ipport_lowlastauto; /* 600 */
- lastport = &inp->inp_pcbinfo->lastlow;
- } else {
- first = ipport_firstauto; /* sysctl */
- last = ipport_lastauto;
- lastport = &inp->inp_pcbinfo->lastport;
- }
- /*
- * Simple check to ensure all ports are not used up causing
- * a deadlock here.
- *
- * We split the two cases (up and down) so that the direction
- * is not being tested on each round of the loop.
- */
- if (first > last) {
- /*
- * counting down
- */
- count = first - last;
-
- do {
- if (count-- <= 0) /* completely used? */
- return (EADDRNOTAVAIL);
- --*lastport;
- if (*lastport > first || *lastport < last)
- *lastport = first;
- lport = htons(*lastport);
- } while (in_pcblookup(inp->inp_pcbinfo,
- zeroin_addr, 0, inp->inp_laddr, lport, wild));
- } else {
- /*
- * counting up
- */
- count = last - first;
-
- do {
- if (count-- <= 0) /* completely used? */
- return (EADDRNOTAVAIL);
- ++*lastport;
- if (*lastport < first || *lastport > last)
- *lastport = first;
- lport = htons(*lastport);
- } while (in_pcblookup(inp->inp_pcbinfo,
- zeroin_addr, 0, inp->inp_laddr, lport, wild));
- }
- }
- inp->inp_lport = lport;
- in_pcbrehash(inp);
- return (0);
-}
-
-/*
- * Transform old in_pcbconnect() into an inner subroutine for new
- * in_pcbconnect(): Do some validity-checking on the remote
- * address (in mbuf 'nam') and then determine local host address
- * (i.e., which interface) to use to access that remote host.
- *
- * This preserves definition of in_pcbconnect(), while supporting a
- * slightly different version for T/TCP. (This is more than
- * a bit of a kludge, but cleaning up the internal interfaces would
- * have forced minor changes in every protocol).
- */
-
-int
-in_pcbladdr(inp, nam, plocal_sin)
- register struct inpcb *inp;
- struct mbuf *nam;
- struct sockaddr_in **plocal_sin;
-{
- struct in_ifaddr *ia;
- register struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *);
-
- if (nam->m_len != sizeof (*sin))
- return (EINVAL);
- if (sin->sin_family != AF_INET)
- return (EAFNOSUPPORT);
- if (sin->sin_port == 0)
- return (EADDRNOTAVAIL);
- if (in_ifaddr) {
- /*
- * If the destination address is INADDR_ANY,
- * use the primary local address.
- * If the supplied address is INADDR_BROADCAST,
- * and the primary interface supports broadcast,
- * choose the broadcast address for that interface.
- */
-#define satosin(sa) ((struct sockaddr_in *)(sa))
-#define sintosa(sin) ((struct sockaddr *)(sin))
-#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
- if (sin->sin_addr.s_addr == INADDR_ANY)
- sin->sin_addr = IA_SIN(in_ifaddr)->sin_addr;
- else if (sin->sin_addr.s_addr == (u_long)INADDR_BROADCAST &&
- (in_ifaddr->ia_ifp->if_flags & IFF_BROADCAST))
- sin->sin_addr = satosin(&in_ifaddr->ia_broadaddr)->sin_addr;
- }
- if (inp->inp_laddr.s_addr == INADDR_ANY) {
- register struct route *ro;
-
- ia = (struct in_ifaddr *)0;
- /*
- * If route is known or can be allocated now,
- * our src addr is taken from the i/f, else punt.
- */
- ro = &inp->inp_route;
- if (ro->ro_rt &&
- (satosin(&ro->ro_dst)->sin_addr.s_addr !=
- sin->sin_addr.s_addr ||
- inp->inp_socket->so_options & SO_DONTROUTE)) {
- RTFREE(ro->ro_rt);
- ro->ro_rt = (struct rtentry *)0;
- }
- if ((inp->inp_socket->so_options & SO_DONTROUTE) == 0 && /*XXX*/
- (ro->ro_rt == (struct rtentry *)0 ||
- ro->ro_rt->rt_ifp == (struct ifnet *)0)) {
- /* No route yet, so try to acquire one */
- ro->ro_dst.sa_family = AF_INET;
- ro->ro_dst.sa_len = sizeof(struct sockaddr_in);
- ((struct sockaddr_in *) &ro->ro_dst)->sin_addr =
- sin->sin_addr;
- rtalloc(ro);
- }
- /*
- * If we found a route, use the address
- * corresponding to the outgoing interface
- * unless it is the loopback (in case a route
- * to our address on another net goes to loopback).
- */
- if (ro->ro_rt && !(ro->ro_rt->rt_ifp->if_flags & IFF_LOOPBACK))
- ia = ifatoia(ro->ro_rt->rt_ifa);
- if (ia == 0) {
- u_short fport = sin->sin_port;
-
- sin->sin_port = 0;
- ia = ifatoia(ifa_ifwithdstaddr(sintosa(sin)));
- if (ia == 0)
- ia = ifatoia(ifa_ifwithnet(sintosa(sin)));
- sin->sin_port = fport;
- if (ia == 0)
- ia = in_ifaddr;
- if (ia == 0)
- return (EADDRNOTAVAIL);
- }
- /*
- * If the destination address is multicast and an outgoing
- * interface has been set as a multicast option, use the
- * address of that interface as our source address.
- */
- if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr)) &&
- inp->inp_moptions != NULL) {
- struct ip_moptions *imo;
- struct ifnet *ifp;
-
- imo = inp->inp_moptions;
- if (imo->imo_multicast_ifp != NULL) {
- ifp = imo->imo_multicast_ifp;
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if (ia->ia_ifp == ifp)
- break;
- if (ia == 0)
- return (EADDRNOTAVAIL);
- }
- }
- /*
- * Don't do pcblookup call here; return interface in plocal_sin
- * and exit to caller, that will do the lookup.
- */
- *plocal_sin = &ia->ia_addr;
-
- }
- return(0);
-}
-
-/*
- * Outer subroutine:
- * Connect from a socket to a specified address.
- * Both address and port must be specified in argument sin.
- * If don't have a local address for this socket yet,
- * then pick one.
- */
-int
-in_pcbconnect(inp, nam)
- register struct inpcb *inp;
- struct mbuf *nam;
-{
- struct sockaddr_in *ifaddr;
- register struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *);
- int error;
-
- /*
- * Call inner routine, to assign local interface address.
- */
- if ((error = in_pcbladdr(inp, nam, &ifaddr)))
- return(error);
-
- if (in_pcblookuphash(inp->inp_pcbinfo, sin->sin_addr, sin->sin_port,
- inp->inp_laddr.s_addr ? inp->inp_laddr : ifaddr->sin_addr,
- inp->inp_lport, 0) != NULL)
- return (EADDRINUSE);
- if (inp->inp_laddr.s_addr == INADDR_ANY) {
- if (inp->inp_lport == 0)
- (void)in_pcbbind(inp, (struct mbuf *)0);
- inp->inp_laddr = ifaddr->sin_addr;
- }
- inp->inp_faddr = sin->sin_addr;
- inp->inp_fport = sin->sin_port;
- in_pcbrehash(inp);
- return (0);
-}
-
-void
-in_pcbdisconnect(inp)
- struct inpcb *inp;
-{
-
- inp->inp_faddr.s_addr = INADDR_ANY;
- inp->inp_fport = 0;
- in_pcbrehash(inp);
- if (inp->inp_socket->so_state & SS_NOFDREF)
- in_pcbdetach(inp);
-}
-
-void
-in_pcbdetach(inp)
- struct inpcb *inp;
-{
- struct socket *so = inp->inp_socket;
- int s;
-
- so->so_pcb = 0;
- sofree(so);
- if (inp->inp_options)
- (void)m_free(inp->inp_options);
- if (inp->inp_route.ro_rt)
- rtfree(inp->inp_route.ro_rt);
- ip_freemoptions(inp->inp_moptions);
- s = splnet();
- LIST_REMOVE(inp, inp_hash);
- LIST_REMOVE(inp, inp_list);
- splx(s);
- FREE(inp, M_PCB);
-}
-
-void
-in_setsockaddr(inp, nam)
- register struct inpcb *inp;
- struct mbuf *nam;
-{
- register struct sockaddr_in *sin;
-
- nam->m_len = sizeof (*sin);
- sin = mtod(nam, struct sockaddr_in *);
- bzero((caddr_t)sin, sizeof (*sin));
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_port = inp->inp_lport;
- sin->sin_addr = inp->inp_laddr;
-}
-
-void
-in_setpeeraddr(inp, nam)
- struct inpcb *inp;
- struct mbuf *nam;
-{
- register struct sockaddr_in *sin;
-
- nam->m_len = sizeof (*sin);
- sin = mtod(nam, struct sockaddr_in *);
- bzero((caddr_t)sin, sizeof (*sin));
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_port = inp->inp_fport;
- sin->sin_addr = inp->inp_faddr;
-}
-
-/*
- * Pass some notification to all connections of a protocol
- * associated with address dst. The local address and/or port numbers
- * may be specified to limit the search. The "usual action" will be
- * taken, depending on the ctlinput cmd. The caller must filter any
- * cmds that are uninteresting (e.g., no error in the map).
- * Call the protocol specific routine (if any) to report
- * any errors for each matching socket.
- *
- * Must be called at splnet.
- */
-void
-in_pcbnotify(head, dst, fport_arg, laddr, lport_arg, cmd, notify)
- struct inpcbhead *head;
- struct sockaddr *dst;
- u_int fport_arg, lport_arg;
- struct in_addr laddr;
- int cmd;
- void (*notify) __P((struct inpcb *, int));
-{
- register struct inpcb *inp, *oinp;
- struct in_addr faddr;
- u_short fport = fport_arg, lport = lport_arg;
- int errnum, s;
-
- if ((unsigned)cmd > PRC_NCMDS || dst->sa_family != AF_INET)
- return;
- faddr = ((struct sockaddr_in *)dst)->sin_addr;
- if (faddr.s_addr == INADDR_ANY)
- return;
-
- /*
- * Redirects go to all references to the destination,
- * and use in_rtchange to invalidate the route cache.
- * Dead host indications: notify all references to the destination.
- * Otherwise, if we have knowledge of the local port and address,
- * deliver only to that socket.
- */
- if (PRC_IS_REDIRECT(cmd) || cmd == PRC_HOSTDEAD) {
- fport = 0;
- lport = 0;
- laddr.s_addr = 0;
- if (cmd != PRC_HOSTDEAD)
- notify = in_rtchange;
- }
- errnum = inetctlerrmap[cmd];
- s = splnet();
- for (inp = head->lh_first; inp != NULL;) {
- if (inp->inp_faddr.s_addr != faddr.s_addr ||
- inp->inp_socket == 0 ||
- (lport && inp->inp_lport != lport) ||
- (laddr.s_addr && inp->inp_laddr.s_addr != laddr.s_addr) ||
- (fport && inp->inp_fport != fport)) {
- inp = inp->inp_list.le_next;
- continue;
- }
- oinp = inp;
- inp = inp->inp_list.le_next;
- if (notify)
- (*notify)(oinp, errnum);
- }
- splx(s);
-}
-
-/*
- * Check for alternatives when higher level complains
- * about service problems. For now, invalidate cached
- * routing information. If the route was created dynamically
- * (by a redirect), time to try a default gateway again.
- */
-void
-in_losing(inp)
- struct inpcb *inp;
-{
- register struct rtentry *rt;
- struct rt_addrinfo info;
-
- if ((rt = inp->inp_route.ro_rt)) {
- inp->inp_route.ro_rt = 0;
- bzero((caddr_t)&info, sizeof(info));
- info.rti_info[RTAX_DST] =
- (struct sockaddr *)&inp->inp_route.ro_dst;
- info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
- info.rti_info[RTAX_NETMASK] = rt_mask(rt);
- rt_missmsg(RTM_LOSING, &info, rt->rt_flags, 0);
- if (rt->rt_flags & RTF_DYNAMIC)
- (void) rtrequest(RTM_DELETE, rt_key(rt),
- rt->rt_gateway, rt_mask(rt), rt->rt_flags,
- (struct rtentry **)0);
- else
- /*
- * A new route can be allocated
- * the next time output is attempted.
- */
- rtfree(rt);
- }
-}
-
-/*
- * After a routing change, flush old routing
- * and allocate a (hopefully) better one.
- */
-static void
-in_rtchange(inp, errnum)
- register struct inpcb *inp;
- int errnum;
-{
- if (inp->inp_route.ro_rt) {
- rtfree(inp->inp_route.ro_rt);
- inp->inp_route.ro_rt = 0;
- /*
- * A new route can be allocated the next time
- * output is attempted.
- */
- }
-}
-
-struct inpcb *
-in_pcblookup(pcbinfo, faddr, fport_arg, laddr, lport_arg, wild_okay)
- struct inpcbinfo *pcbinfo;
- struct in_addr faddr, laddr;
- u_int fport_arg, lport_arg;
- int wild_okay;
-{
- register struct inpcb *inp, *match = NULL;
- int matchwild = 3, wildcard;
- u_short fport = fport_arg, lport = lport_arg;
- int s;
-
- s = splnet();
-
- for (inp = pcbinfo->listhead->lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_lport != lport)
- continue;
- wildcard = 0;
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- if (faddr.s_addr == INADDR_ANY)
- wildcard++;
- else if (inp->inp_faddr.s_addr != faddr.s_addr ||
- inp->inp_fport != fport)
- continue;
- } else {
- if (faddr.s_addr != INADDR_ANY)
- wildcard++;
- }
- if (inp->inp_laddr.s_addr != INADDR_ANY) {
- if (laddr.s_addr == INADDR_ANY)
- wildcard++;
- else if (inp->inp_laddr.s_addr != laddr.s_addr)
- continue;
- } else {
- if (laddr.s_addr != INADDR_ANY)
- wildcard++;
- }
- if (wildcard && wild_okay == 0)
- continue;
- if (wildcard < matchwild) {
- match = inp;
- matchwild = wildcard;
- if (matchwild == 0) {
- break;
- }
- }
- }
- splx(s);
- return (match);
-}
-
-/*
- * Lookup PCB in hash list.
- */
-struct inpcb *
-in_pcblookuphash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard)
- struct inpcbinfo *pcbinfo;
- struct in_addr faddr, laddr;
- u_int fport_arg, lport_arg;
- int wildcard;
-{
- struct inpcbhead *head;
- register struct inpcb *inp;
- u_short fport = fport_arg, lport = lport_arg;
- int s;
-
- s = splnet();
- /*
- * First look for an exact match.
- */
- head = &pcbinfo->hashbase[INP_PCBHASH(faddr.s_addr, lport, fport, pcbinfo->hashmask)];
- for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
- if (inp->inp_faddr.s_addr == faddr.s_addr &&
- inp->inp_laddr.s_addr == laddr.s_addr &&
- inp->inp_fport == fport &&
- inp->inp_lport == lport)
- goto found;
- }
- if (wildcard) {
- struct inpcb *local_wild = NULL;
-
- head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbinfo->hashmask)];
- for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
- if (inp->inp_faddr.s_addr == INADDR_ANY &&
- inp->inp_fport == 0 && inp->inp_lport == lport) {
- if (inp->inp_laddr.s_addr == laddr.s_addr)
- goto found;
- else if (inp->inp_laddr.s_addr == INADDR_ANY)
- local_wild = inp;
- }
- }
- if (local_wild != NULL) {
- inp = local_wild;
- goto found;
- }
- }
- splx(s);
- return (NULL);
-
-found:
- /*
- * Move PCB to head of this hash chain so that it can be
- * found more quickly in the future.
- * XXX - this is a pessimization on machines with few
- * concurrent connections.
- */
- if (inp != head->lh_first) {
- LIST_REMOVE(inp, inp_hash);
- LIST_INSERT_HEAD(head, inp, inp_hash);
- }
- splx(s);
- return (inp);
-}
-
-/*
- * Insert PCB into hash chain. Must be called at splnet.
- */
-static void
-in_pcbinshash(inp)
- struct inpcb *inp;
-{
- struct inpcbhead *head;
-
- head = &inp->inp_pcbinfo->hashbase[INP_PCBHASH(inp->inp_faddr.s_addr,
- inp->inp_lport, inp->inp_fport, inp->inp_pcbinfo->hashmask)];
-
- LIST_INSERT_HEAD(head, inp, inp_hash);
-}
-
-void
-in_pcbrehash(inp)
- struct inpcb *inp;
-{
- struct inpcbhead *head;
- int s;
-
- s = splnet();
- LIST_REMOVE(inp, inp_hash);
-
- head = &inp->inp_pcbinfo->hashbase[INP_PCBHASH(inp->inp_faddr.s_addr,
- inp->inp_lport, inp->inp_fport, inp->inp_pcbinfo->hashmask)];
-
- LIST_INSERT_HEAD(head, inp, inp_hash);
- splx(s);
-}
diff --git a/cpukit/libnetworking/netinet/in_pcb.h b/cpukit/libnetworking/netinet/in_pcb.h
deleted file mode 100644
index 9390cfda6c..0000000000
--- a/cpukit/libnetworking/netinet/in_pcb.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1990, 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_pcb.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IN_PCB_H_
-#define _NETINET_IN_PCB_H_
-
-#include <sys/queue.h>
-
-/*
- * Common structure pcb for internet protocol implementation.
- * Here are stored pointers to local and foreign host table
- * entries, local and foreign socket numbers, and pointers
- * up (to a socket structure) and down (to a protocol-specific)
- * control block.
- */
-LIST_HEAD(inpcbhead, inpcb);
-
-struct inpcb {
- LIST_ENTRY(inpcb) inp_list; /* list for all PCBs of this proto */
- LIST_ENTRY(inpcb) inp_hash; /* hash list */
- struct inpcbinfo *inp_pcbinfo; /* PCB list info */
- struct in_addr inp_faddr; /* foreign host table entry */
- struct in_addr inp_laddr; /* local host table entry */
- u_short inp_fport; /* foreign port */
- u_short inp_lport; /* local port */
- caddr_t inp_ppcb; /* pointer to per-protocol pcb */
- struct socket *inp_socket; /* back pointer to socket */
- struct mbuf *inp_options; /* IP options */
- struct route inp_route; /* placeholder for routing entry */
- int inp_flags; /* generic IP/datagram flags */
- u_char inp_ip_tos; /* type of service proto */
- u_char inp_ip_ttl; /* time to live proto */
- u_char inp_ip_p; /* protocol proto */
- u_char pad[1]; /* alignment */
- struct ip_moptions *inp_moptions; /* IP multicast options */
-#if 0 /* Someday, perhaps... */
- struct ip inp_ip; /* header prototype; should have more */
-#endif
-};
-
-struct inpcbinfo {
- struct inpcbhead *listhead;
- struct inpcbhead *hashbase;
- unsigned long hashmask;
- unsigned short lastport;
- unsigned short lastlow;
- unsigned short lasthi;
-};
-
-#define INP_PCBHASH(faddr, lport, fport, mask) \
- (((faddr) ^ ((faddr) >> 16) ^ (lport) ^ (fport)) & (mask))
-
-/* flags in inp_flags: */
-#define INP_RECVOPTS 0x01 /* receive incoming IP options */
-#define INP_RECVRETOPTS 0x02 /* receive IP options for reply */
-#define INP_RECVDSTADDR 0x04 /* receive IP dst address */
-#define INP_HDRINCL 0x08 /* user supplies entire IP header */
-#define INP_HIGHPORT 0x10 /* user wants "high" port binding */
-#define INP_LOWPORT 0x20 /* user wants "low" port binding */
-#define INP_ANONPORT 0x40 /* port chosen for user */
-#define INP_RECVIF 0x80 /* receive incoming interface */
-#define INP_CONTROLOPTS (INP_RECVOPTS|INP_RECVRETOPTS|INP_RECVDSTADDR|\
- INP_RECVIF)
-
-#define INPLOOKUP_WILDCARD 1
-
-#define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb)
-
-#ifdef KERNEL
-void in_losing __P((struct inpcb *));
-int in_pcballoc __P((struct socket *, struct inpcbinfo *));
-int in_pcbbind __P((struct inpcb *, struct mbuf *));
-int in_pcbconnect __P((struct inpcb *, struct mbuf *));
-void in_pcbdetach __P((struct inpcb *));
-void in_pcbdisconnect __P((struct inpcb *));
-int in_pcbladdr __P((struct inpcb *, struct mbuf *,
- struct sockaddr_in **));
-struct inpcb *
- in_pcblookup __P((struct inpcbinfo *,
- struct in_addr, u_int, struct in_addr, u_int, int));
-struct inpcb *
- in_pcblookuphash __P((struct inpcbinfo *,
- struct in_addr, u_int, struct in_addr, u_int, int));
-void in_pcbnotify __P((struct inpcbhead *, struct sockaddr *,
- u_int, struct in_addr, u_int, int, void (*)(struct inpcb *, int)));
-void in_pcbrehash __P((struct inpcb *));
-void in_setpeeraddr __P((struct inpcb *, struct mbuf *));
-void in_setsockaddr __P((struct inpcb *, struct mbuf *));
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/netinet/in_proto.c b/cpukit/libnetworking/netinet/in_proto.c
deleted file mode 100644
index 3fa845955e..0000000000
--- a/cpukit/libnetworking/netinet/in_proto.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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_proto.c 8.2 (Berkeley) 2/9/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/radix.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/in_pcb.h>
-#include <netinet/igmp_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-/*
- * TCP/IP protocol family: IP, ICMP, UDP, TCP.
- */
-
-#ifdef IPXIP
-#include <netipx/ipx.h>
-#include <netipx/ipx_ip.h>
-#endif
-
-#ifdef NSIP
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-#endif
-
-#ifdef TPIP
-void tpip_input(), tpip_ctlinput(), tp_init(), tp_slowtimo(), tp_drain();
-int tp_ctloutput(), tp_usrreq();
-#endif
-
-#ifdef EON
-void eoninput(), eonctlinput(), eonprotoinit();
-#endif /* EON */
-
-extern struct domain inetdomain;
-
-struct protosw inetsw[] = {
-{ 0, &inetdomain, 0, 0,
- 0, 0, 0, 0,
- 0,
- ip_init, 0, ip_slowtimo, ip_drain
-},
-{ SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR,
- udp_input, 0, udp_ctlinput, ip_ctloutput,
- udp_usrreq,
- udp_init
-},
-{ SOCK_STREAM, &inetdomain, IPPROTO_TCP,
- PR_CONNREQUIRED|PR_IMPLOPCL|PR_WANTRCVD,
- tcp_input, 0, tcp_ctlinput, tcp_ctloutput,
- 0,
- tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain,
- &tcp_usrreqs
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR,
- rip_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR,
- icmp_input, 0, 0, rip_ctloutput,
- rip_usrreq
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_IGMP, PR_ATOMIC|PR_ADDR,
- igmp_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- igmp_init, igmp_fasttimo, igmp_slowtimo
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_RSVP, PR_ATOMIC|PR_ADDR,
- rsvp_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-{ SOCK_RAW, &inetdomain, IPPROTO_IPIP, PR_ATOMIC|PR_ADDR,
- ipip_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-#ifdef IPDIVERT
-{ SOCK_RAW, &inetdomain, IPPROTO_DIVERT, PR_ATOMIC|PR_ADDR,
- div_input, 0, 0, ip_ctloutput,
- div_usrreq,
- div_init, 0, 0, 0,
-},
-#endif
-#ifdef TPIP
-{ SOCK_SEQPACKET,&inetdomain, IPPROTO_TP, PR_CONNREQUIRED|PR_WANTRCVD,
- tpip_input, 0, tpip_ctlinput, tp_ctloutput,
- tp_usrreq,
- tp_init, 0, tp_slowtimo, tp_drain,
-},
-#endif
-/* EON (ISO CLNL over IP) */
-#ifdef EON
-{ SOCK_RAW, &inetdomain, IPPROTO_EON, 0,
- eoninput, 0, eonctlinput, 0,
- 0,
- eonprotoinit, 0, 0, 0,
-},
-#endif
-#ifdef IPXIP
-{ SOCK_RAW, &inetdomain, IPPROTO_IDP, PR_ATOMIC|PR_ADDR,
- ipxip_input, 0, ipxip_ctlinput, 0,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-#endif
-#ifdef NSIP
-{ SOCK_RAW, &inetdomain, IPPROTO_IDP, PR_ATOMIC|PR_ADDR,
- idpip_input, 0, nsip_ctlinput, 0,
- rip_usrreq,
- 0, 0, 0, 0,
-},
-#endif
- /* raw wildcard */
-{ SOCK_RAW, &inetdomain, 0, PR_ATOMIC|PR_ADDR,
- rip_input, 0, 0, rip_ctloutput,
- rip_usrreq,
- rip_init, 0, 0, 0,
-},
-};
-
-extern int in_inithead(void **, int);
-
-struct domain inetdomain =
- { AF_INET, "internet", 0, 0, 0,
- inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])], 0,
- in_inithead, 32, sizeof(struct sockaddr_in)
- };
-
-DOMAIN_SET(inet);
-
-SYSCTL_NODE(_net, PF_INET, inet, CTLFLAG_RW, 0,
- "Internet Family");
-
-SYSCTL_NODE(_net_inet, IPPROTO_IP, ip, CTLFLAG_RW, 0, "IP");
-SYSCTL_NODE(_net_inet, IPPROTO_ICMP, icmp, CTLFLAG_RW, 0, "ICMP");
-SYSCTL_NODE(_net_inet, IPPROTO_UDP, udp, CTLFLAG_RW, 0, "UDP");
-SYSCTL_NODE(_net_inet, IPPROTO_TCP, tcp, CTLFLAG_RW, 0, "TCP");
-SYSCTL_NODE(_net_inet, IPPROTO_IGMP, igmp, CTLFLAG_RW, 0, "IGMP");
-#ifdef IPDIVERT
-SYSCTL_NODE(_net_inet, IPPROTO_DIVERT, div, CTLFLAG_RW, 0, "DIVERT");
-#endif
-
diff --git a/cpukit/libnetworking/netinet/in_rmx.c b/cpukit/libnetworking/netinet/in_rmx.c
deleted file mode 100644
index ba1793b3b4..0000000000
--- a/cpukit/libnetworking/netinet/in_rmx.c
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
- * Copyright 1994, 1995 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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.
- *
- * $Id$
- */
-
-/*
- * This code does two things necessary for the enhanced TCP metrics to
- * function in a useful manner:
- * 1) It marks all non-host routes as `cloning', thus ensuring that
- * every actual reference to such a route actually gets turned
- * into a reference to a host route to the specific destination
- * requested.
- * 2) When such routes lose all their references, it arranges for them
- * to be deleted in some random collection of circumstances, so that
- * a large quantity of stale routing data is not kept in kernel memory
- * indefinitely. See in_rtqtimo() below for the exact mechanism.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/queue.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/mbuf.h>
-#include <sys/syslog.h>
-
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-
-#include <netinet/tcp.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-
-extern int in_inithead __P((void **head, int off));
-
-#define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */
-
-/*
- * Do what we need to do when inserting a route.
- */
-static struct radix_node *
-in_addroute(void *v_arg, void *n_arg, struct radix_node_head *head,
- struct radix_node *treenodes)
-{
- struct rtentry *rt = (struct rtentry *)treenodes;
- struct sockaddr_in *sin = (struct sockaddr_in *)rt_key(rt);
- struct radix_node *ret;
-
- /*
- * For IP, all unicast non-host routes are automatically cloning.
- */
- if(IN_MULTICAST(ntohl(sin->sin_addr.s_addr)))
- rt->rt_flags |= RTF_MULTICAST;
-
- if(!(rt->rt_flags & (RTF_HOST | RTF_CLONING | RTF_MULTICAST))) {
- rt->rt_flags |= RTF_PRCLONING;
- }
-
- /*
- * A little bit of help for both IP output and input:
- * For host routes, we make sure that RTF_BROADCAST
- * is set for anything that looks like a broadcast address.
- * This way, we can avoid an expensive call to in_broadcast()
- * in ip_output() most of the time (because the route passed
- * to ip_output() is almost always a host route).
- *
- * We also do the same for local addresses, with the thought
- * that this might one day be used to speed up ip_input().
- *
- * We also mark routes to multicast addresses as such, because
- * it's easy to do and might be useful (but this is much more
- * dubious since it's so easy to inspect the address). (This
- * is done above.)
- */
- if (rt->rt_flags & RTF_HOST) {
- if (in_broadcast(sin->sin_addr, rt->rt_ifp)) {
- rt->rt_flags |= RTF_BROADCAST;
- } else {
-#define satosin(sa) ((struct sockaddr_in *)sa)
- if (satosin(rt->rt_ifa->ifa_addr)->sin_addr.s_addr
- == sin->sin_addr.s_addr)
- rt->rt_flags |= RTF_LOCAL;
-#undef satosin
- }
- }
-
- /*
- * We also specify a send and receive pipe size for every
- * route added, to help TCP a bit. TCP doesn't actually
- * want a true pipe size, which would be prohibitive in memory
- * costs and is hard to compute anyway; it simply uses these
- * values to size its buffers. So, we fill them in with the
- * same values that TCP would have used anyway, and allow the
- * installing program or the link layer to override these values
- * as it sees fit. This will hopefully allow TCP more
- * opportunities to save its ssthresh value.
- */
- if (!rt->rt_rmx.rmx_sendpipe && !(rt->rt_rmx.rmx_locks & RTV_SPIPE))
- rt->rt_rmx.rmx_sendpipe = tcp_sendspace;
-
- if (!rt->rt_rmx.rmx_recvpipe && !(rt->rt_rmx.rmx_locks & RTV_RPIPE))
- rt->rt_rmx.rmx_recvpipe = tcp_recvspace;
-
- if (!rt->rt_rmx.rmx_mtu && !(rt->rt_rmx.rmx_locks & RTV_MTU)
- && rt->rt_ifp)
- rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu;
-
- ret = rn_addroute(v_arg, n_arg, head, treenodes);
- if (ret == NULL && rt->rt_flags & RTF_HOST) {
- struct rtentry *rt2;
- /*
- * We are trying to add a host route, but can't.
- * Find out if it is because of an
- * ARP entry and delete it if so.
- */
- rt2 = rtalloc1((struct sockaddr *)sin, 0,
- RTF_CLONING | RTF_PRCLONING);
- if (rt2) {
- if (rt2->rt_flags & RTF_LLINFO &&
- rt2->rt_flags & RTF_HOST &&
- rt2->rt_gateway &&
- rt2->rt_gateway->sa_family == AF_LINK) {
- rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt2),
- rt2->rt_gateway,
- rt_mask(rt2), rt2->rt_flags, 0);
- ret = rn_addroute(v_arg, n_arg, head,
- treenodes);
- }
- RTFREE(rt2);
- }
- }
- return ret;
-}
-
-/*
- * This code is the inverse of in_clsroute: on first reference, if we
- * were managing the route, stop doing so and set the expiration timer
- * back off again.
- */
-static struct radix_node *
-in_matroute(void *v_arg, struct radix_node_head *head)
-{
- struct radix_node *rn = rn_match(v_arg, head);
- struct rtentry *rt = (struct rtentry *)rn;
-
- if(rt && rt->rt_refcnt == 0) { /* this is first reference */
- if(rt->rt_flags & RTPRF_OURS) {
- rt->rt_flags &= ~RTPRF_OURS;
- rt->rt_rmx.rmx_expire = 0;
- }
- }
- return rn;
-}
-
-static int rtq_reallyold = 60*60;
- /* one hour is ``really old'' */
-SYSCTL_INT(_net_inet_ip, IPCTL_RTEXPIRE, rtexpire,
- CTLFLAG_RW, &rtq_reallyold , 0, "");
-
-static int rtq_minreallyold = 10;
- /* never automatically crank down to less */
-SYSCTL_INT(_net_inet_ip, IPCTL_RTMINEXPIRE, rtminexpire,
- CTLFLAG_RW, &rtq_minreallyold , 0, "");
-
-static int rtq_toomany = 128;
- /* 128 cached routes is ``too many'' */
-SYSCTL_INT(_net_inet_ip, IPCTL_RTMAXCACHE, rtmaxcache,
- CTLFLAG_RW, &rtq_toomany , 0, "");
-
-
-/*
- * On last reference drop, mark the route as belong to us so that it can be
- * timed out.
- */
-static void
-in_clsroute(struct radix_node *rn, struct radix_node_head *head)
-{
- struct rtentry *rt = (struct rtentry *)rn;
-
- if(!(rt->rt_flags & RTF_UP))
- return; /* prophylactic measures */
-
- if((rt->rt_flags & (RTF_LLINFO | RTF_HOST)) != RTF_HOST)
- return;
-
- if((rt->rt_flags & (RTF_WASCLONED | RTPRF_OURS))
- != RTF_WASCLONED)
- return;
-
- /*
- * As requested by David Greenman:
- * If rtq_reallyold is 0, just delete the route without
- * waiting for a timeout cycle to kill it.
- */
- if(rtq_reallyold != 0) {
- rt->rt_flags |= RTPRF_OURS;
- rt->rt_rmx.rmx_expire = rtems_bsdnet_seconds_since_boot() + rtq_reallyold;
- } else {
- rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt),
- rt->rt_gateway, rt_mask(rt),
- rt->rt_flags, 0);
- }
-}
-
-struct rtqk_arg {
- struct radix_node_head *rnh;
- int draining;
- int killed;
- int found;
- int updating;
- time_t nextstop;
-};
-
-/*
- * Get rid of old routes. When draining, this deletes everything, even when
- * the timeout is not expired yet. When updating, this makes sure that
- * nothing has a timeout longer than the current value of rtq_reallyold.
- */
-static int
-in_rtqkill(struct radix_node *rn, void *rock)
-{
- struct rtqk_arg *ap = rock;
- struct rtentry *rt = (struct rtentry *)rn;
- int err;
-
- if(rt->rt_flags & RTPRF_OURS) {
- ap->found++;
-
- if(ap->draining || rt->rt_rmx.rmx_expire <= rtems_bsdnet_seconds_since_boot()) {
- if(rt->rt_refcnt > 0)
- panic("rtqkill route really not free");
-
- err = rtrequest(RTM_DELETE,
- (struct sockaddr *)rt_key(rt),
- rt->rt_gateway, rt_mask(rt),
- rt->rt_flags, 0);
- if(err) {
- log(LOG_WARNING, "in_rtqkill: error %d\n", err);
- } else {
- ap->killed++;
- }
- } else {
- if(ap->updating
- && (rt->rt_rmx.rmx_expire - rtems_bsdnet_seconds_since_boot()
- > rtq_reallyold)) {
- rt->rt_rmx.rmx_expire = rtems_bsdnet_seconds_since_boot()
- + rtq_reallyold;
- }
- ap->nextstop = lmin(ap->nextstop,
- rt->rt_rmx.rmx_expire);
- }
- }
-
- return 0;
-}
-
-#define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */
-static int rtq_timeout = RTQ_TIMEOUT;
-
-static void
-in_rtqtimo(void *rock)
-{
- struct radix_node_head *rnh = rock;
- struct rtqk_arg arg;
- struct timeval atv;
- static time_t last_adjusted_timeout = 0;
- int s;
-
- arg.found = arg.killed = 0;
- arg.rnh = rnh;
- arg.nextstop = rtems_bsdnet_seconds_since_boot() + rtq_timeout;
- arg.draining = arg.updating = 0;
- s = splnet();
- rnh->rnh_walktree(rnh, in_rtqkill, &arg);
- splx(s);
-
- /*
- * Attempt to be somewhat dynamic about this:
- * If there are ``too many'' routes sitting around taking up space,
- * then crank down the timeout, and see if we can't make some more
- * go away. However, we make sure that we will never adjust more
- * than once in rtq_timeout seconds, to keep from cranking down too
- * hard.
- */
- if((arg.found - arg.killed > rtq_toomany)
- && (rtems_bsdnet_seconds_since_boot() - last_adjusted_timeout >= rtq_timeout)
- && rtq_reallyold > rtq_minreallyold) {
- rtq_reallyold = 2*rtq_reallyold / 3;
- if(rtq_reallyold < rtq_minreallyold) {
- rtq_reallyold = rtq_minreallyold;
- }
-
- last_adjusted_timeout = rtems_bsdnet_seconds_since_boot();
-#ifdef DIAGNOSTIC
- log(LOG_DEBUG, "in_rtqtimo: adjusted rtq_reallyold to %d\n",
- rtq_reallyold);
-#endif
- arg.found = arg.killed = 0;
- arg.updating = 1;
- s = splnet();
- rnh->rnh_walktree(rnh, in_rtqkill, &arg);
- splx(s);
- }
-
- atv.tv_usec = 0;
- atv.tv_sec = arg.nextstop;
- timeout(in_rtqtimo, rock, hzto(&atv));
-}
-
-void
-in_rtqdrain(void)
-{
- struct radix_node_head *rnh = rt_tables[AF_INET];
- struct rtqk_arg arg;
- int s;
- arg.found = arg.killed = 0;
- arg.rnh = rnh;
- arg.nextstop = 0;
- arg.draining = 1;
- arg.updating = 0;
- s = splnet();
- rnh->rnh_walktree(rnh, in_rtqkill, &arg);
- splx(s);
-}
-
-/*
- * Initialize our routing tree.
- */
-int
-in_inithead(void **head, int off)
-{
- struct radix_node_head *rnh;
-
- if(!rn_inithead(head, off))
- return 0;
-
- if(head != (void **)&rt_tables[AF_INET]) /* BOGUS! */
- return 1; /* only do this for the real routing table */
-
- rnh = *head;
- rnh->rnh_addaddr = in_addroute;
- rnh->rnh_matchaddr = in_matroute;
- rnh->rnh_close = in_clsroute;
- in_rtqtimo(rnh); /* kick off timeout first time */
- return 1;
-}
-
diff --git a/cpukit/libnetworking/netinet/in_systm.h b/cpukit/libnetworking/netinet/in_systm.h
deleted file mode 100644
index d72e9b4665..0000000000
--- a/cpukit/libnetworking/netinet/in_systm.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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_systm.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IN_SYSTM_H_
-#define _NETINET_IN_SYSTM_H_
-
-/*
- * Miscellaneous internetwork
- * definitions for kernel.
- */
-
-/*
- * Network types.
- *
- * Internally the system keeps counters in the headers with the bytes
- * swapped so that VAX instructions will work on them. It reverses
- * the bytes before transmission at each protocol level. The n_ types
- * represent the types with the bytes in ``high-ender'' order.
- */
-typedef u_short n_short; /* short as received from the net */
-typedef u_long n_long; /* long as received from the net */
-
-typedef u_long n_time; /* ms since 00:00 GMT, byte rev */
-
-#ifdef KERNEL
-n_time iptime __P((void));
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/netinet/in_var.h b/cpukit/libnetworking/netinet/in_var.h
deleted file mode 100644
index e7a54d5e85..0000000000
--- a/cpukit/libnetworking/netinet/in_var.h
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 1985, 1986, 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_var.h 8.2 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _NETINET_IN_VAR_H_
-#define _NETINET_IN_VAR_H_
-
-#include <sys/queue.h>
-
-/*
- * Interface address, Internet version. One of these structures
- * is allocated for each interface with an Internet address.
- * The ifaddr structure contains the protocol-independent part
- * of the structure and is assumed to be first.
- */
-struct in_ifaddr {
- struct ifaddr ia_ifa; /* protocol-independent info */
-#define ia_ifp ia_ifa.ifa_ifp
-#define ia_flags ia_ifa.ifa_flags
- /* ia_{,sub}net{,mask} in host order */
- u_long ia_net; /* network number of interface */
- u_long ia_netmask; /* mask of net part */
- u_long ia_subnet; /* subnet number, including net */
- u_long ia_subnetmask; /* mask of subnet part */
- struct in_addr ia_netbroadcast; /* to recognize net broadcasts */
- struct in_ifaddr *ia_next; /* next in list of internet addresses */
- struct sockaddr_in ia_addr; /* reserve space for interface name */
- struct sockaddr_in ia_dstaddr; /* reserve space for broadcast addr */
-#define ia_broadaddr ia_dstaddr
- struct sockaddr_in ia_sockmask; /* reserve space for general netmask */
- LIST_HEAD(in_multihead, in_multi) ia_multiaddrs;
- /* list of multicast addresses */
-};
-
-struct in_aliasreq {
- char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- struct sockaddr_in ifra_addr;
- struct sockaddr_in ifra_broadaddr;
-#define ifra_dstaddr ifra_broadaddr
- struct sockaddr_in ifra_mask;
-};
-/*
- * Given a pointer to an in_ifaddr (ifaddr),
- * return a pointer to the addr as a sockaddr_in.
- */
-#define IA_SIN(ia) (&(((struct in_ifaddr *)(ia))->ia_addr))
-#define IA_DSTSIN(ia) (&(((struct in_ifaddr *)(ia))->ia_dstaddr))
-
-#define IN_LNAOF(in, ifa) \
- ((ntohl((in).s_addr) & ~((struct in_ifaddr *)(ifa)->ia_subnetmask))
-
-
-#ifdef KERNEL
-extern struct in_ifaddr *in_ifaddr;
-extern struct ifqueue ipintrq; /* ip packet input queue */
-extern struct in_addr zeroin_addr;
-extern u_char inetctlerrmap[];
-extern int rtq_reallyold; /* XXX */
-extern int rtq_minreallyold; /* XXX */
-extern int rtq_toomany; /* XXX */
-
-/*
- * Macro for finding the interface (ifnet structure) corresponding to one
- * of our IP addresses.
- */
-#define INADDR_TO_IFP(addr, ifp) \
- /* struct in_addr addr; */ \
- /* struct ifnet *ifp; */ \
-{ \
- register struct in_ifaddr *ia; \
-\
- for (ia = in_ifaddr; \
- ia != NULL && ((ia->ia_ifp->if_flags & IFF_POINTOPOINT)? \
- IA_DSTSIN(ia):IA_SIN(ia))->sin_addr.s_addr != (addr).s_addr; \
- ia = ia->ia_next) \
- continue; \
- if (ia == NULL) \
- for (ia = in_ifaddr; \
- ia != NULL; \
- ia = ia->ia_next) \
- if (ia->ia_ifp->if_flags & IFF_POINTOPOINT && \
- IA_SIN(ia)->sin_addr.s_addr == (addr).s_addr) \
- break; \
- (ifp) = (ia == NULL) ? NULL : ia->ia_ifp; \
-}
-
-/*
- * Macro for finding the internet address structure (in_ifaddr) corresponding
- * to a given interface (ifnet structure).
- */
-#define IFP_TO_IA(ifp, ia) \
- /* struct ifnet *ifp; */ \
- /* struct in_ifaddr *ia; */ \
-{ \
- for ((ia) = in_ifaddr; \
- (ia) != NULL && (ia)->ia_ifp != (ifp); \
- (ia) = (ia)->ia_next) \
- continue; \
-}
-#endif
-
-/*
- * This information should be part of the ifnet structure but we don't wish
- * to change that - as it might break a number of things
- */
-
-struct router_info {
- struct ifnet *rti_ifp;
- int rti_type; /* type of router which is querier on this interface */
- int rti_time; /* # of slow timeouts since last old query */
- struct router_info *rti_next;
-};
-
-/*
- * Internet multicast address structure. There is one of these for each IP
- * multicast group to which this host belongs on a given network interface.
- * They are kept in a linked list, rooted in the interface's in_ifaddr
- * structure.
- */
-struct in_multi {
- LIST_ENTRY(in_multi) inm_entry; /* list glue */
- struct in_addr inm_addr; /* IP multicast address */
- struct ifnet *inm_ifp; /* back pointer to ifnet */
- struct in_ifaddr *inm_ia; /* back pointer to in_ifaddr */
- u_int inm_refcount; /* no. membership claims by sockets */
- u_int inm_timer; /* IGMP membership report timer */
- u_int inm_state; /* state of the membership */
- struct router_info *inm_rti; /* router info*/
-};
-
-#ifdef KERNEL
-/*
- * Structure used by macros below to remember position when stepping through
- * all of the in_multi records.
- */
-struct in_multistep {
- struct in_ifaddr *i_ia;
- struct in_multi *i_inm;
-};
-
-/*
- * Macro for looking up the in_multi record for a given IP multicast address
- * on a given interface. If no matching record is found, "inm" returns NULL.
- */
-#define IN_LOOKUP_MULTI(addr, ifp, inm) \
- /* struct in_addr addr; */ \
- /* struct ifnet *ifp; */ \
- /* struct in_multi *inm; */ \
-{ \
- register struct in_ifaddr *ia; \
-\
- IFP_TO_IA((ifp), ia); \
- if (ia == NULL) \
- (inm) = NULL; \
- else \
- for ((inm) = ia->ia_multiaddrs.lh_first; \
- (inm) != NULL && (inm)->inm_addr.s_addr != (addr).s_addr; \
- (inm) = inm->inm_entry.le_next) \
- continue; \
-}
-
-/*
- * Macro to step through all of the in_multi records, one at a time.
- * The current position is remembered in "step", which the caller must
- * provide. IN_FIRST_MULTI(), below, must be called to initialize "step"
- * and get the first record. Both macros return a NULL "inm" when there
- * are no remaining records.
- */
-#define IN_NEXT_MULTI(step, inm) \
- /* struct in_multistep step; */ \
- /* struct in_multi *inm; */ \
-{ \
- if (((inm) = (step).i_inm) != NULL) \
- (step).i_inm = (inm)->inm_entry.le_next; \
- else \
- while ((step).i_ia != NULL) { \
- (inm) = (step).i_ia->ia_multiaddrs.lh_first; \
- (step).i_ia = (step).i_ia->ia_next; \
- if ((inm) != NULL) { \
- (step).i_inm = (inm)->inm_entry.le_next; \
- break; \
- } \
- } \
-}
-
-#define IN_FIRST_MULTI(step, inm) \
- /* struct in_multistep step; */ \
- /* struct in_multi *inm; */ \
-{ \
- (step).i_ia = in_ifaddr; \
- (step).i_inm = NULL; \
- IN_NEXT_MULTI((step), (inm)); \
-}
-
-struct in_multi *in_addmulti __P((struct in_addr *, struct ifnet *));
-void in_delmulti __P((struct in_multi *));
-int in_control __P((struct socket *, u_long, caddr_t, struct ifnet *));
-void in_rtqdrain __P((void));
-void ip_input __P((struct mbuf *));
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_IN_VAR_H_ */
diff --git a/cpukit/libnetworking/netinet/ip.h b/cpukit/libnetworking/netinet/ip.h
deleted file mode 100644
index e7f824ca6f..0000000000
--- a/cpukit/libnetworking/netinet/ip.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)ip.h 8.2 (Berkeley) 6/1/94
- * $Id$
- */
-
-#ifndef _NETINET_IP_H_
-#define _NETINET_IP_H_
-
-/*
- * Definitions for internet protocol version 4.
- * Per RFC 791, September 1981.
- */
-#define IPVERSION 4
-
-/*
- * Structure of an internet header, naked of options.
- *
- * We declare ip_len and ip_off to be short, rather than u_short
- * pragmatically since otherwise unsigned comparisons can result
- * against negative integers quite easily, and fail in subtle ways.
- */
-struct ip {
-#ifdef _IP_VHL
- u_char ip_vhl; /* version << 4 | header length >> 2 */
-#else
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char ip_hl:4, /* header length */
- ip_v:4; /* version */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char ip_v:4, /* version */
- ip_hl:4; /* header length */
-#endif
-#endif /* not _IP_VHL */
- u_char ip_tos; /* type of service */
- u_short ip_len; /* total length */
- u_short ip_id; /* identification */
- u_short ip_off; /* fragment offset field */
-#define IP_RF 0x8000 /* reserved fragment flag */
-#define IP_DF 0x4000 /* dont fragment flag */
-#define IP_MF 0x2000 /* more fragments flag */
-#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
- u_char ip_ttl; /* time to live */
- u_char ip_p; /* protocol */
- u_short ip_sum; /* checksum */
- struct in_addr ip_src,ip_dst; /* source and dest address */
-};
-
-#ifdef _IP_VHL
-#define IP_MAKE_VHL(v, hl) ((v) << 4 | (hl))
-#define IP_VHL_HL(vhl) ((vhl) & 0x0f)
-#define IP_VHL_V(vhl) ((vhl) >> 4)
-#define IP_VHL_BORING 0x45
-#endif
-
-#define IP_MAXPACKET 65535 /* maximum packet size */
-
-/*
- * Definitions for IP type of service (ip_tos)
- */
-#define IPTOS_LOWDELAY 0x10
-#define IPTOS_THROUGHPUT 0x08
-#define IPTOS_RELIABILITY 0x04
-#define IPTOS_MINCOST 0x02
-
-/*
- * Definitions for IP precedence (also in ip_tos) (hopefully unused)
- */
-#define IPTOS_PREC_NETCONTROL 0xe0
-#define IPTOS_PREC_INTERNETCONTROL 0xc0
-#define IPTOS_PREC_CRITIC_ECP 0xa0
-#define IPTOS_PREC_FLASHOVERRIDE 0x80
-#define IPTOS_PREC_FLASH 0x60
-#define IPTOS_PREC_IMMEDIATE 0x40
-#define IPTOS_PREC_PRIORITY 0x20
-#define IPTOS_PREC_ROUTINE 0x00
-
-/*
- * Definitions for options.
- */
-#define IPOPT_COPIED(o) ((o)&0x80)
-#define IPOPT_CLASS(o) ((o)&0x60)
-#define IPOPT_NUMBER(o) ((o)&0x1f)
-
-#define IPOPT_CONTROL 0x00
-#define IPOPT_RESERVED1 0x20
-#define IPOPT_DEBMEAS 0x40
-#define IPOPT_RESERVED2 0x60
-
-#define IPOPT_EOL 0 /* end of option list */
-#define IPOPT_NOP 1 /* no operation */
-
-#define IPOPT_RR 7 /* record packet route */
-#define IPOPT_TS 68 /* timestamp */
-#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
-#define IPOPT_LSRR 131 /* loose source route */
-#define IPOPT_SATID 136 /* satnet id */
-#define IPOPT_SSRR 137 /* strict source route */
-#define IPOPT_RA 148 /* router alert */
-
-/*
- * Offsets to fields in options other than EOL and NOP.
- */
-#define IPOPT_OPTVAL 0 /* option ID */
-#define IPOPT_OLEN 1 /* option length */
-#define IPOPT_OFFSET 2 /* offset within option */
-#define IPOPT_MINOFF 4 /* min value of above */
-
-/*
- * Time stamp option structure.
- */
-struct ip_timestamp {
- u_char ipt_code; /* IPOPT_TS */
- u_char ipt_len; /* size of structure (variable) */
- u_char ipt_ptr; /* index of current entry */
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char ipt_flg:4, /* flags, see below */
- ipt_oflw:4; /* overflow counter */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char ipt_oflw:4, /* overflow counter */
- ipt_flg:4; /* flags, see below */
-#endif
- union ipt_timestamp {
- n_long ipt_time[1];
- struct ipt_ta {
- struct in_addr ipt_addr;
- n_long ipt_time;
- } ipt_ta[1];
- } ipt_timestamp;
-};
-
-#include <machine/in_cksum.h>
-
-/* flag bits for ipt_flg */
-#define IPOPT_TS_TSONLY 0 /* timestamps only */
-#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
-#define IPOPT_TS_PRESPEC 3 /* specified modules only */
-
-/* bits for security (not byte swapped) */
-#define IPOPT_SECUR_UNCLASS 0x0000
-#define IPOPT_SECUR_CONFID 0xf135
-#define IPOPT_SECUR_EFTO 0x789a
-#define IPOPT_SECUR_MMMM 0xbc4d
-#define IPOPT_SECUR_RESTR 0xaf13
-#define IPOPT_SECUR_SECRET 0xd788
-#define IPOPT_SECUR_TOPSECRET 0x6bc5
-
-/*
- * Internet implementation parameters.
- */
-#define MAXTTL 255 /* maximum time to live (seconds) */
-#define IPDEFTTL 64 /* default ttl, from RFC 1340 */
-#define IPFRAGTTL 60 /* time to live for frags, slowhz */
-#define IPTTLDEC 1 /* subtracted when forwarding */
-
-#define IP_MSS 576 /* default maximum segment size */
-
-#endif
diff --git a/cpukit/libnetworking/netinet/ip_divert.c b/cpukit/libnetworking/netinet/ip_divert.c
deleted file mode 100644
index 2955e811ad..0000000000
--- a/cpukit/libnetworking/netinet/ip_divert.c
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/systm.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-
-/*
- * Divert sockets
- */
-
-/*
- * Allocate enough space to hold a full IP packet
- */
-#define DIVSNDQ (65536 + 100)
-#define DIVRCVQ (65536 + 100)
-
-/* Global variables */
-
-/*
- * ip_input() and ip_output() set this secret value before calling us to
- * let us know which divert port to divert a packet to; this is done so
- * we can use the existing prototype for struct protosw's pr_input().
- * This is stored in host order.
- */
-u_short ip_divert_port;
-
-/*
- * We set this value to a non-zero port number when we want the call to
- * ip_fw_chk() in ip_input() or ip_output() to ignore ``divert <port>''
- * chain entries. This is stored in host order.
- */
-u_short ip_divert_ignore;
-
-/* Internal variables */
-
-static struct inpcbhead divcb;
-static struct inpcbinfo divcbinfo;
-
-static u_long div_sendspace = DIVSNDQ; /* XXX sysctl ? */
-static u_long div_recvspace = DIVRCVQ; /* XXX sysctl ? */
-
-/* Optimization: have this preinitialized */
-static struct sockaddr_in divsrc = { sizeof(divsrc), AF_INET };
-
-/* Internal functions */
-
-static int div_output(struct socket *so,
- struct mbuf *m, struct mbuf *addr, struct mbuf *control);
-
-/*
- * Initialize divert connection block queue.
- */
-void
-div_init(void)
-{
- LIST_INIT(&divcb);
- divcbinfo.listhead = &divcb;
- /*
- * XXX We don't use the hash list for divert IP, but it's easier
- * to allocate a one entry hash list than it is to check all
- * over the place for hashbase == NULL.
- */
- divcbinfo.hashbase = hashinit(1, M_PCB, &divcbinfo.hashmask);
-}
-
-/*
- * Setup generic address and protocol structures
- * for div_input routine, then pass them along with
- * mbuf chain. ip->ip_len is assumed to have had
- * the header length (hlen) subtracted out already.
- * We tell whether the packet was incoming or outgoing
- * by seeing if hlen == 0, which is a hack.
- */
-void
-div_input(struct mbuf *m, int hlen)
-{
- struct ip *ip;
- struct inpcb *inp;
- struct socket *sa;
-
- /* Sanity check */
- if (ip_divert_port == 0)
- panic("div_input: port is 0");
-
- /* Assure header */
- if (m->m_len < sizeof(struct ip) &&
- (m = m_pullup(m, sizeof(struct ip))) == 0) {
- return;
- }
- ip = mtod(m, struct ip *);
-
- /* Record divert port */
- divsrc.sin_port = htons(ip_divert_port);
-
- /* Restore packet header fields */
- ip->ip_len += hlen;
- HTONS(ip->ip_len);
- HTONS(ip->ip_off);
-
- /* Record receive interface address, if any */
- divsrc.sin_addr.s_addr = 0;
- if (hlen) {
- struct ifaddr *ifa;
-
-#ifdef DIAGNOSTIC
- /* Sanity check */
- if (!(m->m_flags & M_PKTHDR))
- panic("div_input: no pkt hdr");
-#endif
-
- /* More fields affected by ip_input() */
- HTONS(ip->ip_id);
-
- /* Find IP address for recieve interface */
- for (ifa = m->m_pkthdr.rcvif->if_addrlist;
- ifa != NULL; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr == NULL)
- continue;
- if (ifa->ifa_addr->sa_family != AF_INET)
- continue;
- divsrc.sin_addr =
- ((struct sockaddr_in *) ifa->ifa_addr)->sin_addr;
- break;
- }
- }
-
- /* Put packet on socket queue, if any */
- sa = NULL;
- for (inp = divcb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_lport == htons(ip_divert_port))
- sa = inp->inp_socket;
- }
- if (sa) {
- if (sbappendaddr(&sa->so_rcv, (struct sockaddr *)&divsrc,
- m, (struct mbuf *)0) == 0)
- m_freem(m);
- else
- sorwakeup(sa);
- } else {
- m_freem(m);
- ipstat.ips_noproto++;
- ipstat.ips_delivered--;
- }
-}
-
-/*
- * Deliver packet back into the IP processing machinery.
- *
- * If no address specified, or address is 0.0.0.0, send to ip_output();
- * otherwise, send to ip_input() and mark as having been received on
- * the interface with that address.
- *
- * If no address specified, or dest port is 0, allow packet to divert
- * back to this socket; otherwise, don't.
- */
-static int
-div_output(so, m, addr, control)
- struct socket *so;
- register struct mbuf *m;
- struct mbuf *addr, *control;
-{
- register struct inpcb *const inp = sotoinpcb(so);
- register struct ip *const ip = mtod(m, struct ip *);
- struct sockaddr_in *sin = NULL;
- int error = 0;
-
- if (control)
- m_freem(control); /* XXX */
- if (addr)
- sin = mtod(addr, struct sockaddr_in *);
-
- /* Loopback avoidance option */
- ip_divert_ignore = ntohs(inp->inp_lport);
-
- /* Reinject packet into the system as incoming or outgoing */
- if (!sin || sin->sin_addr.s_addr == 0) {
- /* Don't allow both user specified and setsockopt options,
- and don't allow packet length sizes that will crash */
- if (((ip->ip_hl != (sizeof (*ip) >> 2)) && inp->inp_options) ||
- ((u_short)ntohs(ip->ip_len) > m->m_pkthdr.len)) {
- error = EINVAL;
- goto cantsend;
- }
-
- /* Convert fields to host order for ip_output() */
- NTOHS(ip->ip_len);
- NTOHS(ip->ip_off);
-
- /* Send packet to output processing */
- ipstat.ips_rawout++; /* XXX */
- error = ip_output(m, inp->inp_options, &inp->inp_route,
- (so->so_options & SO_DONTROUTE) |
- IP_ALLOWBROADCAST | IP_RAWOUTPUT, inp->inp_moptions);
- } else {
- struct ifaddr *ifa;
-
- /* Find receive interface with the given IP address */
- sin->sin_port = 0;
- if ((ifa = ifa_ifwithaddr((struct sockaddr *) sin)) == 0) {
- error = EADDRNOTAVAIL;
- goto cantsend;
- }
- m->m_pkthdr.rcvif = ifa->ifa_ifp;
-
- /* Send packet to input processing */
- ip_input(m);
- }
-
- /* Reset for next time (and other packets) */
- ip_divert_ignore = 0;
- return error;
-
-cantsend:
- ip_divert_ignore = 0;
- m_freem(m);
- return error;
-}
-
-/*ARGSUSED*/
-int
-div_usrreq(so, req, m, nam, control)
- register struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register int error = 0;
- register struct inpcb *inp = sotoinpcb(so);
- int s;
-
- if (inp == NULL && req != PRU_ATTACH) {
- error = EINVAL;
- goto release;
- }
- switch (req) {
-
- case PRU_ATTACH:
- if (inp)
- panic("div_attach");
- if ((so->so_state & SS_PRIV) == 0) {
- error = EACCES;
- break;
- }
- s = splnet();
- error = in_pcballoc(so, &divcbinfo);
- splx(s);
- if (error)
- break;
- error = soreserve(so, div_sendspace, div_recvspace);
- if (error)
- break;
- inp = (struct inpcb *)so->so_pcb;
- inp->inp_ip_p = (int)nam; /* XXX */
- inp->inp_flags |= INP_HDRINCL;
- /* The socket is always "connected" because
- we always know "where" to send the packet */
- so->so_state |= SS_ISCONNECTED;
- break;
-
- case PRU_DISCONNECT:
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- error = ENOTCONN;
- break;
- }
- /* FALLTHROUGH */
- case PRU_ABORT:
- soisdisconnected(so);
- /* FALLTHROUGH */
- case PRU_DETACH:
- if (inp == 0)
- panic("div_detach");
- in_pcbdetach(inp);
- break;
-
- case PRU_BIND:
- s = splnet();
- error = in_pcbbind(inp, nam);
- splx(s);
- break;
-
- /*
- * Mark the connection as being incapable of further input.
- */
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- case PRU_SEND:
- /* Packet must have a header (but that's about it) */
- if (m->m_len < sizeof (struct ip) ||
- (m = m_pullup(m, sizeof (struct ip))) == 0) {
- ipstat.ips_toosmall++;
- error = EINVAL;
- break;
- }
-
- /* Send packet */
- error = div_output(so, m, nam, control);
- m = NULL;
- break;
-
- case PRU_SOCKADDR:
- in_setsockaddr(inp, nam);
- break;
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- /*
- * Not supported.
- */
- case PRU_CONNECT:
- case PRU_CONNECT2:
- case PRU_CONTROL:
- case PRU_RCVOOB:
- case PRU_RCVD:
- case PRU_LISTEN:
- case PRU_ACCEPT:
- case PRU_SENDOOB:
- case PRU_PEERADDR:
- error = EOPNOTSUPP;
- break;
-
- default:
- panic("div_usrreq");
- }
-release:
- if (m)
- m_freem(m);
- return (error);
-}
diff --git a/cpukit/libnetworking/netinet/ip_fw.c b/cpukit/libnetworking/netinet/ip_fw.c
deleted file mode 100644
index aeb09b0bbe..0000000000
--- a/cpukit/libnetworking/netinet/ip_fw.c
+++ /dev/null
@@ -1,1069 +0,0 @@
-/*
- * Copyright (c) 1996 Alex Nash
- * Copyright (c) 1993 Daniel Boulet
- * Copyright (c) 1994 Ugen J.S.Antsilevich
- *
- * Redistribution and use in source forms, with and without modification,
- * are permitted provided that this entire comment appears intact.
- *
- * Redistribution in binary form may occur without any restrictions.
- * Obviously, it would be nice if you gave credit where credit is due
- * but requiring it would be too onerous.
- *
- * This software is provided ``AS IS'' without any warranties of any kind.
- *
- * $Id$
- */
-
-/*
- * Implement IP packet firewall
- */
-
-#ifndef IPFIREWALL_MODULE
-#include "opt_ipfw.h"
-#endif
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/queue.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/sysctl.h>
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_fw.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#include <netinet/udp.h>
-
-static int fw_debug = 1;
-#ifdef IPFIREWALL_VERBOSE
-static int fw_verbose = 1;
-#else
-static int fw_verbose = 0;
-#endif
-#ifdef IPFIREWALL_VERBOSE_LIMIT
-static int fw_verbose_limit = IPFIREWALL_VERBOSE_LIMIT;
-#else
-static int fw_verbose_limit = 0;
-#endif
-
-LIST_HEAD (ip_fw_head, ip_fw_chain) ip_fw_chain;
-
-#ifdef SYSCTL_NODE
-SYSCTL_NODE(_net_inet_ip, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, debug, CTLFLAG_RW, &fw_debug, 0, "");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose, CTLFLAG_RW, &fw_verbose, 0, "");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose_limit, CTLFLAG_RW, &fw_verbose_limit, 0, "");
-#endif
-
-#define dprintf(a) if (!fw_debug); else printf a
-
-#define print_ip(a) printf("%ld.%ld.%ld.%ld",(ntohl(a.s_addr)>>24)&0xFF,\
- (ntohl(a.s_addr)>>16)&0xFF,\
- (ntohl(a.s_addr)>>8)&0xFF,\
- (ntohl(a.s_addr))&0xFF);
-
-#define dprint_ip(a) if (!fw_debug); else print_ip(a)
-
-static int add_entry __P((struct ip_fw_head *chainptr, struct ip_fw *frwl));
-static int del_entry __P((struct ip_fw_head *chainptr, u_short number));
-static int zero_entry __P((struct mbuf *m));
-static struct ip_fw *check_ipfw_struct __P((struct ip_fw *m));
-static struct ip_fw *check_ipfw_mbuf __P((struct mbuf *fw));
-static int ipopts_match __P((struct ip *ip, struct ip_fw *f));
-static int port_match __P((u_short *portptr, int nports, u_short port,
- int range_flag));
-static int tcpflg_match __P((struct tcphdr *tcp, struct ip_fw *f));
-static int icmptype_match __P((struct icmp * icmp, struct ip_fw * f));
-static void ipfw_report __P((struct ip_fw *f, struct ip *ip,
- struct ifnet *rif, struct ifnet *oif));
-
-#ifdef IPFIREWALL_MODULE
-static ip_fw_chk_t *old_chk_ptr;
-static ip_fw_ctl_t *old_ctl_ptr;
-#endif
-
-static int ip_fw_chk __P((struct ip **pip, int hlen,
- struct ifnet *oif, int ignport, struct mbuf **m));
-static int ip_fw_ctl __P((int stage, struct mbuf **mm));
-
-static char err_prefix[] = "ip_fw_ctl:";
-
-/*
- * Returns 1 if the port is matched by the vector, 0 otherwise
- */
-static inline int
-port_match(u_short *portptr, int nports, u_short port, int range_flag)
-{
- if (!nports)
- return 1;
- if (range_flag) {
- if (portptr[0] <= port && port <= portptr[1]) {
- return 1;
- }
- nports -= 2;
- portptr += 2;
- }
- while (nports-- > 0) {
- if (*portptr++ == port) {
- return 1;
- }
- }
- return 0;
-}
-
-static int
-tcpflg_match(struct tcphdr *tcp, struct ip_fw *f)
-{
- u_char flg_set, flg_clr;
-
- if ((f->fw_tcpf & IP_FW_TCPF_ESTAB) &&
- (tcp->th_flags & (IP_FW_TCPF_RST | IP_FW_TCPF_ACK)))
- return 1;
-
- flg_set = tcp->th_flags & f->fw_tcpf;
- flg_clr = tcp->th_flags & f->fw_tcpnf;
-
- if (flg_set != f->fw_tcpf)
- return 0;
- if (flg_clr)
- return 0;
-
- return 1;
-}
-
-static int
-icmptype_match(struct icmp *icmp, struct ip_fw *f)
-{
- int type;
-
- if (!(f->fw_flg & IP_FW_F_ICMPBIT))
- return(1);
-
- type = icmp->icmp_type;
-
- /* check for matching type in the bitmap */
- if (type < IP_FW_ICMPTYPES_DIM * sizeof(unsigned) * 8 &&
- (f->fw_icmptypes[type / (sizeof(unsigned) * 8)] &
- (1U << (type % (8 * sizeof(unsigned))))))
- return(1);
-
- return(0); /* no match */
-}
-
-static int
-ipopts_match(struct ip *ip, struct ip_fw *f)
-{
- register u_char *cp;
- int opt, optlen, cnt;
- u_char opts, nopts, nopts_sve;
-
- cp = (u_char *)(ip + 1);
- cnt = (ip->ip_hl << 2) - sizeof (struct ip);
- opts = f->fw_ipopt;
- nopts = nopts_sve = f->fw_ipnopt;
-
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[IPOPT_OLEN];
- if (optlen <= 0 || optlen > cnt) {
- return 0; /*XXX*/
- }
- }
- switch (opt) {
-
- default:
- break;
-
- case IPOPT_LSRR:
- opts &= ~IP_FW_IPOPT_LSRR;
- nopts &= ~IP_FW_IPOPT_LSRR;
- break;
-
- case IPOPT_SSRR:
- opts &= ~IP_FW_IPOPT_SSRR;
- nopts &= ~IP_FW_IPOPT_SSRR;
- break;
-
- case IPOPT_RR:
- opts &= ~IP_FW_IPOPT_RR;
- nopts &= ~IP_FW_IPOPT_RR;
- break;
- case IPOPT_TS:
- opts &= ~IP_FW_IPOPT_TS;
- nopts &= ~IP_FW_IPOPT_TS;
- break;
- }
- if (opts == nopts)
- break;
- }
- if (opts == 0 && nopts == nopts_sve)
- return 1;
- else
- return 0;
-}
-
-static inline int
-iface_match(struct ifnet *ifp, union ip_fw_if *ifu, int byname)
-{
- /* Check by name or by IP address */
- if (byname) {
- /* Check unit number (-1 is wildcard) */
- if (ifu->fu_via_if.unit != -1
- && ifp->if_unit != ifu->fu_via_if.unit)
- return(0);
- /* Check name */
- if (strncmp(ifp->if_name, ifu->fu_via_if.name, FW_IFNLEN))
- return(0);
- return(1);
- } else if (ifu->fu_via_ip.s_addr != 0) { /* Zero == wildcard */
- struct ifaddr *ia;
-
- for (ia = ifp->if_addrlist; ia; ia = ia->ifa_next) {
- if (ia->ifa_addr == NULL)
- continue;
- if (ia->ifa_addr->sa_family != AF_INET)
- continue;
- if (ifu->fu_via_ip.s_addr != ((struct sockaddr_in *)
- (ia->ifa_addr))->sin_addr.s_addr)
- continue;
- return(1);
- }
- return(0);
- }
- return(1);
-}
-
-static void
-ipfw_report(struct ip_fw *f, struct ip *ip,
- struct ifnet *rif, struct ifnet *oif)
-{
- static int counter;
- struct tcphdr *const tcp = (struct tcphdr *) ((u_long *) ip+ ip->ip_hl);
- struct udphdr *const udp = (struct udphdr *) ((u_long *) ip+ ip->ip_hl);
- struct icmp *const icmp = (struct icmp *) ((u_long *) ip + ip->ip_hl);
- int count;
-
- count = f ? f->fw_pcnt : ++counter;
- if (fw_verbose_limit != 0 && count > fw_verbose_limit)
- return;
-
- /* Print command name */
- printf("ipfw: %d ", f ? f->fw_number : -1);
- if (!f)
- printf("Refuse");
- else
- switch (f->fw_flg & IP_FW_F_COMMAND) {
- case IP_FW_F_DENY:
- printf("Deny");
- break;
- case IP_FW_F_REJECT:
- if (f->fw_reject_code == IP_FW_REJECT_RST)
- printf("Reset");
- else
- printf("Unreach");
- break;
- case IP_FW_F_ACCEPT:
- printf("Accept");
- break;
- case IP_FW_F_COUNT:
- printf("Count");
- break;
- case IP_FW_F_DIVERT:
- printf("Divert %d", f->fw_divert_port);
- break;
- case IP_FW_F_TEE:
- printf("Tee %d", f->fw_divert_port);
- break;
- case IP_FW_F_SKIPTO:
- printf("SkipTo %d", f->fw_skipto_rule);
- break;
- default:
- printf("UNKNOWN");
- break;
- }
- printf(" ");
-
- switch (ip->ip_p) {
- case IPPROTO_TCP:
- printf("TCP ");
- print_ip(ip->ip_src);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d ", ntohs(tcp->th_sport));
- else
- printf(" ");
- print_ip(ip->ip_dst);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d", ntohs(tcp->th_dport));
- break;
- case IPPROTO_UDP:
- printf("UDP ");
- print_ip(ip->ip_src);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d ", ntohs(udp->uh_sport));
- else
- printf(" ");
- print_ip(ip->ip_dst);
- if ((ip->ip_off & IP_OFFMASK) == 0)
- printf(":%d", ntohs(udp->uh_dport));
- break;
- case IPPROTO_ICMP:
- printf("ICMP:%u.%u ", icmp->icmp_type, icmp->icmp_code);
- print_ip(ip->ip_src);
- printf(" ");
- print_ip(ip->ip_dst);
- break;
- default:
- printf("P:%d ", ip->ip_p);
- print_ip(ip->ip_src);
- printf(" ");
- print_ip(ip->ip_dst);
- break;
- }
- if (oif)
- printf(" out via %s%d", oif->if_name, oif->if_unit);
- else if (rif)
- printf(" in via %s%d", rif->if_name, rif->if_unit);
- if ((ip->ip_off & IP_OFFMASK))
- printf(" Fragment = %d",ip->ip_off & IP_OFFMASK);
- printf("\n");
- if (fw_verbose_limit != 0 && count == fw_verbose_limit)
- printf("ipfw: limit reached on rule #%d\n",
- f ? f->fw_number : -1);
-}
-
-/*
- * Parameters:
- *
- * ip Pointer to packet header (struct ip *)
- * hlen Packet header length
- * oif Outgoing interface, or NULL if packet is incoming
- * ignport Ignore all divert/tee rules to this port (if non-zero)
- * *m The packet; we set to NULL when/if we nuke it.
- *
- * Return value:
- *
- * 0 The packet is to be accepted and routed normally OR
- * the packet was denied/rejected and has been dropped;
- * in the latter case, *m is equal to NULL upon return.
- * port Divert the packet to port.
- */
-
-static int
-ip_fw_chk(struct ip **pip, int hlen,
- struct ifnet *oif, int ignport, struct mbuf **m)
-{
- struct ip_fw_chain *chain;
- struct ip_fw *rule = NULL;
- struct ip *ip = *pip;
- struct ifnet *const rif = (*m)->m_pkthdr.rcvif;
- u_short offset = (ip->ip_off & IP_OFFMASK);
- u_short src_port, dst_port;
-
- /*
- * Go down the chain, looking for enlightment
- */
- for (chain=ip_fw_chain.lh_first; chain; chain = chain->chain.le_next) {
- register struct ip_fw *const f = chain->rule;
-
- /* Check direction inbound */
- if (!oif && !(f->fw_flg & IP_FW_F_IN))
- continue;
-
- /* Check direction outbound */
- if (oif && !(f->fw_flg & IP_FW_F_OUT))
- continue;
-
- /* Fragments */
- if ((f->fw_flg & IP_FW_F_FRAG) && !(ip->ip_off & IP_OFFMASK))
- continue;
-
- /* If src-addr doesn't match, not this rule. */
- if (((f->fw_flg & IP_FW_F_INVSRC) != 0) ^ ((ip->ip_src.s_addr
- & f->fw_smsk.s_addr) != f->fw_src.s_addr))
- continue;
-
- /* If dest-addr doesn't match, not this rule. */
- if (((f->fw_flg & IP_FW_F_INVDST) != 0) ^ ((ip->ip_dst.s_addr
- & f->fw_dmsk.s_addr) != f->fw_dst.s_addr))
- continue;
-
- /* Interface check */
- if ((f->fw_flg & IF_FW_F_VIAHACK) == IF_FW_F_VIAHACK) {
- struct ifnet *const iface = oif ? oif : rif;
-
- /* Backwards compatibility hack for "via" */
- if (!iface || !iface_match(iface,
- &f->fw_in_if, f->fw_flg & IP_FW_F_OIFNAME))
- continue;
- } else {
- /* Check receive interface */
- if ((f->fw_flg & IP_FW_F_IIFACE)
- && (!rif || !iface_match(rif,
- &f->fw_in_if, f->fw_flg & IP_FW_F_IIFNAME)))
- continue;
- /* Check outgoing interface */
- if ((f->fw_flg & IP_FW_F_OIFACE)
- && (!oif || !iface_match(oif,
- &f->fw_out_if, f->fw_flg & IP_FW_F_OIFNAME)))
- continue;
- }
-
- /* Check IP options */
- if (f->fw_ipopt != f->fw_ipnopt && !ipopts_match(ip, f))
- continue;
-
- /* Check protocol; if wildcard, match */
- if (f->fw_prot == IPPROTO_IP)
- goto got_match;
-
- /* If different, don't match */
- if (ip->ip_p != f->fw_prot)
- continue;
-
-#define PULLUP_TO(len) do { \
- if ((*m)->m_len < (len) \
- && (*m = m_pullup(*m, (len))) == 0) { \
- goto bogusfrag; \
- } \
- *pip = ip = mtod(*m, struct ip *); \
- offset = (ip->ip_off & IP_OFFMASK); \
- } while (0)
-
- /* Protocol specific checks */
- switch (ip->ip_p) {
- case IPPROTO_TCP:
- {
- struct tcphdr *tcp;
-
- if (offset == 1) /* cf. RFC 1858 */
- goto bogusfrag;
- if (offset != 0) {
- /*
- * TCP flags and ports aren't available in this
- * packet -- if this rule specified either one,
- * we consider the rule a non-match.
- */
- if (f->fw_nports != 0 ||
- f->fw_tcpf != f->fw_tcpnf)
- continue;
-
- break;
- }
- PULLUP_TO(hlen + 14);
- tcp = (struct tcphdr *) ((u_long *)ip + ip->ip_hl);
- if (f->fw_tcpf != f->fw_tcpnf && !tcpflg_match(tcp, f))
- continue;
- src_port = ntohs(tcp->th_sport);
- dst_port = ntohs(tcp->th_dport);
- goto check_ports;
- }
-
- case IPPROTO_UDP:
- {
- struct udphdr *udp;
-
- if (offset != 0) {
- /*
- * Port specification is unavailable -- if this
- * rule specifies a port, we consider the rule
- * a non-match.
- */
- if (f->fw_nports != 0)
- continue;
-
- break;
- }
- PULLUP_TO(hlen + 4);
- udp = (struct udphdr *) ((u_long *)ip + ip->ip_hl);
- src_port = ntohs(udp->uh_sport);
- dst_port = ntohs(udp->uh_dport);
-check_ports:
- if (!port_match(&f->fw_pts[0],
- IP_FW_GETNSRCP(f), src_port,
- f->fw_flg & IP_FW_F_SRNG))
- continue;
- if (!port_match(&f->fw_pts[IP_FW_GETNSRCP(f)],
- IP_FW_GETNDSTP(f), dst_port,
- f->fw_flg & IP_FW_F_DRNG))
- continue;
- break;
- }
-
- case IPPROTO_ICMP:
- {
- struct icmp *icmp;
-
- if (offset != 0) /* Type isn't valid */
- break;
- PULLUP_TO(hlen + 2);
- icmp = (struct icmp *) ((u_long *)ip + ip->ip_hl);
- if (!icmptype_match(icmp, f))
- continue;
- break;
- }
-#undef PULLUP_TO
-
-bogusfrag:
- if (fw_verbose)
- ipfw_report(NULL, ip, rif, oif);
- goto dropit;
- }
-
-got_match:
- /* Ignore divert/tee rule if socket port is "ignport" */
- switch (f->fw_flg & IP_FW_F_COMMAND) {
- case IP_FW_F_DIVERT:
- case IP_FW_F_TEE:
- if (f->fw_divert_port == ignport)
- continue; /* ignore this rule */
- break;
- }
-
- /* Update statistics */
- f->fw_pcnt += 1;
- f->fw_bcnt += ip->ip_len;
- f->timestamp = rtems_bsdnet_seconds_since_boot();
-
- /* Log to console if desired */
- if ((f->fw_flg & IP_FW_F_PRN) && fw_verbose)
- ipfw_report(f, ip, rif, oif);
-
- /* Take appropriate action */
- switch (f->fw_flg & IP_FW_F_COMMAND) {
- case IP_FW_F_ACCEPT:
- return(0);
- case IP_FW_F_COUNT:
- continue;
- case IP_FW_F_DIVERT:
- return(f->fw_divert_port);
- case IP_FW_F_TEE:
- /*
- * XXX someday tee packet here, but beware that you
- * can't use m_copym() or m_copypacket() because
- * the divert input routine modifies the mbuf
- * (and these routines only increment reference
- * counts in the case of mbuf clusters), so need
- * to write custom routine.
- */
- continue;
- case IP_FW_F_SKIPTO:
-#ifdef DIAGNOSTIC
- while (chain->chain.le_next
- && chain->chain.le_next->rule->fw_number
- < f->fw_skipto_rule)
-#else
- while (chain->chain.le_next->rule->fw_number
- < f->fw_skipto_rule)
-#endif
- chain = chain->chain.le_next;
- continue;
- }
-
- /* Deny/reject this packet using this rule */
- rule = f;
- break;
- }
-
-#ifdef DIAGNOSTIC
- /* Rule 65535 should always be there and should always match */
- if (!chain)
- panic("ip_fw: chain");
-#endif
-
- /*
- * At this point, we're going to drop the packet.
- * Send a reject notice if all of the following are true:
- *
- * - The packet matched a reject rule
- * - The packet is not an ICMP packet
- * - The packet is not a multicast or broadcast packet
- */
- if ((rule->fw_flg & IP_FW_F_COMMAND) == IP_FW_F_REJECT
- && ip->ip_p != IPPROTO_ICMP
- && !((*m)->m_flags & (M_BCAST|M_MCAST))
- && !IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- switch (rule->fw_reject_code) {
- case IP_FW_REJECT_RST:
- {
- struct tcphdr *const tcp =
- (struct tcphdr *) ((u_long *)ip + ip->ip_hl);
- struct tcpiphdr ti, *const tip = (struct tcpiphdr *) ip;
-
- if (offset != 0 || (tcp->th_flags & TH_RST))
- break;
- ti.ti_i = *((struct ipovly *) ip);
- ti.ti_t = *tcp;
- bcopy(&ti, ip, sizeof(ti));
- NTOHL(tip->ti_seq);
- NTOHL(tip->ti_ack);
- tip->ti_len = ip->ip_len - hlen - (tip->ti_off << 2);
- if (tcp->th_flags & TH_ACK) {
- tcp_respond(NULL, tip, *m,
- (tcp_seq)0, ntohl(tcp->th_ack), TH_RST);
- } else {
- if (tcp->th_flags & TH_SYN)
- tip->ti_len++;
- tcp_respond(NULL, tip, *m, tip->ti_seq
- + tip->ti_len, (tcp_seq)0, TH_RST|TH_ACK);
- }
- *m = NULL;
- break;
- }
- default: /* Send an ICMP unreachable using code */
- icmp_error(*m, ICMP_UNREACH,
- rule->fw_reject_code, 0L, 0);
- *m = NULL;
- break;
- }
- }
-
-dropit:
- /*
- * Finally, drop the packet.
- */
- if (*m) {
- m_freem(*m);
- *m = NULL;
- }
- return(0);
-}
-
-static int
-add_entry(struct ip_fw_head *chainptr, struct ip_fw *frwl)
-{
- struct ip_fw *ftmp = 0;
- struct ip_fw_chain *fwc = 0, *fcp, *fcpl = 0;
- u_short nbr = 0;
- int s;
-
- fwc = malloc(sizeof *fwc, M_IPFW, M_DONTWAIT);
- ftmp = malloc(sizeof *ftmp, M_IPFW, M_DONTWAIT);
- if (!fwc || !ftmp) {
- dprintf(("%s malloc said no\n", err_prefix));
- if (fwc) free(fwc, M_IPFW);
- if (ftmp) free(ftmp, M_IPFW);
- return (ENOSPC);
- }
-
- bcopy(frwl, ftmp, sizeof(struct ip_fw));
- ftmp->fw_in_if.fu_via_if.name[FW_IFNLEN - 1] = '\0';
- ftmp->fw_pcnt = 0L;
- ftmp->fw_bcnt = 0L;
- fwc->rule = ftmp;
-
- s = splnet();
-
- if (!chainptr->lh_first) {
- LIST_INSERT_HEAD(chainptr, fwc, chain);
- splx(s);
- return(0);
- } else if (ftmp->fw_number == (u_short)-1) {
- if (fwc) free(fwc, M_IPFW);
- if (ftmp) free(ftmp, M_IPFW);
- splx(s);
- dprintf(("%s bad rule number\n", err_prefix));
- return (EINVAL);
- }
-
- /* If entry number is 0, find highest numbered rule and add 100 */
- if (ftmp->fw_number == 0) {
- for (fcp = chainptr->lh_first; fcp; fcp = fcp->chain.le_next) {
- if (fcp->rule->fw_number != (u_short)-1)
- nbr = fcp->rule->fw_number;
- else
- break;
- }
- if (nbr < (u_short)-1 - 100)
- nbr += 100;
- ftmp->fw_number = nbr;
- }
-
- /* Got a valid number; now insert it, keeping the list ordered */
- for (fcp = chainptr->lh_first; fcp; fcp = fcp->chain.le_next) {
- if (fcp->rule->fw_number > ftmp->fw_number) {
- if (fcpl) {
- LIST_INSERT_AFTER(fcpl, fwc, chain);
- } else {
- LIST_INSERT_HEAD(chainptr, fwc, chain);
- }
- break;
- } else {
- fcpl = fcp;
- }
- }
-
- splx(s);
- return (0);
-}
-
-static int
-del_entry(struct ip_fw_head *chainptr, u_short number)
-{
- struct ip_fw_chain *fcp;
- int s;
-
- s = splnet();
-
- fcp = chainptr->lh_first;
- if (number != (u_short)-1) {
- for (; fcp; fcp = fcp->chain.le_next) {
- if (fcp->rule->fw_number == number) {
- LIST_REMOVE(fcp, chain);
- splx(s);
- free(fcp->rule, M_IPFW);
- free(fcp, M_IPFW);
- return 0;
- }
- }
- }
-
- splx(s);
- return (EINVAL);
-}
-
-static int
-zero_entry(struct mbuf *m)
-{
- struct ip_fw *frwl;
- struct ip_fw_chain *fcp;
- int s;
-
- if (m) {
- if (m->m_len != sizeof(struct ip_fw))
- return(EINVAL);
- frwl = mtod(m, struct ip_fw *);
- }
- else
- frwl = NULL;
-
- /*
- * It's possible to insert multiple chain entries with the
- * same number, so we don't stop after finding the first
- * match if zeroing a specific entry.
- */
- s = splnet();
- for (fcp = ip_fw_chain.lh_first; fcp; fcp = fcp->chain.le_next)
- if (!frwl || frwl->fw_number == fcp->rule->fw_number) {
- fcp->rule->fw_bcnt = fcp->rule->fw_pcnt = 0;
- fcp->rule->timestamp = 0;
- }
- splx(s);
-
- if (fw_verbose) {
- if (frwl)
- printf("ipfw: Entry %d cleared.\n", frwl->fw_number);
- else
- printf("ipfw: Accounting cleared.\n");
- }
-
- return(0);
-}
-
-static struct ip_fw *
-check_ipfw_mbuf(struct mbuf *m)
-{
- /* Check length */
- if (m->m_len != sizeof(struct ip_fw)) {
- dprintf(("%s len=%d, want %d\n", err_prefix, m->m_len,
- (int)sizeof(struct ip_fw)));
- return (NULL);
- }
- return(check_ipfw_struct(mtod(m, struct ip_fw *)));
-}
-
-static struct ip_fw *
-check_ipfw_struct(struct ip_fw *frwl)
-{
- /* Check for invalid flag bits */
- if ((frwl->fw_flg & ~IP_FW_F_MASK) != 0) {
- dprintf(("%s undefined flag bits set (flags=%x)\n",
- err_prefix, frwl->fw_flg));
- return (NULL);
- }
- /* Must apply to incoming or outgoing (or both) */
- if (!(frwl->fw_flg & (IP_FW_F_IN | IP_FW_F_OUT))) {
- dprintf(("%s neither in nor out\n", err_prefix));
- return (NULL);
- }
- /* Empty interface name is no good */
- if (((frwl->fw_flg & IP_FW_F_IIFNAME)
- && !*frwl->fw_in_if.fu_via_if.name)
- || ((frwl->fw_flg & IP_FW_F_OIFNAME)
- && !*frwl->fw_out_if.fu_via_if.name)) {
- dprintf(("%s empty interface name\n", err_prefix));
- return (NULL);
- }
- /* Sanity check interface matching */
- if ((frwl->fw_flg & IF_FW_F_VIAHACK) == IF_FW_F_VIAHACK) {
- ; /* allow "via" backwards compatibility */
- } else if ((frwl->fw_flg & IP_FW_F_IN)
- && (frwl->fw_flg & IP_FW_F_OIFACE)) {
- dprintf(("%s outgoing interface check on incoming\n",
- err_prefix));
- return (NULL);
- }
- /* Sanity check port ranges */
- if ((frwl->fw_flg & IP_FW_F_SRNG) && IP_FW_GETNSRCP(frwl) < 2) {
- dprintf(("%s src range set but n_src_p=%d\n",
- err_prefix, IP_FW_GETNSRCP(frwl)));
- return (NULL);
- }
- if ((frwl->fw_flg & IP_FW_F_DRNG) && IP_FW_GETNDSTP(frwl) < 2) {
- dprintf(("%s dst range set but n_dst_p=%d\n",
- err_prefix, IP_FW_GETNDSTP(frwl)));
- return (NULL);
- }
- if (IP_FW_GETNSRCP(frwl) + IP_FW_GETNDSTP(frwl) > IP_FW_MAX_PORTS) {
- dprintf(("%s too many ports (%d+%d)\n",
- err_prefix, IP_FW_GETNSRCP(frwl), IP_FW_GETNDSTP(frwl)));
- return (NULL);
- }
- /*
- * Protocols other than TCP/UDP don't use port range
- */
- if ((frwl->fw_prot != IPPROTO_TCP) &&
- (frwl->fw_prot != IPPROTO_UDP) &&
- (IP_FW_GETNSRCP(frwl) || IP_FW_GETNDSTP(frwl))) {
- dprintf(("%s port(s) specified for non TCP/UDP rule\n",
- err_prefix));
- return(NULL);
- }
-
- /*
- * Rather than modify the entry to make such entries work,
- * we reject this rule and require user level utilities
- * to enforce whatever policy they deem appropriate.
- */
- if ((frwl->fw_src.s_addr & (~frwl->fw_smsk.s_addr)) ||
- (frwl->fw_dst.s_addr & (~frwl->fw_dmsk.s_addr))) {
- dprintf(("%s rule never matches\n", err_prefix));
- return(NULL);
- }
-
- if ((frwl->fw_flg & IP_FW_F_FRAG) &&
- (frwl->fw_prot == IPPROTO_UDP || frwl->fw_prot == IPPROTO_TCP)) {
- if (frwl->fw_nports) {
- dprintf(("%s cannot mix 'frag' and ports\n", err_prefix));
- return(NULL);
- }
- if (frwl->fw_prot == IPPROTO_TCP &&
- frwl->fw_tcpf != frwl->fw_tcpnf) {
- dprintf(("%s cannot mix 'frag' with TCP flags\n", err_prefix));
- return(NULL);
- }
- }
-
- /* Check command specific stuff */
- switch (frwl->fw_flg & IP_FW_F_COMMAND)
- {
- case IP_FW_F_REJECT:
- if (frwl->fw_reject_code >= 0x100
- && !(frwl->fw_prot == IPPROTO_TCP
- && frwl->fw_reject_code == IP_FW_REJECT_RST)) {
- dprintf(("%s unknown reject code\n", err_prefix));
- return(NULL);
- }
- break;
- case IP_FW_F_DIVERT: /* Diverting to port zero is invalid */
- case IP_FW_F_TEE:
- if (frwl->fw_divert_port == 0) {
- dprintf(("%s can't divert to port 0\n", err_prefix));
- return (NULL);
- }
- break;
- case IP_FW_F_DENY:
- case IP_FW_F_ACCEPT:
- case IP_FW_F_COUNT:
- case IP_FW_F_SKIPTO:
- break;
- default:
- dprintf(("%s invalid command\n", err_prefix));
- return(NULL);
- }
-
- return frwl;
-}
-
-static int
-ip_fw_ctl(int stage, struct mbuf **mm)
-{
- int error;
- struct mbuf *m;
-
- if (stage == IP_FW_GET) {
- struct ip_fw_chain *fcp = ip_fw_chain.lh_first;
- *mm = m = m_get(M_WAIT, MT_SOOPTS);
- for (; fcp; fcp = fcp->chain.le_next) {
- memcpy(m->m_data, fcp->rule, sizeof *(fcp->rule));
- m->m_len = sizeof *(fcp->rule);
- m->m_next = m_get(M_WAIT, MT_SOOPTS);
- m = m->m_next;
- m->m_len = 0;
- }
- return (0);
- }
- m = *mm;
- /* only allow get calls if secure mode > 2 */
- if (securelevel > 2) {
- if (m) (void)m_free(m);
- return(EPERM);
- }
- if (stage == IP_FW_FLUSH) {
- while (ip_fw_chain.lh_first != NULL &&
- ip_fw_chain.lh_first->rule->fw_number != (u_short)-1) {
- struct ip_fw_chain *fcp = ip_fw_chain.lh_first;
- int s = splnet();
- LIST_REMOVE(ip_fw_chain.lh_first, chain);
- splx(s);
- free(fcp->rule, M_IPFW);
- free(fcp, M_IPFW);
- }
- if (m) (void)m_free(m);
- return (0);
- }
- if (stage == IP_FW_ZERO) {
- error = zero_entry(m);
- if (m) (void)m_free(m);
- return (error);
- }
- if (m == NULL) {
- printf("%s NULL mbuf ptr\n", err_prefix);
- return (EINVAL);
- }
-
- if (stage == IP_FW_ADD) {
- struct ip_fw *frwl = check_ipfw_mbuf(m);
-
- if (!frwl)
- error = EINVAL;
- else
- error = add_entry(&ip_fw_chain, frwl);
- if (m) (void)m_free(m);
- return error;
- }
- if (stage == IP_FW_DEL) {
- if (m->m_len != sizeof(struct ip_fw)) {
- dprintf(("%s len=%d, want %d\n", err_prefix, m->m_len,
- (int)sizeof(struct ip_fw)));
- error = EINVAL;
- } else if (mtod(m, struct ip_fw *)->fw_number == (u_short)-1) {
- dprintf(("%s can't delete rule 65535\n", err_prefix));
- error = EINVAL;
- } else
- error = del_entry(&ip_fw_chain,
- mtod(m, struct ip_fw *)->fw_number);
- if (m) (void)m_free(m);
- return error;
- }
-
- dprintf(("%s unknown request %d\n", err_prefix, stage));
- if (m) (void)m_free(m);
- return (EINVAL);
-}
-
-void
-ip_fw_init(void)
-{
- struct ip_fw default_rule;
-
- ip_fw_chk_ptr = ip_fw_chk;
- ip_fw_ctl_ptr = ip_fw_ctl;
- LIST_INIT(&ip_fw_chain);
-
- bzero(&default_rule, sizeof default_rule);
- default_rule.fw_prot = IPPROTO_IP;
- default_rule.fw_number = (u_short)-1;
-#ifdef IPFIREWALL_DEFAULT_TO_ACCEPT
- default_rule.fw_flg |= IP_FW_F_ACCEPT;
-#else
- default_rule.fw_flg |= IP_FW_F_DENY;
-#endif
- default_rule.fw_flg |= IP_FW_F_IN | IP_FW_F_OUT;
- if (check_ipfw_struct(&default_rule) == NULL ||
- add_entry(&ip_fw_chain, &default_rule))
- panic(__FUNCTION__);
-
- printf("IP packet filtering initialized, "
-#ifdef IPDIVERT
- "divert enabled, ");
-#else
- "divert disabled, ");
-#endif
-#ifdef IPFIREWALL_DEFAULT_TO_ACCEPT
- printf("default to accept, ");
-#endif
-#ifndef IPFIREWALL_VERBOSE
- printf("logging disabled\n");
-#else
- if (fw_verbose_limit == 0)
- printf("unlimited logging\n");
- else
- printf("logging limited to %d packets/entry\n",
- fw_verbose_limit);
-#endif
-}
-
-#ifdef IPFIREWALL_MODULE
-
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-MOD_MISC(ipfw);
-
-static int
-ipfw_load(struct lkm_table *lkmtp, int cmd)
-{
- int s=splnet();
-
- old_chk_ptr = ip_fw_chk_ptr;
- old_ctl_ptr = ip_fw_ctl_ptr;
-
- ip_fw_init();
- splx(s);
- return 0;
-}
-
-static int
-ipfw_unload(struct lkm_table *lkmtp, int cmd)
-{
- int s=splnet();
-
- ip_fw_chk_ptr = old_chk_ptr;
- ip_fw_ctl_ptr = old_ctl_ptr;
-
- while (ip_fw_chain.lh_first != NULL) {
- struct ip_fw_chain *fcp = ip_fw_chain.lh_first;
- LIST_REMOVE(ip_fw_chain.lh_first, chain);
- free(fcp->rule, M_IPFW);
- free(fcp, M_IPFW);
- }
-
- splx(s);
- printf("IP firewall unloaded\n");
- return 0;
-}
-
-int
-ipfw_mod(struct lkm_table *lkmtp, int cmd, int ver)
-{
- DISPATCH(lkmtp, cmd, ver, ipfw_load, ipfw_unload, lkm_nullcmd);
-}
-#endif
diff --git a/cpukit/libnetworking/netinet/ip_fw.h b/cpukit/libnetworking/netinet/ip_fw.h
deleted file mode 100644
index cab7f4ac93..0000000000
--- a/cpukit/libnetworking/netinet/ip_fw.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 1993 Daniel Boulet
- * Copyright (c) 1994 Ugen J.S.Antsilevich
- *
- * Redistribution and use in source forms, with and without modification,
- * are permitted provided that this entire comment appears intact.
- *
- * Redistribution in binary form may occur without any restrictions.
- * Obviously, it would be nice if you gave credit where credit is due
- * but requiring it would be too onerous.
- *
- * This software is provided ``AS IS'' without any warranties of any kind.
- *
- * $Id$
- */
-
-#ifndef _IP_FW_H
-#define _IP_FW_H
-
-#include <net/if.h>
-
-/*
- * This union structure identifies an interface, either explicitly
- * by name or implicitly by IP address. The flags IP_FW_F_IIFNAME
- * and IP_FW_F_OIFNAME say how to interpret this structure. An
- * interface unit number of -1 matches any unit number, while an
- * IP address of 0.0.0.0 indicates matches any interface.
- *
- * The receive and transmit interfaces are only compared against the
- * the packet if the corresponding bit (IP_FW_F_IIFACE or IP_FW_F_OIFACE)
- * is set. Note some packets lack a receive or transmit interface
- * (in which case the missing "interface" never matches).
- */
-
-union ip_fw_if {
- struct in_addr fu_via_ip; /* Specified by IP address */
- struct { /* Specified by interface name */
-#define FW_IFNLEN IFNAMSIZ
- char name[FW_IFNLEN];
- short unit; /* -1 means match any unit */
- } fu_via_if;
-};
-
-/*
- * Format of an IP firewall descriptor
- *
- * fw_src, fw_dst, fw_smsk, fw_dmsk are always stored in network byte order.
- * fw_flg and fw_n*p are stored in host byte order (of course).
- * Port numbers are stored in HOST byte order.
- * Warning: setsockopt() will fail if sizeof(struct ip_fw) > MLEN (108)
- */
-
-struct ip_fw {
- u_long fw_pcnt,fw_bcnt; /* Packet and byte counters */
- struct in_addr fw_src, fw_dst; /* Source and destination IP addr */
- struct in_addr fw_smsk, fw_dmsk; /* Mask for src and dest IP addr */
- u_short fw_number; /* Rule number */
- u_short fw_flg; /* Flags word */
-#define IP_FW_MAX_PORTS 10 /* A reasonable maximum */
- u_short fw_pts[IP_FW_MAX_PORTS]; /* Array of port numbers to match */
- u_char fw_ipopt,fw_ipnopt; /* IP options set/unset */
- u_char fw_tcpf,fw_tcpnf; /* TCP flags set/unset */
-#define IP_FW_ICMPTYPES_DIM (32 / (sizeof(unsigned) * 8))
- unsigned fw_icmptypes[IP_FW_ICMPTYPES_DIM]; /* ICMP types bitmap */
- long timestamp; /* timestamp (tv_sec) of last match */
- union ip_fw_if fw_in_if, fw_out_if; /* Incoming and outgoing interfaces */
- union {
- u_short fu_divert_port; /* Divert/tee port (options IPDIVERT) */
- u_short fu_skipto_rule; /* SKIPTO command rule number */
- u_short fu_reject_code; /* REJECT response code */
- } fw_un;
- u_char fw_prot; /* IP protocol */
- u_char fw_nports; /* N'of src ports and # of dst ports */
- /* in ports array (dst ports follow */
- /* src ports; max of 10 ports in all; */
- /* count of 0 means match all ports) */
-};
-
-#define IP_FW_GETNSRCP(rule) ((rule)->fw_nports & 0x0f)
-#define IP_FW_SETNSRCP(rule, n) do { \
- (rule)->fw_nports &= ~0x0f; \
- (rule)->fw_nports |= (n); \
- } while (0)
-#define IP_FW_GETNDSTP(rule) ((rule)->fw_nports >> 4)
-#define IP_FW_SETNDSTP(rule, n) do { \
- (rule)->fw_nports &= ~0xf0; \
- (rule)->fw_nports |= (n) << 4;\
- } while (0)
-
-#define fw_divert_port fw_un.fu_divert_port
-#define fw_skipto_rule fw_un.fu_skipto_rule
-#define fw_reject_code fw_un.fu_reject_code
-
-struct ip_fw_chain {
- LIST_ENTRY(ip_fw_chain) chain;
- struct ip_fw *rule;
-};
-
-/*
- * Values for "flags" field .
- */
-#define IP_FW_F_IN 0x0001 /* Check inbound packets */
-#define IP_FW_F_OUT 0x0002 /* Check outbound packets */
-#define IP_FW_F_IIFACE 0x0004 /* Apply inbound interface test */
-#define IP_FW_F_OIFACE 0x0008 /* Apply outbound interface test */
-
-#define IP_FW_F_COMMAND 0x0070 /* Mask for type of chain entry: */
-#define IP_FW_F_DENY 0x0000 /* This is a deny rule */
-#define IP_FW_F_REJECT 0x0010 /* Deny and send a response packet */
-#define IP_FW_F_ACCEPT 0x0020 /* This is an accept rule */
-#define IP_FW_F_COUNT 0x0030 /* This is a count rule */
-#define IP_FW_F_DIVERT 0x0040 /* This is a divert rule */
-#define IP_FW_F_TEE 0x0050 /* This is a tee rule */
-#define IP_FW_F_SKIPTO 0x0060 /* This is a skipto rule */
-
-#define IP_FW_F_PRN 0x0080 /* Print if this rule matches */
-
-#define IP_FW_F_SRNG 0x0100 /* The first two src ports are a min *
- * and max range (stored in host byte *
- * order). */
-
-#define IP_FW_F_DRNG 0x0200 /* The first two dst ports are a min *
- * and max range (stored in host byte *
- * order). */
-
-#define IP_FW_F_IIFNAME 0x0400 /* In interface by name/unit (not IP) */
-#define IP_FW_F_OIFNAME 0x0800 /* Out interface by name/unit (not IP) */
-
-#define IP_FW_F_INVSRC 0x1000 /* Invert sense of src check */
-#define IP_FW_F_INVDST 0x2000 /* Invert sense of dst check */
-
-#define IP_FW_F_FRAG 0x4000 /* Fragment */
-
-#define IP_FW_F_ICMPBIT 0x8000 /* ICMP type bitmap is valid */
-
-#define IP_FW_F_MASK 0xFFFF /* All possible flag bits mask */
-
-/*
- * For backwards compatibility with rules specifying "via iface" but
- * not restricted to only "in" or "out" packets, we define this combination
- * of bits to represent this configuration.
- */
-
-#define IF_FW_F_VIAHACK (IP_FW_F_IN|IP_FW_F_OUT|IP_FW_F_IIFACE|IP_FW_F_OIFACE)
-
-/*
- * Definitions for REJECT response codes.
- * Values less than 256 correspond to ICMP unreachable codes.
- */
-#define IP_FW_REJECT_RST 0x0100 /* TCP packets: send RST */
-
-/*
- * Definitions for IP option names.
- */
-#define IP_FW_IPOPT_LSRR 0x01
-#define IP_FW_IPOPT_SSRR 0x02
-#define IP_FW_IPOPT_RR 0x04
-#define IP_FW_IPOPT_TS 0x08
-
-/*
- * Definitions for TCP flags.
- */
-#define IP_FW_TCPF_FIN TH_FIN
-#define IP_FW_TCPF_SYN TH_SYN
-#define IP_FW_TCPF_RST TH_RST
-#define IP_FW_TCPF_PSH TH_PUSH
-#define IP_FW_TCPF_ACK TH_ACK
-#define IP_FW_TCPF_URG TH_URG
-#define IP_FW_TCPF_ESTAB 0x40
-
-/*
- * Main firewall chains definitions and global var's definitions.
- */
-#ifdef KERNEL
-
-/*
- * Function definitions.
- */
-void ip_fw_init(void);
-
-#endif /* KERNEL */
-
-#endif /* _IP_FW_H */
diff --git a/cpukit/libnetworking/netinet/ip_icmp.c b/cpukit/libnetworking/netinet/ip_icmp.c
deleted file mode 100644
index a18dacca99..0000000000
--- a/cpukit/libnetworking/netinet/ip_icmp.c
+++ /dev/null
@@ -1,710 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#define _IP_VHL
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/ip_var.h>
-#include <netinet/icmp_var.h>
-
-/*
- * ICMP routines: error generation, receive packet processing, and
- * routines to turnaround packets back to the originator, and
- * host table maintenance routines.
- */
-
- struct icmpstat icmpstat;
-SYSCTL_STRUCT(_net_inet_icmp, ICMPCTL_STATS, stats, CTLFLAG_RD,
- &icmpstat, icmpstat, "");
-
-static int icmpmaskrepl = 0;
-SYSCTL_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_RW,
- &icmpmaskrepl, 0, "");
-
-static int icmpbmcastecho = 1;
-SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, &icmpbmcastecho,
- 0, "");
-
-#ifdef ICMPPRINTFS
-int icmpprintfs = 0;
-#endif
-
-static void icmp_reflect __P((struct mbuf *));
-static void icmp_send __P((struct mbuf *, struct mbuf *));
-static int ip_next_mtu __P((int, int));
-
-extern struct protosw inetsw[];
-
-/*
- * Generate an error packet of type error
- * in response to bad packet ip.
- */
-void
-icmp_error(n, type, code, dest, destifp)
- struct mbuf *n;
- int type, code;
- n_long dest;
- struct ifnet *destifp;
-{
- register struct ip *oip = mtod(n, struct ip *), *nip;
- register unsigned oiplen = IP_VHL_HL(oip->ip_vhl) << 2;
- register struct icmp *icp;
- register struct mbuf *m;
- unsigned icmplen;
-
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("icmp_error(%p, %x, %d)\n", oip, type, code);
-#endif
- if (type != ICMP_REDIRECT)
- icmpstat.icps_error++;
- /*
- * Don't send error if not the first fragment of message.
- * Don't error if the old packet protocol was ICMP
- * error message, only known informational types.
- */
- if (oip->ip_off &~ (IP_MF|IP_DF))
- goto freeit;
- if (oip->ip_p == IPPROTO_ICMP && type != ICMP_REDIRECT &&
- n->m_len >= oiplen + ICMP_MINLEN &&
- !ICMP_INFOTYPE(((struct icmp *)((caddr_t)oip + oiplen))->icmp_type)) {
- icmpstat.icps_oldicmp++;
- goto freeit;
- }
- /* Don't send error in response to a multicast or broadcast packet */
- if (n->m_flags & (M_BCAST|M_MCAST))
- goto freeit;
- /*
- * First, formulate icmp message
- */
- m = m_gethdr(M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- goto freeit;
- icmplen = oiplen + min(8, oip->ip_len);
- m->m_len = icmplen + ICMP_MINLEN;
- MH_ALIGN(m, m->m_len);
- icp = mtod(m, struct icmp *);
- if ((u_int)type > ICMP_MAXTYPE)
- panic("icmp_error");
- icmpstat.icps_outhist[type]++;
- icp->icmp_type = type;
- if (type == ICMP_REDIRECT)
- icp->icmp_gwaddr.s_addr = dest;
- else {
- icp->icmp_void = 0;
- /*
- * The following assignments assume an overlay with the
- * zeroed icmp_void field.
- */
- if (type == ICMP_PARAMPROB) {
- icp->icmp_pptr = code;
- code = 0;
- } else if (type == ICMP_UNREACH &&
- code == ICMP_UNREACH_NEEDFRAG && destifp) {
- icp->icmp_nextmtu = htons(destifp->if_mtu);
- }
- }
-
- icp->icmp_code = code;
- bcopy((caddr_t)oip, (caddr_t)&icp->icmp_ip, icmplen);
- nip = &icp->icmp_ip;
- nip->ip_len = htons((u_short)(nip->ip_len + oiplen));
-
- /*
- * Now, copy old ip header (without options)
- * in front of icmp message.
- */
- if (m->m_data - sizeof(struct ip) < m->m_pktdat)
- panic("icmp len");
- m->m_data -= sizeof(struct ip);
- m->m_len += sizeof(struct ip);
- m->m_pkthdr.len = m->m_len;
- m->m_pkthdr.rcvif = n->m_pkthdr.rcvif;
- nip = mtod(m, struct ip *);
- bcopy((caddr_t)oip, (caddr_t)nip, sizeof(struct ip));
- nip->ip_len = m->m_len;
- nip->ip_vhl = IP_VHL_BORING;
- nip->ip_p = IPPROTO_ICMP;
- nip->ip_tos = 0;
- icmp_reflect(m);
-
-freeit:
- m_freem(n);
-}
-
-static struct sockaddr_in icmpsrc = { sizeof (struct sockaddr_in), AF_INET };
-static struct sockaddr_in icmpdst = { sizeof (struct sockaddr_in), AF_INET };
-static struct sockaddr_in icmpgw = { sizeof (struct sockaddr_in), AF_INET };
-
-/*
- * Process a received ICMP message.
- */
-void
-icmp_input(m, hlen)
- register struct mbuf *m;
- int hlen;
-{
- register struct icmp *icp;
- register struct ip *ip = mtod(m, struct ip *);
- int icmplen = ip->ip_len;
- register int i;
- struct in_ifaddr *ia;
- void (*ctlfunc) __P((int, struct sockaddr *, void *));
- int code;
-
- /*
- * Locate icmp structure in mbuf, and check
- * that not corrupted and of at least minimum length.
- */
-#ifdef ICMPPRINTFS
- if (icmpprintfs) {
- char buf[4 * sizeof "123"];
- strcpy(buf, inet_ntoa(ip->ip_src));
- printf("icmp_input from %s to %s, len %d\n",
- buf, inet_ntoa(ip->ip_dst), icmplen);
- }
-#endif
- if (icmplen < ICMP_MINLEN) {
- icmpstat.icps_tooshort++;
- goto freeit;
- }
- i = hlen + min(icmplen, ICMP_ADVLENMIN);
- if (m->m_len < i && (m = m_pullup(m, i)) == 0) {
- icmpstat.icps_tooshort++;
- return;
- }
- ip = mtod(m, struct ip *);
- m->m_len -= hlen;
- m->m_data += hlen;
- icp = mtod(m, struct icmp *);
- if (in_cksum(m, icmplen)) {
- icmpstat.icps_checksum++;
- goto freeit;
- }
- m->m_len += hlen;
- m->m_data -= hlen;
-
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("icmp_input, type %d code %d\n", icp->icmp_type,
- icp->icmp_code);
-#endif
-
- /*
- * Message type specific processing.
- */
- if (icp->icmp_type > ICMP_MAXTYPE)
- goto raw;
- icmpstat.icps_inhist[icp->icmp_type]++;
- code = icp->icmp_code;
- switch (icp->icmp_type) {
-
- case ICMP_UNREACH:
- switch (code) {
- case ICMP_UNREACH_NET:
- case ICMP_UNREACH_HOST:
- case ICMP_UNREACH_PROTOCOL:
- case ICMP_UNREACH_PORT:
- case ICMP_UNREACH_SRCFAIL:
- code += PRC_UNREACH_NET;
- break;
-
- case ICMP_UNREACH_NEEDFRAG:
- code = PRC_MSGSIZE;
- break;
-
- case ICMP_UNREACH_NET_UNKNOWN:
- case ICMP_UNREACH_NET_PROHIB:
- case ICMP_UNREACH_TOSNET:
- code = PRC_UNREACH_NET;
- break;
-
- case ICMP_UNREACH_HOST_UNKNOWN:
- case ICMP_UNREACH_ISOLATED:
- case ICMP_UNREACH_HOST_PROHIB:
- case ICMP_UNREACH_TOSHOST:
- code = PRC_UNREACH_HOST;
- break;
-
- case ICMP_UNREACH_FILTER_PROHIB:
- case ICMP_UNREACH_HOST_PRECEDENCE:
- case ICMP_UNREACH_PRECEDENCE_CUTOFF:
- code = PRC_UNREACH_PORT;
- break;
-
- default:
- goto badcode;
- }
- goto deliver;
-
- case ICMP_TIMXCEED:
- if (code > 1)
- goto badcode;
- code += PRC_TIMXCEED_INTRANS;
- goto deliver;
-
- case ICMP_PARAMPROB:
- if (code > 1)
- goto badcode;
- code = PRC_PARAMPROB;
- goto deliver;
-
- case ICMP_SOURCEQUENCH:
- if (code)
- goto badcode;
- code = PRC_QUENCH;
- deliver:
- /*
- * Problem with datagram; advise higher level routines.
- */
- if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
- IP_VHL_HL(icp->icmp_ip.ip_vhl) < (sizeof(struct ip) >> 2)) {
- icmpstat.icps_badlen++;
- goto freeit;
- }
- NTOHS(icp->icmp_ip.ip_len);
- /* Discard ICMP's in response to multicast packets */
- if (IN_MULTICAST(ntohl(icp->icmp_ip.ip_dst.s_addr)))
- goto badcode;
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("deliver to protocol %d\n", icp->icmp_ip.ip_p);
-#endif
- icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
-#if 1
- /*
- * MTU discovery:
- * If we got a needfrag and there is a host route to the
- * original destination, and the MTU is not locked, then
- * set the MTU in the route to the suggested new value
- * (if given) and then notify as usual. The ULPs will
- * notice that the MTU has changed and adapt accordingly.
- * If no new MTU was suggested, then we guess a new one
- * less than the current value. If the new MTU is
- * unreasonably small (arbitrarily set at 296), then
- * we reset the MTU to the interface value and enable the
- * lock bit, indicating that we are no longer doing MTU
- * discovery.
- */
- if (code == PRC_MSGSIZE) {
- struct rtentry *rt;
- int mtu;
-
- rt = rtalloc1((struct sockaddr *)&icmpsrc, 0,
- RTF_CLONING | RTF_PRCLONING);
- if (rt && (rt->rt_flags & RTF_HOST)
- && !(rt->rt_rmx.rmx_locks & RTV_MTU)) {
- mtu = ntohs(icp->icmp_nextmtu);
- if (!mtu)
- mtu = ip_next_mtu(rt->rt_rmx.rmx_mtu,
- 1);
-#ifdef DEBUG_MTUDISC
- printf("MTU for %s reduced to %d\n",
- inet_ntoa(icmpsrc.sin_addr), mtu);
-#endif
- if (mtu < 296) {
- /* rt->rt_rmx.rmx_mtu =
- rt->rt_ifp->if_mtu; */
- rt->rt_rmx.rmx_locks |= RTV_MTU;
- } else if (rt->rt_rmx.rmx_mtu > mtu) {
- rt->rt_rmx.rmx_mtu = mtu;
- }
- }
- if (rt)
- RTFREE(rt);
- }
-
-#endif
- ctlfunc = inetsw[ip_protox[icp->icmp_ip.ip_p]].pr_ctlinput;
- if (ctlfunc)
- (*ctlfunc)(code, (struct sockaddr *)&icmpsrc,
- (void *)&icp->icmp_ip);
- break;
-
- badcode:
- icmpstat.icps_badcode++;
- break;
-
- case ICMP_ECHO:
- if (!icmpbmcastecho
- && (m->m_flags & (M_MCAST | M_BCAST)) != 0
- && IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- icmpstat.icps_bmcastecho++;
- break;
- }
- icp->icmp_type = ICMP_ECHOREPLY;
- goto reflect;
-
- case ICMP_TSTAMP:
- if (!icmpbmcastecho
- && (m->m_flags & (M_MCAST | M_BCAST)) != 0
- && IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- icmpstat.icps_bmcasttstamp++;
- break;
- }
- if (icmplen < ICMP_TSLEN) {
- icmpstat.icps_badlen++;
- break;
- }
- icp->icmp_type = ICMP_TSTAMPREPLY;
- icp->icmp_rtime = iptime();
- icp->icmp_ttime = icp->icmp_rtime; /* bogus, do later! */
- goto reflect;
-
- case ICMP_MASKREQ:
-#define satosin(sa) ((struct sockaddr_in *)(sa))
- if (icmpmaskrepl == 0)
- break;
- /*
- * We are not able to respond with all ones broadcast
- * unless we receive it over a point-to-point interface.
- */
- if (icmplen < ICMP_MASKLEN)
- break;
- switch (ip->ip_dst.s_addr) {
-
- case INADDR_BROADCAST:
- case INADDR_ANY:
- icmpdst.sin_addr = ip->ip_src;
- break;
-
- default:
- icmpdst.sin_addr = ip->ip_dst;
- }
- ia = (struct in_ifaddr *)ifaof_ifpforaddr(
- (struct sockaddr *)&icmpdst, m->m_pkthdr.rcvif);
- if (ia == 0)
- break;
- if (ia->ia_ifp == 0)
- break;
- icp->icmp_type = ICMP_MASKREPLY;
- icp->icmp_mask = ia->ia_sockmask.sin_addr.s_addr;
- if (ip->ip_src.s_addr == 0) {
- if (ia->ia_ifp->if_flags & IFF_BROADCAST)
- ip->ip_src = satosin(&ia->ia_broadaddr)->sin_addr;
- else if (ia->ia_ifp->if_flags & IFF_POINTOPOINT)
- ip->ip_src = satosin(&ia->ia_dstaddr)->sin_addr;
- }
-reflect:
- ip->ip_len += hlen; /* since ip_input deducts this */
- icmpstat.icps_reflect++;
- icmpstat.icps_outhist[icp->icmp_type]++;
- icmp_reflect(m);
- return;
-
- case ICMP_REDIRECT:
- if (code > 3)
- goto badcode;
- if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
- IP_VHL_HL(icp->icmp_ip.ip_vhl) < (sizeof(struct ip) >> 2)) {
- icmpstat.icps_badlen++;
- break;
- }
- /*
- * Short circuit routing redirects to force
- * immediate change in the kernel's routing
- * tables. The message is also handed to anyone
- * listening on a raw socket (e.g. the routing
- * daemon for use in updating its tables).
- */
- icmpgw.sin_addr = ip->ip_src;
- icmpdst.sin_addr = icp->icmp_gwaddr;
-#ifdef ICMPPRINTFS
- if (icmpprintfs) {
- char buf[4 * sizeof "123"];
- strcpy(buf, inet_ntoa(icp->icmp_ip.ip_dst));
-
- printf("redirect dst %s to %s\n",
- buf, inet_ntoa(icp->icmp_gwaddr));
- }
-#endif
- icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
- rtredirect((struct sockaddr *)&icmpsrc,
- (struct sockaddr *)&icmpdst,
- (struct sockaddr *)0, RTF_GATEWAY | RTF_HOST,
- (struct sockaddr *)&icmpgw, (struct rtentry **)0);
- pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&icmpsrc);
- break;
-
- /*
- * No kernel processing for the following;
- * just fall through to send to raw listener.
- */
- case ICMP_ECHOREPLY:
- case ICMP_ROUTERADVERT:
- case ICMP_ROUTERSOLICIT:
- case ICMP_TSTAMPREPLY:
- case ICMP_IREQREPLY:
- case ICMP_MASKREPLY:
- default:
- break;
- }
-
-raw:
- rip_input(m, hlen);
- return;
-
-freeit:
- m_freem(m);
-}
-
-/*
- * Reflect the ip packet back to the source
- */
-static void
-icmp_reflect(m)
- struct mbuf *m;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register struct in_ifaddr *ia;
- struct in_addr t;
- struct mbuf *opts = 0;
- int optlen = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof(struct ip);
-
- if (!in_canforward(ip->ip_src) &&
- ((ntohl(ip->ip_src.s_addr) & IN_CLASSA_NET) !=
- (IN_LOOPBACKNET << IN_CLASSA_NSHIFT))) {
- m_freem(m); /* Bad return address */
- goto done; /* Ip_output() will check for broadcast */
- }
- t = ip->ip_dst;
- ip->ip_dst = ip->ip_src;
- /*
- * If the incoming packet was addressed directly to us,
- * use dst as the src for the reply. Otherwise (broadcast
- * or anonymous), use the address which corresponds
- * to the incoming interface.
- */
- for (ia = in_ifaddr; ia; ia = ia->ia_next) {
- if (t.s_addr == IA_SIN(ia)->sin_addr.s_addr)
- break;
- if (ia->ia_ifp && (ia->ia_ifp->if_flags & IFF_BROADCAST) &&
- t.s_addr == satosin(&ia->ia_broadaddr)->sin_addr.s_addr)
- break;
- }
- icmpdst.sin_addr = t;
- if ((ia == (struct in_ifaddr *)0) && m->m_pkthdr.rcvif)
- ia = (struct in_ifaddr *)ifaof_ifpforaddr(
- (struct sockaddr *)&icmpdst, m->m_pkthdr.rcvif);
- /*
- * The following happens if the packet was not addressed to us,
- * and was received on an interface with no IP address.
- */
- if (ia == (struct in_ifaddr *)0)
- ia = in_ifaddr;
- t = IA_SIN(ia)->sin_addr;
- ip->ip_src = t;
- ip->ip_ttl = MAXTTL;
-
- if (optlen > 0) {
- register u_char *cp;
- int opt, cnt;
- u_int len;
-
- /*
- * Retrieve any source routing from the incoming packet;
- * add on any record-route or timestamp options.
- */
- cp = (u_char *) (ip + 1);
- if ((opts = ip_srcroute()) == 0 &&
- (opts = m_gethdr(M_DONTWAIT, MT_HEADER))) {
- opts->m_len = sizeof(struct in_addr);
- mtod(opts, struct in_addr *)->s_addr = 0;
- }
- if (opts) {
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("icmp_reflect optlen %d rt %d => ",
- optlen, opts->m_len);
-#endif
- for (cnt = optlen; cnt > 0; cnt -= len, cp += len) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- len = 1;
- else {
- len = cp[IPOPT_OLEN];
- if (len <= 0 || len > cnt)
- break;
- }
- /*
- * Should check for overflow, but it "can't happen"
- */
- if (opt == IPOPT_RR || opt == IPOPT_TS ||
- opt == IPOPT_SECURITY) {
- bcopy((caddr_t)cp,
- mtod(opts, caddr_t) + opts->m_len, len);
- opts->m_len += len;
- }
- }
- /* Terminate & pad, if necessary */
- cnt = opts->m_len % 4;
- if (cnt) {
- for (; cnt < 4; cnt++) {
- *(mtod(opts, caddr_t) + opts->m_len) =
- IPOPT_EOL;
- opts->m_len++;
- }
- }
-#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("%d\n", opts->m_len);
-#endif
- }
- /*
- * Now strip out original options by copying rest of first
- * mbuf's data back, and adjust the IP length.
- */
- ip->ip_len -= optlen;
- ip->ip_vhl = IP_VHL_BORING;
- m->m_len -= optlen;
- if (m->m_flags & M_PKTHDR)
- m->m_pkthdr.len -= optlen;
- optlen += sizeof(struct ip);
- bcopy((caddr_t)ip + optlen, (caddr_t)(ip + 1),
- (unsigned)(m->m_len - sizeof(struct ip)));
- }
- m->m_flags &= ~(M_BCAST|M_MCAST);
- icmp_send(m, opts);
-done:
- if (opts)
- (void)m_free(opts);
-}
-
-/*
- * Send an icmp packet back to the ip level,
- * after supplying a checksum.
- */
-static void
-icmp_send(m, opts)
- register struct mbuf *m;
- struct mbuf *opts;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register int hlen;
- register struct icmp *icp;
- struct route ro;
-
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
- m->m_data += hlen;
- m->m_len -= hlen;
- icp = mtod(m, struct icmp *);
- icp->icmp_cksum = 0;
- icp->icmp_cksum = in_cksum(m, ip->ip_len - hlen);
- m->m_data -= hlen;
- m->m_len += hlen;
-#ifdef ICMPPRINTFS
- if (icmpprintfs) {
- char buf[4 * sizeof "123"];
- strcpy(buf, inet_ntoa(ip->ip_dst));
- printf("icmp_send dst %s src %s\n",
- buf, inet_ntoa(ip->ip_src));
- }
-#endif
- bzero(&ro, sizeof ro);
- (void) ip_output(m, opts, &ro, 0, NULL);
- if (ro.ro_rt)
- RTFREE(ro.ro_rt);
-}
-
-n_time
-iptime()
-{
- struct timeval atv;
- u_long t;
-
- microtime(&atv);
- t = (atv.tv_sec % (24*60*60)) * 1000 + atv.tv_usec / 1000;
- return (htonl(t));
-}
-
-#if 1
-/*
- * Return the next larger or smaller MTU plateau (table from RFC 1191)
- * given current value MTU. If DIR is less than zero, a larger plateau
- * is returned; otherwise, a smaller value is returned.
- */
-static int
-ip_next_mtu(mtu, dir)
- int mtu;
- int dir;
-{
- static int mtutab[] = {
- 65535, 32000, 17914, 8166, 4352, 2002, 1492, 1006, 508, 296,
- 68, 0
- };
- int i;
-
- for (i = 0; i < (sizeof mtutab) / (sizeof mtutab[0]); i++) {
- if (mtu >= mtutab[i])
- break;
- }
-
- if (dir < 0) {
- if (i == 0) {
- return 0;
- } else {
- return mtutab[i - 1];
- }
- } else {
- if (mtutab[i] == 0) {
- return 0;
- } else if(mtu > mtutab[i]) {
- return mtutab[i];
- } else {
- return mtutab[i + 1];
- }
- }
-}
-#endif
diff --git a/cpukit/libnetworking/netinet/ip_icmp.h b/cpukit/libnetworking/netinet/ip_icmp.h
deleted file mode 100644
index 9d07a682de..0000000000
--- a/cpukit/libnetworking/netinet/ip_icmp.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IP_ICMP_H_
-#define _NETINET_IP_ICMP_H_
-
-/*
- * Interface Control Message Protocol Definitions.
- * Per RFC 792, September 1981.
- */
-
-/*
- * Internal of an ICMP Router Advertisement
- */
-struct icmp_ra_addr {
- u_int32_t ira_addr;
- u_int32_t ira_preference;
-};
-
-/*
- * Structure of an icmp header.
- */
-struct icmp {
- u_char icmp_type; /* type of message, see below */
- u_char icmp_code; /* type sub code */
- u_short icmp_cksum; /* ones complement cksum of struct */
- union {
- u_char ih_pptr; /* ICMP_PARAMPROB */
- struct in_addr ih_gwaddr; /* ICMP_REDIRECT */
- struct ih_idseq {
- n_short icd_id;
- n_short icd_seq;
- } ih_idseq;
- int ih_void;
-
- /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
- struct ih_pmtu {
- n_short ipm_void;
- n_short ipm_nextmtu;
- } ih_pmtu;
-
- struct ih_rtradv {
- u_char irt_num_addrs;
- u_char irt_wpa;
- u_int16_t irt_lifetime;
- } ih_rtradv;
- } icmp_hun;
-#define icmp_pptr icmp_hun.ih_pptr
-#define icmp_gwaddr icmp_hun.ih_gwaddr
-#define icmp_id icmp_hun.ih_idseq.icd_id
-#define icmp_seq icmp_hun.ih_idseq.icd_seq
-#define icmp_void icmp_hun.ih_void
-#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
-#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
-#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
-#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
-#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
- union {
- struct id_ts {
- n_time its_otime;
- n_time its_rtime;
- n_time its_ttime;
- } id_ts;
- struct id_ip {
- struct ip idi_ip;
- /* options and then 64 bits of data */
- } id_ip;
- struct icmp_ra_addr id_radv;
- u_long id_mask;
- char id_data[1];
- } icmp_dun;
-#define icmp_otime icmp_dun.id_ts.its_otime
-#define icmp_rtime icmp_dun.id_ts.its_rtime
-#define icmp_ttime icmp_dun.id_ts.its_ttime
-#define icmp_ip icmp_dun.id_ip.idi_ip
-#define icmp_radv icmp_dun.id_radv
-#define icmp_mask icmp_dun.id_mask
-#define icmp_data icmp_dun.id_data
-};
-
-/*
- * Lower bounds on packet lengths for various types.
- * For the error advice packets must first insure that the
- * packet is large enough to contain the returned ip header.
- * Only then can we do the check to see if 64 bits of packet
- * data have been returned, since we need to check the returned
- * ip header length.
- */
-#define ICMP_MINLEN 8 /* abs minimum */
-#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */
-#define ICMP_MASKLEN 12 /* address mask */
-#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
-#ifndef _IP_VHL
-#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
- /* N.B.: must separately check that ip_hl >= 5 */
-#else
-#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
- /* N.B.: must separately check that header length >= 5 */
-#endif
-
-/*
- * Definition of type and code field values.
- */
-#define ICMP_ECHOREPLY 0 /* echo reply */
-#define ICMP_UNREACH 3 /* dest unreachable, codes: */
-#define ICMP_UNREACH_NET 0 /* bad net */
-#define ICMP_UNREACH_HOST 1 /* bad host */
-#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
-#define ICMP_UNREACH_PORT 3 /* bad port */
-#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
-#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
-#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
-#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
-#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
-#define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */
-#define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */
-#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
-#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
-#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
-#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
-#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
-#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
-#define ICMP_REDIRECT 5 /* shorter route, codes: */
-#define ICMP_REDIRECT_NET 0 /* for network */
-#define ICMP_REDIRECT_HOST 1 /* for host */
-#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
-#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
-#define ICMP_ECHO 8 /* echo service */
-#define ICMP_ROUTERADVERT 9 /* router advertisement */
-#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
-#define ICMP_TIMXCEED 11 /* time exceeded, code: */
-#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
-#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
-#define ICMP_PARAMPROB 12 /* ip header bad */
-#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
-#define ICMP_TSTAMP 13 /* timestamp request */
-#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
-#define ICMP_IREQ 15 /* information request */
-#define ICMP_IREQREPLY 16 /* information reply */
-#define ICMP_MASKREQ 17 /* address mask request */
-#define ICMP_MASKREPLY 18 /* address mask reply */
-
-#define ICMP_MAXTYPE 18
-
-#define ICMP_INFOTYPE(type) \
- ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
- (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
- (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
- (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
- (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
-
-#ifdef KERNEL
-void icmp_error __P((struct mbuf *, int, int, n_long, struct ifnet *));
-void icmp_input __P((struct mbuf *, int));
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/netinet/ip_input.c b/cpukit/libnetworking/netinet/ip_input.c
deleted file mode 100644
index 4cc141933f..0000000000
--- a/cpukit/libnetworking/netinet/ip_input.c
+++ /dev/null
@@ -1,1488 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)ip_input.c 8.2 (Berkeley) 1/4/94
- * $Id$
- * $ANA: ip_input.c,v 1.5 1996/09/18 14:34:59 wollman Exp $
- */
-
-#define _IP_VHL
-
-#include "opt_ipfw.h"
-
-#include <stddef.h>
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/domain.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/route.h>
-#include <net/netisr.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <machine/in_cksum.h>
-
-#include <sys/socketvar.h>
-
-#ifdef IPFIREWALL
-#include <netinet/ip_fw.h>
-#endif
-
-int rsvp_on = 0;
-static int ip_rsvp_on;
-struct socket *ip_rsvpd;
-
-static int ipforwarding = 0;
-SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_RW,
- &ipforwarding, 0, "");
-
-static int ipsendredirects = 1; /* XXX */
-SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_RW,
- &ipsendredirects, 0, "");
-
-int ip_defttl = IPDEFTTL;
-SYSCTL_INT(_net_inet_ip, IPCTL_DEFTTL, ttl, CTLFLAG_RW,
- &ip_defttl, 0, "");
-
-static int ip_dosourceroute = 0;
-SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW,
- &ip_dosourceroute, 0, "");
-
-static int ip_acceptsourceroute = 0;
-SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute,
- CTLFLAG_RW, &ip_acceptsourceroute, 0, "");
-#ifdef DIAGNOSTIC
-static int ipprintfs = 0;
-#endif
-
-extern struct domain inetdomain;
-extern struct protosw inetsw[];
-u_char ip_protox[IPPROTO_MAX];
-static int ipqmaxlen = IFQ_MAXLEN;
-struct in_ifaddr *in_ifaddr; /* first inet address */
-struct ifqueue ipintrq;
-SYSCTL_INT(_net_inet_ip, IPCTL_INTRQMAXLEN, intr_queue_maxlen, CTLFLAG_RD,
- &ipintrq.ifq_maxlen, 0, "");
-SYSCTL_INT(_net_inet_ip, IPCTL_INTRQDROPS, intr_queue_drops, CTLFLAG_RD,
- &ipintrq.ifq_drops, 0, "");
-
-struct ipstat ipstat;
-
-/* Packet reassembly stuff */
-#define IPREASS_NHASH_LOG2 6
-#define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2)
-#define IPREASS_HMASK (IPREASS_NHASH - 1)
-#define IPREASS_HASH(x,y) \
- (((((x) & 0xF) | ((((x) >> 8) & 0xF) << 4)) ^ (y)) & IPREASS_HMASK)
-
-static struct ipq ipq[IPREASS_NHASH];
-static int nipq = 0; /* total # of reass queues */
-static int maxnipq;
-
-#ifdef IPCTL_DEFMTU
-SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW,
- &ip_mtu, 0, "");
-#endif
-
-#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1
-#undef COMPAT_IPFW
-#define COMPAT_IPFW 1
-#else
-#undef COMPAT_IPFW
-#endif
-
-#ifdef COMPAT_IPFW
-/* Firewall hooks */
-ip_fw_chk_t *ip_fw_chk_ptr;
-ip_fw_ctl_t *ip_fw_ctl_ptr;
-
-/* IP Network Address Translation (NAT) hooks */
-ip_nat_t *ip_nat_ptr;
-ip_nat_ctl_t *ip_nat_ctl_ptr;
-#endif
-
-/*
- * We need to save the IP options in case a protocol wants to respond
- * to an incoming packet over the same route if the packet got here
- * using IP source routing. This allows connection establishment and
- * maintenance when the remote end is on a network that is not known
- * to us.
- */
-static int ip_nhops = 0;
-static struct ip_srcrt {
- struct in_addr dst; /* final destination */
- char nop; /* one NOP to align */
- char srcopt[IPOPT_OFFSET + 1]; /* OPTVAL, OLEN and OFFSET */
- struct in_addr route[MAX_IPOPTLEN/sizeof(struct in_addr)];
-} ip_srcrt;
-
-#ifdef IPDIVERT
-/*
- * Shared variable between ip_input() and ip_reass() to communicate
- * about which packets, once assembled from fragments, get diverted,
- * and to which port.
- */
-static u_short frag_divert_port;
-#endif
-
-static void save_rte __P((u_char *, struct in_addr));
-static void ip_deq __P((struct ipasfrag *));
-static int ip_dooptions __P((struct mbuf *));
-static void ip_enq __P((struct ipasfrag *, struct ipasfrag *));
-static void ip_forward __P((struct mbuf *, int));
-static void ip_freef __P((struct ipq *));
-static struct ip *
- ip_reass __P((struct ipasfrag *, struct ipq *, struct ipq *));
-static struct in_ifaddr *
- ip_rtaddr __P((struct in_addr));
-void ipintr __P((void));
-/*
- * IP initialization: fill in IP protocol switch table.
- * All protocols not implemented in kernel go to raw IP protocol handler.
- */
-void
-ip_init()
-{
- register struct protosw *pr;
- register int i;
-
- pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW);
- if (pr == 0)
- panic("ip_init");
- for (i = 0; i < IPPROTO_MAX; i++)
- ip_protox[i] = pr - inetsw;
- for (pr = inetdomain.dom_protosw;
- pr < inetdomain.dom_protoswNPROTOSW; pr++)
- if (pr->pr_domain->dom_family == PF_INET &&
- pr->pr_protocol && pr->pr_protocol != IPPROTO_RAW)
- ip_protox[pr->pr_protocol] = pr - inetsw;
-
- for (i = 0; i < IPREASS_NHASH; i++)
- ipq[i].next = ipq[i].prev = &ipq[i];
-
- maxnipq = nmbclusters/4;
-
- ip_id = rtems_bsdnet_seconds_since_boot() & 0xffff;
- ipintrq.ifq_maxlen = ipqmaxlen;
-#ifdef IPFIREWALL
- ip_fw_init();
-#endif
-#ifdef IPNAT
- ip_nat_init();
-#endif
-
-}
-
-static struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET };
-static struct route ipforward_rt;
-
-/*
- * Ip input routine. Checksum and byte swap header. If fragmented
- * try to reassemble. Process options. Pass to next level.
- */
-void
-ip_input(struct mbuf *m)
-{
- struct ip *ip;
- struct ipq *fp;
- struct in_ifaddr *ia;
- int i, hlen;
- u_short sum;
-
-#ifdef DIAGNOSTIC
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("ip_input no HDR");
-#endif
- /*
- * If no IP addresses have been set yet but the interfaces
- * are receiving, can't do anything with incoming packets yet.
- */
- if (in_ifaddr == NULL)
- goto bad;
- ipstat.ips_total++;
-
- if (m->m_pkthdr.len < sizeof(struct ip))
- goto tooshort;
-
-#ifdef DIAGNOSTIC
- if (m->m_len < sizeof(struct ip))
- panic("ipintr mbuf too short");
-#endif
-
- if (m->m_len < sizeof (struct ip) &&
- (m = m_pullup(m, sizeof (struct ip))) == 0) {
- ipstat.ips_toosmall++;
- return;
- }
- ip = mtod(m, struct ip *);
-
- if (IP_VHL_V(ip->ip_vhl) != IPVERSION) {
- ipstat.ips_badvers++;
- goto bad;
- }
-
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
- if (hlen < sizeof(struct ip)) { /* minimum header length */
- ipstat.ips_badhlen++;
- goto bad;
- }
- if (hlen > m->m_len) {
- if ((m = m_pullup(m, hlen)) == 0) {
- ipstat.ips_badhlen++;
- return;
- }
- ip = mtod(m, struct ip *);
- }
- if (hlen == sizeof(struct ip)) {
- sum = in_cksum_hdr(ip);
- } else {
- sum = in_cksum(m, hlen);
- }
- if (sum) {
- ipstat.ips_badsum++;
- goto bad;
- }
-
- /*
- * Convert fields to host representation.
- */
- NTOHS(ip->ip_len);
- if (ip->ip_len < hlen) {
- ipstat.ips_badlen++;
- goto bad;
- }
- NTOHS(ip->ip_id);
- NTOHS(ip->ip_off);
-
- /*
- * Check that the amount of data in the buffers
- * is as at least much as the IP header would have us expect.
- * Trim mbufs if longer than we expect.
- * Drop packet if shorter than we expect.
- */
- if (m->m_pkthdr.len < ip->ip_len) {
-tooshort:
- ipstat.ips_tooshort++;
- goto bad;
- }
- if (m->m_pkthdr.len > ip->ip_len) {
- if (m->m_len == m->m_pkthdr.len) {
- m->m_len = ip->ip_len;
- m->m_pkthdr.len = ip->ip_len;
- } else
- m_adj(m, ip->ip_len - m->m_pkthdr.len);
- }
- /*
- * IpHack's section.
- * Right now when no processing on packet has done
- * and it is still fresh out of network we do our black
- * deals with it.
- * - Firewall: deny/allow/divert
- * - Xlate: translate packet's addr/port (NAT).
- * - Wrap: fake packet's addr/port <unimpl.>
- * - Encapsulate: put it in another IP and send out. <unimp.>
- */
-
-#ifdef COMPAT_IPFW
- if (ip_fw_chk_ptr) {
-#ifdef IPDIVERT
- u_short port;
-
- port = (*ip_fw_chk_ptr)(&ip, hlen, NULL, ip_divert_ignore, &m);
- ip_divert_ignore = 0;
- if (port) { /* Divert packet */
- frag_divert_port = port;
- goto ours;
- }
-#else
- /* If ipfw says divert, we have to just drop packet */
- if ((*ip_fw_chk_ptr)(&ip, hlen, NULL, 0, &m)) {
- m_freem(m);
- m = NULL;
- }
-#endif
- if (!m)
- return;
- }
-
- if (ip_nat_ptr && !(*ip_nat_ptr)(&ip, &m, m->m_pkthdr.rcvif, IP_NAT_IN))
- return;
-#endif
-
- /*
- * Process options and, if not destined for us,
- * ship it on. ip_dooptions returns 1 when an
- * error was detected (causing an icmp message
- * to be sent and the original packet to be freed).
- */
- ip_nhops = 0; /* for source routed packets */
- if (hlen > sizeof (struct ip) && ip_dooptions(m))
- return;
-
- /* greedy RSVP, snatches any PATH packet of the RSVP protocol and no
- * matter if it is destined to another node, or whether it is
- * a multicast one, RSVP wants it! and prevents it from being forwarded
- * anywhere else. Also checks if the rsvp daemon is running before
- * grabbing the packet.
- */
- if (rsvp_on && ip->ip_p==IPPROTO_RSVP)
- goto ours;
-
- /*
- * Check our list of addresses, to see if the packet is for us.
- */
- for (ia = in_ifaddr; ia; ia = ia->ia_next) {
-#define satosin(sa) ((struct sockaddr_in *)(sa))
-
- if (IA_SIN(ia)->sin_addr.s_addr == ip->ip_dst.s_addr)
- goto ours;
-#ifdef BOOTP_COMPAT
- if (IA_SIN(ia)->sin_addr.s_addr == INADDR_ANY)
- goto ours;
-#endif
- if (ia->ia_ifp && ia->ia_ifp->if_flags & IFF_BROADCAST) {
- if (satosin(&ia->ia_broadaddr)->sin_addr.s_addr ==
- ip->ip_dst.s_addr)
- goto ours;
- if (ip->ip_dst.s_addr == ia->ia_netbroadcast.s_addr)
- goto ours;
- }
- }
- if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- struct in_multi *inm;
- if (ip_mrouter) {
- /*
- * If we are acting as a multicast router, all
- * incoming multicast packets are passed to the
- * kernel-level multicast forwarding function.
- * The packet is returned (relatively) intact; if
- * ip_mforward() returns a non-zero value, the packet
- * must be discarded, else it may be accepted below.
- *
- * (The IP ident field is put in the same byte order
- * as expected when ip_mforward() is called from
- * ip_output().)
- */
- ip->ip_id = htons(ip->ip_id);
- if (ip_mforward(ip, m->m_pkthdr.rcvif, m, 0) != 0) {
- ipstat.ips_cantforward++;
- m_freem(m);
- return;
- }
- ip->ip_id = ntohs(ip->ip_id);
-
- /*
- * The process-level routing demon needs to receive
- * all multicast IGMP packets, whether or not this
- * host belongs to their destination groups.
- */
- if (ip->ip_p == IPPROTO_IGMP)
- goto ours;
- ipstat.ips_forward++;
- }
- /*
- * See if we belong to the destination multicast group on the
- * arrival interface.
- */
- IN_LOOKUP_MULTI(ip->ip_dst, m->m_pkthdr.rcvif, inm);
- if (inm == NULL) {
- ipstat.ips_cantforward++;
- m_freem(m);
- return;
- }
- goto ours;
- }
- if (ip->ip_dst.s_addr == (u_long)INADDR_BROADCAST)
- goto ours;
- if (ip->ip_dst.s_addr == INADDR_ANY)
- goto ours;
-
- /*
- * Not for us; forward if possible and desirable.
- */
- if (ipforwarding == 0) {
- ipstat.ips_cantforward++;
- m_freem(m);
- } else
- ip_forward(m, 0);
- return;
-
-ours:
-
- /*
- * If offset or IP_MF are set, must reassemble.
- * Otherwise, nothing need be done.
- * (We could look in the reassembly queue to see
- * if the packet was previously fragmented,
- * but it's not worth the time; just let them time out.)
- */
- if (ip->ip_off &~ (IP_DF | IP_RF)) {
- if (m->m_flags & M_EXT) { /* XXX */
- if ((m = m_pullup(m, sizeof (struct ip))) == 0) {
- ipstat.ips_toosmall++;
-#ifdef IPDIVERT
- frag_divert_port = 0;
-#endif
- return;
- }
- ip = mtod(m, struct ip *);
- }
- sum = IPREASS_HASH(ip->ip_src.s_addr, ip->ip_id);
- /*
- * Look for queue of fragments
- * of this datagram.
- */
- for (fp = ipq[sum].next; fp != &ipq[sum]; fp = fp->next)
- if (ip->ip_id == fp->ipq_id &&
- ip->ip_src.s_addr == fp->ipq_src.s_addr &&
- ip->ip_dst.s_addr == fp->ipq_dst.s_addr &&
- ip->ip_p == fp->ipq_p)
- goto found;
-
- fp = 0;
-
- /* check if there's a place for the new queue */
- if (nipq > maxnipq) {
- /*
- * drop something from the tail of the current queue
- * before proceeding further
- */
- if (ipq[sum].prev == &ipq[sum]) { /* gak */
- for (i = 0; i < IPREASS_NHASH; i++) {
- if (ipq[i].prev != &ipq[i]) {
- ip_freef(ipq[i].prev);
- break;
- }
- }
- } else
- ip_freef(ipq[sum].prev);
- }
-found:
- /*
- * Adjust ip_len to not reflect header,
- * set ip_mff if more fragments are expected,
- * convert offset of this to bytes.
- */
- ip->ip_len -= hlen;
- ((struct ipasfrag *)ip)->ipf_mff &= ~1;
- if (ip->ip_off & IP_MF)
- ((struct ipasfrag *)ip)->ipf_mff |= 1;
- ip->ip_off <<= 3;
-
- /*
- * If datagram marked as having more fragments
- * or if this is not the first fragment,
- * attempt reassembly; if it succeeds, proceed.
- */
- if (((struct ipasfrag *)ip)->ipf_mff & 1 || ip->ip_off) {
- ipstat.ips_fragments++;
- ip = ip_reass((struct ipasfrag *)ip, fp, &ipq[sum]);
- if (ip == 0)
- return;
- ipstat.ips_reassembled++;
- m = dtom(ip);
-#ifdef IPDIVERT
- if (frag_divert_port) {
- ip->ip_len += hlen;
- HTONS(ip->ip_len);
- HTONS(ip->ip_off);
- HTONS(ip->ip_id);
- ip->ip_sum = 0;
- ip->ip_sum = in_cksum_hdr(ip);
- NTOHS(ip->ip_id);
- NTOHS(ip->ip_off);
- NTOHS(ip->ip_len);
- ip->ip_len -= hlen;
- }
-#endif
- } else
- if (fp)
- ip_freef(fp);
- } else
- ip->ip_len -= hlen;
-
-#ifdef IPDIVERT
- /*
- * Divert reassembled packets to the divert protocol if required
- */
- if (frag_divert_port) {
- ipstat.ips_delivered++;
- ip_divert_port = frag_divert_port;
- frag_divert_port = 0;
- (*inetsw[ip_protox[IPPROTO_DIVERT]].pr_input)(m, hlen);
- return;
- }
-
- /* Don't let packets divert themselves */
- if (ip->ip_p == IPPROTO_DIVERT) {
- ipstat.ips_noproto++;
- goto bad;
- }
-#endif
-
- /*
- * Switch out to protocol's input routine.
- */
- ipstat.ips_delivered++;
- (*inetsw[ip_protox[ip->ip_p]].pr_input)(m, hlen);
- return;
-bad:
- m_freem(m);
-}
-
-/*
- * IP software interrupt routine - to go away sometime soon
- */
-void
-ipintr(void)
-{
- int s;
- struct mbuf *m;
-
- while(1) {
- s = splimp();
- IF_DEQUEUE(&ipintrq, m);
- splx(s);
- if (m == 0)
- return;
- ip_input(m);
- }
-}
-
-NETISR_SET(NETISR_IP, ipintr);
-
-/*
- * Take incoming datagram fragment and try to
- * reassemble it into whole datagram. If a chain for
- * reassembly of this datagram already exists, then it
- * is given as fp; otherwise have to make a chain.
- */
-static struct ip *
-ip_reass(ip, fp, where)
- register struct ipasfrag *ip;
- register struct ipq *fp;
- struct ipq *where;
-{
- register struct mbuf *m = dtom(ip);
- register struct ipasfrag *q;
- struct mbuf *t;
- int hlen = ip->ip_hl << 2;
- int i, next;
-
- /*
- * Presence of header sizes in mbufs
- * would confuse code below.
- */
- m->m_data += hlen;
- m->m_len -= hlen;
-
- /*
- * If first fragment to arrive, create a reassembly queue.
- */
- if (fp == 0) {
- if ((t = m_get(M_DONTWAIT, MT_FTABLE)) == NULL)
- goto dropfrag;
- fp = mtod(t, struct ipq *);
- insque(fp, where);
- nipq++;
- fp->ipq_ttl = IPFRAGTTL;
- fp->ipq_p = ip->ip_p;
- fp->ipq_id = ip->ip_id;
- fp->ipq_next = fp->ipq_prev = (struct ipasfrag *)fp;
- fp->ipq_src = ((struct ip *)ip)->ip_src;
- fp->ipq_dst = ((struct ip *)ip)->ip_dst;
-#ifdef IPDIVERT
- fp->ipq_divert = 0;
-#endif
- q = (struct ipasfrag *)fp;
- goto insert;
- }
-
- /*
- * Find a segment which begins after this one does.
- */
- for (q = fp->ipq_next; q != (struct ipasfrag *)fp; q = q->ipf_next)
- if (q->ip_off > ip->ip_off)
- break;
-
- /*
- * If there is a preceding segment, it may provide some of
- * our data already. If so, drop the data from the incoming
- * segment. If it provides all of our data, drop us.
- */
- if (q->ipf_prev != (struct ipasfrag *)fp) {
- i = q->ipf_prev->ip_off + q->ipf_prev->ip_len - ip->ip_off;
- if (i > 0) {
- if (i >= ip->ip_len)
- goto dropfrag;
- m_adj(dtom(ip), i);
- ip->ip_off += i;
- ip->ip_len -= i;
- }
- }
-
- /*
- * While we overlap succeeding segments trim them or,
- * if they are completely covered, dequeue them.
- */
- while (q != (struct ipasfrag *)fp && ip->ip_off + ip->ip_len > q->ip_off) {
- struct mbuf *m0;
-
- i = (ip->ip_off + ip->ip_len) - q->ip_off;
- if (i < q->ip_len) {
- q->ip_len -= i;
- q->ip_off += i;
- m_adj(dtom(q), i);
- break;
- }
- m0 = dtom(q);
- q = q->ipf_next;
- ip_deq(q->ipf_prev);
- m_freem(m0);
- }
-
-insert:
-
-#ifdef IPDIVERT
- /*
- * Any fragment diverting causes the whole packet to divert
- */
- if (frag_divert_port != 0)
- fp->ipq_divert = frag_divert_port;
- frag_divert_port = 0;
-#endif
-
- /*
- * Stick new segment in its place;
- * check for complete reassembly.
- */
- ip_enq(ip, q->ipf_prev);
- next = 0;
- for (q = fp->ipq_next; q != (struct ipasfrag *)fp; q = q->ipf_next) {
- if (q->ip_off != next)
- return (0);
- next += q->ip_len;
- }
- if (q->ipf_prev->ipf_mff & 1)
- return (0);
-
- /*
- * Reassembly is complete. Make sure the packet is a sane size.
- */
- if (next + (IP_VHL_HL(((struct ip *)fp->ipq_next)->ip_vhl) << 2)
- > IP_MAXPACKET) {
- ipstat.ips_toolong++;
- ip_freef(fp);
- return (0);
- }
-
- /*
- * Concatenate fragments.
- */
- q = fp->ipq_next;
- m = dtom(q);
- t = m->m_next;
- m->m_next = 0;
- m_cat(m, t);
- q = q->ipf_next;
- while (q != (struct ipasfrag *)fp) {
- t = dtom(q);
- q = q->ipf_next;
- m_cat(m, t);
- }
-
-#ifdef IPDIVERT
- /*
- * Record divert port for packet, if any
- */
- frag_divert_port = fp->ipq_divert;
-#endif
-
- /*
- * Create header for new ip packet by
- * modifying header of first packet;
- * dequeue and discard fragment reassembly header.
- * Make header visible.
- */
- ip = fp->ipq_next;
- ip->ip_len = next;
- ip->ipf_mff &= ~1;
- ((struct ip *)ip)->ip_src = fp->ipq_src;
- ((struct ip *)ip)->ip_dst = fp->ipq_dst;
- remque(fp);
- nipq--;
- (void) m_free(dtom(fp));
- m = dtom(ip);
- m->m_len += (ip->ip_hl << 2);
- m->m_data -= (ip->ip_hl << 2);
- /* some debugging cruft by sklower, below, will go away soon */
- if (m->m_flags & M_PKTHDR) { /* XXX this should be done elsewhere */
- register int plen = 0;
- for (t = m; m; m = m->m_next)
- plen += m->m_len;
- t->m_pkthdr.len = plen;
- }
- return ((struct ip *)ip);
-
-dropfrag:
- ipstat.ips_fragdropped++;
- m_freem(m);
- return (0);
-}
-
-/*
- * Free a fragment reassembly header and all
- * associated datagrams.
- */
-static void
-ip_freef(fp)
- struct ipq *fp;
-{
- register struct ipasfrag *q, *p;
-
- for (q = fp->ipq_next; q != (struct ipasfrag *)fp; q = p) {
- p = q->ipf_next;
- ip_deq(q);
- m_freem(dtom(q));
- }
- remque(fp);
- (void) m_free(dtom(fp));
- nipq--;
-}
-
-/*
- * Put an ip fragment on a reassembly chain.
- * Like insque, but pointers in middle of structure.
- */
-static void
-ip_enq(p, prev)
- register struct ipasfrag *p, *prev;
-{
-
- p->ipf_prev = prev;
- p->ipf_next = prev->ipf_next;
- prev->ipf_next->ipf_prev = p;
- prev->ipf_next = p;
-}
-
-/*
- * To ip_enq as remque is to insque.
- */
-static void
-ip_deq(p)
- register struct ipasfrag *p;
-{
-
- p->ipf_prev->ipf_next = p->ipf_next;
- p->ipf_next->ipf_prev = p->ipf_prev;
-}
-
-/*
- * IP timer processing;
- * if a timer expires on a reassembly
- * queue, discard it.
- */
-void
-ip_slowtimo()
-{
- register struct ipq *fp;
- int s = splnet();
- int i;
-
- for (i = 0; i < IPREASS_NHASH; i++) {
- fp = ipq[i].next;
- if (fp == 0)
- continue;
- while (fp != &ipq[i]) {
- --fp->ipq_ttl;
- fp = fp->next;
- if (fp->prev->ipq_ttl == 0) {
- ipstat.ips_fragtimeout++;
- ip_freef(fp->prev);
- }
- }
- }
- splx(s);
-}
-
-/*
- * Drain off all datagram fragments.
- */
-void
-ip_drain()
-{
- int i;
-
- for (i = 0; i < IPREASS_NHASH; i++) {
- while (ipq[i].next != &ipq[i]) {
- ipstat.ips_fragdropped++;
- ip_freef(ipq[i].next);
- }
- }
- in_rtqdrain();
-}
-
-/*
- * Do option processing on a datagram,
- * possibly discarding it if bad options are encountered,
- * or forwarding it if source-routed.
- * Returns 1 if packet has been forwarded/freed,
- * 0 if the packet should be processed further.
- */
-static int
-ip_dooptions(m)
- struct mbuf *m;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register u_char *cp;
- register struct ip_timestamp *ipt;
- register struct in_ifaddr *ia;
- int opt, optlen, cnt, off, code, type = ICMP_PARAMPROB, forward = 0;
- struct in_addr *sin, dst;
- n_time ntime;
-
- dst = ip->ip_dst;
- cp = (u_char *)(ip + 1);
- cnt = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof (struct ip);
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[IPOPT_OLEN];
- if (optlen <= 0 || optlen > cnt) {
- code = &cp[IPOPT_OLEN] - (u_char *)ip;
- goto bad;
- }
- }
- switch (opt) {
-
- default:
- break;
-
- /*
- * Source routing with record.
- * Find interface with current destination address.
- * If none on this machine then drop if strictly routed,
- * or do nothing if loosely routed.
- * Record interface address and bring up next address
- * component. If strictly routed make sure next
- * address is on directly accessible net.
- */
- case IPOPT_LSRR:
- case IPOPT_SSRR:
- if ((off = cp[IPOPT_OFFSET]) < IPOPT_MINOFF) {
- code = &cp[IPOPT_OFFSET] - (u_char *)ip;
- goto bad;
- }
- ipaddr.sin_addr = ip->ip_dst;
- ia = (struct in_ifaddr *)
- ifa_ifwithaddr((struct sockaddr *)&ipaddr);
- if (ia == 0) {
- if (opt == IPOPT_SSRR) {
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_SRCFAIL;
- goto bad;
- }
- if (!ip_dosourceroute)
- goto nosourcerouting;
- /*
- * Loose routing, and not at next destination
- * yet; nothing to do except forward.
- */
- break;
- }
- off--; /* 0 origin */
- if (off > optlen - sizeof(struct in_addr)) {
- /*
- * End of source route. Should be for us.
- */
- if (!ip_acceptsourceroute)
- goto nosourcerouting;
- save_rte(cp, ip->ip_src);
- break;
- }
-
- if (!ip_dosourceroute) {
- char buf[4*sizeof "123"];
-
-nosourcerouting:
- strcpy(buf, inet_ntoa(ip->ip_dst));
- log(LOG_WARNING,
- "attempted source route from %s to %s\n",
- inet_ntoa(ip->ip_src), buf);
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_SRCFAIL;
- goto bad;
- }
-
- /*
- * locate outgoing interface
- */
- (void)memcpy(&ipaddr.sin_addr, cp + off,
- sizeof(ipaddr.sin_addr));
-
- if (opt == IPOPT_SSRR) {
-#define INA struct in_ifaddr *
-#define SA struct sockaddr *
- if ((ia = (INA)ifa_ifwithdstaddr((SA)&ipaddr)) == 0)
- ia = (INA)ifa_ifwithnet((SA)&ipaddr);
- } else
- ia = ip_rtaddr(ipaddr.sin_addr);
- if (ia == 0) {
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_SRCFAIL;
- goto bad;
- }
- ip->ip_dst = ipaddr.sin_addr;
- (void)memcpy(cp + off, &(IA_SIN(ia)->sin_addr),
- sizeof(struct in_addr));
- cp[IPOPT_OFFSET] += sizeof(struct in_addr);
- /*
- * Let ip_intr's mcast routing check handle mcast pkts
- */
- forward = !IN_MULTICAST(ntohl(ip->ip_dst.s_addr));
- break;
-
- case IPOPT_RR:
- if ((off = cp[IPOPT_OFFSET]) < IPOPT_MINOFF) {
- code = &cp[IPOPT_OFFSET] - (u_char *)ip;
- goto bad;
- }
- /*
- * If no space remains, ignore.
- */
- off--; /* 0 origin */
- if (off > optlen - sizeof(struct in_addr))
- break;
- (void)memcpy(&ipaddr.sin_addr, &ip->ip_dst,
- sizeof(ipaddr.sin_addr));
- /*
- * locate outgoing interface; if we're the destination,
- * use the incoming interface (should be same).
- */
- if ((ia = (INA)ifa_ifwithaddr((SA)&ipaddr)) == 0 &&
- (ia = ip_rtaddr(ipaddr.sin_addr)) == 0) {
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_HOST;
- goto bad;
- }
- (void)memcpy(cp + off, &(IA_SIN(ia)->sin_addr),
- sizeof(struct in_addr));
- cp[IPOPT_OFFSET] += sizeof(struct in_addr);
- break;
-
- case IPOPT_TS:
- code = cp - (u_char *)ip;
- ipt = (struct ip_timestamp *)cp;
- if (ipt->ipt_len < 5)
- goto bad;
- if (ipt->ipt_ptr > ipt->ipt_len - sizeof (long)) {
- if (++ipt->ipt_oflw == 0)
- goto bad;
- break;
- }
- sin = (struct in_addr *)(cp + ipt->ipt_ptr - 1);
- switch (ipt->ipt_flg) {
-
- case IPOPT_TS_TSONLY:
- break;
-
- case IPOPT_TS_TSANDADDR:
- if (ipt->ipt_ptr + sizeof(n_time) +
- sizeof(struct in_addr) > ipt->ipt_len)
- goto bad;
- ipaddr.sin_addr = dst;
- ia = (INA)ifaof_ifpforaddr((SA)&ipaddr,
- m->m_pkthdr.rcvif);
- if (ia == 0)
- continue;
- (void)memcpy(sin, &IA_SIN(ia)->sin_addr,
- sizeof(struct in_addr));
- ipt->ipt_ptr += sizeof(struct in_addr);
- break;
-
- case IPOPT_TS_PRESPEC:
- if (ipt->ipt_ptr + sizeof(n_time) +
- sizeof(struct in_addr) > ipt->ipt_len)
- goto bad;
- (void)memcpy(&ipaddr.sin_addr, sin,
- sizeof(struct in_addr));
- if (ifa_ifwithaddr((SA)&ipaddr) == 0)
- continue;
- ipt->ipt_ptr += sizeof(struct in_addr);
- break;
-
- default:
- goto bad;
- }
- ntime = iptime();
- (void)memcpy(cp + ipt->ipt_ptr - 1, &ntime,
- sizeof(n_time));
- ipt->ipt_ptr += sizeof(n_time);
- }
- }
- if (forward && ipforwarding) {
- ip_forward(m, 1);
- return (1);
- }
- return (0);
-bad:
- ip->ip_len -= IP_VHL_HL(ip->ip_vhl) << 2; /* XXX icmp_error adds in hdr length */
- icmp_error(m, type, code, 0, 0);
- ipstat.ips_badoptions++;
- return (1);
-}
-
-/*
- * Given address of next destination (final or next hop),
- * return internet address info of interface to be used to get there.
- */
-static struct in_ifaddr *
-ip_rtaddr(dst)
- struct in_addr dst;
-{
- register struct sockaddr_in *sin;
-
- sin = (struct sockaddr_in *) &ipforward_rt.ro_dst;
-
- if (ipforward_rt.ro_rt == 0 || dst.s_addr != sin->sin_addr.s_addr) {
- if (ipforward_rt.ro_rt) {
- RTFREE(ipforward_rt.ro_rt);
- ipforward_rt.ro_rt = 0;
- }
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_addr = dst;
-
- rtalloc_ign(&ipforward_rt, RTF_PRCLONING);
- }
- if (ipforward_rt.ro_rt == 0)
- return ((struct in_ifaddr *)0);
- return ((struct in_ifaddr *) ipforward_rt.ro_rt->rt_ifa);
-}
-
-/*
- * Save incoming source route for use in replies,
- * to be picked up later by ip_srcroute if the receiver is interested.
- */
-void
-save_rte(option, dst)
- u_char *option;
- struct in_addr dst;
-{
- unsigned olen;
-
- olen = option[IPOPT_OLEN];
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("save_rte: olen %d\n", olen);
-#endif
- if (olen > sizeof(ip_srcrt) - (1 + sizeof(dst)))
- return;
- bcopy(option, ip_srcrt.srcopt, olen);
- ip_nhops = (olen - IPOPT_OFFSET - 1) / sizeof(struct in_addr);
- ip_srcrt.dst = dst;
-}
-
-/*
- * Retrieve incoming source route for use in replies,
- * in the same form used by setsockopt.
- * The first hop is placed before the options, will be removed later.
- */
-struct mbuf *
-ip_srcroute()
-{
- register struct in_addr *p, *q;
- register struct mbuf *m;
-
- if (ip_nhops == 0)
- return ((struct mbuf *)0);
- m = m_get(M_DONTWAIT, MT_SOOPTS);
- if (m == 0)
- return ((struct mbuf *)0);
-
-#define OPTSIZ (sizeof(ip_srcrt.nop) + sizeof(ip_srcrt.srcopt))
-
- /* length is (nhops+1)*sizeof(addr) + sizeof(nop + srcrt header) */
- m->m_len = ip_nhops * sizeof(struct in_addr) + sizeof(struct in_addr) +
- OPTSIZ;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("ip_srcroute: nhops %d mlen %d", ip_nhops, m->m_len);
-#endif
-
- /*
- * First save first hop for return route
- */
- p = &ip_srcrt.route[ip_nhops - 1];
- *(mtod(m, struct in_addr *)) = *p--;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf(" hops %lx", ntohl(mtod(m, struct in_addr *)->s_addr));
-#endif
-
- /*
- * Copy option fields and padding (nop) to mbuf.
- */
- ip_srcrt.nop = IPOPT_NOP;
- ip_srcrt.srcopt[IPOPT_OFFSET] = IPOPT_MINOFF;
- (void)memcpy(mtod(m, caddr_t) + sizeof(struct in_addr),
- &ip_srcrt.nop, OPTSIZ);
- q = (struct in_addr *)(mtod(m, caddr_t) +
- sizeof(struct in_addr) + OPTSIZ);
-#undef OPTSIZ
- /*
- * Record return path as an IP source route,
- * reversing the path (pointers are now aligned).
- */
- while (p >= ip_srcrt.route) {
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf(" %lx", ntohl(q->s_addr));
-#endif
- *q++ = *p--;
- }
- /*
- * Last hop goes to final destination.
- */
- *q = ip_srcrt.dst;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf(" %lx\n", ntohl(q->s_addr));
-#endif
- return (m);
-}
-
-/*
- * Strip out IP options, at higher
- * level protocol in the kernel.
- * Second argument is buffer to which options
- * will be moved, and return value is their length.
- * XXX should be deleted; last arg currently ignored.
- */
-void
-ip_stripoptions(m, mopt)
- register struct mbuf *m;
- struct mbuf *mopt;
-{
- register int i;
- struct ip *ip = mtod(m, struct ip *);
- register caddr_t opts;
- int olen;
-
- olen = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof (struct ip);
- opts = (caddr_t)(ip + 1);
- i = m->m_len - (sizeof (struct ip) + olen);
- bcopy(opts + olen, opts, (unsigned)i);
- m->m_len -= olen;
- if (m->m_flags & M_PKTHDR)
- m->m_pkthdr.len -= olen;
- ip->ip_vhl = IP_MAKE_VHL(IPVERSION, sizeof(struct ip) >> 2);
-}
-
-u_char inetctlerrmap[PRC_NCMDS] = {
- 0, 0, 0, 0,
- 0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH,
- EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED,
- EMSGSIZE, EHOSTUNREACH, 0, 0,
- 0, 0, 0, 0,
- ENOPROTOOPT
-};
-
-/*
- * Forward a packet. If some error occurs return the sender
- * an icmp packet. Note we can't always generate a meaningful
- * icmp message because icmp doesn't have a large enough repertoire
- * of codes and types.
- *
- * If not forwarding, just drop the packet. This could be confusing
- * if ipforwarding was zero but some routing protocol was advancing
- * us as a gateway to somewhere. However, we must let the routing
- * protocol deal with that.
- *
- * The srcrt parameter indicates whether the packet is being forwarded
- * via a source route.
- */
-static void
-ip_forward(m, srcrt)
- struct mbuf *m;
- int srcrt;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register struct sockaddr_in *sin;
- register struct rtentry *rt;
- int error, type = 0, code = 0;
- struct mbuf *mcopy;
- n_long dest;
- struct ifnet *destifp;
-
- dest = 0;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("forward: src %lx dst %lx ttl %x\n",
- ip->ip_src.s_addr, ip->ip_dst.s_addr, ip->ip_ttl);
-#endif
-
-
- if (m->m_flags & M_BCAST || in_canforward(ip->ip_dst) == 0) {
- ipstat.ips_cantforward++;
- m_freem(m);
- return;
- }
- HTONS(ip->ip_id);
- if (ip->ip_ttl <= IPTTLDEC) {
- icmp_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, dest, 0);
- return;
- }
- ip->ip_ttl -= IPTTLDEC;
-
- sin = (struct sockaddr_in *)&ipforward_rt.ro_dst;
- if ((rt = ipforward_rt.ro_rt) == 0 ||
- ip->ip_dst.s_addr != sin->sin_addr.s_addr) {
- if (ipforward_rt.ro_rt) {
- RTFREE(ipforward_rt.ro_rt);
- ipforward_rt.ro_rt = 0;
- }
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_addr = ip->ip_dst;
-
- rtalloc_ign(&ipforward_rt, RTF_PRCLONING);
- if (ipforward_rt.ro_rt == 0) {
- icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, dest, 0);
- return;
- }
- rt = ipforward_rt.ro_rt;
- }
-
- /*
- * Save at most 64 bytes of the packet in case
- * we need to generate an ICMP message to the src.
- */
- mcopy = m_copy(m, 0, imin((int)ip->ip_len, 64));
-
- /*
- * If forwarding packet using same interface that it came in on,
- * perhaps should send a redirect to sender to shortcut a hop.
- * Only send redirect if source is sending directly to us,
- * and if packet was not source routed (or has any options).
- * Also, don't send redirect if forwarding using a default route
- * or a route modified by a redirect.
- */
-#define satosin(sa) ((struct sockaddr_in *)(sa))
- if (rt->rt_ifp == m->m_pkthdr.rcvif &&
- (rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0 &&
- satosin(rt_key(rt))->sin_addr.s_addr != 0 &&
- ipsendredirects && !srcrt) {
-#define RTA(rt) ((struct in_ifaddr *)(rt->rt_ifa))
- u_long src = ntohl(ip->ip_src.s_addr);
-
- if (RTA(rt) &&
- (src & RTA(rt)->ia_subnetmask) == RTA(rt)->ia_subnet) {
- if (rt->rt_flags & RTF_GATEWAY)
- dest = satosin(rt->rt_gateway)->sin_addr.s_addr;
- else
- dest = ip->ip_dst.s_addr;
- /* Router requirements says to only send host redirects */
- type = ICMP_REDIRECT;
- code = ICMP_REDIRECT_HOST;
-#ifdef DIAGNOSTIC
- if (ipprintfs)
- printf("redirect (%d) to %lx\n", code, (u_long)dest);
-#endif
- }
- }
-
- error = ip_output(m, (struct mbuf *)0, &ipforward_rt,
- IP_FORWARDING, 0);
- if (error)
- ipstat.ips_cantforward++;
- else {
- ipstat.ips_forward++;
- if (type)
- ipstat.ips_redirectsent++;
- else {
- if (mcopy)
- m_freem(mcopy);
- return;
- }
- }
- if (mcopy == NULL)
- return;
- destifp = NULL;
-
- switch (error) {
-
- case 0: /* forwarded, but need redirect */
- /* type, code set above */
- break;
-
- case ENETUNREACH: /* shouldn't happen, checked above */
- case EHOSTUNREACH:
- case ENETDOWN:
- case EHOSTDOWN:
- default:
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_HOST;
- break;
-
- case EMSGSIZE:
- type = ICMP_UNREACH;
- code = ICMP_UNREACH_NEEDFRAG;
- if (ipforward_rt.ro_rt)
- destifp = ipforward_rt.ro_rt->rt_ifp;
- ipstat.ips_cantfrag++;
- break;
-
- case ENOBUFS:
- type = ICMP_SOURCEQUENCH;
- code = 0;
- break;
- }
- icmp_error(mcopy, type, code, dest, destifp);
-}
-
-void
-ip_savecontrol(inp, mp, ip, m)
- register struct inpcb *inp;
- register struct mbuf **mp;
- register struct ip *ip;
- register struct mbuf *m;
-{
- if (inp->inp_socket->so_options & SO_TIMESTAMP) {
- struct timeval tv;
-
- microtime(&tv);
- *mp = sbcreatecontrol((caddr_t) &tv, sizeof(tv),
- SCM_TIMESTAMP, SOL_SOCKET);
- if (*mp)
- mp = &(*mp)->m_next;
- }
- if (inp->inp_flags & INP_RECVDSTADDR) {
- *mp = sbcreatecontrol((caddr_t) &ip->ip_dst,
- sizeof(struct in_addr), IP_RECVDSTADDR, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
-#ifdef notyet
- /* XXX
- * Moving these out of udp_input() made them even more broken
- * than they already were.
- */
- /* options were tossed already */
- if (inp->inp_flags & INP_RECVOPTS) {
- *mp = sbcreatecontrol((caddr_t) opts_deleted_above,
- sizeof(struct in_addr), IP_RECVOPTS, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
- /* ip_srcroute doesn't do what we want here, need to fix */
- if (inp->inp_flags & INP_RECVRETOPTS) {
- *mp = sbcreatecontrol((caddr_t) ip_srcroute(),
- sizeof(struct in_addr), IP_RECVRETOPTS, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
-#endif
- if (inp->inp_flags & INP_RECVIF) {
- struct sockaddr_dl sdl;
-
- sdl.sdl_len = offsetof(struct sockaddr_dl, sdl_data[0]);
- sdl.sdl_family = AF_LINK;
- sdl.sdl_index = m->m_pkthdr.rcvif ?
- m->m_pkthdr.rcvif->if_index : 0;
- sdl.sdl_nlen = sdl.sdl_alen = sdl.sdl_slen = 0;
- *mp = sbcreatecontrol((caddr_t) &sdl, sdl.sdl_len,
- IP_RECVIF, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
-}
-
-int
-ip_rsvp_init(struct socket *so)
-{
- if (so->so_type != SOCK_RAW ||
- so->so_proto->pr_protocol != IPPROTO_RSVP)
- return EOPNOTSUPP;
-
- if (ip_rsvpd != NULL)
- return EADDRINUSE;
-
- ip_rsvpd = so;
- /*
- * This may seem silly, but we need to be sure we don't over-increment
- * the RSVP counter, in case something slips up.
- */
- if (!ip_rsvp_on) {
- ip_rsvp_on = 1;
- rsvp_on++;
- }
-
- return 0;
-}
-
-int
-ip_rsvp_done(void)
-{
- ip_rsvpd = NULL;
- /*
- * This may seem silly, but we need to be sure we don't over-decrement
- * the RSVP counter, in case something slips up.
- */
- if (ip_rsvp_on) {
- ip_rsvp_on = 0;
- rsvp_on--;
- }
- return 0;
-}
diff --git a/cpukit/libnetworking/netinet/ip_mroute.c b/cpukit/libnetworking/netinet/ip_mroute.c
deleted file mode 100644
index 662d695dfe..0000000000
--- a/cpukit/libnetworking/netinet/ip_mroute.c
+++ /dev/null
@@ -1,2302 +0,0 @@
-/*
- * IP multicast forwarding procedures
- *
- * Written by David Waitzman, BBN Labs, August 1988.
- * Modified by Steve Deering, Stanford, February 1989.
- * Modified by Mark J. Steiglitz, Stanford, May, 1991
- * Modified by Van Jacobson, LBL, January 1993
- * Modified by Ajit Thyagarajan, PARC, August 1993
- * Modified by Bill Fenner, PARC, April 1995
- *
- * MROUTING Revision: 3.5
- * $Id$
- */
-
-#include "opt_mrouting.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
-#include <sys/ioctl.h>
-#include <sys/syslog.h>
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/igmp.h>
-#include <netinet/igmp_var.h>
-#include <netinet/ip_mroute.h>
-#include <netinet/udp.h>
-
-#ifndef NTOHL
-#if BYTE_ORDER != BIG_ENDIAN
-#define NTOHL(d) ((d) = ntohl((d)))
-#define NTOHS(d) ((d) = ntohs((u_short)(d)))
-#define HTONL(d) ((d) = htonl((d)))
-#define HTONS(d) ((d) = htons((u_short)(d)))
-#else
-#define NTOHL(d)
-#define NTOHS(d)
-#define HTONL(d)
-#define HTONS(d)
-#endif
-#endif
-
-#ifndef MROUTING
-extern u_long _ip_mcast_src __P((int vifi));
-extern int _ip_mforward __P((struct ip *ip, struct ifnet *ifp,
- struct mbuf *m, struct ip_moptions *imo));
-extern int _ip_mrouter_done __P((void));
-extern int _ip_mrouter_get __P((int cmd, struct socket *so,
- struct mbuf **m));
-extern int _ip_mrouter_set __P((int cmd, struct socket *so,
- struct mbuf *m));
-extern int _mrt_ioctl __P((int req, caddr_t data, struct proc *p));
-
-/*
- * Dummy routines and globals used when multicast routing is not compiled in.
- */
-
-struct socket *ip_mrouter = NULL;
-/* static u_int ip_mrtproto = 0; */
-/* static struct mrtstat mrtstat; */
-u_int rsvpdebug = 0;
-
-int
-_ip_mrouter_set(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf *m;
-{
- return(EOPNOTSUPP);
-}
-
-int (*ip_mrouter_set)(int, struct socket *, struct mbuf *) = _ip_mrouter_set;
-
-
-int
-_ip_mrouter_get(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf **m;
-{
- return(EOPNOTSUPP);
-}
-
-int (*ip_mrouter_get)(int, struct socket *, struct mbuf **) = _ip_mrouter_get;
-
-int
-_ip_mrouter_done()
-{
- return(0);
-}
-
-int (*ip_mrouter_done)(void) = _ip_mrouter_done;
-
-int
-_ip_mforward(ip, ifp, m, imo)
- struct ip *ip;
- struct ifnet *ifp;
- struct mbuf *m;
- struct ip_moptions *imo;
-{
- return(0);
-}
-
-int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *,
- struct ip_moptions *) = _ip_mforward;
-
-int
-_mrt_ioctl(int req, caddr_t data, struct proc *p)
-{
- return EOPNOTSUPP;
-}
-
-int (*mrt_ioctl)(int, caddr_t, struct proc *) = _mrt_ioctl;
-
-void
-rsvp_input(m, iphlen) /* XXX must fixup manually */
- struct mbuf *m;
- int iphlen;
-{
- /* Can still get packets with rsvp_on = 0 if there is a local member
- * of the group to which the RSVP packet is addressed. But in this
- * case we want to throw the packet away.
- */
- if (!rsvp_on) {
- m_freem(m);
- return;
- }
-
- if (ip_rsvpd != NULL) {
- if (rsvpdebug)
- printf("rsvp_input: Sending packet up old-style socket\n");
- rip_input(m, iphlen);
- return;
- }
- /* Drop the packet */
- m_freem(m);
-}
-
-void ipip_input(struct mbuf *m, int iphlen) { /* XXX must fixup manually */
- rip_input(m, iphlen);
-}
-
-int (*legal_vif_num)(int) = 0;
-
-/*
- * This should never be called, since IP_MULTICAST_VIF should fail, but
- * just in case it does get called, the code a little lower in ip_output
- * will assign the packet a local address.
- */
-u_long
-_ip_mcast_src(int vifi) { return INADDR_ANY; }
-u_long (*ip_mcast_src)(int) = _ip_mcast_src;
-
-int
-ip_rsvp_vif_init(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- return(EINVAL);
-}
-
-int
-ip_rsvp_vif_done(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- return(EINVAL);
-}
-
-void
-ip_rsvp_force_done(so)
- struct socket *so;
-{
- return;
-}
-
-#else /* MROUTING */
-
-#define M_HASCL(m) ((m)->m_flags & M_EXT)
-
-#define INSIZ sizeof(struct in_addr)
-#define same(a1, a2) \
- (bcmp((caddr_t)(a1), (caddr_t)(a2), INSIZ) == 0)
-
-#define MT_MRTABLE MT_RTABLE /* since nothing else uses it */
-
-/*
- * Globals. All but ip_mrouter and ip_mrtproto could be static,
- * except for netstat or debugging purposes.
- */
-#ifndef MROUTE_LKM
-struct socket *ip_mrouter = NULL;
-struct mrtstat mrtstat;
-
-int ip_mrtproto = IGMP_DVMRP; /* for netstat only */
-#else /* MROUTE_LKM */
-extern void X_ipip_input __P((struct mbuf *m, int iphlen));
-extern struct mrtstat mrtstat;
-static int ip_mrtproto;
-#endif
-
-#define NO_RTE_FOUND 0x1
-#define RTE_FOUND 0x2
-
-static struct mbuf *mfctable[MFCTBLSIZ];
-static u_char nexpire[MFCTBLSIZ];
-static struct vif viftable[MAXVIFS];
-static u_int mrtdebug = 0; /* debug level */
-#define DEBUG_MFC 0x02
-#define DEBUG_FORWARD 0x04
-#define DEBUG_EXPIRE 0x08
-#define DEBUG_XMIT 0x10
-static u_int tbfdebug = 0; /* tbf debug level */
-static u_int rsvpdebug = 0; /* rsvp debug level */
-
-#define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */
-#define UPCALL_EXPIRE 6 /* number of timeouts */
-
-/*
- * Define the token bucket filter structures
- * tbftable -> each vif has one of these for storing info
- */
-
-static struct tbf tbftable[MAXVIFS];
-#define TBF_REPROCESS (hz / 100) /* 100x / second */
-
-/*
- * 'Interfaces' associated with decapsulator (so we can tell
- * packets that went through it from ones that get reflected
- * by a broken gateway). These interfaces are never linked into
- * the system ifnet list & no routes point to them. I.e., packets
- * can't be sent this way. They only exist as a placeholder for
- * multicast source verification.
- */
-static struct ifnet multicast_decap_if[MAXVIFS];
-
-#define ENCAP_TTL 64
-#define ENCAP_PROTO IPPROTO_IPIP /* 4 */
-
-/* prototype IP hdr for encapsulated packets */
-static struct ip multicast_encap_iphdr = {
-#if BYTE_ORDER == LITTLE_ENDIAN
- sizeof(struct ip) >> 2, IPVERSION,
-#else
- IPVERSION, sizeof(struct ip) >> 2,
-#endif
- 0, /* tos */
- sizeof(struct ip), /* total length */
- 0, /* id */
- 0, /* frag offset */
- ENCAP_TTL, ENCAP_PROTO,
- 0, /* checksum */
-};
-
-/*
- * Private variables.
- */
-static vifi_t numvifs = 0;
-static int have_encap_tunnel = 0;
-
-/*
- * one-back cache used by ipip_input to locate a tunnel's vif
- * given a datagram's src ip address.
- */
-static u_long last_encap_src;
-static struct vif *last_encap_vif;
-
-static u_long X_ip_mcast_src __P((int vifi));
-static int X_ip_mforward __P((struct ip *ip, struct ifnet *ifp, struct mbuf *m, struct ip_moptions *imo));
-static int X_ip_mrouter_done __P((void));
-static int X_ip_mrouter_get __P((int cmd, struct socket *so, struct mbuf **m));
-static int X_ip_mrouter_set __P((int cmd, struct socket *so, struct mbuf *m));
-static int X_legal_vif_num __P((int vif));
-static int X_mrt_ioctl __P((int cmd, caddr_t data));
-
-static int get_sg_cnt(struct sioc_sg_req *);
-static int get_vif_cnt(struct sioc_vif_req *);
-static int ip_mrouter_init(struct socket *, struct mbuf *);
-static int add_vif(struct vifctl *);
-static int del_vif(vifi_t *);
-static int add_mfc(struct mfcctl *);
-static int del_mfc(struct mfcctl *);
-static int socket_send(struct socket *, struct mbuf *, struct sockaddr_in *);
-static int get_version(struct mbuf *);
-static int get_assert(struct mbuf *);
-static int set_assert(int *);
-static void expire_upcalls(void *);
-static int ip_mdq(struct mbuf *, struct ifnet *, struct mfc *,
- vifi_t);
-static void phyint_send(struct ip *, struct vif *, struct mbuf *);
-static void encap_send(struct ip *, struct vif *, struct mbuf *);
-static void tbf_control(struct vif *, struct mbuf *, struct ip *, u_long);
-static void tbf_queue(struct vif *, struct mbuf *);
-static void tbf_process_q(struct vif *);
-static void tbf_reprocess_q(void *);
-static int tbf_dq_sel(struct vif *, struct ip *);
-static void tbf_send_packet(struct vif *, struct mbuf *);
-static void tbf_update_tokens(struct vif *);
-static int priority(struct vif *, struct ip *);
-void multiencap_decap(struct mbuf *);
-
-/*
- * whether or not special PIM assert processing is enabled.
- */
-static int pim_assert;
-/*
- * Rate limit for assert notification messages, in usec
- */
-#define ASSERT_MSG_TIME 3000000
-
-/*
- * Hash function for a source, group entry
- */
-#define MFCHASH(a, g) MFCHASHMOD(((a) >> 20) ^ ((a) >> 10) ^ (a) ^ \
- ((g) >> 20) ^ ((g) >> 10) ^ (g))
-
-/*
- * Find a route for a given origin IP address and Multicast group address
- * Type of service parameter to be added in the future!!!
- */
-
-#define MFCFIND(o, g, rt) { \
- register struct mbuf *_mb_rt = mfctable[MFCHASH(o,g)]; \
- register struct mfc *_rt = NULL; \
- rt = NULL; \
- ++mrtstat.mrts_mfc_lookups; \
- while (_mb_rt) { \
- _rt = mtod(_mb_rt, struct mfc *); \
- if ((_rt->mfc_origin.s_addr == o) && \
- (_rt->mfc_mcastgrp.s_addr == g) && \
- (_mb_rt->m_act == NULL)) { \
- rt = _rt; \
- break; \
- } \
- _mb_rt = _mb_rt->m_next; \
- } \
- if (rt == NULL) { \
- ++mrtstat.mrts_mfc_misses; \
- } \
-}
-
-
-/*
- * Macros to compute elapsed time efficiently
- * Borrowed from Van Jacobson's scheduling code
- */
-#define TV_DELTA(a, b, delta) { \
- register int xxs; \
- \
- delta = (a).tv_usec - (b).tv_usec; \
- if ((xxs = (a).tv_sec - (b).tv_sec)) { \
- switch (xxs) { \
- case 2: \
- delta += 1000000; \
- /* fall through */ \
- case 1: \
- delta += 1000000; \
- break; \
- default: \
- delta += (1000000 * xxs); \
- } \
- } \
-}
-
-#define TV_LT(a, b) (((a).tv_usec < (b).tv_usec && \
- (a).tv_sec <= (b).tv_sec) || (a).tv_sec < (b).tv_sec)
-
-#ifdef UPCALL_TIMING
-u_long upcall_data[51];
-static void collate(struct timeval *);
-#endif /* UPCALL_TIMING */
-
-
-/*
- * Handle MRT setsockopt commands to modify the multicast routing tables.
- */
-static int
-X_ip_mrouter_set(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf *m;
-{
- if (cmd != MRT_INIT && so != ip_mrouter) return EACCES;
-
- switch (cmd) {
- case MRT_INIT: return ip_mrouter_init(so, m);
- case MRT_DONE: return ip_mrouter_done();
- case MRT_ADD_VIF: return add_vif (mtod(m, struct vifctl *));
- case MRT_DEL_VIF: return del_vif (mtod(m, vifi_t *));
- case MRT_ADD_MFC: return add_mfc (mtod(m, struct mfcctl *));
- case MRT_DEL_MFC: return del_mfc (mtod(m, struct mfcctl *));
- case MRT_ASSERT: return set_assert(mtod(m, int *));
- default: return EOPNOTSUPP;
- }
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mrouter_set)(int, struct socket *, struct mbuf *) = X_ip_mrouter_set;
-#endif
-
-/*
- * Handle MRT getsockopt commands
- */
-static int
-X_ip_mrouter_get(cmd, so, m)
- int cmd;
- struct socket *so;
- struct mbuf **m;
-{
- struct mbuf *mb;
-
- if (so != ip_mrouter) return EACCES;
-
- *m = mb = m_get(M_WAIT, MT_SOOPTS);
-
- switch (cmd) {
- case MRT_VERSION: return get_version(mb);
- case MRT_ASSERT: return get_assert(mb);
- default: return EOPNOTSUPP;
- }
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mrouter_get)(int, struct socket *, struct mbuf **) = X_ip_mrouter_get;
-#endif
-
-/*
- * Handle ioctl commands to obtain information from the cache
- */
-static int
-X_mrt_ioctl(cmd, data)
- int cmd;
- caddr_t data;
-{
- int error = 0;
-
- switch (cmd) {
- case (SIOCGETVIFCNT):
- return (get_vif_cnt((struct sioc_vif_req *)data));
- break;
- case (SIOCGETSGCNT):
- return (get_sg_cnt((struct sioc_sg_req *)data));
- break;
- default:
- return (EINVAL);
- break;
- }
- return error;
-}
-
-#ifndef MROUTE_LKM
-int (*mrt_ioctl)(int, caddr_t) = X_mrt_ioctl;
-#endif
-
-/*
- * returns the packet, byte, rpf-failure count for the source group provided
- */
-static int
-get_sg_cnt(req)
- register struct sioc_sg_req *req;
-{
- register struct mfc *rt;
- int s;
-
- s = splnet();
- MFCFIND(req->src.s_addr, req->grp.s_addr, rt);
- splx(s);
- if (rt != NULL) {
- req->pktcnt = rt->mfc_pkt_cnt;
- req->bytecnt = rt->mfc_byte_cnt;
- req->wrong_if = rt->mfc_wrong_if;
- } else
- req->pktcnt = req->bytecnt = req->wrong_if = 0xffffffff;
-
- return 0;
-}
-
-/*
- * returns the input and output packet and byte counts on the vif provided
- */
-static int
-get_vif_cnt(req)
- register struct sioc_vif_req *req;
-{
- register vifi_t vifi = req->vifi;
-
- if (vifi >= numvifs) return EINVAL;
-
- req->icount = viftable[vifi].v_pkt_in;
- req->ocount = viftable[vifi].v_pkt_out;
- req->ibytes = viftable[vifi].v_bytes_in;
- req->obytes = viftable[vifi].v_bytes_out;
-
- return 0;
-}
-
-/*
- * Enable multicast routing
- */
-static int
-ip_mrouter_init(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- int *v;
-
- if (mrtdebug)
- log(LOG_DEBUG,"ip_mrouter_init: so_type = %d, pr_protocol = %d\n",
- so->so_type, so->so_proto->pr_protocol);
-
- if (so->so_type != SOCK_RAW ||
- so->so_proto->pr_protocol != IPPROTO_IGMP) return EOPNOTSUPP;
-
- if (!m || (m->m_len != sizeof(int *)))
- return ENOPROTOOPT;
-
- v = mtod(m, int *);
- if (*v != 1)
- return ENOPROTOOPT;
-
- if (ip_mrouter != NULL) return EADDRINUSE;
-
- ip_mrouter = so;
-
- bzero((caddr_t)mfctable, sizeof(mfctable));
- bzero((caddr_t)nexpire, sizeof(nexpire));
-
- pim_assert = 0;
-
- timeout(expire_upcalls, (caddr_t)NULL, EXPIRE_TIMEOUT);
-
- if (mrtdebug)
- log(LOG_DEBUG, "ip_mrouter_init\n");
-
- return 0;
-}
-
-/*
- * Disable multicast routing
- */
-static int
-X_ip_mrouter_done()
-{
- vifi_t vifi;
- int i;
- struct ifnet *ifp;
- struct ifreq ifr;
- struct mbuf *mb_rt;
- struct mbuf *m;
- struct rtdetq *rte;
- int s;
-
- s = splnet();
-
- /*
- * For each phyint in use, disable promiscuous reception of all IP
- * multicasts.
- */
- for (vifi = 0; vifi < numvifs; vifi++) {
- if (viftable[vifi].v_lcl_addr.s_addr != 0 &&
- !(viftable[vifi].v_flags & VIFF_TUNNEL)) {
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr.s_addr
- = INADDR_ANY;
- ifp = viftable[vifi].v_ifp;
- (*ifp->if_ioctl)(ifp, SIOCDELMULTI, (caddr_t)&ifr);
- }
- }
- bzero((caddr_t)tbftable, sizeof(tbftable));
- bzero((caddr_t)viftable, sizeof(viftable));
- numvifs = 0;
- pim_assert = 0;
-
- untimeout(expire_upcalls, (caddr_t)NULL);
-
- /*
- * Free all multicast forwarding cache entries.
- */
- for (i = 0; i < MFCTBLSIZ; i++) {
- mb_rt = mfctable[i];
- while (mb_rt) {
- if (mb_rt->m_act != NULL) {
- while (mb_rt->m_act) {
- m = mb_rt->m_act;
- mb_rt->m_act = m->m_act;
- rte = mtod(m, struct rtdetq *);
- m_freem(rte->m);
- m_free(m);
- }
- }
- mb_rt = m_free(mb_rt);
- }
- }
-
- bzero((caddr_t)mfctable, sizeof(mfctable));
-
- /*
- * Reset de-encapsulation cache
- */
- last_encap_src = 0;
- last_encap_vif = NULL;
- have_encap_tunnel = 0;
-
- ip_mrouter = NULL;
-
- splx(s);
-
- if (mrtdebug)
- log(LOG_DEBUG, "ip_mrouter_done\n");
-
- return 0;
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mrouter_done)(void) = X_ip_mrouter_done;
-#endif
-
-static int
-get_version(mb)
- struct mbuf *mb;
-{
- int *v;
-
- v = mtod(mb, int *);
-
- *v = 0x0305; /* XXX !!!! */
- mb->m_len = sizeof(int);
-
- return 0;
-}
-
-/*
- * Set PIM assert processing global
- */
-static int
-set_assert(i)
- int *i;
-{
- if ((*i != 1) && (*i != 0))
- return EINVAL;
-
- pim_assert = *i;
-
- return 0;
-}
-
-/*
- * Get PIM assert processing global
- */
-static int
-get_assert(m)
- struct mbuf *m;
-{
- int *i;
-
- i = mtod(m, int *);
-
- *i = pim_assert;
-
- return 0;
-}
-
-/*
- * Add a vif to the vif table
- */
-static int
-add_vif(vifcp)
- register struct vifctl *vifcp;
-{
- register struct vif *vifp = viftable + vifcp->vifc_vifi;
- static struct sockaddr_in sin = {sizeof sin, AF_INET};
- struct ifaddr *ifa;
- struct ifnet *ifp;
- struct ifreq ifr;
- int error, s;
- struct tbf *v_tbf = tbftable + vifcp->vifc_vifi;
-
- if (vifcp->vifc_vifi >= MAXVIFS) return EINVAL;
- if (vifp->v_lcl_addr.s_addr != 0) return EADDRINUSE;
-
- /* Find the interface with an address in AF_INET family */
- sin.sin_addr = vifcp->vifc_lcl_addr;
- ifa = ifa_ifwithaddr((struct sockaddr *)&sin);
- if (ifa == 0) return EADDRNOTAVAIL;
- ifp = ifa->ifa_ifp;
-
- if (vifcp->vifc_flags & VIFF_TUNNEL) {
- if ((vifcp->vifc_flags & VIFF_SRCRT) == 0) {
- /*
- * An encapsulating tunnel is wanted. Tell ipip_input() to
- * start paying attention to encapsulated packets.
- */
- if (have_encap_tunnel == 0) {
- have_encap_tunnel = 1;
- for (s = 0; s < MAXVIFS; ++s) {
- multicast_decap_if[s].if_name = "mdecap";
- multicast_decap_if[s].if_unit = s;
- }
- }
- /*
- * Set interface to fake encapsulator interface
- */
- ifp = &multicast_decap_if[vifcp->vifc_vifi];
- /*
- * Prepare cached route entry
- */
- bzero(&vifp->v_route, sizeof(vifp->v_route));
- } else {
- log(LOG_ERR, "source routed tunnels not supported\n");
- return EOPNOTSUPP;
- }
- } else {
- /* Make sure the interface supports multicast */
- if ((ifp->if_flags & IFF_MULTICAST) == 0)
- return EOPNOTSUPP;
-
- /* Enable promiscuous reception of all IP multicasts from the if */
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr.s_addr = INADDR_ANY;
- s = splnet();
- error = (*ifp->if_ioctl)(ifp, SIOCADDMULTI, (caddr_t)&ifr);
- splx(s);
- if (error)
- return error;
- }
-
- s = splnet();
- /* define parameters for the tbf structure */
- vifp->v_tbf = v_tbf;
- GET_TIME(vifp->v_tbf->tbf_last_pkt_t);
- vifp->v_tbf->tbf_n_tok = 0;
- vifp->v_tbf->tbf_q_len = 0;
- vifp->v_tbf->tbf_max_q_len = MAXQSIZE;
- vifp->v_tbf->tbf_q = vifp->v_tbf->tbf_t = NULL;
-
- vifp->v_flags = vifcp->vifc_flags;
- vifp->v_threshold = vifcp->vifc_threshold;
- vifp->v_lcl_addr = vifcp->vifc_lcl_addr;
- vifp->v_rmt_addr = vifcp->vifc_rmt_addr;
- vifp->v_ifp = ifp;
- /* scaling up here allows division by 1024 in critical code */
- vifp->v_rate_limit= vifcp->vifc_rate_limit * 1024 / 1000;
- vifp->v_rsvp_on = 0;
- vifp->v_rsvpd = NULL;
- /* initialize per vif pkt counters */
- vifp->v_pkt_in = 0;
- vifp->v_pkt_out = 0;
- vifp->v_bytes_in = 0;
- vifp->v_bytes_out = 0;
- splx(s);
-
- /* Adjust numvifs up if the vifi is higher than numvifs */
- if (numvifs <= vifcp->vifc_vifi) numvifs = vifcp->vifc_vifi + 1;
-
- if (mrtdebug)
- log(LOG_DEBUG, "add_vif #%d, lcladdr %x, %s %x, thresh %x, rate %d\n",
- vifcp->vifc_vifi,
- ntohl(vifcp->vifc_lcl_addr.s_addr),
- (vifcp->vifc_flags & VIFF_TUNNEL) ? "rmtaddr" : "mask",
- ntohl(vifcp->vifc_rmt_addr.s_addr),
- vifcp->vifc_threshold,
- vifcp->vifc_rate_limit);
-
- return 0;
-}
-
-/*
- * Delete a vif from the vif table
- */
-static int
-del_vif(vifip)
- vifi_t *vifip;
-{
- register struct vif *vifp = viftable + *vifip;
- register vifi_t vifi;
- register struct mbuf *m;
- struct ifnet *ifp;
- struct ifreq ifr;
- int s;
-
- if (*vifip >= numvifs) return EINVAL;
- if (vifp->v_lcl_addr.s_addr == 0) return EADDRNOTAVAIL;
-
- s = splnet();
-
- if (!(vifp->v_flags & VIFF_TUNNEL)) {
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_family = AF_INET;
- ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr.s_addr = INADDR_ANY;
- ifp = vifp->v_ifp;
- (*ifp->if_ioctl)(ifp, SIOCDELMULTI, (caddr_t)&ifr);
- }
-
- if (vifp == last_encap_vif) {
- last_encap_vif = 0;
- last_encap_src = 0;
- }
-
- /*
- * Free packets queued at the interface
- */
- while (vifp->v_tbf->tbf_q) {
- m = vifp->v_tbf->tbf_q;
- vifp->v_tbf->tbf_q = m->m_act;
- m_freem(m);
- }
-
- bzero((caddr_t)vifp->v_tbf, sizeof(*(vifp->v_tbf)));
- bzero((caddr_t)vifp, sizeof (*vifp));
-
- /* Adjust numvifs down */
- for (vifi = numvifs; vifi > 0; vifi--)
- if (viftable[vifi-1].v_lcl_addr.s_addr != 0) break;
- numvifs = vifi;
-
- splx(s);
-
- if (mrtdebug)
- log(LOG_DEBUG, "del_vif %d, numvifs %d\n", *vifip, numvifs);
-
- return 0;
-}
-
-/*
- * Add an mfc entry
- */
-static int
-add_mfc(mfccp)
- struct mfcctl *mfccp;
-{
- struct mfc *rt;
- register struct mbuf *mb_rt;
- u_long hash;
- struct mbuf *mb_ntry;
- struct rtdetq *rte;
- register u_short nstl;
- int s;
- int i;
-
- MFCFIND(mfccp->mfcc_origin.s_addr, mfccp->mfcc_mcastgrp.s_addr, rt);
-
- /* If an entry already exists, just update the fields */
- if (rt) {
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"add_mfc update o %x g %x p %x\n",
- ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent);
-
- s = splnet();
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- splx(s);
- return 0;
- }
-
- /*
- * Find the entry for which the upcall was made and update
- */
- s = splnet();
- hash = MFCHASH(mfccp->mfcc_origin.s_addr, mfccp->mfcc_mcastgrp.s_addr);
- for (mb_rt = mfctable[hash], nstl = 0; mb_rt; mb_rt = mb_rt->m_next) {
-
- rt = mtod(mb_rt, struct mfc *);
- if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
- (rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr) &&
- (mb_rt->m_act != NULL)) {
-
- if (nstl++)
- log(LOG_ERR, "add_mfc %s o %x g %x p %x dbx %x\n",
- "multiple kernel entries",
- ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent, mb_rt->m_act);
-
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"add_mfc o %x g %x p %x dbg %x\n",
- ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent, mb_rt->m_act);
-
- rt->mfc_origin = mfccp->mfcc_origin;
- rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- /* initialize pkt counters per src-grp */
- rt->mfc_pkt_cnt = 0;
- rt->mfc_byte_cnt = 0;
- rt->mfc_wrong_if = 0;
- rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
-
- rt->mfc_expire = 0; /* Don't clean this guy up */
- nexpire[hash]--;
-
- /* free packets Qed at the end of this entry */
- while (mb_rt->m_act) {
- mb_ntry = mb_rt->m_act;
- rte = mtod(mb_ntry, struct rtdetq *);
-/* #ifdef RSVP_ISI */
- ip_mdq(rte->m, rte->ifp, rt, -1);
-/* #endif */
- mb_rt->m_act = mb_ntry->m_act;
- m_freem(rte->m);
-#ifdef UPCALL_TIMING
- collate(&(rte->t));
-#endif /* UPCALL_TIMING */
- m_free(mb_ntry);
- }
- }
- }
-
- /*
- * It is possible that an entry is being inserted without an upcall
- */
- if (nstl == 0) {
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"add_mfc no upcall h %d o %x g %x p %x\n",
- hash, ntohl(mfccp->mfcc_origin.s_addr),
- ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent);
-
- for (mb_rt = mfctable[hash]; mb_rt; mb_rt = mb_rt->m_next) {
-
- rt = mtod(mb_rt, struct mfc *);
- if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
- (rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr)) {
-
- rt->mfc_origin = mfccp->mfcc_origin;
- rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- /* initialize pkt counters per src-grp */
- rt->mfc_pkt_cnt = 0;
- rt->mfc_byte_cnt = 0;
- rt->mfc_wrong_if = 0;
- rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
- if (rt->mfc_expire)
- nexpire[hash]--;
- rt->mfc_expire = 0;
- }
- }
- if (mb_rt == NULL) {
- /* no upcall, so make a new entry */
- MGET(mb_rt, M_DONTWAIT, MT_MRTABLE);
- if (mb_rt == NULL) {
- splx(s);
- return ENOBUFS;
- }
-
- rt = mtod(mb_rt, struct mfc *);
-
- /* insert new entry at head of hash chain */
- rt->mfc_origin = mfccp->mfcc_origin;
- rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
- rt->mfc_parent = mfccp->mfcc_parent;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
- /* initialize pkt counters per src-grp */
- rt->mfc_pkt_cnt = 0;
- rt->mfc_byte_cnt = 0;
- rt->mfc_wrong_if = 0;
- rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
- rt->mfc_expire = 0;
-
- /* link into table */
- mb_rt->m_next = mfctable[hash];
- mfctable[hash] = mb_rt;
- mb_rt->m_act = NULL;
- }
- }
- splx(s);
- return 0;
-}
-
-#ifdef UPCALL_TIMING
-/*
- * collect delay statistics on the upcalls
- */
-static void collate(t)
-register struct timeval *t;
-{
- register u_long d;
- register struct timeval tp;
- register u_long delta;
-
- GET_TIME(tp);
-
- if (TV_LT(*t, tp))
- {
- TV_DELTA(tp, *t, delta);
-
- d = delta >> 10;
- if (d > 50)
- d = 50;
-
- ++upcall_data[d];
- }
-}
-#endif /* UPCALL_TIMING */
-
-/*
- * Delete an mfc entry
- */
-static int
-del_mfc(mfccp)
- struct mfcctl *mfccp;
-{
- struct in_addr origin;
- struct in_addr mcastgrp;
- struct mfc *rt;
- struct mbuf *mb_rt;
- struct mbuf **nptr;
- u_long hash;
- int s;
-
- origin = mfccp->mfcc_origin;
- mcastgrp = mfccp->mfcc_mcastgrp;
- hash = MFCHASH(origin.s_addr, mcastgrp.s_addr);
-
- if (mrtdebug & DEBUG_MFC)
- log(LOG_DEBUG,"del_mfc orig %x mcastgrp %x\n",
- ntohl(origin.s_addr), ntohl(mcastgrp.s_addr));
-
- s = splnet();
-
- nptr = &mfctable[hash];
- while ((mb_rt = *nptr) != NULL) {
- rt = mtod(mb_rt, struct mfc *);
- if (origin.s_addr == rt->mfc_origin.s_addr &&
- mcastgrp.s_addr == rt->mfc_mcastgrp.s_addr &&
- mb_rt->m_act == NULL)
- break;
-
- nptr = &mb_rt->m_next;
- }
- if (mb_rt == NULL) {
- splx(s);
- return EADDRNOTAVAIL;
- }
-
- MFREE(mb_rt, *nptr);
-
- splx(s);
-
- return 0;
-}
-
-/*
- * Send a message to mrouted on the multicast routing socket
- */
-static int
-socket_send(s, mm, src)
- struct socket *s;
- struct mbuf *mm;
- struct sockaddr_in *src;
-{
- if (s) {
- if (sbappendaddr(&s->so_rcv,
- (struct sockaddr *)src,
- mm, (struct mbuf *)0) != 0) {
- sorwakeup(s);
- return 0;
- }
- }
- m_freem(mm);
- return -1;
-}
-
-/*
- * IP multicast forwarding function. This function assumes that the packet
- * pointed to by "ip" has arrived on (or is about to be sent to) the interface
- * pointed to by "ifp", and the packet is to be relayed to other networks
- * that have members of the packet's destination IP multicast group.
- *
- * The packet is returned unscathed to the caller, unless it is
- * erroneous, in which case a non-zero return value tells the caller to
- * discard it.
- */
-
-#define IP_HDR_LEN 20 /* # bytes of fixed IP header (excluding options) */
-#define TUNNEL_LEN 12 /* # bytes of IP option for tunnel encapsulation */
-
-static int
-X_ip_mforward(ip, ifp, m, imo)
- register struct ip *ip;
- struct ifnet *ifp;
- struct mbuf *m;
- struct ip_moptions *imo;
-{
- register struct mfc *rt;
- register u_char *ipoptions;
- static struct sockaddr_in k_igmpsrc = { sizeof k_igmpsrc, AF_INET };
- static int srctun = 0;
- register struct mbuf *mm;
- int s;
- vifi_t vifi;
- struct vif *vifp;
-
- if (mrtdebug & DEBUG_FORWARD)
- log(LOG_DEBUG, "ip_mforward: src %x, dst %x, ifp %x\n",
- ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr), ifp);
-
- if (ip->ip_hl < (IP_HDR_LEN + TUNNEL_LEN) >> 2 ||
- (ipoptions = (u_char *)(ip + 1))[1] != IPOPT_LSRR ) {
- /*
- * Packet arrived via a physical interface or
- * an encapsulated tunnel.
- */
- } else {
- /*
- * Packet arrived through a source-route tunnel.
- * Source-route tunnels are no longer supported.
- */
- if ((srctun++ % 1000) == 0)
- log(LOG_ERR, "ip_mforward: received source-routed packet from %x\n",
- ntohl(ip->ip_src.s_addr));
-
- return 1;
- }
-
- if ((imo) && ((vifi = imo->imo_multicast_vif) < numvifs)) {
- if (ip->ip_ttl < 255)
- ip->ip_ttl++; /* compensate for -1 in *_send routines */
- if (rsvpdebug && ip->ip_p == IPPROTO_RSVP) {
- vifp = viftable + vifi;
- printf("Sending IPPROTO_RSVP from %lx to %lx on vif %d (%s%s%d)\n",
- ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr), vifi,
- (vifp->v_flags & VIFF_TUNNEL) ? "tunnel on " : "",
- vifp->v_ifp->if_name, vifp->v_ifp->if_unit);
- }
- return (ip_mdq(m, ifp, NULL, vifi));
- }
- if (rsvpdebug && ip->ip_p == IPPROTO_RSVP) {
- printf("Warning: IPPROTO_RSVP from %lx to %lx without vif option\n",
- ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr));
- if(!imo)
- printf("In fact, no options were specified at all\n");
- }
-
- /*
- * Don't forward a packet with time-to-live of zero or one,
- * or a packet destined to a local-only group.
- */
- if (ip->ip_ttl <= 1 ||
- ntohl(ip->ip_dst.s_addr) <= INADDR_MAX_LOCAL_GROUP)
- return 0;
-
- /*
- * Determine forwarding vifs from the forwarding cache table
- */
- s = splnet();
- MFCFIND(ip->ip_src.s_addr, ip->ip_dst.s_addr, rt);
-
- /* Entry exists, so forward if necessary */
- if (rt != NULL) {
- splx(s);
- return (ip_mdq(m, ifp, rt, -1));
- } else {
- /*
- * If we don't have a route for packet's origin,
- * Make a copy of the packet &
- * send message to routing daemon
- */
-
- register struct mbuf *mb_rt;
- register struct mbuf *mb_ntry;
- register struct mbuf *mb0;
- register struct rtdetq *rte;
- register struct mbuf *rte_m;
- register u_long hash;
- register int npkts;
- int hlen = ip->ip_hl << 2;
-#ifdef UPCALL_TIMING
- struct timeval tp;
-
- GET_TIME(tp);
-#endif
-
- mrtstat.mrts_no_route++;
- if (mrtdebug & (DEBUG_FORWARD | DEBUG_MFC))
- log(LOG_DEBUG, "ip_mforward: no rte s %x g %x\n",
- ntohl(ip->ip_src.s_addr),
- ntohl(ip->ip_dst.s_addr));
-
- /*
- * Allocate mbufs early so that we don't do extra work if we are
- * just going to fail anyway. Make sure to pullup the header so
- * that other people can't step on it.
- */
- MGET(mb_ntry, M_DONTWAIT, MT_DATA);
- if (mb_ntry == NULL) {
- splx(s);
- return ENOBUFS;
- }
- mb0 = m_copy(m, 0, M_COPYALL);
- if (mb0 && (M_HASCL(mb0) || mb0->m_len < hlen))
- mb0 = m_pullup(mb0, hlen);
- if (mb0 == NULL) {
- m_free(mb_ntry);
- splx(s);
- return ENOBUFS;
- }
-
- /* is there an upcall waiting for this packet? */
- hash = MFCHASH(ip->ip_src.s_addr, ip->ip_dst.s_addr);
- for (mb_rt = mfctable[hash]; mb_rt; mb_rt = mb_rt->m_next) {
- rt = mtod(mb_rt, struct mfc *);
- if ((ip->ip_src.s_addr == rt->mfc_origin.s_addr) &&
- (ip->ip_dst.s_addr == rt->mfc_mcastgrp.s_addr) &&
- (mb_rt->m_act != NULL))
- break;
- }
-
- if (mb_rt == NULL) {
- int i;
- struct igmpmsg *im;
-
- /* no upcall, so make a new entry */
- MGET(mb_rt, M_DONTWAIT, MT_MRTABLE);
- if (mb_rt == NULL) {
- m_free(mb_ntry);
- m_freem(mb0);
- splx(s);
- return ENOBUFS;
- }
- /* Make a copy of the header to send to the user level process */
- mm = m_copy(mb0, 0, hlen);
- if (mm == NULL) {
- m_free(mb_ntry);
- m_freem(mb0);
- m_free(mb_rt);
- splx(s);
- return ENOBUFS;
- }
-
- /*
- * Send message to routing daemon to install
- * a route into the kernel table
- */
- k_igmpsrc.sin_addr = ip->ip_src;
-
- im = mtod(mm, struct igmpmsg *);
- im->im_msgtype = IGMPMSG_NOCACHE;
- im->im_mbz = 0;
-
- mrtstat.mrts_upcalls++;
-
- if (socket_send(ip_mrouter, mm, &k_igmpsrc) < 0) {
- log(LOG_WARNING, "ip_mforward: ip_mrouter socket queue full\n");
- ++mrtstat.mrts_upq_sockfull;
- m_free(mb_ntry);
- m_freem(mb0);
- m_free(mb_rt);
- splx(s);
- return ENOBUFS;
- }
-
- rt = mtod(mb_rt, struct mfc *);
-
- /* insert new entry at head of hash chain */
- rt->mfc_origin.s_addr = ip->ip_src.s_addr;
- rt->mfc_mcastgrp.s_addr = ip->ip_dst.s_addr;
- rt->mfc_expire = UPCALL_EXPIRE;
- nexpire[hash]++;
- for (i = 0; i < numvifs; i++)
- rt->mfc_ttls[i] = 0;
- rt->mfc_parent = -1;
-
- /* link into table */
- mb_rt->m_next = mfctable[hash];
- mfctable[hash] = mb_rt;
- mb_rt->m_act = NULL;
-
- rte_m = mb_rt;
- } else {
- /* determine if q has overflowed */
- for (rte_m = mb_rt, npkts = 0; rte_m->m_act; rte_m = rte_m->m_act)
- npkts++;
-
- if (npkts > MAX_UPQ) {
- mrtstat.mrts_upq_ovflw++;
- m_free(mb_ntry);
- m_freem(mb0);
- splx(s);
- return 0;
- }
- }
-
- mb_ntry->m_act = NULL;
- rte = mtod(mb_ntry, struct rtdetq *);
-
- rte->m = mb0;
- rte->ifp = ifp;
-#ifdef UPCALL_TIMING
- rte->t = tp;
-#endif
-
- /* Add this entry to the end of the queue */
- rte_m->m_act = mb_ntry;
-
- splx(s);
-
- return 0;
- }
-}
-
-#ifndef MROUTE_LKM
-int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *,
- struct ip_moptions *) = X_ip_mforward;
-#endif
-
-/*
- * Clean up the cache entry if upcall is not serviced
- */
-static void
-expire_upcalls(void *unused)
-{
- struct mbuf *mb_rt, *m, **nptr;
- struct rtdetq *rte;
- struct mfc *mfc;
- int i;
- int s;
-
- s = splnet();
- for (i = 0; i < MFCTBLSIZ; i++) {
- if (nexpire[i] == 0)
- continue;
- nptr = &mfctable[i];
- for (mb_rt = *nptr; mb_rt != NULL; mb_rt = *nptr) {
- mfc = mtod(mb_rt, struct mfc *);
-
- /*
- * Skip real cache entries
- * Make sure it wasn't marked to not expire (shouldn't happen)
- * If it expires now
- */
- if (mb_rt->m_act != NULL &&
- mfc->mfc_expire != 0 &&
- --mfc->mfc_expire == 0) {
- if (mrtdebug & DEBUG_EXPIRE)
- log(LOG_DEBUG, "expire_upcalls: expiring (%x %x)\n",
- ntohl(mfc->mfc_origin.s_addr),
- ntohl(mfc->mfc_mcastgrp.s_addr));
- /*
- * drop all the packets
- * free the mbuf with the pkt, if, timing info
- */
- while (mb_rt->m_act) {
- m = mb_rt->m_act;
- mb_rt->m_act = m->m_act;
-
- rte = mtod(m, struct rtdetq *);
- m_freem(rte->m);
- m_free(m);
- }
- ++mrtstat.mrts_cache_cleanups;
- nexpire[i]--;
-
- MFREE(mb_rt, *nptr);
- } else {
- nptr = &mb_rt->m_next;
- }
- }
- }
- splx(s);
- timeout(expire_upcalls, (caddr_t)NULL, EXPIRE_TIMEOUT);
-}
-
-/*
- * Packet forwarding routine once entry in the cache is made
- */
-static int
-ip_mdq(m, ifp, rt, xmt_vif)
- register struct mbuf *m;
- register struct ifnet *ifp;
- register struct mfc *rt;
- register vifi_t xmt_vif;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register vifi_t vifi;
- register struct vif *vifp;
- register int plen = ntohs(ip->ip_len);
-
-/*
- * Macro to send packet on vif. Since RSVP packets don't get counted on
- * input, they shouldn't get counted on output, so statistics keeping is
- * seperate.
- */
-#define MC_SEND(ip,vifp,m) { \
- if ((vifp)->v_flags & VIFF_TUNNEL) \
- encap_send((ip), (vifp), (m)); \
- else \
- phyint_send((ip), (vifp), (m)); \
-}
-
- /*
- * If xmt_vif is not -1, send on only the requested vif.
- *
- * (since vifi_t is u_short, -1 becomes MAXUSHORT, which > numvifs.)
- */
- if (xmt_vif < numvifs) {
- MC_SEND(ip, viftable + xmt_vif, m);
- return 1;
- }
-
- /*
- * Don't forward if it didn't arrive from the parent vif for its origin.
- */
- vifi = rt->mfc_parent;
- if ((vifi >= numvifs) || (viftable[vifi].v_ifp != ifp)) {
- /* came in the wrong interface */
- if (mrtdebug & DEBUG_FORWARD)
- log(LOG_DEBUG, "wrong if: ifp %x vifi %d vififp %x\n",
- ifp, vifi, viftable[vifi].v_ifp);
- ++mrtstat.mrts_wrong_if;
- ++rt->mfc_wrong_if;
- /*
- * If we are doing PIM assert processing, and we are forwarding
- * packets on this interface, and it is a broadcast medium
- * interface (and not a tunnel), send a message to the routing daemon.
- */
- if (pim_assert && rt->mfc_ttls[vifi] &&
- (ifp->if_flags & IFF_BROADCAST) &&
- !(viftable[vifi].v_flags & VIFF_TUNNEL)) {
- struct sockaddr_in k_igmpsrc;
- struct mbuf *mm;
- struct igmpmsg *im;
- int hlen = ip->ip_hl << 2;
- struct timeval now;
- register u_long delta;
-
- GET_TIME(now);
-
- TV_DELTA(rt->mfc_last_assert, now, delta);
-
- if (delta > ASSERT_MSG_TIME) {
- mm = m_copy(m, 0, hlen);
- if (mm && (M_HASCL(mm) || mm->m_len < hlen))
- mm = m_pullup(mm, hlen);
- if (mm == NULL) {
- return ENOBUFS;
- }
-
- rt->mfc_last_assert = now;
-
- im = mtod(mm, struct igmpmsg *);
- im->im_msgtype = IGMPMSG_WRONGVIF;
- im->im_mbz = 0;
- im->im_vif = vifi;
-
- k_igmpsrc.sin_addr = im->im_src;
-
- socket_send(ip_mrouter, mm, &k_igmpsrc);
- }
- }
- return 0;
- }
-
- /* If I sourced this packet, it counts as output, else it was input. */
- if (ip->ip_src.s_addr == viftable[vifi].v_lcl_addr.s_addr) {
- viftable[vifi].v_pkt_out++;
- viftable[vifi].v_bytes_out += plen;
- } else {
- viftable[vifi].v_pkt_in++;
- viftable[vifi].v_bytes_in += plen;
- }
- rt->mfc_pkt_cnt++;
- rt->mfc_byte_cnt += plen;
-
- /*
- * For each vif, decide if a copy of the packet should be forwarded.
- * Forward if:
- * - the ttl exceeds the vif's threshold
- * - there are group members downstream on interface
- */
- for (vifp = viftable, vifi = 0; vifi < numvifs; vifp++, vifi++)
- if ((rt->mfc_ttls[vifi] > 0) &&
- (ip->ip_ttl > rt->mfc_ttls[vifi])) {
- vifp->v_pkt_out++;
- vifp->v_bytes_out += plen;
- MC_SEND(ip, vifp, m);
- }
-
- return 0;
-}
-
-/*
- * check if a vif number is legal/ok. This is used by ip_output, to export
- * numvifs there,
- */
-static int
-X_legal_vif_num(vif)
- int vif;
-{
- if (vif >= 0 && vif < numvifs)
- return(1);
- else
- return(0);
-}
-
-#ifndef MROUTE_LKM
-int (*legal_vif_num)(int) = X_legal_vif_num;
-#endif
-
-/*
- * Return the local address used by this vif
- */
-static u_long
-X_ip_mcast_src(vifi)
- int vifi;
-{
- if (vifi >= 0 && vifi < numvifs)
- return viftable[vifi].v_lcl_addr.s_addr;
- else
- return INADDR_ANY;
-}
-
-#ifndef MROUTE_LKM
-u_long (*ip_mcast_src)(int) = X_ip_mcast_src;
-#endif
-
-static void
-phyint_send(ip, vifp, m)
- struct ip *ip;
- struct vif *vifp;
- struct mbuf *m;
-{
- register struct mbuf *mb_copy;
- register int hlen = ip->ip_hl << 2;
-
- /*
- * Make a new reference to the packet; make sure that
- * the IP header is actually copied, not just referenced,
- * so that ip_output() only scribbles on the copy.
- */
- mb_copy = m_copy(m, 0, M_COPYALL);
- if (mb_copy && (M_HASCL(mb_copy) || mb_copy->m_len < hlen))
- mb_copy = m_pullup(mb_copy, hlen);
- if (mb_copy == NULL)
- return;
-
- if (vifp->v_rate_limit <= 0)
- tbf_send_packet(vifp, mb_copy);
- else
- tbf_control(vifp, mb_copy, mtod(mb_copy, struct ip *), ip->ip_len);
-}
-
-static void
-encap_send(ip, vifp, m)
- register struct ip *ip;
- register struct vif *vifp;
- register struct mbuf *m;
-{
- register struct mbuf *mb_copy;
- register struct ip *ip_copy;
- register int i, len = ip->ip_len;
-
- /*
- * copy the old packet & pullup it's IP header into the
- * new mbuf so we can modify it. Try to fill the new
- * mbuf since if we don't the ethernet driver will.
- */
- MGETHDR(mb_copy, M_DONTWAIT, MT_HEADER);
- if (mb_copy == NULL)
- return;
- mb_copy->m_data += max_linkhdr;
- mb_copy->m_len = sizeof(multicast_encap_iphdr);
-
- if ((mb_copy->m_next = m_copy(m, 0, M_COPYALL)) == NULL) {
- m_freem(mb_copy);
- return;
- }
- i = MHLEN - M_LEADINGSPACE(mb_copy);
- if (i > len)
- i = len;
- mb_copy = m_pullup(mb_copy, i);
- if (mb_copy == NULL)
- return;
- mb_copy->m_pkthdr.len = len + sizeof(multicast_encap_iphdr);
-
- /*
- * fill in the encapsulating IP header.
- */
- ip_copy = mtod(mb_copy, struct ip *);
- *ip_copy = multicast_encap_iphdr;
- ip_copy->ip_id = htons(ip_id++);
- ip_copy->ip_len += len;
- ip_copy->ip_src = vifp->v_lcl_addr;
- ip_copy->ip_dst = vifp->v_rmt_addr;
-
- /*
- * turn the encapsulated IP header back into a valid one.
- */
- ip = (struct ip *)((caddr_t)ip_copy + sizeof(multicast_encap_iphdr));
- --ip->ip_ttl;
- HTONS(ip->ip_len);
- HTONS(ip->ip_off);
- ip->ip_sum = 0;
- mb_copy->m_data += sizeof(multicast_encap_iphdr);
- ip->ip_sum = in_cksum(mb_copy, ip->ip_hl << 2);
- mb_copy->m_data -= sizeof(multicast_encap_iphdr);
-
- if (vifp->v_rate_limit <= 0)
- tbf_send_packet(vifp, mb_copy);
- else
- tbf_control(vifp, mb_copy, ip, ip_copy->ip_len);
-}
-
-/*
- * De-encapsulate a packet and feed it back through ip input (this
- * routine is called whenever IP gets a packet with proto type
- * ENCAP_PROTO and a local destination address).
- */
-void
-#ifdef MROUTE_LKM
-X_ipip_input(m, iphlen)
-#else
-ipip_input(m, iphlen)
-#endif
- register struct mbuf *m;
- int iphlen;
-{
- struct ifnet *ifp = m->m_pkthdr.rcvif;
- register struct ip *ip = mtod(m, struct ip *);
- register int hlen = ip->ip_hl << 2;
- register int s;
- register struct ifqueue *ifq;
- register struct vif *vifp;
-
- if (!have_encap_tunnel) {
- rip_input(m, iphlen);
- return;
- }
- /*
- * dump the packet if it's not to a multicast destination or if
- * we don't have an encapsulating tunnel with the source.
- * Note: This code assumes that the remote site IP address
- * uniquely identifies the tunnel (i.e., that this site has
- * at most one tunnel with the remote site).
- */
- if (! IN_MULTICAST(ntohl(((struct ip *)((char *)ip + hlen))->ip_dst.s_addr))) {
- ++mrtstat.mrts_bad_tunnel;
- m_freem(m);
- return;
- }
- if (ip->ip_src.s_addr != last_encap_src) {
- register struct vif *vife;
-
- vifp = viftable;
- vife = vifp + numvifs;
- last_encap_src = ip->ip_src.s_addr;
- last_encap_vif = 0;
- for ( ; vifp < vife; ++vifp)
- if (vifp->v_rmt_addr.s_addr == ip->ip_src.s_addr) {
- if ((vifp->v_flags & (VIFF_TUNNEL|VIFF_SRCRT))
- == VIFF_TUNNEL)
- last_encap_vif = vifp;
- break;
- }
- }
- if ((vifp = last_encap_vif) == 0) {
- last_encap_src = 0;
- mrtstat.mrts_cant_tunnel++; /*XXX*/
- m_freem(m);
- if (mrtdebug)
- log(LOG_DEBUG, "ip_mforward: no tunnel with %x\n",
- ntohl(ip->ip_src.s_addr));
- return;
- }
- ifp = vifp->v_ifp;
-
- if (hlen > IP_HDR_LEN)
- ip_stripoptions(m, (struct mbuf *) 0);
- m->m_data += IP_HDR_LEN;
- m->m_len -= IP_HDR_LEN;
- m->m_pkthdr.len -= IP_HDR_LEN;
- m->m_pkthdr.rcvif = ifp;
-
- ifq = &ipintrq;
- s = splimp();
- if (IF_QFULL(ifq)) {
- IF_DROP(ifq);
- m_freem(m);
- } else {
- IF_ENQUEUE(ifq, m);
- /*
- * normally we would need a "schednetisr(NETISR_IP)"
- * here but we were called by ip_input and it is going
- * to loop back & try to dequeue the packet we just
- * queued as soon as we return so we avoid the
- * unnecessary software interrrupt.
- */
- }
- splx(s);
-}
-
-/*
- * Token bucket filter module
- */
-
-static void
-tbf_control(vifp, m, ip, p_len)
- register struct vif *vifp;
- register struct mbuf *m;
- register struct ip *ip;
- register u_long p_len;
-{
- register struct tbf *t = vifp->v_tbf;
-
- if (p_len > MAX_BKT_SIZE) {
- /* drop if packet is too large */
- mrtstat.mrts_pkt2large++;
- m_freem(m);
- return;
- }
-
- tbf_update_tokens(vifp);
-
- /* if there are enough tokens,
- * and the queue is empty,
- * send this packet out
- */
-
- if (t->tbf_q_len == 0) {
- /* queue empty, send packet if enough tokens */
- if (p_len <= t->tbf_n_tok) {
- t->tbf_n_tok -= p_len;
- tbf_send_packet(vifp, m);
- } else {
- /* queue packet and timeout till later */
- tbf_queue(vifp, m);
- timeout(tbf_reprocess_q, (caddr_t)vifp, TBF_REPROCESS);
- }
- } else if (t->tbf_q_len < t->tbf_max_q_len) {
- /* finite queue length, so queue pkts and process queue */
- tbf_queue(vifp, m);
- tbf_process_q(vifp);
- } else {
- /* queue length too much, try to dq and queue and process */
- if (!tbf_dq_sel(vifp, ip)) {
- mrtstat.mrts_q_overflow++;
- m_freem(m);
- return;
- } else {
- tbf_queue(vifp, m);
- tbf_process_q(vifp);
- }
- }
- return;
-}
-
-/*
- * adds a packet to the queue at the interface
- */
-static void
-tbf_queue(vifp, m)
- register struct vif *vifp;
- register struct mbuf *m;
-{
- register int s = splnet();
- register struct tbf *t = vifp->v_tbf;
-
- if (t->tbf_t == NULL) {
- /* Queue was empty */
- t->tbf_q = m;
- } else {
- /* Insert at tail */
- t->tbf_t->m_act = m;
- }
-
- /* Set new tail pointer */
- t->tbf_t = m;
-
-#ifdef DIAGNOSTIC
- /* Make sure we didn't get fed a bogus mbuf */
- if (m->m_act)
- panic("tbf_queue: m_act");
-#endif
- m->m_act = NULL;
-
- t->tbf_q_len++;
-
- splx(s);
-}
-
-
-/*
- * processes the queue at the interface
- */
-static void
-tbf_process_q(vifp)
- register struct vif *vifp;
-{
- register struct mbuf *m;
- register int len;
- register int s = splnet();
- register struct tbf *t = vifp->v_tbf;
-
- /* loop through the queue at the interface and send as many packets
- * as possible
- */
- while (t->tbf_q_len > 0) {
- m = t->tbf_q;
-
- len = mtod(m, struct ip *)->ip_len;
-
- /* determine if the packet can be sent */
- if (len <= t->tbf_n_tok) {
- /* if so,
- * reduce no of tokens, dequeue the packet,
- * send the packet.
- */
- t->tbf_n_tok -= len;
-
- t->tbf_q = m->m_act;
- if (--t->tbf_q_len == 0)
- t->tbf_t = NULL;
-
- m->m_act = NULL;
- tbf_send_packet(vifp, m);
-
- } else break;
- }
- splx(s);
-}
-
-static void
-tbf_reprocess_q(xvifp)
- void *xvifp;
-{
- register struct vif *vifp = xvifp;
- if (ip_mrouter == NULL)
- return;
-
- tbf_update_tokens(vifp);
-
- tbf_process_q(vifp);
-
- if (vifp->v_tbf->tbf_q_len)
- timeout(tbf_reprocess_q, (caddr_t)vifp, TBF_REPROCESS);
-}
-
-/* function that will selectively discard a member of the queue
- * based on the precedence value and the priority
- */
-static int
-tbf_dq_sel(vifp, ip)
- register struct vif *vifp;
- register struct ip *ip;
-{
- register int s = splnet();
- register u_int p;
- register struct mbuf *m, *last;
- register struct mbuf **np;
- register struct tbf *t = vifp->v_tbf;
-
- p = priority(vifp, ip);
-
- np = &t->tbf_q;
- last = NULL;
- while ((m = *np) != NULL) {
- if (p > priority(vifp, mtod(m, struct ip *))) {
- *np = m->m_act;
- /* If we're removing the last packet, fix the tail pointer */
- if (m == t->tbf_t)
- t->tbf_t = last;
- m_freem(m);
- /* it's impossible for the queue to be empty, but
- * we check anyway. */
- if (--t->tbf_q_len == 0)
- t->tbf_t = NULL;
- splx(s);
- mrtstat.mrts_drop_sel++;
- return(1);
- }
- np = &m->m_act;
- last = m;
- }
- splx(s);
- return(0);
-}
-
-static void
-tbf_send_packet(vifp, m)
- register struct vif *vifp;
- register struct mbuf *m;
-{
- struct ip_moptions imo;
- int error;
- static struct route ro;
- int s = splnet();
-
- if (vifp->v_flags & VIFF_TUNNEL) {
- /* If tunnel options */
- ip_output(m, (struct mbuf *)0, &vifp->v_route,
- IP_FORWARDING, (struct ip_moptions *)0);
- } else {
- imo.imo_multicast_ifp = vifp->v_ifp;
- imo.imo_multicast_ttl = mtod(m, struct ip *)->ip_ttl - 1;
- imo.imo_multicast_loop = 1;
- imo.imo_multicast_vif = -1;
-
- /*
- * Re-entrancy should not be a problem here, because
- * the packets that we send out and are looped back at us
- * should get rejected because they appear to come from
- * the loopback interface, thus preventing looping.
- */
- error = ip_output(m, (struct mbuf *)0, &ro,
- IP_FORWARDING, &imo);
-
- if (mrtdebug & DEBUG_XMIT)
- log(LOG_DEBUG, "phyint_send on vif %d err %d\n",
- vifp - viftable, error);
- }
- splx(s);
-}
-
-/* determine the current time and then
- * the elapsed time (between the last time and time now)
- * in milliseconds & update the no. of tokens in the bucket
- */
-static void
-tbf_update_tokens(vifp)
- register struct vif *vifp;
-{
- struct timeval tp;
- register u_long tm;
- register int s = splnet();
- register struct tbf *t = vifp->v_tbf;
-
- GET_TIME(tp);
-
- TV_DELTA(tp, t->tbf_last_pkt_t, tm);
-
- /*
- * This formula is actually
- * "time in seconds" * "bytes/second".
- *
- * (tm / 1000000) * (v_rate_limit * 1000 * (1000/1024) / 8)
- *
- * The (1000/1024) was introduced in add_vif to optimize
- * this divide into a shift.
- */
- t->tbf_n_tok += tm * vifp->v_rate_limit / 1024 / 8;
- t->tbf_last_pkt_t = tp;
-
- if (t->tbf_n_tok > MAX_BKT_SIZE)
- t->tbf_n_tok = MAX_BKT_SIZE;
-
- splx(s);
-}
-
-static int
-priority(vifp, ip)
- register struct vif *vifp;
- register struct ip *ip;
-{
- register int prio;
-
- /* temporary hack; may add general packet classifier some day */
-
- /*
- * The UDP port space is divided up into four priority ranges:
- * [0, 16384) : unclassified - lowest priority
- * [16384, 32768) : audio - highest priority
- * [32768, 49152) : whiteboard - medium priority
- * [49152, 65536) : video - low priority
- */
- if (ip->ip_p == IPPROTO_UDP) {
- struct udphdr *udp = (struct udphdr *)(((char *)ip) + (ip->ip_hl << 2));
- switch (ntohs(udp->uh_dport) & 0xc000) {
- case 0x4000:
- prio = 70;
- break;
- case 0x8000:
- prio = 60;
- break;
- case 0xc000:
- prio = 55;
- break;
- default:
- prio = 50;
- break;
- }
- if (tbfdebug > 1)
- log(LOG_DEBUG, "port %x prio%d\n", ntohs(udp->uh_dport), prio);
- } else {
- prio = 50;
- }
- return prio;
-}
-
-/*
- * End of token bucket filter modifications
- */
-
-int
-ip_rsvp_vif_init(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- int i;
- register int s;
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_init: so_type = %d, pr_protocol = %d\n",
- so->so_type, so->so_proto->pr_protocol);
-
- if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP)
- return EOPNOTSUPP;
-
- /* Check mbuf. */
- if (m == NULL || m->m_len != sizeof(int)) {
- return EINVAL;
- }
- i = *(mtod(m, int *));
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_init: vif = %d rsvp_on = %d\n",i,rsvp_on);
-
- s = splnet();
-
- /* Check vif. */
- if (!legal_vif_num(i)) {
- splx(s);
- return EADDRNOTAVAIL;
- }
-
- /* Check if socket is available. */
- if (viftable[i].v_rsvpd != NULL) {
- splx(s);
- return EADDRINUSE;
- }
-
- viftable[i].v_rsvpd = so;
- /* This may seem silly, but we need to be sure we don't over-increment
- * the RSVP counter, in case something slips up.
- */
- if (!viftable[i].v_rsvp_on) {
- viftable[i].v_rsvp_on = 1;
- rsvp_on++;
- }
-
- splx(s);
- return 0;
-}
-
-int
-ip_rsvp_vif_done(so, m)
- struct socket *so;
- struct mbuf *m;
-{
- int i;
- register int s;
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_done: so_type = %d, pr_protocol = %d\n",
- so->so_type, so->so_proto->pr_protocol);
-
- if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP)
- return EOPNOTSUPP;
-
- /* Check mbuf. */
- if (m == NULL || m->m_len != sizeof(int)) {
- return EINVAL;
- }
- i = *(mtod(m, int *));
-
- s = splnet();
-
- /* Check vif. */
- if (!legal_vif_num(i)) {
- splx(s);
- return EADDRNOTAVAIL;
- }
-
- if (rsvpdebug)
- printf("ip_rsvp_vif_done: v_rsvpd = %p so = %p\n",
- viftable[i].v_rsvpd, so);
-
- viftable[i].v_rsvpd = NULL;
- /* This may seem silly, but we need to be sure we don't over-decrement
- * the RSVP counter, in case something slips up.
- */
- if (viftable[i].v_rsvp_on) {
- viftable[i].v_rsvp_on = 0;
- rsvp_on--;
- }
-
- splx(s);
- return 0;
-}
-
-void
-ip_rsvp_force_done(so)
- struct socket *so;
-{
- int vifi;
- register int s;
-
- /* Don't bother if it is not the right type of socket. */
- if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP)
- return;
-
- s = splnet();
-
- /* The socket may be attached to more than one vif...this
- * is perfectly legal.
- */
- for (vifi = 0; vifi < numvifs; vifi++) {
- if (viftable[vifi].v_rsvpd == so) {
- viftable[vifi].v_rsvpd = NULL;
- /* This may seem silly, but we need to be sure we don't
- * over-decrement the RSVP counter, in case something slips up.
- */
- if (viftable[vifi].v_rsvp_on) {
- viftable[vifi].v_rsvp_on = 0;
- rsvp_on--;
- }
- }
- }
-
- splx(s);
- return;
-}
-
-void
-rsvp_input(m, iphlen)
- struct mbuf *m;
- int iphlen;
-{
- int vifi;
- register struct ip *ip = mtod(m, struct ip *);
- static struct sockaddr_in rsvp_src = { sizeof rsvp_src, AF_INET };
- register int s;
- struct ifnet *ifp;
-
- if (rsvpdebug)
- printf("rsvp_input: rsvp_on %d\n",rsvp_on);
-
- /* Can still get packets with rsvp_on = 0 if there is a local member
- * of the group to which the RSVP packet is addressed. But in this
- * case we want to throw the packet away.
- */
- if (!rsvp_on) {
- m_freem(m);
- return;
- }
-
- /* If the old-style non-vif-associated socket is set, then use
- * it and ignore the new ones.
- */
- if (ip_rsvpd != NULL) {
- if (rsvpdebug)
- printf("rsvp_input: Sending packet up old-style socket\n");
- rip_input(m, iphlen);
- return;
- }
-
- s = splnet();
-
- if (rsvpdebug)
- printf("rsvp_input: check vifs\n");
-
-#ifdef DIAGNOSTIC
- if (!(m->m_flags & M_PKTHDR))
- panic("rsvp_input no hdr");
-#endif
-
- ifp = m->m_pkthdr.rcvif;
- /* Find which vif the packet arrived on. */
- for (vifi = 0; vifi < numvifs; vifi++) {
- if (viftable[vifi].v_ifp == ifp)
- break;
- }
-
- if (vifi == numvifs) {
- /* Can't find vif packet arrived on. Drop packet. */
- if (rsvpdebug)
- printf("rsvp_input: Can't find vif for packet...dropping it.\n");
- m_freem(m);
- splx(s);
- return;
- }
-
- if (rsvpdebug)
- printf("rsvp_input: check socket\n");
-
- if (viftable[vifi].v_rsvpd == NULL) {
- /* drop packet, since there is no specific socket for this
- * interface */
- if (rsvpdebug)
- printf("rsvp_input: No socket defined for vif %d\n",vifi);
- m_freem(m);
- splx(s);
- return;
- }
- rsvp_src.sin_addr = ip->ip_src;
-
- if (rsvpdebug && m)
- printf("rsvp_input: m->m_len = %d, sbspace() = %ld\n",
- m->m_len,sbspace(&(viftable[vifi].v_rsvpd->so_rcv)));
-
- if (socket_send(viftable[vifi].v_rsvpd, m, &rsvp_src) < 0)
- if (rsvpdebug)
- printf("rsvp_input: Failed to append to socket\n");
- else
- if (rsvpdebug)
- printf("rsvp_input: send packet up\n");
-
- splx(s);
-}
-
-#ifdef MROUTE_LKM
-#include <sys/conf.h>
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-MOD_MISC("ip_mroute_mod")
-
-static int
-ip_mroute_mod_handle(struct lkm_table *lkmtp, int cmd)
-{
- int i;
- struct lkm_misc *args = lkmtp->private.lkm_misc;
- int err = 0;
-
- switch(cmd) {
- static int (*old_ip_mrouter_cmd)();
- static int (*old_ip_mrouter_done)();
- static int (*old_ip_mforward)();
- static int (*old_mrt_ioctl)();
- static void (*old_proto4_input)();
- static int (*old_legal_vif_num)();
- extern struct protosw inetsw[];
-
- case LKM_E_LOAD:
- if(lkmexists(lkmtp) || ip_mrtproto)
- return(EEXIST);
- old_ip_mrouter_cmd = ip_mrouter_cmd;
- ip_mrouter_cmd = X_ip_mrouter_cmd;
- old_ip_mrouter_done = ip_mrouter_done;
- ip_mrouter_done = X_ip_mrouter_done;
- old_ip_mforward = ip_mforward;
- ip_mforward = X_ip_mforward;
- old_mrt_ioctl = mrt_ioctl;
- mrt_ioctl = X_mrt_ioctl;
- old_proto4_input = inetsw[ip_protox[ENCAP_PROTO]].pr_input;
- inetsw[ip_protox[ENCAP_PROTO]].pr_input = X_ipip_input;
- old_legal_vif_num = legal_vif_num;
- legal_vif_num = X_legal_vif_num;
- ip_mrtproto = IGMP_DVMRP;
-
- printf("\nIP multicast routing loaded\n");
- break;
-
- case LKM_E_UNLOAD:
- if (ip_mrouter)
- return EINVAL;
-
- ip_mrouter_cmd = old_ip_mrouter_cmd;
- ip_mrouter_done = old_ip_mrouter_done;
- ip_mforward = old_ip_mforward;
- mrt_ioctl = old_mrt_ioctl;
- inetsw[ip_protox[ENCAP_PROTO]].pr_input = old_proto4_input;
- legal_vif_num = old_legal_vif_num;
- ip_mrtproto = 0;
- break;
-
- default:
- err = EINVAL;
- break;
- }
-
- return(err);
-}
-
-int
-ip_mroute_mod(struct lkm_table *lkmtp, int cmd, int ver) {
- DISPATCH(lkmtp, cmd, ver, ip_mroute_mod_handle, ip_mroute_mod_handle,
- nosys);
-}
-
-#endif /* MROUTE_LKM */
-#endif /* MROUTING */
diff --git a/cpukit/libnetworking/netinet/ip_mroute.h b/cpukit/libnetworking/netinet/ip_mroute.h
deleted file mode 100644
index 5ddd6799d2..0000000000
--- a/cpukit/libnetworking/netinet/ip_mroute.h
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright (c) 1989 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * 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.
- *
- * @(#)ip_mroute.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_IP_MROUTE_H_
-#define _NETINET_IP_MROUTE_H_
-
-/*
- * Definitions for IP multicast forwarding.
- *
- * Written by David Waitzman, BBN Labs, August 1988.
- * Modified by Steve Deering, Stanford, February 1989.
- * Modified by Ajit Thyagarajan, PARC, August 1993.
- * Modified by Ajit Thyagarajan, PARC, August 1994.
- *
- * MROUTING Revision: 3.3.1.3
- */
-
-
-/*
- * Multicast Routing set/getsockopt commands.
- */
-#define MRT_INIT 100 /* initialize forwarder */
-#define MRT_DONE 101 /* shut down forwarder */
-#define MRT_ADD_VIF 102 /* create virtual interface */
-#define MRT_DEL_VIF 103 /* delete virtual interface */
-#define MRT_ADD_MFC 104 /* insert forwarding cache entry */
-#define MRT_DEL_MFC 105 /* delete forwarding cache entry */
-#define MRT_VERSION 106 /* get kernel version number */
-#define MRT_ASSERT 107 /* enable PIM assert processing */
-
-
-#define GET_TIME(t) microtime(&t)
-
-/*
- * Types and macros for handling bitmaps with one bit per virtual interface.
- */
-#define MAXVIFS 32
-typedef u_long vifbitmap_t;
-typedef u_short vifi_t; /* type of a vif index */
-#define ALL_VIFS (vifi_t)-1
-
-#define VIFM_SET(n, m) ((m) |= (1 << (n)))
-#define VIFM_CLR(n, m) ((m) &= ~(1 << (n)))
-#define VIFM_ISSET(n, m) ((m) & (1 << (n)))
-#define VIFM_CLRALL(m) ((m) = 0x00000000)
-#define VIFM_COPY(mfrom, mto) ((mto) = (mfrom))
-#define VIFM_SAME(m1, m2) ((m1) == (m2))
-
-
-/*
- * Argument structure for MRT_ADD_VIF.
- * (MRT_DEL_VIF takes a single vifi_t argument.)
- */
-struct vifctl {
- vifi_t vifc_vifi; /* the index of the vif to be added */
- u_char vifc_flags; /* VIFF_ flags defined below */
- u_char vifc_threshold; /* min ttl required to forward on vif */
- u_int vifc_rate_limit; /* max rate */
- struct in_addr vifc_lcl_addr; /* local interface address */
- struct in_addr vifc_rmt_addr; /* remote address (tunnels only) */
-};
-
-#define VIFF_TUNNEL 0x1 /* vif represents a tunnel end-point */
-#define VIFF_SRCRT 0x2 /* tunnel uses IP source routing */
-
-/*
- * Argument structure for MRT_ADD_MFC and MRT_DEL_MFC
- * (mfcc_tos to be added at a future point)
- */
-struct mfcctl {
- struct in_addr mfcc_origin; /* ip origin of mcasts */
- struct in_addr mfcc_mcastgrp; /* multicast group associated*/
- vifi_t mfcc_parent; /* incoming vif */
- u_char mfcc_ttls[MAXVIFS]; /* forwarding ttls on vifs */
-};
-
-/*
- * The kernel's multicast routing statistics.
- */
-struct mrtstat {
- u_long mrts_mfc_lookups; /* # forw. cache hash table hits */
- u_long mrts_mfc_misses; /* # forw. cache hash table misses */
- u_long mrts_upcalls; /* # calls to mrouted */
- u_long mrts_no_route; /* no route for packet's origin */
- u_long mrts_bad_tunnel; /* malformed tunnel options */
- u_long mrts_cant_tunnel; /* no room for tunnel options */
- u_long mrts_wrong_if; /* arrived on wrong interface */
- u_long mrts_upq_ovflw; /* upcall Q overflow */
- u_long mrts_cache_cleanups; /* # entries with no upcalls */
- u_long mrts_drop_sel; /* pkts dropped selectively */
- u_long mrts_q_overflow; /* pkts dropped - Q overflow */
- u_long mrts_pkt2large; /* pkts dropped - size > BKT SIZE */
- u_long mrts_upq_sockfull; /* upcalls dropped - socket full */
-};
-
-/*
- * Argument structure used by mrouted to get src-grp pkt counts
- */
-struct sioc_sg_req {
- struct in_addr src;
- struct in_addr grp;
- u_long pktcnt;
- u_long bytecnt;
- u_long wrong_if;
-};
-
-/*
- * Argument structure used by mrouted to get vif pkt counts
- */
-struct sioc_vif_req {
- vifi_t vifi; /* vif number */
- u_long icount; /* Input packet count on vif */
- u_long ocount; /* Output packet count on vif */
- u_long ibytes; /* Input byte count on vif */
- u_long obytes; /* Output byte count on vif */
-};
-
-
-/*
- * The kernel's virtual-interface structure.
- */
-struct vif {
- u_char v_flags; /* VIFF_ flags defined above */
- u_char v_threshold; /* min ttl required to forward on vif*/
- u_int v_rate_limit; /* max rate */
- struct tbf *v_tbf; /* token bucket structure at intf. */
- struct in_addr v_lcl_addr; /* local interface address */
- struct in_addr v_rmt_addr; /* remote address (tunnels only) */
- struct ifnet *v_ifp; /* pointer to interface */
- u_long v_pkt_in; /* # pkts in on interface */
- u_long v_pkt_out; /* # pkts out on interface */
- u_long v_bytes_in; /* # bytes in on interface */
- u_long v_bytes_out; /* # bytes out on interface */
- struct route v_route; /* cached route if this is a tunnel */
- u_int v_rsvp_on; /* RSVP listening on this vif */
- struct socket *v_rsvpd; /* RSVP daemon socket */
-};
-
-/*
- * The kernel's multicast forwarding cache entry structure
- * (A field for the type of service (mfc_tos) is to be added
- * at a future point)
- */
-struct mfc {
- struct in_addr mfc_origin; /* IP origin of mcasts */
- struct in_addr mfc_mcastgrp; /* multicast group associated*/
- vifi_t mfc_parent; /* incoming vif */
- u_char mfc_ttls[MAXVIFS]; /* forwarding ttls on vifs */
- u_long mfc_pkt_cnt; /* pkt count for src-grp */
- u_long mfc_byte_cnt; /* byte count for src-grp */
- u_long mfc_wrong_if; /* wrong if for src-grp */
- int mfc_expire; /* time to clean entry up */
- struct timeval mfc_last_assert; /* last time I sent an assert*/
-};
-
-/*
- * Struct used to communicate from kernel to multicast router
- * note the convenient similarity to an IP packet
- */
-struct igmpmsg {
- u_long unused1;
- u_long unused2;
- u_char im_msgtype; /* what type of message */
-#define IGMPMSG_NOCACHE 1
-#define IGMPMSG_WRONGVIF 2
- u_char im_mbz; /* must be zero */
- u_char im_vif; /* vif rec'd on */
- u_char unused3;
- struct in_addr im_src, im_dst;
-};
-
-/*
- * Argument structure used for pkt info. while upcall is made
- */
-struct rtdetq {
- struct mbuf *m; /* A copy of the packet */
- struct ifnet *ifp; /* Interface pkt came in on */
- vifi_t xmt_vif; /* Saved copy of imo_multicast_vif */
-#ifdef UPCALL_TIMING
- struct timeval t; /* Timestamp */
-#endif /* UPCALL_TIMING */
-};
-
-#define MFCTBLSIZ 256
-#if (MFCTBLSIZ & (MFCTBLSIZ - 1)) == 0 /* from sys:route.h */
-#define MFCHASHMOD(h) ((h) & (MFCTBLSIZ - 1))
-#else
-#define MFCHASHMOD(h) ((h) % MFCTBLSIZ)
-#endif
-
-#define MAX_UPQ 4 /* max. no of pkts in upcall Q */
-
-/*
- * Token Bucket filter code
- */
-#define MAX_BKT_SIZE 10000 /* 10K bytes size */
-#define MAXQSIZE 10 /* max # of pkts in queue */
-
-/*
- * the token bucket filter at each vif
- */
-struct tbf
-{
- struct timeval tbf_last_pkt_t; /* arr. time of last pkt */
- u_long tbf_n_tok; /* no of tokens in bucket */
- u_long tbf_q_len; /* length of queue at this vif */
- u_long tbf_max_q_len; /* max. queue length */
- struct mbuf *tbf_q; /* Packet queue */
- struct mbuf *tbf_t; /* tail-insertion pointer */
-};
-
-#ifdef KERNEL
-
-extern int (*ip_mrouter_set) __P((int, struct socket *, struct mbuf *));
-extern int (*ip_mrouter_get) __P((int, struct socket *, struct mbuf **));
-extern int (*ip_mrouter_done) __P((void));
-#ifdef MROUTING
-extern int (*mrt_ioctl) __P((int, caddr_t));
-#else
-extern int (*mrt_ioctl) __P((int, caddr_t, struct proc *));
-#endif
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_IP_MROUTE_H_ */
diff --git a/cpukit/libnetworking/netinet/ip_output.c b/cpukit/libnetworking/netinet/ip_output.c
deleted file mode 100644
index 810f6c7479..0000000000
--- a/cpukit/libnetworking/netinet/ip_output.c
+++ /dev/null
@@ -1,1307 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 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.
- *
- * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
- * $Id$
- */
-
-#define _IP_VHL
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/errno.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-
-#ifdef vax
-#include <machine/mtpr.h>
-#endif
-#include <machine/in_cksum.h>
-
-#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1
-#undef COMPAT_IPFW
-#define COMPAT_IPFW 1
-#else
-#undef COMPAT_IPFW
-#endif
-
-u_short ip_id;
-
-static struct mbuf *ip_insertoptions __P((struct mbuf *, struct mbuf *, int *));
-static void ip_mloopback
- __P((struct ifnet *, struct mbuf *, struct sockaddr_in *, int));
-static int ip_getmoptions
- __P((int, struct ip_moptions *, struct mbuf **));
-static int ip_optcopy __P((struct ip *, struct ip *));
-static int ip_pcbopts __P((struct mbuf **, struct mbuf *));
-static int ip_setmoptions
- __P((int, struct ip_moptions **, struct mbuf *));
-
-extern struct protosw inetsw[];
-
-/*
- * IP output. The packet in mbuf chain m contains a skeletal IP
- * header (with len, off, ttl, proto, tos, src, dst).
- * The mbuf chain containing the packet will be freed.
- * The mbuf opt, if present, will not be freed.
- */
-int
-ip_output(m0, opt, ro, flags, imo)
- struct mbuf *m0;
- struct mbuf *opt;
- struct route *ro;
- int flags;
- struct ip_moptions *imo;
-{
- struct ip *ip, *mhip;
- struct ifnet *ifp;
- struct mbuf *m = m0;
- int hlen = sizeof (struct ip);
- int len, off, error = 0;
- struct sockaddr_in *dst;
- struct in_ifaddr *ia;
- int isbroadcast;
-
-#ifdef DIAGNOSTIC
- if ((m->m_flags & M_PKTHDR) == 0)
- panic("ip_output no HDR");
- if (!ro)
- panic("ip_output no route, proto = %d",
- mtod(m, struct ip *)->ip_p);
-#endif
- if (opt) {
- m = ip_insertoptions(m, opt, &len);
- hlen = len;
- }
- ip = mtod(m, struct ip *);
- /*
- * Fill in IP header.
- */
- if ((flags & (IP_FORWARDING|IP_RAWOUTPUT)) == 0) {
- ip->ip_vhl = IP_MAKE_VHL(IPVERSION, hlen >> 2);
- ip->ip_off &= IP_DF;
- ip->ip_id = htons(ip_id++);
- ipstat.ips_localout++;
- } else {
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
- }
-
- dst = (struct sockaddr_in *)&ro->ro_dst;
- /*
- * If there is a cached route,
- * check that it is to the same destination
- * and is still up. If not, free it and try again.
- */
- if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 ||
- dst->sin_addr.s_addr != ip->ip_dst.s_addr)) {
- RTFREE(ro->ro_rt);
- ro->ro_rt = (struct rtentry *)0;
- }
- if (ro->ro_rt == 0) {
- dst->sin_family = AF_INET;
- dst->sin_len = sizeof(*dst);
- dst->sin_addr = ip->ip_dst;
- }
- /*
- * If routing to interface only,
- * short circuit routing lookup.
- */
-#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
-#define sintosa(sin) ((struct sockaddr *)(sin))
- if (flags & IP_ROUTETOIF) {
- if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == 0 &&
- (ia = ifatoia(ifa_ifwithnet(sintosa(dst)))) == 0) {
- ipstat.ips_noroute++;
- error = ENETUNREACH;
- goto bad;
- }
- ifp = ia->ia_ifp;
- ip->ip_ttl = 1;
- isbroadcast = in_broadcast(dst->sin_addr, ifp);
- } else {
- /*
- * If this is the case, we probably don't want to allocate
- * a protocol-cloned route since we didn't get one from the
- * ULP. This lets TCP do its thing, while not burdening
- * forwarding or ICMP with the overhead of cloning a route.
- * Of course, we still want to do any cloning requested by
- * the link layer, as this is probably required in all cases
- * for correct operation (as it is for ARP).
- */
- if (ro->ro_rt == 0)
- rtalloc_ign(ro, RTF_PRCLONING);
- if (ro->ro_rt == 0) {
- ipstat.ips_noroute++;
- error = EHOSTUNREACH;
- goto bad;
- }
- ia = ifatoia(ro->ro_rt->rt_ifa);
- ifp = ro->ro_rt->rt_ifp;
- ro->ro_rt->rt_use++;
- if (ro->ro_rt->rt_flags & RTF_GATEWAY)
- dst = (struct sockaddr_in *)ro->ro_rt->rt_gateway;
- if (ro->ro_rt->rt_flags & RTF_HOST)
- isbroadcast = (ro->ro_rt->rt_flags & RTF_BROADCAST);
- else
- isbroadcast = in_broadcast(dst->sin_addr, ifp);
- }
- if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
- struct in_multi *inm;
-
- m->m_flags |= M_MCAST;
- /*
- * IP destination address is multicast. Make sure "dst"
- * still points to the address in "ro". (It may have been
- * changed to point to a gateway address, above.)
- */
- dst = (struct sockaddr_in *)&ro->ro_dst;
- /*
- * See if the caller provided any multicast options
- */
- if (imo != NULL) {
- ip->ip_ttl = imo->imo_multicast_ttl;
- if (imo->imo_multicast_ifp != NULL)
- ifp = imo->imo_multicast_ifp;
- if (imo->imo_multicast_vif != -1)
- ip->ip_src.s_addr =
- ip_mcast_src(imo->imo_multicast_vif);
- } else
- ip->ip_ttl = IP_DEFAULT_MULTICAST_TTL;
- /*
- * Confirm that the outgoing interface supports multicast.
- */
- if ((imo == NULL) || (imo->imo_multicast_vif == -1)) {
- if ((ifp->if_flags & IFF_MULTICAST) == 0) {
- ipstat.ips_noroute++;
- error = ENETUNREACH;
- goto bad;
- }
- }
- /*
- * If source address not specified yet, use address
- * of outgoing interface.
- */
- if (ip->ip_src.s_addr == INADDR_ANY) {
- register struct in_ifaddr *ia;
-
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if (ia->ia_ifp == ifp) {
- ip->ip_src = IA_SIN(ia)->sin_addr;
- break;
- }
- }
-
- IN_LOOKUP_MULTI(ip->ip_dst, ifp, inm);
- if (inm != NULL &&
- (imo == NULL || imo->imo_multicast_loop)) {
- /*
- * If we belong to the destination multicast group
- * on the outgoing interface, and the caller did not
- * forbid loopback, loop back a copy.
- */
- ip_mloopback(ifp, m, dst, hlen);
- }
- else {
- /*
- * If we are acting as a multicast router, perform
- * multicast forwarding as if the packet had just
- * arrived on the interface to which we are about
- * to send. The multicast forwarding function
- * recursively calls this function, using the
- * IP_FORWARDING flag to prevent infinite recursion.
- *
- * Multicasts that are looped back by ip_mloopback(),
- * above, will be forwarded by the ip_input() routine,
- * if necessary.
- */
- if (ip_mrouter && (flags & IP_FORWARDING) == 0) {
- /*
- * Check if rsvp daemon is running. If not, don't
- * set ip_moptions. This ensures that the packet
- * is multicast and not just sent down one link
- * as prescribed by rsvpd.
- */
- if (!rsvp_on)
- imo = NULL;
- if (ip_mforward(ip, ifp, m, imo) != 0) {
- m_freem(m);
- goto done;
- }
- }
- }
-
- /*
- * Multicasts with a time-to-live of zero may be looped-
- * back, above, but must not be transmitted on a network.
- * Also, multicasts addressed to the loopback interface
- * are not sent -- the above call to ip_mloopback() will
- * loop back a copy if this host actually belongs to the
- * destination group on the loopback interface.
- */
- if (ip->ip_ttl == 0 || ifp->if_flags & IFF_LOOPBACK) {
- m_freem(m);
- goto done;
- }
-
- goto sendit;
- }
-#ifndef notdef
- /*
- * If source address not specified yet, use address
- * of outgoing interface.
- */
- if (ip->ip_src.s_addr == INADDR_ANY)
- ip->ip_src = IA_SIN(ia)->sin_addr;
-#endif
- /*
- * Verify that we have any chance at all of being able to queue
- * the packet or packet fragments
- */
- if ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >=
- ifp->if_snd.ifq_maxlen) {
- error = ENOBUFS;
- goto bad;
- }
-
- /*
- * Look for broadcast address and
- * and verify user is allowed to send
- * such a packet.
- */
- if (isbroadcast) {
- if ((ifp->if_flags & IFF_BROADCAST) == 0) {
- error = EADDRNOTAVAIL;
- goto bad;
- }
- if ((flags & IP_ALLOWBROADCAST) == 0) {
- error = EACCES;
- goto bad;
- }
- /* don't allow broadcast messages to be fragmented */
- if ((u_short)ip->ip_len > ifp->if_mtu) {
- error = EMSGSIZE;
- goto bad;
- }
- m->m_flags |= M_BCAST;
- } else {
- m->m_flags &= ~M_BCAST;
- }
-
-sendit:
- /*
- * IpHack's section.
- * - Xlate: translate packet's addr/port (NAT).
- * - Firewall: deny/allow/etc.
- * - Wrap: fake packet's addr/port <unimpl.>
- * - Encapsulate: put it in another IP and send out. <unimp.>
- */
-
-#ifdef COMPAT_IPFW
- if (ip_nat_ptr && !(*ip_nat_ptr)(&ip, &m, ifp, IP_NAT_OUT)) {
- error = EACCES;
- goto done;
- }
-
- /*
- * Check with the firewall...
- */
- if (ip_fw_chk_ptr) {
-#ifdef IPDIVERT
- ip_divert_port = (*ip_fw_chk_ptr)(&ip,
- hlen, ifp, ip_divert_ignore, &m);
- ip_divert_ignore = 0;
- if (ip_divert_port) { /* Divert packet */
- (*inetsw[ip_protox[IPPROTO_DIVERT]].pr_input)(m, 0);
- goto done;
- }
-#else
- /* If ipfw says divert, we have to just drop packet */
- if ((*ip_fw_chk_ptr)(&ip, hlen, ifp, 0, &m)) {
- m_freem(m);
- goto done;
- }
-#endif
- if (!m) {
- error = EACCES;
- goto done;
- }
- }
-#endif /* COMPAT_IPFW */
-
- /*
- * If small enough for interface, can just send directly.
- */
- if ((u_short)ip->ip_len <= ifp->if_mtu) {
- ip->ip_len = htons((u_short)ip->ip_len);
- ip->ip_off = htons((u_short)ip->ip_off);
- ip->ip_sum = 0;
- if (ip->ip_vhl == IP_VHL_BORING) {
- ip->ip_sum = in_cksum_hdr(ip);
- } else {
- ip->ip_sum = in_cksum(m, hlen);
- }
- error = (*ifp->if_output)(ifp, m,
- (struct sockaddr *)dst, ro->ro_rt);
- goto done;
- }
- /*
- * Too large for interface; fragment if possible.
- * Must be able to put at least 8 bytes per fragment.
- */
- if (ip->ip_off & IP_DF) {
- error = EMSGSIZE;
- /*
- * This case can happen if the user changed the MTU
- * of an interface after enabling IP on it. Because
- * most netifs don't keep track of routes pointing to
- * them, there is no way for one to update all its
- * routes when the MTU is changed.
- */
- if ((ro->ro_rt->rt_flags & (RTF_UP | RTF_HOST))
- && !(ro->ro_rt->rt_rmx.rmx_locks & RTV_MTU)
- && (ro->ro_rt->rt_rmx.rmx_mtu > ifp->if_mtu)) {
- ro->ro_rt->rt_rmx.rmx_mtu = ifp->if_mtu;
- }
- ipstat.ips_cantfrag++;
- goto bad;
- }
- len = (ifp->if_mtu - hlen) &~ 7;
- if (len < 8) {
- error = EMSGSIZE;
- goto bad;
- }
-
- {
- int mhlen, firstlen = len;
- struct mbuf **mnext = &m->m_nextpkt;
-
- /*
- * Loop through length of segment after first fragment,
- * make new header and copy data of each part and link onto chain.
- */
- m0 = m;
- mhlen = sizeof (struct ip);
- for (off = hlen + len; off < (u_short)ip->ip_len; off += len) {
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == 0) {
- error = ENOBUFS;
- ipstat.ips_odropped++;
- goto sendorfree;
- }
- m->m_data += max_linkhdr;
- mhip = mtod(m, struct ip *);
- *mhip = *ip;
- if (hlen > sizeof (struct ip)) {
- mhlen = ip_optcopy(ip, mhip) + sizeof (struct ip);
- mhip->ip_vhl = IP_MAKE_VHL(IPVERSION, mhlen >> 2);
- }
- m->m_len = mhlen;
- mhip->ip_off = ((off - hlen) >> 3) + (ip->ip_off & ~IP_MF);
- if (ip->ip_off & IP_MF)
- mhip->ip_off |= IP_MF;
- if (off + len >= (u_short)ip->ip_len)
- len = (u_short)ip->ip_len - off;
- else
- mhip->ip_off |= IP_MF;
- mhip->ip_len = htons((u_short)(len + mhlen));
- m->m_next = m_copy(m0, off, len);
- if (m->m_next == 0) {
- (void) m_free(m);
- error = ENOBUFS; /* ??? */
- ipstat.ips_odropped++;
- goto sendorfree;
- }
- m->m_pkthdr.len = mhlen + len;
- m->m_pkthdr.rcvif = (struct ifnet *)0;
- mhip->ip_off = htons((u_short)mhip->ip_off);
- mhip->ip_sum = 0;
- if (mhip->ip_vhl == IP_VHL_BORING) {
- mhip->ip_sum = in_cksum_hdr(mhip);
- } else {
- mhip->ip_sum = in_cksum(m, mhlen);
- }
- *mnext = m;
- mnext = &m->m_nextpkt;
- ipstat.ips_ofragments++;
- }
- /*
- * Update first fragment by trimming what's been copied out
- * and updating header, then send each fragment (in order).
- */
- m = m0;
- m_adj(m, hlen + firstlen - (u_short)ip->ip_len);
- m->m_pkthdr.len = hlen + firstlen;
- ip->ip_len = htons((u_short)m->m_pkthdr.len);
- ip->ip_off = htons((u_short)(ip->ip_off | IP_MF));
- ip->ip_sum = 0;
- if (ip->ip_vhl == IP_VHL_BORING) {
- ip->ip_sum = in_cksum_hdr(ip);
- } else {
- ip->ip_sum = in_cksum(m, hlen);
- }
-sendorfree:
- for (m = m0; m; m = m0) {
- m0 = m->m_nextpkt;
- m->m_nextpkt = 0;
- if (error == 0)
- error = (*ifp->if_output)(ifp, m,
- (struct sockaddr *)dst, ro->ro_rt);
- else
- m_freem(m);
- }
-
- if (error == 0)
- ipstat.ips_fragmented++;
- }
-done:
- return (error);
-bad:
- m_freem(m0);
- goto done;
-}
-
-/*
- * Insert IP options into preformed packet.
- * Adjust IP destination as required for IP source routing,
- * as indicated by a non-zero in_addr at the start of the options.
- *
- * XXX This routine assumes that the packet has no options in place.
- */
-static struct mbuf *
-ip_insertoptions(m, opt, phlen)
- register struct mbuf *m;
- struct mbuf *opt;
- int *phlen;
-{
- register struct ipoption *p = mtod(opt, struct ipoption *);
- struct mbuf *n;
- register struct ip *ip = mtod(m, struct ip *);
- unsigned optlen;
-
- optlen = opt->m_len - sizeof(p->ipopt_dst);
- if (optlen + (u_short)ip->ip_len > IP_MAXPACKET)
- return (m); /* XXX should fail */
- if (p->ipopt_dst.s_addr)
- ip->ip_dst = p->ipopt_dst;
- if (m->m_flags & M_EXT || m->m_data - optlen < m->m_pktdat) {
- MGETHDR(n, M_DONTWAIT, MT_HEADER);
- if (n == 0)
- return (m);
- n->m_pkthdr.len = m->m_pkthdr.len + optlen;
- m->m_len -= sizeof(struct ip);
- m->m_data += sizeof(struct ip);
- n->m_next = m;
- m = n;
- m->m_len = optlen + sizeof(struct ip);
- m->m_data += max_linkhdr;
- (void)memcpy(mtod(m, void *), ip, sizeof(struct ip));
- } else {
- m->m_data -= optlen;
- m->m_len += optlen;
- m->m_pkthdr.len += optlen;
- ovbcopy((caddr_t)ip, mtod(m, caddr_t), sizeof(struct ip));
- }
- ip = mtod(m, struct ip *);
- bcopy(p->ipopt_list, ip + 1, optlen);
- *phlen = sizeof(struct ip) + optlen;
- ip->ip_vhl = IP_MAKE_VHL(IPVERSION, *phlen >> 2);
- ip->ip_len += optlen;
- return (m);
-}
-
-/*
- * Copy options from ip to jp,
- * omitting those not copied during fragmentation.
- */
-static int
-ip_optcopy(ip, jp)
- struct ip *ip, *jp;
-{
- register u_char *cp, *dp;
- int opt, optlen, cnt;
-
- cp = (u_char *)(ip + 1);
- dp = (u_char *)(jp + 1);
- cnt = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof (struct ip);
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[0];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP) {
- /* Preserve for IP mcast tunnel's LSRR alignment. */
- *dp++ = IPOPT_NOP;
- optlen = 1;
- continue;
- } else
- optlen = cp[IPOPT_OLEN];
- /* bogus lengths should have been caught by ip_dooptions */
- if (optlen > cnt)
- optlen = cnt;
- if (IPOPT_COPIED(opt)) {
- bcopy(cp, dp, optlen);
- dp += optlen;
- }
- }
- for (optlen = dp - (u_char *)(jp+1); optlen & 0x3; optlen++)
- *dp++ = IPOPT_EOL;
- return (optlen);
-}
-
-/*
- * IP socket option processing.
- */
-int
-ip_ctloutput(op, so, level, optname, mp)
- int op;
- struct socket *so;
- int level, optname;
- struct mbuf **mp;
-{
- register struct inpcb *inp = sotoinpcb(so);
- register struct mbuf *m = *mp;
- register int optval = 0;
- int error = 0;
-
- if (level != IPPROTO_IP) {
- error = EINVAL;
- if (op == PRCO_SETOPT && *mp)
- (void) m_free(*mp);
- } else switch (op) {
-
- case PRCO_SETOPT:
- switch (optname) {
- case IP_OPTIONS:
-#ifdef notyet
- case IP_RETOPTS:
- return (ip_pcbopts(optname, &inp->inp_options, m));
-#else
- return (ip_pcbopts(&inp->inp_options, m));
-#endif
-
- case IP_TOS:
- case IP_TTL:
- case IP_RECVOPTS:
- case IP_RECVRETOPTS:
- case IP_RECVDSTADDR:
- case IP_RECVIF:
- if (m == 0 || m->m_len != sizeof(int))
- error = EINVAL;
- else {
- optval = *mtod(m, int *);
- switch (optname) {
-
- case IP_TOS:
- inp->inp_ip_tos = optval;
- break;
-
- case IP_TTL:
- inp->inp_ip_ttl = optval;
- break;
-#define OPTSET(bit) \
- if (optval) \
- inp->inp_flags |= bit; \
- else \
- inp->inp_flags &= ~bit;
-
- case IP_RECVOPTS:
- OPTSET(INP_RECVOPTS);
- break;
-
- case IP_RECVRETOPTS:
- OPTSET(INP_RECVRETOPTS);
- break;
-
- case IP_RECVDSTADDR:
- OPTSET(INP_RECVDSTADDR);
- break;
-
- case IP_RECVIF:
- OPTSET(INP_RECVIF);
- break;
- }
- }
- break;
-#undef OPTSET
-
- case IP_MULTICAST_IF:
- case IP_MULTICAST_VIF:
- case IP_MULTICAST_TTL:
- case IP_MULTICAST_LOOP:
- case IP_ADD_MEMBERSHIP:
- case IP_DROP_MEMBERSHIP:
- error = ip_setmoptions(optname, &inp->inp_moptions, m);
- break;
-
- case IP_PORTRANGE:
- if (m == 0 || m->m_len != sizeof(int))
- error = EINVAL;
- else {
- optval = *mtod(m, int *);
-
- switch (optval) {
-
- case IP_PORTRANGE_DEFAULT:
- inp->inp_flags &= ~(INP_LOWPORT);
- inp->inp_flags &= ~(INP_HIGHPORT);
- break;
-
- case IP_PORTRANGE_HIGH:
- inp->inp_flags &= ~(INP_LOWPORT);
- inp->inp_flags |= INP_HIGHPORT;
- break;
-
- case IP_PORTRANGE_LOW:
- inp->inp_flags &= ~(INP_HIGHPORT);
- inp->inp_flags |= INP_LOWPORT;
- break;
-
- default:
- error = EINVAL;
- break;
- }
- }
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- if (m)
- (void)m_free(m);
- break;
-
- case PRCO_GETOPT:
- switch (optname) {
- case IP_OPTIONS:
- case IP_RETOPTS:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- if (inp->inp_options) {
- m->m_len = inp->inp_options->m_len;
- bcopy(mtod(inp->inp_options, void *),
- mtod(m, void *), m->m_len);
- } else
- m->m_len = 0;
- break;
-
- case IP_TOS:
- case IP_TTL:
- case IP_RECVOPTS:
- case IP_RECVRETOPTS:
- case IP_RECVDSTADDR:
- case IP_RECVIF:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof(int);
- switch (optname) {
-
- case IP_TOS:
- optval = inp->inp_ip_tos;
- break;
-
- case IP_TTL:
- optval = inp->inp_ip_ttl;
- break;
-
-#define OPTBIT(bit) (inp->inp_flags & bit ? 1 : 0)
-
- case IP_RECVOPTS:
- optval = OPTBIT(INP_RECVOPTS);
- break;
-
- case IP_RECVRETOPTS:
- optval = OPTBIT(INP_RECVRETOPTS);
- break;
-
- case IP_RECVDSTADDR:
- optval = OPTBIT(INP_RECVDSTADDR);
- break;
-
- case IP_RECVIF:
- optval = OPTBIT(INP_RECVIF);
- break;
- }
- *mtod(m, int *) = optval;
- break;
-
- case IP_MULTICAST_IF:
- case IP_MULTICAST_VIF:
- case IP_MULTICAST_TTL:
- case IP_MULTICAST_LOOP:
- case IP_ADD_MEMBERSHIP:
- case IP_DROP_MEMBERSHIP:
- error = ip_getmoptions(optname, inp->inp_moptions, mp);
- break;
-
- case IP_PORTRANGE:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof(int);
-
- if (inp->inp_flags & INP_HIGHPORT)
- optval = IP_PORTRANGE_HIGH;
- else if (inp->inp_flags & INP_LOWPORT)
- optval = IP_PORTRANGE_LOW;
- else
- optval = 0;
-
- *mtod(m, int *) = optval;
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- break;
- }
- return (error);
-}
-
-/*
- * Set up IP options in pcb for insertion in output packets.
- * Store in mbuf with pointer in pcbopt, adding pseudo-option
- * with destination address if source routed.
- */
-static int
-#ifdef notyet
-ip_pcbopts(optname, pcbopt, m)
- int optname;
-#else
-ip_pcbopts(pcbopt, m)
-#endif
- struct mbuf **pcbopt;
- register struct mbuf *m;
-{
- register int cnt, optlen;
- register u_char *cp;
- u_char opt;
-
- /* turn off any old options */
- if (*pcbopt)
- (void)m_free(*pcbopt);
- *pcbopt = 0;
- if (m == (struct mbuf *)0 || m->m_len == 0) {
- /*
- * Only turning off any previous options.
- */
- if (m)
- (void)m_free(m);
- return (0);
- }
-
-#ifndef vax
- if (m->m_len % sizeof(long))
- goto bad;
-#endif
- /*
- * IP first-hop destination address will be stored before
- * actual options; move other options back
- * and clear it when none present.
- */
- if (m->m_data + m->m_len + sizeof(struct in_addr) >= &m->m_dat[MLEN])
- goto bad;
- cnt = m->m_len;
- m->m_len += sizeof(struct in_addr);
- cp = mtod(m, u_char *) + sizeof(struct in_addr);
- ovbcopy(mtod(m, caddr_t), (caddr_t)cp, (unsigned)cnt);
- bzero(mtod(m, caddr_t), sizeof(struct in_addr));
-
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[IPOPT_OPTVAL];
- if (opt == IPOPT_EOL)
- break;
- if (opt == IPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[IPOPT_OLEN];
- if (optlen <= IPOPT_OLEN || optlen > cnt)
- goto bad;
- }
- switch (opt) {
-
- default:
- break;
-
- case IPOPT_LSRR:
- case IPOPT_SSRR:
- /*
- * user process specifies route as:
- * ->A->B->C->D
- * D must be our final destination (but we can't
- * check that since we may not have connected yet).
- * A is first hop destination, which doesn't appear in
- * actual IP option, but is stored before the options.
- */
- if (optlen < IPOPT_MINOFF - 1 + sizeof(struct in_addr))
- goto bad;
- m->m_len -= sizeof(struct in_addr);
- cnt -= sizeof(struct in_addr);
- optlen -= sizeof(struct in_addr);
- cp[IPOPT_OLEN] = optlen;
- /*
- * Move first hop before start of options.
- */
- bcopy((caddr_t)&cp[IPOPT_OFFSET+1], mtod(m, caddr_t),
- sizeof(struct in_addr));
- /*
- * Then copy rest of options back
- * to close up the deleted entry.
- */
- ovbcopy((caddr_t)(&cp[IPOPT_OFFSET+1] +
- sizeof(struct in_addr)),
- (caddr_t)&cp[IPOPT_OFFSET+1],
- (unsigned)cnt + sizeof(struct in_addr));
- break;
- }
- }
- if (m->m_len > MAX_IPOPTLEN + sizeof(struct in_addr))
- goto bad;
- *pcbopt = m;
- return (0);
-
-bad:
- (void)m_free(m);
- return (EINVAL);
-}
-
-/*
- * Set the IP multicast options in response to user setsockopt().
- */
-static int
-ip_setmoptions(optname, imop, m)
- int optname;
- struct ip_moptions **imop;
- struct mbuf *m;
-{
- register int error = 0;
- u_char loop;
- register int i;
- struct in_addr addr;
- register struct ip_mreq *mreq;
- register struct ifnet *ifp;
- register struct ip_moptions *imo = *imop;
- struct route ro;
- register struct sockaddr_in *dst;
- int s;
-
- if (imo == NULL) {
- /*
- * No multicast option buffer attached to the pcb;
- * allocate one and initialize to default values.
- */
- imo = (struct ip_moptions*)malloc(sizeof(*imo), M_IPMOPTS,
- M_WAITOK);
-
- if (imo == NULL)
- return (ENOBUFS);
- *imop = imo;
- imo->imo_multicast_ifp = NULL;
- imo->imo_multicast_vif = -1;
- imo->imo_multicast_ttl = IP_DEFAULT_MULTICAST_TTL;
- imo->imo_multicast_loop = IP_DEFAULT_MULTICAST_LOOP;
- imo->imo_num_memberships = 0;
- }
-
- switch (optname) {
- /* store an index number for the vif you wanna use in the send */
- case IP_MULTICAST_VIF:
- if (!legal_vif_num) {
- error = EOPNOTSUPP;
- break;
- }
- if (m == NULL || m->m_len != sizeof(int)) {
- error = EINVAL;
- break;
- }
- i = *(mtod(m, int *));
- if (!legal_vif_num(i) && (i != -1)) {
- error = EINVAL;
- break;
- }
- imo->imo_multicast_vif = i;
- break;
-
- case IP_MULTICAST_IF:
- /*
- * Select the interface for outgoing multicast packets.
- */
- if (m == NULL || m->m_len != sizeof(struct in_addr)) {
- error = EINVAL;
- break;
- }
- addr = *(mtod(m, struct in_addr *));
- /*
- * INADDR_ANY is used to remove a previous selection.
- * When no interface is selected, a default one is
- * chosen every time a multicast packet is sent.
- */
- if (addr.s_addr == INADDR_ANY) {
- imo->imo_multicast_ifp = NULL;
- break;
- }
- /*
- * The selected interface is identified by its local
- * IP address. Find the interface and confirm that
- * it supports multicasting.
- */
- s = splimp();
- INADDR_TO_IFP(addr, ifp);
- if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) {
- splx(s);
- error = EADDRNOTAVAIL;
- break;
- }
- imo->imo_multicast_ifp = ifp;
- splx(s);
- break;
-
- case IP_MULTICAST_TTL:
- /*
- * Set the IP time-to-live for outgoing multicast packets.
- */
- if (m == NULL || m->m_len != 1) {
- error = EINVAL;
- break;
- }
- imo->imo_multicast_ttl = *(mtod(m, u_char *));
- break;
-
- case IP_MULTICAST_LOOP:
- /*
- * Set the loopback flag for outgoing multicast packets.
- * Must be zero or one.
- */
- if (m == NULL || m->m_len != 1 ||
- (loop = *(mtod(m, u_char *))) > 1) {
- error = EINVAL;
- break;
- }
- imo->imo_multicast_loop = loop;
- break;
-
- case IP_ADD_MEMBERSHIP:
- /*
- * Add a multicast group membership.
- * Group must be a valid IP multicast address.
- */
- if (m == NULL || m->m_len != sizeof(struct ip_mreq)) {
- error = EINVAL;
- break;
- }
- mreq = mtod(m, struct ip_mreq *);
- if (!IN_MULTICAST(ntohl(mreq->imr_multiaddr.s_addr))) {
- error = EINVAL;
- break;
- }
- s = splimp();
- /*
- * If no interface address was provided, use the interface of
- * the route to the given multicast address.
- */
- if (mreq->imr_interface.s_addr == INADDR_ANY) {
- bzero((caddr_t)&ro, sizeof(ro));
- dst = (struct sockaddr_in *)&ro.ro_dst;
- dst->sin_len = sizeof(*dst);
- dst->sin_family = AF_INET;
- dst->sin_addr = mreq->imr_multiaddr;
- rtalloc(&ro);
- if (ro.ro_rt == NULL) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- ifp = ro.ro_rt->rt_ifp;
- rtfree(ro.ro_rt);
- }
- else {
- INADDR_TO_IFP(mreq->imr_interface, ifp);
- }
-
- /*
- * See if we found an interface, and confirm that it
- * supports multicast.
- */
- if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- /*
- * See if the membership already exists or if all the
- * membership slots are full.
- */
- for (i = 0; i < imo->imo_num_memberships; ++i) {
- if (imo->imo_membership[i]->inm_ifp == ifp &&
- imo->imo_membership[i]->inm_addr.s_addr
- == mreq->imr_multiaddr.s_addr)
- break;
- }
- if (i < imo->imo_num_memberships) {
- error = EADDRINUSE;
- splx(s);
- break;
- }
- if (i == IP_MAX_MEMBERSHIPS) {
- error = ETOOMANYREFS;
- splx(s);
- break;
- }
- /*
- * Everything looks good; add a new record to the multicast
- * address list for the given interface.
- */
- if ((imo->imo_membership[i] =
- in_addmulti(&mreq->imr_multiaddr, ifp)) == NULL) {
- error = ENOBUFS;
- splx(s);
- break;
- }
- ++imo->imo_num_memberships;
- splx(s);
- break;
-
- case IP_DROP_MEMBERSHIP:
- /*
- * Drop a multicast group membership.
- * Group must be a valid IP multicast address.
- */
- if (m == NULL || m->m_len != sizeof(struct ip_mreq)) {
- error = EINVAL;
- break;
- }
- mreq = mtod(m, struct ip_mreq *);
- if (!IN_MULTICAST(ntohl(mreq->imr_multiaddr.s_addr))) {
- error = EINVAL;
- break;
- }
-
- s = splimp();
- /*
- * If an interface address was specified, get a pointer
- * to its ifnet structure.
- */
- if (mreq->imr_interface.s_addr == INADDR_ANY)
- ifp = NULL;
- else {
- INADDR_TO_IFP(mreq->imr_interface, ifp);
- if (ifp == NULL) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- }
- /*
- * Find the membership in the membership array.
- */
- for (i = 0; i < imo->imo_num_memberships; ++i) {
- if ((ifp == NULL ||
- imo->imo_membership[i]->inm_ifp == ifp) &&
- imo->imo_membership[i]->inm_addr.s_addr ==
- mreq->imr_multiaddr.s_addr)
- break;
- }
- if (i == imo->imo_num_memberships) {
- error = EADDRNOTAVAIL;
- splx(s);
- break;
- }
- /*
- * Give up the multicast address record to which the
- * membership points.
- */
- in_delmulti(imo->imo_membership[i]);
- /*
- * Remove the gap in the membership array.
- */
- for (++i; i < imo->imo_num_memberships; ++i)
- imo->imo_membership[i-1] = imo->imo_membership[i];
- --imo->imo_num_memberships;
- splx(s);
- break;
-
- default:
- error = EOPNOTSUPP;
- break;
- }
-
- /*
- * If all options have default values, no need to keep the mbuf.
- */
- if (imo->imo_multicast_ifp == NULL &&
- imo->imo_multicast_vif == -1 &&
- imo->imo_multicast_ttl == IP_DEFAULT_MULTICAST_TTL &&
- imo->imo_multicast_loop == IP_DEFAULT_MULTICAST_LOOP &&
- imo->imo_num_memberships == 0) {
- free(*imop, M_IPMOPTS);
- *imop = NULL;
- }
-
- return (error);
-}
-
-/*
- * Return the IP multicast options in response to user getsockopt().
- */
-static int
-ip_getmoptions(optname, imo, mp)
- int optname;
- register struct ip_moptions *imo;
- register struct mbuf **mp;
-{
- u_char *ttl;
- u_char *loop;
- struct in_addr *addr;
- struct in_ifaddr *ia;
-
- *mp = m_get(M_WAIT, MT_SOOPTS);
-
- switch (optname) {
-
- case IP_MULTICAST_VIF:
- if (imo != NULL)
- *(mtod(*mp, int *)) = imo->imo_multicast_vif;
- else
- *(mtod(*mp, int *)) = -1;
- (*mp)->m_len = sizeof(int);
- return(0);
-
- case IP_MULTICAST_IF:
- addr = mtod(*mp, struct in_addr *);
- (*mp)->m_len = sizeof(struct in_addr);
- if (imo == NULL || imo->imo_multicast_ifp == NULL)
- addr->s_addr = INADDR_ANY;
- else {
- IFP_TO_IA(imo->imo_multicast_ifp, ia);
- addr->s_addr = (ia == NULL) ? INADDR_ANY
- : IA_SIN(ia)->sin_addr.s_addr;
- }
- return (0);
-
- case IP_MULTICAST_TTL:
- ttl = mtod(*mp, u_char *);
- (*mp)->m_len = 1;
- *ttl = (imo == NULL) ? IP_DEFAULT_MULTICAST_TTL
- : imo->imo_multicast_ttl;
- return (0);
-
- case IP_MULTICAST_LOOP:
- loop = mtod(*mp, u_char *);
- (*mp)->m_len = 1;
- *loop = (imo == NULL) ? IP_DEFAULT_MULTICAST_LOOP
- : imo->imo_multicast_loop;
- return (0);
-
- default:
- return (EOPNOTSUPP);
- }
-}
-
-/*
- * Discard the IP multicast options.
- */
-void
-ip_freemoptions(imo)
- register struct ip_moptions *imo;
-{
- register int i;
-
- if (imo != NULL) {
- for (i = 0; i < imo->imo_num_memberships; ++i)
- in_delmulti(imo->imo_membership[i]);
- free(imo, M_IPMOPTS);
- }
-}
-
-/*
- * Routine called from ip_output() to loop back a copy of an IP multicast
- * packet to the input queue of a specified interface. Note that this
- * calls the output routine of the loopback "driver", but with an interface
- * pointer that might NOT be a loopback interface -- evil, but easier than
- * replicating that code here.
- */
-static void
-ip_mloopback(ifp, m, dst, hlen)
- struct ifnet *ifp;
- register struct mbuf *m;
- register struct sockaddr_in *dst;
- int hlen;
-{
- register struct ip *ip;
- struct mbuf *copym;
-
- copym = m_copy(m, 0, M_COPYALL);
- if (copym != NULL && (copym->m_flags & M_EXT || copym->m_len < hlen))
- copym = m_pullup(copym, hlen);
- if (copym != NULL) {
- /*
- * We don't bother to fragment if the IP length is greater
- * than the interface's MTU. Can this possibly matter?
- */
- ip = mtod(copym, struct ip *);
- ip->ip_len = htons((u_short)ip->ip_len);
- ip->ip_off = htons((u_short)ip->ip_off);
- ip->ip_sum = 0;
- if (ip->ip_vhl == IP_VHL_BORING) {
- ip->ip_sum = in_cksum_hdr(ip);
- } else {
- ip->ip_sum = in_cksum(copym, hlen);
- }
- /*
- * NB:
- * It's not clear whether there are any lingering
- * reentrancy problems in other areas which might
- * be exposed by using ip_input directly (in
- * particular, everything which modifies the packet
- * in-place). Yet another option is using the
- * protosw directly to deliver the looped back
- * packet. For the moment, we'll err on the side
- * of safety by continuing to abuse looutput().
- */
-#ifdef notdef
- copym->m_pkthdr.rcvif = ifp;
- ip_input(copym)
-#else
- (void) looutput(ifp, copym, (struct sockaddr *)dst, NULL);
-#endif
- }
-}
diff --git a/cpukit/libnetworking/netinet/ip_var.h b/cpukit/libnetworking/netinet/ip_var.h
deleted file mode 100644
index cc7908e9a3..0000000000
--- a/cpukit/libnetworking/netinet/ip_var.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)ip_var.h 8.2 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _NETINET_IP_VAR_H_
-#define _NETINET_IP_VAR_H_
-
-/*
- * Overlay for ip header used by other protocols (tcp, udp).
- */
-struct ipovly {
- caddr_t ih_next, ih_prev; /* for protocol sequence q's */
- u_char ih_x1; /* (unused) */
- u_char ih_pr; /* protocol */
- u_short ih_len; /* protocol length */
- struct in_addr ih_src; /* source internet address */
- struct in_addr ih_dst; /* destination internet address */
-};
-
-/*
- * Ip reassembly queue structure. Each fragment
- * being reassembled is attached to one of these structures.
- * They are timed out after ipq_ttl drops to 0, and may also
- * be reclaimed if memory becomes tight.
- */
-struct ipq {
- struct ipq *next,*prev; /* to other reass headers */
- u_char ipq_ttl; /* time for reass q to live */
- u_char ipq_p; /* protocol of this fragment */
- u_short ipq_id; /* sequence id for reassembly */
- struct ipasfrag *ipq_next,*ipq_prev;
- /* to ip headers of fragments */
- struct in_addr ipq_src,ipq_dst;
-#ifdef IPDIVERT
- u_short ipq_divert; /* divert protocol port */
-#endif
-};
-
-/*
- * Ip header, when holding a fragment.
- *
- * Note: ipf_next must be at same offset as ipq_next above
- */
-struct ipasfrag {
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char ip_hl:4,
- ip_v:4;
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char ip_v:4,
- ip_hl:4;
-#endif
- u_char ipf_mff; /* XXX overlays ip_tos: use low bit
- * to avoid destroying tos;
- * copied from (ip_off&IP_MF) */
- u_short ip_len;
- u_short ip_id;
- u_short ip_off;
- u_char ip_ttl;
- u_char ip_p;
- u_short ip_sum;
- struct ipasfrag *ipf_next; /* next fragment */
- struct ipasfrag *ipf_prev; /* previous fragment */
-};
-
-/*
- * Structure stored in mbuf in inpcb.ip_options
- * and passed to ip_output when ip options are in use.
- * The actual length of the options (including ipopt_dst)
- * is in m_len.
- */
-#define MAX_IPOPTLEN 40
-
-struct ipoption {
- struct in_addr ipopt_dst; /* first-hop dst if source routed */
- char ipopt_list[MAX_IPOPTLEN]; /* options proper */
-};
-
-/*
- * Structure attached to inpcb.ip_moptions and
- * passed to ip_output when IP multicast options are in use.
- */
-struct ip_moptions {
- struct ifnet *imo_multicast_ifp; /* ifp for outgoing multicasts */
- u_char imo_multicast_ttl; /* TTL for outgoing multicasts */
- u_char imo_multicast_loop; /* 1 => hear sends if a member */
- u_short imo_num_memberships; /* no. memberships this socket */
- struct in_multi *imo_membership[IP_MAX_MEMBERSHIPS];
- u_long imo_multicast_vif; /* vif num outgoing multicasts */
-};
-
-struct ipstat {
- u_long ips_total; /* total packets received */
- u_long ips_badsum; /* checksum bad */
- u_long ips_tooshort; /* packet too short */
- u_long ips_toosmall; /* not enough data */
- u_long ips_badhlen; /* ip header length < data size */
- u_long ips_badlen; /* ip length < ip header length */
- u_long ips_fragments; /* fragments received */
- u_long ips_fragdropped; /* frags dropped (dups, out of space) */
- u_long ips_fragtimeout; /* fragments timed out */
- u_long ips_forward; /* packets forwarded */
- u_long ips_cantforward; /* packets rcvd for unreachable dest */
- u_long ips_redirectsent; /* packets forwarded on same net */
- u_long ips_noproto; /* unknown or unsupported protocol */
- u_long ips_delivered; /* datagrams delivered to upper level*/
- u_long ips_localout; /* total ip packets generated here */
- u_long ips_odropped; /* lost packets due to nobufs, etc. */
- u_long ips_reassembled; /* total packets reassembled ok */
- u_long ips_fragmented; /* datagrams successfully fragmented */
- u_long ips_ofragments; /* output fragments created */
- u_long ips_cantfrag; /* don't fragment flag was set, etc. */
- u_long ips_badoptions; /* error in option processing */
- u_long ips_noroute; /* packets discarded due to no route */
- u_long ips_badvers; /* ip version != 4 */
- u_long ips_rawout; /* total raw ip packets generated */
- u_long ips_toolong; /* ip length > max ip packet size */
-};
-
-#ifdef KERNEL
-/* flags passed to ip_output as last parameter */
-#define IP_FORWARDING 0x1 /* most of ip header exists */
-#define IP_RAWOUTPUT 0x2 /* raw ip header exists */
-#define IP_ROUTETOIF SO_DONTROUTE /* bypass routing tables */
-#define IP_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets */
-
-struct inpcb;
-struct route;
-
-extern struct ipstat ipstat;
-extern u_short ip_id; /* ip packet ctr, for ids */
-extern int ip_defttl; /* default IP ttl */
-extern u_char ip_protox[];
-extern struct socket *ip_rsvpd; /* reservation protocol daemon */
-extern struct socket *ip_mrouter; /* multicast routing daemon */
-extern int (*legal_vif_num) __P((int));
-extern u_long (*ip_mcast_src) __P((int));
-extern int rsvp_on;
-
-int ip_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
-void ip_drain __P((void));
-void ip_freemoptions __P((struct ip_moptions *));
-void ip_init __P((void));
-extern int (*ip_mforward) __P((struct ip *, struct ifnet *, struct mbuf *,
- struct ip_moptions *));
-int ip_output __P((struct mbuf *,
- struct mbuf *, struct route *, int, struct ip_moptions *));
-void ip_savecontrol __P((struct inpcb *, struct mbuf **, struct ip *,
- struct mbuf *));
-void ip_slowtimo __P((void));
-struct mbuf *
- ip_srcroute __P((void));
-void ip_stripoptions __P((struct mbuf *, struct mbuf *));
-int rip_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
-void rip_init __P((void));
-void rip_input __P((struct mbuf *, int));
-int rip_output __P((struct mbuf *, struct socket *, u_long));
-int rip_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-void ipip_input __P((struct mbuf *, int));
-void rsvp_input __P((struct mbuf *, int));
-int ip_rsvp_init __P((struct socket *));
-int ip_rsvp_done __P((void));
-int ip_rsvp_vif_init __P((struct socket *, struct mbuf *));
-int ip_rsvp_vif_done __P((struct socket *, struct mbuf *));
-void ip_rsvp_force_done __P((struct socket *));
-
-#ifdef IPDIVERT
-void div_init __P((void));
-void div_input __P((struct mbuf *, int));
-int div_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-extern u_short ip_divert_port;
-extern u_short ip_divert_ignore;
-#endif /* IPDIVERT */
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_IP_VAR_H_ */
diff --git a/cpukit/libnetworking/netinet/raw_ip.c b/cpukit/libnetworking/netinet/raw_ip.c
deleted file mode 100644
index 44d58f1844..0000000000
--- a/cpukit/libnetworking/netinet/raw_ip.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/protosw.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/systm.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#define _IP_VHL
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_mroute.h>
-
-#include <netinet/ip_fw.h>
-
-#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1
-#undef COMPAT_IPFW
-#define COMPAT_IPFW 1
-#else
-#undef COMPAT_IPFW
-#endif
-
-static struct inpcbhead ripcb;
-static struct inpcbinfo ripcbinfo;
-
-/*
- * Nominal space allocated to a raw ip socket.
- */
-#define RIPSNDQ 8192
-#define RIPRCVQ 8192
-
-/*
- * Raw interface to IP protocol.
- */
-
-/*
- * Initialize raw connection block q.
- */
-void
-rip_init()
-{
- LIST_INIT(&ripcb);
- ripcbinfo.listhead = &ripcb;
- /*
- * XXX We don't use the hash list for raw IP, but it's easier
- * to allocate a one entry hash list than it is to check all
- * over the place for hashbase == NULL.
- */
- ripcbinfo.hashbase = hashinit(1, M_PCB, &ripcbinfo.hashmask);
-}
-
-static struct sockaddr_in ripsrc = { sizeof(ripsrc), AF_INET };
-/*
- * Setup generic address and protocol structures
- * for raw_input routine, then pass them along with
- * mbuf chain.
- */
-void
-rip_input(m, iphlen)
- struct mbuf *m;
- int iphlen;
-{
- register struct ip *ip = mtod(m, struct ip *);
- register struct inpcb *inp;
- struct inpcb *last = 0;
- struct mbuf *opts = 0;
-
- ripsrc.sin_addr = ip->ip_src;
- for (inp = ripcb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_ip_p && inp->inp_ip_p != ip->ip_p)
- continue;
- if (inp->inp_laddr.s_addr &&
- inp->inp_laddr.s_addr != ip->ip_dst.s_addr)
- continue;
- if (inp->inp_faddr.s_addr &&
- inp->inp_faddr.s_addr != ip->ip_src.s_addr)
- continue;
- if (last) {
- struct mbuf *n = m_copy(m, 0, (int)M_COPYALL);
- if (n) {
- if (last->inp_flags & INP_CONTROLOPTS ||
- last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, n);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&ripsrc, n,
- opts) == 0) {
- /* should notify about lost packet */
- m_freem(n);
- if (opts)
- m_freem(opts);
- } else
- sorwakeup(last->inp_socket);
- opts = 0;
- }
- }
- last = inp;
- }
- if (last) {
- if (last->inp_flags & INP_CONTROLOPTS ||
- last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, m);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&ripsrc, m, opts) == 0) {
- m_freem(m);
- if (opts)
- m_freem(opts);
- } else
- sorwakeup(last->inp_socket);
- } else {
- m_freem(m);
- ipstat.ips_noproto++;
- ipstat.ips_delivered--;
- }
-}
-
-/*
- * Generate IP header and pass packet to ip_output.
- * Tack on options user may have setup with control call.
- */
-int
-rip_output(m, so, dst)
- register struct mbuf *m;
- struct socket *so;
- u_long dst;
-{
- register struct ip *ip;
- register struct inpcb *inp = sotoinpcb(so);
- int flags = (so->so_options & SO_DONTROUTE) | IP_ALLOWBROADCAST;
-
- /*
- * If the user handed us a complete IP packet, use it.
- * Otherwise, allocate an mbuf for a header and fill it in.
- */
- if ((inp->inp_flags & INP_HDRINCL) == 0) {
- if (m->m_pkthdr.len + sizeof(struct ip) > IP_MAXPACKET) {
- m_freem(m);
- return(EMSGSIZE);
- }
- M_PREPEND(m, sizeof(struct ip), M_WAIT);
- ip = mtod(m, struct ip *);
- ip->ip_tos = 0;
- ip->ip_off = 0;
- ip->ip_p = inp->inp_ip_p;
- ip->ip_len = m->m_pkthdr.len;
- ip->ip_src = inp->inp_laddr;
- ip->ip_dst.s_addr = dst;
- ip->ip_ttl = MAXTTL;
- } else {
- if (m->m_pkthdr.len > IP_MAXPACKET) {
- m_freem(m);
- return(EMSGSIZE);
- }
- ip = mtod(m, struct ip *);
- /* don't allow both user specified and setsockopt options,
- and don't allow packet length sizes that will crash */
- if (((IP_VHL_HL(ip->ip_vhl) != (sizeof (*ip) >> 2))
- && inp->inp_options)
- || (ip->ip_len > m->m_pkthdr.len)
- || (ip->ip_len < (IP_VHL_HL(ip->ip_vhl) << 2))) {
- m_freem(m);
- return EINVAL;
- }
- if (ip->ip_id == 0)
- ip->ip_id = htons(ip_id++);
- /* XXX prevent ip_output from overwriting header fields */
- flags |= IP_RAWOUTPUT;
- ipstat.ips_rawout++;
- }
- return (ip_output(m, inp->inp_options, &inp->inp_route, flags,
- inp->inp_moptions));
-}
-
-/*
- * Raw IP socket option processing.
- */
-int
-rip_ctloutput(op, so, level, optname, m)
- int op;
- struct socket *so;
- int level, optname;
- struct mbuf **m;
-{
- register struct inpcb *inp = sotoinpcb(so);
- register int error;
-
- if (level != IPPROTO_IP) {
- if (op == PRCO_SETOPT && *m)
- (void)m_free(*m);
- return (EINVAL);
- }
-
- switch (optname) {
-
- case IP_HDRINCL:
- error = 0;
- if (op == PRCO_SETOPT) {
- if (m == 0 || *m == 0 || (*m)->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(*m, int *))
- inp->inp_flags |= INP_HDRINCL;
- else
- inp->inp_flags &= ~INP_HDRINCL;
- if (*m)
- (void)m_free(*m);
- } else {
- *m = m_get(M_WAIT, MT_SOOPTS);
- (*m)->m_len = sizeof (int);
- *mtod(*m, int *) = inp->inp_flags & INP_HDRINCL;
- }
- return (error);
-
-#ifdef COMPAT_IPFW
- case IP_FW_GET:
- if (ip_fw_ctl_ptr == NULL || op == PRCO_SETOPT) {
- if (*m) (void)m_free(*m);
- return(EINVAL);
- }
- return (*ip_fw_ctl_ptr)(optname, m);
-
- case IP_FW_ADD:
- case IP_FW_DEL:
- case IP_FW_FLUSH:
- case IP_FW_ZERO:
- if (ip_fw_ctl_ptr == NULL || op != PRCO_SETOPT) {
- if (*m) (void)m_free(*m);
- return(EINVAL);
- }
- return (*ip_fw_ctl_ptr)(optname, m);
-
- case IP_NAT:
- if (ip_nat_ctl_ptr == NULL) {
- if (*m) (void)m_free(*m);
- return(EINVAL);
- }
- return (*ip_nat_ctl_ptr)(op, m);
-
-#endif
- case IP_RSVP_ON:
- return ip_rsvp_init(so);
- break;
-
- case IP_RSVP_OFF:
- return ip_rsvp_done();
- break;
-
- case IP_RSVP_VIF_ON:
- return ip_rsvp_vif_init(so, *m);
-
- case IP_RSVP_VIF_OFF:
- return ip_rsvp_vif_done(so, *m);
-
- case MRT_INIT:
- case MRT_DONE:
- case MRT_ADD_VIF:
- case MRT_DEL_VIF:
- case MRT_ADD_MFC:
- case MRT_DEL_MFC:
- case MRT_VERSION:
- case MRT_ASSERT:
- if (op == PRCO_SETOPT) {
- error = ip_mrouter_set(optname, so, *m);
- if (*m)
- (void)m_free(*m);
- } else if (op == PRCO_GETOPT) {
- error = ip_mrouter_get(optname, so, m);
- } else
- error = EINVAL;
- return (error);
- }
- return (ip_ctloutput(op, so, level, optname, m));
-}
-
-static u_long rip_sendspace = RIPSNDQ; /* XXX sysctl ? */
-static u_long rip_recvspace = RIPRCVQ; /* XXX sysctl ? */
-
-/*ARGSUSED*/
-int
-rip_usrreq(so, req, m, nam, control)
- register struct socket *so;
- int req;
- struct mbuf *m, *nam, *control;
-{
- register int error = 0;
- register struct inpcb *inp = sotoinpcb(so);
- int s;
-
- if (req == PRU_CONTROL)
- return (in_control(so, (u_long)m, (caddr_t)nam,
- (struct ifnet *)control));
-
- switch (req) {
-
- case PRU_ATTACH:
- if (inp)
- panic("rip_attach");
- if ((so->so_state & SS_PRIV) == 0) {
- error = EACCES;
- break;
- }
- s = splnet();
- error = in_pcballoc(so, &ripcbinfo);
- splx(s);
- if (error)
- break;
- error = soreserve(so, rip_sendspace, rip_recvspace);
- if (error)
- break;
- inp = (struct inpcb *)so->so_pcb;
- inp->inp_ip_p = (int)nam;
- break;
-
- case PRU_DISCONNECT:
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- error = ENOTCONN;
- break;
- }
- /* FALLTHROUGH */
- case PRU_ABORT:
- soisdisconnected(so);
- /* FALLTHROUGH */
- case PRU_DETACH:
- if (inp == 0)
- panic("rip_detach");
- if (so == ip_mrouter)
- ip_mrouter_done();
- ip_rsvp_force_done(so);
- if (so == ip_rsvpd)
- ip_rsvp_done();
- in_pcbdetach(inp);
- break;
-
- case PRU_BIND:
- {
- struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *);
-
- if (nam->m_len != sizeof(*addr)) {
- error = EINVAL;
- break;
- }
- if ((ifnet == 0) ||
- ((addr->sin_family != AF_INET) &&
- (addr->sin_family != AF_IMPLINK)) ||
- (addr->sin_addr.s_addr &&
- ifa_ifwithaddr((struct sockaddr *)addr) == 0)) {
- error = EADDRNOTAVAIL;
- break;
- }
- inp->inp_laddr = addr->sin_addr;
- break;
- }
- case PRU_CONNECT:
- {
- struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *);
-
- if (nam->m_len != sizeof(*addr)) {
- error = EINVAL;
- break;
- }
- if (ifnet == 0) {
- error = EADDRNOTAVAIL;
- break;
- }
- if ((addr->sin_family != AF_INET) &&
- (addr->sin_family != AF_IMPLINK)) {
- error = EAFNOSUPPORT;
- break;
- }
- inp->inp_faddr = addr->sin_addr;
- soisconnected(so);
- break;
- }
-
- case PRU_CONNECT2:
- error = EOPNOTSUPP;
- break;
-
- /*
- * Mark the connection as being incapable of further input.
- */
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- /*
- * Ship a packet out. The appropriate raw output
- * routine handles any massaging necessary.
- */
- case PRU_SEND:
- {
- register u_long dst;
-
- if (so->so_state & SS_ISCONNECTED) {
- if (nam) {
- error = EISCONN;
- break;
- }
- dst = inp->inp_faddr.s_addr;
- } else {
- if (nam == NULL) {
- error = ENOTCONN;
- break;
- }
- dst = mtod(nam, struct sockaddr_in *)->sin_addr.s_addr;
- }
- error = rip_output(m, so, dst);
- m = NULL;
- break;
- }
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- /*
- * Not supported.
- */
- case PRU_RCVOOB:
- case PRU_RCVD:
- case PRU_LISTEN:
- case PRU_ACCEPT:
- case PRU_SENDOOB:
- error = EOPNOTSUPP;
- break;
-
- case PRU_SOCKADDR:
- in_setsockaddr(inp, nam);
- break;
-
- case PRU_PEERADDR:
- in_setpeeraddr(inp, nam);
- break;
-
- default:
- panic("rip_usrreq");
- }
- if (m != NULL)
- m_freem(m);
- return (error);
-}
diff --git a/cpukit/libnetworking/netinet/tcp.h b/cpukit/libnetworking/netinet/tcp.h
deleted file mode 100644
index 3585917aa3..0000000000
--- a/cpukit/libnetworking/netinet/tcp.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_H_
-#define _NETINET_TCP_H_
-
-typedef u_long tcp_seq;
-typedef u_long tcp_cc; /* connection count per rfc1644 */
-
-/*
- * TCP header.
- * Per RFC 793, September, 1981.
- */
-struct tcphdr {
- u_short th_sport; /* source port */
- u_short th_dport; /* destination port */
- tcp_seq th_seq; /* sequence number */
- tcp_seq th_ack; /* acknowledgement number */
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_char th_x2:4, /* (unused) */
- th_off:4; /* data offset */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_char th_off:4, /* data offset */
- th_x2:4; /* (unused) */
-#endif
- u_char th_flags;
-#define TH_FIN 0x01
-#define TH_SYN 0x02
-#define TH_RST 0x04
-#define TH_PUSH 0x08
-#define TH_ACK 0x10
-#define TH_URG 0x20
-#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG)
-
- u_short th_win; /* window */
- u_short th_sum; /* checksum */
- u_short th_urp; /* urgent pointer */
-};
-
-#define TCPOPT_EOL 0
-#define TCPOPT_NOP 1
-#define TCPOPT_MAXSEG 2
-#define TCPOLEN_MAXSEG 4
-#define TCPOPT_WINDOW 3
-#define TCPOLEN_WINDOW 3
-#define TCPOPT_SACK_PERMITTED 4 /* Experimental */
-#define TCPOLEN_SACK_PERMITTED 2
-#define TCPOPT_SACK 5 /* Experimental */
-#define TCPOPT_TIMESTAMP 8
-#define TCPOLEN_TIMESTAMP 10
-#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
-#define TCPOPT_TSTAMP_HDR \
- (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
-
-#define TCPOPT_CC 11 /* CC options: RFC-1644 */
-#define TCPOPT_CCNEW 12
-#define TCPOPT_CCECHO 13
-#define TCPOLEN_CC 6
-#define TCPOLEN_CC_APPA (TCPOLEN_CC+2)
-#define TCPOPT_CC_HDR(ccopt) \
- (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC)
-
-/*
- * Default maximum segment size for TCP.
- * With an IP MSS of 576, this is 536,
- * but 512 is probably more convenient.
- * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
- */
-#define TCP_MSS 512
-
-#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
-#define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */
-
-#define TCP_MAX_WINSHIFT 14 /* maximum window shift */
-
-#define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */
-#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr))
- /* max space left for options */
-
-/*
- * User-settable options (used with setsockopt).
- */
-#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
-#define TCP_MAXSEG 0x02 /* set maximum segment size */
-#define TCP_NOPUSH 0x04 /* don't push last block of write */
-#define TCP_NOOPT 0x08 /* don't use TCP options */
-
-#endif
diff --git a/cpukit/libnetworking/netinet/tcp_debug.c b/cpukit/libnetworking/netinet/tcp_debug.c
deleted file mode 100644
index 864a01cb1a..0000000000
--- a/cpukit/libnetworking/netinet/tcp_debug.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_debug.c 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#ifdef TCPDEBUG
-/* load symbolic names */
-#define PRUREQUESTS
-#define TCPSTATES
-#define TCPTIMERS
-#define TANAMES
-#endif
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <net/route.h>
-#include <net/if.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#include <netinet/tcp_debug.h>
-
-#ifdef TCPDEBUG
-static int tcpconsdebug = 0;
-#endif
-
-static struct tcp_debug tcp_debug[TCP_NDEBUG];
-static int tcp_debx;
-
-/*
- * Tcp debug routines
- */
-void
-tcp_trace(act, ostate, tp, ti, req)
- short act, ostate;
- struct tcpcb *tp;
- struct tcpiphdr *ti;
- int req;
-{
-#ifdef TCPDEBUG
- tcp_seq seq, ack;
- int len, flags;
-#endif
- struct tcp_debug *td = &tcp_debug[tcp_debx++];
-
- if (tcp_debx == TCP_NDEBUG)
- tcp_debx = 0;
- td->td_time = iptime();
- td->td_act = act;
- td->td_ostate = ostate;
- td->td_tcb = (caddr_t)tp;
- if (tp)
- td->td_cb = *tp;
- else
- bzero((caddr_t)&td->td_cb, sizeof (*tp));
- if (ti)
- td->td_ti = *ti;
- else
- bzero((caddr_t)&td->td_ti, sizeof (*ti));
- td->td_req = req;
-#ifdef TCPDEBUG
- if (tcpconsdebug == 0)
- return;
- if (tp)
- printf("%p %s:", tp, tcpstates[ostate]);
- else
- printf("???????? ");
- printf("%s ", tanames[act]);
- switch (act) {
-
- case TA_INPUT:
- case TA_OUTPUT:
- case TA_DROP:
- if (ti == 0)
- break;
- seq = ti->ti_seq;
- ack = ti->ti_ack;
- len = ti->ti_len;
- if (act == TA_OUTPUT) {
- seq = ntohl(seq);
- ack = ntohl(ack);
- len = ntohs((u_short)len);
- }
- if (act == TA_OUTPUT)
- len -= sizeof (struct tcphdr);
- if (len)
- printf("[%x..%x)", seq, seq+len);
- else
- printf("%x", seq);
- printf("@%x, urp=%x", ack, ti->ti_urp);
- flags = ti->ti_flags;
- if (flags) {
- char *cp = "<";
-#define pf(f) { \
- if (ti->ti_flags & TH_##f) { \
- printf("%s%s", cp, #f); \
- cp = ","; \
- } \
-}
- pf(SYN); pf(ACK); pf(FIN); pf(RST); pf(PUSH); pf(URG);
- printf(">");
- }
- break;
-
- case TA_USER:
- printf("%s", prurequests[req&0xff]);
- if ((req & 0xff) == PRU_SLOWTIMO)
- printf("<%s>", tcptimers[req>>8]);
- break;
- }
- if (tp)
- printf(" -> %s", tcpstates[tp->t_state]);
- /* print out internal state of tp !?! */
- printf("\n");
- if (tp == 0)
- return;
- printf("\trcv_(nxt,wnd,up) (%x,%x,%x) snd_(una,nxt,max) (%x,%x,%x)\n",
- tp->rcv_nxt, tp->rcv_wnd, tp->rcv_up, tp->snd_una, tp->snd_nxt,
- tp->snd_max);
- printf("\tsnd_(wl1,wl2,wnd) (%x,%x,%x)\n",
- tp->snd_wl1, tp->snd_wl2, tp->snd_wnd);
-#endif /* TCPDEBUG */
-}
diff --git a/cpukit/libnetworking/netinet/tcp_debug.h b/cpukit/libnetworking/netinet/tcp_debug.h
deleted file mode 100644
index a33743b077..0000000000
--- a/cpukit/libnetworking/netinet/tcp_debug.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_debug.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_DEBUG_H_
-#define _NETINET_TCP_DEBUG_H_
-
-struct tcp_debug {
- n_time td_time;
- short td_act;
- short td_ostate;
- caddr_t td_tcb;
- struct tcpiphdr td_ti;
- short td_req;
- struct tcpcb td_cb;
-};
-
-#define TA_INPUT 0
-#define TA_OUTPUT 1
-#define TA_USER 2
-#define TA_RESPOND 3
-#define TA_DROP 4
-
-#ifdef TANAMES
-static char *tanames[] =
- { "input", "output", "user", "respond", "drop" };
-#endif
-
-#define TCP_NDEBUG 100
-
-#ifndef KERNEL
-/* XXX common variables for broken applications. */
-struct tcp_debug tcp_debug[TCP_NDEBUG];
-int tcp_debx;
-#endif
-
-#endif /* !_NETINET_TCP_DEBUG_H_ */
diff --git a/cpukit/libnetworking/netinet/tcp_fsm.h b/cpukit/libnetworking/netinet/tcp_fsm.h
deleted file mode 100644
index 3f2c12f54f..0000000000
--- a/cpukit/libnetworking/netinet/tcp_fsm.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_fsm.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_FSM_H_
-#define _NETINET_TCP_FSM_H_
-
-/*
- * TCP FSM state definitions.
- * Per RFC793, September, 1981.
- */
-
-#define TCP_NSTATES 11
-
-#define TCPS_CLOSED 0 /* closed */
-#define TCPS_LISTEN 1 /* listening for connection */
-#define TCPS_SYN_SENT 2 /* active, have sent syn */
-#define TCPS_SYN_RECEIVED 3 /* have send and received syn */
-/* states < TCPS_ESTABLISHED are those where connections not established */
-#define TCPS_ESTABLISHED 4 /* established */
-#define TCPS_CLOSE_WAIT 5 /* rcvd fin, waiting for close */
-/* states > TCPS_CLOSE_WAIT are those where user has closed */
-#define TCPS_FIN_WAIT_1 6 /* have closed, sent fin */
-#define TCPS_CLOSING 7 /* closed xchd FIN; await FIN ACK */
-#define TCPS_LAST_ACK 8 /* had fin and close; await FIN ACK */
-/* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */
-#define TCPS_FIN_WAIT_2 9 /* have closed, fin is acked */
-#define TCPS_TIME_WAIT 10 /* in 2*msl quiet wait after close */
-
-#define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED)
-#define TCPS_HAVEESTABLISHED(s) ((s) >= TCPS_ESTABLISHED)
-#define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT)
-
-#ifdef TCPOUTFLAGS
-/*
- * Flags used when sending segments in tcp_output.
- * Basic flags (TH_RST,TH_ACK,TH_SYN,TH_FIN) are totally
- * determined by state, with the proviso that TH_FIN is sent only
- * if all data queued for output is included in the segment.
- */
-static u_char tcp_outflags[TCP_NSTATES] = {
- TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK,
- TH_ACK, TH_ACK,
- TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK,
-};
-#endif
-
-#ifdef KPROF
-int tcp_acounts[TCP_NSTATES][PRU_NREQ];
-#endif
-
-#ifdef TCPSTATES
-char *tcpstates[] = {
- "CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD",
- "ESTABLISHED", "CLOSE_WAIT", "FIN_WAIT_1", "CLOSING",
- "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT",
-};
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/netinet/tcp_input.c b/cpukit/libnetworking/netinet/tcp_input.c
deleted file mode 100644
index bc55a79ae2..0000000000
--- a/cpukit/libnetworking/netinet/tcp_input.c
+++ /dev/null
@@ -1,2149 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995
- * 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.
- *
- * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#ifndef TUBA_INCLUDE
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-
-#include <machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-static struct tcpiphdr tcp_saveti;
-#endif
-
-static int tcprexmtthresh = 3;
-tcp_seq tcp_iss;
-tcp_cc tcp_ccgen;
-
-struct tcpstat tcpstat;
-SYSCTL_STRUCT(_net_inet_tcp, TCPCTL_STATS, stats,
- CTLFLAG_RD, &tcpstat , tcpstat, "");
-
-static int log_in_vain = 0;
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_in_vain, CTLFLAG_RW,
- &log_in_vain, 0, "");
-
-u_long tcp_now;
-struct inpcbhead tcb;
-struct inpcbinfo tcbinfo;
-
-static void tcp_dooptions __P((struct tcpcb *,
- u_char *, int, struct tcpiphdr *, struct tcpopt *));
-static void tcp_pulloutofband __P((struct socket *,
- struct tcpiphdr *, struct mbuf *));
-static int tcp_reass __P((struct tcpcb *, struct tcpiphdr *, struct mbuf *));
-static void tcp_xmit_timer __P((struct tcpcb *, int));
-
-#endif /* TUBA_INCLUDE */
-
-/*
- * Insert segment ti into reassembly queue of tcp with
- * control block tp. Return TH_FIN if reassembly now includes
- * a segment with FIN. The macro form does the common case inline
- * (segment is the next to be received on an established connection,
- * and the queue is empty), avoiding linkage into and removal
- * from the queue and repetition of various conversions.
- * Set DELACK for segments received in order, but ack immediately
- * when segments are out of order (so fast retransmit can work).
- */
-#ifdef TCP_ACK_HACK
-#define TCP_REASS(tp, ti, m, so, flags) { \
- if ((ti)->ti_seq == (tp)->rcv_nxt && \
- (tp)->seg_next == (struct tcpiphdr *)(tp) && \
- (tp)->t_state == TCPS_ESTABLISHED) { \
- if (ti->ti_flags & TH_PUSH) \
- tp->t_flags |= TF_ACKNOW; \
- else \
- tp->t_flags |= TF_DELACK; \
- (tp)->rcv_nxt += (ti)->ti_len; \
- flags = (ti)->ti_flags & TH_FIN; \
- tcpstat.tcps_rcvpack++;\
- tcpstat.tcps_rcvbyte += (ti)->ti_len;\
- sbappend(&(so)->so_rcv, (m)); \
- sorwakeup(so); \
- } else { \
- (flags) = tcp_reass((tp), (ti), (m)); \
- tp->t_flags |= TF_ACKNOW; \
- } \
-}
-#else
-#define TCP_REASS(tp, ti, m, so, flags) { \
- if ((ti)->ti_seq == (tp)->rcv_nxt && \
- (tp)->seg_next == (struct tcpiphdr *)(tp) && \
- (tp)->t_state == TCPS_ESTABLISHED) { \
- tp->t_flags |= TF_DELACK; \
- (tp)->rcv_nxt += (ti)->ti_len; \
- flags = (ti)->ti_flags & TH_FIN; \
- tcpstat.tcps_rcvpack++;\
- tcpstat.tcps_rcvbyte += (ti)->ti_len;\
- sbappend(&(so)->so_rcv, (m)); \
- sorwakeup(so); \
- } else { \
- (flags) = tcp_reass((tp), (ti), (m)); \
- tp->t_flags |= TF_ACKNOW; \
- } \
-}
-#endif
-#ifndef TUBA_INCLUDE
-
-static int
-tcp_reass(tp, ti, m)
- register struct tcpcb *tp;
- register struct tcpiphdr *ti;
- struct mbuf *m;
-{
- register struct tcpiphdr *q;
- struct socket *so = tp->t_inpcb->inp_socket;
- int flags;
-
- /*
- * Call with ti==0 after become established to
- * force pre-ESTABLISHED data up to user socket.
- */
- if (ti == 0)
- goto present;
-
- /*
- * Find a segment which begins after this one does.
- */
- for (q = tp->seg_next; q != (struct tcpiphdr *)tp;
- q = (struct tcpiphdr *)q->ti_next)
- if (SEQ_GT(q->ti_seq, ti->ti_seq))
- break;
-
- /*
- * If there is a preceding segment, it may provide some of
- * our data already. If so, drop the data from the incoming
- * segment. If it provides all of our data, drop us.
- */
- if ((struct tcpiphdr *)q->ti_prev != (struct tcpiphdr *)tp) {
- register int i;
- q = (struct tcpiphdr *)q->ti_prev;
- /* conversion to int (in i) handles seq wraparound */
- i = q->ti_seq + q->ti_len - ti->ti_seq;
- if (i > 0) {
- if (i >= ti->ti_len) {
- tcpstat.tcps_rcvduppack++;
- tcpstat.tcps_rcvdupbyte += ti->ti_len;
- m_freem(m);
- /*
- * Try to present any queued data
- * at the left window edge to the user.
- * This is needed after the 3-WHS
- * completes.
- */
- goto present; /* ??? */
- }
- m_adj(m, i);
- ti->ti_len -= i;
- ti->ti_seq += i;
- }
- q = (struct tcpiphdr *)(q->ti_next);
- }
- tcpstat.tcps_rcvoopack++;
- tcpstat.tcps_rcvoobyte += ti->ti_len;
- REASS_MBUF(ti) = m; /* XXX */
-
- /*
- * While we overlap succeeding segments trim them or,
- * if they are completely covered, dequeue them.
- */
- while (q != (struct tcpiphdr *)tp) {
- register int i = (ti->ti_seq + ti->ti_len) - q->ti_seq;
- if (i <= 0)
- break;
- if (i < q->ti_len) {
- q->ti_seq += i;
- q->ti_len -= i;
- m_adj(REASS_MBUF(q), i);
- break;
- }
- q = (struct tcpiphdr *)q->ti_next;
- m = REASS_MBUF((struct tcpiphdr *)q->ti_prev);
- remque(q->ti_prev);
- m_freem(m);
- }
-
- /*
- * Stick new segment in its place.
- */
- insque(ti, q->ti_prev);
-
-present:
- /*
- * Present data to user, advancing rcv_nxt through
- * completed sequence space.
- */
- if (!TCPS_HAVEESTABLISHED(tp->t_state))
- return (0);
- ti = tp->seg_next;
- if (ti == (struct tcpiphdr *)tp || ti->ti_seq != tp->rcv_nxt)
- return (0);
- do {
- tp->rcv_nxt += ti->ti_len;
- flags = ti->ti_flags & TH_FIN;
- remque(ti);
- m = REASS_MBUF(ti);
- ti = (struct tcpiphdr *)ti->ti_next;
- if (so->so_state & SS_CANTRCVMORE)
- m_freem(m);
- else
- sbappend(&so->so_rcv, m);
- } while (ti != (struct tcpiphdr *)tp && ti->ti_seq == tp->rcv_nxt);
- sorwakeup(so);
- return (flags);
-}
-
-/*
- * TCP input routine, follows pages 65-76 of the
- * protocol specification dated September, 1981 very closely.
- */
-void
-tcp_input(m, iphlen)
- register struct mbuf *m;
- int iphlen;
-{
- register struct tcpiphdr *ti;
- register struct inpcb *inp;
- u_char *optp = NULL;
- int optlen = 0;
- int len, tlen, off;
- register struct tcpcb *tp = 0;
- register int tiflags;
- struct socket *so = 0;
- int todrop, acked, ourfinisacked, needoutput = 0;
- struct in_addr laddr;
- int dropsocket = 0;
- int iss = 0;
- u_long tiwin;
- struct tcpopt to; /* options in this segment */
- struct rmxp_tao *taop; /* pointer to our TAO cache entry */
- struct rmxp_tao tao_noncached; /* in case there's no cached entry */
-#ifdef TCPDEBUG
- short ostate = 0;
-#endif
-
- bzero((char *)&to, sizeof(to));
-
- tcpstat.tcps_rcvtotal++;
- /*
- * Get IP and TCP header together in first mbuf.
- * Note: IP leaves IP header in first mbuf.
- */
- ti = mtod(m, struct tcpiphdr *);
- if (iphlen > sizeof (struct ip))
- ip_stripoptions(m, (struct mbuf *)0);
- if (m->m_len < sizeof (struct tcpiphdr)) {
- if ((m = m_pullup(m, sizeof (struct tcpiphdr))) == 0) {
- tcpstat.tcps_rcvshort++;
- return;
- }
- ti = mtod(m, struct tcpiphdr *);
- }
-
- /*
- * Checksum extended TCP header and data.
- */
- tlen = ((struct ip *)ti)->ip_len;
- len = sizeof (struct ip) + tlen;
- ti->ti_next = ti->ti_prev = 0;
- ti->ti_x1 = 0;
- ti->ti_len = (u_short)tlen;
- HTONS(ti->ti_len);
- ti->ti_sum = in_cksum(m, len);
- if (ti->ti_sum) {
- tcpstat.tcps_rcvbadsum++;
- goto drop;
- }
-#endif /* TUBA_INCLUDE */
-
- /*
- * Check that TCP offset makes sense,
- * pull out TCP options and adjust length. XXX
- */
- off = ti->ti_off << 2;
- if (off < sizeof (struct tcphdr) || off > tlen) {
- tcpstat.tcps_rcvbadoff++;
- goto drop;
- }
- tlen -= off;
- ti->ti_len = tlen;
- if (off > sizeof (struct tcphdr)) {
- if (m->m_len < sizeof(struct ip) + off) {
- if ((m = m_pullup(m, sizeof (struct ip) + off)) == 0) {
- tcpstat.tcps_rcvshort++;
- return;
- }
- ti = mtod(m, struct tcpiphdr *);
- }
- optlen = off - sizeof (struct tcphdr);
- optp = mtod(m, u_char *) + sizeof (struct tcpiphdr);
- }
- tiflags = ti->ti_flags;
-
- /*
- * Convert TCP protocol specific fields to host format.
- */
- NTOHL(ti->ti_seq);
- NTOHL(ti->ti_ack);
- NTOHS(ti->ti_win);
- NTOHS(ti->ti_urp);
-
- /*
- * Drop TCP, IP headers and TCP options.
- */
- m->m_data += sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
- m->m_len -= sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
-
- /*
- * Locate pcb for segment.
- */
-findpcb:
- inp = in_pcblookuphash(&tcbinfo, ti->ti_src, ti->ti_sport,
- ti->ti_dst, ti->ti_dport, 1);
-
- /*
- * If the state is CLOSED (i.e., TCB does not exist) then
- * all data in the incoming segment is discarded.
- * If the TCB exists but is in CLOSED state, it is embryonic,
- * but should either do a listen or a connect soon.
- */
- if (inp == NULL) {
- if (log_in_vain && tiflags & TH_SYN) {
- char buf[4*sizeof "123"];
-
- strcpy(buf, inet_ntoa(ti->ti_dst));
- log(LOG_INFO, "Connection attempt to TCP %s:%d"
- " from %s:%d\n",
- buf, ntohs(ti->ti_dport),
- inet_ntoa(ti->ti_src), ntohs(ti->ti_sport));
- }
- goto dropwithreset;
- }
- tp = intotcpcb(inp);
- if (tp == 0)
- goto dropwithreset;
- if (tp->t_state == TCPS_CLOSED)
- goto drop;
-
- /* Unscale the window into a 32-bit value. */
- if ((tiflags & TH_SYN) == 0)
- tiwin = ti->ti_win << tp->snd_scale;
- else
- tiwin = ti->ti_win;
-
- so = inp->inp_socket;
- if (so->so_options & (SO_DEBUG|SO_ACCEPTCONN)) {
-#ifdef TCPDEBUG
- if (so->so_options & SO_DEBUG) {
- ostate = tp->t_state;
- tcp_saveti = *ti;
- }
-#endif
- if (so->so_options & SO_ACCEPTCONN) {
- register struct tcpcb *tp0 = tp;
- struct socket *so2;
- if ((tiflags & (TH_RST|TH_ACK|TH_SYN)) != TH_SYN) {
- /*
- * Note: dropwithreset makes sure we don't
- * send a RST in response to a RST.
- */
- if (tiflags & TH_ACK) {
- tcpstat.tcps_badsyn++;
- goto dropwithreset;
- }
- goto drop;
- }
- so2 = sonewconn(so, 0);
- if (so2 == 0) {
- tcpstat.tcps_listendrop++;
- so2 = sodropablereq(so);
- if (so2) {
- tcp_drop(sototcpcb(so2), ETIMEDOUT);
- so2 = sonewconn(so, 0);
- }
- if (!so2)
- goto drop;
- }
- so = so2;
- /*
- * This is ugly, but ....
- *
- * Mark socket as temporary until we're
- * committed to keeping it. The code at
- * ``drop'' and ``dropwithreset'' check the
- * flag dropsocket to see if the temporary
- * socket created here should be discarded.
- * We mark the socket as discardable until
- * we're committed to it below in TCPS_LISTEN.
- */
- dropsocket++;
- inp = (struct inpcb *)so->so_pcb;
- inp->inp_laddr = ti->ti_dst;
- inp->inp_lport = ti->ti_dport;
- in_pcbrehash(inp);
-#if BSD>=43
- inp->inp_options = ip_srcroute();
-#endif
- tp = intotcpcb(inp);
- tp->t_state = TCPS_LISTEN;
- tp->t_flags |= tp0->t_flags & (TF_NOPUSH|TF_NOOPT);
-
- /* Compute proper scaling value from buffer space */
- while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
- TCP_MAXWIN << tp->request_r_scale < so->so_rcv.sb_hiwat)
- tp->request_r_scale++;
- }
- }
-
- /*
- * Segment received on connection.
- * Reset idle time and keep-alive timer.
- */
- tp->t_idle = 0;
- if (TCPS_HAVEESTABLISHED(tp->t_state))
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
-
- /*
- * Process options if not in LISTEN state,
- * else do it below (after getting remote address).
- */
- if (tp->t_state != TCPS_LISTEN)
- tcp_dooptions(tp, optp, optlen, ti, &to);
-
- /*
- * Header prediction: check for the two common cases
- * of a uni-directional data xfer. If the packet has
- * no control flags, is in-sequence, the window didn't
- * change and we're not retransmitting, it's a
- * candidate. If the length is zero and the ack moved
- * forward, we're the sender side of the xfer. Just
- * free the data acked & wake any higher level process
- * that was blocked waiting for space. If the length
- * is non-zero and the ack didn't move, we're the
- * receiver side. If we're getting packets in-order
- * (the reassembly queue is empty), add the data to
- * the socket buffer and note that we need a delayed ack.
- * Make sure that the hidden state-flags are also off.
- * Since we check for TCPS_ESTABLISHED above, it can only
- * be TH_NEEDSYN.
- */
- if (tp->t_state == TCPS_ESTABLISHED &&
- (tiflags & (TH_SYN|TH_FIN|TH_RST|TH_URG|TH_ACK)) == TH_ACK &&
- ((tp->t_flags & (TF_NEEDSYN|TF_NEEDFIN)) == 0) &&
- ((to.to_flag & TOF_TS) == 0 ||
- TSTMP_GEQ(to.to_tsval, tp->ts_recent)) &&
- /*
- * Using the CC option is compulsory if once started:
- * the segment is OK if no T/TCP was negotiated or
- * if the segment has a CC option equal to CCrecv
- */
- ((tp->t_flags & (TF_REQ_CC|TF_RCVD_CC)) != (TF_REQ_CC|TF_RCVD_CC) ||
- ((to.to_flag & TOF_CC) != 0 && to.to_cc == tp->cc_recv)) &&
- ti->ti_seq == tp->rcv_nxt &&
- tiwin && tiwin == tp->snd_wnd &&
- tp->snd_nxt == tp->snd_max) {
-
- /*
- * If last ACK falls within this segment's sequence numbers,
- * record the timestamp.
- * NOTE that the test is modified according to the latest
- * proposal of the tcplw@cray.com list (Braden 1993/04/26).
- */
- if ((to.to_flag & TOF_TS) != 0 &&
- SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) {
- tp->ts_recent_age = tcp_now;
- tp->ts_recent = to.to_tsval;
- }
-
- if (ti->ti_len == 0) {
- if (SEQ_GT(ti->ti_ack, tp->snd_una) &&
- SEQ_LEQ(ti->ti_ack, tp->snd_max) &&
- tp->snd_cwnd >= tp->snd_wnd &&
- tp->t_dupacks < tcprexmtthresh) {
- /*
- * this is a pure ack for outstanding data.
- */
- ++tcpstat.tcps_predack;
- if ((to.to_flag & TOF_TS) != 0)
- tcp_xmit_timer(tp,
- tcp_now - to.to_tsecr + 1);
- else if (tp->t_rtt &&
- SEQ_GT(ti->ti_ack, tp->t_rtseq))
- tcp_xmit_timer(tp, tp->t_rtt);
- acked = ti->ti_ack - tp->snd_una;
- tcpstat.tcps_rcvackpack++;
- tcpstat.tcps_rcvackbyte += acked;
- sbdrop(&so->so_snd, acked);
- tp->snd_una = ti->ti_ack;
- m_freem(m);
-
- /*
- * If all outstanding data are acked, stop
- * retransmit timer, otherwise restart timer
- * using current (possibly backed-off) value.
- * If process is waiting for space,
- * wakeup/selwakeup/signal. If data
- * are ready to send, let tcp_output
- * decide between more output or persist.
- */
- if (tp->snd_una == tp->snd_max)
- tp->t_timer[TCPT_REXMT] = 0;
- else if (tp->t_timer[TCPT_PERSIST] == 0)
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
-
- if (so->so_snd.sb_flags & SB_NOTIFY)
- sowwakeup(so);
- if (so->so_snd.sb_cc)
- (void) tcp_output(tp);
- return;
- }
- } else if (ti->ti_ack == tp->snd_una &&
- tp->seg_next == (struct tcpiphdr *)tp &&
- ti->ti_len <= sbspace(&so->so_rcv)) {
- /*
- * this is a pure, in-sequence data packet
- * with nothing on the reassembly queue and
- * we have enough buffer space to take it.
- */
- ++tcpstat.tcps_preddat;
- tp->rcv_nxt += ti->ti_len;
- tcpstat.tcps_rcvpack++;
- tcpstat.tcps_rcvbyte += ti->ti_len;
- /*
- * Add data to socket buffer.
- */
- sbappend(&so->so_rcv, m);
- sorwakeup(so);
-#ifdef TCP_ACK_HACK
- /*
- * If this is a short packet, then ACK now - with Nagel
- * congestion avoidance sender won't send more until
- * he gets an ACK.
- */
- if (tiflags & TH_PUSH) {
- tp->t_flags |= TF_ACKNOW;
- tcp_output(tp);
- } else {
- tp->t_flags |= TF_DELACK;
- }
-#else
- tp->t_flags |= TF_DELACK;
-#endif
- return;
- }
- }
-
- /*
- * Calculate amount of space in receive window,
- * and then do TCP input processing.
- * Receive window is amount of space in rcv queue,
- * but not less than advertised window.
- */
- { int win;
-
- win = sbspace(&so->so_rcv);
- if (win < 0)
- win = 0;
- tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt));
- }
-
- switch (tp->t_state) {
-
- /*
- * If the state is LISTEN then ignore segment if it contains an RST.
- * If the segment contains an ACK then it is bad and send a RST.
- * If it does not contain a SYN then it is not interesting; drop it.
- * If it is from this socket, drop it, it must be forged.
- * Don't bother responding if the destination was a broadcast.
- * Otherwise initialize tp->rcv_nxt, and tp->irs, select an initial
- * tp->iss, and send a segment:
- * <SEQ=ISS><ACK=RCV_NXT><CTL=SYN,ACK>
- * Also initialize tp->snd_nxt to tp->iss+1 and tp->snd_una to tp->iss.
- * Fill in remote peer address fields if not previously specified.
- * Enter SYN_RECEIVED state, and process any other fields of this
- * segment in this state.
- */
- case TCPS_LISTEN: {
- struct mbuf *am;
- register struct sockaddr_in *sin;
-
- if (tiflags & TH_RST)
- goto drop;
- if (tiflags & TH_ACK)
- goto dropwithreset;
- if ((tiflags & TH_SYN) == 0)
- goto drop;
- if ((ti->ti_dport == ti->ti_sport) &&
- (ti->ti_dst.s_addr == ti->ti_src.s_addr))
- goto drop;
- /*
- * RFC1122 4.2.3.10, p. 104: discard bcast/mcast SYN
- * in_broadcast() should never return true on a received
- * packet with M_BCAST not set.
- */
- if (m->m_flags & (M_BCAST|M_MCAST) ||
- IN_MULTICAST(ntohl(ti->ti_dst.s_addr)))
- goto drop;
- am = m_get(M_DONTWAIT, MT_SONAME); /* XXX */
- if (am == NULL)
- goto drop;
- am->m_len = sizeof (struct sockaddr_in);
- sin = mtod(am, struct sockaddr_in *);
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_addr = ti->ti_src;
- sin->sin_port = ti->ti_sport;
- bzero((caddr_t)sin->sin_zero, sizeof(sin->sin_zero));
- laddr = inp->inp_laddr;
- if (inp->inp_laddr.s_addr == INADDR_ANY)
- inp->inp_laddr = ti->ti_dst;
- if (in_pcbconnect(inp, am)) {
- inp->inp_laddr = laddr;
- (void) m_free(am);
- goto drop;
- }
- (void) m_free(am);
- tp->t_template = tcp_template(tp);
- if (tp->t_template == 0) {
- tp = tcp_drop(tp, ENOBUFS);
- dropsocket = 0; /* socket is already gone */
- goto drop;
- }
- if ((taop = tcp_gettaocache(inp)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
- tcp_dooptions(tp, optp, optlen, ti, &to);
- if (iss)
- tp->iss = iss;
- else
- tp->iss = tcp_iss;
- tcp_iss += TCP_ISSINCR/4;
- tp->irs = ti->ti_seq;
- tcp_sendseqinit(tp);
- tcp_rcvseqinit(tp);
- /*
- * Initialization of the tcpcb for transaction;
- * set SND.WND = SEG.WND,
- * initialize CCsend and CCrecv.
- */
- tp->snd_wnd = tiwin; /* initial send-window */
- tp->cc_send = CC_INC(tcp_ccgen);
- tp->cc_recv = to.to_cc;
- /*
- * Perform TAO test on incoming CC (SEG.CC) option, if any.
- * - compare SEG.CC against cached CC from the same host,
- * if any.
- * - if SEG.CC > chached value, SYN must be new and is accepted
- * immediately: save new CC in the cache, mark the socket
- * connected, enter ESTABLISHED state, turn on flag to
- * send a SYN in the next segment.
- * A virtual advertised window is set in rcv_adv to
- * initialize SWS prevention. Then enter normal segment
- * processing: drop SYN, process data and FIN.
- * - otherwise do a normal 3-way handshake.
- */
- if ((to.to_flag & TOF_CC) != 0) {
- if (taop->tao_cc != 0 && CC_GT(to.to_cc, taop->tao_cc)) {
- taop->tao_cc = to.to_cc;
- tp->t_state = TCPS_ESTABLISHED;
-
- /*
- * If there is a FIN, or if there is data and the
- * connection is local, then delay SYN,ACK(SYN) in
- * the hope of piggy-backing it on a response
- * segment. Otherwise must send ACK now in case
- * the other side is slow starting.
- */
- if ((tiflags & TH_FIN) || (ti->ti_len != 0 &&
- in_localaddr(inp->inp_faddr)))
- tp->t_flags |= (TF_DELACK | TF_NEEDSYN);
- else
- tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN);
-
- /*
- * Limit the `virtual advertised window' to TCP_MAXWIN
- * here. Even if we requested window scaling, it will
- * become effective only later when our SYN is acked.
- */
- tp->rcv_adv += min(tp->rcv_wnd, TCP_MAXWIN);
- tcpstat.tcps_connects++;
- soisconnected(so);
- tp->t_timer[TCPT_KEEP] = tcp_keepinit;
- dropsocket = 0; /* committed to socket */
- tcpstat.tcps_accepts++;
- goto trimthenstep6;
- }
- /* else do standard 3-way handshake */
- } else {
- /*
- * No CC option, but maybe CC.NEW:
- * invalidate cached value.
- */
- taop->tao_cc = 0;
- }
- /*
- * TAO test failed or there was no CC option,
- * do a standard 3-way handshake.
- */
- tp->t_flags |= TF_ACKNOW;
- tp->t_state = TCPS_SYN_RECEIVED;
- tp->t_timer[TCPT_KEEP] = tcp_keepinit;
- dropsocket = 0; /* committed to socket */
- tcpstat.tcps_accepts++;
- goto trimthenstep6;
- }
-
- /*
- * If the state is SYN_RECEIVED:
- * if seg contains SYN/ACK, send a RST.
- * if seg contains an ACK, but not for our SYN/ACK, send a RST.
- */
- case TCPS_SYN_RECEIVED:
- if (tiflags & TH_ACK) {
- if (tiflags & TH_SYN) {
- tcpstat.tcps_badsyn++;
- goto dropwithreset;
- }
- if (SEQ_LEQ(ti->ti_ack, tp->snd_una) ||
- SEQ_GT(ti->ti_ack, tp->snd_max))
- goto dropwithreset;
- }
- break;
-
- /*
- * If the state is SYN_SENT:
- * if seg contains an ACK, but not for our SYN, drop the input.
- * if seg contains a RST, then drop the connection.
- * if seg does not contain SYN, then drop it.
- * Otherwise this is an acceptable SYN segment
- * initialize tp->rcv_nxt and tp->irs
- * if seg contains ack then advance tp->snd_una
- * if SYN has been acked change to ESTABLISHED else SYN_RCVD state
- * arrange for segment to be acked (eventually)
- * continue processing rest of data/controls, beginning with URG
- */
- case TCPS_SYN_SENT:
- if ((taop = tcp_gettaocache(inp)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
-
- if ((tiflags & TH_ACK) &&
- (SEQ_LEQ(ti->ti_ack, tp->iss) ||
- SEQ_GT(ti->ti_ack, tp->snd_max))) {
- /*
- * If we have a cached CCsent for the remote host,
- * hence we haven't just crashed and restarted,
- * do not send a RST. This may be a retransmission
- * from the other side after our earlier ACK was lost.
- * Our new SYN, when it arrives, will serve as the
- * needed ACK.
- */
- if (taop->tao_ccsent != 0)
- goto drop;
- else
- goto dropwithreset;
- }
- if (tiflags & TH_RST) {
- if (tiflags & TH_ACK)
- tp = tcp_drop(tp, ECONNREFUSED);
- goto drop;
- }
- if ((tiflags & TH_SYN) == 0)
- goto drop;
- tp->snd_wnd = ti->ti_win; /* initial send window */
- tp->cc_recv = to.to_cc; /* foreign CC */
-
- tp->irs = ti->ti_seq;
- tcp_rcvseqinit(tp);
- if (tiflags & TH_ACK) {
- /*
- * Our SYN was acked. If segment contains CC.ECHO
- * option, check it to make sure this segment really
- * matches our SYN. If not, just drop it as old
- * duplicate, but send an RST if we're still playing
- * by the old rules. If no CC.ECHO option, make sure
- * we don't get fooled into using T/TCP.
- */
- if (to.to_flag & TOF_CCECHO) {
- if (tp->cc_send != to.to_ccecho)
- if (taop->tao_ccsent != 0)
- goto drop;
- else
- goto dropwithreset;
- } else
- tp->t_flags &= ~TF_RCVD_CC;
- tcpstat.tcps_connects++;
- soisconnected(so);
- /* Do window scaling on this connection? */
- if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
- (TF_RCVD_SCALE|TF_REQ_SCALE)) {
- tp->snd_scale = tp->requested_s_scale;
- tp->rcv_scale = tp->request_r_scale;
- }
- /* Segment is acceptable, update cache if undefined. */
- if (taop->tao_ccsent == 0)
- taop->tao_ccsent = to.to_ccecho;
-
- tp->rcv_adv += tp->rcv_wnd;
- tp->snd_una++; /* SYN is acked */
- /*
- * If there's data, delay ACK; if there's also a FIN
- * ACKNOW will be turned on later.
- */
- if (ti->ti_len != 0)
- tp->t_flags |= TF_DELACK;
- else
- tp->t_flags |= TF_ACKNOW;
- /*
- * Received <SYN,ACK> in SYN_SENT[*] state.
- * Transitions:
- * SYN_SENT --> ESTABLISHED
- * SYN_SENT* --> FIN_WAIT_1
- */
- if (tp->t_flags & TF_NEEDFIN) {
- tp->t_state = TCPS_FIN_WAIT_1;
- tp->t_flags &= ~TF_NEEDFIN;
- tiflags &= ~TH_SYN;
- } else {
- tp->t_state = TCPS_ESTABLISHED;
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- }
- } else {
- /*
- * Received initial SYN in SYN-SENT[*] state => simul-
- * taneous open. If segment contains CC option and there is
- * a cached CC, apply TAO test; if it succeeds, connection is
- * half-synchronized. Otherwise, do 3-way handshake:
- * SYN-SENT -> SYN-RECEIVED
- * SYN-SENT* -> SYN-RECEIVED*
- * If there was no CC option, clear cached CC value.
- */
- tp->t_flags |= TF_ACKNOW;
- tp->t_timer[TCPT_REXMT] = 0;
- if (to.to_flag & TOF_CC) {
- if (taop->tao_cc != 0 &&
- CC_GT(to.to_cc, taop->tao_cc)) {
- /*
- * update cache and make transition:
- * SYN-SENT -> ESTABLISHED*
- * SYN-SENT* -> FIN-WAIT-1*
- */
- taop->tao_cc = to.to_cc;
- if (tp->t_flags & TF_NEEDFIN) {
- tp->t_state = TCPS_FIN_WAIT_1;
- tp->t_flags &= ~TF_NEEDFIN;
- } else {
- tp->t_state = TCPS_ESTABLISHED;
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- }
- tp->t_flags |= TF_NEEDSYN;
- } else
- tp->t_state = TCPS_SYN_RECEIVED;
- } else {
- /* CC.NEW or no option => invalidate cache */
- taop->tao_cc = 0;
- tp->t_state = TCPS_SYN_RECEIVED;
- }
- }
-
-trimthenstep6:
- /*
- * Advance ti->ti_seq to correspond to first data byte.
- * If data, trim to stay within window,
- * dropping FIN if necessary.
- */
- ti->ti_seq++;
- if (ti->ti_len > tp->rcv_wnd) {
- todrop = ti->ti_len - tp->rcv_wnd;
- m_adj(m, -todrop);
- ti->ti_len = tp->rcv_wnd;
- tiflags &= ~TH_FIN;
- tcpstat.tcps_rcvpackafterwin++;
- tcpstat.tcps_rcvbyteafterwin += todrop;
- }
- tp->snd_wl1 = ti->ti_seq - 1;
- tp->rcv_up = ti->ti_seq;
- /*
- * Client side of transaction: already sent SYN and data.
- * If the remote host used T/TCP to validate the SYN,
- * our data will be ACK'd; if so, enter normal data segment
- * processing in the middle of step 5, ack processing.
- * Otherwise, goto step 6.
- */
- if (tiflags & TH_ACK)
- goto process_ACK;
- goto step6;
- /*
- * If the state is LAST_ACK or CLOSING or TIME_WAIT:
- * if segment contains a SYN and CC [not CC.NEW] option:
- * if state == TIME_WAIT and connection duration > MSL,
- * drop packet and send RST;
- *
- * if SEG.CC > CCrecv then is new SYN, and can implicitly
- * ack the FIN (and data) in retransmission queue.
- * Complete close and delete TCPCB. Then reprocess
- * segment, hoping to find new TCPCB in LISTEN state;
- *
- * else must be old SYN; drop it.
- * else do normal processing.
- */
- case TCPS_LAST_ACK:
- case TCPS_CLOSING:
- case TCPS_TIME_WAIT:
- if ((tiflags & TH_SYN) &&
- (to.to_flag & TOF_CC) && tp->cc_recv != 0) {
- if (tp->t_state == TCPS_TIME_WAIT &&
- tp->t_duration > TCPTV_MSL)
- goto dropwithreset;
- if (CC_GT(to.to_cc, tp->cc_recv)) {
- tp = tcp_close(tp);
- goto findpcb;
- }
- else
- goto drop;
- }
- break; /* continue normal processing */
- }
-
- /*
- * States other than LISTEN or SYN_SENT.
- * First check timestamp, if present.
- * Then check the connection count, if present.
- * Then check that at least some bytes of segment are within
- * receive window. If segment begins before rcv_nxt,
- * drop leading data (and SYN); if nothing left, just ack.
- *
- * RFC 1323 PAWS: If we have a timestamp reply on this segment
- * and it's less than ts_recent, drop it.
- */
- if ((to.to_flag & TOF_TS) != 0 && (tiflags & TH_RST) == 0 &&
- tp->ts_recent && TSTMP_LT(to.to_tsval, tp->ts_recent)) {
-
- /* Check to see if ts_recent is over 24 days old. */
- if ((int)(tcp_now - tp->ts_recent_age) > TCP_PAWS_IDLE) {
- /*
- * Invalidate ts_recent. If this segment updates
- * ts_recent, the age will be reset later and ts_recent
- * will get a valid value. If it does not, setting
- * ts_recent to zero will at least satisfy the
- * requirement that zero be placed in the timestamp
- * echo reply when ts_recent isn't valid. The
- * age isn't reset until we get a valid ts_recent
- * because we don't want out-of-order segments to be
- * dropped when ts_recent is old.
- */
- tp->ts_recent = 0;
- } else {
- tcpstat.tcps_rcvduppack++;
- tcpstat.tcps_rcvdupbyte += ti->ti_len;
- tcpstat.tcps_pawsdrop++;
- goto dropafterack;
- }
- }
-
- /*
- * T/TCP mechanism
- * If T/TCP was negotiated and the segment doesn't have CC,
- * or if it's CC is wrong then drop the segment.
- * RST segments do not have to comply with this.
- */
- if ((tp->t_flags & (TF_REQ_CC|TF_RCVD_CC)) == (TF_REQ_CC|TF_RCVD_CC) &&
- ((to.to_flag & TOF_CC) == 0 || tp->cc_recv != to.to_cc) &&
- (tiflags & TH_RST) == 0)
- goto dropafterack;
-
- todrop = tp->rcv_nxt - ti->ti_seq;
- if (todrop > 0) {
- if (tiflags & TH_SYN) {
- tiflags &= ~TH_SYN;
- ti->ti_seq++;
- if (ti->ti_urp > 1)
- ti->ti_urp--;
- else
- tiflags &= ~TH_URG;
- todrop--;
- }
- /*
- * Following if statement from Stevens, vol. 2, p. 960.
- */
- if (todrop > ti->ti_len
- || (todrop == ti->ti_len && (tiflags & TH_FIN) == 0)) {
- /*
- * Any valid FIN must be to the left of the window.
- * At this point the FIN must be a duplicate or out
- * of sequence; drop it.
- */
- tiflags &= ~TH_FIN;
-
- /*
- * Send an ACK to resynchronize and drop any data.
- * But keep on processing for RST or ACK.
- */
- tp->t_flags |= TF_ACKNOW;
- todrop = ti->ti_len;
- tcpstat.tcps_rcvduppack++;
- tcpstat.tcps_rcvdupbyte += todrop;
- } else {
- tcpstat.tcps_rcvpartduppack++;
- tcpstat.tcps_rcvpartdupbyte += todrop;
- }
- m_adj(m, todrop);
- ti->ti_seq += todrop;
- ti->ti_len -= todrop;
- if (ti->ti_urp > todrop)
- ti->ti_urp -= todrop;
- else {
- tiflags &= ~TH_URG;
- ti->ti_urp = 0;
- }
- }
-
- /*
- * If new data are received on a connection after the
- * user processes are gone, then RST the other end.
- */
- if ((so->so_state & SS_NOFDREF) &&
- tp->t_state > TCPS_CLOSE_WAIT && ti->ti_len) {
- tp = tcp_close(tp);
- tcpstat.tcps_rcvafterclose++;
- goto dropwithreset;
- }
-
- /*
- * If segment ends after window, drop trailing data
- * (and PUSH and FIN); if nothing left, just ACK.
- */
- todrop = (ti->ti_seq+ti->ti_len) - (tp->rcv_nxt+tp->rcv_wnd);
- if (todrop > 0) {
- tcpstat.tcps_rcvpackafterwin++;
- if (todrop >= ti->ti_len) {
- tcpstat.tcps_rcvbyteafterwin += ti->ti_len;
- /*
- * If a new connection request is received
- * while in TIME_WAIT, drop the old connection
- * and start over if the sequence numbers
- * are above the previous ones.
- */
- if (tiflags & TH_SYN &&
- tp->t_state == TCPS_TIME_WAIT &&
- SEQ_GT(ti->ti_seq, tp->rcv_nxt)) {
- iss = tp->rcv_nxt + TCP_ISSINCR;
- tp = tcp_close(tp);
- goto findpcb;
- }
- /*
- * If window is closed can only take segments at
- * window edge, and have to drop data and PUSH from
- * incoming segments. Continue processing, but
- * remember to ack. Otherwise, drop segment
- * and ack.
- */
- if (tp->rcv_wnd == 0 && ti->ti_seq == tp->rcv_nxt) {
- tp->t_flags |= TF_ACKNOW;
- tcpstat.tcps_rcvwinprobe++;
- } else
- goto dropafterack;
- } else
- tcpstat.tcps_rcvbyteafterwin += todrop;
- m_adj(m, -todrop);
- ti->ti_len -= todrop;
- tiflags &= ~(TH_PUSH|TH_FIN);
- }
-
- /*
- * If last ACK falls within this segment's sequence numbers,
- * record its timestamp.
- * NOTE that the test is modified according to the latest
- * proposal of the tcplw@cray.com list (Braden 1993/04/26).
- */
- if ((to.to_flag & TOF_TS) != 0 &&
- SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) {
- tp->ts_recent_age = tcp_now;
- tp->ts_recent = to.to_tsval;
- }
-
- /*
- * If the RST bit is set examine the state:
- * SYN_RECEIVED STATE:
- * If passive open, return to LISTEN state.
- * If active open, inform user that connection was refused.
- * ESTABLISHED, FIN_WAIT_1, FIN_WAIT2, CLOSE_WAIT STATES:
- * Inform user that connection was reset, and close tcb.
- * CLOSING, LAST_ACK, TIME_WAIT STATES
- * Close the tcb.
- */
- if (tiflags&TH_RST) switch (tp->t_state) {
-
- case TCPS_SYN_RECEIVED:
- so->so_error = ECONNREFUSED;
- goto close;
-
- case TCPS_ESTABLISHED:
- case TCPS_FIN_WAIT_1:
- case TCPS_FIN_WAIT_2:
- case TCPS_CLOSE_WAIT:
- so->so_error = ECONNRESET;
- close:
- tp->t_state = TCPS_CLOSED;
- tcpstat.tcps_drops++;
- tp = tcp_close(tp);
- goto drop;
-
- case TCPS_CLOSING:
- case TCPS_LAST_ACK:
- case TCPS_TIME_WAIT:
- tp = tcp_close(tp);
- goto drop;
- }
-
- /*
- * If a SYN is in the window, then this is an
- * error and we send an RST and drop the connection.
- */
- if (tiflags & TH_SYN) {
- tp = tcp_drop(tp, ECONNRESET);
- goto dropwithreset;
- }
-
- /*
- * If the ACK bit is off: if in SYN-RECEIVED state or SENDSYN
- * flag is on (half-synchronized state), then queue data for
- * later processing; else drop segment and return.
- */
- if ((tiflags & TH_ACK) == 0) {
- if (tp->t_state == TCPS_SYN_RECEIVED ||
- (tp->t_flags & TF_NEEDSYN))
- goto step6;
- else
- goto drop;
- }
-
- /*
- * Ack processing.
- */
- switch (tp->t_state) {
-
- /*
- * In SYN_RECEIVED state, the ack ACKs our SYN, so enter
- * ESTABLISHED state and continue processing.
- * The ACK was checked above.
- */
- case TCPS_SYN_RECEIVED:
-
- tcpstat.tcps_connects++;
- soisconnected(so);
- /* Do window scaling? */
- if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
- (TF_RCVD_SCALE|TF_REQ_SCALE)) {
- tp->snd_scale = tp->requested_s_scale;
- tp->rcv_scale = tp->request_r_scale;
- }
- /*
- * Upon successful completion of 3-way handshake,
- * update cache.CC if it was undefined, pass any queued
- * data to the user, and advance state appropriately.
- */
- if ((taop = tcp_gettaocache(inp)) != NULL &&
- taop->tao_cc == 0)
- taop->tao_cc = tp->cc_recv;
-
- /*
- * Make transitions:
- * SYN-RECEIVED -> ESTABLISHED
- * SYN-RECEIVED* -> FIN-WAIT-1
- */
- if (tp->t_flags & TF_NEEDFIN) {
- tp->t_state = TCPS_FIN_WAIT_1;
- tp->t_flags &= ~TF_NEEDFIN;
- } else {
- tp->t_state = TCPS_ESTABLISHED;
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- }
- /*
- * If segment contains data or ACK, will call tcp_reass()
- * later; if not, do so now to pass queued data to user.
- */
- if (ti->ti_len == 0 && (tiflags & TH_FIN) == 0)
- (void) tcp_reass(tp, (struct tcpiphdr *)0,
- (struct mbuf *)0);
- tp->snd_wl1 = ti->ti_seq - 1;
- /* fall into ... */
-
- /*
- * In ESTABLISHED state: drop duplicate ACKs; ACK out of range
- * ACKs. If the ack is in the range
- * tp->snd_una < ti->ti_ack <= tp->snd_max
- * then advance tp->snd_una to ti->ti_ack and drop
- * data from the retransmission queue. If this ACK reflects
- * more up to date window information we update our window information.
- */
- case TCPS_ESTABLISHED:
- case TCPS_FIN_WAIT_1:
- case TCPS_FIN_WAIT_2:
- case TCPS_CLOSE_WAIT:
- case TCPS_CLOSING:
- case TCPS_LAST_ACK:
- case TCPS_TIME_WAIT:
-
- if (SEQ_LEQ(ti->ti_ack, tp->snd_una)) {
- if (ti->ti_len == 0 && tiwin == tp->snd_wnd) {
- tcpstat.tcps_rcvdupack++;
- /*
- * If we have outstanding data (other than
- * a window probe), this is a completely
- * duplicate ack (ie, window info didn't
- * change), the ack is the biggest we've
- * seen and we've seen exactly our rexmt
- * threshhold of them, assume a packet
- * has been dropped and retransmit it.
- * Kludge snd_nxt & the congestion
- * window so we send only this one
- * packet.
- *
- * We know we're losing at the current
- * window size so do congestion avoidance
- * (set ssthresh to half the current window
- * and pull our congestion window back to
- * the new ssthresh).
- *
- * Dup acks mean that packets have left the
- * network (they're now cached at the receiver)
- * so bump cwnd by the amount in the receiver
- * to keep a constant cwnd packets in the
- * network.
- */
- if (tp->t_timer[TCPT_REXMT] == 0 ||
- ti->ti_ack != tp->snd_una)
- tp->t_dupacks = 0;
- else if (++tp->t_dupacks == tcprexmtthresh) {
- tcp_seq onxt = tp->snd_nxt;
- u_int win =
- min(tp->snd_wnd, tp->snd_cwnd) / 2 /
- tp->t_maxseg;
-
- if (win < 2)
- win = 2;
- tp->snd_ssthresh = win * tp->t_maxseg;
- tp->t_timer[TCPT_REXMT] = 0;
- tp->t_rtt = 0;
- tp->snd_nxt = ti->ti_ack;
- tp->snd_cwnd = tp->t_maxseg;
- (void) tcp_output(tp);
- tp->snd_cwnd = tp->snd_ssthresh +
- tp->t_maxseg * tp->t_dupacks;
- if (SEQ_GT(onxt, tp->snd_nxt))
- tp->snd_nxt = onxt;
- goto drop;
- } else if (tp->t_dupacks > tcprexmtthresh) {
- tp->snd_cwnd += tp->t_maxseg;
- (void) tcp_output(tp);
- goto drop;
- }
- } else
- tp->t_dupacks = 0;
- break;
- }
- /*
- * If the congestion window was inflated to account
- * for the other side's cached packets, retract it.
- */
- if (tp->t_dupacks >= tcprexmtthresh &&
- tp->snd_cwnd > tp->snd_ssthresh)
- tp->snd_cwnd = tp->snd_ssthresh;
- tp->t_dupacks = 0;
- if (SEQ_GT(ti->ti_ack, tp->snd_max)) {
- tcpstat.tcps_rcvacktoomuch++;
- goto dropafterack;
- }
- /*
- * If we reach this point, ACK is not a duplicate,
- * i.e., it ACKs something we sent.
- */
- if (tp->t_flags & TF_NEEDSYN) {
- /*
- * T/TCP: Connection was half-synchronized, and our
- * SYN has been ACK'd (so connection is now fully
- * synchronized). Go to non-starred state,
- * increment snd_una for ACK of SYN, and check if
- * we can do window scaling.
- */
- tp->t_flags &= ~TF_NEEDSYN;
- tp->snd_una++;
- /* Do window scaling? */
- if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
- (TF_RCVD_SCALE|TF_REQ_SCALE)) {
- tp->snd_scale = tp->requested_s_scale;
- tp->rcv_scale = tp->request_r_scale;
- }
- }
-
-process_ACK:
- acked = ti->ti_ack - tp->snd_una;
- tcpstat.tcps_rcvackpack++;
- tcpstat.tcps_rcvackbyte += acked;
-
- /*
- * If we have a timestamp reply, update smoothed
- * round trip time. If no timestamp is present but
- * transmit timer is running and timed sequence
- * number was acked, update smoothed round trip time.
- * Since we now have an rtt measurement, cancel the
- * timer backoff (cf., Phil Karn's retransmit alg.).
- * Recompute the initial retransmit timer.
- */
- if (to.to_flag & TOF_TS)
- tcp_xmit_timer(tp, tcp_now - to.to_tsecr + 1);
- else if (tp->t_rtt && SEQ_GT(ti->ti_ack, tp->t_rtseq))
- tcp_xmit_timer(tp,tp->t_rtt);
-
- /*
- * If all outstanding data is acked, stop retransmit
- * timer and remember to restart (more output or persist).
- * If there is more data to be acked, restart retransmit
- * timer, using current (possibly backed-off) value.
- */
- if (ti->ti_ack == tp->snd_max) {
- tp->t_timer[TCPT_REXMT] = 0;
- needoutput = 1;
- } else if (tp->t_timer[TCPT_PERSIST] == 0)
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
-
- /*
- * If no data (only SYN) was ACK'd,
- * skip rest of ACK processing.
- */
- if (acked == 0)
- goto step6;
-
- /*
- * When new data is acked, open the congestion window.
- * If the window gives us less than ssthresh packets
- * in flight, open exponentially (maxseg per packet).
- * Otherwise open linearly: maxseg per window
- * (maxseg^2 / cwnd per packet).
- */
- {
- register u_int cw = tp->snd_cwnd;
- register u_int incr = tp->t_maxseg;
-
- if (cw > tp->snd_ssthresh)
- incr = incr * incr / cw;
- tp->snd_cwnd = min(cw + incr, TCP_MAXWIN<<tp->snd_scale);
- }
- if (acked > so->so_snd.sb_cc) {
- tp->snd_wnd -= so->so_snd.sb_cc;
- sbdrop(&so->so_snd, (int)so->so_snd.sb_cc);
- ourfinisacked = 1;
- } else {
- sbdrop(&so->so_snd, acked);
- tp->snd_wnd -= acked;
- ourfinisacked = 0;
- }
- if (so->so_snd.sb_flags & SB_NOTIFY)
- sowwakeup(so);
- tp->snd_una = ti->ti_ack;
- if (SEQ_LT(tp->snd_nxt, tp->snd_una))
- tp->snd_nxt = tp->snd_una;
-
- switch (tp->t_state) {
-
- /*
- * In FIN_WAIT_1 STATE in addition to the processing
- * for the ESTABLISHED state if our FIN is now acknowledged
- * then enter FIN_WAIT_2.
- */
- case TCPS_FIN_WAIT_1:
- if (ourfinisacked) {
- /*
- * If we can't receive any more
- * data, then closing user can proceed.
- * Starting the timer is contrary to the
- * specification, but if we don't get a FIN
- * we'll hang forever.
- */
- if (so->so_state & SS_CANTRCVMORE) {
- soisdisconnected(so);
- tp->t_timer[TCPT_2MSL] = tcp_maxidle;
- }
- tp->t_state = TCPS_FIN_WAIT_2;
- }
- break;
-
- /*
- * In CLOSING STATE in addition to the processing for
- * the ESTABLISHED state if the ACK acknowledges our FIN
- * then enter the TIME-WAIT state, otherwise ignore
- * the segment.
- */
- case TCPS_CLOSING:
- if (ourfinisacked) {
- tp->t_state = TCPS_TIME_WAIT;
- tcp_canceltimers(tp);
- /* Shorten TIME_WAIT [RFC-1644, p.28] */
- if (tp->cc_recv != 0 &&
- tp->t_duration < TCPTV_MSL)
- tp->t_timer[TCPT_2MSL] =
- tp->t_rxtcur * TCPTV_TWTRUNC;
- else
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- soisdisconnected(so);
- }
- break;
-
- /*
- * In LAST_ACK, we may still be waiting for data to drain
- * and/or to be acked, as well as for the ack of our FIN.
- * If our FIN is now acknowledged, delete the TCB,
- * enter the closed state and return.
- */
- case TCPS_LAST_ACK:
- if (ourfinisacked) {
- tp = tcp_close(tp);
- goto drop;
- }
- break;
-
- /*
- * In TIME_WAIT state the only thing that should arrive
- * is a retransmission of the remote FIN. Acknowledge
- * it and restart the finack timer.
- */
- case TCPS_TIME_WAIT:
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- goto dropafterack;
- }
- }
-
-step6:
- /*
- * Update window information.
- * Don't look at window if no ACK: TAC's send garbage on first SYN.
- */
- if ((tiflags & TH_ACK) &&
- (SEQ_LT(tp->snd_wl1, ti->ti_seq) ||
- (tp->snd_wl1 == ti->ti_seq && (SEQ_LT(tp->snd_wl2, ti->ti_ack) ||
- (tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd))))) {
- /* keep track of pure window updates */
- if (ti->ti_len == 0 &&
- tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd)
- tcpstat.tcps_rcvwinupd++;
- tp->snd_wnd = tiwin;
- tp->snd_wl1 = ti->ti_seq;
- tp->snd_wl2 = ti->ti_ack;
- if (tp->snd_wnd > tp->max_sndwnd)
- tp->max_sndwnd = tp->snd_wnd;
- needoutput = 1;
- }
-
- /*
- * Process segments with URG.
- */
- if ((tiflags & TH_URG) && ti->ti_urp &&
- TCPS_HAVERCVDFIN(tp->t_state) == 0) {
- /*
- * This is a kludge, but if we receive and accept
- * random urgent pointers, we'll crash in
- * soreceive. It's hard to imagine someone
- * actually wanting to send this much urgent data.
- */
- if (ti->ti_urp + so->so_rcv.sb_cc > sb_max) {
- ti->ti_urp = 0; /* XXX */
- tiflags &= ~TH_URG; /* XXX */
- goto dodata; /* XXX */
- }
- /*
- * If this segment advances the known urgent pointer,
- * then mark the data stream. This should not happen
- * in CLOSE_WAIT, CLOSING, LAST_ACK or TIME_WAIT STATES since
- * a FIN has been received from the remote side.
- * In these states we ignore the URG.
- *
- * According to RFC961 (Assigned Protocols),
- * the urgent pointer points to the last octet
- * of urgent data. We continue, however,
- * to consider it to indicate the first octet
- * of data past the urgent section as the original
- * spec states (in one of two places).
- */
- if (SEQ_GT(ti->ti_seq+ti->ti_urp, tp->rcv_up)) {
- tp->rcv_up = ti->ti_seq + ti->ti_urp;
- so->so_oobmark = so->so_rcv.sb_cc +
- (tp->rcv_up - tp->rcv_nxt) - 1;
- if (so->so_oobmark == 0)
- so->so_state |= SS_RCVATMARK;
- sohasoutofband(so);
- tp->t_oobflags &= ~(TCPOOB_HAVEDATA | TCPOOB_HADDATA);
- }
- /*
- * Remove out of band data so doesn't get presented to user.
- * This can happen independent of advancing the URG pointer,
- * but if two URG's are pending at once, some out-of-band
- * data may creep in... ick.
- */
- if (ti->ti_urp <= (u_long)ti->ti_len
-#ifdef SO_OOBINLINE
- && (so->so_options & SO_OOBINLINE) == 0
-#endif
- )
- tcp_pulloutofband(so, ti, m);
- } else
- /*
- * If no out of band data is expected,
- * pull receive urgent pointer along
- * with the receive window.
- */
- if (SEQ_GT(tp->rcv_nxt, tp->rcv_up))
- tp->rcv_up = tp->rcv_nxt;
-dodata: /* XXX */
-
- /*
- * Process the segment text, merging it into the TCP sequencing queue,
- * and arranging for acknowledgment of receipt if necessary.
- * This process logically involves adjusting tp->rcv_wnd as data
- * is presented to the user (this happens in tcp_usrreq.c,
- * case PRU_RCVD). If a FIN has already been received on this
- * connection then we just ignore the text.
- */
- if ((ti->ti_len || (tiflags&TH_FIN)) &&
- TCPS_HAVERCVDFIN(tp->t_state) == 0) {
- TCP_REASS(tp, ti, m, so, tiflags);
- /*
- * Note the amount of data that peer has sent into
- * our window, in order to estimate the sender's
- * buffer size.
- */
- len = so->so_rcv.sb_hiwat - (tp->rcv_adv - tp->rcv_nxt);
- } else {
- m_freem(m);
- tiflags &= ~TH_FIN;
- }
-
- /*
- * If FIN is received ACK the FIN and let the user know
- * that the connection is closing.
- */
- if (tiflags & TH_FIN) {
- if (TCPS_HAVERCVDFIN(tp->t_state) == 0) {
- socantrcvmore(so);
- /*
- * If connection is half-synchronized
- * (ie NEEDSYN flag on) then delay ACK,
- * so it may be piggybacked when SYN is sent.
- * Otherwise, since we received a FIN then no
- * more input can be expected, send ACK now.
- */
- if (tp->t_flags & TF_NEEDSYN)
- tp->t_flags |= TF_DELACK;
- else
- tp->t_flags |= TF_ACKNOW;
- tp->rcv_nxt++;
- }
- switch (tp->t_state) {
-
- /*
- * In SYN_RECEIVED and ESTABLISHED STATES
- * enter the CLOSE_WAIT state.
- */
- case TCPS_SYN_RECEIVED:
- case TCPS_ESTABLISHED:
- tp->t_state = TCPS_CLOSE_WAIT;
- break;
-
- /*
- * If still in FIN_WAIT_1 STATE FIN has not been acked so
- * enter the CLOSING state.
- */
- case TCPS_FIN_WAIT_1:
- tp->t_state = TCPS_CLOSING;
- break;
-
- /*
- * In FIN_WAIT_2 state enter the TIME_WAIT state,
- * starting the time-wait timer, turning off the other
- * standard timers.
- */
- case TCPS_FIN_WAIT_2:
- tp->t_state = TCPS_TIME_WAIT;
- tcp_canceltimers(tp);
- /* Shorten TIME_WAIT [RFC-1644, p.28] */
- if (tp->cc_recv != 0 &&
- tp->t_duration < TCPTV_MSL) {
- tp->t_timer[TCPT_2MSL] =
- tp->t_rxtcur * TCPTV_TWTRUNC;
- /* For transaction client, force ACK now. */
- tp->t_flags |= TF_ACKNOW;
- }
- else
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- soisdisconnected(so);
- break;
-
- /*
- * In TIME_WAIT state restart the 2 MSL time_wait timer.
- */
- case TCPS_TIME_WAIT:
- tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL;
- break;
- }
- }
-#ifdef TCPDEBUG
- if (so->so_options & SO_DEBUG)
- tcp_trace(TA_INPUT, ostate, tp, &tcp_saveti, 0);
-#endif
-
- /*
- * Return any desired output.
- */
- if (needoutput || (tp->t_flags & TF_ACKNOW))
- (void) tcp_output(tp);
- return;
-
-dropafterack:
- /*
- * Generate an ACK dropping incoming segment if it occupies
- * sequence space, where the ACK reflects our state.
- */
- if (tiflags & TH_RST)
- goto drop;
-#ifdef TCPDEBUG
- if (so->so_options & SO_DEBUG)
- tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0);
-#endif
- m_freem(m);
- tp->t_flags |= TF_ACKNOW;
- (void) tcp_output(tp);
- return;
-
-dropwithreset:
- /*
- * Generate a RST, dropping incoming segment.
- * Make ACK acceptable to originator of segment.
- * Don't bother to respond if destination was broadcast/multicast.
- */
- if ((tiflags & TH_RST) || m->m_flags & (M_BCAST|M_MCAST) ||
- IN_MULTICAST(ntohl(ti->ti_dst.s_addr)))
- goto drop;
-#ifdef TCPDEBUG
- if (tp == 0 || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
- tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0);
-#endif
- if (tiflags & TH_ACK)
- tcp_respond(tp, ti, m, (tcp_seq)0, ti->ti_ack, TH_RST);
- else {
- if (tiflags & TH_SYN)
- ti->ti_len++;
- tcp_respond(tp, ti, m, ti->ti_seq+ti->ti_len, (tcp_seq)0,
- TH_RST|TH_ACK);
- }
- /* destroy temporarily created socket */
- if (dropsocket)
- (void) soabort(so);
- return;
-
-drop:
- /*
- * Drop space held by incoming segment and return.
- */
-#ifdef TCPDEBUG
- if (tp == 0 || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
- tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0);
-#endif
- m_freem(m);
- /* destroy temporarily created socket */
- if (dropsocket)
- (void) soabort(so);
- return;
-#ifndef TUBA_INCLUDE
-}
-
-static void
-tcp_dooptions(tp, cp, cnt, ti, to)
- struct tcpcb *tp;
- u_char *cp;
- int cnt;
- struct tcpiphdr *ti;
- struct tcpopt *to;
-{
- u_short mss = 0;
- int opt, optlen;
-
- for (; cnt > 0; cnt -= optlen, cp += optlen) {
- opt = cp[0];
- if (opt == TCPOPT_EOL)
- break;
- if (opt == TCPOPT_NOP)
- optlen = 1;
- else {
- optlen = cp[1];
- if (optlen <= 0)
- break;
- }
- switch (opt) {
-
- default:
- continue;
-
- case TCPOPT_MAXSEG:
- if (optlen != TCPOLEN_MAXSEG)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- bcopy((char *) cp + 2, (char *) &mss, sizeof(mss));
- NTOHS(mss);
- break;
-
- case TCPOPT_WINDOW:
- if (optlen != TCPOLEN_WINDOW)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- tp->t_flags |= TF_RCVD_SCALE;
- tp->requested_s_scale = min(cp[2], TCP_MAX_WINSHIFT);
- break;
-
- case TCPOPT_TIMESTAMP:
- if (optlen != TCPOLEN_TIMESTAMP)
- continue;
- to->to_flag |= TOF_TS;
- bcopy((char *)cp + 2,
- (char *)&to->to_tsval, sizeof(to->to_tsval));
- NTOHL(to->to_tsval);
- bcopy((char *)cp + 6,
- (char *)&to->to_tsecr, sizeof(to->to_tsecr));
- NTOHL(to->to_tsecr);
-
- /*
- * A timestamp received in a SYN makes
- * it ok to send timestamp requests and replies.
- */
- if (ti->ti_flags & TH_SYN) {
- tp->t_flags |= TF_RCVD_TSTMP;
- tp->ts_recent = to->to_tsval;
- tp->ts_recent_age = tcp_now;
- }
- break;
- case TCPOPT_CC:
- if (optlen != TCPOLEN_CC)
- continue;
- to->to_flag |= TOF_CC;
- bcopy((char *)cp + 2,
- (char *)&to->to_cc, sizeof(to->to_cc));
- NTOHL(to->to_cc);
- /*
- * A CC or CC.new option received in a SYN makes
- * it ok to send CC in subsequent segments.
- */
- if (ti->ti_flags & TH_SYN)
- tp->t_flags |= TF_RCVD_CC;
- break;
- case TCPOPT_CCNEW:
- if (optlen != TCPOLEN_CC)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- to->to_flag |= TOF_CCNEW;
- bcopy((char *)cp + 2,
- (char *)&to->to_cc, sizeof(to->to_cc));
- NTOHL(to->to_cc);
- /*
- * A CC or CC.new option received in a SYN makes
- * it ok to send CC in subsequent segments.
- */
- tp->t_flags |= TF_RCVD_CC;
- break;
- case TCPOPT_CCECHO:
- if (optlen != TCPOLEN_CC)
- continue;
- if (!(ti->ti_flags & TH_SYN))
- continue;
- to->to_flag |= TOF_CCECHO;
- bcopy((char *)cp + 2,
- (char *)&to->to_ccecho, sizeof(to->to_ccecho));
- NTOHL(to->to_ccecho);
- break;
- }
- }
- if (ti->ti_flags & TH_SYN)
- tcp_mss(tp, mss); /* sets t_maxseg */
-}
-
-/*
- * Pull out of band byte out of a segment so
- * it doesn't appear in the user's data queue.
- * It is still reflected in the segment length for
- * sequencing purposes.
- */
-static void
-tcp_pulloutofband(so, ti, m)
- struct socket *so;
- struct tcpiphdr *ti;
- register struct mbuf *m;
-{
- int cnt = ti->ti_urp - 1;
-
- while (cnt >= 0) {
- if (m->m_len > cnt) {
- char *cp = mtod(m, caddr_t) + cnt;
- struct tcpcb *tp = sototcpcb(so);
-
- tp->t_iobc = *cp;
- tp->t_oobflags |= TCPOOB_HAVEDATA;
- bcopy(cp+1, cp, (unsigned)(m->m_len - cnt - 1));
- m->m_len--;
- return;
- }
- cnt -= m->m_len;
- m = m->m_next;
- if (m == 0)
- break;
- }
- panic("tcp_pulloutofband");
-}
-
-/*
- * Collect new round-trip time estimate
- * and update averages and current timeout.
- */
-static void
-tcp_xmit_timer(tp, rtt)
- register struct tcpcb *tp;
- short rtt;
-{
- register int delta;
-
- tcpstat.tcps_rttupdated++;
- tp->t_rttupdated++;
- if (tp->t_srtt != 0) {
- /*
- * srtt is stored as fixed point with 5 bits after the
- * binary point (i.e., scaled by 8). The following magic
- * is equivalent to the smoothing algorithm in rfc793 with
- * an alpha of .875 (srtt = rtt/8 + srtt*7/8 in fixed
- * point). Adjust rtt to origin 0.
- */
- delta = ((rtt - 1) << TCP_DELTA_SHIFT)
- - (tp->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT));
-
- if ((tp->t_srtt += delta) <= 0)
- tp->t_srtt = 1;
-
- /*
- * We accumulate a smoothed rtt variance (actually, a
- * smoothed mean difference), then set the retransmit
- * timer to smoothed rtt + 4 times the smoothed variance.
- * rttvar is stored as fixed point with 4 bits after the
- * binary point (scaled by 16). The following is
- * equivalent to rfc793 smoothing with an alpha of .75
- * (rttvar = rttvar*3/4 + |delta| / 4). This replaces
- * rfc793's wired-in beta.
- */
- if (delta < 0)
- delta = -delta;
- delta -= tp->t_rttvar >> (TCP_RTTVAR_SHIFT - TCP_DELTA_SHIFT);
- if ((tp->t_rttvar += delta) <= 0)
- tp->t_rttvar = 1;
- } else {
- /*
- * No rtt measurement yet - use the unsmoothed rtt.
- * Set the variance to half the rtt (so our first
- * retransmit happens at 3*rtt).
- */
- tp->t_srtt = rtt << TCP_RTT_SHIFT;
- tp->t_rttvar = rtt << (TCP_RTTVAR_SHIFT - 1);
- }
- tp->t_rtt = 0;
- tp->t_rxtshift = 0;
-
- /*
- * the retransmit should happen at rtt + 4 * rttvar.
- * Because of the way we do the smoothing, srtt and rttvar
- * will each average +1/2 tick of bias. When we compute
- * the retransmit timer, we want 1/2 tick of rounding and
- * 1 extra tick because of +-1/2 tick uncertainty in the
- * firing of the timer. The bias will give us exactly the
- * 1.5 tick we need. But, because the bias is
- * statistical, we have to test that we don't drop below
- * the minimum feasible timer (which is 2 ticks).
- */
- TCPT_RANGESET(tp->t_rxtcur, TCP_REXMTVAL(tp),
- max(tp->t_rttmin, rtt + 2), TCPTV_REXMTMAX);
-
- /*
- * We received an ack for a packet that wasn't retransmitted;
- * it is probably safe to discard any error indications we've
- * received recently. This isn't quite right, but close enough
- * for now (a route might have failed after we sent a segment,
- * and the return path might not be symmetrical).
- */
- tp->t_softerror = 0;
-}
-
-/*
- * Determine a reasonable value for maxseg size.
- * If the route is known, check route for mtu.
- * If none, use an mss that can be handled on the outgoing
- * interface without forcing IP to fragment; if bigger than
- * an mbuf cluster (MCLBYTES), round down to nearest multiple of MCLBYTES
- * to utilize large mbufs. If no route is found, route has no mtu,
- * or the destination isn't local, use a default, hopefully conservative
- * size (usually 512 or the default IP max size, but no more than the mtu
- * of the interface), as we can't discover anything about intervening
- * gateways or networks. We also initialize the congestion/slow start
- * window to be a single segment if the destination isn't local.
- * While looking at the routing entry, we also initialize other path-dependent
- * parameters from pre-set or cached values in the routing entry.
- *
- * Also take into account the space needed for options that we
- * send regularly. Make maxseg shorter by that amount to assure
- * that we can send maxseg amount of data even when the options
- * are present. Store the upper limit of the length of options plus
- * data in maxopd.
- *
- * NOTE that this routine is only called when we process an incoming
- * segment, for outgoing segments only tcp_mssopt is called.
- *
- * In case of T/TCP, we call this routine during implicit connection
- * setup as well (offer = -1), to initialize maxseg from the cached
- * MSS of our peer.
- */
-void
-tcp_mss(tp, offer)
- struct tcpcb *tp;
- int offer;
-{
- register struct rtentry *rt;
- struct ifnet *ifp;
- register int rtt, mss;
- u_long bufsize;
- struct inpcb *inp;
- struct socket *so;
- struct rmxp_tao *taop;
- int origoffer = offer;
-
- inp = tp->t_inpcb;
- if ((rt = tcp_rtlookup(inp)) == NULL) {
- tp->t_maxopd = tp->t_maxseg = tcp_mssdflt;
- return;
- }
- ifp = rt->rt_ifp;
- so = inp->inp_socket;
-
- taop = rmx_taop(rt->rt_rmx);
- /*
- * Offer == -1 means that we didn't receive SYN yet,
- * use cached value in that case;
- */
- if (offer == -1)
- offer = taop->tao_mssopt;
- /*
- * Offer == 0 means that there was no MSS on the SYN segment,
- * in this case we use tcp_mssdflt.
- */
- if (offer == 0)
- offer = tcp_mssdflt;
- else
- /*
- * Sanity check: make sure that maxopd will be large
- * enough to allow some data on segments even is the
- * all the option space is used (40bytes). Otherwise
- * funny things may happen in tcp_output.
- */
- offer = max(offer, 64);
- taop->tao_mssopt = offer;
-
- /*
- * While we're here, check if there's an initial rtt
- * or rttvar. Convert from the route-table units
- * to scaled multiples of the slow timeout timer.
- */
- if (tp->t_srtt == 0 && (rtt = rt->rt_rmx.rmx_rtt)) {
- /*
- * XXX the lock bit for RTT indicates that the value
- * is also a minimum value; this is subject to time.
- */
- if (rt->rt_rmx.rmx_locks & RTV_RTT)
- tp->t_rttmin = rtt / (RTM_RTTUNIT / PR_SLOWHZ);
- tp->t_srtt = rtt / (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTT_SCALE));
- tcpstat.tcps_usedrtt++;
- if (rt->rt_rmx.rmx_rttvar) {
- tp->t_rttvar = rt->rt_rmx.rmx_rttvar /
- (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTTVAR_SCALE));
- tcpstat.tcps_usedrttvar++;
- } else {
- /* default variation is +- 1 rtt */
- tp->t_rttvar =
- tp->t_srtt * TCP_RTTVAR_SCALE / TCP_RTT_SCALE;
- }
- TCPT_RANGESET(tp->t_rxtcur,
- ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1,
- tp->t_rttmin, TCPTV_REXMTMAX);
- }
- /*
- * if there's an mtu associated with the route, use it
- */
- if (rt->rt_rmx.rmx_mtu)
- mss = rt->rt_rmx.rmx_mtu - sizeof(struct tcpiphdr);
- else
- {
- mss = ifp->if_mtu - sizeof(struct tcpiphdr);
- if (!in_localaddr(inp->inp_faddr))
- mss = min(mss, tcp_mssdflt);
- }
- mss = min(mss, offer);
- /*
- * maxopd stores the maximum length of data AND options
- * in a segment; maxseg is the amount of data in a normal
- * segment. We need to store this value (maxopd) apart
- * from maxseg, because now every segment carries options
- * and thus we normally have somewhat less data in segments.
- */
- tp->t_maxopd = mss;
-
- /*
- * In case of T/TCP, origoffer==-1 indicates, that no segments
- * were received yet. In this case we just guess, otherwise
- * we do the same as before T/TCP.
- */
- if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP &&
- (origoffer == -1 ||
- (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP))
- mss -= TCPOLEN_TSTAMP_APPA;
- if ((tp->t_flags & (TF_REQ_CC|TF_NOOPT)) == TF_REQ_CC &&
- (origoffer == -1 ||
- (tp->t_flags & TF_RCVD_CC) == TF_RCVD_CC))
- mss -= TCPOLEN_CC_APPA;
-
-#if (MCLBYTES & (MCLBYTES - 1)) == 0
- if (mss > MCLBYTES)
- mss &= ~(MCLBYTES-1);
-#else
- if (mss > MCLBYTES)
- mss = mss / MCLBYTES * MCLBYTES;
-#endif
- /*
- * If there's a pipesize, change the socket buffer
- * to that size. Make the socket buffers an integral
- * number of mss units; if the mss is larger than
- * the socket buffer, decrease the mss.
- */
-#ifdef RTV_SPIPE
- if ((bufsize = rt->rt_rmx.rmx_sendpipe) == 0)
-#endif
- bufsize = so->so_snd.sb_hiwat;
- if (bufsize < mss)
- mss = bufsize;
- else {
- bufsize = roundup(bufsize, mss);
- if (bufsize > sb_max)
- bufsize = sb_max;
- (void)sbreserve(&so->so_snd, bufsize);
- }
- tp->t_maxseg = mss;
-
-#ifdef RTV_RPIPE
- if ((bufsize = rt->rt_rmx.rmx_recvpipe) == 0)
-#endif
- bufsize = so->so_rcv.sb_hiwat;
- if (bufsize > mss) {
- bufsize = roundup(bufsize, mss);
- if (bufsize > sb_max)
- bufsize = sb_max;
- (void)sbreserve(&so->so_rcv, bufsize);
- }
- /*
- * Don't force slow-start on local network.
- */
- if (!in_localaddr(inp->inp_faddr))
- tp->snd_cwnd = mss;
-
- if (rt->rt_rmx.rmx_ssthresh) {
- /*
- * There's some sort of gateway or interface
- * buffer limit on the path. Use this to set
- * the slow start threshhold, but set the
- * threshold to no less than 2*mss.
- */
- tp->snd_ssthresh = max(2 * mss, rt->rt_rmx.rmx_ssthresh);
- tcpstat.tcps_usedssthresh++;
- }
-}
-
-/*
- * Determine the MSS option to send on an outgoing SYN.
- */
-int
-tcp_mssopt(tp)
- struct tcpcb *tp;
-{
- struct rtentry *rt;
-
- rt = tcp_rtlookup(tp->t_inpcb);
- if (rt == NULL)
- return tcp_mssdflt;
-
- return rt->rt_ifp->if_mtu - sizeof(struct tcpiphdr);
-}
-#endif /* TUBA_INCLUDE */
diff --git a/cpukit/libnetworking/netinet/tcp_output.c b/cpukit/libnetworking/netinet/tcp_output.c
deleted file mode 100644
index cbb5218dce..0000000000
--- a/cpukit/libnetworking/netinet/tcp_output.c
+++ /dev/null
@@ -1,755 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#define TCPOUTFLAGS
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-#ifdef notyet
-extern struct mbuf *m_copypack();
-#endif
-
-
-/*
- * Tcp output routine: figure out what should be sent and send it.
- */
-int
-tcp_output(tp)
- register struct tcpcb *tp;
-{
- register struct socket *so = tp->t_inpcb->inp_socket;
- register long len, win;
- int off, flags, error;
- register struct mbuf *m;
- register struct tcpiphdr *ti;
- u_char opt[TCP_MAXOLEN];
- unsigned optlen, hdrlen;
- int idle, sendalot;
- struct rmxp_tao *taop;
- struct rmxp_tao tao_noncached;
-
- /*
- * Determine length of data that should be transmitted,
- * and flags that will be used.
- * If there is some data or critical controls (SYN, RST)
- * to send, then transmit; otherwise, investigate further.
- */
- idle = (tp->snd_max == tp->snd_una);
- if (idle && tp->t_idle >= tp->t_rxtcur)
- /*
- * We have been idle for "a while" and no acks are
- * expected to clock out any data we send --
- * slow start to get ack "clock" running again.
- */
- tp->snd_cwnd = tp->t_maxseg;
-again:
- sendalot = 0;
- off = tp->snd_nxt - tp->snd_una;
- win = min(tp->snd_wnd, tp->snd_cwnd);
-
- flags = tcp_outflags[tp->t_state];
- /*
- * Get standard flags, and add SYN or FIN if requested by 'hidden'
- * state flags.
- */
- if (tp->t_flags & TF_NEEDFIN)
- flags |= TH_FIN;
- if (tp->t_flags & TF_NEEDSYN)
- flags |= TH_SYN;
-
- /*
- * If in persist timeout with window of 0, send 1 byte.
- * Otherwise, if window is small but nonzero
- * and timer expired, we will send what we can
- * and go to transmit state.
- */
- if (tp->t_force) {
- if (win == 0) {
- /*
- * If we still have some data to send, then
- * clear the FIN bit. Usually this would
- * happen below when it realizes that we
- * aren't sending all the data. However,
- * if we have exactly 1 byte of unset data,
- * then it won't clear the FIN bit below,
- * and if we are in persist state, we wind
- * up sending the packet without recording
- * that we sent the FIN bit.
- *
- * We can't just blindly clear the FIN bit,
- * because if we don't have any more data
- * to send then the probe will be the FIN
- * itself.
- */
- if (off < so->so_snd.sb_cc)
- flags &= ~TH_FIN;
- win = 1;
- } else {
- tp->t_timer[TCPT_PERSIST] = 0;
- tp->t_rxtshift = 0;
- }
- }
-
- len = min(so->so_snd.sb_cc, win) - off;
-
- if ((taop = tcp_gettaocache(tp->t_inpcb)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
-
- /*
- * Lop off SYN bit if it has already been sent. However, if this
- * is SYN-SENT state and if segment contains data and if we don't
- * know that foreign host supports TAO, suppress sending segment.
- */
- if ((flags & TH_SYN) && SEQ_GT(tp->snd_nxt, tp->snd_una)) {
- flags &= ~TH_SYN;
- off--, len++;
- if (len > 0 && tp->t_state == TCPS_SYN_SENT &&
- taop->tao_ccsent == 0)
- return 0;
- }
-
- /*
- * Be careful not to send data and/or FIN on SYN segments
- * in cases when no CC option will be sent.
- * This measure is needed to prevent interoperability problems
- * with not fully conformant TCP implementations.
- */
- if ((flags & TH_SYN) &&
- ((tp->t_flags & TF_NOOPT) || !(tp->t_flags & TF_REQ_CC) ||
- ((flags & TH_ACK) && !(tp->t_flags & TF_RCVD_CC)))) {
- len = 0;
- flags &= ~TH_FIN;
- }
-
- if (len < 0) {
- /*
- * If FIN has been sent but not acked,
- * but we haven't been called to retransmit,
- * len will be -1. Otherwise, window shrank
- * after we sent into it. If window shrank to 0,
- * cancel pending retransmit, pull snd_nxt back
- * to (closed) window, and set the persist timer
- * if it isn't already going. If the window didn't
- * close completely, just wait for an ACK.
- */
- len = 0;
- if (win == 0) {
- tp->t_timer[TCPT_REXMT] = 0;
- tp->t_rxtshift = 0;
- tp->snd_nxt = tp->snd_una;
- if (tp->t_timer[TCPT_PERSIST] == 0)
- tcp_setpersist(tp);
- }
- }
- if (len > tp->t_maxseg) {
- len = tp->t_maxseg;
- sendalot = 1;
- }
- if (SEQ_LT(tp->snd_nxt + len, tp->snd_una + so->so_snd.sb_cc))
- flags &= ~TH_FIN;
-
- win = sbspace(&so->so_rcv);
-
- /*
- * Sender silly window avoidance. If connection is idle
- * and can send all data, a maximum segment,
- * at least a maximum default-size segment do it,
- * or are forced, do it; otherwise don't bother.
- * If peer's buffer is tiny, then send
- * when window is at least half open.
- * If retransmitting (possibly after persist timer forced us
- * to send into a small window), then must resend.
- */
- if (len) {
- if (len == tp->t_maxseg)
- goto send;
- if ((idle || tp->t_flags & TF_NODELAY) &&
- (tp->t_flags & TF_NOPUSH) == 0 &&
- len + off >= so->so_snd.sb_cc)
- goto send;
- if (tp->t_force)
- goto send;
- if (len >= tp->max_sndwnd / 2 && tp->max_sndwnd > 0)
- goto send;
- if (SEQ_LT(tp->snd_nxt, tp->snd_max))
- goto send;
- }
-
- /*
- * Compare available window to amount of window
- * known to peer (as advertised window less
- * next expected input). If the difference is at least two
- * max size segments, or at least 50% of the maximum possible
- * window, then want to send a window update to peer.
- */
- if (win > 0) {
- /*
- * "adv" is the amount we can increase the window,
- * taking into account that we are limited by
- * TCP_MAXWIN << tp->rcv_scale.
- */
- long adv = min(win, (long)TCP_MAXWIN << tp->rcv_scale) -
- (tp->rcv_adv - tp->rcv_nxt);
-
- if (adv >= (long) (2 * tp->t_maxseg))
- goto send;
- if (2 * adv >= (long) so->so_rcv.sb_hiwat)
- goto send;
- }
-
- /*
- * Send if we owe peer an ACK.
- */
- if (tp->t_flags & TF_ACKNOW)
- goto send;
- if ((flags & TH_RST) ||
- ((flags & TH_SYN) && (tp->t_flags & TF_NEEDSYN) == 0))
- goto send;
- if (SEQ_GT(tp->snd_up, tp->snd_una))
- goto send;
- /*
- * If our state indicates that FIN should be sent
- * and we have not yet done so, or we're retransmitting the FIN,
- * then we need to send.
- */
- if (flags & TH_FIN &&
- ((tp->t_flags & TF_SENTFIN) == 0 || tp->snd_nxt == tp->snd_una))
- goto send;
-
- /*
- * TCP window updates are not reliable, rather a polling protocol
- * using ``persist'' packets is used to insure receipt of window
- * updates. The three ``states'' for the output side are:
- * idle not doing retransmits or persists
- * persisting to move a small or zero window
- * (re)transmitting and thereby not persisting
- *
- * tp->t_timer[TCPT_PERSIST]
- * is set when we are in persist state.
- * tp->t_force
- * is set when we are called to send a persist packet.
- * tp->t_timer[TCPT_REXMT]
- * is set when we are retransmitting
- * The output side is idle when both timers are zero.
- *
- * If send window is too small, there is data to transmit, and no
- * retransmit or persist is pending, then go to persist state.
- * If nothing happens soon, send when timer expires:
- * if window is nonzero, transmit what we can,
- * otherwise force out a byte.
- */
- if (so->so_snd.sb_cc && tp->t_timer[TCPT_REXMT] == 0 &&
- tp->t_timer[TCPT_PERSIST] == 0) {
- tp->t_rxtshift = 0;
- tcp_setpersist(tp);
- }
-
- /*
- * No reason to send a segment, just return.
- */
- return (0);
-
-send:
- /*
- * Before ESTABLISHED, force sending of initial options
- * unless TCP set not to do any options.
- * NOTE: we assume that the IP/TCP header plus TCP options
- * always fit in a single mbuf, leaving room for a maximum
- * link header, i.e.
- * max_linkhdr + sizeof (struct tcpiphdr) + optlen <= MHLEN
- */
- optlen = 0;
- hdrlen = sizeof (struct tcpiphdr);
- if (flags & TH_SYN) {
- tp->snd_nxt = tp->iss;
- if ((tp->t_flags & TF_NOOPT) == 0) {
- u_short mss;
-
- opt[0] = TCPOPT_MAXSEG;
- opt[1] = TCPOLEN_MAXSEG;
- mss = htons((u_short) tcp_mssopt(tp));
- (void)memcpy(opt + 2, &mss, sizeof(mss));
- optlen = TCPOLEN_MAXSEG;
-
- if ((tp->t_flags & TF_REQ_SCALE) &&
- ((flags & TH_ACK) == 0 ||
- (tp->t_flags & TF_RCVD_SCALE))) {
- *((u_long *) (opt + optlen)) = htonl(
- TCPOPT_NOP << 24 |
- TCPOPT_WINDOW << 16 |
- TCPOLEN_WINDOW << 8 |
- tp->request_r_scale);
- optlen += 4;
- }
- }
- }
-
- /*
- * Send a timestamp and echo-reply if this is a SYN and our side
- * wants to use timestamps (TF_REQ_TSTMP is set) or both our side
- * and our peer have sent timestamps in our SYN's.
- */
- if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP &&
- (flags & TH_RST) == 0 &&
- ((flags & TH_ACK) == 0 ||
- (tp->t_flags & TF_RCVD_TSTMP))) {
- u_long *lp = (u_long *)(opt + optlen);
-
- /* Form timestamp option as shown in appendix A of RFC 1323. */
- *lp++ = htonl(TCPOPT_TSTAMP_HDR);
- *lp++ = htonl(tcp_now);
- *lp = htonl(tp->ts_recent);
- optlen += TCPOLEN_TSTAMP_APPA;
- }
-
- /*
- * Send `CC-family' options if our side wants to use them (TF_REQ_CC),
- * options are allowed (!TF_NOOPT) and it's not a RST.
- */
- if ((tp->t_flags & (TF_REQ_CC|TF_NOOPT)) == TF_REQ_CC &&
- (flags & TH_RST) == 0) {
- switch (flags & (TH_SYN|TH_ACK)) {
- /*
- * This is a normal ACK, send CC if we received CC before
- * from our peer.
- */
- case TH_ACK:
- if (!(tp->t_flags & TF_RCVD_CC))
- break;
- /*FALLTHROUGH*/
-
- /*
- * We can only get here in T/TCP's SYN_SENT* state, when
- * we're a sending a non-SYN segment without waiting for
- * the ACK of our SYN. A check above assures that we only
- * do this if our peer understands T/TCP.
- */
- case 0:
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_CC;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] = htonl(tp->cc_send);
-
- optlen += 4;
- break;
-
- /*
- * This is our initial SYN, check whether we have to use
- * CC or CC.new.
- */
- case TH_SYN:
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = tp->t_flags & TF_SENDCCNEW ?
- TCPOPT_CCNEW : TCPOPT_CC;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] = htonl(tp->cc_send);
- optlen += 4;
- break;
-
- /*
- * This is a SYN,ACK; send CC and CC.echo if we received
- * CC from our peer.
- */
- case (TH_SYN|TH_ACK):
- if (tp->t_flags & TF_RCVD_CC) {
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_CC;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] =
- htonl(tp->cc_send);
- optlen += 4;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_NOP;
- opt[optlen++] = TCPOPT_CCECHO;
- opt[optlen++] = TCPOLEN_CC;
- *(u_int32_t *)&opt[optlen] =
- htonl(tp->cc_recv);
- optlen += 4;
- }
- break;
- }
- }
-
- hdrlen += optlen;
-
- /*
- * Adjust data length if insertion of options will
- * bump the packet length beyond the t_maxopd length.
- * Clear the FIN bit because we cut off the tail of
- * the segment.
- */
- if (len + optlen > tp->t_maxopd) {
- /*
- * If there is still more to send, don't close the connection.
- */
- flags &= ~TH_FIN;
- len = tp->t_maxopd - optlen;
- sendalot = 1;
- }
-
-/*#ifdef DIAGNOSTIC*/
- if (max_linkhdr + hdrlen > MHLEN)
- panic("tcphdr too big");
-/*#endif*/
-
- /*
- * Grab a header mbuf, attaching a copy of data to
- * be transmitted, and initialize the header from
- * the template for sends on this connection.
- */
- if (len) {
- if (tp->t_force && len == 1)
- tcpstat.tcps_sndprobe++;
- else if (SEQ_LT(tp->snd_nxt, tp->snd_max)) {
- tcpstat.tcps_sndrexmitpack++;
- tcpstat.tcps_sndrexmitbyte += len;
- } else {
- tcpstat.tcps_sndpack++;
- tcpstat.tcps_sndbyte += len;
- }
-#ifdef notyet
- if ((m = m_copypack(so->so_snd.sb_mb, off,
- (int)len, max_linkhdr + hdrlen)) == 0) {
- error = ENOBUFS;
- goto out;
- }
- /*
- * m_copypack left space for our hdr; use it.
- */
- m->m_len += hdrlen;
- m->m_data -= hdrlen;
-#else
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- }
- m->m_data += max_linkhdr;
- m->m_len = hdrlen;
- if (len <= MHLEN - hdrlen - max_linkhdr) {
- m_copydata(so->so_snd.sb_mb, off, (int) len,
- mtod(m, caddr_t) + hdrlen);
- m->m_len += len;
- } else {
- m->m_next = m_copy(so->so_snd.sb_mb, off, (int) len);
- if (m->m_next == 0) {
- (void) m_free(m);
- error = ENOBUFS;
- goto out;
- }
- }
-#endif
- /*
- * If we're sending everything we've got, set PUSH.
- * (This will keep happy those implementations which only
- * give data to the user when a buffer fills or
- * a PUSH comes in.)
- */
- if (off + len == so->so_snd.sb_cc)
- flags |= TH_PUSH;
- } else {
- if (tp->t_flags & TF_ACKNOW)
- tcpstat.tcps_sndacks++;
- else if (flags & (TH_SYN|TH_FIN|TH_RST))
- tcpstat.tcps_sndctrl++;
- else if (SEQ_GT(tp->snd_up, tp->snd_una))
- tcpstat.tcps_sndurg++;
- else
- tcpstat.tcps_sndwinup++;
-
- MGETHDR(m, M_DONTWAIT, MT_HEADER);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- }
- m->m_data += max_linkhdr;
- m->m_len = hdrlen;
- }
- m->m_pkthdr.rcvif = (struct ifnet *)0;
- ti = mtod(m, struct tcpiphdr *);
- if (tp->t_template == 0)
- panic("tcp_output");
- (void)memcpy(ti, tp->t_template, sizeof (struct tcpiphdr));
-
- /*
- * Fill in fields, remembering maximum advertised
- * window for use in delaying messages about window sizes.
- * If resending a FIN, be sure not to use a new sequence number.
- */
- if (flags & TH_FIN && tp->t_flags & TF_SENTFIN &&
- tp->snd_nxt == tp->snd_max)
- tp->snd_nxt--;
- /*
- * If we are doing retransmissions, then snd_nxt will
- * not reflect the first unsent octet. For ACK only
- * packets, we do not want the sequence number of the
- * retransmitted packet, we want the sequence number
- * of the next unsent octet. So, if there is no data
- * (and no SYN or FIN), use snd_max instead of snd_nxt
- * when filling in ti_seq. But if we are in persist
- * state, snd_max might reflect one byte beyond the
- * right edge of the window, so use snd_nxt in that
- * case, since we know we aren't doing a retransmission.
- * (retransmit and persist are mutually exclusive...)
- */
- if (len || (flags & (TH_SYN|TH_FIN)) || tp->t_timer[TCPT_PERSIST])
- ti->ti_seq = htonl(tp->snd_nxt);
- else
- ti->ti_seq = htonl(tp->snd_max);
- ti->ti_ack = htonl(tp->rcv_nxt);
- if (optlen) {
- bcopy(opt, ti + 1, optlen);
- ti->ti_off = (sizeof (struct tcphdr) + optlen) >> 2;
- }
- ti->ti_flags = flags;
- /*
- * Calculate receive window. Don't shrink window,
- * but avoid silly window syndrome.
- */
- if (win < (long)(so->so_rcv.sb_hiwat / 4) && win < (long)tp->t_maxseg)
- win = 0;
- if (win < (long)(tp->rcv_adv - tp->rcv_nxt))
- win = (long)(tp->rcv_adv - tp->rcv_nxt);
- if (win > (long)TCP_MAXWIN << tp->rcv_scale)
- win = (long)TCP_MAXWIN << tp->rcv_scale;
- ti->ti_win = htons((u_short) (win>>tp->rcv_scale));
- if (SEQ_GT(tp->snd_up, tp->snd_nxt)) {
- ti->ti_urp = htons((u_short)(tp->snd_up - tp->snd_nxt));
- ti->ti_flags |= TH_URG;
- } else
- /*
- * If no urgent pointer to send, then we pull
- * the urgent pointer to the left edge of the send window
- * so that it doesn't drift into the send window on sequence
- * number wraparound.
- */
- tp->snd_up = tp->snd_una; /* drag it along */
-
- /*
- * Put TCP length in extended header, and then
- * checksum extended header and data.
- */
- if (len + optlen)
- ti->ti_len = htons((u_short)(sizeof (struct tcphdr) +
- optlen + len));
- ti->ti_sum = in_cksum(m, (int)(hdrlen + len));
-
- /*
- * In transmit state, time the transmission and arrange for
- * the retransmit. In persist state, just set snd_max.
- */
- if (tp->t_force == 0 || tp->t_timer[TCPT_PERSIST] == 0) {
- tcp_seq startseq = tp->snd_nxt;
-
- /*
- * Advance snd_nxt over sequence space of this segment.
- */
- if (flags & (TH_SYN|TH_FIN)) {
- if (flags & TH_SYN)
- tp->snd_nxt++;
- if (flags & TH_FIN) {
- tp->snd_nxt++;
- tp->t_flags |= TF_SENTFIN;
- }
- }
- tp->snd_nxt += len;
- if (SEQ_GT(tp->snd_nxt, tp->snd_max)) {
- tp->snd_max = tp->snd_nxt;
- /*
- * Time this transmission if not a retransmission and
- * not currently timing anything.
- */
- if (tp->t_rtt == 0) {
- tp->t_rtt = 1;
- tp->t_rtseq = startseq;
- tcpstat.tcps_segstimed++;
- }
- }
-
- /*
- * Set retransmit timer if not currently set,
- * and not doing an ack or a keep-alive probe.
- * Initial value for retransmit timer is smoothed
- * round-trip time + 2 * round-trip time variance.
- * Initialize shift counter which is used for backoff
- * of retransmit time.
- */
- if (tp->t_timer[TCPT_REXMT] == 0 &&
- tp->snd_nxt != tp->snd_una) {
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
- if (tp->t_timer[TCPT_PERSIST]) {
- tp->t_timer[TCPT_PERSIST] = 0;
- tp->t_rxtshift = 0;
- }
- }
- } else
- if (SEQ_GT(tp->snd_nxt + len, tp->snd_max))
- tp->snd_max = tp->snd_nxt + len;
-
-#ifdef TCPDEBUG
- /*
- * Trace.
- */
- if (so->so_options & SO_DEBUG)
- tcp_trace(TA_OUTPUT, tp->t_state, tp, ti, 0);
-#endif
-
- /*
- * Fill in IP length and desired time to live and
- * send to IP level. There should be a better way
- * to handle ttl and tos; we could keep them in
- * the template, but need a way to checksum without them.
- */
- m->m_pkthdr.len = hdrlen + len;
-#ifdef TUBA
- if (tp->t_tuba_pcb)
- error = tuba_output(m, tp);
- else
-#endif
- {
-#if 1
- struct rtentry *rt;
-#endif
- ((struct ip *)ti)->ip_len = m->m_pkthdr.len;
- ((struct ip *)ti)->ip_ttl = tp->t_inpcb->inp_ip_ttl; /* XXX */
- ((struct ip *)ti)->ip_tos = tp->t_inpcb->inp_ip_tos; /* XXX */
-#if 1
- /*
- * See if we should do MTU discovery. We do it only if the following
- * are true:
- * 1) we have a valid route to the destination
- * 2) the MTU is not locked (if it is, then discovery has been
- * disabled)
- */
- if ((rt = tp->t_inpcb->inp_route.ro_rt)
- && rt->rt_flags & RTF_UP
- && !(rt->rt_rmx.rmx_locks & RTV_MTU)) {
- ((struct ip *)ti)->ip_off |= IP_DF;
- }
-#endif
- error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route,
- so->so_options & SO_DONTROUTE, 0);
- }
- if (error) {
-out:
- if (error == ENOBUFS) {
- tcp_quench(tp->t_inpcb, 0);
- return (0);
- }
-#if 1
- if (error == EMSGSIZE) {
- /*
- * ip_output() will have already fixed the route
- * for us. tcp_mtudisc() will, as its last action,
- * initiate retransmission, so it is important to
- * not do so here.
- */
- tcp_mtudisc(tp->t_inpcb, 0);
- return 0;
- }
-#endif
- if ((error == EHOSTUNREACH || error == ENETDOWN)
- && TCPS_HAVERCVDSYN(tp->t_state)) {
- tp->t_softerror = error;
- return (0);
- }
- return (error);
- }
- tcpstat.tcps_sndtotal++;
-
- /*
- * Data sent (as far as we can tell).
- * If this advertises a larger window than any other segment,
- * then remember the size of the advertised window.
- * Any pending ACK has now been sent.
- */
- if (win > 0 && SEQ_GT(tp->rcv_nxt+win, tp->rcv_adv))
- tp->rcv_adv = tp->rcv_nxt + win;
- tp->last_ack_sent = tp->rcv_nxt;
- tp->t_flags &= ~(TF_ACKNOW|TF_DELACK);
- if (sendalot)
- goto again;
- return (0);
-}
-
-void
-tcp_setpersist(tp)
- register struct tcpcb *tp;
-{
- register int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1;
-
- if (tp->t_timer[TCPT_REXMT])
- panic("tcp_output REXMT");
- /*
- * Start/restart persistance timer.
- */
- TCPT_RANGESET(tp->t_timer[TCPT_PERSIST],
- t * tcp_backoff[tp->t_rxtshift],
- TCPTV_PERSMIN, TCPTV_PERSMAX);
- if (tp->t_rxtshift < TCP_MAXRXTSHIFT)
- tp->t_rxtshift++;
-}
diff --git a/cpukit/libnetworking/netinet/tcp_seq.h b/cpukit/libnetworking/netinet/tcp_seq.h
deleted file mode 100644
index 8cccf199e1..0000000000
--- a/cpukit/libnetworking/netinet/tcp_seq.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993, 1995
- * 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.
- *
- * @(#)tcp_seq.h 8.3 (Berkeley) 6/21/95
- * $Id$
- */
-
-#ifndef _NETINET_TCP_SEQ_H_
-#define _NETINET_TCP_SEQ_H_
-/*
- * TCP sequence numbers are 32 bit integers operated
- * on with modular arithmetic. These macros can be
- * used to compare such integers.
- */
-#define SEQ_LT(a,b) ((int)((a)-(b)) < 0)
-#define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0)
-#define SEQ_GT(a,b) ((int)((a)-(b)) > 0)
-#define SEQ_GEQ(a,b) ((int)((a)-(b)) >= 0)
-
-/* for modulo comparisons of timestamps */
-#define TSTMP_LT(a,b) ((int)((a)-(b)) < 0)
-#define TSTMP_GEQ(a,b) ((int)((a)-(b)) >= 0)
-
-/*
- * TCP connection counts are 32 bit integers operated
- * on with modular arithmetic. These macros can be
- * used to compare such integers.
- */
-#define CC_LT(a,b) ((int)((a)-(b)) < 0)
-#define CC_LEQ(a,b) ((int)((a)-(b)) <= 0)
-#define CC_GT(a,b) ((int)((a)-(b)) > 0)
-#define CC_GEQ(a,b) ((int)((a)-(b)) >= 0)
-
-/* Macro to increment a CC: skip 0 which has a special meaning */
-#define CC_INC(c) (++(c) == 0 ? ++(c) : (c))
-
-/*
- * Macros to initialize tcp sequence numbers for
- * send and receive from initial send and receive
- * sequence numbers.
- */
-#define tcp_rcvseqinit(tp) \
- (tp)->rcv_adv = (tp)->rcv_nxt = (tp)->irs + 1
-
-#define tcp_sendseqinit(tp) \
- (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \
- (tp)->iss
-
-#define TCP_PAWS_IDLE (24 * 24 * 60 * 60 * PR_SLOWHZ)
- /* timestamp wrap-around time */
-
-#ifdef KERNEL
-extern tcp_cc tcp_ccgen; /* global connection count */
-
-/*
- * Increment for tcp_iss each second.
- * This is designed to increment at the standard 250 KB/s,
- * but with a random component averaging 128 KB.
- * We also increment tcp_iss by a quarter of this amount
- * each time we use the value for a new connection.
- * If defined, the tcp_random18() macro should produce a
- * number in the range [0-0x3ffff] that is hard to predict.
- */
-#ifndef tcp_random18
-#define tcp_random18() ((random() >> 14) & 0x3ffff)
-#endif
-#define TCP_ISSINCR (122*1024 + tcp_random18())
-
-extern tcp_seq tcp_iss; /* tcp initial send seq # */
-#else
-#define TCP_ISSINCR (250*1024) /* increment for tcp_iss each second */
-#endif /* KERNEL */
-#endif /* _NETINET_TCP_SEQ_H_ */
diff --git a/cpukit/libnetworking/netinet/tcp_subr.c b/cpukit/libnetworking/netinet/tcp_subr.c
deleted file mode 100644
index a9cde3fdf0..0000000000
--- a/cpukit/libnetworking/netinet/tcp_subr.c
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/proc.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <net/route.h>
-#include <net/if.h>
-
-#define _IP_VHL
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-int tcp_mssdflt = TCP_MSS;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt,
- CTLFLAG_RW, &tcp_mssdflt , 0, "");
-
-static int tcp_do_rfc1323 = 1;
-static int tcp_do_rfc1644 = 1;
-#if !defined(__rtems__)
-static int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_RTTDFLT, rttdflt,
- CTLFLAG_RW, &tcp_rttdflt , 0, "");
-
-SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323,
- CTLFLAG_RW, &tcp_do_rfc1323 , 0, "");
-
-SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1644, rfc1644,
- CTLFLAG_RW, &tcp_do_rfc1644 , 0, "");
-#endif
-
-static void tcp_cleartaocache(void);
-static void tcp_notify __P((struct inpcb *, int));
-
-/*
- * Target size of TCP PCB hash table. Will be rounded down to a prime
- * number.
- */
-#ifndef TCBHASHSIZE
-#define TCBHASHSIZE 128
-#endif
-
-/*
- * Tcp initialization
- */
-void
-tcp_init()
-{
-
- tcp_iss = random(); /* wrong, but better than a constant */
- tcp_ccgen = 1;
- tcp_cleartaocache();
- LIST_INIT(&tcb);
- tcbinfo.listhead = &tcb;
- tcbinfo.hashbase = hashinit(TCBHASHSIZE, M_PCB, &tcbinfo.hashmask);
- if (max_protohdr < sizeof(struct tcpiphdr))
- max_protohdr = sizeof(struct tcpiphdr);
- if (max_linkhdr + sizeof(struct tcpiphdr) > MHLEN)
- panic("tcp_init");
-}
-
-/*
- * Create template to be used to send tcp packets on a connection.
- * Call after host entry created, allocates an mbuf and fills
- * in a skeletal tcp/ip header, minimizing the amount of work
- * necessary when the connection is used.
- */
-struct tcpiphdr *
-tcp_template(tp)
- struct tcpcb *tp;
-{
- register struct inpcb *inp = tp->t_inpcb;
- register struct mbuf *m;
- register struct tcpiphdr *n;
-
- if ((n = tp->t_template) == 0) {
- m = m_get(M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- return (0);
- m->m_len = sizeof (struct tcpiphdr);
- n = mtod(m, struct tcpiphdr *);
- }
- n->ti_next = n->ti_prev = 0;
- n->ti_x1 = 0;
- n->ti_pr = IPPROTO_TCP;
- n->ti_len = htons(sizeof (struct tcpiphdr) - sizeof (struct ip));
- n->ti_src = inp->inp_laddr;
- n->ti_dst = inp->inp_faddr;
- n->ti_sport = inp->inp_lport;
- n->ti_dport = inp->inp_fport;
- n->ti_seq = 0;
- n->ti_ack = 0;
- n->ti_x2 = 0;
- n->ti_off = 5;
- n->ti_flags = 0;
- n->ti_win = 0;
- n->ti_sum = 0;
- n->ti_urp = 0;
- return (n);
-}
-
-/*
- * Send a single message to the TCP at address specified by
- * the given TCP/IP header. If m == 0, then we make a copy
- * of the tcpiphdr at ti and send directly to the addressed host.
- * This is used to force keep alive messages out using the TCP
- * template for a connection tp->t_template. If flags are given
- * then we send a message back to the TCP which originated the
- * segment ti, and discard the mbuf containing it and any other
- * attached mbufs.
- *
- * In any case the ack and sequence number of the transmitted
- * segment are as specified by the parameters.
- *
- * NOTE: If m != NULL, then ti must point to *inside* the mbuf.
- */
-void
-tcp_respond(tp, ti, m, ack, seq, flags)
- struct tcpcb *tp;
- register struct tcpiphdr *ti;
- register struct mbuf *m;
- tcp_seq ack, seq;
- int flags;
-{
- register int tlen;
- int win = 0;
- struct route *ro = 0;
- struct route sro;
-
- if (tp) {
- win = sbspace(&tp->t_inpcb->inp_socket->so_rcv);
- ro = &tp->t_inpcb->inp_route;
- } else {
- ro = &sro;
- bzero(ro, sizeof *ro);
- }
- if (m == 0) {
- m = m_gethdr(M_DONTWAIT, MT_HEADER);
- if (m == NULL)
- return;
-#ifdef TCP_COMPAT_42
- tlen = 1;
-#else
- tlen = 0;
-#endif
- m->m_data += max_linkhdr;
- *mtod(m, struct tcpiphdr *) = *ti;
- ti = mtod(m, struct tcpiphdr *);
- flags = TH_ACK;
- } else {
- m_freem(m->m_next);
- m->m_next = 0;
- m->m_data = (caddr_t)ti;
- m->m_len = sizeof (struct tcpiphdr);
- tlen = 0;
-#define xchg(a,b,type) { type t; t=a; a=b; b=t; }
- xchg(ti->ti_dst.s_addr, ti->ti_src.s_addr, u_long);
- xchg(ti->ti_dport, ti->ti_sport, u_short);
-#undef xchg
- }
- ti->ti_len = htons((u_short)(sizeof (struct tcphdr) + tlen));
- tlen += sizeof (struct tcpiphdr);
- m->m_len = tlen;
- m->m_pkthdr.len = tlen;
- m->m_pkthdr.rcvif = (struct ifnet *) 0;
- ti->ti_next = ti->ti_prev = 0;
- ti->ti_x1 = 0;
- ti->ti_seq = htonl(seq);
- ti->ti_ack = htonl(ack);
- ti->ti_x2 = 0;
- ti->ti_off = sizeof (struct tcphdr) >> 2;
- ti->ti_flags = flags;
- if (tp)
- ti->ti_win = htons((u_short) (win >> tp->rcv_scale));
- else
- ti->ti_win = htons((u_short)win);
- ti->ti_urp = 0;
- ti->ti_sum = 0;
- ti->ti_sum = in_cksum(m, tlen);
- ((struct ip *)ti)->ip_len = tlen;
- ((struct ip *)ti)->ip_ttl = ip_defttl;
-#ifdef TCPDEBUG
- if (tp == NULL || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
- tcp_trace(TA_OUTPUT, 0, tp, ti, 0);
-#endif
- (void) ip_output(m, NULL, ro, 0, NULL);
- if (ro == &sro && ro->ro_rt) {
- RTFREE(ro->ro_rt);
- }
-}
-
-/*
- * Create a new TCP control block, making an
- * empty reassembly queue and hooking it to the argument
- * protocol control block.
- */
-struct tcpcb *
-tcp_newtcpcb(inp)
- struct inpcb *inp;
-{
- register struct tcpcb *tp;
-
- tp = malloc(sizeof(*tp), M_PCB, M_NOWAIT);
- if (tp == NULL)
- return ((struct tcpcb *)0);
- bzero((char *) tp, sizeof(struct tcpcb));
- tp->seg_next = tp->seg_prev = (struct tcpiphdr *)tp;
- tp->t_maxseg = tp->t_maxopd = tcp_mssdflt;
-
- if (tcp_do_rfc1323)
- tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP);
- if (tcp_do_rfc1644)
- tp->t_flags |= TF_REQ_CC;
- tp->t_inpcb = inp;
- /*
- * Init srtt to TCPTV_SRTTBASE (0), so we can tell that we have no
- * rtt estimate. Set rttvar so that srtt + 4 * rttvar gives
- * reasonable initial retransmit time.
- */
- tp->t_srtt = TCPTV_SRTTBASE;
- tp->t_rttvar = ((TCPTV_RTOBASE - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4;
- tp->t_rttmin = TCPTV_MIN;
- tp->t_rxtcur = TCPTV_RTOBASE;
- tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT;
- tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT;
- inp->inp_ip_ttl = ip_defttl;
- inp->inp_ppcb = (caddr_t)tp;
- return (tp);
-}
-
-/*
- * Drop a TCP connection, reporting
- * the specified error. If connection is synchronized,
- * then send a RST to peer.
- */
-struct tcpcb *
-tcp_drop(tp, errnum)
- register struct tcpcb *tp;
- int errnum;
-{
- struct socket *so = tp->t_inpcb->inp_socket;
-
- if (TCPS_HAVERCVDSYN(tp->t_state)) {
- tp->t_state = TCPS_CLOSED;
- (void) tcp_output(tp);
- tcpstat.tcps_drops++;
- } else
- tcpstat.tcps_conndrops++;
- if (errnum == ETIMEDOUT && tp->t_softerror)
- errnum = tp->t_softerror;
- so->so_error = errnum;
- return (tcp_close(tp));
-}
-
-/*
- * Close a TCP control block:
- * discard all space held by the tcp
- * discard internet protocol block
- * wake up any sleepers
- */
-struct tcpcb *
-tcp_close(tp)
- register struct tcpcb *tp;
-{
- register struct tcpiphdr *t;
- struct inpcb *inp = tp->t_inpcb;
- struct socket *so = inp->inp_socket;
- register struct mbuf *m;
- register struct rtentry *rt;
-
- /*
- * If we got enough samples through the srtt filter,
- * save the rtt and rttvar in the routing entry.
- * 'Enough' is arbitrarily defined as the 16 samples.
- * 16 samples is enough for the srtt filter to converge
- * to within 5% of the correct value; fewer samples and
- * we could save a very bogus rtt.
- *
- * Don't update the default route's characteristics and don't
- * update anything that the user "locked".
- */
- if (tp->t_rttupdated >= 16 &&
- (rt = inp->inp_route.ro_rt) &&
- ((struct sockaddr_in *)rt_key(rt))->sin_addr.s_addr != INADDR_ANY) {
- register u_long i = 0;
-
- if ((rt->rt_rmx.rmx_locks & RTV_RTT) == 0) {
- i = tp->t_srtt *
- (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTT_SCALE));
- if (rt->rt_rmx.rmx_rtt && i)
- /*
- * filter this update to half the old & half
- * the new values, converting scale.
- * See route.h and tcp_var.h for a
- * description of the scaling constants.
- */
- rt->rt_rmx.rmx_rtt =
- (rt->rt_rmx.rmx_rtt + i) / 2;
- else
- rt->rt_rmx.rmx_rtt = i;
- tcpstat.tcps_cachedrtt++;
- }
- if ((rt->rt_rmx.rmx_locks & RTV_RTTVAR) == 0) {
- i = tp->t_rttvar *
- (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTTVAR_SCALE));
- if (rt->rt_rmx.rmx_rttvar && i)
- rt->rt_rmx.rmx_rttvar =
- (rt->rt_rmx.rmx_rttvar + i) / 2;
- else
- rt->rt_rmx.rmx_rttvar = i;
- tcpstat.tcps_cachedrttvar++;
- }
- /*
- * update the pipelimit (ssthresh) if it has been updated
- * already or if a pipesize was specified & the threshhold
- * got below half the pipesize. I.e., wait for bad news
- * before we start updating, then update on both good
- * and bad news.
- */
- if (((rt->rt_rmx.rmx_locks & RTV_SSTHRESH) == 0 &&
- ((i = tp->snd_ssthresh) != 0) && rt->rt_rmx.rmx_ssthresh) ||
- i < (rt->rt_rmx.rmx_sendpipe / 2)) {
- /*
- * convert the limit from user data bytes to
- * packets then to packet data bytes.
- */
- i = (i + tp->t_maxseg / 2) / tp->t_maxseg;
- if (i < 2)
- i = 2;
- i *= (u_long)(tp->t_maxseg + sizeof (struct tcpiphdr));
- if (rt->rt_rmx.rmx_ssthresh)
- rt->rt_rmx.rmx_ssthresh =
- (rt->rt_rmx.rmx_ssthresh + i) / 2;
- else
- rt->rt_rmx.rmx_ssthresh = i;
- tcpstat.tcps_cachedssthresh++;
- }
- }
- /* free the reassembly queue, if any */
- t = tp->seg_next;
- while (t != (struct tcpiphdr *)tp) {
- t = (struct tcpiphdr *)t->ti_next;
- m = REASS_MBUF((struct tcpiphdr *)t->ti_prev);
- remque(t->ti_prev);
- m_freem(m);
- }
- if (tp->t_template)
- (void) m_free(dtom(tp->t_template));
- free(tp, M_PCB);
- inp->inp_ppcb = 0;
- soisdisconnected(so);
- in_pcbdetach(inp);
- tcpstat.tcps_closed++;
- return ((struct tcpcb *)0);
-}
-
-void
-tcp_drain()
-{
-
-}
-
-/*
- * Notify a tcp user of an asynchronous error;
- * store error as soft error, but wake up user
- * (for now, won't do anything until can select for soft error).
- */
-static void
-tcp_notify(inp, error)
- struct inpcb *inp;
- int error;
-{
- register struct tcpcb *tp = (struct tcpcb *)inp->inp_ppcb;
- register struct socket *so = inp->inp_socket;
-
- /*
- * Ignore some errors if we are hooked up.
- * If connection hasn't completed, has retransmitted several times,
- * and receives a second error, give up now. This is better
- * than waiting a long time to establish a connection that
- * can never complete.
- */
- if (tp->t_state == TCPS_ESTABLISHED &&
- (error == EHOSTUNREACH || error == ENETUNREACH ||
- error == EHOSTDOWN)) {
- return;
- } else if (tp->t_state < TCPS_ESTABLISHED && tp->t_rxtshift > 3 &&
- tp->t_softerror)
- so->so_error = error;
- else
- tp->t_softerror = error;
- soconnwakeup (so);
- sorwakeup(so);
- sowwakeup(so);
-}
-
-void
-tcp_ctlinput(cmd, sa, vip)
- int cmd;
- struct sockaddr *sa;
- void *vip;
-{
- register struct ip *ip = vip;
- register struct tcphdr *th;
- void (*notify) __P((struct inpcb *, int)) = tcp_notify;
-
- if (cmd == PRC_QUENCH)
- notify = tcp_quench;
-#if 1
- else if (cmd == PRC_MSGSIZE)
- notify = tcp_mtudisc;
-#endif
- else if (!PRC_IS_REDIRECT(cmd) &&
- ((unsigned)cmd > PRC_NCMDS || inetctlerrmap[cmd] == 0))
- return;
- if (ip) {
- th = (struct tcphdr *)((caddr_t)ip
- + (IP_VHL_HL(ip->ip_vhl) << 2));
- in_pcbnotify(&tcb, sa, th->th_dport, ip->ip_src, th->th_sport,
- cmd, notify);
- } else
- in_pcbnotify(&tcb, sa, 0, zeroin_addr, 0, cmd, notify);
-}
-
-/*
- * When a source quench is received, close congestion window
- * to one segment. We will gradually open it again as we proceed.
- */
-void
-tcp_quench(inp, errnum)
- struct inpcb *inp;
- int errnum;
-{
- struct tcpcb *tp = intotcpcb(inp);
-
- if (tp)
- tp->snd_cwnd = tp->t_maxseg;
-}
-
-#if 1
-/*
- * When `need fragmentation' ICMP is received, update our idea of the MSS
- * based on the new value in the route. Also nudge TCP to send something,
- * since we know the packet we just sent was dropped.
- * This duplicates some code in the tcp_mss() function in tcp_input.c.
- */
-void
-tcp_mtudisc(inp, errnum)
- struct inpcb *inp;
- int errnum;
-{
- struct tcpcb *tp = intotcpcb(inp);
- struct rtentry *rt;
- struct rmxp_tao *taop;
- struct socket *so = inp->inp_socket;
- int offered;
- int mss;
-
- if (tp) {
- rt = tcp_rtlookup(inp);
- if (!rt || !rt->rt_rmx.rmx_mtu) {
- tp->t_maxopd = tp->t_maxseg = tcp_mssdflt;
- return;
- }
- taop = rmx_taop(rt->rt_rmx);
- offered = taop->tao_mssopt;
- mss = rt->rt_rmx.rmx_mtu - sizeof(struct tcpiphdr);
- if (offered)
- mss = min(mss, offered);
- /*
- * XXX - The above conditional probably violates the TCP
- * spec. The problem is that, since we don't know the
- * other end's MSS, we are supposed to use a conservative
- * default. But, if we do that, then MTU discovery will
- * never actually take place, because the conservative
- * default is much less than the MTUs typically seen
- * on the Internet today. For the moment, we'll sweep
- * this under the carpet.
- *
- * The conservative default might not actually be a problem
- * if the only case this occurs is when sending an initial
- * SYN with options and data to a host we've never talked
- * to before. Then, they will reply with an MSS value which
- * will get recorded and the new parameters should get
- * recomputed. For Further Study.
- */
- if (tp->t_maxopd <= mss)
- return;
- tp->t_maxopd = mss;
-
- if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP &&
- (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP)
- mss -= TCPOLEN_TSTAMP_APPA;
- if ((tp->t_flags & (TF_REQ_CC|TF_NOOPT)) == TF_REQ_CC &&
- (tp->t_flags & TF_RCVD_CC) == TF_RCVD_CC)
- mss -= TCPOLEN_CC_APPA;
-#if (MCLBYTES & (MCLBYTES - 1)) == 0
- if (mss > MCLBYTES)
- mss &= ~(MCLBYTES-1);
-#else
- if (mss > MCLBYTES)
- mss = mss / MCLBYTES * MCLBYTES;
-#endif
- if (so->so_snd.sb_hiwat < mss)
- mss = so->so_snd.sb_hiwat;
-
- tp->t_maxseg = mss;
-
- tcpstat.tcps_mturesent++;
- tp->t_rtt = 0;
- tp->snd_nxt = tp->snd_una;
- tcp_output(tp);
- }
-}
-#endif
-
-/*
- * Look-up the routing entry to the peer of this inpcb. If no route
- * is found and it cannot be allocated the return NULL. This routine
- * is called by TCP routines that access the rmx structure and by tcp_mss
- * to get the interface MTU.
- */
-struct rtentry *
-tcp_rtlookup(inp)
- struct inpcb *inp;
-{
- struct route *ro;
- struct rtentry *rt;
-
- ro = &inp->inp_route;
- rt = ro->ro_rt;
- if (rt == NULL || !(rt->rt_flags & RTF_UP)) {
- /* No route yet, so try to acquire one */
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- ro->ro_dst.sa_family = AF_INET;
- ro->ro_dst.sa_len = sizeof(ro->ro_dst);
- ((struct sockaddr_in *) &ro->ro_dst)->sin_addr =
- inp->inp_faddr;
- rtalloc(ro);
- rt = ro->ro_rt;
- }
- }
- return rt;
-}
-
-/*
- * Return a pointer to the cached information about the remote host.
- * The cached information is stored in the protocol specific part of
- * the route metrics.
- */
-struct rmxp_tao *
-tcp_gettaocache(inp)
- struct inpcb *inp;
-{
- struct rtentry *rt = tcp_rtlookup(inp);
-
- /* Make sure this is a host route and is up. */
- if (rt == NULL ||
- (rt->rt_flags & (RTF_UP|RTF_HOST)) != (RTF_UP|RTF_HOST))
- return NULL;
-
- return rmx_taop(rt->rt_rmx);
-}
-
-/*
- * Clear all the TAO cache entries, called from tcp_init.
- *
- * XXX
- * This routine is just an empty one, because we assume that the routing
- * routing tables are initialized at the same time when TCP, so there is
- * nothing in the cache left over.
- */
-static void
-tcp_cleartaocache(void)
-{ }
diff --git a/cpukit/libnetworking/netinet/tcp_timer.c b/cpukit/libnetworking/netinet/tcp_timer.c
deleted file mode 100644
index 04d3d604e2..0000000000
--- a/cpukit/libnetworking/netinet/tcp_timer.c
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#ifndef TUBA_INCLUDE
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-
-#include <machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-int tcp_keepinit = TCPTV_KEEP_INIT;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit,
- CTLFLAG_RW, &tcp_keepinit , 0, "");
-
-int tcp_keepidle = TCPTV_KEEP_IDLE;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPIDLE, keepidle,
- CTLFLAG_RW, &tcp_keepidle , 0, "");
-
-static int tcp_keepintvl = TCPTV_KEEPINTVL;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPINTVL, keepintvl,
- CTLFLAG_RW, &tcp_keepintvl , 0, "");
-
-static int always_keepalive = 0;
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive,
- CTLFLAG_RW, &always_keepalive , 0, "");
-
-static int tcp_keepcnt = TCPTV_KEEPCNT;
- /* max idle probes */
-static int tcp_maxpersistidle = TCPTV_KEEP_IDLE;
- /* max idle time in persist */
-int tcp_maxidle;
-#else /* TUBA_INCLUDE */
-
-static int tcp_maxpersistidle;
-#endif /* TUBA_INCLUDE */
-
-/*
- * Fast timeout routine for processing delayed acks
- */
-void
-tcp_fasttimo()
-{
- register struct inpcb *inp;
- register struct tcpcb *tp;
- int s;
-
- s = splnet();
-
- for (inp = tcb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if ((tp = (struct tcpcb *)inp->inp_ppcb) &&
- (tp->t_flags & TF_DELACK)) {
- tp->t_flags &= ~TF_DELACK;
- tp->t_flags |= TF_ACKNOW;
- tcpstat.tcps_delack++;
- (void) tcp_output(tp);
- }
- }
- splx(s);
-}
-
-/*
- * Tcp protocol timeout routine called every 500 ms.
- * Updates the timers in all active tcb's and
- * causes finite state machine actions if timers expire.
- */
-void
-tcp_slowtimo()
-{
- register struct inpcb *ip, *ipnxt;
- register struct tcpcb *tp;
- register int i;
- int s;
-#ifdef TCPDEBUG
- int ostate;
-#endif
-
- s = splnet();
-
- tcp_maxidle = tcp_keepcnt * tcp_keepintvl;
-
- ip = tcb.lh_first;
- if (ip == NULL) {
- splx(s);
- return;
- }
- /*
- * Search through tcb's and update active timers.
- */
- for (; ip != NULL; ip = ipnxt) {
- ipnxt = ip->inp_list.le_next;
- tp = intotcpcb(ip);
- if (tp == 0 || tp->t_state == TCPS_LISTEN)
- continue;
- for (i = 0; i < TCPT_NTIMERS; i++) {
- if (tp->t_timer[i] && --tp->t_timer[i] == 0) {
-#ifdef TCPDEBUG
- ostate = tp->t_state;
-#endif
- tp = tcp_timers(tp, i);
- if (tp == NULL)
- goto tpgone;
-#ifdef TCPDEBUG
- if (tp->t_inpcb->inp_socket->so_options
- & SO_DEBUG)
- tcp_trace(TA_USER, ostate, tp,
- (struct tcpiphdr *)0,
- PRU_SLOWTIMO);
-#endif
- }
- }
- tp->t_idle++;
- tp->t_duration++;
- if (tp->t_rtt)
- tp->t_rtt++;
-tpgone:
- ;
- }
- tcp_iss += TCP_ISSINCR/PR_SLOWHZ; /* increment iss */
-#ifdef TCP_COMPAT_42
- if ((int)tcp_iss < 0)
- tcp_iss = TCP_ISSINCR; /* XXX */
-#endif
- tcp_now++; /* for timestamps */
- splx(s);
-}
-#ifndef TUBA_INCLUDE
-
-/*
- * Cancel all timers for TCP tp.
- */
-void
-tcp_canceltimers(tp)
- struct tcpcb *tp;
-{
- register int i;
-
- for (i = 0; i < TCPT_NTIMERS; i++)
- tp->t_timer[i] = 0;
-}
-
-int tcp_backoff[TCP_MAXRXTSHIFT + 1] =
- { 1, 2, 4, 8, 16, 32, 64, 64, 64, 64, 64, 64, 64 };
-
-static int tcp_totbackoff = 511; /* sum of tcp_backoff[] */
-
-/*
- * TCP timer processing.
- */
-struct tcpcb *
-tcp_timers(tp, timer)
- register struct tcpcb *tp;
- int timer;
-{
- register int rexmt;
-
- switch (timer) {
-
- /*
- * 2 MSL timeout in shutdown went off. If we're closed but
- * still waiting for peer to close and connection has been idle
- * too long, or if 2MSL time is up from TIME_WAIT, delete connection
- * control block. Otherwise, check again in a bit.
- */
- case TCPT_2MSL:
- if (tp->t_state != TCPS_TIME_WAIT &&
- tp->t_idle <= tcp_maxidle)
- tp->t_timer[TCPT_2MSL] = tcp_keepintvl;
- else
- tp = tcp_close(tp);
- break;
-
- /*
- * Retransmission timer went off. Message has not
- * been acked within retransmit interval. Back off
- * to a longer retransmit interval and retransmit one segment.
- */
- case TCPT_REXMT:
- if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) {
- tp->t_rxtshift = TCP_MAXRXTSHIFT;
- tcpstat.tcps_timeoutdrop++;
- tp = tcp_drop(tp, tp->t_softerror ?
- tp->t_softerror : ETIMEDOUT);
- break;
- }
- tcpstat.tcps_rexmttimeo++;
- rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
- TCPT_RANGESET(tp->t_rxtcur, rexmt,
- tp->t_rttmin, TCPTV_REXMTMAX);
- tp->t_timer[TCPT_REXMT] = tp->t_rxtcur;
- /*
- * If losing, let the lower level know and try for
- * a better route. Also, if we backed off this far,
- * our srtt estimate is probably bogus. Clobber it
- * so we'll take the next rtt measurement as our srtt;
- * move the current srtt into rttvar to keep the current
- * retransmit times until then.
- */
- if (tp->t_rxtshift > TCP_MAXRXTSHIFT / 4) {
- in_losing(tp->t_inpcb);
- tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT);
- tp->t_srtt = 0;
- }
- tp->snd_nxt = tp->snd_una;
- /*
- * Force a segment to be sent.
- */
- tp->t_flags |= TF_ACKNOW;
- /*
- * If timing a segment in this window, stop the timer.
- */
- tp->t_rtt = 0;
- /*
- * Close the congestion window down to one segment
- * (we'll open it by one segment for each ack we get).
- * Since we probably have a window's worth of unacked
- * data accumulated, this "slow start" keeps us from
- * dumping all that data as back-to-back packets (which
- * might overwhelm an intermediate gateway).
- *
- * There are two phases to the opening: Initially we
- * open by one mss on each ack. This makes the window
- * size increase exponentially with time. If the
- * window is larger than the path can handle, this
- * exponential growth results in dropped packet(s)
- * almost immediately. To get more time between
- * drops but still "push" the network to take advantage
- * of improving conditions, we switch from exponential
- * to linear window opening at some threshhold size.
- * For a threshhold, we use half the current window
- * size, truncated to a multiple of the mss.
- *
- * (the minimum cwnd that will give us exponential
- * growth is 2 mss. We don't allow the threshhold
- * to go below this.)
- */
- {
- u_int win = min(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg;
- if (win < 2)
- win = 2;
- tp->snd_cwnd = tp->t_maxseg;
- tp->snd_ssthresh = win * tp->t_maxseg;
- tp->t_dupacks = 0;
- }
- (void) tcp_output(tp);
- break;
-
- /*
- * Persistance timer into zero window.
- * Force a byte to be output, if possible.
- */
- case TCPT_PERSIST:
- tcpstat.tcps_persisttimeo++;
- /*
- * Hack: if the peer is dead/unreachable, we do not
- * time out if the window is closed. After a full
- * backoff, drop the connection if the idle time
- * (no responses to probes) reaches the maximum
- * backoff that we would use if retransmitting.
- */
- if (tp->t_rxtshift == TCP_MAXRXTSHIFT) {
- u_long maxidle = TCP_REXMTVAL(tp);
- if (maxidle < tp->t_rttmin)
- maxidle = tp->t_rttmin;
- maxidle *= tcp_totbackoff;
- if (tp->t_idle >= tcp_maxpersistidle ||
- tp->t_idle >= maxidle) {
- tcpstat.tcps_persistdrop++;
- tp = tcp_drop(tp, ETIMEDOUT);
- break;
- }
- }
- tcp_setpersist(tp);
- tp->t_force = 1;
- (void) tcp_output(tp);
- tp->t_force = 0;
- break;
-
- /*
- * Keep-alive timer went off; send something
- * or drop connection if idle for too long.
- */
- case TCPT_KEEP:
- tcpstat.tcps_keeptimeo++;
- if (tp->t_state < TCPS_ESTABLISHED)
- goto dropit;
- if ((always_keepalive ||
- tp->t_inpcb->inp_socket->so_options & SO_KEEPALIVE) &&
- tp->t_state <= TCPS_CLOSING) {
- if (tp->t_idle >= tcp_keepidle + tcp_maxidle)
- goto dropit;
- /*
- * Send a packet designed to force a response
- * if the peer is up and reachable:
- * either an ACK if the connection is still alive,
- * or an RST if the peer has closed the connection
- * due to timeout or reboot.
- * Using sequence number tp->snd_una-1
- * causes the transmitted zero-length segment
- * to lie outside the receive window;
- * by the protocol spec, this requires the
- * correspondent TCP to respond.
- */
- tcpstat.tcps_keepprobe++;
-#ifdef TCP_COMPAT_42
- /*
- * The keepalive packet must have nonzero length
- * to get a 4.2 host to respond.
- */
- tcp_respond(tp, tp->t_template, (struct mbuf *)NULL,
- tp->rcv_nxt - 1, tp->snd_una - 1, 0);
-#else
- tcp_respond(tp, tp->t_template, (struct mbuf *)NULL,
- tp->rcv_nxt, tp->snd_una - 1, 0);
-#endif
- tp->t_timer[TCPT_KEEP] = tcp_keepintvl;
- } else
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
- break;
- dropit:
- tcpstat.tcps_keepdrops++;
- tp = tcp_drop(tp, ETIMEDOUT);
- break;
- }
- return (tp);
-}
-#endif /* TUBA_INCLUDE */
diff --git a/cpukit/libnetworking/netinet/tcp_timer.h b/cpukit/libnetworking/netinet/tcp_timer.h
deleted file mode 100644
index 38ffac4ee7..0000000000
--- a/cpukit/libnetworking/netinet/tcp_timer.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcp_timer.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCP_TIMER_H_
-#define _NETINET_TCP_TIMER_H_
-
-/*
- * Definitions of the TCP timers. These timers are counted
- * down PR_SLOWHZ times a second.
- */
-#define TCPT_NTIMERS 4
-
-#define TCPT_REXMT 0 /* retransmit */
-#define TCPT_PERSIST 1 /* retransmit persistence */
-#define TCPT_KEEP 2 /* keep alive */
-#define TCPT_2MSL 3 /* 2*msl quiet time timer */
-
-/*
- * The TCPT_REXMT timer is used to force retransmissions.
- * The TCP has the TCPT_REXMT timer set whenever segments
- * have been sent for which ACKs are expected but not yet
- * received. If an ACK is received which advances tp->snd_una,
- * then the retransmit timer is cleared (if there are no more
- * outstanding segments) or reset to the base value (if there
- * are more ACKs expected). Whenever the retransmit timer goes off,
- * we retransmit one unacknowledged segment, and do a backoff
- * on the retransmit timer.
- *
- * The TCPT_PERSIST timer is used to keep window size information
- * flowing even if the window goes shut. If all previous transmissions
- * have been acknowledged (so that there are no retransmissions in progress),
- * and the window is too small to bother sending anything, then we start
- * the TCPT_PERSIST timer. When it expires, if the window is nonzero,
- * we go to transmit state. Otherwise, at intervals send a single byte
- * into the peer's window to force him to update our window information.
- * We do this at most as often as TCPT_PERSMIN time intervals,
- * but no more frequently than the current estimate of round-trip
- * packet time. The TCPT_PERSIST timer is cleared whenever we receive
- * a window update from the peer.
- *
- * The TCPT_KEEP timer is used to keep connections alive. If an
- * connection is idle (no segments received) for TCPTV_KEEP_INIT amount of time,
- * but not yet established, then we drop the connection. Once the connection
- * is established, if the connection is idle for TCPTV_KEEP_IDLE time
- * (and keepalives have been enabled on the socket), we begin to probe
- * the connection. We force the peer to send us a segment by sending:
- * <SEQ=SND.UNA-1><ACK=RCV.NXT><CTL=ACK>
- * This segment is (deliberately) outside the window, and should elicit
- * an ack segment in response from the peer. If, despite the TCPT_KEEP
- * initiated segments we cannot elicit a response from a peer in TCPT_MAXIDLE
- * amount of time probing, then we drop the connection.
- */
-
-/*
- * Time constants.
- */
-#define TCPTV_MSL ( 30*PR_SLOWHZ) /* max seg lifetime (hah!) */
-#define TCPTV_SRTTBASE 0 /* base roundtrip time;
- if 0, no idea yet */
-#define TCPTV_RTOBASE ( 3*PR_SLOWHZ) /* assumed RTO if no info */
-#define TCPTV_SRTTDFLT ( 3*PR_SLOWHZ) /* assumed RTT if no info */
-
-#define TCPTV_PERSMIN ( 5*PR_SLOWHZ) /* retransmit persistence */
-#define TCPTV_PERSMAX ( 60*PR_SLOWHZ) /* maximum persist interval */
-
-#define TCPTV_KEEP_INIT ( 75*PR_SLOWHZ) /* initial connect keep alive */
-#define TCPTV_KEEP_IDLE (120*60*PR_SLOWHZ) /* dflt time before probing */
-#define TCPTV_KEEPINTVL ( 75*PR_SLOWHZ) /* default probe interval */
-#define TCPTV_KEEPCNT 8 /* max probes before drop */
-
-#define TCPTV_MIN ( 1*PR_SLOWHZ) /* minimum allowable value */
-#define TCPTV_REXMTMAX ( 64*PR_SLOWHZ) /* max allowable REXMT value */
-
-#define TCPTV_TWTRUNC 8 /* RTO factor to truncate TW */
-
-#define TCP_LINGERTIME 120 /* linger at most 2 minutes */
-
-#define TCP_MAXRXTSHIFT 12 /* maximum retransmits */
-
-#ifdef TCPTIMERS
-static char *tcptimers[] =
- { "REXMT", "PERSIST", "KEEP", "2MSL" };
-#endif
-
-/*
- * Force a time value to be in a certain range.
- */
-#define TCPT_RANGESET(tv, value, tvmin, tvmax) { \
- (tv) = (value); \
- if ((u_long)(tv) < (u_long)(tvmin)) \
- (tv) = (tvmin); \
- else if ((u_long)(tv) > (u_long)(tvmax)) \
- (tv) = (tvmax); \
-}
-
-#ifdef KERNEL
-extern int tcp_keepinit; /* time to establish connection */
-extern int tcp_keepidle; /* time before keepalive probes begin */
-extern int tcp_keepintvl; /* time between keepalive probes */
-extern int tcp_maxidle; /* time to drop after starting probes */
-extern int tcp_ttl; /* time to live for TCP segs */
-extern int tcp_backoff[];
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/netinet/tcp_usrreq.c b/cpukit/libnetworking/netinet/tcp_usrreq.c
deleted file mode 100644
index ecd9d95636..0000000000
--- a/cpukit/libnetworking/netinet/tcp_usrreq.c
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94
- * $Id$
- */
-
-#include "opt_tcpdebug.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/errno.h>
-#include <sys/stat.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_fsm.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/tcpip.h>
-#ifdef TCPDEBUG
-#include <netinet/tcp_debug.h>
-#endif
-
-/*
- * TCP protocol interface to socket abstraction.
- */
-extern char *tcpstates[];
-
-static int tcp_attach __P((struct socket *));
-static int tcp_connect __P((struct tcpcb *, struct mbuf *));
-static struct tcpcb *
- tcp_disconnect __P((struct tcpcb *));
-static struct tcpcb *
- tcp_usrclosed __P((struct tcpcb *));
-
-#ifdef TCPDEBUG
-#define TCPDEBUG0 int ostate
-#define TCPDEBUG1() ostate = tp ? tp->t_state : 0
-#define TCPDEBUG2(req) if (tp && (so->so_options & SO_DEBUG)) \
- tcp_trace(TA_USER, ostate, tp, 0, req)
-#else
-#define TCPDEBUG0
-#define TCPDEBUG1()
-#define TCPDEBUG2(req)
-#endif
-
-/*
- * TCP attaches to socket via pru_attach(), reserving space,
- * and an internet control block.
- */
-static int
-tcp_usr_attach(struct socket *so, int proto)
-{
- int s = splnet();
- int error;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp = 0;
- TCPDEBUG0;
-
- TCPDEBUG1();
- if (inp) {
- error = EISCONN;
- goto out;
- }
-
- error = tcp_attach(so);
- if (error)
- goto out;
-
- if ((so->so_options & SO_LINGER) && so->so_linger == 0)
- so->so_linger = TCP_LINGERTIME * hz;
- tp = sototcpcb(so);
-out:
- TCPDEBUG2(PRU_ATTACH);
- splx(s);
- return error;
-}
-
-/*
- * pru_detach() detaches the TCP protocol from the socket.
- * If the protocol state is non-embryonic, then can't
- * do this directly: have to initiate a pru_disconnect(),
- * which may finish later; embryonic TCB's can just
- * be discarded here.
- */
-static int
-tcp_usr_detach(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
- TCPDEBUG0;
-
- if (inp == 0) {
- splx(s);
- return EINVAL; /* XXX */
- }
- tp = intotcpcb(inp);
- TCPDEBUG1();
- if (tp->t_state > TCPS_LISTEN)
- tp = tcp_disconnect(tp);
- else
- tp = tcp_close(tp);
-
- TCPDEBUG2(PRU_DETACH);
- splx(s);
- return error;
-}
-
-#define COMMON_START() TCPDEBUG0; \
- do { \
- if (inp == 0) { \
- splx(s); \
- return EINVAL; \
- } \
- tp = intotcpcb(inp); \
- TCPDEBUG1(); \
- } while(0)
-
-#define COMMON_END(req) out: TCPDEBUG2(req); splx(s); return error; goto out
-
-
-/*
- * Give the socket an address.
- */
-static int
-tcp_usr_bind(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
- struct sockaddr_in *sinp;
-
- COMMON_START();
-
- /*
- * Must check for multicast addresses and disallow binding
- * to them.
- */
- sinp = mtod(nam, struct sockaddr_in *);
- if (sinp->sin_family == AF_INET &&
- IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) {
- error = EAFNOSUPPORT;
- goto out;
- }
- error = in_pcbbind(inp, nam);
- if (error)
- goto out;
- COMMON_END(PRU_BIND);
-
-}
-
-/*
- * Prepare to accept connections.
- */
-static int
-tcp_usr_listen(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- if (inp->inp_lport == 0)
- error = in_pcbbind(inp, NULL);
- if (error == 0)
- tp->t_state = TCPS_LISTEN;
- COMMON_END(PRU_LISTEN);
-}
-
-/*
- * Initiate connection to peer.
- * Create a template for use in transmissions on this connection.
- * Enter SYN_SENT state, and mark socket as connecting.
- * Start keep-alive timer, and seed output sequence space.
- * Send initial segment on connection.
- */
-static int
-tcp_usr_connect(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
- struct sockaddr_in *sinp;
-
- COMMON_START();
-
- /*
- * Must disallow TCP ``connections'' to multicast addresses.
- */
- sinp = mtod(nam, struct sockaddr_in *);
- if (sinp->sin_family == AF_INET
- && IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) {
- error = EAFNOSUPPORT;
- goto out;
- }
-
- if ((error = tcp_connect(tp, nam)) != 0)
- goto out;
- error = tcp_output(tp);
- COMMON_END(PRU_CONNECT);
-}
-
-/*
- * Initiate disconnect from peer.
- * If connection never passed embryonic stage, just drop;
- * else if don't need to let data drain, then can just drop anyways,
- * else have to begin TCP shutdown process: mark socket disconnecting,
- * drain unread data, state switch to reflect user close, and
- * send segment (e.g. FIN) to peer. Socket will be really disconnected
- * when peer sends FIN and acks ours.
- *
- * SHOULD IMPLEMENT LATER PRU_CONNECT VIA REALLOC TCPCB.
- */
-static int
-tcp_usr_disconnect(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- tp = tcp_disconnect(tp);
- COMMON_END(PRU_DISCONNECT);
-}
-
-/*
- * Accept a connection. Essentially all the work is
- * done at higher levels; just return the address
- * of the peer, storing through addr.
- */
-static int
-tcp_usr_accept(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- in_setpeeraddr(inp, nam);
- COMMON_END(PRU_ACCEPT);
-}
-
-/*
- * Mark the connection as being incapable of further output.
- */
-static int
-tcp_usr_shutdown(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- socantsendmore(so);
- tp = tcp_usrclosed(tp);
- if (tp)
- error = tcp_output(tp);
- COMMON_END(PRU_SHUTDOWN);
-}
-
-/*
- * After a receive, possibly send window update to peer.
- */
-static int
-tcp_usr_rcvd(struct socket *so, int flags)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- tcp_output(tp);
- COMMON_END(PRU_RCVD);
-}
-
-/*
- * Do a send by putting data in output queue and updating urgent
- * marker if URG set. Possibly send more data.
- */
-static int
-tcp_usr_send(struct socket *so, int flags, struct mbuf *m, struct mbuf *nam,
- struct mbuf *control)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- if (control && control->m_len) {
- m_freem(control); /* XXX shouldn't caller do this??? */
- if (m)
- m_freem(m);
- error = EINVAL;
- goto out;
- }
-
- if(!(flags & PRUS_OOB)) {
- sbappend(&so->so_snd, m);
- if (nam && tp->t_state < TCPS_SYN_SENT) {
- /*
- * Do implied connect if not yet connected,
- * initialize window to default value, and
- * initialize maxseg/maxopd using peer's cached
- * MSS.
- */
- error = tcp_connect(tp, nam);
- if (error)
- goto out;
- tp->snd_wnd = TTCP_CLIENT_SND_WND;
- tcp_mss(tp, -1);
- }
-
- if (flags & PRUS_EOF) {
- /*
- * Close the send side of the connection after
- * the data is sent.
- */
- socantsendmore(so);
- tp = tcp_usrclosed(tp);
- }
- if (tp != NULL)
- error = tcp_output(tp);
- } else {
- if (sbspace(&so->so_snd) < -512) {
- m_freem(m);
- error = ENOBUFS;
- goto out;
- }
- /*
- * According to RFC961 (Assigned Protocols),
- * the urgent pointer points to the last octet
- * of urgent data. We continue, however,
- * to consider it to indicate the first octet
- * of data past the urgent section.
- * Otherwise, snd_up should be one lower.
- */
- sbappend(&so->so_snd, m);
- if (nam && tp->t_state < TCPS_SYN_SENT) {
- /*
- * Do implied connect if not yet connected,
- * initialize window to default value, and
- * initialize maxseg/maxopd using peer's cached
- * MSS.
- */
- error = tcp_connect(tp, nam);
- if (error)
- goto out;
- tp->snd_wnd = TTCP_CLIENT_SND_WND;
- tcp_mss(tp, -1);
- }
- tp->snd_up = tp->snd_una + so->so_snd.sb_cc;
- tp->t_force = 1;
- error = tcp_output(tp);
- tp->t_force = 0;
- }
- COMMON_END((flags & PRUS_OOB) ? PRU_SENDOOB :
- ((flags & PRUS_EOF) ? PRU_SEND_EOF : PRU_SEND));
-}
-
-/*
- * Abort the TCP.
- */
-static int
-tcp_usr_abort(struct socket *so)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- tp = tcp_drop(tp, ECONNABORTED);
- COMMON_END(PRU_ABORT);
-}
-
-/*
- * Fill in st_bklsize for fstat() operations on a socket.
- */
-static int
-tcp_usr_sense(struct socket *so, struct stat *sb)
-{
- int s = splnet();
-
- sb->st_blksize = so->so_snd.sb_hiwat;
- splx(s);
- return 0;
-}
-
-/*
- * Receive out-of-band data.
- */
-static int
-tcp_usr_rcvoob(struct socket *so, struct mbuf *m, int flags)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- if ((so->so_oobmark == 0 &&
- (so->so_state & SS_RCVATMARK) == 0) ||
- so->so_options & SO_OOBINLINE ||
- tp->t_oobflags & TCPOOB_HADDATA) {
- error = EINVAL;
- goto out;
- }
- if ((tp->t_oobflags & TCPOOB_HAVEDATA) == 0) {
- error = EWOULDBLOCK;
- goto out;
- }
- m->m_len = 1;
- *mtod(m, caddr_t) = tp->t_iobc;
- if ((flags & MSG_PEEK) == 0)
- tp->t_oobflags ^= (TCPOOB_HAVEDATA | TCPOOB_HADDATA);
- COMMON_END(PRU_RCVOOB);
-}
-
-static int
-tcp_usr_sockaddr(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- in_setsockaddr(inp, nam);
- COMMON_END(PRU_SOCKADDR);
-}
-
-static int
-tcp_usr_peeraddr(struct socket *so, struct mbuf *nam)
-{
- int s = splnet();
- int error = 0;
- struct inpcb *inp = sotoinpcb(so);
- struct tcpcb *tp;
-
- COMMON_START();
- in_setpeeraddr(inp, nam);
- COMMON_END(PRU_PEERADDR);
-}
-
-/*
- * XXX - this should just be a call to in_control, but we need to get
- * the types worked out.
- */
-static int
-tcp_usr_control(struct socket *so, int cmd, caddr_t arg, struct ifnet *ifp)
-{
- return in_control(so, cmd, arg, ifp);
-}
-
-/* xxx - should be const */
-struct pr_usrreqs tcp_usrreqs = {
- tcp_usr_abort, tcp_usr_accept, tcp_usr_attach, tcp_usr_bind,
- tcp_usr_connect, pru_connect2_notsupp, tcp_usr_control, tcp_usr_detach,
- tcp_usr_disconnect, tcp_usr_listen, tcp_usr_peeraddr, tcp_usr_rcvd,
- tcp_usr_rcvoob, tcp_usr_send, tcp_usr_sense, tcp_usr_shutdown,
- tcp_usr_sockaddr
-};
-
-/*
- * Common subroutine to open a TCP connection to remote host specified
- * by struct sockaddr_in in mbuf *nam. Call in_pcbbind to assign a local
- * port number if needed. Call in_pcbladdr to do the routing and to choose
- * a local host address (interface). If there is an existing incarnation
- * of the same connection in TIME-WAIT state and if the remote host was
- * sending CC options and if the connection duration was < MSL, then
- * truncate the previous TIME-WAIT state and proceed.
- * Initialize connection parameters and enter SYN-SENT state.
- */
-static int
-tcp_connect(tp, nam)
- register struct tcpcb *tp;
- struct mbuf *nam;
-{
- struct inpcb *inp = tp->t_inpcb, *oinp;
- struct socket *so = inp->inp_socket;
- struct tcpcb *otp;
- struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *);
- struct sockaddr_in *ifaddr;
- int error;
- struct rmxp_tao *taop;
- struct rmxp_tao tao_noncached;
-
- if (inp->inp_lport == 0) {
- error = in_pcbbind(inp, NULL);
- if (error)
- return error;
- }
-
- /*
- * Cannot simply call in_pcbconnect, because there might be an
- * earlier incarnation of this same connection still in
- * TIME_WAIT state, creating an ADDRINUSE error.
- */
- error = in_pcbladdr(inp, nam, &ifaddr);
- if (error)
- return error;
- oinp = in_pcblookuphash(inp->inp_pcbinfo,
- sin->sin_addr, sin->sin_port,
- inp->inp_laddr.s_addr != INADDR_ANY ? inp->inp_laddr
- : ifaddr->sin_addr,
- inp->inp_lport, 0);
- if (oinp) {
- if (oinp != inp && (otp = intotcpcb(oinp)) != NULL &&
- otp->t_state == TCPS_TIME_WAIT &&
- otp->t_duration < TCPTV_MSL &&
- (otp->t_flags & TF_RCVD_CC))
- otp = tcp_close(otp);
- else
- return EADDRINUSE;
- }
- if (inp->inp_laddr.s_addr == INADDR_ANY)
- inp->inp_laddr = ifaddr->sin_addr;
- inp->inp_faddr = sin->sin_addr;
- inp->inp_fport = sin->sin_port;
- in_pcbrehash(inp);
-
- tp->t_template = tcp_template(tp);
- if (tp->t_template == 0) {
- in_pcbdisconnect(inp);
- return ENOBUFS;
- }
-
- /* Compute window scaling to request. */
- while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
- (TCP_MAXWIN << tp->request_r_scale) < so->so_rcv.sb_hiwat)
- tp->request_r_scale++;
-
- soisconnecting(so);
- tcpstat.tcps_connattempt++;
- tp->t_state = TCPS_SYN_SENT;
- tp->t_timer[TCPT_KEEP] = tcp_keepinit;
- tp->iss = tcp_iss; tcp_iss += TCP_ISSINCR/2;
- tcp_sendseqinit(tp);
-
- /*
- * Generate a CC value for this connection and
- * check whether CC or CCnew should be used.
- */
- if ((taop = tcp_gettaocache(tp->t_inpcb)) == NULL) {
- taop = &tao_noncached;
- bzero(taop, sizeof(*taop));
- }
-
- tp->cc_send = CC_INC(tcp_ccgen);
- if (taop->tao_ccsent != 0 &&
- CC_GEQ(tp->cc_send, taop->tao_ccsent)) {
- taop->tao_ccsent = tp->cc_send;
- } else {
- taop->tao_ccsent = 0;
- tp->t_flags |= TF_SENDCCNEW;
- }
-
- return 0;
-}
-
-int
-tcp_ctloutput(op, so, level, optname, mp)
- int op;
- struct socket *so;
- int level, optname;
- struct mbuf **mp;
-{
- int error = 0, s;
- struct inpcb *inp;
- register struct tcpcb *tp;
- register struct mbuf *m;
- register int i;
-
- s = splnet();
- inp = sotoinpcb(so);
- if (inp == NULL) {
- splx(s);
- if (op == PRCO_SETOPT && *mp)
- (void) m_free(*mp);
- return (ECONNRESET);
- }
- if (level != IPPROTO_TCP) {
- error = ip_ctloutput(op, so, level, optname, mp);
- splx(s);
- return (error);
- }
- tp = intotcpcb(inp);
-
- switch (op) {
-
- case PRCO_SETOPT:
- m = *mp;
- switch (optname) {
-
- case TCP_NODELAY:
- if (m == NULL || m->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(m, int *))
- tp->t_flags |= TF_NODELAY;
- else
- tp->t_flags &= ~TF_NODELAY;
- break;
-
- case TCP_MAXSEG:
- if (m && (i = *mtod(m, int *)) > 0 && i <= tp->t_maxseg)
- tp->t_maxseg = i;
- else
- error = EINVAL;
- break;
-
- case TCP_NOOPT:
- if (m == NULL || m->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(m, int *))
- tp->t_flags |= TF_NOOPT;
- else
- tp->t_flags &= ~TF_NOOPT;
- break;
-
- case TCP_NOPUSH:
- if (m == NULL || m->m_len < sizeof (int))
- error = EINVAL;
- else if (*mtod(m, int *))
- tp->t_flags |= TF_NOPUSH;
- else
- tp->t_flags &= ~TF_NOPUSH;
- break;
-
- default:
- error = ENOPROTOOPT;
- break;
- }
- if (m)
- (void) m_free(m);
- break;
-
- case PRCO_GETOPT:
- *mp = m = m_get(M_WAIT, MT_SOOPTS);
- m->m_len = sizeof(int);
-
- switch (optname) {
- case TCP_NODELAY:
- *mtod(m, int *) = tp->t_flags & TF_NODELAY;
- break;
- case TCP_MAXSEG:
- *mtod(m, int *) = tp->t_maxseg;
- break;
- case TCP_NOOPT:
- *mtod(m, int *) = tp->t_flags & TF_NOOPT;
- break;
- case TCP_NOPUSH:
- *mtod(m, int *) = tp->t_flags & TF_NOPUSH;
- break;
- default:
- error = ENOPROTOOPT;
- break;
- }
- break;
- }
- splx(s);
- return (error);
-}
-
-/*
- * tcp_sendspace and tcp_recvspace are the default send and receive window
- * sizes, respectively. These are obsolescent (this information should
- * be set by the route).
- */
-u_long tcp_sendspace = 1024*16;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_SENDSPACE, sendspace,
- CTLFLAG_RW, &tcp_sendspace , 0, "");
-u_long tcp_recvspace = 1024*16;
-SYSCTL_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace,
- CTLFLAG_RW, &tcp_recvspace , 0, "");
-
-/*
- * Attach TCP protocol to socket, allocating
- * internet protocol control block, tcp control block,
- * bufer space, and entering LISTEN state if to accept connections.
- */
-static int
-tcp_attach(so)
- struct socket *so;
-{
- register struct tcpcb *tp;
- struct inpcb *inp;
- int error;
-
- if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) {
- error = soreserve(so, tcp_sendspace, tcp_recvspace);
- if (error)
- return (error);
- }
- error = in_pcballoc(so, &tcbinfo);
- if (error)
- return (error);
- inp = sotoinpcb(so);
- tp = tcp_newtcpcb(inp);
- if (tp == 0) {
- int nofd = so->so_state & SS_NOFDREF; /* XXX */
-
- so->so_state &= ~SS_NOFDREF; /* don't free the socket yet */
- in_pcbdetach(inp);
- so->so_state |= nofd;
- return (ENOBUFS);
- }
- tp->t_state = TCPS_CLOSED;
- return (0);
-}
-
-/*
- * Initiate (or continue) disconnect.
- * If embryonic state, just send reset (once).
- * If in ``let data drain'' option and linger null, just drop.
- * Otherwise (hard), mark socket disconnecting and drop
- * current input data; switch states based on user close, and
- * send segment to peer (with FIN).
- */
-static struct tcpcb *
-tcp_disconnect(tp)
- register struct tcpcb *tp;
-{
- struct socket *so = tp->t_inpcb->inp_socket;
-
- if (tp->t_state < TCPS_ESTABLISHED)
- tp = tcp_close(tp);
- else if ((so->so_options & SO_LINGER) && so->so_linger == 0)
- tp = tcp_drop(tp, 0);
- else {
- soisdisconnecting(so);
- sbflush(&so->so_rcv);
- tp = tcp_usrclosed(tp);
- if (tp)
- (void) tcp_output(tp);
- }
- return (tp);
-}
-
-/*
- * User issued close, and wish to trail through shutdown states:
- * if never received SYN, just forget it. If got a SYN from peer,
- * but haven't sent FIN, then go to FIN_WAIT_1 state to send peer a FIN.
- * If already got a FIN from peer, then almost done; go to LAST_ACK
- * state. In all other cases, have already sent FIN to peer (e.g.
- * after PRU_SHUTDOWN), and just have to play tedious game waiting
- * for peer to send FIN or not respond to keep-alives, etc.
- * We can let the user exit from the close as soon as the FIN is acked.
- */
-static struct tcpcb *
-tcp_usrclosed(tp)
- register struct tcpcb *tp;
-{
-
- switch (tp->t_state) {
-
- case TCPS_CLOSED:
- case TCPS_LISTEN:
- tp->t_state = TCPS_CLOSED;
- tp = tcp_close(tp);
- break;
-
- case TCPS_SYN_SENT:
- case TCPS_SYN_RECEIVED:
- tp->t_flags |= TF_NEEDFIN;
- break;
-
- case TCPS_ESTABLISHED:
- tp->t_state = TCPS_FIN_WAIT_1;
- break;
-
- case TCPS_CLOSE_WAIT:
- tp->t_state = TCPS_LAST_ACK;
- break;
- }
- if (tp && tp->t_state >= TCPS_FIN_WAIT_2) {
- soisdisconnected(tp->t_inpcb->inp_socket);
- /* To prevent the connection hanging in FIN_WAIT_2 forever. */
- if (tp->t_state == TCPS_FIN_WAIT_2)
- tp->t_timer[TCPT_2MSL] = tcp_maxidle;
- }
- return (tp);
-}
-
diff --git a/cpukit/libnetworking/netinet/tcp_var.h b/cpukit/libnetworking/netinet/tcp_var.h
deleted file mode 100644
index 8e63a2cafe..0000000000
--- a/cpukit/libnetworking/netinet/tcp_var.h
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993, 1994, 1995
- * 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.
- *
- * @(#)tcp_var.h 8.4 (Berkeley) 5/24/95
- * $Id$
- */
-
-#ifndef _NETINET_TCP_VAR_H_
-#define _NETINET_TCP_VAR_H_
-/*
- * Kernel variables for tcp.
- */
-
-/*
- * Tcp control block, one per tcp; fields:
- */
-struct tcpcb {
- struct tcpiphdr *seg_next; /* sequencing queue */
- struct tcpiphdr *seg_prev;
- int t_state; /* state of this connection */
- int t_timer[TCPT_NTIMERS]; /* tcp timers */
- int t_rxtshift; /* log(2) of rexmt exp. backoff */
- int t_rxtcur; /* current retransmit value */
- int t_dupacks; /* consecutive dup acks recd */
- u_int t_maxseg; /* maximum segment size */
- u_int t_maxopd; /* mss plus options */
- int t_force; /* 1 if forcing out a byte */
- u_int t_flags;
-#define TF_ACKNOW 0x0001 /* ack peer immediately */
-#define TF_DELACK 0x0002 /* ack, but try to delay it */
-#define TF_NODELAY 0x0004 /* don't delay packets to coalesce */
-#define TF_NOOPT 0x0008 /* don't use tcp options */
-#define TF_SENTFIN 0x0010 /* have sent FIN */
-#define TF_REQ_SCALE 0x0020 /* have/will request window scaling */
-#define TF_RCVD_SCALE 0x0040 /* other side has requested scaling */
-#define TF_REQ_TSTMP 0x0080 /* have/will request timestamps */
-#define TF_RCVD_TSTMP 0x0100 /* a timestamp was received in SYN */
-#define TF_SACK_PERMIT 0x0200 /* other side said I could SACK */
-#define TF_NEEDSYN 0x0400 /* send SYN (implicit state) */
-#define TF_NEEDFIN 0x0800 /* send FIN (implicit state) */
-#define TF_NOPUSH 0x1000 /* don't push */
-#define TF_REQ_CC 0x2000 /* have/will request CC */
-#define TF_RCVD_CC 0x4000 /* a CC was received in SYN */
-#define TF_SENDCCNEW 0x8000 /* send CCnew instead of CC in SYN */
-
- struct tcpiphdr *t_template; /* skeletal packet for transmit */
- struct inpcb *t_inpcb; /* back pointer to internet pcb */
-/*
- * The following fields are used as in the protocol specification.
- * See RFC783, Dec. 1981, page 21.
- */
-/* send sequence variables */
- tcp_seq snd_una; /* send unacknowledged */
- tcp_seq snd_nxt; /* send next */
- tcp_seq snd_up; /* send urgent pointer */
- tcp_seq snd_wl1; /* window update seg seq number */
- tcp_seq snd_wl2; /* window update seg ack number */
- tcp_seq iss; /* initial send sequence number */
- u_long snd_wnd; /* send window */
-/* receive sequence variables */
- u_long rcv_wnd; /* receive window */
- tcp_seq rcv_nxt; /* receive next */
- tcp_seq rcv_up; /* receive urgent pointer */
- tcp_seq irs; /* initial receive sequence number */
-/*
- * Additional variables for this implementation.
- */
-/* receive variables */
- tcp_seq rcv_adv; /* advertised window */
-/* retransmit variables */
- tcp_seq snd_max; /* highest sequence number sent;
- * used to recognize retransmits
- */
-/* congestion control (for slow start, source quench, retransmit after loss) */
- u_long snd_cwnd; /* congestion-controlled window */
- u_long snd_ssthresh; /* snd_cwnd size threshold for
- * for slow start exponential to
- * linear switch
- */
-/*
- * transmit timing stuff. See below for scale of srtt and rttvar.
- * "Variance" is actually smoothed difference.
- */
- u_int t_idle; /* inactivity time */
- int t_rtt; /* round trip time */
- tcp_seq t_rtseq; /* sequence number being timed */
- int t_srtt; /* smoothed round-trip time */
- int t_rttvar; /* variance in round-trip time */
- u_int t_rttmin; /* minimum rtt allowed */
- u_long max_sndwnd; /* largest window peer has offered */
-
-/* out-of-band data */
- char t_oobflags; /* have some */
- char t_iobc; /* input character */
-#define TCPOOB_HAVEDATA 0x01
-#define TCPOOB_HADDATA 0x02
- int t_softerror; /* possible error not yet reported */
-
-/* RFC 1323 variables */
- u_char snd_scale; /* window scaling for send window */
- u_char rcv_scale; /* window scaling for recv window */
- u_char request_r_scale; /* pending window scaling */
- u_char requested_s_scale;
- u_long ts_recent; /* timestamp echo data */
- u_long ts_recent_age; /* when last updated */
- tcp_seq last_ack_sent;
-/* RFC 1644 variables */
- tcp_cc cc_send; /* send connection count */
- tcp_cc cc_recv; /* receive connection count */
- u_long t_duration; /* connection duration */
-
-/* TUBA stuff */
- caddr_t t_tuba_pcb; /* next level down pcb for TCP over z */
-/* More RTT stuff */
- u_long t_rttupdated; /* number of times rtt sampled */
-};
-
-/*
- * Structure to hold TCP options that are only used during segment
- * processing (in tcp_input), but not held in the tcpcb.
- * It's basically used to reduce the number of parameters
- * to tcp_dooptions.
- */
-struct tcpopt {
- u_long to_flag; /* which options are present */
-#define TOF_TS 0x0001 /* timestamp */
-#define TOF_CC 0x0002 /* CC and CCnew are exclusive */
-#define TOF_CCNEW 0x0004
-#define TOF_CCECHO 0x0008
- u_long to_tsval;
- u_long to_tsecr;
- tcp_cc to_cc; /* holds CC or CCnew */
- tcp_cc to_ccecho;
-};
-
-/*
- * The TAO cache entry which is stored in the protocol family specific
- * portion of the route metrics.
- */
-struct rmxp_tao {
- tcp_cc tao_cc; /* latest CC in valid SYN */
- tcp_cc tao_ccsent; /* latest CC sent to peer */
- u_short tao_mssopt; /* peer's cached MSS */
-#ifdef notyet
- u_short tao_flags; /* cache status flags */
-#define TAOF_DONT 0x0001 /* peer doesn't understand rfc1644 */
-#define TAOF_OK 0x0002 /* peer does understand rfc1644 */
-#define TAOF_UNDEF 0 /* we don't know yet */
-#endif /* notyet */
-};
-#define rmx_taop(r) ((struct rmxp_tao *)(r).rmx_filler)
-
-#define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb)
-#define sototcpcb(so) (intotcpcb(sotoinpcb(so)))
-
-/*
- * The smoothed round-trip time and estimated variance
- * are stored as fixed point numbers scaled by the values below.
- * For convenience, these scales are also used in smoothing the average
- * (smoothed = (1/scale)sample + ((scale-1)/scale)smoothed).
- * With these scales, srtt has 3 bits to the right of the binary point,
- * and thus an "ALPHA" of 0.875. rttvar has 2 bits to the right of the
- * binary point, and is smoothed with an ALPHA of 0.75.
- */
-#define TCP_RTT_SCALE 32 /* multiplier for srtt; 3 bits frac. */
-#define TCP_RTT_SHIFT 5 /* shift for srtt; 3 bits frac. */
-#define TCP_RTTVAR_SCALE 16 /* multiplier for rttvar; 2 bits */
-#define TCP_RTTVAR_SHIFT 4 /* shift for rttvar; 2 bits */
-#define TCP_DELTA_SHIFT 2 /* see tcp_input.c */
-
-/*
- * The initial retransmission should happen at rtt + 4 * rttvar.
- * Because of the way we do the smoothing, srtt and rttvar
- * will each average +1/2 tick of bias. When we compute
- * the retransmit timer, we want 1/2 tick of rounding and
- * 1 extra tick because of +-1/2 tick uncertainty in the
- * firing of the timer. The bias will give us exactly the
- * 1.5 tick we need. But, because the bias is
- * statistical, we have to test that we don't drop below
- * the minimum feasible timer (which is 2 ticks).
- * This version of the macro adapted from a paper by Lawrence
- * Brakmo and Larry Peterson which outlines a problem caused
- * by insufficient precision in the original implementation,
- * which results in inappropriately large RTO values for very
- * fast networks.
- */
-#define TCP_REXMTVAL(tp) \
- ((((tp)->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT)) \
- + (tp)->t_rttvar) >> TCP_DELTA_SHIFT)
-
-/* XXX
- * We want to avoid doing m_pullup on incoming packets but that
- * means avoiding dtom on the tcp reassembly code. That in turn means
- * keeping an mbuf pointer in the reassembly queue (since we might
- * have a cluster). As a quick hack, the source & destination
- * port numbers (which are no longer needed once we've located the
- * tcpcb) are overlayed with an mbuf pointer.
- */
-#define REASS_MBUF(ti) (*(struct mbuf **)&((ti)->ti_t))
-
-/*
- * TCP statistics.
- * Many of these should be kept per connection,
- * but that's inconvenient at the moment.
- */
-struct tcpstat {
- u_long tcps_connattempt; /* connections initiated */
- u_long tcps_accepts; /* connections accepted */
- u_long tcps_connects; /* connections established */
- u_long tcps_drops; /* connections dropped */
- u_long tcps_conndrops; /* embryonic connections dropped */
- u_long tcps_closed; /* conn. closed (includes drops) */
- u_long tcps_segstimed; /* segs where we tried to get rtt */
- u_long tcps_rttupdated; /* times we succeeded */
- u_long tcps_delack; /* delayed acks sent */
- u_long tcps_timeoutdrop; /* conn. dropped in rxmt timeout */
- u_long tcps_rexmttimeo; /* retransmit timeouts */
- u_long tcps_persisttimeo; /* persist timeouts */
- u_long tcps_keeptimeo; /* keepalive timeouts */
- u_long tcps_keepprobe; /* keepalive probes sent */
- u_long tcps_keepdrops; /* connections dropped in keepalive */
-
- u_long tcps_sndtotal; /* total packets sent */
- u_long tcps_sndpack; /* data packets sent */
- u_long tcps_sndbyte; /* data bytes sent */
- u_long tcps_sndrexmitpack; /* data packets retransmitted */
- u_long tcps_sndrexmitbyte; /* data bytes retransmitted */
- u_long tcps_sndacks; /* ack-only packets sent */
- u_long tcps_sndprobe; /* window probes sent */
- u_long tcps_sndurg; /* packets sent with URG only */
- u_long tcps_sndwinup; /* window update-only packets sent */
- u_long tcps_sndctrl; /* control (SYN|FIN|RST) packets sent */
-
- u_long tcps_rcvtotal; /* total packets received */
- u_long tcps_rcvpack; /* packets received in sequence */
- u_long tcps_rcvbyte; /* bytes received in sequence */
- u_long tcps_rcvbadsum; /* packets received with ccksum errs */
- u_long tcps_rcvbadoff; /* packets received with bad offset */
- u_long tcps_rcvshort; /* packets received too short */
- u_long tcps_rcvduppack; /* duplicate-only packets received */
- u_long tcps_rcvdupbyte; /* duplicate-only bytes received */
- u_long tcps_rcvpartduppack; /* packets with some duplicate data */
- u_long tcps_rcvpartdupbyte; /* dup. bytes in part-dup. packets */
- u_long tcps_rcvoopack; /* out-of-order packets received */
- u_long tcps_rcvoobyte; /* out-of-order bytes received */
- u_long tcps_rcvpackafterwin; /* packets with data after window */
- u_long tcps_rcvbyteafterwin; /* bytes rcvd after window */
- u_long tcps_rcvafterclose; /* packets rcvd after "close" */
- u_long tcps_rcvwinprobe; /* rcvd window probe packets */
- u_long tcps_rcvdupack; /* rcvd duplicate acks */
- u_long tcps_rcvacktoomuch; /* rcvd acks for unsent data */
- u_long tcps_rcvackpack; /* rcvd ack packets */
- u_long tcps_rcvackbyte; /* bytes acked by rcvd acks */
- u_long tcps_rcvwinupd; /* rcvd window update packets */
- u_long tcps_pawsdrop; /* segments dropped due to PAWS */
- u_long tcps_predack; /* times hdr predict ok for acks */
- u_long tcps_preddat; /* times hdr predict ok for data pkts */
- u_long tcps_pcbcachemiss;
- u_long tcps_cachedrtt; /* times cached RTT in route updated */
- u_long tcps_cachedrttvar; /* times cached rttvar updated */
- u_long tcps_cachedssthresh; /* times cached ssthresh updated */
- u_long tcps_usedrtt; /* times RTT initialized from route */
- u_long tcps_usedrttvar; /* times RTTVAR initialized from rt */
- u_long tcps_usedssthresh; /* times ssthresh initialized from rt*/
- u_long tcps_persistdrop; /* timeout in persist state */
- u_long tcps_badsyn; /* bogus SYN, e.g. premature ACK */
- u_long tcps_mturesent; /* resends due to MTU discovery */
- u_long tcps_listendrop; /* listen queue overflows */
-};
-
-/*
- * Names for TCP sysctl objects
- */
-#define TCPCTL_DO_RFC1323 1 /* use RFC-1323 extensions */
-#define TCPCTL_DO_RFC1644 2 /* use RFC-1644 extensions */
-#define TCPCTL_MSSDFLT 3 /* MSS default */
-#define TCPCTL_STATS 4 /* statistics (read-only) */
-#define TCPCTL_RTTDFLT 5 /* default RTT estimate */
-#define TCPCTL_KEEPIDLE 6 /* keepalive idle timer */
-#define TCPCTL_KEEPINTVL 7 /* interval to send keepalives */
-#define TCPCTL_SENDSPACE 8 /* send buffer space */
-#define TCPCTL_RECVSPACE 9 /* receive buffer space */
-#define TCPCTL_KEEPINIT 10 /* receive buffer space */
-#define TCPCTL_MAXID 11
-
-#define TCPCTL_NAMES { \
- { 0, 0 }, \
- { "rfc1323", CTLTYPE_INT }, \
- { "rfc1644", CTLTYPE_INT }, \
- { "mssdflt", CTLTYPE_INT }, \
- { "stats", CTLTYPE_STRUCT }, \
- { "rttdflt", CTLTYPE_INT }, \
- { "keepidle", CTLTYPE_INT }, \
- { "keepintvl", CTLTYPE_INT }, \
- { "sendspace", CTLTYPE_INT }, \
- { "recvspace", CTLTYPE_INT }, \
- { "keepinit", CTLTYPE_INT }, \
-}
-
-#ifdef KERNEL
-extern struct inpcbhead tcb; /* head of queue of active tcpcb's */
-extern struct inpcbinfo tcbinfo;
-extern struct tcpstat tcpstat; /* tcp statistics */
-extern int tcp_mssdflt; /* XXX */
-extern u_long tcp_now; /* for RFC 1323 timestamps */
-
-void tcp_canceltimers __P((struct tcpcb *));
-struct tcpcb *
- tcp_close __P((struct tcpcb *));
-void tcp_ctlinput __P((int, struct sockaddr *, void *));
-int tcp_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
-struct tcpcb *
- tcp_drop __P((struct tcpcb *, int));
-void tcp_drain __P((void));
-void tcp_fasttimo __P((void));
-struct rmxp_tao *
- tcp_gettaocache __P((struct inpcb *));
-void tcp_init __P((void));
-void tcp_input __P((struct mbuf *, int));
-void tcp_mss __P((struct tcpcb *, int));
-int tcp_mssopt __P((struct tcpcb *));
-void tcp_mtudisc __P((struct inpcb *, int));
-struct tcpcb *
- tcp_newtcpcb __P((struct inpcb *));
-int tcp_output __P((struct tcpcb *));
-void tcp_quench __P((struct inpcb *, int));
-void tcp_respond __P((struct tcpcb *,
- struct tcpiphdr *, struct mbuf *, u_long, u_long, int));
-struct rtentry *
- tcp_rtlookup __P((struct inpcb *));
-void tcp_setpersist __P((struct tcpcb *));
-void tcp_slowtimo __P((void));
-struct tcpiphdr *
- tcp_template __P((struct tcpcb *));
-struct tcpcb *
- tcp_timers __P((struct tcpcb *, int));
-void tcp_trace __P((int, int, struct tcpcb *, struct tcpiphdr *, int));
-
-extern struct pr_usrreqs tcp_usrreqs;
-extern u_long tcp_sendspace;
-extern u_long tcp_recvspace;
-
-#endif /* KERNEL */
-
-#endif /* _NETINET_TCP_VAR_H_ */
diff --git a/cpukit/libnetworking/netinet/tcpip.h b/cpukit/libnetworking/netinet/tcpip.h
deleted file mode 100644
index b8634bfd15..0000000000
--- a/cpukit/libnetworking/netinet/tcpip.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)tcpip.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_TCPIP_H_
-#define _NETINET_TCPIP_H_
-
-/*
- * Tcp+ip header, after ip options removed.
- */
-struct tcpiphdr {
- struct ipovly ti_i; /* overlaid ip structure */
- struct tcphdr ti_t; /* tcp header */
-};
-#ifdef notyet
-/*
- * Tcp+ip header, after ip options removed but including TCP options.
- */
-struct full_tcpiphdr {
- struct ipovly ti_i; /* overlaid ip structure */
- struct tcphdr ti_t; /* tcp header */
- char ti_o[TCP_MAXOLEN]; /* space for tcp options */
-};
-#endif /* notyet */
-#define ti_next ti_i.ih_next
-#define ti_prev ti_i.ih_prev
-#define ti_x1 ti_i.ih_x1
-#define ti_pr ti_i.ih_pr
-#define ti_len ti_i.ih_len
-#define ti_src ti_i.ih_src
-#define ti_dst ti_i.ih_dst
-#define ti_sport ti_t.th_sport
-#define ti_dport ti_t.th_dport
-#define ti_seq ti_t.th_seq
-#define ti_ack ti_t.th_ack
-#define ti_x2 ti_t.th_x2
-#define ti_off ti_t.th_off
-#define ti_flags ti_t.th_flags
-#define ti_win ti_t.th_win
-#define ti_sum ti_t.th_sum
-#define ti_urp ti_t.th_urp
-
-#endif
diff --git a/cpukit/libnetworking/netinet/udp.h b/cpukit/libnetworking/netinet/udp.h
deleted file mode 100644
index e73e1f4ddb..0000000000
--- a/cpukit/libnetworking/netinet/udp.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)udp.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_UDP_H_
-#define _NETINET_UDP_H_
-
-/*
- * Udp protocol header.
- * Per RFC 768, September, 1981.
- */
-struct udphdr {
- u_short uh_sport; /* source port */
- u_short uh_dport; /* destination port */
- u_short uh_ulen; /* udp length */
- u_short uh_sum; /* udp checksum */
-};
-
-#endif
diff --git a/cpukit/libnetworking/netinet/udp_usrreq.c b/cpukit/libnetworking/netinet/udp_usrreq.c
deleted file mode 100644
index 16c5fce2df..0000000000
--- a/cpukit/libnetworking/netinet/udp_usrreq.c
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
- * 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.
- *
- * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/errno.h>
-#include <sys/stat.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/syslog.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/in_pcb.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-
-/*
- * UDP protocol implementation.
- * Per RFC 768, August, 1980.
- */
-#ifndef COMPAT_42
-static int udpcksum = 1;
-#else
-static int udpcksum = 0; /* XXX */
-#endif
-SYSCTL_INT(_net_inet_udp, UDPCTL_CHECKSUM, checksum, CTLFLAG_RW,
- &udpcksum, 0, "");
-
-static int log_in_vain = 0;
-SYSCTL_INT(_net_inet_udp, OID_AUTO, log_in_vain, CTLFLAG_RW,
- &log_in_vain, 0, "");
-
-static struct inpcbhead udb; /* from udp_var.h */
-static struct inpcbinfo udbinfo;
-
-#ifndef UDBHASHSIZE
-#define UDBHASHSIZE 64
-#endif
-
- struct udpstat udpstat; /* from udp_var.h */
-SYSCTL_STRUCT(_net_inet_udp, UDPCTL_STATS, stats, CTLFLAG_RD,
- &udpstat, udpstat, "");
-
-static struct sockaddr_in udp_in = { sizeof(udp_in), AF_INET };
-
-static void udp_detach __P((struct inpcb *));
-static int udp_output __P((struct inpcb *, struct mbuf *, struct mbuf *,
- struct mbuf *));
-static void udp_notify __P((struct inpcb *, int));
-
-void
-udp_init()
-{
- LIST_INIT(&udb);
- udbinfo.listhead = &udb;
- udbinfo.hashbase = hashinit(UDBHASHSIZE, M_PCB, &udbinfo.hashmask);
-}
-
-void
-udp_input(m, iphlen)
- register struct mbuf *m;
- int iphlen;
-{
- register struct ip *ip;
- register struct udphdr *uh;
- register struct inpcb *inp;
- struct mbuf *opts = 0;
- int len;
- struct ip save_ip;
-
- udpstat.udps_ipackets++;
-
- /*
- * Strip IP options, if any; should skip this,
- * make available to user, and use on returned packets,
- * but we don't yet have a way to check the checksum
- * with options still present.
- */
- if (iphlen > sizeof (struct ip)) {
- ip_stripoptions(m, (struct mbuf *)0);
- iphlen = sizeof(struct ip);
- }
-
- /*
- * Get IP and UDP header together in first mbuf.
- */
- ip = mtod(m, struct ip *);
- if (m->m_len < iphlen + sizeof(struct udphdr)) {
- if ((m = m_pullup(m, iphlen + sizeof(struct udphdr))) == 0) {
- udpstat.udps_hdrops++;
- return;
- }
- ip = mtod(m, struct ip *);
- }
- uh = (struct udphdr *)((caddr_t)ip + iphlen);
-
- /*
- * Make mbuf data length reflect UDP length.
- * If not enough data to reflect UDP length, drop.
- */
- len = ntohs((u_short)uh->uh_ulen);
- if (ip->ip_len != len) {
- if (len > ip->ip_len || len < sizeof(struct udphdr)) {
- udpstat.udps_badlen++;
- goto bad;
- }
- m_adj(m, len - ip->ip_len);
- /* ip->ip_len = len; */
- }
- /*
- * Save a copy of the IP header in case we want restore it
- * for sending an ICMP error message in response.
- */
- save_ip = *ip;
-
- /*
- * Checksum extended UDP header and data.
- */
- if (uh->uh_sum) {
- ((struct ipovly *)ip)->ih_next = 0;
- ((struct ipovly *)ip)->ih_prev = 0;
- ((struct ipovly *)ip)->ih_x1 = 0;
- ((struct ipovly *)ip)->ih_len = uh->uh_ulen;
- uh->uh_sum = in_cksum(m, len + sizeof (struct ip));
- if (uh->uh_sum) {
- udpstat.udps_badsum++;
- m_freem(m);
- return;
- }
- }
-
- if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
- in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) {
- struct inpcb *last;
- /*
- * Deliver a multicast or broadcast datagram to *all* sockets
- * for which the local and remote addresses and ports match
- * those of the incoming datagram. This allows more than
- * one process to receive multi/broadcasts on the same port.
- * (This really ought to be done for unicast datagrams as
- * well, but that would cause problems with existing
- * applications that open both address-specific sockets and
- * a wildcard socket listening to the same port -- they would
- * end up receiving duplicates of every unicast datagram.
- * Those applications open the multiple sockets to overcome an
- * inadequacy of the UDP socket interface, but for backwards
- * compatibility we avoid the problem here rather than
- * fixing the interface. Maybe 4.5BSD will remedy this?)
- */
-
- /*
- * Construct sockaddr format source address.
- */
- udp_in.sin_port = uh->uh_sport;
- udp_in.sin_addr = ip->ip_src;
- m->m_len -= sizeof (struct udpiphdr);
- m->m_data += sizeof (struct udpiphdr);
- /*
- * Locate pcb(s) for datagram.
- * (Algorithm copied from raw_intr().)
- */
- last = NULL;
- for (inp = udb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
- if (inp->inp_lport != uh->uh_dport)
- continue;
- if (inp->inp_laddr.s_addr != INADDR_ANY) {
- if (inp->inp_laddr.s_addr !=
- ip->ip_dst.s_addr)
- continue;
- }
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- if (inp->inp_faddr.s_addr !=
- ip->ip_src.s_addr ||
- inp->inp_fport != uh->uh_sport)
- continue;
- }
-
- if (last != NULL) {
- struct mbuf *n;
-
- if ((n = m_copy(m, 0, M_COPYALL)) != NULL) {
- if (last->inp_flags & INP_CONTROLOPTS
- || last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, n);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&udp_in,
- n, opts) == 0) {
- m_freem(n);
- if (opts)
- m_freem(opts);
- udpstat.udps_fullsock++;
- } else
- sorwakeup(last->inp_socket);
- opts = 0;
- }
- }
- last = inp;
- /*
- * Don't look for additional matches if this one does
- * not have either the SO_REUSEPORT or SO_REUSEADDR
- * socket options set. This heuristic avoids searching
- * through all pcbs in the common case of a non-shared
- * port. It * assumes that an application will never
- * clear these options after setting them.
- */
- if (((last->inp_socket->so_options&(SO_REUSEPORT|SO_REUSEADDR)) == 0))
- break;
- }
-
- if (last == NULL) {
- /*
- * No matching pcb found; discard datagram.
- * (No need to send an ICMP Port Unreachable
- * for a broadcast or multicast datgram.)
- */
- udpstat.udps_noportbcast++;
- goto bad;
- }
- if (last->inp_flags & INP_CONTROLOPTS
- || last->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(last, &opts, ip, m);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&udp_in,
- m, opts) == 0) {
- udpstat.udps_fullsock++;
- goto bad;
- }
- sorwakeup(last->inp_socket);
- return;
- }
- /*
- * Locate pcb for datagram.
- */
- inp = in_pcblookuphash(&udbinfo, ip->ip_src, uh->uh_sport,
- ip->ip_dst, uh->uh_dport, 1);
- if (inp == NULL) {
- if (log_in_vain) {
- char buf[4*sizeof "123"];
-
- strcpy(buf, inet_ntoa(ip->ip_dst));
- log(LOG_INFO, "Connection attempt to UDP %s:%d"
- " from %s:%d\n",
- buf, ntohs(uh->uh_dport),
- inet_ntoa(ip->ip_src), ntohs(uh->uh_sport));
- }
- udpstat.udps_noport++;
- if (m->m_flags & (M_BCAST | M_MCAST)) {
- udpstat.udps_noportbcast++;
- goto bad;
- }
- *ip = save_ip;
- icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0);
- return;
- }
-
- /*
- * Construct sockaddr format source address.
- * Stuff source address and datagram in user buffer.
- */
- udp_in.sin_port = uh->uh_sport;
- udp_in.sin_addr = ip->ip_src;
- if (inp->inp_flags & INP_CONTROLOPTS
- || inp->inp_socket->so_options & SO_TIMESTAMP)
- ip_savecontrol(inp, &opts, ip, m);
- iphlen += sizeof(struct udphdr);
- m->m_len -= iphlen;
- m->m_pkthdr.len -= iphlen;
- m->m_data += iphlen;
- if (sbappendaddr(&inp->inp_socket->so_rcv, (struct sockaddr *)&udp_in,
- m, opts) == 0) {
- udpstat.udps_fullsock++;
- goto bad;
- }
- sorwakeup(inp->inp_socket);
- return;
-bad:
- m_freem(m);
- if (opts)
- m_freem(opts);
-}
-
-/*
- * Notify a udp user of an asynchronous error;
- * just wake up so that he can collect error status.
- */
-static void
-udp_notify(inp, errnum)
- register struct inpcb *inp;
- int errnum;
-{
- inp->inp_socket->so_error = errnum;
- sorwakeup(inp->inp_socket);
- sowwakeup(inp->inp_socket);
-}
-
-void
-udp_ctlinput(cmd, sa, vip)
- int cmd;
- struct sockaddr *sa;
- void *vip;
-{
- register struct ip *ip = vip;
- register struct udphdr *uh;
-
- if (!PRC_IS_REDIRECT(cmd) &&
- ((unsigned)cmd >= PRC_NCMDS || inetctlerrmap[cmd] == 0))
- return;
- if (ip) {
- uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2));
- in_pcbnotify(&udb, sa, uh->uh_dport, ip->ip_src, uh->uh_sport,
- cmd, udp_notify);
- } else
- in_pcbnotify(&udb, sa, 0, zeroin_addr, 0, cmd, udp_notify);
-}
-
-static int
-udp_output(inp, m, addr, control)
- register struct inpcb *inp;
- register struct mbuf *m;
- struct mbuf *addr, *control;
-{
- register struct udpiphdr *ui;
- register int len = m->m_pkthdr.len;
- struct in_addr laddr;
- int s = 0, error = 0;
-
- if (control)
- m_freem(control); /* XXX */
-
- if (len + sizeof(struct udpiphdr) > IP_MAXPACKET) {
- error = EMSGSIZE;
- goto release;
- }
-
- if (addr) {
- laddr = inp->inp_laddr;
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- error = EISCONN;
- goto release;
- }
- /*
- * Must block input while temporarily connected.
- */
- s = splnet();
- error = in_pcbconnect(inp, addr);
- if (error) {
- splx(s);
- goto release;
- }
- } else {
- if (inp->inp_faddr.s_addr == INADDR_ANY) {
- error = ENOTCONN;
- goto release;
- }
- }
- /*
- * Calculate data length and get a mbuf
- * for UDP and IP headers.
- */
- M_PREPEND(m, sizeof(struct udpiphdr), M_DONTWAIT);
- if (m == 0) {
- error = ENOBUFS;
- if (addr)
- splx(s);
- goto release;
- }
-
- /*
- * Fill in mbuf with extended UDP header
- * and addresses and length put into network format.
- */
- ui = mtod(m, struct udpiphdr *);
- ui->ui_next = ui->ui_prev = 0;
- ui->ui_x1 = 0;
- ui->ui_pr = IPPROTO_UDP;
- ui->ui_len = htons((u_short)len + sizeof (struct udphdr));
- ui->ui_src = inp->inp_laddr;
- ui->ui_dst = inp->inp_faddr;
- ui->ui_sport = inp->inp_lport;
- ui->ui_dport = inp->inp_fport;
- ui->ui_ulen = ui->ui_len;
-
- /*
- * Stuff checksum and output datagram.
- */
- ui->ui_sum = 0;
- if (udpcksum) {
- if ((ui->ui_sum = in_cksum(m, sizeof (struct udpiphdr) + len)) == 0)
- ui->ui_sum = 0xffff;
- }
- ((struct ip *)ui)->ip_len = sizeof (struct udpiphdr) + len;
- ((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; /* XXX */
- ((struct ip *)ui)->ip_tos = inp->inp_ip_tos; /* XXX */
- udpstat.udps_opackets++;
- error = ip_output(m, inp->inp_options, &inp->inp_route,
- inp->inp_socket->so_options & (SO_DONTROUTE | SO_BROADCAST),
- inp->inp_moptions);
-
- if (addr) {
- in_pcbdisconnect(inp);
- inp->inp_laddr = laddr;
- splx(s);
- }
- return (error);
-
-release:
- m_freem(m);
- return (error);
-}
-
-static u_long udp_sendspace = 9216; /* really max datagram size */
- /* 40 1K datagrams */
-SYSCTL_INT(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW,
- &udp_sendspace, 0, "");
-
-static u_long udp_recvspace = 40 * (1024 + sizeof(struct sockaddr_in));
-SYSCTL_INT(_net_inet_udp, UDPCTL_RECVSPACE, recvspace, CTLFLAG_RW,
- &udp_recvspace, 0, "");
-
-/*ARGSUSED*/
-int
-udp_usrreq(so, req, m, addr, control)
- struct socket *so;
- int req;
- struct mbuf *m, *addr, *control;
-{
- struct inpcb *inp = sotoinpcb(so);
- int error = 0;
- int s;
-
- if (req == PRU_CONTROL)
- return (in_control(so, (u_long)m, (caddr_t)addr,
- (struct ifnet *)control));
- if (inp == NULL && req != PRU_ATTACH) {
- error = EINVAL;
- goto release;
- }
- /*
- * Note: need to block udp_input while changing
- * the udp pcb queue and/or pcb addresses.
- */
- switch (req) {
-
- case PRU_ATTACH:
- if (inp != NULL) {
- error = EINVAL;
- break;
- }
- s = splnet();
- error = in_pcballoc(so, &udbinfo);
- splx(s);
- if (error)
- break;
- error = soreserve(so, udp_sendspace, udp_recvspace);
- if (error)
- break;
- ((struct inpcb *) so->so_pcb)->inp_ip_ttl = ip_defttl;
- break;
-
- case PRU_DETACH:
- udp_detach(inp);
- break;
-
- case PRU_BIND:
- s = splnet();
- error = in_pcbbind(inp, addr);
- splx(s);
- break;
-
- case PRU_LISTEN:
- error = EOPNOTSUPP;
- break;
-
- case PRU_CONNECT:
- if (inp->inp_faddr.s_addr != INADDR_ANY) {
- error = EISCONN;
- break;
- }
- s = splnet();
- error = in_pcbconnect(inp, addr);
- splx(s);
- if (error == 0)
- soisconnected(so);
- break;
-
- case PRU_CONNECT2:
- error = EOPNOTSUPP;
- break;
-
- case PRU_ACCEPT:
- error = EOPNOTSUPP;
- break;
-
- case PRU_DISCONNECT:
- if (inp->inp_faddr.s_addr == INADDR_ANY) {
- error = ENOTCONN;
- break;
- }
- s = splnet();
- in_pcbdisconnect(inp);
- inp->inp_laddr.s_addr = INADDR_ANY;
- splx(s);
- so->so_state &= ~SS_ISCONNECTED; /* XXX */
- break;
-
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- case PRU_SEND:
- return (udp_output(inp, m, addr, control));
-
- case PRU_ABORT:
- soisdisconnected(so);
- udp_detach(inp);
- break;
-
- case PRU_SOCKADDR:
- in_setsockaddr(inp, addr);
- break;
-
- case PRU_PEERADDR:
- in_setpeeraddr(inp, addr);
- break;
-
- case PRU_SENSE:
- /*
- * stat: don't bother with a blocksize.
- */
- return (0);
-
- case PRU_SENDOOB:
- case PRU_FASTTIMO:
- case PRU_SLOWTIMO:
- case PRU_PROTORCV:
- case PRU_PROTOSEND:
- error = EOPNOTSUPP;
- break;
-
- case PRU_RCVD:
- case PRU_RCVOOB:
- return (EOPNOTSUPP); /* do not free mbuf's */
-
- default:
- panic("udp_usrreq");
- }
-
-release:
- if (control) {
- printf("udp control data unexpectedly retained\n");
- m_freem(control);
- }
- if (m)
- m_freem(m);
- return (error);
-}
-
-static void
-udp_detach(inp)
- struct inpcb *inp;
-{
- int s = splnet();
-
- in_pcbdetach(inp);
- splx(s);
-}
diff --git a/cpukit/libnetworking/netinet/udp_var.h b/cpukit/libnetworking/netinet/udp_var.h
deleted file mode 100644
index 90785b53de..0000000000
--- a/cpukit/libnetworking/netinet/udp_var.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 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.
- *
- * @(#)udp_var.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NETINET_UDP_VAR_H_
-#define _NETINET_UDP_VAR_H_
-
-/*
- * UDP kernel structures and variables.
- */
-struct udpiphdr {
- struct ipovly ui_i; /* overlaid ip structure */
- struct udphdr ui_u; /* udp header */
-};
-#define ui_next ui_i.ih_next
-#define ui_prev ui_i.ih_prev
-#define ui_x1 ui_i.ih_x1
-#define ui_pr ui_i.ih_pr
-#define ui_len ui_i.ih_len
-#define ui_src ui_i.ih_src
-#define ui_dst ui_i.ih_dst
-#define ui_sport ui_u.uh_sport
-#define ui_dport ui_u.uh_dport
-#define ui_ulen ui_u.uh_ulen
-#define ui_sum ui_u.uh_sum
-
-struct udpstat {
- /* input statistics: */
- u_long udps_ipackets; /* total input packets */
- u_long udps_hdrops; /* packet shorter than header */
- u_long udps_badsum; /* checksum error */
- u_long udps_badlen; /* data length larger than packet */
- u_long udps_noport; /* no socket on port */
- u_long udps_noportbcast; /* of above, arrived as broadcast */
- u_long udps_fullsock; /* not delivered, input socket full */
- u_long udpps_pcbcachemiss; /* input packets missing pcb cache */
- u_long udpps_pcbhashmiss; /* input packets not for hashed pcb */
- /* output statistics: */
- u_long udps_opackets; /* total output packets */
-};
-
-/*
- * Names for UDP sysctl objects
- */
-#define UDPCTL_CHECKSUM 1 /* checksum UDP packets */
-#define UDPCTL_STATS 2 /* statistics (read-only) */
-#define UDPCTL_MAXDGRAM 3 /* max datagram size */
-#define UDPCTL_RECVSPACE 4 /* default receive buffer space */
-#define UDPCTL_MAXID 5
-
-#define UDPCTL_NAMES { \
- { 0, 0 }, \
- { "checksum", CTLTYPE_INT }, \
- { "stats", CTLTYPE_STRUCT }, \
- { "maxdgram", CTLTYPE_INT }, \
- { "recvspace", CTLTYPE_INT }, \
-}
-
-#ifdef KERNEL
-extern struct inpcbhead udb;
-extern struct inpcbinfo udbinfo;
-extern struct udpstat udpstat;
-
-void udp_ctlinput __P((int, struct sockaddr *, void *));
-void udp_init __P((void));
-void udp_input __P((struct mbuf *, int));
-int udp_usrreq __P((struct socket *,
- int, struct mbuf *, struct mbuf *, struct mbuf *));
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/nfs/bootp_subr.c b/cpukit/libnetworking/nfs/bootp_subr.c
deleted file mode 100644
index cb7d3d3407..0000000000
--- a/cpukit/libnetworking/nfs/bootp_subr.c
+++ /dev/null
@@ -1,968 +0,0 @@
-/* $Id$ */
-
-/*
- * Copyright (c) 1995 Gordon Ross, Adam Glass
- * Copyright (c) 1992 Regents of the University of California.
- * All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * 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, Lawrence Berkeley Laboratory 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.
- *
- * based on:
- * nfs/krpc_subr.c
- * $NetBSD: krpc_subr.c,v 1.10 1995/08/08 20:43:43 gwr Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/conf.h>
-#include <sys/sockio.h>
-#include <sys/proc.h>
-#include <sys/mount.h>
-#include <sys/mbuf.h>
-#include <sys/reboot.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <net/if_types.h>
-#include <net/if_dl.h>
-#include <netinet/if_ether.h>
-
-#include <nfs/rpcv2.h>
-#include <nfs/nfsproto.h>
-#include <nfs/nfs.h>
-#include <nfs/nfsdiskless.h>
-#include <nfs/krpc.h>
-#include <nfs/xdr_subs.h>
-
-#define BOOTP_MIN_LEN 300 /* Minimum size of bootp udp packet */
-
-/*
- * What is the longest we will wait before re-sending a request?
- * Note this is also the frequency of "RPC timeout" messages.
- * The re-send loop count sup linearly to this maximum, so the
- * first complaint will happen after (1+2+3+4+5)=15 seconds.
- */
-#define MAX_RESEND_DELAY 5 /* seconds */
-
-/* Definitions from RFC951 */
-struct bootp_packet {
- u_int8_t op;
- u_int8_t htype;
- u_int8_t hlen;
- u_int8_t hops;
- u_int32_t xid;
- u_int16_t secs;
- u_int16_t flags;
- struct in_addr ciaddr;
- struct in_addr yiaddr;
- struct in_addr siaddr;
- struct in_addr giaddr;
- unsigned char chaddr[16];
- char sname[64];
- char file[128];
- unsigned char vend[256];
-};
-
-#define IPPORT_BOOTPC 68
-#define IPPORT_BOOTPS 67
-
-extern int nfs_diskless_valid;
-extern struct nfsv3_diskless nfsv3_diskless;
-
-/* mountd RPC */
-#if !defined(__rtems__)
-static int md_mount __P((struct sockaddr_in *mdsin, char *path,
- u_char *fhp, int *fhsizep, struct nfs_args *args,struct proc *procp));
-static int md_lookup_swap __P((struct sockaddr_in *mdsin,char *path,
- u_char *fhp, int *fhsizep,
- struct nfs_args *args,
- struct proc *procp));
-static int setfs __P((struct sockaddr_in *addr, char *path, char *p));
-#endif
-static int getdec __P((char **ptr));
-static char *substr __P((char *a,char *b));
-#if !defined(__rtems__)
-static void mountopts __P((struct nfs_args *args, char *p));
-static int xdr_opaque_decode __P((struct mbuf **ptr,u_char *buf,
- int len));
-static int xdr_int_decode __P((struct mbuf **ptr,int *iptr));
-#endif
-static void printip __P((char *prefix,struct in_addr addr));
-
-#ifdef BOOTP_DEBUG
-void bootpboot_p_sa(struct sockaddr *sa,struct sockaddr *ma);
-void bootpboot_p_ma(struct sockaddr *ma);
-void bootpboot_p_rtentry(struct rtentry *rt);
-void bootpboot_p_tree(struct radix_node *rn);
-void bootpboot_p_rtlist(void);
-void bootpboot_p_iflist(void);
-#endif
-
-int bootpc_call(struct bootp_packet *call,
- struct bootp_packet *reply,
- struct proc *procp);
-
-int bootpc_fakeup_interface(struct ifreq *ireq,struct socket *so,
- struct proc *procp);
-
-int
-bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
- struct sockaddr_in *myaddr,
- struct sockaddr_in *netmask,
- struct sockaddr_in *gw,
- struct proc *procp);
-
-void bootpc_init(void);
-
-#ifdef BOOTP_DEBUG
-void bootpboot_p_sa(sa,ma)
- struct sockaddr *sa;
- struct sockaddr *ma;
-{
- if (!sa) {
- printf("(sockaddr *) <null>");
- return;
- }
- switch (sa->sa_family) {
- case AF_INET:
- {
- struct sockaddr_in *sin = (struct sockaddr_in *) sa;
- printf("inet %x",ntohl(sin->sin_addr.s_addr));
- if (ma) {
- struct sockaddr_in *sin = (struct sockaddr_in *) ma;
- printf(" mask %x",ntohl(sin->sin_addr.s_addr));
- }
- }
- break;
- case AF_LINK:
- {
- struct sockaddr_dl *sli = (struct sockaddr_dl *) sa;
- int i;
- printf("link %.*s ",sli->sdl_nlen,sli->sdl_data);
- for (i=0;i<sli->sdl_alen;i++) {
- if (i>0)
- printf(":");
- printf("%x",(unsigned char) sli->sdl_data[i+sli->sdl_nlen]);
- }
- }
- break;
- default:
- printf("af%d",sa->sa_family);
- }
-}
-
-void bootpboot_p_ma(ma)
- struct sockaddr *ma;
-{
- if (!ma) {
- printf("<null>");
- return;
- }
- printf("%x",*(int*)ma);
-}
-
-void bootpboot_p_rtentry(rt)
- struct rtentry *rt;
-{
- bootpboot_p_sa(rt_key(rt),rt_mask(rt));
- printf(" ");
- bootpboot_p_ma(rt->rt_genmask);
- printf(" ");
- bootpboot_p_sa(rt->rt_gateway,NULL);
- printf(" ");
- printf("flags %x",(unsigned short) rt->rt_flags);
- printf(" %d",rt->rt_rmx.rmx_expire);
- printf(" %s%d\n",rt->rt_ifp->if_name,rt->rt_ifp->if_unit);
-}
-void bootpboot_p_tree(rn)
- struct radix_node *rn;
-{
- while (rn) {
- if (rn->rn_b < 0) {
- if (rn->rn_flags & RNF_ROOT) {
- } else {
- bootpboot_p_rtentry((struct rtentry *) rn);
- }
- rn = rn->rn_dupedkey;
- } else {
- bootpboot_p_tree(rn->rn_l);
- bootpboot_p_tree(rn->rn_r);
- return;
- }
-
- }
-}
-
-void bootpboot_p_rtlist(void)
-{
- printf("Routing table:\n");
- bootpboot_p_tree(rt_tables[AF_INET]->rnh_treetop);
-}
-
-void bootpboot_p_iflist(void)
-{
- struct ifnet *ifp;
- struct ifaddr *ifa;
- printf("Interface list:\n");
- for (ifp = TAILQ_FIRST(&ifnet); ifp != 0; ifp = TAILQ_NEXT(ifp,if_link))
- {
- for (ifa = TAILQ_FIRST(&ifp->if_addrhead) ;ifa;
- ifa=TAILQ_NEXT(ifa,ifa_link))
- if (ifa->ifa_addr->sa_family == AF_INET ) {
- printf("%s%d flags %x, addr %x, bcast %x, net %x\n",
- ifp->if_name,ifp->if_unit,
- (unsigned short) ifp->if_flags,
- ntohl(((struct sockaddr_in *) ifa->ifa_addr)->sin_addr.s_addr),
- ntohl(((struct sockaddr_in *) ifa->ifa_dstaddr)->sin_addr.s_addr),
- ntohl(((struct sockaddr_in *) ifa->ifa_netmask)->sin_addr.s_addr)
- );
- }
- }
-}
-#endif
-
-int
-bootpc_call(call,reply,procp)
- struct bootp_packet *call;
- struct bootp_packet *reply; /* output */
- struct proc *procp;
-{
- struct socket *so;
- struct sockaddr_in *sin;
- struct mbuf *m, *nam;
- struct uio auio;
- struct iovec aio;
- int error, rcvflg, timo, secs, len;
-
- /* Free at end if not null. */
- nam = NULL;
-
- /*
- * Create socket and set its recieve timeout.
- */
- if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0,procp)))
- goto out;
-
- m = m_get(M_WAIT, MT_SOOPTS);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- } else {
- struct timeval *tv;
- tv = mtod(m, struct timeval *);
- m->m_len = sizeof(*tv);
- tv->tv_sec = 1;
- tv->tv_usec = 0;
- if ((error = sosetopt(so, SOL_SOCKET, SO_RCVTIMEO, m)))
- goto out;
- }
-
- /*
- * Enable broadcast.
- */
- {
- int *on;
- m = m_get(M_WAIT, MT_SOOPTS);
- if (m == NULL) {
- error = ENOBUFS;
- goto out;
- }
- on = mtod(m, int *);
- m->m_len = sizeof(*on);
- *on = 1;
- if ((error = sosetopt(so, SOL_SOCKET, SO_BROADCAST, m)))
- goto out;
- }
-
- /*
- * Bind the local endpoint to a bootp client port.
- */
- m = m_getclr(M_WAIT, MT_SONAME);
- sin = mtod(m, struct sockaddr_in *);
- sin->sin_len = m->m_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_ANY;
- sin->sin_port = htons(IPPORT_BOOTPC);
- error = sobind(so, m);
- m_freem(m);
- if (error) {
- printf("bind failed\n");
- goto out;
- }
-
- /*
- * Setup socket address for the server.
- */
- nam = m_get(M_WAIT, MT_SONAME);
- if (nam == NULL) {
- error = ENOBUFS;
- goto out;
- }
- sin = mtod(nam, struct sockaddr_in *);
- sin-> sin_len = sizeof(*sin);
- sin-> sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_BROADCAST;
- sin->sin_port = htons(IPPORT_BOOTPS);
-
- nam->m_len = sizeof(*sin);
-
- /*
- * Send it, repeatedly, until a reply is received,
- * but delay each re-send by an increasing amount.
- * If the delay hits the maximum, start complaining.
- */
- timo = 0;
- for (;;) {
- /* Send BOOTP request (or re-send). */
-
- aio.iov_base = (caddr_t) call;
- aio.iov_len = sizeof(*call);
-
- auio.uio_iov = &aio;
- auio.uio_iovcnt = 1;
- auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_rw = UIO_WRITE;
- auio.uio_offset = 0;
- auio.uio_resid = sizeof(*call);
- auio.uio_procp = procp;
-
- error = sosend(so, nam, &auio, NULL, NULL, 0);
- if (error) {
- printf("bootpc_call: sosend: %d\n", error);
- goto out;
- }
-
- /* Determine new timeout. */
- if (timo < MAX_RESEND_DELAY)
- timo++;
- else
- printf("BOOTP timeout for server 0x%x\n",
- (int)ntohl(sin->sin_addr.s_addr));
-
- /*
- * Wait for up to timo seconds for a reply.
- * The socket receive timeout was set to 1 second.
- */
- secs = timo;
- while (secs > 0) {
- aio.iov_base = (caddr_t) reply;
- aio.iov_len = sizeof(*reply);
-
- auio.uio_iov = &aio;
- auio.uio_iovcnt = 1;
- auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_rw = UIO_READ;
- auio.uio_offset = 0;
- auio.uio_resid = sizeof(*reply);
- auio.uio_procp = procp;
-
- rcvflg = 0;
- error = soreceive(so, NULL, &auio, NULL, NULL, &rcvflg);
- if (error == EWOULDBLOCK) {
- secs--;
- call->secs=htons(ntohs(call->secs)+1);
- continue;
- }
- if (error)
- goto out;
- len = sizeof(*reply) - auio.uio_resid;
-
- /* Do we have the required number of bytes ? */
- if (len < BOOTP_MIN_LEN)
- continue;
-
- /* Is it the right reply? */
- if (reply->op != 2)
- continue;
-
- if (reply->xid != call->xid)
- continue;
-
- if (reply->hlen != call->hlen)
- continue;
-
- if (bcmp(reply->chaddr,call->chaddr,call->hlen))
- continue;
-
- goto gotreply; /* break two levels */
-
- } /* while secs */
- } /* forever send/receive */
-
- error = ETIMEDOUT;
- goto out;
-
- gotreply:
- out:
- if (nam) m_freem(nam);
- soclose(so);
- return error;
-}
-
-int
-bootpc_fakeup_interface(struct ifreq *ireq,struct socket *so,
- struct proc *procp)
-{
- struct sockaddr_in *sin;
- int error;
- struct sockaddr_in dst;
- struct sockaddr_in gw;
- struct sockaddr_in mask;
-
- /*
- * Bring up the interface.
- *
- * Get the old interface flags and or IFF_UP into them; if
- * IFF_UP set blindly, interface selection can be clobbered.
- */
- error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: GIFFLAGS, error=%d", error);
- ireq->ifr_flags |= IFF_UP;
- error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: SIFFLAGS, error=%d", error);
-
- /*
- * Do enough of ifconfig(8) so that the chosen interface
- * can talk to the servers. (just set the address)
- */
-
- /* addr is 0.0.0.0 */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_ANY;
- error = ifioctl(so, SIOCSIFADDR, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: set if addr, error=%d", error);
-
- /* netmask is 0.0.0.0 */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_ANY;
- error = ifioctl(so, SIOCSIFNETMASK, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: set if net addr, error=%d", error);
-
- /* Broadcast is 255.255.255.255 */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = INADDR_BROADCAST;
- error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_fakeup_interface: set if broadcast addr, error=%d", error);
-
- /* Add default route to 0.0.0.0 so we can send data */
-
- bzero((caddr_t) &dst, sizeof(dst));
- dst.sin_len=sizeof(dst);
- dst.sin_family=AF_INET;
- dst.sin_addr.s_addr = htonl(0);
-
- bzero((caddr_t) &gw, sizeof(gw));
- gw.sin_len=sizeof(gw);
- gw.sin_family=AF_INET;
- gw.sin_addr.s_addr = htonl(0x0);
-
- bzero((caddr_t) &mask, sizeof(mask));
- mask.sin_len=sizeof(mask);
- mask.sin_family=AF_INET;
- mask.sin_addr.s_addr = htonl(0);
-
- error = rtrequest(RTM_ADD,
- (struct sockaddr *) &dst,
- (struct sockaddr *) &gw,
- (struct sockaddr *) &mask,
- RTF_UP | RTF_STATIC
- , NULL);
- if (error)
- printf("bootpc_fakeup_interface: add default route, error=%d\n", error);
- return error;
-}
-
-int
-bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
- struct sockaddr_in *myaddr,
- struct sockaddr_in *netmask,
- struct sockaddr_in *gw,
- struct proc *procp)
-{
- int error;
- struct sockaddr_in oldgw;
- struct sockaddr_in olddst;
- struct sockaddr_in oldmask;
- struct sockaddr_in *sin;
-
- /* Remove old default route to 0.0.0.0 */
-
- bzero((caddr_t) &olddst, sizeof(olddst));
- olddst.sin_len=sizeof(olddst);
- olddst.sin_family=AF_INET;
- olddst.sin_addr.s_addr = INADDR_ANY;
-
- bzero((caddr_t) &oldgw, sizeof(oldgw));
- oldgw.sin_len=sizeof(oldgw);
- oldgw.sin_family=AF_INET;
- oldgw.sin_addr.s_addr = INADDR_ANY;
-
- bzero((caddr_t) &oldmask, sizeof(oldmask));
- oldmask.sin_len=sizeof(oldmask);
- oldmask.sin_family=AF_INET;
- oldmask.sin_addr.s_addr = INADDR_ANY;
-
- error = rtrequest(RTM_DELETE,
- (struct sockaddr *) &olddst,
- (struct sockaddr *) &oldgw,
- (struct sockaddr *) &oldmask,
- (RTF_UP | RTF_STATIC), NULL);
- if (error) {
- printf("nfs_boot: del default route, error=%d\n", error);
- return error;
- }
-
- /*
- * Do enough of ifconfig(8) so that the chosen interface
- * can talk to the servers. (just set the address)
- */
- bcopy(netmask,&ireq->ifr_addr,sizeof(*netmask));
- error = ifioctl(so, SIOCSIFNETMASK, (caddr_t)ireq, procp);
- if (error)
- panic("nfs_boot: set if netmask, error=%d", error);
-
- /* Broadcast is with host part of IP address all 1's */
-
- sin = (struct sockaddr_in *)&ireq->ifr_addr;
- bzero((caddr_t)sin, sizeof(*sin));
- sin->sin_len = sizeof(*sin);
- sin->sin_family = AF_INET;
- sin->sin_addr.s_addr = myaddr->sin_addr.s_addr | ~ netmask->sin_addr.s_addr;
- error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t)ireq, procp);
- if (error)
- panic("bootpc_call: set if broadcast addr, error=%d", error);
-
- bcopy(myaddr,&ireq->ifr_addr,sizeof(*myaddr));
- error = ifioctl(so, SIOCSIFADDR, (caddr_t)ireq, procp);
- if (error)
- panic("nfs_boot: set if addr, error=%d", error);
-
- /* Add new default route */
-
- error = rtrequest(RTM_ADD,
- (struct sockaddr *) &olddst,
- (struct sockaddr *) gw,
- (struct sockaddr *) &oldmask,
- (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL);
- if (error) {
- printf("nfs_boot: add net route, error=%d\n", error);
- return error;
- }
-
- return 0;
-}
-
-#if !defined(__rtems__)
-static int setfs(addr, path, p)
- struct sockaddr_in *addr;
- char *path;
- char *p;
-{
- unsigned ip = 0;
- int val;
-
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip = val << 24;
- if (*p != '.') return(0);
- p++;
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip |= (val << 16);
- if (*p != '.') return(0);
- p++;
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip |= (val << 8);
- if (*p != '.') return(0);
- p++;
- if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
- ip |= val;
- if (*p != ':') return(0);
- p++;
-
- addr->sin_addr.s_addr = htonl(ip);
- addr->sin_len = sizeof(struct sockaddr_in);
- addr->sin_family = AF_INET;
-
- strncpy(path,p,MNAMELEN-1);
- return(1);
-}
-#endif
-
-static int getdec(ptr)
- char **ptr;
-{
- char *p = *ptr;
- int ret=0;
- if ((*p < '0') || (*p > '9')) return(-1);
- while ((*p >= '0') && (*p <= '9')) {
- ret = ret*10 + (*p - '0');
- p++;
- }
- *ptr = p;
- return(ret);
-}
-
-static char *substr(a,b)
- char *a,*b;
-{
- char *loc1;
- char *loc2;
-
- while (*a != '\0') {
- loc1 = a;
- loc2 = b;
- while (*loc1 == *loc2++) {
- if (*loc1 == '\0') return (0);
- loc1++;
- if (*loc2 == '\0') return (loc1);
- }
- a++;
- }
- return (0);
-}
-
-static void printip(char *prefix,struct in_addr addr)
-{
- unsigned int ip;
-
- ip = ntohl(addr.s_addr);
-
- printf("%s is %d.%d.%d.%d\n",prefix,
- ip >> 24, (ip >> 16) & 255 ,(ip >> 8) & 255 ,ip & 255 );
-}
-
-void
-bootpc_init(void)
-{
- struct bootp_packet call;
- struct bootp_packet reply;
- static u_int32_t xid = ~0xFF;
-
- struct ifreq ireq;
- struct ifnet *ifp;
- struct socket *so;
- int error;
- int code,ncode,len;
- int j;
- char *p;
- unsigned int ip;
-
- struct sockaddr_in myaddr;
- struct sockaddr_in netmask;
- struct sockaddr_in gw;
- int gotgw=0;
- int gotnetmask=0;
-#if !defined(__rtems__)
- int gotrootpath=0;
- int gotswappath=0;
-#endif
- char lookup_path[24];
-
-#define EALEN 6
-#if !defined(__rtems__)
- unsigned char ea[EALEN];
-#endif
- struct ifaddr *ifa;
- struct sockaddr_dl *sdl = NULL;
- char *delim;
- struct proc *procp = NULL;
-
- /*
- * If already filled in, don't touch it here
- */
- if (nfs_diskless_valid)
- return;
-
- /*
- * Bump time if 0.
- if (!time.tv_sec)
- time.tv_sec++;
- */
-
- /*
- * Find a network interface.
- */
- for (ifp = ifnet; ifp != 0; ifp = ifp->if_next)
- if ((ifp->if_flags &
- (IFF_LOOPBACK|IFF_POINTOPOINT)) == 0)
- break;
- if (ifp == NULL)
- panic("bootpc_init: no suitable interface");
- bzero(&ireq,sizeof(ireq));
- sprintf(ireq.ifr_name, "%s%d", ifp->if_name,ifp->if_unit);
- printf("bootpc_init: using network interface '%s'\n",
- ireq.ifr_name);
-
- if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0,procp)) != 0)
- panic("nfs_boot: socreate, error=%d", error);
-
- bootpc_fakeup_interface(&ireq,so,procp);
-
- printf("Bootpc testing starting\n");
-
- /* Get HW address */
-
- for (ifa = ifp->if_addrlist;ifa; ifa = ifa->ifa_next)
- if (ifa->ifa_addr->sa_family == AF_LINK &&
- (sdl = ((struct sockaddr_dl *) ifa->ifa_addr)) &&
- sdl->sdl_type == IFT_ETHER)
- break;
-
- if (!sdl)
- panic("bootpc: Unable to find HW address");
- if (sdl->sdl_alen != EALEN )
- panic("bootpc: HW address len is %d, expected value is %d",
- sdl->sdl_alen,EALEN);
-
- printf("bootpc hw address is ");
- delim="";
- for (j=0;j<sdl->sdl_alen;j++) {
- printf("%s%x",delim,((unsigned char *)LLADDR(sdl))[j]);
- delim=":";
- }
- printf("\n");
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
-
- bzero((caddr_t) &call, sizeof(call));
-
- /* bootpc part */
- call.op = 1; /* BOOTREQUEST */
- call.htype= 1; /* 10mb ethernet */
- call.hlen=sdl->sdl_alen; /* Hardware address length */
- call.hops=0;
- xid++;
- call.xid = txdr_unsigned(xid);
- bcopy(LLADDR(sdl),&call.chaddr,sdl->sdl_alen);
-
- call.vend[0]=99;
- call.vend[1]=130;
- call.vend[2]=83;
- call.vend[3]=99;
- call.vend[4]=255;
-
- call.secs = 0;
- call.flags = htons(0x8000); /* We need an broadcast answer */
-
- error = bootpc_call(&call,&reply,procp);
-
- if (error)
- panic("BOOTP call failed -- error %d", error);
-
- bzero(&myaddr,sizeof(myaddr));
- bzero(&netmask,sizeof(netmask));
- bzero(&gw,sizeof(gw));
-
- myaddr.sin_len = sizeof(myaddr);
- myaddr.sin_family = AF_INET;
-
- netmask.sin_len = sizeof(netmask);
- netmask.sin_family = AF_INET;
-
- gw.sin_len = sizeof(gw);
- gw.sin_family= AF_INET;
-
- rtems_bsdnet_bootp_server_address = reply.siaddr;
- rtems_bsdnet_log_host_address = reply.siaddr;
-
- myaddr.sin_addr = reply.yiaddr;
-
- ip = ntohl(myaddr.sin_addr.s_addr);
- sprintf(lookup_path,"swap.%d.%d.%d.%d",
- ip >> 24, (ip >> 16) & 255 ,(ip >> 8) & 255 ,ip & 255 );
-
- printip("My ip address",myaddr.sin_addr);
-
- printip("Server ip address",reply.siaddr);
-
- gw.sin_addr = reply.giaddr;
- printip("Gateway ip address",reply.giaddr);
-
- if (reply.sname[0])
- printf("Server name is %s\n",reply.sname);
- if (reply.file[0])
- printf("boot file is %s\n",reply.file);
- rtems_bsdnet_bootp_boot_file_name = strdup (reply.file);
- if (reply.vend[0]==99 && reply.vend[1]==130 &&
- reply.vend[2]==83 && reply.vend[3]==99) {
- j=4;
- ncode = reply.vend[j];
- while (j<sizeof(reply.vend)) {
- code = reply.vend[j] = ncode;
- if (code==255)
- break;
- if (code==0) {
- j++;
- continue;
- }
- len = reply.vend[j+1];
- j+=2;
- if (len+j>=sizeof(reply.vend)) {
- printf("Truncated field");
- break;
- }
- ncode = reply.vend[j+len];
- reply.vend[j+len]='\0';
- p = &reply.vend[j];
- switch (code) {
- case 1:
- if (len!=4)
- panic("bootpc: subnet mask len is %d",len);
- bcopy(&reply.vend[j],&netmask.sin_addr,4);
- gotnetmask=1;
- printip("Subnet mask",netmask.sin_addr);
- break;
- case 6:
- /* Domain Name servers */
- if (len % 4)
- panic("bootpc: DNS Len is %d",len);
- {
- int dlen = 0;
- while ((dlen < len) &&
- (rtems_bsdnet_nameserver_count < sizeof rtems_bsdnet_config.name_server /
- sizeof rtems_bsdnet_config.name_server[0])) {
- bcopy(&reply.vend[j+dlen],
- &rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count],
- 4);
- printip("Domain Name Server",
- rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count]);
- rtems_bsdnet_nameserver_count++;
- dlen += 4;
- }
- }
- break;
- case 16: /* Swap server IP address. unused */
- case 2:
- /* Time offset */
- break;
- case 3:
- /* Routers */
- if (len % 4)
- panic("bootpc: Router Len is %d",len);
- if (len > 0) {
- bcopy(&reply.vend[j],&gw.sin_addr,4);
- printip("Router",gw.sin_addr);
- gotgw=1;
- }
- break;
- case 7:
- /* Log servers */
- if (len % 4)
- panic("bootpc: Log server len is %d",len);
- if (len > 0) {
- bcopy(&reply.vend[j],&rtems_bsdnet_log_host_address,4);
- printip("Log server",rtems_bsdnet_log_host_address);
- }
- break;
- case 12:
- if (len>=MAXHOSTNAMELEN)
- panic("bootpc: hostname >=%d bytes",MAXHOSTNAMELEN);
- if (sethostname (&reply.vend[j], len) < 0)
- panic("Can't set host name");
- printf("Hostname is %.*s\n",len,&reply.vend[j]);
- break;
- case 15:
- /* Domain name */
- rtems_bsdnet_domain_name = strdup (&reply.vend[j]);
- if (rtems_bsdnet_domain_name)
- printf("Domain name is %s\n", rtems_bsdnet_domain_name);
- break;
- default:
- printf("Ignoring field type %d\n",code);
- }
- j+=len;
- }
- }
-
- if (!gotnetmask) {
- if (IN_CLASSA(ntohl(myaddr.sin_addr.s_addr)))
- netmask.sin_addr.s_addr = htonl(IN_CLASSA_NET);
- else if (IN_CLASSB(ntohl(myaddr.sin_addr.s_addr)))
- netmask.sin_addr.s_addr = htonl(IN_CLASSB_NET);
- else
- netmask.sin_addr.s_addr = htonl(IN_CLASSC_NET);
- }
- if (!gotgw) {
- /* Use proxyarp */
- gw.sin_addr.s_addr = myaddr.sin_addr.s_addr;
- }
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
- error = bootpc_adjust_interface(&ireq,so,
- &myaddr,&netmask,&gw,procp);
-
- soclose(so);
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
-
-
-#if 0
- myaddr.sin_addr.s_addr | ~ netmask.sin_addr.s_addr;
-#endif
-
-#if 0
- bootpboot_p_iflist();
- bootpboot_p_rtlist();
-#endif
- return;
-}
diff --git a/cpukit/libnetworking/nfs/krpc.h b/cpukit/libnetworking/nfs/krpc.h
deleted file mode 100644
index 8a21392657..0000000000
--- a/cpukit/libnetworking/nfs/krpc.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* $NetBSD: krpc.h,v 1.4 1995/12/19 23:07:11 cgd Exp $ */
-/* $Id$ */
-
-#include <sys/cdefs.h>
-
-int krpc_call __P((struct sockaddr_in *sin,
- u_int prog, u_int vers, u_int func,
- struct mbuf **data, struct mbuf **from, struct proc *procp));
-
-int krpc_portmap __P((struct sockaddr_in *sin,
- u_int prog, u_int vers, u_int16_t *portp, struct proc *procp));
-
-struct mbuf *xdr_string_encode __P((char *str, int len));
-
-/*
- * RPC definitions for the portmapper
- */
-#define PMAPPORT 111
-#define PMAPPROG 100000
-#define PMAPVERS 2
-#define PMAPPROC_NULL 0
-#define PMAPPROC_SET 1
-#define PMAPPROC_UNSET 2
-#define PMAPPROC_GETPORT 3
-#define PMAPPROC_DUMP 4
-#define PMAPPROC_CALLIT 5
diff --git a/cpukit/libnetworking/nfs/nfs.h b/cpukit/libnetworking/nfs/nfs.h
deleted file mode 100644
index 68f206e213..0000000000
--- a/cpukit/libnetworking/nfs/nfs.h
+++ /dev/null
@@ -1,620 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)nfs.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_NFS_H_
-#define _NFS_NFS_H_
-
-#include <nfs/rpcv2.h>
-
-/*
- * Tunable constants for nfs
- */
-
-#define NFS_MAXIOVEC 34
-#define NFS_TICKINTVL 5 /* Desired time for a tick (msec) */
-#define NFS_HZ (hz / nfs_ticks) /* Ticks/sec */
-#define NFS_TIMEO (1 * NFS_HZ) /* Default timeout = 1 second */
-#define NFS_MINTIMEO (1 * NFS_HZ) /* Min timeout to use */
-#define NFS_MAXTIMEO (60 * NFS_HZ) /* Max timeout to backoff to */
-#define NFS_MINIDEMTIMEO (5 * NFS_HZ) /* Min timeout for non-idempotent ops*/
-#define NFS_MAXREXMIT 100 /* Stop counting after this many */
-#define NFS_MAXWINDOW 1024 /* Max number of outstanding requests */
-#define NFS_RETRANS 10 /* Num of retrans for soft mounts */
-#define NFS_MAXGRPS 16 /* Max. size of groups list */
-#ifndef NFS_MINATTRTIMO
-#define NFS_MINATTRTIMO 5 /* Attribute cache timeout in sec */
-#endif
-#ifndef NFS_MAXATTRTIMO
-#define NFS_MAXATTRTIMO 60
-#endif
-#define NFS_WSIZE 8192 /* Def. write data size <= 8192 */
-#define NFS_RSIZE 8192 /* Def. read data size <= 8192 */
-#define NFS_READDIRSIZE 8192 /* Def. readdir size */
-#define NFS_DEFRAHEAD 1 /* Def. read ahead # blocks */
-#define NFS_MAXRAHEAD 4 /* Max. read ahead # blocks */
-#define NFS_MAXUIDHASH 64 /* Max. # of hashed uid entries/mp */
-#define NFS_MAXASYNCDAEMON 20 /* Max. number async_daemons runnable */
-#define NFS_MAXGATHERDELAY 100 /* Max. write gather delay (msec) */
-#ifndef NFS_GATHERDELAY
-#define NFS_GATHERDELAY 10 /* Default write gather delay (msec) */
-#endif
-#define NFS_DIRBLKSIZ 4096 /* Must be a multiple of DIRBLKSIZ */
-
-/*
- * Oddballs
- */
-#define NMOD(a) ((a) % nfs_asyncdaemons)
-#define NFS_CMPFH(n, f, s) \
- ((n)->n_fhsize == (s) && !bcmp((caddr_t)(n)->n_fhp, (caddr_t)(f), (s)))
-#define NFS_ISV3(v) (VFSTONFS((v)->v_mount)->nm_flag & NFSMNT_NFSV3)
-#define NFS_SRVMAXDATA(n) \
- (((n)->nd_flag & ND_NFSV3) ? (((n)->nd_nam2) ? \
- NFS_MAXDGRAMDATA : NFS_MAXDATA) : NFS_V2MAXDATA)
-
-/*
- * XXX
- * sys/buf.h should be edited to change B_APPENDWRITE --> B_NEEDCOMMIT, but
- * until then...
- * Same goes for sys/malloc.h, which needs M_NFSDIROFF,
- * M_NFSRVDESC and M_NFSBIGFH added.
- * The VA_EXCLUSIVE flag should be added for va_vaflags and set for an
- * exclusive create.
- * The B_INVAFTERWRITE flag should be set to whatever is required by the
- * buffer cache code to say "Invalidate the block after it is written back".
- */
-#ifndef B_NEEDCOMMIT
-#define B_NEEDCOMMIT B_APPENDWRITE
-#endif
-#ifndef M_NFSRVDESC
-#define M_NFSRVDESC M_TEMP
-#endif
-#ifndef M_NFSDIROFF
-#define M_NFSDIROFF M_TEMP
-#endif
-#ifndef M_NFSBIGFH
-#define M_NFSBIGFH M_TEMP
-#endif
-#ifndef VA_EXCLUSIVE
-#define VA_EXCLUSIVE 0
-#endif
-#ifdef __FreeBSD__
-#define B_INVAFTERWRITE B_NOCACHE
-#else
-#define B_INVAFTERWRITE B_INVAL
-#endif
-
-/*
- * These ifdefs try to handle the differences between the various 4.4BSD-Lite
- * based vfs interfaces.
- * btw: NetBSD-current does have a VOP_LEASDE(), but I don't know how to
- * differentiate between NetBSD-1.0 and NetBSD-current, so..
- * I also don't know about BSDi's 2.0 release.
- */
-#if !defined(HAS_VOPLEASE) && !defined(__FreeBSD__) && !defined(__NetBSD__)
-#define HAS_VOPLEASE 1
-#endif
-#if !defined(HAS_VOPREVOKE) && !defined(__FreeBSD__) && !defined(__NetBSD__)
-#define HAS_VOPREVOKE 1
-#endif
-
-/*
- * The IO_METASYNC flag should be implemented for local file systems.
- * (Until then, it is nothin at all.)
- */
-#ifndef IO_METASYNC
-#define IO_METASYNC 0
-#endif
-
-/*
- * Set the attribute timeout based on how recently the file has been modified.
- */
-#define NFS_ATTRTIMEO(np) \
- ((((np)->n_flag & NMODIFIED) || \
- (time.tv_sec - (np)->n_mtime) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \
- ((time.tv_sec - (np)->n_mtime) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \
- (time.tv_sec - (np)->n_mtime) / 10))
-
-/*
- * Expected allocation sizes for major data structures. If the actual size
- * of the structure exceeds these sizes, then malloc() will be allocating
- * almost twice the memory required. This is used in nfs_init() to warn
- * the sysadmin that the size of a structure should be reduced.
- * (These sizes are always a power of 2. If the kernel malloc() changes
- * to one that does not allocate space in powers of 2 size, then this all
- * becomes bunk!)
- */
-#define NFS_NODEALLOC 256
-#define NFS_MNTALLOC 512
-#define NFS_SVCALLOC 256
-#define NFS_UIDALLOC 128
-
-/*
- * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs
- * should ever try and use it.
- */
-struct nfsd_args {
- int sock; /* Socket to serve */
- caddr_t name; /* Client address for connection based sockets */
- int namelen; /* Length of name */
-};
-
-struct nfsd_srvargs {
- struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */
- uid_t nsd_uid; /* Effective uid mapped to cred */
- u_long nsd_haddr; /* Ip address of client */
- struct ucred nsd_cr; /* Cred. uid maps to */
- int nsd_authlen; /* Length of auth string (ret) */
- u_char *nsd_authstr; /* Auth string (ret) */
- int nsd_verflen; /* and the verfier */
- u_char *nsd_verfstr;
- struct timeval nsd_timestamp; /* timestamp from verifier */
- u_long nsd_ttl; /* credential ttl (sec) */
- NFSKERBKEY_T nsd_key; /* Session key */
-};
-
-struct nfsd_cargs {
- char *ncd_dirp; /* Mount dir path */
- uid_t ncd_authuid; /* Effective uid */
- int ncd_authtype; /* Type of authenticator */
- int ncd_authlen; /* Length of authenticator string */
- u_char *ncd_authstr; /* Authenticator string */
- int ncd_verflen; /* and the verifier */
- u_char *ncd_verfstr;
- NFSKERBKEY_T ncd_key; /* Session key */
-};
-
-/*
- * Stats structure
- */
-struct nfsstats {
- int attrcache_hits;
- int attrcache_misses;
- int lookupcache_hits;
- int lookupcache_misses;
- int direofcache_hits;
- int direofcache_misses;
- int biocache_reads;
- int read_bios;
- int read_physios;
- int biocache_writes;
- int write_bios;
- int write_physios;
- int biocache_readlinks;
- int readlink_bios;
- int biocache_readdirs;
- int readdir_bios;
- int rpccnt[NFS_NPROCS];
- int rpcretries;
- int srvrpccnt[NFS_NPROCS];
- int srvrpc_errs;
- int srv_errs;
- int rpcrequests;
- int rpctimeouts;
- int rpcunexpected;
- int rpcinvalid;
- int srvcache_inproghits;
- int srvcache_idemdonehits;
- int srvcache_nonidemdonehits;
- int srvcache_misses;
- int srvnqnfs_leases;
- int srvnqnfs_maxleases;
- int srvnqnfs_getleases;
- int srvvop_writes;
-};
-
-/*
- * Flags for nfssvc() system call.
- */
-#define NFSSVC_BIOD 0x002
-#define NFSSVC_NFSD 0x004
-#define NFSSVC_ADDSOCK 0x008
-#define NFSSVC_AUTHIN 0x010
-#define NFSSVC_GOTAUTH 0x040
-#define NFSSVC_AUTHINFAIL 0x080
-#define NFSSVC_MNTD 0x100
-
-/*
- * fs.nfs sysctl(3) identifiers
- */
-#define NFS_NFSSTATS 1 /* struct: struct nfsstats */
-#define NFS_NFSPRIVPORT 2 /* int: prohibit nfs to resvports */
-
-#define FS_NFS_NAMES { \
- { 0, 0 }, \
- { "nfsstats", CTLTYPE_STRUCT }, \
- { "nfsprivport", CTLTYPE_INT }, \
-}
-
-/*
- * The set of signals the interrupt an I/O in progress for NFSMNT_INT mounts.
- * What should be in this set is open to debate, but I believe that since
- * I/O system calls on ufs are never interrupted by signals the set should
- * be minimal. My reasoning is that many current programs that use signals
- * such as SIGALRM will not expect file I/O system calls to be interrupted
- * by them and break.
- */
-#if defined(KERNEL) || defined(_KERNEL)
-
-struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
-
-#define NFSINT_SIGMASK (sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGKILL)| \
- sigmask(SIGHUP)|sigmask(SIGQUIT))
-
-/*
- * Socket errors ignored for connectionless sockets??
- * For now, ignore them all
- */
-#define NFSIGNORE_SOERROR(s, e) \
- ((e) != EINTR && (e) != ERESTART && (e) != EWOULDBLOCK && \
- ((s) & PR_CONNREQUIRED) == 0)
-
-/*
- * Nfs outstanding request list element
- */
-struct nfsreq {
- TAILQ_ENTRY(nfsreq) r_chain;
- struct mbuf *r_mreq;
- struct mbuf *r_mrep;
- struct mbuf *r_md;
- caddr_t r_dpos;
- struct nfsmount *r_nmp;
- struct vnode *r_vp;
- u_long r_xid;
- int r_flags; /* flags on request, see below */
- int r_retry; /* max retransmission count */
- int r_rexmit; /* current retrans count */
- int r_timer; /* tick counter on reply */
- int r_procnum; /* NFS procedure number */
- int r_rtt; /* RTT for rpc */
- struct proc *r_procp; /* Proc that did I/O system call */
-};
-
-/*
- * Queue head for nfsreq's
- */
-extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
-
-/* Flag values for r_flags */
-#define R_TIMING 0x01 /* timing request (in mntp) */
-#define R_SENT 0x02 /* request has been sent */
-#define R_SOFTTERM 0x04 /* soft mnt, too many retries */
-#define R_INTR 0x08 /* intr mnt, signal pending */
-#define R_SOCKERR 0x10 /* Fatal error on socket */
-#define R_TPRINTFMSG 0x20 /* Did a tprintf msg. */
-#define R_MUSTRESEND 0x40 /* Must resend request */
-#define R_GETONEREP 0x80 /* Probe for one reply only */
-
-/*
- * A list of nfssvc_sock structures is maintained with all the sockets
- * that require service by the nfsd.
- * The nfsuid structs hang off of the nfssvc_sock structs in both lru
- * and uid hash lists.
- */
-#ifndef NFS_UIDHASHSIZ
-#define NFS_UIDHASHSIZ 29 /* Tune the size of nfssvc_sock with this */
-#endif
-#define NUIDHASH(sock, uid) \
- (&(sock)->ns_uidhashtbl[(uid) % NFS_UIDHASHSIZ])
-#ifndef NFS_WDELAYHASHSIZ
-#define NFS_WDELAYHASHSIZ 16 /* and with this */
-#endif
-#define NWDELAYHASH(sock, f) \
- (&(sock)->ns_wdelayhashtbl[(*((u_long *)(f))) % NFS_WDELAYHASHSIZ])
-#ifndef NFS_MUIDHASHSIZ
-#define NFS_MUIDHASHSIZ 63 /* Tune the size of nfsmount with this */
-#endif
-#define NMUIDHASH(nmp, uid) \
- (&(nmp)->nm_uidhashtbl[(uid) % NFS_MUIDHASHSIZ])
-#define NFSNOHASH(fhsum) \
- (&nfsnodehashtbl[(fhsum) & nfsnodehash])
-
-/*
- * Network address hash list element
- */
-union nethostaddr {
- u_long had_inetaddr;
- struct mbuf *had_nam;
-};
-
-struct nfsuid {
- TAILQ_ENTRY(nfsuid) nu_lru; /* LRU chain */
- LIST_ENTRY(nfsuid) nu_hash; /* Hash list */
- int nu_flag; /* Flags */
- union nethostaddr nu_haddr; /* Host addr. for dgram sockets */
- struct ucred nu_cr; /* Cred uid mapped to */
- int nu_expire; /* Expiry time (sec) */
- struct timeval nu_timestamp; /* Kerb. timestamp */
- u_long nu_nickname; /* Nickname on server */
- NFSKERBKEY_T nu_key; /* and session key */
-};
-
-#define nu_inetaddr nu_haddr.had_inetaddr
-#define nu_nam nu_haddr.had_nam
-/* Bits for nu_flag */
-#define NU_INETADDR 0x1
-#define NU_NAM 0x2
-#define NU_NETFAM(u) (((u)->nu_flag & NU_INETADDR) ? AF_INET : AF_ISO)
-
-struct nfssvc_sock {
- TAILQ_ENTRY(nfssvc_sock) ns_chain; /* List of all nfssvc_sock's */
- TAILQ_HEAD(, nfsuid) ns_uidlruhead;
- struct file *ns_fp;
- struct socket *ns_so;
- struct mbuf *ns_nam;
- struct mbuf *ns_raw;
- struct mbuf *ns_rawend;
- struct mbuf *ns_rec;
- struct mbuf *ns_recend;
- struct mbuf *ns_frag;
- int ns_flag;
- int ns_solock;
- int ns_cc;
- int ns_reclen;
- int ns_numuids;
- u_long ns_sref;
- LIST_HEAD(, nfsrv_descript) ns_tq; /* Write gather lists */
- LIST_HEAD(, nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ];
- LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ];
-};
-
-/* Bits for "ns_flag" */
-#define SLP_VALID 0x01
-#define SLP_DOREC 0x02
-#define SLP_NEEDQ 0x04
-#define SLP_DISCONN 0x08
-#define SLP_GETSTREAM 0x10
-#define SLP_LASTFRAG 0x20
-#define SLP_ALLFLAGS 0xff
-
-extern TAILQ_HEAD(nfssvc_sockhead, nfssvc_sock) nfssvc_sockhead;
-extern int nfssvc_sockhead_flag;
-#define SLP_INIT 0x01
-#define SLP_WANTINIT 0x02
-
-/*
- * One of these structures is allocated for each nfsd.
- */
-struct nfsd {
- TAILQ_ENTRY(nfsd) nfsd_chain; /* List of all nfsd's */
- int nfsd_flag; /* NFSD_ flags */
- struct nfssvc_sock *nfsd_slp; /* Current socket */
- int nfsd_authlen; /* Authenticator len */
- u_char nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */
- int nfsd_verflen; /* and the Verifier */
- u_char nfsd_verfstr[RPCVERF_MAXSIZ];
- struct proc *nfsd_procp; /* Proc ptr */
- struct nfsrv_descript *nfsd_nd; /* Associated nfsrv_descript */
-};
-
-/* Bits for "nfsd_flag" */
-#define NFSD_WAITING 0x01
-#define NFSD_REQINPROG 0x02
-#define NFSD_NEEDAUTH 0x04
-#define NFSD_AUTHFAIL 0x08
-
-/*
- * This structure is used by the server for describing each request.
- * Some fields are used only when write request gathering is performed.
- */
-struct nfsrv_descript {
- u_quad_t nd_time; /* Write deadline (usec) */
- off_t nd_off; /* Start byte offset */
- off_t nd_eoff; /* and end byte offset */
- LIST_ENTRY(nfsrv_descript) nd_hash; /* Hash list */
- LIST_ENTRY(nfsrv_descript) nd_tq; /* and timer list */
- LIST_HEAD(,nfsrv_descript) nd_coalesce; /* coalesced writes */
- struct mbuf *nd_mrep; /* Request mbuf list */
- struct mbuf *nd_md; /* Current dissect mbuf */
- struct mbuf *nd_mreq; /* Reply mbuf list */
- struct mbuf *nd_nam; /* and socket addr */
- struct mbuf *nd_nam2; /* return socket addr */
- caddr_t nd_dpos; /* Current dissect pos */
- int nd_procnum; /* RPC # */
- int nd_stable; /* storage type */
- int nd_flag; /* nd_flag */
- int nd_len; /* Length of this write */
- int nd_repstat; /* Reply status */
- u_long nd_retxid; /* Reply xid */
- u_long nd_duration; /* Lease duration */
- struct timeval nd_starttime; /* Time RPC initiated */
- fhandle_t nd_fh; /* File handle */
- struct ucred nd_cr; /* Credentials */
-};
-
-/* Bits for "nd_flag" */
-#define ND_READ LEASE_READ
-#define ND_WRITE LEASE_WRITE
-#define ND_CHECK 0x04
-#define ND_LEASE (ND_READ | ND_WRITE | ND_CHECK)
-#define ND_NFSV3 0x08
-#define ND_NQNFS 0x10
-#define ND_KERBNICK 0x20
-#define ND_KERBFULL 0x40
-#define ND_KERBAUTH (ND_KERBNICK | ND_KERBFULL)
-
-extern TAILQ_HEAD(nfsd_head, nfsd) nfsd_head;
-extern int nfsd_head_flag;
-#define NFSD_CHECKSLP 0x01
-
-/*
- * These macros compare nfsrv_descript structures.
- */
-#define NFSW_CONTIG(o, n) \
- ((o)->nd_eoff >= (n)->nd_off && \
- !bcmp((caddr_t)&(o)->nd_fh, (caddr_t)&(n)->nd_fh, NFSX_V3FH))
-
-#define NFSW_SAMECRED(o, n) \
- (((o)->nd_flag & ND_KERBAUTH) == ((n)->nd_flag & ND_KERBAUTH) && \
- !bcmp((caddr_t)&(o)->nd_cr, (caddr_t)&(n)->nd_cr, \
- sizeof (struct ucred)))
-
-int nfs_reply __P((struct nfsreq *));
-int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
-int nfs_send __P((struct socket *,struct mbuf *,struct mbuf *,struct nfsreq *));
-int nfs_rephead __P((int,struct nfsrv_descript *,struct nfssvc_sock *,int,int,u_quad_t *,struct mbuf **,struct mbuf **,caddr_t *));
-int nfs_sndlock __P((int *,struct nfsreq *));
-void nfs_sndunlock __P((int *flagp));
-int nfs_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *));
-int nfs_vinvalbuf __P((struct vnode *,int,struct ucred *,struct proc *,int));
-int nfs_readrpc __P((struct vnode *,struct uio *,struct ucred *));
-int nfs_writerpc __P((struct vnode *,struct uio *,struct ucred *,int *,int *));
-int nfs_readdirrpc __P((register struct vnode *,struct uio *,struct ucred *));
-int nfs_asyncio __P((struct buf *,struct ucred *));
-int nfs_doio __P((struct buf *,struct ucred *,struct proc *));
-int nfs_readlinkrpc __P((struct vnode *,struct uio *,struct ucred *));
-int nfs_sigintr __P((struct nfsmount *,struct nfsreq *r,struct proc *));
-int nfs_readdirplusrpc __P((struct vnode *,register struct uio *,struct ucred *));
-int nfsm_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *));
-void nfsm_srvfattr __P((struct nfsrv_descript *,struct vattr *,struct nfs_fattr *));
-void nfsm_srvwcc __P((struct nfsrv_descript *,int,struct vattr *,int,struct vattr *,struct mbuf **,char **));
-void nfsm_srvpostopattr __P((struct nfsrv_descript *,int,struct vattr *,struct mbuf **,char **));
-int netaddr_match __P((int,union nethostaddr *,struct mbuf *));
-int nfs_request __P((struct vnode *,struct mbuf *,int,struct proc *,struct ucred *,struct mbuf **,struct mbuf **,caddr_t *));
-int nfs_loadattrcache __P((struct vnode **,struct mbuf **,caddr_t *,struct vattr *));
-int nfs_namei __P((struct nameidata *,fhandle_t *,int,struct nfssvc_sock *,struct mbuf *,struct mbuf **,caddr_t *,struct vnode **,struct proc *,int));
-void nfsm_adj __P((struct mbuf *,int,int));
-int nfsm_mbuftouio __P((struct mbuf **,struct uio *,int,caddr_t *));
-void nfsrv_initcache __P((void));
-int nfs_getauth __P((struct nfsmount *,struct nfsreq *,struct ucred *,char **,int *,char *,int *,NFSKERBKEY_T));
-int nfs_getnickauth __P((struct nfsmount *,struct ucred *,char **,int *,char *,int));
-int nfs_savenickauth __P((struct nfsmount *,struct ucred *,int,NFSKERBKEY_T,struct mbuf **,char **,struct mbuf *));
-int nfs_adv __P((struct mbuf **,caddr_t *,int,int));
-void nfs_nhinit __P((void));
-void nfs_timer __P((void*));
-u_long nfs_hash __P((nfsfh_t *,int));
-void nfsrv_slpderef __P((struct nfssvc_sock *slp));
-int nfsrv_dorec __P((struct nfssvc_sock *,struct nfsd *,struct nfsrv_descript **));
-void nfsrv_cleancache __P((void));
-int nfsrv_getcache __P((struct nfsrv_descript *,struct nfssvc_sock *,struct mbuf **));
-int nfs_init __P((void));
-void nfsrv_updatecache __P((struct nfsrv_descript *,int,struct mbuf *));
-int nfs_connect __P((struct nfsmount *,struct nfsreq *));
-void nfs_disconnect __P((struct nfsmount *nmp));
-int nfs_getattrcache __P((struct vnode *,struct vattr *));
-int nfsm_strtmbuf __P((struct mbuf **,char **,char *,long));
-int nfs_bioread __P((struct vnode *,struct uio *,int,struct ucred *, int getpages));
-int nfsm_uiotombuf __P((struct uio *,struct mbuf **,int,caddr_t *));
-void nfsrv_init __P((int));
-void nfs_clearcommit __P((struct mount *));
-int nfsrv_errmap __P((struct nfsrv_descript *, int));
-void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag));
-void nfsrvw_sort __P((gid_t [],int));
-void nfsrv_setcred __P((struct ucred *,struct ucred *));
-int nfs_writebp __P((struct buf *,int));
-int nfsrv_object_create __P(( struct vnode * ));
-void nfsrv_wakenfsd __P((struct nfssvc_sock *slp));
-int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *,
- struct proc *, struct mbuf **));
-int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *,
- struct proc *p));
-
-int nfsrv3_access __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **,
- struct ucred *,struct nfssvc_sock *,struct mbuf *,
- int *,int));
-int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_link __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_lookup __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_mkdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_mknod __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_noop __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_null __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_pathconf __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_read __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_readdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_readdirplus __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_readlink __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_remove __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_rename __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_rmdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_setattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_statfs __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_symlink __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-
-#ifdef NFS_DEBUG
-
-extern int nfs_debug;
-#define NFS_DEBUG_ASYNCIO 1 /* asynchronous i/o */
-#define NFS_DEBUG_WG 2 /* server write gathering */
-#define NFS_DEBUG_RC 4 /* server request caching */
-
-#define NFS_DPF(cat, args) \
- do { \
- if (nfs_debug & NFS_DEBUG_##cat) printf args; \
- } while (0)
-
-#else
-
-#define NFS_DPF(cat, args)
-
-#endif
-
-#endif /* KERNEL */
-
-#endif
diff --git a/cpukit/libnetworking/nfs/nfsdiskless.h b/cpukit/libnetworking/nfs/nfsdiskless.h
deleted file mode 100644
index 0ed5c8f6f7..0000000000
--- a/cpukit/libnetworking/nfs/nfsdiskless.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)nfsdiskless.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_NFSDISKLESS_H_
-#define _NFS_NFSDISKLESS_H_
-
-/*
- * Structure that must be initialized for a diskless nfs client.
- * This structure is used by nfs_mountroot() to set up the root and swap
- * vnodes plus do a partial ifconfig(8) and route(8) so that the critical net
- * interface can communicate with the server.
- * The primary bootstrap is expected to fill in the appropriate fields before
- * starting the kernel. Whether or not the swap area is nfs mounted is determined
- * by the value in swdevt[0]. (equal to NODEV --> swap over nfs)
- * Currently only works for AF_INET protocols.
- * NB: All fields are stored in net byte order to avoid hassles with
- * client/server byte ordering differences.
- */
-
-/*
- * I have defined a new structure that can handle an NFS Version 3 file handle
- * but the kernel still expects the old Version 2 one to be provided. The
- * changes required in nfs_vfsops.c for using the new are documented there in
- * comments. (I felt that breaking network booting code by changing this
- * structure would not be prudent at this time, since almost all servers are
- * still Version 2 anyhow.)
- */
-struct nfsv3_diskless {
- struct ifaliasreq myif; /* Default interface */
- struct sockaddr_in mygateway; /* Default gateway */
- struct nfs_args swap_args; /* Mount args for swap file */
- int swap_fhsize; /* Size of file handle */
- u_char swap_fh[NFSX_V3FHMAX]; /* Swap file's file handle */
- struct sockaddr_in swap_saddr; /* Address of swap server */
- char swap_hostnam[MNAMELEN]; /* Host name for mount pt */
- int swap_nblks; /* Size of server swap file */
- struct ucred swap_ucred; /* Swap credentials */
- struct nfs_args root_args; /* Mount args for root fs */
- int root_fhsize; /* Size of root file handle */
- u_char root_fh[NFSX_V3FHMAX]; /* File handle of root dir */
- struct sockaddr_in root_saddr; /* Address of root server */
- char root_hostnam[MNAMELEN]; /* Host name for mount pt */
- long root_time; /* Timestamp of root fs */
- char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */
-};
-
-struct nfs_diskless {
- struct ifaliasreq myif; /* Default interface */
- struct sockaddr_in mygateway; /* Default gateway */
- struct nfs_args swap_args; /* Mount args for swap file */
- u_char swap_fh[NFSX_V2FH]; /* Swap file's file handle */
- struct sockaddr_in swap_saddr; /* Address of swap server */
- char swap_hostnam[MNAMELEN]; /* Host name for mount pt */
- int swap_nblks; /* Size of server swap file */
- struct ucred swap_ucred; /* Swap credentials */
- struct nfs_args root_args; /* Mount args for root fs */
- u_char root_fh[NFSX_V2FH]; /* File handle of root dir */
- struct sockaddr_in root_saddr; /* Address of root server */
- char root_hostnam[MNAMELEN]; /* Host name for mount pt */
- long root_time; /* Timestamp of root fs */
- char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */
-};
-
-#endif
diff --git a/cpukit/libnetworking/nfs/nfsproto.h b/cpukit/libnetworking/nfs/nfsproto.h
deleted file mode 100644
index 6ce7c5b960..0000000000
--- a/cpukit/libnetworking/nfs/nfsproto.h
+++ /dev/null
@@ -1,441 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)nfsproto.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_NFSPROTO_H_
-#define _NFS_NFSPROTO_H_
-
-/*
- * nfs definitions as per the Version 2 and 3 specs
- */
-
-/*
- * Constants as defined in the Sun NFS Version 2 and 3 specs.
- * "NFS: Network File System Protocol Specification" RFC1094
- * and in the "NFS: Network File System Version 3 Protocol
- * Specification"
- */
-
-#define NFS_PORT 2049
-#define NFS_PROG 100003
-#define NFS_VER2 2
-#define NFS_VER3 3
-#define NFS_V2MAXDATA 8192
-#define NFS_MAXDGRAMDATA 16384
-#define NFS_MAXDATA 32768
-#define NFS_MAXPATHLEN 1024
-#define NFS_MAXNAMLEN 255
-#define NFS_MAXPKTHDR 404
-#define NFS_MAXPACKET (NFS_MAXPKTHDR + NFS_MAXDATA)
-#define NFS_MINPACKET 20
-#define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */
-
-/* Stat numbers for rpc returns (version 2 and 3) */
-#define NFS_OK 0
-#define NFSERR_PERM 1
-#define NFSERR_NOENT 2
-#define NFSERR_IO 5
-#define NFSERR_NXIO 6
-#define NFSERR_ACCES 13
-#define NFSERR_EXIST 17
-#define NFSERR_XDEV 18 /* Version 3 only */
-#define NFSERR_NODEV 19
-#define NFSERR_NOTDIR 20
-#define NFSERR_ISDIR 21
-#define NFSERR_INVAL 22 /* Version 3 only */
-#define NFSERR_FBIG 27
-#define NFSERR_NOSPC 28
-#define NFSERR_ROFS 30
-#define NFSERR_MLINK 31 /* Version 3 only */
-#define NFSERR_NAMETOL 63
-#define NFSERR_NOTEMPTY 66
-#define NFSERR_DQUOT 69
-#define NFSERR_STALE 70
-#define NFSERR_REMOTE 71 /* Version 3 only */
-#define NFSERR_WFLUSH 99 /* Version 2 only */
-#define NFSERR_BADHANDLE 10001 /* The rest Version 3 only */
-#define NFSERR_NOT_SYNC 10002
-#define NFSERR_BAD_COOKIE 10003
-#define NFSERR_NOTSUPP 10004
-#define NFSERR_TOOSMALL 10005
-#define NFSERR_SERVERFAULT 10006
-#define NFSERR_BADTYPE 10007
-#define NFSERR_JUKEBOX 10008
-#define NFSERR_TRYLATER NFSERR_JUKEBOX
-#define NFSERR_STALEWRITEVERF 30001 /* Fake return for nfs_commit() */
-
-#define NFSERR_RETVOID 0x20000000 /* Return void, not error */
-#define NFSERR_AUTHERR 0x40000000 /* Mark an authentication error */
-#define NFSERR_RETERR 0x80000000 /* Mark an error return for V3 */
-
-/* Sizes in bytes of various nfs rpc components */
-#define NFSX_UNSIGNED 4
-
-/* specific to NFS Version 2 */
-#define NFSX_V2FH 32
-#define NFSX_V2FATTR 68
-#define NFSX_V2SATTR 32
-#define NFSX_V2COOKIE 4
-#define NFSX_V2STATFS 20
-
-/* specific to NFS Version 3 */
-#define NFSX_V3FH (sizeof (fhandle_t)) /* size this server uses */
-#define NFSX_V3FHMAX 64 /* max. allowed by protocol */
-#define NFSX_V3FATTR 84
-#define NFSX_V3SATTR 60 /* max. all fields filled in */
-#define NFSX_V3SRVSATTR (sizeof (struct nfsv3_sattr))
-#define NFSX_V3POSTOPATTR (NFSX_V3FATTR + NFSX_UNSIGNED)
-#define NFSX_V3WCCDATA (NFSX_V3POSTOPATTR + 8 * NFSX_UNSIGNED)
-#define NFSX_V3COOKIEVERF 8
-#define NFSX_V3WRITEVERF 8
-#define NFSX_V3CREATEVERF 8
-#define NFSX_V3STATFS 52
-#define NFSX_V3FSINFO 48
-#define NFSX_V3PATHCONF 24
-
-/* variants for both versions */
-#define NFSX_FH(v3) ((v3) ? (NFSX_V3FHMAX + NFSX_UNSIGNED) : \
- NFSX_V2FH)
-#define NFSX_SRVFH(v3) ((v3) ? NFSX_V3FH : NFSX_V2FH)
-#define NFSX_FATTR(v3) ((v3) ? NFSX_V3FATTR : NFSX_V2FATTR)
-#define NFSX_PREOPATTR(v3) ((v3) ? (7 * NFSX_UNSIGNED) : 0)
-#define NFSX_POSTOPATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : 0)
-#define NFSX_POSTOPORFATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : \
- NFSX_V2FATTR)
-#define NFSX_WCCDATA(v3) ((v3) ? NFSX_V3WCCDATA : 0)
-#define NFSX_WCCORFATTR(v3) ((v3) ? NFSX_V3WCCDATA : NFSX_V2FATTR)
-#define NFSX_SATTR(v3) ((v3) ? NFSX_V3SATTR : NFSX_V2SATTR)
-#define NFSX_COOKIEVERF(v3) ((v3) ? NFSX_V3COOKIEVERF : 0)
-#define NFSX_WRITEVERF(v3) ((v3) ? NFSX_V3WRITEVERF : 0)
-#define NFSX_READDIR(v3) ((v3) ? (5 * NFSX_UNSIGNED) : \
- (2 * NFSX_UNSIGNED))
-#define NFSX_STATFS(v3) ((v3) ? NFSX_V3STATFS : NFSX_V2STATFS)
-
-/* nfs rpc procedure numbers (before version mapping) */
-#define NFSPROC_NULL 0
-#define NFSPROC_GETATTR 1
-#define NFSPROC_SETATTR 2
-#define NFSPROC_LOOKUP 3
-#define NFSPROC_ACCESS 4
-#define NFSPROC_READLINK 5
-#define NFSPROC_READ 6
-#define NFSPROC_WRITE 7
-#define NFSPROC_CREATE 8
-#define NFSPROC_MKDIR 9
-#define NFSPROC_SYMLINK 10
-#define NFSPROC_MKNOD 11
-#define NFSPROC_REMOVE 12
-#define NFSPROC_RMDIR 13
-#define NFSPROC_RENAME 14
-#define NFSPROC_LINK 15
-#define NFSPROC_READDIR 16
-#define NFSPROC_READDIRPLUS 17
-#define NFSPROC_FSSTAT 18
-#define NFSPROC_FSINFO 19
-#define NFSPROC_PATHCONF 20
-#define NFSPROC_COMMIT 21
-
-/* And leasing (nqnfs) procedure numbers (must be last) */
-#define NQNFSPROC_GETLEASE 22
-#define NQNFSPROC_VACATED 23
-#define NQNFSPROC_EVICTED 24
-
-#define NFSPROC_NOOP 25
-#define NFS_NPROCS 26
-
-/* Actual Version 2 procedure numbers */
-#define NFSV2PROC_NULL 0
-#define NFSV2PROC_GETATTR 1
-#define NFSV2PROC_SETATTR 2
-#define NFSV2PROC_NOOP 3
-#define NFSV2PROC_ROOT NFSV2PROC_NOOP /* Obsolete */
-#define NFSV2PROC_LOOKUP 4
-#define NFSV2PROC_READLINK 5
-#define NFSV2PROC_READ 6
-#define NFSV2PROC_WRITECACHE NFSV2PROC_NOOP /* Obsolete */
-#define NFSV2PROC_WRITE 8
-#define NFSV2PROC_CREATE 9
-#define NFSV2PROC_REMOVE 10
-#define NFSV2PROC_RENAME 11
-#define NFSV2PROC_LINK 12
-#define NFSV2PROC_SYMLINK 13
-#define NFSV2PROC_MKDIR 14
-#define NFSV2PROC_RMDIR 15
-#define NFSV2PROC_READDIR 16
-#define NFSV2PROC_STATFS 17
-
-/*
- * Constants used by the Version 3 protocol for various RPCs
- */
-#define NFSV3SATTRTIME_DONTCHANGE 0
-#define NFSV3SATTRTIME_TOSERVER 1
-#define NFSV3SATTRTIME_TOCLIENT 2
-
-#define NFSV3ACCESS_READ 0x01
-#define NFSV3ACCESS_LOOKUP 0x02
-#define NFSV3ACCESS_MODIFY 0x04
-#define NFSV3ACCESS_EXTEND 0x08
-#define NFSV3ACCESS_DELETE 0x10
-#define NFSV3ACCESS_EXECUTE 0x20
-
-#define NFSV3WRITE_UNSTABLE 0
-#define NFSV3WRITE_DATASYNC 1
-#define NFSV3WRITE_FILESYNC 2
-
-#define NFSV3CREATE_UNCHECKED 0
-#define NFSV3CREATE_GUARDED 1
-#define NFSV3CREATE_EXCLUSIVE 2
-
-#define NFSV3FSINFO_LINK 0x01
-#define NFSV3FSINFO_SYMLINK 0x02
-#define NFSV3FSINFO_HOMOGENEOUS 0x08
-#define NFSV3FSINFO_CANSETTIME 0x10
-
-/* Conversion macros */
-#define vtonfsv2_mode(t,m) \
- txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \
- MAKEIMODE((t), (m)))
-#define vtonfsv3_mode(m) txdr_unsigned((m) & 07777)
-#define nfstov_mode(a) (fxdr_unsigned(u_short, (a))&07777)
-#define vtonfsv2_type(a) txdr_unsigned(nfsv2_type[((long)(a))])
-#define vtonfsv3_type(a) txdr_unsigned(nfsv3_type[((long)(a))])
-#define nfsv2tov_type(a) nv2tov_type[fxdr_unsigned(u_long,(a))&0x7]
-#define nfsv3tov_type(a) nv3tov_type[fxdr_unsigned(u_long,(a))&0x7]
-
-/* File types */
-typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5,
- NFSOCK=6, NFFIFO=7 } nfstype;
-
-/* Structs for common parts of the rpc's */
-/*
- * File Handle (32 bytes for version 2), variable up to 64 for version 3.
- * File Handles of up to NFS_SMALLFH in size are stored directly in the
- * nfs node, whereas larger ones are malloc'd. (This never happens when
- * NFS_SMALLFH is set to 64.)
- * NFS_SMALLFH should be in the range of 32 to 64 and be divisible by 4.
- */
-#ifndef NFS_SMALLFH
-#define NFS_SMALLFH 64
-#endif
-union nfsfh {
- fhandle_t fh_generic;
- u_char fh_bytes[NFS_SMALLFH];
-};
-typedef union nfsfh nfsfh_t;
-
-struct nfsv2_time {
- u_long nfsv2_sec;
- u_long nfsv2_usec;
-};
-typedef struct nfsv2_time nfstime2;
-
-struct nfsv3_time {
- u_long nfsv3_sec;
- u_long nfsv3_nsec;
-};
-typedef struct nfsv3_time nfstime3;
-
-/*
- * Quads are defined as arrays of 2 longs to ensure dense packing for the
- * protocol and to facilitate xdr conversion.
- */
-struct nfs_uquad {
- u_long nfsuquad[2];
-};
-typedef struct nfs_uquad nfsuint64;
-
-/*
- * Used to convert between two u_longs and a u_quad_t.
- */
-union nfs_quadconvert {
- u_long lval[2];
- u_quad_t qval;
-};
-typedef union nfs_quadconvert nfsquad_t;
-
-/*
- * NFS Version 3 special file number.
- */
-struct nfsv3_spec {
- u_long specdata1;
- u_long specdata2;
-};
-typedef struct nfsv3_spec nfsv3spec;
-
-/*
- * File attributes and setable attributes. These structures cover both
- * NFS version 2 and the version 3 protocol. Note that the union is only
- * used so that one pointer can refer to both variants. These structures
- * go out on the wire and must be densely packed, so no quad data types
- * are used. (all fields are longs or u_longs or structures of same)
- * NB: You can't do sizeof(struct nfs_fattr), you must use the
- * NFSX_FATTR(v3) macro.
- */
-struct nfs_fattr {
- u_long fa_type;
- u_long fa_mode;
- u_long fa_nlink;
- u_long fa_uid;
- u_long fa_gid;
- union {
- struct {
- u_long nfsv2fa_size;
- u_long nfsv2fa_blocksize;
- u_long nfsv2fa_rdev;
- u_long nfsv2fa_blocks;
- u_long nfsv2fa_fsid;
- u_long nfsv2fa_fileid;
- nfstime2 nfsv2fa_atime;
- nfstime2 nfsv2fa_mtime;
- nfstime2 nfsv2fa_ctime;
- } fa_nfsv2;
- struct {
- nfsuint64 nfsv3fa_size;
- nfsuint64 nfsv3fa_used;
- nfsv3spec nfsv3fa_rdev;
- nfsuint64 nfsv3fa_fsid;
- nfsuint64 nfsv3fa_fileid;
- nfstime3 nfsv3fa_atime;
- nfstime3 nfsv3fa_mtime;
- nfstime3 nfsv3fa_ctime;
- } fa_nfsv3;
- } fa_un;
-};
-
-/* and some ugly defines for accessing union components */
-#define fa2_size fa_un.fa_nfsv2.nfsv2fa_size
-#define fa2_blocksize fa_un.fa_nfsv2.nfsv2fa_blocksize
-#define fa2_rdev fa_un.fa_nfsv2.nfsv2fa_rdev
-#define fa2_blocks fa_un.fa_nfsv2.nfsv2fa_blocks
-#define fa2_fsid fa_un.fa_nfsv2.nfsv2fa_fsid
-#define fa2_fileid fa_un.fa_nfsv2.nfsv2fa_fileid
-#define fa2_atime fa_un.fa_nfsv2.nfsv2fa_atime
-#define fa2_mtime fa_un.fa_nfsv2.nfsv2fa_mtime
-#define fa2_ctime fa_un.fa_nfsv2.nfsv2fa_ctime
-#define fa3_size fa_un.fa_nfsv3.nfsv3fa_size
-#define fa3_used fa_un.fa_nfsv3.nfsv3fa_used
-#define fa3_rdev fa_un.fa_nfsv3.nfsv3fa_rdev
-#define fa3_fsid fa_un.fa_nfsv3.nfsv3fa_fsid
-#define fa3_fileid fa_un.fa_nfsv3.nfsv3fa_fileid
-#define fa3_atime fa_un.fa_nfsv3.nfsv3fa_atime
-#define fa3_mtime fa_un.fa_nfsv3.nfsv3fa_mtime
-#define fa3_ctime fa_un.fa_nfsv3.nfsv3fa_ctime
-
-struct nfsv2_sattr {
- u_long sa_mode;
- u_long sa_uid;
- u_long sa_gid;
- u_long sa_size;
- nfstime2 sa_atime;
- nfstime2 sa_mtime;
-};
-
-/*
- * NFS Version 3 sattr structure for the new node creation case.
- */
-struct nfsv3_sattr {
- u_long sa_modetrue;
- u_long sa_mode;
- u_long sa_uidtrue;
- u_long sa_uid;
- u_long sa_gidtrue;
- u_long sa_gid;
- u_long sa_sizefalse;
- u_long sa_atimetype;
- nfstime3 sa_atime;
- u_long sa_mtimetype;
- nfstime3 sa_mtime;
-};
-
-struct nfs_statfs {
- union {
- struct {
- u_long nfsv2sf_tsize;
- u_long nfsv2sf_bsize;
- u_long nfsv2sf_blocks;
- u_long nfsv2sf_bfree;
- u_long nfsv2sf_bavail;
- } sf_nfsv2;
- struct {
- nfsuint64 nfsv3sf_tbytes;
- nfsuint64 nfsv3sf_fbytes;
- nfsuint64 nfsv3sf_abytes;
- nfsuint64 nfsv3sf_tfiles;
- nfsuint64 nfsv3sf_ffiles;
- nfsuint64 nfsv3sf_afiles;
- u_long nfsv3sf_invarsec;
- } sf_nfsv3;
- } sf_un;
-};
-
-#define sf_tsize sf_un.sf_nfsv2.nfsv2sf_tsize
-#define sf_bsize sf_un.sf_nfsv2.nfsv2sf_bsize
-#define sf_blocks sf_un.sf_nfsv2.nfsv2sf_blocks
-#define sf_bfree sf_un.sf_nfsv2.nfsv2sf_bfree
-#define sf_bavail sf_un.sf_nfsv2.nfsv2sf_bavail
-#define sf_tbytes sf_un.sf_nfsv3.nfsv3sf_tbytes
-#define sf_fbytes sf_un.sf_nfsv3.nfsv3sf_fbytes
-#define sf_abytes sf_un.sf_nfsv3.nfsv3sf_abytes
-#define sf_tfiles sf_un.sf_nfsv3.nfsv3sf_tfiles
-#define sf_ffiles sf_un.sf_nfsv3.nfsv3sf_ffiles
-#define sf_afiles sf_un.sf_nfsv3.nfsv3sf_afiles
-#define sf_invarsec sf_un.sf_nfsv3.nfsv3sf_invarsec
-
-struct nfsv3_fsinfo {
- u_long fs_rtmax;
- u_long fs_rtpref;
- u_long fs_rtmult;
- u_long fs_wtmax;
- u_long fs_wtpref;
- u_long fs_wtmult;
- u_long fs_dtpref;
- nfsuint64 fs_maxfilesize;
- nfstime3 fs_timedelta;
- u_long fs_properties;
-};
-
-struct nfsv3_pathconf {
- u_long pc_linkmax;
- u_long pc_namemax;
- u_long pc_notrunc;
- u_long pc_chownrestricted;
- u_long pc_caseinsensitive;
- u_long pc_casepreserving;
-};
-
-#endif
diff --git a/cpukit/libnetworking/nfs/rpcv2.h b/cpukit/libnetworking/nfs/rpcv2.h
deleted file mode 100644
index 5fd6e7febf..0000000000
--- a/cpukit/libnetworking/nfs/rpcv2.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)rpcv2.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_RPCV2_H_
-#define _NFS_RPCV2_H_
-
-/*
- * Definitions for Sun RPC Version 2, from
- * "RPC: Remote Procedure Call Protocol Specification" RFC1057
- */
-
-/* Version # */
-#define RPC_VER2 2
-
-/* Authentication */
-#define RPCAUTH_NULL 0
-#define RPCAUTH_UNIX 1
-#define RPCAUTH_SHORT 2
-#define RPCAUTH_KERB4 4
-#define RPCAUTH_NQNFS 300000
-#define RPCAUTH_MAXSIZ 400
-#define RPCVERF_MAXSIZ 12 /* For Kerb, can actually be 400 */
-#define RPCAUTH_UNIXGIDS 16
-
-/*
- * Constants associated with authentication flavours.
- */
-#define RPCAKN_FULLNAME 0
-#define RPCAKN_NICKNAME 1
-
-/* Rpc Constants */
-#define RPC_CALL 0
-#define RPC_REPLY 1
-#define RPC_MSGACCEPTED 0
-#define RPC_MSGDENIED 1
-#define RPC_PROGUNAVAIL 1
-#define RPC_PROGMISMATCH 2
-#define RPC_PROCUNAVAIL 3
-#define RPC_GARBAGE 4 /* I like this one */
-#define RPC_MISMATCH 0
-#define RPC_AUTHERR 1
-
-/* Authentication failures */
-#define AUTH_BADCRED 1
-#define AUTH_REJECTCRED 2
-#define AUTH_BADVERF 3
-#define AUTH_REJECTVERF 4
-#define AUTH_TOOWEAK 5 /* Give em wheaties */
-
-/* Sizes of rpc header parts */
-#define RPC_SIZ 24
-#define RPC_REPLYSIZ 28
-
-/* RPC Prog definitions */
-#define RPCPROG_MNT 100005
-#define RPCMNT_VER1 1
-#define RPCMNT_VER3 3
-#define RPCMNT_MOUNT 1
-#define RPCMNT_DUMP 2
-#define RPCMNT_UMOUNT 3
-#define RPCMNT_UMNTALL 4
-#define RPCMNT_EXPORT 5
-#define RPCMNT_NAMELEN 255
-#define RPCMNT_PATHLEN 1024
-#define RPCPROG_NFS 100003
-
-/*
- * Structures used for RPCAUTH_KERB4.
- */
-struct nfsrpc_fullverf {
- u_long t1;
- u_long t2;
- u_long w2;
-};
-
-struct nfsrpc_fullblock {
- u_long t1;
- u_long t2;
- u_long w1;
- u_long w2;
-};
-
-struct nfsrpc_nickverf {
- u_long kind;
- struct nfsrpc_fullverf verf;
-};
-
-/*
- * and their sizes in bytes.. If sizeof (struct nfsrpc_xx) != these
- * constants, well then things will break in mount_nfs and nfsd.
- */
-#define RPCX_FULLVERF 12
-#define RPCX_FULLBLOCK 16
-#define RPCX_NICKVERF 16
-
-#ifdef NFSKERB
-XXX
-#else
-typedef u_char NFSKERBKEY_T[2];
-typedef u_char NFSKERBKEYSCHED_T[2];
-#endif
-#define NFS_KERBSRV "rcmd" /* Kerberos Service for NFS */
-#define NFS_KERBTTL (30 * 60) /* Credential ttl (sec) */
-#define NFS_KERBCLOCKSKEW (5 * 60) /* Clock skew (sec) */
-#define NFS_KERBW1(t) (*((u_long *)(&((t).dat[((t).length + 3) & ~0x3]))))
-#endif
diff --git a/cpukit/libnetworking/nfs/xdr_subs.h b/cpukit/libnetworking/nfs/xdr_subs.h
deleted file mode 100644
index 874730378f..0000000000
--- a/cpukit/libnetworking/nfs/xdr_subs.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * 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.
- *
- * @(#)xdr_subs.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _NFS_XDR_SUBS_H_
-#define _NFS_XDR_SUBS_H_
-
-/*
- * Macros used for conversion to/from xdr representation by nfs...
- * These use the MACHINE DEPENDENT routines ntohl, htonl
- * As defined by "XDR: External Data Representation Standard" RFC1014
- *
- * To simplify the implementation, we use ntohl/htonl even on big-endian
- * machines, and count on them being `#define'd away. Some of these
- * might be slightly more efficient as quad_t copies on a big-endian,
- * but we cannot count on their alignment anyway.
- */
-
-#define fxdr_unsigned(t, v) ((t)ntohl((long)(v)))
-#define txdr_unsigned(v) (htonl((long)(v)))
-
-#define fxdr_nfsv2time(f, t) { \
- (t)->tv_sec = ntohl(((struct nfsv2_time *)(f))->nfsv2_sec); \
- if (((struct nfsv2_time *)(f))->nfsv2_usec != 0xffffffff) \
- (t)->tv_nsec = 1000 * ntohl(((struct nfsv2_time *)(f))->nfsv2_usec); \
- else \
- (t)->tv_nsec = 0; \
-}
-#define txdr_nfsv2time(f, t) { \
- ((struct nfsv2_time *)(t))->nfsv2_sec = htonl((f)->tv_sec); \
- if ((f)->tv_nsec != -1) \
- ((struct nfsv2_time *)(t))->nfsv2_usec = htonl((f)->tv_nsec / 1000); \
- else \
- ((struct nfsv2_time *)(t))->nfsv2_usec = 0xffffffff; \
-}
-
-#define fxdr_nfsv3time(f, t) { \
- (t)->tv_sec = ntohl(((struct nfsv3_time *)(f))->nfsv3_sec); \
- (t)->tv_nsec = ntohl(((struct nfsv3_time *)(f))->nfsv3_nsec); \
-}
-#define txdr_nfsv3time(f, t) { \
- ((struct nfsv3_time *)(t))->nfsv3_sec = htonl((f)->tv_sec); \
- ((struct nfsv3_time *)(t))->nfsv3_nsec = htonl((f)->tv_nsec); \
-}
-
-#define fxdr_hyper(f, t) { \
- ((long *)(t))[_QUAD_HIGHWORD] = ntohl(((long *)(f))[0]); \
- ((long *)(t))[_QUAD_LOWWORD] = ntohl(((long *)(f))[1]); \
-}
-#define txdr_hyper(f, t) { \
- ((long *)(t))[0] = htonl(((long *)(f))[_QUAD_HIGHWORD]); \
- ((long *)(t))[1] = htonl(((long *)(f))[_QUAD_LOWWORD]); \
-}
-
-#endif
diff --git a/cpukit/libnetworking/opt_ipfw.h b/cpukit/libnetworking/opt_ipfw.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/cpukit/libnetworking/opt_ipfw.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/cpukit/libnetworking/opt_mrouting.h b/cpukit/libnetworking/opt_mrouting.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/cpukit/libnetworking/opt_mrouting.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/cpukit/libnetworking/opt_tcpdebug.h b/cpukit/libnetworking/opt_tcpdebug.h
deleted file mode 100644
index 5a6ee0337b..0000000000
--- a/cpukit/libnetworking/opt_tcpdebug.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
-
diff --git a/cpukit/libnetworking/poll.h b/cpukit/libnetworking/poll.h
deleted file mode 100644
index 74dfca76c1..0000000000
--- a/cpukit/libnetworking/poll.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*-
- * Copyright (c) 1997 Peter Wemm <peter@freebsd.org>
- * 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. 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 BY THE AUTHOR 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 AUTHOR 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.
- *
- * $Id$
- */
-
-#ifndef _SYS_POLL_H_
-#define _SYS_POLL_H_
-
-/*
- * This file is intended to be compatable with the traditional poll.h.
- */
-
-/*
- * This structure is passed as an array to poll(2).
- */
-struct pollfd {
- int fd; /* which file descriptor to poll */
- short events; /* events we are interested in */
- short revents; /* events found on return */
-};
-
-/*
- * Requestable events. If poll(2) finds any of these set, they are
- * copied to revents on return.
- * XXX Note that FreeBSD doesn't make much distinction between POLLPRI
- * and POLLRDBAND since none of the file types have distinct priority
- * bands - and only some have an urgent "mode".
- * XXX Note POLLIN isn't really supported in true SVSV terms. Under SYSV
- * POLLIN includes all of normal, band and urgent data. Most poll handlers
- * on FreeBSD only treat it as "normal" data.
- */
-#define POLLIN 0x0001 /* any readable data available */
-#define POLLPRI 0x0002 /* OOB/Urgent readable data */
-#define POLLOUT 0x0004 /* file descriptor is writeable */
-#define POLLRDNORM 0x0040 /* non-OOB/URG data available */
-#define POLLWRNORM POLLOUT /* no write type differentiation */
-#define POLLRDBAND 0x0080 /* OOB/Urgent readable data */
-#define POLLWRBAND 0x0100 /* OOB/Urgent data can be written */
-
-/*
- * FreeBSD extensions: polling on a regular file might return one
- * of these events (currently only supported on UFS).
- */
-#define POLLEXTEND 0x0200 /* file may have been extended */
-#define POLLATTRIB 0x0400 /* file attributes may have changed */
-#define POLLNLINK 0x0800 /* (un)link/rename may have happened */
-#define POLLWRITE 0x1000 /* file's contents may have changed */
-
-/*
- * These events are set if they occur regardless of whether they were
- * requested.
- */
-#define POLLERR 0x0008 /* some poll error occurred */
-#define POLLHUP 0x0010 /* file descriptor was "hung up" */
-#define POLLNVAL 0x0020 /* requested events "invalid" */
-
-#define POLLSTANDARD (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|\
- POLLWRBAND|POLLERR|POLLHUP|POLLNVAL)
-
-/*
- * Request that poll() wait forever.
- * XXX in SYSV, this is defined in stropts.h, which is not included
- * by poll.h.
- */
-#define INFTIM (-1)
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-/*
- * XXX logically, poll() should be declared in <poll.h>, but SVR4 at
- * least has it here in <sys/poll.h>.
- * XXX poll() has "unsigned long" nfds on SVR4, not unsigned as on the
- * other BSDs.
- */
-int poll __P((struct pollfd *_pfd, unsigned _nfds, int _timeout));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif /* !_SYS_POLL_H_ */
diff --git a/cpukit/libnetworking/resolv.h b/cpukit/libnetworking/resolv.h
deleted file mode 100644
index 614f204706..0000000000
--- a/cpukit/libnetworking/resolv.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/*-
- * Copyright (c) 1983, 1987, 1989, 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.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * @(#)resolv.h 8.1 (Berkeley) 6/2/93
- * From Id: resolv.h,v 8.12 1998/04/28 19:36:46 halley Exp $
- * $Id$
- */
-
-#ifndef _RESOLV_H_
-#define _RESOLV_H_
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/cdefs.h>
-#include <stdio.h>
-
-/*
- * Revision information. This is the release date in YYYYMMDD format.
- * It can change every day so the right thing to do with it is use it
- * in preprocessor commands such as "#if (__RES > 19931104)". Do not
- * compare for equality; rather, use it to determine whether your resolver
- * is new enough to contain a certain feature.
- */
-
-#define __RES 19960801
-
-/*
- * This used to be defined in res_query.c, now it's in herror.c. It was
- * never extern'd by any *.h file before it was placed here. herror.c is
- * part of libresolv.a even though it might make more sense in libnetdb.a
- * or even libnet.a.
- */
-
-extern int h_errno;
-
-/*
- * Resolver configuration file.
- * Normally not present, but may contain the address of the
- * inital name server(s) to query and the domain search list.
- */
-
-#ifndef _PATH_RESCONF
-#define _PATH_RESCONF "/etc/resolv.conf"
-#endif
-
-/*
- * Global defines and variables for resolver stub.
- */
-#define MAXNS 3 /* max # name servers we'll track */
-#define MAXDFLSRCH 3 /* # default domain levels to try */
-#define MAXDNSRCH 6 /* max # domains in search path */
-#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
-
-#define RES_TIMEOUT 5 /* min. seconds between retries */
-#define MAXRESOLVSORT 10 /* number of net to sort on */
-#define RES_MAXNDOTS 15 /* should reflect bit field size */
-
-struct __res_state {
- int retrans; /* retransmition time interval */
- int retry; /* number of times to retransmit */
- u_long options; /* option flags - see below. */
- int nscount; /* number of name servers */
- struct sockaddr_in
- nsaddr_list[MAXNS]; /* address of name server */
-#define nsaddr nsaddr_list[0] /* for backward compatibility */
- u_short id; /* current message id */
- char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
- char defdname[256]; /* default domain (deprecated) */
- u_long pfcode; /* RES_PRF_ flags - see below. */
- unsigned ndots:4; /* threshold for initial abs. query */
- unsigned nsort:4; /* number of elements in sort_list[] */
- char unused[3];
- struct {
- struct in_addr addr;
- u_int32_t mask;
- } sort_list[MAXRESOLVSORT];
- char pad[72]; /* on an i386 this means 512b total */
-};
-
-/*
- * Resolver options (keep these in synch with res_debug.c, please)
- */
-#define RES_INIT 0x00000001 /* address initialized */
-#define RES_DEBUG 0x00000002 /* print debug messages */
-#define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/
-#define RES_USEVC 0x00000008 /* use virtual circuit */
-#define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */
-#define RES_IGNTC 0x00000020 /* ignore truncation errors */
-#define RES_RECURSE 0x00000040 /* recursion desired */
-#define RES_DEFNAMES 0x00000080 /* use default domain name */
-#define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */
-#define RES_DNSRCH 0x00000200 /* search up local domain tree */
-#define RES_INSECURE1 0x00000400 /* type 1 security disabled */
-#define RES_INSECURE2 0x00000800 /* type 2 security disabled */
-#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
-#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
-#define RES_NOTLDQUERY 0x00004000 /* Don't query TLD names */
-
-#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
-
-/*
- * Resolver "pfcode" values. Used by dig.
- */
-#define RES_PRF_STATS 0x00000001
-#define RES_PRF_UPDATE 0x00000002
-#define RES_PRF_CLASS 0x00000004
-#define RES_PRF_CMD 0x00000008
-#define RES_PRF_QUES 0x00000010
-#define RES_PRF_ANS 0x00000020
-#define RES_PRF_AUTH 0x00000040
-#define RES_PRF_ADD 0x00000080
-#define RES_PRF_HEAD1 0x00000100
-#define RES_PRF_HEAD2 0x00000200
-#define RES_PRF_TTLID 0x00000400
-#define RES_PRF_HEADX 0x00000800
-#define RES_PRF_QUERY 0x00001000
-#define RES_PRF_REPLY 0x00002000
-#define RES_PRF_INIT 0x00004000
-/* 0x00008000 */
-
-typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
- res_sendhookact;
-
-typedef res_sendhookact (*res_send_qhook)__P((struct sockaddr_in * const *ns,
- const u_char **query,
- int *querylen,
- u_char *ans,
- int anssiz,
- int *resplen));
-
-typedef res_sendhookact (*res_send_rhook)__P((const struct sockaddr_in *ns,
- const u_char *query,
- int querylen,
- u_char *ans,
- int anssiz,
- int *resplen));
-
-struct res_sym {
- int number; /* Identifying number, like T_MX */
- char * name; /* Its symbolic name, like "MX" */
- char * humanname; /* Its fun name, like "mail exchanger" */
-};
-
-extern struct __res_state _res;
-extern const struct res_sym __p_class_syms[];
-extern const struct res_sym __p_type_syms[];
-
-/* Private routines shared between libc/net, named, nslookup and others. */
-#define res_hnok __res_hnok
-#define res_ownok __res_ownok
-#define res_mailok __res_mailok
-#define res_dnok __res_dnok
-#define sym_ston __sym_ston
-#define sym_ntos __sym_ntos
-#define sym_ntop __sym_ntop
-#define b64_ntop __b64_ntop
-#define b64_pton __b64_pton
-#define loc_ntoa __loc_ntoa
-#define loc_aton __loc_aton
-#define fp_resstat __fp_resstat
-#define p_query __p_query
-#define dn_skipname __dn_skipname
-#define fp_resstat __fp_resstat
-#define fp_query __fp_query
-#define fp_nquery __fp_nquery
-#define hostalias __hostalias
-#define putlong __putlong
-#define putshort __putshort
-#define p_class __p_class
-#define p_time __p_time
-#define p_type __p_type
-#define p_query __p_query
-#define p_cdnname __p_cdnname
-#define p_section __p_section
-#define p_cdname __p_cdname
-#define p_fqnname __p_fqnname
-#define p_fqname __p_fqname
-#define p_option __p_option
-#define p_secstodate __p_secstodate
-#define dn_count_labels __dn_count_labels
-#define dn_comp __dn_comp
-#define dn_expand __dn_expand
-#define res_init __res_init
-#define res_randomid __res_randomid
-#define res_query __res_query
-#define res_search __res_search
-#define res_querydomain __res_querydomain
-#define res_mkquery __res_mkquery
-#define res_send __res_send
-#define res_isourserver __res_isourserver
-#define res_nameinquery __res_nameinquery
-#define res_queriesmatch __res_queriesmatch
-#define res_close __res_close
-#define res_mkupdate __res_mkupdate
-#define res_mkupdrec __res_mkupdrec
-#define res_freeupdrec __res_freeupdrec
-
-__BEGIN_DECLS
-int res_hnok __P((const char *));
-int res_ownok __P((const char *));
-int res_mailok __P((const char *));
-int res_dnok __P((const char *));
-int sym_ston __P((const struct res_sym *, const char *, int *));
-const char * sym_ntos __P((const struct res_sym *, int, int *));
-const char * sym_ntop __P((const struct res_sym *, int, int *));
-int b64_ntop __P((u_char const *, size_t, char *, size_t));
-int b64_pton __P((char const *, u_char *, size_t));
-int loc_aton __P((const char *, u_char *));
-const char * loc_ntoa __P((const u_char *, char *));
-int dn_skipname __P((const u_char *, const u_char *));
-void fp_resstat __P((struct __res_state *, FILE *));
-void fp_query __P((const u_char *, FILE *));
-void fp_nquery __P((const u_char *, int, FILE *));
-const char * hostalias __P((const char *));
-void putlong __P((u_int32_t, u_char *));
-void putshort __P((u_int16_t, u_char *));
-const char * p_class __P((int));
-const char * p_time __P((u_int32_t));
-const char * p_type __P((int));
-void p_query __P((const u_char *));
-const u_char * p_cdnname __P((const u_char *, const u_char *, int, FILE *));
-const u_char * p_cdname __P((const u_char *, const u_char *, FILE *));
-const u_char * p_fqnname __P((const u_char *, const u_char *,
- int, char *, int));
-const u_char * p_fqname __P((const u_char *, const u_char *, FILE *));
-const char * p_option __P((u_long));
-char * p_secstodate __P((u_long));
-int dn_count_labels __P((const char *));
-int dn_comp __P((const char *, u_char *, int,
- u_char **, u_char **));
-int dn_expand __P((const u_char *, const u_char *, const u_char *,
- char *, int));
-int res_init __P((void));
-u_int res_randomid __P((void));
-int res_query __P((const char *, int, int, u_char *, int));
-int res_search __P((const char *, int, int, u_char *, int));
-int res_querydomain __P((const char *, const char *, int, int,
- u_char *, int));
-int res_mkquery __P((int, const char *, int, int, const u_char *,
- int, const u_char *, u_char *, int));
-int res_send __P((const u_char *, int, u_char *, int));
-int res_isourserver __P((const struct sockaddr_in *));
-int res_nameinquery __P((const char *, int, int,
- const u_char *, const u_char *));
-int res_queriesmatch __P((const u_char *, const u_char *,
- const u_char *, const u_char *));
-void res_close __P((void));
-const char * p_section __P((int, int));
-/* XXX The following depend on the ns_updrec typedef in arpa/nameser.h */
-#ifdef _ARPA_NAMESER_H_
-int res_update __P((ns_updrec *));
-int res_mkupdate __P((ns_updrec *, u_char *, int));
-ns_updrec * res_mkupdrec __P((int, const char *, u_int, u_int, u_long));
-void res_freeupdrec __P((ns_updrec *));
-#endif
-__END_DECLS
-
-#endif /* !_RESOLV_H_ */
diff --git a/cpukit/libnetworking/rtems/issetugid.c b/cpukit/libnetworking/rtems/issetugid.c
deleted file mode 100644
index 3baf0ec88b..0000000000
--- a/cpukit/libnetworking/rtems/issetugid.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Dummy version of BSD routine
- *
- * $Id$
- */
-
-int
-issetugid (void)
-{
- return 0;
-}
diff --git a/cpukit/libnetworking/rtems/rtems_bootp.c b/cpukit/libnetworking/rtems/rtems_bootp.c
deleted file mode 100644
index 47e3db758f..0000000000
--- a/cpukit/libnetworking/rtems/rtems_bootp.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * $Id$
- */
-
-#include <rtems.h>
-#include <rtems/error.h>
-#include <sys/types.h>
-#include <rtems/rtems_bsdnet.h>
-
-/*
- * Perform a BOOTP request
- */
-void
-rtems_bsdnet_do_bootp (void)
-{
- rtems_bsdnet_semaphore_obtain ();
- bootpc_init ();
- rtems_bsdnet_semaphore_release ();
-}
diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet.h b/cpukit/libnetworking/rtems/rtems_bsdnet.h
deleted file mode 100644
index 73ad92fa30..0000000000
--- a/cpukit/libnetworking/rtems/rtems_bsdnet.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef _RTEMS_BSDNET_
-#define _RTEMS_BSDNET_
-
-#include <rtems.h>
-
-/*
- * Values that may be obtained by BOOTP
- */
-extern struct in_addr rtems_bsdnet_bootp_server_address;
-extern char *rtems_bsdnet_bootp_boot_file_name;
-
-/*
- * Manipulate routing tables
- */
-struct sockaddr;
-struct rtentry;
-int rtems_bsdnet_rtrequest (
- int req,
- struct sockaddr *dst,
- struct sockaddr *gateway,
- struct sockaddr *netmask,
- int flags,
- struct rtentry **net_nrt);
-
-/*
- * Diagnostics
- */
-void rtems_bsdnet_show_inet_routes (void);
-void rtems_bsdnet_show_mbuf_stats (void);
-void rtems_bsdnet_show_if_stats (void);
-void rtems_bsdnet_show_ip_stats (void);
-void rtems_bsdnet_show_icmp_stats (void);
-void rtems_bsdnet_show_udp_stats (void);
-void rtems_bsdnet_show_tcp_stats (void);
-
-/*
- * Network configuration
- */
-struct rtems_bsdnet_ifconfig {
- /*
- * These two entries must be supplied for each interface.
- */
- char *name;
- int (*attach)(struct rtems_bsdnet_ifconfig *conf);
-
- /*
- * Link to next interface
- */
- struct rtems_bsdnet_ifconfig *next;
-
- /*
- * The following entries may be obtained
- * from BOOTP or explicitily supplied.
- */
- char *ip_address;
- char *ip_netmask;
- void *hardware_address;
-
- /*
- * The driver assigns defaults values to the following
- * entries if they are not explicitly supplied.
- */
- int ignore_broadcast;
- int mtu;
- int rbuf_count;
- int xbuf_count;
-
- /*
- * For external ethernet controller board the following
- * parameters are needed
- */
- unsigned int port; /* port of the board */
- unsigned int irno; /* irq of the board */
- unsigned int bpar; /* memory of the board */
-
-};
-
-struct rtems_bsdnet_config {
- /*
- * This entry points to the head of the ifconfig chain.
- */
- struct rtems_bsdnet_ifconfig *ifconfig;
-
- /*
- * This entry should be rtems_bsdnet_do_bootp if BOOTP
- * is being used to configure the network, and NULL
- * if BOOTP is not being used.
- */
- void (*bootp)(void);
-
- /*
- * The remaining items can be initialized to 0, in
- * which case the default value will be used.
- */
- rtems_task_priority network_task_priority; /* 100 */
- unsigned long mbuf_bytecount; /* 64 kbytes */
- unsigned long mbuf_cluster_bytecount; /* 128 kbytes */
- char *hostname; /* BOOTP */
- char *domainname; /* BOOTP */
- char *gateway; /* BOOTP */
- char *log_host; /* BOOTP */
- char *name_server[3]; /* BOOTP */
-};
-extern struct rtems_bsdnet_config rtems_bsdnet_config;
-int rtems_bsdnet_initialize_network (void);
-void rtems_bsdnet_do_bootp (void);
-
-#endif /* _RTEMS_BSDNET_ */
diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
deleted file mode 100644
index 559bafd4c5..0000000000
--- a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Declarations to fit FreeBSD to RTEMS.
- *
- *******************************************************************
- * WARNING *
- * This file should *never* be included by any application program *
- *******************************************************************
- *
- * $Id$
- */
-
-#ifndef _RTEMS_BSDNET_INTERNAL_H_
-#define _RTEMS_BSDNET_INTERNAL_H_
-
-typedef unsigned int vm_offset_t;
-typedef long long vm_ooffset_t;
-typedef unsigned int vm_pindex_t;
-typedef unsigned int vm_size_t;
-
-#define _BSD_OFF_T_ rtems_signed32
-#define _BSD_PID_T_ rtems_id
-#define _BSD_VA_LIST_ char *
-
-/* make sure we get the network versions of these */
-#include "../machine/types.h"
-#include "../machine/param.h"
-
-#include <sys/time.h>
-struct itimerval {
- struct timeval it_interval;
- struct timeval it_value;
-};
-struct mdproc {
- int md_flags;
- int *md_regs;
-};
-
-#define USHRT_MAX 65535
-
-/*
- * Other RTEMS/BSD glue
- */
-struct socket;
-extern void soconnsleep (struct socket *so);
-extern void soconnwakeup (struct socket *so);
-#define splnet() 0
-#define splimp() 0
-#define splx(_s) do { (_s) = 0; } while(0)
-
-#define ovbcopy(f,t,n) bcopy(f,t,n)
-#define copyout(f,t,n) (memcpy(t,f,n),0)
-#define copyin(f,t,n) (memcpy(t,f,n),0)
-
-#define random() rtems_bsdnet_random()
-#define panic rtems_panic
-#define suser(a,b) 0
-
-void microtime (struct timeval *tv);
-#define hz rtems_bsdnet_ticks_per_second
-#define tick rtems_bsdnet_microseconds_per_tick
-
-#define SHRT_MAX 65535
-
-#define log rtems_bsdnet_log
-
-/*
- * Since we can't have two sys/types.h files, we'll hack around
- * and copy the contents of the BSD sys/types.h to here....
- */
-#include <sys/cdefs.h>
-
-typedef u_int64_t u_quad_t; /* quads */
-typedef int64_t quad_t;
-typedef quad_t * qaddr_t;
-
-typedef void __sighandler_t __P((int));
-typedef __sighandler_t *sig_t; /* type of pointer to a signal function */
-#define NSIG 32
-struct sigaltstack {
- char *ss_sp; /* signal stack base */
- int ss_size; /* signal stack length */
- int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */
-};
-
-#ifdef KERNEL
-typedef int boolean_t;
-typedef struct vm_page *vm_page_t;
-#endif
-
-#ifndef _POSIX_SOURCE
-/*
- * minor() gives a cookie instead of an index since we don't want to
- * change the meanings of bits 0-15 or waste time and space shifting
- * bits 16-31 for devices that don't use them.
- */
-#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
-#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */
-#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */
-#endif
-
-#include <machine/endian.h>
-
-typedef quad_t rlim_t; /* resource limit */
-typedef u_int32_t fixpt_t; /* fixed point number */
-
-/*
- * Forward structure declarations for function prototypes. We include the
- * common structures that cross subsystem boundaries here; others are mostly
- * used in the same place that the structure is defined.
- */
-struct proc;
-struct pgrp;
-struct ucred;
-struct rusage;
-struct file;
-struct buf;
-struct tty;
-struct uio;
-
-/*
- * Redo kernel memory allocation
- */
-#define malloc rtems_bsdnet_malloc
-#define free rtems_bsdnet_free
-
-#define M_NOWAIT 0x0001
-void *rtems_bsdnet_malloc (unsigned long size, int type, int flags);
-void rtems_bsdnet_free (void *addr, int type);
-
-void rtems_bsdnet_semaphore_obtain (void);
-void rtems_bsdnet_semaphore_release (void);
-void rtems_bsdnet_schednetisr (int n);
-
-unsigned long rtems_bsdnet_seconds_since_boot (void);
-unsigned long rtems_bsdnet_random (void);
-
-rtems_id rtems_bsdnet_newproc (
- char *name,
- int stacksize,
- void (*entry)(void *),
- void *arg
-);
-
-rtems_status_code rtems_bsdnet_event_receive (
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-);
-
-/*
- * Network configuration
- */
-extern int rtems_bsdnet_ticks_per_second;
-extern int rtems_bsdnet_microseconds_per_tick;
-extern struct in_addr rtems_bsdnet_log_host_address;
-extern char *rtems_bsdnet_domain_name;
-extern struct in_addr rtems_bsdnet_nameserver[];
-extern int rtems_bsdnet_nameserver_count;
-
-/*
- * Internal IOCTL command
- */
-#define SIO_RTEMS_SHOW_STATS _IO('i', 250)
-
-/*
- * Some extra prototypes
- */
-int sethostname (char *name, int namelen);
-void domaininit (void *);
-void ifinit (void *);
-void ipintr (void);
-void arpintr (void);
-void bootpc_init(void);
-int socket (int, int, int);
-int ioctl (int, unsigned long, ...);
-
-#endif /* _RTEMS_BSDNET_INTERNAL_H_ */
diff --git a/cpukit/libnetworking/rtems/rtems_glue.c b/cpukit/libnetworking/rtems/rtems_glue.c
deleted file mode 100644
index dd80a13d08..0000000000
--- a/cpukit/libnetworking/rtems/rtems_glue.c
+++ /dev/null
@@ -1,905 +0,0 @@
-/*
- * $Id$
- */
-
-#include <string.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <errno.h>
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/error.h>
-#include <rtems/rtems_bsdnet.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/domain.h>
-#include <sys/mbuf.h>
-#include <sys/socketvar.h>
-#include <sys/socket.h>
-#include <sys/sockio.h>
-#include <sys/callout.h>
-#include <sys/proc.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <vm/vm.h>
-#include <arpa/inet.h>
-
-#include <net/netisr.h>
-#include <net/route.h>
-
-/*
- * Events used by networking routines.
- * Everything will break if the application
- * tries to use these events or if the `sleep'
- * events are equal to any of the NETISR * events.
- */
-#define SBWAIT_EVENT RTEMS_EVENT_24
-#define SOSLEEP_EVENT RTEMS_EVENT_25
-#define NETISR_IP_EVENT (1 << NETISR_IP)
-#define NETISR_ARP_EVENT (1 << NETISR_ARP)
-#define NETISR_EVENTS (NETISR_IP_EVENT|NETISR_ARP_EVENT)
-
-
-/*
- * Memory allocation
- */
-static int nmbuf = (64 * 1024) / MSIZE;
- int nmbclusters = (128 * 1024) / MCLBYTES;
-
-/*
- * Socket buffering parameters
- */
-unsigned long sb_efficiency = 8;
-
-/*
- * Network task synchronization
- */
-static rtems_id networkSemaphore;
-static rtems_id networkDaemonTid;
-static rtems_unsigned32 networkDaemonPriority;
-static void networkDaemon (void *task_argument);
-
-/*
- * Network timing
- */
-int rtems_bsdnet_ticks_per_second;
-int rtems_bsdnet_microseconds_per_tick;
-
-/*
- * Callout processing
- */
-static rtems_interval ticksWhenCalloutsLastChecked;
-static struct callout *callfree, calltodo;
-
-/*
- * FreeBSD variables
- */
-int nfs_diskless_valid;
-
-/*
- * BOOTP values
- */
-struct in_addr rtems_bsdnet_log_host_address;
-struct in_addr rtems_bsdnet_bootp_server_address;
-char *rtems_bsdnet_bootp_boot_file_name;
-char *rtems_bsdnet_domain_name;
-struct in_addr rtems_bsdnet_nameserver[sizeof rtems_bsdnet_config.name_server /
- sizeof rtems_bsdnet_config.name_server[0]];
-int rtems_bsdnet_nameserver_count;
-
-extern rtems_libio_handler_t rtems_bsdnet_io_handler;
-
-/*
- * Perform FreeBSD memory allocation.
- * FIXME: This should be modified to keep memory allocation statistics.
- */
-#undef malloc
-#undef free
-extern void *malloc (size_t);
-extern void free (void *);
-void *
-rtems_bsdnet_malloc (unsigned long size, int type, int flags)
-{
- void *p;
-
- for (;;) {
- p = malloc (size);
- if (p)
- return p;
- if (flags & M_NOWAIT)
- return p;
- /*
- * FIXME: This should be redone as:
- * static volatile int rtems_bsdnet_need_memory;
- *
- * rtems_bsdnet_need_memory = 1;
- * message_queue_receive
- *
- * Then in rtems_bsdnet_freee:
- * free (....);
- * if (rtems_bsdnet_need_memory)
- * rtems_bsdnet_need_memory = 0;
- * message_queue_broadcast
- */
- rtems_task_wake_after (rtems_bsdnet_ticks_per_second);
- }
-}
-
-/*
- * Free FreeBSD memory
- * FIXME: This should be modified to keep memory allocation statistics.
- */
-void
-rtems_bsdnet_free (void *addr, int type)
-{
- free (addr);
-}
-
-/*
- * Do the initializations required by the BSD code
- * FIXME: Maybe we should use a different memory allocation scheme that
- * would let us share space between mbufs and mbuf clusters.
- * For now, we'll just take the easy way out!
- */
-static void
-bsd_init ()
-{
- /*
- * Set up mbuf data strutures
- * Cluster allocation *must* come first -- see comment on kmem_malloc().
- */
- m_clalloc (nmbclusters, M_DONTWAIT);
- mclrefcnt = malloc (nmbclusters);
- if (mclrefcnt == NULL)
- rtems_panic ("No memory for mbuf cluster reference counts.");
- memset (mclrefcnt, '\0', nmbclusters);
- m_mballoc (nmbuf, M_DONTWAIT);
- mbstat.m_mtypes[MT_FREE] = nmbuf;
-
-
- /*
- * Set up domains
- */
- {
- extern struct domain routedomain;
- extern struct domain inetdomain;
-
- routedomain.dom_next = domains;
- domains = &routedomain;
- inetdomain.dom_next = domains;
- domains = &inetdomain;
- domaininit (NULL);
- }
-
- /*
- * Set up interfaces
- */
- ifinit (NULL);
-}
-
-/*
- * Initialize and start network operations
- */
-static void
-rtems_bsdnet_initialize (void)
-{
- rtems_status_code sc;
-
- /*
- * Set the priority of all network tasks
- */
- if (rtems_bsdnet_config.network_task_priority == 0)
- networkDaemonPriority = 100;
- else
- networkDaemonPriority = rtems_bsdnet_config.network_task_priority;
-
- /*
- * Set the memory allocation limits
- */
- if (rtems_bsdnet_config.mbuf_bytecount)
- nmbuf = rtems_bsdnet_config.mbuf_bytecount / MSIZE;
- if (rtems_bsdnet_config.mbuf_cluster_bytecount)
- nmbclusters = rtems_bsdnet_config.mbuf_cluster_bytecount / MCLBYTES;
-
- /*
- * Create the task-synchronization semaphore
- */
- sc = rtems_semaphore_create (rtems_build_name('B', 'S', 'D', 'n'),
- 0,
- RTEMS_FIFO |
- RTEMS_BINARY_SEMAPHORE |
- RTEMS_NO_INHERIT_PRIORITY |
- RTEMS_NO_PRIORITY_CEILING |
- RTEMS_LOCAL,
- 0,
- &networkSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't create network seamphore: `%s'\n", rtems_status_text (sc));
-
- /*
- * Compute clock tick conversion factors
- */
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &rtems_bsdnet_ticks_per_second);
- if (rtems_bsdnet_ticks_per_second <= 0)
- rtems_bsdnet_ticks_per_second = 1;
- rtems_bsdnet_microseconds_per_tick = 1000000 / rtems_bsdnet_ticks_per_second;
-
- /*
- * Ensure that `seconds' is greater than 0
- */
- rtems_task_wake_after (rtems_bsdnet_ticks_per_second);
-
- /*
- * Set up BSD-style sockets
- */
- bsd_init ();
-
- /*
- * Start network daemon
- */
- networkDaemonTid = rtems_bsdnet_newproc ("ntwk", 4096, networkDaemon, NULL);
-
- /*
- * Register as an external I/O handler
- */
- rtems_register_libio_handler (RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET,
- &rtems_bsdnet_io_handler);
-
- /*
- * Let other network tasks begin
- */
- rtems_bsdnet_semaphore_release ();
-}
-
-rtems_id TaskWithSemaphore;
-/*
- * Obtain network mutex
- */
-void
-rtems_bsdnet_semaphore_obtain (void)
-{
- rtems_status_code sc;
-
- sc = rtems_semaphore_obtain (networkSemaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-rtems_task_ident (RTEMS_SELF, 0, &TaskWithSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't obtain network semaphore: `%s'\n", rtems_status_text (sc));
-}
-
-/*
- * Release network mutex
- */
-void
-rtems_bsdnet_semaphore_release (void)
-{
- rtems_status_code sc;
-
-TaskWithSemaphore = 0;
- sc = rtems_semaphore_release (networkSemaphore);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't release network semaphore: `%s'\n", rtems_status_text (sc));
- }
-
-/*
- * Wait for something to happen to a socket buffer
- */
-int
-sbwait(sb)
- struct sockbuf *sb;
-{
- rtems_event_set events;
- rtems_id tid;
- rtems_status_code sc;
-
- /*
- * Soak up any pending events.
- * The sleep/wakeup synchronization in the FreeBSD
- * kernel has no memory.
- */
- rtems_event_receive (SBWAIT_EVENT, RTEMS_EVENT_ANY | RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Set this task as the target of the wakeup operation.
- */
- if (sb->sb_sel.si_pid)
- rtems_panic ("Another task is already sleeping on that socket buffer");
- rtems_task_ident (RTEMS_SELF, 0, &tid);
- sb->sb_sel.si_pid = tid;
-
- /*
- * Mark the socket buffer as waiting.
- */
- sb->sb_flags |= SB_WAIT;
-
- /*
- * Release the network semaphore.
- */
- rtems_bsdnet_semaphore_release ();
-
- /*
- * Wait for the wakeup event.
- */
- sc = rtems_event_receive (SBWAIT_EVENT, RTEMS_EVENT_ANY | RTEMS_WAIT, sb->sb_timeo, &events);
-
- /*
- * Reobtain the network semaphore.
- */
- rtems_bsdnet_semaphore_obtain ();
-
- /*
- * Relinquish ownership of the socket buffer
- */
- sb->sb_flags &= ~SB_WAIT;
- sb->sb_sel.si_pid = 0;
-
- /*
- * Return the status of the wait.
- */
- switch (sc) {
- case RTEMS_SUCCESSFUL: return 0;
- case RTEMS_TIMEOUT: return EWOULDBLOCK;
- default: return ENXIO;
- }
-}
-
-
-/*
- * Wake up the task waiting on a socket buffer.
- */
-void
-sowakeup(so, sb)
- register struct socket *so;
- register struct sockbuf *sb;
-{
- if (sb->sb_flags & SB_WAIT) {
- sb->sb_flags &= ~SB_WAIT;
- rtems_event_send (sb->sb_sel.si_pid, SBWAIT_EVENT);
- }
-}
-
-/*
- * For now, a socket can be used by only one task at a time.
- */
-int
-sb_lock(sb)
- register struct sockbuf *sb;
-{
- rtems_panic ("Socket buffer is already in use.");
- return 0;
-}
-void
-wakeup (void *p)
-{
- rtems_panic ("Wakeup called");
-}
-
-/*
- * Wait for a connection/disconnection event.
- */
-void
-soconnsleep (struct socket *so)
-{
- rtems_event_set events;
- rtems_id tid;
-
- /*
- * Soak up any pending events.
- * The sleep/wakeup synchronization in the FreeBSD
- * kernel has no memory.
- */
- rtems_event_receive (SOSLEEP_EVENT, RTEMS_EVENT_ANY | RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Set this task as the target of the wakeup operation.
- */
- if (so->so_pgid)
- rtems_panic ("Another task is already sleeping on that socket");
- rtems_task_ident (RTEMS_SELF, 0, &tid);
- so->so_pgid = tid;
-
- /*
- * Wait for the wakeup event.
- */
- rtems_bsdnet_event_receive (SOSLEEP_EVENT, RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Relinquish ownership of the socket.
- */
- so->so_pgid = 0;
-}
-
-/*
- * Wake up a task waiting for a connection/disconnection to complete.
- */
-void
-soconnwakeup (struct socket *so)
-{
- if (so->so_pgid)
- rtems_event_send (so->so_pgid, SOSLEEP_EVENT);
-}
-
-/*
- * Send an event to the network daemon.
- * This corresponds to sending a software interrupt in the BSD kernel.
- */
-void
-rtems_bsdnet_schednetisr (int n)
-{
- rtems_event_send (networkDaemonTid, 1 << n);
-}
-
-/*
- * The network daemon
- * This provides a context to run BSD software interrupts
- */
-static void
-networkDaemon (void *task_argument)
-{
- rtems_event_set events;
- rtems_interval now;
- int ticksPassed;
- unsigned32 timeout;
- struct callout *c;
-
- for (;;) {
- c = calltodo.c_next;
- if (c)
- timeout = c->c_time;
- else
- timeout = RTEMS_NO_TIMEOUT;
- rtems_bsdnet_event_receive (NETISR_EVENTS,
- RTEMS_EVENT_ANY | RTEMS_WAIT,
- timeout,
- &events);
- if (events & NETISR_IP_EVENT)
- ipintr ();
- if (events & NETISR_ARP_EVENT)
- arpintr ();
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- ticksPassed = now - ticksWhenCalloutsLastChecked;
- if (ticksPassed != 0) {
- ticksWhenCalloutsLastChecked = now;
-
- c = calltodo.c_next;
- if (c) {
- c->c_time -= ticksPassed;
- while ((c = calltodo.c_next) != NULL && c->c_time <= 0) {
- void *arg;
- void (*func) (void *);
-
- func = c->c_func;
- arg = c->c_arg;
- calltodo.c_next = c->c_next;
- c->c_next = callfree;
- callfree = c;
- (*func)(arg);
- }
- }
- }
- }
-}
-
-/*
- * Structure passed to task-start stub
- */
-struct newtask {
- void (*entry)(void *);
- void *arg;
-};
-
-/*
- * Task-start stub
- */
-static void
-taskEntry (rtems_task_argument arg)
-{
- struct newtask t;
-
- /*
- * Pick up task information and free
- * the memory allocated to pass the
- * information to this task.
- */
- t = *(struct newtask *)arg;
- free ((struct newtask *)arg);
-
- /*
- * Enter the competition for the network semaphore
- */
- rtems_bsdnet_semaphore_obtain ();
-
- /*
- * Enter the task
- */
- (*t.entry)(t.arg);
- rtems_panic ("Network task returned!\n");
-}
-
-/*
- * Start a network task
- */
-rtems_id
-rtems_bsdnet_newproc (char *name, int stacksize, void(*entry)(void *), void *arg)
-{
- struct newtask *t;
- char nm[4];
- rtems_id tid;
- rtems_status_code sc;
-
- strncpy (nm, name, 4);
- sc = rtems_task_create (rtems_build_name(nm[0], nm[1], nm[2], nm[3]),
- networkDaemonPriority,
- stacksize,
- RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
- RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
- &tid);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't create network daemon `%s': `%s'\n", name, rtems_status_text (sc));
-
- /*
- * Set up task arguments
- */
- t = malloc (sizeof *t);
- t->entry = entry;
- t->arg = arg;
-
- /*
- * Start the task
- */
- sc = rtems_task_start (tid, taskEntry, (rtems_task_argument)t);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't start network daemon `%s': `%s'\n", name, rtems_status_text (sc));
-
- /*
- * Let our caller know the i.d. of the new task
- */
- return tid;
-}
-
-rtems_status_code rtems_bsdnet_event_receive (
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out)
-{
- rtems_status_code sc;
-
- rtems_bsdnet_semaphore_release ();
- sc = rtems_event_receive (event_in, option_set, ticks, event_out);
- rtems_bsdnet_semaphore_obtain ();
- return sc;
-}
-
-/*
- * Return time since startup
- */
-void
-microtime (struct timeval *t)
-{
- rtems_interval now;
-
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- t->tv_sec = now / rtems_bsdnet_ticks_per_second;
- t->tv_usec = (now % rtems_bsdnet_ticks_per_second) * rtems_bsdnet_microseconds_per_tick;
-}
-
-unsigned long
-rtems_bsdnet_seconds_since_boot (void)
-{
- rtems_interval now;
-
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- return now / rtems_bsdnet_ticks_per_second;
-}
-
-/*
- * Fake random number generator
- */
-unsigned long
-rtems_bsdnet_random (void)
-{
- rtems_interval now;
-
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
- return (now * 99991);
-}
-
-/*
- * Callout list processing
- */
-void
-timeout(void (*ftn)(void *), void *arg, int ticks)
-{
- register struct callout *new, *p, *t;
-
- if (ticks <= 0)
- ticks = 1;
-
- /* Fill in the next free callout structure. */
- if (callfree == NULL) {
- callfree = malloc (sizeof *callfree);
- if (callfree == NULL)
- rtems_panic ("No memory for timeout table entry");
- callfree->c_next = NULL;
- }
-
- new = callfree;
- callfree = new->c_next;
- new->c_arg = arg;
- new->c_func = ftn;
-
- /*
- * The time for each event is stored as a difference from the time
- * of the previous event on the queue. Walk the queue, correcting
- * the ticks argument for queue entries passed. Correct the ticks
- * value for the queue entry immediately after the insertion point
- * as well. Watch out for negative c_time values; these represent
- * overdue events.
- */
- for (p = &calltodo;
- (t = p->c_next) != NULL && ticks > t->c_time; p = t)
- if (t->c_time > 0)
- ticks -= t->c_time;
- new->c_time = ticks;
- if (t != NULL)
- t->c_time -= ticks;
-
- /* Insert the new entry into the queue. */
- p->c_next = new;
- new->c_next = t;
-}
-
-/*
- * Ticks till specified time
- * FIXME: This version worries only about seconds, but that's good
- * enough for the way the network code uses this routine.
- */
-int
-hzto(struct timeval *tv)
-{
- long diff = tv->tv_sec - rtems_bsdnet_seconds_since_boot();
-
- if (diff <= 0)
- return 1;
- return diff * rtems_bsdnet_ticks_per_second;
-}
-
-/*
- * Kernel debugging
- */
-int rtems_bsdnet_log_priority;
-void
-rtems_bsdnet_log (int priority, const char *fmt, ...)
-{
- va_list args;
-
- if (priority & rtems_bsdnet_log_priority) {
- va_start (args, fmt);
- vprintf (fmt, args);
- va_end (args);
- }
-}
-
-/*
- * Hack alert: kmem_malloc `knows' that its
- * first invocation is to get mbuf clusters!
- */
-int mb_map_full;
-vm_map_t mb_map;
-vm_offset_t
-kmem_malloc (vm_map_t *map, vm_size_t size, boolean_t waitflag)
-{
- void *p;
-
- /*
- * Can't get memory if we're already running.
- */
- if (networkDaemonTid) {
- if (waitflag == M_WAITOK)
- rtems_panic (
-"Network mbuf space can not be enlarged after rtems_bsdnet_initialize() has\n"
-"returned. Enlarge the initial mbuf/cluster size in rtems_bsdnet_config.");
- return 0;
- }
-
-#define ROUNDSIZE 2048
- p = malloc (size+ROUNDSIZE);
- p = (void *)((unsigned long)p & ~(ROUNDSIZE-1));
- if ((p == NULL) && (waitflag == M_WAITOK))
- rtems_panic ("Can't get initial network memory!");
- if (mbutl == NULL)
- mbutl = p;
- return (vm_offset_t)p;
-}
-
-/*
- * IP header checksum routine for processors which don't have an inline version
- */
-u_int
-in_cksum_hdr (const void *ip)
-{
- rtems_unsigned32 sum;
- const rtems_unsigned16 *sp;
- int i;
-
- sum = 0;
- sp = (rtems_unsigned16 *)ip;
- for (i = 0 ; i < 10 ; i++)
- sum += *sp++;
- while (sum > 0xFFFF)
- sum = (sum & 0xffff) + (sum >> 16);
- return ~sum & 0xFFFF;
-}
-
-/*
- * Manipulate routing tables
- */
-int rtems_bsdnet_rtrequest (
- int req,
- struct sockaddr *dst,
- struct sockaddr *gateway,
- struct sockaddr *netmask,
- int flags,
- struct rtentry **net_nrt)
-{
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- error = rtrequest (req, dst, gateway, netmask, flags, net_nrt);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- errno = error;
- return -1;
- }
- return 0;
-}
-
-static void
-rtems_bsdnet_setup (void)
-{
- struct rtems_bsdnet_ifconfig *ifp;
- int s;
- struct ifreq ifreq;
- struct sockaddr_in address;
- struct sockaddr_in netmask;
- struct sockaddr_in broadcast;
- struct sockaddr_in gateway;
- int i;
-
- /*
- * Set local parameters
- */
- if (rtems_bsdnet_config.hostname)
- sethostname (rtems_bsdnet_config.hostname,
- strlen (rtems_bsdnet_config.hostname));
- if (rtems_bsdnet_config.domainname)
- rtems_bsdnet_domain_name =
- strdup (rtems_bsdnet_config.domainname);
- if (rtems_bsdnet_config.log_host)
- rtems_bsdnet_log_host_address.s_addr =
- inet_addr (rtems_bsdnet_config.log_host);
- for (i = 0 ; i < sizeof rtems_bsdnet_config.name_server /
- sizeof rtems_bsdnet_config.name_server[0] ; i++) {
- if (!rtems_bsdnet_config.name_server[i])
- break;
- rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count++].s_addr
- = inet_addr (rtems_bsdnet_config.name_server[i]);
- }
-
- /*
- * Configure interfaces
- */
- s = socket (AF_INET, SOCK_DGRAM, 0);
- if (s < 0)
- rtems_panic ("Can't create initial socket: %s", strerror (errno));
- for (ifp = rtems_bsdnet_config.ifconfig ; ifp ; ifp = ifp->next) {
- if (ifp->ip_address == NULL)
- continue;
-
- /*
- * Get the interface flags
- */
- strcpy (ifreq.ifr_name, ifp->name);
- if (ioctl (s, SIOCGIFFLAGS, &ifreq) < 0)
- rtems_panic ("Can't get %s flags: %s", ifp->name, strerror (errno));
-
- /*
- * Bring interface up
- */
- ifreq.ifr_flags |= IFF_UP;
- if (ioctl (s, SIOCSIFFLAGS, &ifreq) < 0)
- rtems_panic ("Can't bring %s up: %s", ifp->name, strerror (errno));
-
- /*
- * Set interface netmask
- */
- memset (&netmask, '\0', sizeof netmask);
- netmask.sin_len = sizeof netmask;
- netmask.sin_family = AF_INET;
- netmask.sin_addr.s_addr = inet_addr (ifp->ip_netmask);
- memcpy (&ifreq.ifr_addr, &netmask, sizeof netmask);
- if (ioctl (s, SIOCSIFNETMASK, &ifreq) < 0)
- rtems_panic ("Can't set %s netmask: %s", ifp->name, strerror (errno));
-
- /*
- * Set interface address
- */
- memset (&address, '\0', sizeof address);
- address.sin_len = sizeof address;
- address.sin_family = AF_INET;
- address.sin_addr.s_addr = inet_addr (ifp->ip_address);
- memcpy (&ifreq.ifr_addr, &address, sizeof address);
- if (ioctl (s, SIOCSIFADDR, &ifreq) < 0)
- rtems_panic ("Can't set %s address: %s", ifp->name, strerror (errno));
-
- /*
- * Set interface broadcast address
- */
- memset (&broadcast, '\0', sizeof broadcast);
- broadcast.sin_len = sizeof broadcast;
- broadcast.sin_family = AF_INET;
- broadcast.sin_addr.s_addr = address.sin_addr.s_addr | ~netmask.sin_addr.s_addr;
- memcpy (&ifreq.ifr_broadaddr, &broadcast, sizeof broadcast);
- if (ioctl (s, SIOCSIFBRDADDR, &ifreq) < 0)
- rtems_panic ("Can't set %s broadcast address: %s", ifp->name, strerror (errno));
- }
-
- /*
- * We're done with the dummy socket
- */
- close (s);
-
- /*
- * Set default route
- */
- if (rtems_bsdnet_config.gateway) {
- address.sin_addr.s_addr = INADDR_ANY;
- netmask.sin_addr.s_addr = INADDR_ANY;
- memset (&gateway, '\0', sizeof gateway);
- gateway.sin_len = sizeof gateway;
- gateway.sin_family = AF_INET;
- gateway.sin_addr.s_addr = inet_addr (rtems_bsdnet_config.gateway);
- if (rtems_bsdnet_rtrequest (
- RTM_ADD,
- (struct sockaddr *)&address,
- (struct sockaddr *)&gateway,
- (struct sockaddr *)&netmask,
- (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL) < 0)
- rtems_panic ("Can't set default route: %s", strerror (errno));
- }
-}
-
-/*
- * Initialize the network
- */
-int
-rtems_bsdnet_initialize_network (void)
-{
- struct rtems_bsdnet_ifconfig *ifp;
-
- /*
- * Start network tasks.
- * Initialize BSD network data structures.
- */
- rtems_bsdnet_initialize ();
-
- /*
- * Attach interfaces
- */
- for (ifp = rtems_bsdnet_config.ifconfig ; ifp ; ifp = ifp->next) {
- rtems_bsdnet_semaphore_obtain ();
- (ifp->attach)(ifp);
- rtems_bsdnet_semaphore_release ();
- }
-
- /*
- * Bring up the network
- */
- rtems_bsdnet_setup ();
- if (rtems_bsdnet_config.bootp)
- (*rtems_bsdnet_config.bootp)();
- return 0;
-}
diff --git a/cpukit/libnetworking/rtems/rtems_showicmpstat.c b/cpukit/libnetworking/rtems/rtems_showicmpstat.c
deleted file mode 100644
index 1faea2512b..0000000000
--- a/cpukit/libnetworking/rtems/rtems_showicmpstat.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/icmp_var.h>
-
-/*
- * Display ICMP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showicmpstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_icmp_stats (void)
-{
- int i;
- char cbuf[20];
-
- printf ("************ ICMP Statistics ************\n");
- showicmpstat ("Calls to icmp_error()", icmpstat.icps_error);
- showicmpstat ("Errors not sent -- old was icmp", icmpstat.icps_oldicmp);
- for (i = 0 ; i <= ICMP_MAXTYPE ; i++) {
- if (icmpstat.icps_outhist[i]) {
- sprintf (cbuf, "Type %d sent", i);
- showicmpstat (cbuf, icmpstat.icps_outhist[i]);
- }
- }
- showicmpstat ("icmp_code out of range", icmpstat.icps_badcode);
- showicmpstat ("packet < ICMP_MINLEN", icmpstat.icps_tooshort);
- showicmpstat ("bad checksum", icmpstat.icps_checksum);
- showicmpstat ("calculated bound mismatch", icmpstat.icps_badlen);
- showicmpstat ("number of responses", icmpstat.icps_reflect);
- showicmpstat ("b/mcast echo requests dropped", icmpstat.icps_bmcastecho);
- showicmpstat ("b/mcast tstamp requests dropped", icmpstat.icps_bmcasttstamp);
- for (i = 0 ; i <= ICMP_MAXTYPE ; i++) {
- if (icmpstat.icps_inhist[i]) {
- sprintf (cbuf, "Type %d received", i);
- showicmpstat (cbuf, icmpstat.icps_inhist[i]);
- }
- }
-
- printf ("\n");
-}
diff --git a/cpukit/libnetworking/rtems/rtems_showifstat.c b/cpukit/libnetworking/rtems/rtems_showifstat.c
deleted file mode 100644
index 9f9efc5ac2..0000000000
--- a/cpukit/libnetworking/rtems/rtems_showifstat.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <netinet/in.h>
-
-/*
- * Display an address
- */
-static int
-showaddress (char *name, struct sockaddr *a)
-{
- struct sockaddr_in *sa;
-
- if (!a || (a->sa_family != AF_INET))
- return 0;
- printf ("%s:", name);
- sa = (struct sockaddr_in *)a;
- printf ("%-16s", inet_ntoa (sa->sin_addr));
- return 1;
-}
-
-/*
- * Display interface statistics
- */
-void
-rtems_bsdnet_show_if_stats (void)
-{
- struct ifnet *ifp;
- struct ifaddr *ifa;
- unsigned int bit, flags;
- int printed;
-
- printf ("************ INTERFACE STATISTICS ************\n");
- for (ifp = ifnet; ifp; ifp = ifp->if_next) {
- printf ("***** %s%d *****\n", ifp->if_name, ifp->if_unit);
- for (ifa = ifp->if_addrlist ; ifa ; ifa = ifa->ifa_next) {
- printed = showaddress ("Address", ifa->ifa_addr);
- if (ifp->if_flags & IFF_BROADCAST)
- printed |= showaddress ("Broadcast Address", ifa->ifa_broadaddr);
- if (ifp->if_flags & IFF_POINTOPOINT)
- printed |= showaddress ("Destination Address", ifa->ifa_dstaddr);
- printed |= showaddress ("Net mask", ifa->ifa_netmask);
- if (printed)
- printf ("\n");
- }
-
- printf ("Flags:");
- for (bit = 1, flags = ifp->if_flags ; flags ; bit <<= 1) {
- char *cp;
- switch (flags & bit) {
- default: cp = NULL; break;
- case IFF_UP: cp = "Up"; break;
- case IFF_BROADCAST: cp = "Broadcast"; break;
- case IFF_DEBUG: cp = "Debug"; break;
- case IFF_LOOPBACK: cp = "Loopback"; break;
- case IFF_POINTOPOINT: cp = "Point-to-point"; break;
- case IFF_RUNNING: cp = "Running"; break;
- case IFF_NOARP: cp = "No-ARP"; break;
- case IFF_PROMISC: cp = "Promiscuous"; break;
- case IFF_ALLMULTI: cp = "All-multicast"; break;
- case IFF_OACTIVE: cp = "Active"; break;
- case IFF_SIMPLEX: cp = "Simplex"; break;
- case IFF_LINK0: cp = "Link0"; break;
- case IFF_LINK1: cp = "Link1"; break;
- case IFF_LINK2: cp = "Link2"; break;
- case IFF_MULTICAST: cp = "Multicast"; break;
- }
- if (cp) {
- flags &= ~bit;
- printf (" %s", cp);
- }
- }
- printf ("\n");
-
- printf ("Send queue limit:%-4d length:%-4d Dropped:%-8d\n",
- ifp->if_snd.ifq_maxlen,
- ifp->if_snd.ifq_len,
- ifp->if_snd.ifq_drops);
-
- /*
- * FIXME: Could print if_data statistics here,
- * but right now the drivers maintain their
- * own statistics.
- */
-
- /*
- * Grab the network semaphore.
- * In most cases this is not necessary, but it's
- * easier to always call the driver ioctl function
- * while holding the semaphore than to try
- * and explain why some ioctl commands are invoked
- * while holding the semaphore and others are
- * invoked while not holding the semaphore.
- */
- rtems_bsdnet_semaphore_obtain ();
- (*ifp->if_ioctl)(ifp, SIO_RTEMS_SHOW_STATS, NULL);
- rtems_bsdnet_semaphore_release ();
- }
- printf ("\n");
-}
diff --git a/cpukit/libnetworking/rtems/rtems_showipstat.c b/cpukit/libnetworking/rtems/rtems_showipstat.c
deleted file mode 100644
index 2dd499a8c0..0000000000
--- a/cpukit/libnetworking/rtems/rtems_showipstat.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-
-/*
- * Display IP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showipstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_ip_stats (void)
-{
- printf ("************ IP Statistics ************\n");
- showipstat ("total packets received", ipstat.ips_total);
- showipstat ("checksum bad", ipstat.ips_badsum);
- showipstat ("packet too short", ipstat.ips_tooshort);
- showipstat ("not enough data", ipstat.ips_toosmall);
- showipstat ("ip header length < data size", ipstat.ips_badhlen);
- showipstat ("ip length < ip header length", ipstat.ips_badlen);
- showipstat ("fragments received", ipstat.ips_fragments);
- showipstat ("frags dropped (dups, out of space)", ipstat.ips_fragdropped);
- showipstat ("fragments timed out", ipstat.ips_fragtimeout);
- showipstat ("packets forwarded", ipstat.ips_forward);
- showipstat ("packets rcvd for unreachable dest", ipstat.ips_cantforward);
- showipstat ("packets forwarded on same net", ipstat.ips_redirectsent);
- showipstat ("unknown or unsupported protocol", ipstat.ips_noproto);
- showipstat ("datagrams delivered to upper level", ipstat.ips_delivered);
- showipstat ("total ip packets generated here", ipstat.ips_localout);
- showipstat ("lost packets due to nobufs, etc.", ipstat.ips_odropped);
- showipstat ("total packets reassembled ok", ipstat.ips_reassembled);
- showipstat ("datagrams successfully fragmented", ipstat.ips_fragmented);
- showipstat ("output fragments created", ipstat.ips_ofragments);
- showipstat ("don't fragment flag was set, etc.", ipstat.ips_cantfrag);
- showipstat ("error in option processing", ipstat.ips_badoptions);
- showipstat ("packets discarded due to no route", ipstat.ips_noroute);
- showipstat ("ip version != 4", ipstat.ips_badvers);
- showipstat ("total raw ip packets generated", ipstat.ips_rawout);
- showipstat ("ip length > max ip packet size", ipstat.ips_toolong);
- printf ("\n");
-}
diff --git a/cpukit/libnetworking/rtems/rtems_showmbuf.c b/cpukit/libnetworking/rtems/rtems_showmbuf.c
deleted file mode 100644
index 39523bd00a..0000000000
--- a/cpukit/libnetworking/rtems/rtems_showmbuf.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-
-/*
- * Display MBUF statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-void
-rtems_bsdnet_show_mbuf_stats (void)
-{
- int i;
- int printed = 0;
- char *cp;
-
- printf ("************ MBUF STATISTICS ************\n");
- printf ("mbufs:%4lu clusters:%4lu free:%4lu\n",
- mbstat.m_mbufs, mbstat.m_clusters, mbstat.m_clfree);
- printf ("drops:%4lu waits:%4lu drains:%4lu\n",
- mbstat.m_drops, mbstat.m_wait, mbstat.m_drain);
- for (i = 0 ; i < 20 ; i++) {
- switch (i) {
- case MT_FREE: cp = "free"; break;
- case MT_DATA: cp = "data"; break;
- case MT_HEADER: cp = "header"; break;
- case MT_SOCKET: cp = "socket"; break;
- case MT_PCB: cp = "pcb"; break;
- case MT_RTABLE: cp = "rtable"; break;
- case MT_HTABLE: cp = "htable"; break;
- case MT_ATABLE: cp = "atable"; break;
- case MT_SONAME: cp = "soname"; break;
- case MT_SOOPTS: cp = "soopts"; break;
- case MT_FTABLE: cp = "ftable"; break;
- case MT_RIGHTS: cp = "rights"; break;
- case MT_IFADDR: cp = "ifaddr"; break;
- case MT_CONTROL: cp = "control"; break;
- case MT_OOBDATA: cp = "oobdata"; break;
- default: cp = NULL; break;
- }
- if ((cp != NULL) || (mbstat.m_mtypes[i] != 0)) {
- char cbuf[16];
- if (cp == NULL) {
- sprintf (cbuf, "Type %d", i);
- cp = cbuf;
- }
- printf ("%10s:%-8u", cp, mbstat.m_mtypes[i]);
- if (++printed == 4) {
- printf ("\n");
- printed = 0;
- }
- }
- }
- if (printed)
- printf ("\n");
- printf ("\n");
-}
diff --git a/cpukit/libnetworking/rtems/rtems_showroute.c b/cpukit/libnetworking/rtems/rtems_showroute.c
deleted file mode 100644
index b8196de8d3..0000000000
--- a/cpukit/libnetworking/rtems/rtems_showroute.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * $Id$
- */
-
-#include <stdlib.h>
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/domain.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-
-#include <arpa/inet.h>
-
-/*
- * We'll use the application versions of malloc and free.
- */
-#undef malloc
-#undef free
-
-/*
- * Information per route
- */
-struct rinfo {
- struct sockaddr dst;
- union {
- struct sockaddr sa;
- struct sockaddr_in sin;
- struct sockaddr_dl sdl;
- } un;
- unsigned long pksent;
- unsigned long expire;
- int flags;
- char ifname[16];
- short ifunit;
- short refcnt;
-};
-
-/*
- * Information per display
- */
-struct dinfo {
- int capacity;
- int count;
- struct rinfo *routes;
-};
-
-/*
- * Copy address
- */
-static void
-copyAddress (void *to, void *from, int tolen)
-{
- int ncopy;
- struct sockaddr dummy;
-
- if (from == NULL) {
- /*
- * Create a fake address of unspecified type
- */
- from = &dummy;
- dummy.sa_len = 4;
- dummy.sa_family = AF_UNSPEC;
- }
- ncopy = ((struct sockaddr *)from)->sa_len;
- if (ncopy > tolen)
- ncopy = tolen;
- memcpy (to, from, ncopy);
-}
-
-/*
- * Package everything up before printing it.
- * We don't want to block all network operations till
- * the printing completes!
- */
-static int
-show_inet_route (rn, vw)
- struct radix_node *rn;
- void *vw;
-{
- struct rtentry *rt = (struct rtentry *)rn;
- struct ifnet *ifp;
- struct dinfo *dp = (struct dinfo *)vw;
- struct rinfo *r;
-
- /*
- * Get a pointer to a new route info structure
- */
- if (dp->count >= dp->capacity) {
- r = realloc (dp->routes, (sizeof *r) * (dp->capacity + 20));
- if (r == 0)
- return ENOMEM;
- dp->capacity += 20;
- dp->routes = r;
- }
- r = dp->routes + dp->count++;
-
- /*
- * Fill in the route info structure
- */
- copyAddress (&r->dst, rt_key(rt), sizeof r->dst);
- if (rt->rt_flags & (RTF_GATEWAY | RTF_HOST)) {
- copyAddress (&r->un, rt->rt_gateway, sizeof r->un);
- }
- else {
- /*
- * Create a fake address to hold the mask
- */
- struct sockaddr_in dummy;
-
- dummy.sin_family = AF_INET;
- dummy.sin_len = sizeof dummy;
- dummy.sin_addr = ((struct sockaddr_in *)rt_mask(rt))->sin_addr;
- copyAddress (&r->un, &dummy, sizeof r->un);
- }
- r->flags = rt->rt_flags;
- r->refcnt = rt->rt_refcnt;
- r->pksent = rt->rt_rmx.rmx_pksent;
- r->expire = rt->rt_rmx.rmx_expire;
- ifp = rt->rt_ifp;
- strncpy (r->ifname, ifp->if_name, sizeof r->ifname);
- r->ifunit = ifp->if_unit;
- return 0;
-}
-
-/*
- * Convert link address to ASCII
- */
-static char *
-link_ascii (struct sockaddr_dl *sdl, char *buf, int bufsize)
-{
- char *cp;
- int i;
- int first = 1;
- int nleft = sdl->sdl_alen;
- unsigned char *ap = LLADDR (sdl);
- static const char hextab[16] = "0123456789ABCDEF";
-
- cp = buf;
- while (nleft && (bufsize > 4)) {
- if (first) {
- first = 0;
- }
- else {
- *cp++ = ':';
- bufsize--;
- }
- i = *ap++;
- *cp++ = hextab[(i >> 4) & 0xf];
- *cp++ = hextab[i & 0xf];
- nleft--;
- bufsize -= 2;
- }
- *cp = '\0';
- return buf;
-}
-
-void
-rtems_bsdnet_show_inet_routes (void)
-{
- struct radix_node_head *rnh;
- struct dinfo d;
- struct rinfo *r;
- int i, error;
-
- /*
- * For now we'll handle only AF_INET
- */
- rnh = rt_tables[AF_INET];
- if (!rnh)
- return;
- d.count = d.capacity = 0;
- d.routes = NULL;
- rtems_bsdnet_semaphore_obtain ();
- error = rnh->rnh_walktree(rnh, show_inet_route, &d);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- printf ("Can't get route info: %s\n", strerror (error));
- return;
- }
- if (d.count == 0) {
- printf ("No routes!\n");
- return;
- }
- printf ("Destination Gateway/Mask/Hw Flags Refs Use Expire Interface\n");
- for (i = 0, r = d.routes ; i < d.count ; i++, r++) {
- char buf[30];
- char *cp, *fc, flagbuf[10];
- const char *addr;
- unsigned long flagbit;
- struct sockaddr_in *sin;
-
- sin = (struct sockaddr_in *)&r->dst;
- if (sin->sin_addr.s_addr == INADDR_ANY)
- addr = "default";
- else
- addr = inet_ntop (AF_INET, &sin->sin_addr, buf, sizeof buf);
- printf ("%-16s", addr);
- switch (r->un.sa.sa_family) {
- case AF_INET:
- addr = inet_ntop (AF_INET, &r->un.sin.sin_addr, buf, sizeof buf);
- break;
-
- case AF_LINK:
- addr = link_ascii (&r->un.sdl, buf, sizeof buf);
- break;
-
- default:
- addr = "";
- break;
- }
- printf ("%-19s", addr);
- fc = "UGHRDM XLS";
- for (flagbit = 0x1, cp = flagbuf ; *fc ; flagbit <<= 1, fc++) {
- if ((r->flags & flagbit) && (*fc != ' '))
- *cp++ = *fc;
- }
- *cp = '\0';
- printf ("%-10s%3d%9ld%7ld %.*s%d\n", flagbuf,
- r->refcnt, r->pksent,
- r->expire,
- (int)sizeof r->ifname, r->ifname,
- r->ifunit);
- }
- free (d.routes);
-}
diff --git a/cpukit/libnetworking/rtems/rtems_showtcpstat.c b/cpukit/libnetworking/rtems/rtems_showtcpstat.c
deleted file mode 100644
index b9a0366819..0000000000
--- a/cpukit/libnetworking/rtems/rtems_showtcpstat.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_var.h>
-
-/*
- * Display TCP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showtcpstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_tcp_stats (void)
-{
- printf ("************ TCP Statistics ************\n");
- showtcpstat ("connections initiated", tcpstat.tcps_connattempt);
- showtcpstat ("connections accepted", tcpstat.tcps_accepts);
- showtcpstat ("connections established", tcpstat.tcps_connects);
- showtcpstat ("connections dropped", tcpstat.tcps_drops);
- showtcpstat ("embryonic connections dropped", tcpstat.tcps_conndrops);
- showtcpstat ("conn. closed (includes drops)", tcpstat.tcps_closed);
- showtcpstat ("segs where we tried to get rtt", tcpstat.tcps_segstimed);
- showtcpstat ("times we succeeded", tcpstat.tcps_rttupdated);
- showtcpstat ("delayed acks sent", tcpstat.tcps_delack);
- showtcpstat ("conn. dropped in rxmt timeout", tcpstat.tcps_timeoutdrop);
- showtcpstat ("retransmit timeouts", tcpstat.tcps_rexmttimeo);
- showtcpstat ("persist timeouts", tcpstat.tcps_persisttimeo);
- showtcpstat ("keepalive timeouts", tcpstat.tcps_keeptimeo);
- showtcpstat ("keepalive probes sent", tcpstat.tcps_keepprobe);
- showtcpstat ("connections dropped in keepalive", tcpstat.tcps_keepdrops);
-
- showtcpstat ("total packets sent", tcpstat.tcps_sndtotal);
- showtcpstat ("data packets sent", tcpstat.tcps_sndpack);
- showtcpstat ("data bytes sent", tcpstat.tcps_sndbyte);
- showtcpstat ("data packets retransmitted", tcpstat.tcps_sndrexmitpack);
- showtcpstat ("data bytes retransmitted", tcpstat.tcps_sndrexmitbyte);
- showtcpstat ("ack-only packets sent", tcpstat.tcps_sndacks);
- showtcpstat ("window probes sent", tcpstat.tcps_sndprobe);
- showtcpstat ("packets sent with URG only", tcpstat.tcps_sndurg);
- showtcpstat ("window update-only packets sent", tcpstat.tcps_sndwinup);
- showtcpstat ("control (SYN|FIN|RST) packets sent", tcpstat.tcps_sndctrl);
-
- showtcpstat ("total packets received", tcpstat.tcps_rcvtotal);
- showtcpstat ("packets received in sequence", tcpstat.tcps_rcvpack);
- showtcpstat ("bytes received in sequence", tcpstat.tcps_rcvbyte);
- showtcpstat ("packets received with ccksum errs", tcpstat.tcps_rcvbadsum);
- showtcpstat ("packets received with bad offset", tcpstat.tcps_rcvbadoff);
- showtcpstat ("packets received too short", tcpstat.tcps_rcvshort);
- showtcpstat ("duplicate-only packets received", tcpstat.tcps_rcvduppack);
- showtcpstat ("duplicate-only bytes received", tcpstat.tcps_rcvdupbyte);
- showtcpstat ("packets with some duplicate data", tcpstat.tcps_rcvpartduppack);
- showtcpstat ("dup. bytes in part-dup. packets", tcpstat.tcps_rcvpartdupbyte);
- showtcpstat ("out-of-order packets received", tcpstat.tcps_rcvoopack);
- showtcpstat ("out-of-order bytes received", tcpstat.tcps_rcvoobyte);
- showtcpstat ("packets with data after window", tcpstat.tcps_rcvpackafterwin);
- showtcpstat ("bytes rcvd after window", tcpstat.tcps_rcvbyteafterwin);
- showtcpstat ("packets rcvd after \"close\"", tcpstat.tcps_rcvafterclose);
- showtcpstat ("rcvd window probe packets", tcpstat.tcps_rcvwinprobe);
- showtcpstat ("rcvd duplicate acks", tcpstat.tcps_rcvdupack);
- showtcpstat ("rcvd acks for unsent data", tcpstat.tcps_rcvacktoomuch);
- showtcpstat ("rcvd ack packets", tcpstat.tcps_rcvackpack);
- showtcpstat ("bytes acked by rcvd acks", tcpstat.tcps_rcvackbyte);
- showtcpstat ("rcvd window update packets", tcpstat.tcps_rcvwinupd);
- showtcpstat ("segments dropped due to PAWS", tcpstat.tcps_pawsdrop);
- showtcpstat ("times hdr predict ok for acks", tcpstat.tcps_predack);
- showtcpstat ("times hdr predict ok for data pkts", tcpstat.tcps_preddat);
- showtcpstat ("pcb cache misses", tcpstat.tcps_pcbcachemiss);
- showtcpstat ("times cached RTT in route updated", tcpstat.tcps_cachedrtt);
- showtcpstat ("times cached rttvar updated", tcpstat.tcps_cachedrttvar);
- showtcpstat ("times cached ssthresh updated", tcpstat.tcps_cachedssthresh);
- showtcpstat ("times RTT initialized from route", tcpstat.tcps_usedrtt);
- showtcpstat ("times RTTVAR initialized from rt", tcpstat.tcps_usedrttvar);
- showtcpstat ("times ssthresh initialized from rt", tcpstat.tcps_usedssthresh);
- showtcpstat ("timeout in persist state", tcpstat.tcps_persistdrop);
- showtcpstat ("bogus SYN, e.g. premature ACK", tcpstat.tcps_badsyn);
- showtcpstat ("resends due to MTU discovery", tcpstat.tcps_mturesent);
- showtcpstat ("listen queue overflows", tcpstat.tcps_listendrop);
- printf ("\n");
-}
diff --git a/cpukit/libnetworking/rtems/rtems_showudpstat.c b/cpukit/libnetworking/rtems/rtems_showudpstat.c
deleted file mode 100644
index 1fc2d15a0b..0000000000
--- a/cpukit/libnetworking/rtems/rtems_showudpstat.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-
-/*
- * Display UDP statistics
- * Don't lock the rest of the network tasks out while printing.
- * It's no big deal if the values change while being printed.
- */
-static void
-showudpstat (const char *name, unsigned long n)
-{
- if (n)
- printf ("%35s%12lu\n", name, n);
-}
-
-void
-rtems_bsdnet_show_udp_stats (void)
-{
- printf ("************ UDP Statistics ************\n");
- showudpstat ("total input packets", udpstat.udps_ipackets);
- showudpstat ("packet shorter than header", udpstat.udps_hdrops);
- showudpstat ("checksum error", udpstat.udps_badsum);
- showudpstat ("data length larger than packet", udpstat.udps_badlen);
- showudpstat ("no socket on port", udpstat.udps_noport);
- showudpstat ("of above, arrived as broadcast", udpstat.udps_noportbcast);
- showudpstat ("not delivered, input socket full", udpstat.udps_fullsock);
- showudpstat ("input packets missing pcb cache", udpstat.udpps_pcbcachemiss);
- showudpstat ("input packets not for hashed pcb", udpstat.udpps_pcbhashmiss);
- showudpstat ("total output packets", udpstat.udps_opackets);
- printf ("\n");
-}
diff --git a/cpukit/libnetworking/rtems/rtems_syscall.c b/cpukit/libnetworking/rtems/rtems_syscall.c
deleted file mode 100644
index 782a2f907b..0000000000
--- a/cpukit/libnetworking/rtems/rtems_syscall.c
+++ /dev/null
@@ -1,761 +0,0 @@
-/*
- * $Id$
- */
-
-#include <string.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/error.h>
-#include <rtems/rtems_bsdnet.h>
-
-#include <sys/errno.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/proc.h>
-#include <sys/filio.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-/*
- *********************************************************************
- * Map RTEMS file descriptor to BSD socket *
- *********************************************************************
- */
-struct fdsock {
- int indexFreeNext;
- struct socket *sock;
-};
-static struct fdsock *fdsock;
-static int fdsockCount;
-static int indexFreeHead = -1;
-
-/*
- * Convert an RTEMS file descriptor to a BSD socket pointer.
- */
-static struct socket *
-fdToSocket (int fd)
-{
- int i;
- struct socket *s;
-
- if ((fd < 0)
- || (rtems_file_descriptor_type(fd) != RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET)
- || ((i = rtems_file_descriptor_base(fd)) >= fdsockCount)
- || ((s = fdsock[i].sock) == NULL)) {
- errno = EBADF;
- return NULL;
- }
- return s;
-}
-
-/*
- * Enlarge the size of the file-descritor/socket pointer map.
- */
-static int
-enlargeFdMap (void)
-{
- struct fdsock *nfdsock;
- int i;
-
- nfdsock = realloc (fdsock, sizeof *fdsock * (fdsockCount + 20));
- if (nfdsock == NULL) {
- errno = ENFILE;
- return 0;
- }
- fdsock = nfdsock;
- for (i = fdsockCount, fdsockCount += 20 ; i < fdsockCount ; i++) {
- fdsock[i].sock = NULL;
- fdsock[i].indexFreeNext = indexFreeHead;
- indexFreeHead = i;
- }
- return 1;
-}
-
-/*
- * Create a file descriptor for a new socket
- */
-static int
-makeFd (struct socket *s)
-{
- int i;
-
- if ((indexFreeHead < 0) && !enlargeFdMap ())
- return -1;
- i = indexFreeHead;
- indexFreeHead = fdsock[i].indexFreeNext;
- fdsock[i].sock = s;
- return rtems_make_file_descriptor(i,RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET);
-}
-
-/*
- * Package system call argument into mbuf.
- */
-static int
-sockargstombuf (struct mbuf **mp, const void *buf, int buflen, int type)
-{
- struct mbuf *m;
-
- if ((u_int)buflen > MLEN)
- return (EINVAL);
- m = m_get(M_WAIT, type);
- if (m == NULL)
- return (ENOBUFS);
- m->m_len = buflen;
- memcpy (mtod(m, caddr_t), buf, buflen);
- *mp = m;
- if (type == MT_SONAME) {
- struct sockaddr *sa;
- sa = mtod(m, struct sockaddr *);
- sa->sa_len = buflen;
- }
- return 0;
-}
-
-/*
- *********************************************************************
- * BSD-style entry points *
- *********************************************************************
- */
-int
-socket (int domain, int type, int protocol)
-{
- int fd = -1;
- int error;
- struct socket *so;
-
- rtems_bsdnet_semaphore_obtain ();
- error = socreate(domain, &so, type, protocol, NULL);
- if (error == 0) {
- fd = makeFd (so);
- if (fd < 0)
- soclose (so);
- }
- else {
- errno = error;
- fd = -1;
- }
- rtems_bsdnet_semaphore_release ();
- return fd;
-}
-
-int
-bind (int s, struct sockaddr *name, int namelen)
-{
- int error;
- int ret = -1;
- struct socket *so;
- struct mbuf *nam;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) != NULL) {
- error = sockargstombuf (&nam, name, namelen, MT_SONAME);
- if (error == 0) {
- error = sobind (so, nam);
- if (error == 0)
- ret = 0;
- else
- errno = error;
- m_freem (nam);
- }
- else {
- errno = error;
- }
- }
- rtems_bsdnet_semaphore_release ();
- return ret;
-}
-
-int
-connect (int s, struct sockaddr *name, int namelen)
-{
- int error;
- int ret = -1;
- struct socket *so;
- struct mbuf *nam;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((so->so_state & SS_NBIO) && (so->so_state & SS_ISCONNECTING)) {
- errno = EALREADY;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- error = sockargstombuf (&nam, name, namelen, MT_SONAME);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- error = soconnect (so, nam);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((so->so_state & SS_NBIO) && (so->so_state & SS_ISCONNECTING)) {
- m_freem(nam);
- errno = EINPROGRESS;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) {
- soconnsleep (so);
- }
- if (error == 0) {
- error = so->so_error;
- so->so_error = 0;
- }
- so->so_state &= ~SS_ISCONNECTING;
- m_freem (nam);
- if (error == 0)
- ret = 0;
- rtems_bsdnet_semaphore_release ();
- return ret;
-}
-
-int
-listen (int s, int backlog)
-{
- int error;
- int ret = -1;
- struct socket *so;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) != NULL) {
- error = solisten (so, backlog);
- if (error == 0)
- ret = 0;
- else
- errno = error;
- }
- rtems_bsdnet_semaphore_release ();
- return ret;
-}
-
-int
-accept (int s, struct sockaddr *name, int *namelen)
-{
- int fd;
- struct socket *head, *so;
- struct mbuf *nam;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((head = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((head->so_options & SO_ACCEPTCONN) == 0) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if ((head->so_state & SS_NBIO) && head->so_comp.tqh_first == NULL) {
- errno = EWOULDBLOCK;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- while (head->so_comp.tqh_first == NULL && head->so_error == 0) {
- if (head->so_state & SS_CANTRCVMORE) {
- head->so_error = ECONNABORTED;
- break;
- }
- soconnsleep (head);
- }
- if (head->so_error) {
- errno = head->so_error;
- head->so_error = 0;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
-
- so = head->so_comp.tqh_first;
- TAILQ_REMOVE(&head->so_comp, so, so_list);
- head->so_qlen--;
-
- fd = makeFd (so);
- if (fd < 0) {
- TAILQ_INSERT_HEAD(&head->so_comp, so, so_list);
- head->so_qlen++;
- soconnwakeup (head);
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- so->so_state &= ~SS_COMP;
- so->so_head = NULL;
-
- nam = m_get(M_WAIT, MT_SONAME);
- (void) soaccept(so, nam);
- if (name) {
- /* check length before it is destroyed */
- if (*namelen > nam->m_len)
- *namelen = nam->m_len;
- memcpy (name, mtod(nam, caddr_t), *namelen);
- }
- m_freem(nam);
- rtems_bsdnet_semaphore_release ();
- return (fd);
-
-}
-
-/*
- * All `transmit' operations end up calling this routine.
- */
-ssize_t
-sendmsg (int s, const struct msghdr *mp, int flags)
-{
- int ret = -1;
- int error;
- struct uio auio;
- struct iovec *iov;
- struct socket *so;
- struct mbuf *to, *control;
- int i;
- int len;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- auio.uio_iov = mp->msg_iov;
- auio.uio_iovcnt = mp->msg_iovlen;
- auio.uio_segflg = UIO_USERSPACE;
- auio.uio_rw = UIO_WRITE;
- auio.uio_offset = 0;
- auio.uio_resid = 0;
- iov = mp->msg_iov;
- for (i = 0; i < mp->msg_iovlen; i++, iov++) {
- if ((auio.uio_resid += iov->iov_len) < 0) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- if (mp->msg_name) {
- error = sockargstombuf (&to, mp->msg_name, mp->msg_namelen, MT_SONAME);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- else {
- to = NULL;
- }
- if (mp->msg_control) {
- if (mp->msg_controllen < sizeof (struct cmsghdr)) {
- errno = EINVAL;
- if (to)
- m_freem(to);
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- sockargstombuf (&control, mp->msg_control, mp->msg_controllen, MT_CONTROL);
- }
- else {
- control = NULL;
- }
- len = auio.uio_resid;
- error = sosend (so, to, &auio, (struct mbuf *)0, control, flags);
- if (error) {
- if (auio.uio_resid != len && (error == EINTR || error == EWOULDBLOCK))
- error = 0;
- }
- if (error)
- errno = error;
- else
- ret = len - auio.uio_resid;
- if (to)
- m_freem(to);
- rtems_bsdnet_semaphore_release ();
- return (ret);
-}
-
-/*
- * Send a message to a host
- */
-ssize_t
-sendto (int s, const void *buf, size_t buflen, int flags, const struct sockaddr *to, int tolen)
-{
- struct msghdr msg;
- struct iovec iov;
-
- iov.iov_base = (void *)buf;
- iov.iov_len = buflen;
- msg.msg_name = (caddr_t)to;
- msg.msg_namelen = tolen;
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
- msg.msg_control = NULL;
- msg.msg_controllen = 0;
- return sendmsg (s, &msg, flags);
-}
-
-/*
- * Send a message to a connected host
- */
-ssize_t
-send (int s, const void *buf, size_t buflen, int flags)
-{
- return sendto (s, buf, buflen, flags, NULL, 0);
-}
-
-/*
- * All `receive' operations end up calling this routine.
- */
-ssize_t
-recvmsg (int s, struct msghdr *mp, int flags)
-{
- int ret = -1;
- int error;
- struct uio auio;
- struct iovec *iov;
- struct socket *so;
- struct mbuf *from = NULL, *control = NULL;
- int i;
- int len;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- auio.uio_iov = mp->msg_iov;
- auio.uio_iovcnt = mp->msg_iovlen;
- auio.uio_segflg = UIO_USERSPACE;
- auio.uio_rw = UIO_READ;
- auio.uio_offset = 0;
- auio.uio_resid = 0;
- iov = mp->msg_iov;
- for (i = 0; i < mp->msg_iovlen; i++, iov++) {
- if ((auio.uio_resid += iov->iov_len) < 0) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- len = auio.uio_resid;
- mp->msg_flags = flags;
- error = soreceive (so, &from, &auio, (struct mbuf **)NULL,
- mp->msg_control ? &control : (struct mbuf **)NULL,
- &mp->msg_flags);
- if (error) {
- if (auio.uio_resid != len && (error == EINTR || error == EWOULDBLOCK))
- error = 0;
- }
- if (error) {
- errno = error;
- }
- else {
- ret = len - auio.uio_resid;
- if (mp->msg_name) {
- len = mp->msg_namelen;
- if ((len <= 0) || (from == NULL)) {
- len = 0;
- }
- else {
- if (len > from->m_len)
- len = from->m_len;
- memcpy (mp->msg_name, mtod(from, caddr_t), len);
- }
- mp->msg_namelen = len;
- }
- if (mp->msg_control) {
- struct mbuf *m;
- caddr_t ctlbuf;
-
- len = mp->msg_controllen;
- m = control;
- mp->msg_controllen = 0;
- ctlbuf = (caddr_t) mp->msg_control;
-
- while (m && (len > 0)) {
- unsigned int tocopy;
-
- if (len >= m->m_len)
- tocopy = m->m_len;
- else {
- mp->msg_flags |= MSG_CTRUNC;
- tocopy = len;
- }
- memcpy(ctlbuf, mtod(m, caddr_t), tocopy);
- ctlbuf += tocopy;
- len -= tocopy;
- m = m->m_next;
- }
- mp->msg_controllen = ctlbuf - mp->msg_control;
- }
- }
- if (from)
- m_freem (from);
- if (control)
- m_freem (control);
- rtems_bsdnet_semaphore_release ();
- return (ret);
-}
-
-/*
- * Receive a message from a host
- */
-ssize_t
-recvfrom (int s, void *buf, size_t buflen, int flags, const struct sockaddr *from, int *fromlen)
-{
- struct msghdr msg;
- struct iovec iov;
- int ret;
-
- iov.iov_base = buf;
- iov.iov_len = buflen;
- msg.msg_name = (caddr_t)from;
- msg.msg_namelen = *fromlen;
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
- msg.msg_control = NULL;
- msg.msg_controllen = 0;
- ret = recvmsg (s, &msg, flags);
- if ((from != NULL) && (fromlen != NULL) && (ret >= 0))
- *fromlen = msg.msg_namelen;
- return ret;
-}
-
-/*
- * Receive a message from a connected host
- */
-ssize_t
-recv (int s, void *buf, size_t buflen, int flags)
-{
- return recvfrom (s, buf, buflen, flags, NULL, NULL);
-}
-
-int
-setsockopt (int s, int level, int name, const void *val, int len)
-{
- struct socket *so;
- struct mbuf *m = NULL;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (len > MLEN) {
- errno = EINVAL;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (val) {
- error = sockargstombuf (&m, val, len, MT_SOOPTS);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- }
- error = sosetopt(so, level, name, m);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- rtems_bsdnet_semaphore_release ();
- return 0;
-}
-
-int
-getsockopt (int s, int level, int name, void *aval, int *avalsize)
-{
- struct socket *so;
- struct mbuf *m = NULL, *m0;
- char *val = aval;
- int i, op, valsize;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (val)
- valsize = *avalsize;
- else
- valsize = 0;
- if (((error = sogetopt(so, level, name, &m)) == 0) && val && valsize && m) {
- op = 0;
- while (m && op < valsize) {
- i = valsize - op;
- if (i > m->m_len)
- i = m->m_len;
- memcpy (val, mtod(m, caddr_t), i);
- op += i;
- val += i;
- m0 = m;
- MFREE (m0, m);
- }
- *avalsize = op;
- }
- if (m != NULL)
- (void) m_free(m);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- rtems_bsdnet_semaphore_release ();
- return 0;
-}
-
-static int
-getpeersockname (int s, struct sockaddr *name, int *namelen, int pflag)
-{
- struct socket *so;
- struct mbuf *m;
- int len = *namelen;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (s)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- m = m_getclr(M_WAIT, MT_SONAME);
- if (m == NULL) {
- errno = ENOBUFS;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (pflag)
- error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, m);
- else
- error = (*so->so_proto->pr_usrreqs->pru_sockaddr)(so, m);
- if (error) {
- errno = error;
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- if (len > m->m_len) {
- len = m->m_len;
- *namelen = len;
- }
- memcpy (name, mtod(m, caddr_t), len);
- m_freem (m);
- rtems_bsdnet_semaphore_release ();
- return 0;
-}
-
-int
-getpeername (int s, struct sockaddr *name, int *namelen)
-{
- return getpeersockname (s, name, namelen, 1);
-}
-int
-getsockname (int s, struct sockaddr *name, int *namelen)
-{
- return getpeersockname (s, name, namelen, 0);
-}
-
-/*
- ************************************************************************
- * RTEMS EXTERNAL I/O HANDLER ROUTINES *
- ************************************************************************
- */
-static int
-rtems_bsdnet_close (int fd)
-{
- struct socket *so;
- int error;
- int i;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (fd)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- i = rtems_file_descriptor_base(fd);
- fdsock[i].indexFreeNext = indexFreeHead;;
- indexFreeHead = i;
- error = soclose (so);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- errno = error;
- return -1;
- }
- return 0;
-}
-
-static int
-rtems_bsdnet_read (int fd, void *buffer, unsigned32 count)
-{
- return recv (fd, buffer, count, 0);
-}
-
-static int
-rtems_bsdnet_write (int fd, const void *buffer, unsigned32 count)
-{
- return send (fd, buffer, count, 0);
-}
-
-static int
-so_ioctl (struct socket *so, unsigned32 command, void *buffer)
-{
- switch (command) {
- case FIONBIO:
- if (*(int *)buffer)
- so->so_state |= SS_NBIO;
- else
- so->so_state &= ~SS_NBIO;
- return 0;
-
- case FIONREAD:
- *(int *)buffer = so->so_rcv.sb_cc;
- return 0;
- }
-
- if (IOCGROUP(command) == 'i')
- return ifioctl (so, command, buffer, NULL);
- if (IOCGROUP(command) == 'r')
- return rtioctl (command, buffer, NULL);
- return (*so->so_proto->pr_usrreqs->pru_control)(so, command, buffer, 0);
-}
-
-static int
-rtems_bsdnet_ioctl (int fd, unsigned32 command, void *buffer)
-{
- struct socket *so;
- int error;
-
- rtems_bsdnet_semaphore_obtain ();
- if ((so = fdToSocket (fd)) == NULL) {
- rtems_bsdnet_semaphore_release ();
- return -1;
- }
- error = so_ioctl (so, command, buffer);
- rtems_bsdnet_semaphore_release ();
- if (error) {
- errno = error;
- return -1;
- }
- return 0;
-}
-
-rtems_libio_handler_t rtems_bsdnet_io_handler = {
- NULL, /* open */
- rtems_bsdnet_close, /* close */
- rtems_bsdnet_read, /* read */
- rtems_bsdnet_write, /* write */
- rtems_bsdnet_ioctl, /* ioctl */
- NULL, /* lseek */
-};
-
diff --git a/cpukit/libnetworking/rtems/sghostname.c b/cpukit/libnetworking/rtems/sghostname.c
deleted file mode 100644
index 36894caa86..0000000000
--- a/cpukit/libnetworking/rtems/sghostname.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * RTEMS versions of hostname functions
- * FIXME: Not thread-safe
- *
- * $Id$
- */
-
-#include <string.h>
-#include <errno.h>
-#include <rtems/rtems_bsdnet.h>
-#include <sys/param.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-
-static char *rtems_hostname;
-
-int
-gethostname (char *name, int namelen)
-{
- char *cp = rtems_hostname;
-
- if (cp == NULL)
- cp = "";
- strncpy (name, cp, namelen);
- return 0;
-}
-
-int
-sethostname (char *name, int namelen)
-{
- char *old, *new;
-
- if (namelen >= MAXHOSTNAMELEN) {
- errno = EINVAL;
- return -1;
- }
- new = malloc (namelen + 1, M_HTABLE, M_NOWAIT);
- if (new == NULL) {
- errno = ENOMEM;
- return -1;
- }
- strncpy (new, name, namelen);
- new[namelen] = '\0';
- old = rtems_hostname;
- rtems_hostname = new;
- if (old)
- free (old, M_HTABLE);
- return 0;
-}
diff --git a/cpukit/libnetworking/rtems/tftp.h b/cpukit/libnetworking/rtems/tftp.h
deleted file mode 100644
index d09782e22b..0000000000
--- a/cpukit/libnetworking/rtems/tftp.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * $Id$
- */
-
-/*
- * Trivial File Transfer Protocol (TFTP)
- *
- * Transfer file to/from remote host
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- */
-
-/*
- * Usage:
- *
- * To open `/bootfiles/image' on `hostname' for reading:
- * fd = open ("/TFTP/hostname/bootfiles/image", O_RDONLY);
- *
- * The `hostname' must be four dot-separated decimal values.
- *
- * To open a file on the host which supplied the BOOTP
- * information just leave the `hostname' part empty:
- * fd = open ("/TFTP//bootfiles/image", O_RDONLY);
- *
- */
-
-#ifndef _TFTP_DRIVER_h
-#define _TFTP_DRIVER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Driver entry points
- */
-#define TFTP_DRIVER_TABLE_ENTRY \
- { rtems_tftp_initialize, rtems_tftp_open, rtems_tftp_close, \
- rtems_tftp_read, rtems_tftp_write, rtems_tftp_control }
-
-rtems_device_driver rtems_tftp_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_open(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_close(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_read(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_write(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver rtems_tftp_control(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/sys/buf.h b/cpukit/libnetworking/sys/buf.h
deleted file mode 100644
index 6cca571141..0000000000
--- a/cpukit/libnetworking/sys/buf.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)buf.h 8.9 (Berkeley) 3/30/95
- * $Id$
- */
-
-#ifndef _SYS_BUF_H_
-#define _SYS_BUF_H_
-
-#include <sys/queue.h>
-
-#define NOLIST ((struct buf *)0x87654321)
-
-struct buf;
-
-struct iodone_chain {
- long ic_prev_flags;
- void (*ic_prev_iodone) __P((struct buf *));
- void *ic_prev_iodone_chain;
- struct {
- long ia_long;
- void *ia_ptr;
- } ic_args[5];
-};
-
-typedef TAILQ_HEAD(buf_queue_head, buf) buf_queue_head, *buf_queue_head_t;
-
-/*
- * The buffer header describes an I/O operation in the kernel.
- */
-struct buf {
- LIST_ENTRY(buf) b_hash; /* Hash chain. */
- LIST_ENTRY(buf) b_vnbufs; /* Buffer's associated vnode. */
- TAILQ_ENTRY(buf) b_freelist; /* Free list position if not active. */
- TAILQ_ENTRY(buf) b_act; /* Device driver queue when active. *new* */
- struct proc *b_proc; /* Associated proc; NULL if kernel. */
- long b_flags; /* B_* flags. */
- unsigned short b_qindex; /* buffer queue index */
- unsigned char b_usecount; /* buffer use count */
- int b_error; /* Errno value. */
- long b_bufsize; /* Allocated buffer size. */
- long b_bcount; /* Valid bytes in buffer. */
- long b_resid; /* Remaining I/O. */
- dev_t b_dev; /* Device associated with buffer. */
- struct {
- caddr_t b_addr; /* Memory, superblocks, indirect etc. */
- } b_un;
- caddr_t b_kvabase; /* base kva for buffer */
- int b_kvasize; /* size of kva for buffer */
- void *b_saveaddr; /* Original b_addr for physio. */
- daddr_t b_lblkno; /* Logical block number. */
- daddr_t b_blkno; /* Underlying physical block number. */
- /* Function to call upon completion. */
- void (*b_iodone) __P((struct buf *));
- /* For nested b_iodone's. */
- struct iodone_chain *b_iodone_chain;
- struct vnode *b_vp; /* Device vnode. */
- int b_dirtyoff; /* Offset in buffer of dirty region. */
- int b_dirtyend; /* Offset of end of dirty region. */
- struct ucred *b_rcred; /* Read credentials reference. */
- struct ucred *b_wcred; /* Write credentials reference. */
- int b_validoff; /* Offset in buffer of valid region. */
- int b_validend; /* Offset of end of valid region. */
- daddr_t b_pblkno; /* physical block number */
- caddr_t b_savekva; /* saved kva for transfer while bouncing */
- void *b_driver1; /* for private use by the driver */
- void *b_driver2; /* for private use by the driver */
- void *b_spc;
- union cluster_info {
- TAILQ_HEAD(cluster_list_head, buf) cluster_head;
- TAILQ_ENTRY(buf) cluster_entry;
- } b_cluster;
- struct vm_page *b_pages[btoc(MAXPHYS)];
- int b_npages;
-};
-
-/* Device driver compatibility definitions. */
-#define b_data b_un.b_addr /* b_un.b_addr is not changeable. */
-
-/*
- * These flags are kept in b_flags.
- */
-#define B_AGE 0x00000001 /* Move to age queue when I/O done. */
-#define B_NEEDCOMMIT 0x00000002 /* Append-write in progress. */
-#define B_ASYNC 0x00000004 /* Start I/O, do not wait. */
-#define B_BAD 0x00000008 /* Bad block revectoring in progress. */
-#define B_BUSY 0x00000010 /* I/O in progress. */
-#define B_CACHE 0x00000020 /* Bread found us in the cache. */
-#define B_CALL 0x00000040 /* Call b_iodone from biodone. */
-#define B_DELWRI 0x00000080 /* Delay I/O until buffer reused. */
-#define B_DIRTY 0x00000100 /* Dirty page to be pushed out async. */
-#define B_DONE 0x00000200 /* I/O completed. */
-#define B_EINTR 0x00000400 /* I/O was interrupted */
-#define B_ERROR 0x00000800 /* I/O error occurred. */
-#define B_GATHERED 0x00001000 /* LFS: already in a segment. */
-#define B_INVAL 0x00002000 /* Does not contain valid info. */
-#define B_LOCKED 0x00004000 /* Locked in core (not reusable). */
-#define B_NOCACHE 0x00008000 /* Do not cache block after use. */
-#define B_MALLOC 0x00010000 /* malloced b_data */
-#define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */
-#define B_PHYS 0x00040000 /* I/O to user memory. */
-#define B_RAW 0x00080000 /* Set by physio for raw transfers. */
-#define B_READ 0x00100000 /* Read buffer. */
-#define B_TAPE 0x00200000 /* Magnetic tape I/O. */
-#define B_RELBUF 0x00400000 /* Release VMIO buffer. */
-#define B_WANTED 0x00800000 /* Process wants this buffer. */
-#define B_WRITE 0x00000000 /* Write buffer (pseudo flag). */
-#define B_WRITEINPROG 0x01000000 /* Write in progress. */
-#define B_XXX 0x02000000 /* Debugging flag. */
-#define B_PAGING 0x04000000 /* volatile paging I/O -- bypass VMIO */
-#define B_ORDERED 0x08000000 /* Must guarantee I/O ordering */
-#define B_VMIO 0x20000000 /* VMIO flag */
-#define B_CLUSTER 0x40000000 /* pagein op, so swap() can count it */
-#define B_BOUNCE 0x80000000 /* bounce buffer flag */
-
-/*
- * number of buffer hash entries
- */
-#define BUFHSZ 512
-
-/*
- * buffer hash table calculation, originally by David Greenman
- */
-#define BUFHASH(vnp, bn) \
- (&bufhashtbl[(((unsigned long)(vnp) >> 7)+(int)(bn)) % BUFHSZ])
-
-/*
- * Definitions for the buffer free lists.
- */
-#define BUFFER_QUEUES 6 /* number of free buffer queues */
-
-extern LIST_HEAD(bufhashhdr, buf) bufhashtbl[BUFHSZ], invalhash;
-extern TAILQ_HEAD(bqueues, buf) bufqueues[BUFFER_QUEUES];
-
-#define QUEUE_NONE 0 /* on no queue */
-#define QUEUE_LOCKED 1 /* locked buffers */
-#define QUEUE_LRU 2 /* useful buffers */
-#define QUEUE_VMIO 3 /* VMIO buffers */
-#define QUEUE_AGE 4 /* not-useful buffers */
-#define QUEUE_EMPTY 5 /* empty buffer headers*/
-
-/*
- * Zero out the buffer's data area.
- */
-#define clrbuf(bp) { \
- bzero((bp)->b_data, (u_int)(bp)->b_bcount); \
- (bp)->b_resid = 0; \
-}
-
-/* Flags to low-level allocation routines. */
-#define B_CLRBUF 0x01 /* Request allocated buffer be cleared. */
-#define B_SYNC 0x02 /* Do all allocations synchronously. */
-
-#ifdef KERNEL
-extern int nbuf; /* The number of buffer headers */
-extern struct buf *buf; /* The buffer headers. */
-extern char *buffers; /* The buffer contents. */
-extern int bufpages; /* Number of memory pages in the buffer pool. */
-extern struct buf *swbuf; /* Swap I/O buffer headers. */
-extern int nswbuf; /* Number of swap I/O buffer headers. */
-extern TAILQ_HEAD(swqueue, buf) bswlist;
-
-void bufinit __P((void));
-void bremfree __P((struct buf *));
-int bread __P((struct vnode *, daddr_t, int,
- struct ucred *, struct buf **));
-int breadn __P((struct vnode *, daddr_t, int, daddr_t *, int *, int,
- struct ucred *, struct buf **));
-int bwrite __P((struct buf *));
-void bdwrite __P((struct buf *));
-void bawrite __P((struct buf *));
-int bowrite __P((struct buf *));
-void brelse __P((struct buf *));
-void bqrelse __P((struct buf *));
-int vfs_bio_awrite __P((struct buf *));
-struct buf * getpbuf __P((void));
-struct buf *incore __P((struct vnode *, daddr_t));
-struct buf *gbincore __P((struct vnode *, daddr_t));
-int inmem __P((struct vnode *, daddr_t));
-struct buf *getblk __P((struct vnode *, daddr_t, int, int, int));
-struct buf *geteblk __P((int));
-int allocbuf __P((struct buf *, int));
-int biowait __P((struct buf *));
-void biodone __P((struct buf *));
-
-void cluster_callback __P((struct buf *));
-int cluster_read __P((struct vnode *, u_quad_t, daddr_t, long,
- struct ucred *, struct buf **));
-int cluster_wbuild __P((struct vnode *, long, daddr_t, int));
-void cluster_write __P((struct buf *, u_quad_t));
-int physio __P((void (*)(struct buf *), struct buf *, dev_t,
- int, u_int (*)(struct buf *), struct uio *));
-u_int minphys __P((struct buf *));
-void vfs_bio_clrbuf __P((struct buf *));
-void vfs_busy_pages __P((struct buf *, int clear_modify));
-void vfs_unbusy_pages(struct buf *);
-void vwakeup __P((struct buf *));
-void vmapbuf __P((struct buf *));
-void vunmapbuf __P((struct buf *));
-void relpbuf __P((struct buf *));
-void brelvp __P((struct buf *));
-void bgetvp __P((struct vnode *, struct buf *));
-void pbgetvp __P((struct vnode *, struct buf *));
-void pbrelvp __P((struct buf *));
-void reassignbuf __P((struct buf *, struct vnode *));
-struct buf *trypbuf __P((void));
-void vm_bounce_alloc __P((struct buf *));
-void vm_bounce_free __P((struct buf *));
-vm_offset_t vm_bounce_kva_alloc __P((int));
-void vm_bounce_kva_alloc_free __P((vm_offset_t, int));
-#endif /* KERNEL */
-
-#endif /* !_SYS_BUF_H_ */
diff --git a/cpukit/libnetworking/sys/callout.h b/cpukit/libnetworking/sys/callout.h
deleted file mode 100644
index 5fec98f28b..0000000000
--- a/cpukit/libnetworking/sys/callout.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)callout.h 8.2 (Berkeley) 1/21/94
- * $Id$
- */
-
-#ifndef _SYS_CALLOUT_H_
-#define _SYS_CALLOUT_H_
-
-struct callout {
- struct callout *c_next; /* next callout in queue */
- void *c_arg; /* function argument */
- void (*c_func) __P((void *)); /* function to call */
- int c_time; /* ticks to the event */
-};
-
-#ifdef KERNEL
-extern struct callout *callfree, *callout, calltodo;
-extern int ncallout;
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/sys/conf.h b/cpukit/libnetworking/sys/conf.h
deleted file mode 100644
index 92d99d9d07..0000000000
--- a/cpukit/libnetworking/sys/conf.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)conf.h 8.5 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _SYS_CONF_H_
-#define _SYS_CONF_H_
-
-/*
- * Definitions of device driver entry switches
- */
-
-struct buf;
-struct proc;
-struct tty;
-struct uio;
-struct vnode;
-
-typedef int d_open_t __P((dev_t dev, int oflags, int devtype, struct proc *p));
-typedef int d_close_t __P((dev_t dev, int fflag, int devtype, struct proc *p));
-typedef void d_strategy_t __P((struct buf *bp));
-typedef int d_ioctl_t __P((dev_t dev, int cmd, caddr_t data,
- int fflag, struct proc *p));
-typedef int d_dump_t __P((dev_t dev));
-typedef int d_psize_t __P((dev_t dev));
-
-typedef int d_read_t __P((dev_t dev, struct uio *uio, int ioflag));
-typedef int d_write_t __P((dev_t dev, struct uio *uio, int ioflag));
-typedef void d_stop_t __P((struct tty *tp, int rw));
-typedef int d_reset_t __P((dev_t dev));
-typedef struct tty *d_devtotty_t __P((dev_t dev));
-typedef int d_select_t __P((dev_t dev, int which, struct proc *p));
-typedef int d_mmap_t __P((dev_t dev, int offset, int nprot));
-
-typedef int l_open_t __P((dev_t dev, struct tty *tp));
-typedef int l_close_t __P((struct tty *tp, int flag));
-typedef int l_read_t __P((struct tty *tp, struct uio *uio, int flag));
-typedef int l_write_t __P((struct tty *tp, struct uio *uio, int flag));
-typedef int l_ioctl_t __P((struct tty *tp, int cmd, caddr_t data,
- int flag, struct proc *p));
-typedef int l_rint_t __P((int c, struct tty *tp));
-typedef int l_start_t __P((struct tty *tp));
-typedef int l_modem_t __P((struct tty *tp, int flag));
-
-/*
- * Block device switch table
- */
-struct bdevsw {
- d_open_t *d_open;
- d_close_t *d_close;
- d_strategy_t *d_strategy;
- d_ioctl_t *d_ioctl;
- d_dump_t *d_dump;
- d_psize_t *d_psize;
- int d_flags;
- char *d_name; /* name of the driver e.g. audio */
- struct cdevsw *d_cdev; /* cross pointer to the cdev */
- int d_maj; /* the major number we were assigned */
-};
-
-#ifdef KERNEL
-extern struct bdevsw *bdevsw[];
-#endif
-
-/*
- * Character device switch table
- */
-struct cdevsw {
- d_open_t *d_open;
- d_close_t *d_close;
- d_read_t *d_read;
- d_write_t *d_write;
- d_ioctl_t *d_ioctl;
- d_stop_t *d_stop;
- d_reset_t *d_reset; /* XXX not used */
- d_devtotty_t *d_devtotty;
- d_select_t *d_select;
- d_mmap_t *d_mmap;
- d_strategy_t *d_strategy;
- char *d_name; /* see above */
- struct bdevsw *d_bdev;
- int d_maj;
-};
-
-#ifdef KERNEL
-extern struct cdevsw *cdevsw[];
-#endif
-
-/*
- * Line discipline switch table
- */
-struct linesw {
- l_open_t *l_open;
- l_close_t *l_close;
- l_read_t *l_read;
- l_write_t *l_write;
- l_ioctl_t *l_ioctl;
- l_rint_t *l_rint;
- l_start_t *l_start;
- l_modem_t *l_modem;
-};
-
-#ifdef KERNEL
-extern struct linesw linesw[];
-extern int nlinesw;
-
-int ldisc_register __P((int , struct linesw *));
-void ldisc_deregister __P((int));
-#define LDISC_LOAD -1 /* Loadable line discipline */
-#endif
-
-/*
- * Swap device table
- */
-struct swdevt {
- dev_t sw_dev;
- int sw_flags;
- int sw_nblks;
- struct vnode *sw_vp;
-};
-#define SW_FREED 0x01
-#define SW_SEQUENTIAL 0x02
-#define sw_freed sw_flags /* XXX compat */
-
-#ifdef KERNEL
-d_open_t noopen;
-d_close_t noclose;
-d_read_t noread;
-d_write_t nowrite;
-d_ioctl_t noioctl;
-d_stop_t nostop;
-d_reset_t noreset;
-d_devtotty_t nodevtotty;
-d_select_t noselect;
-d_mmap_t nommap;
-
-/* Bogus defines for compatibility. */
-#define noioc noioctl
-#define nostrat nostrategy
-#define zerosize nopsize
-/*
- * XXX d_strategy seems to be unused for cdevs that aren't associated with
- * bdevs and called without checking for it being non-NULL for bdevs.
- */
-#define nostrategy ((d_strategy_t *)NULL)
-
-d_dump_t nodump;
-
-/*
- * nopsize is little used, so not worth having dummy functions for.
- */
-#define nopsize ((d_psize_t *)NULL)
-
-d_open_t nullopen;
-d_close_t nullclose;
-#define nullstop nostop /* one void return is as good as another */
-#define nullreset noreset /* one unused function is as good as another */
-
-d_open_t nxopen;
-d_close_t nxclose;
-d_read_t nxread;
-d_write_t nxwrite;
-d_ioctl_t nxioctl;
-#define nxstop nostop /* one void return is as good as another */
-#define nxreset noreset /* one unused function is as good as another */
-#define nxdevtotty nodevtotty /* one NULL return is as good as another */
-d_select_t nxselect;
-#define nxmmap nommap /* one -1 return is as good as another */
-#define nxstrategy nostrategy /* one NULL value is as good as another */
-d_dump_t nxdump;
-#define nxpsize nopsize /* one NULL value is as good as another */
-
-d_read_t rawread;
-d_write_t rawwrite;
-
-l_read_t l_noread;
-l_write_t l_nowrite;
-
-int bdevsw_add __P((dev_t *descrip,struct bdevsw *new,struct bdevsw **old));
-int cdevsw_add __P((dev_t *descrip,struct cdevsw *new,struct cdevsw **old));
-void cdevsw_make __P((struct bdevsw *from));
-void bdevsw_add_generic __P((int bdev, int cdev, struct bdevsw *bdevsw));
-dev_t chrtoblk __P((dev_t dev));
-int isdisk __P((dev_t dev, int type));
-int iskmemdev __P((dev_t dev));
-int iszerodev __P((dev_t dev));
-void setconf __P((void));
-#endif /* KERNEL */
-
-#include <machine/conf.h>
-
-#endif /* !_SYS_CONF_H_ */
diff --git a/cpukit/libnetworking/sys/domain.h b/cpukit/libnetworking/sys/domain.h
deleted file mode 100644
index 2ec8a5fb05..0000000000
--- a/cpukit/libnetworking/sys/domain.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)domain.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_DOMAIN_H_
-#define _SYS_DOMAIN_H_
-
-/*
- * Structure per communications domain.
- */
-
-/*
- * Forward structure declarations for function prototypes [sic].
- */
-struct mbuf;
-
-struct domain {
- int dom_family; /* AF_xxx */
- char *dom_name;
- void (*dom_init) /* initialize domain data structures */
- __P((void));
- int (*dom_externalize) /* externalize access rights */
- __P((struct mbuf *));
- void (*dom_dispose) /* dispose of internalized rights */
- __P((struct mbuf *));
- struct protosw *dom_protosw, *dom_protoswNPROTOSW;
- struct domain *dom_next;
- int (*dom_rtattach) /* initialize routing table */
- __P((void **, int));
- int dom_rtoffset; /* an arg to rtattach, in bits */
- int dom_maxrtkey; /* for routing layer */
-};
-
-#ifdef KERNEL
-extern struct domain *domains;
-extern struct domain localdomain;
-
-#define DOMAIN_SET(name) \
- DATA_SET(domain_set, name ## domain);
-
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/sys/kernel.h b/cpukit/libnetworking/sys/kernel.h
deleted file mode 100644
index 35bce70bd6..0000000000
--- a/cpukit/libnetworking/sys/kernel.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/*-
- * Copyright (c) 1995 Terrence R. Lambert
- * All rights reserved.
- *
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)kernel.h 8.3 (Berkeley) 1/21/94
- * $Id$
- */
-
-#ifndef _SYS_KERNEL_H_
-#define _SYS_KERNEL_H_
-
-/* Global variables for the kernel. */
-
-/* 1.1 */
-extern long hostid;
-extern char hostname[MAXHOSTNAMELEN];
-extern int hostnamelen;
-extern char domainname[MAXHOSTNAMELEN];
-extern int domainnamelen;
-extern char kernelname[MAXPATHLEN];
-
-/* 1.2 */
-extern volatile struct timeval mono_time;
-extern struct timeval boottime;
-extern struct timeval runtime;
-/* extern volatile struct timeval time; */
-extern struct timezone tz; /* XXX */
-
-extern int tick; /* usec per tick (1000000 / hz) */
-extern int hz; /* system clock's frequency */
-extern int psratio; /* ratio: prof / stat */
-extern int stathz; /* statistics clock's frequency */
-extern int profhz; /* profiling clock's frequency */
-extern int ticks;
-extern int lbolt; /* once a second sleep address */
-extern int tickdelta;
-extern long timedelta;
-
-/*
- * The following macros are used to declare global sets of objects, which
- * are collected by the linker into a `struct linker_set' as defined below.
- *
- * NB: the constants defined below must match those defined in
- * ld/ld.h. Since their calculation requires arithmetic, we
- * can't name them symbolically (e.g., 23 is N_SETT | N_EXT).
- */
-#define MAKE_SET(set, sym, type)
-#define TEXT_SET(set, sym) MAKE_SET(set, sym, 23)
-#define DATA_SET(set, sym) MAKE_SET(set, sym, 25)
-#define BSS_SET(set, sym) MAKE_SET(set, sym, 27)
-#define ABS_SET(set, sym) MAKE_SET(set, sym, 21)
-
-
-/*
- * Enumerated types for known system startup interfaces.
- *
- * Startup occurs in ascending numeric order; the list entries are
- * sorted prior to attempting startup to guarantee order. Items
- * of the same level are arbitrated for order based on the 'order'
- * element.
- *
- * These numbers are arbitrary and are chosen ONLY for ordering; the
- * enumeration values are explicit rather than implicit to provide
- * for binary compatibility with inserted elements.
- *
- * The SI_SUB_RUN_SCHEDULER value must have the highest lexical value.
- *
- * The SI_SUB_CONSOLE and SI_SUB_SWAP values represent values used by
- * the BSD 4.4Lite but not by FreeBSD; they are maintained in dependent
- * order to support porting.
- *
- * The SI_SUB_PROTO_BEGIN and SI_SUB_PROTO_END bracket a range of
- * initializations to take place at splimp(). This is a historical
- * wart that should be removed -- probably running everything at
- * splimp() until the first init that doesn't want it is the correct
- * fix. They are currently present to ensure historical behavior.
- */
-enum sysinit_sub_id {
- SI_SUB_DUMMY = 0x00000000, /* not executed; for linker*/
- SI_SUB_CONSOLE = 0x08000000, /* console*/
- SI_SUB_COPYRIGHT = 0x08000001, /* first use of console*/
- SI_SUB_VM = 0x10000000, /* virtual memory system init*/
- SI_SUB_KMEM = 0x18000000, /* kernel memory*/
- SI_SUB_CPU = 0x20000000, /* CPU resource(s)*/
- SI_SUB_DEVFS = 0x22000000, /* get DEVFS ready */
- SI_SUB_DRIVERS = 0x23000000, /* Let Drivers initialize */
- SI_SUB_CONFIGURE = 0x24000000, /* Configure devices */
- SI_SUB_INTRINSIC = 0x28000000, /* proc 0*/
- SI_SUB_RUN_QUEUE = 0x30000000, /* the run queue*/
- SI_SUB_VM_CONF = 0x38000000, /* config VM, set limits*/
- SI_SUB_VFS = 0x40000000, /* virtual file system*/
- SI_SUB_CLOCKS = 0x48000000, /* real time and stat clocks*/
- SI_SUB_MBUF = 0x50000000, /* mbufs*/
- SI_SUB_CLIST = 0x58000000, /* clists*/
- SI_SUB_SYSV_SHM = 0x64000000, /* System V shared memory*/
- SI_SUB_SYSV_SEM = 0x68000000, /* System V semaphores*/
- SI_SUB_SYSV_MSG = 0x6C000000, /* System V message queues*/
- SI_SUB_PSEUDO = 0x70000000, /* pseudo devices*/
- SI_SUB_PROTO_BEGIN = 0x80000000, /* XXX: set splimp (kludge)*/
- SI_SUB_PROTO_IF = 0x84000000, /* interfaces*/
- SI_SUB_PROTO_DOMAIN = 0x88000000, /* domains (address families?)*/
- SI_SUB_PROTO_END = 0x8fffffff, /* XXX: set splx (kludge)*/
- SI_SUB_KPROF = 0x90000000, /* kernel profiling*/
- SI_SUB_KICK_SCHEDULER = 0xa0000000, /* start the timeout events*/
- SI_SUB_ROOT = 0xb0000000, /* root mount*/
- SI_SUB_ROOT_FDTAB = 0xb8000000, /* root vnode in fd table...*/
- SI_SUB_SWAP = 0xc0000000, /* swap*/
- SI_SUB_INTRINSIC_POST = 0xd0000000, /* proc 0 cleanup*/
- SI_SUB_KTHREAD_INIT = 0xe0000000, /* init process*/
- SI_SUB_KTHREAD_PAGE = 0xe4000000, /* pageout daemon*/
- SI_SUB_KTHREAD_VM = 0xe8000000, /* vm daemon*/
- SI_SUB_KTHREAD_UPDATE = 0xec000000, /* update daemon*/
- SI_SUB_RUN_SCHEDULER = 0xffffffff /* scheduler: no return*/
-};
-
-
-/*
- * Some enumerated orders; "ANY" sorts last.
- */
-enum sysinit_elem_order {
- SI_ORDER_FIRST = 0x00000000, /* first*/
- SI_ORDER_SECOND = 0x00000001, /* second*/
- SI_ORDER_THIRD = 0x00000002, /* third*/
- SI_ORDER_MIDDLE = 0x10000000, /* somewhere in the middle */
- SI_ORDER_ANY = 0xffffffff /* last*/
-};
-
-
-/*
- * System initialization call types; currently two are supported... one
- * to do a simple function call and one to cause a process to be started
- * by the kernel on the callers behalf.
- */
-typedef enum sysinit_elem_type {
- SI_TYPE_DEFAULT = 0x00000000, /* No special processing*/
- SI_TYPE_KTHREAD = 0x00000001 /* start kernel thread*/
-} si_elem_t;
-
-
-/*
- * A system initialization call instance
- *
- * The subsystem
- */
-struct sysinit {
- unsigned int subsystem; /* subsystem identifier*/
- unsigned int order; /* init order within subsystem*/
- void (*func) __P((void *)); /* init function*/
- void *udata; /* multiplexer/argument */
- si_elem_t type; /* sysinit_elem_type*/
-};
-
-
-/*
- * Default: no special processing
- */
-#define SYSINIT(uniquifier, subsystem, order, func, ident)
-
-/*
- * Call 'fork()' before calling '(*func)(ident)';
- * for making a kernel 'thread' (or builtin process.)
- */
-#define SYSINIT_KT(uniquifier, subsystem, order, func, ident)
-
-
-/*
- * A kernel process descriptor; used to start "internal" daemons
- *
- * Note: global_procpp may be NULL for no global save area
- */
-struct kproc_desc {
- char *arg0; /* arg 0 (for 'ps' listing)*/
- void (*func) __P((void)); /* "main" for kernel process*/
- struct proc **global_procpp; /* ptr to proc ptr save area*/
-};
-
-void kproc_start __P((void *udata));
-
-#ifdef PSEUDO_LKM
-#include <sys/conf.h>
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-#define PSEUDO_SET(init, name) \
- extern struct linker_set MODVNOPS; \
- MOD_MISC(name); \
- static int \
- name ## _load(struct lkm_table *lkmtp, int cmd) \
- { init((void *)NULL /* XXX unused (?) */); return 0; } \
- static int \
- name ## _unload(struct lkm_table *lkmtp, int cmd) \
- { return EINVAL; } \
- int \
- name ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \
- DISPATCH(lkmtp, cmd, ver, name ## _load, name ## _unload, \
- lkm_nullcmd); }
-#else /* PSEUDO_LKM */
-
-/*
- * Compatibility. To be deprecated after LKM is updated.
- */
-#define PSEUDO_SET(sym, name) SYSINIT(ps, SI_SUB_PSEUDO, SI_ORDER_ANY, sym, 0)
-
-#endif /* PSEUDO_LKM */
-
-struct linker_set {
- int ls_length;
- const void *ls_items[1]; /* really ls_length of them,
- * trailing NULL */
-};
-
-extern struct linker_set execsw_set;
-
-#endif /* !_SYS_KERNEL_H_*/
diff --git a/cpukit/libnetworking/sys/libkern.h b/cpukit/libnetworking/sys/libkern.h
deleted file mode 100644
index c01e35b273..0000000000
--- a/cpukit/libnetworking/sys/libkern.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * 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.
- *
- * @(#)libkern.h 8.1 (Berkeley) 6/10/93
- * $Id$
- */
-
-#ifndef _SYS_LIBKERN_H_
-#define _SYS_LIBKERN_H_
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-/* BCD conversions. */
-extern u_char const bcd2bin_data[];
-extern u_char const bin2bcd_data[];
-extern char const hex2ascii_data[];
-
-#define bcd2bin(bcd) (bcd2bin_data[bcd])
-#define bin2bcd(bin) (bin2bcd_data[bin])
-#define hex2ascii(hex) (hex2ascii_data[hex])
-
-static __inline int imax(int a, int b) { return (a > b ? a : b); }
-static __inline int imin(int a, int b) { return (a < b ? a : b); }
-static __inline long lmax(long a, long b) { return (a > b ? a : b); }
-static __inline long lmin(long a, long b) { return (a < b ? a : b); }
-static __inline u_int max(u_int a, u_int b) { return (a > b ? a : b); }
-static __inline u_int min(u_int a, u_int b) { return (a < b ? a : b); }
-static __inline quad_t qmax(quad_t a, quad_t b) { return (a > b ? a : b); }
-static __inline quad_t qmin(quad_t a, quad_t b) { return (a < b ? a : b); }
-static __inline u_long ulmax(u_long a, u_long b) { return (a > b ? a : b); }
-static __inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); }
-
-/* Prototypes for non-quad routines. */
-int bcmp __P((const void *, const void *, size_t));
-#ifndef HAVE_INLINE_FFS
-int ffs __P((int));
-#endif
-#ifndef HAVE_INLINE_FLS
-int fls __P((int));
-#endif
-int locc __P((int, char *, u_int));
-void qsort __P((void *base, size_t nmemb, size_t size,
- int (*compar)(const void *, const void *)));
-u_long random __P((void));
-char *index __P((const char *, int));
-char *rindex __P((const char *, int));
-int scanc __P((u_int, const u_char *, const u_char *, int));
-int skpc __P((int, int, char *));
-void srandom __P((u_long));
-char *strcat __P((char *, const char *));
-int strcmp __P((const char *, const char *));
-char *strdup __P((const char *s));
-char *strcpy __P((char *, const char *));
-size_t strlen __P((const char *));
-int strncmp __P((const char *, const char *, size_t));
-char *strncpy __P((char *, const char *, size_t));
-char *strerror __P((int errnum));
-
-#endif /* !_SYS_LIBKERN_H_ */
diff --git a/cpukit/libnetworking/sys/malloc.h b/cpukit/libnetworking/sys/malloc.h
deleted file mode 100644
index ec85c1814d..0000000000
--- a/cpukit/libnetworking/sys/malloc.h
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Copyright (c) 1987, 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.
- *
- * @(#)malloc.h 8.5 (Berkeley) 5/3/95
- * $Id$
- */
-
-#ifndef _SYS_MALLOC_H_
-#define _SYS_MALLOC_H_
-
-#include <rtems/rtems_bsdnet_internal.h> /* Ensure we get RTEMS malloc hooks */
-#define KMEMSTATS
-
-/*
- * flags to malloc
- */
-#define M_WAITOK 0x0000
-#define M_NOWAIT 0x0001
-#define M_KERNEL 0x0002
-
-/*
- * Types of memory to be allocated
- */
-#define M_FREE 0 /* should be on free list */
-#define M_MBUF 1 /* mbuf */
-#define M_DEVBUF 2 /* device driver memory */
-#define M_SOCKET 3 /* socket structure */
-#define M_PCB 4 /* protocol control block */
-#define M_RTABLE 5 /* routing tables */
-#define M_HTABLE 6 /* IMP host tables */
-#define M_FTABLE 7 /* fragment reassembly header */
-#define M_ZOMBIE 8 /* zombie proc status */
-#define M_IFADDR 9 /* interface address */
-#define M_SOOPTS 10 /* socket options */
-#define M_SONAME 11 /* socket name */
-#define M_NAMEI 12 /* namei path name buffer */
-#define M_GPROF 13 /* kernel profiling buffer */
-#define M_IOCTLOPS 14 /* ioctl data buffer */
-#define M_MAPMEM 15 /* mapped memory descriptors */
-#define M_CRED 16 /* credentials */
-#define M_PGRP 17 /* process group header */
-#define M_SESSION 18 /* session header */
-#define M_IOV 19 /* large iov's */
-#define M_MOUNT 20 /* vfs mount struct */
-#define M_FHANDLE 21 /* network file handle */
-#define M_NFSREQ 22 /* NFS request header */
-#define M_NFSMNT 23 /* NFS mount structure */
-#define M_NFSNODE 24 /* NFS vnode private part */
-#define M_VNODE 25 /* Dynamically allocated vnodes */
-#define M_CACHE 26 /* Dynamically allocated cache entries */
-#define M_DQUOT 27 /* UFS quota entries */
-#define M_UFSMNT 28 /* UFS mount structure */
-#define M_SHM 29 /* SVID compatible shared memory segments */
-#define M_VMMAP 30 /* VM map structures */
-#define M_VMMAPENT 31 /* VM map entry structures */
-#define M_VMOBJ 32 /* VM object structure */
-#define M_VMOBJHASH 33 /* VM object hash structure */
-#define M_VMPMAP 34 /* VM pmap */
-#define M_VMPVENT 35 /* VM phys-virt mapping entry */
-#define M_VMPAGER 36 /* XXX: VM pager struct */
-#define M_VMPGDATA 37 /* XXX: VM pager private data */
-#define M_FILE 38 /* Open file structure */
-#define M_FILEDESC 39 /* Open file descriptor table */
-#define M_LOCKF 40 /* Byte-range locking structures */
-#define M_PROC 41 /* Proc structures */
-#define M_SUBPROC 42 /* Proc sub-structures */
-#define M_SEGMENT 43 /* Segment for LFS */
-#define M_LFSNODE 44 /* LFS vnode private part */
-#define M_FFSNODE 45 /* FFS vnode private part */
-#define M_MFSNODE 46 /* MFS vnode private part */
-#define M_NQLEASE 47 /* Nqnfs lease */
-#define M_NQMHOST 48 /* Nqnfs host address table */
-#define M_NETADDR 49 /* Export host address structure */
-#define M_NFSSVC 50 /* Nfs server structure */
-#define M_NFSUID 51 /* Nfs uid mapping structure */
-#define M_NFSD 52 /* Nfs server daemon structure */
-#define M_IPMOPTS 53 /* internet multicast options */
-#define M_IPMADDR 54 /* internet multicast address */
-#define M_IFMADDR 55 /* link-level multicast address */
-#define M_MRTABLE 56 /* multicast routing tables */
-#define M_ISOFSMNT 57 /* ISOFS mount structure */
-#define M_ISOFSNODE 58 /* ISOFS vnode private part */
-#define M_NFSRVDESC 59 /* NFS server socket descriptor */
-#define M_NFSDIROFF 60 /* NFS directory offset data */
-#define M_NFSBIGFH 61 /* NFS version 3 file handle */
-#define M_MSDOSFSMNT 67 /* MSDOSFS mount structure */
-#define M_MSDOSFSNODE 68 /* MSDOSFS vnode private part */
-#define M_MSDOSFSFAT 69 /* MSDOSFS file allocation table */
-#define M_DEVFSMNT 70 /* DEVFS mount structure */
-#define M_DEVFSBACK 71 /* DEVFS Back node */
-#define M_DEVFSFRONT 72 /* DEVFS Front node */
-#define M_DEVFSNODE 73 /* DEVFS node */
-#define M_TEMP 74 /* misc temporary data buffers */
-#define M_TTYS 75 /* tty data structures */
-#define M_GZIP 76 /* Gzip trees */
-#define M_IPFW 77 /* IpFw/IpAcct chain's */
-#define M_DEVL 78 /* isa_device lists in userconfig() */
-#define M_PKTCLASS 79 /* structures used in packet classifier */
-#define M_SYSCTL 80 /* sysctl internal magic */
-#define M_SECA 81 /* security associations, key management */
-#define M_BIOBUF 82 /* BIO buffer */
-#define M_KTRACE 83 /* KTRACE */
-#define M_SELECT 84 /* select() buffer */
-#define M_CFS 85 /* Coda */
-#define M_LAST 86 /* Must be last type + 1 */
-
-#define INITKMEMNAMES { \
- "free", /* 0 M_FREE */ \
- "mbuf", /* 1 M_MBUF */ \
- "devbuf", /* 2 M_DEVBUF */ \
- "socket", /* 3 M_SOCKET */ \
- "pcb", /* 4 M_PCB */ \
- "routetbl", /* 5 M_RTABLE */ \
- "hosttbl", /* 6 M_HTABLE */ \
- "fragtbl", /* 7 M_FTABLE */ \
- "zombie", /* 8 M_ZOMBIE */ \
- "ifaddr", /* 9 M_IFADDR */ \
- "soopts", /* 10 M_SOOPTS */ \
- "soname", /* 11 M_SONAME */ \
- "namei", /* 12 M_NAMEI */ \
- "gprof", /* 13 M_GPROF */ \
- "ioctlops", /* 14 M_IOCTLOPS */ \
- "mapmem", /* 15 M_MAPMEM */ \
- "cred", /* 16 M_CRED */ \
- "pgrp", /* 17 M_PGRP */ \
- "session", /* 18 M_SESSION */ \
- "iov", /* 19 M_IOV */ \
- "mount", /* 20 M_MOUNT */ \
- "fhandle", /* 21 M_FHANDLE */ \
- "NFS req", /* 22 M_NFSREQ */ \
- "NFS mount", /* 23 M_NFSMNT */ \
- "NFS node", /* 24 M_NFSNODE */ \
- "vnodes", /* 25 M_VNODE */ \
- "namecache", /* 26 M_CACHE */ \
- "UFS quota", /* 27 M_DQUOT */ \
- "UFS mount", /* 28 M_UFSMNT */ \
- "shm", /* 29 M_SHM */ \
- "VM map", /* 30 M_VMMAP */ \
- "VM mapent", /* 31 M_VMMAPENT */ \
- "VM object", /* 32 M_VMOBJ */ \
- "VM objhash", /* 33 M_VMOBJHASH */ \
- "VM pmap", /* 34 M_VMPMAP */ \
- "VM pvmap", /* 35 M_VMPVENT */ \
- "VM pager", /* 36 M_VMPAGER */ \
- "VM pgdata", /* 37 M_VMPGDATA */ \
- "file", /* 38 M_FILE */ \
- "file desc", /* 39 M_FILEDESC */ \
- "lockf", /* 40 M_LOCKF */ \
- "proc", /* 41 M_PROC */ \
- "subproc", /* 42 M_SUBPROC */ \
- "LFS segment", /* 43 M_SEGMENT */ \
- "LFS node", /* 44 M_LFSNODE */ \
- "FFS node", /* 45 M_FFSNODE */ \
- "MFS node", /* 46 M_MFSNODE */ \
- "NQNFS Lease", /* 47 M_NQLEASE */ \
- "NQNFS Host", /* 48 M_NQMHOST */ \
- "Export Host", /* 49 M_NETADDR */ \
- "NFS srvsock", /* 50 M_NFSSVC */ \
- "NFS uid", /* 51 M_NFSUID */ \
- "NFS daemon", /* 52 M_NFSD */ \
- "ip_moptions", /* 53 M_IPMOPTS */ \
- "in_multi", /* 54 M_IPMADDR */ \
- "ether_multi", /* 55 M_IFMADDR */ \
- "mrt", /* 56 M_MRTABLE */ \
- "ISOFS mount", /* 57 M_ISOFSMNT */ \
- "ISOFS node", /* 58 M_ISOFSNODE */ \
- "NFSV3 srvdesc",/* 59 M_NFSRVDESC */ \
- "NFSV3 diroff", /* 60 M_NFSDIROFF */ \
- "NFSV3 bigfh", /* 61 M_NFSBIGFH */ \
- NULL, \
- NULL, NULL, NULL, NULL, \
- "MSDOSFS mount",/* 67 M_MSDOSFSMNT */ \
- "MSDOSFS node", /* 68 M_MSDOSFSNODE */ \
- "MSDOSFS FAT", /* 69 M_MSDOSFSFAR */ \
- "DEVFS mount", /* 70 M_DEVFSMNT */ \
- "DEVFS back", /* 71 M_DEVFSBACK */ \
- "DEVFS front", /* 72 M_DEVFSFRONT */ \
- "DEVFS node", /* 73 M_DEVFSNODE */ \
- "temp", /* 74 M_TEMP */ \
- "ttys", /* 75 M_TTYS */ \
- "Gzip trees", /* 76 M_GZIP */ \
- "IpFw/IpAcct", /* 77 M_IPFW */ \
- "isa_devlist", /* 78 M_DEVL */ \
- "PktClass", /* 79 M_PKTCLASS */ \
- "sysctl", /* 80 M_SYSCTL */ \
- "key mgmt", /* 81 M_SECA */ \
- "BIO buffer", /* 82 M_BIOBUF */ \
- "KTRACE", /* 83 M_KTRACE */ \
- "select", /* 84 M_SELECT */ \
- "Coda", /* 85 M_CFS */ \
-}
-
-struct kmemstats {
- long ks_inuse; /* # of packets of this type currently in use */
- long ks_calls; /* total packets of this type ever allocated */
- long ks_memuse; /* total memory held in bytes */
- u_short ks_limblocks; /* number of times blocked for hitting limit */
- u_short ks_mapblocks; /* number of times blocked for kernel map */
- long ks_maxused; /* maximum number ever used */
- long ks_limit; /* most that are allowed to exist */
- long ks_size; /* sizes of this thing that are allocated */
- long ks_spare;
-};
-
-/*
- * Array of descriptors that describe the contents of each page
- */
-struct kmemusage {
- short ku_indx; /* bucket index */
- union {
- u_short freecnt;/* for small allocations, free pieces in page */
- u_short pagecnt;/* for large allocations, pages alloced */
- } ku_un;
-};
-#define ku_freecnt ku_un.freecnt
-#define ku_pagecnt ku_un.pagecnt
-
-/*
- * Set of buckets for each size of memory block that is retained
- */
-struct kmembuckets {
- caddr_t kb_next; /* list of free blocks */
- caddr_t kb_last; /* last free block */
- long kb_calls; /* total calls to allocate this size */
- long kb_total; /* total number of blocks allocated */
- long kb_totalfree; /* # of free elements in this bucket */
- long kb_elmpercl; /* # of elements in this sized allocation */
- long kb_highwat; /* high water mark */
- long kb_couldfree; /* over high water mark and could free */
-};
-
-#ifdef KERNEL
-#define MINALLOCSIZE (1 << MINBUCKET)
-#define BUCKETINDX(size) \
- ((size) <= (MINALLOCSIZE * 128) \
- ? (size) <= (MINALLOCSIZE * 8) \
- ? (size) <= (MINALLOCSIZE * 2) \
- ? (size) <= (MINALLOCSIZE * 1) \
- ? (MINBUCKET + 0) \
- : (MINBUCKET + 1) \
- : (size) <= (MINALLOCSIZE * 4) \
- ? (MINBUCKET + 2) \
- : (MINBUCKET + 3) \
- : (size) <= (MINALLOCSIZE* 32) \
- ? (size) <= (MINALLOCSIZE * 16) \
- ? (MINBUCKET + 4) \
- : (MINBUCKET + 5) \
- : (size) <= (MINALLOCSIZE * 64) \
- ? (MINBUCKET + 6) \
- : (MINBUCKET + 7) \
- : (size) <= (MINALLOCSIZE * 2048) \
- ? (size) <= (MINALLOCSIZE * 512) \
- ? (size) <= (MINALLOCSIZE * 256) \
- ? (MINBUCKET + 8) \
- : (MINBUCKET + 9) \
- : (size) <= (MINALLOCSIZE * 1024) \
- ? (MINBUCKET + 10) \
- : (MINBUCKET + 11) \
- : (size) <= (MINALLOCSIZE * 8192) \
- ? (size) <= (MINALLOCSIZE * 4096) \
- ? (MINBUCKET + 12) \
- : (MINBUCKET + 13) \
- : (size) <= (MINALLOCSIZE * 16384) \
- ? (MINBUCKET + 14) \
- : (MINBUCKET + 15))
-
-/*
- * Turn virtual addresses into kmem map indices
- */
-#define kmemxtob(alloc) (kmembase + (alloc) * PAGE_SIZE)
-#define btokmemx(addr) (((caddr_t)(addr) - kmembase) / PAGE_SIZE)
-#define btokup(addr) (&kmemusage[(caddr_t)(addr) - kmembase >> PAGE_SHIFT])
-
-/*
- * Macro versions for the usual cases of malloc/free
- */
-#if defined(KMEMSTATS) || defined(DIAGNOSTIC)
-#define MALLOC(space, cast, size, type, flags) \
- (space) = (cast)malloc((u_long)(size), type, flags)
-#define FREE(addr, type) free((addr), type)
-
-#else /* do not collect statistics */
-#define MALLOC(space, cast, size, type, flags) { \
- register struct kmembuckets *kbp = &bucket[BUCKETINDX(size)]; \
- long s = splimp(); \
- if (kbp->kb_next == NULL) { \
- (space) = (cast)malloc((u_long)(size), type, flags); \
- } else { \
- (space) = (cast)kbp->kb_next; \
- kbp->kb_next = *(caddr_t *)(space); \
- } \
- splx(s); \
-}
-
-#define FREE(addr, type) { \
- register struct kmembuckets *kbp; \
- register struct kmemusage *kup = btokup(addr); \
- long s = splimp(); \
- if (1 << kup->ku_indx > MAXALLOCSAVE) { \
- free((addr), type); \
- } else { \
- kbp = &bucket[kup->ku_indx]; \
- if (kbp->kb_next == NULL) \
- kbp->kb_next = (caddr_t)(addr); \
- else \
- *(caddr_t *)(kbp->kb_last) = (caddr_t)(addr); \
- *(caddr_t *)(addr) = NULL; \
- kbp->kb_last = (caddr_t)(addr); \
- } \
- splx(s); \
-}
-#endif /* do not collect statistics */
-
-extern struct kmemstats kmemstats[];
-extern struct kmemusage *kmemusage;
-extern char *kmembase;
-extern struct kmembuckets bucket[];
-
-void *contigmalloc __P((unsigned long size, int type, int flags,
- unsigned long low, unsigned long high,
- unsigned long alignment, unsigned long boundary));
-void free __P((void *addr, int type));
-void *malloc __P((unsigned long size, int type, int flags));
-#endif /* KERNEL */
-
-#endif /* !_SYS_MALLOC_H_ */
diff --git a/cpukit/libnetworking/sys/mbuf.h b/cpukit/libnetworking/sys/mbuf.h
deleted file mode 100644
index b380b3fca3..0000000000
--- a/cpukit/libnetworking/sys/mbuf.h
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)mbuf.h 8.5 (Berkeley) 2/19/95
- * $Id$
- */
-
-#ifndef _SYS_MBUF_H_
-#define _SYS_MBUF_H_
-
-#ifndef M_WAITOK
-#include <sys/malloc.h>
-#endif
-
-/*
- * Mbufs are of a single size, MSIZE (machine/machparam.h), which
- * includes overhead. An mbuf may add a single "mbuf cluster" of size
- * MCLBYTES (also in machine/machparam.h), which has no additional overhead
- * and is used instead of the internal data area; this is done when
- * at least MINCLSIZE of data must be stored.
- */
-
-#define MLEN (MSIZE - sizeof(struct m_hdr)) /* normal data len */
-#define MHLEN (MLEN - sizeof(struct pkthdr)) /* data len w/pkthdr */
-
-#define MINCLSIZE (MHLEN + MLEN) /* smallest amount to put in cluster */
-#define M_MAXCOMPRESS (MHLEN / 2) /* max amount to copy for compression */
-
-/*
- * Macros for type conversion
- * mtod(m,t) - convert mbuf pointer to data pointer of correct type
- * dtom(x) - convert data pointer within mbuf to mbuf pointer (XXX)
- * mtocl(x) - convert pointer within cluster to cluster index #
- * cltom(x) - convert cluster # to ptr to beginning of cluster
- */
-#define mtod(m,t) ((t)((m)->m_data))
-#define dtom(x) ((struct mbuf *)((long)(x) & ~(MSIZE-1)))
-#define mtocl(x) (((u_long)(x) - (u_long)mbutl) >> MCLSHIFT)
-#define cltom(x) ((caddr_t)((u_long)mbutl + ((u_long)(x) << MCLSHIFT)))
-
-/* header at beginning of each mbuf: */
-struct m_hdr {
- struct mbuf *mh_next; /* next buffer in chain */
- struct mbuf *mh_nextpkt; /* next chain in queue/record */
- caddr_t mh_data; /* location of data */
- int mh_len; /* amount of data in this mbuf */
- short mh_type; /* type of data in this mbuf */
- short mh_flags; /* flags; see below */
-};
-
-/* record/packet header in first mbuf of chain; valid if M_PKTHDR set */
-struct pkthdr {
- struct ifnet *rcvif; /* rcv interface */
- int len; /* total packet length */
-};
-
-/* description of external storage mapped into mbuf, valid if M_EXT set */
-struct m_ext {
- caddr_t ext_buf; /* start of buffer */
- void (*ext_free) /* free routine if not the usual */
- __P((caddr_t, u_int));
- u_int ext_size; /* size of buffer, for ext_free */
- void (*ext_ref) /* add a reference to the ext object */
- __P((caddr_t, u_int));
-};
-
-struct mbuf {
- struct m_hdr m_hdr;
- union {
- struct {
- struct pkthdr MH_pkthdr; /* M_PKTHDR set */
- union {
- struct m_ext MH_ext; /* M_EXT set */
- char MH_databuf[MHLEN];
- } MH_dat;
- } MH;
- char M_databuf[MLEN]; /* !M_PKTHDR, !M_EXT */
- } M_dat;
-};
-#define m_next m_hdr.mh_next
-#define m_len m_hdr.mh_len
-#define m_data m_hdr.mh_data
-#define m_type m_hdr.mh_type
-#define m_flags m_hdr.mh_flags
-#define m_nextpkt m_hdr.mh_nextpkt
-#define m_act m_nextpkt
-#define m_pkthdr M_dat.MH.MH_pkthdr
-#define m_ext M_dat.MH.MH_dat.MH_ext
-#define m_pktdat M_dat.MH.MH_dat.MH_databuf
-#define m_dat M_dat.M_databuf
-
-/* mbuf flags */
-#define M_EXT 0x0001 /* has associated external storage */
-#define M_PKTHDR 0x0002 /* start of record */
-#define M_EOR 0x0004 /* end of record */
-#define M_PROTO1 0x0008 /* protocol-specific */
-
-/* mbuf pkthdr flags, also in m_flags */
-#define M_BCAST 0x0100 /* send/received as link-level broadcast */
-#define M_MCAST 0x0200 /* send/received as link-level multicast */
-
-/* flags copied when copying m_pkthdr */
-#define M_COPYFLAGS (M_PKTHDR|M_EOR|M_PROTO1|M_BCAST|M_MCAST)
-
-/* mbuf types */
-#define MT_FREE 0 /* should be on free list */
-#define MT_DATA 1 /* dynamic (data) allocation */
-#define MT_HEADER 2 /* packet header */
-#define MT_SOCKET 3 /* socket structure */
-#define MT_PCB 4 /* protocol control block */
-#define MT_RTABLE 5 /* routing tables */
-#define MT_HTABLE 6 /* IMP host tables */
-#define MT_ATABLE 7 /* address resolution tables */
-#define MT_SONAME 8 /* socket name */
-#define MT_SOOPTS 10 /* socket options */
-#define MT_FTABLE 11 /* fragment reassembly header */
-#define MT_RIGHTS 12 /* access rights */
-#define MT_IFADDR 13 /* interface address */
-#define MT_CONTROL 14 /* extra-data protocol message */
-#define MT_OOBDATA 15 /* expedited data */
-
-/* flags to m_get/MGET */
-#define M_DONTWAIT M_NOWAIT
-#define M_WAIT M_WAITOK
-
-/* Freelists:
- *
- * Normal mbuf clusters are normally treated as character arrays
- * after allocation, but use the first word of the buffer as a free list
- * pointer while on the free list.
- */
-union mcluster {
- union mcluster *mcl_next;
- char mcl_buf[MCLBYTES];
-};
-
-/*
- * mbuf utility macros:
- *
- * MBUFLOCK(code)
- * prevents a section of code from from being interrupted by network
- * drivers.
- */
-#define MBUFLOCK(code) \
- { int ms = splimp(); \
- { code } \
- splx(ms); \
- }
-
-/*
- * mbuf allocation/deallocation macros:
- *
- * MGET(struct mbuf *m, int how, int type)
- * allocates an mbuf and initializes it to contain internal data.
- *
- * MGETHDR(struct mbuf *m, int how, int type)
- * allocates an mbuf and initializes it to contain a packet header
- * and internal data.
- */
-#define MGET(m, how, type) { \
- int _ms = splimp(); \
- if (mmbfree == 0) \
- (void)m_mballoc(1, (how)); \
- if (((m) = mmbfree) != 0) { \
- mmbfree = (m)->m_next; \
- mbstat.m_mtypes[MT_FREE]--; \
- (m)->m_type = (type); \
- mbstat.m_mtypes[type]++; \
- (m)->m_next = (struct mbuf *)NULL; \
- (m)->m_nextpkt = (struct mbuf *)NULL; \
- (m)->m_data = (m)->m_dat; \
- (m)->m_flags = 0; \
- splx(_ms); \
- } else { \
- splx(_ms); \
- (m) = m_retry((how), (type)); \
- } \
-}
-
-#define MGETHDR(m, how, type) { \
- int _ms = splimp(); \
- if (mmbfree == 0) \
- (void)m_mballoc(1, (how)); \
- if (((m) = mmbfree) != 0) { \
- mmbfree = (m)->m_next; \
- mbstat.m_mtypes[MT_FREE]--; \
- (m)->m_type = (type); \
- mbstat.m_mtypes[type]++; \
- (m)->m_next = (struct mbuf *)NULL; \
- (m)->m_nextpkt = (struct mbuf *)NULL; \
- (m)->m_data = (m)->m_pktdat; \
- (m)->m_flags = M_PKTHDR; \
- splx(_ms); \
- } else { \
- splx(_ms); \
- (m) = m_retryhdr((how), (type)); \
- } \
-}
-
-/*
- * Mbuf cluster macros.
- * MCLALLOC(caddr_t p, int how) allocates an mbuf cluster.
- * MCLGET adds such clusters to a normal mbuf;
- * the flag M_EXT is set upon success.
- * MCLFREE releases a reference to a cluster allocated by MCLALLOC,
- * freeing the cluster if the reference count has reached 0.
- */
-#define MCLALLOC(p, how) \
- MBUFLOCK( \
- if (mclfree == 0) \
- (void)m_clalloc(1, (how)); \
- if (((p) = (caddr_t)mclfree) != 0) { \
- ++mclrefcnt[mtocl(p)]; \
- mbstat.m_clfree--; \
- mclfree = ((union mcluster *)(p))->mcl_next; \
- } \
- )
-
-#define MCLGET(m, how) \
- { MCLALLOC((m)->m_ext.ext_buf, (how)); \
- if ((m)->m_ext.ext_buf != NULL) { \
- (m)->m_data = (m)->m_ext.ext_buf; \
- (m)->m_flags |= M_EXT; \
- (m)->m_ext.ext_free = NULL; \
- (m)->m_ext.ext_ref = NULL; \
- (m)->m_ext.ext_size = MCLBYTES; \
- } \
- }
-
-#define MCLFREE(p) \
- MBUFLOCK ( \
- if (--mclrefcnt[mtocl(p)] == 0) { \
- ((union mcluster *)(p))->mcl_next = mclfree; \
- mclfree = (union mcluster *)(p); \
- mbstat.m_clfree++; \
- } \
- )
-
-/*
- * MFREE(struct mbuf *m, struct mbuf *n)
- * Free a single mbuf and associated external storage.
- * Place the successor, if any, in n.
- */
-#define MFREE(m, n) \
- MBUFLOCK( \
- mbstat.m_mtypes[(m)->m_type]--; \
- if ((m)->m_flags & M_EXT) { \
- if ((m)->m_ext.ext_free) \
- (*((m)->m_ext.ext_free))((m)->m_ext.ext_buf, \
- (m)->m_ext.ext_size); \
- else { \
- char *p = (m)->m_ext.ext_buf; \
- if (--mclrefcnt[mtocl(p)] == 0) { \
- ((union mcluster *)(p))->mcl_next = mclfree; \
- mclfree = (union mcluster *)(p); \
- mbstat.m_clfree++; \
- } \
- } \
- } \
- (n) = (m)->m_next; \
- (m)->m_type = MT_FREE; \
- mbstat.m_mtypes[MT_FREE]++; \
- (m)->m_next = mmbfree; \
- mmbfree = (m); \
- )
-
-/*
- * Copy mbuf pkthdr from from to to.
- * from must have M_PKTHDR set, and to must be empty.
- */
-#define M_COPY_PKTHDR(to, from) { \
- (to)->m_pkthdr = (from)->m_pkthdr; \
- (to)->m_flags = (from)->m_flags & M_COPYFLAGS; \
- (to)->m_data = (to)->m_pktdat; \
-}
-
-/*
- * Set the m_data pointer of a newly-allocated mbuf (m_get/MGET) to place
- * an object of the specified size at the end of the mbuf, longword aligned.
- */
-#define M_ALIGN(m, len) \
- { (m)->m_data += (MLEN - (len)) &~ (sizeof(long) - 1); }
-/*
- * As above, for mbufs allocated with m_gethdr/MGETHDR
- * or initialized by M_COPY_PKTHDR.
- */
-#define MH_ALIGN(m, len) \
- { (m)->m_data += (MHLEN - (len)) &~ (sizeof(long) - 1); }
-
-/*
- * Compute the amount of space available
- * before the current start of data in an mbuf.
- */
-#define M_LEADINGSPACE(m) \
- ((m)->m_flags & M_EXT ? /* (m)->m_data - (m)->m_ext.ext_buf */ 0 : \
- (m)->m_flags & M_PKTHDR ? (m)->m_data - (m)->m_pktdat : \
- (m)->m_data - (m)->m_dat)
-
-/*
- * Compute the amount of space available
- * after the end of data in an mbuf.
- */
-#define M_TRAILINGSPACE(m) \
- ((m)->m_flags & M_EXT ? (m)->m_ext.ext_buf + (m)->m_ext.ext_size - \
- ((m)->m_data + (m)->m_len) : \
- &(m)->m_dat[MLEN] - ((m)->m_data + (m)->m_len))
-
-/*
- * Arrange to prepend space of size plen to mbuf m.
- * If a new mbuf must be allocated, how specifies whether to wait.
- * If how is M_DONTWAIT and allocation fails, the original mbuf chain
- * is freed and m is set to NULL.
- */
-#define M_PREPEND(m, plen, how) { \
- if (M_LEADINGSPACE(m) >= (plen)) { \
- (m)->m_data -= (plen); \
- (m)->m_len += (plen); \
- } else \
- (m) = m_prepend((m), (plen), (how)); \
- if ((m) && (m)->m_flags & M_PKTHDR) \
- (m)->m_pkthdr.len += (plen); \
-}
-
-/* change mbuf to new type */
-#define MCHTYPE(m, t) { \
- MBUFLOCK(mbstat.m_mtypes[(m)->m_type]--; mbstat.m_mtypes[t]++;) \
- (m)->m_type = t;\
-}
-
-/* length to m_copy to copy all */
-#define M_COPYALL 1000000000
-
-/* compatibility with 4.3 */
-#define m_copy(m, o, l) m_copym((m), (o), (l), M_DONTWAIT)
-
-/*
- * Mbuf statistics.
- */
-struct mbstat {
- u_long m_mbufs; /* mbufs obtained from page pool */
- u_long m_clusters; /* clusters obtained from page pool */
- u_long m_spare; /* spare field */
- u_long m_clfree; /* free clusters */
- u_long m_drops; /* times failed to find space */
- u_long m_wait; /* times waited for space */
- u_long m_drain; /* times drained protocols for space */
- u_short m_mtypes[256]; /* type specific mbuf allocations */
-};
-
-#ifdef KERNEL
-extern struct mbuf *mbutl; /* virtual address of mclusters */
-extern char *mclrefcnt; /* cluster reference counts */
-extern struct mbstat mbstat;
-extern int nmbclusters;
-extern int nmbufs;
-extern struct mbuf *mmbfree;
-extern union mcluster *mclfree;
-extern int max_linkhdr; /* largest link-level header */
-extern int max_protohdr; /* largest protocol header */
-extern int max_hdr; /* largest link+protocol header */
-extern int max_datalen; /* MHLEN - max_hdr */
-extern int mbtypes[]; /* XXX */
-
-struct mbuf *m_copym __P((struct mbuf *, int, int, int));
-struct mbuf *m_copypacket __P((struct mbuf *, int));
-struct mbuf *m_devget __P((char *, int, int, struct ifnet *,
- void (*copy)(char *, caddr_t, u_int)));
-struct mbuf *m_free __P((struct mbuf *));
-struct mbuf *m_get __P((int, int));
-struct mbuf *m_getclr __P((int, int));
-struct mbuf *m_gethdr __P((int, int));
-struct mbuf *m_prepend __P((struct mbuf *,int,int));
-struct mbuf *m_pullup __P((struct mbuf *, int));
-struct mbuf *m_retry __P((int, int));
-struct mbuf *m_retryhdr __P((int, int));
-struct mbuf *m_split __P((struct mbuf *,int,int));
-void m_adj __P((struct mbuf *, int));
-void m_cat __P((struct mbuf *,struct mbuf *));
-int m_mballoc __P((int, int));
-int m_clalloc __P((int, int));
-void m_copyback __P((struct mbuf *, int, int, caddr_t));
-void m_copydata __P((struct mbuf *,int,int,caddr_t));
-void m_freem __P((struct mbuf *));
-
-#ifdef MBTYPES
-int mbtypes[] = { /* XXX */
- M_FREE, /* MT_FREE 0 should be on free list */
- M_MBUF, /* MT_DATA 1 dynamic (data) allocation */
- M_MBUF, /* MT_HEADER 2 packet header */
- M_SOCKET, /* MT_SOCKET 3 socket structure */
- M_PCB, /* MT_PCB 4 protocol control block */
- M_RTABLE, /* MT_RTABLE 5 routing tables */
- M_HTABLE, /* MT_HTABLE 6 IMP host tables */
- 0, /* MT_ATABLE 7 address resolution tables */
- M_MBUF, /* MT_SONAME 8 socket name */
- 0, /* 9 */
- M_SOOPTS, /* MT_SOOPTS 10 socket options */
- M_FTABLE, /* MT_FTABLE 11 fragment reassembly header */
- M_MBUF, /* MT_RIGHTS 12 access rights */
- M_IFADDR, /* MT_IFADDR 13 interface address */
- M_MBUF, /* MT_CONTROL 14 extra-data protocol message */
- M_MBUF, /* MT_OOBDATA 15 expedited data */
-#ifdef DATAKIT
- 25, 26, 27, 28, 29, 30, 31, 32 /* datakit ugliness */
-#endif
-};
-#endif
-#endif
-
-#endif /* !_SYS_MBUF_H_ */
diff --git a/cpukit/libnetworking/sys/mount.h b/cpukit/libnetworking/sys/mount.h
deleted file mode 100644
index a6254e302d..0000000000
--- a/cpukit/libnetworking/sys/mount.h
+++ /dev/null
@@ -1,531 +0,0 @@
-/*
- * Copyright (c) 1989, 1991, 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.
- *
- * @(#)mount.h 8.13 (Berkeley) 3/27/94
- * $Id$
- */
-
-#ifndef _SYS_MOUNT_H_
-#define _SYS_MOUNT_H_
-
-#ifndef KERNEL
-#include <sys/ucred.h>
-#endif
-#include <sys/queue.h>
-
-typedef struct fsid { long val[2]; } fsid_t; /* file system id type */
-
-/*
- * File identifier.
- * These are unique per filesystem on a single machine.
- */
-#define MAXFIDSZ 16
-
-struct fid {
- u_short fid_len; /* length of data in bytes */
- u_short fid_reserved; /* force longword alignment */
- char fid_data[MAXFIDSZ]; /* data (variable length) */
-};
-
-/*
- * file system statistics
- */
-
-#define MNAMELEN 90 /* length of buffer for returned name */
-
-struct statfs {
- long f_spare2; /* placeholder */
- long f_bsize; /* fundamental file system block size */
- long f_iosize; /* optimal transfer block size */
- long f_blocks; /* total data blocks in file system */
- long f_bfree; /* free blocks in fs */
- long f_bavail; /* free blocks avail to non-superuser */
- long f_files; /* total file nodes in file system */
- long f_ffree; /* free file nodes in fs */
- fsid_t f_fsid; /* file system id */
- uid_t f_owner; /* user that mounted the filesystem */
- int f_type; /* type of filesystem (see below) */
- int f_flags; /* copy of mount flags */
- long f_spare[6]; /* spare for later */
- char f_mntonname[MNAMELEN]; /* directory on which mounted */
- char f_mntfromname[MNAMELEN];/* mounted filesystem */
-};
-
-/*
- * File system types.
- */
-#define MOUNT_NONE 0
-#define MOUNT_UFS 1 /* Fast Filesystem */
-#define MOUNT_NFS 2 /* Sun-compatible Network Filesystem */
-#define MOUNT_MFS 3 /* Memory-based Filesystem */
-#define MOUNT_MSDOS 4 /* MS/DOS Filesystem */
-#define MOUNT_LFS 5 /* Log-based Filesystem */
-#define MOUNT_LOFS 6 /* Loopback Filesystem */
-#define MOUNT_FDESC 7 /* File Descriptor Filesystem */
-#define MOUNT_PORTAL 8 /* Portal Filesystem */
-#define MOUNT_NULL 9 /* Minimal Filesystem Layer */
-#define MOUNT_UMAP 10 /* User/Group Identifier Remapping Filesystem */
-#define MOUNT_KERNFS 11 /* Kernel Information Filesystem */
-#define MOUNT_PROCFS 12 /* /proc Filesystem */
-#define MOUNT_AFS 13 /* Andrew Filesystem */
-#define MOUNT_CD9660 14 /* ISO9660 (aka CDROM) Filesystem */
-#define MOUNT_UNION 15 /* Union (translucent) Filesystem */
-#define MOUNT_DEVFS 16 /* existing device Filesystem */
-#define MOUNT_EXT2FS 17 /* Linux EXT2FS */
-#define MOUNT_TFS 18 /* Netcon Novell filesystem */
-#define MOUNT_CFS 19 /* Coda filesystem */
-#define MOUNT_MAXTYPE 19
-
-#define INITMOUNTNAMES { \
- "none", /* 0 MOUNT_NONE */ \
- "ufs", /* 1 MOUNT_UFS */ \
- "nfs", /* 2 MOUNT_NFS */ \
- "mfs", /* 3 MOUNT_MFS */ \
- "msdos", /* 4 MOUNT_MSDOS */ \
- "lfs", /* 5 MOUNT_LFS */ \
- "lofs", /* 6 MOUNT_LOFS */ \
- "fdesc", /* 7 MOUNT_FDESC */ \
- "portal", /* 8 MOUNT_PORTAL */ \
- "null", /* 9 MOUNT_NULL */ \
- "umap", /* 10 MOUNT_UMAP */ \
- "kernfs", /* 11 MOUNT_KERNFS */ \
- "procfs", /* 12 MOUNT_PROCFS */ \
- "afs", /* 13 MOUNT_AFS */ \
- "cd9660", /* 14 MOUNT_CD9660 */ \
- "union", /* 15 MOUNT_UNION */ \
- "devfs", /* 16 MOUNT_DEVFS */ \
- "ext2fs", /* 17 MOUNT_EXT2FS */ \
- "tfs", /* 18 MOUNT_TFS */ \
- "cfs", /* 19 MOUNT_CFS */ \
- 0, /* 20 MOUNT_SPARE */ \
-}
-
-/*
- * Structure per mounted file system. Each mounted file system has an
- * array of operations and an instance record. The file systems are
- * put on a doubly linked list.
- */
-LIST_HEAD(vnodelst, vnode);
-
-struct mount {
- CIRCLEQ_ENTRY(mount) mnt_list; /* mount list */
- struct vfsops *mnt_op; /* operations on fs */
- struct vfsconf *mnt_vfc; /* configuration info */
- struct vnode *mnt_vnodecovered; /* vnode we mounted on */
- struct vnodelst mnt_vnodelist; /* list of vnodes this mount */
- int mnt_flag; /* flags */
- int mnt_maxsymlinklen; /* max size of short symlink */
- struct statfs mnt_stat; /* cache of filesystem stats */
- qaddr_t mnt_data; /* private data */
-/* struct vfsconf *mnt_vfc; */ /* configuration info */
- time_t mnt_time; /* last time written*/
-};
-
-/*
- * Mount flags.
- *
- * Unmount uses MNT_FORCE flag.
- */
-#define MNT_RDONLY 0x00000001 /* read only filesystem */
-#define MNT_SYNCHRONOUS 0x00000002 /* file system written synchronously */
-#define MNT_NOEXEC 0x00000004 /* can't exec from filesystem */
-#define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */
-#define MNT_NODEV 0x00000010 /* don't interpret special files */
-#define MNT_UNION 0x00000020 /* union with underlying filesystem */
-#define MNT_ASYNC 0x00000040 /* file system written asynchronously */
-#define MNT_NOATIME 0x10000000 /* Disable update of file access times */
-
-/*
- * exported mount flags.
- */
-#define MNT_EXRDONLY 0x00000080 /* exported read only */
-#define MNT_EXPORTED 0x00000100 /* file system is exported */
-#define MNT_DEFEXPORTED 0x00000200 /* exported to the world */
-#define MNT_EXPORTANON 0x00000400 /* use anon uid mapping for everyone */
-#define MNT_EXKERB 0x00000800 /* exported with Kerberos uid mapping */
-
-/*
- * Flags set by internal operations.
- */
-#define MNT_LOCAL 0x00001000 /* filesystem is stored locally */
-#define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */
-#define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */
-#define MNT_USER 0x00008000 /* mounted by a user */
-
-/*
- * Mask of flags that are visible to statfs()
- */
-#define MNT_VISFLAGMASK (MNT_RDONLY|MNT_SYNCHRONOUS|MNT_NOEXEC|MNT_NOSUID| \
- MNT_NODEV|MNT_UNION|MNT_ASYNC|MNT_EXRDONLY|MNT_EXPORTED| \
- MNT_DEFEXPORTED|MNT_EXPORTANON|MNT_EXKERB|MNT_LOCAL| \
- MNT_QUOTA|MNT_ROOTFS|MNT_USER|MNT_NOATIME)
-
-/*
- * filesystem control flags.
- *
- * MNT_MLOCK lock the mount entry so that name lookup cannot proceed
- * past the mount point. This keeps the subtree stable during mounts
- * and unmounts.
- */
-#define MNT_UPDATE 0x00010000 /* not a real mount, just an update */
-#define MNT_DELEXPORT 0x00020000 /* delete export host lists */
-#define MNT_RELOAD 0x00040000 /* reload filesystem data */
-#define MNT_FORCE 0x00080000 /* force unmount or readonly change */
-#define MNT_MLOCK 0x00100000 /* lock so that subtree is stable */
-#define MNT_MWAIT 0x00200000 /* someone is waiting for lock */
-#define MNT_MPBUSY 0x00400000 /* scan of mount point in progress */
-#define MNT_MPWANT 0x00800000 /* waiting for mount point */
-#define MNT_UNMOUNT 0x01000000 /* unmount in progress */
-#define MNT_WANTRDWR 0x02000000 /* want upgrade to read/write */
-
-/*
- * used to get configured filesystems information
- */
-#define VFS_MAXNAMELEN 32
-struct vfsconf {
- void *vfc_vfsops;
- char vfc_name[VFS_MAXNAMELEN];
- int vfc_index;
- int vfc_refcount;
- int vfc_flags;
-};
-
-/*
- * NB: these flags refer to IMPLEMENTATION properties, not properties of
- * any actual mounts; i.e., it does not make sense to change the flags.
- */
-#define VFCF_STATIC 0x00000001 /* statically compiled into kernel */
-#define VFCF_NETWORK 0x00000002 /* may get data over the network */
-#define VFCF_READONLY 0x00000004 /* writes are not implemented */
-#define VFCF_SYNTHETIC 0x00000008 /* data does not represent real files */
-#define VFCF_LOOPBACK 0x00000010 /* aliases some other mounted FS */
-#define VFCF_UNICODE 0x00000020 /* stores file names as Unicode*/
-
-/*
- * Operations supported on mounted file system.
- */
-#ifdef KERNEL
-
-extern int doforce; /* Flag to permit forcible unmounting. */
-extern struct vfsconf void_vfsconf;
-extern struct vfsconf *vfsconf[];
-
-#ifdef __STDC__
-struct nameidata;
-struct mbuf;
-#endif
-
-struct vfsops {
- int (*vfs_mount) __P((struct mount *mp, char *path, caddr_t data,
- struct nameidata *ndp, struct proc *p));
- int (*vfs_start) __P((struct mount *mp, int flags,
- struct proc *p));
- int (*vfs_unmount) __P((struct mount *mp, int mntflags,
- struct proc *p));
- int (*vfs_root) __P((struct mount *mp, struct vnode **vpp));
- int (*vfs_quotactl) __P((struct mount *mp, int cmds, uid_t uid,
- caddr_t arg, struct proc *p));
- int (*vfs_statfs) __P((struct mount *mp, struct statfs *sbp,
- struct proc *p));
- int (*vfs_sync) __P((struct mount *mp, int waitfor,
- struct ucred *cred, struct proc *p));
- int (*vfs_vget) __P((struct mount *mp, ino_t ino,
- struct vnode **vpp));
- int (*vfs_fhtovp) __P((struct mount *mp, struct fid *fhp,
- struct mbuf *nam, struct vnode **vpp,
- int *exflagsp, struct ucred **credanonp));
- int (*vfs_vptofh) __P((struct vnode *vp, struct fid *fhp));
- int (*vfs_init) __P((void));
-};
-
-#define VFS_MOUNT(MP, PATH, DATA, NDP, P) \
- (*(MP)->mnt_op->vfs_mount)(MP, PATH, DATA, NDP, P)
-#define VFS_START(MP, FLAGS, P) (*(MP)->mnt_op->vfs_start)(MP, FLAGS, P)
-#define VFS_UNMOUNT(MP, FORCE, P) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE, P)
-#define VFS_ROOT(MP, VPP) (*(MP)->mnt_op->vfs_root)(MP, VPP)
-#define VFS_QUOTACTL(MP,C,U,A,P) (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A, P)
-#define VFS_STATFS(MP, SBP, P) (*(MP)->mnt_op->vfs_statfs)(MP, SBP, P)
-#define VFS_SYNC(MP, WAIT, C, P) (*(MP)->mnt_op->vfs_sync)(MP, WAIT, C, P)
-#define VFS_VGET(MP, INO, VPP) (*(MP)->mnt_op->vfs_vget)(MP, INO, VPP)
-#define VFS_FHTOVP(MP, FIDP, NAM, VPP, EXFLG, CRED) \
- (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, NAM, VPP, EXFLG, CRED)
-#define VFS_VPTOFH(VP, FIDP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP)
-
-#ifdef VFS_LKM
-#include <sys/conf.h>
-#include <sys/exec.h>
-#include <sys/sysent.h>
-#include <sys/lkm.h>
-
-#define VFS_SET(vfsops, fsname, index, flags) \
- static struct vfsconf _fs_vfsconf = { \
- &vfsops, \
- #fsname, \
- index, \
- 0, \
- flags \
- }; \
- extern struct linker_set MODVNOPS; \
- MOD_VFS(#fsname,index,&MODVNOPS,&_fs_vfsconf); \
- int \
- fsname ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \
- DISPATCH(lkmtp, cmd, ver, lkm_nullcmd, lkm_nullcmd, lkm_nullcmd); }
-#else
-
-#define VFS_SET(vfsops, fsname, index, flags) \
- static struct vfsconf _fs_vfsconf = { \
- &vfsops, \
- #fsname, \
- index, \
- 0, \
- flags | VFCF_STATIC \
- }; \
- DATA_SET(vfs_set,_fs_vfsconf)
-#endif /* VFS_LKM */
-
-#endif /* KERNEL */
-
-/*
- * Flags for various system call interfaces.
- *
- * waitfor flags to vfs_sync() and getfsstat()
- */
-#define MNT_WAIT 1
-#define MNT_NOWAIT 2
-
-/*
- * Generic file handle
- */
-struct fhandle {
- fsid_t fh_fsid; /* File system id of mount point */
- struct fid fh_fid; /* File sys specific id */
-};
-typedef struct fhandle fhandle_t;
-
-#ifdef KERNEL
-#include <net/radix.h>
-#include <sys/socket.h> /* XXX for AF_MAX */
-
-/*
- * Network address lookup element
- */
-struct netcred {
- struct radix_node netc_rnodes[2];
- int netc_exflags;
- struct ucred netc_anon;
-};
-
-/*
- * Network export information
- */
-struct netexport {
- struct netcred ne_defexported; /* Default export */
- struct radix_node_head *ne_rtable[AF_MAX+1]; /* Individual exports */
-};
-#endif /* KERNEL */
-
-/*
- * Export arguments for local filesystem mount calls.
- */
-struct export_args {
- int ex_flags; /* export related flags */
- uid_t ex_root; /* mapping for root uid */
- struct ucred ex_anon; /* mapping for anonymous user */
- struct sockaddr *ex_addr; /* net address to which exported */
- int ex_addrlen; /* and the net address length */
- struct sockaddr *ex_mask; /* mask of valid bits in saddr */
- int ex_masklen; /* and the smask length */
-};
-
-/*
- * Arguments to mount UFS-based filesystems
- */
-struct ufs_args {
- char *fspec; /* block special device to mount */
- struct export_args export; /* network export information */
-};
-
-#ifdef MFS
-/*
- * Arguments to mount MFS
- */
-struct mfs_args {
- char *fspec; /* name to export for statfs */
- struct export_args export; /* if exported MFSes are supported */
- caddr_t base; /* base of file system in memory */
- u_long size; /* size of file system */
-};
-#endif /* MFS */
-
-#ifdef MSDOSFS
-/*
- * Arguments to mount MSDOS filesystems.
- */
-struct msdosfs_args {
- char *fspec; /* blocks special holding the fs to mount */
- struct export_args export; /* network export information */
- uid_t uid; /* uid that owns msdosfs files */
- gid_t gid; /* gid that owns msdosfs files */
- mode_t mask; /* mask to be applied for msdosfs perms */
-};
-#endif
-
-#ifdef CD9660
-/*
- * Arguments to mount ISO 9660 filesystems.
- */
-struct iso_args {
- char *fspec; /* block special device to mount */
- struct export_args export; /* network export info */
- int flags; /* mounting flags, see below */
- int ssector; /* starting sector */
-
-};
-#define ISOFSMNT_NORRIP 0x00000001 /* disable Rock Ridge Ext.*/
-#define ISOFSMNT_GENS 0x00000002 /* enable generation numbers */
-#define ISOFSMNT_EXTATT 0x00000004 /* enable extended attributes */
-#endif /* CD9660 */
-
-#ifdef NFS
-/*
- * Arguments to mount NFS
- */
-struct nfs_args {
- struct sockaddr *addr; /* file server address */
- int addrlen; /* length of address */
- int sotype; /* Socket type */
- int proto; /* and Protocol */
- u_char *fh; /* File handle to be mounted */
- int fhsize; /* Size, in bytes, of fh */
- int flags; /* flags */
- int wsize; /* write size in bytes */
- int rsize; /* read size in bytes */
- int readdirsize; /* readdir size in bytes */
- int timeo; /* initial timeout in .1 secs */
- int retrans; /* times to retry send */
- int maxgrouplist; /* Max. size of group list */
- int readahead; /* # of blocks to readahead */
- int leaseterm; /* Term (sec) of lease */
- int deadthresh; /* Retrans threshold */
- char *hostname; /* server's name */
-};
-
-/*
- * NFS mount option flags
- */
-#define NFSMNT_SOFT 0x00000001 /* soft mount (hard is default) */
-#define NFSMNT_WSIZE 0x00000002 /* set write size */
-#define NFSMNT_RSIZE 0x00000004 /* set read size */
-#define NFSMNT_TIMEO 0x00000008 /* set initial timeout */
-#define NFSMNT_RETRANS 0x00000010 /* set number of request retrys */
-#define NFSMNT_MAXGRPS 0x00000020 /* set maximum grouplist size */
-#define NFSMNT_INT 0x00000040 /* allow interrupts on hard mount */
-#define NFSMNT_NOCONN 0x00000080 /* Don't Connect the socket */
-#define NFSMNT_NQNFS 0x00000100 /* Use Nqnfs protocol */
-#define NFSMNT_NFSV3 0x00000200 /* Use NFS Version 3 protocol */
-#define NFSMNT_KERB 0x00000400 /* Use Kerberos authentication */
-#define NFSMNT_DUMBTIMR 0x00000800 /* Don't estimate rtt dynamically */
-#define NFSMNT_LEASETERM 0x00001000 /* set lease term (nqnfs) */
-#define NFSMNT_READAHEAD 0x00002000 /* set read ahead */
-#define NFSMNT_DEADTHRESH 0x00004000 /* set dead server retry thresh */
-#define NFSMNT_RESVPORT 0x00008000 /* Allocate a reserved port */
-#define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */
-#define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */
-#define NFSMNT_INTERNAL 0xfffc0000 /* Bits set internally */
-#define NFSMNT_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */
-#define NFSMNT_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */
-#define NFSMNT_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */
-#define NFSMNT_MNTD 0x00200000 /* Mnt server for mnt point */
-#define NFSMNT_DISMINPROG 0x00400000 /* Dismount in progress */
-#define NFSMNT_DISMNT 0x00800000 /* Dismounted */
-#define NFSMNT_SNDLOCK 0x01000000 /* Send socket lock */
-#define NFSMNT_WANTSND 0x02000000 /* Want above */
-#define NFSMNT_RCVLOCK 0x04000000 /* Rcv socket lock */
-#define NFSMNT_WANTRCV 0x08000000 /* Want above */
-#define NFSMNT_WAITAUTH 0x10000000 /* Wait for authentication */
-#define NFSMNT_HASAUTH 0x20000000 /* Has authenticator */
-#define NFSMNT_WANTAUTH 0x40000000 /* Wants an authenticator */
-#define NFSMNT_AUTHERR 0x80000000 /* Authentication error */
-#endif /* NFS */
-
-#ifdef KERNEL
-extern int (*mountroot) __P((void *));
-extern struct vfsops *mountrootvfsops;
-
-/*
- * exported vnode operations
- */
-int dounmount __P((struct mount *, int, struct proc *));
-struct mount *getvfs __P((fsid_t *)); /* return vfs given fsid */
-void getnewfsid __P((struct mount *, int));
-int vflush __P((struct mount *, struct vnode *, int));
-int vfs_export /* process mount export info */
- __P((struct mount *, struct netexport *, struct export_args *));
-struct netcred *vfs_export_lookup /* lookup host in fs export list */
- __P((struct mount *, struct netexport *, struct mbuf *));
-int vfs_lock __P((struct mount *)); /* lock a vfs */
-int vfs_mountedon __P((struct vnode *)); /* is a vfs mounted on vp */
-int vfs_mountroot __P((void *)); /* XXX goes away? */
-void vfs_msync __P((struct mount *, int));
-void vfs_unlock __P((struct mount *)); /* unlock a vfs */
-void vfs_unmountall __P((void));
-int vfs_busy __P((struct mount *)); /* mark a vfs busy */
-void vfs_unbusy __P((struct mount *)); /* mark a vfs not busy */
-extern CIRCLEQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */
-extern struct vfsops *vfssw[]; /* filesystem type table */
-
-#else /* KERNEL */
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int fstatfs __P((int, struct statfs *));
-int getfh __P((const char *, fhandle_t *));
-int getfsstat __P((struct statfs *, long, int));
-int getmntinfo __P((struct statfs **, int));
-int mount __P((int, const char *, int, void *));
-int statfs __P((const char *, struct statfs *));
-int unmount __P((const char *, int));
-
-/* C library stuff */
-struct vfsconf *getvfsbyname __P((const char *));
-struct vfsconf *getvfsbytype __P((int));
-struct vfsconf *getvfsent __P((void));
-void setvfsent __P((int));
-void endvfsent __P((void));
-int vfsisloadable __P((const char *));
-int vfsload __P((const char *));
-__END_DECLS
-
-#endif /* KERNEL */
-
-#endif /* !_SYS_MOUNT_H_ */
diff --git a/cpukit/libnetworking/sys/param.h b/cpukit/libnetworking/sys/param.h
deleted file mode 100644
index 21a9758520..0000000000
--- a/cpukit/libnetworking/sys/param.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)param.h 8.3 (Berkeley) 4/4/95
- * $Id$
- */
-
-#ifndef _SYS_PARAM_H_
-#define _SYS_PARAM_H_
-
-#include <unistd.h>
-
-#define BSD 199506 /* System version (year & month). */
-#define BSD4_3 1
-#define BSD4_4 1
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef LOCORE
-#include <sys/types.h>
-#endif
-
-/*
- * Machine-independent constants (some used in following include files).
- * Redefined constants are from POSIX 1003.1 limits file.
- *
- * MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>)
- * MAXLOGNAME should be >= UT_NAMESIZE (see <utmp.h>)
- */
-#include <sys/syslimits.h>
-
-#define MAXCOMLEN 16 /* max command name remembered */
-#define MAXINTERP 32 /* max interpreter file name length */
-#define MAXLOGNAME 12 /* max login name length */
-#define MAXUPRC CHILD_MAX /* max simultaneous processes */
-#define NCARGS ARG_MAX /* max bytes for an exec function */
-#define NGROUPS NGROUPS_MAX /* max number groups */
-#define NOFILE OPEN_MAX /* max open files per process */
-#define NOGROUP 65535 /* marker for empty group set member */
-#define MAXHOSTNAMELEN 256 /* max hostname size */
-
-/* More types and definitions used throughout the kernel. */
-#ifdef KERNEL
-#include <sys/cdefs.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/ucred.h>
-#include <sys/uio.h>
-#include <sys/rtprio.h>
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-#endif
-
-/* Signals. */
-#include <sys/signal.h>
-
-/* Machine type dependent parameters. */
-#include <machine/param.h>
-#include <machine/limits.h>
-
-/*
- * Priorities. Note that with 32 run queues, differences less than 4 are
- * insignificant.
- */
-#define PSWP 0
-#define PVM 4
-#define PINOD 8
-#define PRIBIO 16
-#define PVFS 20
-#define PZERO 22 /* No longer magic, shouldn't be here. XXX */
-#define PSOCK 24
-#define PWAIT 32
-#define PLOCK 36
-#define PPAUSE 40
-#define PUSER 50
-#define MAXPRI 127 /* Priorities range from 0 through MAXPRI. */
-
-#define PRIMASK 0x0ff
-#define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */
-
-#define NZERO 0 /* default "nice" */
-
-#define NBPW sizeof(int) /* number of bytes per word (integer) */
-
-#define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */
-#define NODEV (dev_t)(-1) /* non-existent device */
-
-/*
- * Clustering of hardware pages on machines with ridiculously small
- * page sizes is done here. The paging subsystem deals with units of
- * CLSIZE pte's describing PAGE_SIZE (from machine/machparam.h) pages each.
- */
-#if 0
-#define CLBYTES (CLSIZE*PAGE_SIZE)
-#endif
-
-#define CBLOCK 128 /* Clist block size, must be a power of 2. */
-#define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */
- /* Data chars/clist. */
-#define CBSIZE (CBLOCK - sizeof(struct cblock *) - CBQSIZE)
-#define CROUND (CBLOCK - 1) /* Clist rounding. */
-
-/*
- * File system parameters and macros.
- *
- * The file system is made out of blocks of at most MAXBSIZE units, with
- * smaller units (fragments) only in the last direct block. MAXBSIZE
- * primarily determines the size of buffers in the buffer pool. It may be
- * made larger without any effect on existing file systems; however making
- * it smaller make make some file systems unmountable. Also, MAXBSIZE
- * must be less than MAXPHYS!!! DFLTBSIZE is the average amount of
- * memory allocated by vfs_bio per nbuf. BKVASIZE is the average amount
- * of kernel virtual space allocated per nbuf. BKVASIZE should be >=
- * DFLTBSIZE. If it is significantly bigger than DFLTBSIZE, then
- * kva fragmentation causes fewer performance problems.
- */
-#define MAXBSIZE 65536
-#define BKVASIZE 8192
-#define DFLTBSIZE 4096
-#define MAXFRAG 8
-
-/*
- * MAXPATHLEN defines the longest permissible path length after expanding
- * symbolic links. It is used to allocate a temporary buffer from the buffer
- * pool in which to do the name expansion, hence should be a power of two,
- * and must be less than or equal to MAXBSIZE. MAXSYMLINKS defines the
- * maximum number of symbolic links that may be expanded in a path name.
- * It should be set high enough to allow all legitimate uses, but halt
- * infinite loops reasonably quickly.
- */
-#if !defined(__rtems__)
-#define MAXPATHLEN PATH_MAX
-#endif
-#define MAXSYMLINKS 32
-
-/* Bit map related macros. */
-#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
-#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
-#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
-#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
-
-/* Macros for counting and rounding. */
-#ifndef howmany
-#define howmany(x, y) (((x)+((y)-1))/(y))
-#endif
-#define rounddown(x, y) (((x)/(y))*(y))
-#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */
-#define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */
-#define powerof2(x) ((((x)-1)&(x))==0)
-
-/* Macros for min/max. */
-#ifndef KERNEL
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#endif
-
-/*
- * Constants for setting the parameters of the kernel memory allocator.
- *
- * 2 ** MINBUCKET is the smallest unit of memory that will be
- * allocated. It must be at least large enough to hold a pointer.
- *
- * Units of memory less or equal to MAXALLOCSAVE will permanently
- * allocate physical memory; requests for these size pieces of
- * memory are quite fast. Allocations greater than MAXALLOCSAVE must
- * always allocate and free physical memory; requests for these
- * size allocations should be done infrequently as they will be slow.
- *
- * Constraints: PAGE_SIZE <= MAXALLOCSAVE <= 2 ** (MINBUCKET + 14), and
- * MAXALLOCSIZE must be a power of two.
- */
-#define MINBUCKET 4 /* 4 => min allocation of 16 bytes */
-#define MAXALLOCSAVE (2 * PAGE_SIZE)
-
-/*
- * Scale factor for scaled integers used to count %cpu time and load avgs.
- *
- * The number of CPU `tick's that map to a unique `%age' can be expressed
- * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that
- * can be calculated (assuming 32 bits) can be closely approximated using
- * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15).
- *
- * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age',
- * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024.
- */
-#define FSHIFT 11 /* bits to right of fixed binary point */
-#define FSCALE (1<<FSHIFT)
-
-#endif /* _SYS_PARAM_H_ */
diff --git a/cpukit/libnetworking/sys/proc.h b/cpukit/libnetworking/sys/proc.h
deleted file mode 100644
index 2189a33b11..0000000000
--- a/cpukit/libnetworking/sys/proc.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Dummy structure
- *
- * $Id$
- */
-struct proc {
- int this_should_never_be_referenced;
-};
diff --git a/cpukit/libnetworking/sys/protosw.h b/cpukit/libnetworking/sys/protosw.h
deleted file mode 100644
index a7aa52feea..0000000000
--- a/cpukit/libnetworking/sys/protosw.h
+++ /dev/null
@@ -1,300 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 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.
- *
- * @(#)protosw.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_PROTOSW_H_
-#define _SYS_PROTOSW_H_
-
-struct ifnet;
-struct mbuf;
-struct sockaddr;
-struct socket;
-struct sockproto;
-struct stat;
-
-/*
- * Protocol switch table.
- *
- * Each protocol has a handle initializing one of these structures,
- * which is used for protocol-protocol and system-protocol communication.
- *
- * A protocol is called through the pr_init entry before any other.
- * Thereafter it is called every 200ms through the pr_fasttimo entry and
- * every 500ms through the pr_slowtimo for timer based actions.
- * The system will call the pr_drain entry if it is low on space and
- * this should throw away any non-critical data.
- *
- * Protocols pass data between themselves as chains of mbufs using
- * the pr_input and pr_output hooks. Pr_input passes data up (towards
- * UNIX) and pr_output passes it down (towards the imps); control
- * information passes up and down on pr_ctlinput and pr_ctloutput.
- * The protocol is responsible for the space occupied by any the
- * arguments to these entries and must dispose it.
- *
- * The userreq routine interfaces protocols to the system and is
- * described below.
- */
-struct protosw {
- short pr_type; /* socket type used for */
- struct domain *pr_domain; /* domain protocol a member of */
- short pr_protocol; /* protocol number */
- short pr_flags; /* see below */
-/* protocol-protocol hooks */
- void (*pr_input) __P((struct mbuf *, int len));
- /* input to protocol (from below) */
- int (*pr_output) __P((struct mbuf *m, struct socket *so));
- /* output to protocol (from above) */
- void (*pr_ctlinput)__P((int, struct sockaddr *, void *));
- /* control input (from below) */
- int (*pr_ctloutput)__P((int, struct socket *, int, int,
- struct mbuf **));
- /* control output (from above) */
-/* user-protocol hook */
- int (*pr_ousrreq) __P((struct socket *, int, struct mbuf *,
- struct mbuf *, struct mbuf *));
- /* user request: see list below */
-/* utility hooks */
- void (*pr_init) __P((void)); /* initialization hook */
- void (*pr_fasttimo) __P((void));
- /* fast timeout (200ms) */
- void (*pr_slowtimo) __P((void));
- /* slow timeout (500ms) */
- void (*pr_drain) __P((void));
- /* flush any excess space possible */
- struct pr_usrreqs *pr_usrreqs; /* supersedes pr_usrreq() */
-};
-
-#define PR_SLOWHZ 2 /* 2 slow timeouts per second */
-#define PR_FASTHZ 5 /* 5 fast timeouts per second */
-
-/*
- * Values for pr_flags.
- * PR_ADDR requires PR_ATOMIC;
- * PR_ADDR and PR_CONNREQUIRED are mutually exclusive.
- * PR_IMPLOPCL means that the protocol allows sendto without prior connect,
- * and the protocol understands the MSG_EOF flag. The first property is
- * is only relevant if PR_CONNREQUIRED is set (otherwise sendto is allowed
- * anyhow).
- */
-#define PR_ATOMIC 0x01 /* exchange atomic messages only */
-#define PR_ADDR 0x02 /* addresses given with messages */
-#define PR_CONNREQUIRED 0x04 /* connection required by protocol */
-#define PR_WANTRCVD 0x08 /* want PRU_RCVD calls */
-#define PR_RIGHTS 0x10 /* passes capabilities */
-#define PR_IMPLOPCL 0x20 /* implied open/close */
-
-/*
- * The arguments to usrreq are:
- * (*protosw[].pr_usrreq)(up, req, m, nam, opt);
- * where up is a (struct socket *), req is one of these requests,
- * m is a optional mbuf chain containing a message,
- * nam is an optional mbuf chain containing an address,
- * and opt is a pointer to a socketopt structure or nil.
- * The protocol is responsible for disposal of the mbuf chain m,
- * the caller is responsible for any space held by nam and opt.
- * A non-zero return from usrreq gives an
- * UNIX error number which should be passed to higher level software.
- */
-#define PRU_ATTACH 0 /* attach protocol to up */
-#define PRU_DETACH 1 /* detach protocol from up */
-#define PRU_BIND 2 /* bind socket to address */
-#define PRU_LISTEN 3 /* listen for connection */
-#define PRU_CONNECT 4 /* establish connection to peer */
-#define PRU_ACCEPT 5 /* accept connection from peer */
-#define PRU_DISCONNECT 6 /* disconnect from peer */
-#define PRU_SHUTDOWN 7 /* won't send any more data */
-#define PRU_RCVD 8 /* have taken data; more room now */
-#define PRU_SEND 9 /* send this data */
-#define PRU_ABORT 10 /* abort (fast DISCONNECT, DETATCH) */
-#define PRU_CONTROL 11 /* control operations on protocol */
-#define PRU_SENSE 12 /* return status into m */
-#define PRU_RCVOOB 13 /* retrieve out of band data */
-#define PRU_SENDOOB 14 /* send out of band data */
-#define PRU_SOCKADDR 15 /* fetch socket's address */
-#define PRU_PEERADDR 16 /* fetch peer's address */
-#define PRU_CONNECT2 17 /* connect two sockets */
-/* begin for protocols internal use */
-#define PRU_FASTTIMO 18 /* 200ms timeout */
-#define PRU_SLOWTIMO 19 /* 500ms timeout */
-#define PRU_PROTORCV 20 /* receive from below */
-#define PRU_PROTOSEND 21 /* send to below */
-/* end for protocol's internal use */
-#define PRU_SEND_EOF 22 /* send and close */
-#define PRU_NREQ 22
-
-#ifdef PRUREQUESTS
-char *prurequests[] = {
- "ATTACH", "DETACH", "BIND", "LISTEN",
- "CONNECT", "ACCEPT", "DISCONNECT", "SHUTDOWN",
- "RCVD", "SEND", "ABORT", "CONTROL",
- "SENSE", "RCVOOB", "SENDOOB", "SOCKADDR",
- "PEERADDR", "CONNECT2", "FASTTIMO", "SLOWTIMO",
- "PROTORCV", "PROTOSEND",
- "SEND_EOF",
-};
-#endif
-
-#ifdef KERNEL /* users shouldn't see this decl */
-struct stat;
-struct ifnet;
-
-/*
- * If the ordering here looks odd, that's because it's alphabetical.
- */
-struct pr_usrreqs {
- int (*pru_abort) __P((struct socket *so));
- int (*pru_accept) __P((struct socket *so, struct mbuf *nam));
- int (*pru_attach) __P((struct socket *so, int proto));
- int (*pru_bind) __P((struct socket *so, struct mbuf *nam));
- int (*pru_connect) __P((struct socket *so, struct mbuf *nam));
- int (*pru_connect2) __P((struct socket *so1, struct socket *so2));
- int (*pru_control) __P((struct socket *so, int cmd, caddr_t data,
- struct ifnet *ifp));
- int (*pru_detach) __P((struct socket *so));
- int (*pru_disconnect) __P((struct socket *so));
- int (*pru_listen) __P((struct socket *so));
- int (*pru_peeraddr) __P((struct socket *so, struct mbuf *nam));
- int (*pru_rcvd) __P((struct socket *so, int flags));
- int (*pru_rcvoob) __P((struct socket *so, struct mbuf *m,
- int flags));
- /*
- * The `m' parameter here is almost certainly going to become a
- * `struct uio' at some point in the future. Similar changes
- * will probably happen for the receive entry points.
- */
- int (*pru_send) __P((struct socket *so, int flags, struct mbuf *m,
- struct mbuf *addr, struct mbuf *control));
-#define PRUS_OOB 0x1
-#define PRUS_EOF 0x2
- int (*pru_sense) __P((struct socket *so, struct stat *sb));
- int (*pru_shutdown) __P((struct socket *so));
- int (*pru_sockaddr) __P((struct socket *so, struct mbuf *nam));
-};
-
-int pru_accept_notsupp __P((struct socket *so, struct mbuf *nam));
-int pru_connect2_notsupp __P((struct socket *so1, struct socket *so2));
-int pru_control_notsupp __P((struct socket *so, int cmd, caddr_t data,
- struct ifnet *ifp));
-int pru_listen_notsupp __P((struct socket *so));
-int pru_rcvd_notsupp __P((struct socket *so, int flags));
-int pru_rcvoob_notsupp __P((struct socket *so, struct mbuf *m, int flags));
-int pru_sense_null __P((struct socket *so, struct stat *sb));
-
-#define PRU_OLDSTYLE
-
-#ifdef PRU_OLDSTYLE
-/*
- * Protocols which don't yet implement pr_usrreqs can point it to this
- * structure, which will call the old pr_usrreq() entry point with the
- * appropriate arguments.
- */
-extern struct pr_usrreqs pru_oldstyle;
-#endif /* PRU_OLDSTYLE */
-
-#endif /* KERNEL */
-
-/*
- * The arguments to the ctlinput routine are
- * (*protosw[].pr_ctlinput)(cmd, sa, arg);
- * where cmd is one of the commands below, sa is a pointer to a sockaddr,
- * and arg is a `void *' argument used within a protocol family.
- */
-#define PRC_IFDOWN 0 /* interface transition */
-#define PRC_ROUTEDEAD 1 /* select new route if possible ??? */
-#define PRC_QUENCH2 3 /* DEC congestion bit says slow down */
-#define PRC_QUENCH 4 /* some one said to slow down */
-#define PRC_MSGSIZE 5 /* message size forced drop */
-#define PRC_HOSTDEAD 6 /* host appears to be down */
-#define PRC_HOSTUNREACH 7 /* deprecated (use PRC_UNREACH_HOST) */
-#define PRC_UNREACH_NET 8 /* no route to network */
-#define PRC_UNREACH_HOST 9 /* no route to host */
-#define PRC_UNREACH_PROTOCOL 10 /* dst says bad protocol */
-#define PRC_UNREACH_PORT 11 /* bad port # */
-/* was PRC_UNREACH_NEEDFRAG 12 (use PRC_MSGSIZE) */
-#define PRC_UNREACH_SRCFAIL 13 /* source route failed */
-#define PRC_REDIRECT_NET 14 /* net routing redirect */
-#define PRC_REDIRECT_HOST 15 /* host routing redirect */
-#define PRC_REDIRECT_TOSNET 16 /* redirect for type of service & net */
-#define PRC_REDIRECT_TOSHOST 17 /* redirect for tos & host */
-#define PRC_TIMXCEED_INTRANS 18 /* packet lifetime expired in transit */
-#define PRC_TIMXCEED_REASS 19 /* lifetime expired on reass q */
-#define PRC_PARAMPROB 20 /* header incorrect */
-
-#define PRC_NCMDS 21
-
-#define PRC_IS_REDIRECT(cmd) \
- ((cmd) >= PRC_REDIRECT_NET && (cmd) <= PRC_REDIRECT_TOSHOST)
-
-#ifdef PRCREQUESTS
-char *prcrequests[] = {
- "IFDOWN", "ROUTEDEAD", "#2", "DEC-BIT-QUENCH2",
- "QUENCH", "MSGSIZE", "HOSTDEAD", "#7",
- "NET-UNREACH", "HOST-UNREACH", "PROTO-UNREACH", "PORT-UNREACH",
- "#12", "SRCFAIL-UNREACH", "NET-REDIRECT", "HOST-REDIRECT",
- "TOSNET-REDIRECT", "TOSHOST-REDIRECT", "TX-INTRANS", "TX-REASS",
- "PARAMPROB"
-};
-#endif
-
-/*
- * The arguments to ctloutput are:
- * (*protosw[].pr_ctloutput)(req, so, level, optname, optval);
- * req is one of the actions listed below, so is a (struct socket *),
- * level is an indication of which protocol layer the option is intended.
- * optname is a protocol dependent socket option request,
- * optval is a pointer to a mbuf-chain pointer, for value-return results.
- * The protocol is responsible for disposal of the mbuf chain *optval
- * if supplied,
- * the caller is responsible for any space held by *optval, when returned.
- * A non-zero return from usrreq gives an
- * UNIX error number which should be passed to higher level software.
- */
-#define PRCO_GETOPT 0
-#define PRCO_SETOPT 1
-
-#define PRCO_NCMDS 2
-
-#ifdef PRCOREQUESTS
-char *prcorequests[] = {
- "GETOPT", "SETOPT",
-};
-#endif
-
-#ifdef KERNEL
-struct protosw *pffindproto __P((int family, int protocol, int type));
-struct protosw *pffindtype __P((int family, int type));
-#endif
-
-#endif
diff --git a/cpukit/libnetworking/sys/queue.h b/cpukit/libnetworking/sys/queue.h
deleted file mode 100644
index e8aa08cf5d..0000000000
--- a/cpukit/libnetworking/sys/queue.h
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * Copyright (c) 1991, 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.
- *
- * @(#)queue.h 8.5 (Berkeley) 8/20/94
- * $Id$
- */
-
-#ifndef _SYS_QUEUE_H_
-#define _SYS_QUEUE_H_
-
-/*
- * This file defines five types of data structures: singly-linked lists,
- * slingly-linked tail queues, lists, tail queues, and circular queues.
- *
- * A singly-linked list is headed by a single forward pointer. The elements
- * are singly linked for minimum space and pointer manipulation overhead at
- * the expense of O(n) removal for arbitrary elements. New elements can be
- * added to the list after an existing element or at the head of the list.
- * Elements being removed from the head of the list should use the explicit
- * macro for this purpose for optimum efficiency. A singly-linked list may
- * only be traversed in the forward direction. Singly-linked lists are ideal
- * for applications with large datasets and few or no removals or for
- * implementing a LIFO queue.
- *
- * A singly-linked tail queue is headed by a pair of pointers, one to the
- * head of the list and the other to the tail of the list. The elements are
- * singly linked for minimum space and pointer manipulation overhead at the
- * expense of O(n) removal for arbitrary elements. New elements can be added
- * to the list after an existing element, at the head of the list, or at the
- * end of the list. Elements being removed from the head of the tail queue
- * should use the explicit macro for this purpose for optimum efficiency.
- * A singly-linked tail queue may only be traversed in the forward direction.
- * Singly-linked tail queues are ideal for applications with large datasets
- * and few or no removals or for implementing a FIFO queue.
- *
- * A list is headed by a single forward pointer (or an array of forward
- * pointers for a hash table header). The elements are doubly linked
- * so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before
- * or after an existing element or at the head of the list. A list
- * may only be traversed in the forward direction.
- *
- * A tail queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or
- * after an existing element, at the head of the list, or at the end of
- * the list. A tail queue may only be traversed in the forward direction.
- *
- * A circle queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or after
- * an existing element, at the head of the list, or at the end of the list.
- * A circle queue may be traversed in either direction, but has a more
- * complex end of list detection.
- *
- * For details on the use of these macros, see the queue(3) manual page.
- */
-
-/*
- * Singly-linked List definitions.
- */
-#define SLIST_HEAD(name, type) \
-struct name { \
- struct type *slh_first; /* first element */ \
-}
-
-#define SLIST_ENTRY(type) \
-struct { \
- struct type *sle_next; /* next element */ \
-}
-
-/*
- * Singly-linked List functions.
- */
-#define SLIST_INIT(head) { \
- (head)->slh_first = NULL; \
-}
-
-#define SLIST_INSERT_AFTER(slistelm, elm, field) { \
- (elm)->field.sle_next = (slistelm)->field.sle_next; \
- (slistelm)->field.sle_next = (elm); \
-}
-
-#define SLIST_INSERT_HEAD(head, elm, field) { \
- (elm)->field.sle_next = (head)->slh_first; \
- (head)->slh_first = (elm); \
-}
-
-#define SLIST_REMOVE_HEAD(head, field) { \
- (head)->slh_first = (head)->slh_first->field.sle_next; \
-}
-
-#define SLIST_REMOVE(head, elm, type, field) { \
- if ((head)->slh_first == (elm)) { \
- SLIST_REMOVE_HEAD((head), field); \
- } \
- else { \
- struct type *curelm = (head)->slh_first; \
- while( curelm->field.sle_next != (elm) ) \
- curelm = curelm->field.sle_next; \
- curelm->field.sle_next = \
- curelm->field.sle_next->field.sle_next; \
- } \
-}
-
-/*
- * Singly-linked Tail queue definitions.
- */
-#define STAILQ_HEAD(name, type) \
-struct name { \
- struct type *stqh_first;/* first element */ \
- struct type **stqh_last;/* addr of last next element */ \
-}
-
-#define STAILQ_ENTRY(type) \
-struct { \
- struct type *stqe_next; /* next element */ \
-}
-
-/*
- * Singly-linked Tail queue functions.
- */
-#define STAILQ_INIT(head) { \
- (head)->stqh_first = NULL; \
- (head)->stqh_last = &(head)->stqh_first; \
-}
-
-#define STAILQ_INSERT_HEAD(head, elm, field) { \
- if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
- (head)->stqh_last = &(elm)->field.stqe_next; \
- (head)->stqh_first = (elm); \
-}
-
-#define STAILQ_INSERT_TAIL(head, elm, field) { \
- (elm)->field.stqe_next = NULL; \
- *(head)->stqh_last = (elm); \
- (head)->stqh_last = &(elm)->field.stqe_next; \
-}
-
-#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) { \
- if (((elm)->field.stqe_next = (tqelm)->field.stqe_next) == NULL)\
- (head)->stqh_last = &(elm)->field.stqe_next; \
- (tqelm)->field.stqe_next = (elm); \
-}
-
-#define STAILQ_REMOVE_HEAD(head, field) { \
- if (((head)->stqh_first = \
- (head)->stqh_first->field.stqe_next) == NULL) \
- (head)->stqh_last = &(head)->stqh_first; \
-}
-
-#define STAILQ_REMOVE(head, elm, type, field) { \
- if ((head)->stqh_first == (elm)) { \
- STAILQ_REMOVE_HEAD(head, field); \
- } \
- else { \
- struct type *curelm = (head)->stqh_first; \
- while( curelm->field.stqe_next != (elm) ) \
- curelm = curelm->field.stqe_next; \
- if((curelm->field.stqe_next = \
- curelm->field.stqe_next->field.stqe_next) == NULL) \
- (head)->stqh_last = &(curelm)->field.stqe_next; \
- } \
-}
-
-/*
- * List definitions.
- */
-#define LIST_HEAD(name, type) \
-struct name { \
- struct type *lh_first; /* first element */ \
-}
-
-#define LIST_ENTRY(type) \
-struct { \
- struct type *le_next; /* next element */ \
- struct type **le_prev; /* address of previous next element */ \
-}
-
-/*
- * List functions.
- */
-#define LIST_INIT(head) { \
- (head)->lh_first = NULL; \
-}
-
-#define LIST_INSERT_AFTER(listelm, elm, field) { \
- if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
- (listelm)->field.le_next->field.le_prev = \
- &(elm)->field.le_next; \
- (listelm)->field.le_next = (elm); \
- (elm)->field.le_prev = &(listelm)->field.le_next; \
-}
-
-#define LIST_INSERT_BEFORE(listelm, elm, field) { \
- (elm)->field.le_prev = (listelm)->field.le_prev; \
- (elm)->field.le_next = (listelm); \
- *(listelm)->field.le_prev = (elm); \
- (listelm)->field.le_prev = &(elm)->field.le_next; \
-}
-
-#define LIST_INSERT_HEAD(head, elm, field) { \
- if (((elm)->field.le_next = (head)->lh_first) != NULL) \
- (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
- (head)->lh_first = (elm); \
- (elm)->field.le_prev = &(head)->lh_first; \
-}
-
-#define LIST_REMOVE(elm, field) { \
- if ((elm)->field.le_next != NULL) \
- (elm)->field.le_next->field.le_prev = \
- (elm)->field.le_prev; \
- *(elm)->field.le_prev = (elm)->field.le_next; \
-}
-
-/*
- * Tail queue definitions.
- */
-#define TAILQ_HEAD(name, type) \
-struct name { \
- struct type *tqh_first; /* first element */ \
- struct type **tqh_last; /* addr of last next element */ \
-}
-
-#define TAILQ_HEAD_INITIALIZER(head) \
- { NULL, &(head).tqh_first }
-
-#define TAILQ_ENTRY(type) \
-struct { \
- struct type *tqe_next; /* next element */ \
- struct type **tqe_prev; /* address of previous next element */ \
-}
-
-/*
- * Tail queue functions.
- */
-#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
-
-#define TAILQ_FIRST(head) ((head)->tqh_first)
-
-#define TAILQ_LAST(head) ((head)->tqh_last)
-
-#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
-
-#define TAILQ_PREV(elm, field) ((elm)->field.tqe_prev)
-
-#define TAILQ_INIT(head) { \
- (head)->tqh_first = NULL; \
- (head)->tqh_last = &(head)->tqh_first; \
-}
-
-#define TAILQ_INSERT_HEAD(head, elm, field) { \
- if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
- (head)->tqh_first->field.tqe_prev = \
- &(elm)->field.tqe_next; \
- else \
- (head)->tqh_last = &(elm)->field.tqe_next; \
- (head)->tqh_first = (elm); \
- (elm)->field.tqe_prev = &(head)->tqh_first; \
-}
-
-#define TAILQ_INSERT_TAIL(head, elm, field) { \
- (elm)->field.tqe_next = NULL; \
- (elm)->field.tqe_prev = (head)->tqh_last; \
- *(head)->tqh_last = (elm); \
- (head)->tqh_last = &(elm)->field.tqe_next; \
-}
-
-#define TAILQ_INSERT_AFTER(head, listelm, elm, field) { \
- if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
- (elm)->field.tqe_next->field.tqe_prev = \
- &(elm)->field.tqe_next; \
- else \
- (head)->tqh_last = &(elm)->field.tqe_next; \
- (listelm)->field.tqe_next = (elm); \
- (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
-}
-
-#define TAILQ_INSERT_BEFORE(listelm, elm, field) { \
- (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
- (elm)->field.tqe_next = (listelm); \
- *(listelm)->field.tqe_prev = (elm); \
- (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
-}
-
-#define TAILQ_REMOVE(head, elm, field) { \
- if (((elm)->field.tqe_next) != NULL) \
- (elm)->field.tqe_next->field.tqe_prev = \
- (elm)->field.tqe_prev; \
- else \
- (head)->tqh_last = (elm)->field.tqe_prev; \
- *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
-}
-
-/*
- * Circular queue definitions.
- */
-#define CIRCLEQ_HEAD(name, type) \
-struct name { \
- struct type *cqh_first; /* first element */ \
- struct type *cqh_last; /* last element */ \
-}
-
-#define CIRCLEQ_ENTRY(type) \
-struct { \
- struct type *cqe_next; /* next element */ \
- struct type *cqe_prev; /* previous element */ \
-}
-
-/*
- * Circular queue functions.
- */
-#define CIRCLEQ_INIT(head) { \
- (head)->cqh_first = (void *)(head); \
- (head)->cqh_last = (void *)(head); \
-}
-
-#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) { \
- (elm)->field.cqe_next = (listelm)->field.cqe_next; \
- (elm)->field.cqe_prev = (listelm); \
- if ((listelm)->field.cqe_next == (void *)(head)) \
- (head)->cqh_last = (elm); \
- else \
- (listelm)->field.cqe_next->field.cqe_prev = (elm); \
- (listelm)->field.cqe_next = (elm); \
-}
-
-#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) { \
- (elm)->field.cqe_next = (listelm); \
- (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
- if ((listelm)->field.cqe_prev == (void *)(head)) \
- (head)->cqh_first = (elm); \
- else \
- (listelm)->field.cqe_prev->field.cqe_next = (elm); \
- (listelm)->field.cqe_prev = (elm); \
-}
-
-#define CIRCLEQ_INSERT_HEAD(head, elm, field) { \
- (elm)->field.cqe_next = (head)->cqh_first; \
- (elm)->field.cqe_prev = (void *)(head); \
- if ((head)->cqh_last == (void *)(head)) \
- (head)->cqh_last = (elm); \
- else \
- (head)->cqh_first->field.cqe_prev = (elm); \
- (head)->cqh_first = (elm); \
-}
-
-#define CIRCLEQ_INSERT_TAIL(head, elm, field) { \
- (elm)->field.cqe_next = (void *)(head); \
- (elm)->field.cqe_prev = (head)->cqh_last; \
- if ((head)->cqh_first == (void *)(head)) \
- (head)->cqh_first = (elm); \
- else \
- (head)->cqh_last->field.cqe_next = (elm); \
- (head)->cqh_last = (elm); \
-}
-
-#define CIRCLEQ_REMOVE(head, elm, field) { \
- if ((elm)->field.cqe_next == (void *)(head)) \
- (head)->cqh_last = (elm)->field.cqe_prev; \
- else \
- (elm)->field.cqe_next->field.cqe_prev = \
- (elm)->field.cqe_prev; \
- if ((elm)->field.cqe_prev == (void *)(head)) \
- (head)->cqh_first = (elm)->field.cqe_next; \
- else \
- (elm)->field.cqe_prev->field.cqe_next = \
- (elm)->field.cqe_next; \
-}
-
-#ifdef KERNEL
-
-/*
- * XXX insque() and remque() are an old way of handling certain queues.
- * They bogusly assumes that all queue heads look alike.
- */
-
-struct quehead {
- struct quehead *qh_link;
- struct quehead *qh_rlink;
-};
-
-#ifdef __GNUC__
-
-static __inline void
-insque(void *a, void *b)
-{
- struct quehead *element = a, *head = b;
-
- element->qh_link = head->qh_link;
- element->qh_rlink = head;
- head->qh_link = element;
- element->qh_link->qh_rlink = element;
-}
-
-static __inline void
-remque(void *a)
-{
- struct quehead *element = a;
-
- element->qh_link->qh_rlink = element->qh_rlink;
- element->qh_rlink->qh_link = element->qh_link;
- element->qh_rlink = 0;
-}
-
-#else /* !__GNUC__ */
-
-void insque __P((void *a, void *b));
-void remque __P((void *a));
-
-#endif /* __GNUC__ */
-
-#endif /* KERNEL */
-
-#endif /* !_SYS_QUEUE_H_ */
diff --git a/cpukit/libnetworking/sys/reboot.h b/cpukit/libnetworking/sys/reboot.h
deleted file mode 100644
index 48a7f0f782..0000000000
--- a/cpukit/libnetworking/sys/reboot.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1993, 1994
- * 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.
- *
- * @(#)reboot.h 8.3 (Berkeley) 12/13/94
- * $Id$
- */
-
-#ifndef _SYS_REBOOT_H_
-#define _SYS_REBOOT_H_
-
-/*
- * Arguments to reboot system call. These are passed to
- * the boot program and on to init.
- */
-#define RB_AUTOBOOT 0 /* flags for system auto-booting itself */
-
-#define RB_ASKNAME 0x001 /* ask for file name to reboot from */
-#define RB_SINGLE 0x002 /* reboot to single user only */
-#define RB_NOSYNC 0x004 /* dont sync before reboot */
-#define RB_HALT 0x008 /* don't reboot, just halt */
-#define RB_INITNAME 0x010 /* name given for /etc/init (unused) */
-#define RB_DFLTROOT 0x020 /* use compiled-in rootdev */
-#define RB_KDB 0x040 /* give control to kernel debugger */
-#define RB_RDONLY 0x080 /* mount root fs read-only */
-#define RB_DUMP 0x100 /* dump kernel memory before reboot */
-#define RB_MINIROOT 0x200 /* mini-root present in memory at boot time */
-#define RB_CONFIG 0x400 /* invoke user configuration routing */
-#define RB_VERBOSE 0x800 /* print all potentially useful info */
-#define RB_SERIAL 0x1000 /* user serial port as console */
-#define RB_CDROM 0x2000 /* use cdrom as root */
-#define RB_POWEROFF 0x4000 /* if you can, turn the power off */
-#define RB_GDB 0x8000 /* use GDB remote debugger instead of DDB */
-#define RB_MUTE 0x10000 /* Come up with the console muted */
-#define RB_SELFTEST 0x20000 /* don't boot to normal operation, do selftest */
-
-#define RB_BOOTINFO 0x80000000 /* have `struct bootinfo *' arg */
-
-/*
- * Constants for converting boot-style device number to type,
- * adaptor (uba, mba, etc), unit number and partition number.
- * Type (== major device number) is in the low byte
- * for backward compatibility. Except for that of the "magic
- * number", each mask applies to the shifted value.
- * Format:
- * (4) (4) (4) (4) (8) (8)
- * --------------------------------
- * |MA | AD| CT| UN| PART | TYPE |
- * --------------------------------
- */
-#define B_ADAPTORSHIFT 24
-#define B_ADAPTORMASK 0x0f
-#define B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
-#define B_CONTROLLERSHIFT 20
-#define B_CONTROLLERMASK 0xf
-#define B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
-#define B_SLICESHIFT 20
-#define B_SLICEMASK 0xff
-#define B_SLICE(val) (((val)>>B_SLICESHIFT) & B_SLICEMASK)
-#define B_UNITSHIFT 16
-#define B_UNITMASK 0xf
-#define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK)
-#define B_PARTITIONSHIFT 8
-#define B_PARTITIONMASK 0xff
-#define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
-#define B_TYPESHIFT 0
-#define B_TYPEMASK 0xff
-#define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK)
-
-#define B_MAGICMASK 0xf0000000
-#define B_DEVMAGIC 0xa0000000
-
-#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
- (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
- ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
- ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
-
-#endif
diff --git a/cpukit/libnetworking/sys/resourcevar.h b/cpukit/libnetworking/sys/resourcevar.h
deleted file mode 100644
index 2b4c47e48f..0000000000
--- a/cpukit/libnetworking/sys/resourcevar.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-/* intentionally empty file */
diff --git a/cpukit/libnetworking/sys/rtprio.h b/cpukit/libnetworking/sys/rtprio.h
deleted file mode 100644
index dd9521e7c8..0000000000
--- a/cpukit/libnetworking/sys/rtprio.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 1994, Henrik Vestergaard Draboel
- * 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 (name).
- * 4. 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 BY THE AUTHOR 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 AUTHOR 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.
- *
- * $Id$
- */
-
-#ifndef _SYS_RTPRIO_H_
-#define _SYS_RTPRIO_H_
-
-/*
- * Process realtime-priority specifications to rtprio.
- */
-
-/* priority types */
-#define RTP_PRIO_REALTIME 0
-#define RTP_PRIO_NORMAL 1
-#define RTP_PRIO_IDLE 2
-
-/* priority range */
-#define RTP_PRIO_MIN 0 /* Highest priority */
-#define RTP_PRIO_MAX 31 /* Lowest priority */
-
-/*
- * rtprio() syscall functions
- */
-#define RTP_LOOKUP 0
-#define RTP_SET 1
-
-#ifndef LOCORE
-struct rtprio {
- u_short type;
- u_short prio;
-};
-#endif
-
-#ifndef KERNEL
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int rtprio __P((int, pid_t, struct rtprio *));
-__END_DECLS
-#endif /* !KERNEL */
-#endif /* !_SYS_RTPRIO_H_ */
diff --git a/cpukit/libnetworking/sys/select.h b/cpukit/libnetworking/sys/select.h
deleted file mode 100644
index e69971e3b6..0000000000
--- a/cpukit/libnetworking/sys/select.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * 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.
- *
- * @(#)select.h 8.2 (Berkeley) 1/4/94
- * $Id$
- */
-
-#ifndef _SYS_SELECT_H_
-#define _SYS_SELECT_H_
-
-/*
- * Used to maintain information about processes that wish to be
- * notified when I/O becomes possible.
- */
-struct selinfo {
- pid_t si_pid; /* process to be notified */
- short si_flags; /* see below */
-};
-#define SI_COLL 0x0001 /* collision occurred */
-
-#ifdef KERNEL
-struct proc;
-
-void selrecord __P((struct proc *selector, struct selinfo *));
-void selwakeup __P((struct selinfo *));
-#endif
-
-#endif /* !_SYS_SELECT_H_ */
diff --git a/cpukit/libnetworking/sys/signalvar.h b/cpukit/libnetworking/sys/signalvar.h
deleted file mode 100644
index 8900458fdb..0000000000
--- a/cpukit/libnetworking/sys/signalvar.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 1991, 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.
- *
- * @(#)signalvar.h 8.6 (Berkeley) 2/19/95
- * $Id$
- */
-
-#ifndef _SYS_SIGNALVAR_H_ /* tmp for user.h */
-#define _SYS_SIGNALVAR_H_
-
-/*
- * Kernel signal definitions and data structures,
- * not exported to user programs.
- */
-
-/*
- * Process signal actions and state, needed only within the process
- * (not necessarily resident).
- */
-struct sigacts {
- sig_t ps_sigact[NSIG]; /* disposition of signals */
- sigset_t ps_catchmask[NSIG]; /* signals to be blocked */
- sigset_t ps_sigonstack; /* signals to take on sigstack */
- sigset_t ps_sigintr; /* signals that interrupt syscalls */
- sigset_t ps_sigreset; /* signals that reset when caught */
- sigset_t ps_signodefer; /* signals not masked while handled */
- sigset_t ps_oldmask; /* saved mask from before sigpause */
- int ps_flags; /* signal flags, below */
- struct sigaltstack ps_sigstk; /* sp & on stack state variable */
- int ps_sig; /* for core dump/debugger XXX */
- u_long ps_code; /* for core dump/debugger XXX */
- sigset_t ps_usertramp; /* SunOS compat; libc sigtramp XXX */
-};
-
-/* signal flags */
-#define SAS_OLDMASK 0x01 /* need to restore mask before pause */
-#define SAS_ALTSTACK 0x02 /* have alternate signal stack */
-
-/* additional signal action values, used only temporarily/internally */
-#define SIG_CATCH ((__sighandler_t *)2)
-#define SIG_HOLD ((__sighandler_t *)3)
-
-/*
- * get signal action for process and signal; currently only for current process
- */
-#define SIGACTION(p, sig) (p->p_sigacts->ps_sigact[(sig)])
-
-/*
- * Determine signal that should be delivered to process p, the current
- * process, 0 if none. If there is a pending stop signal with default
- * action, the process stops in issignal().
- */
-#define CURSIG(p) \
- (((p)->p_siglist == 0 || \
- (((p)->p_flag & P_TRACED) == 0 && \
- ((p)->p_siglist & ~(p)->p_sigmask) == 0)) ? \
- 0 : issignal(p))
-
-/*
- * Clear a pending signal from a process.
- */
-#define CLRSIG(p, sig) { (p)->p_siglist &= ~sigmask(sig); }
-
-/*
- * Signal properties and actions.
- * The array below categorizes the signals and their default actions
- * according to the following properties:
- */
-#define SA_KILL 0x01 /* terminates process by default */
-#define SA_CORE 0x02 /* ditto and coredumps */
-#define SA_STOP 0x04 /* suspend process */
-#define SA_TTYSTOP 0x08 /* ditto, from tty */
-#define SA_IGNORE 0x10 /* ignore by default */
-#define SA_CONT 0x20 /* continue if suspended */
-#define SA_CANTMASK 0x40 /* non-maskable, catchable */
-
-#ifdef SIGPROP
-static int sigprop[NSIG + 1] = {
- 0, /* unused */
- SA_KILL, /* SIGHUP */
- SA_KILL, /* SIGINT */
- SA_KILL|SA_CORE, /* SIGQUIT */
- SA_KILL|SA_CORE, /* SIGILL */
- SA_KILL|SA_CORE, /* SIGTRAP */
- SA_KILL|SA_CORE, /* SIGABRT */
- SA_KILL|SA_CORE, /* SIGEMT */
- SA_KILL|SA_CORE, /* SIGFPE */
- SA_KILL, /* SIGKILL */
- SA_KILL|SA_CORE, /* SIGBUS */
- SA_KILL|SA_CORE, /* SIGSEGV */
- SA_KILL|SA_CORE, /* SIGSYS */
- SA_KILL, /* SIGPIPE */
- SA_KILL, /* SIGALRM */
- SA_KILL, /* SIGTERM */
- SA_IGNORE, /* SIGURG */
- SA_STOP, /* SIGSTOP */
- SA_STOP|SA_TTYSTOP, /* SIGTSTP */
- SA_IGNORE|SA_CONT, /* SIGCONT */
- SA_IGNORE, /* SIGCHLD */
- SA_STOP|SA_TTYSTOP, /* SIGTTIN */
- SA_STOP|SA_TTYSTOP, /* SIGTTOU */
- SA_IGNORE, /* SIGIO */
- SA_KILL, /* SIGXCPU */
- SA_KILL, /* SIGXFSZ */
- SA_KILL, /* SIGVTALRM */
- SA_KILL, /* SIGPROF */
- SA_IGNORE, /* SIGWINCH */
- SA_IGNORE, /* SIGINFO */
- SA_KILL, /* SIGUSR1 */
- SA_KILL, /* SIGUSR2 */
-};
-
-#define contsigmask (sigmask(SIGCONT))
-#define stopsigmask (sigmask(SIGSTOP) | sigmask(SIGTSTP) | \
- sigmask(SIGTTIN) | sigmask(SIGTTOU))
-
-#endif /* SIGPROP */
-
-#define sigcantmask (sigmask(SIGKILL) | sigmask(SIGSTOP))
-
-#ifdef KERNEL
-/*
- * Machine-independent functions:
- */
-void execsigs __P((struct proc *p));
-void gsignal __P((int pgid, int sig));
-int issignal __P((struct proc *p));
-void killproc __P((struct proc *p, char *why));
-void pgsignal __P((struct pgrp *pgrp, int sig, int checkctty));
-void postsig __P((int sig));
-void psignal __P((struct proc *p, int sig));
-void setsigvec __P((struct proc *p, int signum, struct sigaction *sa));
-void sigexit __P((struct proc *p, int signum));
-void siginit __P((struct proc *p));
-void trapsignal __P((struct proc *p, int sig, u_long code));
-
-/*
- * Machine-dependent functions:
- */
-void sendsig __P((sig_t action, int sig, int returnmask, u_long code));
-#endif /* KERNEL */
-#endif /* !_SYS_SIGNALVAR_H_ */
diff --git a/cpukit/libnetworking/sys/socket.h b/cpukit/libnetworking/sys/socket.h
deleted file mode 100644
index 7e0f6c7572..0000000000
--- a/cpukit/libnetworking/sys/socket.h
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
- * 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.
- *
- * @(#)socket.h 8.4 (Berkeley) 2/21/94
- * $Id$
- */
-
-#ifndef _SYS_SOCKET_H_
-#define _SYS_SOCKET_H_
-
-/*
- * Definitions related to sockets: types, address families, options.
- */
-
-/*
- * Types
- */
-#define SOCK_STREAM 1 /* stream socket */
-#define SOCK_DGRAM 2 /* datagram socket */
-#define SOCK_RAW 3 /* raw-protocol interface */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */
-#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-#define SO_PRIVSTATE 0x1009 /* get/deny privileged state */
-
-/*
- * Structure used for manipulating linger option.
- */
-struct linger {
- int l_onoff; /* option on/off */
- int l_linger; /* linger time */
-};
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/*
- * Address families.
- */
-#define AF_UNSPEC 0 /* unspecified */
-#define AF_LOCAL 1 /* local to host (pipes, portals) */
-#define AF_UNIX AF_LOCAL /* backward compatibility */
-#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
-#define AF_IMPLINK 3 /* arpanet imp addresses */
-#define AF_PUP 4 /* pup protocols: e.g. BSP */
-#define AF_CHAOS 5 /* mit CHAOS protocols */
-#define AF_NS 6 /* XEROX NS protocols */
-#define AF_ISO 7 /* ISO protocols */
-#define AF_OSI AF_ISO
-#define AF_ECMA 8 /* European computer manufacturers */
-#define AF_DATAKIT 9 /* datakit protocols */
-#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
-#define AF_SNA 11 /* IBM SNA */
-#define AF_DECnet 12 /* DECnet */
-#define AF_DLI 13 /* DEC Direct data link interface */
-#define AF_LAT 14 /* LAT */
-#define AF_HYLINK 15 /* NSC Hyperchannel */
-#define AF_APPLETALK 16 /* Apple Talk */
-#define AF_ROUTE 17 /* Internal Routing Protocol */
-#define AF_LINK 18 /* Link layer interface */
-#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
-#define AF_COIP 20 /* connection-oriented IP, aka ST II */
-#define AF_CNT 21 /* Computer Network Technology */
-#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */
-#define AF_IPX 23 /* Novell Internet Protocol */
-#define AF_SIP 24 /* Simple Internet Protocol */
-#define pseudo_AF_PIP 25 /* Help Identify PIP packets */
-#define AF_ISDN 26 /* Integrated Services Digital Network*/
-#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */
-#define pseudo_AF_KEY 27 /* Internal key-management function */
-#define AF_INET6 28 /* IPv6 */
-
-#define AF_MAX 29
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- u_char sa_len; /* total length */
- u_char sa_family; /* address family */
- char sa_data[14]; /* actually longer; address value */
-};
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- u_short sp_family; /* address family */
- u_short sp_protocol; /* protocol */
-};
-
-/*
- * Protocol families, same as address families for now.
- */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_LOCAL AF_LOCAL
-#define PF_UNIX PF_LOCAL /* backward compatibility */
-#define PF_INET AF_INET
-#define PF_IMPLINK AF_IMPLINK
-#define PF_PUP AF_PUP
-#define PF_CHAOS AF_CHAOS
-#define PF_NS AF_NS
-#define PF_ISO AF_ISO
-#define PF_OSI AF_ISO
-#define PF_ECMA AF_ECMA
-#define PF_DATAKIT AF_DATAKIT
-#define PF_CCITT AF_CCITT
-#define PF_SNA AF_SNA
-#define PF_DECnet AF_DECnet
-#define PF_DLI AF_DLI
-#define PF_LAT AF_LAT
-#define PF_HYLINK AF_HYLINK
-#define PF_APPLETALK AF_APPLETALK
-#define PF_ROUTE AF_ROUTE
-#define PF_LINK AF_LINK
-#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
-#define PF_COIP AF_COIP
-#define PF_CNT AF_CNT
-#define PF_SIP AF_SIP
-#define PF_IPX AF_IPX /* same format as AF_NS */
-#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */
-#define PF_PIP pseudo_AF_PIP
-#define PF_ISDN AF_ISDN
-#define PF_KEY pseudo_AF_KEY
-#define PF_INET6 AF_INET6
-
-#define PF_MAX AF_MAX
-
-/*
- * Definitions for network related sysctl, CTL_NET.
- *
- * Second level is protocol family.
- * Third level is protocol number.
- *
- * Further levels are defined by the individual families below.
- */
-#define NET_MAXID AF_MAX
-
-#define CTL_NET_NAMES { \
- { 0, 0 }, \
- { "unix", CTLTYPE_NODE }, \
- { "inet", CTLTYPE_NODE }, \
- { "implink", CTLTYPE_NODE }, \
- { "pup", CTLTYPE_NODE }, \
- { "chaos", CTLTYPE_NODE }, \
- { "xerox_ns", CTLTYPE_NODE }, \
- { "iso", CTLTYPE_NODE }, \
- { "emca", CTLTYPE_NODE }, \
- { "datakit", CTLTYPE_NODE }, \
- { "ccitt", CTLTYPE_NODE }, \
- { "ibm_sna", CTLTYPE_NODE }, \
- { "decnet", CTLTYPE_NODE }, \
- { "dec_dli", CTLTYPE_NODE }, \
- { "lat", CTLTYPE_NODE }, \
- { "hylink", CTLTYPE_NODE }, \
- { "appletalk", CTLTYPE_NODE }, \
- { "route", CTLTYPE_NODE }, \
- { "link_layer", CTLTYPE_NODE }, \
- { "xtp", CTLTYPE_NODE }, \
- { "coip", CTLTYPE_NODE }, \
- { "cnt", CTLTYPE_NODE }, \
- { "rtip", CTLTYPE_NODE }, \
- { "ipx", CTLTYPE_NODE }, \
- { "sip", CTLTYPE_NODE }, \
- { "pip", CTLTYPE_NODE }, \
- { "isdn", CTLTYPE_NODE }, \
- { "key", CTLTYPE_NODE }, \
-}
-
-/*
- * PF_ROUTE - Routing table
- *
- * Three additional levels are defined:
- * Fourth: address family, 0 is wildcard
- * Fifth: type of info, defined below
- * Sixth: flag(s) to mask with for NET_RT_FLAGS
- */
-#define NET_RT_DUMP 1 /* dump; may limit to a.f. */
-#define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */
-#define NET_RT_IFLIST 3 /* survey interface list */
-#define NET_RT_MAXID 4
-
-#define CTL_NET_RT_NAMES { \
- { 0, 0 }, \
- { "dump", CTLTYPE_STRUCT }, \
- { "flags", CTLTYPE_STRUCT }, \
- { "iflist", CTLTYPE_STRUCT }, \
-}
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#define SOMAXCONN 128
-
-/*
- * Message header for recvmsg and sendmsg calls.
- * Used value-result for recvmsg, value only for sendmsg.
- */
-struct msghdr {
- caddr_t msg_name; /* optional address */
- u_int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- u_int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_control; /* ancillary data, see below */
- u_int msg_controllen; /* ancillary data buffer len */
- int msg_flags; /* flags on received message */
-};
-
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-#define MSG_EOR 0x8 /* data completes record */
-#define MSG_TRUNC 0x10 /* data discarded before delivery */
-#define MSG_CTRUNC 0x20 /* control data lost before delivery */
-#define MSG_WAITALL 0x40 /* wait for full request or error */
-#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */
-#define MSG_EOF 0x100 /* data completes connection */
-#define MSG_COMPAT 0x8000 /* used in sendit() */
-
-/*
- * Header for ancillary data objects in msg_control buffer.
- * Used for additional information with/about a datagram
- * not expressible by flags. The format is a sequence
- * of message elements headed by cmsghdr structures.
- */
-struct cmsghdr {
- u_int cmsg_len; /* data byte count, including hdr */
- int cmsg_level; /* originating protocol */
- int cmsg_type; /* protocol-specific type */
-/* followed by u_char cmsg_data[]; */
-};
-
-/* given pointer to struct cmsghdr, return pointer to data */
-#define CMSG_DATA(cmsg) ((u_char *)((cmsg) + 1))
-
-/* given pointer to struct cmsghdr, return pointer to next cmsghdr */
-#define CMSG_NXTHDR(mhdr, cmsg) \
- (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
- (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
- (struct cmsghdr *)NULL : \
- (struct cmsghdr *)((caddr_t)(cmsg) + ALIGN((cmsg)->cmsg_len)))
-
-#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
-
-/* "Socket"-level control message types: */
-#define SCM_RIGHTS 0x01 /* access rights (array of int) */
-#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */
-
-/*
- * 4.3 compat sockaddr, move to compat file later
- */
-struct osockaddr {
- u_short sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
-};
-
-/*
- * 4.3-compat message header (move to compat file later).
- */
-struct omsghdr {
- caddr_t msg_name; /* optional address */
- int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_accrights; /* access rights sent/received */
- int msg_accrightslen;
-};
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int accept __P((int, struct sockaddr *, int *));
-int bind __P((int, const struct sockaddr *, int));
-int connect __P((int, const struct sockaddr *, int));
-int getpeername __P((int, struct sockaddr *, int *));
-int getsockname __P((int, struct sockaddr *, int *));
-int getsockopt __P((int, int, int, void *, int *));
-int listen __P((int, int));
-ssize_t recv __P((int, void *, size_t, int));
-ssize_t recvfrom __P((int, void *, size_t, int, struct sockaddr *, int *));
-ssize_t recvmsg __P((int, struct msghdr *, int));
-ssize_t send __P((int, const void *, size_t, int));
-ssize_t sendto __P((int, const void *,
- size_t, int, const struct sockaddr *, int));
-ssize_t sendmsg __P((int, const struct msghdr *, int));
-int setsockopt __P((int, int, int, const void *, int));
-int shutdown __P((int, int));
-int socket __P((int, int, int));
-int socketpair __P((int, int, int, int *));
-__END_DECLS
-
-#else /* KERNEL */
-void pfctlinput __P((int, struct sockaddr *));
-#endif /* !KERNEL */
-#endif /* !_SYS_SOCKET_H_ */
diff --git a/cpukit/libnetworking/sys/socketvar.h b/cpukit/libnetworking/sys/socketvar.h
deleted file mode 100644
index 257fee012b..0000000000
--- a/cpukit/libnetworking/sys/socketvar.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 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.
- *
- * @(#)socketvar.h 8.3 (Berkeley) 2/19/95
- * $Id$
- */
-
-#ifndef _SYS_SOCKETVAR_H_
-#define _SYS_SOCKETVAR_H_
-
-#include <sys/queue.h> /* for TAILQ macros */
-#include <sys/select.h> /* for struct selinfo */
-
-/*
- * Kernel structure per socket.
- * Contains send and receive buffer queues,
- * handle on protocol and pointer to protocol
- * private data and error information.
- */
-struct socket {
- short so_type; /* generic type, see socket.h */
- short so_options; /* from socket call, see socket.h */
- short so_linger; /* time to linger while closing */
- short so_state; /* internal state flags SS_*, below */
- caddr_t so_pcb; /* protocol control block */
- struct protosw *so_proto; /* protocol handle */
-/*
- * Variables for connection queuing.
- * Socket where accepts occur is so_head in all subsidiary sockets.
- * If so_head is 0, socket is not related to an accept.
- * For head socket so_q0 queues partially completed connections,
- * while so_q is a queue of connections ready to be accepted.
- * If a connection is aborted and it has so_head set, then
- * it has to be pulled out of either so_q0 or so_q.
- * We allow connections to queue up based on current queue lengths
- * and limit on number of queued connections for this socket.
- */
- struct socket *so_head; /* back pointer to accept socket */
- TAILQ_HEAD(, socket) so_incomp; /* queue of partial unaccepted connections */
- TAILQ_HEAD(, socket) so_comp; /* queue of complete unaccepted connections */
- TAILQ_ENTRY(socket) so_list; /* list of unaccepted connections */
- short so_qlen; /* number of unaccepted connections */
- short so_incqlen; /* number of unaccepted incomplete
- connections */
- short so_qlimit; /* max number queued connections */
- short so_timeo; /* connection timeout */
- u_short so_error; /* error affecting connection */
- pid_t so_pgid; /* pgid for signals */
- u_long so_oobmark; /* chars to oob mark */
-/*
- * Variables for socket buffering.
- */
- struct sockbuf {
- u_long sb_cc; /* actual chars in buffer */
- u_long sb_hiwat; /* max actual char count */
- u_long sb_mbcnt; /* chars of mbufs used */
- u_long sb_mbmax; /* max chars of mbufs to use */
- long sb_lowat; /* low water mark */
- struct mbuf *sb_mb; /* the mbuf chain */
- struct selinfo sb_sel; /* process selecting read/write */
- short sb_flags; /* flags, see below */
- short sb_timeo; /* timeout for read/write */
- } so_rcv, so_snd;
-#define SB_MAX (256*1024) /* default for max chars in sockbuf */
-#define SB_LOCK 0x01 /* lock on data queue */
-#define SB_WANT 0x02 /* someone is waiting to lock */
-#define SB_WAIT 0x04 /* someone is waiting for data/space */
-#define SB_SEL 0x08 /* someone is selecting */
-#define SB_ASYNC 0x10 /* ASYNC I/O, need signals */
-#define SB_NOTIFY (SB_WAIT|SB_SEL|SB_ASYNC)
-#define SB_NOINTR 0x40 /* operations not interruptible */
-
- caddr_t so_tpcb; /* Wisc. protocol control block XXX */
- void (*so_upcall) __P((struct socket *so, caddr_t arg, int waitf));
- caddr_t so_upcallarg; /* Arg for above */
- uid_t so_uid; /* who opened the socket */
-};
-
-/*
- * Socket state bits.
- */
-#define SS_NOFDREF 0x0001 /* no file table ref any more */
-#define SS_ISCONNECTED 0x0002 /* socket connected to a peer */
-#define SS_ISCONNECTING 0x0004 /* in process of connecting to peer */
-#define SS_ISDISCONNECTING 0x0008 /* in process of disconnecting */
-#define SS_CANTSENDMORE 0x0010 /* can't send more data to peer */
-#define SS_CANTRCVMORE 0x0020 /* can't receive more data from peer */
-#define SS_RCVATMARK 0x0040 /* at mark on input */
-
-#define SS_PRIV 0x0080 /* privileged for broadcast, raw... */
-#define SS_NBIO 0x0100 /* non-blocking ops */
-#define SS_ASYNC 0x0200 /* async i/o notify */
-#define SS_ISCONFIRMING 0x0400 /* deciding to accept connection req */
-
-#define SS_INCOMP 0x0800 /* unaccepted, incomplete connection */
-#define SS_COMP 0x1000 /* unaccepted, complete connection */
-
-
-/*
- * Macros for sockets and socket buffering.
- */
-
-/*
- * How much space is there in a socket buffer (so->so_snd or so->so_rcv)?
- * This is problematical if the fields are unsigned, as the space might
- * still be negative (cc > hiwat or mbcnt > mbmax). Should detect
- * overflow and return 0. Should use "lmin" but it doesn't exist now.
- */
-#define sbspace(sb) \
- ((long) imin((int)((sb)->sb_hiwat - (sb)->sb_cc), \
- (int)((sb)->sb_mbmax - (sb)->sb_mbcnt)))
-
-/* do we have to send all at once on a socket? */
-#define sosendallatonce(so) \
- ((so)->so_proto->pr_flags & PR_ATOMIC)
-
-/* can we read something from so? */
-#define soreadable(so) \
- ((so)->so_rcv.sb_cc >= (so)->so_rcv.sb_lowat || \
- ((so)->so_state & SS_CANTRCVMORE) || \
- (so)->so_comp.tqh_first || (so)->so_error)
-
-/* can we write something to so? */
-#define sowriteable(so) \
- ((sbspace(&(so)->so_snd) >= (so)->so_snd.sb_lowat && \
- (((so)->so_state&SS_ISCONNECTED) || \
- ((so)->so_proto->pr_flags&PR_CONNREQUIRED)==0)) || \
- ((so)->so_state & SS_CANTSENDMORE) || \
- (so)->so_error)
-
-/* adjust counters in sb reflecting allocation of m */
-#define sballoc(sb, m) { \
- (sb)->sb_cc += (m)->m_len; \
- (sb)->sb_mbcnt += MSIZE; \
- if ((m)->m_flags & M_EXT) \
- (sb)->sb_mbcnt += (m)->m_ext.ext_size; \
-}
-
-/* adjust counters in sb reflecting freeing of m */
-#define sbfree(sb, m) { \
- (sb)->sb_cc -= (m)->m_len; \
- (sb)->sb_mbcnt -= MSIZE; \
- if ((m)->m_flags & M_EXT) \
- (sb)->sb_mbcnt -= (m)->m_ext.ext_size; \
-}
-
-/*
- * Set lock on sockbuf sb; sleep if lock is already held.
- * Unless SB_NOINTR is set on sockbuf, sleep is interruptible.
- * Returns error without lock if sleep is interrupted.
- */
-#define sblock(sb, wf) ((sb)->sb_flags & SB_LOCK ? \
- (((wf) == M_WAITOK) ? sb_lock(sb) : EWOULDBLOCK) : \
- ((sb)->sb_flags |= SB_LOCK), 0)
-
-/* release lock on sockbuf sb */
-#define sbunlock(sb) { \
- (sb)->sb_flags &= ~SB_LOCK; \
- if ((sb)->sb_flags & SB_WANT) { \
- (sb)->sb_flags &= ~SB_WANT; \
- wakeup((caddr_t)&(sb)->sb_flags); \
- } \
-}
-
-#define sorwakeup(so) { sowakeup((so), &(so)->so_rcv); \
- if ((so)->so_upcall) \
- (*((so)->so_upcall))((so), (so)->so_upcallarg, M_DONTWAIT); \
- }
-
-#define sowwakeup(so) sowakeup((so), &(so)->so_snd)
-
-#ifdef KERNEL
-extern u_long sb_max;
-
-/* to catch callers missing new second argument to sonewconn: */
-#define sonewconn(head, connstatus) sonewconn1((head), (connstatus))
-
-struct filedesc;
-struct mbuf;
-struct sockaddr;
-struct stat;
-
-/*
- * File operations on sockets.
- */
-int soo_ioctl __P((struct file *fp, int cmd, caddr_t data,
- struct proc *p));
-int soo_select __P((struct file *fp, int which, struct proc *p));
-int soo_stat __P((struct socket *so, struct stat *ub));
-
-/*
- * From uipc_socket and friends
- */
-int getsock __P((struct filedesc *fdp, int fdes, struct file **fpp));
-int sockargs __P((struct mbuf **mp, caddr_t buf, int buflen, int type));
-void sbappend __P((struct sockbuf *sb, struct mbuf *m));
-int sbappendaddr __P((struct sockbuf *sb, struct sockaddr *asa,
- struct mbuf *m0, struct mbuf *control));
-int sbappendcontrol __P((struct sockbuf *sb, struct mbuf *m0,
- struct mbuf *control));
-void sbappendrecord __P((struct sockbuf *sb, struct mbuf *m0));
-void sbcheck __P((struct sockbuf *sb));
-void sbcompress __P((struct sockbuf *sb, struct mbuf *m, struct mbuf *n));
-struct mbuf *
- sbcreatecontrol __P((caddr_t p, int size, int type, int level));
-void sbdrop __P((struct sockbuf *sb, int len));
-void sbdroprecord __P((struct sockbuf *sb));
-void sbflush __P((struct sockbuf *sb));
-void sbinsertoob __P((struct sockbuf *sb, struct mbuf *m0));
-void sbrelease __P((struct sockbuf *sb));
-int sbreserve __P((struct sockbuf *sb, u_long cc));
-int sbwait __P((struct sockbuf *sb));
-int sb_lock __P((struct sockbuf *sb));
-int soabort __P((struct socket *so));
-int soaccept __P((struct socket *so, struct mbuf *nam));
-int sobind __P((struct socket *so, struct mbuf *nam));
-void socantrcvmore __P((struct socket *so));
-void socantsendmore __P((struct socket *so));
-int soclose __P((struct socket *so));
-int soconnect __P((struct socket *so, struct mbuf *nam));
-int soconnect2 __P((struct socket *so1, struct socket *so2));
-int socreate __P((int dom, struct socket **aso, int type, int proto,
- struct proc *p));
-int sodisconnect __P((struct socket *so));
-void sofree __P((struct socket *so));
-int sogetopt __P((struct socket *so, int level, int optname,
- struct mbuf **mp));
-void sohasoutofband __P((struct socket *so));
-void soisconnected __P((struct socket *so));
-void soisconnecting __P((struct socket *so));
-void soisdisconnected __P((struct socket *so));
-void soisdisconnecting __P((struct socket *so));
-int solisten __P((struct socket *so, int backlog));
-struct socket *
- sodropablereq __P((struct socket *head));
-struct socket *
- sonewconn1 __P((struct socket *head, int connstatus));
-int soreceive __P((struct socket *so, struct mbuf **paddr, struct uio *uio,
- struct mbuf **mp0, struct mbuf **controlp, int *flagsp));
-int soreserve __P((struct socket *so, u_long sndcc, u_long rcvcc));
-void sorflush __P((struct socket *so));
-int sosend __P((struct socket *so, struct mbuf *addr, struct uio *uio,
- struct mbuf *top, struct mbuf *control, int flags));
-int sosetopt __P((struct socket *so, int level, int optname,
- struct mbuf *m0));
-int soshutdown __P((struct socket *so, int how));
-void sowakeup __P((struct socket *so, struct sockbuf *sb));
-#endif /* KERNEL */
-
-#endif /* !_SYS_SOCKETVAR_H_ */
diff --git a/cpukit/libnetworking/sys/sysctl.h b/cpukit/libnetworking/sys/sysctl.h
deleted file mode 100644
index b25ba43c4f..0000000000
--- a/cpukit/libnetworking/sys/sysctl.h
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Mike Karels at Berkeley Software Design, Inc.
- *
- * 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.
- *
- * @(#)sysctl.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_SYSCTL_H_
-#define _SYS_SYSCTL_H_
-
-/*
- * Definitions for sysctl call. The sysctl call uses a hierarchical name
- * for objects that can be examined or modified. The name is expressed as
- * a sequence of integers. Like a file path name, the meaning of each
- * component depends on its place in the hierarchy. The top-level and kern
- * identifiers are defined here, and other identifiers are defined in the
- * respective subsystem header files.
- */
-
-#define CTL_MAXNAME 12 /* largest number of components supported */
-
-/*
- * Each subsystem defined by sysctl defines a list of variables
- * for that subsystem. Each name is either a node with further
- * levels defined below it, or it is a leaf of some particular
- * type given below. Each sysctl level defines a set of name/type
- * pairs to be used by sysctl(1) in manipulating the subsystem.
- */
-struct ctlname {
- char *ctl_name; /* subsystem name */
- int ctl_type; /* type of name */
-};
-
-#define CTLTYPE 0xf /* Mask for the type */
-#define CTLTYPE_NODE 1 /* name is a node */
-#define CTLTYPE_INT 2 /* name describes an integer */
-#define CTLTYPE_STRING 3 /* name describes a string */
-#define CTLTYPE_QUAD 4 /* name describes a 64-bit number */
-#define CTLTYPE_OPAQUE 5 /* name describes a structure */
-#define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */
-
-#define CTLFLAG_RD 0x80000000 /* Allow reads of variable */
-#define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */
-#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR)
-#define CTLFLAG_NOLOCK 0x20000000 /* XXX Don't Lock */
-#define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */
-
-/*
- * USE THIS instead of a hardwired number from the categories below
- * to get dynamically assigned sysctl entries using the linker-set
- * technology. This is the way nearly all new sysctl variables should
- * be implimented.
- * e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, "");
- */
-#define OID_AUTO (-1)
-
-#ifdef KERNEL
-#define SYSCTL_HANDLER_ARGS (struct sysctl_oid *oidp, void *arg1, int arg2, \
- struct sysctl_req *req)
-
-/*
- * This describes the access space for a sysctl request. This is needed
- * so that we can use the interface from the kernel or from user-space.
- */
-struct sysctl_req {
- struct proc *p;
- int lock;
- void *oldptr;
- int oldlen;
- int oldidx;
- int (*oldfunc)(struct sysctl_req *, const void *, int);
- void *newptr;
- int newlen;
- int newidx;
- int (*newfunc)(struct sysctl_req *, void *, int);
-};
-
-/*
- * This describes one "oid" in the MIB tree. Potentially more nodes can
- * be hidden behind it, expanded by the handler.
- */
-struct sysctl_oid {
- int oid_number;
- int oid_kind;
- void *oid_arg1;
- int oid_arg2;
- const char *oid_name;
- int (*oid_handler) SYSCTL_HANDLER_ARGS;
- const char *oid_fmt;
-};
-
-#define SYSCTL_IN(r, p, l)
-#define SYSCTL_OUT(r, p, l)
-
-int sysctl_handle_int SYSCTL_HANDLER_ARGS;
-int sysctl_handle_string SYSCTL_HANDLER_ARGS;
-int sysctl_handle_opaque SYSCTL_HANDLER_ARGS;
-
-/* This is the "raw" function for a mib-oid */
-#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr)
-
-/* This makes a node from which other oids can hang */
-#define SYSCTL_NODE(parent, nbr, name, access, handler, descr)
-
-/* This is a string len can be 0 to indicate '\0' termination */
-#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr)
-
-/* This is a integer, if ptr is NULL, val is returned */
-#define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr)
-
-/* This is anything, specified by a pointer and a lenth */
-#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr)
-
-/* This is a struct, specified by a pointer and type */
-#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr)
-
-/* Needs a proc. Specify by pointer and arg */
-#define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr)
-#endif /* KERNEL */
-
-/*
- * Top-level identifiers
- */
-#define CTL_UNSPEC 0 /* unused */
-#define CTL_KERN 1 /* "high kernel": proc, limits */
-#define CTL_VM 2 /* virtual memory */
-#define CTL_VFS 3 /* file system, mount type is next */
-#define CTL_NET 4 /* network, see socket.h */
-#define CTL_DEBUG 5 /* debugging parameters */
-#define CTL_HW 6 /* generic cpu/io */
-#define CTL_MACHDEP 7 /* machine dependent */
-#define CTL_USER 8 /* user-level */
-#define CTL_MAXID 9 /* number of valid top-level ids */
-
-#define CTL_NAMES { \
- { 0, 0 }, \
- { "kern", CTLTYPE_NODE }, \
- { "vm", CTLTYPE_NODE }, \
- { "vfs", CTLTYPE_NODE }, \
- { "net", CTLTYPE_NODE }, \
- { "debug", CTLTYPE_NODE }, \
- { "hw", CTLTYPE_NODE }, \
- { "machdep", CTLTYPE_NODE }, \
- { "user", CTLTYPE_NODE }, \
-}
-
-/*
- * CTL_KERN identifiers
- */
-#define KERN_OSTYPE 1 /* string: system version */
-#define KERN_OSRELEASE 2 /* string: system release */
-#define KERN_OSREV 3 /* int: system revision */
-#define KERN_VERSION 4 /* string: compile time info */
-#define KERN_MAXVNODES 5 /* int: max vnodes */
-#define KERN_MAXPROC 6 /* int: max processes */
-#define KERN_MAXFILES 7 /* int: max open files */
-#define KERN_ARGMAX 8 /* int: max arguments to exec */
-#define KERN_SECURELVL 9 /* int: system security level */
-#define KERN_HOSTNAME 10 /* string: hostname */
-#define KERN_HOSTID 11 /* int: host identifier */
-#define KERN_CLOCKRATE 12 /* struct: struct clockrate */
-#define KERN_VNODE 13 /* struct: vnode structures */
-#define KERN_PROC 14 /* struct: process entries */
-#define KERN_FILE 15 /* struct: file entries */
-#define KERN_PROF 16 /* node: kernel profiling info */
-#define KERN_POSIX1 17 /* int: POSIX.1 version */
-#define KERN_NGROUPS 18 /* int: # of supplemental group ids */
-#define KERN_JOB_CONTROL 19 /* int: is job control available */
-#define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */
-#define KERN_BOOTTIME 21 /* struct: time kernel was booted */
-#define KERN_NISDOMAINNAME 22 /* string: YP domain name */
-#define KERN_UPDATEINTERVAL 23 /* int: update process sleep time */
-#define KERN_OSRELDATE 24 /* int: OS release date */
-#define KERN_NTP_PLL 25 /* node: NTP PLL control */
-#define KERN_BOOTFILE 26 /* string: name of booted kernel */
-#define KERN_MAXFILESPERPROC 27 /* int: max open files per proc */
-#define KERN_MAXPROCPERUID 28 /* int: max processes per uid */
-#define KERN_DUMPDEV 29 /* dev_t: device to dump on */
-#define KERN_SOMAXCONN 30 /* int: max connections in listen q */
-#define KERN_MAXSOCKBUF 31 /* int: max size of a socket buffer */
-#define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */
-#define KERN_USRSTACK 33 /* int: address of USRSTACK */
-#define KERN_MAXID 34 /* number of valid kern ids */
-
-#define CTL_KERN_NAMES { \
- { 0, 0 }, \
- { "ostype", CTLTYPE_STRING }, \
- { "osrelease", CTLTYPE_STRING }, \
- { "osrevision", CTLTYPE_INT }, \
- { "version", CTLTYPE_STRING }, \
- { "maxvnodes", CTLTYPE_INT }, \
- { "maxproc", CTLTYPE_INT }, \
- { "maxfiles", CTLTYPE_INT }, \
- { "argmax", CTLTYPE_INT }, \
- { "securelevel", CTLTYPE_INT }, \
- { "hostname", CTLTYPE_STRING }, \
- { "hostid", CTLTYPE_INT }, \
- { "clockrate", CTLTYPE_STRUCT }, \
- { "vnode", CTLTYPE_STRUCT }, \
- { "proc", CTLTYPE_STRUCT }, \
- { "file", CTLTYPE_STRUCT }, \
- { "profiling", CTLTYPE_NODE }, \
- { "posix1version", CTLTYPE_INT }, \
- { "ngroups", CTLTYPE_INT }, \
- { "job_control", CTLTYPE_INT }, \
- { "saved_ids", CTLTYPE_INT }, \
- { "boottime", CTLTYPE_STRUCT }, \
- { "nisdomainname", CTLTYPE_STRING }, \
- { "update", CTLTYPE_INT }, \
- { "osreldate", CTLTYPE_INT }, \
- { "ntp_pll", CTLTYPE_NODE }, \
- { "bootfile", CTLTYPE_STRING }, \
- { "maxfilesperproc", CTLTYPE_INT }, \
- { "maxprocperuid", CTLTYPE_INT }, \
- { "dumpdev", CTLTYPE_STRUCT }, /* we lie; don't print as int */ \
- { "somaxconn", CTLTYPE_INT }, \
- { "maxsockbuf", CTLTYPE_INT }, \
- { "ps_strings", CTLTYPE_INT }, \
- { "usrstack", CTLTYPE_INT }, \
-}
-
-/*
- * CTL_VFS identifiers
- */
-#define VFS_VFSCONF 0 /* get configured filesystems */
-#define VFS_MAXID 1 /* number of items */
-
-#define CTL_VFS_NAMES { \
- { "vfsconf", CTLTYPE_STRUCT }, \
-}
-
-/*
- * KERN_PROC subtypes
- */
-#define KERN_PROC_ALL 0 /* everything */
-#define KERN_PROC_PID 1 /* by process id */
-#define KERN_PROC_PGRP 2 /* by process group id */
-#define KERN_PROC_SESSION 3 /* by session of pid */
-#define KERN_PROC_TTY 4 /* by controlling tty */
-#define KERN_PROC_UID 5 /* by effective uid */
-#define KERN_PROC_RUID 6 /* by real uid */
-
-/*
- * CTL_HW identifiers
- */
-#define HW_MACHINE 1 /* string: machine class */
-#define HW_MODEL 2 /* string: specific machine model */
-#define HW_NCPU 3 /* int: number of cpus */
-#define HW_BYTEORDER 4 /* int: machine byte order */
-#define HW_PHYSMEM 5 /* int: total memory */
-#define HW_USERMEM 6 /* int: non-kernel memory */
-#define HW_PAGESIZE 7 /* int: software page size */
-#define HW_DISKNAMES 8 /* strings: disk drive names */
-#define HW_DISKSTATS 9 /* struct: diskstats[] */
-#define HW_FLOATINGPT 10 /* int: has HW floating point? */
-#define HW_MACHINE_ARCH 11 /* string: machine architecture */
-#define HW_MAXID 12 /* number of valid hw ids */
-
-#define CTL_HW_NAMES { \
- { 0, 0 }, \
- { "machine", CTLTYPE_STRING }, \
- { "model", CTLTYPE_STRING }, \
- { "ncpu", CTLTYPE_INT }, \
- { "byteorder", CTLTYPE_INT }, \
- { "physmem", CTLTYPE_INT }, \
- { "usermem", CTLTYPE_INT }, \
- { "pagesize", CTLTYPE_INT }, \
- { "disknames", CTLTYPE_STRUCT }, \
- { "diskstats", CTLTYPE_STRUCT }, \
- { "floatingpoint", CTLTYPE_INT }, \
-}
-
-/*
- * CTL_USER definitions
- */
-#define USER_CS_PATH 1 /* string: _CS_PATH */
-#define USER_BC_BASE_MAX 2 /* int: BC_BASE_MAX */
-#define USER_BC_DIM_MAX 3 /* int: BC_DIM_MAX */
-#define USER_BC_SCALE_MAX 4 /* int: BC_SCALE_MAX */
-#define USER_BC_STRING_MAX 5 /* int: BC_STRING_MAX */
-#define USER_COLL_WEIGHTS_MAX 6 /* int: COLL_WEIGHTS_MAX */
-#define USER_EXPR_NEST_MAX 7 /* int: EXPR_NEST_MAX */
-#define USER_LINE_MAX 8 /* int: LINE_MAX */
-#define USER_RE_DUP_MAX 9 /* int: RE_DUP_MAX */
-#define USER_POSIX2_VERSION 10 /* int: POSIX2_VERSION */
-#define USER_POSIX2_C_BIND 11 /* int: POSIX2_C_BIND */
-#define USER_POSIX2_C_DEV 12 /* int: POSIX2_C_DEV */
-#define USER_POSIX2_CHAR_TERM 13 /* int: POSIX2_CHAR_TERM */
-#define USER_POSIX2_FORT_DEV 14 /* int: POSIX2_FORT_DEV */
-#define USER_POSIX2_FORT_RUN 15 /* int: POSIX2_FORT_RUN */
-#define USER_POSIX2_LOCALEDEF 16 /* int: POSIX2_LOCALEDEF */
-#define USER_POSIX2_SW_DEV 17 /* int: POSIX2_SW_DEV */
-#define USER_POSIX2_UPE 18 /* int: POSIX2_UPE */
-#define USER_STREAM_MAX 19 /* int: POSIX2_STREAM_MAX */
-#define USER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */
-#define USER_MAXID 21 /* number of valid user ids */
-
-#define CTL_USER_NAMES { \
- { 0, 0 }, \
- { "cs_path", CTLTYPE_STRING }, \
- { "bc_base_max", CTLTYPE_INT }, \
- { "bc_dim_max", CTLTYPE_INT }, \
- { "bc_scale_max", CTLTYPE_INT }, \
- { "bc_string_max", CTLTYPE_INT }, \
- { "coll_weights_max", CTLTYPE_INT }, \
- { "expr_nest_max", CTLTYPE_INT }, \
- { "line_max", CTLTYPE_INT }, \
- { "re_dup_max", CTLTYPE_INT }, \
- { "posix2_version", CTLTYPE_INT }, \
- { "posix2_c_bind", CTLTYPE_INT }, \
- { "posix2_c_dev", CTLTYPE_INT }, \
- { "posix2_char_term", CTLTYPE_INT }, \
- { "posix2_fort_dev", CTLTYPE_INT }, \
- { "posix2_fort_run", CTLTYPE_INT }, \
- { "posix2_localedef", CTLTYPE_INT }, \
- { "posix2_sw_dev", CTLTYPE_INT }, \
- { "posix2_upe", CTLTYPE_INT }, \
- { "stream_max", CTLTYPE_INT }, \
- { "tzname_max", CTLTYPE_INT }, \
-}
-
-#ifdef KERNEL
-
-extern char cpu_model[];
-extern char machine[];
-extern char osrelease[];
-extern char ostype[];
-
-int kernel_sysctl(struct proc *p, int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen, int *retval);
-int userland_sysctl(struct proc *p, int *name, u_int namelen, void *old, size_t *oldlenp, int inkernel, void *new, size_t newlen, int *retval);
-/*
-int sysctl_clockrate __P((char *, size_t*));
-int sysctl_file __P((char *, size_t*));
-int sysctl_doproc __P((int *, u_int, char *, size_t*));
-int sysctl_doprof __P((int *, u_int, void *, size_t *, void *, size_t));
-*/
-
-#else /* !KERNEL */
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int sysctl __P((int *, u_int, void *, size_t *, void *, size_t));
-int sysctlbyname __P((const char *, void *, size_t *, void *, size_t));
-__END_DECLS
-#endif /* KERNEL */
-
-#endif /* !_SYS_SYSCTL_H_ */
diff --git a/cpukit/libnetworking/sys/syslimits.h b/cpukit/libnetworking/sys/syslimits.h
deleted file mode 100644
index 283a0241e3..0000000000
--- a/cpukit/libnetworking/sys/syslimits.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 1988, 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.
- *
- * @(#)syslimits.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_SYSLIMITS_H_
-#define _SYS_SYSLIMITS_H_
-
-#if !defined(__rtems__)
-#define ARG_MAX 65536 /* max bytes for an exec function */
-#endif
-
-#if !defined(__rtems__)
-#ifndef CHILD_MAX
-#define CHILD_MAX 40 /* max simultaneous processes */
-#endif
-#endif
-
-#if !defined(__rtems__)
-#define LINK_MAX 32767 /* max file link count */
-#endif
-
-#define MAX_CANON 255 /* max bytes in term canon input line */
-
-#define MAX_INPUT 255 /* max bytes in terminal input */
-
-#if !defined(__rtems__)
-#define NAME_MAX 255 /* max bytes in a file name */
-#endif
-
-#define NGROUPS_MAX 16 /* max supplemental group id's */
-
-#if !defined(__rtems__)
-#ifndef OPEN_MAX
-#define OPEN_MAX 64 /* max open files per process */
-#endif
-#endif
-
-#if !defined(__rtems__)
-#define PATH_MAX 1024 /* max bytes in pathname */
-#endif
-
-#define PIPE_BUF 512 /* max bytes for atomic pipe writes */
-
-#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */
-#define BC_DIM_MAX 2048 /* max array elements in bc(1) */
-#define BC_SCALE_MAX 99 /* max scale value in bc(1) */
-#define BC_STRING_MAX 1000 /* max const string length in bc(1) */
-#define COLL_WEIGHTS_MAX 0 /* max weights for order keyword */
-#define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */
-#define LINE_MAX 2048 /* max bytes in an input line */
-#define RE_DUP_MAX 255 /* max RE's in interval notation */
-
-#endif
diff --git a/cpukit/libnetworking/sys/syslog.h b/cpukit/libnetworking/sys/syslog.h
deleted file mode 100644
index 724bee62c7..0000000000
--- a/cpukit/libnetworking/sys/syslog.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 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.
- *
- * @(#)syslog.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_SYSLOG_H_
-#define _SYS_SYSLOG_H_
-
-#define _PATH_LOG "/var/run/log"
-#define _PATH_OLDLOG "/dev/log" /* backward compatibility */
-
-/*
- * priorities/facilities are encoded into a single 32-bit quantity, where the
- * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
- * (0-big number). Both the priorities and the facilities map roughly
- * one-to-one to strings in the syslogd(8) source code. This mapping is
- * included in this file.
- *
- * priorities (these are ordered)
- */
-#define LOG_EMERG 0 /* system is unusable */
-#define LOG_ALERT 1 /* action must be taken immediately */
-#define LOG_CRIT 2 /* critical conditions */
-#define LOG_ERR 3 /* error conditions */
-#define LOG_WARNING 4 /* warning conditions */
-#define LOG_NOTICE 5 /* normal but significant condition */
-#define LOG_INFO 6 /* informational */
-#define LOG_DEBUG 7 /* debug-level messages */
-
-#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
- /* extract priority */
-#define LOG_PRI(p) ((p) & LOG_PRIMASK)
-#define LOG_MAKEPRI(fac, pri) ((fac) | (pri))
-
-#ifdef SYSLOG_NAMES
-#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
- /* mark "facility" */
-#define INTERNAL_MARK LOG_MAKEPRI((LOG_NFACILITIES<<3), 0)
-typedef struct _code {
- char *c_name;
- int c_val;
-} CODE;
-
-CODE prioritynames[] = {
- { "alert", LOG_ALERT, },
- { "crit", LOG_CRIT, },
- { "debug", LOG_DEBUG, },
- { "emerg", LOG_EMERG, },
- { "err", LOG_ERR, },
- { "error", LOG_ERR, }, /* DEPRECATED */
- { "info", LOG_INFO, },
- { "none", INTERNAL_NOPRI, }, /* INTERNAL */
- { "notice", LOG_NOTICE, },
- { "panic", LOG_EMERG, }, /* DEPRECATED */
- { "warn", LOG_WARNING, }, /* DEPRECATED */
- { "warning", LOG_WARNING, },
- { NULL, -1, }
-};
-#endif
-
-/* facility codes */
-#define LOG_KERN (0<<3) /* kernel messages */
-#define LOG_USER (1<<3) /* random user-level messages */
-#define LOG_MAIL (2<<3) /* mail system */
-#define LOG_DAEMON (3<<3) /* system daemons */
-#define LOG_AUTH (4<<3) /* security/authorization messages */
-#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
-#define LOG_LPR (6<<3) /* line printer subsystem */
-#define LOG_NEWS (7<<3) /* network news subsystem */
-#define LOG_UUCP (8<<3) /* UUCP subsystem */
-#define LOG_CRON (9<<3) /* clock daemon */
-#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
- /* Facility #10 clashes in DEC UNIX, where */
- /* it's defined as LOG_MEGASAFE for AdvFS */
- /* event logging. */
-#define LOG_FTP (11<<3) /* ftp daemon */
-#define LOG_NTP (12<<3) /* NTP subsystem */
-
- /* other codes through 15 reserved for system use */
-#define LOG_LOCAL0 (16<<3) /* reserved for local use */
-#define LOG_LOCAL1 (17<<3) /* reserved for local use */
-#define LOG_LOCAL2 (18<<3) /* reserved for local use */
-#define LOG_LOCAL3 (19<<3) /* reserved for local use */
-#define LOG_LOCAL4 (20<<3) /* reserved for local use */
-#define LOG_LOCAL5 (21<<3) /* reserved for local use */
-#define LOG_LOCAL6 (22<<3) /* reserved for local use */
-#define LOG_LOCAL7 (23<<3) /* reserved for local use */
-
-#define LOG_NFACILITIES 24 /* current number of facilities */
-#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
- /* facility of pri */
-#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
-
-#ifdef SYSLOG_NAMES
-CODE facilitynames[] = {
- { "auth", LOG_AUTH, },
- { "authpriv", LOG_AUTHPRIV, },
- { "cron", LOG_CRON, },
- { "daemon", LOG_DAEMON, },
- { "ftp", LOG_FTP, },
- { "kern", LOG_KERN, },
- { "lpr", LOG_LPR, },
- { "mail", LOG_MAIL, },
- { "mark", INTERNAL_MARK, }, /* INTERNAL */
- { "news", LOG_NEWS, },
- { "ntp", LOG_NTP, },
- { "security", LOG_AUTH, }, /* DEPRECATED */
- { "syslog", LOG_SYSLOG, },
- { "user", LOG_USER, },
- { "uucp", LOG_UUCP, },
- { "local0", LOG_LOCAL0, },
- { "local1", LOG_LOCAL1, },
- { "local2", LOG_LOCAL2, },
- { "local3", LOG_LOCAL3, },
- { "local4", LOG_LOCAL4, },
- { "local5", LOG_LOCAL5, },
- { "local6", LOG_LOCAL6, },
- { "local7", LOG_LOCAL7, },
- { NULL, -1, }
-};
-#endif
-
-#ifdef KERNEL
-#define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */
-#endif
-
-/*
- * arguments to setlogmask.
- */
-#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
-#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
-
-/*
- * Option flags for openlog.
- *
- * LOG_ODELAY no longer does anything.
- * LOG_NDELAY is the inverse of what it used to be.
- */
-#define LOG_PID 0x01 /* log the pid with each message */
-#define LOG_CONS 0x02 /* log on the console if errors in sending */
-#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
-#define LOG_NDELAY 0x08 /* don't delay open */
-#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
-#define LOG_PERROR 0x20 /* log to stderr as well */
-
-#ifdef KERNEL
-
-#else /* not KERNEL */
-
-#include <sys/cdefs.h>
-#include <stdarg.h>
-
-__BEGIN_DECLS
-void closelog __P((void));
-void openlog __P((const char *, int, int));
-int setlogmask __P((int));
-void syslog __P((int, const char *, ...));
-void vsyslog __P((int, const char *, va_list));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif
diff --git a/cpukit/libnetworking/sys/systm.h b/cpukit/libnetworking/sys/systm.h
deleted file mode 100644
index 7e14867e70..0000000000
--- a/cpukit/libnetworking/sys/systm.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/*-
- * Copyright (c) 1982, 1988, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)systm.h 8.7 (Berkeley) 3/29/95
- * $Id$
- */
-
-#ifndef _SYS_SYSTM_H_
-#define _SYS_SYSTM_H_
-
-#include <machine/cpufunc.h>
-
-extern int securelevel; /* system security level (see init(8)) */
-
-extern int cold; /* nonzero if we are doing a cold boot */
-extern const char *panicstr; /* panic message */
-extern char version[]; /* system version */
-extern char copyright[]; /* system copyright */
-
-extern int nblkdev; /* number of entries in bdevsw */
-extern int nchrdev; /* number of entries in cdevsw */
-extern struct swdevt *swdevt; /* swap-device information */
-extern int nswdev; /* number of swap devices */
-extern int nswap; /* size of swap space */
-
-extern int selwait; /* select timeout address */
-
-extern u_char curpriority; /* priority of current process */
-
-extern int physmem; /* physical memory */
-
-extern dev_t dumpdev; /* dump device */
-extern long dumplo; /* offset into dumpdev */
-
-extern dev_t rootdev; /* root device */
-extern struct vnode *rootvp; /* vnode equivalent to above */
-
-extern dev_t swapdev; /* swapping device */
-extern struct vnode *swapdev_vp;/* vnode equivalent to above */
-
-extern int boothowto; /* reboot flags, from console subsystem */
-extern int bootverbose; /* nonzero to print verbose messages */
-
-/*
- * General function declarations.
- */
-void Debugger __P((const char *msg));
-int nullop __P((void));
-int eopnotsupp __P((void));
-int einval __P((void));
-int seltrue __P((dev_t dev, int which, struct proc *p));
-int ureadc __P((int, struct uio *));
-void *hashinit __P((int count, int type, u_long *hashmask));
-void *phashinit __P((int count, int type, u_long *nentries));
-
-void panic __P((const char *, ...)) __dead2;
-void boot __P((int)) __dead2;
-void cpu_boot __P((int));
-void tablefull __P((const char *));
-int addlog __P((const char *, ...));
-int kvprintf __P((char const *, void (*)(int, void*), void *, int,
- _BSD_VA_LIST_));
-void log __P((int, const char *, ...));
-int printf __P((const char *, ...));
-int sprintf __P((char *buf, const char *, ...));
-void uprintf __P((const char *, ...));
-void ttyprintf __P((struct tty *, const char *, ...));
-
-#define bcopy(f,t,n) memcpy((t),(f),(n))
-#define bzero(p,n) memset((p),(0),(n))
-
-int copystr __P((const void *kfaddr, void *kdaddr, size_t len,
- size_t *lencopied));
-int copyinstr __P((const void *udaddr, void *kaddr, size_t len,
- size_t *lencopied));
-int copyin __P((const void *udaddr, void *kaddr, size_t len));
-int copyout __P((const void *kaddr, void *udaddr, size_t len));
-
-int fubyte __P((const void *base));
-int fuibyte __P((const void *base));
-int subyte __P((void *base, int byte));
-int suibyte __P((void *base, int byte));
-int fuword __P((const void *base));
-int suword __P((void *base, int word));
-int susword __P((void *base, int word));
-
-int hzto __P((struct timeval *tv));
-void realitexpire __P((void *));
-
-struct clockframe;
-void hardclock __P((struct clockframe *frame));
-void softclock __P((void));
-void statclock __P((struct clockframe *frame));
-
-void startprofclock __P((struct proc *));
-void stopprofclock __P((struct proc *));
-void setstatclockrate __P((int hzrate));
-
-void hardupdate __P((long));
-void hardpps __P((struct timeval *tvp, long usec));
-
-#include <sys/libkern.h>
-
-/* Initialize the world */
-extern void consinit(void);
-extern void usrinfoinit(void);
-extern void cpu_initclocks(void);
-extern void vntblinit(void);
-extern void nchinit(void);
-
-/* Finalize the world. */
-void shutdown_nice __P((void));
-
-/*
- * Kernel to clock driver interface.
- */
-void inittodr __P((time_t base));
-void resettodr __P((void));
-void startrtclock __P((void));
-
-/* Timeouts */
-typedef void (timeout_t)(void *); /* actual timeout function type */
-typedef timeout_t *timeout_func_t; /* a pointer to this type */
-
-void timeout(timeout_func_t, void *, int);
-void untimeout(timeout_func_t, void *);
-void logwakeup __P((void));
-
-/* Various other callout lists that modules might want to know about */
-/* shutdown callout list definitions */
-typedef void (*bootlist_fn)(int,void *);
-int at_shutdown(bootlist_fn function, void *arg, int);
-int rm_at_shutdown(bootlist_fn function, void *arg);
-#define SHUTDOWN_PRE_SYNC 0
-#define SHUTDOWN_POST_SYNC 1
-
-/* forking */ /* XXX not yet */
-typedef void (*forklist_fn)(struct proc *parent,struct proc *child,int flags);
-int at_fork(forklist_fn function);
-int rm_at_fork(forklist_fn function);
-
-/* exiting */
-typedef void (*exitlist_fn)(struct proc *procp);
-int at_exit(exitlist_fn function);
-int rm_at_exit(exitlist_fn function);
-
-/* Not exactly a callout LIST, but a callout entry.. */
-/* Allow an external module to define a hardware watchdog tickler */
-/* Normally a process would do this, but there are times when the */
-/* kernel needs to be able to hold off the watchdog, when the process */
-/* is not active, e.g. when dumping core. Costs us a whole 4 bytes to */
-/* make this generic. the variable is in kern_shutdown.c */
-typedef void (*watchdog_tickle_fn)(void);
-extern watchdog_tickle_fn wdog_tickler;
-
-
-/*
- * Common `proc' functions are declared here so that proc.h can be included
- * less often.
- */
-int tsleep __P((void *chan, int pri, char *wmesg, int timo));
-void wakeup __P((void *chan));
-
-#endif /* !_SYS_SYSTM_H_ */
diff --git a/cpukit/libnetworking/sys/ttydefaults.h b/cpukit/libnetworking/sys/ttydefaults.h
deleted file mode 100644
index 68f0ddbe77..0000000000
--- a/cpukit/libnetworking/sys/ttydefaults.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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.
- *
- * @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94
- * $Id$
- */
-
-/*
- * System wide defaults for terminal state.
- */
-#ifndef _SYS_TTYDEFAULTS_H_
-#define _SYS_TTYDEFAULTS_H_
-
-/*
- * Defaults on "first" open.
- */
-#define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY)
-#define TTYDEF_OFLAG (OPOST | ONLCR)
-#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
-#define TTYDEF_CFLAG (CREAD | CS8 | HUPCL)
-#define TTYDEF_SPEED (B9600)
-
-/*
- * Control Character Defaults
- */
-#define CTRL(x) (x&037)
-#define CEOF CTRL('d')
-#define CEOL 0xff /* XXX avoid _POSIX_VDISABLE */
-#define CERASE 0177
-#define CINTR CTRL('c')
-#define CSTATUS CTRL('t')
-#define CKILL CTRL('u')
-#define CMIN 1
-#define CQUIT 034 /* FS, ^\ */
-#define CSUSP CTRL('z')
-#define CTIME 0
-#define CDSUSP CTRL('y')
-#define CSTART CTRL('q')
-#define CSTOP CTRL('s')
-#define CLNEXT CTRL('v')
-#define CDISCARD CTRL('o')
-#define CWERASE CTRL('w')
-#define CREPRINT CTRL('r')
-#define CEOT CEOF
-/* compat */
-#define CBRK CEOL
-#define CRPRNT CREPRINT
-#define CFLUSH CDISCARD
-
-/* PROTECTED INCLUSION ENDS HERE */
-#endif /* !_SYS_TTYDEFAULTS_H_ */
-
-/*
- * #define TTYDEFCHARS to include an array of default control characters.
- */
-#ifdef TTYDEFCHARS
-static cc_t ttydefchars[NCCS] = {
- CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
- _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
- CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE
-};
-#undef TTYDEFCHARS
-#endif
diff --git a/cpukit/libnetworking/sys/ucred.h b/cpukit/libnetworking/sys/ucred.h
deleted file mode 100644
index d3899c3b4c..0000000000
--- a/cpukit/libnetworking/sys/ucred.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1989, 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.
- *
- * @(#)ucred.h 8.4 (Berkeley) 1/9/95
- * $Id$
- */
-
-#ifndef _SYS_UCRED_H_
-#define _SYS_UCRED_H_
-
-/*
- * Credentials.
- */
-struct ucred {
- u_short cr_ref; /* reference count */
- uid_t cr_uid; /* effective user id */
- short cr_ngroups; /* number of groups */
- gid_t cr_groups[NGROUPS]; /* groups */
-};
-#define cr_gid cr_groups[0]
-#define NOCRED ((struct ucred *)0) /* no credential available */
-#define FSCRED ((struct ucred *)-1) /* filesystem credential */
-
-#ifdef KERNEL
-#define crhold(cr) (cr)->cr_ref++
-
-struct ucred *crcopy __P((struct ucred *cr));
-struct ucred *crdup __P((struct ucred *cr));
-void crfree __P((struct ucred *cr));
-struct ucred *crget __P((void));
-int suser __P((struct ucred *cred, u_short *acflag));
-int groupmember __P((gid_t gid, struct ucred *cred));
-#endif /* KERNEL */
-
-#endif /* !_SYS_UCRED_H_ */
diff --git a/cpukit/libnetworking/sys/uio.h b/cpukit/libnetworking/sys/uio.h
deleted file mode 100644
index 305941500d..0000000000
--- a/cpukit/libnetworking/sys/uio.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993, 1994
- * 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.
- *
- * @(#)uio.h 8.5 (Berkeley) 2/22/94
- * $Id$
- */
-
-#ifndef _SYS_UIO_H_
-#define _SYS_UIO_H_
-
-/*
- * XXX
- * iov_base should be a void *.
- */
-struct iovec {
- char *iov_base; /* Base address. */
- size_t iov_len; /* Length. */
-};
-
-enum uio_rw { UIO_READ, UIO_WRITE };
-
-/* Segment flag values. */
-enum uio_seg {
- UIO_USERSPACE, /* from user data space */
- UIO_SYSSPACE, /* from system space */
- UIO_USERISPACE, /* from user I space */
- UIO_NOCOPY /* don't copy, already in object */
-};
-
-#ifdef KERNEL
-struct uio {
- struct iovec *uio_iov;
- int uio_iovcnt;
- off_t uio_offset;
- int uio_resid;
- enum uio_seg uio_segflg;
- enum uio_rw uio_rw;
- struct proc *uio_procp;
-};
-
-/*
- * Limits
- */
-#define UIO_MAXIOV 1024 /* max 1K of iov's */
-#define UIO_SMALLIOV 8 /* 8 on stack, else malloc */
-#endif /* KERNEL */
-
-#ifdef KERNEL
-
-int uiomove __P((caddr_t, int, struct uio *));
-
-#else /* !KERNEL */
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-ssize_t readv __P((int, const struct iovec *, int));
-ssize_t writev __P((int, const struct iovec *, int));
-__END_DECLS
-
-#endif /* KERNEL */
-
-#endif /* !_SYS_UIO_H_ */
diff --git a/cpukit/libnetworking/syslog.h b/cpukit/libnetworking/syslog.h
deleted file mode 100644
index 6d223d00b7..0000000000
--- a/cpukit/libnetworking/syslog.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * $Id$
- */
-
-#include <sys/syslog.h>
diff --git a/cpukit/libnetworking/vm/vm.h b/cpukit/libnetworking/vm/vm.h
deleted file mode 100644
index 19ea10e5eb..0000000000
--- a/cpukit/libnetworking/vm/vm.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 1991, 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.
- *
- * @(#)vm.h 8.2 (Berkeley) 12/13/93
- * $Id$
- */
-
-#ifndef VM_H
-#define VM_H
-
-typedef char vm_inherit_t; /* XXX: inheritance codes */
-typedef u_char vm_prot_t; /* protection codes */
-
-union vm_map_object;
-typedef union vm_map_object vm_map_object_t;
-
-struct vm_map_entry;
-typedef struct vm_map_entry *vm_map_entry_t;
-
-struct vm_map;
-typedef struct vm_map *vm_map_t;
-
-struct vm_object;
-typedef struct vm_object *vm_object_t;
-
-#ifndef KERNEL
-/*
- * This is defined in <sys/types.h> for the kernel so that non-vm kernel
- * sources (mainly Mach-derived ones such as ddb) don't have to include
- * vm stuff. Defining it there for applications might break things.
- * Define it here for "applications" that include vm headers (e.g.,
- * genassym).
- */
-typedef int boolean_t;
-
-/*
- * This is defined in <sys/types.h> for the kernel so that vnode_if.h
- * doesn't have to include <vm/vm.h>.
- */
-struct vm_page;
-typedef struct vm_page *vm_page_t;
-#endif
-
-#endif /* VM_H */
diff --git a/cpukit/libnetworking/vm/vm_extern.h b/cpukit/libnetworking/vm/vm_extern.h
deleted file mode 100644
index 720d42dc28..0000000000
--- a/cpukit/libnetworking/vm/vm_extern.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-
- * 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.
- *
- * @(#)vm_extern.h 8.2 (Berkeley) 1/12/94
- * $Id$
- */
-
-#ifndef _VM_EXTERN_H_
-#define _VM_EXTERN_H_
-
-struct buf;
-struct proc;
-struct vmspace;
-struct vmtotal;
-struct mount;
-struct vnode;
-
-#ifdef KERNEL
-
-#ifdef TYPEDEF_FOR_UAP
-int getpagesize __P((struct proc * p, void *, int *));
-int madvise __P((struct proc *, void *, int *));
-int mincore __P((struct proc *, void *, int *));
-int mprotect __P((struct proc *, void *, int *));
-int msync __P((struct proc *, void *, int *));
-int munmap __P((struct proc *, void *, int *));
-int obreak __P((struct proc *, void *, int *));
-int sbrk __P((struct proc *, void *, int *));
-int smmap __P((struct proc *, void *, int *));
-int sstk __P((struct proc *, void *, int *));
-int swapon __P((struct proc *, void *, int *));
-#endif
-
-void faultin __P((struct proc *p));
-int grow __P((struct proc *, u_int));
-int kernacc __P((caddr_t, int, int));
-vm_offset_t kmem_alloc __P((vm_map_t, vm_size_t));
-vm_offset_t kmem_alloc_pageable __P((vm_map_t, vm_size_t));
-vm_offset_t kmem_alloc_wait __P((vm_map_t, vm_size_t));
-void kmem_free __P((vm_map_t, vm_offset_t, vm_size_t));
-void kmem_free_wakeup __P((vm_map_t, vm_offset_t, vm_size_t));
-void kmem_init __P((vm_offset_t, vm_offset_t));
-vm_offset_t kmem_malloc __P((vm_map_t, vm_size_t, boolean_t));
-vm_map_t kmem_suballoc __P((vm_map_t, vm_offset_t *, vm_offset_t *, vm_size_t, boolean_t));
-void munmapfd __P((struct proc *, int));
-int pager_cache __P((vm_object_t, boolean_t));
-int swaponvp __P((struct proc *, struct vnode *, dev_t , u_long));
-void swapout_procs __P((void));
-int useracc __P((caddr_t, int, int));
-int vm_fault __P((vm_map_t, vm_offset_t, vm_prot_t, boolean_t));
-void vm_fault_copy_entry __P((vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t));
-void vm_fault_unwire __P((vm_map_t, vm_offset_t, vm_offset_t));
-int vm_fault_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
-int vm_fault_user_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
-int vm_fork __P((struct proc *, struct proc *));
-int vm_mmap __P((vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, caddr_t, vm_ooffset_t));
-vm_offset_t vm_page_alloc_contig __P((vm_offset_t, vm_offset_t, vm_offset_t, vm_offset_t));
-void vm_set_page_size __P((void));
-void vmmeter __P((void));
-struct vmspace *vmspace_alloc __P((vm_offset_t, vm_offset_t, int));
-struct vmspace *vmspace_fork __P((struct vmspace *));
-void vmspace_free __P((struct vmspace *));
-void vnode_pager_setsize __P((struct vnode *, vm_ooffset_t));
-void vnode_pager_umount __P((struct mount *));
-void vnode_pager_uncache __P((struct vnode *));
-void vslock __P((caddr_t, u_int));
-void vsunlock __P((caddr_t, u_int, int));
-void vm_object_print __P((/* db_expr_t */ int, boolean_t, /* db_expr_t */ int,
- char *));
-void vm_fault_quick __P((caddr_t v, int prot));
-
-#endif /* KERNEL */
-
-#endif /* !_VM_EXTERN_H_ */
diff --git a/cpukit/libnetworking/vm/vm_kern.h b/cpukit/libnetworking/vm/vm_kern.h
deleted file mode 100644
index b1e073dd3a..0000000000
--- a/cpukit/libnetworking/vm/vm_kern.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * The Mach Operating System project at Carnegie-Mellon University.
- *
- * 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.
- *
- * from: @(#)vm_kern.h 8.1 (Berkeley) 6/11/93
- *
- *
- * Copyright (c) 1987, 1990 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Authors: Avadis Tevanian, Jr., Michael Wayne Young
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- *
- * $Id$
- */
-
-#ifndef _VM_VM_KERN_H_
-#define _VM_VM_KERN_H_ 1
-
-/* Kernel memory management definitions. */
-extern vm_map_t buffer_map;
-extern vm_map_t kernel_map;
-extern vm_map_t kmem_map;
-extern vm_map_t mb_map;
-extern int mb_map_full;
-extern vm_map_t io_map;
-extern vm_map_t clean_map;
-extern vm_map_t phys_map;
-extern vm_map_t exec_map;
-extern vm_map_t u_map;
-
-extern vm_offset_t kernel_vm_end;
-
-#endif /* _VM_VM_KERN_H_ */
diff --git a/cpukit/libnetworking/vm/vm_param.h b/cpukit/libnetworking/vm/vm_param.h
deleted file mode 100644
index f1cfca98ec..0000000000
--- a/cpukit/libnetworking/vm/vm_param.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * The Mach Operating System project at Carnegie-Mellon University.
- *
- * 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.
- *
- * from: @(#)vm_param.h 8.1 (Berkeley) 6/11/93
- *
- *
- * Copyright (c) 1987, 1990 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Authors: Avadis Tevanian, Jr., Michael Wayne Young
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- *
- * $Id$
- */
-
-/*
- * Machine independent virtual memory parameters.
- */
-
-#ifndef _VM_PARAM_
-#define _VM_PARAM_
-
-#include <machine/vmparam.h>
-
-/*
- * The machine independent pages are refered to as PAGES. A page
- * is some number of hardware pages, depending on the target machine.
- */
-#define DEFAULT_PAGE_SIZE 4096
-
-#if 0
-
-/*
- * All references to the size of a page should be done with PAGE_SIZE
- * or PAGE_SHIFT. The fact they are variables is hidden here so that
- * we can easily make them constant if we so desire.
- */
-#ifndef PAGE_SIZE
-#define PAGE_SIZE cnt.v_page_size /* size of page */
-#endif
-#ifndef PAGE_MASK
-#define PAGE_MASK page_mask /* size of page - 1 */
-#endif
-#ifndef PAGE_SHIFT
-#define PAGE_SHIFT page_shift /* bits to shift for pages */
-#endif
-
-#endif
-
-#ifdef KERNEL
-extern vm_size_t page_mask;
-extern int page_shift;
-
-#endif
-
-/*
- * CTL_VM identifiers
- */
-#define VM_METER 1 /* struct vmmeter */
-#define VM_LOADAVG 2 /* struct loadavg */
-#define VM_V_FREE_MIN 3 /* cnt.v_free_min */
-#define VM_V_FREE_TARGET 4 /* cnt.v_free_target */
-#define VM_V_FREE_RESERVED 5 /* cnt.v_free_reserved */
-#define VM_V_INACTIVE_TARGET 6 /* cnt.v_inactive_target */
-#define VM_V_CACHE_MIN 7 /* cnt.v_cache_max */
-#define VM_V_CACHE_MAX 8 /* cnt.v_cache_min */
-#define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min */
-#define VM_PAGEOUT_ALGORITHM 10 /* pageout algorithm */
-#define VM_SWAPPING_ENABLED 11 /* swapping enabled */
-#define VM_MAXID 12 /* number of valid vm ids */
-
-#define CTL_VM_NAMES { \
- { 0, 0 }, \
- { "vmmeter", CTLTYPE_STRUCT }, \
- { "loadavg", CTLTYPE_STRUCT }, \
- { "v_free_min", CTLTYPE_INT }, \
- { "v_free_target", CTLTYPE_INT }, \
- { "v_free_reserved", CTLTYPE_INT }, \
- { "v_inactive_target", CTLTYPE_INT }, \
- { "v_cache_min", CTLTYPE_INT }, \
- { "v_cache_max", CTLTYPE_INT }, \
- { "v_pageout_free_min", CTLTYPE_INT}, \
- { "pageout_algorithm", CTLTYPE_INT}, \
- { "swapping_enabled", CTLTYPE_INT},\
-}
-
-/*
- * Return values from the VM routines.
- */
-#define KERN_SUCCESS 0
-#define KERN_INVALID_ADDRESS 1
-#define KERN_PROTECTION_FAILURE 2
-#define KERN_NO_SPACE 3
-#define KERN_INVALID_ARGUMENT 4
-#define KERN_FAILURE 5
-#define KERN_RESOURCE_SHORTAGE 6
-#define KERN_NOT_RECEIVER 7
-#define KERN_NO_ACCESS 8
-
-#ifndef ASSEMBLER
-/*
- * Convert addresses to pages and vice versa.
- * No rounding is used.
- */
-#ifdef KERNEL
-#define num_pages(x) \
- ((vm_offset_t)((((vm_offset_t)(x)) + PAGE_MASK) >> PAGE_SHIFT))
-
-extern vm_size_t mem_size; /* size of physical memory (bytes) */
-extern vm_offset_t first_addr; /* first physical page */
-extern vm_offset_t last_addr; /* last physical page */
-#endif /* KERNEL */
-#endif /* ASSEMBLER */
-#endif /* _VM_PARAM_ */
diff --git a/cpukit/posix/include/aio.h b/cpukit/posix/include/aio.h
deleted file mode 100644
index 6348da4c15..0000000000
--- a/cpukit/posix/include/aio.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* aio.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_ASYNCHRONOUS_IO_h
-#define __POSIX_ASYNCHRONOUS_IO_h
-
-#include <rtems/posix/features.h>
-
-#if defined(_POSIX_ASYNCHRONOUS_IO)
-
-/*
- * 6.7.1 Data Definitions for Asynchronous Input and Output,
- * P1003.1b-1993, p. 151
- */
-
-#include <sys/types.h>
-#include <signal.h>
-#include <time.h>
-#include <fcntl.h>
-
-/*
- * 6.7.1.2 Manifest Constants, P1003.1b-1993, p. 153
- */
-
-#define AIO_CANCELED 0 /* all requested operations have been canceled */
-#define AIO_NOTCANCELED 1 /* some of the operations could not be canceled */
- /* since they are in progress */
-#define AIO_ALLDONE 2 /* none of the requested operations could be */
- /* canceled since they are already complete */
-
-/* lio_listio() options */
-
-#define LIO_WAIT 0 /* calling process is to suspend until the */
- /* operation is complete */
-#define LIO_NOWAIT 1 /* calling process is to continue execution while */
- /* the operation is performed and no notification */
- /* shall be given when the operation is completed */
-#define LIO_READ 2 /* request a read() */
-#define LIO_WRITE 3 /* request a write() */
-#define LIO_NOP 4 /* no transfer is requested */
-
-/*
- * 6.7.1.1 Asynchronous I/O Control Block, P1003.1b-1993, p. 151
- */
-
-struct aiocb {
- int aio_fildes; /* File descriptor */
- off_t aio_offset; /* File offset */
- volatile void *aio_buf; /* Location of buffer */
- size_t aio_nbytes; /* Length of transfer */
- int aio_reqprio; /* Request priority offset */
- struct sigevent aio_sigevent; /* Signal number and value */
- int aoi_lio_opcode; /* Operation to be performed */
-};
-
-/*
- * 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154
- */
-
-int aio_read(
- struct aiocb *aiocbp
-);
-
-/*
- * 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155
- */
-
-int aio_write(
- struct aiocb *aiocbp
-);
-
-/*
- * 6.7.4 List Directed I/O, P1003.1b-1993, p. 158
- */
-
-int lio_listio(
- int mode,
- struct aiocb * const list[],
- int nent,
- struct sigevent *sig
-);
-
-/*
- * 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161
- */
-
-int aio_error(
- const struct aiocb *aiocbp
-);
-
-/*
- * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
- * P1003.1b-1993, p. 162
- */
-
-int aio_return(
- const struct aiocb *aiocbp
-);
-
-/*
- * 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163
- */
-
-int aio_cancel(
- int filedes,
- struct aiocb *aiocbp
-);
-
-/*
- * 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164
- */
-
-int aio_suspend(
- struct aiocb * const list[],
- int nent,
- const struct timespec *timeout
-);
-
-#if defined(_POSIX_SYNCHRONIZED_IO)
-
-/*
- * 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166
- */
-
-int aio_fsync(
- int op,
- struct aiocb *aiocbp
-);
-
-#endif /* _POSIX_SYNCHRONIZED_IO */
-
-#endif /* _POSIX_ASYNCHRONOUS_IO */
-
-#endif
-/* end of include file */
diff --git a/cpukit/posix/include/devctl.h b/cpukit/posix/include/devctl.h
deleted file mode 100644
index 5073b475ee..0000000000
--- a/cpukit/posix/include/devctl.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* devctl.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_DEVICE_CONTROL_h
-#define __POSIX_DEVICE_CONTROL_h
-
-#include <rtems/posix/features.h>
-
-#if defined(_POSIX_DEVICE_CONTROL)
-
-#include <sys/types.h>
-#include <unistd.h>
-
-/*
- * 21.2.1 Control a Device, P1003.4b/D8, p. 65
- */
-
-int devctl(
- int filedes,
- void *dev_data_ptr,
- size_t nbyte,
- int *dev_info_ptr
-);
-
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/posix/include/intr.h b/cpukit/posix/include/intr.h
deleted file mode 100644
index f07d1f9552..0000000000
--- a/cpukit/posix/include/intr.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* intr.h
- *
- * XXX: It is unclear if the type "intr_t" should be defined when
- * _POSIX_INTERRUPT_CONTROL is not.
- *
- * $Id$
- */
-
-#ifndef __POSIX_INTERRUPTS_h
-#define __POSIX_INTERRUPTS_h
-
-#include <rtems/posix/features.h>
-#include <sys/types.h>
-#include <sys/time.h>
-
-#if defined(_POSIX_INTERRUPT_CONTROL)
-
-/*
- * 22.2 Concepts, P1003.4b/D8, p. 73
- */
-
-typedef int intr_t;
-
-/*
- * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
- */
-
-/*
- * Return codes from an interrupt handler
- */
-
-#define INTR_HANDLED_NOTIFY 0 /* ISR handled this interrupt, notify */
- /* the thread that registered the */
- /* ISR that the interrupt occurred. */
-#define INTR_HANDLED_DO_NOT_NOTIFY 1 /* ISR handled this interrupt, but */
- /* do NOT perform notification. */
-#define INTR_NOT_HANDLED 2 /* ISR did not handle this interrupt, */
- /* let the next handler try. */
-
-int intr_capture(
- intr_t intr,
- int (*intr_handler)( void *area ),
- volatile void *area,
- size_t areasize
-);
-
-int intr_release(
- intr_t intr,
- int (*intr_handler)( void *area )
-);
-
-int intr_lock(
- intr_t intr
-);
-
-int intr_unlock(
- intr_t intr
-);
-
-/*
- * 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76
- */
-
-int intr_timed_wait(
- int flags,
- const struct timespec *timeout
-);
-
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/posix/include/mqueue.h b/cpukit/posix/include/mqueue.h
deleted file mode 100644
index f1b2250e5c..0000000000
--- a/cpukit/posix/include/mqueue.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/* mqueue.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_MESSAGE_QUEUE_h
-#define __POSIX_MESSAGE_QUEUE_h
-
-#include <rtems/posix/features.h>
-
-#if defined(_POSIX_MESSAGE_PASSING)
-
-#include <sys/types.h>
-
-#include <rtems/system.h>
-#include <rtems/score/object.h>
-
-/*
- * 15.1.1 Data Structures, P1003.1b-1993, p. 271
- */
-
-typedef Objects_Id mqd_t;
-
-struct mq_attr {
- long mq_flags; /* Message queue flags */
- long mq_maxmsg; /* Maximum number of messages */
- long mq_msgsize; /* Maximum message size */
- long mq_curmsgs; /* Number of messages currently queued */
-};
-
-/*
- * 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
- */
-
-mqd_t mq_open(
- const char *name,
- int oflag,
- ...
-);
-
-/*
- * 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275
- */
-
-int mq_close(
- mqd_t mqdes
-);
-
-/*
- * 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276
- */
-
-int mq_unlink(
- const char *name
-);
-
-/*
- * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
- *
- * NOTE: P1003.4b/D8, p. 45 adds mq_timedsend().
- */
-
-int mq_send(
- mqd_t mqdes,
- const char *msg_ptr,
- size_t msg_len,
- unsigned int msg_prio
-);
-
-#if defined(_POSIX_TIMEOUTS)
-
-#include <time.h>
-
-int mq_timedsend(
- mqd_t mqdes,
- const char *msg_ptr,
- size_t msg_len,
- unsigned int msg_prio,
- const struct timespec *timeout
-);
-
-#endif /* _POSIX_TIMEOUTS */
-
-/*
- * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
- *
- * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
- */
-
-ssize_t mq_receive(
- mqd_t mqdes,
- char *msg_ptr,
- size_t msg_len,
- unsigned int *msg_prio
-);
-
-#if defined(_POSIX_TIMEOUTS)
-
-int mq_timedreceive( /* XXX: should this be ssize_t */
- mqd_t mqdes,
- char *msg_ptr,
- size_t msg_len,
- unsigned int *msg_prio,
- const struct timespec *timeout
-);
-
-#endif /* _POSIX_TIMEOUTS */
-
-#if defined(_POSIX_REALTIME_SIGNALS)
-
-/*
- * 15.2.6 Notify Process that a Message is Available on a Queue,
- * P1003.1b-1993, p. 280
- */
-
-int mq_notify(
- mqd_t mqdes,
- const struct sigevent *notification
-);
-
-#endif /* _POSIX_REALTIME_SIGNALS */
-
-/*
- * 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281
- */
-
-int mq_setattr(
- mqd_t mqdes,
- const struct mq_attr *mqstat,
- struct mq_attr *omqstat
-);
-
-/*
- * 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
- */
-
-int mq_getattr(
- mqd_t mqdes,
- struct mq_attr *mqstat
-);
-
-#endif /* _POSIX_MESSAGE_PASSING */
-
-#endif
-/* end of include file */
diff --git a/cpukit/posix/include/rtems/posix/cancel.h b/cpukit/posix/include/rtems/posix/cancel.h
deleted file mode 100644
index e6d80275f4..0000000000
--- a/cpukit/posix/include/rtems/posix/cancel.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* rtems/posix/cancel.h
- *
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_CANCEL_h
-#define __RTEMS_POSIX_CANCEL_h
-
-typedef struct {
- Chain_Node Node;
- void (*routine)( void * );
- void *arg;
-} POSIX_Cancel_Handler_control;
-
-#endif
-/* end of include file */
diff --git a/cpukit/posix/include/rtems/posix/cond.h b/cpukit/posix/include/rtems/posix/cond.h
deleted file mode 100644
index 92c2e453ae..0000000000
--- a/cpukit/posix/include/rtems/posix/cond.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* rtems/posix/cond.h
- *
- * This include file contains all the private support information for
- * POSIX condition variables.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_CONDITION_VARIABLES_h
-#define __RTEMS_POSIX_CONDITION_VARIABLES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/threadq.h>
-
-/*
- * Constant to indicate condition variable does not currently have
- * a mutex assigned to it.
- */
-
-#define POSIX_CONDITION_VARIABLES_NO_MUTEX 0
-
-/*
- * Data Structure used to manage a POSIX condition variable
- */
-
-typedef struct {
- Objects_Control Object;
- int process_shared;
- pthread_mutex_t Mutex;
- Thread_queue_Control Wait_queue;
-} POSIX_Condition_variables_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Condition_variables_Information;
-
-/*
- * _POSIX_Condition_variables_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Condition_variables_Manager_initialization(
- unsigned32 maximum_condition_variables
-);
-
-/*
- * _POSIX_Condition_variables_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a condition variable control block from
- * the inactive chain of free condition variable control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *
- _POSIX_Condition_variables_Allocate( void );
-
-/*
- * _POSIX_Condition_variables_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a condition variable control block to the
- * inactive chain of free condition variable control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
- POSIX_Condition_variables_Control *the_condition_variable
-);
-
-/*
- * _POSIX_Condition_variables_Get
- *
- * DESCRIPTION:
- *
- * This function maps condition variable IDs to condition variable control
- * blocks. If ID corresponds to a local condition variable, then it returns
- * the_condition variable control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the condition variable ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_condition variable is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_condition variable is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
- Objects_Id *id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Condition_variables_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_condition variable is NULL
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
- POSIX_Condition_variables_Control *the_condition_variable
-);
-
-#include <rtems/posix/cond.inl>
-#include <rtems/posix/condmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/include/rtems/posix/condmp.h b/cpukit/posix/include/rtems/posix/condmp.h
deleted file mode 100644
index de9c5ce0d4..0000000000
--- a/cpukit/posix/include/rtems/posix/condmp.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/* condmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Condition Variable Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_CONDITION_VARIABLES_MP_h
-#define __RTEMS_POSIX_CONDITION_VARIABLES_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote condition variable operations.
- */
-
-typedef enum {
- POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_CREATE = 0,
- POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_DELETE = 1,
- POSIX_CONDITION_VARIABLES_MP_EXTRACT_PROXY = 2,
- POSIX_CONDITION_VARIABLES_MP_OBTAIN_REQUEST = 3,
- POSIX_CONDITION_VARIABLES_MP_OBTAIN_RESPONSE = 4,
- POSIX_CONDITION_VARIABLES_MP_RELEASE_REQUEST = 5,
- POSIX_CONDITION_VARIABLES_MP_RELEASE_RESPONSE = 6,
-} POSIX_Condition_variables_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote condition variable operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Condition_variables_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait; /* XXX options */
- Objects_Id proxy_id;
-} POSIX_Condition_variables_MP_Packet;
-
-/*
- * _POSIX_Condition_variables_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Condition_variables_MP_Send_process_packet (
- POSIX_Condition_variables_MP_Remote_operations operation,
- Objects_Id condition_variables_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Condition_variables_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Condition_variables_MP_Send_request_packet (
- POSIX_Condition_variables_MP_Remote_operations operation,
- Objects_Id condition_variables_id,
- boolean wait, /* XXX options */
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Condition_variables_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Condition_variables_MP_Send_response_packet (
- POSIX_Condition_variables_MP_Remote_operations operation,
- Objects_Id condition_variables_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Condition_variables_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Condition_variables_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Condition_variables_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Condition_variables_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Condition_variables_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Condition_variables_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Condition_variables_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a condition variable mp packet.
- */
-
-POSIX_Condition_variables_MP_Packet
- *_POSIX_Condition_variables_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/cpukit/posix/include/rtems/posix/config.h b/cpukit/posix/include/rtems/posix/config.h
deleted file mode 100644
index 8753c42382..0000000000
--- a/cpukit/posix/include/rtems/posix/config.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* config.h
- *
- * This include file contains the table of user defined configuration
- * parameters specific for the POSIX API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_CONFIGURATION_h
-#define __RTEMS_POSIX_CONFIGURATION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * XXX
- *
- * The following records define the Configuration Table. The
- * information contained in this table is required in all
- * RTEMS systems, whether single or multiprocessor. This
- * table primarily defines the following:
- *
- * + required number of each object type
- */
-
-/*
- * For now, we are only allowing the user to specify the entry point
- * for posix initialization threads.
- */
-
-typedef struct {
- void *(*thread_entry)(void *);
-} posix_initialization_threads_table;
-
-typedef struct {
- int maximum_threads;
- int maximum_mutexes;
- int maximum_condition_variables;
- int maximum_keys;
- int maximum_queued_signals;
- int number_of_initialization_threads;
- posix_initialization_threads_table *User_initialization_threads_table;
-} posix_api_configuration_table;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/posix/include/rtems/posix/intr.h b/cpukit/posix/include/rtems/posix/intr.h
deleted file mode 100644
index 539c66f058..0000000000
--- a/cpukit/posix/include/rtems/posix/intr.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/* rtems/posix/intr.h
- *
- * This include file contains all the private support information for
- * POSIX Interrupt Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_KEY_h
-#define __RTEMS_POSIX_KEY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-
-/*
- * Data Structure used to manage each POSIX Interrupt Vector
- */
-
-typedef struct {
- int number_installed;
- int lock_count;
- int deferred_count;
- Chain_Control Handlers;
-} POSIX_Interrupt_Control;
-
-/*
- * Data Structure used to manage a POSIX Interrupt Handler
- */
-
-typedef struct {
- Objects_Control Object;
- int is_active;
- intr_t vector;
- Thread_Control *server;
- int (*handler)( void *area );
- volatile void *user_data_area;
-} POSIX_Interrupt_Handler_control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Interrupt_Handlers_Information;
-
-/*
- * The following is an array which is used to manage the set of
- * interrupt handlers installed on each vector.
- */
-
-POSIX_EXTERN POSIX_Interrupt_Control
- _POSIX_Interrupt_Information[ ISR_NUMBER_OF_VECTORS ];
-
-/*
- * _POSIX_Interrupt_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Interrupt_Manager_initialization(
- unsigned32 maximum_interrupt_handlers
-);
-
-/*
- * _POSIX_Interrupt_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a interrupt handler control block from
- * the inactive chain of free interrupt handler control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
- _POSIX_Interrupt_Allocate( void );
-
-/*
- * _POSIX_Interrupt_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a interrupt handler control block to the
- * inactive chain of free interrupt handler control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
- POSIX_Interrupt_Handler_control *the_intr
-);
-
-/*
- * _POSIX_Interrupt_Get
- *
- * DESCRIPTION:
- *
- * This function maps interrupt handler IDs to interrupt handler control
- * blocks. If ID corresponds to a local interrupt handler, then it returns
- * the_intr control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the interrupt handler ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_intr is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_intr is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
- Objects_Id id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Interrupt_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_intr is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
- POSIX_Interrupt_Handler_control *the_intr
-);
-
-/*
- * _POSIX_Interrupt_Handler
- *
- * DESCRIPTION:
- *
- * This function XXX.
- */
-
-void _POSIX_Interrupt_Handler(
- ISR_Vector_number vector
-);
-
-#include <rtems/posix/intr.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/include/rtems/posix/key.h b/cpukit/posix/include/rtems/posix/key.h
deleted file mode 100644
index 22bfafd594..0000000000
--- a/cpukit/posix/include/rtems/posix/key.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/* rtems/posix/key.h
- *
- * This include file contains all the private support information for
- * POSIX key.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_KEY_h
-#define __RTEMS_POSIX_KEY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Data Structure used to manage a POSIX key
- *
- * NOTE: The Values is a table indexed by the index portion of the
- * ID of the currently executing thread.
- */
-
-typedef struct {
- Objects_Control Object;
- boolean is_active;
- void (*destructor)( void * );
- void **Values[ OBJECTS_CLASSES_LAST_THREAD_CLASS + 1 ];
-} POSIX_Keys_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Keys_Information;
-
-/*
- * _POSIX_Keys_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Key_Manager_initialization(
- unsigned32 maximum_keys
-);
-
-/*
- * _POSIX_Keys_Run_destructors
- *
- * DESCRIPTION:
- *
- * This function executes all the destructors associated with the thread's
- * keys. This function will execute until all values have been set to NULL.
- *
- * NOTE: This is the routine executed when a thread exits to
- * run through all the keys and do the destructor action.
- */
-
-void _POSIX_Keys_Run_destructors(
- Thread_Control *thread
-);
-
-/*
- * _POSIX_Keys_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a keys control block from
- * the inactive chain of free keys control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void );
-
-/*
- * _POSIX_Keys_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a keys control block to the
- * inactive chain of free keys control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
- POSIX_Keys_Control *the_key
-);
-
-/*
- * _POSIX_Keys_Get
- *
- * DESCRIPTION:
- *
- * This function maps key IDs to key control blocks.
- * If ID corresponds to a local keys, then it returns
- * the_key control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the keys ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_key is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_key is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
- Objects_Id id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Keys_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_key is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
- POSIX_Keys_Control *the_key
-);
-
-#include <rtems/posix/key.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/include/rtems/posix/mqueue.h b/cpukit/posix/include/rtems/posix/mqueue.h
deleted file mode 100644
index 8e2851bfb5..0000000000
--- a/cpukit/posix/include/rtems/posix/mqueue.h
+++ /dev/null
@@ -1,186 +0,0 @@
-/* rtems/posix/mqueue.h
- *
- * This include file contains all the private support information for
- * POSIX Message Queues.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MESSAGE_QUEUE_h
-#define __RTEMS_POSIX_MESSAGE_QUEUE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/coremsg.h>
-#include <rtems/score/object.h>
-
-/*
- * Data Structure used to manage a POSIX message queue
- */
-
-typedef struct {
- Objects_Control Object;
- int process_shared;
- int flags;
- boolean named;
- boolean linked;
- boolean blocking;
- unsigned32 open_count;
- CORE_message_queue_Control Message_queue;
- struct sigevent notification;
-} POSIX_Message_queue_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information;
-
-/*
- * _POSIX_Message_queue_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Message_queue_Manager_initialization(
- unsigned32 maximum_message_queues
-);
-
-/*
- *
- * _POSIX_Message_queue_Create_support
- *
- * DESCRIPTION:
- *
- * This routine performs the creation of a message queue utilizing the
- * core message queue.
- */
-
-int _POSIX_Message_queue_Create_support(
- const char *name,
- int pshared,
- unsigned int oflag,
- struct mq_attr *attr,
- POSIX_Message_queue_Control **message_queue
-);
-
-/*
- *
- * _POSIX_Message_queue_Send_support
- *
- * DESCRIPTION:
- *
- * This routine posts a message to a specified message queue.
- */
-
-int _POSIX_Message_queue_Send_support(
- mqd_t mqdes,
- const char *msg_ptr,
- unsigned32 msg_len,
- Priority_Control msg_prio,
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Message_queue_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a message queue control block from
- * the inactive chain of free message queue control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
-
-/*
- * _POSIX_Message_queue_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a message queue control block to the
- * inactive chain of free message queue control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
- POSIX_Message_queue_Control *the_mq
-);
-
-/*
- * _POSIX_Message_queue_Get
- *
- * DESCRIPTION:
- *
- * This function maps message queue IDs to message queue control blocks.
- * If ID corresponds to a local message queue, then it returns
- * the_mq control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the message queue ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_message queue is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_mq is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
- Objects_Id id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Message_queue_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_message_queue is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
- POSIX_Message_queue_Control *the_mq
-);
-
-/*
- * _POSIX_Message_queue_Name_to_id
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-int _POSIX_Message_queue_Name_to_id(
- const char *name,
- Objects_Id *id
-);
-
-/*
- * _POSIX_Message_queue_Priority_to_core
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
- unsigned int priority
-);
-
-#include <rtems/posix/mqueue.inl>
-#include <rtems/posix/mqueuemp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/include/rtems/posix/mqueuemp.h b/cpukit/posix/include/rtems/posix/mqueuemp.h
deleted file mode 100644
index 27742014ab..0000000000
--- a/cpukit/posix/include/rtems/posix/mqueuemp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* mqueuemp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Message Queue Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MESSAGE_QUEUE_MP_h
-#define __RTEMS_POSIX_MESSAGE_QUEUE_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote message queue operations.
- */
-
-typedef enum {
- POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0,
- POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1,
- POSIX_MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2,
- POSIX_MESSAGE_QUEUE_MP_OBTAIN_REQUEST = 3,
- POSIX_MESSAGE_QUEUE_MP_OBTAIN_RESPONSE = 4,
- POSIX_MESSAGE_QUEUE_MP_RELEASE_REQUEST = 5,
- POSIX_MESSAGE_QUEUE_MP_RELEASE_RESPONSE = 6,
-} POSIX_Message_queue_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote message queue operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Message_queue_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait; /* XXX options */
- Objects_Id proxy_id;
-} POSIX_Message_queue_MP_Packet;
-
-/*
- * _POSIX_Message_queue_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Message_queue_MP_Send_process_packet (
- POSIX_Message_queue_MP_Remote_operations operation,
- Objects_Id mq_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Message_queue_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Message_queue_MP_Send_request_packet (
- POSIX_Message_queue_MP_Remote_operations operation,
- Objects_Id mq_id,
- boolean wait, /* XXX options */
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Message_queue_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Message_queue_MP_Send_response_packet (
- POSIX_Message_queue_MP_Remote_operations operation,
- Objects_Id mq_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Message_queue_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Message_queue_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Message_queue_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Message_queue_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Message_queue_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Message_queue_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Message_queue_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a message queue mp packet.
- */
-
-POSIX_Message_queue_MP_Packet *_POSIX_Message_queue_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/cpukit/posix/include/rtems/posix/mutex.h b/cpukit/posix/include/rtems/posix/mutex.h
deleted file mode 100644
index e6c5c44d39..0000000000
--- a/cpukit/posix/include/rtems/posix/mutex.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* rtems/posix/mutex.h
- *
- * This include file contains all the private support information for
- * POSIX mutex's.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MUTEX_h
-#define __RTEMS_POSIX_MUTEX_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/coremutex.h>
-#include <pthread.h>
-
-/*
- * Data Structure used to manage a POSIX mutex
- */
-
-typedef struct {
- Objects_Control Object;
- int process_shared;
- CORE_mutex_Control Mutex;
-} POSIX_Mutex_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Mutex_Information;
-
-/*
- * _POSIX_Mutex_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Mutex_Manager_initialization(
- unsigned32 maximum_mutexes
-);
-
-/*
- * _POSIX_Mutex_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a mutexes control block from
- * the inactive chain of free mutexes control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void );
-
-/*
- * _POSIX_Mutex_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a mutexes control block to the
- * inactive chain of free mutexes control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
- POSIX_Mutex_Control *the_mutex
-);
-
-/*
- * _POSIX_Mutex_Get
- *
- * DESCRIPTION:
- *
- * This function maps mutexes IDs to mutexes control blocks.
- * If ID corresponds to a local mutexes, then it returns
- * the_mutex control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the mutexes ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_mutex is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_mutex is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
- Objects_Id *id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Mutex_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_mutex is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
- POSIX_Mutex_Control *the_mutex
-);
-
-#include <rtems/posix/mutex.inl>
-#include <rtems/posix/mutexmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/include/rtems/posix/mutexmp.h b/cpukit/posix/include/rtems/posix/mutexmp.h
deleted file mode 100644
index 71f60677eb..0000000000
--- a/cpukit/posix/include/rtems/posix/mutexmp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* mutexmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Mutex Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MUTEX_MP_h
-#define __RTEMS_POSIX_MUTEX_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote mutex operations.
- */
-
-typedef enum {
- POSIX_MUTEX_MP_ANNOUNCE_CREATE = 0,
- POSIX_MUTEX_MP_ANNOUNCE_DELETE = 1,
- POSIX_MUTEX_MP_EXTRACT_PROXY = 2,
- POSIX_MUTEX_MP_OBTAIN_REQUEST = 3,
- POSIX_MUTEX_MP_OBTAIN_RESPONSE = 4,
- POSIX_MUTEX_MP_RELEASE_REQUEST = 5,
- POSIX_MUTEX_MP_RELEASE_RESPONSE = 6,
-} POSIX_Mutex_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote mutex operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Mutex_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait; /* XXX options */
- Objects_Id proxy_id;
-} POSIX_Mutex_MP_Packet;
-
-/*
- * _POSIX_Mutex_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Mutex_MP_Send_process_packet (
- POSIX_Mutex_MP_Remote_operations operation,
- Objects_Id mutex_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Mutex_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Mutex_MP_Send_request_packet (
- POSIX_Mutex_MP_Remote_operations operation,
- Objects_Id mutex_id,
- boolean wait, /* XXX options */
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Mutex_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Mutex_MP_Send_response_packet (
- POSIX_Mutex_MP_Remote_operations operation,
- Objects_Id mutex_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Mutex_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Mutex_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Mutex_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Mutex_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Mutex_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Mutex_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Mutex_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a mutex mp packet.
- */
-
-POSIX_Mutex_MP_Packet *_POSIX_Mutex_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/cpukit/posix/include/rtems/posix/posixapi.h b/cpukit/posix/include/rtems/posix/posixapi.h
deleted file mode 100644
index f7c52985c3..0000000000
--- a/cpukit/posix/include/rtems/posix/posixapi.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * POSIX API Support
- *
- * NOTE:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __POSIX_API_h
-#define __POSIX_API_h
-
-#include <rtems/config.h>
-
-/*PAGE
- *
- * _POSIX_API_Initialize
- *
- * XXX
- */
-
-void _POSIX_API_Initialize(
- rtems_configuration_table *configuration_table
-);
-
-#endif
-/* end of include file */
diff --git a/cpukit/posix/include/rtems/posix/priority.h b/cpukit/posix/include/rtems/posix/priority.h
deleted file mode 100644
index c0253f3bab..0000000000
--- a/cpukit/posix/include/rtems/posix/priority.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- *
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_PRIORITY_h
-#define __RTEMS_POSIX_PRIORITY_h
-
-#include <rtems/score/priority.h>
-
-/*
- * 1003.1b-1993,2.2.2.80 definition of priority, p. 19
- *
- * "Numericallly higher values represent higher priorities."
- *
- * Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
- *
- * There are only 254 posix priority levels since a task at priority level
- * 255 would never run because of the RTEMS idle task. This is necessary
- * because GNAT maps the lowest Ada task priority to the lowest thread
- * priority. The lowest priority Ada task should get to run, so there is
- * a fundamental conflict with having 255 priorities.
- */
-
-#define POSIX_SCHEDULER_MAXIMUM_PRIORITY (254)
-
-#define POSIX_SCHEDULER_MINIMUM_PRIORITY (1)
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
- int priority
-);
-
-RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
- int priority
-);
-
-RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
- Priority_Control priority
-);
-
-#include <rtems/posix/priority.inl>
-
-#endif
diff --git a/cpukit/posix/include/rtems/posix/psignal.h b/cpukit/posix/include/rtems/posix/psignal.h
deleted file mode 100644
index 4ecba1f41c..0000000000
--- a/cpukit/posix/include/rtems/posix/psignal.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_SIGNALS_h
-#define __RTEMS_POSIX_SIGNALS_h
-
-typedef struct {
- Chain_Node Node;
- siginfo_t Info;
-} POSIX_signals_Siginfo_node;
-
-void _POSIX_signals_Manager_Initialization(
- int maximum_queued_signals
-);
-
-void _POSIX_signals_Post_switch_extension(
- Thread_Control *the_thread
-);
-
-#endif
-/* end of file */
diff --git a/cpukit/posix/include/rtems/posix/pthread.h b/cpukit/posix/include/rtems/posix/pthread.h
deleted file mode 100644
index abf5933fc2..0000000000
--- a/cpukit/posix/include/rtems/posix/pthread.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/* rtems/posix/pthread.h
- *
- * This include file contains all the private support information for
- * POSIX threads.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_THREADS_h
-#define __RTEMS_POSIX_THREADS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/posix/config.h>
-#include <rtems/posix/threadsup.h>
-
-#define PTHREAD_MINIMUM_STACK_SIZE (STACK_MINIMUM_SIZE * 2)
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Threads_Information;
-
-/*
- * These are used to manage the user initialization threads.
- */
-
-POSIX_EXTERN posix_initialization_threads_table
- *_POSIX_Threads_User_initialization_threads;
-POSIX_EXTERN unsigned32 _POSIX_Threads_Number_of_initialization_threads;
-
-
-/*
- * _POSIX_Threads_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Threads_Manager_initialization(
- unsigned32 maximum_pthreads,
- unsigned32 number_of_initialization_threads,
- posix_initialization_threads_table *user_threads
-);
-
-/*
- * _POSIX_Threads_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a pthread control block from
- * the inactive chain of free pthread control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void );
-
-/*
- * _POSIX_Threads_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a pthread control block to the
- * inactive chain of free pthread control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free(
- Thread_Control *the_pthread
-);
-
-/*
- * _POSIX_Threads_Get
- *
- * DESCRIPTION:
- *
- * This function maps pthread IDs to pthread control blocks.
- * If ID corresponds to a local pthread, then it returns
- * the_pthread control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the pthread ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_pthread is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_pthread is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get(
- pthread_t id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Threads_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_pthread is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null(
- Thread_Control *the_pthread
-);
-
-#include <rtems/posix/pthread.inl>
-#include <rtems/posix/pthreadmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/include/rtems/posix/pthreadmp.h b/cpukit/posix/include/rtems/posix/pthreadmp.h
deleted file mode 100644
index af5997ead7..0000000000
--- a/cpukit/posix/include/rtems/posix/pthreadmp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* pthreadmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Threads Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_THREADS_MP_h
-#define __RTEMS_POSIX_THREADS_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote pthread operations.
- */
-
-typedef enum {
- POSIX_THREADS_MP_ANNOUNCE_CREATE = 0,
- POSIX_THREADS_MP_ANNOUNCE_DELETE = 1,
- POSIX_THREADS_MP_EXTRACT_PROXY = 2,
- POSIX_THREADS_MP_OBTAIN_REQUEST = 3,
- POSIX_THREADS_MP_OBTAIN_RESPONSE = 4,
- POSIX_THREADS_MP_RELEASE_REQUEST = 5,
- POSIX_THREADS_MP_RELEASE_RESPONSE = 6
-} POSIX_Threads_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote pthread operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Threads_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait;
- Objects_Id proxy_id;
-} POSIX_Threads_MP_Packet;
-
-/*
- * _POSIX_Threads_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Threads_MP_Send_process_packet (
- POSIX_Threads_MP_Remote_operations operation,
- Objects_Id pthread_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Threads_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Threads_MP_Send_request_packet (
- POSIX_Threads_MP_Remote_operations operation,
- Objects_Id pthread_id,
- boolean wait,
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Threads_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Threads_MP_Send_response_packet (
- POSIX_Threads_MP_Remote_operations operation,
- Objects_Id pthread_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Threads_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Threads_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Threads_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Threads_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Threads_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Threads_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Threads_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a pthread mp packet.
- */
-
-POSIX_Threads_MP_Packet *_POSIX_Threads_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/cpukit/posix/include/rtems/posix/semaphore.h b/cpukit/posix/include/rtems/posix/semaphore.h
deleted file mode 100644
index cc658ee32b..0000000000
--- a/cpukit/posix/include/rtems/posix/semaphore.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/* rtems/posix/semaphore.h
- *
- * This include file contains all the private support information for
- * POSIX Semaphores.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_SEMAPHORE_h
-#define __RTEMS_POSIX_SEMAPHORE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/coresem.h>
-
-/*
- * Data Structure used to manage a POSIX semaphore
- */
-
-typedef struct {
- Objects_Control Object;
- int process_shared;
- boolean named;
- boolean linked;
- unsigned32 open_count;
- CORE_semaphore_Control Semaphore;
-} POSIX_Semaphore_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Semaphore_Information;
-
-/*
- * _POSIX_Semaphore_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Semaphore_Manager_initialization(
- unsigned32 maximum_semaphorees
-);
-
-/*
- * _POSIX_Semaphore_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a semaphore control block from
- * the inactive chain of free semaphore control blocks.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void );
-
-/*
- * _POSIX_Semaphore_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a semaphore control block to the
- * inactive chain of free semaphore control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
- POSIX_Semaphore_Control *the_semaphore
-);
-
-/*
- * _POSIX_Semaphore_Get
- *
- * DESCRIPTION:
- *
- * This function maps semaphore IDs to semaphore control blocks.
- * If ID corresponds to a local semaphore, then it returns
- * the_semaphore control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the semaphore ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_semaphore is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_semaphore is undefined.
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
- Objects_Id *id,
- Objects_Locations *location
-);
-
-/*
- * _POSIX_Semaphore_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
- POSIX_Semaphore_Control *the_semaphore
-);
-
-/*
- * _POSIX_Semaphore_Name_to_id
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-int _POSIX_Semaphore_Name_to_id(
- const char *name,
- Objects_Id *id
-);
-
-#include <rtems/posix/semaphore.inl>
-#include <rtems/posix/semaphoremp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/include/rtems/posix/semaphoremp.h b/cpukit/posix/include/rtems/posix/semaphoremp.h
deleted file mode 100644
index 14af483f98..0000000000
--- a/cpukit/posix/include/rtems/posix/semaphoremp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* semaphoremp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the POSIX Semaphore Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_SEMAPHORE_MP_h
-#define __RTEMS_POSIX_SEMAPHORE_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote semaphore operations.
- */
-
-typedef enum {
- POSIX_SEMAPHORE_MP_ANNOUNCE_CREATE = 0,
- POSIX_SEMAPHORE_MP_ANNOUNCE_DELETE = 1,
- POSIX_SEMAPHORE_MP_EXTRACT_PROXY = 2,
- POSIX_SEMAPHORE_MP_OBTAIN_REQUEST = 3,
- POSIX_SEMAPHORE_MP_OBTAIN_RESPONSE = 4,
- POSIX_SEMAPHORE_MP_RELEASE_REQUEST = 5,
- POSIX_SEMAPHORE_MP_RELEASE_RESPONSE = 6,
-} POSIX_Semaphore_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote semaphore operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- POSIX_Semaphore_MP_Remote_operations operation;
- Objects_Name name;
- boolean wait; /* XXX options */
- Objects_Id proxy_id;
-} POSIX_Semaphore_MP_Packet;
-
-/*
- * _POSIX_Semaphore_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _POSIX_Semaphore_MP_Send_process_packet (
- POSIX_Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- Objects_Name name,
- Objects_Id proxy_id
-);
-
-/*
- * _POSIX_Semaphore_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-int _POSIX_Semaphore_MP_Send_request_packet (
- POSIX_Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- boolean wait, /* XXX options */
- Watchdog_Interval timeout
-);
-
-/*
- * _POSIX_Semaphore_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _POSIX_Semaphore_MP_Send_response_packet (
- POSIX_Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _POSIX_Semaphore_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _POSIX_Semaphore_MP_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _POSIX_Semaphore_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Semaphore_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _POSIX_Semaphore_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _POSIX_Semaphore_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _POSIX_Semaphore_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a semaphore mp packet.
- */
-
-POSIX_Semaphore_MP_Packet *_POSIX_Semaphore_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/cpukit/posix/include/rtems/posix/threadsup.h b/cpukit/posix/include/rtems/posix/threadsup.h
deleted file mode 100644
index bb800a507f..0000000000
--- a/cpukit/posix/include/rtems/posix/threadsup.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* threadsup.h
- *
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_THREAD_SUPPORT_h
-#define __RTEMS_POSIX_THREAD_SUPPORT_h
-
-#include <rtems/score/coresem.h>
-#include <rtems/score/tqdata.h>
-
-typedef struct {
- pthread_attr_t Attributes;
- int detachstate;
- Thread_queue_Control Join_List;
- int schedpolicy;
- struct sched_param schedparam;
- int ss_high_priority;
- Watchdog_Control Sporadic_timer;
-
- sigset_t signals_blocked;
- sigset_t signals_pending;
-
-#if 0
- /*
- * POSIX Interrupts
- */
- unsigned32 interrupts_installed;
- CORE_semaphore_Control Interrupt_Semaphore;
-#endif
-
-#if 0
- /*
- * POSIX Cancelability
- */
- int cancelability_state;
- int cancelability_type;
- int cancelation_requested;
- Chain_Control Cancellation_Handlers;
-#endif
-
-} POSIX_API_Control;
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/include/rtems/posix/time.h b/cpukit/posix/include/rtems/posix/time.h
deleted file mode 100644
index 0e87db388e..0000000000
--- a/cpukit/posix/include/rtems/posix/time.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- *
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_TIME_h
-#define __RTEMS_POSIX_TIME_h
-
-#include <rtems/score/tod.h>
-
-/*
- * Seconds from January 1, 1970 to January 1, 1988. Used to account for
- * differences between POSIX API and RTEMS core.
- */
-
-#define POSIX_TIME_SECONDS_1970_THROUGH_1988 \
- (((1987 - 1970 + 1) * TOD_SECONDS_PER_NON_LEAP_YEAR) + \
- (4 * TOD_SECONDS_PER_DAY))
-
-/*PAGE
- *
- * _POSIX_Timespec_subtract
- */
-
-void _POSIX_Timespec_subtract(
- const struct timespec *the_start,
- const struct timespec *end,
- struct timespec *result
-);
-
-/*
- * _POSIX_Timespec_to_interval
- */
-
-Watchdog_Interval _POSIX_Timespec_to_interval(
- const struct timespec *time
-);
-
-/*PAGE
- *
- * _POSIX_Interval_to_timespec
- */
-
-void _POSIX_Interval_to_timespec(
- Watchdog_Interval ticks,
- struct timespec *time
-);
-
-#endif
diff --git a/cpukit/posix/include/sched.h b/cpukit/posix/include/sched.h
deleted file mode 100644
index 14a603c0c5..0000000000
--- a/cpukit/posix/include/sched.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* sched.h
- *
- * $Id$
- */
-
-
-#ifndef __POSIX_SCHEDULING_h
-#define __POSIX_SCHEDULING_h
-
-#include <sys/features.h>
-
-#if defined(_POSIX_PRIORITY_SCHEDULING)
-
-#include <sys/types.h>
-#include <time.h>
-#include <sys/sched.h>
-#include <pthread.h>
-
-/*
- * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252
- *
- */
-
-int sched_setparam(
- pid_t pid,
- const struct sched_param *param
-);
-
-/*
- * 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253
- */
-
-int sched_getparam(
- pid_t pid,
- const struct sched_param *param
-);
-
-/*
- * 13.3.3 Set Scheduling Policy and Scheduling Parameters,
- * P1003.1b-1993, p. 254
- */
-
-int sched_setscheduler(
- pid_t pid,
- int policy,
- const struct sched_param *param
-);
-
-/*
- * 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256
- */
-
-int sched_getscheduler(
- pid_t pid
-);
-
-/*
- * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
- */
-
-int sched_get_priority_max(
- int policy
-);
-
-int sched_get_priority_min(
- int policy
-);
-
-int sched_rr_get_interval(
- pid_t pid,
- struct timespec *interval
-);
-
-#endif /* _POSIX_PRIORITY_SCHEDULING */
-
-#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING)
-
-/*
- * 13.3.5 Yield Processor, P1003.1b-1993, p. 257
- */
-
-int sched_yield( void );
-
-#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/include/semaphore.h b/cpukit/posix/include/semaphore.h
deleted file mode 100644
index 0388f91ad9..0000000000
--- a/cpukit/posix/include/semaphore.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* semaphore.h
- *
- * $Id$
- */
-
-#ifndef __POSIX_SEMAPHORE_h
-#define __POSIX_SEMAPHORE_h
-
-#include <rtems/posix/features.h>
-
-#if defined(_POSIX_SEMAPHORES)
-
-#include <sys/time.h>
-
-/*
- * 11.1 Semaphore Characteristics, P1003.1b-1993, p.219
- */
-
-typedef int sem_t;
-
-/*
- * 11.2.1 Initialize an Unnamed Semaphore, P1003.1b-1993, p.219
- */
-
-int sem_init(
- sem_t *sem,
- int pshared,
- unsigned int value
-);
-
-/*
- * 11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220
- */
-
-int sem_destroy(
- sem_t *sem
-);
-
-/*
- * 11.2.3 Initialize/Open a Named Semaphore, P1003.1b-1993, p.221
- *
- * NOTE: Follows open() calling conventions.
- */
-
-sem_t *sem_open(
- const char *name,
- int oflag,
- ...
-);
-
-/*
- * 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224
- */
-
-int sem_close(
- sem_t *sem
-);
-
-/*
- * 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225
- */
-
-int sem_unlink(
- const char *name
-);
-
-/*
- * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226
- *
- * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27
- */
-
-int sem_wait(
- sem_t *sem
-);
-
-int sem_trywait(
- sem_t *sem
-);
-
-#if defined(_POSIX_TIMEOUTS)
-int sem_timedwait(
- sem_t *sem,
- const struct timespec *timeout
-);
-#endif
-
-/*
- * 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227
- */
-
-int sem_post(
- sem_t *sem
-);
-
-/*
- * 11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229
- */
-
-int sem_getvalue(
- sem_t *sem,
- int *sval
-);
-
-#endif /* _POSIX_SEMAPHORES */
-
-#endif
-/* end of include file */
diff --git a/cpukit/posix/inline/rtems/posix/cond.inl b/cpukit/posix/inline/rtems/posix/cond.inl
deleted file mode 100644
index 3a6741b1b8..0000000000
--- a/cpukit/posix/inline/rtems/posix/cond.inl
+++ /dev/null
@@ -1,77 +0,0 @@
-/* rtems/posix/cond.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX condition variables.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_CONDITION_VARIABLES_inl
-#define __RTEMS_POSIX_CONDITION_VARIABLES_inl
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
- *_POSIX_Condition_variables_Allocate( void )
-{
- return (POSIX_Condition_variables_Control *)
- _Objects_Allocate( &_POSIX_Condition_variables_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
- POSIX_Condition_variables_Control *the_condition_variable
-)
-{
- _Objects_Free(
- &_POSIX_Condition_variables_Information,
- &the_condition_variable->Object
- );
-}
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
- Objects_Id *id,
- Objects_Locations *location
-)
-{
-/* XXX really should validate pointer */
-/* XXX should support COND_INITIALIZER */
- return (POSIX_Condition_variables_Control *)
- _Objects_Get( &_POSIX_Condition_variables_Information, *id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
- POSIX_Condition_variables_Control *the_condition_variable
-)
-{
- return !the_condition_variable;
-}
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/inline/rtems/posix/intr.inl b/cpukit/posix/inline/rtems/posix/intr.inl
deleted file mode 100644
index d084a1d12a..0000000000
--- a/cpukit/posix/inline/rtems/posix/intr.inl
+++ /dev/null
@@ -1,72 +0,0 @@
-/* rtems/posix/intr.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX Interrupt Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_INTERRUPT_inl
-#define __RTEMS_POSIX_INTERRUPT_inl
-
-/*PAGE
- *
- * _POSIX_Interrupt_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
- _POSIX_Interrupt_Allocate( void )
-{
- return (POSIX_Interrupt_Handler_control *)
- _Objects_Allocate( &_POSIX_Interrupt_Handlers_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Interrupt_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
- POSIX_Interrupt_Handler_control *the_intr
-)
-{
- _Objects_Free( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Interrupt_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (POSIX_Interrupt_Control *)
- _Objects_Get( &_POSIX_Interrupt_Handlers_Information, id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Interrupt_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
- POSIX_Interrupt_Handler_control *the_intr
-)
-{
- return !the_intr;
-}
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/inline/rtems/posix/key.inl b/cpukit/posix/inline/rtems/posix/key.inl
deleted file mode 100644
index fa4d31b11f..0000000000
--- a/cpukit/posix/inline/rtems/posix/key.inl
+++ /dev/null
@@ -1,70 +0,0 @@
-/* rtems/posix/key.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX key's.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_KEY_inl
-#define __RTEMS_POSIX_KEY_inl
-
-/*PAGE
- *
- * _POSIX_Keys_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
-{
- return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Keys_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
- POSIX_Keys_Control *the_key
-)
-{
- _Objects_Free( &_POSIX_Keys_Information, &the_key->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Keys_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (POSIX_Keys_Control *)
- _Objects_Get( &_POSIX_Keys_Information, id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Keys_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
- POSIX_Keys_Control *the_key
-)
-{
- return !the_key;
-}
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/inline/rtems/posix/mqueue.inl b/cpukit/posix/inline/rtems/posix/mqueue.inl
deleted file mode 100644
index 51326fba7b..0000000000
--- a/cpukit/posix/inline/rtems/posix/mqueue.inl
+++ /dev/null
@@ -1,83 +0,0 @@
-/* rtems/posix/mqueue.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX Message Queue.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MESSAGE_QUEUE_inl
-#define __RTEMS_POSIX_MESSAGE_QUEUE_inl
-
-/*PAGE
- *
- * _POSIX_Message_queue_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
-{
- return (POSIX_Message_queue_Control *)
- _Objects_Allocate( &_POSIX_Message_queue_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
- POSIX_Message_queue_Control *the_mq
-)
-{
- _Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (POSIX_Message_queue_Control *)
- _Objects_Get( &_POSIX_Message_queue_Information, id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
- POSIX_Message_queue_Control *the_mq
-)
-{
- return !the_mq;
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Priority_to_core
- */
-
-RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
- unsigned int priority
-)
-{
- return priority;
-}
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/inline/rtems/posix/mutex.inl b/cpukit/posix/inline/rtems/posix/mutex.inl
deleted file mode 100644
index 5c1f3b7b73..0000000000
--- a/cpukit/posix/inline/rtems/posix/mutex.inl
+++ /dev/null
@@ -1,93 +0,0 @@
-/* rtems/posix/mutex.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX mutex's.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_MUTEX_inl
-#define __RTEMS_POSIX_MUTEX_inl
-
-/*PAGE
- *
- * _POSIX_Mutex_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void )
-{
- return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Mutex_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
- POSIX_Mutex_Control *the_mutex
-)
-{
- _Objects_Free( &_POSIX_Mutex_Information, &the_mutex->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Mutex_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
- Objects_Id *id,
- Objects_Locations *location
-)
-{
- int status;
-
- if ( !id ) {
- *location = OBJECTS_ERROR;
- return (POSIX_Mutex_Control *) 0;
- }
-
- if ( *id == PTHREAD_MUTEX_INITIALIZER ) {
- /*
- * Do an "auto-create" here.
- */
-
- status = pthread_mutex_init( id, 0 );
- if ( status ) {
- *location = OBJECTS_ERROR;
- return (POSIX_Mutex_Control *) 0;
- }
- }
-
- /*
- * Now call Objects_Get()
- */
-
- return (POSIX_Mutex_Control *)
- _Objects_Get( &_POSIX_Mutex_Information, *id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Mutex_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
- POSIX_Mutex_Control *the_mutex
-)
-{
- return !the_mutex;
-}
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/inline/rtems/posix/priority.inl b/cpukit/posix/inline/rtems/posix/priority.inl
deleted file mode 100644
index dc8187d4ef..0000000000
--- a/cpukit/posix/inline/rtems/posix/priority.inl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef __RTEMS_POSIX_PRIORITY_inl
-#define __RTEMS_POSIX_PRIORITY_inl
-
-/*
- * 1003.1b-1993,2.2.2.80 definition of priority, p. 19
- *
- * "Numericallly higher values represent higher priorities."
- *
- * Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
- int priority
-)
-{
- return (boolean) (priority >= 1 && priority <= 254);
-}
-
-RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
- int priority
-)
-{
- return (Priority_Control) (255 - priority);
-}
-
-RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
- Priority_Control priority
-)
-{
- return 255 - priority;
-}
-
-#endif
diff --git a/cpukit/posix/inline/rtems/posix/pthread.inl b/cpukit/posix/inline/rtems/posix/pthread.inl
deleted file mode 100644
index 51f7287384..0000000000
--- a/cpukit/posix/inline/rtems/posix/pthread.inl
+++ /dev/null
@@ -1,70 +0,0 @@
-/* rtems/posix/pthread.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX threads.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_THREADS_inl
-#define __RTEMS_POSIX_THREADS_inl
-
-/*PAGE
- *
- * _POSIX_Threads_Allocate
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
-{
- return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
- Thread_Control *the_pthread
-)
-{
- _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Get
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get (
- pthread_t id,
- Objects_Locations *location
-)
-{
- return (Thread_Control *)
- _Objects_Get( &_POSIX_Threads_Information, (Objects_Id)id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null (
- Thread_Control *the_pthread
-)
-{
- return !the_pthread;
-}
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/inline/rtems/posix/semaphore.inl b/cpukit/posix/inline/rtems/posix/semaphore.inl
deleted file mode 100644
index 8f2189d82a..0000000000
--- a/cpukit/posix/inline/rtems/posix/semaphore.inl
+++ /dev/null
@@ -1,71 +0,0 @@
-/* rtems/posix/semaphore.inl
- *
- * This include file contains the static inline implementation of the private
- * inlined routines for POSIX Semaphores.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_POSIX_SEMAPHORE_inl
-#define __RTEMS_POSIX_SEMAPHORE_inl
-
-/*PAGE
- *
- * _POSIX_Semaphore_Allocate
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
-{
- return (POSIX_Semaphore_Control *)
- _Objects_Allocate( &_POSIX_Semaphore_Information );
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Free
- */
-
-RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
- POSIX_Semaphore_Control *the_semaphore
-)
-{
- _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Get
- */
-
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
- Objects_Id *id,
- Objects_Locations *location
-)
-{
- return (POSIX_Semaphore_Control *)
- _Objects_Get( &_POSIX_Semaphore_Information, *id, location );
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Is_null
- */
-
-RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
- POSIX_Semaphore_Control *the_semaphore
-)
-{
- return !the_semaphore;
-}
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/posix/src/adasupp.c b/cpukit/posix/src/adasupp.c
deleted file mode 100644
index 234b0c2a40..0000000000
--- a/cpukit/posix/src/adasupp.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * $Id$
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <pthread.h>
-
-#include <rtems/system.h>
-#include <rtems/posix/pthread.h>
-
-/*PAGE
- *
- * _ada_pthread_minimum_stack_size
- *
- * This routine returns the minimum stack size so the GNAT RTS can
- * allocate enough stack for Ada tasks.
- */
-
-size_t _ada_pthread_minimum_stack_size( void )
-{
- /*
- * Eventually this may need to include a per cpu family calculation
- * but for now, this will do.
- */
-
- return PTHREAD_MINIMUM_STACK_SIZE * 2;
-}
diff --git a/cpukit/posix/src/aio.c b/cpukit/posix/src/aio.c
deleted file mode 100644
index 9fc072f820..0000000000
--- a/cpukit/posix/src/aio.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * $Id$
- */
-
-#include <aio.h>
-
-#include <rtems/system.h>
-
-/*PAGE
- *
- * 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154
- */
-
-int aio_read(
- struct aiocb *aiocbp
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155
- */
-
-int aio_write(
- struct aiocb *aiocbp
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 6.7.4 List Directed I/O, P1003.1b-1993, p. 158
- */
-
-int lio_listio(
- int mode,
- struct aiocb * const list[],
- int nent,
- struct sigevent *sig
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161
- */
-
-int aio_error(
- const struct aiocb *aiocbp
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
- * P1003.1b-1993, p. 162
- */
-
-int aio_return(
- const struct aiocb *aiocbp
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163
- */
-
-int aio_cancel(
- int filedes,
- struct aiocb *aiocbp
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164
- */
-
-int aio_suspend(
- struct aiocb * const list[],
- int nent,
- const struct timespec *timeout
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166
- */
-
-int aio_fsync(
- int op,
- struct aiocb *aiocbp
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
diff --git a/cpukit/posix/src/cancel.c b/cpukit/posix/src/cancel.c
deleted file mode 100644
index b6cc073456..0000000000
--- a/cpukit/posix/src/cancel.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * $Id$
- */
-
-#include <pthread.h>
-#include <errno.h>
-
-#include <rtems/system.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/posix/cancel.h>
-#include <rtems/posix/pthread.h>
-#include <rtems/posix/threadsup.h>
-
-/*PAGE
- *
- * POSIX_Thread_cancel_run
- *
- */
-
-void POSIX_Thread_cancel_run(
- Thread_Control *the_thread
-)
-{
- int old_cancel_state;
- POSIX_Cancel_Handler_control *handler;
- Chain_Control *handler_stack;
- POSIX_API_Thread_Support_Control *thread_support;
- ISR_Level level;
-
- thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- handler_stack = &thread_support->Cancellation_Handlers;
-
- old_cancel_state = thread_support->cancelability_state;
-
- thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE;
-
- while ( !_Chain_Is_empty( handler_stack ) ) {
- _ISR_Disable( level );
- handler = (POSIX_Cancel_Handler_control *) _Chain_Tail( handler_stack );
- _Chain_Extract_unprotected( &handler->Node );
- _ISR_Enable( level );
-
- (*handler->routine)( handler->arg );
-
- _Workspace_Free( handler );
- }
-
- thread_support->cancelation_requested = 0;
-
- thread_support->cancelability_state = old_cancel_state;
-}
-
-/*PAGE
- *
- * 18.2.1 Canceling Execution of a Thread, P1003.1c/Draft 10, p. 181
- */
-
-int pthread_cancel(
- pthread_t thread
-)
-{
- Thread_Control *the_thread;
- POSIX_API_Thread_Support_Control *thread_support;
- Objects_Locations location;
-
- the_thread = _POSIX_Threads_Get( &thread, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- return POSIX_MP_NOT_IMPLEMENTED();
- case OBJECTS_LOCAL:
- thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- thread_support->cancelation_requested = 1;
-
- _Thread_Enable_dispatch();
- return 0;
- }
-
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
- */
-
-int pthread_setcancelstate(
- int state,
- int *oldstate
-)
-{
- POSIX_API_Thread_Support_Control *thread_support;
-
- if ( !oldstate )
- return EINVAL;
-
- if ( state != PTHREAD_CANCEL_ENABLE && state != PTHREAD_CANCEL_DISABLE )
- return EINVAL;
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- *oldstate = thread_support->cancelability_state;
- thread_support->cancelability_state = state;
-
- if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
- thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
- thread_support->cancelation_requested )
- POSIX_Thread_cancel_run( _Thread_Executing );
-
- return 0;
-}
-
-/*PAGE
- *
- * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
- */
-
-int pthread_setcanceltype(
- int type,
- int *oldtype
-)
-{
- POSIX_API_Thread_Support_Control *thread_support;
-
- if ( !oldtype )
- return EINVAL;
-
- if ( type != PTHREAD_CANCEL_DEFERRED && type != PTHREAD_CANCEL_ASYNCHRONOUS )
- return EINVAL;
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- *oldtype = thread_support->cancelability_type;
- thread_support->cancelability_type = type;
-
- if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
- thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
- thread_support->cancelation_requested )
- POSIX_Thread_cancel_run( _Thread_Executing );
-
- return 0;
-}
-
-/*PAGE
- *
- * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
- */
-
-void pthread_testcancel( void )
-{
- POSIX_API_Thread_Support_Control *thread_support;
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
- thread_support->cancelation_requested )
- POSIX_Thread_cancel_run( _Thread_Executing );
-}
-
-/*PAGE
- *
- * 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184
- */
-
-void pthread_cleanup_push(
- void (*routine)( void * ),
- void *arg
-)
-{
- POSIX_Cancel_Handler_control *handler;
- Chain_Control *handler_stack;
- POSIX_API_Thread_Support_Control *thread_support;
-
- if ( !routine )
- return; /* XXX what to do really? */
-
- handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
-
- if ( !handler )
- return; /* XXX what to do really? */
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- handler_stack = &thread_support->Cancellation_Handlers;
-
- handler->routine = routine;
- handler->arg = arg;
-
- _Chain_Append( handler_stack, &handler->Node );
-}
-
-/*PAGE
- *
- * 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184
- */
-
-void pthread_cleanup_pop(
- int execute
-)
-{
- POSIX_Cancel_Handler_control *handler;
- Chain_Control *handler_stack;
- POSIX_API_Thread_Support_Control *thread_support;
- ISR_Level level;
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- handler_stack = &thread_support->Cancellation_Handlers;
-
- if ( _Chain_Is_empty( handler_stack ) )
- return;
-
- _ISR_Disable( level );
- handler = (POSIX_Cancel_Handler_control *) _Chain_Tail( handler_stack );
- _Chain_Extract_unprotected( &handler->Node );
- _ISR_Enable( level );
-
- if ( execute )
- (*handler->routine)( handler->arg );
-
- _Workspace_Free( handler );
-}
diff --git a/cpukit/posix/src/cond.c b/cpukit/posix/src/cond.c
deleted file mode 100644
index 248f836b94..0000000000
--- a/cpukit/posix/src/cond.c
+++ /dev/null
@@ -1,502 +0,0 @@
-/*
- * $Id$
- */
-
-#include <pthread.h>
-#include <errno.h>
-
-#include <rtems/system.h>
-#include <rtems/score/object.h>
-#include <rtems/score/states.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/posix/cond.h>
-#include <rtems/posix/time.h>
-#include <rtems/posix/mutex.h>
-
-/*
- * TEMPORARY
- */
-
-void _POSIX_Condition_variables_MP_Send_process_packet (
- POSIX_Condition_variables_MP_Remote_operations operation,
- Objects_Id condition_variables_id,
- Objects_Name name,
- Objects_Id proxy_id
-)
-{
- (void) POSIX_MP_NOT_IMPLEMENTED();
-}
-
-void _POSIX_Condition_variables_MP_Send_extract_proxy(
- Thread_Control *the_thread
-)
-{
- (void) POSIX_MP_NOT_IMPLEMENTED();
-}
-
-/*
- * END OF TEMPORARY
- */
-
-/*PAGE
- *
- * The default condition variable attributes structure.
- */
-
-const pthread_condattr_t _POSIX_Condition_variables_Default_attributes = {
- TRUE, /* is_initialized */
- PTHREAD_PROCESS_PRIVATE /* process_shared */
-};
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Manager_initialization
- *
- * This routine initializes all condition variable manager related data
- * structures.
- *
- * Input parameters:
- * maximum_condition_variables - maximum configured condition_variables
- *
- * Output parameters: NONE
- */
-
-void _POSIX_Condition_variables_Manager_initialization(
- unsigned32 maximum_condition_variables
-)
-{
- _Objects_Initialize_information(
- &_POSIX_Condition_variables_Information,
- OBJECTS_POSIX_CONDITION_VARIABLES,
- TRUE,
- maximum_condition_variables,
- sizeof( POSIX_Condition_variables_Control ),
- FALSE,
- 0,
- FALSE
- );
-}
-
-/*PAGE
- *
- * 11.4.1 Condition Variable Initialization Attributes,
- * P1003.1c/Draft 10, p. 96
- */
-
-int pthread_condattr_init(
- pthread_condattr_t *attr
-)
-{
- if ( !attr )
- return EINVAL;
-
- *attr = _POSIX_Condition_variables_Default_attributes;
- return 0;
-}
-
-/*PAGE
- *
- * 11.4.1 Condition Variable Initialization Attributes,
- * P1003.1c/Draft 10, p. 96
- */
-
-int pthread_condattr_destroy(
- pthread_condattr_t *attr
-)
-{
- if ( !attr || attr->is_initialized == FALSE )
- return EINVAL;
-
- attr->is_initialized = FALSE;
- return 0;
-}
-
-/*PAGE
- *
- * 11.4.1 Condition Variable Initialization Attributes,
- * P1003.1c/Draft 10, p. 96
- */
-
-int pthread_condattr_getpshared(
- const pthread_condattr_t *attr,
- int *pshared
-)
-{
- if ( !attr )
- return EINVAL;
-
- *pshared = attr->process_shared;
- return 0;
-}
-
-/*PAGE
- *
- * 11.4.1 Condition Variable Initialization Attributes,
- * P1003.1c/Draft 10, p. 96
- */
-
-int pthread_condattr_setpshared(
- pthread_condattr_t *attr,
- int pshared
-)
-{
- if ( !attr )
- return EINVAL;
-
- switch ( pshared ) {
- case PTHREAD_PROCESS_SHARED:
- case PTHREAD_PROCESS_PRIVATE:
- attr->process_shared = pshared;
- return 0;
-
- default:
- return EINVAL;
- }
-}
-
-/*PAGE
- *
- * 11.4.2 Initializing and Destroying a Condition Variable,
- * P1003.1c/Draft 10, p. 87
- */
-
-int pthread_cond_init(
- pthread_cond_t *cond,
- const pthread_condattr_t *attr
-)
-{
- POSIX_Condition_variables_Control *the_cond;
- const pthread_condattr_t *the_attr;
-
- if ( attr ) the_attr = attr;
- else the_attr = &_POSIX_Condition_variables_Default_attributes;
-
- /*
- * XXX: Be careful about attributes when global!!!
- */
-
- if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
- return POSIX_MP_NOT_IMPLEMENTED();
-
- if ( !the_attr->is_initialized )
- return EINVAL;
-
- _Thread_Disable_dispatch();
-
- the_cond = _POSIX_Condition_variables_Allocate();
-
- if ( !the_cond ) {
- _Thread_Enable_dispatch();
- return ENOMEM;
- }
-
- if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED &&
- !( _Objects_MP_Allocate_and_open( &_POSIX_Condition_variables_Information,
- 0, the_cond->Object.id, FALSE ) ) ) {
- _POSIX_Condition_variables_Free( the_cond );
- _Thread_Enable_dispatch();
- return EAGAIN;
- }
-
- the_cond->process_shared = the_attr->process_shared;
-
- the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
-
-/* XXX some more initialization might need to go here */
- _Thread_queue_Initialize(
- &the_cond->Wait_queue,
- OBJECTS_POSIX_CONDITION_VARIABLES,
- THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_CONDITION_VARIABLE,
- _POSIX_Condition_variables_MP_Send_extract_proxy,
- ETIMEDOUT
- );
-
- _Objects_Open(
- &_POSIX_Condition_variables_Information,
- &the_cond->Object,
- 0
- );
-
- *cond = the_cond->Object.id;
-
- if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
- _POSIX_Condition_variables_MP_Send_process_packet(
- POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_CREATE,
- the_cond->Object.id,
- 0, /* Name not used */
- 0 /* Not used */
- );
-
- _Thread_Enable_dispatch();
-
- return 0;
-}
-
-/*PAGE
- *
- * 11.4.2 Initializing and Destroying a Condition Variable,
- * P1003.1c/Draft 10, p. 87
- */
-
-int pthread_cond_destroy(
- pthread_cond_t *cond
-)
-{
- register POSIX_Condition_variables_Control *the_cond;
- Objects_Locations location;
-
- the_cond = _POSIX_Condition_variables_Get( cond, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- return EINVAL;
- case OBJECTS_LOCAL:
-
- if ( _Thread_queue_First( &the_cond->Wait_queue ) ) {
- _Thread_Enable_dispatch();
- return EBUSY;
- }
-
- _Objects_Close(
- &_POSIX_Condition_variables_Information,
- &the_cond->Object
- );
-
- _POSIX_Condition_variables_Free( the_cond );
-
- if ( the_cond->process_shared == PTHREAD_PROCESS_SHARED ) {
-
- _Objects_MP_Close(
- &_POSIX_Condition_variables_Information,
- the_cond->Object.id
- );
-
- _POSIX_Condition_variables_MP_Send_process_packet(
- POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_DELETE,
- the_cond->Object.id,
- 0, /* Not used */
- 0 /* Not used */
- );
- }
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Signal_support
- *
- * A support routine which implements guts of the broadcast and single task
- * wake up version of the "signal" operation.
- */
-
-int _POSIX_Condition_variables_Signal_support(
- pthread_cond_t *cond,
- boolean is_broadcast
-)
-{
- register POSIX_Condition_variables_Control *the_cond;
- Objects_Locations location;
- Thread_Control *the_thread;
-
- the_cond = _POSIX_Condition_variables_Get( cond, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- return EINVAL;
- case OBJECTS_LOCAL:
-
- do {
- the_thread = _Thread_queue_Dequeue( &the_cond->Wait_queue );
- if ( !the_thread )
- the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
- } while ( is_broadcast && the_thread );
-
- _Thread_Enable_dispatch();
-
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101
- */
-
-int pthread_cond_signal(
- pthread_cond_t *cond
-)
-{
- return _POSIX_Condition_variables_Signal_support( cond, FALSE );
-}
-
-/*PAGE
- *
- * 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101
- */
-
-int pthread_cond_broadcast(
- pthread_cond_t *cond
-)
-{
- return _POSIX_Condition_variables_Signal_support( cond, TRUE );
-}
-
-/*PAGE
- *
- * _POSIX_Condition_variables_Wait_support
- *
- * A support routine which implements guts of the blocking, non-blocking, and
- * timed wait version of condition variable wait routines.
- */
-
-int _POSIX_Condition_variables_Wait_support(
- pthread_cond_t *cond,
- pthread_mutex_t *mutex,
- Watchdog_Interval timeout,
- boolean already_timedout
-)
-{
- register POSIX_Condition_variables_Control *the_cond;
- Objects_Locations location;
- int status;
- int mutex_status;
-
- if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
- return EINVAL;
- }
-
- _Thread_Unnest_dispatch();
-
- the_cond = _POSIX_Condition_variables_Get( cond, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- return EINVAL;
- case OBJECTS_LOCAL:
-
- if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) {
- _Thread_Enable_dispatch();
- return EINVAL;
- }
-
- (void) pthread_mutex_unlock( mutex );
-/* XXX ignore this for now since behavior is undefined
- if ( mutex_status ) {
- _Thread_Enable_dispatch();
- return EINVAL;
- }
-*/
-
- if ( !already_timedout ) {
- the_cond->Mutex = *mutex;
-
- _Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
- _Thread_Executing->Wait.return_code = 0;
- _Thread_Executing->Wait.queue = &the_cond->Wait_queue;
- _Thread_Executing->Wait.id = *cond;
-
- _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout );
-
- _Thread_Enable_dispatch();
-
- /*
- * Switch ourself out because we blocked as a result of the
- * _Thread_queue_Enqueue.
- */
-
- status = _Thread_Executing->Wait.return_code;
- if ( status && status != ETIMEDOUT )
- return status;
-
- } else {
- _Thread_Enable_dispatch();
- status = ETIMEDOUT;
- }
-
- /*
- * When we get here the dispatch disable level is 0.
- */
-
- mutex_status = pthread_mutex_lock( mutex );
- if ( mutex_status )
- return EINVAL;
-
- return status;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105
- */
-
-int pthread_cond_wait(
- pthread_cond_t *cond,
- pthread_mutex_t *mutex
-)
-{
- return _POSIX_Condition_variables_Wait_support(
- cond,
- mutex,
- THREAD_QUEUE_WAIT_FOREVER,
- FALSE
- );
-}
-
-/*PAGE
- *
- * 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105
- */
-
-int pthread_cond_timedwait(
- pthread_cond_t *cond,
- pthread_mutex_t *mutex,
- const struct timespec *abstime
-)
-{
- Watchdog_Interval timeout;
- struct timespec current_time;
- struct timespec difference;
- boolean already_timedout = FALSE;
-
- if ( !abstime )
- return EINVAL;
-
- /*
- * The abstime is a walltime. We turn it into an interval.
- */
-
- (void) clock_gettime( CLOCK_REALTIME, &current_time );
-
- /* XXX probably some error checking should go here */
-
- _POSIX_Timespec_subtract( &current_time, abstime, &difference );
-
- if ( ( difference.tv_sec < 0 ) || ( ( difference.tv_sec == 0 ) &&
- ( difference.tv_nsec < 0 ) ) )
- already_timedout = TRUE;
-
- timeout = _POSIX_Timespec_to_interval( &difference );
-
- return _POSIX_Condition_variables_Wait_support(
- cond,
- mutex,
- timeout,
- already_timedout
- );
-}
diff --git a/cpukit/posix/src/devctl.c b/cpukit/posix/src/devctl.c
deleted file mode 100644
index 699bc2d228..0000000000
--- a/cpukit/posix/src/devctl.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * $Id$
- */
-
-#include <devctl.h>
-
-#include <rtems/system.h>
-
-/*PAGE
- *
- * 21.2.1 Control a Device, P1003.4b/D8, p. 65
- */
-
-int devctl(
- int filedes,
- void *dev_data_ptr,
- size_t nbyte,
- int *dev_info_ptr
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
diff --git a/cpukit/posix/src/execl.c b/cpukit/posix/src/execl.c
deleted file mode 100644
index af26b539d5..0000000000
--- a/cpukit/posix/src/execl.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * execl() - POSIX 1003.1b 3.1.2
- *
- * $Id$
- */
-
-#include <errno.h>
-
-int execl(
- const char *path,
- const char *arg,
- ...
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/posix/src/execle.c b/cpukit/posix/src/execle.c
deleted file mode 100644
index 94b0ede939..0000000000
--- a/cpukit/posix/src/execle.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * execle() - POSIX 1003.1b 3.1.2
- *
- * $Id$
- */
-
-#include <errno.h>
-
-int execle(
- const char *path,
- char const *arg,
- ...
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/posix/src/execlp.c b/cpukit/posix/src/execlp.c
deleted file mode 100644
index 83b6ceba33..0000000000
--- a/cpukit/posix/src/execlp.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * execlp() - POSIX 1003.1b 3.1.2
- *
- * $Id$
- */
-
-#include <errno.h>
-
-int execlp(
- const char *file,
- const char *arg,
- ...
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/posix/src/execv.c b/cpukit/posix/src/execv.c
deleted file mode 100644
index d05f4a2c58..0000000000
--- a/cpukit/posix/src/execv.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * execv() - POSIX 1003.1b 3.1.2
- *
- * $Id$
- */
-
-#include <errno.h>
-
-int execv(
- const char *file,
- char *const argv[],
- ...
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/posix/src/execve.c b/cpukit/posix/src/execve.c
deleted file mode 100644
index 478af706ea..0000000000
--- a/cpukit/posix/src/execve.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * execve() - POSIX 1003.1b 3.1.2
- *
- * $Id$
- */
-
-#include <errno.h>
-
-int execve(
- const char *path,
- char *const argv[],
- char *const envp[],
- ...
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/posix/src/execvp.c b/cpukit/posix/src/execvp.c
deleted file mode 100644
index a9d7694fbd..0000000000
--- a/cpukit/posix/src/execvp.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * execvp() - POSIX 1003.1b 3.1.2
- *
- * $Id$
- */
-
-#include <errno.h>
-
-int execvp(
- const char *path,
- char const *argv[]
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/posix/src/fork.c b/cpukit/posix/src/fork.c
deleted file mode 100644
index 11cac91bdb..0000000000
--- a/cpukit/posix/src/fork.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * fork() - POSIX 1003.1b 3.1.1
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <errno.h>
-
-int fork( void )
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/posix/src/getpid.c b/cpukit/posix/src/getpid.c
deleted file mode 100644
index b42981398a..0000000000
--- a/cpukit/posix/src/getpid.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * $Id$
- */
-
-#include <limits.h>
-#include <errno.h>
-#include <string.h>
-#include <sys/types.h>
-
-#include <rtems/system.h>
-#include <rtems/score/object.h>
-#include <rtems/posix/seterr.h>
-
-/*PAGE
- *
- * 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83
- */
-
-pid_t getpid( void )
-{
- return _Objects_Local_node;
-}
diff --git a/cpukit/posix/src/intr.c b/cpukit/posix/src/intr.c
deleted file mode 100644
index 5d41a5fe52..0000000000
--- a/cpukit/posix/src/intr.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * NOTE: Each task has an interrupt semaphore associated with it.
- * No matter which interrupt occurs that it has registered,
- * the same semaphore is used.
- *
- * This whole interrupt scheme may have been eliminated in a later draft.
- *
- * $Id$
- */
-
-#include <errno.h>
-#include <intr.h>
-#include <pthread.h>
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/coresem.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/posix/intr.h>
-#include <rtems/posix/time.h>
-#include <rtems/posix/threadsup.h>
-
-/*
- * _POSIX_Interrupt_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Interrupt_Manager_initialization(
- unsigned32 maximum_interrupt_handlers
-)
-{
- unsigned32 index;
- POSIX_Interrupt_Control *the_vector;
-
- _Objects_Initialize_information(
- &_POSIX_Interrupt_Handlers_Information,
- OBJECTS_POSIX_INTERRUPTS,
- FALSE,
- maximum_interrupt_handlers,
- sizeof( POSIX_Interrupt_Handler_control ),
- FALSE,
- 0,
- FALSE
- );
-
- for ( index=0 ; index < CPU_INTERRUPT_NUMBER_OF_VECTORS ; index++ ) {
- the_vector = &_POSIX_Interrupt_Information[ index ];
-
- the_vector->number_installed = 0;
- the_vector->lock_count = 0;
- the_vector->deferred_count = 0;
- _Chain_Initialize_empty( &the_vector->Handlers );
- }
-}
-
-/*PAGE
- *
- * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
- */
-
-int intr_capture(
- intr_t intr,
- int (*intr_handler)( void *area ),
- volatile void *area,
- size_t areasize
-)
-{
- POSIX_Interrupt_Handler_control *the_intr;
- POSIX_Interrupt_Control *the_vector;
- POSIX_API_Thread_Support_Control *thread_support;
- proc_ptr old_handler;
-
- if ( !_ISR_Is_vector_number_valid( intr ) ||
- !_ISR_Is_valid_user_handler( intr_handler ) )
- return EINVAL;
-
- _Thread_Disable_dispatch();
-
- the_intr = _POSIX_Interrupt_Allocate();
-
- if ( !the_intr ) {
- _Thread_Enable_dispatch();
- return ENOMEM;
- }
-
- the_vector = &_POSIX_Interrupt_Information[ intr ];
-
- the_intr->vector = intr;
- the_intr->handler = intr_handler;
- the_intr->user_data_area = area;
- the_intr->server = _Thread_Executing;
- the_intr->is_active = TRUE;
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
- thread_support->interrupts_installed++;
-
-/* XXX should we malloc the semaphore on the fly??? if so we probably need to
- release it when the thread has released all interrupts and keep
- a count of how many it has installed. CURRENTLY NO.. ALLOCATED w/TCB
-*/
-
- /*
- * This is sufficient to have the handlers invoked in the opposite
- * order of installation. The loop invoking them can then go from
- * the front of the list to the end.
- */
-
- _Chain_Prepend( &the_vector->Handlers, &the_intr->Object.Node );
-
- if ( !the_vector->number_installed++ )
- _ISR_Install_vector(
- intr,
- (proc_ptr) _POSIX_Interrupt_Handler,
- &old_handler
- );
-
- _Objects_Open( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object, 0 );
-
- /*
- * Normally, an Id would be returned here.
- */
-
- _Thread_Enable_dispatch();
-
- return 0;
-}
-
-/*PAGE
- *
- * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
- */
-
-int intr_release(
- intr_t intr,
- int (*intr_handler)( void *area )
-)
-{
- boolean found;
- POSIX_Interrupt_Handler_control *the_intr;
- POSIX_Interrupt_Control *the_vector;
- POSIX_API_Thread_Support_Control *thread_support;
- Chain_Node *the_node;
-
- if ( !_ISR_Is_valid_user_handler( intr_handler ) )
- return EINVAL;
-
- _Thread_Disable_dispatch();
-
- /*
- * Since interrupt handlers do not have a user visible id, there is
- * no choice but to search the entire set of active interrupt handlers
- * to find this one.
- */
-
- found = FALSE;
-
- the_vector = &_POSIX_Interrupt_Information[ intr ];
-
- the_node = _Chain_Head( &the_vector->Handlers );
-
- for ( ; !_Chain_Is_tail( &the_vector->Handlers, the_node ) ; ) {
- the_intr = (POSIX_Interrupt_Handler_control *) the_node;
-
- if ( the_intr->handler == intr_handler ) {
- found = TRUE;
- break;
- }
- the_node = the_node->next;
- }
-
- if ( !found ) {
- _Thread_Enable_dispatch();
- return EINVAL;
- }
-
- if ( !_Thread_Is_executing( the_intr->server ) ) {
- _Thread_Enable_dispatch();
- return EINVAL; /* XXX should be ENOISR; */
- }
-
- /*
- * OK now we have found the interrupt handler and can do some work.
- */
-
- _Chain_Extract( &the_intr->Object.Node );
-
- the_intr->is_active = FALSE;
-
- the_vector->number_installed -= 1;
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
- thread_support->interrupts_installed--;
-
- /*
- * It is unnecessary to flush the semaphore since the handler can only
- * be "removed" by the thread which installed it. Thus it cannot be
- * blocked on the semaphore or it would not be executing this routine.
- */
-
- _Objects_Close( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object );
-
- _POSIX_Interrupt_Free( the_intr );
-
- _Thread_Enable_dispatch();
-
- return 0;
-}
-
-/*PAGE
- *
- * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
- */
-
-int intr_lock(
- intr_t intr
-)
-{
- POSIX_Interrupt_Control *the_vector;
-
- _Thread_Disable_dispatch();
-
- the_vector = &_POSIX_Interrupt_Information[ intr ];
-
- the_vector->lock_count++;
-
- _Thread_Enable_dispatch();
-
- return 0;
-}
-
-/*PAGE
- *
- * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
- */
-
-int intr_unlock(
- intr_t intr
-)
-{
- POSIX_Interrupt_Control *the_vector;
-
- _Thread_Disable_dispatch();
-
- the_vector = &_POSIX_Interrupt_Information[ intr ];
-
- if ( !--the_vector->lock_count ) {
- while ( --the_vector->deferred_count ) {
- _POSIX_Interrupt_Handler( intr );
- }
- }
-
- _Thread_Enable_dispatch();
-
- return 0;
-}
-
-/*
- * 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76
- */
-
-int intr_timed_wait(
- int flags,
- const struct timespec *timeout
-)
-{
- Watchdog_Interval ticks;
- POSIX_API_Thread_Support_Control *thread_support;
-
- ticks = _POSIX_Timespec_to_interval( timeout );
-
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- _Thread_Disable_dispatch();
-
- _CORE_semaphore_Seize(
- &thread_support->Interrupt_Semaphore,
- 0, /* XXX does id=0 hurt in this case? */
- TRUE,
- ticks
- );
- _Thread_Enable_dispatch();
-
- return _Thread_Executing->Wait.return_code; /* XXX should be POSIX */
-}
-
-/*PAGE
- *
- * _POSIX_Interrupt_Handler
- *
- */
-
-void _POSIX_Interrupt_Handler(
- ISR_Vector_number vector
-)
-{
- POSIX_Interrupt_Handler_control *the_intr;
- POSIX_Interrupt_Control *the_vector;
- POSIX_API_Thread_Support_Control *thread_support;
- Chain_Node *the_node;
- int status;
-
- the_vector = &_POSIX_Interrupt_Information[ vector ];
-
- the_node = _Chain_Head( &the_vector->Handlers );
-
- for ( ; !_Chain_Is_tail( &the_vector->Handlers, the_node ) ; ) {
- the_intr = (POSIX_Interrupt_Handler_control *) the_node;
-
- status = (*the_intr->handler)( (void *) the_intr->user_data_area );
-
- switch ( status ) {
- case INTR_HANDLED_NOTIFY:
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- _CORE_semaphore_Surrender(
- &thread_support->Interrupt_Semaphore,
- 0, /* XXX is id=0 a problem */
- 0 /* XXX is this a problem (mp support)*/
- );
- return;
-
- case INTR_HANDLED_DO_NOT_NOTIFY:
- return;
-
- case INTR_NOT_HANDLED:
- default: /* this should not happen */
- break;
- }
- the_node = the_node->next;
- }
-
- /* XXX
- *
- * This is an unhandled interrupt!!!
- */
-}
diff --git a/cpukit/posix/src/key.c b/cpukit/posix/src/key.c
deleted file mode 100644
index 1203343f66..0000000000
--- a/cpukit/posix/src/key.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * $Id$
- */
-
-#include <errno.h>
-#include <limits.h>
-#include <pthread.h>
-#include <string.h>
-
-#include <rtems/system.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/posix/key.h>
-
-/*
- * _POSIX_Key_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Key_Manager_initialization(
- unsigned32 maximum_keys
-)
-{
- _Objects_Initialize_information(
- &_POSIX_Keys_Information,
- OBJECTS_POSIX_KEYS,
- FALSE,
- maximum_keys,
- sizeof( POSIX_Keys_Control ),
- FALSE,
- 0,
- FALSE
- );
-}
-
-/*PAGE
- *
- * 17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163
- */
-
-int pthread_key_create(
- pthread_key_t *key,
- void (*destructor)( void * )
-)
-{
- POSIX_Keys_Control *the_key;
- void *table;
- unsigned32 the_class;
- unsigned32 bytes_to_allocate;
-
-
- _Thread_Disable_dispatch();
-
- the_key = _POSIX_Keys_Allocate();
-
- if ( !the_key ) {
- _Thread_Enable_dispatch();
- return EAGAIN;
- }
-
- the_key->destructor = destructor;
-
- for ( the_class = OBJECTS_CLASSES_FIRST_THREAD_CLASS;
- the_class <= OBJECTS_CLASSES_LAST_THREAD_CLASS;
- the_class++ ) {
-
- bytes_to_allocate =
- (_Objects_Information_table[ the_class ]->maximum + 1) * sizeof( void * );
-
- table = _Workspace_Allocate( bytes_to_allocate );
-
- if ( !table ) {
- for ( --the_class;
- the_class >= OBJECTS_CLASSES_FIRST_THREAD_CLASS;
- the_class-- )
- _Workspace_Free( the_key->Values[ the_class ] );
-
- _POSIX_Keys_Free( the_key );
- _Thread_Enable_dispatch();
- return ENOMEM;
- }
-
- the_key->Values[ the_class ] = table;
- memset( table, '\0', bytes_to_allocate );
- }
-
- the_key->is_active = TRUE;
-
- _Objects_Open( &_POSIX_Keys_Information, &the_key->Object, 0 );
-
- *key = the_key->Object.id;
-
- _Thread_Enable_dispatch();
-
- return 0;
-}
-
-/*PAGE
- *
- * 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165
- */
-
-int pthread_setspecific(
- pthread_key_t key,
- const void *value
-)
-{
- register POSIX_Keys_Control *the_key;
- unsigned32 index;
- unsigned32 class;
- Objects_Locations location;
-
- the_key = _POSIX_Keys_Get( key, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* should never happen */
- return EINVAL;
- case OBJECTS_LOCAL:
- index = _Objects_Get_index( _Thread_Executing->Object.id );
- class = _Objects_Get_class( _Thread_Executing->Object.id );
- the_key->Values[ class ][ index ] = (void *) value;
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165
- */
-
-void *pthread_getspecific(
- pthread_key_t key
-)
-{
- register POSIX_Keys_Control *the_key;
- unsigned32 index;
- unsigned32 class;
- Objects_Locations location;
- void *key_data;
-
- the_key = _POSIX_Keys_Get( key, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* should never happen */
- return NULL;
- case OBJECTS_LOCAL:
- index = _Objects_Get_index( _Thread_Executing->Object.id );
- class = _Objects_Get_class( _Thread_Executing->Object.id );
- key_data = (void *) the_key->Values[ class ][ index ];
- _Thread_Enable_dispatch();
- return key_data;
- }
- return (void *) POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 17.1.3 Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167
- */
-
-int pthread_key_delete(
- pthread_key_t key
-)
-{
- register POSIX_Keys_Control *the_key;
- Objects_Locations location;
- unsigned32 the_class;
-
- the_key = _POSIX_Keys_Get( key, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* should never happen */
- return EINVAL;
- case OBJECTS_LOCAL:
- _Objects_Close( &_POSIX_Keys_Information, &the_key->Object );
-
- the_key->is_active = FALSE;
-
- for ( the_class = OBJECTS_CLASSES_FIRST_THREAD_CLASS;
- the_class <= OBJECTS_CLASSES_LAST_THREAD_CLASS;
- the_class++ )
- _Workspace_Free( the_key->Values[ the_class ] );
-
- /*
- * NOTE: The destructor is not called and it is the responsibility
- * of the application to free the memory.
- */
-
- _POSIX_Keys_Free( the_key );
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * _POSIX_Keys_Run_destructors
- *
- * 17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163
- *
- * NOTE: This is the routine executed when a thread exits to
- * run through all the keys and do the destructor action.
- */
-
-void _POSIX_Keys_Run_destructors(
- Thread_Control *thread
-)
-{
- unsigned32 index;
- unsigned32 pthread_index;
- unsigned32 pthread_class;
- unsigned32 iterations;
- boolean are_all_null;
- POSIX_Keys_Control *the_key;
- void *value;
-
- pthread_index = _Objects_Get_index( thread->Object.id );
- pthread_class = _Objects_Get_class( thread->Object.id );
-
- iterations = 0;
-
- for ( ; ; ) {
-
- are_all_null = TRUE;
-
- for ( index=1 ; index <= _POSIX_Keys_Information.maximum ; index++ ) {
-
- the_key = (POSIX_Keys_Control *)
- _POSIX_Keys_Information.local_table[ index ];
-
- if ( the_key && the_key->is_active && the_key->destructor ) {
- value = the_key->Values[ pthread_class ][ pthread_index ];
- if ( value ) {
- (*the_key->destructor)( value );
- if ( the_key->Values[ pthread_class ][ pthread_index ] )
- are_all_null = FALSE;
- }
- }
- }
-
- if ( are_all_null == TRUE )
- return;
-
- iterations++;
-
- /*
- * The standard allows one to not do this and thus go into an infinite
- * loop. It seems rude to unnecessarily lock up a system.
- *
- * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99.
- */
-
- if ( iterations >= PTHREAD_DESTRUCTOR_ITERATIONS )
- return;
- }
-}
diff --git a/cpukit/posix/src/mqueue.c b/cpukit/posix/src/mqueue.c
deleted file mode 100644
index 82da4ee706..0000000000
--- a/cpukit/posix/src/mqueue.c
+++ /dev/null
@@ -1,710 +0,0 @@
-/*
- * NOTE: The structure of the routines is identical to that of POSIX
- * Message_queues to leave the option of having unnamed message
- * queues at a future date. They are currently not part of the
- * POSIX standard but unnamed message_queues are. This is also
- * the reason for the apparently unnecessary tracking of
- * the process_shared attribute. [In addition to the fact that
- * it would be trivial to add pshared to the mq_attr structure
- * and have process private message queues.]
- *
- * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open
- * time.
- *
- * $Id$
- */
-
-#include <stdarg.h>
-
-#include <pthread.h>
-#include <limits.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <mqueue.h>
-
-#include <rtems/system.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/posix/seterr.h>
-#include <rtems/posix/mqueue.h>
-#include <rtems/posix/time.h>
-
-/*PAGE
- *
- * _POSIX_Message_queue_Manager_initialization
- *
- * This routine initializes all message_queue manager related data structures.
- *
- * Input parameters:
- * maximum_message_queues - maximum configured message_queues
- *
- * Output parameters: NONE
- */
-
-void _POSIX_Message_queue_Manager_initialization(
- unsigned32 maximum_message_queues
-)
-{
- _Objects_Initialize_information(
- &_POSIX_Message_queue_Information,
- OBJECTS_POSIX_MESSAGE_QUEUES,
- TRUE,
- maximum_message_queues,
- sizeof( POSIX_Message_queue_Control ),
- TRUE,
- _POSIX_PATH_MAX,
- FALSE
- );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Create_support
- */
-
-int _POSIX_Message_queue_Create_support(
- const char *name,
- int pshared,
- unsigned int oflag,
- struct mq_attr *attr,
- POSIX_Message_queue_Control **message_queue
-)
-{
- POSIX_Message_queue_Control *the_mq;
-
- _Thread_Disable_dispatch();
-
- the_mq = _POSIX_Message_queue_Allocate();
-
- if ( !the_mq ) {
- _Thread_Enable_dispatch();
- set_errno_and_return_minus_one( ENFILE );
- }
-
- if ( pshared == PTHREAD_PROCESS_SHARED &&
- !( _Objects_MP_Allocate_and_open( &_POSIX_Message_queue_Information, 0,
- the_mq->Object.id, FALSE ) ) ) {
- _POSIX_Message_queue_Free( the_mq );
- _Thread_Enable_dispatch();
- set_errno_and_return_minus_one( ENFILE );
- }
-
- the_mq->process_shared = pshared;
-
- if ( name ) {
- the_mq->named = TRUE;
- the_mq->open_count = 1;
- the_mq->linked = TRUE;
- }
- else
- the_mq->named = FALSE;
-
- if ( oflag & O_NONBLOCK )
- the_mq->blocking = FALSE;
- else
- the_mq->blocking = TRUE;
-
- /* XXX
- *
- * Note that this should be based on the current scheduling policy.
- */
-
- /* XXX
- *
- * Message and waiting disciplines are not distinguished.
- */
-/*
- the_mq_attr->message_discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO;
- the_mq_attr->waiting_discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO;
- */
-
- the_mq->Message_queue.Attributes.discipline =
- CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO;
-
- if ( ! _CORE_message_queue_Initialize(
- &the_mq->Message_queue,
- OBJECTS_POSIX_MESSAGE_QUEUES,
- &the_mq->Message_queue.Attributes,
- attr->mq_maxmsg,
- attr->mq_msgsize,
- _POSIX_Message_queue_MP_Send_extract_proxy ) ) {
-
- if ( pshared == PTHREAD_PROCESS_SHARED )
- _Objects_MP_Close( &_POSIX_Message_queue_Information, the_mq->Object.id );
-
- _POSIX_Message_queue_Free( the_mq );
- _Thread_Enable_dispatch();
- set_errno_and_return_minus_one( ENOSPC );
- }
-
-
- /* XXX - need Names to be a string!!! */
- _Objects_Open(
- &_POSIX_Message_queue_Information,
- &the_mq->Object,
- (char *) name
- );
-
- *message_queue = the_mq;
-
- if ( pshared == PTHREAD_PROCESS_SHARED )
- _POSIX_Message_queue_MP_Send_process_packet(
- POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_CREATE,
- the_mq->Object.id,
- (char *) name,
- 0 /* Not used */
- );
-
- _Thread_Enable_dispatch();
- return 0;
-}
-
-/*PAGE
- *
- * 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
- */
-
-mqd_t mq_open(
- const char *name,
- int oflag,
- ...
- /* mode_t mode, */
- /* struct mq_attr attr */
-)
-{
- va_list arg;
- mode_t mode;
- struct mq_attr *attr;
- int status;
- Objects_Id the_mq_id;
- POSIX_Message_queue_Control *the_mq;
-
- if ( oflag & O_CREAT ) {
- va_start(arg, oflag);
- mode = (mode_t) va_arg( arg, mode_t * );
- attr = (struct mq_attr *) va_arg( arg, struct mq_attr ** );
- va_end(arg);
- }
-
- status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id );
-
- /*
- * If the name to id translation worked, then the message queue exists
- * and we can just return a pointer to the id. Otherwise we may
- * need to check to see if this is a "message queue does not exist"
- * or some other miscellaneous error on the name.
- */
-
- if ( status ) {
-
- if ( status == EINVAL ) { /* name -> ID translation failed */
- if ( !(oflag & O_CREAT) ) { /* willing to create it? */
- seterrno( ENOENT );
- return (mqd_t) -1;
- }
- /* we are willing to create it */
- }
- seterrno( status ); /* some type of error */
- return (mqd_t) -1;
-
- } else { /* name -> ID translation succeeded */
-
- if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
- seterrno( EEXIST );
- return (mqd_t) -1;
- }
-
- /*
- * XXX In this case we need to do an ID->pointer conversion to
- * check the mode. This is probably a good place for a subroutine.
- */
-
- the_mq->open_count += 1;
-
- return (mqd_t)&the_mq->Object.id;
-
- }
-
- /* XXX verify this comment...
- *
- * At this point, the message queue does not exist and everything has been
- * checked. We should go ahead and create a message queue.
- */
-
- status = _POSIX_Message_queue_Create_support(
- name,
- TRUE, /* shared across processes */
- oflag,
- attr,
- &the_mq
- );
-
- if ( status == -1 )
- return (mqd_t) -1;
-
- return (mqd_t) &the_mq->Object.id;
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Delete
- */
-
-void _POSIX_Message_queue_Delete(
- POSIX_Message_queue_Control *the_mq
-)
-{
- if ( !the_mq->linked && !the_mq->open_count ) {
- _POSIX_Message_queue_Free( the_mq );
-
- if ( the_mq->process_shared == PTHREAD_PROCESS_SHARED ) {
-
- _Objects_MP_Close(
- &_POSIX_Message_queue_Information,
- the_mq->Object.id
- );
-
- _POSIX_Message_queue_MP_Send_process_packet(
- POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_DELETE,
- the_mq->Object.id,
- 0, /* Not used */
- 0 /* Not used */
- );
- }
-
- }
-}
-
-/*PAGE
- *
- * 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275
- */
-
-int mq_close(
- mqd_t mqdes
-)
-{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
-
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- the_mq->open_count -= 1;
- _POSIX_Message_queue_Delete( the_mq );
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276
- */
-
-int mq_unlink(
- const char *name
-)
-{
- int status;
- register POSIX_Message_queue_Control *the_mq;
- Objects_Id the_mq_id;
- Objects_Locations location;
-
- status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id );
-
- if ( !status )
- set_errno_and_return_minus_one( status );
-
- the_mq = _POSIX_Message_queue_Get( the_mq_id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
-
- _Objects_MP_Close(
- &_POSIX_Message_queue_Information,
- the_mq->Object.id
- );
-
- the_mq->linked = FALSE;
-
- _POSIX_Message_queue_Delete( the_mq );
-
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Send_support
- */
-
-int _POSIX_Message_queue_Send_support(
- mqd_t mqdes,
- const char *msg_ptr,
- unsigned32 msg_len,
- Priority_Control msg_prio,
- Watchdog_Interval timeout
-)
-{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
-
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- /* XXX must add support for timeout and priority */
- _CORE_message_queue_Send(
- &the_mq->Message_queue,
- (void *) msg_ptr,
- msg_len,
- mqdes,
- NULL /* XXX _POSIX_Message_queue_Core_message_queue_mp_support*/
- );
- _Thread_Enable_dispatch();
- return _Thread_Executing->Wait.return_code;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
- *
- * NOTE: P1003.4b/D8, p. 45 adds mq_timedsend().
- */
-
-int mq_send(
- mqd_t mqdes,
- const char *msg_ptr,
- size_t msg_len,
- unsigned int msg_prio
-)
-{
- return _POSIX_Message_queue_Send_support(
- mqdes,
- msg_ptr,
- msg_len,
- msg_prio,
- THREAD_QUEUE_WAIT_FOREVER
- );
-}
-
-/*PAGE
- *
- * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
- *
- * NOTE: P1003.4b/D8, p. 45 adds mq_timedsend().
- */
-
-int mq_timedsend(
- mqd_t mqdes,
- const char *msg_ptr,
- size_t msg_len,
- unsigned int msg_prio,
- const struct timespec *timeout
-)
-{
- return _POSIX_Message_queue_Send_support(
- mqdes,
- msg_ptr,
- msg_len,
- msg_prio,
- _POSIX_Timespec_to_interval( timeout )
- );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Receive_support
- */
-
-/* XXX be careful ... watch the size going through all the layers ... */
-
-ssize_t _POSIX_Message_queue_Receive_support(
- mqd_t mqdes,
- char *msg_ptr,
- size_t msg_len,
- unsigned int *msg_prio,
- Watchdog_Interval timeout
-)
-{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
- unsigned32 status = 0;
- unsigned32 length_out;
-
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- /* XXX need to define the options argument to this */
- length_out = msg_len;
- _CORE_message_queue_Seize(
- &the_mq->Message_queue,
- mqdes,
- msg_ptr,
- &length_out,
- /* msg_prio, XXXX */
- the_mq->blocking,
- timeout
- );
- _Thread_Enable_dispatch();
- if ( !status )
- return length_out;
- /* XXX --- the return codes gotta be looked at .. fix this */
- return _Thread_Executing->Wait.return_code;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
- *
- * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
- */
-
-ssize_t mq_receive(
- mqd_t mqdes,
- char *msg_ptr,
- size_t msg_len,
- unsigned int *msg_prio
-)
-{
- return _POSIX_Message_queue_Receive_support(
- mqdes,
- msg_ptr,
- msg_len,
- msg_prio,
- THREAD_QUEUE_WAIT_FOREVER
- );
-}
-
-/*PAGE
- *
- * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
- *
- * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
- */
-
-int mq_timedreceive( /* XXX: should this be ssize_t */
- mqd_t mqdes,
- char *msg_ptr,
- size_t msg_len,
- unsigned int *msg_prio,
- const struct timespec *timeout
-)
-{
- return _POSIX_Message_queue_Receive_support(
- mqdes,
- msg_ptr,
- msg_len,
- msg_prio,
- _POSIX_Timespec_to_interval( timeout )
- );
-}
-
-/*PAGE
- *
- * _POSIX_Message_queue_Notify_handler
- *
- */
-
-void _POSIX_Message_queue_Notify_handler(
- void *user_data
-)
-{
- POSIX_Message_queue_Control *the_mq;
-
- the_mq = user_data;
-
- /* XXX do something with signals here!!!! */
-}
-
-/*PAGE
- *
- * 15.2.6 Notify Process that a Message is Available on a Queue,
- * P1003.1b-1993, p. 280
- */
-
-int mq_notify(
- mqd_t mqdes,
- const struct sigevent *notification
-)
-{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
-
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EBADF );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- if ( notification ) {
- if ( _CORE_message_queue_Is_notify_enabled( &the_mq->Message_queue ) ) {
- _Thread_Enable_dispatch();
- seterrno( EBUSY );
- return( -1 );
- }
-
- _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL );
-
- the_mq->notification = *notification;
-
- _CORE_message_queue_Set_notify(
- &the_mq->Message_queue,
- _POSIX_Message_queue_Notify_handler,
- the_mq
- );
- } else {
-
- _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL );
-
- }
-
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281
- */
-
-int mq_setattr(
- mqd_t mqdes,
- const struct mq_attr *mqstat,
- struct mq_attr *omqstat
-)
-{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
- CORE_message_queue_Attributes *the_mq_attr;
-
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- /*
- * Return the old values.
- */
-
- /* XXX this is the same stuff as is in mq_getattr... and probably */
- /* XXX should be in an inlined private routine */
-
- the_mq_attr = &the_mq->Message_queue.Attributes;
-
- omqstat->mq_flags = the_mq->flags;
- omqstat->mq_msgsize = the_mq->Message_queue.maximum_message_size;
- omqstat->mq_maxmsg = the_mq->Message_queue.maximum_pending_messages;
- omqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages;
-
- /*
- * Ignore everything except the O_NONBLOCK bit.
- */
-
- if ( mqstat->mq_flags & O_NONBLOCK )
- the_mq->blocking = FALSE;
- else
- the_mq->blocking = TRUE;
-
- the_mq->flags = mqstat->mq_flags;
-
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
- */
-
-int mq_getattr(
- mqd_t mqdes,
- struct mq_attr *mqstat
-)
-{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
- CORE_message_queue_Attributes *the_mq_attr;
-
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- /*
- * Return the old values.
- */
-
- /* XXX this is the same stuff as is in mq_setattr... and probably */
- /* XXX should be in an inlined private routine */
-
- the_mq_attr = &the_mq->Message_queue.Attributes;
-
- mqstat->mq_flags = the_mq->flags;
- mqstat->mq_msgsize = the_mq->Message_queue.maximum_message_size;
- mqstat->mq_maxmsg = the_mq->Message_queue.maximum_pending_messages;
- mqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages;
-
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
diff --git a/cpukit/posix/src/mutex.c b/cpukit/posix/src/mutex.c
deleted file mode 100644
index fa2ccc9cc5..0000000000
--- a/cpukit/posix/src/mutex.c
+++ /dev/null
@@ -1,688 +0,0 @@
-/*
- * $Id$
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <pthread.h>
-
-#include <rtems/system.h>
-#include <rtems/score/coremutex.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/score/mpci.h>
-#include <rtems/posix/mutex.h>
-#include <rtems/posix/priority.h>
-#include <rtems/posix/time.h>
-
-/*
- * TEMPORARY
- */
-
-void _POSIX_Mutex_MP_Send_process_packet (
- POSIX_Mutex_MP_Remote_operations operation,
- Objects_Id mutex_id,
- Objects_Name name,
- Objects_Id proxy_id
-)
-{
- (void) POSIX_MP_NOT_IMPLEMENTED();
-}
-
-void _POSIX_Mutex_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-)
-{
- (void) POSIX_MP_NOT_IMPLEMENTED();
-}
-
-int _POSIX_Mutex_MP_Send_request_packet (
- POSIX_Mutex_MP_Remote_operations operation,
- Objects_Id mutex_id,
- boolean wait, /* XXX options */
- Watchdog_Interval timeout
-)
-{
- return POSIX_MP_NOT_IMPLEMENTED();
-}
-
-void POSIX_Threads_mutex_MP_support(
- Thread_Control *the_thread,
- Objects_Id id
-)
-{
- (void) POSIX_MP_NOT_IMPLEMENTED(); /* XXX: should never get here */
-}
-
-/*
- * END OF TEMPORARY
- */
-
-/*PAGE
- *
- * The default mutex attributes structure.
- */
-
-const pthread_mutexattr_t _POSIX_Mutex_Default_attributes = {
- TRUE, /* is_initialized */
- PTHREAD_PROCESS_PRIVATE, /* process_shared */
- POSIX_SCHEDULER_MAXIMUM_PRIORITY, /* prio_ceiling */
- PTHREAD_PRIO_NONE, /* protocol */
- FALSE /* recursive */
-};
-
-/*PAGE
- *
- * _POSIX_Mutex_From_core_mutex_status
- */
-
-int _POSIX_Mutex_From_core_mutex_status(
- CORE_mutex_Status status
-)
-{
- switch ( status ) {
- case CORE_MUTEX_STATUS_SUCCESSFUL:
- return 0;
- case CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT:
- return EBUSY;
- case CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED:
- return EDEADLK;
- case CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE:
- return EPERM;
- case CORE_MUTEX_WAS_DELETED:
- return EINVAL;
- case CORE_MUTEX_TIMEOUT:
- return EAGAIN;
- case CORE_MUTEX_STATUS_CEILING_VIOLATED:
- return EINVAL;
- default:
- break;
- }
- assert( 0 );
- return 0;
-}
-
-/*PAGE
- *
- * _POSIX_Mutex_Manager_initialization
- *
- * This routine initializes all mutex manager related data structures.
- *
- * Input parameters:
- * maximum_mutexes - maximum configured mutexes
- *
- * Output parameters: NONE
- */
-
-void _POSIX_Mutex_Manager_initialization(
- unsigned32 maximum_mutexes
-)
-{
- _Objects_Initialize_information(
- &_POSIX_Mutex_Information,
- OBJECTS_POSIX_MUTEXES,
- TRUE,
- maximum_mutexes,
- sizeof( POSIX_Mutex_Control ),
- FALSE,
- 0,
- FALSE
- );
-}
-
-/*PAGE
- *
- * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
- */
-
-int pthread_mutexattr_init(
- pthread_mutexattr_t *attr
-)
-{
- if ( !attr )
- return EINVAL;
-
- *attr = _POSIX_Mutex_Default_attributes;
- return 0;
-}
-
-/*PAGE
- *
- * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
- */
-
-int pthread_mutexattr_destroy(
- pthread_mutexattr_t *attr
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- attr->is_initialized = FALSE;
- return 0;
-}
-
-/*PAGE
- *
- * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
- */
-
-int pthread_mutexattr_getpshared(
- const pthread_mutexattr_t *attr,
- int *pshared
-)
-{
- if ( !attr || !attr->is_initialized || !pshared )
- return EINVAL;
-
- *pshared = attr->process_shared;
- return 0;
-}
-
-/*PAGE
- *
- * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
- */
-
-int pthread_mutexattr_setpshared(
- pthread_mutexattr_t *attr,
- int pshared
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- switch ( pshared ) {
- case PTHREAD_PROCESS_SHARED:
- case PTHREAD_PROCESS_PRIVATE:
- attr->process_shared = pshared;
- return 0;
-
- default:
- return EINVAL;
- }
-}
-
-/*PAGE
- *
- * 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87
- *
- * NOTE: XXX Could be optimized so all the attribute error checking
- * is not performed when attr is NULL.
- */
-
-int pthread_mutex_init(
- pthread_mutex_t *mutex,
- const pthread_mutexattr_t *attr
-)
-{
- POSIX_Mutex_Control *the_mutex;
- CORE_mutex_Attributes *the_mutex_attr;
- const pthread_mutexattr_t *the_attr;
- CORE_mutex_Disciplines the_discipline;
- register POSIX_Mutex_Control *mutex_in_use;
- Objects_Locations location;
-
- if ( attr ) the_attr = attr;
- else the_attr = &_POSIX_Mutex_Default_attributes;
-
- /* Check for NULL mutex */
-
- if ( !mutex )
- return EINVAL;
-
- /* avoid infinite recursion on call to this routine in _POSIX_Mutex_Get */
-
- if ( *mutex != PTHREAD_MUTEX_INITIALIZER ) {
-
- /* EBUSY if *mutex is a valid id */
-
- mutex_in_use = _POSIX_Mutex_Get( mutex, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- break;
- case OBJECTS_REMOTE:
- case OBJECTS_LOCAL:
- _Thread_Enable_dispatch();
- return EBUSY;
- }
- }
-
- if ( !the_attr->is_initialized )
- return EINVAL;
-
- /*
- * XXX: Be careful about attributes when global!!!
- */
-
- assert( the_attr->process_shared == PTHREAD_PROCESS_PRIVATE );
-
- if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
- return POSIX_MP_NOT_IMPLEMENTED();
-
- /*
- * Determine the discipline of the mutex
- */
-
- switch ( the_attr->protocol ) {
- case PTHREAD_PRIO_NONE:
- the_discipline = CORE_MUTEX_DISCIPLINES_FIFO;
- break;
- case PTHREAD_PRIO_INHERIT:
- the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT;
- break;
- case PTHREAD_PRIO_PROTECT:
- the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
- break;
- default:
- return EINVAL;
- }
-
- if ( !_POSIX_Priority_Is_valid( the_attr->prio_ceiling ) )
- return EINVAL;
-
- _Thread_Disable_dispatch();
-
- the_mutex = _POSIX_Mutex_Allocate();
-
- if ( !the_mutex ) {
- _Thread_Enable_dispatch();
- return EAGAIN;
- }
-
- if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED &&
- !( _Objects_MP_Allocate_and_open( &_POSIX_Mutex_Information, 0,
- the_mutex->Object.id, FALSE ) ) ) {
- _POSIX_Mutex_Free( the_mutex );
- _Thread_Enable_dispatch();
- return EAGAIN;
- }
-
- the_mutex->process_shared = the_attr->process_shared;
-
- the_mutex_attr = &the_mutex->Mutex.Attributes;
-
- the_mutex_attr->allow_nesting = the_attr->recursive;
- the_mutex_attr->priority_ceiling =
- _POSIX_Priority_To_core( the_attr->prio_ceiling );
- the_mutex_attr->discipline = the_discipline;
-
- /*
- * Must be initialized to unlocked.
- */
-
- _CORE_mutex_Initialize(
- &the_mutex->Mutex,
- OBJECTS_POSIX_MUTEXES,
- the_mutex_attr,
- CORE_MUTEX_UNLOCKED,
- NULL /* proxy_extract_callout */
- );
-
- _Objects_Open( &_POSIX_Mutex_Information, &the_mutex->Object, 0 );
-
- *mutex = the_mutex->Object.id;
-
- if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
- _POSIX_Mutex_MP_Send_process_packet(
- POSIX_MUTEX_MP_ANNOUNCE_CREATE,
- the_mutex->Object.id,
- 0, /* Name not used */
- 0 /* Not used */
- );
-
- _Thread_Enable_dispatch();
- return 0;
-}
-
-/*PAGE
- *
- * 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87
- */
-
-int pthread_mutex_destroy(
- pthread_mutex_t *mutex
-)
-{
- register POSIX_Mutex_Control *the_mutex;
- Objects_Locations location;
-
- the_mutex = _POSIX_Mutex_Get( mutex, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- return EINVAL;
- case OBJECTS_LOCAL:
- /*
- * XXX: There is an error for the mutex being locked
- * or being in use by a condition variable.
- */
-
- if ( _CORE_mutex_Is_locked( &the_mutex->Mutex ) ) {
- _Thread_Enable_dispatch();
- return EBUSY;
- }
-
- _Objects_Close( &_POSIX_Mutex_Information, &the_mutex->Object );
-
- _CORE_mutex_Flush(
- &the_mutex->Mutex,
- _POSIX_Mutex_MP_Send_object_was_deleted,
- EINVAL
- );
-
- _POSIX_Mutex_Free( the_mutex );
-
- if ( the_mutex->process_shared == PTHREAD_PROCESS_SHARED ) {
-
- _Objects_MP_Close( &_POSIX_Mutex_Information, the_mutex->Object.id );
-
- _POSIX_Mutex_MP_Send_process_packet(
- POSIX_MUTEX_MP_ANNOUNCE_DELETE,
- the_mutex->Object.id,
- 0, /* Not used */
- 0 /* Not used */
- );
- }
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * _POSIX_Mutex_Lock_support
- *
- * A support routine which implements guts of the blocking, non-blocking, and
- * timed wait version of mutex lock.
- */
-
-int _POSIX_Mutex_Lock_support(
- pthread_mutex_t *mutex,
- boolean blocking,
- Watchdog_Interval timeout
-)
-{
- register POSIX_Mutex_Control *the_mutex;
- Objects_Locations location;
-
- the_mutex = _POSIX_Mutex_Get( mutex, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- return _POSIX_Mutex_MP_Send_request_packet(
- POSIX_MUTEX_MP_OBTAIN_REQUEST,
- *mutex,
- 0, /* must define the option set */
- WATCHDOG_NO_TIMEOUT
- );
- case OBJECTS_LOCAL:
- _CORE_mutex_Seize(
- &the_mutex->Mutex,
- the_mutex->Object.id,
- blocking,
- timeout
- );
- _Thread_Enable_dispatch();
- return _POSIX_Mutex_From_core_mutex_status(
- (CORE_mutex_Status) _Thread_Executing->Wait.return_code
- );
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93
- *
- * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29
- */
-
-int pthread_mutex_lock(
- pthread_mutex_t *mutex
-)
-{
- return _POSIX_Mutex_Lock_support( mutex, TRUE, THREAD_QUEUE_WAIT_FOREVER );
-}
-
-/*PAGE
- *
- * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93
- *
- * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29
- */
-
-int pthread_mutex_trylock(
- pthread_mutex_t *mutex
-)
-{
- return _POSIX_Mutex_Lock_support( mutex, FALSE, THREAD_QUEUE_WAIT_FOREVER );
-}
-
-/*PAGE
- *
- * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93
- *
- * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29
- */
-
-int pthread_mutex_unlock(
- pthread_mutex_t *mutex
-)
-{
- register POSIX_Mutex_Control *the_mutex;
- Objects_Locations location;
- CORE_mutex_Status status;
-
- the_mutex = _POSIX_Mutex_Get( mutex, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- return _POSIX_Mutex_MP_Send_request_packet(
- POSIX_MUTEX_MP_RELEASE_REQUEST,
- *mutex,
- 0, /* Not used */
- MPCI_DEFAULT_TIMEOUT
- );
- case OBJECTS_LOCAL:
- status = _CORE_mutex_Surrender(
- &the_mutex->Mutex,
- the_mutex->Object.id,
- POSIX_Threads_mutex_MP_support
- );
- _Thread_Enable_dispatch();
- return _POSIX_Mutex_From_core_mutex_status( status );
- break;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93
- *
- * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29
- */
-
-int pthread_mutex_timedlock(
- pthread_mutex_t *mutex,
- const struct timespec *timeout
-)
-{
- return _POSIX_Mutex_Lock_support(
- mutex,
- TRUE,
- _POSIX_Timespec_to_interval( timeout )
- );
-}
-
-/*PAGE
- *
- * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
- */
-
-int pthread_mutexattr_setprotocol(
- pthread_mutexattr_t *attr,
- int protocol
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- switch ( protocol ) {
- case PTHREAD_PRIO_NONE:
- case PTHREAD_PRIO_INHERIT:
- case PTHREAD_PRIO_PROTECT:
- attr->protocol = protocol;
- return 0;
-
- default:
- return EINVAL;
- }
-}
-
-/*PAGE
- *
- * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
- */
-
-int pthread_mutexattr_getprotocol(
- const pthread_mutexattr_t *attr,
- int *protocol
-)
-{
- if ( !attr || !attr->is_initialized || !protocol )
- return EINVAL;
-
- *protocol = attr->protocol;
- return 0;
-}
-
-/*PAGE
- *
- * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
- */
-
-int pthread_mutexattr_setprioceiling(
- pthread_mutexattr_t *attr,
- int prioceiling
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- if ( !_POSIX_Priority_Is_valid( prioceiling ) )
- return EINVAL;
-
- attr->prio_ceiling = prioceiling;
- return 0;
-}
-
-/*PAGE
- *
- * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
- */
-
-int pthread_mutexattr_getprioceiling(
- const pthread_mutexattr_t *attr,
- int *prioceiling
-)
-{
- if ( !attr || !attr->is_initialized || !prioceiling )
- return EINVAL;
-
- *prioceiling = attr->prio_ceiling;
- return 0;
-}
-
-/*PAGE
- *
- * 13.6.2 Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131
- */
-
-int pthread_mutex_setprioceiling(
- pthread_mutex_t *mutex,
- int prioceiling,
- int *old_ceiling
-)
-{
- register POSIX_Mutex_Control *the_mutex;
- Objects_Locations location;
- Priority_Control the_priority;
- int status;
-
- if ( !old_ceiling )
- return EINVAL;
-
- if ( !_POSIX_Priority_Is_valid( prioceiling ) )
- return EINVAL;
-
- the_priority = _POSIX_Priority_To_core( prioceiling );
-
- /*
- * Must acquire the mutex before we can change it's ceiling
- */
-
- status = pthread_mutex_lock( mutex );
- if ( status )
- return status;
-
- the_mutex = _POSIX_Mutex_Get( mutex, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL; /* impossible to get here */
- case OBJECTS_REMOTE:
- /* XXX It feels questionable to set the ceiling on a remote mutex. */
- return EINVAL;
- case OBJECTS_LOCAL:
- *old_ceiling = _POSIX_Priority_From_core(
- the_mutex->Mutex.Attributes.priority_ceiling
- );
- the_mutex->Mutex.Attributes.priority_ceiling = the_priority;
- _CORE_mutex_Surrender(
- &the_mutex->Mutex,
- the_mutex->Object.id,
- POSIX_Threads_mutex_MP_support
- );
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 13.6.2 Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131
- */
-
-int pthread_mutex_getprioceiling(
- pthread_mutex_t *mutex,
- int *prioceiling
-)
-{
- register POSIX_Mutex_Control *the_mutex;
- Objects_Locations location;
-
- if ( !prioceiling )
- return EINVAL;
-
- the_mutex = _POSIX_Mutex_Get( mutex, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return EINVAL;
- case OBJECTS_REMOTE:
- return POSIX_MP_NOT_IMPLEMENTED(); /* XXX feels questionable */
- case OBJECTS_LOCAL:
- *prioceiling = _POSIX_Priority_From_core(
- the_mutex->Mutex.Attributes.priority_ceiling
- );
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
diff --git a/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c
deleted file mode 100644
index 4037209009..0000000000
--- a/cpukit/posix/src/psignal.c
+++ /dev/null
@@ -1,1343 +0,0 @@
-/*
- * $Id$
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <pthread.h>
-#include <signal.h>
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tqdata.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/posix/seterr.h>
-#include <rtems/posix/threadsup.h>
-#include <rtems/posix/psignal.h>
-#include <rtems/posix/pthread.h>
-#include <rtems/posix/time.h>
-
-/*
- * Currently 32 signals numbered 1-32 are defined
- */
-
-#define SIGNAL_EMPTY_MASK 0x00000000
-#define SIGNAL_ALL_MASK 0xffffffff
-
-#define signo_to_mask( _sig ) (1 << ((_sig) - 1))
-
-#define is_valid_signo( _sig ) \
- ((_sig) >= 1 && (_sig) <= 32 )
-
-/*** PROCESS WIDE STUFF ****/
-
-sigset_t _POSIX_signals_Pending;
-
-void _POSIX_signals_Abormal_termination_handler( int signo )
-{
- exit( 1 );
-}
-
-#define _POSIX_signals_Stop_handler NULL
-#define _POSIX_signals_Continue_handler NULL
-
-#define SIGACTION_TERMINATE \
- { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Abormal_termination_handler} }
-#define SIGACTION_IGNORE \
- { 0, SIGNAL_ALL_MASK, {SIG_IGN} }
-#define SIGACTION_STOP \
- { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Stop_handler} }
-#define SIGACTION_CONTINUE \
- { 0, SIGNAL_ALL_MASK, {_POSIX_signals_Continue_handler} }
-
-#define SIG_ARRAY_MAX (SIGRTMAX + 1)
-struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ] = {
- /* NO SIGNAL 0 */ SIGACTION_IGNORE,
- /* SIGHUP 1 */ SIGACTION_TERMINATE,
- /* SIGINT 2 */ SIGACTION_TERMINATE,
- /* SIGQUIT 3 */ SIGACTION_TERMINATE,
- /* SIGILL 4 */ SIGACTION_TERMINATE,
- /* SIGTRAP 5 */ SIGACTION_TERMINATE,
- /* SIGIOT 6 */ SIGACTION_TERMINATE,
- /* SIGABRT 6 SIGACTION_TERMINATE, -- alias for SIGIOT */
- /* SIGEMT 7 */ SIGACTION_TERMINATE,
- /* SIGFPE 8 */ SIGACTION_TERMINATE,
- /* SIGKILL 9 */ SIGACTION_TERMINATE,
- /* SIGBUS 10 */ SIGACTION_TERMINATE,
- /* SIGSEGV 11 */ SIGACTION_TERMINATE,
- /* SIGSYS 12 */ SIGACTION_TERMINATE,
- /* SIGPIPE 13 */ SIGACTION_TERMINATE,
- /* SIGALRM 14 */ SIGACTION_TERMINATE,
- /* SIGTERM 15 */ SIGACTION_TERMINATE,
- /* SIGUSR1 16 */ SIGACTION_TERMINATE,
- /* SIGUSR2 17 */ SIGACTION_TERMINATE,
- /* SIGRTMIN 18 */ SIGACTION_IGNORE,
- /* SIGRT 19 */ SIGACTION_IGNORE,
- /* SIGRT 20 */ SIGACTION_IGNORE,
- /* SIGRT 21 */ SIGACTION_IGNORE,
- /* SIGRT 22 */ SIGACTION_IGNORE,
- /* SIGRT 23 */ SIGACTION_IGNORE,
- /* SIGRT 24 */ SIGACTION_IGNORE,
- /* SIGRT 25 */ SIGACTION_IGNORE,
- /* SIGRT 26 */ SIGACTION_IGNORE,
- /* SIGRT 27 */ SIGACTION_IGNORE,
- /* SIGRT 28 */ SIGACTION_IGNORE,
- /* SIGRT 29 */ SIGACTION_IGNORE,
- /* SIGRT 30 */ SIGACTION_IGNORE,
- /* SIGRT 31 */ SIGACTION_IGNORE,
- /* SIGRTMAX 32 */ SIGACTION_IGNORE
-};
-
-struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ];
-
-Watchdog_Control _POSIX_signals_Alarm_timer;
-
-Thread_queue_Control _POSIX_signals_Wait_queue;
-
-Chain_Control _POSIX_signals_Inactive_siginfo;
-Chain_Control _POSIX_signals_Siginfo[ SIG_ARRAY_MAX ];
-
-/*PAGE
- *
- * XXX - move these
- */
-
-#define _States_Is_interruptible_signal( _states ) \
- ( ((_states) & \
- (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) == \
- (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL))
-
-/*PAGE
- *
- * _POSIX_signals_Unblock_thread
- */
-
-/* XXX this routine could probably be cleaned up */
-boolean _POSIX_signals_Unblock_thread(
- Thread_Control *the_thread,
- int signo,
- siginfo_t *info
-)
-{
- POSIX_API_Control *api;
- sigset_t mask;
- siginfo_t *the_info = NULL;
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- mask = signo_to_mask( signo );
-
- /*
- * Is the thread is specifically waiting for a signal?
- */
-
- if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
-
- if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
- the_thread->Wait.return_code = EINTR;
-
- the_info = (siginfo_t *) the_thread->Wait.return_argument;
-
- if ( !info ) {
- the_info->si_signo = signo;
- the_info->si_code = SI_USER;
- the_info->si_value.sival_int = 0;
- } else {
- *the_info = *info;
- }
-
- _Thread_queue_Extract_with_proxy( the_thread );
- return TRUE;
- }
-
- /*
- * This should only be reached via pthread_kill().
- */
-
- return FALSE;
- }
-
- if ( ~api->signals_blocked & mask ) {
- the_thread->do_post_task_switch_extension = TRUE;
-
- if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) {
- the_thread->Wait.return_code = EINTR;
- if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
- _Thread_queue_Extract_with_proxy( the_thread );
- else if ( _States_Is_delaying(the_thread->current_state)){
- if ( _Watchdog_Is_active( &the_thread->Timer ) )
- (void) _Watchdog_Remove( &the_thread->Timer );
- _Thread_Unblock( the_thread );
- }
- }
- }
- return FALSE;
-
-}
-
-/*PAGE
- *
- * _POSIX_signals_Set_process_signals
- */
-
-void _POSIX_signals_Set_process_signals(
- sigset_t mask
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
- if ( !_POSIX_signals_Pending )
- _Thread_Do_post_task_switch_extension++;
- _POSIX_signals_Pending |= mask;
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _POSIX_signals_Clear_process_signals
- */
-
-void _POSIX_signals_Clear_process_signals(
- sigset_t mask
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
- _POSIX_signals_Pending &= ~mask;
- if ( !_POSIX_signals_Pending )
- _Thread_Do_post_task_switch_extension--;
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _POSIX_signals_Clear_signals
- */
-
-boolean _POSIX_signals_Clear_signals(
- POSIX_API_Control *api,
- int signo,
- siginfo_t *info,
- boolean is_global,
- boolean check_blocked
-)
-{
- sigset_t mask;
- sigset_t signals_blocked;
- ISR_Level level;
- boolean do_callout;
- POSIX_signals_Siginfo_node *psiginfo;
-
- mask = signo_to_mask( signo );
-
- do_callout = FALSE;
-
- /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK
- * insures that no signals are blocked and all are checked.
- */
-
- if ( check_blocked )
- signals_blocked = ~api->signals_blocked;
- else
- signals_blocked = SIGNAL_ALL_MASK;
-
- /* XXX this is not right for siginfo type signals yet */
- /* XXX since they can't be cleared the same way */
-
- _ISR_Disable( level );
- if ( is_global ) {
- if ( mask & (_POSIX_signals_Pending & signals_blocked) ) {
- if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
- psiginfo = (POSIX_signals_Siginfo_node *)
- _Chain_Get_unprotected( &_POSIX_signals_Siginfo[ signo ] );
- if ( _Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
- _POSIX_signals_Clear_process_signals( mask );
- if ( psiginfo ) {
- *info = psiginfo->Info;
- _Chain_Append_unprotected(
- &_POSIX_signals_Inactive_siginfo,
- &psiginfo->Node
- );
- } else
- do_callout = FALSE;
- } else
- _POSIX_signals_Clear_process_signals( mask );
- do_callout = TRUE;
- }
- } else {
- if ( mask & (api->signals_pending & signals_blocked) ) {
- api->signals_pending &= ~mask;
- do_callout = TRUE;
- }
- }
- _ISR_Enable( level );
- return do_callout;
-}
-
-
-/*PAGE
- *
- * _POSIX_signals_Check_signal
- */
-
-boolean _POSIX_signals_Check_signal(
- POSIX_API_Control *api,
- int signo,
- boolean is_global
-)
-{
- siginfo_t siginfo_struct;
- sigset_t saved_signals_blocked;
-
- if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
- is_global, TRUE ) )
- return FALSE;
-
- /*
- * Since we made a union of these, only one test is necessary but this is
- * safer.
- */
-
- assert( _POSIX_signals_Vectors[ signo ].sa_handler ||
- _POSIX_signals_Vectors[ signo ].sa_sigaction );
-
- /*
- * Just to prevent sending a signal which is currently being ignored.
- */
-
- if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN )
- return FALSE;
-
- /*
- * Block the signals requested in sa_mask
- */
-
- saved_signals_blocked = api->signals_blocked;
- api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
-
- switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) {
- case SA_SIGINFO:
- assert( is_global );
-
- (*_POSIX_signals_Vectors[ signo ].sa_sigaction)(
- signo,
- &siginfo_struct,
- NULL /* context is undefined per 1003.1b-1993, p. 66 */
- );
- break;
- default:
- (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo );
- break;
- }
-
- /*
- * Restore the previous set of blocked signals
- */
-
- api->signals_blocked = saved_signals_blocked;
-
- return TRUE;
-}
-
-void _POSIX_signals_Post_switch_extension(
- Thread_Control *the_thread
-)
-{
- POSIX_API_Control *api;
- int signo;
- ISR_Level level;
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- /*
- * If we invoke any user code, there is the possibility that
- * a new signal has been posted that we should process so we
- * restart the loop if a signal handler was invoked.
- *
- * The first thing done is to check there are any signals to be
- * processed at all. No point in doing this loop otherwise.
- */
-
-restart:
- _ISR_Disable( level );
- if ( !(~api->signals_blocked &
- (api->signals_pending | _POSIX_signals_Pending)) ) {
- _ISR_Enable( level );
- return;
- }
- _ISR_Enable( level );
-
- for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
-
- if ( _POSIX_signals_Check_signal( api, signo, FALSE ) )
- goto restart;
-
- if ( _POSIX_signals_Check_signal( api, signo, TRUE ) )
- goto restart;
-
- }
-
-/* XXX - add __SIGFIRSTNOTRT or something like that to newlib siginfo.h */
-
- for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
-
- if ( _POSIX_signals_Check_signal( api, signo, FALSE ) )
- goto restart;
-
- if ( _POSIX_signals_Check_signal( api, signo, TRUE ) )
- goto restart;
-
- }
-
-}
-
-/*PAGE
- *
- * _POSIX_signals_Alarm_TSR
- */
-
-void _POSIX_signals_Alarm_TSR(
- Objects_Id id,
- void *argument
-)
-{
- int status;
-
- status = kill( getpid(), SIGALRM );
- /* XXX can't print from an ISR, should this be fatal? */
- assert( !status );
-}
-
-/*PAGE
- *
- * _POSIX_signals_Manager_Initialization
- */
-
-void _POSIX_signals_Manager_Initialization(
- int maximum_queued_signals
-)
-{
- unsigned32 signo;
-
- /*
- * Insure we have the same number of vectors and default vector entries
- */
-
- assert(
- sizeof(_POSIX_signals_Vectors) == sizeof(_POSIX_signals_Default_vectors)
- );
-
- memcpy(
- _POSIX_signals_Vectors,
- _POSIX_signals_Default_vectors,
- sizeof( _POSIX_signals_Vectors )
- );
-
- /*
- * Initialize the set of pending signals for the entire process
- */
-
- sigemptyset( &_POSIX_signals_Pending );
-
- /*
- * Initialize the timer used to implement alarm().
- */
-
- _Watchdog_Initialize(
- &_POSIX_signals_Alarm_timer,
- _POSIX_signals_Alarm_TSR,
- 0,
- NULL
- );
-
- /*
- * Initialize the queue we use to block for signals
- */
-
- _Thread_queue_Initialize(
- &_POSIX_signals_Wait_queue,
- OBJECTS_NO_CLASS,
- THREAD_QUEUE_DISCIPLINE_PRIORITY,
- STATES_WAITING_FOR_SIGNAL | STATES_INTERRUPTIBLE_BY_SIGNAL,
- NULL,
- EAGAIN
- );
-
- /* XXX status codes */
-
- /*
- * Allocate the siginfo pools.
- */
-
- for ( signo=1 ; signo<= SIGRTMAX ; signo++ )
- _Chain_Initialize_empty( &_POSIX_signals_Siginfo[ signo ] );
-
- _Chain_Initialize(
- &_POSIX_signals_Inactive_siginfo,
- _Workspace_Allocate_or_fatal_error(
- maximum_queued_signals * sizeof( POSIX_signals_Siginfo_node )
- ),
- maximum_queued_signals,
- sizeof( POSIX_signals_Siginfo_node )
- );
-}
-
-/*
- * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69
- */
-
-int sigemptyset(
- sigset_t *set
-)
-{
- if ( !set )
- set_errno_and_return_minus_one( EINVAL );
-
- *set = 0;
- return 0;
-}
-
-/*
- * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69
- */
-
-int sigfillset(
- sigset_t *set
-)
-{
- if ( !set )
- set_errno_and_return_minus_one( EINVAL );
-
- *set = SIGNAL_ALL_MASK;
- return 0;
-}
-
-/*
- * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69
- */
-
-int sigaddset(
- sigset_t *set,
- int signo
-)
-{
- if ( !set )
- set_errno_and_return_minus_one( EINVAL );
-
- if ( !signo )
- return 0;
-
- if ( !is_valid_signo(signo) )
- set_errno_and_return_minus_one( EINVAL );
-
- *set |= signo_to_mask(signo);
- return 0;
-}
-
-/*
- * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69
- */
-
-int sigdelset(
- sigset_t *set,
- int signo
-)
-{
- if ( !set )
- set_errno_and_return_minus_one( EINVAL );
-
- if ( !signo )
- return 0;
-
- if ( !is_valid_signo(signo) )
- set_errno_and_return_minus_one( EINVAL );
-
- *set &= ~signo_to_mask(signo);
- return 0;
-}
-
-/*
- * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69
- */
-
-int sigismember(
- const sigset_t *set,
- int signo
-)
-{
- if ( !set )
- set_errno_and_return_minus_one( EINVAL );
-
- if ( !signo )
- return 0;
-
- if ( !is_valid_signo(signo) )
- set_errno_and_return_minus_one( EINVAL );
-
- if ( *set & signo_to_mask(signo) )
- return 1;
-
- return 0;
-}
-
-/*
- * 3.3.4 Examine and Change Signal Action, P1003.1b-1993, p. 70
- */
-
-int sigaction(
- int sig,
- const struct sigaction *act,
- struct sigaction *oact
-)
-{
- ISR_Level level;
-
- if ( oact )
- *oact = _POSIX_signals_Vectors[ sig ];
-
- if ( !sig )
- return 0;
-
- if ( !is_valid_signo(sig) )
- set_errno_and_return_minus_one( EINVAL );
-
- /*
- * Some signals cannot be ignored (P1003.1b-1993, pp. 70-72 and references.
- *
- * NOTE: Solaris documentation claims to "silently enforce" this which
- * contradicts the POSIX specification.
- */
-
- if ( sig == SIGKILL )
- set_errno_and_return_minus_one( EINVAL );
-
- /*
- * Evaluate the new action structure and set the global signal vector
- * appropriately.
- */
-
- if ( act ) {
-
- /*
- * Unless the user is installing the default signal actions, then
- * we can just copy the provided sigaction structure into the vectors.
- */
-
- _ISR_Disable( level );
- if ( act->sa_handler == SIG_DFL ) {
- _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
- } else {
- _POSIX_signals_Clear_process_signals( signo_to_mask(sig) );
- _POSIX_signals_Vectors[ sig ] = *act;
- }
- _ISR_Enable( level );
- }
-
- /*
- * No need to evaluate or dispatch because:
- *
- * + If we were ignoring the signal before, none could be pending
- * now (signals not posted when SIG_IGN).
- * + If we are now ignoring a signal that was previously pending,
- * we clear the pending signal indicator.
- */
-
- return 0;
-}
-
-/*
- * 3.3.5 Examine and Change Blocked Signals, P1003.1b-1993, p. 73
- *
- * NOTE: P1003.1c/D10, p. 37 adds pthread_sigmask().
- *
- */
-
-int sigprocmask(
- int how,
- const sigset_t *set,
- sigset_t *oset
-)
-{
- /*
- * P1003.1c/Draft 10, p. 38 maps sigprocmask to pthread_sigmask.
- */
-
- return pthread_sigmask( how, set, oset );
-}
-
-/*
- * 3.3.5 Examine and Change Blocked Signals, P1003.1b-1993, p. 73
- *
- * NOTE: P1003.1c/D10, p. 37 adds pthread_sigmask().
- */
-
-int pthread_sigmask(
- int how,
- const sigset_t *set,
- sigset_t *oset
-)
-{
- POSIX_API_Control *api;
-
- if ( !set && !oset )
- set_errno_and_return_minus_one( EINVAL );
-
- api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- if ( oset )
- *oset = api->signals_blocked;
-
- if ( !set )
- return 0;
-
- switch ( how ) {
- case SIG_BLOCK:
- api->signals_blocked |= *set;
- break;
- case SIG_UNBLOCK:
- api->signals_blocked &= ~*set;
- break;
- case SIG_SETMASK:
- api->signals_blocked = *set;
- break;
- default:
- set_errno_and_return_minus_one( EINVAL );
- }
-
- /* XXX are there critical section problems here? */
-
- /* XXX evaluate the new set */
-
- if ( ~api->signals_blocked &
- (api->signals_pending | _POSIX_signals_Pending) ) {
- _Thread_Executing->do_post_task_switch_extension = TRUE;
- _Thread_Dispatch();
- }
-
- return 0;
-}
-
-/*
- * 3.3.6 Examine Pending Signals, P1003.1b-1993, p. 75
- */
-
-int sigpending(
- sigset_t *set
-)
-{
- POSIX_API_Control *api;
-
- if ( !set )
- set_errno_and_return_minus_one( EINVAL );
-
- api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- *set = api->signals_pending | _POSIX_signals_Pending;
-
- return 0;
-}
-
-/*
- * 3.3.7 Wait for a Signal, P1003.1b-1993, p. 75
- */
-
-int sigsuspend(
- const sigset_t *sigmask
-)
-{
- sigset_t saved_signals_blocked;
- sigset_t all_signals;
- int status;
- POSIX_API_Control *api;
-
- api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
- status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked );
-
- (void) sigfillset( &all_signals );
-
- status = sigtimedwait( &all_signals, NULL, NULL );
-
- (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL );
-
- return status;
-}
-
-/*
- * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76
- *
- * NOTE: P1003.1c/D10, p. 39 adds sigwait().
- */
-
-int sigwaitinfo(
- const sigset_t *set,
- siginfo_t *info
-)
-{
- return sigtimedwait( set, info, NULL );
-}
-
-/*
- * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76
- *
- * NOTE: P1003.1c/D10, p. 39 adds sigwait().
- */
-
-int _POSIX_signals_Get_highest(
- sigset_t set
-)
-{
- int signo;
-
- for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
- if ( set & signo_to_mask( signo ) )
- return signo;
- }
-
-/* XXX - add __SIGFIRSTNOTRT or something like that to newlib siginfo.h */
-
- for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
- if ( set & signo_to_mask( signo ) )
- return signo;
- }
-
- return 0;
-}
-
-int sigtimedwait(
- const sigset_t *set,
- siginfo_t *info,
- const struct timespec *timeout
-)
-{
- Thread_Control *the_thread;
- POSIX_API_Control *api;
- Watchdog_Interval interval;
- siginfo_t signal_information;
- siginfo_t *the_info;
- int signo;
-
- the_info = ( info ) ? info : &signal_information;
-
- the_thread = _Thread_Executing;
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- /*
- * What if they are already pending?
- */
-
- /* API signals pending? */
-
- if ( *set & api->signals_pending ) {
- /* XXX real info later */
- the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending );
- _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info,
- FALSE, FALSE );
- the_info->si_code = SI_USER;
- the_info->si_value.sival_int = 0;
- return the_info->si_signo;
- }
-
- /* Process pending signals? */
-
- if ( *set & _POSIX_signals_Pending) {
- signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending );
- _POSIX_signals_Clear_signals( api, signo, the_info, TRUE, FALSE );
-
- if ( !info ) {
- the_info->si_signo = signo;
- the_info->si_code = SI_USER;
- the_info->si_value.sival_int = 0;
- }
- }
-
- interval = 0;
- if ( timeout ) {
-
- if (timeout->tv_nsec < 0 || timeout->tv_nsec >= TOD_NANOSECONDS_PER_SECOND)
- set_errno_and_return_minus_one( EINVAL );
-
- interval = _POSIX_Timespec_to_interval( timeout );
- }
-
- the_info->si_signo = -1;
-
- _Thread_Disable_dispatch();
- the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
- the_thread->Wait.return_code = EINTR;
- the_thread->Wait.option = *set;
- the_thread->Wait.return_argument = (void *) the_info;
- _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue );
- _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval );
- _Thread_Enable_dispatch();
-
- errno = _Thread_Executing->Wait.return_code;
- return the_info->si_signo;
-}
-
-/*
- * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76
- *
- * NOTE: P1003.1c/D10, p. 39 adds sigwait().
- */
-
-int sigwait(
- const sigset_t *set,
- int *sig
-)
-{
- int status;
-
- status = sigtimedwait( set, NULL, NULL );
-
- if ( status != -1 ) {
- if ( sig )
- *sig = status;
- return 0;
- }
-
- return errno;
-}
-
-/*PAGE
- *
- * 3.3.2 Send a Signal to a Process, P1003.1b-1993, p. 68
- *
- * NOTE: Behavior of kill() depends on _POSIX_SAVED_IDS.
- */
-
-#define _POSIX_signals_Is_interested( _api, _mask ) \
- ( ~(_api)->signals_blocked & (_mask) )
-
-int killinfo(
- pid_t pid,
- int sig,
- const union sigval *value
-)
-{
- sigset_t mask;
- POSIX_API_Control *api;
- unsigned32 the_class;
- unsigned32 index;
- unsigned32 maximum;
- Objects_Information *the_info;
- Objects_Control **object_table;
- Thread_Control *the_thread;
- Thread_Control *interested_thread;
- Priority_Control interested_priority;
- Chain_Control *the_chain;
- Chain_Node *the_node;
- siginfo_t siginfo_struct;
- siginfo_t *siginfo;
- POSIX_signals_Siginfo_node *psiginfo;
-
- /*
- * Only supported for the "calling process" (i.e. this node).
- */
-
- if( pid != getpid() )
- set_errno_and_return_minus_one( ESRCH );
-
- /*
- * Validate the signal passed if not 0.
- */
-
- if ( sig && !is_valid_signo(sig) )
- set_errno_and_return_minus_one( EINVAL );
-
- /*
- * If the signal is being ignored, then we are out of here.
- */
-
- if ( !sig || _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
- return 0;
-
- /*
- * P1003.1c/Draft 10, p. 33 says that certain signals should always
- * be directed to the executing thread such as those caused by hardware
- * faults.
- */
-
- switch ( sig ) {
- case SIGFPE:
- case SIGILL:
- case SIGSEGV:
- return pthread_kill( pthread_self(), sig );
- default:
- break;
- }
-
- mask = signo_to_mask( sig );
-
- /*
- * Build up a siginfo structure
- */
-
- siginfo = &siginfo_struct;
- siginfo->si_signo = sig;
- siginfo->si_code = SI_USER;
- if ( !value ) {
- siginfo->si_value.sival_int = 0;
- } else {
- siginfo->si_value = *value;
- }
-
- _Thread_Disable_dispatch();
-
- /*
- * Is the currently executing thread interested? If so then it will
- * get it an execute it as soon as the dispatcher executes.
- */
-
- the_thread = _Thread_Executing;
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
- if ( _POSIX_signals_Is_interested( api, mask ) ) {
- goto process_it;
- }
-
- /*
- * Is an interested thread waiting for this signal (sigwait())?
- */
-
- /* XXX violation of visibility -- need to define thread queue support */
-
- for( index=0 ;
- index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
- index++ ) {
-
- the_chain = &_POSIX_signals_Wait_queue.Queues.Priority[ index ];
-
- for ( the_node = the_chain->first ;
- !_Chain_Is_tail( the_chain, the_node ) ;
- the_node = the_node->next ) {
-
- the_thread = (Thread_Control *)the_node;
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- if ((the_thread->Wait.option & mask) || (~api->signals_blocked & mask)) {
- goto process_it;
- }
-
- }
- }
-
- /*
- * Is any other thread interested? The highest priority interested
- * thread is selected. In the event of a tie, then the following
- * additional criteria is used:
- *
- * + ready thread over blocked
- * + blocked on call interruptible by signal (can return EINTR)
- * + blocked on call not interruptible by signal
- *
- * This looks at every thread in the system regardless of the creating API.
- *
- * NOTES:
- *
- * + rtems internal threads do not receive signals.
- */
-
- interested_thread = NULL;
- interested_priority = PRIORITY_MAXIMUM + 1;
-
- for ( the_class = OBJECTS_CLASSES_FIRST_THREAD_CLASS;
- the_class <= OBJECTS_CLASSES_LAST_THREAD_CLASS;
- the_class++ ) {
-
- if ( the_class == OBJECTS_INTERNAL_THREADS )
- continue;
-
- the_info = _Objects_Information_table[ the_class ];
-
- if ( !the_info ) /* manager not installed */
- continue;
-
- maximum = the_info->maximum;
- object_table = the_info->local_table;
-
- assert( object_table ); /* always at least 1 entry */
-
- for ( index = 1 ; index <= maximum ; index++ ) {
- the_thread = (Thread_Control *) object_table[ index ];
-
- if ( !the_thread )
- continue;
-
- /*
- * If this thread is of lower priority than the interested thread,
- * go on to the next thread.
- */
-
- if ( the_thread->current_priority > interested_priority )
- continue;
-
- /*
- * If this thread is not interested, then go on to the next thread.
- */
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- if ( !api || !_POSIX_signals_Is_interested( api, mask ) )
- continue;
-
- /*
- * Now we know the thread under connsideration is interested.
- * If the thread under consideration is of higher priority, then
- * it becomes the interested thread.
- */
-
- if ( the_thread->current_priority < interested_priority ) {
- interested_thread = the_thread;
- interested_priority = the_thread->current_priority;
- continue;
- }
-
- /*
- * Now the thread and the interested thread have the same priority.
- * If the interested thread is ready, then we don't need to send it
- * to a blocked thread.
- */
-
- if ( _States_Is_ready( interested_thread->current_state ) )
- continue;
-
- /*
- * Now the interested thread is blocked.
- * If the thread we are considering is not, the it becomes the
- * interested thread.
- */
-
- if ( _States_Is_ready( the_thread->current_state ) ) {
- interested_thread = the_thread;
- interested_priority = the_thread->current_priority;
- continue;
- }
-
- /*
- * Now we know both threads are blocked.
- * If the interested thread is interruptible, then just use it.
- */
-
- /* XXX need a new states macro */
- if ( interested_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL )
- continue;
-
- /*
- * Now both threads are blocked and the interested thread is not
- * interruptible.
- * If the thread under consideration is interruptible by a signal,
- * then it becomes the interested thread.
- */
-
- /* XXX need a new states macro */
- if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) {
- interested_thread = the_thread;
- interested_priority = the_thread->current_priority;
- }
- }
- }
-
- if ( interested_thread ) {
- the_thread = interested_thread;
- goto process_it;
- }
-
- /*
- * OK so no threads were interested right now. It will be left on the
- * global pending until a thread receives it. The global set of threads
- * can change interest in this signal in one of the following ways:
- *
- * + a thread is created with the signal unblocked,
- * + pthread_sigmask() unblocks the signal,
- * + sigprocmask() unblocks the signal, OR
- * + sigaction() which changes the handler to SIG_IGN.
- */
-
- the_thread = NULL;
- goto post_process_signal;
-
- /*
- * We found a thread which was interested, so now we mark that this
- * thread needs to do the post context switch extension so it can
- * evaluate the signals pending.
- */
-
-process_it:
-
- the_thread->do_post_task_switch_extension = TRUE;
-
- /*
- * Returns TRUE if the signal was synchronously given to a thread
- * blocked waiting for the signal.
- */
-
- if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
- _Thread_Enable_dispatch();
- return 0;
- }
-
-post_process_signal:
-
- /*
- * We may have woken up a thread but we definitely need to post the
- * signal to the process wide information set.
- */
-
- _POSIX_signals_Set_process_signals( mask );
-
- if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
-
- psiginfo = (POSIX_signals_Siginfo_node *)
- _Chain_Get( &_POSIX_signals_Inactive_siginfo );
- if ( !psiginfo )
- set_errno_and_return_minus_one( EAGAIN );
-
- psiginfo->Info = *siginfo;
-
- _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
- }
-
- _Thread_Enable_dispatch();
- return 0;
-}
-
-/*PAGE
- *
- * 3.3.2 Send a Signal to a Process, P1003.1b-1993, p. 68
- *
- * NOTE: Behavior of kill() depends on _POSIX_SAVED_IDS.
- */
-
-int kill(
- pid_t pid,
- int sig
-)
-{
- return killinfo( pid, sig, NULL );
-}
-
-/*
- * 3.3.9 Queue a Signal to a Process, P1003.1b-1993, p. 78
- */
-
-int sigqueue(
- pid_t pid,
- int signo,
- const union sigval value
-)
-{
- return killinfo( pid, signo, &value );
-}
-
-/*
- * 3.3.10 Send a Signal to a Thread, P1003.1c/D10, p. 43
- */
-
-int pthread_kill(
- pthread_t thread,
- int sig
-)
-{
- POSIX_API_Control *api;
- Thread_Control *the_thread;
- Objects_Locations location;
-
- if ( sig && !is_valid_signo(sig) )
- set_errno_and_return_minus_one( EINVAL );
-
- if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO )
- set_errno_and_return_minus_one( ENOSYS );
-
- /*
- * RTEMS does not support sending a siginfo signal to a specific thread.
- */
-
- the_thread = _POSIX_Threads_Get( thread, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- set_errno_and_return_minus_one( ESRCH );
- case OBJECTS_LOCAL:
- /*
- * If sig == 0 then just validate arguments
- */
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- if ( sig ) {
-
- if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
- _Thread_Enable_dispatch();
- return 0;
- }
-
- /* XXX critical section */
-
- api->signals_pending |= signo_to_mask( sig );
-
- (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
-
- the_thread->do_post_task_switch_extension = TRUE;
-
- if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
- _ISR_Signals_to_thread_executing = TRUE;
- }
- _Thread_Enable_dispatch();
- return 0;
- }
-
- return POSIX_BOTTOM_REACHED();
-}
-
-/*
- * 3.4.1 Schedule Alarm, P1003.1b-1993, p. 79
- */
-
-Watchdog_Control _POSIX_signals_Alarm_timer;
-
-unsigned int alarm(
- unsigned int seconds
-)
-{
- unsigned int remaining = 0;
- Watchdog_Control *the_timer;
-
- the_timer = &_POSIX_signals_Alarm_timer;
-
- switch ( _Watchdog_Remove( the_timer ) ) {
- case WATCHDOG_INACTIVE:
- case WATCHDOG_BEING_INSERTED:
- break;
-
- case WATCHDOG_ACTIVE:
- case WATCHDOG_REMOVE_IT:
- remaining = the_timer->initial -
- (the_timer->stop_time - the_timer->start_time);
- break;
- }
-
- _Watchdog_Insert_seconds( the_timer, seconds );
-
- return remaining;
-}
-
-/*
- * 3.4.2 Suspend Process Execution, P1003.1b-1993, p. 81
- */
-
-int pause( void )
-{
- sigset_t all_signals;
- int status;
-
- (void) sigfillset( &all_signals );
-
- status = sigtimedwait( &all_signals, NULL, NULL );
-
- return status;
-}
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
deleted file mode 100644
index f8c6116dd0..0000000000
--- a/cpukit/posix/src/pthread.c
+++ /dev/null
@@ -1,1313 +0,0 @@
-/*
- * $Id$
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <pthread.h>
-#include <limits.h>
-
-#include <rtems/system.h>
-#include <rtems/score/apiext.h>
-#include <rtems/score/stack.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/userext.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/posix/pthread.h>
-#include <rtems/posix/priority.h>
-#include <rtems/posix/psignal.h>
-#include <rtems/posix/config.h>
-#include <rtems/posix/key.h>
-#include <rtems/posix/time.h>
-
-/*PAGE
- *
- * The default pthreads attributes structure.
- *
- * NOTE: Be careful .. if the default attribute set changes,
- * _POSIX_Threads_Initialize_user_threads will need to be examined.
- *
- */
-
-const pthread_attr_t _POSIX_Threads_Default_attributes = {
- TRUE, /* is_initialized */
- NULL, /* stackaddr */
- PTHREAD_MINIMUM_STACK_SIZE, /* stacksize */
- PTHREAD_SCOPE_PROCESS, /* contentionscope */
- PTHREAD_INHERIT_SCHED, /* inheritsched */
- SCHED_FIFO, /* schedpolicy */
- { /* schedparam */
- 2, /* sched_priority */
- 0, /* ss_low_priority */
- { 0L, 0 }, /* ss_replenish_period */
- { 0L, 0 } /* ss_initial_budget */
- },
- PTHREAD_CREATE_JOINABLE, /* detachstate */
- 1 /* cputime_clock_allowed */
-};
-
-/*PAGE
- *
- * _POSIX_Threads_Sporadic_budget_TSR
- */
-
-void _POSIX_Threads_Sporadic_budget_TSR(
- Objects_Id id,
- void *argument
-)
-{
- unsigned32 ticks;
- unsigned32 new_priority;
- Thread_Control *the_thread;
- POSIX_API_Control *api;
-
- the_thread = argument;
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- ticks = _POSIX_Timespec_to_interval( &api->schedparam.ss_initial_budget );
-
- if ( !ticks )
- ticks = 1;
-
- the_thread->cpu_time_budget = ticks;
-
- new_priority = _POSIX_Priority_To_core( api->ss_high_priority );
- the_thread->real_priority = new_priority;
-
- if ( the_thread->resource_count == 0 ||
- the_thread->current_priority > new_priority )
- _Thread_Change_priority( the_thread, new_priority, TRUE );
-
- ticks = _POSIX_Timespec_to_interval( &api->schedparam.ss_replenish_period );
-
- if ( !ticks )
- ticks = 1;
-
- _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Sporadic_budget_callout
- */
-
-void _POSIX_Threads_Sporadic_budget_callout(
- Thread_Control *the_thread
-)
-{
- POSIX_API_Control *api;
- unsigned32 new_priority;
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- /*
- * This will prevent the thread from consuming its entire "budget"
- * while at low priority.
- */
-
-
- the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */
-
- new_priority = _POSIX_Priority_To_core( api->schedparam.ss_low_priority );
- the_thread->real_priority = new_priority;
-
- if ( the_thread->resource_count == 0 ||
- the_thread->current_priority > new_priority )
- _Thread_Change_priority( the_thread, new_priority, TRUE );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Create_extension
- *
- * XXX
- */
-
-boolean _POSIX_Threads_Create_extension(
- Thread_Control *executing,
- Thread_Control *created
-)
-{
- POSIX_API_Control *api;
- POSIX_API_Control *executing_api;
-
- api = _Workspace_Allocate( sizeof( POSIX_API_Control ) );
-
- if ( !api )
- return FALSE;
-
- created->API_Extensions[ THREAD_API_POSIX ] = api;
-
- /* XXX check all fields are touched */
- api->Attributes = _POSIX_Threads_Default_attributes;
- api->detachstate = _POSIX_Threads_Default_attributes.detachstate;
- api->schedpolicy = _POSIX_Threads_Default_attributes.schedpolicy;
- api->schedparam = _POSIX_Threads_Default_attributes.schedparam;
- api->schedparam.sched_priority =
- _POSIX_Priority_From_core( created->current_priority );
-
- /*
- * If the thread is not a posix thread, then all posix signals are blocked
- * by default.
- */
-
- /* XXX use signal constants */
- api->signals_pending = 0;
- if ( _Objects_Get_class( created->Object.id ) == OBJECTS_POSIX_THREADS ) {
- executing_api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
- api->signals_blocked = api->signals_blocked;
- } else
- api->signals_blocked = 0xffffffff;
-
-/* XXX set signal parameters -- block all signals for non-posix threads */
-
- _Thread_queue_Initialize(
- &api->Join_List,
- OBJECTS_NO_CLASS, /* only used for proxy operations */
- THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_JOIN_AT_EXIT,
- NULL, /* no extract proxy handler */
- 0
- );
-
- _Watchdog_Initialize(
- &api->Sporadic_timer,
- _POSIX_Threads_Sporadic_budget_TSR,
- created->Object.id,
- created
- );
-
- return TRUE;
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Delete_extension
- */
-
-User_extensions_routine _POSIX_Threads_Delete_extension(
- Thread_Control *executing,
- Thread_Control *deleted
-)
-{
- Thread_Control *the_thread;
- POSIX_API_Control *api;
- void **value_ptr;
-
- api = deleted->API_Extensions[ THREAD_API_POSIX ];
-
- /* XXX run cancellation handlers */
-
- _POSIX_Keys_Run_destructors( deleted );
-
- /*
- * Wakeup all the tasks which joined with this one
- */
-
- value_ptr = (void **) deleted->Wait.return_argument;
-
- while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
- *(void **)the_thread->Wait.return_argument = value_ptr;
-
- if ( api->schedpolicy == SCHED_SPORADIC )
- (void) _Watchdog_Remove( &api->Sporadic_timer );
-
- deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
-
- (void) _Workspace_Free( api );
-}
-
-/*PAGE
- *
- * _POSIX_Threads_Initialize_user_threads
- *
- * This routine creates and starts all configured user
- * initialzation threads.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _POSIX_Threads_Initialize_user_threads( void )
-{
- int status;
- unsigned32 index;
- unsigned32 maximum;
- posix_initialization_threads_table *user_threads;
- pthread_t thread_id;
- pthread_attr_t attr;
-
- user_threads = _POSIX_Threads_User_initialization_threads;
- maximum = _POSIX_Threads_Number_of_initialization_threads;
-
- if ( !user_threads || maximum == 0 )
- return;
-
- /*
- * Be careful .. if the default attribute set changes, this may need to.
- *
- * Setting the attributes explicitly is critical, since we don't want
- * to inherit the idle tasks attributes.
- */
-
- for ( index=0 ; index < maximum ; index++ ) {
- status = pthread_attr_init( &attr );
- assert( !status );
-
- status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
- assert( !status );
-
- status = pthread_attr_setstacksize( &attr, PTHREAD_MINIMUM_STACK_SIZE * 2 );
- assert( !status );
-
- status = pthread_create(
- &thread_id,
- &attr,
- user_threads[ index ].thread_entry,
- NULL
- );
- assert( !status );
- }
-}
-
-/*PAGE
- *
- * API Extension control structures
- */
-
-API_extensions_Control _POSIX_Threads_API_extensions = {
- { NULL, NULL },
- NULL, /* predriver */
- _POSIX_Threads_Initialize_user_threads, /* postdriver */
- _POSIX_signals_Post_switch_extension, /* post switch */
-};
-
-User_extensions_Control _POSIX_Threads_User_extensions = {
- { NULL, NULL },
- { _POSIX_Threads_Create_extension, /* create */
- NULL, /* start */
- NULL, /* restart */
- _POSIX_Threads_Delete_extension, /* delete */
- NULL, /* switch */
- NULL, /* begin */
- NULL, /* exitted */
- NULL /* fatal */
- }
-};
-
-/*PAGE
- *
- * _POSIX_Threads_Manager_initialization
- *
- * This routine initializes all threads manager related data structures.
- *
- * Input parameters:
- * maximum_pthreads - maximum configured pthreads
- *
- * Output parameters: NONE
- */
-
-void _POSIX_Threads_Manager_initialization(
- unsigned32 maximum_pthreads,
- unsigned32 number_of_initialization_threads,
- posix_initialization_threads_table *user_threads
-
-)
-{
- _POSIX_Threads_Number_of_initialization_threads =
- number_of_initialization_threads;
- _POSIX_Threads_User_initialization_threads = user_threads;
-
- /*
- * There may not be any POSIX initialization threads configured.
- */
-
-#if 0
- if ( user_threads == NULL || number_of_initialization_threads == 0 )
- _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, TRUE, EINVAL );
-#endif
-
- _Objects_Initialize_information(
- &_POSIX_Threads_Information,
- OBJECTS_POSIX_THREADS,
- FALSE, /* does not support global */
- maximum_pthreads,
- sizeof( Thread_Control ),
- TRUE,
- 5, /* length is arbitrary for now */
- TRUE /* this class is threads */
- );
-
- /*
- * Add all the extensions for this API
- */
-
- _User_extensions_Add_API_set( &_POSIX_Threads_User_extensions );
-
- _API_extensions_Add( &_POSIX_Threads_API_extensions );
-
- /*
- * If we supported MP, then here we would ...
- * Register the MP Process Packet routine.
- */
-
-}
-
-/*PAGE
- *
- * 3.1.3 Register Fork Handlers, P1003.1c/Draft 10, P1003.1c/Draft 10, p. 27
- *
- * RTEMS does not support processes, so we fall under this and do not
- * provide this routine:
- *
- * "Either the implementation shall support the pthread_atfork() function
- * as described above or the pthread_atfork() funciton shall not be
- * provided."
- */
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_setscope(
- pthread_attr_t *attr,
- int contentionscope
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- switch ( contentionscope ) {
- case PTHREAD_SCOPE_PROCESS:
- attr->contentionscope = contentionscope;
- return 0;
-
- case PTHREAD_SCOPE_SYSTEM:
- return ENOTSUP;
-
- default:
- return EINVAL;
- }
-}
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_getscope(
- const pthread_attr_t *attr,
- int *contentionscope
-)
-{
- if ( !attr || !attr->is_initialized || !contentionscope )
- return EINVAL;
-
- *contentionscope = attr->contentionscope;
- return 0;
-}
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_setinheritsched(
- pthread_attr_t *attr,
- int inheritsched
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- switch ( inheritsched ) {
- case PTHREAD_INHERIT_SCHED:
- case PTHREAD_EXPLICIT_SCHED:
- attr->inheritsched = inheritsched;
- return 0;
-
- default:
- return ENOTSUP;
- }
-}
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_getinheritsched(
- const pthread_attr_t *attr,
- int *inheritsched
-)
-{
- if ( !attr || !attr->is_initialized || !inheritsched )
- return EINVAL;
-
- *inheritsched = attr->inheritsched;
- return 0;
-}
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_setschedpolicy(
- pthread_attr_t *attr,
- int policy
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- switch ( policy ) {
- case SCHED_OTHER:
- case SCHED_FIFO:
- case SCHED_RR:
- case SCHED_SPORADIC:
- attr->schedpolicy = policy;
- return 0;
-
- default:
- return ENOTSUP;
- }
-}
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Parameters, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_getschedpolicy(
- const pthread_attr_t *attr,
- int *policy
-)
-{
- if ( !attr || !attr->is_initialized || !policy )
- return EINVAL;
-
- *policy = attr->schedpolicy;
- return 0;
-}
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Parameters, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_setschedparam(
- pthread_attr_t *attr,
- const struct sched_param *param
-)
-{
- if ( !attr || !attr->is_initialized || !param )
- return EINVAL;
-
- attr->schedparam = *param;
- return 0;
-}
-
-/*PAGE
- *
- * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
- */
-
-int pthread_attr_getschedparam(
- const pthread_attr_t *attr,
- struct sched_param *param
-)
-{
- if ( !attr || !attr->is_initialized || !param )
- return EINVAL;
-
- *param = attr->schedparam;
- return 0;
-}
-
-/*PAGE
- *
- * 13.5.2 Dynamic Thread Scheduling Parameters Access,
- * P1003.1c/Draft 10, p. 124
- */
-
-int pthread_getschedparam(
- pthread_t thread,
- int *policy,
- struct sched_param *param
-)
-{
- Objects_Locations location;
- POSIX_API_Control *api;
- register Thread_Control *the_thread;
-
- if ( !policy || !param )
- return EINVAL;
-
- the_thread = _POSIX_Threads_Get( thread, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- return ESRCH;
- case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
- *policy = api->schedpolicy;
- *param = api->schedparam;
- param->sched_priority =
- _POSIX_Priority_From_core( the_thread->current_priority );
- _Thread_Enable_dispatch();
- return 0;
- }
-
- return POSIX_BOTTOM_REACHED();
-
-}
-
-/*PAGE
- *
- * 13.5.2 Dynamic Thread Scheduling Parameters Access,
- * P1003.1c/Draft 10, p. 124
- */
-
-int pthread_setschedparam(
- pthread_t thread,
- int policy,
- struct sched_param *param
-)
-{
- register Thread_Control *the_thread;
- POSIX_API_Control *api;
- Thread_CPU_budget_algorithms budget_algorithm;
- Thread_CPU_budget_algorithm_callout budget_callout;
- Objects_Locations location;
-
- /*
- * Check all the parameters
- */
-
- if ( !param )
- return EINVAL;
-
- if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
- return EINVAL;
-
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
- budget_callout = NULL;
-
- switch ( policy ) {
- case SCHED_OTHER:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
- break;
-
- case SCHED_FIFO:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
- break;
-
- case SCHED_RR:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
- break;
-
- case SCHED_SPORADIC:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
- budget_callout = _POSIX_Threads_Sporadic_budget_callout;
-
- if ( _POSIX_Timespec_to_interval( &param->ss_replenish_period ) <
- _POSIX_Timespec_to_interval( &param->ss_initial_budget ) )
- return EINVAL;
-
- if ( !_POSIX_Priority_Is_valid( param->ss_low_priority ) )
- return EINVAL;
-
- break;
-
- default:
- return EINVAL;
- }
-
- /*
- * Actually change the scheduling policy and parameters
- */
-
- the_thread = _POSIX_Threads_Get( thread, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- return ESRCH;
- case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- if ( api->schedpolicy == SCHED_SPORADIC )
- (void) _Watchdog_Remove( &api->Sporadic_timer );
-
- api->schedpolicy = policy;
- api->schedparam = *param;
- the_thread->budget_algorithm = budget_algorithm;
- the_thread->budget_callout = budget_callout;
-
- switch ( api->schedpolicy ) {
- case SCHED_OTHER:
- case SCHED_FIFO:
- case SCHED_RR:
- the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
-
- the_thread->real_priority =
- _POSIX_Priority_To_core( api->schedparam.sched_priority );
-
- _Thread_Change_priority(
- the_thread,
- the_thread->real_priority,
- TRUE
- );
- break;
-
- case SCHED_SPORADIC:
- api->ss_high_priority = api->schedparam.sched_priority;
- _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread );
- break;
- }
-
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_init(
- pthread_attr_t *attr
-)
-{
- if ( !attr )
- return EINVAL;
-
- *attr = _POSIX_Threads_Default_attributes;
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_destroy(
- pthread_attr_t *attr
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- attr->is_initialized = FALSE;
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_getstacksize(
- const pthread_attr_t *attr,
- size_t *stacksize
-)
-{
- if ( !attr || !attr->is_initialized || !stacksize )
- return EINVAL;
-
- *stacksize = attr->stacksize;
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_setstacksize(
- pthread_attr_t *attr,
- size_t stacksize
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- if (stacksize < PTHREAD_MINIMUM_STACK_SIZE)
- attr->stacksize = PTHREAD_MINIMUM_STACK_SIZE;
- else
- attr->stacksize = stacksize;
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_getstackaddr(
- const pthread_attr_t *attr,
- void **stackaddr
-)
-{
- if ( !attr || !attr->is_initialized || !stackaddr )
- return EINVAL;
-
- *stackaddr = attr->stackaddr;
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_setstackaddr(
- pthread_attr_t *attr,
- void *stackaddr
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- attr->stackaddr = stackaddr;
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_getdetachstate(
- const pthread_attr_t *attr,
- int *detachstate
-)
-{
- if ( !attr || !attr->is_initialized || !detachstate )
- return EINVAL;
-
- *detachstate = attr->detachstate;
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140
- */
-
-int pthread_attr_setdetachstate(
- pthread_attr_t *attr,
- int detachstate
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- switch ( detachstate ) {
- case PTHREAD_CREATE_DETACHED:
- case PTHREAD_CREATE_JOINABLE:
- attr->detachstate = detachstate;
- return 0;
-
- default:
- return EINVAL;
- }
-}
-
-/*PAGE
- *
- * 16.1.2 Thread Creation, P1003.1c/Draft 10, p. 144
- */
-
-int pthread_create(
- pthread_t *thread,
- const pthread_attr_t *attr,
- void *(*start_routine)( void * ),
- void *arg
-)
-{
- const pthread_attr_t *the_attr;
- Priority_Control core_priority;
- Thread_CPU_budget_algorithms budget_algorithm;
- Thread_CPU_budget_algorithm_callout budget_callout;
- boolean is_fp;
- boolean status;
- Thread_Control *the_thread;
- char *default_name = "psx";
- POSIX_API_Control *api;
- int schedpolicy = SCHED_RR;
- struct sched_param schedparam;
-
- the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
-
- if ( !the_attr->is_initialized )
- return EINVAL;
-
- /*
- * Core Thread Initialize insures we get the minimum amount of
- * stack space if it is allowed to allocate it itself.
- */
-
- if ( the_attr->stackaddr && !_Stack_Is_enough( the_attr->stacksize ) )
- return EINVAL;
-
-#if 0
- int cputime_clock_allowed; /* see time.h */
- POSIX_NOT_IMPLEMENTED();
-#endif
-
- /*
- * P1003.1c/Draft 10, p. 121.
- *
- * If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread
- * inherits scheduling attributes from the creating thread. If it is
- * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the
- * attributes structure.
- */
-
- switch ( the_attr->inheritsched ) {
- case PTHREAD_INHERIT_SCHED:
- api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
- schedpolicy = api->schedpolicy;
- schedparam = api->schedparam;
- break;
-
- case PTHREAD_EXPLICIT_SCHED:
- schedpolicy = the_attr->schedpolicy;
- schedparam = the_attr->schedparam;
- break;
-
- default:
- return EINVAL;
- }
-
- /*
- * Check the contentionscope since rtems only supports PROCESS wide
- * contention (i.e. no system wide contention).
- */
-
- if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
- return ENOTSUP;
-
- /*
- * Interpret the scheduling parameters.
- */
-
- if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
- return EINVAL;
-
- core_priority = _POSIX_Priority_To_core( schedparam.sched_priority );
-
- /*
- * Set the core scheduling policy information.
- */
-
- budget_callout = NULL;
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
-
- switch ( schedpolicy ) {
- case SCHED_OTHER:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
- break;
-
- case SCHED_FIFO:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
- break;
-
- case SCHED_RR:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
- break;
-
- case SCHED_SPORADIC:
- budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
- budget_callout = _POSIX_Threads_Sporadic_budget_callout;
-
- if ( _POSIX_Timespec_to_interval( &schedparam.ss_replenish_period ) <
- _POSIX_Timespec_to_interval( &schedparam.ss_initial_budget ) )
- return EINVAL;
-
- if ( !_POSIX_Priority_Is_valid( schedparam.ss_low_priority ) )
- return EINVAL;
-
- break;
-
- default:
- return EINVAL;
- }
-
- /*
- * Currently all POSIX threads are floating point if the hardware
- * supports it.
- */
-
- is_fp = CPU_HARDWARE_FP;
-
- /*
- * Disable dispatch for protection
- */
-
- _Thread_Disable_dispatch();
-
- /*
- * Allocate the thread control block.
- *
- * NOTE: Global threads are not currently supported.
- */
-
- the_thread = _POSIX_Threads_Allocate();
-
- if ( !the_thread ) {
- _Thread_Enable_dispatch();
- return EAGAIN;
- }
-
- /*
- * Initialize the core thread for this task.
- */
-
- status = _Thread_Initialize(
- &_POSIX_Threads_Information,
- the_thread,
- the_attr->stackaddr,
- the_attr->stacksize,
- is_fp,
- core_priority,
- TRUE, /* preemptible */
- budget_algorithm,
- budget_callout,
- 0, /* isr level */
- &default_name /* posix threads don't have a name */
- );
-
- if ( !status ) {
- _POSIX_Threads_Free( the_thread );
- _Thread_Enable_dispatch();
- return EAGAIN;
- }
-
- /*
- * finish initializing the per API structure
- */
-
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- api->Attributes = *the_attr;
- api->detachstate = the_attr->detachstate;
- api->schedpolicy = schedpolicy;
- api->schedparam = schedparam;
-
- /*
- * This insures we evaluate the process-wide signals pending when we
- * first run.
- *
- * NOTE: Since the thread starts with all unblocked, this is necessary.
- */
-
- the_thread->do_post_task_switch_extension = TRUE;
-
- /*
- * POSIX threads are allocated and started in one operation.
- */
-
- status = _Thread_Start(
- the_thread,
- THREAD_START_POINTER,
- start_routine,
- arg,
- 0 /* unused */
- );
-
- if ( schedpolicy == SCHED_SPORADIC ) {
- _Watchdog_Insert_ticks(
- &api->Sporadic_timer,
- _POSIX_Timespec_to_interval( &api->schedparam.ss_replenish_period )
- );
- }
-
- /*
- * _Thread_Start only fails if the thread was in the incorrect state
- */
-
- if ( !status ) {
- _POSIX_Threads_Free( the_thread );
- _Thread_Enable_dispatch();
- return EINVAL;
- }
-
- /*
- * Return the id and indicate we successfully created the thread
- */
-
- *thread = the_thread->Object.id;
-
- _Thread_Enable_dispatch();
-
- return 0;
-}
-
-/*PAGE
- *
- * 16.1.3 Wait for Thread Termination, P1003.1c/Draft 10, p. 147
- */
-
-int pthread_join(
- pthread_t thread,
- void **value_ptr
-)
-{
- register Thread_Control *the_thread;
- POSIX_API_Control *api;
- Objects_Locations location;
- void *return_pointer;
-
- the_thread = _POSIX_Threads_Get( thread, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- return ESRCH;
- case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
- if ( api->detachstate == PTHREAD_CREATE_DETACHED ) {
- _Thread_Enable_dispatch();
- return EINVAL;
- }
-
- if ( _Thread_Is_executing( the_thread ) ) {
- _Thread_Enable_dispatch();
- return EDEADLK;
- }
-
- /*
- * Put ourself on the threads join list
- */
-
- _Thread_Executing->Wait.return_argument = (unsigned32 *) &return_pointer;
-
- _Thread_queue_Enter_critical_section( &api->Join_List );
-
- _Thread_queue_Enqueue( &api->Join_List, WATCHDOG_NO_TIMEOUT );
-
- _Thread_Enable_dispatch();
-
- if ( value_ptr )
- *value_ptr = return_pointer;
- return 0;
- }
-
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 16.1.4 Detaching a Thread, P1003.1c/Draft 10, p. 149
- */
-
-int pthread_detach(
- pthread_t thread
-)
-{
- register Thread_Control *the_thread;
- POSIX_API_Control *api;
- Objects_Locations location;
-
- the_thread = _POSIX_Threads_Get( thread, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- return ESRCH;
- case OBJECTS_LOCAL:
-
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
- api->detachstate = PTHREAD_CREATE_DETACHED;
- _Thread_Enable_dispatch();
- return 0;
- }
-
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 16.1.5.1 Thread Termination, p1003.1c/Draft 10, p. 150
- *
- * NOTE: Key destructors are executed in the POSIX api delete extension.
- */
-
-void pthread_exit(
- void *value_ptr
-)
-{
- Objects_Information *the_information;
-
- the_information = _Objects_Get_information( _Thread_Executing->Object.id );
-
- _Thread_Disable_dispatch();
-
- _Thread_Executing->Wait.return_argument = (unsigned32 *)value_ptr;
-
- _Thread_Close( the_information, _Thread_Executing );
-
- _POSIX_Threads_Free( _Thread_Executing );
-
- _Thread_Enable_dispatch();
-}
-
-/*PAGE
- *
- * 16.1.6 Get Calling Thread's ID, p1003.1c/Draft 10, p. 152
- */
-
-pthread_t pthread_self( void )
-{
- return _Thread_Executing->Object.id;
-}
-
-/*PAGE
- *
- * 16.1.7 Compare Thread IDs, p1003.1c/Draft 10, p. 153
- *
- * NOTE: POSIX does not define the behavior when either thread id is invalid.
- */
-
-int pthread_equal(
- pthread_t t1,
- pthread_t t2
-)
-{
- /*
- * If the system is configured for debug, then we will do everything we
- * can to insure that both ids are valid. Otherwise, we will do the
- * cheapest possible thing to determine if they are equal.
- */
-
-#ifndef RTEMS_DEBUG
- return _Objects_Are_ids_equal( t1, t2 );
-#else
- int status;
- Objects_Locations location;
-
- /*
- * By default this is not a match.
- */
-
- status = 0;
-
- /*
- * Validate the first id and return 0 if it is not valid
- */
-
- (void) _POSIX_Threads_Get( t1, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- break;
-
- case OBJECTS_LOCAL:
-
- /*
- * Validate the second id and return 0 if it is not valid
- */
-
- (void) _POSIX_Threads_Get( t2, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- break;
- case OBJECTS_LOCAL:
- status = _Objects_Are_ids_equal( t1, t2 );
- break;
- }
- _Thread_Unnest_dispatch();
- break;
- }
-
- _Thread_Enable_dispatch();
- return status;
-#endif
-}
-
-/*PAGE
- *
- * 16.1.8 Dynamic Package Initialization, P1003.1c/Draft 10, p. 154
- */
-
-int pthread_once(
- pthread_once_t *once_control,
- void (*init_routine)(void)
-)
-{
- if ( !once_control || !init_routine )
- return EINVAL;
-
- _Thread_Disable_dispatch();
-
- if ( !once_control->init_executed ) {
- once_control->is_initialized = TRUE;
- once_control->init_executed = TRUE;
- (*init_routine)();
- }
-
- _Thread_Enable_dispatch();
- return 0;
-}
-
-/*PAGE
- *
- * 20.1.6 Accessing a Thread CPU-time Clock, P1003.4b/Draft 8, p. 58
- */
-
-int pthread_getcpuclockid(
- pthread_t pid,
- clockid_t *clock_id
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/Draft 8, p. 59
- */
-
-int pthread_attr_setcputime(
- pthread_attr_t *attr,
- int clock_allowed
-)
-{
- if ( !attr || !attr->is_initialized )
- return EINVAL;
-
- switch ( clock_allowed ) {
- case CLOCK_ENABLED:
- case CLOCK_DISABLED:
- attr->cputime_clock_allowed = clock_allowed;
- return 0;
-
- default:
- return EINVAL;
- }
-}
-
-/*PAGE
- *
- * 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/Draft 8, p. 59
- */
-
-int pthread_attr_getcputime(
- pthread_attr_t *attr,
- int *clock_allowed
-)
-{
- if ( !attr || !attr->is_initialized || !clock_allowed )
- return EINVAL;
-
- *clock_allowed = attr->cputime_clock_allowed;
- return 0;
-}
diff --git a/cpukit/posix/src/pthreadatfork.c b/cpukit/posix/src/pthreadatfork.c
deleted file mode 100644
index f70f8d7dc1..0000000000
--- a/cpukit/posix/src/pthreadatfork.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * pthread_atfork() - POSIX 1003.1b 3.1.3
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <errno.h>
-
-int pthread_atfork(
- void (*prepare)(void),
- void (*parent)(void),
- void (*child)(void)
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/posix/src/ptimer.c b/cpukit/posix/src/ptimer.c
deleted file mode 100644
index 0446a7a683..0000000000
--- a/cpukit/posix/src/ptimer.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * $Id$
- */
-
-#include <assert.h>
-#include <time.h>
-#include <errno.h>
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-
-#include <rtems/posix/time.h>
-
-/*
- * 14.2.2 Create a Per-Process Timer, P1003.1b-1993, p. 264
- */
-
-int timer_create(
- clockid_t clock_id,
- struct sigevent *evp,
- timer_t *timerid
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*
- * 14.2.3 Delete a Per_process Timer, P1003.1b-1993, p. 266
- */
-
-int timer_delete(
- timer_t timerid
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*
- * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267
- */
-
-int timer_settime(
- timer_t timerid,
- int flags,
- const struct itimerspec *value,
- struct itimerspec *ovalue
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*
- * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267
- */
-
-int timer_gettime(
- timer_t timerid,
- struct itimerspec *value
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*
- * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267
- */
-
-int timer_getoverrun(
- timer_t timerid
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
diff --git a/cpukit/posix/src/sched.c b/cpukit/posix/src/sched.c
deleted file mode 100644
index e558126926..0000000000
--- a/cpukit/posix/src/sched.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * $Id$
- */
-
-#include <assert.h>
-#include <sched.h>
-#include <errno.h>
-
-#include <rtems/system.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/thread.h>
-#include <rtems/posix/seterr.h>
-#include <rtems/posix/priority.h>
-#include <rtems/posix/time.h>
-
-/*PAGE
- *
- * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252
- *
- */
-
-int sched_setparam(
- pid_t pid,
- const struct sched_param *param
-)
-{
- set_errno_and_return_minus_one( ENOSYS );
-}
-
-/*PAGE
- *
- * 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253
- */
-
-int sched_getparam(
- pid_t pid,
- const struct sched_param *param
-)
-{
- set_errno_and_return_minus_one( ENOSYS );
-}
-
-/*PAGE
- *
- * 13.3.3 Set Scheduling Policy and Scheduling Parameters,
- * P1003.1b-1993, p. 254
- */
-
-int sched_setscheduler(
- pid_t pid,
- int policy,
- const struct sched_param *param
-)
-{
- set_errno_and_return_minus_one( ENOSYS );
-}
-
-/*PAGE
- *
- * 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256
- */
-
-int sched_getscheduler(
- pid_t pid
-)
-{
- set_errno_and_return_minus_one( ENOSYS );
-}
-
-/*PAGE
- *
- * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
- */
-
-int sched_get_priority_max(
- int policy
-)
-{
- switch ( policy ) {
- case SCHED_OTHER:
- case SCHED_FIFO:
- case SCHED_RR:
- case SCHED_SPORADIC:
- break;
-
- default:
- set_errno_and_return_minus_one( EINVAL );
- }
-
- return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
-}
-
-/*PAGE
- *
- * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
- */
-
-int sched_get_priority_min(
- int policy
-)
-{
- switch ( policy ) {
- case SCHED_OTHER:
- case SCHED_FIFO:
- case SCHED_RR:
- case SCHED_SPORADIC:
- break;
-
- default:
- set_errno_and_return_minus_one( EINVAL );
- }
-
- return POSIX_SCHEDULER_MINIMUM_PRIORITY;
-}
-
-/*PAGE
- *
- * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
- */
-
-int sched_rr_get_interval(
- pid_t pid,
- struct timespec *interval
-)
-{
- /* XXX do we need to support different time quantums per thread */
-
- /*
- * Only supported for the "calling process" (i.e. this node).
- */
-
- if ( pid != getpid() )
- set_errno_and_return_minus_one( ESRCH );
-
- if ( !interval )
- set_errno_and_return_minus_one( EINVAL );
-
- _POSIX_Interval_to_timespec( _Thread_Ticks_per_timeslice, interval );
- return 0;
-}
-
-/*PAGE
- *
- * 13.3.5 Yield Processor, P1003.1b-1993, p. 257
- */
-
-int sched_yield( void )
-{
- _Thread_Disable_dispatch();
- _Thread_Yield_processor();
- _Thread_Enable_dispatch();
- return 0;
-}
diff --git a/cpukit/posix/src/semaphore.c b/cpukit/posix/src/semaphore.c
deleted file mode 100644
index a968abe43b..0000000000
--- a/cpukit/posix/src/semaphore.c
+++ /dev/null
@@ -1,571 +0,0 @@
-/*
- * $Id$
- */
-
-#include <stdarg.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <semaphore.h>
-#include <limits.h>
-
-#include <rtems/system.h>
-#include <rtems/score/object.h>
-#include <rtems/posix/semaphore.h>
-#include <rtems/posix/time.h>
-
-/*PAGE
- *
- * _POSIX_Semaphore_Manager_initialization
- *
- * This routine initializes all semaphore manager related data structures.
- *
- * Input parameters:
- * maximum_semaphores - maximum configured semaphores
- *
- * Output parameters: NONE
- */
-
-void _POSIX_Semaphore_Manager_initialization(
- unsigned32 maximum_semaphores
-)
-{
- _Objects_Initialize_information(
- &_POSIX_Semaphore_Information,
- OBJECTS_POSIX_SEMAPHORES,
- TRUE,
- maximum_semaphores,
- sizeof( POSIX_Semaphore_Control ),
- TRUE,
- _POSIX_PATH_MAX,
- FALSE
- );
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Create_support
- */
-
-int _POSIX_Semaphore_Create_support(
- const char *name,
- int pshared,
- unsigned int value,
- POSIX_Semaphore_Control **the_sem
-)
-{
- POSIX_Semaphore_Control *the_semaphore;
- CORE_semaphore_Attributes *the_sem_attr;
-
- _Thread_Disable_dispatch();
-
- the_semaphore = _POSIX_Semaphore_Allocate();
-
- if ( !the_semaphore ) {
- _Thread_Enable_dispatch();
- set_errno_and_return_minus_one( ENOMEM );
- }
-
- if ( pshared == PTHREAD_PROCESS_SHARED &&
- !( _Objects_MP_Allocate_and_open( &_POSIX_Semaphore_Information, 0,
- the_semaphore->Object.id, FALSE ) ) ) {
- _POSIX_Semaphore_Free( the_semaphore );
- _Thread_Enable_dispatch();
- set_errno_and_return_minus_one( EAGAIN );
- }
-
- the_semaphore->process_shared = pshared;
-
- if ( name ) {
- the_semaphore->named = TRUE;
- the_semaphore->open_count = 1;
- the_semaphore->linked = TRUE;
- }
- else
- the_semaphore->named = FALSE;
-
- the_sem_attr = &the_semaphore->Semaphore.Attributes;
-
- /* XXX
- *
- * Note should this be based on the current scheduling policy?
- */
-
- the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
-
- _CORE_semaphore_Initialize(
- &the_semaphore->Semaphore,
- OBJECTS_POSIX_SEMAPHORES,
- the_sem_attr,
- value,
- 0 /* XXX - proxy_extract_callout is unused */
- );
-
- /* XXX - need Names to be a string!!! */
- _Objects_Open(
- &_POSIX_Semaphore_Information,
- &the_semaphore->Object,
- (char *) name
- );
-
- *the_sem = the_semaphore;
-
- if ( pshared == PTHREAD_PROCESS_SHARED )
- _POSIX_Semaphore_MP_Send_process_packet(
- POSIX_SEMAPHORE_MP_ANNOUNCE_CREATE,
- the_semaphore->Object.id,
- (char *) name,
- 0 /* proxy id - Not used */
- );
-
- _Thread_Enable_dispatch();
- return 0;
-}
-
-
-/*PAGE
- *
- * 11.2.1 Initialize an Unnamed Semaphore, P1003.1b-1993, p.219
- */
-
-int sem_init(
- sem_t *sem,
- int pshared,
- unsigned int value
-)
-{
- int status;
- POSIX_Semaphore_Control *the_semaphore;
-
- status = _POSIX_Semaphore_Create_support(
- NULL,
- pshared,
- value,
- &the_semaphore
- );
-
- if ( status != -1 )
- *sem = the_semaphore->Object.id;
-
- return status;
-}
-
-/*PAGE
- *
- * 11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220
- */
-
-int sem_destroy(
- sem_t *sem
-)
-{
- register POSIX_Semaphore_Control *the_semaphore;
- Objects_Locations location;
-
- the_semaphore = _POSIX_Semaphore_Get( sem, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- /*
- * Undefined operation on a named semaphore.
- */
-
- if ( the_semaphore->named == TRUE ) {
- seterrno( EINVAL );
- return( -1 );
- }
-
- _Objects_Close( &_POSIX_Semaphore_Information, &the_semaphore->Object );
-
- _CORE_semaphore_Flush(
- &the_semaphore->Semaphore,
- _POSIX_Semaphore_MP_Send_object_was_deleted,
- -1 /* XXX should also seterrno -> EINVAL */
- );
-
- _POSIX_Semaphore_Free( the_semaphore );
-
- if ( the_semaphore->process_shared == PTHREAD_PROCESS_SHARED ) {
-
- _Objects_MP_Close(
- &_POSIX_Semaphore_Information,
- the_semaphore->Object.id
- );
-
- _POSIX_Semaphore_MP_Send_process_packet(
- POSIX_SEMAPHORE_MP_ANNOUNCE_DELETE,
- the_semaphore->Object.id,
- 0, /* Not used */
- 0 /* Not used */
- );
- }
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.2.3 Initialize/Open a Named Semaphore, P1003.1b-1993, p.221
- *
- * NOTE: When oflag is O_CREAT, then optional third and fourth
- * parameters must be present.
- */
-
-sem_t *sem_open(
- const char *name,
- int oflag,
- ...
- /* mode_t mode, */
- /* unsigned int value */
-)
-{
- va_list arg;
- mode_t mode;
- unsigned int value;
- int status;
- Objects_Id the_semaphore_id;
- POSIX_Semaphore_Control *the_semaphore;
-
-
- if ( oflag & O_CREAT ) {
- va_start(arg, oflag);
- mode = (mode_t) va_arg( arg, mode_t * );
- value = (unsigned int) va_arg( arg, unsigned int * );
- va_end(arg);
- }
-
- status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id );
-
- /*
- * If the name to id translation worked, then the semaphore exists
- * and we can just return a pointer to the id. Otherwise we may
- * need to check to see if this is a "semaphore does not exist"
- * or some other miscellaneous error on the name.
- */
-
- if ( status ) {
-
- if ( status == EINVAL ) { /* name -> ID translation failed */
- if ( !(oflag & O_CREAT) ) { /* willing to create it? */
- seterrno( ENOENT );
- return (sem_t *) -1;
- }
- /* we are willing to create it */
- }
- seterrno( status ); /* some type of error */
- return (sem_t *) -1;
-
- } else { /* name -> ID translation succeeded */
-
- if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
- seterrno( EEXIST );
- return (sem_t *) -1;
- }
-
- /*
- * XXX In this case we need to do an ID->pointer conversion to
- * check the mode. This is probably a good place for a subroutine.
- */
-
- the_semaphore->open_count += 1;
-
- return (sem_t *)&the_semaphore->Object.id;
-
- }
-
- /* XXX verify this comment...
- *
- * At this point, the semaphore does not exist and everything has been
- * checked. We should go ahead and create a semaphore.
- */
-
- status = _POSIX_Semaphore_Create_support(
- name,
- TRUE, /* shared across processes */
- value,
- &the_semaphore
- );
-
- if ( status == -1 )
- return (sem_t *) -1;
-
- return (sem_t *) &the_semaphore->Object.id;
-
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Delete
- */
-
-void _POSIX_Semaphore_Delete(
- POSIX_Semaphore_Control *the_semaphore
-)
-{
- if ( !the_semaphore->linked && !the_semaphore->open_count ) {
- _POSIX_Semaphore_Free( the_semaphore );
-
- if ( the_semaphore->process_shared == PTHREAD_PROCESS_SHARED ) {
-
- _Objects_MP_Close(
- &_POSIX_Semaphore_Information,
- the_semaphore->Object.id
- );
-
- _POSIX_Semaphore_MP_Send_process_packet(
- POSIX_SEMAPHORE_MP_ANNOUNCE_DELETE,
- the_semaphore->Object.id,
- 0, /* Not used */
- 0 /* Not used */
- );
- }
-
- }
-}
-
-/*PAGE
- *
- * 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224
- */
-
-int sem_close(
- sem_t *sem
-)
-{
- register POSIX_Semaphore_Control *the_semaphore;
- Objects_Locations location;
-
- the_semaphore = _POSIX_Semaphore_Get( sem, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- the_semaphore->open_count -= 1;
- _POSIX_Semaphore_Delete( the_semaphore );
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225
- */
-
-int sem_unlink(
- const char *name
-)
-{
- int status;
- register POSIX_Semaphore_Control *the_semaphore;
- Objects_Id the_semaphore_id;
- Objects_Locations location;
-
- status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id );
-
- if ( !status )
- set_errno_and_return_minus_one( status );
-
- the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
-
- if ( the_semaphore->process_shared == PTHREAD_PROCESS_SHARED ) {
- _Objects_MP_Close(
- &_POSIX_Semaphore_Information,
- the_semaphore->Object.id
- );
- }
-
- the_semaphore->linked = FALSE;
-
- _POSIX_Semaphore_Delete( the_semaphore );
-
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * _POSIX_Semaphore_Wait_support
- */
-
-int _POSIX_Semaphore_Wait_support(
- sem_t *sem,
- boolean blocking,
- Watchdog_Interval timeout
-)
-{
- register POSIX_Semaphore_Control *the_semaphore;
- Objects_Locations location;
-
- the_semaphore = _POSIX_Semaphore_Get( sem, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- _CORE_semaphore_Seize(
- &the_semaphore->Semaphore,
- the_semaphore->Object.id,
- blocking,
- timeout
- );
- _Thread_Enable_dispatch();
- return _Thread_Executing->Wait.return_code;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226
- *
- * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27
- */
-
-int sem_wait(
- sem_t *sem
-)
-{
- return _POSIX_Semaphore_Wait_support( sem, TRUE, THREAD_QUEUE_WAIT_FOREVER );
-}
-
-/*PAGE
- *
- * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226
- *
- * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27
- */
-
-int sem_trywait(
- sem_t *sem
-)
-{
- return _POSIX_Semaphore_Wait_support( sem, FALSE, THREAD_QUEUE_WAIT_FOREVER );
-}
-
-/*PAGE
- *
- * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226
- *
- * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27
- */
-
-int sem_timedwait(
- sem_t *sem,
- const struct timespec *timeout
-)
-{
- return _POSIX_Semaphore_Wait_support(
- sem,
- TRUE,
- _POSIX_Timespec_to_interval( timeout )
- );
-}
-
-/*PAGE
- *
- * 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227
- */
-
-void POSIX_Semaphore_MP_support(
- Thread_Control *the_thread,
- Objects_Id id
-)
-{
- (void) POSIX_MP_NOT_IMPLEMENTED();
-}
-
-
-int sem_post(
- sem_t *sem
-)
-{
- register POSIX_Semaphore_Control *the_semaphore;
- Objects_Locations location;
-
- the_semaphore = _POSIX_Semaphore_Get( sem, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- _CORE_semaphore_Surrender(
- &the_semaphore->Semaphore,
- the_semaphore->Object.id,
- POSIX_Semaphore_MP_support
- );
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
-
-/*PAGE
- *
- * 11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229
- */
-
-int sem_getvalue(
- sem_t *sem,
- int *sval
-)
-{
- register POSIX_Semaphore_Control *the_semaphore;
- Objects_Locations location;
-
- the_semaphore = _POSIX_Semaphore_Get( sem, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return POSIX_MP_NOT_IMPLEMENTED();
- seterrno( EINVAL );
- return( -1 );
- case OBJECTS_LOCAL:
- *sval = _CORE_semaphore_Get_count( &the_semaphore->Semaphore );
- _Thread_Enable_dispatch();
- return 0;
- }
- return POSIX_BOTTOM_REACHED();
-}
diff --git a/cpukit/posix/src/time.c b/cpukit/posix/src/time.c
deleted file mode 100644
index a14eb71f8e..0000000000
--- a/cpukit/posix/src/time.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
- * $Id$
- */
-
-#include <assert.h>
-#include <time.h>
-#include <errno.h>
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-
-#include <rtems/posix/seterr.h>
-#include <rtems/posix/time.h>
-
-/*PAGE
- *
- * _POSIX_Timespec_subtract
- */
-
-void _POSIX_Timespec_subtract(
- const struct timespec *the_start,
- const struct timespec *end,
- struct timespec *result
-)
-{
- struct timespec start_struct = *the_start;
- struct timespec *start = &start_struct;
- unsigned int nsecs_per_sec = TOD_NANOSECONDS_PER_SECOND;
-
- if (end->tv_nsec < start->tv_nsec) {
- int seconds = (start->tv_nsec - end->tv_nsec) / nsecs_per_sec + 1;
- start->tv_nsec -= nsecs_per_sec * seconds;
- start->tv_sec += seconds;
- }
-
- if (end->tv_nsec - start->tv_nsec > nsecs_per_sec) {
- int seconds = (start->tv_nsec - end->tv_nsec) / nsecs_per_sec;
- start->tv_nsec += nsecs_per_sec * seconds;
- start->tv_sec -= seconds;
- }
-
- result->tv_sec = end->tv_sec - start->tv_sec;
- result->tv_nsec = end->tv_nsec - start->tv_nsec;
-}
-
-/*PAGE
- *
- * _POSIX_Timespec_to_interval
- */
-
-Watchdog_Interval _POSIX_Timespec_to_interval(
- const struct timespec *time
-)
-{
- Watchdog_Interval ticks;
-
- ticks = (time->tv_sec * TOD_MICROSECONDS_PER_SECOND) /
- _TOD_Microseconds_per_tick;
-
- ticks += (time->tv_nsec / TOD_NANOSECONDS_PER_MICROSECOND) /
- _TOD_Microseconds_per_tick;
-
- if (ticks)
- return ticks;
-
- return 1;
-}
-
-/*PAGE
- *
- * _POSIX_Interval_to_timespec
- */
-
-void _POSIX_Interval_to_timespec(
- Watchdog_Interval ticks,
- struct timespec *time
-)
-{
- unsigned32 usecs;
-
- usecs = ticks * _TOD_Microseconds_per_tick;
-
- time->tv_sec = usecs / TOD_MICROSECONDS_PER_SECOND;
- time->tv_nsec = (usecs % TOD_MICROSECONDS_PER_SECOND) *
- TOD_NANOSECONDS_PER_MICROSECOND;
-}
-
-/*PAGE
- *
- * 4.5.1 Get System Time, P1003.1b-1993, p. 91
- */
-
-/* Using the implementation in newlib */
-#if 0
-time_t time(
- time_t *tloc
-)
-{
- time_t seconds_since_epoch;
-
- /*
- * No error is the time of day is not set. For RTEMS the system time
- * starts out at the rtems epoch.
- */
-
- /*
- * Internally the RTEMS epoch is 1988. This must be taken into account.
- */
-
- seconds_since_epoch = _TOD_Seconds_since_epoch;
-
- seconds_since_epoch += POSIX_TIME_SECONDS_1970_THROUGH_1988;
-
- if ( tloc )
- *tloc = seconds_since_epoch;
-
- return seconds_since_epoch;
-}
-#endif
-
-/*PAGE
- *
- * 14.2.1 Clocks, P1003.1b-1993, p. 263
- */
-
-int clock_settime(
- clockid_t clock_id,
- const struct timespec *tp
-)
-{
- struct tm split_time;
- TOD_Control tod;
- Watchdog_Interval seconds;
-
- assert( tp );
-
- switch ( clock_id ) {
-
- case CLOCK_REALTIME:
- (void) gmtime_r( &tp->tv_sec, &split_time );
-
- /*
- * Convert the tm structure format to that used by the TOD Handler
- *
- * NOTE: TOD Handler does not honor leap seconds.
- */
-
- tod.year = split_time.tm_year + 1900; /* RHS is years since 1900 */
- tod.month = split_time.tm_mon + 1; /* RHS uses 0-11 */
- tod.day = split_time.tm_mday;
- tod.hour = split_time.tm_hour;
- tod.minute = split_time.tm_min;
- tod.second = split_time.tm_sec; /* RHS allows 0-61 for leap seconds */
-
- tod.ticks = (tp->tv_nsec / TOD_NANOSECONDS_PER_MICROSECOND) /
- _TOD_Microseconds_per_tick;
-
- if ( !_TOD_Validate( &tod ) )
- set_errno_and_return_minus_one( EINVAL );
-
- /*
- * We can't use the tp->tv_sec field because it is based on
- * a different EPOCH.
- */
-
- seconds = _TOD_To_seconds( &tod );
- _Thread_Disable_dispatch();
- _TOD_Set( &tod, seconds );
- _Thread_Enable_dispatch();
- break;
-
-#ifdef _POSIX_CPUTIME
- case CLOCK_PROCESS_CPUTIME:
- return POSIX_NOT_IMPLEMENTED();
- break;
-#endif
-
-#ifdef _POSIX_THREAD_CPUTIME
- case CLOCK_THREAD_CPUTIME:
- return POSIX_NOT_IMPLEMENTED();
- break;
-#endif
- default:
- set_errno_and_return_minus_one( EINVAL );
-
- }
- return 0;
-}
-
-/*PAGE
- *
- * 14.2.1 Clocks, P1003.1b-1993, p. 263
- */
-
-int clock_gettime(
- clockid_t clock_id,
- struct timespec *tp
-)
-{
- ISR_Level level;
- time_t seconds;
- long ticks;
-
- if ( !tp )
- set_errno_and_return_minus_one( EINVAL );
-
- switch ( clock_id ) {
-
- case CLOCK_REALTIME:
-
- _ISR_Disable( level );
- seconds = _TOD_Seconds_since_epoch;
- ticks = _TOD_Current.ticks;
- _ISR_Enable( level );
-
- tp->tv_sec = seconds + POSIX_TIME_SECONDS_1970_THROUGH_1988;
- tp->tv_nsec = ticks * _TOD_Microseconds_per_tick *
- TOD_NANOSECONDS_PER_MICROSECOND;
- break;
-
-#ifdef _POSIX_CPUTIME
- case CLOCK_PROCESS_CPUTIME:
- /* don't base this on _Watchdog_Ticks_since_boot--duration is too short*/
- return POSIX_NOT_IMPLEMENTED();
- break;
-#endif
-
-#ifdef _POSIX_THREAD_CPUTIME
- case CLOCK_THREAD_CPUTIME:
- return POSIX_NOT_IMPLEMENTED();
- break;
-#endif
- default:
- set_errno_and_return_minus_one( EINVAL );
-
- }
- return 0;
-}
-
-/*PAGE
- *
- * 14.2.1 Clocks, P1003.1b-1993, p. 263
- */
-
-int clock_getres(
- clockid_t clock_id,
- struct timespec *res
-)
-{
- if ( !res )
- set_errno_and_return_minus_one( EINVAL );
-
- switch ( clock_id ) {
-
- /*
- * All time in rtems is based on the same clock tick.
- */
-
- case CLOCK_REALTIME:
- case CLOCK_PROCESS_CPUTIME:
- case CLOCK_THREAD_CPUTIME:
- if ( res )
- _POSIX_Interval_to_timespec( _TOD_Microseconds_per_tick, res );
- break;
-
- default:
- set_errno_and_return_minus_one( EINVAL );
-
- }
- return 0;
-}
-
-/*PAGE
- *
- * 14.2.5 High Resolution Sleep, P1003.1b-1993, p. 269
- */
-
-int nanosleep(
- const struct timespec *rqtp,
- struct timespec *rmtp
-)
-{
- Watchdog_Interval ticks;
- struct timespec *the_rqtp;
-
- if ( !rqtp )
- set_errno_and_return_minus_one( EINVAL );
-
- the_rqtp = (struct timespec *)rqtp;
-
- /*
- * Return EAGAIN if the delay interval is negative.
- *
- * NOTE: This behavior is beyond the POSIX specification.
- * FSU pthreads shares this behavior.
- */
-
- if ( the_rqtp->tv_sec < 0 )
- the_rqtp->tv_sec = 0;
-
- if ( /* the_rqtp->tv_sec < 0 || */ the_rqtp->tv_nsec < 0 )
- set_errno_and_return_minus_one( EAGAIN );
-
- if ( the_rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
- set_errno_and_return_minus_one( EINVAL );
-
- ticks = _POSIX_Timespec_to_interval( the_rqtp );
-
- /*
- * This behavior is also beyond the POSIX specification but is
- * consistent with the RTEMS api and yields desirable behavior.
- */
-
- if ( !ticks ) {
- _Thread_Yield_processor();
- _Thread_Dispatch();
- if ( rmtp ) {
- rmtp->tv_sec = 0;
- rmtp->tv_nsec = 0;
- }
- return 0;
- }
-
- _Thread_Disable_dispatch();
- _Thread_Set_state(
- _Thread_Executing,
- STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL
- );
- _Watchdog_Initialize(
- &_Thread_Executing->Timer,
- _Thread_Delay_ended,
- _Thread_Executing->Object.id,
- NULL
- );
- _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks );
- _Thread_Enable_dispatch();
-
- /* calculate time remaining */
-
- if ( rmtp ) {
- ticks -=
- _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time;
-
- _POSIX_Interval_to_timespec( ticks, rmtp );
-
- /*
- * If there is time remaining, then we were interrupted by a signal.
- */
-
- if ( ticks )
- set_errno_and_return_minus_one( EINTR );
- }
-
- return 0;
-}
-
-/*PAGE
- *
- * 20.1.3 Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55
- */
-
-int clock_getcpuclockid(
- pid_t pid,
- clockid_t *clock_id
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 20.1.5 CPU-time Clock Attribute Access, P1003.4b/D8, p. 58
- */
-
-int clock_setenable_attr(
- clockid_t clock_id,
- int attr
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
-
-/*PAGE
- *
- * 20.1.5 CPU-time Clock Attribute Access, P1003.4b/D8, p. 58
- */
-
-int clock_getenable_attr(
- clockid_t clock_id,
- int *attr
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
diff --git a/cpukit/posix/src/types.c b/cpukit/posix/src/types.c
deleted file mode 100644
index 4386ad5292..0000000000
--- a/cpukit/posix/src/types.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * $Id$
- */
-
-#include <limits.h>
-#include <errno.h>
-#include <string.h>
-#include <sys/types.h>
-
-#include <rtems/system.h>
-#include <rtems/score/object.h>
-#include <rtems/posix/seterr.h>
-
-pid_t _POSIX_types_Ppid = 0;
-uid_t _POSIX_types_Uid = 0;
-uid_t _POSIX_types_Euid = 0;
-gid_t _POSIX_types_Gid = 0;
-gid_t _POSIX_types_Egid = 0;
-
-/*PAGE
- *
- * 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83
- */
-
-pid_t getppid( void )
-{
- return _POSIX_types_Ppid;
-}
-
-/*PAGE
- *
- * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
- * P1003.1b-1993, p. 84
- */
-
-uid_t getuid( void )
-{
- return _POSIX_types_Uid;
-}
-
-/*PAGE
- *
- * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
- * P1003.1b-1993, p. 84
- */
-
-uid_t geteuid( void )
-{
- return _POSIX_types_Euid;
-}
-
-/*PAGE
- *
- * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
- * P1003.1b-1993, p. 84
- */
-
-gid_t getgid( void )
-{
- return _POSIX_types_Gid;
-}
-
-/*PAGE
- *
- * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
- * P1003.1b-1993, p. 84
- */
-
-gid_t getegid( void )
-{
- return _POSIX_types_Egid;
-}
-
-/*PAGE
- *
- * 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
- */
-
-int setuid(
- uid_t uid
-)
-{
- _POSIX_types_Uid = uid;
- return 0;
-}
-
-/*PAGE
- *
- * 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
- */
-
-int setgid(
- gid_t gid
-)
-{
- _POSIX_types_Gid = gid;
- return 0;
-}
-
-/*PAGE
- *
- * 4.2.3 Get Supplementary IDs, P1003.1b-1993, p. 86
- */
-
-int getgroups(
- int gidsetsize,
- gid_t grouplist[]
-)
-{
- return 0; /* no supplemental group ids */
-}
-
-/*PAGE
- *
- * 4.2.4 Get User Name, P1003.1b-1993, p. 87
- *
- * NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
- */
-
-static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];
-
-char *getlogin( void )
-{
- (void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX );
- return _POSIX_types_Getlogin_buffer;
-}
-
-/*PAGE
- *
- * 4.2.4 Get User Name, P1003.1b-1993, p. 87
- *
- * NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
- */
-
-int getlogin_r(
- char *name,
- size_t namesize
-)
-{
- if ( namesize < LOGIN_NAME_MAX )
- return ERANGE;
-
- strcpy( name, "posixapp" );
- return 0;
-}
-
-/*PAGE
- *
- * 4.3.1 Get Process Group IDs, P1003.1b-1993, p. 89
- */
-
-pid_t getpgrp( void )
-{
- /*
- * This always succeeds and returns the process group id. For rtems,
- * this will always be the local node;
- */
-
- return _Objects_Local_node;
-}
-
-/*PAGE
- *
- * 4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88
- */
-
-pid_t setsid( void )
-{
- set_errno_and_return_minus_one( ENOSYS );
-}
-
-/*PAGE
- *
- * 4.3.3 Set Process Group ID for Job Control, P1003.1b-1993, p. 89
- */
-
-int setpgid(
- pid_t pid,
- pid_t pgid
-)
-{
- set_errno_and_return_minus_one( ENOSYS );
-}
-
-/*
- * TEMPORARY
- */
-
-#include <assert.h>
-
-int POSIX_MP_NOT_IMPLEMENTED()
-{
- assert( 0 );
- return 0;
-}
-
-int POSIX_BOTTOM_REACHED()
-{
- assert( 0 );
- return 0;
-}
-
-int POSIX_NOT_IMPLEMENTED()
-{
- assert( 0 );
- return 0;
-}
-
-/*
- * END OF TEMPORARY
- */
-
diff --git a/cpukit/posix/src/wait.c b/cpukit/posix/src/wait.c
deleted file mode 100644
index bbef04a2eb..0000000000
--- a/cpukit/posix/src/wait.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * waitpid() - POSIX 1003.1b 3.2.1
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <errno.h>
-
-int wait(
- int *stat_loc
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/posix/src/waitpid.c b/cpukit/posix/src/waitpid.c
deleted file mode 100644
index f20161b5a9..0000000000
--- a/cpukit/posix/src/waitpid.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * wait() - POSIX 1003.1b 3.2.1
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <errno.h>
-
-int wait(
- int *stat_loc
-)
-{
- errno = ENOSYS;
- return -1;
-}
diff --git a/cpukit/rtems/include/rtems.h b/cpukit/rtems/include/rtems.h
deleted file mode 100644
index 9a165c08dd..0000000000
--- a/cpukit/rtems/include/rtems.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* rtems.h
- *
- * This include file contains information about RTEMS executive that
- * is required by the application and is CPU independent. It includes
- * two (2) CPU dependent files to tailor its data structures for a
- * particular processor.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_GENERIC_h
-#define __RTEMS_RTEMS_GENERIC_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Unless told otherwise, the RTEMS include files will hide some stuff
- * from normal application code. Defining this crosses a boundary which
- * is undesirable since it means your application is using RTEMS features
- * which are not included in the formally defined and supported API.
- * Define this at your own risk.
- */
-
-#if !defined(__RTEMS_VIOLATE_KERNEL_VISIBILITY__) && !defined(__RTEMS_INSIDE__)
-#define __RTEMS_APPLICATION__
-#endif
-
-#include <rtems/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/types.h>
-
-#include <rtems/config.h>
-#include <rtems/init.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/rtems/intr.h>
-#include <rtems/rtems/clock.h>
-#include <rtems/extension.h>
-#include <rtems/rtems/timer.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/rtems/message.h>
-#include <rtems/rtems/event.h>
-#include <rtems/rtems/signal.h>
-#include <rtems/rtems/event.h>
-#include <rtems/rtems/part.h>
-#include <rtems/rtems/region.h>
-#include <rtems/rtems/dpmem.h>
-#include <rtems/io.h>
-#include <rtems/fatal.h>
-#include <rtems/rtems/ratemon.h>
-#include <rtems/rtems/mp.h>
-
-#include <rtems/rtems/support.h>
-#include <rtems/score/sysstate.h>
-
-#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP
-
-/*
- * The following define the constants which may be used in name searches.
- */
-
-#define RTEMS_SEARCH_ALL_NODES OBJECTS_SEARCH_ALL_NODES
-#define RTEMS_SEARCH_OTHER_NODES OBJECTS_SEARCH_OTHER_NODES
-#define RTEMS_SEARCH_LOCAL_NODE OBJECTS_SEARCH_LOCAL_NODE
-#define RTEMS_WHO_AM_I OBJECTS_WHO_AM_I
-
-/*
- * Parameters and return id's for _Objects_Get_next
- */
-
-#define RTEMS_OBJECT_ID_INITIAL_INDEX OBJECTS_ID_INITIAL_INDEX
-#define RTEMS_OBJECT_ID_FINAL_INDEX OBJECTS_ID_FINAL_INDEX
-
-#define RTEMS_OBJECT_ID_INITIAL(class, node) OBJECTS_ID_INITIAL(class, node)
-#define RTEMS_OBJECT_ID_FINAL OBJECTS_ID_FINAL
-
-/*
- * The following constant defines the minimum stack size which every
- * thread must exceed.
- */
-
-#define RTEMS_MINIMUM_STACK_SIZE STACK_MINIMUM_SIZE
-
-/*
- * Constant for indefinite wait. (actually an illegal interval)
- */
-
-#define RTEMS_NO_TIMEOUT WATCHDOG_NO_TIMEOUT
-
-/*
- * An MPCI must support packets of at least this size.
- */
-
-#define RTEMS_MINIMUM_PACKET_SIZE MP_PACKET_MINIMUM_PACKET_SIZE
-
-/*
- * The following constant defines the number of unsigned32's
- * in a packet which must be converted to native format in a
- * heterogeneous system. In packets longer than
- * MP_PACKET_MINIMUN_HETERO_CONVERSION unsigned32's, some of the "extra" data
- * may a user message buffer which is not automatically endian swapped.
- */
-
-#define RTEMS_MINIMUN_HETERO_CONVERSION MP_PACKET_MINIMUN_HETERO_CONVERSION
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/asr.h b/cpukit/rtems/include/rtems/rtems/asr.h
deleted file mode 100644
index 3fac2fa3e3..0000000000
--- a/cpukit/rtems/include/rtems/rtems/asr.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* asr.h
- *
- * This include file contains all the constants and structures associated
- * with the Asynchronous Signal Handler. This Handler provides the low-level
- * support required by the Signal Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_ASR_h
-#define __RTEMS_ASR_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/modes.h>
-
-/*
- *
- * The following type defines the control block used to manage
- * each signal set.
- */
-
-typedef unsigned32 rtems_signal_set;
-
-/*
- * Return type for ASR Handler
- */
-
-typedef void rtems_asr;
-
-/*
- * The following type corresponds to the applications asynchronous
- * signal processing routine.
- */
-
-typedef rtems_asr ( *rtems_asr_entry )(
- rtems_signal_set
- );
-
-/*
- *
- * The following defines the control structure used to manage
- * signals. Each thread has a copy of this record.
- */
-
-typedef struct {
- boolean is_enabled; /* are ASRs enabled currently? */
- rtems_asr_entry handler; /* address of RTEMS_ASR */
- Modes_Control mode_set; /* RTEMS_ASR mode */
- rtems_signal_set signals_posted; /* signal set */
- rtems_signal_set signals_pending; /* pending signal set */
- unsigned32 nest_level; /* nest level of RTEMS_ASR */
-} ASR_Information;
-
-/*
- * The following constants define the individual signals which may
- * be used to compose a signal set.
- */
-
-#define RTEMS_SIGNAL_0 0x00000001
-#define RTEMS_SIGNAL_1 0x00000002
-#define RTEMS_SIGNAL_2 0x00000004
-#define RTEMS_SIGNAL_3 0x00000008
-#define RTEMS_SIGNAL_4 0x00000010
-#define RTEMS_SIGNAL_5 0x00000020
-#define RTEMS_SIGNAL_6 0x00000040
-#define RTEMS_SIGNAL_7 0x00000080
-#define RTEMS_SIGNAL_8 0x00000100
-#define RTEMS_SIGNAL_9 0x00000200
-#define RTEMS_SIGNAL_10 0x00000400
-#define RTEMS_SIGNAL_11 0x00000800
-#define RTEMS_SIGNAL_12 0x00001000
-#define RTEMS_SIGNAL_13 0x00002000
-#define RTEMS_SIGNAL_14 0x00004000
-#define RTEMS_SIGNAL_15 0x00008000
-#define RTEMS_SIGNAL_16 0x00010000
-#define RTEMS_SIGNAL_17 0x00020000
-#define RTEMS_SIGNAL_18 0x00040000
-#define RTEMS_SIGNAL_19 0x00080000
-#define RTEMS_SIGNAL_20 0x00100000
-#define RTEMS_SIGNAL_21 0x00200000
-#define RTEMS_SIGNAL_22 0x00400000
-#define RTEMS_SIGNAL_23 0x00800000
-#define RTEMS_SIGNAL_24 0x01000000
-#define RTEMS_SIGNAL_25 0x02000000
-#define RTEMS_SIGNAL_26 0x04000000
-#define RTEMS_SIGNAL_27 0x08000000
-#define RTEMS_SIGNAL_28 0x10000000
-#define RTEMS_SIGNAL_29 0x20000000
-#define RTEMS_SIGNAL_30 0x40000000
-#define RTEMS_SIGNAL_31 0x80000000
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/asr.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/attr.h b/cpukit/rtems/include/rtems/rtems/attr.h
deleted file mode 100644
index 215b27f9a0..0000000000
--- a/cpukit/rtems/include/rtems/rtems/attr.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* attr.h
- *
- * This include file contains all information about the Object Attributes
- * Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_ATTRIBUTES_h
-#define __RTEMS_ATTRIBUTES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* types */
-
-typedef unsigned32 rtems_attribute;
-
-/* constants */
-
-#define RTEMS_DEFAULT_ATTRIBUTES 0x00000000
-
-#define RTEMS_NO_FLOATING_POINT 0x00000000 /* don't use FP HW */
-#define RTEMS_FLOATING_POINT 0x00000001 /* utilize coprocessor */
-
-#define RTEMS_LOCAL 0x00000000 /* local resource */
-#define RTEMS_GLOBAL 0x00000002 /* global resource */
-
-#define RTEMS_FIFO 0x00000000 /* process RTEMS_FIFO */
-#define RTEMS_PRIORITY 0x00000004 /* process by priority */
-
-#define RTEMS_COUNTING_SEMAPHORE 0x00000000
-#define RTEMS_BINARY_SEMAPHORE 0x00000010
-
-#define RTEMS_NO_INHERIT_PRIORITY 0x00000000
-#define RTEMS_INHERIT_PRIORITY 0x00000020
-
-#define RTEMS_NO_PRIORITY_CEILING 0x00000000
-#define RTEMS_PRIORITY_CEILING 0x00000040
-
-#define RTEMS_APPLICATION_TASK 0x00000000
-#define RTEMS_SYSTEM_TASK 0x00000080
-
-#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
-#define ATTRIBUTES_NOT_SUPPORTED 0
-#else
-#define ATTRIBUTES_NOT_SUPPORTED RTEMS_FLOATING_POINT
-#endif
-
-#if ( CPU_ALL_TASKS_ARE_FP == TRUE )
-#define ATTRIBUTES_REQUIRED RTEMS_FLOATING_POINT
-#else
-#define ATTRIBUTES_REQUIRED 0
-#endif
-
-/*
- * _Attributes_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs initialization for this handler.
- *
- * NOTE: There is no initialization required in C. Conditional compilation
- * takes care of this in C.
- */
-
-#define _Attributes_Handler_initialization()
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/attr.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/clock.h b/cpukit/rtems/include/rtems/rtems/clock.h
deleted file mode 100644
index c991d769cf..0000000000
--- a/cpukit/rtems/include/rtems/rtems/clock.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* clock.h
- *
- * This include file contains all the constants and structures associated
- * with the Clock Manager. This manager provides facilities to set, obtain,
- * and continually update the current date and time.
- *
- * This manager provides directives to:
- *
- * + set the current date and time
- * + obtain the current date and time
- * + announce a clock tick
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CLOCK_h
-#define __RTEMS_CLOCK_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/tod.h>
-#include <rtems/rtems/types.h>
-
-/*
- * List of things which can be returned by the rtems_clock_get directive.
- */
-
-typedef enum {
- RTEMS_CLOCK_GET_TOD,
- RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH,
- RTEMS_CLOCK_GET_TICKS_SINCE_BOOT,
- RTEMS_CLOCK_GET_TICKS_PER_SECOND,
- RTEMS_CLOCK_GET_TIME_VALUE
-} rtems_clock_get_options;
-
-/*
- * Standard flavor style to return TOD in for a rtems_clock_get option.
- */
-
-typedef struct {
- unsigned32 seconds;
- unsigned32 microseconds;
-} rtems_clock_time_value;
-
-/*
- * rtems_clock_get
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_clock_get directive. It returns
- * one of the following:
- * + current time of day
- * + seconds since epoch
- * + ticks since boot
- * + ticks per second
- */
-
-rtems_status_code rtems_clock_get(
- rtems_clock_get_options option,
- void *time_buffer
-);
-
-/*
- * rtems_clock_set
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_clock_set directive. It sets
- * the current time of day to that in the time_buffer record.
- */
-
-rtems_status_code rtems_clock_set(
- rtems_time_of_day *time_buffer
-);
-
-/*
- * rtems_clock_tick
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_clock_tick directive. It is invoked
- * to inform RTEMS of the occurrence of a clock tick.
- */
-
-rtems_status_code rtems_clock_tick( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/config.h b/cpukit/rtems/include/rtems/rtems/config.h
deleted file mode 100644
index f395710271..0000000000
--- a/cpukit/rtems/include/rtems/rtems/config.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* config.h
- *
- * This include file contains the table of user defined configuration
- * parameters specific for the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_CONFIGURATION_h
-#define __RTEMS_RTEMS_CONFIGURATION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/tasks.h>
-
-/*
- * The following records define the Configuration Table. The
- * information contained in this table is required in all
- * RTEMS systems, whether single or multiprocessor. This
- * table primarily defines the following:
- *
- * + required number of each object type
- */
-
-typedef struct {
- unsigned32 maximum_tasks;
- unsigned32 maximum_timers;
- unsigned32 maximum_semaphores;
- unsigned32 maximum_message_queues;
- unsigned32 maximum_partitions;
- unsigned32 maximum_regions;
- unsigned32 maximum_ports;
- unsigned32 maximum_periods;
- unsigned32 number_of_initialization_tasks;
- rtems_initialization_tasks_table *User_initialization_tasks_table;
-} rtems_api_configuration_table;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/dpmem.h b/cpukit/rtems/include/rtems/rtems/dpmem.h
deleted file mode 100644
index a74fc90f2a..0000000000
--- a/cpukit/rtems/include/rtems/rtems/dpmem.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/* dpmem.h
- *
- * This include file contains all the constants and structures associated
- * with the Dual Ported Memory Manager. This manager provides a mechanism
- * for converting addresses between internal and external representations
- * for multiple dual-ported memory areas.
- *
- * Directives provided are:
- *
- * + create a port
- * + get ID of a port
- * + delete a port
- * + convert external to internal address
- * + convert internal to external address
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_DUAL_PORTED_MEMORY_h
-#define __RTEMS_DUAL_PORTED_MEMORY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-
-/*
- * The following structure defines the port control block. Each port
- * has a control block associated with it. This control block contains
- * all information required to support the port related operations.
- */
-
-typedef struct {
- Objects_Control Object;
- void *internal_base; /* base internal address */
- void *external_base; /* base external address */
- unsigned32 length; /* length of dual-ported area */
-} Dual_ported_memory_Control;
-
-/*
- * The following define the internal Dual Ported Memory information.
- */
-
-RTEMS_EXTERN Objects_Information _Dual_ported_memory_Information;
-
-/*
- * _Dual_ported_memory_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Dual_ported_memory_Manager_initialization(
- unsigned32 maximum_ports
-);
-
-/*
- * rtems_port_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_port_create directive. The port
- * will have the name name. The port maps onto an area of dual ported
- * memory of length bytes which has internal_start and external_start
- * as the internal and external starting addresses, respectively.
- * It returns the id of the created port in ID.
- */
-
-rtems_status_code rtems_port_create(
- rtems_name name,
- void *internal_start,
- void *external_start,
- unsigned32 length,
- Objects_Id *id
-);
-
-/*
- * rtems_port_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_port_ident directive. This directive
- * returns the port ID associated with name. If more than one port is
- * named name, then the port to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_port_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_port_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_port_delete directive. It deletes
- * the port associated with ID.
- */
-
-rtems_status_code rtems_port_delete(
- Objects_Id id
-);
-
-/*
- * rtems_port_external_to_internal
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_port_external_to_internal directive.
- * It returns the internal port address which maps to the provided
- * external port address for the specified port ID.
- */
-
-rtems_status_code rtems_port_external_to_internal(
- Objects_Id id,
- void *external,
- void **internal
-);
-
-/*
- * rtems_port_internal_to_external
- *
- * DESCRIPTION:
- *
- * This routine implements the Port_internal_to_external directive.
- * It returns the external port address which maps to the provided
- * internal port address for the specified port ID.
- */
-
-rtems_status_code rtems_port_internal_to_external(
- Objects_Id id,
- void *internal,
- void **external
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/dpmem.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/event.h b/cpukit/rtems/include/rtems/rtems/event.h
deleted file mode 100644
index 48045bdade..0000000000
--- a/cpukit/rtems/include/rtems/rtems/event.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/* event.h
- *
- * This include file contains the information pertaining to the Event
- * Manager. This manager provides a high performance method of communication
- * and synchronization.
- *
- * Directives provided are:
- *
- * + send an event set to a task
- * + receive event condition
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_EVENT_h
-#define __RTEMS_EVENT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/rtems/eventset.h>
-
-/*
- * This constant is passed as the event_in to the
- * rtems_event_receive directive to determine which events are pending.
- */
-
-#define EVENT_CURRENT 0
-
-/*
- * The following enumerated types indicate what happened while the event
- * manager was in the synchronization window.
- */
-
-typedef enum {
- EVENT_SYNC_SYNCHRONIZED,
- EVENT_SYNC_NOTHING_HAPPENED,
- EVENT_SYNC_TIMEOUT,
- EVENT_SYNC_SATISFIED
-} Event_Sync_states;
-
-/*
- * Event_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Event_Manager_initialization( void );
-
-/*
- * rtems_event_send
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_event_send directive. It sends
- * event_in to the task specified by ID. If the task is blocked
- * waiting to receive events and the posting of event_in satisfies
- * the task's event condition, then it is unblocked.
- */
-
-rtems_status_code rtems_event_send (
- Objects_Id id,
- rtems_event_set event_in
-);
-
-/*
- * rtems_event_receive
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_event_receive directive. This
- * directive is invoked when the calling task wishes to receive
- * the event_in event condition. One of the fields in the option_set
- * parameter determines whether the receive request is satisfied if
- * any or all of the events are pending. If the event condition
- * is not satisfied immediately, then the task may block with an
- * optional timeout of TICKS clock ticks or return immediately.
- * This determination is based on another field in the option_set
- * parameter. This directive returns the events received in the
- * event_out parameter.
- */
-
-rtems_status_code rtems_event_receive (
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-);
-
-/*
- * _Event_Seize
- *
- * DESCRIPTION:
- *
- * This routine determines if the event condition event_in is
- * satisfied. If so or if the no_wait option is enabled in option_set,
- * then the procedure returns immediately. If neither of these
- * conditions is true, then the calling task is blocked with an
- * optional timeout of ticks clock ticks.
- */
-
-void _Event_Seize (
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-);
-
-/*
- * _Event_Surrender
- *
- * DESCRIPTION:
- *
- * This routine determines if the event condition of the_thread
- * has been satisfied. If so, it unblocks the_thread.
- */
-
-void _Event_Surrender (
- Thread_Control *the_thread
-);
-
-/*
- * _Event_Timeout
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task's event receive request
- * has not been satisfied after the specified timeout interval.
- * The task represented by ID will be unblocked and its status
- * code will be set in it's control block to indicate that a timeout
- * has occurred.
- */
-
-void _Event_Timeout (
- Objects_Id id,
- void *ignored
-);
-
-/*
- * The following defines the synchronization flag used by the
- * Event Manager to insure that signals sent to the currently
- * executing thread are received properly.
- */
-
-RTEMS_EXTERN volatile Event_Sync_states _Event_Sync_state;
-
-#include <rtems/rtems/eventmp.h>
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/event.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/eventmp.h b/cpukit/rtems/include/rtems/rtems/eventmp.h
deleted file mode 100644
index 2d609cbb37..0000000000
--- a/cpukit/rtems/include/rtems/rtems/eventmp.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* eventmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Event Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_EVENT_MP_h
-#define __RTEMS_EVENT_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/event.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote event operations.
- */
-
-typedef enum {
- EVENT_MP_SEND_REQUEST = 0,
- EVENT_MP_SEND_RESPONSE = 1
-} Event_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote event operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Event_MP_Remote_operations operation;
- rtems_event_set event_in;
-} Event_MP_Packet;
-
-/*
- * _Event_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- *
- * This routine is not needed since there are no process
- * packets to be sent by this manager.
- */
-
-/*
- * _Event_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Event_MP_Send_request_packet (
- Event_MP_Remote_operations operation,
- Objects_Id event_id,
- rtems_event_set event_in
-);
-
-/*
- * _Event_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Event_MP_Send_response_packet (
- Event_MP_Remote_operations operation,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Event_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Event_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Event_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _Event_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _Event_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a event mp packet.
- */
-
-Event_MP_Packet *_Event_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/cpukit/rtems/include/rtems/rtems/eventset.h b/cpukit/rtems/include/rtems/rtems/eventset.h
deleted file mode 100644
index fe1f9eb170..0000000000
--- a/cpukit/rtems/include/rtems/rtems/eventset.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* eventset.h
- *
- * This include file contains the information pertaining to the
- * Event Sets Handler. This handler provides methods for the manipulation
- * of event sets which will be sent and received by tasks.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_EVENT_SET_h
-#define __RTEMS_EVENT_SET_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following defines the type used to control event sets.
- */
-
-typedef unsigned32 rtems_event_set;
-
-/*
- * The following constants define the individual events which may
- * be used to compose an event set.
- */
-
-#define RTEMS_PENDING_EVENTS 0 /* receive pending events */
-#define RTEMS_ALL_EVENTS 0xFFFFFFFF
-
-#define RTEMS_EVENT_0 0x00000001
-#define RTEMS_EVENT_1 0x00000002
-#define RTEMS_EVENT_2 0x00000004
-#define RTEMS_EVENT_3 0x00000008
-#define RTEMS_EVENT_4 0x00000010
-#define RTEMS_EVENT_5 0x00000020
-#define RTEMS_EVENT_6 0x00000040
-#define RTEMS_EVENT_7 0x00000080
-#define RTEMS_EVENT_8 0x00000100
-#define RTEMS_EVENT_9 0x00000200
-#define RTEMS_EVENT_10 0x00000400
-#define RTEMS_EVENT_11 0x00000800
-#define RTEMS_EVENT_12 0x00001000
-#define RTEMS_EVENT_13 0x00002000
-#define RTEMS_EVENT_14 0x00004000
-#define RTEMS_EVENT_15 0x00008000
-#define RTEMS_EVENT_16 0x00010000
-#define RTEMS_EVENT_17 0x00020000
-#define RTEMS_EVENT_18 0x00040000
-#define RTEMS_EVENT_19 0x00080000
-#define RTEMS_EVENT_20 0x00100000
-#define RTEMS_EVENT_21 0x00200000
-#define RTEMS_EVENT_22 0x00400000
-#define RTEMS_EVENT_23 0x00800000
-#define RTEMS_EVENT_24 0x01000000
-#define RTEMS_EVENT_25 0x02000000
-#define RTEMS_EVENT_26 0x04000000
-#define RTEMS_EVENT_27 0x08000000
-#define RTEMS_EVENT_28 0x10000000
-#define RTEMS_EVENT_29 0x20000000
-#define RTEMS_EVENT_30 0x40000000
-#define RTEMS_EVENT_31 0x80000000
-
-
-/*
- * The following constant is the value of an event set which
- * has no events pending.
- */
-
-#define EVENT_SETS_NONE_PENDING 0
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/eventset.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/intr.h b/cpukit/rtems/include/rtems/rtems/intr.h
deleted file mode 100644
index 168806bff2..0000000000
--- a/cpukit/rtems/include/rtems/rtems/intr.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/* intr.h
- *
- * This include file contains all the constants and structures associated
- * with the Interrupt Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_INTERRUPT_h
-#define __RTEMS_INTERRUPT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/isr.h>
-
-/*
- * Interrupt level type
- */
-
-typedef ISR_Level rtems_interrupt_level;
-
-/*
- * The following type defines the control block used to manage
- * the vectors.
- */
-
-typedef ISR_Vector_number rtems_vector_number;
-
-/*
- * Return type for ISR Handler
- */
-
-typedef void rtems_isr;
-
-/*
- * Pointer to an ISR Handler
- */
-
-typedef rtems_isr ( *rtems_isr_entry )(
- rtems_vector_number
- );
-
-/*
- * _Interrupt_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the interrupt manager.
- *
- */
-
-void _Interrupt_Manager_initialization( void );
-
-/*
- * rtems_interrupt_catch
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_interrupt_catch directive. This
- * directive installs new_isr_handler as the RTEMS interrupt service
- * routine for vector. The previous RTEMS interrupt service
- * routine is returned in old_isr_handler.
- */
-
-rtems_status_code rtems_interrupt_catch(
- rtems_isr_entry new_isr_handler,
- rtems_vector_number vector,
- rtems_isr_entry *old_isr_handler
-);
-
-/*
- * rtems_interrupt_disable
- *
- * DESCRIPTION:
- *
- * This routine disables all maskable interrupts and returns the
- * previous level in _isr_cookie.
- */
-
-#define rtems_interrupt_disable( _isr_cookie ) \
- _ISR_Disable(_isr_cookie)
-
-/*
- * rtems_interrupt_enable
- *
- * DESCRIPTION:
- *
- * This routine enables maskable interrupts to the level indicated
- * _isr_cookie.
- */
-
-#define rtems_interrupt_enable( _isr_cookie ) \
- _ISR_Enable(_isr_cookie)
-
-/*
- * rtems_interrupt_flash
- *
- * DESCRIPTION:
- *
- * This routine temporarily enables maskable interrupts to the
- * level in _isr_cookie before redisabling them.
- */
-
-#define rtems_interrupt_flash( _isr_cookie ) \
- _ISR_Flash(_isr_cookie)
-
-/*
- * rtems_interrupt_is_in_progress
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the processor is currently servicing
- * an interrupt and FALSE otherwise. A return value of TRUE indicates
- * that the caller is an interrupt service routine, NOT a thread. The
- * directives available to an interrupt service routine are restricted.
- */
-
-#define rtems_interrupt_is_in_progress() \
- _ISR_Is_in_progress()
-
-/*
- * rtems_interrupt_cause
- *
- * DESCRIPTION:
- *
- * This routine generates an interrupt.
- *
- * NOTE: No implementation.
- */
-
-#define rtems_interrupt_cause( _interrupt_to_cause )
-
-/*
- * rtems_interrupt_cause
- *
- * DESCRIPTION:
- *
- * This routine clears the specified interrupt.
- *
- * NOTE: No implementation.
- */
-
-#define rtems_interrupt_clear( _interrupt_to_clear )
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/message.h b/cpukit/rtems/include/rtems/rtems/message.h
deleted file mode 100644
index 611d46fde8..0000000000
--- a/cpukit/rtems/include/rtems/rtems/message.h
+++ /dev/null
@@ -1,334 +0,0 @@
-/* message.h
- *
- * This include file contains all the constants and structures associated
- * with the Message Queue Manager. This manager provides a mechanism for
- * communication and synchronization between tasks using messages.
- *
- * Directives provided are:
- *
- * + create a queue
- * + get ID of a queue
- * + delete a queue
- * + put a message at the rear of a queue
- * + put a message at the front of a queue
- * + broadcast N messages to a queue
- * + receive message from a queue
- * + flush all messages on a queue
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MESSAGE_QUEUE_h
-#define __RTEMS_MESSAGE_QUEUE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/coremsg.h>
-
-/*
- * The following enumerated type details the modes in which a message
- * may be submitted to a message queue. The message may be posted
- * in a send or urgent fashion.
- */
-
-typedef enum {
- MESSAGE_QUEUE_SEND_REQUEST = 0,
- MESSAGE_QUEUE_URGENT_REQUEST = 1
-} Message_queue_Submit_types;
-
-/*
- * The following records define the control block used to manage
- * each message queue.
- */
-
-typedef struct {
- Objects_Control Object;
- rtems_attribute attribute_set;
- CORE_message_queue_Control message_queue;
-} Message_queue_Control;
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Message_queue_Information;
-
-/*
- * _Message_queue_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Message_queue_Manager_initialization(
- unsigned32 maximum_message_queues
-);
-
-/*
- * rtems_message_queue_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_create directive. The
- * message queue will have the name name. If the attribute_set indicates
- * that the message queue is to be limited in the number of messages
- * that can be outstanding, then count indicates the maximum number of
- * messages that will be held. It returns the id of the created
- * message queue in ID.
- */
-
-rtems_status_code rtems_message_queue_create(
- rtems_name name,
- unsigned32 count,
- unsigned32 max_message_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-);
-
-/*
- * rtems_message_queue_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_ident directive.
- * This directive returns the message queue ID associated with NAME.
- * If more than one message queue is named name, then the message
- * queue to which the ID belongs is arbitrary. node indicates the
- * extent of the search for the ID of the message queue named name.
- * The search can be limited to a particular node or allowed to
- * encompass all nodes.
- */
-
-rtems_status_code rtems_message_queue_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-);
-
-/*
- * rtems_message_queue_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_delete directive. The
- * message queue indicated by ID is deleted.
- */
-
-rtems_status_code rtems_message_queue_delete(
- Objects_Id id
-);
-
-/*
- * rtems_message_queue_send
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_send directive.
- * This directive sends the message buffer to the message queue
- * indicated by ID. If one or more tasks is blocked waiting
- * to receive a message from this message queue, then one will
- * receive the message. The task selected to receive the
- * message is based on the task queue discipline algorithm in
- * use by this particular message queue. If no tasks are waiting,
- * then the message buffer will be placed at the rear of the
- * chain of pending messages for this message queue.
- */
-
-rtems_status_code rtems_message_queue_send(
- Objects_Id id,
- void *buffer,
- unsigned32 size
-);
-
-/*
- * rtems_message_queue_urgent
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_send directive.
- * This directive sends the message buffer to the message queue
- * indicated by ID. If one or more tasks is blocked waiting
- * to receive a message from this message queue, then one will
- * receive the message. The task selected to receive the
- * message is based on the task queue discipline algorithm in
- * use by this particular message queue. If no tasks are waiting,
- * then the message buffer will be placed at the rear of the
- * chain of pending messages for this message queue.
- */
-
-rtems_status_code rtems_message_queue_urgent(
- Objects_Id id,
- void *buffer,
- unsigned32 size
-);
-
-/*
- * rtems_message_queue_broadcast
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_send directive.
- * This directive sends the message buffer to the message queue
- * indicated by ID. If one or more tasks is blocked waiting
- * to receive a message from this message queue, then one will
- * receive the message. The task selected to receive the
- * message is based on the task queue discipline algorithm in
- * use by this particular message queue. If no tasks are waiting,
- * then the message buffer will be placed at the rear of the
- * chain of pending messages for this message queue.
- */
-
-rtems_status_code rtems_message_queue_broadcast(
- Objects_Id id,
- void *buffer,
- unsigned32 size,
- unsigned32 *count
-);
-
-/*
- * rtems_message_queue_receive
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_receive directive.
- * This directive is invoked when the calling task wishes to receive
- * a message from the message queue indicated by ID. The received
- * message is to be placed in buffer. If no messages are outstanding
- * and the option_set indicates that the task is willing to block,
- * then the task will be blocked until a message arrives or until,
- * optionally, timeout clock ticks have passed.
- */
-
-rtems_status_code rtems_message_queue_receive(
- Objects_Id id,
- void *buffer,
- unsigned32 *size,
- unsigned32 option_set,
- rtems_interval timeout
-);
-
-/*
- * rtems_message_queue_flush
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_flush directive.
- * This directive takes all outstanding messages for the message
- * queue indicated by ID and returns them to the inactive message
- * chain. The number of messages flushed is returned in COUNT.
- */
-
-rtems_status_code rtems_message_queue_flush(
- Objects_Id id,
- unsigned32 *count
-);
-
-/*
- * rtems_message_queue_get_number_pending
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_message_queue_get_number_pending
- * directive. This directive returns the number of pending
- * messages for the message queue indicated by ID
- * chain. The number of messages pending is returned in COUNT.
- */
-
-rtems_status_code rtems_message_queue_get_number_pending(
- Objects_Id id,
- unsigned32 *count
-);
-
-
-/*
- * _Message_queue_Submit
- *
- * DESCRIPTION:
- *
- * This routine implements the directives rtems_message_queue_send
- * and rtems_message_queue_urgent. It processes a message that is
- * to be submitted to the designated message queue. The message will
- * either be processed as a send send message which it will be inserted
- * at the rear of the queue or it will be processed as an urgent message
- * which will be inserted at the front of the queue.
- */
-
-rtems_status_code _Message_queue_Submit(
- Objects_Id id,
- void *buffer,
- unsigned32 size,
- Message_queue_Submit_types submit_type
-);
-
-/*
- * _Message_queue_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a message queue control block from
- * the inactive chain of free message queue control blocks.
- */
-
-Message_queue_Control *_Message_queue_Allocate (
- unsigned32 count,
- unsigned32 max_message_size
-);
-
-/*
- * _Message_queue_Translate_core_message_queue_return_code
- *
- * DESCRIPTION:
- *
- * This function returns a RTEMS status code based on the core message queue
- * status code specified.
- */
-
-rtems_status_code _Message_queue_Translate_core_message_queue_return_code (
- unsigned32 the_message_queue_status
-);
-
-/*
- *
- * _Message_queue_Core_message_queue_mp_support
- *
- * Input parameters:
- * the_thread - the remote thread the message was submitted to
- * id - id of the message queue
- *
- * Output parameters: NONE
- */
-
-void _Message_queue_Core_message_queue_mp_support (
- Thread_Control *the_thread,
- Objects_Id id
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/message.inl>
-#endif
-#include <rtems/rtems/msgmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/modes.h b/cpukit/rtems/include/rtems/rtems/modes.h
deleted file mode 100644
index 05205078c5..0000000000
--- a/cpukit/rtems/include/rtems/rtems/modes.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* modes.h
- *
- * This include file contains all constants and structures associated
- * with the RTEMS thread and RTEMS_ASR modes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MODES_h
-#define __RTEMS_MODES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/isr.h>
-
-/*
- * The following type defines the control block used to manage
- * each a mode set.
- */
-
-typedef unsigned32 Modes_Control;
-
-/*
- * The following constants define the individual modes and masks
- * which may be used to compose a mode set and to alter modes.
- */
-
-#define RTEMS_ALL_MODE_MASKS 0x0000ffff
-
-#define RTEMS_DEFAULT_MODES 0x00000000
-#define RTEMS_CURRENT_MODE 0
-
-#define RTEMS_PREEMPT_MASK 0x00000100 /* preemption bit */
-#define RTEMS_TIMESLICE_MASK 0x00000200 /* timeslice bit */
-#define RTEMS_ASR_MASK 0x00000400 /* RTEMS_ASR enable bit */
-#define RTEMS_INTERRUPT_MASK CPU_MODES_INTERRUPT_MASK
-
-#define RTEMS_PREEMPT 0x00000000 /* enable preemption */
-#define RTEMS_NO_PREEMPT 0x00000100 /* disable preemption */
-
-#define RTEMS_NO_TIMESLICE 0x00000000 /* disable timeslicing */
-#define RTEMS_TIMESLICE 0x00000200 /* enable timeslicing */
-
-#define RTEMS_ASR 0x00000000 /* enable RTEMS_ASR */
-#define RTEMS_NO_ASR 0x00000400 /* disable RTEMS_ASR */
-
-/*
- * The number of bits for interrupt levels is CPU dependent.
- * RTEMS supports 0 to 256 levels in bits 0-7 of the mode.
- */
-
-/*PAGE
- *
- * RTEMS_INTERRUPT_LEVEL
- *
- * DESCRIPTION:
- *
- * This function returns the processor dependent interrupt
- * level which corresponds to the requested interrupt level.
- *
- * NOTE: RTEMS supports 256 interrupt levels using the least
- * significant eight bits of MODES.CONTROL. On any
- * particular CPU, fewer than 256 levels may be supported.
- */
-
-#define RTEMS_INTERRUPT_LEVEL( _mode_set ) \
- ( (_mode_set) & RTEMS_INTERRUPT_MASK )
-
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/modes.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/mp.h b/cpukit/rtems/include/rtems/rtems/mp.h
deleted file mode 100644
index 77dd8a707f..0000000000
--- a/cpukit/rtems/include/rtems/rtems/mp.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* mp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MP_h
-#define __RTEMS_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- *
- * _Multiprocessing_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Multiprocessing_Manager_initialization ( void );
-
-/*
- *
- * rtems_multiprocessing_announce
- *
- * DESCRIPTION:
- *
- * This routine implements the MULTIPROCESSING_ANNOUNCE directive.
- * It is invoked by the MPCI layer to indicate that an MPCI packet
- * has been received.
- */
-
-void rtems_multiprocessing_announce ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/msgmp.h b/cpukit/rtems/include/rtems/rtems/msgmp.h
deleted file mode 100644
index 64fa8da93b..0000000000
--- a/cpukit/rtems/include/rtems/rtems/msgmp.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/* msgmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Message Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MESSAGE_QUEUE_MP_h
-#define __RTEMS_MESSAGE_QUEUE_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/message.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote message queue operations.
- */
-
-typedef enum {
- MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0,
- MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1,
- MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2,
- MESSAGE_QUEUE_MP_RECEIVE_REQUEST = 3,
- MESSAGE_QUEUE_MP_RECEIVE_RESPONSE = 4,
- MESSAGE_QUEUE_MP_SEND_REQUEST = 5,
- MESSAGE_QUEUE_MP_SEND_RESPONSE = 6,
- MESSAGE_QUEUE_MP_URGENT_REQUEST = 7,
- MESSAGE_QUEUE_MP_URGENT_RESPONSE = 8,
- MESSAGE_QUEUE_MP_BROADCAST_REQUEST = 9,
- MESSAGE_QUEUE_MP_BROADCAST_RESPONSE = 10,
- MESSAGE_QUEUE_MP_FLUSH_REQUEST = 11,
- MESSAGE_QUEUE_MP_FLUSH_RESPONSE = 12,
- MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST = 13,
- MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE = 14
-} Message_queue_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote message queue operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Message_queue_MP_Remote_operations operation;
- rtems_name name;
- rtems_option option_set;
- Objects_Id proxy_id;
- unsigned32 count;
- unsigned32 size;
- unsigned32 pad0;
- CORE_message_queue_Buffer Buffer;
-} Message_queue_MP_Packet;
-
-/*
- * _Message_queue_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _Message_queue_MP_Send_process_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- rtems_name name,
- Objects_Id proxy_id
-);
-
-/*
- * _Message_queue_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Message_queue_MP_Send_request_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- void *buffer,
- unsigned32 *size_p,
- rtems_option option_set,
- Watchdog_Interval timeout
-);
-
-/*
- * _Message_queue_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Message_queue_MP_Send_response_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Message_queue_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Message_queue_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Message_queue_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _Message_queue_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _Message_queue_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _Message_queue_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _Message_queue_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a message queue mp packet.
- */
-
-Message_queue_MP_Packet *_Message_queue_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/cpukit/rtems/include/rtems/rtems/options.h b/cpukit/rtems/include/rtems/rtems/options.h
deleted file mode 100644
index 7746524f98..0000000000
--- a/cpukit/rtems/include/rtems/rtems/options.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* options.h
- *
- * This include file contains information which defines the
- * options available on many directives.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_OPTIONS_h
-#define __RTEMS_OPTIONS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type defines the control block used to manage
- * option sets.
- */
-
-typedef unsigned32 rtems_option;
-
-/*
- * The following constants define the individual options which may
- * be used to compose an option set.
- */
-
-#define RTEMS_DEFAULT_OPTIONS 0x00000000
-
-#define RTEMS_WAIT 0x00000000 /* wait on resource */
-#define RTEMS_NO_WAIT 0x00000001 /* do not wait on resource */
-
-#define RTEMS_EVENT_ALL 0x00000000 /* wait for all events */
-#define RTEMS_EVENT_ANY 0x00000002 /* wait on any event */
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/options.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/part.h b/cpukit/rtems/include/rtems/rtems/part.h
deleted file mode 100644
index 1d720db146..0000000000
--- a/cpukit/rtems/include/rtems/rtems/part.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/* partition.h
- *
- * This include file contains all the constants and structures associated
- * with the Partition Manager. This manager provides facilities to
- * dynamically allocate memory in fixed-sized units which are returned
- * as buffers.
- *
- * Directives provided are:
- *
- * + create a partition
- * + get an ID of a partition
- * + delete a partition
- * + get a buffer from a partition
- * + return a buffer to a partition
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_PARTITION_h
-#define __RTEMS_PARTITION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/address.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/rtems/types.h>
-
-/*
- * The following defines the control block used to manage each partition.
- */
-
-typedef struct {
- Objects_Control Object;
- void *starting_address; /* physical address */
- unsigned32 length; /* in bytes */
- unsigned32 buffer_size; /* in bytes */
- rtems_attribute attribute_set; /* attributes */
- unsigned32 number_of_used_blocks; /* or allocated buffers */
- Chain_Control Memory; /* buffer chain */
-} Partition_Control;
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Partition_Information;
-
-/*
- * _Partition_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Partition_Manager_initialization(
- unsigned32 maximum_partitions
-);
-
-/*
- * rtems_partition_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_create directive. The
- * partition will have the name name. The memory area managed by
- * the partition is of length bytes and starts at starting_address.
- * The memory area will be divided into as many buffers of
- * buffer_size bytes as possible. The attribute_set determines if
- * the partition is global or local. It returns the id of the
- * created partition in ID.
- */
-
-rtems_status_code rtems_partition_create(
- rtems_name name,
- void *starting_address,
- unsigned32 length,
- unsigned32 buffer_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-);
-
-/*
- * rtems_partition_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_ident directive.
- * This directive returns the partition ID associated with name.
- * If more than one partition is named name, then the partition
- * to which the ID belongs is arbitrary. node indicates the
- * extent of the search for the ID of the partition named name.
- * The search can be limited to a particular node or allowed to
- * encompass all nodes.
- */
-
-rtems_status_code rtems_partition_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-);
-
-/*
- * rtems_partition_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_delete directive. The
- * partition indicated by ID is deleted.
- */
-
-rtems_status_code rtems_partition_delete(
- Objects_Id id
-);
-
-/*
- * rtems_partition_get_buffer
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_get_buffer directive. It
- * attempts to allocate a buffer from the partition associated with ID.
- * If a buffer is allocated, its address is returned in buffer.
- */
-
-rtems_status_code rtems_partition_get_buffer(
- Objects_Id id,
- void **buffer
-);
-
-/*
- * rtems_partition_return_buffer
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_partition_return_buffer directive. It
- * frees the buffer to the partition associated with ID. The buffer must
- * have been previously allocated from the same partition.
- */
-
-rtems_status_code rtems_partition_return_buffer(
- Objects_Id id,
- void *buffer
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/part.inl>
-#endif
-#include <rtems/rtems/partmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/partmp.h b/cpukit/rtems/include/rtems/rtems/partmp.h
deleted file mode 100644
index 0bac39258b..0000000000
--- a/cpukit/rtems/include/rtems/rtems/partmp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* partmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Partition Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_PARTITION_MP_h
-#define __RTEMS_PARTITION_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/thread.h>
-
-#include <rtems/rtems/part.h>
-
-/*
- * The following enumerated type defines the list of
- * remote partition operations.
- */
-
-typedef enum {
- PARTITION_MP_ANNOUNCE_CREATE = 0,
- PARTITION_MP_ANNOUNCE_DELETE = 1,
- PARTITION_MP_EXTRACT_PROXY = 2,
- PARTITION_MP_GET_BUFFER_REQUEST = 3,
- PARTITION_MP_GET_BUFFER_RESPONSE = 4,
- PARTITION_MP_RETURN_BUFFER_REQUEST = 5,
- PARTITION_MP_RETURN_BUFFER_RESPONSE = 6
-} Partition_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote partition operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Partition_MP_Remote_operations operation;
- rtems_name name;
- void *buffer;
- Objects_Id proxy_id;
-} Partition_MP_Packet;
-
-/*
- * _Partition_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _Partition_MP_Send_process_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- rtems_name name,
- Objects_Id proxy_id
-);
-
-/*
- * _Partition_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Partition_MP_Send_request_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- void *buffer
-);
-
-/*
- * _Partition_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Partition_MP_Send_response_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Partition_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Partition_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Partition_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed by the Partition since a partition
- * cannot be deleted when buffers are in use.
- */
-
-/*
- * _Partition_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _Partition_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _Partition_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a partition mp packet.
- */
-
-Partition_MP_Packet *_Partition_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/cpukit/rtems/include/rtems/rtems/ratemon.h b/cpukit/rtems/include/rtems/rtems/ratemon.h
deleted file mode 100644
index 0e1dfbfad3..0000000000
--- a/cpukit/rtems/include/rtems/rtems/ratemon.h
+++ /dev/null
@@ -1,213 +0,0 @@
-/* ratemon.h
- *
- * This include file contains all the constants, structures, and
- * prototypes associated with the Rate Monotonic Manager. This manager
- * provides facilities to implement tasks which execute in a periodic fashion.
- *
- * Directives provided are:
- *
- * + create a rate monotonic timer
- * + cancel a period
- * + delete a rate monotonic timer
- * + conclude current and start the next period
- * + obtain status information on a period
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RATE_MONOTONIC_h
-#define __RTEMS_RATE_MONOTONIC_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the states in which a
- * period may be.
- */
-
-typedef enum {
- RATE_MONOTONIC_INACTIVE, /* off chain, never initialized */
- RATE_MONOTONIC_OWNER_IS_BLOCKING, /* on chain, owner is blocking on it */
- RATE_MONOTONIC_ACTIVE, /* on chain, running continuously */
- RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING, /* on chain, expired while owner was */
- /* was blocking on it */
- RATE_MONOTONIC_EXPIRED /* off chain, will be reset by next */
- /* rtems_rate_monotonic_period */
-} rtems_rate_monotonic_period_states;
-
-/*
- * The following constant is the interval passed to the rate_monontonic_period
- * directive to obtain status information.
- */
-
-#define RTEMS_PERIOD_STATUS WATCHDOG_NO_TIMEOUT
-
-/*
- * The following defines the period status structure.
- */
-
-typedef struct {
- rtems_rate_monotonic_period_states state;
- unsigned32 ticks_since_last_period;
- unsigned32 ticks_executed_since_last_period;
-} rtems_rate_monotonic_period_status;
-
-/*
- * The following structure defines the control block used to manage
- * each period.
- */
-
-typedef struct {
- Objects_Control Object;
- Watchdog_Control Timer;
- rtems_rate_monotonic_period_states state;
- unsigned32 owner_ticks_executed_at_period;
- unsigned32 time_at_period;
- Thread_Control *owner;
-} Rate_monotonic_Control;
-
-RTEMS_EXTERN Objects_Information _Rate_monotonic_Information;
-
-/*
- * _Rate_monotonic_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Rate_monotonic_Manager_initialization(
- unsigned32 maximum_periods
-);
-
-/*
- * rtems_rate_monotonic_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rate_monotonic_create directive. The
- * period will have the name name. It returns the id of the
- * created period in ID.
- */
-
-rtems_status_code rtems_rate_monotonic_create(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_rate_monotonic_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_ident directive.
- * This directive returns the period ID associated with name.
- * If more than one period is named name, then the period
- * to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_rate_monotonic_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_rate_monotonic_cancel
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_cancel directive. This
- * directive stops the period associated with ID from continuing to
- * run.
- */
-
-rtems_status_code rtems_rate_monotonic_cancel(
- Objects_Id id
-);
-
-/*
- * rtems_rate_monotonic_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_delete directive. The
- * period indicated by ID is deleted.
- */
-
-rtems_status_code rtems_rate_monotonic_delete(
- Objects_Id id
-);
-
-/*
- * rtems_rate_monotonic_get_status
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_get_status directive.
- * Information about the period indicated by ID is returned.
- *
- */
-
-rtems_status_code rtems_rate_monotonic_get_status(
- Objects_Id id,
- rtems_rate_monotonic_period_status *status
-);
-
-/*
- * rtems_rate_monotonic_period
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_rate_monotonic_period directive. When
- * length is non-zero, this directive initiates the period associated with
- * ID from continuing for a period of length. If length is zero, then
- * result is set to indicate the current state of the period.
- */
-
-rtems_status_code rtems_rate_monotonic_period(
- Objects_Id id,
- rtems_interval length
-);
-
-/*
- * _Rate_monotonic_Timeout
- *
- * DESCRIPTION:
- *
- * This routine is invoked when the period represented
- * by ID expires. If the task which owns this period is blocked
- * waiting for the period to expire, then it is readied and the
- * period is restarted. If the owning task is not waiting for the
- * period to expire, then the period is placed in the EXPIRED
- * state and not restarted.
- */
-
-void _Rate_monotonic_Timeout (
- Objects_Id id,
- void *ignored
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/ratemon.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/region.h b/cpukit/rtems/include/rtems/rtems/region.h
deleted file mode 100644
index 05418f6a95..0000000000
--- a/cpukit/rtems/include/rtems/rtems/region.h
+++ /dev/null
@@ -1,234 +0,0 @@
-/* region.h
- *
- * This include file contains all the constants and structures associated
- * with the Region Manager. This manager provides facilities to dynamically
- * allocate memory in variable sized units which are returned as segments.
- *
- * Directives provided are:
- *
- * + create a region
- * + get an ID of a region
- * + delete a region
- * + get a segment from a region
- * + return a segment to a region
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_REGION_h
-#define __RTEMS_REGION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/heap.h>
-#include <rtems/debug.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/rtems/types.h>
-
-/*
- * The following records define the control block used to manage
- * each region.
- */
-
-typedef struct {
- Objects_Control Object;
- Thread_queue_Control Wait_queue; /* waiting threads */
- void *starting_address; /* physical start addr */
- unsigned32 length; /* physical length(bytes) */
- unsigned32 page_size; /* in bytes */
- unsigned32 maximum_segment_size; /* in bytes */
- rtems_attribute attribute_set;
- unsigned32 number_of_used_blocks; /* blocks allocated */
- Heap_Control Memory;
-} Region_Control;
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Region_Information;
-
-/*
- * _Region_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Region_Manager_initialization(
- unsigned32 maximum_regions
-);
-
-/*
- * rtems_region_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_create directive. The
- * region will have the name name. The memory area managed by
- * the region is of length bytes and starts at starting_address.
- * The memory area will be divided into as many allocatable units of
- * page_size bytes as possible. The attribute_set determines which
- * thread queue discipline is used by the region. It returns the
- * id of the created region in ID.
- */
-
-rtems_status_code rtems_region_create(
- rtems_name name,
- void *starting_address,
- unsigned32 length,
- unsigned32 page_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-);
-
-/*
- * rtems_region_extend
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_extend directive. The
- * region will have the name name. The memory area managed by
- * the region will be attempted to be grown by length bytes using
- * the memory starting at starting_address.
- */
-
-rtems_status_code rtems_region_extend(
- Objects_Id id,
- void *starting_address,
- unsigned32 length
-);
-
-/*
- * rtems_region_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_ident directive.
- * This directive returns the region ID associated with name.
- * If more than one region is named name, then the region
- * to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_region_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_region_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_delete directive. The
- * region indicated by ID is deleted.
- */
-
-rtems_status_code rtems_region_delete(
- Objects_Id id
-);
-
-/*
- * rtems_region_get_segment
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_get_segment directive. It
- * attempts to allocate a segment from the region associated with ID.
- * If a segment of the requested size can be allocated, its address
- * is returned in segment. If no segment is available, then the task
- * may return immediately or block waiting for a segment with an optional
- * timeout of timeout clock ticks. Whether the task blocks or returns
- * immediately is based on the no_wait option in the option_set.
- */
-
-rtems_status_code rtems_region_get_segment(
- Objects_Id id,
- unsigned32 size,
- rtems_option option_set,
- rtems_interval timeout,
- void **segment
-);
-
-/*
- * rtems_region_get_segment_size
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_get_segment_size directive. It
- * returns the size in bytes of the specified user memory area.
- */
-
-rtems_status_code rtems_region_get_segment_size(
- Objects_Id id,
- void *segment,
- unsigned32 *size
-);
-
-/*
- * rtems_region_return_segment
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_region_return_segment directive. It
- * frees the segment to the region associated with ID. The segment must
- * have been previously allocated from the same region. If freeing the
- * segment results in enough memory being available to satisfy the
- * rtems_region_get_segment of the first blocked task, then that task and as
- * many subsequent tasks as possible will be unblocked with their requests
- * satisfied.
- */
-
-rtems_status_code rtems_region_return_segment(
- Objects_Id id,
- void *segment
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/region.inl>
-#endif
-#include <rtems/rtems/regionmp.h>
-
-/*
- * _Region_Debug_Walk
- *
- * DESCRIPTION:
- *
- * This routine is invoked to verify the integrity of a heap associated
- * with the_region.
- */
-
-#ifdef RTEMS_DEBUG
-
-#define _Region_Debug_Walk( _the_region, _source ) \
- do { \
- if ( _Debug_Is_enabled( RTEMS_DEBUG_REGION ) ) \
- _Heap_Walk( &(_the_region)->Memory, _source, FALSE ); \
- } while ( 0 )
-
-#else
-
-#define _Region_Debug_Walk( _the_region, _source )
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/regionmp.h b/cpukit/rtems/include/rtems/rtems/regionmp.h
deleted file mode 100644
index fcdfa03178..0000000000
--- a/cpukit/rtems/include/rtems/rtems/regionmp.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/* regionmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Region Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_REGION_MP_h
-#define __RTEMS_REGION_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/region.h>
-
-/*
- * The following enumerated type defines the list of
- * remote region operations.
- */
-
-typedef enum {
- REGION_MP_ANNOUNCE_CREATE = 0,
- REGION_MP_ANNOUNCE_DELETE = 1,
- REGION_MP_EXTRACT_PROXY = 2,
- REGION_MP_GET_SEGMENT_REQUEST = 3,
- REGION_MP_GET_SEGMENT_RESPONSE = 4,
- REGION_MP_RETURN_SEGMENT_REQUEST = 5,
- REGION_MP_RETURN_SEGMENT_RESPONSE = 6
-} Region_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote region operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Region_MP_Remote_operations operation;
- rtems_name name;
- rtems_option option_set;
- unsigned32 size;
- Objects_Id proxy_id;
- void *segment;
-} Region_MP_Packet;
-
-/*
- * _Region_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _Region_MP_Send_process_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- rtems_name name,
- Objects_Id proxy_id
-);
-
-/*
- * _Region_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Region_MP_Send_request_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- void *segment,
- unsigned32 size,
- rtems_option option_set,
- rtems_interval timeout
-);
-
-/*
- * _Region_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Region_MP_Send_response_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Region_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Region_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Region_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed by the Region since a region
- * cannot be deleted when segments are in use.
- */
-
-/*
- * _Region_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _Region_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _Region_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a region mp packet.
- */
-
-Region_MP_Packet *_Region_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/cpukit/rtems/include/rtems/rtems/rtemsapi.h b/cpukit/rtems/include/rtems/rtems/rtemsapi.h
deleted file mode 100644
index dcea660f43..0000000000
--- a/cpukit/rtems/include/rtems/rtems/rtemsapi.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * RTEMS API Support
- *
- * NOTE:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_API_h
-#define __RTEMS_API_h
-
-#include <rtems/config.h>
-
-/*PAGE
- *
- * _RTEMS_API_Initialize
- *
- * XXX
- */
-
-void _RTEMS_API_Initialize(
- rtems_configuration_table *configuration_table
-);
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/sem.h b/cpukit/rtems/include/rtems/rtems/sem.h
deleted file mode 100644
index 191e62b414..0000000000
--- a/cpukit/rtems/include/rtems/rtems/sem.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/* semaphore.h
- *
- * This include file contains all the constants and structures associated
- * with the Semaphore Manager. This manager utilizes standard Dijkstra
- * counting semaphores to provide synchronization and mutual exclusion
- * capabilities.
- *
- * Directives provided are:
- *
- * + create a semaphore
- * + get an ID of a semaphore
- * + delete a semaphore
- * + acquire a semaphore
- * + release a semaphore
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SEMAPHORE_h
-#define __RTEMS_SEMAPHORE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/score/coremutex.h>
-#include <rtems/score/object.h>
-#include <rtems/score/coresem.h>
-#include <rtems/score/threadq.h>
-
-/*
- * The following defines the control block used to manage each semaphore.
- */
-
-typedef struct {
- Objects_Control Object;
- rtems_attribute attribute_set;
- union {
- CORE_mutex_Control mutex;
- CORE_semaphore_Control semaphore;
- } Core_control;
-} Semaphore_Control;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Semaphore_Information;
-
-/*
- * _Semaphore_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Semaphore_Manager_initialization(
- unsigned32 maximum_semaphores
-);
-
-/*
- * rtems_semaphore_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_create directive. The
- * semaphore will have the name name. The starting count for
- * the semaphore is count. The attribute_set determines if
- * the semaphore is global or local and the thread queue
- * discipline. It returns the id of the created semaphore in ID.
- */
-
-rtems_status_code rtems_semaphore_create(
- rtems_name name,
- unsigned32 count,
- rtems_attribute attribute_set,
- rtems_task_priority priority_ceiling,
- rtems_id *id
-);
-
-/*
- * rtems_semaphore_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_ident directive.
- * This directive returns the semaphore ID associated with name.
- * If more than one semaphore is named name, then the semaphore
- * to which the ID belongs is arbitrary. node indicates the
- * extent of the search for the ID of the semaphore named name.
- * The search can be limited to a particular node or allowed to
- * encompass all nodes.
- */
-
-rtems_status_code rtems_semaphore_ident(
- rtems_name name,
- unsigned32 node,
- rtems_id *id
-);
-
-/*
- * rtems_semaphore_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_delete directive. The
- * semaphore indicated by ID is deleted.
- */
-
-rtems_status_code rtems_semaphore_delete(
- rtems_id id
-);
-
-/*
- * rtems_semaphore_obtain
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_obtain directive. It
- * attempts to obtain a unit from the semaphore associated with ID.
- * If a unit can be allocated, the calling task will return immediately.
- * If no unit is available, then the task may return immediately or
- * block waiting for a unit with an optional timeout of timeout
- * clock ticks. Whether the task blocks or returns immediately
- * is based on the RTEMS_NO_WAIT option in the option_set.
- */
-
-rtems_status_code rtems_semaphore_obtain(
- rtems_id id,
- unsigned32 option_set,
- rtems_interval timeout
-);
-
-/*
- * rtems_semaphore_release
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_semaphore_release directive. It
- * frees a unit to the semaphore associated with ID. If a task was
- * blocked waiting for a unit from this semaphore, then that task will
- * be readied and the unit given to that task. Otherwise, the unit
- * will be returned to the semaphore.
- */
-
-rtems_status_code rtems_semaphore_release(
- rtems_id id
-);
-
-/*
- * _Semaphore_Seize
- *
- * DESCRIPTION:
- *
- * This routine attempts to receive a unit from the_semaphore.
- * If a unit is available or if the RTEMS_NO_WAIT option is enabled in
- * option_set, then the routine returns. Otherwise, the calling task
- * is blocked until a unit becomes available.
- */
-
-boolean _Semaphore_Seize(
- Semaphore_Control *the_semaphore,
- unsigned32 option_set
-);
-
-/*
- * _Semaphore_Translate_core_mutex_return_code
- *
- * DESCRIPTION:
- *
- * This function returns a RTEMS status code based on the mutex
- * status code specified.
- */
-
-rtems_status_code _Semaphore_Translate_core_mutex_return_code (
- unsigned32 the_mutex_status
-);
-
-/*
- * _Semaphore_Translate_core_semaphore_return_code
- *
- * DESCRIPTION:
- *
- * This function returns a RTEMS status code based on the semaphore
- * status code specified.
- */
-
-rtems_status_code _Semaphore_Translate_core_semaphore_return_code (
- unsigned32 the_mutex_status
-);
-
-/*PAGE
- *
- * _Semaphore_Core_mutex_mp_support
- *
- * DESCRIPTION:
- *
- * This function processes the global actions necessary for remote
- * accesses to a global semaphore based on a core mutex. This function
- * is called by the core.
- */
-
-void _Semaphore_Core_mutex_mp_support (
- Thread_Control *the_thread,
- rtems_id id
-);
-
-/*PAGE
- *
- * _Semaphore_Core_mp_support
- *
- * DESCRIPTION:
- *
- * This function processes the global actions necessary for remote
- * accesses to a global semaphore based on a core semaphore. This function
- * is called by the core.
- */
-
-void _Semaphore_Core_semaphore_mp_support (
- Thread_Control *the_thread,
- rtems_id id
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/sem.inl>
-#endif
-#include <rtems/rtems/semmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/semmp.h b/cpukit/rtems/include/rtems/rtems/semmp.h
deleted file mode 100644
index fdea66f6a4..0000000000
--- a/cpukit/rtems/include/rtems/rtems/semmp.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/* semmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Semaphore Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SEMAPHORE_MP_h
-#define __RTEMS_SEMAPHORE_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote semaphore operations.
- */
-
-typedef enum {
- SEMAPHORE_MP_ANNOUNCE_CREATE = 0,
- SEMAPHORE_MP_ANNOUNCE_DELETE = 1,
- SEMAPHORE_MP_EXTRACT_PROXY = 2,
- SEMAPHORE_MP_OBTAIN_REQUEST = 3,
- SEMAPHORE_MP_OBTAIN_RESPONSE = 4,
- SEMAPHORE_MP_RELEASE_REQUEST = 5,
- SEMAPHORE_MP_RELEASE_RESPONSE = 6
-} Semaphore_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote semaphore operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Semaphore_MP_Remote_operations operation;
- rtems_name name;
- rtems_option option_set;
- Objects_Id proxy_id;
-} Semaphore_MP_Packet;
-
-/*
- * _Semaphore_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _Semaphore_MP_Send_process_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- rtems_name name,
- Objects_Id proxy_id
-);
-
-/*
- * _Semaphore_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Semaphore_MP_Send_request_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- rtems_option option_set,
- rtems_interval timeout
-);
-
-/*
- * _Semaphore_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Semaphore_MP_Send_response_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Semaphore_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Semaphore_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Semaphore_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- */
-
-void _Semaphore_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-);
-
-/*
- * _Semaphore_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- */
-
-void _Semaphore_MP_Send_extract_proxy (
- Thread_Control *the_thread
-);
-
-/*
- * _Semaphore_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a semaphore mp packet.
- */
-
-Semaphore_MP_Packet *_Semaphore_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/cpukit/rtems/include/rtems/rtems/signal.h b/cpukit/rtems/include/rtems/rtems/signal.h
deleted file mode 100644
index 2b247762e9..0000000000
--- a/cpukit/rtems/include/rtems/rtems/signal.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* signal.h
- *
- * This include file contains all the constants and structures associated
- * with the Signal Manager. This manager provides capabilities required
- * for asynchronous communication between tasks via signal sets.
- *
- * Directives provided are:
- *
- * + establish an asynchronous signal routine
- * + send a signal set to a task
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SIGNAL_h
-#define __RTEMS_SIGNAL_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/asr.h>
-#include <rtems/rtems/modes.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/types.h>
-
-/*
- * _Signal_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Signal_Manager_initialization( void );
-
-/*
- * rtems_signal_catch
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_signal_catch directive. This directive
- * is used to establish asr_handler as the Asynchronous Signal Routine
- * (RTEMS_ASR) for the calling task. The asr_handler will execute with a
- * mode of mode_set.
- */
-
-rtems_status_code rtems_signal_catch(
- rtems_asr_entry asr_handler,
- rtems_mode mode_set
-);
-
-/*
- * rtems_signal_send
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_signal_send directive. This directive
- * sends the signal_set to the task specified by ID.
- */
-
-rtems_status_code rtems_signal_send(
- Objects_Id id,
- rtems_signal_set signal_set
-);
-
-#include <rtems/rtems/signalmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/signalmp.h b/cpukit/rtems/include/rtems/rtems/signalmp.h
deleted file mode 100644
index 2b13a0707e..0000000000
--- a/cpukit/rtems/include/rtems/rtems/signalmp.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* signalmp.h
- *
- * This include file contains all the constants and structures associated
- * with the Multiprocessing Support in the Signal Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SIGNAL_MP_h
-#define __RTEMS_SIGNAL_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/asr.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the list of
- * remote signal operations.
- */
-
-typedef enum {
- SIGNAL_MP_SEND_REQUEST = 0,
- SIGNAL_MP_SEND_RESPONSE = 1
-} Signal_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote signal operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- Signal_MP_Remote_operations operation;
- rtems_signal_set signal_in;
-} Signal_MP_Packet;
-
-/*
- * _Signal_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- *
- * This routine is not needed since there are no process
- * packets to be sent by this manager.
- */
-
-/*
- * _Signal_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _Signal_MP_Send_request_packet (
- Signal_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_signal_set signal_in
-);
-
-/*
- * _Signal_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _Signal_MP_Send_response_packet (
- Signal_MP_Remote_operations operation,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _Signal_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _Signal_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _Signal_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _Signal_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _Signal_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a signal mp packet.
- */
-
-Signal_MP_Packet *_Signal_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/cpukit/rtems/include/rtems/rtems/status.h b/cpukit/rtems/include/rtems/rtems/status.h
deleted file mode 100644
index db1cf2049c..0000000000
--- a/cpukit/rtems/include/rtems/rtems/status.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* status.h
- *
- * This include file contains the status codes returned from the
- * executive directives.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_STATUS_h
-#define __RTEMS_STATUS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* types */
-
-/* enumerated constants */
-
-typedef enum {
- RTEMS_SUCCESSFUL = 0, /* successful completion */
- RTEMS_TASK_EXITTED = 1, /* returned from a thread */
- RTEMS_MP_NOT_CONFIGURED = 2, /* multiprocessing not configured */
- RTEMS_INVALID_NAME = 3, /* invalid object name */
- RTEMS_INVALID_ID = 4, /* invalid object id */
- RTEMS_TOO_MANY = 5, /* too many */
- RTEMS_TIMEOUT = 6, /* timed out waiting */
- RTEMS_OBJECT_WAS_DELETED = 7, /* object deleted while waiting */
- RTEMS_INVALID_SIZE = 8, /* specified size was invalid */
- RTEMS_INVALID_ADDRESS = 9, /* address specified is invalid */
- RTEMS_INVALID_NUMBER = 10, /* number was invalid */
- RTEMS_NOT_DEFINED = 11, /* item has not been initialized */
- RTEMS_RESOURCE_IN_USE = 12, /* resources still outstanding */
- RTEMS_UNSATISFIED = 13, /* request not satisfied */
- RTEMS_INCORRECT_STATE = 14, /* thread is in wrong state */
- RTEMS_ALREADY_SUSPENDED = 15, /* thread already in state */
- RTEMS_ILLEGAL_ON_SELF = 16, /* illegal on calling thread */
- RTEMS_ILLEGAL_ON_REMOTE_OBJECT = 17, /* illegal for remote object */
- RTEMS_CALLED_FROM_ISR = 18, /* called from wrong environment */
- RTEMS_INVALID_PRIORITY = 19, /* invalid thread priority */
- RTEMS_INVALID_CLOCK = 20, /* invalid date/time */
- RTEMS_INVALID_NODE = 21, /* invalid node id */
- RTEMS_NOT_CONFIGURED = 22, /* directive not configured */
- RTEMS_NOT_OWNER_OF_RESOURCE = 23, /* not owner of resource */
- RTEMS_NOT_IMPLEMENTED = 24, /* directive not implemented */
- RTEMS_INTERNAL_ERROR = 25, /* RTEMS inconsistency detected */
- RTEMS_NO_MEMORY = 26, /* could not get enough memory */
- RTEMS_IO_ERROR = 27, /* driver IO error */
- RTEMS_PROXY_BLOCKING = 28 /* internal error only */
-} rtems_status_code;
-
-#define RTEMS_STATUS_CODES_FIRST RTEMS_SUCCESSFUL
-#define RTEMS_STATUS_CODES_LAST RTEMS_PROXY_BLOCKING
-
-extern rtems_status_code _Status_Object_name_errors_to_status[];
-
-#ifdef RTEMS_API_INIT
-rtems_status_code _Status_Object_name_errors_to_status[] = {
- RTEMS_SUCCESSFUL, /* OBJECTS_SUCCESSFUL */
- RTEMS_INVALID_NAME, /* OBJECTS_INVALID_NAME */
- RTEMS_INVALID_NODE /* OBJECTS_INVALID_NODE */
-};
-#endif
-
-/*
- * Applications are allowed to use the macros to compare status codes.
- */
-
-#include <rtems/rtems/status.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/support.h b/cpukit/rtems/include/rtems/rtems/support.h
deleted file mode 100644
index 643b4295bd..0000000000
--- a/cpukit/rtems/include/rtems/rtems/support.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* support.h
- *
- * This include file contains information about support functions for
- * the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_SUPPORT_h
-#define __RTEMS_RTEMS_SUPPORT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-
-/*
- * rtems_build_name
- *
- * DESCRIPTION:
- *
- * This function returns an object name composed of the four characters
- * C1, C2, C3, and C4.
- *
- * NOTE:
- *
- * This must be implemented as a macro for use in Configuration Tables.
- *
- */
-
-#define rtems_build_name( _C1, _C2, _C3, _C4 ) \
- ( (_C1) << 24 | (_C2) << 16 | (_C3) << 8 | (_C4) )
-
-/*
- * rtems_get_class
- *
- * DESCRIPTION:
- *
- * This function returns the class portion of the ID.
- *
- */
-
-#define rtems_get_class( _id ) \
- _Objects_Get_class( _id )
-
-/*
- * rtems_get_node
- *
- * DESCRIPTION:
- *
- * This function returns the node portion of the ID.
- *
- */
-
-#define rtems_get_node( _id ) \
- _Objects_Get_node( _id )
-
-/*
- * rtems_get_index
- *
- * DESCRIPTION:
- *
- * This function returns the index portion of the ID.
- *
- */
-
-#define rtems_get_index( _id ) \
- _Objects_Get_index( _id )
-
-/*
- * Time related
- */
-
-#define RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) \
- TOD_MILLISECONDS_TO_MICROSECONDS(_ms)
-#define RTEMS_MILLISECONDS_TO_TICKS(_ms) \
- TOD_MILLISECONDS_TO_TICKS(_ms)
-#define RTEMS_MICROSECONDS_TO_TICKS(_ms) \
- TOD_MICROSECONDS_TO_TICKS(_ms)
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/support.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/taskmp.h b/cpukit/rtems/include/rtems/rtems/taskmp.h
deleted file mode 100644
index a1ff0a3715..0000000000
--- a/cpukit/rtems/include/rtems/rtems/taskmp.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/* taskmp.h
- *
- * This include file contains all the constants and structures associated
- * with the multiprocessing support in the task manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_TASKS_MP_h
-#define __RTEMS_RTEMS_TASKS_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/priority.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/score/thread.h>
-
-/*
- * The following enumerated type defines the list of
- * remote task operations.
- */
-
-typedef enum {
- RTEMS_TASKS_MP_ANNOUNCE_CREATE = 0,
- RTEMS_TASKS_MP_ANNOUNCE_DELETE = 1,
- RTEMS_TASKS_MP_SUSPEND_REQUEST = 2,
- RTEMS_TASKS_MP_SUSPEND_RESPONSE = 3,
- RTEMS_TASKS_MP_RESUME_REQUEST = 4,
- RTEMS_TASKS_MP_RESUME_RESPONSE = 5,
- RTEMS_TASKS_MP_SET_PRIORITY_REQUEST = 6,
- RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE = 7,
- RTEMS_TASKS_MP_GET_NOTE_REQUEST = 8,
- RTEMS_TASKS_MP_GET_NOTE_RESPONSE = 9,
- RTEMS_TASKS_MP_SET_NOTE_REQUEST = 10,
- RTEMS_TASKS_MP_SET_NOTE_RESPONSE = 11
-} RTEMS_tasks_MP_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote task operations.
- */
-
-typedef struct {
- rtems_packet_prefix Prefix;
- RTEMS_tasks_MP_Remote_operations operation;
- rtems_name name;
- rtems_task_priority the_priority;
- unsigned32 notepad;
- unsigned32 note;
-} RTEMS_tasks_MP_Packet;
-
-/*
- * _RTEMS_tasks_MP_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _RTEMS_tasks_MP_Send_process_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_name name
-);
-
-/*
- * _RTEMS_tasks_MP_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- */
-
-rtems_status_code _RTEMS_tasks_MP_Send_request_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_task_priority the_priority,
- unsigned32 notepad,
- unsigned32 note
-);
-
-/*
- * _RTEMS_tasks_MP_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- */
-
-void _RTEMS_tasks_MP_Send_response_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Thread_Control *the_thread
-);
-
-/*
- *
- * _RTEMS_tasks_MP_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _RTEMS_tasks_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-);
-
-/*
- * _RTEMS_tasks_MP_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed by RTEMS_tasks since a task
- * cannot be deleted when segments are in use.
- */
-
-/*
- * _RTEMS_tasks_MP_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*
- * _RTEMS_tasks_MP_Get_packet
- *
- * DESCRIPTION:
- *
- * This function is used to obtain a task mp packet.
- */
-
-RTEMS_tasks_MP_Packet *_RTEMS_tasks_MP_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of file */
diff --git a/cpukit/rtems/include/rtems/rtems/tasks.h b/cpukit/rtems/include/rtems/rtems/tasks.h
deleted file mode 100644
index 17730cee7f..0000000000
--- a/cpukit/rtems/include/rtems/rtems/tasks.h
+++ /dev/null
@@ -1,421 +0,0 @@
-/* tasks.h
- *
- * This include file contains all constants and structures associated
- * with RTEMS tasks. This manager provides a comprehensive set of directives
- * to create, delete, and administer tasks.
- *
- * Directives provided are:
- *
- * + create a task
- * + get an ID of a task
- * + start a task
- * + restart a task
- * + delete a task
- * + suspend a task
- * + resume a task
- * + set a task's priority
- * + change the current task's mode
- * + get a task notepad entry
- * + set a task notepad entry
- * + wake up after interval
- * + wake up when specified
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_TASKS_h
-#define __RTEMS_RTEMS_TASKS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/eventset.h>
-#include <rtems/rtems/asr.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/rtems/status.h>
-
-/*
- * Constant to be used as the ID of current task
- */
-
-#define RTEMS_SELF OBJECTS_ID_OF_SELF
-
-/*
- * This constant is passed to the rtems_task_wake_after directive as the
- * interval when a task wishes to yield the CPU.
- */
-
-#define RTEMS_YIELD_PROCESSOR WATCHDOG_NO_TIMEOUT
-
-/*
- * Define the type for an RTEMS API task priority.
- */
-
-typedef Priority_Control rtems_task_priority;
-
-#define RTEMS_NO_PRIORITY RTEMS_CURRENT_PRIORITY
-
-#define RTEMS_MINIMUM_PRIORITY (PRIORITY_MINIMUM + 1)
-#define RTEMS_MAXIMUM_PRIORITY PRIORITY_MAXIMUM
-
-/*
- * The following constant is passed to rtems_task_set_priority when the
- * caller wants to obtain the current priority.
- */
-
-#define RTEMS_CURRENT_PRIORITY PRIORITY_MINIMUM
-
-/*
- * Notepads constants (indices into notepad array)
- */
-
-#define RTEMS_NOTEPAD_FIRST 0 /* lowest numbered notepad */
-#define RTEMS_NOTEPAD_0 0 /* notepad location 0 */
-#define RTEMS_NOTEPAD_1 1 /* notepad location 1 */
-#define RTEMS_NOTEPAD_2 2 /* notepad location 2 */
-#define RTEMS_NOTEPAD_3 3 /* notepad location 3 */
-#define RTEMS_NOTEPAD_4 4 /* notepad location 4 */
-#define RTEMS_NOTEPAD_5 5 /* notepad location 5 */
-#define RTEMS_NOTEPAD_6 6 /* notepad location 6 */
-#define RTEMS_NOTEPAD_7 7 /* notepad location 7 */
-#define RTEMS_NOTEPAD_8 8 /* notepad location 8 */
-#define RTEMS_NOTEPAD_9 9 /* notepad location 9 */
-#define RTEMS_NOTEPAD_10 10 /* notepad location 10 */
-#define RTEMS_NOTEPAD_11 11 /* notepad location 11 */
-#define RTEMS_NOTEPAD_12 12 /* notepad location 12 */
-#define RTEMS_NOTEPAD_13 13 /* notepad location 13 */
-#define RTEMS_NOTEPAD_14 14 /* notepad location 14 */
-#define RTEMS_NOTEPAD_15 15 /* notepad location 15 */
-#define RTEMS_NOTEPAD_LAST RTEMS_NOTEPAD_15 /* highest numbered notepad */
-
-#define RTEMS_NUMBER_NOTEPADS (RTEMS_NOTEPAD_LAST+1)
-
-/*
- * External API name for Thread_Control
- */
-
-typedef Thread_Control rtems_tcb;
-
-/*
- * The following defines the "return type" of an RTEMS task.
- */
-
-typedef void rtems_task;
-
-/*
- * The following defines the argument to an RTEMS task.
- */
-
-typedef unsigned32 rtems_task_argument;
-
-/*
- * The following defines the type for the entry point of an RTEMS task.
- */
-
-typedef rtems_task ( *rtems_task_entry )(
- rtems_task_argument
- );
-
-/*
- * The following records define the Initialization Tasks Table.
- * Each entry contains the information required by RTEMS to
- * create and start a user task automatically at executive
- * initialization time.
- */
-
-typedef struct {
- rtems_name name; /* task name */
- unsigned32 stack_size; /* task stack size */
- rtems_task_priority initial_priority; /* task priority */
- rtems_attribute attribute_set; /* task attributes */
- rtems_task_entry entry_point; /* task entry point */
- rtems_mode mode_set; /* task initial mode */
- unsigned32 argument; /* task argument */
-} rtems_initialization_tasks_table;
-
-/*
- * This is the API specific information required by each thread for
- * the RTEMS API to function correctly.
- */
-
-
-typedef struct {
- unsigned32 Notepads[ RTEMS_NUMBER_NOTEPADS ];
- rtems_event_set pending_events;
- rtems_event_set event_condition;
- ASR_Information Signal;
-} RTEMS_API_Control;
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _RTEMS_tasks_Information;
-
-/*
- * These are used to manage the user initialization tasks.
- */
-
-RTEMS_EXTERN rtems_initialization_tasks_table
- *_RTEMS_tasks_User_initialization_tasks;
-RTEMS_EXTERN unsigned32 _RTEMS_tasks_Number_of_initialization_tasks;
-
-/*
- * _RTEMS_tasks_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes all Task Manager related data structures.
- */
-
-void _RTEMS_tasks_Manager_initialization(
- unsigned32 maximum_tasks,
- unsigned32 number_of_initialization_tasks,
- rtems_initialization_tasks_table *user_tasks
-);
-
-/*
- * rtems_task_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_create directive. The task
- * will have the name name. The attribute_set can be used to indicate
- * that the task will be globally accessible or utilize floating point.
- * The task's stack will be stack_size bytes. The task will begin
- * execution with initial_priority and initial_modes. It returns the
- * id of the created task in ID.
- */
-
-rtems_status_code rtems_task_create(
- rtems_name name,
- rtems_task_priority initial_priority,
- unsigned32 stack_size,
- rtems_mode initial_modes,
- rtems_attribute attribute_set,
- Objects_Id *id
-);
-
-/*
- * rtems_task_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_ident directive.
- * This directive returns the task ID associated with name.
- * If more than one task is named name, then the task to
- * which the ID belongs is arbitrary. node indicates the
- * extent of the search for the ID of the task named name.
- * The search can be limited to a particular node or allowed to
- * encompass all nodes.
- */
-
-rtems_status_code rtems_task_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-);
-
-/*
- * rtems_task_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_delete directive. The
- * task indicated by ID is deleted.
- */
-
-rtems_status_code rtems_task_delete(
- Objects_Id id
-);
-
-/*
- * rtems_task_get_note
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_get_note directive. The
- * value of the indicated notepad for the task associated with ID
- * is returned in note.
- */
-
-rtems_status_code rtems_task_get_note(
- Objects_Id id,
- unsigned32 notepad,
- unsigned32 *note
-);
-
-/*
- * rtems_task_set_note
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_set_note directive. The
- * value of the indicated notepad for the task associated with ID
- * is returned in note.
- */
-
-rtems_status_code rtems_task_set_note(
- Objects_Id id,
- unsigned32 notepad,
- unsigned32 note
-);
-
-/*
- * rtems_task_mode
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_mode directive. The current
- * values of the modes indicated by mask of the calling task are changed
- * to that indicated in mode_set. The former mode of the task is
- * returned in mode_set.
- */
-
-rtems_status_code rtems_task_mode(
- rtems_mode mode_set,
- rtems_mode mask,
- rtems_mode *previous_mode_set
-);
-
-/*
- * rtems_task_restart
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_restart directive. The
- * task associated with ID is restarted at its initial entry
- * point with the new argument.
- */
-
-rtems_status_code rtems_task_restart(
- Objects_Id id,
- unsigned32 arg
-);
-
-/*
- * rtems_task_suspend
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_suspend directive. The
- * SUSPENDED state is set for task associated with ID.
- */
-
-rtems_status_code rtems_task_suspend(
- Objects_Id id
-);
-
-/*
- * rtems_task_resume
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_resume Directive. The
- * SUSPENDED state is cleared for task associated with ID.
- */
-
-rtems_status_code rtems_task_resume(
- Objects_Id id
-);
-
-/*
- * rtems_task_set_priority
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_set_priority directive. The
- * current priority of the task associated with ID is set to
- * new_priority. The former priority of that task is returned
- * in old_priority.
- */
-
-rtems_status_code rtems_task_set_priority(
- Objects_Id id,
- rtems_task_priority new_priority,
- rtems_task_priority *old_priority
-);
-
-/*
- * rtems_task_start
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_start directive. The
- * starting execution point of the task associated with ID is
- * set to entry_point with the initial argument.
- */
-
-rtems_status_code rtems_task_start(
- Objects_Id id,
- rtems_task_entry entry_point,
- unsigned32 argument
-);
-
-/*
- * rtems_task_wake_when
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_wake_when directive. The
- * calling task is blocked until the current time of day is
- * equal to that indicated by time_buffer.
- */
-
-rtems_status_code rtems_task_wake_when(
- rtems_time_of_day *time_buffer
-);
-
-/*
- * rtems_task_wake_after
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_task_wake_after directive. The
- * calling task is blocked until the indicated number of clock
- * ticks have occurred.
- */
-
-rtems_status_code rtems_task_wake_after(
- rtems_interval ticks
-);
-
-/*PAGE
- *
- * _RTEMS_tasks_Initialize_user_tasks
- *
- * This routine creates and starts all configured user
- * initialzation threads.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _RTEMS_tasks_Initialize_user_tasks( void );
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/tasks.inl>
-#endif
-#include <rtems/rtems/taskmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/timer.h b/cpukit/rtems/include/rtems/rtems/timer.h
deleted file mode 100644
index 4ef567c9bc..0000000000
--- a/cpukit/rtems/include/rtems/rtems/timer.h
+++ /dev/null
@@ -1,207 +0,0 @@
-/* timer.h
- *
- * This include file contains all the constants, structures, and
- * prototypes associated with the Timer Manager. This manager provides
- * facilities to configure, initiate, cancel, and delete timers which will
- * fire at specified intervals of time.
- *
- * Directives provided are:
- *
- * + create a timer
- * + get an ID of a timer
- * + delete a timer
- * + set a timer to fire after a number of ticks have passed
- * + set a timer to fire when a specified date and time has been reached
- * + reset a timer
- * + cancel a time
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_TIMER_h
-#define __RTEMS_TIMER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type details the classes to which a timer
- * may belong.
- */
-
-typedef enum {
- TIMER_INTERVAL,
- TIMER_TIME_OF_DAY,
- TIMER_DORMANT
-} Timer_Classes;
-
-/*
- * The following types define a pointer to a timer service routine.
- */
-
-typedef void rtems_timer_service_routine;
-
-typedef rtems_timer_service_routine ( *rtems_timer_service_routine_entry )(
- rtems_id,
- void *
- );
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-RTEMS_EXTERN Objects_Information _Timer_Information;
-
-/*
- * The following records define the control block used to manage
- * each timer.
- */
-
-typedef struct {
- Objects_Control Object;
- Watchdog_Control Ticker;
- Timer_Classes the_class;
-} Timer_Control;
-
-/*
- * _Timer_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Timer_Manager_initialization(
- unsigned32 maximum_timers
-);
-
-/*
- * rtems_timer_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_create directive. The
- * timer will have the name name. It returns the id of the
- * created timer in ID.
- */
-
-rtems_status_code rtems_timer_create(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_timer_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_ident directive.
- * This directive returns the timer ID associated with name.
- * If more than one timer is named name, then the timer
- * to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_timer_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_timer_cancel
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_cancel directive. It is used
- * to stop the timer associated with ID from firing.
- */
-
-rtems_status_code rtems_timer_cancel(
- Objects_Id id
-);
-
-/*
- * rtems_timer_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_delete directive. The
- * timer indicated by ID is deleted.
- */
-
-rtems_status_code rtems_timer_delete(
- Objects_Id id
-);
-
-/*
- * rtems_timer_fire_after
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_fire_after directive. It
- * initiates the timer associated with ID to fire in ticks clock
- * ticks. When the timer fires, the routine will be invoked.
- */
-
-rtems_status_code rtems_timer_fire_after(
- Objects_Id id,
- rtems_interval ticks,
- rtems_timer_service_routine_entry routine,
- void *user_data
-);
-
-/*
- * rtems_timer_fire_when
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_fire_when directive. It
- * initiates the timer associated with ID to fire at wall_time
- * When the timer fires, the routine will be invoked.
- */
-
-rtems_status_code rtems_timer_fire_when(
- Objects_Id id,
- rtems_time_of_day *wall_time,
- rtems_timer_service_routine_entry routine,
- void *user_data
-);
-
-/*
- * rtems_timer_reset
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_timer_reset directive. It is used
- * to reinitialize the interval timer associated with ID just as if
- * rtems_timer_fire_after were re-invoked with the same arguments that
- * were used to initiate this timer.
- */
-
-rtems_status_code rtems_timer_reset(
- Objects_Id id
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/timer.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/types.h b/cpukit/rtems/include/rtems/rtems/types.h
deleted file mode 100644
index 4d2915bafa..0000000000
--- a/cpukit/rtems/include/rtems/rtems/types.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* types.h
- *
- * This include file defines the types used by the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_RTEMS_TYPES_h
-#define __RTEMS_RTEMS_TYPES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/priority.h>
-#include <rtems/rtems/modes.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-
-/*
- * RTEMS basic type definitions
- */
-
-typedef unsigned8 rtems_unsigned8; /* unsigned 8-bit value */
-typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */
-typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */
-
-typedef signed8 rtems_signed8; /* signed 8-bit value */
-typedef signed16 rtems_signed16; /* signed 16-bit value */
-typedef signed32 rtems_signed32; /* signed 32-bit value */
-
-/*
- * some C++ compilers (eg: HP's) don't do 'long long'
- */
-#if defined(__GNUC__)
-typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */
-typedef signed64 rtems_signed64; /* signed 64-bit value */
-#endif
-
-typedef single_precision rtems_single; /* single precision float */
-typedef double_precision rtems_double; /* double precision float */
-
-typedef boolean rtems_boolean;
-
-typedef unsigned32 rtems_name;
-typedef Objects_Id rtems_id;
-
-typedef Context_Control rtems_context;
-typedef Context_Control_fp rtems_context_fp;
-typedef CPU_Interrupt_frame rtems_interrupt_frame;
-
-/*
- * Time related
- */
-
-typedef Watchdog_Interval rtems_interval;
-typedef TOD_Control rtems_time_of_day;
-
-/*
- * Define the type for an RTEMS API task mode.
- */
-
-typedef Modes_Control rtems_mode;
-
-/*
- * MPCI related entries
- */
-
-typedef MP_packet_Classes rtems_mp_packet_classes;
-typedef MP_packet_Prefix rtems_packet_prefix;
-
-typedef MPCI_initialization_entry rtems_mpci_initialization_entry;
-typedef MPCI_get_packet_entry rtems_mpci_get_packet_entry;
-typedef MPCI_return_packet_entry rtems_mpci_return_packet_entry;
-typedef MPCI_send_entry rtems_mpci_send_packet_entry;
-typedef MPCI_receive_entry rtems_mpci_receive_packet_entry;
-
-typedef MPCI_Entry rtems_mpci_entry;
-
-typedef MPCI_Control rtems_mpci_table;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/asr.inl b/cpukit/rtems/inline/rtems/rtems/asr.inl
deleted file mode 100644
index fede9dea9b..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/asr.inl
+++ /dev/null
@@ -1,128 +0,0 @@
-/* inline/asr.inl
- *
- * This include file contains the implemenation of all routines
- * associated with the asynchronous signal handler which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_ASR_inl
-#define __INLINE_ASR_inl
-
-#include <rtems/score/isr.h>
-
-/*PAGE
- *
- * _ASR_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the given RTEMS_ASR information record.
- */
-
-RTEMS_INLINE_ROUTINE void _ASR_Initialize (
- ASR_Information *information
-)
-{
- information->is_enabled = TRUE;
- information->handler = NULL;
- information->mode_set = RTEMS_DEFAULT_MODES;
- information->signals_posted = 0;
- information->signals_pending = 0;
- information->nest_level = 0;
-}
-
-/*PAGE
- *
- * _ASR_Swap_signals
- *
- * DESCRIPTION:
- *
- * This routine atomically swaps the pending and posted signal
- * sets. This is done when the thread alters its mode in such a
- * way that the RTEMS_ASR disable/enable flag changes.
- */
-
-RTEMS_INLINE_ROUTINE void _ASR_Swap_signals (
- ASR_Information *information
-)
-{
- rtems_signal_set _signals;
- ISR_Level _level;
-
- _ISR_Disable( _level );
- _signals = information->signals_pending;
- information->signals_pending = information->signals_posted;
- information->signals_posted = _signals;
- _ISR_Enable( _level );
-}
-
-/*PAGE
- *
- * _ASR_Is_null_handler
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the given asr_handler is NULL and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ASR_Is_null_handler (
- rtems_asr_entry asr_handler
-)
-{
- return asr_handler == NULL;
-}
-
-/*PAGE
- *
- * _ASR_Are_signals_pending
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if there are signals pending in the
- * given RTEMS_ASR information record and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ASR_Are_signals_pending (
- ASR_Information *information
-)
-{
- return information->signals_posted != 0;
-}
-
-/*PAGE
- *
- * _ASR_Post_signals
- *
- * DESCRIPTION:
- *
- * This routine posts the given signals into the signal_set
- * passed in. The result is returned to the user in signal_set.
- *
- * NOTE: This must be implemented as a macro.
- */
-
-RTEMS_INLINE_ROUTINE void _ASR_Post_signals(
- rtems_signal_set signals,
- rtems_signal_set *signal_set
-)
-{
- ISR_Level _level;
-
- _ISR_Disable( _level );
- *signal_set |= signals;
- _ISR_Enable( _level );
-}
-
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/attr.inl b/cpukit/rtems/inline/rtems/rtems/attr.inl
deleted file mode 100644
index 3cec1edd3b..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/attr.inl
+++ /dev/null
@@ -1,176 +0,0 @@
-/* inline/attr.inl
- *
- * This include file contains all of the inlined routines associated
- * with attributes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_ATTRIBUTES_inl
-#define __INLINE_ATTRIBUTES_inl
-
-/*PAGE
- *
- * _Attributes_Set
- *
- * DESCRIPTION:
- *
- * This function sets the requested new_attributes in the attribute_set
- * passed in. The result is returned to the user.
- */
-
-RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Set (
- rtems_attribute new_attributes,
- rtems_attribute attribute_set
-)
-{
- return attribute_set | new_attributes;
-}
-
-/*PAGE
- *
- * _Attributes_Clear
- *
- * DESCRIPTION:
- *
- * This function clears the requested new_attributes in the attribute_set
- * passed in. The result is returned to the user.
- */
-
-RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Clear (
- rtems_attribute attribute_set,
- rtems_attribute mask
-)
-{
- return attribute_set & ~mask;
-}
-
-/*PAGE
- *
- * _Attributes_Is_floating_point
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the floating point attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_floating_point(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_FLOATING_POINT );
-}
-
-/*PAGE
- *
- * _Attributes_Is_global
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the global object attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_global(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_GLOBAL );
-}
-
-/*PAGE
- *
- * _Attributes_Is_priority
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_PRIORITY );
-}
-
-/*PAGE
- *
- * _Attributes_Is_binary_semaphore
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the binary semaphore attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_binary_semaphore(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_BINARY_SEMAPHORE );
-}
-
-/*PAGE
- *
- * _Attributes_Is_inherit_priority
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority inheritance attribute
- * is enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_inherit_priority(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_INHERIT_PRIORITY );
-}
-
-/*PAGE
- *
- * _Attributes_Is_priority_ceiling
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority ceiling attribute
- * is enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority_ceiling(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_PRIORITY_CEILING );
-}
-
-/*PAGE
- *
- * _Attributes_Is_system_task
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the system task attribute
- * is enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Attributes_Is_system_task(
- rtems_attribute attribute_set
-)
-{
- return ( attribute_set & RTEMS_PRIORITY_CEILING );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/dpmem.inl b/cpukit/rtems/inline/rtems/rtems/dpmem.inl
deleted file mode 100644
index 777a886452..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/dpmem.inl
+++ /dev/null
@@ -1,95 +0,0 @@
-/* inline/dpmem.inl
- *
- * This include file contains the inline routine used in conjunction
- * with the Dual Ported Memory Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_DPMEM_inl
-#define __INLINE_DPMEM_inl
-
-
-/*PAGE
- *
- * _Dual_ported_memory_Allocate
- *
- * DESCRIPTION:
- *
- * This routine allocates a port control block from the inactive chain
- * of free port control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Dual_ported_memory_Control
- *_Dual_ported_memory_Allocate ( void )
-{
- return (Dual_ported_memory_Control *)
- _Objects_Allocate( &_Dual_ported_memory_Information );
-}
-
-/*PAGE
- *
- * _Dual_ported_memory_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a port control block to the inactive chain
- * of free port control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Dual_ported_memory_Free (
- Dual_ported_memory_Control *the_port
-)
-{
- _Objects_Free( &_Dual_ported_memory_Information, &the_port->Object );
-}
-
-/*PAGE
- *
- * _Dual_ported_memory_Get
- *
- * DESCRIPTION:
- *
- * This function maps port IDs to port control blocks. If ID
- * corresponds to a local port, then it returns the_port control
- * pointer which maps to ID and location is set to OBJECTS_LOCAL.
- * Global ports are not supported, thus if ID does not map to a
- * local port, location is set to OBJECTS_ERROR and the_port is
- * undefined.
- */
-
-RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Dual_ported_memory_Control *)
- _Objects_Get( &_Dual_ported_memory_Information, id, location );
-}
-
-/*PAGE
- *
- * _Dual_ported_memory_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_port is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Dual_ported_memory_Is_null(
- Dual_ported_memory_Control *the_port
-)
-{
- return ( the_port == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/event.inl b/cpukit/rtems/inline/rtems/rtems/event.inl
deleted file mode 100644
index a4c6ec7930..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/event.inl
+++ /dev/null
@@ -1,21 +0,0 @@
-/* inline/event.inl
- *
- * This include file contains the static inline implementation of
- * macros for the Event Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_EVENT_inl
-#define __MACROS_EVENT_inl
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/eventset.inl b/cpukit/rtems/inline/rtems/rtems/eventset.inl
deleted file mode 100644
index eed8c33751..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/eventset.inl
+++ /dev/null
@@ -1,95 +0,0 @@
-/* inline/eventset.inl
- *
- * This include file contains the information pertaining to event sets.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_EVENT_SET_inl
-#define __INLINE_EVENT_SET_inl
-
-/*PAGE
- *
- * _Event_sets_Is_empty
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if on events are posted in the event_set,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Event_sets_Is_empty(
- rtems_event_set the_event_set
-)
-{
- return ( the_event_set == 0 );
-}
-
-/*PAGE
- *
- * _Event_sets_Post
- *
- * DESCRIPTION:
- *
- * This routine posts the given new_events into the event_set
- * passed in. The result is returned to the user in event_set.
- */
-
-RTEMS_INLINE_ROUTINE void _Event_sets_Post(
- rtems_event_set the_new_events,
- rtems_event_set *the_event_set
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
- *the_event_set |= the_new_events;
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Event_sets_Get
- *
- * DESCRIPTION:
- *
- * This function returns the events in event_condition which are
- * set in event_set.
- */
-
-RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get(
- rtems_event_set the_event_set,
- rtems_event_set the_event_condition
-)
-{
- return ( the_event_set & the_event_condition );
-}
-
-/*PAGE
- *
- * _Event_sets_Clear
- *
- * DESCRIPTION:
- *
- * This function removes the events in mask from the event_set
- * passed in. The result is returned to the user in event_set.
- */
-
-RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear(
- rtems_event_set the_event_set,
- rtems_event_set the_mask
-)
-{
- return ( the_event_set & ~(the_mask) );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/message.inl b/cpukit/rtems/inline/rtems/rtems/message.inl
deleted file mode 100644
index f3f763ca2e..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/message.inl
+++ /dev/null
@@ -1,83 +0,0 @@
-/* message.inl
- *
- * This include file contains the static inline implementation of all
- * inlined routines in the Message Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MESSAGE_QUEUE_inl
-#define __MESSAGE_QUEUE_inl
-
-#include <rtems/score/wkspace.h>
-
-/*PAGE
- *
- * _Message_queue_Is_null
- *
- * DESCRIPTION:
- *
- * This function places the_message at the rear of the outstanding
- * messages on the_message_queue.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Message_queue_Is_null (
- Message_queue_Control *the_message_queue
-)
-{
- return ( the_message_queue == NULL );
-}
-
-
-/*PAGE
- *
- * _Message_queue_Free
- *
- * DESCRIPTION:
- *
- * This routine deallocates a message queue control block into
- * the inactive chain of free message queue control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Message_queue_Free (
- Message_queue_Control *the_message_queue
-)
-{
- _Objects_Free( &_Message_queue_Information, &the_message_queue->Object );
-}
-
-/*PAGE
- *
- * _Message_queue_Get
- *
- * DESCRIPTION:
- *
- * This function maps message queue IDs to message queue control
- * blocks. If ID corresponds to a local message queue, then it
- * returns the_message_queue control pointer which maps to ID
- * and location is set to OBJECTS_LOCAL. If the message queue ID is
- * global and resides on a remote node, then location is set
- * to OBJECTS_REMOTE, and the_message_queue is undefined.
- * Otherwise, location is set to OBJECTS_ERROR and
- * the_message_queue is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Message_queue_Control *)
- _Objects_Get( &_Message_queue_Information, id, location );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/modes.inl b/cpukit/rtems/inline/rtems/rtems/modes.inl
deleted file mode 100644
index f72c2468e3..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/modes.inl
+++ /dev/null
@@ -1,152 +0,0 @@
-/* modes.inl
- *
- * This include file contains the static inline implementation of the
- * inlined routines in the Mode Handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MODES_inl
-#define __MODES_inl
-
-/*PAGE
- *
- * _Modes_Mask_changed
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if any of the mode flags in mask
- * are set in mode_set, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Modes_Mask_changed (
- Modes_Control mode_set,
- Modes_Control masks
-)
-{
- return ( mode_set & masks );
-}
-
-/*PAGE
- *
- * _Modes_Is_asr_disabled
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if mode_set indicates that Asynchronous
- * Signal Processing is disabled, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Modes_Is_asr_disabled (
- Modes_Control mode_set
-)
-{
- return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR;
-}
-
-/*PAGE
- *
- * _Modes_Is_preempt
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if mode_set indicates that preemption
- * is enabled, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Modes_Is_preempt (
- Modes_Control mode_set
-)
-{
- return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
-}
-
-/*PAGE
- *
- * _Modes_Is_timeslice
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if mode_set indicates that timeslicing
- * is enabled, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Modes_Is_timeslice (
- Modes_Control mode_set
-)
-{
- return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;
-}
-
-/*PAGE
- *
- * _Modes_Get_interrupt_level
- *
- * DESCRIPTION:
- *
- * This function returns the interrupt level portion of the mode_set.
- */
-
-RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
- Modes_Control mode_set
-)
-{
- return ( mode_set & RTEMS_INTERRUPT_MASK );
-}
-
-/*PAGE
- *
- * _Modes_Set_interrupt_level
- *
- * DESCRIPTION:
- *
- * This routine sets the current interrupt level to that specified
- * in the mode_set.
- */
-
-RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
- Modes_Control mode_set
-)
-{
- _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
-}
-
-/*PAGE
- *
- * _Modes_Change
- *
- * DESCRIPTION:
- *
- * This routine changes the modes in old_mode_set indicated by
- * mask to the requested values in new_mode_set. The resulting
- * mode set is returned in out_mode_set and the modes that changed
- * is returned in changed.
- */
-
-RTEMS_INLINE_ROUTINE void _Modes_Change (
- Modes_Control old_mode_set,
- Modes_Control new_mode_set,
- Modes_Control mask,
- Modes_Control *out_mode_set,
- Modes_Control *changed
-)
-{
- Modes_Control _out_mode;
-
- _out_mode = old_mode_set;
- _out_mode &= ~mask;
- _out_mode |= new_mode_set & mask;
- *changed = _out_mode ^ old_mode_set;
- *out_mode_set = _out_mode;
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/options.inl b/cpukit/rtems/inline/rtems/rtems/options.inl
deleted file mode 100644
index f92acf56c4..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/options.inl
+++ /dev/null
@@ -1,55 +0,0 @@
-/* options.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines from the Options Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OPTIONS_inl
-#define __OPTIONS_inl
-
-/*PAGE
- *
- * _Options_Is_no_wait
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the RTEMS_NO_WAIT option is enabled in
- * option_set, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Options_Is_no_wait (
- rtems_option option_set
-)
-{
- return (option_set & RTEMS_NO_WAIT);
-}
-
-/*PAGE
- *
- * _Options_Is_any
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the RTEMS_EVENT_ANY option is enabled in
- * OPTION_SET, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Options_Is_any (
- rtems_option option_set
-)
-{
- return (option_set & RTEMS_EVENT_ANY);
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/part.inl b/cpukit/rtems/inline/rtems/rtems/part.inl
deleted file mode 100644
index 18c948d5c4..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/part.inl
+++ /dev/null
@@ -1,199 +0,0 @@
-/* part.inl
- *
- * This file contains the macro implementation of all inlined routines
- * in the Partition Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PARTITION_inl
-#define __PARTITION_inl
-
-/*PAGE
- *
- * _Partition_Allocate_buffer
- *
- * DESCRIPTION:
- *
- * This function attempts to allocate a buffer from the_partition.
- * If successful, it returns the address of the allocated buffer.
- * Otherwise, it returns NULL.
- */
-
-RTEMS_INLINE_ROUTINE void *_Partition_Allocate_buffer (
- Partition_Control *the_partition
-)
-{
- return _Chain_Get( &the_partition->Memory );
-}
-
-/*PAGE
- *
- * _Partition_Free_buffer
- *
- * DESCRIPTION:
- *
- * This routine frees the_buffer to the_partition.
- */
-
-RTEMS_INLINE_ROUTINE void _Partition_Free_buffer (
- Partition_Control *the_partition,
- Chain_Node *the_buffer
-)
-{
- _Chain_Append( &the_partition->Memory, the_buffer );
-}
-
-/*PAGE
- *
- * _Partition_Is_buffer_on_boundary
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_buffer is on a valid buffer
- * boundary for the_partition, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Partition_Is_buffer_on_boundary (
- void *the_buffer,
- Partition_Control *the_partition
-)
-{
- unsigned32 offset;
-
- offset = (unsigned32) _Addresses_Subtract(
- the_buffer,
- the_partition->starting_address
- );
-
- return ((offset % the_partition->buffer_size) == 0);
-}
-
-/*PAGE
- *
- * _Partition_Is_buffer_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_buffer is a valid buffer from
- * the_partition, otherwise FALSE is returned.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Partition_Is_buffer_valid (
- Chain_Node *the_buffer,
- Partition_Control *the_partition
-)
-{
- void *starting;
- void *ending;
-
- starting = the_partition->starting_address;
- ending = _Addresses_Add_offset( starting, the_partition->length );
-
- return (
- _Addresses_Is_in_range( the_buffer, starting, ending ) &&
- _Partition_Is_buffer_on_boundary( the_buffer, the_partition )
- );
-}
-
-/*PAGE
- *
- * _Partition_Is_buffer_size_aligned
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the use of the specified buffer_size
- * will result in the allocation of buffers whose first byte is
- * properly aligned, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Partition_Is_buffer_size_aligned (
- unsigned32 buffer_size
-)
-{
- return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0);
-}
-
-/*PAGE
- *
- * _Partition_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a partition control block from
- * the inactive chain of free partition control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void )
-{
- return (Partition_Control *) _Objects_Allocate( &_Partition_Information );
-}
-
-/*PAGE
- *
- * _Partition_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a partition control block to the
- * inactive chain of free partition control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Partition_Free (
- Partition_Control *the_partition
-)
-{
- _Objects_Free( &_Partition_Information, &the_partition->Object );
-}
-
-/*PAGE
- *
- * _Partition_Get
- *
- * DESCRIPTION:
- *
- * This function maps partition IDs to partition control blocks.
- * If ID corresponds to a local partition, then it returns
- * the_partition control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. If the partition ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_partition is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_partition is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Partition_Control *)
- _Objects_Get( &_Partition_Information, id, location );
-}
-
-/*PAGE
- *
- * _Partition_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_partition is NULL
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Partition_Is_null (
- Partition_Control *the_partition
-)
-{
- return ( the_partition == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/ratemon.inl b/cpukit/rtems/inline/rtems/rtems/ratemon.inl
deleted file mode 100644
index f1293ef75a..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/ratemon.inl
+++ /dev/null
@@ -1,143 +0,0 @@
-/* ratemon.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines in the Rate Monotonic Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RATE_MONOTONIC_inl
-#define __RATE_MONOTONIC_inl
-
-/*PAGE
- *
- * _Rate_monotonic_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a period control block from
- * the inactive chain of free period control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void )
-{
- return (Rate_monotonic_Control *)
- _Objects_Allocate( &_Rate_monotonic_Information );
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Free
- *
- * DESCRIPTION:
- *
- * This routine allocates a period control block from
- * the inactive chain of free period control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Rate_monotonic_Free (
- Rate_monotonic_Control *the_period
-)
-{
- _Objects_Free( &_Rate_monotonic_Information, &the_period->Object );
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Get
- *
- * DESCRIPTION:
- *
- * This function maps period IDs to period control blocks.
- * If ID corresponds to a local period, then it returns
- * the_period control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. Otherwise, location is set
- * to OBJECTS_ERROR and the_period is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Rate_monotonic_Control *)
- _Objects_Get( &_Rate_monotonic_Information, id, location );
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Is_active
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_period is in the ACTIVE state,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_active (
- Rate_monotonic_Control *the_period
-)
-{
- return (the_period->state == RATE_MONOTONIC_ACTIVE);
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Is_inactive
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_period is in the ACTIVE state,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_inactive (
- Rate_monotonic_Control *the_period
-)
-{
- return (the_period->state == RATE_MONOTONIC_INACTIVE);
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Is_expired
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_period is in the EXPIRED state,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_expired (
- Rate_monotonic_Control *the_period
-)
-{
- return (the_period->state == RATE_MONOTONIC_EXPIRED);
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_period is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_null (
- Rate_monotonic_Control *the_period
-)
-{
- return (the_period == NULL);
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/region.inl b/cpukit/rtems/inline/rtems/rtems/region.inl
deleted file mode 100644
index 37f098ae63..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/region.inl
+++ /dev/null
@@ -1,127 +0,0 @@
-/* region.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Region Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __REGION_inl
-#define __REGION_inl
-
-/*PAGE
- *
- * _Region_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a region control block from
- * the inactive chain of free region control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Region_Control *_Region_Allocate( void )
-{
- return (Region_Control *) _Objects_Allocate( &_Region_Information );
-}
-
-/*PAGE
- *
- * _Region_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a region control block to the
- * inactive chain of free region control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Region_Free (
- Region_Control *the_region
-)
-{
- _Objects_Free( &_Region_Information, &the_region->Object );
-}
-
-/*PAGE
- *
- * _Region_Get
- *
- * DESCRIPTION:
- *
- * This function maps region IDs to region control blocks.
- * If ID corresponds to a local region, then it returns
- * the_region control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. Otherwise, location is set
- * to OBJECTS_ERROR and the_region is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Region_Control *_Region_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Region_Control *)
- _Objects_Get( &_Region_Information, id, location );
-}
-
-/*PAGE
- *
- * _Region_Allocate_segment
- *
- * DESCRIPTION:
- *
- * This function attempts to allocate a segment from the_region.
- * If successful, it returns the address of the allocated segment.
- * Otherwise, it returns NULL.
- */
-
-RTEMS_INLINE_ROUTINE void *_Region_Allocate_segment (
- Region_Control *the_region,
- unsigned32 size
-)
-{
- return _Heap_Allocate( &the_region->Memory, size );
-}
-
-/*PAGE
- *
- * _Region_Free_segment
- *
- * DESCRIPTION:
- *
- * This function frees the_segment to the_region.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Region_Free_segment (
- Region_Control *the_region,
- void *the_segment
-)
-{
- return _Heap_Free( &the_region->Memory, the_segment );
-}
-
-/*PAGE
- *
- * _Region_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_region is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Region_Is_null (
- Region_Control *the_region
-)
-{
- return ( the_region == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/sem.inl b/cpukit/rtems/inline/rtems/rtems/sem.inl
deleted file mode 100644
index 75774b2917..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/sem.inl
+++ /dev/null
@@ -1,93 +0,0 @@
-/* sem.inl
- *
- * This file contains the static inlin implementation of the inlined
- * routines from the Semaphore Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __SEMAPHORE_inl
-#define __SEMAPHORE_inl
-
-/*PAGE
- *
- * _Semaphore_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a semaphore control block from
- * the inactive chain of free semaphore control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void )
-{
- return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information );
-}
-
-/*PAGE
- *
- * _Semaphore_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a semaphore control block to the
- * inactive chain of free semaphore control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Semaphore_Free (
- Semaphore_Control *the_semaphore
-)
-{
- _Objects_Free( &_Semaphore_Information, &the_semaphore->Object );
-}
-
-/*PAGE
- *
- * _Semaphore_Get
- *
- * DESCRIPTION:
- *
- * This function maps semaphore IDs to semaphore control blocks.
- * If ID corresponds to a local semaphore, then it returns
- * the_semaphore control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. if the semaphore ID is global and
- * resides on a remote node, then location is set to OBJECTS_REMOTE,
- * and the_semaphore is undefined. Otherwise, location is set
- * to OBJECTS_ERROR and the_semaphore is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Semaphore_Control *)
- _Objects_Get( &_Semaphore_Information, id, location );
-}
-
-/*PAGE
- *
- * _Semaphore_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Semaphore_Is_null (
- Semaphore_Control *the_semaphore
-)
-{
- return ( the_semaphore == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/status.inl b/cpukit/rtems/inline/rtems/rtems/status.inl
deleted file mode 100644
index b9182c6f63..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/status.inl
+++ /dev/null
@@ -1,56 +0,0 @@
-/* inline/status.inl
- *
- * This include file contains the implementations of the inlined
- * routines for the status package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_STATUS_inl
-#define __INLINE_STATUS_inl
-
-/*PAGE
- *
- * rtems_is_status_successful
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the status code is equal to RTEMS_SUCCESSFUL,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean rtems_is_status_successful(
- rtems_status_code code
-)
-{
- return (code == RTEMS_SUCCESSFUL);
-}
-
-/*PAGE
- *
- * rtems_are_statuses_equal
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the status code1 is equal to code2,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean rtems_are_statuses_equal(
- rtems_status_code code1,
- rtems_status_code code2
-)
-{
- return (code1 == code2);
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/support.inl b/cpukit/rtems/inline/rtems/rtems/support.inl
deleted file mode 100644
index 06de8d1f59..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/support.inl
+++ /dev/null
@@ -1,61 +0,0 @@
-/* support.inl
- *
- * This include file contains the static inline implementation of all
- * of the inlined routines specific to the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SUPPORT_inl
-#define __RTEMS_SUPPORT_inl
-
-/*PAGE
- *
- * rtems_is_name_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the name is valid, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE rtems_boolean rtems_is_name_valid (
- rtems_name name
-)
-{
- return ( name != 0 );
-}
-
-/*PAGE
- *
- * rtems_name_to_characters
- *
- * DESCRIPTION:
- *
- * This function breaks the object name into the four component
- * characters C1, C2, C3, and C4.
- */
-
-RTEMS_INLINE_ROUTINE void rtems_name_to_characters(
- rtems_name name,
- char *c1,
- char *c2,
- char *c3,
- char *c4
-)
-{
- *c1 = (name >> 24) & 0xff;
- *c2 = (name >> 16) & 0xff;
- *c3 = (name >> 8) & 0xff;
- *c4 = name & 0xff;
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/tasks.inl b/cpukit/rtems/inline/rtems/rtems/tasks.inl
deleted file mode 100644
index 34c1e055a8..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/tasks.inl
+++ /dev/null
@@ -1,90 +0,0 @@
-/* tasks.inl
- *
- * This file contains the static inline implementation of all inlined
- * routines in the with RTEMS Tasks Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_TASKS_inl
-#define __RTEMS_TASKS_inl
-
-/*PAGE
- *
- * _RTEMS_tasks_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a task control block from
- * the inactive chain of free task control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_RTEMS_tasks_Allocate( void )
-{
- return (Thread_Control *) _Objects_Allocate( &_RTEMS_tasks_Information );
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a task control block to the
- * inactive chain of free task control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free (
- Thread_Control *the_task
-)
-{
- _Objects_Free(
- _Objects_Get_information( the_task->Object.id ),
- &the_task->Object
- );
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Priority_to_Core
- *
- * DESCRIPTION:
- *
- * This function converts an RTEMS API priority into a core priority.
- */
-
-RTEMS_INLINE_ROUTINE Priority_Control _RTEMS_tasks_Priority_to_Core(
- rtems_task_priority priority
-)
-{
- return (Priority_Control) priority;
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Priority_is_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_priority is a valid user task priority
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _RTEMS_tasks_Priority_is_valid (
- rtems_task_priority the_priority
-)
-{
- return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) &&
- ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/timer.inl b/cpukit/rtems/inline/rtems/rtems/timer.inl
deleted file mode 100644
index b884e02f4d..0000000000
--- a/cpukit/rtems/inline/rtems/rtems/timer.inl
+++ /dev/null
@@ -1,142 +0,0 @@
-/* timer.inl
- *
- * This file contains the static inline implementation of the inlined routines
- * from the Timer Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIMER_inl
-#define __TIMER_inl
-
-/*PAGE
- *
- * _Timer_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a timer control block from
- * the inactive chain of free timer control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void )
-{
- return (Timer_Control *) _Objects_Allocate( &_Timer_Information );
-}
-
-/*PAGE
- *
- * _Timer_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a timer control block to the
- * inactive chain of free timer control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Timer_Free (
- Timer_Control *the_timer
-)
-{
- _Objects_Free( &_Timer_Information, &the_timer->Object );
-}
-
-/*PAGE
- *
- * _Timer_Get
- *
- * DESCRIPTION:
- *
- * This function maps timer IDs to timer control blocks.
- * If ID corresponds to a local timer, then it returns
- * the timer control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. Otherwise, location is set
- * to OBJECTS_ERROR and the returned value is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Timer_Control *)
- _Objects_Get( &_Timer_Information, id, location );
-}
-
-/*PAGE
- *
- * _Timer_Is_interval_class
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the class is that of an INTERVAL
- * timer, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Timer_Is_interval_class (
- Timer_Classes the_class
-)
-{
- return ( the_class == TIMER_INTERVAL );
-}
-
-/*PAGE
- *
- * _Timer_Is_time_of_day_class
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the class is that of an INTERVAL
- * timer, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Timer_Is_timer_of_day_class (
- Timer_Classes the_class
-)
-{
- return ( the_class == TIMER_TIME_OF_DAY );
-}
-
-/*PAGE
- *
- * _Timer_Is_dormant_class
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the class is that of a DORMANT
- * timer, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Timer_Is_dormant_class (
- Timer_Classes the_class
-)
-{
- return ( the_class == TIMER_DORMANT );
-}
-
-/*PAGE
- *
- * _Timer_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_timer is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Timer_Is_null (
- Timer_Control *the_timer
-)
-{
- return ( the_timer == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/asr.inl b/cpukit/rtems/macros/rtems/rtems/asr.inl
deleted file mode 100644
index d3ed229ca9..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/asr.inl
+++ /dev/null
@@ -1,90 +0,0 @@
-/* macros/asr.h
- *
- * This include file contains the implemenation of all routines
- * associated with the asynchronous signal handler which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_ASR_h
-#define __INLINE_ASR_h
-
-#include <rtems/score/isr.h>
-
-/*PAGE
- *
- * _ASR_Initialize
- *
- */
-
-#define _ASR_Initialize( _information ) \
-{ \
- (_information)->is_enabled = TRUE; \
- (_information)->handler = NULL; \
- (_information)->mode_set = RTEMS_DEFAULT_MODES; \
- (_information)->signals_posted = 0; \
- (_information)->signals_pending = 0; \
- (_information)->nest_level = 0; \
-}
-
-/*PAGE
- *
- * _ASR_Swap_signals
- *
- */
-
-#define _ASR_Swap_signals( _information ) \
-{ \
- rtems_signal_set _signals; \
- ISR_Level _level; \
- \
- _ISR_Disable( _level ); \
- _signals = (_information)->signals_pending; \
- (_information)->signals_pending = (_information)->signals_posted; \
- (_information)->signals_posted = _signals; \
- _ISR_Enable( _level ); \
-}
-
-/*PAGE
- *
- * _ASR_Is_null_handler
- *
- */
-
-#define _ASR_Is_null_handler( _asr_handler ) \
- ( (_asr_handler) == NULL )
-
-/*PAGE
- *
- * _ASR_Are_signals_pending
- *
- */
-
-#define _ASR_Are_signals_pending( _information ) \
- ( (_information)->signals_posted != 0 )
-
-/*PAGE
- *
- * _ASR_Post_signals
- *
- */
-
-#define _ASR_Post_signals( _signals, _signal_set ) \
- do { \
- ISR_Level _level; \
- \
- _ISR_Disable( _level ); \
- *(_signal_set) |= (_signals); \
- _ISR_Enable( _level ); \
- } while ( 0 )
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/attr.inl b/cpukit/rtems/macros/rtems/rtems/attr.inl
deleted file mode 100644
index 290e7f7870..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/attr.inl
+++ /dev/null
@@ -1,100 +0,0 @@
-/* macros/attr.h
- *
- * This include file contains all of the inlined routines associated
- * with attributes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_ATTRIBUTES_h
-#define __MACROS_ATTRIBUTES_h
-
-/*PAGE
- *
- * _Attributes_Set
- */
-
-#define _Attributes_Set( _new_attributes, _attribute_set ) \
- ( (_attribute_set) | (_new_attributes) )
-
-/*PAGE
- *
- * _Attributes_Clear
- */
-
-#define _Attributes_Clear( _attribute_set, _mask ) \
- ( (_attribute_set) & ~(_mask) )
-
-/*PAGE
- *
- * _Attributes_Is_floating_point
- *
- */
-
-#define _Attributes_Is_floating_point( _attribute_set ) \
- ( (_attribute_set) & RTEMS_FLOATING_POINT )
-
-/*PAGE
- *
- * _Attributes_Is_global
- *
- */
-
-#define _Attributes_Is_global( _attribute_set ) \
- ( (_attribute_set) & RTEMS_GLOBAL )
-
-/*PAGE
- *
- * _Attributes_Is_priority
- *
- */
-
-#define _Attributes_Is_priority( _attribute_set ) \
- ( (_attribute_set) & RTEMS_PRIORITY )
-
-/*PAGE
- *
- * _Attributes_Is_binary_semaphore
- *
- */
-
-#define _Attributes_Is_binary_semaphore( _attribute_set ) \
- ( (_attribute_set) & RTEMS_BINARY_SEMAPHORE )
-
-/*PAGE
- *
- * _Attributes_Is_inherit_priority
- *
- */
-
-#define _Attributes_Is_inherit_priority( _attribute_set ) \
- ( (_attribute_set) & RTEMS_INHERIT_PRIORITY )
-
-/*PAGE
- *
- * _Attributes_Is_priority_ceiling
- *
- */
-
-#define _Attributes_Is_priority_ceiling( _attribute_set ) \
- ( (_attribute_set) & RTEMS_PRIORITY_CEILING )
-
-/*PAGE
- *
- * _Attributes_Is_system_task
- *
- */
-
-#define _Attributes_Is_system_task( _attribute_set ) \
- ( (_attribute_set) & RTEMS_SYSTEM_TASK )
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/dpmem.inl b/cpukit/rtems/macros/rtems/rtems/dpmem.inl
deleted file mode 100644
index 171f15d8e9..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/dpmem.inl
+++ /dev/null
@@ -1,59 +0,0 @@
-/* macros/dpmem.h
- *
- * This include file contains the inline routine used in conjunction
- * with the Dual Ported Memory Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_DPMEM_h
-#define __MACROS_DPMEM_h
-
-/*PAGE
- *
- * _Dual_ported_memory_Allocate
- *
- */
-
-#define _Dual_ported_memory_Allocate() \
- (Dual_ported_memory_Control *) \
- _Objects_Allocate( &_Dual_ported_memory_Information )
-
-/*PAGE
- *
- * _Dual_ported_memory_Free
- *
- */
-
-#define _Dual_ported_memory_Free( _the_port ) \
- _Objects_Free( &_Dual_ported_memory_Information, &(_the_port)->Object )
-
-/*PAGE
- *
- * _Dual_ported_memory_Get
- *
- */
-
-#define _Dual_ported_memory_Get( _id, _location ) \
- (Dual_ported_memory_Control *) \
- _Objects_Get( &_Dual_ported_memory_Information, (_id), (_location) )
-
-
-/*PAGE
- *
- * _Dual_ported_memory_Is_null
- */
-
-#define _Dual_ported_memory_Is_null( _the_port ) \
- ( (_the_port) == NULL )
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/event.inl b/cpukit/rtems/macros/rtems/rtems/event.inl
deleted file mode 100644
index e0d18e7817..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/event.inl
+++ /dev/null
@@ -1,21 +0,0 @@
-/* macros/event.h
- *
- * This include file contains the implementation of macros for
- * the Event Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_EVENT_h
-#define __MACROS_EVENT_h
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/eventset.inl b/cpukit/rtems/macros/rtems/rtems/eventset.inl
deleted file mode 100644
index 3eeb2bea63..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/eventset.inl
+++ /dev/null
@@ -1,59 +0,0 @@
-/* eventset.inl
- *
- * This include file contains the macro implementation of inlined
- * routines in the event set object.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __EVENT_SET_inl
-#define __EVENT_SET_inl
-
-/*PAGE
- *
- * _Event_sets_Is_empty
- */
-
-#define _Event_sets_Is_empty( _the_event_set ) \
- ((_the_event_set) == 0 )
-
-/*PAGE
- *
- * _Event_sets_Is_empty
- */
-
-#define _Event_sets_Post( _the_new_events, _the_event_set ) \
- do { \
- ISR_Level level; \
- \
- _ISR_Disable( level ); \
- *(_the_event_set) |= (_the_new_events); \
- _ISR_Enable( level ); \
- } while (0);
-
-/*PAGE
- *
- * _Event_sets_Is_empty
- */
-
-#define _Event_sets_Get( _the_event_set, _the_event_condition ) \
- ((_the_event_set) & (_the_event_condition))
-
-/*PAGE
- *
- * _Event_sets_Clear
- */
-
-#define _Event_sets_Clear( _the_event_set, _the_mask ) \
- ((_the_event_set) & ~(_the_mask))
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/message.inl b/cpukit/rtems/macros/rtems/rtems/message.inl
deleted file mode 100644
index 537701d41b..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/message.inl
+++ /dev/null
@@ -1,49 +0,0 @@
-/* message.inl
- *
- * This include file contains the macro implementation of all
- * inlined routines in the Message Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MESSAGE_QUEUE_inl
-#define __MESSAGE_QUEUE_inl
-
-/*PAGE
- *
- * _Message_queue_Is_null
- *
- */
-
-#define _Message_queue_Is_null( _the_message_queue ) \
- ( (_the_message_queue) == NULL )
-
-/*PAGE
- *
- * _Message_queue_Free
- *
- */
-
-#define _Message_queue_Free( _the_message_queue ) \
- _Objects_Free( &_Message_queue_Information, &(_the_message_queue)->Object )
-
-/*PAGE
- *
- * _Message_queue_Get
- *
- */
-
-#define _Message_queue_Get( _id, _location ) \
- (Message_queue_Control *) \
- _Objects_Get( &_Message_queue_Information, (_id), (_location) )
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/modes.inl b/cpukit/rtems/macros/rtems/rtems/modes.inl
deleted file mode 100644
index e84bf25b32..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/modes.inl
+++ /dev/null
@@ -1,92 +0,0 @@
-/* modes.inl
- *
- * This include file contains the macro implementation of the
- * inlined routines in the Mode Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MODES_inl
-#define __MODES_inl
-
-/*PAGE
- *
- * _Modes_Mask_changed
- *
- */
-
-#define _Modes_Mask_changed( _mode_set, _masks ) \
- ( (_mode_set) & (_masks) )
-
-/*PAGE
- *
- * _Modes_Is_asr_disabled
- *
- */
-
-#define _Modes_Is_asr_disabled( _mode_set ) \
- (((_mode_set) & RTEMS_ASR_MASK) == RTEMS_NO_ASR)
-
-/*PAGE
- *
- * _Modes_Is_preempt
- *
- */
-
-#define _Modes_Is_preempt( _mode_set ) \
- ( ( (_mode_set) & RTEMS_PREEMPT_MASK ) == RTEMS_PREEMPT )
-
-/*PAGE
- *
- * _Modes_Is_timeslice
- *
- */
-
-#define _Modes_Is_timeslice( _mode_set ) \
- (((_mode_set) & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE)
-
-/*PAGE
- *
- * _Modes_Get_interrupt_level
- *
- */
-
-#define _Modes_Get_interrupt_level( _mode_set ) \
- ( (_mode_set) & RTEMS_INTERRUPT_MASK )
-
-/*PAGE
- *
- * _Modes_Set_interrupt_level
- *
- */
-
-#define _Modes_Set_interrupt_level( _mode_set ) \
- _ISR_Set_level( _Modes_Get_interrupt_level( (_mode_set) ) )
-
-/*PAGE
- *
- * _Modes_Change
- *
- */
-
-#define _Modes_Change( _old_mode_set, _new_mode_set, \
- _mask, _out_mode_set, _changed ) \
- { Modes_Control _out_mode; \
- \
- _out_mode = (_old_mode_set); \
- _out_mode &= ~(_mask); \
- _out_mode |= (_new_mode_set) & (_mask); \
- *(_changed) = _out_mode ^ (_old_mode_set); \
- *(_out_mode_set) = _out_mode; \
- }
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/options.inl b/cpukit/rtems/macros/rtems/rtems/options.inl
deleted file mode 100644
index 78068ab17c..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/options.inl
+++ /dev/null
@@ -1,39 +0,0 @@
-/* options.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Options Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OPTIONS_inl
-#define __OPTIONS_inl
-
-/*PAGE
- *
- * _Options_Is_no_wait
- *
- */
-
-#define _Options_Is_no_wait( _option_set ) \
- ( (_option_set) & RTEMS_NO_WAIT )
-
-/*PAGE
- *
- * _Options_Is_any
- *
- */
-
-#define _Options_Is_any( _option_set ) \
- ( (_option_set) & RTEMS_EVENT_ANY )
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/part.inl b/cpukit/rtems/macros/rtems/rtems/part.inl
deleted file mode 100644
index 027a7427e5..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/part.inl
+++ /dev/null
@@ -1,117 +0,0 @@
-/* part.inl
- *
- * This file contains the macro implementation of all inlined routines
- * in the Partition Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PARTITION_inl
-#define __PARTITION_inl
-
-/*PAGE
- *
- * _Partition_Allocate_buffer
- *
- */
-
-#define _Partition_Allocate_buffer( _the_partition ) \
- _Chain_Get( &(_the_partition)->Memory )
-
-/*PAGE
- *
- * _Partition_Free_buffer
- *
- */
-
-#define _Partition_Free_buffer( _the_partition, _the_buffer ) \
- _Chain_Append( &(_the_partition)->Memory, (_the_buffer) )
-
-/*PAGE
- *
- * _Partition_Is_buffer_on_boundary
- *
- */
-
-#define _Partition_Is_buffer_on_boundary( _the_buffer, _the_partition ) \
- ((((unsigned32) _Addresses_Subtract( \
- (_the_buffer), \
- (_the_partition)->starting_address ) \
- ) % \
- (_the_partition)->buffer_size) == 0)
-
-/*PAGE
- *
- * _Partition_Is_buffer_valid
- *
- */
-
-#define _Partition_Is_buffer_valid( _the_buffer, _the_partition ) \
- ( \
- _Addresses_Is_in_range( \
- (_the_buffer), \
- (_the_partition)->starting_address, \
- _Addresses_Add_offset( \
- (_the_partition)->starting_address, \
- (_the_partition)->length \
- ) \
- ) && \
- _Partition_Is_buffer_on_boundary( (_the_buffer), (_the_partition) ) \
- )
-
-/*PAGE
- *
- * _Partition_Is_buffer_size_aligned
- *
- */
-
-#define _Partition_Is_buffer_size_aligned( _buffer_size ) \
- ((_buffer_size) % CPU_PARTITION_ALIGNMENT == 0)
-
-/*PAGE
- *
- * _Partition_Allocate
- *
- */
-
-#define _Partition_Allocate() \
- (Partition_Control *) _Objects_Allocate( &_Partition_Information )
-
-/*PAGE
- *
- * _Partition_Free
- *
- */
-
-#define _Partition_Free( _the_partition ) \
- _Objects_Free( &_Partition_Information, &(_the_partition)->Object )
-
-/*PAGE
- *
- * _Partition_Get
- *
- */
-
-#define _Partition_Get( _id, _location ) \
- (Partition_Control *) \
- _Objects_Get( &_Partition_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Partition_Is_null
- *
- */
-
-#define _Partition_Is_null( _the_partition ) \
- ( (_the_partition) == NULL )
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/ratemon.inl b/cpukit/rtems/macros/rtems/rtems/ratemon.inl
deleted file mode 100644
index 8a550d91e0..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/ratemon.inl
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ratemon.inl
- *
- * This file contains the macro implementation of the inlined
- * routines in the Rate Monotonic Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RATE_MONOTONIC_inl
-#define __RATE_MONOTONIC_inl
-
-/*PAGE
- *
- * _Rate_monotonic_Allocate
- *
- */
-
-#define _Rate_monotonic_Allocate() \
- (Rate_monotonic_Control *) \
- _Objects_Allocate( &_Rate_monotonic_Information )
-
-/*PAGE
- *
- * _Rate_monotonic_Free
- *
- */
-
-#define _Rate_monotonic_Free( _the_period ) \
- _Objects_Free( &_Rate_monotonic_Information, &(_the_period)->Object )
-
-/*PAGE
- *
- * _Rate_monotonic_Get
- *
- */
-
-#define _Rate_monotonic_Get( _id, _location ) \
- (Rate_monotonic_Control *) \
- _Objects_Get( &_Rate_monotonic_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Rate_monotonic_Is_active
- *
- */
-
-#define _Rate_monotonic_Is_active( _the_period ) \
- ((_the_period)->state == RATE_MONOTONIC_ACTIVE)
-
-/*PAGE
- *
- * _Rate_monotonic_Is_inactive
- *
- */
-
-#define _Rate_monotonic_Is_inactive( _the_period ) \
- ((_the_period)->state == RATE_MONOTONIC_INACTIVE)
-
-/*PAGE
- *
- * _Rate_monotonic_Is_expired
- *
- */
-
-#define _Rate_monotonic_Is_expired( _the_period ) \
- ((_the_period)->state == RATE_MONOTONIC_EXPIRED)
-
-/*PAGE
- *
- * _Rate_monotonic_Is_null
- *
- */
-
-#define _Rate_monotonic_Is_null( _the_period ) ( (_the_period) == NULL )
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/region.inl b/cpukit/rtems/macros/rtems/rtems/region.inl
deleted file mode 100644
index 8c36bdeb34..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/region.inl
+++ /dev/null
@@ -1,75 +0,0 @@
-/* region.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Region Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __REGION_inl
-#define __REGION_inl
-
-/*PAGE
- *
- * _Region_Allocate
- *
- */
-
-#define _Region_Allocate() \
- (Region_Control *) _Objects_Allocate( &_Region_Information )
-
-/*PAGE
- *
- * _Region_Free
- *
- */
-
-#define _Region_Free( _the_region ) \
- _Objects_Free( &_Region_Information, &(_the_region)->Object )
-
-/*PAGE
- *
- * _Region_Get
- *
- */
-
-#define _Region_Get( _id, _location ) \
- (Region_Control *) \
- _Objects_Get( &_Region_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Region_Allocate_segment
- *
- */
-
-#define _Region_Allocate_segment( _the_region, _size ) \
- _Heap_Allocate( &(_the_region)->Memory, (_size) )
-
-/*PAGE
- *
- * _Region_Free_segment
- *
- */
-
-#define _Region_Free_segment( _the_region, _the_segment ) \
- _Heap_Free( &(_the_region)->Memory, (_the_segment) )
-
-/*PAGE
- *
- * _Region_Is_null
- *
- */
-
-#define _Region_Is_null( _the_region ) ( (_the_region) == NULL )
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/sem.inl b/cpukit/rtems/macros/rtems/rtems/sem.inl
deleted file mode 100644
index 132422a30b..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/sem.inl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* sem.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Semaphore Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __SEMAPHORE_inl
-#define __SEMAPHORE_inl
-
-/*PAGE
- *
- * _Semaphore_Allocate
- *
- */
-
-#define _Semaphore_Allocate() \
- (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information )
-
-/*PAGE
- *
- * _Semaphore_Free
- *
- */
-
-#define _Semaphore_Free( _the_semaphore ) \
- _Objects_Free( &_Semaphore_Information, &(_the_semaphore)->Object )
-
-/*PAGE
- *
- * _Semaphore_Get
- *
- */
-
-#define _Semaphore_Get( _id, _location ) \
- (Semaphore_Control *) \
- _Objects_Get( &_Semaphore_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Semaphore_Is_null
- *
- */
-
-#define _Semaphore_Is_null( _the_semaphore ) \
- ( (_the_semaphore) == NULL )
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/status.inl b/cpukit/rtems/macros/rtems/rtems/status.inl
deleted file mode 100644
index 6db9086df0..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/status.inl
+++ /dev/null
@@ -1,39 +0,0 @@
-/* macros/status.h
- *
- * This include file contains the implementations of the inlined
- * routines for the status package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_STATUS_h
-#define __MACROS_STATUS_h
-
-/*PAGE
- *
- * rtems_is_status_successful
- *
- */
-
-#define rtems_is_status_successful( _code ) \
- ( (_code) == RTEMS_SUCCESSFUL )
-
-/*PAGE
- *
- * rtems_are_statuses_equal
- *
- */
-
-#define rtems_are_statuses_equal( _code1, _code2 ) \
- ((_code1) == (_code2))
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/support.inl b/cpukit/rtems/macros/rtems/rtems/support.inl
deleted file mode 100644
index fc84a2e7ee..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/support.inl
+++ /dev/null
@@ -1,44 +0,0 @@
-/* support.inl
- *
- * This include file contains the macros implementation of all
- * of the inlined routines specific to the RTEMS API.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SUPPORT_inl
-#define __RTEMS_SUPPORT_inl
-
-/*PAGE
- *
- * rtems_is_name_valid
- *
- */
-
-#define rtems_is_name_valid( _name ) \
- ( (_name) != 0 )
-
-/*PAGE
- *
- * rtems_name_to_characters
- *
- */
-
-#define rtems_name_to_characters( _name, _c1, _c2, _c3, _c4 ) \
- { \
- (*(_c1) = ((_name) >> 24) & 0xff; \
- (*(_c2) = ((_name) >> 16) & 0xff; \
- (*(_c3) = ((_name) >> 8) & 0xff; \
- (*(_c4) = ((_name)) & 0xff; \
- }
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/tasks.inl b/cpukit/rtems/macros/rtems/rtems/tasks.inl
deleted file mode 100644
index a60d80d60c..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/tasks.inl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* tasks.inl
- *
- * This file contains the macro implementation of all inlined
- * routines in the with RTEMS Tasks Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_TASKS_inl
-#define __RTEMS_TASKS_inl
-
-/*PAGE
- *
- * _RTEMS_tasks_Allocate
- *
- */
-
-#define _RTEMS_tasks_Allocate() \
- (Thread_Control *) _Objects_Allocate( &_RTEMS_tasks_Information )
-
-/*PAGE
- *
- * _RTEMS_tasks_Free
- *
- */
-
-#define _RTEMS_tasks_Free( _the_task ) \
- _Objects_Free( &_RTEMS_tasks_Information, &(_the_task)->Object )
-
-/*PAGE
- *
- * _RTEMS_tasks_Priority_to_Core
- */
-
-#define _RTEMS_tasks_Priority_to_Core( _priority ) \
- ((Priority_Control) (_priority))
-
-/*PAGE
- *
- * _RTEMS_tasks_Priority_is_valid
- *
- */
-
-#define _RTEMS_tasks_Priority_is_valid( _the_priority ) \
- ( ((_the_priority) >= RTEMS_MINIMUM_PRIORITY) && \
- ((_the_priority) <= RTEMS_MAXIMUM_PRIORITY) )
-
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/macros/rtems/rtems/timer.inl b/cpukit/rtems/macros/rtems/rtems/timer.inl
deleted file mode 100644
index 5dc329a203..0000000000
--- a/cpukit/rtems/macros/rtems/rtems/timer.inl
+++ /dev/null
@@ -1,85 +0,0 @@
-/* timer.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the Timer Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIMER_inl
-#define __TIMER_inl
-
-/*PAGE
- *
- * _Timer_Allocate
- *
- */
-
-#define _Timer_Allocate() \
- (Timer_Control *) _Objects_Allocate( &_Timer_Information )
-
-/*PAGE
- *
- * _Timer_Free
- *
- */
-
-#define _Timer_Free( _the_timer ) \
- _Objects_Free( &_Timer_Information, &(_the_timer)->Object )
-
-/*PAGE
- *
- * _Timer_Get
- *
- */
-
-#define _Timer_Get( _id, _location ) \
- (Timer_Control *) \
- _Objects_Get( &_Timer_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Timer_Is_interval_class
- *
- */
-
-#define _Timer_Is_interval_class( _the_class ) \
- ( (_the_class) == TIMER_INTERVAL )
-
-/*PAGE
- *
- * _Timer_Is_time_of_day_class
- *
- */
-
-#define _Timer_Is_time_of_day_class( _the_class ) \
- ( (_the_class) == TIMER_TIME_OF_DAY )
-
-/*PAGE
- *
- * _Timer_Is_dormant_class
- *
- */
-
-#define _Timer_Is_dormant_class( _the_class ) \
- ( (_the_class) == TIMER_DORMANT )
-
-/*PAGE
- *
- * _Timer_Is_null
- *
- */
-
-#define _Timer_Is_null( _the_timer ) \
- ( (_the_timer) == NULL )
-
-#endif
-/* end of include file */
diff --git a/cpukit/rtems/src/attr.c b/cpukit/rtems/src/attr.c
deleted file mode 100644
index ea0f68be70..0000000000
--- a/cpukit/rtems/src/attr.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Body for Attribute Routines
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/score/stack.h>
-#include <rtems/rtems/modes.h>
-
-rtems_unsigned32 rtems_minimum_stack_size = STACK_MINIMUM_SIZE;
-rtems_unsigned32 rtems_interrupt_mask = RTEMS_INTERRUPT_MASK;
-
-rtems_attribute rtems_interrupt_level_attribute(
- unsigned32 level
-)
-{
- return RTEMS_INTERRUPT_LEVEL(level);
-}
-
diff --git a/cpukit/rtems/src/dpmem.c b/cpukit/rtems/src/dpmem.c
deleted file mode 100644
index 9cc778df82..0000000000
--- a/cpukit/rtems/src/dpmem.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Dual Port Memory Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/address.h>
-#include <rtems/rtems/dpmem.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/dpmem.h>
-
-/*PAGE
- *
- * _Dual_ported_memory_Manager_initialization
- *
- * This routine initializes all dual-ported memory manager related
- * data structures.
- *
- * Input parameters:
- * maximum_ports - number of ports to initialize
- *
- * Output parameters: NONE
- */
-
-void _Dual_ported_memory_Manager_initialization(
- unsigned32 maximum_ports
-)
-{
- _Objects_Initialize_information(
- &_Dual_ported_memory_Information,
- OBJECTS_RTEMS_PORTS,
- FALSE,
- maximum_ports,
- sizeof( Dual_ported_memory_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-}
-
-/*PAGE
- *
- * rtems_port_create
- *
- * This directive creates a port into a dual-ported memory area.
- *
- * Input parameters:
- * name - user defined port name
- * internal_start - internal start address of port
- * external_start - external start address of port
- * length - physical length in bytes
- * id - address of port id to set
- *
- * Output parameters:
- * id - port id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_port_create(
- rtems_name name,
- void *internal_start,
- void *external_start,
- unsigned32 length,
- Objects_Id *id
-)
-{
- register Dual_ported_memory_Control *the_port;
-
- if ( !rtems_is_name_valid( name) )
- return RTEMS_INVALID_NAME;
-
- if ( !_Addresses_Is_aligned( internal_start ) ||
- !_Addresses_Is_aligned( external_start ) )
- return RTEMS_INVALID_ADDRESS;
-
- _Thread_Disable_dispatch(); /* to prevent deletion */
-
- the_port = _Dual_ported_memory_Allocate();
-
- if ( !the_port ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- the_port->internal_base = internal_start;
- the_port->external_base = external_start;
- the_port->length = length - 1;
-
- _Objects_Open(
- &_Dual_ported_memory_Information,
- &the_port->Object,
- &name
- );
-
- *id = the_port->Object.id;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_port_ident
- *
- * This directive returns the system ID associated with
- * the port name.
- *
- * Input parameters:
- * name - user defined port name
- * id - pointer to port id
- *
- * Output parameters:
- * *id - port id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_port_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id(
- &_Dual_ported_memory_Information,
- &name,
- OBJECTS_SEARCH_ALL_NODES,
- id
- );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_port_delete
- *
- * This directive allows a thread to delete a dual-ported memory area
- * specified by the dual-ported memory identifier.
- *
- * Input parameters:
- * id - dual-ported memory area id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_port_delete(
- Objects_Id id
-)
-{
- register Dual_ported_memory_Control *the_port;
- Objects_Locations location;
-
- the_port = _Dual_ported_memory_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- _Objects_Close( &_Dual_ported_memory_Information, &the_port->Object );
- _Dual_ported_memory_Free( the_port );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_port_internal_to_external
- *
- * This directive converts an internal dual-ported memory address to an
- * external dual-ported memory address. If the given internal address
- * is an invalid dual-ported address, then the external address is set
- * to the given internal address.
- *
- * Input parameters:
- * id - id of dual-ported memory object
- * internal - internal address to set
- * external - pointer to external address
- *
- * Output parameters:
- * external - external address
- * RTEMS_SUCCESSFUL - always succeeds
- */
-
-rtems_status_code rtems_port_internal_to_external(
- Objects_Id id,
- void *internal,
- void **external
-)
-{
- register Dual_ported_memory_Control *the_port;
- Objects_Locations location;
- unsigned32 ending;
-
- the_port = _Dual_ported_memory_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- ending = _Addresses_Subtract( internal, the_port->internal_base );
- if ( ending > the_port->length )
- *external = internal;
- else
- *external = _Addresses_Add_offset( the_port->external_base,
- ending );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_port_external_to_internal
- *
- * This directive converts an external dual-ported memory address to an
- * internal dual-ported memory address. If the given external address
- * is an invalid dual-ported address, then the internal address is set
- * to the given external address.
- *
- * Input parameters:
- * id - id of dp memory object
- * external - external address
- * internal - pointer of internal address to set
- *
- * Output parameters:
- * internal - internal address
- * RTEMS_SUCCESSFUL - always succeeds
- */
-
-rtems_status_code rtems_port_external_to_internal(
- Objects_Id id,
- void *external,
- void **internal
-)
-{
- register Dual_ported_memory_Control *the_port;
- Objects_Locations location;
- unsigned32 ending;
-
- the_port = _Dual_ported_memory_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- ending = _Addresses_Subtract( external, the_port->external_base );
- if ( ending > the_port->length )
- *internal = external;
- else
- *internal = _Addresses_Add_offset( the_port->internal_base,
- ending );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
diff --git a/cpukit/rtems/src/event.c b/cpukit/rtems/src/event.c
deleted file mode 100644
index a780ba7cf7..0000000000
--- a/cpukit/rtems/src/event.c
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * Event Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/event.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/tasks.h>
-
-/*PAGE
- *
- * _Event_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Event_Manager_initialization( void )
-{
- _Event_Sync_state = EVENT_SYNC_SYNCHRONIZED;
-
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor( MP_PACKET_EVENT, _Event_MP_Process_packet );
-}
-
-/*PAGE
- *
- * rtems_event_send
- *
- * This directive allows a thread send an event set to another thread.
- *
- * Input parameters:
- * id - thread id
- * event - event set
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_event_send(
- Objects_Id id,
- rtems_event_set event_in
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
- RTEMS_API_Control *api;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return(
- _Event_MP_Send_request_packet(
- EVENT_MP_SEND_REQUEST,
- id,
- event_in
- )
- );
- case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
- _Event_sets_Post( event_in, &api->pending_events );
- _Event_Surrender( the_thread );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_event_receive
- *
- * This directive allows a thread to receive a set of events.
- *
- * Input parameters:
- * event_in - input event condition
- * option_set - options
- * ticks - number of ticks to wait (0 means wait forever)
- * event_out - pointer to output event set
- *
- * Output parameters:
- * event out - event set
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_event_receive(
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-)
-{
- RTEMS_API_Control *api;
-
- api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ];
-
- if ( _Event_sets_Is_empty( event_in ) ) {
- *event_out = api->pending_events;
- return RTEMS_SUCCESSFUL;
- }
-
- _Thread_Disable_dispatch();
- _Event_Seize( event_in, option_set, ticks, event_out );
- _Thread_Enable_dispatch();
- return( _Thread_Executing->Wait.return_code );
-}
-
-
-/*PAGE
- *
- * _Event_Seize
- *
- * This routine attempts to satisfy the requested event condition
- * for the running thread.
- *
- * Input parameters:
- * event_in - the event condition to satisfy
- * option_set - acquire event options
- * ticks - interval to wait
- * event_out - pointer to event set output area
- *
- * Output parameters: NONE
- * *event_out - event set output area filled in
- *
- * INTERRUPT LATENCY:
- * available
- * wait
- * check sync
- */
-
-void _Event_Seize(
- rtems_event_set event_in,
- rtems_option option_set,
- rtems_interval ticks,
- rtems_event_set *event_out
-)
-{
- Thread_Control *executing;
- rtems_event_set seized_events;
- rtems_event_set pending_events;
- ISR_Level level;
- RTEMS_API_Control *api;
- Event_Sync_states sync_state;
-
- executing = _Thread_Executing;
- executing->Wait.return_code = RTEMS_SUCCESSFUL;
-
- api = executing->API_Extensions[ THREAD_API_RTEMS ];
-
- _ISR_Disable( level );
- pending_events = api->pending_events;
- seized_events = _Event_sets_Get( pending_events, event_in );
-
- if ( !_Event_sets_Is_empty( seized_events ) &&
- (seized_events == event_in || _Options_Is_any( option_set )) ) {
- api->pending_events =
- _Event_sets_Clear( pending_events, seized_events );
- _ISR_Enable( level );
- *event_out = seized_events;
- return;
- }
-
- if ( _Options_Is_no_wait( option_set ) ) {
- _ISR_Enable( level );
- executing->Wait.return_code = RTEMS_UNSATISFIED;
- *event_out = seized_events;
- return;
- }
-
- _Event_Sync_state = EVENT_SYNC_NOTHING_HAPPENED;
-
- executing->Wait.option = (unsigned32) option_set;
- executing->Wait.count = (unsigned32) event_in;
- executing->Wait.return_argument = event_out;
-
- _ISR_Enable( level );
-
- if ( ticks ) {
- _Watchdog_Initialize(
- &executing->Timer,
- _Event_Timeout,
- executing->Object.id,
- NULL
- );
- _Watchdog_Insert_ticks( &executing->Timer, ticks );
- }
-
- _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT );
-
- _ISR_Disable( level );
-
- sync_state = _Event_Sync_state;
- _Event_Sync_state = EVENT_SYNC_SYNCHRONIZED;
-
- switch ( sync_state ) {
- case EVENT_SYNC_SYNCHRONIZED:
- /*
- * This cannot happen. It indicates that this routine did not
- * enter the synchronization states above.
- */
- return;
-
- case EVENT_SYNC_NOTHING_HAPPENED:
- _ISR_Enable( level );
- return;
-
- case EVENT_SYNC_TIMEOUT:
- executing->Wait.return_code = RTEMS_TIMEOUT;
- _ISR_Enable( level );
- _Thread_Unblock( executing );
- return;
-
- case EVENT_SYNC_SATISFIED:
- if ( _Watchdog_Is_active( &executing->Timer ) ) {
- _Watchdog_Deactivate( &executing->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &executing->Timer );
- } else
- _ISR_Enable( level );
- _Thread_Unblock( executing );
- return;
- }
-}
-
-/*PAGE
- *
- * _Event_Surrender
- *
- * This routines remove a thread from the specified threadq.
- *
- * Input parameters:
- * the_thread - pointer to thread to be dequeued
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * before flash
- * after flash
- * check sync
- */
-
-void _Event_Surrender(
- Thread_Control *the_thread
-)
-{
- ISR_Level level;
- rtems_event_set pending_events;
- rtems_event_set event_condition;
- rtems_event_set seized_events;
- rtems_option option_set;
- RTEMS_API_Control *api;
-
- api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
-
- option_set = (rtems_option) the_thread->Wait.option;
-
- _ISR_Disable( level );
- pending_events = api->pending_events;
- event_condition = (rtems_event_set) the_thread->Wait.count;
-
- seized_events = _Event_sets_Get( pending_events, event_condition );
-
- if ( !_Event_sets_Is_empty( seized_events ) ) {
- if ( _States_Is_waiting_for_event( the_thread->current_state ) ) {
- if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
- api->pending_events =
- _Event_sets_Clear( pending_events, seized_events );
- *(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
-
- _ISR_Flash( level );
-
- if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
- _ISR_Enable( level );
- _Thread_Unblock( the_thread );
- }
- else {
- _Watchdog_Deactivate( &the_thread->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &the_thread->Timer );
- _Thread_Unblock( the_thread );
- }
- return;
- }
- }
-
- switch ( _Event_Sync_state ) {
- case EVENT_SYNC_SYNCHRONIZED:
- case EVENT_SYNC_SATISFIED:
- break;
-
- case EVENT_SYNC_NOTHING_HAPPENED:
- case EVENT_SYNC_TIMEOUT:
- if ( !_Thread_Is_executing( the_thread ) )
- break;
-
- if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
- api->pending_events =
- _Event_sets_Clear( pending_events,seized_events );
- *(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
- _Event_Sync_state = EVENT_SYNC_SATISFIED;
- }
- break;
- }
- }
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Event_Timeout
- *
- * This routine processes a thread which timeouts while waiting to
- * receive an event_set. It is called by the watchdog handler.
- *
- * Input parameters:
- * id - thread id
- *
- * Output parameters: NONE
- */
-
-void _Event_Timeout(
- Objects_Id id,
- void *ignored
-)
-{
- Thread_Control *the_thread;
- Objects_Locations location;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* impossible */
- break;
- case OBJECTS_LOCAL:
-
- /*
- * If the event manager is not synchronized, then it is either
- * "nothing happened", "timeout", or "satisfied". If the_thread
- * is the executing thread, then it is in the process of blocking
- * and it is the thread which is responsible for the synchronization
- * process.
- *
- * If it is not satisfied, then it is "nothing happened" and
- * this is the "timeout" transition. After a request is satisfied,
- * a timeout is not allowed to occur.
- */
-
- if ( _Event_Sync_state != EVENT_SYNC_SYNCHRONIZED &&
- _Thread_Is_executing( the_thread ) ) {
- if ( _Event_Sync_state != EVENT_SYNC_SATISFIED )
- _Event_Sync_state = EVENT_SYNC_TIMEOUT;
- } else {
- the_thread->Wait.return_code = RTEMS_TIMEOUT;
- _Thread_Unblock( the_thread );
- }
- _Thread_Unnest_dispatch();
- break;
- }
-}
diff --git a/cpukit/rtems/src/eventmp.c b/cpukit/rtems/src/eventmp.c
deleted file mode 100644
index 4a561e69a2..0000000000
--- a/cpukit/rtems/src/eventmp.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Multiprocessing Support for the Event Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/event.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _Event_MP_Send_process_packet
- *
- * This subprogram is not needed since there are no process
- * packets to be sent by this manager.
- *
- */
-
-/*PAGE
- *
- * _Event_MP_Send_request_packet
- *
- */
-
-rtems_status_code _Event_MP_Send_request_packet (
- Event_MP_Remote_operations operation,
- Objects_Id event_id,
- rtems_event_set event_in
-)
-{
- Event_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case EVENT_MP_SEND_REQUEST:
-
- the_packet = _Event_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_EVENT;
- the_packet->Prefix.length = sizeof ( Event_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Event_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = event_id;
- the_packet->event_in = event_in;
-
- return (rtems_status_code)
- _MPCI_Send_request_packet(
- rtems_get_node( event_id ),
- &the_packet->Prefix,
- STATES_READY
- );
-
- break;
-
- case EVENT_MP_SEND_RESPONSE:
- break;
-
- }
- /*
- * The following line is included to satisfy compilers which
- * produce warnings when a function does not end with a return.
- */
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _Event_MP_Send_response_packet
- *
- */
-
-void _Event_MP_Send_response_packet (
- Event_MP_Remote_operations operation,
- Thread_Control *the_thread
-)
-{
- Event_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case EVENT_MP_SEND_RESPONSE:
-
- the_packet = ( Event_MP_Packet *) the_thread->receive_packet;
-
-/*
- * The packet being returned already contains the class, length, and
- * to_convert fields, therefore they are not set in this routine.
- */
- the_packet->operation = operation;
- the_packet->Prefix.id = the_packet->Prefix.source_tid;
-
- _MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
- &the_packet->Prefix
- );
- break;
-
- case EVENT_MP_SEND_REQUEST:
- break;
-
- }
-}
-
-/*PAGE
- *
- *
- * _Event_MP_Process_packet
- *
- */
-
-void _Event_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-)
-{
- Event_MP_Packet *the_packet;
- Thread_Control *the_thread;
-
- the_packet = (Event_MP_Packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case EVENT_MP_SEND_REQUEST:
-
- the_packet->Prefix.return_code = rtems_event_send(
- the_packet->Prefix.id,
- the_packet->event_in
- );
-
- _Event_MP_Send_response_packet(
- EVENT_MP_SEND_RESPONSE,
- _Thread_Executing
- );
- break;
-
- case EVENT_MP_SEND_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- _MPCI_Return_packet( the_packet_prefix );
-
- break;
-
- }
-}
-
-/*PAGE
- *
- * _Event_MP_Send_object_was_deleted
- *
- * This subprogram is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*PAGE
- *
- * _Event_MP_Send_extract_proxy
- *
- * This subprogram is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*PAGE
- *
- * _Event_MP_Get_packet
- *
- */
-
-Event_MP_Packet *_Event_MP_Get_packet ( void )
-{
- return ( (Event_MP_Packet *) _MPCI_Get_packet() );
-}
-
-/* end of file */
diff --git a/cpukit/rtems/src/intr.c b/cpukit/rtems/src/intr.c
deleted file mode 100644
index 45dce11bdd..0000000000
--- a/cpukit/rtems/src/intr.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Interrupt Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/isr.h>
-#include <rtems/rtems/intr.h>
-
-/* _Interrupt_Manager_initialization
- *
- * This routine initializes the interrupt manager.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _Interrupt_Manager_initialization( void )
-{
-}
-
-/* rtems_interrupt_catch
- *
- * This directive allows a thread to specify what action to take when
- * catching signals.
- *
- * Input parameters:
- * new_isr_handler - address of interrupt service routine (isr)
- * vector - interrupt vector number
- * old_isr_handler - address at which to store previous ISR address
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - always succeeds
- * *old_isr_handler - previous ISR address
- */
-
-rtems_status_code rtems_interrupt_catch(
- rtems_isr_entry new_isr_handler,
- rtems_vector_number vector,
- rtems_isr_entry *old_isr_handler
-)
-{
- if ( !_ISR_Is_vector_number_valid( vector ) )
- return RTEMS_INVALID_NUMBER;
-
- if ( !_ISR_Is_valid_user_handler( (void *) new_isr_handler ) )
- return RTEMS_INVALID_ADDRESS;
-
- if ( !_ISR_Is_valid_user_handler( (void *) old_isr_handler ) )
- return RTEMS_INVALID_ADDRESS;
-
- _ISR_Install_vector(
- vector, (proc_ptr)new_isr_handler, (proc_ptr *)old_isr_handler );
-
- return RTEMS_SUCCESSFUL;
-}
diff --git a/cpukit/rtems/src/intrbody.c b/cpukit/rtems/src/intrbody.c
deleted file mode 100644
index d72e21281d..0000000000
--- a/cpukit/rtems/src/intrbody.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Bodies for Inlined Interrupt Manager Routines
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/isr.h>
-#include <rtems/rtems/intr.h>
-
-/*
- * Real body for rtems_interrupt_disable
- */
-
-#undef rtems_interrupt_disable
-
-rtems_interrupt_level rtems_interrupt_disable( void )
-{
- rtems_interrupt_level previous_level;
-
- _ISR_Disable( previous_level );
-
- return previous_level;
-}
-
-/*
- * Real body for rtems_interrupt_enable
- */
-
-#undef rtems_interrupt_enable
-
-void rtems_interrupt_enable(
- rtems_interrupt_level previous_level
-)
-{
- _ISR_Enable( previous_level );
-}
-
-/*
- * Real body for rtems_interrupt_flash
- */
-
-#undef rtems_interrupt_flash
-
-void rtems_interrupt_flash(
- rtems_interrupt_level previous_level
-)
-{
- _ISR_Flash( previous_level );
-}
-
-/*
- * Real body for rtems_interrupt_is_in_progress
- */
-
-#undef rtems_interrupt_is_in_progress
-
-boolean rtems_interrupt_is_in_progress( void )
-{
- return _ISR_Is_in_progress();
-}
diff --git a/cpukit/rtems/src/mp.c b/cpukit/rtems/src/mp.c
deleted file mode 100644
index 7d9f93c51c..0000000000
--- a/cpukit/rtems/src/mp.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Multiprocessing Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/mp.h>
-#include <rtems/score/mpci.h>
-
-/*PAGE
- *
- * _Multiprocessing_Manager_initialization
- *
- */
-
-void _Multiprocessing_Manager_initialization ( void )
-{
-}
-
-/*PAGE
- *
- * rtems_multiprocessing_announce
- *
- */
-
-void rtems_multiprocessing_announce ( void )
-{
- _MPCI_Announce();
-}
-
-/* end of file */
diff --git a/cpukit/rtems/src/msg.c b/cpukit/rtems/src/msg.c
deleted file mode 100644
index f49e1cac21..0000000000
--- a/cpukit/rtems/src/msg.c
+++ /dev/null
@@ -1,764 +0,0 @@
-/*
- * Message Queue Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/coremsg.h>
-#include <rtems/score/object.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/mpci.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/rtems/message.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _Message_queue_Manager_initialization
- *
- * This routine initializes all message queue manager related
- * data structures.
- *
- * Input parameters:
- * maximum_message_queues - number of message queues to initialize
- *
- * Output parameters: NONE
- */
-
-void _Message_queue_Manager_initialization(
- unsigned32 maximum_message_queues
-)
-{
- _Objects_Initialize_information(
- &_Message_queue_Information,
- OBJECTS_RTEMS_MESSAGE_QUEUES,
- TRUE,
- maximum_message_queues,
- sizeof( Message_queue_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor(
- MP_PACKET_MESSAGE_QUEUE,
- _Message_queue_MP_Process_packet
- );
-
-}
-
-/*PAGE
- *
- * _Message_queue_Allocate
- *
- * Allocate a message queue and the space for its messages
- *
- * Input parameters:
- * the_message_queue - the message queue to allocate message buffers
- * count - maximum message and reserved buffer count
- * max_message_size - maximum size of each message
- *
- * Output parameters:
- * the_message_queue - set if successful, NULL otherwise
- */
-
-Message_queue_Control *_Message_queue_Allocate (
- unsigned32 count,
- unsigned32 max_message_size
-)
-{
- return
- (Message_queue_Control *)_Objects_Allocate(&_Message_queue_Information);
-
-}
-
-/*PAGE
- *
- * rtems_message_queue_create
- *
- * This directive creates a message queue by allocating and initializing
- * a message queue data structure.
- *
- * Input parameters:
- * name - user defined queue name
- * count - maximum message and reserved buffer count
- * max_message_size - maximum size of each message
- * attribute_set - process method
- * id - pointer to queue
- *
- * Output parameters:
- * id - queue id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_create(
- rtems_name name,
- unsigned32 count,
- unsigned32 max_message_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-)
-{
- register Message_queue_Control *the_message_queue;
- CORE_message_queue_Attributes the_message_queue_attributes;
- boolean is_global;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- if ( (is_global = _Attributes_Is_global( attribute_set ) ) &&
- !_System_state_Is_multiprocessing )
- return RTEMS_MP_NOT_CONFIGURED;
-
- if (count == 0)
- return RTEMS_INVALID_NUMBER;
-
- if (max_message_size == 0)
- return RTEMS_INVALID_SIZE;
-
-#if 1
- /*
- * I am not 100% sure this should be an error.
- * It seems reasonable to create a que with a large max size,
- * and then just send smaller msgs from remote (or all) nodes.
- */
-
- if ( is_global && (_MPCI_table->maximum_packet_size < max_message_size) )
- return RTEMS_INVALID_SIZE;
-
-#endif
-
- _Thread_Disable_dispatch(); /* protects object pointer */
-
- the_message_queue = _Message_queue_Allocate( count, max_message_size );
-
- if ( !the_message_queue ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- if ( is_global &&
- !( _Objects_MP_Allocate_and_open( &_Message_queue_Information,
- name, the_message_queue->Object.id, FALSE ) ) ) {
- _Message_queue_Free( the_message_queue );
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- the_message_queue->attribute_set = attribute_set;
-
- if (_Attributes_Is_priority( attribute_set ) )
- the_message_queue_attributes.discipline =
- CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY;
- else
- the_message_queue_attributes.discipline =
- CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO;
-
- if ( ! _CORE_message_queue_Initialize(
- &the_message_queue->message_queue,
- OBJECTS_RTEMS_MESSAGE_QUEUES,
- &the_message_queue_attributes,
- count,
- max_message_size,
- _Message_queue_MP_Send_extract_proxy ) ) {
- if ( is_global )
- _Objects_MP_Close(
- &_Message_queue_Information, the_message_queue->Object.id);
-
- _Message_queue_Free( the_message_queue );
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- _Objects_Open(
- &_Message_queue_Information,
- &the_message_queue->Object,
- &name
- );
-
- *id = the_message_queue->Object.id;
-
- if ( is_global )
- _Message_queue_MP_Send_process_packet(
- MESSAGE_QUEUE_MP_ANNOUNCE_CREATE,
- the_message_queue->Object.id,
- name,
- 0
- );
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_message_queue_ident
- *
- * This directive returns the system ID associated with
- * the message queue name.
- *
- * Input parameters:
- * name - user defined message queue name
- * node - node(s) to be searched
- * id - pointer to message queue id
- *
- * Output parameters:
- * *id - message queue id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id(
- &_Message_queue_Information,
- &name,
- node,
- id
- );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_message_queue_delete
- *
- * This directive allows a thread to delete the message queue specified
- * by the given queue identifier.
- *
- * Input parameters:
- * id - queue id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_delete(
- Objects_Id id
-)
-{
- register Message_queue_Control *the_message_queue;
- Objects_Locations location;
-
- the_message_queue = _Message_queue_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
- case OBJECTS_LOCAL:
- _Objects_Close( &_Message_queue_Information,
- &the_message_queue->Object );
-
- _CORE_message_queue_Close(
- &the_message_queue->message_queue,
- _Message_queue_MP_Send_object_was_deleted,
- CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED
- );
-
- _Message_queue_Free( the_message_queue );
-
- if ( _Attributes_Is_global( the_message_queue->attribute_set ) ) {
- _Objects_MP_Close(
- &_Message_queue_Information,
- the_message_queue->Object.id
- );
-
- _Message_queue_MP_Send_process_packet(
- MESSAGE_QUEUE_MP_ANNOUNCE_DELETE,
- the_message_queue->Object.id,
- 0, /* Not used */
- 0
- );
- }
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_message_queue_send
- *
- * This routine implements the directives q_send. It sends a
- * message to the specified message queue.
- *
- * Input parameters:
- * id - pointer to message queue
- * buffer - pointer to message buffer
- * size - size of message to sent urgently
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_send(
- Objects_Id id,
- void *buffer,
- unsigned32 size
-)
-{
- return( _Message_queue_Submit(id, buffer, size, MESSAGE_QUEUE_SEND_REQUEST) );
-}
-
-/*PAGE
- *
- * rtems_message_queue_urgent
- *
- * This routine implements the directives q_urgent. It urgents a
- * message to the specified message queue.
- *
- * Input parameters:
- * id - pointer to message queue
- * buffer - pointer to message buffer
- * size - size of message to sent urgently
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_urgent(
- Objects_Id id,
- void *buffer,
- unsigned32 size
-)
-{
- return(_Message_queue_Submit(id, buffer, size, MESSAGE_QUEUE_URGENT_REQUEST));
-}
-
-/*PAGE
- *
- * rtems_message_queue_broadcast
- *
- * This directive sends a message for every thread waiting on the queue
- * designated by id.
- *
- * Input parameters:
- * id - pointer to message queue
- * buffer - pointer to message buffer
- * size - size of message to broadcast
- * count - pointer to area to store number of threads made ready
- *
- * Output parameters:
- * count - number of threads made ready
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_broadcast(
- Objects_Id id,
- void *buffer,
- unsigned32 size,
- unsigned32 *count
-)
-{
- register Message_queue_Control *the_message_queue;
- Objects_Locations location;
- CORE_message_queue_Status core_status;
-
- the_message_queue = _Message_queue_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Executing->Wait.return_argument = count;
-
- return
- _Message_queue_MP_Send_request_packet(
- MESSAGE_QUEUE_MP_BROADCAST_REQUEST,
- id,
- buffer,
- &size,
- 0, /* option_set not used */
- MPCI_DEFAULT_TIMEOUT
- );
-
- case OBJECTS_LOCAL:
- core_status = _CORE_message_queue_Broadcast(
- &the_message_queue->message_queue,
- buffer,
- size,
- id,
- _Message_queue_Core_message_queue_mp_support,
- count
- );
-
- _Thread_Enable_dispatch();
- return
- _Message_queue_Translate_core_message_queue_return_code( core_status );
-
- }
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_message_queue_receive
- *
- * This directive dequeues a message from the designated message queue
- * and copies it into the requesting thread's buffer.
- *
- * Input parameters:
- * id - queue id
- * buffer - pointer to message buffer
- * size - size of message receive
- * option_set - options on receive
- * timeout - number of ticks to wait
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_receive(
- Objects_Id id,
- void *buffer,
- unsigned32 *size,
- unsigned32 option_set,
- rtems_interval timeout
-)
-{
- register Message_queue_Control *the_message_queue;
- Objects_Locations location;
- boolean wait;
-
- the_message_queue = _Message_queue_Get( id, &location );
- switch ( location ) {
-
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
-
- case OBJECTS_REMOTE:
- return _Message_queue_MP_Send_request_packet(
- MESSAGE_QUEUE_MP_RECEIVE_REQUEST,
- id,
- buffer,
- size,
- option_set,
- timeout
- );
-
- case OBJECTS_LOCAL:
- if ( _Options_Is_no_wait( option_set ) )
- wait = FALSE;
- else
- wait = TRUE;
-
- _CORE_message_queue_Seize(
- &the_message_queue->message_queue,
- the_message_queue->Object.id,
- buffer,
- size,
- wait,
- timeout
- );
- _Thread_Enable_dispatch();
- return( _Message_queue_Translate_core_message_queue_return_code(
- _Thread_Executing->Wait.return_code ) );
-
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_message_queue_flush
- *
- * This directive removes all pending messages from a queue and returns
- * the number of messages removed. If no messages were present then
- * a count of zero is returned.
- *
- * Input parameters:
- * id - queue id
- * count - return area for count
- *
- * Output parameters:
- * count - number of messages removed ( 0 = empty queue )
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_flush(
- Objects_Id id,
- unsigned32 *count
-)
-{
- register Message_queue_Control *the_message_queue;
- Objects_Locations location;
-
- the_message_queue = _Message_queue_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Executing->Wait.return_argument = count;
-
- return
- _Message_queue_MP_Send_request_packet(
- MESSAGE_QUEUE_MP_FLUSH_REQUEST,
- id,
- 0, /* buffer not used */
- 0, /* size */
- 0, /* option_set not used */
- MPCI_DEFAULT_TIMEOUT
- );
-
- case OBJECTS_LOCAL:
- *count = _CORE_message_queue_Flush( &the_message_queue->message_queue );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_message_queue_get_number_pending
- *
- * This directive returns the number of messages pending.
- *
- * Input parameters:
- * id - queue id
- * count - return area for count
- *
- * Output parameters:
- * count - number of messages removed ( 0 = empty queue )
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_message_queue_get_number_pending(
- Objects_Id id,
- unsigned32 *count
-)
-{
- register Message_queue_Control *the_message_queue;
- Objects_Locations location;
-
- the_message_queue = _Message_queue_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Executing->Wait.return_argument = count;
-
- return
- _Message_queue_MP_Send_request_packet(
- MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST,
- id,
- 0, /* buffer not used */
- 0, /* size */
- 0, /* option_set not used */
- MPCI_DEFAULT_TIMEOUT
- );
-
- case OBJECTS_LOCAL:
- *count = the_message_queue->message_queue.number_of_pending_messages;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * _Message_queue_Submit
- *
- * This routine implements the directives rtems_message_queue_send
- * and rtems_message_queue_urgent. It processes a message that is
- * to be submitted to the designated message queue. The message will
- * either be processed as a send send message which it will be inserted
- * at the rear of the queue or it will be processed as an urgent message
- * which will be inserted at the front of the queue.
- *
- * Input parameters:
- * id - pointer to message queue
- * buffer - pointer to message buffer
- * size - size in bytes of message to send
- * submit_type - send or urgent message
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code _Message_queue_Submit(
- Objects_Id id,
- void *buffer,
- unsigned32 size,
- Message_queue_Submit_types submit_type
-)
-{
- register Message_queue_Control *the_message_queue;
- Objects_Locations location;
- CORE_message_queue_Status core_status;
-
- the_message_queue = _Message_queue_Get( id, &location );
- switch ( location )
- {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
-
- case OBJECTS_REMOTE:
- switch ( submit_type ) {
- case MESSAGE_QUEUE_SEND_REQUEST:
- return
- _Message_queue_MP_Send_request_packet(
- MESSAGE_QUEUE_MP_SEND_REQUEST,
- id,
- buffer,
- &size,
- 0, /* option_set */
- MPCI_DEFAULT_TIMEOUT
- );
-
- case MESSAGE_QUEUE_URGENT_REQUEST:
- return
- _Message_queue_MP_Send_request_packet(
- MESSAGE_QUEUE_MP_URGENT_REQUEST,
- id,
- buffer,
- &size,
- 0, /* option_set */
- MPCI_DEFAULT_TIMEOUT
- );
- }
-
- case OBJECTS_LOCAL:
- switch ( submit_type ) {
- case MESSAGE_QUEUE_SEND_REQUEST:
- core_status = _CORE_message_queue_Send(
- &the_message_queue->message_queue,
- buffer,
- size,
- id,
- _Message_queue_Core_message_queue_mp_support
- );
- break;
- case MESSAGE_QUEUE_URGENT_REQUEST:
- core_status = _CORE_message_queue_Urgent(
- &the_message_queue->message_queue,
- buffer,
- size,
- id,
- _Message_queue_Core_message_queue_mp_support
- );
- break;
- default:
- core_status = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
- return RTEMS_INTERNAL_ERROR; /* should never get here */
- }
-
- _Thread_Enable_dispatch();
- return _Message_queue_Translate_core_message_queue_return_code(
- core_status );
-
- }
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * _Message_queue_Translate_core_message_queue_return_code
- *
- * Input parameters:
- * the_message_queue_status - message_queue status code to translate
- *
- * Output parameters:
- * rtems status code - translated RTEMS status code
- *
- */
-
-rtems_status_code _Message_queue_Translate_core_message_queue_return_code (
- unsigned32 the_message_queue_status
-)
-{
- switch ( the_message_queue_status ) {
- case CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL:
- return RTEMS_SUCCESSFUL;
- case CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE:
- return RTEMS_INVALID_SIZE;
- case CORE_MESSAGE_QUEUE_STATUS_TOO_MANY:
- return RTEMS_TOO_MANY;
- case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED:
- return RTEMS_UNSATISFIED;
- case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT:
- return RTEMS_UNSATISFIED;
- case CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED:
- return RTEMS_OBJECT_WAS_DELETED;
- case CORE_MESSAGE_QUEUE_STATUS_TIMEOUT:
- return RTEMS_TIMEOUT;
- case THREAD_STATUS_PROXY_BLOCKING:
- return RTEMS_PROXY_BLOCKING;
- }
- _Internal_error_Occurred( /* XXX */
- INTERNAL_ERROR_RTEMS_API,
- TRUE,
- the_message_queue_status
- );
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * _Message_queue_Core_message_queue_mp_support
- *
- * Input parameters:
- * the_thread - the remote thread the message was submitted to
- * id - id of the message queue
- *
- * Output parameters: NONE
- */
-
-void _Message_queue_Core_message_queue_mp_support (
- Thread_Control *the_thread,
- Objects_Id id
-)
-{
- the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
-
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_RECEIVE_RESPONSE,
- id,
- the_thread
- );
-}
diff --git a/cpukit/rtems/src/msgmp.c b/cpukit/rtems/src/msgmp.c
deleted file mode 100644
index 707aa94b44..0000000000
--- a/cpukit/rtems/src/msgmp.c
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * Multiprocessing Support for the Message Queue Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/message.h>
-#include <rtems/score/mpci.h>
-#include <rtems/rtems/msgmp.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _Message_queue_MP_Send_process_packet
- *
- */
-
-void _Message_queue_MP_Send_process_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- rtems_name name,
- Objects_Id proxy_id
-)
-{
- Message_queue_MP_Packet *the_packet;
- unsigned32 node;
-
- switch ( operation ) {
-
- case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE:
- case MESSAGE_QUEUE_MP_ANNOUNCE_DELETE:
- case MESSAGE_QUEUE_MP_EXTRACT_PROXY:
-
- the_packet = _Message_queue_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_MESSAGE_QUEUE;
- the_packet->Prefix.length = sizeof ( Message_queue_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Message_queue_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = message_queue_id;
- the_packet->name = name;
- the_packet->proxy_id = proxy_id;
-
- if ( operation == MESSAGE_QUEUE_MP_EXTRACT_PROXY )
- node = rtems_get_node( message_queue_id );
- else
- node = MPCI_ALL_NODES;
-
- _MPCI_Send_process_packet( node, &the_packet->Prefix );
- break;
-
- case MESSAGE_QUEUE_MP_RECEIVE_REQUEST:
- case MESSAGE_QUEUE_MP_RECEIVE_RESPONSE:
- case MESSAGE_QUEUE_MP_SEND_REQUEST:
- case MESSAGE_QUEUE_MP_SEND_RESPONSE:
- case MESSAGE_QUEUE_MP_URGENT_REQUEST:
- case MESSAGE_QUEUE_MP_URGENT_RESPONSE:
- case MESSAGE_QUEUE_MP_BROADCAST_REQUEST:
- case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE:
- case MESSAGE_QUEUE_MP_FLUSH_REQUEST:
- case MESSAGE_QUEUE_MP_FLUSH_RESPONSE:
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST:
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE:
- break;
-
- }
-}
-
-/*PAGE
- *
- * _Message_queue_MP_Send_request_packet
- *
- */
-
-rtems_status_code _Message_queue_MP_Send_request_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- void *buffer,
- unsigned32 *size_p,
- rtems_option option_set,
- rtems_interval timeout
-)
-{
- Message_queue_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case MESSAGE_QUEUE_MP_SEND_REQUEST:
- case MESSAGE_QUEUE_MP_URGENT_REQUEST:
- case MESSAGE_QUEUE_MP_BROADCAST_REQUEST:
- case MESSAGE_QUEUE_MP_FLUSH_REQUEST:
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST:
-
- the_packet = _Message_queue_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_MESSAGE_QUEUE;
- the_packet->Prefix.length = sizeof(Message_queue_MP_Packet);
- if ( size_p )
- the_packet->Prefix.length += *size_p;
- the_packet->Prefix.to_convert = sizeof(Message_queue_MP_Packet);
-
- /*
- * make sure message is not too big for our MPCI driver
- * We have to check it here instead of waiting for MPCI because
- * we are about to slam in the payload
- */
-
- if (the_packet->Prefix.length > _MPCI_table->maximum_packet_size) {
- _Thread_Enable_dispatch();
- return RTEMS_INVALID_SIZE;
- }
-
- if (! _Options_Is_no_wait(option_set))
- the_packet->Prefix.timeout = timeout;
-
- the_packet->operation = operation;
- the_packet->Prefix.id = message_queue_id;
- the_packet->option_set = option_set;
-
- /*
- * Copy the data into place if needed
- */
-
- if (buffer) {
- the_packet->Buffer.size = *size_p;
- _CORE_message_queue_Copy_buffer(
- buffer,
- the_packet->Buffer.buffer,
- *size_p
- );
- }
-
- return (rtems_status_code) _MPCI_Send_request_packet(
- rtems_get_node(message_queue_id),
- &the_packet->Prefix,
- STATES_WAITING_FOR_MESSAGE
- );
- break;
-
- case MESSAGE_QUEUE_MP_RECEIVE_REQUEST:
-
- the_packet = _Message_queue_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_MESSAGE_QUEUE;
- the_packet->Prefix.length = sizeof(Message_queue_MP_Packet);
- the_packet->Prefix.to_convert = sizeof(Message_queue_MP_Packet);
-
- if (! _Options_Is_no_wait(option_set))
- the_packet->Prefix.timeout = timeout;
-
- the_packet->operation = MESSAGE_QUEUE_MP_RECEIVE_REQUEST;
- the_packet->Prefix.id = message_queue_id;
- the_packet->option_set = option_set;
- the_packet->size = 0; /* just in case of an error */
-
- _Thread_Executing->Wait.return_argument = (unsigned32 *)buffer;
- _Thread_Executing->Wait.return_argument_1 = size_p;
-
- return (rtems_status_code) _MPCI_Send_request_packet(
- rtems_get_node(message_queue_id),
- &the_packet->Prefix,
- STATES_WAITING_FOR_MESSAGE
- );
- break;
-
- case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE:
- case MESSAGE_QUEUE_MP_ANNOUNCE_DELETE:
- case MESSAGE_QUEUE_MP_EXTRACT_PROXY:
- case MESSAGE_QUEUE_MP_RECEIVE_RESPONSE:
- case MESSAGE_QUEUE_MP_SEND_RESPONSE:
- case MESSAGE_QUEUE_MP_URGENT_RESPONSE:
- case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE:
- case MESSAGE_QUEUE_MP_FLUSH_RESPONSE:
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE:
- break;
- }
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _Message_queue_MP_Send_response_packet
- *
- */
-
-void _Message_queue_MP_Send_response_packet (
- Message_queue_MP_Remote_operations operation,
- Objects_Id message_queue_id,
- Thread_Control *the_thread
-)
-{
- Message_queue_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case MESSAGE_QUEUE_MP_RECEIVE_RESPONSE:
- case MESSAGE_QUEUE_MP_SEND_RESPONSE:
- case MESSAGE_QUEUE_MP_URGENT_RESPONSE:
- case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE:
- case MESSAGE_QUEUE_MP_FLUSH_RESPONSE:
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE:
-
- the_packet = ( Message_queue_MP_Packet *) the_thread->receive_packet;
-
-/*
- * The packet being returned already contains the class, length, and
- * to_convert fields, therefore they are not set in this routine.
- *
- * Exception: MESSAGE_QUEUE_MP_RECEIVE_RESPONSE needs payload length
- * added to 'length'
- */
- the_packet->operation = operation;
- the_packet->Prefix.id = the_packet->Prefix.source_tid;
-
- if (operation == MESSAGE_QUEUE_MP_RECEIVE_RESPONSE)
- the_packet->Prefix.length += the_packet->size;
-
- _MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
- &the_packet->Prefix
- );
- break;
-
- case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE:
- case MESSAGE_QUEUE_MP_ANNOUNCE_DELETE:
- case MESSAGE_QUEUE_MP_EXTRACT_PROXY:
- case MESSAGE_QUEUE_MP_RECEIVE_REQUEST:
- case MESSAGE_QUEUE_MP_SEND_REQUEST:
- case MESSAGE_QUEUE_MP_URGENT_REQUEST:
- case MESSAGE_QUEUE_MP_BROADCAST_REQUEST:
- case MESSAGE_QUEUE_MP_FLUSH_REQUEST:
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST:
- break;
-
- }
-}
-
-/*PAGE
- *
- *
- * _Message_queue_MP_Process_packet
- *
- */
-
-void _Message_queue_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-)
-{
- Message_queue_MP_Packet *the_packet;
- Thread_Control *the_thread;
- boolean ignored;
-
- the_packet = (Message_queue_MP_Packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE:
-
- ignored = _Objects_MP_Allocate_and_open(
- &_Message_queue_Information,
- the_packet->name,
- the_packet->Prefix.id,
- TRUE
- );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case MESSAGE_QUEUE_MP_ANNOUNCE_DELETE:
-
- _Objects_MP_Close( &_Message_queue_Information, the_packet->Prefix.id );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case MESSAGE_QUEUE_MP_EXTRACT_PROXY:
-
- the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
-
- if (! _Thread_Is_null( the_thread ) )
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case MESSAGE_QUEUE_MP_RECEIVE_REQUEST:
-
- the_packet->Prefix.return_code = rtems_message_queue_receive(
- the_packet->Prefix.id,
- the_packet->Buffer.buffer,
- &the_packet->size,
- the_packet->option_set,
- the_packet->Prefix.timeout
- );
-
- if (! _Thread_Is_proxy_blocking( the_packet->Prefix.return_code ) )
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_RECEIVE_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case MESSAGE_QUEUE_MP_RECEIVE_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- if (the_packet->Prefix.return_code == RTEMS_SUCCESSFUL) {
- *(rtems_unsigned32 *)the_thread->Wait.return_argument_1 =
- the_packet->size;
-
- _CORE_message_queue_Copy_buffer(
- the_packet->Buffer.buffer,
- the_thread->Wait.return_argument,
- the_packet->size
- );
- }
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case MESSAGE_QUEUE_MP_SEND_REQUEST:
-
- the_packet->Prefix.return_code = rtems_message_queue_send(
- the_packet->Prefix.id,
- the_packet->Buffer.buffer,
- the_packet->Buffer.size
- );
-
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_SEND_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case MESSAGE_QUEUE_MP_SEND_RESPONSE:
- case MESSAGE_QUEUE_MP_URGENT_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case MESSAGE_QUEUE_MP_URGENT_REQUEST:
-
- the_packet->Prefix.return_code = rtems_message_queue_urgent(
- the_packet->Prefix.id,
- the_packet->Buffer.buffer,
- the_packet->Buffer.size
- );
-
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_URGENT_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case MESSAGE_QUEUE_MP_BROADCAST_REQUEST:
-
- the_packet->Prefix.return_code = rtems_message_queue_broadcast(
- the_packet->Prefix.id,
- the_packet->Buffer.buffer,
- the_packet->Buffer.size,
- &the_packet->count
- );
-
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_BROADCAST_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE:
- case MESSAGE_QUEUE_MP_FLUSH_RESPONSE:
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- *(unsigned32 *)the_thread->Wait.return_argument = the_packet->count;
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case MESSAGE_QUEUE_MP_FLUSH_REQUEST:
-
- the_packet->Prefix.return_code = rtems_message_queue_flush(
- the_packet->Prefix.id,
- &the_packet->count
- );
-
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_FLUSH_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST:
-
- the_packet->Prefix.return_code = rtems_message_queue_get_number_pending(
- the_packet->Prefix.id,
- &the_packet->count
- );
-
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- }
-}
-
-/*PAGE
- *
- * _Message_queue_MP_Send_object_was_deleted
- *
- */
-
-void _Message_queue_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-)
-{
- the_proxy->receive_packet->return_code = RTEMS_OBJECT_WAS_DELETED;
-
- _Message_queue_MP_Send_response_packet(
- MESSAGE_QUEUE_MP_RECEIVE_RESPONSE,
- the_proxy->Wait.id,
- the_proxy
- );
-}
-
-/*PAGE
- *
- * _Message_queue_MP_Send_extract_proxy
- *
- */
-
-void _Message_queue_MP_Send_extract_proxy (
- Thread_Control *the_thread
-)
-{
- _Message_queue_MP_Send_process_packet(
- MESSAGE_QUEUE_MP_EXTRACT_PROXY,
- the_thread->Wait.id,
- (rtems_name) 0,
- the_thread->Object.id
- );
-}
-
-/*PAGE
- *
- * _Message_queue_MP_Get_packet
- *
- */
-
-Message_queue_MP_Packet *_Message_queue_MP_Get_packet ( void )
-{
- return ( (Message_queue_MP_Packet *) _MPCI_Get_packet() );
-}
-
-/* end of file */
diff --git a/cpukit/rtems/src/part.c b/cpukit/rtems/src/part.c
deleted file mode 100644
index 0698f0db71..0000000000
--- a/cpukit/rtems/src/part.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Partition Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/address.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/part.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/sysstate.h>
-
-/*PAGE
- *
- * _Partition_Manager_initialization
- *
- * This routine initializes all partition manager related
- * data structures.
- *
- * Input parameters:
- * maximum_partitions - number of partitions to initialize
- *
- * Output parameters: NONE
- */
-
-void _Partition_Manager_initialization(
- unsigned32 maximum_partitions
-)
-{
- _Objects_Initialize_information(
- &_Partition_Information,
- OBJECTS_RTEMS_PARTITIONS,
- TRUE,
- maximum_partitions,
- sizeof( Partition_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor(
- MP_PACKET_PARTITION,
- _Partition_MP_Process_packet
- );
-
-}
-
-/*PAGE
- *
- * rtems_partition_create
- *
- * This directive creates a partiton of fixed sized buffers from the
- * given contiguous memory area.
- *
- * Input parameters:
- * name - user defined partition name
- * starting_address - physical start address of partition
- * length - physical length in bytes
- * buffer_size - size of buffers in bytes
- * attribute_set - partition attributes
- * id - pointer to partition id
- *
- * Output parameters:
- * id - partition id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_partition_create(
- rtems_name name,
- void *starting_address,
- unsigned32 length,
- unsigned32 buffer_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-)
-{
- register Partition_Control *the_partition;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- if ( length == 0 || buffer_size == 0 || length < buffer_size ||
- !_Partition_Is_buffer_size_aligned( buffer_size ) )
- return RTEMS_INVALID_SIZE;
-
- if ( !_Addresses_Is_aligned( starting_address ) )
- return RTEMS_INVALID_ADDRESS;
-
- if ( _Attributes_Is_global( attribute_set ) &&
- !_System_state_Is_multiprocessing )
- return RTEMS_MP_NOT_CONFIGURED;
-
- _Thread_Disable_dispatch(); /* prevents deletion */
-
- the_partition = _Partition_Allocate();
-
- if ( !the_partition ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- if ( _Attributes_Is_global( attribute_set ) &&
- !( _Objects_MP_Allocate_and_open( &_Partition_Information, name,
- the_partition->Object.id, FALSE ) ) ) {
- _Partition_Free( the_partition );
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
- the_partition->starting_address = starting_address;
- the_partition->length = length;
- the_partition->buffer_size = buffer_size;
- the_partition->attribute_set = attribute_set;
- the_partition->number_of_used_blocks = 0;
-
- _Chain_Initialize( &the_partition->Memory, starting_address,
- length / buffer_size, buffer_size );
-
- _Objects_Open( &_Partition_Information, &the_partition->Object, &name );
-
- *id = the_partition->Object.id;
- if ( _Attributes_Is_global( attribute_set ) )
- _Partition_MP_Send_process_packet(
- PARTITION_MP_ANNOUNCE_CREATE,
- the_partition->Object.id,
- name,
- 0 /* Not used */
- );
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_partition_ident
- *
- * This directive returns the system ID associated with
- * the partition name.
- *
- * Input parameters:
- * name - user defined partition name
- * node - node(s) to be searched
- * id - pointer to partition id
- *
- * Output parameters:
- * *id - partition id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_partition_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id( &_Partition_Information, &name, node, id );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_partition_delete
- *
- * This directive allows a thread to delete a partition specified by
- * the partition identifier, provided that none of its buffers are
- * still allocated.
- *
- * Input parameters:
- * id - partition id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_partition_delete(
- Objects_Id id
-)
-{
- register Partition_Control *the_partition;
- Objects_Locations location;
-
- the_partition = _Partition_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
- case OBJECTS_LOCAL:
- if ( the_partition->number_of_used_blocks == 0 ) {
- _Objects_Close( &_Partition_Information, &the_partition->Object );
- _Partition_Free( the_partition );
- if ( _Attributes_Is_global( the_partition->attribute_set ) ) {
-
- _Objects_MP_Close(
- &_Partition_Information,
- the_partition->Object.id
- );
-
- _Partition_MP_Send_process_packet(
- PARTITION_MP_ANNOUNCE_DELETE,
- the_partition->Object.id,
- 0, /* Not used */
- 0 /* Not used */
- );
- }
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_RESOURCE_IN_USE;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_partition_get_buffer
- *
- * This directive will obtain a buffer from a buffer partition.
- *
- * Input parameters:
- * id - partition id
- * buffer - pointer to buffer address
- *
- * Output parameters:
- * buffer - pointer to buffer address filled in
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_partition_get_buffer(
- Objects_Id id,
- void **buffer
-)
-{
- register Partition_Control *the_partition;
- Objects_Locations location;
- void *the_buffer;
-
- the_partition = _Partition_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Executing->Wait.return_argument = buffer;
- return(
- _Partition_MP_Send_request_packet(
- PARTITION_MP_GET_BUFFER_REQUEST,
- id,
- 0 /* Not used */
- )
- );
- case OBJECTS_LOCAL:
- the_buffer = _Partition_Allocate_buffer( the_partition );
- if ( the_buffer ) {
- the_partition->number_of_used_blocks += 1;
- _Thread_Enable_dispatch();
- *buffer = the_buffer;
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_UNSATISFIED;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_partition_return_buffer
- *
- * This directive will return the given buffer to the specified
- * buffer partition.
- *
- * Input parameters:
- * id - partition id
- * buffer - pointer to buffer address
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_partition_return_buffer(
- Objects_Id id,
- void *buffer
-)
-{
- register Partition_Control *the_partition;
- Objects_Locations location;
-
- the_partition = _Partition_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return(
- _Partition_MP_Send_request_packet(
- PARTITION_MP_RETURN_BUFFER_REQUEST,
- id,
- buffer
- )
- );
- case OBJECTS_LOCAL:
- if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) {
- _Partition_Free_buffer( the_partition, buffer );
- the_partition->number_of_used_blocks -= 1;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_INVALID_ADDRESS;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
diff --git a/cpukit/rtems/src/partmp.c b/cpukit/rtems/src/partmp.c
deleted file mode 100644
index 17234974ef..0000000000
--- a/cpukit/rtems/src/partmp.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Multiprocessing Support for the Partition Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/part.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _Partition_MP_Send_process_packet
- *
- */
-
-void _Partition_MP_Send_process_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- rtems_name name,
- Objects_Id proxy_id
-)
-{
- Partition_MP_Packet *the_packet;
- unsigned32 node;
-
- switch ( operation ) {
-
- case PARTITION_MP_ANNOUNCE_CREATE:
- case PARTITION_MP_ANNOUNCE_DELETE:
- case PARTITION_MP_EXTRACT_PROXY:
-
- the_packet = _Partition_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_PARTITION;
- the_packet->Prefix.length = sizeof ( Partition_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Partition_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = partition_id;
- the_packet->name = name;
- the_packet->proxy_id = proxy_id;
-
- if ( operation == PARTITION_MP_EXTRACT_PROXY )
- node = rtems_get_node( partition_id );
- else
- node = MPCI_ALL_NODES;
-
- _MPCI_Send_process_packet( node, &the_packet->Prefix );
- break;
-
- case PARTITION_MP_GET_BUFFER_REQUEST:
- case PARTITION_MP_GET_BUFFER_RESPONSE:
- case PARTITION_MP_RETURN_BUFFER_REQUEST:
- case PARTITION_MP_RETURN_BUFFER_RESPONSE:
- break;
- }
-}
-
-/*PAGE
- *
- * _Partition_MP_Send_request_packet
- *
- */
-
-rtems_status_code _Partition_MP_Send_request_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- void *buffer
-)
-{
- Partition_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case PARTITION_MP_GET_BUFFER_REQUEST:
- case PARTITION_MP_RETURN_BUFFER_REQUEST:
-
- the_packet = _Partition_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_PARTITION;
- the_packet->Prefix.length = sizeof ( Partition_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Partition_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = partition_id;
- the_packet->buffer = buffer;
-
- return
- _MPCI_Send_request_packet(
- rtems_get_node( partition_id ),
- &the_packet->Prefix,
- STATES_READY /* Not used */
- );
-
- break;
-
- case PARTITION_MP_ANNOUNCE_CREATE:
- case PARTITION_MP_ANNOUNCE_DELETE:
- case PARTITION_MP_EXTRACT_PROXY:
- case PARTITION_MP_GET_BUFFER_RESPONSE:
- case PARTITION_MP_RETURN_BUFFER_RESPONSE:
- break;
-
- }
- /*
- * The following line is included to satisfy compilers which
- * produce warnings when a function does not end with a return.
- */
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _Partition_MP_Send_response_packet
- *
- */
-
-void _Partition_MP_Send_response_packet (
- Partition_MP_Remote_operations operation,
- Objects_Id partition_id,
- Thread_Control *the_thread
-)
-{
- Partition_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case PARTITION_MP_GET_BUFFER_RESPONSE:
- case PARTITION_MP_RETURN_BUFFER_RESPONSE:
-
- the_packet = ( Partition_MP_Packet *) the_thread->receive_packet;
-
-/*
- * The packet being returned already contains the class, length, and
- * to_convert fields, therefore they are not set in this routine.
- */
- the_packet->operation = operation;
- the_packet->Prefix.id = the_packet->Prefix.source_tid;
-
- _MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
- &the_packet->Prefix
- );
- break;
-
- case PARTITION_MP_ANNOUNCE_CREATE:
- case PARTITION_MP_ANNOUNCE_DELETE:
- case PARTITION_MP_EXTRACT_PROXY:
- case PARTITION_MP_GET_BUFFER_REQUEST:
- case PARTITION_MP_RETURN_BUFFER_REQUEST:
- break;
-
- }
-}
-
-/*PAGE
- *
- *
- * _Partition_MP_Process_packet
- *
- */
-
-void _Partition_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-)
-{
- Partition_MP_Packet *the_packet;
- Thread_Control *the_thread;
- boolean ignored;
-
- the_packet = (Partition_MP_Packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case PARTITION_MP_ANNOUNCE_CREATE:
-
- ignored = _Objects_MP_Allocate_and_open(
- &_Partition_Information,
- the_packet->name,
- the_packet->Prefix.id,
- TRUE
- );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case PARTITION_MP_ANNOUNCE_DELETE:
-
- _Objects_MP_Close( &_Partition_Information, the_packet->Prefix.id );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case PARTITION_MP_EXTRACT_PROXY:
-
- the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
-
- if ( ! _Thread_Is_null( the_thread ) )
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case PARTITION_MP_GET_BUFFER_REQUEST:
-
- the_packet->Prefix.return_code = rtems_partition_get_buffer(
- the_packet->Prefix.id,
- &the_packet->buffer
- );
-
- _Partition_MP_Send_response_packet(
- PARTITION_MP_GET_BUFFER_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case PARTITION_MP_GET_BUFFER_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- *(void **)the_thread->Wait.return_argument = the_packet->buffer;
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case PARTITION_MP_RETURN_BUFFER_REQUEST:
-
- the_packet->Prefix.return_code = rtems_partition_return_buffer(
- the_packet->Prefix.id,
- the_packet->buffer
- );
-
- _Partition_MP_Send_response_packet(
- PARTITION_MP_RETURN_BUFFER_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case PARTITION_MP_RETURN_BUFFER_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- }
-}
-
-/*PAGE
- *
- * _Partition_MP_Send_object_was_deleted
- *
- * This routine is not needed by the Partition since a partition
- * cannot be deleted when buffers are in use.
- *
- */
-
-/*PAGE
- *
- * _Partition_MP_Send_extract_proxy
- *
- */
-
-void _Partition_MP_Send_extract_proxy (
- Thread_Control *the_thread
-)
-{
- _Partition_MP_Send_process_packet(
- PARTITION_MP_EXTRACT_PROXY,
- the_thread->Wait.id,
- (rtems_name) 0,
- the_thread->Object.id
- );
-
-}
-
-/*PAGE
- *
- * _Partition_MP_Get_packet
- *
- */
-
-Partition_MP_Packet *_Partition_MP_Get_packet ( void )
-{
- return ( (Partition_MP_Packet *) _MPCI_Get_packet() );
-}
-
-/* end of file */
diff --git a/cpukit/rtems/src/ratemon.c b/cpukit/rtems/src/ratemon.c
deleted file mode 100644
index ff9bb5bc21..0000000000
--- a/cpukit/rtems/src/ratemon.c
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- * Rate Monotonic Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/ratemon.h>
-#include <rtems/score/thread.h>
-
-/*PAGE
- *
- * _Rate_monotonic_Manager_initialization
- *
- * This routine initializes all Rate Monotonic Manager related
- * data structures.
- *
- * Input parameters:
- * maximum_periods - number of periods timers to initialize
- *
- * Output parameters: NONE
- *
- * NOTE: The Rate Monotonic Manager is built on top of the Watchdog
- * Handler.
- */
-
-void _Rate_monotonic_Manager_initialization(
- unsigned32 maximum_periods
-)
-{
- _Objects_Initialize_information(
- &_Rate_monotonic_Information,
- OBJECTS_RTEMS_PERIODS,
- FALSE,
- maximum_periods,
- sizeof( Rate_monotonic_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-}
-
-/*PAGE
- *
- * rtems_rate_monotonic_create
- *
- * This directive creates a rate monotonic timer and performs
- * some initialization.
- *
- * Input parameters:
- * name - name of period
- * id - pointer to rate monotonic id
- *
- * Output parameters:
- * id - rate monotonic id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_rate_monotonic_create(
- rtems_name name,
- Objects_Id *id
-)
-{
- Rate_monotonic_Control *the_period;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- _Thread_Disable_dispatch(); /* to prevent deletion */
-
- the_period = _Rate_monotonic_Allocate();
-
- if ( !the_period ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- the_period->owner = _Thread_Executing;
- the_period->state = RATE_MONOTONIC_INACTIVE;
-
- _Objects_Open( &_Rate_monotonic_Information, &the_period->Object, &name );
-
- *id = the_period->Object.id;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_rate_monotonic_ident
- *
- * This directive returns the system ID associated with
- * the rate monotonic period name.
- *
- * Input parameters:
- * name - user defined period name
- * id - pointer to period id
- *
- * Output parameters:
- * *id - region id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_rate_monotonic_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id(
- &_Rate_monotonic_Information,
- &name,
- OBJECTS_SEARCH_LOCAL_NODE,
- id
- );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_rate_monotonic_cancel
- *
- * This directive allows a thread to cancel a rate monotonic timer.
- *
- * Input parameters:
- * id - rate monotonic id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful and caller is not the owning thread
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_rate_monotonic_cancel(
- Objects_Id id
-)
-{
- Rate_monotonic_Control *the_period;
- Objects_Locations location;
-
- the_period = _Rate_monotonic_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return RTEMS_INTERNAL_ERROR; /* should never return this */
- case OBJECTS_LOCAL:
- if ( !_Thread_Is_executing( the_period->owner ) ) {
- _Thread_Enable_dispatch();
- return RTEMS_NOT_OWNER_OF_RESOURCE;
- }
- (void) _Watchdog_Remove( &the_period->Timer );
- the_period->state = RATE_MONOTONIC_INACTIVE;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_rate_monotonic_delete
- *
- * This directive allows a thread to delete a rate monotonic timer.
- *
- * Input parameters:
- * id - rate monotonic id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_rate_monotonic_delete(
- Objects_Id id
-)
-{
- Rate_monotonic_Control *the_period;
- Objects_Locations location;
-
- the_period = _Rate_monotonic_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- _Objects_Close( &_Rate_monotonic_Information, &the_period->Object );
- (void) _Watchdog_Remove( &the_period->Timer );
- the_period->state = RATE_MONOTONIC_INACTIVE;
- _Rate_monotonic_Free( the_period );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_rate_monotonic_get_status
- *
- * This directive allows a thread to obtain status information on a
- * period.
- *
- * Input parameters:
- * id - rate monotonic id
- * status - pointer to status control block
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- *
- */
-
-rtems_status_code rtems_rate_monotonic_get_status(
- Objects_Id id,
- rtems_rate_monotonic_period_status *status
-)
-{
- Objects_Locations location;
- Rate_monotonic_Control *the_period;
-
- if ( status == NULL )
- return RTEMS_INVALID_ADDRESS;
-
- the_period = _Rate_monotonic_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- status->state = the_period->state;
-
- if ( status->state == RATE_MONOTONIC_INACTIVE ) {
- status->ticks_since_last_period = 0;
- status->ticks_executed_since_last_period = 0;
- } else {
- status->ticks_since_last_period =
- _Watchdog_Ticks_since_boot - the_period->time_at_period;
-
- status->ticks_executed_since_last_period =
- the_period->owner->ticks_executed -
- the_period->owner_ticks_executed_at_period;
- }
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-
-/*PAGE
- *
- * rtems_rate_monotonic_period
- *
- * This directive allows a thread to manipulate a rate monotonic timer.
- *
- * Input parameters:
- * id - rate monotonic id
- * length - length of period (in ticks)
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_rate_monotonic_period(
- Objects_Id id,
- rtems_interval length
-)
-{
- Rate_monotonic_Control *the_period;
- Objects_Locations location;
- rtems_status_code return_value;
- rtems_rate_monotonic_period_states local_state;
- ISR_Level level;
-
- the_period = _Rate_monotonic_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- if ( !_Thread_Is_executing( the_period->owner ) ) {
- _Thread_Enable_dispatch();
- return RTEMS_NOT_OWNER_OF_RESOURCE;
- }
-
- if ( length == RTEMS_PERIOD_STATUS ) {
- switch ( the_period->state ) {
- case RATE_MONOTONIC_INACTIVE:
- return_value = RTEMS_NOT_DEFINED;
- break;
- case RATE_MONOTONIC_ACTIVE:
- return_value = RTEMS_SUCCESSFUL;
- break;
- case RATE_MONOTONIC_EXPIRED:
- return_value = RTEMS_TIMEOUT;
- break;
- default: /* unreached -- only to remove warnings */
- return_value = RTEMS_INTERNAL_ERROR;
- break;
- }
- _Thread_Enable_dispatch();
- return( return_value );
- }
-
- _ISR_Disable( level );
- switch ( the_period->state ) {
- case RATE_MONOTONIC_INACTIVE:
- _ISR_Enable( level );
- the_period->state = RATE_MONOTONIC_ACTIVE;
- _Watchdog_Initialize(
- &the_period->Timer,
- _Rate_monotonic_Timeout,
- id,
- NULL
- );
-
- the_period->owner_ticks_executed_at_period =
- _Thread_Executing->ticks_executed;
-
- the_period->time_at_period = _Watchdog_Ticks_since_boot;
-
- _Watchdog_Insert_ticks( &the_period->Timer, length );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-
- case RATE_MONOTONIC_ACTIVE:
- /*
- * This tells the _Rate_monotonic_Timeout that this task is
- * in the process of blocking on the period.
- */
-
- the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING;
- _ISR_Enable( level );
-
- _Thread_Executing->Wait.id = the_period->Object.id;
- _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
-
- /*
- * Did the watchdog timer expire while we were actually blocking
- * on it?
- */
-
- _ISR_Disable( level );
- local_state = the_period->state;
- the_period->state = RATE_MONOTONIC_ACTIVE;
- _ISR_Enable( level );
-
- /*
- * If it did, then we want to unblock ourself and continue as
- * if nothing happen. The period was reset in the timeout routine.
- */
-
- if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING )
- _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- break;
-
- case RATE_MONOTONIC_EXPIRED:
- _ISR_Enable( level );
- the_period->state = RATE_MONOTONIC_ACTIVE;
- the_period->owner_ticks_executed_at_period =
- _Thread_Executing->ticks_executed;
- the_period->time_at_period = _Watchdog_Ticks_since_boot;
-
- _Watchdog_Insert_ticks( &the_period->Timer, length );
- _Thread_Enable_dispatch();
- return RTEMS_TIMEOUT;
-
- case RATE_MONOTONIC_OWNER_IS_BLOCKING:
- case RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING:
- /*
- * These should never happen.
- */
- break;
- }
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * _Rate_monotonic_Timeout
- *
- * This routine processes a period ending. If the owning thread
- * is waiting for the period, that thread is unblocked and the
- * period reinitiated. Otherwise, the period is expired.
- * This routine is called by the watchdog handler.
- *
- * Input parameters:
- * id - period id
- *
- * Output parameters: NONE
- */
-
-void _Rate_monotonic_Timeout(
- Objects_Id id,
- void *ignored
-)
-{
- Rate_monotonic_Control *the_period;
- Objects_Locations location;
- Thread_Control *the_thread;
-
- the_period = _Rate_monotonic_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* impossible */
- break;
- case OBJECTS_LOCAL:
- the_thread = the_period->owner;
- if ( _States_Is_waiting_for_period( the_thread->current_state ) &&
- the_thread->Wait.id == the_period->Object.id ) {
- _Thread_Unblock( the_thread );
- the_period->owner_ticks_executed_at_period =
- the_thread->ticks_executed;
-
- the_period->time_at_period = _Watchdog_Ticks_since_boot;
-
- _Watchdog_Reset( &the_period->Timer );
- } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) {
- the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
- the_period->owner_ticks_executed_at_period =
- the_thread->ticks_executed;
-
- the_period->time_at_period = _Watchdog_Ticks_since_boot;
- _Watchdog_Reset( &the_period->Timer );
- } else
- the_period->state = RATE_MONOTONIC_EXPIRED;
- _Thread_Unnest_dispatch();
- break;
- }
-}
-
diff --git a/cpukit/rtems/src/region.c b/cpukit/rtems/src/region.c
deleted file mode 100644
index c238bf51c5..0000000000
--- a/cpukit/rtems/src/region.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Region Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/region.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-
-/*PAGE
- *
- * _Region_Manager_initialization
- *
- * This routine initializes all region manager related data structures.
- *
- * Input parameters:
- * maximum_regions - number of regions to initialize
- *
- * Output parameters: NONE
- */
-
-void _Region_Manager_initialization(
- unsigned32 maximum_regions
-)
-{
- _Objects_Initialize_information(
- &_Region_Information,
- OBJECTS_RTEMS_REGIONS,
- FALSE,
- maximum_regions,
- sizeof( Region_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor(
- MP_PACKET_REGION,
- 0 /* XXX _Region_MP_Process_packet */
- );
-
-}
-
-/*PAGE
- *
- * rtems_region_create
- *
- * This directive creates a region of physical contiguous memory area
- * from which variable sized segments can be allocated.
- *
- * Input parameters:
- * name - user defined region name
- * starting_address - physical start address of region
- * length - physical length in bytes
- * page_size - page size in bytes
- * attribute_set - region attributes
- * id - address of region id to set
- *
- * Output parameters:
- * id - region id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_region_create(
- rtems_name name,
- void *starting_address,
- unsigned32 length,
- unsigned32 page_size,
- rtems_attribute attribute_set,
- Objects_Id *id
-)
-{
- Region_Control *the_region;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- if ( !_Addresses_Is_aligned( starting_address ) )
- return RTEMS_INVALID_ADDRESS;
-
- _Thread_Disable_dispatch(); /* to prevent deletion */
-
- the_region = _Region_Allocate();
-
- if ( !the_region ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- the_region->maximum_segment_size =
- _Heap_Initialize(&the_region->Memory, starting_address, length, page_size);
-
- if ( !the_region->maximum_segment_size ) {
- _Region_Free( the_region );
- _Thread_Enable_dispatch();
- return RTEMS_INVALID_SIZE;
- }
-
- the_region->starting_address = starting_address;
- the_region->length = length;
- the_region->page_size = page_size;
- the_region->attribute_set = attribute_set;
- the_region->number_of_used_blocks = 0;
-
- _Thread_queue_Initialize(
- &the_region->Wait_queue,
- OBJECTS_RTEMS_REGIONS,
- _Attributes_Is_priority( attribute_set ) ?
- THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_SEGMENT,
- _Region_MP_Send_extract_proxy,
- RTEMS_TIMEOUT
- );
-
- _Objects_Open( &_Region_Information, &the_region->Object, &name );
-
- *id = the_region->Object.id;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_region_ident
- *
- * This directive returns the system ID associated with
- * the region name.
- *
- * Input parameters:
- * name - user defined region name
- * id - pointer to region id
- *
- * Output parameters:
- * *id - region id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_region_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id(
- &_Region_Information,
- &name,
- OBJECTS_SEARCH_LOCAL_NODE,
- id
- );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_region_delete
- *
- * This directive allows a thread to delete a region specified by
- * the region identifier, provided that none of its segments are
- * still allocated.
- *
- * Input parameters:
- * id - region id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_region_delete(
- Objects_Id id
-)
-{
- register Region_Control *the_region;
- Objects_Locations location;
-
- the_region = _Region_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- _Region_Debug_Walk( the_region, 5 );
- if ( the_region->number_of_used_blocks == 0 ) {
- _Objects_Close( &_Region_Information, &the_region->Object );
- _Region_Free( the_region );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_RESOURCE_IN_USE;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_region_extend
- *
- * This directive attempts to grow a region of physical contiguous memory area
- * from which variable sized segments can be allocated.
- *
- * Input parameters:
- * id - id of region to grow
- * start - starting address of memory area for extension
- * length - physical length in bytes to grow the region
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_region_extend(
- Objects_Id id,
- void *starting_address,
- unsigned32 length
-)
-{
- Region_Control *the_region;
- Objects_Locations location;
- unsigned32 amount_extended;
- Heap_Extend_status heap_status;
- rtems_status_code status;
-
- status = RTEMS_SUCCESSFUL;
-
- the_region = _Region_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
-
- heap_status = _Heap_Extend(
- &the_region->Memory,
- starting_address,
- length,
- &amount_extended
- );
-
- switch ( heap_status ) {
- case HEAP_EXTEND_SUCCESSFUL:
- the_region->length += amount_extended;
- the_region->maximum_segment_size += amount_extended;
- break;
- case HEAP_EXTEND_ERROR:
- status = RTEMS_INVALID_ADDRESS;
- break;
- case HEAP_EXTEND_NOT_IMPLEMENTED:
- status = RTEMS_NOT_IMPLEMENTED;
- break;
- }
- _Thread_Enable_dispatch();
- return( status );
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_region_get_segment
- *
- * This directive will obtain a segment from the given region.
- *
- * Input parameters:
- * id - region id
- * size - segment size in bytes
- * option_set - wait option
- * timeout - number of ticks to wait (0 means wait forever)
- * segment - pointer to segment address
- *
- * Output parameters:
- * segment - pointer to segment address filled in
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_region_get_segment(
- Objects_Id id,
- unsigned32 size,
- rtems_option option_set,
- rtems_interval timeout,
- void **segment
-)
-{
- register Region_Control *the_region;
- Objects_Locations location;
- Thread_Control *executing;
- void *the_segment;
-
- *segment = NULL;
-
- if ( size == 0 )
- return RTEMS_INVALID_SIZE;
-
- executing = _Thread_Executing;
- the_region = _Region_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- if ( size > the_region->maximum_segment_size ) {
- _Thread_Enable_dispatch();
- return RTEMS_INVALID_SIZE;
- }
-
- _Region_Debug_Walk( the_region, 1 );
-
- the_segment = _Region_Allocate_segment( the_region, size );
-
- _Region_Debug_Walk( the_region, 2 );
-
- if ( the_segment ) {
- the_region->number_of_used_blocks += 1;
- _Thread_Enable_dispatch();
- *segment = the_segment;
- return RTEMS_SUCCESSFUL;
- }
-
- if ( _Options_Is_no_wait( option_set ) ) {
- _Thread_Enable_dispatch();
- return RTEMS_UNSATISFIED;
- }
-
- executing->Wait.queue = &the_region->Wait_queue;
- executing->Wait.id = id;
- executing->Wait.count = size;
- executing->Wait.return_argument = (unsigned32 *) segment;
-
- _Thread_queue_Enter_critical_section( &the_region->Wait_queue );
-
- _Thread_queue_Enqueue( &the_region->Wait_queue, timeout );
-
- _Thread_Enable_dispatch();
- return (rtems_status_code) executing->Wait.return_code;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-/*PAGE
- *
- * rtems_region_get_segment_size
- *
- * This directive will return the size of the segment indicated
- *
- * Input parameters:
- * id - region id
- * segment - segment address
- * size - pointer to segment size in bytes
- *
- * Output parameters:
- * size - segment size in bytes filled in
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_region_get_segment_size(
- Objects_Id id,
- void *segment,
- unsigned32 *size
-)
-{
- register Region_Control *the_region;
- Objects_Locations location;
- Thread_Control *executing;
-
- executing = _Thread_Executing;
- the_region = _Region_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
-
- if ( _Heap_Size_of_user_area( &the_region->Memory, segment, size ) ) {
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_INVALID_ADDRESS;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_region_return_segment
- *
- * This directive will return a segment to its region.
- *
- * Input parameters:
- * id - region id
- * segment - pointer to segment address
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_region_return_segment(
- Objects_Id id,
- void *segment
-)
-{
- register Region_Control *the_region;
- Thread_Control *the_thread;
- Objects_Locations location;
- void **the_segment;
- int status;
-
- the_region = _Region_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* this error cannot be returned */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
-
- _Region_Debug_Walk( the_region, 3 );
-
- status = _Region_Free_segment( the_region, segment );
-
- _Region_Debug_Walk( the_region, 4 );
-
- if ( !status ) {
- _Thread_Enable_dispatch();
- return RTEMS_INVALID_ADDRESS;
- }
-
- the_region->number_of_used_blocks -= 1;
- for ( ; ; ) {
- the_thread = _Thread_queue_First( &the_region->Wait_queue );
-
- if ( the_thread == NULL )
- break;
-
- the_segment = (void **) _Region_Allocate_segment(
- the_region,
- the_thread->Wait.count
- );
-
- if ( the_segment == NULL )
- break;
-
- *(void **)the_thread->Wait.return_argument = the_segment;
- the_region->number_of_used_blocks += 1;
- _Thread_queue_Extract( &the_region->Wait_queue, the_thread );
- the_thread->Wait.return_code = RTEMS_SUCCESSFUL;
- }
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
diff --git a/cpukit/rtems/src/regionmp.c b/cpukit/rtems/src/regionmp.c
deleted file mode 100644
index 0b833f8671..0000000000
--- a/cpukit/rtems/src/regionmp.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Multiprocessing Support for the Region Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/region.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _Region_MP_Send_process_packet
- *
- */
-
-void _Region_MP_Send_process_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- rtems_name name,
- Objects_Id proxy_id
-)
-{
- Region_MP_Packet *the_packet;
- unsigned32 node;
-
- switch ( operation ) {
-
- case REGION_MP_ANNOUNCE_CREATE:
- case REGION_MP_ANNOUNCE_DELETE:
- case REGION_MP_EXTRACT_PROXY:
-
- the_packet = _Region_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_REGION;
- the_packet->Prefix.length = sizeof ( Region_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Region_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = region_id;
- the_packet->name = name;
- the_packet->proxy_id = proxy_id;
-
- if ( operation == REGION_MP_EXTRACT_PROXY )
- node = rtems_get_node( region_id );
- else
- node = MPCI_ALL_NODES;
-
- _MPCI_Send_process_packet( node, &the_packet->Prefix );
- break;
-
- case REGION_MP_GET_SEGMENT_REQUEST:
- case REGION_MP_GET_SEGMENT_RESPONSE:
- case REGION_MP_RETURN_SEGMENT_REQUEST:
- case REGION_MP_RETURN_SEGMENT_RESPONSE:
- break;
- }
-}
-
-/*PAGE
- *
- * _Region_MP_Send_request_packet
- *
- */
-
-rtems_status_code _Region_MP_Send_request_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- void *segment,
- unsigned32 size,
- rtems_option option_set,
- rtems_interval timeout
-)
-{
- Region_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case REGION_MP_GET_SEGMENT_REQUEST:
- case REGION_MP_RETURN_SEGMENT_REQUEST:
-
- the_packet = _Region_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_REGION;
- the_packet->Prefix.length = sizeof ( Region_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Region_MP_Packet );
- if ( ! _Options_Is_no_wait(option_set))
- the_packet->Prefix.timeout = timeout;
-
- the_packet->operation = operation;
- the_packet->Prefix.id = region_id;
- the_packet->segment = segment;
- the_packet->size = size;
- the_packet->option_set = option_set;
-
- return (rtems_status_code) _MPCI_Send_request_packet(
- rtems_get_node( region_id ),
- &the_packet->Prefix,
- STATES_READY /* Not used */
- );
- break;
-
- case REGION_MP_ANNOUNCE_CREATE:
- case REGION_MP_ANNOUNCE_DELETE:
- case REGION_MP_EXTRACT_PROXY:
- case REGION_MP_GET_SEGMENT_RESPONSE:
- case REGION_MP_RETURN_SEGMENT_RESPONSE:
- break;
-
- }
- /*
- * The following line is included to satisfy compilers which
- * produce warnings when a function does not end with a return.
- */
- return RTEMS_INTERNAL_ERROR;
-}
-
-/*PAGE
- *
- * _Region_MP_Send_response_packet
- *
- */
-
-void _Region_MP_Send_response_packet (
- Region_MP_Remote_operations operation,
- Objects_Id region_id,
- Thread_Control *the_thread
-)
-{
- Region_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case REGION_MP_GET_SEGMENT_RESPONSE:
- case REGION_MP_RETURN_SEGMENT_RESPONSE:
-
- the_packet = ( Region_MP_Packet *) the_thread->receive_packet;
-
-/*
- * The packet being returned already contains the class, length, and
- * to_convert fields, therefore they are not set in this routine.
- */
- the_packet->operation = operation;
- the_packet->Prefix.id = the_packet->Prefix.source_tid;
-
- _MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
- &the_packet->Prefix
- );
- break;
-
- case REGION_MP_ANNOUNCE_CREATE:
- case REGION_MP_ANNOUNCE_DELETE:
- case REGION_MP_EXTRACT_PROXY:
- case REGION_MP_GET_SEGMENT_REQUEST:
- case REGION_MP_RETURN_SEGMENT_REQUEST:
- break;
-
- }
-}
-
-/*PAGE
- *
- *
- * _Region_MP_Process_packet
- *
- */
-
-void _Region_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-)
-{
- Region_MP_Packet *the_packet;
- Thread_Control *the_thread;
- boolean ignored;
-
- the_packet = (Region_MP_Packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case REGION_MP_ANNOUNCE_CREATE:
-
- ignored = _Objects_MP_Allocate_and_open(
- &_Region_Information,
- the_packet->name,
- the_packet->Prefix.id,
- TRUE
- );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case REGION_MP_ANNOUNCE_DELETE:
-
- _Objects_MP_Close( &_Region_Information, the_packet->Prefix.id );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case REGION_MP_EXTRACT_PROXY:
-
- the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
-
- if ( ! _Thread_Is_null( the_thread ) )
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case REGION_MP_GET_SEGMENT_REQUEST:
-
- the_packet->Prefix.return_code = rtems_region_get_segment(
- the_packet->Prefix.id,
- the_packet->size,
- the_packet->option_set,
- the_packet->Prefix.timeout,
- &the_packet->segment
- );
-
- _Region_MP_Send_response_packet(
- REGION_MP_GET_SEGMENT_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case REGION_MP_GET_SEGMENT_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- *(void **)the_thread->Wait.return_argument = the_packet->segment;
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case REGION_MP_RETURN_SEGMENT_REQUEST:
-
- the_packet->Prefix.return_code = rtems_region_return_segment(
- the_packet->Prefix.id,
- the_packet->segment
- );
-
- _Region_MP_Send_response_packet(
- REGION_MP_RETURN_SEGMENT_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case REGION_MP_RETURN_SEGMENT_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- }
-}
-
-/*PAGE
- *
- * _Region_MP_Send_object_was_deleted
- *
- * This routine is not needed by the Region since a region
- * cannot be deleted when segments are in use.
- *
- */
-
-/*PAGE
- *
- * _Region_MP_Send_extract_proxy
- *
- */
-
-void _Region_MP_Send_extract_proxy (
- Thread_Control *the_thread
-)
-{
- _Region_MP_Send_process_packet(
- REGION_MP_EXTRACT_PROXY,
- the_thread->Wait.id,
- (rtems_name) 0,
- the_thread->Object.id
- );
-}
-
-/*PAGE
- *
- * _Region_MP_Get_packet
- *
- */
-
-Region_MP_Packet *_Region_MP_Get_packet ( void )
-{
- return ( (Region_MP_Packet *) _MPCI_Get_packet() );
-}
-
-/* end of file */
diff --git a/cpukit/rtems/src/rtclock.c b/cpukit/rtems/src/rtclock.c
deleted file mode 100644
index 8a1b6b56af..0000000000
--- a/cpukit/rtems/src/rtclock.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Clock Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/clock.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
-
-/*PAGE
- *
- * rtems_clock_get
- *
- * This directive returns the current date and time. If the time has
- * not been set by a tm_set then an error is returned.
- *
- * Input parameters:
- * option - which value to return
- * time_buffer - pointer to output buffer (a time and date structure
- * or an interval)
- *
- * Output parameters:
- * time_buffer - output filled in
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_clock_get(
- rtems_clock_get_options option,
- void *time_buffer
-)
-{
- ISR_Level level;
- rtems_interval tmp;
-
- switch ( option ) {
- case RTEMS_CLOCK_GET_TOD:
- if ( !_TOD_Is_set )
- return RTEMS_NOT_DEFINED;
-
- *(rtems_time_of_day *)time_buffer = _TOD_Current;
- return RTEMS_SUCCESSFUL;
-
- case RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH:
- if ( !_TOD_Is_set )
- return RTEMS_NOT_DEFINED;
-
- *(rtems_interval *)time_buffer = _TOD_Seconds_since_epoch;
- return RTEMS_SUCCESSFUL;
-
- case RTEMS_CLOCK_GET_TICKS_SINCE_BOOT:
- *(rtems_interval *)time_buffer = _Watchdog_Ticks_since_boot;
- return RTEMS_SUCCESSFUL;
-
- case RTEMS_CLOCK_GET_TICKS_PER_SECOND:
- *(rtems_interval *)time_buffer = _TOD_Ticks_per_second;
- return RTEMS_SUCCESSFUL;
-
- case RTEMS_CLOCK_GET_TIME_VALUE:
- if ( !_TOD_Is_set )
- return RTEMS_NOT_DEFINED;
-
- _ISR_Disable( level );
- ((rtems_clock_time_value *)time_buffer)->seconds =
- _TOD_Seconds_since_epoch;
- tmp = _TOD_Current.ticks;
- _ISR_Enable( level );
-
- tmp *= _TOD_Microseconds_per_tick;
- ((rtems_clock_time_value *)time_buffer)->microseconds = tmp;
-
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* should never get here */
-
-}
-
-/*PAGE
- *
- * rtems_clock_set
- *
- * This directive sets the date and time for this node.
- *
- * Input parameters:
- * time_buffer - pointer to the time and date structure
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_clock_set(
- rtems_time_of_day *time_buffer
-)
-{
- rtems_interval seconds;
-
- if ( _TOD_Validate( time_buffer ) ) {
- seconds = _TOD_To_seconds( time_buffer );
- _Thread_Disable_dispatch();
- _TOD_Set( time_buffer, seconds );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- return RTEMS_INVALID_CLOCK;
-}
-
-/*PAGE
- *
- * rtems_clock_tick
- *
- * This directive notifies the executve that a tick has occurred.
- * When the tick occurs the time manager updates and maintains
- * the calendar time, timeslicing, and any timeout delays.
- *
- * Input parameters: NONE
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - always succeeds
- *
- * NOTE: This routine only works for leap-years through 2099.
- */
-
-rtems_status_code rtems_clock_tick( void )
-{
- _TOD_Tickle_ticks();
-
- _Watchdog_Tickle_ticks();
-
- _Thread_Tickle_timeslice();
-
- if ( _Thread_Is_context_switch_necessary() &&
- _Thread_Is_dispatching_enabled() )
- _Thread_Dispatch();
-
- return RTEMS_SUCCESSFUL;
-}
diff --git a/cpukit/rtems/src/rtemstimer.c b/cpukit/rtems/src/rtemstimer.c
deleted file mode 100644
index 9d04686d40..0000000000
--- a/cpukit/rtems/src/rtemstimer.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Timer Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/timer.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
-
-/*PAGE
- *
- * _Timer_Manager_initialization
- *
- * This routine initializes all timer manager related data structures.
- *
- * Input parameters:
- * maximum_timers - number of timers to initialize
- *
- * Output parameters: NONE
- */
-
-void _Timer_Manager_initialization(
- unsigned32 maximum_timers
-)
-{
- _Objects_Initialize_information(
- &_Timer_Information,
- OBJECTS_RTEMS_TIMERS,
- FALSE,
- maximum_timers,
- sizeof( Timer_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-}
-
-/*PAGE
- *
- * rtems_timer_create
- *
- * This directive creates a timer and performs some initialization.
- *
- * Input parameters:
- * name - timer name
- * id - pointer to timer id
- *
- * Output parameters:
- * id - timer id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_create(
- rtems_name name,
- Objects_Id *id
-)
-{
- Timer_Control *the_timer;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- _Thread_Disable_dispatch(); /* to prevent deletion */
-
- the_timer = _Timer_Allocate();
-
- if ( !the_timer ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- the_timer->the_class = TIMER_DORMANT;
-
- _Objects_Open( &_Timer_Information, &the_timer->Object, &name );
-
- *id = the_timer->Object.id;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_timer_ident
- *
- * This directive returns the system ID associated with
- * the timer name.
- *
- * Input parameters:
- * name - user defined message queue name
- * id - pointer to timer id
- *
- * Output parameters:
- * *id - message queue id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id(
- &_Timer_Information,
- &name,
- OBJECTS_SEARCH_LOCAL_NODE,
- id
- );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_timer_cancel
- *
- * This directive allows a thread to cancel a timer.
- *
- * Input parameters:
- * id - timer id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_cancel(
- Objects_Id id
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
- (void) _Watchdog_Remove( &the_timer->Ticker );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_timer_delete
- *
- * This directive allows a thread to delete a timer.
- *
- * Input parameters:
- * id - timer id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_delete(
- Objects_Id id
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- _Objects_Close( &_Timer_Information, &the_timer->Object );
- (void) _Watchdog_Remove( &the_timer->Ticker );
- _Timer_Free( the_timer );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_timer_fire_after
- *
- * This directive allows a thread to start a timer.
- *
- * Input parameters:
- * id - timer id
- * ticks - interval until routine is fired
- * routine - routine to schedule
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_fire_after(
- Objects_Id id,
- rtems_interval ticks,
- rtems_timer_service_routine_entry routine,
- void *user_data
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
-
- if ( ticks == 0 )
- return RTEMS_INVALID_NUMBER;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- (void) _Watchdog_Remove( &the_timer->Ticker );
- the_timer->the_class = TIMER_INTERVAL;
- _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
- _Watchdog_Insert_ticks( &the_timer->Ticker, ticks );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_timer_fire_when
- *
- * This directive allows a thread to start a timer.
- *
- * Input parameters:
- * id - timer id
- * wall_time - time of day to fire timer
- * routine - routine to schedule
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_fire_when(
- Objects_Id id,
- rtems_time_of_day *wall_time,
- rtems_timer_service_routine_entry routine,
- void *user_data
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
- rtems_interval seconds;
-
- if ( !_TOD_Is_set )
- return RTEMS_NOT_DEFINED;
-
- if ( !_TOD_Validate( wall_time ) )
- return RTEMS_INVALID_CLOCK;
-
- seconds = _TOD_To_seconds( wall_time );
- if ( seconds <= _TOD_Seconds_since_epoch )
- return RTEMS_INVALID_CLOCK;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- (void) _Watchdog_Remove( &the_timer->Ticker );
- the_timer->the_class = TIMER_TIME_OF_DAY;
- _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
- _Watchdog_Insert_seconds(
- &the_timer->Ticker,
- seconds - _TOD_Seconds_since_epoch
- );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_timer_reset
- *
- * This directive allows a thread to reset a timer.
- *
- * Input parameters:
- * id - timer id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_timer_reset(
- Objects_Id id
-)
-{
- Timer_Control *the_timer;
- Objects_Locations location;
-
- the_timer = _Timer_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INTERNAL_ERROR;
- case OBJECTS_LOCAL:
- if ( _Timer_Is_interval_class( the_timer->the_class ) ) {
- _Watchdog_Reset( &the_timer->Ticker );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_NOT_DEFINED;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
diff --git a/cpukit/rtems/src/sem.c b/cpukit/rtems/src/sem.c
deleted file mode 100644
index f1c1f1fbb9..0000000000
--- a/cpukit/rtems/src/sem.c
+++ /dev/null
@@ -1,571 +0,0 @@
-/*
- * Semaphore Manager
- *
- * DESCRIPTION:
- *
- * This package is the implementation of the Semaphore Manager.
- * This manager utilizes standard Dijkstra counting semaphores to provide
- * synchronization and mutual exclusion capabilities.
- *
- * Directives provided are:
- *
- * + create a semaphore
- * + get an ID of a semaphore
- * + delete a semaphore
- * + acquire a semaphore
- * + release a semaphore
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/score/coremutex.h>
-#include <rtems/score/coresem.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/sysstate.h>
-
-#include <rtems/score/interr.h>
-
-/*PAGE
- *
- * _Semaphore_Manager_initialization
- *
- * This routine initializes all semaphore manager related data structures.
- *
- * Input parameters:
- * maximum_semaphores - maximum configured semaphores
- *
- * Output parameters: NONE
- */
-
-void _Semaphore_Manager_initialization(
- unsigned32 maximum_semaphores
-)
-{
- _Objects_Initialize_information(
- &_Semaphore_Information,
- OBJECTS_RTEMS_SEMAPHORES,
- TRUE,
- maximum_semaphores,
- sizeof( Semaphore_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor(
- MP_PACKET_SEMAPHORE,
- _Semaphore_MP_Process_packet
- );
-
-}
-
-/*PAGE
- *
- * rtems_semaphore_create
- *
- * This directive creates a semaphore and sets the initial value based
- * on the given count. A semaphore id is returned.
- *
- * Input parameters:
- * name - user defined semaphore name
- * count - initial count of semaphore
- * attribute_set - semaphore attributes
- * priority_ceiling - semaphore's ceiling priority
- * id - pointer to semaphore id
- *
- * Output parameters:
- * id - semaphore id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_semaphore_create(
- rtems_name name,
- unsigned32 count,
- rtems_attribute attribute_set,
- rtems_task_priority priority_ceiling,
- Objects_Id *id
-)
-{
- register Semaphore_Control *the_semaphore;
- CORE_mutex_Attributes the_mutex_attributes;
- CORE_semaphore_Attributes the_semaphore_attributes;
- unsigned32 lock;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- if ( _Attributes_Is_global( attribute_set ) ) {
-
- if ( !_System_state_Is_multiprocessing )
- return RTEMS_MP_NOT_CONFIGURED;
-
- if ( _Attributes_Is_inherit_priority( attribute_set ) )
- return RTEMS_NOT_DEFINED;
-
- } else if ( _Attributes_Is_inherit_priority( attribute_set ) ||
- _Attributes_Is_priority_ceiling( attribute_set ) ) {
-
- if ( ! ( _Attributes_Is_binary_semaphore( attribute_set ) &&
- _Attributes_Is_priority( attribute_set ) ) )
- return RTEMS_NOT_DEFINED;
-
- }
-
- if ( _Attributes_Is_binary_semaphore( attribute_set ) && ( count > 1 ) )
- return RTEMS_INVALID_NUMBER;
-
- _Thread_Disable_dispatch(); /* prevents deletion */
-
- the_semaphore = _Semaphore_Allocate();
-
- if ( !the_semaphore ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- if ( _Attributes_Is_global( attribute_set ) &&
- ! ( _Objects_MP_Allocate_and_open( &_Semaphore_Information, name,
- the_semaphore->Object.id, FALSE ) ) ) {
- _Semaphore_Free( the_semaphore );
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- the_semaphore->attribute_set = attribute_set;
-
- if ( _Attributes_Is_binary_semaphore( attribute_set ) ) {
- if ( _Attributes_Is_inherit_priority( attribute_set ) )
- the_mutex_attributes.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT;
- else if (_Attributes_Is_priority_ceiling( attribute_set ) )
- the_mutex_attributes.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
- else if (_Attributes_Is_priority( attribute_set ) )
- the_mutex_attributes.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY;
- else
- the_mutex_attributes.discipline = CORE_MUTEX_DISCIPLINES_FIFO;
-
- the_mutex_attributes.allow_nesting = TRUE;
-
- /* Add priority ceiling code here ????? */
-
- the_mutex_attributes.priority_ceiling = priority_ceiling;
-
- if ( count == 1 )
- lock = CORE_MUTEX_UNLOCKED;
- else
- lock = CORE_MUTEX_LOCKED;
-
- _CORE_mutex_Initialize(
- &the_semaphore->Core_control.mutex,
- OBJECTS_RTEMS_SEMAPHORES,
- &the_mutex_attributes,
- lock,
- _Semaphore_MP_Send_extract_proxy
- );
- }
- else {
- if ( _Attributes_Is_priority( attribute_set ) )
- the_semaphore_attributes.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY;
- else
- the_semaphore_attributes.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
-
- /*
- * The following are just to make Purify happy.
- */
-
- the_mutex_attributes.allow_nesting = TRUE;
- the_mutex_attributes.priority_ceiling = PRIORITY_MINIMUM;
-
- _CORE_semaphore_Initialize(
- &the_semaphore->Core_control.semaphore,
- OBJECTS_RTEMS_SEMAPHORES,
- &the_semaphore_attributes,
- count,
- _Semaphore_MP_Send_extract_proxy
- );
- }
-
- _Objects_Open( &_Semaphore_Information, &the_semaphore->Object, &name );
-
- *id = the_semaphore->Object.id;
-
- if ( _Attributes_Is_global( attribute_set ) )
- _Semaphore_MP_Send_process_packet(
- SEMAPHORE_MP_ANNOUNCE_CREATE,
- the_semaphore->Object.id,
- name,
- 0 /* Not used */
- );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_semaphore_ident
- *
- * This directive returns the system ID associated with
- * the semaphore name.
- *
- * Input parameters:
- * name - user defined semaphore name
- * node - node(s) to be searched
- * id - pointer to semaphore id
- *
- * Output parameters:
- * *id - semaphore id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_semaphore_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id( &_Semaphore_Information, &name, node, id );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_semaphore_delete
- *
- * This directive allows a thread to delete a semaphore specified by
- * the semaphore id. The semaphore is freed back to the inactive
- * semaphore chain.
- *
- * Input parameters:
- * id - semaphore id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_semaphore_delete(
- Objects_Id id
-)
-{
- register Semaphore_Control *the_semaphore;
- Objects_Locations location;
-
- the_semaphore = _Semaphore_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
- case OBJECTS_LOCAL:
- if ( _Attributes_Is_binary_semaphore( the_semaphore->attribute_set) ) {
- if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) ) {
- _Thread_Enable_dispatch();
- return RTEMS_RESOURCE_IN_USE;
- }
- else
- _CORE_mutex_Flush(
- &the_semaphore->Core_control.mutex,
- _Semaphore_MP_Send_object_was_deleted,
- CORE_MUTEX_WAS_DELETED
- );
- }
- else
- _CORE_semaphore_Flush(
- &the_semaphore->Core_control.semaphore,
- _Semaphore_MP_Send_object_was_deleted,
- CORE_SEMAPHORE_WAS_DELETED
- );
-
- _Objects_Close( &_Semaphore_Information, &the_semaphore->Object );
-
- _Semaphore_Free( the_semaphore );
-
- if ( _Attributes_Is_global( the_semaphore->attribute_set ) ) {
-
- _Objects_MP_Close( &_Semaphore_Information, the_semaphore->Object.id );
-
- _Semaphore_MP_Send_process_packet(
- SEMAPHORE_MP_ANNOUNCE_DELETE,
- the_semaphore->Object.id,
- 0, /* Not used */
- 0 /* Not used */
- );
- }
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_semaphore_obtain
- *
- * This directive allows a thread to acquire a semaphore.
- *
- * Input parameters:
- * id - semaphore id
- * option_set - wait option
- * timeout - number of ticks to wait (0 means wait forever)
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_semaphore_obtain(
- Objects_Id id,
- unsigned32 option_set,
- rtems_interval timeout
-)
-{
- register Semaphore_Control *the_semaphore;
- Objects_Locations location;
- boolean wait;
-
- the_semaphore = _Semaphore_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return _Semaphore_MP_Send_request_packet(
- SEMAPHORE_MP_OBTAIN_REQUEST,
- id,
- option_set,
- timeout
- );
- case OBJECTS_LOCAL:
- if ( _Options_Is_no_wait( option_set ) )
- wait = FALSE;
- else
- wait = TRUE;
-
- if ( _Attributes_Is_binary_semaphore( the_semaphore->attribute_set ) ) {
- _CORE_mutex_Seize(
- &the_semaphore->Core_control.mutex,
- id,
- wait,
- timeout
- );
- _Thread_Enable_dispatch();
- return _Semaphore_Translate_core_mutex_return_code(
- _Thread_Executing->Wait.return_code );
- } else {
- _CORE_semaphore_Seize(
- &the_semaphore->Core_control.semaphore,
- id,
- wait,
- timeout
- );
- _Thread_Enable_dispatch();
- return _Semaphore_Translate_core_semaphore_return_code(
- _Thread_Executing->Wait.return_code );
- }
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_semaphore_release
- *
- * This directive allows a thread to release a semaphore.
- *
- * Input parameters:
- * id - semaphore id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_semaphore_release(
- Objects_Id id
-)
-{
- register Semaphore_Control *the_semaphore;
- Objects_Locations location;
- CORE_mutex_Status mutex_status;
- CORE_semaphore_Status semaphore_status;
-
- the_semaphore = _Semaphore_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return _Semaphore_MP_Send_request_packet(
- SEMAPHORE_MP_RELEASE_REQUEST,
- id,
- 0, /* Not used */
- MPCI_DEFAULT_TIMEOUT
- );
- case OBJECTS_LOCAL:
- if ( _Attributes_Is_binary_semaphore( the_semaphore->attribute_set ) ) {
- mutex_status = _CORE_mutex_Surrender(
- &the_semaphore->Core_control.mutex,
- id,
- _Semaphore_Core_mutex_mp_support
- );
- _Thread_Enable_dispatch();
- return _Semaphore_Translate_core_mutex_return_code( mutex_status );
- }
- else
- semaphore_status = _CORE_semaphore_Surrender(
- &the_semaphore->Core_control.semaphore,
- id,
- _Semaphore_Core_semaphore_mp_support
- );
- _Thread_Enable_dispatch();
- return
- _Semaphore_Translate_core_semaphore_return_code( semaphore_status );
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * _Semaphore_Translate_core_mutex_return_code
- *
- * Input parameters:
- * the_mutex_status - mutex status code to translate
- *
- * Output parameters:
- * rtems status code - translated RTEMS status code
- *
- */
-
-rtems_status_code _Semaphore_Translate_core_mutex_return_code (
- unsigned32 the_mutex_status
-)
-{
- switch ( the_mutex_status ) {
- case CORE_MUTEX_STATUS_SUCCESSFUL:
- return RTEMS_SUCCESSFUL;
- case CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT:
- return RTEMS_UNSATISFIED;
- case CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED:
- return RTEMS_INTERNAL_ERROR;
- case CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE:
- return RTEMS_NOT_OWNER_OF_RESOURCE;
- case CORE_MUTEX_WAS_DELETED:
- return RTEMS_OBJECT_WAS_DELETED;
- case CORE_MUTEX_TIMEOUT:
- return RTEMS_TIMEOUT;
- case THREAD_STATUS_PROXY_BLOCKING:
- return THREAD_STATUS_PROXY_BLOCKING;
- }
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * _Semaphore_Translate_core_semaphore_return_code
- *
- * Input parameters:
- * the_semaphore_status - semaphore status code to translate
- *
- * Output parameters:
- * rtems status code - translated RTEMS status code
- *
- */
-
-rtems_status_code _Semaphore_Translate_core_semaphore_return_code (
- unsigned32 the_semaphore_status
-)
-{
- switch ( the_semaphore_status ) {
- case CORE_SEMAPHORE_STATUS_SUCCESSFUL:
- return RTEMS_SUCCESSFUL;
- case CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT:
- return RTEMS_UNSATISFIED;
- case CORE_SEMAPHORE_WAS_DELETED:
- return RTEMS_OBJECT_WAS_DELETED;
- case CORE_SEMAPHORE_TIMEOUT:
- return RTEMS_TIMEOUT;
- case THREAD_STATUS_PROXY_BLOCKING:
- return THREAD_STATUS_PROXY_BLOCKING;
- }
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * _Semaphore_Core_mutex_mp_support
- *
- * Input parameters:
- * the_thread - the remote thread the semaphore was surrendered to
- * id - id of the surrendered semaphore
- *
- * Output parameters: NONE
- */
-
-void _Semaphore_Core_mutex_mp_support (
- Thread_Control *the_thread,
- Objects_Id id
-)
-{
- the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
-
- _Semaphore_MP_Send_response_packet(
- SEMAPHORE_MP_OBTAIN_RESPONSE,
- id,
- the_thread
- );
-}
-
-
-/*PAGE
- *
- * _Semaphore_Core_semaphore_mp_support
- *
- * Input parameters:
- * the_thread - the remote thread the semaphore was surrendered to
- * id - id of the surrendered semaphore
- *
- * Output parameters: NONE
- */
-
-void _Semaphore_Core_semaphore_mp_support (
- Thread_Control *the_thread,
- Objects_Id id
-)
-{
- the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
-
- _Semaphore_MP_Send_response_packet(
- SEMAPHORE_MP_OBTAIN_RESPONSE,
- id,
- the_thread
- );
-}
diff --git a/cpukit/rtems/src/semmp.c b/cpukit/rtems/src/semmp.c
deleted file mode 100644
index 01efdfca4e..0000000000
--- a/cpukit/rtems/src/semmp.c
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Multiprocessing Support for the Semaphore Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _Semaphore_MP_Send_process_packet
- *
- */
-
-void _Semaphore_MP_Send_process_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- rtems_name name,
- Objects_Id proxy_id
-)
-{
- Semaphore_MP_Packet *the_packet;
- unsigned32 node;
-
- switch ( operation ) {
-
- case SEMAPHORE_MP_ANNOUNCE_CREATE:
- case SEMAPHORE_MP_ANNOUNCE_DELETE:
- case SEMAPHORE_MP_EXTRACT_PROXY:
-
- the_packet = _Semaphore_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_SEMAPHORE;
- the_packet->Prefix.length = sizeof ( Semaphore_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Semaphore_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = semaphore_id;
- the_packet->name = name;
- the_packet->proxy_id = proxy_id;
-
- if ( operation == SEMAPHORE_MP_EXTRACT_PROXY )
- node = rtems_get_node( semaphore_id );
- else
- node = MPCI_ALL_NODES;
-
- _MPCI_Send_process_packet( node, &the_packet->Prefix );
- break;
-
- case SEMAPHORE_MP_OBTAIN_REQUEST:
- case SEMAPHORE_MP_OBTAIN_RESPONSE:
- case SEMAPHORE_MP_RELEASE_REQUEST:
- case SEMAPHORE_MP_RELEASE_RESPONSE:
- break;
- }
-}
-
-/*PAGE
- *
- * _Semaphore_MP_Send_request_packet
- *
- */
-
-rtems_status_code _Semaphore_MP_Send_request_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- rtems_option option_set,
- rtems_interval timeout
-)
-{
- Semaphore_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case SEMAPHORE_MP_OBTAIN_REQUEST:
- case SEMAPHORE_MP_RELEASE_REQUEST:
-
- the_packet = _Semaphore_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_SEMAPHORE;
- the_packet->Prefix.length = sizeof ( Semaphore_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Semaphore_MP_Packet );
- if ( ! _Options_Is_no_wait(option_set))
- the_packet->Prefix.timeout = timeout;
-
- the_packet->operation = operation;
- the_packet->Prefix.id = semaphore_id;
- the_packet->option_set = option_set;
-
- return _MPCI_Send_request_packet(
- rtems_get_node( semaphore_id ),
- &the_packet->Prefix,
- STATES_WAITING_FOR_SEMAPHORE
- );
- break;
-
- case SEMAPHORE_MP_ANNOUNCE_CREATE:
- case SEMAPHORE_MP_ANNOUNCE_DELETE:
- case SEMAPHORE_MP_EXTRACT_PROXY:
- case SEMAPHORE_MP_OBTAIN_RESPONSE:
- case SEMAPHORE_MP_RELEASE_RESPONSE:
- break;
-
- }
- /*
- * The following line is included to satisfy compilers which
- * produce warnings when a function does not end with a return.
- */
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _Semaphore_MP_Send_response_packet
- *
- */
-
-void _Semaphore_MP_Send_response_packet (
- Semaphore_MP_Remote_operations operation,
- Objects_Id semaphore_id,
- Thread_Control *the_thread
-)
-{
- Semaphore_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case SEMAPHORE_MP_OBTAIN_RESPONSE:
- case SEMAPHORE_MP_RELEASE_RESPONSE:
-
- the_packet = ( Semaphore_MP_Packet *) the_thread->receive_packet;
-
-/*
- * The packet being returned already contains the class, length, and
- * to_convert fields, therefore they are not set in this routine.
- */
- the_packet->operation = operation;
- the_packet->Prefix.id = the_packet->Prefix.source_tid;
-
- _MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
- &the_packet->Prefix
- );
- break;
-
- case SEMAPHORE_MP_ANNOUNCE_CREATE:
- case SEMAPHORE_MP_ANNOUNCE_DELETE:
- case SEMAPHORE_MP_EXTRACT_PROXY:
- case SEMAPHORE_MP_OBTAIN_REQUEST:
- case SEMAPHORE_MP_RELEASE_REQUEST:
- break;
-
- }
-}
-
-/*PAGE
- *
- *
- * _Semaphore_MP_Process_packet
- *
- */
-
-void _Semaphore_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-)
-{
- Semaphore_MP_Packet *the_packet;
- Thread_Control *the_thread;
- boolean ignored;
-
- the_packet = (Semaphore_MP_Packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case SEMAPHORE_MP_ANNOUNCE_CREATE:
-
- ignored = _Objects_MP_Allocate_and_open(
- &_Semaphore_Information,
- the_packet->name,
- the_packet->Prefix.id,
- TRUE
- );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case SEMAPHORE_MP_ANNOUNCE_DELETE:
-
- _Objects_MP_Close( &_Semaphore_Information, the_packet->Prefix.id );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case SEMAPHORE_MP_EXTRACT_PROXY:
-
- the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
-
- if ( ! _Thread_Is_null( the_thread ) )
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case SEMAPHORE_MP_OBTAIN_REQUEST:
-
- the_packet->Prefix.return_code = rtems_semaphore_obtain(
- the_packet->Prefix.id,
- the_packet->option_set,
- the_packet->Prefix.timeout
- );
-
- if ( ! _Thread_Is_proxy_blocking( the_packet->Prefix.return_code ) )
- _Semaphore_MP_Send_response_packet(
- SEMAPHORE_MP_OBTAIN_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
-
- case SEMAPHORE_MP_OBTAIN_RESPONSE:
- case SEMAPHORE_MP_RELEASE_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case SEMAPHORE_MP_RELEASE_REQUEST:
-
- the_packet->Prefix.return_code = rtems_semaphore_release(
- the_packet->Prefix.id
- );
-
- _Semaphore_MP_Send_response_packet(
- SEMAPHORE_MP_RELEASE_RESPONSE,
- the_packet->Prefix.id,
- _Thread_Executing
- );
- break;
- }
-}
-
-/*PAGE
- *
- * _Semaphore_MP_Send_object_was_deleted
- *
- */
-
-void _Semaphore_MP_Send_object_was_deleted (
- Thread_Control *the_proxy
-)
-{
- the_proxy->receive_packet->return_code = RTEMS_OBJECT_WAS_DELETED;
-
- _Semaphore_MP_Send_response_packet(
- SEMAPHORE_MP_OBTAIN_RESPONSE,
- the_proxy->Wait.id,
- the_proxy
- );
-
-}
-
-/*PAGE
- *
- * _Semaphore_MP_Send_extract_proxy
- *
- */
-
-void _Semaphore_MP_Send_extract_proxy (
- Thread_Control *the_thread
-)
-{
- _Semaphore_MP_Send_process_packet(
- SEMAPHORE_MP_EXTRACT_PROXY,
- the_thread->Wait.id,
- (rtems_name) 0,
- the_thread->Object.id
- );
-
-}
-
-/*PAGE
- *
- * _Semaphore_MP_Get_packet
- *
- */
-
-Semaphore_MP_Packet *_Semaphore_MP_Get_packet ( void )
-{
- return ( (Semaphore_MP_Packet *) _MPCI_Get_packet() );
-}
-
-/* end of file */
diff --git a/cpukit/rtems/src/signal.c b/cpukit/rtems/src/signal.c
deleted file mode 100644
index efdcf70eea..0000000000
--- a/cpukit/rtems/src/signal.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Signal Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/asr.h>
-#include <rtems/score/isr.h>
-#include <rtems/rtems/modes.h>
-#include <rtems/rtems/signal.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/tasks.h>
-
-/*PAGE
- *
- * _Signal_Manager_initialization
- *
- * This routine initializes all signal manager related data structures.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _Signal_Manager_initialization( void )
-{
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor(
- MP_PACKET_SIGNAL,
- _Signal_MP_Process_packet
- );
-}
-
-/*PAGE
- *
- * rtems_signal_catch
- *
- * This directive allows a thread to specify what action to take when
- * catching signals.
- *
- * Input parameters:
- * handler - address of asynchronous signal routine (asr)
- * ( NULL indicates asr is invalid )
- * mode_set - mode value for asr
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - always succeeds
- */
-
-rtems_status_code rtems_signal_catch(
- rtems_asr_entry asr_handler,
- rtems_mode mode_set
-)
-{
- Thread_Control *executing;
- RTEMS_API_Control *api;
- ASR_Information *asr;
-
-/* XXX normalize mode */
- executing = _Thread_Executing;
- api = executing->API_Extensions[ THREAD_API_RTEMS ];
- asr = &api->Signal;
-
- _Thread_Disable_dispatch(); /* cannot reschedule while */
- /* the thread is inconsistent */
-
- if ( !_ASR_Is_null_handler( asr_handler ) ) {
- asr->mode_set = mode_set;
- asr->handler = asr_handler;
- }
- else
- _ASR_Initialize( asr );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_signal_send
- *
- * This directive allows a thread to send signals to a thread.
- *
- * Input parameters:
- * id - thread id
- * signal_set - signal set
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_signal_send(
- Objects_Id id,
- rtems_signal_set signal_set
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
- RTEMS_API_Control *api;
- ASR_Information *asr;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return _Signal_MP_Send_request_packet(
- SIGNAL_MP_SEND_REQUEST,
- id,
- signal_set
- );
- case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
- asr = &api->Signal;
-
- if ( ! _ASR_Is_null_handler( asr->handler ) ) {
- if ( asr->is_enabled ) {
- _ASR_Post_signals( signal_set, &asr->signals_posted );
-
- the_thread->do_post_task_switch_extension = TRUE;
-
- if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
- _ISR_Signals_to_thread_executing = TRUE;
- } else {
- _ASR_Post_signals( signal_set, &asr->signals_pending );
- }
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_NOT_DEFINED;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
diff --git a/cpukit/rtems/src/signalmp.c b/cpukit/rtems/src/signalmp.c
deleted file mode 100644
index f78e94d366..0000000000
--- a/cpukit/rtems/src/signalmp.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Multiprocessing Support for the Signal Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/signal.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _Signal_MP_Send_process_packet
- *
- * This subprogram is not needed since there are no process
- * packets to be sent by this manager.
- *
- */
-
-/*PAGE
- *
- * _Signal_MP_Send_request_packet
- *
- */
-
-rtems_status_code _Signal_MP_Send_request_packet (
- Signal_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_signal_set signal_in
-)
-{
- Signal_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case SIGNAL_MP_SEND_REQUEST:
-
- the_packet = _Signal_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_SIGNAL;
- the_packet->Prefix.length = sizeof ( Signal_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( Signal_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = task_id;
- the_packet->signal_in = signal_in;
-
- return _MPCI_Send_request_packet(
- rtems_get_node( task_id ),
- &the_packet->Prefix,
- STATES_READY /* Not used */
- );
- break;
-
- case SIGNAL_MP_SEND_RESPONSE:
- break;
-
- }
- /*
- * The following line is included to satisfy compilers which
- * produce warnings when a function does not end with a return.
- */
- return RTEMS_INTERNAL_ERROR;
-}
-
-/*PAGE
- *
- * _Signal_MP_Send_response_packet
- *
- */
-
-void _Signal_MP_Send_response_packet (
- Signal_MP_Remote_operations operation,
- Thread_Control *the_thread
-)
-{
- Signal_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case SIGNAL_MP_SEND_RESPONSE:
-
- the_packet = ( Signal_MP_Packet *) the_thread->receive_packet;
-
-/*
- * The packet being returned already contains the class, length, and
- * to_convert fields, therefore they are not set in this routine.
- */
- the_packet->operation = operation;
- the_packet->Prefix.id = the_packet->Prefix.source_tid;
-
- _MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
- &the_packet->Prefix
- );
- break;
-
- case SIGNAL_MP_SEND_REQUEST:
- break;
-
- }
-}
-
-/*PAGE
- *
- *
- * _Signal_MP_Process_packet
- *
- */
-
-void _Signal_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-)
-{
- Signal_MP_Packet *the_packet;
- Thread_Control *the_thread;
-
- the_packet = (Signal_MP_Packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case SIGNAL_MP_SEND_REQUEST:
-
- the_packet->Prefix.return_code = rtems_signal_send(
- the_packet->Prefix.id,
- the_packet->signal_in
- );
-
- _Signal_MP_Send_response_packet(
- SIGNAL_MP_SEND_RESPONSE,
- _Thread_Executing
- );
- break;
-
- case SIGNAL_MP_SEND_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- }
-}
-
-/*PAGE
- *
- * _Signal_MP_Send_object_was_deleted
- *
- * This subprogram is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*PAGE
- *
- * _Signal_MP_Send_extract_proxy
- *
- * This subprogram is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*PAGE
- *
- * _Signal_MP_Get_packet
- *
- */
-
-Signal_MP_Packet *_Signal_MP_Get_packet ( void )
-{
- return ( (Signal_MP_Packet *) _MPCI_Get_packet() );
-}
-
-/* end of file */
diff --git a/cpukit/rtems/src/taskmp.c b/cpukit/rtems/src/taskmp.c
deleted file mode 100644
index 5d5f3df763..0000000000
--- a/cpukit/rtems/src/taskmp.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * Multiprocessing Support for the RTEMS Task Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/rtems/support.h>
-
-/*PAGE
- *
- * _RTEMS_tasks_MP_Send_process_packet
- *
- */
-
-void _RTEMS_tasks_MP_Send_process_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_name name
-)
-{
- RTEMS_tasks_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case RTEMS_TASKS_MP_ANNOUNCE_CREATE:
- case RTEMS_TASKS_MP_ANNOUNCE_DELETE:
-
- the_packet = _RTEMS_tasks_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_TASKS;
- the_packet->Prefix.length = sizeof ( RTEMS_tasks_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( RTEMS_tasks_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = task_id;
- the_packet->name = name;
-
- _MPCI_Send_process_packet( MPCI_ALL_NODES, &the_packet->Prefix );
- break;
-
- case RTEMS_TASKS_MP_SUSPEND_REQUEST:
- case RTEMS_TASKS_MP_SUSPEND_RESPONSE:
- case RTEMS_TASKS_MP_RESUME_REQUEST:
- case RTEMS_TASKS_MP_RESUME_RESPONSE:
- case RTEMS_TASKS_MP_SET_PRIORITY_REQUEST:
- case RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE:
- case RTEMS_TASKS_MP_GET_NOTE_REQUEST:
- case RTEMS_TASKS_MP_GET_NOTE_RESPONSE:
- case RTEMS_TASKS_MP_SET_NOTE_REQUEST:
- case RTEMS_TASKS_MP_SET_NOTE_RESPONSE:
- break;
- }
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_MP_Send_request_packet
- *
- */
-
-rtems_status_code _RTEMS_tasks_MP_Send_request_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Objects_Id task_id,
- rtems_task_priority new_priority,
- unsigned32 notepad,
- unsigned32 note
-)
-{
- RTEMS_tasks_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case RTEMS_TASKS_MP_SUSPEND_REQUEST:
- case RTEMS_TASKS_MP_RESUME_REQUEST:
- case RTEMS_TASKS_MP_SET_PRIORITY_REQUEST:
- case RTEMS_TASKS_MP_GET_NOTE_REQUEST:
- case RTEMS_TASKS_MP_SET_NOTE_REQUEST:
-
- the_packet = _RTEMS_tasks_MP_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_TASKS;
- the_packet->Prefix.length = sizeof ( RTEMS_tasks_MP_Packet );
- the_packet->Prefix.to_convert = sizeof ( RTEMS_tasks_MP_Packet );
- the_packet->operation = operation;
- the_packet->Prefix.id = task_id;
- the_packet->the_priority = new_priority;
- the_packet->notepad = notepad;
- the_packet->note = note;
-
- return _MPCI_Send_request_packet(
- rtems_get_node( task_id ),
- &the_packet->Prefix,
- STATES_READY /* Not used */
- );
- break;
-
- case RTEMS_TASKS_MP_ANNOUNCE_CREATE:
- case RTEMS_TASKS_MP_ANNOUNCE_DELETE:
- case RTEMS_TASKS_MP_SUSPEND_RESPONSE:
- case RTEMS_TASKS_MP_RESUME_RESPONSE:
- case RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE:
- case RTEMS_TASKS_MP_GET_NOTE_RESPONSE:
- case RTEMS_TASKS_MP_SET_NOTE_RESPONSE:
- break;
-
- }
- /*
- * The following line is included to satisfy compilers which
- * produce warnings when a function does not end with a return.
- */
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_MP_Send_response_packet
- *
- */
-
-void _RTEMS_tasks_MP_Send_response_packet (
- RTEMS_tasks_MP_Remote_operations operation,
- Thread_Control *the_thread
-)
-{
- RTEMS_tasks_MP_Packet *the_packet;
-
- switch ( operation ) {
-
- case RTEMS_TASKS_MP_SUSPEND_RESPONSE:
- case RTEMS_TASKS_MP_RESUME_RESPONSE:
- case RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE:
- case RTEMS_TASKS_MP_GET_NOTE_RESPONSE:
- case RTEMS_TASKS_MP_SET_NOTE_RESPONSE:
-
- the_packet = (RTEMS_tasks_MP_Packet *) the_thread->receive_packet;
-
-/*
- * The packet being returned already contains the class, length, and
- * to_convert fields, therefore they are not set in this routine.
- */
- the_packet->operation = operation;
- the_packet->Prefix.id = the_packet->Prefix.source_tid;
-
- _MPCI_Send_response_packet(
- rtems_get_node( the_packet->Prefix.source_tid ),
- &the_packet->Prefix
- );
- break;
-
- case RTEMS_TASKS_MP_ANNOUNCE_CREATE:
- case RTEMS_TASKS_MP_ANNOUNCE_DELETE:
- case RTEMS_TASKS_MP_SUSPEND_REQUEST:
- case RTEMS_TASKS_MP_RESUME_REQUEST:
- case RTEMS_TASKS_MP_SET_PRIORITY_REQUEST:
- case RTEMS_TASKS_MP_GET_NOTE_REQUEST:
- case RTEMS_TASKS_MP_SET_NOTE_REQUEST:
- break;
-
- }
-}
-
-/*PAGE
- *
- *
- * _RTEMS_tasks_MP_Process_packet
- *
- */
-
-void _RTEMS_tasks_MP_Process_packet (
- rtems_packet_prefix *the_packet_prefix
-)
-{
- RTEMS_tasks_MP_Packet *the_packet;
- Thread_Control *the_thread;
- boolean ignored;
-
- the_packet = (RTEMS_tasks_MP_Packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case RTEMS_TASKS_MP_ANNOUNCE_CREATE:
-
- ignored = _Objects_MP_Allocate_and_open(
- &_RTEMS_tasks_Information,
- the_packet->name,
- the_packet->Prefix.id,
- TRUE
- );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case RTEMS_TASKS_MP_ANNOUNCE_DELETE:
-
- _Objects_MP_Close( &_RTEMS_tasks_Information, the_packet->Prefix.id );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case RTEMS_TASKS_MP_SUSPEND_REQUEST:
-
- the_packet->Prefix.return_code = rtems_task_suspend(
- the_packet->Prefix.id
- );
-
- _RTEMS_tasks_MP_Send_response_packet(
- RTEMS_TASKS_MP_SUSPEND_RESPONSE,
- _Thread_Executing
- );
- break;
-
- case RTEMS_TASKS_MP_SUSPEND_RESPONSE:
- case RTEMS_TASKS_MP_RESUME_RESPONSE:
- case RTEMS_TASKS_MP_SET_NOTE_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case RTEMS_TASKS_MP_RESUME_REQUEST:
-
- the_packet->Prefix.return_code = rtems_task_resume(
- the_packet->Prefix.id
- );
-
- _RTEMS_tasks_MP_Send_response_packet(
- RTEMS_TASKS_MP_RESUME_RESPONSE,
- _Thread_Executing
- );
- break;
-
- case RTEMS_TASKS_MP_SET_PRIORITY_REQUEST:
-
- the_packet->Prefix.return_code = rtems_task_set_priority(
- the_packet->Prefix.id,
- the_packet->the_priority,
- &the_packet->the_priority
- );
-
- _RTEMS_tasks_MP_Send_response_packet(
- RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE,
- _Thread_Executing
- );
- break;
-
- case RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- *(rtems_task_priority *)the_thread->Wait.return_argument =
- the_packet->the_priority;
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case RTEMS_TASKS_MP_GET_NOTE_REQUEST:
-
- the_packet->Prefix.return_code = rtems_task_get_note(
- the_packet->Prefix.id,
- the_packet->notepad,
- &the_packet->note
- );
-
- _RTEMS_tasks_MP_Send_response_packet(
- RTEMS_TASKS_MP_GET_NOTE_RESPONSE,
- _Thread_Executing
- );
- break;
-
- case RTEMS_TASKS_MP_GET_NOTE_RESPONSE:
-
- the_thread = _MPCI_Process_response( the_packet_prefix );
-
- *(unsigned32 *)the_thread->Wait.return_argument = the_packet->note;
-
- _MPCI_Return_packet( the_packet_prefix );
- break;
-
- case RTEMS_TASKS_MP_SET_NOTE_REQUEST:
-
- the_packet->Prefix.return_code = rtems_task_set_note(
- the_packet->Prefix.id,
- the_packet->notepad,
- the_packet->note
- );
-
- _RTEMS_tasks_MP_Send_response_packet(
- RTEMS_TASKS_MP_SET_NOTE_RESPONSE,
- _Thread_Executing
- );
- break;
- }
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_MP_Send_object_was_deleted
- *
- * This routine is not neededby the Tasks since a task
- * cannot be globally deleted.
- *
- */
-
-/*PAGE
- *
- * _RTEMS_tasks_MP_Send_extract_proxy
- *
- * This routine is not neededby the Tasks since a task
- * cannot be globally deleted.
- *
- */
-
-/*PAGE
- *
- * _RTEMS_tasks_MP_Get_packet
- *
- */
-
-RTEMS_tasks_MP_Packet *_RTEMS_tasks_MP_Get_packet ( void )
-{
- return (RTEMS_tasks_MP_Packet *) _MPCI_Get_packet();
-}
-
-/* end of file */
diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c
deleted file mode 100644
index 723a769836..0000000000
--- a/cpukit/rtems/src/tasks.c
+++ /dev/null
@@ -1,1130 +0,0 @@
-/*
- * RTEMS Task Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/modes.h>
-#include <rtems/score/object.h>
-#include <rtems/score/stack.h>
-#include <rtems/score/states.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/userext.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/apiext.h>
-#include <rtems/score/sysstate.h>
-
-/*PAGE
- *
- * _RTEMS_tasks_Create_extension
- *
- * XXX
- */
-
-boolean _RTEMS_tasks_Create_extension(
- Thread_Control *executing,
- Thread_Control *created
-)
-{
- RTEMS_API_Control *api;
-
- api = _Workspace_Allocate( sizeof( RTEMS_API_Control ) );
-
- if ( !api )
- return FALSE;
-
- created->API_Extensions[ THREAD_API_RTEMS ] = api;
-
- api->pending_events = EVENT_SETS_NONE_PENDING;
- _ASR_Initialize( &api->Signal );
- return TRUE;
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Start_extension
- *
- * XXX
- */
-
-User_extensions_routine _RTEMS_tasks_Start_extension(
- Thread_Control *executing,
- Thread_Control *started
-)
-{
- RTEMS_API_Control *api;
-
- api = started->API_Extensions[ THREAD_API_RTEMS ];
-
- api->pending_events = EVENT_SETS_NONE_PENDING;
-
- _ASR_Initialize( &api->Signal );
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Delete_extension
- *
- * XXX
- */
-
-User_extensions_routine _RTEMS_tasks_Delete_extension(
- Thread_Control *executing,
- Thread_Control *deleted
-)
-{
- (void) _Workspace_Free( deleted->API_Extensions[ THREAD_API_RTEMS ] );
-
- deleted->API_Extensions[ THREAD_API_RTEMS ] = NULL;
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Switch_extension
- *
- * XXX
- */
-
-void _RTEMS_tasks_Switch_extension(
- Thread_Control *executing
-)
-{
- ISR_Level level;
- RTEMS_API_Control *api;
- ASR_Information *asr;
- rtems_signal_set signal_set;
- Modes_Control prev_mode;
-
- api = executing->API_Extensions[ THREAD_API_RTEMS ];
- asr = &api->Signal;
-
- _ISR_Disable( level );
- signal_set = asr->signals_posted;
- asr->signals_posted = 0;
- _ISR_Enable( level );
-
-
- if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
- return;
-
- asr->nest_level += 1;
- rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
-
- (*asr->handler)( signal_set );
-
- asr->nest_level -= 1;
- rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
-
-}
-
-API_extensions_Control _RTEMS_tasks_API_extensions = {
- { NULL, NULL },
- NULL, /* predriver */
- _RTEMS_tasks_Initialize_user_tasks, /* postdriver */
- _RTEMS_tasks_Switch_extension /* post switch */
-};
-
-User_extensions_Control _RTEMS_tasks_User_extensions = {
- { NULL, NULL },
- { _RTEMS_tasks_Create_extension, /* create */
- _RTEMS_tasks_Start_extension, /* start */
- _RTEMS_tasks_Start_extension, /* restart */
- _RTEMS_tasks_Delete_extension, /* delete */
- NULL, /* switch */
- NULL, /* begin */
- NULL, /* exitted */
- NULL /* fatal */
- }
-};
-
-/*PAGE
- *
- * _RTEMS_tasks_Manager_initialization
- *
- * This routine initializes all Task Manager related data structures.
- *
- * Input parameters:
- * maximum_tasks - number of tasks to initialize
- *
- * Output parameters: NONE
- */
-
-void _RTEMS_tasks_Manager_initialization(
- unsigned32 maximum_tasks,
- unsigned32 number_of_initialization_tasks,
- rtems_initialization_tasks_table *user_tasks
-)
-{
-
- _RTEMS_tasks_Number_of_initialization_tasks = number_of_initialization_tasks;
- _RTEMS_tasks_User_initialization_tasks = user_tasks;
-
- /*
- * There may not be any RTEMS initialization tasks configured.
- */
-
-#if 0
- if ( user_tasks == NULL || number_of_initialization_tasks == 0 )
- _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, TRUE, RTEMS_TOO_MANY );
-#endif
-
- _Objects_Initialize_information(
- &_RTEMS_tasks_Information,
- OBJECTS_RTEMS_TASKS,
- TRUE,
- maximum_tasks,
- sizeof( Thread_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- TRUE
- );
-
- /*
- * Add all the extensions for this API
- */
-
- _User_extensions_Add_API_set( &_RTEMS_tasks_User_extensions );
-
- _API_extensions_Add( &_RTEMS_tasks_API_extensions );
-
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor(
- MP_PACKET_TASKS,
- _RTEMS_tasks_MP_Process_packet
- );
-
-}
-
-/*PAGE
- *
- * rtems_task_create
- *
- * This directive creates a thread by allocating and initializing a
- * thread control block and a stack. The newly created thread is
- * placed in the dormant state.
- *
- * Input parameters:
- * name - user defined thread name
- * initial_priority - thread priority
- * stack_size - stack size in bytes
- * initial_modes - initial thread mode
- * attribute_set - thread attributes
- * id - pointer to thread id
- *
- * Output parameters:
- * id - thread id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_create(
- rtems_name name,
- rtems_task_priority initial_priority,
- unsigned32 stack_size,
- rtems_mode initial_modes,
- rtems_attribute attribute_set,
- Objects_Id *id
-)
-{
- register Thread_Control *the_thread;
- Objects_MP_Control *the_global_object = NULL;
- boolean is_fp;
- boolean is_global;
- boolean status;
- rtems_attribute the_attribute_set;
- Priority_Control core_priority;
- RTEMS_API_Control *api;
- ASR_Information *asr;
-
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- /*
- * Core Thread Initialize insures we get the minimum amount of
- * stack space.
- */
-
-#if 0
- if ( !_Stack_Is_enough( stack_size ) )
- return RTEMS_INVALID_SIZE;
-#endif
-
- /*
- * Fix the attribute set to match the attributes which
- * this processor (1) requires and (2) is able to support.
- * First add in the required flags for attribute_set
- * Typically this might include FP if the platform
- * or application required all tasks to be fp aware.
- * Then turn off the requested bits which are not supported.
- */
-
- the_attribute_set = _Attributes_Set( attribute_set, ATTRIBUTES_REQUIRED );
- the_attribute_set =
- _Attributes_Clear( the_attribute_set, ATTRIBUTES_NOT_SUPPORTED );
-
- if ( _Attributes_Is_floating_point( the_attribute_set ) )
- is_fp = TRUE;
- else
- is_fp = FALSE;
-
- /*
- * Validate the RTEMS API priority and convert it to the core priority range.
- */
-
- if ( !_Attributes_Is_system_task( the_attribute_set ) ) {
- if ( !_RTEMS_tasks_Priority_is_valid( initial_priority ) )
- return RTEMS_INVALID_PRIORITY;
- }
-
- core_priority = _RTEMS_tasks_Priority_to_Core( initial_priority );
-
- if ( _Attributes_Is_global( the_attribute_set ) ) {
-
- is_global = TRUE;
-
- if ( !_System_state_Is_multiprocessing )
- return RTEMS_MP_NOT_CONFIGURED;
-
- } else
- is_global = FALSE;
-
- /*
- * Make sure system is MP if this task is global
- */
-
- /*
- * Disable dispatch for protection
- */
-
- _Thread_Disable_dispatch();
-
- /*
- * Allocate the thread control block and -- if the task is global --
- * allocate a global object control block.
- *
- * NOTE: This routine does not use the combined allocate and open
- * global object routine because this results in a lack of
- * control over when memory is allocated and can be freed in
- * the event of an error.
- */
-
- the_thread = _RTEMS_tasks_Allocate();
-
- if ( !the_thread ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- if ( is_global ) {
- the_global_object = _Objects_MP_Allocate_global_object();
-
- if ( _Objects_MP_Is_null_global_object( the_global_object ) ) {
- _RTEMS_tasks_Free( the_thread );
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
- }
-
- /*
- * Initialize the core thread for this task.
- */
-
- status = _Thread_Initialize(
- &_RTEMS_tasks_Information,
- the_thread,
- NULL,
- stack_size,
- is_fp,
- core_priority,
- _Modes_Is_preempt(initial_modes) ? TRUE : FALSE,
- _Modes_Is_timeslice(initial_modes) ?
- THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE :
- THREAD_CPU_BUDGET_ALGORITHM_NONE,
- NULL, /* no budget algorithm callout */
- _Modes_Get_interrupt_level(initial_modes),
- &name
- );
-
- if ( !status ) {
- if ( is_global )
- _Objects_MP_Free_global_object( the_global_object );
- _RTEMS_tasks_Free( the_thread );
- _Thread_Enable_dispatch();
- return RTEMS_UNSATISFIED;
- }
-
- api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
- asr = &api->Signal;
-
- asr->is_enabled = _Modes_Is_asr_disabled(initial_modes) ? FALSE : TRUE;
-
- *id = the_thread->Object.id;
-
- if ( is_global ) {
-
- the_thread->is_global = TRUE;
-
- _Objects_MP_Open(
- &_RTEMS_tasks_Information,
- the_global_object,
- name,
- the_thread->Object.id
- );
-
- _RTEMS_tasks_MP_Send_process_packet(
- RTEMS_TASKS_MP_ANNOUNCE_CREATE,
- the_thread->Object.id,
- name
- );
-
- }
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_task_ident
- *
- * This directive returns the system ID associated with
- * the thread name.
- *
- * Input parameters:
- * name - user defined thread name
- * node - node(s) to be searched
- * id - pointer to thread id
- *
- * Output parameters:
- * *id - thread id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_ident(
- rtems_name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- if ( name == OBJECTS_ID_OF_SELF ) {
- *id = _Thread_Executing->Object.id;
- return RTEMS_SUCCESSFUL;
- }
-
- status = _Objects_Name_to_id( &_RTEMS_tasks_Information, &name, node, id );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_task_start
- *
- * This directive readies the thread identified by the "id"
- * based on its current priorty, to await execution. A thread
- * can be started only from the dormant state.
- *
- * Input parameters:
- * id - thread id
- * entry_point - start execution address of thread
- * argument - thread argument
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_start(
- rtems_id id,
- rtems_task_entry entry_point,
- unsigned32 argument
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
-
- if ( entry_point == NULL )
- return RTEMS_INVALID_ADDRESS;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
- case OBJECTS_LOCAL:
- if ( _Thread_Start(
- the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) {
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_INCORRECT_STATE;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_restart
- *
- * This directive readies the specified thread. It restores
- * the thread environment to the original values established
- * at thread creation and start time. A thread can be restarted
- * from any state except the dormant state.
- *
- * Input parameters:
- * id - thread id
- * argument - thread argument
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_restart(
- Objects_Id id,
- unsigned32 argument
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
- case OBJECTS_LOCAL:
- if ( _Thread_Restart( the_thread, NULL, argument ) ) {
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_INCORRECT_STATE;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_delete
- *
- * This directive allows a thread to delete itself or the thread
- * identified in the id field. The executive halts execution
- * of the thread and frees the thread control block.
- *
- * Input parameters:
- * id - thread id
- *
- * Output parameters:
- * nothing - if id is the requesting thread (always succeeds)
- * RTEMS_SUCCESSFUL - if successful and id is
- * not the requesting thread
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_delete(
- Objects_Id id
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
- Objects_Information *the_information;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Dispatch();
- return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
- case OBJECTS_LOCAL:
- the_information = _Objects_Get_information( the_thread->Object.id );
-
- if ( !the_information ) {
- _Thread_Enable_dispatch();
- return RTEMS_INVALID_ID;
- /* This should never happen if _Thread_Get() works right */
- }
-
- _Thread_Close( the_information, the_thread );
-
- _RTEMS_tasks_Free( the_thread );
-
- if ( the_thread->is_global ) {
-
- _Objects_MP_Close( &_RTEMS_tasks_Information, the_thread->Object.id );
-
- _RTEMS_tasks_MP_Send_process_packet(
- RTEMS_TASKS_MP_ANNOUNCE_DELETE,
- the_thread->Object.id,
- 0 /* Not used */
- );
- }
-
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_suspend
- *
- * This directive will place the specified thread in the "suspended"
- * state. Note that the suspended state can be in addition to
- * other waiting states.
- *
- * Input parameters:
- * id - thread id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_suspend(
- Objects_Id id
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return _RTEMS_tasks_MP_Send_request_packet(
- RTEMS_TASKS_MP_SUSPEND_REQUEST,
- id,
- 0, /* Not used */
- 0, /* Not used */
- 0 /* Not used */
- );
- case OBJECTS_LOCAL:
- if ( !_States_Is_suspended( the_thread->current_state ) ) {
- _Thread_Set_state( the_thread, STATES_SUSPENDED );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_ALREADY_SUSPENDED;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_resume
- *
- * This directive will remove the specified thread
- * from the suspended state.
- *
- * Input parameters:
- * id - thread id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_resume(
- Objects_Id id
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return(
- _RTEMS_tasks_MP_Send_request_packet(
- RTEMS_TASKS_MP_RESUME_REQUEST,
- id,
- 0, /* Not used */
- 0, /* Not used */
- 0 /* Not used */
- )
- );
- case OBJECTS_LOCAL:
- if ( _States_Is_suspended( the_thread->current_state ) ) {
- _Thread_Resume( the_thread );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
- _Thread_Enable_dispatch();
- return RTEMS_INCORRECT_STATE;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_set_priority
- *
- * This directive changes the priority of the specified thread.
- * The specified thread can be any thread in the system including
- * the requesting thread.
- *
- * Input parameters:
- * id - thread id (0 indicates requesting thread)
- * new_priority - thread priority (0 indicates current priority)
- * old_priority - pointer to previous priority
- *
- * Output parameters:
- * old_priority - previous priority
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_set_priority(
- Objects_Id id,
- rtems_task_priority new_priority,
- rtems_task_priority *old_priority
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
-
- if ( new_priority != RTEMS_CURRENT_PRIORITY &&
- !_RTEMS_tasks_Priority_is_valid( new_priority ) )
- return RTEMS_INVALID_PRIORITY;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Executing->Wait.return_argument = old_priority;
- return(
- _RTEMS_tasks_MP_Send_request_packet(
- RTEMS_TASKS_MP_SET_PRIORITY_REQUEST,
- id,
- new_priority,
- 0, /* Not used */
- 0 /* Not used */
- )
- );
- case OBJECTS_LOCAL:
- *old_priority = the_thread->current_priority;
- if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
- the_thread->real_priority = new_priority;
- if ( the_thread->resource_count == 0 ||
- the_thread->current_priority > new_priority )
- _Thread_Change_priority( the_thread, new_priority, FALSE );
- }
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_mode
- *
- * This directive enables and disables several modes of
- * execution for the requesting thread.
- *
- * Input parameters:
- * mode_set - new mode
- * mask - mask
- * previous_mode_set - address of previous mode set
- *
- * Output:
- * *previous_mode_set - previous mode set
- * always return RTEMS_SUCCESSFUL;
- */
-
-rtems_status_code rtems_task_mode(
- rtems_mode mode_set,
- rtems_mode mask,
- rtems_mode *previous_mode_set
-)
-{
- Thread_Control *executing;
- RTEMS_API_Control *api;
- ASR_Information *asr;
- boolean is_asr_enabled = FALSE;
- boolean needs_asr_dispatching = FALSE;
- rtems_mode old_mode;
-
- executing = _Thread_Executing;
- api = executing->API_Extensions[ THREAD_API_RTEMS ];
- asr = &api->Signal;
-
- old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
-
- if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
- old_mode |= RTEMS_NO_TIMESLICE;
- else
- old_mode |= RTEMS_TIMESLICE;
-
- old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
- old_mode |= _ISR_Get_level();
-
- *previous_mode_set = old_mode;
-
- /*
- * These are generic thread scheduling characteristics.
- */
-
- if ( mask & RTEMS_PREEMPT_MASK )
- executing->is_preemptible = _Modes_Is_preempt(mode_set) ? TRUE : FALSE;
-
- if ( mask & RTEMS_TIMESLICE_MASK ) {
- if ( _Modes_Is_timeslice(mode_set) )
- executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
- else
- executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
- }
-
- /*
- * Set the new interrupt level
- */
-
- if ( mask & RTEMS_INTERRUPT_MASK )
- _Modes_Set_interrupt_level( mode_set );
-
- /*
- * This is specific to the RTEMS API
- */
-
- is_asr_enabled = FALSE;
- needs_asr_dispatching = FALSE;
-
- if ( mask & RTEMS_ASR_MASK ) {
- is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? FALSE : TRUE;
- if ( is_asr_enabled != asr->is_enabled ) {
- asr->is_enabled = is_asr_enabled;
- _ASR_Swap_signals( asr );
- if ( _ASR_Are_signals_pending( asr ) ) {
- needs_asr_dispatching = TRUE;
- executing->do_post_task_switch_extension = TRUE;
- }
- }
- }
-
- if ( _Thread_Evaluate_mode() || needs_asr_dispatching )
- _Thread_Dispatch();
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_task_get_note
- *
- * This directive obtains the note from the specified notepad
- * of the specified thread.
- *
- * Input parameters:
- * id - thread id
- * notepad - notepad number
- * note - pointer to note
- *
- * Output parameters:
- * note - filled in if successful
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_get_note(
- Objects_Id id,
- unsigned32 notepad,
- unsigned32 *note
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
- RTEMS_API_Control *api;
-
- /*
- * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would
- * be checking an unsigned number for being negative.
- */
-
- if ( notepad > RTEMS_NOTEPAD_LAST )
- return RTEMS_INVALID_NUMBER;
-
- /*
- * Optimize the most likely case to avoid the Thread_Dispatch.
- */
-
- if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ||
- _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) {
- api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ];
- *note = api->Notepads[ notepad ];
- return RTEMS_SUCCESSFUL;
- }
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- _Thread_Executing->Wait.return_argument = note;
-
- return _RTEMS_tasks_MP_Send_request_packet(
- RTEMS_TASKS_MP_GET_NOTE_REQUEST,
- id,
- 0, /* Not used */
- notepad,
- 0 /* Not used */
- );
- case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
- *note = api->Notepads[ notepad ];
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_set_note
- *
- * This directive sets the specified notepad contents to the given
- * note.
- *
- * Input parameters:
- * id - thread id
- * notepad - notepad number
- * note - note value
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_set_note(
- Objects_Id id,
- unsigned32 notepad,
- unsigned32 note
-)
-{
- register Thread_Control *the_thread;
- Objects_Locations location;
- RTEMS_API_Control *api;
-
- /*
- * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would
- * be checking an unsigned number for being negative.
- */
-
- if ( notepad > RTEMS_NOTEPAD_LAST )
- return RTEMS_INVALID_NUMBER;
-
- /*
- * Optimize the most likely case to avoid the Thread_Dispatch.
- */
-
- if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ||
- _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) {
- api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ];
- api->Notepads[ notepad ] = note;
- return RTEMS_SUCCESSFUL;
- }
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- return RTEMS_INVALID_ID;
- case OBJECTS_REMOTE:
- return _RTEMS_tasks_MP_Send_request_packet(
- RTEMS_TASKS_MP_SET_NOTE_REQUEST,
- id,
- 0, /* Not used */
- notepad,
- note
- );
-
- case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
- api->Notepads[ notepad ] = note;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
-
-/*PAGE
- *
- * rtems_task_wake_after
- *
- * This directive suspends the requesting thread for the given amount
- * of ticks.
- *
- * Input parameters:
- * ticks - number of ticks to wait
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - always successful
- */
-
-rtems_status_code rtems_task_wake_after(
- rtems_interval ticks
-)
-{
- if ( ticks == 0 ) {
- _Thread_Yield_processor();
- _Thread_Dispatch();
- } else {
- _Thread_Disable_dispatch();
- _Thread_Set_state( _Thread_Executing, STATES_DELAYING );
- _Watchdog_Initialize(
- &_Thread_Executing->Timer,
- _Thread_Delay_ended,
- _Thread_Executing->Object.id,
- NULL
- );
- _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks );
- _Thread_Enable_dispatch();
- }
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_task_wake_when
- *
- * This directive blocks the requesting thread until the given date and
- * time is reached.
- *
- * Input parameters:
- * time_buffer - pointer to the time and date structure
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_task_wake_when(
-rtems_time_of_day *time_buffer
-)
-{
- Watchdog_Interval seconds;
-
- if ( !_TOD_Is_set )
- return RTEMS_NOT_DEFINED;
-
- time_buffer->ticks = 0;
-
- if ( !_TOD_Validate( time_buffer ) )
- return RTEMS_INVALID_CLOCK;
-
- seconds = _TOD_To_seconds( time_buffer );
-
- if ( seconds <= _TOD_Seconds_since_epoch )
- return RTEMS_INVALID_CLOCK;
-
- _Thread_Disable_dispatch();
- _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME );
- _Watchdog_Initialize(
- &_Thread_Executing->Timer,
- _Thread_Delay_ended,
- _Thread_Executing->Object.id,
- NULL
- );
- _Watchdog_Insert_seconds(
- &_Thread_Executing->Timer,
- seconds - _TOD_Seconds_since_epoch
- );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _RTEMS_tasks_Initialize_user_tasks
- *
- * This routine creates and starts all configured user
- * initialzation threads.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _RTEMS_tasks_Initialize_user_tasks( void )
-{
- unsigned32 index;
- unsigned32 maximum;
- rtems_id id;
- rtems_status_code return_value;
- rtems_initialization_tasks_table *user_tasks;
-
- /*
- * NOTE: This is slightly different from the Ada implementation.
- */
-
- user_tasks = _RTEMS_tasks_User_initialization_tasks;
- maximum = _RTEMS_tasks_Number_of_initialization_tasks;
-
- if ( !user_tasks || maximum == 0 )
- return;
-
- for ( index=0 ; index < maximum ; index++ ) {
- return_value = rtems_task_create(
- user_tasks[ index ].name,
- user_tasks[ index ].initial_priority,
- user_tasks[ index ].stack_size,
- user_tasks[ index ].mode_set,
- user_tasks[ index ].attribute_set,
- &id
- );
-
- if ( !rtems_is_status_successful( return_value ) )
- _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, TRUE, return_value );
-
- return_value = rtems_task_start(
- id,
- user_tasks[ index ].entry_point,
- user_tasks[ index ].argument
- );
-
- if ( !rtems_is_status_successful( return_value ) )
- _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, TRUE, return_value );
- }
-}
-
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
deleted file mode 100644
index e31218ac0d..0000000000
--- a/cpukit/sapi/include/confdefs.h
+++ /dev/null
@@ -1,656 +0,0 @@
-/* confdefs.h
- *
- * This include file contains the configuration table template that will
- * be used by the single processor tests to define its default configuration
- * parameters.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __CONFIGURATION_TEMPLATE_h
-#define __CONFIGURATION_TEMPLATE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern rtems_initialization_tasks_table Initialization_tasks[];
-extern rtems_driver_address_table Device_drivers[];
-extern rtems_configuration_table Configuration;
-extern rtems_multiprocessing_table Multiprocessing_configuration;
-#ifdef RTEMS_POSIX_API
-extern posix_api_configuration_table Configuration_POSIX_API;
-#endif
-
-/*
- * RTEMS C Library and Newlib support
- *
- * NOTE: This ends up defining these even when newlib is not used.
- */
-
-#define CONFIGURE_NEWLIB_EXTENSION 1
-#define CONFIGURE_MALLOC_REGION 1
-
-#ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
-#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
-#endif
-
-#define CONFIGURE_LIBIO_SEMAPHORES \
- (CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS + 1)
-
-#ifdef CONFIGURE_INIT
-unsigned32 rtems_libio_number_iops = CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS;
-#endif
-
-/*
- * Stack Checker Requirements
- */
-
-#ifdef STACK_CHECKER_ON
-#define CONFIGURE_STACK_CHECKER_EXTENSION 1
-#else
-#define CONFIGURE_STACK_CHECKER_EXTENSION 0
-#endif
-
-/*
- * Interrupt Stack Space
- */
-
-#if (CPU_ALLOCATE_INTERRUPT_STACK == 0)
-#define CONFIGURE_INTERRUPT_STACK_MEMORY 0
-#else
- #ifndef CONFIGURE_INTERRUPT_STACK_MEMORY
- #define CONFIGURE_INTERRUPT_STACK_MEMORY RTEMS_MINIMUM_STACK_SIZE
- #else
- #define CONFIGURE_INTERRUPT_STACK_MEMORY 0
- #endif
-#endif
-
-/*
- * Default User Initialization Task Table. This table guarantees that
- * one user initialization table is defined.
- */
-
-#ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE
-
-/*
- * The user is defining their own table information and setting the
- * appropriate variables.
- */
-
-#else
-
-#ifndef CONFIGURE_INIT_TASK_NAME
-#define CONFIGURE_INIT_TASK_NAME rtems_build_name( 'U', 'I', '1', ' ' )
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_STACK_SIZE
-#define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_PRIORITY
-#define CONFIGURE_INIT_TASK_PRIORITY 1
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_ATTRIBUTES
-#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_ENTRY_POINT
-#define CONFIGURE_INIT_TASK_ENTRY_POINT Init
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_INITIAL_MODES
-#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
-#endif
-
-#ifndef CONFIGURE_INIT_TASK_ARGUMENTS
-#define CONFIGURE_INIT_TASK_ARGUMENTS 0
-#endif
-
-#ifdef CONFIGURE_INIT
-rtems_initialization_tasks_table Initialization_tasks[] = {
- { CONFIGURE_INIT_TASK_NAME,
- CONFIGURE_INIT_TASK_STACK_SIZE,
- CONFIGURE_INIT_TASK_PRIORITY,
- CONFIGURE_INIT_TASK_ATTRIBUTES,
- CONFIGURE_INIT_TASK_ENTRY_POINT,
- CONFIGURE_INIT_TASK_INITIAL_MODES,
- CONFIGURE_INIT_TASK_ARGUMENTS
- }
-};
-#endif
-
-#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
-
-#define CONFIGURE_INIT_TASK_TABLE_SIZE \
- sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
-
-#endif /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */
-
-#else /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */
-
-#define CONFIGURE_INIT_TASK_TABLE NULL
-#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
-
-#endif
-
-/*
- * Default Device Driver Table. Each driver needed by the test is explicitly
- * choosen by that test. There is always a null driver entry.
- */
-
-#define NULL_DRIVER_TABLE_ENTRY \
- { NULL, NULL, NULL, NULL, NULL, NULL }
-
-#ifdef CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-#include <timerdrv.h>
-#endif
-
-#ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER
-#include <stubdrv.h>
-#endif
-
-#ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
-
-#ifdef CONFIGURE_INIT
-rtems_driver_address_table Device_drivers[] = {
-#ifdef CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
- CONSOLE_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
- CLOCK_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER
- STUB_DRIVER_TABLE_ENTRY,
-#endif
- NULL_DRIVER_TABLE_ENTRY
-};
-#endif
-
-#endif /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */
-
-/*
- * Default the number of devices per device driver. This value may be
- * overridden by the user.
- */
-
-#ifndef CONFIGURE_HAS_OWN_NUMBER_OF_DEVICES
-
-#ifndef CONFIGURE_MAXIMUM_DEVICES
-#define CONFIGURE_MAXIMUM_DEVICES 20
-#endif
-
-#endif /* CONFIGURE_HAS_OWN_NUMBER_OF_DEVICES */
-
-/*
- * Default Configuration Table. This table contains the most values set in
- * the RTEMS Test Suite. Each value may be overridden within each test to
- * customize the environment.
- */
-
-#ifdef CONFIGURE_MPTEST
-#ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
-
-#ifndef CONFIGURE_MP_NODE_NUMBER
-#define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER
-#endif
-
-#ifndef CONFIGURE_MP_MAXIMUM_NODES
-#define CONFIGURE_MP_MAXIMUM_NODES 2
-#endif
-
-#ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
-#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32
-#endif
-
-#ifndef CONFIGURE_MP_MAXIMUM_PROXIES
-#define CONFIGURE_MP_MAXIMUM_PROXIES 32
-#endif
-
-#ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
-#include <mpci.h>
-#define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table
-#endif
-
-#ifdef CONFIGURE_INIT
-rtems_multiprocessing_table Multiprocessing_configuration = {
- CONFIGURE_MP_NODE_NUMBER, /* local node number */
- CONFIGURE_MP_MAXIMUM_NODES, /* maximum # nodes in system */
- CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS, /* maximum # global objects */
- CONFIGURE_MP_MAXIMUM_PROXIES, /* maximum # proxies */
- CONFIGURE_MP_MPCI_TABLE_POINTER /* pointer to MPCI config table */
-};
-#endif
-
-#define CONFIGURE_MULTIPROCESSING_TABLE &Multiprocessing_configuration
-
-#endif /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */
-
-#else
-
-#define CONFIGURE_MULTIPROCESSING_TABLE NULL
-
-#endif /* CONFIGURE_MPTEST */
-
-/*
- * Default Configuration Table. This table contains the most values set in
- * the RTEMS Test Suite. Each value may be overridden within each test to
- * customize the environment.
- */
-
-#ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE
-
-#ifndef CONFIGURE_EXECUTIVE_RAM_WORK_AREA
-#define CONFIGURE_EXECUTIVE_RAM_WORK_AREA NULL
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_TASKS
-#define CONFIGURE_MAXIMUM_TASKS 10
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_TIMERS
-#define CONFIGURE_MAXIMUM_TIMERS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_SEMAPHORES
-#define CONFIGURE_MAXIMUM_SEMAPHORES 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_PARTITIONS
-#define CONFIGURE_MAXIMUM_PARTITIONS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_REGIONS
-#define CONFIGURE_MAXIMUM_REGIONS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_PORTS
-#define CONFIGURE_MAXIMUM_PORTS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_PERIODS
-#define CONFIGURE_MAXIMUM_PERIODS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
-#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0
-#endif
-
-#ifndef CONFIGURE_MICROSECONDS_PER_TICK
-#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(10)
-#endif
-
-#ifndef CONFIGURE_TICKS_PER_TIMESLICE
-#define CONFIGURE_TICKS_PER_TIMESLICE 50
-#endif
-
-/*
- * Initial Extension Set
- */
-
-#ifdef CONFIGURE_INIT
-#ifdef STACK_CHECKER_ON
-#include <stackchk.h>
-#endif
-
-rtems_extensions_table Configuration_Initial_Extensions[] = {
-#ifdef CONFIGURE_INITIAL_EXTENSIONS
- CONFIGURE_INITIAL_EXTENSIONS,
-#endif
-#ifdef STACK_CHECKER_ON
- STACK_CHECKER_EXTENSION,
-#endif
- { NULL, NULL, NULL, NULL, NULL, NULL, NULL }
-};
-
-#define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \
- ((sizeof(Configuration_Initial_Extensions) / \
- sizeof(rtems_extensions_table)) - 1)
-
-#endif
-
-/*
- * POSIX API Configuration Parameters
- */
-
-#ifdef RTEMS_POSIX_API
-
-#include <sys/types.h>
-#include <rtems/posix/cond.h>
-#include <rtems/posix/mutex.h>
-#include <rtems/posix/key.h>
-#include <rtems/posix/psignal.h>
-#include <rtems/posix/threadsup.h>
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_KEYS
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 0
-#endif
-
-#ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
-#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0
-#endif
-
-#ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
-
-/*
- * The user is defining their own table information and setting the
- * appropriate variables.
- */
-
-#else
-
-#ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
-#define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init
-#endif
-
-#ifdef CONFIGURE_INIT
-posix_initialization_threads_table POSIX_Initialization_threads[] = {
- { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT }
-};
-#endif
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME POSIX_Initialization_threads
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
- sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \
- sizeof(posix_initialization_threads_table)
-
-#endif /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
-
-#else /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0
-
-#endif
-
-#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \
- ( \
- sizeof (POSIX_API_Control) + \
- (sizeof (void *) * (CONFIGURE_GNAT_KEYS + CONFIGURE_MAXIMUM_POSIX_KEYS)) \
- )
-
-#define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \
- ((_mutexes) * \
- ( sizeof(POSIX_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condition_variables) \
- ((_condition_variables) * \
- ( sizeof(POSIX_Condition_variables_Control) + \
- CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \
- ((_keys) * \
- ( sizeof(POSIX_Keys_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
- ((_queued_signals) * \
- ( sizeof(POSIX_signals_Siginfo_node) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-
-
-#define CONFIGURE_MEMORY_FOR_POSIX \
- ( \
- CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \
- CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
- CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \
- CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \
- CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
- CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) \
- )
-
-
-#else
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 0
-#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0
-#define CONFIGURE_MEMORY_FOR_POSIX 0
-
-#endif /* RTEMS_POSIX_API */
-
-/*
- * Calculate the RAM size based on the maximum number of objects configured.
- * The model is to estimate the memory required for each configured item,
- * sum the memory requirements and insure that there is at least 32K greater
- * than that for things not directly addressed such as:
- *
- * + stacks greater than minimum size
- * + FP contexts
- * + API areas (should be optional)
- * + messages
- * + object name and local pointer table overhead
- * + per node memory requirements
- * + executive fixed requirements (including at least internal threads
- * and the Ready chains)
- *
- * NOTE: Eventually this should take into account some of the above.
- * Basically, this is a "back of the envelope" estimate for
- * memory requirements. It could be more accurate.
- */
-
-#ifndef CONFIGURE_EXECUTIVE_RAM_SIZE
-
-#define CONFIGURE_OBJECT_TABLE_STUFF \
- ( sizeof(Objects_Control *) + sizeof(rtems_name *) + sizeof(rtems_name) )
-
-#define CONFIGURE_MEMORY_FOR_TASKS(_tasks) \
- (((_tasks) + 1 ) * \
- ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \
- STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \
- CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \
- CONFIGURE_OBJECT_TABLE_STUFF)) \
- )
-
-#define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \
- ((_timers) * ( sizeof(Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \
- ((_semaphores) * \
- ( sizeof(Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \
- ( (_queues) * \
- ( sizeof(Message_queue_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \
- ( (_partitions) * \
- ( sizeof(Partition_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \
- ( (_regions) * \
- ( sizeof(Region_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_PORTS(_ports) \
- ( (_ports) * \
- ( sizeof(Dual_ported_memory_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \
- ( (_periods) * \
- ( sizeof(Rate_monotonic_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \
- ( (_extensions) * \
- ( sizeof(Extension_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
-
-#define CONFIGURE_MEMORY_FOR_DEVICES(_devices) \
- (((_devices) + 1) * ( sizeof(rtems_driver_name_t) ) )
-
-#ifdef CONFIGURE_MPTEST
-
-#ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
-
-#define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \
- ( ((_proxies) + 1) * ( sizeof(Thread_Proxy_control) ) )
-
-#define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \
- ((_global_objects) * ( sizeof(Objects_MP_Control) ) )
-
-#define CONFIGURE_MEMORY_FOR_MP \
- ( CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \
- CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \
- CONFIGURE_MEMORY_FOR_TASKS(1) \
- )
-
-#endif /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */
-
-#else
-
-#define CONFIGURE_MEMORY_FOR_MP 0
-
-#endif
-
-#ifndef CONFIGURE_MEMORY_OVERHEAD
-#define CONFIGURE_MEMORY_OVERHEAD 0
-#endif
-
-#ifndef CONFIGURE_EXTRA_TASK_STACKS
-#define CONFIGURE_EXTRA_TASK_STACKS 0
-#endif
-
-#define CONFIGURE_MEMORY_FOR_SYSTEM_OVEREHAD \
- ( CONFIGURE_MEMORY_FOR_TASKS(1) + /* IDLE */ \
- (256 * 12) + /* Ready chains */ \
- 256 + /* name/ptr table overhead */ \
- CONFIGURE_INTERRUPT_STACK_MEMORY /* interrupt stack */ \
- )
-
-#define CONFIGURE_EXECUTIVE_RAM_SIZE \
-(( CONFIGURE_MEMORY_FOR_POSIX + \
- CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS + \
- CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS ) + \
- CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \
- CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \
- CONFIGURE_LIBIO_SEMAPHORES) + \
- CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \
- CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \
- CONFIGURE_MEMORY_FOR_REGIONS( \
- CONFIGURE_MAXIMUM_REGIONS + CONFIGURE_MALLOC_REGION ) + \
- CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \
- CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \
- CONFIGURE_MEMORY_FOR_USER_EXTENSIONS( \
- CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION + \
- CONFIGURE_STACK_CHECKER_EXTENSION ) + \
- CONFIGURE_MEMORY_FOR_DEVICES(CONFIGURE_MAXIMUM_DEVICES) + \
- CONFIGURE_MEMORY_FOR_MP + \
- CONFIGURE_MEMORY_FOR_SYSTEM_OVEREHAD + \
- (((CONFIGURE_MEMORY_OVERHEAD)+1) * 1024) + \
- (CONFIGURE_EXTRA_TASK_STACKS) + (CONFIGURE_ADA_TASKS_STACK) \
-) & 0xfffffc00)
-#endif
-
-#ifdef CONFIGURE_GNAT_RTEMS
-#define CONFIGURE_GNAT_MUTEXES 10
-#define CONFIGURE_GNAT_KEYS 1
-
-/* 20 are required to run all tests in the ACVC */
-#ifndef CONFIGURE_MAXIMUM_ADA_TASKS
-#define CONFIGURE_MAXIMUM_ADA_TASKS 20
-#endif
-
-/* This is the number of non-Ada tasks which invoked Ada code. */
-#ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
-#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
-#endif
-
-/* Ada tasks are allocated twice the minimum stack space */
-#define CONFIGURE_ADA_TASKS_STACK \
- (CONFIGURE_MAXIMUM_ADA_TASKS * (RTEMS_MINIMUM_STACK_SIZE + (6 * 1024)))
-
-#else
-#define CONFIGURE_GNAT_MUTEXES 0
-#define CONFIGURE_GNAT_KEYS 0
-#define CONFIGURE_MAXIMUM_ADA_TASKS 0
-#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
-#define CONFIGURE_ADA_TASKS_STACK 0
-#endif
-
-
-#ifdef CONFIGURE_INIT
-
-rtems_api_configuration_table Configuration_RTEMS_API = {
- CONFIGURE_MAXIMUM_TASKS,
- CONFIGURE_MAXIMUM_TIMERS,
- CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES,
- CONFIGURE_MAXIMUM_MESSAGE_QUEUES,
- CONFIGURE_MAXIMUM_PARTITIONS,
- CONFIGURE_MAXIMUM_REGIONS + CONFIGURE_MALLOC_REGION,
- CONFIGURE_MAXIMUM_PORTS,
- CONFIGURE_MAXIMUM_PERIODS,
- CONFIGURE_INIT_TASK_TABLE_SIZE,
- CONFIGURE_INIT_TASK_TABLE
-};
-
-#ifdef RTEMS_POSIX_API
-posix_api_configuration_table Configuration_POSIX_API = {
- CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS,
- CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES +
- CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS,
- CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES +
- CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS,
- CONFIGURE_MAXIMUM_POSIX_KEYS + CONFIGURE_GNAT_KEYS,
- CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS,
- CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE,
- CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME
-};
-#endif
-
-rtems_configuration_table Configuration = {
- CONFIGURE_EXECUTIVE_RAM_WORK_AREA,
- CONFIGURE_EXECUTIVE_RAM_SIZE,
- CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION +
- CONFIGURE_STACK_CHECKER_EXTENSION,
- CONFIGURE_MICROSECONDS_PER_TICK,
- CONFIGURE_TICKS_PER_TIMESLICE,
- CONFIGURE_MAXIMUM_DEVICES,
- sizeof (Device_drivers)/
- sizeof(rtems_driver_address_table), /* number of device drivers */
- Device_drivers, /* pointer to driver table */
- CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of initial extensions */
- Configuration_Initial_Extensions, /* pointer to initial extensions */
- CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */
- &Configuration_RTEMS_API, /* pointer to RTEMS API config */
-#ifdef RTEMS_POSIX_API
- &Configuration_POSIX_API /* pointer to POSIX API config */
-#else
- NULL /* pointer to POSIX API config */
-#endif
-};
-#endif
-
-#endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/sapi/include/rtems/README b/cpukit/sapi/include/rtems/README
deleted file mode 100644
index 5fcc0d14c7..0000000000
--- a/cpukit/sapi/include/rtems/README
+++ /dev/null
@@ -1,135 +0,0 @@
-#
-# $Id$
-#
-
-Configuring a System Using the Template in confdefs.h
-=====================================================
-
-The file confdefs.h is a Configuration Template file which can be
-used to greatly simplify the creation and maintenance of RTEMS
-Configuration Tables. The basic concepts are:
-
- + confdefs.h provides defaults for all configuration parameters
-
- + applications specify only those values they wish to override
-
- + confdefs.h can be the only file which knows the precise layout
- of the RTEMS Configuration Tables.
-
-The Configuration Template setup is used by all RTEMS tests to
-simplify the maintenance of the tests.
-
-Here is the section from the system.h file from test tm21 from
-the Timing Test Suite:
-
- /* configuration information */
-
- #define CONFIGURE_TMTEST
-
- #define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
- #define CONFIGURE_TEST_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
-
- #include <confdefs.h>
-
-
-The above example overrides a number of the configuration parameters.
-It informs the template that it is a member of the Timing Suite,
-requires a console and timer driver, and that it needs 102 tasks,
-100 timers, 100 semaphores, 100 message queues, 100 partitions,
-100 regions, 100 ports, and 100 periods. By default, the test
-would have gotten no drivers, 10 tasks, and no other RTEMS objects.
-
-The following shows the configuration tables generated by the
-template by default.
-
-
-#include <bsp.h>
-
-#define NULL_DRIVER_TABLE_ENTRY \
- { NULL, NULL, NULL, NULL, NULL, NULL }
-
-rtems_driver_address_table Device_drivers[] = {
-#ifdef CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
- CONSOLE_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
- CLOCK_DRIVER_TABLE_ENTRY,
-#endif
-#ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER
- STUB_DRIVER_TABLE_ENTRY,
-#endif
- NULL_DRIVER_TABLE_ENTRY,
-};
-
-rtems_initialization_tasks_table Initialization_tasks[] = {
- { rtems_build_name( 'U', 'I', '1', ' ' ), /* init task name */
- RTEMS_MINIMUM_STACK_SIZE, /* init task stack size */
- 1, /* init task priority */
- RTEMS_DEFAULT_ATTRIBUTES, /* init task attributes */
- Init, /* init task entry point */
- RTEMS_NO_PREEMPT, /* init task initial mode */
- 0 /* init task argument list */
- }
-};
-
-#ifdef CONFIGURE_MPTEST
-/*
- * NODE_NUMBER is assumed to be set on the compile line.
- */
-
-rtems_multiprocessing_table Multiprocessing_configuration = {
- NODE_NUMBER, /* local node number */
- 2, /* maximum # nodes in system */
- 32, /* maximum # global objects */
- 32, /* maximum # proxies */
- &MPCI_table /* pointer to MPCI config table */
-};
-#endif
-
-/*
- * CONFIGURE_EXECUTIVE_RAM_SIZE is a rough guess based on the number of
- * tasks in the system plus enough extra to get a whole 64K extra.
- *
- * The NULL address for the workspace area is assumed to be assigned
- * at startup time by the BSP.
- */
-
-rtems_configuration_table Configuration = {
- NULL, /* executive RAM work area */
- CONFIGURE_EXECUTIVE_RAM_SIZE, /* executive RAM size */
- 10, /* maximum # tasks */
- 0, /* maximum # timers */
- 0, /* maximum # semaphores */
- 0, /* maximum # message queues */
- 0, /* maximum # messages */
- 0, /* maximum # partitions */
- 0, /* maximum # regions */
- 0, /* maximum # dp memory areas */
- 0, /* maximum # periods */
- 0, /* maximum # user extensions */
- RTEMS_MILLISECONDS_TO_MICROSECONDS(10), /* # us in a tick */
- 50, /* # ticks in a timeslice */
- sizeof (Initialization_tasks) / sizeof(rtems_initialization_tasks_table),
- /* number of init tasks */
- Initialization_tasks, /* init task(s) table */
- sizeof (Device_drivers) / sizeof(rtems_driver_address_table),
- /* number of device drivers */
- Device_drivers, /* pointer to driver address table */
- NULL, /* pointer to initial extensions */
-#ifdef CONFIGURE_MPTEST
- &Multiprocessing_configuration
-#else
- NULL /* ptr to MP config table */
-#endif
-};
diff --git a/cpukit/sapi/include/rtems/config.h b/cpukit/sapi/include/rtems/config.h
deleted file mode 100644
index e3ae50d7d1..0000000000
--- a/cpukit/sapi/include/rtems/config.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* config.h
- *
- * This include file contains the table of user defined configuration
- * parameters.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CONFIGURATION_h
-#define __RTEMS_CONFIGURATION_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This is kind of kludgy but it allows targets to totally ignore the
- * POSIX API safely.
- */
-
-#ifdef RTEMS_POSIX_API
-#include <rtems/posix/config.h>
-#else
-
-typedef void *posix_api_configuration_table;
-#endif
-
-#include <rtems/rtems/config.h>
-
-/* XXX <rtems/rtems/config.h> should cover these
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/types.h>
-#include <rtems/rtems/tasks.h>
-*/
-
-#include <rtems/extension.h>
-#include <rtems/io.h>
-#include <rtems/score/mpci.h>
-
-/*
- * The following records define the Multiprocessor Configuration
- * Table. This table defines the multiprocessor system
- * characteristics which must be known by RTEMS in a multiprocessor
- * system.
- */
-
-typedef struct {
- unsigned32 node; /* local node number */
- unsigned32 maximum_nodes; /* maximum # nodes in system */
- unsigned32 maximum_global_objects; /* maximum # global objects */
- unsigned32 maximum_proxies; /* maximum # proxies */
- MPCI_Control *User_mpci_table; /* pointer to MPCI table */
-} rtems_multiprocessing_table;
-
-/*
- * The following records define the Configuration Table. The
- * information contained in this table is required in all
- * RTEMS systems, whether single or multiprocessor. This
- * table primarily defines the following:
- *
- * + location and size of the RTEMS Workspace
- * + microseconds per clock tick
- * + clock ticks per task timeslice
- * + required number of each object type for each API configured
- */
-
-typedef struct {
- void *work_space_start;
- unsigned32 work_space_size;
- unsigned32 maximum_extensions;
- unsigned32 microseconds_per_tick;
- unsigned32 ticks_per_timeslice;
- unsigned32 maximum_devices;
- unsigned32 number_of_device_drivers;
- rtems_driver_address_table *Device_driver_table;
- unsigned32 number_of_initial_extensions;
- rtems_extensions_table *User_extension_table;
- rtems_multiprocessing_table *User_multiprocessing_table;
- rtems_api_configuration_table *RTEMS_api_configuration;
- posix_api_configuration_table *POSIX_api_configuration;
-} rtems_configuration_table;
-
-/*
- * The following are provided strictly for the convenience of
- * the user. They are not used in RTEMS itself.
- */
-
-SAPI_EXTERN rtems_configuration_table *_Configuration_Table;
-SAPI_EXTERN rtems_multiprocessing_table *_Configuration_MP_table;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/sapi/include/rtems/extension.h b/cpukit/sapi/include/rtems/extension.h
deleted file mode 100644
index 9b6b21c70e..0000000000
--- a/cpukit/sapi/include/rtems/extension.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/* extension.h
- *
- * This include file contains all the constants, structures, and
- * prototypes associated with the User Extension Manager. This manager
- * provides a mechanism for manipulating sets of user-defined extensions.
- *
- * Directives provided are:
- *
- * + create user extension set
- * + get ID of user extension set
- * + delete user extension set
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_EXTENSION_MANAGER_h
-#define __RTEMS_EXTENSION_MANAGER_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/userext.h>
-#include <rtems/rtems/status.h> /* XXX */
-#include <rtems/rtems/types.h> /* XXX */
-
-/*
- * Extension related types
- */
-
-typedef User_extensions_routine rtems_extension;
-typedef User_extensions_thread_create_extension rtems_task_create_extension;
-typedef User_extensions_thread_delete_extension rtems_task_delete_extension;
-typedef User_extensions_thread_start_extension rtems_task_start_extension;
-typedef User_extensions_thread_restart_extension rtems_task_restart_extension;
-typedef User_extensions_thread_switch_extension rtems_task_switch_extension;
-typedef User_extensions_thread_post_switch_extension
- rtems_task_post_switch_extension;
-typedef User_extensions_thread_begin_extension rtems_task_begin_extension;
-typedef User_extensions_thread_exitted_extension rtems_task_exitted_extension;
-typedef User_extensions_fatal_extension rtems_fatal_extension;
-
-typedef User_extensions_Table rtems_extensions_table;
-
-/*
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-SAPI_EXTERN Objects_Information _Extension_Information;
-
-/*
- * The following records define the control block used to manage
- * each extension.
- */
-
-typedef struct {
- Objects_Control Object;
- User_extensions_Control Extension;
-} Extension_Control;
-
-/*
- * _Extension_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Extension_Manager_initialization(
- unsigned32 maximum_extensions
-);
-
-/*
- * rtems_extension_create
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_extension_create directive. The
- * extension will have the name name. The entry points of the
- * routines which constitute this extension set are in EXTENSION_TABLE.
- * It returns the id of the created extension in ID.
- */
-
-rtems_status_code rtems_extension_create(
- rtems_name name,
- rtems_extensions_table *extension_table,
- Objects_Id *id
-);
-
-/*
- * rtems_extension_ident
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_extension_ident directive.
- * This directive returns the extension ID associated with name.
- * If more than one extension is named name, then the extension
- * to which the ID belongs is arbitrary.
- */
-
-rtems_status_code rtems_extension_ident(
- rtems_name name,
- Objects_Id *id
-);
-
-/*
- * rtems_extension_delete
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_extension_delete directive. The
- * extension indicated by ID is deleted.
- */
-
-rtems_status_code rtems_extension_delete(
- Objects_Id id
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/extension.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/sapi/include/rtems/fatal.h b/cpukit/sapi/include/rtems/fatal.h
deleted file mode 100644
index 7f0a7b443a..0000000000
--- a/cpukit/sapi/include/rtems/fatal.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* fatal.h
- *
- * This include file contains constants and prototypes related
- * to the Fatal Error Manager. This manager processes all fatal or
- * irrecoverable errors.
- *
- * This manager provides directives to:
- *
- * + announce a fatal error has occurred
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_FATAL_h
-#define __RTEMS_FATAL_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * rtems_fatal_error_occurred
- *
- * DESCRIPTION:
- *
- * This is the routine which implements the rtems_fatal_error_occurred
- * directive. It is invoked when the application or RTEMS
- * determines that a fatal error has occurred.
- */
-
-void volatile rtems_fatal_error_occurred(
- unsigned32 the_error
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/sapi/include/rtems/init.h b/cpukit/sapi/include/rtems/init.h
deleted file mode 100644
index a4f24d8010..0000000000
--- a/cpukit/sapi/include/rtems/init.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* init.h
- *
- * This include file contains all the constants and structures associated
- * with the Initialization Manager. This manager is responsible for
- * initializing RTEMS, creating and starting all configured initialization
- * tasks, invoking the initialization routine for each user-supplied device
- * driver, and initializing the optional multiprocessor layer.
- *
- * This manager provides directives to:
- *
- * + initialize the RTEMS executive
- * + shutdown the RTEMS executive
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_INIT_h
-#define __RTEMS_INIT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/types.h>
-#include <rtems/config.h>
-#include <rtems/rtems/intr.h>
-
-/*
- * The following defines the default Multiprocessing Configuration
- * Table. This table is used in a single processor system.
- */
-
-extern const rtems_multiprocessing_table
- _Initialization_Default_multiprocessing_table;
-
-/*
- * rtems_initialize_executive
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_initialize_executive directive. This
- * directive is invoked at system startup to initialize the RTEMS
- * multitasking environment.
- */
-
-void rtems_initialize_executive(
- rtems_configuration_table *configuration_table,
- rtems_cpu_table *cpu_table
-);
-
-/*
- * rtems_initialize_executive_early
- *
- * DESCRIPTION:
- *
- * This routine implements the early portion of rtems_initialize_executive
- * directive up to the pretasking hook. This directive is invoked at system
- * startup to initialize the RTEMS multitasking environment.
- */
-
-rtems_interrupt_level rtems_initialize_executive_early(
- rtems_configuration_table *configuration_table,
- rtems_cpu_table *cpu_table
-);
-
-/*
- * rtems_initialize_executive_late
- *
- * DESCRIPTION:
- *
- * This routine implements the early portion of rtems_initialize_executive
- * directive up to the pretasking hook. This directive is invoked at system
- * startup to initialize the RTEMS multitasking environment.
- */
-
-void rtems_initialize_executive_late(
- rtems_interrupt_level bsp_level
-);
-
-/*
- * rtems_shutdown_executive
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_shutdown_executive directive. The
- * invocation of this directive results in the RTEMS environment being
- * shutdown and multitasking halted. From the application's perspective,
- * invocation of this directive results in the rtems_initialize_executive
- * directive exitting to the startup code which invoked it.
- */
-
-void rtems_shutdown_executive(
- unsigned32 result
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/sapi/include/rtems/io.h b/cpukit/sapi/include/rtems/io.h
deleted file mode 100644
index 11b4f812cd..0000000000
--- a/cpukit/sapi/include/rtems/io.h
+++ /dev/null
@@ -1,244 +0,0 @@
-/* io.h
- *
- * This include file contains all the constants and structures associated
- * with the Input/Output Manager. This manager provides a well defined
- * mechanism for accessing device drivers and a structured methodology for
- * organizing device drivers.
- *
- * Directives provided are:
- *
- * + initialize a device driver
- * + open a device driver
- * + close a device driver
- * + read from a device driver
- * + write to a device driver
- * + special device services
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_IO_h
-#define __RTEMS_IO_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/rtems/status.h>
-
-/*
- *
- * The following defines the types for:
- *
- * + major and minor numbers
- * + the return type of a device driver entry
- * + a pointer to a device driver entry
- * + an entry in the the Device Driver Address Table. Each entry in this
- * table corresponds to an application provided device driver and
- * defines the entry points for that device driver.
- */
-
-typedef unsigned32 rtems_device_major_number;
-typedef unsigned32 rtems_device_minor_number;
-
-typedef rtems_status_code rtems_device_driver;
-
-typedef rtems_device_driver ( *rtems_device_driver_entry )(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
- );
-
-typedef struct {
- rtems_device_driver_entry initialization; /* initialization procedure */
- rtems_device_driver_entry open; /* open request procedure */
- rtems_device_driver_entry close; /* close request procedure */
- rtems_device_driver_entry read; /* read request procedure */
- rtems_device_driver_entry write; /* write request procedure */
- rtems_device_driver_entry control; /* special functions procedure */
-} rtems_driver_address_table;
-
-/*
- * Table for the io device names
- */
-
-typedef struct {
- char *device_name;
- unsigned32 device_name_length;
- rtems_device_major_number major;
- rtems_device_minor_number minor;
-} rtems_driver_name_t;
-
-/*
- * This is the table of device names.
- */
-
-/*
- * The following declare the data required to manage the Driver
- * Address Table and Device Name Table.
- */
-
-SAPI_EXTERN unsigned32 _IO_Number_of_drivers;
-SAPI_EXTERN rtems_driver_address_table *_IO_Driver_address_table;
-SAPI_EXTERN unsigned32 _IO_Number_of_devices;
-SAPI_EXTERN rtems_driver_name_t *_IO_Driver_name_table;
-
-/*
- * _IO_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _IO_Manager_initialization(
- rtems_driver_address_table *driver_table,
- unsigned32 number_of_drivers,
- unsigned32 number_of_devices
-);
-
-/*
- * rtems_io_register_name
- *
- * DESCRIPTION:
- *
- * Associate a name with a driver.
- *
- */
-
-rtems_status_code rtems_io_register_name(
- char *device_name,
- rtems_device_major_number major,
- rtems_device_minor_number minor
-);
-
-
-/*
- * rtems_io_lookup_name
- *
- * DESCRIPTION:
- *
- * Find what driver "owns" this name
- */
-
-rtems_status_code rtems_io_lookup_name(
- const char *name,
- rtems_driver_name_t **device_info
-);
-
-
-/*
- * rtems_io_initialize
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_initialize directive. It is invoked
- * to initialize a device driver or an individual device.
- */
-
-rtems_status_code rtems_io_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_open
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_open directive. It is invoked
- * to open a device.
- */
-
-rtems_status_code rtems_io_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_close
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_close directive. It is invoked
- * to close a device.
- */
-
-rtems_status_code rtems_io_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_read
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_read directive. It is invoked
- * to read from a device.
- */
-
-rtems_status_code rtems_io_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_write
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_write directive. It is invoked
- * to write to a device.
- */
-
-rtems_status_code rtems_io_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * rtems_io_control
- *
- * DESCRIPTION:
- *
- * This routine implements the rtems_io_control directive. It is invoked
- * to perform a device specific operation on a device.
- */
-
-rtems_status_code rtems_io_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-);
-
-/*
- * _IO_Initialize_all_drivers
- *
- * DESCRIPTION:
- *
- * This routine initializes all of the device drivers configured
- * in the Device Driver Address Table.
- */
-
-void _IO_Initialize_all_drivers( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/sapi/include/rtems/mptables.h b/cpukit/sapi/include/rtems/mptables.h
deleted file mode 100644
index 8fdbdfebd2..0000000000
--- a/cpukit/sapi/include/rtems/mptables.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mptables.h
- *
- * This include file contains the executive's pre-initialized tables
- * used in a multiprocessor configuration.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_MPTABLES_h
-#define __RTEMS_MPTABLES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/sapi/inline/rtems/extension.inl b/cpukit/sapi/inline/rtems/extension.inl
deleted file mode 100644
index 49cd834832..0000000000
--- a/cpukit/sapi/inline/rtems/extension.inl
+++ /dev/null
@@ -1,91 +0,0 @@
-/* extension.inl
- *
- * This file contains the static inline implementation of the inlined routines
- * from the Extension Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __EXTENSION_MANAGER_inl
-#define __EXTENSION_MANAGER_inl
-
-/*PAGE
- *
- * _Extension_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a extension control block from
- * the inactive chain of free extension control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Allocate( void )
-{
- return (Extension_Control *) _Objects_Allocate( &_Extension_Information );
-}
-
-/*PAGE
- *
- * _Extension_Free
- *
- * DESCRIPTION:
- *
- * This routine frees a extension control block to the
- * inactive chain of free extension control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Extension_Free (
- Extension_Control *the_extension
-)
-{
- _Objects_Free( &_Extension_Information, &the_extension->Object );
-}
-
-/*PAGE
- *
- * _Extension_Get
- *
- * DESCRIPTION:
- *
- * This function maps extension IDs to extension control blocks.
- * If ID corresponds to a local extension, then it returns
- * the extension control pointer which maps to ID and location
- * is set to OBJECTS_LOCAL. Otherwise, location is set
- * to OBJECTS_ERROR and the returned value is undefined.
- */
-
-RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- return (Extension_Control *)
- _Objects_Get( &_Extension_Information, id, location );
-}
-
-/*PAGE
- *
- * _Extension_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_extension is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Extension_Is_null (
- Extension_Control *the_extension
-)
-{
- return ( the_extension == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/sapi/macros/rtems/extension.inl b/cpukit/sapi/macros/rtems/extension.inl
deleted file mode 100644
index 225f6b188d..0000000000
--- a/cpukit/sapi/macros/rtems/extension.inl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* extension.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the Extension Manager.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __EXTENSION_inl
-#define __EXTENSION_inl
-
-/*PAGE
- *
- * _Extension_Allocate
- *
- */
-
-#define _Extension_Allocate() \
- (Extension_Control *) _Objects_Allocate( &_Extension_Information )
-
-/*PAGE
- *
- * _Extension_Free
- *
- */
-
-#define _Extension_Free( _the_extension ) \
- _Objects_Free( &_Extension_Information, &(_the_extension)->Object )
-
-/*PAGE
- *
- * _Extension_Get
- *
- */
-
-#define _Extension_Get( _id, _location ) \
- (Extension_Control *) \
- _Objects_Get( &_Extension_Information, (_id), (_location) )
-
-/*PAGE
- *
- * _Extension_Is_null
- *
- */
-
-#define _Extension_Is_null( _the_extension ) \
- ( (_the_extension) == NULL )
-
-#endif
-/* end of include file */
diff --git a/cpukit/sapi/src/debug.c b/cpukit/sapi/src/debug.c
deleted file mode 100644
index e44e837dc9..0000000000
--- a/cpukit/sapi/src/debug.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Debug Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/debug.h>
-
-/*PAGE
- *
- * _Debug_Manager_initialization
- */
-
-void _Debug_Manager_initialization( void )
-{
- rtems_debug_disable( RTEMS_DEBUG_ALL_MASK );
-}
-
-/*PAGE
- *
- * rtems_debug_enable
- */
-
-void rtems_debug_enable (
- rtems_debug_control to_be_enabled
-)
-{
- _Debug_Level |= to_be_enabled;
-}
-
-/*PAGE
- *
- * rtems_debug_disable
- */
-
-void rtems_debug_disable (
- rtems_debug_control to_be_disabled
-)
-{
- _Debug_Level &= ~to_be_disabled;
-}
-
-/*PAGE
- *
- * _Debug_Is_enabled
- */
-
-boolean _Debug_Is_enabled(
- rtems_debug_control level
-)
-{
- return (_Debug_Level & level);
-}
diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c
deleted file mode 100644
index dabf21dcc0..0000000000
--- a/cpukit/sapi/src/exinit.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Initialization Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * SCORE_INIT and SAPI_INIT are defined so all of the super core and
- * super API data will be included in this object file.
- */
-
-#define SAPI_INIT
-#define SCORE_INIT
-
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/debug.h>
-#include <rtems/extension.h>
-#include <rtems/fatal.h>
-#include <rtems/init.h>
-#include <rtems/io.h>
-#include <rtems/score/sysstate.h>
-
-#include <rtems/score/apiext.h>
-#include <rtems/score/copyrt.h>
-#include <rtems/score/heap.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/userext.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/score/wkspace.h>
-
-#include <rtems/directives.h>
-#include <rtems/sptables.h>
-
-
-#include <rtems/rtems/rtemsapi.h>
-#ifdef RTEMS_POSIX_API
-#include <rtems/posix/posixapi.h>
-#endif
-
-/*PAGE
- *
- * rtems_initialize_executive
- *
- * This directive initializes all the kernels data structures
- * to the states necessary for the kernel to begin execution. All
- * include files that contain global variable definitions should be
- * included in this file. The system threads and initialization threads
- * are created and started by this routine. This routine then
- * initiates multithreading.
- *
- * Input parameters:
- * configuration_table - pointer to the user's configuration table
- * cpu_table - pointer to the user's CPU configuration table
- *
- * Output parameters: NONE
- */
-
-void rtems_initialize_executive(
- rtems_configuration_table *configuration_table,
- rtems_cpu_table *cpu_table
-)
-{
- rtems_interrupt_level bsp_level;
-
- bsp_level = rtems_initialize_executive_early(configuration_table, cpu_table);
- rtems_initialize_executive_late( bsp_level );
-}
-
-rtems_interrupt_level rtems_initialize_executive_early(
- rtems_configuration_table *configuration_table,
- rtems_cpu_table *cpu_table
-)
-{
- rtems_interrupt_level bsp_level;
- rtems_multiprocessing_table *multiprocessing_table;
-
- /*
- * Dispatching and interrupts are disabled until the end of the
- * initialization sequence. This prevents an inadvertent context
- * switch before the executive is initialized.
- */
-
- _ISR_Disable( bsp_level );
-
- if ( configuration_table == NULL )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_NO_CONFIGURATION_TABLE
- );
-
- /*
- * Initialize the system state based on whether this is an MP system.
- */
-
- multiprocessing_table = configuration_table->User_multiprocessing_table;
-
- _System_state_Handler_initialization(
- (multiprocessing_table) ? TRUE : FALSE
- );
-
- /*
- * Provided just for user convenience.
- */
-
- _Configuration_Table = configuration_table;
- _Configuration_MP_table = multiprocessing_table;
-
- /*
- * Internally we view single processor systems as a very restricted
- * multiprocessor system.
- */
-
- if ( multiprocessing_table == NULL )
- multiprocessing_table =
- (void *)&_Initialization_Default_multiprocessing_table;
-
- if ( cpu_table == NULL )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_NO_CPU_TABLE
- );
-
- _CPU_Initialize( cpu_table, _Thread_Dispatch );
-
- /*
- * Do this as early as possible to insure no debugging output
- * is even attempted to be printed.
- */
-
- _Debug_Manager_initialization();
-
- _API_extensions_Initialization();
-
- _Thread_Dispatch_initialization();
-
- _Workspace_Handler_initialization(
- (void *)configuration_table->work_space_start,
- configuration_table->work_space_size
- );
-
- _User_extensions_Handler_initialization(
- configuration_table->number_of_initial_extensions,
- configuration_table->User_extension_table
- );
-
- _ISR_Handler_initialization();
-
- _Objects_Handler_initialization(
- multiprocessing_table->node,
- multiprocessing_table->maximum_nodes,
- multiprocessing_table->maximum_global_objects
- );
-
- _Priority_Handler_initialization();
-
- _Watchdog_Handler_initialization();
-
- _TOD_Handler_initialization( configuration_table->microseconds_per_tick );
-
- _Thread_Handler_initialization(
- configuration_table->ticks_per_timeslice,
- configuration_table->maximum_extensions,
- multiprocessing_table->maximum_proxies
- );
-
- _MPCI_Handler_initialization(
- multiprocessing_table->User_mpci_table,
- RTEMS_TIMEOUT
- );
-
-/* MANAGERS */
-
- _Extension_Manager_initialization( configuration_table->maximum_extensions );
-
- _IO_Manager_initialization(
- configuration_table->Device_driver_table,
- configuration_table->number_of_device_drivers,
- configuration_table->maximum_devices
- );
-
- _RTEMS_API_Initialize( configuration_table );
-
-#ifdef RTEMS_POSIX_API
- _POSIX_API_Initialize( configuration_table );
-#endif
-
- _System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING );
-
- if ( cpu_table->pretasking_hook )
- (*cpu_table->pretasking_hook)();
-
- /*
- * No threads should be created before this point!!!
- *
- * At this point all API extensions are in place. After the call to
- * _Thread_Create_idle() _Thread_Executing will be set.
- * and _Thread_Heir are not set yet.
- */
-
- _Thread_Create_idle();
-
- _MPCI_Create_server();
-
- /*
- * Run the API and BSPs predriver hook.
- */
-
- _API_extensions_Run_predriver();
-
- if ( _CPU_Table.predriver_hook )
- (*_CPU_Table.predriver_hook)();
-
- /*
- * Initialize all the device drivers and initialize the MPCI layer.
- *
- * NOTE: The MPCI may be build upon a device driver.
- */
-
- _IO_Initialize_all_drivers();
-
- if ( _System_state_Is_multiprocessing ) {
- _MPCI_Initialization();
- _MPCI_Internal_packets_Send_process_packet(
- MPCI_PACKETS_SYSTEM_VERIFY
- );
- }
-
- /*
- * Run the APIs and BSPs postdriver hooks.
- *
- * The API extensions are supposed to create user initialization tasks.
- */
-
- _API_extensions_Run_postdriver();
-
- if ( _CPU_Table.postdriver_hook )
- (*_CPU_Table.postdriver_hook)();
-
- return bsp_level;
-}
-
-void rtems_initialize_executive_late(
- rtems_interrupt_level bsp_level
-)
-{
-
- _System_state_Set( SYSTEM_STATE_BEGIN_MULTITASKING );
-
- _Thread_Start_multitasking();
-
- /*
- * Restore the interrupt level to what the BSP had. Technically,
- * this is unnecessary since the BSP should have all interrupts
- * disabled when rtems_initialize_executive is invoked. But this keeps
- * the ISR Disable/Enable calls paired.
- */
-
- _ISR_Enable( bsp_level );
-}
-
-/*PAGE
- *
- * rtems_shutdown_executive
- *
- * This kernel routine shutdowns the executive. It halts multitasking
- * and returns control to the application execution "thread" which
- * initialially invoked the rtems_initialize_executive directive.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void rtems_shutdown_executive(
- unsigned32 result
-)
-{
- if ( _System_state_Current != SYSTEM_STATE_SHUTDOWN ) {
- _System_state_Set( SYSTEM_STATE_SHUTDOWN );
- _Thread_Stop_multitasking();
- }
-}
diff --git a/cpukit/sapi/src/extension.c b/cpukit/sapi/src/extension.c
deleted file mode 100644
index 09d9e09d33..0000000000
--- a/cpukit/sapi/src/extension.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Extension Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/extension.h>
-
-/*PAGE
- *
- * _Extension_Manager_initialization
- *
- * This routine initializes all extension manager related data structures.
- *
- * Input parameters:
- * maximum_extensions - number of extensions to initialize
- *
- * Output parameters: NONE
- */
-
-void _Extension_Manager_initialization(
- unsigned32 maximum_extensions
-)
-{
- _Objects_Initialize_information(
- &_Extension_Information,
- OBJECTS_RTEMS_EXTENSIONS,
- FALSE,
- maximum_extensions,
- sizeof( Extension_Control ),
- FALSE,
- RTEMS_MAXIMUM_NAME_LENGTH,
- FALSE
- );
-}
-
-/*PAGE
- *
- * rtems_extension_create
- *
- * This directive creates a extension and performs some initialization.
- *
- * Input parameters:
- * name - extension name
- * extension_table - pointer to extension set information
- * id - pointer to extension id
- *
- * Output parameters:
- * id - extension id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_extension_create(
- rtems_name name,
- rtems_extensions_table *extension_table,
- Objects_Id *id
-)
-{
- Extension_Control *the_extension;
-
- if ( !rtems_is_name_valid( name ) )
- return RTEMS_INVALID_NAME;
-
- _Thread_Disable_dispatch(); /* to prevent deletion */
-
- the_extension = _Extension_Allocate();
-
- if ( !the_extension ) {
- _Thread_Enable_dispatch();
- return RTEMS_TOO_MANY;
- }
-
- _User_extensions_Add_set( &the_extension->Extension, extension_table );
-
- _Objects_Open( &_Extension_Information, &the_extension->Object, &name );
-
- *id = the_extension->Object.id;
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_extension_ident
- *
- * This directive returns the system ID associated with
- * the extension name.
- *
- * Input parameters:
- * name - user defined message queue name
- * id - pointer to extension id
- *
- * Output parameters:
- * *id - message queue id
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_extension_ident(
- rtems_name name,
- Objects_Id *id
-)
-{
- Objects_Name_to_id_errors status;
-
- status = _Objects_Name_to_id(
- &_Extension_Information,
- &name,
- OBJECTS_SEARCH_LOCAL_NODE,
- id
- );
-
- return _Status_Object_name_errors_to_status[ status ];
-}
-
-/*PAGE
- *
- * rtems_extension_delete
- *
- * This directive allows a thread to delete a extension.
- *
- * Input parameters:
- * id - extension id
- *
- * Output parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_extension_delete(
- Objects_Id id
-)
-{
- Extension_Control *the_extension;
- Objects_Locations location;
-
- the_extension = _Extension_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* should never return this */
- return RTEMS_INVALID_ID;
- case OBJECTS_LOCAL:
- _User_extensions_Remove_set( &the_extension->Extension );
- _Objects_Close( &_Extension_Information, &the_extension->Object );
- _Extension_Free( the_extension );
- _Thread_Enable_dispatch();
- return RTEMS_SUCCESSFUL;
- }
-
- return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
-}
diff --git a/cpukit/sapi/src/fatal.c b/cpukit/sapi/src/fatal.c
deleted file mode 100644
index d0fc3ff5c7..0000000000
--- a/cpukit/sapi/src/fatal.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Fatal Error Manager
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/fatal.h>
-#include <rtems/score/interr.h>
-
-/*PAGE
- *
- * rtems_fatal_error_occurred
- *
- * This directive will invoke the internal fatal error handler.
- *
- * Input parameters:
- * the_error - fatal error status code
- *
- * Output parameters: NONE
- */
-
-void volatile rtems_fatal_error_occurred(
- unsigned32 the_error
-)
-{
- _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, FALSE, the_error );
-
-/* will not return from this routine */
-}
diff --git a/cpukit/sapi/src/io.c b/cpukit/sapi/src/io.c
deleted file mode 100644
index 92de490885..0000000000
--- a/cpukit/sapi/src/io.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Input/Output Manager
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/io.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-
-#include <string.h>
-
-/*PAGE
- *
- * _IO_Manager_initialization
- *
- */
-
-void _IO_Manager_initialization(
- rtems_driver_address_table *driver_table,
- unsigned32 number_of_drivers,
- unsigned32 number_of_devices
-)
-{
- void *tmp;
- unsigned32 index;
- rtems_driver_name_t *np;
-
- _IO_Driver_address_table = driver_table;
- _IO_Number_of_drivers = number_of_drivers;
- _IO_Number_of_devices = number_of_devices;
-
- tmp = _Workspace_Allocate_or_fatal_error(
- sizeof( rtems_driver_name_t ) * ( number_of_devices + 1 )
- );
-
- _IO_Driver_name_table = (rtems_driver_name_t *) tmp;
-
- for( index=0, np = _IO_Driver_name_table ;
- index < _IO_Number_of_devices ;
- index++, np++ ) {
- np->device_name = 0;
- np->device_name_length = 0;
- np->major = 0;
- np->minor = 0;
- }
-}
-
-/*PAGE
- *
- * _IO_Initialize_all_drivers
- *
- * This routine initializes all device drivers
- *
- * Input Paramters: NONE
- *
- * Output Parameters: NONE
- */
-
-void _IO_Initialize_all_drivers( void )
-{
- rtems_device_major_number major;
-
- for ( major=0 ; major < _IO_Number_of_drivers ; major ++ )
- (void) rtems_io_initialize( major, 0, NULL);
-}
-
-/*PAGE
- *
- * rtems_io_register_name
- *
- * Associate a name with a driver
- *
- * Input Paramters:
- * device_name - pointer to name string to associate with device
- * major - device major number to receive name
- * minor - device minor number to receive name
- *
- * Output Parameters:
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_io_register_name(
- char *device_name,
- rtems_device_major_number major,
- rtems_device_minor_number minor
- )
-{
- rtems_driver_name_t *np;
- unsigned32 level;
- unsigned32 index;
-
- /* find an empty slot */
- for( index=0, np = _IO_Driver_name_table ;
- index < _IO_Number_of_devices ;
- index++, np++ )
- {
-
- _ISR_Disable(level);
- if (np->device_name == 0)
- {
- np->device_name = device_name;
- np->device_name_length = strlen(device_name);
- np->major = major;
- np->minor = minor;
- _ISR_Enable(level);
-
- return RTEMS_SUCCESSFUL;
- }
- _ISR_Enable(level);
- }
-
- return RTEMS_TOO_MANY;
-}
-
-/*PAGE
- *
- * rtems_io_lookup_name
- *
- * Find what driver "owns" this name
- *
- * Input Paramters:
- * name - name to lookup the associated device
- *
- * Output Parameters:
- * device_info - device associate with name
- * RTEMS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-rtems_status_code rtems_io_lookup_name(
- const char *name,
- rtems_driver_name_t **device_info
-)
-{
- rtems_driver_name_t *np;
- unsigned32 index;
-
- for( index=0, np = _IO_Driver_name_table ;
- index < _IO_Number_of_devices ;
- index++, np++ )
- if (np->device_name)
- if (strncmp(np->device_name, name, np->device_name_length) == 0)
- {
- *device_info = np;
- return RTEMS_SUCCESSFUL;
- }
-
- *device_info = 0;
- return RTEMS_UNSATISFIED;
-}
-
-
-/*PAGE
- *
- * rtems_io_initialize
- *
- * This routine is the initialization directive of the IO manager.
- *
- * Input Paramters:
- * major - device driver number
- * minor - device number
- * argument - pointer to argument(s)
- *
- * Output Parameters:
- * returns - return code
- */
-
-rtems_status_code rtems_io_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- rtems_device_driver_entry callout;
-
- if ( major >= _IO_Number_of_drivers )
- return RTEMS_INVALID_NUMBER;
-
- callout = _IO_Driver_address_table[major].initialization;
- return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_io_open
- *
- * This routine is the open directive of the IO manager.
- *
- * Input Paramters:
- * major - device driver number
- * minor - device number
- * argument - pointer to argument(s)
- *
- * Output Parameters:
- * returns - return code
- */
-
-rtems_status_code rtems_io_open(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- rtems_device_driver_entry callout;
-
- if ( major >= _IO_Number_of_drivers )
- return RTEMS_INVALID_NUMBER;
-
- callout = _IO_Driver_address_table[major].open;
- return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_io_close
- *
- * This routine is the close directive of the IO manager.
- *
- * Input Paramters:
- * major - device driver number
- * minor - device number
- * argument - pointer to argument(s)
- *
- * Output Parameters:
- * returns - return code
- */
-
-rtems_status_code rtems_io_close(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- rtems_device_driver_entry callout;
-
- if ( major >= _IO_Number_of_drivers )
- return RTEMS_INVALID_NUMBER;
-
- callout = _IO_Driver_address_table[major].close;
- return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_io_read
- *
- * This routine is the read directive of the IO manager.
- *
- * Input Paramters:
- * major - device driver number
- * minor - device number
- * argument - pointer to argument(s)
- *
- * Output Parameters:
- * returns - return code
- */
-
-rtems_status_code rtems_io_read(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- rtems_device_driver_entry callout;
-
- if ( major >= _IO_Number_of_drivers )
- return RTEMS_INVALID_NUMBER;
-
- callout = _IO_Driver_address_table[major].read;
- return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_io_write
- *
- * This routine is the write directive of the IO manager.
- *
- * Input Paramters:
- * major - device driver number
- * minor - device number
- * argument - pointer to argument(s)
- *
- * Output Parameters:
- * returns - return code
- */
-
-rtems_status_code rtems_io_write(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- rtems_device_driver_entry callout;
-
- if ( major >= _IO_Number_of_drivers )
- return RTEMS_INVALID_NUMBER;
-
- callout = _IO_Driver_address_table[major].write;
- return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * rtems_io_control
- *
- * This routine is the control directive of the IO manager.
- *
- * Input Paramters:
- * major - device driver number
- * minor - device number
- * argument - pointer to argument(s)
- *
- * Output Parameters:
- * returns - return code
- */
-
-rtems_status_code rtems_io_control(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *argument
-)
-{
- rtems_device_driver_entry callout;
-
- if ( major >= _IO_Number_of_drivers )
- return RTEMS_INVALID_NUMBER;
-
- callout = _IO_Driver_address_table[major].control;
- return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
-}
-
diff --git a/cpukit/sapi/src/posixapi.c b/cpukit/sapi/src/posixapi.c
deleted file mode 100644
index cc41c30d20..0000000000
--- a/cpukit/sapi/src/posixapi.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * RTEMS API Initialization Support
- *
- * NOTE:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <assert.h>
-
-/*
- * POSIX_API_INIT is defined so all of the POSIX API
- * data will be included in this object file.
- */
-
-#define POSIX_API_INIT
-
-#include <rtems/system.h> /* include this before checking RTEMS_POSIX_API */
-#ifdef RTEMS_POSIX_API
-
-#include <sys/types.h>
-#include <rtems/config.h>
-#include <rtems/score/object.h>
-#include <rtems/posix/cond.h>
-#include <rtems/posix/config.h>
-#include <rtems/posix/key.h>
-#include <rtems/posix/mutex.h>
-#include <rtems/posix/priority.h>
-#include <rtems/posix/psignal.h>
-#include <rtems/posix/pthread.h>
-#include <rtems/posix/time.h>
-
-/*PAGE
- *
- * _POSIX_API_Initialize
- *
- * XXX
- */
-
-posix_api_configuration_table _POSIX_Default_configuration = {
- 0, /* maximum_threads */
- 0, /* maximum_mutexes */
- 0, /* maximum_condition_variables */
- 0, /* maximum_keys */
- 0, /* maximum_queued_signals */
- 0, /* number_of_initialization_threads */
- NULL /* User_initialization_threads_table */
-};
-
-
-void _POSIX_API_Initialize(
- rtems_configuration_table *configuration_table
-)
-{
- posix_api_configuration_table *api_configuration;
-
- /* XXX need to assert here based on size assumptions */
-
- assert( sizeof(pthread_t) == sizeof(Objects_Id) );
-
- api_configuration = configuration_table->POSIX_api_configuration;
- if ( !api_configuration )
- api_configuration = &_POSIX_Default_configuration;
-
- _POSIX_signals_Manager_Initialization(
- api_configuration->maximum_queued_signals
- );
-
- _POSIX_Threads_Manager_initialization(
- api_configuration->maximum_threads,
- api_configuration->number_of_initialization_threads,
- api_configuration->User_initialization_threads_table
- );
-
- _POSIX_Condition_variables_Manager_initialization(
- api_configuration->maximum_condition_variables
- );
-
- _POSIX_Key_Manager_initialization( api_configuration->maximum_keys );
-
- _POSIX_Mutex_Manager_initialization(
- api_configuration->maximum_mutexes
- );
-
-}
-
-#endif
-/* end of file */
diff --git a/cpukit/sapi/src/rtemsapi.c b/cpukit/sapi/src/rtemsapi.c
deleted file mode 100644
index d860ad7f99..0000000000
--- a/cpukit/sapi/src/rtemsapi.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * POSIX API Initialization Support
- *
- * NOTE:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * RTEMS_API_INIT is defined so all of the RTEMS API
- * data will be included in this object file.
- */
-
-#define RTEMS_API_INIT
-
-#include <rtems/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/rtemsapi.h>
-
-#include <rtems/rtems/intr.h>
-#include <rtems/rtems/clock.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/rtems/dpmem.h>
-#include <rtems/rtems/event.h>
-#include <rtems/rtems/message.h>
-#include <rtems/rtems/mp.h>
-#include <rtems/rtems/part.h>
-#include <rtems/rtems/ratemon.h>
-#include <rtems/rtems/region.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/rtems/signal.h>
-#include <rtems/rtems/timer.h>
-
-/*PAGE
- *
- * _RTEMS_API_Initialize
- *
- * XXX
- */
-
-void _RTEMS_API_Initialize(
- rtems_configuration_table *configuration_table
-)
-{
- rtems_api_configuration_table *api_configuration;
-
- api_configuration = configuration_table->RTEMS_api_configuration;
-
- _Attributes_Handler_initialization();
-
- _Interrupt_Manager_initialization();
-
- _Multiprocessing_Manager_initialization();
-
- _RTEMS_tasks_Manager_initialization(
- api_configuration->maximum_tasks,
- api_configuration->number_of_initialization_tasks,
- api_configuration->User_initialization_tasks_table
- );
-
- _Timer_Manager_initialization( api_configuration->maximum_timers );
-
- _Signal_Manager_initialization();
-
- _Event_Manager_initialization();
-
- _Message_queue_Manager_initialization(
- api_configuration->maximum_message_queues
- );
-
- _Semaphore_Manager_initialization( api_configuration->maximum_semaphores );
-
- _Partition_Manager_initialization( api_configuration->maximum_partitions );
-
- _Region_Manager_initialization( api_configuration->maximum_regions );
-
- _Dual_ported_memory_Manager_initialization( api_configuration->maximum_ports);
-
- _Rate_monotonic_Manager_initialization( api_configuration->maximum_periods );
-}
-
-/* end of file */
diff --git a/cpukit/score/cpu/a29k/amd.ah b/cpukit/score/cpu/a29k/amd.ah
deleted file mode 100644
index 006e7e15e7..0000000000
--- a/cpukit/score/cpu/a29k/amd.ah
+++ /dev/null
@@ -1,531 +0,0 @@
-; /* @(#)amd.ah 1.1 96/05/23 08:56:58, TEI */
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Initialization values for registers after RESET
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;
-: /* $Id$ */
-;* File information and includes.
-
- .file "amd.ah"
- .ident "@(#)amd.ah 1.1 96/05/23 08:56:58, TEI"
-
-
-
-;
-;* AMD PROCESSOR SPECIFIC VALUES...
-;
-
-;
-;* Processor revision levels...
-;
-
-; PRL values: 31-28 27-24
-; Am29000 0 x
-; Am29005 1 x
-; Am29050 2 x
-; Am29035 3 x
-; Am29030 4 x
-; Am29200 5 x
-; Am29205 5 1x
-; Am29240 6 0
-; Manx 7 0
-; Cougar 8 0
-
-
- .equ AM29000_PRL, 0x00
-
- .equ AM29005_PRL, 0x10
-
- .equ AM29050_PRL, 0x20
-
- .equ AM29035_PRL, 0x30
-
- .equ AM29030_PRL, 0x40
-
- .equ AM29200_PRL, 0x50
-
- .equ AM29205_PRL, 0x58
-
- .equ AM29240_PRL, 0x60
-
- .equ AM29040_PRL, 0x70
-
- .equ MANX_PRL, 0x70
-
- .equ COUGAR_PRL, 0x80
-
-;
-;* data structures sizes.
-;
- .equ CFGINFO_SIZE, 16*4
-
- .equ PGMINFO_SIZE, 16*4
-
- .equ VARARGS_SPACE, 16*4
-
- .equ WINDOWSIZE, 0x80
-;
-;* Am29027 Mode registers
-;
-
- .equ Am29027Mode1, 0x0fc00820
-
- .equ Am29027Mode2, 0x00001375
-
-
-
-;* Processor Based Equates and Defines
-
- .equ SIG_SYNC, -1
-
- .equ ENABLE, (SM)
-
- .equ DISABLE, (ENABLE | DI | DA)
-
- .equ DISABLE_FZ, (FZ | ENABLE | DI | DA)
-
- .equ CLR_TRAP, (FZ | DA)
-
- .equ InitOPS, (TD | SM | (3<<IMShift) | DI | DA)
-
- .equ InitCPS, (TD | SM | (0<<IMShift) | DI | DA)
-
- .equ InitCPS1, (TD | SM | (0<<IMShift) | DI )
-
- .equ CPS_TMR, (SM | (0<<IMShift) | DI)
-
- .equ CPS_INT0, (TD | SM | (0<<IMShift))
-
- .equ CPS_TMRINT0, (SM | (0<<IMShift))
-
- .equ InitCFG, 0x0
-
- .equ InitRBP, (B0|B1|B2|B3|B4|B5)
-
- .equ TMC_VALUE, 0xFFFFFF
-
- .equ TMR_VALUE, (IE | TMC_VALUE)
-
-
-
-
-
-
-;* 29205 specific (internal) peripheral initialization constants.
-
-; Current Processor Status (CPS) Register.
-; Old Processor Status Register (OPS).
-
- .equ DA, 0x00001
- .equ DI, 0x00002
- .equ IMShift,0x2
- .equ SM, 0x00010
- .equ PI, 0x00020
- .equ PD, 0x00040
- .equ WM, 0x00080
- .equ RE, 0x00100
- .equ LK, 0x00200
- .equ FZ, 0x00400
- .equ TU, 0x00800
- .equ TP, 0x01000
- .equ TE, 0x02000
- .equ IP, 0x04000
- .equ CA, 0x08000
- .equ MM, 0x10000
- .equ TD, 0x20000
-
-; Configuration Register (CFG)
-
- .equ CD, 0x01
- .equ CP, 0x02
- .equ BO, 0x04
- .equ RV, 0x08
- .equ VF, 0x10
- .equ DW, 0x20
- .equ CO, 0x40
- .equ EE, 0x80
- .equ IDShift, 8
- .equ CFG_ID, 0x100
- .equ ILShift, 9
- .equ CFG_ILMask, 0x600
- .equ DDShift, 11
- .equ CFG_DD, 0x800
- .equ DLShift, 12
- .equ CFG_DLMask, 0x3000
- .equ PCEShift, 14
- .equ CFG_PCE, 0x4000
- .equ PMBShift, 16
- .equ D16, 0x8000
- .equ TBOShift, 23
- .equ PRLShift, 24
-
-; Channel Control Register (CHC)
-
- .equ CV, 0x1
- .equ NN, 0x2
- .equ TRShift, 2
- .equ TF, 0x400
- .equ PER, 0x800
- .equ LA, 0x1000
- .equ ST, 0x2000
- .equ ML, 0x4000
- .equ LS, 0x8000
- .equ CRShift, 16
- .equ CNTLShift, 24
- .equ CEShift, 31
- .equ WBERShift, 31
-
-; Register Bank Protect (RBP)
- .equ B0, 0x1
- .equ B1, 0x2
- .equ B2, 0x4
- .equ B3, 0x8
- .equ B4, 0x10
- .equ B5, 0x20
- .equ B6, 0x40
- .equ B7, 0x80
- .equ B8, 0x100
- .equ B9, 0x200
- .equ B10, 0x400
- .equ B11, 0x800
- .equ B12, 0x1000
- .equ B13, 0x2000
- .equ B14, 0x4000
- .equ B15, 0x8000
-
-; Timer Counter
-
- .equ TCVMask, 0xffffff
-
-; Timer Reload Register
-
- .equ IE, 0x1000000
- .equ IN, 0x2000000
- .equ OV, 0x4000000
- .equ TRVMAsk, 0xffffff
-
-; MMU Configuration
-
- .equ PSShift, 8
- .equ PS0Shift, 8
- .equ PS1Shift, 12
-
-; LRU Recommendation (LRU)
- .equ LRUMask, 0xff
-
-; Reason Vector (RSN)
- .equ RSNMask, 0xff
-
-; Region Mapping Address (RMA0 | RMA1)
- .equ PBAMask,0xffff
- .equ VBAShift, 16
-
-; Region Mapping Control (RMC0 | RMC1)
- .equ TIDMask, 0xff
- .equ RMC_UE, 0x100
- .equ RMC_UW, 0x200
- .equ RMC_UR, 0x400
- .equ RMC_SE, 0x800
- .equ RMC_SW, 0x1000
- .equ RMC_SR, 0x2000
- .equ RMC_VE, 0x4000
- .equ RMC_IO, 0x10000
- .equ RGSShift, 17
- .equ RMC_PGMShift, 22
-
-; Instruction breakpoint Control (IBC0 | IBC1)
- .equ BPIDMask, 0xff
- .equ BTE, 0x100
- .equ BRM, 0x200
- .equ IBC_BSY, 0x400
- .equ BEN, 0x800
- .equ BHO, 0x1000
-
-; Cache Data Register (CDR)
- .equ CDR_US, 0x1
- .equ P, 0x2
- .equ CDR_V, 0x4
- .equ IATAGShift, 20
-
-; Cache Interface Register (CIR)
- .equ CPTRShift, 2
- .equ CIR_RW, 0x1000000
- .equ FSELShift, 28
-
-; Indirect Pointer A, B, C (IPA, IPB, IPC)
- .equ IPShift, 2
-
-; ALU Status (ALU)
- .equ FCMask, 0x1F
- .equ BPShift, 5
- .equ C, 0x80
- .equ Z, 0x100
- .equ N, 0x200
- .equ ALU_V, 0x400
- .equ DF, 0x800
-
-; Byte Pointer
- .equ BPMask, 0x3
-
-; Load/Store Count Remaining (CR)
- .equ CRMask, 0xff
-
-; Floating Point Environment (FPE)
- .equ NM, 0x1
- .equ RM, 0x2
- .equ VM, 0x4
- .equ UM, 0x8
- .equ XM, 0x10
- .equ DM, 0x20
- .equ FRMShift, 6
- .equ FF, 0x100
- .equ ACFShift, 9
-
-; Integer Environment (INTE)
- .equ MO, 0x1
- .equ DO, 0x2
-
-; Floating Point Status (FPS)
- .equ NS, 0x1
- .equ RS, 0x2
- .equ VS, 0x4
- .equ FPS_US, 0x8
- .equ XS, 0x10
- .equ DS, 0x20
- .equ NT, 0x100
- .equ RT, 0x200
- .equ VT, 0x400
- .equ UT, 0x800
- .equ XT, 0x1000
- .equ DT, 0x2000
-
-; Exception Opcode (EXOP)
- .equ IOPMask, 0xff
-
-; TLB Entry Word 0
-; .equ TIDMask, 0xff already defined above
- .equ TLB_UE, 0x100
- .equ TLB_UW, 0x200
- .equ TLB_UR, 0x400
- .equ TLB_SE, 0x800
- .equ TLB_SW, 0x1000
- .equ TLB_SR, 0x2000
- .equ TLB_VE, 0x4000
- .equ VTAGShift, 15
-
-; TLB Entry Word 1
- .equ TLB_IO, 0x1
- .equ U, 0x2
- .equ TLB_PGMShift, 6
- .equ RPNShift, 10
-
-; Am29200 ROM Control bits.
- .equ RMCT_DW0Shift, 29
- .equ RMCT_DW1Shift, 21
- .equ RMCT_DW2Shift, 13
- .equ RMCT_DW3Shift, 5
-
-; Am29200 DRAM Control bits.
- .equ DW3, (1<<18)
- .equ DW2, (1<<22)
- .equ DW1, (1<<26)
- .equ DW0, (1<<30)
-
- ; Internal peripheral address assignments.
- .equ RMCT, 0x80000000
- .equ RMCF, 0x80000004
- .equ DRCT, 0x80000008
- .equ DRCF, 0x8000000C
- .equ DRM0, 0x80000010
- .equ DRM1, 0x80000014
- .equ DRM2, 0x80000018
- .equ DRM3, 0x8000001C
- .equ PIACT0, 0x80000020
- .equ PIACT1, 0x80000020
- .equ ICT, 0x80000028
- .equ DMCT0, 0x80000030
- .equ DMAD0, 0x80000034
- .ifdef revA
- .equ TAD0, 0x80000036
- .equ TCN0, 0x8000003A
- .else
- .equ TAD0, 0x80000070 ; default
- .equ TCN0, 0x8000003C ; default
- .endif
- .equ DMCN0, 0x80000038
- .equ DMCT1, 0x80000040
- .equ DMAD1, 0x80000044
- .equ DMCN1, 0x80000048
- .equ SPCT, 0x80000080
- .equ SPST, 0x80000084
- .equ SPTH, 0x80000088
- .equ SPRB, 0x8000008C
- .equ BAUD, 0x80000090
- .equ PPCT, 0x800000C0
- .equ PPST, 0x800000C1
- .equ PPDT, 0x800000C4
- .equ POCT, 0x800000D0
- .equ PIN, 0x800000D4
- .equ POUT, 0x800000D8
- .equ POEN, 0x800000DC
- .equ VCT, 0x800000E0
- .equ TOP, 0x800000E4
- .equ SIDE, 0x800000E8
- .equ VDT, 0x800000EC
-
- ; Interrupt Controller Register bits.
- .equ TXDI, (1<<5)
- .equ RXDI, (1<<6)
- .equ RXSI, (1<<7)
- .equ PPI, (1<<11)
- .equ DMA1I, (1<<13)
- .equ DMA0I, (1<<14)
- .equ IOPIMask, (0xFF<<16)
- .equ VDI, (1<<27)
- .equ ICT200_I, (TXDI|RXDI|RXSI|PPI|DMA1I|DMA0I|IOPIMask|VDI)
- .equ ICT205_I, (TXDI|RXDI|RXSI|PPI|DMA1I|DMA0I|IOPIMask|VDI)
-
- ; Serial port Initialization bits
- .equ NO_PARITY, 0
-
-
- ; SPST bits
- .equ THREShift, 22
-
-;* REGISTER Addresses
-
- .equ ROMCntlRegAddr, 0x80000000
-
- .equ ROMCfgRegAddr, 0x80000004
-
- .equ DRAMCntlRegAddr, 0x80000008
-
- .equ DRAMCfgRegAddr, 0x8000000C
-
- .equ DRAMMap0RegAddr, 0x80000010
-
- .equ DRAMMap1RegAddr, 0x80000014
-
- .equ DRAMMap2RegAddr, 0x80000018
-
- .equ DRAMMap3RegAddr, 0x8000001C
-
- .equ PIACntl0RegAddr, 0x80000020
-
- .equ PIACntl1RegAddr, 0x80000024
-
- .equ INTRCntlRegAddr, 0x80000028
-
- .equ DMACntl0RegAddr, 0x80000030
-
- .equ DMACntl1RegAddr, 0x80000040
-
- .equ SERPortCntlRegAddr, 0x80000080
-
- .equ SERPortStatRegAddr, 0x80000084
-
- .equ SERPortTHLDRegAddr, 0x80000088
-
- .equ SERPortRbufRegAddr, 0x8000008C
-
- .equ SERPortBaudRegAddr, 0x80000090
-
- .equ PARPortCntlRegAddr, 0x800000C0
-
- .equ PIOCntlRegAddr, 0x800000D0
-
- .equ PIOInpRegAddr, 0x800000D4
-
- .equ PIOOutRegAddr, 0x800000D8
-
- .equ PIOOutEnaRegAddr, 0x800000DC
-
- .equ VCTCntlRegAddr, 0x800000E0
-
-;
-;* Control constants
-;
-
-;* AM29030 Timer related constants.
-
- .equ TMR_IE, 0x01000000
-
- .equ TMR_IN, 0x02000000
-
- .equ TMR_OV, 0x04000000
-
- .equ TMC_INITCNT, 1613
-
-;
-;* System initialization values.
-;
-
- .equ __os_version, 0x0001 ;
-
- .equ STACKSize, 0x8000 ;
-
- .equ PGMExecMode, 0x0000 ;
-
- .equ TSTCK_OFST, 28 * 4
-
- .equ CSTCK_OFST, 29 * 4
-
- .equ TMSTCK_OFST, 30 * 4
-
- .equ CMSTCK_OFST, 31 * 4
-
- .equ CTXSW_OK, 0xA55A ; ctx switch ok
-
- .set NV_STARTOFST, 0x20 ; 32 bytes
-
- .set NV_BAUDOFST, 0x00 ; 00 bytes
-
- .set reg_cir, 29
-
- .set reg_cdr, 30
-
- .equ MSG_BUFSIZE, 0x1000 ; serial buffer size
-
- .equ ILLOPTRAP, 0
-
- .equ UATRAP, 1
-
- .equ PVTRAP, 5
-
- .equ UITLBMISSTRAP, 8
-
- .equ UDTLBMISSTRAP, 9
-
- .equ TIMERTRAP, 14
-
- .equ TRACETRAP, 15
-
- .equ XLINXTRAP, 16
-
- .equ SERIALTRAP, 17
-
- .equ SLOWTMRTRAP, 18
-
- .equ PORTTRAP, 19
-
- .equ SVSCTRAP, 80
-
- .equ SVSCTRAP1, 81
-
- .equ V_CACHETRAP, 66 ;
-
- .equ V_SETSERVICE, 67 ;
-
- .equ INIT_TIMER, 100
-
- .equ DISABLE_TIMER, 101
-
- .equ GET_TIMER, 102
-
- .equ CLEAR_TIMER, 103
-
- .equ V_SPILL, 64
-
- .equ V_FILL, 65
-
- .equ SIGDFL, 105
diff --git a/cpukit/score/cpu/a29k/asm.h b/cpukit/score/cpu/a29k/asm.h
deleted file mode 100644
index 5622b124ce..0000000000
--- a/cpukit/score/cpu/a29k/asm.h
+++ /dev/null
@@ -1,103 +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.
- *
- * !!! THIS FILE DOES NOT APPEAR TO HAVE BEEN USED IN THE 29K PORT !!!
- *
- * 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-1997
- * On-Line Applications Research Corporation (OAR).
- *
- * $Id$
- */
-
-#ifndef __A29K_ASM_h
-#define __A29K_ASM_h
-
-/*
- * Indicate we are in an assembly file and get the basic CPU definitions.
- */
-
-#ifndef ASM
-#define ASM
-#endif
-#include <rtems/score/targopts.h>
-#include <rtems/score/asm.h>
-
-/*
- * 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/a29k/cpu.c b/cpukit/score/cpu/a29k/cpu.c
deleted file mode 100644
index 111533a2ae..0000000000
--- a/cpukit/score/cpu/a29k/cpu.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * AMD 29K CPU Dependent Source
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 lint
-static char _sccsid[] = "@(#)cpu.c 10/21/96 1.8\n";
-#endif
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/thread.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-void a29k_ISR_Handler(unsigned32 vector);
-
-/* _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 */
-)
-{
- unsigned int i;
- /*
- * The thread_dispatch argument is the address of the entry point
- * for the routine called at the end of an ISR once it has been
- * decided a context switch is necessary. On some compilation
- * systems it is difficult to call a high-level language routine
- * from assembly. This allows us to trick these systems.
- *
- * If you encounter this problem save the entry point in a CPU
- * dependent variable.
- */
-
- _CPU_Thread_dispatch_pointer = thread_dispatch;
-
- /*
- * If there is not an easy way to initialize the FP context
- * during Context_Initialize, then it is usually easier to
- * save an "uninitialized" FP context here and copy it to
- * the task's during Context_Initialize.
- */
-
- /* FP context initialization support goes here */
-
- _CPU_Table = *cpu_table;
-
- for ( i = 0; i < ISR_NUMBER_OF_VECTORS; i++ )
- {
- _ISR_Vector_table[i] = (proc_ptr)NULL;
- }
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- unsigned32 cps;
-
- /*
- * This routine returns the current interrupt level.
- */
- cps = a29k_getops();
- if (cps & (TD|DI))
- return 1;
- else
- return 0;
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-extern void intr14( void );
-extern void intr18( void );
-extern void intr19( void );
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- /*
- * This is where we install the interrupt handler into the "raw" interrupt
- * table used by the CPU to dispatch interrupt handlers.
- */
- switch( vector )
- {
- case 14:
- _settrap( vector, intr14 );
- break;
- case 18:
- _settrap( vector, intr18 );
- break;
- case 19:
- _settrap( vector, intr19 );
- break;
-
- default:
- break;
- }
-}
-
-
-/*PAGE
- *
- * _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
-)
-{
- *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.
- */
-
- _CPU_ISR_install_raw_handler( vector, new_handler, old_handler );
-
- /*
- * 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;
-}
-
-/*PAGE
- *
- * _CPU_Install_interrupt_stack
- */
-
-void _CPU_Install_interrupt_stack( void )
-{
-}
-
-/*PAGE
- *
- * _CPU_Internal_threads_Idle_thread_body
- *
- * NOTES:
- *
- * 1. This is the same as the regular CPU independent algorithm.
- *
- * 2. If you implement this using a "halt", "idle", or "shutdown"
- * instruction, then don't forget to put it in an infinite loop.
- *
- * 3. Be warned. Some processors with onboard DMA have been known
- * to stop the DMA if the CPU were put in IDLE mode. This might
- * also be a problem with other on-chip peripherals. So use this
- * hook with caution.
- */
-
-void _CPU_Internal_threads_Idle_thread_body( void )
-{
-
- for( ; ; )
- {
- }
- /* insert your "halt" instruction here */ ;
-}
-
-void a29k_fatal_error( unsigned32 error )
-{
- printf("\n\nfatal error %d, rebooting!!!\n",error );
- exit(error);
-}
-
- /*
- * This discussion ignores a lot of the ugly details in a real
- * implementation such as saving enough registers/state to be
- * able to do something real. Keep in mind that the goal is
- * to invoke a user's ISR handler which is written in C and
- * uses a certain set of registers.
- *
- * Also note that the exact order is to a large extent flexible.
- * Hardware will dictate a sequence for a certain subset of
- * _ISR_Handler while requirements for setting
- */
-
- /*
- * At entry to "common" _ISR_Handler, the vector number must be
- * available. On some CPUs the hardware puts either the vector
- * number or the offset into the vector table for this ISR in a
- * known place. If the hardware does not give us this information,
- * then the assembly portion of RTEMS for this port will contain
- * a set of distinct interrupt entry points which somehow place
- * the vector number in a known place (which is safe if another
- * interrupt nests this one) and branches to _ISR_Handler.
- *
- */
-
-void a29k_ISR_Handler(unsigned32 vector)
-{
- _ISR_Nest_level++;
- _Thread_Dispatch_disable_level++;
- if ( _ISR_Vector_table[ vector ] )
- (*_ISR_Vector_table[ vector ])( vector );
- --_Thread_Dispatch_disable_level;
- --_ISR_Nest_level;
- if ( !_Thread_Dispatch_disable_level && !_ISR_Nest_level &&
- (_Context_Switch_necessary || _ISR_Signals_to_thread_executing ))
- _Thread_Dispatch();
- return;
-}
diff --git a/cpukit/score/cpu/a29k/pswmacro.ah b/cpukit/score/cpu/a29k/pswmacro.ah
deleted file mode 100644
index c21eee4f35..0000000000
--- a/cpukit/score/cpu/a29k/pswmacro.ah
+++ /dev/null
@@ -1,442 +0,0 @@
-; /* @(#)pswmacro.ah 1.1 96/05/23 08:56:58, TEI */
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; macros: Do_install and init_TLB
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; /* $Id$ */
-
-;* File information and includes.
-
- .file "macro.ah"
- .ident "@(#)pswmacro.ah 1.1 96/05/23 08:56:58, TEI"
-
-
- .macro CONST32, RegName, RegValue
- const RegName, RegValue
- consth RegName, RegValue
- .endm
-
- .macro CONSTX, RegName, RegValue
- .if (RegValue) <= 0x0000ffff
- const RegName, RegValue
- .else
- const RegName, RegValue
- consth RegName, RegValue
- .endif
- .endm
-
- .macro PRODEV, RegName
- srl RegName, RegName, 24
- .endm
-
-;
-;* MACRO TO INSTALL VECTOR TABLE ENTRIES
-;
-
-;* Assumes vector table address in v0
-
- .macro _setvec, trapnum, trapaddr
- mfsr v0, vab ;
- const v2, trapnum ;
- sll v1, v2, 2 ;
- add v1, v1, v0 ; v0 has location of vector tab
-
- const v2, trapaddr ;
- consth v2, trapaddr ;
- store 0, 0, v2, v1 ;
- nop ;
- .endm
-
- .macro syscall, name
- const tav, HIF_@name ;
- asneq V_SYSCALL, gr1, gr1 ;
- nop ;
- nop ;
- .endm
-
-
-
-;* MACRO TO INSTALL VECTOR TABLE ENTRIES
-
- .macro Do_Install, V_Number, V_Address
- const lr4, V_Address
- consth lr4, V_Address
- const lr3, V_Number * 4
- consth lr3, V_Number * 4
- call lr0, V_Install
- nop
- .endm
-
- .macro Do_InstallX, V_Number, V_Address
- const lr4, V_Address
- consth lr4, V_Address
- const lr3, V_Number * 4
- consth lr3, V_Number * 4
- call lr0, V_InstallX
- nop
- .endm
-
-
-
-; push a register onto the stack
- .macro pushreg, reg, sp
- sub sp, sp, 4 ; adjust stack pointer
- store 0, 0, reg, sp ; push register
- .endm
-
- .macro push, sp, reg
- sub sp, sp, 4
- store 0, 0, reg, sp
- .endm
-
-; pop the register from stack
- .macro popreg, reg, sp
- load 0, 0, reg, sp ; pop register
- add sp, sp, 4 ; adjust stack pointer
- .endm
- .macro pop, reg, sp
- load 0, 0, reg, sp
- add sp, sp, 4
- .endm
-
-; push a special register onto stack
- .macro pushspcl, spcl, tmpreg, sp
- sub sp, sp, 4 ; adjust stack pointer
- mfsr tmpreg, spcl ; get spcl reg
- store 0, 0, tmpreg, sp ; push onto stack
- .endm
-
- .macro pushsr, sp, reg, sreg
- mfsr reg, sreg
- sub sp, sp, 4
- store 0, 0, reg, sp
- .endm
-
-; pop a special register from stack
- .macro popspcl, spcl, tmpreg, sp
- load 0, 0, tmpreg, sp ; pop from stack
- add sp, sp, 4 ; adjust stack pointer
- mtsr spcl, tmpreg ; set spcl reg
- .endm
-
- .macro popsr, sreg, reg, sp
- load 0, 0, reg, sp
- add sp, sp, 4
- mtsr sreg, reg
- .endm
-
-;
-; save freeze mode registers on memory stack.
-;
-
- .macro SaveFZState, tmp1, tmp2
-
- ; save freeze mode registers.
-
- pushspcl pc0, tmp1, msp
- pushspcl pc1, tmp1, msp
- pushspcl alu, tmp1, msp
-
- pushspcl cha, tmp1, msp
- pushspcl chd, tmp1, msp
- pushspcl chc, tmp1, msp
-
- pushspcl ops, tmp1, msp
-
- ; turn freeze off
-
- const tmp2, FZ
- mfsr tmp1, cps
- andn tmp1, tmp1, tmp2
- mtsr cps, tmp1
- .endm
-
-; restore freeze mode registers from memory stack.
-
- .macro RestoreFZState, tmp1, tmp2
-
- ; turn freeze on
-
- const tmp2, (FZ|DI|DA)
- mfsr tmp1, cps
- or tmp1, tmp1, tmp2
- mtsr cps, tmp1
-
- ; restore freeze mode registers.
-
- popspcl ops, tmp1, msp
- popspcl chc, tmp1, msp
- popspcl chd, tmp1, msp
- popspcl cha, tmp1, msp
- popspcl alu, tmp1, msp
- popspcl pc1, tmp1, msp
- popspcl pc0, tmp1, msp
- .endm
-
-;
-;*
-;
- .equ WS, 512 ; window size
- .equ RALLOC, 4 * 4 ; stack alloc for C
- .equ SIGCTX_UM_SIZE, 40 * 4 ;
- .equ SIGCTX_RFB, (38) * 4 ; user mode saved
- .equ SIGCTX_SM_SIZE, 12 * 4 ;
- .equ SIGCTX_SIG, (11)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_GR1, (10)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_RAB, (9)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_PC0, (8)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_PC1, (7)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_PC2, (6)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_CHC, (3)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_OPS, (1)*4 + SIGCTX_UM_SIZE ;
- .equ SIGCTX_TAV, (0)*4 + SIGCTX_UM_SIZE ;
-
- .macro sup_sv
- add it2, trapreg, 0 ; transfer signal #
- sub msp, msp, 4 ;
- store 0, 0, it2, msp ; save signal number
- sub msp, msp, 4 ; push gr1
-
- store 0, 0, gr1, msp ;
- sub msp, msp, 4 ; push rab
- store 0, 0, rab, msp ;
- const it0, WS ; Window size
-
- sub rab, rfb, it0 ; set rab = rfb-512
- pushsr msp, it0, PC0 ; save program counter0
- pushsr msp, it0, PC1 ; save program counter1
- pushsr msp, it0, PC2 ; save program counter2
-
- pushsr msp, it0, CHA ; save channel address
- pushsr msp, it0, CHD ; save channel data
- pushsr msp, it0, CHC ; save channel control
- pushsr msp, it0, ALU ; save alu
-
- pushsr msp, it0, OPS ; save ops
- sub msp, msp, 4 ;
- store 0, 0, tav, msp ; push tav
- mtsrim chc, 0 ; no loadm/storem
-
- mfsr it0, ops ; get ops value
- const it1, (TD | DI) ; disable interrupts
- consth it1, (TD | DI) ; disable interrupts
- or it0, it0, it1 ; set bits
-
- mtsr ops, it0 ; set new ops
- const it0, _sigcode ; signal handler
- consth it0, _sigcode ; signal handler
- mtsr pc1, it0 ; store pc1
-
- add it1, it0, 4 ; next addr
- mtsr pc0, it1 ; store pc1 location
- iret ; return
- nop ; ALIGN
- .endm
-
- .macro sig_return
- mfsr it0, cps ; get processor status
- const it1, FZ|DA ; Freeze + traps disable
- or it0, it0, it1 ; to set FZ+DA
- mtsr cps, it0 ; in freeze mode
-
- load 0, 0, tav, msp ; restore tav
- add msp, msp, 4 ;
-
- popsr OPS,it0, msp ;
- popsr ALU,it0, msp ;
- popsr CHC,it0, msp ;
- popsr CHD,it0, msp ;
-
- popsr CHA,it0, msp ;
- popsr PC2,it0, msp ;
- popsr PC1,it0, msp ;
- popsr PC0,it0, msp ;
-
- load 0, 0, rab, msp ;
- add msp, msp, 4 ;
- load 0, 0, it0, msp ;
- add gr1, it0, 0 ; pop rsp
-
- add msp, msp, 8 ; discount signal #
- iret
- .endm
-
- .macro repair_R_stack
- add v0, msp, SIGCTX_GR1 ; interrupted gr1
- load 0, 0, v2, v0 ;
- add v0, msp, SIGCTX_RFB ;
- load 0, 0, v3, v0 ; interupted rfb
-
- const v1, WS ;
- sub v1, v3, v1 ; rfb-512
- cpltu v0, v2, v1 ; test gr1 < rfb-512
- jmpf v0, $1 ;
-
- add gr1, rab, 0 ;
- add v2, v1, 0 ; set LB = rfb-512
-$1:
-;* if gr1 < rfb-512 yes LB = rfb-512 signalled during spill
-;* if no, LB=gr1 interrupted cache < 126 registers
- cpleu v0, v2, rfb ; test LB<=rfb
- jmpf v0, $2 ;
- nop ;
- add v2, rfb, 0 ;
-$2:
- cpeq v0, v3, rfb ; fill rfb->'rfb
- jmpt v0, $3 ; if rfb==rfb'
- const tav, (0x80<<2) ; prepare for fill
- or tav, tav, v2 ;
-
- mtsr IPA, tav ; IPA=LA<<2
- sub tav, v3, gr98 ; cache fill LA->rfb
- srl tav, tav, 2 ; convert to words
- sub tav, tav, 1 ;
-
- mtsr cr, tav ;
- loadm 0, 0, gr0, v2 ; fill from LA->rfb
-$3:
- add rfb, v3, 0 ; move rfb upto 'rfb
- sub rab, v1, 0 ; assign rab to rfb-512
-
- add v0, msp, SIGCTX_GR1 ;
- load 0, 0, v2, v0 ; v0 = interrupted gr1
- add gr1, v2, 0 ; move gr1 upto 'gr1
- nop ;
- .endm
-
- .macro repair_regs
- mtsrim cr, 29 - 1 ; to restore locals
- loadm 0, 0, v0, msp ;
- add msp, msp, 29*4 ;
- popsr Q, tav, msp ;
-
- popsr IPC, tav, msp ;
- popsr IPB, tav, msp ;
- popsr IPA, tav, msp ;
- pop FPStat3, msp ; floating point regs
-
- pop FPStat2, msp ; floating point regs
- pop FPStat1, msp ; floating point regs
- pop FPStat0, msp ; floating point regs
-
- add msp, msp, 3*4 ; R-stack repaired
- .endm
-
-;
-;*HIF related...
-;
-
-
-
-
-; send the message in bufaddr to Montip.
- .macro SendMessageToMontip, bufaddr
- const lr2, bufaddr
-$1:
- call lr0, _msg_send
- consth lr2, bufaddr
- cpeq gr96, gr96, 0
- jmpf gr96, $1
- const lr2, bufaddr
- .endm
-
-; build a HIF_CALL message in bufaddr to send to montip.
- .macro BuildHIFCALLMsg, bufaddr, tmp1, tmp2
- const tmp1, bufaddr
- consth tmp1, bufaddr
- const tmp2, HIF_CALL_MSGCODE
- store 0, 0, tmp2, tmp1 ; msg code
- add tmp1, tmp1, 4
- const tmp2, HIF_CALL_MSGLEN
- store 0, 0, tmp2, tmp1 ; msg len
- add tmp1, tmp1, 4
- store 0, 0, gr121, tmp1 ; service number
- add tmp1, tmp1, 4
- store 0, 0, lr2, tmp1 ; lr2
- add tmp1, tmp1, 4
- store 0, 0, lr3, tmp1 ; lr3
- add tmp1, tmp1, 4
- store 0, 0, lr4, tmp1 ; lr4
- .endm
-
-;
-;*
-;* All the funky AMD style macros go in here...simply for
-;* compatility
-;
-;
- .macro IMPORT, symbol
- .extern symbol
- .endm
-
- .macro GLOBAL, symbol
- .global symbol
- .endm
-
- .macro USESECT, name, type
- .sect name, type
- .use name
- .endm
-
- .macro SECTION, name, type
- .sect name, type
- .endm
-
- .macro FUNC, fname, lineno
- .global fname
-fname:
- .endm
-
- .macro ENDFUNC, fname, lineno
- .endm
-
-;*************************************LONG
- .macro LONG, varname
-varname:
- .block 4
- .endm
-
-;*************************************UNSIGNED LONG
- .macro ULONG, varname
-varname:
- .block 4
- .endm
-
-;*************************************SHORT
- .macro SHORT, varname
-varname:
- .block 2
- .endm
-
-;*************************************CHAR
- .macro CHAR, varname
-varname:
- .block 1
- .endm
-
-;*************************************LONGARRAY
- .macro LONGARRAY, name, count
-name:
- .block count*4
- .endm
-
-;*************************************SHORTARRAY
-
- .macro SHORTARRAY, name, count
-name:
- .block count*2
- .endm
-
-;*************************************CHARARRAY
-
- .macro CHARARRAY, name, count
-name:
- .block count
- .endm
-
-
-;*************************************VOID_FPTR
-
- .macro VOID_FPTR, name
-name:
- .block 4
- .endm
diff --git a/cpukit/score/cpu/a29k/register.ah b/cpukit/score/cpu/a29k/register.ah
deleted file mode 100644
index 35142b508f..0000000000
--- a/cpukit/score/cpu/a29k/register.ah
+++ /dev/null
@@ -1,214 +0,0 @@
-; /* @(#)register.ah 1.1 96/05/23 08:56:57, TEI */
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; naming of various registers
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; /* $Id$ */
-
-;* File information and includes.
-
- .file "register.ah"
- .ident "@(#)register.ah 1.1 96/05/23 08:56:57, TEI\n"
-
-;* Register Stack pointer and frame pointer registers.
-
- .extern Rrsp, Rfp
-
- .reg regsp, %%Rrsp
- .reg fp, %%Rfp
-
-
- .extern RTrapReg
- .extern Rtrapreg
-
- .reg TrapReg, %%RTrapReg
- .reg trapreg, %%Rtrapreg
-
-
-;* Operating system Interrupt handler registers (gr64-gr67)
-
- .extern ROSint0, ROSint1, ROSint2, ROSint3
-
- .reg OSint0, %%ROSint0
- .reg OSint1, %%ROSint1
- .reg OSint2, %%ROSint2
- .reg OSint3, %%ROSint3
-
- .reg it0, %%ROSint0
- .reg it1, %%ROSint1
- .reg it2, %%ROSint2
- .reg it3, %%ROSint3
-
-
-
-;* Operating system temporary (or scratch) registers (gr68-gr79)
-
- .extern ROStmp0, ROStmp1, ROStmp2, ROStmp3
- .extern ROStmp4, ROStmp5, ROStmp6, ROStmp7
- .extern ROStmp8, ROStmp9, ROStmp10, ROStmp11
-
- .reg OStmp0, %%ROStmp0
- .reg OStmp1, %%ROStmp1
- .reg OStmp2, %%ROStmp2
- .reg OStmp3, %%ROStmp3
-
- .reg OStmp4, %%ROStmp4
- .reg OStmp5, %%ROStmp5
- .reg OStmp6, %%ROStmp6
- .reg OStmp7, %%ROStmp7
-
- .reg OStmp8, %%ROStmp8
- .reg OStmp9, %%ROStmp9
- .reg OStmp10, %%ROStmp10
- .reg OStmp11, %%ROStmp11
-
-
- .reg kt0, %%ROStmp0
- .reg kt1, %%ROStmp1
- .reg kt2, %%ROStmp2
- .reg kt3, %%ROStmp3
-
- .reg kt4, %%ROStmp4
- .reg kt5, %%ROStmp5
- .reg kt6, %%ROStmp6
- .reg kt7, %%ROStmp7
-
- .reg kt8, %%ROStmp8
- .reg kt9, %%ROStmp9
- .reg kt10, %%ROStmp10
- .reg kt11, %%ROStmp11
-
-
- .reg TempReg0, %%ROSint0
- .reg TempReg1, %%ROSint1
- .reg TempReg2, %%ROSint2
- .reg TempReg3, %%ROSint3
-
- .reg TempReg4, %%ROStmp0
- .reg TempReg5, %%ROStmp1
- .reg TempReg6, %%ROStmp2
- .reg TempReg7, %%ROStmp3
-
- .reg TempReg8, %%ROStmp4
- .reg TempReg9, %%ROStmp5
- .reg TempReg10, %%ROStmp6
- .reg TempReg11, %%ROStmp7
-
- .reg TempReg12, %%ROStmp8
- .reg TempReg13, %%ROStmp9
- .reg TempReg14, %%ROStmp10
- .reg TempReg15, %%ROStmp11
-
-
-;* Assigned static registers
-
- .extern RSpillAddrReg, RFillAddrReg, RSignalAddrReg
- .extern Rpcb, Retc
- .extern RTimerExt, RTimerUtil, RLEDReg, RERRReg
- .extern Ret0, Ret1, Ret2, Ret3, Ret4, Ret5, Ret6, Ret7, Reta, Retb
- .extern Retx, Rety, Retz
-
-
- .reg SpillAddrReg, %%RSpillAddrReg
- .reg FillAddrReg, %%RFillAddrReg
- .reg SignalAddrReg, %%RSignalAddrReg
- .reg pcb, %%Rpcb
-
- .reg etx, %%Retx
- .reg ety, %%Rety
- .reg etz, %%Retz
- .reg eta, %%Reta
-
- .reg etb, %%Retb
- .reg etc, %%Retc
- .reg TimerExt, %%RTimerExt
- .reg TimerUtil, %%RTimerUtil
-
- .reg LEDReg, %%RLEDReg
- .reg ERRReg, %%RERRReg
-
-
- .reg et0, %%Ret0
- .reg et1, %%Ret1
- .reg et2, %%Ret2
- .reg et3, %%Ret3
-
- .reg et4, %%Ret4
- .reg et5, %%Ret5
- .reg et6, %%Ret6
- .reg et7, %%Ret7
-
-;
- .equ SCB1REG_NUM, 88
- .reg SCB1REG_PTR, %%Ret0
-
-; The floating point trap handlers need a few static registers
-
- .extern RFPStat0, RFPStat1, RFPStat2, RFPStat3
- .extern Rheapptr, RHeapPtr, RArgvPtr
-
- .reg FPStat0, %%RFPStat0
- .reg FPStat1, %%RFPStat1
- .reg FPStat2, %%RFPStat2
- .reg FPStat3, %%RFPStat3
-
- .reg heapptr, %%Rheapptr
- .reg HeapPtr, %%RHeapPtr
- .reg ArgvPtr, %%RArgvPtr
-
- .extern RXLINXReg, RVMBCReg, RUARTReg, RETHERReg
-
- .reg XLINXReg, %%RXLINXReg
- .reg VMBCReg, %%RVMBCReg
- .reg UARTReg, %%RUARTReg
- .reg ETHERReg, %%RXLINXReg
-
-;* Compiler and programmer registers. (gr96-gr127)
-
- .extern Rv0, Rv1, Rv2, Rv3, Rv4, Rv5, Rv6, Rv7, Rv8, Rv9
- .extern Rv10, Rv11, Rv12, Rv13, Rv14, Rv15
-
- .reg v0, %%Rv0
- .reg v1, %%Rv1
- .reg v2, %%Rv2
- .reg v3, %%Rv3
-
- .reg v4, %%Rv4
- .reg v5, %%Rv5
- .reg v6, %%Rv6
- .reg v7, %%Rv7
-
- .reg v8, %%Rv8
- .reg v9, %%Rv9
- .reg v10, %%Rv10
- .reg v11, %%Rv11
-
- .reg v12, %%Rv12
- .reg v13, %%Rv13
- .reg v14, %%Rv14
- .reg v15, %%Rv15
-
- .extern Rtv0, Rtv1, Rtv2, Rtv3, Rtv4
-
- .reg tv0, %%Rtv0
- .reg tv1, %%Rtv1
- .reg tv2, %%Rtv2
- .reg tv3, %%Rtv3
- .reg tv4, %%Rtv4
-
-; ****************************************************************************
-; For uatrap
-; register definitions -- since this trap handler must allow for
-; nested traps and interrupts such as TLB miss, protection violation,
-; or Data Access Exception, and these trap handlers use the shared
-; Temp registers, we must maintain our own that are safe over user-
-; mode loads and stores. The following must be assigned global
-; registers which are not used in INTR[0-3], TRAP[0-1], TLB miss,
-; TLB protection violation, or data exception trap handlers.
-
-; .reg cha_cpy, OStmp4 ; copy of CHA
-; .reg chd_cpy, OStmp5 ; copy of CHD
-; .reg chc_cpy, OStmp6 ; copy of CHC
-; .reg LTemp0, OStmp7 ; local temp 0
-; .reg LTemp1, OStmp8 ; local temp 1
-
-; ****************************************************************************
diff --git a/cpukit/score/cpu/hppa1.1/cpu.c b/cpukit/score/cpu/hppa1.1/cpu.c
deleted file mode 100644
index 282e0e53b6..0000000000
--- a/cpukit/score/cpu/hppa1.1/cpu.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * HP PA-RISC Dependent Source
- *
- * COPYRIGHT (c) 1994 by Division Incorporated
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-void hppa_cpu_halt(unsigned32 the_error);
-
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- /*
- * This is unsupported. For HPPA this function is handled by BSP
- */
-
- _CPU_Fatal_halt( 0xdeaddead );
-}
-
-
-
-/*
- * This is the default handler which is called if
- * _CPU_ISR_install_vector() has not been called for the
- * specified vector. It simply forwards onto the spurious
- * handler defined in the cpu-table.
- */
-
-static ISR_Handler
-hppa_interrupt_report_spurious(ISR_Vector_number vector,
- void* rtems_isr_frame) /* HPPA extension */
-{
-
- /*
- * If the CPU table defines a spurious_handler, then
- * call it. If the handler returns halt.
- */
- if ( _CPU_Table.spurious_handler )
- _CPU_Table.spurious_handler(vector, rtems_isr_frame);
-
- hppa_cpu_halt(vector);
-}
-
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level(void)
-{
- int level;
- HPPA_ASM_SSM(0, level); /* change no bits; just get copy */
- if (level & HPPA_PSW_I)
- return 0;
- return 1;
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_vector
- *
- * This kernel routine installs the RTEMS handler for the
- * specified vector. The handler is a C callable routine.
- *
- * 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
-)
-{
- *old_handler = _ISR_Vector_table[vector];
-
- _ISR_Vector_table[vector] = new_handler;
-}
-
-/* _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 */
-)
-{
- register unsigned8 *fp_context;
- unsigned32 i;
- proc_ptr old_handler;
-
- /*
- * This is the default fp context for all tasks
- * Set it up so that denormalized results go to zero.
- */
-
- fp_context = (unsigned8*) &_CPU_Null_fp_context;
- for (i=0 ; i<sizeof(Context_Control_fp); i++)
- *fp_context++ = 0;
- *((unsigned32 *) &_CPU_Null_fp_context) = HPPA_FPSTATUS_D;
-
- /*
- * Save r27 into _CPU_Default_gr27 so it will hopefully be the correct
- * global data pointer for the entire system.
- */
-
- asm volatile( "stw %%r27,%0" : "=m" (_CPU_Default_gr27): );
-
- /*
- * Init the 2nd level interrupt handlers
- */
-
- for (i=0; i < CPU_INTERRUPT_NUMBER_OF_VECTORS; i++)
- _CPU_ISR_install_vector(i,
- hppa_interrupt_report_spurious,
- &old_handler);
-
- _CPU_Table = *cpu_table;
-
-}
-
-
-/*
- * Halt the system.
- * Called by the _CPU_Fatal_halt macro
- *
- * XXX
- * Later on, this will allow us to return to the prom.
- * For now, we just ignore 'type_of_halt'
- *
- * XXX
- * NOTE: for gcc, this function must be at the bottom
- * of the file, that is because if it is at the top
- * of the file, gcc will inline it's calls. Since
- * the function uses the HPPA_ASM_LABEL() macro, when
- * gcc inlines it, you get two definitions of the same
- * label name, which is an assembly error.
- */
-
-
-void
-hppa_cpu_halt(unsigned32 the_error)
-{
- unsigned32 isrlevel;
-
- _CPU_ISR_Disable(isrlevel);
-
- /*
- * XXXXX NOTE: This label is only needed that that when
- * the simulator stops, it shows the label name specified
- */
- HPPA_ASM_LABEL("_hppa_cpu_halt");
- HPPA_ASM_BREAK(0, 0);
-}
-
diff --git a/cpukit/score/cpu/i386/asm.h b/cpukit/score/cpu/i386/asm.h
deleted file mode 100644
index 9fe867c04c..0000000000
--- a/cpukit/score/cpu/i386/asm.h
+++ /dev/null
@@ -1,151 +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 <rtems/score/targopts.h>
-#include <rtems/score/i386.h>
-
-/*
- * 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.
- */
-
-/*
- * Go32 suffers the same bug as __REGISTER_PREFIX__
- */
-
-#if __GO32__
-#undef __USER_LABEL_PREFIX__
-#define __USER_LABEL_PREFIX__ _
-#endif
-
-#ifndef __USER_LABEL_PREFIX__
-#define __USER_LABEL_PREFIX__ _
-#endif
-
-/*
- * 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/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c
deleted file mode 100644
index 90473bdb14..0000000000
--- a/cpukit/score/cpu/i386/cpu.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Intel i386 Dependent Source
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <bspIo.h>
-#include <rtems/score/thread.h>
-
-
-/* _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 */
-)
-{
- register unsigned16 fp_status asm ("ax");
- register void *fp_context;
-
- _CPU_Table = *cpu_table;
-
- /*
- * The following code saves a NULL i387 context which is given
- * to each task at start and restart time. The following code
- * is based upon that provided in the i386 Programmer's
- * Manual and should work on any coprocessor greater than
- * the i80287.
- *
- * NOTE: The NO RTEMS_WAIT form of the coprocessor instructions
- * MUST be used in case there is not a coprocessor
- * to wait for.
- */
-
- fp_status = 0xa5a5;
- asm volatile( "fninit" );
- asm volatile( "fnstsw %0" : "=a" (fp_status) : "0" (fp_status) );
-
- if ( fp_status == 0 ) {
-
- fp_context = &_CPU_Null_fp_context;
-
- asm volatile( "fsave (%0)" : "=r" (fp_context)
- : "0" (fp_context)
- );
- }
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- unsigned32 level;
-
- i386_get_interrupt_level( level );
-
- return level;
-}
-
-void _CPU_Thread_Idle_body ()
-{
- while(1){
- asm volatile ("hlt");
- }
-}
-
-void _defaultExcHandler (CPU_Exception_frame *ctx)
-{
- printk("----------------------------------------------------------\n");
- printk("Exception %d caught at PC %x by thread %d\n",
- ctx->idtIndex,
- ctx->eip,
- _Thread_Executing->Object.id);
- printk("----------------------------------------------------------\n");
- printk("Processor execution context at time of the fault was :\n");
- printk("----------------------------------------------------------\n");
- printk(" EAX = %x EBX = %x ECX = %x EDX = %x\n",
- ctx->eax, ctx->ebx, ctx->ecx, ctx->edx);
- printk(" ESI = %x EDI = %x EBP = %x ESP = %x\n",
- ctx->esi, ctx->edi, ctx->ebp, ctx->esp0);
- printk("----------------------------------------------------------\n");
- printk("Error code pushed by processor itself (if not 0) = %x\n",
- ctx->faultCode);
- printk("----------------------------------------------------------\n\n");
- if (_ISR_Nest_level > 0) {
- /*
- * In this case we shall not delete the task interrupted as
- * it has nothing to do with the fault. We cannot return either
- * because the eip points to the faulty instruction so...
- */
- printk("Exception while executing ISR!!!. System locked\n");
- while(1);
- }
- else {
- /*
- * OK I could probably use a simplified version but at least this
- * should work.
- */
- printk(" ************ FAULTY THREAD WILL BE DELETED **************\n");
- rtems_task_delete(_Thread_Executing->Object.id);
- }
-}
-
-cpuExcHandlerType _currentExcHandler = _defaultExcHandler;
-
-extern void rtems_exception_prologue_0();
-extern void rtems_exception_prologue_1();
-extern void rtems_exception_prologue_2();
-extern void rtems_exception_prologue_3();
-extern void rtems_exception_prologue_4();
-extern void rtems_exception_prologue_5();
-extern void rtems_exception_prologue_6();
-extern void rtems_exception_prologue_7();
-extern void rtems_exception_prologue_8();
-extern void rtems_exception_prologue_9();
-extern void rtems_exception_prologue_10();
-extern void rtems_exception_prologue_11();
-extern void rtems_exception_prologue_12();
-extern void rtems_exception_prologue_13();
-extern void rtems_exception_prologue_14();
-extern void rtems_exception_prologue_16();
-extern void rtems_exception_prologue_17();
-extern void rtems_exception_prologue_18();
-
-static rtems_raw_irq_hdl tbl[] = {
- rtems_exception_prologue_0,
- rtems_exception_prologue_1,
- rtems_exception_prologue_2,
- rtems_exception_prologue_3,
- rtems_exception_prologue_4,
- rtems_exception_prologue_5,
- rtems_exception_prologue_6,
- rtems_exception_prologue_7,
- rtems_exception_prologue_8,
- rtems_exception_prologue_9,
- rtems_exception_prologue_10,
- rtems_exception_prologue_11,
- rtems_exception_prologue_12,
- rtems_exception_prologue_13,
- rtems_exception_prologue_14,
- rtems_exception_prologue_16,
- rtems_exception_prologue_17,
- rtems_exception_prologue_18,
-};
-
-void rtems_exception_init_mngt()
-{
- unsigned int i,j;
- interrupt_gate_descriptor *currentIdtEntry;
- unsigned limit;
- unsigned level;
-
- i = sizeof(tbl) / sizeof (rtems_raw_irq_hdl);
-
- i386_get_info_from_IDTR (&currentIdtEntry, &limit);
-
- _CPU_ISR_Disable(level);
- for (j = 0; j < i; j++) {
- create_interrupt_gate_descriptor (&currentIdtEntry[j], tbl[j]);
- }
- _CPU_ISR_Enable(level);
-}
-
diff --git a/cpukit/score/cpu/i386/rtems/asm.h b/cpukit/score/cpu/i386/rtems/asm.h
deleted file mode 100644
index 9fe867c04c..0000000000
--- a/cpukit/score/cpu/i386/rtems/asm.h
+++ /dev/null
@@ -1,151 +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 <rtems/score/targopts.h>
-#include <rtems/score/i386.h>
-
-/*
- * 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.
- */
-
-/*
- * Go32 suffers the same bug as __REGISTER_PREFIX__
- */
-
-#if __GO32__
-#undef __USER_LABEL_PREFIX__
-#define __USER_LABEL_PREFIX__ _
-#endif
-
-#ifndef __USER_LABEL_PREFIX__
-#define __USER_LABEL_PREFIX__ _
-#endif
-
-/*
- * 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/i960/asm.h b/cpukit/score/cpu/i960/asm.h
deleted file mode 100644
index a9a0788925..0000000000
--- a/cpukit/score/cpu/i960/asm.h
+++ /dev/null
@@ -1,110 +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 __i960_ASM_h
-#define __i960_ASM_h
-
-/*
- * Indicate we are in an assembly file and get the basic CPU definitions.
- */
-
-#ifndef ASM
-#define ASM
-#endif
-#include <rtems/score/targopts.h>
-#include <rtems/score/i960.h>
-
-/*
- * 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 g0 REG (g0)
-#define g1 REG (g1)
-#define g2 REG (g2)
-#define g3 REG (g3)
-#define g4 REG (g4)
-#define g5 REG (g5)
-#define g6 REG (g6)
-#define g7 REG (g7)
-#define g8 REG (g8)
-#define g9 REG (g9)
-#define g10 REG (g10)
-#define g11 REG (g11)
-#define g12 REG (g12)
-#define g13 REG (g13)
-#define g14 REG (g14)
-#define g15 REG (g15)
-
-/*
- * 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/i960/cpu.c b/cpukit/score/cpu/i960/cpu.c
deleted file mode 100644
index 7dbbb5828f..0000000000
--- a/cpukit/score/cpu/i960/cpu.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Intel i960CA Dependent Source
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#if defined(__i960CA__) || defined(__i960_CA__) || defined(__i960CA)
-#else
-#warning "*** ENTIRE FILE IMPLEMENTED & TESTED FOR CA ONLY ***"
-#warning "*** THIS FILE WILL NOT COMPILE ON ANOTHER FAMILY MEMBER ***"
-#endif
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-
-/* _CPU_Initialize
- *
- * This routine performs processor dependent initialization.
- *
- * INPUT PARAMETERS:
- * cpu_table - CPU table to initialize
- * thread_dispatch - address of disptaching routine
- *
- * OUTPUT PARAMETERS: NONE
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch) /* ignored on this CPU */
-)
-{
-
- _CPU_Table = *cpu_table;
-
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- unsigned32 level;
-
- i960_get_interrupt_level( level );
-
- return level;
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-#define _Is_vector_caching_enabled( _prcb ) \
- ((_prcb)->control_tbl->icon & 0x2000)
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- i960ca_PRCB *prcb = _CPU_Table.Prcb;
- proc_ptr *cached_intr_tbl = NULL;
-
- /* The i80960CA does not support vectors 0-7. The first 9 entries
- * in the Interrupt Table are used to manage pending interrupts.
- * Thus vector 8, the first valid vector number, is actually in
- * slot 9 in the table.
- */
-
- *old_handler = prcb->intr_tbl[ vector + 1 ];
-
- prcb->intr_tbl[ vector + 1 ] = new_handler;
-
- if ( _Is_vector_caching_enabled( prcb ) )
- if ( (vector & 0xf) == 0x2 ) /* cacheable? */
- cached_intr_tbl[ vector >> 4 ] = new_handler;
-}
-
-/*PAGE
- *
- * _CPU__ISR_install_vector
- *
- * Install the RTEMS vector wrapper in the CPU's interrupt table.
- *
- * 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 ];
-
- _CPU_ISR_install_raw_handler( vector, _ISR_Handler, &ignored );
-
- _ISR_Vector_table[ vector ] = new_handler;
-}
-
-/*PAGE
- *
- * _CPU_Install_interrupt_stack
- */
-
-#define soft_reset( prcb ) \
- { register i960ca_PRCB *_prcb = (prcb); \
- register unsigned32 *_next=0; \
- register unsigned32 _cmd = 0x30000; \
- asm volatile( "lda next,%1; \
- sysctl %0,%1,%2; \
- next: mov g0,g0" \
- : "=d" (_cmd), "=d" (_next), "=d" (_prcb) \
- : "0" (_cmd), "1" (_next), "2" (_prcb) ); \
- }
-
-void _CPU_Install_interrupt_stack( void )
-{
- i960ca_PRCB *prcb = _CPU_Table.Prcb;
- unsigned32 level;
-
- /*
- * Set the Interrupt Stack in the PRCB and force a reload of it.
- * Interrupts are disabled for safety.
- */
-
- _CPU_ISR_Disable( level );
-
- prcb->intr_stack = _CPU_Interrupt_stack_low;
-
- soft_reset( prcb );
-
- _CPU_ISR_Enable( level );
-}
diff --git a/cpukit/score/cpu/m68k/asm.h b/cpukit/score/cpu/m68k/asm.h
deleted file mode 100644
index 456b213cb2..0000000000
--- a/cpukit/score/cpu/m68k/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 <rtems/score/targopts.h>
-#include <rtems/score/cpu.h>
-
-/*
- * 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/cpu.c b/cpukit/score/cpu/m68k/cpu.c
deleted file mode 100644
index e714933350..0000000000
--- a/cpukit/score/cpu/m68k/cpu.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Motorola MC68xxx Dependent Source
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-
-/* _CPU_Initialize
- *
- * This routine performs processor dependent initialization.
- *
- * INPUT PARAMETERS:
- * cpu_table - CPU table to initialize
- * thread_dispatch - entry pointer to thread dispatcher
- *
- * OUTPUT PARAMETERS: NONE
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch) /* ignored on this CPU */
-)
-{
-#if ( M68K_HAS_VBR == 0 )
- /* fill the isr redirect table with the code to place the format/id
- onto the stack */
-
- unsigned32 slot;
-
- for (slot = 0; slot < CPU_INTERRUPT_NUMBER_OF_VECTORS; slot++)
- {
- _CPU_ISR_jump_table[slot].move_a7 = M68K_MOVE_A7;
- _CPU_ISR_jump_table[slot].format_id = slot << 2;
- _CPU_ISR_jump_table[slot].jmp = M68K_JMP;
- _CPU_ISR_jump_table[slot].isr_handler = (unsigned32) 0xDEADDEAD;
- }
-#endif /* M68K_HAS_VBR */
-
- _CPU_Table = *cpu_table;
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- unsigned32 level;
-
- m68k_get_interrupt_level( level );
-
- return level;
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- proc_ptr *interrupt_table = NULL;
-
-#if (M68K_HAS_FPSP_PACKAGE == 1)
- /*
- * If this vector being installed is one related to FP, then the
- * FPSP will install the handler itself and handle it completely
- * with no intervention from RTEMS.
- */
-
- if (*_FPSP_install_raw_handler &&
- (*_FPSP_install_raw_handler)(vector, new_handler, *old_handler))
- return;
-#endif
-
-
- /*
- * On CPU models without a VBR, it is necessary for there to be some
- * header code for each ISR which saves a register, loads the vector
- * number, and jumps to _ISR_Handler.
- */
-
- m68k_get_vbr( interrupt_table );
- *old_handler = interrupt_table[ vector ];
-#if ( M68K_HAS_VBR == 1 )
- interrupt_table[ vector ] = new_handler;
-#else
- _CPU_ISR_jump_table[vector].isr_handler = (unsigned32) new_handler;
- interrupt_table[ vector ] = (proc_ptr) &_CPU_ISR_jump_table[vector];
-#endif /* M68K_HAS_VBR */
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_vector
- *
- * This kernel routine installs the RTEMS handler for the
- * specified vector.
- *
- * Input parameters:
- * vector - interrupt vector number
- * new_handler - replacement ISR for this vector number
- * old_handler - former 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 ];
-
- _CPU_ISR_install_raw_handler( vector, _ISR_Handler, &ignored );
-
- _ISR_Vector_table[ vector ] = new_handler;
-}
-
-
-/*PAGE
- *
- * _CPU_Install_interrupt_stack
- */
-
-void _CPU_Install_interrupt_stack( void )
-{
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
- void *isp = _CPU_Interrupt_stack_high;
-
- asm volatile ( "movec %0,%%isp" : "=r" (isp) : "0" (isp) );
-#endif
-}
-
-#if ( M68K_HAS_BFFFO != 1 )
-/*
- * Returns table for duplication of the BFFFO instruction (16 bits only)
- */
-const unsigned char __BFFFOtable[256] = {
- 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 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,
- 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, 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, 0, 0
-};
-#endif
-
-/*PAGE
- *
- * The following code context switches the software FPU emulation
- * code provided with GCC.
- */
-
-#if (CPU_SOFTWARE_FP == TRUE)
-extern Context_Control_fp _fpCCR;
-
-void CPU_Context_save_fp (void **fp_context_ptr)
-{
- Context_Control_fp *fp;
-
- fp = (Context_Control_fp *) *fp_context_ptr;
-
- *fp = _fpCCR;
-}
-
-void CPU_Context_restore_fp (void **fp_context_ptr)
-{
- Context_Control_fp *fp;
-
- fp = (Context_Control_fp *) *fp_context_ptr;
-
- _fpCCR = *fp;
-}
-#endif
-
diff --git a/cpukit/score/cpu/m68k/m68302.h b/cpukit/score/cpu/m68k/m68302.h
deleted file mode 100644
index 084ceac034..0000000000
--- a/cpukit/score/cpu/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 */
- 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/m68360.h b/cpukit/score/cpu/m68k/m68360.h
deleted file mode 100644
index 84687c49fa..0000000000
--- a/cpukit/score/cpu/m68k/m68360.h
+++ /dev/null
@@ -1,880 +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_ {
- rtems_unsigned32 br;
- rtems_unsigned32 or;
- rtems_unsigned32 _pad[2];
-} m360MEMCRegisters_t;
-
-/*
- * Serial Communications Controller registers
- */
-typedef struct m360SCCRegisters_ {
- rtems_unsigned32 gsmr_l;
- rtems_unsigned32 gsmr_h;
- rtems_unsigned16 psmr;
- rtems_unsigned16 _pad0;
- rtems_unsigned16 todr;
- rtems_unsigned16 dsr;
- rtems_unsigned16 scce;
- rtems_unsigned16 _pad1;
- rtems_unsigned16 sccm;
- rtems_unsigned8 _pad2;
- rtems_unsigned8 sccs;
- rtems_unsigned32 _pad3[2];
-} m360SCCRegisters_t;
-
-/*
- * Serial Management Controller registers
- */
-typedef struct m360SMCRegisters_ {
- rtems_unsigned16 _pad0;
- rtems_unsigned16 smcmr;
- rtems_unsigned16 _pad1;
- rtems_unsigned8 smce;
- rtems_unsigned8 _pad2;
- rtems_unsigned16 _pad3;
- rtems_unsigned8 smcm;
- rtems_unsigned8 _pad4;
- rtems_unsigned32 _pad5;
-} m360SMCRegisters_t;
-
-
-/*
- *************************************************************************
- * Miscellaneous Parameters *
- *************************************************************************
- */
-typedef struct m360MiscParms_ {
- rtems_unsigned16 rev_num;
- rtems_unsigned16 _res1;
- rtems_unsigned32 _res2;
- rtems_unsigned32 _res3;
-} m360MiscParms_t;
-
-/*
- *************************************************************************
- * RISC Timers *
- *************************************************************************
- */
-typedef struct m360TimerParms_ {
- rtems_unsigned16 tm_base;
- rtems_unsigned16 _tm_ptr;
- rtems_unsigned16 _r_tmr;
- rtems_unsigned16 _r_tmv;
- rtems_unsigned32 tm_cmd;
- rtems_unsigned32 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_ {
- rtems_unsigned16 ibase;
- rtems_unsigned16 ibptr;
- rtems_unsigned32 _istate;
- rtems_unsigned32 _itemp;
-} m360IDMAparms_t;
-
-/*
- *************************************************************************
- * Serial Communication Controllers *
- *************************************************************************
- */
-typedef struct m360SCCparms_ {
- rtems_unsigned16 rbase;
- rtems_unsigned16 tbase;
- rtems_unsigned8 rfcr;
- rtems_unsigned8 tfcr;
- rtems_unsigned16 mrblr;
- rtems_unsigned32 _rstate;
- rtems_unsigned32 _pad0;
- rtems_unsigned16 _rbptr;
- rtems_unsigned16 _pad1;
- rtems_unsigned32 _pad2;
- rtems_unsigned32 _tstate;
- rtems_unsigned32 _pad3;
- rtems_unsigned16 _tbptr;
- rtems_unsigned16 _pad4;
- rtems_unsigned32 _pad5;
- rtems_unsigned32 _rcrc;
- rtems_unsigned32 _tcrc;
- union {
- struct {
- rtems_unsigned32 _res0;
- rtems_unsigned32 _res1;
- rtems_unsigned16 max_idl;
- rtems_unsigned16 _idlc;
- rtems_unsigned16 brkcr;
- rtems_unsigned16 parec;
- rtems_unsigned16 frmec;
- rtems_unsigned16 nosec;
- rtems_unsigned16 brkec;
- rtems_unsigned16 brklen;
- rtems_unsigned16 uaddr[2];
- rtems_unsigned16 _rtemp;
- rtems_unsigned16 toseq;
- rtems_unsigned16 character[8];
- rtems_unsigned16 rccm;
- rtems_unsigned16 rccr;
- rtems_unsigned16 rlbc;
- } uart;
- } un;
-} m360SCCparms_t;
-
-typedef struct m360SCCENparms_ {
- rtems_unsigned16 rbase;
- rtems_unsigned16 tbase;
- rtems_unsigned8 rfcr;
- rtems_unsigned8 tfcr;
- rtems_unsigned16 mrblr;
- rtems_unsigned32 _rstate;
- rtems_unsigned32 _pad0;
- rtems_unsigned16 _rbptr;
- rtems_unsigned16 _pad1;
- rtems_unsigned32 _pad2;
- rtems_unsigned32 _tstate;
- rtems_unsigned32 _pad3;
- rtems_unsigned16 _tbptr;
- rtems_unsigned16 _pad4;
- rtems_unsigned32 _pad5;
- rtems_unsigned32 _rcrc;
- rtems_unsigned32 _tcrc;
- union {
- struct {
- rtems_unsigned32 _res0;
- rtems_unsigned32 _res1;
- rtems_unsigned16 max_idl;
- rtems_unsigned16 _idlc;
- rtems_unsigned16 brkcr;
- rtems_unsigned16 parec;
- rtems_unsigned16 frmec;
- rtems_unsigned16 nosec;
- rtems_unsigned16 brkec;
- rtems_unsigned16 brklen;
- rtems_unsigned16 uaddr[2];
- rtems_unsigned16 _rtemp;
- rtems_unsigned16 toseq;
- rtems_unsigned16 character[8];
- rtems_unsigned16 rccm;
- rtems_unsigned16 rccr;
- rtems_unsigned16 rlbc;
- } uart;
- struct {
- rtems_unsigned32 c_pres;
- rtems_unsigned32 c_mask;
- rtems_unsigned32 crcec;
- rtems_unsigned32 alec;
- rtems_unsigned32 disfc;
- rtems_unsigned16 pads;
- rtems_unsigned16 ret_lim;
- rtems_unsigned16 _ret_cnt;
- rtems_unsigned16 mflr;
- rtems_unsigned16 minflr;
- rtems_unsigned16 maxd1;
- rtems_unsigned16 maxd2;
- rtems_unsigned16 _maxd;
- rtems_unsigned16 dma_cnt;
- rtems_unsigned16 _max_b;
- rtems_unsigned16 gaddr1;
- rtems_unsigned16 gaddr2;
- rtems_unsigned16 gaddr3;
- rtems_unsigned16 gaddr4;
- rtems_unsigned32 _tbuf0data0;
- rtems_unsigned32 _tbuf0data1;
- rtems_unsigned32 _tbuf0rba0;
- rtems_unsigned32 _tbuf0crc;
- rtems_unsigned16 _tbuf0bcnt;
- rtems_unsigned16 paddr_h;
- rtems_unsigned16 paddr_m;
- rtems_unsigned16 paddr_l;
- rtems_unsigned16 p_per;
- rtems_unsigned16 _rfbd_ptr;
- rtems_unsigned16 _tfbd_ptr;
- rtems_unsigned16 _tlbd_ptr;
- rtems_unsigned32 _tbuf1data0;
- rtems_unsigned32 _tbuf1data1;
- rtems_unsigned32 _tbuf1rba0;
- rtems_unsigned32 _tbuf1crc;
- rtems_unsigned16 _tbuf1bcnt;
- rtems_unsigned16 _tx_len;
- rtems_unsigned16 iaddr1;
- rtems_unsigned16 iaddr2;
- rtems_unsigned16 iaddr3;
- rtems_unsigned16 iaddr4;
- rtems_unsigned16 _boff_cnt;
- rtems_unsigned16 taddr_l;
- rtems_unsigned16 taddr_m;
- rtems_unsigned16 taddr_h;
- } ethernet;
- } 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_ {
- rtems_unsigned16 rbase;
- rtems_unsigned16 tbase;
- rtems_unsigned8 rfcr;
- rtems_unsigned8 tfcr;
- rtems_unsigned16 mrblr;
- rtems_unsigned32 _rstate;
- rtems_unsigned32 _pad0;
- rtems_unsigned16 _rbptr;
- rtems_unsigned16 _pad1;
- rtems_unsigned32 _pad2;
- rtems_unsigned32 _tstate;
- rtems_unsigned32 _pad3;
- rtems_unsigned16 _tbptr;
- rtems_unsigned16 _pad4;
- rtems_unsigned32 _pad5;
- union {
- struct {
- rtems_unsigned16 max_idl;
- rtems_unsigned16 _pad0;
- rtems_unsigned16 brklen;
- rtems_unsigned16 brkec;
- rtems_unsigned16 brkcr;
- rtems_unsigned16 _r_mask;
- } uart;
- struct {
- rtems_unsigned16 _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_ {
- rtems_unsigned16 rbase;
- rtems_unsigned16 tbase;
- rtems_unsigned8 rfcr;
- rtems_unsigned8 tfcr;
- rtems_unsigned16 mrblr;
- rtems_unsigned32 _rstate;
- rtems_unsigned32 _pad0;
- rtems_unsigned16 _rbptr;
- rtems_unsigned16 _pad1;
- rtems_unsigned32 _pad2;
- rtems_unsigned32 _tstate;
- rtems_unsigned32 _pad3;
- rtems_unsigned16 _tbptr;
- rtems_unsigned16 _pad4;
- rtems_unsigned32 _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_ {
- rtems_unsigned16 status;
- rtems_unsigned16 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_ {
- rtems_unsigned16 status;
- rtems_unsigned16 _pad;
- rtems_unsigned32 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
- */
- rtems_unsigned8 dpram0[0x400]; /* Microcode program */
- rtems_unsigned8 dpram1[0x200];
- rtems_unsigned8 dpram2[0x100]; /* Microcode scratch */
- rtems_unsigned8 dpram3[0x100]; /* Not on REV A or B masks */
- rtems_unsigned8 _rsv0[0xC00-0x800];
- m360SCCENparms_t scc1p;
- rtems_unsigned8 _rsv1[0xCB0-0xC00-sizeof(m360SCCENparms_t)];
- m360MiscParms_t miscp;
- rtems_unsigned8 _rsv2[0xD00-0xCB0-sizeof(m360MiscParms_t)];
- m360SCCparms_t scc2p;
- rtems_unsigned8 _rsv3[0xD80-0xD00-sizeof(m360SCCparms_t)];
- m360SPIparms_t spip;
- rtems_unsigned8 _rsv4[0xDB0-0xD80-sizeof(m360SPIparms_t)];
- m360TimerParms_t tmp;
- rtems_unsigned8 _rsv5[0xE00-0xDB0-sizeof(m360TimerParms_t)];
- m360SCCparms_t scc3p;
- rtems_unsigned8 _rsv6[0xE70-0xE00-sizeof(m360SCCparms_t)];
- m360IDMAparms_t idma1p;
- rtems_unsigned8 _rsv7[0xE80-0xE70-sizeof(m360IDMAparms_t)];
- m360SMCparms_t smc1p;
- rtems_unsigned8 _rsv8[0xF00-0xE80-sizeof(m360SMCparms_t)];
- m360SCCparms_t scc4p;
- rtems_unsigned8 _rsv9[0xF70-0xF00-sizeof(m360SCCparms_t)];
- m360IDMAparms_t idma2p;
- rtems_unsigned8 _rsv10[0xF80-0xF70-sizeof(m360IDMAparms_t)];
- m360SMCparms_t smc2p;
- rtems_unsigned8 _rsv11[0x1000-0xF80-sizeof(m360SMCparms_t)];
-
- /*
- * SIM Block
- */
- rtems_unsigned32 mcr;
- rtems_unsigned32 _pad00;
- rtems_unsigned8 avr;
- rtems_unsigned8 rsr;
- rtems_unsigned16 _pad01;
- rtems_unsigned8 clkocr;
- rtems_unsigned8 _pad02;
- rtems_unsigned16 _pad03;
- rtems_unsigned16 pllcr;
- rtems_unsigned16 _pad04;
- rtems_unsigned16 cdvcr;
- rtems_unsigned16 pepar;
- rtems_unsigned32 _pad05[2];
- rtems_unsigned16 _pad06;
- rtems_unsigned8 sypcr;
- rtems_unsigned8 swiv;
- rtems_unsigned16 _pad07;
- rtems_unsigned16 picr;
- rtems_unsigned16 _pad08;
- rtems_unsigned16 pitr;
- rtems_unsigned16 _pad09;
- rtems_unsigned8 _pad10;
- rtems_unsigned8 swsr;
- rtems_unsigned32 bkar;
- rtems_unsigned32 bcar;
- rtems_unsigned32 _pad11[2];
-
- /*
- * MEMC Block
- */
- rtems_unsigned32 gmr;
- rtems_unsigned16 mstat;
- rtems_unsigned16 _pad12;
- rtems_unsigned32 _pad13[2];
- m360MEMCRegisters_t memc[8];
- rtems_unsigned8 _pad14[0xF0-0xD0];
- rtems_unsigned8 _pad15[0x100-0xF0];
- rtems_unsigned8 _pad16[0x500-0x100];
-
- /*
- * IDMA1 Block
- */
- rtems_unsigned16 iccr;
- rtems_unsigned16 _pad17;
- rtems_unsigned16 cmr1;
- rtems_unsigned16 _pad18;
- rtems_unsigned32 sapr1;
- rtems_unsigned32 dapr1;
- rtems_unsigned32 bcr1;
- rtems_unsigned8 fcr1;
- rtems_unsigned8 _pad19;
- rtems_unsigned8 cmar1;
- rtems_unsigned8 _pad20;
- rtems_unsigned8 csr1;
- rtems_unsigned8 _pad21;
- rtems_unsigned16 _pad22;
-
- /*
- * SDMA Block
- */
- rtems_unsigned8 sdsr;
- rtems_unsigned8 _pad23;
- rtems_unsigned16 sdcr;
- rtems_unsigned32 sdar;
-
- /*
- * IDMA2 Block
- */
- rtems_unsigned16 _pad24;
- rtems_unsigned16 cmr2;
- rtems_unsigned32 sapr2;
- rtems_unsigned32 dapr2;
- rtems_unsigned32 bcr2;
- rtems_unsigned8 fcr2;
- rtems_unsigned8 _pad26;
- rtems_unsigned8 cmar2;
- rtems_unsigned8 _pad27;
- rtems_unsigned8 csr2;
- rtems_unsigned8 _pad28;
- rtems_unsigned16 _pad29;
- rtems_unsigned32 _pad30;
-
- /*
- * CPIC Block
- */
- rtems_unsigned32 cicr;
- rtems_unsigned32 cipr;
- rtems_unsigned32 cimr;
- rtems_unsigned32 cisr;
-
- /*
- * Parallel I/O Block
- */
- rtems_unsigned16 padir;
- rtems_unsigned16 papar;
- rtems_unsigned16 paodr;
- rtems_unsigned16 padat;
- rtems_unsigned32 _pad31[2];
- rtems_unsigned16 pcdir;
- rtems_unsigned16 pcpar;
- rtems_unsigned16 pcso;
- rtems_unsigned16 pcdat;
- rtems_unsigned16 pcint;
- rtems_unsigned16 _pad32;
- rtems_unsigned32 _pad33[5];
-
- /*
- * TIMER Block
- */
- rtems_unsigned16 tgcr;
- rtems_unsigned16 _pad34;
- rtems_unsigned32 _pad35[3];
- rtems_unsigned16 tmr1;
- rtems_unsigned16 tmr2;
- rtems_unsigned16 trr1;
- rtems_unsigned16 trr2;
- rtems_unsigned16 tcr1;
- rtems_unsigned16 tcr2;
- rtems_unsigned16 tcn1;
- rtems_unsigned16 tcn2;
- rtems_unsigned16 tmr3;
- rtems_unsigned16 tmr4;
- rtems_unsigned16 trr3;
- rtems_unsigned16 trr4;
- rtems_unsigned16 tcr3;
- rtems_unsigned16 tcr4;
- rtems_unsigned16 tcn3;
- rtems_unsigned16 tcn4;
- rtems_unsigned16 ter1;
- rtems_unsigned16 ter2;
- rtems_unsigned16 ter3;
- rtems_unsigned16 ter4;
- rtems_unsigned32 _pad36[2];
-
- /*
- * CP Block
- */
- rtems_unsigned16 cr;
- rtems_unsigned16 _pad37;
- rtems_unsigned16 rccr;
- rtems_unsigned16 _pad38;
- rtems_unsigned32 _pad39[3];
- rtems_unsigned16 _pad40;
- rtems_unsigned16 rter;
- rtems_unsigned16 _pad41;
- rtems_unsigned16 rtmr;
- rtems_unsigned32 _pad42[5];
-
- /*
- * BRG Block
- */
- rtems_unsigned32 brgc1;
- rtems_unsigned32 brgc2;
- rtems_unsigned32 brgc3;
- rtems_unsigned32 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
- */
- rtems_unsigned16 spmode;
- rtems_unsigned16 _pad43[2];
- rtems_unsigned8 spie;
- rtems_unsigned8 _pad44;
- rtems_unsigned16 _pad45;
- rtems_unsigned8 spim;
- rtems_unsigned8 _pad46[2];
- rtems_unsigned8 spcom;
- rtems_unsigned16 _pad47[2];
-
- /*
- * PIP Block
- */
- rtems_unsigned16 pipc;
- rtems_unsigned16 _pad48;
- rtems_unsigned16 ptpr;
- rtems_unsigned32 pbdir;
- rtems_unsigned32 pbpar;
- rtems_unsigned16 _pad49;
- rtems_unsigned16 pbodr;
- rtems_unsigned32 pbdat;
- rtems_unsigned32 _pad50[6];
-
- /*
- * SI Block
- */
- rtems_unsigned32 simode;
- rtems_unsigned8 sigmr;
- rtems_unsigned8 _pad51;
- rtems_unsigned8 sistr;
- rtems_unsigned8 sicmr;
- rtems_unsigned32 _pad52;
- rtems_unsigned32 sicr;
- rtems_unsigned16 _pad53;
- rtems_unsigned16 sirp[2];
- rtems_unsigned16 _pad54;
- rtems_unsigned32 _pad55[2];
- rtems_unsigned8 siram[256];
-} m360_t;
-
-extern volatile m360_t m360;
-
-#endif /* __MC68360_h */
diff --git a/cpukit/score/cpu/m68k/memcpy.c b/cpukit/score/cpu/m68k/memcpy.c
deleted file mode 100644
index 3948411f4b..0000000000
--- a/cpukit/score/cpu/m68k/memcpy.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * C library memcpy routine
- *
- * This routine has code to optimize performance on the CPU32+
- * and another version for other 68k machines.
- *
- * It could be optimized more for machines with MOVE16 instructions.
- *
- * The routine is placed in this source directory to ensure that it
- * is picked up by all applications.
- *
- * W. Eric Norum
- * Saskatchewan Accelerator Laboratory
- * University of Saskatchewan
- * Saskatoon, Saskatchewan, CANADA
- * eric@skatter.usask.ca
- */
-
-#include <string.h>
-#include <rtems/score/m68k.h>
-
-#if defined(__mcpu32__)
-#define COPYSETUP(n) n--
-#define COPY(to,from,n,size) \
- asm volatile ("1:\n" \
- "\tmove." size " (%0)+,(%1)+\n" \
- "\tdbf %2,1b\n" \
- "\tsub.l #0x10000,%2\n" \
- "\tbpl.b 1b\n" : \
- "=a" (from), "=a" (to), "=d" (n) :\
- "0" (from), "1" (to), "2" (n) : \
- "cc", "memory")
-#else
-#define COPYSETUP(n)
-#define COPY(to,from,n,size) \
- asm volatile ("1:\n" \
- "\tmove." size " (%0)+,(%1)+\n" \
- "\tsubq.l #1,%2\n\tbne.b 1b\n" : \
- "=a" (from), "=a" (to), "=d" (n) :\
- "0" (from), "1" (to), "2" (n) : \
- "cc", "memory")
-#endif
-
-void *
-memcpy(void *s1, const void *s2, size_t n)
-{
- char *p1 = s1;
- const char *p2 = s2;
-
- if (n) {
- if (n < 16) {
- COPYSETUP (n);
- COPY (p1, p2, n, "b");
- }
- else {
- int nbyte;
- int nl;
- nbyte = (int)p1 & 0x3;
- if (nbyte) {
- nbyte = 4 - nbyte;
- n -= nbyte;
- COPYSETUP (nbyte);
- COPY (p1, p2, nbyte, "b");
- }
-#if (M68K_HAS_MISALIGNED == 0)
- /*
- * Take care of machines that can't
- * handle misaligned references.
- */
- if ((int)p2 & 0x1) {
- COPYSETUP (n);
- COPY (p1, p2, n, "b");
- return s1;
- }
-#endif
- nl = (unsigned int)n >> 2;
- COPYSETUP (nl);
- COPY (p1, p2, nl, "l");
- nbyte = (int)n & 0x3;
- if (nbyte) {
- COPYSETUP (nbyte);
- COPY (p1, p2, nbyte, "b");
- }
- }
- }
- return s1;
-}
diff --git a/cpukit/score/cpu/m68k/qsm.h b/cpukit/score/cpu/m68k/qsm.h
deleted file mode 100644
index e1bf33bc12..0000000000
--- a/cpukit/score/cpu/m68k/qsm.h
+++ /dev/null
@@ -1,209 +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_
-
-
-#include <efi332.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/asm.h b/cpukit/score/cpu/m68k/rtems/asm.h
deleted file mode 100644
index 456b213cb2..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 <rtems/score/targopts.h>
-#include <rtems/score/cpu.h>
-
-/*
- * 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 084ceac034..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 */
- 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 84687c49fa..0000000000
--- a/cpukit/score/cpu/m68k/rtems/m68k/m68360.h
+++ /dev/null
@@ -1,880 +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_ {
- rtems_unsigned32 br;
- rtems_unsigned32 or;
- rtems_unsigned32 _pad[2];
-} m360MEMCRegisters_t;
-
-/*
- * Serial Communications Controller registers
- */
-typedef struct m360SCCRegisters_ {
- rtems_unsigned32 gsmr_l;
- rtems_unsigned32 gsmr_h;
- rtems_unsigned16 psmr;
- rtems_unsigned16 _pad0;
- rtems_unsigned16 todr;
- rtems_unsigned16 dsr;
- rtems_unsigned16 scce;
- rtems_unsigned16 _pad1;
- rtems_unsigned16 sccm;
- rtems_unsigned8 _pad2;
- rtems_unsigned8 sccs;
- rtems_unsigned32 _pad3[2];
-} m360SCCRegisters_t;
-
-/*
- * Serial Management Controller registers
- */
-typedef struct m360SMCRegisters_ {
- rtems_unsigned16 _pad0;
- rtems_unsigned16 smcmr;
- rtems_unsigned16 _pad1;
- rtems_unsigned8 smce;
- rtems_unsigned8 _pad2;
- rtems_unsigned16 _pad3;
- rtems_unsigned8 smcm;
- rtems_unsigned8 _pad4;
- rtems_unsigned32 _pad5;
-} m360SMCRegisters_t;
-
-
-/*
- *************************************************************************
- * Miscellaneous Parameters *
- *************************************************************************
- */
-typedef struct m360MiscParms_ {
- rtems_unsigned16 rev_num;
- rtems_unsigned16 _res1;
- rtems_unsigned32 _res2;
- rtems_unsigned32 _res3;
-} m360MiscParms_t;
-
-/*
- *************************************************************************
- * RISC Timers *
- *************************************************************************
- */
-typedef struct m360TimerParms_ {
- rtems_unsigned16 tm_base;
- rtems_unsigned16 _tm_ptr;
- rtems_unsigned16 _r_tmr;
- rtems_unsigned16 _r_tmv;
- rtems_unsigned32 tm_cmd;
- rtems_unsigned32 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_ {
- rtems_unsigned16 ibase;
- rtems_unsigned16 ibptr;
- rtems_unsigned32 _istate;
- rtems_unsigned32 _itemp;
-} m360IDMAparms_t;
-
-/*
- *************************************************************************
- * Serial Communication Controllers *
- *************************************************************************
- */
-typedef struct m360SCCparms_ {
- rtems_unsigned16 rbase;
- rtems_unsigned16 tbase;
- rtems_unsigned8 rfcr;
- rtems_unsigned8 tfcr;
- rtems_unsigned16 mrblr;
- rtems_unsigned32 _rstate;
- rtems_unsigned32 _pad0;
- rtems_unsigned16 _rbptr;
- rtems_unsigned16 _pad1;
- rtems_unsigned32 _pad2;
- rtems_unsigned32 _tstate;
- rtems_unsigned32 _pad3;
- rtems_unsigned16 _tbptr;
- rtems_unsigned16 _pad4;
- rtems_unsigned32 _pad5;
- rtems_unsigned32 _rcrc;
- rtems_unsigned32 _tcrc;
- union {
- struct {
- rtems_unsigned32 _res0;
- rtems_unsigned32 _res1;
- rtems_unsigned16 max_idl;
- rtems_unsigned16 _idlc;
- rtems_unsigned16 brkcr;
- rtems_unsigned16 parec;
- rtems_unsigned16 frmec;
- rtems_unsigned16 nosec;
- rtems_unsigned16 brkec;
- rtems_unsigned16 brklen;
- rtems_unsigned16 uaddr[2];
- rtems_unsigned16 _rtemp;
- rtems_unsigned16 toseq;
- rtems_unsigned16 character[8];
- rtems_unsigned16 rccm;
- rtems_unsigned16 rccr;
- rtems_unsigned16 rlbc;
- } uart;
- } un;
-} m360SCCparms_t;
-
-typedef struct m360SCCENparms_ {
- rtems_unsigned16 rbase;
- rtems_unsigned16 tbase;
- rtems_unsigned8 rfcr;
- rtems_unsigned8 tfcr;
- rtems_unsigned16 mrblr;
- rtems_unsigned32 _rstate;
- rtems_unsigned32 _pad0;
- rtems_unsigned16 _rbptr;
- rtems_unsigned16 _pad1;
- rtems_unsigned32 _pad2;
- rtems_unsigned32 _tstate;
- rtems_unsigned32 _pad3;
- rtems_unsigned16 _tbptr;
- rtems_unsigned16 _pad4;
- rtems_unsigned32 _pad5;
- rtems_unsigned32 _rcrc;
- rtems_unsigned32 _tcrc;
- union {
- struct {
- rtems_unsigned32 _res0;
- rtems_unsigned32 _res1;
- rtems_unsigned16 max_idl;
- rtems_unsigned16 _idlc;
- rtems_unsigned16 brkcr;
- rtems_unsigned16 parec;
- rtems_unsigned16 frmec;
- rtems_unsigned16 nosec;
- rtems_unsigned16 brkec;
- rtems_unsigned16 brklen;
- rtems_unsigned16 uaddr[2];
- rtems_unsigned16 _rtemp;
- rtems_unsigned16 toseq;
- rtems_unsigned16 character[8];
- rtems_unsigned16 rccm;
- rtems_unsigned16 rccr;
- rtems_unsigned16 rlbc;
- } uart;
- struct {
- rtems_unsigned32 c_pres;
- rtems_unsigned32 c_mask;
- rtems_unsigned32 crcec;
- rtems_unsigned32 alec;
- rtems_unsigned32 disfc;
- rtems_unsigned16 pads;
- rtems_unsigned16 ret_lim;
- rtems_unsigned16 _ret_cnt;
- rtems_unsigned16 mflr;
- rtems_unsigned16 minflr;
- rtems_unsigned16 maxd1;
- rtems_unsigned16 maxd2;
- rtems_unsigned16 _maxd;
- rtems_unsigned16 dma_cnt;
- rtems_unsigned16 _max_b;
- rtems_unsigned16 gaddr1;
- rtems_unsigned16 gaddr2;
- rtems_unsigned16 gaddr3;
- rtems_unsigned16 gaddr4;
- rtems_unsigned32 _tbuf0data0;
- rtems_unsigned32 _tbuf0data1;
- rtems_unsigned32 _tbuf0rba0;
- rtems_unsigned32 _tbuf0crc;
- rtems_unsigned16 _tbuf0bcnt;
- rtems_unsigned16 paddr_h;
- rtems_unsigned16 paddr_m;
- rtems_unsigned16 paddr_l;
- rtems_unsigned16 p_per;
- rtems_unsigned16 _rfbd_ptr;
- rtems_unsigned16 _tfbd_ptr;
- rtems_unsigned16 _tlbd_ptr;
- rtems_unsigned32 _tbuf1data0;
- rtems_unsigned32 _tbuf1data1;
- rtems_unsigned32 _tbuf1rba0;
- rtems_unsigned32 _tbuf1crc;
- rtems_unsigned16 _tbuf1bcnt;
- rtems_unsigned16 _tx_len;
- rtems_unsigned16 iaddr1;
- rtems_unsigned16 iaddr2;
- rtems_unsigned16 iaddr3;
- rtems_unsigned16 iaddr4;
- rtems_unsigned16 _boff_cnt;
- rtems_unsigned16 taddr_l;
- rtems_unsigned16 taddr_m;
- rtems_unsigned16 taddr_h;
- } ethernet;
- } 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_ {
- rtems_unsigned16 rbase;
- rtems_unsigned16 tbase;
- rtems_unsigned8 rfcr;
- rtems_unsigned8 tfcr;
- rtems_unsigned16 mrblr;
- rtems_unsigned32 _rstate;
- rtems_unsigned32 _pad0;
- rtems_unsigned16 _rbptr;
- rtems_unsigned16 _pad1;
- rtems_unsigned32 _pad2;
- rtems_unsigned32 _tstate;
- rtems_unsigned32 _pad3;
- rtems_unsigned16 _tbptr;
- rtems_unsigned16 _pad4;
- rtems_unsigned32 _pad5;
- union {
- struct {
- rtems_unsigned16 max_idl;
- rtems_unsigned16 _pad0;
- rtems_unsigned16 brklen;
- rtems_unsigned16 brkec;
- rtems_unsigned16 brkcr;
- rtems_unsigned16 _r_mask;
- } uart;
- struct {
- rtems_unsigned16 _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_ {
- rtems_unsigned16 rbase;
- rtems_unsigned16 tbase;
- rtems_unsigned8 rfcr;
- rtems_unsigned8 tfcr;
- rtems_unsigned16 mrblr;
- rtems_unsigned32 _rstate;
- rtems_unsigned32 _pad0;
- rtems_unsigned16 _rbptr;
- rtems_unsigned16 _pad1;
- rtems_unsigned32 _pad2;
- rtems_unsigned32 _tstate;
- rtems_unsigned32 _pad3;
- rtems_unsigned16 _tbptr;
- rtems_unsigned16 _pad4;
- rtems_unsigned32 _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_ {
- rtems_unsigned16 status;
- rtems_unsigned16 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_ {
- rtems_unsigned16 status;
- rtems_unsigned16 _pad;
- rtems_unsigned32 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
- */
- rtems_unsigned8 dpram0[0x400]; /* Microcode program */
- rtems_unsigned8 dpram1[0x200];
- rtems_unsigned8 dpram2[0x100]; /* Microcode scratch */
- rtems_unsigned8 dpram3[0x100]; /* Not on REV A or B masks */
- rtems_unsigned8 _rsv0[0xC00-0x800];
- m360SCCENparms_t scc1p;
- rtems_unsigned8 _rsv1[0xCB0-0xC00-sizeof(m360SCCENparms_t)];
- m360MiscParms_t miscp;
- rtems_unsigned8 _rsv2[0xD00-0xCB0-sizeof(m360MiscParms_t)];
- m360SCCparms_t scc2p;
- rtems_unsigned8 _rsv3[0xD80-0xD00-sizeof(m360SCCparms_t)];
- m360SPIparms_t spip;
- rtems_unsigned8 _rsv4[0xDB0-0xD80-sizeof(m360SPIparms_t)];
- m360TimerParms_t tmp;
- rtems_unsigned8 _rsv5[0xE00-0xDB0-sizeof(m360TimerParms_t)];
- m360SCCparms_t scc3p;
- rtems_unsigned8 _rsv6[0xE70-0xE00-sizeof(m360SCCparms_t)];
- m360IDMAparms_t idma1p;
- rtems_unsigned8 _rsv7[0xE80-0xE70-sizeof(m360IDMAparms_t)];
- m360SMCparms_t smc1p;
- rtems_unsigned8 _rsv8[0xF00-0xE80-sizeof(m360SMCparms_t)];
- m360SCCparms_t scc4p;
- rtems_unsigned8 _rsv9[0xF70-0xF00-sizeof(m360SCCparms_t)];
- m360IDMAparms_t idma2p;
- rtems_unsigned8 _rsv10[0xF80-0xF70-sizeof(m360IDMAparms_t)];
- m360SMCparms_t smc2p;
- rtems_unsigned8 _rsv11[0x1000-0xF80-sizeof(m360SMCparms_t)];
-
- /*
- * SIM Block
- */
- rtems_unsigned32 mcr;
- rtems_unsigned32 _pad00;
- rtems_unsigned8 avr;
- rtems_unsigned8 rsr;
- rtems_unsigned16 _pad01;
- rtems_unsigned8 clkocr;
- rtems_unsigned8 _pad02;
- rtems_unsigned16 _pad03;
- rtems_unsigned16 pllcr;
- rtems_unsigned16 _pad04;
- rtems_unsigned16 cdvcr;
- rtems_unsigned16 pepar;
- rtems_unsigned32 _pad05[2];
- rtems_unsigned16 _pad06;
- rtems_unsigned8 sypcr;
- rtems_unsigned8 swiv;
- rtems_unsigned16 _pad07;
- rtems_unsigned16 picr;
- rtems_unsigned16 _pad08;
- rtems_unsigned16 pitr;
- rtems_unsigned16 _pad09;
- rtems_unsigned8 _pad10;
- rtems_unsigned8 swsr;
- rtems_unsigned32 bkar;
- rtems_unsigned32 bcar;
- rtems_unsigned32 _pad11[2];
-
- /*
- * MEMC Block
- */
- rtems_unsigned32 gmr;
- rtems_unsigned16 mstat;
- rtems_unsigned16 _pad12;
- rtems_unsigned32 _pad13[2];
- m360MEMCRegisters_t memc[8];
- rtems_unsigned8 _pad14[0xF0-0xD0];
- rtems_unsigned8 _pad15[0x100-0xF0];
- rtems_unsigned8 _pad16[0x500-0x100];
-
- /*
- * IDMA1 Block
- */
- rtems_unsigned16 iccr;
- rtems_unsigned16 _pad17;
- rtems_unsigned16 cmr1;
- rtems_unsigned16 _pad18;
- rtems_unsigned32 sapr1;
- rtems_unsigned32 dapr1;
- rtems_unsigned32 bcr1;
- rtems_unsigned8 fcr1;
- rtems_unsigned8 _pad19;
- rtems_unsigned8 cmar1;
- rtems_unsigned8 _pad20;
- rtems_unsigned8 csr1;
- rtems_unsigned8 _pad21;
- rtems_unsigned16 _pad22;
-
- /*
- * SDMA Block
- */
- rtems_unsigned8 sdsr;
- rtems_unsigned8 _pad23;
- rtems_unsigned16 sdcr;
- rtems_unsigned32 sdar;
-
- /*
- * IDMA2 Block
- */
- rtems_unsigned16 _pad24;
- rtems_unsigned16 cmr2;
- rtems_unsigned32 sapr2;
- rtems_unsigned32 dapr2;
- rtems_unsigned32 bcr2;
- rtems_unsigned8 fcr2;
- rtems_unsigned8 _pad26;
- rtems_unsigned8 cmar2;
- rtems_unsigned8 _pad27;
- rtems_unsigned8 csr2;
- rtems_unsigned8 _pad28;
- rtems_unsigned16 _pad29;
- rtems_unsigned32 _pad30;
-
- /*
- * CPIC Block
- */
- rtems_unsigned32 cicr;
- rtems_unsigned32 cipr;
- rtems_unsigned32 cimr;
- rtems_unsigned32 cisr;
-
- /*
- * Parallel I/O Block
- */
- rtems_unsigned16 padir;
- rtems_unsigned16 papar;
- rtems_unsigned16 paodr;
- rtems_unsigned16 padat;
- rtems_unsigned32 _pad31[2];
- rtems_unsigned16 pcdir;
- rtems_unsigned16 pcpar;
- rtems_unsigned16 pcso;
- rtems_unsigned16 pcdat;
- rtems_unsigned16 pcint;
- rtems_unsigned16 _pad32;
- rtems_unsigned32 _pad33[5];
-
- /*
- * TIMER Block
- */
- rtems_unsigned16 tgcr;
- rtems_unsigned16 _pad34;
- rtems_unsigned32 _pad35[3];
- rtems_unsigned16 tmr1;
- rtems_unsigned16 tmr2;
- rtems_unsigned16 trr1;
- rtems_unsigned16 trr2;
- rtems_unsigned16 tcr1;
- rtems_unsigned16 tcr2;
- rtems_unsigned16 tcn1;
- rtems_unsigned16 tcn2;
- rtems_unsigned16 tmr3;
- rtems_unsigned16 tmr4;
- rtems_unsigned16 trr3;
- rtems_unsigned16 trr4;
- rtems_unsigned16 tcr3;
- rtems_unsigned16 tcr4;
- rtems_unsigned16 tcn3;
- rtems_unsigned16 tcn4;
- rtems_unsigned16 ter1;
- rtems_unsigned16 ter2;
- rtems_unsigned16 ter3;
- rtems_unsigned16 ter4;
- rtems_unsigned32 _pad36[2];
-
- /*
- * CP Block
- */
- rtems_unsigned16 cr;
- rtems_unsigned16 _pad37;
- rtems_unsigned16 rccr;
- rtems_unsigned16 _pad38;
- rtems_unsigned32 _pad39[3];
- rtems_unsigned16 _pad40;
- rtems_unsigned16 rter;
- rtems_unsigned16 _pad41;
- rtems_unsigned16 rtmr;
- rtems_unsigned32 _pad42[5];
-
- /*
- * BRG Block
- */
- rtems_unsigned32 brgc1;
- rtems_unsigned32 brgc2;
- rtems_unsigned32 brgc3;
- rtems_unsigned32 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
- */
- rtems_unsigned16 spmode;
- rtems_unsigned16 _pad43[2];
- rtems_unsigned8 spie;
- rtems_unsigned8 _pad44;
- rtems_unsigned16 _pad45;
- rtems_unsigned8 spim;
- rtems_unsigned8 _pad46[2];
- rtems_unsigned8 spcom;
- rtems_unsigned16 _pad47[2];
-
- /*
- * PIP Block
- */
- rtems_unsigned16 pipc;
- rtems_unsigned16 _pad48;
- rtems_unsigned16 ptpr;
- rtems_unsigned32 pbdir;
- rtems_unsigned32 pbpar;
- rtems_unsigned16 _pad49;
- rtems_unsigned16 pbodr;
- rtems_unsigned32 pbdat;
- rtems_unsigned32 _pad50[6];
-
- /*
- * SI Block
- */
- rtems_unsigned32 simode;
- rtems_unsigned8 sigmr;
- rtems_unsigned8 _pad51;
- rtems_unsigned8 sistr;
- rtems_unsigned8 sicmr;
- rtems_unsigned32 _pad52;
- rtems_unsigned32 sicr;
- rtems_unsigned16 _pad53;
- rtems_unsigned16 sirp[2];
- rtems_unsigned16 _pad54;
- rtems_unsigned32 _pad55[2];
- rtems_unsigned8 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 e1bf33bc12..0000000000
--- a/cpukit/score/cpu/m68k/rtems/m68k/qsm.h
+++ /dev/null
@@ -1,209 +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_
-
-
-#include <efi332.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 d70f56d360..0000000000
--- a/cpukit/score/cpu/m68k/rtems/m68k/sim.h
+++ /dev/null
@@ -1,342 +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_
-
-
-/*
- * XXX Why is a generic file like this including a bsp specific file?
-
-#include <efi332.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 */
-/* not included in ram_init.h */
-#if SIM_MM == 0
-#define SIM_CRB 0x7ffa00
-#else
-#undef SIM_MM
-#define SIM_MM 1
-#define SIM_CRB 0xfffa00
-#endif
-/* end not included in ram_init.h */
-
-
-
-#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 W 0x8000 /* Frequency Control (VCO) */
-#define X 0x4000 /* Frequency Control Bit (Prescale) */
-#define Y 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/m68k/sim.h b/cpukit/score/cpu/m68k/sim.h
deleted file mode 100644
index d70f56d360..0000000000
--- a/cpukit/score/cpu/m68k/sim.h
+++ /dev/null
@@ -1,342 +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_
-
-
-/*
- * XXX Why is a generic file like this including a bsp specific file?
-
-#include <efi332.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 */
-/* not included in ram_init.h */
-#if SIM_MM == 0
-#define SIM_CRB 0x7ffa00
-#else
-#undef SIM_MM
-#define SIM_MM 1
-#define SIM_CRB 0xfffa00
-#endif
-/* end not included in ram_init.h */
-
-
-
-#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 W 0x8000 /* Frequency Control (VCO) */
-#define X 0x4000 /* Frequency Control Bit (Prescale) */
-#define Y 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/asm.h b/cpukit/score/cpu/mips/asm.h
deleted file mode 100644
index fccd89069f..0000000000
--- a/cpukit/score/cpu/mips/asm.h
+++ /dev/null
@@ -1,102 +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 <rtems/score/targopts.h>
-#include <rtems/score/no_cpu.h>
-
-/*
- * 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/mips/cpu.c b/cpukit/score/cpu/mips/cpu.c
deleted file mode 100644
index 4617be460d..0000000000
--- a/cpukit/score/cpu/mips/cpu.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Mips CPU Dependent Source
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)cpu.c 08/20/96 1.5\n";
- */
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/wkspace.h>
-
-
-ISR_Handler_entry _ISR_Vector_table[ ISR_NUMBER_OF_VECTORS ];
-
-/* _CPU_Initialize
- *
- * This routine performs processor dependent initialization.
- *
- * INPUT PARAMETERS:
- * cpu_table - CPU table to initialize
- * thread_dispatch - address of disptaching routine
- */
-
-
-void null_handler( void )
-{
-}
-
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch) /* ignored on this CPU */
-)
-{
- unsigned int i = ISR_NUMBER_OF_VECTORS;
-
- while ( i-- )
- {
- _ISR_Vector_table[i] = (ISR_Handler_entry)null_handler;
- }
-
- /*
- * The thread_dispatch argument is the address of the entry point
- * for the routine called at the end of an ISR once it has been
- * decided a context switch is necessary. On some compilation
- * systems it is difficult to call a high-level language routine
- * from assembly. This allows us to trick these systems.
- *
- * If you encounter this problem save the entry point in a CPU
- * dependent variable.
- */
-
- _CPU_Thread_dispatch_pointer = thread_dispatch;
-
- /*
- * If there is not an easy way to initialize the FP context
- * during Context_Initialize, then it is usually easier to
- * save an "uninitialized" FP context here and copy it to
- * the task's during Context_Initialize.
- */
-
- /* FP context initialization support goes here */
-
- _CPU_Table = *cpu_table;
-
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-#if 0 /* located in cpu_asm.S */
-unsigned32 _CPU_ISR_Get_level( void )
-{
- /*
- * This routine returns the current interrupt level.
- */
-}
-#endif
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- /*
- * This is where we install the interrupt handler into the "raw" interrupt
- * table used by the CPU to dispatch interrupt handlers.
- */
-
-#if 0 /* not necessary */
-/* use IDT/Sim to set interrupt vector. Needed to co-exist with debugger. */
- add_ext_int_func( vector, new_handler );
-#endif
-}
-
-/*PAGE
- *
- * _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
-)
-{
- *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.
- */
-
- _CPU_ISR_install_raw_handler( vector, _ISR_Handler, old_handler );
-
- /*
- * 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;
-}
-
-/*PAGE
- *
- * _CPU_Install_interrupt_stack
- */
-
-void _CPU_Install_interrupt_stack( void )
-{
-/* we don't support this yet */
-}
-
-/*PAGE
- *
- * _CPU_Internal_threads_Idle_thread_body
- *
- * NOTES:
- *
- * 1. This is the same as the regular CPU independent algorithm.
- *
- * 2. If you implement this using a "halt", "idle", or "shutdown"
- * instruction, then don't forget to put it in an infinite loop.
- *
- * 3. Be warned. Some processors with onboard DMA have been known
- * to stop the DMA if the CPU were put in IDLE mode. This might
- * also be a problem with other on-chip peripherals. So use this
- * hook with caution.
- */
-
-#if 0 /* located in cpu_asm.S */
-void _CPU_Thread_Idle_body( void )
-{
-
- for( ; ; )
- /* insert your "halt" instruction here */ ;
-}
-#endif
-
-extern void mips_break( int error );
-
-#include <stdio.h>
-
-void mips_fatal_error( int error )
-{
- printf("fatal error 0x%x %d\n",error,error);
- mips_break( error );
-}
diff --git a/cpukit/score/cpu/mips/cpu_asm.S b/cpukit/score/cpu/mips/cpu_asm.S
deleted file mode 100644
index 7dcb8fbda7..0000000000
--- a/cpukit/score/cpu/mips/cpu_asm.S
+++ /dev/null
@@ -1,972 +0,0 @@
-/* cpu_asm.S
- *
- * This file contains the basic algorithms for all assembly code used
- * in an specific CPU port of RTEMS. These algorithms must be implemented
- * in assembly language
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu_asm.s:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-/* @(#)cpu_asm.S 08/20/96 1.15 */
-
-#include "cpu_asm.h"
-
-#include "iregdef.h"
-#include "idtcpu.h"
-
-#define FRAME(name,frm_reg,offset,ret_reg) \
- .globl name; \
- .ent name; \
-name:; \
- .frame frm_reg,offset,ret_reg
-#define ENDFRAME(name) \
- .end name
-
-
-#define EXCP_STACK_SIZE (NREGS*R_SZ)
-
-#if __ghs__
-#define sd sw
-#define ld lw
-#define dmtc0 mtc0
-#define dsll sll
-#define dmfc0 mfc0
-#endif
-
-#if 1 /* 32 bit unsigned32 types */
-#define sint sw
-#define lint lw
-#define stackadd addiu
-#define intadd addu
-#define SZ_INT 4
-#define SZ_INT_POW2 2
-#else /* 64 bit unsigned32 types */
-#define sint dw
-#define lint dw
-#define stackadd daddiu
-#define intadd daddu
-#define SZ_INT 8
-#define SZ_INT_POW2 3
-#endif
-
-#ifdef __GNUC__
-#define EXTERN(x,size) .extern x,size
-#else
-#define EXTERN(x,size)
-#endif
-
-/* NOTE: these constants must match the Context_Control structure in cpu.h */
-#define S0_OFFSET 0
-#define S1_OFFSET 1
-#define S2_OFFSET 2
-#define S3_OFFSET 3
-#define S4_OFFSET 4
-#define S5_OFFSET 5
-#define S6_OFFSET 6
-#define S7_OFFSET 7
-#define SP_OFFSET 8
-#define FP_OFFSET 9
-#define RA_OFFSET 10
-#define C0_SR_OFFSET 11
-#define C0_EPC_OFFSET 12
-
-/* NOTE: these constants must match the Context_Control_fp structure in cpu.h */
-#define FP0_OFFSET 0
-#define FP1_OFFSET 1
-#define FP2_OFFSET 2
-#define FP3_OFFSET 3
-#define FP4_OFFSET 4
-#define FP5_OFFSET 5
-#define FP6_OFFSET 6
-#define FP7_OFFSET 7
-#define FP8_OFFSET 8
-#define FP9_OFFSET 9
-#define FP10_OFFSET 10
-#define FP11_OFFSET 11
-#define FP12_OFFSET 12
-#define FP13_OFFSET 13
-#define FP14_OFFSET 14
-#define FP15_OFFSET 15
-#define FP16_OFFSET 16
-#define FP17_OFFSET 17
-#define FP18_OFFSET 18
-#define FP19_OFFSET 19
-#define FP20_OFFSET 20
-#define FP21_OFFSET 21
-#define FP22_OFFSET 22
-#define FP23_OFFSET 23
-#define FP24_OFFSET 24
-#define FP25_OFFSET 25
-#define FP26_OFFSET 26
-#define FP27_OFFSET 27
-#define FP28_OFFSET 28
-#define FP29_OFFSET 29
-#define FP30_OFFSET 30
-#define FP31_OFFSET 31
-
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-#if 0
-unsigned32 _CPU_ISR_Get_level( void )
-{
- /*
- * This routine returns the current interrupt level.
- */
-}
-#endif
-/* return the current exception level for the 4650 */
-FRAME(_CPU_ISR_Get_level,sp,0,ra)
- mfc0 v0,C0_SR
- nop
- andi v0,SR_EXL
- srl v0,1
- j ra
-ENDFRAME(_CPU_ISR_Get_level)
-
-FRAME(_CPU_ISR_Set_level,sp,0,ra)
- nop
- mfc0 a0,C0_SR
- nop
- andi a0,SR_EXL
- beqz a0,_CPU_ISR_Set_1 /* normalize a0 */
- nop
- li a0,1
-_CPU_ISR_Set_1:
- beq v0,a0,_CPU_ISR_Set_exit /* if (current_level != new_level ) */
- nop
- bnez a0,_CPU_ISR_Set_2
- nop
- nop
- mfc0 t0,C0_SR
- nop
- li t1,~SR_EXL
- and t0,t1
- nop
- mtc0 t0,C0_SR /* disable exception level */
- nop
- j ra
- nop
-_CPU_ISR_Set_2:
- nop
- mfc0 t0,C0_SR
- nop
- li t1,~SR_IE
- and t0,t1
- nop
- mtc0 t0,C0_SR /* first disable ie bit (recommended) */
- nop
- ori t0,SR_EXL|SR_IE /* enable exception level */
- nop
- mtc0 t0,C0_SR
- nop
-_CPU_ISR_Set_exit:
- j ra
- nop
-ENDFRAME(_CPU_ISR_Set_level)
-
-/*
- * _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.
- */
-
-/* void _CPU_Context_save_fp(
- * void **fp_context_ptr
- * )
- * {
- * }
- */
-
-FRAME(_CPU_Context_save_fp,sp,0,ra)
- .set noat
- ld a1,(a0)
- swc1 $f0,FP0_OFFSET*4(a1)
- swc1 $f1,FP1_OFFSET*4(a1)
- swc1 $f2,FP2_OFFSET*4(a1)
- swc1 $f3,FP3_OFFSET*4(a1)
- swc1 $f4,FP4_OFFSET*4(a1)
- swc1 $f5,FP5_OFFSET*4(a1)
- swc1 $f6,FP6_OFFSET*4(a1)
- swc1 $f7,FP7_OFFSET*4(a1)
- swc1 $f8,FP8_OFFSET*4(a1)
- swc1 $f9,FP9_OFFSET*4(a1)
- swc1 $f10,FP10_OFFSET*4(a1)
- swc1 $f11,FP11_OFFSET*4(a1)
- swc1 $f12,FP12_OFFSET*4(a1)
- swc1 $f13,FP13_OFFSET*4(a1)
- swc1 $f14,FP14_OFFSET*4(a1)
- swc1 $f15,FP15_OFFSET*4(a1)
- swc1 $f16,FP16_OFFSET*4(a1)
- swc1 $f17,FP17_OFFSET*4(a1)
- swc1 $f18,FP18_OFFSET*4(a1)
- swc1 $f19,FP19_OFFSET*4(a1)
- swc1 $f20,FP20_OFFSET*4(a1)
- swc1 $f21,FP21_OFFSET*4(a1)
- swc1 $f22,FP22_OFFSET*4(a1)
- swc1 $f23,FP23_OFFSET*4(a1)
- swc1 $f24,FP24_OFFSET*4(a1)
- swc1 $f25,FP25_OFFSET*4(a1)
- swc1 $f26,FP26_OFFSET*4(a1)
- swc1 $f27,FP27_OFFSET*4(a1)
- swc1 $f28,FP28_OFFSET*4(a1)
- swc1 $f29,FP29_OFFSET*4(a1)
- swc1 $f30,FP30_OFFSET*4(a1)
- swc1 $f31,FP31_OFFSET*4(a1)
- j ra
- nop
- .set at
-ENDFRAME(_CPU_Context_save_fp)
-
-/*
- * _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.
- */
-
-/* void _CPU_Context_restore_fp(
- * void **fp_context_ptr
- * )
- * {
- * }
- */
-
-FRAME(_CPU_Context_restore_fp,sp,0,ra)
- .set noat
- ld a1,(a0)
- lwc1 $f0,FP0_OFFSET*4(a1)
- lwc1 $f1,FP1_OFFSET*4(a1)
- lwc1 $f2,FP2_OFFSET*4(a1)
- lwc1 $f3,FP3_OFFSET*4(a1)
- lwc1 $f4,FP4_OFFSET*4(a1)
- lwc1 $f5,FP5_OFFSET*4(a1)
- lwc1 $f6,FP6_OFFSET*4(a1)
- lwc1 $f7,FP7_OFFSET*4(a1)
- lwc1 $f8,FP8_OFFSET*4(a1)
- lwc1 $f9,FP9_OFFSET*4(a1)
- lwc1 $f10,FP10_OFFSET*4(a1)
- lwc1 $f11,FP11_OFFSET*4(a1)
- lwc1 $f12,FP12_OFFSET*4(a1)
- lwc1 $f13,FP13_OFFSET*4(a1)
- lwc1 $f14,FP14_OFFSET*4(a1)
- lwc1 $f15,FP15_OFFSET*4(a1)
- lwc1 $f16,FP16_OFFSET*4(a1)
- lwc1 $f17,FP17_OFFSET*4(a1)
- lwc1 $f18,FP18_OFFSET*4(a1)
- lwc1 $f19,FP19_OFFSET*4(a1)
- lwc1 $f20,FP20_OFFSET*4(a1)
- lwc1 $f21,FP21_OFFSET*4(a1)
- lwc1 $f22,FP22_OFFSET*4(a1)
- lwc1 $f23,FP23_OFFSET*4(a1)
- lwc1 $f24,FP24_OFFSET*4(a1)
- lwc1 $f25,FP25_OFFSET*4(a1)
- lwc1 $f26,FP26_OFFSET*4(a1)
- lwc1 $f27,FP27_OFFSET*4(a1)
- lwc1 $f28,FP28_OFFSET*4(a1)
- lwc1 $f29,FP29_OFFSET*4(a1)
- lwc1 $f30,FP30_OFFSET*4(a1)
- lwc1 $f31,FP31_OFFSET*4(a1)
- j ra
- nop
- .set at
-ENDFRAME(_CPU_Context_restore_fp)
-
-/* _CPU_Context_switch
- *
- * This routine performs a normal non-FP context switch.
- */
-
-/* void _CPU_Context_switch(
- * Context_Control *run,
- * Context_Control *heir
- * )
- * {
- * }
- */
-
-FRAME(_CPU_Context_switch,sp,0,ra)
-
- mfc0 t0,C0_SR
- li t1,~SR_IE
- sd t0,C0_SR_OFFSET*8(a0) /* save status register */
- and t0,t1
- mtc0 t0,C0_SR /* first disable ie bit (recommended) */
- ori t0,SR_EXL|SR_IE /* enable exception level to disable interrupts */
- mtc0 t0,C0_SR
-
- sd ra,RA_OFFSET*8(a0) /* save current context */
- sd sp,SP_OFFSET*8(a0)
- sd fp,FP_OFFSET*8(a0)
- sd s0,S0_OFFSET*8(a0)
- sd s1,S1_OFFSET*8(a0)
- sd s2,S2_OFFSET*8(a0)
- sd s3,S3_OFFSET*8(a0)
- sd s4,S4_OFFSET*8(a0)
- sd s5,S5_OFFSET*8(a0)
- sd s6,S6_OFFSET*8(a0)
- sd s7,S7_OFFSET*8(a0)
- dmfc0 t0,C0_EPC
- sd t0,C0_EPC_OFFSET*8(a0)
-
-_CPU_Context_switch_restore:
- ld s0,S0_OFFSET*8(a1) /* restore context */
- ld s1,S1_OFFSET*8(a1)
- ld s2,S2_OFFSET*8(a1)
- ld s3,S3_OFFSET*8(a1)
- ld s4,S4_OFFSET*8(a1)
- ld s5,S5_OFFSET*8(a1)
- ld s6,S6_OFFSET*8(a1)
- ld s7,S7_OFFSET*8(a1)
- ld fp,FP_OFFSET*8(a1)
- ld sp,SP_OFFSET*8(a1)
- ld ra,RA_OFFSET*8(a1)
- ld t0,C0_EPC_OFFSET*8(a1)
- dmtc0 t0,C0_EPC
- ld t0,C0_SR_OFFSET*8(a1)
- andi t0,SR_EXL
- bnez t0,_CPU_Context_1 /* set exception level from restore context */
- li t0,~SR_EXL
- mfc0 t1,C0_SR
- nop
- and t1,t0
- mtc0 t1,C0_SR
-_CPU_Context_1:
- j ra
- nop
-ENDFRAME(_CPU_Context_switch)
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally 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.
- */
-
-#if 0
-void _CPU_Context_restore(
- Context_Control *new_context
-)
-{
-}
-#endif
-
-FRAME(_CPU_Context_restore,sp,0,ra)
- dadd a1,a0,zero
- j _CPU_Context_switch_restore
- nop
-ENDFRAME(_CPU_Context_restore)
-
-EXTERN(_ISR_Nest_level, SZ_INT)
-EXTERN(_Thread_Dispatch_disable_level,SZ_INT)
-EXTERN(_Context_Switch_necessary,SZ_INT)
-EXTERN(_ISR_Signals_to_thread_executing,SZ_INT)
-.extern _Thread_Dispatch
-.extern _ISR_Vector_table
-
-/* void __ISR_Handler()
- *
- * This routine provides the RTEMS interrupt management.
- *
- */
-
-#if 0
-void _ISR_Handler()
-{
- /*
- * This discussion ignores a lot of the ugly details in a real
- * implementation such as saving enough registers/state to be
- * able to do something real. Keep in mind that the goal is
- * to invoke a user's ISR handler which is written in C and
- * uses a certain set of registers.
- *
- * Also note that the exact order is to a large extent flexible.
- * Hardware will dictate a sequence for a certain subset of
- * _ISR_Handler while requirements for setting
- */
-
- /*
- * At entry to "common" _ISR_Handler, the vector number must be
- * available. On some CPUs the hardware puts either the vector
- * number or the offset into the vector table for this ISR in a
- * known place. If the hardware does not give us this information,
- * then the assembly portion of RTEMS for this port will contain
- * a set of distinct interrupt entry points which somehow place
- * the vector number in a known place (which is safe if another
- * interrupt nests this one) and branches to _ISR_Handler.
- *
- */
-#endif
-FRAME(_ISR_Handler,sp,0,ra)
-.set noreorder
-#if USE_IDTKIT
-/* IDT/Kit incorrectly adds 4 to EPC before returning. This compensates */
- lreg k0, R_EPC*R_SZ(sp)
- daddiu k0,k0,-4
- sreg k0, R_EPC*R_SZ(sp)
- lreg k0, R_CAUSE*R_SZ(sp)
- li k1, ~CAUSE_BD
- and k0, k1
- sreg k0, R_CAUSE*R_SZ(sp)
-#endif
-
-/* save registers not already saved by IDT/sim */
- stackadd sp,sp,-EXCP_STACK_SIZE /* store ra on the stack */
-
- sreg ra, R_RA*R_SZ(sp)
- sreg v0, R_V0*R_SZ(sp)
- sreg v1, R_V1*R_SZ(sp)
- sreg a0, R_A0*R_SZ(sp)
- sreg a1, R_A1*R_SZ(sp)
- sreg a2, R_A2*R_SZ(sp)
- sreg a3, R_A3*R_SZ(sp)
- sreg t0, R_T0*R_SZ(sp)
- sreg t1, R_T1*R_SZ(sp)
- sreg t2, R_T2*R_SZ(sp)
- sreg t3, R_T3*R_SZ(sp)
- sreg t4, R_T4*R_SZ(sp)
- sreg t5, R_T5*R_SZ(sp)
- sreg t6, R_T6*R_SZ(sp)
- sreg t7, R_T7*R_SZ(sp)
- mflo k0
- sreg t8, R_T8*R_SZ(sp)
- sreg k0, R_MDLO*R_SZ(sp)
- sreg t9, R_T9*R_SZ(sp)
- mfhi k0
- sreg gp, R_GP*R_SZ(sp)
- sreg fp, R_FP*R_SZ(sp)
- sreg k0, R_MDHI*R_SZ(sp)
- .set noat
- sreg AT, R_AT*R_SZ(sp)
- .set at
-
- stackadd sp,sp,-40 /* store ra on the stack */
- sd ra,32(sp)
-
-/* determine if an interrupt generated this exception */
- mfc0 k0,C0_CAUSE
- and k1,k0,CAUSE_EXCMASK
- bnez k1,_ISR_Handler_prom_exit /* not an external interrupt, pass exception to Monitor */
- mfc0 k1,C0_SR
- and k0,k1
- and k0,CAUSE_IPMASK
- beq k0,zero,_ISR_Handler_quick_exit /* external interrupt not enabled, ignore */
- nop
-
- /*
- * save some or all context on stack
- * may need to save some special interrupt information for exit
- *
- * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- * if ( _ISR_Nest_level == 0 )
- * switch to software interrupt stack
- * #endif
- */
-#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- lint t0,_ISR_Nest_level
- beq t0, zero, _ISR_Handler_1
- nop
- /* switch stacks */
-_ISR_Handler_1:
-#else
- lint t0,_ISR_Nest_level
-#endif
- /*
- * _ISR_Nest_level++;
- */
- addi t0,t0,1
- sint t0,_ISR_Nest_level
- /*
- * _Thread_Dispatch_disable_level++;
- */
- lint t1,_Thread_Dispatch_disable_level
- addi t1,t1,1
- sint t1,_Thread_Dispatch_disable_level
-#if 0
- nop
- j _ISR_Handler_4
- nop
- /*
- * while ( interrupts_pending(cause_reg) ) {
- * vector = BITFIELD_TO_INDEX(cause_reg);
- * (*_ISR_Vector_table[ vector ])( vector );
- * }
- */
-_ISR_Handler_2:
-/* software interrupt priorities can be applied here */
- li t1,-1
-/* convert bit field into interrupt index */
-_ISR_Handler_3:
- andi t2,t0,1
- addi t1,1
- beql t2,zero,_ISR_Handler_3
- dsrl t0,1
- li t1,7
- dsll t1,3 /* convert index to byte offset (*8) */
- la t3,_ISR_Vector_table
- intadd t1,t3
- lint t1,(t1)
- jalr t1
- nop
- j _ISR_Handler_5
- nop
-_ISR_Handler_4:
- mfc0 t0,C0_CAUSE
- andi t0,CAUSE_IPMASK
- bne t0,zero,_ISR_Handler_2
- dsrl t0,t0,8
-_ISR_Handler_5:
-#else
- nop
- li t1,7
- dsll t1,t1,SZ_INT_POW2
- la t3,_ISR_Vector_table
- intadd t1,t3
- lint t1,(t1)
- jalr t1
- nop
-#endif
- /*
- * --_ISR_Nest_level;
- */
- lint t2,_ISR_Nest_level
- addi t2,t2,-1
- sint t2,_ISR_Nest_level
- /*
- * --_Thread_Dispatch_disable_level;
- */
- lint t1,_Thread_Dispatch_disable_level
- addi t1,t1,-1
- sint t1,_Thread_Dispatch_disable_level
- /*
- * if ( _Thread_Dispatch_disable_level || _ISR_Nest_level )
- * goto the label "exit interrupt (simple case)"
- */
- or t0,t2,t1
- bne t0,zero,_ISR_Handler_exit
- nop
- /*
- * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- * restore stack
- * #endif
- *
- * if ( !_Context_Switch_necessary && !_ISR_Signals_to_thread_executing )
- * goto the label "exit interrupt (simple case)"
- */
- lint t0,_Context_Switch_necessary
- lint t1,_ISR_Signals_to_thread_executing
- or t0,t0,t1
- beq t0,zero,_ISR_Handler_exit
- nop
-
- /*
- * call _Thread_Dispatch() or prepare to return to _ISR_Dispatch
- */
- jal _Thread_Dispatch
- nop
- /*
- * prepare to get out of interrupt
- * return from interrupt (maybe to _ISR_Dispatch)
- *
- * LABEL "exit interrupt (simple case):
- * prepare to get out of interrupt
- * return from interrupt
- */
-_ISR_Handler_exit:
- ld ra,32(sp)
- stackadd sp,sp,40
-
-/* restore interrupt context from stack */
- lreg k0, R_MDLO*R_SZ(sp)
- mtlo k0
- lreg k0, R_MDHI*R_SZ(sp)
- lreg a2, R_A2*R_SZ(sp)
- mthi k0
- lreg a3, R_A3*R_SZ(sp)
- lreg t0, R_T0*R_SZ(sp)
- lreg t1, R_T1*R_SZ(sp)
- lreg t2, R_T2*R_SZ(sp)
- lreg t3, R_T3*R_SZ(sp)
- lreg t4, R_T4*R_SZ(sp)
- lreg t5, R_T5*R_SZ(sp)
- lreg t6, R_T6*R_SZ(sp)
- lreg t7, R_T7*R_SZ(sp)
- lreg t8, R_T8*R_SZ(sp)
- lreg t9, R_T9*R_SZ(sp)
- lreg gp, R_GP*R_SZ(sp)
- lreg fp, R_FP*R_SZ(sp)
- lreg ra, R_RA*R_SZ(sp)
- lreg a0, R_A0*R_SZ(sp)
- lreg a1, R_A1*R_SZ(sp)
- lreg v1, R_V1*R_SZ(sp)
- lreg v0, R_V0*R_SZ(sp)
- .set noat
- lreg AT, R_AT*R_SZ(sp)
- .set at
-
- stackadd sp,sp,EXCP_STACK_SIZE /* store ra on the stack */
-
-#if USE_IDTKIT
-/* we handled exception, so return non-zero value */
- li v0,1
-#endif
-
-_ISR_Handler_quick_exit:
-#ifdef USE_IDTKIT
- j ra
-#else
- eret
-#endif
- nop
-
-_ISR_Handler_prom_exit:
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
- .set reorder
-
-ENDFRAME(_ISR_Handler)
-
-
-FRAME(mips_enable_interrupts,sp,0,ra)
- mfc0 t0,C0_SR /* get status reg */
- nop
- or t0,t0,a0
- mtc0 t0,C0_SR /* save updated status reg */
- j ra
- nop
-ENDFRAME(mips_enable_interrupts)
-
-FRAME(mips_disable_interrupts,sp,0,ra)
- mfc0 v0,C0_SR /* get status reg */
- li t1,SR_IMASK /* t1 = load interrupt mask word */
- not t0,t1 /* t0 = ~t1 */
- and t0,v0 /* clear imask bits */
- mtc0 t0,C0_SR /* save status reg */
- and v0,t1 /* mask return value (only return imask bits) */
- jr ra
- nop
-ENDFRAME(mips_disable_interrupts)
-
-FRAME(mips_enable_global_interrupts,sp,0,ra)
- mfc0 t0,C0_SR /* get status reg */
- nop
- ori t0,SR_IE
- mtc0 t0,C0_SR /* save updated status reg */
- j ra
- nop
-ENDFRAME(mips_enable_global_interrupts)
-
-FRAME(mips_disable_global_interrupts,sp,0,ra)
- li t1,SR_IE
- mfc0 t0,C0_SR /* get status reg */
- not t1
- and t0,t1
- mtc0 t0,C0_SR /* save updated status reg */
- j ra
- nop
-ENDFRAME(mips_disable_global_interrupts)
-
-/* return the value of the status register in v0. Used for debugging */
-FRAME(mips_get_sr,sp,0,ra)
- mfc0 v0,C0_SR
- j ra
- nop
-ENDFRAME(mips_get_sr)
-
-FRAME(mips_break,sp,0,ra)
-#if 1
- break 0x0
- j mips_break
-#else
- j ra
-#endif
- nop
-ENDFRAME(mips_break)
-
-/*PAGE
- *
- * _CPU_Internal_threads_Idle_thread_body
- *
- * NOTES:
- *
- * 1. This is the same as the regular CPU independent algorithm.
- *
- * 2. If you implement this using a "halt", "idle", or "shutdown"
- * instruction, then don't forget to put it in an infinite loop.
- *
- * 3. Be warned. Some processors with onboard DMA have been known
- * to stop the DMA if the CPU were put in IDLE mode. This might
- * also be a problem with other on-chip peripherals. So use this
- * hook with caution.
- */
-
-FRAME(_CPU_Thread_Idle_body,sp,0,ra)
- wait /* enter low power mode */
- j _CPU_Thread_Idle_body
- nop
-ENDFRAME(_CPU_Thread_Idle_body)
-
-#define VEC_CODE_LENGTH 10*4
-
-/**************************************************************************
-**
-** init_exc_vecs() - moves the exception code into the addresses
-** reserved for exception vectors
-**
-** UTLB Miss exception vector at address 0x80000000
-**
-** General exception vector at address 0x80000080
-**
-** RESET exception vector is at address 0xbfc00000
-**
-***************************************************************************/
-
-#define INITEXCFRM ((2*4)+4) /* ra + 2 arguments */
-FRAME(init_exc_vecs,sp,0,ra)
-/* This code yanked from SIM */
-#if defined(CPU_R3000)
- .set noreorder
- la t1,exc_utlb_code
- la t2,exc_norm_code
- li t3,UT_VEC
- li t4,E_VEC
- li t5,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- lw t7,0(t2)
- sw t6,0(t3)
- sw t7,0(t4)
- addiu t1,4
- addiu t3,4
- addiu t4,4
- subu t5,4
- bne t5,zero,1b
- addiu t2,4
- move t5,ra # assumes clear_cache doesnt use t5
- li a0,UT_VEC
- jal clear_cache
- li a1,VEC_CODE_LENGTH
- nop
- li a0,E_VEC
- jal clear_cache
- li a1,VEC_CODE_LENGTH
- move ra,t5 # restore ra
- j ra
- nop
- .set reorder
-#endif
-#if defined(CPU_R4000)
- .set reorder
- move t5,ra # assumes clear_cache doesnt use t5
-
- /* TLB exception vector */
- la t1,exc_tlb_code
- li t2,T_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- li a0,T_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- la t1,exc_xtlb_code
- li t2,X_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- /* extended TLB exception vector */
- li a0,X_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- /* cache error exception vector */
- la t1,exc_cache_code
- li t2,C_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- li a0,C_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- /* normal exception vector */
- la t1,exc_norm_code
- li t2,E_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- li a0,E_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- move ra,t5 # restore ra
- j ra
-#endif
-ENDFRAME(init_exc_vecs)
-
-
-#if defined(CPU_R4000)
-FRAME(exc_tlb_code,sp,0,ra)
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
-ENDFRAME(exc_tlb_code)
-
-
-FRAME(exc_xtlb_code,sp,0,ra)
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
-ENDFRAME(exc_xtlb_code)
-
-
-FRAME(exc_cache_code,sp,0,ra)
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
-ENDFRAME(exc_cache_code)
-
-
-FRAME(exc_norm_code,sp,0,ra)
- la k0, _ISR_Handler /* generic external int hndlr */
- j k0
- nop
- subu sp, EXCP_STACK_SIZE /* set up local stack frame */
-ENDFRAME(exc_norm_code)
-#endif
-
-/**************************************************************************
-**
-** enable_int(mask) - enables interrupts - mask is positioned so it only
-** needs to be or'ed into the status reg. This
-** also does some other things !!!! caution should
-** be used if invoking this while in the middle
-** of a debugging session where the client may have
-** nested interrupts.
-**
-****************************************************************************/
-FRAME(enable_int,sp,0,ra)
- .set noreorder
- mfc0 t0,C0_SR
- or a0,1
- or t0,a0
- mtc0 t0,C0_SR
- j ra
- nop
- .set reorder
-ENDFRAME(enable_int)
-
-
-/***************************************************************************
-**
-** disable_int(mask) - disable the interrupt - mask is the complement
-** of the bits to be cleared - i.e. to clear ext int
-** 5 the mask would be - 0xffff7fff
-**
-****************************************************************************/
-FRAME(disable_int,sp,0,ra)
- .set noreorder
- mfc0 t0,C0_SR
- nop
- and t0,a0
- mtc0 t0,C0_SR
- j ra
- nop
-ENDFRAME(disable_int)
-
-
diff --git a/cpukit/score/cpu/mips/idtcpu.h b/cpukit/score/cpu/mips/idtcpu.h
deleted file mode 100644
index f921e85ef6..0000000000
--- a/cpukit/score/cpu/mips/idtcpu.h
+++ /dev/null
@@ -1,440 +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 defined(CPU_R4000)
-#define KSBASE 0xe0000000
-#define KSSIZE 0x20000000
-#endif
-
-#define KUBASE 0
-#define KUSIZE 0x80000000
-
-/*
-** Exception Vectors
-*/
-#if defined(CPU_R3000)
-#define UT_VEC K0BASE /* utlbmiss vector */
-#define E_VEC (K0BASE+0x80) /* exception vevtor */
-#endif
-#if defined(CPU_R4000)
-#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 */
-#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 defined(CPU_R4000)
-/* 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
-
-#ifndef wait
-#define wait .word 0x42000020
-#endif wait
-
-#endif
-
-/*
-** TLB resource defines
-*/
-#if defined(CPU_R3000)
-#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 defined(CPU_R4000)
-#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<<TLBLO_CSHIFT)
-#define TLBLO_NONCOHERENT (CFG_C_NONCOHERENT<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTXCL (CFG_C_COHERENTXCL<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTXCLW (CFG_C_COHERENTXCLW<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTUPD (CFG_C_COHERENTUPD<<TLBLO_CSHIFT)
-
-#define TLBINX_PROBE 0x80000000
-#define TLBINX_INXMASK 0x0000003f
-
-#define TLBRAND_RANDMASK 0x0000003f
-
-#define TLBCTXT_BASEMASK 0xff800000
-#define TLBCTXT_BASESHIFT 23
-
-#define TLBCTXT_VPN2MASK 0x007ffff0
-#define TLBCTXT_VPN2SHIFT 4
-
-#define TLBPGMASK_MASK 0x01ffe000
-#endif
-
-#if defined(CPU_R3000)
-#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_BEV 0x00400000 /* use boot exception vectors */
-
-/* Cache control bits */
-#define SR_TS 0x00200000 /* TLB shutdown */
-#define SR_PE 0x00100000 /* cache parity error */
-#define SR_CM 0x00080000 /* cache miss */
-#define SR_PZ 0x00040000 /* cache parity zero */
-#define SR_SWC 0x00020000 /* swap cache */
-#define SR_ISC 0x00010000 /* Isolate data cache */
-
-/*
-** 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_KUO 0x00000020 /* old kernel/user, 0 => 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 defined(CPU_R4000)
-#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_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 defined(CPU_R3000)
-#define C0_TLBLO $2 /* tlb entry low */
-#endif
-#if defined(CPU_R4000)
-#define C0_TLBLO0 $2 /* tlb entry low 0 */
-#define C0_TLBLO1 $3 /* tlb entry low 1 */
-#endif
-
-#define C0_CTXT $4 /* tlb context */
-
-#if defined(CPU_R4000)
-#define C0_PAGEMASK $5 /* tlb page mask */
-#define C0_WIRED $6 /* number of wired tlb entries */
-#endif
-
-#define C0_BADVADDR $8 /* bad virtual address */
-
-#if defined(CPU_R4000)
-#define C0_COUNT $9 /* cycle count */
-#endif
-
-#define C0_TLBHI $10 /* tlb entry hi */
-
-#if defined(CPU_R4000)
-#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 defined(CPU_R3000)
-#define C0_CONFIG $3 /* configuration register R3081*/
-#endif
-
-#if defined(CPU_R4000)
-#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
-
-#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/iregdef.h b/cpukit/score/cpu/mips/iregdef.h
deleted file mode 100644
index f0953da852..0000000000
--- a/cpukit/score/cpu/mips/iregdef.h
+++ /dev/null
@@ -1,325 +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 save reg area
-*/
-#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_F0 32
-#define R_F1 33
-#define R_F2 34
-#define R_F3 35
-#define R_F4 36
-#define R_F5 37
-#define R_F6 38
-#define R_F7 39
-#define R_F8 40
-#define R_F9 41
-#define R_F10 42
-#define R_F11 43
-#define R_F12 44
-#define R_F13 45
-#define R_F14 46
-#define R_F15 47
-#define R_F16 48
-#define R_F17 49
-#define R_F18 50
-#define R_F19 51
-#define R_F20 52
-#define R_F21 53
-#define R_F22 54
-#define R_F23 55
-#define R_F24 56
-#define R_F25 57
-#define R_F26 58
-#define R_F27 59
-#define R_F28 60
-#define R_F29 61
-#define R_F30 62
-#define R_F31 63
-#define NCLIENTREGS 64
-#define R_EPC 64
-#define R_MDHI 65
-#define R_MDLO 66
-#define R_SR 67
-#define R_CAUSE 68
-#define R_TLBHI 69
-#if defined(CPU_R3000)
-#define R_TLBLO 70
-#endif
-#if defined(CPU_R4000)
-#define R_TLBLO0 70
-#endif
-#define R_BADVADDR 71
-#define R_INX 72
-#define R_RAND 73
-#define R_CTXT 74
-#define R_EXCTYPE 75
-#define R_MODE 76
-#define R_PRID 77
-#define R_FCSR 78
-#define R_FEIR 79
-#if defined(CPU_R3000)
-#define NREGS 80
-#endif
-#if defined(CPU_R4000)
-#define R_TLBLO1 80
-#define R_PAGEMASK 81
-#define R_WIRED 82
-#define R_COUNT 83
-#define R_COMPARE 84
-#define R_CONFIG 85
-#define R_LLADDR 86
-#define R_WATCHLO 87
-#define R_WATCHHI 88
-#define R_ECC 89
-#define R_CACHEERR 90
-#define R_TAGLO 91
-#define R_TAGHI 92
-#define R_ERRPC 93
-#define R_XCTXT 94 /* Ketan added from SIM64bit */
-
-#define NREGS 95
-#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
-
-/* Ketan added the following */
-#ifdef CPU_R3000
-#define sreg sw
-#define lreg lw
-#define rmfc0 mfc0
-#define rmtc0 mtc0
-#define R_SZ 4
-#endif CPU_R3000
-
-#ifdef CPU_R4000
-#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 CPU_R4000
-/* Ketan till here */
-
-#endif /* __IREGDEF_H__ */
-
diff --git a/cpukit/score/cpu/mips/rtems/asm.h b/cpukit/score/cpu/mips/rtems/asm.h
deleted file mode 100644
index fccd89069f..0000000000
--- a/cpukit/score/cpu/mips/rtems/asm.h
+++ /dev/null
@@ -1,102 +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 <rtems/score/targopts.h>
-#include <rtems/score/no_cpu.h>
-
-/*
- * 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/mips/rtems/mips/idtcpu.h b/cpukit/score/cpu/mips/rtems/mips/idtcpu.h
deleted file mode 100644
index f921e85ef6..0000000000
--- a/cpukit/score/cpu/mips/rtems/mips/idtcpu.h
+++ /dev/null
@@ -1,440 +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 defined(CPU_R4000)
-#define KSBASE 0xe0000000
-#define KSSIZE 0x20000000
-#endif
-
-#define KUBASE 0
-#define KUSIZE 0x80000000
-
-/*
-** Exception Vectors
-*/
-#if defined(CPU_R3000)
-#define UT_VEC K0BASE /* utlbmiss vector */
-#define E_VEC (K0BASE+0x80) /* exception vevtor */
-#endif
-#if defined(CPU_R4000)
-#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 */
-#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 defined(CPU_R4000)
-/* 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
-
-#ifndef wait
-#define wait .word 0x42000020
-#endif wait
-
-#endif
-
-/*
-** TLB resource defines
-*/
-#if defined(CPU_R3000)
-#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 defined(CPU_R4000)
-#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<<TLBLO_CSHIFT)
-#define TLBLO_NONCOHERENT (CFG_C_NONCOHERENT<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTXCL (CFG_C_COHERENTXCL<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTXCLW (CFG_C_COHERENTXCLW<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTUPD (CFG_C_COHERENTUPD<<TLBLO_CSHIFT)
-
-#define TLBINX_PROBE 0x80000000
-#define TLBINX_INXMASK 0x0000003f
-
-#define TLBRAND_RANDMASK 0x0000003f
-
-#define TLBCTXT_BASEMASK 0xff800000
-#define TLBCTXT_BASESHIFT 23
-
-#define TLBCTXT_VPN2MASK 0x007ffff0
-#define TLBCTXT_VPN2SHIFT 4
-
-#define TLBPGMASK_MASK 0x01ffe000
-#endif
-
-#if defined(CPU_R3000)
-#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_BEV 0x00400000 /* use boot exception vectors */
-
-/* Cache control bits */
-#define SR_TS 0x00200000 /* TLB shutdown */
-#define SR_PE 0x00100000 /* cache parity error */
-#define SR_CM 0x00080000 /* cache miss */
-#define SR_PZ 0x00040000 /* cache parity zero */
-#define SR_SWC 0x00020000 /* swap cache */
-#define SR_ISC 0x00010000 /* Isolate data cache */
-
-/*
-** 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_KUO 0x00000020 /* old kernel/user, 0 => 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 defined(CPU_R4000)
-#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_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 defined(CPU_R3000)
-#define C0_TLBLO $2 /* tlb entry low */
-#endif
-#if defined(CPU_R4000)
-#define C0_TLBLO0 $2 /* tlb entry low 0 */
-#define C0_TLBLO1 $3 /* tlb entry low 1 */
-#endif
-
-#define C0_CTXT $4 /* tlb context */
-
-#if defined(CPU_R4000)
-#define C0_PAGEMASK $5 /* tlb page mask */
-#define C0_WIRED $6 /* number of wired tlb entries */
-#endif
-
-#define C0_BADVADDR $8 /* bad virtual address */
-
-#if defined(CPU_R4000)
-#define C0_COUNT $9 /* cycle count */
-#endif
-
-#define C0_TLBHI $10 /* tlb entry hi */
-
-#if defined(CPU_R4000)
-#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 defined(CPU_R3000)
-#define C0_CONFIG $3 /* configuration register R3081*/
-#endif
-
-#if defined(CPU_R4000)
-#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
-
-#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 f0953da852..0000000000
--- a/cpukit/score/cpu/mips/rtems/mips/iregdef.h
+++ /dev/null
@@ -1,325 +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 save reg area
-*/
-#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_F0 32
-#define R_F1 33
-#define R_F2 34
-#define R_F3 35
-#define R_F4 36
-#define R_F5 37
-#define R_F6 38
-#define R_F7 39
-#define R_F8 40
-#define R_F9 41
-#define R_F10 42
-#define R_F11 43
-#define R_F12 44
-#define R_F13 45
-#define R_F14 46
-#define R_F15 47
-#define R_F16 48
-#define R_F17 49
-#define R_F18 50
-#define R_F19 51
-#define R_F20 52
-#define R_F21 53
-#define R_F22 54
-#define R_F23 55
-#define R_F24 56
-#define R_F25 57
-#define R_F26 58
-#define R_F27 59
-#define R_F28 60
-#define R_F29 61
-#define R_F30 62
-#define R_F31 63
-#define NCLIENTREGS 64
-#define R_EPC 64
-#define R_MDHI 65
-#define R_MDLO 66
-#define R_SR 67
-#define R_CAUSE 68
-#define R_TLBHI 69
-#if defined(CPU_R3000)
-#define R_TLBLO 70
-#endif
-#if defined(CPU_R4000)
-#define R_TLBLO0 70
-#endif
-#define R_BADVADDR 71
-#define R_INX 72
-#define R_RAND 73
-#define R_CTXT 74
-#define R_EXCTYPE 75
-#define R_MODE 76
-#define R_PRID 77
-#define R_FCSR 78
-#define R_FEIR 79
-#if defined(CPU_R3000)
-#define NREGS 80
-#endif
-#if defined(CPU_R4000)
-#define R_TLBLO1 80
-#define R_PAGEMASK 81
-#define R_WIRED 82
-#define R_COUNT 83
-#define R_COMPARE 84
-#define R_CONFIG 85
-#define R_LLADDR 86
-#define R_WATCHLO 87
-#define R_WATCHHI 88
-#define R_ECC 89
-#define R_CACHEERR 90
-#define R_TAGLO 91
-#define R_TAGHI 92
-#define R_ERRPC 93
-#define R_XCTXT 94 /* Ketan added from SIM64bit */
-
-#define NREGS 95
-#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
-
-/* Ketan added the following */
-#ifdef CPU_R3000
-#define sreg sw
-#define lreg lw
-#define rmfc0 mfc0
-#define rmtc0 mtc0
-#define R_SZ 4
-#endif CPU_R3000
-
-#ifdef CPU_R4000
-#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 CPU_R4000
-/* Ketan till here */
-
-#endif /* __IREGDEF_H__ */
-
diff --git a/cpukit/score/cpu/mips64orion/asm.h b/cpukit/score/cpu/mips64orion/asm.h
deleted file mode 100644
index fccd89069f..0000000000
--- a/cpukit/score/cpu/mips64orion/asm.h
+++ /dev/null
@@ -1,102 +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 <rtems/score/targopts.h>
-#include <rtems/score/no_cpu.h>
-
-/*
- * 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/mips64orion/cpu.c b/cpukit/score/cpu/mips64orion/cpu.c
deleted file mode 100644
index 4617be460d..0000000000
--- a/cpukit/score/cpu/mips64orion/cpu.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Mips CPU Dependent Source
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu.c:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)cpu.c 08/20/96 1.5\n";
- */
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/wkspace.h>
-
-
-ISR_Handler_entry _ISR_Vector_table[ ISR_NUMBER_OF_VECTORS ];
-
-/* _CPU_Initialize
- *
- * This routine performs processor dependent initialization.
- *
- * INPUT PARAMETERS:
- * cpu_table - CPU table to initialize
- * thread_dispatch - address of disptaching routine
- */
-
-
-void null_handler( void )
-{
-}
-
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch) /* ignored on this CPU */
-)
-{
- unsigned int i = ISR_NUMBER_OF_VECTORS;
-
- while ( i-- )
- {
- _ISR_Vector_table[i] = (ISR_Handler_entry)null_handler;
- }
-
- /*
- * The thread_dispatch argument is the address of the entry point
- * for the routine called at the end of an ISR once it has been
- * decided a context switch is necessary. On some compilation
- * systems it is difficult to call a high-level language routine
- * from assembly. This allows us to trick these systems.
- *
- * If you encounter this problem save the entry point in a CPU
- * dependent variable.
- */
-
- _CPU_Thread_dispatch_pointer = thread_dispatch;
-
- /*
- * If there is not an easy way to initialize the FP context
- * during Context_Initialize, then it is usually easier to
- * save an "uninitialized" FP context here and copy it to
- * the task's during Context_Initialize.
- */
-
- /* FP context initialization support goes here */
-
- _CPU_Table = *cpu_table;
-
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-#if 0 /* located in cpu_asm.S */
-unsigned32 _CPU_ISR_Get_level( void )
-{
- /*
- * This routine returns the current interrupt level.
- */
-}
-#endif
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- /*
- * This is where we install the interrupt handler into the "raw" interrupt
- * table used by the CPU to dispatch interrupt handlers.
- */
-
-#if 0 /* not necessary */
-/* use IDT/Sim to set interrupt vector. Needed to co-exist with debugger. */
- add_ext_int_func( vector, new_handler );
-#endif
-}
-
-/*PAGE
- *
- * _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
-)
-{
- *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.
- */
-
- _CPU_ISR_install_raw_handler( vector, _ISR_Handler, old_handler );
-
- /*
- * 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;
-}
-
-/*PAGE
- *
- * _CPU_Install_interrupt_stack
- */
-
-void _CPU_Install_interrupt_stack( void )
-{
-/* we don't support this yet */
-}
-
-/*PAGE
- *
- * _CPU_Internal_threads_Idle_thread_body
- *
- * NOTES:
- *
- * 1. This is the same as the regular CPU independent algorithm.
- *
- * 2. If you implement this using a "halt", "idle", or "shutdown"
- * instruction, then don't forget to put it in an infinite loop.
- *
- * 3. Be warned. Some processors with onboard DMA have been known
- * to stop the DMA if the CPU were put in IDLE mode. This might
- * also be a problem with other on-chip peripherals. So use this
- * hook with caution.
- */
-
-#if 0 /* located in cpu_asm.S */
-void _CPU_Thread_Idle_body( void )
-{
-
- for( ; ; )
- /* insert your "halt" instruction here */ ;
-}
-#endif
-
-extern void mips_break( int error );
-
-#include <stdio.h>
-
-void mips_fatal_error( int error )
-{
- printf("fatal error 0x%x %d\n",error,error);
- mips_break( error );
-}
diff --git a/cpukit/score/cpu/mips64orion/cpu_asm.S b/cpukit/score/cpu/mips64orion/cpu_asm.S
deleted file mode 100644
index 7dcb8fbda7..0000000000
--- a/cpukit/score/cpu/mips64orion/cpu_asm.S
+++ /dev/null
@@ -1,972 +0,0 @@
-/* cpu_asm.S
- *
- * This file contains the basic algorithms for all assembly code used
- * in an specific CPU port of RTEMS. These algorithms must be implemented
- * in assembly language
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu_asm.s:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-/* @(#)cpu_asm.S 08/20/96 1.15 */
-
-#include "cpu_asm.h"
-
-#include "iregdef.h"
-#include "idtcpu.h"
-
-#define FRAME(name,frm_reg,offset,ret_reg) \
- .globl name; \
- .ent name; \
-name:; \
- .frame frm_reg,offset,ret_reg
-#define ENDFRAME(name) \
- .end name
-
-
-#define EXCP_STACK_SIZE (NREGS*R_SZ)
-
-#if __ghs__
-#define sd sw
-#define ld lw
-#define dmtc0 mtc0
-#define dsll sll
-#define dmfc0 mfc0
-#endif
-
-#if 1 /* 32 bit unsigned32 types */
-#define sint sw
-#define lint lw
-#define stackadd addiu
-#define intadd addu
-#define SZ_INT 4
-#define SZ_INT_POW2 2
-#else /* 64 bit unsigned32 types */
-#define sint dw
-#define lint dw
-#define stackadd daddiu
-#define intadd daddu
-#define SZ_INT 8
-#define SZ_INT_POW2 3
-#endif
-
-#ifdef __GNUC__
-#define EXTERN(x,size) .extern x,size
-#else
-#define EXTERN(x,size)
-#endif
-
-/* NOTE: these constants must match the Context_Control structure in cpu.h */
-#define S0_OFFSET 0
-#define S1_OFFSET 1
-#define S2_OFFSET 2
-#define S3_OFFSET 3
-#define S4_OFFSET 4
-#define S5_OFFSET 5
-#define S6_OFFSET 6
-#define S7_OFFSET 7
-#define SP_OFFSET 8
-#define FP_OFFSET 9
-#define RA_OFFSET 10
-#define C0_SR_OFFSET 11
-#define C0_EPC_OFFSET 12
-
-/* NOTE: these constants must match the Context_Control_fp structure in cpu.h */
-#define FP0_OFFSET 0
-#define FP1_OFFSET 1
-#define FP2_OFFSET 2
-#define FP3_OFFSET 3
-#define FP4_OFFSET 4
-#define FP5_OFFSET 5
-#define FP6_OFFSET 6
-#define FP7_OFFSET 7
-#define FP8_OFFSET 8
-#define FP9_OFFSET 9
-#define FP10_OFFSET 10
-#define FP11_OFFSET 11
-#define FP12_OFFSET 12
-#define FP13_OFFSET 13
-#define FP14_OFFSET 14
-#define FP15_OFFSET 15
-#define FP16_OFFSET 16
-#define FP17_OFFSET 17
-#define FP18_OFFSET 18
-#define FP19_OFFSET 19
-#define FP20_OFFSET 20
-#define FP21_OFFSET 21
-#define FP22_OFFSET 22
-#define FP23_OFFSET 23
-#define FP24_OFFSET 24
-#define FP25_OFFSET 25
-#define FP26_OFFSET 26
-#define FP27_OFFSET 27
-#define FP28_OFFSET 28
-#define FP29_OFFSET 29
-#define FP30_OFFSET 30
-#define FP31_OFFSET 31
-
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-#if 0
-unsigned32 _CPU_ISR_Get_level( void )
-{
- /*
- * This routine returns the current interrupt level.
- */
-}
-#endif
-/* return the current exception level for the 4650 */
-FRAME(_CPU_ISR_Get_level,sp,0,ra)
- mfc0 v0,C0_SR
- nop
- andi v0,SR_EXL
- srl v0,1
- j ra
-ENDFRAME(_CPU_ISR_Get_level)
-
-FRAME(_CPU_ISR_Set_level,sp,0,ra)
- nop
- mfc0 a0,C0_SR
- nop
- andi a0,SR_EXL
- beqz a0,_CPU_ISR_Set_1 /* normalize a0 */
- nop
- li a0,1
-_CPU_ISR_Set_1:
- beq v0,a0,_CPU_ISR_Set_exit /* if (current_level != new_level ) */
- nop
- bnez a0,_CPU_ISR_Set_2
- nop
- nop
- mfc0 t0,C0_SR
- nop
- li t1,~SR_EXL
- and t0,t1
- nop
- mtc0 t0,C0_SR /* disable exception level */
- nop
- j ra
- nop
-_CPU_ISR_Set_2:
- nop
- mfc0 t0,C0_SR
- nop
- li t1,~SR_IE
- and t0,t1
- nop
- mtc0 t0,C0_SR /* first disable ie bit (recommended) */
- nop
- ori t0,SR_EXL|SR_IE /* enable exception level */
- nop
- mtc0 t0,C0_SR
- nop
-_CPU_ISR_Set_exit:
- j ra
- nop
-ENDFRAME(_CPU_ISR_Set_level)
-
-/*
- * _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.
- */
-
-/* void _CPU_Context_save_fp(
- * void **fp_context_ptr
- * )
- * {
- * }
- */
-
-FRAME(_CPU_Context_save_fp,sp,0,ra)
- .set noat
- ld a1,(a0)
- swc1 $f0,FP0_OFFSET*4(a1)
- swc1 $f1,FP1_OFFSET*4(a1)
- swc1 $f2,FP2_OFFSET*4(a1)
- swc1 $f3,FP3_OFFSET*4(a1)
- swc1 $f4,FP4_OFFSET*4(a1)
- swc1 $f5,FP5_OFFSET*4(a1)
- swc1 $f6,FP6_OFFSET*4(a1)
- swc1 $f7,FP7_OFFSET*4(a1)
- swc1 $f8,FP8_OFFSET*4(a1)
- swc1 $f9,FP9_OFFSET*4(a1)
- swc1 $f10,FP10_OFFSET*4(a1)
- swc1 $f11,FP11_OFFSET*4(a1)
- swc1 $f12,FP12_OFFSET*4(a1)
- swc1 $f13,FP13_OFFSET*4(a1)
- swc1 $f14,FP14_OFFSET*4(a1)
- swc1 $f15,FP15_OFFSET*4(a1)
- swc1 $f16,FP16_OFFSET*4(a1)
- swc1 $f17,FP17_OFFSET*4(a1)
- swc1 $f18,FP18_OFFSET*4(a1)
- swc1 $f19,FP19_OFFSET*4(a1)
- swc1 $f20,FP20_OFFSET*4(a1)
- swc1 $f21,FP21_OFFSET*4(a1)
- swc1 $f22,FP22_OFFSET*4(a1)
- swc1 $f23,FP23_OFFSET*4(a1)
- swc1 $f24,FP24_OFFSET*4(a1)
- swc1 $f25,FP25_OFFSET*4(a1)
- swc1 $f26,FP26_OFFSET*4(a1)
- swc1 $f27,FP27_OFFSET*4(a1)
- swc1 $f28,FP28_OFFSET*4(a1)
- swc1 $f29,FP29_OFFSET*4(a1)
- swc1 $f30,FP30_OFFSET*4(a1)
- swc1 $f31,FP31_OFFSET*4(a1)
- j ra
- nop
- .set at
-ENDFRAME(_CPU_Context_save_fp)
-
-/*
- * _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.
- */
-
-/* void _CPU_Context_restore_fp(
- * void **fp_context_ptr
- * )
- * {
- * }
- */
-
-FRAME(_CPU_Context_restore_fp,sp,0,ra)
- .set noat
- ld a1,(a0)
- lwc1 $f0,FP0_OFFSET*4(a1)
- lwc1 $f1,FP1_OFFSET*4(a1)
- lwc1 $f2,FP2_OFFSET*4(a1)
- lwc1 $f3,FP3_OFFSET*4(a1)
- lwc1 $f4,FP4_OFFSET*4(a1)
- lwc1 $f5,FP5_OFFSET*4(a1)
- lwc1 $f6,FP6_OFFSET*4(a1)
- lwc1 $f7,FP7_OFFSET*4(a1)
- lwc1 $f8,FP8_OFFSET*4(a1)
- lwc1 $f9,FP9_OFFSET*4(a1)
- lwc1 $f10,FP10_OFFSET*4(a1)
- lwc1 $f11,FP11_OFFSET*4(a1)
- lwc1 $f12,FP12_OFFSET*4(a1)
- lwc1 $f13,FP13_OFFSET*4(a1)
- lwc1 $f14,FP14_OFFSET*4(a1)
- lwc1 $f15,FP15_OFFSET*4(a1)
- lwc1 $f16,FP16_OFFSET*4(a1)
- lwc1 $f17,FP17_OFFSET*4(a1)
- lwc1 $f18,FP18_OFFSET*4(a1)
- lwc1 $f19,FP19_OFFSET*4(a1)
- lwc1 $f20,FP20_OFFSET*4(a1)
- lwc1 $f21,FP21_OFFSET*4(a1)
- lwc1 $f22,FP22_OFFSET*4(a1)
- lwc1 $f23,FP23_OFFSET*4(a1)
- lwc1 $f24,FP24_OFFSET*4(a1)
- lwc1 $f25,FP25_OFFSET*4(a1)
- lwc1 $f26,FP26_OFFSET*4(a1)
- lwc1 $f27,FP27_OFFSET*4(a1)
- lwc1 $f28,FP28_OFFSET*4(a1)
- lwc1 $f29,FP29_OFFSET*4(a1)
- lwc1 $f30,FP30_OFFSET*4(a1)
- lwc1 $f31,FP31_OFFSET*4(a1)
- j ra
- nop
- .set at
-ENDFRAME(_CPU_Context_restore_fp)
-
-/* _CPU_Context_switch
- *
- * This routine performs a normal non-FP context switch.
- */
-
-/* void _CPU_Context_switch(
- * Context_Control *run,
- * Context_Control *heir
- * )
- * {
- * }
- */
-
-FRAME(_CPU_Context_switch,sp,0,ra)
-
- mfc0 t0,C0_SR
- li t1,~SR_IE
- sd t0,C0_SR_OFFSET*8(a0) /* save status register */
- and t0,t1
- mtc0 t0,C0_SR /* first disable ie bit (recommended) */
- ori t0,SR_EXL|SR_IE /* enable exception level to disable interrupts */
- mtc0 t0,C0_SR
-
- sd ra,RA_OFFSET*8(a0) /* save current context */
- sd sp,SP_OFFSET*8(a0)
- sd fp,FP_OFFSET*8(a0)
- sd s0,S0_OFFSET*8(a0)
- sd s1,S1_OFFSET*8(a0)
- sd s2,S2_OFFSET*8(a0)
- sd s3,S3_OFFSET*8(a0)
- sd s4,S4_OFFSET*8(a0)
- sd s5,S5_OFFSET*8(a0)
- sd s6,S6_OFFSET*8(a0)
- sd s7,S7_OFFSET*8(a0)
- dmfc0 t0,C0_EPC
- sd t0,C0_EPC_OFFSET*8(a0)
-
-_CPU_Context_switch_restore:
- ld s0,S0_OFFSET*8(a1) /* restore context */
- ld s1,S1_OFFSET*8(a1)
- ld s2,S2_OFFSET*8(a1)
- ld s3,S3_OFFSET*8(a1)
- ld s4,S4_OFFSET*8(a1)
- ld s5,S5_OFFSET*8(a1)
- ld s6,S6_OFFSET*8(a1)
- ld s7,S7_OFFSET*8(a1)
- ld fp,FP_OFFSET*8(a1)
- ld sp,SP_OFFSET*8(a1)
- ld ra,RA_OFFSET*8(a1)
- ld t0,C0_EPC_OFFSET*8(a1)
- dmtc0 t0,C0_EPC
- ld t0,C0_SR_OFFSET*8(a1)
- andi t0,SR_EXL
- bnez t0,_CPU_Context_1 /* set exception level from restore context */
- li t0,~SR_EXL
- mfc0 t1,C0_SR
- nop
- and t1,t0
- mtc0 t1,C0_SR
-_CPU_Context_1:
- j ra
- nop
-ENDFRAME(_CPU_Context_switch)
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally 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.
- */
-
-#if 0
-void _CPU_Context_restore(
- Context_Control *new_context
-)
-{
-}
-#endif
-
-FRAME(_CPU_Context_restore,sp,0,ra)
- dadd a1,a0,zero
- j _CPU_Context_switch_restore
- nop
-ENDFRAME(_CPU_Context_restore)
-
-EXTERN(_ISR_Nest_level, SZ_INT)
-EXTERN(_Thread_Dispatch_disable_level,SZ_INT)
-EXTERN(_Context_Switch_necessary,SZ_INT)
-EXTERN(_ISR_Signals_to_thread_executing,SZ_INT)
-.extern _Thread_Dispatch
-.extern _ISR_Vector_table
-
-/* void __ISR_Handler()
- *
- * This routine provides the RTEMS interrupt management.
- *
- */
-
-#if 0
-void _ISR_Handler()
-{
- /*
- * This discussion ignores a lot of the ugly details in a real
- * implementation such as saving enough registers/state to be
- * able to do something real. Keep in mind that the goal is
- * to invoke a user's ISR handler which is written in C and
- * uses a certain set of registers.
- *
- * Also note that the exact order is to a large extent flexible.
- * Hardware will dictate a sequence for a certain subset of
- * _ISR_Handler while requirements for setting
- */
-
- /*
- * At entry to "common" _ISR_Handler, the vector number must be
- * available. On some CPUs the hardware puts either the vector
- * number or the offset into the vector table for this ISR in a
- * known place. If the hardware does not give us this information,
- * then the assembly portion of RTEMS for this port will contain
- * a set of distinct interrupt entry points which somehow place
- * the vector number in a known place (which is safe if another
- * interrupt nests this one) and branches to _ISR_Handler.
- *
- */
-#endif
-FRAME(_ISR_Handler,sp,0,ra)
-.set noreorder
-#if USE_IDTKIT
-/* IDT/Kit incorrectly adds 4 to EPC before returning. This compensates */
- lreg k0, R_EPC*R_SZ(sp)
- daddiu k0,k0,-4
- sreg k0, R_EPC*R_SZ(sp)
- lreg k0, R_CAUSE*R_SZ(sp)
- li k1, ~CAUSE_BD
- and k0, k1
- sreg k0, R_CAUSE*R_SZ(sp)
-#endif
-
-/* save registers not already saved by IDT/sim */
- stackadd sp,sp,-EXCP_STACK_SIZE /* store ra on the stack */
-
- sreg ra, R_RA*R_SZ(sp)
- sreg v0, R_V0*R_SZ(sp)
- sreg v1, R_V1*R_SZ(sp)
- sreg a0, R_A0*R_SZ(sp)
- sreg a1, R_A1*R_SZ(sp)
- sreg a2, R_A2*R_SZ(sp)
- sreg a3, R_A3*R_SZ(sp)
- sreg t0, R_T0*R_SZ(sp)
- sreg t1, R_T1*R_SZ(sp)
- sreg t2, R_T2*R_SZ(sp)
- sreg t3, R_T3*R_SZ(sp)
- sreg t4, R_T4*R_SZ(sp)
- sreg t5, R_T5*R_SZ(sp)
- sreg t6, R_T6*R_SZ(sp)
- sreg t7, R_T7*R_SZ(sp)
- mflo k0
- sreg t8, R_T8*R_SZ(sp)
- sreg k0, R_MDLO*R_SZ(sp)
- sreg t9, R_T9*R_SZ(sp)
- mfhi k0
- sreg gp, R_GP*R_SZ(sp)
- sreg fp, R_FP*R_SZ(sp)
- sreg k0, R_MDHI*R_SZ(sp)
- .set noat
- sreg AT, R_AT*R_SZ(sp)
- .set at
-
- stackadd sp,sp,-40 /* store ra on the stack */
- sd ra,32(sp)
-
-/* determine if an interrupt generated this exception */
- mfc0 k0,C0_CAUSE
- and k1,k0,CAUSE_EXCMASK
- bnez k1,_ISR_Handler_prom_exit /* not an external interrupt, pass exception to Monitor */
- mfc0 k1,C0_SR
- and k0,k1
- and k0,CAUSE_IPMASK
- beq k0,zero,_ISR_Handler_quick_exit /* external interrupt not enabled, ignore */
- nop
-
- /*
- * save some or all context on stack
- * may need to save some special interrupt information for exit
- *
- * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- * if ( _ISR_Nest_level == 0 )
- * switch to software interrupt stack
- * #endif
- */
-#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- lint t0,_ISR_Nest_level
- beq t0, zero, _ISR_Handler_1
- nop
- /* switch stacks */
-_ISR_Handler_1:
-#else
- lint t0,_ISR_Nest_level
-#endif
- /*
- * _ISR_Nest_level++;
- */
- addi t0,t0,1
- sint t0,_ISR_Nest_level
- /*
- * _Thread_Dispatch_disable_level++;
- */
- lint t1,_Thread_Dispatch_disable_level
- addi t1,t1,1
- sint t1,_Thread_Dispatch_disable_level
-#if 0
- nop
- j _ISR_Handler_4
- nop
- /*
- * while ( interrupts_pending(cause_reg) ) {
- * vector = BITFIELD_TO_INDEX(cause_reg);
- * (*_ISR_Vector_table[ vector ])( vector );
- * }
- */
-_ISR_Handler_2:
-/* software interrupt priorities can be applied here */
- li t1,-1
-/* convert bit field into interrupt index */
-_ISR_Handler_3:
- andi t2,t0,1
- addi t1,1
- beql t2,zero,_ISR_Handler_3
- dsrl t0,1
- li t1,7
- dsll t1,3 /* convert index to byte offset (*8) */
- la t3,_ISR_Vector_table
- intadd t1,t3
- lint t1,(t1)
- jalr t1
- nop
- j _ISR_Handler_5
- nop
-_ISR_Handler_4:
- mfc0 t0,C0_CAUSE
- andi t0,CAUSE_IPMASK
- bne t0,zero,_ISR_Handler_2
- dsrl t0,t0,8
-_ISR_Handler_5:
-#else
- nop
- li t1,7
- dsll t1,t1,SZ_INT_POW2
- la t3,_ISR_Vector_table
- intadd t1,t3
- lint t1,(t1)
- jalr t1
- nop
-#endif
- /*
- * --_ISR_Nest_level;
- */
- lint t2,_ISR_Nest_level
- addi t2,t2,-1
- sint t2,_ISR_Nest_level
- /*
- * --_Thread_Dispatch_disable_level;
- */
- lint t1,_Thread_Dispatch_disable_level
- addi t1,t1,-1
- sint t1,_Thread_Dispatch_disable_level
- /*
- * if ( _Thread_Dispatch_disable_level || _ISR_Nest_level )
- * goto the label "exit interrupt (simple case)"
- */
- or t0,t2,t1
- bne t0,zero,_ISR_Handler_exit
- nop
- /*
- * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- * restore stack
- * #endif
- *
- * if ( !_Context_Switch_necessary && !_ISR_Signals_to_thread_executing )
- * goto the label "exit interrupt (simple case)"
- */
- lint t0,_Context_Switch_necessary
- lint t1,_ISR_Signals_to_thread_executing
- or t0,t0,t1
- beq t0,zero,_ISR_Handler_exit
- nop
-
- /*
- * call _Thread_Dispatch() or prepare to return to _ISR_Dispatch
- */
- jal _Thread_Dispatch
- nop
- /*
- * prepare to get out of interrupt
- * return from interrupt (maybe to _ISR_Dispatch)
- *
- * LABEL "exit interrupt (simple case):
- * prepare to get out of interrupt
- * return from interrupt
- */
-_ISR_Handler_exit:
- ld ra,32(sp)
- stackadd sp,sp,40
-
-/* restore interrupt context from stack */
- lreg k0, R_MDLO*R_SZ(sp)
- mtlo k0
- lreg k0, R_MDHI*R_SZ(sp)
- lreg a2, R_A2*R_SZ(sp)
- mthi k0
- lreg a3, R_A3*R_SZ(sp)
- lreg t0, R_T0*R_SZ(sp)
- lreg t1, R_T1*R_SZ(sp)
- lreg t2, R_T2*R_SZ(sp)
- lreg t3, R_T3*R_SZ(sp)
- lreg t4, R_T4*R_SZ(sp)
- lreg t5, R_T5*R_SZ(sp)
- lreg t6, R_T6*R_SZ(sp)
- lreg t7, R_T7*R_SZ(sp)
- lreg t8, R_T8*R_SZ(sp)
- lreg t9, R_T9*R_SZ(sp)
- lreg gp, R_GP*R_SZ(sp)
- lreg fp, R_FP*R_SZ(sp)
- lreg ra, R_RA*R_SZ(sp)
- lreg a0, R_A0*R_SZ(sp)
- lreg a1, R_A1*R_SZ(sp)
- lreg v1, R_V1*R_SZ(sp)
- lreg v0, R_V0*R_SZ(sp)
- .set noat
- lreg AT, R_AT*R_SZ(sp)
- .set at
-
- stackadd sp,sp,EXCP_STACK_SIZE /* store ra on the stack */
-
-#if USE_IDTKIT
-/* we handled exception, so return non-zero value */
- li v0,1
-#endif
-
-_ISR_Handler_quick_exit:
-#ifdef USE_IDTKIT
- j ra
-#else
- eret
-#endif
- nop
-
-_ISR_Handler_prom_exit:
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
- .set reorder
-
-ENDFRAME(_ISR_Handler)
-
-
-FRAME(mips_enable_interrupts,sp,0,ra)
- mfc0 t0,C0_SR /* get status reg */
- nop
- or t0,t0,a0
- mtc0 t0,C0_SR /* save updated status reg */
- j ra
- nop
-ENDFRAME(mips_enable_interrupts)
-
-FRAME(mips_disable_interrupts,sp,0,ra)
- mfc0 v0,C0_SR /* get status reg */
- li t1,SR_IMASK /* t1 = load interrupt mask word */
- not t0,t1 /* t0 = ~t1 */
- and t0,v0 /* clear imask bits */
- mtc0 t0,C0_SR /* save status reg */
- and v0,t1 /* mask return value (only return imask bits) */
- jr ra
- nop
-ENDFRAME(mips_disable_interrupts)
-
-FRAME(mips_enable_global_interrupts,sp,0,ra)
- mfc0 t0,C0_SR /* get status reg */
- nop
- ori t0,SR_IE
- mtc0 t0,C0_SR /* save updated status reg */
- j ra
- nop
-ENDFRAME(mips_enable_global_interrupts)
-
-FRAME(mips_disable_global_interrupts,sp,0,ra)
- li t1,SR_IE
- mfc0 t0,C0_SR /* get status reg */
- not t1
- and t0,t1
- mtc0 t0,C0_SR /* save updated status reg */
- j ra
- nop
-ENDFRAME(mips_disable_global_interrupts)
-
-/* return the value of the status register in v0. Used for debugging */
-FRAME(mips_get_sr,sp,0,ra)
- mfc0 v0,C0_SR
- j ra
- nop
-ENDFRAME(mips_get_sr)
-
-FRAME(mips_break,sp,0,ra)
-#if 1
- break 0x0
- j mips_break
-#else
- j ra
-#endif
- nop
-ENDFRAME(mips_break)
-
-/*PAGE
- *
- * _CPU_Internal_threads_Idle_thread_body
- *
- * NOTES:
- *
- * 1. This is the same as the regular CPU independent algorithm.
- *
- * 2. If you implement this using a "halt", "idle", or "shutdown"
- * instruction, then don't forget to put it in an infinite loop.
- *
- * 3. Be warned. Some processors with onboard DMA have been known
- * to stop the DMA if the CPU were put in IDLE mode. This might
- * also be a problem with other on-chip peripherals. So use this
- * hook with caution.
- */
-
-FRAME(_CPU_Thread_Idle_body,sp,0,ra)
- wait /* enter low power mode */
- j _CPU_Thread_Idle_body
- nop
-ENDFRAME(_CPU_Thread_Idle_body)
-
-#define VEC_CODE_LENGTH 10*4
-
-/**************************************************************************
-**
-** init_exc_vecs() - moves the exception code into the addresses
-** reserved for exception vectors
-**
-** UTLB Miss exception vector at address 0x80000000
-**
-** General exception vector at address 0x80000080
-**
-** RESET exception vector is at address 0xbfc00000
-**
-***************************************************************************/
-
-#define INITEXCFRM ((2*4)+4) /* ra + 2 arguments */
-FRAME(init_exc_vecs,sp,0,ra)
-/* This code yanked from SIM */
-#if defined(CPU_R3000)
- .set noreorder
- la t1,exc_utlb_code
- la t2,exc_norm_code
- li t3,UT_VEC
- li t4,E_VEC
- li t5,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- lw t7,0(t2)
- sw t6,0(t3)
- sw t7,0(t4)
- addiu t1,4
- addiu t3,4
- addiu t4,4
- subu t5,4
- bne t5,zero,1b
- addiu t2,4
- move t5,ra # assumes clear_cache doesnt use t5
- li a0,UT_VEC
- jal clear_cache
- li a1,VEC_CODE_LENGTH
- nop
- li a0,E_VEC
- jal clear_cache
- li a1,VEC_CODE_LENGTH
- move ra,t5 # restore ra
- j ra
- nop
- .set reorder
-#endif
-#if defined(CPU_R4000)
- .set reorder
- move t5,ra # assumes clear_cache doesnt use t5
-
- /* TLB exception vector */
- la t1,exc_tlb_code
- li t2,T_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- li a0,T_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- la t1,exc_xtlb_code
- li t2,X_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- /* extended TLB exception vector */
- li a0,X_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- /* cache error exception vector */
- la t1,exc_cache_code
- li t2,C_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- li a0,C_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- /* normal exception vector */
- la t1,exc_norm_code
- li t2,E_VEC |K1BASE
- li t3,VEC_CODE_LENGTH
-1:
- lw t6,0(t1)
- addiu t1,4
- subu t3,4
- sw t6,0(t2)
- addiu t2,4
- bne t3,zero,1b
-
- li a0,E_VEC
- li a1,VEC_CODE_LENGTH
- jal clear_cache
-
- move ra,t5 # restore ra
- j ra
-#endif
-ENDFRAME(init_exc_vecs)
-
-
-#if defined(CPU_R4000)
-FRAME(exc_tlb_code,sp,0,ra)
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
-ENDFRAME(exc_tlb_code)
-
-
-FRAME(exc_xtlb_code,sp,0,ra)
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
-ENDFRAME(exc_xtlb_code)
-
-
-FRAME(exc_cache_code,sp,0,ra)
-#ifdef CPU_R3000
- la k0, (R_VEC+((48)*8))
-#endif
-
-#ifdef CPU_R4000
- la k0, (R_VEC+((112)*8)) /* R4000 Sim's location is different */
-#endif
- j k0
- nop
-
-ENDFRAME(exc_cache_code)
-
-
-FRAME(exc_norm_code,sp,0,ra)
- la k0, _ISR_Handler /* generic external int hndlr */
- j k0
- nop
- subu sp, EXCP_STACK_SIZE /* set up local stack frame */
-ENDFRAME(exc_norm_code)
-#endif
-
-/**************************************************************************
-**
-** enable_int(mask) - enables interrupts - mask is positioned so it only
-** needs to be or'ed into the status reg. This
-** also does some other things !!!! caution should
-** be used if invoking this while in the middle
-** of a debugging session where the client may have
-** nested interrupts.
-**
-****************************************************************************/
-FRAME(enable_int,sp,0,ra)
- .set noreorder
- mfc0 t0,C0_SR
- or a0,1
- or t0,a0
- mtc0 t0,C0_SR
- j ra
- nop
- .set reorder
-ENDFRAME(enable_int)
-
-
-/***************************************************************************
-**
-** disable_int(mask) - disable the interrupt - mask is the complement
-** of the bits to be cleared - i.e. to clear ext int
-** 5 the mask would be - 0xffff7fff
-**
-****************************************************************************/
-FRAME(disable_int,sp,0,ra)
- .set noreorder
- mfc0 t0,C0_SR
- nop
- and t0,a0
- mtc0 t0,C0_SR
- j ra
- nop
-ENDFRAME(disable_int)
-
-
diff --git a/cpukit/score/cpu/mips64orion/cpu_asm.h b/cpukit/score/cpu/mips64orion/cpu_asm.h
deleted file mode 100644
index 5d78f39d7c..0000000000
--- a/cpukit/score/cpu/mips64orion/cpu_asm.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * cpu_asm.h
- *
- * Author: Craig Lebakken <craigl@transition.com>
- *
- * COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- * 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 Transition Networks not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * Transition Networks makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/exec/score/cpu/no_cpu/cpu_asm.h:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- *
- */
-/* @(#)cpu_asm.h 08/20/96 1.2 */
-
-#ifndef __CPU_ASM_h
-#define __CPU_ASM_h
-
-/* pull in the generated offsets */
-
-/* #include <rtems/score/offsets.h> */
-
-/*
- * Hardware General Registers
- */
-
-/* put something here */
-
-/*
- * 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
-
-/*
- * Hardware Control Registers
- */
-
-/* put something here */
-
-/*
- * Calling Convention
- */
-
-/* put something here */
-
-/*
- * Temporary registers
- */
-
-/* put something here */
-
-/*
- * Floating Point Registers - SW Conventions
- */
-
-/* put something here */
-
-/*
- * Temporary floating point registers
- */
-
-/* put something here */
-
-#endif
-
-/* end of file */
diff --git a/cpukit/score/cpu/mips64orion/idtcpu.h b/cpukit/score/cpu/mips64orion/idtcpu.h
deleted file mode 100644
index f921e85ef6..0000000000
--- a/cpukit/score/cpu/mips64orion/idtcpu.h
+++ /dev/null
@@ -1,440 +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 defined(CPU_R4000)
-#define KSBASE 0xe0000000
-#define KSSIZE 0x20000000
-#endif
-
-#define KUBASE 0
-#define KUSIZE 0x80000000
-
-/*
-** Exception Vectors
-*/
-#if defined(CPU_R3000)
-#define UT_VEC K0BASE /* utlbmiss vector */
-#define E_VEC (K0BASE+0x80) /* exception vevtor */
-#endif
-#if defined(CPU_R4000)
-#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 */
-#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 defined(CPU_R4000)
-/* 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
-
-#ifndef wait
-#define wait .word 0x42000020
-#endif wait
-
-#endif
-
-/*
-** TLB resource defines
-*/
-#if defined(CPU_R3000)
-#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 defined(CPU_R4000)
-#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<<TLBLO_CSHIFT)
-#define TLBLO_NONCOHERENT (CFG_C_NONCOHERENT<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTXCL (CFG_C_COHERENTXCL<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTXCLW (CFG_C_COHERENTXCLW<<TLBLO_CSHIFT)
-#define TLBLO_COHERENTUPD (CFG_C_COHERENTUPD<<TLBLO_CSHIFT)
-
-#define TLBINX_PROBE 0x80000000
-#define TLBINX_INXMASK 0x0000003f
-
-#define TLBRAND_RANDMASK 0x0000003f
-
-#define TLBCTXT_BASEMASK 0xff800000
-#define TLBCTXT_BASESHIFT 23
-
-#define TLBCTXT_VPN2MASK 0x007ffff0
-#define TLBCTXT_VPN2SHIFT 4
-
-#define TLBPGMASK_MASK 0x01ffe000
-#endif
-
-#if defined(CPU_R3000)
-#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_BEV 0x00400000 /* use boot exception vectors */
-
-/* Cache control bits */
-#define SR_TS 0x00200000 /* TLB shutdown */
-#define SR_PE 0x00100000 /* cache parity error */
-#define SR_CM 0x00080000 /* cache miss */
-#define SR_PZ 0x00040000 /* cache parity zero */
-#define SR_SWC 0x00020000 /* swap cache */
-#define SR_ISC 0x00010000 /* Isolate data cache */
-
-/*
-** 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_KUO 0x00000020 /* old kernel/user, 0 => 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 defined(CPU_R4000)
-#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_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 defined(CPU_R3000)
-#define C0_TLBLO $2 /* tlb entry low */
-#endif
-#if defined(CPU_R4000)
-#define C0_TLBLO0 $2 /* tlb entry low 0 */
-#define C0_TLBLO1 $3 /* tlb entry low 1 */
-#endif
-
-#define C0_CTXT $4 /* tlb context */
-
-#if defined(CPU_R4000)
-#define C0_PAGEMASK $5 /* tlb page mask */
-#define C0_WIRED $6 /* number of wired tlb entries */
-#endif
-
-#define C0_BADVADDR $8 /* bad virtual address */
-
-#if defined(CPU_R4000)
-#define C0_COUNT $9 /* cycle count */
-#endif
-
-#define C0_TLBHI $10 /* tlb entry hi */
-
-#if defined(CPU_R4000)
-#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 defined(CPU_R3000)
-#define C0_CONFIG $3 /* configuration register R3081*/
-#endif
-
-#if defined(CPU_R4000)
-#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
-
-#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/mips64orion/idtmon.h b/cpukit/score/cpu/mips64orion/idtmon.h
deleted file mode 100644
index b42211ed5c..0000000000
--- a/cpukit/score/cpu/mips64orion/idtmon.h
+++ /dev/null
@@ -1,171 +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$
-*/
-
-/*
-** idtmon.h - General header file for the IDT Prom Monitor
-**
-** Copyright 1989 Integrated Device Technology, Inc.
-** All Rights Reserved.
-**
-** June 1989 - D.Cahoon
-*/
-#ifndef __IDTMON_H__
-#define __IDTMON_H__
-
-/*
-** P_STACKSIZE is the size of the Prom Stack.
-** the prom stack grows downward
-*/
-#define P_STACKSIZE 0x2000 /* sets stack size to 8k */
-
-/*
-** M_BUSWIDTH
-** Memory bus width (including bank interleaving) in bytes
-** used when doing memory sizing to prevent bus capacitance
-** reporting ghost memory locations
-*/
-#if defined(CPU_R3000)
-#define M_BUSWIDTH 8 /* 32bit memory bank interleaved */
-#endif
-#if defined(CPU_R4000)
-#define M_BUSWIDTH 16 /* 64 bit memory bank interleaved */
-#endif
-
-/*
-** this is the default value for the number of bytes to add in calculating
-** the checksums in the checksum command
-*/
-#define CHK_SUM_CNT 0x20000 /* number of bytes to calc chksum for */
-
-/*
-** Monitor modes
-*/
-#define MODE_MONITOR 5 /* IDT Prom Monitor is executing */
-#define MODE_USER 0xa /* USER is executing */
-
-/*
-** memory reference widths
-*/
-#define SW_BYTE 1
-#define SW_HALFWORD 2
-#define SW_WORD 4
-#define SW_TRIBYTEL 12
-#define SW_TRIBYTER 20
-
-#ifdef CPU_R4000
-/*
-** definitions for select_cache call
-*/
-#define DCACHE 0
-#define ICACHE 1
-#define SCACHE 2
-
-#endif
-
-#if defined (CLANGUAGE) || defined(_LANGUAGE_C)
-typedef struct {
- unsigned int mem_size;
- unsigned int icache_size;
- unsigned int dcache_size;
-#ifdef CPU_R4000
- unsigned int scache_size;
-#endif
-
- } mem_config;
-
-#endif CLANGUAGE || defined(_LANGUAGE_C)
-
-/*
-** general equates for diagnostics and boolean functions
-*/
-#define PASS 0
-#define FAIL 1
-
-#ifndef TRUE
-#define TRUE 1
-#endif TRUE
-#ifndef NULL
-#define NULL 0
-#endif NULL
-
-#ifndef FALSE
-#define FALSE 0
-#endif FALSE
-
-
-/*
-** portablility equates
-*/
-
-#ifndef BOOL
-#define BOOL unsigned int
-#endif BOOL
-
-#ifndef GLOBAL
-#define GLOBAL /**/
-#endif GLOBAL
-
-#ifndef MLOCAL
-#define MLOCAL static
-#endif MLOCAL
-
-
-#ifdef XDS
-#define CONST const
-#else
-#define CONST
-#endif XDS
-
-#define u_char unsigned char
-#define u_short unsigned short
-#define u_int unsigned int
-/*
-** assembly instructions for compatability between xds and mips
-*/
-#ifndef XDS
-#define sllv sll
-#define srlv srl
-#endif XDS
-/*
-** 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
-#endif /* __IDTMON_H__ */
diff --git a/cpukit/score/cpu/mips64orion/iregdef.h b/cpukit/score/cpu/mips64orion/iregdef.h
deleted file mode 100644
index f0953da852..0000000000
--- a/cpukit/score/cpu/mips64orion/iregdef.h
+++ /dev/null
@@ -1,325 +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 save reg area
-*/
-#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_F0 32
-#define R_F1 33
-#define R_F2 34
-#define R_F3 35
-#define R_F4 36
-#define R_F5 37
-#define R_F6 38
-#define R_F7 39
-#define R_F8 40
-#define R_F9 41
-#define R_F10 42
-#define R_F11 43
-#define R_F12 44
-#define R_F13 45
-#define R_F14 46
-#define R_F15 47
-#define R_F16 48
-#define R_F17 49
-#define R_F18 50
-#define R_F19 51
-#define R_F20 52
-#define R_F21 53
-#define R_F22 54
-#define R_F23 55
-#define R_F24 56
-#define R_F25 57
-#define R_F26 58
-#define R_F27 59
-#define R_F28 60
-#define R_F29 61
-#define R_F30 62
-#define R_F31 63
-#define NCLIENTREGS 64
-#define R_EPC 64
-#define R_MDHI 65
-#define R_MDLO 66
-#define R_SR 67
-#define R_CAUSE 68
-#define R_TLBHI 69
-#if defined(CPU_R3000)
-#define R_TLBLO 70
-#endif
-#if defined(CPU_R4000)
-#define R_TLBLO0 70
-#endif
-#define R_BADVADDR 71
-#define R_INX 72
-#define R_RAND 73
-#define R_CTXT 74
-#define R_EXCTYPE 75
-#define R_MODE 76
-#define R_PRID 77
-#define R_FCSR 78
-#define R_FEIR 79
-#if defined(CPU_R3000)
-#define NREGS 80
-#endif
-#if defined(CPU_R4000)
-#define R_TLBLO1 80
-#define R_PAGEMASK 81
-#define R_WIRED 82
-#define R_COUNT 83
-#define R_COMPARE 84
-#define R_CONFIG 85
-#define R_LLADDR 86
-#define R_WATCHLO 87
-#define R_WATCHHI 88
-#define R_ECC 89
-#define R_CACHEERR 90
-#define R_TAGLO 91
-#define R_TAGHI 92
-#define R_ERRPC 93
-#define R_XCTXT 94 /* Ketan added from SIM64bit */
-
-#define NREGS 95
-#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
-
-/* Ketan added the following */
-#ifdef CPU_R3000
-#define sreg sw
-#define lreg lw
-#define rmfc0 mfc0
-#define rmtc0 mtc0
-#define R_SZ 4
-#endif CPU_R3000
-
-#ifdef CPU_R4000
-#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 CPU_R4000
-/* Ketan till here */
-
-#endif /* __IREGDEF_H__ */
-
diff --git a/cpukit/score/cpu/no_cpu/asm.h b/cpukit/score/cpu/no_cpu/asm.h
deleted file mode 100644
index 1ca7fd435b..0000000000
--- a/cpukit/score/cpu/no_cpu/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 <rtems/score/targopts.h>
-#include <rtems/score/no_cpu.h>
-
-/*
- * 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/no_cpu/cpu.c b/cpukit/score/cpu/no_cpu/cpu.c
deleted file mode 100644
index 58e71f9266..0000000000
--- a/cpukit/score/cpu/no_cpu/cpu.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * XXX CPU Dependent Source
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/wkspace.h>
-
-/* _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 */
-)
-{
- /*
- * The thread_dispatch argument is the address of the entry point
- * for the routine called at the end of an ISR once it has been
- * decided a context switch is necessary. On some compilation
- * systems it is difficult to call a high-level language routine
- * from assembly. This allows us to trick these systems.
- *
- * If you encounter this problem save the entry point in a CPU
- * dependent variable.
- */
-
- _CPU_Thread_dispatch_pointer = thread_dispatch;
-
- /*
- * If there is not an easy way to initialize the FP context
- * during Context_Initialize, then it is usually easier to
- * save an "uninitialized" FP context here and copy it to
- * the task's during Context_Initialize.
- */
-
- /* FP context initialization support goes here */
-
- _CPU_Table = *cpu_table;
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- /*
- * This routine returns the current interrupt level.
- */
-
- return 0;
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- /*
- * This is where we install the interrupt handler into the "raw" interrupt
- * table used by the CPU to dispatch interrupt handlers.
- */
-}
-
-/*PAGE
- *
- * _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
-)
-{
- *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.
- */
-
- _CPU_ISR_install_raw_handler( vector, new_handler, old_handler );
-
- /*
- * 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;
-}
-
-/*PAGE
- *
- * _CPU_Install_interrupt_stack
- */
-
-void _CPU_Install_interrupt_stack( void )
-{
-}
-
-/*PAGE
- *
- * _CPU_Thread_Idle_body
- *
- * NOTES:
- *
- * 1. This is the same as the regular CPU independent algorithm.
- *
- * 2. If you implement this using a "halt", "idle", or "shutdown"
- * instruction, then don't forget to put it in an infinite loop.
- *
- * 3. Be warned. Some processors with onboard DMA have been known
- * to stop the DMA if the CPU were put in IDLE mode. This might
- * also be a problem with other on-chip peripherals. So use this
- * hook with caution.
- */
-
-void _CPU_Thread_Idle_body( void )
-{
-
- for( ; ; )
- /* insert your "halt" instruction here */ ;
-}
diff --git a/cpukit/score/cpu/no_cpu/cpu_asm.c b/cpukit/score/cpu/no_cpu/cpu_asm.c
deleted file mode 100644
index d6abcab5c2..0000000000
--- a/cpukit/score/cpu/no_cpu/cpu_asm.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/* cpu_asm.c ===> cpu_asm.S or cpu_asm.s
- *
- * This file contains the basic algorithms for all assembly code used
- * in an specific CPU port of RTEMS. These algorithms must be implemented
- * in assembly language
- *
- * NOTE: This is supposed to be a .S or .s file NOT a C file.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 is supposed to be an assembly file. This means that system.h
- * and cpu.h should not be included in a "real" cpu_asm file. An
- * implementation in assembly should include "cpu_asm.h>
- */
-
-#include <rtems/system.h>
-#include <rtems/score/cpu.h>
-/* #include "cpu_asm.h> */
-
-/*
- * _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.
- */
-
-void _CPU_Context_save_fp(
- void **fp_context_ptr
-)
-{
-}
-
-/*
- * _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.
- */
-
-void _CPU_Context_restore_fp(
- void **fp_context_ptr
-)
-{
-}
-
-/* _CPU_Context_switch
- *
- * This routine performs a normal non-FP context switch.
- */
-
-void _CPU_Context_switch(
- Context_Control *run,
- Context_Control *heir
-)
-{
-}
-
-/*
- * _CPU_Context_restore
- *
- * This routine is generally 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.
- */
-
-void _CPU_Context_restore(
- Context_Control *new_context
-)
-{
-}
-
-/* void __ISR_Handler()
- *
- * This routine provides the RTEMS interrupt management.
- *
- */
-
-void _ISR_Handler()
-{
- /*
- * This discussion ignores a lot of the ugly details in a real
- * implementation such as saving enough registers/state to be
- * able to do something real. Keep in mind that the goal is
- * to invoke a user's ISR handler which is written in C and
- * uses a certain set of registers.
- *
- * Also note that the exact order is to a large extent flexible.
- * Hardware will dictate a sequence for a certain subset of
- * _ISR_Handler while requirements for setting
- */
-
- /*
- * At entry to "common" _ISR_Handler, the vector number must be
- * available. On some CPUs the hardware puts either the vector
- * number or the offset into the vector table for this ISR in a
- * known place. If the hardware does not give us this information,
- * then the assembly portion of RTEMS for this port will contain
- * a set of distinct interrupt entry points which somehow place
- * the vector number in a known place (which is safe if another
- * interrupt nests this one) and branches to _ISR_Handler.
- *
- * save some or all context on stack
- * may need to save some special interrupt information for exit
- *
- * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- * if ( _ISR_Nest_level == 0 )
- * switch to software interrupt stack
- * #endif
- *
- * _ISR_Nest_level++;
- *
- * _Thread_Dispatch_disable_level++;
- *
- * (*_ISR_Vector_table[ vector ])( vector );
- *
- * --_ISR_Nest_level;
- *
- * if ( _ISR_Nest_level )
- * goto the label "exit interrupt (simple case)"
- *
- * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
- * restore stack
- * #endif
- *
- * if ( !_Context_Switch_necessary )
- * goto the label "exit interrupt (simple case)"
- *
- * if ( !_ISR_Signals_to_thread_executing )
- * _ISR_Signals_to_thread_executing = FALSE;
- * goto the label "exit interrupt (simple case)"
- *
- * call _Thread_Dispatch() or prepare to return to _ISR_Dispatch
- *
- * prepare to get out of interrupt
- * return from interrupt (maybe to _ISR_Dispatch)
- *
- * LABEL "exit interrupt (simple case):
- * prepare to get out of interrupt
- * return from interrupt
- */
-}
-
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 1ca7fd435b..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 <rtems/score/targopts.h>
-#include <rtems/score/no_cpu.h>
-
-/*
- * 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/sh/asm.h b/cpukit/score/cpu/sh/asm.h
deleted file mode 100644
index f6fff9f40e..0000000000
--- a/cpukit/score/cpu/sh/asm.h
+++ /dev/null
@@ -1,137 +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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <rtems/score/targopts.h>
-#include <rtems/score/sh.h>
-
-/*
- * 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/sh/cpu.c b/cpukit/score/cpu/sh/cpu.c
deleted file mode 100644
index cc07552cf0..0000000000
--- a/cpukit/score/cpu/sh/cpu.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * This file contains information pertaining to the Hitachi SH
- * processor.
- *
- * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
- * Bernd Becker (becker@faw.uni-ulm.de)
- *
- * 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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/sh_io.h>
-#include <rtems/score/cpu.h>
-#include <rtems/score/sh.h>
-
-
-/* referenced in start.s */
-extern proc_ptr vectab[] ;
-
-proc_ptr vectab[256] ;
-
-extern proc_ptr _Hardware_isr_Table[];
-
-/* _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 */
-)
-{
- register unsigned32 level = 0;
-
- /*
- * The thread_dispatch argument is the address of the entry point
- * for the routine called at the end of an ISR once it has been
- * decided a context switch is necessary. On some compilation
- * systems it is difficult to call a high-level language routine
- * from assembly. This allows us to trick these systems.
- *
- * If you encounter this problem save the entry point in a CPU
- * dependent variable.
- */
-
- _CPU_Thread_dispatch_pointer = thread_dispatch;
-
- /*
- * If there is not an easy way to initialize the FP context
- * during Context_Initialize, then it is usually easier to
- * save an "uninitialized" FP context here and copy it to
- * the task's during Context_Initialize.
- */
-
- /* FP context initialization support goes here */
-
- _CPU_Table = *cpu_table;
-
- /* enable interrupts */
- _CPU_ISR_Set_level( level);
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- /*
- * This routine returns the current interrupt level.
- */
-
- register unsigned32 _mask ;
-
- sh_get_interrupt_level( _mask );
-
- return ( _mask);
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- /*
- * This is where we install the interrupt handler into the "raw" interrupt
- * table used by the CPU to dispatch interrupt handlers.
- */
- volatile proc_ptr *vbr ;
-
-#if SH_PARANOID_ISR
- unsigned32 level ;
-
- sh_disable_interrupts( level );
-#endif
-
- /* get vbr */
- asm ( "stc vbr,%0" : "=r" (vbr) );
-
- *old_handler = vbr[vector] ;
- vbr[vector] = new_handler ;
-
-#if SH_PARANOID_ISR
- sh_enable_interrupts( level );
-#endif
-}
-
-
-/*PAGE
- *
- * _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 ;
-
- if(( vector <= 113) && ( vector >= 11))
- {
- *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.
- */
- _CPU_ISR_install_raw_handler(vector,
- _Hardware_isr_Table[vector],
- &ignored );
-
- /*
- * We put the actual user ISR address in '_ISR_Vector_table'.
- * This will be used by __ISR_Handler so the user gets control.
- */
-
- _ISR_Vector_table[ vector ] = new_handler;
- }
-}
-
-/*PAGE
- *
- * _CPU_Thread_Idle_body
- *
- * NOTES:
- *
- * 1. This is the same as the regular CPU independent algorithm.
- *
- * 2. If you implement this using a "halt", "idle", or "shutdown"
- * instruction, then don't forget to put it in an infinite loop.
- *
- * 3. Be warned. Some processors with onboard DMA have been known
- * to stop the DMA if the CPU were put in IDLE mode. This might
- * also be a problem with other on-chip peripherals. So use this
- * hook with caution.
- */
-
-#if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
-void _CPU_Thread_Idle_body( void )
-{
-
- for( ; ; )
- {
- asm volatile("nop");
- }
- /* insert your "halt" instruction here */ ;
-}
-#endif
-
-#if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
-
-unsigned8 _bit_set_table[16] =
- { 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 1,0};
-
-
-#endif
-
-void _CPU_Context_Initialize(
- Context_Control *_the_context,
- void *_stack_base,
- unsigned32 _size,
- unsigned32 _isr,
- void (*_entry_point)(void),
- int _is_fp )
-{
- _the_context->r15 = (unsigned32*) ((unsigned32) (_stack_base) + (_size) );
- _the_context->sr = (_isr << 4) & 0x00f0 ;
- _the_context->pr = (unsigned32*) _entry_point ;
-}
diff --git a/cpukit/score/cpu/sh/rtems/asm.h b/cpukit/score/cpu/sh/rtems/asm.h
deleted file mode 100644
index f6fff9f40e..0000000000
--- a/cpukit/score/cpu/sh/rtems/asm.h
+++ /dev/null
@@ -1,137 +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.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <rtems/score/targopts.h>
-#include <rtems/score/sh.h>
-
-/*
- * 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/README b/cpukit/score/cpu/sparc/README
deleted file mode 100644
index c4c2200075..0000000000
--- a/cpukit/score/cpu/sparc/README
+++ /dev/null
@@ -1,110 +0,0 @@
-#
-# $Id$
-#
-
-This file discusses SPARC specific issues which are important to
-this port. The primary topics in this file are:
-
- + Global Register Usage
- + Stack Frame
- + EF bit in the PSR
-
-
-Global Register Usage
-=====================
-
-This information on register usage is based heavily on a comment in the
-file gcc-2.7.0/config/sparc/sparc.h in the the gcc 2.7.0 source.
-
- + g0 is hardwired to 0
- + On non-v9 systems:
- - g1 is free to use as temporary.
- - g2-g4 are reserved for applications. Gcc normally uses them as
- temporaries, but this can be disabled via the -mno-app-regs option.
- - g5 through g7 are reserved for the operating system.
- + On v9 systems:
- - g1 and g5 are free to use as temporaries.
- - g2-g4 are reserved for applications (the compiler will not normally use
- them, but they can be used as temporaries with -mapp-regs).
- - g6-g7 are reserved for the operating system.
-
- NOTE: As of gcc 2.7.0 register g1 was used in the following scenarios:
-
- + as a temporary by the 64 bit sethi pattern
- + when restoring call-preserved registers in large stack frames
-
-RTEMS places no constraints on the usage of the global registers. Although
-gcc assumes that either g5-g7 (non-V9) or g6-g7 (V9) are reserved for the
-operating system, RTEMS does not assume any special use for them.
-
-
-
-Stack Frame
-===========
-
-The stack grows downward (i.e. to lower addresses) on the SPARC architecture.
-
-The following is the organization of the stack frame:
-
-
-
- | ............... |
- fp | |
- +-------------------------------+
- | |
- | Local registers, temporaries, |
- | and saved floats | x bytes
- | |
- sp + x +-------------------------------+
- | |
- | outgoing parameters past |
- | the sixth one | x bytes
- | |
- sp + 92 +-------------------------------+ *
- | | *
- | area for callee to save | *
- | register arguments | * 24 bytes
- | | *
- sp + 68 +-------------------------------+ *
- | | *
- | structure return pointer | * 4 bytes
- | | *
- sp + 64 +-------------------------------+ *
- | | *
- | local register set | * 32 bytes
- | | *
- sp + 32 +-------------------------------+ *
- | | *
- | input register set | * 32 bytes
- | | *
- sp +-------------------------------+ *
-
-
-* = minimal stack frame
-
-x = optional components
-
-EF bit in the PSR
-=================
-
-The EF (enable floating point unit) in the PSR is utilized in this port to
-prevent non-floating point tasks from performing floating point
-operations. This bit is maintained as part of the integer context.
-However, the floating point context is switched BEFORE the integer
-context. Thus the EF bit in place at the time of the FP switch may
-indicate that FP operations are disabled. This occurs on certain task
-switches, when the EF bit will be 0 for the outgoing task and thus a fault
-will be generated on the first FP operation of the FP context save.
-
-The remedy for this is to enable FP access as the first step in both the
-save and restore of the FP context area. This bit will be subsequently
-reloaded by the integer context switch.
-
-Two of the scenarios which demonstrate this problem are outlined below:
-
-1. When the first FP task is switched to. The system tasks are not FP and
-thus would be unable to restore the FP context of the incoming task.
-
-2. On a deferred FP context switch. In this case, the system might switch
-from FP Task A to non-FP Task B and then to FP Task C. In this scenario,
-the floating point state must technically be saved by a non-FP task.
diff --git a/cpukit/score/cpu/sparc/asm.h b/cpukit/score/cpu/sparc/asm.h
deleted file mode 100644
index b9a3aabeea..0000000000
--- a/cpukit/score/cpu/sparc/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 <rtems/score/targopts.h>
-#include <rtems/score/cpu.h>
-
-/*
- * 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. */
-#undef __USER_LABEL_PREFIX__
-#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 for ERC32 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/score/cpu/sparc/cpu.c b/cpukit/score/cpu/sparc/cpu.c
deleted file mode 100644
index 70b0f8f219..0000000000
--- a/cpukit/score/cpu/sparc/cpu.c
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
- * SPARC Dependent Source
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * Ported to ERC32 implementation of the SPARC by On-Line Applications
- * Research Corporation (OAR) under contract to the European Space
- * Agency (ESA).
- *
- * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
- * European Space Agency.
- *
- * $Id$
- */
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-
-#if defined(erc32)
-#include <erc32.h>
-#endif
-
-/*
- * This initializes the set of opcodes placed in each trap
- * table entry. The routine which installs a handler is responsible
- * for filling in the fields for the _handler address and the _vector
- * trap type.
- *
- * The constants following this structure are masks for the fields which
- * must be filled in when the handler is installed.
- */
-
-const CPU_Trap_table_entry _CPU_Trap_slot_template = {
- 0xa1480000, /* mov %psr, %l0 */
- 0x29000000, /* sethi %hi(_handler), %l4 */
- 0x81c52000, /* jmp %l4 + %lo(_handler) */
- 0xa6102000 /* mov _vector, %l3 */
-};
-
-/*PAGE
- *
- * _CPU_Initialize
- *
- * This routine performs processor dependent initialization.
- *
- * Input Parameters:
- * cpu_table - CPU table to initialize
- * thread_dispatch - address of disptaching routine
- *
- * Output Parameters: NONE
- *
- * NOTE: There is no need to save the pointer to the thread dispatch routine.
- * The SPARC's assembly code can reference it directly with no problems.
- */
-
-void _CPU_Initialize(
- rtems_cpu_table *cpu_table,
- void (*thread_dispatch) /* ignored on this CPU */
-)
-{
- void *pointer;
-
-#ifndef NO_TABLE_MOVE
- unsigned32 trap_table_start;
- unsigned32 tbr_value;
- CPU_Trap_table_entry *old_tbr;
- CPU_Trap_table_entry *trap_table;
-
- /*
- * Install the executive's trap table. All entries from the original
- * trap table are copied into the executive's trap table. This is essential
- * since this preserves critical trap handlers such as the window underflow
- * and overflow handlers. It is the responsibility of the BSP to provide
- * install these in the initial trap table.
- */
-
-
- trap_table_start = (unsigned32) &_CPU_Trap_Table_area;
- if (trap_table_start & (SPARC_TRAP_TABLE_ALIGNMENT-1))
- trap_table_start = (trap_table_start + SPARC_TRAP_TABLE_ALIGNMENT) &
- ~(SPARC_TRAP_TABLE_ALIGNMENT-1);
-
- trap_table = (CPU_Trap_table_entry *) trap_table_start;
-
- sparc_get_tbr( tbr_value );
-
- old_tbr = (CPU_Trap_table_entry *) (tbr_value & 0xfffff000);
-
- memcpy( trap_table, (void *) old_tbr, 256 * sizeof( CPU_Trap_table_entry ) );
-
- sparc_set_tbr( trap_table_start );
-
-#endif
-
- /*
- * This seems to be the most appropriate way to obtain an initial
- * FP context on the SPARC. The NULL fp context is copied it to
- * the task's FP context during Context_Initialize.
- */
-
- pointer = &_CPU_Null_fp_context;
- _CPU_Context_save_fp( &pointer );
-
- /*
- * Grab our own copy of the user's CPU table.
- */
-
- _CPU_Table = *cpu_table;
-
-#if defined(erc32)
-
- /*
- * ERC32 specific initialization
- */
-
- _ERC32_MEC_Timer_Control_Mirror = 0;
- ERC32_MEC.Timer_Control = 0;
-
- ERC32_MEC.Control |= ERC32_CONFIGURATION_POWER_DOWN_ALLOWED;
-
-#endif
-
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- *
- * Input Parameters: NONE
- *
- * Output Parameters:
- * returns the current interrupt level (PIL field of the PSR)
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- unsigned32 level;
-
- sparc_get_interrupt_level( level );
-
- return level;
-}
-
-/*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:
- *
- * On the SPARC, there are really only 256 vectors. However, the executive
- * has no easy, fast, reliable way to determine which traps are synchronous
- * and which are asynchronous. By default, synchronous traps return to the
- * instruction which caused the interrupt. So if you 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.
- *
- * So vectors 0 through 255 are treated as regular asynchronous traps which
- * provide the "correct" return address. Vectors 256 through 512 are assumed
- * by the executive to be synchronous and to require that the return address
- * be fudged.
- *
- * If you use this mechanism to install a trap handler which must reexecute
- * the instruction which caused the trap, then it should be installed as
- * an asynchronous trap. This will avoid the executive changing the return
- * address.
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- unsigned32 real_vector;
- CPU_Trap_table_entry *tbr;
- CPU_Trap_table_entry *slot;
- unsigned32 u32_tbr;
- unsigned32 u32_handler;
-
- /*
- * Get the "real" trap number for this vector ignoring the synchronous
- * versus asynchronous indicator included with our vector numbers.
- */
-
- real_vector = SPARC_REAL_TRAP_NUMBER( vector );
-
- /*
- * Get the current base address of the trap table and calculate a pointer
- * to the slot we are interested in.
- */
-
- sparc_get_tbr( u32_tbr );
-
- u32_tbr &= 0xfffff000;
-
- tbr = (CPU_Trap_table_entry *) u32_tbr;
-
- slot = &tbr[ 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->mov_psr_l0 == _CPU_Trap_slot_template.mov_psr_l0 ) {
- u32_handler =
- ((slot->sethi_of_handler_to_l4 & HIGH_BITS_MASK) << HIGH_BITS_SHIFT) |
- (slot->jmp_to_low_of_handler_plus_l4 & LOW_BITS_MASK);
- *old_handler = (proc_ptr) u32_handler;
- } else
- *old_handler = 0;
-
- /*
- * Copy the template to the slot and then fix it.
- */
-
- *slot = _CPU_Trap_slot_template;
-
- u32_handler = (unsigned32) new_handler;
-
- slot->mov_vector_l3 |= vector;
- slot->sethi_of_handler_to_l4 |=
- (u32_handler & HIGH_BITS_MASK) >> HIGH_BITS_SHIFT;
- slot->jmp_to_low_of_handler_plus_l4 |= (u32_handler & LOW_BITS_MASK);
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_vector
- *
- * This kernel routine installs the RTEMS handler for the
- * specified vector.
- *
- * Input parameters:
- * vector - interrupt vector number
- * new_handler - replacement ISR for this vector number
- * old_handler - pointer to former ISR for this vector number
- *
- * Output parameters:
- * *old_handler - former ISR for this vector number
- *
- */
-
-void _CPU_ISR_install_vector(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- unsigned32 real_vector;
- proc_ptr ignored;
-
- /*
- * Get the "real" trap number for this vector ignoring the synchronous
- * versus asynchronous indicator included with our vector numbers.
- */
-
- real_vector = SPARC_REAL_TRAP_NUMBER( vector );
-
- /*
- * Return the previous ISR handler.
- */
-
- *old_handler = _ISR_Vector_table[ real_vector ];
-
- /*
- * Install the wrapper so this ISR can be invoked properly.
- */
-
- _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[ real_vector ] = new_handler;
-}
-
-/*PAGE
- *
- * _CPU_Context_Initialize
- *
- * This kernel routine initializes the basic non-FP context area associated
- * with each thread.
- *
- * Input parameters:
- * the_context - pointer to the context area
- * stack_base - address of memory for the SPARC
- * size - size in bytes of the stack area
- * new_level - interrupt level for this context area
- * entry_point - the starting execution point for this this context
- * is_fp - TRUE if this context is associated with an FP thread
- *
- * Output parameters: NONE
- */
-
-void _CPU_Context_Initialize(
- Context_Control *the_context,
- unsigned32 *stack_base,
- unsigned32 size,
- unsigned32 new_level,
- void *entry_point,
- boolean is_fp
-)
-{
- unsigned32 stack_high; /* highest "stack aligned" address */
- unsigned32 the_size;
- unsigned32 tmp_psr;
-
- /*
- * On CPUs with stacks which grow down (i.e. SPARC), we build the stack
- * based on the stack_high address.
- */
-
- stack_high = ((unsigned32)(stack_base) + size);
- stack_high &= ~(CPU_STACK_ALIGNMENT - 1);
-
- the_size = size & ~(CPU_STACK_ALIGNMENT - 1);
-
- /*
- * See the README in this directory for a diagram of the stack.
- */
-
- the_context->o7 = ((unsigned32) entry_point) - 8;
- the_context->o6_sp = stack_high - CPU_MINIMUM_STACK_FRAME_SIZE;
- the_context->i6_fp = stack_high;
-
- /*
- * Build the PSR for the task. Most everything can be 0 and the
- * CWP is corrected during the context switch.
- *
- * The EF bit determines if the floating point unit is available.
- * The FPU is ONLY enabled if the context is associated with an FP task
- * and this SPARC model has an FPU.
- */
-
- sparc_get_psr( tmp_psr );
- tmp_psr &= ~SPARC_PSR_PIL_MASK;
- tmp_psr |= (new_level << 8) & SPARC_PSR_PIL_MASK;
- tmp_psr &= ~SPARC_PSR_EF_MASK; /* disabled by default */
-
-#if (SPARC_HAS_FPU == 1)
- /*
- * If this bit is not set, then a task gets a fault when it accesses
- * a floating point register. This is a nice way to detect floating
- * point tasks which are not currently declared as such.
- */
-
- if ( is_fp )
- tmp_psr |= SPARC_PSR_EF_MASK;
-#endif
- the_context->psr = tmp_psr;
-}
-
-/*PAGE
- *
- * _CPU_Thread_Idle_body
- *
- * Some SPARC implementations have low power, sleep, or idle modes. This
- * tries to take advantage of those models.
- */
-
-#if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
-
-/*
- * This is the implementation for the erc32.
- *
- * NOTE: Low power mode was enabled at initialization time.
- */
-
-#if defined(erc32)
-
-void _CPU_Thread_Idle_body( void )
-{
- while (1) {
- ERC32_MEC.Power_Down = 0; /* value is irrelevant */
- }
-}
-
-#endif
-
-#endif /* CPU_PROVIDES_IDLE_THREAD_BODY */
diff --git a/cpukit/score/cpu/sparc/rtems/asm.h b/cpukit/score/cpu/sparc/rtems/asm.h
deleted file mode 100644
index b9a3aabeea..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 <rtems/score/targopts.h>
-#include <rtems/score/cpu.h>
-
-/*
- * 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. */
-#undef __USER_LABEL_PREFIX__
-#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 for ERC32 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/score/cpu/unix/cpu.c b/cpukit/score/cpu/unix/cpu.c
deleted file mode 100644
index 3b3dbcd383..0000000000
--- a/cpukit/score/cpu/unix/cpu.c
+++ /dev/null
@@ -1,1117 +0,0 @@
-/*
- * UNIX Simulator Dependent Source
- *
- * COPYRIGHT (c) 1994,95 by Division Incorporated
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/interr.h>
-
-#if defined(__linux__)
-#define _XOPEN_SOURCE
-#define MALLOC_0_RETURNS_NULL
-#endif
-
-#include <sys/types.h>
-#include <sys/times.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <setjmp.h>
-#include <signal.h>
-#include <time.h>
-#include <sys/time.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/sem.h>
-#include <string.h> /* memset */
-
-#ifndef SA_RESTART
-#define SA_RESTART 0
-#endif
-
-typedef struct {
- jmp_buf regs;
- int isr_level;
-} Context_Control_overlay;
-
-void _CPU_Signal_initialize(void);
-void _CPU_Stray_signal(int);
-void _CPU_ISR_Handler(int);
-
-static sigset_t _CPU_Signal_mask;
-static Context_Control_overlay
- _CPU_Context_Default_with_ISRs_enabled CPU_STRUCTURE_ALIGNMENT;
-static Context_Control_overlay
- _CPU_Context_Default_with_ISRs_disabled CPU_STRUCTURE_ALIGNMENT;
-
-/*
- * Sync IO support, an entry for each fd that can be set
- */
-
-void _CPU_Sync_io_Init();
-
-static rtems_sync_io_handler _CPU_Sync_io_handlers[FD_SETSIZE];
-static int sync_io_nfds;
-static fd_set sync_io_readfds;
-static fd_set sync_io_writefds;
-static fd_set sync_io_exceptfds;
-
-/*
- * Which cpu are we? Used by libcpu and libbsp.
- */
-
-int cpu_number;
-
-/*PAGE
- *
- * _CPU_ISR_From_CPU_Init
- */
-
-sigset_t posix_empty_mask;
-
-void _CPU_ISR_From_CPU_Init()
-{
- unsigned32 i;
- proc_ptr old_handler;
-
- /*
- * Generate an empty mask to be used by disable_support
- */
-
- sigemptyset(&posix_empty_mask);
-
- /*
- * Block all the signals except SIGTRAP for the debugger
- * and fatal error signals.
- */
-
- (void) sigfillset(&_CPU_Signal_mask);
- (void) sigdelset(&_CPU_Signal_mask, SIGTRAP);
- (void) sigdelset(&_CPU_Signal_mask, SIGABRT);
- (void) sigdelset(&_CPU_Signal_mask, SIGIOT);
- (void) sigdelset(&_CPU_Signal_mask, SIGCONT);
- (void) sigdelset(&_CPU_Signal_mask, SIGSEGV);
- (void) sigdelset(&_CPU_Signal_mask, SIGBUS);
- (void) sigdelset(&_CPU_Signal_mask, SIGFPE);
-
- _CPU_ISR_Enable(1);
-
- /*
- * Set the handler for all signals to be signal_handler
- * which will then vector out to the correct handler
- * for whichever signal actually happened. Initially
- * set the vectors to the stray signal handler.
- */
-
- for (i = 0; i < CPU_INTERRUPT_NUMBER_OF_VECTORS; i++)
- (void)_CPU_ISR_install_vector(i, _CPU_Stray_signal, &old_handler);
-
- _CPU_Signal_initialize();
-}
-
-void _CPU_Signal_initialize( void )
-{
- struct sigaction act;
- sigset_t mask;
-
- /* mark them all active except for TraceTrap and Abort */
-
- mask = _CPU_Signal_mask;
- sigprocmask(SIG_UNBLOCK, &mask, 0);
-
- act.sa_handler = _CPU_ISR_Handler;
- act.sa_mask = mask;
- act.sa_flags = SA_RESTART;
-
- sigaction(SIGHUP, &act, 0);
- sigaction(SIGINT, &act, 0);
- sigaction(SIGQUIT, &act, 0);
- sigaction(SIGILL, &act, 0);
-#ifdef SIGEMT
- sigaction(SIGEMT, &act, 0);
-#endif
- sigaction(SIGFPE, &act, 0);
- sigaction(SIGKILL, &act, 0);
- sigaction(SIGBUS, &act, 0);
- sigaction(SIGSEGV, &act, 0);
-#ifdef SIGSYS
- sigaction(SIGSYS, &act, 0);
-#endif
- sigaction(SIGPIPE, &act, 0);
- sigaction(SIGALRM, &act, 0);
- sigaction(SIGTERM, &act, 0);
- sigaction(SIGUSR1, &act, 0);
- sigaction(SIGUSR2, &act, 0);
- sigaction(SIGCHLD, &act, 0);
-#ifdef SIGCLD
- sigaction(SIGCLD, &act, 0);
-#endif
-#ifdef SIGPWR
- sigaction(SIGPWR, &act, 0);
-#endif
- sigaction(SIGVTALRM, &act, 0);
- sigaction(SIGPROF, &act, 0);
- sigaction(SIGIO, &act, 0);
- sigaction(SIGWINCH, &act, 0);
- sigaction(SIGSTOP, &act, 0);
- sigaction(SIGTTIN, &act, 0);
- sigaction(SIGTTOU, &act, 0);
- sigaction(SIGURG, &act, 0);
-#ifdef SIGLOST
- sigaction(SIGLOST, &act, 0);
-#endif
-}
-
-/*PAGE
- *
- * _CPU_Context_From_CPU_Init
- */
-
-void _CPU_Context_From_CPU_Init()
-{
-
-#if defined(__hppa__) && defined(RTEMS_UNIXLIB_SETJMP)
- /*
- * HACK - set the _SYSTEM_ID to 0x20c so that setjmp/longjmp
- * will handle the full 32 floating point registers.
- */
-
- {
- extern unsigned32 _SYSTEM_ID;
-
- _SYSTEM_ID = 0x20c;
- }
-#endif
-
- /*
- * get default values to use in _CPU_Context_Initialize()
- */
-
-
- (void) memset(
- &_CPU_Context_Default_with_ISRs_enabled,
- 0,
- sizeof(Context_Control)
- );
- (void) memset(
- &_CPU_Context_Default_with_ISRs_disabled,
- 0,
- sizeof(Context_Control)
- );
-
- _CPU_ISR_Set_level( 0 );
- _CPU_Context_switch(
- (Context_Control *) &_CPU_Context_Default_with_ISRs_enabled,
- (Context_Control *) &_CPU_Context_Default_with_ISRs_enabled
- );
-
- _CPU_ISR_Set_level( 1 );
- _CPU_Context_switch(
- (Context_Control *) &_CPU_Context_Default_with_ISRs_disabled,
- (Context_Control *) &_CPU_Context_Default_with_ISRs_disabled
- );
-}
-
-/*PAGE
- *
- * _CPU_Sync_io_Init
- */
-
-void _CPU_Sync_io_Init()
-{
- int fd;
-
- for (fd = 0; fd < FD_SETSIZE; fd++)
- _CPU_Sync_io_handlers[fd] = NULL;
-
- sync_io_nfds = 0;
- FD_ZERO(&sync_io_readfds);
- FD_ZERO(&sync_io_writefds);
- FD_ZERO(&sync_io_exceptfds);
-}
-
-/*PAGE
- *
- * _CPU_ISR_Get_level
- */
-
-unsigned32 _CPU_ISR_Get_level( void )
-{
- sigset_t old_mask;
-
-#if defined(__linux__)
- sigemptyset( &old_mask );
-#endif
- sigprocmask(SIG_BLOCK, 0, &old_mask);
-
- if (memcmp((void *)&posix_empty_mask, (void *)&old_mask, sizeof(sigset_t)))
- return 1;
-
- return 0;
-}
-
-/* _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 */
-)
-{
- /*
- * The thread_dispatch argument is the address of the entry point
- * for the routine called at the end of an ISR once it has been
- * decided a context switch is necessary. On some compilation
- * systems it is difficult to call a high-level language routine
- * from assembly. This allows us to trick these systems.
- *
- * If you encounter this problem save the entry point in a CPU
- * dependent variable.
- */
-
- _CPU_Thread_dispatch_pointer = thread_dispatch;
-
- /*
- * XXX; If there is not an easy way to initialize the FP context
- * during Context_Initialize, then it is usually easier to
- * save an "uninitialized" FP context here and copy it to
- * the task's during Context_Initialize.
- */
-
- /* XXX: FP context initialization support */
-
- _CPU_Table = *cpu_table;
-
- _CPU_ISR_From_CPU_Init();
-
- _CPU_Sync_io_Init();
-
- _CPU_Context_From_CPU_Init();
-
-}
-
-/*PAGE
- *
- * _CPU_ISR_install_raw_handler
- */
-
-void _CPU_ISR_install_raw_handler(
- unsigned32 vector,
- proc_ptr new_handler,
- proc_ptr *old_handler
-)
-{
- _CPU_Fatal_halt( 0xdeaddead );
-}
-
-/*PAGE
- *
- * _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
-)
-{
- *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.
- */
-
- /*
- * We put the actual user ISR address in '_ISR_vector_table'. This will
- * be used by the _CPU_ISR_Handler so the user gets control.
- */
-
- _ISR_Vector_table[ vector ] = new_handler;
-}
-
-/*PAGE
- *
- * _CPU_Install_interrupt_stack
- */
-
-void _CPU_Install_interrupt_stack( void )
-{
-}
-
-/*PAGE
- *
- * _CPU_Thread_Idle_body
- *
- * Stop until we get a signal which is the logically the same thing
- * entering low-power or sleep mode on a real processor and waiting for
- * an interrupt. This significantly reduces the consumption of host
- * CPU cycles which is again similar to low power mode.
- */
-
-void _CPU_Thread_Idle_body( void )
-{
-#if CPU_SYNC_IO
- extern void _Thread_Dispatch(void);
- int fd;
-#endif
-
- while (1) {
-#ifdef RTEMS_DEBUG
- /* interrupts had better be enabled at this point! */
- if (_CPU_ISR_Get_level() != 0)
- abort();
-#endif
-
- /*
- * Block on a select statement, the CPU interface added allow the
- * user to add new descriptors which are to be blocked on
- */
-
-#if CPU_SYNC_IO
- if (sync_io_nfds) {
- int result;
- fd_set readfds, writefds, exceptfds;
-
- readfds = sync_io_readfds;
- writefds = sync_io_writefds;
- exceptfds = sync_io_exceptfds;
- result = select(sync_io_nfds,
- &readfds,
- &writefds,
- &exceptfds,
- NULL);
-
- if (result < 0) {
- if (errno != EINTR)
- _CPU_Fatal_error(0x200); /* FIXME : what number should go here !! */
- _Thread_Dispatch();
- continue;
- }
-
- for (fd = 0; fd < sync_io_nfds; fd++) {
- boolean read = FD_ISSET(fd, &readfds);
- boolean write = FD_ISSET(fd, &writefds);
- boolean except = FD_ISSET(fd, &exceptfds);
-
- if (_CPU_Sync_io_handlers[fd] && (read || write || except))
- _CPU_Sync_io_handlers[fd](fd, read, write, except);
- }
-
- _Thread_Dispatch();
- } else
- pause();
-#else
- pause();
-#endif
-
- }
-
-}
-
-/*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 *addr;
- unsigned32 jmp_addr;
- unsigned32 _stack_low; /* lowest "stack aligned" address */
- unsigned32 _stack_high; /* highest "stack aligned" address */
- unsigned32 _the_size;
-
- jmp_addr = (unsigned32) _entry_point;
-
- /*
- * On CPUs with stacks which grow down, we build the stack
- * based on the _stack_high address. On CPUs with stacks which
- * grow up, we build the stack based on the _stack_low address.
- */
-
- _stack_low = (unsigned32)(_stack_base) + CPU_STACK_ALIGNMENT - 1;
- _stack_low &= ~(CPU_STACK_ALIGNMENT - 1);
-
- _stack_high = (unsigned32)(_stack_base) + _size;
- _stack_high &= ~(CPU_STACK_ALIGNMENT - 1);
-
- if (_stack_high > _stack_low)
- _the_size = _stack_high - _stack_low;
- else
- _the_size = _stack_low - _stack_high;
-
- /*
- * Slam our jmp_buf template into the context we are creating
- */
-
- if ( _new_level == 0 )
- *_the_context = *(Context_Control *)
- &_CPU_Context_Default_with_ISRs_enabled;
- else
- *_the_context = *(Context_Control *)
- &_CPU_Context_Default_with_ISRs_disabled;
-
- addr = (unsigned32 *)_the_context;
-
-#if defined(__hppa__)
- *(addr + RP_OFF) = jmp_addr;
- *(addr + SP_OFF) = (unsigned32)(_stack_low + CPU_FRAME_SIZE);
-
- /*
- * See if we are using shared libraries by checking
- * bit 30 in 24 off of newp. If bit 30 is set then
- * we are using shared libraries and the jump address
- * points to the pointer, so we put that into rp instead.
- */
-
- if (jmp_addr & 0x40000000) {
- jmp_addr &= 0xfffffffc;
- *(addr + RP_OFF) = *(unsigned32 *)jmp_addr;
- }
-#elif defined(__sparc__)
-
- /*
- * See /usr/include/sys/stack.h in Solaris 2.3 for a nice
- * diagram of the stack.
- */
-
- asm ("ta 0x03"); /* flush registers */
-
- *(addr + RP_OFF) = jmp_addr + ADDR_ADJ_OFFSET;
- *(addr + SP_OFF) = (unsigned32)(_stack_high - CPU_FRAME_SIZE);
- *(addr + FP_OFF) = (unsigned32)(_stack_high);
-
-#elif defined(__i386__)
-
- /*
- * This information was gathered by disassembling setjmp().
- */
-
- {
- unsigned32 stack_ptr;
-
- stack_ptr = _stack_high - CPU_FRAME_SIZE;
-
- *(addr + EBX_OFF) = 0xFEEDFEED;
- *(addr + ESI_OFF) = 0xDEADDEAD;
- *(addr + EDI_OFF) = 0xDEAFDEAF;
- *(addr + EBP_OFF) = stack_ptr;
- *(addr + ESP_OFF) = stack_ptr;
- *(addr + RET_OFF) = jmp_addr;
-
- addr = (unsigned32 *) stack_ptr;
-
- addr[ 0 ] = jmp_addr;
- addr[ 1 ] = (unsigned32) stack_ptr;
- addr[ 2 ] = (unsigned32) stack_ptr;
- }
-
-#else
-#error "UNKNOWN CPU!!!"
-#endif
-
-}
-
-/*PAGE
- *
- * _CPU_Context_restore
- */
-
-void _CPU_Context_restore(
- Context_Control *next
-)
-{
- Context_Control_overlay *nextp = (Context_Control_overlay *)next;
-
- _CPU_ISR_Enable(nextp->isr_level);
- longjmp( nextp->regs, 0 );
-}
-
-/*PAGE
- *
- * _CPU_Context_switch
- */
-
-static void do_jump(
- Context_Control_overlay *currentp,
- Context_Control_overlay *nextp
-);
-
-void _CPU_Context_switch(
- Context_Control *current,
- Context_Control *next
-)
-{
- Context_Control_overlay *currentp = (Context_Control_overlay *)current;
- Context_Control_overlay *nextp = (Context_Control_overlay *)next;
-#if 0
- int status;
-#endif
-
- currentp->isr_level = _CPU_ISR_Disable_support();
-
- do_jump( currentp, nextp );
-
-#if 0
- if (sigsetjmp(currentp->regs, 1) == 0) { /* Save the current context */
- siglongjmp(nextp->regs, 0); /* Switch to the new context */
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- status
- );
- }
-#endif
-
-#ifdef RTEMS_DEBUG
- if (_CPU_ISR_Get_level() == 0)
- abort();
-#endif
-
- _CPU_ISR_Enable(currentp->isr_level);
-}
-
-static void do_jump(
- Context_Control_overlay *currentp,
- Context_Control_overlay *nextp
-)
-{
- int status;
-
- if (setjmp(currentp->regs) == 0) { /* Save the current context */
- longjmp(nextp->regs, 0); /* Switch to the new context */
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- status
- );
- }
-}
-
-/*PAGE
- *
- * _CPU_Save_float_context
- */
-
-void _CPU_Save_float_context(
- Context_Control_fp *fp_context
-)
-{
-}
-
-/*PAGE
- *
- * _CPU_Restore_float_context
- */
-
-void _CPU_Restore_float_context(
- Context_Control_fp *fp_context
-)
-{
-}
-
-/*PAGE
- *
- * _CPU_ISR_Disable_support
- */
-
-unsigned32 _CPU_ISR_Disable_support(void)
-{
- int status;
- sigset_t old_mask;
-
- status = sigprocmask(SIG_BLOCK, &_CPU_Signal_mask, &old_mask);
- if ( status )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- status
- );
-
- if (memcmp((void *)&posix_empty_mask, (void *)&old_mask, sizeof(sigset_t)))
- return 1;
-
- return 0;
-}
-
-/*PAGE
- *
- * _CPU_ISR_Enable
- */
-
-void _CPU_ISR_Enable(
- unsigned32 level
-)
-{
- int status;
-
- if (level == 0)
- status = sigprocmask(SIG_UNBLOCK, &_CPU_Signal_mask, 0);
- else
- status = sigprocmask(SIG_BLOCK, &_CPU_Signal_mask, 0);
-
- if ( status )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- status
- );
-}
-
-/*PAGE
- *
- * _CPU_ISR_Handler
- *
- * External interrupt handler.
- * This is installed as a UNIX signal handler.
- * It vectors out to specific user interrupt handlers.
- */
-
-void _CPU_ISR_Handler(int vector)
-{
- extern void _Thread_Dispatch(void);
- extern unsigned32 _Thread_Dispatch_disable_level;
- extern boolean _Context_Switch_necessary;
-
- if (_ISR_Nest_level++ == 0) {
- /* switch to interrupt stack */
- }
-
- _Thread_Dispatch_disable_level++;
-
- if (_ISR_Vector_table[vector]) {
- _ISR_Vector_table[vector](vector);
- } else {
- _CPU_Stray_signal(vector);
- }
-
- if (_ISR_Nest_level-- == 0) {
- /* switch back to original stack */
- }
-
- _Thread_Dispatch_disable_level--;
-
- if (_Thread_Dispatch_disable_level == 0 &&
- (_Context_Switch_necessary || _ISR_Signals_to_thread_executing)) {
- _ISR_Signals_to_thread_executing = FALSE;
- _CPU_ISR_Enable(0);
- _Thread_Dispatch();
- }
-}
-
-/*PAGE
- *
- * _CPU_Stray_signal
- */
-
-void _CPU_Stray_signal(int sig_num)
-{
- char buffer[ 4 ];
-
- /*
- * print "stray" msg about ones which that might mean something
- * Avoid using the stdio section of the library.
- * The following is generally safe.
- */
-
- switch (sig_num)
- {
-#ifdef SIGCLD
- case SIGCLD:
- break;
-#endif
- default:
- {
- /*
- * We avoid using the stdio section of the library.
- * The following is generally safe
- */
-
- int digit;
- int number = sig_num;
- int len = 0;
-
- digit = number / 100;
- number %= 100;
- if (digit) buffer[len++] = '0' + digit;
-
- digit = number / 10;
- number %= 10;
- if (digit || len) buffer[len++] = '0' + digit;
-
- digit = number;
- buffer[len++] = '0' + digit;
-
- buffer[ len++ ] = '\n';
-
- write( 2, "Stray signal ", 13 );
- write( 2, buffer, len );
-
- }
- }
-
- /*
- * If it was a "fatal" signal, then exit here
- * If app code has installed a hander for one of these, then
- * we won't call _CPU_Stray_signal, so this is ok.
- */
-
- switch (sig_num) {
- case SIGINT:
- case SIGHUP:
- case SIGQUIT:
- case SIGILL:
-#ifdef SIGEMT
- case SIGEMT:
-#endif
- case SIGKILL:
- case SIGBUS:
- case SIGSEGV:
- case SIGTERM:
- case SIGIOT:
- _CPU_Fatal_error(0x100 + sig_num);
- }
-}
-
-/*PAGE
- *
- * _CPU_Fatal_error
- */
-
-void _CPU_Fatal_error(unsigned32 error)
-{
- setitimer(ITIMER_REAL, 0, 0);
-
- if ( error ) {
-#ifdef RTEMS_DEBUG
- abort();
-#endif
- if (getenv("RTEMS_DEBUG"))
- abort();
- }
-
- _exit(error);
-}
-
-/*
- * Special Purpose Routines to hide the use of UNIX system calls.
- */
-
-int _CPU_Set_sync_io_handler(
- int fd,
- boolean read,
- boolean write,
- boolean except,
- rtems_sync_io_handler handler
-)
-{
- if ((fd < FD_SETSIZE) && (_CPU_Sync_io_handlers[fd] == NULL)) {
- if (read)
- FD_SET(fd, &sync_io_readfds);
- else
- FD_CLR(fd, &sync_io_readfds);
- if (write)
- FD_SET(fd, &sync_io_writefds);
- else
- FD_CLR(fd, &sync_io_writefds);
- if (except)
- FD_SET(fd, &sync_io_exceptfds);
- else
- FD_CLR(fd, &sync_io_exceptfds);
- _CPU_Sync_io_handlers[fd] = handler;
- if ((fd + 1) > sync_io_nfds)
- sync_io_nfds = fd + 1;
- return 0;
- }
- return -1;
-}
-
-int _CPU_Clear_sync_io_handler(
- int fd
-)
-{
- if ((fd < FD_SETSIZE) && _CPU_Sync_io_handlers[fd]) {
- FD_CLR(fd, &sync_io_readfds);
- FD_CLR(fd, &sync_io_writefds);
- FD_CLR(fd, &sync_io_exceptfds);
- _CPU_Sync_io_handlers[fd] = NULL;
- sync_io_nfds = 0;
- for (fd = 0; fd < FD_SETSIZE; fd++)
- if (FD_ISSET(fd, &sync_io_readfds) ||
- FD_ISSET(fd, &sync_io_writefds) ||
- FD_ISSET(fd, &sync_io_exceptfds))
- sync_io_nfds = fd + 1;
- return 0;
- }
- return -1;
-}
-
-int _CPU_Get_clock_vector( void )
-{
- return SIGALRM;
-}
-
-void _CPU_Start_clock(
- int microseconds
-)
-{
- struct itimerval new;
-
- new.it_value.tv_sec = 0;
- new.it_value.tv_usec = microseconds;
- new.it_interval.tv_sec = 0;
- new.it_interval.tv_usec = microseconds;
-
- setitimer(ITIMER_REAL, &new, 0);
-}
-
-void _CPU_Stop_clock( void )
-{
- struct itimerval new;
- struct sigaction act;
-
- /*
- * Set the SIGALRM signal to ignore any last
- * signals that might come in while we are
- * disarming the timer and removing the interrupt
- * vector.
- */
-
- (void) memset(&act, 0, sizeof(act));
- act.sa_handler = SIG_IGN;
-
- sigaction(SIGALRM, &act, 0);
-
- (void) memset(&new, 0, sizeof(new));
- setitimer(ITIMER_REAL, &new, 0);
-}
-
-int _CPU_SHM_Semid;
-extern void fix_syscall_errno( void );
-
-void _CPU_SHM_Init(
- unsigned32 maximum_nodes,
- boolean is_master_node,
- void **shm_address,
- unsigned32 *shm_length
-)
-{
- int i;
- int shmid;
- char *shm_addr;
- key_t shm_key;
- key_t sem_key;
- int status = 0; /* to avoid unitialized warnings */
- int shm_size;
-
- if (getenv("RTEMS_SHM_KEY"))
- shm_key = strtol(getenv("RTEMS_SHM_KEY"), 0, 0);
- else
-#ifdef RTEMS_SHM_KEY
- shm_key = RTEMS_SHM_KEY;
-#else
- shm_key = 0xa000;
-#endif
-
- if (getenv("RTEMS_SHM_SIZE"))
- shm_size = strtol(getenv("RTEMS_SHM_SIZE"), 0, 0);
- else
-#ifdef RTEMS_SHM_SIZE
- shm_size = RTEMS_SHM_SIZE;
-#else
- shm_size = 64 * 1024;
-#endif
-
- if (getenv("RTEMS_SHM_SEMAPHORE_KEY"))
- sem_key = strtol(getenv("RTEMS_SHM_SEMAPHORE_KEY"), 0, 0);
- else
-#ifdef RTEMS_SHM_SEMAPHORE_KEY
- sem_key = RTEMS_SHM_SEMAPHORE_KEY;
-#else
- sem_key = 0xa001;
-#endif
-
- shmid = shmget(shm_key, shm_size, IPC_CREAT | 0660);
- if ( shmid == -1 ) {
- fix_syscall_errno(); /* in case of newlib */
- perror( "shmget" );
- _CPU_Fatal_halt( 0xdead0001 );
- }
-
- shm_addr = shmat(shmid, (char *)0, SHM_RND);
- if ( shm_addr == (void *)-1 ) {
- fix_syscall_errno(); /* in case of newlib */
- perror( "shmat" );
- _CPU_Fatal_halt( 0xdead0002 );
- }
-
- _CPU_SHM_Semid = semget(sem_key, maximum_nodes + 1, IPC_CREAT | 0660);
- if ( _CPU_SHM_Semid == -1 ) {
- fix_syscall_errno(); /* in case of newlib */
- perror( "semget" );
- _CPU_Fatal_halt( 0xdead0003 );
- }
-
- if ( is_master_node ) {
- for ( i=0 ; i <= maximum_nodes ; i++ ) {
-#if defined(solaris2)
- union semun {
- int val;
- struct semid_ds *buf;
- ushort *array;
- } help;
-
- help.val = 1;
- status = semctl( _CPU_SHM_Semid, i, SETVAL, help );
-#elif defined(__linux__) || defined(__FreeBSD__)
- union semun help;
-
- help.val = 1;
- status = semctl( _CPU_SHM_Semid, i, SETVAL, help );
-#elif defined(hpux)
- status = semctl( _CPU_SHM_Semid, i, SETVAL, 1 );
-#else
-#error "Not a supported unix variant"
-#endif
-
- fix_syscall_errno(); /* in case of newlib */
- if ( status == -1 ) {
- _CPU_Fatal_halt( 0xdead0004 );
- }
- }
- }
-
- *shm_address = shm_addr;
- *shm_length = shm_size;
-
-}
-
-int _CPU_Get_pid( void )
-{
- return getpid();
-}
-
-/*
- * Define this to use signals for MPCI shared memory driver.
- * If undefined, the shared memory driver will poll from the
- * clock interrupt.
- * Ref: ../shmsupp/getcfg.c
- *
- * BEWARE:: many UN*X kernels and debuggers become severely confused when
- * debugging programs which use signals. The problem is *much*
- * worse when using multiple signals, since ptrace(2) tends to
- * drop all signals except 1 in the case of multiples.
- * On hpux9, this problem was so bad, we couldn't use interrupts
- * with the shared memory driver if we ever hoped to debug
- * RTEMS programs.
- * Maybe systems that use /proc don't have this problem...
- */
-
-
-int _CPU_SHM_Get_vector( void )
-{
-#ifdef CPU_USE_SHM_INTERRUPTS
- return SIGUSR1;
-#else
- return 0;
-#endif
-}
-
-void _CPU_SHM_Send_interrupt(
- int pid,
- int vector
-)
-{
- kill((pid_t) pid, vector);
-}
-
-void _CPU_SHM_Lock(
- int semaphore
-)
-{
- struct sembuf sb;
-
- sb.sem_num = semaphore;
- sb.sem_op = -1;
- sb.sem_flg = 0;
-
- while (1) {
- int status = -1;
-
- status = semop(_CPU_SHM_Semid, &sb, 1);
- if ( status >= 0 )
- break;
- if ( status == -1 ) {
- fix_syscall_errno(); /* in case of newlib */
- if (errno == EINTR)
- continue;
- perror("shm lock");
- _CPU_Fatal_halt( 0xdead0005 );
- }
- }
-
-}
-
-void _CPU_SHM_Unlock(
- int semaphore
-)
-{
- struct sembuf sb;
- int status;
-
- sb.sem_num = semaphore;
- sb.sem_op = 1;
- sb.sem_flg = 0;
-
- while (1) {
- status = semop(_CPU_SHM_Semid, &sb, 1);
- if ( status >= 0 )
- break;
-
- if ( status == -1 ) {
- fix_syscall_errno(); /* in case of newlib */
- if (errno == EINTR)
- continue;
- perror("shm unlock");
- _CPU_Fatal_halt( 0xdead0006 );
- }
- }
-
-}
diff --git a/cpukit/score/include/rtems/debug.h b/cpukit/score/include/rtems/debug.h
deleted file mode 100644
index 5c83e67d05..0000000000
--- a/cpukit/score/include/rtems/debug.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* debug.h
- *
- * This include file contains the information pertaining to the debug
- * support within RTEMS. It is currently cast in the form of a
- * Manager since it is externally accessible.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_DEBUG_h
-#define __RTEMS_DEBUG_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type is used to manage the debug mask.
- */
-
-typedef unsigned32 rtems_debug_control;
-
-/*
- * These constants represent various classes of debugging.
- */
-
-#define RTEMS_DEBUG_ALL_MASK 0xffffffff
-#define RTEMS_DEBUG_REGION 0x00000001
-
-/*
- * This variable contains the current debug level.
- */
-
-SCORE_EXTERN rtems_debug_control _Debug_Level;
-
-/*
- * _Debug_Manager_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _Debug_Manager_initialization( void );
-
-/*
- * rtems_debug_enable
- *
- * DESCRIPTION:
- *
- * This routine enables the specified types of debug checks.
- */
-
-void rtems_debug_enable (
- rtems_debug_control to_be_enabled
-);
-
-/*
- * rtems_debug_disable
- *
- * DESCRIPTION:
- *
- * This routine disables the specified types of debug checks.
- */
-
-void rtems_debug_disable (
- rtems_debug_control to_be_disabled
-);
-
-/*
- *
- * _Debug_Is_enabled
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the requested debug level is
- * enabled, and FALSE otherwise.
- */
-
-boolean _Debug_Is_enabled(
- rtems_debug_control level
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/address.h b/cpukit/score/include/rtems/score/address.h
deleted file mode 100644
index e64cd54931..0000000000
--- a/cpukit/score/include/rtems/score/address.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* address.h
- *
- * This include file contains the information required to manipulate
- * physical addresses.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_ADDRESSES_h
-#define __RTEMS_ADDRESSES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/address.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/apiext.h b/cpukit/score/include/rtems/score/apiext.h
deleted file mode 100644
index 804b2dea4c..0000000000
--- a/cpukit/score/include/rtems/score/apiext.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* apiext.h
- *
- * XXX
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __API_EXTENSIONS_h
-#define __API_EXTENSIONS_h
-
-#include <rtems/score/chain.h>
-#include <rtems/score/thread.h>
-
-/*
- * The control structure which defines the points at which an API
- * can add an extension to the system initialization thread.
- */
-
-typedef void (*API_extensions_Predriver_hook)(void);
-typedef void (*API_extensions_Postdriver_hook)(void);
-typedef void (*API_extensions_Postswitch_hook)(
- Thread_Control *
- );
-
-
-typedef struct {
- Chain_Node Node;
- API_extensions_Predriver_hook predriver_hook;
- API_extensions_Postdriver_hook postdriver_hook;
- API_extensions_Postswitch_hook postswitch_hook;
-} API_extensions_Control;
-
-/*
- * This is the list of API extensions to the system initialization.
- */
-
-SCORE_EXTERN Chain_Control _API_extensions_List;
-
-/*
- * _API_extensions_Initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the API extension handler.
- *
- */
-
-void _API_extensions_Initialization( void );
-
-/*
- * _API_extensions_Add
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _API_extensions_Add(
- API_extensions_Control *the_extension
-);
-
-/*
- * _API_extensions_Run_predriver
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _API_extensions_Run_predriver( void );
-
-/*
- * _API_extensions_Run_postdriver
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _API_extensions_Run_postdriver( void );
-
-/*
- * _API_extensions_Run_postswitch
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _API_extensions_Run_postswitch( void );
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/bitfield.h b/cpukit/score/include/rtems/score/bitfield.h
deleted file mode 100644
index bbced47652..0000000000
--- a/cpukit/score/include/rtems/score/bitfield.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* bitfield.h
- *
- * This include file contains all bit field manipulation routines.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_BITFIELD_h
-#define __RTEMS_BITFIELD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * _Bitfield_Find_first_bit
- *
- * DESCRIPTION:
- *
- * This routine returns the bit_number of the first bit set
- * in the specified value. The correspondence between bit_number
- * and actual bit position is processor dependent. The search for
- * the first bit set may run from most to least significant bit
- * or vice-versa.
- *
- * NOTE:
- *
- * This routine is used when the executing thread is removed
- * from the ready state and, as a result, its performance has a
- * significant impact on the performance of the executive as a whole.
- */
-
-#if ( CPU_USE_GENERIC_BITFIELD_DATA == TRUE )
-
-#ifndef SCORE_INIT
-extern const unsigned char __log2table[256];
-#else
-const unsigned char __log2table[256] = {
- 7, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 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,
- 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, 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, 0, 0
-};
-#endif
-
-#endif
-
-#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE )
-
-#define _Bitfield_Find_first_bit( _value, _bit_number ) \
- _CPU_Bitfield_Find_first_bit( _value, _bit_number )
-
-#else
-
-/*
- * The following must be a macro because if a CPU specific version
- * is used it will most likely use inline assembly.
- */
-
-#define _Bitfield_Find_first_bit( _value, _bit_number ) \
- { \
- register unsigned32 __value = (unsigned32) (_value); \
- register const unsigned char *__p = __log2table; \
- \
- if ( __value < 0x100 ) \
- (_bit_number) = __p[ __value ] + 8; \
- else \
- (_bit_number) = __p[ __value >> 8 ]; \
- }
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/chain.h b/cpukit/score/include/rtems/score/chain.h
deleted file mode 100644
index 910f5e4414..0000000000
--- a/cpukit/score/include/rtems/score/chain.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/* chain.h
- *
- * This include file contains all the constants and structures associated
- * with the Doubly Linked Chain Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CHAIN_h
-#define __RTEMS_CHAIN_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/address.h>
-
-/*
- * This is used to manage each element (node) which is placed
- * on a chain.
- *
- * NOTE: Typically, a more complicated structure will use the
- * chain package. The more complicated structure will
- * include a chain node as the first element in its
- * control structure. It will then call the chain package
- * with a pointer to that node element. The node pointer
- * and the higher level structure start at the same address
- * so the user can cast the pointers back and forth.
- *
- */
-
-typedef struct Chain_Node_struct Chain_Node;
-
-struct Chain_Node_struct {
- Chain_Node *next;
- Chain_Node *previous;
-};
-
-/*
- * This is used to manage a chain. A chain consists of a doubly
- * linked list of zero or more nodes.
- *
- * NOTE: This implementation does not require special checks for
- * manipulating the first and last elements on the chain.
- * To accomplish this the chain control structure is
- * treated as two overlapping chain nodes. The permanent
- * head of the chain overlays a node structure on the
- * first and permanent_null fields. The permanent tail
- * of the chain overlays a node structure on the
- * permanent_null and last elements of the structure.
- *
- */
-
-typedef struct {
- Chain_Node *first;
- Chain_Node *permanent_null;
- Chain_Node *last;
-} Chain_Control;
-
-/*
- * _Chain_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the_chain structure to manage the
- * contiguous array of number_nodes nodes which starts at
- * starting_address. Each node is of node_size bytes.
- *
- */
-
-void _Chain_Initialize(
- Chain_Control *the_chain,
- void *starting_address,
- unsigned32 number_nodes,
- unsigned32 node_size
-);
-
-/*
- * _Chain_Get_first_unprotected
- */
-
-#ifndef USE_INLINES
-Chain_Node *_Chain_Get_first_unprotected(
- Chain_Control *the_chain
-);
-#endif
-
-/*
- * _Chain_Extract
- *
- * DESCRIPTION:
- *
- * This routine extracts the_node from the chain on which it resides.
- * It disables interrupts to insure the atomicity of the
- * extract operation.
- *
- */
-
-void _Chain_Extract(
- Chain_Node *the_node
-);
-
-/*
- * _Chain_Get
- *
- * DESCRIPTION:
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. If the_chain is empty, then NULL is returned.
- * It disables interrupts to insure the atomicity of the
- * get operation.
- *
- */
-
-Chain_Node *_Chain_Get(
- Chain_Control *the_chain
-);
-
-/*
- * _Chain_Insert
- *
- * DESCRIPTION:
- *
- * This routine inserts the_node on a chain immediately following
- * after_node. It disables interrupts to insure the atomicity
- * of the extract operation.
- *
- */
-
-void _Chain_Insert(
- Chain_Node *after_node,
- Chain_Node *the_node
-);
-
-/*
- * _Chain_Append
- *
- * DESCRIPTION:
- *
- * This routine appends the_node onto the end of the_chain.
- * It disables interrupts to insure the atomicity of the
- * append operation.
- *
- */
-
-void _Chain_Append(
- Chain_Control *the_chain,
- Chain_Node *the_node
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/chain.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/context.h b/cpukit/score/include/rtems/score/context.h
deleted file mode 100644
index 5a22fd4b6d..0000000000
--- a/cpukit/score/include/rtems/score/context.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/* context.h
- *
- * This include file contains all information about a context.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CONTEXT_h
-#define __RTEMS_CONTEXT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/cpu.h>
-
-/*
- * The following constant defines the number of bytes required
- * to store a full floating point context.
- */
-
-#define CONTEXT_FP_SIZE CPU_CONTEXT_FP_SIZE
-
-/*
- * The following variable is set to TRUE when a reschedule operation
- * has determined that the processor should be taken away from the
- * currently executing thread and given to the heir thread.
- */
-
-SCORE_EXTERN volatile boolean _Context_Switch_necessary;
-
-/*
- * _Context_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes THE_CONTEXT such that the stack
- * pointer, interrupt level, and entry point are correct for the
- * thread's initial state.
- */
-
-#define \
- _Context_Initialize( _the_context, _stack, _size, _isr, _entry, _is_fp ) \
- _CPU_Context_Initialize( _the_context, _stack, _size, _isr, _entry, _is_fp )
-
-/*
- * _Context_Switch
- *
- * DESCRIPTION:
- *
- * This routine saves the current context into the EXECUTING
- * context record and restores the context specified by HEIR.
- */
-
-#define _Context_Switch( _executing, _heir ) \
- _CPU_Context_switch( _executing, _heir )
-
-/*
- * _Context_Restart_self
- *
- * DESCRIPTION:
- *
- * This routine restarts the calling thread by restoring its initial
- * stack pointer and returning to the thread's entry point.
- */
-
-#define _Context_Restart_self( _the_context ) \
- _CPU_Context_Restart_self( _the_context )
-
-/*
- * _Context_Fp_start
- *
- * DESCRIPTION:
- *
- * This function returns the starting address of the floating
- * point context save area. It is assumed that the are reserved
- * for the floating point save area is large enough.
- */
-
-#define _Context_Fp_start( _base, _offset ) \
- _CPU_Context_Fp_start( (_base), (_offset) )
-
-/*
- * _Context_Initialize_fp
- *
- * DESCRIPTION:
- *
- * This routine initializes the floating point context save
- * area to contain an initial known state.
- */
-
-#define _Context_Initialize_fp( _fp_area ) \
- _CPU_Context_Initialize_fp( _fp_area )
-
-/*
- * _Context_Restore_fp
- *
- * DESCRIPTION:
- *
- * This routine restores the floating point context contained
- * in the FP_CONTEXT area. It is assumed that the current
- * floating point context has been saved by a previous invocation
- * of SAVE_FP.
- */
-
-#define _Context_Restore_fp( _fp ) \
- _CPU_Context_restore_fp( _fp )
-
-/*
- * _Context_Save_fp
- *
- * DESCRIPTION:
- *
- * This routine saves the current floating point context
- * in the FP_CONTEXT area.
- */
-
-#define _Context_Save_fp( _fp ) \
- _CPU_Context_save_fp( _fp )
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/copyrt.h b/cpukit/score/include/rtems/score/copyrt.h
deleted file mode 100644
index 3a9a5a5c60..0000000000
--- a/cpukit/score/include/rtems/score/copyrt.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* copyrt.h
- *
- * This include file contains the copyright notice for RTEMS
- * which is included in every binary copy of the executive.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_COPYRIGHT_h
-#define __RTEMS_COPYRIGHT_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef SCORE_INIT
-
-const char _Copyright_Notice[] =
-"COPYRIGHT (c) 1989-1998.\n\
-On-Line Applications Research Corporation (OAR).\n\
-Copyright assigned to U.S. Government, 1994.\n";
-
-#else
-
-extern const char _Copyright_Notice[];
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/coremsg.h b/cpukit/score/include/rtems/score/coremsg.h
deleted file mode 100644
index 03277e12b7..0000000000
--- a/cpukit/score/include/rtems/score/coremsg.h
+++ /dev/null
@@ -1,267 +0,0 @@
-/* coremsg.h
- *
- * This include file contains all the constants and structures associated
- * with the Message queue Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CORE_MESSAGE_QUEUE_h
-#define __RTEMS_CORE_MESSAGE_QUEUE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following type defines the callout which the API provides
- * to support global/multiprocessor operations on message_queues.
- */
-
-typedef void ( *CORE_message_queue_API_mp_support_callout )(
- Thread_Control *,
- Objects_Id
- );
-
-/*
- * The following defines the data types needed to manipulate
- * the contents of message buffers.
- *
- * NOTE: The buffer field is normally longer than a single unsigned32.
- * but since messages are variable length we just make a ptr to 1.
- */
-
-typedef struct {
- unsigned32 size;
- unsigned32 buffer[1];
-} CORE_message_queue_Buffer;
-
-/*
- * The following records define the organization of a message
- * buffer.
- */
-
-typedef struct {
- Chain_Node Node;
- CORE_message_queue_Buffer Contents;
-} CORE_message_queue_Buffer_control;
-
-/*
- * Blocking disciplines for a message_queue.
- */
-
-typedef enum {
- CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO,
- CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY
-} CORE_message_queue_Disciplines;
-
-/*
- * The following enumerated type details the modes in which a message
- * may be submitted to a message queue. The message may be posted
- * in a send or urgent fashion.
- */
-
-typedef enum {
- CORE_MESSAGE_QUEUE_SEND_REQUEST = 0,
- CORE_MESSAGE_QUEUE_URGENT_REQUEST = 1
-} CORE_message_queue_Submit_types;
-
-/*
- * Core Message queue handler return statuses.
- */
-
-typedef enum {
- CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL,
- CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE,
- CORE_MESSAGE_QUEUE_STATUS_TOO_MANY,
- CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED,
- CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT,
- CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED,
- CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
-} CORE_message_queue_Status;
-
-/*
- * The following defines the control block used to manage the
- * attributes of each message queue.
- */
-
-typedef struct {
- CORE_message_queue_Disciplines discipline;
-} CORE_message_queue_Attributes;
-
-/*
- * The following defines the type for a Notification handler. A notification
- * handler is invoked when the message queue makes a 0->1 transition on
- * pending messages.
- */
-
-typedef void (*CORE_message_queue_Notify_Handler)( void * );
-
-/*
- * The following defines the control block used to manage each
- * counting message_queue.
- */
-
-typedef struct {
- Thread_queue_Control Wait_queue;
- CORE_message_queue_Attributes Attributes;
- unsigned32 maximum_pending_messages;
- unsigned32 number_of_pending_messages;
- unsigned32 maximum_message_size;
- Chain_Control Pending_messages;
- CORE_message_queue_Buffer *message_buffers;
- CORE_message_queue_Notify_Handler notify_handler;
- void *notify_argument;
- Chain_Control Inactive_messages;
-} CORE_message_queue_Control;
-
-/*
- * _CORE_message_queue_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the message_queue based on the parameters passed.
- */
-
-boolean _CORE_message_queue_Initialize(
- CORE_message_queue_Control *the_message_queue,
- Objects_Classes the_class,
- CORE_message_queue_Attributes *the_message_queue_attributes,
- unsigned32 maximum_pending_messages,
- unsigned32 maximum_message_size,
- Thread_queue_Extract_callout proxy_extract_callout
-);
-
-/*
- * _CORE_message_queue_Close
- *
- * DESCRIPTION:
- *
- * This function closes a message by returning all allocated space and
- * flushing the message_queue's task wait queue.
- */
-
-void _CORE_message_queue_Close(
- CORE_message_queue_Control *the_message_queue,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-);
-
-/*
- *
- * _CORE_message_queue_Flush
- *
- * DESCRIPTION:
- *
- * This function flushes the message_queue's task wait queue. The number
- * messages flushed from the queue is returned.
- *
- */
-
-unsigned32 _CORE_message_queue_Flush(
- CORE_message_queue_Control *the_message_queue
-);
-
-/*
- * _CORE_message_queue_Flush_support
- *
- * DESCRIPTION:
- *
- * This routine flushes all outstanding messages and returns
- * them to the inactive message chain.
- */
-
-unsigned32 _CORE_message_queue_Flush_support(
- CORE_message_queue_Control *the_message_queue
-);
-
-/*
- *
- * _CORE_message_queue_Broadcast
- *
- * DESCRIPTION:
- *
- * This function sends a message for every thread waiting on the queue and
- * returns the number of threads made ready by the message.
- *
- */
-
-CORE_message_queue_Status _CORE_message_queue_Broadcast(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support,
- unsigned32 *count
-);
-
-/*
- *
- * _CORE_message_queue_Submit
- *
- * DESCRIPTION:
- *
- * This routine implements the send and urgent message functions. It
- * processes a message that is to be submitted to the designated
- * message queue. The message will either be processed as a
- * send message which it will be inserted at the rear of the queue
- * or it will be processed as an urgent message which will be inserted
- * at the front of the queue.
- *
- */
-
-CORE_message_queue_Status _CORE_message_queue_Submit(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support,
- CORE_message_queue_Submit_types submit_type
-);
-
-/*
- *
- * _CORE_message_queue_Seize
- *
- * DESCRIPTION:
- *
- * This kernel routine dequeues a message, copies the message buffer to
- * a given destination buffer, and frees the message buffer to the
- * inactive message pool. The thread will be blocked if wait is TRUE,
- * otherwise an error will be given to the thread if no messages are available.
- *
- */
-
-void _CORE_message_queue_Seize(
- CORE_message_queue_Control *the_message_queue,
- Objects_Id id,
- void *buffer,
- unsigned32 *size,
- boolean wait,
- Watchdog_Interval timeout
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/coremsg.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/score/include/rtems/score/coremutex.h b/cpukit/score/include/rtems/score/coremutex.h
deleted file mode 100644
index 7145e4f19f..0000000000
--- a/cpukit/score/include/rtems/score/coremutex.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/* mutex.h
- *
- * This include file contains all the constants and structures associated
- * with the Mutex Handler. A mutex is an enhanced version of the standard
- * Dijkstra binary semaphore used to provide synchronization and mutual
- * exclusion capabilities.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CORE_MUTEX_h
-#define __RTEMS_CORE_MUTEX_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following type defines the callout which the API provides
- * to support global/multiprocessor operations on mutexes.
- */
-
-typedef void ( *CORE_mutex_API_mp_support_callout )(
- Thread_Control *,
- Objects_Id
- );
-
-/*
- * Blocking disciplines for a mutex.
- */
-
-typedef enum {
- CORE_MUTEX_DISCIPLINES_FIFO,
- CORE_MUTEX_DISCIPLINES_PRIORITY,
- CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT,
- CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING
-} CORE_mutex_Disciplines;
-
-/*
- * Mutex handler return statuses.
- */
-
-typedef enum {
- CORE_MUTEX_STATUS_SUCCESSFUL,
- CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT,
- CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED,
- CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE,
- CORE_MUTEX_WAS_DELETED,
- CORE_MUTEX_TIMEOUT,
- CORE_MUTEX_STATUS_CEILING_VIOLATED
-} CORE_mutex_Status;
-
-/*
- * Locked and unlocked values
- */
-
-#define CORE_MUTEX_UNLOCKED 1
-#define CORE_MUTEX_LOCKED 0
-
-/*
- * The following defines the control block used to manage the
- * attributes of each mutex.
- */
-
-typedef struct {
- boolean allow_nesting;
- CORE_mutex_Disciplines discipline;
- Priority_Control priority_ceiling;
-} CORE_mutex_Attributes;
-
-/*
- * The following defines the control block used to manage each mutex.
- */
-
-typedef struct {
- Thread_queue_Control Wait_queue;
- CORE_mutex_Attributes Attributes;
- unsigned32 lock;
- unsigned32 nest_count;
- Thread_Control *holder;
- Objects_Id holder_id;
-} CORE_mutex_Control;
-
-/*
- * _CORE_mutex_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the mutex based on the parameters passed.
- */
-
-void _CORE_mutex_Initialize(
- CORE_mutex_Control *the_mutex,
- Objects_Classes the_class,
- CORE_mutex_Attributes *the_mutex_attributes,
- unsigned32 initial_lock,
- Thread_queue_Extract_callout proxy_extract_callout
-);
-
-/*
- * _CORE_mutex_Seize
- *
- * DESCRIPTION:
- *
- * This routine attempts to receive a unit from the_mutex.
- * If a unit is available or if the wait flag is FALSE, then the routine
- * returns. Otherwise, the calling task is blocked until a unit becomes
- * available.
- */
-
-void _CORE_mutex_Seize(
- CORE_mutex_Control *the_mutex,
- Objects_Id id,
- boolean wait,
- Watchdog_Interval timeout
-);
-
-/*
- * _CORE_mutex_Surrender
- *
- * DESCRIPTION:
- *
- * This routine frees a unit to the mutex. If a task was blocked waiting for
- * a unit from this mutex, then that task will be readied and the unit
- * given to that task. Otherwise, the unit will be returned to the mutex.
- */
-
-CORE_mutex_Status _CORE_mutex_Surrender(
- CORE_mutex_Control *the_mutex,
- Objects_Id id,
- CORE_mutex_API_mp_support_callout api_mutex_mp_support
-);
-
-/*
- * _CORE_mutex_Flush
- *
- * DESCRIPTION:
- *
- * This routine assists in the deletion of a mutex by flushing the associated
- * wait queue.
- */
-
-void _CORE_mutex_Flush(
- CORE_mutex_Control *the_mutex,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/coremutex.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/score/include/rtems/score/coresem.h b/cpukit/score/include/rtems/score/coresem.h
deleted file mode 100644
index 2ef1371e8d..0000000000
--- a/cpukit/score/include/rtems/score/coresem.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/* core_sem.h
- *
- * This include file contains all the constants and structures associated
- * with the Counting Semaphore Handler. A counting semaphore is the
- * standard Dijkstra binary semaphore used to provide synchronization
- * and mutual exclusion capabilities.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_CORE_COUNTING_SEMAPHORE_h
-#define __RTEMS_CORE_COUNTING_SEMAPHORE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following type defines the callout which the API provides
- * to support global/multiprocessor operations on semaphores.
- */
-
-typedef void ( *CORE_semaphore_API_mp_support_callout )(
- Thread_Control *,
- Objects_Id
- );
-
-/*
- * Blocking disciplines for a semaphore.
- */
-
-typedef enum {
- CORE_SEMAPHORE_DISCIPLINES_FIFO,
- CORE_SEMAPHORE_DISCIPLINES_PRIORITY
-} CORE_semaphore_Disciplines;
-
-/*
- * Core Semaphore handler return statuses.
- */
-
-typedef enum {
- CORE_SEMAPHORE_STATUS_SUCCESSFUL,
- CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT,
- CORE_SEMAPHORE_WAS_DELETED,
- CORE_SEMAPHORE_TIMEOUT
-} CORE_semaphore_Status;
-
-/*
- * The following defines the control block used to manage the
- * attributes of each semaphore.
- */
-
-typedef struct {
- CORE_semaphore_Disciplines discipline;
-} CORE_semaphore_Attributes;
-
-/*
- * The following defines the control block used to manage each
- * counting semaphore.
- */
-
-typedef struct {
- Thread_queue_Control Wait_queue;
- CORE_semaphore_Attributes Attributes;
- unsigned32 count;
-} CORE_semaphore_Control;
-
-/*
- * _CORE_semaphore_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the semaphore based on the parameters passed.
- */
-
-void _CORE_semaphore_Initialize(
- CORE_semaphore_Control *the_semaphore,
- Objects_Classes the_class,
- CORE_semaphore_Attributes *the_semaphore_attributes,
- unsigned32 initial_value,
- Thread_queue_Extract_callout proxy_extract_callout
-);
-
-/*
- * _CORE_semaphore_Seize
- *
- * DESCRIPTION:
- *
- * This routine attempts to receive a unit from the_semaphore.
- * If a unit is available or if the wait flag is FALSE, then the routine
- * returns. Otherwise, the calling task is blocked until a unit becomes
- * available.
- */
-
-void _CORE_semaphore_Seize(
- CORE_semaphore_Control *the_semaphore,
- Objects_Id id,
- boolean wait,
- Watchdog_Interval timeout
-);
-
-/*
- * _CORE_semaphore_Surrender
- *
- * DESCRIPTION:
- *
- * This routine frees a unit to the semaphore. If a task was blocked waiting
- * for a unit from this semaphore, then that task will be readied and the unit
- * given to that task. Otherwise, the unit will be returned to the semaphore.
- */
-
-CORE_semaphore_Status _CORE_semaphore_Surrender(
- CORE_semaphore_Control *the_semaphore,
- Objects_Id id,
- CORE_semaphore_API_mp_support_callout api_semaphore_mp_support
-);
-
-/*
- * _CORE_semaphore_Flush
- *
- * DESCRIPTION:
- *
- * This routine assists in the deletion of a semaphore by flushing the
- * associated wait queue.
- */
-
-void _CORE_semaphore_Flush(
- CORE_semaphore_Control *the_semaphore,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/coresem.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
-
diff --git a/cpukit/score/include/rtems/score/heap.h b/cpukit/score/include/rtems/score/heap.h
deleted file mode 100644
index eaee7cde3f..0000000000
--- a/cpukit/score/include/rtems/score/heap.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/* heap.h
- *
- * This include file contains the information pertaining to the Heap
- * Handler. A heap is a doubly linked list of variable size
- * blocks which are allocated using the first fit method. Garbage
- * collection is performed each time a block is returned to the heap by
- * coalescing neighbor blocks. Control information for both allocated
- * and unallocated blocks is contained in the heap space. A heap header
- * contains control information for the heap.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_HEAP_h
-#define __RTEMS_HEAP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Status codes for heap_extend
- */
-
-typedef enum {
- HEAP_EXTEND_SUCCESSFUL,
- HEAP_EXTEND_ERROR,
- HEAP_EXTEND_NOT_IMPLEMENTED
-} Heap_Extend_status;
-
-/*
- * Constants used in the size/used field of each heap block to
- * indicate when a block is free or in use.
- */
-
-#define HEAP_BLOCK_USED 1 /* indicates block is in use */
-#define HEAP_BLOCK_FREE 0 /* indicates block is free */
-
-/*
- * The size/used field value for the dummy front and back flags.
- */
-
-#define HEAP_DUMMY_FLAG (0 + HEAP_BLOCK_USED)
-
-/*
- * The following constants reflect various requirements of the
- * heap data structures which impact the management of a heap.
- *
- * NOTE: Because free block overhead is greater than used block
- * overhead AND a portion of the allocated space is from
- * the extra free block overhead, the absolute lower bound
- * of the minimum fragment size is equal to the size of
- * the free block overhead.
- */
-
-#define HEAP_OVERHEAD \
- (sizeof( unsigned32 ) * 2) /* size dummy first and last blocks */
-#define HEAP_BLOCK_USED_OVERHEAD \
- (sizeof( void * ) * 2) /* num bytes overhead in used block */
-#define HEAP_MINIMUM_SIZE \
- (HEAP_OVERHEAD + sizeof (Heap_Block))
- /* min number of bytes the user may */
- /* specify for the heap size */
-
-/*
- * The following defines the data structure used to manage
- * individual blocks in a heap. When the block is allocated, the
- * next and previous fields are not used by the Heap Handler
- * and thus the address returned for the block starts at
- * the address of the next field.
- *
- * NOTE: The next and previous pointers are only valid when the
- * block is free. Caution must be exercised to insure that
- * allocated blocks are large enough to contain them and
- * that they are not accidentally overwritten when the
- * block is actually allocated.
- */
-
-typedef struct Heap_Block_struct Heap_Block;
-
-struct Heap_Block_struct {
- unsigned32 back_flag; /* size and status of prev block */
- unsigned32 front_flag; /* size and status of block */
- Heap_Block *next; /* pointer to next block */
- Heap_Block *previous; /* pointer to previous block */
-};
-
-/*
- * The following defines the control block used to manage each heap.
- *
- * NOTE:
- *
- * This structure is layed out such that it can be used a a dummy
- * first and last block on the free block chain. The extra padding
- * insures the dummy last block is the correct size.
- *
- * The first Heap_Block starts at first while the second starts at
- * final. This is effectively the same trick as is used in the Chain
- * Handler.
- */
-
-typedef struct {
- Heap_Block *start; /* first valid block address in heap */
- Heap_Block *final; /* last valid block address in heap */
-
- Heap_Block *first; /* pointer to first block in heap */
- Heap_Block *permanent_null; /* always NULL pointer */
- Heap_Block *last; /* pointer to last block in heap */
- unsigned32 page_size; /* allocation unit */
- unsigned32 reserved;
-} Heap_Control;
-
-/*
- * _Heap_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the_heap record to manage the
- * contiguous heap of size bytes which starts at starting_address.
- * Blocks of memory are allocated from the heap in multiples of
- * page_size byte units.
- */
-
-unsigned32 _Heap_Initialize(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 size,
- unsigned32 page_size
-);
-
-/*
- * _Heap_Extend
- *
- * DESCRIPTION:
- *
- * This routine grows the_heap memory area using the size bytes which
- * begin at starting_address.
- */
-
-Heap_Extend_status _Heap_Extend(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 size,
- unsigned32 *amount_extended
-);
-
-/*
- * _Heap_Allocate
- *
- * DESCRIPTION:
- *
- * DESCRIPTION:
- *
- * This function attempts to allocate a block of size bytes from
- * the_heap. If insufficient memory is free in the_heap to allocate
- * a block of the requested size, then NULL is returned.
- */
-
-void *_Heap_Allocate(
- Heap_Control *the_heap,
- unsigned32 size
-);
-
-/*
- * _Heap_Size_of_user_area
- *
- * DESCRIPTION:
- *
- * This kernel routine sets size to the size of the given heap block.
- * It returns TRUE if the starting_address is in the heap, and FALSE
- * otherwise.
- */
-
-boolean _Heap_Size_of_user_area(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 *size
-);
-
-/*
- * _Heap_Free
- *
- * DESCRIPTION:
- *
- * This routine returns the block of memory which begins
- * at starting_address to the_heap. Any coalescing which is
- * possible with the freeing of this routine is performed.
- */
-
-boolean _Heap_Free(
- Heap_Control *the_heap,
- void *start_address
-);
-
-/*
- * _Heap_Walk
- *
- * DESCRIPTION:
- *
- * This routine walks the heap to verify its integrity.
- */
-
-void _Heap_Walk(
- Heap_Control *the_heap,
- int source,
- boolean do_dump
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/heap.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h
deleted file mode 100644
index e999ceff7a..0000000000
--- a/cpukit/score/include/rtems/score/interr.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* interr.h
- *
- * This include file contains constants and prototypes related
- * to the Internal Error Handler.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_INTERNAL_ERROR_h
-#define __RTEMS_INTERNAL_ERROR_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This type lists the possible sources from which an error
- * can be reported.
- */
-
-typedef enum {
- INTERNAL_ERROR_CORE,
- INTERNAL_ERROR_RTEMS_API,
- INTERNAL_ERROR_POSIX_API
-} Internal_errors_Source;
-
-/*
- * A list of errors which are generated internally by the executive core.
- */
-
-typedef enum {
- INTERNAL_ERROR_NO_CONFIGURATION_TABLE,
- INTERNAL_ERROR_NO_CPU_TABLE,
- INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS,
- INTERNAL_ERROR_TOO_LITTLE_WORKSPACE,
- INTERNAL_ERROR_WORKSPACE_ALLOCATION,
- INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL,
- INTERNAL_ERROR_THREAD_EXITTED,
- INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION,
- INTERNAL_ERROR_INVALID_NODE,
- INTERNAL_ERROR_NO_MPCI,
- INTERNAL_ERROR_BAD_PACKET,
- INTERNAL_ERROR_OUT_OF_PACKETS,
- INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS,
- INTERNAL_ERROR_OUT_OF_PROXIES,
- INTERNAL_ERROR_INVALID_GLOBAL_ID,
- INTERNAL_ERROR_BAD_STACK_HOOK
-} Internal_errors_Core_list;
-
-/*
- * This type holds the fatal error information.
- */
-
-typedef struct {
- Internal_errors_Source the_source;
- boolean is_internal;
- unsigned32 the_error;
-} Internal_errors_Information;
-
-/*
- * When a fatal error occurs, the error information is stored here.
- */
-
-SCORE_EXTERN Internal_errors_Information Internal_errors_What_happened;
-
-/*
- * _Internal_error_Occurred
- *
- * DESCRIPTION:
- *
- * This routine is invoked when the application or the executive itself
- * determines that a fatal error has occurred.
- */
-
-void volatile _Internal_error_Occurred(
- Internal_errors_Source the_source,
- boolean is_internal,
- unsigned32 the_error
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/isr.h b/cpukit/score/include/rtems/score/isr.h
deleted file mode 100644
index 97ffe7f2ec..0000000000
--- a/cpukit/score/include/rtems/score/isr.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/* isr.h
- *
- * This include file contains all the constants and structures associated
- * with the management of processor interrupt levels. This handler
- * supports interrupt critical sections, vectoring of user interrupt
- * handlers, nesting of interrupts, and manipulating interrupt levels.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __ISR_h
-#define __ISR_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type defines the control block used to manage
- * the interrupt level portion of the status register.
- */
-
-typedef unsigned32 ISR_Level;
-
-/*
- * The following type defines the type used to manage the vectors.
- */
-
-typedef unsigned32 ISR_Vector_number;
-
-/*
- * Return type for ISR Handler
- */
-
-typedef void ISR_Handler;
-
-/*
- * Pointer to an ISR Handler
- */
-
-#if (CPU_ISR_PASSES_FRAME_POINTER == 1)
-typedef ISR_Handler ( *ISR_Handler_entry )(
- ISR_Vector_number,
- CPU_Interrupt_frame *
- );
-#else
-typedef ISR_Handler ( *ISR_Handler_entry )(
- ISR_Vector_number
- );
-#endif
-/*
- * This constant promotes out the number of vectors truly supported by
- * the current CPU being used. This is usually the number of distinct vectors
- * the cpu can vector.
- */
-
-#define ISR_NUMBER_OF_VECTORS CPU_INTERRUPT_NUMBER_OF_VECTORS
-
-/*
- * This constant promotes out the highest valid interrupt vector number.
- */
-
-#define ISR_INTERRUPT_MAXIMUM_VECTOR_NUMBER CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER
-
-/*
- * The following is TRUE if signals have been sent to the currently
- * executing thread by an ISR handler.
- */
-
-SCORE_EXTERN boolean _ISR_Signals_to_thread_executing;
-
-/*
- * The following contains the interrupt service routine nest level.
- * When this variable is zero, a thread is executing.
- */
-
-SCORE_EXTERN unsigned32 _ISR_Nest_level;
-
-/*
- * The following declares the Vector Table. Application
- * interrupt service routines are vectored by the ISR Handler via this table.
- */
-
-SCORE_EXTERN ISR_Handler_entry _ISR_Vector_table[ ISR_NUMBER_OF_VECTORS ];
-
-/*
- * _ISR_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _ISR_Handler_initialization ( void );
-
-/*
- * _ISR_Disable
- *
- * DESCRIPTION:
- *
- * This routine disables all interrupts so that a critical section
- * of code can be executing without being interrupted. Upon return,
- * the argument _level will contain the previous interrupt mask level.
- */
-
-#define _ISR_Disable( _level ) \
- _CPU_ISR_Disable( _level )
-
-/*
- * _ISR_Enable
- *
- * DESCRIPTION:
- *
- * This routine enables interrupts to the previous interrupt mask
- * LEVEL. It is used at the end of a critical section of code to
- * enable interrupts so they can be processed again.
- */
-
-#define _ISR_Enable( _level ) \
- _CPU_ISR_Enable( _level )
-
-/*
- * _ISR_Flash
- *
- * DESCRIPTION:
- *
- * This routine temporarily enables interrupts to the previous
- * interrupt mask level and then disables all interrupts so that
- * the caller can continue into the second part of a critical
- * section. This routine is used to temporarily enable interrupts
- * during a long critical section. It is used in long sections of
- * critical code when a point is reached at which interrupts can
- * be temporarily enabled. Deciding where to flash interrupts
- * in a long critical section is often difficult and the point
- * must be selected with care to insure that the critical section
- * properly protects itself.
- */
-
-#define _ISR_Flash( _level ) \
- _CPU_ISR_Flash( _level )
-
-/*
- * _ISR_Install_vector
- *
- * DESCRIPTION:
- *
- * This routine installs new_handler as the interrupt service routine
- * for the specified vector. The previous interrupt service routine is
- * returned as old_handler.
- */
-
-#define _ISR_Install_vector( _vector, _new_handler, _old_handler ) \
- _CPU_ISR_install_vector( _vector, _new_handler, _old_handler )
-
-/*
- * _ISR_Get_level
- *
- * DESCRIPTION:
- *
- * This routine returns the current interrupt level.
- */
-
-#define _ISR_Get_level() \
- _CPU_ISR_Get_level()
-
-/*
- * _ISR_Set_level
- *
- * DESCRIPTION:
- *
- * This routine sets the current interrupt level to that specified
- * by new_level. The new interrupt level is effective when the
- * routine exits.
- */
-
-#define _ISR_Set_level( _new_level ) \
- _CPU_ISR_Set_level( _new_level )
-
-/*
- * _ISR_Handler
- *
- * DESCRIPTION:
- *
- * This routine is the interrupt dispatcher. ALL interrupts
- * are vectored to this routine so that minimal context can be saved
- * and setup performed before the application's high-level language
- * interrupt service routine is invoked. After the application's
- * interrupt service routine returns control to this routine, it
- * will determine if a thread dispatch is necessary. If so, it will
- * insure that the necessary thread scheduling operations are
- * performed when the outermost interrupt service routine exits.
- *
- * NOTE: Implemented in assembly language.
- */
-
-void _ISR_Handler( void );
-
-/*
- * _ISR_Dispatch
- *
- * DESCRIPTION:
- *
- * This routine provides a wrapper so that the routine
- * _Thread_Dispatch can be invoked when a reschedule is necessary
- * at the end of the outermost interrupt service routine. This
- * wrapper is necessary to establish the processor context needed
- * by _Thread_Dispatch and to save the processor context which is
- * corrupted by _Thread_Dispatch. This context typically consists
- * of registers which are not preserved across routine invocations.
- *
- * NOTE: Implemented in assembly language.
- */
-
-void _ISR_Dispatch( void );
-
-#include <rtems/score/isr.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/mpci.h b/cpukit/score/include/rtems/score/mpci.h
deleted file mode 100644
index 4475021eca..0000000000
--- a/cpukit/score/include/rtems/score/mpci.h
+++ /dev/null
@@ -1,412 +0,0 @@
-/* mpci.h
- *
- * This include file contains all the constants and structures associated
- * with the MPCI layer. It provides mechanisms to utilize packets.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MPCI_h
-#define __MPCI_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/mppkt.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/tqdata.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/score/coresem.h>
-
-/*
- * The following constants define the stack size requirements for
- * the system threads.
- */
-
-#define MPCI_RECEIVE_SERVER_STACK_SIZE \
- ( STACK_MINIMUM_SIZE + \
- CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \
- _CPU_Table.extra_mpci_receive_server_stack \
- )
-
-/*
- * The following defines the node number used when a broadcast is desired.
- */
-
-#define MPCI_ALL_NODES 0
-
-/*
- * For packets associated with requests that don't already have a timeout,
- * use the one specified by this MPCI driver. The value specified by
- * the MPCI driver sets an upper limit on how long a remote request
- * should take to complete.
- */
-
-#define MPCI_DEFAULT_TIMEOUT 0xFFFFFFFF
-
-/*
- * The following records define the Multiprocessor Communications
- * Interface (MPCI) Table. This table defines the user-provided
- * MPCI which is a required part of a multiprocessor system.
- *
- * For non-blocking local operations that become remote operations,
- * we need a timeout. This is a per-driver timeout: default_timeout
- */
-
-typedef void MPCI_Entry;
-
-typedef MPCI_Entry ( *MPCI_initialization_entry )( void );
-
-typedef MPCI_Entry ( *MPCI_get_packet_entry )(
- MP_packet_Prefix **
- );
-
-typedef MPCI_Entry ( *MPCI_return_packet_entry )(
- MP_packet_Prefix *
- );
-
-typedef MPCI_Entry ( *MPCI_send_entry )(
- unsigned32,
- MP_packet_Prefix *
- );
-
-typedef MPCI_Entry ( *MPCI_receive_entry )(
- MP_packet_Prefix **
- );
-
-typedef struct {
- unsigned32 default_timeout; /* in ticks */
- unsigned32 maximum_packet_size;
- MPCI_initialization_entry initialization;
- MPCI_get_packet_entry get_packet;
- MPCI_return_packet_entry return_packet;
- MPCI_send_entry send_packet;
- MPCI_receive_entry receive_packet;
-} MPCI_Control;
-
-/*
- * The following defines the type for packet processing routines
- * invoked by the MPCI Receive server.
- */
-
-typedef void (*MPCI_Packet_processor)( MP_packet_Prefix * );
-
-/*
- * The following enumerated type defines the list of
- * internal MP operations.
- */
-
-typedef enum {
- MPCI_PACKETS_SYSTEM_VERIFY = 0
-} MPCI_Internal_Remote_operations;
-
-/*
- * The following data structure defines the packet used to perform
- * remote event operations.
- */
-
-typedef struct {
- MP_packet_Prefix Prefix;
- MPCI_Internal_Remote_operations operation;
- unsigned32 maximum_nodes;
- unsigned32 maximum_global_objects;
-} MPCI_Internal_packet;
-
-/*
- * This is the core semaphore which the MPCI Receive Server blocks on.
- */
-
-SCORE_EXTERN CORE_semaphore_Control _MPCI_Semaphore;
-/*
- * The following thread queue is used to maintain a list of tasks
- * which currently have outstanding remote requests.
- */
-
-SCORE_EXTERN Thread_queue_Control _MPCI_Remote_blocked_threads;
-
-/*
- * The following define the internal pointers to the user's
- * configuration information.
- */
-
-SCORE_EXTERN MPCI_Control *_MPCI_table;
-
-/*
- * The following points to the MPCI Receive Server.
- */
-
-SCORE_EXTERN Thread_Control *_MPCI_Receive_server_tcb;
-
-/*
- * The following table contains the process packet routines provided
- * by each object that supports MP operations.
- */
-
-SCORE_EXTERN MPCI_Packet_processor
- _MPCI_Packet_processors[MP_PACKET_CLASSES_LAST+1];
-
-/*
- * _MPCI_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _MPCI_Handler_initialization(
- MPCI_Control *users_mpci_table,
- unsigned32 timeout_status
-);
-
-/*
- * _MPCI_Create_server
- *
- * DESCRIPTION:
- *
- * This routine creates the packet receive server used in MP systems.
- */
-
-void _MPCI_Create_server( void );
-
-/*
- * _MPCI_Initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the MPCI driver by
- * invoking the user provided MPCI initialization callout.
- */
-
-void _MPCI_Initialization ( void );
-
-/*
- * _MPCI_Register_packet_processor
- *
- * DESCRIPTION:
- *
- * This routine registers the MPCI packet processor for the
- * designated object class.
- */
-
-void _MPCI_Register_packet_processor(
- MP_packet_Classes the_class,
- MPCI_Packet_processor the_packet_processor
-
-);
-
-/*
- * _MPCI_Get_packet
- *
- * DESCRIPTION:
- *
- * This function obtains a packet by invoking the user provided
- * MPCI get packet callout.
- */
-
-MP_packet_Prefix *_MPCI_Get_packet ( void );
-
-/*
- * _MPCI_Return_packet
- *
- * DESCRIPTION:
- *
- * This routine returns a packet by invoking the user provided
- * MPCI return packet callout.
- */
-
-void _MPCI_Return_packet (
- MP_packet_Prefix *the_packet
-);
-
-/*
- * _MPCI_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine sends a process packet by invoking the user provided
- * MPCI send callout.
- */
-
-void _MPCI_Send_process_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet
-);
-
-/*
- * _MPCI_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine sends a request packet by invoking the user provided
- * MPCI send callout.
- */
-
-unsigned32 _MPCI_Send_request_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet,
- States_Control extra_state
-);
-
-/*
- * _MPCI_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine sends a response packet by invoking the user provided
- * MPCI send callout.
- */
-
-void _MPCI_Send_response_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet
-);
-
-/*
- * _MPCI_Receive_packet
- *
- * DESCRIPTION:
- *
- * This routine receives a packet by invoking the user provided
- * MPCI receive callout.
- */
-
-MP_packet_Prefix *_MPCI_Receive_packet ( void );
-
-/*
- * _MPCI_Process_response
- *
- * DESCRIPTION:
- *
- * This routine obtains a packet by invoking the user provided
- * MPCI get packet callout.
- */
-
-Thread_Control *_MPCI_Process_response (
- MP_packet_Prefix *the_packet
-);
-
-/*PAGE
- *
- * _MPCI_Receive_server
- *
- */
-
-Thread _MPCI_Receive_server(
- unsigned32 ignored
-);
-
-/*PAGE
- *
- * _MPCI_Announce
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _MPCI_Announce ( void );
-
-/*
- * _MPCI_Internal_packets_Send_process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * process operation can be performed on another node.
- */
-
-void _MPCI_Internal_packets_Send_process_packet (
- MPCI_Internal_Remote_operations operation
-);
-
-/*
- * _MPCI_Internal_packets_Send_request_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive operation can be initiated on another node.
- *
- * This routine is not needed since there are no request
- * packets to be sent by this manager.
- */
-
-/*
- * _MPCI_Internal_packets_Send_response_packet
- *
- * DESCRIPTION:
- *
- * This routine performs a remote procedure call so that a
- * directive can be performed on another node.
- *
- * This routine is not needed since there are no response
- * packets to be sent by this manager.
- */
-
-/*
- *
- * _MPCI_Internal_packets_Process_packet
- *
- * DESCRIPTION:
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-
-void _MPCI_Internal_packets_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-);
-
-/*
- * _MPCI_Internal_packets_Send_object_was_deleted
- *
- * DESCRIPTION:
- *
- * This routine is invoked indirectly by the thread queue
- * when a proxy has been removed from the thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _MPCI_Internal_packets_Send_extract_proxy
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task is deleted and it
- * has a proxy which must be removed from a thread queue and
- * the remote node must be informed of this.
- *
- * This routine is not needed since there are no objects
- * deleted by this manager.
- */
-
-/*
- * _MPCI_Internal_packets_Get_packet
- *
- * DESCRIPTION:
- *
- * This routine is used to obtain a internal threads mp packet.
- */
-
- MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/mppkt.h b/cpukit/score/include/rtems/score/mppkt.h
deleted file mode 100644
index 1838d92336..0000000000
--- a/cpukit/score/include/rtems/score/mppkt.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* mppkt.h
- *
- * This package is the specification for the Packet Handler.
- * This handler defines the basic packet and provides
- * mechanisms to utilize packets based on this prefix.
- * Packets are the fundamental basis for messages passed between
- * nodes in an MP system.
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MP_PACKET_h
-#define __MP_PACKET_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following enumerated type defines the packet classes.
- *
- * NOTE: In general, each class corresponds to a manager
- * which supports global operations. Each manager
- * defines the set of supported operations.
- */
-
-typedef enum {
- 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
-} MP_packet_Classes;
-
-#define MP_PACKET_CLASSES_FIRST MP_PACKET_MPCI_INTERNAL
-#define MP_PACKET_CLASSES_LAST MP_PACKET_SIGNAL
-
-/*
- * The following record contains the prefix for every packet
- * passed between nodes in an MP system.
- *
- * NOTE: This structure is padded to insure that anything
- * following it is on a 16 byte boundary. This is
- * the most stringent structure alignment rule
- * encountered yet (i960CA).
- */
-
-typedef struct {
- MP_packet_Classes the_class;
- Objects_Id id;
- Objects_Id source_tid;
- Priority_Control source_priority;
- unsigned32 return_code;
- unsigned32 length;
- unsigned32 to_convert;
- Watchdog_Interval timeout;
-} MP_packet_Prefix;
-
-/*
- * An MPCI must support packets of at least this size.
- */
-
-#define MP_PACKET_MINIMUM_PACKET_SIZE 64
-
-/*
- * The following constant defines the number of unsigned32's
- * in a packet which must be converted to native format in a
- * heterogeneous system. In packets longer than
- * MP_PACKET_MINIMUN_HETERO_CONVERSION unsigned32's, some of the "extra" data
- * may a user message buffer which is not automatically endian swapped.
- */
-
-#define MP_PACKET_MINIMUN_HETERO_CONVERSION \
- ( sizeof( MP_packet_Prefix ) / sizeof( unsigned32 ) )
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/mppkt.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/object.h b/cpukit/score/include/rtems/score/object.h
deleted file mode 100644
index 0198731b96..0000000000
--- a/cpukit/score/include/rtems/score/object.h
+++ /dev/null
@@ -1,397 +0,0 @@
-/* object.h
- *
- * This include file contains all the constants and structures associated
- * with the Object Handler. This Handler provides mechanisms which
- * can be used to initialize and manipulate all objects which have
- * ids.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OBJECTS_h
-#define __OBJECTS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/chain.h>
-
-/*
- * The following type defines the control block used to manage
- * object names.
- */
-
-typedef void * Objects_Name;
-
-/*
- * Space for object names is allocated in multiples of this.
- *
- * NOTE: Must be a power of 2. Matches the name manipulation routines.
- */
-
-#define OBJECTS_NAME_ALIGNMENT sizeof( unsigned32 )
-
-/*
- * Functions which compare names are prototyped like this.
- */
-
-typedef boolean (*Objects_Name_comparators)(
- void * /* name_1 */,
- void * /* name_2 */,
- unsigned32 /* length */
-);
-
-/*
- * The following type defines the control block used to manage
- * object IDs. The format is as follows (0=LSB):
- *
- * Bits 0 .. 15 = index
- * Bits 16 .. 25 = node
- * Bits 26 .. 31 = class
- */
-
-typedef unsigned32 Objects_Id;
-
-#define OBJECTS_INDEX_START_BIT 0
-#define OBJECTS_NODE_START_BIT 16
-#define OBJECTS_CLASS_START_BIT 26
-
-#define OBJECTS_INDEX_MASK 0x0000ffff
-#define OBJECTS_NODE_MASK 0x03ff0000
-#define OBJECTS_CLASS_MASK 0xfc000000
-
-#define OBJECTS_INDEX_VALID_BITS 0x0000ffff
-#define OBJECTS_NODE_VALID_BITS 0x000003ff
-#define OBJECTS_CLASS_VALID_BITS 0x000000cf
-
-/*
- * This enumerated type is used in the class field of the object ID.
- */
-
-typedef enum {
- OBJECTS_NO_CLASS = 0,
- OBJECTS_INTERNAL_THREADS = 1,
- OBJECTS_RTEMS_TASKS = 2,
- OBJECTS_POSIX_THREADS = 3,
- OBJECTS_RTEMS_TIMERS = 4,
- OBJECTS_RTEMS_SEMAPHORES = 5,
- OBJECTS_RTEMS_MESSAGE_QUEUES = 6,
- OBJECTS_RTEMS_PARTITIONS = 7,
- OBJECTS_RTEMS_REGIONS = 8,
- OBJECTS_RTEMS_PORTS = 9,
- OBJECTS_RTEMS_PERIODS = 10,
- OBJECTS_RTEMS_EXTENSIONS = 11,
- OBJECTS_POSIX_KEYS = 12,
- OBJECTS_POSIX_INTERRUPTS = 13,
- OBJECTS_POSIX_MESSAGE_QUEUES = 14,
- OBJECTS_POSIX_MUTEXES = 15,
- OBJECTS_POSIX_SEMAPHORES = 16,
- OBJECTS_POSIX_CONDITION_VARIABLES = 17
-} Objects_Classes;
-
-#define OBJECTS_CLASSES_FIRST OBJECTS_NO_CLASS
-#define OBJECTS_CLASSES_LAST OBJECTS_POSIX_CONDITION_VARIABLES
-#define OBJECTS_CLASSES_FIRST_THREAD_CLASS OBJECTS_INTERNAL_THREADS
-#define OBJECTS_CLASSES_LAST_THREAD_CLASS OBJECTS_POSIX_THREADS
-
-/*
- * This enumerated type lists the locations which may be returned
- * by _Objects_Get. These codes indicate the success of locating
- * an object with the specified ID.
- */
-
-typedef enum {
- OBJECTS_LOCAL = 0, /* object is local */
- OBJECTS_REMOTE = 1, /* object is remote */
- OBJECTS_ERROR = 2 /* id was invalid */
-} Objects_Locations;
-
-/*
- * The following defines the Object Control Block used to manage
- * each object local to this node.
- */
-
-typedef struct {
- Chain_Node Node;
- Objects_Id id;
- Objects_Name name;
-} Objects_Control;
-
-/*
- * The following defines the structure for the information used to
- * manage each class of objects.
- */
-
-typedef struct {
- Objects_Classes the_class; /* Class of this object */
- Objects_Id minimum_id; /* minimum valid id of this type */
- Objects_Id maximum_id; /* maximum valid id of this type */
- unsigned32 maximum; /* maximum number of objects */
- Objects_Control **local_table; /* table of local object pointers */
- Objects_Name *name_table; /* table of local object names */
- Chain_Control *global_table; /* pointer to global table */
- Chain_Control Inactive; /* chain of inactive ctl blocks */
- boolean is_string; /* TRUE if names are strings */
- unsigned32 name_length; /* maximum length of names */
- boolean is_thread; /* TRUE if these are threads */
- /* irregardless of API */
-} Objects_Information;
-
-/*
- * The following defines the data storage which contains the
- * node number of the local node.
- */
-
-SCORE_EXTERN unsigned32 _Objects_Local_node;
-SCORE_EXTERN unsigned32 _Objects_Maximum_nodes;
-
-/*
- * The following is the list of information blocks for each object
- * class. From the ID, we can go to one of these information blocks,
- * and obtain a pointer to the appropriate object control block.
- */
-
-SCORE_EXTERN Objects_Information
- *_Objects_Information_table[OBJECTS_CLASSES_LAST + 1];
-
-/*
- * The following defines the constant which may be used
- * with _Objects_Get to manipulate the calling task.
- *
- */
-
-#define OBJECTS_ID_OF_SELF ((Objects_Id) 0)
-
-/*
- * The following define the constants which may be used in name searches.
- */
-
-#define OBJECTS_SEARCH_ALL_NODES 0
-#define OBJECTS_SEARCH_OTHER_NODES 0x7FFFFFFE
-#define OBJECTS_SEARCH_LOCAL_NODE 0x7FFFFFFF
-#define OBJECTS_WHO_AM_I 0
-
-/*
- * Parameters and return id's for _Objects_Get_next
- */
-
-#define OBJECTS_ID_INITIAL_INDEX (0)
-#define OBJECTS_ID_FINAL_INDEX (0xffff)
-
-#define OBJECTS_ID_INITIAL(_class, _node) \
- _Objects_Build_id( (_class), (_node), OBJECTS_ID_INITIAL_INDEX )
-
-#define OBJECTS_ID_FINAL ((Objects_Id)~0)
-
-/*
- * _Objects_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This function performs the initialization necessary for this handler.
- *
- */
-
-void _Objects_Handler_initialization(
- unsigned32 node,
- unsigned32 maximum_nodes,
- unsigned32 maximum_global_objects
-);
-
-/*
- * _Objects_Initialize_information
- *
- * DESCRIPTION:
- *
- * This function initializes an object class information record.
- * SUPPORTS_GLOBAL is TRUE if the object class supports global
- * objects, and FALSE otherwise. Maximum indicates the number
- * of objects required in this class and size indicates the size
- * in bytes of each control block for this object class. The
- * name length and string designator are also set. In addition,
- * the class may be a task, therefore this information is also included.
- */
-
-void _Objects_Initialize_information (
- Objects_Information *information,
- Objects_Classes the_class,
- boolean supports_global,
- unsigned32 maximum,
- unsigned32 size,
- boolean is_string,
- unsigned32 maximum_name_length,
- boolean is_task
-);
-
-/*
- * _Objects_Clear_name
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _Objects_Clear_name(
- void *name,
- unsigned32 length
-);
-
-/*
- * _Objects_Copy_name_string
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _Objects_Copy_name_string(
- void *source,
- void *destination
-);
-
-/*
- * _Objects_Copy_name_raw
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _Objects_Copy_name_raw(
- void *source,
- void *destination,
- unsigned32 length
-);
-
-/*
- * _Objects_Compare_name_string
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-boolean _Objects_Compare_name_string(
- void *name_1,
- void *name_2,
- unsigned32 length
-);
-
-/*
- * _Objects_Compare_name_raw
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-boolean _Objects_Compare_name_raw(
- void *name_1,
- void *name_2,
- unsigned32 length
-);
-/*
- * _Objects_Name_to_id
- *
- * DESCRIPTION:
- *
- * This function implements the common portion of the object
- * identification directives. This directive returns the object
- * id associated with name. If more than one object of this class
- * is named name, then the object to which the id belongs is
- * arbitrary. Node indicates the extent of the search for the
- * id of the object named name. If the object class supports global
- * objects, then the search can be limited to a particular node
- * or allowed to encompass all nodes.
- *
- */
-
-typedef enum {
- OBJECTS_SUCCESSFUL,
- OBJECTS_INVALID_NAME,
- OBJECTS_INVALID_NODE
-} Objects_Name_to_id_errors;
-
-#define OBJECTS_NAME_ERRORS_FIRST OBJECTS_SUCCESSFUL
-#define OBJECTS_NAME_ERRORS_LAST OBJECTS_INVALID_NODE
-
-Objects_Name_to_id_errors _Objects_Name_to_id(
- Objects_Information *information,
- Objects_Name name,
- unsigned32 node,
- Objects_Id *id
-);
-
-/*
- * _Objects_Get
- *
- * DESCRIPTION:
- *
- * This function maps object ids to object control blocks.
- * If id corresponds to a local object, then it returns
- * the_object control pointer which maps to id and location
- * is set to OBJECTS_LOCAL. If the object class supports global
- * objects and the object id is global and resides on a remote
- * node, then location is set to OBJECTS_REMOTE, and the_object
- * is undefined. Otherwise, location is set to OBJECTS_ERROR
- * and the_object is undefined.
- *
- */
-
-Objects_Control *_Objects_Get (
- Objects_Information *information,
- Objects_Id id,
- Objects_Locations *location
-);
-
-/*
- * _Objects_Get_next
- *
- * DESCRIPTION:
- *
- * Like _Objects_Get, but is used to find "next" open object.
- *
- */
-
-Objects_Control *_Objects_Get_next(
- Objects_Information *information,
- Objects_Id id,
- Objects_Locations *location_p,
- Objects_Id *next_id_p
-);
-
-/*
- * _Objects_Get_information
- *
- * DESCRIPTION:
- *
- * Returns the information control block for the class of objects
- * corresponding to this id.
- */
-
-Objects_Information *_Objects_Get_information(
- Objects_Id id
-);
-
-/*
- * Pieces of object.inl are promoted out to the user
- */
-
-#include <rtems/score/object.inl>
-#include <rtems/score/objectmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/objectmp.h b/cpukit/score/include/rtems/score/objectmp.h
deleted file mode 100644
index e307ca4264..0000000000
--- a/cpukit/score/include/rtems/score/objectmp.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/* objectmp.h
- *
- * This include file contains all the constants and structures associated
- * with the manipulation of Global RTEMS Objects.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_OBJECTS_MP_h
-#define __RTEMS_OBJECTS_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This defines the Global Object Control Block used to manage
- * objects resident on other nodes.
- */
-
-typedef struct {
- Objects_Control Object;
- unsigned32 name; /* XXX broken but works */
- /* XXX If any API is MP with variable length names .. BOOM!!!! */
-} Objects_MP_Control;
-
-/*
- * _Objects_MP_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine intializes the inactive global object chain
- * based on the maximum number of global objects configured.
- */
-
-void _Objects_MP_Handler_initialization (
- unsigned32 node,
- unsigned32 maximum_nodes,
- unsigned32 maximum_global_objects
-);
-
-/*PAGE
- *
- * _Objects_MP_Open
- *
- * DESCRIPTION:
- *
- * This routine place the specified global object in the
- * specified information table.
- */
-
-void _Objects_MP_Open (
- Objects_Information *information,
- Objects_MP_Control *the_global_object,
- unsigned32 the_name, /* XXX -- wrong for variable */
- Objects_Id the_id
-);
-
-/*
- * _Objects_MP_Allocate_and_open
- *
- * DESCRIPTION:
- *
- * This routine allocates a global object control block
- * and places it in the specified information table. If the
- * allocation fails, then is_fatal_error determines the
- * error processing actions taken.
- */
-
-boolean _Objects_MP_Allocate_and_open (
- Objects_Information *information,
- unsigned32 the_name, /* XXX -- wrong for variable length */
- Objects_Id the_id,
- boolean is_fatal_error
-);
-
-/*
- * _Objects_MP_Close
- *
- * DESCRIPTION:
- *
- * This routine removes a global object from the specified
- * information table and deallocates the global object control block.
- */
-
-void _Objects_MP_Close (
- Objects_Information *information,
- Objects_Id the_id
-);
-
-/*
- * _Objects_MP_Global_name_search
- *
- * DESCRIPTION:
- *
- * This routine looks for the object with the_name in the global
- * object tables indicated by information. It returns the ID of the
- * object with that name if one is found.
- */
-
-Objects_Name_to_id_errors _Objects_MP_Global_name_search (
- Objects_Information *information,
- Objects_Name the_name,
- unsigned32 nodes_to_search,
- Objects_Id *the_id
-);
-
-/*
- * _Objects_MP_Is_remote
- *
- * DESCRIPTION:
- *
- * This function searches the Global Object Table managed
- * by information for the object indicated by ID. If the object
- * is found, then location is set to objects_remote, otherwise
- * location is set to objects_error. In both cases, the_object
- * is undefined.
- */
-
-void _Objects_MP_Is_remote (
- Objects_Information *information,
- Objects_Id the_id,
- Objects_Locations *location,
- Objects_Control **the_object
-);
-
-/*
- * The following chain header is used to manage the set of
- * inactive global object control blocks.
- */
-
-SCORE_EXTERN unsigned32 _Objects_MP_Maximum_global_objects;
-SCORE_EXTERN Chain_Control _Objects_MP_Inactive_global_objects;
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/objectmp.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/priority.h b/cpukit/score/include/rtems/score/priority.h
deleted file mode 100644
index 7241888242..0000000000
--- a/cpukit/score/include/rtems/score/priority.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* priority.h
- *
- * This include file contains all thread priority manipulation routines.
- * This Handler provides mechanisms which can be used to
- * initialize and manipulate thread priorities.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PRIORITY_h
-#define __PRIORITY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type defines the control block used to manage
- * thread priorities.
- *
- * NOTE: Priority 0 is reserved for internal threads only.
- */
-
-typedef unsigned32 Priority_Control;
-
-#define PRIORITY_MINIMUM 0 /* highest thread priority */
-#define PRIORITY_MAXIMUM 255 /* lowest thread priority */
-
-/*
- * The following record defines the information associated with
- * each thread to manage its interaction with the priority bit maps.
- */
-
-typedef struct {
- Priority_Bit_map_control *minor; /* addr of minor bit map slot */
- Priority_Bit_map_control ready_major; /* priority bit map ready mask */
- Priority_Bit_map_control ready_minor; /* priority bit map ready mask */
- Priority_Bit_map_control block_major; /* priority bit map block mask */
- Priority_Bit_map_control block_minor; /* priority bit map block mask */
-} Priority_Information;
-
-/*
- * The following data items are the priority bit map.
- * Each of the sixteen bits used in the _Priority_Major_bit_map is
- * associated with one of the sixteen entries in the _Priority_Bit_map.
- * Each bit in the _Priority_Bit_map indicates whether or not there are
- * threads ready at a particular priority. The mapping of
- * individual priority levels to particular bits is processor
- * dependent as is the value of each bit used to indicate that
- * threads are ready at that priority.
- */
-
-SCORE_EXTERN volatile Priority_Bit_map_control _Priority_Major_bit_map;
-SCORE_EXTERN Priority_Bit_map_control
- _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;
-
-/*
- * The definition of the Priority_Bit_map_control type is CPU dependent.
- *
- */
-
-/*
- * Priority Bitfield Manipulation Routines
- *
- * NOTE:
- *
- * These may simply be pass throughs to CPU dependent routines.
- */
-
-#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE )
-
-#define _Priority_Mask( _bit_number ) \
- _CPU_Priority_Mask( _bit_number )
-
-#define _Priority_Bits_index( _priority ) \
- _CPU_Priority_bits_index( _priority )
-
-#endif
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/priority.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/stack.h b/cpukit/score/include/rtems/score/stack.h
deleted file mode 100644
index 1fc4a13966..0000000000
--- a/cpukit/score/include/rtems/score/stack.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* stack.h
- *
- * This include file contains all information about the thread
- * Stack Handler. This Handler provides mechanisms which can be used to
- * initialize and utilize stacks.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STACK_h
-#define __STACK_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following constant defines the minimum stack size which every
- * thread must exceed.
- */
-
-#define STACK_MINIMUM_SIZE CPU_STACK_MINIMUM_SIZE
-
-/*
- * The following defines the control block used to manage each stack.
- */
-
-typedef struct {
- unsigned32 size; /* stack size */
- void *area; /* low memory addr of stack */
-} Stack_Control;
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/stack.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/states.h b/cpukit/score/include/rtems/score/states.h
deleted file mode 100644
index a0d7ed8ab8..0000000000
--- a/cpukit/score/include/rtems/score/states.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* states.h
- *
- * This include file contains thread execution state information.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_STATES_h
-#define __RTEMS_STATES_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The following type defines the control block used to manage a
- * thread's state.
- */
-
-typedef unsigned32 States_Control;
-
-/*
- * The following constants define the individual states which may be
- * be used to compose and manipulate a thread's state.
- */
-
-#define STATES_ALL_SET 0xfffff /* all states */
-#define STATES_READY 0x00000 /* ready to run */
-#define STATES_DORMANT 0x00001 /* created not started */
-#define STATES_SUSPENDED 0x00002 /* waiting for resume */
-#define STATES_TRANSIENT 0x00004 /* in transition */
-#define STATES_DELAYING 0x00008 /* wait for timeout */
-#define STATES_WAITING_FOR_TIME 0x00010 /* wait for TOD */
-#define STATES_WAITING_FOR_BUFFER 0x00020
-#define STATES_WAITING_FOR_SEGMENT 0x00040
-#define STATES_WAITING_FOR_MESSAGE 0x00080
-#define STATES_WAITING_FOR_EVENT 0x00100
-#define STATES_WAITING_FOR_SEMAPHORE 0x00200
-#define STATES_WAITING_FOR_MUTEX 0x00400
-#define STATES_WAITING_FOR_CONDITION_VARIABLE 0x00800
-#define STATES_WAITING_FOR_JOIN_AT_EXIT 0x01000
-#define STATES_WAITING_FOR_RPC_REPLY 0x02000
-#define STATES_WAITING_FOR_PERIOD 0x04000
-#define STATES_WAITING_FOR_SIGNAL 0x08000
-#define STATES_INTERRUPTIBLE_BY_SIGNAL 0x10000
-
-#define STATES_LOCALLY_BLOCKED ( STATES_WAITING_FOR_BUFFER | \
- STATES_WAITING_FOR_SEGMENT | \
- STATES_WAITING_FOR_MESSAGE | \
- STATES_WAITING_FOR_SEMAPHORE | \
- STATES_WAITING_FOR_MUTEX | \
- STATES_WAITING_FOR_CONDITION_VARIABLE | \
- STATES_WAITING_FOR_JOIN_AT_EXIT | \
- STATES_WAITING_FOR_SIGNAL )
-
-#define STATES_WAITING_ON_THREAD_QUEUE \
- ( STATES_LOCALLY_BLOCKED | \
- STATES_WAITING_FOR_RPC_REPLY )
-
-#define STATES_BLOCKED ( STATES_DELAYING | \
- STATES_WAITING_FOR_TIME | \
- STATES_WAITING_FOR_PERIOD | \
- STATES_WAITING_FOR_EVENT | \
- STATES_WAITING_ON_THREAD_QUEUE | \
- STATES_INTERRUPTIBLE_BY_SIGNAL )
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/states.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/sysstate.h b/cpukit/score/include/rtems/score/sysstate.h
deleted file mode 100644
index 8451894e97..0000000000
--- a/cpukit/score/include/rtems/score/sysstate.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* sysstates.h
- *
- * This include file contains information regarding the system state.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SYSTEM_STATE_h
-#define __RTEMS_SYSTEM_STATE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* types */
-
-/* enumerated constants */
-
-/*
- * The following type defines the possible system states.
- */
-
-typedef enum {
- SYSTEM_STATE_BEFORE_INITIALIZATION, /* start -> end of 1st init part */
- SYSTEM_STATE_BEFORE_MULTITASKING, /* end of 1st -> beginning of 2nd */
- SYSTEM_STATE_BEGIN_MULTITASKING, /* just before multitasking starts */
- SYSTEM_STATE_UP, /* normal operation */
- SYSTEM_STATE_SHUTDOWN, /* shutdown */
- SYSTEM_STATE_FAILED /* fatal error occurred */
-} System_state_Codes;
-
-#define SYSTEM_STATE_CODES_FIRST SYSTEM_STATE_BEFORE_INITIALIZATION
-#define SYSTEM_STATE_CODES_LAST SYSTEM_STATE_FAILED
-
-/*
- * The following variable indicates whether or not this is
- * an multiprocessing system.
- */
-
-SCORE_EXTERN boolean _System_state_Is_multiprocessing;
-
-/*
- * The following variable contains the current system state.
- */
-
-SCORE_EXTERN System_state_Codes _System_state_Current;
-
-/*
- * Make it possible for the application to get the system state information.
- */
-
-#include <rtems/score/sysstate.inl>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h
deleted file mode 100644
index da6fa76bd0..0000000000
--- a/cpukit/score/include/rtems/score/thread.h
+++ /dev/null
@@ -1,622 +0,0 @@
-/* thread.h
- *
- * This include file contains all constants and structures associated
- * with the thread control block.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_h
-#define __THREAD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/context.h>
-#include <rtems/score/cpu.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/object.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/stack.h>
-#include <rtems/score/states.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/tqdata.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following defines the "return type" of a thread.
- */
-
-typedef void Thread;
-
-/*
- * The following defines the ways in which the entry point for a
- * thread can be invoked. Basically, it can be passed any
- * combination/permutation of a pointer and an unsigned32 value.
- *
- * NOTE: For now, we are ignoring the return type.
- */
-
-typedef enum {
- THREAD_START_NUMERIC,
- THREAD_START_POINTER,
- THREAD_START_BOTH_POINTER_FIRST,
- THREAD_START_BOTH_NUMERIC_FIRST
-} Thread_Start_types;
-
-typedef Thread ( *Thread_Entry )(); /* basic type */
-
-typedef Thread ( *Thread_Entry_numeric )( unsigned32 );
-typedef Thread ( *Thread_Entry_pointer )( void * );
-typedef Thread ( *Thread_Entry_both_pointer_first )( void *, unsigned32 );
-typedef Thread ( *Thread_Entry_both_numeric_first )( unsigned32, void * );
-
-/*
- * The following lists the algorithms used to manage the thread cpu budget.
- *
- * Reset Timeslice: At each context switch, reset the time quantum.
- * Exhaust Timeslice: Only reset the quantum once it is consumed.
- * Callout: Execute routine when budget is consumed.
- */
-
-typedef enum {
- THREAD_CPU_BUDGET_ALGORITHM_NONE,
- THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE,
- THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE,
- THREAD_CPU_BUDGET_ALGORITHM_CALLOUT
-} Thread_CPU_budget_algorithms;
-
-typedef struct Thread_Control_struct Thread_Control;
-
-typedef void (*Thread_CPU_budget_algorithm_callout )( Thread_Control * );
-
-/*
- * The following structure contains the information which defines
- * the starting state of a thread.
- */
-
-typedef struct {
- Thread_Entry entry_point; /* starting thread address */
- Thread_Start_types prototype; /* how task is invoked */
- void *pointer_argument; /* pointer argument */
- unsigned32 numeric_argument; /* numeric argument */
- /* initial execution modes */
- boolean is_preemptible;
- Thread_CPU_budget_algorithms budget_algorithm;
- Thread_CPU_budget_algorithm_callout budget_callout;
- unsigned32 isr_level;
- Priority_Control initial_priority; /* initial priority */
- boolean core_allocated_stack;
- Stack_Control Initial_stack; /* stack information */
- void *fp_context; /* initial FP context area address */
- void *stack; /* initial stack area address */
-} Thread_Start_information;
-
-/*
- * The following structure contains the information necessary to manage
- * a thread which it is waiting for a resource.
- */
-
-#define THREAD_STATUS_PROXY_BLOCKING 0x1111111
-
-typedef struct {
- Objects_Id id; /* waiting on this object */
- unsigned32 count; /* "generic" fields to be used */
- void *return_argument; /* when blocking */
- void *return_argument_1;
- unsigned32 option;
-
- /*
- * NOTE: The following assumes that all API return codes can be
- * treated as an unsigned32.
- */
- unsigned32 return_code; /* status for thread awakened */
-
- Chain_Control Block2n; /* 2 - n priority blocked chain */
- Thread_queue_Control *queue; /* pointer to thread queue */
-} Thread_Wait_information;
-
-/*
- * The following defines the control block used to manage
- * each thread proxy.
- *
- * NOTE: It is critical that proxies and threads have identical
- * memory images for the shared part.
- */
-
-typedef struct {
- Objects_Control Object;
- States_Control current_state;
- Priority_Control current_priority;
- Priority_Control real_priority;
- unsigned32 resource_count;
- Thread_Wait_information Wait;
- Watchdog_Control Timer;
- MP_packet_Prefix *receive_packet;
- /****************** end of common block ********************/
- Chain_Node Active;
-} Thread_Proxy_control;
-
-
-/*
- * The following record defines the control block used
- * to manage each thread.
- *
- * NOTE: It is critical that proxies and threads have identical
- * memory images for the shared part.
- */
-
-typedef enum {
- THREAD_API_RTEMS,
- THREAD_API_POSIX
-} Thread_APIs;
-
-#define THREAD_API_FIRST THREAD_API_RTEMS
-#define THREAD_API_LAST THREAD_API_POSIX
-
-struct Thread_Control_struct {
- Objects_Control Object;
- States_Control current_state;
- Priority_Control current_priority;
- Priority_Control real_priority;
- unsigned32 resource_count;
- Thread_Wait_information Wait;
- Watchdog_Control Timer;
- MP_packet_Prefix *receive_packet;
- /****************** end of common block ********************/
- boolean is_global;
- boolean do_post_task_switch_extension;
-
- boolean is_preemptible;
- unsigned32 cpu_time_budget;
- Thread_CPU_budget_algorithms budget_algorithm;
- Thread_CPU_budget_algorithm_callout budget_callout;
-
- unsigned32 ticks_executed;
- Chain_Control *ready;
- Priority_Information Priority_map;
- Thread_Start_information Start;
- Context_Control Registers;
- void *fp_context;
- void *API_Extensions[ THREAD_API_LAST + 1 ];
- void **extensions;
-};
-
-/*
- * The following defines the information control block used to
- * manage this class of objects.
- */
-
-SCORE_EXTERN Objects_Information _Thread_Internal_information;
-
-/*
- * The following define the thread control pointers used to access
- * and manipulate the idle thread.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_Idle;
-
-/*
- * The following context area contains the context of the "thread"
- * which invoked the start multitasking routine. This context is
- * restored as the last action of the stop multitasking routine. Thus
- * control of the processor can be returned to the environment
- * which initiated the system.
- */
-
-SCORE_EXTERN Context_Control _Thread_BSP_context;
-
-/*
- * The following declares the dispatch critical section nesting
- * counter which is used to prevent context switches at inopportune
- * moments.
- */
-
-SCORE_EXTERN unsigned32 _Thread_Dispatch_disable_level;
-
-/*
- * If this is non-zero, then the post-task switch extension
- * is run regardless of the state of the per thread flag.
- */
-
-SCORE_EXTERN unsigned32 _Thread_Do_post_task_switch_extension;
-
-/*
- * The following holds how many user extensions are in the system. This
- * is used to determine how many user extension data areas to allocate
- * per thread.
- */
-
-SCORE_EXTERN unsigned32 _Thread_Maximum_extensions;
-
-/*
- * The following is used to manage the length of a timeslice quantum.
- */
-
-SCORE_EXTERN unsigned32 _Thread_Ticks_per_timeslice;
-
-/*
- * The following points to the array of FIFOs used to manage the
- * set of ready threads.
- */
-
-SCORE_EXTERN Chain_Control *_Thread_Ready_chain;
-
-/*
- * The following points to the thread which is currently executing.
- * This thread is implicitly manipulated by numerous directives.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_Executing;
-
-/*
- * The following points to the highest priority ready thread
- * in the system. Unless the current thread is not preemptibl,
- * then this thread will be context switched to when the next
- * dispatch occurs.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_Heir;
-
-/*
- * The following points to the thread whose floating point
- * context is currently loaded.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_Allocated_fp;
-
-/*
- * _Thread_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _Thread_Handler_initialization (
- unsigned32 ticks_per_timeslice,
- unsigned32 maximum_extensions,
- unsigned32 maximum_proxies
-);
-
-/*
- * _Thread_Create_idle
- *
- * DESCRIPTION:
- *
- * This routine creates the idle thread.
- *
- * WARNING!! No thread should be created before this one.
- */
-
-void _Thread_Create_idle( void );
-
-/*
- * _Thread_Start_multitasking
- *
- * DESCRIPTION:
- *
- * This routine initiates multitasking. It is invoked only as
- * part of initialization and its invocation is the last act of
- * the non-multitasking part of the system initialization.
- */
-
-void _Thread_Start_multitasking( void );
-
-/*
- * _Thread_Dispatch
- *
- * DESCRIPTION:
- *
- * This routine is responsible for transferring control of the
- * processor from the executing thread to the heir thread. As part
- * of this process, it is responsible for the following actions:
- *
- * + saving the context of the executing thread
- * + restoring the context of the heir thread
- * + dispatching any signals for the resulting executing thread
- */
-
-void _Thread_Dispatch( void );
-
-/*
- * _Thread_Initialize
- *
- * DESCRIPTION:
- *
- * XXX
- *
- * NOTES:
- *
- * If stack_area is NULL, it is allocated from the workspace.
- *
- * If the stack is allocated from the workspace, then it is guaranteed to be
- * of at least minimum size.
- */
-
-boolean _Thread_Initialize(
- Objects_Information *information,
- Thread_Control *the_thread,
- void *stack_area,
- unsigned32 stack_size,
- boolean is_fp,
- Priority_Control priority,
- boolean is_preemptible,
- Thread_CPU_budget_algorithms budget_algorithm,
- Thread_CPU_budget_algorithm_callout budget_callout,
- unsigned32 isr_level,
- Objects_Name name
-);
-
-/*
- * _Thread_Start
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-boolean _Thread_Start(
- Thread_Control *the_thread,
- Thread_Start_types the_prototype,
- void *entry_point,
- void *pointer_argument,
- unsigned32 numeric_argument
-);
-
-/*
- * _Thread_Restart
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-/* XXX multiple task arg profiles */
-
-boolean _Thread_Restart(
- Thread_Control *the_thread,
- void *pointer_argument,
- unsigned32 numeric_argument
-);
-
-/*
- * _Thread_Close
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _Thread_Close(
- Objects_Information *information,
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_Ready
- *
- * DESCRIPTION:
- *
- * This routine removes any set states for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-void _Thread_Ready(
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_Clear_state
- *
- * DESCRIPTION:
- *
- * This routine clears the indicated STATES for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-void _Thread_Clear_state(
- Thread_Control *the_thread,
- States_Control state
-);
-
-/*
- * _Thread_Set_state
- *
- * DESCRIPTION:
- *
- * This routine sets the indicated states for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- *
- */
-
-void _Thread_Set_state(
- Thread_Control *the_thread,
- States_Control state
-);
-
-/*
- * _Thread_Set_transient
- *
- * DESCRIPTION:
- *
- * This routine sets the TRANSIENT state for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-void _Thread_Set_transient(
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_Reset_timeslice
- *
- * DESCRIPTION:
- *
- * This routine is invoked upon expiration of the currently
- * executing thread's timeslice. If no other thread's are ready
- * at the priority of the currently executing thread, then the
- * executing thread's timeslice is reset. Otherwise, the
- * currently executing thread is placed at the rear of the
- * FIFO for this priority and a new heir is selected.
- */
-
-void _Thread_Reset_timeslice( void );
-
-/*
- * _Thread_Tickle_timeslice
- *
- * DESCRIPTION:
- *
- * This routine is invoked as part of processing each clock tick.
- * It is responsible for determining if the current thread allows
- * timeslicing and, if so, when its timeslice expires.
- */
-
-void _Thread_Tickle_timeslice( void );
-
-/*
- * _Thread_Yield_processor
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a thread wishes to voluntarily
- * transfer control of the processor to another thread of equal
- * or greater priority.
- */
-
-void _Thread_Yield_processor( void );
-
-/*
- * _Thread_Load_environment
- *
- * DESCRIPTION:
- *
- * This routine initializes the context of the_thread to its
- * appropriate starting state.
- */
-
-void _Thread_Load_environment(
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_Handler
- *
- * DESCRIPTION:
- *
- * This routine is the wrapper function for all threads. It is
- * the starting point for all threads. The user provided thread
- * entry point is invoked by this routine. Operations
- * which must be performed immediately before and after the user's
- * thread executes are found here.
- */
-
-void _Thread_Handler( void );
-
-/*
- * _Thread_Delay_ended
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a thread must be unblocked at the
- * end of a time based delay (i.e. wake after or wake when).
- */
-
-void _Thread_Delay_ended(
- Objects_Id id,
- void *ignored
-);
-
-/*
- * _Thread_Change_priority
- *
- * DESCRIPTION:
- *
- * This routine changes the current priority of the_thread to
- * new_priority. It performs any necessary scheduling operations
- * including the selection of a new heir thread.
- */
-
-void _Thread_Change_priority (
- Thread_Control *the_thread,
- Priority_Control new_priority,
- boolean prepend_it
-);
-
-/*
- * _Thread_Set_priority
- *
- * DESCRIPTION:
- *
- * This routine updates the priority related fields in the_thread
- * control block to indicate the current priority is now new_priority.
- */
-
-void _Thread_Set_priority(
- Thread_Control *the_thread,
- Priority_Control new_priority
-);
-
-/*
- * _Thread_Evaluate_mode
- *
- * DESCRIPTION:
- *
- * This routine XXX
- */
-
-boolean _Thread_Evaluate_mode( void );
-
-/*
- * _Thread_Get
- *
- * NOTE: If we are not using static inlines, this must be a real
- * subroutine call.
- */
-
-#ifndef USE_INLINES
-Thread_Control *_Thread_Get (
- Objects_Id id,
- Objects_Locations *location
-);
-#endif
-
-/*
- * _Thread_Idle_body
- *
- * DESCRIPTION:
- *
- * This routine is the body of the system idle thread.
- */
-
-#if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)
-Thread _Thread_Idle_body(
- unsigned32 ignored
-);
-#endif
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/thread.inl>
-#endif
-#include <rtems/score/threadmp.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/threadmp.h b/cpukit/score/include/rtems/score/threadmp.h
deleted file mode 100644
index 497bdc8c5b..0000000000
--- a/cpukit/score/include/rtems/score/threadmp.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* threadmp.h
- *
- * This include file contains the specification for all routines
- * and data specific to the multiprocessing portion of the thread package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_THREAD_MP_h
-#define __RTEMS_THREAD_MP_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * _Thread_MP_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the multiprocessing portion of the Thread Handler.
- */
-
-void _Thread_MP_Handler_initialization (
- unsigned32 maximum_proxies
-);
-
-/*
- * _Thread_MP_Allocate_proxy
- *
- * DESCRIPTION:
- *
- * This allocates a proxy control block from
- * the inactive chain of free proxy control blocks.
- *
- * NOTE: This function returns a thread control pointer
- * because proxies are substitutes for remote threads.
- */
-
-Thread_Control *_Thread_MP_Allocate_proxy (
- States_Control the_state
-);
-
-/*
- * _Thread_MP_Find_proxy
- *
- * DESCRIPTION:
- *
- * This function removes the proxy control block for the specified
- * id from the active chain of proxy control blocks.
- */
-
-Thread_Control *_Thread_MP_Find_proxy (
- Objects_Id the_id
-);
-
-/*
- * The following is used to determine when the multiprocessing receive
- * thread is executing so that a proxy can be allocated instead of
- * blocking the multiprocessing receive thread.
- */
-
-SCORE_EXTERN Thread_Control *_Thread_MP_Receive;
-
-/*
- * The following chains are used to manage proxies.
- */
-
-SCORE_EXTERN Chain_Control _Thread_MP_Active_proxies;
-SCORE_EXTERN Chain_Control _Thread_MP_Inactive_proxies;
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/threadmp.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/threadq.h b/cpukit/score/include/rtems/score/threadq.h
deleted file mode 100644
index d3a0f58ad1..0000000000
--- a/cpukit/score/include/rtems/score/threadq.h
+++ /dev/null
@@ -1,301 +0,0 @@
-/* threadq.h
- *
- * This include file contains all the constants and structures associated
- * with the manipulation of objects.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_QUEUE_h
-#define __THREAD_QUEUE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/tqdata.h>
-
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * Constant for indefinite wait.
- */
-
-#define THREAD_QUEUE_WAIT_FOREVER WATCHDOG_NO_TIMEOUT
-
-/*
- * The following type defines the callout used when a remote task
- * is extracted from a local thread queue.
- */
-
-typedef void ( *Thread_queue_Flush_callout )(
- Thread_Control *
- );
-
-/*
- * The following type defines the callout used when a local task
- * is extracted from a remote thread queue (i.e. it's proxy must
- * extracted from the remote queue).
- */
-
-typedef void ( *Thread_queue_Extract_callout )(
- Thread_Control *
- );
-
-SCORE_EXTERN Thread_queue_Extract_callout
- _Thread_queue_Extract_table[ OBJECTS_CLASSES_LAST + 1 ];
-
-/*
- * _Thread_queue_Dequeue
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to a thread waiting on
- * the_thread_queue. The selection of this thread is based on
- * the discipline of the_thread_queue. If no threads are waiting
- * on the_thread_queue, then NULL is returned.
- */
-
-Thread_Control *_Thread_queue_Dequeue(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Enqueue
- *
- * DESCRIPTION:
- *
- * This routine enqueues the currently executing thread on
- * the_thread_queue with an optional timeout.
- */
-
-void _Thread_queue_Enqueue(
- Thread_queue_Control *the_thread_queue,
- Watchdog_Interval timeout
-);
-
-/*
- * _Thread_queue_Extract
- *
- * DESCRIPTION:
- *
- * This routine removes the_thread from the_thread_queue
- * and cancels any timeouts associated with this blocking.
- */
-
-void _Thread_queue_Extract(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_queue_Extract_with_proxy
- *
- * DESCRIPTION:
- *
- * This routine extracts the_thread from the_thread_queue
- * and insures that if there is a proxy for this task on
- * another node, it is also dealt with.
- */
-
-boolean _Thread_queue_Extract_with_proxy(
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_queue_First
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the "first" thread
- * on the_thread_queue. The "first" thread is selected
- * based on the discipline of the_thread_queue.
- */
-
-Thread_Control *_Thread_queue_First(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Flush
- *
- * DESCRIPTION:
- *
- * This routine unblocks all threads blocked on the_thread_queue
- * and cancels any associated timeouts.
- */
-
-void _Thread_queue_Flush(
- Thread_queue_Control *the_thread_queue,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-);
-
-/*
- * _Thread_queue_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the_thread_queue based on the
- * discipline indicated in attribute_set. The state set on
- * threads which block on the_thread_queue is state.
- */
-
-void _Thread_queue_Initialize(
- Thread_queue_Control *the_thread_queue,
- Objects_Classes the_class,
- Thread_queue_Disciplines the_discipline,
- States_Control state,
- Thread_queue_Extract_callout proxy_extract_callout,
- unsigned32 timeout_status
-);
-
-/*
- * _Thread_queue_Dequeue_priority
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the highest priority
- * thread waiting on the_thread_queue. If no threads are waiting
- * on the_thread_queue, then NULL is returned.
- */
-
-Thread_Control *_Thread_queue_Dequeue_priority(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Enqueue_priority
- *
- * DESCRIPTION:
- *
- * This routine enqueues the currently executing thread on
- * the_thread_queue with an optional timeout using the
- * priority discipline.
- */
-
-void _Thread_queue_Enqueue_priority(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread,
- Watchdog_Interval timeout
-);
-
-/*
- * _Thread_queue_Extract_priority
- *
- * DESCRIPTION:
- *
- * This routine removes the_thread from the_thread_queue
- * and cancels any timeouts associated with this blocking.
- */
-
-void _Thread_queue_Extract_priority(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_queue_First_priority
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the "first" thread
- * on the_thread_queue. The "first" thread is the highest
- * priority thread waiting on the_thread_queue.
- */
-
-Thread_Control *_Thread_queue_First_priority(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Dequeue_FIFO
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the thread which has
- * been waiting the longest on the_thread_queue. If no
- * threads are waiting on the_thread_queue, then NULL is returned.
- */
-
-Thread_Control *_Thread_queue_Dequeue_fifo(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_Enqueue_FIFO
- *
- * DESCRIPTION:
- *
- * This routine enqueues the currently executing thread on
- * the_thread_queue with an optional timeout using the
- * FIFO discipline.
- */
-
-void _Thread_queue_Enqueue_fifo(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread,
- Watchdog_Interval timeout
-);
-
-/*
- * _Thread_queue_Extract_FIFO
- *
- * DESCRIPTION:
- *
- * This routine removes the_thread from the_thread_queue
- * and cancels any timeouts associated with this blocking.
- */
-
-void _Thread_queue_Extract_fifo(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-);
-
-/*
- * _Thread_queue_First_FIFO
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the "first" thread
- * on the_thread_queue. The first thread is the thread
- * which has been waiting longest on the_thread_queue.
- */
-
-Thread_Control *_Thread_queue_First_fifo(
- Thread_queue_Control *the_thread_queue
-);
-
-/*
- * _Thread_queue_timeout
- *
- * DESCRIPTION:
- *
- * This routine is invoked when a task's request has not
- * been satisfied after the timeout interval specified to
- * enqueue. The task represented by ID will be unblocked and
- * its status code will be set in it's control block to indicate
- * that a timeout has occurred.
- */
-
-void _Thread_queue_Timeout (
- Objects_Id id,
- void *ignored
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/tod.h b/cpukit/score/include/rtems/score/tod.h
deleted file mode 100644
index b87486bda1..0000000000
--- a/cpukit/score/include/rtems/score/tod.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/* tod.h
- *
- * This include file contains all the constants and structures associated
- * with the Time of Day Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIME_OF_DAY_h
-#define __TIME_OF_DAY_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-#include <rtems/score/watchdog.h>
-
-/*
- * The following constants are related to the time of day.
- */
-
-#define TOD_SECONDS_PER_MINUTE 60
-#define TOD_MINUTES_PER_HOUR 60
-#define TOD_MONTHS_PER_YEAR 12
-#define TOD_DAYS_PER_YEAR 365
-#define TOD_HOURS_PER_DAY 24
-#define TOD_SECONDS_PER_DAY (TOD_SECONDS_PER_MINUTE * \
- TOD_MINUTES_PER_HOUR * \
- TOD_HOURS_PER_DAY)
-
-#define TOD_SECONDS_PER_NON_LEAP_YEAR (365 * TOD_SECONDS_PER_DAY)
-
-#define TOD_MILLISECONDS_PER_SECOND 1000
-#define TOD_MICROSECONDS_PER_SECOND 1000000
-#define TOD_NANOSECONDS_PER_SECOND 1000000000
-#define TOD_NANOSECONDS_PER_MICROSECOND 1000
-
-/*
- * The following constant define the earliest year to which an
- * time of day can be initialized. This is considered the
- * epoch.
- */
-
-#define TOD_BASE_YEAR 1988
-
-/*
- * The following record defines the time of control block. This
- * control block is used to maintain the current time of day.
- */
-
-typedef struct { /* RTEID style time/date */
- unsigned32 year; /* year, A.D. */
- unsigned32 month; /* month, 1 -> 12 */
- unsigned32 day; /* day, 1 -> 31 */
- unsigned32 hour; /* hour, 0 -> 23 */
- unsigned32 minute; /* minute, 0 -> 59 */
- unsigned32 second; /* second, 0 -> 59 */
- unsigned32 ticks; /* elapsed ticks between secs */
-} TOD_Control;
-
-/*
- * The following is TRUE if the application has set the current
- * time of day, and FALSE otherwise.
- */
-
-SCORE_EXTERN boolean _TOD_Is_set;
-
-/*
- * The following contains the current time of day.
- */
-
-SCORE_EXTERN TOD_Control _TOD_Current;
-
-/*
- * The following contains the number of seconds from 00:00:00
- * January 1, TOD_BASE_YEAR until the current time of day.
- */
-
-SCORE_EXTERN Watchdog_Interval _TOD_Seconds_since_epoch;
-
-/*
- * The following contains the number of microseconds per tick.
- */
-
-SCORE_EXTERN unsigned32 _TOD_Microseconds_per_tick;
-
-/*
- * The following contains the number of clock ticks per second.
- *
- * NOTE:
- *
- * If one second is NOT evenly divisible by the number of microseconds
- * per clock tick, this value will contain only the integer portion
- * of the division. This means that the interval between clock ticks
- * can be a source of error in the current time of day.
- */
-
-SCORE_EXTERN unsigned32 _TOD_Ticks_per_second;
-
-/*
- * This is the control structure for the watchdog timer which
- * fires to service the seconds chain.
- */
-
-SCORE_EXTERN Watchdog_Control _TOD_Seconds_watchdog;
-
-#ifdef SCORE_INIT
-
-/*
- * The following array contains the number of days in all months.
- * The first dimension should be 1 for leap years, and 0 otherwise.
- * The second dimension should range from 1 to 12 for January to
- * February, respectively.
- */
-
-const unsigned32 _TOD_Days_per_month[ 2 ][ 13 ] = {
- { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
- { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
-};
-
-/*
- * The following array contains the number of days in all months
- * up to the month indicated by the index of the second dimension.
- * The first dimension should be 1 for leap years, and 0 otherwise.
- */
-
-const unsigned16 _TOD_Days_to_date[2][13] = {
- { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 },
- { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }
-};
-
-/*
- * The following array contains the number of days in the years
- * since the last leap year. The index should be 0 for leap
- * years, and the number of years since the beginning of a leap
- * year otherwise.
- */
-
-const unsigned16 _TOD_Days_since_last_leap_year[4] = { 0, 366, 731, 1096 };
-
-#else
-
-extern const unsigned16 _TOD_Days_to_date[2][13]; /* Julian days */
-extern const unsigned16 _TOD_Days_since_last_leap_year[4];
-extern const unsigned32 _TOD_Days_per_month[2][13];
-
-#endif
-
-/*
- * _TOD_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _TOD_Handler_initialization(
- unsigned32 microseconds_per_tick
-);
-
-/*
- * _TOD_Set
- *
- * DESCRIPTION:
- *
- * This routine sets the current time of day to THE_TOD and
- * the equivalent SECONDS_SINCE_EPOCH.
- */
-
-void _TOD_Set(
- TOD_Control *the_tod,
- Watchdog_Interval seconds_since_epoch
-);
-
-/*
- * _TOD_Validate
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if THE_TOD contains
- * a valid time of day, and FALSE otherwise.
- */
-
-boolean _TOD_Validate(
- TOD_Control *the_tod
-);
-
-/*
- * _TOD_To_seconds
- *
- * DESCRIPTION:
- *
- * This function returns the number seconds between the epoch and THE_TOD.
- */
-
-Watchdog_Interval _TOD_To_seconds(
- TOD_Control *the_tod
-);
-
-/*
- * _TOD_Tickle
- *
- * DESCRIPTION:
- *
- * This routine is scheduled as a watchdog function and is invoked at
- * each second boundary. It updates the current time of day to indicate
- * that a second has passed and processes the seconds watchdog chain.
- */
-
-void _TOD_Tickle(
- Objects_Id id,
- void *ignored
-);
-
-/*
- * TOD_MILLISECONDS_TO_MICROSECONDS
- *
- * DESCRIPTION:
- *
- * This routine converts an interval expressed in milliseconds to microseconds.
- *
- * NOTE:
- *
- * This must be a macro so it can be used in "static" tables.
- */
-
-#define TOD_MILLISECONDS_TO_MICROSECONDS(_ms) ((_ms) * 1000)
-
-/*
- * TOD_MICROSECONDS_TO_TICKS
- *
- * DESCRIPTION:
- *
- * This routine converts an interval expressed in microseconds to ticks.
- *
- * NOTE:
- *
- * This must be a macro so it can be used in "static" tables.
- */
-
-#define TOD_MICROSECONDS_TO_TICKS(_us) \
- ((_us) / _TOD_Microseconds_per_tick)
-
-/*
- * TOD_MILLISECONDS_TO_TICKS
- *
- * DESCRIPTION:
- *
- * This routine converts an interval expressed in milliseconds to ticks.
- *
- * NOTE:
- *
- * This must be a macro so it can be used in "static" tables.
- */
-
-#define TOD_MILLISECONDS_TO_TICKS(_ms) \
- (TOD_MILLISECONDS_TO_MICROSECONDS(_ms) / _TOD_Microseconds_per_tick)
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/tod.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/tqdata.h b/cpukit/score/include/rtems/score/tqdata.h
deleted file mode 100644
index 6136d35412..0000000000
--- a/cpukit/score/include/rtems/score/tqdata.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* tqdata.h
- *
- * This include file contains all the constants and structures
- * needed to declare a thread queue.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_QUEUE_DATA_h
-#define __THREAD_QUEUE_DATA_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/chain.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/states.h>
-
-/*
- * The following enumerated type details all of the disciplines
- * supported by the Thread Queue Handler.
- */
-
-typedef enum {
- THREAD_QUEUE_DISCIPLINE_FIFO, /* FIFO queue discipline */
- THREAD_QUEUE_DISCIPLINE_PRIORITY /* PRIORITY queue discipline */
-} Thread_queue_Disciplines;
-
-/*
- * The following enumerated types indicate what happened while the thread
- * queue was in the synchronization window.
- */
-
-typedef enum {
- THREAD_QUEUE_SYNCHRONIZED,
- THREAD_QUEUE_NOTHING_HAPPENED,
- THREAD_QUEUE_TIMEOUT,
- THREAD_QUEUE_SATISFIED
-} Thread_queue_States;
-
-/*
- * The following constants are used to manage the priority queues.
- *
- * There are four chains used to maintain a priority -- each chain
- * manages a distinct set of task priorities. The number of chains
- * is determined by TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS.
- * The following set must be consistent.
- *
- * The set below configures 4 headers -- each contains 64 priorities.
- * Header x manages priority range (x*64) through ((x*64)+63). If
- * the priority is more than half way through the priority range it
- * is in, then the search is performed from the rear of the chain.
- * This halves the search time to find the insertion point.
- */
-
-#define TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS 4
-#define TASK_QUEUE_DATA_PRIORITIES_PER_HEADER 64
-#define TASK_QUEUE_DATA_REVERSE_SEARCH_MASK 0x20
-
-typedef struct {
- union {
- Chain_Control Fifo; /* FIFO discipline list */
- Chain_Control Priority[TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS];
- /* priority discipline list */
- } Queues;
- Thread_queue_States sync_state; /* alloc/dealloc critical section */
- Thread_queue_Disciplines discipline; /* queue discipline */
- States_Control state; /* state of threads on Thread_q */
- unsigned32 timeout_status;
-} Thread_queue_Control;
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/tqdata.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/userext.h b/cpukit/score/include/rtems/score/userext.h
deleted file mode 100644
index 29b0e9564e..0000000000
--- a/cpukit/score/include/rtems/score/userext.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/* userext.h
- *
- * This include file contains all information about user extensions. This
- * Handler provides mechanisms which can be used to initialize and manipulate
- * all user extensions.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __USER_EXTENSIONS_h
-#define __USER_EXTENSIONS_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/interr.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/thread.h>
-
-/*
- * The following records defines the User Extension Table.
- * This table defines the application dependent routines which
- * are invoked at critical points in the life of each thread and
- * the system as a whole.
- */
-
-typedef void User_extensions_routine;
-
-typedef boolean ( *User_extensions_thread_create_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_delete_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_start_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_restart_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_switch_extension )(
- Thread_Control *,
- Thread_Control *
- );
-
-typedef User_extensions_routine (
- *User_extensions_thread_post_switch_extension )(
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_begin_extension )(
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_thread_exitted_extension )(
- Thread_Control *
- );
-
-typedef User_extensions_routine ( *User_extensions_fatal_extension )(
- Internal_errors_Source /* the_source */,
- boolean /* is_internal */,
- unsigned32 /* the_error */
- );
-
-
-typedef struct {
- User_extensions_thread_create_extension thread_create;
- User_extensions_thread_start_extension thread_start;
- User_extensions_thread_restart_extension thread_restart;
- User_extensions_thread_delete_extension thread_delete;
- User_extensions_thread_switch_extension thread_switch;
- User_extensions_thread_begin_extension thread_begin;
- User_extensions_thread_exitted_extension thread_exitted;
- User_extensions_fatal_extension fatal;
-} User_extensions_Table;
-
-/*
- * The following is used to manage each user extension set.
- */
-
-typedef struct {
- Chain_Node Node;
- User_extensions_Table Callouts;
-} User_extensions_Control;
-
-/*
- * The following is used to manage the list of active extensions.
- */
-
-SCORE_EXTERN Chain_Control _User_extensions_List;
-
-/*
- * _User_extensions_Thread_create
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension for
- * the thread creation operate.
- */
-
-boolean _User_extensions_Thread_create (
- Thread_Control *the_thread
-);
-
-/*
- * _User_extensions_Thread_delete
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension for
- * the thread deletion operation.
- */
-
-void _User_extensions_Thread_delete (
- Thread_Control *the_thread
-);
-
-/*
- * _User_extensions_Thread_start
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension for
- * the thread start operation.
- */
-
-void _User_extensions_Thread_start (
- Thread_Control *the_thread
-);
-
-/*
- * _User_extensions_Thread_restart
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension for
- * the thread restart operation.
- */
-
-void _User_extensions_Thread_restart (
- Thread_Control *the_thread
-);
-
-/*
- * _User_extensions_Thread_begin
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension which
- * is invoked when a thread begins.
- */
-
-void _User_extensions_Thread_begin (
- Thread_Control *executing
-);
-
-/*
- * _User_extensions_Thread_exitted
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension which
- * is invoked when a thread exits.
- */
-
-void _User_extensions_Thread_exitted (
- Thread_Control *executing
-);
-
-/*
- * _User_extensions_Fatal
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension invoked
- * when a fatal error occurs.
- */
-
-void _User_extensions_Fatal (
- Internal_errors_Source the_source,
- boolean is_internal,
- unsigned32 the_error
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/userext.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/watchdog.h b/cpukit/score/include/rtems/score/watchdog.h
deleted file mode 100644
index ceb09793f6..0000000000
--- a/cpukit/score/include/rtems/score/watchdog.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/* watchdog.h
- *
- * This include file contains all the constants and structures associated
- * with watchdog timers. This Handler provides mechanisms which can be
- * used to initialize and manipulate watchdog timers.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WATCHDOG_h
-#define __WATCHDOG_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/object.h>
-
-/*
- * The following type defines the control block used to manage
- * intervals.
- */
-
-typedef unsigned32 Watchdog_Interval;
-
-/*
- * The following types define a pointer to a watchdog service routine.
- */
-
-typedef void Watchdog_Service_routine;
-
-typedef Watchdog_Service_routine ( *Watchdog_Service_routine_entry )(
- Objects_Id,
- void *
- );
-
-/*
- * Constant for indefinite wait. (actually an illegal interval)
- */
-
-#define WATCHDOG_NO_TIMEOUT 0
-
-/*
- * The following enumerated type lists the states in which a
- * watchdog timer may be at any given time.
- */
-
-typedef enum {
- WATCHDOG_INACTIVE, /* off all chains */
- WATCHDOG_BEING_INSERTED, /* off all chains, searching for insertion point */
- WATCHDOG_ACTIVE, /* on chain, allowed to fire */
- WATCHDOG_REMOVE_IT /* on chain, remove without firing if expires */
-} Watchdog_States;
-
-/*
- * The following enumerated type details the manner in which
- * a watchdog chain may be adjusted by the Watchdog_Adjust
- * routine. The direction indicates a movement FORWARD
- * or BACKWARD in time.
- */
-
-typedef enum {
- WATCHDOG_FORWARD, /* adjust delta value forward */
- WATCHDOG_BACKWARD /* adjust delta value backward */
-} Watchdog_Adjust_directions;
-
-/*
- * The following record defines the control block used
- * to manage each watchdog timer.
- */
-
-typedef struct {
- Chain_Node Node;
- Watchdog_States state;
- Watchdog_Interval initial;
- Watchdog_Interval delta_interval;
- Watchdog_Interval start_time;
- Watchdog_Interval stop_time;
- Watchdog_Service_routine_entry routine;
- Objects_Id id;
- void *user_data;
-} Watchdog_Control;
-
-/*
- * The following are used for synchronization purposes
- * during an insert on a watchdog delta chain.
- */
-
-SCORE_EXTERN volatile unsigned32 _Watchdog_Sync_level;
-SCORE_EXTERN volatile unsigned32 _Watchdog_Sync_count;
-
-/*
- * The following contains the number of ticks since the
- * system was booted.
- */
-
-SCORE_EXTERN Watchdog_Interval _Watchdog_Ticks_since_boot;
-
-/*
- * The following defines the watchdog chains which are managed
- * on ticks and second boundaries.
- */
-
-SCORE_EXTERN Chain_Control _Watchdog_Ticks_chain;
-SCORE_EXTERN Chain_Control _Watchdog_Seconds_chain;
-
-/*
- * _Watchdog_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the watchdog handler. The watchdog
- * synchronization flag is initialized and the watchdog chains are
- * initialized and emptied.
- */
-
-void _Watchdog_Handler_initialization( void );
-
-/*
- * _Watchdog_Remove
- *
- * DESCRIPTION:
- *
- * This routine removes THE_WATCHDOG from the watchdog chain on which
- * it resides and returns the state THE_WATCHDOG timer was in.
- */
-
-Watchdog_States _Watchdog_Remove (
- Watchdog_Control *the_watchdog
-);
-
-/*
- * _Watchdog_Adjust
- *
- * DESCRIPTION:
- *
- * This routine adjusts the HEADER watchdog chain in the forward
- * or backward DIRECTION for UNITS ticks.
- */
-
-void _Watchdog_Adjust (
- Chain_Control *header,
- Watchdog_Adjust_directions direction,
- Watchdog_Interval units
-);
-
-/*
- * _Watchdog_Insert
- *
- * DESCRIPTION:
- *
- * This routine inserts THE_WATCHDOG into the HEADER watchdog chain
- * for a time of UNITS. The INSERT_MODE indicates whether
- * THE_WATCHDOG is to be activated automatically or later, explicitly
- * by the caller.
- *
- */
-
-void _Watchdog_Insert (
- Chain_Control *header,
- Watchdog_Control *the_watchdog
-);
-
-/*
- * _Watchdog_Tickle
- *
- * DESCRIPTION:
- *
- * This routine is invoked at appropriate intervals to update
- * the HEADER watchdog chain.
- */
-
-void _Watchdog_Tickle (
- Chain_Control *header
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/watchdog.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/score/wkspace.h b/cpukit/score/include/rtems/score/wkspace.h
deleted file mode 100644
index 3b4b84f95f..0000000000
--- a/cpukit/score/include/rtems/score/wkspace.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* wkspace.h
- *
- * This include file contains information related to the
- * RAM Workspace. This Handler provides mechanisms which can be used to
- * define, initialize and manipulate the workspace.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WORKSPACE_h
-#define __WORKSPACE_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/heap.h>
-#include <rtems/score/interr.h>
-
-/*
- * The following is used to manage the Workspace.
- *
- */
-
-SCORE_EXTERN Heap_Control _Workspace_Area; /* executive heap header */
-
-/*
- * _Workspace_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-void _Workspace_Handler_initialization(
- void *starting_address,
- unsigned32 size
-);
-
-/*
- * _Workspace_Allocate_or_fatal_error
- *
- * DESCRIPTION:
- *
- * This routine returns the address of a block of memory of size
- * bytes. If a block of the appropriate size cannot be allocated
- * from the workspace, then the internal error handler is invoked.
- */
-
-void *_Workspace_Allocate_or_fatal_error(
- unsigned32 size
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/wkspace.inl>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/include/rtems/system.h b/cpukit/score/include/rtems/system.h
deleted file mode 100644
index 5e1cc80ed5..0000000000
--- a/cpukit/score/include/rtems/system.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the executive. This must be the first include file
- * included in all internal RTEMS files.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __RTEMS_SYSTEM_h
-#define __RTEMS_SYSTEM_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The target options include file defines all target dependent
- * parameters for this build of RTEMS. It must be included
- * first so the basic macro definitions are in place.
- */
-
-#include <rtems/score/targopts.h>
-
-/*
- * The following insures that all data is declared in the space
- * of the initialization routine for either the Initialization Manager
- * or the initialization file for the appropriate API. It is
- * referenced as "external" in every other file.
- */
-
-#ifdef SCORE_INIT
-#undef SCORE_EXTERN
-#define SCORE_EXTERN
-#else
-#undef SCORE_EXTERN
-#define SCORE_EXTERN extern
-#endif
-
-#ifdef SAPI_INIT
-#undef SAPI_EXTERN
-#define SAPI_EXTERN
-#else
-#undef SAPI_EXTERN
-#define SAPI_EXTERN extern
-#endif
-
-#ifdef RTEMS_API_INIT
-#undef RTEMS_EXTERN
-#define RTEMS_EXTERN
-#else
-#undef RTEMS_EXTERN
-#define RTEMS_EXTERN extern
-#endif
-
-#ifdef POSIX_API_INIT
-#undef POSIX_EXTERN
-#define POSIX_EXTERN
-#else
-#undef POSIX_EXTERN
-#define POSIX_EXTERN extern
-#endif
-
-/*
- * The following (in conjunction with compiler arguments) are used
- * to choose between the use of static inline functions and macro
- * functions. The static inline implementation allows better
- * type checking with no cost in code size or execution speed.
- */
-
-#ifdef USE_INLINES
-# ifdef __GNUC__
-# define RTEMS_INLINE_ROUTINE static __inline__
-# else
-# define RTEMS_INLINE_ROUTINE static inline
-# endif
-#else
-# define RTEMS_INLINE_ROUTINE
-#endif
-
-/*
- * Include a base set of files.
- */
-
-/*
- * XXX: Eventually proc_ptr needs to disappear!!!
- */
-
-typedef void * proc_ptr;
-
-/*
- * Define NULL
- */
-
-#ifndef NULL
-#define NULL 0 /* NULL value */
-#endif
-
-/*
- * Boolean constants
- */
-
-#if !defined( TRUE ) || (TRUE != 1)
-#undef TRUE
-#define TRUE (1)
-#endif
-
-#if !defined( FALSE ) || (FALSE != 0)
-#undef FALSE
-#define FALSE (0)
-#endif
-
-#include <rtems/score/cpu.h> /* processor specific information */
-
-#define stringify( _x ) # _x
-
-#define RTEMS_offsetof(type, field) \
- ((unsigned32) &(((type *) 0)->field))
-
-/*
- * The following is the extern for the RTEMS version string.
- * The contents of this string are CPU specific.
- */
-
-extern const char _RTEMS_version[]; /* RTEMS version string */
-extern const char _Copyright_Notice[]; /* RTEMS copyright string */
-
-/*
- * The following defines the CPU dependent information table.
- */
-
-SCORE_EXTERN rtems_cpu_table _CPU_Table; /* CPU dependent info */
-
-/*
- * XXX weird RTEMS stuff
- */
-
-#define RTEMS_MAXIMUM_NAME_LENGTH 4
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/address.inl b/cpukit/score/inline/rtems/score/address.inl
deleted file mode 100644
index 2e3049d08e..0000000000
--- a/cpukit/score/inline/rtems/score/address.inl
+++ /dev/null
@@ -1,120 +0,0 @@
-/* inline/address.inl
- *
- * This include file contains the bodies of the routines
- * about addresses which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_ADDRESSES_inl
-#define __INLINE_ADDRESSES_inl
-
-/*PAGE
- *
- * _Addresses_Add_offset
- *
- * DESCRIPTION:
- *
- * This function is used to add an offset to a base address.
- * It returns the resulting address. This address is typically
- * converted to an access type before being used further.
- */
-
-RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
- void *base,
- unsigned32 offset
-)
-{
- return (void *)((char *)base + offset);
-}
-
-/*PAGE
- *
- * _Addresses_Subtract_offset
- *
- * DESCRIPTION:
- *
- * This function is used to subtract an offset from a base
- * address. It returns the resulting address. This address is
- * typically converted to an access type before being used further.
- */
-
-RTEMS_INLINE_ROUTINE void *_Addresses_Subtract_offset (
- void *base,
- unsigned32 offset
-)
-{
- return (void *)((char *)base - offset);
-}
-
-/*PAGE
- *
- * _Addresses_Subtract
- *
- * DESCRIPTION:
- *
- * This function is used to subtract two addresses. It returns the
- * resulting offset.
- *
- * NOTE: The cast of an address to an unsigned32 makes this code
- * dependent on an addresses being thirty two bits.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Addresses_Subtract (
- void *left,
- void *right
-)
-{
- return ((char *) left - (char *) right);
-}
-
-/*PAGE
- *
- * _Addresses_Is_aligned
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the given address is correctly
- * aligned for this processor and FALSE otherwise. Proper alignment
- * is based on correctness and efficiency.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Addresses_Is_aligned (
- void *address
-)
-{
- return ( ( (unsigned32)address % CPU_ALIGNMENT ) == 0 );
-}
-
-/*PAGE
- *
- * _Addresses_Is_in_range
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the given address is within the
- * memory range specified and FALSE otherwise. base is the address
- * of the first byte in the memory range and limit is the address
- * of the last byte in the memory range. The base address is
- * assumed to be lower than the limit address.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Addresses_Is_in_range (
- void *address,
- void *base,
- void *limit
-)
-{
- return ( address >= base && address <= limit );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/chain.inl b/cpukit/score/inline/rtems/score/chain.inl
deleted file mode 100644
index 4bd80116ae..0000000000
--- a/cpukit/score/inline/rtems/score/chain.inl
+++ /dev/null
@@ -1,390 +0,0 @@
-/* inline/chain.inl
- *
- * This include file contains the bodies of the routines which are
- * associated with doubly linked chains and inlined.
- *
- * NOTE: The routines in this file are ordered from simple
- * to complex. No other Chain Handler routine is referenced
- * unless it has already been defined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_CHAIN_inl
-#define __INLINE_CHAIN_inl
-
-/*PAGE
- *
- * _Chain_Are_nodes_equal
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if LEFT and RIGHT are equal,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Are_nodes_equal(
- Chain_Node *left,
- Chain_Node *right
-)
-{
- return left == right;
-}
-
-/*PAGE
- *
- * _Chain_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_chain is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_null(
- Chain_Control *the_chain
-)
-{
- return ( the_chain == NULL );
-}
-
-/*PAGE
- *
- * _Chain_Is_null_node
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_null_node(
- Chain_Node *the_node
-)
-{
- return ( the_node == NULL );
-}
-
-/*PAGE
- *
- * _Chain_Head
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the first node on the chain.
- */
-
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head(
- Chain_Control *the_chain
-)
-{
- return (Chain_Node *) the_chain;
-}
-
-/*PAGE
- *
- * _Chain_Tail
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the last node on the chain.
- */
-
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
- Chain_Control *the_chain
-)
-{
- return (Chain_Node *) &the_chain->permanent_null;
-}
-
-/*PAGE
- *
- * _Chain_Is_empty
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if there a no nodes on the_chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_empty(
- Chain_Control *the_chain
-)
-{
- return ( the_chain->first == _Chain_Tail( the_chain ) );
-}
-
-/*PAGE
- *
- * _Chain_Is_first
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is the first node on a chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_first(
- Chain_Node *the_node
-)
-{
- return ( the_node->previous == NULL );
-}
-
-/*PAGE
- *
- * _Chain_Is_last
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is the last node on a chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_last(
- Chain_Node *the_node
-)
-{
- return ( the_node->next == NULL );
-}
-
-/*PAGE
- *
- * _Chain_Has_only_one_node
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if there is only one node on the_chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Has_only_one_node(
- Chain_Control *the_chain
-)
-{
- return ( the_chain->first == the_chain->last );
-}
-
-/*PAGE
- *
- * _Chain_Is_head
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is the head of the_chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_head(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- return ( the_node == _Chain_Head( the_chain ) );
-}
-
-/*PAGE
- *
- * _Chain_Is_tail
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_node is the tail of the_chain and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Chain_Is_tail(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- return ( the_node == _Chain_Tail( the_chain ) );
-}
-
-/*PAGE
- *
- * Chain_Initialize_empty
- *
- * DESCRIPTION:
- *
- * This routine initializes the specified chain to contain zero nodes.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
- Chain_Control *the_chain
-)
-{
- the_chain->first = _Chain_Tail( the_chain );
- the_chain->permanent_null = NULL;
- the_chain->last = _Chain_Head( the_chain );
-}
-
-/*PAGE
- *
- * _Chain_Extract_unprotected
- *
- * DESCRIPTION:
- *
- * This routine extracts the_node from the chain on which it resides.
- * It does NOT disable interrupts to insure the atomicity of the
- * extract operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Extract_unprotected(
- Chain_Node *the_node
-)
-{
- Chain_Node *next;
- Chain_Node *previous;
-
- next = the_node->next;
- previous = the_node->previous;
- next->previous = previous;
- previous->next = next;
-}
-
-/*PAGE
- *
- * _Chain_Get_first_unprotected
- *
- * DESCRIPTION:
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. It does NOT disable interrupts to insure
- * the atomicity of the get operation.
- */
-
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected(
- Chain_Control *the_chain
-)
-{
- Chain_Node *return_node;
- Chain_Node *new_first;
-
- return_node = the_chain->first;
- new_first = return_node->next;
- the_chain->first = new_first;
- new_first->previous = _Chain_Head( the_chain );
-
- return return_node;
-}
-
-/*PAGE
- *
- * Chain_Get_unprotected
- *
- * DESCRIPTION:
- *
- * This function removes the first node from the_chain and returns
- * a pointer to that node. If the_chain is empty, then NULL is returned.
- * It does NOT disable interrupts to insure the atomicity of the
- * get operation.
- */
-
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
- Chain_Control *the_chain
-)
-{
- if ( !_Chain_Is_empty( the_chain ) )
- return _Chain_Get_first_unprotected( the_chain );
- else
- return NULL;
-}
-
-/*PAGE
- *
- * _Chain_Insert_unprotected
- *
- * DESCRIPTION:
- *
- * This routine inserts the_node on a chain immediately following
- * after_node. It does NOT disable interrupts to insure the atomicity
- * of the extract operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Insert_unprotected(
- Chain_Node *after_node,
- Chain_Node *the_node
-)
-{
- Chain_Node *before_node;
-
- the_node->previous = after_node;
- before_node = after_node->next;
- after_node->next = the_node;
- the_node->next = before_node;
- before_node->previous = the_node;
-}
-
-/*PAGE
- *
- * _Chain_Append_unprotected
- *
- * DESCRIPTION:
- *
- * This routine appends the_node onto the end of the_chain.
- * It does NOT disable interrupts to insure the atomicity of the
- * append operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- Chain_Node *old_last_node;
-
- the_node->next = _Chain_Tail( the_chain );
- old_last_node = the_chain->last;
- the_chain->last = the_node;
- old_last_node->next = the_node;
- the_node->previous = old_last_node;
-}
-
-/*PAGE
- *
- * _Chain_Prepend_unprotected
- *
- * DESCRIPTION:
- *
- * This routine prepends the_node onto the front of the_chain.
- * It does NOT disable interrupts to insure the atomicity of the
- * prepend operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- _Chain_Insert_unprotected( _Chain_Head( the_chain ), the_node );
-
-}
-
-/*PAGE
- *
- * _Chain_Prepend
- *
- * DESCRIPTION:
- *
- * This routine prepends the_node onto the front of the_chain.
- * It disables interrupts to insure the atomicity of the
- * prepend operation.
- */
-
-RTEMS_INLINE_ROUTINE void _Chain_Prepend(
- Chain_Control *the_chain,
- Chain_Node *the_node
-)
-{
- _Chain_Insert( _Chain_Head( the_chain ), the_node );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/coremsg.inl b/cpukit/score/inline/rtems/score/coremsg.inl
deleted file mode 100644
index a43b0e7b06..0000000000
--- a/cpukit/score/inline/rtems/score/coremsg.inl
+++ /dev/null
@@ -1,260 +0,0 @@
-/* coremsg.inl
- *
- * This include file contains the static inline implementation of all
- * inlined routines in the Core Message Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __CORE_MESSAGE_QUEUE_inl
-#define __CORE_MESSAGE_QUEUE_inl
-
-#include <string.h> /* needed for memcpy */
-
-/*PAGE
- *
- * _CORE_message_queue_Send
- *
- * DESCRIPTION:
- *
- * This routine sends a message to the end of the specified message queue.
- */
-
-RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Send(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support
-)
-{
- return _CORE_message_queue_Submit(
- the_message_queue,
- buffer,
- size,
- id,
- api_message_queue_mp_support,
- CORE_MESSAGE_QUEUE_SEND_REQUEST
- );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Urgent
- *
- * DESCRIPTION:
- *
- * This routine sends a message to the front of the specified message queue.
- */
-
-RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Urgent(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support
-)
-{
- return _CORE_message_queue_Submit(
- the_message_queue,
- buffer,
- size,
- id,
- api_message_queue_mp_support,
- CORE_MESSAGE_QUEUE_URGENT_REQUEST
- );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Copy_buffer
- *
- * DESCRIPTION:
- *
- * This routine copies the contents of the source message buffer
- * to the destination message buffer.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Copy_buffer (
- void *source,
- void *destination,
- unsigned32 size
-)
-{
- memcpy(destination, source, size);
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Allocate_message_buffer
- *
- * DESCRIPTION:
- *
- * This function allocates a message buffer from the inactive
- * message buffer chain.
- */
-
-RTEMS_INLINE_ROUTINE CORE_message_queue_Buffer_control *
-_CORE_message_queue_Allocate_message_buffer (
- CORE_message_queue_Control *the_message_queue
-)
-{
- return (CORE_message_queue_Buffer_control *)
- _Chain_Get( &the_message_queue->Inactive_messages );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Free_message_buffer
- *
- * DESCRIPTION:
- *
- * This routine frees a message buffer to the inactive
- * message buffer chain.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer (
- CORE_message_queue_Control *the_message_queue,
- CORE_message_queue_Buffer_control *the_message
-)
-{
- _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Get_pending_message
- *
- * DESCRIPTION:
- *
- * This function removes the first message from the_message_queue
- * and returns a pointer to it.
- */
-
-RTEMS_INLINE_ROUTINE
- CORE_message_queue_Buffer_control *_CORE_message_queue_Get_pending_message (
- CORE_message_queue_Control *the_message_queue
-)
-{
- return (CORE_message_queue_Buffer_control *)
- _Chain_Get_unprotected( &the_message_queue->Pending_messages );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Is_priority
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_priority(
- CORE_message_queue_Attributes *the_attribute
-)
-{
- return (the_attribute->discipline == CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY);
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Append
- *
- * DESCRIPTION:
- *
- * This routine places the_message at the rear of the outstanding
- * messages on the_message_queue.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Append (
- CORE_message_queue_Control *the_message_queue,
- CORE_message_queue_Buffer_control *the_message
-)
-{
- _Chain_Append( &the_message_queue->Pending_messages, &the_message->Node );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Prepend
- *
- * DESCRIPTION:
- *
- * This routine places the_message at the front of the outstanding
- * messages on the_message_queue.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Prepend (
- CORE_message_queue_Control *the_message_queue,
- CORE_message_queue_Buffer_control *the_message
-)
-{
- _Chain_Prepend(
- &the_message_queue->Pending_messages,
- &the_message->Node
- );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_message_queue is TRUE and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_null (
- CORE_message_queue_Control *the_message_queue
-)
-{
- return ( the_message_queue == NULL );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Is_notify_enabled
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if notification is enabled on this message
- * queue and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_notify_enabled (
- CORE_message_queue_Control *the_message_queue
-)
-{
- return (the_message_queue->notify_handler != NULL);
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Set_notify
- *
- * DESCRIPTION:
- *
- * This routine initializes the notification information for the_message_queue.
- */
-
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Set_notify (
- CORE_message_queue_Control *the_message_queue,
- CORE_message_queue_Notify_Handler the_handler,
- void *the_argument
-)
-{
- the_message_queue->notify_handler = the_handler;
- the_message_queue->notify_argument = the_argument;
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/coremutex.inl b/cpukit/score/inline/rtems/score/coremutex.inl
deleted file mode 100644
index 457f7c7d7d..0000000000
--- a/cpukit/score/inline/rtems/score/coremutex.inl
+++ /dev/null
@@ -1,124 +0,0 @@
-/* inline/coremutex.inl
- *
- * This include file contains all of the inlined routines associated
- * with the CORE mutexes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_CORE_MUTEX_inl
-#define __INLINE_CORE_MUTEX_inl
-
-/*PAGE
- *
- * _CORE_mutex_Is_locked
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex specified is locked and FALSE
- * otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_locked(
- CORE_mutex_Control *the_mutex
-)
-{
- return the_mutex->lock == CORE_MUTEX_LOCKED;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_fifo
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex's wait discipline is FIFO and FALSE
- * otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_fifo(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_FIFO;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_priority
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex's wait discipline is PRIORITY and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_priority(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_inherit_priority
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex's wait discipline is
- * INHERIT_PRIORITY and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_inherit_priority(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_priority_ceiling
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex's wait discipline is
- * PRIORITY_CEILING and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_priority_ceiling(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
-}
-
-/*PAGE
- *
- * _CORE_mutex_Is_nesting_allowed
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the mutex allows a task to obtain a
- * semaphore more than once and nest.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_nesting_allowed(
- CORE_mutex_Attributes *the_attribute
-)
-{
- return the_attribute->allow_nesting == TRUE;
-
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/coresem.inl b/cpukit/score/inline/rtems/score/coresem.inl
deleted file mode 100644
index 7ef8c93990..0000000000
--- a/cpukit/score/inline/rtems/score/coresem.inl
+++ /dev/null
@@ -1,54 +0,0 @@
-/* inline/coresem.inl
- *
- * This include file contains all of the inlined routines associated
- * with the CORE semaphore.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_CORE_SEMAPHORE_inl
-#define __INLINE_CORE_SEMAPHORE_inl
-
-/*PAGE
- *
- * _CORE_semaphore_Is_priority
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority attribute is
- * enabled in the attribute_set and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _CORE_semaphore_Is_priority(
- CORE_semaphore_Attributes *the_attribute
-)
-{
- return ( the_attribute->discipline == CORE_SEMAPHORE_DISCIPLINES_PRIORITY );
-}
-
-/*PAGE
- *
- * _CORE_semaphore_Get_count
- *
- * DESCRIPTION:
- *
- * This routine returns the current count associated with the semaphore.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _CORE_semaphore_Get_count(
- CORE_semaphore_Control *the_semaphore
-)
-{
- return the_semaphore->count;
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/heap.inl b/cpukit/score/inline/rtems/score/heap.inl
deleted file mode 100644
index 92936f8135..0000000000
--- a/cpukit/score/inline/rtems/score/heap.inl
+++ /dev/null
@@ -1,274 +0,0 @@
-/* heap.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines from the heap handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __HEAP_inl
-#define __HEAP_inl
-
-#include <rtems/score/address.h>
-
-/*PAGE
- *
- * _Heap_Head
- *
- * DESCRIPTION:
- *
- * This function returns the head of the specified heap.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Head (
- Heap_Control *the_heap
-)
-{
- return (Heap_Block *)&the_heap->start;
-}
-
-/*PAGE
- *
- * _Heap_Tail
- *
- * DESCRIPTION:
- *
- * This function returns the tail of the specified heap.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Tail (
- Heap_Control *the_heap
-)
-{
- return (Heap_Block *)&the_heap->final;
-}
-
-/*PAGE
- *
- * _Heap_Previous_block
- *
- * DESCRIPTION:
- *
- * This function returns the address of the block which physically
- * precedes the_block in memory.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Previous_block (
- Heap_Block *the_block
-)
-{
- return (Heap_Block *) _Addresses_Subtract_offset(
- (void *)the_block,
- the_block->back_flag & ~ HEAP_BLOCK_USED
- );
-}
-
-/*PAGE
- *
- * _Heap_Next_block
- *
- * DESCRIPTION:
- *
- * This function returns the address of the block which physically
- * follows the_block in memory.
- *
- * NOTE: Next_block assumes that the block is free.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Next_block (
- Heap_Block *the_block
-)
-{
- return (Heap_Block *) _Addresses_Add_offset(
- (void *)the_block,
- the_block->front_flag & ~ HEAP_BLOCK_USED
- );
-}
-
-/*PAGE
- *
- * _Heap_Block_at
- *
- * DESCRIPTION:
- *
- * This function calculates and returns a block's location (address)
- * in the heap based upon a base address and an offset.
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
- void *base,
- unsigned32 offset
-)
-{
- return (Heap_Block *) _Addresses_Add_offset( (void *)base, offset );
-}
-
-/*PAGE
- *
- * _Heap_User_block_at
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_User_block_at(
- void *base
-)
-{
- unsigned32 offset;
-
- offset = *(((unsigned32 *) base) - 1);
- return _Heap_Block_at( base, -offset + -HEAP_BLOCK_USED_OVERHEAD);
-}
-
-/*PAGE
- *
- * _Heap_Is_previous_block_free
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the previous block of the_block
- * is free, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_previous_block_free (
- Heap_Block *the_block
-)
-{
- return !(the_block->back_flag & HEAP_BLOCK_USED);
-}
-
-/*PAGE
- *
- * _Heap_Is_block_free
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the block is free, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_block_free (
- Heap_Block *the_block
-)
-{
- return !(the_block->front_flag & HEAP_BLOCK_USED);
-}
-
-/*PAGE
- *
- * _Heap_Is_block_used
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the block is currently allocated,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_block_used (
- Heap_Block *the_block
-)
-{
- return (the_block->front_flag & HEAP_BLOCK_USED);
-}
-
-/*PAGE
- *
- * _Heap_Block_size
- *
- * DESCRIPTION:
- *
- * This function returns the size of the_block in bytes.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Heap_Block_size (
- Heap_Block *the_block
-)
-{
- return (the_block->front_flag & ~HEAP_BLOCK_USED);
-}
-
-/*PAGE
- *
- * _Heap_Start_of_user_area
- *
- * DESCRIPTION:
- *
- * This function returns the starting address of the portion of the block
- * which the user may access.
- */
-
-RTEMS_INLINE_ROUTINE void *_Heap_Start_of_user_area (
- Heap_Block *the_block
-)
-{
- return (void *) &the_block->next;
-}
-
-/*PAGE
- *
- * _Heap_Is_block_in
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_block is within the memory area
- * managed by the_heap, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_block_in (
- Heap_Control *the_heap,
- Heap_Block *the_block
-)
-{
- return _Addresses_Is_in_range( the_block, the_heap->start, the_heap->final );
-}
-
-/*PAGE
- *
- * _Heap_Is_page_size_valid
- *
- * DESCRIPTION:
- *
- * This function validates a specified heap page size. If the page size
- * is 0 or if lies outside a page size alignment boundary it is invalid
- * and FALSE is returned. Otherwise, the page size is valid and TRUE is
- * returned.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Heap_Is_page_size_valid(
- unsigned32 page_size
-)
-{
- return ((page_size != 0) &&
- ((page_size % CPU_HEAP_ALIGNMENT) == 0));
-}
-
-/*PAGE
- *
- * _Heap_Build_flag
- *
- * DESCRIPTION:
- *
- * This function returns the block flag composed of size and in_use_flag.
- * The flag returned is suitable for use as a back or front flag in a
- * heap block.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Heap_Build_flag (
- unsigned32 size,
- unsigned32 in_use_flag
-)
-{
- return size | in_use_flag;
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/isr.inl b/cpukit/score/inline/rtems/score/isr.inl
deleted file mode 100644
index 6bd6e09d16..0000000000
--- a/cpukit/score/inline/rtems/score/isr.inl
+++ /dev/null
@@ -1,73 +0,0 @@
-/* isr.inl
- *
- * This include file contains the static implementation of all
- * inlined routines in the Interrupt Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __ISR_inl
-#define __ISR_inl
-
-/*PAGE
- *
- * _ISR_Is_in_progress
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the processor is currently servicing
- * and interrupt and FALSE otherwise. A return value of TRUE indicates
- * that the caller is an interrupt service routine, NOT a thread. The
- * directives available to an interrupt service routine are restricted.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ISR_Is_in_progress( void )
-{
- return (_ISR_Nest_level != 0);
-}
-
-/*PAGE
- *
- * _ISR_Is_vector_number_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the vector is a valid vector number
- * for this processor and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ISR_Is_vector_number_valid (
- unsigned32 vector
-)
-{
- return ( vector <= CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER );
-}
-
-/*PAGE
- *
- * _ISR_Is_valid_user_handler
- *
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if handler is the entry point of a valid
- * use interrupt service routine and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _ISR_Is_valid_user_handler (
- void *handler
-)
-{
- return ( handler != NULL);
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/mppkt.inl b/cpukit/score/inline/rtems/score/mppkt.inl
deleted file mode 100644
index 4be286b294..0000000000
--- a/cpukit/score/inline/rtems/score/mppkt.inl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* inline/mppkt.inl
- *
- * This package is the implementation of the Packet Handler
- * routines which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_MP_PACKET_inl
-#define __INLINE_MP_PACKET_inl
-
-/*PAGE
- *
- * _Mp_packet_Is_valid_packet_class
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the the_packet_class is valid,
- * and FALSE otherwise.
- *
- * NOTE: Check for lower bounds (MP_PACKET_CLASSES_FIRST ) is unnecessary
- * because this enum starts at lower bound of zero.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Mp_packet_Is_valid_packet_class (
- MP_packet_Classes the_packet_class
-)
-{
- return ( the_packet_class <= MP_PACKET_CLASSES_LAST );
-}
-
-/*PAGE
- *
- * _Mp_packet_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the the_packet_class is null,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Mp_packet_Is_null (
- MP_packet_Prefix *the_packet
-)
-{
- return the_packet == NULL;
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/object.inl b/cpukit/score/inline/rtems/score/object.inl
deleted file mode 100644
index 7e4d12aeec..0000000000
--- a/cpukit/score/inline/rtems/score/object.inl
+++ /dev/null
@@ -1,244 +0,0 @@
-/* object.inl
- *
- * This include file contains the static inline implementation of all
- * of the inlined routines in the Object Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OBJECTS_inl
-#define __OBJECTS_inl
-
-/*PAGE
- *
- * _Objects_Build_id
- *
- * DESCRIPTION:
- *
- * This function builds an object's id from the processor node and index
- * values specified.
- */
-
-RTEMS_INLINE_ROUTINE Objects_Id _Objects_Build_id(
- Objects_Classes the_class,
- unsigned32 node,
- unsigned32 index
-)
-{
- return ( (the_class << OBJECTS_CLASS_START_BIT) |
- (node << OBJECTS_NODE_START_BIT) |
- (index << OBJECTS_INDEX_START_BIT) );
-}
-
-/*PAGE
- *
- * _Objects_Get_class
- *
- * DESCRIPTION:
- *
- * This function returns the class portion of the ID.
- */
-
-RTEMS_INLINE_ROUTINE Objects_Classes _Objects_Get_class(
- Objects_Id id
-)
-{
- return (Objects_Classes)
- ((id >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS);
-}
-
-
-/*PAGE
- *
- * _Objects_Get_node
- *
- * DESCRIPTION:
- *
- * This function returns the node portion of the ID.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Objects_Get_node(
- Objects_Id id
-)
-{
- return (id >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS;
-}
-
-/*PAGE
- *
- * _Objects_Get_index
- *
- * DESCRIPTION:
- *
- * This function returns the index portion of the ID.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Objects_Get_index(
- Objects_Id id
-)
-{
- return (id >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS;
-}
-
-/*PAGE
- *
- * _Objects_Is_class_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the class is valid.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_Is_class_valid(
- Objects_Classes the_class
-)
-{
- return the_class && the_class <= OBJECTS_CLASSES_LAST;
-}
-
-/*PAGE
- *
- * _Objects_Is_local_node
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the node is of the local object, and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_Is_local_node(
- unsigned32 node
-)
-{
- return ( node == _Objects_Local_node );
-}
-
-/*PAGE
- *
- * _Objects_Is_local_id
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the id is of a local object, and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_Is_local_id(
- Objects_Id id
-)
-{
- return _Objects_Is_local_node( _Objects_Get_node(id) );
-}
-
-/*PAGE
- *
- * _Objects_Are_ids_equal
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if left and right are equal,
- * and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_Are_ids_equal(
- Objects_Id left,
- Objects_Id right
-)
-{
- return ( left == right );
-}
-
-/*PAGE
- *
- * _Objects_Allocate
- *
- * DESCRIPTION:
- *
- * This function allocates a object control block from
- * the inactive chain of free object control blocks.
- */
-
-RTEMS_INLINE_ROUTINE Objects_Control *_Objects_Allocate(
- Objects_Information *information
-)
-{
- return (Objects_Control *) _Chain_Get( &information->Inactive );
-}
-
-/*PAGE
- *
- * _Objects_Free
- *
- * DESCRIPTION:
- *
- * This function frees a object control block to the
- * inactive chain of free object control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Objects_Free(
- Objects_Information *information,
- Objects_Control *the_object
-)
-{
- _Chain_Append( &information->Inactive, &the_object->Node );
-}
-
-/*PAGE
- *
- * _Objects_Open
- *
- * DESCRIPTION:
- *
- * This function places the_object control pointer and object name
- * in the Local Pointer and Local Name Tables, respectively.
- */
-
-RTEMS_INLINE_ROUTINE void _Objects_Open(
- Objects_Information *information,
- Objects_Control *the_object,
- Objects_Name name
-)
-{
- unsigned32 index;
-
- index = _Objects_Get_index( the_object->id );
- information->local_table[ index ] = the_object;
-
- if ( information->is_string )
- _Objects_Copy_name_string( name, the_object->name );
- else
- _Objects_Copy_name_raw( name, the_object->name, information->name_length );
-}
-
-/*PAGE
- *
- * _Objects_Close
- *
- * DESCRIPTION:
- *
- * This function removes the_object control pointer and object name
- * in the Local Pointer and Local Name Tables.
- */
-
-RTEMS_INLINE_ROUTINE void _Objects_Close(
- Objects_Information *information,
- Objects_Control *the_object
-)
-{
- unsigned32 index;
-
- index = _Objects_Get_index( the_object->id );
- information->local_table[ index ] = (Objects_Control *) NULL;
- _Objects_Clear_name( the_object->name, information->name_length );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/objectmp.inl b/cpukit/score/inline/rtems/score/objectmp.inl
deleted file mode 100644
index f8fc62e129..0000000000
--- a/cpukit/score/inline/rtems/score/objectmp.inl
+++ /dev/null
@@ -1,73 +0,0 @@
-/* inline/objectmp.inl
- *
- * This include file contains the bodies of all inlined routines
- * which deal with global objects.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_MP_OBJECTS_inl
-#define __INLINE_MP_OBJECTS_inl
-
-/*PAGE
- *
- * _Objects_MP_Allocate_global_object
- *
- * DESCRIPTION:
- *
- * This function allocates a Global Object control block.
- */
-
-RTEMS_INLINE_ROUTINE Objects_MP_Control *_Objects_MP_Allocate_global_object (
- void
-)
-{
- return (Objects_MP_Control *)
- _Chain_Get( &_Objects_MP_Inactive_global_objects );
-}
-
-/*PAGE
- *
- * _Objects_MP_Free_global_object
- *
- * DESCRIPTION:
- *
- * This routine deallocates a Global Object control block.
- */
-
-RTEMS_INLINE_ROUTINE void _Objects_MP_Free_global_object (
- Objects_MP_Control *the_object
-)
-{
- _Chain_Append(
- &_Objects_MP_Inactive_global_objects,
- &the_object->Object.Node
- );
-}
-
-/*PAGE
- *
- * _Objects_MP_Is_null_global_object
- *
- * DESCRIPTION:
- *
- * This function returns whether the global object is NULL or not.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Objects_MP_Is_null_global_object (
- Objects_MP_Control *the_object
-)
-{
- return( the_object == NULL );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/priority.inl b/cpukit/score/inline/rtems/score/priority.inl
deleted file mode 100644
index b19d157976..0000000000
--- a/cpukit/score/inline/rtems/score/priority.inl
+++ /dev/null
@@ -1,247 +0,0 @@
-/* priority.inl
- *
- * This file contains the static inline implementation of all inlined
- * routines in the Priority Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PRIORITY_inl
-#define __PRIORITY_inl
-
-#include <rtems/score/bitfield.h>
-
-/*PAGE
- *
- * _Priority_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-RTEMS_INLINE_ROUTINE void _Priority_Handler_initialization( void )
-{
- unsigned32 index;
-
- _Priority_Major_bit_map = 0;
- for ( index=0 ; index <16 ; index++ )
- _Priority_Bit_map[ index ] = 0;
-}
-
-/*PAGE
- *
- * _Priority_Is_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_priority if valid for a
- * user task, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Priority_Is_valid (
- Priority_Control the_priority
-)
-{
- /*
- * Since PRIORITY_MINIMUM is 0 and priorities are stored unsigned,
- * then checking for less than 0 is unnecessary.
- */
-
- return ( the_priority <= PRIORITY_MAXIMUM );
-}
-
-/*PAGE
- *
- * _Priority_Major
- *
- * DESCRIPTION:
- *
- * This function returns the major portion of the_priority.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Priority_Major (
- Priority_Control the_priority
-)
-{
- return ( the_priority / 16 );
-}
-
-/*PAGE
- *
- * _Priority_Minor
- *
- * DESCRIPTION:
- *
- * This function returns the minor portion of the_priority.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Priority_Minor (
- Priority_Control the_priority
-)
-{
- return ( the_priority % 16 );
-}
-
-#if ( CPU_USE_GENERIC_BITFIELD_CODE == TRUE )
-
-/*PAGE
- *
- * _Priority_Mask
- *
- * DESCRIPTION:
- *
- * This function returns the mask associated with the major or minor
- * number passed to it.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Priority_Mask (
- unsigned32 bit_number
-)
-{
- return (0x8000 >> bit_number);
-}
-
-
-/*PAGE
- *
- * _Priority_Bits_index
- *
- * DESCRIPTION:
- *
- * This function translates the bit numbers returned by the bit scan
- * of a priority bit field into something suitable for use as
- * a major or minor component of a priority.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Priority_Bits_index (
- unsigned32 bit_number
-)
-{
- return bit_number;
-}
-
-#endif
-
-/*PAGE
- *
- * _Priority_Add_to_bit_map
- *
- * DESCRIPTION:
- *
- * This routine uses the_priority_map to update the priority
- * bit maps to indicate that a thread has been readied.
- */
-
-RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map (
- Priority_Information *the_priority_map
-)
-{
- *the_priority_map->minor |= the_priority_map->ready_minor;
- _Priority_Major_bit_map |= the_priority_map->ready_major;
-}
-
-/*PAGE
- *
- * _Priority_Remove_from_bit_map
- *
- * DESCRIPTION:
- *
- * This routine uses the_priority_map to update the priority
- * bit maps to indicate that a thread has been removed from the
- * ready state.
- */
-
-RTEMS_INLINE_ROUTINE void _Priority_Remove_from_bit_map (
- Priority_Information *the_priority_map
-)
-{
- *the_priority_map->minor &= the_priority_map->block_minor;
- if ( *the_priority_map->minor == 0 )
- _Priority_Major_bit_map &= the_priority_map->block_major;
-}
-
-/*PAGE
- *
- * _Priority_Get_highest
- *
- * DESCRIPTION:
- *
- * This function returns the priority of the highest priority
- * ready thread.
- */
-
-RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void )
-{
- Priority_Bit_map_control minor;
- Priority_Bit_map_control major;
-
- _Bitfield_Find_first_bit( _Priority_Major_bit_map, major );
- _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
-
- return (_Priority_Bits_index( major ) << 4) +
- _Priority_Bits_index( minor );
-}
-
-/*PAGE
- *
- * _Priority_Initialize_information
- *
- * DESCRIPTION:
- *
- * This routine initializes the_priority_map so that it
- * contains the information necessary to manage a thread
- * at new_priority.
- */
-
-RTEMS_INLINE_ROUTINE void _Priority_Initialize_information(
- Priority_Information *the_priority_map,
- Priority_Control new_priority
-)
-{
- Priority_Bit_map_control major;
- Priority_Bit_map_control minor;
- Priority_Bit_map_control mask;
-
- major = _Priority_Major( new_priority );
- minor = _Priority_Minor( new_priority );
-
- the_priority_map->minor =
- &_Priority_Bit_map[ _Priority_Bits_index(major) ];
-
- mask = _Priority_Mask( major );
- the_priority_map->ready_major = mask;
- the_priority_map->block_major = ~mask;
-
- mask = _Priority_Mask( minor );
- the_priority_map->ready_minor = mask;
- the_priority_map->block_minor = ~mask;
-}
-
-/*PAGE
- *
- * _Priority_Is_group_empty
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the priority GROUP is empty, and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Priority_Is_group_empty (
- Priority_Control the_priority
-)
-{
- return the_priority == 0;
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/stack.inl b/cpukit/score/inline/rtems/score/stack.inl
deleted file mode 100644
index eedd2f5ba2..0000000000
--- a/cpukit/score/inline/rtems/score/stack.inl
+++ /dev/null
@@ -1,81 +0,0 @@
-/* stack.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines from the Stack Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STACK_inl
-#define __STACK_inl
-
-/*PAGE
- *
- * _Stack_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the_stack record to indicate that
- * size bytes of memory starting at starting_address have been
- * reserved for a stack.
- */
-
-RTEMS_INLINE_ROUTINE void _Stack_Initialize (
- Stack_Control *the_stack,
- void *starting_address,
- unsigned32 size
-)
-{
- the_stack->area = starting_address;
- the_stack->size = size;
-}
-
-/*PAGE
- *
- * _Stack_Is_enough
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if size bytes is enough memory for
- * a valid stack area on this processor, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Stack_Is_enough (
- unsigned32 size
-)
-{
- return ( size >= STACK_MINIMUM_SIZE );
-}
-
-/*PAGE
- *
- * _Stack_Adjust_size
- *
- * DESCRIPTION:
- *
- * This function increases the stack size to insure that the thread
- * has the desired amount of stack space after the initial stack
- * pointer is determined based on alignment restrictions.
- *
- * NOTE:
- *
- * The amount of adjustment for alignment is CPU dependent.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Stack_Adjust_size (
- unsigned32 size
-)
-{
- return size + CPU_STACK_ALIGNMENT;
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/states.inl b/cpukit/score/inline/rtems/score/states.inl
deleted file mode 100644
index 1e67b14144..0000000000
--- a/cpukit/score/inline/rtems/score/states.inl
+++ /dev/null
@@ -1,384 +0,0 @@
-/* states.inl
- *
- * This file contains the macro implementation of the inlined
- * routines associated with thread state information.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STATES_inl
-#define __STATES_inl
-
-/*PAGE
- *
- * _States_Set
- *
- * DESCRIPTION:
- *
- * This function sets the given states_to_set into the current_state
- * passed in. The result is returned to the user in current_state.
- */
-
-RTEMS_INLINE_ROUTINE States_Control _States_Set (
- States_Control states_to_set,
- States_Control current_state
-)
-{
- return (current_state | states_to_set);
-}
-
-/*PAGE
- *
- * _States_Clear
- *
- * DESCRIPTION:
- *
- * This function clears the given states_to_clear into the current_state
- * passed in. The result is returned to the user in current_state.
- */
-
-RTEMS_INLINE_ROUTINE States_Control _States_Clear (
- States_Control states_to_clear,
- States_Control current_state
-)
-{
- return (current_state & ~states_to_clear);
-}
-
-/*PAGE
- *
- * _States_Is_ready
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_states indicates that the
- * state is READY, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_ready (
- States_Control the_states
-)
-{
- return (the_states == STATES_READY);
-}
-
-/*PAGE
- *
- * _States_Is_only_dormant
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the DORMANT state is the ONLY state
- * set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_only_dormant (
- States_Control the_states
-)
-{
- return (the_states == STATES_DORMANT);
-}
-
-/*PAGE
- *
- * _States_Is_dormant
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the DORMANT state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_dormant (
- States_Control the_states
-)
-{
- return (the_states & STATES_DORMANT);
-}
-
-/*PAGE
- *
- * _States_Is_suspended
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the SUSPENDED state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_suspended (
- States_Control the_states
-)
-{
- return (the_states & STATES_SUSPENDED);
-}
-
-/*PAGE
- *
- * _States_Is_Transient
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the TRANSIENT state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_transient (
- States_Control the_states
-)
-{
- return (the_states & STATES_TRANSIENT);
-}
-
-/*PAGE
- *
- * _States_Is_delaying
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the DELAYING state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_delaying (
- States_Control the_states
-)
-{
- return (the_states & STATES_DELAYING);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_buffer
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_BUFFER state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_buffer (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_BUFFER);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_segment
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_SEGMENT state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_segment (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_SEGMENT);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_message
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_MESSAGE state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_message (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_MESSAGE);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_event
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_EVENT state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_event (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_EVENT);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_mutex
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_MUTEX state
- * is set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_mutex (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_MUTEX);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_semaphore
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_SEMAPHORE state
- * is set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_semaphore (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_SEMAPHORE);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_time
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_TIME state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_time (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_TIME);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_rpc_reply
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_TIME state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_rpc_reply (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_RPC_REPLY);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_for_period
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the WAITING_FOR_PERIOD state is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_period (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_FOR_PERIOD);
-}
-
-/*PAGE
- *
- * _States_Is_locally_blocked
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if one of the states which indicates
- * that a task is blocked waiting for a local resource is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_locally_blocked (
- States_Control the_states
-)
-{
- return (the_states & STATES_LOCALLY_BLOCKED);
-}
-
-/*PAGE
- *
- * _States_Is_waiting_on_thread_queue
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if one of the states which indicates
- * that a task is blocked waiting for a local resource is set in
- * the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_on_thread_queue (
- States_Control the_states
-)
-{
- return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
-}
-
-/*PAGE
- *
- * _States_Is_blocked
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if one of the states which indicates
- * that a task is blocked is set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Is_blocked (
- States_Control the_states
-)
-{
- return (the_states & STATES_BLOCKED);
-}
-
-/*PAGE
- *
- *
- * _States_Are_set
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if any of the states in the mask
- * are set in the_states, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _States_Are_set (
- States_Control the_states,
- States_Control mask
-)
-{
- return ( (the_states & mask) != STATES_READY);
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/sysstate.inl b/cpukit/score/inline/rtems/score/sysstate.inl
deleted file mode 100644
index dea36d2806..0000000000
--- a/cpukit/score/inline/rtems/score/sysstate.inl
+++ /dev/null
@@ -1,154 +0,0 @@
-/* sysstates.inl
- *
- * This file contains the inline implementation of routines regarding the
- * system state.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __SYSTEM_STATE_inl
-#define __SYSTEM_STATE_inl
-
-/*PAGE
- *
- * _System_state_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the system state handler.
- */
-
-RTEMS_INLINE_ROUTINE void _System_state_Handler_initialization (
- boolean is_multiprocessing
-)
-{
- _System_state_Current = SYSTEM_STATE_BEFORE_INITIALIZATION;
- _System_state_Is_multiprocessing = is_multiprocessing;
-}
-
-/*PAGE
- *
- * _System_state_Set
- *
- * DESCRIPTION:
- *
- * This routine sets the current system state to that specified by
- * the called.
- */
-
-RTEMS_INLINE_ROUTINE void _System_state_Set (
- System_state_Codes state
-)
-{
- _System_state_Current = state;
-}
-
-/*PAGE
- *
- * _System_state_Get
- *
- * DESCRIPTION:
- *
- * This function returns the current system state.
- */
-
-RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void )
-{
- return _System_state_Current;
-}
-
-/*PAGE
- *
- * _System_state_Is_before_initialization
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "before initialization" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_before_initialization (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_BEFORE_INITIALIZATION);
-}
-
-/*PAGE
- *
- * _System_state_Is_before_multitasking
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "before multitasking" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_before_multitasking (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_BEFORE_MULTITASKING);
-}
-
-/*PAGE
- *
- * _System_state_Is_begin_multitasking
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "begin multitasking" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_begin_multitasking (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_BEGIN_MULTITASKING);
-}
-
-/*PAGE
- *
- * _System_state_Is_up
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "up" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_up (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_UP);
-}
-
-/*PAGE
- *
- * _System_state_Is_failed
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the state is equal to the
- * "failed" state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _System_state_Is_failed (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_FAILED);
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/thread.inl b/cpukit/score/inline/rtems/score/thread.inl
deleted file mode 100644
index eef4532c07..0000000000
--- a/cpukit/score/inline/rtems/score/thread.inl
+++ /dev/null
@@ -1,404 +0,0 @@
-/* thread.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Thread handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_inl
-#define __THREAD_inl
-
-/*PAGE
- *
- * _Thread_Stop_multitasking
- *
- * DESCRIPTION:
- *
- * This routine halts multitasking and returns control to
- * the "thread" (i.e. the BSP) which initially invoked the
- * routine which initialized the system.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Stop_multitasking( void )
-{
- _Context_Switch( &_Thread_Executing->Registers, &_Thread_BSP_context );
-}
-
-/*PAGE
- *
- * _Thread_Is_executing
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_thread is the currently executing
- * thread, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_executing (
- Thread_Control *the_thread
-)
-{
- return ( the_thread == _Thread_Executing );
-}
-
-/*PAGE
- *
- * _Thread_Is_heir
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_thread is the heir
- * thread, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_heir (
- Thread_Control *the_thread
-)
-{
- return ( the_thread == _Thread_Heir );
-}
-
-/*PAGE
- *
- * _Thread_Is_executing_also_the_heir
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the currently executing thread
- * is also the heir thread, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_executing_also_the_heir( void )
-{
- return ( _Thread_Executing == _Thread_Heir );
-}
-
-/*PAGE
- *
- * _Thread_Resume
- *
- * DESCRIPTION:
- *
- * This routine clears the SUSPENDED state for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Resume (
- Thread_Control *the_thread
-)
-{
- _Thread_Clear_state( the_thread, STATES_SUSPENDED );
-}
-
-/*PAGE
- *
- * _Thread_Unblock
- *
- * DESCRIPTION:
- *
- * This routine clears any blocking state for the_thread. It performs
- * any necessary scheduling operations including the selection of
- * a new heir thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Unblock (
- Thread_Control *the_thread
-)
-{
- _Thread_Clear_state( the_thread, STATES_BLOCKED );
-}
-
-/*PAGE
- *
- * _Thread_Restart_self
- *
- * DESCRIPTION:
- *
- * This routine resets the current context of the calling thread
- * to that of its initial state.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void )
-{
- if ( _Thread_Executing->fp_context != NULL )
- _Context_Restore_fp( &_Thread_Executing->fp_context );
-
- _CPU_Context_Restart_self( &_Thread_Executing->Registers );
-}
-
-/*PAGE
- *
- * _Thread_Calculate_heir
- *
- * DESCRIPTION:
- *
- * This function returns a pointer to the highest priority
- * ready thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void )
-{
- _Thread_Heir = (Thread_Control *)
- _Thread_Ready_chain[ _Priority_Get_highest() ].first;
-}
-
-/*PAGE
- *
- * _Thread_Is_allocated_fp
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the floating point context of
- * the_thread is currently loaded in the floating point unit, and
- * FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_allocated_fp (
- Thread_Control *the_thread
-)
-{
- return ( the_thread == _Thread_Allocated_fp );
-}
-
-/*PAGE
- *
- * _Thread_Deallocate_fp
- *
- * DESCRIPTION:
- *
- * This routine is invoked when the currently loaded floating
- * point context is now longer associated with an active thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void )
-{
- _Thread_Allocated_fp = NULL;
-}
-
-/*PAGE
- *
- * _Thread_Disable_dispatch
- *
- * DESCRIPTION:
- *
- * This routine prevents dispatching.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Disable_dispatch( void )
-{
- _Thread_Dispatch_disable_level += 1;
-}
-
-/*PAGE
- *
- * _Thread_Enable_dispatch
- *
- * DESCRIPTION:
- *
- * This routine allows dispatching to occur again. If this is
- * the outer most dispatching critical section, then a dispatching
- * operation will be performed and, if necessary, control of the
- * processor will be transferred to the heir thread.
- */
-
-#if ( CPU_INLINE_ENABLE_DISPATCH == TRUE )
-RTEMS_INLINE_ROUTINE void _Thread_Enable_dispatch()
-{
- if ( (--_Thread_Dispatch_disable_level) == 0 )
- _Thread_Dispatch();
-}
-#endif
-
-#if ( CPU_INLINE_ENABLE_DISPATCH == FALSE )
-void _Thread_Enable_dispatch( void );
-#endif
-
-/*PAGE
- *
- * _Thread_Unnest_dispatch
- *
- * DESCRIPTION:
- *
- * This routine allows dispatching to occur again. However,
- * no dispatching operation is performed even if this is the outer
- * most dispatching critical section.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
-{
- _Thread_Dispatch_disable_level -= 1;
-}
-
-/*PAGE
- *
- * _Thread_Is_dispatching_enabled
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if dispatching is disabled, and FALSE
- * otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_dispatching_enabled( void )
-{
- return ( _Thread_Dispatch_disable_level == 0 );
-}
-
-/*PAGE
- *
- * _Thread_Is_context_switch_necessary
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if dispatching is disabled, and FALSE
- * otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_context_switch_necessary( void )
-{
- return ( _Context_Switch_necessary );
-}
-
-/*PAGE
- *
- * _Thread_Dispatch_initialization
- *
- * DESCRIPTION:
- *
- * This routine initializes the thread dispatching subsystem.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void )
-{
- _Thread_Dispatch_disable_level = 1;
-}
-
-/*PAGE
- *
- * _Thread_Is_null
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_thread is NULL and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_null (
- Thread_Control *the_thread
-)
-{
- return ( the_thread == NULL );
-}
-
-/*PAGE
- *
- * _Thread_Get
- *
- * DESCRIPTION:
- *
- * This function maps thread IDs to thread control
- * blocks. If ID corresponds to a local thread, then it
- * returns the_thread control pointer which maps to ID
- * and location is set to OBJECTS_LOCAL. If the thread ID is
- * global and resides on a remote node, then location is set
- * to OBJECTS_REMOTE, and the_thread is undefined.
- * Otherwise, location is set to OBJECTS_ERROR and
- * the_thread is undefined.
- *
- * NOTE: XXX... This routine may be able to be optimized.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- Objects_Classes the_class;
- Objects_Information *information;
- Thread_Control *tp = (Thread_Control *) 0;
-
- if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
- _Thread_Disable_dispatch();
- *location = OBJECTS_LOCAL;
- tp = _Thread_Executing;
- goto done;
- }
-
- the_class = _Objects_Get_class( id );
-
- if ( the_class > OBJECTS_CLASSES_LAST ) {
- *location = OBJECTS_ERROR;
- goto done;
- }
-
- information = _Objects_Information_table[ the_class ];
-
- if ( !information || !information->is_thread ) {
- *location = OBJECTS_ERROR;
- goto done;
- }
-
- tp = (Thread_Control *) _Objects_Get( information, id, location );
-
-done:
- return tp;
-}
-
-
-/*
- * _Thread_Is_proxy_blocking
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the status code is equal to the
- * status which indicates that a proxy is blocking, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_Is_proxy_blocking (
- unsigned32 code
-)
-{
- return (code == THREAD_STATUS_PROXY_BLOCKING);
-}
-
-/*PAGE
- *
- * _Thread_Internal_allocate
- *
- * DESCRIPTION:
- *
- * This routine allocates an internal thread.
- */
-
-RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Internal_allocate( void )
-{
- return (Thread_Control *) _Objects_Allocate( &_Thread_Internal_information );
-}
-
-/*PAGE
- *
- * _Thread_Internal_free
- *
- * DESCRIPTION:
- *
- * This routine frees an internal thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Internal_free (
- Thread_Control *the_task
-)
-{
- _Objects_Free( &_Thread_Internal_information, &the_task->Object );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/threadmp.inl b/cpukit/score/inline/rtems/score/threadmp.inl
deleted file mode 100644
index 7a0391ff73..0000000000
--- a/cpukit/score/inline/rtems/score/threadmp.inl
+++ /dev/null
@@ -1,61 +0,0 @@
-/* inline/threadmp.inl
- *
- * This include file contains the bodies of all inlined routines
- * for the multiprocessing part of thread package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __INLINE_MP_THREAD_inl
-#define __INLINE_MP_THREAD_inl
-
-/*PAGE
- *
- * _Thread_MP_Is_receive
- *
- * DESCRIPTION:
- *
- * This function returns true if the thread in question is the
- * multiprocessing receive thread.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_MP_Is_receive (
- Thread_Control *the_thread
-)
-{
- return the_thread == _Thread_MP_Receive;
-}
-
-/*PAGE
- *
- * _Thread_MP_Free_proxy
- *
- * DESCRIPTION:
- *
- * This routine frees a proxy control block to the
- * inactive chain of free proxy control blocks.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_MP_Free_proxy (
- Thread_Control *the_thread
-)
-{
- Thread_Proxy_control *the_proxy;
-
- the_proxy = (Thread_Proxy_control *) the_thread;
-
- _Chain_Extract( &the_proxy->Active );
-
- _Chain_Append( &_Thread_MP_Inactive_proxies, &the_thread->Object.Node );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/tod.inl b/cpukit/score/inline/rtems/score/tod.inl
deleted file mode 100644
index 326d662e64..0000000000
--- a/cpukit/score/inline/rtems/score/tod.inl
+++ /dev/null
@@ -1,67 +0,0 @@
-/* tod.inl
- *
- * This file contains the static inline implementation of the inlined routines
- * from the Time of Day Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIME_OF_DAY_inl
-#define __TIME_OF_DAY_inl
-
-/*PAGE
- *
- * _TOD_Tickle_ticks
- *
- * DESCRIPTION:
- *
- * This routine increments the ticks field of the current time of
- * day at each clock tick.
- */
-
-RTEMS_INLINE_ROUTINE void _TOD_Tickle_ticks( void )
-{
- _TOD_Current.ticks += 1;
- _Watchdog_Ticks_since_boot += 1;
-}
-
-/*PAGE
- *
- * _TOD_Deactivate
- *
- * DESCRIPTION:
- *
- * This routine deactivates updating of the current time of day.
- */
-
-RTEMS_INLINE_ROUTINE void _TOD_Deactivate( void )
-{
- _Watchdog_Remove( &_TOD_Seconds_watchdog );
-}
-
-/*PAGE
- *
- * _TOD_Activate
- *
- * DESCRIPTION:
- *
- * This routine activates updating of the current time of day.
- */
-
-RTEMS_INLINE_ROUTINE void _TOD_Activate(
- Watchdog_Interval ticks
-)
-{
- _Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, ticks );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/tqdata.inl b/cpukit/score/inline/rtems/score/tqdata.inl
deleted file mode 100644
index d589933cf8..0000000000
--- a/cpukit/score/inline/rtems/score/tqdata.inl
+++ /dev/null
@@ -1,73 +0,0 @@
-/* tqdata.inl
- *
- * This file contains the static inline implementation of the inlined
- * routines needed to support the Thread Queue Data.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_QUEUE_DATA_inl
-#define __THREAD_QUEUE_DATA_inl
-
-/*PAGE
- *
- * _Thread_queue_Header_number
- *
- * DESCRIPTION:
- *
- * This function returns the index of the priority chain on which
- * a thread of the_priority should be placed.
- */
-
-RTEMS_INLINE_ROUTINE unsigned32 _Thread_queue_Header_number (
- Priority_Control the_priority
-)
-{
- return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER);
-}
-
-/*PAGE
- *
- * _Thread_queue_Is_reverse_search
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the_priority indicates that the
- * enqueue search should start at the front of this priority
- * group chain, and FALSE if the search should start at the rear.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Thread_queue_Is_reverse_search (
- Priority_Control the_priority
-)
-{
- return ( the_priority & TASK_QUEUE_DATA_REVERSE_SEARCH_MASK );
-}
-
-/*PAGE
- *
- * _Thread_queue_Enter_critical_section
- *
- * DESCRIPTION:
- *
- * This routine is invoked to indicate that the specified thread queue is
- * entering a critical section.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
- Thread_queue_Control *the_thread_queue
-)
-{
- the_thread_queue->sync_state = THREAD_QUEUE_NOTHING_HAPPENED;
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/userext.inl b/cpukit/score/inline/rtems/score/userext.inl
deleted file mode 100644
index 29f7975aaa..0000000000
--- a/cpukit/score/inline/rtems/score/userext.inl
+++ /dev/null
@@ -1,132 +0,0 @@
-/* userext.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the User Extension Handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __USER_EXTENSIONS_inl
-#define __USER_EXTENSIONS_inl
-
-#include <rtems/score/wkspace.h>
-
-/*PAGE
- *
- * _User_extensions_Handler_initialization
- *
- * DESCRIPTION:
- *
- * This routine performs the initialization necessary for this handler.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Handler_initialization (
- unsigned32 number_of_extensions,
- User_extensions_Table *initial_extensions
-)
-{
- User_extensions_Control *extension;
- unsigned32 i;
-
- _Chain_Initialize_empty( &_User_extensions_List );
-
- if ( initial_extensions ) {
- for (i=0 ; i<number_of_extensions ; i++ ) {
- extension =
- _Workspace_Allocate_or_fatal_error( sizeof(User_extensions_Control) );
-
- extension->Callouts = initial_extensions[i];
- _Chain_Append( &_User_extensions_List, &extension->Node );
- }
- }
-}
-
-/*PAGE
- *
- * _User_extensions_Add_set
- *
- * DESCRIPTION:
- *
- * This routine is used to add a user extension set to the active list.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Add_set (
- User_extensions_Control *the_extension,
- User_extensions_Table *extension_table
-)
-{
- the_extension->Callouts = *extension_table;
-
- _Chain_Append( &_User_extensions_List, &the_extension->Node );
-}
-
-/*PAGE
- *
- * _User_extensions_Add_API_set
- * DESCRIPTION:
- *
- * This routine is used to add an API extension set to the active list.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Add_API_set (
- User_extensions_Control *the_extension
-)
-{
- _Chain_Prepend( &_User_extensions_List, &the_extension->Node );
-}
-
-/*PAGE
- *
- * _User_extensions_Remove_set
- *
- * DESCRIPTION:
- *
- * This routine is used to remove a user extension set from the active list.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Remove_set (
- User_extensions_Control *the_extension
-)
-{
- _Chain_Extract( &the_extension->Node );
-}
-
-/*PAGE
- *
- * _User_extensions_Thread_switch
- *
- * DESCRIPTION:
- *
- * This routine is used to invoke the user extension which
- * is invoked when a context switch occurs.
- */
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Thread_switch (
- Thread_Control *executing,
- Thread_Control *heir
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.first ;
- !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_switch != NULL )
- (*the_extension->Callouts.thread_switch)( executing, heir );
- }
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/watchdog.inl b/cpukit/score/inline/rtems/score/watchdog.inl
deleted file mode 100644
index 9662a9abc6..0000000000
--- a/cpukit/score/inline/rtems/score/watchdog.inl
+++ /dev/null
@@ -1,324 +0,0 @@
-/* watchdog.inl
- *
- * This file contains the static inline implementation of all inlined
- * routines in the Watchdog Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WATCHDOG_inl
-#define __WATCHDOG_inl
-
-/*PAGE
- *
- * _Watchdog_Initialize
- *
- * DESCRIPTION:
- *
- * This routine initializes the specified watchdog. The watchdog is
- * made inactive, the watchdog id and handler routine are set to the
- * specified values.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Initialize(
- Watchdog_Control *the_watchdog,
- Watchdog_Service_routine_entry routine,
- Objects_Id id,
- void *user_data
-)
-{
- the_watchdog->state = WATCHDOG_INACTIVE;
- the_watchdog->routine = routine;
- the_watchdog->id = id;
- the_watchdog->user_data = user_data;
-}
-
-/*PAGE
- *
- * _Watchdog_Is_active
- *
- * DESCRIPTION:
- *
- * This routine returns TRUE if the watchdog timer is in the ACTIVE
- * state, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Watchdog_Is_active(
- Watchdog_Control *the_watchdog
-)
-{
-
- return ( the_watchdog->state == WATCHDOG_ACTIVE );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Activate
- *
- * DESCRIPTION:
- *
- * This routine activates THE_WATCHDOG timer which is already
- * on a watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Activate(
- Watchdog_Control *the_watchdog
-)
-{
-
- the_watchdog->state = WATCHDOG_ACTIVE;
-
-}
-
-/*PAGE
- *
- * _Watchdog_Deactivate
- *
- * DESCRIPTION:
- *
- * This routine deactivates THE_WATCHDOG timer which will remain
- * on a watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
- Watchdog_Control *the_watchdog
-)
-{
-
- the_watchdog->state = WATCHDOG_REMOVE_IT;
-
-}
-
-/*PAGE
- *
- * _Watchdog_Tickle_ticks
- *
- * DESCRIPTION:
- *
- * This routine is invoked at each clock tick to update the ticks
- * watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_ticks( void )
-{
-
- _Watchdog_Tickle( &_Watchdog_Ticks_chain );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Tickle_seconds
- *
- * DESCRIPTION:
- *
- * This routine is invoked at each clock tick to update the seconds
- * watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_seconds( void )
-{
-
- _Watchdog_Tickle( &_Watchdog_Seconds_chain );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Insert_ticks
- *
- * DESCRIPTION:
- *
- * This routine inserts THE_WATCHDOG into the ticks watchdog chain
- * for a time of UNITS ticks. The INSERT_MODE indicates whether
- * THE_WATCHDOG is to be activated automatically or later, explicitly
- * by the caller.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Insert_ticks(
- Watchdog_Control *the_watchdog,
- Watchdog_Interval units
-)
-{
-
- the_watchdog->initial = units;
-
- _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Insert_seconds
- *
- * DESCRIPTION:
- *
- * This routine inserts THE_WATCHDOG into the seconds watchdog chain
- * for a time of UNITS seconds. The INSERT_MODE indicates whether
- * THE_WATCHDOG is to be activated automatically or later, explicitly
- * by the caller.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Insert_seconds(
- Watchdog_Control *the_watchdog,
- Watchdog_Interval units
-)
-{
-
- the_watchdog->initial = units;
-
- _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Adjust_seconds
- *
- * DESCRIPTION:
- *
- * This routine adjusts the seconds watchdog chain in the forward
- * or backward DIRECTION for UNITS seconds. This is invoked when the
- * current time of day is changed.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Adjust_seconds(
- Watchdog_Adjust_directions direction,
- Watchdog_Interval units
-)
-{
-
- _Watchdog_Adjust( &_Watchdog_Seconds_chain, direction, units );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Adjust_ticks
- *
- * DESCRIPTION:
- *
- * This routine adjusts the ticks watchdog chain in the forward
- * or backward DIRECTION for UNITS ticks.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Adjust_ticks(
- Watchdog_Adjust_directions direction,
- Watchdog_Interval units
-)
-{
-
- _Watchdog_Adjust( &_Watchdog_Ticks_chain, direction, units );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Reset
- *
- * DESCRIPTION:
- *
- * This routine resets THE_WATCHDOG timer to its state at INSERT
- * time. This routine is valid only on interval watchdog timers
- * and is used to make an interval watchdog timer fire "every" so
- * many ticks.
- */
-
-RTEMS_INLINE_ROUTINE void _Watchdog_Reset(
- Watchdog_Control *the_watchdog
-)
-{
-
- (void) _Watchdog_Remove( the_watchdog );
-
- _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Next
- *
- * DESCRIPTION:
- *
- * This routine returns a pointer to the watchdog timer following
- * THE_WATCHDOG on the watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next(
- Watchdog_Control *the_watchdog
-)
-{
-
- return ( (Watchdog_Control *) the_watchdog->Node.next );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Previous
- *
- * DESCRIPTION:
- *
- * This routine returns a pointer to the watchdog timer preceding
- * THE_WATCHDOG on the watchdog chain.
- */
-
-RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Previous(
- Watchdog_Control *the_watchdog
-)
-{
-
- return ( (Watchdog_Control *) the_watchdog->Node.previous );
-
-}
-
-/*PAGE
- *
- * _Watchdog_First
- *
- * DESCRIPTION:
- *
- * This routine returns a pointer to the first watchdog timer
- * on the watchdog chain HEADER.
- */
-
-RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
- Chain_Control *header
-)
-{
-
- return ( (Watchdog_Control *) header->first );
-
-}
-
-/*PAGE
- *
- * _Watchdog_Last
- *
- * DESCRIPTION:
- *
- * This routine returns a pointer to the last watchdog timer
- * on the watchdog chain HEADER.
- */
-
-RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Last(
- Chain_Control *header
-)
-{
-
- return ( (Watchdog_Control *) header->last );
-
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/wkspace.inl b/cpukit/score/inline/rtems/score/wkspace.inl
deleted file mode 100644
index f92bde0f41..0000000000
--- a/cpukit/score/inline/rtems/score/wkspace.inl
+++ /dev/null
@@ -1,57 +0,0 @@
-/* wkspace.inl
- *
- * This include file contains the bodies of the routines which contains
- * information related to the RAM Workspace.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WORKSPACE_inl
-#define __WORKSPACE_inl
-
-/*PAGE
- *
- * _Workspace_Allocate
- *
- * DESCRIPTION:
- *
- * This routine returns the address of a block of memory of size
- * bytes. If a block of the appropriate size cannot be allocated
- * from the workspace, then NULL is returned.
- */
-
-RTEMS_INLINE_ROUTINE void *_Workspace_Allocate(
- unsigned32 size
-)
-{
- return _Heap_Allocate( &_Workspace_Area, size );
-}
-
-/*PAGE
- *
- * _Workspace_Free
- *
- * DESCRIPTION:
- *
- * This function frees the specified block of memory. If the block
- * belongs to the Workspace and can be successfully freed, then
- * TRUE is returned. Otherwise FALSE is returned.
- */
-
-RTEMS_INLINE_ROUTINE boolean _Workspace_Free(
- void *block
-)
-{
- return _Heap_Free( &_Workspace_Area, block );
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/README b/cpukit/score/macros/README
deleted file mode 100644
index b2f0c4d481..0000000000
--- a/cpukit/score/macros/README
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# $Id$
-#
-
-The files in this directory are not considered the "primary" source
-of inlined routines for RTEMS. The "inline" directory contains
-the implementations of the inlined basis which are regularly
-tested. In general, an effort is made to keep the contents of
-this directory up to date but testing is only performed irregularly
-and even then it is usually with a single target processor and BSP.
-
-The primary purpose of the code in this directory is to insure
-that RTEMS can be compiled using a C compiler which does not support
-static inline routines.
-
-These were last successfully tested on 2/1/95 on a prerelease version
-of 3.2.0. The testing was done only on the Force CPU386 i386 target board.
-No testing was done on version of the code in the final release.
diff --git a/cpukit/score/macros/rtems/score/README b/cpukit/score/macros/rtems/score/README
deleted file mode 100644
index b2f0c4d481..0000000000
--- a/cpukit/score/macros/rtems/score/README
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# $Id$
-#
-
-The files in this directory are not considered the "primary" source
-of inlined routines for RTEMS. The "inline" directory contains
-the implementations of the inlined basis which are regularly
-tested. In general, an effort is made to keep the contents of
-this directory up to date but testing is only performed irregularly
-and even then it is usually with a single target processor and BSP.
-
-The primary purpose of the code in this directory is to insure
-that RTEMS can be compiled using a C compiler which does not support
-static inline routines.
-
-These were last successfully tested on 2/1/95 on a prerelease version
-of 3.2.0. The testing was done only on the Force CPU386 i386 target board.
-No testing was done on version of the code in the final release.
diff --git a/cpukit/score/macros/rtems/score/address.inl b/cpukit/score/macros/rtems/score/address.inl
deleted file mode 100644
index 712809a4e7..0000000000
--- a/cpukit/score/macros/rtems/score/address.inl
+++ /dev/null
@@ -1,68 +0,0 @@
-/* macros/address.h
- *
- * This include file contains the bodies of the routines
- * about addresses which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_ADDRESSES_h
-#define __MACROS_ADDRESSES_h
-
-/*PAGE
- *
- * _Addresses_Add_offset
- *
- */
-
-#define _Addresses_Add_offset( _base, _offset ) \
- ((void *)((char *)(_base) + (_offset)))
-
-/*PAGE
- *
- * _Addresses_Subtract_offset
- *
- */
-
-#define _Addresses_Subtract_offset( _base, _offset ) \
- ((void *)((char *)(_base) - (_offset)))
-
-/*PAGE
- *
- * _Addresses_Subtract
- *
- * NOTE: The cast of an address to an unsigned32 makes this code
- * dependent on an addresses being thirty two bits.
- */
-
-#define _Addresses_Subtract( _left, _right ) \
- ((void *)(_left) - (void *)(_right))
-
-/*PAGE
- *
- * _Addresses_Is_aligned
- *
- */
-
-#define _Addresses_Is_aligned( _address ) \
- ( ( (unsigned32)(_address) % 4 ) == 0 )
-
-/*PAGE
- *
- * _Addresses_Is_in_range
- *
- */
-
-#define _Addresses_Is_in_range( _address, _base, _limit ) \
- ( (_address) >= (_base) && (_address) <= (_limit) )
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/chain.inl b/cpukit/score/macros/rtems/score/chain.inl
deleted file mode 100644
index 85ede31c12..0000000000
--- a/cpukit/score/macros/rtems/score/chain.inl
+++ /dev/null
@@ -1,200 +0,0 @@
-/* macros/chain.h
- *
- * This include file contains the bodies of the routines which are
- * associated with doubly linked chains and inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_CHAIN_h
-#define __MACROS_CHAIN_h
-
-/*PAGE
- *
- * _Chain_Are_nodes_equal
- */
-
-#define _Chain_Are_nodes_equal( _left, _right ) \
- ( (_left) == (_right) )
-
-/*PAGE
- *
- * _Chain_Is_null
- */
-
-#define _Chain_Is_null( _the_chain ) \
- ( (_the_chain) == NULL )
-
-/*PAGE
- *
- * _Chain_Is_null_node
- */
-
-#define _Chain_Is_null_node( _the_node ) \
- ( (_the_node) == NULL )
-
-/*PAGE
- *
- * _Chain_Head
- */
-
-#define _Chain_Head( _the_chain ) \
- ((Chain_Node *) (_the_chain))
-
-/*PAGE
- *
- * _Chain_Tail
- */
-
-#define _Chain_Tail( _the_chain ) \
- ((Chain_Node *) &(_the_chain)->permanent_null)
-
-/*PAGE
- *
- * _Chain_Is_empty
- */
-
-#define _Chain_Is_empty( _the_chain ) \
- ( (_the_chain)->first == _Chain_Tail( (_the_chain) ) )
-
-/*PAGE
- *
- * _Chain_Is_first
- */
-
-#define _Chain_Is_first( _the_node ) \
- ( (the_node)->previous == NULL )
-
-/*PAGE
- *
- * _Chain_Is_last
- */
-
-#define _Chain_Is_last( _the_node ) \
- ( (_the_node)->next == NULL )
-
-/*PAGE
- *
- * _Chain_Has_only_one_node
- */
-
-#define _Chain_Has_only_one_node( _the_chain ) \
- ( (_the_chain)->first == (_the_chain)->last )
-
-/*PAGE
- *
- * _Chain_Is_head
- */
-
-#define _Chain_Is_head( _the_chain, _the_node ) \
- ( (_the_node) == _Chain_Head( (_the_chain) ) )
-
-/*PAGE
- *
- * _Chain_Is_tail
- */
-
-#define _Chain_Is_tail( _the_chain, _the_node ) \
- ( (_the_node) == _Chain_Tail( (_the_chain) ) )
-
-/*PAGE
- *
- * Chain_Initialize_empty
- */
-
-#define _Chain_Initialize_empty( _the_chain ) \
-{ \
- (_the_chain)->first = _Chain_Tail( (_the_chain) ); \
- (_the_chain)->permanent_null = NULL; \
- (_the_chain)->last = _Chain_Head( (_the_chain) ); \
-}
-
-/*PAGE
- *
- * _Chain_Extract_unprotected
- */
-
-#define _Chain_Extract_unprotected( _the_node ) \
-{ \
- Chain_Node *_next; \
- Chain_Node *_previous; \
- \
- _next = (_the_node)->next; \
- _previous = (_the_node)->previous; \
- _next->previous = _previous; \
- _previous->next = _next; \
-}
-
-/*PAGE
- *
- * _Chain_Get_unprotected
- */
-
-/*PAGE
- *
- * Chain_Get_unprotected
- */
-
-#define _Chain_Get_unprotected( _the_chain ) \
- (( !_Chain_Is_empty( (_the_chain) ) ) \
- ? _Chain_Get_first_unprotected( (_the_chain) ) \
- : NULL)
-
-/*PAGE
- *
- * _Chain_Insert_unprotected
- */
-
-#define _Chain_Insert_unprotected( _after_node, _the_node ) \
-do { \
- Chain_Node *_before_node; \
- \
- (_the_node)->previous = (_after_node); \
- _before_node = (_after_node)->next; \
- (_after_node)->next = (_the_node); \
- (_the_node)->next = _before_node; \
- _before_node->previous = (_the_node); \
-} while (0)
-
-/*PAGE
- *
- * _Chain_Append_unprotected
- */
-
-#define _Chain_Append_unprotected( _the_chain, _the_node ) \
-{ \
- Chain_Node *_old_last_node; \
- \
- (_the_node)->next = _Chain_Tail( (_the_chain) ); \
- _old_last_node = (_the_chain)->last; \
- (_the_chain)->last = (_the_node); \
- _old_last_node->next = (_the_node); \
- (_the_node)->previous = _old_last_node; \
-}
-
-/*PAGE
- *
- * _Chain_Prepend_unprotected
- */
-
-#define _Chain_Prepend_unprotected( _the_chain, _the_node ) \
- _Chain_Insert_unprotected( _Chain_Head( (_the_chain) ), (_the_node) )
-
-/*PAGE
- *
- * _Chain_Prepend
- */
-
-#define _Chain_Prepend( _the_chain, _the_node ) \
- _Chain_Insert( _Chain_Head( (_the_chain) ), (_the_node) )
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/coremsg.inl b/cpukit/score/macros/rtems/score/coremsg.inl
deleted file mode 100644
index 9868c97074..0000000000
--- a/cpukit/score/macros/rtems/score/coremsg.inl
+++ /dev/null
@@ -1,143 +0,0 @@
-/* coremsg.inl
- *
- * This include file contains the macro implementation of all
- * inlined routines in the Core Message Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __CORE_MESSAGE_QUEUE_inl
-#define __CORE_MESSAGE_QUEUE_inl
-
-/*PAGE
- *
- * _CORE_message_queue_Send
- *
- */
-
-#define _CORE_message_queue_Send( _the_message_queue, _buffer, _size, \
-_id, _api_message_queue_mp_support ) \
- _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \
- (_id), (_api_message_queue_mp_support), CORE_MESSAGE_QUEUE_SEND_REQUEST )
-
-/*PAGE
- *
- * _CORE_message_queue_Urgent
- *
- */
-
-#define _CORE_message_queue_Urgent( _the_message_queue, _buffer, _size, \
-_id, _api_message_queue_mp_support ) \
- _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \
- (_id), (_api_message_queue_mp_support), CORE_MESSAGE_QUEUE_URGENT_REQUEST )
-
-/*PAGE
- *
- * _CORE_message_queue_Copy_buffer
- */
-
-#define _CORE_message_queue_Copy_buffer( _source, _destination, _size ) \
- memcpy( _destination, _source, _size)
-
-/*PAGE
- *
- * _CORE_message_queue_Allocate_message_buffer
- *
- */
-
-#define _CORE_message_queue_Allocate_message_buffer( _the_message_queue ) \
- (CORE_message_queue_Buffer_control *) \
- _Chain_Get( &(_the_message_queue)->Inactive_messages )
-
-/*PAGE
- *
- * _CORE_message_queue_Free_message_buffer
- *
- */
-
-#define _CORE_message_queue_Free_message_buffer( _the_message_queue, _the_message ) \
- _Chain_Append( \
- &(_the_message_queue)->Inactive_messages, \
- &(_the_message)->Node \
- )
-
-/*PAGE
- *
- * _CORE_message_queue_Is_priority
- *
- */
-
-#define _CORE_message_queue_Is_priority( _the_attribute ) \
- ((_the_attribute)->discipline == CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY)
-
-/*PAGE
- *
- * _CORE_message_queue_Get_pending_message
- *
- */
-
-#define _CORE_message_queue_Get_pending_message( _the_message_queue ) \
- (CORE_message_queue_Buffer_control *) \
- _Chain_Get_unprotected( &(_the_message_queue)->Pending_messages )
-
-/*PAGE
- *
- * _CORE_message_queue_Append
- *
- */
-
-#define _CORE_message_queue_Append( _the_message_queue, _the_message ) \
- _Chain_Append( &(_the_message_queue)->Pending_messages, \
- &(_the_message)->Node )
-
-/*PAGE
- *
- * _CORE_message_queue_Prepend
- *
- */
-
-#define _CORE_message_queue_Prepend( _the_message_queue, _the_message ) \
- _Chain_Prepend( &(_the_message_queue)->Pending_messages, \
- &(_the_message)->Node )
-
-/*PAGE
- *
- * _CORE_message_queue_Is_null
- *
- */
-
-#define _CORE_message_queue_Is_null( _the_message_queue ) \
- ( (_the_message_queue) == NULL )
-
-/*PAGE
- *
- * _CORE_message_queue_Is_notify_enabled
- *
- */
-
-#define _CORE_message_queue_Is_notify_enabled( _the_message_queue ) \
- ( (_the_message_queue)->notify_handler != NULL )
-
-/*PAGE
- *
- * _CORE_message_queue_Set_notify
- *
- */
-
-#define _CORE_message_queue_Set_notify( \
- _the_message_queue, _the_handler, _the_argument ) \
- do { \
- (_the_message_queue)->notify_handler = (_the_handler); \
- (_the_message_queue)->notify_argument = (_the_argument); \
- } while ( 0 )
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/coremutex.inl b/cpukit/score/macros/rtems/score/coremutex.inl
deleted file mode 100644
index 19d535dc4e..0000000000
--- a/cpukit/score/macros/rtems/score/coremutex.inl
+++ /dev/null
@@ -1,77 +0,0 @@
-/* macros/coremutex.h
- *
- * This include file contains all of the inlined routines associated
- * with core mutexes.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_CORE_MUTEX_h
-#define __MACROS_CORE_MUTEX_h
-
-
-/*PAGE
- *
- * _CORE_mutex_Is_locked
- *
- */
-
-#define _CORE_mutex_Is_locked( _the_mutex ) \
- ( (_the_mutex)->lock == CORE_MUTEX_LOCKED )
-
-/*PAGE
- *
- * _CORE_mutex_Is_fifo
- *
- */
-
-#define _CORE_mutex_Is_fifo( _the_attribute ) \
- ( (_the_attribute)->discipline == CORE_MUTEX_DISCIPLINES_FIFO )
-
-/*PAGE
- *
- * _CORE_mutex_Is_priority
- *
- */
-
-#define _CORE_mutex_Is_priority( _the_attribute ) \
- ( (_the_attribute)->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY )
-
-/*PAGE
- *
- * _CORE_mutex_Is_inherit_priority
- *
- */
-
-#define _CORE_mutex_Is_inherit_priority( _the_attribute ) \
- ( (_the_attribute)->discipline == \
- CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT )
-
-/*PAGE
- *
- * _CORE_mutex_Is_priority_ceiling
- *
- */
-
-#define _CORE_mutex_Is_priority_ceiling( _the_attribute )\
- ( (_the_attribute)->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING )
-
-/*PAGE
- *
- * _CORE_mutex_Is_nesting_allowed
- *
- */
-
-#define _CORE_mutex_Is_nesting_allowed( _the_attribute ) \
- ( (_the_attribute)->allow_nesting == TRUE )
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/coresem.inl b/cpukit/score/macros/rtems/score/coresem.inl
deleted file mode 100644
index fed9227c59..0000000000
--- a/cpukit/score/macros/rtems/score/coresem.inl
+++ /dev/null
@@ -1,40 +0,0 @@
-/* macros/coresem.h
- *
- * This include file contains all of the inlined routines associated
- * with core semaphores.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_CORE_SEMAPHORE_h
-#define __MACROS_CORE_SEMAPHORE_h
-
-/*PAGE
- *
- * _CORE_semaphore_Is_priority
- *
- */
-
-#define _CORE_semaphore_Is_priority( _the_attribute ) \
- ( (_the_attribute)->discipline == CORE_SEMAPHORE_DISCIPLINES_PRIORITY )
-
-/*PAGE
- *
- * _Core_semaphore_Get_count
- *
- */
-
-#define _Core_semaphore_Get_count( _the_semaphore ) \
- ( (_the_semaphore)->count )
-
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/heap.inl b/cpukit/score/macros/rtems/score/heap.inl
deleted file mode 100644
index d4bb8edb97..0000000000
--- a/cpukit/score/macros/rtems/score/heap.inl
+++ /dev/null
@@ -1,150 +0,0 @@
-/* heap.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the heap handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __HEAP_inl
-#define __HEAP_inl
-
-#include <rtems/score/address.h>
-
-/*PAGE
- *
- * _Heap_Head
- */
-
-#define _Heap_Head( _the_heap ) \
- ((Heap_Block *)&(_the_heap)->start)
-
-/*PAGE
- *
- * _Heap_Tail
- */
-
-#define _Heap_Tail( _the_heap ) \
- ((Heap_Block *)&(_the_heap)->final)
-
-/*PAGE
- *
- * _Heap_Previous_block
- */
-
-#define _Heap_Previous_block( _the_block ) \
- ( (Heap_Block *) _Addresses_Subtract_offset( \
- (void *)(_the_block), \
- (_the_block)->back_flag & ~ HEAP_BLOCK_USED \
- ) \
- )
-
-/*PAGE
- *
- * _Heap_Next_block
- */
-
-#define _Heap_Next_block( _the_block ) \
- ( (Heap_Block *) _Addresses_Add_offset( \
- (void *)(_the_block), \
- (_the_block)->front_flag & ~ HEAP_BLOCK_USED \
- ) \
- )
-
-/*PAGE
- *
- * _Heap_Block_at
- */
-
-#define _Heap_Block_at( _base, _offset ) \
- ( (Heap_Block *) \
- _Addresses_Add_offset( (void *)(_base), (_offset) ) )
-
-/*PAGE
- *
- * _Heap_User_block_at
- *
- */
-
-#define _Heap_User_block_at( _base ) \
- _Heap_Block_at( \
- (_base), \
- -*(((unsigned32 *) (_base)) - 1) + -HEAP_BLOCK_USED_OVERHEAD \
- )
-
-/*PAGE
- *
- * _Heap_Is_previous_block_free
- */
-
-#define _Heap_Is_previous_block_free( _the_block ) \
- ( !((_the_block)->back_flag & HEAP_BLOCK_USED) )
-
-/*PAGE
- *
- * _Heap_Is_block_free
- */
-
-#define _Heap_Is_block_free( _the_block ) \
- ( !((_the_block)->front_flag & HEAP_BLOCK_USED) )
-
-/*PAGE
- *
- * _Heap_Is_block_used
- */
-
-#define _Heap_Is_block_used( _the_block ) \
- ((_the_block)->front_flag & HEAP_BLOCK_USED)
-
-/*PAGE
- *
- * _Heap_Block_size
- */
-
-#define _Heap_Block_size( _the_block ) \
- ((_the_block)->front_flag & ~HEAP_BLOCK_USED)
-
-/*PAGE
- *
- * _Heap_Start_of_user_area
- */
-
-#define _Heap_Start_of_user_area( _the_block ) \
- ((void *) &(_the_block)->next)
-
-/*PAGE
- *
- * _Heap_Is_block_in
- */
-
-#define _Heap_Is_block_in( _the_heap, _the_block ) \
- ( ((_the_block) >= (_the_heap)->start) && \
- ((_the_block) <= (_the_heap)->final) )
-
-/*PAGE
- *
- * _Heap_Is_page_size_valid
- */
-
-#define _Heap_Is_page_size_valid( _page_size ) \
- ( ((_page_size) != 0) && \
- (((_page_size) % CPU_HEAP_ALIGNMENT) == 0) )
-
-/*PAGE
- *
- * _Heap_Build_flag
- */
-
-#define _Heap_Build_flag( _size, _in_use_flag ) \
- ( (_size) | (_in_use_flag))
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/isr.inl b/cpukit/score/macros/rtems/score/isr.inl
deleted file mode 100644
index b642c4fed2..0000000000
--- a/cpukit/score/macros/rtems/score/isr.inl
+++ /dev/null
@@ -1,48 +0,0 @@
-/* isr.inl
- *
- * This include file contains the macro implementation of all
- * inlined routines in the Interrupt Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __ISR_inl
-#define __ISR_inl
-
-/*PAGE
- *
- * _ISR_Is_in_progress
- *
- */
-
-#define _ISR_Is_in_progress() \
- (_ISR_Nest_level != 0)
-
-/*PAGE
- *
- * _ISR_Is_vector_number_valid
- *
- */
-
-#define _ISR_Is_vector_number_valid( _vector ) \
- ( (_vector) <= CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER )
-
-/*PAGE
- *
- * _ISR_Is_valid_user_handler
- *
- */
-
-#define _ISR_Is_valid_user_handler( _handler ) \
- ((_handler) != NULL)
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/mppkt.inl b/cpukit/score/macros/rtems/score/mppkt.inl
deleted file mode 100644
index b698602626..0000000000
--- a/cpukit/score/macros/rtems/score/mppkt.inl
+++ /dev/null
@@ -1,41 +0,0 @@
-/* macros/mppkt.h
- *
- * This package is the implementation of the Packet Handler
- * routines which are inlined.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_MP_PACKET_h
-#define __MACROS_MP_PACKET_h
-
-/*PAGE
- *
- * _Mp_packet_Is_valid_packet_class
- *
- * NOTE: Check for lower bounds (MP_PACKET_CLASSES_FIRST ) is unnecessary
- * because this enum starts at lower bound of zero.
- */
-
-#define _Mp_packet_Is_valid_packet_class( _the_packet_class ) \
- ( (_the_packet_class) <= MP_PACKET_CLASSES_LAST )
-
-/*PAGE
- *
- * _Mp_packet_Is_null
- *
- */
-
-#define _Mp_packet_Is_null ( _the_packet ) \
- ( (_the_packet) == NULL )
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/object.inl b/cpukit/score/macros/rtems/score/object.inl
deleted file mode 100644
index cce2cbde9b..0000000000
--- a/cpukit/score/macros/rtems/score/object.inl
+++ /dev/null
@@ -1,148 +0,0 @@
-/* object.inl
- *
- * This include file contains the macro implementation of all
- * of the inlined routines in the Object Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __OBJECTS_inl
-#define __OBJECTS_inl
-
-/*PAGE
- *
- * _Objects_Build_id
- *
- */
-
-#define _Objects_Build_id( _the_class, _node, _index ) \
- ( ((_the_class) << OBJECTS_CLASS_START_BIT) | \
- ((_node) << OBJECTS_NODE_START_BIT) | \
- ((_index) << OBJECTS_INDEX_START_BIT) )
-
-/*PAGE
- *
- * _Objects_Get_class
- */
-
-#define _Objects_Get_class( _id ) \
- (Objects_Classes) \
- (((_id) >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS)
-
-/*PAGE
- *
- * _Objects_Get_node
- *
- */
-
-#define _Objects_Get_node( _id ) \
- (((_id) >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS)
-
-/*PAGE
- *
- * _Objects_Get_index
- *
- */
-
-#define _Objects_Get_index( _id ) \
- (((_id) >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS)
-
-/*PAGE
- *
- * _Objects_Is_class_valid
- *
- */
-
-#define _Objects_Is_class_valid( _the_class ) \
- ( (_the_class) && (_the_class) <= OBJECTS_CLASSES_LAST )
-
-/*PAGE
- *
- * _Objects_Is_local_node
- *
- */
-
-#define _Objects_Is_local_node( _node ) \
- ( (_node) == _Objects_Local_node )
-
-/*PAGE
- *
- * _Objects_Is_local_id
- *
- */
-
-#define _Objects_Is_local_id( _id ) \
- _Objects_Is_local_node( _Objects_Get_node(_id) )
-
-/*PAGE
- *
- * _Objects_Are_ids_equal
- *
- */
-
-#define _Objects_Are_ids_equal( _left, _right ) \
- ( (_left) == (_right) )
-
-/*PAGE
- *
- * _Objects_Allocate
- *
- */
-
-#define _Objects_Allocate( _information ) \
- (Objects_Control *) _Chain_Get( &(_information)->Inactive )
-
-/*PAGE
- *
- * _Objects_Free
- *
- */
-
-#define _Objects_Free( _information, _the_object ) \
- _Chain_Append( &(_information)->Inactive, &(_the_object)->Node )
-
-/*PAGE
- *
- * _Objects_Open
- *
- */
-
-#define _Objects_Open( _information, _the_object, _name ) \
- { \
- unsigned32 _index; \
- \
- _index = _Objects_Get_index( (_the_object)->id ); \
- (_information)->local_table[ _index ] = (_the_object); \
- \
- if ( (_information)->is_string ) \
- _Objects_Copy_name_string( (_name), (_the_object)->name ); \
- else \
- _Objects_Copy_name_raw( \
- (_name), (_the_object)->name, (_information)->name_length ); \
- }
-
-/*PAGE
- *
- * _Objects_Close
- *
- */
-
-#define _Objects_Close( _information, _the_object ) \
- { \
- unsigned32 _index; \
- \
- _index = _Objects_Get_index( (_the_object)->id ); \
- (_information)->local_table[ _index ] = (Objects_Control *) NULL; \
- _Objects_Clear_name( (_the_object)->name, (_information)->name_length ); \
- }
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/objectmp.inl b/cpukit/score/macros/rtems/score/objectmp.inl
deleted file mode 100644
index 4593857fba..0000000000
--- a/cpukit/score/macros/rtems/score/objectmp.inl
+++ /dev/null
@@ -1,50 +0,0 @@
-/* macros/objectmp.inl
- *
- * This include file contains the bodies of all inlined routines
- * which deal with global objects.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_MP_OBJECTS_inl
-#define __MACROS_MP_OBJECTS_inl
-
-/*PAGE
- *
- * _Objects_MP_Allocate_global_object
- *
- */
-
-#define _Objects_MP_Allocate_global_object() \
- (Objects_MP_Control *) \
- _Chain_Get( &_Objects_MP_Inactive_global_objects )
-
-/*PAGE
- * _Objects_MP_Free_global_object
- *
- */
-
-#define _Objects_MP_Free_global_object( _the_object ) \
- _Chain_Append( \
- &_Objects_MP_Inactive_global_objects, \
- &(_the_object)->Object.Node \
- )
-
-/*PAGE
- * _Objects_MP_Is_null_global_object
- *
- */
-
-#define _Objects_MP_Is_null_global_object( _the_object ) \
- ( (_the_object) == NULL )
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/priority.inl b/cpukit/score/macros/rtems/score/priority.inl
deleted file mode 100644
index c588289163..0000000000
--- a/cpukit/score/macros/rtems/score/priority.inl
+++ /dev/null
@@ -1,170 +0,0 @@
-/* priority.inl
- *
- * This file contains the macro implementation of all inlined routines
- * in the Priority Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __PRIORITY_inl
-#define __PRIORITY_inl
-
-#include <rtems/score/bitfield.h>
-
-/*PAGE
- *
- * _Priority_Handler_initialization
- *
- */
-
-#define _Priority_Handler_initialization() \
- { \
- unsigned32 index; \
- \
- _Priority_Major_bit_map = 0; \
- for ( index=0 ; index <16 ; index++ ) \
- _Priority_Bit_map[ index ] = 0; \
- }
-
-/*PAGE
- *
- * _Priority_Is_valid
- *
- */
-
- /*
- * Since PRIORITY_MINIMUM is 0 and priorities are stored unsigned,
- * then checking for less than 0 is unnecessary.
- */
-
-#define _Priority_Is_valid( _the_priority ) \
- ( (_the_priority) <= PRIORITY_MAXIMUM )
-
-/*PAGE
- *
- * _Priority_Major
- *
- */
-
-#define _Priority_Major( _the_priority ) ( (_the_priority) / 16 )
-
-/*PAGE
- *
- * _Priority_Minor
- *
- */
-
-#define _Priority_Minor( _the_priority ) ( (_the_priority) % 16 )
-
-#if ( CPU_USE_GENERIC_BITFIELD_CODE == TRUE )
-
-/*PAGE
- *
- * _Priority_Mask
- *
- */
-
-#define _Priority_Mask( _bit_number ) \
- (0x8000 >> _bit_number)
-
-/*PAGE
- *
- * _Priority_Bits_index
- *
- */
-
-#define _Priority_Bits_index( _bit_number ) \
- (_bit_number)
-
-#endif
-
-/*PAGE
- *
- * _Priority_Add_to_bit_map
- *
- */
-
-#define _Priority_Add_to_bit_map( _the_priority_map ) \
- { \
- *(_the_priority_map)->minor |= (_the_priority_map)->ready_minor; \
- _Priority_Major_bit_map |= (_the_priority_map)->ready_major; \
- }
-
-/*PAGE
- *
- * _Priority_Remove_from_bit_map
- *
- */
-
-#define _Priority_Remove_from_bit_map( _the_priority_map ) \
- { \
- *(_the_priority_map)->minor &= (_the_priority_map)->block_minor; \
- if ( *(_the_priority_map)->minor == 0 ) \
- _Priority_Major_bit_map &= (_the_priority_map)->block_major; \
- }
-
-/*PAGE
- *
- * _Priority_Get_highest
- *
- */
-
-#define _Priority_Get_highest( _high_priority ) \
- { \
- Priority_Bit_map_control minor; \
- Priority_Bit_map_control major; \
- \
- _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); \
- _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); \
- \
- (_high_priority) = (_Priority_Bits_index( major ) * 16) + \
- _Priority_Bits_index( minor ); \
- }
-
-/*PAGE
- *
- * _Priority_Initialize_information
- *
- */
-
-#define _Priority_Initialize_information( \
- _the_priority_map, _new_priority ) \
- { \
- Priority_Bit_map_control _major; \
- Priority_Bit_map_control _minor; \
- Priority_Bit_map_control _mask; \
- \
- _major = _Priority_Major( (_new_priority) ); \
- _minor = _Priority_Minor( (_new_priority) ); \
- \
- (_the_priority_map)->minor = \
- &_Priority_Bit_map[ _Priority_Bits_index(_major) ]; \
- \
- _mask = _Priority_Mask( _major ); \
- (_the_priority_map)->ready_major = _mask; \
- (_the_priority_map)->block_major = ~_mask; \
- \
- _mask = _Priority_Mask( _minor ); \
- (_the_priority_map)->ready_minor = _mask; \
- (_the_priority_map)->block_minor = ~_mask; \
- }
-
-/*PAGE
- *
- * _Priority_Is_group_empty
- *
- */
-
-#define _Priority_Is_group_empty ( _the_priority ) \
- ( (_the_priority) == 0 )
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/stack.inl b/cpukit/score/macros/rtems/score/stack.inl
deleted file mode 100644
index 0e976eb0e0..0000000000
--- a/cpukit/score/macros/rtems/score/stack.inl
+++ /dev/null
@@ -1,50 +0,0 @@
-/* stack.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Stack Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STACK_inl
-#define __STACK_inl
-
-/*PAGE
- *
- * _Stack_Initialize
- *
- */
-
-#define _Stack_Initialize( _the_stack, _starting_address, _size ) \
- { \
- (_the_stack)->area = (_starting_address); \
- (_the_stack)->size = (_size); \
- }
-
-/*PAGE
- *
- * _Stack_Is_enough
- *
- */
-
-#define _Stack_Is_enough( _size ) \
- ( (_size) >= STACK_MINIMUM_SIZE )
-
-/*PAGE
- *
- * _Stack_Adjust_size
- */
-
-#define _Stack_Adjust_size( _size ) \
- ((_size) + CPU_STACK_ALIGNMENT)
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/states.inl b/cpukit/score/macros/rtems/score/states.inl
deleted file mode 100644
index a100da077a..0000000000
--- a/cpukit/score/macros/rtems/score/states.inl
+++ /dev/null
@@ -1,210 +0,0 @@
-/* states.inl
- *
- * This file contains the macro implementation of the inlined
- * routines associated with thread state information.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __STATES_inl
-#define __STATES_inl
-
-/*PAGE
- *
- * _States_Set
- *
- */
-
-#define _States_Set( _states_to_set, _current_state ) \
- ((_current_state) | (_states_to_set))
-
-/*PAGE
- *
- * _States_Clear
- *
- */
-
-#define _States_Clear( _states_to_clear, _current_state ) \
- ((_current_state) & ~(_states_to_clear))
-
-/*PAGE
- *
- * _States_Is_ready
- *
- */
-
-#define _States_Is_ready( _the_states ) \
- ( (_the_states) == STATES_READY )
-
-/*PAGE
- *
- * _States_Is_only_dormant
- *
- */
-
-#define _States_Is_only_dormant( _the_states ) \
- ( (_the_states) == STATES_DORMANT )
-
-/*PAGE
- *
- * _States_Is_dormant
- *
- */
-
-#define _States_Is_dormant( _the_states ) \
- ( (_the_states) & STATES_DORMANT )
-
-/*PAGE
- *
- * _States_Is_suspended
- *
- */
-
-#define _States_Is_suspended( _the_states ) \
- ( (_the_states) & STATES_SUSPENDED )
-
-/*PAGE
- *
- * _States_Is_Transient
- *
- */
-
-#define _States_Is_transient( _the_states ) \
- ( (_the_states) & STATES_TRANSIENT )
-
-/*PAGE
- *
- * _States_Is_delaying
- *
- */
-
-#define _States_Is_delaying( _the_states ) \
- ( (_the_states) & STATES_DELAYING )
-
-/*PAGE
- *
- * _States_Is_waiting_for_buffer
- *
- */
-
-#define _States_Is_waiting_for_buffer( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_BUFFER )
-
-/*PAGE
- *
- * _States_Is_waiting_for_segment
- *
- */
-
-#define _States_Is_waiting_for_segment( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_SEGMENT )
-
-/*PAGE
- *
- * _States_Is_waiting_for_message
- *
- */
-
-#define _States_Is_waiting_for_message( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_MESSAGE )
-
-/*PAGE
- *
- * _States_Is_waiting_for_event
- *
- */
-
-#define _States_Is_waiting_for_event( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_EVENT )
-
-/*PAGE
- *
- * _States_Is_waiting_for_mutex
- *
- */
-
-#define _States_Is_waiting_for_mutex( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_MUTEX )
-
-/*PAGE
- *
- * _States_Is_waiting_for_semaphore
- *
- */
-
-#define _States_Is_waiting_for_semaphore( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_SEMAPHORE )
-
-/*PAGE
- *
- * _States_Is_waiting_for_time
- *
- */
-
-#define _States_Is_waiting_for_time( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_TIME )
-
-/*PAGE
- *
- * _States_Is_waiting_for_rpc_reply
- *
- */
-
-#define _States_Is_waiting_for_rpc_reply( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_RPC_REPLY )
-
-/*PAGE
- *
- * _States_Is_waiting_for_period
- *
- */
-
-#define _States_Is_waiting_for_period( _the_states ) \
- ( (_the_states) & STATES_WAITING_FOR_PERIOD )
-
-/*PAGE
- *
- * _States_Is_locally_blocked
- *
- */
-
-#define _States_Is_locally_blocked( _the_states ) \
- ( (_the_states) & STATES_LOCALLY_BLOCKED )
-
-/*PAGE
- *
- * _States_Is_waiting_on_thread_queue
- *
- */
-
-#define _States_Is_waiting_on_thread_queue( _the_states ) \
- ( (_the_states) & STATES_WAITING_ON_THREAD_QUEUE )
-
-/*PAGE
- *
- * _States_Is_blocked
- *
- */
-
-#define _States_Is_blocked( _the_states ) \
- ( (_the_states) & STATES_BLOCKED )
-
-/*PAGE
- *
- * _States_Are_set
- *
- */
-
-#define _States_Are_set( _the_states, _mask ) \
- ( ((_the_states) & (_mask)) != STATES_READY )
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/sysstate.inl b/cpukit/score/macros/rtems/score/sysstate.inl
deleted file mode 100644
index 44957f6faa..0000000000
--- a/cpukit/score/macros/rtems/score/sysstate.inl
+++ /dev/null
@@ -1,90 +0,0 @@
-/* sysstates.inl
- *
- * This file contains the macro implementation of routines regarding the
- * system state.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __SYSTEM_STATE_inl
-#define __SYSTEM_STATE_inl
-
-/*PAGE
- *
- * _System_state_Handler_initialization
- */
-
-#define _System_state_Handler_initialization( _is_multiprocessing ) \
- do { \
- _System_state_Current = SYSTEM_STATE_BEFORE_INITIALIZATION; \
- _System_state_Is_multiprocessing = (_is_multiprocessing); \
- } while ( 0 )
-
-/*PAGE
- *
- * _System_state_Set
- */
-
-#define _System_state_Set( _state ) \
- do { \
- _System_state_Current = (_state); \
- } while ( 0 )
-
-/*PAGE
- *
- * _System_state_Get
- */
-
-#define _System_state_Get() \
- (_System_state_Current)
-
-/*PAGE
- *
- * _System_state_Is_before_initialization
- */
-
-#define _System_state_Is_before_initialization( _state ) \
- ((_state) == SYSTEM_STATE_BEFORE_INITIALIZATION)
-
-/*PAGE
- *
- * _System_state_Is_before_multitasking
- */
-
-#define _System_state_Is_before_multitasking( _state ) \
- ((_state) == SYSTEM_STATE_BEFORE_MULTITASKING)
-
-/*PAGE
- *
- * _System_state_Is_begin_multitasking
- */
-
-#define _System_state_Is_begin_multitasking( _state ) \
- ((_state) == SYSTEM_STATE_BEGIN_MULTITASKING)
-
-/*PAGE
- *
- * _System_state_Is_up
- */
-
-#define _System_state_Is_up( _state ) \
- ((_state) == SYSTEM_STATE_UP)
-
-/*PAGE
- *
- * _System_state_Is_failed
- */
-
-#define _System_state_Is_failed( _state ) \
- ((_state) == SYSTEM_STATE_FAILED)
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/thread.inl b/cpukit/score/macros/rtems/score/thread.inl
deleted file mode 100644
index 96761143b8..0000000000
--- a/cpukit/score/macros/rtems/score/thread.inl
+++ /dev/null
@@ -1,217 +0,0 @@
-/* thread.inl
- *
- * This file contains the macro implementation of the inlined
- * routines from the Thread handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_inl
-#define __THREAD_inl
-
-/*PAGE
- *
- * _Thread_Stop_multitasking
- *
- */
-
-#define _Thread_Stop_multitasking() \
- _Context_Switch( &_Thread_Executing->Registers, &_Thread_BSP_context );
-
-/*PAGE
- *
- * _Thread_Is_executing
- *
- */
-
-#define _Thread_Is_executing( _the_thread ) \
- ( (_the_thread) == _Thread_Executing )
-
-/*PAGE
- *
- * _Thread_Is_heir
- *
- */
-
-#define _Thread_Is_heir( _the_thread ) \
- ( (_the_thread) == _Thread_Heir )
-
-/*PAGE
- *
- * _Thread_Is_executing_also_the_heir
- *
- */
-
-#define _Thread_Is_executing_also_the_heir() \
- ( _Thread_Executing == _Thread_Heir )
-
-/*PAGE
- *
- * _Thread_Resume
- *
- */
-
-#define _Thread_Resume( _the_thread ) \
- _Thread_Clear_state( (_the_thread), STATES_SUSPENDED )
-
-/*PAGE
- *
- * _Thread_Unblock
- *
- */
-
-#define _Thread_Unblock( _the_thread ) \
- _Thread_Clear_state( (_the_thread), STATES_BLOCKED );
-
-/*PAGE
- *
- * _Thread_Restart_self
- *
- */
-
-#define _Thread_Restart_self() \
- { \
- if ( _Thread_Executing->fp_context != NULL ) \
- _Context_Restore_fp( &_Thread_Executing->fp_context ); \
- \
- _CPU_Context_Restart_self( &_Thread_Executing->Registers ); \
- }
-
-/*PAGE
- *
- * _Thread_Calculate_heir
- *
- */
-
-#define _Thread_Calculate_heir() \
- { \
- Priority_Control highest; \
- \
- _Priority_Get_highest( highest ); \
- \
- _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ highest ].first; \
- }
-
-/*PAGE
- *
- * _Thread_Is_allocated_fp
- *
- */
-
-#define _Thread_Is_allocated_fp( _the_thread ) \
- ( (_the_thread) == _Thread_Allocated_fp )
-
-/*PAGE
- *
- * _Thread_Deallocate_fp
- *
- */
-
-#define _Thread_Deallocate_fp() \
- _Thread_Allocated_fp = NULL
-
-/*PAGE
- *
- * _Thread_Disable_dispatch
- *
- */
-
-#define _Thread_Disable_dispatch() \
- _Thread_Dispatch_disable_level += 1
-
-/*PAGE
- *
- * _Thread_Enable_dispatch
- *
- */
-
-#if ( CPU_INLINE_ENABLE_DISPATCH == TRUE )
-#define _Thread_Enable_dispatch() \
- { if ( (--_Thread_Dispatch_disable_level) == 0 ) \
- _Thread_Dispatch(); \
- }
-#endif
-
-#if ( CPU_INLINE_ENABLE_DISPATCH == FALSE )
-void _Thread_Enable_dispatch( void );
-#endif
-
-/*PAGE
- *
- * _Thread_Unnest_dispatch
- *
- */
-
-#define _Thread_Unnest_dispatch() \
- _Thread_Dispatch_disable_level -= 1
-
-/*PAGE
- *
- * _Thread_Is_dispatching_enabled
- *
- */
-
-#define _Thread_Is_dispatching_enabled() \
- ( _Thread_Dispatch_disable_level == 0 )
-
-/*PAGE
- *
- * _Thread_Is_context_switch_necessary
- *
- */
-
-#define _Thread_Is_context_switch_necessary() \
- ( _Context_Switch_necessary == TRUE )
-
-/*PAGE
- *
- * _Thread_Dispatch_initialization
- *
- */
-
-#define _Thread_Dispatch_initialization() \
- _Thread_Dispatch_disable_level = 1
-
-/*PAGE
- *
- * _Thread_Is_null
- *
- */
-
-#define _Thread_Is_null( _the_thread ) \
- ( (_the_thread) == NULL )
-
-/*
- * _Thread_Is_proxy_blocking
- *
- */
-
-#define _Thread_Is_proxy_blocking( _code ) \
- ( (_code) == THREAD_STATUS_PROXY_BLOCKING )
-
-/*
- * _Thread_Internal_allocate
- *
- */
-
-#define _Thread_Internal_allocate() \
- ((Thread_Control *) _Objects_Allocate( &_Thread_Internal_information ))
-
-/*
- * _Thread_Internal_free
- *
- */
-
-#define _Thread_Internal_free( _the_task ) \
- _Objects_Free( &_Thread_Internal_information, &(_the_task)->Object )
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/threadmp.inl b/cpukit/score/macros/rtems/score/threadmp.inl
deleted file mode 100644
index c9cc91319f..0000000000
--- a/cpukit/score/macros/rtems/score/threadmp.inl
+++ /dev/null
@@ -1,50 +0,0 @@
-/* macros/threadmp.h
- *
- * This include file contains the bodies of all inlined routines
- * for the multiprocessing part of thread package.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __MACROS_MP_THREAD_h
-#define __MACROS_MP_THREAD_h
-
-/*PAGE
- *
- * _Thread_MP_Is_receive
- *
- */
-
-#define _Thread_MP_Is_receive( _the_thread ) \
- ( (_the_thread) == _Thread_MP_Receive)
-
-/*PAGE
- *
- * _Thread_MP_Free_proxy
- *
- */
-
-#define _Thread_MP_Free_proxy( _the_thread ) \
-{ \
- Thread_Proxy_control *_the_proxy; \
- \
- _the_proxy = (Thread_Proxy_control *) (_the_thread); \
- \
- _Chain_Extract( &_the_proxy->Active ); \
- \
- _Chain_Append( \
- &_Thread_MP_Inactive_proxies, \
- &(_the_thread)->Object.Node \
- ); \
-}
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/tod.inl b/cpukit/score/macros/rtems/score/tod.inl
deleted file mode 100644
index 85603550ee..0000000000
--- a/cpukit/score/macros/rtems/score/tod.inl
+++ /dev/null
@@ -1,49 +0,0 @@
-/* tod.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the Time of Day Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __TIME_OF_DAY_inl
-#define __TIME_OF_DAY_inl
-
-/*PAGE
- *
- * _TOD_Tickle_ticks
- *
- */
-
-#define _TOD_Tickle_ticks() \
- _TOD_Current.ticks++; \
- _Watchdog_Ticks_since_boot++
-
-/*PAGE
- *
- * _TOD_Deactivate
- *
- */
-
-#define _TOD_Deactivate() \
- _Watchdog_Remove( &_TOD_Seconds_watchdog )
-
-/*PAGE
- *
- * _TOD_Activate
- *
- */
-
-#define _TOD_Activate( _ticks ) \
- _Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, (_ticks) )
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/tqdata.inl b/cpukit/score/macros/rtems/score/tqdata.inl
deleted file mode 100644
index 0749e612d6..0000000000
--- a/cpukit/score/macros/rtems/score/tqdata.inl
+++ /dev/null
@@ -1,50 +0,0 @@
-/* tqdata.inl
- *
- * This file contains the macro implementation of the inlined
- * routines needed to support the Thread Queue Data.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __THREAD_QUEUE_DATA_inl
-#define __THREAD_QUEUE_DATA_inl
-
-/*PAGE
- *
- * _Thread_queue_Header_number
- *
- */
-
-#define _Thread_queue_Header_number( _the_priority ) \
- ((_the_priority) / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER)
-
-/*PAGE
- *
- * _Thread_queue_Is_reverse_search
- *
- */
-
-#define _Thread_queue_Is_reverse_search( _the_priority ) \
- ( (_the_priority) & TASK_QUEUE_DATA_REVERSE_SEARCH_MASK )
-
-/*PAGE
- *
- * _Thread_queue_Enter_critical_section
- *
- */
-
-#define _Thread_queue_Enter_critical_section( _the_thread_queue ) \
- do { \
- (_the_thread_queue)->sync_state = THREAD_QUEUE_NOTHING_HAPPENED; \
- } while ( 0 )
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/userext.inl b/cpukit/score/macros/rtems/score/userext.inl
deleted file mode 100644
index 37b0bf8d2a..0000000000
--- a/cpukit/score/macros/rtems/score/userext.inl
+++ /dev/null
@@ -1,126 +0,0 @@
-/* userext.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the User Extension Handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __USER_EXTENSIONS_inl
-#define __USER_EXTENSIONS_inl
-
-/*PAGE
- *
- * _User_extensions_Handler_initialization
- *
- */
-
-#define _User_extensions_Handler_initialization( _initial_extensions ) \
- { \
- _Chain_Initialize_empty( &_User_extensions_List ); \
- \
- if ( (_initial_extensions) ) { \
- _User_extensions_Initial.Callouts = *(_initial_extensions); \
- _Chain_Append( \
- &_User_extensions_List, &_User_extensions_Initial.Node ); \
- } \
- }
-
-/*PAGE
- *
- * _User_extensions_Add_set
- */
-
-#define _User_extensions_Add_set( _the_extension, _extension_table ) \
- do { \
- (_the_extension)->Callouts = *(_extension_table); \
- \
- _Chain_Append( &_User_extensions_List, &(_the_extension)->Node ); \
- } while ( 0 )
-
-/*PAGE
- *
- * _User_extensions_Add_API_set
- */
-
-#define _User_extensions_Add_API_set( _the_extension ) \
- _Chain_Prepend( &_User_extensions_List, &(_the_extension)->Node )
-
-
-/*PAGE
- *
- * _User_extensions_Remove_set
- */
-
-#define _User_extensions_Remove_set( _the_extension ) \
- _Chain_Extract( &(_the_extension)->Node )
-
-/*PAGE
- *
- * _User_extensions_Run_list_forward
- *
- * NOTE: No parentheses around macro names here to avoid
- * messing up the name and function call expansion.
- */
-
-#define _User_extensions_Run_list_forward( _name, _arguments ) \
- do { \
- Chain_Node *the_node; \
- User_extensions_Control *the_extension; \
- \
- for ( the_node = _User_extensions_List.first ; \
- !_Chain_Is_tail( &_User_extensions_List, the_node ) ; \
- the_node = the_node->next ) { \
- the_extension = (User_extensions_Control *) the_node; \
- \
- if ( the_extension->Callouts.## _name != NULL ) \
- (*the_extension->Callouts.## _name) _arguments; \
- \
- } \
- \
- } while ( 0 )
-
-/*PAGE
- *
- * _User_extensions_Run_list_backward
- *
- * NOTE: No parentheses around macro names here to avoid
- * messing up the name and function call expansion.
- */
-
-#define _User_extensions_Run_list_backward( _name, _arguments ) \
- do { \
- Chain_Node *the_node; \
- User_extensions_Control *the_extension; \
- \
- for ( the_node = _User_extensions_List.last ; \
- !_Chain_Is_head( &_User_extensions_List, the_node ) ; \
- the_node = the_node->previous ) { \
- the_extension = (User_extensions_Control *) the_node; \
- \
- if ( the_extension->Callouts.## _name != NULL ) \
- (*the_extension->Callouts.## _name) _arguments; \
- \
- } \
- \
- } while ( 0 )
-
-/*PAGE
- *
- * _User_extensions_Thread_switch
- *
- */
-
-#define _User_extensions_Thread_switch( _executing, _heir ) \
- _User_extensions_Run_list_forward(thread_switch, (_executing, _heir) )
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/watchdog.inl b/cpukit/score/macros/rtems/score/watchdog.inl
deleted file mode 100644
index fecc20e4f1..0000000000
--- a/cpukit/score/macros/rtems/score/watchdog.inl
+++ /dev/null
@@ -1,172 +0,0 @@
-/* watchdog.inl
- *
- * This file contains the macro implementation of all inlined routines
- * in the Watchdog Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WATCHDOG_inl
-#define __WATCHDOG_inl
-
-#include <rtems/score/object.h>
-
-/*PAGE
- *
- * _Watchdog_Initialize
- *
- */
-
-#define _Watchdog_Initialize( _the_watchdog, _routine, _id, _user_data ) \
- { \
- (_the_watchdog)->state = WATCHDOG_INACTIVE; \
- (_the_watchdog)->routine = (_routine); \
- (_the_watchdog)->id = (_id); \
- (_the_watchdog)->user_data = (_user_data); \
- }
-
-/*PAGE
- *
- * _Watchdog_Is_active
- *
- */
-
-#define _Watchdog_Is_active( _the_watchdog ) \
- ( (_the_watchdog)->state == WATCHDOG_ACTIVE )
-
-/*PAGE
- *
- * _Watchdog_Activate
- *
- */
-
-#define _Watchdog_Activate( _the_watchdog ) \
- (_the_watchdog)->state = WATCHDOG_ACTIVE
-
-/*PAGE
- *
- * _Watchdog_Deactivate
- *
- */
-
-#define _Watchdog_Deactivate( _the_watchdog ) \
- (_the_watchdog)->state = WATCHDOG_REMOVE_IT
-
-/*PAGE
- *
- * _Watchdog_Tickle_ticks
- *
- */
-
-#define _Watchdog_Tickle_ticks() \
- _Watchdog_Tickle( &_Watchdog_Ticks_chain )
-
-/*PAGE
- *
- * _Watchdog_Tickle_seconds
- *
- */
-
-#define _Watchdog_Tickle_seconds() \
- _Watchdog_Tickle( &_Watchdog_Seconds_chain )
-
-/*PAGE
- *
- * _Watchdog_Insert_ticks
- *
- */
-
-#define _Watchdog_Insert_ticks( _the_watchdog, _units ) \
- do { \
- (_the_watchdog)->initial = (_units); \
- _Watchdog_Insert( &_Watchdog_Ticks_chain, (_the_watchdog) ); \
- } while ( 0 )
-
-/*PAGE
- *
- * _Watchdog_Insert_seconds
- *
- */
-
-#define _Watchdog_Insert_seconds( _the_watchdog, _units ) \
- do { \
- (_the_watchdog)->initial = (_units); \
- _Watchdog_Insert( &_Watchdog_Seconds_chain, (_the_watchdog) ); \
- } while ( 0 )
-
-/*PAGE
- *
- * _Watchdog_Adjust_seconds
- *
- */
-
-#define _Watchdog_Adjust_seconds( _direction, _units ) \
- _Watchdog_Adjust( &_Watchdog_Seconds_chain, (_direction), (_units) )
-
-/*PAGE
- *
- * _Watchdog_Adjust_ticks
- *
- */
-
-#define _Watchdog_Adjust_ticks( _direction, _units ) \
- _Watchdog_Adjust( &_Watchdog_Ticks_chain, (_direction), (_units) )
-
-/*PAGE
- *
- * _Watchdog_Reset
- *
- */
-
-#define _Watchdog_Reset( _the_watchdog ) \
- { \
- (void) _Watchdog_Remove( (_the_watchdog) ); \
- _Watchdog_Insert( &_Watchdog_Ticks_chain, (_the_watchdog) ); \
- }
-
-/*PAGE
- *
- * _Watchdog_Next
- *
- */
-
-#define _Watchdog_Next( _watchdog ) \
- ((Watchdog_Control *) (_watchdog)->Node.next)
-
-/*PAGE
- *
- * _Watchdog_Previous
- *
- */
-
-#define _Watchdog_Previous( _watchdog ) \
- ((Watchdog_Control *) (_watchdog)->Node.previous)
-
-/*PAGE
- *
- * _Watchdog_First
- *
- */
-
-#define _Watchdog_First( _header ) \
- ((Watchdog_Control *) (_header)->first)
-
-/*PAGE
- *
- * _Watchdog_Last
- *
- */
-
-#define _Watchdog_Last( _header ) \
- ((Watchdog_Control *) (_header)->last)
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/wkspace.inl b/cpukit/score/macros/rtems/score/wkspace.inl
deleted file mode 100644
index 525756db6b..0000000000
--- a/cpukit/score/macros/rtems/score/wkspace.inl
+++ /dev/null
@@ -1,39 +0,0 @@
-/* wkspace.inl
- *
- * This file contains the macro implementation of the inlined routines
- * from the RAM Workspace Handler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 __WORKSPACE_inl
-#define __WORKSPACE_inl
-
-/*PAGE
- *
- * _Workspace_Allocate
- *
- */
-
-#define _Workspace_Allocate( _size ) \
- _Heap_Allocate( &_Workspace_Area, (_size) )
-
-/*PAGE
- *
- * _Workspace_Free
- *
- */
-
-#define _Workspace_Free( _block ) \
- _Heap_Free( &_Workspace_Area, (_block) )
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/src/apiext.c b/cpukit/score/src/apiext.c
deleted file mode 100644
index 2fb2155558..0000000000
--- a/cpukit/score/src/apiext.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* apiext.c
- *
- * XXX
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/apiext.h>
-
-/*PAGE
- *
- * _API_extensions_Initialization
- */
-
-void _API_extensions_Initialization( void )
-{
- _Chain_Initialize_empty( &_API_extensions_List );
-}
-
-/*PAGE
- *
- * _API_extensions_Add
- */
-
-void _API_extensions_Add(
- API_extensions_Control *the_extension
-)
-{
- _Chain_Append( &_API_extensions_List, &the_extension->Node );
-}
-
-/*PAGE
- *
- * _API_extensions_Run_predriver
- */
-
-void _API_extensions_Run_predriver( void )
-{
- Chain_Node *the_node;
- API_extensions_Control *the_extension;
-
- for ( the_node = _API_extensions_List.first ;
- !_Chain_Is_tail( &_API_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (API_extensions_Control *) the_node;
-
- if ( the_extension->predriver_hook )
- (*the_extension->predriver_hook)();
- }
-}
-
-/*PAGE
- *
- * _API_extensions_Run_postdriver
- */
-
-void _API_extensions_Run_postdriver( void )
-{
- Chain_Node *the_node;
- API_extensions_Control *the_extension;
-
- for ( the_node = _API_extensions_List.first ;
- !_Chain_Is_tail( &_API_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (API_extensions_Control *) the_node;
-
- if ( the_extension->postdriver_hook )
- (*the_extension->postdriver_hook)();
- }
-}
-
-/*PAGE
- *
- * _API_extensions_Run_postswitch
- */
-
-void _API_extensions_Run_postswitch( void )
-{
- Chain_Node *the_node;
- API_extensions_Control *the_extension;
-
- for ( the_node = _API_extensions_List.first ;
- !_Chain_Is_tail( &_API_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (API_extensions_Control *) the_node;
-
- if ( the_extension->postswitch_hook )
- (*the_extension->postswitch_hook)( _Thread_Executing );
- }
-}
-
-/* end of file */
diff --git a/cpukit/score/src/chain.c b/cpukit/score/src/chain.c
deleted file mode 100644
index 690141d3ee..0000000000
--- a/cpukit/score/src/chain.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Chain Handler
- *
- * NOTE:
- *
- * The order of this file is to allow proper compilation due to the
- * order of inlining required by the compiler.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/address.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/isr.h>
-
-/*PAGE
- *
- * _Chain_Initialize
- *
- * This kernel routine initializes a doubly linked chain.
- *
- * Input parameters:
- * the_chain - pointer to chain header
- * starting_address - starting address of first node
- * number_nodes - number of nodes in chain
- * node_size - size of node in bytes
- *
- * Output parameters: NONE
- */
-
-void _Chain_Initialize(
- Chain_Control *the_chain,
- void *starting_address,
- unsigned32 number_nodes,
- unsigned32 node_size
-)
-{
- unsigned32 count;
- Chain_Node *current;
- Chain_Node *next;
-
- count = number_nodes;
- current = _Chain_Head( the_chain );
- the_chain->permanent_null = NULL;
- next = (Chain_Node *)starting_address;
- while ( count-- ) {
- current->next = next;
- next->previous = current;
- current = next;
- next = (Chain_Node *)
- _Addresses_Add_offset( (void *) next, node_size );
- }
- current->next = _Chain_Tail( the_chain );
- the_chain->last = current;
-}
-
-/*PAGE
- *
- * _Chain_Get_first_unprotected
- */
-
-#ifndef USE_INLINES
-Chain_Node *_Chain_Get_first_unprotected(
- Chain_Control *the_chain
-)
-{
- Chain_Node *return_node;
- Chain_Node *new_first;
-
- return_node = the_chain->first;
- new_first = return_node->next;
- the_chain->first = new_first;
- new_first->previous = _Chain_Head( the_chain );
-
- return return_node;
-}
-#endif /* USE_INLINES */
-
-/*PAGE
- *
- * _Chain_Get
- *
- * This kernel routine returns a pointer to a node taken from the
- * given chain.
- *
- * Input parameters:
- * the_chain - pointer to chain header
- *
- * Output parameters:
- * return_node - pointer to node in chain allocated
- * CHAIN_END - if no nodes available
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-Chain_Node *_Chain_Get(
- Chain_Control *the_chain
-)
-{
- ISR_Level level;
- Chain_Node *return_node;
-
- return_node = NULL;
- _ISR_Disable( level );
- if ( !_Chain_Is_empty( the_chain ) )
- return_node = _Chain_Get_first_unprotected( the_chain );
- _ISR_Enable( level );
- return return_node;
-}
-
-/*PAGE
- *
- * _Chain_Append
- *
- * This kernel routine puts a node on the end of the specified chain.
- *
- * Input parameters:
- * the_chain - pointer to chain header
- * node - address of node to put at rear of chain
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-void _Chain_Append(
- Chain_Control *the_chain,
- Chain_Node *node
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
- _Chain_Append_unprotected( the_chain, node );
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Chain_Extract
- *
- * This kernel routine deletes the given node from a chain.
- *
- * Input parameters:
- * node - pointer to node in chain to be deleted
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-void _Chain_Extract(
- Chain_Node *node
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
- _Chain_Extract_unprotected( node );
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Chain_Insert
- *
- * This kernel routine inserts a given node after a specified node
- * a requested chain.
- *
- * Input parameters:
- * after_node - pointer to node in chain to be inserted after
- * node - pointer to node to be inserted
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-void _Chain_Insert(
- Chain_Node *after_node,
- Chain_Node *node
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
- _Chain_Insert_unprotected( after_node, node );
- _ISR_Enable( level );
-}
diff --git a/cpukit/score/src/coremsg.c b/cpukit/score/src/coremsg.c
deleted file mode 100644
index 34778d26cd..0000000000
--- a/cpukit/score/src/coremsg.c
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * CORE Message Queue Handler
- *
- * DESCRIPTION:
- *
- * This package is the implementation of the CORE Message Queue Handler.
- * This core object provides task synchronization and communication functions
- * via messages passed to queue objects.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/score/coremsg.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/mpci.h>
-
-/*PAGE
- *
- * _CORE_message_queue_Initialize
- *
- * This routine initializes a newly created message queue based on the
- * specified data.
- *
- * Input parameters:
- * the_message_queue - the message queue to initialize
- * the_class - the API specific object class
- * the_message_queue_attributes - the message queue's attributes
- * maximum_pending_messages - maximum message and reserved buffer count
- * maximum_message_size - maximum size of each message
- * proxy_extract_callout - remote extract support
- *
- * Output parameters:
- * TRUE - if the message queue is initialized
- * FALSE - if the message queue is NOT initialized
- */
-
-boolean _CORE_message_queue_Initialize(
- CORE_message_queue_Control *the_message_queue,
- Objects_Classes the_class,
- CORE_message_queue_Attributes *the_message_queue_attributes,
- unsigned32 maximum_pending_messages,
- unsigned32 maximum_message_size,
- Thread_queue_Extract_callout proxy_extract_callout
-)
-{
- unsigned32 message_buffering_required;
- unsigned32 allocated_message_size;
-
- the_message_queue->maximum_pending_messages = maximum_pending_messages;
- the_message_queue->number_of_pending_messages = 0;
- the_message_queue->maximum_message_size = maximum_message_size;
- _CORE_message_queue_Set_notify( the_message_queue, NULL, NULL );
-
- /*
- * round size up to multiple of a ptr for chain init
- */
-
- allocated_message_size = maximum_message_size;
- if (allocated_message_size & (sizeof(unsigned32) - 1)) {
- allocated_message_size += sizeof(unsigned32);
- allocated_message_size &= ~(sizeof(unsigned32) - 1);
- }
-
- message_buffering_required = maximum_pending_messages *
- (allocated_message_size + sizeof(CORE_message_queue_Buffer_control));
-
- the_message_queue->message_buffers = (CORE_message_queue_Buffer *)
- _Workspace_Allocate( message_buffering_required );
-
- if (the_message_queue->message_buffers == 0)
- return FALSE;
-
- _Chain_Initialize (
- &the_message_queue->Inactive_messages,
- the_message_queue->message_buffers,
- maximum_pending_messages,
- allocated_message_size + sizeof( CORE_message_queue_Buffer_control )
- );
-
- _Chain_Initialize_empty( &the_message_queue->Pending_messages );
-
- _Thread_queue_Initialize(
- &the_message_queue->Wait_queue,
- the_class,
- _CORE_message_queue_Is_priority( the_message_queue_attributes ) ?
- THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_MESSAGE,
- proxy_extract_callout,
- CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
- );
-
- return TRUE;
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Close
- *
- * This function closes a message by returning all allocated space and
- * flushing the message_queue's task wait queue.
- *
- * Input parameters:
- * the_message_queue - the message_queue to be flushed
- * remote_extract_callout - function to invoke remotely
- * status - status to pass to thread
- *
- * Output parameters: NONE
- */
-
-void _CORE_message_queue_Close(
- CORE_message_queue_Control *the_message_queue,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-)
-{
-
- if ( the_message_queue->number_of_pending_messages != 0 )
- (void) _CORE_message_queue_Flush_support( the_message_queue );
- else
- _Thread_queue_Flush(
- &the_message_queue->Wait_queue,
- remote_extract_callout,
- status
- );
-
- (void) _Workspace_Free( the_message_queue->message_buffers );
-
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Flush
- *
- * This function flushes the message_queue's task wait queue. The number
- * of messages flushed from the queue is returned.
- *
- * Input parameters:
- * the_message_queue - the message_queue to be flushed
- *
- * Output parameters:
- * returns - the number of messages flushed from the queue
- */
-
-unsigned32 _CORE_message_queue_Flush(
- CORE_message_queue_Control *the_message_queue
-)
-{
- if ( the_message_queue->number_of_pending_messages != 0 )
- return _CORE_message_queue_Flush_support( the_message_queue );
- else
- return 0;
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Broadcast
- *
- * This function sends a message for every thread waiting on the queue and
- * returns the number of threads made ready by the message.
- *
- * Input parameters:
- * the_message_queue - message is submitted to this message queue
- * buffer - pointer to message buffer
- * size - size in bytes of message to send
- * id - id of message queue
- * api_message_queue_mp_support - api specific mp support callout
- * count - area to store number of threads made ready
- *
- * Output parameters:
- * count - number of threads made ready
- * CORE_MESSAGE_QUEUE_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-CORE_message_queue_Status _CORE_message_queue_Broadcast(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support,
- unsigned32 *count
-)
-{
- Thread_Control *the_thread;
- unsigned32 number_broadcasted;
- Thread_Wait_information *waitp;
- unsigned32 constrained_size;
-
- number_broadcasted = 0;
- while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) {
- waitp = &the_thread->Wait;
- number_broadcasted += 1;
-
- constrained_size = size;
- if ( size > the_message_queue->maximum_message_size )
- constrained_size = the_message_queue->maximum_message_size;
-
- _CORE_message_queue_Copy_buffer(
- buffer,
- waitp->return_argument,
- constrained_size
- );
-
- *(unsigned32 *)the_thread->Wait.return_argument_1 = size;
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- (*api_message_queue_mp_support) ( the_thread, id );
-
- }
- *count = number_broadcasted;
- return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Seize
- *
- * This kernel routine dequeues a message, copies the message buffer to
- * a given destination buffer, and frees the message buffer to the
- * inactive message pool. The thread will be blocked if wait is TRUE,
- * otherwise an error will be given to the thread if no messages are available.
- *
- * Input parameters:
- * the_message_queue - pointer to message queue
- * id - id of object we are waitig on
- * buffer - pointer to message buffer to be filled
- * size - pointer to the size of buffer to be filled
- * wait - TRUE if wait is allowed, FALSE otherwise
- * timeout - time to wait for a message
- *
- * Output parameters: NONE
- *
- * NOTE: Dependent on BUFFER_LENGTH
- *
- * INTERRUPT LATENCY:
- * available
- * wait
- */
-
-void _CORE_message_queue_Seize(
- CORE_message_queue_Control *the_message_queue,
- Objects_Id id,
- void *buffer,
- unsigned32 *size,
- boolean wait,
- Watchdog_Interval timeout
-)
-{
- ISR_Level level;
- CORE_message_queue_Buffer_control *the_message;
- Thread_Control *executing;
-
- executing = _Thread_Executing;
- executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
- _ISR_Disable( level );
- if ( the_message_queue->number_of_pending_messages != 0 ) {
- the_message_queue->number_of_pending_messages -= 1;
-
- the_message = _CORE_message_queue_Get_pending_message( the_message_queue );
- _ISR_Enable( level );
- *size = the_message->Contents.size;
- _CORE_message_queue_Copy_buffer(the_message->Contents.buffer,buffer,*size );
- _CORE_message_queue_Free_message_buffer(the_message_queue, the_message );
- return;
- }
-
- if ( !wait ) {
- _ISR_Enable( level );
- executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT;
- return;
- }
-
- _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue );
- executing->Wait.queue = &the_message_queue->Wait_queue;
- executing->Wait.id = id;
- executing->Wait.return_argument = (void *)buffer;
- executing->Wait.return_argument_1 = (void *)size;
- _ISR_Enable( level );
-
- _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Flush_support
- *
- * This message handler routine removes all messages from a message queue
- * and returns them to the inactive message pool. The number of messages
- * flushed from the queue is returned
- *
- * Input parameters:
- * the_message_queue - pointer to message queue
- *
- * Output parameters:
- * returns - number of messages placed on inactive chain
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-unsigned32 _CORE_message_queue_Flush_support(
- CORE_message_queue_Control *the_message_queue
-)
-{
- ISR_Level level;
- Chain_Node *inactive_first;
- Chain_Node *message_queue_first;
- Chain_Node *message_queue_last;
- unsigned32 count;
-
- _ISR_Disable( level );
- inactive_first = the_message_queue->Inactive_messages.first;
- message_queue_first = the_message_queue->Pending_messages.first;
- message_queue_last = the_message_queue->Pending_messages.last;
-
- the_message_queue->Inactive_messages.first = message_queue_first;
- message_queue_last->next = inactive_first;
- inactive_first->previous = message_queue_last;
- message_queue_first->previous =
- _Chain_Head( &the_message_queue->Inactive_messages );
-
- _Chain_Initialize_empty( &the_message_queue->Pending_messages );
-
- count = the_message_queue->number_of_pending_messages;
- the_message_queue->number_of_pending_messages = 0;
- _ISR_Enable( level );
- return count;
-}
-
-/*PAGE
- *
- * _CORE_message_queue_Submit
- *
- * This routine implements the send and urgent message functions. It
- * processes a message that is to be submitted to the designated
- * message queue. The message will either be processed as a
- * send message which it will be inserted at the rear of the queue
- * or it will be processed as an urgent message which will be inserted
- * at the front of the queue.
- *
- * Input parameters:
- * the_message_queue - message is submitted to this message queue
- * buffer - pointer to message buffer
- * size - size in bytes of message to send
- * id - id of message queue
- * api_message_queue_mp_support - api specific mp support callout
- * submit_type - send or urgent message
- *
- * Output parameters:
- * CORE_MESSAGE_QUEUE_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-CORE_message_queue_Status _CORE_message_queue_Submit(
- CORE_message_queue_Control *the_message_queue,
- void *buffer,
- unsigned32 size,
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support,
- CORE_message_queue_Submit_types submit_type
-)
-{
- CORE_message_queue_Buffer_control *the_message;
- Thread_Control *the_thread;
-
- if ( size > the_message_queue->maximum_message_size )
- return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE;
-
- /*
- * Is there a thread currently waiting on this message queue?
- */
-
- the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue );
- if ( the_thread )
- {
- _CORE_message_queue_Copy_buffer(
- buffer,
- the_thread->Wait.return_argument,
- size
- );
- *(unsigned32 *)the_thread->Wait.return_argument_1 = size;
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- (*api_message_queue_mp_support) ( the_thread, id );
-
- return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
- }
-
- /*
- * No one waiting on this one currently.
- * Allocate a message buffer and store it away
- */
-
- if ( the_message_queue->number_of_pending_messages ==
- the_message_queue->maximum_pending_messages ) {
- return CORE_MESSAGE_QUEUE_STATUS_TOO_MANY;
- }
-
- the_message = _CORE_message_queue_Allocate_message_buffer(the_message_queue);
- if ( the_message == 0)
- return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED;
-
- _CORE_message_queue_Copy_buffer( buffer, the_message->Contents.buffer, size );
- the_message->Contents.size = size;
-
- the_message_queue->number_of_pending_messages += 1;
-
- switch ( submit_type ) {
- case CORE_MESSAGE_QUEUE_SEND_REQUEST:
- _CORE_message_queue_Append( the_message_queue, the_message );
- break;
- case CORE_MESSAGE_QUEUE_URGENT_REQUEST:
- _CORE_message_queue_Prepend( the_message_queue, the_message );
- break;
- }
-
- return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
-}
diff --git a/cpukit/score/src/coremutex.c b/cpukit/score/src/coremutex.c
deleted file mode 100644
index dac5a5172b..0000000000
--- a/cpukit/score/src/coremutex.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Mutex Handler
- *
- * DESCRIPTION:
- *
- * This package is the implementation of the Mutex Handler.
- * This handler provides synchronization and mutual exclusion capabilities.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/coremutex.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-
-/*PAGE
- *
- * _CORE_mutex_Initialize
- *
- * This routine initializes a mutex at create time and set the control
- * structure according to the values passed.
- *
- * Input parameters:
- * the_mutex - the mutex control block to initialize
- * the_class - the API class of the object
- * the_mutex_attributes - the mutex attributes specified at create time
- * initial_lock - mutex initial lock or unlocked status
- * proxy_extract_callout - MP specific extract callout
- *
- * Output parameters: NONE
- */
-
-void _CORE_mutex_Initialize(
- CORE_mutex_Control *the_mutex,
- Objects_Classes the_class,
- CORE_mutex_Attributes *the_mutex_attributes,
- unsigned32 initial_lock,
- Thread_queue_Extract_callout proxy_extract_callout
-)
-{
-
-/* Add this to the RTEMS environment later ?????????
- rtems_assert( initial_lock == CORE_MUTEX_LOCKED ||
- initial_lock == CORE_MUTEX_UNLOCKED );
- */
-
- the_mutex->Attributes = *the_mutex_attributes;
- the_mutex->lock = initial_lock;
-
- if ( initial_lock == CORE_MUTEX_LOCKED ) {
- the_mutex->nest_count = 1;
- the_mutex->holder = _Thread_Executing;
- the_mutex->holder_id = _Thread_Executing->Object.id;
- _Thread_Executing->resource_count++;
- } else {
- the_mutex->nest_count = 0;
- the_mutex->holder = NULL;
- the_mutex->holder_id = 0;
- }
-
- _Thread_queue_Initialize(
- &the_mutex->Wait_queue,
- the_class,
- _CORE_mutex_Is_fifo( the_mutex_attributes ) ?
- THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY,
- STATES_WAITING_FOR_MUTEX,
- proxy_extract_callout,
- CORE_MUTEX_TIMEOUT
- );
-}
-
-/*PAGE
- *
- * _CORE_mutex_Seize
- *
- * This routine attempts to allocate a mutex to the calling thread.
- *
- * Input parameters:
- * the_mutex - pointer to mutex control block
- * id - id of object to wait on
- * wait - TRUE if wait is allowed, FALSE otherwise
- * timeout - number of ticks to wait (0 means forever)
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * available
- * wait
- */
-
-void _CORE_mutex_Seize(
- CORE_mutex_Control *the_mutex,
- Objects_Id id,
- boolean wait,
- Watchdog_Interval timeout
-)
-{
- Thread_Control *executing;
- ISR_Level level;
-
- executing = _Thread_Executing;
- switch ( the_mutex->Attributes.discipline ) {
- case CORE_MUTEX_DISCIPLINES_FIFO:
- case CORE_MUTEX_DISCIPLINES_PRIORITY:
- case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
- break;
- case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
- if ( executing->current_priority <
- the_mutex->Attributes.priority_ceiling) {
- executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED;
- return;
- }
- }
- executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
- _ISR_Disable( level );
- if ( ! _CORE_mutex_Is_locked( the_mutex ) ) {
- the_mutex->lock = CORE_MUTEX_LOCKED;
- the_mutex->holder = executing;
- the_mutex->holder_id = executing->Object.id;
- the_mutex->nest_count = 1;
- executing->resource_count++;
- _ISR_Enable( level );
- switch ( the_mutex->Attributes.discipline ) {
- case CORE_MUTEX_DISCIPLINES_FIFO:
- case CORE_MUTEX_DISCIPLINES_PRIORITY:
- case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
- /* already the highest priority */
- break;
- case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
- if ( the_mutex->Attributes.priority_ceiling <
- executing->current_priority ) {
- _Thread_Change_priority(
- the_mutex->holder,
- the_mutex->Attributes.priority_ceiling,
- FALSE
- );
- }
- }
- return;
- }
-
- if ( _Objects_Are_ids_equal(
- _Thread_Executing->Object.id, the_mutex->holder_id ) ) {
- if ( _CORE_mutex_Is_nesting_allowed( &the_mutex->Attributes ) )
- the_mutex->nest_count++;
- else
- executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
-
- _ISR_Enable( level );
- return;
- }
-
- if ( !wait ) {
- _ISR_Enable( level );
- executing->Wait.return_code = CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT;
- return;
- }
-
- _Thread_queue_Enter_critical_section( &the_mutex->Wait_queue );
- executing->Wait.queue = &the_mutex->Wait_queue;
- executing->Wait.id = id;
- _ISR_Enable( level );
-
- switch ( the_mutex->Attributes.discipline ) {
- case CORE_MUTEX_DISCIPLINES_FIFO:
- case CORE_MUTEX_DISCIPLINES_PRIORITY:
- case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
- break;
- case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
- if ( the_mutex->holder->current_priority > executing->current_priority ) {
- _Thread_Change_priority(
- the_mutex->holder,
- executing->current_priority,
- FALSE
- );
- }
- break;
- }
-
- _Thread_queue_Enqueue( &the_mutex->Wait_queue, timeout );
-
- if ( _Thread_Executing->Wait.return_code == CORE_MUTEX_STATUS_SUCCESSFUL ) {
- switch ( the_mutex->Attributes.discipline ) {
- case CORE_MUTEX_DISCIPLINES_FIFO:
- case CORE_MUTEX_DISCIPLINES_PRIORITY:
- case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
- break;
- case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
- if ( the_mutex->Attributes.priority_ceiling <
- executing->current_priority ) {
- _Thread_Change_priority(
- executing,
- the_mutex->Attributes.priority_ceiling,
- FALSE
- );
- };
- break;
- }
- }
-}
-
-/*
- * _CORE_mutex_Surrender
- *
- * DESCRIPTION:
- *
- * This routine frees a unit to the mutex. If a task was blocked waiting for
- * a unit from this mutex, then that task will be readied and the unit
- * given to that task. Otherwise, the unit will be returned to the mutex.
- *
- * Input parameters:
- * the_mutex - the mutex to be flushed
- * id - id of parent mutex
- * api_mutex_mp_support - api dependent MP support actions
- *
- * Output parameters:
- * CORE_MUTEX_STATUS_SUCCESSFUL - if successful
- * core error code - if unsuccessful
- */
-
-CORE_mutex_Status _CORE_mutex_Surrender(
- CORE_mutex_Control *the_mutex,
- Objects_Id id,
- CORE_mutex_API_mp_support_callout api_mutex_mp_support
-)
-{
- Thread_Control *the_thread;
- Thread_Control *executing;
-
- executing = _Thread_Executing;
-
- /*
- * The following code allows a thread (or ISR) other than the thread
- * which acquired the mutex to release that mutex. This is only
- * allowed when the mutex in quetion is FIFO or simple Priority
- * discipline. But Priority Ceiling or Priority Inheritance mutexes
- * must be released by the thread which acquired them.
- */
-
- if ( !_Objects_Are_ids_equal(
- _Thread_Executing->Object.id, the_mutex->holder_id ) ) {
-
- switch ( the_mutex->Attributes.discipline ) {
- case CORE_MUTEX_DISCIPLINES_FIFO:
- case CORE_MUTEX_DISCIPLINES_PRIORITY:
- break;
- case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
- case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
- return( CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE );
- break;
- }
- }
-
- the_mutex->nest_count--;
-
- if ( the_mutex->nest_count != 0 )
- return( CORE_MUTEX_STATUS_SUCCESSFUL );
-
- _Thread_Executing->resource_count--;
- the_mutex->holder = NULL;
- the_mutex->holder_id = 0;
-
- /*
- * Whether or not someone is waiting for the mutex, an
- * inherited priority must be lowered if this is the last
- * mutex (i.e. resource) this task has.
- */
-
- switch ( the_mutex->Attributes.discipline ) {
- case CORE_MUTEX_DISCIPLINES_FIFO:
- case CORE_MUTEX_DISCIPLINES_PRIORITY:
- break;
- case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
- case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
- if ( executing->resource_count == 0 &&
- executing->real_priority != executing->current_priority ) {
- _Thread_Change_priority( executing, executing->real_priority, TRUE );
- }
- break;
- }
-
-
- if ( ( the_thread = _Thread_queue_Dequeue( &the_mutex->Wait_queue ) ) ) {
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) ) {
-
- the_mutex->holder = NULL;
- the_mutex->holder_id = the_thread->Object.id;
- the_mutex->nest_count = 1;
-
- ( *api_mutex_mp_support)( the_thread, id );
-
- } else {
-
- the_mutex->holder = the_thread;
- the_mutex->holder_id = the_thread->Object.id;
- the_thread->resource_count++;
- the_mutex->nest_count = 1;
-
- /*
- * No special action for priority inheritance or priority ceiling
- * because the_thread is guaranteed to be the highest priority
- * thread waiting for the mutex.
- */
- }
- } else
- the_mutex->lock = CORE_MUTEX_UNLOCKED;
-
- return( CORE_MUTEX_STATUS_SUCCESSFUL );
-}
-
-/*PAGE
- *
- * _CORE_mutex_Flush
- *
- * This function a flushes the mutex's task wait queue.
- *
- * Input parameters:
- * the_mutex - the mutex to be flushed
- * remote_extract_callout - function to invoke remotely
- * status - status to pass to thread
- *
- * Output parameters: NONE
- */
-
-void _CORE_mutex_Flush(
- CORE_mutex_Control *the_mutex,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-)
-{
- _Thread_queue_Flush(
- &the_mutex->Wait_queue,
- remote_extract_callout,
- status
- );
-}
diff --git a/cpukit/score/src/coresem.c b/cpukit/score/src/coresem.c
deleted file mode 100644
index 074ba2cb22..0000000000
--- a/cpukit/score/src/coresem.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * CORE Semaphore Handler
- *
- * DESCRIPTION:
- *
- * This package is the implementation of the CORE Semaphore Handler.
- * This core object utilizes standard Dijkstra counting semaphores to provide
- * synchronization and mutual exclusion capabilities.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/coresem.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/mpci.h>
-
-/*PAGE
- *
- * CORE_semaphore_Initialize
- *
- * This function initialize a semaphore and sets the initial value based
- * on the given count.
- *
- * Input parameters:
- * the_semaphore - the semaphore control block to initialize
- * the_class - the API class of the object
- * the_semaphore_attributes - the attributes specified at create time
- * initial_value - semaphore's initial value
- * proxy_extract_callout - MP specific extract callout
- *
- * Output parameters: NONE
- */
-
-void _CORE_semaphore_Initialize(
- CORE_semaphore_Control *the_semaphore,
- Objects_Classes the_class,
- CORE_semaphore_Attributes *the_semaphore_attributes,
- unsigned32 initial_value,
- Thread_queue_Extract_callout proxy_extract_callout
-)
-{
-
- the_semaphore->Attributes = *the_semaphore_attributes;
- the_semaphore->count = initial_value;
-
- _Thread_queue_Initialize(
- &the_semaphore->Wait_queue,
- the_class,
- _CORE_semaphore_Is_priority( the_semaphore_attributes ) ?
- THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_SEMAPHORE,
- proxy_extract_callout,
- CORE_SEMAPHORE_TIMEOUT
- );
-}
-
-/*PAGE
- *
- * _CORE_semaphore_Surrender
- *
- * Input parameters:
- * the_semaphore - the semaphore to be flushed
- * id - id of parent semaphore
- * api_semaphore_mp_support - api dependent MP support actions
- *
- * Output parameters:
- * CORE_SEMAPHORE_STATUS_SUCCESSFUL - if successful
- * core error code - if unsuccessful
- *
- * Output parameters:
- */
-
-CORE_semaphore_Status _CORE_semaphore_Surrender(
- CORE_semaphore_Control *the_semaphore,
- Objects_Id id,
- CORE_semaphore_API_mp_support_callout api_semaphore_mp_support
-)
-{
- Thread_Control *the_thread;
-
- if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) {
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- (*api_semaphore_mp_support) ( the_thread, id );
-
- } else
- the_semaphore->count += 1;
-
- return( CORE_SEMAPHORE_STATUS_SUCCESSFUL );
-}
-
-/*PAGE
- *
- * _CORE_semaphore_Seize
- *
- * This routine attempts to allocate a core semaphore to the calling thread.
- *
- * Input parameters:
- * the_semaphore - pointer to semaphore control block
- * id - id of object to wait on
- * wait - TRUE if wait is allowed, FALSE otherwise
- * timeout - number of ticks to wait (0 means forever)
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * available
- * wait
- */
-
-void _CORE_semaphore_Seize(
- CORE_semaphore_Control *the_semaphore,
- Objects_Id id,
- boolean wait,
- Watchdog_Interval timeout
-)
-{
- Thread_Control *executing;
- ISR_Level level;
-
- executing = _Thread_Executing;
- executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
- _ISR_Disable( level );
- if ( the_semaphore->count != 0 ) {
- the_semaphore->count -= 1;
- _ISR_Enable( level );
- return;
- }
-
- if ( !wait ) {
- _ISR_Enable( level );
- executing->Wait.return_code = CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT;
- return;
- }
-
- _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue );
- executing->Wait.queue = &the_semaphore->Wait_queue;
- executing->Wait.id = id;
- _ISR_Enable( level );
-
- _Thread_queue_Enqueue( &the_semaphore->Wait_queue, timeout );
-}
-
-
-/*PAGE
- *
- * _CORE_semaphore_Flush
- *
- * This function a flushes the semaphore's task wait queue.
- *
- * Input parameters:
- * the_semaphore - the semaphore to be flushed
- * remote_extract_callout - function to invoke remotely
- * status - status to pass to thread
- *
- * Output parameters: NONE
- */
-
-void _CORE_semaphore_Flush(
- CORE_semaphore_Control *the_semaphore,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-)
-{
-
- _Thread_queue_Flush(
- &the_semaphore->Wait_queue,
- remote_extract_callout,
- status
- );
-
-}
diff --git a/cpukit/score/src/coretod.c b/cpukit/score/src/coretod.c
deleted file mode 100644
index 72742944b4..0000000000
--- a/cpukit/score/src/coretod.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Time of Day (TOD) Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/object.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
-
-/*PAGE
- *
- * _TOD_Handler_initialization
- *
- * This routine initializes the time of day handler.
- *
- * Input parameters:
- * microseconds_per_tick - microseconds between clock ticks
- *
- * Output parameters: NONE
- */
-
-void _TOD_Handler_initialization(
- unsigned32 microseconds_per_tick
-)
-{
- _TOD_Microseconds_per_tick = microseconds_per_tick;
-
- _TOD_Seconds_since_epoch = 0;
-
- _TOD_Current.year = TOD_BASE_YEAR;
- _TOD_Current.month = 1;
- _TOD_Current.day = 1;
- _TOD_Current.hour = 0;
- _TOD_Current.minute = 0;
- _TOD_Current.second = 0;
- _TOD_Current.ticks = 0;
-
- if ( microseconds_per_tick == 0 )
- _TOD_Ticks_per_second = 0;
- else
- _TOD_Ticks_per_second =
- TOD_MICROSECONDS_PER_SECOND / microseconds_per_tick;
-
- _Watchdog_Initialize( &_TOD_Seconds_watchdog, _TOD_Tickle, 0, NULL );
-
- _TOD_Is_set = FALSE;
- _TOD_Activate( _TOD_Ticks_per_second );
-}
-
-/*PAGE
- *
- * _TOD_Set
- *
- * This rountine sets the current date and time with the specified
- * new date and time structure.
- *
- * Input parameters:
- * the_tod - pointer to the time and date structure
- * seconds_since_epoch - seconds since system epoch
- *
- * Output parameters: NONE
- */
-
-void _TOD_Set(
- TOD_Control *the_tod,
- Watchdog_Interval seconds_since_epoch
-)
-{
- Watchdog_Interval ticks_until_next_second;
-
- _Thread_Disable_dispatch();
- _TOD_Deactivate();
-
- if ( seconds_since_epoch < _TOD_Seconds_since_epoch )
- _Watchdog_Adjust_seconds( WATCHDOG_BACKWARD,
- _TOD_Seconds_since_epoch - seconds_since_epoch );
- else
- _Watchdog_Adjust_seconds( WATCHDOG_FORWARD,
- seconds_since_epoch - _TOD_Seconds_since_epoch );
-
- ticks_until_next_second = _TOD_Ticks_per_second;
- if ( ticks_until_next_second > _TOD_Current.ticks )
- ticks_until_next_second -= _TOD_Current.ticks;
-
- _TOD_Current = *the_tod;
- _TOD_Seconds_since_epoch = seconds_since_epoch;
- _TOD_Is_set = TRUE;
- _TOD_Activate( ticks_until_next_second );
-
- _Thread_Enable_dispatch();
-}
-
-/*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;
-}
-
-/*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 );
-}
-
-/*PAGE
- *
- * _TOD_Tickle
- *
- * This routine updates the calendar time and tickles the
- * per second watchdog timer chain.
- *
- * Input parameters:
- * ignored - this parameter is ignored
- *
- * Output parameters: NONE
- *
- * NOTE: This routine only works for leap-years through 2099.
- */
-
-void _TOD_Tickle(
- Objects_Id id,
- void *ignored
-)
-{
- unsigned32 leap;
-
- _TOD_Current.ticks = 0;
- ++_TOD_Seconds_since_epoch;
- if ( ++_TOD_Current.second >= TOD_SECONDS_PER_MINUTE ) {
- _TOD_Current.second = 0;
- if ( ++_TOD_Current.minute >= TOD_MINUTES_PER_HOUR ) {
- _TOD_Current.minute = 0;
- if ( ++_TOD_Current.hour >= TOD_HOURS_PER_DAY ) {
- _TOD_Current.hour = 0;
- if ( _TOD_Current.year & 0x3 ) leap = 0;
- else leap = 1;
- if ( ++_TOD_Current.day >
- _TOD_Days_per_month[ leap ][ _TOD_Current.month ]) {
- _TOD_Current.day = 1;
- if ( ++_TOD_Current.month > TOD_MONTHS_PER_YEAR ) {
- _TOD_Current.month = 1;
- _TOD_Current.year++;
- }
- }
- }
- }
- }
-
- _Watchdog_Tickle_seconds();
- _Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, _TOD_Ticks_per_second );
-}
diff --git a/cpukit/score/src/heap.c b/cpukit/score/src/heap.c
deleted file mode 100644
index d8a1aad8bd..0000000000
--- a/cpukit/score/src/heap.c
+++ /dev/null
@@ -1,538 +0,0 @@
-/*
- * Heap Handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/heap.h>
-
-/*PAGE
- *
- * _Heap_Initialize
- *
- * This kernel routine initializes a heap.
- *
- * Input parameters:
- * the_heap - pointer to heap header
- * starting_address - starting address of heap
- * size - size of heap
- * page_size - allocatable unit of memory
- *
- * Output parameters:
- * returns - maximum memory available if RTEMS_SUCCESSFUL
- * 0 - otherwise
- *
- * This is what a heap looks like in memory immediately
- * after initialization:
- *
- * +--------------------------------+
- * 0 | size = 0 | status = used | a.k.a. dummy back flag
- * +--------------------------------+
- * 4 | size = size-8 | status = free | a.k.a. front flag
- * +--------------------------------+
- * 8 | next = PERM HEAP_TAIL |
- * +--------------------------------+
- * 12 | previous = PERM HEAP_HEAD |
- * +--------------------------------+
- * | |
- * | memory available |
- * | for allocation |
- * | |
- * +--------------------------------+
- * size - 8 | size = size-8 | status = free | a.k.a. back flag
- * +--------------------------------+
- * size - 4 | size = 0 | status = used | a.k.a. dummy front flag
- * +--------------------------------+
- */
-
-unsigned32 _Heap_Initialize(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 size,
- unsigned32 page_size
-)
-{
- Heap_Block *the_block;
- unsigned32 the_size;
-
- if ( !_Heap_Is_page_size_valid( page_size ) ||
- (size < HEAP_MINIMUM_SIZE) )
- return 0;
-
- the_heap->page_size = page_size;
- the_size = size - HEAP_OVERHEAD;
-
- the_block = (Heap_Block *) starting_address;
- the_block->back_flag = HEAP_DUMMY_FLAG;
- the_block->front_flag = the_size;
- the_block->next = _Heap_Tail( the_heap );
- the_block->previous = _Heap_Head( the_heap );
-
- the_heap->start = the_block;
- the_heap->first = the_block;
- the_heap->permanent_null = NULL;
- the_heap->last = the_block;
-
- the_block = _Heap_Next_block( the_block );
- the_block->back_flag = the_size;
- the_block->front_flag = HEAP_DUMMY_FLAG;
- the_heap->final = the_block;
-
- return ( the_size - HEAP_BLOCK_USED_OVERHEAD );
-}
-
-/*PAGE
- *
- * _Heap_Extend
- *
- * This routine grows the_heap memory area using the size bytes which
- * begin at starting_address.
- *
- * Input parameters:
- * the_heap - pointer to heap header.
- * starting_address - pointer to the memory area.
- * size - size in bytes of the memory block to allocate.
- *
- * Output parameters:
- * *amount_extended - amount of memory added to the_heap
- */
-
-Heap_Extend_status _Heap_Extend(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 size,
- unsigned32 *amount_extended
-)
-{
- Heap_Block *the_block;
- unsigned32 *p;
-
- /*
- * The overhead was taken from the original heap memory.
- */
-
- Heap_Block *old_final;
- Heap_Block *new_final;
-
- /*
- * There are five possibilities for the location of starting
- * address:
- *
- * 1. non-contiguous lower address (NOT SUPPORTED)
- * 2. contiguous lower address (NOT SUPPORTED)
- * 3. in the heap (ERROR)
- * 4. contiguous higher address (SUPPORTED)
- * 5. non-contiguous higher address (NOT SUPPORTED)
- *
- * As noted, this code only supports (4).
- */
-
- if ( starting_address >= (void *) the_heap->start && /* case 3 */
- starting_address <= (void *) the_heap->final
- )
- return HEAP_EXTEND_ERROR;
-
- if ( starting_address < (void *) the_heap->start ) { /* cases 1 and 2 */
-
- return HEAP_EXTEND_NOT_IMPLEMENTED; /* cases 1 and 2 */
-
- } else { /* cases 4 and 5 */
-
- the_block = (Heap_Block *)
- _Addresses_Subtract_offset( starting_address, HEAP_OVERHEAD );
- if ( the_block != the_heap->final )
- return HEAP_EXTEND_NOT_IMPLEMENTED; /* case 5 */
- }
-
- /*
- * Currently only case 4 should make it to this point.
- * The basic trick is to make the extend area look like a used
- * block and free it.
- */
-
- *amount_extended = size;
-
- old_final = the_heap->final;
- new_final = _Addresses_Add_offset( old_final, size );
- /* SAME AS: _Addresses_Add_offset( starting_address, size-HEAP_OVERHEAD ); */
-
- the_heap->final = new_final;
-
- old_final->front_flag =
- new_final->back_flag = _Heap_Build_flag( size, HEAP_BLOCK_USED );
- new_final->front_flag = HEAP_DUMMY_FLAG;
-
- /*
- * Must pass in address of "user" area
- * So add in the offset field.
- */
-
- p = (unsigned32 *) &old_final->next;
- *p = sizeof(unsigned32);
- p++;
- _Heap_Free( the_heap, p );
-
- return HEAP_EXTEND_SUCCESSFUL;
-}
-
-/*PAGE
- *
- * _Heap_Allocate
- *
- * This kernel routine allocates the requested size of memory
- * from the specified heap.
- *
- * Input parameters:
- * the_heap - pointer to heap header.
- * size - size in bytes of the memory block to allocate.
- *
- * Output parameters:
- * returns - starting address of memory block allocated
- */
-
-void *_Heap_Allocate(
- Heap_Control *the_heap,
- unsigned32 size
-)
-{
- unsigned32 excess;
- unsigned32 the_size;
- Heap_Block *the_block;
- Heap_Block *next_block;
- Heap_Block *temporary_block;
- void *ptr;
- unsigned32 offset;
-
- excess = size % the_heap->page_size;
- the_size = size + the_heap->page_size + HEAP_BLOCK_USED_OVERHEAD;
-
- if ( excess )
- the_size += the_heap->page_size - excess;
-
- if ( the_size < sizeof( Heap_Block ) )
- the_size = sizeof( Heap_Block );
-
- for ( the_block = the_heap->first;
- ;
- the_block = the_block->next ) {
- if ( the_block == _Heap_Tail( the_heap ) )
- return( NULL );
- if ( the_block->front_flag >= the_size )
- break;
- }
-
- if ( (the_block->front_flag - the_size) >
- (the_heap->page_size + HEAP_BLOCK_USED_OVERHEAD) ) {
- the_block->front_flag -= the_size;
- next_block = _Heap_Next_block( the_block );
- next_block->back_flag = the_block->front_flag;
-
- temporary_block = _Heap_Block_at( next_block, the_size );
- temporary_block->back_flag =
- next_block->front_flag = _Heap_Build_flag( the_size,
- HEAP_BLOCK_USED );
- ptr = _Heap_Start_of_user_area( next_block );
- } else {
- next_block = _Heap_Next_block( the_block );
- next_block->back_flag = _Heap_Build_flag( the_block->front_flag,
- HEAP_BLOCK_USED );
- the_block->front_flag = next_block->back_flag;
- the_block->next->previous = the_block->previous;
- the_block->previous->next = the_block->next;
- ptr = _Heap_Start_of_user_area( the_block );
- }
-
- /*
- * round ptr up to a multiple of page size
- * Have to save the bump amount in the buffer so that free can figure it out
- */
-
- offset = the_heap->page_size - (((unsigned32) ptr) & (the_heap->page_size - 1));
- ptr = _Addresses_Add_offset( ptr, offset );
- *(((unsigned32 *) ptr) - 1) = offset;
-
-#ifdef RTEMS_DEBUG
- {
- unsigned32 ptr_u32;
- ptr_u32 = (unsigned32) ptr;
- if (ptr_u32 & (the_heap->page_size - 1))
- abort();
- }
-#endif
-
- return ptr;
-}
-
-/*PAGE
- *
- * _Heap_Size_of_user_area
- *
- * This kernel routine returns the size of the memory area
- * given heap block.
- *
- * Input parameters:
- * the_heap - pointer to heap header
- * starting_address - starting address of the memory block to free.
- * size - pointer to size of area
- *
- * Output parameters:
- * size - size of area filled in
- * TRUE - if starting_address is valid heap address
- * FALSE - if starting_address is invalid heap address
- */
-
-boolean _Heap_Size_of_user_area(
- Heap_Control *the_heap,
- void *starting_address,
- unsigned32 *size
-)
-{
- Heap_Block *the_block;
- Heap_Block *next_block;
- unsigned32 the_size;
-
- the_block = _Heap_User_block_at( starting_address );
-
- if ( !_Heap_Is_block_in( the_heap, the_block ) ||
- _Heap_Is_block_free( the_block ) )
- return( FALSE );
-
- the_size = _Heap_Block_size( the_block );
- next_block = _Heap_Block_at( the_block, the_size );
-
- if ( !_Heap_Is_block_in( the_heap, next_block ) ||
- (the_block->front_flag != next_block->back_flag) )
- return( FALSE );
-
- *size = the_size;
- return( TRUE );
-}
-
-/*PAGE
- *
- * _Heap_Free
- *
- * This kernel routine returns the memory designated by the
- * given heap and given starting address to the memory pool.
- *
- * Input parameters:
- * the_heap - pointer to heap header
- * starting_address - starting address of the memory block to free.
- *
- * Output parameters:
- * TRUE - if starting_address is valid heap address
- * FALSE - if starting_address is invalid heap address
- */
-
-boolean _Heap_Free(
- Heap_Control *the_heap,
- void *starting_address
-)
-{
- Heap_Block *the_block;
- Heap_Block *next_block;
- Heap_Block *new_next_block;
- Heap_Block *previous_block;
- Heap_Block *temporary_block;
- unsigned32 the_size;
-
- the_block = _Heap_User_block_at( starting_address );
-
- if ( !_Heap_Is_block_in( the_heap, the_block ) ||
- _Heap_Is_block_free( the_block ) ) {
- return( FALSE );
- }
-
- the_size = _Heap_Block_size( the_block );
- next_block = _Heap_Block_at( the_block, the_size );
-
- if ( !_Heap_Is_block_in( the_heap, next_block ) ||
- (the_block->front_flag != next_block->back_flag) ) {
- return( FALSE );
- }
-
- if ( _Heap_Is_previous_block_free( the_block ) ) {
- previous_block = _Heap_Previous_block( the_block );
-
- if ( !_Heap_Is_block_in( the_heap, previous_block ) ) {
- return( FALSE );
- }
-
- if ( _Heap_Is_block_free( next_block ) ) { /* coalesce both */
- previous_block->front_flag += next_block->front_flag + the_size;
- temporary_block = _Heap_Next_block( previous_block );
- temporary_block->back_flag = previous_block->front_flag;
- next_block->next->previous = next_block->previous;
- next_block->previous->next = next_block->next;
- }
- else { /* coalesce prev */
- previous_block->front_flag =
- next_block->back_flag = previous_block->front_flag + the_size;
- }
- }
- else if ( _Heap_Is_block_free( next_block ) ) { /* coalesce next */
- the_block->front_flag = the_size + next_block->front_flag;
- new_next_block = _Heap_Next_block( the_block );
- new_next_block->back_flag = the_block->front_flag;
- the_block->next = next_block->next;
- the_block->previous = next_block->previous;
- next_block->previous->next = the_block;
- next_block->next->previous = the_block;
-
- if (the_heap->first == next_block)
- the_heap->first = the_block;
- }
- else { /* no coalesce */
- next_block->back_flag =
- the_block->front_flag = the_size;
- the_block->previous = _Heap_Head( the_heap );
- the_block->next = the_heap->first;
- the_heap->first = the_block;
- the_block->next->previous = the_block;
- }
-
- return( TRUE );
-}
-
-/*PAGE
- *
- * _Heap_Walk
- *
- * This kernel routine walks the heap and verifies its correctness.
- *
- * Input parameters:
- * the_heap - pointer to heap header
- * source - a numeric indicator of the invoker of this routine
- * do_dump - when TRUE print the information
- *
- * Output parameters: NONE
- */
-
-#ifndef RTEMS_DEBUG
-
-void _Heap_Walk(
- Heap_Control *the_heap,
- int source,
- boolean do_dump
-)
-{
-}
-
-#else
-
-#include <stdio.h>
-#include <unistd.h>
-
-void _Heap_Walk(
- Heap_Control *the_heap,
- int source,
- boolean do_dump
-)
-{
- Heap_Block *the_block = 0; /* avoid warnings */
- Heap_Block *next_block = 0; /* avoid warnings */
- int notdone = 1;
- int error = 0;
- int passes = 0;
-
- /*
- * We don't want to allow walking the heap until we have
- * transferred control to the user task so we watch the
- * system state.
- */
-
- if ( !_System_state_Is_up( _System_state_Get() ) )
- return;
-
- the_block = the_heap->start;
-
- if (do_dump == TRUE) {
- printf("\nPASS: %d start @ 0x%p final 0x%p, first 0x%p last 0x%p\n",
- source, the_heap->start, the_heap->final,
- the_heap->first, the_heap->last
- );
- }
-
- /*
- * Handle the 1st block
- */
-
- if (the_block->back_flag != HEAP_DUMMY_FLAG) {
- printf("PASS: %d Back flag of 1st block isn't HEAP_DUMMY_FLAG\n", source);
- error = 1;
- }
-
- while (notdone) {
- passes++;
- if (error && (passes > 10))
- abort();
-
- if (do_dump == TRUE) {
- printf("PASS: %d Block @ 0x%p Back %d, Front %d",
- source, the_block,
- the_block->back_flag, the_block->front_flag);
- if ( _Heap_Is_block_free(the_block) ) {
- printf( " Prev 0x%p, Next 0x%p\n",
- the_block->previous, the_block->next);
- } else {
- printf("\n");
- }
- }
-
- /*
- * Handle the last block
- */
-
- if ( the_block->front_flag != HEAP_DUMMY_FLAG ) {
- next_block = _Heap_Next_block(the_block);
- if ( the_block->front_flag != next_block->back_flag ) {
- error = 1;
- printf("PASS: %d Front and back flags don't match\n", source);
- printf(" Current Block (%p): Back - %d, Front - %d",
- the_block, the_block->back_flag, the_block->front_flag);
- if (do_dump == TRUE) {
- if (_Heap_Is_block_free(the_block)) {
- printf(" Prev 0x%p, Next 0x%p\n",
- the_block->previous, the_block->next);
- } else {
- printf("\n");
- }
- } else {
- printf("\n");
- }
- printf(" Next Block (%p): Back - %d, Front - %d",
- next_block, next_block->back_flag, next_block->front_flag);
- if (do_dump == TRUE) {
- if (_Heap_Is_block_free(next_block)) {
- printf(" Prev 0x%p, Next 0x%p\n",
- the_block->previous, the_block->next);
- } else {
- printf("\n");
- }
- } else {
- printf("\n");
- }
- }
- }
-
- if (the_block->front_flag == HEAP_DUMMY_FLAG)
- notdone = 0;
- else
- the_block = next_block;
- }
-
- if (error)
- abort();
-}
-#endif
diff --git a/cpukit/score/src/interr.c b/cpukit/score/src/interr.c
deleted file mode 100644
index c3a6d48514..0000000000
--- a/cpukit/score/src/interr.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Internal Error Handler
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/userext.h>
-
-/*PAGE
- *
- * _Internal_error_Occurred
- *
- * This routine will invoke the fatal error handler supplied by the user
- * followed by the the default one provided by the executive. The default
- * error handler assumes no hardware is present to help inform the user
- * of the problem. Halt stores the error code in a known register,
- * disables interrupts, and halts the CPU. If the CPU does not have a
- * halt instruction, it will loop to itself.
- *
- * Input parameters:
- * the_source - what subsystem the error originated in
- * is_internal - if the error was internally generated
- * the_error - fatal error status code
- *
- * Output parameters:
- * As much information as possible is stored in a CPU dependent fashion.
- * See the CPU dependent code for more information.
- *
- * NOTE: The the_error is not necessarily a directive status code.
- */
-
-void volatile _Internal_error_Occurred(
- Internal_errors_Source the_source,
- boolean is_internal,
- unsigned32 the_error
-)
-{
-
- Internal_errors_What_happened.the_source = the_source;
- Internal_errors_What_happened.is_internal = is_internal;
- Internal_errors_What_happened.the_error = the_error;
-
- _User_extensions_Fatal( the_source, is_internal, the_error );
-
- _System_state_Set( SYSTEM_STATE_FAILED );
-
- _CPU_Fatal_halt( the_error );
-
- /* will not return from this routine */
-}
diff --git a/cpukit/score/src/isr.c b/cpukit/score/src/isr.c
deleted file mode 100644
index 53baf388c4..0000000000
--- a/cpukit/score/src/isr.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * ISR Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/stack.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/wkspace.h>
-
-/* _ISR_Handler_initialization
- *
- * This routine initializes the ISR handler.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _ISR_Handler_initialization( void )
-{
- _ISR_Signals_to_thread_executing = FALSE;
-
- _ISR_Nest_level = 0;
-
-#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
-
- if ( _CPU_Table.interrupt_stack_size < STACK_MINIMUM_SIZE )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL
- );
-
- _CPU_Interrupt_stack_low =
- _Workspace_Allocate_or_fatal_error( _CPU_Table.interrupt_stack_size );
-
- _CPU_Interrupt_stack_high = _Addresses_Add_offset(
- _CPU_Interrupt_stack_low,
- _CPU_Table.interrupt_stack_size
- );
-
-#endif
-
-#if ( CPU_HAS_HARDWARE_INTERRUPT_STACK == TRUE )
- _CPU_Install_interrupt_stack();
-#endif
-
-}
diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c
deleted file mode 100644
index efe63160f3..0000000000
--- a/cpukit/score/src/mpci.c
+++ /dev/null
@@ -1,525 +0,0 @@
-/*
- * Multiprocessing Communications Interface (MPCI) Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/cpu.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/mpci.h>
-#include <rtems/score/mppkt.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/tqdata.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/score/sysstate.h>
-
-#include <rtems/score/coresem.h>
-
-/*PAGE
- *
- * _MPCI_Handler_initialization
- *
- * This subprogram performs the initialization necessary for this handler.
- */
-
-void _MPCI_Handler_initialization(
- MPCI_Control *users_mpci_table,
- unsigned32 timeout_status
-)
-{
- CORE_semaphore_Attributes attributes;
-
- if ( _System_state_Is_multiprocessing && !users_mpci_table )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_NO_MPCI
- );
-
- _MPCI_table = users_mpci_table;
-
- if ( !_System_state_Is_multiprocessing )
- return;
-
- /*
- * Register the MP Process Packet routine.
- */
-
- _MPCI_Register_packet_processor(
- MP_PACKET_MPCI_INTERNAL,
- _MPCI_Internal_packets_Process_packet
- );
-
- /*
- * Create the counting semaphore used by the MPCI Receive Server.
- */
-
- attributes.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
-
- _CORE_semaphore_Initialize(
- &_MPCI_Semaphore,
- OBJECTS_NO_CLASS, /* free floating semaphore */
- &attributes, /* the_semaphore_attributes */
- 0, /* initial_value */
- NULL /* proxy_extract_callout */
- );
-
- _Thread_queue_Initialize(
- &_MPCI_Remote_blocked_threads,
- OBJECTS_NO_CLASS,
- THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_RPC_REPLY,
- NULL,
- timeout_status
- );
-}
-
-/*PAGE
- *
- * _MPCI_Create_server
- *
- * This subprogram creates the MPCI receive server.
- */
-
-char *_MPCI_Internal_name = "MPCI";
-
-void _MPCI_Create_server( void )
-{
-
- if ( !_System_state_Is_multiprocessing )
- return;
-
- /*
- * Initialize the MPCI Receive Server
- */
-
- _MPCI_Receive_server_tcb = _Thread_Internal_allocate();
-
- _Thread_Initialize(
- &_Thread_Internal_information,
- _MPCI_Receive_server_tcb,
- NULL, /* allocate the stack */
- MPCI_RECEIVE_SERVER_STACK_SIZE,
- CPU_ALL_TASKS_ARE_FP,
- PRIORITY_MINIMUM,
- FALSE, /* no preempt */
- THREAD_CPU_BUDGET_ALGORITHM_NONE,
- NULL, /* no budget algorithm callout */
- 0, /* all interrupts enabled */
- _MPCI_Internal_name
- );
-
- _Thread_Start(
- _MPCI_Receive_server_tcb,
- THREAD_START_NUMERIC,
- (void *) _MPCI_Receive_server,
- NULL,
- 0
- );
-}
-
-/*PAGE
- *
- * _MPCI_Initialization
- *
- * This subprogram initializes the MPCI driver by
- * invoking the user provided MPCI initialization callout.
- */
-
-void _MPCI_Initialization ( void )
-{
- (*_MPCI_table->initialization)();
-}
-
-/*PAGE
- *
- * _MPCI_Register_packet_processor
- *
- * This routine registers the MPCI packet processor for the
- * designated object class.
- */
-
-void _MPCI_Register_packet_processor(
- MP_packet_Classes the_class,
- MPCI_Packet_processor the_packet_processor
-
-)
-{
- _MPCI_Packet_processors[ the_class ] = the_packet_processor;
-}
-
-/*PAGE
- *
- * _MPCI_Get_packet
- *
- * This subprogram obtains a packet by invoking the user provided
- * MPCI get packet callout.
- */
-
-MP_packet_Prefix *_MPCI_Get_packet ( void )
-{
- MP_packet_Prefix *the_packet;
-
- (*_MPCI_table->get_packet)( &the_packet );
-
- if ( the_packet == NULL )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_OUT_OF_PACKETS
- );
-
- /*
- * Put in a default timeout that will be used for
- * all packets that do not otherwise have a timeout.
- */
-
- the_packet->timeout = MPCI_DEFAULT_TIMEOUT;
-
- return the_packet;
-}
-
-/*PAGE
- *
- * _MPCI_Return_packet
- *
- * This subprogram returns a packet by invoking the user provided
- * MPCI return packet callout.
- */
-
-void _MPCI_Return_packet (
- MP_packet_Prefix *the_packet
-)
-{
- (*_MPCI_table->return_packet)( the_packet );
-}
-
-/*PAGE
- *
- * _MPCI_Send_process_packet
- *
- * This subprogram sends a process packet by invoking the user provided
- * MPCI send callout.
- */
-
-void _MPCI_Send_process_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet
-)
-{
- the_packet->source_tid = _Thread_Executing->Object.id;
- the_packet->to_convert =
- ( the_packet->to_convert - sizeof(MP_packet_Prefix) ) /
- sizeof(unsigned32);
-
- (*_MPCI_table->send_packet)( destination, the_packet );
-}
-
-/*PAGE
- *
- * _MPCI_Send_request_packet
- *
- * This subprogram sends a request packet by invoking the user provided
- * MPCI send callout.
- */
-
-unsigned32 _MPCI_Send_request_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet,
- States_Control extra_state
-)
-{
- the_packet->source_tid = _Thread_Executing->Object.id;
- the_packet->source_priority = _Thread_Executing->current_priority;
- the_packet->to_convert =
- ( the_packet->to_convert - sizeof(MP_packet_Prefix) ) /
- sizeof(unsigned32);
-
- _Thread_Executing->Wait.id = the_packet->id;
-
- _Thread_Executing->Wait.queue = &_MPCI_Remote_blocked_threads;
-
- _Thread_Disable_dispatch();
-
- (*_MPCI_table->send_packet)( destination, the_packet );
-
- _Thread_queue_Enter_critical_section( &_MPCI_Remote_blocked_threads );
-
- /*
- * See if we need a default timeout
- */
-
- if (the_packet->timeout == MPCI_DEFAULT_TIMEOUT)
- the_packet->timeout = _MPCI_table->default_timeout;
-
- _Thread_queue_Enqueue( &_MPCI_Remote_blocked_threads, the_packet->timeout );
-
- _Thread_Executing->current_state =
- _States_Set( extra_state, _Thread_Executing->current_state );
-
- _Thread_Enable_dispatch();
-
- return _Thread_Executing->Wait.return_code;
-}
-
-/*PAGE
- *
- * _MPCI_Send_response_packet
- *
- * This subprogram sends a response packet by invoking the user provided
- * MPCI send callout.
- */
-
-void _MPCI_Send_response_packet (
- unsigned32 destination,
- MP_packet_Prefix *the_packet
-)
-{
- the_packet->source_tid = _Thread_Executing->Object.id;
-
- (*_MPCI_table->send_packet)( destination, the_packet );
-}
-
-/*PAGE
- *
- * _MPCI_Receive_packet
- *
- * This subprogram receives a packet by invoking the user provided
- * MPCI receive callout.
- */
-
-MP_packet_Prefix *_MPCI_Receive_packet ( void )
-{
- MP_packet_Prefix *the_packet;
-
- (*_MPCI_table->receive_packet)( &the_packet );
-
- return the_packet;
-}
-
-/*PAGE
- *
- * _MPCI_Process_response
- *
- * This subprogram obtains a packet by invoking the user provided
- * MPCI get packet callout.
- */
-
-Thread_Control *_MPCI_Process_response (
- MP_packet_Prefix *the_packet
-)
-{
- Thread_Control *the_thread;
- Objects_Locations location;
-
- the_thread = _Thread_Get( the_packet->id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE:
- the_thread = NULL; /* IMPOSSIBLE */
- break;
- case OBJECTS_LOCAL:
- _Thread_queue_Extract( &_MPCI_Remote_blocked_threads, the_thread );
- the_thread->Wait.return_code = the_packet->return_code;
- _Thread_Unnest_dispatch();
- break;
- }
-
- return the_thread;
-}
-
-/*PAGE
- *
- * _MPCI_Receive_server
- *
- */
-
-Thread _MPCI_Receive_server(
- unsigned32 ignored
-)
-{
-
- MP_packet_Prefix *the_packet;
- MPCI_Packet_processor the_function;
- Thread_Control *executing;
-
- executing = _Thread_Executing;
-
- for ( ; ; ) {
-
- executing->receive_packet = NULL;
-
- _Thread_Disable_dispatch();
- _CORE_semaphore_Seize( &_MPCI_Semaphore, 0, TRUE, WATCHDOG_NO_TIMEOUT );
- _Thread_Enable_dispatch();
-
- for ( ; ; ) {
- the_packet = _MPCI_Receive_packet();
-
- if ( !the_packet )
- break;
-
- executing->receive_packet = the_packet;
-
- if ( !_Mp_packet_Is_valid_packet_class ( the_packet->the_class ) )
- break;
-
- the_function = _MPCI_Packet_processors[ the_packet->the_class ];
-
- if ( !the_function )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_BAD_PACKET
- );
-
- (*the_function)( the_packet );
- }
- }
-}
-
-/*PAGE
- *
- * _MPCI_Announce
- *
- */
-
-void _MPCI_Announce ( void )
-{
- _Thread_Disable_dispatch();
- (void) _CORE_semaphore_Surrender( &_MPCI_Semaphore, 0, 0 );
- _Thread_Enable_dispatch();
-}
-
-/*PAGE
- *
- * _MPCI_Internal_packets_Send_process_packet
- *
- */
-
-void _MPCI_Internal_packets_Send_process_packet (
- MPCI_Internal_Remote_operations operation
-)
-{
- MPCI_Internal_packet *the_packet;
-
- switch ( operation ) {
-
- case MPCI_PACKETS_SYSTEM_VERIFY:
-
- the_packet = _MPCI_Internal_packets_Get_packet();
- the_packet->Prefix.the_class = MP_PACKET_MPCI_INTERNAL;
- the_packet->Prefix.length = sizeof ( MPCI_Internal_packet );
- the_packet->Prefix.to_convert = sizeof ( MPCI_Internal_packet );
- the_packet->operation = operation;
-
- the_packet->maximum_nodes = _Objects_Maximum_nodes;
-
- the_packet->maximum_global_objects = _Objects_MP_Maximum_global_objects;
-
- _MPCI_Send_process_packet( MPCI_ALL_NODES, &the_packet->Prefix );
- break;
- }
-}
-
-/*PAGE
- *
- * _MPCI_Internal_packets_Send_request_packet
- *
- * This subprogram is not needed since there are no request
- * packets to be sent by this manager.
- *
- */
-
-/*PAGE
- *
- * _MPCI_Internal_packets_Send_response_packet
- *
- * This subprogram is not needed since there are no response
- * packets to be sent by this manager.
- *
- */
-
-/*PAGE
- *
- *
- * _MPCI_Internal_packets_Process_packet
- *
- */
-
-void _MPCI_Internal_packets_Process_packet (
- MP_packet_Prefix *the_packet_prefix
-)
-{
- MPCI_Internal_packet *the_packet;
- unsigned32 maximum_nodes;
- unsigned32 maximum_global_objects;
-
- the_packet = (MPCI_Internal_packet *) the_packet_prefix;
-
- switch ( the_packet->operation ) {
-
- case MPCI_PACKETS_SYSTEM_VERIFY:
-
- maximum_nodes = the_packet->maximum_nodes;
- maximum_global_objects = the_packet->maximum_global_objects;
- if ( maximum_nodes != _Objects_Maximum_nodes ||
- maximum_global_objects != _Objects_MP_Maximum_global_objects ) {
-
- _MPCI_Return_packet( the_packet_prefix );
-
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION
- );
- }
-
- _MPCI_Return_packet( the_packet_prefix );
-
- break;
- }
-}
-
-/*PAGE
- *
- * _MPCI_Internal_packets_Send_object_was_deleted
- *
- * This subprogram is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*PAGE
- *
- * _MPCI_Internal_packets_Send_extract_proxy
- *
- * This subprogram is not needed since there are no objects
- * deleted by this manager.
- *
- */
-
-/*PAGE
- *
- * _MPCI_Internal_packets_Get_packet
- *
- */
-
-MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void )
-{
- return ( (MPCI_Internal_packet *) _MPCI_Get_packet() );
-}
-
-/* end of file */
diff --git a/cpukit/score/src/object.c b/cpukit/score/src/object.c
deleted file mode 100644
index 7585235d3b..0000000000
--- a/cpukit/score/src/object.c
+++ /dev/null
@@ -1,516 +0,0 @@
-/*
- * Object Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/object.h>
-#include <rtems/score/objectmp.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/sysstate.h>
-
-/*PAGE
- *
- * _Objects_Handler_initialization
- *
- * This routine initializes the object handler.
- *
- * Input parameters:
- * node - local node
- * maximum_nodes - number of nodes in the system
- * maximum_global_objects - number of configured global objects
- *
- * Output parameters: NONE
- */
-
-void _Objects_Handler_initialization(
- unsigned32 node,
- unsigned32 maximum_nodes,
- unsigned32 maximum_global_objects
-)
-{
- if ( node < 1 || node > maximum_nodes )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_INVALID_NODE
- );
-
- _Objects_Local_node = node;
- _Objects_Maximum_nodes = maximum_nodes;
-
- _Objects_MP_Handler_initialization(
- node,
- maximum_nodes,
- maximum_global_objects
- );
-}
-
-/*PAGE
- *
- * _Objects_Initialize_information
- *
- * This routine initializes all object information related data structures.
- *
- * Input parameters:
- * information - object information table
- * the_class - object class
- * supports_global - TRUE if this is a global object class
- * maximum - maximum objects of this class
- * is_string - TRUE if names for this object are strings
- * size - size of this object's control block
- * is_thread - TRUE if this class is threads
- *
- * Output parameters: NONE
- */
-
-void _Objects_Initialize_information(
- Objects_Information *information,
- Objects_Classes the_class,
- boolean supports_global,
- unsigned32 maximum,
- unsigned32 size,
- boolean is_string,
- unsigned32 maximum_name_length,
- boolean is_thread
-)
-{
- unsigned32 minimum_index;
- unsigned32 index;
- Objects_Control *the_object;
- unsigned32 name_length;
- void *name_area;
-
- information->maximum = maximum;
- information->the_class = the_class;
- information->is_string = is_string;
- information->is_thread = is_thread;
-
- /*
- * Set the entry in the object information table.
- */
-
- _Objects_Information_table[ the_class ] = information;
-
- /*
- * Calculate minimum and maximum Id's
- */
-
- if ( maximum == 0 ) minimum_index = 0;
- else minimum_index = 1;
-
- information->minimum_id =
- _Objects_Build_id( the_class, _Objects_Local_node, minimum_index );
-
- information->maximum_id =
- _Objects_Build_id( the_class, _Objects_Local_node, maximum );
-
- /*
- * Allocate local pointer table
- */
-
- information->local_table =
- (Objects_Control **) _Workspace_Allocate_or_fatal_error(
- (maximum + 1) * sizeof(Objects_Control *)
- );
-
- /*
- * Allocate name table
- */
-
- name_length = maximum_name_length;
-
- if (name_length & (OBJECTS_NAME_ALIGNMENT-1))
- name_length = (name_length + OBJECTS_NAME_ALIGNMENT) &
- ~(OBJECTS_NAME_ALIGNMENT-1);
-
- information->name_length = name_length;
-
- name_area = (Objects_Name *)
- _Workspace_Allocate_or_fatal_error( (maximum + 1) * name_length );
- information->name_table = name_area;
-
- /*
- * Initialize local pointer table
- */
-
- for ( index=0 ; index <= maximum ; index++ ) {
- information->local_table[ index ] = NULL;
- }
-
- /*
- * Initialize objects .. if there are any
- */
-
- if ( maximum == 0 ) {
- _Chain_Initialize_empty( &information->Inactive );
- } else {
-
- _Chain_Initialize(
- &information->Inactive,
- _Workspace_Allocate_or_fatal_error( maximum * size ),
- maximum,
- size
- );
-
- the_object = (Objects_Control *) information->Inactive.first;
- for ( index=1; index <= maximum ; index++ ) {
- the_object->id =
- _Objects_Build_id( the_class, _Objects_Local_node, index );
-
- the_object->name = (void *) name_area;
-
- name_area = _Addresses_Add_offset( name_area, name_length );
-
- the_object = (Objects_Control *) the_object->Node.next;
- }
-
- }
-
- /*
- * Take care of multiprocessing
- */
-
- if ( supports_global == TRUE && _System_state_Is_multiprocessing ) {
-
- information->global_table =
- (Chain_Control *) _Workspace_Allocate_or_fatal_error(
- (_Objects_Maximum_nodes + 1) * sizeof(Chain_Control)
- );
-
- for ( index=1; index <= _Objects_Maximum_nodes ; index++ )
- _Chain_Initialize_empty( &information->global_table[ index ] );
- }
- else
- information->global_table = NULL;
-}
-
-/*PAGE
- *
- * _Objects_Clear_name
- *
- * XXX
- */
-
-void _Objects_Clear_name(
- void *name,
- unsigned32 length
-)
-{
- unsigned32 index;
- unsigned32 maximum = length / OBJECTS_NAME_ALIGNMENT;
- unsigned32 *name_ptr = (unsigned32 *) name;
-
- for ( index=0 ; index < maximum ; index++ )
- *name_ptr++ = 0;
-}
-
-/*PAGE
- *
- * _Objects_Copy_name_string
- *
- * XXX
- */
-
-void _Objects_Copy_name_string(
- void *source,
- void *destination
-)
-{
- unsigned8 *source_p = (unsigned8 *) source;
- unsigned8 *destination_p = (unsigned8 *) destination;
-
- do {
- *destination_p++ = *source_p;
- } while ( *source_p++ );
-}
-
-/*PAGE
- *
- * _Objects_Copy_name_raw
- *
- * XXX
- */
-
-void _Objects_Copy_name_raw(
- void *source,
- void *destination,
- unsigned32 length
-)
-{
- unsigned32 *source_p = (unsigned32 *) source;
- unsigned32 *destination_p = (unsigned32 *) destination;
- unsigned32 tmp_length = length / OBJECTS_NAME_ALIGNMENT;
-
- while ( tmp_length-- )
- *destination_p++ = *source_p++;
-}
-
-/*PAGE
- *
- * _Objects_Compare_name_string
- *
- * XXX
- */
-
-boolean _Objects_Compare_name_string(
- void *name_1,
- void *name_2,
- unsigned32 length
-)
-{
- unsigned8 *name_1_p = (unsigned8 *) name_1;
- unsigned8 *name_2_p = (unsigned8 *) name_2;
- unsigned32 tmp_length = length;
-
- do {
- if ( *name_1_p++ != *name_2_p++ )
- return FALSE;
- if ( !tmp_length-- )
- return FALSE;
- } while ( *name_1_p );
-
- return TRUE;
-}
-
-/*PAGE
- *
- * _Objects_Compare_name_raw
- *
- * XXX
- */
-
-boolean _Objects_Compare_name_raw(
- void *name_1,
- void *name_2,
- unsigned32 length
-)
-{
- unsigned32 *name_1_p = (unsigned32 *) name_1;
- unsigned32 *name_2_p = (unsigned32 *) name_2;
- unsigned32 tmp_length = length / OBJECTS_NAME_ALIGNMENT;
-
- while ( tmp_length-- )
- if ( *name_1_p++ != *name_2_p++ )
- return FALSE;
-
- return TRUE;
-}
-
-
-/*PAGE
- *
- * _Objects_Name_to_id
- *
- * These kernel routines search the object table(s) for the given
- * object name and returns the associated object id.
- *
- * Input parameters:
- * information - object information
- * name - user defined object name
- * node - node indentifier (0 indicates any node)
- * id - address of return ID
- *
- * Output parameters:
- * id - object id
- * OBJECTS_SUCCESSFUL - if successful
- * error code - if unsuccessful
- */
-
-Objects_Name_to_id_errors _Objects_Name_to_id(
- Objects_Information *information,
- Objects_Name name,
- unsigned32 node,
- Objects_Id *id
-)
-{
- boolean search_local_node;
- Objects_Control **objects;
- Objects_Control *the_object;
- unsigned32 index;
- unsigned32 name_length;
- Objects_Name_comparators compare_them;
-
- if ( name == 0 )
- return OBJECTS_INVALID_NAME;
-
- search_local_node = FALSE;
-
- if ( information->maximum != 0 &&
- (node == OBJECTS_SEARCH_ALL_NODES || node == OBJECTS_SEARCH_LOCAL_NODE ||
- _Objects_Is_local_node( node ) ) )
- search_local_node = TRUE;
-
- if ( search_local_node ) {
- objects = information->local_table;
-
- name_length = information->name_length;
-
- if ( information->is_string ) compare_them = _Objects_Compare_name_string;
- else compare_them = _Objects_Compare_name_raw;
-
- for ( index = 1; index <= information->maximum; index++ ) {
-
- the_object = objects[ index ];
-
- if ( !the_object || !the_object->name )
- continue;
-
- if ( (*compare_them)( name, the_object->name, name_length ) ) {
- *id = the_object->id;
- return OBJECTS_SUCCESSFUL;
- }
- }
- }
-
- if ( _Objects_Is_local_node( node ) || node == OBJECTS_SEARCH_LOCAL_NODE )
- return OBJECTS_INVALID_NAME;
-
- return ( _Objects_MP_Global_name_search( information, name, node, id ) );
-}
-
-/*PAGE
- *
- * _Objects_Get
- *
- * This routine sets the object pointer for the given
- * object id based on the given object information structure.
- *
- * Input parameters:
- * information - pointer to entry in table for this class
- * id - object id to search for
- * location - address of where to store the location
- *
- * Output parameters:
- * returns - address of object if local
- * location - one of the following:
- * OBJECTS_ERROR - invalid object ID
- * OBJECTS_REMOTE - remote object
- * OBJECTS_LOCAL - local object
- */
-
-Objects_Control *_Objects_Get(
- Objects_Information *information,
- Objects_Id id,
- Objects_Locations *location
-)
-{
- Objects_Control *the_object;
- unsigned32 index;
-
- index = id - information->minimum_id;
-
- if ( information->maximum >= index ) {
- _Thread_Disable_dispatch();
- if ( (the_object = information->local_table[index+1]) != NULL ) {
- *location = OBJECTS_LOCAL;
- return( the_object );
- }
- _Thread_Enable_dispatch();
- *location = OBJECTS_ERROR;
- return( NULL );
- }
- *location = OBJECTS_ERROR;
- _Objects_MP_Is_remote( information, id, location, &the_object );
- return the_object;
-}
-
-
-/*PAGE
- *
- * _Objects_Get_next
- *
- * Like _Objects_Get, but considers the 'id' as a "hint" and
- * finds next valid one after that point.
- * Mostly used for monitor and debug traversal of an object.
- *
- * Input parameters:
- * information - pointer to entry in table for this class
- * id - object id to search for
- * location - address of where to store the location
- * next_id - address to store next id to try
- *
- * Output parameters:
- * returns - address of object if local
- * location - one of the following:
- * OBJECTS_ERROR - invalid object ID
- * OBJECTS_REMOTE - remote object
- * OBJECTS_LOCAL - local object
- * next_id - will contain a reasonable "next" id to continue traversal
- *
- * NOTE:
- * assumes can add '1' to an id to get to next index.
- */
-
-Objects_Control *
-_Objects_Get_next(
- Objects_Information *information,
- Objects_Id id,
- Objects_Locations *location_p,
- Objects_Id *next_id_p
-)
-{
- Objects_Control *object;
- Objects_Id next_id;
-
- if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX)
- next_id = information->minimum_id;
- else
- next_id = id;
-
- do {
- /* walked off end of list? */
- if (_Objects_Get_index(next_id) > information->maximum)
- {
- *location_p = OBJECTS_ERROR;
- goto final;
- }
-
- /* try to grab one */
- object = _Objects_Get(information, next_id, location_p);
-
- next_id++;
-
- } while (*location_p != OBJECTS_LOCAL);
-
- *next_id_p = next_id;
- return object;
-
-final:
- *next_id_p = OBJECTS_ID_FINAL;
- return 0;
-}
-
-/*PAGE
- *
- * _Objects_Get_information
- *
- * XXX
- */
-
-Objects_Information *_Objects_Get_information(
- Objects_Id id
-)
-{
- Objects_Classes the_class;
-
- the_class = _Objects_Get_class( id );
-
- if ( !_Objects_Is_class_valid( the_class ) )
- return NULL;
-
- return _Objects_Information_table[ the_class ];
-}
-
diff --git a/cpukit/score/src/objectmp.c b/cpukit/score/src/objectmp.c
deleted file mode 100644
index 62f7fb5285..0000000000
--- a/cpukit/score/src/objectmp.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Multiprocessing Support for the Object Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/object.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/thread.h>
-
-/*PAGE
- *
- * _Objects_MP_Handler_initialization
- *
- */
-
-void _Objects_MP_Handler_initialization (
- unsigned32 node,
- unsigned32 maximum_nodes,
- unsigned32 maximum_global_objects
-)
-{
- _Objects_MP_Maximum_global_objects = maximum_global_objects;
-
- if ( maximum_global_objects == 0 ) {
- _Chain_Initialize_empty( &_Objects_MP_Inactive_global_objects );
- return;
- }
-
- _Chain_Initialize(
- &_Objects_MP_Inactive_global_objects,
- _Workspace_Allocate_or_fatal_error(
- maximum_global_objects * sizeof( Objects_MP_Control )
- ),
- maximum_global_objects,
- sizeof( Objects_MP_Control )
- );
-
-}
-
-/*PAGE
- *
- * _Objects_MP_Open
- *
- */
-
-void _Objects_MP_Open (
- Objects_Information *information,
- Objects_MP_Control *the_global_object,
- unsigned32 the_name, /* XXX -- wrong for variable */
- Objects_Id the_id
-)
-{
- the_global_object->Object.id = the_id;
- the_global_object->name = the_name;
-
- _Chain_Prepend(
- &information->global_table[ _Objects_Get_node( the_id ) ],
- &the_global_object->Object.Node
- );
-
-}
-
-/*PAGE
- *
- * _Objects_MP_Allocate_and_open
- *
- */
-
-boolean _Objects_MP_Allocate_and_open (
- Objects_Information *information,
- unsigned32 the_name, /* XXX -- wrong for variable */
- Objects_Id the_id,
- boolean is_fatal_error
-)
-{
- Objects_MP_Control *the_global_object;
-
- the_global_object = _Objects_MP_Allocate_global_object();
- if ( _Objects_MP_Is_null_global_object( the_global_object ) ) {
-
- if ( is_fatal_error == FALSE )
- return FALSE;
-
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS
- );
-
- }
-
- _Objects_MP_Open( information, the_global_object, the_name, the_id );
-
- return TRUE;
-}
-
-/*PAGE
- *
- * _Objects_MP_Close
- *
- */
-
-void _Objects_MP_Close (
- Objects_Information *information,
- Objects_Id the_id
-)
-{
- Chain_Control *the_chain;
- Chain_Node *the_node;
- Objects_MP_Control *the_object;
-
- the_chain = &information->global_table[ _Objects_Get_node( the_id ) ];
-
- for ( the_node = the_chain->first ;
- !_Chain_Is_tail( the_chain, the_node ) ;
- the_node = the_node->next ) {
-
- the_object = (Objects_MP_Control *) the_node;
-
- if ( _Objects_Are_ids_equal( the_object->Object.id, the_id ) ) {
-
- _Chain_Extract( the_node );
- _Objects_MP_Free_global_object( the_object );
- return;
- }
-
- }
-
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_INVALID_GLOBAL_ID
- );
-}
-
-/*PAGE
- *
- * _Objects_MP_Global_name_search
- *
- */
-
-Objects_Name_to_id_errors _Objects_MP_Global_name_search (
- Objects_Information *information,
- Objects_Name the_name,
- unsigned32 nodes_to_search,
- Objects_Id *the_id
-)
-{
- unsigned32 low_node;
- unsigned32 high_node;
- unsigned32 node_index;
- Chain_Control *the_chain;
- Chain_Node *the_node;
- Objects_MP_Control *the_object;
- unsigned32 name_to_use = *(unsigned32 *)the_name; /* XXX variable */
-
- if ( nodes_to_search > _Objects_Maximum_nodes )
- return OBJECTS_INVALID_NODE;
-
- if ( information->global_table == NULL )
- return OBJECTS_INVALID_NAME;
-
- if ( nodes_to_search == OBJECTS_SEARCH_ALL_NODES ||
- nodes_to_search == OBJECTS_SEARCH_OTHER_NODES ) {
- low_node = 1;
- high_node = _Objects_Maximum_nodes;
- } else {
- low_node =
- high_node = nodes_to_search;
- }
-
- _Thread_Disable_dispatch();
-
- for ( node_index = low_node ; node_index <= high_node ; node_index++ ) {
-
- /*
- * NOTE: The local node was search (if necessary) by
- * _Objects_Name_to_id before this was invoked.
- */
-
- if ( !_Objects_Is_local_node( node_index ) ) {
- the_chain = &information->global_table[ node_index ];
-
- for ( the_node = the_chain->first ;
- !_Chain_Is_tail( the_chain, the_node ) ;
- the_node = the_node->next ) {
-
- the_object = (Objects_MP_Control *) the_node;
-
- if ( the_object->name == name_to_use ) {
- *the_id = the_object->Object.id;
- _Thread_Enable_dispatch();
- return OBJECTS_SUCCESSFUL;
- }
- }
- }
- }
-
- _Thread_Enable_dispatch();
- return OBJECTS_INVALID_NAME;
-}
-
-/*PAGE
- *
- * _Objects_MP_Is_remote
- *
- */
-
-void _Objects_MP_Is_remote (
- Objects_Information *information,
- Objects_Id the_id,
- Objects_Locations *location,
- Objects_Control **the_object
-)
-{
- unsigned32 node;
- Chain_Control *the_chain;
- Chain_Node *the_node;
- Objects_MP_Control *the_global_object;
-
- node = _Objects_Get_node( the_id );
-
- /*
- * NOTE: The local node was search (if necessary) by
- * _Objects_Name_to_id before this was invoked.
- *
- * The NODE field of an object id cannot be 0
- * because 0 is an invalid node number.
- */
-
- if ( node == 0 ||
- _Objects_Is_local_node( node ) ||
- node > _Objects_Maximum_nodes ||
- information->global_table == NULL ) {
-
- *location = OBJECTS_ERROR;
- *the_object = NULL;
- return;
- }
-
- _Thread_Disable_dispatch();
-
- the_chain = &information->global_table[ node ];
-
- for ( the_node = the_chain->first ;
- !_Chain_Is_tail( the_chain, the_node ) ;
- the_node = the_node->next ) {
-
- the_global_object = (Objects_MP_Control *) the_node;
-
- if ( _Objects_Are_ids_equal( the_global_object->Object.id, the_id ) ) {
- _Thread_Unnest_dispatch();
- *location = OBJECTS_REMOTE;
- *the_object = (Objects_Control *) the_global_object;
- return;
- }
- }
-
- _Thread_Enable_dispatch();
- *location = OBJECTS_ERROR;
- *the_object = NULL;
-
-}
diff --git a/cpukit/score/src/thread.c b/cpukit/score/src/thread.c
deleted file mode 100644
index 4e44ac6f75..0000000000
--- a/cpukit/score/src/thread.c
+++ /dev/null
@@ -1,1396 +0,0 @@
-/*
- * Thread Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <rtems/system.h>
-#include <rtems/score/apiext.h>
-#include <rtems/score/context.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/states.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/userext.h>
-#include <rtems/score/wkspace.h>
-
-/*PAGE
- *
- * _Thread_Handler_initialization
- *
- * This routine initializes all thread manager related data structures.
- *
- * Input parameters:
- * ticks_per_timeslice - clock ticks per quantum
- * maximum_proxies - number of proxies to initialize
- *
- * Output parameters: NONE
- */
-
-char *_Thread_Idle_name = "IDLE";
-
-void _Thread_Handler_initialization(
- unsigned32 ticks_per_timeslice,
- unsigned32 maximum_extensions,
- unsigned32 maximum_proxies
-)
-{
- unsigned32 index;
-
- /*
- * BOTH stacks hooks must be set or both must be NULL.
- * Do not allow mixture.
- */
-
- if ( !( ( _CPU_Table.stack_allocate_hook == 0 )
- == ( _CPU_Table.stack_free_hook == 0 ) ) )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_BAD_STACK_HOOK
- );
-
- _Context_Switch_necessary = FALSE;
- _Thread_Executing = NULL;
- _Thread_Heir = NULL;
- _Thread_Allocated_fp = NULL;
-
- _Thread_Do_post_task_switch_extension = 0;
-
- _Thread_Maximum_extensions = maximum_extensions;
-
- _Thread_Ticks_per_timeslice = ticks_per_timeslice;
-
- _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error(
- (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control)
- );
-
- for ( index=0; index <= PRIORITY_MAXIMUM ; index++ )
- _Chain_Initialize_empty( &_Thread_Ready_chain[ index ] );
-
- _Thread_MP_Handler_initialization( maximum_proxies );
-
- /*
- * Initialize this class of objects.
- */
-
- _Objects_Initialize_information(
- &_Thread_Internal_information,
- OBJECTS_INTERNAL_THREADS,
- FALSE,
- ( _System_state_Is_multiprocessing ) ? 2 : 1,
- sizeof( Thread_Control ),
- TRUE,
- 8,
- TRUE
- );
-
-}
-
-/*PAGE
- *
- * _Thread_Create_idle
- */
-
-void _Thread_Create_idle( void )
-{
- void *idle;
- unsigned32 idle_task_stack_size;
-
- /*
- * The entire workspace is zeroed during its initialization. Thus, all
- * fields not explicitly assigned were explicitly zeroed by
- * _Workspace_Initialization.
- */
-
- _Thread_Idle = _Thread_Internal_allocate();
-
- /*
- * Initialize the IDLE task.
- */
-
-#if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
- idle = (void *) _CPU_Thread_Idle_body;
-#else
- idle = (void *) _Thread_Idle_body;
-#endif
-
- if ( _CPU_Table.idle_task )
- idle = _CPU_Table.idle_task;
-
- idle_task_stack_size = _CPU_Table.idle_task_stack_size;
- if ( idle_task_stack_size < STACK_MINIMUM_SIZE )
- idle_task_stack_size = STACK_MINIMUM_SIZE;
-
- _Thread_Initialize(
- &_Thread_Internal_information,
- _Thread_Idle,
- NULL, /* allocate the stack */
- idle_task_stack_size,
- CPU_IDLE_TASK_IS_FP,
- PRIORITY_MAXIMUM,
- TRUE, /* preemptable */
- THREAD_CPU_BUDGET_ALGORITHM_NONE,
- NULL, /* no budget algorithm callout */
- 0, /* all interrupts enabled */
- _Thread_Idle_name
- );
-
- /*
- * WARNING!!! This is necessary to "kick" start the system and
- * MUST be done before _Thread_Start is invoked.
- */
-
- _Thread_Heir =
- _Thread_Executing = _Thread_Idle;
-
- _Thread_Start(
- _Thread_Idle,
- THREAD_START_NUMERIC,
- idle,
- NULL,
- 0
- );
-
-}
-
-/*PAGE
- *
- * _Thread_Start_multitasking
- *
- * This kernel routine readies the requested thread, the thread chain
- * is adjusted. A new heir thread may be selected.
- *
- * Input parameters:
- * system_thread - pointer to system initialization thread control block
- * idle_thread - pointer to idle thread control block
- *
- * Output parameters: NONE
- *
- * NOTE: This routine uses the "blocking" heir selection mechanism.
- * This insures the correct heir after a thread restart.
- *
- * INTERRUPT LATENCY:
- * ready chain
- * select heir
- */
-
-void _Thread_Start_multitasking( void )
-{
- /*
- * The system is now multitasking and completely initialized.
- * This system thread now either "goes away" in a single processor
- * system or "turns into" the server thread in an MP system.
- */
-
- _System_state_Set( SYSTEM_STATE_UP );
-
- _Context_Switch_necessary = FALSE;
-
- _Thread_Executing = _Thread_Heir;
-
- /*
- * Get the init task(s) running.
- *
- * Note: Thread_Dispatch() is normally used to dispatch threads. As
- * part of its work, Thread_Dispatch() restores floating point
- * state for the heir task.
- *
- * This code avoids Thread_Dispatch(), and so we have to restore
- * (actually initialize) the floating point state "by hand".
- *
- * Ignore the CPU_USE_DEFERRED_FP_SWITCH because we must always
- * switch in the first thread if it is FP.
- */
-
-
-#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
- /*
- * don't need to worry about saving BSP's floating point state
- */
-
- if ( _Thread_Heir->fp_context != NULL )
- _Context_Restore_fp( &_Thread_Heir->fp_context );
-#endif
-
- _Context_Switch( &_Thread_BSP_context, &_Thread_Heir->Registers );
-}
-
-/*PAGE
- *
- * _Thread_Dispatch
- *
- * This kernel routine determines if a dispatch is needed, and if so
- * dispatches to the heir thread. Once the heir is running an attempt
- * is made to dispatch any ASRs.
- *
- * ALTERNATE ENTRY POINTS:
- * void _Thread_Enable_dispatch();
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * dispatch thread
- * no dispatch thread
- */
-
-#if ( CPU_INLINE_ENABLE_DISPATCH == FALSE )
-void _Thread_Enable_dispatch( void )
-{
- if ( --_Thread_Dispatch_disable_level )
- return;
- _Thread_Dispatch();
-}
-#endif
-
-void _Thread_Dispatch( void )
-{
- Thread_Control *executing;
- Thread_Control *heir;
- ISR_Level level;
-
- executing = _Thread_Executing;
- _ISR_Disable( level );
- while ( _Context_Switch_necessary == TRUE ) {
- heir = _Thread_Heir;
- _Thread_Dispatch_disable_level = 1;
- _Context_Switch_necessary = FALSE;
- _Thread_Executing = heir;
- _ISR_Enable( level );
-
- heir->ticks_executed++;
-
- _User_extensions_Thread_switch( executing, heir );
-
- if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE )
- heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
-
- /*
- * If the CPU has hardware floating point, then we must address saving
- * and restoring it as part of the context switch.
- *
- * The second conditional compilation section selects the algorithm used
- * to context switch between floating point tasks. The deferred algorithm
- * can be significantly better in a system with few floating point tasks
- * because it reduces the total number of save and restore FP context
- * operations. However, this algorithm can not be used on all CPUs due
- * to unpredictable use of FP registers by some compilers for integer
- * operations.
- */
-
-#if ( CPU_HARDWARE_FP == TRUE )
-#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
- if ( (heir->fp_context != NULL) && !_Thread_Is_allocated_fp( heir ) ) {
- if ( _Thread_Allocated_fp != NULL )
- _Context_Save_fp( &_Thread_Allocated_fp->fp_context );
- _Context_Restore_fp( &heir->fp_context );
- _Thread_Allocated_fp = heir;
- }
-#else
- if ( executing->fp_context != NULL )
- _Context_Save_fp( &executing->fp_context );
-
- if ( heir->fp_context != NULL )
- _Context_Restore_fp( &heir->fp_context );
-#endif
-#endif
-
- _Context_Switch( &executing->Registers, &heir->Registers );
-
- executing = _Thread_Executing;
-
- _ISR_Disable( level );
- }
-
- _Thread_Dispatch_disable_level = 0;
-
- _ISR_Enable( level );
-
- if ( _Thread_Do_post_task_switch_extension ||
- executing->do_post_task_switch_extension ) {
- executing->do_post_task_switch_extension = FALSE;
- _API_extensions_Run_postswitch();
- }
-
-}
-
-/*PAGE
- *
- * _Thread_Stack_Allocate
- *
- * Allocate the requested stack space for the thread.
- * return the actual size allocated after any adjustment
- * or return zero if the allocation failed.
- * Set the Start.stack field to the address of the stack
- */
-
-static unsigned32 _Thread_Stack_Allocate(
- Thread_Control *the_thread,
- unsigned32 stack_size)
-{
- void *stack_addr = 0;
-
- if ( !_Stack_Is_enough( stack_size ) )
- stack_size = STACK_MINIMUM_SIZE;
-
- /*
- * Call ONLY the CPU table stack allocate hook, _or_ the
- * the RTEMS workspace allocate. This is so the stack free
- * routine can call the correct deallocation routine.
- */
-
- if ( _CPU_Table.stack_allocate_hook )
- {
- stack_addr = (*_CPU_Table.stack_allocate_hook)( stack_size );
- } else {
-
- /*
- * First pad the requested size so we allocate enough memory
- * so the context initialization can align it properly. The address
- * returned the workspace allocate must be directly stored in the
- * stack control block because it is later used in the free sequence.
- *
- * Thus it is the responsibility of the CPU dependent code to
- * get and keep the stack adjust factor, the stack alignment, and
- * the context initialization sequence in sync.
- */
-
- stack_size = _Stack_Adjust_size( stack_size );
- stack_addr = _Workspace_Allocate( stack_size );
- }
-
- if ( !stack_addr )
- stack_size = 0;
-
- the_thread->Start.stack = stack_addr;
-
- return stack_size;
-}
-
-/*
- * _Thread_Stack_Free
- *
- * Deallocate the Thread's stack.
- */
-
-static void _Thread_Stack_Free(
- Thread_Control *the_thread
-)
-{
- /*
- * If the API provided the stack space, then don't free it.
- */
-
- if ( !the_thread->Start.core_allocated_stack )
- return;
-
- /*
- * Call ONLY the CPU table stack free hook, or the
- * the RTEMS workspace free. This is so the free
- * routine properly matches the allocation of the stack.
- */
-
- if ( _CPU_Table.stack_free_hook )
- (*_CPU_Table.stack_free_hook)( the_thread->Start.Initial_stack.area );
- else
- _Workspace_Free( the_thread->Start.Initial_stack.area );
-}
-
-/*PAGE
- *
- * _Thread_Initialize
- *
- * XXX
- */
-
-boolean _Thread_Initialize(
- Objects_Information *information,
- Thread_Control *the_thread,
- void *stack_area,
- unsigned32 stack_size,
- boolean is_fp,
- Priority_Control priority,
- boolean is_preemptible,
- Thread_CPU_budget_algorithms budget_algorithm,
- Thread_CPU_budget_algorithm_callout budget_callout,
- unsigned32 isr_level,
- Objects_Name name
-)
-{
- unsigned32 actual_stack_size = 0;
- void *stack = NULL;
- void *fp_area;
- void *extensions_area;
-
- /*
- * Allocate and Initialize the stack for this thread.
- */
-
-
- if ( !stack_area ) {
- if ( !_Stack_Is_enough( stack_size ) )
- actual_stack_size = STACK_MINIMUM_SIZE;
- else
- actual_stack_size = stack_size;
-
- actual_stack_size = _Thread_Stack_Allocate( the_thread, actual_stack_size );
-
- if ( !actual_stack_size )
- return FALSE; /* stack allocation failed */
-
- stack = the_thread->Start.stack;
- the_thread->Start.core_allocated_stack = TRUE;
- } else {
- stack = stack_area;
- actual_stack_size = stack_size;
- the_thread->Start.core_allocated_stack = FALSE;
- }
-
- _Stack_Initialize(
- &the_thread->Start.Initial_stack,
- stack,
- actual_stack_size
- );
-
- /*
- * Allocate the floating point area for this thread
- */
-
- if ( is_fp ) {
-
- fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE );
- if ( !fp_area ) {
- _Thread_Stack_Free( the_thread );
- return FALSE;
- }
- fp_area = _Context_Fp_start( fp_area, 0 );
-
- } else
- fp_area = NULL;
-
- the_thread->fp_context = fp_area;
- the_thread->Start.fp_context = fp_area;
-
- /*
- * Allocate the extensions area for this thread
- */
-
- if ( _Thread_Maximum_extensions ) {
- extensions_area = _Workspace_Allocate(
- (_Thread_Maximum_extensions + 1) * sizeof( void * )
- );
-
- if ( !extensions_area ) {
- if ( fp_area )
- (void) _Workspace_Free( fp_area );
-
- _Thread_Stack_Free( the_thread );
-
- return FALSE;
- }
- } else
- extensions_area = NULL;
-
- the_thread->extensions = (void **) extensions_area;
-
- /*
- * General initialization
- */
-
- the_thread->Start.is_preemptible = is_preemptible;
- the_thread->Start.budget_algorithm = budget_algorithm;
- the_thread->Start.budget_callout = budget_callout;
- the_thread->Start.isr_level = isr_level;
-
- the_thread->current_state = STATES_DORMANT;
- the_thread->resource_count = 0;
- the_thread->real_priority = priority;
- the_thread->Start.initial_priority = priority;
- the_thread->ticks_executed = 0;
-
- _Thread_Set_priority( the_thread, priority );
-
- /*
- * Open the object
- */
-
- _Objects_Open( information, &the_thread->Object, name );
-
- /*
- * Invoke create extensions
- */
-
- if ( !_User_extensions_Thread_create( the_thread ) ) {
-
- if ( extensions_area )
- (void) _Workspace_Free( extensions_area );
-
- if ( fp_area )
- (void) _Workspace_Free( fp_area );
-
- _Thread_Stack_Free( the_thread );
-
- return FALSE;
- }
-
- return TRUE;
-
-}
-
-/*
- * _Thread_Start
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-boolean _Thread_Start(
- Thread_Control *the_thread,
- Thread_Start_types the_prototype,
- void *entry_point,
- void *pointer_argument,
- unsigned32 numeric_argument
-)
-{
- if ( _States_Is_dormant( the_thread->current_state ) ) {
-
- the_thread->Start.entry_point = (Thread_Entry) entry_point;
-
- the_thread->Start.prototype = the_prototype;
- the_thread->Start.pointer_argument = pointer_argument;
- the_thread->Start.numeric_argument = numeric_argument;
-
- _Thread_Load_environment( the_thread );
-
- _Thread_Ready( the_thread );
-
- _User_extensions_Thread_start( the_thread );
-
- return TRUE;
- }
-
- return FALSE;
-
-}
-
-/*
- * _Thread_Restart
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-boolean _Thread_Restart(
- Thread_Control *the_thread,
- void *pointer_argument,
- unsigned32 numeric_argument
-)
-{
- if ( !_States_Is_dormant( the_thread->current_state ) ) {
-
- _Thread_Set_transient( the_thread );
- the_thread->resource_count = 0;
- the_thread->is_preemptible = the_thread->Start.is_preemptible;
- the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
- the_thread->budget_callout = the_thread->Start.budget_callout;
-
- the_thread->Start.pointer_argument = pointer_argument;
- the_thread->Start.numeric_argument = numeric_argument;
-
- if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
-
- if ( _Watchdog_Is_active( &the_thread->Timer ) )
- (void) _Watchdog_Remove( &the_thread->Timer );
- }
-
- if ( the_thread->current_priority != the_thread->Start.initial_priority ) {
- the_thread->real_priority = the_thread->Start.initial_priority;
- _Thread_Set_priority( the_thread, the_thread->Start.initial_priority );
- }
-
- _Thread_Load_environment( the_thread );
-
- _Thread_Ready( the_thread );
-
- _User_extensions_Thread_restart( the_thread );
-
- if ( _Thread_Is_executing ( the_thread ) )
- _Thread_Restart_self();
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-/*
- * _Thread_Close
- *
- * DESCRIPTION:
- *
- * XXX
- */
-
-void _Thread_Close(
- Objects_Information *information,
- Thread_Control *the_thread
-)
-{
- _Objects_Close( information, &the_thread->Object );
-
- _Thread_Set_state( the_thread, STATES_TRANSIENT );
-
- if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
-
- if ( _Watchdog_Is_active( &the_thread->Timer ) )
- (void) _Watchdog_Remove( &the_thread->Timer );
- }
-
- _User_extensions_Thread_delete( the_thread );
-
-#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
- if ( _Thread_Is_allocated_fp( the_thread ) )
- _Thread_Deallocate_fp();
-#endif
- the_thread->fp_context = NULL;
-
- if ( the_thread->Start.fp_context )
- (void) _Workspace_Free( the_thread->Start.fp_context );
-
- _Thread_Stack_Free( the_thread );
-
- if ( the_thread->extensions )
- (void) _Workspace_Free( the_thread->extensions );
-
- the_thread->Start.stack = NULL;
- the_thread->extensions = NULL;
-}
-
-/*PAGE
- *
- * _Thread_Ready
- *
- * This kernel routine readies the requested thread, the thread chain
- * is adjusted. A new heir thread may be selected.
- *
- * Input parameters:
- * the_thread - pointer to thread control block
- *
- * Output parameters: NONE
- *
- * NOTE: This routine uses the "blocking" heir selection mechanism.
- * This insures the correct heir after a thread restart.
- *
- * INTERRUPT LATENCY:
- * ready chain
- * select heir
- */
-
-void _Thread_Ready(
- Thread_Control *the_thread
-)
-{
- ISR_Level level;
- Thread_Control *heir;
-
- _ISR_Disable( level );
-
- the_thread->current_state = STATES_READY;
-
- _Priority_Add_to_bit_map( &the_thread->Priority_map );
-
- _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
-
- _ISR_Flash( level );
-
- _Thread_Calculate_heir();
-
- heir = _Thread_Heir;
-
- if ( !_Thread_Is_executing( heir ) && _Thread_Executing->is_preemptible )
- _Context_Switch_necessary = TRUE;
-
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Thread_Clear_state
- *
- * This kernel routine clears the appropriate states in the
- * requested thread. The thread ready chain is adjusted if
- * necessary and the Heir thread is set accordingly.
- *
- * Input parameters:
- * the_thread - pointer to thread control block
- * state - state set to clear
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * priority map
- * select heir
- */
-
-
-void _Thread_Clear_state(
- Thread_Control *the_thread,
- States_Control state
-)
-{
- ISR_Level level;
- States_Control current_state;
-
- _ISR_Disable( level );
- current_state = the_thread->current_state;
-
- if ( current_state & state ) {
- current_state =
- the_thread->current_state = _States_Clear( state, current_state );
-
- if ( _States_Is_ready( current_state ) ) {
-
- _Priority_Add_to_bit_map( &the_thread->Priority_map );
-
- _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node);
-
- _ISR_Flash( level );
-
- if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
- _Thread_Heir = the_thread;
- if ( _Thread_Executing->is_preemptible ||
- the_thread->current_priority == 0 )
- _Context_Switch_necessary = TRUE;
- }
- }
- }
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Thread_Set_state
- *
- * This kernel routine sets the requested state in the THREAD. The
- * THREAD chain is adjusted if necessary.
- *
- * Input parameters:
- * the_thread - pointer to thread control block
- * state - state to be set
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * ready chain
- * select map
- */
-
-void _Thread_Set_state(
- Thread_Control *the_thread,
- States_Control state
-)
-{
- ISR_Level level;
- Chain_Control *ready;
-
- ready = the_thread->ready;
- _ISR_Disable( level );
- if ( !_States_Is_ready( the_thread->current_state ) ) {
- the_thread->current_state =
- _States_Set( state, the_thread->current_state );
- _ISR_Enable( level );
- return;
- }
-
- the_thread->current_state = state;
-
- if ( _Chain_Has_only_one_node( ready ) ) {
-
- _Chain_Initialize_empty( ready );
- _Priority_Remove_from_bit_map( &the_thread->Priority_map );
-
- } else
- _Chain_Extract_unprotected( &the_thread->Object.Node );
-
- _ISR_Flash( level );
-
- if ( _Thread_Is_heir( the_thread ) )
- _Thread_Calculate_heir();
-
- if ( _Thread_Is_executing( the_thread ) )
- _Context_Switch_necessary = TRUE;
-
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Thread_Set_transient
- *
- * This kernel routine places the requested thread in the transient state
- * which will remove it from the ready queue, if necessary. No
- * rescheduling is necessary because it is assumed that the transient
- * state will be cleared before dispatching is enabled.
- *
- * Input parameters:
- * the_thread - pointer to thread control block
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-void _Thread_Set_transient(
- Thread_Control *the_thread
-)
-{
- ISR_Level level;
- unsigned32 old_state;
- Chain_Control *ready;
-
- ready = the_thread->ready;
- _ISR_Disable( level );
-
- old_state = the_thread->current_state;
- the_thread->current_state = _States_Set( STATES_TRANSIENT, old_state );
-
- if ( _States_Is_ready( old_state ) ) {
- if ( _Chain_Has_only_one_node( ready ) ) {
-
- _Chain_Initialize_empty( ready );
- _Priority_Remove_from_bit_map( &the_thread->Priority_map );
-
- } else
- _Chain_Extract_unprotected( &the_thread->Object.Node );
- }
-
- _ISR_Enable( level );
-
-}
-
-/*PAGE
- *
- * _Thread_Reset_timeslice
- *
- * This routine will remove the running thread from the ready chain
- * and place it immediately at the rear of this chain and then the
- * timeslice counter is reset. The heir THREAD will be updated if
- * the running is also the currently the heir.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * ready chain
- * select heir
- */
-
-void _Thread_Reset_timeslice( void )
-{
- ISR_Level level;
- Thread_Control *executing;
- Chain_Control *ready;
-
- executing = _Thread_Executing;
- ready = executing->ready;
- _ISR_Disable( level );
- if ( _Chain_Has_only_one_node( ready ) ) {
- _ISR_Enable( level );
- return;
- }
- _Chain_Extract_unprotected( &executing->Object.Node );
- _Chain_Append_unprotected( ready, &executing->Object.Node );
-
- _ISR_Flash( level );
-
- if ( _Thread_Is_heir( executing ) )
- _Thread_Heir = (Thread_Control *) ready->first;
-
- _Context_Switch_necessary = TRUE;
-
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Thread_Tickle_timeslice
- *
- * This scheduler routine determines if timeslicing is enabled
- * for the currently executing thread and, if so, updates the
- * timeslice count and checks for timeslice expiration.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _Thread_Tickle_timeslice( void )
-{
- Thread_Control *executing;
-
- executing = _Thread_Executing;
-
- /*
- * Increment the number of ticks this thread has been executing
- */
-
- executing->ticks_executed++;
-
- /*
- * If the thread is not preemptible or is not ready, then
- * just return.
- */
-
- if ( !executing->is_preemptible )
- return;
-
- if ( !_States_Is_ready( executing->current_state ) )
- return;
-
- /*
- * The cpu budget algorithm determines what happens next.
- */
-
- switch ( executing->budget_algorithm ) {
- case THREAD_CPU_BUDGET_ALGORITHM_NONE:
- break;
-
- case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
- case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
- if ( --executing->cpu_time_budget == 0 ) {
- _Thread_Reset_timeslice();
- executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
- }
- break;
-
- case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
- if ( --executing->cpu_time_budget == 0 )
- (*executing->budget_callout)( executing );
- break;
- }
-}
-
-/*PAGE
- *
- * _Thread_Yield_processor
- *
- * This kernel routine will remove the running THREAD from the ready chain
- * and place it immediatly at the rear of this chain. Reset timeslice
- * and yield the processor functions both use this routine, therefore if
- * reset is TRUE and this is the only thread on the chain then the
- * timeslice counter is reset. The heir THREAD will be updated if the
- * running is also the currently the heir.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * ready chain
- * select heir
- */
-
-void _Thread_Yield_processor( void )
-{
- ISR_Level level;
- Thread_Control *executing;
- Chain_Control *ready;
-
- executing = _Thread_Executing;
- ready = executing->ready;
- _ISR_Disable( level );
- if ( !_Chain_Has_only_one_node( ready ) ) {
- _Chain_Extract_unprotected( &executing->Object.Node );
- _Chain_Append_unprotected( ready, &executing->Object.Node );
-
- _ISR_Flash( level );
-
- if ( _Thread_Is_heir( executing ) )
- _Thread_Heir = (Thread_Control *) ready->first;
- _Context_Switch_necessary = TRUE;
- }
- else if ( !_Thread_Is_heir( executing ) )
- _Context_Switch_necessary = TRUE;
-
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Thread_Load_environment
- *
- * Load starting environment for another thread from its start area in the
- * thread. Only called from t_restart and t_start.
- *
- * Input parameters:
- * the_thread - thread control block pointer
- *
- * Output parameters: NONE
- */
-
-void _Thread_Load_environment(
- Thread_Control *the_thread
-)
-{
- boolean is_fp = FALSE;
-
- if ( the_thread->Start.fp_context ) {
- the_thread->fp_context = the_thread->Start.fp_context;
- _Context_Initialize_fp( &the_thread->fp_context );
- is_fp = TRUE;
- }
-
- the_thread->do_post_task_switch_extension = FALSE;
- the_thread->is_preemptible = the_thread->Start.is_preemptible;
- the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
- the_thread->budget_callout = the_thread->Start.budget_callout;
-
- _Context_Initialize(
- &the_thread->Registers,
- the_thread->Start.Initial_stack.area,
- the_thread->Start.Initial_stack.size,
- the_thread->Start.isr_level,
- _Thread_Handler,
- is_fp
- );
-
-}
-
-/*PAGE
- *
- * _Thread_Handler
- *
- * This routine is the "primal" entry point for all threads.
- * _Context_Initialize() dummies up the thread's initial context
- * to cause the first Context_Switch() to jump to _Thread_Handler().
- *
- * This routine is the default thread exitted error handler. It is
- * returned to when a thread exits. The configured fatal error handler
- * is invoked to process the exit.
- *
- * NOTE:
- *
- * On entry, it is assumed all interrupts are blocked and that this
- * routine needs to set the initial isr level. This may or may not
- * actually be needed by the context switch routine and as a result
- * interrupts may already be at there proper level. Either way,
- * setting the initial isr level properly here is safe.
- *
- * Currently this is only really needed for the posix port,
- * ref: _Context_Switch in unix/cpu.c
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _Thread_Handler( void )
-{
- ISR_Level level;
- Thread_Control *executing;
-
- executing = _Thread_Executing;
-
- /*
- * have to put level into a register for those cpu's that use
- * inline asm here
- */
-
- level = executing->Start.isr_level;
- _ISR_Set_level(level);
-
- /*
- * Take care that 'begin' extensions get to complete before
- * 'switch' extensions can run. This means must keep dispatch
- * disabled until all 'begin' extensions complete.
- */
-
- _User_extensions_Thread_begin( executing );
-
- /*
- * At this point, the dispatch disable level BETTER be 1.
- */
-
- _Thread_Enable_dispatch();
-
- switch ( executing->Start.prototype ) {
- case THREAD_START_NUMERIC:
- (*(Thread_Entry_numeric) executing->Start.entry_point)(
- executing->Start.numeric_argument
- );
- break;
- case THREAD_START_POINTER:
- (*(Thread_Entry_pointer) executing->Start.entry_point)(
- executing->Start.pointer_argument
- );
- break;
- case THREAD_START_BOTH_POINTER_FIRST:
- (*(Thread_Entry_both_pointer_first) executing->Start.entry_point)(
- executing->Start.pointer_argument,
- executing->Start.numeric_argument
- );
- break;
- case THREAD_START_BOTH_NUMERIC_FIRST:
- (*(Thread_Entry_both_numeric_first) executing->Start.entry_point)(
- executing->Start.numeric_argument,
- executing->Start.pointer_argument
- );
- break;
- }
-
- _User_extensions_Thread_exitted( executing );
-
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_THREAD_EXITTED
- );
-}
-
-/*PAGE
- *
- * _Thread_Delay_ended
- *
- * This routine processes a thread whose delay period has ended.
- * It is called by the watchdog handler.
- *
- * Input parameters:
- * id - thread id
- *
- * Output parameters: NONE
- */
-
-void _Thread_Delay_ended(
- Objects_Id id,
- void *ignored
-)
-{
- Thread_Control *the_thread;
- Objects_Locations location;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* impossible */
- break;
- case OBJECTS_LOCAL:
- _Thread_Unblock( the_thread );
- _Thread_Unnest_dispatch();
- break;
- }
-}
-
-/*PAGE
- *
- * _Thread_Change_priority
- *
- * This kernel routine changes the priority of the thread. The
- * thread chain is adjusted if necessary.
- *
- * Input parameters:
- * the_thread - pointer to thread control block
- * new_priority - ultimate priority
- * prepend_it - TRUE if the thread should be prepended to the chain
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * ready chain
- * select heir
- */
-
-void _Thread_Change_priority(
- Thread_Control *the_thread,
- Priority_Control new_priority,
- boolean prepend_it
-)
-{
- ISR_Level level;
- /* boolean do_prepend = FALSE; */
-
- /*
- * If this is a case where prepending the task to its priority is
- * potentially desired, then we need to consider whether to do it.
- * This usually occurs when a task lowers its priority implcitly as
- * the result of losing inherited priority. Normal explicit priority
- * change calls (e.g. rtems_task_set_priority) should always do an
- * append not a prepend.
- */
-
- /*
- * Techically, the prepend should conditional on the thread lowering
- * its priority but that does allow cxd2004 of the acvc 2.0.1 to
- * pass with rtems 4.0.0. This should change when gnat redoes its
- * priority scheme.
- */
-/*
- if ( prepend_it &&
- _Thread_Is_executing( the_thread ) &&
- new_priority >= the_thread->current_priority )
- prepend_it = TRUE;
-*/
-
- _Thread_Set_transient( the_thread );
-
- if ( the_thread->current_priority != new_priority )
- _Thread_Set_priority( the_thread, new_priority );
-
- _ISR_Disable( level );
-
- the_thread->current_state =
- _States_Clear( STATES_TRANSIENT, the_thread->current_state );
-
- if ( ! _States_Is_ready( the_thread->current_state ) ) {
- _ISR_Enable( level );
- return;
- }
-
- _Priority_Add_to_bit_map( &the_thread->Priority_map );
- if ( prepend_it )
- _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node );
- else
- _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
-
- _ISR_Flash( level );
-
- _Thread_Calculate_heir();
-
- if ( !_Thread_Is_executing_also_the_heir() &&
- _Thread_Executing->is_preemptible )
- _Context_Switch_necessary = TRUE;
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Thread_Set_priority
- *
- * This directive enables and disables several modes of
- * execution for the requesting thread.
- *
- * Input parameters:
- * the_thread - pointer to thread priority
- * new_priority - new priority
- *
- * Output: NONE
- */
-
-void _Thread_Set_priority(
- Thread_Control *the_thread,
- Priority_Control new_priority
-)
-{
- the_thread->current_priority = new_priority;
- the_thread->ready = &_Thread_Ready_chain[ new_priority ];
-
- _Priority_Initialize_information( &the_thread->Priority_map, new_priority );
-}
-
-/*PAGE
- *
- * _Thread_Evaluate_mode
- *
- * XXX
- */
-
-boolean _Thread_Evaluate_mode( void )
-{
- Thread_Control *executing;
-
- executing = _Thread_Executing;
-
- if ( !_States_Is_ready( executing->current_state ) ||
- ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) {
- _Context_Switch_necessary = TRUE;
- return TRUE;
- }
-
- return FALSE;
-}
-
-/*PAGE
- *
- * _Thread_Get
- *
- * NOTE: If we are not using static inlines, this must be a real
- * subroutine call.
- *
- * NOTE: XXX... This routine may be able to be optimized.
- */
-
-#ifndef USE_INLINES
-
-Thread_Control *_Thread_Get (
- Objects_Id id,
- Objects_Locations *location
-)
-{
- Objects_Classes the_class;
- Objects_Information *information;
-
- if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
- _Thread_Disable_dispatch();
- *location = OBJECTS_LOCAL;
- return( _Thread_Executing );
- }
-
- the_class = _Objects_Get_class( id );
-
- if ( the_class > OBJECTS_CLASSES_LAST ) {
- *location = OBJECTS_ERROR;
- return (Thread_Control *) 0;
- }
-
- information = _Objects_Information_table[ the_class ];
-
- if ( !information || !information->is_thread ) {
- *location = OBJECTS_ERROR;
- return (Thread_Control *) 0;
- }
-
- return (Thread_Control *) _Objects_Get( information, id, location );
-}
-
-#endif
-
-/*PAGE
- *
- * _Thread_Idle_body
- *
- * This kernel routine is the idle thread. The idle thread runs any time
- * no other thread is ready to run. This thread loops forever with
- * interrupts enabled.
- *
- * Input parameters:
- * ignored - this parameter is ignored
- *
- * Output parameters: NONE
- */
-
-#if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)
-Thread _Thread_Idle_body(
- unsigned32 ignored
-)
-{
- for( ; ; ) ;
-}
-#endif
diff --git a/cpukit/score/src/threadmp.c b/cpukit/score/src/threadmp.c
deleted file mode 100644
index 7f22e626c0..0000000000
--- a/cpukit/score/src/threadmp.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Multiprocessing Support for the Thread Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/isr.h>
-
-/*PAGE
- *
- * _Thread_MP_Handler_initialization
- *
- */
-
-void _Thread_MP_Handler_initialization (
- unsigned32 maximum_proxies
-)
-{
-
- _Chain_Initialize_empty( &_Thread_MP_Active_proxies );
-
- if ( maximum_proxies == 0 ) {
- _Chain_Initialize_empty( &_Thread_MP_Inactive_proxies );
- return;
- }
-
-
- _Chain_Initialize(
- &_Thread_MP_Inactive_proxies,
- _Workspace_Allocate_or_fatal_error(
- maximum_proxies * sizeof( Thread_Proxy_control )
- ),
- maximum_proxies,
- sizeof( Thread_Proxy_control )
- );
-
-}
-
-/*PAGE
- *
- * _Thread_MP_Allocate_proxy
- *
- */
-
-Thread_Control *_Thread_MP_Allocate_proxy (
- States_Control the_state
-)
-{
- Thread_Control *the_thread;
- Thread_Proxy_control *the_proxy;
-
- the_thread = (Thread_Control *)_Chain_Get( &_Thread_MP_Inactive_proxies );
-
- if ( !_Thread_Is_null( the_thread ) ) {
-
- the_proxy = (Thread_Proxy_control *) the_thread;
-
- _Thread_Executing->Wait.return_code = THREAD_STATUS_PROXY_BLOCKING;
-
- the_proxy->receive_packet = _Thread_MP_Receive->receive_packet;
-
- the_proxy->Object.id = _Thread_MP_Receive->receive_packet->source_tid;
-
- the_proxy->current_priority =
- _Thread_MP_Receive->receive_packet->source_priority;
-
- the_proxy->current_state = _States_Set( STATES_DORMANT, the_state );
-
- the_proxy->Wait = _Thread_Executing->Wait;
-
- _Chain_Append( &_Thread_MP_Active_proxies, &the_proxy->Active );
-
- return the_thread;
- }
-
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_OUT_OF_PROXIES
- );
-
- /*
- * NOTE: The following return insures that the compiler will
- * think that all paths return a value.
- */
-
- return NULL;
-}
-
-/*PAGE
- *
- * _Thread_MP_Find_proxy
- *
- */
-
-/*
- * The following macro provides the offset of the Active element
- * in the Thread_Proxy_control structure. This is the logical
- * equivalent of the POSITION attribute in Ada.
- */
-
-#define _Thread_MP_Proxy_Active_offset \
- ((unsigned32)&(((Thread_Proxy_control *)0))->Active)
-
-Thread_Control *_Thread_MP_Find_proxy (
- Objects_Id the_id
-)
-{
-
- Chain_Node *proxy_node;
- Thread_Control *the_thread;
- ISR_Level level;
-
-restart:
-
- _ISR_Disable( level );
-
- for ( proxy_node = _Thread_MP_Active_proxies.first;
- !_Chain_Is_tail( &_Thread_MP_Active_proxies, proxy_node ) ;
- ) {
-
- the_thread = (Thread_Control *) _Addresses_Subtract_offset(
- proxy_node,
- _Thread_MP_Proxy_Active_offset
- );
-
- if ( _Objects_Are_ids_equal( the_thread->Object.id, the_id ) ) {
- _ISR_Enable( level );
- return the_thread;
- }
-
- _ISR_Flash( level );
-
- proxy_node = proxy_node->next;
-
- /*
- * A proxy which is only dormant is not in a blocking state.
- * Therefore, we are looking at proxy which has been moved from
- * active to inactive chain (by an ISR) and need to restart
- * the search.
- */
-
- if ( _States_Is_only_dormant( the_thread->current_state ) ) {
- _ISR_Enable( level );
- goto restart;
- }
- }
-
- _ISR_Enable( level );
- return NULL;
-}
diff --git a/cpukit/score/src/threadq.c b/cpukit/score/src/threadq.c
deleted file mode 100644
index 3cdca9701b..0000000000
--- a/cpukit/score/src/threadq.c
+++ /dev/null
@@ -1,967 +0,0 @@
-/*
- * Thread Queue Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/tqdata.h>
-
-/*PAGE
- *
- * _Thread_queue_Initialize
- *
- * This routine initializes the specified threadq.
- *
- * Input parameters:
- * the_thread_queue - pointer to a threadq header
- * the_class - class of the object to which this belongs
- * discipline - queueing discipline
- * state - state of waiting threads
- * proxy_extract_callout - MP specific callout
- * timeout_status - return on a timeout
- *
- * Output parameters: NONE
- */
-
-void _Thread_queue_Initialize(
- Thread_queue_Control *the_thread_queue,
- Objects_Classes the_class,
- Thread_queue_Disciplines the_discipline,
- States_Control state,
- Thread_queue_Extract_callout proxy_extract_callout,
- unsigned32 timeout_status
-)
-{
- unsigned32 index;
-
- _Thread_queue_Extract_table[ the_class ] = proxy_extract_callout;
-
- the_thread_queue->state = state;
- the_thread_queue->discipline = the_discipline;
- the_thread_queue->timeout_status = timeout_status;
- the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
-
- switch ( the_discipline ) {
- case THREAD_QUEUE_DISCIPLINE_FIFO:
- _Chain_Initialize_empty( &the_thread_queue->Queues.Fifo );
- break;
- case THREAD_QUEUE_DISCIPLINE_PRIORITY:
- for( index=0 ;
- index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
- index++)
- _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] );
- break;
- }
-
-}
-
-/*PAGE
- *
- * _Thread_queue_Enqueue
- *
- * This routine blocks a thread, places it on a thread, and optionally
- * starts a timeout timer.
- *
- * Input parameters:
- * the_thread_queue - pointer to threadq
- * timeout - interval to wait
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-void _Thread_queue_Enqueue(
- Thread_queue_Control *the_thread_queue,
- Watchdog_Interval timeout
-)
-{
- Thread_Control *the_thread;
-
- the_thread = _Thread_Executing;
-
- if ( _Thread_MP_Is_receive( the_thread ) && the_thread->receive_packet )
- the_thread = _Thread_MP_Allocate_proxy( the_thread_queue->state );
- else
- _Thread_Set_state( the_thread, the_thread_queue->state );
-
- if ( timeout ) {
- _Watchdog_Initialize(
- &the_thread->Timer,
- _Thread_queue_Timeout,
- the_thread->Object.id,
- NULL
- );
-
- _Watchdog_Insert_ticks( &the_thread->Timer, timeout );
- }
-
- switch( the_thread_queue->discipline ) {
- case THREAD_QUEUE_DISCIPLINE_FIFO:
- _Thread_queue_Enqueue_fifo( the_thread_queue, the_thread, timeout );
- break;
- case THREAD_QUEUE_DISCIPLINE_PRIORITY:
- _Thread_queue_Enqueue_priority( the_thread_queue, the_thread, timeout );
- break;
- }
-}
-
-/*PAGE
- *
- * _Thread_queue_Dequeue
- *
- * This routine removes a thread from the specified threadq. If the
- * threadq discipline is FIFO, it unblocks a thread, and cancels its
- * timeout timer. Priority discipline is processed elsewhere.
- *
- * Input parameters:
- * the_thread_queue - pointer to threadq
- *
- * Output parameters:
- * returns - thread dequeued or NULL
- *
- * INTERRUPT LATENCY:
- * check sync
- */
-
-Thread_Control *_Thread_queue_Dequeue(
- Thread_queue_Control *the_thread_queue
-)
-{
- Thread_Control *the_thread;
-
- switch ( the_thread_queue->discipline ) {
- case THREAD_QUEUE_DISCIPLINE_FIFO:
- the_thread = _Thread_queue_Dequeue_fifo( the_thread_queue );
- break;
- case THREAD_QUEUE_DISCIPLINE_PRIORITY:
- the_thread = _Thread_queue_Dequeue_priority( the_thread_queue );
- break;
- default: /* this is only to prevent warnings */
- the_thread = NULL;
- break;
- }
-
- return( the_thread );
-}
-
-/*PAGE
- *
- * _Thread_queue_Extract_with_proxy
- *
- * This routine extracts the_thread from the_thread_queue
- * and insures that if there is a proxy for this task on
- * another node, it is also dealt with.
- *
- * XXX
- */
-
-boolean _Thread_queue_Extract_with_proxy(
- Thread_Control *the_thread
-)
-{
- States_Control state;
- Objects_Classes the_class;
- Thread_queue_Extract_callout proxy_extract_callout;
-
- state = the_thread->current_state;
-
- if ( _States_Is_waiting_on_thread_queue( state ) ) {
- if ( _States_Is_waiting_for_rpc_reply( state ) &&
- _States_Is_locally_blocked( state ) ) {
-
- the_class = _Objects_Get_class( the_thread->Wait.id );
-
- proxy_extract_callout = _Thread_queue_Extract_table[ the_class ];
-
- if ( proxy_extract_callout )
- (*proxy_extract_callout)( the_thread );
- }
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
-
- return TRUE;
- }
- return FALSE;
-}
-
-/*PAGE
- *
- * _Thread_queue_Extract
- *
- * This routine removes a specific thread from the specified threadq,
- * deletes any timeout, and unblocks the thread.
- *
- * Input parameters:
- * the_thread_queue - pointer to a threadq header
- * the_thread - pointer to a thread control block
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY: NONE
- */
-
-void _Thread_queue_Extract(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-)
-{
- switch ( the_thread_queue->discipline ) {
- case THREAD_QUEUE_DISCIPLINE_FIFO:
- _Thread_queue_Extract_fifo( the_thread_queue, the_thread );
- break;
- case THREAD_QUEUE_DISCIPLINE_PRIORITY:
- _Thread_queue_Extract_priority( the_thread_queue, the_thread );
- break;
- }
-}
-
-/*PAGE
- *
- * _Thread_queue_Flush
- *
- * This kernel routine flushes the given thread queue.
- *
- * Input parameters:
- * the_thread_queue - pointer to threadq to be flushed
- * remote_extract_callout - pointer to routine which extracts a remote thread
- * status - status to return to the thread
- *
- * Output parameters: NONE
- */
-
-void _Thread_queue_Flush(
- Thread_queue_Control *the_thread_queue,
- Thread_queue_Flush_callout remote_extract_callout,
- unsigned32 status
-)
-{
- Thread_Control *the_thread;
-
- while ( (the_thread = _Thread_queue_Dequeue( the_thread_queue )) ) {
- if ( _Objects_Is_local_id( the_thread->Object.id ) )
- the_thread->Wait.return_code = status;
- else
- ( *remote_extract_callout )( the_thread );
- }
-}
-
-/*PAGE
- *
- * _Thread_queue_First
- *
- * This routines returns a pointer to the first thread on the
- * specified threadq.
- *
- * Input parameters:
- * the_thread_queue - pointer to thread queue
- *
- * Output parameters:
- * returns - first thread or NULL
- */
-
-Thread_Control *_Thread_queue_First(
- Thread_queue_Control *the_thread_queue
-)
-{
- Thread_Control *the_thread;
-
- switch ( the_thread_queue->discipline ) {
- case THREAD_QUEUE_DISCIPLINE_FIFO:
- the_thread = _Thread_queue_First_fifo( the_thread_queue );
- break;
- case THREAD_QUEUE_DISCIPLINE_PRIORITY:
- the_thread = _Thread_queue_First_priority( the_thread_queue );
- break;
- default: /* this is only to prevent warnings */
- the_thread = NULL;
- break;
- }
-
- return the_thread;
-}
-
-/*PAGE
- *
- * _Thread_queue_Timeout
- *
- * This routine processes a thread which timeouts while waiting on
- * a thread queue. It is called by the watchdog handler.
- *
- * Input parameters:
- * id - thread id
- *
- * Output parameters: NONE
- */
-
-void _Thread_queue_Timeout(
- Objects_Id id,
- void *ignored
-)
-{
- Thread_Control *the_thread;
- Thread_queue_Control *the_thread_queue;
- Objects_Locations location;
-
- the_thread = _Thread_Get( id, &location );
- switch ( location ) {
- case OBJECTS_ERROR:
- case OBJECTS_REMOTE: /* impossible */
- break;
- case OBJECTS_LOCAL:
- the_thread_queue = the_thread->Wait.queue;
-
- /*
- * If the_thread_queue is not synchronized, then it is either
- * "nothing happened", "timeout", or "satisfied". If the_thread
- * is the executing thread, then it is in the process of blocking
- * and it is the thread which is responsible for the synchronization
- * process.
- *
- * If it is not satisfied, then it is "nothing happened" and
- * this is the "timeout" transition. After a request is satisfied,
- * a timeout is not allowed to occur.
- */
-
- if ( the_thread_queue->sync_state != THREAD_QUEUE_SYNCHRONIZED &&
- _Thread_Is_executing( the_thread ) ) {
- if ( the_thread_queue->sync_state != THREAD_QUEUE_SATISFIED )
- the_thread_queue->sync_state = THREAD_QUEUE_TIMEOUT;
- } else {
- the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
- }
- _Thread_Unnest_dispatch();
- break;
- }
-}
-
-/*PAGE
- *
- * _Thread_queue_Enqueue_fifo
- *
- * This routine blocks a thread, places it on a thread, and optionally
- * starts a timeout timer.
- *
- * Input parameters:
- * the_thread_queue - pointer to threadq
- * the_thread - pointer to the thread to block
- * timeout - interval to wait
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-void _Thread_queue_Enqueue_fifo (
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread,
- Watchdog_Interval timeout
-)
-{
- ISR_Level level;
- Thread_queue_States sync_state;
-
- _ISR_Disable( level );
-
- sync_state = the_thread_queue->sync_state;
- the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
-
- switch ( sync_state ) {
- case THREAD_QUEUE_SYNCHRONIZED:
- /*
- * This should never happen. It indicates that someone did not
- * enter a thread queue critical section.
- */
- break;
-
- case THREAD_QUEUE_NOTHING_HAPPENED:
- _Chain_Append_unprotected(
- &the_thread_queue->Queues.Fifo,
- &the_thread->Object.Node
- );
- _ISR_Enable( level );
- return;
-
- case THREAD_QUEUE_TIMEOUT:
- the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
- _ISR_Enable( level );
- break;
-
- case THREAD_QUEUE_SATISFIED:
- if ( _Watchdog_Is_active( &the_thread->Timer ) ) {
- _Watchdog_Deactivate( &the_thread->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &the_thread->Timer );
- } else
- _ISR_Enable( level );
- break;
- }
-
- /*
- * Global objects with thread queue's should not be operated on from an
- * ISR. But the sync code still must allow short timeouts to be processed
- * correctly.
- */
-
- _Thread_Unblock( the_thread );
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- _Thread_MP_Free_proxy( the_thread );
-
-}
-
-/*PAGE
- *
- * _Thread_queue_Dequeue_fifo
- *
- * This routine removes a thread from the specified threadq.
- *
- * Input parameters:
- * the_thread_queue - pointer to threadq
- *
- * Output parameters:
- * returns - thread dequeued or NULL
- *
- * INTERRUPT LATENCY:
- * check sync
- * FIFO
- */
-
-Thread_Control *_Thread_queue_Dequeue_fifo(
- Thread_queue_Control *the_thread_queue
-)
-{
- ISR_Level level;
- Thread_Control *the_thread;
-
- _ISR_Disable( level );
- if ( !_Chain_Is_empty( &the_thread_queue->Queues.Fifo ) ) {
-
- the_thread = (Thread_Control *)
- _Chain_Get_first_unprotected( &the_thread_queue->Queues.Fifo );
-
- if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
- _ISR_Enable( level );
- _Thread_Unblock( the_thread );
- } else {
- _Watchdog_Deactivate( &the_thread->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &the_thread->Timer );
- _Thread_Unblock( the_thread );
- }
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- _Thread_MP_Free_proxy( the_thread );
-
- return the_thread;
- }
-
- switch ( the_thread_queue->sync_state ) {
- case THREAD_QUEUE_SYNCHRONIZED:
- case THREAD_QUEUE_SATISFIED:
- _ISR_Enable( level );
- return NULL;
-
- case THREAD_QUEUE_NOTHING_HAPPENED:
- case THREAD_QUEUE_TIMEOUT:
- the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
- _ISR_Enable( level );
- return _Thread_Executing;
- }
- return NULL; /* this is only to prevent warnings */
-}
-
-/*PAGE
- *
- * _Thread_queue_Extract_fifo
- *
- * This routine removes a specific thread from the specified threadq,
- * deletes any timeout, and unblocks the thread.
- *
- * Input parameters:
- * the_thread_queue - pointer to a threadq header
- * the_thread - pointer to the thread to block
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * EXTRACT_FIFO
- */
-
-void _Thread_queue_Extract_fifo(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-)
-{
- ISR_Level level;
-
- _ISR_Disable( level );
-
- if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
- _ISR_Enable( level );
- return;
- }
-
- _Chain_Extract_unprotected( &the_thread->Object.Node );
-
- if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
- _ISR_Enable( level );
- } else {
- _Watchdog_Deactivate( &the_thread->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &the_thread->Timer );
- }
-
- _Thread_Unblock( the_thread );
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- _Thread_MP_Free_proxy( the_thread );
-
-}
-
-/*PAGE
- *
- * _Thread_queue_First_fifo
- *
- * This routines returns a pointer to the first thread on the
- * specified threadq.
- *
- * Input parameters:
- * the_thread_queue - pointer to threadq
- *
- * Output parameters:
- * returns - first thread or NULL
- */
-
-Thread_Control *_Thread_queue_First_fifo(
- Thread_queue_Control *the_thread_queue
-)
-{
- if ( !_Chain_Is_empty( &the_thread_queue->Queues.Fifo ) )
- return (Thread_Control *) the_thread_queue->Queues.Fifo.first;
-
- return NULL;
-}
-
-/*PAGE
- *
- * _Thread_queue_Enqueue_priority
- *
- * This routine blocks a thread, places it on a thread, and optionally
- * starts a timeout timer.
- *
- * Input parameters:
- * the_thread_queue - pointer to threadq
- * thread - thread to insert
- * timeout - timeout interval in ticks
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * forward less than
- * forward equal
- */
-
-void _Thread_queue_Enqueue_priority(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread,
- Watchdog_Interval timeout
-)
-{
- Priority_Control search_priority;
- Thread_Control *search_thread;
- ISR_Level level;
- Chain_Control *header;
- unsigned32 header_index;
- Chain_Node *the_node;
- Chain_Node *next_node;
- Chain_Node *previous_node;
- Chain_Node *search_node;
- Priority_Control priority;
- States_Control block_state;
- Thread_queue_States sync_state;
-
- _Chain_Initialize_empty( &the_thread->Wait.Block2n );
-
- priority = the_thread->current_priority;
- header_index = _Thread_queue_Header_number( priority );
- header = &the_thread_queue->Queues.Priority[ header_index ];
- block_state = the_thread_queue->state;
-
- if ( _Thread_queue_Is_reverse_search( priority ) )
- goto restart_reverse_search;
-
-restart_forward_search:
- search_priority = PRIORITY_MINIMUM - 1;
- _ISR_Disable( level );
- search_thread = (Thread_Control *) header->first;
- while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
- search_priority = search_thread->current_priority;
- if ( priority <= search_priority )
- break;
-
-#if ( CPU_UNROLL_ENQUEUE_PRIORITY == TRUE )
- search_thread = (Thread_Control *) search_thread->Object.Node.next;
- if ( _Chain_Is_tail( header, (Chain_Node *)search_thread ) )
- break;
- search_priority = search_thread->current_priority;
- if ( priority <= search_priority )
- break;
-#endif
- _ISR_Flash( level );
- if ( !_States_Are_set( search_thread->current_state, block_state) ) {
- _ISR_Enable( level );
- goto restart_forward_search;
- }
- search_thread =
- (Thread_Control *)search_thread->Object.Node.next;
- }
-
- if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
- goto synchronize;
-
- the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
-
- if ( priority == search_priority )
- goto equal_priority;
-
- search_node = (Chain_Node *) search_thread;
- previous_node = search_node->previous;
- the_node = (Chain_Node *) the_thread;
-
- the_node->next = search_node;
- the_node->previous = previous_node;
- previous_node->next = the_node;
- search_node->previous = the_node;
- _ISR_Enable( level );
- return;
-
-restart_reverse_search:
- search_priority = PRIORITY_MAXIMUM + 1;
-
- _ISR_Disable( level );
- search_thread = (Thread_Control *) header->last;
- while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
- search_priority = search_thread->current_priority;
- if ( priority >= search_priority )
- break;
-#if ( CPU_UNROLL_ENQUEUE_PRIORITY == TRUE )
- search_thread = (Thread_Control *) search_thread->Object.Node.previous;
- if ( _Chain_Is_head( header, (Chain_Node *)search_thread ) )
- break;
- search_priority = search_thread->current_priority;
- if ( priority >= search_priority )
- break;
-#endif
- _ISR_Flash( level );
- if ( !_States_Are_set( search_thread->current_state, block_state) ) {
- _ISR_Enable( level );
- goto restart_reverse_search;
- }
- search_thread = (Thread_Control *)
- search_thread->Object.Node.previous;
- }
-
- if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
- goto synchronize;
-
- the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
-
- if ( priority == search_priority )
- goto equal_priority;
-
- search_node = (Chain_Node *) search_thread;
- next_node = search_node->next;
- the_node = (Chain_Node *) the_thread;
-
- the_node->next = next_node;
- the_node->previous = search_node;
- search_node->next = the_node;
- next_node->previous = the_node;
- _ISR_Enable( level );
- return;
-
-equal_priority: /* add at end of priority group */
- search_node = _Chain_Tail( &search_thread->Wait.Block2n );
- previous_node = search_node->previous;
- the_node = (Chain_Node *) the_thread;
-
- the_node->next = search_node;
- the_node->previous = previous_node;
- previous_node->next = the_node;
- search_node->previous = the_node;
- _ISR_Enable( level );
- return;
-
-synchronize:
-
- sync_state = the_thread_queue->sync_state;
- the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
-
- switch ( sync_state ) {
- case THREAD_QUEUE_SYNCHRONIZED:
- /*
- * This should never happen. It indicates that someone did not
- * enter a thread queue critical section.
- */
- break;
-
- case THREAD_QUEUE_NOTHING_HAPPENED:
- /*
- * This should never happen. All of this was dealt with above.
- */
- break;
-
- case THREAD_QUEUE_TIMEOUT:
- the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
- _ISR_Enable( level );
- break;
-
- case THREAD_QUEUE_SATISFIED:
- if ( _Watchdog_Is_active( &the_thread->Timer ) ) {
- _Watchdog_Deactivate( &the_thread->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &the_thread->Timer );
- } else
- _ISR_Enable( level );
- break;
- }
-
- /*
- * Global objects with thread queue's should not be operated on from an
- * ISR. But the sync code still must allow short timeouts to be processed
- * correctly.
- */
-
- _Thread_Unblock( the_thread );
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- _Thread_MP_Free_proxy( the_thread );
-}
-
-/*PAGE
- *
- * _Thread_queue_Dequeue_priority
- *
- * This routine removes a thread from the specified PRIORITY based
- * threadq, unblocks it, and cancels its timeout timer.
- *
- * Input parameters:
- * the_thread_queue - pointer to thread queue
- *
- * Output parameters:
- * returns - thread dequeued or NULL
- *
- * INTERRUPT LATENCY:
- * only case
- */
-
-Thread_Control *_Thread_queue_Dequeue_priority(
- Thread_queue_Control *the_thread_queue
-)
-{
- unsigned32 index;
- ISR_Level level;
- Thread_Control *the_thread = NULL; /* just to remove warnings */
- Thread_Control *new_first_thread;
- Chain_Node *new_first_node;
- Chain_Node *new_second_node;
- Chain_Node *last_node;
- Chain_Node *next_node;
- Chain_Node *previous_node;
-
- _ISR_Disable( level );
- for( index=0 ;
- index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
- index++ ) {
- if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) {
- the_thread = (Thread_Control *)
- the_thread_queue->Queues.Priority[ index ].first;
- goto dequeue;
- }
- }
-
- switch ( the_thread_queue->sync_state ) {
- case THREAD_QUEUE_SYNCHRONIZED:
- case THREAD_QUEUE_SATISFIED:
- _ISR_Enable( level );
- return NULL;
-
- case THREAD_QUEUE_NOTHING_HAPPENED:
- case THREAD_QUEUE_TIMEOUT:
- the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
- _ISR_Enable( level );
- return _Thread_Executing;
- }
-
-dequeue:
- new_first_node = the_thread->Wait.Block2n.first;
- new_first_thread = (Thread_Control *) new_first_node;
- next_node = the_thread->Object.Node.next;
- previous_node = the_thread->Object.Node.previous;
-
- if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
- last_node = the_thread->Wait.Block2n.last;
- new_second_node = new_first_node->next;
-
- previous_node->next = new_first_node;
- next_node->previous = new_first_node;
- new_first_node->next = next_node;
- new_first_node->previous = previous_node;
-
- if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
- /* > two threads on 2-n */
- new_second_node->previous =
- _Chain_Head( &new_first_thread->Wait.Block2n );
-
- new_first_thread->Wait.Block2n.first = new_second_node;
- new_first_thread->Wait.Block2n.last = last_node;
-
- last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n );
- }
- } else {
- previous_node->next = next_node;
- next_node->previous = previous_node;
- }
-
- if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
- _ISR_Enable( level );
- _Thread_Unblock( the_thread );
- } else {
- _Watchdog_Deactivate( &the_thread->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &the_thread->Timer );
- _Thread_Unblock( the_thread );
- }
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- _Thread_MP_Free_proxy( the_thread );
- return( the_thread );
-}
-
-/*PAGE
- *
- * _Thread_queue_Extract_priority
- *
- * This routine removes a specific thread from the specified threadq,
- * deletes any timeout, and unblocks the thread.
- *
- * Input parameters:
- * the_thread_queue - pointer to a threadq header
- * the_thread - pointer to a thread control block
- *
- * Output parameters: NONE
- *
- * INTERRUPT LATENCY:
- * EXTRACT_PRIORITY
- */
-
-void _Thread_queue_Extract_priority(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-)
-{
- ISR_Level level;
- Chain_Node *the_node;
- Chain_Node *next_node;
- Chain_Node *previous_node;
- Thread_Control *new_first_thread;
- Chain_Node *new_first_node;
- Chain_Node *new_second_node;
- Chain_Node *last_node;
-
- the_node = (Chain_Node *) the_thread;
- _ISR_Disable( level );
- if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
- next_node = the_node->next;
- previous_node = the_node->previous;
-
- if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
- new_first_node = the_thread->Wait.Block2n.first;
- new_first_thread = (Thread_Control *) new_first_node;
- last_node = the_thread->Wait.Block2n.last;
- new_second_node = new_first_node->next;
-
- previous_node->next = new_first_node;
- next_node->previous = new_first_node;
- new_first_node->next = next_node;
- new_first_node->previous = previous_node;
-
- if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
- /* > two threads on 2-n */
- new_second_node->previous =
- _Chain_Head( &new_first_thread->Wait.Block2n );
- new_first_thread->Wait.Block2n.first = new_second_node;
-
- new_first_thread->Wait.Block2n.last = last_node;
- last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n );
- }
- } else {
- previous_node->next = next_node;
- next_node->previous = previous_node;
- }
-
- if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
- _ISR_Enable( level );
- _Thread_Unblock( the_thread );
- } else {
- _Watchdog_Deactivate( &the_thread->Timer );
- _ISR_Enable( level );
- (void) _Watchdog_Remove( &the_thread->Timer );
- _Thread_Unblock( the_thread );
- }
-
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- _Thread_MP_Free_proxy( the_thread );
- }
- else
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Thread_queue_First_priority
- *
- * This routines returns a pointer to the first thread on the
- * specified threadq.
- *
- * Input parameters:
- * the_thread_queue - pointer to thread queue
- *
- * Output parameters:
- * returns - first thread or NULL
- */
-
-Thread_Control *_Thread_queue_First_priority (
- Thread_queue_Control *the_thread_queue
-)
-{
- unsigned32 index;
-
- for( index=0 ;
- index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
- index++ ) {
- if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) )
- return (Thread_Control *)
- the_thread_queue->Queues.Priority[ index ].first;
- }
- return NULL;
-}
diff --git a/cpukit/score/src/userext.c b/cpukit/score/src/userext.c
deleted file mode 100644
index a57c6e7ee8..0000000000
--- a/cpukit/score/src/userext.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * User Extension Handler
- *
- * NOTE: XXX
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/userext.h>
-
-/*PAGE
- *
- * _User_extensions_Thread_create
- */
-
-boolean _User_extensions_Thread_create (
- Thread_Control *the_thread
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
- boolean status;
-
- for ( the_node = _User_extensions_List.first ;
- !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_create != NULL ) {
- status = (*the_extension->Callouts.thread_create)(
- _Thread_Executing,
- the_thread
- );
- if ( !status )
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-/*PAGE
- *
- * _User_extensions_Thread_delete
- */
-
-void _User_extensions_Thread_delete (
- Thread_Control *the_thread
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.last ;
- !_Chain_Is_head( &_User_extensions_List, the_node ) ;
- the_node = the_node->previous ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_delete != NULL )
- (*the_extension->Callouts.thread_delete)(
- _Thread_Executing,
- the_thread
- );
- }
-}
-
-/*PAGE
- *
- * _User_extensions_Thread_start
- *
- */
-
-void _User_extensions_Thread_start (
- Thread_Control *the_thread
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.first ;
- !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_start != NULL )
- (*the_extension->Callouts.thread_start)(
- _Thread_Executing,
- the_thread
- );
- }
-}
-
-/*PAGE
- *
- * _User_extensions_Thread_restart
- *
- */
-
-void _User_extensions_Thread_restart (
- Thread_Control *the_thread
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.first ;
- !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_restart != NULL )
- (*the_extension->Callouts.thread_restart)(
- _Thread_Executing,
- the_thread
- );
- }
-}
-
-/*PAGE
- *
- * _User_extensions_Thread_begin
- *
- */
-
-void _User_extensions_Thread_begin (
- Thread_Control *executing
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.first ;
- !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
- the_node = the_node->next ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_begin != NULL )
- (*the_extension->Callouts.thread_begin)( executing );
- }
-}
-
-/*PAGE
- *
- * _User_extensions_Thread_exitted
- */
-
-void _User_extensions_Thread_exitted (
- Thread_Control *executing
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.last ;
- !_Chain_Is_head( &_User_extensions_List, the_node ) ;
- the_node = the_node->previous ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.thread_exitted != NULL )
- (*the_extension->Callouts.thread_exitted)( executing );
- }
-}
-
-/*PAGE
- *
- * _User_extensions_Fatal
- */
-
-void _User_extensions_Fatal (
- Internal_errors_Source the_source,
- boolean is_internal,
- unsigned32 the_error
-)
-{
- Chain_Node *the_node;
- User_extensions_Control *the_extension;
-
- for ( the_node = _User_extensions_List.last ;
- !_Chain_Is_head( &_User_extensions_List, the_node ) ;
- the_node = the_node->previous ) {
-
- the_extension = (User_extensions_Control *) the_node;
-
- if ( the_extension->Callouts.fatal != NULL )
- (*the_extension->Callouts.fatal)( the_source, is_internal, the_error );
- }
-}
-
-
diff --git a/cpukit/score/src/watchdog.c b/cpukit/score/src/watchdog.c
deleted file mode 100644
index a3ddf85420..0000000000
--- a/cpukit/score/src/watchdog.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * Watchdog Handler
- *
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/watchdog.h>
-
-/*PAGE
- *
- * _Watchdog_Handler_initialization
- *
- * This routine initializes the watchdog handler.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _Watchdog_Handler_initialization( void )
-{
- _Watchdog_Sync_count = 0;
- _Watchdog_Sync_level = 0;
- _Watchdog_Ticks_since_boot = 0;
-
- _Chain_Initialize_empty( &_Watchdog_Ticks_chain );
- _Chain_Initialize_empty( &_Watchdog_Seconds_chain );
-}
-
-/*PAGE
- *
- * _Watchdog_Remove
- *
- * The routine removes a watchdog from a delta chain and updates
- * the delta counters of the remaining watchdogs.
- */
-
-Watchdog_States _Watchdog_Remove(
- Watchdog_Control *the_watchdog
-)
-{
- ISR_Level level;
- Watchdog_States previous_state;
- Watchdog_Control *next_watchdog;
-
- _ISR_Disable( level );
- previous_state = the_watchdog->state;
- switch ( previous_state ) {
- case WATCHDOG_INACTIVE:
- break;
-
- case WATCHDOG_BEING_INSERTED:
-
- /*
- * It is not actually on the chain so just change the state and
- * the Insert operation we interrupted will be aborted.
- */
- the_watchdog->state = WATCHDOG_INACTIVE;
- break;
-
- case WATCHDOG_ACTIVE:
- case WATCHDOG_REMOVE_IT:
-
- the_watchdog->state = WATCHDOG_INACTIVE;
- next_watchdog = _Watchdog_Next( the_watchdog );
-
- if ( _Watchdog_Next(next_watchdog) )
- next_watchdog->delta_interval += the_watchdog->delta_interval;
-
- if ( _Watchdog_Sync_count )
- _Watchdog_Sync_level = _ISR_Nest_level;
-
- _Chain_Extract_unprotected( &the_watchdog->Node );
- break;
- }
- the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
-
- _ISR_Enable( level );
- return( previous_state );
-}
-
-/*PAGE
- *
- * _Watchdog_Adjust
- *
- * This routine adjusts the delta chain backward or forward in response
- * to a time change.
- *
- * Input parameters:
- * header - pointer to the delta chain to be adjusted
- * direction - forward or backward adjustment to delta chain
- * units - units to adjust
- *
- * Output parameters:
- */
-
-void _Watchdog_Adjust(
- Chain_Control *header,
- Watchdog_Adjust_directions direction,
- Watchdog_Interval units
-)
-{
- if ( !_Chain_Is_empty( header ) ) {
- switch ( direction ) {
- case WATCHDOG_BACKWARD:
- _Watchdog_First( header )->delta_interval += units;
- break;
- case WATCHDOG_FORWARD:
- while ( units ) {
- if ( units < _Watchdog_First( header )->delta_interval ) {
- _Watchdog_First( header )->delta_interval -= units;
- break;
- } else {
- units -= _Watchdog_First( header )->delta_interval;
- _Watchdog_First( header )->delta_interval = 1;
- _Watchdog_Tickle( header );
- if ( _Chain_Is_empty( header ) )
- break;
- }
- }
- break;
- }
- }
-}
-
-/*PAGE
- *
- * _Watchdog_Insert
- *
- * This routine inserts a watchdog timer on to the appropriate delta
- * chain while updating the delta interval counters.
- */
-
-void _Watchdog_Insert(
- Chain_Control *header,
- Watchdog_Control *the_watchdog
-)
-{
- ISR_Level level;
- Watchdog_Control *after;
- unsigned32 insert_isr_nest_level;
- Watchdog_Interval delta_interval;
-
-
- insert_isr_nest_level = _ISR_Nest_level;
- the_watchdog->state = WATCHDOG_BEING_INSERTED;
-
- _Watchdog_Sync_count++;
-restart:
- delta_interval = the_watchdog->initial;
-
- _ISR_Disable( level );
-
- for ( after = _Watchdog_First( header ) ;
- ;
- after = _Watchdog_Next( after ) ) {
-
- if ( delta_interval == 0 || !_Watchdog_Next( after ) )
- break;
-
- if ( delta_interval < after->delta_interval ) {
- after->delta_interval -= delta_interval;
- break;
- }
-
- delta_interval -= after->delta_interval;
-
- /*
- * If you experience problems comment out the _ISR_Flash line.
- * 3.2.0 was the first release with this critical section redesigned.
- * Under certain circumstances, the PREVIOUS critical section algorithm
- * used around this flash point allowed interrupts to execute
- * which violated the design assumptions. The critical section
- * mechanism used here WAS redesigned to address this.
- */
-
- _ISR_Flash( level );
-
- if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) {
- goto exit_insert;
- }
-
- if ( _Watchdog_Sync_level > insert_isr_nest_level ) {
- _Watchdog_Sync_level = insert_isr_nest_level;
- _ISR_Enable( level );
- goto restart;
- }
- }
-
- _Watchdog_Activate( the_watchdog );
-
- the_watchdog->delta_interval = delta_interval;
-
- _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node );
-
- the_watchdog->start_time = _Watchdog_Ticks_since_boot;
-
-exit_insert:
- _Watchdog_Sync_level = insert_isr_nest_level;
- _Watchdog_Sync_count--;
- _ISR_Enable( level );
-}
-
-/*PAGE
- *
- * _Watchdog_Tickle
- *
- * This routine decrements the delta counter in response to a tick. The
- * delta chain is updated accordingly.
- *
- * Input parameters:
- * header - pointer to the delta chain to be tickled
- *
- * Output parameters: NONE
- */
-
-void _Watchdog_Tickle(
- Chain_Control *header
-)
-{
- Watchdog_Control *the_watchdog;
-
- if ( _Chain_Is_empty( header ) )
- return;
-
- the_watchdog = _Watchdog_First( header );
- the_watchdog->delta_interval--;
- if ( the_watchdog->delta_interval != 0 )
- return;
-
- do {
- switch( _Watchdog_Remove( the_watchdog ) ) {
- case WATCHDOG_ACTIVE:
- (*the_watchdog->routine)(
- the_watchdog->id,
- the_watchdog->user_data
- );
- break;
-
- case WATCHDOG_INACTIVE:
- /*
- * This state indicates that the watchdog is not on any chain.
- * Thus, it is NOT on a chain being tickled. This case should
- * never occur.
- */
- break;
-
- case WATCHDOG_BEING_INSERTED:
- /*
- * This state indicates that the watchdog is in the process of
- * BEING inserted on the chain. Thus, it can NOT be on a chain
- * being tickled. This case should never occur.
- */
- break;
-
- case WATCHDOG_REMOVE_IT:
- break;
- }
- the_watchdog = _Watchdog_First( header );
- } while ( !_Chain_Is_empty( header ) &&
- (the_watchdog->delta_interval == 0) );
-}
diff --git a/cpukit/score/src/wkspace.c b/cpukit/score/src/wkspace.c
deleted file mode 100644
index 5e154f5efa..0000000000
--- a/cpukit/score/src/wkspace.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Workspace Handler
- *
- * XXX
- *
- * NOTE:
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/interr.h>
-
-/*PAGE
- *
- * _Workspace_Handler_initialization
- */
-
-void _Workspace_Handler_initialization(
- void *starting_address,
- unsigned32 size
-)
-{
- unsigned32 *zero_out_array;
- unsigned32 index;
- unsigned32 memory_available;
-
- if ( !starting_address || !_Addresses_Is_aligned( starting_address ) )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS
- );
-
- if ( _CPU_Table.do_zero_of_workspace ) {
- for( zero_out_array = (unsigned32 *) starting_address, index = 0 ;
- index < size / sizeof( unsigned32 ) ;
- index++ )
- zero_out_array[ index ] = 0;
- }
-
- memory_available = _Heap_Initialize(
- &_Workspace_Area,
- starting_address,
- size,
- CPU_HEAP_ALIGNMENT
- );
-
- if ( memory_available == 0 )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_TOO_LITTLE_WORKSPACE
- );
-}
-
-/*PAGE
- *
- * _Workspace_Allocate_or_fatal_error
- *
- */
-
-void *_Workspace_Allocate_or_fatal_error(
- unsigned32 size
-)
-{
- void *memory;
-
- memory = _Workspace_Allocate( size );
-
- if ( memory == NULL )
- _Internal_error_Occurred(
- INTERNAL_ERROR_CORE,
- TRUE,
- INTERNAL_ERROR_WORKSPACE_ALLOCATION
- );
-
- return memory;
-}
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
- <ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html>.
-
-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: <ghost@aladdin.com>
-
-
- Jean-Loup Gailly
-
- EMail: <gzip@prep.ai.mit.edu>
-
- Questions about the technical content of this specification can be
- sent by email to
-
- Jean-Loup Gailly <gzip@prep.ai.mit.edu> and
- Mark Adler <madler@alumni.caltech.edu>
-
- Editorial comments on this specification can be sent by email to
-
- L. Peter Deutsch <ghost@aladdin.com> and
- Glenn Randers-Pehrson <randeg@alumni.rpi.edu>
-
-
-
-
-
-
-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
- <ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html>.
-
-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 <length, backward distance>. 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 <length = 5, distance = 2>
- 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 <length, backward distance> 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: <ghost@aladdin.com>
-
- Questions about the technical content of this specification can be
- sent by email to:
-
- Jean-Loup Gailly <gzip@prep.ai.mit.edu> and
- Mark Adler <madler@alumni.caltech.edu>
-
- Editorial comments on this specification can be sent by email to:
-
- L. Peter Deutsch <ghost@aladdin.com> and
- Glenn Randers-Pehrson <randeg@alumni.rpi.edu>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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
- <ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html>.
-
-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
- <gzip@prep.ai.mit.edu> 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: <ghost@aladdin.com>
-
- Questions about the technical content of this specification can be
- sent by email to:
-
- Jean-Loup Gailly <gzip@prep.ai.mit.edu> and
- Mark Adler <madler@alumni.caltech.edu>
-
- Editorial comments on this specification can be sent by email to:
-
- L. Peter Deutsch <ghost@aladdin.com> and
- Glenn Randers-Pehrson <randeg@alumni.rpi.edu>
-
-
-
-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 <gzip@prep.ai.mit.edu>. 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/doc/common/missing-arrow.gif b/doc/common/missing-arrow.gif
new file mode 100644
index 0000000000..c686c80b5f
--- /dev/null
+++ b/doc/common/missing-arrow.gif
Binary files differ
diff --git a/doc/common/next-arrow.gif b/doc/common/next-arrow.gif
new file mode 100644
index 0000000000..57f5cddb81
--- /dev/null
+++ b/doc/common/next-arrow.gif
Binary files differ
diff --git a/doc/common/prev-arrow.gif b/doc/common/prev-arrow.gif
new file mode 100644
index 0000000000..350785be10
--- /dev/null
+++ b/doc/common/prev-arrow.gif
Binary files differ
diff --git a/doc/common/timing.texi b/doc/common/timing.texi
new file mode 100644
index 0000000000..2d5b7e35a2
--- /dev/null
+++ b/doc/common/timing.texi
@@ -0,0 +1,457 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Timing Specification, Timing Specification Introduction, , Top
+@end ifinfo
+@chapter Timing Specification
+@ifinfo
+@menu
+* Timing Specification Introduction::
+* Timing Specification Philosophy::
+* Timing Specification Methodology::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Timing Specification Introduction, Timing Specification Philosophy, Timing Specification, Timing Specification
+@end ifinfo
+@section Introduction
+
+This chapter provides information pertaining to the
+measurement of the performance of RTEMS, the methods of
+gathering the timing data, and the usefulness of the data. Also
+discussed are other time critical aspects of RTEMS that affect
+an applications design and ultimate throughput. These aspects
+include determinancy, interrupt latency and context switch times.
+
+@ifinfo
+@node Timing Specification Philosophy, Determinancy, Timing Specification Introduction, Timing Specification
+@end ifinfo
+@section Philosophy
+@ifinfo
+@menu
+* Determinancy::
+* Interrupt Latency::
+* Context Switch Time::
+* Directive Times::
+@end menu
+@end ifinfo
+
+Benchmarks are commonly used to evaluate the
+performance of software and hardware. Benchmarks can be an
+effective tool when comparing systems. Unfortunately,
+benchmarks can also be manipulated to justify virtually any
+claim. Benchmarks of real-time executives are difficult to
+evaluate for a variety of reasons. Executives vary in the
+robustness of features and options provided. Even when
+executives compare favorably in functionality, it is quite
+likely that different methodologies were used to obtain the
+timing data. Another problem is that some executives provide
+times for only a small subset of directives, This is typically
+justified by claiming that these are the only time-critical
+directives. The performance of some executives is also very
+sensitive to the number of objects in the system. To obtain any
+measure of usefulness, the performance information provided for
+an executive should address each of these issues.
+
+When evaluating the performance of a real-time
+executive, one typically considers the following areas:
+determinancy, directive times, worst case interrupt latency, and
+context switch time. Unfortunately, these areas do not have
+standard measurement methodologies. This allows vendors to
+manipulate the results such that their product is favorably
+represented. We have attempted to provide useful and meaningful
+timing information for RTEMS. To insure the usefulness of our
+data, the methodology and definitions used to obtain and
+describe the data are also documented.
+
+@ifinfo
+@node Determinancy, Interrupt Latency, Timing Specification Philosophy, Timing Specification Philosophy
+@end ifinfo
+@subsection Determinancy
+
+The correctness of data in a real-time system must
+always be judged by its timeliness. In many real-time systems,
+obtaining the correct answer does not necessarily solve the
+problem. For example, in a nuclear reactor it is not enough to
+determine that the core is overheating. This situation must be
+detected and acknowledged early enough that corrective action
+can be taken and a meltdown avoided.
+
+Consequently, a system designer must be able to
+predict the worst-case behavior of the application running under
+the selected executive. In this light, it is important that a
+real-time system perform consistently regardless of the number
+of tasks, semaphores, or other resources allocated. An
+important design goal of a real-time executive is that all
+internal algorithms be fixed-cost. Unfortunately, this goal is
+difficult to completely meet without sacrificing the robustness
+of the executive's feature set.
+
+Many executives use the term deterministic to mean
+that the execution times of their services can be predicted.
+However, they often provide formulas to modify execution times
+based upon the number of objects in the system. This usage is
+in sharp contrast to the notion of deterministic meaning fixed
+cost.
+
+Almost all RTEMS directives execute in a fixed amount
+of time regardless of the number of objects present in the
+system. The primary exception occurs when a task blocks while
+acquiring a resource and specifies a non-zero timeout interval.
+
+Other exceptions are message queue broadcast,
+obtaining a variable length memory block, object name to ID
+translation, and deleting a resource upon which tasks are
+waiting. In addition, the time required to service a clock tick
+interrupt is based upon the number of timeouts and other
+"events" which must be processed at that tick. This second
+group is composed primarily of capabilities which are inherently
+non-deterministic but are infrequently used in time critical
+situations. The major exception is that of servicing a clock
+tick. However, most applications have a very small number of
+timeouts which expire at exactly the same millisecond (usually
+none, but occasionally two or three).
+
+@ifinfo
+@node Interrupt Latency, Context Switch Time, Determinancy, Timing Specification Philosophy
+@end ifinfo
+@subsection Interrupt Latency
+
+Interrupt latency is the delay between the CPU's
+receipt of an interrupt request and the execution of the first
+application-specific instruction in an interrupt service
+routine. Interrupts are a critical component of most real-time
+applications and it is critical that they be acted upon as
+quickly as possible.
+
+Knowledge of the worst case interrupt latency of an
+executive aids the application designer in determining the
+maximum period of time between the generation of an interrupt
+and an interrupt handler responding to that interrupt. The
+interrupt latency of an system is the greater of the executive's
+and the applications's interrupt latency. If the application
+disables interrupts longer than the executive, then the
+application's interrupt latency is the system's worst case
+interrupt disable period.
+
+The worst case interrupt latency for a real-time
+executive is based upon the following components:
+
+@itemize @bullet
+@item the longest period of time interrupts are disabled
+by the executive,
+
+@item the overhead required by the executive at the
+beginning of each ISR,
+
+@item the time required for the CPU to vector the
+interrupt, and
+
+@item for some microprocessors, the length of the longest
+instruction.
+@end itemize
+
+The first component is irrelevant if an interrupt
+occurs when interrupts are enabled, although it must be included
+in a worst case analysis. The third and fourth components are
+particular to a CPU implementation and are not dependent on the
+executive. The fourth component is ignored by this document
+because most applications use only a subset of a
+microprocessor's instruction set. Because of this the longest
+instruction actually executed is application dependent. The
+worst case interrupt latency of an executive is typically
+defined as the sum of components (1) and (2). The second
+component includes the time necessry for RTEMS to save registers
+and vector to the user-defined handler. RTEMS includes the
+third component, the time required for the CPU to vector the
+interrupt, because it is a required part of any interrupt.
+
+Many executives report the maximum interrupt disable
+period as their interrupt latency and ignore the other
+components. This results in very low worst-case interrupt
+latency times which are not indicative of actual application
+performance. The definition used by RTEMS results in a higher
+interrupt latency being reported, but accurately reflects the
+longest delay between the CPU's receipt of an interrupt request
+and the execution of the first application-specific instruction
+in an interrupt service routine.
+
+The actual interrupt latency times are reported in
+the Timing Data chapter of this supplement.
+
+@ifinfo
+@node Context Switch Time, Directive Times, Interrupt Latency, Timing Specification Philosophy
+@end ifinfo
+@subsection Context Switch Time
+
+An RTEMS context switch is defined as the act of
+taking the CPU from the currently executing task and giving it
+to another task. This process involves the following components:
+
+@itemize @bullet
+@item Saving the hardware state of the current task.
+
+@item Optionally, invoking the TASK_SWITCH user extension.
+
+@item Restoring the hardware state of the new task.
+@end itemize
+
+RTEMS defines the hardware state of a task to include
+the CPU's data registers, address registers, and, optionally,
+floating point registers.
+
+Context switch time is often touted as a performance
+measure of real-time executives. However, a context switch is
+performed as part of a directive's actions and should be viewed
+as such when designing an application. For example, if a task
+is unable to acquire a semaphore and blocks, a context switch is
+required to transfer control from the blocking task to a new
+task. From the application's perspective, the context switch is
+a direct result of not acquiring the semaphore. In this light,
+the context switch time is no more relevant than the performance
+of any other of the executive's subroutines which are not
+directly accessible by the application.
+
+In spite of the inappropriateness of using the
+context switch time as a performance metric, RTEMS context
+switch times for floating point and non-floating points tasks
+are provided for comparison purposes. Of the executives which
+actually support floating point operations, many do not report
+context switch times for floating point context switch time.
+This results in a reported context switch time which is
+meaningless for an application with floating point tasks.
+
+The actual context switch times are reported in the
+Timing Data chapter of this supplement.
+
+@ifinfo
+@node Directive Times, Timing Specification Methodology, Context Switch Time, Timing Specification Philosophy
+@end ifinfo
+@subsection Directive Times
+
+Directives are the application's interface to the
+executive, and as such their execution times are critical in
+determining the performance of the application. For example, an
+application using a semaphore to protect a critical data
+structure should be aware of the time required to acquire and
+release a semaphore. In addition, the application designer can
+utilize the directive execution times to evaluate the
+performance of different synchronization and communication
+mechanisms.
+
+The actual directive execution times are reported in
+the Timing Data chapter of this supplement.
+
+@ifinfo
+@node Timing Specification Methodology, Software Platform, Directive Times, Timing Specification
+@end ifinfo
+@section Methodology
+@ifinfo
+@menu
+* Software Platform::
+* Hardware Platform::
+* What is measured?::
+* What is not measured?::
+* Terminology::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Software Platform, Hardware Platform, Timing Specification Methodology, Timing Specification Methodology
+@end ifinfo
+@subsection Software Platform
+
+The RTEMS timing suite is written in C. The overhead
+of passing arguments to RTEMS by C is not timed. The times
+reported represent the amount of time from entering to exiting
+RTEMS.
+
+The tests are based upon one of two execution models:
+(1) single invocation times, and (2) average times of repeated
+invocations. Single invocation times are provided for
+directives which cannot easily be invoked multiple times in the
+same scenario. For example, the times reported for entering and
+exiting an interrupt service routine are single invocation
+times. The second model is used for directives which can easily
+be invoked multiple times in the same scenario. For example,
+the times reported for semaphore obtain and semaphore release
+are averages of multiple invocations. At least 100 invocations
+are used to obtain the average.
+
+@ifinfo
+@node Hardware Platform, What is measured?, Software Platform, Timing Specification Methodology
+@end ifinfo
+@subsection Hardware Platform
+
+Since RTEMS supports a variety of processors, the
+hardware platform used to gather the benchmark times must also
+vary. Therefore, for each processor supported the hardware
+platform must be defined. Each definition will include a brief
+description of the target hardware platform including the clock
+speed, memory wait states encountered, and any other pertinent
+information. This definition may be found in the processor
+dependent timing data chapter within this supplement.
+
+@ifinfo
+@node What is measured?, What is not measured?, Hardware Platform, Timing Specification Methodology
+@end ifinfo
+@subsection What is measured?
+
+An effort was made to provide execution times for a
+large portion of RTEMS. Times were provided for most directives
+regardless of whether or not they are typically used in time
+critical code. For example, execution times are provided for
+all object create and delete directives, even though these are
+typically part of application initialization.
+
+The times include all RTEMS actions necessary in a
+particular scenario. For example, all times for blocking
+directives include the context switch necessary to transfer
+control to a new task. Under no circumstances is it necessary
+to add context switch time to the reported times.
+
+The following list describes the objects created by
+the timing suite:
+
+@itemize @bullet
+@item All tasks are non-floating point.
+
+@item All tasks are created as local objects.
+
+@item No timeouts are used on blocking directives.
+
+@item All tasks wait for objects in FIFO order.
+
+@end itemize
+
+In addition, no user extensions are configured.
+
+@ifinfo
+@node What is not measured?, Terminology, What is measured?, Timing Specification Methodology
+@end ifinfo
+@subsection What is not measured?
+
+The times presented in this document are not intended
+to represent best or worst case times, nor are all directives
+included. For example, no times are provided for the initialize
+executive and fatal_error_occurred directives. Other than the
+exceptions detailed in the Determinancy section, all directives
+will execute in the fixed length of time given.
+
+Other than entering and exiting an interrupt service
+routine, all directives were executed from tasks and not from
+interrupt service routines. Directives invoked from ISRs, when
+allowable, will execute in slightly less time than when invoked
+from a task because rescheduling is delayed until the interrupt
+exits.
+
+@ifinfo
+@node Terminology, , What is not measured?, Timing Specification Methodology
+@end ifinfo
+@subsection Terminology
+
+The following is a list of phrases which are used to
+distinguish individual execution paths of the directives taken
+during the RTEMS performance analysis:
+
+@table @b
+@item another task
+The directive was performed
+on a task other than the calling task.
+
+@item available
+A task attempted to obtain a resource and
+immediately acquired it.
+
+@item blocked task
+The task operated upon by the
+directive was blocked waiting for a resource.
+
+@item caller blocks
+The requested resoure was not
+immediately available and the calling task chose to wait.
+
+@item calling task
+The task invoking the directive.
+
+@item messages flushed
+One or more messages was flushed
+from the message queue.
+
+@item no messages flushed
+No messages were flushed from
+the message queue.
+
+@item not available
+A task attempted to obtain a resource
+and could not immediately acquire it.
+
+@item no reschedule
+The directive did not require a
+rescheduling operation.
+
+@item NO_WAIT
+A resource was not available and the
+calling task chose to return immediately via the NO_WAIT option
+with an error.
+
+@item obtain current
+The current value of something was
+requested by the calling task.
+
+@item preempts caller
+The release of a resource caused a
+task of higher priority than the calling to be readied and it
+became the executing task.
+
+@item ready task
+The task operated upon by the directive
+was in the ready state.
+
+@item reschedule
+The actions of the directive
+necessitated a rescheduling operation.
+
+@item returns to caller
+The directive succeeded and
+immediately returned to the calling task.
+
+@item returns to interrupted task
+The instructions
+executed immediately following this interrupt will be in the
+interrupted task.
+
+@item returns to nested interrupt
+The instructions
+executed immediately following this interrupt will be in a
+previously interrupted ISR.
+
+@item returns to preempting task
+The instructions
+executed immediately following this interrupt or signal handler
+will be in a task other than the interrupted task.
+
+@item signal to self
+The signal set was sent to the
+calling task and signal processing was enabled.
+
+@item suspended task
+The task operated upon by the
+directive was in the suspended state.
+
+@item task readied
+The release of a resource caused a
+task of lower or equal priority to be readied and the calling
+task remained the executing task.
+
+@item yield
+The act of attempting to voluntarily release
+the CPU.
+
+@end table
+
diff --git a/doc/import_ami_txt b/doc/import_ami_txt
new file mode 100644
index 0000000000..3de3af993d
--- /dev/null
+++ b/doc/import_ami_txt
@@ -0,0 +1,81 @@
+#! /bin/bash
+#
+# This script converts the ASCII version of the manual saved by AmiPro
+# into a reasonably acceptable form of Texinfo. The output of this program
+# is fed into another program which inserts texinfo node and menu infomation.
+#
+
+#set -x
+
+#rm -f *.txt
+orig=/usr1/home/joel/tmp/doc/relnotes
+inputfiles=`cd $orig ; echo *.txt`
+
+for i in $inputfiles
+do
+ echo $i
+ out=`echo $i | sed -e 's/\.txt$/.texi/'`
+ # 1. Remove <ctl>-Z and <ctl>-M
+ # 2. Tackle paragraph style issues
+ # 3. Directive status code lines
+
+ tr -d '\032\015' <${orig}/$i |
+ sed -e 's/<Topic Lvl 0>/@chapter /' |
+ sed -e 's/<Topic Lvl 1>/@section /' |
+ sed -e 's/<Topic Lvl 2>/@subsection /' |
+ sed -e 's/<Topic Lvl 3>/@subsection /' |
+ sed -e 's/<Body Text>//' |
+ sed -e 's/<Directive Tbl>/@item /' |
+ sed -e 's/<Table Title>/@itemize /' |
+ sed -e 's/<Bullet>/@item /' |
+ sed -e 's/<Bullet 2>/@item /' |
+ sed -e 's/<Table Text>/@item /' |
+ sed -e 's/<Number List>/@item /' |
+ sed -e 's/<Time Desc>/@item /' |
+ while read line
+ do
+ case $line in
+ "<C Code Exampl>"*"{") echo "@example"; echo "$line" ; read line;;
+ "<C Code Exampl>"*"(") echo "@example"; echo "$line" ; read line;;
+ "<C Code Exampl>"*");") echo "$line" ; echo "@end example" ;;
+ "<C Code Exampl>"*"}"*";") echo "$line" ; echo "@end example" ;;
+ "<C Code Exampl>"*",") echo "$line" ; read line ;;
+ "<C Code Exampl>"*";") echo "$line" ; read line ;;
+ *) echo "$line" ;;
+ esac
+ done |
+ sed -e 's/<C Code Exampl>//' |
+ sed -e 's/<Directive Tbl>/@item /' |
+ sed -e 's/<Topic>/@subheading /' |
+ sed -e 's/<Directive>/@page\
+@subsection /' |
+ sed -e 's/<Status Codes>//' |
+ sed -e 's/^\(SUCCESSFUL\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(TASK_EXITTED\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(MP_NOT_CONFIGURED\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(INVALID_NAME\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(INVALID_ID\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(TOO_MANY\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(TIMEOUT\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(OBJECT_WAS_DELETED\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(INVALID_SIZE\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(INVALID_ADDRESS\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(INVALID_NUMBER\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(NOT_DEFINED\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(RESOURCE_IN_USE\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(UNSATISFIED\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(INCORRRECT_STATE\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(ALREADY_SUSPENDED\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(ILLEGAL_ON_SELF\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(ILLEGAL_ON_REMOTE_OBJECT\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(CALLED_FROM_ISR\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(INVALID_PRIORITY\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(INVALID_TIME_OF_DAY\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(INVALID_NODE\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(NOT_CONFIGURED\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(NOT_OWNER_OF_RESOURCE\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(NOT_IMPLEMENTED\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(INTERNAL_ERROR\) - \(.*\)/@code{\1} - \2@*/' |
+ sed -e 's/^\(NO_MEMORY\) - \(.*\)/@code{\1} - \2@*/' |
+ cat >$out
+done
diff --git a/doc/new_chapters/base.texi b/doc/new_chapters/base.texi
new file mode 100644
index 0000000000..ee0c280d63
--- /dev/null
+++ b/doc/new_chapters/base.texi
@@ -0,0 +1,96 @@
+@c
+@c COPYRIGHT (c) 1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Mutex Manager, Mutex Manager Introduction, Preface, Top
+@end ifinfo
+@chapter Mutex Manager
+@ifinfo
+@menu
+* Mutex Manager Introduction::
+* Mutex Manager Background::
+* Mutex Manager Operations::
+* Mutex Manager Directives::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Mutex Manager Introduction, Mutex Manager Background, Mutex Manager, Mutex Manager
+@end ifinfo
+@section Introduction
+
+The mutex manager ...
+
+The directives provided by the mutex manager are:
+
+@itemize @bullet
+@item @code{sigaddset} -
+@item @code{sigdelset} -
+@item @code{sigfillset} -
+@item @code{sigismember} -
+@item @code{sigemptyset} -
+@item @code{sigaction} -
+@item @code{pthread_kill} -
+@item @code{pthread_sigmask} -
+@item @code{kill} -
+@item @code{sigwait} -
+@end itemize
+
+@ifinfo
+@node Mutex Manager Background, Mutex Manager Operations, Mutex Manager Introduction, Mutex Manager
+@end ifinfo
+@section Background
+
+@ifinfo
+@node Mutex Manager Operations, Mutex Manager Directives, Mutex Manager Background, Mutex Manager
+@end ifinfo
+@section Operations
+
+@ifinfo
+@node Mutex Manager Directives, sigaddset, Mutex Manager Operations, Mutex Manager
+@end ifinfo
+@section Directives
+@ifinfo
+@menu
+* sigaddset::
+* sigdelset::
+* sigfillset::
+* sigismember::
+* sigemptyset::
+* sigaction::
+* pthread_kill::
+* pthread_sigmask::
+* kill::
+* sigwait::
+@end menu
+@end ifinfo
+
+This section details the mutex manager's directives.
+A subsection is dedicated to each of this manager's directives
+and describes the calling sequence, related constants, usage,
+and status codes.
+
+@page
+@ifinfo
+@node sigaddset, sigdelset, Mutex Manager Directives, Mutex Manager Directives
+@end ifinfo
+@subsection sigaddset
+
+@subheading CALLING SEQUENCE:
+
+@example
+int sigaddset(
+ sigset_t *set,
+ int signo
+);
+@end example
+
+@subheading STATUS CODES:
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
diff --git a/doc/new_chapters/clock.texi b/doc/new_chapters/clock.texi
new file mode 100644
index 0000000000..1b64d91a6b
--- /dev/null
+++ b/doc/new_chapters/clock.texi
@@ -0,0 +1,262 @@
+@c
+@c COPYRIGHT (c) 1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Clock Manager, Clock Manager Introduction, pthread_getspecific, Top
+@end ifinfo
+@chapter Clock Manager
+@ifinfo
+@menu
+* Clock Manager Introduction::
+* Clock Manager Background::
+* Clock Manager Operations::
+* Clock Manager Directives::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Clock Manager Introduction, Clock Manager Background, Clock Manager, Clock Manager
+@end ifinfo
+@section Introduction
+
+The clock manager ...
+
+The directives provided by the clock manager are:
+
+@itemize @bullet
+@item @code{clock_gettime} -
+@item @code{clock_settime} -
+@item @code{clock_getres} -
+@item @code{nanosleep} -
+@item @code{time} -
+@end itemize
+
+@ifinfo
+@node Clock Manager Background, Clock Manager Operations, Clock Manager Introduction, Clock Manager
+@end ifinfo
+@section Background
+
+@ifinfo
+@node Clock Manager Operations, Clock Manager Directives, Clock Manager Background, Clock Manager
+@end ifinfo
+@section Operations
+
+@ifinfo
+@node Clock Manager Directives, clock_gettime, Clock Manager Operations, Clock Manager
+@end ifinfo
+@section Directives
+@ifinfo
+@menu
+* clock_gettime::
+* clock_settime::
+* clock_getres::
+* sleep::
+* nanosleep::
+* time::
+@end menu
+@end ifinfo
+
+This section details the clock manager's directives.
+A subsection is dedicated to each of this manager's directives
+and describes the calling sequence, related constants, usage,
+and status codes.
+
+@page
+@ifinfo
+@node clock_gettime, clock_settime, Clock Manager Directives, Clock Manager Directives
+@end ifinfo
+@subsection clock_gettime
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <time.h>
+
+int clock_gettime(
+ clockid_t clock_id,
+ struct timespec *tp
+);
+@end example
+
+@subheading STATUS CODES:
+
+On error, this routine returns -1 and sets errno to one of the following:
+
+@table @b
+@item EINVAL
+The tp pointer parameter is invalid.
+
+@item EINVAL
+The clock_id specified is invalid.
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node clock_settime, clock_getres, clock_gettime, Clock Manager Directives
+@end ifinfo
+@subsection clock_settime
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <time.h>
+
+int clock_settime(
+ clockid_t clock_id,
+ const struct timespec *tp
+);
+@end example
+
+@subheading STATUS CODES:
+
+On error, this routine returns -1 and sets errno to one of the following:
+
+@table @b
+@item EINVAL
+The tp pointer parameter is invalid.
+
+@item EINVAL
+The clock_id specified is invalid.
+
+@item EINVAL
+The contents of the tp structure are invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node clock_getres, sleep, clock_settime, Clock Manager Directives
+@end ifinfo
+@subsection clock_getres
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <time.h>
+
+int clock_getres(
+ clockid_t clock_id,
+ struct timespec *res
+);
+@end example
+
+@subheading STATUS CODES:
+
+On error, this routine returns -1 and sets errno to one of the following:
+
+@table @b
+@item EINVAL
+The res pointer parameter is invalid.
+
+@item EINVAL
+The clock_id specified is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+If res is NULL, then the resolution is not returned.
+
+@page
+@ifinfo
+@node sleep, nanosleep, clock_getres, Clock Manager Directives
+@end ifinfo
+@subsection sleep
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <time.h>
+
+unsigned int sleep(
+ unsigned int seconds
+);
+@end example
+
+@subheading STATUS CODES:
+
+This routine returns the number of unslept seconds.
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+This call is interruptible by a signal.
+
+@page
+@ifinfo
+@node nanosleep, time, sleep, Clock Manager Directives
+@end ifinfo
+@subsection nanosleep
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <time.h>
+
+int nanosleep(
+ const struct timespec *rqtp,
+ struct timespec *rmtp
+);
+@end example
+
+@subheading STATUS CODES:
+
+On error, this routine returns -1 and sets errno to one of the following:
+
+@table @b
+@item EINTR
+The routine was interrupted by a signal.
+
+@item EAGAIN
+The requested sleep period specified negative seconds or nanoseconds.
+
+@item EINVAL
+The requested sleep period specified an invalid number for the nanoseconds
+field.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+This call is interruptible by a signal.
+
+@page
+@ifinfo
+@node time, Scheduler Manager, nanosleep, Clock Manager Directives
+@end ifinfo
+@subsection nanosleep
+
+@subheading time SEQUENCE:
+
+@example
+#include <time.h>
+
+int time(
+ time_t *tloc
+);
+@end example
+
+@subheading STATUS CODES:
+
+This routine returns the number of seconds since the Epoch.
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
diff --git a/doc/new_chapters/cond.texi b/doc/new_chapters/cond.texi
new file mode 100644
index 0000000000..284f0793a9
--- /dev/null
+++ b/doc/new_chapters/cond.texi
@@ -0,0 +1,384 @@
+@c
+@c COPYRIGHT (c) 1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Condition Variable Manager, Condition Variable Manager Introduction, pthread_mutex_getprioceiling, Top
+@end ifinfo
+@chapter Condition Variable Manager
+@ifinfo
+@menu
+* Condition Variable Manager Introduction::
+* Condition Variable Manager Background::
+* Condition Variable Manager Operations::
+* Condition Variable Manager Directives::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Condition Variable Manager Introduction, Condition Variable Manager Background, Condition Variable Manager, Condition Variable Manager
+@end ifinfo
+@section Introduction
+
+The condition variable manager ...
+
+The directives provided by the condition variable manager are:
+
+@itemize @bullet
+@item @code{pthread_condattr_init} -
+@item @code{pthread_condattr_destroy} -
+@item @code{pthread_condattr_setpshared} -
+@item @code{pthread_condattr_getpshared} -
+@item @code{pthread_cond_init} -
+@item @code{pthread_cond_destroy} -
+@item @code{pthread_cond_signal} -
+@item @code{pthread_cond_broadcast} -
+@item @code{pthread_cond_wait} -
+@item @code{pthread_cond_timedwait} -
+@end itemize
+
+@ifinfo
+@node Condition Variable Manager Background, Condition Variable Manager Operations, Condition Variable Manager Introduction, Condition Variable Manager
+@end ifinfo
+@section Background
+
+@ifinfo
+@node Condition Variable Manager Operations, Condition Variable Manager Directives, Condition Variable Manager Background, Condition Variable Manager
+@end ifinfo
+@section Operations
+
+@ifinfo
+@node Condition Variable Manager Directives, pthread_condattr_init, Condition Variable Manager Operations, Condition Variable Manager
+@end ifinfo
+@section Directives
+@ifinfo
+@menu
+* pthread_condattr_init::
+* pthread_condattr_destroy::
+* pthread_condattr_setpshared::
+* pthread_condattr_getpshared::
+* pthread_cond_init::
+* pthread_cond_destroy::
+* pthread_cond_signal::
+* pthread_cond_broadcast::
+* pthread_cond_wait::
+* pthread_cond_timedwait::
+@end menu
+@end ifinfo
+
+This section details the condition variable manager's directives.
+A subsection is dedicated to each of this manager's directives
+and describes the calling sequence, related constants, usage,
+and status codes.
+
+@page
+@ifinfo
+@node pthread_condattr_init, pthread_condattr_destroy, Condition Variable Manager Directives, Condition Variable Manager Directives
+@end ifinfo
+@subsection pthread_condattr_init
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_condattr_init(
+ pthread_condattr_t *attr
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item ENOMEM
+Insufficient memory is available to initialize the condition variable
+attributes object.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_condattr_destroy, pthread_condattr_setpshared, pthread_condattr_init, Condition Variable Manager Directives
+@end ifinfo
+@subsection pthread_condattr_destroy
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_condattr_destroy(
+ pthread_condattr_t *attr
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+The attribute object specified is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_condattr_setpshared, pthread_condattr_getpshared, pthread_condattr_destroy, Condition Variable Manager Directives
+@end ifinfo
+@subsection pthread_condattr_setpshared
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_condattr_setpshared(
+ pthread_condattr_t *attr,
+ int pshared
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+Invalid argument passed.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_condattr_getpshared, pthread_cond_init, pthread_condattr_setpshared, Condition Variable Manager Directives
+@end ifinfo
+@subsection pthread_condattr_getpshared
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_condattr_getpshared(
+ const pthread_condattr_t *attr,
+ int *pshared
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+Invalid argument passed.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+
+@page
+@ifinfo
+@node pthread_cond_init, pthread_cond_destroy, pthread_condattr_getpshared, Condition Variable Manager Directives
+@end ifinfo
+@subsection pthread_cond_init
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_cond_init(
+ pthread_cond_t *cond,
+ const pthread_condattr_t *attr
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EAGAIN
+The system lacked a resource other than memory necessary to create the
+initialize the condition variable object.
+
+@item ENOMEM
+Insufficient memory is available to initialize the condition variable object.
+
+@item EBUSY
+The specified condition variable has already been initialized.
+
+@item EINVAL
+The specified attribute value is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_cond_destroy, pthread_cond_signal, pthread_cond_init, Condition Variable Manager Directives
+@end ifinfo
+@subsection pthread_cond_destroy
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_cond_destroy(
+ pthread_cond_t *cond
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+The specified condition variable is invalid.
+
+@item EBUSY
+The specified condition variable is currently in use.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_cond_signal, pthread_cond_broadcast, pthread_cond_destroy, Condition Variable Manager Directives
+@end ifinfo
+@subsection pthread_cond_signal
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_cond_signal(
+ pthread_cond_t *cond
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+The specified condition variable is not valid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+This routine should not be invoked from a handler from an asynchronous signal
+handler or an interrupt service routine.
+
+@page
+@ifinfo
+@node pthread_cond_broadcast, pthread_cond_wait, pthread_cond_signal, Condition Variable Manager Directives
+@end ifinfo
+@subsection pthread_cond_broadcast
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_cond_broadcast(
+ pthread_cond_t *cond
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+The specified condition variable is not valid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+This routine should not be invoked from a handler from an asynchronous signal
+handler or an interrupt service routine.
+
+@page
+@ifinfo
+@node pthread_cond_wait, pthread_cond_timedwait, pthread_cond_broadcast, Condition Variable Manager Directives
+@end ifinfo
+@subsection pthread_cond_wait
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_cond_wait(
+ pthread_cond_t *cond,
+ pthread_mutex_t *mutex
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+The specified condition variable or mutex is not initialized OR different
+mutexes were specified for concurrent pthread_cond_wait() and
+pthread_cond_timedwait() operations on the same condition variable OR
+the mutex was not owned by the current thread at the time of the call.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_cond_timedwait, Key Manager, pthread_cond_wait, Condition Variable Manager Directives
+@end ifinfo
+@subsection pthread_cond_timedwait
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_cond_timedwait(
+ pthread_cond_t *cond,
+ pthread_mutex_t *mutex,
+ const struct timespec *abstime
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+The specified condition variable or mutex is not initialized OR different
+mutexes were specified for concurrent pthread_cond_wait() and
+pthread_cond_timedwait() operations on the same condition variable OR
+the mutex was not owned by the current thread at the time of the call.
+
+@item ETIMEDOUT
+The specified time has elapsed without the condition variable being
+satisfied.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
diff --git a/doc/new_chapters/key.texi b/doc/new_chapters/key.texi
new file mode 100644
index 0000000000..90569d0e27
--- /dev/null
+++ b/doc/new_chapters/key.texi
@@ -0,0 +1,177 @@
+@c
+@c COPYRIGHT (c) 1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Key Manager, Key Manager Introduction, pthread_cond_timedwait, Top
+@end ifinfo
+@chapter Key Manager
+@ifinfo
+@menu
+* Key Manager Introduction::
+* Key Manager Background::
+* Key Manager Operations::
+* Key Manager Directives::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Key Manager Introduction, Key Manager Background, Key Manager, Key Manager
+@end ifinfo
+@section Introduction
+
+The key manager ...
+
+The directives provided by the key manager are:
+
+@itemize @bullet
+@item @code{pthread_key_create} -
+@item @code{pthread_key_delete} -
+@item @code{pthread_setspecific} -
+@item @code{pthread_getspecific} -
+@end itemize
+
+@ifinfo
+@node Key Manager Background, Key Manager Operations, Key Manager Introduction, Key Manager
+@end ifinfo
+@section Background
+
+@ifinfo
+@node Key Manager Operations, Key Manager Directives, Key Manager Background, Key Manager
+@end ifinfo
+@section Operations
+
+@ifinfo
+@node Key Manager Directives, pthread_key_create, Key Manager Operations, Key Manager
+@end ifinfo
+@section Directives
+@ifinfo
+@menu
+* pthread_key_create::
+* pthread_key_delete::
+* pthread_setspecific::
+* pthread_getspecific::
+@end menu
+@end ifinfo
+
+This section details the key manager's directives.
+A subsection is dedicated to each of this manager's directives
+and describes the calling sequence, related constants, usage,
+and status codes.
+
+@page
+@ifinfo
+@node pthread_key_create, pthread_key_delete, Key Manager Directives, Key Manager Directives
+@end ifinfo
+@subsection pthread_key_create
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_key_create(
+ pthread_key_t *key,
+ void (*destructor)( void * )
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EAGAIN
+There were not enough resources available to create another key.
+
+@item ENOMEM
+Insufficient memory exists to create the key.
+
+@end table
+
+@page
+@ifinfo
+@node pthread_key_delete, pthread_setspecific, pthread_key_create, Key Manager Directives
+@end ifinfo
+@subsection pthread_key_delete
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_key_delete(
+ pthread_key_t key,
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The key was invalid
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_setspecific, pthread_getspecific, pthread_key_delete, Key Manager Directives
+@end ifinfo
+@subsection pthread_setspecific
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_setspecific(
+ pthread_key_t key,
+ const void *value
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+The specified key is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_getspecific, Clock Manager, pthread_setspecific, Key Manager Directives
+@end ifinfo
+@subsection pthread_getspecific
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+void *pthread_getspecific(
+ pthread_key_t key
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item NULL
+There is no thread-specific data associated with the specified key.
+
+@item non-NULL
+The data associated with the specified key.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
diff --git a/doc/new_chapters/mutex.texi b/doc/new_chapters/mutex.texi
new file mode 100644
index 0000000000..37ea926b96
--- /dev/null
+++ b/doc/new_chapters/mutex.texi
@@ -0,0 +1,640 @@
+@c
+@c COPYRIGHT (c) 1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Mutex Manager, Mutex Manager Introduction, alarm, Top
+@end ifinfo
+@chapter Mutex Manager
+@ifinfo
+@menu
+* Mutex Manager Introduction::
+* Mutex Manager Background::
+* Mutex Manager Operations::
+* Mutex Manager Directives::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Mutex Manager Introduction, Mutex Manager Background, Mutex Manager, Mutex Manager
+@end ifinfo
+@section Introduction
+
+The mutex manager ...
+
+The directives provided by the mutex manager are:
+
+@itemize @bullet
+@item @code{pthread_mutexattr_init} -
+@item @code{pthread_mutexattr_destroy} -
+@item @code{pthread_mutexattr_setprotocol} -
+@item @code{pthread_mutexattr_getprotocol} -
+@item @code{pthread_mutexattr_setprioceiling} -
+@item @code{pthread_mutexattr_getprioceiling} -
+@item @code{pthread_mutexattr_setpshared} -
+@item @code{pthread_mutexattr_getpshared} -
+@item @code{pthread_mutex_init} -
+@item @code{pthread_mutex_destroy} -
+@item @code{pthread_mutex_lock} -
+@item @code{pthread_mutex_trylock} -
+@item @code{pthread_mutex_timedlock} -
+@item @code{pthread_mutex_unlock} -
+@item @code{pthread_mutex_setprioceiling} -
+@item @code{pthread_mutex_getprioceiling} -
+@end itemize
+
+@ifinfo
+@node Mutex Manager Background, Mutex Manager Operations, Mutex Manager Introduction, Mutex Manager
+@end ifinfo
+@section Background
+
+@ifinfo
+@node Mutex Manager Operations, Mutex Manager Directives, Mutex Manager Background, Mutex Manager
+@end ifinfo
+@section Operations
+
+@ifinfo
+@node Mutex Manager Directives, pthread_mutexattr_init, Mutex Manager Operations, Mutex Manager
+@end ifinfo
+@section Directives
+@ifinfo
+@menu
+* pthread_mutexattr_init::
+* pthread_mutexattr_destroy::
+* pthread_mutexattr_setprotocol::
+* pthread_mutexattr_getprotocol::
+* pthread_mutexattr_setprioceiling::
+* pthread_mutexattr_getprioceiling::
+* pthread_mutexattr_setpshared::
+* pthread_mutexattr_getpshared::
+* pthread_mutex_init::
+* pthread_mutex_destroy::
+* pthread_mutex_lock::
+* pthread_mutex_trylock::
+* pthread_mutex_timedlock::
+* pthread_mutex_unlock::
+* pthread_mutex_setprioceiling::
+* pthread_mutex_getprioceiling::
+@end menu
+@end ifinfo
+
+This section details the mutex manager's directives.
+A subsection is dedicated to each of this manager's directives
+and describes the calling sequence, related constants, usage,
+and status codes.
+
+@page
+@ifinfo
+@node pthread_mutexattr_init, pthread_mutexattr_destroy, Mutex Manager Directives, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutexattr_init
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutexattr_init(
+ pthread_mutexattr_t *attr
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_mutexattr_destroy, pthread_mutexattr_setprotocol, pthread_mutexattr_init, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutexattr_destroy
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutexattr_destroy(
+ pthread_mutexattr_t *attr
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_mutexattr_setprotocol, pthread_mutexattr_getprotocol, pthread_mutexattr_destroy, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutexattr_setprotocol
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutexattr_setprotocol(
+ pthread_mutexattr_t *attr,
+ int protocol
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The protocol argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_mutexattr_getprotocol, pthread_mutexattr_setprioceiling, pthread_mutexattr_setprotocol, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutexattr_getprotocol
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutexattr_getprotocol(
+ pthread_mutexattr_t *attr,
+ int *protocol
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The protocol pointer argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_mutexattr_setprioceiling, pthread_mutexattr_getprioceiling, pthread_mutexattr_getprotocol, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutexattr_setprioceiling
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutexattr_setprioceiling(
+ pthread_mutexattr_t *attr,
+ int prioceiling
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The prioceiling argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_mutexattr_getprioceiling, pthread_mutexattr_setpshared, pthread_mutexattr_setprioceiling, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutexattr_getprioceiling
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutexattr_getprioceiling(
+ const pthread_mutexattr_t *attr,
+ int *prioceiling
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The prioceiling pointer argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_mutexattr_setpshared, pthread_mutexattr_getpshared, pthread_mutexattr_getprioceiling, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutexattr_setpshared
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutexattr_setpshared(
+ pthread_mutexattr_t *attr,
+ int pshared
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The pshared argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_mutexattr_getpshared, pthread_mutex_init, pthread_mutexattr_setpshared, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutexattr_getpshared
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutexattr_getpshared(
+ const pthread_mutexattr_t *attr,
+ int *pshared
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The pshared pointer argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_mutex_init, pthread_mutex_destroy, pthread_mutexattr_getpshared, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutex_init
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutex_init(
+ pthread_mutex_t *mutex,
+ const pthread_mutexattr_t *attr
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The specified protocol is invalid.
+
+@item EAGAIN
+The system lacked the necessary resources to initialize another mutex.
+
+@item ENOMEM
+Insufficient memory exists to initialize the mutex.
+
+@item EBUSY
+Attempted to reinialize the object reference by mutex, a previously
+initialized, but not yet destroyed.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_mutex_destroy, pthread_mutex_lock, pthread_mutex_init, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutex_destroy
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutex_destroy(
+ pthread_mutex_t *mutex
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The specified mutex is invalid.
+
+@item EBUSY
+Attempted to destroy the object reference by mutex, while it is locked or
+referenced by another thread.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_destroy, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutex_lock
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutex_lock(
+ pthread_mutex_t *mutex
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The specified mutex is invalid.
+
+@item EINVAL
+The mutex has the protocol attribute of PTHREAD_PRIO_PROTECT and the
+priority of the calling thread is higher than the current priority
+ceiling.
+
+@item EDEADLK
+The current thread already owns the mutex.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_mutex_trylock, pthread_mutex_timedlock, pthread_mutex_lock, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutex_trylock
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutex_trylock(
+ pthread_mutex_t *mutex
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The specified mutex is invalid.
+
+@item EINVAL
+The mutex has the protocol attribute of PTHREAD_PRIO_PROTECT and the
+priority of the calling thread is higher than the current priority
+ceiling.
+
+@item EDEADLK
+The current thread already owns the mutex.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_mutex_timedlock, pthread_mutex_unlock, pthread_mutex_trylock, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutex_timedlock
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+#include <time.h>
+
+int pthread_mutex_timedlock(
+ pthread_mutex_t *mutex,
+ const struct timespec *timeout
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The specified mutex is invalid.
+
+@item EINVAL
+The nanoseconds field of timeout is invalid.
+
+@item EINVAL
+The mutex has the protocol attribute of PTHREAD_PRIO_PROTECT and the
+priority of the calling thread is higher than the current priority
+ceiling.
+
+@item EDEADLK
+The current thread already owns the mutex.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+
+@page
+@ifinfo
+@node pthread_mutex_unlock, pthread_mutex_setprioceiling, pthread_mutex_timedlock, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutex_unlock
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutex_unlock(
+ pthread_mutex_t *mutex
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The specified mutex is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_mutex_setprioceiling, pthread_mutex_getprioceiling, pthread_mutex_unlock, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutex_setprioceiling
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutex_setprioceiling(
+ pthread_mutex_t *mutex,
+ int prioceiling,
+ int *oldceiling
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The oldceiling pointer parameter is invalid.
+
+@item EINVAL
+The prioceiling parameter is an invalid priority.
+
+@item EINVAL
+The specified mutex is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_mutex_getprioceiling, Condition Variable Manager, pthread_mutex_setprioceiling, Mutex Manager Directives
+@end ifinfo
+@subsection pthread_mutex_getprioceiling
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_mutex_getprioceiling(
+ pthread_mutex_t *mutex,
+ int *prioceiling
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The prioceiling pointer parameter is invalid.
+
+@item EINVAL
+The specified mutex is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
diff --git a/doc/new_chapters/posix_test_plan.texi b/doc/new_chapters/posix_test_plan.texi
new file mode 100644
index 0000000000..da06fee1a4
--- /dev/null
+++ b/doc/new_chapters/posix_test_plan.texi
@@ -0,0 +1,123 @@
+\input ../texinfo/texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename posix_test_plan
+@syncodeindex vr fn
+@synindex ky cp
+@paragraphindent 0
+@c @smallbook
+@c %**end of header
+
+@c
+@c COPYRIGHT (c) 1988-1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@c
+@c Master file for the C User's Guide
+@c
+
+@c Joel's Questions
+@c
+@c 1. Why does paragraphindent only impact makeinfo?
+@c 2. Why does paragraphindent show up in HTML?
+@c
+
+@include ../common/setup.texi
+
+@ignore
+@ifinfo
+@format
+START-INFO-DIR-ENTRY
+* RTEMS Posix Test Plan: (posix_test_plan). Posix Test Plan
+END-INFO-DIR-ENTRY
+@end format
+@end ifinfo
+@end ignore
+
+@c variable substitution info:
+@c
+@c @set RTEMS-LANGUAGE C
+@c the language is @value{RTEMS-LANGUAGE}
+@c NOTE: don't use underscore in the name
+@c
+
+@c
+@c Title Page Stuff
+@c
+
+@set edition 4.0.0a
+@set update-date 1 June 97
+@set update-month June 97
+
+@c
+@c I don't really like having a short title page. --joel
+@c
+@c @shorttitlepage RTEMS POSIX API Test Plan
+
+@setchapternewpage odd
+@settitle RTEMS POSIX API Test Plan
+@titlepage
+@finalout
+
+@title RTEMS POSIX API Test Plan
+@subtitle Edition @value{edition}, for RTEMS 4.0.0
+@sp 1
+@subtitle @value{update-month}
+@author On-Line Applications Research Corporation
+@page
+@include ../common/cpright.texi
+@end titlepage
+
+@c This prevents a black box from being printed on "overflow" lines.
+@c The alternative is to rework a sentence to avoid this problem.
+
+@include preface.texi
+@include thread.texi
+@include signal.texi
+@include mutex.texi
+@include cond.texi
+@include key.texi
+@include clock.texi
+@include sched.texi
+@ifinfo
+@node Top, Preface, (dir), (dir)
+@top posix_test_plan
+
+This is the online version of the RTEMS POSIX API Test Plan.
+
+@menu
+* Preface::
+* Thread Manager::
+* Signal Manager::
+* Mutex Manager::
+* Condition Variable Manager::
+* Key Manager::
+* Clock Manager::
+* Scheduler Manager::
+* Command and Variable Index::
+* Concept Index::
+@end menu
+
+@end ifinfo
+@c
+@c
+@c Need to copy the emacs stuff and "trailer stuff" (index, toc) into here
+@c
+
+@node Command and Variable Index, Concept Index, sched_yield, Top
+@unnumbered Command and Variable Index
+
+There are currently no Command and Variable Index entries.
+
+@c @printindex fn
+
+@node Concept Index, , Command and Variable Index, Top
+@unnumbered Concept Index
+
+There are currently no Concept Index entries.
+@c @printindex cp
+
+@contents
+@bye
+
diff --git a/doc/new_chapters/sched.texi b/doc/new_chapters/sched.texi
new file mode 100644
index 0000000000..f8211b51a7
--- /dev/null
+++ b/doc/new_chapters/sched.texi
@@ -0,0 +1,226 @@
+@c
+@c COPYRIGHT (c) 1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Scheduler Manager, Scheduler Manager Introduction, time, Top
+@end ifinfo
+@chapter Scheduler Manager
+@ifinfo
+@menu
+* Scheduler Manager Introduction::
+* Scheduler Manager Background::
+* Scheduler Manager Operations::
+* Scheduler Manager Directives::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Scheduler Manager Introduction, Scheduler Manager Background, Scheduler Manager, Scheduler Manager
+@end ifinfo
+@section Introduction
+
+The scheduler manager ...
+
+The directives provided by the scheduler manager are:
+
+@itemize @bullet
+@item @code{sched_get_priority_min} -
+@item @code{sched_get_priority_max} -
+@item @code{sched_rr_get_interval} -
+@item @code{sched_yield} -
+@end itemize
+
+@ifinfo
+@node Scheduler Manager Background, Priority, Scheduler Manager Introduction, Scheduler Manager
+@end ifinfo
+@section Background
+@ifinfo
+@menu
+* Priority::
+* Scheduling Policies::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Priority, Scheduling Policies, Scheduler Manager Background, Scheduler Manager Background
+@end ifinfo
+@subsection Priority
+
+In the RTEMS implementation of the POSIX API, the priorities range from
+the low priority of sched_get_priority_min() to the highest priority of
+sched_get_priority_max(). Numerically higher values represent higher
+priorities.
+
+@ifinfo
+@node Scheduling Policies, Scheduler Manager Operations, Priority, Scheduler Manager Background
+@end ifinfo
+@subsection Scheduling Policies
+
+The following scheduling policies are available:
+
+@table @b
+@item SCHED_FIFO
+Priority-based, preemptive scheduling with no timeslicing. This is equivalent
+to what is called "manual round-robin" scheduling.
+
+@item SCHED_RR
+Priority-based, preemptive scheduling with timeslicing. Time quantums are
+maintained on a per-thread basis and are not reset at each context switch.
+Thus, a thread which is preempted and subsequently resumes execution will
+attempt to complete the unused portion of its time quantum.
+
+@item SCHED_OTHER
+Priority-based, preemptive scheduling with timeslicing. Time quantums are
+maintained on a per-thread basis and are reset at each context switch.
+
+@item SCHED_SPORADIC
+Priority-based, preemptive scheduling utilizing three additional parameters:
+budget, replenishment period, and low priority. Under this policy, the
+thread is allowed to execute for "budget" amount of time before its priority
+is lowered to "low priority". At the end of each replenishment period,
+the thread resumes its initial priority and has its budget replenished.
+
+@end table
+
+@ifinfo
+@node Scheduler Manager Operations, Scheduler Manager Directives, Scheduling Policies, Scheduler Manager
+@end ifinfo
+@section Operations
+
+@ifinfo
+@node Scheduler Manager Directives, sched_get_priority_min, Scheduler Manager Operations, Scheduler Manager
+@end ifinfo
+@section Directives
+@ifinfo
+@menu
+* sched_get_priority_min::
+* sched_get_priority_max::
+* sched_rr_get_interval::
+* sched_yield::
+@end menu
+@end ifinfo
+
+This section details the scheduler manager's directives.
+A subsection is dedicated to each of this manager's directives
+and describes the calling sequence, related constants, usage,
+and status codes.
+
+@page
+@ifinfo
+@node sched_get_priority_min, sched_get_priority_max, Scheduler Manager Directives, Scheduler Manager Directives
+@end ifinfo
+@subsection sched_get_priority_min
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <sched.h>
+
+int sched_get_priority_min(
+ int policy
+);
+@end example
+
+@subheading STATUS CODES:
+
+On error, this routine returns -1 and sets errno to one of the following:
+
+@table @b
+@item EINVAL
+The indicated policy is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node sched_get_priority_max, sched_rr_get_interval, sched_get_priority_min, Scheduler Manager Directives
+@end ifinfo
+@subsection sched_get_priority_max
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <sched.h>
+
+int sched_get_priority_max(
+ int policy
+);
+@end example
+
+@subheading STATUS CODES:
+
+On error, this routine returns -1 and sets errno to one of the following:
+
+@table @b
+@item EINVAL
+The indicated policy is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node sched_rr_get_interval, sched_yield, sched_get_priority_max, Scheduler Manager Directives
+@end ifinfo
+@subsection sched_rr_get_interval
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <sched.h>
+
+int sched_rr_get_interval(
+ pid_t pid,
+ struct timespec *interval
+);
+@end example
+
+@subheading STATUS CODES:
+
+On error, this routine returns -1 and sets errno to one of the following:
+
+@table @b
+@item ESRCH
+The indicated process id is invalid.
+
+@item EINVAL
+The specified interval pointer parameter is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node sched_yield, Command and Variable Index, sched_rr_get_interval, Scheduler Manager Directives
+@end ifinfo
+@subsection sched_yield
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <sched.h>
+
+int sched_yield( void );
+@end example
+
+@subheading STATUS CODES:
+
+This routine always returns zero to indicate success.
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
diff --git a/doc/new_chapters/signal.texi b/doc/new_chapters/signal.texi
new file mode 100644
index 0000000000..3185aeff7d
--- /dev/null
+++ b/doc/new_chapters/signal.texi
@@ -0,0 +1,689 @@
+@c
+@c COPYRIGHT (c) 1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Signal Manager, Signal Manager Introduction, pthread_getschedparam, Top
+@end ifinfo
+@chapter Signal Manager
+@ifinfo
+@menu
+* Signal Manager Introduction::
+* Signal Manager Background::
+* Signal Manager Operations::
+* Signal Manager Directives::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Signal Manager Introduction, Signal Manager Background, Signal Manager, Signal Manager
+@end ifinfo
+@section Introduction
+
+The signal manager ...
+
+The directives provided by the signal manager are:
+
+@itemize @bullet
+@item @code{sigaddset} -
+@item @code{sigdelset} -
+@item @code{sigfillset} -
+@item @code{sigismember} -
+@item @code{sigemptyset} -
+@item @code{sigaction} -
+@item @code{pthread_kill} -
+@item @code{sigprocmask} -
+@item @code{pthread_sigmask} -
+@item @code{kill} -
+@item @code{sigpending} -
+@item @code{sigsuspend} -
+@item @code{pause} -
+@item @code{sigwait} -
+@item @code{sigwaitinfo} -
+@item @code{sigtimedwait} -
+@item @code{sigqueue} -
+@item @code{alarm} -
+@end itemize
+
+@ifinfo
+@node Signal Manager Background, Signal Delivery, Signal Manager Introduction, Signal Manager
+@end ifinfo
+@section Background
+@ifinfo
+@menu
+* Signal Delivery::
+@end menu
+@end ifinfo
+
+
+@ifinfo
+@node Signal Delivery, Signal Manager Operations, Signal Manager Background, Signal Manager Background
+@end ifinfo
+@subsection Signal Delivery
+
+Signals directed at a thread are delivered to the specified thread.
+
+Signals directed at a process are delivered to a thread which is selected
+based on the following algorithm:
+
+@enumerate
+@item If the action for this signal is currently SIG_IGN, then the signal
+is simply ignored.
+
+@item If the currently executing thread has the signal unblocked, then
+the signal is delivered to it.
+
+@item If any threads are currently blocked waiting for this signal
+(sigwait()), then the signal is delivered to the highest priority
+thread waiting for this signal.
+
+@item If any other threads are willing to accept delivery of the signal, then
+the signal is delivered to the highest priority thread of this set. In the
+event, multiple threads of the same priority are willing to accept this
+signal, then priority is given first to ready threads, then to threads
+blocked on calls which may be interrupted, and finally to threads blocked
+on non-interruptible calls.
+
+@item In the event the signal still can not be delivered, then it is left
+pending. The first thread to unblock the signal (sigprocmask() or
+pthread_sigprocmask()) or to wait for this signal (sigwait()) will be
+the recipient of the signal.
+
+@end enumerate
+
+@ifinfo
+@node Signal Manager Operations, Signal Manager Directives, Signal Delivery, Signal Manager
+@end ifinfo
+@section Operations
+
+@ifinfo
+@node Signal Manager Directives, sigaddset, Signal Manager Operations, Signal Manager
+@end ifinfo
+@section Directives
+@ifinfo
+@menu
+* sigaddset::
+* sigdelset::
+* sigfillset::
+* sigismember::
+* sigemptyset::
+* sigaction::
+* pthread_kill::
+* sigprocmask::
+* pthread_sigmask::
+* kill::
+* sigpending::
+* sigsuspend::
+* pause::
+* sigwait::
+* sigwaitinfo::
+* sigtimedwait::
+* sigqueue::
+* alarm::
+@end menu
+@end ifinfo
+
+This section details the signal manager's directives.
+A subsection is dedicated to each of this manager's directives
+and describes the calling sequence, related constants, usage,
+and status codes.
+
+@page
+@ifinfo
+@node sigaddset, sigdelset, Signal Manager Directives, Signal Manager Directives
+@end ifinfo
+@subsection sigaddset
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int sigaddset(
+ sigset_t *set,
+ int signo
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+Invalid argument passed.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node sigdelset, sigfillset, sigaddset, Signal Manager Directives
+@end ifinfo
+@subsection sigdelset
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int sigdelset(
+ sigset_t *set,
+ int signo
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+Invalid argument passed.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node sigfillset, sigismember, sigdelset, Signal Manager Directives
+@end ifinfo
+@subsection sigfillset
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int sigfillset(
+ sigset_t *set
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+Invalid argument passed.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node sigismember, sigemptyset, sigfillset, Signal Manager Directives
+@end ifinfo
+@subsection sigismember
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int sigismember(
+ const sigset_t *set,
+ int signo
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+Invalid argument passed.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node sigemptyset, sigaction, sigismember, Signal Manager Directives
+@end ifinfo
+@subsection sigemptyset
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int sigemptyset(
+ sigset_t *set
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+Invalid argument passed.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node sigaction, pthread_kill, sigemptyset, Signal Manager Directives
+@end ifinfo
+@subsection sigaction
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int sigaction(
+ int sig,
+ const struct sigaction *act,
+ struct sigaction *oact
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+Invalid argument passed.
+
+@item ENOTSUP
+Realtime Signals Extension option not supported.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+The signal number cannot be SIGKILL.
+@page
+@ifinfo
+@node pthread_kill, sigprocmask, sigaction, Signal Manager Directives
+@end ifinfo
+@subsection pthread_kill
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int pthread_kill(
+ pthread_t thread,
+ int sig
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item ESRCH
+The thread indicated by the parameter thread is invalid.
+
+@item EINVAL
+Invalid argument passed.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node sigprocmask, pthread_sigmask, pthread_kill, Signal Manager Directives
+@end ifinfo
+@subsection sigprocmask
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int sigprocmask(
+ int how,
+ const sigset_t *set,
+ sigset_t *oset
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+Invalid argument passed.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+
+@page
+@ifinfo
+@node pthread_sigmask, kill, sigprocmask, Signal Manager Directives
+@end ifinfo
+@subsection pthread_sigmask
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int pthread_sigmask(
+ int how,
+ const sigset_t *set,
+ sigset_t *oset
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+Invalid argument passed.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+
+@page
+@ifinfo
+@node kill, sigpending, pthread_sigmask, Signal Manager Directives
+@end ifinfo
+@subsection kill
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <sys/types.h>
+#include <signal.h>
+
+int kill(
+ pid_t pid,
+ int sig
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+Invalid argument passed.
+
+@item EPERM
+Process does not have permission to send the signal to any receiving process.
+
+@item ESRCH
+The process indicated by the parameter pid is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+
+@page
+@ifinfo
+@node sigpending, sigsuspend, kill, Signal Manager Directives
+@end ifinfo
+@subsection sigpending
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int sigpending(
+ const sigset_t *set
+);
+@end example
+
+@subheading STATUS CODES:
+
+On error, this routine returns -1 and sets errno to one of the following:
+
+@table @b
+@item EFAULT
+Invalid address for set.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node sigsuspend, pause, sigpending, Signal Manager Directives
+@end ifinfo
+@subsection sigsuspend
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int sigsuspend(
+ const sigset_t *sigmask
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+Returns -1 and sets errno.
+
+@item EINTR
+Signal interrupted this function.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pause, sigwait, sigsuspend, Signal Manager Directives
+@end ifinfo
+@subsection pause
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int pause( void );
+@end example
+
+@subheading STATUS CODES:
+@table @b
+Returns -1 and sets errno.
+
+@item EINTR
+Signal interrupted this function.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node sigwait, sigwaitinfo, pause, Signal Manager Directives
+@end ifinfo
+@subsection sigwait
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int sigwait(
+ const sigset_t *set,
+ int *sig
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+Invalid argument passed.
+
+@item EINTR
+Signal interrupted this function.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node sigwaitinfo, sigtimedwait, sigwait, Signal Manager Directives
+@end ifinfo
+@subsection sigwaitinfo
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int sigwaitinfo(
+ const sigset_t *set,
+ siginfo_t *info
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINTR
+Signal interrupted this function.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node sigtimedwait, sigqueue, sigwaitinfo, Signal Manager Directives
+@end ifinfo
+@subsection sigtimedwait
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int sigtimedwait(
+ const sigset_t *set,
+ siginfo_t *info,
+ const struct timespec *timeout
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EAGAIN
+Timed out while waiting for the specified signal set.
+
+@item EINVAL
+Nanoseconds field of the timeout argument is invalid.
+
+@item EINTR
+Signal interrupted this function.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+If timeout is NULL, then the thread will wait forever for the specified
+signal set.
+
+@page
+@ifinfo
+@node sigqueue, alarm, sigtimedwait, Signal Manager Directives
+@end ifinfo
+@subsection sigqueue
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+int sigqueue(
+ pid_t pid,
+ int signo,
+ const union sigval value
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+
+@item EAGAIN
+No resources available to queue the signal. The process has already
+queued SIGQUEUE_MAX signals that are still pending at the receiver
+or the systemwide resource limit has been exceeded.
+
+@item EINVAL
+The value of the signo argument is an invalid or unsupported signal
+number.
+
+@item EPERM
+The process does not have the appropriate privilege to send the signal
+to the receiving process.
+
+@item ESRCH
+The process pid does not exist.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+
+@page
+@ifinfo
+@node alarm, Mutex Manager, sigqueue, Signal Manager Directives
+@end ifinfo
+@subsection alarm
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <signal.h>
+
+unsigned int alarm(
+ unsigned int seconds
+);
+@end example
+
+@subheading STATUS CODES:
+
+If there was a previous alarm() request with time remaining, then this routine
+returns the number of seconds until that outstanding alarm would have fired.
+If no previous alarm() request was outstanding, then zero is returned.
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+
diff --git a/doc/new_chapters/thread.texi b/doc/new_chapters/thread.texi
new file mode 100644
index 0000000000..56f8bf9be5
--- /dev/null
+++ b/doc/new_chapters/thread.texi
@@ -0,0 +1,1023 @@
+@c
+@c COPYRIGHT (c) 1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Thread Manager, Thread Manager Introduction, Preface, Top
+@end ifinfo
+@chapter Thread Manager
+@ifinfo
+@menu
+* Thread Manager Introduction::
+* Thread Manager Background::
+* Thread Manager Operations::
+* Thread Manager Directives::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Thread Manager Introduction, Thread Manager Background, Thread Manager, Thread Manager
+@end ifinfo
+@section Introduction
+
+The thread manager ...
+
+The directives provided by the thread manager are:
+
+@itemize @bullet
+@item @code{pthread_attr_init} -
+@item @code{pthread_attr_destroy} -
+@item @code{pthread_attr_setdetachstate} -
+@item @code{pthread_attr_getdetachstate} -
+@item @code{pthread_attr_setstacksize} -
+@item @code{pthread_attr_getstacksize} -
+@item @code{pthread_attr_setstackaddr} -
+@item @code{pthread_attr_getstackaddr} -
+@item @code{pthread_attr_setscope} -
+@item @code{pthread_attr_getscope} -
+@item @code{pthread_attr_setinheritsched} -
+@item @code{pthread_attr_getinheritsched} -
+@item @code{pthread_attr_setschedpolicy} -
+@item @code{pthread_attr_getschedpolicy} -
+@item @code{pthread_attr_setschedparam} -
+@item @code{pthread_attr_getschedparam} -
+@item @code{pthread_create} -
+@item @code{pthread_exit} -
+@item @code{pthread_detach} -
+@item @code{pthread_join} -
+@item @code{pthread_self} -
+@item @code{pthread_equal} -
+@item @code{pthread_once} -
+@item @code{pthread_setschedparam} -
+@item @code{pthread_getschedparam} -
+@end itemize
+
+@ifinfo
+@node Thread Manager Background, Thread Attributes, Thread Manager Introduction, Thread Manager
+@end ifinfo
+@section Background
+@ifinfo
+@menu
+* Thread Attributes::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Thread Attributes, Thread Manager Operations, Thread Manager Background, Thread Manager Background
+@end ifinfo
+@subsection Thread Attributes
+
+Thread attributes are utilized only at thread creation time.
+
+@table @b
+@item stack address
+is the address of the optionally user specified stack area for this thread.
+If this value is NULL, then RTEMS allocates the memory for the thread stack
+from the RTEMS Workspace Area. Otherwise, this is the user specified
+address for the memory to be used for the thread's stack. Each thread must
+have a distinct stack area. Each processor family has different alignment
+rules which should be followed.
+
+@item stack size
+is the minimum desired size for this thread's stack area.
+If the size of this area as specified by the stack size attribute
+is smaller than the minimum for this processor family and the stack
+is not user specified, then RTEMS will automatically allocate a
+stack of the minimum size for this processor family.
+
+@item contention scope
+specifies the scheduling contention scope. RTEMS only supports the
+PTHREAD_SCOPE_PROCESS scheduling contention scope.
+
+@item scheduling inheritance
+specifies whether a user specified or the scheduling policy and
+parameters of the currently executing thread are to be used. When
+this is PTHREAD_INHERIT_SCHED, then the scheduling policy and
+parameters of the currently executing thread are inherited by
+the newly created thread.
+
+@item scheduling policy and parameters
+specify the manner in which the thread will contend for the processor.
+The scheduling parameters are interpreted based on the specified policy.
+All policies utilize the thread priority parameter.
+
+@end table
+
+@ifinfo
+@node Thread Manager Operations, Thread Manager Directives, Thread Attributes, Thread Manager
+@end ifinfo
+@section Operations
+
+@ifinfo
+@node Thread Manager Directives, pthread_attr_init, Thread Manager Operations, Thread Manager
+@end ifinfo
+@section Directives
+@ifinfo
+@menu
+* pthread_attr_init::
+* pthread_attr_destroy::
+* pthread_attr_setdetachstate::
+* pthread_attr_getdetachstate::
+* pthread_attr_setstacksize::
+* pthread_attr_getstacksize::
+* pthread_attr_setstackaddr::
+* pthread_attr_getstackaddr::
+* pthread_attr_setscope::
+* pthread_attr_getscope::
+* pthread_attr_setinheritsched::
+* pthread_attr_getinheritsched::
+* pthread_attr_setschedpolicy::
+* pthread_attr_getschedpolicy::
+* pthread_attr_setschedparam::
+* pthread_attr_getschedparam::
+* pthread_create::
+* pthread_exit::
+* pthread_detach::
+* pthread_join::
+* pthread_self::
+* pthread_equal::
+* pthread_once::
+* pthread_setschedparam::
+* pthread_getschedparam::
+@end menu
+@end ifinfo
+
+This section details the thread manager's directives.
+A subsection is dedicated to each of this manager's directives
+and describes the calling sequence, related constants, usage,
+and status codes.
+
+@page
+@ifinfo
+@node pthread_attr_init, pthread_attr_destroy, Thread Manager Directives, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_init
+
+@subheading CALLING SEQUENCE:
+
+
+@example
+#include <pthread.h>
+
+int pthread_attr_init(
+ pthread_attr_t *attr
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_attr_destroy, pthread_attr_setdetachstate, pthread_attr_init, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_destroy
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_destroy(
+ pthread_attr_t *attr
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_attr_setdetachstate, pthread_attr_getdetachstate, pthread_attr_destroy, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_setdetachstate
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_setdetachstate(
+ pthread_attr_t *attr,
+ int detachstate
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The detachstate argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_attr_getdetachstate, pthread_attr_setstacksize, pthread_attr_setdetachstate, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_getdetachstate
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_getdetachstate(
+ const pthread_attr_t *attr,
+ int *detachstate
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The detatchstate pointer argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_attr_setstacksize, pthread_attr_getstacksize, pthread_attr_getdetachstate, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_setstacksize
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_setstacksize(
+ pthread_attr_t *attr,
+ size_t stacksize
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+If the specified stacksize is below the minimum required for this CPU, then
+the stacksize will be set to the minimum for this CPU.
+
+@page
+@ifinfo
+@node pthread_attr_getstacksize, pthread_attr_setstackaddr, pthread_attr_setstacksize, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_getstacksize
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_getstacksize(
+ const pthread_attr_t *attr,
+ size_t *stacksize
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The stacksize pointer argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_attr_setstackaddr, pthread_attr_getstackaddr, pthread_attr_getstacksize, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_setstackaddr
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_setstackaddr(
+ pthread_attr_t *attr,
+ void *stackaddr
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_attr_getstackaddr, pthread_attr_setscope, pthread_attr_setstackaddr, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_getstackaddr
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_getstackaddr(
+ const pthread_attr_t *attr,
+ void **stackaddr
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The stackaddr pointer argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_attr_setscope, pthread_attr_getscope, pthread_attr_getstackaddr, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_setscope
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_setscope(
+ pthread_attr_t *attr,
+ int contentionscope
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The contention scope specified is not valid.
+
+@item ENOTSUP
+The contention scope specified (PTHREAD_SCOPE_SYSTEM) is not supported.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_attr_getscope, pthread_attr_setinheritsched, pthread_attr_setscope, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_getscope
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_getscope(
+ const pthread_attr_t *attr,
+ int *contentionscope
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The contentionscope pointer argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_attr_setinheritsched, pthread_attr_getinheritsched, pthread_attr_getscope, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_setinheritsched
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_setinheritsched(
+ pthread_attr_t *attr,
+ int inheritsched
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The specified scheduler inheritance argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_attr_getinheritsched, pthread_attr_setschedpolicy, pthread_attr_setinheritsched, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_getinheritsched
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_getinheritsched(
+ const pthread_attr_t *attr,
+ int *inheritsched
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The inheritsched pointer argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_attr_setschedpolicy, pthread_attr_getschedpolicy, pthread_attr_getinheritsched, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_setschedpolicy
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_setschedpolicy(
+ pthread_attr_t *attr,
+ int policy
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item ENOTSUP
+The specified scheduler policy argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_attr_getschedpolicy, pthread_attr_setschedparam, pthread_attr_setschedpolicy, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_getschedpolicy
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_getschedpolicy(
+ const pthread_attr_t *attr,
+ int *policy
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The specified scheduler policy argument pointer is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_attr_setschedparam, pthread_attr_getschedparam, pthread_attr_getschedpolicy, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_setschedparam
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_setschedparam(
+ pthread_attr_t *attr,
+ const struct sched_param param
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The specified scheduler parameter argument is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_attr_getschedparam, pthread_create, pthread_attr_setschedparam, Thread Manager Directives
+@end ifinfo
+@subsection pthread_attr_getschedparam
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_attr_getschedparam(
+ const pthread_attr_t *attr,
+ struct sched_param *param
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item EINVAL
+The attribute pointer argument is invalid.
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The specified scheduler parameter argument pointer is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_create, pthread_exit, pthread_attr_getschedparam, Thread Manager Directives
+@end ifinfo
+@subsection pthread_create
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_create(
+ pthread_t *thread,
+ const pthread_attr_t *attr,
+ void (*start_routine)( void * ),
+ void *arg
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+
+@item EINVAL
+The attribute set is not initialized.
+
+@item EINVAL
+The user specified a stack address and the size of the area was not
+large enough to meet this processor's minimum stack requirements.
+
+@item EINVAL
+The specified scheduler inheritance policy was invalid.
+
+@item ENOTSUP
+The specified contention scope was PTHREAD_SCOPE_PROCESS.
+
+@item EINVAL
+The specified thread priority was invalid.
+
+@item EINVAL
+The specified scheduling policy was invalid.
+
+@item EINVAL
+The scheduling policy was SCHED_SPORADIC and the specified replenishment
+period is less than the initial budget.
+
+@item EINVAL
+The scheduling policy was SCHED_SPORADIC and the specified low priority
+is invalid.
+
+@item EAGAIN
+The system lacked the necessary resources to create another thread, or the
+self imposed limit on the total number of threads in a process
+PTHREAD_THREAD_MAX would be exceeded.
+
+@item EINVAL
+Invalid argument passed.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_exit, pthread_detach, pthread_create, Thread Manager Directives
+@end ifinfo
+@subsection pthread_exit
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+void pthread_exit(
+ void *status
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item NONE
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_detach, pthread_join, pthread_exit, Thread Manager Directives
+@end ifinfo
+@subsection pthread_detach
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_detach(
+ pthread_t thread
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item ESRCH
+The thread specified is invalid.
+
+@item EINVAL
+The thread specified is not a joinable thread.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+If any threads have previously joined with the specified thread, then they
+will remain joined with that thread. Any subsequent calls to pthread_join
+on the specified thread will fail.
+
+@page
+@ifinfo
+@node pthread_join, pthread_self, pthread_detach, Thread Manager Directives
+@end ifinfo
+@subsection pthread_join
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_join(
+ pthread_t thread,
+ void **value_ptr
+);
+@end example
+
+@subheading STATUS CODES:
+@table @b
+@item ESRCH
+The thread specified is invalid.
+
+@item EINVAL
+The thread specified is not a joinable thread.
+
+@item EDEADLK
+A deadlock was detected or thread is the calling thread.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+If any threads have previously joined with the specified thread, then they
+will remain joined with that thread. Any subsequent calls to pthread_join
+on the specified thread will fail.
+
+If value_ptr is NULL, then no value is returned.
+
+@page
+@ifinfo
+@node pthread_self, pthread_equal, pthread_join, Thread Manager Directives
+@end ifinfo
+@subsection pthread_self
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+pthread_t pthread_self( void );
+@end example
+
+@subheading STATUS CODES:
+
+This routine returns the id of the calling thread.
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_equal, pthread_once, pthread_self, Thread Manager Directives
+@end ifinfo
+@subsection pthread_equal
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_equal(
+ pthread_t t1,
+ pthread_t t2
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item zero
+The thread ids are not equal.
+
+@item non-zero
+The thread ids are equal.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+The behavior is undefined if the thread IDs are not valid.
+
+@page
+@ifinfo
+@node pthread_once, pthread_setschedparam, pthread_equal, Thread Manager Directives
+@end ifinfo
+@subsection pthread_once
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+pthread_once_t once_control = PTHREAD_ONCE_INIT;
+
+int pthread_once(
+ pthread_once_t *once_control,
+ void (*init_routine)(void)
+);
+@end example
+
+@subheading STATUS CODES:
+
+NONE
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_setschedparam, pthread_getschedparam, pthread_once, Thread Manager Directives
+@end ifinfo
+@subsection pthread_setschedparam
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_setschedparam(
+ pthread_t thread,
+ int policy,
+ struct sched_param *param
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The scheduling parameters indicated by the parameter param is invalid.
+
+@item EINVAL
+The value specified by policy is invalid.
+
+@item EINVAL
+The scheduling policy was SCHED_SPORADIC and the specified replenishment
+period is less than the initial budget.
+
+@item EINVAL
+The scheduling policy was SCHED_SPORADIC and the specified low priority
+is invalid.
+
+@item ESRCH
+The thread indicated was invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
+@page
+@ifinfo
+@node pthread_getschedparam, Signal Manager, pthread_setschedparam, Thread Manager Directives
+@end ifinfo
+@subsection pthread_getschedparam
+
+@subheading CALLING SEQUENCE:
+
+@example
+#include <pthread.h>
+
+int pthread_getschedparam(
+ pthread_t thread,
+ int *policy,
+ struct sched_param *param
+);
+@end example
+
+@subheading STATUS CODES:
+
+@table @b
+@item EINVAL
+The policy pointer argument is invalid.
+
+@item EINVAL
+The scheduling parameters pointer argument is invalid.
+
+@item ESRCH
+The thread indicated by the parameter thread is invalid.
+
+@end table
+
+@subheading DESCRIPTION:
+
+@subheading NOTES:
+
diff --git a/doc/posix_users/posix_test_plan.texi b/doc/posix_users/posix_test_plan.texi
new file mode 100644
index 0000000000..da06fee1a4
--- /dev/null
+++ b/doc/posix_users/posix_test_plan.texi
@@ -0,0 +1,123 @@
+\input ../texinfo/texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename posix_test_plan
+@syncodeindex vr fn
+@synindex ky cp
+@paragraphindent 0
+@c @smallbook
+@c %**end of header
+
+@c
+@c COPYRIGHT (c) 1988-1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@c
+@c Master file for the C User's Guide
+@c
+
+@c Joel's Questions
+@c
+@c 1. Why does paragraphindent only impact makeinfo?
+@c 2. Why does paragraphindent show up in HTML?
+@c
+
+@include ../common/setup.texi
+
+@ignore
+@ifinfo
+@format
+START-INFO-DIR-ENTRY
+* RTEMS Posix Test Plan: (posix_test_plan). Posix Test Plan
+END-INFO-DIR-ENTRY
+@end format
+@end ifinfo
+@end ignore
+
+@c variable substitution info:
+@c
+@c @set RTEMS-LANGUAGE C
+@c the language is @value{RTEMS-LANGUAGE}
+@c NOTE: don't use underscore in the name
+@c
+
+@c
+@c Title Page Stuff
+@c
+
+@set edition 4.0.0a
+@set update-date 1 June 97
+@set update-month June 97
+
+@c
+@c I don't really like having a short title page. --joel
+@c
+@c @shorttitlepage RTEMS POSIX API Test Plan
+
+@setchapternewpage odd
+@settitle RTEMS POSIX API Test Plan
+@titlepage
+@finalout
+
+@title RTEMS POSIX API Test Plan
+@subtitle Edition @value{edition}, for RTEMS 4.0.0
+@sp 1
+@subtitle @value{update-month}
+@author On-Line Applications Research Corporation
+@page
+@include ../common/cpright.texi
+@end titlepage
+
+@c This prevents a black box from being printed on "overflow" lines.
+@c The alternative is to rework a sentence to avoid this problem.
+
+@include preface.texi
+@include thread.texi
+@include signal.texi
+@include mutex.texi
+@include cond.texi
+@include key.texi
+@include clock.texi
+@include sched.texi
+@ifinfo
+@node Top, Preface, (dir), (dir)
+@top posix_test_plan
+
+This is the online version of the RTEMS POSIX API Test Plan.
+
+@menu
+* Preface::
+* Thread Manager::
+* Signal Manager::
+* Mutex Manager::
+* Condition Variable Manager::
+* Key Manager::
+* Clock Manager::
+* Scheduler Manager::
+* Command and Variable Index::
+* Concept Index::
+@end menu
+
+@end ifinfo
+@c
+@c
+@c Need to copy the emacs stuff and "trailer stuff" (index, toc) into here
+@c
+
+@node Command and Variable Index, Concept Index, sched_yield, Top
+@unnumbered Command and Variable Index
+
+There are currently no Command and Variable Index entries.
+
+@c @printindex fn
+
+@node Concept Index, , Command and Variable Index, Top
+@unnumbered Concept Index
+
+There are currently no Concept Index entries.
+@c @printindex cp
+
+@contents
+@bye
+
diff --git a/doc/rtems.html b/doc/rtems.html
new file mode 100644
index 0000000000..58e6a853f2
--- /dev/null
+++ b/doc/rtems.html
@@ -0,0 +1,26 @@
+<HTML>
+<HEAD><TITLE>RTEMS On-Line Library</TITLE></HEAD>
+<BODY BGCOLOR="FFFFFF">
+<A HREF="http://www.oarcorp.com" target="Text Frame">
+ <IMG align=right BORDER=0 SRC="oaronly.jpg" ALT="OAR"> </A>
+<FONT SIZE=-1>
+<H1>RTEMS On-Line Library</H1>
+<HR>
+<BODY>
+<MENU>
+<LI><A HREF="c_user/Top.html">RTEMS Applications C User's Guide</A>
+<LI><A HREF="relnotes/Top.html">RTEMS Release Notes</A>
+<LI><A HREF="develenv/Top.html">RTEMS Development Environment Guide</A>
+<LI><A HREF="HELP.html">RTEMS AMD 29K C Applications Supplement</A>
+<LI><A HREF="c_i386/Top.html">RTEMS Intel i386 C Applications Supplement</A>
+<LI><A HREF="c_i960/Top.html">RTEMS Intel i960 C Applications Supplement</A>
+<LI><A HREF="HELP.html">RTEMS MIPS C Applications Supplement</A>
+<LI><A HREF="c_m68k/Top.html">RTEMS Motorola MC68xxx C Applications Supplement</A>
+<LI><A HREF="HELP.html">RTEMS PowerPC C Applications Supplement</A>
+<LI><A HREF="c_sparc/Top.html">RTEMS SPARC C Applications Supplement</A>
+<LI><A HREF="c_hppa1_1/Top.html">RTEMS Hewlett Packard PA-RISC C Applications Supplement</A>
+<LI><A HREF="HELP.html">RTEMS UNIX Port C Applications Supplement</A>
+</MENU>
+<HR>
+Copyright &copy; 1997 <A HREF="http://www.oarcorp.com" target="Text Frame">OAR Corporation</A>
+</BODY></HTML>
diff --git a/doc/supplements/hppa1_1/TIMES b/doc/supplements/hppa1_1/TIMES
new file mode 100644
index 0000000000..485340715b
--- /dev/null
+++ b/doc/supplements/hppa1_1/TIMES
@@ -0,0 +1,244 @@
+#
+# PA-RISC Timing and Size Information
+#
+
+#
+# CPU Model Information
+#
+RTEMS_CPU_MODEL HP-7100
+#
+# Interrupt Latency
+#
+# NOTE: In general, the text says it is hand-calculated to be
+# RTEMS_MAXIMUM_DISABLE_PERIOD at RTEMS_MAXIMUM_DISABLE_PERIOD_MHZ
+# Mhz and this was last calculated for Release
+# RTEMS_VERSION_FOR_MAXIMUM_DISABLE_PERIOD.
+#
+RTEMS_MAXIMUM_DISABLE_PERIOD TBD
+RTEMS_MAXIMUM_DISABLE_PERIOD_MHZ TBD
+RTEMS_RELEASE_FOR_MAXIMUM_DISABLE_PERIOD TBD
+#
+# Context Switch Times
+#
+RTEMS_NO_FP_CONTEXTS 1
+RTEMS_RESTORE_1ST_FP_TASK 2
+RTEMS_SAVE_INIT_RESTORE_INIT 3
+RTEMS_SAVE_IDLE_RESTORE_INIT 4
+RTEMS_SAVE_IDLE_RESTORE_IDLE 5
+#
+# Task Manager Times
+#
+RTEMS_TASK_CREATE_ONLY 6
+RTEMS_TASK_IDENT_ONLY 7
+RTEMS_TASK_START_ONLY 8
+RTEMS_TASK_RESTART_CALLING_TASK 9
+RTEMS_TASK_RESTART_SUSPENDED_RETURNS_TO_CALLER 9
+RTEMS_TASK_RESTART_BLOCKED_RETURNS_TO_CALLER 10
+RTEMS_TASK_RESTART_READY_RETURNS_TO_CALLER 11
+RTEMS_TASK_RESTART_SUSPENDED_PREEMPTS_CALLER 12
+RTEMS_TASK_RESTART_BLOCKED_PREEMPTS_CALLER 13
+RTEMS_TASK_RESTART_READY_PREEMPTS_CALLER 14
+RTEMS_TASK_DELETE_CALLING_TASK 15
+RTEMS_TASK_DELETE_SUSPENDED_TASK 16
+RTEMS_TASK_DELETE_BLOCKED_TASK 17
+RTEMS_TASK_DELETE_READY_TASK 18
+RTEMS_TASK_SUSPEND_CALLING_TASK 19
+RTEMS_TASK_SUSPEND_RETURNS_TO_CALLER 20
+RTEMS_TASK_RESUME_TASK_READIED_RETURNS_TO_CALLER 21
+RTEMS_TASK_RESUME_TASK_READIED_PREEMPTS_CALLER 22
+RTEMS_TASK_SET_PRIORITY_OBTAIN_CURRENT_PRIORITY 23
+RTEMS_TASK_SET_PRIORITY_RETURNS_TO_CALLER 24
+RTEMS_TASK_SET_PRIORITY_PREEMPTS_CALLER 25
+RTEMS_TASK_MODE_OBTAIN_CURRENT_MODE 26
+RTEMS_TASK_MODE_NO_RESCHEDULE 27
+RTEMS_TASK_MODE_RESCHEDULE_RETURNS_TO_CALLER 28
+RTEMS_TASK_MODE_RESCHEDULE_PREEMPTS_CALLER 29
+RTEMS_TASK_GET_NOTE_ONLY 30
+RTEMS_TASK_SET_NOTE_ONLY 31
+RTEMS_TASK_WAKE_AFTER_YIELD_RETURNS_TO_CALLER 32
+RTEMS_TASK_WAKE_AFTER_YIELD_PREEMPTS_CALLER 33
+RTEMS_TASK_WAKE_WHEN_ONLY 34
+#
+# Interrupt Manager
+#
+RTEMS_INTR_ENTRY_RETURNS_TO_NESTED 35
+RTEMS_INTR_ENTRY_RETURNS_TO_INTERRUPTED_TASK 36
+RTEMS_INTR_ENTRY_RETURNS_TO_PREEMPTING_TASK 37
+RTEMS_INTR_EXIT_RETURNS_TO_NESTED 38
+RTEMS_INTR_EXIT_RETURNS_TO_INTERRUPTED_TASK 39
+RTEMS_INTR_EXIT_RETURNS_TO_PREEMPTING_TASK 40
+#
+# Clock Manager
+#
+RTEMS_CLOCK_SET_ONLY 41
+RTEMS_CLOCK_GET_ONLY 42
+RTEMS_CLOCK_TICK_ONLY 43
+#
+# Timer Manager
+#
+RTEMS_TIMER_CREATE_ONLY 44
+RTEMS_TIMER_IDENT_ONLY 45
+RTEMS_TIMER_DELETE_INACTIVE 46
+RTEMS_TIMER_DELETE_ACTIVE 47
+RTEMS_TIMER_FIRE_AFTER_INACTIVE 48
+RTEMS_TIMER_FIRE_AFTER_ACTIVE 49
+RTEMS_TIMER_FIRE_WHEN_INACTIVE 50
+RTEMS_TIMER_FIRE_WHEN_ACTIVE 51
+RTEMS_TIMER_RESET_INACTIVE 52
+RTEMS_TIMER_RESET_ACTIVE 53
+RTEMS_TIMER_CANCEL_INACTIVE 54
+RTEMS_TIMER_CANCEL_ACTIVE 55
+#
+# Semaphore Manager
+#
+RTEMS_SEMAPHORE_CREATE_ONLY 56
+RTEMS_SEMAPHORE_IDENT_ONLY 57
+RTEMS_SEMAPHORE_DELETE_ONLY 58
+RTEMS_SEMAPHORE_OBTAIN_AVAILABLE 59
+RTEMS_SEMAPHORE_OBTAIN_NOT_AVAILABLE_NO_WAIT 60
+RTEMS_SEMAPHORE_OBTAIN_NOT_AVAILABLE_CALLER_BLOCKS 61
+RTEMS_SEMAPHORE_RELEASE_NO_WAITING_TASKS 62
+RTEMS_SEMAPHORE_RELEASE_TASK_READIED_RETURNS_TO_CALLER 63
+RTEMS_SEMAPHORE_RELEASE_TASK_READIED_PREEMPTS_CALLER 64
+#
+# Message Manager
+#
+RTEMS_MESSAGE_QUEUE_CREATE_ONLY 65
+RTEMS_MESSAGE_QUEUE_IDENT_ONLY 66
+RTEMS_MESSAGE_QUEUE_DELETE_ONLY 67
+RTEMS_MESSAGE_QUEUE_SEND_NO_WAITING_TASKS 68
+RTEMS_MESSAGE_QUEUE_SEND_TASK_READIED_RETURNS_TO_CALLER 69
+RTEMS_MESSAGE_QUEUE_SEND_TASK_READIED_PREEMPTS_CALLER 70
+RTEMS_MESSAGE_QUEUE_URGENT_NO_WAITING_TASKS 71
+RTEMS_MESSAGE_QUEUE_URGENT_TASK_READIED_RETURNS_TO_CALLER 72
+RTEMS_MESSAGE_QUEUE_URGENT_TASK_READIED_PREEMPTS_CALLER 73
+RTEMS_MESSAGE_QUEUE_BROADCAST_NO_WAITING_TASKS 74
+RTEMS_MESSAGE_QUEUE_BROADCAST_TASK_READIED_RETURNS_TO_CALLER 75
+RTEMS_MESSAGE_QUEUE_BROADCAST_TASK_READIED_PREEMPTS_CALLER 76
+RTEMS_MESSAGE_QUEUE_RECEIVE_AVAILABLE 77
+RTEMS_MESSAGE_QUEUE_RECEIVE_NOT_AVAILABLE_NO_WAIT 78
+RTEMS_MESSAGE_QUEUE_RECEIVE_NOT_AVAILABLE_CALLER_BLOCKS 79
+RTEMS_MESSAGE_QUEUE_FLUSH_NO_MESSAGES_FLUSHED 80
+RTEMS_MESSAGE_QUEUE_FLUSH_MESSAGES_FLUSHED 81
+#
+# Event Manager
+#
+RTEMS_EVENT_SEND_NO_TASK_READIED 82
+RTEMS_EVENT_SEND_TASK_READIED_RETURNS_TO_CALLER 83
+RTEMS_EVENT_SEND_TASK_READIED_PREEMPTS_CALLER 84
+RTEMS_EVENT_RECEIVE_OBTAIN_CURRENT_EVENTS 85
+RTEMS_EVENT_RECEIVE_AVAILABLE 86
+RTEMS_EVENT_RECEIVE_NOT_AVAILABLE_NO_WAIT 87
+RTEMS_EVENT_RECEIVE_NOT_AVAILABLE_CALLER_BLOCKS 88
+#
+# Signal Manager
+#
+RTEMS_SIGNAL_CATCH_ONLY 89
+RTEMS_SIGNAL_SEND_RETURNS_TO_CALLER 90
+RTEMS_SIGNAL_SEND_SIGNAL_TO_SELF 91
+RTEMS_SIGNAL_EXIT_ASR_OVERHEAD_RETURNS_TO_CALLING_TASK 92
+RTEMS_SIGNAL_EXIT_ASR_OVERHEAD_RETURNS_TO_PREEMPTING_TASK 93
+#
+# Partition Manager
+#
+RTEMS_PARTITION_CREATE_ONLY 94
+RTEMS_PARTITION_IDENT_ONLY 95
+RTEMS_PARTITION_DELETE_ONLY 96
+RTEMS_PARTITION_GET_BUFFER_AVAILABLE 97
+RTEMS_PARTITION_GET_BUFFER_NOT_AVAILABLE 98
+RTEMS_PARTITION_RETURN_BUFFER_ONLY 99
+#
+# Region Manager
+#
+RTEMS_REGION_CREATE_ONLY 100
+RTEMS_REGION_IDENT_ONLY 101
+RTEMS_REGION_DELETE_ONLY 102
+RTEMS_REGION_GET_SEGMENT_AVAILABLE 103
+RTEMS_REGION_GET_SEGMENT_NOT_AVAILABLE_NO_WAIT 104
+RTEMS_REGION_GET_SEGMENT_NOT_AVAILABLE_CALLER_BLOCKS 105
+RTEMS_REGION_RETURN_SEGMENT_NO_WAITING_TASKS 106
+RTEMS_REGION_RETURN_SEGMENT_TASK_READIED_RETURNS_TO_CALLER 107
+RTEMS_REGION_RETURN_SEGMENT_TASK_READIED_PREEMPTS_CALLER 108
+#
+# Dual-Ported Memory Manager
+#
+RTEMS_PORT_CREATE_ONLY 109
+RTEMS_PORT_IDENT_ONLY 110
+RTEMS_PORT_DELETE_ONLY 111
+RTEMS_PORT_INTERNAL_TO_EXTERNAL_ONLY 112
+RTEMS_PORT_EXTERNAL_TO_INTERNAL_ONLY 113
+#
+# IO Manager
+#
+RTEMS_IO_INITIALIZE_ONLY 114
+RTEMS_IO_OPEN_ONLY 115
+RTEMS_IO_CLOSE_ONLY 116
+RTEMS_IO_READ_ONLY 117
+RTEMS_IO_WRITE_ONLY 118
+RTEMS_IO_CONTROL_ONLY 119
+#
+# Rate Monotonic Manager
+#
+RTEMS_RATE_MONOTONIC_CREATE_ONLY 120
+RTEMS_RATE_MONOTONIC_IDENT_ONLY 121
+RTEMS_RATE_MONOTONIC_CANCEL_ONLY 122
+RTEMS_RATE_MONOTONIC_DELETE_ACTIVE 123
+RTEMS_RATE_MONOTONIC_DELETE_INACTIVE 124
+RTEMS_RATE_MONOTONIC_PERIOD_INITIATE_PERIOD_RETURNS_TO_CALLER 125
+RTEMS_RATE_MONOTONIC_PERIOD_CONCLUDE_PERIOD_CALLER_BLOCKS 126
+RTEMS_RATE_MONOTONIC_PERIOD_OBTAIN_STATUS 127
+#
+# Size Information
+#
+#
+# xxx alloted for numbers
+#
+RTEMS_DATA_SPACE 128
+RTEMS_MINIMUM_CONFIGURATION xx,129
+RTEMS_MAXIMUM_CONFIGURATION xx,130
+# x,xxx alloted for numbers
+RTEMS_CORE_CODE_SIZE x,131
+RTEMS_INITIALIZATION_CODE_SIZE x,132
+RTEMS_TASK_CODE_SIZE x,133
+RTEMS_INTERRUPT_CODE_SIZE x,134
+RTEMS_CLOCK_CODE_SIZE x,135
+RTEMS_TIMER_CODE_SIZE x,136
+RTEMS_SEMAPHORE_CODE_SIZE x,137
+RTEMS_MESSAGE_CODE_SIZE x,138
+RTEMS_EVENT_CODE_SIZE x,139
+RTEMS_SIGNAL_CODE_SIZE x,140
+RTEMS_PARTITION_CODE_SIZE x,141
+RTEMS_REGION_CODE_SIZE x,142
+RTEMS_DPMEM_CODE_SIZE x,143
+RTEMS_IO_CODE_SIZE x,144
+RTEMS_FATAL_ERROR_CODE_SIZE x,145
+RTEMS_RATE_MONOTONIC_CODE_SIZE x,146
+RTEMS_MULTIPROCESSING_CODE_SIZE x,147
+# xxx alloted for numbers
+RTEMS_TIMER_CODE_OPTSIZE 148
+RTEMS_SEMAPHORE_CODE_OPTSIZE 149
+RTEMS_MESSAGE_CODE_OPTSIZE 150
+RTEMS_EVENT_CODE_OPTSIZE 151
+RTEMS_SIGNAL_CODE_OPTSIZE 152
+RTEMS_PARTITION_CODE_OPTSIZE 153
+RTEMS_REGION_CODE_OPTSIZE 154
+RTEMS_DPMEM_CODE_OPTSIZE 155
+RTEMS_IO_CODE_OPTSIZE 156
+RTEMS_RATE_MONOTONIC_CODE_OPTSIZE 157
+RTEMS_MULTIPROCESSING_CODE_OPTSIZE 158
+# xxx alloted for numbers
+RTEMS_BYTES_PER_TASK 159
+RTEMS_BYTES_PER_TIMER 160
+RTEMS_BYTES_PER_SEMAPHORE 161
+RTEMS_BYTES_PER_MESSAGE_QUEUE 162
+RTEMS_BYTES_PER_REGION 163
+RTEMS_BYTES_PER_PARTITION 164
+RTEMS_BYTES_PER_PORT 165
+RTEMS_BYTES_PER_PERIOD 166
+RTEMS_BYTES_PER_EXTENSION 167
+RTEMS_BYTES_PER_FP_TASK 168
+RTEMS_BYTES_PER_NODE 169
+RTEMS_BYTES_PER_GLOBAL_OBJECT 170
+RTEMS_BYTES_PER_PROXY 171
+# x,xxx alloted for numbers
+RTEMS_BYTES_OF_FIXED_SYSTEM_REQUIREMENTS x,172
diff --git a/doc/supplements/hppa1_1/bsp.texi b/doc/supplements/hppa1_1/bsp.texi
new file mode 100644
index 0000000000..b4b92a5bdb
--- /dev/null
+++ b/doc/supplements/hppa1_1/bsp.texi
@@ -0,0 +1,70 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Board Support Packages, Board Support Packages Introduction, Default Fatal Error Processing Default Fatal Error Handler Operations, Top
+@end ifinfo
+@chapter Board Support Packages
+@ifinfo
+@menu
+* Board Support Packages Introduction::
+* Board Support Packages System Reset::
+* Board Support Packages Processor Initialization::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Board Support Packages Introduction, Board Support Packages System Reset, Board Support Packages, Board Support Packages
+@end ifinfo
+@section Introduction
+
+An RTEMS Board Support Package (BSP) must be designed
+to support a particular processor and target board combination.
+This chapter presents a discussion of PA-RISC specific BSP
+issues. For more information on developing a BSP, refer to the
+chapter titled Board Support Packages in the RTEMS C
+Applications User's Guide.
+
+@ifinfo
+@node Board Support Packages System Reset, Board Support Packages Processor Initialization, Board Support Packages Introduction, Board Support Packages
+@end ifinfo
+@section System Reset
+
+An RTEMS based application is initiated or
+re-initiated when the PA-RISC processor is reset. The behavior
+of a PA-RISC upon reset is implementation defined and thus is
+beyond the scope of this manual.
+
+@ifinfo
+@node Board Support Packages Processor Initialization, Processor Dependent Information Table, Board Support Packages System Reset, Board Support Packages
+@end ifinfo
+@section Processor Initialization
+
+The precise requirements for initialization of a
+particular implementation of the PA-RISC architecture are
+implementation defined. Thus it is impossible to provide exact
+details of this procedure in this manual. However, the
+requirements of RTEMS which must be satisfied by this
+initialization code can be discussed.
+
+RTEMS assumes that interrupts are disabled when the
+initialize_executive directive is invoked. Interrupts are
+enabled automatically by RTEMS as part of the initialize
+executive directive and device driver initialization occurs
+after interrupts are enabled. Thus all interrupt sources should
+be quiescent until the system's device drivers have been
+initialized and installed their interrupt handlers.
+
+If the processor requires initialization of the
+cache, then it should be be done during the reset application
+initialization code.
+
+Finally, the requirements in the Board Support
+Packages chapter of the C Applications User's Manual for the
+reset code which is executed before the call to initialize
+executive must be satisfied.
+
+
diff --git a/doc/supplements/hppa1_1/callconv.texi b/doc/supplements/hppa1_1/callconv.texi
new file mode 100644
index 0000000000..77f2b8a926
--- /dev/null
+++ b/doc/supplements/hppa1_1/callconv.texi
@@ -0,0 +1,172 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Calling Conventions, Calling Conventions Introduction, CPU Model Dependent Features CPU Model Name, Top
+@end ifinfo
+@chapter Calling Conventions
+@ifinfo
+@menu
+* Calling Conventions Introduction::
+* Calling Conventions Processor Background::
+* Calling Conventions Calling Mechanism::
+* Calling Conventions Register Usage::
+* Calling Conventions Parameter Passing::
+* Calling Conventions User-Provided Routines::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Calling Conventions Introduction, Calling Conventions Processor Background, Calling Conventions, Calling Conventions
+@end ifinfo
+@section Introduction
+
+Each high-level language compiler generates
+subroutine entry and exit code based upon a set of rules known
+as the compiler's calling convention. These rules address the
+following issues:
+
+@itemize @bullet
+@item register preservation and usage
+
+@item parameter passing
+
+@item call and return mechanism
+@end itemize
+
+A compiler's calling convention is of importance when
+interfacing to subroutines written in another language either
+assembly or high-level. Even when the high-level language and
+target processor are the same, different compilers may use
+different calling conventions. As a result, calling conventions
+are both processor and compiler dependent.
+
+This chapter describes the calling conventions used
+by the GNU C and standard HP-UX compilers for the PA-RISC
+architecture.
+
+@ifinfo
+@node Calling Conventions Processor Background, Calling Conventions Calling Mechanism, Calling Conventions Introduction, Calling Conventions
+@end ifinfo
+@section Processor Background
+
+The PA-RISC architecture supports a simple yet
+effective call and return mechanism for subroutine calls where
+the caller and callee are both in the same address space. The
+compiler will not automatically generate subroutine calls which
+cross address spaces. A subroutine is invoked via the branch
+and link (bl) or the branch and link register (blr). These
+instructions save the return address in a caller specified
+register. By convention, the return address is saved in r2.
+The callee is responsible for maintaining the return address so
+it can return to the correct address. The branch vectored (bv)
+instruction is used to branch to the return address and thus
+return from the subroutine to the caller. It is is important to
+note that the PA-RISC subroutine call and return mechanism does
+not automatically save or restore any registers. It is the
+responsibility of the high-level language compiler to define the
+register preservation and usage convention.
+
+@ifinfo
+@node Calling Conventions Calling Mechanism, Calling Conventions Register Usage, Calling Conventions Processor Background, Calling Conventions
+@end ifinfo
+@section Calling Mechanism
+
+All RTEMS directives are invoked as standard
+subroutines via a bl or a blr instruction with the return address
+assumed to be in r2 and return to the user application via the
+bv instruction.
+
+@ifinfo
+@node Calling Conventions Register Usage, Calling Conventions Parameter Passing, Calling Conventions Calling Mechanism, Calling Conventions
+@end ifinfo
+@section Register Usage
+
+As discussed above, the bl and blr instructions do
+not automatically save any registers. RTEMS uses the registers
+r1, r19 - r26, and r31 as scratch registers. The PA-RISC
+calling convention specifies that the first four (4) arguments
+to subroutines are passed in registers r23 - r26. After the
+arguments have been used, the contents of these registers may be
+altered. Register r31 is the millicode scratch register.
+Millicode is the set of routines which support high-level
+languages on the PA-RISC by providing routines which are either
+too complex or too long for the compiler to generate inline code
+when these operations are needed. For example, indirect calls
+utilize a millicode routine. The scratch registers are not
+preserved by RTEMS directives therefore, the contents of these
+registers should not be assumed upon return from any RTEMS
+directive.
+
+Surprisingly, when using the GNU C compiler at least
+integer multiplies are performed using the floating point
+registers. This is an important optimization because the
+PA-RISC does not have otherwise have hardware for multiplies.
+This has important ramifications in regards to the PA-RISC port
+of RTEMS. On most processors, the floating point unit is
+ignored if the code only performs integer operations. This
+makes it easy for the application developer to predict whether
+or not any particular task will require floating point
+operations. This property is taken advantage of by RTEMS on
+other architectures to minimize the number of times the floating
+point context is saved and restored. However, on the PA-RISC
+architecture, every task is implicitly a floating point task.
+Additionally the state of the floating point unit must be saved
+and restored as part of the interrupt processing because for all
+practical purposes it is impossible to avoid the use of the
+floating point registers. It is unknown if the HP-UX C compiler
+shares this property.
+
+@itemize @code{ }
+@item @b{NOTE}: Later versions of the GNU C has a PA-RISC specific
+option to disable use of the floating point registers. RTEMS
+currently assumes that this option is not turned on. If the use
+of this option sets a built-in define, then it should be
+possible to modify the PA-RISC specific code such that all tasks
+are considered floating point only when this option is not used.
+@end itemize
+
+@ifinfo
+@node Calling Conventions Parameter Passing, Calling Conventions User-Provided Routines, Calling Conventions Register Usage, Calling Conventions
+@end ifinfo
+@section Parameter Passing
+
+RTEMS assumes that the first four (4) arguments are
+placed in the appropriate registers (r26, r25, r24, and r23)
+and, if needed, additional are placed on the current stack
+before the directive is invoked via the bl or blr instruction.
+The first argument is placed in r26, the second is placed in
+r25, and so forth. The following pseudo-code illustrates the
+typical sequence used to call a RTEMS directive with three (3)
+arguments:
+
+
+@example
+set r24 to the third argument
+set r25 to the second argument
+set r26 to the first argument
+invoke directive
+@end example
+
+The stack on the PA-RISC grows upward -- i.e.
+"pushing" onto the stack results in the address in the stack
+pointer becoming numerically larger. By convention, r27 is used
+as the stack pointer. The standard stack frame consists of a
+minimum of sixty-four (64) bytes and is the responsibility of
+the callee to maintain.
+
+@ifinfo
+@node Calling Conventions User-Provided Routines, Memory Model, Calling Conventions Parameter Passing, Calling Conventions
+@end ifinfo
+@section User-Provided Routines
+
+All user-provided routines invoked by RTEMS, such as
+user extensions, device drivers, and MPCI routines, must also
+adhere to these calling conventions.
+
+
+
+
diff --git a/doc/supplements/hppa1_1/cpumodel.texi b/doc/supplements/hppa1_1/cpumodel.texi
new file mode 100644
index 0000000000..be4541bd87
--- /dev/null
+++ b/doc/supplements/hppa1_1/cpumodel.texi
@@ -0,0 +1,69 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node CPU Model Dependent Features, CPU Model Dependent Features Introduction, Preface, Top
+@end ifinfo
+@chapter CPU Model Dependent Features
+@ifinfo
+@menu
+* CPU Model Dependent Features Introduction::
+* CPU Model Dependent Features CPU Model Name::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node CPU Model Dependent Features Introduction, CPU Model Dependent Features CPU Model Name, CPU Model Dependent Features, CPU Model Dependent Features
+@end ifinfo
+@section Introduction
+
+Microprocessors are generally classified into
+families with a variety of CPU models or implementations within
+that family. Within a processor family, there is a high level
+of binary compatibility. This family may be based on either an
+architectural specification or on maintaining compatibility with
+a popular processor. Recent microprocessor families such as the
+SPARC or PA-RISC are based on an architectural specification
+which is independent or any particular CPU model or
+implementation. Older families such as the M68xxx and the iX86
+evolved as the manufacturer strived to produce higher
+performance processor models which maintained binary
+compatibility with older models.
+
+RTEMS takes advantage of the similarity of the
+various models within a CPU family. Although the models do vary
+in significant ways, the high level of compatibility makes it
+possible to share the bulk of the CPU dependent executive code
+across the entire family. Each processor family supported by
+RTEMS has a list of features which vary between CPU models
+within a family. For example, the most common model dependent
+feature regardless of CPU family is the presence or absence of a
+floating point unit or coprocessor. When defining the list of
+features present on a particular CPU model, one simply notes
+that floating point hardware is or is not present and defines a
+single constant appropriately. Conditional compilation is
+utilized to include the appropriate source code for this CPU
+model's feature set. It is important to note that this means
+that RTEMS is thus compiled using the appropriate feature set
+and compilation flags optimal for this CPU model used. The
+alternative would be to generate a binary which would execute on
+all family members using only the features which were always
+present.
+
+This chapter presents the set of features which vary
+across PA-RISC implementations and are of importance to RTEMS.
+The set of CPU model feature macros are defined in the file
+c/src/exec/score/cpu/hppa1_1/hppa.h based upon the particular CPU
+model defined on the compilation command line.
+
+@ifinfo
+@node CPU Model Dependent Features CPU Model Name, Calling Conventions, CPU Model Dependent Features Introduction, CPU Model Dependent Features
+@end ifinfo
+@section CPU Model Name
+
+The macro CPU_MODEL_NAME is a string which designates
+the name of this CPU model. For example, for the Hewlett Packard
+PA-7100 CPU model, this macro is set to the string "hppa 7100".
diff --git a/doc/supplements/hppa1_1/cputable.texi b/doc/supplements/hppa1_1/cputable.texi
new file mode 100644
index 0000000000..651dd69606
--- /dev/null
+++ b/doc/supplements/hppa1_1/cputable.texi
@@ -0,0 +1,124 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Processor Dependent Information Table, Processor Dependent Information Table Introduction, Board Support Packages Processor Initialization, Top
+@end ifinfo
+@chapter Processor Dependent Information Table
+@ifinfo
+@menu
+* Processor Dependent Information Table Introduction::
+* Processor Dependent Information Table CPU Dependent Information Table::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Processor Dependent Information Table Introduction, Processor Dependent Information Table CPU Dependent Information Table, Processor Dependent Information Table, Processor Dependent Information Table
+@end ifinfo
+@section Introduction
+
+Any highly processor dependent information required
+to describe a processor to RTEMS is provided in the CPU
+Dependent Information Table. This table is not required for all
+processors supported by RTEMS. This chapter describes the
+contents, if any, for a particular processor type.
+
+@ifinfo
+@node Processor Dependent Information Table CPU Dependent Information Table, Memory Requirements, Processor Dependent Information Table Introduction, Processor Dependent Information Table
+@end ifinfo
+@section CPU Dependent Information Table
+
+The PA-RISC version of the RTEMS CPU Dependent
+Information Table contains the information required to interface
+a Board Support Package and RTEMS on the PA-RISC. This
+information is provided to allow RTEMS to interoperate
+effectively with the BSP. The C structure definition is given
+here:
+
+@example
+typedef struct @{
+ void (*pretasking_hook)( void );
+ void (*predriver_hook)( void );
+ void (*postdriver_hook)( void );
+ void (*idle_task)( void );
+ boolean do_zero_of_workspace;
+ unsigned32 interrupt_stack_size;
+ unsigned32 extra_mpci_receive_server_stack;
+ void * (*stack_allocate_hook)( unsigned32 );
+ void (*stack_free_hook)( void * );
+ /* end of fields required on all CPUs */
+
+ hppa_rtems_isr_entry spurious_handler;
+
+ unsigned32 itimer_clicks_per_microsecond; /* for use by Clock driver */
+@} rtems_cpu_table;
+@end example
+
+@table @code
+@item pretasking_hook
+is the address of the
+user provided routine which is invoked once RTEMS initialization
+is complete but before interrupts and tasking are enabled. This
+field may be NULL to indicate that the hook is not utilized.
+
+@item predriver_hook
+is the address of the user provided
+routine which is invoked with tasking enabled immediately before
+the MPCI and device drivers are initialized. RTEMS
+initialization is complete, interrupts and tasking are enabled,
+but no device drivers are initialized. This field may be NULL to
+indicate that the hook is not utilized.
+
+@item postdriver_hook
+is the address of the user provided
+routine which is invoked with tasking enabled immediately after
+the MPCI and device drivers are initialized. RTEMS
+initialization is complete, interrupts and tasking are enabled,
+and the device drivers are initialized. This field may be NULL
+to indicate that the hook is not utilized.
+
+@item idle_task
+is the address of the optional user
+provided routine which is used as the system's IDLE task. If
+this field is not NULL, then the RTEMS default IDLE task is not
+used. This field may be NULL to indicate that the default IDLE
+is to be used.
+
+@item do_zero_of_workspace
+indicates whether RTEMS should
+zero the Workspace as part of its initialization. If set to
+TRUE, the Workspace is zeroed. Otherwise, it is not.
+
+@item interrupt_stack_size
+is the size of the RTEMS allocated interrupt stack in bytes.
+This value must be at least as large as MINIMUM_STACK_SIZE.
+
+@item extra_mpci_receive_server_stack
+is the extra stack space allocated for the RTEMS MPCI receive server task
+in bytes. The MPCI receive server may invoke nearly all directives and
+may require extra stack space on some targets.
+
+@item stack_allocate_hook
+is the address of the optional user provided routine which allocates
+memory for task stacks. If this hook is not NULL, then a stack_free_hook
+must be provided as well.
+
+@item stack_free_hook
+is the address of the optional user provided routine which frees
+memory for task stacks. If this hook is not NULL, then a stack_allocate_hook
+must be provided as well.
+
+@item spurious_handler
+is the address of the optional user provided routine which is invoked
+when a spurious external interrupt occurs. A spurious interrupt is one
+for which no handler is installed.
+
+@item itimer_clicks_per_microsecond
+is the number of countdowns in the on-CPU timer which corresponds
+to a microsecond. This is a function of the clock speed of the CPU
+being used.
+
+@end table
diff --git a/doc/supplements/hppa1_1/fatalerr.texi b/doc/supplements/hppa1_1/fatalerr.texi
new file mode 100644
index 0000000000..3caedc2e06
--- /dev/null
+++ b/doc/supplements/hppa1_1/fatalerr.texi
@@ -0,0 +1,45 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Default Fatal Error Processing, Default Fatal Error Processing Introduction, Interrupt Processing Disabling of Interrupts by RTEMS, Top
+@end ifinfo
+@chapter Default Fatal Error Processing
+@ifinfo
+@menu
+* Default Fatal Error Processing Introduction::
+* Default Fatal Error Processing Default Fatal Error Handler Operations::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Default Fatal Error Processing Introduction, Default Fatal Error Processing Default Fatal Error Handler Operations, Default Fatal Error Processing, Default Fatal Error Processing
+@end ifinfo
+@section Introduction
+
+Upon detection of a fatal error by either the
+application or RTEMS the fatal error manager is invoked. The
+fatal error manager will invoke a user-supplied fatal error
+handler. If no user-supplied handler is configured, the RTEMS
+provided default fatal error handler is invoked. If the
+user-supplied fatal error handler returns to the executive the
+default fatal error handler is then invoked. This chapter
+describes the precise operations of the default fatal error
+handler.
+
+@ifinfo
+@node Default Fatal Error Processing Default Fatal Error Handler Operations, Board Support Packages, Default Fatal Error Processing Introduction, Default Fatal Error Processing
+@end ifinfo
+@section Default Fatal Error Handler Operations
+
+The default fatal error handler which is invoked by
+the fatal_error_occurred directive when there is no user handler
+configured or the user handler returns control to RTEMS. The
+default fatal error handler disables processor interrupts (i.e.
+sets the I bit in the PSW register to 0), places the error code
+in r1, and executes a break instruction to simulate a halt
+processor instruction.
+
diff --git a/doc/supplements/hppa1_1/intr.t b/doc/supplements/hppa1_1/intr.t
new file mode 100644
index 0000000000..bea2a3e39e
--- /dev/null
+++ b/doc/supplements/hppa1_1/intr.t
@@ -0,0 +1,214 @@
+@ifinfo
+@node Interrupt Processing, Interrupt Processing Introduction, Memory Model Flat Memory Model, Top
+@end ifinfo
+@chapter Interrupt Processing
+@ifinfo
+@menu
+* Interrupt Processing Introduction::
+* Interrupt Processing Vectoring of Interrupt Handler::
+* Interrupt Processing Interrupt Stack Frame::
+* Interrupt Processing External Interrupts and Traps::
+* Interrupt Processing Interrupt Levels::
+* Interrupt Processing Disabling of Interrupts by RTEMS::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Interrupt Processing Introduction, Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing, Interrupt Processing
+@end ifinfo
+@section Introduction
+
+Different types of processors respond to the
+occurence of an interrupt in their own unique fashion. In
+addition, each processor type provides a control mechanism to
+allow for the proper handling of an interrupt. The processor
+dependent response to the interrupt modifies the current
+execution state and results in a change in the execution stream.
+Most processors require that an interrupt handler utilize some
+special control mechanisms to return to the normal processing
+stream. Although RTEMS hides many of the processor dependent
+details of interrupt processing, it is important to understand
+how the RTEMS interrupt manager is mapped onto the processor's
+unique architecture. Discussed in this chapter are the PA-RISC's
+interrupt response and control mechanisms as they pertain to
+RTEMS.
+
+@ifinfo
+@node Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing Interrupt Stack Frame, Interrupt Processing Introduction, Interrupt Processing
+@end ifinfo
+@section Vectoring of Interrupt Handler
+
+Upon receipt of an interrupt the PA-RISC
+automatically performs the following actions:
+
+@itemize @bullet
+@item The PSW (Program Status Word) is saved in the IPSW
+(Interrupt Program Status Word).
+
+@item The current privilege level is set to 0.
+
+@item The following defined bits in the PSW are set:
+
+@item E bit is set to the default endian bit
+
+@item M bit is set to 1 if the interrupt is a high-priority
+machine check and 0 otherwise
+
+@item Q bit is set to zero thuse freezing the IIA
+(Instruction Address) queues
+
+@item C and D bits are set to zero thus disabling all
+protection and translation.
+
+@item I bit is set to zero this disabling all external,
+powerfail, and low-priority machine check interrupts.
+
+@item All others bits are set to zero.
+
+@item General purpose registers r1, r8, r9, r16, r17, r24, and
+r25 are copied to the shadow registers.
+
+@item Execution begins at the address given by the formula:
+Interruption Vector Address + (32 * interrupt vector number).
+@end itemize
+
+Once the processor has completed the actions it is is
+required to perform for each interrupt, the RTEMS interrupt
+management code (the beginning of which is stored in the
+Interruption Vector Table) gains control and performs the
+following actions upon each interrupt:
+
+@itemize @bullet
+@item returns the processor to "virtual mode" thus reenabling
+all code and data address translation.
+
+@item saves all necessary interrupt state information
+
+@item saves all floating point registers
+
+@item saves all integer registers
+
+@item switches the current stack to the interrupt stack
+
+@item dispatches to the appropriate user provided interrupt
+service routine (ISR). If the ISR was installed with the
+interrupt_catch directive, then it will be executed at this.
+Because, the RTEMS interrupt handler saves all registers which
+are not preserved according to the calling conventions and
+invokes the application's ISR, the ISR can easily be written in
+a high-level language.
+@end itemize
+
+RTEMS refers to the combination of the interrupt
+state information and registers saved when vectoring an
+interrupt as the Interrupt Stack Frame (ISF). A nested
+interrupt is processed similarly by the PA-RISC and RTEMS with
+the exception that the nested interrupt occurred while executing
+on the interrupt stack and, thus, the current stack need not be
+switched.
+
+@ifinfo
+@node Interrupt Processing Interrupt Stack Frame, Interrupt Processing External Interrupts and Traps, Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing
+@end ifinfo
+@section Interrupt Stack Frame
+
+The PA-RISC architecture does not alter the stack
+while processing interrupts. However, RTEMS does save
+information on the stack as part of processing an interrupt.
+This following shows the format of the Interrupt Stack Frame for
+the PA-RISC as defined by RTEMS:
+
+@example
+@group
+ +------------------------+
+ | Interrupt Context | 0xXXX
+ +------------------------+
+ | Integer Context | 0xXXX
+ +------------------------+
+ | Floating Point Context | 0xXXX
+ +------------------------+
+@end group
+@end example
+
+@ifinfo
+@node Interrupt Processing External Interrupts and Traps, Interrupt Processing Interrupt Levels, Interrupt Processing Interrupt Stack Frame, Interrupt Processing
+@end ifinfo
+@section External Interrupts and Traps
+
+In addition to the thirty-two unique interrupt
+sources supported by the PA-RISC architecture, RTEMS also
+supports the installation of handlers for each of the thirty-two
+external interrupts supported by the PA-RISC architecture.
+Except for interrupt vector 4, each of the interrupt vectors 0
+through 31 may be associated with a user-provided interrupt
+handler. Interrupt vector 4 is used for external interrupts.
+When an external interrupt occurs, the RTEMS external interrupt
+handler is invoked and the actual interrupt source is indicated
+by status bits in the EIR (External Interrupt Request) register.
+The RTEMS external interrupt handler (or interrupt vector four)
+examines the EIR to determine which interrupt source requires
+servicing.
+
+RTEMS supports sixty-four interrupt vectors for the
+PA-RISC. Vectors 0 through 31 map to the normal interrupt
+sources while RTEMS interrupt vectors 32 through 63 are directly
+associated with the external interrupt sources indicated by bits
+0 through 31 in the EIR.
+
+The exact set of interrupt sources which are checked
+for by the RTEMS external interrupt handler and the order in
+which they are checked are configured by the user in the CPU
+Configuration Table. If an external interrupt occurs which does
+not have a handler configured, then the spurious interrupt
+handler will be invoked. The spurious interrupt handler may
+also be specifiec by the user in the CPU Configuration Table.
+
+@ifinfo
+@node Interrupt Processing Interrupt Levels, Interrupt Processing Disabling of Interrupts by RTEMS, Interrupt Processing External Interrupts and Traps, Interrupt Processing
+@end ifinfo
+@section Interrupt Levels
+
+Two levels (enabled and disabled) of interrupt
+priorities are supported by the PA-RISC architecture. Level
+zero (0) indicates that interrupts are fully enabled (i.e. the I
+bit of the PSW is 1). Level one (1) indicates that interrupts
+are disabled (i.e. the I bit of the PSW is 0). Thirty-two
+independent sources of external interrupts are supported by the
+PA-RISC architecture. Each of these interrupts sources may be
+individually enabled or disabled. When processor interrupts are
+disabled, all sources of external interrupts are ignored. When
+processor interrupts are enabled, the EIR (External Interrupt
+Request) register is used to determine which sources are
+currently allowed to generate interrupts.
+
+Although RTEMS supports 256 interrupt levels, the
+PA-RISC architecture only supports two. RTEMS interrupt level 0
+indicates that interrupts are enabled and level 1 indicates that
+interrupts are disabled. All other RTEMS interrupt levels are
+undefined and their behavior is unpredictable.
+
+@ifinfo
+@node Interrupt Processing Disabling of Interrupts by RTEMS, Default Fatal Error Processing, Interrupt Processing Interrupt Levels, Interrupt Processing
+@end ifinfo
+@section Disabling of Interrupts by RTEMS
+
+During the execution of directive calls, critical
+sections of code may be executed. When these sections are
+encountered, RTEMS disables external interrupts by setting the I
+bit in the PSW to 0 before the execution of this section and
+restores them to the previous level upon completion of the
+section. RTEMS has been optimized to insure that interrupts are
+disabled for less than XXX instructions when compiled with GNU
+CC at optimization level 4. The exact execution time will vary
+based on the based on the processor implementation, amount of
+cache, the number of wait states for primary memory, and
+processor speed present on the target board.
+
+Non-maskable interrupts (NMI) such as high-priority
+machine checks cannot be disabled, and ISRs which execute at
+this level MUST NEVER issue RTEMS system calls. If a directive
+is invoked, unpredictable results may occur due to the inability
+of RTEMS to protect its critical sections. However, ISRs that
+make no system calls may safely execute as non-maskable
+interrupts.
+
diff --git a/doc/supplements/hppa1_1/memmodel.texi b/doc/supplements/hppa1_1/memmodel.texi
new file mode 100644
index 0000000000..8ac774de3d
--- /dev/null
+++ b/doc/supplements/hppa1_1/memmodel.texi
@@ -0,0 +1,80 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Memory Model, Memory Model Introduction, Calling Conventions User-Provided Routines, Top
+@end ifinfo
+@chapter Memory Model
+@ifinfo
+@menu
+* Memory Model Introduction::
+* Memory Model Flat Memory Model::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Memory Model Introduction, Memory Model Flat Memory Model, Memory Model, Memory Model
+@end ifinfo
+@section Introduction
+
+A processor may support any combination of memory
+models ranging from pure physical addressing to complex demand
+paged virtual memory systems. RTEMS supports a flat memory
+model which ranges contiguously over the processor's allowable
+address space. RTEMS does not support segmentation or virtual
+memory of any kind. The appropriate memory model for RTEMS
+provided by the targeted processor and related characteristics
+of that model are described in this chapter.
+
+@ifinfo
+@node Memory Model Flat Memory Model, Interrupt Processing, Memory Model Introduction, Memory Model
+@end ifinfo
+@section Flat Memory Model
+
+RTEMS supports applications in which the application
+and the executive execute within a single thirty-two bit address
+space. Thus RTEMS and the application share a common four
+gigabyte address space within a single space. The PA-RISC
+automatically converts every address from a logical to a
+physical address each time it is used. The PA-RISC uses
+information provided in the page table to perform this
+translation. The following protection levels are assumed:
+
+@itemize @bullet
+@item a single code segment at protection level (0) which
+contains all application and executive code.
+
+@item a single data segment at protection level zero (0) which
+contains all application and executive data.
+@end itemize
+
+The PA-RISC space registers and associated stack --
+including the stack pointer r27 -- must be initialized when the
+initialize_executive directive is invoked. RTEMS treats the
+space registers as system resources shared by all tasks and does
+not modify or context switch them.
+
+This memory model supports a flat 32-bit address
+space with addresses ranging from 0x00000000 to 0xFFFFFFFF (4
+gigabytes). Each address is represented by a 32-bit value and
+memory is addressable. The address may be used to reference a
+single byte, half-word (2-bytes), or word (4 bytes).
+
+RTEMS does not require that logical addresses map
+directly to physical addresses, although it is desirable in many
+applications to do so. RTEMS does not need any additional
+information when physical addresses do not map directly to
+physical addresses. By not requiring that logical addresses map
+directly to physical addresses, the memory space of an RTEMS
+space can be separated from that of a ROM monitor. For example,
+a ROM monitor may load application programs into a separate
+logical address space from itself.
+
+RTEMS assumes that the space registers contain the
+selector for the single data segment when a directive is
+invoked. This assumption is especially important when
+developing interrupt service routines.
+
diff --git a/doc/supplements/hppa1_1/timedata.t b/doc/supplements/hppa1_1/timedata.t
new file mode 100644
index 0000000000..a26ce419c3
--- /dev/null
+++ b/doc/supplements/hppa1_1/timedata.t
@@ -0,0 +1,105 @@
+@ifinfo
+@node HP-7100 Timing Data, HP-7100 Timing Data Introduction, Memory Requirements RTEMS RAM Workspace Worksheet, Top
+@end ifinfo
+@chapter HP-7100 Timing Data
+@ifinfo
+@menu
+* HP-7100 Timing Data Introduction::
+* HP-7100 Timing Data Hardware Platform::
+* HP-7100 Timing Data Interrupt Latency::
+* HP-7100 Timing Data Context Switch::
+* HP-7100 Timing Data Directive Times::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node HP-7100 Timing Data Introduction, HP-7100 Timing Data Hardware Platform, HP-7100 Timing Data, HP-7100 Timing Data
+@end ifinfo
+@section Introduction
+
+The timing data for the PA-RISC version of RTEMS is
+provided along with the target dependent aspects concerning the
+gathering of the timing data. The hardware platform used to
+gather the times is described to give the reader a better
+understanding of each directive time provided. Also, provided
+is a description of the interrupt latency and the context
+switch times as they pertain to the PA-RISC version of RTEMS.
+
+@ifinfo
+@node HP-7100 Timing Data Hardware Platform, HP-7100 Timing Data Interrupt Latency, HP-7100 Timing Data Introduction, HP-7100 Timing Data
+@end ifinfo
+@section Hardware Platform
+
+No directive execution times are reported for the
+HP-7100 because the target platform was proprietary and
+executions times could not be released.
+
+@ifinfo
+@node HP-7100 Timing Data Interrupt Latency, HP-7100 Timing Data Context Switch, HP-7100 Timing Data Hardware Platform, HP-7100 Timing Data
+@end ifinfo
+@section Interrupt Latency
+
+The maximum period with traps disabled or the
+processor interrupt level set to it's highest value inside RTEMS
+is less than RTEMS_MAXIMUM_DISABLE_PERIOD
+microseconds including the instructions which
+disable and re-enable interrupts. The time required for the
+HP-7100 to vector an interrupt and for the RTEMS entry overhead
+before invoking the user's trap handler are a total of
+RTEMS_INTR_ENTRY_RETURNS_TO_PREEMPTING_TASK
+microseconds. These combine to yield a worst case interrupt
+latency of less than RTEMS_MAXIMUM_DISABLE_PERIOD +
+RTEMS_INTR_ENTRY_RETURNS_TO_PREEMPTING_TASK microseconds at 15 Mhz.
+[NOTE: The maximum period with interrupts disabled was last
+determined for Release RTEMS_RELEASE_FOR_MAXIMUM_DISABLE_PERIOD.]
+
+It should be noted again that the maximum period with
+interrupts disabled within RTEMS for the HP-7100 is hand calculated.
+
+@ifinfo
+@node HP-7100 Timing Data Context Switch, HP-7100 Timing Data Directive Times, HP-7100 Timing Data Interrupt Latency, HP-7100 Timing Data
+@end ifinfo
+@section Context Switch
+
+The RTEMS processor context switch time is RTEMS_NO_FP_CONTEXTS
+microsections for the HP-7100 when no floating point context
+switch is saved or restored. Saving and restoring the floating
+point context adds additional time to the context
+switch procedure. Additional execution time is required when a
+TASK_SWITCH user extension is configured. The use of the
+TASK_SWITCH extension is application dependent. Thus, its
+execution time is not considered part of the raw context switch
+time.
+
+Since RTEMS was designed specifically for embedded
+missile applications which are floating point intensive, the
+executive is optimized to avoid unnecessarily saving and
+restoring the state of the numeric coprocessor. On many
+processors, the state of the numeric coprocessor is only saved
+when an FLOATING_POINT task is dispatched and that task was not
+the last task to utilize the coprocessor. In a system with only
+one FLOATING_POINT task, the state of the numeric coprocessor
+will never be saved or restored. When the first FLOATING_POINT
+task is dispatched, RTEMS does not need to save the current
+state of the numeric coprocessor. As discussed in the Register
+Usage section, on the HP-7100 the every task is considered to be
+floating point registers and , as a rsule, every context switch
+involves saving and restoring the state of the floating point
+unit.
+
+The following table summarizes the context switch
+times for the HP-7100 processor:
+
+@example
+no times are available for the HP-7100
+@end example
+
+@ifinfo
+@node HP-7100 Timing Data Directive Times, Command and Variable Index, HP-7100 Timing Data Context Switch, HP-7100 Timing Data
+@end ifinfo
+@section Directive Times
+
+No execution times are available for the HP-7100
+because the target platform was proprietary and no timing
+information could be released.
+
diff --git a/doc/supplements/i386/bsp.texi b/doc/supplements/i386/bsp.texi
new file mode 100644
index 0000000000..110d155154
--- /dev/null
+++ b/doc/supplements/i386/bsp.texi
@@ -0,0 +1,110 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Board Support Packages, Board Support Packages Introduction, Default Fatal Error Processing Default Fatal Error Handler Operations, Top
+@end ifinfo
+@chapter Board Support Packages
+@ifinfo
+@menu
+* Board Support Packages Introduction::
+* Board Support Packages System Reset::
+* Board Support Packages Processor Initialization::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Board Support Packages Introduction, Board Support Packages System Reset, Board Support Packages, Board Support Packages
+@end ifinfo
+@section Introduction
+
+An RTEMS Board Support Package (BSP) must be designed
+to support a particular processor and target board combination.
+This chapter presents a discussion of i386 specific BSP issues.
+For more information on developing a BSP, refer to the chapter
+titled Board Support Packages in the RTEMS C Applications User's
+Guide.
+
+@ifinfo
+@node Board Support Packages System Reset, Board Support Packages Processor Initialization, Board Support Packages Introduction, Board Support Packages
+@end ifinfo
+@section System Reset
+
+An RTEMS based application is initiated when the i386
+processor is reset. When the i386 is reset,
+
+@itemize @bullet
+@item The EAX register is set to indicate the results of the
+processor's power-up self test. If the self-test was not
+executed, the contents of this register are undefined.
+Otherwise, a non-zero value indicates the processor is faulty
+and a zero value indicates a successful self-test.
+
+@item The DX register holds a component identifier and
+revision level. DH contains 3 to indicate an i386 component and
+DL contains a unique revision level indicator.
+
+@item Control register zero (CR0) is set such that the
+processor is in real mode with paging disabled. Other portions
+of CR0 are used to indicate the presence of a numeric
+coprocessor.
+
+@item All bits in the extended flags register (EFLAG) which
+are not permanently set are cleared. This inhibits all maskable
+interrupts.
+
+@item The Interrupt Descriptor Register (IDTR) is set to point
+at address zero.
+
+@item All segment registers are set to zero.
+
+@item The instruction pointer is set to 0x0000FFF0. The
+first instruction executed after a reset is actually at
+0xFFFFFFF0 because the i386 asserts the upper twelve address
+until the first intersegment (FAR) JMP or CALL instruction.
+When a JMP or CALL is executed, the upper twelve address lines
+are lowered and the processor begins executing in the first
+megabyte of memory.
+@end itemize
+
+Typically, an intersegment JMP to the application's
+initialization code is placed at address 0xFFFFFFF0.
+
+@ifinfo
+@node Board Support Packages Processor Initialization, Processor Dependent Information Table, Board Support Packages System Reset, Board Support Packages
+@end ifinfo
+@section Processor Initialization
+
+This initialization code is responsible for
+initializing all data structures required by the i386 in
+protected mode and for actually entering protected mode. The
+i386 must be placed in protected mode and the segment registers
+and associated selectors must be initialized before the
+initialize_executive directive is invoked.
+
+The initialization code is responsible for
+initializing the Global Descriptor Table such that the i386 is
+in the thirty-two bit flat memory model with paging disabled.
+In this mode, the i386 automatically converts every address from
+a logical to a physical address each time it is used. For more
+information on the memory model used by RTEMS, please refer to
+the Memory Model chapter in this document.
+
+If the application requires that the IDTR be some
+value besides zero, then it should set it to the required value
+at this point. All tasks share the same i386 IDTR value.
+Because interrupts are enabled automatically by RTEMS as part of
+the initialize_executive directive, the IDTR MUST be set
+properly before this directive is invoked to insure correct
+interrupt vectoring. If processor caching is to be utilized,
+then it should be enabled during the reset application
+initialization code. The reset code which is executed before
+the call to initialize_executive has the following requirements:
+
+For more information regarding the i386s data
+structures and their contents, refer to Intel's 386
+Programmer's Reference Manual.
+
diff --git a/doc/supplements/i386/callconv.texi b/doc/supplements/i386/callconv.texi
new file mode 100644
index 0000000000..6d58ba2f7b
--- /dev/null
+++ b/doc/supplements/i386/callconv.texi
@@ -0,0 +1,119 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Calling Conventions, Calling Conventions Introduction, CPU Model Dependent Features Floating Point Unit, Top
+@end ifinfo
+@chapter Calling Conventions
+@ifinfo
+@menu
+* Calling Conventions Introduction::
+* Calling Conventions Processor Background::
+* Calling Conventions Calling Mechanism::
+* Calling Conventions Register Usage::
+* Calling Conventions Parameter Passing::
+* Calling Conventions User-Provided Routines::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Calling Conventions Introduction, Calling Conventions Processor Background, Calling Conventions, Calling Conventions
+@end ifinfo
+@section Introduction
+
+Each high-level language compiler generates
+subroutine entry and exit code based upon a set of rules known
+as the compiler's calling convention. These rules address the
+following issues:
+
+@itemize @bullet
+@item register preservation and usage
+
+@item parameter passing
+
+@item call and return mechanism
+@end itemize
+
+A compiler's calling convention is of importance when
+interfacing to subroutines written in another language either
+assembly or high-level. Even when the high-level language and
+target processor are the same, different compilers may use
+different calling conventions. As a result, calling conventions
+are both processor and compiler dependent.
+
+@ifinfo
+@node Calling Conventions Processor Background, Calling Conventions Calling Mechanism, Calling Conventions Introduction, Calling Conventions
+@end ifinfo
+@section Processor Background
+
+The i386 architecture supports a simple yet effective
+call and return mechanism. A subroutine is invoked via the call
+(call) instruction. This instruction pushes the return address
+on the stack. The return from subroutine (ret) instruction pops
+the return address off the current stack and transfers control
+to that instruction. It is is important to note that the i386
+call and return mechanism does not automatically save or restore
+any registers. It is the responsibility of the high-level
+language compiler to define the register preservation and usage
+convention.
+
+@ifinfo
+@node Calling Conventions Calling Mechanism, Calling Conventions Register Usage, Calling Conventions Processor Background, Calling Conventions
+@end ifinfo
+@section Calling Mechanism
+
+All RTEMS directives are invoked using a call
+instruction and return to the user application via the ret
+instruction.
+
+@ifinfo
+@node Calling Conventions Register Usage, Calling Conventions Parameter Passing, Calling Conventions Calling Mechanism, Calling Conventions
+@end ifinfo
+@section Register Usage
+
+As discussed above, the call instruction does not
+automatically save any registers. RTEMS uses the registers EAX,
+ECX, and EDX as scratch registers. These registers are not
+preserved by RTEMS directives therefore, the contents of these
+registers should not be assumed upon return from any RTEMS
+directive.
+
+@ifinfo
+@node Calling Conventions Parameter Passing, Calling Conventions User-Provided Routines, Calling Conventions Register Usage, Calling Conventions
+@end ifinfo
+@section Parameter Passing
+
+RTEMS assumes that arguments are placed on the
+current stack before the directive is invoked via the call
+instruction. The first argument is assumed to be closest to the
+return address on the stack. This means that the first argument
+of the C calling sequence is pushed last. The following
+pseudo-code illustrates the typical sequence used to call a
+RTEMS directive with three (3) arguments:
+
+@example
+push third argument
+push second argument
+push first argument
+invoke directive
+remove arguments from the stack
+@end example
+
+The arguments to RTEMS are typically pushed onto the
+stack using a push instruction. These arguments must be removed
+from the stack after control is returned to the caller. This
+removal is typically accomplished by adding the size of the
+argument list in bytes to the stack pointer.
+
+@ifinfo
+@node Calling Conventions User-Provided Routines, Memory Model, Calling Conventions Parameter Passing, Calling Conventions
+@end ifinfo
+@section User-Provided Routines
+
+All user-provided routines invoked by RTEMS, such as
+user extensions, device drivers, and MPCI routines, must also
+adhere to these calling conventions.
+
diff --git a/doc/supplements/i386/cpumodel.texi b/doc/supplements/i386/cpumodel.texi
new file mode 100644
index 0000000000..4504572dca
--- /dev/null
+++ b/doc/supplements/i386/cpumodel.texi
@@ -0,0 +1,81 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node CPU Model Dependent Features, CPU Model Dependent Features Introduction, Preface, Top
+@end ifinfo
+@chapter CPU Model Dependent Features
+@ifinfo
+@menu
+* CPU Model Dependent Features Introduction::
+* CPU Model Dependent Features CPU Model Name::
+* CPU Model Dependent Features Floating Point Unit::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node CPU Model Dependent Features Introduction, CPU Model Dependent Features CPU Model Name, CPU Model Dependent Features, CPU Model Dependent Features
+@end ifinfo
+@section Introduction
+
+Microprocessors are generally classified into
+families with a variety of CPU models or implementations within
+that family. Within a processor family, there is a high level
+of binary compatibility. This family may be based on either an
+architectural specification or on maintaining compatibility with
+a popular processor. Recent microprocessor families such as the
+SPARC or PA-RISC are based on an architectural specification
+which is independent or any particular CPU model or
+implementation. Older families such as the M68xxx and the iX86
+evolved as the manufacturer strived to produce higher
+performance processor models which maintained binary
+compatibility with older models.
+
+RTEMS takes advantage of the similarity of the
+various models within a CPU family. Although the models do vary
+in significant ways, the high level of compatibility makes it
+possible to share the bulk of the CPU dependent executive code
+across the entire family. Each processor family supported by
+RTEMS has a list of features which vary between CPU models
+within a family. For example, the most common model dependent
+feature regardless of CPU family is the presence or absence of a
+floating point unit or coprocessor. When defining the list of
+features present on a particular CPU model, one simply notes
+that floating point hardware is or is not present and defines a
+single constant appropriately. Conditional compilation is
+utilized to include the appropriate source code for this CPU
+model's feature set. It is important to note that this means
+that RTEMS is thus compiled using the appropriate feature set
+and compilation flags optimal for this CPU model used. The
+alternative would be to generate a binary which would execute on
+all family members using only the features which were always
+present.
+
+This chapter presents the set of features which vary
+across i386 implementations and are of importance to RTEMS.
+The set of CPU model feature macros are defined in the file
+c/src/exec/score/cpu/i386/i386.h based upon the particular CPU
+model defined on the compilation command line.
+
+@ifinfo
+@node CPU Model Dependent Features CPU Model Name, CPU Model Dependent Features Floating Point Unit, CPU Model Dependent Features Introduction, CPU Model Dependent Features
+@end ifinfo
+@section CPU Model Name
+
+The macro CPU_MODEL_NAME is a string which designates
+the name of this CPU model. For example, for the Intel i386 without an
+i387 coprocessor, this macro is set to the string "i386 with i387".
+
+@ifinfo
+@node CPU Model Dependent Features Floating Point Unit, Calling Conventions, CPU Model Dependent Features CPU Model Name, CPU Model Dependent Features
+@end ifinfo
+@section Floating Point Unit
+
+The macro I386_HAS_FPU is set to 1 to indicate that
+this CPU model has a hardware floating point unit and 0
+otherwise. The hardware floating point may be on-chip (as in the
+case of an i486DX or Pentium) or as a coprocessor (as in the case of
+an i386/i387 combination).
diff --git a/doc/supplements/i386/cputable.texi b/doc/supplements/i386/cputable.texi
new file mode 100644
index 0000000000..aea8db223e
--- /dev/null
+++ b/doc/supplements/i386/cputable.texi
@@ -0,0 +1,126 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Processor Dependent Information Table, Processor Dependent Information Table Introduction, Board Support Packages Processor Initialization, Top
+@end ifinfo
+@chapter Processor Dependent Information Table
+@ifinfo
+@menu
+* Processor Dependent Information Table Introduction::
+* Processor Dependent Information Table CPU Dependent Information Table::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Processor Dependent Information Table Introduction, Processor Dependent Information Table CPU Dependent Information Table, Processor Dependent Information Table, Processor Dependent Information Table
+@end ifinfo
+@section Introduction
+
+Any highly processor dependent information required
+to describe a processor to RTEMS is provided in the CPU
+Dependent Information Table. This table is not required for all
+processors supported by RTEMS. This chapter describes the
+contents, if any, for a particular processor type.
+
+@ifinfo
+@node Processor Dependent Information Table CPU Dependent Information Table, Memory Requirements, Processor Dependent Information Table Introduction, Processor Dependent Information Table
+@end ifinfo
+@section CPU Dependent Information Table
+
+The i386 version of the RTEMS CPU Dependent
+Information Table contains the information required to interface
+a Board Support Package and RTEMS on the i386. This information
+is provided to allow RTEMS to interoperate effectively with the
+BSP. The C structure definition is given here:
+
+@example
+struct cpu_configuration_table @{
+ void (*pretasking_hook)( void );
+ void (*predriver_hook)( void );
+ void (*idle_task)( void );
+ boolean do_zero_of_workspace;
+ unsigned32 interrupt_stack_size;
+ unsigned32 extra_mpci_receive_server_stack;
+ void * (*stack_allocate_hook)( unsigned32 );
+ void (*stack_free_hook)( void* );
+ /* end of fields required on all CPUs */
+
+ unsigned32 interrupt_segment;
+ void *interrupt_vector_table;
+@};
+@end example
+
+@table @code
+@item pretasking_hook
+is the address of the
+user provided routine which is invoked once RTEMS initialization
+is complete but before interrupts and tasking are enabled. This
+field may be NULL to indicate that the hook is not utilized.
+
+@item predriver_hook
+is the address of the user provided
+routine which is invoked with tasking enabled immediately before
+the MPCI and device drivers are initialized. RTEMS
+initialization is complete, interrupts and tasking are enabled,
+but no device drivers are initialized. This field may be NULL to
+indicate that the hook is not utilized.
+
+@item postdriver_hook
+is the address of the user provided
+routine which is invoked with tasking enabled immediately after
+the MPCI and device drivers are initialized. RTEMS
+initialization is complete, interrupts and tasking are enabled,
+and the device drivers are initialized. This field may be NULL
+to indicate that the hook is not utilized.
+
+@item idle_task
+is the address of the optional user
+provided routine which is used as the system's IDLE task. If
+this field is not NULL, then the RTEMS default IDLE task is not
+used. This field may be NULL to indicate that the default IDLE
+is to be used.
+
+@item do_zero_of_workspace
+indicates whether RTEMS should
+zero the Workspace as part of its initialization. If set to
+TRUE, the Workspace is zeroed. Otherwise, it is not.
+
+@item interrupt_stack_size
+is the size of the RTEMS
+allocated interrupt stack in bytes. This value must be at least
+as large as MINIMUM_STACK_SIZE.
+
+@item extra_mpci_receive_server_stack
+is the extra stack space allocated for the RTEMS MPCI receive server task
+in bytes. The MPCI receive server may invoke nearly all directives and
+may require extra stack space on some targets.
+
+@item stack_allocate_hook
+is the address of the optional user provided routine which allocates
+memory for task stacks. If this hook is not NULL, then a stack_free_hook
+must be provided as well.
+
+@item stack_free_hook
+is the address of the optional user provided routine which frees
+memory for task stacks. If this hook is not NULL, then a stack_allocate_hook
+must be provided as well.
+
+@item interrupt_segment
+is the value of the selector which should be placed in a segment
+register to access the Interrupt Descriptor Table.
+
+@item interrupt_vector_table
+is the base address of the Interrupt Descriptor Table relative to the
+interrupt_segment.
+
+@end table
+
+The contents of the i386 Interrupt Descriptor Table
+are discussed in Intel's i386 User's Manual. Structure
+definitions for the i386 IDT is provided by including the file
+rtems.h.
+
diff --git a/doc/supplements/i386/fatalerr.texi b/doc/supplements/i386/fatalerr.texi
new file mode 100644
index 0000000000..2743eb9a05
--- /dev/null
+++ b/doc/supplements/i386/fatalerr.texi
@@ -0,0 +1,44 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Default Fatal Error Processing, Default Fatal Error Processing Introduction, Interrupt Processing Interrupt Stack, Top
+@end ifinfo
+@chapter Default Fatal Error Processing
+@ifinfo
+@menu
+* Default Fatal Error Processing Introduction::
+* Default Fatal Error Processing Default Fatal Error Handler Operations::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Default Fatal Error Processing Introduction, Default Fatal Error Processing Default Fatal Error Handler Operations, Default Fatal Error Processing, Default Fatal Error Processing
+@end ifinfo
+@section Introduction
+
+Upon detection of a fatal error by either the
+application or RTEMS the fatal error manager is invoked. The
+fatal error manager will invoke the user-supplied fatal error
+handlers. If no user-supplied handlers are configured, the
+RTEMS provided default fatal error handler is invoked. If the
+user-supplied fatal error handlers return to the executive the
+default fatal error handler is then invoked. This chapter
+describes the precise operations of the default fatal error
+handler.
+
+@ifinfo
+@node Default Fatal Error Processing Default Fatal Error Handler Operations, Board Support Packages, Default Fatal Error Processing Introduction, Default Fatal Error Processing
+@end ifinfo
+@section Default Fatal Error Handler Operations
+
+The default fatal error handler which is invoked by
+the fatal_error_occurred directive when there is no user handler
+configured or the user handler returns control to RTEMS. The
+default fatal error handler disables processor interrupts,
+places the error code in EAX, and executes a HLT instruction to
+halt the processor.
+
diff --git a/doc/supplements/i386/intr.t b/doc/supplements/i386/intr.t
new file mode 100644
index 0000000000..5c36183970
--- /dev/null
+++ b/doc/supplements/i386/intr.t
@@ -0,0 +1,191 @@
+@ifinfo
+@node Interrupt Processing, Interrupt Processing Introduction, Memory Model Flat Memory Model, Top
+@end ifinfo
+@chapter Interrupt Processing
+@ifinfo
+@menu
+* Interrupt Processing Introduction::
+* Interrupt Processing Vectoring of Interrupt Handler::
+* Interrupt Processing Interrupt Stack Frame::
+* Interrupt Processing Interrupt Levels::
+* Interrupt Processing Disabling of Interrupts by RTEMS::
+* Interrupt Processing Interrupt Stack::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Interrupt Processing Introduction, Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing, Interrupt Processing
+@end ifinfo
+@section Introduction
+
+Different types of processors respond to the
+occurrence of an interrupt in their own unique fashion. In
+addition, each processor type provides a control mechanism to
+allow the proper handling of an interrupt. The processor
+dependent response to the interrupt modifies the execution state
+and results in the modification of the execution stream. This
+modification usually requires that an interrupt handler utilize
+the provided control mechanisms to return to the normal
+processing stream. Although RTEMS hides many of the processor
+dependent details of interrupt processing, it is important to
+understand how the RTEMS interrupt manager is mapped onto the
+processor's unique architecture. Discussed in this chapter are
+the the processor's response and control mechanisms as they
+pertain to RTEMS.
+
+@ifinfo
+@node Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing Interrupt Stack Frame, Interrupt Processing Introduction, Interrupt Processing
+@end ifinfo
+@section Vectoring of Interrupt Handler
+
+Although the i386 supports multiple privilege levels,
+RTEMS and all user software executes at privilege level 0. This
+decision was made by the RTEMS designers to enhance
+compatibility with processors which do not provide sophisticated
+protection facilities like those of the i386. This decision
+greatly simplifies the discussion of i386 processing, as one
+need only consider interrupts without privilege transitions.
+
+Upon receipt of an interrupt the i386 automatically
+performs the following actions:
+
+@itemize @bullet
+@item pushes the EFLAGS register
+
+@item pushes the far address of the interrupted instruction
+
+@item vectors to the interrupt service routine (ISR).
+@end itemize
+
+A nested interrupt is processed similarly by the
+i386.
+
+@ifinfo
+@node Interrupt Processing Interrupt Stack Frame, Interrupt Processing Interrupt Levels, Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing
+@end ifinfo
+@section Interrupt Stack Frame
+
+The structure of the Interrupt Stack Frame for the
+i386 which is placed on the interrupt stack by the processor in
+response to an interrupt is as follows:
+
+@ifset use-ascii
+@example
+@group
+ +----------------------+
+ | Old EFLAGS Register | ESP+8
+ +----------+-----------+
+ | UNUSED | Old CS | ESP+4
+ +----------+-----------+
+ | Old EIP | ESP
+ +----------------------+
+@end group
+@end example
+@end ifset
+
+@ifset use-tex
+@sp 1
+@tex
+\centerline{\vbox{\offinterlineskip\halign{
+\strut\vrule#&
+\hbox to 1.00in{\enskip\hfil#\hfil}&
+\vrule#&
+\hbox to 1.00in{\enskip\hfil#\hfil}&
+\vrule#&
+\hbox to 0.75in{\enskip\hfil#\hfil}
+\cr
+\multispan{4}\hrulefill\cr
+& \multispan{3} Old EFLAGS Register\quad&&ESP+8\cr
+\multispan{4}\hrulefill\cr
+&UNUSED &&Old CS &&ESP+4\cr
+\multispan{4}\hrulefill\cr
+& \multispan{3} Old EIP && ESP\cr
+\multispan{4}\hrulefill\cr
+}}\hfil}
+@end tex
+@end ifset
+
+@ifset use-html
+@html
+<CENTER>
+ <TABLE COLS=3 WIDTH="40%" BORDER=2>
+<TR><TD ALIGN=center COLSPAN=2><STRONG>Old EFLAGS Register</STRONG></TD>
+ <TD ALIGN=center>0x0</TD></TR>
+<TR><TD ALIGN=center><STRONG>UNUSED</STRONG></TD>
+ <TD ALIGN=center><STRONG>Old CS</STRONG></TD>
+ <TD ALIGN=center>0x2</TD></TR>
+<TR><TD ALIGN=center COLSPAN=2><STRONG>Old EIP</STRONG></TD>
+ <TD ALIGN=center>0x4</TD></TR>
+ </TABLE>
+</CENTER>
+@end html
+@end ifset
+
+@ifinfo
+@node Interrupt Processing Interrupt Levels, Interrupt Processing Disabling of Interrupts by RTEMS, Interrupt Processing Interrupt Stack Frame, Interrupt Processing
+@end ifinfo
+@section Interrupt Levels
+
+Although RTEMS supports 256 interrupt levels, the
+i386 only supports two -- enabled and disabled. Interrupts are
+enabled when the interrupt-enable flag (IF) in the extended
+flags (EFLAGS) is set. Conversely, interrupt processing is
+inhibited when the IF is cleared. During a non-maskable
+interrupt, all other interrupts, including other non-maskable
+ones, are inhibited.
+
+RTEMS interrupt levels 0 and 1 such that level zero
+(0) indicates that interrupts are fully enabled and level one
+that interrupts are disabled. All other RTEMS interrupt levels
+are undefined and their behavior is unpredictable.
+
+@ifinfo
+@node Interrupt Processing Disabling of Interrupts by RTEMS, Interrupt Processing Interrupt Stack, Interrupt Processing Interrupt Levels, Interrupt Processing
+@end ifinfo
+@section Disabling of Interrupts by RTEMS
+
+During the execution of directive calls, critical
+sections of code may be executed. When these sections are
+encountered, RTEMS disables interrupts before the execution of
+this section and restores them to the previous level upon
+completion of the section. RTEMS has been optimized to insure
+that interrupts are disabled for less than RTEMS_MAXIMUM_DISABLE_PERIOD
+microseconds on a RTEMS_MAXIMUM_DISABLE_PERIOD_MHZ Mhz i386 with zero
+wait states. These numbers will vary based the number of wait states
+and processor speed present on the target board. [NOTE: The maximum
+period with interrupts disabled within RTEMS was last calculated for
+Release RTEMS_RELEASE_FOR_MAXIMUM_DISABLE_PERIOD.]
+
+Non-maskable interrupts (NMI) cannot be disabled, and
+ISRs which execute at this level MUST NEVER issue RTEMS system
+calls. If a directive is invoked, unpredictable results may
+occur due to the inability of RTEMS to protect its critical
+sections. However, ISRs that make no system calls may safely
+execute as non-maskable interrupts.
+
+@ifinfo
+@node Interrupt Processing Interrupt Stack, Default Fatal Error Processing, Interrupt Processing Disabling of Interrupts by RTEMS, Interrupt Processing
+@end ifinfo
+@section Interrupt Stack
+
+The i386 family does not support a dedicated hardware
+interrupt stack. On this processor, RTEMS allocates and manages
+a dedicated interrupt stack. As part of vectoring a non-nested
+interrupt service routine, RTEMS switches from the stack of the
+interrupted task to a dedicated interrupt stack. When a
+non-nested interrupt returns, RTEMS switches back to the stack
+of the interrupted stack. The current stack pointer is not
+altered by RTEMS on nested interrupt.
+
+Without a dedicated interrupt stack, every task in
+the system MUST have enough stack space to accommodate the worst
+case stack usage of that particular task and the interrupt
+service routines COMBINED. By supporting a dedicated interrupt
+stack, RTEMS significantly lowers the stack requirements for
+each task.
+
+RTEMS allocates the dedicated interrupt stack from
+the Workspace Area. The amount of memory allocated for the
+interrupt stack is determined by the interrupt_stack_size field
+in the CPU Configuration Table.
+
diff --git a/doc/supplements/i386/memmodel.texi b/doc/supplements/i386/memmodel.texi
new file mode 100644
index 0000000000..3d4ca55410
--- /dev/null
+++ b/doc/supplements/i386/memmodel.texi
@@ -0,0 +1,85 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Memory Model, Memory Model Introduction, Calling Conventions User-Provided Routines, Top
+@end ifinfo
+@chapter Memory Model
+@ifinfo
+@menu
+* Memory Model Introduction::
+* Memory Model Flat Memory Model::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Memory Model Introduction, Memory Model Flat Memory Model, Memory Model, Memory Model
+@end ifinfo
+@section Introduction
+
+A processor may support any combination of memory
+models ranging from pure physical addressing to complex demand
+paged virtual memory systems. RTEMS supports a flat memory
+model which ranges contiguously over the processor's allowable
+address space. RTEMS does not support segmentation or virtual
+memory of any kind. The appropriate memory model for RTEMS
+provided by the targeted processor and related characteristics
+of that model are described in this chapter.
+
+@ifinfo
+@node Memory Model Flat Memory Model, Interrupt Processing, Memory Model Introduction, Memory Model
+@end ifinfo
+@section Flat Memory Model
+
+RTEMS supports the i386 protected mode, flat memory
+model with paging disabled. In this mode, the i386
+automatically converts every address from a logical to a
+physical address each time it is used. The i386 uses
+information provided in the segment registers and the Global
+Descriptor Table to convert these addresses. RTEMS assumes the
+existence of the following segments:
+
+@itemize @bullet
+@item a single code segment at protection level (0) which
+contains all application and executive code.
+
+@item a single data segment at protection level zero (0) which
+contains all application and executive data.
+@end itemize
+
+The i386 segment registers and associated selectors
+must be initialized when the initialize_executive directive is
+invoked. RTEMS treats the segment registers as system registers
+and does not modify or context switch them.
+
+This i386 memory model supports a flat 32-bit address
+space with addresses ranging from 0x00000000 to 0xFFFFFFFF (4
+gigabytes). Each address is represented by a 32-bit value and
+is byte addressable. The address may be used to reference a
+single byte, half-word (2-bytes), or word (4 bytes).
+
+RTEMS does not require that logical addresses map
+directly to physical addresses, although it is desirable in many
+applications to do so. If logical and physical addresses are
+not the same, then an additional selector will be required so
+RTEMS can access the Interrupt Descriptor Table to install
+interrupt service routines. The selector number of this segment
+is provided to RTEMS in the CPU Dependent Information Table.
+
+By not requiring that logical addresses map directly
+to physical addresses, the memory space of an RTEMS application
+can be separated from that of a ROM monitor. For example, on
+the Force Computers CPU386, the ROM monitor loads application
+programs into a logical address space where logical address
+0x00000000 corresponds to physical address 0x0002000. On this
+board, RTEMS and the application use virtual addresses which do
+not map to physical addresses.
+
+RTEMS assumes that the DS and ES registers contain
+the selector for the single data segment when a directive is
+invoked. This assumption is especially important when
+developing interrupt service routines.
+
diff --git a/doc/supplements/i386/timedata.t b/doc/supplements/i386/timedata.t
new file mode 100644
index 0000000000..03362e3c88
--- /dev/null
+++ b/doc/supplements/i386/timedata.t
@@ -0,0 +1,135 @@
+@include ../common/timemac.texi
+@tex
+\global\advance \smallskipamount by -4pt
+@end tex
+
+@ifinfo
+@node i386 Timing Data, i386 Timing Data Introduction, Memory Requirements RTEMS RAM Workspace Worksheet, Top
+@end ifinfo
+@chapter i386 Timing Data
+@ifinfo
+@menu
+* i386 Timing Data Introduction::
+* i386 Timing Data Hardware Platform::
+* i386 Timing Data Interrupt Latency::
+* i386 Timing Data Context Switch::
+* i386 Timing Data Directive Times::
+* i386 Timing Data Task Manager::
+* i386 Timing Data Interrupt Manager::
+* i386 Timing Data Clock Manager::
+* i386 Timing Data Timer Manager::
+* i386 Timing Data Semaphore Manager::
+* i386 Timing Data Message Manager::
+* i386 Timing Data Event Manager::
+* i386 Timing Data Signal Manager::
+* i386 Timing Data Partition Manager::
+* i386 Timing Data Region Manager::
+* i386 Timing Data Dual-Ported Memory Manager::
+* i386 Timing Data I/O Manager::
+* i386 Timing Data Rate Monotonic Manager::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node i386 Timing Data Introduction, i386 Timing Data Hardware Platform, i386 Timing Data, i386 Timing Data
+@end ifinfo
+@section Introduction
+
+The timing data for the i386 version of RTEMS is
+provided along with the target dependent aspects concerning the
+gathering of the timing data. The hardware platform used to
+gather the times is described to give the reader a better
+understanding of each directive time provided. Also, provided
+is a description of the interrupt latency and the context
+switch times as they pertain to the i386 version of RTEMS.
+
+@ifinfo
+@node i386 Timing Data Hardware Platform, i386 Timing Data Interrupt Latency, i386 Timing Data Introduction, i386 Timing Data
+@end ifinfo
+@section Hardware Platform
+
+All times reported except for the maximum period
+interrupts are disabled by RTEMS were measured using a Force
+Computers CPU386 board. The CPU386 is a 16 Mhz board with zero
+wait state dynamic memory and an i80387 numeric coprocessor.
+One of the count-down timers provided by a Motorola MC68901 was
+used to measure elapsed time with one microsecond resolution.
+All sources of hardware interrupts are disabled, although the
+interrupt level of the i386 allows all interrupts.
+
+The maximum period interrupts are disabled was
+measured by summing the number of CPU cycles required by each
+assembly language instruction executed while interrupts were
+disabled. Zero wait state memory was assumed. The total CPU
+cycles executed with interrupts disabled, including the
+instructions to disable and enable interrupts, was divided by 16
+to simulate a i386 executing at 16 Mhz.
+
+@ifinfo
+@node i386 Timing Data Interrupt Latency, i386 Timing Data Context Switch, i386 Timing Data Hardware Platform, i386 Timing Data
+@end ifinfo
+@section Interrupt Latency
+
+The maximum period with interrupts disabled within
+RTEMS is less than RTEMS_MAXIMUM_DISABLE_PERIOD microseconds
+including the instructions
+which disable and re-enable interrupts. The time required for
+the i386 to generate an interrupt using the int instruction,
+vectoring to an interrupt handler, and for the RTEMS entry
+overhead before invoking the user's interrupt handler are a
+total of 12 microseconds. These combine to yield a worst case
+interrupt latency of less
+RTEMS_MAXIMUM_DISABLE_PERIOD + RTEMS_INTR_ENTRY_RETURNS_TO_PREEMPTING_TASK
+microseconds. [NOTE: The
+maximum period with interrupts disabled within RTEMS was last
+calculated for Release RTEMS_RELEASE_FOR_MAXIMUM_DISABLE_PERIOD.]
+
+It should be noted again that the maximum period with
+interrupts disabled within RTEMS is hand-timed. The interrupt
+vector and entry overhead time was generated on the Force
+Computers CPU386 benchmark platform using the int instruction as
+the interrupt source.
+
+@ifinfo
+@node i386 Timing Data Context Switch, i386 Timing Data Directive Times, i386 Timing Data Interrupt Latency, i386 Timing Data
+@end ifinfo
+@section Context Switch
+
+The RTEMS processor context switch time is RTEMS_NO_FP_CONTEXTS
+microseconds on the Force Computers CPU386 benchmark platform.
+This time represents the raw context switch time with no user
+extensions configured. Additional execution time is required
+when a TASK_SWITCH user extension is configured. The use of the
+TASK_SWITCH extension is application dependent. Thus, its
+execution time is not considered part of the base context switch
+time.
+
+Since RTEMS was designed specifically for embedded
+missile applications which are floating point intensive, the
+executive is optimized to avoid unnecessarily saving and
+restoring the state of the numeric coprocessor. The state of
+the numeric coprocessor is only saved when a FLOATING_POINT task
+is dispatched and that task was not the last task to utilize the
+coprocessor. In a system with only one FLOATING_POINT task, the
+state of the numeric coprocessor will never be saved or
+restored. When the first FLOATING_POINT task is dispatched,
+RTEMS does not need to save the current state of the numeric
+coprocessor.
+
+The exact amount of time required to save and restore
+floating point context is dependent on the state of the numeric
+coprocessor. RTEMS places the coprocessor in the initialized
+state when a task is started or restarted. Once the task has
+utilized the coprocessor, it is in the idle state when floating
+point instructions are not executing and the busy state when
+floating point instructions are executing. The state of the
+coprocessor is task specific.
+
+The following table summarizes the context switch
+times for the Force Computers CPU386 benchmark platform:
+
+@include timetbl.texi
+
+@tex
+\global\advance \smallskipamount by 4pt
+@end tex
diff --git a/doc/supplements/i960/bsp.texi b/doc/supplements/i960/bsp.texi
new file mode 100644
index 0000000000..423cde737c
--- /dev/null
+++ b/doc/supplements/i960/bsp.texi
@@ -0,0 +1,71 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Board Support Packages, Board Support Packages Introduction, Default Fatal Error Processing Default Fatal Error Handler Operations, Top
+@end ifinfo
+@chapter Board Support Packages
+@ifinfo
+@menu
+* Board Support Packages Introduction::
+* Board Support Packages System Reset::
+* Board Support Packages Processor Initialization::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Board Support Packages Introduction, Board Support Packages System Reset, Board Support Packages, Board Support Packages
+@end ifinfo
+@section Introduction
+
+An RTEMS Board Support Package (BSP) must be designed
+to support a particular processor and target board combination.
+This chapter presents a discussion of i960CA specific BSP
+issues. For more information on developing a BSP, refer to the
+chapter titled Board Support Packages in the RTEMS C
+Applications User's Guide.
+
+@ifinfo
+@node Board Support Packages System Reset, Board Support Packages Processor Initialization, Board Support Packages Introduction, Board Support Packages
+@end ifinfo
+@section System Reset
+
+An RTEMS based application is initiated when the
+i960CA processor is reset. When the i960CA is reset, the
+processor reads an Initial Memory Image (IMI) to establish its
+state. The IMI consists of the Initialization Boot Record (IBR)
+and the Process Control Block (PRCB) from an Initial Memory
+Image (IMI) at location 0xFFFFFF00. The IBR contains the
+initial bus configuration data, the address of the first
+instruction to execute after reset, the address of the PRCB, and
+the checksum used by the processor's self-test.
+
+@ifinfo
+@node Board Support Packages Processor Initialization, Processor Dependent Information Table, Board Support Packages System Reset, Board Support Packages
+@end ifinfo
+@section Processor Initialization
+
+The PRCB contains the base addresses for system data
+structures, and initial configuration information for the core
+and integrated peripherals. In particular, the PRCB contains
+the initial contents of the Arithmetic Control (AC) Register as
+well as the base addresses of the Interrupt Vector Table, System
+Procedure Entry Table, Fault Entry Table, and the Control Table.
+In addition, the PRCB is used to configure the depth of the
+instruction and register caches and the actions when certain
+types of faults are encountered.
+
+The Process Controls (PC) Register is initialized to
+0xC01F2002 which sets the i960CA's interrupt level to 0x1F (31
+decimal). In addition, the Interrupt Mask (IMSK) Register
+(alternately referred to as Special Function Register 1 or sf1)
+is set to 0x00000000 to mask all external and DMA interrupt
+sources. Thus, all interrupts are disabled when the first
+instruction is executed.
+
+For more information regarding the i960CA's data
+structures and their contents, refer to Intel's i960CA User's
+Manual.
diff --git a/doc/supplements/i960/callconv.texi b/doc/supplements/i960/callconv.texi
new file mode 100644
index 0000000000..7998baee2f
--- /dev/null
+++ b/doc/supplements/i960/callconv.texi
@@ -0,0 +1,130 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Calling Conventions, Calling Conventions Introduction, CPU Model Dependent Features Floating Point Unit, Top
+@end ifinfo
+@chapter Calling Conventions
+@ifinfo
+@menu
+* Calling Conventions Introduction::
+* Calling Conventions Processor Background::
+* Calling Conventions Calling Mechanism::
+* Calling Conventions Register Usage::
+* Calling Conventions Parameter Passing::
+* Calling Conventions User-Provided Routines::
+* Calling Conventions Leaf Procedures::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Calling Conventions Introduction, Calling Conventions Processor Background, Calling Conventions, Calling Conventions
+@end ifinfo
+@section Introduction
+
+Each high-level language compiler generates
+subroutine entry and exit code based upon a set of rules known
+as the compiler's calling convention. These rules address the
+following issues:
+
+@itemize @bullet
+@item register preservation and usage
+
+@item parameter passing
+
+@item call and return mechanism
+@end itemize
+
+A compiler's calling convention is of importance when
+interfacing to subroutines written in another language either
+assembly or high-level. Even when the high-level language and
+target processor are the same, different compilers may use
+different calling conventions. As a result, calling conventions
+are both processor and compiler dependent.
+
+@ifinfo
+@node Calling Conventions Processor Background, Calling Conventions Calling Mechanism, Calling Conventions Introduction, Calling Conventions
+@end ifinfo
+@section Processor Background
+
+All members of the i960 architecture family support
+two methods for performing procedure calls: a RISC-style
+branch-and-link and an integrated call and return mechanism.
+
+On a branch-and-link, the processor branches to the
+invoked procedure and saves the return address in a register,
+G14. Typically, the invoked procedure will not invoke another
+procedure and is referred to as a leaf procedure. Many
+high-level language compilers for the i960 family recognize leaf
+procedures and automatically optimize them to utilize the
+branch-and-link mechanism. Branch-and-link procedures are
+invoked using the bal and balx instructions and return control
+via the bx instruction. By convention, G14 is zero when not in
+a leaf procedure. It is the responsibility of the leaf
+procedure to clear G14 before returning.
+
+The integrated call and return mechanism also
+branches to the invoked procedure and saves the return address
+as did the branch and link mechanism. However, the important
+difference is that the call, callx, and calls instructions save
+the local register set (R0 through R15) before transferring
+control to the invoked procedure. The ret instruction
+automatically restores the previous local register set. The
+i960CA provides a register cache which can be configured to
+retain the last five to sixteen recent register caches. When
+the register cache is full, the oldest cached register set is
+written to the stack.
+
+@ifinfo
+@node Calling Conventions Calling Mechanism, Calling Conventions Register Usage, Calling Conventions Processor Background, Calling Conventions
+@end ifinfo
+@section Calling Mechanism
+
+All RTEMS directives are invoked using either a call
+or callx instruction and return to the user via the ret
+instruction.
+
+@ifinfo
+@node Calling Conventions Register Usage, Calling Conventions Parameter Passing, Calling Conventions Calling Mechanism, Calling Conventions
+@end ifinfo
+@section Register Usage
+
+As discussed above, the call and callx instructions
+automatically save the current contents of the local register
+set (R0 through R15). The contents of the local registers will
+be restored as part of returning to the application. The
+contents of global registers G0 through G7 are not preserved by
+RTEMS directives.
+
+@ifinfo
+@node Calling Conventions Parameter Passing, Calling Conventions User-Provided Routines, Calling Conventions Register Usage, Calling Conventions
+@end ifinfo
+@section Parameter Passing
+
+RTEMS uses the standard i960 family C parameter
+passing mechanism in which G0 contains the first parameter, G1
+the second, and so on for the remaining parameters. No RTEMS
+directive requires more than six parameters.
+
+@ifinfo
+@node Calling Conventions User-Provided Routines, Calling Conventions Leaf Procedures, Calling Conventions Parameter Passing, Calling Conventions
+@end ifinfo
+@section User-Provided Routines
+
+All user-provided routines invoked by RTEMS, such as
+user extensions, device drivers, and MPCI routines, must also
+adhere to these calling conventions.
+
+@ifinfo
+@node Calling Conventions Leaf Procedures, Memory Model, Calling Conventions User-Provided Routines, Calling Conventions
+@end ifinfo
+@section Leaf Procedures
+
+RTEMS utilizes leaf procedures internally to improve
+performance. This improves execution speed as well as reducing
+stack usage and the number of register sets which must be cached.
+
+
diff --git a/doc/supplements/i960/cpumodel.texi b/doc/supplements/i960/cpumodel.texi
new file mode 100644
index 0000000000..18ec1d7311
--- /dev/null
+++ b/doc/supplements/i960/cpumodel.texi
@@ -0,0 +1,79 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node CPU Model Dependent Features, CPU Model Dependent Features Introduction, Preface, Top
+@end ifinfo
+@chapter CPU Model Dependent Features
+@ifinfo
+@menu
+* CPU Model Dependent Features Introduction::
+* CPU Model Dependent Features CPU Model Name::
+* CPU Model Dependent Features Floating Point Unit::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node CPU Model Dependent Features Introduction, CPU Model Dependent Features CPU Model Name, CPU Model Dependent Features, CPU Model Dependent Features
+@end ifinfo
+@section Introduction
+
+Microprocessors are generally classified into
+families with a variety of CPU models or implementations within
+that family. Within a processor family, there is a high level
+of binary compatibility. This family may be based on either an
+architectural specification or on maintaining compatibility with
+a popular processor. Recent microprocessor families such as the
+SPARC or PA-RISC are based on an architectural specification
+which is independent or any particular CPU model or
+implementation. Older families such as the M68xxx and the iX86
+evolved as the manufacturer strived to produce higher
+performance processor models which maintained binary
+compatibility with older models.
+
+RTEMS takes advantage of the similarity of the
+various models within a CPU family. Although the models do vary
+in significant ways, the high level of compatibility makes it
+possible to share the bulk of the CPU dependent executive code
+across the entire family. Each processor family supported by
+RTEMS has a list of features which vary between CPU models
+within a family. For example, the most common model dependent
+feature regardless of CPU family is the presence or absence of a
+floating point unit or coprocessor. When defining the list of
+features present on a particular CPU model, one simply notes
+that floating point hardware is or is not present and defines a
+single constant appropriately. Conditional compilation is
+utilized to include the appropriate source code for this CPU
+model's feature set. It is important to note that this means
+that RTEMS is thus compiled using the appropriate feature set
+and compilation flags optimal for this CPU model used. The
+alternative would be to generate a binary which would execute on
+all family members using only the features which were always
+present.
+
+This chapter presents the set of features which vary
+across i960 implementations and are of importance to RTEMS.
+The set of CPU model feature macros are defined in the file
+c/src/exec/score/cpu/i960/i960.h based upon the particular CPU
+model defined on the compilation command line.
+
+@ifinfo
+@node CPU Model Dependent Features CPU Model Name, CPU Model Dependent Features Floating Point Unit, CPU Model Dependent Features Introduction, CPU Model Dependent Features
+@end ifinfo
+@section CPU Model Name
+
+The macro CPU_MODEL_NAME is a string which designates
+the name of this CPU model. For example, for the Intel i960CA,
+this macro is set to the string "i960ca".
+
+@ifinfo
+@node CPU Model Dependent Features Floating Point Unit, Calling Conventions, CPU Model Dependent Features CPU Model Name, CPU Model Dependent Features
+@end ifinfo
+@section Floating Point Unit
+
+The macro I960_HAS_FPU is set to 1 to indicate that
+this CPU model has a hardware floating point unit and 0
+otherwise.
diff --git a/doc/supplements/i960/cputable.texi b/doc/supplements/i960/cputable.texi
new file mode 100644
index 0000000000..dbeebd5a68
--- /dev/null
+++ b/doc/supplements/i960/cputable.texi
@@ -0,0 +1,130 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Processor Dependent Information Table, Processor Dependent Information Table Introduction, Board Support Packages Processor Initialization, Top
+@end ifinfo
+@chapter Processor Dependent Information Table
+@ifinfo
+@menu
+* Processor Dependent Information Table Introduction::
+* Processor Dependent Information Table CPU Dependent Information Table::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Processor Dependent Information Table Introduction, Processor Dependent Information Table CPU Dependent Information Table, Processor Dependent Information Table, Processor Dependent Information Table
+@end ifinfo
+@section Introduction
+
+Any highly processor dependent information required
+to describe a processor to RTEMS is provided in the CPU
+Dependent Information Table. This table is not required for all
+processors supported by RTEMS. This chapter describes the
+contents, if any, for a particular processor type.
+
+@ifinfo
+@node Processor Dependent Information Table CPU Dependent Information Table, Memory Requirements, Processor Dependent Information Table Introduction, Processor Dependent Information Table
+@end ifinfo
+@section CPU Dependent Information Table
+
+The i960CA version of the RTEMS CPU Dependent
+Information Table contains the information required to interface
+a Board Support Package and RTEMS on the i960CA. This
+information is provided to allow RTEMS to interoperate
+effectively with the BSP. The C structure definition is given
+here:
+
+@example
+struct cpu_configuration_table @{
+ void (*pretasking_hook)( void );
+ void (*predriver_hook)( void );
+ void (*postdriver_hook)( void );
+ void (*idle_task)( void );
+ boolean do_zero_of_workspace;
+ unsigned32 interrupt_stack_size;
+ unsigned32 extra_mpci_receive_server_stack;
+ void (*stack_free_hook)( void* );
+ /* end of fields required on all CPUs */
+
+#if defined(__i960CA__) || defined(__i960_CA__) || defined(__i960CA)
+ i960ca_PRCB *Prcb;
+#endif
+
+@};
+@end example
+
+The contents of the i960CA Processor Control Block
+are discussed in Intel's i960CA User's Manual. Structure
+definitions for the i960CA PRCB and Control Table are provided
+by including the file rtems.h.
+
+@table @code
+@item pretasking_hook
+is the address of the
+user provided routine which is invoked once RTEMS initialization
+is complete but before interrupts and tasking are enabled. This
+field may be NULL to indicate that the hook is not utilized.
+
+@item predriver_hook
+is the address of the user provided
+routine which is invoked with tasking enabled immediately before
+the MPCI and device drivers are initialized. RTEMS
+initialization is complete, interrupts and tasking are enabled,
+but no device drivers are initialized. This field may be NULL to
+indicate that the hook is not utilized.
+
+@item postdriver_hook
+is the address of the user provided
+routine which is invoked with tasking enabled immediately after
+the MPCI and device drivers are initialized. RTEMS
+initialization is complete, interrupts and tasking are enabled,
+and the device drivers are initialized. This field may be NULL
+to indicate that the hook is not utilized.
+
+@item idle_task
+is the address of the optional user
+provided routine which is used as the system's IDLE task. If
+this field is not NULL, then the RTEMS default IDLE task is not
+used. This field may be NULL to indicate that the default IDLE
+is to be used.
+
+@item do_zero_of_workspace
+indicates whether RTEMS should
+zero the Workspace as part of its initialization. If set to
+TRUE, the Workspace is zeroed. Otherwise, it is not.
+
+@item interrupt_stack_size
+is the size of the RTEMS
+allocated interrupt stack in bytes. This value must be at least
+as large as MINIMUM_STACK_SIZE.
+
+@item extra_mpci_receive_server_stack
+is the extra stack space allocated for the RTEMS MPCI receive server task
+in bytes. The MPCI receive server may invoke nearly all directives and
+may require extra stack space on some targets.
+
+@item stack_allocate_hook
+is the address of the optional user provided routine which allocates
+memory for task stacks. If this hook is not NULL, then a stack_free_hook
+must be provided as well.
+
+@item stack_free_hook
+is the address of the optional user provided routine which frees
+memory for task stacks. If this hook is not NULL, then a stack_allocate_hook
+must be provided as well.
+
+@item Prcb
+is the base address of the i960CA's Processor
+Control Block. It is primarily used by RTEMS to install
+interrupt handlers.
+@end table
+
+
+
+
+
+
diff --git a/doc/supplements/i960/fatalerr.texi b/doc/supplements/i960/fatalerr.texi
new file mode 100644
index 0000000000..6ce95fe669
--- /dev/null
+++ b/doc/supplements/i960/fatalerr.texi
@@ -0,0 +1,43 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Default Fatal Error Processing, Default Fatal Error Processing Introduction, Interrupt Processing Interrupt Stack, Top
+@end ifinfo
+@chapter Default Fatal Error Processing
+@ifinfo
+@menu
+* Default Fatal Error Processing Introduction::
+* Default Fatal Error Processing Default Fatal Error Handler Operations::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Default Fatal Error Processing Introduction, Default Fatal Error Processing Default Fatal Error Handler Operations, Default Fatal Error Processing, Default Fatal Error Processing
+@end ifinfo
+@section Introduction
+
+Upon detection of a fatal error by either the
+application or RTEMS the fatal error manager is invoked. The
+fatal error manager will invoke the user-supplied fatal error
+handlers. If no user-supplied handlers is configured, the
+RTEMS provided default fatal error handler is invoked. If the
+user-supplied fatal error handlers return to the executive the
+default fatal error handler is then invoked. This chapter
+describes the precise operations of the default fatal error
+handler.
+
+@ifinfo
+@node Default Fatal Error Processing Default Fatal Error Handler Operations, Board Support Packages, Default Fatal Error Processing Introduction, Default Fatal Error Processing
+@end ifinfo
+@section Default Fatal Error Handler Operations
+
+The default fatal error handler which is invoked by
+the fatal_error_occurred directive when there is no user handler
+configured or the user handler returns control to RTEMS. The
+default fatal error handler disables processor interrupts to
+level 31, places the error code in G0, and executes a branch to
+self instruction to simulate a halt processor instruction.
diff --git a/doc/supplements/i960/intr.t b/doc/supplements/i960/intr.t
new file mode 100644
index 0000000000..45b80fead9
--- /dev/null
+++ b/doc/supplements/i960/intr.t
@@ -0,0 +1,220 @@
+@ifinfo
+@node Interrupt Processing, Interrupt Processing Introduction, Memory Model Flat Memory Model, Top
+@end ifinfo
+@chapter Interrupt Processing
+@ifinfo
+@menu
+* Interrupt Processing Introduction::
+* Interrupt Processing Vectoring of Interrupt Handler::
+* Interrupt Processing Interrupt Record::
+* Interrupt Processing Interrupt Levels::
+* Interrupt Processing Disabling of Interrupts by RTEMS::
+* Interrupt Processing Register Cache Flushing::
+* Interrupt Processing Interrupt Stack::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Interrupt Processing Introduction, Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing, Interrupt Processing
+@end ifinfo
+@section Introduction
+
+Different types of processors respond to the
+occurrence of an interrupt in its own unique fashion. In
+addition, each processor type provides a control mechanism to
+allow the proper handling of an interrupt. The processor
+dependent response to the interrupt which modifies the execution
+state and results in the modification of the execution stream.
+This modification usually requires that an interrupt handler
+utilize the provided control mechanisms to return to the normal
+processing stream. Although RTEMS hides many of the processor
+dependent details of interrupt processing, it is important to
+understand how the RTEMS interrupt manager is mapped onto the
+processor's unique architecture. Discussed in this chapter are
+the the processor's response and control mechanisms as they
+pertain to RTEMS.
+
+@ifinfo
+@node Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing Interrupt Record, Interrupt Processing Introduction, Interrupt Processing
+@end ifinfo
+@section Vectoring of Interrupt Handler
+
+Upon receipt of an interrupt the i960CA
+automatically performs the following actions:
+
+@itemize @bullet
+@item saves the local register set,
+
+@item sets the Frame Pointer (FP) to point to the interrupt
+stack,
+
+@item increments the FP by sixteen (16) to make room for the
+Interrupt Record,
+
+@item saves the current values of the arithmetic-controls (AC)
+register, the process-controls (PC) register, and the interrupt
+vector number are saved in the Interrupt Record,
+
+@item the CPU sets the Instruction Pointer (IP) to the address
+of the first instruction in the interrupt handler,
+
+@item the return-status field of the Previous Frame Pointer
+(PFP or R0) register is set to interrupt return,
+
+@item sets the PC state bit to interrupted,
+
+@item sets the current interrupt disable level in the PC to
+the level of the current interrupt, and
+
+@item disables tracing.
+@end itemize
+
+A nested interrupt is processed similarly by the
+i960CA with the exception that the Frame Pointer (FP) already
+points to the interrupt stack. This means that the FP is NOT
+overwritten before space for the Interrupt Record is allocated.
+
+The state flag bit of the saved PC register in the
+Interrupt Record is examined by RTEMS to determine when an outer
+most interrupt is being exited. Therefore, the user application
+code MUST NOT modify this bit.
+
+@ifinfo
+@node Interrupt Processing Interrupt Record, Interrupt Processing Interrupt Levels, Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing
+@end ifinfo
+@section Interrupt Record
+
+The structure of the Interrupt Record for the i960CA
+which is placed on the interrupt stack by the processor in
+response to an interrupt is as follows:
+
+@ifset use-ascii
+@example
+@group
+ +---------------------------+
+ | Saved Process Controls | NFP-16
+ +---------------------------+
+ | Saved Arithmetic Controls | NFP-12
+ +---------------------------+
+ | UNUSED | NFP-8
+ +---------------------------+
+ | UNUSED | NFP-4
+ +---------------------------+
+@end group
+@end example
+@end ifset
+
+@ifset use-tex
+@sp 1
+@tex
+\centerline{\vbox{\offinterlineskip\halign{
+\strut\vrule#&
+\hbox to 2.00in{\enskip\hfil#\hfil}&
+\vrule#&
+\hbox to 1.00in{\enskip\hfil#\hfil}
+\cr
+\multispan{3}\hrulefill\cr
+& Saved Process Controls && NFP-16\cr
+\multispan{3}\hrulefill\cr
+& Saved Arithmetic Controls && NFP-12\cr
+\multispan{3}\hrulefill\cr
+& UNUSED && NFP-8\cr
+\multispan{3}\hrulefill\cr
+& UNUSED && NFP-4\cr
+\multispan{3}\hrulefill\cr
+}}\hfil}
+@end tex
+@end ifset
+
+@ifset use-html
+@html
+<CENTER>
+ <TABLE COLS=2 WIDTH="40%" BORDER=2>
+<TR><TD ALIGN=center><STRONG>Saved Process Controls</STRONG></TD>
+ <TD ALIGN=center>NFP-16</TD></TR>
+<TR><TD ALIGN=center><STRONG>Saved Arithmetic Controls</STRONG></TD>
+ <TD ALIGN=center>NFP-12</TD></TR>
+<TR><TD ALIGN=center><STRONG>UNUSED</STRONG></TD>
+ <TD ALIGN=center>NFP-8</TD></TR>
+<TR><TD ALIGN=center><STRONG>UNUSED</STRONG></TD>
+ <TD ALIGN=center>NFP-4</TD></TR>
+ </TABLE>
+</CENTER>
+@end html
+@end ifset
+
+@ifinfo
+@node Interrupt Processing Interrupt Levels, Interrupt Processing Disabling of Interrupts by RTEMS, Interrupt Processing Interrupt Record, Interrupt Processing
+@end ifinfo
+@section Interrupt Levels
+
+Thirty-two levels (0-31) of interrupt priorities are
+supported by the i960CA microprocessor with level thirty-one
+(31) being the highest priority. Level zero (0) indicates that
+interrupts are fully enabled. Interrupt requests for interrupts
+with priorities less than or equal to the current interrupt mask
+level are ignored.
+
+Although RTEMS supports 256 interrupt levels, the
+i960CA only supports thirty-two. RTEMS interrupt levels 0
+through 31 directly correspond to i960CA interrupt levels. All
+other RTEMS interrupt levels are undefined and their behavior is
+unpredictable.
+
+@ifinfo
+@node Interrupt Processing Disabling of Interrupts by RTEMS, Interrupt Processing Register Cache Flushing, Interrupt Processing Interrupt Levels, Interrupt Processing
+@end ifinfo
+@section Disabling of Interrupts by RTEMS
+
+During the execution of directive calls, critical
+sections of code may be executed. When these sections are
+encountered, RTEMS disables interrupts to level thirty-one (31)
+before the execution of this section and restores them to the
+previous level upon completion of the section. RTEMS has been
+optimized to insure that interrupts are disabled for less than
+RTEMS_MAXIMUM_DISABLE_PERIOD microseconds on a
+RTEMS_MAXIMUM_DISABLE_PERIOD_MHZ Mhz i960CA with zero wait states.
+These numbers will vary based the number of wait states and
+processor speed present on the target board. [NOTE: This
+calculation was most recently performed for Release
+RTEMS_RELEASE_FOR_MAXIMUM_DISABLE_PERIOD.]
+
+Non-maskable interrupts (NMI) cannot be disabled, and
+ISRs which execute at this level MUST NEVER issue RTEMS system
+calls. If a directive is invoked, unpredictable results may
+occur due to the inability of RTEMS to protect its critical
+sections. However, ISRs that make no system calls may safely
+execute as non-maskable interrupts.
+
+@ifinfo
+@node Interrupt Processing Register Cache Flushing, Interrupt Processing Interrupt Stack, Interrupt Processing Disabling of Interrupts by RTEMS, Interrupt Processing
+@end ifinfo
+@section Register Cache Flushing
+
+The i960CA version of the RTEMS interrupt manager is
+optimized to insure that the flushreg instruction is only
+executed when a context switch is necessary. The flushreg
+instruction flushes the i960CA register set cache and takes (14
++ 23 * number of sets flushed) cycles to execute. As the i960CA
+supports caching of from five to sixteen register sets, this
+instruction takes from 129 to 382 cycles (3.90 to 11.57
+microseconds at 33 Mhz) to execute given no wait state memory.
+RTEMS flushes the register set cache only at the conclusion of
+the outermost ISR when a context switch is necessary. The
+register set cache will not be flushed as part of processing a
+nested interrupt or when a context switch is not necessary.
+This optimization is essential to providing high-performance
+interrupt management on the i960CA.
+
+@ifinfo
+@node Interrupt Processing Interrupt Stack, Default Fatal Error Processing, Interrupt Processing Register Cache Flushing, Interrupt Processing
+@end ifinfo
+@section Interrupt Stack
+
+On the i960CA, RTEMS allocates the interrupt stack
+from the Workspace Area. The amount of memory allocated for the
+interrupt stack is determined by the interrupt_stack_size field
+in the CPU Configuration Table. During the initialization
+process, RTEMS will install its interrupt stack.
+
+
diff --git a/doc/supplements/i960/memmodel.texi b/doc/supplements/i960/memmodel.texi
new file mode 100644
index 0000000000..ce057bc94c
--- /dev/null
+++ b/doc/supplements/i960/memmodel.texi
@@ -0,0 +1,53 @@
+@c
+@c COPYRIGHT (c) 1988-1997.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Memory Model, Memory Model Introduction, Calling Conventions Leaf Procedures, Top
+@end ifinfo
+@chapter Memory Model
+@ifinfo
+@menu
+* Memory Model Introduction::
+* Memory Model Flat Memory Model::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Memory Model Introduction, Memory Model Flat Memory Model, Memory Model, Memory Model
+@end ifinfo
+@section Introduction
+
+A processor may support any combination of memory
+models ranging from pure physical addressing to complex demand
+paged virtual memory systems. RTEMS supports a flat memory
+model which ranges contiguously over the processor's allowable
+address space. RTEMS does not support segmentation or virtual
+memory of any kind. The appropriate memory model for RTEMS
+provided by the targeted processor and related characteristics
+of that model are described in this chapter.
+
+@ifinfo
+@node Memory Model Flat Memory Model, Interrupt Processing, Memory Model Introduction, Memory Model
+@end ifinfo
+@section Flat Memory Model
+
+The i960CA supports a flat 32-bit address space with
+addresses ranging from 0x00000000 to 0xFFFFFFFF (4 gigabytes).
+Although the i960CA reserves portions of this address space,
+application code and data may be placed in any non-reserved
+areas. Each address is represented by a 32-bit value and is
+byte addressable. The address may be used to reference a single
+byte, half-word (2-bytes), word (4 bytes), double-word (8
+bytes), triple-word (12 bytes) or quad-word (16 bytes). The
+i960CA does not support virtual memory or segmentation.
+
+The i960CA allows the memory space to be partitioned
+into sixteen regions which may be configured individually as big
+or little endian. RTEMS assumes that the memory regions in
+which its code, data, and the RTEMS Workspace reside are
+configured as little endian.
+
+
diff --git a/doc/supplements/i960/timedata.t b/doc/supplements/i960/timedata.t
new file mode 100644
index 0000000000..e8dd9736b1
--- /dev/null
+++ b/doc/supplements/i960/timedata.t
@@ -0,0 +1,123 @@
+@include ../common/timemac.texi
+@tex
+\global\advance \smallskipamount by -4pt
+@end tex
+
+@ifinfo
+@node i960CA Timing Data, i960CA Timing Data Introduction, Memory Requirements RTEMS RAM Workspace Worksheet, Top
+@end ifinfo
+@chapter Timing Data
+@ifinfo
+@menu
+* i960CA Timing Data Introduction::
+* i960CA Timing Data Hardware Platform::
+* i960CA Timing Data Interrupt Latency::
+* i960CA Timing Data Context Switch::
+* i960CA Timing Data Directive Times::
+* i960CA Timing Data Task Manager::
+* i960CA Timing Data Interrupt Manager::
+* i960CA Timing Data Clock Manager::
+* i960CA Timing Data Timer Manager::
+* i960CA Timing Data Semaphore Manager::
+* i960CA Timing Data Message Manager::
+* i960CA Timing Data Event Manager::
+* i960CA Timing Data Signal Manager::
+* i960CA Timing Data Partition Manager::
+* i960CA Timing Data Region Manager::
+* i960CA Timing Data Dual-Ported Memory Manager::
+* i960CA Timing Data I/O Manager::
+* i960CA Timing Data Rate Monotonic Manager::
+@end menu
+@end ifinfo
+
+NOTE: The i960CA board used by the RTEMS Project to
+obtain i960CA times is currently broken. The information in
+this chapter was obtained using Release 3.2.1.
+
+@ifinfo
+@node i960CA Timing Data Introduction, i960CA Timing Data Hardware Platform, i960CA Timing Data, i960CA Timing Data
+@end ifinfo
+@section Introduction
+
+The timing data for the i960CA version of RTEMS is
+provided along with the target dependent aspects concerning the
+gathering of the timing data. The hardware platform used to
+gather the times is described to give the reader a better
+understanding of each directive time provided. Also, provided
+is a description of the interrupt latency and the context
+switch times as they pertain to the i960CA version of RTEMS.
+
+@ifinfo
+@node i960CA Timing Data Hardware Platform, i960CA Timing Data Interrupt Latency, i960CA Timing Data Introduction, i960CA Timing Data
+@end ifinfo
+@section Hardware Platform
+
+All times reported except for the maximum period
+interrupts are disabled by RTEMS were measured using a Cyclone
+Microsystems CVME961 board. The CVME961 is a 33 Mhz board with
+dynamic RAM which has two wait state dynamic memory (four CPU
+cycles) for read accesses and one wait state (two CPU cycles)
+for write accesses. The Z8536 on a SQUALL SQSIO4 mezzanine
+board was used to measure elapsed time with one-half microsecond
+resolution. All sources of hardware interrupts are disabled,
+although the interrupt level of the i960CA allows all interrupts.
+
+The maximum interrupt disable period was measured by
+summing the number of CPU cycles required by each assembly
+language instruction executed while interrupts were disabled.
+Zero wait state memory was assumed. The total CPU cycles
+executed with interrupts disabled, including the instructions to
+disable and enable interrupts, was divided by 33 to simulate a
+i960CA executing at 33 Mhz with zero wait states.
+
+@ifinfo
+@node i960CA Timing Data Interrupt Latency, i960CA Timing Data Context Switch, i960CA Timing Data Hardware Platform, i960CA Timing Data
+@end ifinfo
+@section Interrupt Latency
+
+The maximum period with interrupts disabled within
+RTEMS is less than
+RTEMS_MAXIMUM_DISABLE_PERIOD microseconds including the instructions
+which disable and re-enable interrupts. The time required for
+the i960CA to generate an interrupt using the sysctl
+instruction, vectoring to an interrupt handler, and for the
+RTEMS entry overhead before invoking the user's interrupt
+handler are a total of RTEMS_INTR_ENTRY_RETURNS_TO_PREEMPTING_TASK
+microseconds. These combine to yield
+a worst case interrupt latency of less than
+RTEMS_MAXIMUM_DISABLE_PERIOD + RTEMS_INTR_ENTRY_RETURNS_TO_PREEMPTING_TASK
+microseconds. [NOTE: The maximum period with interrupts
+disabled within RTEMS was last calculated for Release
+RTEMS_RELEASE_FOR_MAXIMUM_DISABLE_PERIOD.]
+
+It should be noted again that the maximum period with
+interrupts disabled within RTEMS is hand-timed. The interrupt
+vector and entry overhead time was generated on the Cyclone
+CVME961 benchmark platform using the sysctl instruction as the
+interrupt source.
+
+@ifinfo
+@node i960CA Timing Data Context Switch, i960CA Timing Data Directive Times, i960CA Timing Data Interrupt Latency, i960CA Timing Data
+@end ifinfo
+@section Context Switch
+
+The RTEMS processor context switch time is RTEMS_NO_FP_CONTEXTS
+microseconds on the Cyclone CVME961 benchmark platform. This
+time represents the raw context switch time with no user
+extensions configured. Additional execution time is required
+when a TSWITCH user extension is configured. The use of the
+TSWITCH extension is application dependent. Thus, its execution
+time is not considered part of the base context switch time.
+
+The i960CA has no hardware floating point capability
+and floating point tasks are not supported.
+
+The following table summarizes the context switch
+times for the CVME961 benchmark platform:
+
+@include timetbl.texi
+
+@tex
+\global\advance \smallskipamount by 4pt
+@end tex
+
diff --git a/doc/supplements/m68k/timedata.t b/doc/supplements/m68k/timedata.t
index 74b64bd088..fe99c38fef 100644
--- a/doc/supplements/m68k/timedata.t
+++ b/doc/supplements/m68k/timedata.t
@@ -1,45 +1,38 @@
-@c
-@c COPYRIGHT (c) 1988-1998.
-@c On-Line Applications Research Corporation (OAR).
-@c All rights reserved.
-@c
-@c $Id$
-@c
-
-@include ../../common/timemac.texi
+
+@include ../common/timemac.texi
@tex
\global\advance \smallskipamount by -4pt
@end tex
@ifinfo
-@node MVME136 Timing Data, MVME136 Timing Data Introduction, Timing Specification Terminology, Top
+@node MC68020 Timing Data, MC68020 Timing Data Introduction, Memory Requirements RTEMS RAM Workspace Worksheet, Top
@end ifinfo
-@chapter MVME136 Timing Data
+@chapter MC68020 Timing Data
@ifinfo
@menu
-* MVME136 Timing Data Introduction::
-* MVME136 Timing Data Hardware Platform::
-* MVME136 Timing Data Interrupt Latency::
-* MVME136 Timing Data Context Switch::
-* MVME136 Timing Data Directive Times::
-* MVME136 Timing Data Task Manager::
-* MVME136 Timing Data Interrupt Manager::
-* MVME136 Timing Data Clock Manager::
-* MVME136 Timing Data Timer Manager::
-* MVME136 Timing Data Semaphore Manager::
-* MVME136 Timing Data Message Manager::
-* MVME136 Timing Data Event Manager::
-* MVME136 Timing Data Signal Manager::
-* MVME136 Timing Data Partition Manager::
-* MVME136 Timing Data Region Manager::
-* MVME136 Timing Data Dual-Ported Memory Manager::
-* MVME136 Timing Data I/O Manager::
-* MVME136 Timing Data Rate Monotonic Manager::
+* MC68020 Timing Data Introduction::
+* MC68020 Timing Data Hardware Platform::
+* MC68020 Timing Data Interrupt Latency::
+* MC68020 Timing Data Context Switch::
+* MC68020 Timing Data Directive Times::
+* MC68020 Timing Data Task Manager::
+* MC68020 Timing Data Interrupt Manager::
+* MC68020 Timing Data Clock Manager::
+* MC68020 Timing Data Timer Manager::
+* MC68020 Timing Data Semaphore Manager::
+* MC68020 Timing Data Message Manager::
+* MC68020 Timing Data Event Manager::
+* MC68020 Timing Data Signal Manager::
+* MC68020 Timing Data Partition Manager::
+* MC68020 Timing Data Region Manager::
+* MC68020 Timing Data Dual-Ported Memory Manager::
+* MC68020 Timing Data I/O Manager::
+* MC68020 Timing Data Rate Monotonic Manager::
@end menu
@end ifinfo
@ifinfo
-@node MVME136 Timing Data Introduction, MVME136 Timing Data Hardware Platform, MVME136 Timing Data, MVME136 Timing Data
+@node MC68020 Timing Data Introduction, MC68020 Timing Data Hardware Platform, MC68020 Timing Data, MC68020 Timing Data
@end ifinfo
@section Introduction
@@ -52,7 +45,7 @@ is a description of the interrupt latency and the context switch
times as they pertain to the MC68020 version of RTEMS.
@ifinfo
-@node MVME136 Timing Data Hardware Platform, MVME136 Timing Data Interrupt Latency, MVME136 Timing Data Introduction, MVME136 Timing Data
+@node MC68020 Timing Data Hardware Platform, MC68020 Timing Data Interrupt Latency, MC68020 Timing Data Introduction, MC68020 Timing Data
@end ifinfo
@section Hardware Platform
@@ -78,7 +71,7 @@ MC68020 assume that the internal cache is disabled and that no
instructions overlap.
@ifinfo
-@node MVME136 Timing Data Interrupt Latency, MVME136 Timing Data Context Switch, MVME136 Timing Data Hardware Platform, MVME136 Timing Data
+@node MC68020 Timing Data Interrupt Latency, MC68020 Timing Data Context Switch, MC68020 Timing Data Hardware Platform, MC68020 Timing Data
@end ifinfo
@section Interrupt Latency
@@ -105,7 +98,7 @@ using the Multiprocessing Communications registers to generate
as the interrupt source.
@ifinfo
-@node MVME136 Timing Data Context Switch, MVME136 Timing Data Directive Times, MVME136 Timing Data Interrupt Latency, MVME136 Timing Data
+@node MC68020 Timing Data Context Switch, MC68020 Timing Data Directive Times, MC68020 Timing Data Interrupt Latency, MC68020 Timing Data
@end ifinfo
@section Context Switch
diff --git a/doc/supplements/sparc/SIS_TIMES b/doc/supplements/sparc/SIS_TIMES
new file mode 100644
index 0000000000..367426562c
--- /dev/null
+++ b/doc/supplements/sparc/SIS_TIMES
@@ -0,0 +1,244 @@
+#
+# SPARC/ERC32/SIS Timing and Size Information
+#
+
+#
+# CPU Model Information
+#
+RTEMS_CPU_MODEL ERC32
+#
+# Interrupt Latency
+#
+# NOTE: In general, the text says it is hand-calculated to be
+# RTEMS_MAXIMUM_DISABLE_PERIOD at RTEMS_MAXIMUM_DISABLE_PERIOD_MHZ
+# Mhz and this was last calculated for Release
+# RTEMS_VERSION_FOR_MAXIMUM_DISABLE_PERIOD.
+#
+RTEMS_MAXIMUM_DISABLE_PERIOD TBD
+RTEMS_MAXIMUM_DISABLE_PERIOD_MHZ 15.0
+RTEMS_RELEASE_FOR_MAXIMUM_DISABLE_PERIOD 3.5.17
+#
+# Context Switch Times
+#
+RTEMS_NO_FP_CONTEXTS 21
+RTEMS_RESTORE_1ST_FP_TASK 26
+RTEMS_SAVE_INIT_RESTORE_INIT 24
+RTEMS_SAVE_IDLE_RESTORE_INIT 23
+RTEMS_SAVE_IDLE_RESTORE_IDLE 33
+#
+# Task Manager Times
+#
+RTEMS_TASK_CREATE_ONLY 59
+RTEMS_TASK_IDENT_ONLY 163
+RTEMS_TASK_START_ONLY 30
+RTEMS_TASK_RESTART_CALLING_TASK 64
+RTEMS_TASK_RESTART_SUSPENDED_RETURNS_TO_CALLER 36
+RTEMS_TASK_RESTART_BLOCKED_RETURNS_TO_CALLER 47
+RTEMS_TASK_RESTART_READY_RETURNS_TO_CALLER 37
+RTEMS_TASK_RESTART_SUSPENDED_PREEMPTS_CALLER 77
+RTEMS_TASK_RESTART_BLOCKED_PREEMPTS_CALLER 84
+RTEMS_TASK_RESTART_READY_PREEMPTS_CALLER 75
+RTEMS_TASK_DELETE_CALLING_TASK 91
+RTEMS_TASK_DELETE_SUSPENDED_TASK 47
+RTEMS_TASK_DELETE_BLOCKED_TASK 50
+RTEMS_TASK_DELETE_READY_TASK 51
+RTEMS_TASK_SUSPEND_CALLING_TASK 56
+RTEMS_TASK_SUSPEND_RETURNS_TO_CALLER 16
+RTEMS_TASK_RESUME_TASK_READIED_RETURNS_TO_CALLER 17
+RTEMS_TASK_RESUME_TASK_READIED_PREEMPTS_CALLER 52
+RTEMS_TASK_SET_PRIORITY_OBTAIN_CURRENT_PRIORITY 10
+RTEMS_TASK_SET_PRIORITY_RETURNS_TO_CALLER 25
+RTEMS_TASK_SET_PRIORITY_PREEMPTS_CALLER 67
+RTEMS_TASK_MODE_OBTAIN_CURRENT_MODE 5
+RTEMS_TASK_MODE_NO_RESCHEDULE 6
+RTEMS_TASK_MODE_RESCHEDULE_RETURNS_TO_CALLER 9
+RTEMS_TASK_MODE_RESCHEDULE_PREEMPTS_CALLER 42
+RTEMS_TASK_GET_NOTE_ONLY 10
+RTEMS_TASK_SET_NOTE_ONLY 10
+RTEMS_TASK_WAKE_AFTER_YIELD_RETURNS_TO_CALLER 6
+RTEMS_TASK_WAKE_AFTER_YIELD_PREEMPTS_CALLER 49
+RTEMS_TASK_WAKE_WHEN_ONLY 75
+#
+# Interrupt Manager
+#
+RTEMS_INTR_ENTRY_RETURNS_TO_NESTED 7
+RTEMS_INTR_ENTRY_RETURNS_TO_INTERRUPTED_TASK 8
+RTEMS_INTR_ENTRY_RETURNS_TO_PREEMPTING_TASK 8
+RTEMS_INTR_EXIT_RETURNS_TO_NESTED 5
+RTEMS_INTR_EXIT_RETURNS_TO_INTERRUPTED_TASK 7
+RTEMS_INTR_EXIT_RETURNS_TO_PREEMPTING_TASK 14
+#
+# Clock Manager
+#
+RTEMS_CLOCK_SET_ONLY 33
+RTEMS_CLOCK_GET_ONLY 4
+RTEMS_CLOCK_TICK_ONLY 6
+#
+# Timer Manager
+#
+RTEMS_TIMER_CREATE_ONLY 11
+RTEMS_TIMER_IDENT_ONLY 159
+RTEMS_TIMER_DELETE_INACTIVE 15
+RTEMS_TIMER_DELETE_ACTIVE 17
+RTEMS_TIMER_FIRE_AFTER_INACTIVE 21
+RTEMS_TIMER_FIRE_AFTER_ACTIVE 23
+RTEMS_TIMER_FIRE_WHEN_INACTIVE 34
+RTEMS_TIMER_FIRE_WHEN_ACTIVE 34
+RTEMS_TIMER_RESET_INACTIVE 20
+RTEMS_TIMER_RESET_ACTIVE 22
+RTEMS_TIMER_CANCEL_INACTIVE 10
+RTEMS_TIMER_CANCEL_ACTIVE 13
+#
+# Semaphore Manager
+#
+RTEMS_SEMAPHORE_CREATE_ONLY 19
+RTEMS_SEMAPHORE_IDENT_ONLY 171
+RTEMS_SEMAPHORE_DELETE_ONLY 19
+RTEMS_SEMAPHORE_OBTAIN_AVAILABLE 12
+RTEMS_SEMAPHORE_OBTAIN_NOT_AVAILABLE_NO_WAIT 12
+RTEMS_SEMAPHORE_OBTAIN_NOT_AVAILABLE_CALLER_BLOCKS 67
+RTEMS_SEMAPHORE_RELEASE_NO_WAITING_TASKS 14
+RTEMS_SEMAPHORE_RELEASE_TASK_READIED_RETURNS_TO_CALLER 23
+RTEMS_SEMAPHORE_RELEASE_TASK_READIED_PREEMPTS_CALLER 57
+#
+# Message Manager
+#
+RTEMS_MESSAGE_QUEUE_CREATE_ONLY 114
+RTEMS_MESSAGE_QUEUE_IDENT_ONLY 159
+RTEMS_MESSAGE_QUEUE_DELETE_ONLY 25
+RTEMS_MESSAGE_QUEUE_SEND_NO_WAITING_TASKS 36
+RTEMS_MESSAGE_QUEUE_SEND_TASK_READIED_RETURNS_TO_CALLER 38
+RTEMS_MESSAGE_QUEUE_SEND_TASK_READIED_PREEMPTS_CALLER 76
+RTEMS_MESSAGE_QUEUE_URGENT_NO_WAITING_TASKS 36
+RTEMS_MESSAGE_QUEUE_URGENT_TASK_READIED_RETURNS_TO_CALLER 38
+RTEMS_MESSAGE_QUEUE_URGENT_TASK_READIED_PREEMPTS_CALLER 76
+RTEMS_MESSAGE_QUEUE_BROADCAST_NO_WAITING_TASKS 15
+RTEMS_MESSAGE_QUEUE_BROADCAST_TASK_READIED_RETURNS_TO_CALLER 42
+RTEMS_MESSAGE_QUEUE_BROADCAST_TASK_READIED_PREEMPTS_CALLER 83
+RTEMS_MESSAGE_QUEUE_RECEIVE_AVAILABLE 30
+RTEMS_MESSAGE_QUEUE_RECEIVE_NOT_AVAILABLE_NO_WAIT 13
+RTEMS_MESSAGE_QUEUE_RECEIVE_NOT_AVAILABLE_CALLER_BLOCKS 67
+RTEMS_MESSAGE_QUEUE_FLUSH_NO_MESSAGES_FLUSHED 9
+RTEMS_MESSAGE_QUEUE_FLUSH_MESSAGES_FLUSHED 13
+#
+# Event Manager
+#
+RTEMS_EVENT_SEND_NO_TASK_READIED 9
+RTEMS_EVENT_SEND_TASK_READIED_RETURNS_TO_CALLER 22
+RTEMS_EVENT_SEND_TASK_READIED_PREEMPTS_CALLER 58
+RTEMS_EVENT_RECEIVE_OBTAIN_CURRENT_EVENTS 1
+RTEMS_EVENT_RECEIVE_AVAILABLE 10
+RTEMS_EVENT_RECEIVE_NOT_AVAILABLE_NO_WAIT 9
+RTEMS_EVENT_RECEIVE_NOT_AVAILABLE_CALLER_BLOCKS 60
+#
+# Signal Manager
+#
+RTEMS_SIGNAL_CATCH_ONLY 6
+RTEMS_SIGNAL_SEND_RETURNS_TO_CALLER 14
+RTEMS_SIGNAL_SEND_SIGNAL_TO_SELF 22
+RTEMS_SIGNAL_EXIT_ASR_OVERHEAD_RETURNS_TO_CALLING_TASK 27
+RTEMS_SIGNAL_EXIT_ASR_OVERHEAD_RETURNS_TO_PREEMPTING_TASK 56
+#
+# Partition Manager
+#
+RTEMS_PARTITION_CREATE_ONLY 34
+RTEMS_PARTITION_IDENT_ONLY 159
+RTEMS_PARTITION_DELETE_ONLY 14
+RTEMS_PARTITION_GET_BUFFER_AVAILABLE 12
+RTEMS_PARTITION_GET_BUFFER_NOT_AVAILABLE 10
+RTEMS_PARTITION_RETURN_BUFFER_ONLY 16
+#
+# Region Manager
+#
+RTEMS_REGION_CREATE_ONLY 22
+RTEMS_REGION_IDENT_ONLY 162
+RTEMS_REGION_DELETE_ONLY 14
+RTEMS_REGION_GET_SEGMENT_AVAILABLE 19
+RTEMS_REGION_GET_SEGMENT_NOT_AVAILABLE_NO_WAIT 19
+RTEMS_REGION_GET_SEGMENT_NOT_AVAILABLE_CALLER_BLOCKS 67
+RTEMS_REGION_RETURN_SEGMENT_NO_WAITING_TASKS 17
+RTEMS_REGION_RETURN_SEGMENT_TASK_READIED_RETURNS_TO_CALLER 44
+RTEMS_REGION_RETURN_SEGMENT_TASK_READIED_PREEMPTS_CALLER 77
+#
+# Dual-Ported Memory Manager
+#
+RTEMS_PORT_CREATE_ONLY 14
+RTEMS_PORT_IDENT_ONLY 159
+RTEMS_PORT_DELETE_ONLY 13
+RTEMS_PORT_INTERNAL_TO_EXTERNAL_ONLY 9
+RTEMS_PORT_EXTERNAL_TO_INTERNAL_ONLY 9
+#
+# IO Manager
+#
+RTEMS_IO_INITIALIZE_ONLY 2
+RTEMS_IO_OPEN_ONLY 1
+RTEMS_IO_CLOSE_ONLY 1
+RTEMS_IO_READ_ONLY 1
+RTEMS_IO_WRITE_ONLY 1
+RTEMS_IO_CONTROL_ONLY 1
+#
+# Rate Monotonic Manager
+#
+RTEMS_RATE_MONOTONIC_CREATE_ONLY 12
+RTEMS_RATE_MONOTONIC_IDENT_ONLY 159
+RTEMS_RATE_MONOTONIC_CANCEL_ONLY 14
+RTEMS_RATE_MONOTONIC_DELETE_ACTIVE 19
+RTEMS_RATE_MONOTONIC_DELETE_INACTIVE 16
+RTEMS_RATE_MONOTONIC_PERIOD_INITIATE_PERIOD_RETURNS_TO_CALLER 20
+RTEMS_RATE_MONOTONIC_PERIOD_CONCLUDE_PERIOD_CALLER_BLOCKS 55
+RTEMS_RATE_MONOTONIC_PERIOD_OBTAIN_STATUS 9
+#
+# Size Information
+#
+#
+# xxx alloted for numbers
+#
+RTEMS_DATA_SPACE 9059
+RTEMS_MINIMUM_CONFIGURATION 28,288
+RTEMS_MAXIMUM_CONFIGURATION 50,432
+# x,xxx alloted for numbers
+RTEMS_CORE_CODE_SIZE 20,336
+RTEMS_INITIALIZATION_CODE_SIZE 1,408
+RTEMS_TASK_CODE_SIZE 4,496
+RTEMS_INTERRUPT_CODE_SIZE 72
+RTEMS_CLOCK_CODE_SIZE 576
+RTEMS_TIMER_CODE_SIZE 1,336
+RTEMS_SEMAPHORE_CODE_SIZE 1,888
+RTEMS_MESSAGE_CODE_SIZE 2,032
+RTEMS_EVENT_CODE_SIZE 1,696
+RTEMS_SIGNAL_CODE_SIZE 664
+RTEMS_PARTITION_CODE_SIZE 1,368
+RTEMS_REGION_CODE_SIZE 1,736
+RTEMS_DPMEM_CODE_SIZE 872
+RTEMS_IO_CODE_SIZE 1,144
+RTEMS_FATAL_ERROR_CODE_SIZE 32
+RTEMS_RATE_MONOTONIC_CODE_SIZE 1,656
+RTEMS_MULTIPROCESSING_CODE_SIZE 8,328
+# xxx alloted for numbers
+RTEMS_TIMER_CODE_OPTSIZE 208
+RTEMS_SEMAPHORE_CODE_OPTSIZE 192
+RTEMS_MESSAGE_CODE_OPTSIZE 320
+RTEMS_EVENT_CODE_OPTSIZE 64
+RTEMS_SIGNAL_CODE_OPTSIZE 64
+RTEMS_PARTITION_CODE_OPTSIZE 152
+RTEMS_REGION_CODE_OPTSIZE 176
+RTEMS_DPMEM_CODE_OPTSIZE 152
+RTEMS_IO_CODE_OPTSIZE 00
+RTEMS_RATE_MONOTONIC_CODE_OPTSIZE 208
+RTEMS_MULTIPROCESSING_CODE_OPTSIZE 408
+# xxx alloted for numbers
+RTEMS_BYTES_PER_TASK 488
+RTEMS_BYTES_PER_TIMER 68
+RTEMS_BYTES_PER_SEMAPHORE 124
+RTEMS_BYTES_PER_MESSAGE_QUEUE 148
+RTEMS_BYTES_PER_REGION 144
+RTEMS_BYTES_PER_PARTITION 56
+RTEMS_BYTES_PER_PORT 36
+RTEMS_BYTES_PER_PERIOD 36
+RTEMS_BYTES_PER_EXTENSION 64
+RTEMS_BYTES_PER_FP_TASK 136
+RTEMS_BYTES_PER_NODE 48
+RTEMS_BYTES_PER_GLOBAL_OBJECT 20
+RTEMS_BYTES_PER_PROXY 124
+# x,xxx alloted for numbers
+RTEMS_BYTES_OF_FIXED_SYSTEM_REQUIREMENTS 10,072
diff --git a/doc/supplements/sparc/bsp.texi b/doc/supplements/sparc/bsp.texi
new file mode 100644
index 0000000000..78ffa3ac26
--- /dev/null
+++ b/doc/supplements/sparc/bsp.texi
@@ -0,0 +1,103 @@
+@c
+@c COPYRIGHT (c) 1988-1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Board Support Packages, Board Support Packages Introduction, Default Fatal Error Processing Default Fatal Error Handler Operations, Top
+@end ifinfo
+@chapter Board Support Packages
+@ifinfo
+@menu
+* Board Support Packages Introduction::
+* Board Support Packages System Reset::
+* Board Support Packages Processor Initialization::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Board Support Packages Introduction, Board Support Packages System Reset, Board Support Packages, Board Support Packages
+@end ifinfo
+@section Introduction
+
+An RTEMS Board Support Package (BSP) must be designed
+to support a particular processor and target board combination.
+This chapter presents a discussion of SPARC specific BSP issues.
+For more information on developing a BSP, refer to the chapter
+titled Board Support Packages in the RTEMS C Applications User's
+Guide.
+
+@ifinfo
+@node Board Support Packages System Reset, Board Support Packages Processor Initialization, Board Support Packages Introduction, Board Support Packages
+@end ifinfo
+@section System Reset
+
+An RTEMS based application is initiated or
+re-initiated when the SPARC processor is reset. When the SPARC
+is reset, the processor performs the following actions:
+
+@itemize @bullet
+@item the enable trap (ET) of the psr is set to 0 to disable
+traps,
+
+@item the supervisor bit (S) of the psr is set to 1 to enter
+supervisor mode, and
+
+@item the PC is set 0 and the nPC is set to 4.
+@end itemize
+
+The processor then begins to execute the code at
+location 0. It is important to note that all fields in the psr
+are not explicitly set by the above steps and all other
+registers retain their value from the previous execution mode.
+This is true even of the Trap Base Register (TBR) whose contents
+reflect the last trap which occurred before the reset.
+
+@ifinfo
+@node Board Support Packages Processor Initialization, Processor Dependent Information Table, Board Support Packages System Reset, Board Support Packages
+@end ifinfo
+@section Processor Initialization
+
+It is the responsibility of the application's
+initialization code to initialize the TBR and install trap
+handlers for at least the register window overflow and register
+window underflow conditions. Traps should be enabled before
+invoking any subroutines to allow for register window
+management. However, interrupts should be disabled by setting
+the Processor Interrupt Level (pil) field of the psr to 15.
+RTEMS installs it's own Trap Table as part of initialization
+which is initialized with the contents of the Trap Table in
+place when the rtems_initialize_executive directive was invoked.
+Upon completion of executive initialization, interrupts are
+enabled.
+
+If this SPARC implementation supports on-chip caching
+and this is to be utilized, then it should be enabled during the
+reset application initialization code.
+
+In addition to the requirements described in the
+Board Support Packages chapter of the C Applications User's
+Manual for the reset code which is executed before the call to
+rtems_initialize executive, the SPARC version has the following
+specific requirements:
+
+@itemize @bullet
+@item Must leave the S bit of the status register set so that
+the SPARC remains in the supervisor state.
+
+@item Must set stack pointer (sp) such that a minimum stack
+size of MINIMUM_STACK_SIZE bytes is provided for the
+rtems_initialize executive directive.
+
+@item Must disable all external interrupts (i.e. set the pil
+to 15).
+
+@item Must enable traps so window overflow and underflow
+conditions can be properly handled.
+
+@item Must initialize the SPARC's initial trap table with at
+least trap handlers for register window overflow and register
+window underflow.
+@end itemize
+
diff --git a/doc/supplements/sparc/callconv.texi b/doc/supplements/sparc/callconv.texi
new file mode 100644
index 0000000000..fd9b9a5846
--- /dev/null
+++ b/doc/supplements/sparc/callconv.texi
@@ -0,0 +1,445 @@
+@c
+@c COPYRIGHT (c) 1988-1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Calling Conventions, Calling Conventions Introduction, CPU Model Dependent Features CPU Model Implementation Notes, Top
+@end ifinfo
+@chapter Calling Conventions
+@ifinfo
+@menu
+* Calling Conventions Introduction::
+* Calling Conventions Programming Model::
+* Calling Conventions Register Windows::
+* Calling Conventions Call and Return Mechanism::
+* Calling Conventions Calling Mechanism::
+* Calling Conventions Register Usage::
+* Calling Conventions Parameter Passing::
+* Calling Conventions User-Provided Routines::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Calling Conventions Introduction, Calling Conventions Programming Model, Calling Conventions, Calling Conventions
+@end ifinfo
+@section Introduction
+
+Each high-level language compiler generates
+subroutine entry and exit code based upon a set of rules known
+as the compiler's calling convention. These rules address the
+following issues:
+
+@itemize @bullet
+@item register preservation and usage
+
+@item parameter passing
+
+@item call and return mechanism
+@end itemize
+
+A compiler's calling convention is of importance when
+interfacing to subroutines written in another language either
+assembly or high-level. Even when the high-level language and
+target processor are the same, different compilers may use
+different calling conventions. As a result, calling conventions
+are both processor and compiler dependent.
+
+@ifinfo
+@node Calling Conventions Programming Model, Non-Floating Point Registers, Calling Conventions Introduction, Calling Conventions
+@end ifinfo
+@section Programming Model
+@ifinfo
+@menu
+* Non-Floating Point Registers::
+* Floating Point Registers::
+* Special Registers::
+@end menu
+@end ifinfo
+
+This section discusses the programming model for the
+SPARC architecture.
+
+@ifinfo
+@node Non-Floating Point Registers, Floating Point Registers, Calling Conventions Programming Model, Calling Conventions Programming Model
+@end ifinfo
+@subsection Non-Floating Point Registers
+
+The SPARC architecture defines thirty-two
+non-floating point registers directly visible to the programmer.
+These are divided into four sets:
+
+@itemize @bullet
+@item input registers
+
+@item local registers
+
+@item output registers
+
+@item global registers
+@end itemize
+
+Each register is referred to by either two or three
+names in the SPARC reference manuals. First, the registers are
+referred to as r0 through r31 or with the alternate notation
+r[0] through r[31]. Second, each register is a member of one of
+the four sets listed above. Finally, some registers have an
+architecturally defined role in the programming model which
+provides an alternate name. The following table describes the
+mapping between the 32 registers and the register sets:
+
+@ifset use-ascii
+@example
+@group
+ +-----------------+----------------+------------------+
+ | Register Number | Register Names | Description |
+ +-----------------+----------------+------------------+
+ | 0 - 7 | g0 - g7 | Global Registers |
+ +-----------------+----------------+------------------+
+ | 8 - 15 | o0 - o7 | Output Registers |
+ +-----------------+----------------+------------------+
+ | 16 - 23 | l0 - l7 | Local Registers |
+ +-----------------+----------------+------------------+
+ | 24 - 31 | i0 - i7 | Input Registers |
+ +-----------------+----------------+------------------+
+@end group
+@end example
+@end ifset
+
+@ifset use-tex
+@sp 1
+@tex
+\centerline{\vbox{\offinterlineskip\halign{
+\vrule\strut#&
+\hbox to 1.75in{\enskip\hfil#\hfil}&
+\vrule#&
+\hbox to 1.75in{\enskip\hfil#\hfil}&
+\vrule#&
+\hbox to 1.75in{\enskip\hfil#\hfil}&
+\vrule#\cr
+\noalign{\hrule}
+&\bf Register Number &&\bf Register Names&&\bf Description&\cr\noalign{\hrule}
+&0 - 7&&g0 - g7&&Global Registers&\cr\noalign{\hrule}
+&8 - 15&&o0 - o7&&Output Registers&\cr\noalign{\hrule}
+&16 - 23&&l0 - l7&&Local Registers&\cr\noalign{\hrule}
+&24 - 31&&i0 - i7&&Input Registers&\cr\noalign{\hrule}
+}}\hfil}
+@end tex
+@end ifset
+
+@ifset use-html
+@html
+<CENTER>
+ <TABLE COLS=3 WIDTH="80%" BORDER=2>
+<TR><TD ALIGN=center><STRONG>Register Number</STRONG></TD>
+ <TD ALIGN=center><STRONG>Register Names</STRONG></TD>
+ <TD ALIGN=center><STRONG>Description</STRONG></TD>
+<TR><TD ALIGN=center>0 - 7</TD>
+ <TD ALIGN=center>g0 - g7</TD>
+ <TD ALIGN=center>Global Registers</TD></TR>
+<TR><TD ALIGN=center>8 - 15</TD>
+ <TD ALIGN=center>o0 - o7</TD>
+ <TD ALIGN=center>Output Registers</TD></TR>
+<TR><TD ALIGN=center>16 - 23</TD>
+ <TD ALIGN=center>l0 - l7</TD>
+ <TD ALIGN=center>Local Registers</TD></TR>
+<TR><TD ALIGN=center>24 - 31</TD>
+ <TD ALIGN=center>i0 - i7</TD>
+ <TD ALIGN=center>Input Registers</TD></TR>
+ </TABLE>
+</CENTER>
+@end html
+@end ifset
+
+As mentioned above, some of the registers serve
+defined roles in the programming model. The following table
+describes the role of each of these registers:
+
+@ifset use-ascii
+@example
+@group
+ +---------------+----------------+----------------------+
+ | Register Name | Alternate Name | Description |
+ +---------------+----------------+----------------------+
+ | g0 | na | reads return 0 |
+ | | | writes are ignored |
+ +---------------+----------------+----------------------+
+ | o6 | sp | stack pointer |
+ +---------------+----------------+----------------------+
+ | i6 | fp | frame pointer |
+ +---------------+----------------+----------------------+
+ | i7 | na | return address |
+ +---------------+----------------+----------------------+
+@end group
+@end example
+@end ifset
+
+@ifset use-tex
+@sp 1
+@tex
+\centerline{\vbox{\offinterlineskip\halign{
+\vrule\strut#&
+\hbox to 1.75in{\enskip\hfil#\hfil}&
+\vrule#&
+\hbox to 1.75in{\enskip\hfil#\hfil}&
+\vrule#&
+\hbox to 1.75in{\enskip\hfil#\hfil}&
+\vrule#\cr
+\noalign{\hrule}
+&\bf Register Name &&\bf Alternate Names&&\bf Description&\cr\noalign{\hrule}
+&g0&&NA&&reads return 0; &\cr
+&&&&&writes are ignored&\cr\noalign{\hrule}
+&o6&&sp&&stack pointer&\cr\noalign{\hrule}
+&i6&&fp&&frame pointer&\cr\noalign{\hrule}
+&i7&&NA&&return address&\cr\noalign{\hrule}
+}}\hfil}
+@end tex
+@end ifset
+
+@ifset use-html
+@html
+<CENTER>
+ <TABLE COLS=3 WIDTH="80%" BORDER=2>
+<TR><TD ALIGN=center><STRONG>Register Name</STRONG></TD>
+ <TD ALIGN=center><STRONG>Alternate Name</STRONG></TD>
+ <TD ALIGN=center><STRONG>Description</STRONG></TD></TR>
+<TR><TD ALIGN=center>g0</TD>
+ <TD ALIGN=center>NA</TD>
+ <TD ALIGN=center>reads return 0 ; writes are ignored</TD></TR>
+<TR><TD ALIGN=center>o6</TD>
+ <TD ALIGN=center>sp</TD>
+ <TD ALIGN=center>stack pointer</TD></TR>
+<TR><TD ALIGN=center>i6</TD>
+ <TD ALIGN=center>fp</TD>
+ <TD ALIGN=center>frame pointer</TD></TR>
+<TR><TD ALIGN=center>i7</TD>
+ <TD ALIGN=center>NA</TD>
+ <TD ALIGN=center>return address</TD></TR>
+ </TABLE>
+</CENTER>
+@end html
+@end ifset
+
+
+@ifinfo
+@node Floating Point Registers, Special Registers, Non-Floating Point Registers, Calling Conventions Programming Model
+@end ifinfo
+@subsection Floating Point Registers
+
+The SPARC V7 architecture includes thirty-two,
+thirty-two bit registers. These registers may be viewed as
+follows:
+
+@itemize @bullet
+@item 32 single precision floating point or integer registers
+(f0, f1, ... f31)
+
+@item 16 double precision floating point registers (f0, f2,
+f4, ... f30)
+
+@item 8 extended precision floating point registers (f0, f4,
+f8, ... f28)
+@end itemize
+
+The floating point status register (fpsr) specifies
+the behavior of the floating point unit for rounding, contains
+its condition codes, version specification, and trap information.
+
+A queue of the floating point instructions which have
+started execution but not yet completed is maintained. This
+queue is needed to support the multiple cycle nature of floating
+point operations and to aid floating point exception trap
+handlers. Once a floating point exception has been encountered,
+the queue is frozen until it is emptied by the trap handler.
+The floating point queue is loaded by launching instructions.
+It is emptied normally when the floating point completes all
+outstanding instructions and by floating point exception
+handlers with the store double floating point queue (stdfq)
+instruction.
+
+@ifinfo
+@node Special Registers, Calling Conventions Register Windows, Floating Point Registers, Calling Conventions Programming Model
+@end ifinfo
+@subsection Special Registers
+
+The SPARC architecture includes two special registers
+which are critical to the programming model: the Processor State
+Register (psr) and the Window Invalid Mask (wim). The psr
+contains the condition codes, processor interrupt level, trap
+enable bit, supervisor mode and previous supervisor mode bits,
+version information, floating point unit and coprocessor enable
+bits, and the current window pointer (cwp). The cwp field of
+the psr and wim register are used to manage the register windows
+in the SPARC architecture. The register windows are discussed
+in more detail below.
+
+@ifinfo
+@node Calling Conventions Register Windows, Calling Conventions Call and Return Mechanism, Special Registers, Calling Conventions
+@end ifinfo
+@section Register Windows
+
+The SPARC architecture includes the concept of
+register windows. An overly simplistic way to think of these
+windows is to imagine them as being an infinite supply of
+"fresh" register sets available for each subroutine to use. In
+reality, they are much more complicated.
+
+The save instruction is used to obtain a new register
+window. This instruction decrements the current window pointer,
+thus providing a new set of registers for use. This register
+set includes eight fresh local registers for use exclusively by
+this subroutine. When done with a register set, the restore
+instruction increments the current window pointer and the
+previous register set is once again available.
+
+The two primary issues complicating the use of
+register windows are that (1) the set of register windows is
+finite, and (2) some registers are shared between adjacent
+registers windows.
+
+Because the set of register windows is finite, it is
+possible to execute enough save instructions without
+corresponding restore's to consume all of the register windows.
+This is easily accomplished in a high level language because
+each subroutine typically performs a save instruction upon
+entry. Thus having a subroutine call depth greater than the
+number of register windows will result in a window overflow
+condition. The window overflow condition generates a trap which
+must be handled in software. The window overflow trap handler
+is responsible for saving the contents of the oldest register
+window on the program stack.
+
+Similarly, the subroutines will eventually complete
+and begin to perform restore's. If the restore results in the
+need for a register window which has previously been written to
+memory as part of an overflow, then a window underflow condition
+results. Just like the window overflow, the window underflow
+condition must be handled in software by a trap handler. The
+window underflow trap handler is responsible for reloading the
+contents of the register window requested by the restore
+instruction from the program stack.
+
+The Window Invalid Mask (wim) and the Current Window
+Pointer (cwp) field in the psr are used in conjunction to manage
+the finite set of register windows and detect the window
+overflow and underflow conditions. The cwp contains the index
+of the register window currently in use. The save instruction
+decrements the cwp modulo the number of register windows.
+Similarly, the restore instruction increments the cwp modulo the
+number of register windows. Each bit in the wim represents
+represents whether a register window contains valid information.
+The value of 0 indicates the register window is valid and 1
+indicates it is invalid. When a save instruction causes the cwp
+to point to a register window which is marked as invalid, a
+window overflow condition results. Conversely, the restore
+instruction may result in a window underflow condition.
+
+Other than the assumption that a register window is
+always available for trap (i.e. interrupt) handlers, the SPARC
+architecture places no limits on the number of register windows
+simultaneously marked as invalid (i.e. number of bits set in the
+wim). However, RTEMS assumes that only one register window is
+marked invalid at a time (i.e. only one bit set in the wim).
+This makes the maximum possible number of register windows
+available to the user while still meeting the requirement that
+window overflow and underflow conditions can be detected.
+
+The window overflow and window underflow trap
+handlers are a critical part of the run-time environment for a
+SPARC application. The SPARC architectural specification allows
+for the number of register windows to be any power of two less
+than or equal to 32. The most common choice for SPARC
+implementations appears to be 8 register windows. This results
+in the cwp ranging in value from 0 to 7 on most implementations.
+
+
+The second complicating factor is the sharing of
+registers between adjacent register windows. While each
+register window has its own set of local registers, the input
+and output registers are shared between adjacent windows. The
+output registers for register window N are the same as the input
+registers for register window ((N - 1) modulo RW) where RW is
+the number of register windows. An alternative way to think of
+this is to remember how parameters are passed to a subroutine on
+the SPARC. The caller loads values into what are its output
+registers. Then after the callee executes a save instruction,
+those parameters are available in its input registers. This is
+a very efficient way to pass parameters as no data is actually
+moved by the save or restore instructions.
+
+@ifinfo
+@node Calling Conventions Call and Return Mechanism, Calling Conventions Calling Mechanism, Calling Conventions Register Windows, Calling Conventions
+@end ifinfo
+@section Call and Return Mechanism
+
+The SPARC architecture supports a simple yet
+effective call and return mechanism. A subroutine is invoked
+via the call (call) instruction. This instruction places the
+return address in the caller's output register 7 (o7). After
+the callee executes a save instruction, this value is available
+in input register 7 (i7) until the corresponding restore
+instruction is executed.
+
+The callee returns to the caller via a jmp to the
+return address. There is a delay slot following this
+instruction which is commonly used to execute a restore
+instruction -- if a register window was allocated by this
+subroutine.
+
+It is important to note that the SPARC subroutine
+call and return mechanism does not automatically save and
+restore any registers. This is accomplished via the save and
+restore instructions which manage the set of registers windows.
+
+@ifinfo
+@node Calling Conventions Calling Mechanism, Calling Conventions Register Usage, Calling Conventions Call and Return Mechanism, Calling Conventions
+@end ifinfo
+@section Calling Mechanism
+
+All RTEMS directives are invoked using the regular
+SPARC calling convention via the call instruction.
+
+@ifinfo
+@node Calling Conventions Register Usage, Calling Conventions Parameter Passing, Calling Conventions Calling Mechanism, Calling Conventions
+@end ifinfo
+@section Register Usage
+
+As discussed above, the call instruction does not
+automatically save any registers. The save and restore
+instructions are used to allocate and deallocate register
+windows. When a register window is allocated, the new set of
+local registers are available for the exclusive use of the
+subroutine which allocated this register set.
+
+@ifinfo
+@node Calling Conventions Parameter Passing, Calling Conventions User-Provided Routines, Calling Conventions Register Usage, Calling Conventions
+@end ifinfo
+@section Parameter Passing
+
+RTEMS assumes that arguments are placed in the
+caller's output registers with the first argument in output
+register 0 (o0), the second argument in output register 1 (o1),
+and so forth. Until the callee executes a save instruction, the
+parameters are still visible in the output registers. After the
+callee executes a save instruction, the parameters are visible
+in the corresponding input registers. The following pseudo-code
+illustrates the typical sequence used to call a RTEMS directive
+with three (3) arguments:
+
+@example
+load third argument into o2
+load second argument into o1
+load first argument into o0
+invoke directive
+@end example
+
+@ifinfo
+@node Calling Conventions User-Provided Routines, Memory Model, Calling Conventions Parameter Passing, Calling Conventions
+@end ifinfo
+@section User-Provided Routines
+
+All user-provided routines invoked by RTEMS, such as
+user extensions, device drivers, and MPCI routines, must also
+adhere to these calling conventions.
+
diff --git a/doc/supplements/sparc/cpumodel.texi b/doc/supplements/sparc/cpumodel.texi
new file mode 100644
index 0000000000..6f137ad48d
--- /dev/null
+++ b/doc/supplements/sparc/cpumodel.texi
@@ -0,0 +1,169 @@
+@c
+@c COPYRIGHT (c) 1988-1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node CPU Model Dependent Features, CPU Model Dependent Features Introduction, Preface, Top
+@end ifinfo
+@chapter CPU Model Dependent Features
+@ifinfo
+@menu
+* CPU Model Dependent Features Introduction::
+* CPU Model Dependent Features CPU Model Feature Flags::
+* CPU Model Dependent Features CPU Model Implementation Notes::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node CPU Model Dependent Features Introduction, CPU Model Dependent Features CPU Model Feature Flags, CPU Model Dependent Features, CPU Model Dependent Features
+@end ifinfo
+@section Introduction
+
+Microprocessors are generally classified into
+families with a variety of CPU models or implementations within
+that family. Within a processor family, there is a high level
+of binary compatibility. This family may be based on either an
+architectural specification or on maintaining compatibility with
+a popular processor. Recent microprocessor families such as the
+SPARC or PA-RISC are based on an architectural specification
+which is independent or any particular CPU model or
+implementation. Older families such as the M68xxx and the iX86
+evolved as the manufacturer strived to produce higher
+performance processor models which maintained binary
+compatibility with older models.
+
+RTEMS takes advantage of the similarity of the
+various models within a CPU family. Although the models do vary
+in significant ways, the high level of compatibility makes it
+possible to share the bulk of the CPU dependent executive code
+across the entire family.
+
+@ifinfo
+@node CPU Model Dependent Features CPU Model Feature Flags, CPU Model Dependent Features CPU Model Name, CPU Model Dependent Features Introduction, CPU Model Dependent Features
+@end ifinfo
+@section CPU Model Feature Flags
+@ifinfo
+@menu
+* CPU Model Dependent Features CPU Model Name::
+* CPU Model Dependent Features Floating Point Unit::
+* CPU Model Dependent Features Bitscan Instruction::
+* CPU Model Dependent Features Number of Register Windows::
+* CPU Model Dependent Features Low Power Mode::
+@end menu
+@end ifinfo
+
+Each processor family supported by RTEMS has a
+list of features which vary between CPU models
+within a family. For example, the most common model dependent
+feature regardless of CPU family is the presence or absence of a
+floating point unit or coprocessor. When defining the list of
+features present on a particular CPU model, one simply notes
+that floating point hardware is or is not present and defines a
+single constant appropriately. Conditional compilation is
+utilized to include the appropriate source code for this CPU
+model's feature set. It is important to note that this means
+that RTEMS is thus compiled using the appropriate feature set
+and compilation flags optimal for this CPU model used. The
+alternative would be to generate a binary which would execute on
+all family members using only the features which were always
+present.
+
+This section presents the set of features which vary
+across SPARC implementations and are of importance to RTEMS.
+The set of CPU model feature macros are defined in the file
+c/src/exec/score/cpu/sparc/sparc.h based upon the particular CPU
+model defined on the compilation command line.
+
+@ifinfo
+@node CPU Model Dependent Features CPU Model Name, CPU Model Dependent Features Floating Point Unit, CPU Model Dependent Features CPU Model Feature Flags, CPU Model Dependent Features CPU Model Feature Flags
+@end ifinfo
+@subsection CPU Model Name
+
+The macro CPU_MODEL_NAME is a string which designates
+the name of this CPU model. For example, for the European Space
+Agency's ERC32 SPARC model, this macro is set to the string
+"erc32".
+
+@ifinfo
+@node CPU Model Dependent Features Floating Point Unit, CPU Model Dependent Features Bitscan Instruction, CPU Model Dependent Features CPU Model Name, CPU Model Dependent Features CPU Model Feature Flags
+@end ifinfo
+@subsection Floating Point Unit
+
+The macro SPARC_HAS_FPU is set to 1 to indicate that
+this CPU model has a hardware floating point unit and 0
+otherwise.
+
+@ifinfo
+@node CPU Model Dependent Features Bitscan Instruction, CPU Model Dependent Features Number of Register Windows, CPU Model Dependent Features Floating Point Unit, CPU Model Dependent Features CPU Model Feature Flags
+@end ifinfo
+@subsection Bitscan Instruction
+
+The macro SPARC_HAS_BITSCAN is set to 1 to indicate
+that this CPU model has the bitscan instruction. For example,
+this instruction is supported by the Fujitsu SPARClite family.
+
+@ifinfo
+@node CPU Model Dependent Features Number of Register Windows, CPU Model Dependent Features Low Power Mode, CPU Model Dependent Features Bitscan Instruction, CPU Model Dependent Features CPU Model Feature Flags
+@end ifinfo
+@subsection Number of Register Windows
+
+The macro SPARC_NUMBER_OF_REGISTER_WINDOWS is set to
+indicate the number of register window sets implemented by this
+CPU model. The SPARC architecture allows a for a maximum of
+thirty-two register window sets although most implementations
+only include eight.
+
+@ifinfo
+@node CPU Model Dependent Features Low Power Mode, CPU Model Dependent Features CPU Model Implementation Notes, CPU Model Dependent Features Number of Register Windows, CPU Model Dependent Features CPU Model Feature Flags
+@end ifinfo
+@subsection Low Power Mode
+
+The macro SPARC_HAS_LOW_POWER_MODE is set to one to
+indicate that this CPU model has a low power mode. If low power
+is enabled, then there must be CPU model specific implementation
+of the IDLE task in c/src/exec/score/cpu/sparc/cpu.c. The low
+power mode IDLE task should be of the form:
+
+@example
+while ( TRUE ) @{
+ enter low power mode
+@}
+@end example
+
+The code required to enter low power mode is CPU model specific.
+
+@ifinfo
+@node CPU Model Dependent Features CPU Model Implementation Notes, Calling Conventions, CPU Model Dependent Features Low Power Mode, CPU Model Dependent Features
+@end ifinfo
+@section CPU Model Implementation Notes
+
+The ERC is a custom SPARC V7 implementation based on the Cypress 601/602
+chipset. This CPU has a number of on-board peripherals and was developed by
+the European Space Agency to target space applications. RTEMS currently
+provides support for the following peripherals:
+
+@itemize @bullet
+@item UART Channels A and B
+@item General Purpose Timer
+@item Real Time Clock
+@item Watchdog Timer (so it can be disabled)
+@item Control Register (so powerdown mode can be enabled)
+@item Memory Control Register
+@item Interrupt Control
+@end itemize
+
+The General Purpose Timer and Real Time Clock Timer provided with the ERC32
+share the Timer Control Register. Because the Timer Control Register is write
+only, we must mirror it in software and insure that writes to one timer do not
+alter the current settings and status of the other timer. Routines are
+provided in erc32.h which promote the view that the two timers are completely
+independent. By exclusively using these routines to access the Timer Control
+Register, the application can view the system as having a General Purpose
+Timer Control Register and a Real Time Clock Timer Control Register
+rather than the single shared value.
+
+The RTEMS Idle thread take advantage of the low power mode provided by the
+ERC32. Low power mode is entered during idle loops and is enabled at
+initialization time.
diff --git a/doc/supplements/sparc/cputable.texi b/doc/supplements/sparc/cputable.texi
new file mode 100644
index 0000000000..6aabd6cfa5
--- /dev/null
+++ b/doc/supplements/sparc/cputable.texi
@@ -0,0 +1,109 @@
+@c
+@c COPYRIGHT (c) 1988-1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Processor Dependent Information Table, Processor Dependent Information Table Introduction, Board Support Packages Processor Initialization, Top
+@end ifinfo
+@chapter Processor Dependent Information Table
+@ifinfo
+@menu
+* Processor Dependent Information Table Introduction::
+* Processor Dependent Information Table CPU Dependent Information Table::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Processor Dependent Information Table Introduction, Processor Dependent Information Table CPU Dependent Information Table, Processor Dependent Information Table, Processor Dependent Information Table
+@end ifinfo
+@section Introduction
+
+Any highly processor dependent information required
+to describe a processor to RTEMS is provided in the CPU
+Dependent Information Table. This table is not required for all
+processors supported by RTEMS. This chapter describes the
+contents, if any, for a particular processor type.
+
+@ifinfo
+@node Processor Dependent Information Table CPU Dependent Information Table, Memory Requirements, Processor Dependent Information Table Introduction, Processor Dependent Information Table
+@end ifinfo
+@section CPU Dependent Information Table
+
+The SPARC version of the RTEMS CPU Dependent
+Information Table is given by the C structure definition is
+shown below:
+
+@example
+struct cpu_configuration_table @{
+ void (*pretasking_hook)( void );
+ void (*predriver_hook)( void );
+ void (*postdriver_hook)( void );
+ void (*idle_task)( void );
+ boolean do_zero_of_workspace;
+ unsigned32 interrupt_stack_size;
+ unsigned32 extra_mpci_receive_server_stack;
+ void * (*stack_allocate_hook)( unsigned32 );
+ void (*stack_free_hook)( void* );
+ /* end of fields required on all CPUs */
+
+@};
+@end example
+
+@table @code
+@item pretasking_hook
+is the address of the
+user provided routine which is invoked once RTEMS initialization
+is complete but before interrupts and tasking are enabled. This
+field may be NULL to indicate that the hook is not utilized.
+
+@item predriver_hook
+is the address of the user provided
+routine which is invoked with tasking enabled immediately before
+the MPCI and device drivers are initialized. RTEMS
+initialization is complete, interrupts and tasking are enabled,
+but no device drivers are initialized. This field may be NULL to
+indicate that the hook is not utilized.
+
+@item postdriver_hook
+is the address of the user provided
+routine which is invoked with tasking enabled immediately after
+the MPCI and device drivers are initialized. RTEMS
+initialization is complete, interrupts and tasking are enabled,
+and the device drivers are initialized. This field may be NULL
+to indicate that the hook is not utilized.
+
+@item idle_task
+is the address of the optional user
+provided routine which is used as the system's IDLE task. If
+this field is not NULL, then the RTEMS default IDLE task is not
+used. This field may be NULL to indicate that the default IDLE
+is to be used.
+
+@item do_zero_of_workspace
+indicates whether RTEMS should
+zero the Workspace as part of its initialization. If set to
+TRUE, the Workspace is zeroed. Otherwise, it is not.
+
+@item interrupt_stack_size
+is the size of the RTEMS allocated interrupt stack in bytes.
+This value must be at least as large as MINIMUM_STACK_SIZE.
+
+@item extra_mpci_receive_server_stack
+is the extra stack space allocated for the RTEMS MPCI receive server task
+in bytes. The MPCI receive server may invoke nearly all directives and
+may require extra stack space on some targets.
+
+@item stack_allocate_hook
+is the address of the optional user provided routine which allocates
+memory for task stacks. If this hook is not NULL, then a stack_free_hook
+must be provided as well.
+
+@item stack_free_hook
+is the address of the optional user provided routine which frees
+memory for task stacks. If this hook is not NULL, then a stack_allocate_hook
+must be provided as well.
+
+@end table
+
diff --git a/doc/supplements/sparc/fatalerr.texi b/doc/supplements/sparc/fatalerr.texi
new file mode 100644
index 0000000000..1406097f3a
--- /dev/null
+++ b/doc/supplements/sparc/fatalerr.texi
@@ -0,0 +1,45 @@
+@c
+@c COPYRIGHT (c) 1988-1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Default Fatal Error Processing, Default Fatal Error Processing Introduction, Interrupt Processing Interrupt Stack, Top
+@end ifinfo
+@chapter Default Fatal Error Processing
+@ifinfo
+@menu
+* Default Fatal Error Processing Introduction::
+* Default Fatal Error Processing Default Fatal Error Handler Operations::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Default Fatal Error Processing Introduction, Default Fatal Error Processing Default Fatal Error Handler Operations, Default Fatal Error Processing, Default Fatal Error Processing
+@end ifinfo
+@section Introduction
+
+Upon detection of a fatal error by either the
+application or RTEMS the fatal error manager is invoked. The
+fatal error manager will invoke the user-supplied fatal error
+handlers. If no user-supplied handlers are configured, the
+RTEMS provided default fatal error handler is invoked. If the
+user-supplied fatal error handlers return to the executive the
+default fatal error handler is then invoked. This chapter
+describes the precise operations of the default fatal error
+handler.
+
+@ifinfo
+@node Default Fatal Error Processing Default Fatal Error Handler Operations, Board Support Packages, Default Fatal Error Processing Introduction, Default Fatal Error Processing
+@end ifinfo
+@section Default Fatal Error Handler Operations
+
+The default fatal error handler which is invoked by
+the fatal_error_occurred directive when there is no user handler
+configured or the user handler returns control to RTEMS. The
+default fatal error handler disables processor interrupts to
+level 15, places the error code in g1, and goes into an infinite
+loop to simulate a halt processor instruction.
+
+
diff --git a/doc/supplements/sparc/intr.t b/doc/supplements/sparc/intr.t
new file mode 100644
index 0000000000..73224c1008
--- /dev/null
+++ b/doc/supplements/sparc/intr.t
@@ -0,0 +1,226 @@
+@ifinfo
+@node Interrupt Processing, Interrupt Processing Introduction, Memory Model Flat Memory Model, Top
+@end ifinfo
+@chapter Interrupt Processing
+@ifinfo
+@menu
+* Interrupt Processing Introduction::
+* Interrupt Processing Synchronous Versus Asynchronous Traps::
+* Interrupt Processing Vectoring of Interrupt Handler::
+* Interrupt Processing Traps and Register Windows::
+* Interrupt Processing Interrupt Levels::
+* Interrupt Processing Disabling of Interrupts by RTEMS::
+* Interrupt Processing Interrupt Stack::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Interrupt Processing Introduction, Interrupt Processing Synchronous Versus Asynchronous Traps, Interrupt Processing, Interrupt Processing
+@end ifinfo
+@section Introduction
+
+Different types of processors respond to the
+occurrence of an interrupt in its own unique fashion. In
+addition, each processor type provides a control mechanism to
+allow for the proper handling of an interrupt. The processor
+dependent response to the interrupt modifies the current
+execution state and results in a change in the execution stream.
+Most processors require that an interrupt handler utilize some
+special control mechanisms to return to the normal processing
+stream. Although RTEMS hides many of the processor dependent
+details of interrupt processing, it is important to understand
+how the RTEMS interrupt manager is mapped onto the processor's
+unique architecture. Discussed in this chapter are the SPARC's
+interrupt response and control mechanisms as they pertain to
+RTEMS.
+
+RTEMS and associated documentation uses the terms
+interrupt and vector. In the SPARC architecture, these terms
+correspond to traps and trap type, respectively. The terms will
+be used interchangeably in this manual.
+
+@ifinfo
+@node Interrupt Processing Synchronous Versus Asynchronous Traps, Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing Introduction, Interrupt Processing
+@end ifinfo
+@section Synchronous Versus Asynchronous Traps
+
+The SPARC architecture includes two classes of traps:
+synchronous and asynchronous. Asynchronous traps occur when an
+external event interrupts the processor. These traps are not
+associated with any instruction executed by the processor and
+logically occur between instructions. The instruction currently
+in the execute stage of the processor is allowed to complete
+although subsequent instructions are annulled. The return
+address reported by the processor for asynchronous traps is the
+pair of instructions following the current instruction.
+
+Synchronous traps are caused by the actions of an
+instruction. The trap stimulus in this case either occurs
+internally to the processor or is from an external signal that
+was provoked by the instruction. These traps are taken
+immediately and the instruction that caused the trap is aborted
+before any state changes occur in the processor itself. The
+return address reported by the processor for synchronous traps
+is the instruction which caused the trap and the following
+instruction.
+
+@ifinfo
+@node Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing Traps and Register Windows, Interrupt Processing Synchronous Versus Asynchronous Traps, Interrupt Processing
+@end ifinfo
+@section Vectoring of Interrupt Handler
+
+Upon receipt of an interrupt the SPARC automatically
+performs the following actions:
+
+@itemize @bullet
+@item disables traps (sets the ET bit of the psr to 0),
+
+@item the S bit of the psr is copied into the Previous
+Supervisor Mode (PS) bit of the psr,
+
+@item the cwp is decremented by one (modulo the number of
+register windows) to activate a trap window,
+
+@item the PC and nPC are loaded into local register 1 and 2
+(l0 and l1),
+
+@item the trap type (tt) field of the Trap Base Register (TBR)
+is set to the appropriate value, and
+
+@item if the trap is not a reset, then the PC is written with
+the contents of the TBR and the nPC is written with TBR + 4. If
+the trap is a reset, then the PC is set to zero and the nPC is
+set to 4.
+@end itemize
+
+Trap processing on the SPARC has two features which
+are noticeably different than interrupt processing on other
+architectures. First, the value of psr register in effect
+immediately before the trap occurred is not explicitly saved.
+Instead only reversible alterations are made to it. Second, the
+Processor Interrupt Level (pil) is not set to correspond to that
+of the interrupt being processed. When a trap occurs, ALL
+subsequent traps are disabled. In order to safely invoke a
+subroutine during trap handling, traps must be enabled to allow
+for the possibility of register window overflow and underflow
+traps.
+
+If the interrupt handler was installed as an RTEMS
+interrupt handler, then upon receipt of the interrupt, the
+processor passes control to the RTEMS interrupt handler which
+performs the following actions:
+
+@itemize @bullet
+@item saves the state of the interrupted task on it's stack,
+
+@item insures that a register window is available for
+subsequent traps,
+
+@item if this is the outermost (i.e. non-nested) interrupt,
+then the RTEMS interrupt handler switches from the current stack
+to the interrupt stack,
+
+@item enables traps,
+
+@item invokes the vectors to a user interrupt service routine (ISR).
+@end itemize
+
+Asynchronous interrupts are ignored while traps are
+disabled. Synchronous traps which occur while traps are
+disabled result in the CPU being forced into an error mode.
+
+A nested interrupt is processed similarly with the
+exception that the current stack need not be switched to the
+interrupt stack.
+
+@ifinfo
+@node Interrupt Processing Traps and Register Windows, Interrupt Processing Interrupt Levels, Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing
+@end ifinfo
+@section Traps and Register Windows
+
+One of the register windows must be reserved at all
+times for trap processing. This is critical to the proper
+operation of the trap mechanism in the SPARC architecture. It
+is the responsibility of the trap handler to insure that there
+is a register window available for a subsequent trap before
+re-enabling traps. It is likely that any high level language
+routines invoked by the trap handler (such as a user-provided
+RTEMS interrupt handler) will allocate a new register window.
+The save operation could result in a window overflow trap. This
+trap cannot be correctly processed unless (1) traps are enabled
+and (2) a register window is reserved for traps. Thus, the
+RTEMS interrupt handler insures that a register window is
+available for subsequent traps before enabling traps and
+invoking the user's interrupt handler.
+
+@ifinfo
+@node Interrupt Processing Interrupt Levels, Interrupt Processing Disabling of Interrupts by RTEMS, Interrupt Processing Traps and Register Windows, Interrupt Processing
+@end ifinfo
+@section Interrupt Levels
+
+Sixteen levels (0-15) of interrupt priorities are
+supported by the SPARC architecture with level fifteen (15)
+being the highest priority. Level zero (0) indicates that
+interrupts are fully enabled. Interrupt requests for interrupts
+with priorities less than or equal to the current interrupt mask
+level are ignored.
+
+Although RTEMS supports 256 interrupt levels, the
+SPARC only supports sixteen. RTEMS interrupt levels 0 through
+15 directly correspond to SPARC processor interrupt levels. All
+other RTEMS interrupt levels are undefined and their behavior is
+unpredictable.
+
+@ifinfo
+@node Interrupt Processing Disabling of Interrupts by RTEMS, Interrupt Processing Interrupt Stack, Interrupt Processing Interrupt Levels, Interrupt Processing
+@end ifinfo
+@section Disabling of Interrupts by RTEMS
+
+During the execution of directive calls, critical
+sections of code may be executed. When these sections are
+encountered, RTEMS disables interrupts to level seven (15)
+before the execution of this section and restores them to the
+previous level upon completion of the section. RTEMS has been
+optimized to insure that interrupts are disabled for less than
+RTEMS_MAXIMUM_DISABLE_PERIOD microseconds on a RTEMS_MAXIMUM_DISABLE_PERIOD_MHZ
+Mhz ERC32 with zero wait states.
+These numbers will vary based the number of wait states and
+processor speed present on the target board.
+[NOTE: The maximum period with interrupts disabled is hand calculated. This
+calculation was last performed for Release
+RTEMS_RELEASE_FOR_MAXIMUM_DISABLE_PERIOD.]
+
+[NOTE: It is thought that the length of time at which
+the processor interrupt level is elevated to fifteen by RTEMS is
+not anywhere near as long as the length of time ALL traps are
+disabled as part of the "flush all register windows" operation.]
+
+Non-maskable interrupts (NMI) cannot be disabled, and
+ISRs which execute at this level MUST NEVER issue RTEMS system
+calls. If a directive is invoked, unpredictable results may
+occur due to the inability of RTEMS to protect its critical
+sections. However, ISRs that make no system calls may safely
+execute as non-maskable interrupts.
+
+@ifinfo
+@node Interrupt Processing Interrupt Stack, Default Fatal Error Processing, Interrupt Processing Disabling of Interrupts by RTEMS, Interrupt Processing
+@end ifinfo
+@section Interrupt Stack
+
+The SPARC architecture does not provide for a
+dedicated interrupt stack. Thus by default, trap handlers would
+execute on the stack of the RTEMS task which they interrupted.
+This artificially inflates the stack requirements for each task
+since EVERY task stack would have to include enough space to
+account for the worst case interrupt stack requirements in
+addition to it's own worst case usage. RTEMS addresses this
+problem on the SPARC by providing a dedicated interrupt stack
+managed by software.
+
+During system initialization, RTEMS allocates the
+interrupt stack from the Workspace Area. The amount of memory
+allocated for the interrupt stack is determined by the
+interrupt_stack_size field in the CPU Configuration Table. As
+part of processing a non-nested interrupt, RTEMS will switch to
+the interrupt stack before invoking the installed handler.
+
diff --git a/doc/supplements/sparc/memmodel.texi b/doc/supplements/sparc/memmodel.texi
new file mode 100644
index 0000000000..d99ef26f96
--- /dev/null
+++ b/doc/supplements/sparc/memmodel.texi
@@ -0,0 +1,117 @@
+@c
+@c COPYRIGHT (c) 1988-1996.
+@c On-Line Applications Research Corporation (OAR).
+@c All rights reserved.
+@c
+
+@ifinfo
+@node Memory Model, Memory Model Introduction, Calling Conventions User-Provided Routines, Top
+@end ifinfo
+@chapter Memory Model
+@ifinfo
+@menu
+* Memory Model Introduction::
+* Memory Model Flat Memory Model::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node Memory Model Introduction, Memory Model Flat Memory Model, Memory Model, Memory Model
+@end ifinfo
+@section Introduction
+
+A processor may support any combination of memory
+models ranging from pure physical addressing to complex demand
+paged virtual memory systems. RTEMS supports a flat memory
+model which ranges contiguously over the processor's allowable
+address space. RTEMS does not support segmentation or virtual
+memory of any kind. The appropriate memory model for RTEMS
+provided by the targeted processor and related characteristics
+of that model are described in this chapter.
+
+@ifinfo
+@node Memory Model Flat Memory Model, Interrupt Processing, Memory Model Introduction, Memory Model
+@end ifinfo
+@section Flat Memory Model
+
+The SPARC architecture supports a flat 32-bit address
+space with addresses ranging from 0x00000000 to 0xFFFFFFFF (4
+gigabytes). Each address is represented by a 32-bit value and
+is byte addressable. The address may be used to reference a
+single byte, half-word (2-bytes), word (4 bytes), or doubleword
+(8 bytes). Memory accesses within this address space are
+performed in big endian fashion by the SPARC. Memory accesses
+which are not properly aligned generate a "memory address not
+aligned" trap (type number 7). The following table lists the
+alignment requirements for a variety of data accesses:
+
+@ifset use-ascii
+@example
+@group
+ +--------------+-----------------------+
+ | Data Type | Alignment Requirement |
+ +--------------+-----------------------+
+ | byte | 1 |
+ | half-word | 2 |
+ | word | 4 |
+ | doubleword | 8 |
+ +--------------+-----------------------+
+@end group
+@end example
+@end ifset
+
+@ifset use-tex
+@sp 1
+@tex
+\centerline{\vbox{\offinterlineskip\halign{
+\vrule\strut#&
+\hbox to 1.75in{\enskip\hfil#\hfil}&
+\vrule#&
+\hbox to 1.75in{\enskip\hfil#\hfil}&
+\vrule#\cr
+\noalign{\hrule}
+&\bf Data Type &&\bf Alignment Requirement&\cr\noalign{\hrule}
+&byte&&1&\cr\noalign{\hrule}
+&half-word&&2&\cr\noalign{\hrule}
+&word&&4&\cr\noalign{\hrule}
+&doubleword&&8&\cr\noalign{\hrule}
+}}\hfil}
+@end tex
+@end ifset
+
+@ifset use-html
+@html
+<CENTER>
+ <TABLE COLS=2 WIDTH="60%" BORDER=2>
+<TR><TD ALIGN=center><STRONG>Data Type</STRONG></TD>
+ <TD ALIGN=center><STRONG>Alignment Requirement</STRONG></TD></TR>
+<TR><TD ALIGN=center>byte</TD>
+ <TD ALIGN=center>1</TD></TR>
+<TR><TD ALIGN=center>half-word</TD>
+ <TD ALIGN=center>2</TD></TR>
+<TR><TD ALIGN=center>word</TD>
+ <TD ALIGN=center>4</TD></TR>
+<TR><TD ALIGN=center>doubleword</TD>
+ <TD ALIGN=center>8</TD></TR>
+ </TABLE>
+</CENTER>
+@end html
+@end ifset
+
+Doubleword load and store operations must use a pair
+of registers as their source or destination. This pair of
+registers must be an adjacent pair of registers with the first
+of the pair being even numbered. For example, a valid
+destination for a doubleword load might be input registers 0 and
+1 (i0 and i1). The pair i1 and i2 would be invalid. [NOTE:
+Some assemblers for the SPARC do not generate an error if an odd
+numbered register is specified as the beginning register of the
+pair. In this case, the assembler assumes that what the
+programmer meant was to use the even-odd pair which ends at the
+specified register. This may or may not have been a correct
+assumption.]
+
+RTEMS does not support any SPARC Memory Management
+Units, therefore, virtual memory or segmentation systems
+involving the SPARC are not supported.
+
diff --git a/doc/supplements/sparc/timedata.t b/doc/supplements/sparc/timedata.t
new file mode 100644
index 0000000000..22cc6a1202
--- /dev/null
+++ b/doc/supplements/sparc/timedata.t
@@ -0,0 +1,156 @@
+@include ../common/timemac.texi
+@tex
+\global\advance \smallskipamount by -4pt
+@end tex
+
+@ifinfo
+@node ERC32 Timing Data, ERC32 Timing Data Introduction, Memory Requirements RTEMS RAM Workspace Worksheet, Top
+@end ifinfo
+@chapter ERC32 Timing Data
+@ifinfo
+@menu
+* ERC32 Timing Data Introduction::
+* ERC32 Timing Data Hardware Platform::
+* ERC32 Timing Data Interrupt Latency::
+* ERC32 Timing Data Context Switch::
+* ERC32 Timing Data Directive Times::
+* ERC32 Timing Data Task Manager::
+* ERC32 Timing Data Interrupt Manager::
+* ERC32 Timing Data Clock Manager::
+* ERC32 Timing Data Timer Manager::
+* ERC32 Timing Data Semaphore Manager::
+* ERC32 Timing Data Message Manager::
+* ERC32 Timing Data Event Manager::
+* ERC32 Timing Data Signal Manager::
+* ERC32 Timing Data Partition Manager::
+* ERC32 Timing Data Region Manager::
+* ERC32 Timing Data Dual-Ported Memory Manager::
+* ERC32 Timing Data I/O Manager::
+* ERC32 Timing Data Rate Monotonic Manager::
+@end menu
+@end ifinfo
+
+@ifinfo
+@node ERC32 Timing Data Introduction, ERC32 Timing Data Hardware Platform, ERC32 Timing Data, ERC32 Timing Data
+@end ifinfo
+@section Introduction
+
+The timing data for RTEMS on the ERC32 implementation
+of the SPARC architecture is provided along with the target
+dependent aspects concerning the gathering of the timing data.
+The hardware platform used to gather the times is described to
+give the reader a better understanding of each directive time
+provided. Also, provided is a description of the interrupt
+latency and the context switch times as they pertain to the
+SPARC version of RTEMS.
+
+@ifinfo
+@node ERC32 Timing Data Hardware Platform, ERC32 Timing Data Interrupt Latency, ERC32 Timing Data Introduction, ERC32 Timing Data
+@end ifinfo
+@section Hardware Platform
+
+All times reported in this chapter were measured
+using the SPARC Instruction Simulator (SIS) developed by the
+European Space Agency. SIS simulates the ERC32 -- a custom low
+power implementation combining the Cypress 90C601 integer unit,
+the Cypress 90C602 floating point unit, and a number of
+peripherals such as counter timers, interrupt controller and a
+memory controller.
+
+For the RTEMS tests, SIS is configured with the
+following characteristics:
+
+@itemize @bullet
+@item 15 Mhz clock speed
+
+@item 0 wait states for PROM accesses
+
+@item 0 wait states for RAM accesses
+@end itemize
+
+The ERC32's General Purpose Timer was used to gather
+all timing information. This timer was programmed to operate
+with one microsecond accuracy. All sources of hardware
+interrupts were disabled, although traps were enabled and the
+interrupt level of the SPARC allows all interrupts.
+
+@ifinfo
+@node ERC32 Timing Data Interrupt Latency, ERC32 Timing Data Context Switch, ERC32 Timing Data Hardware Platform, ERC32 Timing Data
+@end ifinfo
+@section Interrupt Latency
+
+The maximum period with traps disabled or the
+processor interrupt level set to it's highest value inside RTEMS
+is less than RTEMS_MAXIMUM_DISABLE_PERIOD
+microseconds including the instructions which
+disable and re-enable interrupts. The time required for the
+ERC32 to vector an interrupt and for the RTEMS entry overhead
+before invoking the user's trap handler are a total of
+RTEMS_INTR_ENTRY_RETURNS_TO_PREEMPTING_TASK
+microseconds. These combine to yield a worst case interrupt
+latency of less than RTEMS_MAXIMUM_DISABLE_PERIOD +
+RTEMS_INTR_ENTRY_RETURNS_TO_PREEMPTING_TASK microseconds at
+RTEMS_MAXIMUM_DISABLE_PERIOD_MHZ Mhz.
+[NOTE: The maximum period with interrupts disabled was last
+determined for Release RTEMS_RELEASE_FOR_MAXIMUM_DISABLE_PERIOD.]
+
+The maximum period with interrupts disabled within
+RTEMS is hand-timed with some assistance from SIS. The maximum
+period with interrupts disabled with RTEMS occurs during a
+context switch when traps are disabled to flush all the register
+windows to memory. The length of time spent flushing the
+register windows varies based on the number of windows which
+must be flushed. Based on the information reported by SIS, it
+takes from 4.0 to 18.0 microseconds (37 to 122 instructions) to
+flush the register windows. It takes approximately 41 CPU
+cycles (2.73 microseconds) to flush each register window set to
+memory. The register window flush operation is heavily memory
+bound.
+
+[NOTE: All traps are disabled during the register
+window flush thus disabling both software generate traps and
+external interrupts. During a normal RTEMS critical section,
+the processor interrupt level (pil) is raised to level 15 and
+traps are left enabled. The longest path for a normal critical
+section within RTEMS is less than 50 instructions.]
+
+The interrupt vector and entry overhead time was
+generated on the SIS benchmark platform using the ERC32's
+ability to forcibly generate an arbitrary interrupt as the
+source of the "benchmark" interrupt.
+
+@ifinfo
+@node ERC32 Timing Data Context Switch, RTEMS_CPU_MODEL Timing Data Directive Times, ERC32 Timing Data Interrupt Latency, ERC32 Timing Data
+@end ifinfo
+@section Context Switch
+
+The RTEMS processor context switch time is 10
+microseconds on the SIS benchmark platform when no floating
+point context is saved or restored. Additional execution time
+is required when a TASK_SWITCH user extension is configured.
+The use of the TASK_SWITCH extension is application dependent.
+Thus, its execution time is not considered part of the raw
+context switch time.
+
+Since RTEMS was designed specifically for embedded
+missile applications which are floating point intensive, the
+executive is optimized to avoid unnecessarily saving and
+restoring the state of the numeric coprocessor. The state of
+the numeric coprocessor is only saved when an FLOATING_POINT
+task is dispatched and that task was not the last task to
+utilize the coprocessor. In a system with only one
+FLOATING_POINT task, the state of the numeric coprocessor will
+never be saved or restored. When the first FLOATING_POINT task
+is dispatched, RTEMS does not need to save the current state of
+the numeric coprocessor.
+
+The following table summarizes the context switch
+times for the ERC32 benchmark platform:
+
+@include timetbl.texi
+
+@tex
+\global\advance \smallskipamount by 4pt
+@end tex
+
+
diff --git a/doc/tools/bmenu/bmenu b/doc/tools/bmenu/bmenu
new file mode 100644
index 0000000000..91796a8862
--- /dev/null
+++ b/doc/tools/bmenu/bmenu
Binary files differ
diff --git a/doc/tools/bmenu/chain.o b/doc/tools/bmenu/chain.o
new file mode 100644
index 0000000000..f26dd12af6
--- /dev/null
+++ b/doc/tools/bmenu/chain.o
Binary files differ
diff --git a/doc/tools/bmenu/main.o b/doc/tools/bmenu/main.o
new file mode 100644
index 0000000000..e4b1fa7579
--- /dev/null
+++ b/doc/tools/bmenu/main.o
Binary files differ
diff --git a/install-sh b/install-sh
deleted file mode 100755
index d55683a77f..0000000000
--- a/install-sh
+++ /dev/null
@@ -1,252 +0,0 @@
-#! /bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
-#
-# Copyright 1991 by the Massachusetts Institute of Technology
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission. M.I.T. makes no representations about the
-# suitability of this software for any purpose. It is provided "as is"
-# without express or implied warranty.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch. It can only install one file at a time, a restriction
-# shared with many OS's install programs.
-#
-# $Id$
-#
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
-else
- true
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d $dst ]; then
- instcmd=:
- else
- instcmd=mkdir
- fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f $src -o -d $src ]
- then
- true
- else
- echo "install: $src does not exist"
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "install: no destination specified"
- exit 1
- else
- true
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d $dst ]
- then
- dst="$dst"/`basename $src`
- else
- true
- fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
- shift
-
- if [ ! -d "${pathcomp}" ] ;
- then
- $mkdirprog "${pathcomp}"
- else
- true
- fi
-
- pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd $dst &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename $dst`
- else
- dstfile=`basename $dst $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename $dst`
- else
- true
- fi
-
-# Make a temp file name in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd $src $dsttmp &&
-
- trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing. If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
-
-fi &&
-
-
-exit 0
diff --git a/make/Makefile.in b/make/Makefile.in
deleted file mode 100644
index ea5220009c..0000000000
--- a/make/Makefile.in
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# $Id$
-#
-# Not strictly necessary to pull in this stuff. But it helps with
-# working with the templates and poking around.
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-# NOTE: No need to prepend $(srcdir) to file names,
-# VPATH handles the paths for us.
-# NOTE: Only the files really need get installed.
-
-GENERIC_FILES := host.cfg target.cfg
-
-MAKEFILES := README \
- directory.cfg leaf.cfg \
- lib.cfg main.cfg
-
-# NOTE: Use the wildcard rule to install all custom files
-# CUSTOM_FILES := $(wildcard $(srcdir)/custom/*.cfg)
-
-# NOTE: This should be sufficient, but may fail for some BSPS:
-# Get all custom files for the BSP family, they may depend on each other
-#CUSTOM_FILES := custom/default.cfg $(patsubst %,custom/%.cfg, posix)
-
-# This version of the rule is pretty ugly but I think it works ALL the time.
-# + Figure out what this BSP.cfg includes
-# + Make those files have the correct relative path.
-# + Now fix $(RTEMS_HOST) to the real host name
-CUSTOM_FILES := custom/default.cfg custom/$(RTEMS_BSP).cfg \
- $(shell grep "^include.*make/custom" $(srcdir)/custom/$(RTEMS_BSP).cfg | \
- sed -e 's/^.*make\///' | sed -e s/\\$$\(RTEMS_HOST\)/${RTEMS_HOST}/)
-
-# NOTE: Use the wildcard rule to install all compiler files
-# COMPILER_FILES := $(wildcard $(srcdir)/compilers/*.cfg)
-COMPILER_FILES := $(CONFIG.$(TARGET_ARCH).CC) $(CONFIG.$(HOST_ARCH).CC)
-
-# NOTE: Don't use a wildcard rule here, otherwise Templates/Makefile.inc
-# will be installed, too
-TEMPLATE_FILES := \
- Templates/Makefile.dir \
- Templates/Makefile.leaf \
- Templates/Makefile.lib
-
-get: retrieve
-
-all:
-
-$(prefix)/rtems:
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-install: $(prefix)/rtems \
- $(prefix)/rtems/make \
- $(prefix)/rtems/make/compilers \
- $(prefix)/rtems/make/custom \
- $(prefix)/rtems/make/Templates \
- install_files
-
-$(prefix)/rtems/make:
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-install_files:: $(GENERIC_FILES) $(MAKEFILES)
- @INSTALL@ $(INSTDATAFLAGS) $^ \
- $(prefix)/rtems/make
-
-$(prefix)/rtems/make/compilers:
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-install_files:: $(COMPILER_FILES)
- @INSTALL@ $(INSTDATAFLAGS) $^ \
- $(prefix)/rtems/make/compilers
-
-$(prefix)/rtems/make/custom:
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-install_files:: $(CUSTOM_FILES)
- @INSTALL@ $(INSTDATAFLAGS) $^ \
- $(prefix)/rtems/make/custom
-
-$(prefix)/rtems/make/Templates:
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-
-install_files:: $(TEMPLATE_FILES)
- @INSTALL@ $(INSTDATAFLAGS) $^ \
- $(prefix)/rtems/make/Templates
diff --git a/make/README b/make/README
deleted file mode 100644
index 6cdc4b2c6e..0000000000
--- a/make/README
+++ /dev/null
@@ -1,513 +0,0 @@
-#
-# $Id$
-#
-
- make/README
-
- This file describes the layout and conventions of the make tree used in
- the RTEMS software project and others.
- All of these "make" trees are substantially similar; however this
- file documents the current state of the rtems Makefile tree.
-
- This make tree was developed originally to simplify porting projects
- between various os's. The primary goals are:
-
- . simple *and* customizable individual makefiles
-
- . use widely available GNU make. There is no pre-processing or
- automatic generation of Makefiles.
-
- . Same makefiles work on *many* host os's due to portability
- of GNU make and the host os config files.
-
- . Support for different compilers and operating systems
- on a per-user basis. Using the same sources (including
- Makefiles) one developer can develop and test under SVR4,
- another under 4.x, another under HPUX.
-
- . Builtin support for compiling "variants" such as debug,
- profile, and tcov versions. These variants can be built
- recursively.
-
- . Control of system dependencies. "hidden" dependencies on
- environment variables (such as PATH)
- have been removed whenever possible. No matter what your
- PATH variable is set to, you should get the same thing
- when you 'make' as everyone else on the project.
-
- This description attempts to cover all aspects of the Makefile tree. Most
- of what is described here is maintained automatically by the configuration
- files.
-
- The example makefiles in make/Templates should be used as a starting
- point for new directories.
-
- There are 2 main types of Makefile:
-
- directory and leaf.
-
- Directory Makefiles
- -------------------
-
- A Makefile in a source directory with sub-directories is called a
- "directory" Makefile.
-
- Directory Makefile's are simply responsible for acting as "middle-men"
- and recursing into their sub-directories and propagating the make.
-
- For example, directory src/bin will contain only a Makefile and
- sub-directories. No actual source code will reside in the directory.
- The following commands:
-
- $ cd src/bin
- $ make all
-
- would descend into all the subdirectories of 'src/bin' and recursively
- perform a 'make all'.
-
- A 'make debug' will recurse thru sub-directories as a debug build.
-
- A template directory Makefile which should work in almost all
- cases is in make/Templates/Makefile.dir
-
-
- Leaf Makefiles
- --------------
-
- Source directories that contain source code for libraries or
- programs use a "leaf" Makefile.
-
- These makefiles contain the rules necessary to build programs
- (or libraries).
-
- A template leaf Makefile is in Templates/Makefile.leaf . A template
- leaf Makefile for building libraries is in Templates/Makefile.lib .
-
-
- NOTE: To simplify nested makefile's and source maintenance, we disallow
- combining source and directories (that make(1) would be expected to
- recurse into) in one source directory. Ie., a directory in the source
- tree may contain EITHER source files OR recursive sub directories, but NOT
- both.
-
- Variants (where objects go)
- ---------------------------
-
- All binary targets are placed in a sub-directory whose name is (for
- example):
-
- o-force386/ -- binaries (no debug, no profile)
- o-force386-debug/ -- debug binaries
- o-force386-profile/ -- profiling binaries
-
- Using the template Makefiles, this will all happen automatically.
-
- Within a Makefile, the ${ARCH} variable is set to o-force386,
- o-force386-debug, etc., as appropriate.
-
- Typing 'make' will place objects in o-force386.
- 'make debug' will place objects in o-force386-debug.
- 'make profile' will place objects in o-force386-profile.
-
- NOTE: For RTEMS work, the word 'force386' is the specified
- RTEMS_BSP (specified in the modules file)
-
- The debug and profile targets are equivalent to 'all' except that
- CFLAGS and/or LDFLAGS are modified as per the compiler config file for
- debug and profile support.
-
- Targets debug_install and profile_install are equivalent to 'make
- install' except that debug (or profile) variants are built and
- installed.
-
- The targets debug, profile, debug_install, profile_install, etc., can be
- invoked recursively at the directory make level. So from the top of a
- tree, one could install a debug version of everything under that point
- by:
-
- $ cd src/lib
- $ gmake debug_install
-
- When building a command that is linked with a generated library, the
- appropriate version of the library will be linked in.
-
- For example, the following fragments link the normal, debug, or
- profile version of "libmine.a" as appropriate:
-
- LDLIBS += $(LIBMINE)
- LIBMINE = ../libmine/${ARCH}/libmine.a
-
- ${ARCH}/pgm: $(LIBMINE) ${OBJS}
- $(LINK.c) -o $@ ${OBJS} $(LDLIBS)
-
- If we do 'gmake debug', then the library in
- ../libmine/sparc-debug/libmine.a will be linked in. If $(LIBMINE)
- might not exist (or might be out of date) at this point, we could add
-
- ${LIBMINE}: FORCEIT
- cd ../libmine; ${MAKE} ${VARIANT_VA}
-
- The above would generate the following command to build libmine.a:
-
- cd ../libmine; gmake debug
-
- The macro reference ${VARIANT_VA} converts ${ARCH} to the word 'debug'
- (in this example) and thus ensures the proper version of the library
- is built.
-
-
- Targets
- -------
-
- All Makefile's support the following targets:
-
- all -- make "everything"
- install -- install "everything"
-
- The following targets are provided automatically by
- the included config files:
-
- clean -- delete all targets
- clobber -- 'clean' plus delete sccs'd files
- lint -- run lint or lint-like tool
- get -- "sccs get" all sources
- depend -- build a make dependency file
- "variant targets" -- special variants, see below
-
-
- All directory Makefiles automatically propagate all these targets. If
- you don't wish to support 'all' or 'install' in your source directory,
- you must leave the rules section empty, as the parent directory Makefile
- will attempt it on recursive make's.
-
-
- Configuration
- -------------
-
- All the real work described here happens in file(s) included
- from your Makefile.
-
- All Makefiles include a customization file which is used to select
- compiler and host operating system. The environment variable
- RTEMS_CUSTOM must point to this file; eg:
-
- /.../make/custom/force386.cfg
-
- All leaf Makefile's also include either 'make/leaf.cfg' (or
- 'make/lib.cfg' for building libraries). These config files provide
- default rules and set up the command macros as appropriate.
-
- All directory Makefiles include 'make/directory.cfg'. directory.cfg
- provides all the rules for recursing through sub directories.
-
- The Makefile templates already perform these include's.
-
- 'make/leaf.cfg' (or directory.cfg) in turn includes:
-
- a file specifying general purpose rules appropriate for
- both leaf and directory makefiles.
- ( make/main.cfg )
-
- personality modules specified by the customization file for:
- compiler ( make/compilers/??.cfg )
-
-
- private customization files
- ---------------------------
-
- [ $(RTEMS_CUSTOM) ]
-
- Your own private configuration file. Specifies which of the above
- files you want to include.
-
- Example: custom/force386.cfg
-
- CONFIG.$(HOST_ARCH).OS = $(RTEMS_ROOT)/make/os/HPUX-9.0.cfg
-
- # HOST Compiler config file
- # You may also want to specify where the compiler resides here.
- CC_$(HOST_ARCH)_DIR=/usr/local
- CONFIG.$(HOST_ARCH).CC = $(RTEMS_ROOT)/make/compilers/gcc.cfg
-
- ## Target compiler config file, if any
- CC_$(TARGET_ARCH)_DIR=$(RTEMS_GNUTOOLS)
- CONFIG.$(TARGET_ARCH).CC = $(RTEMS_ROOT)/make/compilers/gcc-force386.cfg
-
- generic rules file
- ------------------
-
- [ make/main.cfg ]
- included by leaf.cfg or directory.cfg.
-
- This file contains some standard rules and variable assignments
- that all Makefiles need.
-
- It also includes the FORCEIT: pseudo target.
-
-
- OS config file for host machine
- -------------------------------
-
- [ make/os/OS-NAME.cfg ]
- included by main.cfg
-
- Figures out the target architecture and specifies command names
- for the OS tools including RCS/CVS (but NOT for the compiler tools).
-
-
- Compiler configuration for the target
- -------------------------------------
-
- [ compilers/COMPILER-NAME.cfg ]
- included by leaf.cfg
-
- Specifies the names of tools for compiling programs.
- Names in here should be fully qualified, and NOT depend on $PATH.
-
- Also specifies compiler flags to be used to generate optimized,
- debugging and profile versions, as well as rules to compile
- assembly language and make makefile dependencies.
-
-
- Configuration Variables
- -----------------------
-
- Variables you have to set in the environment or in your Makefile.
- Note: the rtems module files set RTEMS_ROOT and RTEMS_CUSTOM
- for you.
-
- Environment Variables
- ---------------------
-
- RTEMS_BSP -- name of your 'bsp' eg: force386
-
- RTEMS_ROOT -- The root of your source tree.
- All other file names are derived from this.
- [ eg: % setenv RTEMS_ROOT $HOME/work/rtems ]
-
- RTEMS_CUSTOM -- name of your config files in make/custom
- Example:
- $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-
- RTEMS_GNUTOOLS -- root of the gcc tools for the target
-
- The value RTEMS_ROOT is used in the custom
- files to generate the make(1) variables:
-
- PROJECT_ROOT
- PROJECT_RELEASE
- PROJECT_TOOLS
-
- etc., which are used within the make config files themselves.
- (The files in make/*.cfg try to avoid use of word RTEMS so
- they can be more easily shared by other projects)
-
- Preset variables
- ----------------
-
- Aside from command names set by the os and compiler config files,
- a number of MAKE variables are automatically set and maintained by
- the config files.
-
- CONFIG.$(HOST_ARCH).CC
- -- full path of C compilation config file, set by custom
- config file.
-
- PROJECT_RELEASE
- -- release/install directory
- [ $(PROJECT_ROOT) ]
-
- PROJECT_BIN
- -- directory for installed binaries
- [ $(PROJECT_ROOT)/bin ]
-
- PROJECT_TOOLS
- -- directory for build environment commands
- [ eg: $(PROJECT_ROOT)/build-tools ]
-
- TARCH -- ${TARGET_ARCH}
- [ eg: o-forc386 ]
- obsolete and should not be referenced
-
- ARCH -- target sub-directory for object code
- [ eg: o-force386 or o-force386-debug ]
-
- HOST_ARCH
- -- host machine architecture name
- [ eg: sun4, sparc on SVR4 ]
-
- VARIANTS -- full list of all possible values for $(ARCH);
- used mainly for 'make clean'
- [ eg: "o-force386 o-force386-debug o-force386-profile" ]
-
- VARIANT_VA -- Variant name.
- Normally "", but for 'make debug' it is "debug",
- for 'make profile', "profile, etc.
-
- see make/leaf.cfg for more info.
-
-
- Preset compilation variables
- ----------------------------
-
- This is a list of some of the compilation variables.
- Refer to the compiler config files for the complete list.
-
- CFLAGS_OPTIMIZE_V -- value of optimize flag for compiler
- [ eg: -O ]
-
- CFLAGS_DEBUG_V -- value of debug flag for compiler
- [ eg: -g ]
-
- CFLAGS_PROFILE_V -- compiler profile flags
- [ eg: -pg ]
-
- CFLAGS_DEBUG_OPTIMIZE_V
- -- optimize flag if compiling for debug
- [ eg: "" ]
-
- CFLAGS_DEBUG
- CFLAGS_PROFILE
- CFLAGS_OPTIMIZE -- current values for each depending
- on make variant.
-
- LDFLAGS_STATIC_LIBRARIES_V
- -- ld option for static libraries
- -Bstatic or -dy (svr4)
-
- LDFLAGS_SHARED_LIBRARIES_V
- -- ld option for dynamic libraries
- -Bdynamic or -dn (svr4)
-
- LIB_SOCKET
- -- ld(1) -l option(s) to provide
- socket support.
-
- LIB_MATH -- ld(1) -l option(s) to provide
- math library.
-
-
- Makefile Variables
- ------------------
-
- The following variables may be set in a typical Makefile.
-
- C_PIECES -- File names of your .c files without '.c' suffix.
- [ eg: C_PIECES=main funcs stuff ]
-
- CC_PIECES -- ditto, except for .cc files
-
- S_PIECES -- ditto, except for .S files.
-
- LIB -- target library name in leaf library makefiles.
- [ eg: LIB=${ARCH}/libmine.a ]
-
- H_FILES -- your .h files in this directory.
- [ eg: H_FILES=stuff.h extra.h ]
-
- DEFINES -- cc -D items. Included in CPPFLAGS.
- leaf Makefiles.
- [ eg: DEFINES += -DUNIX ]
-
- CPPFLAGS -- -I include directories.
- leaf Makefiles.
- [ eg: CPPFLAGS += -I../include ]
-
- YFLAGS -- Yacc flags.
- leaf Makefiles.
- [ eg: YFLAGS += -v ]
-
- LD_PATHS -- arguments to -L for ld.
- Will be prefixed with '-L' or '-L ' as appropriate
- and included in LDFLAGS.
-
- LDFLAGS -- -L arguments to ld; more may be ADDed.
-
- LD_LIBS -- libraries to be linked in.
- [ eg: LDLIBS += ../libfoo/${ARCH}/libfoo.a ]
-
- XCFLAGS -- "extra" CFLAGS for special needs. Pre-pended
- to CFLAGS.
- Not set or used by Makefiles.
- Can be set on command line to pass extra flags
- to the compiler.
-
- XCPPFLAGS -- ditto for CPPFLAGS
- Can be set on command line to pass extra flags
- to the preprocessor.
-
- XCCPPFLAGS -- same as XCPPFLAGS for C++.
-
- XCCFLAGS -- same as XCFLAGS for C++.
-
- SUB_DIRS -- list of sub directories for make recursion.
- directory Makefiles only.
- [ eg: SUB_DIRS=cpu bsp ]
-
- CLEAN_ADDITIONS
- -- list of files or directories that should
- be deleted by 'make clean'
- [ eg: CLEAN_ADDITIONS += y.tab.c ]
-
- See 'leaf.cfg' for the 'clean:' rule and its
- default deletions.
-
- CLOBBER_ADDITIONS
- -- list of files or directories that should
- be deleted by 'make clobber'
- Since 'make clobber' includes 'make clean',
- you don't need to duplicate items in both.
-
- TARGET_ARCH -- target architecture (eg: o-force386)
- leaf makefiles only.
- Should be specified before 'include leaf.cfg'.
- Only needs to be specified if your target is
- different from output of `arch`.
-
- Command names
- -------------
-
- The following commands should only be called
- as make variables:
-
- MAKE,INSTALL,SHELL
-
- ECHO,CAT,RM,CP,MV,LN,MKDIR,CHMOD
-
- ED,SED
-
- CC,CPP,AS,AR,LD,NM,SIZE,RANLIB,MKLIB,
- YACC,LEX,LINT,CTAGS,ETAGS
-
- Special Directory Makefile Targets
- ----------------------------------
-
- all_WRAPUP
- clean_WRAPUP
- install_WRAPUP
- clean_WRAPUP
- clobber_WRAPUP
- depend_WRAPUP
- -- Specify additional commands for recursive
- (directory level) targets.
-
- This is handy in certain cases where you need
- to do bit of work *after* a recursive make.
-
- make/Templates
- --------------
-
- This directory contains Makefile and source file templates that
- should help in creating or converting makefiles.
-
- Makefile.leaf
- Template leaf Makefiles.
-
- Makefile.lib
- Template leaf library Makefiles.
-
- Makefile.dir
- Template "directory" makefile.
-
-
-
diff --git a/make/Templates/Makefile.dir b/make/Templates/Makefile.dir
deleted file mode 100644
index e70d40c0cb..0000000000
--- a/make/Templates/Makefile.dir
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=a b c your-directories-go-here
-
diff --git a/make/Templates/Makefile.inc.in b/make/Templates/Makefile.inc.in
deleted file mode 100644
index c64b785dd5..0000000000
--- a/make/Templates/Makefile.inc.in
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-#
-# Target specific settings. To be included in application Makefiles.
-#
-
-prefix = @prefix@
-
-CC_FOR_TARGET = @program_prefix@gcc
-AS_FOR_TARGET = @program_prefix@as
-AR_FOR_TARGET = @program_prefix@ar
-NM_FOR_TARGET = @program_prefix@nm
-LD_FOR_TARGET = @program_prefix@ld
-SIZE_FOR_TARGET = @program_prefix@size
-OBJCOPY_FOR_TARGET = @program_prefix@objcopy
-
-CC= $(CC_FOR_TARGET)
-AS= $(AS_FOR_TARGET)
-LD= $(LD_FOR_TARGET)
-NM= $(NM_FOR_TARGET)
-AR= $(AR_FOR_TARGET)
-SIZE= $(SIZE_FOR_TARGET)
-OBJCOPY= $(OBJCOPY_FOR_TARGET)
-
-export CC
-export AS
-export LD
-export NM
-export AR
-export SIZE
-export OBJCOPY
-
-RTEMS_HOST = @RTEMS_HOST@
-RTEMS_CUSTOM = $(prefix)/rtems/make/custom/$(RTEMS_BSP).cfg
-PROJECT_ROOT = $(prefix)/rtems/
-RTEMS_USE_OWN_PDIR = @RTEMS_USE_OWN_PDIR@
-RTEMS_HAS_POSIX_API = @RTEMS_HAS_POSIX_API@
-RTEMS_USE_MACROS = @RTEMS_USE_MACROS@
-RTEMS_HAS_CPLUSPLUS = @RTEMS_HAS_CPLUSPLUS@
-RTEMS_USE_GCC272 = @RTEMS_USE_GCC272@
-RTEMS_LIBC_DIR = @RTEMS_LIBC_DIR@
-
-export RTEMS_BSP
-export RTEMS_CUSTOM
-export PROJECT_ROOT
-
-# FIXME: The following shouldn't be here
-RTEMS_ROOT = $(PROJECT_ROOT)
-export RTEMS_ROOT
diff --git a/make/Templates/Makefile.leaf b/make/Templates/Makefile.leaf
deleted file mode 100644
index 8d610b1c0e..0000000000
--- a/make/Templates/Makefile.leaf
+++ /dev/null
@@ -1,77 +0,0 @@
-#
-# $Id$
-#
-# Templates/Makefile.leaf
-# Template leaf node Makefile
-#
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=xxxd xxxe xxxf
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-# C++ source names, if any, go here -- minus the .cc
-CC_PIECES=xxxa xxxb xxxc
-CC_FILES=$(CC_PIECES:%=%.cc)
-CC_O_FILES=$(CC_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-PGMS=${ARCH}/xxx-your-program-here ${ARCH}/xxx-another-one
-
-# List of RTEMS managers to be included in the application goes here.
-# Use:
-# MANAGERS=all
-# to include all RTEMS managers in the application.
-MANAGERS=io event message rate_monotonic semaphore timer, etc.
-
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# CFLAGS_DEBUG_V are used when the `make debug' target is built.
-# To link your application with the non-optimized RTEMS routines,
-# uncomment the following line:
-# CFLAGS_DEBUG_V += -qrtems_debug
-#
-
-LD_PATHS += xxx-your-EXTRA-library-paths-go-here, if any
-LD_LIBS += xxx-your-libraries-go-here eg: -lvx
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += xxx-your-debris-goes-here
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(PGMS)
-
-${ARCH}/xxx-your-program-here: ${OBJS} ${LINK_FILES}
- $(make-exe)
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-install: all
- $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/bin
diff --git a/make/Templates/Makefile.lib b/make/Templates/Makefile.lib
deleted file mode 100644
index 18baaedbaa..0000000000
--- a/make/Templates/Makefile.lib
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id$
-#
-# Templates/Makefile.lib
-# Template library Makefile
-#
-
-LIBNAME=libfoo.a # xxx- your library names goes here
-LIB=${ARCH}/${LIBNAME}
-
-# C and C++ source names, if any, go here -- minus the .c or .cc
-C_PIECES=xxxd xxxe xxxf
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-CC_PIECES=xxxa xxxb xxxc
-CC_FILES=$(CC_PIECES:%=%.cc)
-CC_O_FILES=$(CC_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-# Assembly source names, if any, go here -- minus the .s
-S_PIECES=
-S_FILES=$(S_PIECES:%=%.s)
-S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += xxx-your-debris-goes-here
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(LIB)
-
-$(LIB): ${OBJS}
- $(make-library)
-
-# Install the library, appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
-install: all
- $(INSTALL_VARIANT) -m 644 ${LIB} ${PROJECT_RELEASE}/lib
diff --git a/make/compilers/gcc-no_bsp.cfg b/make/compilers/gcc-no_bsp.cfg
deleted file mode 100644
index 6260eafe65..0000000000
--- a/make/compilers/gcc-no_bsp.cfg
+++ /dev/null
@@ -1,293 +0,0 @@
-#
-# $Id$
-#
-# gcc 2.6.x compiler for a "native" nocpu/nobsp system
-# Compiler (and tools) configuration
-#
-
-# Prefix on the installed GNU tools
-# Just use the native tools
-GNU_TOOLS_PREFIX=
-
-# Additional target names (other than debug, profile)
-TARGET_VARIANTS +=
-
-#
-# Pre-processor defines using the target options header file.
-#
-# Local tailoring (on the command line) can be done by setting XCFLAGS
-# or XCPPFLAGS -- neither of which are never set in the Makefile's
-#
-
-CPPFLAGS=$(CFLAGS) $(XCPPFLAGS) $(DEFINES)
-
-CPLUS_CPPFLAGS=$(CFLAGS) $(XCPPFLAGS) $(DEFINES)
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# NO_TABLE_MOVE (SPARC PORT)
-# do not have a second trap table -- use the BSP's
-#
-# STACK_CHECKER_ON (RTEMS support code)
-# If defined, stack bounds checking is enabled.
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-
-define make-target-options
- echo "/* #define NDEBUG 1 */ " >>$@
- echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- echo "/* #define STACK_CHECKER_ON 1 */" >>$@
- echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-#
-# Local tailoring (on the command line) can be done by setting XCFLAGS
-# which is never set in the Makefile's
-#
-
-#
-# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V, CFLAGS_PROFILE_V are the values we
-# would want the corresponding macros to be set to.
-#
-# CFLAGS_OPTIMIZE, CFLAGS_DEBUG, CFLAGS_PROFILE are set in the leaf
-# Makefiles by the 'debug:' and 'profile:' targets to their _V values.
-#
-
-# default flags
-
-#
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS =
-
-CFLAGS_DEFAULT = $(CPU_CFLAGS) -Wall -ansi -fasm
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# debug flag; typically -g
-CFLAGS_DEBUG_V=-g -Wno-unused
-
-# when debugging, optimize flag: typically empty
-# some compilers do allow optimization with their "-g"
-CFLAGS_DEBUG_OPTIMIZE_V=
-
-# profile flag; use gprof(1)
-CFLAGS_PROFILE_V=-pg
-
-# default is to optimize
-CFLAGS_OPTIMIZE=$(CFLAGS_OPTIMIZE_V)
-
-# dynamic libraries
-CFLAGS_DYNAMIC_V=-fpic
-ASFLAGS_DYNAMIC_V=
-
-CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE) \
- -I $(PROJECT_INCLUDE)
-
-# List of library paths without -L
-LD_PATHS= $(PROJECT_RELEASE)/lib
-
-# libraries you want EVERYONE to link with
-LD_LIBS=
-
-# ld flag to ensure pure-text
-LDFLAGS_MUST_BE_PURE_V =
-
-# ld flag for [un]shared objects
-LDFLAGS_STATIC_LIBRARIES_V =
-LDFLAGS_SHARED_LIBRARIES_V =
-
-# ld flag for incomplete link
-LDFLAGS_INCOMPLETE = -r
-
-# Special linker options when building lib.so
-LDFLAGS_DYNAMIC_V = ??
-
-# Some dynamic linking systems want the preferred name recorded in the binary
-# ref: src/libxil/Makefile
-LDFLAGS_DYNAMIC_LIBNAME_V = -h $(DYNAMIC_VERSION_LIBNAME)
-
-# ld flags for profiling, debugging
-LDFLAGS_PROFILE_V =
-LDFLAGS_DEBUG_V =
-
-LDFLAGS=$(LDFLAGS_PROFILE) $(LDFLAGS_DEBUG) $(LD_PATHS:%=-L %)
-
-#
-# Stuff to clean and clobber for the compiler and its tools
-#
-
-CLEAN_CC = a.out *.o *.BAK
-CLOBBER_CC =
-
-#
-# Client compiler and support tools
-#
-
-CC=gcc
-CXX=$(CC)
-CCC=$(CXX)
-
-# CPP command to write file to standard output
-CPP=$(CC) -E
-
-# flags set by cc when running cpp
-CPP_CC_FLAGS=-D__STDC__
-
-AS=as
-ASPP=ERROR_NO_ASPP
-
-ASFLAGS=
-ASM4FLAGS := -I $(PROJECT_INCLUDE)
-
-
-# NOTE: should never use full path .. but there is no guarantee ld, etc
-# will be in the same directory as gcc.. so hope they are in the path
-# Don't do this on a real target!!!
-LD=ld
-NM=nm
-AR=ar
-# egrep regexp to ignore symbol table entries in ar archives.
-# Only used to make sure we skip them when coalescing libraries.
-# skip __.SYMDEF and empty names (maybe bug in ranlib??).
-AR_SYMBOL_TABLE="HIGHLY-UNLIKELY-TO-CONFLICT"
-ARFLAGS=ruv
-
-# NOTE: see comment on ld, nm, ar
-SIZE=size
-
-#
-# Command to convert a normal archive to one searchable by $(LD)
-# Not needed on SVR4
-#
-
-MKLIB=echo library is complete:
-
-#
-# How to compile stuff into ${ARCH} subdirectory
-#
-# NOTE: we override COMPILE.c
-#
-
-COMPILE.c=$(CC) $(CFLAGS) $(CPPFLAGS) $(XCFLAGS) -c
-
-${ARCH}/%.o: %.c
- ${COMPILE.c} -o $@ $<
-
-${ARCH}/%.o: %.cc
- ${COMPILE.c} -o $@ $<
-
-${ARCH}/%.o: %.S
- ${COMPILE.c} -DASM -o $@ $<
-
-${ARCH}/%.o: %.s
- $(CPP) $(CPPFLAGS) - <$*.s >$(ARCH)/$*.i
- $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i
-# $(RM) $(ARCH)/$*.i
-
-# Specify our own default rule for this to prevent having CFLAGS and
-# CPPFLAGS being passed to linker
-${ARCH}/%: ${ARCH}/%.o
- ${CC} ${LDFLAGS} -o $@ $@.o ${LD_LIBS}
-
-# Make foo.rel from foo.o
-${ARCH}/%.rel: ${ARCH}/%.o
- ${LD} $(LDFLAGS_INCOMPLETE) -o $@ $^
-
-# create $(ARCH)/pgm from pgm.sh
-${ARCH}/%: %.sh
- $(RM) $@
- $(CP) $< $@
- $(CHMOD) +x $@
-
-# Dependency files for use by gmake
-# NOTE: we don't put in $(TARGET_ARCH)
-# so that 'make clean' doesn't blow it away
-
-DEPEND=Depends-$(TARGET_ARCH:o-%=%)
-
-CLEAN_DEPEND=$(DEPEND).tmp
-CLOBBER_DEPEND=$(DEPEND)
-
-# We deliberately don't have anything depend on the
-# $(DEPEND) file; otherwise it will get rebuilt even
-# on 'make clean'
-#
-
-depend: $(C_FILES) $(CC_FILES) $(S_FILES)
-ifneq ($(words $(C_FILES) $(CC_FILES) $(S_FILES)), 0)
-# Use gcc -M to generate dependencies
-# Replace foo.o with $(ARCH)/foo.o
-# Replace $(ARCH) value with string $(ARCH)
-# so that it will for debug and profile cases
- $(COMPILE.c) -M $^ | \
- $(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
- -e 's?$(ARCH)/?$$(ARCH)/?' >$(DEPEND).tmp
- $(MV) $(DEPEND).tmp $(DEPEND)
-endif
-
-
-# List (possibly empty) of required managers
-# We require:
-# region -- used by lib/libcsupport for malloc()
-# ext -- used by libc for libc reentrancy hooks
-
-MANAGERS_REQUIRED=region ext sem
-
-# Create a RTEMS executable based on MANAGERS which was set in
-# app's Makefile
-
-MANAGERS_NOT_WANTED=$(filter-out $(MANAGERS), $(MANAGER_LIST))
-MANAGERS_NOT_WANTED:=$(filter-out $(MANAGERS_REQUIRED), $(MANAGERS_NOT_WANTED))
-
-# spell out all the LINK_FILE's, rather than using -lbsp, so
-# that $(LINK_FILES) can be a dependency
-
-# Start file must be one of
-# $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o
-# $(PROJECT_RELEASE)/lib/asmiface$(LIB_VARIANT).o
-# It defaults to start.o, but an app can override it.
-
-# Note: Normally RTEMS provides a start file...
-START_FILE=
-
-CONSTRUCTOR=
-
-LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name $(GCCSED))
-
-LINK_FILES= $(START_FILE) \
- $(CONSTRUCTOR) \
- $(OBJS) \
- $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel) \
- $(LD_LIBS) \
- $(LIBC_EXTRA_LIBS) \
- $(PROJECT_RELEASE)/lib/libtest$(LIBSUFFIX_VA) \
- $(PROJECT_RELEASE)/lib/librtemsall$(LIBSUFFIX_VA) \
- $(LIBC_LIBM) $(LIBC_LIBC) $(LIBGCC)
-
-# Here is the rule to actually build a $(ARCH)/foo.exe
-# It also builds $(ARCH)/foo.sr and $(ARCH)/foo.nm
-# Usage ref: src/tests/sptest/sp1/Makefile
-
-# On Solaris at least you need to had /usr/ucblib/libucb.a
-
-define make-exe
- $(CC) -o $(basename $@).exe $(LINK_FILES) -lc -lm
- $(NM) -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-
-define make-rel
- $(LD) $(LDFLAGS_INCOMPLETE) $(XLDFLAGS) -o $@ $(OBJS)
-endef
diff --git a/make/compilers/gcc-portsw.cfg b/make/compilers/gcc-portsw.cfg
deleted file mode 100644
index 6b6f3c459f..0000000000
--- a/make/compilers/gcc-portsw.cfg
+++ /dev/null
@@ -1,296 +0,0 @@
-#
-# gcc-no_bsp.cfg,v 1.13 1995/12/19 19:59:57 joel Exp
-#
-# This is for the amd29k portsw board.
-#
-# THIS IS NOT A GNU TOOLS BASED PORT!!!
-#
-
-# Prefix on the installed GNU tools
-# Just use the native tools
-GNU_TOOLS_PREFIX=
-
-# Additional target names (other than debug, profile)
-TARGET_VARIANTS +=
-
-#
-# Pre-processor defines.
-# Local tailoring (on the command line) can be done by setting XCPPFLAGS
-# which is never set in the Makefile's
-#
-# Possible defines include:
-# -DRTEMS_LIBC using libc bundled with RTEMS
-# -DRTEMS_NEWLIB using CYGNUS libc
-# -DMALLOC_PROVIDED must be used for newlib reent struct
-
-DEFINES:= $(LIBC_DEFINES)
-
-GCC_INCLUDE=.
-
-# Note: normally we do not want the standard include files
-# Also we usually include a "libc_include" directory
-CPPFLAGS=$(XCPPFLAGS) $(DEFINES) \
- -I$(RTEMS_LIBC_DIR)/include \
- -I$(PROJECT_INCLUDE) \
- -I/opt/29k/src/inc
-
-#
-# Local tailoring (on the command line) can be done by setting XCFLAGS
-# which is never set in the Makefile's
-#
-
-#
-# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V, CFLAGS_PROFILE_V are the values we
-# would want the corresponding macros to be set to.
-#
-# CFLAGS_OPTIMIZE, CFLAGS_DEBUG, CFLAGS_PROFILE are set in the leaf
-# Makefiles by the 'debug:' and 'profile:' targets to their _V values.
-#
-
-# default flags
-
-CFLAGS_DEFAULT = -NB -bwc -nocrt0 -Ml -m -g -Hansi -Hon=Pointers_compatible -Hon=Pointers_compatible_with_ints -Dinline= -D___AM29K__ -Hnocopyr
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-# -Os to optimize for size
-CFLAGS_OPTIMIZE_V=-Os
-
-# debug flag; typically -g
-CFLAGS_DEBUG_V=-g -O0 -DRTEMS_DEBUG -DSTACK_CHECKER_ON
-
-# when debugging, optimize flag: typically empty
-# some compilers do allow optimization with their "-g"
-CFLAGS_DEBUG_OPTIMIZE_V=
-
-# profile flag; use gprof(1)
-CFLAGS_PROFILE_V=
-
-# default is to optimize
-CFLAGS_OPTIMIZE=$(CFLAGS_OPTIMIZE_V)
-
-# dynamic libraries
-CFLAGS_DYNAMIC_V=-fpic
-ASFLAGS_DYNAMIC_V=
-
-CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE)
-
-# List of library paths without -L
-LD_PATHS= $(PROJECT_RELEASE)/lib
-
-# libraries you want EVERYONE to link with
-LD_LIBS=
-
-# ld flag to ensure pure-text
-LDFLAGS_MUST_BE_PURE_V =
-
-# ld flag for [un]shared objects
-LDFLAGS_STATIC_LIBRARIES_V =
-LDFLAGS_SHARED_LIBRARIES_V =
-
-# ld flag for incomplete link
-LDFLAGS_INCOMPLETE = -i
-
-# Special linker options when building lib.so
-LDFLAGS_DYNAMIC_V = ??
-
-# Some dynamic linking systems want the preferred name recorded in the binary
-# ref: src/libxil/Makefile
-LDFLAGS_DYNAMIC_LIBNAME_V = -h $(DYNAMIC_VERSION_LIBNAME)
-
-# ld flags for profiling, debugging
-LDFLAGS_PROFILE_V =
-LDFLAGS_DEBUG_V =
-
-LDFLAGS=$(LDFLAGS_PROFILE) $(LDFLAGS_DEBUG) $(LD_PATHS:%=-L %)
-
-#
-# Stuff to clean and clobber for the compiler and its tools
-#
-
-CLEAN_CC = a.out *.o *.BAK
-CLOBBER_CC =
-
-#
-# Client compiler and support tools
-#
-
-CC=/opt/29k/bin/hc29
-CXX=$(CC)
-CCC=$(CXX)
-
-# CPP command to write file to standard output
-CPP=$(CC) -E
-
-# flags set by cc when running cpp
-CPP_CC_FLAGS=-D__STDC__
-
-AS=/opt/29k/bin/as29
-ASPP=ERROR_NO_ASPP
-
-ASFLAGS=-l -fcgimosx
-ASM4FLAGS := -I $(PROJECT_INCLUDE)
-
-
-# NOTE: should never use full path .. but there is no guarantee ld, etc
-# will be in the same directory as gcc.. so hope they are in the path
-# Don't do this on a real target!!!
-LD=/opt/29k/bin/ld29
-NM=/opt/29k/bin/nm29
-AR=echo making library
-# egrep regexp to ignore symbol table entries in ar archives.
-# Only used to make sure we skip them when coalescing libraries.
-# skip __.SYMDEF and empty names (maybe bug in ranlib??).
-AR_SYMBOL_TABLE="HIGHLY-UNLIKELY-TO-CONFLICT"
-ARFLAGS=ruv
-
-# NOTE: see comment on ld, nm, ar
-SIZE=size
-
-#
-# Command to convert a normal archive to one searchable by $(LD)
-# Not needed on SVR4
-#
-
-MKLIB=/opt/29k/bin/lib29
-
-#
-# How to compile stuff into ${ARCH} subdirectory
-#
-# NOTE: we override COMPILE.c
-#
-
-COMPILE.c=$(CC) -c $(CFLAGS) $(CPPFLAGS) $(XCFLAGS)
-
-${ARCH}/%.o: %.c
- ${COMPILE.c} -o $@ $<
- $(CHMOD) -f g+w $@
-
-${ARCH}/%.o: %.cc
- ${COMPILE.c} -o $@ $<
- $(CHMOD) -f g+w $@
-
-${ARCH}/%.o: %.s
- ${COMPILE.c} -DASM -o $@ $<
- $(CHMOD) -f g+w $@
-
-${ARCH}/%.o: %.S
- $(CP) $*.s $(ARCH)/$*.c
- $(CPP) $(CPPFLAGS) $(ARCH)/$*.c > $(ARCH)/$*.s
- ${COMPILE.c} -o $@ $(ARCH)/$*.s
- $(CHMOD) -f g+w $@
- $(RM) $(ARCH)/$*.c
-
-# Specify our own default rule for this to prevent having CFLAGS and
-# CPPFLAGS being passed to linker
-${ARCH}/%: ${ARCH}/%.o
- ${CC} ${LDFLAGS} -o $@ $@.o ${LD_LIBS}
- $(CHMOD) -f g+w $@
-
-# Make foo.rel from foo.o
-${ARCH}/%.rel: ${ARCH}/%.o
- ${LD} $(LDFLAGS_INCOMPLETE) -o $@ $^
- $(CHMOD) -f g+w $@
-
-# create $(ARCH)/pgm from pgm.sh
-${ARCH}/%: %.sh
- $(RM) $@
- $(CP) $< $@
- $(CHMOD) +x $@
- $(CHMOD) -f g+w $@
-
-# Dependency files for use by gmake
-# NOTE: we don't put in $(TARGET_ARCH)
-# so that 'make clean' doesn't blow it away
-
-DEPEND=Depends-$(TARGET_ARCH:o-%=%)
-
-CLEAN_DEPEND=$(DEPEND).tmp
-CLOBBER_DEPEND=$(DEPEND)
-
-# We deliberately don't have anything depend on the
-# $(DEPEND) file; otherwise it will get rebuilt even
-# on 'make clean'
-#
-
-depend: $(C_FILES) $(CC_FILES) $(S_FILES)
-ifneq ($(words $(C_FILES) $(CC_FILES) $(S_FILES)), 0)
-# Use gcc -M to generate dependencies
-# Replace foo.o with $(ARCH)/foo.o
-# Replace $(ARCH) value with string $(ARCH)
-# so that it will for debug and profile cases
- $(COMPILE.c) -Hmake $^ | \
- $(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
- -e 's?$(ARCH)/?$$(ARCH)/?' >$(DEPEND).tmp
-
- $(MV) $(DEPEND).tmp $(DEPEND)
- $(CHMOD) -f g+w $(DEPEND)
-endif
-
-
-# spell out all the LINK_FILE's, rather than using -lbsp, so
-# that $(LINK_FILES) can be a dependency
-
-# Start file must be one of
-# $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o
-# $(PROJECT_RELEASE)/lib/asmiface$(LIB_VARIANT).o
-# It defaults to start.o, but an app can override it.
-
-# Note: Normally RTEMS provides a start file...
-START_FILE= $(PROJECT_RELEASE)/lib/crt0$(LIB_VARIANT).o $(PROJECT_RELEASE)/lib/register$(LIB_VARIANT).o
-
-LIBC_LOW= $(PROJECT_RELEASE)/lib/libcsupport$(LIBSUFFIX_VA)
-
-LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name $(GCCSED))
-
-LIBOSBOOT=/home/src/amd29k/sps2000/netrom.o
-
-LINK_FILES= \
- $(START_FILE) \
- $(OBJS) \
- $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel) \
- $(PROJECT_RELEASE)/lib/libbsp$(LIBSUFFIX_VA) \
- $(LD_LIBS) \
- $(PROJECT_RELEASE)/lib/libtest$(LIBSUFFIX_VA) \
- $(PROJECT_RELEASE)/lib/librtems$(LIBSUFFIX_VA) \
- $(LIBC_LOW) \
- $(PROJECT_RELEASE)/lib/libmisc$(LIBSUFFIX_VA) \
- $(LIBC_LIBC) \
- $(LIBC_EXTRALIBS) \
- $(LIBC_LIBM)
-# /home/craigl/osbdbg.o
-
-# Here is the rule to actually build a $(ARCH)/foo.exe
-# It also builds $(ARCH)/foo.sr and $(ARCH)/foo.nm
-# Usage ref: src/tests/sptest/sp1/Makefile
-
-define make-exe
- if [ $(NO_ROM) ]; then echo "\n\nskipping ROM compile\n"; else \
- $(CC) -nocrt0 -cmd$(PROJECT_RELEASE)/lib/romlink -u _times -u _gettimeofday \
- -u _sleep -o $(basename $@).out $(LIBOSBOOT) $(LINK_FILES); \
- romcoff -r -t -l -b $(basename $@).out raminit.o; \
- rm $(basename $@).out; \
- $(CC) -m -u _times -u _gettimeofday -u _sleep -o $(basename $@).romcof $(LIBOSBOOT) \
- $(LINK_FILES) raminit.o -nocrt0 -cmd$(PROJECT_RELEASE)/lib/romlink > $(basename $@).rommap ; \
- rm raminit.o ; \
- $(CHMOD) -f g+w $(basename $@).romcof; \
- /opt/green/coff2sr -noS5 $(basename $@).romcof -o $(basename $@).srec; \
- $(CHMOD) -f g+w $(basename $@).srec; \
- fi
- if [ $(CREATE_MAP) ]; then \
- $(CC) -m -u _times -u _gettimeofday -u _sleep -o $(basename $@).exe $(LINK_FILES) -nocrt0 -cmd$(PROJECT_RELEASE)/lib/ramlink > $(basename $@).rammap; \
- else \
- rm $(basename $@).rommap > /dev/null 2> /dev/null ; \
- $(CC) -u _times -u _gettimeofday -u _sleep -o $(basename $@).exe $(LINK_FILES) -nocrt0 -cmd$(PROJECT_RELEASE)/lib/ramlink; \
- fi
- $(CHMOD) -f g+w $(basename $@).exe
-# $(CC) -o $(basename $@).exe $(LINK_FILES) -nocrt0 -cmd/opt/29k/lib/link030.cmd
- $(NM) -g $(basename $@).exe > $(basename $@).num
- $(CHMOD) -f g+w $(basename $@).num
-# $(SIZE) $(basename $@).exe
-endef
-
-define make-rel
- $(LD) $(LDFLAGS_INCOMPLETE) $(XLDFLAGS) -o $@ $(OBJS)
- $(CHMOD) -f g+w $@
-endef
diff --git a/make/compilers/gcc-target-default.cfg b/make/compilers/gcc-target-default.cfg
deleted file mode 100644
index c1b27435dc..0000000000
--- a/make/compilers/gcc-target-default.cfg
+++ /dev/null
@@ -1,330 +0,0 @@
-#
-# Shared compiler for all GNU tools configurations
-#
-# $Id$
-#
-
-CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
-
-CPLUS_CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
-
-##
-# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V, CFLAGS_PROFILE_V are the values we
-# would want the corresponding macros to be set to.
-#
-# CFLAGS_OPTIMIZE, CFLAGS_DEBUG, CFLAGS_PROFILE are set in the leaf
-# Makefiles by the 'debug:' and 'profile:' targets to their _V values.
-#
-
-# default flags
-
-# We only include the header files for networking if it is enabled.
-INCLUDE_NETWORKING_yes_V = -I$(PROJECT_INCLUDE)/networking
-INCLUDE_NETWORKING = $(INCLUDE_NETWORKING_$(HAS_NETWORKING)_V)
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-ifeq ($(RTEMS_CROSS_TARGET),no)
-
-ifdef RTEMS_LIBC_DIR
-RTEMS_LIBC_INCLUDES := -I$(RTEMS_LIBC_DIR)/include
-endif
-
-# Used for posix bsps
-CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
- -I$(PROJECT_INCLUDE) \
- $(INCLUDE_NETWORKING) \
- $(RTEMS_LIBC_INCLUDES) $(DEFINES)
-
-ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g \
- -I$(PROJECT_INCLUDE) \
- $(RTEMS_LIBC_INCLUDES) $(DEFINES)
-else
-# Used for embedded bsps
-# Ask gcc where it finds its own include files
-GCC_INCLUDE=$(shell $(CC) $(CPU_CFLAGS) -print-file-name=include $(GCCSED))
-
-CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
- -nostdinc -I$(PROJECT_INCLUDE) \
- $(INCLUDE_NETWORKING) \
- -I$(RTEMS_LIBC_DIR)/include -I$(GCC_INCLUDE) $(DEFINES)
-
-ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g \
- -nostdinc -I$(PROJECT_INCLUDE) \
- -I$(RTEMS_LIBC_DIR)/include -I$(GCC_INCLUDE) $(DEFINES)
-endif
-
-# default location of Standard C Library
-ifndef LIBC_LIBC
-LIBC_LIBC=$(RTEMS_LIBC_DIR)/lib/libc.a
-endif
-
-ifndef LIBC_LIBM
-LIBC_LIBM=$(RTEMS_LIBC_DIR)/lib/libm.a
-endif
-
-else
-CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
- -B$(PROJECT_RELEASE)/lib/ -specs bsp_specs -qrtems \
- $(INCLUDE_NETWORKING) $(DEFINES)
-
-ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g -I$(srcdir) \
- -B$(PROJECT_RELEASE)/lib/ -specs bsp_specs -qrtems $(DEFINES)
-
-# default location of Standard C Library
-ifndef LIBC_LIBC
-LIBC_LIBC=$(shell $(CC) $(CPU_CFLAGS) -print-file-name=libc.a $(GCCSED))
-endif
-
-ifndef LIBC_LIBM
-LIBC_LIBM=$(shell $(CC) $(CPU_CFLAGS) -print-file-name=libm.a $(GCCSED))
-endif
-endif
-
-# Define this to yes if C++ is included in the development environment.
-# This requires that at least the GNU C++ compiler and libg++ be installed.
-ifeq ($(RTEMS_HAS_CPLUSPLUS),yes)
-HAS_CPLUSPLUS=yes
-CPLUS_LD_LIBS += $(PROJECT_RELEASE)/lib/librtems++$(LIBSUFFIX_VA)
-else
-HAS_CPLUSPLUS=no
-endif
-
-# debug flag;
-CFLAGS_DEBUG_V+=-Wno-unused
-
-ifeq ($(RTEMS_USE_GCC272),no)
-CFLAGS_DEBUG_V+=-qrtems_debug
-endif
-
-# when debugging, optimize flag: typically empty
-# some compilers do allow optimization with their "-g"
-#CFLAGS_DEBUG_OPTIMIZE_V=
-
-# profile flag; use gprof(1)
-CFLAGS_PROFILE_V=-pg
-
-# default is to optimize
-CFLAGS_OPTIMIZE=$(CFLAGS_OPTIMIZE_V)
-
-# dynamic libraries
-CFLAGS_DYNAMIC_V=-fpic
-#ASFLAGS_DYNAMIC_V=
-
-CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE)
-
-# List of library paths without -L
-LD_PATHS= $(PROJECT_RELEASE)/lib
-
-# libraries you want EVERYONE to link with
-#LD_LIBS=
-
-# ld flag to ensure pure-text
-#LDFLAGS_MUST_BE_PURE_V =
-
-# ld flag for [un]shared objects
-#LDFLAGS_STATIC_LIBRARIES_V =
-#LDFLAGS_SHARED_LIBRARIES_V =
-
-# ld flag for incomplete link
-LDFLAGS_INCOMPLETE = -r
-
-# Special linker options when building lib.so
-LDFLAGS_DYNAMIC_V = ??
-
-# Some dynamic linking systems want the preferred name recorded in the binary
-# ref: src/libxil/Makefile
-LDFLAGS_DYNAMIC_LIBNAME_V = -h $(DYNAMIC_VERSION_LIBNAME)
-
-# ld flags for profiling, debugging
-LDFLAGS_PROFILE_V =
-LDFLAGS_DEBUG_V =
-
-LDFLAGS=$(LDFLAGS_PROFILE) $(LDFLAGS_DEBUG) $(LD_PATHS:%=-L %)
-
-#
-# Stuff to clean and clobber for the compiler and its tools
-#
-
-CLEAN_CC = a.out *.o *.BAK
-CLOBBER_CC =
-
-#
-# Client compiler and support tools
-#
-
-# CPP command to write file to standard output
-CPP=$(CC) -E -ansi -w -Wp,-$$
-
-# flags set by cc when running cpp
-CPP_CC_FLAGS=-D__STDC__
-
-ASFLAGS= $(CPU_ASFLAGS)
-ASM4FLAGS := -I $(PROJECT_INCLUDE)
-
-# egrep regexp to ignore symbol table entries in ar archives.
-# Only used to make sure we skip them when coalescing libraries.
-# skip __.SYMDEF and empty names (maybe bug in ranlib??).
-AR_SYMBOL_TABLE="HIGHLY-UNLIKELY-TO-CONFLICT"
-ARFLAGS=ruv
-
-#
-# Command to convert a normal archive to one searchable by $(LD)
-#
-# NOTE: Obsolete, use $(RANLIB) instead, MKLIB may disappear soon
-MKLIB=$(RANLIB)
-
-#
-# How to compile stuff into ${ARCH} subdirectory
-#
-# NOTE: we override COMPILE.c
-#
-
-COMPILE.c=$(CC) $(CFLAGS) $(XCFLAGS) -c
-COMPILE.cc=$(CXX) $(CFLAGS) $(CXXFLAGS) $(XCFLAGS) -c
-
-${ARCH}/%.o: %.c
- ${COMPILE.c} -o $@ $<
-
-${ARCH}/%.o: %.cc
- ${COMPILE.cc} -o $@ $<
-
-${ARCH}/%.o: %.S
- ${COMPILE.c} -DASM -o $@ $<
-
-# strip out C++ style comments.
-${ARCH}/%.o: %.s
- sed -e 's/\/\/.*$$//' < $< | \
- $(CPP) $(ASMFLAGS) -I. -I$(srcdir) -DASM - >$(ARCH)/$*.i
- $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i
-
-# $(CPP) $(CPPFLAGS) -DASM - < $< >$(ARCH)/$*.i
-# $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i
-# $(RM) $(ARCH)/$*.i
-
-# Specify our own default rule for this to prevent having CFLAGS and
-# CPPFLAGS being passed to linker
-#
-#
-# NOTE (Ralf): Having this rule is a bug, IMO.
-# I have only kept it for the moment because some (broken) Makefiles
-# might need it.
-#
-# ${ARCH}/%: ${ARCH}/%.o
-# ${CC} ${LDFLAGS} -o $@ $@.o ${LD_LIBS}
-#
-# Anyway, the rule above is wrong. The one below should be correct
-# (But this one should also not be necessary. If something breaks now,
-# have a look at the Makefile or custom/*.cfg :-)
-# $(ARCH)/%.exe: $(ARCH)/%.o
-# $(make-exe)
-
-# Make foo.rel from foo.o
-${ARCH}/%.rel: ${ARCH}/%.o
- ${LD} $(LDFLAGS_INCOMPLETE) -o $@ $^
-
-# create $(ARCH)/pgm from pgm.sh
-${ARCH}/%: %.sh
- $(RM) $@
- $(CP) $< $@
- $(CHMOD) +x $@
-
-# Dependency files for use by gmake
-# NOTE: we don't put in $(TARGET_ARCH)
-# so that 'make clean' doesn't blow it away
-
-DEPEND=Depends-$(TARGET_ARCH:o-%=%)
-
-CLEAN_DEPEND=$(DEPEND).tmp
-CLOBBER_DEPEND=$(DEPEND)
-
-# We deliberately don't have anything depend on the
-# $(DEPEND) file; otherwise it will get rebuilt even
-# on 'make clean'
-#
-
-depend: $(C_FILES) $(CC_FILES) $(S_FILES)
-ifneq ($(words $(C_FILES) $(CC_FILES) $(S_FILES)), 0)
-# Use gcc -M to generate dependencies
-# Replace foo.o with $(ARCH)/foo.o
-# Replace $(ARCH) value with string $(ARCH)
-# so that it will for debug and profile cases
- $(COMPILE.c) -M $^ | \
- $(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
- -e 's?$(ARCH)/?$$(ARCH)/?' >$(DEPEND).tmp
- $(MV) $(DEPEND).tmp $(DEPEND)
-endif
-
-# spell out all the LINK_FILE's, rather than using -lbsp, so
-# that $(LINK_FILES) can be a dependency
-
-# Start file must be one of
-# $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o
-# $(PROJECT_RELEASE)/lib/asmiface$(LIB_VARIANT).o
-# It defaults to start.o, but an app can override it.
-
-ifeq ($(START_BASE),)
- START_FILE=
-else
- START_FILE=$(PROJECT_RELEASE)/lib/$(START_BASE)$(LIB_VARIANT).o
-endif
-
-CONSTRUCTOR=
-
-LIBC_LOW=
-
-ifndef LIBGCC
-LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name $(GCCSED))
-endif
-
-#
-# NOTE: a rule to link an rtems' application should look similar to this
-# (cf. "make-exe" in make/custom/*.cfg):
-#
-# gcc27:
-# $(PGM): $(LINK_FILES)
-# $(LD) $(LDFLAGS) -o $@ $(LINK_OBJS) \
-# --start-group $(LINK_LIBS) --end-group
-#
-# gcc28:
-# $(PGM): $(LINK_FILES)
-# $(CC) $(CFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS)
-#
-
-LINK_OBJS =\
- $(CONSTRUCTOR) \
- $(OBJS) \
- $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel) \
- $(PROJECT_RELEASE)/lib/libtest$(LIBSUFFIX_VA)
-
-LINK_FILES =\
- $(START_FILE) \
- $(CONSTRUCTOR) \
- $(OBJS) \
- $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel) \
- $(PROJECT_RELEASE)/lib/libtest$(LIBSUFFIX_VA) \
- $(PROJECT_RELEASE)/lib/librtemsall$(LIBSUFFIX_VA)
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-LINK_LIBS = $(PROJECT_RELEASE)/lib/librtemsall$(LIBSUFFIX_VA)
-ifeq ($(RTEMS_CROSS_TARGET),yes)
-# NOTE: add libc and libgcc only for embedded targets
-# LIBC_LIBM should not be needed by rtems itself.
-# FIXME: If a BSP requires libm, its make/custom/*.cfg file should add
-# LIBC_LIBM to LINK_LIBS (untested)
-LINK_LIBS += $(LIBC_LIBC) $(LIBGCC)
-endif
-endif
-
-LINK_LIBS += $(LD_LIBS)
-
-#
-# Allow user to override link commands (to build a prom image, perhaps)
-#
-ifndef LINKCMDS
-LINKCMDS=$(PROJECT_RELEASE)/lib/linkcmds
-endif
-
-
-define make-rel
- $(LD) $(LDFLAGS_INCOMPLETE) $(XLDFLAGS) -o $@ $(OBJS)
-endef
diff --git a/make/compilers/gcc.cfg.in b/make/compilers/gcc.cfg.in
deleted file mode 100644
index 590bacc213..0000000000
--- a/make/compilers/gcc.cfg.in
+++ /dev/null
@@ -1,203 +0,0 @@
-#
-# $Id$
-#
-# gcc 2.6.x native compiler
-# Compiler (and tools) configuration
-#
-
-# Additional target names (other than debug, profile)
-TARGET_VARIANTS +=
-
-#
-# Pre-processor defines.
-# Local tailoring (on the command line) can be done by setting XCPPFLAGS
-# which is never set in the Makefile's
-#
-
-CPPFLAGS=$(XCPPFLAGS) $(DEFINES)
-
-#
-# Local tailoring (on the command line) can be done by setting CFLAGS
-# which is never set in the Makefile's
-#
-
-#
-# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V, CFLAGS_PROFILE_V are the values we
-# would want the corresponding macros to be set to.
-#
-# CFLAGS_OPTIMIZE, CFLAGS_DEBUG, CFLAGS_PROFILE are set in the leaf
-# Makefiles by the 'debug:' and 'profile:' targets to their _V values.
-#
-
-# default flags
-
-CFLAGS_DEFAULT = @CC_CFLAGS_DEFAULT@
-
-# Under MS-DOS do not use pipes
-# It turns out the pipes don't work with some non-gas assemblers either. :(
-# ifneq ($(RTEMS_HOST),msdos)
-# # CFLAGS_DEFAULT += -pipe
-# CFLAGS_DEFAULT +=
-# endif
-
-# Additional target names (other than debug, profile)
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O
-
-# debug flag; typically -g
-CFLAGS_DEBUG_V=@CC_CFLAGS_DEBUG_V@
-
-# when debugging, optimize flag: typically empty
-# some compilers do allow optimization with their "-g"
-CFLAGS_DEBUG_OPTIMIZE_V=
-
-# profile flag; use gprof(1)
-CFLAGS_PROFILE_V=@CC_CFLAGS_PROFILE_V@
-
-# default is to optimize
-CFLAGS_OPTIMIZE=$(CFLAGS_OPTIMIZE_V)
-
-# dynamic libraries
-CFLAGS_DYNAMIC_V=-fpic
-ASFLAGS_DYNAMIC_V=
-
-# XCFLAGS are now local flags to avoid conflict with cygnus configure
-XCFLAGS=$(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE) \
- $(CFLAGS_DEFAULT)
-
-# List of library paths without -L
-LD_PATHS=
-
-# libraries you want EVERYONE to link with
-LD_LIBS=
-
-# ld flag to ensure pure-text
-LDFLAGS_MUST_BE_PURE_V =
-
-# ld flag for [un]shared objects
-LDFLAGS_STATIC_LIBRARIES_V =
-LDFLAGS_SHARED_LIBRARIES_V =
-
-# ld flag for incomplete link
-LDFLAGS_INCOMPLETE = -r
-
-# Special linker options when building lib.so
-LDFLAGS_DYNAMIC_V = ??
-
-# Some dynamic linking systems want the preferred name recorded in the binary
-# ref: src/libxil/Makefile
-LDFLAGS_DYNAMIC_LIBNAME_V = -h $(DYNAMIC_VERSION_LIBNAME)
-
-# ld flags for profiling, debugging
-LDFLAGS_PROFILE_V = @CC_LDFLAGS_PROFILE_V@
-LDFLAGS_DEBUG_V =
-
-LDFLAGS=$(LDFLAGS_PROFILE) $(LDFLAGS_DEBUG) $(LD_PATHS:%=-L %)
-
-#
-# Stuff to clean and clobber for the compiler and its tools
-#
-
-CLEAN_CC = a.out *.o *.BAK
-CLOBBER_CC =
-
-#
-# Client compiler and support tools
-#
-
-# CC_FOR_BUILD=gcc -O
-# override CC=$(CC_FOR_BUILD)
-
-CC=@CC@
-
-# CPP command to write file to standard output
-CPP=$(CC) -E
-
-# flags set by cc when running cpp
-CPP_CC_FLAGS=-D__STDC__
-
-# egrep regexp to ignore symbol table entries in ar archives.
-# Only used to make sure we skip them when coalescing libraries.
-# skip __.SYMDEF and empty names (maybe bug in ranlib??).
-AR_SYMBOL_TABLE="HIGHLY-UNLIKELY-TO-CONFLICT"
-ARFLAGS=ruv
-
-#
-# Command to convert a normal archive to one searchable by $(LD)
-# Not needed on SVR4
-# FIXME: Should be handled by autoconf. Doesn't matter, because
-# rtems doesn't have any host-libraries until now.
-#
-
-MKLIB=echo library is complete:
-
-#
-# How to compile stuff into ${ARCH} subdirectory
-#
-# NOTE: we override COMPILE.c
-#
-
-COMPILE.c=$(CC) $(CFLAGS) $(CPPFLAGS) $(XCFLAGS) -c
-
-${ARCH}/%.o: %.c
- ${COMPILE.c} -o $@ $<
-
-${ARCH}/%.o: %.cc
- ${COMPILE.c} -o $@ $<
-
-# assembly runs gasp
-${ARCH}/%.o: %.s
- $(CPP) ${CPPFLAGS} $< | $(SED) 's/% /%/g' | $(SED) 's/^#.*//' >$(ARCH)/$*.i
- $(AS) -o $@ $(ARCH)/$*.i
- $(RM) $(ARCH)/$*.i
-
-# Link host applications.
-define make-exe
- ${CC} ${LDFLAGS} -o $@ $^ ${LD_LIBS}
-endef
-
-# Specify our own default rule for this to prevent having CFLAGS and
-# CPPFLAGS being passed to linker
-#
-# NOTE: This rule is only used as fallback for host-tool makefiles
-# which don't provide their own rule
-${ARCH}/%$(EXEEXT): ${ARCH}/%.o
- $(make-exe)
-
-# create $(ARCH)/pgm from pgm.sh
-${ARCH}/%: %.sh
- $(RM) $@
- $(CP) $< $@
- $(CHMOD) +x $@
-
-# Dependency files for use by gmake
-# NOTE: we don't put in $(TARGET_ARCH)
-# so that 'make clean' doesn't blow it away
-
-DEPEND=Depends-$(TARGET_ARCH:o-%=%)
-
-CLEAN_DEPEND=$(DEPEND).tmp
-CLOBBER_DEPEND=$(DEPEND)
-
-# We deliberately don't have anything depend on the
-# $(DEPEND) file; otherwise it will get rebuilt even
-# on 'make clean'
-#
-
-depend: $(C_FILES) $(CC_FILES) $(S_FILES)
-ifneq ($(words $(C_FILES) $(CC_FILES) $(S_FILES)), 0)
-# Use gcc -M to generate dependencies
-# Replace foo.o with $(ARCH)/foo.o
-# Replace $(ARCH) value with string $(ARCH)
-# so that it will for debug and profile cases
- $(COMPILE.c) -M $^ | \
- $(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
- -e 's?$(ARCH)/?$$(ARCH)/?' >$(DEPEND).tmp
- $(MV) $(DEPEND).tmp $(DEPEND)
-endif
-
-define make-rel
- $(LD) $(LDFLAGS_INCOMPLETE) $(XLDFLAGS) -o $@ $(OBJS)
-endef
diff --git a/make/custom/FreeBSD-posix.cfg b/make/custom/FreeBSD-posix.cfg
deleted file mode 100644
index 99225f0d9a..0000000000
--- a/make/custom/FreeBSD-posix.cfg
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# Config file for the FreeBSD 2.x based RTEMS UNIX
-#
-#
-
-RTEMS_CPU=unix
-RTEMS_CPU_FAMILY=i386
-RTEMS_CPU_MODEL=i486dx
-RTEMS_UNIX_FLAVOR=freebsd
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=posix
-TARGET_ARCH=o-freebsd2
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-# DO NOT Use the LIBC support for CYGNUS newlib
-RTEMS_USE_NEWLIB=no
-
-# RTEMS_LIBC_DIR must already be set (by configuration) DOES NOT MATTER
-LIBC_DEFINES =-D_POSIX_C_SOURCE
-LIBC_DEFINES+=-DRTEMS_UNIXLIB -DRTEMS_UNIX -DMALLOC_PROVIDED -DRTEMS_DEBUG
-
-# The following define the memory reserved in the executable for the
-# RTEMS Workspace and the C Program Heap.
-LIBC_DEFINES += -DWORKSPACE_MB=2
-LIBC_DEFINES += -DHEAPSPACE_MB=1
-
-
-# Define this to yes if C++ is included in the development environment
-# This requires that at least the GNU C++ compiler and libg++ be installed.
-ifeq ($(RTEMS_HAS_CPLUSPLUS),yes)
-HAS_CPLUSPLUS=yes
-CPLUS_LD_LIBS += $(PROJECT_RELEASE)/lib/librtems++$(LIBSUFFIX_VA)
-endif
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=yes
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This target does NOT support the POSIX API.
-HAS_POSIX_API=no
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V = -O2
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# NO_TABLE_MOVE (SPARC PORT)
-# do not have a second trap table -- use the BSP's
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-# RTEMS_UNIX (unix)
-# Define this to indicate this is an RTEMS UNIX port.
-
-define make-target-options
- echo "/* #define NDEBUG 1 */ " >>$@
- echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- echo "/* #define RTEMS_DEBUG 1 */" >>$@
- echo "#define RTEMS_UNIX 1 " >>$@
-endef
-
-define make-exe
- $(CC) $(CFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -ng $@ > $(basename $@).num
- $(SIZE) $@
-endef
-
-
-# *****************************************************************
-# Miscellaneous additions go here
diff --git a/make/custom/HPUX9-posix.cfg b/make/custom/HPUX9-posix.cfg
deleted file mode 100644
index 31f1f8e180..0000000000
--- a/make/custom/HPUX9-posix.cfg
+++ /dev/null
@@ -1,82 +0,0 @@
-#
-# Config file for HPUX running the posix bsp
-#
-# $Id$
-#
-
-# Specify here the host and target "architectures"
-HOST_ARCH=o-$(RTEMS_HOST)
-TARGET_ARCH=o-$(RTEMS_BSP)
-
-RTEMS_CPU=unix
-RTEMS_CPU_FAMILY=hppa1_1
-RTEMS_CPU_MODEL=hppa7200
-RTEMS_UNIX_FLAVOR=hpux
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=posix
-TARGET_ARCH=o-hpux9
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-# use the macros instead of the inline functions
-# The macros work better when mixed with other compilers.
-INLINE=macros
-INLINE_UPCASE=MACRO
-
-# RTEMS_LIBC_DIR must already be set (by configuration) DOES NOT MATTER
-LIBC_DEFINES=-DRTEMS_UNIXLIB -DRTEMS_UNIX -DMALLOC_PROVIDED -DRTEMS_DEBUG
-
-# The following define the memory reserved in the executable for the
-# RTEMS Workspace and the C Program Heap.
-# NOTE: some of the timing tests need > 1M workspace
-LIBC_DEFINES += -DWORKSPACE_MB=2
-LIBC_DEFINES += -DHEAPSPACE_MB=1
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=yes
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This target does NOT support the POSIX API.
-HAS_POSIX_API=no
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V = -O2
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# NO_TABLE_MOVE (SPARC PORT)
-# do not have a second trap table -- use the BSP's
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-# RTEMS_UNIX (unix)
-# Define this to indicate this is an RTEMS UNIX port.
-
-define make-target-options
- echo "/* #define NDEBUG 1 */ " >>$@
- echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- echo "/* #define RTEMS_DEBUG 1 */" >>$@
- echo "#define RTEMS_UNIX 1 " >>$@
-endef
-
-define make-exe
- $(CC) $(CFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -ng $@ > $(basename $@).num
- $(SIZE) $@
-endef
-
-# Miscellaneous additions go here
-
diff --git a/make/custom/Linux-posix.cfg b/make/custom/Linux-posix.cfg
deleted file mode 100644
index fcd9c9be5b..0000000000
--- a/make/custom/Linux-posix.cfg
+++ /dev/null
@@ -1,85 +0,0 @@
-#
-# Config file for the Linux 1.x based RTEMS UNIX
-#
-# $Id$
-#
-
-RTEMS_CPU=unix
-RTEMS_CPU_FAMILY=i386
-RTEMS_CPU_MODEL=i486dx
-RTEMS_UNIX_FLAVOR=linux
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=posix
-TARGET_ARCH=o-linux1
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-# DO NOT Use the LIBC support for CYGNUS newlib
-RTEMS_USE_NEWLIB=no
-
-# RTEMS_LIBC_DIR must already be set (by configuration) DOES NOT MATTER
-LIBC_DEFINES =-D_POSIX_C_SOURCE
-LIBC_DEFINES+=-DRTEMS_UNIXLIB -DRTEMS_UNIX -DMALLOC_PROVIDED -DRTEMS_DEBUG
-
-# The following define the memory reserved in the executable for the
-# RTEMS Workspace and the C Program Heap.
-LIBC_DEFINES += -DWORKSPACE_MB=2
-LIBC_DEFINES += -DHEAPSPACE_MB=1
-
-
-# Define this to yes if C++ is included in the development environment
-# This requires that at least the GNU C++ compiler and libg++ be installed.
-ifeq ($(RTEMS_HAS_CPLUSPLUS),yes)
-HAS_CPLUSPLUS=yes
-CPLUS_LD_LIBS += $(PROJECT_RELEASE)/lib/librtems++$(LIBSUFFIX_VA)
-endif
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=yes
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This target does NOT support the POSIX API.
-HAS_POSIX_API=no
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V = -O2
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# NO_TABLE_MOVE (SPARC PORT)
-# do not have a second trap table -- use the BSP's
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-# RTEMS_UNIX (unix)
-# Define this to indicate this is an RTEMS UNIX port.
-
-define make-target-options
- echo "/* #define NDEBUG 1 */ " >>$@
- echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- echo "/* #define RTEMS_DEBUG 1 */" >>$@
- echo "#define RTEMS_UNIX 1 " >>$@
-endef
-
-define make-exe
- $(CC) $(CFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -ng $@ > $(basename $@).num
- $(SIZE) $@
-endef
-
-
-# *****************************************************************
-# Miscellaneous additions go here
diff --git a/make/custom/Solaris-posix.cfg b/make/custom/Solaris-posix.cfg
deleted file mode 100644
index 0120081bb7..0000000000
--- a/make/custom/Solaris-posix.cfg
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# Config file for the Solaris based RTEMS UNIX
-#
-# $Id$
-#
-
-RTEMS_CPU=unix
-RTEMS_CPU_FAMILY=sparc
-RTEMS_CPU_MODEL=sparc_v8
-RTEMS_UNIX_FLAVOR=solaris
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=posix
-TARGET_ARCH=o-solaris2
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-# DO NOT Use the LIBC support for CYGNUS newlib
-RTEMS_USE_NEWLIB=no
-
-# The following define the memory reserved in the executable for the
-# RTEMS Workspace and the C Program Heap.
-LIBC_DEFINES += -DWORKSPACE_MB=2
-LIBC_DEFINES += -DHEAPSPACE_MB=1
-LIBC_DEFINES +=-DRTEMS_UNIXLIB -DRTEMS_UNIX -DMALLOC_PROVIDED -DRTEMS_DEBUG
-
-DEFINES += -D__EXTENSIONS__ -Dsolaris2
-
-# Define this to yes if C++ is included in the development environment
-# This requires that at least the GNU C++ compiler and libg++ be installed.
-ifeq ($(RTEMS_HAS_CPLUSPLUS),yes)
-HAS_CPLUSPLUS=yes
-CPLUS_LD_LIBS=$(PROJECT_RELEASE)/lib/librtems++$(LIBSUFFIX_VA)
-endif
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=yes
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This target does NOT support the POSIX API.
-HAS_POSIX_API=no
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V = -O2
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# NO_TABLE_MOVE (SPARC PORT)
-# do not have a second trap table -- use the BSP's
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-# RTEMS_UNIX (unix)
-# Define this to indicate this is an RTEMS UNIX port.
-
-define make-target-options
- echo "/* #define NDEBUG 1 */ " >>$@
- echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- echo "/* #define RTEMS_DEBUG 1 */" >>$@
- echo "#define RTEMS_UNIX 1 " >>$@
-endef
-
-define make-exe
- $(CC) $(CFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -ng $@ > $(basename $@).num
- $(SIZE) $@
-endef
-
-# *****************************************************************
-
-
-# Miscellaneous additions go here
diff --git a/make/custom/bare.cfg b/make/custom/bare.cfg
deleted file mode 100644
index 8ad849e4be..0000000000
--- a/make/custom/bare.cfg
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# Config file for the "bare" BSP
-#
-# $Id$
-#
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=bare
-
-RTEMS_BSP=bare
-
-RTEMS_CPU_MODEL=$(BARE_CPU_MODEL)
-
-TARGET_ARCH=o-$(RTEMS_BSP_FAMILY)-$(BARE_CPU_MODEL)
-
-CPU_CFLAGS=$(BARE_CPU_CFLAGS)
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# This section makes the target dependent options file.
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-# this target has no start file
-START_BASE=
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-define make-exe
- echo "Cannot do a link with the bare bsp."
- echo "#!/bin/sh" > $(basename $@).exe
- echo "echo \"Cannot do a link with the bare bsp.\"" >> $(basename $@).exe
-endef
-
-# Miscellaneous additions go here
diff --git a/make/custom/cvme961.cfg b/make/custom/cvme961.cfg
deleted file mode 100644
index a868c79964..0000000000
--- a/make/custom/cvme961.cfg
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-# Config file for the Cyclone i960ca CVME961 BSP
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=i960
-RTEMS_CPU_MODEL=i960ca
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=cvme961
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS = -mca
-
-# -pipe does not work in our local configuration of FSF GCC 2.6.0
-# configured on top of Intel Release 2.4. We did this to replace
-# the GCC 2.4.5 shipped with Intel Release 2.4.
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -mleaf-procedures
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=yes
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# NO_TABLE_MOVE (SPARC PORT)
-# do not have a second trap table -- use the BSP's
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-
-define make-exe
- $(LD) -u _sbrk $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).exe \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(NM) -g -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).exe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -g -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-endif
-
-# Miscellaneous additions go here
-
diff --git a/make/custom/default.cfg b/make/custom/default.cfg
deleted file mode 100644
index afa1779f3d..0000000000
--- a/make/custom/default.cfg
+++ /dev/null
@@ -1,79 +0,0 @@
-# Default target settings
-#
-# Some of these values are redefined in the target specific .cfg files.
-#
-# Created by Jiri Gaisler, 16-03-97 (who is owed a debt of gratitude
-# for converting RTEMS to autoconf. Thanks. --joel)
-#
-# $Id$
-#
-
-include $(PROJECT_ROOT)/make/target.cfg
-include $(PROJECT_ROOT)/make/host.cfg
-
-# Specify here the host and target "architectures"
-HOST_ARCH=o-$(RTEMS_HOST)
-ifndef TARGET_ARCH
-TARGET_ARCH=o-$(RTEMS_BSP)
-endif
-
-include $(RTEMS_ROOT)/make/main.cfg
-
-# use the inline functions instead of the macros
-# ref: src/exec/generic/Makefile
-ifeq ($(RTEMS_USE_MACROS),yes)
-INLINE=macros
-INLINE_UPCASE=
-else
-INLINE=inline
-INLINE_UPCASE=INLINE
-endif
-
-# HOST Compiler config file
-# You may also want to specify where the compiler resides here.
-CONFIG.$(HOST_ARCH).CC = $(PROJECT_ROOT)/make/compilers/gcc.cfg
-
-## Target compiler config file, if any
-CONFIG.$(TARGET_ARCH).CC = $(RTEMS_ROOT)/make/compilers/gcc-target-default.cfg
-
-## GCC specs extension file location
-RTEMS_BSP_SPECS = $(PROJECT_ROOT)/$(RTEMS_BSP)/lib/bsp_specs
-
-## LIBC support
-## Specify the one you want here and fill in the blanks.
-## Currently CYGNUS newlib is supported.
-## NOTE: RTEMS libcsupport.a includes RTEMS versions of stuff like
-## malloc, gettimeofday, etc.
-
-# Use the LIBC support for CYGNUS newlib
-# RTEMS_LIBC_DIR must already be set (by module file)
-RTEMS_USE_NEWLIB=yes
-
-# Define this to yes if C++ is included in the development environment.
-# This requires that at least the GNU C++ compiler and libg++ be installed.
-ifeq ($(RTEMS_HAS_CPLUSPLUS),yes)
-HAS_CPLUSPLUS=yes
-else
-HAS_CPLUSPLUS=no
-endif
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=no
-
-# Define this to yes if this target wants the TCP/IP stack
-ifeq ($(RTEMS_HAS_NETWORKING),yes)
-HAS_NETWORKING=yes
-else
-HAS_NETWORKING=no
-endif
-
-# Define this to yes if this target wants the posix api
-ifeq ($(RTEMS_HAS_POSIX_API),yes)
-HAS_POSIX_API=yes
-else
-HAS_POSIX_API=no
-endif
-
-# Base name of start file
-START_BASE=start
-
diff --git a/make/custom/dmv152.cfg b/make/custom/dmv152.cfg
deleted file mode 100644
index 357a84b21c..0000000000
--- a/make/custom/dmv152.cfg
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# Config file for the dmv152 BSP
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=m68k
-RTEMS_CPU_MODEL=m68020
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=dmv152
-
-#
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-
-CPU_CFLAGS =
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This section makes the target dependent options file.
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-# USE_CHANNEL_A (DMV152)
-# USE_CHANNEL_B (DMV152)
-# One and only one of these should be set to 1 to indicate which
-# serial port is used as the RTEMS console.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
- @echo "#define USE_CHANNEL_A 1" >>$@
- @echo "#define USE_CHANNEL_B 0" >>$@
-endef
-
-# Here is the rule to actually build a $(ARCH)/foo.exe
-# It also builds $(ARCH)/foo.sr and $(ARCH)/foo.nm
-# Usage ref: src/tests/sptest/sp1/Makefile
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-define make-exe
- $(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).nxe \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).nxe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-endif
-
-# Miscellaneous additions go here
diff --git a/make/custom/dmv177.cfg b/make/custom/dmv177.cfg
deleted file mode 100644
index 006f81968b..0000000000
--- a/make/custom/dmv177.cfg
+++ /dev/null
@@ -1,117 +0,0 @@
-#
-# Config file for a PowerPC 603e based DY-4 VMEbus Single Board Computer.
-# This BSP should work with the following models:
-#
-# + SVME-171/DMV-171
-# + SVME-176/DMV-176
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=powerpc
-RTEMS_CPU_MODEL=ppc603e
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=dmv177
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-# CONSOLE_USE_POLLED (psim_bsp)
-# CONSOLE_USE_INTERRUPTS (psim_bsp)
-# The psim console driver has the structure to operate in either
-# polled or interrupt mode. However both modes only trap to the
-# monitor currently.
-#
-# PPC_VECTOR_FILE_BASE (ppc)
-# This defines the base address of the exception table.
-# NOTE: Vectors are actually at 0xFFF00000 but file starts at offset 0x0100
-#
-# PPC_ABI (ppc)
-# This defines the calling convention (Application Binary Interface)
-# used in this configuration. EABI is the only one supported.
-#
-# PPC_ASM (ppc)
-# This defines the assembly language format used in this configuration.
-# ELF is the only one supported.
-#
-# PPC_USE_SPRG (RTEMS PowerPC port)
-# If defined, then the PowerPC specific code in RTEMS will use some
-# of the special purpose registers to slightly optimize interrupt
-# response time. The use of these registers can conflict with
-# other tools like debuggers.
-#
-# PPC_USE_DATA_CACHE (RTEMS PowerPC port)
-# If defined, then the PowerPC specific code in RTEMS will use
-# data cache instructions to optimize the context switch code.
-# This code can conflict with debuggers or emulators.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
- @echo "#define CONSOLE_USE_INTERRUPTS 0" >>$@
- @echo "#define CONSOLE_USE_POLLED ~CONSOLE_USE_INTERRUPTS" >>$@
- @echo "#define PPC_VECTOR_FILE_BASE 0x0100" >>$@
- @echo "#define PPC_ABI PPC_ABI_EABI" >>$@
- @echo "#define PPC_ASM PPC_ASM_ELF" >>$@
- @echo "#define PPC_USE_SPRG 0" >>$@
- @echo "#define PPC_USE_DATA_CACHE 0" >>$@
-endef
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS = -mcpu=603
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-# NOTE: some level of -O may be actually required by inline assembler
-CFLAGS_OPTIMIZE_V=-O4 -fno-keep-inline-functions
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=no
-
-# Define this to yes if this target supports a real-time clock.
-HAS_RTC=yes
-
-# The following is a ld command file which works without using the
-# -specs system in gcc 2.8. IT HAS NEVER BEEN TESTED WITH THIS BSP!!!
-# $(LD) $(XLDFLAGS) -T $(LINKCMDS) \
-# -o $@ -u atexit -u __vectors -u download_entry $(LINK_FILES)
-# $(LD) $(XLDFLAGS) -Ttext 0x20000 \
-# -o $@ -u atexit -u __vectors -u download_entry $(LINK_FILES)
-
-# $(CC) -mmvme -mrtems -nostartfiles -mcpu=603 \
-# -o $(basename $@).exe -L $(PROJECT_RELEASE)/lib \
-# $(START_FILE) $(LINK_OBJS) \
-# $(LD_LIBS) \
-# -Wl,-\( -Wl,-lc -Wl,-lrtemsall -Wl,-lgcc -Wl,-\)
-define make-exe
- $(CC) $(CFLAGS) -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS)
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
- $(STRIP) $(basename $@).nxe
-endef
-
-# Miscellaneous additions go here
-
-# No start file
-START_BASE=
-
-# Let the HWAPI know which set of drivers to build
-DRIVER_ARCHITECTURE=vmebus
diff --git a/make/custom/efi332.cfg b/make/custom/efi332.cfg
deleted file mode 100644
index e985ef14e0..0000000000
--- a/make/custom/efi332.cfg
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# Config file for the efi332 BSP
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=m68k
-RTEMS_CPU_MODEL=m68332
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=efi332
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-# XXX JRS - my gas does not grok -m68332
-#CPU_CFLAGS = -m68332
-CPU_CFLAGS = -m68020
-
-# optimize flag: typically -0, could use -O4 or -fast, -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# Override default start file
-START_BASE=start332
-
-# This section makes the target dependent options file.
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-define make-exe
- $(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).nxe \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).nxe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-endif
-
-
-# Miscellaneous additions go here
diff --git a/make/custom/efi68k.cfg b/make/custom/efi68k.cfg
deleted file mode 100644
index 0e84355337..0000000000
--- a/make/custom/efi68k.cfg
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# Config file for the efi68k BSP
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=m68k
-RTEMS_CPU_MODEL=m68000
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=efi68k
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS = -m68000 -msoft-float
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# Override default start file
-START_BASE=start68k
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-define make-exe
- $(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).nxe \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).nxe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-endif
-
-# Miscellaneous additions go here
diff --git a/make/custom/erc32.cfg b/make/custom/erc32.cfg
deleted file mode 100644
index 8fdedfedb3..0000000000
--- a/make/custom/erc32.cfg
+++ /dev/null
@@ -1,100 +0,0 @@
-#
-# Config file for the European Space Agency ERC32
-# a V7 SPARC processor derived from the Cypress 601/602 set.
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=sparc
-RTEMS_CPU_MODEL=erc32
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=erc32
-
-# The -mflat avoids the use of save/restore instructions. It has
-# a negative impact on the performance of RTEMS and should not be used.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-# -mno-v8 says not to use v8 level instructions. i.e. use v7 only
-CPU_CFLAGS = -mno-v8 -mcypress
-else
-# -mcpu=cypress says to optimize for a Cypress 60x chipset
-CPU_CFLAGS = -mcpu=cypress
-endif
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# Override default start file
-START_BASE=startsis
-
-# This makes the target dependent options file
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# NO_TABLE_MOVE (SPARC PORT)
-# do not have a second trap table -- use the BSP's
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-# CONSOLE_USE_POLLED (erc32_bsp)
-# CONSOLE_USE_INTERRUPTS (erc32_bsp)
-# The erc32 console driver can operate in either polled or interrupt mode.
-# Under the simulator (especially when FAST_UART is defined), polled seems
-# to operate better. It is common for a task to print a line (like the
-# end of test message) and then exit. In this case, the program returns
-# control to the simulator command line before the program has even queued
-# the output to the uart. Thus sis has no chance of getting the data out.
-#
-# SIMSPARC_FAST_IDLE (erc32_bsp)
-# If defined, speed up the clock ticks while the idle task is running so
-# time spent in the idle task is minimized. This significantly reduces
-# the wall time required to execute the RTEMS test suites.
-#
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
- @echo "#define NO_TABLE_MOVE 1" >>$@
- @echo "#define CONSOLE_USE_INTERRUPTS 0" >>$@
- @echo "#define CONSOLE_USE_POLLED ~CONSOLE_USE_INTERRUPTS" >>$@
- @echo "/* #define SIMSPARC_FAST_IDLE 1 */" >>$@
-endef
-
-
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-define make-exe
- $(LD) -u _sbrk $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).exe \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(NM) -g -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).exe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -g -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-endif
-# Miscellaneous additions go here
-
diff --git a/make/custom/force386.cfg b/make/custom/force386.cfg
deleted file mode 100644
index 89e7532e10..0000000000
--- a/make/custom/force386.cfg
+++ /dev/null
@@ -1,80 +0,0 @@
-#
-# Config file for the force386 BSP
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=i386
-RTEMS_CPU_MODEL=i386_fp
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=force386
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS =
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=yes
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-# Here is the rule to actually build a $(ARCH)/foo.exe
-# It also builds $(ARCH)/foo.sr and $(ARCH)/foo.nm
-# Usage ref: src/tests/sptest/sp1/Makefile
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-define make-exe
- $(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).nxe \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).nxe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-endif
-
-# Miscellaneous additions go here
-
diff --git a/make/custom/gen68302.cfg b/make/custom/gen68302.cfg
deleted file mode 100644
index b72fea3fb0..0000000000
--- a/make/custom/gen68302.cfg
+++ /dev/null
@@ -1,71 +0,0 @@
-#
-# Config file for a "generic 68302" BSP
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=m68k
-RTEMS_CPU_MODEL=m68302
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=gen68302
-
-#
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS=-m68302 -msoft-float
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-
-# override default location of Standard C Library
-LIBC_LIBC=$(RTEMS_LIBC_DIR)/lib/m68000/libc.a
-LIBC_LIBM=$(RTEMS_LIBC_DIR)/lib/m68000/libm.a
-
-define make-exe
- $(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).exe \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(NM) -g -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).exe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -g -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-endif
-# Miscellaneous additions go here
diff --git a/make/custom/gen68340.cfg b/make/custom/gen68340.cfg
deleted file mode 100644
index 826f3fc6b9..0000000000
--- a/make/custom/gen68340.cfg
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# Config file for a "generic 68340" BSP
-#
-# $Id$
-#
-
-RTEMS_CPU=m68k
-
-RTEMS_CPU_MODEL=mcpu32
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=gen68340
-
-CPU_CFLAGS = -mcpu32
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# Override default start file
-START_BASE=start340
-
-# This section makes the target dependent options file.
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# STACK_CHECKER_ON (RTEMS support code)
-# If defined, stack bounds checking is enabled.
-#
-# STACK_CHECKER_REPORT_USAGE (RTEMS support code)
-# If this and STACK_CHECKER_ON are defined, then a report on stack usage
-# per task is printed when the program exits.
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define STACK_CHECKER_ON 1 */" >>$@
- @echo "/* #define STACK_CHECKER_REPORT_USAGE 1 */" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-
-# override default location of Standard C Library
-LIBC_LIBC=$(RTEMS_LIBC_DIR)/lib/m68000/msoft-float/libc.a
-LIBC_LIBM=$(RTEMS_LIBC_DIR)/lib/m68000/msoft-float/libm.a
-
-define make-exe
- @ echo
- @ echo "WARNING: newlib may use bit test instructions!!"
- @ echo
- $(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).exe \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(NM) -g -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-else
-
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).exe $(LINK_OBJS) \
- $(LINK_LIBS)
- $(NM) -g -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
- # if you want to make a prom image
- # m68k-rtems-objcopy --adjust-section-vma \
- # .data=`m68k-rtems-objdump --section-headers $(basename $@).exe | \
- # awk 'function h2d(x) { x=toupper(x); digits=length(x); s=0 ; \
- # for (p=digits; p>0; p--) \
- # s += (16^(p-1)) * ( index("0123456789ABCDEF",\
- # substr(x,1+digits-p,1)) -1 );\
- # return s } ;\
- # /\.text/ { base = $$4 ; size = $$3 };\
- # END { printf("0x%x", h2d(base) + h2d(size)) }'\
- # ` $(basename $@).exe
- # if you want to convert it to ieee
- # m68k-rtems-objcopy --output-target=ieee --debugging \
- # $(basename $@).exe $(basename $@).ieee
-endef
-endif
-
-
-# Miscellaneous additions go here
diff --git a/make/custom/gen68360.cfg b/make/custom/gen68360.cfg
deleted file mode 100644
index ab06827625..0000000000
--- a/make/custom/gen68360.cfg
+++ /dev/null
@@ -1,95 +0,0 @@
-#
-# Config file for a "generic 68360" BSP
-#
-# $Id$
-#
-
-RTEMS_CPU=m68k
-
-ifeq ($(RTEMS_GEN68360_COMPANION_MODE),yes)
-TARGET_ARCH=o-gen68360_040
-RTEMS_CPU_MODEL=m68040
-else
-TARGET_ARCH=o-gen68360
-RTEMS_CPU_MODEL=mcpu32
-endif
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=gen68360
-
-#
-# You must use versions of gcc and gas that support the -mcpu32 option.
-#
-ifeq ($(RTEMS_GEN68360_COMPANION_MODE),yes)
-CPU_CFLAGS= -m68040
-else
-CPU_CFLAGS = -mcpu32
-endif
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# Override default start file
-START_BASE=start360
-
-# This section makes the target dependent options file.
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-
-ifeq ($(RTEMS_GEN68360_COMPANION_MODE),yes)
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-else
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
- @echo "#define RTEMS__mcpu32p__ 1" >>$@
-endef
-endif
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-
-# override default location of Standard C Library
-LIBC_LIBC=$(RTEMS_LIBC_DIR)/lib/m68000/msoft-float/libc.a
-LIBC_LIBM=$(RTEMS_LIBC_DIR)/lib/m68000/msoft-float/libm.a
-
-define make-exe
- @ echo
- @ echo "WARNING: newlib may use bit test instructions!!"
- @ echo
- $(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).exe \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(NM) -g -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-else
-
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).exe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -g -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-endif
-
-
-# Miscellaneous additions go here
diff --git a/make/custom/gen68360_040.cfg b/make/custom/gen68360_040.cfg
deleted file mode 100644
index 66c120c803..0000000000
--- a/make/custom/gen68360_040.cfg
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Configuration file for a 68040 using the 68360 in companion mode
-#
-# $Id$
-#
-
-#
-# All gen68360 configurations share the same base file, only the cpu model
-# differs.
-#
-
-RTEMS_GEN68360_COMPANION_MODE=yes
-
-include $(RTEMS_ROOT)/make/custom/gen68360.cfg
-
diff --git a/make/custom/gensh1.cfg b/make/custom/gensh1.cfg
deleted file mode 100644
index b53b3418b0..0000000000
--- a/make/custom/gensh1.cfg
+++ /dev/null
@@ -1,86 +0,0 @@
-#
-# gensh1.cfg
-#
-# default configuration for Hitachi sh1 processors
-#
-# Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-#
-# $Id$
-#
-
-MHZ:=20
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=sh
-RTEMS_CPU_MODEL=sh7032
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=gensh1
-
-#
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS=-m1
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=no
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# debug flags: typically none, but we use -O1 as it produces better code
-CFLAGS_DEBUG_V = -O1
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V = -O4
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-define make-exe
- $(LD) $(LDFLAGS) -N -e _start \
- -T$(PROJECT_RELEASE)/lib/linkcmds\
- -o $(basename $@).exe \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(NM) -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-else
-define make-exe
- $(CC) -Wl,-Map,$(basename $@).map \
- $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).exe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-endif
-
-# Miscellaneous additions go here
-
-SHGEN=$(PROJECT_ROOT)/c/src/exec/score/tools/sh/$(ARCH)/shgen
diff --git a/make/custom/go32.cfg b/make/custom/go32.cfg
deleted file mode 100644
index 0c4078368a..0000000000
--- a/make/custom/go32.cfg
+++ /dev/null
@@ -1,113 +0,0 @@
-#
-# Config file for the go32 BSP .. CPU model defaults to an i486DX
-# unless set otherwise by a custom configuration file which overrides.
-#
-# $Id$
-#
-
-# default to i486dx as cpu
-ifeq ($(RTEMS_GO32_CPU_MODEL),)
-TARGET_ARCH=o-go32
-RTEMS_CPU_MODEL=i486dx
-else
-ifeq ($(RTEMS_GO32_CPU_MODEL),pentium)
-TARGET_ARCH=o-go32_p5
-RTEMS_CPU_MODEL=pentium
-endif # pentium
-endif # i486dx
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-# Sharing a single bsp among multiple cpu models results in us having to
-# explicitly set some values normally taken care of in the defaults.cfg
-# file.
-
-RTEMS_CPU=i386
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=go32
-
-## Target compiler config file, if any
-CONFIG.$(TARGET_ARCH).CC = $(RTEMS_ROOT)/make/compilers/gcc-target-default.cfg
-
-# We may install in a CPU model based directory but this is still
-# a go32 based bsp.
-RTEMS_BSP=go32
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-# NOTE: As gcc grows to include more options, this section should also grow.
-#
-ifeq ($(RTEMS_CPU_MODEL),i486dx)
-CPU_CFLAGS = -m486
-else
-ifeq ($(RTEMS_CPU_MODEL),pentium)
-CPU_CFLAGS = -m486
-else
-CPU_CFLAGS =
-endif # pentium
-endif # i486dx
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# Base name of start file
-# go32 does not use the rtems start file
-START_BASE=
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-# Ultimately, it would be nice to do this when in a cross environment:
-# $(COFF2EXE) $(basename $@).out
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-# may need to reference libpc.a
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-define make-exe
- $(LD) $(LDFLAGS) -N -o $(basename $@).exe \
- $(shell $(CC) $(CPU_CFLAGS) -print-file-name=crt0.o) \
- $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group \
- $(shell $(CC) $(CPU_CFLAGS) -print-file-name=libcgo32.a $(GCCSED)) \
- $(shell $(CC) $(CPU_CFLAGS) -print-file-name=libpc.a $(GCCSED))
- $(NM) -g -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).exe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -g -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-
-endif
-
-
-# Miscellaneous additions go here
diff --git a/make/custom/go32_p5.cfg b/make/custom/go32_p5.cfg
deleted file mode 100644
index 45668dfaa4..0000000000
--- a/make/custom/go32_p5.cfg
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Configuration file for a Pentium using the go32 BSP
-#
-# $Id$
-#
-
-#
-# All go32 configurations share the same base file, only the cpu model
-# differs.
-#
-
-RTEMS_GO32_CPU_MODEL=pentium
-
-include $(RTEMS_ROOT)/make/custom/go32.cfg
-
diff --git a/make/custom/helas403.cfg b/make/custom/helas403.cfg
deleted file mode 100644
index 3d6f1ef27c..0000000000
--- a/make/custom/helas403.cfg
+++ /dev/null
@@ -1,110 +0,0 @@
-#
-# Config file for a PowerPC 403 based helas403 card
-#
-# $Id$
-#
-# this is derived from:
-#
-# Config file for a PowerPC 403 based papyrus card
-#
-# Id: papyrus.cfg,v 1.7 1998/06/27 17:09:47 joel Exp
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=powerpc
-RTEMS_CPU_MODEL=ppc403
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=helas403
-
-# These should be defined in targopt.h now.
-#CPU_DEFINES=-DPPC_ABI=PPC_ABI_POWEROPEN \
-# -DPPC_ASM=PPC_ASM_ELF -DPPC_VECTOR_FILE_BASE=0x0100
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-#
-# PPC_VECTOR_FILE_BASE (PowerPC)
-# This defines the base address of the exception table.
-# NOTE: Vectors are actually at 0xFFF00000 but file starts at offset 0x0100
-#
-# PPC_ABI (PowerPC)
-# This defines the calling convention (Application Binary Interface)
-# used in this configuration. EABI is the only one supported.
-# This BSP was initially developed using the PowerOpen ABI.
-#
-# PPC_ASM (PowerPC)
-# This defines the assembly language format used in this configuration.
-# ELF is the only one supported.
-#
-# PPC_USE_SPRG (RTEMS PowerPC port)
-# If defined, then the PowerPC specific code in RTEMS will use some
-# of the special purpose registers to slightly optimize interrupt
-# response time. The use of these registers can conflict with
-# other tools like debuggers.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
- @echo "#define PPC_VECTOR_FILE_BASE 0x0100" >>$@
- @echo "#define PPC_ABI PPC_ABI_EABI" >>$@
- @echo "#define PPC_ASM PPC_ASM_ELF" >>$@
- @echo "#define PPC_USE_SPRG 1" >>$@
-endef
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS = -mcpu=403
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-# NOTE: some level of -O may be actually required by inline assembler
-CFLAGS_OPTIMIZE_V=-O4 -fno-keep-inline-functions
-
-# No start file
-START_BASE=
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-# The --defsym arguments define arguments which are required by the linkcmds
-# file which is designed for gcc 2.8
-define make-exe
- $(LD) $(XLDFLAGS) -T $(LINKCMDS) \
- --defsym __fini=0 --defsym __init=0 \
- -o $@ -u atexit -u __vectors -u download_entry \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(NM) -g -n $@ > $(basename $@).num
- $(SIZE) $@
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) -o $(basename $@).exe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -g -n $@ > $(basename $@).num
- $(SIZE) $@
-endef
-endif
-
-# Miscellaneous additions go here
-
-
diff --git a/make/custom/i386ex.cfg b/make/custom/i386ex.cfg
deleted file mode 100644
index 1524e38238..0000000000
--- a/make/custom/i386ex.cfg
+++ /dev/null
@@ -1,82 +0,0 @@
-#
-# Config file for the i386ex BSP
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=i386
-RTEMS_CPU_MODEL=i386_nofp
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=i386ex
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS =
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-# Something like this should produce a map file but this does not work.
-
-# -Xlinker "-Map $(basename $@).map" $(LINK_OBJS)
-#
-# This is a good way to get debug information. The rdmp file is large
-# though (1.9 Mb for hello) and greatly slows the build process.
-# $(OBJDUMP) -x -m i386 -d $(basename $@).coff > $(basename $@).rdmp
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-define make-exe
- $(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).coff \
- -noinhibit-exec -Map $(basename $@).map \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(OBJCOPY) -O srec $(basename $@).coff $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).coff > $(basename $@).num
- $(SIZE) $(basename $@).coff
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).coff \
- $(LINK_OBJS) $(LINK_LIBS)
- $(OBJCOPY) -O srec $(basename $@).coff $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).coff > $(basename $@).num
- $(SIZE) $(basename $@).coff
-endef
-endif
-
-# Miscellaneous additions go here
-
diff --git a/make/custom/idp.cfg b/make/custom/idp.cfg
deleted file mode 100644
index 0d853906f4..0000000000
--- a/make/custom/idp.cfg
+++ /dev/null
@@ -1,77 +0,0 @@
-#
-# Config file for the IDP BSP
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=m68k
-RTEMS_CPU_MODEL=m68ec040
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=idp
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS = -msoft-float
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-
-# override default location of Standard C Library
-LIBC_LIBC=$(RTEMS_LIBC_DIR)/lib/msoft-float/libc.a
-LIBC_LIBM=$(RTEMS_LIBC_DIR)/lib/msoft-float/libm.a
-
-define make-exe
- $(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).nxe \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).nxe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-endif
-
-# Miscellaneous additions go here
diff --git a/make/custom/mvme136.cfg b/make/custom/mvme136.cfg
deleted file mode 100644
index 019ddabbb9..0000000000
--- a/make/custom/mvme136.cfg
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# Config file for the mvme136 BSP
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=m68k
-RTEMS_CPU_MODEL=m68020
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=mvme136
-
-#
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS =
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=yes
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-define make-exe
- $(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).nxe \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).nxe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-endif
-# Miscellaneous additions go here
-
-
-
diff --git a/make/custom/mvme147.cfg b/make/custom/mvme147.cfg
deleted file mode 100644
index c63fd9891c..0000000000
--- a/make/custom/mvme147.cfg
+++ /dev/null
@@ -1,71 +0,0 @@
-#
-# Config file for the mvme147 BSP
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=m68k
-RTEMS_CPU_MODEL=m68030
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=mvme147
-
-# default flags
-CPU_CFLAGS=
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-define make-exe
- $(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).nxe \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).nxe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-endif
-# Miscellaneous additions go here
-
-
diff --git a/make/custom/mvme147s.cfg b/make/custom/mvme147s.cfg
deleted file mode 100644
index 95dfa70f29..0000000000
--- a/make/custom/mvme147s.cfg
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Config file for the mvme147s BSP
-#
-# $Id$
-#
-
-#
-# mvme147s and mvme147 use the same toolset
-#
-
-include $(RTEMS_ROOT)/make/custom/mvme147.cfg
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=mvme147s
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=yes
-
-# Miscellaneous additions go here
diff --git a/make/custom/mvme162.cfg b/make/custom/mvme162.cfg
deleted file mode 100644
index 9141517008..0000000000
--- a/make/custom/mvme162.cfg
+++ /dev/null
@@ -1,109 +0,0 @@
-#
-# Config file for the mvme162 BSP
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=m68k
-
-ifeq ($(RTEMS_MVME162_MODEL),mvme162lx)
-
-TARGET_ARCH=o-mvme162lx
-RTEMS_CPU_MODEL=m68lc040
-
-else
-ifeq ($(RTEMS_MVME162_MODEL),)
-
-RTEMS_MVME162_MODEL=mvme162
-TARGET_ARCH=o-mvme162
-RTEMS_CPU_MODEL=m68040
-
-endif # mvme162 - mc68040
-endif # mvme162lx - mc68lc040
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=mvme162
-
-# We may install in a CPU model based directory but this is still
-# a mvme162 based bsp.
-RTEMS_BSP=mvme162
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-
-ifeq ($(RTEMS_CPU_MODEL),m68040)
-CPU_CFLAGS = -m68040
-else
-ifeq ($(RTEMS_CPU_MODEL),m68lc040)
-CPU_CFLAGS = -m68040 -msoft-float
-endif # mc68040
-endif # mc68lc040
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# NO_TABLE_MOVE (SPARC PORT)
-# do not have a second trap table -- use the BSP's
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-
-define make-target-options
- @echo "#undef $(RTEMS_MVME162_MODEL)" >>$@
- @echo "#define $(RTEMS_MVME162_MODEL)" >>$@
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-
-ifeq ($(RTEMS_CPU_MODEL),m68lc040)
-# override default location of Standard C Library
-LIBC_LIBC=$(RTEMS_LIBC_DIR)/lib/msoft-float/libc.a
-LIBC_LIBM=$(RTEMS_LIBC_DIR)/lib/msoft-float/libm.a
-endif # mc68lc040
-
-define make-exe
- $(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).nxe \
- $(START_FILE) $(LINK_OBJS) \
- --start-group $(LINK_LIBS) --end-group
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).nxe $(LINK_OBJS) \
- $(LINK_LIBS)
- $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
- $(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
- $(PROJECT_TOOLS)/packhex > $(basename $@).exe
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
-endef
-endif
-# Miscellaneous additions go here
diff --git a/make/custom/mvme162lx.cfg b/make/custom/mvme162lx.cfg
deleted file mode 100644
index 881df8202c..0000000000
--- a/make/custom/mvme162lx.cfg
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Configuration file for a MVME162LX
-#
-# This is an MVME162 model with ...
-#
-# $Id$
-#
-
-#
-# All mvme162 configurations share the same base file, only the cpu model
-# differs.
-#
-
-RTEMS_MVME162_MODEL=mvme162lx
-
-include $(RTEMS_ROOT)/make/custom/mvme162.cfg
-
diff --git a/make/custom/no_bsp.cfg b/make/custom/no_bsp.cfg
deleted file mode 100644
index d4ef58fad9..0000000000
--- a/make/custom/no_bsp.cfg
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Configuration file for the "no_bsp" board
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=no_cpu
-RTEMS_CPU_MODEL=no_cpu_model
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=no_bsp
-
-# Use the LIBC support for CYGNUS newlib
-# RTEMS_LIBC_DIR must already be set (by module file)
-RTEMS_USE_NEWLIB=no
-
-# Define this to yes if C++ is included in the development environment.
-# This requires that at least the GNU C++ compiler and libg++ be installed.
-#
-# Need "main" in BSP so can't link C++ sample test or you will get
-# duplicate symbol errors for main
-#
-HAS_CPLUSPLUS=no
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=yes
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# Miscellaneous additions go here
diff --git a/make/custom/ods68302.cfg b/make/custom/ods68302.cfg
deleted file mode 100644
index bb24d9b97a..0000000000
--- a/make/custom/ods68302.cfg
+++ /dev/null
@@ -1,116 +0,0 @@
-#
-# Config file for a "ODS 68302" BSP
-#
-# Differs from the gen68302 by providing most of the boot code as C
-# code. This allows separate board definitions to be based on C
-# header files. The file is based on the VARIANT defined.
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=m68k
-RTEMS_CPU_MODEL=m68302
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=ods68302
-
-#
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS=-g -m68302 -msoft-float \
- -DVARIANT=$(BSP_VARIANT) -DMC68302_BASE=$(MC68302_BASE) \
- -DRAM_BASE=$(RAM_BASE) -DRAM_SIZE=$(RAM_SIZE) \
- -DROM_BASE=$(ROM_BASE) -DROM_SIZE=$(ROM_SIZE)
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# debugging please
-CFLAGS_DEBUG_V+=-g
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# Define this to yes if C++ is included in the development environment.
-# This requires that at least the GNU C++ compiler and libg++ be installed.
-ifeq ($(RTEMS_HAS_CPLUSPLUS),yes)
-HAS_CPLUSPLUS=yes
-CPLUS_LD_LIBS=$(PROJECT_RELEASE)/lib/librtems++$(LIBSUFFIX_VA)
-endif
-
-START_BASE=start302
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "#define RTEMS_DEBUG 1" >>$@
-endef
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-
-# override default location of Standard C Library
-LIBC_LIBC=$(RTEMS_LIBC_DIR)/lib/m68000/libc.a
-LIBC_LIBM=$(RTEMS_LIBC_DIR)/lib/m68000/libm.a
-
-define make-exe
- $(LD) $(LDFLAGS) -N -Ttext $(ROM_BASE) \
- -defsym MC68302_BASE=$(MC68302_BASE) \
- -T $(LINKCMDS) -o $(basename $@).exe \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(NM) -g -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) \
- -Wl,-defsym -Wl,MC68302_BASE=$(MC68302_BASE) \
- -o $(basename $@).exe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -g -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-endif
-# Miscellaneous additions go here
-
-ifeq "$(strip $(BSP_VARIANT))" ""
-BSP_VARIANT=bare
-MC68302_BASE=0x00700000
-RAM_BASE=0x00000000
-RAM_SIZE=0x00100000
-
-ifeq ($(RTEMS_DEBUGGER),yes)
-ROM_BASE=0x00010000
-LINKCMDS=$(PROJECT_RELEASE)/lib/debugrom
-else
-ROM_BASE=0x00C00000
-LINKCMDS=$(PROJECT_RELEASE)/lib/rom
-endif
-
-ROM_SIZE=0x00100000
-
-else
-
-# pattern match the variant to set the memory map
-
-endif
diff --git a/make/custom/p4000.cfg b/make/custom/p4000.cfg
deleted file mode 100644
index d036013511..0000000000
--- a/make/custom/p4000.cfg
+++ /dev/null
@@ -1,77 +0,0 @@
-#
-# Config file for the algorithmics p4000 evaluation board
-#
-# $Id$
-#
-
-# Override default start file
-START_BASE=idt_csu
-
-CPU_DEFINES+=-DP4000 -DCPU_R4000 -DP3_DIAG -D_R4000 -D__mips=3
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=p4000
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-# WORKSPACE_MB (p4000)
-# Defines the size in Megabytes of the RTEMS Workspace.
-#
-# HEAPSPACE_MB (p4000)
-# Defines the size in Megabytes of the C Program Heap.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
- @echo "#define WORKSPACE_MB 2" >>$@
- @echo "#define HEAPSPACE_MB 1" >>$@
-endef
-
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-define make-exe
- $(CC) $(LDFLAGS) -nostdlib -o $(basename $@).exe \
- -T$(PROJECT_RELEASE)/lib/linkcmds $(LINK_OBJS) $(LINK_LIBS) $(LD_PATHS:%=-L %)
- $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec1
- $(PACKHEX) < $(basename $@).srec1 > $(basename $@).srec
- $(RM) $(basename $@).srec1
- $(NM) -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).exe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec1
- $(PACKHEX) < $(basename $@).srec1 > $(basename $@).srec
- $(RM) $(basename $@).srec1
- $(NM) -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-endif
-
-# Miscellaneous additions go here
-
diff --git a/make/custom/p4600.cfg b/make/custom/p4600.cfg
deleted file mode 100644
index 8f77c8c2af..0000000000
--- a/make/custom/p4600.cfg
+++ /dev/null
@@ -1,95 +0,0 @@
-#
-# Config file for the algorithmics p4000 evaluation board with R4600 cpu
-#
-# $Id$
-#
-
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=mips64orion
-RTEMS_CPU_MODEL=R4600
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=p4000
-
-CPU_CFLAGS=-mcpu=4600 -G0
-CCMIPS_CFLAGS_CPU=-cpu=r4600
-
-# Override default start file
-START_BASE=idt_csu
-
-CPU_DEFINES+=-DP4000 -DCPU_R4000 -DP3_DIAG -D_R4000 -D__mips=3
-
-# The p4600 and p4600 share the p4000 bsp.
-TARGET_ARCH=o-p4600
-RTEMS_BSP=p4000
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-# WORKSPACE_MB (p4000)
-# Defines the size in Megabytes of the RTEMS Workspace.
-#
-# HEAPSPACE_MB (p4000)
-# Defines the size in Megabytes of the C Program Heap.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
- @echo "#define WORKSPACE_MB 2" >>$@
- @echo "#define HEAPSPACE_MB 1" >>$@
-endef
-
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-# This rule was used in 3.6.0
-# $(CC) $(LDFLAGS) -nostdlib -o $(basename $@).exe \
-# -T$(PROJECT_RELEASE)/lib/linkcmds $(LINK_FILES) $(LD_PATHS:%=-L %)
-
-define make-exe
- $(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).exe \
- $(START_FILE) $(LINK_OBJS) \
- --start-group $(LINK_LIBS) --end-group
- $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec1
- $(PACKHEX) < $(basename $@).srec1 > $(basename $@).srec
- $(RM) $(basename $@).srec1
- $(NM) -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).exe $(LINK_OBJS) \
- $(LINK_LIBS)
- $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec1
- $(PACKHEX) < $(basename $@).srec1 > $(basename $@).srec
- $(RM) $(basename $@).srec1
- $(NM) -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-endif
-
-# Miscellaneous additions go here
-
diff --git a/make/custom/p4650.cfg b/make/custom/p4650.cfg
deleted file mode 100644
index d076faa6ec..0000000000
--- a/make/custom/p4650.cfg
+++ /dev/null
@@ -1,93 +0,0 @@
-#
-# Config file for the algorithmics p4000 evaluation board with R4650 cpu
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=mips64orion
-RTEMS_CPU_MODEL=R4650
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=p4000
-
-CPU_CFLAGS=-m4650 -G0
-CCMIPS_CFLAGS_CPU=-cpu=r4650
-
-# Override default start file
-START_BASE=idt_csu
-
-CPU_DEFINES+=-DP4000 -DCPU_R4000 -DP3_DIAG -D_R4000 -D__mips=3
-
-# The p4600 and p4600 share the p4000 bsp.
-TARGET_ARCH=o-p4650
-RTEMS_BSP=p4000
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-# WORKSPACE_MB (p4000)
-# Defines the size in Megabytes of the RTEMS Workspace.
-#
-# HEAPSPACE_MB (p4000)
-# Defines the size in Megabytes of the C Program Heap.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
- @echo "#define WORKSPACE_MB 2" >>$@
- @echo "#define HEAPSPACE_MB 1" >>$@
-endef
-
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-# This rule was used in 3.6.0
-# $(CC) $(LDFLAGS) -nostdlib -o $(basename $@).exe \
-# -T$(PROJECT_RELEASE)/lib/linkcmds $(LINK_FILES) $(LD_PATHS:%=-L %)
-
-define make-exe
- $(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).exe \
- $(START_FILE) $(LINK_OBJS) \
- --start-group $(LINK_LIBS) --end-group $(LD_LIBS)
- $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec1
- $(PACKHEX) < $(basename $@).srec1 > $(basename $@).srec
- $(RM) $(basename $@).srec1
- $(NM) -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).exe \
- $(LINK_OBJS) $(LINK_LIBS) $(LD_LIBS)
- $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec1
- $(PACKHEX) < $(basename $@).srec1 > $(basename $@).srec
- $(RM) $(basename $@).srec1
- $(NM) -n $(basename $@).exe > $(basename $@).num
- $(SIZE) $(basename $@).exe
-endef
-endif
-
-# Miscellaneous additions go here
diff --git a/make/custom/papyrus.cfg b/make/custom/papyrus.cfg
deleted file mode 100644
index 9086732cf8..0000000000
--- a/make/custom/papyrus.cfg
+++ /dev/null
@@ -1,104 +0,0 @@
-#
-# Config file for a PowerPC 403 based papyrus card
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=powerpc
-RTEMS_CPU_MODEL=ppc403
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=papyrus
-
-# These should be defined in targopt.h now.
-#CPU_DEFINES=-DPPC_ABI=PPC_ABI_POWEROPEN \
-# -DPPC_ASM=PPC_ASM_ELF -DPPC_VECTOR_FILE_BASE=0x0100
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-#
-# PPC_VECTOR_FILE_BASE (PowerPC)
-# This defines the base address of the exception table.
-# NOTE: Vectors are actually at 0xFFF00000 but file starts at offset 0x0100
-#
-# PPC_ABI (PowerPC)
-# This defines the calling convention (Application Binary Interface)
-# used in this configuration. EABI is the only one supported.
-# This BSP was initially developed using the PowerOpen ABI.
-#
-# PPC_ASM (PowerPC)
-# This defines the assembly language format used in this configuration.
-# ELF is the only one supported.
-#
-# PPC_USE_SPRG (RTEMS PowerPC port)
-# If defined, then the PowerPC specific code in RTEMS will use some
-# of the special purpose registers to slightly optimize interrupt
-# response time. The use of these registers can conflict with
-# other tools like debuggers.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
- @echo "#define PPC_VECTOR_FILE_BASE 0x0100" >>$@
- @echo "#define PPC_ABI PPC_ABI_EABI" >>$@
- @echo "#define PPC_ASM PPC_ASM_ELF" >>$@
- @echo "#define PPC_USE_SPRG 1" >>$@
-endef
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS = -mcpu=403
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-# NOTE: some level of -O may be actually required by inline assembler
-CFLAGS_OPTIMIZE_V=-O4 -fno-keep-inline-functions
-
-# No start file
-START_BASE=
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-# The --defsym arguments define arguments which are required by the linkcmds
-# file which is designed for gcc 2.8
-define make-exe
- $(LD) $(XLDFLAGS) -T $(LINKCMDS) \
- --defsym __fini=0 --defsym __init=0 \
- -o $@ -u atexit -u __vectors -u download_entry \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(NM) -g -n $@ > $(basename $@).num
- $(SIZE) $@
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) -o $(basename $@).exe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -g -n $@ > $(basename $@).num
- $(SIZE) $@
-endef
-endif
-
-# Miscellaneous additions go here
-
-
diff --git a/make/custom/pc386.cfg b/make/custom/pc386.cfg
deleted file mode 100644
index 50689fce06..0000000000
--- a/make/custom/pc386.cfg
+++ /dev/null
@@ -1,107 +0,0 @@
-#
-# Config file for the PC 386 BSP
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=i386
-RTEMS_CPU_MODEL=i386_fp
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=pc386
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS =
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=no
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "/* #define RTEMS_TEST_NO_PAUSE 1 */" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
-endef
-
-# Here is the rule to actually build a $(ARCH)/foo.exe
-# It also builds $(ARCH)/foo.sr and $(ARCH)/foo.nm
-# Usage ref: src/tests/sptest/sp1/Makefile
-
-#+--------------------------------------------------------------------------+
-#| Set the value of RELOCADDR to the address where you want your image to
-#| load. If you'll be using GRUB to load the images it will have to be >=
-#| 0x100000 (1024K). If you are using NetBoot to load the images it can be
-#| >= 0x10000 (64K) AND <= 0x97C00 (607K) OR >= 0x100000 (1024K). The memory
-#| top is of course another limit. Make sure there is enough space before the
-#| upper memory limits for the image and the memory allocated by it to fit.
-#| Make sure the value you choose is aligned to 4 bytes.
-#+--------------------------------------------------------------------------+
- RELOCADDR=0x00100000
-
-START16FILE=$(PROJECT_RELEASE)/lib/start16.bin
-START16ADDR=0x00097C00
-HEADERADDR=0x00097E00
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-define make-exe
- $(LD) -N -T $(LINKCMDS) -Ttext $(RELOCADDR) -e start -nostdlib \
- -o $(basename $@).obj \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(OBJCOPY) -O a.out-i386 \
- --remove-section=.rodata \
- --remove-section=.comment \
- --remove-section=.note \
- --strip-unneeded $(basename $@).obj $@
- $(OBJCOPY) -O binary $(basename $@).obj $(basename $@).bin
- $(PROJECT_TOOLS)/bin2boot -v $(basename $@).bt $(HEADERADDR)\
- $(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0
- $(NM) -g -n $(basename $@).obj > $(basename $@).num
- $(SIZE) $(basename $@).obj
- $(INSTALL_VARIANT) -m 555 $(basename $@).bt ${PROJECT_RELEASE}/BootImgs
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) -Wl,-Ttext,$(RELOCADDR) \
- -Wl,--oformat,elf32-i386 -o $(basename $@).obj \
- -o $(basename $@).obj \
- $(LINK_OBJS) $(LINK_LIBS)
- $(OBJCOPY) -O a.out-i386 \
- --remove-section=.rodata \
- --remove-section=.comment \
- --remove-section=.note \
- --strip-unneeded $(basename $@).obj $@
- $(OBJCOPY) -O binary $(basename $@).obj $(basename $@).bin
- $(PROJECT_TOOLS)/bin2boot -v $(basename $@).bt $(HEADERADDR)\
- $(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0
- $(NM) -g -n $(basename $@).obj > $(basename $@).num
- $(SIZE) $(basename $@).obj
- $(INSTALL_VARIANT) -m 555 $(basename $@).bt ${PROJECT_RELEASE}/BootImgs
- $(CC) $(CFLAGS) $(CFLAGS_LD) -Wl,-Ttext,$(RELOCADDR) \
- -o $(basename $@).coff $(LINK_OBJS) $(LINK_LIBS)
-endef
-endif
-
-# Miscellaneous additions go here
diff --git a/make/custom/portsw.cfg b/make/custom/portsw.cfg
deleted file mode 100644
index e083530894..0000000000
--- a/make/custom/portsw.cfg
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# Custom file for "portsw" -- AMD 29205 based board
-#
-# $Id$
-#
-
-# Specify here the host and target "architectures"
-HOST_ARCH=o-$(RTEMS_HOST)
-TARGET_ARCH=o-$(RTEMS_BSP)
-
-RTEMS_CPU=a29k
-RTEMS_CPU_MODEL=a29205
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=portsw
-
-# use the inline functions instead of the macros
-# ref: src/exec/generic/Makefile
-# Need INLINE_UPCASE set to uppercase value of INLINE variable
-# ref: make/compilers/gcc-force386.cfg
-INLINE=macros
-INLINE_UPCASE=
-
-# The makefiles all use PROJECT_xxx for variables.
-# Ie: $(PROJECT_RELEASE) is the install point.
-# Externally, we think of these as "RTEMS" variables.
-# Here is where we convert from RTEMS forms to PROJECT forms
-# See also make/main.cfg, which derives some more.
-PROJECT_ROOT=$(RTEMS_ROOT)/c
-
-# HOST Compiler config file
-# You may also want to specify where the compiler resides here.
-CC_$(HOST_ARCH)_DIR=$(RTEMS_GNUTOOLS_HOST)
-CONFIG.$(HOST_ARCH).CC = $(RTEMS_ROOT)/make/compilers/gcc.cfg
-
-## Target compiler config file, if any
-CC_$(TARGET_ARCH)_DIR=$(RTEMS_GNUTOOLS)
-CONFIG.$(TARGET_ARCH).CC = $(RTEMS_ROOT)/make/compilers/gcc-$(RTEMS_BSP).cfg
-
-# Use the LIBC support for CYGNUS newlib
-# RTEMS_LIBC_DIR must already be set (by module file)
-RTEMS_USE_NEWLIB=yes
-
-# Define this to yes if C++ is included in the development environment.
-# This requires that at least the GNU C++ compiler and libg++ be installed.
-#
-# Need "main" in BSP so can't link C++ sample test or you will get
-# duplicate symbol errors for main
-#
-HAS_CPLUSPLUS=no
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=no
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# Define this to yes if this target wants the posix api
-HAS_POSIX_API=no
-
-# Miscellaneous additions go here
diff --git a/make/custom/posix.cfg b/make/custom/posix.cfg
deleted file mode 100644
index 720b5a2932..0000000000
--- a/make/custom/posix.cfg
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Config file for the posix based RTEMS
-#
-# $Id$
-#
-
-include $(PROJECT_ROOT)/make/target.cfg
-include $(PROJECT_ROOT)/make/host.cfg
-
-# Set them here, otherwise gcc-target-default.cfg will set them to values
-# not working on some os variants (linux-RH5.0, glibc versions 2.0.0 - 2.0.7)
-# These should be available on all unices
-LIBC_LIBC=-lc
-LIBC_LIBM=-lm
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_HOST)-posix.cfg
-
-# Not applicable - let's override 'em
-LINKCMDS=
-START_FILE=
-START_BASE=
-
-# Here is the rule to actually build a $(ARCH)/foo.exe
-# It also builds $(ARCH)/foo.sr and $(ARCH)/foo.nm
-# Usage ref: src/tests/sptest/sp1/Makefile
-#
-# 'NODE' is set to 1 or 2 for multi cpu tests (ref: mptests/mp01/node1/Makefile)
-# If NODE is set as an environment variable, don't trust it, zero it out.
-# (NODE turns out to be a very common environment variable)
-ifeq (,$(NODE))
-NODE=0
-else
-ifeq "$(origin NODE)" "environment"
-NODE=0
-endif
-endif
-
diff --git a/make/custom/psim.cfg b/make/custom/psim.cfg
deleted file mode 100644
index 9a6ce2e5aa..0000000000
--- a/make/custom/psim.cfg
+++ /dev/null
@@ -1,118 +0,0 @@
-#
-# Config file for the PowerPC 60x simulator - psim
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=powerpc
-RTEMS_CPU_MODEL=ppc603e
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=psim
-
-# This section makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-# CONSOLE_USE_POLLED (psim_bsp)
-# CONSOLE_USE_INTERRUPTS (psim_bsp)
-# The psim console driver has the structure to operate in either
-# polled or interrupt mode. However both modes only trap to the
-# monitor currently.
-#
-# PSIM_FAST_IDLE (psim_bsp)
-# If defined, speed up the clock ticks while the idle task is running so
-# time spent in the idle task is minimized. This significantly reduces
-# the wall time required to execute the RTEMS test suites.
-#
-# PPC_VECTOR_FILE_BASE (PowerPC)
-# This defines the base address of the exception table.
-# NOTE: Vectors are actually at 0xFFF00000 but file starts at offset 0x0100
-#
-# PPC_ABI (PowerPC)
-# This defines the calling convention (Application Binary Interface)
-# used in this configuration. EABI is the only one supported.
-#
-# PPC_ASM (PowerPC)
-# This defines the assembly language format used in this configuration.
-# ELF is the only one supported.
-#
-# PPC_USE_SPRG (RTEMS PowerPC port)
-# If defined, then the PowerPC specific code in RTEMS will use some
-# of the special purpose registers to slightly optimize interrupt
-# response time. The use of these registers can conflict with
-# other tools like debuggers.
-
-
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
- @echo "#define CONSOLE_USE_INTERRUPTS 0" >>$@
- @echo "#define CONSOLE_USE_POLLED ~CONSOLE_USE_INTERRUPTS" >>$@
- @echo "#define PSIM_FAST_IDLE 1" >>$@
- @echo "#define PPC_VECTOR_FILE_BASE 0xFFF00100" >>$@
- @echo "#define PPC_ABI PPC_ABI_EABI" >>$@
- @echo "#define PPC_ASM PPC_ASM_ELF" >>$@
- @echo "#define PPC_USE_SPRG 1" >>$@
-endef
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS = -mcpu=603
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-# NOTE: some level of -O may be actually required by inline assembler
-CFLAGS_OPTIMIZE_V=-O4 -fno-keep-inline-functions
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=no
-
-# This target does not support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# The following is a linkcmds file which will work without using the
-# -specs system in gcc 2.8.
-# $(LD) $(XLDFLAGS) -T $(LINKCMDS) \
-# -o $@ -u atexit -u __vectors -u download_entry $(LINK_FILES)
-# $(LD) $(XLDFLAGS) -Ttext 0x20000 \
-# -o $@ -u atexit -u __vectors -u download_entry $(LINK_FILES)
-
-# $(CC) -mmvme -mrtems -nostartfiles -mcpu=603 \
-# -o $(basename $@).exe -L $(PROJECT_RELEASE)/lib \
-# $(START_FILE) $(LINK_OBJS) \
-# $(LD_LIBS) \
-# -Wl,-\( -Wl,-lc -Wl,-lrtemsall -Wl,-lgcc -Wl,-\)
-ifeq ($(RTEMS_USE_GCC272),yes)
-define make-exe
- $(CC) $(CFLAGS) -o $(basename $@).exe $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -g -n $@ > $(basename $@).num
- $(SIZE) $@
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) -o $(basename $@).exe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -g -n $@ > $(basename $@).num
- $(SIZE) $@
-endef
-endif
-
-# Miscellaneous additions go here
-
-# No start file
-START_BASE=
diff --git a/make/custom/simhppa.cfg b/make/custom/simhppa.cfg
deleted file mode 100644
index 6a7f022336..0000000000
--- a/make/custom/simhppa.cfg
+++ /dev/null
@@ -1,137 +0,0 @@
-#
-# Config file for the 7100 pa-risc simulator
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=hppa1.1
-RTEMS_CPU_MODEL=hppa7200
-
-# This is the actual bsp directory used during the build process.
-RTEMS_BSP_FAMILY=simhppa
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-# Possibles:
-# -mpa-risc-1-1 -- HPPA 1.1 instead of 1.0
-# -mportable-runtime
-#
-CPU_CFLAGS = -mpa-risc-1-1 -mportable-runtime
-
-# Possibles:
-# -Wall -- lots of warnings
-# -pipe -- compiler uses pipes to talk to phases (usually faster)
-# -ansi -- ANSI C compliance
-# -fasm -- ANSI, but allow inline assembler
-# -mgas -- we are using gas as assembler
-# -fno-keep-inline-functions -- do not emit any inlines as static
-CFLAGS_DEFAULT = $(CPU_CFLAGS) -Wall -ansi -fasm -mgas
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-# NOTE: some level of -O may be actually required by inline assembler
-CFLAGS_OPTIMIZE_V=-O4 -fno-keep-inline-functions
-
-# Define this to yes if this target supports multiprocessor environments.
-HAS_MP=yes
-
-# This target does NOT support the TCP/IP stack so ignore requests
-# to enable it.
-HAS_NETWORKING=no
-
-# This makes the target dependent options file.
-
-# NDEBUG (C library)
-# if defined asserts do not generate code. This is commonly used
-# as a command line option.
-#
-# RTEMS_TEST_NO_PAUSE (RTEMS tests)
-# do not pause between screens of output in the rtems tests
-#
-# RTEMS_DEBUG (RTEMS)
-# If defined, debug checks in RTEMS and support library code are enabled.
-#
-# SIMHPPA_FAST_IDLE (simhppa)
-# If defined, speed up the clock ticks while the idle task is running so
-# time spent in the idle task is minimized. This significantly reduces
-# the wall time required to execute the RTEMS test suites.
-#
-
-define make-target-options
- @echo "/* #define NDEBUG 1 */ " >>$@
- @echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
- @echo "/* #define RTEMS_DEBUG 1 */" >>$@
- @echo "#define SIMHPPA_FAST_IDLE 1 " >>$@
-endef
-
-#
-# GNU ld options
-# `-Tbss ORG'
-# `-Tdata ORG'
-# `-Ttext ORG'
-# Use ORG as the starting address for--respectively--the `bss',
-# `data', or the `text' segment of the output file. ORG must be a
-# single hexadecimal integer; for compatibility with other linkers,
-# you may omit the leading `0x' usually associated with hexadecimal
-# values.
-
-# 'NODE' is set to 1 or 2 for multi cpu tests (ref: mptests/mp01/node1/Makefile)
-# If NODE is set as an environment variable, don't trust it, zero it out.
-# (NODE turns out to be a very common environment variable)
-ifeq (,$(NODE))
-NODE=0
-else
-ifeq "$(origin NODE)" "environment"
-NODE=0
-endif
-endif
-
-# XXX some/all of this should move into 'linkcmds'
-# single processor
-DATA_0_BASE=0x40001000
-TEXT_0_BASE=0x00001000
-
-# first node (mptests number them from 1)
-DATA_1_BASE=$(DATA_0_BASE)
-TEXT_1_BASE=$(TEXT_0_BASE)
-
-# second node (mptests number them from 1)
-DATA_2_BASE=0x48001000
-TEXT_2_BASE=0x08001000
-
-# for hpux ld
-#LD_LOC_OPTIONS=-D $(DATA_$(NODE)_BASE) -R $(TEXT_$(NODE)_BASE)
-# for gnu ld
-LD_LOC_OPTIONS=-Tdata $(DATA_$(NODE)_BASE) -Ttext $(TEXT_$(NODE)_BASE)
-GCC_LD_LOC_OPTIONS=-W,l-T -W,ldata -W,l$(DATA_$(NODE)_BASE) \
- -W,l-T -W,ltext -W,l$(TEXT_$(NODE)_BASE)
-
-
-# The following are definitions of make-exe which will work using ld as
-# is currently required. It is expected that as of gcc 2.8, the end user
-# will be able to override parts of the compilers specs and link using gcc.
-
-ifeq ($(RTEMS_USE_GCC272),yes)
-define make-exe
- $(LDARGS) $(LD) $(LD_LOC_OPTIONS) $(XLDFLAGS) -a archive \
- -o $@ -u atexit \
- $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
- $(NM) -g -n $@ > $(basename $@).num
- $(SIZE) $@
-endef
-else
-define make-exe
- $(CC) $(CFLAGS) $(CFLAGS_LD) $(GCC_LD_LOC_OPTIONS) \
- -o $(basename $@).exe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(NM) -g -n $@ > $(basename $@).num
- $(SIZE) $@
-endef
-endif
-
-define make-rel
- $(LDARGS) $(LD) $(LDFLAGS_INCOMPLETE) $(XLDFLAGS) -o $@ $(OBJS)
-endef
diff --git a/make/directory.cfg b/make/directory.cfg
deleted file mode 100644
index 68b68d79e0..0000000000
--- a/make/directory.cfg
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# $Id$
-#
-# make/directory.cfg
-#
-# Make(1) configuration file include'd by all directory-level Makefile's.
-#
-# See also make/main.cfg
-#
-
-# include $(RTEMS_ROOT)/make/main.cfg
-
-# on a 'make -k' we don't want to bomb out of directory list
-EXIT_CMD=exit 1
-ifeq (k, $(findstring k, $(MAKEFLAGS)))
-EXIT_CMD=true
-endif
-
-RULE=$(shell echo $@ | $(SED) -e s/debug_// -e s/profile_//)
-
-ifeq ($(RTEMS_USE_OWN_PDIR),yes)
-$(RECURSE_TARGETS):
- @$(ECHO); \
- BASEDIR=`pwd`; \
- test -d $$BASEDIR || $(EXIT_CMD) ; \
- for subd in $(SUB_DIRS) xxx; \
- do if [ $$subd != xxx ] ; then \
- cd $$BASEDIR; \
- if [ ! -d $$subd ] ; then \
- $(ECHO) "*** ERROR -- Directory ($$subd) does not exist!!!"; \
- $(EXIT_CMD) ; \
- fi ; \
- $(ECHO); \
- $(ECHO) "*** $$BASEDIR/$$subd ($@)" ; \
- cmd="cd $$subd; $(MAKE) $(RULE)"; \
- $(ECHO) $$cmd; \
- eval $$cmd || $(EXIT_CMD); \
- fi; done; \
- $(ECHO); \
- $(ECHO) "*** $$BASEDIR/$@ ($@) Finished."; \
- $(ECHO)
- $($@_WRAPUP)
-else
-ifdef RECURSE_TARGETS
-$(RECURSE_TARGETS):
- @$(ECHO) ; set -e ; \
- if [ "$(SUB_DIRS)" != "" ] ; then \
- sdirs="$(SUB_DIRS)" ; \
- else \
- sdirs="xxx" ; \
- fi ; \
- if [ "$$sdirs" != "xxx" ] ; then \
- for subd in $$sdirs; do $(MAKE) -w -C $$subd $(RULE); done ;\
- fi
-endif
-endif
-
diff --git a/make/host.cfg.in b/make/host.cfg.in
deleted file mode 100644
index 0c8f9cf408..0000000000
--- a/make/host.cfg.in
+++ /dev/null
@@ -1,74 +0,0 @@
-#
-# $Id$
-#
-# OS-specific configuration
-#
-# Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de) 97/11/08
-#
-# Derived from rtems/c/make/os/*.cfg in previous RTEMS version.
-#
-
-RTEMS_HOST = @RTEMS_HOST@
-
-#
-# Stuff to clean and clobber for the OS
-#
-
-CLEAN_OS =
-CLOBBER_OS = *~ *.bak TAGS tags
-
-SHELL=/bin/sh
-ECHO=echo
-
-CAT=@CAT@
-RM=@RM@ -f
-CP=@CP@
-MV=@MV@
-LN=@LN@
-MKDIR=@MKDIR@
-CHMOD=@CHMOD@
-SED=@SED@
-M4=@M4@
-
-INSTALL=$(PROJECT_TOOLS)/install-if-change
-INSTALL_VARIANT=$(PROJECT_TOOLS)/install-if-change -V "$(LIB_VARIANT)"
-
-# FIXME: HACK for a bug in cygwin-hosted egcs which returns a mixture
-# of '\\' and '/' as path separators.
-# Should be removed as soon as this bug is fixed in egcs.
-GCCSED = @GCCSED@
-
-# ksh (or bash) is used by some shell scripts; ref build-tools/scripts/Makefile
-#
-# Must have shell functions. Some ksh's core dump mysteriously and
-# unreliably on RTEMS shell scripts. bash appears to be the most
-# reliable but late model ksh's are usually OK.
-KSH=@KSH@
-
-#
-# RCS support
-#
-RCS_CLEAN=$(PROJECT_TOOLS)/rcs-clean
-
-#
-# Rule to install a shell script with the proper shell to run it.
-#
-
-# when debugging, one may want to save the previous incarnation of the
-# installed script. Replace the first line of this rule to do this.
-#
-# -$(RM) $@.old
-# -$(MV) $@ $@.old >/dev/null 2>&1
-
-define make-script
- -$(RM) $@
- $(SED) -e '1,1s?^#!KSHELL?#!$(KSH)?' \
- -e '1,1s?^#!SHELL?#!$(SHELL)?' < $< > $@
- $(CHMOD) 0555 $@
-endef
-
-INSTBINFLAGS = -m 0755
-INSTDATAFLAGS = -m 0644
-INSTLIBFLAGS = -m 0644
-INSTDIRFLAGS = -m 0755 -d
-INSTINCFLAGS = -m 0644
diff --git a/make/leaf.cfg b/make/leaf.cfg
deleted file mode 100644
index 0553cefdf2..0000000000
--- a/make/leaf.cfg
+++ /dev/null
@@ -1,183 +0,0 @@
-#
-# $Id$
-#
-# make/leaf.cfg
-#
-# Make(1) configuration file include'd by all leaf-node Makefiles
-#
-
-# get most stuff done
-
-# include $(RTEMS_ROOT)/make/main.cfg
-
-#
-# list of all known managers
-# This list is used, along with $(MANAGERS) (set by app makefile)
-# to build the list of *not wanted* drivers.
-#
-# ref: target compiler config file for usage
-#
-
-MANAGER_LIST=dpmem event io msg mp part region sem signal timer rtmon ext
-
-# Convert *real* spellings in $(MANAGERS) (set
-# in application makefile) to their "correct" name.
-# (I hate abbreviations :-)
-
-MANAGERS := $(patsubst message, msg, $(MANAGERS))
-MANAGERS := $(patsubst multi_processor, mp, $(MANAGERS))
-MANAGERS := $(patsubst partition, part, $(MANAGERS))
-MANAGERS := $(patsubst rate_monotonic, rtmon, $(MANAGERS))
-MANAGERS := $(patsubst semaphore, sem, $(MANAGERS))
-MANAGERS := $(patsubst dual_ported_memory, dpmem, $(MANAGERS))
-MANAGERS := $(patsubst extension, ext, $(MANAGERS))
-
-# allow 'all' to mean all managers
-MANAGERS := $(patsubst all, $(MANAGER_LIST), $(MANAGERS))
-
-# and finally rip out duplicates
-MANAGERS := $(sort $(MANAGERS))
-
-# Pull in the desired compiler
-# This is almost always the "target" compiler.
-# But sometimes, you have to build something on the host.
-# Allow for that by allowing individual Makefiles specify $(USE_HOST_COMPILER)
-# This will not change $(ARCH) -- binaries will still be place as per target
-ifeq (,$(USE_HOST_COMPILER))
- include ${CONFIG.$(TARGET_ARCH).CC}
-else
- include $(CONFIG.$(HOST_ARCH).CC)
-endif
-ifeq (${DEPEND},$(wildcard ${DEPEND}))
-include ${DEPEND} # pull in dependencies if they exist
-endif
-
-#
-# Builtin targets for compilation variants
-#
-debug debug_install:
- $(MAKE) -f $(MAKEFILE) MAKEFILE=$(MAKEFILE) "ARCH=${TARGET_ARCH}-debug" \
- "CFLAGS_DEBUG=$(CFLAGS_DEBUG_V)" \
- "CFLAGS_OPTIMIZE=$(CFLAGS_DEBUG_OPTIMIZE_V)" \
- "LDFLAGS_DEBUG=$(LDFLAGS_DEBUG_V)" $(TARGET_VA)
-
-profile profile_install:
- $(MAKE) -f $(MAKEFILE) \
- MAKEFILE=$(MAKEFILE) "ARCH=${TARGET_ARCH}-profile" \
- "CFLAGS_PROFILE=$(CFLAGS_PROFILE_V)" \
- "LDFLAGS_PROFILE=$(LDFLAGS_PROFILE_V)" $(TARGET_VA)
-
-#
-# VARIANT_VA will convert our ${ARCH} back into "" or "debug" or "profile".
-# Handy when one makefile wants to hop over into a peer's tree and
-# build something "the same" way.
-#
-
-VARIANT-$(TARGET_ARCH)-v =
-VARIANT-$(TARGET_ARCH)-debug-v = debug
-VARIANT-$(TARGET_ARCH)-profile-v = profile
-
-VARIANT_VA = $(VARIANT-$(ARCH)-v)
-
-#
-# TARGET_VA will convert $@ (expected to be 'debug' or
-# 'debug_install' or 'profile' etc.)
-# into "" or "install" as appropriate.
-# Used for variant recursion.
-#
-
-TARGET_debug_V = all
-TARGET_profile_V = all
-
-TARGET_debug_install_V = install
-TARGET_profile_install_V = install
-
-TARGET_VA = $(TARGET_$@_V)
-
-#
-# LIBSUFFIX_VA, will "index" into LIBSUFF-*-v macros and
-# convert our ${ARCH} back into .a or _g.a or _p.a based on debug or profile.
-# Useful for installing libraries.
-#
-
-LIBSUFFIX_$(TARGET_ARCH)_V=
-LIBSUFFIX_$(TARGET_ARCH)-debug_V=_g
-LIBSUFFIX_$(TARGET_ARCH)-profile_V=_p
-
-LIB_VARIANT=$(LIBSUFFIX_$(ARCH)_V)
-LIBSUFFIX_VA = $(LIB_VARIANT).a
-
-get: $(SRCS) $(GET_ADDITIONS)
-
-#
-# Builtin clean and clobber rules
-# Individual makefiles can add stuff via CLEAN_ADDITIONS and CLOBBER_ADDITIONS
-# If desperate to save something, they can override CLEAN_OS, CLEAN_CC, etc.
-#
-
-clean:
- $(RM) -r a.out core mon.out gmon.out $(CLEAN_OS) $(CLEAN_CC)
- $(RM) -r $(CLEAN_PROTO) $(CLEAN_DEPEND) a.out
- $(RM) -r $(VARIANTS) $(CLEAN_ADDITIONS) $(IMPORT_SOURCE)
-
-clobber: clean
- -$(RCS_CLEAN)
- $(RM) .#*
- $(RM) -r $(CLOBBER_OS) $(CLOBBER_CC) $(CLOBBER_DEPEND)
- $(RM) -r $(CLOBBER_ADDITIONS) a.out
-
-# Until RTEMS_CPU is removed from all the make configuration files,
-# this will need to be here to transform hppa1.1 into hppa1_1 to
-# make it a valid cpp symbol. At some point in the near future,
-# targopts.h should not define RTEMS_CPU. As best I can tell,
-# gcc cpp predefines eliminate the need for RTEMS_CPU_MODEL
-# on some families but not on others. For example, the i386
-# family does not give us enough information from the predefines.
-RTEMS_CPU_DEFINED=$(subst .,_,$(RTEMS_CPU))
-
-# make the target dependent options file
-$(ARCH)/targopts.h-tmp: FORCE
- @echo "/* target board dependent options file */" >$@
- @echo "/* automatically generated -- DO NOT EDIT!! */" >>$@
- @echo >>$@
- @echo "#ifndef __TARGET_OPTIONS_h" >>$@
- @echo "#define __TARGET_OPTIONS_h" >>$@
- @echo >>$@
- @echo "#ifdef $(RTEMS_CPU_DEFINED)" >>$@
- @echo "#undef $(RTEMS_CPU_DEFINED)" >>$@
- @echo "#endif" >>$@
- @echo "#define $(RTEMS_CPU_DEFINED) 1" >>$@
- @echo >>$@
- @echo "#ifdef $(RTEMS_CPU_MODEL)" >>$@
- @echo "#undef $(RTEMS_CPU_MODEL)" >>$@
- @echo "#endif" >>$@
- @echo "#define $(RTEMS_CPU_MODEL) 1" >>$@
- @echo >>$@
- @echo "#ifdef $(RTEMS_BSP)" >>$@
- @echo "#undef $(RTEMS_BSP)" >>$@
- @echo "#endif" >>$@
- @echo "#define $(RTEMS_BSP) 1" >>$@
- @echo >>$@
- @$(make-target-options)
-ifeq (${RTEMS_USE_MACROS},yes)
- @echo "#define USE_MACROS 1" >>$@
-else
- @echo "#define USE_INLINES 1" >>$@
-endif
-ifeq ($(RTEMS_HAS_POSIX_API),yes)
- @echo "#define RTEMS_POSIX_API 1" >>$@
-endif
-ifeq ($(RTEMS_USE_NEWLIB),yes)
- @echo "#define RTEMS_NEWLIB 1" >>$@
- @echo "#define MALLOC_PROVIDED 1" >>$@
-endif
- @echo >>$@
- @echo "#endif" >>$@
-
-ifeq ($(RTEMS_BSP),bare)
-$(ARCH)/bsp_specs.tmp: FORCE
- cp $(RTEMS_ROOT)/c/src/lib/libbsp/$(RTEMS_BSP_FAMILY)/bsp_specs $@
-else
-$(ARCH)/bsp_specs.tmp: FORCE
- cp $(RTEMS_ROOT)/c/src/lib/libbsp/$(RTEMS_CPU)/$(RTEMS_BSP_FAMILY)/bsp_specs $@
-endif
diff --git a/make/lib.cfg b/make/lib.cfg
deleted file mode 100644
index 6d170efed4..0000000000
--- a/make/lib.cfg
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-# make/lib.cfg
-#
-# Make(1) configuration file include'd by all "library" Makefile
-# Assumes $(LIB) is set to $(ARCH)/libfoo.a
-#
-
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-define make-library
-$(RM) $@
-$(AR) $(ARFLAGS) $@ $(OBJS)
-$(MKLIB) $@
-endef
-
-CLEAN_ADDITIONS +=
-
-.PRECIOUS: $(LIB)
diff --git a/make/main.cfg b/make/main.cfg
deleted file mode 100644
index f35000a989..0000000000
--- a/make/main.cfg
+++ /dev/null
@@ -1,82 +0,0 @@
-#
-# $Id$
-#
-# make/main.cfg
-#
-# Make(1) configuration file include'd by all Makefile's
-#
-
-#
-# where things are relative to PROJECT_ROOT; shouldn't need to change,
-# but could be overridden in custom files.
-#
-
-PROJECT_RELEASE=$(PROJECT_ROOT)/$(RTEMS_BSP)
-PROJECT_BIN=$(PROJECT_RELEASE)/bin
-PROJECT_INCLUDE=$(PROJECT_RELEASE)/lib/include
-PROJECT_TOOLS = $(PROJECT_RELEASE)/build-tools
-
-#
-# Target architecture; may be changed as per 'make "ARCH=${TARGET_ARCH}-debug"'
-# This is where the object files get put.
-#
-
-ARCH=${TARGET_ARCH}
-
-VARIANT=
-
-#
-# Initial target for make(1)
-# Once this is established we can safely include other targets
-# within this make-include file.
-#
-
-default_target: all
-
-#
-# Describe the host os
-#
-# include $(PROJECT_ROOT)/make/target.cfg
-# include $(PROJECT_ROOT)/make/host.cfg
-
-#
-# Default makefile name
-# May be overridden by command line macro assignment
-#
-
-MAKEFILE=Makefile
-
-#
-# Target variant names
-# and rule to expand them into (for example): sun4 sun4-debug sun4-profile
-# Note compiler config may add to TARGET_VARIANTS
-#
-
-TARGET_VARIANTS = debug profile
-
-#
-# Generate list of object directories: sun4, sun4-debug, sun4-profile
-#
-VARIANTS=${TARGET_ARCH} ${TARGET_VARIANTS:%=${TARGET_ARCH}-%}
-
-#
-# List of "recursion-able" targets for directory Makefiles
-#
-
-RECURSE_TARGETS=all clean protos get clobber depend install \
- $(TARGET_VARIANTS) $(TARGET_VARIANTS:%=%_install)
-
-ifeq ($(RTEMS_USE_OWN_PDIR),yes)
-MAKEFLAGS += --no-print-directory
-endif
-
-${ARCH}:
- test -d ${ARCH} || $(MKDIR) ${ARCH}
-
-
-# general purpose forcing dependency; try to use .PHONY instead
-FORCEIT:
-
-FORCE:
-
-.PHONY: $(RECURSE_TARGETS)
diff --git a/make/rtems.cfg b/make/rtems.cfg
deleted file mode 100644
index 9e46845142..0000000000
--- a/make/rtems.cfg
+++ /dev/null
@@ -1,10 +0,0 @@
-# This file is only used inside the rtems source tree and should not get
-# installed.
-
-# autoconf support
-%: %.in
- @subdir=`echo $(srcdir) | sed -e "s%$(RTEMS_ROOT)%%g"`; \
- cd $(PROJECT_ROOT) && CONFIG_FILES=".$$subdir/$@" \
- CONFIG_HEADERS= $(SHELL) ./config.status
-
-Makefile: $(PROJECT_ROOT)/config.status
diff --git a/make/target.cfg.in b/make/target.cfg.in
deleted file mode 100644
index decb674781..0000000000
--- a/make/target.cfg.in
+++ /dev/null
@@ -1,74 +0,0 @@
-#
-# $Id$
-#
-# Target specific settings.
-#
-
-prefix = @prefix@
-
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-DEFS = @DEFS@
-LDFLAGS =
-LIBS = @LIBS@
-CC_FOR_BUILD = @CC@
-
-CC = @CC_FOR_TARGET@
-AS = @AS_FOR_TARGET@
-AR = @AR_FOR_TARGET@
-NM = @NM_FOR_TARGET@
-LD = @LD_FOR_TARGET@
-SIZE = @SIZE_FOR_TARGET@
-STRIP = @STRIP_FOR_TARGET@
-OBJCOPY = @OBJCOPY_FOR_TARGET@
-RANLIB = @RANLIB_FOR_TARGET@
-
-CXX = @CXX_FOR_TARGET@
-
-export CC
-export AS
-export LD
-export NM
-export AR
-export SIZE
-export OBJCOPY
-
-export CXX
-
-RTEMS_CROSS_TARGET=@rtems_cv_prog_cc_cross@
-
-RTEMS_HOST = @RTEMS_HOST@
-RTEMS_USE_OWN_PDIR = @RTEMS_USE_OWN_PDIR@
-RTEMS_HAS_POSIX_API = @RTEMS_HAS_POSIX_API@
-RTEMS_HAS_POSIX_1H_API = @RTEMS_HAS_POSIX_1H_API@
-RTEMS_HAS_NETWORKING = @RTEMS_HAS_NETWORKING@
-RTEMS_HAS_CPLUSPLUS = @RTEMS_HAS_CPLUSPLUS@
-RTEMS_USE_MACROS = @RTEMS_USE_MACROS@
-RTEMS_USE_GCC272 = @RTEMS_USE_GCC272@
-RTEMS_LIBC_DIR = @RTEMS_LIBC_DIR@
-RTEMS_CPU = @target_cpu@
-
-# the following are only used for the bare bsp
-BARE_CPU_MODEL = @BARE_CPU_MODEL@
-BARE_CPU_CFLAGS = @BARE_CPU_CFLAGS@
-
-INSTALL=$(PROJECT_ROOT)/$(RTEMS_BSP)/build-tools/install-if-change
-XCFLAGS=$(CFLAGS_FOR_TARGET)
-
-export RTEMS_BSP
-export RTEMS_CUSTOM
-export PROJECT_ROOT
-
-# List (possibly empty) of required managers
-# We require:
-# region -- used by lib/libcsupport for malloc()
-# ext -- used by libc for libc reentrancy hooks
-
-MANAGERS_REQUIRED=region ext sem
-
-# Create a RTEMS executable based on MANAGERS which was set in
-# app's Makefile
-
-MANAGERS_NOT_WANTED=$(filter-out $(MANAGERS) \
- $(MANAGERS_REQUIRED), $(MANAGER_LIST))
-
diff --git a/mkinstalldirs b/mkinstalldirs
deleted file mode 100755
index 8e32bc5f88..0000000000
--- a/mkinstalldirs
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-# Make directory hierarchy.
-# Written by Noah Friedman <friedman@prep.ai.mit.edu>
-# Public domain.
-#
-# $Id$
-#
-
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
-
-errstatus=0
-
-for file in ${1+"$@"} ; do
- oIFS="${IFS}"
- # Some sh's can't handle IFS=/ for some reason.
- IFS='%'
- set - `echo ${file} | sed -e 's@/@%@g' -e 's@^%@/@'`
- IFS="${oIFS}"
-
- pathcomp=''
-
- for d in ${1+"$@"} ; do
- pathcomp="${pathcomp}${d}"
-
- if test ! -d "${pathcomp}"; then
- echo "mkdir $pathcomp" 1>&2
- mkdir "${pathcomp}" || errstatus=$?
- fi
-
- pathcomp="${pathcomp}/"
- done
-done
-
-exit $errstatus
-
-# eof
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/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/cpuuse/cpuuse.scn b/testsuites/libtests/cpuuse/cpuuse.scn
deleted file mode 100644
index f104c0c482..0000000000
--- a/testsuites/libtests/cpuuse/cpuuse.scn
+++ /dev/null
@@ -1,24 +0,0 @@
-*** TEST 4 ***
-TA1 - 09:15:00 12/31/1988
-TA1 - rtems_task_suspend - on Task 2
-TA1 - rtems_task_suspend - on Task 3
-TA1 - killing time
-TA1 - rtems_task_resume - on Task 2
-TA1 - rtems_task_resume - on Task 3
-TA2 - 09:15:03 12/31/1988
-TA3 - 09:15:04 12/31/1988
-TA1 - 09:15:05 12/31/1988
-TA2 - 09:15:06 12/31/1988
-TA3 - 09:15:07 12/31/1988
-TA1 - 09:15:08 12/31/1988
-TA1 - rtems_task_mode - change mode to NO RTEMS_PREEMPT
-TA1 - 09:15:09 12/31/1988
-TA1 - 09:15:10 12/31/1988
-TA1 - 09:15:11 12/31/1988
-TA1 - 09:15:12 12/31/1988
-TA1 - 09:15:13 12/31/1988
-TA1 - 09:15:14 12/31/1988
-TA1 - rtems_task_mode - change mode to RTEMS_PREEMPT
-TA2 - 09:15:15 12/31/1988
-TA3 - 09:15:16 12/31/1988
-*** END OF TEST 4 ***
diff --git a/testsuites/libtests/cpuuse/init.c b/testsuites/libtests/cpuuse/init.c
deleted file mode 100644
index 31e017c698..0000000000
--- a/testsuites/libtests/cpuuse/init.c
+++ /dev/null
@@ -1,106 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 055d93a098..0000000000
--- a/testsuites/libtests/cpuuse/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 (6 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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 ];
-
-/* end of include file */
diff --git a/testsuites/libtests/cpuuse/task1.c b/testsuites/libtests/cpuuse/task1.c
deleted file mode 100644
index 53f0188ca0..0000000000
--- a/testsuites/libtests/cpuuse/task1.c
+++ /dev/null
@@ -1,103 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ff22274284..0000000000
--- a/testsuites/libtests/cpuuse/task2.c
+++ /dev/null
@@ -1,29 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/libtests/cpuuse/task3.c b/testsuites/libtests/cpuuse/task3.c
deleted file mode 100644
index a431a99f9d..0000000000
--- a/testsuites/libtests/cpuuse/task3.c
+++ /dev/null
@@ -1,29 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 9abd5f80cb..0000000000
--- a/testsuites/libtests/cpuuse/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 "cpuuse.h"
-
-rtems_extension Task_switch(
- rtems_tcb *unused,
- rtems_tcb *heir
-)
-{
- rtems_unsigned32 index;
- rtems_time_of_day time;
- rtems_status_code status;
-
- index = task_number( heir->Object.id );
-
- switch( index ) {
- case 1:
- case 2:
- case 3:
- Run_count[ index ] += 1;
-
- status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
- directive_failed( status, "rtems_clock_get" );
-
- put_name( Task_name[ index ], FALSE );
- print_time( "- ", &time, "\n" );
-
- if ( time.second >= 16 ) {
- CPU_usage_Dump();
- puts( "*** END OF CPU USAGE LIBRARY TEST ***" );
- exit( 0 );
- }
- break;
-
- case 0:
- default:
- break;
- }
-}
diff --git a/testsuites/libtests/malloctest/init.c b/testsuites/libtests/malloctest/init.c
deleted file mode 100644
index 643aa843b8..0000000000
--- a/testsuites/libtests/malloctest/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_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_create(
- Task_name[ 4 ],
- 1,
- TASK_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 ],
- 1,
- TASK_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[ 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/system.h b/testsuites/libtests/malloctest/system.h
deleted file mode 100644
index 7c95130900..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE*3)
-
-#define CONFIGURE_EXTRA_TASK_STACKS (10 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/testsuites/libtests/malloctest/task1.c b/testsuites/libtests/malloctest/task1.c
deleted file mode 100644
index aa47bd404b..0000000000
--- a/testsuites/libtests/malloctest/task1.c
+++ /dev/null
@@ -1,67 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <libcsupport.h> /* for malloc_dump, malloc_walk */
-#include <string.h> /* for memset */
-
-#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 )
- 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 = rand() * task_number( tid );
- printf("mallocing %d bytes\n",mem_amt);
- mem_ptr = malloc ( 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);
- exit(1);
- }
- }
- directive_failed( status, "rtems_task_wake_after" );
- free( mem_ptr );
- }
-}
diff --git a/testsuites/libtests/monitor/init.c b/testsuites/libtests/monitor/init.c
deleted file mode 100644
index 0766c5f8cc..0000000000
--- a/testsuites/libtests/monitor/init.c
+++ /dev/null
@@ -1,74 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/monitor.h>
-
-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 75f5771161..0000000000
--- a/testsuites/libtests/monitor/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_INIT_TASK_PRIORITY 10
-#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
-#define CONFIGURE_MAXIMUM_PERIODS 10
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* 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/rtems++/Init.cc b/testsuites/libtests/rtems++/Init.cc
deleted file mode 100644
index 4474580bc3..0000000000
--- a/testsuites/libtests/rtems++/Init.cc
+++ /dev/null
@@ -1,63 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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++/System.h b/testsuites/libtests/rtems++/System.h
deleted file mode 100644
index 18668d3b9a..0000000000
--- a/testsuites/libtests/rtems++/System.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-#include <rtems++/rtemsEvent.h>
-#include <rtems++/rtemsMessageQueue.h>
-#include <rtems++/rtemsTask.h>
-#include <rtems++/rtemsTaskMode.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/libtests/rtems++/Task1.cc b/testsuites/libtests/rtems++/Task1.cc
deleted file mode 100644
index 0d334ca977..0000000000
--- a/testsuites/libtests/rtems++/Task1.cc
+++ /dev/null
@@ -1,682 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-#include <string.h>
-#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 afddbca67d..0000000000
--- a/testsuites/libtests/rtems++/Task2.cc
+++ /dev/null
@@ -1,81 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 73ddb3b6b2..0000000000
--- a/testsuites/libtests/rtems++/Task3.cc
+++ /dev/null
@@ -1,81 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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
-<pause - screen 1>
- * 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
-<pause - screen 2>
-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 *
-<pause - screen 3>
- * 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 *
-<pause - screen 4>
- * 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 *
-<pause - screen 5>
- * START Interrupt Class test *
- do not know a portable BSP type interrupt test
- * END Interrupt Class test *
-<pause - screen 6>
- * 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 *
-<pause - screen 7>
diff --git a/testsuites/libtests/rtmonuse/getall.c b/testsuites/libtests/rtmonuse/getall.c
deleted file mode 100644
index 85f6470d1c..0000000000
--- a/testsuites/libtests/rtmonuse/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 c599df3c5a..0000000000
--- a/testsuites/libtests/rtmonuse/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 "rtmonuse.h"
-
-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 b10fb1193b..0000000000
--- a/testsuites/libtests/rtmonuse/system.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_INIT_TASK_PRIORITY 10
-#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
-#define CONFIGURE_MAXIMUM_PERIODS 10
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (15 * RTEMS_MINIMUM_STACK_SIZE)
-#include <confdefs.h>
-
-/* 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 92b22178af..0000000000
--- a/testsuites/libtests/rtmonuse/task1.c
+++ /dev/null
@@ -1,124 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <cpuuse.h>
-#include "rtmonuse.h"
-
-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 );
- 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 )
- 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();
- exit( 0 );
- }
-
- }
- break;
- }
-}
diff --git a/testsuites/libtests/stackchk/blow.c b/testsuites/libtests/stackchk/blow.c
deleted file mode 100644
index 0be35308c8..0000000000
--- a/testsuites/libtests/stackchk/blow.c
+++ /dev/null
@@ -1,49 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-
-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 f4aab85d95..0000000000
--- a/testsuites/libtests/stackchk/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 a656d24e26..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* macros */
-
-#define TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE*3)
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define STACK_CHECKER_ON
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/testsuites/libtests/stackchk/task1.c b/testsuites/libtests/stackchk/task1.c
deleted file mode 100644
index 14cc35ae35..0000000000
--- a/testsuites/libtests/stackchk/task1.c
+++ /dev/null
@@ -1,44 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/README b/testsuites/libtests/termios/README
deleted file mode 100644
index 6991d80309..0000000000
--- a/testsuites/libtests/termios/README
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# $Id$
-#
-
-These tests are brought to you by the letter `q'.
-
-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.
-
-Clear???
-
-Also, when testing the cooked mode input, try typing some tabs
-and/or control characters and make sure that you can backspace over
-them properly.
-
----
-Eric Norum
-eric@skatter.usask.ca
-Saskatchewan Accelerator Laboratory
-University of Saskatchewan
-Saskatoon, Canada.
-
diff --git a/testsuites/libtests/termios/init.c b/testsuites/libtests/termios/init.c
deleted file mode 100644
index 96c7e0934e..0000000000
--- a/testsuites/libtests/termios/init.c
+++ /dev/null
@@ -1,143 +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
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_MAXIMUM_SEMAPHORES 20
-#define CONFIGURE_MAXIMUM_TIMERS 5
-#define CONFIGURE_MAXIMUM_PERIODS 1
-
-#define CONFIGURE_MICROSECONDS_PER_TICK 1000
-
-#define CONFIGURE_INIT
-rtems_task Init (rtems_task_argument argument);
-
-#include <confdefs.h>
-
-#include <stdio.h>
-#include <unistd.h>
-#include <termios.h>
-#include <errno.h>
-#include <string.h>
-
-/*
- * Test raw (ICANON=0) input
- */
-static void
-testRawInput (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 VMIN=%d VTIME=%d ***\n", vmin, vtime);
- rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond);
- i = tcgetattr (fileno (stdin), &old);
- if (i < 0) {
- printf ("tcgetattr failed: %s\n", strerror (errno));
- return;
- }
- new = old;
- new.c_lflag &= ~(ICANON|ECHO|ECHONL|ECHOK|ECHOE|ECHOPRT|ECHOCTL);
- new.c_cc[VMIN] = vmin;
- new.c_cc[VTIME] = vtime;
- i = tcsetattr (fileno (stdin), TCSANOW, &new);
- if (i < 0) {
- printf ("tcsetattr failed: %s\n", strerror (errno));
- 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) {
- printf ("Read error: %s\n", strerror (errno));
- 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 (" %2.2x", cbuf[i]);
- printf ("\n");
- } while (cbuf[0] != 'q');
- out:
- i = tcsetattr (fileno (stdin), TCSANOW, &old);
- if (i < 0)
- printf ("tcsetattr failed: %s\n", strerror (errno));
- printf ("*** End of Raw input VMIN=%d VTIME=%d ***\n", vmin, vtime);
-}
-
-/*
- * RTEMS Startup Task
- */
-rtems_task
-Init (rtems_task_argument ignored)
-{
- int i, j;
-
- printf( "\n\n*** HELLO WORLD TEST ***\n" );
- printf( "Hello World\n" );
- printf( "*** END OF HELLO WORLD TEST ***\n" );
-
- printf( "\n\ntype 'q' to exit raw input tests\n\n" );
-
- for (;;) {
- /*
- * Test blocking, line-oriented input
- */
- do {
- printf (">>> ");
- fflush (stdout);
- i = scanf (" %d", &j);
- printf ("Return: %d Value: %d\n", i, j);
- } while (i != 0);
-
- /*
- * Consume what scanf rejected
- */
- while ((i = getchar ()) != '\n')
- if (i == EOF)
- break;
-
- /*
- * Test character-oriented input
- */
- testRawInput (0, 0);
- testRawInput (0, 20);
- testRawInput (5, 0);
- testRawInput (5, 20);
- }
- exit (1);
-}
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/mp01/init.c b/testsuites/mptests/mp01/init.c
deleted file mode 100644
index 4234ba1473..0000000000
--- a/testsuites/mptests/mp01/init.c
+++ /dev/null
@@ -1,96 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/mp01.doc b/testsuites/mptests/mp01/node1/mp01.doc
deleted file mode 100644
index f2c86a4433..0000000000
--- a/testsuites/mptests/mp01/node1/mp01.doc
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/mp01.doc b/testsuites/mptests/mp01/node2/mp01.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/mptests/mp01/node2/mp01.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 2abd7fabfa..0000000000
--- a/testsuites/mptests/mp01/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_GLOBAL
-
-#include <confdefs.h>
-
-/* 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 559ef3781a..0000000000
--- a/testsuites/mptests/mp01/task1.c
+++ /dev/null
@@ -1,84 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit(0);
- }
-}
diff --git a/testsuites/mptests/mp02/init.c b/testsuites/mptests/mp02/init.c
deleted file mode 100644
index 17ceff147a..0000000000
--- a/testsuites/mptests/mp02/init.c
+++ /dev/null
@@ -1,60 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/mp02.doc b/testsuites/mptests/mp02/node1/mp02.doc
deleted file mode 100644
index 532dad1f43..0000000000
--- a/testsuites/mptests/mp02/node1/mp02.doc
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/mp02.doc b/testsuites/mptests/mp02/node2/mp02.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/mptests/mp02/node2/mp02.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 01abf230f6..0000000000
--- a/testsuites/mptests/mp02/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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 854dcae9bc..0000000000
--- a/testsuites/mptests/mp02/task1.c
+++ /dev/null
@@ -1,118 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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), &note );
- directive_failed( status, "rtems_task_get_note" );
-
- if ( note == rtems_get_node(tid) )
- puts( "Remote notepad set and read correctly" );
- else
- printf(
- "FAILURE!! Remote notepad was not set and read correctly (%d, %d)\n",
- note,
- rtems_get_node( tid )
- );
-
- status = rtems_task_wake_after( TICKS_PER_SECOND );
- directive_failed( status, "rtems_task_wake_after" );
-
- puts( "*** END OF TEST 2 ***" );
- exit( 0 );
-}
diff --git a/testsuites/mptests/mp03/delay.c b/testsuites/mptests/mp03/delay.c
deleted file mode 100644
index 06c329a254..0000000000
--- a/testsuites/mptests/mp03/delay.c
+++ /dev/null
@@ -1,31 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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( status, "rtems_event_send" );
-}
diff --git a/testsuites/mptests/mp03/init.c b/testsuites/mptests/mp03/init.c
deleted file mode 100644
index 2b178c972e..0000000000
--- a/testsuites/mptests/mp03/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/mp03.doc b/testsuites/mptests/mp03/node1/mp03.doc
deleted file mode 100644
index 6a1d5517f5..0000000000
--- a/testsuites/mptests/mp03/node1/mp03.doc
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/mp03.doc b/testsuites/mptests/mp03/node2/mp03.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/mptests/mp03/node2/mp03.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 a6f517ae1a..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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 47a921e7b3..0000000000
--- a/testsuites/mptests/mp03/task1.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* Test_task
- *
- * This task suspends and resumes a remote task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/mptests/mp04/init.c b/testsuites/mptests/mp04/init.c
deleted file mode 100644
index 0523bede6b..0000000000
--- a/testsuites/mptests/mp04/init.c
+++ /dev/null
@@ -1,60 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/mp04.doc b/testsuites/mptests/mp04/node1/mp04.doc
deleted file mode 100644
index 7165e7c841..0000000000
--- a/testsuites/mptests/mp04/node1/mp04.doc
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/mp04.doc b/testsuites/mptests/mp04/node2/mp04.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/mptests/mp04/node2/mp04.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 f432fd6216..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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 ffa0d1b9a5..0000000000
--- a/testsuites/mptests/mp04/task1.c
+++ /dev/null
@@ -1,83 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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
- );
- exit( 0xf0000 );
- }
-
- do {
- status = rtems_task_set_priority(
- RTEMS_SELF,
- RTEMS_CURRENT_PRIORITY,
- &previous_priority_1
- );
- directive_failed( status, "rtems_task_set_priority" );
- } while ( previous_priority_1 != remote_node );
-
- puts( "Local task priority has been set" );
-
- puts( "*** END OF TEST 4 ***" );
- exit( 0 );
-}
diff --git a/testsuites/mptests/mp05/asr.c b/testsuites/mptests/mp05/asr.c
deleted file mode 100644
index d90c5b0056..0000000000
--- a/testsuites/mptests/mp05/asr.c
+++ /dev/null
@@ -1,37 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 56a420752a..0000000000
--- a/testsuites/mptests/mp05/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/mp05.doc b/testsuites/mptests/mp05/node1/mp05.doc
deleted file mode 100644
index 508e664600..0000000000
--- a/testsuites/mptests/mp05/node1/mp05.doc
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/mp05.doc b/testsuites/mptests/mp05/node2/mp05.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/mptests/mp05/node2/mp05.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 a3d66bf338..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* 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 dd97f261c6..0000000000
--- a/testsuites/mptests/mp05/task1.c
+++ /dev/null
@@ -1,106 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/mptests/mp06/init.c b/testsuites/mptests/mp06/init.c
deleted file mode 100644
index 9e33f8f284..0000000000
--- a/testsuites/mptests/mp06/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/mp06.doc b/testsuites/mptests/mp06/node1/mp06.doc
deleted file mode 100644
index 086434fcb7..0000000000
--- a/testsuites/mptests/mp06/node1/mp06.doc
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/mp06.doc b/testsuites/mptests/mp06/node2/mp06.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/mptests/mp06/node2/mp06.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 fa86b90798..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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 6ec9a24534..0000000000
--- a/testsuites/mptests/mp06/task1.c
+++ /dev/null
@@ -1,176 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/mptests/mp07/init.c b/testsuites/mptests/mp07/init.c
deleted file mode 100644
index 658b2dc5cf..0000000000
--- a/testsuites/mptests/mp07/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/mp07.doc b/testsuites/mptests/mp07/node1/mp07.doc
deleted file mode 100644
index 196a33defc..0000000000
--- a/testsuites/mptests/mp07/node1/mp07.doc
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/mp07.doc b/testsuites/mptests/mp07/node2/mp07.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/mptests/mp07/node2/mp07.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 fa86b90798..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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 8434f9d6f9..0000000000
--- a/testsuites/mptests/mp07/task1.c
+++ /dev/null
@@ -1,103 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/mptests/mp08/init.c b/testsuites/mptests/mp08/init.c
deleted file mode 100644
index 499bbf166c..0000000000
--- a/testsuites/mptests/mp08/init.c
+++ /dev/null
@@ -1,74 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/mp08.doc b/testsuites/mptests/mp08/node1/mp08.doc
deleted file mode 100644
index 93cef0a0d7..0000000000
--- a/testsuites/mptests/mp08/node1/mp08.doc
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/mp08.doc b/testsuites/mptests/mp08/node2/mp08.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/mptests/mp08/node2/mp08.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 939c78fd9b..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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 3fc914ee35..0000000000
--- a/testsuites/mptests/mp08/task1.c
+++ /dev/null
@@ -1,89 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
- }
-
- if ( Multiprocessing_configuration.node == 1 && ++count == 1000 ) {
- status = rtems_task_wake_after( TICKS_PER_SECOND );
- directive_failed( status, "rtems_task_wake_after" );
-
- puts( "\nDeleting global semaphore" );
- status = rtems_semaphore_delete( Semaphore_id[ 1 ] );
- directive_failed( status, "rtems_semaphore_delete" );
-
- puts( "*** END OF TEST 8 ***" );
- exit( 0 );
- }
- else {
- put_dot( 'v' );
- status = rtems_semaphore_release( Semaphore_id[ 1 ] );
- directive_failed( status, "rtems_semaphore_release FAILED!!" );
- }
- }
-}
diff --git a/testsuites/mptests/mp09/init.c b/testsuites/mptests/mp09/init.c
deleted file mode 100644
index 85af601bce..0000000000
--- a/testsuites/mptests/mp09/init.c
+++ /dev/null
@@ -1,74 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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/mp09.doc b/testsuites/mptests/mp09/node1/mp09.doc
deleted file mode 100644
index 239298cf4e..0000000000
--- a/testsuites/mptests/mp09/node1/mp09.doc
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/mp09.doc b/testsuites/mptests/mp09/node2/mp09.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/mptests/mp09/node2/mp09.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 2de46306a7..0000000000
--- a/testsuites/mptests/mp09/recvmsg.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Receive_messages
- *
- * This routine receives and prints three messages.
- * an error condition.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 0992d21ae5..0000000000
--- a/testsuites/mptests/mp09/sendmsg.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Send_messages
- *
- * This routine sends a series of three messages.
- * an error condition.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 1115045c3e..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 1
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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 ab16e8b4eb..0000000000
--- a/testsuites/mptests/mp09/task1.c
+++ /dev/null
@@ -1,109 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/mptests/mp10/init.c b/testsuites/mptests/mp10/init.c
deleted file mode 100644
index d5ab43d908..0000000000
--- a/testsuites/mptests/mp10/init.c
+++ /dev/null
@@ -1,143 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/mptests/mp10/node1/mp10.doc b/testsuites/mptests/mp10/node1/mp10.doc
deleted file mode 100644
index fd264018d3..0000000000
--- a/testsuites/mptests/mp10/node1/mp10.doc
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/mp10.doc b/testsuites/mptests/mp10/node2/mp10.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/mptests/mp10/node2/mp10.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 669eff75ac..0000000000
--- a/testsuites/mptests/mp10/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.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#if ( NODE_NUMBER == 1 )
-#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#endif
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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 df7a8e9e03..0000000000
--- a/testsuites/mptests/mp10/task1.c
+++ /dev/null
@@ -1,52 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 86e944fb2f..0000000000
--- a/testsuites/mptests/mp10/task2.c
+++ /dev/null
@@ -1,47 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 fe91319879..0000000000
--- a/testsuites/mptests/mp10/task3.c
+++ /dev/null
@@ -1,50 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/init.c b/testsuites/mptests/mp11/init.c
deleted file mode 100644
index 7d74289ee4..0000000000
--- a/testsuites/mptests/mp11/init.c
+++ /dev/null
@@ -1,105 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/mptests/mp11/node1/mp11.doc b/testsuites/mptests/mp11/node1/mp11.doc
deleted file mode 100644
index bc525ffa30..0000000000
--- a/testsuites/mptests/mp11/node1/mp11.doc
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/mp11.doc b/testsuites/mptests/mp11/node2/mp11.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/mptests/mp11/node2/mp11.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 a7b1a2e5d8..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 0
-#define CONFIGURE_MP_MAXIMUM_PROXIES 0
-
-#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 <confdefs.h>
-
-/* 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/init.c b/testsuites/mptests/mp12/init.c
deleted file mode 100644
index b0e54bc8d9..0000000000
--- a/testsuites/mptests/mp12/init.c
+++ /dev/null
@@ -1,113 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/mptests/mp12/node1/mp12.doc b/testsuites/mptests/mp12/node1/mp12.doc
deleted file mode 100644
index 3ce94b73eb..0000000000
--- a/testsuites/mptests/mp12/node1/mp12.doc
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/mp12.doc b/testsuites/mptests/mp12/node2/mp12.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/mptests/mp12/node2/mp12.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 6469a7f12c..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-#define PT_NAME rtems_build_name( 'P', 'A', 'R', '\0' )
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 1
-#define CONFIGURE_MP_MAXIMUM_PROXIES 0
-
-#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 <confdefs.h>
-
-/* 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/init.c b/testsuites/mptests/mp13/init.c
deleted file mode 100644
index e33048ffcb..0000000000
--- a/testsuites/mptests/mp13/init.c
+++ /dev/null
@@ -1,115 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
- }
- puts( "Deleting initialization task" );
- status = rtems_task_delete( RTEMS_SELF );
- directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
-}
diff --git a/testsuites/mptests/mp13/node1/mp13.doc b/testsuites/mptests/mp13/node1/mp13.doc
deleted file mode 100644
index 13b100e7fa..0000000000
--- a/testsuites/mptests/mp13/node1/mp13.doc
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/mp13.doc b/testsuites/mptests/mp13/node2/mp13.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/mptests/mp13/node2/mp13.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 81c96b4f54..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#if ( NODE_NUMBER == 1 )
-#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
-#endif
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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 5b6d3a9f89..0000000000
--- a/testsuites/mptests/mp13/task1.c
+++ /dev/null
@@ -1,73 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ab1f165788..0000000000
--- a/testsuites/mptests/mp13/task2.c
+++ /dev/null
@@ -1,106 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/mptests/mp14/delay.c b/testsuites/mptests/mp14/delay.c
deleted file mode 100644
index 8c2d177ddf..0000000000
--- a/testsuites/mptests/mp14/delay.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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
- );
- directive_failed( status, "rtems_event_send" );
-}
diff --git a/testsuites/mptests/mp14/evtask1.c b/testsuites/mptests/mp14/evtask1.c
deleted file mode 100644
index 742aee2613..0000000000
--- a/testsuites/mptests/mp14/evtask1.c
+++ /dev/null
@@ -1,87 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 165274dc21..0000000000
--- a/testsuites/mptests/mp14/evtmtask.c
+++ /dev/null
@@ -1,65 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 6e944c2a18..0000000000
--- a/testsuites/mptests/mp14/exit.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Exit_test
- *
- * This routine safely stops the test and prints some information
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 6dace461aa..0000000000
--- a/testsuites/mptests/mp14/init.c
+++ /dev/null
@@ -1,191 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 0d698d58ef..0000000000
--- a/testsuites/mptests/mp14/msgtask1.c
+++ /dev/null
@@ -1,107 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/mp14.doc b/testsuites/mptests/mp14/node1/mp14.doc
deleted file mode 100644
index 6fbbe4b2cd..0000000000
--- a/testsuites/mptests/mp14/node1/mp14.doc
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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
-<stream of following characters>
-
-. - indicates 100 iterations of
- tm_evafter of 1 tick and rtems_event_receive.
-
-e - indicates that 100
- events have been sent to the remote task.
-
-m - indicates 100 iterations of
- rtems_message_queue_send and rtems_message_queue_receive.
-
-p - indicates 100 iterations of
- rtems_partition_get_buffer and rtems_partition_return_buffer.
-
-s - indicates 100 iterations of
- rtems_semaphore_obtain and rtems_semaphore_release.
-
-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/mp14.doc b/testsuites/mptests/mp14/node2/mp14.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/mptests/mp14/node2/mp14.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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
-<stream of following characters>
-
-. - indicates 100 iterations of
- tm_evafter of 1 tick and rtems_event_receive.
-
-e - indicates that 100
- events have been sent to the remote task.
-
-m - indicates 100 iterations of
- rtems_message_queue_send and rtems_message_queue_receive.
-
-p - indicates 100 iterations of
- rtems_partition_get_buffer and rtems_partition_return_buffer.
-
-s - indicates 100 iterations of
- rtems_semaphore_obtain and rtems_semaphore_release.
-
-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 f8933db339..0000000000
--- a/testsuites/mptests/mp14/pttask1.c
+++ /dev/null
@@ -1,71 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 eeeb111352..0000000000
--- a/testsuites/mptests/mp14/smtask1.c
+++ /dev/null
@@ -1,73 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 1bbc8ca1e9..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_TICKS_PER_TIMESLICE 1
-#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(1)
-
-#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 <confdefs.h>
-
-/* 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/psxtests/include/pmacros.h b/testsuites/psxtests/include/pmacros.h
deleted file mode 100644
index 1f15dac9c0..0000000000
--- a/testsuites/psxtests/include/pmacros.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef __POSIX_TEST_MACROS_h
-#define __POSIX_TEST_MACROS_h
-
-#include <bsp.h>
-#include <pthread.h>
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-
-/*
- * 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
-
-#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; }
-
-#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 _buffer[32]; \
- int _status; \
- struct timespec _tv; \
- \
- _status = clock_gettime( CLOCK_REALTIME, &_tv ); \
- assert( !_status ); \
- \
- (void) ctime_r( &_tv.tv_sec, _buffer ); \
- _buffer[ strlen( _buffer ) - 1 ] = 0; \
- printf( "%s%s%s\n", s1, _buffer, s2 ); \
- fflush(stdout); \
- } while ( 0 )
-
-#define empty_line() puts( "" )
-
-#endif
-
-/* end of file */
diff --git a/testsuites/psxtests/psx01/init.c b/testsuites/psxtests/psx01/init.c
deleted file mode 100644
index a2101a5f16..0000000000
--- a/testsuites/psxtests/psx01/init.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <sched.h>
-
-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;
-
- puts( "\n\n*** POSIX TEST 1 ***" );
-
- build_time( &tm, TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
-
- /* 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 8f563dd26c..0000000000
--- a/testsuites/psxtests/psx01/psx01.scn
+++ /dev/null
@@ -1,46 +0,0 @@
-*** POSIX TEST 1 ***
-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 (100), nsec (0)
-
-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 - EAGAIN (negative seconds)
-Init: nanosleep - EINVAL (too many nanoseconds)
-Init: nanosleep - yield
-Init: nanosleep - 3.05 seconds
-Fri May 24 11:05:06 1996
-Init: sec (0), nsec (0) remaining
-Init: ID is 0x0c010001
-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 0x0c010002
-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 9ff369cc01..0000000000
--- a/testsuites/psxtests/psx01/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sched.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1_through_3(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
-
-#include <confdefs.h>
-
-/* 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 d6733a8a82..0000000000
--- a/testsuites/psxtests/psx01/task.c
+++ /dev/null
@@ -1,94 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/testsuites/psxtests/psx02/init.c b/testsuites/psxtests/psx02/init.c
deleted file mode 100644
index 27a0778583..0000000000
--- a/testsuites/psxtests/psx02/init.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <signal.h>
-
-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 ***" );
- 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 3b0d373b16..0000000000
--- a/testsuites/psxtests/psx02/psx02.scn
+++ /dev/null
@@ -1,26 +0,0 @@
-*** POSIX TEST 2 ***
-Init's ID is 0x0c010001
-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 862e5c80f1..0000000000
--- a/testsuites/psxtests/psx02/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-#include <errno.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1_through_3(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#include <confdefs.h>
-
-/* 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 ce8f4b0a4d..0000000000
--- a/testsuites/psxtests/psx02/task.c
+++ /dev/null
@@ -1,45 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <signal.h>
-
-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 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/testsuites/psxtests/psx03/init.c b/testsuites/psxtests/psx03/init.c
deleted file mode 100644
index 4ccd89e3cc..0000000000
--- a/testsuites/psxtests/psx03/init.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <signal.h>
-#include <errno.h>
-
-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 */
-
- /* exit this thread */
-
- puts( "*** END OF POSIX TEST 3 ***" );
- 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 61ba36592a..0000000000
--- a/testsuites/psxtests/psx03/psx03.scn
+++ /dev/null
@@ -1,17 +0,0 @@
-*** POSIX TEST 3 ***
-Init's ID is 0x0c010001
-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
-*** END OF POSIX TEST 3 ***
diff --git a/testsuites/psxtests/psx03/system.h b/testsuites/psxtests/psx03/system.h
deleted file mode 100644
index a17b36812d..0000000000
--- a/testsuites/psxtests/psx03/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-void *Task_2(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#include <confdefs.h>
-
-/* 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 be9b1ae96c..0000000000
--- a/testsuites/psxtests/psx03/task.c
+++ /dev/null
@@ -1,65 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <signal.h>
-
-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/init.c b/testsuites/psxtests/psx04/init.c
deleted file mode 100644
index a1dfbd5ac5..0000000000
--- a/testsuites/psxtests/psx04/init.c
+++ /dev/null
@@ -1,564 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <signal.h>
-#include <errno.h>
-
-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, SIGUSR1 );
- if ( status != -1 )
- printf( "status = %d\n", status );
- assert( errno == ENOSYS );
- puts( "Init: pthread_kill - ENOSYS (signal SA_SIGINFO)" );
-
- 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 ***" );
- 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 83237ec768..0000000000
--- a/testsuites/psxtests/psx04/psx04.scn
+++ /dev/null
@@ -1,112 +0,0 @@
-*** POSIX TEST 4 ***
-Init's ID is 0x0c010001
-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
-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 - ENOSYS (signal SA_SIGINFO)
-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 7128f0f807..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-void *Task_2(
- void *argument
-);
-
-void *Task_3(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 5
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#include <confdefs.h>
-
-/* 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 0f628b95d9..0000000000
--- a/testsuites/psxtests/psx04/task1.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Task_1
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <signal.h>
-
-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 fa19e36be9..0000000000
--- a/testsuites/psxtests/psx04/task2.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Task_2
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <signal.h>
-
-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 0c169c099f..0000000000
--- a/testsuites/psxtests/psx04/task3.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/* Task_3
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <signal.h>
-
-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/init.c b/testsuites/psxtests/psx05/init.c
deleted file mode 100644
index 08b059310f..0000000000
--- a/testsuites/psxtests/psx05/init.c
+++ /dev/null
@@ -1,569 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <errno.h>
-
-#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 );
-
- puts( "Init: pthread_mutex_init - SUCCESSFUL" );
- status = pthread_mutex_init( &Mutex_id, &attr );
- if ( status )
- printf( "status = %d\n", status );
- assert( !status );
-
- puts( "Init: pthread_mutex_init - EBUSY (attempt to initialize an existing mutex)" );
- status = pthread_mutex_init( &Mutex_id, &attr );
- if ( !status )
- printf( "status = %d\n", status );
- assert( status == EBUSY );
-
- 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, &times );
- 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, &param );
- assert( !status );
-
- /* switching to Task2 */
-
- status = pthread_getschedparam( pthread_self(), &policy, &param );
- 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, &param );
- 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, &param );
- 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, &param );
- 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, &param );
- 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 ***" );
- 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 6e4bc7320d..0000000000
--- a/testsuites/psxtests/psx05/psx05.scn
+++ /dev/null
@@ -1,111 +0,0 @@
-*** POSIX TEST 5 ***
-Init's ID is 0x0c010001
-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 (attempt to initialize an existing mutex)
-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 = 1
-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 271c7559f8..0000000000
--- a/testsuites/psxtests/psx05/system.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-void *Task_2(
- void *argument
-);
-
-void *Task_3(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
-
-#include <confdefs.h>
-
-/* 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 705d288ebe..0000000000
--- a/testsuites/psxtests/psx05/task.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <errno.h>
-
-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 4b6a3e38c7..0000000000
--- a/testsuites/psxtests/psx05/task2.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Task_2
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <errno.h>
-
-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 5b869ff96f..0000000000
--- a/testsuites/psxtests/psx05/task3.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Task_3
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <errno.h>
-
-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, &param );
- 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/init.c b/testsuites/psxtests/psx06/init.c
deleted file mode 100644
index 913ae2c1f3..0000000000
--- a/testsuites/psxtests/psx06/init.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <errno.h>
-
-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 ***" );
- 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 a17fa043ee..0000000000
--- a/testsuites/psxtests/psx06/psx06.scn
+++ /dev/null
@@ -1,21 +0,0 @@
-*** POSIX TEST 6 ***
-Init's ID is 0x0c010001
-
-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 c6945ef23a..0000000000
--- a/testsuites/psxtests/psx06/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-void *Task_2(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 1
-
-#include <confdefs.h>
-
-/* 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 0918033b8d..0000000000
--- a/testsuites/psxtests/psx06/task.c
+++ /dev/null
@@ -1,51 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <errno.h>
-
-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 ef70e0f0f9..0000000000
--- a/testsuites/psxtests/psx06/task2.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Task_2
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <errno.h>
-
-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/init.c b/testsuites/psxtests/psx07/init.c
deleted file mode 100644
index f4da65213a..0000000000
--- a/testsuites/psxtests/psx07/init.c
+++ /dev/null
@@ -1,495 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <errno.h>
-
-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
-}
-
-extern rtems_configuration_table BSP_Configuration;
-
-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 = BSP_Configuration.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 );
- printf( "Init: current stack size attribute = %ld\n", (long) stacksize );
-
- /* 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 ***" );
- 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 33f5c68f6a..0000000000
--- a/testsuites/psxtests/psx07/psx07.scn
+++ /dev/null
@@ -1,105 +0,0 @@
-*** POSIX TEST 7 ***
-Init's ID is 0x0c010001
-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 = 5120
-
-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 a402b65128..0000000000
--- a/testsuites/psxtests/psx07/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#include <confdefs.h>
-
-/* 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 a477e4ee88..0000000000
--- a/testsuites/psxtests/psx07/task.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <time.h>
-#include <sched.h>
-
-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/init.c b/testsuites/psxtests/psx08/init.c
deleted file mode 100644
index f1ec5a6b09..0000000000
--- a/testsuites/psxtests/psx08/init.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <errno.h>
-
-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 */
-
- puts( "Init: creating two tasks" );
- status = pthread_create( &Task_id, NULL, Task_1, NULL );
- assert( !status );
-
- status = pthread_create( &Task2_id, NULL, Task_2, 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( Task_id, &return_pointer );
- /* assert is below comment */
-
- /* switch to Task 1 */
-
- puts( "Init: returned from pthread_join" );
- if ( status )
- printf( "status = %d\n", status );
- assert( !status );
-
- if ( return_pointer == &Task_id )
- puts( "Init: pthread_join returned correct pointer" );
- else
- printf(
- "Init: pthread_join returned incorrect pointer (%p != %p)\n",
- return_pointer,
- &Task_id
- );
-
- puts( "Init: exitting" );
- pthread_exit( NULL );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/testsuites/psxtests/psx08/psx08.scn b/testsuites/psxtests/psx08/psx08.scn
deleted file mode 100644
index 34c1934f59..0000000000
--- a/testsuites/psxtests/psx08/psx08.scn
+++ /dev/null
@@ -1,18 +0,0 @@
-*** POSIX TEST 8 ***
-Init's ID is 0x0c010001
-Init: pthread_detach - ESRCH (invalid id)
-Init: pthread_detach self
-Init: creating two tasks
-Init: pthread_join - ESRCH (invalid id)
-Init: pthread_join - SUCCESSFUL
-Task_1: sleep 1 second
-Task_2: join to Task_1
-Task_1: join to detached task (Init) -- EINVAL
-Task_1: join to self task (Init) -- EDEADLK
-Task_1: exitting
-Init: returned from pthread_join
-Init: pthread_join returned correct pointer
-Init: exitting
-Task_2: returned from pthread_join
-Task_2: 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 18c0c49f35..0000000000
--- a/testsuites/psxtests/psx08/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-void *Task_2(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#include <confdefs.h>
-
-/* 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;
-
-/* end of include file */
diff --git a/testsuites/psxtests/psx08/task2.c b/testsuites/psxtests/psx08/task2.c
deleted file mode 100644
index 028df4cb91..0000000000
--- a/testsuites/psxtests/psx08/task2.c
+++ /dev/null
@@ -1,52 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <errno.h>
-
-void *Task_2(
- void *argument
-)
-{
- int status;
- void *return_pointer;
-
- puts( "Task_2: join to Task_1" );
- status = pthread_join( Task_id, &return_pointer );
- puts( "Task_2: returned from pthread_join" );
- if ( status )
- printf( "status = %d\n", status );
- assert( !status );
-
- if ( return_pointer == &Task_id )
- puts( "Task_2: pthread_join returned correct pointer" );
- else
- printf(
- "Task_2: pthread_join returned incorrect pointer (%p != %p)\n",
- return_pointer,
- &Task_id
- );
-
- puts( "*** END OF POSIX TEST 8 ***" );
- exit( 0 );
-
- return NULL; /* just so the compiler thinks we returned something */
-}
diff --git a/testsuites/psxtests/psx09/init.c b/testsuites/psxtests/psx09/init.c
deleted file mode 100644
index b4856583cf..0000000000
--- a/testsuites/psxtests/psx09/init.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <errno.h>
-
-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 ***" );
- 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 afc609c456..0000000000
--- a/testsuites/psxtests/psx09/psx09.scn
+++ /dev/null
@@ -1,23 +0,0 @@
-*** POSIX TEST 9 ***
-Init's ID is 0x0c010001
-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 48197e1589..0000000000
--- a/testsuites/psxtests/psx09/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-void *Task_2(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 10
-
-#include <confdefs.h>
-
-/* 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/init.c b/testsuites/psxtests/psx10/init.c
deleted file mode 100644
index 940cfaa27e..0000000000
--- a/testsuites/psxtests/psx10/init.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <sched.h>
-
-
-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 ***" );
- 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 a26432ac6e..0000000000
--- a/testsuites/psxtests/psx10/psx10.scn
+++ /dev/null
@@ -1,59 +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 0x0c010002
-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 0x0c010003
-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 0x0c010004
-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 9bbdac0f25..0000000000
--- a/testsuites/psxtests/psx10/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-#include <unistd.h>
-#include <errno.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-void *Task_2(
- void *argument
-);
-
-void *Task_3(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 1
-
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
-
-#include <confdefs.h>
-
-/* 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 6419b13c3c..0000000000
--- a/testsuites/psxtests/psx10/task.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Task_1
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 5095178e6f..0000000000
--- a/testsuites/psxtests/psx10/task2.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Task_2
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 d276bf86cb..0000000000
--- a/testsuites/psxtests/psx10/task3.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Task_3
- *
- * This routine serves as a test task.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/init.c b/testsuites/psxtests/psx11/init.c
deleted file mode 100644
index 2a64517935..0000000000
--- a/testsuites/psxtests/psx11/init.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <errno.h>
-
-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, &param );
- assert( !status );
-
- param.sched_priority = 125;
-
- puts( "Init: Setting scheduling parameters to RR with priority 125" );
- status = pthread_setschedparam( Init_id, SCHED_RR, &param );
- assert( !status );
-
- param.sched_priority = 121;
-
- puts( "Init: Setting scheduling parameters to OTHER with priority 121" );
- status = pthread_setschedparam( Init_id, SCHED_OTHER, &param );
- 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 ***" );
- 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 69df5ec1b9..0000000000
--- a/testsuites/psxtests/psx11/psx11.scn
+++ /dev/null
@@ -1,18 +0,0 @@
-*** POSIX TEST 11 ***
-Init's ID is 0x0c010001
-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 a402b65128..0000000000
--- a/testsuites/psxtests/psx11/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#include <confdefs.h>
-
-/* 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 dbc90cbc58..0000000000
--- a/testsuites/psxtests/psx11/task.c
+++ /dev/null
@@ -1,92 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <time.h>
-#include <sched.h>
-
-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, &current );
- assert( !status );
-
- diff_timespec( &start, &current, &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/init.c b/testsuites/psxtests/psx12/init.c
deleted file mode 100644
index 17ca4e0f5d..0000000000
--- a/testsuites/psxtests/psx12/init.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <errno.h>
-
-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 ***" );
- 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 fd969cb122..0000000000
--- a/testsuites/psxtests/psx12/psx12.scn
+++ /dev/null
@@ -1,11 +0,0 @@
-*** POSIX TEST 12 ***
-Init's ID is 0x0c010001
-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 ebdf74e20b..0000000000
--- a/testsuites/psxtests/psx12/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <pmacros.h>
-
-void *POSIX_Init(
- void *argument
-);
-
-void *Task_1(
- void *argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 10
-
-#include <confdefs.h>
-
-/* 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 a477e4ee88..0000000000
--- a/testsuites/psxtests/psx12/task.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <time.h>
-#include <sched.h>
-
-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/psxhdrs/clock01.c b/testsuites/psxtests/psxhdrs/clock01.c
deleted file mode 100644
index 4677dac3f8..0000000000
--- a/testsuites/psxtests/psxhdrs/clock01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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 9bd35c1be6..0000000000
--- a/testsuites/psxtests/psxhdrs/clock02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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 489390fcec..0000000000
--- a/testsuites/psxtests/psxhdrs/clock03.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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 721f73666b..0000000000
--- a/testsuites/psxtests/psxhdrs/clock04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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 7c862db4a0..0000000000
--- a/testsuites/psxtests/psxhdrs/clock05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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 614da056d5..0000000000
--- a/testsuites/psxtests/psxhdrs/clock06.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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 3dfd686313..0000000000
--- a/testsuites/psxtests/psxhdrs/cond01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 0f0f84ba17..0000000000
--- a/testsuites/psxtests/psxhdrs/cond02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 a1e848ff82..0000000000
--- a/testsuites/psxtests/psxhdrs/cond03.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 ebf340182e..0000000000
--- a/testsuites/psxtests/psxhdrs/cond04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 3daf62c66b..0000000000
--- a/testsuites/psxtests/psxhdrs/cond05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 e3a5466264..0000000000
--- a/testsuites/psxtests/psxhdrs/cond06.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 e5551d2487..0000000000
--- a/testsuites/psxtests/psxhdrs/cond07.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 ff4bc7d233..0000000000
--- a/testsuites/psxtests/psxhdrs/cond08.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 c563c0a3ef..0000000000
--- a/testsuites/psxtests/psxhdrs/cond09.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 01ff0ba63f..0000000000
--- a/testsuites/psxtests/psxhdrs/cond10.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 513d81a7c3..0000000000
--- a/testsuites/psxtests/psxhdrs/key01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 85e5f07577..0000000000
--- a/testsuites/psxtests/psxhdrs/key02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 62ad1fdc0b..0000000000
--- a/testsuites/psxtests/psxhdrs/key03.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 d3440106cf..0000000000
--- a/testsuites/psxtests/psxhdrs/key04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 318b79b684..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 0d53b8ba1d..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 8d2d23b871..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex03.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 ca9b8b8abe..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 6b0aa58296..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 9773d02a27..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex06.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 709b15093d..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex07.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 119cccc190..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex08.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 322b00060e..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex09.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 11ee1ac294..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex10.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 58fa2017cf..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex11.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 2a0090e26e..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex12.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 b3ab3fb070..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex13.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 6410e021a4..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex14.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 cbef40b0c9..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex15.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 8adbff564e..0000000000
--- a/testsuites/psxtests/psxhdrs/mutex16.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 52b286fd70..0000000000
--- a/testsuites/psxtests/psxhdrs/proc01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-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 469ef59382..0000000000
--- a/testsuites/psxtests/psxhdrs/proc02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-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 69a94d51af..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-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 25809433c5..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-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 d3cb7835cf..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-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 9de56e6de3..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-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 1f05103761..0000000000
--- a/testsuites/psxtests/psxhdrs/proc07.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-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 9ef24d36c1..0000000000
--- a/testsuites/psxtests/psxhdrs/proc08.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-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 10d90ada2f..0000000000
--- a/testsuites/psxtests/psxhdrs/proc09.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-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 c57d0cd05e..0000000000
--- a/testsuites/psxtests/psxhdrs/proc10.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-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 531139f8f7..0000000000
--- a/testsuites/psxtests/psxhdrs/proc11.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <limits.h> /* 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 7437189dbe..0000000000
--- a/testsuites/psxtests/psxhdrs/proc12.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-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 7982132e9b..0000000000
--- a/testsuites/psxtests/psxhdrs/proc13.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-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 b905d18ea1..0000000000
--- a/testsuites/psxtests/psxhdrs/proc14.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-
-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 9b95ecd5f9..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 a88a76b4a5..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 28be165a5f..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread03.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 84a4aad280..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 669a356fbf..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-#include <limits.h> /* 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 2140678008..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread06.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 7b6b6c8c55..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread07.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 a3bab33ef1..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread08.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 d4a9754fb8..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread09.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 8cb965ca87..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread10.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 5a9faca6dd..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread11.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * This test file is used to verify that the header files associated with
- * invoking this function are correct.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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, &param );
-}
diff --git a/testsuites/psxtests/psxhdrs/pthread12.c b/testsuites/psxtests/psxhdrs/pthread12.c
deleted file mode 100644
index 00b88a53ab..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread12.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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, &param );
-}
diff --git a/testsuites/psxtests/psxhdrs/pthread13.c b/testsuites/psxtests/psxhdrs/pthread13.c
deleted file mode 100644
index 9126951486..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread13.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 58a75a4f17..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread14.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 10435a266b..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread15.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 54960897ec..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread16.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 24f6b0386f..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread17.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 b59860997d..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread18.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 fc968e065e..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread19.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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, &param );
-}
diff --git a/testsuites/psxtests/psxhdrs/pthread20.c b/testsuites/psxtests/psxhdrs/pthread20.c
deleted file mode 100644
index d6432f25c4..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread20.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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, &param );
-}
diff --git a/testsuites/psxtests/psxhdrs/pthread21.c b/testsuites/psxtests/psxhdrs/pthread21.c
deleted file mode 100644
index e94a5c5f29..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread21.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 d163cc3352..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread22.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * This test file is used to verify that the header files associated with
- * invoking this function are correct.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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, &param );
-}
diff --git a/testsuites/psxtests/psxhdrs/pthread23.c b/testsuites/psxtests/psxhdrs/pthread23.c
deleted file mode 100644
index fc12a615cc..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread23.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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, &param );
-}
diff --git a/testsuites/psxtests/psxhdrs/pthread24.c b/testsuites/psxtests/psxhdrs/pthread24.c
deleted file mode 100644
index afb8d3b2e9..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread24.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-#include <limits.h> /* 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 48e01eaa53..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread25.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-#include <limits.h> /* 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 6643454b6f..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread26.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 2f80f1c098..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread27.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 a9d78e36fa..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread28.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 45efbc0bb9..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread29.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 44e885612e..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread30.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 d553a09e65..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread31.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 80990610ec..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread32.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 7cff807ef0..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread33.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 fc575a6056..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread34.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 d9dd771c2c..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread35.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 80ddd64578..0000000000
--- a/testsuites/psxtests/psxhdrs/pthread36.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <pthread.h>
-
-#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 7e1e9ca621..0000000000
--- a/testsuites/psxtests/psxhdrs/sched01.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * This test file is used to verify that the header files associated with
- * invoking this function are correct.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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, &param );
-}
diff --git a/testsuites/psxtests/psxhdrs/sched02.c b/testsuites/psxtests/psxhdrs/sched02.c
deleted file mode 100644
index 5475b22382..0000000000
--- a/testsuites/psxtests/psxhdrs/sched02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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, &param );
-}
diff --git a/testsuites/psxtests/psxhdrs/sched03.c b/testsuites/psxtests/psxhdrs/sched03.c
deleted file mode 100644
index 19a2774b94..0000000000
--- a/testsuites/psxtests/psxhdrs/sched03.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * This test file is used to verify that the header files associated with
- * invoking this function are correct.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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, &param );
-}
diff --git a/testsuites/psxtests/psxhdrs/sched04.c b/testsuites/psxtests/psxhdrs/sched04.c
deleted file mode 100644
index bc002be98a..0000000000
--- a/testsuites/psxtests/psxhdrs/sched04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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 179bc7b4e0..0000000000
--- a/testsuites/psxtests/psxhdrs/sched05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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 055b0d197f..0000000000
--- a/testsuites/psxtests/psxhdrs/sched06.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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 5743359f6a..0000000000
--- a/testsuites/psxtests/psxhdrs/sched07.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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 2fdadc2924..0000000000
--- a/testsuites/psxtests/psxhdrs/sched08.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sched.h>
-
-#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 adc7c43f4d..0000000000
--- a/testsuites/psxtests/psxhdrs/signal01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 a16ed63a6b..0000000000
--- a/testsuites/psxtests/psxhdrs/signal02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 27c778b7c4..0000000000
--- a/testsuites/psxtests/psxhdrs/signal03.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 a0b22d39ca..0000000000
--- a/testsuites/psxtests/psxhdrs/signal04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 b473c55f1e..0000000000
--- a/testsuites/psxtests/psxhdrs/signal05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 e90bc62e37..0000000000
--- a/testsuites/psxtests/psxhdrs/signal06.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This test file is used to verify that the header files associated with
- * invoking this function are correct.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 e30a07791d..0000000000
--- a/testsuites/psxtests/psxhdrs/signal07.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-#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 251c8d3af6..0000000000
--- a/testsuites/psxtests/psxhdrs/signal08.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-#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 b33647d147..0000000000
--- a/testsuites/psxtests/psxhdrs/signal09.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <signal.h>
-
-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 dc5f7c27d5..0000000000
--- a/testsuites/psxtests/psxhdrs/signal10.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 0af70d9ef5..0000000000
--- a/testsuites/psxtests/psxhdrs/signal11.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 36926a98ea..0000000000
--- a/testsuites/psxtests/psxhdrs/signal12.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 2270066aaa..0000000000
--- a/testsuites/psxtests/psxhdrs/signal13.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 192b824655..0000000000
--- a/testsuites/psxtests/psxhdrs/signal14.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 1dabed1945..0000000000
--- a/testsuites/psxtests/psxhdrs/signal15.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 cc8bfe9bbb..0000000000
--- a/testsuites/psxtests/psxhdrs/signal16.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-#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 152883d0bf..0000000000
--- a/testsuites/psxtests/psxhdrs/signal17.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 1deb450c27..0000000000
--- a/testsuites/psxtests/psxhdrs/signal18.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 e4497623bb..0000000000
--- a/testsuites/psxtests/psxhdrs/signal19.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 928b528906..0000000000
--- a/testsuites/psxtests/psxhdrs/signal20.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 6572d5a9af..0000000000
--- a/testsuites/psxtests/psxhdrs/signal21.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <signal.h>
-
-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 a944c79edd..0000000000
--- a/testsuites/psxtests/psxhdrs/signal22.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <unistd.h>
-
-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 2c2a811ebd..0000000000
--- a/testsuites/psxtests/psxhdrs/time01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-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 233b33adbe..0000000000
--- a/testsuites/psxtests/psxhdrs/time02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-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 1d44f3d927..0000000000
--- a/testsuites/psxtests/psxhdrs/time03.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-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( &timestruct );
-}
diff --git a/testsuites/psxtests/psxhdrs/time04.c b/testsuites/psxtests/psxhdrs/time04.c
deleted file mode 100644
index 9db332a605..0000000000
--- a/testsuites/psxtests/psxhdrs/time04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-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 817df63f30..0000000000
--- a/testsuites/psxtests/psxhdrs/time05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-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", &timestruct );
-}
diff --git a/testsuites/psxtests/psxhdrs/time06.c b/testsuites/psxtests/psxhdrs/time06.c
deleted file mode 100644
index abdeee0d24..0000000000
--- a/testsuites/psxtests/psxhdrs/time06.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- char *buffer;
- struct tm timestruct;
-
- buffer = asctime( &timestruct );
-}
diff --git a/testsuites/psxtests/psxhdrs/time07.c b/testsuites/psxtests/psxhdrs/time07.c
deleted file mode 100644
index 66eebe6d37..0000000000
--- a/testsuites/psxtests/psxhdrs/time07.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-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 8e0cd49bcd..0000000000
--- a/testsuites/psxtests/psxhdrs/time08.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-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 9069927fcc..0000000000
--- a/testsuites/psxtests/psxhdrs/time09.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-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 a87fa0079b..0000000000
--- a/testsuites/psxtests/psxhdrs/time10.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- char *buffer_pointer;
- struct tm timestruct;
- char buffer[ 80 ];
-
- buffer_pointer = asctime_r( &timestruct, buffer );
-}
diff --git a/testsuites/psxtests/psxhdrs/time11.c b/testsuites/psxtests/psxhdrs/time11.c
deleted file mode 100644
index 8c5e4d8a7f..0000000000
--- a/testsuites/psxtests/psxhdrs/time11.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-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 46ac4d44bf..0000000000
--- a/testsuites/psxtests/psxhdrs/time12.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- time_t time;
- struct tm *timestruct_pointer;
- struct tm timestruct;
-
- timestruct_pointer = gmtime_r( &time, &timestruct );
-}
diff --git a/testsuites/psxtests/psxhdrs/time13.c b/testsuites/psxtests/psxhdrs/time13.c
deleted file mode 100644
index ff9a42eb96..0000000000
--- a/testsuites/psxtests/psxhdrs/time13.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-void test( void )
-{
- time_t time;
- struct tm *timestruct_pointer;
- struct tm timestruct;
-
- timestruct_pointer = localtime_r( &time, &timestruct );
-}
diff --git a/testsuites/psxtests/psxhdrs/timer01.c b/testsuites/psxtests/psxhdrs/timer01.c
deleted file mode 100644
index 02be02cff1..0000000000
--- a/testsuites/psxtests/psxhdrs/timer01.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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 b312d2e143..0000000000
--- a/testsuites/psxtests/psxhdrs/timer02.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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 5ae0efe07f..0000000000
--- a/testsuites/psxtests/psxhdrs/timer03.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This test file is used to verify that the header files associated with
- * invoking this function are correct.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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 aea13743f0..0000000000
--- a/testsuites/psxtests/psxhdrs/timer04.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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 f514857e12..0000000000
--- a/testsuites/psxtests/psxhdrs/timer05.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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 5d0274397c..0000000000
--- a/testsuites/psxtests/psxhdrs/timer06.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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <time.h>
-
-#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/samples/README b/testsuites/samples/README
deleted file mode 100644
index bc618c5cfd..0000000000
--- a/testsuites/samples/README
+++ /dev/null
@@ -1,73 +0,0 @@
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and distribution 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/apptask.c b/testsuites/samples/base_mp/apptask.c
deleted file mode 100644
index c4ffaa1625..0000000000
--- a/testsuites/samples/base_mp/apptask.c
+++ /dev/null
@@ -1,37 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 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 58f66e76e5..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_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/base_mp.doc b/testsuites/samples/base_mp/node1/base_mp.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/samples/base_mp/node1/base_mp.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/base_mp.doc b/testsuites/samples/base_mp/node2/base_mp.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/samples/base_mp/node2/base_mp.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 27088d078c..0000000000
--- a/testsuites/samples/base_mp/system.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Application_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_MPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-/*
- * Put the overrides of default configuration parameters here.
- */
-
-#include <confdefs.h>
-
-/* variables */
-
-TEST_EXTERN rtems_id Global_variable; /* example global variable */
-
-/* end of include file */
diff --git a/testsuites/samples/base_sp/apptask.c b/testsuites/samples/base_sp/apptask.c
deleted file mode 100644
index 2a3196a37f..0000000000
--- a/testsuites/samples/base_sp/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: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 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 496f3569e5..0000000000
--- a/testsuites/samples/base_sp/base_sp.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 c3f1aabefc..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 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 b0c56044ae..0000000000
--- a/testsuites/samples/base_sp/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Application_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Global_variable; /* example global variable */
-
-/* end of include file */
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 4d408147cc..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <stdio.h>
diff --git a/testsuites/samples/cdtest/main.cc b/testsuites/samples/cdtest/main.cc
deleted file mode 100644
index 19f7d50174..0000000000
--- a/testsuites/samples/cdtest/main.cc
+++ /dev/null
@@ -1,142 +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.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef RTEMS_TEST_IO_STREAM
-#include <iostream.h>
-#endif
-
-extern "C" {
-extern rtems_task main_task(rtems_task_argument);
-}
-
-static int num_inst = 0;
-
-class A {
-public:
- A(void)
- {
- num_inst++;
- printf(
- "Hey I'm in base class constructor number %d for %p.\n",
- num_inst,
- this
- );
-
- /*
- * Make sure we use some space
- */
-
- string = new char[50];
- sprintf(string, "Instantiation order %d", num_inst);
- };
-
- virtual ~A()
- {
- printf(
- "Hey I'm in base class destructor number %d for %p.\n",
- num_inst,
- this
- );
- print();
- num_inst--;
- };
-
- virtual void print() { printf("%s\n", string); };
-
-protected:
- char *string;
-};
-
-class B : public A {
-public:
- B(void)
- {
- num_inst++;
- printf(
- "Hey I'm in derived class constructor number %d for %p.\n",
- num_inst,
- this
- );
-
- /*
- * Make sure we use some space
- */
-
- string = new char[50];
- sprintf(string, "Instantiation order %d", num_inst);
- };
-
- ~B()
- {
- printf(
- "Hey I'm in derived class destructor number %d for %p.\n",
- num_inst,
- this
- );
- print();
- num_inst--;
- };
-
- void print() { printf("Derived class - %s\n", string); }
-};
-
-
-A foo;
-B foobar;
-
-void
-cdtest(void)
-{
- A bar, blech, blah;
- B bleak;
-
-#ifdef RTEMS_TEST_IO_STREAM
- cout << "Testing a C++ I/O stream" << endl;
-#else
- printf("IO Stream not tested\n");
-#endif
-
- bar = blech;
-}
-
-//
-// main equivalent
-// It can not be called 'main' since the bsp owns that name
-// in many implementations in order to get global constructors
-// run.
-//
-
-
-rtems_task main_task(
- rtems_task_argument
-)
-{
- printf( "\n\n*** CONSTRUCTOR/DESTRUCTOR TEST ***\n" );
-
- cdtest();
-
- printf( "*** END OF CONSTRUCTOR/DESTRUCTOR TEST ***\n\n\n" );
-
- exit(0);
-}
diff --git a/testsuites/samples/cdtest/system.h b/testsuites/samples/cdtest/system.h
deleted file mode 100644
index 975be98a2f..0000000000
--- a/testsuites/samples/cdtest/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task main_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Global_variable; /* example global variable */
-
-/* end of include file */
diff --git a/testsuites/samples/hello/hello.doc b/testsuites/samples/hello/hello.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/samples/hello/hello.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 3931c1a2bf..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <stdio.h>
-
-rtems_task Init(
- rtems_task_argument ignored
-)
-{
- printf( "\n\n*** HELLO WORLD TEST ***\n" );
- printf( "Hello World\n" );
- printf( "*** END OF HELLO WORLD TEST ***\n" );
- exit( 0 );
-}
diff --git a/testsuites/samples/hello/system.h b/testsuites/samples/hello/system.h
deleted file mode 100644
index 94a854da15..0000000000
--- a/testsuites/samples/hello/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Global_variable; /* example global variable */
-
-/* end of include file */
diff --git a/testsuites/samples/paranoia/init.c b/testsuites/samples/paranoia/init.c
deleted file mode 100644
index c562e9c44a..0000000000
--- a/testsuites/samples/paranoia/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 test, it should also be set to a known
- * value by this function.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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"
-
-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 67228436e1..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 <stdio.h>
-#include <string.h>
-
-#if defined(solaris2)
-#include <math.h>
-#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 <reent.h>
-struct _reent libm_reent = _REENT_INIT(libm_reent);
-struct _reent *_impure_ptr = &libm_reent;
-#endif
-
-#ifndef NOSIGNAL
-#include <signal.h>
-#include <setjmp.h>
-#else /* NOSIGNAL */
-#define longjmp(e,v)
-#define setjmp(e) 0
-#define jmp_buf int
-#endif /* NOSIGNAL */
-
-#ifdef SINGLE_PRECISION
-#define FLOAT float
-#define FABS(x) (float)fabs((double)(x))
-#define FLOOR(x) (float)floor((double)(x))
-#define LOG(x) (float)log((double)(x))
-#define POW(x,y) (float)pow((double)(x),(double)(y))
-#define SQRT(x) (float)sqrt((double)(x))
-#else /* !SINGLE_PRECISION */
-#define FLOAT double
-#define FABS(x) fabs(x)
-#define FLOOR(x) floor(x)
-#define LOG(x) log(x)
-#define POW(x,y) pow(x,y)
-#define SQRT(x) sqrt(x)
-#endif /* SINGLE_PRECISION */
-
-jmp_buf ovfl_buf;
-extern double fabs (), floor (), log (), pow (), sqrt ();
-extern void exit ();
-typedef void (*Sig_type) ();
-FLOAT Sign (), Random ();
-extern void BadCond ();
-extern void SqXMinX ();
-extern void TstCond ();
-extern void notify ();
-extern int read ();
-extern void Characteristics ();
-extern void Heading ();
-extern void History ();
-extern void Instructions ();
-extern void IsYeqX ();
-extern void NewD ();
-extern void Pause ();
-extern void PrintIfNPositive ();
-extern void SR3750 ();
-extern void SR3980 ();
-extern void TstPtUf ();
-
-Sig_type sigsave;
-
-#define KEYBOARD 0
-
-FLOAT Radix, BInvrse, RadixD2, BMinusU2;
-
-/*Small floating point constants.*/
-FLOAT Zero = 0.0;
-FLOAT Half = 0.5;
-FLOAT One = 1.0;
-FLOAT Two = 2.0;
-FLOAT Three = 3.0;
-FLOAT Four = 4.0;
-FLOAT Five = 5.0;
-FLOAT Eight = 8.0;
-FLOAT Nine = 9.0;
-FLOAT TwentySeven = 27.0;
-FLOAT ThirtyTwo = 32.0;
-FLOAT TwoForty = 240.0;
-FLOAT MinusOne = -1.0;
-FLOAT OneAndHalf = 1.5;
-
-/*Integer constants*/
-int NoTrials = 20; /*Number of tests for commutativity. */
-#define False 0
-#define True 1
-
-/*
- * Definitions for declared types
- * Guard == (Yes, No);
- * Rounding == (Chopped, Rounded, Other);
- * Message == packed array [1..40] of char;
- * Class == (Flaw, Defect, Serious, Failure);
- */
-#define Yes 1
-#define No 0
-#define Chopped 2
-#define Rounded 1
-#define Other 0
-#define Flaw 3
-#define Defect 2
-#define Serious 1
-#define Failure 0
-typedef int Guard, Rounding, Class;
-typedef char Message;
-
-/* Declarations of Variables */
-int Indx;
-char ch[8];
-FLOAT AInvrse, A1;
-FLOAT C, CInvrse;
-FLOAT D, FourD;
-FLOAT E0, E1, Exp2, E3, MinSqEr;
-FLOAT SqEr, MaxSqEr, E9;
-FLOAT Third;
-FLOAT F6, F9;
-FLOAT H, HInvrse;
-int I;
-FLOAT StickyBit, J;
-FLOAT MyZero;
-FLOAT Precision;
-FLOAT Q, Q9;
-FLOAT R, Random9;
-FLOAT T, Underflow, S;
-FLOAT OneUlp, UfThold, U1, U2;
-FLOAT V, V0, V9;
-FLOAT W;
-FLOAT X, X1, X2, X8, Random1;
-FLOAT Y, Y1, Y2, Random2;
-FLOAT Z, PseudoZero, Z1, Z2, Z9;
-int ErrCnt[4];
-int fpecount;
-int Milestone;
-int PageNo;
-int M, N, N1;
-Guard GMult, GDiv, GAddSub;
-Rounding RMult, RDiv, RAddSub, RSqrt;
-int Break, Done, NotMonot, Monot, Anomaly, IEEE, SqRWrng, UfNGrad;
-
-/* Computed constants.
- * U1 gap below 1.0, i.e, 1.0 - U1 is next number below 1.0
- * U2 gap above 1.0, i.e, 1.0 + U2 is next number above 1.0
- */
-
-int batchmode; /* global batchmode test */
-
-/* program name and version variables and macro */
-char *temp;
-char *program_name;
-char *program_vers;
-
-#ifndef VERSION
-#define VERSION "1.1 [cygnus]"
-#endif /* VERSION */
-
-#define basename(cp) ((temp=(char *)strrchr((cp), '/')) ? temp+1 : (cp))
-
-#ifndef BATCHMODE
-# ifdef CYGNUS
-# define BATCHMODE
-# endif
-#endif
-
-/* floating point exception receiver */
-void
-_sigfpe (x)
-int x;
-{
- fpecount++;
- printf ("\n* * * FLOATING-POINT ERROR %d * * *\n", x);
- fflush (stdout);
- if (sigsave) {
-#ifndef NOSIGNAL
- signal (SIGFPE, sigsave);
-#endif /* NOSIGNAL */
- sigsave = 0;
- longjmp (ovfl_buf, 1);
- }
- exit (1);
-}
-
-#ifdef NOMAIN
-#define main paranoia
-#endif
-
-int
-main (argc, argv)
-int argc;
-char **argv;
-{
- /* First two assignments use integer right-hand sides. */
- Zero = 0;
- One = 1;
- Two = One + One;
- Three = Two + One;
- Four = Three + One;
- Five = Four + One;
- Eight = Four + Four;
- Nine = Three * Three;
- TwentySeven = Nine * Three;
- ThirtyTwo = Four * Eight;
- TwoForty = Four * Five * Three * Four;
- MinusOne = -One;
- Half = One / Two;
- OneAndHalf = One + Half;
- ErrCnt[Failure] = 0;
- ErrCnt[Serious] = 0;
- ErrCnt[Defect] = 0;
- ErrCnt[Flaw] = 0;
- PageNo = 1;
-
-#ifdef BATCHMODE
- batchmode = 1; /* run test in batchmode? */
-#else /* !BATCHMODE */
- batchmode = 0; /* run test interactively */
-#endif /* BATCHMODE */
-
- program_name = basename (argv[0]);
- program_vers = VERSION;
-
- printf ("%s version %s\n", program_name, program_vers);
-
- /*=============================================*/
- Milestone = 0;
- /*=============================================*/
-#ifndef NOSIGNAL
- signal (SIGFPE, _sigfpe);
-#endif
-
- if (!batchmode) {
- Instructions ();
- Pause ();
- Heading ();
- Instructions ();
- Pause ();
- Heading ();
- Pause ();
- Characteristics ();
- Pause ();
- History ();
- Pause ();
- }
-
- /*=============================================*/
- Milestone = 7;
- /*=============================================*/
- printf ("Program is now RUNNING tests on small integers:\n");
- TstCond (Failure, (Zero + Zero == Zero) && (One - One == Zero)
- && (One > Zero) && (One + One == Two),
- "0+0 != 0, 1-1 != 0, 1 <= 0, or 1+1 != 2");
- Z = -Zero;
- if (Z != 0.0) {
- ErrCnt[Failure] = ErrCnt[Failure] + 1;
- printf ("Comparison alleges that -0.0 is Non-zero!\n");
- U1 = 0.001;
- Radix = 1;
- TstPtUf ();
- }
- TstCond (Failure, (Three == Two + One) && (Four == Three + One)
- && (Four + Two * (-Two) == Zero)
- && (Four - Three - One == Zero),
- "3 != 2+1, 4 != 3+1, 4+2*(-2) != 0, or 4-3-1 != 0");
- TstCond (Failure, (MinusOne == (0 - One))
- && (MinusOne + One == Zero) && (One + MinusOne == Zero)
- && (MinusOne + FABS (One) == Zero)
- && (MinusOne + MinusOne * MinusOne == Zero),
- "-1+1 != 0, (-1)+abs(1) != 0, or -1+(-1)*(-1) != 0");
- TstCond (Failure, Half + MinusOne + Half == Zero,
- "1/2 + (-1) + 1/2 != 0");
- /*=============================================*/
- Milestone = 10;
- /*=============================================*/
- TstCond (Failure, (Nine == Three * Three)
- && (TwentySeven == Nine * Three) && (Eight == Four + Four)
- && (ThirtyTwo == Eight * Four)
- && (ThirtyTwo - TwentySeven - Four - One == Zero),
- "9 != 3*3, 27 != 9*3, 32 != 8*4, or 32-27-4-1 != 0");
- TstCond (Failure, (Five == Four + One) &&
- (TwoForty == Four * Five * Three * Four)
- && (TwoForty / Three - Four * Four * Five == Zero)
- && (TwoForty / Four - Five * Three * Four == Zero)
- && (TwoForty / Five - Four * Three * Four == Zero),
- "5 != 4+1, 240/3 != 80, 240/4 != 60, or 240/5 != 48");
- if (ErrCnt[Failure] == 0) {
- printf ("-1, 0, 1/2, 1, 2, 3, 4, 5, 9, 27, 32 & 240 are O.K.\n");
- printf ("\n");
- }
- printf ("Searching for Radix and Precision.\n");
- W = One;
- do {
- W = W + W;
- Y = W + One;
- Z = Y - W;
- Y = Z - One;
- }
- while (MinusOne + FABS (Y) < Zero);
- /*.. now W is just big enough that |((W+1)-W)-1| >= 1 ...*/
- Precision = Zero;
- Y = One;
- do {
- Radix = W + Y;
- Y = Y + Y;
- Radix = Radix - W;
- }
- while (Radix == Zero);
- if (Radix < Two)
- Radix = One;
- printf ("Radix = %f .\n", Radix);
- if (Radix != 1) {
- W = One;
- do {
- Precision = Precision + One;
- W = W * Radix;
- Y = W + One;
- }
- while ((Y - W) == One);
- }
- /*... now W == Radix^Precision is barely too big to satisfy (W+1)-W == 1
- ...*/
- U1 = One / W;
- U2 = Radix * U1;
- printf ("Closest relative separation found is U1 = %.7e .\n\n", U1);
- printf ("Recalculating radix and precision\n ");
-
- /*save old values*/
- E0 = Radix;
- E1 = U1;
- E9 = U2;
- E3 = Precision;
-
- X = Four / Three;
- Third = X - One;
- F6 = Half - Third;
- X = F6 + F6;
- X = FABS (X - Third);
- if (X < U2)
- X = U2;
-
- /*... now X = (unknown no.) ulps of 1+...*/
- do {
- U2 = X;
- Y = Half * U2 + ThirtyTwo * U2 * U2;
- Y = One + Y;
- X = Y - One;
- }
- while (!((U2 <= X) || (X <= Zero)));
-
- /*... now U2 == 1 ulp of 1 + ... */
- X = Two / Three;
- F6 = X - Half;
- Third = F6 + F6;
- X = Third - Half;
- X = FABS (X + F6);
- if (X < U1)
- X = U1;
-
- /*... now X == (unknown no.) ulps of 1 -... */
- do {
- U1 = X;
- Y = Half * U1 + ThirtyTwo * U1 * U1;
- Y = Half - Y;
- X = Half + Y;
- Y = Half - X;
- X = Half + Y;
- }
- while (!((U1 <= X) || (X <= Zero)));
- /*... now U1 == 1 ulp of 1 - ... */
- if (U1 == E1)
- printf ("confirms closest relative separation U1 .\n");
- else
- printf ("gets better closest relative separation U1 = %.7e .\n", U1);
- W = One / U1;
- F9 = (Half - U1) + Half;
- Radix = FLOOR (0.01 + U2 / U1);
- if (Radix == E0)
- printf ("Radix confirmed.\n");
- else
- printf ("MYSTERY: recalculated Radix = %.7e .\n", Radix);
- TstCond (Defect, Radix <= Eight + Eight,
- "Radix is too big: roundoff problems");
- TstCond (Flaw, (Radix == Two) || (Radix == 10)
- || (Radix == One), "Radix is not as good as 2 or 10");
- /*=============================================*/
- Milestone = 20;
- /*=============================================*/
- TstCond (Failure, F9 - Half < Half,
- "(1-U1)-1/2 < 1/2 is FALSE, prog. fails?");
- X = F9;
- I = 1;
- Y = X - Half;
- Z = Y - Half;
- TstCond (Failure, (X != One)
- || (Z == Zero), "Comparison is fuzzy,X=1 but X-1/2-1/2 != 0");
- X = One + U2;
- I = 0;
- /*=============================================*/
- Milestone = 25;
- /*=============================================*/
- /*... BMinusU2 = nextafter(Radix, 0) */
- BMinusU2 = Radix - One;
- BMinusU2 = (BMinusU2 - U2) + One;
- /* Purify Integers */
- if (Radix != One) {
- X = -TwoForty * LOG (U1) / LOG (Radix);
- Y = FLOOR (Half + X);
- if (FABS (X - Y) * Four < One)
- X = Y;
- Precision = X / TwoForty;
- Y = FLOOR (Half + Precision);
- if (FABS (Precision - Y) * TwoForty < Half)
- Precision = Y;
- }
- if ((Precision != FLOOR (Precision)) || (Radix == One)) {
- printf ("Precision cannot be characterized by an Integer number\n");
- printf ("of significant digits but, by itself, this is a minor flaw.\n");
- }
- if (Radix == One)
- printf ("logarithmic encoding has precision characterized solely by U1.\n");
- else
- printf ("The number of significant digits of the Radix is %f .\n",
- Precision);
- TstCond (Serious, U2 * Nine * Nine * TwoForty < One,
- "Precision worse than 5 decimal figures ");
- /*=============================================*/
- Milestone = 30;
- /*=============================================*/
- /* Test for extra-precise subepressions */
- X = FABS (((Four / Three - One) - One / Four) * Three - One / Four);
- do {
- Z2 = X;
- X = (One + (Half * Z2 + ThirtyTwo * Z2 * Z2)) - One;
- }
- while (!((Z2 <= X) || (X <= Zero)));
- X = Y = Z = FABS ((Three / Four - Two / Three) * Three - One / Four);
- do {
- Z1 = Z;
- Z = (One / Two - ((One / Two - (Half * Z1 + ThirtyTwo * Z1 * Z1))
- + One / Two)) + One / Two;
- }
- while (!((Z1 <= Z) || (Z <= Zero)));
- do {
- do {
- Y1 = Y;
- Y = (Half - ((Half - (Half * Y1 + ThirtyTwo * Y1 * Y1)) + Half
- )) + Half;
- }
- while (!((Y1 <= Y) || (Y <= Zero)));
- X1 = X;
- X = ((Half * X1 + ThirtyTwo * X1 * X1) - F9) + F9;
- }
- while (!((X1 <= X) || (X <= Zero)));
- if ((X1 != Y1) || (X1 != Z1)) {
- BadCond (Serious, "Disagreements among the values X1, Y1, Z1,\n");
- printf ("respectively %.7e, %.7e, %.7e,\n", X1, Y1, Z1);
- printf ("are symptoms of inconsistencies introduced\n");
- printf ("by extra-precise evaluation of arithmetic subexpressions.\n");
- notify ("Possibly some part of this");
- if ((X1 == U1) || (Y1 == U1) || (Z1 == U1))
- printf (
- "That feature is not tested further by this program.\n");
- } else {
- if ((Z1 != U1) || (Z2 != U2)) {
- if ((Z1 >= U1) || (Z2 >= U2)) {
- BadCond (Failure, "");
- notify ("Precision");
- printf ("\tU1 = %.7e, Z1 - U1 = %.7e\n", U1, Z1 - U1);
- printf ("\tU2 = %.7e, Z2 - U2 = %.7e\n", U2, Z2 - U2);
- } else {
- if ((Z1 <= Zero) || (Z2 <= Zero)) {
- printf ("Because of unusual Radix = %f", Radix);
- printf (", or exact rational arithmetic a result\n");
- printf ("Z1 = %.7e, or Z2 = %.7e ", Z1, Z2);
- notify ("of an\nextra-precision");
- }
- if (Z1 != Z2 || Z1 > Zero) {
- X = Z1 / U1;
- Y = Z2 / U2;
- if (Y > X)
- X = Y;
- Q = -LOG (X);
- printf ("Some subexpressions appear to be calculated extra\n");
- printf ("precisely with about %g extra B-digits, i.e.\n",
- (Q / LOG (Radix)));
- printf ("roughly %g extra significant decimals.\n",
- Q / LOG (10.));
- }
- printf ("That feature is not tested further by this program.\n");
- }
- }
- }
- Pause ();
- /*=============================================*/
- Milestone = 35;
- /*=============================================*/
- if (Radix >= Two) {
- X = W / (Radix * Radix);
- Y = X + One;
- Z = Y - X;
- T = Z + U2;
- X = T - Z;
- TstCond (Failure, X == U2,
- "Subtraction is not normalized X=Y,X+Z != Y+Z!");
- if (X == U2)
- printf (
- "Subtraction appears to be normalized, as it should be.");
- }
- printf ("\nChecking for guard digit in *, /, and -.\n");
- Y = F9 * One;
- Z = One * F9;
- X = F9 - Half;
- Y = (Y - Half) - X;
- Z = (Z - Half) - X;
- X = One + U2;
- T = X * Radix;
- R = Radix * X;
- X = T - Radix;
- X = X - Radix * U2;
- T = R - Radix;
- T = T - Radix * U2;
- X = X * (Radix - One);
- T = T * (Radix - One);
- if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T == Zero))
- GMult = Yes;
- else {
- GMult = No;
- TstCond (Serious, False,
- "* lacks a Guard Digit, so 1*X != X");
- }
- Z = Radix * U2;
- X = One + Z;
- Y = FABS ((X + Z) - X * X) - U2;
- X = One - U2;
- Z = FABS ((X - U2) - X * X) - U1;
- TstCond (Failure, (Y <= Zero)
- && (Z <= Zero), "* gets too many final digits wrong.\n");
- Y = One - U2;
- X = One + U2;
- Z = One / Y;
- Y = Z - X;
- X = One / Three;
- Z = Three / Nine;
- X = X - Z;
- T = Nine / TwentySeven;
- Z = Z - T;
- TstCond (Defect, X == Zero && Y == Zero && Z == Zero,
- "Division lacks a Guard Digit, so error can exceed 1 ulp\n\
-or 1/3 and 3/9 and 9/27 may disagree");
- Y = F9 / One;
- X = F9 - Half;
- Y = (Y - Half) - X;
- X = One + U2;
- T = X / One;
- X = T - X;
- if ((X == Zero) && (Y == Zero) && (Z == Zero))
- GDiv = Yes;
- else {
- GDiv = No;
- TstCond (Serious, False,
- "Division lacks a Guard Digit, so X/1 != X");
- }
- X = One / (One + U2);
- Y = X - Half - Half;
- TstCond (Serious, Y < Zero,
- "Computed value of 1/1.000..1 >= 1");
- X = One - U2;
- Y = One + Radix * U2;
- Z = X * Radix;
- T = Y * Radix;
- R = Z / Radix;
- StickyBit = T / Radix;
- X = R - X;
- Y = StickyBit - Y;
- TstCond (Failure, X == Zero && Y == Zero,
- "* and/or / gets too many last digits wrong");
- Y = One - U1;
- X = One - F9;
- Y = One - Y;
- T = Radix - U2;
- Z = Radix - BMinusU2;
- T = Radix - T;
- if ((X == U1) && (Y == U1) && (Z == U2) && (T == U2))
- GAddSub = Yes;
- else {
- GAddSub = No;
- TstCond (Serious, False,
- "- lacks Guard Digit, so cancellation is obscured");
- }
- if (F9 != One && F9 - One >= Zero) {
- BadCond (Serious, "comparison alleges (1-U1) < 1 although\n");
- printf (" subtraction yields (1-U1) - 1 = 0 , thereby vitiating\n");
- printf (" such precautions against division by zero as\n");
- printf (" ... if (X == 1.0) {.....} else {.../(X-1.0)...}\n");
- }
- if (GMult == Yes && GDiv == Yes && GAddSub == Yes)
- printf (
- " *, /, and - appear to have guard digits, as they should.\n");
- /*=============================================*/
- Milestone = 40;
- /*=============================================*/
- Pause ();
- printf ("Checking rounding on multiply, divide and add/subtract.\n");
- RMult = Other;
- RDiv = Other;
- RAddSub = Other;
- RadixD2 = Radix / Two;
- A1 = Two;
- Done = False;
- do {
- AInvrse = Radix;
- do {
- X = AInvrse;
- AInvrse = AInvrse / A1;
- }
- while (!(FLOOR (AInvrse) != AInvrse));
- Done = (X == One) || (A1 > Three);
- if (!Done)
- A1 = Nine + One;
- }
- while (!(Done));
- if (X == One)
- A1 = Radix;
- AInvrse = One / A1;
- X = A1;
- Y = AInvrse;
- Done = False;
- do {
- Z = X * Y - Half;
- TstCond (Failure, Z == Half,
- "X * (1/X) differs from 1");
- Done = X == Radix;
- X = Radix;
- Y = One / X;
- }
- while (!(Done));
- Y2 = One + U2;
- Y1 = One - U2;
- X = OneAndHalf - U2;
- Y = OneAndHalf + U2;
- Z = (X - U2) * Y2;
- T = Y * Y1;
- Z = Z - X;
- T = T - X;
- X = X * Y2;
- Y = (Y + U2) * Y1;
- X = X - OneAndHalf;
- Y = Y - OneAndHalf;
- if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T <= Zero)) {
- X = (OneAndHalf + U2) * Y2;
- Y = OneAndHalf - U2 - U2;
- Z = OneAndHalf + U2 + U2;
- T = (OneAndHalf - U2) * Y1;
- X = X - (Z + U2);
- StickyBit = Y * Y1;
- S = Z * Y2;
- T = T - Y;
- Y = (U2 - Y) + StickyBit;
- Z = S - (Z + U2 + U2);
- StickyBit = (Y2 + U2) * Y1;
- Y1 = Y2 * Y1;
- StickyBit = StickyBit - Y2;
- Y1 = Y1 - Half;
- if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T == Zero)
- && (StickyBit == Zero) && (Y1 == Half)) {
- RMult = Rounded;
- printf ("Multiplication appears to round correctly.\n");
- } else if ((X + U2 == Zero) && (Y < Zero) && (Z + U2 == Zero)
- && (T < Zero) && (StickyBit + U2 == Zero)
- && (Y1 < Half)) {
- RMult = Chopped;
- printf ("Multiplication appears to chop.\n");
- } else
- printf ("* is neither chopped nor correctly rounded.\n");
- if ((RMult == Rounded) && (GMult == No))
- notify ("Multiplication");
- } else
- printf ("* is neither chopped nor correctly rounded.\n");
- /*=============================================*/
- Milestone = 45;
- /*=============================================*/
- Y2 = One + U2;
- Y1 = One - U2;
- Z = OneAndHalf + U2 + U2;
- X = Z / Y2;
- T = OneAndHalf - U2 - U2;
- Y = (T - U2) / Y1;
- Z = (Z + U2) / Y2;
- X = X - OneAndHalf;
- Y = Y - T;
- T = T / Y1;
- Z = Z - (OneAndHalf + U2);
- T = (U2 - OneAndHalf) + T;
- if (!((X > Zero) || (Y > Zero) || (Z > Zero) || (T > Zero))) {
- X = OneAndHalf / Y2;
- Y = OneAndHalf - U2;
- Z = OneAndHalf + U2;
- X = X - Y;
- T = OneAndHalf / Y1;
- Y = Y / Y1;
- T = T - (Z + U2);
- Y = Y - Z;
- Z = Z / Y2;
- Y1 = (Y2 + U2) / Y2;
- Z = Z - OneAndHalf;
- Y2 = Y1 - Y2;
- Y1 = (F9 - U1) / F9;
- if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T == Zero)
- && (Y2 == Zero) && (Y2 == Zero)
- && (Y1 - Half == F9 - Half)) {
- RDiv = Rounded;
- printf ("Division appears to round correctly.\n");
- if (GDiv == No)
- notify ("Division");
- } else if ((X < Zero) && (Y < Zero) && (Z < Zero) && (T < Zero)
- && (Y2 < Zero) && (Y1 - Half < F9 - Half)) {
- RDiv = Chopped;
- printf ("Division appears to chop.\n");
- }
- }
- if (RDiv == Other)
- printf ("/ is neither chopped nor correctly rounded.\n");
- BInvrse = One / Radix;
- TstCond (Failure, (BInvrse * Radix - Half == Half),
- "Radix * ( 1 / Radix ) differs from 1");
- /*=============================================*/
- Milestone = 50;
- /*=============================================*/
- TstCond (Failure, ((F9 + U1) - Half == Half)
- && ((BMinusU2 + U2) - One == Radix - One),
- "Incomplete carry-propagation in Addition");
- X = One - U1 * U1;
- Y = One + U2 * (One - U2);
- Z = F9 - Half;
- X = (X - Half) - Z;
- Y = Y - One;
- if ((X == Zero) && (Y == Zero)) {
- RAddSub = Chopped;
- printf ("Add/Subtract appears to be chopped.\n");
- }
- if (GAddSub == Yes) {
- X = (Half + U2) * U2;
- Y = (Half - U2) * U2;
- X = One + X;
- Y = One + Y;
- X = (One + U2) - X;
- Y = One - Y;
- if ((X == Zero) && (Y == Zero)) {
- X = (Half + U2) * U1;
- Y = (Half - U2) * U1;
- X = One - X;
- Y = One - Y;
- X = F9 - X;
- Y = One - Y;
- if ((X == Zero) && (Y == Zero)) {
- RAddSub = Rounded;
- printf ("Addition/Subtraction appears to round correctly.\n");
- if (GAddSub == No)
- notify ("Add/Subtract");
- } else
- printf ("Addition/Subtraction neither rounds nor chops.\n");
- } else
- printf ("Addition/Subtraction neither rounds nor chops.\n");
- } else
- printf ("Addition/Subtraction neither rounds nor chops.\n");
- S = One;
- X = One + Half * (One + Half);
- Y = (One + U2) * Half;
- Z = X - Y;
- T = Y - X;
- StickyBit = Z + T;
- if (StickyBit != Zero) {
- S = Zero;
- BadCond (Flaw, "(X - Y) + (Y - X) is non zero!\n");
- }
- StickyBit = Zero;
- if ((GMult == Yes) && (GDiv == Yes) && (GAddSub == Yes)
- && (RMult == Rounded) && (RDiv == Rounded)
- && (RAddSub == Rounded) && (FLOOR (RadixD2) == RadixD2)) {
- printf ("Checking for sticky bit.\n");
- X = (Half + U1) * U2;
- Y = Half * U2;
- Z = One + Y;
- T = One + X;
- if ((Z - One <= Zero) && (T - One >= U2)) {
- Z = T + Y;
- Y = Z - X;
- if ((Z - T >= U2) && (Y - T == Zero)) {
- X = (Half + U1) * U1;
- Y = Half * U1;
- Z = One - Y;
- T = One - X;
- if ((Z - One == Zero) && (T - F9 == Zero)) {
- Z = (Half - U1) * U1;
- T = F9 - Z;
- Q = F9 - Y;
- if ((T - F9 == Zero) && (F9 - U1 - Q == Zero)) {
- Z = (One + U2) * OneAndHalf;
- T = (OneAndHalf + U2) - Z + U2;
- X = One + Half / Radix;
- Y = One + Radix * U2;
- Z = X * Y;
- if (T == Zero && X + Radix * U2 - Z == Zero) {
- if (Radix != Two) {
- X = Two + U2;
- Y = X / Two;
- if ((Y - One == Zero))
- StickyBit = S;
- } else
- StickyBit = S;
- }
- }
- }
- }
- }
- }
- if (StickyBit == One)
- printf ("Sticky bit apparently used correctly.\n");
- else
- printf ("Sticky bit used incorrectly or not at all.\n");
- TstCond (Flaw, !(GMult == No || GDiv == No || GAddSub == No ||
- RMult == Other || RDiv == Other || RAddSub == Other),
- "lack(s) of guard digits or failure(s) to correctly round or chop\n\
-(noted above) count as one flaw in the final tally below");
- /*=============================================*/
- Milestone = 60;
- /*=============================================*/
- printf ("\n");
- printf ("Does Multiplication commute? ");
- printf ("Testing on %d random pairs.\n", NoTrials);
- Random9 = SQRT (3.0);
- Random1 = Third;
- I = 1;
- do {
- X = Random ();
- Y = Random ();
- Z9 = Y * X;
- Z = X * Y;
- Z9 = Z - Z9;
- I = I + 1;
- }
- while (!((I > NoTrials) || (Z9 != Zero)));
- if (I == NoTrials) {
- Random1 = One + Half / Three;
- Random2 = (U2 + U1) + One;
- Z = Random1 * Random2;
- Y = Random2 * Random1;
- Z9 = (One + Half / Three) * ((U2 + U1) + One) - (One + Half /
- Three) * ((U2 + U1) + One);
- }
- if (!((I == NoTrials) || (Z9 == Zero)))
- BadCond (Defect, "X * Y == Y * X trial fails.\n");
- else
- printf (" No failures found in %d integer pairs.\n", NoTrials);
- /*=============================================*/
- Milestone = 70;
- /*=============================================*/
- printf ("\nRunning test of square root(x).\n");
- TstCond (Failure, (Zero == SQRT (Zero))
- && (-Zero == SQRT (-Zero))
- && (One == SQRT (One)), "Square root of 0.0, -0.0 or 1.0 wrong");
- MinSqEr = Zero;
- MaxSqEr = Zero;
- J = Zero;
- X = Radix;
- OneUlp = U2;
- SqXMinX (Serious);
- X = BInvrse;
- OneUlp = BInvrse * U1;
- SqXMinX (Serious);
- X = U1;
- OneUlp = U1 * U1;
- SqXMinX (Serious);
- if (J != Zero)
- Pause ();
- printf ("Testing if sqrt(X * X) == X for %d Integers X.\n", NoTrials);
- J = Zero;
- X = Two;
- Y = Radix;
- if ((Radix != One))
- do {
- X = Y;
- Y = Radix * Y;
- }
- while (!((Y - X >= NoTrials)));
- OneUlp = X * U2;
- I = 1;
- while (I <= NoTrials) {
- X = X + One;
- SqXMinX (Defect);
- if (J > Zero)
- break;
- I = I + 1;
- }
- printf ("Test for sqrt monotonicity.\n");
- I = -1;
- X = BMinusU2;
- Y = Radix;
- Z = Radix + Radix * U2;
- NotMonot = False;
- Monot = False;
- while (!(NotMonot || Monot)) {
- I = I + 1;
- X = SQRT (X);
- Q = SQRT (Y);
- Z = SQRT (Z);
- if ((X > Q) || (Q > Z))
- NotMonot = True;
- else {
- Q = FLOOR (Q + Half);
- if ((I > 0) || (Radix == Q * Q))
- Monot = True;
- else if (I > 0) {
- if (I > 1)
- Monot = True;
- else {
- Y = Y * BInvrse;
- X = Y - U1;
- Z = Y + U1;
- }
- } else {
- Y = Q;
- X = Y - U2;
- Z = Y + U2;
- }
- }
- }
- if (Monot)
- printf ("sqrt has passed a test for Monotonicity.\n");
- else {
- BadCond (Defect, "");
- printf ("sqrt(X) is non-monotonic for X near %.7e .\n", Y);
- }
- /*=============================================*/
- Milestone = 80;
- /*=============================================*/
- MinSqEr = MinSqEr + Half;
- MaxSqEr = MaxSqEr - Half;
- Y = (SQRT (One + U2) - One) / U2;
- SqEr = (Y - One) + U2 / Eight;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- SqEr = Y + U2 / Eight;
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- Y = ((SQRT (F9) - U2) - (One - U2)) / U1;
- SqEr = Y + U1 / Eight;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- SqEr = (Y + One) + U1 / Eight;
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- OneUlp = U2;
- X = OneUlp;
- for (Indx = 1; Indx <= 3; ++Indx) {
- Y = SQRT ((X + U1 + X) + F9);
- Y = ((Y - U2) - ((One - U2) + X)) / OneUlp;
- Z = ((U1 - X) + F9) * Half * X * X / OneUlp;
- SqEr = (Y + Half) + Z;
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- SqEr = (Y - Half) + Z;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- if (((Indx == 1) || (Indx == 3)))
- X = OneUlp * Sign (X) * FLOOR (Eight / (Nine * SQRT (OneUlp)));
- else {
- OneUlp = U1;
- X = -OneUlp;
- }
- }
- /*=============================================*/
- Milestone = 85;
- /*=============================================*/
- SqRWrng = False;
- Anomaly = False;
- RSqrt = Other; /* ~dgh */
- if (Radix != One) {
- printf ("Testing whether sqrt is rounded or chopped.\n");
- D = FLOOR (Half + POW (Radix, One + Precision - FLOOR (Precision)));
- /* ... == Radix^(1 + fract) if (Precision == Integer + fract. */
- X = D / Radix;
- Y = D / A1;
- if ((X != FLOOR (X)) || (Y != FLOOR (Y))) {
- Anomaly = True;
- } else {
- X = Zero;
- Z2 = X;
- Y = One;
- Y2 = Y;
- Z1 = Radix - One;
- FourD = Four * D;
- do {
- if (Y2 > Z2) {
- Q = Radix;
- Y1 = Y;
- do {
- X1 = FABS (Q + FLOOR (Half - Q / Y1) * Y1);
- Q = Y1;
- Y1 = X1;
- }
- while (!(X1 <= Zero));
- if (Q <= One) {
- Z2 = Y2;
- Z = Y;
- }
- }
- Y = Y + Two;
- X = X + Eight;
- Y2 = Y2 + X;
- if (Y2 >= FourD)
- Y2 = Y2 - FourD;
- }
- while (!(Y >= D));
- X8 = FourD - Z2;
- Q = (X8 + Z * Z) / FourD;
- X8 = X8 / Eight;
- if (Q != FLOOR (Q))
- Anomaly = True;
- else {
- Break = False;
- do {
- X = Z1 * Z;
- X = X - FLOOR (X / Radix) * Radix;
- if (X == One)
- Break = True;
- else
- Z1 = Z1 - One;
- }
- while (!(Break || (Z1 <= Zero)));
- if ((Z1 <= Zero) && (!Break))
- Anomaly = True;
- else {
- if (Z1 > RadixD2)
- Z1 = Z1 - Radix;
- do {
- NewD ();
- }
- while (!(U2 * D >= F9));
- if (D * Radix - D != W - D)
- Anomaly = True;
- else {
- Z2 = D;
- I = 0;
- Y = D + (One + Z) * Half;
- X = D + Z + Q;
- SR3750 ();
- Y = D + (One - Z) * Half + D;
- X = D - Z + D;
- X = X + Q + X;
- SR3750 ();
- NewD ();
- if (D - Z2 != W - Z2)
- Anomaly = True;
- else {
- Y = (D - Z2) + (Z2 + (One - Z) * Half);
- X = (D - Z2) + (Z2 - Z + Q);
- SR3750 ();
- Y = (One + Z) * Half;
- X = Q;
- SR3750 ();
- if (I == 0)
- Anomaly = True;
- }
- }
- }
- }
- }
- if ((I == 0) || Anomaly) {
- BadCond (Failure, "Anomalous arithmetic with Integer < ");
- printf ("Radix^Precision = %.7e\n", W);
- printf (" fails test whether sqrt rounds or chops.\n");
- SqRWrng = True;
- }
- }
- if (!Anomaly) {
- if (!((MinSqEr < Zero) || (MaxSqEr > Zero))) {
- RSqrt = Rounded;
- printf ("Square root appears to be correctly rounded.\n");
- } else {
- if ((MaxSqEr + U2 > U2 - Half) || (MinSqEr > Half)
- || (MinSqEr + Radix < Half))
- SqRWrng = True;
- else {
- RSqrt = Chopped;
- printf ("Square root appears to be chopped.\n");
- }
- }
- }
- if (SqRWrng) {
- printf ("Square root is neither chopped nor correctly rounded.\n");
- printf ("Observed errors run from %.7e ", MinSqEr - Half);
- printf ("to %.7e ulps.\n", Half + MaxSqEr);
- TstCond (Serious, MaxSqEr - MinSqEr < Radix * Radix,
- "sqrt gets too many last digits wrong");
- }
- /*=============================================*/
- Milestone = 90;
- /*=============================================*/
- Pause ();
- printf ("Testing powers Z^i for small Integers Z and i.\n");
- N = 0;
- /* ... test powers of zero. */
- I = 0;
- Z = -Zero;
- M = 3;
- Break = False;
- do {
- X = One;
- SR3980 ();
- if (I <= 10) {
- I = 1023;
- SR3980 ();
- }
- if (Z == MinusOne)
- Break = True;
- else {
- Z = MinusOne;
- /* .. if(-1)^N is invalid, replace MinusOne by One. */
- I = -4;
- }
- }
- while (!Break);
- PrintIfNPositive ();
- N1 = N;
- N = 0;
- Z = A1;
- M = (int) FLOOR (Two * LOG (W) / LOG (A1));
- Break = False;
- do {
- X = Z;
- I = 1;
- SR3980 ();
- if (Z == AInvrse)
- Break = True;
- else
- Z = AInvrse;
- }
- while (!(Break));
- /*=============================================*/
- Milestone = 100;
- /*=============================================*/
- /* Powers of Radix have been tested, */
- /* next try a few primes */
- M = NoTrials;
- Z = Three;
- do {
- X = Z;
- I = 1;
- SR3980 ();
- do {
- Z = Z + Two;
- }
- while (Three * FLOOR (Z / Three) == Z);
- }
- while (Z < Eight * Three);
- if (N > 0) {
- printf ("Errors like this may invalidate financial calculations\n");
- printf ("\tinvolving interest rates.\n");
- }
- PrintIfNPositive ();
- N += N1;
- if (N == 0)
- printf ("... no discrepancies found.\n");
- if (N > 0)
- Pause ();
- else
- printf ("\n");
- /*=============================================*/
- Milestone = 110;
- /*=============================================*/
- printf ("Seeking Underflow thresholds UfThold and E0.\n");
- D = U1;
- if (Precision != FLOOR (Precision)) {
- D = BInvrse;
- X = Precision;
- do {
- D = D * BInvrse;
- X = X - One;
- }
- while (X > Zero);
- }
- Y = One;
- Z = D;
- /* ... D is power of 1/Radix < 1. */
- do {
- C = Y;
- Y = Z;
- Z = Y * Y;
- }
- while ((Y > Z) && (Z + Z > Z));
- Y = C;
- Z = Y * D;
- do {
- C = Y;
- Y = Z;
- Z = Y * D;
- }
- while ((Y > Z) && (Z + Z > Z));
- if (Radix < Two)
- HInvrse = Two;
- else
- HInvrse = Radix;
- H = One / HInvrse;
- /* ... 1/HInvrse == H == Min(1/Radix, 1/2) */
- CInvrse = One / C;
- E0 = C;
- Z = E0 * H;
- /* ...1/Radix^(BIG Integer) << 1 << CInvrse == 1/C */
- do {
- Y = E0;
- E0 = Z;
- Z = E0 * H;
- }
- while ((E0 > Z) && (Z + Z > Z));
- UfThold = E0;
- E1 = Zero;
- Q = Zero;
- E9 = U2;
- S = One + E9;
- D = C * S;
- if (D <= C) {
- E9 = Radix * U2;
- S = One + E9;
- D = C * S;
- if (D <= C) {
- BadCond (Failure, "multiplication gets too many last digits wrong.\n");
- Underflow = E0;
- Y1 = Zero;
- PseudoZero = Z;
- Pause ();
- }
- } else {
- Underflow = D;
- PseudoZero = Underflow * H;
- UfThold = Zero;
- do {
- Y1 = Underflow;
- Underflow = PseudoZero;
- if (E1 + E1 <= E1) {
- Y2 = Underflow * HInvrse;
- E1 = FABS (Y1 - Y2);
- Q = Y1;
- if ((UfThold == Zero) && (Y1 != Y2))
- UfThold = Y1;
- }
- PseudoZero = PseudoZero * H;
- }
- while ((Underflow > PseudoZero)
- && (PseudoZero + PseudoZero > PseudoZero));
- }
- /* Comment line 4530 .. 4560 */
- if (PseudoZero != Zero) {
- printf ("\n");
- Z = PseudoZero;
- /* ... Test PseudoZero for "phoney- zero" violates */
- /* ... PseudoZero < Underflow or PseudoZero < PseudoZero + PseudoZero
- ... */
- if (PseudoZero <= Zero) {
- BadCond (Failure, "Positive expressions can underflow to an\n");
- printf ("allegedly negative value\n");
- printf ("PseudoZero that prints out as: %g .\n", PseudoZero);
- X = -PseudoZero;
- if (X <= Zero) {
- printf ("But -PseudoZero, which should be\n");
- printf ("positive, isn't; it prints out as %g .\n", X);
- }
- } else {
- BadCond (Flaw, "Underflow can stick at an allegedly positive\n");
- printf ("value PseudoZero that prints out as %g .\n", PseudoZero);
- }
- TstPtUf ();
- }
- /*=============================================*/
- Milestone = 120;
- /*=============================================*/
- if (CInvrse * Y > CInvrse * Y1) {
- S = H * S;
- E0 = Underflow;
- }
- if (!((E1 == Zero) || (E1 == E0))) {
- BadCond (Defect, "");
- if (E1 < E0) {
- printf ("Products underflow at a higher");
- printf (" threshold than differences.\n");
- if (PseudoZero == Zero)
- E0 = E1;
- } else {
- printf ("Difference underflows at a higher");
- printf (" threshold than products.\n");
- }
- }
- printf ("Smallest strictly positive number found is E0 = %g .\n", E0);
- Z = E0;
- TstPtUf ();
- Underflow = E0;
- if (N == 1)
- Underflow = Y;
- I = 4;
- if (E1 == Zero)
- I = 3;
- if (UfThold == Zero)
- I = I - 2;
- UfNGrad = True;
- switch (I) {
- case 1:
- UfThold = Underflow;
- if ((CInvrse * Q) != ((CInvrse * Y) * S)) {
- UfThold = Y;
- BadCond (Failure, "Either accuracy deteriorates as numbers\n");
- printf ("approach a threshold = %.17e\n", UfThold);;
- printf (" coming down from %.17e\n", C);
- printf (" or else multiplication gets too many last digits wrong.\n");
- }
- Pause ();
- break;
-
- case 2:
- BadCond (Failure, "Underflow confuses Comparison, which alleges that\n");
- printf ("Q == Y while denying that |Q - Y| == 0; these values\n");
- printf ("print out as Q = %.17e, Y = %.17e .\n", Q, Y2);
- printf ("|Q - Y| = %.17e .\n", FABS (Q - Y2));
- UfThold = Q;
- break;
-
- case 3:
- X = X;
- break;
-
- case 4:
- if ((Q == UfThold) && (E1 == E0)
- && (FABS (UfThold - E1 / E9) <= E1)) {
- UfNGrad = False;
- printf ("Underflow is gradual; it incurs Absolute Error =\n");
- printf ("(roundoff in UfThold) < E0.\n");
- Y = E0 * CInvrse;
- Y = Y * (OneAndHalf + U2);
- X = CInvrse * (One + U2);
- Y = Y / X;
- IEEE = (Y == E0);
- }
- }
- if (UfNGrad) {
- printf ("\n");
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf)) {
- printf ("Underflow / UfThold failed!\n");
- R = H + H;
- } else
- R = SQRT (Underflow / UfThold);
- sigsave = 0;
- if (R <= H) {
- Z = R * UfThold;
- X = Z * (One + R * H * (One + H));
- } else {
- Z = UfThold;
- X = Z * (One + H * H * (One + H));
- }
- if (!((X == Z) || (X - Z != Zero))) {
- BadCond (Flaw, "");
- printf ("X = %.17e\n\tis not equal to Z = %.17e .\n", X, Z);
- Z9 = X - Z;
- printf ("yet X - Z yields %.17e .\n", Z9);
- printf (" Should this NOT signal Underflow, ");
- printf ("this is a SERIOUS DEFECT\nthat causes ");
- printf ("confusion when innocent statements like\n");;
- printf (" if (X == Z) ... else");
- printf (" ... (f(X) - f(Z)) / (X - Z) ...\n");
- printf ("encounter Division by Zero although actually\n");
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf))
- printf ("X / Z fails!\n");
- else
- printf ("X / Z = 1 + %g .\n", (X / Z - Half) - Half);
- sigsave = 0;
- }
- }
- printf ("The Underflow threshold is %.17e, %s\n", UfThold,
- " below which");
- printf ("calculation may suffer larger Relative error than ");
- printf ("merely roundoff.\n");
- Y2 = U1 * U1;
- Y = Y2 * Y2;
- Y2 = Y * U1;
- if (Y2 <= UfThold) {
- if (Y > E0) {
- BadCond (Defect, "");
- I = 5;
- } else {
- BadCond (Serious, "");
- I = 4;
- }
- printf ("Range is too narrow; U1^%d Underflows.\n", I);
- }
- /*=============================================*/
- Milestone = 130;
- /*=============================================*/
- Y = -FLOOR (Half - TwoForty * LOG (UfThold) / LOG (HInvrse)) / TwoForty;
- Y2 = Y + Y;
- printf ("Since underflow occurs below the threshold\n");
- printf ("UfThold = (%.17e) ^ (%.17e)\nonly underflow ", HInvrse, Y);
- printf ("should afflict the expression\n\t(%.17e) ^ (%.17e);\n",
- HInvrse, Y2);
- printf ("actually calculating yields:");
- if (setjmp (ovfl_buf)) {
- sigsave = 0;
- BadCond (Serious, "trap on underflow.\n");
- } else {
- sigsave = _sigfpe;
- V9 = POW (HInvrse, Y2);
- sigsave = 0;
- printf (" %.17e .\n", V9);
- if (!((V9 >= Zero) && (V9 <= (Radix + Radix + E9) * UfThold))) {
- BadCond (Serious, "this is not between 0 and underflow\n");
- printf (" threshold = %.17e .\n", UfThold);
- } else if (!(V9 > UfThold * (One + E9)))
- printf ("This computed value is O.K.\n");
- else {
- BadCond (Defect, "this is not between 0 and underflow\n");
- printf (" threshold = %.17e .\n", UfThold);
- }
- }
- /*=============================================*/
- Milestone = 140;
- /*=============================================*/
- printf ("\n");
- /* ...calculate Exp2 == exp(2) == 7.389056099... */
- X = Zero;
- I = 2;
- Y = Two * Three;
- Q = Zero;
- N = 0;
- do {
- Z = X;
- I = I + 1;
- Y = Y / (I + I);
- R = Y + Q;
- X = Z + R;
- Q = (Z - X) + R;
- }
- while (X > Z);
- Z = (OneAndHalf + One / Eight) + X / (OneAndHalf * ThirtyTwo);
- X = Z * Z;
- Exp2 = X * X;
- X = F9;
- Y = X - U1;
- printf ("Testing X^((X + 1) / (X - 1)) vs. exp(2) = %.17e as X -> 1.\n",
- Exp2);
- for (I = 1;;) {
- Z = X - BInvrse;
- Z = (X + One) / (Z - (One - BInvrse));
- Q = POW (X, Z) - Exp2;
- if (FABS (Q) > TwoForty * U2) {
- N = 1;
- V9 = (X - BInvrse) - (One - BInvrse);
- BadCond (Defect, "Calculated");
- printf (" %.17e for\n", POW (X, Z));
- printf ("\t(1 + (%.17e) ^ (%.17e);\n", V9, Z);
- printf ("\tdiffers from correct value by %.17e .\n", Q);
- printf ("\tThis much error may spoil financial\n");
- printf ("\tcalculations involving tiny interest rates.\n");
- break;
- } else {
- Z = (Y - X) * Two + Y;
- X = Y;
- Y = Z;
- Z = One + (X - F9) * (X - F9);
- if (Z > One && I < NoTrials)
- I++;
- else {
- if (X > One) {
- if (N == 0)
- printf ("Accuracy seems adequate.\n");
- break;
- } else {
- X = One + U2;
- Y = U2 + U2;
- Y += X;
- I = 1;
- }
- }
- }
- }
- /*=============================================*/
- Milestone = 150;
- /*=============================================*/
- printf ("Testing powers Z^Q at four nearly extreme values.\n");
- N = 0;
- Z = A1;
- Q = FLOOR (Half - LOG (C) / LOG (A1));
- Break = False;
- do {
- X = CInvrse;
- Y = POW (Z, Q);
- IsYeqX ();
- Q = -Q;
- X = C;
- Y = POW (Z, Q);
- IsYeqX ();
- if (Z < One)
- Break = True;
- else
- Z = AInvrse;
- }
- while (!(Break));
- PrintIfNPositive ();
- if (N == 0)
- printf (" ... no discrepancies found.\n");
- printf ("\n");
-
- /*=============================================*/
- Milestone = 160;
- /*=============================================*/
- Pause ();
- printf ("Searching for Overflow threshold:\n");
- printf ("This may generate an error.\n");
- Y = -CInvrse;
- V9 = HInvrse * Y;
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf)) {
- I = 0;
- V9 = Y;
- goto overflow;
- }
- do {
- V = Y;
- Y = V9;
- V9 = HInvrse * Y;
- }
- while (V9 < Y);
- I = 1;
- overflow:
- sigsave = 0;
- Z = V9;
- printf ("Can `Z = -Y' overflow?\n");
- printf ("Trying it on Y = %.17e .\n", Y);
- V9 = -Y;
- V0 = V9;
- if (V - Y == V + V0)
- printf ("Seems O.K.\n");
- else {
- printf ("finds a ");
- BadCond (Flaw, "-(-Y) differs from Y.\n");
- }
- if (Z != Y) {
- BadCond (Serious, "");
- printf ("overflow past %.17e\n\tshrinks to %.17e .\n", Y, Z);
- }
- if (I) {
- Y = V * (HInvrse * U2 - HInvrse);
- Z = Y + ((One - HInvrse) * U2) * V;
- if (Z < V0)
- Y = Z;
- if (Y < V0)
- V = Y;
- if (V0 - V < V0)
- V = V0;
- } else {
- V = Y * (HInvrse * U2 - HInvrse);
- V = V + ((One - HInvrse) * U2) * Y;
- }
- printf ("Overflow threshold is V = %.17e .\n", V);
- if (I)
- printf ("Overflow saturates at V0 = %.17e .\n", V0);
- else
- printf ("There is no saturation value because \
-the system traps on overflow.\n");
- V9 = V * One;
- printf ("No Overflow should be signaled for V * 1 = %.17e\n", V9);
- V9 = V / One;
- printf (" nor for V / 1 = %.17e .\n", V9);
- printf ("Any overflow signal separating this * from the one\n");
- printf ("above is a DEFECT.\n");
- /*=============================================*/
- Milestone = 170;
- /*=============================================*/
- if (!(-V < V && -V0 < V0 && -UfThold < V && UfThold < V)) {
- BadCond (Failure, "Comparisons involving ");
- printf ("+-%g, +-%g\nand +-%g are confused by Overflow.",
- V, V0, UfThold);
- }
- /*=============================================*/
- Milestone = 175;
- /*=============================================*/
- printf ("\n");
- for (Indx = 1; Indx <= 3; ++Indx) {
- switch (Indx) {
- case 1:
- Z = UfThold;
- break;
- case 2:
- Z = E0;
- break;
- case 3:
- Z = PseudoZero;
- break;
- }
- if (Z != Zero) {
- V9 = SQRT (Z);
- Y = V9 * V9;
- if (Y / (One - Radix * E9) < Z
- || Y > (One + Radix * E9) * Z) { /* dgh: + E9 --> * E9 */
- if (V9 > U1)
- BadCond (Serious, "");
- else
- BadCond (Defect, "");
- printf ("Comparison alleges that what prints as Z = %.17e\n", Z);
- printf (" is too far from sqrt(Z) ^ 2 = %.17e .\n", Y);
- }
- }
- }
- /*=============================================*/
- Milestone = 180;
- /*=============================================*/
- for (Indx = 1; Indx <= 2; ++Indx) {
- if (Indx == 1)
- Z = V;
- else
- Z = V0;
- V9 = SQRT (Z);
- X = (One - Radix * E9) * V9;
- V9 = V9 * X;
- if (((V9 < (One - Two * Radix * E9) * Z) || (V9 > Z))) {
- Y = V9;
- if (X < W)
- BadCond (Serious, "");
- else
- BadCond (Defect, "");
- printf ("Comparison alleges that Z = %17e\n", Z);
- printf (" is too far from sqrt(Z) ^ 2 (%.17e) .\n", Y);
- }
- }
- /*=============================================*/
- Milestone = 190;
- /*=============================================*/
- Pause ();
- X = UfThold * V;
- Y = Radix * Radix;
- if (X * Y < One || X > Y) {
- if (X * Y < U1 || X > Y / U1)
- BadCond (Defect, "Badly");
- else
- BadCond (Flaw, "");
-
- printf (" unbalanced range; UfThold * V = %.17e\n\t%s\n",
- X, "is too far from 1.\n");
- }
- /*=============================================*/
- Milestone = 200;
- /*=============================================*/
- for (Indx = 1; Indx <= 5; ++Indx) {
- X = F9;
- switch (Indx) {
- case 2:
- X = One + U2;
- break;
- case 3:
- X = V;
- break;
- case 4:
- X = UfThold;
- break;
- case 5:
- X = Radix;
- }
- Y = X;
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf))
- printf (" X / X traps when X = %g\n", X);
- else {
- V9 = (Y / X - Half) - Half;
- if (V9 == Zero)
- continue;
- if (V9 == -U1 && Indx < 5)
- BadCond (Flaw, "");
- else
- BadCond (Serious, "");
- printf (" X / X differs from 1 when X = %.17e\n", X);
- printf (" instead, X / X - 1/2 - 1/2 = %.17e .\n", V9);
- }
- sigsave = 0;
- }
- /*=============================================*/
- Milestone = 210;
- /*=============================================*/
- MyZero = Zero;
- printf ("\n");
- printf ("What message and/or values does Division by Zero produce?\n");
-#ifndef BATCHMODE
- printf ("This can interupt your program. You can ");
- printf ("skip this part if you wish.\n");
- printf ("Do you wish to compute 1 / 0? ");
- fflush (stdout);
- read (KEYBOARD, ch, 8);
- if ((ch[0] == 'Y') || (ch[0] == 'y')) {
-#endif /* !BATCHMODE */
- sigsave = _sigfpe;
- printf (" Trying to compute 1 / 0 produces ...");
- if (!setjmp (ovfl_buf))
- printf (" %.7e .\n", One / MyZero);
- sigsave = 0;
-#ifndef BATCHMODE
- } else
- printf ("O.K.\n");
- printf ("\nDo you wish to compute 0 / 0? ");
- fflush (stdout);
- read (KEYBOARD, ch, 80);
- if ((ch[0] == 'Y') || (ch[0] == 'y')) {
-#endif /* !BATCHMODE */
- sigsave = _sigfpe;
- printf ("\n Trying to compute 0 / 0 produces ...");
- if (!setjmp (ovfl_buf))
- printf (" %.7e .\n", Zero / MyZero);
- sigsave = 0;
-#ifndef BATCHMODE
- } else
- printf ("O.K.\n");
-#endif /* !BATCHMODE */
- /*=============================================*/
- Milestone = 220;
- /*=============================================*/
-
- Pause ();
- printf ("\n");
- {
- static char *msg[] =
- {
- "FAILUREs encountered =",
- "SERIOUS DEFECTs discovered =",
- "DEFECTs discovered =",
- "FLAWs discovered ="};
- int i;
- for (i = 0; i < 4; i++)
- if (ErrCnt[i])
- printf ("The number of %-29s %d.\n",
- msg[i], ErrCnt[i]);
- }
-
- printf ("\n");
- if ((ErrCnt[Failure] + ErrCnt[Serious] + ErrCnt[Defect]
- + ErrCnt[Flaw]) > 0) {
- if ((ErrCnt[Failure] + ErrCnt[Serious] + ErrCnt[
- Defect] == 0) && (ErrCnt[Flaw] > 0)) {
- printf ("The arithmetic diagnosed seems ");
- printf ("Satisfactory though flawed.\n");
- }
- if ((ErrCnt[Failure] + ErrCnt[Serious] == 0)
- && (ErrCnt[Defect] > 0)) {
- printf ("The arithmetic diagnosed may be Acceptable\n");
- printf ("despite inconvenient Defects.\n");
- }
- if ((ErrCnt[Failure] + ErrCnt[Serious]) > 0) {
- printf ("The arithmetic diagnosed has ");
- printf ("unacceptable Serious Defects.\n");
- }
- if (ErrCnt[Failure] > 0) {
- printf ("Potentially fatal FAILURE may have spoiled this");
- printf (" program's subsequent diagnoses.\n");
- }
- } else {
-
- printf ("No failures, defects nor flaws have been discovered.\n");
- if (!((RMult == Rounded) && (RDiv == Rounded)
- && (RAddSub == Rounded) && (RSqrt == Rounded)))
- printf ("The arithmetic diagnosed seems Satisfactory.\n");
- else {
- if (StickyBit >= One &&
- (Radix - Two) * (Radix - Nine - One) == Zero) {
- printf ("Rounding appears to conform to ");
- printf ("the proposed IEEE standard P");
- if ((Radix == Two) &&
- ((Precision - Four * Three * Two) *
- (Precision - TwentySeven -
- TwentySeven + One) == Zero))
- printf ("754");
- else
- printf ("854");
- if (IEEE)
- printf (".\n");
- else {
- printf (",\nexcept for possibly Double Rounding");
- printf (" during Gradual Underflow.\n");
- }
- }
- printf ("The arithmetic diagnosed appears to be Excellent!\n");
- }
- }
-
- if (fpecount)
- printf ("\nA total of %d floating point exceptions were registered.\n",
- fpecount);
- printf ("END OF TEST.\n");
- return 0;
-}
-
-FLOAT
-Sign (X)
- FLOAT X;
-{
- return X >= 0. ? 1.0 : -1.0;
-}
-
-void
-Pause ()
-{
-#ifndef BATCHMODE
- char ch[8];
-
- printf ("\nTo continue, press RETURN");
- fflush (stdout);
- read (KEYBOARD, ch, 8);
-#endif /* !BATCHMODE */
-#ifndef CYGNUS
- printf ("\nDiagnosis resumes after milestone Number %d", Milestone);
- printf (" Page: %d\n\n", PageNo);
- ++Milestone;
- ++PageNo;
-#endif /* !CYGNUS */
-}
-
-void
-TstCond (K, Valid, T)
- int K, Valid;
- char *T;
-{
-#ifdef CYGNUS
- printf ("TEST: %s\n", T);
-#endif /* CYGNUS */
- if (!Valid) {
- BadCond (K, T);
- printf (".\n");
- }
-#ifdef CYGNUS
- printf ("PASS: %s\n", T);
-#endif /* CYGNUS */
-}
-
-void
-BadCond (K, T)
- int K;
- char *T;
-{
- static char *msg[] =
- {"FAILURE", "SERIOUS DEFECT", "DEFECT", "FLAW"};
-
- ErrCnt[K] = ErrCnt[K] + 1;
-#ifndef CYGNUS
- printf ("%s: %s", msg[K], T);
-#else
- printf ("ERROR: Severity: %s: %s", msg[K], T);
-#endif /* CYGNUS */
-}
-
-/*
- * Random computes
- * X = (Random1 + Random9)^5
- * Random1 = X - FLOOR(X) + 0.000005 * X;
- * and returns the new value of Random1
-*/
-FLOAT
-Random ()
-{
- FLOAT X, Y;
-
- X = Random1 + Random9;
- Y = X * X;
- Y = Y * Y;
- X = X * Y;
- Y = X - FLOOR (X);
- Random1 = Y + X * 0.000005;
- return (Random1);
-}
-
-void
-SqXMinX (ErrKind)
- int ErrKind;
-{
- FLOAT XA, XB;
-
- XB = X * BInvrse;
- XA = X - XB;
- SqEr = ((SQRT (X * X) - XB) - XA) / OneUlp;
- if (SqEr != Zero) {
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- J = J + 1.0;
- BadCond (ErrKind, "\n");
- printf ("sqrt( %.17e) - %.17e = %.17e\n", X * X, X, OneUlp * SqEr);
- printf ("\tinstead of correct value 0 .\n");
- }
-}
-
-void
-NewD ()
-{
- X = Z1 * Q;
- X = FLOOR (Half - X / Radix) * Radix + X;
- Q = (Q - X * Z) / Radix + X * X * (D / Radix);
- Z = Z - Two * X * D;
- if (Z <= Zero) {
- Z = -Z;
- Z1 = -Z1;
- }
- D = Radix * D;
-}
-
-void
-SR3750 ()
-{
- if (!((X - Radix < Z2 - Radix) || (X - Z2 > W - Z2))) {
- I = I + 1;
- X2 = SQRT (X * D);
- Y2 = (X2 - Z2) - (Y - Z2);
- X2 = X8 / (Y - Half);
- X2 = X2 - Half * X2 * X2;
- SqEr = (Y2 + Half) + (Half - X2);
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- SqEr = Y2 - X2;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- }
-}
-
-void
-IsYeqX ()
-{
- if (Y != X) {
- if (N <= 0) {
- if (Z == Zero && Q <= Zero)
- printf ("WARNING: computing\n");
- else
- BadCond (Defect, "computing\n");
- printf ("\t(%.17e) ^ (%.17e)\n", Z, Q);
- printf ("\tyielded %.17e;\n", Y);
- printf ("\twhich compared unequal to correct %.17e ;\n",
- X);
- printf ("\t\tthey differ by %.17e .\n", Y - X);
- }
- N = N + 1; /* ... count discrepancies. */
- }
-}
-
-void
-SR3980 ()
-{
- do {
- Q = (FLOAT) I;
- Y = POW (Z, Q);
- IsYeqX ();
- if (++I > M)
- break;
- X = Z * X;
- }
- while (X < W);
-}
-
-void
-PrintIfNPositive ()
-{
- if (N > 0)
- printf ("Similar discrepancies have occurred %d times.\n", N);
-}
-
-void
-TstPtUf ()
-{
- N = 0;
- if (Z != Zero) {
- printf ("Since comparison denies Z = 0, evaluating ");
- printf ("(Z + Z) / Z should be safe.\n");
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf))
- goto very_serious;
- Q9 = (Z + Z) / Z;
- printf ("What the machine gets for (Z + Z) / Z is %.17e .\n",
- Q9);
- if (FABS (Q9 - Two) < Radix * U2) {
- printf ("This is O.K., provided Over/Underflow");
- printf (" has NOT just been signaled.\n");
- } else {
- if ((Q9 < One) || (Q9 > Two)) {
- very_serious:
- N = 1;
- ErrCnt[Serious] = ErrCnt[Serious] + 1;
- printf ("This is a VERY SERIOUS DEFECT!\n");
- } else {
- N = 1;
- ErrCnt[Defect] = ErrCnt[Defect] + 1;
- printf ("This is a DEFECT!\n");
- }
- }
- sigsave = 0;
- V9 = Z * One;
- Random1 = V9;
- V9 = One * Z;
- Random2 = V9;
- V9 = Z / One;
- if ((Z == Random1) && (Z == Random2) && (Z == V9)) {
- if (N > 0)
- Pause ();
- } else {
- N = 1;
- BadCond (Defect, "What prints as Z = ");
- printf ("%.17e\n\tcompares different from ", Z);
- if (Z != Random1)
- printf ("Z * 1 = %.17e ", Random1);
- if (!((Z == Random2)
- || (Random2 == Random1)))
- printf ("1 * Z == %g\n", Random2);
- if (!(Z == V9))
- printf ("Z / 1 = %.17e\n", V9);
- if (Random2 != Random1) {
- ErrCnt[Defect] = ErrCnt[Defect] + 1;
- BadCond (Defect, "Multiplication does not commute!\n");
- printf ("\tComparison alleges that 1 * Z = %.17e\n",
- Random2);
- printf ("\tdiffers from Z * 1 = %.17e\n", Random1);
- }
- Pause ();
- }
- }
-}
-
-void
-notify (s)
- char *s;
-{
- printf ("%s test appears to be inconsistent...\n", s);
- printf (" PLEASE NOTIFY KARPINKSI!\n");
-}
-
-void
-msglist (s)
- char **s;
-{
- while (*s)
- printf ("%s\n", *s++);
-}
-
-void
-Instructions ()
-{
- static char *instr[] =
- {
- "Lest this program stop prematurely, i.e. before displaying\n",
- " `END OF TEST',\n",
- "try to persuade the computer NOT to terminate execution when an",
- "error like Over/Underflow or Division by Zero occurs, but rather",
- "to persevere with a surrogate value after, perhaps, displaying some",
- "warning. If persuasion avails naught, don't despair but run this",
- "program anyway to see how many milestones it passes, and then",
- "amend it to make further progress.\n",
- "Answer questions with Y, y, N or n (unless otherwise indicated).\n",
- 0};
-
- msglist (instr);
-}
-
-void
-Heading ()
-{
- static char *head[] =
- {
- "Users are invited to help debug and augment this program so it will",
- "cope with unanticipated and newly uncovered arithmetic pathologies.\n",
- "Please send suggestions and interesting results to",
- "\tRichard Karpinski",
- "\tComputer Center U-76",
- "\tUniversity of California",
- "\tSan Francisco, CA 94143-0704, USA\n",
- "In doing so, please include the following information:",
-#ifdef SINGLE_PRECISION
- "\tPrecision:\tsingle;",
-#else /* !SINGLE_PRECISION */
- "\tPrecision:\tdouble;",
-#endif /* SINGLE_PRECISION */
- "\tVersion:\t10 February 1989;",
- "\tComputer:\n",
- "\tCompiler:\n",
- "\tOptimization level:\n",
- "\tOther relevant compiler options:",
- 0};
-
- msglist (head);
-}
-
-void
-Characteristics ()
-{
- static char *chars[] =
- {
- "Running this program should reveal these characteristics:",
- " Radix = 1, 2, 4, 8, 10, 16, 100, 256 ...",
- " Precision = number of significant digits carried.",
- " U2 = Radix/Radix^Precision = One Ulp",
- "\t(OneUlpnit in the Last Place) of 1.000xxx .",
- " U1 = 1/Radix^Precision = One Ulp of numbers a little less than 1.0 .",
- " Adequacy of guard digits for Mult., Div. and Subt.",
- " Whether arithmetic is chopped, correctly rounded, or something else",
- "\tfor Mult., Div., Add/Subt. and Sqrt.",
- " Whether a Sticky Bit used correctly for rounding.",
- " UnderflowThreshold = an underflow threshold.",
- " E0 and PseudoZero tell whether underflow is abrupt, gradual, or fuzzy.",
- " V = an overflow threshold, roughly.",
- " V0 tells, roughly, whether Infinity is represented.",
- " Comparisions are checked for consistency with subtraction",
- "\tand for contamination with pseudo-zeros.",
- " Sqrt is tested. Y^X is not tested.",
- " Extra-precise subexpressions are revealed but NOT YET tested.",
- " Decimal-Binary conversion is NOT YET tested for accuracy.",
- 0};
-
- msglist (chars);
-}
-
-void
-History ()
-{ /* History */
- /* Converted from Brian Wichmann's Pascal version to C by Thos Sumner,
- with further massaging by David M. Gay. */
-
- static char *hist[] =
- {
- "The program attempts to discriminate among",
- " FLAWs, like lack of a sticky bit,",
- " Serious DEFECTs, like lack of a guard digit, and",
- " FAILUREs, like 2+2 == 5 .",
- "Failures may confound subsequent diagnoses.\n",
- "The diagnostic capabilities of this program go beyond an earlier",
- "program called `MACHAR', which can be found at the end of the",
- "book `Software Manual for the Elementary Functions' (1980) by",
- "W. J. Cody and W. Waite. Although both programs try to discover",
- "the Radix, Precision and range (over/underflow thresholds)",
- "of the arithmetic, this program tries to cope with a wider variety",
- "of pathologies, and to say how well the arithmetic is implemented.",
- "\nThe program is based upon a conventional radix representation for",
- "floating-point numbers, but also allows logarithmic encoding",
- "as used by certain early WANG machines.\n",
- "BASIC version of this program (C) 1983 by Prof. W. M. Kahan;",
- "see source comments for more history.",
- 0};
-
- msglist (hist);
-}
diff --git a/testsuites/samples/paranoia/paranoia.doc b/testsuites/samples/paranoia/paranoia.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/samples/paranoia/paranoia.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 a3e79d92f4..0000000000
--- a/testsuites/samples/paranoia/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Global_variable; /* example global variable */
-
-/* end of include file */
diff --git a/testsuites/samples/ticker/init.c b/testsuites/samples/ticker/init.c
deleted file mode 100644
index 47e086ff66..0000000000
--- a/testsuites/samples/ticker/init.c
+++ /dev/null
@@ -1,61 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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;
-
- puts( "\n\n*** CLOCK TICK TEST ***" );
-
- build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
- status = rtems_clock_set( &time );
-
- Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
- Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
- Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
-
- status = rtems_task_create(
- Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES,
- RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]
- );
- status = rtems_task_create(
- Task_name[ 2 ], 1, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES,
- RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 2 ]
- );
- status = rtems_task_create(
- Task_name[ 3 ], 1, RTEMS_MINIMUM_STACK_SIZE, 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 99943044c1..0000000000
--- a/testsuites/samples/ticker/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/testsuites/samples/ticker/tasks.c b/testsuites/samples/ticker/tasks.c
deleted file mode 100644
index f5f9ea28ff..0000000000
--- a/testsuites/samples/ticker/tasks.c
+++ /dev/null
@@ -1,44 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 unused
-)
-{
- rtems_id tid;
- rtems_time_of_day time;
- rtems_unsigned32 task_index;
- rtems_status_code status;
-
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
- task_index = task_number( tid );
- while( FOREVER ) {
- status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
- if ( time.second >= 35 ) {
- puts( "*** END OF CLOCK TICK TEST ***" );
- exit( 0 );
- }
- put_name( Task_name[ task_index ], FALSE );
- print_time( " - rtems_clock_get - ", &time, "\n" );
- status = rtems_task_wake_after( task_index * 5 * TICKS_PER_SECOND );
- }
-}
diff --git a/testsuites/samples/ticker/ticker.doc b/testsuites/samples/ticker/ticker.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/samples/ticker/ticker.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/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/sp01/init.c b/testsuites/sptests/sp01/init.c
deleted file mode 100644
index 59b89d7c67..0000000000
--- a/testsuites/sptests/sp01/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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,
- 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 019cc4d18a..0000000000
--- a/testsuites/sptests/sp01/sp01.doc
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 ddcefc02a9..0000000000
--- a/testsuites/sptests/sp01/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Task_1_through_3(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/testsuites/sptests/sp01/task1.c b/testsuites/sptests/sp01/task1.c
deleted file mode 100644
index 88ec7c85f7..0000000000
--- a/testsuites/sptests/sp01/task1.c
+++ /dev/null
@@ -1,50 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
- }
-
- put_name( Task_name[ task_number( tid ) ], FALSE );
- print_time( " - rtems_clock_get - ", &time, "\n" );
-
- status = rtems_task_wake_after( task_number( tid ) * 5 * TICKS_PER_SECOND );
- directive_failed( status, "rtems_task_wake_after" );
- }
-}
diff --git a/testsuites/sptests/sp02/init.c b/testsuites/sptests/sp02/init.c
deleted file mode 100644
index dda2f9661c..0000000000
--- a/testsuites/sptests/sp02/init.c
+++ /dev/null
@@ -1,152 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 4ce362e8fa..0000000000
--- a/testsuites/sptests/sp02/preempt.c
+++ /dev/null
@@ -1,32 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 5e50b42f12..0000000000
--- a/testsuites/sptests/sp02/sp02.doc
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 d3f3d61cd1..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 (0x08010007)
-TA1 - rtems_task_ident - tid of TA3 (0x08010008)
-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 aedcd2d375..0000000000
--- a/testsuites/sptests/sp02/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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 2ab2caa7e8..0000000000
--- a/testsuites/sptests/sp02/task1.c
+++ /dev/null
@@ -1,66 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp02/task2.c b/testsuites/sptests/sp02/task2.c
deleted file mode 100644
index 0b10e3db53..0000000000
--- a/testsuites/sptests/sp02/task2.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ddc6b8e5bd..0000000000
--- a/testsuites/sptests/sp02/task3.c
+++ /dev/null
@@ -1,37 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/init.c b/testsuites/sptests/sp03/init.c
deleted file mode 100644
index c266cfd600..0000000000
--- a/testsuites/sptests/sp03/init.c
+++ /dev/null
@@ -1,67 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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,
- 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 b5182f2f94..0000000000
--- a/testsuites/sptests/sp03/sp03.doc
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 c52f7a9896..0000000000
--- a/testsuites/sptests/sp03/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/testsuites/sptests/sp03/task1.c b/testsuites/sptests/sp03/task1.c
deleted file mode 100644
index 9f39d26293..0000000000
--- a/testsuites/sptests/sp03/task1.c
+++ /dev/null
@@ -1,59 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 4f40582ab3..0000000000
--- a/testsuites/sptests/sp03/task2.c
+++ /dev/null
@@ -1,46 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 *** " );
- exit( 0 );
- }
-
- put_name( Task_name[ 2 ], FALSE );
- print_time( " ", &time, "\n" );
- }
-}
diff --git a/testsuites/sptests/sp04/init.c b/testsuites/sptests/sp04/init.c
deleted file mode 100644
index 531b42af64..0000000000
--- a/testsuites/sptests/sp04/init.c
+++ /dev/null
@@ -1,110 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 13a235886a..0000000000
--- a/testsuites/sptests/sp04/sp04.doc
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 1acd83a82f..0000000000
--- a/testsuites/sptests/sp04/sp04.scn
+++ /dev/null
@@ -1,23 +0,0 @@
-*** TEST 4 ***
-TA1 - 09:15:00 12/31/1988
-TA1 - rtems_task_suspend - on Task 2
-TA1 - rtems_task_suspend - on Task 3
-TA1 - killing time
-TA1 - rtems_task_resume - on Task 2
-TA1 - rtems_task_resume - on Task 3
-TA2 - 09:15: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
-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
-TA2 - 09:15:16 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 cef8f5546b..0000000000
--- a/testsuites/sptests/sp04/system.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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 40b7c175f4..0000000000
--- a/testsuites/sptests/sp04/task1.c
+++ /dev/null
@@ -1,118 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit (0);
- }
- }
-}
diff --git a/testsuites/sptests/sp04/task2.c b/testsuites/sptests/sp04/task2.c
deleted file mode 100644
index ff22274284..0000000000
--- a/testsuites/sptests/sp04/task2.c
+++ /dev/null
@@ -1,29 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 a431a99f9d..0000000000
--- a/testsuites/sptests/sp04/task3.c
+++ /dev/null
@@ -1,29 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 1301507782..0000000000
--- a/testsuites/sptests/sp04/tswitch.c
+++ /dev/null
@@ -1,63 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 );
- directive_failed( status, "rtems_clock_get" );
-
- 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/init.c b/testsuites/sptests/sp05/init.c
deleted file mode 100644
index df81e48052..0000000000
--- a/testsuites/sptests/sp05/init.c
+++ /dev/null
@@ -1,81 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 0f005cf007..0000000000
--- a/testsuites/sptests/sp05/sp05.doc
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 785491d481..0000000000
--- a/testsuites/sptests/sp05/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/testsuites/sptests/sp05/task1.c b/testsuites/sptests/sp05/task1.c
deleted file mode 100644
index 8e67584e90..0000000000
--- a/testsuites/sptests/sp05/task1.c
+++ /dev/null
@@ -1,78 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp05/task2.c b/testsuites/sptests/sp05/task2.c
deleted file mode 100644
index 2d492746c4..0000000000
--- a/testsuites/sptests/sp05/task2.c
+++ /dev/null
@@ -1,39 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 bc63d771d0..0000000000
--- a/testsuites/sptests/sp05/task3.c
+++ /dev/null
@@ -1,39 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/init.c b/testsuites/sptests/sp06/init.c
deleted file mode 100644
index 2b551e48b5..0000000000
--- a/testsuites/sptests/sp06/init.c
+++ /dev/null
@@ -1,87 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 6ec1bb23d7..0000000000
--- a/testsuites/sptests/sp06/sp06.doc
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 b3c2786832..0000000000
--- a/testsuites/sptests/sp06/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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 63af3d680f..0000000000
--- a/testsuites/sptests/sp06/task1.c
+++ /dev/null
@@ -1,61 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- 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 6a57b907e2..0000000000
--- a/testsuites/sptests/sp06/task2.c
+++ /dev/null
@@ -1,40 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 af1a398da5..0000000000
--- a/testsuites/sptests/sp06/task3.c
+++ /dev/null
@@ -1,32 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/init.c b/testsuites/sptests/sp07/init.c
deleted file mode 100644
index df627a2895..0000000000
--- a/testsuites/sptests/sp07/init.c
+++ /dev/null
@@ -1,128 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 6ecc0e0c20..0000000000
--- a/testsuites/sptests/sp07/sp07.doc
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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
-<pause>
-TA1 - rtems_task_set_priority - get initial priority of self: 04
-TA1 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: 04
-TA1 - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8: 03
-TA1 - rtems_task_set_priority - set TA2's priority: 03
-TA2 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: 03
-TA2 - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8: 02
-TA2 - rtems_task_set_priority - set TA1's priority: 02
-TA1 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: 02
-TA1 - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8: 01
-TA1 - rtems_task_set_priority - set TA2's priority: 01
-TA2 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: 01
-TA2 - rtems_task_suspend - suspend TA1
-TA2 - rtems_task_set_priority - set priority of TA1 ( blocked )
-TASK_DELETE - TA2 deleting TA1
-TASK_DELETE - TA2 deleting TA3
-TASK_DELETE - TA2 deleting TA2
-TA4 - exitting task
-RTEMS_TASK_EXITTED - extension invoked for TA4
-*** END OF TEST 7 ***
-TASK_DELETE - TA4 deleting TA4 <---- may not appear
diff --git a/testsuites/sptests/sp07/system.h b/testsuites/sptests/sp07/system.h
deleted file mode 100644
index 110f844957..0000000000
--- a/testsuites/sptests/sp07/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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)
-
-#include <confdefs.h>
-
-/* 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 d6e5e4d1f1..0000000000
--- a/testsuites/sptests/sp07/task1.c
+++ /dev/null
@@ -1,85 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 d528fa2dde..0000000000
--- a/testsuites/sptests/sp07/task2.c
+++ /dev/null
@@ -1,78 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 71aec743a4..0000000000
--- a/testsuites/sptests/sp07/task3.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 6ea75d42e6..0000000000
--- a/testsuites/sptests/sp07/task4.c
+++ /dev/null
@@ -1,30 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 a7b0745f16..0000000000
--- a/testsuites/sptests/sp07/taskexit.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Task_exit_extension
- *
- * This routine is the task exitted user extension.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp07/tcreate.c b/testsuites/sptests/sp07/tcreate.c
deleted file mode 100644
index bba5b8d40d..0000000000
--- a/testsuites/sptests/sp07/tcreate.c
+++ /dev/null
@@ -1,35 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 5276369d47..0000000000
--- a/testsuites/sptests/sp07/tdelete.c
+++ /dev/null
@@ -1,37 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 9195ca7c3f..0000000000
--- a/testsuites/sptests/sp07/trestart.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 6fac296b87..0000000000
--- a/testsuites/sptests/sp07/tstart.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/init.c b/testsuites/sptests/sp08/init.c
deleted file mode 100644
index 260fec7f65..0000000000
--- a/testsuites/sptests/sp08/init.c
+++ /dev/null
@@ -1,53 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 734bfde9ca..0000000000
--- a/testsuites/sptests/sp08/sp08.doc
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 352bfe9a13..0000000000
--- a/testsuites/sptests/sp08/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/testsuites/sptests/sp08/task1.c b/testsuites/sptests/sp08/task1.c
deleted file mode 100644
index 257e9586a9..0000000000
--- a/testsuites/sptests/sp08/task1.c
+++ /dev/null
@@ -1,256 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp09/delay.c b/testsuites/sptests/sp09/delay.c
deleted file mode 100644
index 23f1c8730f..0000000000
--- a/testsuites/sptests/sp09/delay.c
+++ /dev/null
@@ -1,28 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 fb80e38d00..0000000000
--- a/testsuites/sptests/sp09/init.c
+++ /dev/null
@@ -1,120 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 4098dc0f95..0000000000
--- a/testsuites/sptests/sp09/isr.c
+++ /dev/null
@@ -1,27 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 e3d0359837..0000000000
--- a/testsuites/sptests/sp09/screen01.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/* Screen1
- *
- * This routine generates error screen 1 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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, &notepad_value );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NUMBER,
- "rtems_task_get_note with illegal notepad"
- );
- puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_NUMBER" );
-
- status = rtems_task_get_note( 100, RTEMS_NOTEPAD_LAST, &notepad_value );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_task_get_note with illegal id"
- );
- puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID" );
-
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &self_id );
- directive_failed( status, "rtems_task_ident of self" );
-
- if ( self_id != Task_id[ 1 ] ) {
- puts( "ERROR - rtems_task_ident - incorrect ID returned!" );
- }
- puts( "TA1 - rtems_task_ident - current task RTEMS_SUCCESSFUL" );
-
- status = rtems_task_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NAME,
- "rtems_task_ident with illegal name (local)"
- );
- puts( "TA1 - rtems_task_ident - global RTEMS_INVALID_NAME" );
-
- status = rtems_task_ident( 100, 1, &Junk_id );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NAME,
- "rtems_task_ident with illegal name (global)"
- );
- puts( "TA1 - rtems_task_ident - local RTEMS_INVALID_NAME" );
-
- status = rtems_task_ident( 100, 2, &Junk_id );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NODE,
- "rtems_task_ident with illegal node"
- );
- puts( "TA1 - rtems_task_ident - RTEMS_INVALID_NODE" );
-
- status = rtems_task_restart( 100, 0 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_task_restart with illegal id"
- );
- puts( "TA1 - rtems_task_restart - RTEMS_INVALID_ID" );
-
- status = rtems_task_resume( 100 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_task_resume with illegal id"
- );
- puts( "TA1 - rtems_task_resume - RTEMS_INVALID_ID" );
-
- status = rtems_task_resume( RTEMS_SELF );
- fatal_directive_status(
- status,
- RTEMS_INCORRECT_STATE,
- "rtems_task_resume of ready task"
- );
- puts( "TA1 - rtems_task_resume - RTEMS_INCORRECT_STATE" );
-
- status = rtems_task_set_priority( RTEMS_SELF, 512, &previous_priority );
- fatal_directive_status(
- status,
- RTEMS_INVALID_PRIORITY,
- "rtems_task_set_priority with illegal priority"
- );
- puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_PRIORITY" );
-
- status = rtems_task_set_priority( 100, 8, &previous_priority );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_task_set_priority with illegal id"
- );
- puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_ID" );
-
- status = rtems_task_set_note(
- RTEMS_SELF,
- RTEMS_NOTEPAD_LAST+10,
- notepad_value
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NUMBER,
- "rtems_task_set_note with illegal notepad"
- );
- puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_NUMBER" );
-
- status = rtems_task_set_note( 100, RTEMS_NOTEPAD_LAST, notepad_value );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_task_set_note with illegal id"
- );
- puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_ID" );
-
- status = rtems_task_start( 100, Task_1, 0 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_task_start with illegal id"
- );
- puts( "TA1 - rtems_task_start - RTEMS_INVALID_ID" );
-
- status = rtems_task_start( 0, Task_1, 0 );
- fatal_directive_status(
- status,
- RTEMS_INCORRECT_STATE,
- "rtems_task_start of ready task"
- );
- puts( "TA1 - rtems_task_start - RTEMS_INCORRECT_STATE" );
-
- status = rtems_task_suspend( 100 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_task_suspend with illegal id"
- );
- puts( "TA1 - rtems_task_suspend - RTEMS_INVALID_ID" );
-}
diff --git a/testsuites/sptests/sp09/screen02.c b/testsuites/sptests/sp09/screen02.c
deleted file mode 100644
index 27982c0af7..0000000000
--- a/testsuites/sptests/sp09/screen02.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/* Screen2
- *
- * This routine generates error screen 2 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 713375cb52..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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_configuration_table BSP_Configuration;
-extern rtems_cpu_table _CPU_Table;
-
-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 (_CPU_Table.stack_allocate_hook)
- {
- puts( "TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED -- SKIPPED" );
- }
- else
- {
- status = rtems_task_create(
- task_name,
- 1,
- BSP_Configuration.work_space_size,
- RTEMS_DEFAULT_MODES,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_UNSATISFIED,
- "rtems_task_create with a stack size larger than the workspace"
- );
- puts( "TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED" );
- }
-
- status = rtems_task_create(
- Task_name[ 2 ],
- 4,
- 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" );
-
- 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"
- );
- 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 3dcddf9581..0000000000
--- a/testsuites/sptests/sp09/screen04.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Screen4
- *
- * This routine generates error screen 4 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 c5dfd1a067..0000000000
--- a/testsuites/sptests/sp09/screen05.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/* Screen5
- *
- * This routine generates error screen 5 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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" );
-
- 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"
- );
- 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 948598dff3..0000000000
--- a/testsuites/sptests/sp09/screen06.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/* Screen6
- *
- * This routine generates error screen 6 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 14ba4ff2d2..0000000000
--- a/testsuites/sptests/sp09/screen07.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/* Screen7
- *
- * This routine generates error screen 7 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 Screen7()
-{
- long buffer[ 4 ];
- rtems_unsigned32 size;
- rtems_unsigned32 count;
- rtems_status_code status;
-
- status = rtems_message_queue_broadcast( 100, (long (*)[4]) buffer, 16, &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,
- 16,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NAME,
- "rtems_message_queue_create with illegal name"
- );
-
- puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_INVALID_NAME" );
- status = rtems_message_queue_create(
- Queue_name[ 1 ],
- 1,
- 16,
- RTEMS_GLOBAL,
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_MP_NOT_CONFIGURED,
- "rtems_message_queue_create of mp not configured"
- );
- puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_MP_NOT_CONFIGURED" );
-
- status = rtems_message_queue_create(
- Queue_name[ 1 ],
- 2,
- 16,
- 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,
- 16,
- 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, (long (*)[4]) buffer, 16 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_message_queue_send with illegal id"
- );
- puts( "TA1 - rtems_message_queue_send - RTEMS_INVALID_ID" );
-
- status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer, 16 );
- directive_failed( status, "rtems_message_queue_send" );
- puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" );
-
- status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer, 16 );
- directive_failed( status, "rtems_message_queue_send" );
- puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" );
-
- status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer, 16 );
- 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 705b9111fa..0000000000
--- a/testsuites/sptests/sp09/screen08.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/* Screen8
- *
- * This routine generates error screen 8 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 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,
- 16,
- 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 ], (long (*)[4])buffer, 16 );
- directive_failed( status, "rtems_message_queue_send successful" );
- puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" );
-
- status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer, 16 );
- directive_failed( status, "rtems_message_queue_send successful" );
- puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" );
-
- status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer, 16 );
- 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,
- 16,
- 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 ], (long (*)[4])buffer, 16 );
- directive_failed( status, "rtems_message_queue_send successful" );
- puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" );
-
- status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer, 16 );
- directive_failed( status, "rtems_message_queue_send successful" );
- puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" );
-
- status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer, 16 );
- 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 ], (long (*)[4])buffer, 16 );
- 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,
- 16,
- 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 a932c38e7c..0000000000
--- a/testsuites/sptests/sp09/screen09.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* Screen9
- *
- * This routine generates error screen 9 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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" );
-
- 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" );
-
- 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" );
-
- status = rtems_signal_send( 100, RTEMS_SIGNAL_1 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_signal_send with illegal id"
- );
- puts( "TA1 - rtems_signal_send - RTEMS_INVALID_ID" );
-
- status = rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_16 );
- fatal_directive_status(
- status,
- RTEMS_NOT_DEFINED,
- "rtems_signal_send with no handler"
- );
- puts( "TA1 - rtems_signal_send - RTEMS_NOT_DEFINED" );
-
- status = rtems_port_create(
- 0,
- Internal_port_area,
- External_port_area,
- sizeof( Internal_port_area ),
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NAME,
- "rtems_port_create with illegal name"
- );
- puts( "TA1 - rtems_port_create - RTEMS_INVALID_NAME" );
-
- status = rtems_port_create(
- Port_name[ 1 ],
- &((char *)Internal_port_area)[ 1 ],
- External_port_area,
- sizeof( Internal_port_area ),
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ADDRESS,
- "rtems_port_create with illegal address"
- );
- puts( "TA1 - rtems_port_create - RTEMS_INVALID_ADDRESS" );
-
- status = rtems_port_create(
- Port_name[ 1 ],
- Internal_port_area,
- External_port_area,
- sizeof( Internal_port_area ),
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_TOO_MANY,
- "rtems_port_create of too many"
- );
- puts( "TA1 - rtems_port_create - RTEMS_TOO_MANY" );
-
- status = rtems_port_delete( 0 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_port_delete with illegal id"
- );
- puts( "TA1 - rtems_port_delete - RTEMS_INVALID_ID" );
-
- status = rtems_port_ident( 0, &Junk_id );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NAME,
- "rtems_port_ident with illegal name"
- );
- puts( "TA1 - rtems_port_ident - RTEMS_INVALID_NAME" );
-
- status = rtems_port_external_to_internal(
- 100,
- Internal_port_area,
- &converted
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_port_external_to_internal with illegal id"
- );
- puts( "TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ID" );
- status = rtems_port_internal_to_external(
- 100,
- Internal_port_area,
- &converted
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_port_internal_to_external with illegal id"
- );
- puts( "TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ID" );
-}
diff --git a/testsuites/sptests/sp09/screen10.c b/testsuites/sptests/sp09/screen10.c
deleted file mode 100644
index bb09ab2d7e..0000000000
--- a/testsuites/sptests/sp09/screen10.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/* Screen10
- *
- * This routine generates error screen 10 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 7857a98c95..0000000000
--- a/testsuites/sptests/sp09/screen11.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/* Screen11
- *
- * This routine generates error screen 11 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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"
- );
-
- status = rtems_partition_create(
- Partition_name[ 1 ],
- Partition_good_area,
- 128,
- 64,
- RTEMS_GLOBAL,
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_MP_NOT_CONFIGURED,
- "rtems_partition_create of global"
- );
- puts( "TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED" );
-
- status = rtems_partition_create(
- Partition_name[ 1 ],
- Partition_bad_area,
- 128,
- 64,
- RTEMS_GLOBAL,
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ADDRESS,
- "rtems_partition_create with bad address"
- );
- puts( "TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS" );
-
- status = rtems_partition_create(
- Partition_name[ 1 ],
- Partition_good_area,
- 128,
- 34,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_SIZE,
- "rtems_partition_create with unaligned buffer_size"
- );
- puts( "TA1 - rtems_partition_create - RTEMS_INVALID_SIZE" );
-
- status = rtems_partition_delete( 100 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_partition_delete with illegal id"
- );
- puts( "TA1 - rtems_partition_delete - unknown RTEMS_INVALID_ID" );
-
- status = rtems_partition_delete( 0x10100 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_partition_delete with illegal id"
- );
- puts( "TA1 - rtems_partition_delete - local RTEMS_INVALID_ID" );
-
- status = rtems_partition_get_buffer( 100, &buffer_address_1 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_partition_get_buffer with illegal id"
- );
- puts( "TA1 - rtems_partition_get_buffer - RTEMS_INVALID_ID" );
-
- status = rtems_partition_ident( 0, RTEMS_SEARCH_ALL_NODES, &Junk_id );
- fatal_directive_status(
- status,
- RTEMS_INVALID_NAME,
- "rtems_partition_ident with illegal name"
- );
- puts( "TA1 - rtems_partition_ident - RTEMS_INVALID_NAME" );
-
- status = rtems_partition_return_buffer( 100, buffer_address_1 );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ID,
- "rtems_partition_return_buffer with illegal id"
- );
- puts( "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ID" );
-
- status = rtems_partition_create(
- Partition_name[ 1 ],
- Partition_good_area,
- 128,
- 64,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Partition_id[ 1 ]
- );
- directive_failed( status, "rtems_partition_create" );
- puts( "TA1 - rtems_partition_create - RTEMS_SUCCESSFUL" );
-
- status = rtems_partition_create(
- Partition_name[ 1 ],
- Partition_good_area,
- 128,
- 32,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Junk_id
- );
- fatal_directive_status(
- status,
- RTEMS_TOO_MANY,
- "rtems_partition_create of too many"
- );
- puts( "TA1 - rtems_partition_create - RTEMS_TOO_MANY" );
-
- status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_1 );
- directive_failed( status, "rtems_partition_get_buffer");
- puts( "TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL" );
-
- status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_2 );
- directive_failed( status, "rtems_partition_get_buffer" );
- puts( "TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL" );
-
- status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_3 );
- fatal_directive_status(
- status,
- RTEMS_UNSATISFIED,
- "rtems_partition_get_buffer unsatisfied"
- );
- puts( "TA1 - rtems_partition_get_buffer - RTEMS_UNSATISFIED" );
-
- status = rtems_partition_delete( Partition_id[ 1 ] );
- fatal_directive_status(
- status,
- RTEMS_RESOURCE_IN_USE,
- "rtems_partition_delete with buffers in use"
- );
- puts( "TA1 - rtems_partition_delete - RTEMS_RESOURCE_IN_USE" );
-
- status = rtems_partition_return_buffer(
- Partition_id[ 1 ],
- Region_good_area /* NOTE: Region Memory */
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ADDRESS,
- "rtems_partition_return_buffer with buffer address out of partition"
- );
- puts(
- "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - out of range"
- );
-
- status = rtems_partition_return_buffer(
- Partition_id[ 1 ],
- &Partition_good_area[ 7 ]
- );
- fatal_directive_status(
- status,
- RTEMS_INVALID_ADDRESS,
- "rtems_partition_return_buffer with buffer address not on boundary"
- );
- puts_nocr( "TA1 - rtems_partition_return_buffer - " );
- puts ( "RTEMS_INVALID_ADDRESS - not on boundary");
-}
diff --git a/testsuites/sptests/sp09/screen12.c b/testsuites/sptests/sp09/screen12.c
deleted file mode 100644
index 281885994a..0000000000
--- a/testsuites/sptests/sp09/screen12.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/* Screen12
- *
- * This routine generates error screen 12 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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" );
-
- 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" );
-
- 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" );
-
- 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 5aee5a3995..0000000000
--- a/testsuites/sptests/sp09/screen13.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Screen13
- *
- * This routine generates error screen 13 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 a53ac99ee4..0000000000
--- a/testsuites/sptests/sp09/screen14.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/* Screen14
- *
- * This routine generates error screen 14 for test 9.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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"
- );
-}
diff --git a/testsuites/sptests/sp09/sp09.doc b/testsuites/sptests/sp09/sp09.doc
deleted file mode 100644
index db8ec401bb..0000000000
--- a/testsuites/sptests/sp09/sp09.doc
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 67471b8d7d..0000000000
--- a/testsuites/sptests/sp09/sp09.scn
+++ /dev/null
@@ -1,251 +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
-<pause - screen 2>
-TA1 - rtems_clock_get - RTEMS_NOT_DEFINED
-TA1 - rtems_task_wake_when - RTEMS_NOT_DEFINED
-TA1 - rtems_timer_fire_when - RTEMS_NOT_DEFINED
-TA1 - rtems_clock_set - 08:30:45 02/05/1987 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_set - 08:30:45 15/05/1988 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_set - 08:30:45 02/32/1988 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_set - 25:30:45 02/05/1988 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_set - 08:61:45 02/05/1988 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_set - 08:30:61 02/05/1988 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_set - 08:30:45 02/05/1988 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_set - 08:30:45 02/05/1988 - RTEMS_SUCCESSFUL
-TA1 - rtems_task_wake_when - TICKINVALID - sleep about 3 seconds
-TA1 - rtems_task_wake_when - TICKINVALID - woke up RTEMS_SUCCESSFUL
-TA1 - rtems_task_wake_when - 08:30:48 02/05/1961 - RTEMS_INVALID_CLOCK
-TA1 - rtems_task_wake_when - 25:30:48 02/05/1988 - RTEMS_INVALID_CLOCK
-TA1 - current time - 08:30:51 02/05/1988
-TA1 - rtems_task_wake_when - 08:30:51 01/05/1988 - RTEMS_INVALID_CLOCK
-<pause - screen 3>
-TA1 - rtems_task_create - RTEMS_INVALID_NAME
-TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED
-TA1 - rtems_task_create - TA2 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_suspend - suspend TA2 - RTEMS_SUCCESSFUL
-TA1 - rtems_task_suspend - suspend TA2 - RTEMS_ALREADY_SUSPENDED
-TA1 - rtems_task_resume - TA2 resumed - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - TA3 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 4 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 5 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 6 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 7 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 8 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 9 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 10 created - RTEMS_SUCCESSFUL
-TA1 - rtems_task_create - 11 - RTEMS_TOO_MANY
-TA1 - rtems_task_create - RTEMS_MP_NOT_CONFIGURED
-<pause - screen 4>
-TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( all conditions )
-TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( any condition )
-TA1 - rtems_event_receive - timeout in 3 seconds
-TA1 - rtems_event_receive - woke up with RTEMS_TIMEOUT
-TA1 - rtems_event_send - RTEMS_INVALID_ID
-TA1 - rtems_task_wake_after - sleep 1 second - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_set - 08:30:45 02/05/1988 - RTEMS_SUCCESSFUL
-<pause - screen 5>
-TA1 - rtems_semaphore_create - RTEMS_INVALID_NAME
-TA1 - rtems_semaphore_create - 1 - RTEMS_SUCCESSFUL
-TA1 - rtems_semaphore_create - 2 - RTEMS_SUCCESSFUL
-TA1 - rtems_semaphore_create - 3 - RTEMS_TOO_MANY
-TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED
-TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED
-TA1 - rtems_semaphore_create - RTEMS_INVALID_NUMBER
-TA1 - rtems_semaphore_create - RTEMS_MP_NOT_CONFIGURED
-TA1 - rtems_semaphore_delete - unknown RTEMS_INVALID_ID
-TA1 - rtems_semaphore_delete - local RTEMS_INVALID_ID
-TA1 - rtems_semaphore_ident - global RTEMS_INVALID_NAME
-TA1 - rtems_semaphore_ident - local RTEMS_INVALID_NAME
-<pause - screen 6>
-TA1 - rtems_semaphore_obtain - RTEMS_INVALID_ID
-TA1 - rtems_semaphore_obtain - got sem 1 - RTEMS_SUCCESSFUL
-TA1 - rtems_semaphore_obtain - RTEMS_UNSATISFIED
-TA1 - rtems_semaphore_obtain - timeout in 3 seconds
-TA1 - rtems_semaphore_obtain - woke up with RTEMS_TIMEOUT
-TA1 - rtems_semaphore_release - RTEMS_NOT_OWNER_OF_RESOURCE
-TA1 - rtems_semaphore_release - RTEMS_INVALID_ID
-TA1 - rtems_task_start - start TA2 - RTEMS_SUCCESSFUL
-TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL
-TA2 - rtems_semaphore_obtain - sem 1 - RTEMS_WAIT FOREVER
-TA1 - rtems_semaphore_delete - delete sem 1 - RTEMS_SUCCESSFUL
-TA1 - rtems_semaphore_obtain - binary semaphore
-TA1 - rtems_semaphore_delete - delete sem 2 - RTEMS_RESOURCE_IN_USE
-TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL
-TA2 - rtems_semaphore_obtain - woke up with RTEMS_OBJECT_WAS_DELETED
-TA2 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL
-<pause - screen 7>
-TA1 - rtems_message_queue_broadcast - RTEMS_INVALID_ID
-TA1 - rtems_message_queue_create - Q 1 - RTEMS_INVALID_NAME
-TA1 - rtems_message_queue_create - Q 1 - RTEMS_MP_NOT_CONFIGURED
-TA1 - rtems_message_queue_create - Q 1 - 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
-<pause - screen 8>
-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
-<pause - screen 9>
-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
-<pause - screen 10>
-TA1 - rtems_rate_monotonic_create - RTEMS_INVALID_NAME
-TA1 - rtems_rate_monotonic_create - RTEMS_SUCCESSFUL
-TA1 - rtems_rate_monotonic_create - RTEMS_TOO_MANY
-TA1 - rtems_rate_monotonic_ident - RTEMS_INVALID_NAME
-TA1 - rtems_rate_monotonic_period - unknown RTEMS_INVALID_ID
-TA1 - rtems_rate_monotonic_period - local RTEMS_INVALID_ID
-TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_NOT_DEFINED
-TA1 - rtems_rate_monotonic_period - 100 ticks - RTEMS_SUCCESSFUL
-TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_SUCCESSFUL
-TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_TIMEOUT
-TA1 - rtems_rate_monotonic_cancel - unknown RTEMS_INVALID_ID
-TA1 - rtems_rate_monotonic_cancel - local RTEMS_INVALID_ID
-TA1 - rtems_rate_monotonic_cancel - RTEMS_SUCCESSFUL
-TA1 - rtems_rate_monotonic_period - 5 ticks - RTEMS_TIMEOUT
-TA1 - yielding to TA4
-TA4 - rtems_rate_monotonic_cancel - RTEMS_NOT_OWNER_OF_RESOURCE
-TA4 - rtems_rate_monotonic_period - RTEMS_NOT_OWNER_OF_RESOURCE
-TA4 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL
-TA1 - rtems_rate_monotonic_delete - unknown RTEMS_INVALID_ID
-TA1 - rtems_rate_monotonic_delete - local RTEMS_INVALID_ID
-TA1 - rtems_rate_monotonic_delete - RTEMS_SUCCESSFUL
-<pause - screen 11>
-TA1 - rtems_partition_create - RTEMS_INVALID_NAME
-TA1 - rtems_partition_create - length - RTEMS_INVALID_SIZE
-TA1 - rtems_partition_create - buffer size - RTEMS_INVALID_SIZE
-TA1 - rtems_partition_create - length < buffer size - RTEMS_INVALID_SIZE
-TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED
-TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS
-TA1 - rtems_partition_create - RTEMS_INVALID_SIZE
-TA1 - rtems_partition_delete - unknown RTEMS_INVALID_ID
-TA1 - rtems_partition_delete - local RTEMS_INVALID_ID
-TA1 - rtems_partition_get_buffer - RTEMS_INVALID_ID
-TA1 - rtems_partition_ident - RTEMS_INVALID_NAME
-TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ID
-TA1 - rtems_partition_create - RTEMS_SUCCESSFUL
-TA1 - rtems_partition_create - RTEMS_TOO_MANY
-TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL
-TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL
-TA1 - rtems_partition_get_buffer - RTEMS_UNSATISFIED
-TA1 - rtems_partition_delete - RTEMS_RESOURCE_IN_USE
-TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - out of range
-TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - not on boundary
-<pause - screen 12>
-TA1 - rtems_region_create - RTEMS_INVALID_NAME
-TA1 - rtems_region_create - RTEMS_INVALID_ADDRESS
-TA1 - rtems_region_create - RTEMS_INVALID_SIZE
-TA1 - rtems_region_create - RTEMS_SUCCESSFUL
-TA1 - rtems_region_create - RTEMS_TOO_MANY
-TA1 - rtems_region_delete - unknown RTEMS_INVALID_ID
-TA1 - rtems_region_delete - local RTEMS_INVALID_ID
-TA1 - rtems_region_ident - RTEMS_INVALID_NAME
-TA1 - rtems_region_get_segment - RTEMS_INVALID_ID
-TA1 - rtems_region_get_segment - RTEMS_INVALID_SIZE
-TA1 - rtems_region_get_segment - RTEMS_SUCCESSFUL
-TA1 - rtems_region_get_segment - RTEMS_UNSATISFIED
-TA1 - rtems_region_get_segment - timeout in 3 seconds
-TA1 - rtems_region_get_segment - woke up with RTEMS_TIMEOUT
-TA1 - rtems_region_delete - RTEMS_RESOURCE_IN_USE
-TA1 - rtems_region_return_segment - RTEMS_INVALID_ID
-TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS
-TA1 - rtems_debug_disable - RTEMS_DEBUG_REGION
-TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS - 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
-<pause - screen 13>
-TA1 - rtems_io_close - RTEMS_INVALID_NUMBER
-TA1 - rtems_io_control - RTEMS_INVALID_NUMBER
-TA1 - rtems_io_initialize - RTEMS_INVALID_NUMBER
-TA1 - rtems_io_open - RTEMS_INVALID_NUMBER
-TA1 - rtems_io_read - RTEMS_INVALID_NUMBER
-TA1 - rtems_io_write - RTEMS_INVALID_NUMBER
-TA1 - rtems_clock_set - 23:59:59 12/31/2000 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_get - 00:00:00 01/01/2001 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_set - 23:59:59 12/31/1999 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_get - 00:00:00 01/01/2000 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_set - 23:59:59 12/31/2100 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_get - 00:00:00 01/01/2101 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_set - 23:59:59 12/31/2099 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_get - 00:00:00 01/01/2100 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_set - 23:59:59 12/31/1991 - RTEMS_SUCCESSFUL
-TA1 - rtems_clock_get - 00:00:00 01/01/1992 - RTEMS_SUCCESSFUL
-<pause - screen 14>
-TA1 - rtems_timer_create - RTEMS_INVALID_NAME
-TA1 - rtems_timer_create - 1 - RTEMS_SUCCESSFUL
-TA1 - rtems_timer_create - 2 - RTEMS_TOO_MANY
-TA1 - rtems_timer_delete - local RTEMS_INVALID_ID
-TA1 - rtems_timer_delete - global RTEMS_INVALID_ID
-TA1 - rtems_timer_ident - RTEMS_INVALID_NAME
-TA1 - rtems_timer_cancel - RTEMS_INVALID_ID
-TA1 - rtems_timer_reset - RTEMS_INVALID_ID
-TA1 - rtems_timer_reset - RTEMS_NOT_DEFINED
-TA1 - rtems_timer_fire_after - RTEMS_INVALID_ID
-TA1 - rtems_timer_fire_when - RTEMS_INVALID_ID
-TA1 - rtems_timer_fire_after - RTEMS_INVALID_NUMBER
-TA1 - rtems_timer_fire_when - 08:30:45 02/05/1987 - RTEMS_INVALID_CLOCK
-TA1 - rtems_clock_get - 00:00:00 01/01/1992
-TA1 - rtems_timer_fire_when - 08:30:45 02/05/1990 - before RTEMS_INVALID_CLOCK
-*** END OF TEST 9 ***
diff --git a/testsuites/sptests/sp09/system.h b/testsuites/sptests/sp09/system.h
deleted file mode 100644
index 69b28b1b4d..0000000000
--- a/testsuites/sptests/sp09/system.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* 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 997204674d..0000000000
--- a/testsuites/sptests/sp09/task1.c
+++ /dev/null
@@ -1,70 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp09/task2.c b/testsuites/sptests/sp09/task2.c
deleted file mode 100644
index 9fdd9160da..0000000000
--- a/testsuites/sptests/sp09/task2.c
+++ /dev/null
@@ -1,48 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 2f1a91f5d6..0000000000
--- a/testsuites/sptests/sp09/task3.c
+++ /dev/null
@@ -1,53 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 2b8c127a98..0000000000
--- a/testsuites/sptests/sp09/task4.c
+++ /dev/null
@@ -1,50 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/init.c b/testsuites/sptests/sp11/init.c
deleted file mode 100644
index 6382f31bae..0000000000
--- a/testsuites/sptests/sp11/init.c
+++ /dev/null
@@ -1,92 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 5bc0bae8bd..0000000000
--- a/testsuites/sptests/sp11/sp11.doc
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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
-<pause>
-TA1 - rtems_event_send - send RTEMS_EVENT_18 to self after 5 seconds
-TA1 - rtems_event_receive - waiting forever on RTEMS_EVENT_18
-TA2 - RTEMS_EVENT_10 received - eventout => 00000400
-TA2 - rtems_clock_get - 08:15:05 02/12/1988
-TA2 - rtems_event_receive - RTEMS_PENDING_EVENTS
-TA2 - eventout => 00080000
-TA2 - rtems_event_receive - RTEMS_EVENT_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
-<pause>
-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
-<pause>
-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
-<pause>
-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 113113969c..0000000000
--- a/testsuites/sptests/sp11/system.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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 b8d3530b04..0000000000
--- a/testsuites/sptests/sp11/task1.c
+++ /dev/null
@@ -1,410 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp11/task2.c b/testsuites/sptests/sp11/task2.c
deleted file mode 100644
index 8522334b9a..0000000000
--- a/testsuites/sptests/sp11/task2.c
+++ /dev/null
@@ -1,126 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 986b7b91ad..0000000000
--- a/testsuites/sptests/sp11/timer.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Timer_functions
- *
- * These routines are the timer service routines used by this test.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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( status, "rtems_event_send of 18" );
-}
-
-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( status, "rtems_event_send of 8" );
-}
-
-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( status, "rtems_event_send of 9" );
-}
-
-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( status, "rtems_event_send of 10" );
-}
-
-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( status, "rtems_event_send of 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( status, "rtems_event_send of 11" );
-}
-
-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( status, "rtems_event_send of 10" );
-}
diff --git a/testsuites/sptests/sp12/init.c b/testsuites/sptests/sp12/init.c
deleted file mode 100644
index d610dc070b..0000000000
--- a/testsuites/sptests/sp12/init.c
+++ /dev/null
@@ -1,179 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 24c96c10ea..0000000000
--- a/testsuites/sptests/sp12/pridrv.c
+++ /dev/null
@@ -1,131 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 eb5ac15603..0000000000
--- a/testsuites/sptests/sp12/pritask.c
+++ /dev/null
@@ -1,91 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 );
- 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,
- &current_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 a729ab0843..0000000000
--- a/testsuites/sptests/sp12/sp12.doc
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 e87a729259..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
-<pause>
-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
-<pause>
-TA1 - rtems_semaphore_ident - smid => 14010002
-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
-<pause>
-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
-<pause>
-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 08b43430a6..0000000000
--- a/testsuites/sptests/sp12/system.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2)
-#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 <confdefs.h>
-
-/* 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 4b284ee364..0000000000
--- a/testsuites/sptests/sp12/task1.c
+++ /dev/null
@@ -1,153 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 c83fd87b8a..0000000000
--- a/testsuites/sptests/sp12/task2.c
+++ /dev/null
@@ -1,65 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 5622df991f..0000000000
--- a/testsuites/sptests/sp12/task3.c
+++ /dev/null
@@ -1,50 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 f392007fe2..0000000000
--- a/testsuites/sptests/sp12/task4.c
+++ /dev/null
@@ -1,37 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 263eed640b..0000000000
--- a/testsuites/sptests/sp12/task5.c
+++ /dev/null
@@ -1,55 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp13/fillbuff.c b/testsuites/sptests/sp13/fillbuff.c
deleted file mode 100644
index 2f821d6c1c..0000000000
--- a/testsuites/sptests/sp13/fillbuff.c
+++ /dev/null
@@ -1,31 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 Fill_buffer(
- char *source,
- long *buffer
-)
-{
- memcpy( buffer, source, 16 );
-}
diff --git a/testsuites/sptests/sp13/init.c b/testsuites/sptests/sp13/init.c
deleted file mode 100644
index 40b6574d68..0000000000
--- a/testsuites/sptests/sp13/init.c
+++ /dev/null
@@ -1,112 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 13 ***" );
-
- 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 ],
- 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 * 2,
- 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" );
-
- Queue_name[ 1 ] = rtems_build_name( 'Q', '1', ' ', ' ' );
- Queue_name[ 2 ] = rtems_build_name( 'Q', '2', ' ', ' ' );
- Queue_name[ 3 ] = rtems_build_name( 'Q', '3', ' ', ' ' );
-
- status = rtems_message_queue_create(
- Queue_name[ 1 ],
- 100,
- 16,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Queue_id[ 1 ]
- );
- directive_failed( status, "rtems_message_queue_create of Q1" );
-
- status = rtems_message_queue_create(
- Queue_name[ 2 ],
- 10,
- 16,
- RTEMS_PRIORITY,
- &Queue_id[ 2 ]
- );
- directive_failed( status, "rtems_message_queue_create of Q2" );
-
- status = rtems_message_queue_create(
- Queue_name[ 3 ],
- 100,
- 16,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Queue_id[ 3 ]
- );
- directive_failed( status, "rtems_message_queue_create of Q3" );
-
- status = rtems_task_delete( RTEMS_SELF );
- directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
-}
diff --git a/testsuites/sptests/sp13/putbuff.c b/testsuites/sptests/sp13/putbuff.c
deleted file mode 100644
index 154be5d400..0000000000
--- a/testsuites/sptests/sp13/putbuff.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Put_buffer
- *
- * This test routine prints the given buffer.
- * buffer.
- *
- * Input parameters:
- * buffer - pointer to message buffer to be printer
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 Put_buffer(
- long *buffer
-)
-{
- printf( "%16s", (char *)buffer );
-}
diff --git a/testsuites/sptests/sp13/sp13.doc b/testsuites/sptests/sp13/sp13.doc
deleted file mode 100644
index e46d8b6eed..0000000000
--- a/testsuites/sptests/sp13/sp13.doc
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 cb34131eb9..0000000000
--- a/testsuites/sptests/sp13/sp13.scn
+++ /dev/null
@@ -1,76 +0,0 @@
-*** TEST 13 ***
-TA1 - rtems_message_queue_ident - qid => 18010001
-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
-<pause>
-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
-<pause>
-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
-<pause>
-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
-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
-<pause>
-TA1 - create message queue of 20 bytes on queue 1
-TA1 - rtems_message_queue_delete - delete queue 1
-<pause>
-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 e1efa42963..0000000000
--- a/testsuites/sptests/sp13/system.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 10
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (2 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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 3ac0c398eb..0000000000
--- a/testsuites/sptests/sp13/task1.c
+++ /dev/null
@@ -1,352 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <string.h> /* for memcmp */
-
-extern rtems_configuration_table BSP_Configuration;
-
-char big_send_buffer[2048];
-char big_receive_buffer[2048];
-
-long buffer[ 4 ];
-
-void dope_buffer(unsigned char *buff,
- int buff_size,
- unsigned32 v)
-{
- int i;
- unsigned char ch;
-
- ch = (' ' + (v % (0x7f - ' ')));
-
- for (i=0; i<buff_size; i++)
- {
- *buff++ = ch++;
- if (ch >= 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- 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, 16 );
- directive_failed( status, "rtems_message_queue_send" );
-
- 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, 16 );
- 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, 16 );
- 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");
- exit(1);
- }
-
- if (memcmp(big_send_buffer, big_receive_buffer, size) != 0)
- {
- puts("TA1 - exact size data match failed");
- 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");
- 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp13/task2.c b/testsuites/sptests/sp13/task2.c
deleted file mode 100644
index 1246e84d30..0000000000
--- a/testsuites/sptests/sp13/task2.c
+++ /dev/null
@@ -1,139 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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
-)
-{
- 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 ],
- (long (*)[4])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 ],
- (long (*)[4])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 ],
- (long (*)[4])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 ],
- (long (*)[4])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" );
- directive_failed( status, "rtems_message_queue_send" );
-
- status = rtems_message_queue_send( Queue_id[ 2 ], (long (*)[4])buffer, 16 );
- 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 ],
- (long (*)[4])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 ],
- (long (*)[4])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 501bc01e3e..0000000000
--- a/testsuites/sptests/sp13/task3.c
+++ /dev/null
@@ -1,78 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/asr.c b/testsuites/sptests/sp14/asr.c
deleted file mode 100644
index 04902c605a..0000000000
--- a/testsuites/sptests/sp14/asr.c
+++ /dev/null
@@ -1,47 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 bc59a52cb4..0000000000
--- a/testsuites/sptests/sp14/init.c
+++ /dev/null
@@ -1,72 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 c5f06e136f..0000000000
--- a/testsuites/sptests/sp14/sp14.doc
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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
-<pause>
-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 ecb34d21b7..0000000000
--- a/testsuites/sptests/sp14/system.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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 c46d833dde..0000000000
--- a/testsuites/sptests/sp14/task1.c
+++ /dev/null
@@ -1,116 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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( status, "rtems_signal_send of 3" );
-
- 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 27d17dbe3c..0000000000
--- a/testsuites/sptests/sp14/task2.c
+++ /dev/null
@@ -1,48 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp15/init.c b/testsuites/sptests/sp15/init.c
deleted file mode 100644
index 489b387cc3..0000000000
--- a/testsuites/sptests/sp15/init.c
+++ /dev/null
@@ -1,78 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 261f9e7a49..0000000000
--- a/testsuites/sptests/sp15/sp15.doc
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 f1a800dc0d..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 = 1c010001
-TA1 - rtems_partition_ident - partition 2 id = 1c010002
-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 ef5e481920..0000000000
--- a/testsuites/sptests/sp15/system.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Task_1(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_PARTITIONS 2
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_name Partition_id[ 4 ]; /* array of partition ids */
-TEST_EXTERN rtems_name Partition_name[ 4 ]; /* array of partition names */
-
-TEST_EXTERN rtems_unsigned8 Area_1[4096] CPU_STRUCTURE_ALIGNMENT;
-TEST_EXTERN rtems_unsigned8 Area_2[274] CPU_STRUCTURE_ALIGNMENT;
-
-#define Put_address_from_area_1( _to_be_printed ) \
- printf( "0x%08lx", \
- (unsigned long)((rtems_unsigned8 *)(_to_be_printed) - Area_1 ) )
-
-#define Put_address_from_area_2( _to_be_printed ) \
- printf( "0x%08lx", \
- (unsigned long)((rtems_unsigned8 *)(_to_be_printed) - Area_2 ) )
-
-/* end of include file */
diff --git a/testsuites/sptests/sp15/task1.c b/testsuites/sptests/sp15/task1.c
deleted file mode 100644
index da77cdf478..0000000000
--- a/testsuites/sptests/sp15/task1.c
+++ /dev/null
@@ -1,129 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp16/init.c b/testsuites/sptests/sp16/init.c
deleted file mode 100644
index d526b7d3e3..0000000000
--- a/testsuites/sptests/sp16/init.c
+++ /dev/null
@@ -1,128 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 1a208582dc..0000000000
--- a/testsuites/sptests/sp16/sp16.doc
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 36d533c2b4..0000000000
--- a/testsuites/sptests/sp16/sp16.scn
+++ /dev/null
@@ -1,58 +0,0 @@
-*** TEST 16 ***
-TA1 - rtems_region_ident - rnid => 20010002
-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
-<pause>
-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
-<pause>
-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 b507d2a562..0000000000
--- a/testsuites/sptests/sp16/system.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* 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 fdd2776e93..0000000000
--- a/testsuites/sptests/sp16/task1.c
+++ /dev/null
@@ -1,282 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp16/task2.c b/testsuites/sptests/sp16/task2.c
deleted file mode 100644
index 2f17952b09..0000000000
--- a/testsuites/sptests/sp16/task2.c
+++ /dev/null
@@ -1,86 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 09a3ec87ad..0000000000
--- a/testsuites/sptests/sp16/task3.c
+++ /dev/null
@@ -1,57 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 3f1eebeb28..0000000000
--- a/testsuites/sptests/sp16/task4.c
+++ /dev/null
@@ -1,60 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 0f36aec535..0000000000
--- a/testsuites/sptests/sp16/task5.c
+++ /dev/null
@@ -1,73 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/asr.c b/testsuites/sptests/sp17/asr.c
deleted file mode 100644
index d4384a0774..0000000000
--- a/testsuites/sptests/sp17/asr.c
+++ /dev/null
@@ -1,32 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 1a49b46c78..0000000000
--- a/testsuites/sptests/sp17/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 dcff893039..0000000000
--- a/testsuites/sptests/sp17/sp17.doc
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 8f595b3e6b..0000000000
--- a/testsuites/sptests/sp17/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(25)
-#define CONFIGURE_TICKS_PER_TIMESLICE 1000
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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 9bd1a04e01..0000000000
--- a/testsuites/sptests/sp17/task1.c
+++ /dev/null
@@ -1,48 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp17/task2.c b/testsuites/sptests/sp17/task2.c
deleted file mode 100644
index 1b9759c9b6..0000000000
--- a/testsuites/sptests/sp17/task2.c
+++ /dev/null
@@ -1,45 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/first.c b/testsuites/sptests/sp19/first.c
deleted file mode 100644
index 82348300ed..0000000000
--- a/testsuites/sptests/sp19/first.c
+++ /dev/null
@@ -1,66 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 f80e0decca..0000000000
--- a/testsuites/sptests/sp19/fptask.c
+++ /dev/null
@@ -1,98 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 *** " );
- 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 a30f2cf451..0000000000
--- a/testsuites/sptests/sp19/fptest.h
+++ /dev/null
@@ -1,172 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <stdio.h>
-
-#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 86c38134ef..0000000000
--- a/testsuites/sptests/sp19/init.c
+++ /dev/null
@@ -1,150 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 1da6c7d42a..0000000000
--- a/testsuites/sptests/sp19/inttest.h
+++ /dev/null
@@ -1,149 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <stdio.h>
-#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 0b26e5d8b2..0000000000
--- a/testsuites/sptests/sp19/sp19.doc
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 fefd7ece07..0000000000
--- a/testsuites/sptests/sp19/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (18 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* 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 9b271fac8f..0000000000
--- a/testsuites/sptests/sp19/task1.c
+++ /dev/null
@@ -1,59 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/getall.c b/testsuites/sptests/sp20/getall.c
deleted file mode 100644
index 85f6470d1c..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/sptests/sp20/init.c b/testsuites/sptests/sp20/init.c
deleted file mode 100644
index e70df5aa47..0000000000
--- a/testsuites/sptests/sp20/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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', ' ' );
-
- for ( index = 1 ; index <= 5 ; 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 <= 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/sptests/sp20/sp20.doc b/testsuites/sptests/sp20/sp20.doc
deleted file mode 100644
index 668aa4a844..0000000000
--- a/testsuites/sptests/sp20/sp20.doc
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 bb4e8814da..0000000000
--- a/testsuites/sptests/sp20/sp20.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/sptests/sp20/system.h b/testsuites/sptests/sp20/system.h
deleted file mode 100644
index 45d79b70d8..0000000000
--- a/testsuites/sptests/sp20/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_INIT_TASK_PRIORITY 10
-#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
-#define CONFIGURE_MAXIMUM_PERIODS 10
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (15 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* 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/sptests/sp20/task1.c b/testsuites/sptests/sp20/task1.c
deleted file mode 100644
index dc80a405d5..0000000000
--- a/testsuites/sptests/sp20/task1.c
+++ /dev/null
@@ -1,116 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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_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 );
- 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 )
- exit( 0 );
-
- pass += 1;
-
- printf( "TA5 - PERIODS CHECK OK (%d)\n", pass );
-
- fflush( stdout );
-
- if ( pass == 10 ) {
- puts( "*** END OF TEST 20 ***" );
- exit( 0 );
- }
-
- }
- break;
- }
-}
diff --git a/testsuites/sptests/sp21/init.c b/testsuites/sptests/sp21/init.c
deleted file mode 100644
index acfa626b6c..0000000000
--- a/testsuites/sptests/sp21/init.c
+++ /dev/null
@@ -1,53 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 6666e315f2..0000000000
--- a/testsuites/sptests/sp21/sp21.doc
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 563ce8b63d..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Task_1(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-#define CONFIGURE_TEST_NEEDS_STUB_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/testsuites/sptests/sp21/task1.c b/testsuites/sptests/sp21/task1.c
deleted file mode 100644
index b961b2e0d6..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 0x5
-
-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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp22/delay.c b/testsuites/sptests/sp22/delay.c
deleted file mode 100644
index 17b8b8b412..0000000000
--- a/testsuites/sptests/sp22/delay.c
+++ /dev/null
@@ -1,32 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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( status, "rtems_task_resume of self" );
-}
diff --git a/testsuites/sptests/sp22/init.c b/testsuites/sptests/sp22/init.c
deleted file mode 100644
index 92dc031a25..0000000000
--- a/testsuites/sptests/sp22/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 9d36f1e0d8..0000000000
--- a/testsuites/sptests/sp22/prtime.c
+++ /dev/null
@@ -1,32 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 262f441342..0000000000
--- a/testsuites/sptests/sp22/sp22.doc
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 6fb08156c5..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 (0x10010001)
-TA1 - rtems_timer_ident - identing timer 1
-TA1 - timer 1 has id (0x10010001)
-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
-<pause>
-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 8e23bd3e02..0000000000
--- a/testsuites/sptests/sp22/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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 38c20ad956..0000000000
--- a/testsuites/sptests/sp22/task1.c
+++ /dev/null
@@ -1,164 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <cr> 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 *** " );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp23/init.c b/testsuites/sptests/sp23/init.c
deleted file mode 100644
index c91f107a4e..0000000000
--- a/testsuites/sptests/sp23/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 2ea35a714a..0000000000
--- a/testsuites/sptests/sp23/sp23.doc
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 7d9f8ff898..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 - 0x24010001
-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 e88f367859..0000000000
--- a/testsuites/sptests/sp23/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Task_1(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#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 <confdefs.h>
-
-/* 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 886f7c8d04..0000000000
--- a/testsuites/sptests/sp23/task1.c
+++ /dev/null
@@ -1,96 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/sp24/init.c b/testsuites/sptests/sp24/init.c
deleted file mode 100644
index 8cb39f3d34..0000000000
--- a/testsuites/sptests/sp24/init.c
+++ /dev/null
@@ -1,76 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 81e37c361f..0000000000
--- a/testsuites/sptests/sp24/resume.c
+++ /dev/null
@@ -1,34 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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( status, "rtems_task_resume" );
-}
diff --git a/testsuites/sptests/sp24/sp24.doc b/testsuites/sptests/sp24/sp24.doc
deleted file mode 100644
index aecae8b27a..0000000000
--- a/testsuites/sptests/sp24/sp24.doc
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 c3775f4ee3..0000000000
--- a/testsuites/sptests/sp24/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TIMERS 3
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_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 464286ae1f..0000000000
--- a/testsuites/sptests/sp24/task1.c
+++ /dev/null
@@ -1,58 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ***" );
- 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/init.c b/testsuites/sptests/sp25/init.c
deleted file mode 100644
index 6fb95bbb8f..0000000000
--- a/testsuites/sptests/sp25/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 9a0417dfea..0000000000
--- a/testsuites/sptests/sp25/sp25.doc
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 af2599663d..0000000000
--- a/testsuites/sptests/sp25/sp25.scn
+++ /dev/null
@@ -1,29 +0,0 @@
-*** TEST 25 ***
-TA1 - rtems_region_ident - 0x20010002
-TA1 - rtems_region_get_segment - wait on 64 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000f9b8
-TA1 - rtems_region_get_segment - wait on 128 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000f930
-TA1 - rtems_region_get_segment - wait on 256 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000f828
-TA1 - rtems_region_get_segment - wait on 512 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000f620
-TA1 - rtems_region_get_segment - wait on 1024 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000f218
-TA1 - rtems_region_get_segment - wait on 2048 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000ea10
-TA1 - rtems_region_get_segment - wait on 4096 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000da08
-TA1 - rtems_region_get_segment - wait on 8192 byte segment from region 1
-TA1 - got segment from region 1 - 0x0000ba00
-<pause>
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f828
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f620
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f9b8
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f930
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000da08
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000ea10
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000ba00
-TA1 - rtems_region_return_segment - return segment to region 1 - 0x0000f218
-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 3435288228..0000000000
--- a/testsuites/sptests/sp25/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Task_1(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_REGIONS 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* 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 45bf5780f4..0000000000
--- a/testsuites/sptests/sp25/task1.c
+++ /dev/null
@@ -1,241 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ], &region_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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/sptests/spfatal/fatal.c b/testsuites/sptests/spfatal/fatal.c
deleted file mode 100644
index aef4a159de..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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 <setjmp.h>
-
-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 = BSP_Configuration;
- 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, &Cpu_table );
-}
-
diff --git a/testsuites/sptests/spfatal/init.c b/testsuites/sptests/spfatal/init.c
deleted file mode 100644
index 1892975f29..0000000000
--- a/testsuites/sptests/spfatal/init.c
+++ /dev/null
@@ -1,51 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 d5404d3d1b..0000000000
--- a/testsuites/sptests/spfatal/puterr.c
+++ /dev/null
@@ -1,68 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 b6ff6b5504..0000000000
--- a/testsuites/sptests/spfatal/spfatal.doc
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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 f2391c2a94..0000000000
--- a/testsuites/sptests/spfatal/system.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* 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_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_configuration_table New_Configuration;
-
-extern rtems_extensions_table Extensions;
-extern rtems_configuration_table BSP_Configuration;
-extern rtems_cpu_table Cpu_table;
-
-/* end of include file */
diff --git a/testsuites/sptests/spfatal/task1.c b/testsuites/sptests/spfatal/task1.c
deleted file mode 100644
index f7298ab2a4..0000000000
--- a/testsuites/sptests/spfatal/task1.c
+++ /dev/null
@@ -1,29 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/getint.c b/testsuites/sptests/spsize/getint.c
deleted file mode 100644
index 01eae17fec..0000000000
--- a/testsuites/sptests/spsize/getint.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* getint
- *
- * This routine reads and returns an integer.
- * It assumes decimal.
- *
- * Input parameters: NONE
- *
- * Output parameters:
- * returns - number read
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-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 f7d3b67fd6..0000000000
--- a/testsuites/sptests/spsize/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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: 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 9ebad1aad6..0000000000
--- a/testsuites/sptests/spsize/size.c
+++ /dev/null
@@ -1,650 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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/system.h>
-#include <rtems/config.h>
-#include <rtems/directives.h>
-#include <rtems/score/apiext.h>
-#include <rtems/score/copyrt.h>
-#include <rtems/rtems/clock.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/rtems/dpmem.h>
-#include <rtems/rtems/event.h>
-#include <rtems/extension.h>
-#include <rtems/fatal.h>
-#include <rtems/init.h>
-#include <rtems/score/isr.h>
-#include <rtems/rtems/intr.h>
-#include <rtems/io.h>
-#include <rtems/rtems/message.h>
-#include <rtems/rtems/mp.h>
-#include <rtems/score/mpci.h>
-#include <rtems/rtems/part.h>
-#include <rtems/score/priority.h>
-#include <rtems/rtems/ratemon.h>
-#include <rtems/rtems/region.h>
-#include <rtems/rtems/sem.h>
-#include <rtems/rtems/signal.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/timer.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/userext.h>
-#include <rtems/score/wkspace.h>
-
-#include <stdlib.h>
-
-/* These are always defined by the executive.
- *
- * #include <rtems/copyrt.h>
- * #include <rtems/tables.h>
- * #include <rtems/sptables.h>
- */
-#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
-#define PER_GOBJECT (long) (sizeof (Objects_MP_Control))
-#define PER_PROXY (long) (sizeof (Thread_Proxy_control))
-
-#if (CPU_ALL_TASKS_ARE_FP == TRUE)
-#define MPCI_RECEIVE_SERVER_FP (long) (sizeof( Context_Control_fp ))
-#else
-#define MPCI_RECEIVE_SERVER_FP (long) 0
-#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
-
-#define SYSTEM_TASKS \
- (STACK_MINIMUM_SIZE + \
- MPCI_RECEIVE_SERVER_STACK_SIZE + \
- (2*sizeof(Thread_Control))) + \
- MPCI_RECEIVE_SERVER_FP + \
- SYSTEM_IDLE_FP
-
-#define rtems_unsigned32 unsigned32
-
-rtems_unsigned32 sys_req;
-
-/* to avoid warnings */
-int puts();
-int printf();
-int getint();
-#undef getchar
-int getchar();
-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) +
-
-/*eventmp.h*/ 0 +
-
-/*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 +
-
-/*mp.h*/ 0 +
-
-/*mpci.h*/ (sizeof _MPCI_Remote_blocked_threads) +
- (sizeof _MPCI_Semaphore) +
- (sizeof _MPCI_table) +
- (sizeof _MPCI_Receive_server_tcb) +
- (sizeof _MPCI_Packet_processors) +
-
-/*mppkt.h*/ 0 +
-
-/*mptables.h*/ 0 +
-
-/*msgmp.h*/ 0 +
-
-/*object.h*/ (sizeof _Objects_Local_node) +
- (sizeof _Objects_Maximum_nodes) +
- (sizeof _Objects_Information_table) +
-
-/*objectmp.h*/ (sizeof _Objects_MP_Maximum_global_objects) +
- (sizeof _Objects_MP_Inactive_global_objects) +
-
-/*options.h*/ 0 +
-
-/*part.h*/ (sizeof _Partition_Information) +
-
-/*partmp.h*/ 0 +
-
-/*priority.h*/ (sizeof _Priority_Major_bit_map) +
- (sizeof _Priority_Bit_map) +
-
-/*ratemon.h*/ (sizeof _Rate_monotonic_Information) +
-
-/*region.h*/ (sizeof _Region_Information) +
-
-/*regionmp.h*/ 0 +
-
-/*rtems.h*/ /* Not applicable */
-
-/*sem.h*/ (sizeof _Semaphore_Information) +
-
-/*semmp.h*/ 0 +
-
-/*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) +
-
-/*taskmp.h*/ 0 +
-
-/*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) +
- (sizeof _Thread_Allocated_fp) +
- (sizeof _Thread_Internal_information) +
- (sizeof _Thread_Idle) +
-
-/*threadmp.h*/ (sizeof _Thread_MP_Receive) +
- (sizeof _Thread_MP_Active_proxies) +
- (sizeof _Thread_MP_Inactive_proxies) +
-
-/*threadq.h*/ (sizeof _Thread_queue_Extract_table) +
-
-/*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) +
- (sizeof _CPU_Interrupt_stack_low) +
- (sizeof _CPU_Interrupt_stack_high);
-
-#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) +
-#ifndef 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);
-
-#ifndef NO_TABLE_MOVE
-uninitialized += (sizeof _CPU_Trap_Table_area);
-#endif
-
-#ifdef erc32
-uninitialized += (sizeof _ERC32_MEC_Timer_Control_Mirror);
-#endif
-
-
-#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) +
- (sizeof _Entry_points) +
-
-
-/*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/system.h b/testsuites/sptests/spsize/system.h
deleted file mode 100644
index 21abdab2f7..0000000000
--- a/testsuites/sptests/spsize/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Test_task(
- rtems_task_argument argument
-);
-
-int getint( void );
-
-/* configuration information */
-
-#define CONFIGURE_SPTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-/* end of include file */
diff --git a/testsuites/support/include/tmacros.h b/testsuites/support/include/tmacros.h
deleted file mode 100644
index ec2b5a0409..0000000000
--- a/testsuites/support/include/tmacros.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/* tmacros.h
- *
- * This include file contains macros which are useful in the RTEMS
- * test suites.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <bsp.h> /* includes <rtems.h> */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#define FOREVER 1 /* infinite loop */
-
-#ifdef TEST_INIT
-#define TEST_EXTERN
-#define CONFIGURE_INIT
-#else
-#define TEST_EXTERN extern
-#endif
-
-#define directive_failed( dirstat, failmsg ) \
- fatal_directive_status( dirstat, RTEMS_SUCCESSFUL, failmsg )
-
-#define fatal_directive_status( stat, desired, msg ) \
- do { \
- if ( (stat) != (desired) ) { \
- printf( "\n%s FAILED -- expected (%d) got (%d)\n", \
- (msg), (desired), (stat) ); \
- fflush(stdout); \
- exit( stat ); \
- } \
- } while ( 0 )
-
-#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 ); \
- fflush(stdout); \
- } while ( 0 )
-
-#define put_dot( c ) putchar( c ); fflush( stdout )
-
-#define new_line puts( "" )
-
-#define puts_nocr printf
-
-#ifdef RTEMS_TEST_NO_PAUSE
-#define rtems_test_pause() \
- do { \
- printf( "<pause>\n" ); fflush( stdout ); \
- } while ( 0 )
-
-#define rtems_test_pause_and_screen_number( _screen ) \
- do { \
- printf( "<pause - screen %d>\n", (_screen) ); fflush( stdout ); \
- } while ( 0 )
-#else
-#define rtems_test_pause() \
- do { \
- char buffer[ 80 ]; \
- printf( "<pause>" ); fflush( stdout ); \
- gets( buffer ); \
- puts( "" ); \
- } while ( 0 )
-
-#define rtems_test_pause_and_screen_number( _screen ) \
- do { \
- char buffer[ 80 ]; \
- printf( "<pause - screen %d>", (_screen) ); fflush( stdout ); \
- 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' ); \
-}
-
-#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; }
-
-#define task_number( tid ) \
- ( rtems_get_index( tid ) - \
- BSP_Configuration.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/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/include/timesys.h b/testsuites/tmtests/include/timesys.h
deleted file mode 100644
index 40337e9924..0000000000
--- a/testsuites/tmtests/include/timesys.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* timesys.h
- *
- * This header file contains the global variables for the Time
- * suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <tmacros.h>
-
-/*
- * How many times a particular operation is performed while timed.
- */
-
-#define OPERATION_COUNT 100
-#define IT_COUNT 100
-
-/* 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/system.h b/testsuites/tmtests/tm01/system.h
deleted file mode 100644
index f66403dcdc..0000000000
--- a/testsuites/tmtests/tm01/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm01/task1.c b/testsuites/tmtests/tm01/task1.c
deleted file mode 100644
index e3a6b49dad..0000000000
--- a/testsuites/tmtests/tm01/task1.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm01/tm01.doc b/testsuites/tmtests/tm01/tm01.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm01/tm01.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm02/system.h
deleted file mode 100644
index 2fd0f720d0..0000000000
--- a/testsuites/tmtests/tm02/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm02/task1.c b/testsuites/tmtests/tm02/task1.c
deleted file mode 100644
index cd7d73e78d..0000000000
--- a/testsuites/tmtests/tm02/task1.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm02/tm02.doc b/testsuites/tmtests/tm02/tm02.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm02/tm02.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm03/system.h
deleted file mode 100644
index 2fd0f720d0..0000000000
--- a/testsuites/tmtests/tm03/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm03/task1.c b/testsuites/tmtests/tm03/task1.c
deleted file mode 100644
index 0b6d8e6263..0000000000
--- a/testsuites/tmtests/tm03/task1.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm03/tm03.doc b/testsuites/tmtests/tm03/tm03.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm03/tm03.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm04/system.h
deleted file mode 100644
index a31ee198f7..0000000000
--- a/testsuites/tmtests/tm04/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm04/task1.c b/testsuites/tmtests/tm04/task1.c
deleted file mode 100644
index 2ba3932016..0000000000
--- a/testsuites/tmtests/tm04/task1.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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 496f3569e5..0000000000
--- a/testsuites/tmtests/tm04/tm04.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm05/system.h
deleted file mode 100644
index 2fd0f720d0..0000000000
--- a/testsuites/tmtests/tm05/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm05/task1.c b/testsuites/tmtests/tm05/task1.c
deleted file mode 100644
index 959bab006a..0000000000
--- a/testsuites/tmtests/tm05/task1.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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 496f3569e5..0000000000
--- a/testsuites/tmtests/tm05/tm05.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm06/system.h
deleted file mode 100644
index 2fd0f720d0..0000000000
--- a/testsuites/tmtests/tm06/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm06/task1.c b/testsuites/tmtests/tm06/task1.c
deleted file mode 100644
index 7b0a31efe9..0000000000
--- a/testsuites/tmtests/tm06/task1.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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 496f3569e5..0000000000
--- a/testsuites/tmtests/tm06/tm06.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm07/system.h
deleted file mode 100644
index 2fd0f720d0..0000000000
--- a/testsuites/tmtests/tm07/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm07/task1.c b/testsuites/tmtests/tm07/task1.c
deleted file mode 100644
index 09380a67c2..0000000000
--- a/testsuites/tmtests/tm07/task1.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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 496f3569e5..0000000000
--- a/testsuites/tmtests/tm07/tm07.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm08/system.h
deleted file mode 100644
index 2fd0f720d0..0000000000
--- a/testsuites/tmtests/tm08/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm08/task1.c b/testsuites/tmtests/tm08/task1.c
deleted file mode 100644
index e2527797ba..0000000000
--- a/testsuites/tmtests/tm08/task1.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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 496f3569e5..0000000000
--- a/testsuites/tmtests/tm08/tm08.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm09/system.h
deleted file mode 100644
index c973e40ffc..0000000000
--- a/testsuites/tmtests/tm09/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm09/task1.c b/testsuites/tmtests/tm09/task1.c
deleted file mode 100644
index 0df6233c6e..0000000000
--- a/testsuites/tmtests/tm09/task1.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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" );
-}
-
-rtems_task Test_task (
- rtems_task_argument argument
-)
-{
- Timer_initialize();
- rtems_message_queue_create(
- 1,
- OPERATION_COUNT,
- 16,
- 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 ***" );
- 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, (long (*)[4])buffer, 16 );
- 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, (long (*)[4])buffer, 16 );
- 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,
- 16
- );
- 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 496f3569e5..0000000000
--- a/testsuites/tmtests/tm09/tm09.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm10/system.h
deleted file mode 100644
index e406249fd2..0000000000
--- a/testsuites/tmtests/tm10/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm10/task1.c b/testsuites/tmtests/tm10/task1.c
deleted file mode 100644
index 9177ed8b12..0000000000
--- a/testsuites/tmtests/tm10/task1.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm10/tm10.doc b/testsuites/tmtests/tm10/tm10.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm10/tm10.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm11/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/testsuites/tmtests/tm11/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm11/task1.c b/testsuites/tmtests/tm11/task1.c
deleted file mode 100644
index e67852aca3..0000000000
--- a/testsuites/tmtests/tm11/task1.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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" );
-}
-
-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,
- 16,
- 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, (long (*)[4]) Buffer, 16 );
-}
-
-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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm11/tm11.doc b/testsuites/tmtests/tm11/tm11.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm11/tm11.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm12/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/testsuites/tmtests/tm12/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm12/task1.c b/testsuites/tmtests/tm12/task1.c
deleted file mode 100644
index d8a427c618..0000000000
--- a/testsuites/tmtests/tm12/task1.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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
-);
-
-
-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,
- 16,
- 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, (long (*)[4]) Buffer, 16 );
- 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 ***" );
- 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 496f3569e5..0000000000
--- a/testsuites/tmtests/tm12/tm12.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm13/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/testsuites/tmtests/tm13/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm13/task1.c b/testsuites/tmtests/tm13/task1.c
deleted file mode 100644
index 4071ded7a8..0000000000
--- a/testsuites/tmtests/tm13/task1.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 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,
- 16,
- 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, (long (*)[4]) Buffer, 16 );
-}
-
-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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm13/tm13.doc b/testsuites/tmtests/tm13/tm13.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm13/tm13.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm14/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/testsuites/tmtests/tm14/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm14/task1.c b/testsuites/tmtests/tm14/task1.c
deleted file mode 100644
index 30e1e8a38d..0000000000
--- a/testsuites/tmtests/tm14/task1.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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
-);
-
-
-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,
- 16,
- 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, (long (*)[4]) Buffer, 16 );
- 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 ***" );
- 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 496f3569e5..0000000000
--- a/testsuites/tmtests/tm14/tm14.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm15/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/testsuites/tmtests/tm15/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm15/task1.c b/testsuites/tmtests/tm15/task1.c
deleted file mode 100644
index c968f6d28c..0000000000
--- a/testsuites/tmtests/tm15/task1.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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 496f3569e5..0000000000
--- a/testsuites/tmtests/tm15/tm15.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm16/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/testsuites/tmtests/tm16/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm16/task1.c b/testsuites/tmtests/tm16/task1.c
deleted file mode 100644
index 93a65c17d9..0000000000
--- a/testsuites/tmtests/tm16/task1.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm16/tm16.doc b/testsuites/tmtests/tm16/tm16.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm16/tm16.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm17/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/testsuites/tmtests/tm17/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm17/task1.c b/testsuites/tmtests/tm17/task1.c
deleted file mode 100644
index 1ef373e61b..0000000000
--- a/testsuites/tmtests/tm17/task1.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm17/tm17.doc b/testsuites/tmtests/tm17/tm17.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm17/tm17.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm18/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/testsuites/tmtests/tm18/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm18/task1.c b/testsuites/tmtests/tm18/task1.c
deleted file mode 100644
index e86b889848..0000000000
--- a/testsuites/tmtests/tm18/task1.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm18/tm18.doc b/testsuites/tmtests/tm18/tm18.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm18/tm18.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm19/system.h
deleted file mode 100644
index 534584eed0..0000000000
--- a/testsuites/tmtests/tm19/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm19/task1.c b/testsuites/tmtests/tm19/task1.c
deleted file mode 100644
index 14bd4a9a9a..0000000000
--- a/testsuites/tmtests/tm19/task1.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm19/tm19.doc b/testsuites/tmtests/tm19/tm19.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm19/tm19.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm20/system.h
deleted file mode 100644
index a96f77a41d..0000000000
--- a/testsuites/tmtests/tm20/system.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-#define CONFIGURE_TEST_NEEDS_STUB_DRIVER
-
-#define CONFIGURE_MAXIMUM_PARTITIONS 1
-#define CONFIGURE_MAXIMUM_REGIONS 1
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm20/task1.c b/testsuites/tmtests/tm20/task1.c
deleted file mode 100644
index 6f2505c7aa..0000000000
--- a/testsuites/tmtests/tm20/task1.c
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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_device_major_number _STUB_major = 1;
-
-rtems_id Region_id;
-rtems_name Region_name;
-rtems_unsigned8 Region_area[ 2048 ] CPU_STRUCTURE_ALIGNMENT;
-
-rtems_id Partition_id;
-rtems_name Partition_name;
-rtems_unsigned8 Partition_area[ 2048 ] 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[ OPERATION_COUNT+1 ];
-
-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,
- 2048,
- 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++;
- }
-
- 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_semgent" );
-
- 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 ***" );
- 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 496f3569e5..0000000000
--- a/testsuites/tmtests/tm20/tm20.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm21/system.h
deleted file mode 100644
index 28b5a31469..0000000000
--- a/testsuites/tmtests/tm21/system.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm21/task1.c b/testsuites/tmtests/tm21/task1.c
deleted file mode 100644
index f3fd4e04e3..0000000000
--- a/testsuites/tmtests/tm21/task1.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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" );
-}
-
-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 */
- 16,
- 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm21/tm21.doc b/testsuites/tmtests/tm21/tm21.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm21/tm21.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm22/system.h
deleted file mode 100644
index 8884d8eaf6..0000000000
--- a/testsuites/tmtests/tm22/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm22/task1.c b/testsuites/tmtests/tm22/task1.c
deleted file mode 100644
index 817f3a71d6..0000000000
--- a/testsuites/tmtests/tm22/task1.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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
-);
-
-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,
- 16,
- 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,
- (long (*)[4]) Buffer,
- 16,
- &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,
- (long (*)[4]) Buffer,
- 16,
- &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 ***" );
- exit( 0 );
-}
-
-rtems_task Preempt_task(
- rtems_task_argument argument
-)
-{
- rtems_unsigned32 count;
-
- Timer_initialize();
- (void) rtems_message_queue_broadcast(
- Queue_id,
- (long (*)[4]) Buffer,
- 16,
- &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 496f3569e5..0000000000
--- a/testsuites/tmtests/tm22/tm22.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm23/system.h
deleted file mode 100644
index 246a14480d..0000000000
--- a/testsuites/tmtests/tm23/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm23/task1.c b/testsuites/tmtests/tm23/task1.c
deleted file mode 100644
index 70c59e93f5..0000000000
--- a/testsuites/tmtests/tm23/task1.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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<OPERATION_COUNT ; i++ )
- 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: inactive",
- end_time,
- OPERATION_COUNT,
- overhead,
- CALLING_OVERHEAD_TIMER_CANCEL
- );
-
- for ( Timer_initialize(), i=0 ; i<OPERATION_COUNT ; i++ )
- Timer_initialize();
- for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_timer_reset( Timer_id[ index ] );
- end_time = Read_timer();
-
- put_time(
- "rtems_timer_reset: inactive",
- end_time,
- OPERATION_COUNT,
- overhead,
- CALLING_OVERHEAD_TIMER_RESET
- );
-
- Timer_initialize();
- for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_timer_reset( Timer_id[ index ] );
- end_time = Read_timer();
-
- put_time(
- "rtems_timer_reset: active",
- end_time,
- OPERATION_COUNT,
- overhead,
- CALLING_OVERHEAD_TIMER_RESET
- );
-
- for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_timer_reset( Timer_id[ index ] );
-
- build_time( &time_of_day, 12, 31, 1988, 9, 0, 0, 0 );
-
- status = rtems_clock_set( &time_of_day );
- directive_failed( status, "rtems_clock_set" );
-
- time_of_day.year = 1989;
-
- Timer_initialize();
- for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_timer_fire_when(
- Timer_id[ index ], &time_of_day, null_delay, NULL );
- end_time = Read_timer();
-
- put_time(
- "rtems_timer_fire_when: inactive",
- end_time,
- OPERATION_COUNT,
- overhead,
- CALLING_OVERHEAD_TIMER_FIRE_WHEN
- );
-
- Timer_initialize();
- for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_timer_fire_when(
- Timer_id[ index ], &time_of_day, null_delay, NULL );
- end_time = Read_timer();
-
- put_time(
- "rtems_timer_fire_when: active",
- end_time,
- OPERATION_COUNT,
- overhead,
- CALLING_OVERHEAD_TIMER_FIRE_WHEN
- );
-
- Timer_initialize();
- for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_timer_delete( Timer_id[ index ] );
- end_time = Read_timer();
-
- put_time(
- "rtems_timer_delete: active",
- end_time,
- OPERATION_COUNT,
- overhead,
- CALLING_OVERHEAD_TIMER_DELETE
- );
-
- Timer_initialize();
- for ( index=1 ; index <= OPERATION_COUNT ; index++ ) {
- status = rtems_timer_create( index, &Timer_id[ index ] );
- directive_failed( status, "rtems_timer_create" );
-
- status = rtems_timer_fire_after( Timer_id[ index ], 500, null_delay, NULL );
- directive_failed( status, "rtems_timer_fire_after" );
-
- status = rtems_timer_cancel( Timer_id[ index ] );
- directive_failed( status, "rtems_timer_cancel" );
- }
-
- Timer_initialize();
- for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_timer_delete( Timer_id[ index ] );
- end_time = Read_timer();
-
- put_time(
- "rtems_timer_delete: inactive",
- end_time,
- OPERATION_COUNT,
- overhead,
- CALLING_OVERHEAD_TIMER_DELETE
- );
-
- Timer_initialize();
- (void) rtems_task_wake_when( &time_of_day );
-}
-
-rtems_task Middle_tasks(
- rtems_task_argument argument
-)
-{
- (void) rtems_task_wake_when( &time_of_day );
-}
-
-rtems_task Low_task(
- rtems_task_argument argument
-)
-{
- end_time = Read_timer();
-
- put_time(
- "rtems_task_wake_when",
- end_time,
- OPERATION_COUNT,
- 0,
- CALLING_OVERHEAD_TASK_WAKE_WHEN
- );
-
- puts( "*** END OF TEST 23 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm23/tm23.doc b/testsuites/tmtests/tm23/tm23.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm23/tm23.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/tm24/system.h b/testsuites/tmtests/tm24/system.h
deleted file mode 100644
index 51fbb131b8..0000000000
--- a/testsuites/tmtests/tm24/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm24/task1.c b/testsuites/tmtests/tm24/task1.c
deleted file mode 100644
index a4e78f126a..0000000000
--- a/testsuites/tmtests/tm24/task1.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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 496f3569e5..0000000000
--- a/testsuites/tmtests/tm24/tm24.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm25/system.h
deleted file mode 100644
index a31ee198f7..0000000000
--- a/testsuites/tmtests/tm25/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm25/task1.c b/testsuites/tmtests/tm25/task1.c
deleted file mode 100644
index 6d79ed46a0..0000000000
--- a/testsuites/tmtests/tm25/task1.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm25/tm25.doc b/testsuites/tmtests/tm25/tm25.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm25/tm25.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/fptest.h b/testsuites/tmtests/tm26/fptest.h
deleted file mode 100644
index 551aa0989e..0000000000
--- a/testsuites/tmtests/tm26/fptest.h
+++ /dev/null
@@ -1,165 +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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <stdio.h>
-
-#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 a31ee198f7..0000000000
--- a/testsuites/tmtests/tm26/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm26/task1.c b/testsuites/tmtests/tm26/task1.c
deleted file mode 100644
index 4eb40b09d7..0000000000
--- a/testsuites/tmtests/tm26/task1.c
+++ /dev/null
@@ -1,580 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 <rtems.h>
-#include "system.h"
-#include "fptest.h"
-#include <coverhd.h>
-#include <tmacros.h>
-#include <timesys.h>
-
-
-/* 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();
- _Context_Restore_fp( &_Thread_Executing->fp_context );
- _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();
- _Context_Save_fp( &executing->fp_context );
- _Context_Restore_fp( &_Thread_Executing->fp_context );
- _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();
- _Context_Save_fp( &executing->fp_context );
- _Context_Restore_fp( &_Thread_Executing->fp_context );
- _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();
- _Context_Save_fp( &executing->fp_context );
- _Context_Restore_fp( &_Thread_Executing->fp_context );
- _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 );
- 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
- );
-
- 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
- );
-
- 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 ***" );
- exit( 0 );
-}
-
diff --git a/testsuites/tmtests/tm26/tm26.doc b/testsuites/tmtests/tm26/tm26.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm26/tm26.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm27/system.h
deleted file mode 100644
index 51fbb131b8..0000000000
--- a/testsuites/tmtests/tm27/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 111
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm27/task1.c b/testsuites/tmtests/tm27/task1.c
deleted file mode 100644
index a852979986..0000000000
--- a/testsuites/tmtests/tm27/task1.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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
-#include "system.h"
-
-#include <bsp.h>
-
-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_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" );
-
- 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,
- 0
- );
-
- put_time(
- "interrupt exit overhead: returns to interrupted task",
- Interrupt_return_time,
- 1,
- 0,
- 0
- );
-
- /*
- * 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 ***" );
- 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,
- 0
- );
-
- 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 496f3569e5..0000000000
--- a/testsuites/tmtests/tm27/tm27.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm28/system.h
deleted file mode 100644
index dbadf8b14c..0000000000
--- a/testsuites/tmtests/tm28/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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 <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm28/task1.c b/testsuites/tmtests/tm28/task1.c
deleted file mode 100644
index aa5df73865..0000000000
--- a/testsuites/tmtests/tm28/task1.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm28/tm28.doc b/testsuites/tmtests/tm28/tm28.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm28/tm28.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tm29/system.h
deleted file mode 100644
index c2b1355153..0000000000
--- a/testsuites/tmtests/tm29/system.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_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
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tm29/task1.c b/testsuites/tmtests/tm29/task1.c
deleted file mode 100644
index 779a0df49b..0000000000
--- a/testsuites/tmtests/tm29/task1.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tm29/tm29.doc b/testsuites/tmtests/tm29/tm29.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tm29/tm29.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/system.h b/testsuites/tmtests/tmck/system.h
deleted file mode 100644
index 43d3be0fb5..0000000000
--- a/testsuites/tmtests/tmck/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-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-#include <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 2
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tmck/task1.c b/testsuites/tmtests/tmck/task1.c
deleted file mode 100644
index bee3bf5f5b..0000000000
--- a/testsuites/tmtests/tmck/task1.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 ***" );
- 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) || defined(go32)
- index--;
- continue;
-#else
- 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 b8997c7b35..0000000000
--- a/testsuites/tmtests/tmck/tmck.doc
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/dumrtems.h b/testsuites/tmtests/tmoverhd/dumrtems.h
deleted file mode 100644
index 7eee650ebc..0000000000
--- a/testsuites/tmtests/tmoverhd/dumrtems.h
+++ /dev/null
@@ -1,255 +0,0 @@
-/* dumrtems.h
- *
- * This include file contains phony macros to map
- * executive calls to Empty_directive().
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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 cef38f2e73..0000000000
--- a/testsuites/tmtests/tmoverhd/empty.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms 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 ea369d97cb..0000000000
--- a/testsuites/tmtests/tmoverhd/system.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* system.h
- *
- * This include file is used by all tests in the Time Suite.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-
-#include <coverhd.h>
-#include <tmacros.h>
-
-/* 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 <timesys.h>
-
-/* configuration information */
-
-#define CONFIGURE_TMTEST
-
-#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 2
-#define CONFIGURE_TICKS_PER_TIMESLICE 0
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#include <confdefs.h>
-
-/* end of include file */
diff --git a/testsuites/tmtests/tmoverhd/testtask.c b/testsuites/tmtests/tmoverhd/testtask.c
deleted file mode 100644
index 96413ac722..0000000000
--- a/testsuites/tmtests/tmoverhd/testtask.c
+++ /dev/null
@@ -1,1279 +0,0 @@
-/*
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- * Copyright assigned to U.S. Government, 1994.
- *
- * The license and distribution 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( &BSP_Configuration, &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 ***" );
-
- exit( 0 );
-}
diff --git a/testsuites/tmtests/tmoverhd/tmoverhd.doc b/testsuites/tmtests/tmoverhd/tmoverhd.doc
deleted file mode 100644
index 496f3569e5..0000000000
--- a/testsuites/tmtests/tmoverhd/tmoverhd.doc
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id$
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and 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/tools/build/Makefile.in b/tools/build/Makefile.in
deleted file mode 100644
index ad819e8214..0000000000
--- a/tools/build/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=os scripts src
diff --git a/tools/build/README b/tools/build/README
deleted file mode 100644
index 0738a5830e..0000000000
--- a/tools/build/README
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# $Id$
-#
-
-Misc. support tools for RTEMS workspaces.
-More will be added later as they are converted from Teamware
-to CVS.
-
-install-if-change
- Smart install script that also can append suffixes as it
- installs (suffixes used for debug and profile variants).
- Requires bash or ksh.
-
-rcs-clean
- deletes all files from the current directory that can be
- re-created from RCS. Careful to not delete locked files.
- May be used by 'gmake clobber'
-
-lock-directory
-unlock-directory
- traverse a directory structure making it unwritable.
- Useful to keep people from accidentally overwriting
- "released" trees if they get confused about which
- module they have loaded.
diff --git a/tools/build/binpatch.c b/tools/build/binpatch.c
deleted file mode 100644
index ab0900702a..0000000000
--- a/tools/build/binpatch.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * $Id$
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-
-/*
- * This function will patch binary file
- */
-
-
-static char buf[512];
-
-static void
-usage(void)
-{
- printf("usage: binpatch [-h] <ofile> <ifile> <reloc> <off> <byte0> "
- "[<byte1> [<byte2> [<byte3>]]]\n");
- printf("this function patches binary file at specified offset with\n");
- printf("up to 4 bytes provided on command line \n");
- printf("-h - prints this message\n\n");
- printf("<ofile> - output file\n");
- printf("<ifile> - input ifile\n");
- printf("<reloc> - relocation address of image\n");
- printf("<off> - offset of patch, offset in file is at off - reloc\n");
- printf("<byte0> - byte 0 of patch\n");
- printf("<byte1> - byte 1 of patch\n");
- printf("<byte2> - byte 1 of patch\n");
- printf("<byte3> - byte 1 of patch\n");
-
- return;
-}
-
-int
-main(int argc, char **argv)
-{
- int c;
- FILE *ofp, *ifp;
- char patch[4], *end;
- int patchLen, tmp, i, off, cnt, patched, len, reloc;
-
-
- /* parse command line options */
- while ((c = getopt(argc, argv, "h")) >= 0)
- {
- switch (c)
- {
- case 'h':
- usage();
- return 0;
- default:
- usage();
- return 1;
- }
- }
-
- if(argc < 6)
- {
- usage();
- return 1;
- }
-
- /* Let us get offset in file */
- reloc = strtol(argv[3], &end, 0);
- if(end == argv[3] || off < 0)
- {
- fprintf(stderr, "bad reloc value %s\n", argv[3]);
- return 1;
- }
-
- off = strtol(argv[4], &end, 0);
- if(end == argv[4] || off < 0 || off < reloc)
- {
- fprintf(stderr, "bad offset value %s\n", argv[4]);
- return 1;
- }
-
- off -= reloc;
-
- /* Let us get patch */
- patchLen = argc - 5;
-
- for(i=0; i<patchLen; i++)
- {
- tmp = strtol(argv[5+i], &end, 0);
-
- if(end == argv[4+i] || tmp < 0 || tmp > 0xff)
- {
- fprintf(stderr, "bad byte value %s\n", argv[5+i]);
- return 1;
- }
- patch[i] = tmp;
- }
-
- ifp = fopen(argv[2], "r");
- if(ifp == NULL)
- {
- fprintf(stderr, "unable to open file %s\n", argv[2]);
- return 1;
- }
-
- ofp = fopen(argv[1], "w");
- if(ofp == NULL)
- {
- fprintf(stderr, "unable to open file %s\n", argv[1]);
- return 1;
- }
-
- cnt = 0;
- patched = 0;
- for(;;)
- {
- len = fread(buf, 1, sizeof(buf), ifp);
-
- if(len == 0)
- {
- break;
- }
-
- if(cnt <= off && (cnt + len) > off)
- {
- /* Perform patch */
- for(i=0; i<patchLen && (off+i)<(cnt+len); i++)
- {
- buf[off-cnt+i] = patch[i];
- }
- patched = 1;
- }
- else if(cnt > off && cnt < (off + patchLen))
- {
- /* Perform patch */
- for(i=cnt-off; i<patchLen; i++)
- {
- buf[off-cnt+i] = patch[i];
- }
- patched = 1;
- }
-
- fwrite(buf, 1, len, ofp);
-
- cnt += len;
- }
-
- fclose(ifp);
- fclose(ofp);
-
- if(!patched)
- {
- fprintf(stderr, "warning: offset is beyond input file length\n");
- fprintf(stderr, " no patch is performed\n");
- }
-
- return 0;
-}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/build/cklength.c b/tools/build/cklength.c
deleted file mode 100644
index 624bf25e70..0000000000
--- a/tools/build/cklength.c
+++ /dev/null
@@ -1,377 +0,0 @@
-/*
- * cklength - check the length of lines in a file
- *
- * This program check to see if the files passed to it on the command line
- * contain a line which exceeds the maximum allowable length. The default
- * maximum line length is 80.
- *
- * usage: cklength [ -v ] [ arg ... ] files...
- * -l length -- maximum line length
- * -v -- verbose
- *
- * $Id$
- */
-
-#define GETOPTARGS "l:nNv"
-
-char *USAGE = "\
-usage: cklength [ -v ] [ arg ... ] files... \n\
- -l length -- maximum line length\n\
- -n -- report line numbers for offending lines\n\
- -N -- report line numbers and length for offending lines\n\
- -v -- verbose\n\
-\n\
-Print the name of files which have at least 1 line which exceeds the\n\
-maximum line length. The default maximum line length is 80.\n\
-";
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <memory.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-
-#define BUFFER_SIZE 512
-
-#define SUCCESS 0
-#define FAILURE -1
-#define Failed(x) (((int) (x)) == FAILURE)
-#define TRUE 1
-#define FALSE 0
-#define STREQ(a,b) (strcmp(a,b) == 0)
-#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
-
-/*
- * Definitions for unsigned "ints"; especially for use in data structures
- * that will be shared among (potentially) different cpu's (we punt on
- * byte ordering problems tho)
- */
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned long u32;
-
-/*
- * vars controlled by command line options
- */
-
-int verbose = FALSE; /* be verbose */
-int report_line_numbers = FALSE; /* report line numbers of offenders */
-int report_line_length = FALSE; /* report line length of offenders */
-
-int line_length = 80; /* maximum allowable line length */
-
-extern char *optarg; /* getopt(3) control vars */
-extern int optind, opterr;
-
-char *progname; /* for error() */
-
-int process(char *arg);
-void error(int errn, ...);
-long getparm(char *s, long min, long max, char *msg);
-
-#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define ERR_FATAL (ERR_ERRNO / 2) /* fatal error ; no return */
-#define ERR_ABORT (ERR_ERRNO / 4) /* fatal error ; abort */
-#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
-
-#define stol(p) strtol(p, (char **) NULL, 0)
-int Open(), Read(), Write();
-
-int main(
- int argc,
- char **argv
-)
-{
- register int c;
- int showusage = FALSE; /* usage error? */
- int rc = 0;
-
- /*
- * figure out invocation leaf-name
- */
-
- if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
- progname = argv[0];
- else
- progname++;
-
- argv[0] = progname; /* for getopt err reporting */
-
- /*
- * Check options and arguments.
- */
-
- opterr = 0; /* we'll report all errors */
- while ((c = getopt(argc, argv, GETOPTARGS)) != EOF)
- switch (c)
- {
- case 'l': /* line length */
- line_length = atoi( optarg );
- if ( line_length < 0 || line_length > BUFFER_SIZE )
- error(ERR_FATAL, "(%d) is illegal line length\n",line_length);
- break;
-
- case 'n': /* toggle report_line_numbers */
- report_line_numbers = ! report_line_numbers;
- break;
-
- case 'N': /* toggle both reports */
- report_line_numbers = ! report_line_numbers;
- report_line_length = ! report_line_length;
- break;
-
- case 'v': /* toggle verbose */
- verbose = ! verbose;
- break;
-
- case '?':
- showusage = TRUE;
- }
-
- if (showusage)
- {
- (void) fprintf(stderr, "%s", USAGE);
- exit(1);
- }
-
- /*
- * traverse and process the arguments
- */
-
- for ( ; argv[optind]; optind++)
- if (Failed(process(argv[optind])))
- rc = FAILURE;
-
- return rc;
-}
-
-
-/*
- * process(arg)
- */
-
-int
-process(char *arg)
-{
- FILE *in;
- char *bptr;
- char buffer[ BUFFER_SIZE ];
- int line_number;
- int length;
- int count;
- int rc = SUCCESS; /* succeed by default */
-
- in = fopen( arg, "r" );
- if (!in)
- error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
-
- count = 0;
-
- for ( line_number=1 ; ; line_number++ ) {
- bptr = fgets( buffer, BUFFER_SIZE, in );
- if (!bptr)
- break;
-
- /*
- * Don't count the carriage return.
- */
-
- length = strlen( buffer ) - 1;
-
- if ( length <= line_length )
- continue;
-
- if ( count == 0 ) {
- fprintf( stderr, "%s\n", arg );
- if ( !report_line_numbers )
- break;
- }
-
- if ( verbose )
- fprintf( stderr, "TOO LONG:%d: %s\n", line_number, buffer );
-
- if ( report_line_numbers ) {
- if ( report_line_length )
- fprintf( stderr, "%d: %d\n" , line_number, length );
- else
- fprintf( stderr, "%d\n" , line_number );
- }
-
- count++;
-
- }
-
- fclose( in );
- return rc;
-}
-
-/*
- * error(errn, arglist)
- * report an error to stderr using printf(3) conventions.
- * Any output is preceded by '<progname>: '
- *
- * Uses ERR_FATAL bit to request exit(errn)
- * ERR_ABORT to request abort()
- * ERR_ERRNO to indicate use of errno instead of argument.
- *
- * If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
- * associated error message is appended to the output.
- */
-
-/*VARARGS*/
-
-void
-error(int error_flag, ...)
-{
- va_list arglist;
- register char *format;
- int local_errno;
-
- extern int errno;
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- local_errno = error_flag & ~ERR_MASK;
- if (error_flag & ERR_ERRNO) /* use errno? */
- local_errno = errno;
-
- va_start(arglist, error_flag);
- format = va_arg(arglist, char *);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, format, arglist);
- va_end(arglist);
-
- if (local_errno)
- (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
-
- (void) fflush(stderr);
-
- if (error_flag & (ERR_FATAL | ERR_ABORT))
- {
- if (error_flag & ERR_FATAL)
- {
- error(0, "fatal error, exiting");
- exit(local_errno ? local_errno : 1);
- }
- else
- {
- error(0, "fatal error, aborting");
- abort();
- }
- }
-}
-
-long
-getparm(char *s,
- long min,
- long max,
- char *msg)
-{
- long val;
-
- if ( ! strchr("0123456789-", *s))
- {
- error(ERR_FATAL, "'%s' is not a number", s);
- return min;
- }
-
- val = strtol(s, (char **) NULL, 0);
- if ((val < min) || (val > max))
- {
- if (min == max)
- error(ERR_FATAL, "%s can only be %ld", s, min);
- else
- error(ERR_FATAL, "%s must be between %ld and %ld", msg, min, max);
- }
-
- return val;
-}
-
-
-/*
- * Open()
- * Perform open(2), returning the file descriptor. Prints
- * error message if open fails.
- */
-
-int
-Open(char *file,
- int oflag,
- int mode)
-{
- int O_fd;
-
- if (Failed(O_fd = open(file, oflag, mode)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "open('%s', 0x%x, 0%o) failed", file, oflag, mode
- );
-
- return O_fd;
-}
-
-/*
- * Read()
- * Perform read(2); prints error message if fails.
- */
-
-int
-Read(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = read(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "read(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
-
-/*
- * Write()
- * Perform write(2); prints error message if fails.
- */
-
-int
-Write(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = write(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "write(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
diff --git a/tools/build/eolstrip.c b/tools/build/eolstrip.c
deleted file mode 100644
index c944ae6663..0000000000
--- a/tools/build/eolstrip.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * eolstrip - strip white space from end of lines
- *
- * This program strips the white space from the end of every line in the
- * specified program.
- *
- * usage: eolstrip [ -v ] [ arg ... ] files...
- * -v -- verbose
- *
- * $Id$
- */
-
-#define GETOPTARGS "vt"
-
-char *USAGE = "\
-usage: cklength [ -v ] [ arg ... ] files... \n\
- -v -- verbose\n\
- -t -- test only .. DO NOT OVERWRITE FILE!!!\n\
-\n\
-Strip the white space from the end of every line on the list of files.\n\
-";
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <memory.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-
-#define BUFFER_SIZE 2048
-#define MAX_PATH 2048
-
-#define SUCCESS 0
-#define FAILURE -1
-#define Failed(x) (((int) (x)) == FAILURE)
-#define TRUE 1
-#define FALSE 0
-#define STREQ(a,b) (strcmp(a,b) == 0)
-#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
-
-/*
- * Definitions for unsigned "ints"; especially for use in data structures
- * that will be shared among (potentially) different cpu's (we punt on
- * byte ordering problems tho)
- */
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned long u32;
-
-/*
- * vars controlled by command line options
- */
-
-int verbose = FALSE; /* be verbose */
-int test_only = FALSE; /* test only */
-
-extern char *optarg; /* getopt(3) control vars */
-extern int optind, opterr;
-
-char *progname; /* for error() */
-
-int process(char *arg);
-void error(int errn, ...);
-long getparm(char *s, long min, long max, char *msg);
-
-#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define ERR_FATAL (ERR_ERRNO / 2) /* fatal error ; no return */
-#define ERR_ABORT (ERR_ERRNO / 4) /* fatal error ; abort */
-#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
-
-#define stol(p) strtol(p, (char **) NULL, 0)
-int Open(), Read(), Write();
-
-int main(
- int argc,
- char **argv
-)
-{
- register int c;
- int showusage = FALSE; /* usage error? */
- int rc = 0;
-
- /*
- * figure out invocation leaf-name
- */
-
- if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
- progname = argv[0];
- else
- progname++;
-
- argv[0] = progname; /* for getopt err reporting */
-
- /*
- * Check options and arguments.
- */
-
- opterr = 0; /* we'll report all errors */
- while ((c = getopt(argc, argv, GETOPTARGS)) != EOF)
- switch (c)
- {
- case 't': /* toggle test only mode */
- test_only = ! test_only;
- break;
-
- case 'v': /* toggle verbose */
- verbose = ! verbose;
- break;
-
- case '?':
- showusage = TRUE;
- }
-
- if (showusage)
- {
- (void) fprintf(stderr, "%s", USAGE);
- exit(1);
- }
-
- /*
- * traverse and process the arguments
- */
-
- for ( ; argv[optind]; optind++)
- if (Failed(process(argv[optind])))
- rc = FAILURE;
-
- return rc;
-}
-
-
-/*
- * process(arg)
- */
-
-int
-process(char *arg)
-{
- FILE *in;
- FILE *out = (FILE *) 0;
- char outname[ MAX_PATH ];
- char *bptr;
- char buffer[ BUFFER_SIZE ];
- int length;
- int line_number;
- int rc = SUCCESS; /* succeed by default */
-
- in = fopen( arg, "r" );
- if (!in)
- error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
-
- if ( !test_only ) {
- sprintf( outname, "%s.eoltmp", arg );
-
- out = fopen( outname, "w" );
- if (!out)
- error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
- }
-
- if ( verbose )
- fprintf( stderr, "Processing %s\n", arg );
-
- for ( line_number=1 ; ; line_number++ ) {
- bptr = fgets( buffer, BUFFER_SIZE, in );
- if (!bptr)
- break;
-
- /*
- * Don't count the carriage return.
- */
-
- length = strlen( buffer ) - 1;
-
- if ( buffer[ length ] != '\n' )
- error(ERR_ERRNO|ERR_FATAL, "Line %d too long in %s\n", line_number, arg);
-
- while ( isspace( (int) buffer[ length ] ) )
- buffer[ length-- ] = '\0';
-
- if ( test_only ) {
- fprintf( stderr, "%s\n", arg );
- break;
- }
-
- fprintf( out, "%s\n", buffer );
- }
-
- fclose( in );
- if ( !test_only ) {
- fclose( out );
- rename( outname, arg );
- }
- return rc;
-}
-
-/*
- * error(errn, arglist)
- * report an error to stderr using printf(3) conventions.
- * Any output is preceded by '<progname>: '
- *
- * Uses ERR_FATAL bit to request exit(errn)
- * ERR_ABORT to request abort()
- * ERR_ERRNO to indicate use of errno instead of argument.
- *
- * If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
- * associated error message is appended to the output.
- */
-
-/*VARARGS*/
-
-void
-error(int error_flag, ...)
-{
- va_list arglist;
- register char *format;
- int local_errno;
-
- extern int errno;
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- local_errno = error_flag & ~ERR_MASK;
- if (error_flag & ERR_ERRNO) /* use errno? */
- local_errno = errno;
-
- va_start(arglist, error_flag);
- format = va_arg(arglist, char *);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, format, arglist);
- va_end(arglist);
-
- if (local_errno)
- (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
- else
- (void) fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (ERR_FATAL | ERR_ABORT))
- {
- if (error_flag & ERR_FATAL)
- {
- error(0, "fatal error, exiting");
- exit(local_errno ? local_errno : 1);
- }
- else
- {
- error(0, "fatal error, aborting");
- abort();
- }
- }
-}
-
-long
-getparm(char *s,
- long min,
- long max,
- char *msg)
-{
- long val;
-
- if ( ! strchr("0123456789-", *s))
- {
- error(ERR_FATAL, "'%s' is not a number", s);
- return min;
- }
-
- val = strtol(s, (char **) NULL, 0);
- if ((val < min) || (val > max))
- {
- if (min == max)
- error(ERR_FATAL, "%s can only be %ld", s, min);
- else
- error(ERR_FATAL, "%s must be between %ld and %ld", msg, min, max);
- }
-
- return val;
-}
-
-
-/*
- * Open()
- * Perform open(2), returning the file descriptor. Prints
- * error message if open fails.
- */
-
-int
-Open(char *file,
- int oflag,
- int mode)
-{
- int O_fd;
-
- if (Failed(O_fd = open(file, oflag, mode)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "open('%s', 0x%x, 0%o) failed", file, oflag, mode
- );
-
- return O_fd;
-}
-
-/*
- * Read()
- * Perform read(2); prints error message if fails.
- */
-
-int
-Read(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = read(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "read(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
-
-/*
- * Write()
- * Perform write(2); prints error message if fails.
- */
-
-int
-Write(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = write(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "write(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
diff --git a/tools/build/install-if-change.in b/tools/build/install-if-change.in
deleted file mode 100644
index b2f3cb04bb..0000000000
--- a/tools/build/install-if-change.in
+++ /dev/null
@@ -1,142 +0,0 @@
-#!@KSH@ -p
-#
-# Either bash or ksh will be ok for this; requires (( )) arithmetic
-# (-p above just says to not parse $ENV file; makes it faster for
-# those of us who set $ENV)
-#
-# install files if they have changed by running 'cmp', then 'install'
-# as necessary.
-#
-# Optionally, can append a suffix before last existing suffix (if any)
-#
-# NOTE
-# We avoid using typical install(1M) programs since they have
-# large variability across systems and we also need to support ou
-# -V option.
-# So we just copy and chmod by hand.
-#
-# $Id$
-#
-
-progname=`basename $0`
-#progname=${0##*/} # fast basename hack for ksh, bash
-
-USAGE=\
-"usage: $progname [ -vmV ] file [ file ... ] dest-directory-or-file
- -v -- verbose
- -V suffix -- suffix to append to targets (before any . suffix)
- eg: -V _g would change 'foo' to 'foo_g' and
- 'libfoo.a' to 'libfoo_g.a'
- -m mode -- mode for new file(s)"
-
-fatal() {
- if [ "$1" ]
- then
- echo $* >&2
- fi
- echo "$USAGE" 1>&2
- exit 1
-}
-
-#
-# process the options
-#
-
-verbose=""
-suffix=""
-mode=""
-
-while getopts vm:V: OPT
-do
- case "$OPT" in
- v)
- verbose="yes";;
- V)
- eval suffix=$OPTARG;;
- m)
- mode="$OPTARG";;
- *)
- fatal
- esac
-done
-
-shiftcount=`expr $OPTIND - 1`
-shift $shiftcount
-
-args=$*
-
-#
-# Separate source file(s) from dest directory or file
-#
-
-files=""
-dest=""
-for d in $args
-do
- files="$files $dest"
- dest=$d
-done
-
-if [ ! "$files" ] || [ ! "$dest" ]
-then
- fatal "missing files or invalid destination"
-fi
-
-#
-# Process the arguments
-#
-
-targets=""
-for f in $files
-do
- # leaf=`basename $f`
- leaf=${f##*/} # fast basename hack for ksh, bash
-
- target=$dest
- if [ -d $dest ]
- then
- # if we were given a suffix, then add it as appropriate
- if [ "$suffix" ]
- then
- case $f in
- *.*)
- # leaf=`echo $leaf |
- # /bin/sed "s/\([~\.]*\)\.\(.*\)$/\1$suffix.\2/"`
- # ksh,bash hack for above sed script
- leaf=${leaf%%.*}$suffix.${leaf#*.}
-
- [ "$verbose" = "yes" ] &&
- echo "$progname: $f will be installed as $leaf"
- ;;
- *)
- leaf=$leaf$suffix;;
- esac
- fi
- target=$target/$leaf
- fi
-
- [ ! -r $f ] && fatal "can not read $f"
-
- if cmp -s $f $target
- then
- [ "$verbose" = "yes" ] && echo "'$f' not newer than '$target'"
- else
- [ "$verbose" = "yes" ] && echo "rm -f $target"
- rm -f $target
- echo "cp -p $f $target"
- cp -p $f $target || exit 1
- targets="$targets $target" # keep list for chmod below
- fi
-done
-
-if [ "$mode" -a "$targets" ]
-then
- [ "$verbose" = "yes" ] && echo "chmod $mode $targets"
- chmod $mode $targets
-fi
-
-exit 0
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
diff --git a/tools/build/lock-directory.in b/tools/build/lock-directory.in
deleted file mode 100644
index 1c205cdec0..0000000000
--- a/tools/build/lock-directory.in
+++ /dev/null
@@ -1,43 +0,0 @@
-#!@KSH@
-#
-# $Id$
-#
-# Make a directory write protected
-# Used to write protect the install point after a build
-# to prevent inadvertant overwriting.
-#
-
-# is a particular command available on this machine?
-#
-cmd_avail()
-{
- set -- `type $1 2>&1`
- if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ]
- then
- return 1
- else
- return 0
- fi
-}
-
-lock_directory() {
- l_dir=$1/. # get any symlink out of the way using '.'
- if [ -d $l_dir ]
- then
- find $l_dir -type d -perm -0200 -print | $XARGS chmod -w
- fi
-}
-
-# Use gnu xargs if available; faster, more reliable in general
-XARGS=xargs
-cmd_avail gxargs && XARGS=gxargs
-
-for dir
-do
- lock_directory $dir
-done
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
-
diff --git a/tools/build/os/Makefile.in b/tools/build/os/Makefile.in
deleted file mode 100644
index d540e58fa0..0000000000
--- a/tools/build/os/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=$(wildcard $(RTEMS_HOST))
diff --git a/tools/build/os/msdos/Makefile.in b/tools/build/os/msdos/Makefile.in
deleted file mode 100644
index 23a840d33a..0000000000
--- a/tools/build/os/msdos/Makefile.in
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-DESTDIR=$(PROJECT_RELEASE)/build-tools
-
-INSTALLED=$(DESTDIR)/ifc.exe \
- $(DESTDIR)/cklength.exe \
- $(DESTDIR)/fixtimer.exe
-
-all: $(DESTDIR) $(PGMS) install
-
-$(DESTDIR):
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-install: $(INSTALLED)
-
-# Install the programs
-$(DESTDIR)/ifc.exe: ifc_exe.uue
- uudecode <ifc_exe.uue
- mv ifc.exe $(DESTDIR)/ifc.exe
-
-$(DESTDIR)/cklength.exe: cklength.uue
- uudecode <cklength.uue
- mv cklength.exe $(DESTDIR)/cklength.exe
-
-$(DESTDIR)/fixtimer.exe: fixtimer.uue
- uudecode <fixtimer.uue
- mv fixtimer.exe $(DESTDIR)/fixtimer.exe
-
diff --git a/tools/build/os/msdos/README b/tools/build/os/msdos/README
deleted file mode 100644
index af3b0dfb31..0000000000
--- a/tools/build/os/msdos/README
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# $Id$
-#
-
-ifc is an MS-DOS executable which is equivalent to the program
-install-if-change. It was compiled using Borland C 2.00.
-
-cklength is a precompiled version of the program cklength.c from
-the main source tree.
-
-fixtimer is a program to restore the clock if the program does not
-exit cleanly.
diff --git a/tools/build/os/msdos/cklength.uue b/tools/build/os/msdos/cklength.uue
deleted file mode 100644
index fd8052cd9a..0000000000
--- a/tools/build/os/msdos/cklength.uue
+++ /dev/null
@@ -1,286 +0,0 @@
-#
-# $Id$
-#
-begin 664 cklength
-M?T5,1@$" 0 " ( ! $,% #0 "T8 T "
-M!0 H !H %P 8 T $ - "@ H 4 P
-M -0 !$ ! ! ! 7
-M2P %TL % $ $ !=, (73 &\ %? < 0
-M @ %U A=0 (@ !P O=7-R+VQI8B]L9"YS
-M;RXQ $, !6 20 #P
-M #@ $4 /0 !P !# &@
-M A 30 #\ *0 $X !" D
-M $@ W $8 )@ "
-M ! %( 4P Z *@ 00
-M $H 'P $L !5 3P L .P %0 H
-M-@ #$ P 40
-M
-M
-M G
-M '0 C ; N
-M "( -0 E #D R - !X
-M "T ,P !$ *P
-M ^ "\ 3 % !'
-M 0#4 , $ $ Z # "
-M ! U0 P P 0BT , 0 $*W #
-M % !"S P !@ 0P4 , < $32
-M # ( !$^ P "0 1/L , H $3
-M] # + !% P # A=, , T
-M (74 # . "%]@ P #P ACP , !
-M (9" # 1 P $@ ,
-M !, # 4 P %0
-M , !8 # 7 P &
-M , !D ! (8. 2 " !$_0 $0 "P !8
-M 0P4 =!( < = (8U 2 (@ "&$0 $@
-M "< 1/L !$ H U (8O 2 / "&0@ $$0
-M$0 $4 AB8 !( !. (9# 01 1 5P "',@
-M$0#_\0 %P 1+ 2!( < !B $2> $@2 ' 9P !$8@
-M "H$@ !P &\ AD8 !0"$ !$ !T (73 1 /_Q B@ "
-M&*0 $@ ) A@( !( "7 (8% 2
-MG !$T@ $@ " *( ACT !!$ ! "J (9$ 01 1
-M M "&E@ )@$0 $0 , AB !( #' (8\ 01
-M 0 S0 "%U $0#_\0 -8 0[H !0!( < #> (9&
-M 4 1 1 Y "&E@ )@$0 $0 /$ AC@ !( #W (8
-M+ 2 _P "&" $@ 04 AD, !"$ !$ $-
-M (<N 01 1 !$P "&+ $@ 1H 1 H !8!( <
-M $@ (8_ 01 0 !,P "'+P $$0 $0 3H AC( !(
-M $_ (<P 01 1 !1@ "&&@ $@ 4P AS$
-M!!$ !$ %3 (8^ 01 0 !9P "&0@ $0#_\0 6X A?8
-M !$ __$ &( (87 2 !C@ "&1 $$0 $0 9<
-M 1,( /!( < &I $3\ 1 * !M@ !%TL $0#_\0
-M ;T 10 !!$ P '* $2, $@2 ' !SP "&(P $@
-M =8 0R( !( < 'H $3^ 1 + !]0 !#10 '4
-M$@ !P ?H AD !!$ ! (& (8= 2 "#0 !$^
-M $@ "0 A, AA0 !( 9V5T;W!T %]?1%1/4E],25-47U\
-M7W-T87)T ')E860 871O:0!?7T-43U)?3$E35%]? '-T<G1O; !P<F]G;F%M
-M90!V9G!R:6YT9@!?96YV:7)O;@!?96YD %=R:71E %)E860 9V5T<&%R;0!?
-M:6]B %]'3$]"04Q?3T9&4T547U1!0DQ%7P!A8F]R= !A=&5X:70 97AI= !?
-M:6YI= !V97)B;W-E %]S>7-?;F5R<@!S>7-?97)R;&ES= !F8VQO<V4 55-!
-M1T4 7T193D%-24, <')O8V5S<P!?7VEO8@!?<WES7V5R<FQI<W0 =W)I=&4
-M<W1R<F-H<@!?97AI= !E;G9I<F]N &5R<FYO '-T<F-H<@!E<G)O<@!R97!O
-M<G1?;&EN95]L96YG=&@ ;W!T:6YD &]P96X ;W!T87)G &9G971S &]P=&5R
-M<@!R97!O<G1?;&EN95]N=6UB97)S %]E9&%T80!?4%)/0T5$55)%7TQ)3DM!
-M1T5?5$%"3$5? &9O<&5N '-Y<U]N97)R %]?9&]?9VQO8F%L7V1T;W)S %]?
-M0U1/4E]%3D1?7P!?971E>'0 7VQI8E]V97)S:6]N $]P96X 9F9L=7-H %]?
-M9&]?9VQO8F%L7V-T;W)S %]?1%1/4E]%3D1?7P!M86EN &QI;F5?;&5N9W1H
-M '-T<FQE;@!?9FEN:0!F<')I;G1F &QI8F,N<V\N,0 AD, C$P
-M AS$ !#$P AS !!$P AR\ _$P AD8 U
-M$P " AD0 !($P AI8 P$P A@( K%0 A@4
-M L%0 A@@ Y%0 A@L X%0 A@X :%0
-M AA$ >%0 AA0 !5%0 AA< !'%0 AAH !"%0
-M AAT !3%0 AB Q%0 AB, !.%0 AB8 B
-M%0 ABD J%0 ABP \%0 AB\ @%0 AC(
-M ! %0 AC4 =%0 AC@ W%0 "\$" X .@0*(#H$2<
-M(Z @@) 0* 20$ !0 !"]@$ 1 !$D!(CX$ 0O(! 0 !P $
-M "0$ 0DA $94L( *4 J $E 1 "A< (:6$N$,U"+ $ "D! 0 !"
-MYP$ ! $+H 0 ('#X @! $0 1-0"(^R HK__$H #9(2(^S0 F $
-M@*(@ * F4$" E@)@!)(0( "2 F $T ) "X"B( 2O__]E *@ 9*2@ "
-M@ ,$0 1!$ $2B$B/LH2I@ M $ !&?P@ 0 *"$/_PRO__]T 0 $1$
-M $1 $+!D!(C"(''X B!Z G>._F*@0 !BB$" L! @ - &0 ! $+!DA @
-M+Q, (: HB $H !- B80@0@ $T 9 - "80B0 B !T")A"!$ (;0 B$(
-MT"9 !$ (? (B#$(0 AB< (8E "&%0 19 0 !22$ 90 !"KI02H:"
-MHC__ H ,X"B(&PB@ 1$0 AQ2 F HB!N@*(@/P* "J HB!. H '- $
-M(/@0O__P%0 10* !. HB!V H 'M $H/00O__J%0 14 0IO0 B# E!
-M"!$ (: HJ( "+__XM0B(0 3 !%$0@ $ (N2$F&H$+__W14 $70!"#X
-M@* ")!@/_\0O__7T"0@^("@ B08#__T"0@^- $X/R H (D& __Q"__\_0
-M).#\@* ")!@/_\0O__+T"2@]!"__\FB$" !@*1@ "* L1 "'%0 AA$
-M (:0$B$X$P 19(28<A $)VU *@\$ 0F60$" !DA "- "(+R1*B "T 9
-M"("B( "@ 1(0 A] "8+R1*B "0 #] &0 B HC__(H K 0/__0!""\
-MD (@ = D(+R1*B "T 9 "("B( 2O__SDA $(''X B!Z G>.]F) 0 !@3
-M !%0 !"6I(28="JD@ $H !Z80( 1& $P 19(28=A !%E! &* 0
-M( &H![WX)0 ABT (:0$ 4DA B $ 0DV4$ 5@*(@ * #4! 0 !"
-M2Y 0 !2B C__$0 AM "(0" I$ (!( *X"DX 2@ +$0 AA, $60%*$X
-MDA)A^$ 0C64$ 8T 6@^("B( "@ B$0 AM "(/2 HB H !Q, $60
-M%*$XDA)B )00 !! $(HE@>]^- %H/B HB H $A$ (;0 B#\@*(@ *
-M D3 !%D!2A.)(28AB4$ 00 !"&Y80 !$0@ (I@3@ 1, $60%*$XDA)B
-M($ 0A24$ 0I@3@ 1"__\B@!" !0 !"&Y 0 !6P$" @<?@"('H "=X[^0
-M\B>@2/0GH$SV)Z!0^">@5/HGH%@1 "&0 !"$I 2(2@1' LBX "!$0 "
-MC@ ( H !*('H$P1 "'\@(@N. 'H$@5 "&-0 AI 6H3@3 !%DA)B*$
-M0?/4 J$(D!:A.)(0 !! $(!E! $8"F8 "@ :$0 A@2 !*0$B$X$0
-MAM "(1" ID (-H #!$ (85 "&E!*B6)<N8 *0%J$X$P 19(28C! $'=
-MU + "A" X1 "&D!(A.!, $62$F(X0 !!UI00 !D0@ '$0 AI 2(3@3
-M !%0 !!T)(28E 1 "&0 !!W) 2(3@1# @(X " * !41" @(X " *
-M R IF H !1$ $41 !%$( Y(2(EB2$B)P?___M) 0( ! $&MD!
-M&9 0( 3 !%?___KI(28GA $'+ 0 (''X B!Z G>._F* 0 !@1 !%
-MD!(BD$ 0<;23 @*(@ !* F0$ 0$0@ !, $62$F*@?___G)00 ! 0
-M@ :L! &9(0( ! $&\E! @ + 0 B I@ 9!H !("F !H$@ 1 0 ("F
-M0!H2@ ($0@ !, $62$F*XE! $'___XF6$ :,( !Q, $62$F+0E!
-M&Y80 !E___^"F! &H''X B!Z G>._F* 0 !B0$ 0DA &4 0:*4$ :
-ML! "("F/_\2@ ($1@ !, $62$F+PE! $)80 !E___]PF! &H''X B!
-MZ G>._F* 0 !B0$ 0DA &4 09.4$ :L! "("F/_\2@ ($1@ !,
-M $62$F,0E! $)80 !E___]>F! &H''X B!Z G>._F* 0 !B0$ 0DA
-M&4 0824$ :L! "("F/_\2@ ($1@ !, $62$F,PE! $)80 !E___],
-MF! &H''X B!Z G>._F!$ $32 B/X@*)@ * F@$B/XT 0 )_" "@
-M!" $T 0 ("B( 2O__[ 0 (''X B!Z G>._F)WCOZ"!Z G>._F!$
-M $34 B/L@**__Q* V2$B/LT )@!("B( "@ )E! @ )8"8 22$" D@)@
-M!- "0 N HB $K___90"H &2DH H #!$ $01 !$HA(C[*$J8 +0! 1
-MG\( $ "@A#_\,K___= $ !$1 !$0 !!$) 2(PB!Q^ (@>@ (''X B!
-MZ G>._H(''X B!Z _____P #_____ ! '5S
-M86=E.B @8VML96YG=&@@(%L@+78@72!;(&%R9R N+BX@72!F:6QE<RXN+B *
-M(" @(" @(" @(" @+6P@;&5N9W1H(" @+2T@;6%X:6UU;2!L:6YE(&QE;F=T
-M: H@(" @(" @(" @(" M;B @(" @(" @(" M+2!R97!O<G0@;&EN92!N=6UB
-M97)S(&9O<B!O9F9E;F1I;F<@;&EN97,*(" @(" @(" @(" @+4X@(" @(" @
-M(" @+2T@<F5P;W)T(&QI;F4@;G5M8F5R<R!A;F0@;&5N9W1H(&9O<B!O9F9E
-M;F1I;F<@;&EN97,*(" @(" @(" @(" @+78@(" @(" @(" @+2T@=F5R8F]S
-M90H*4')I;G0@=&AE(&YA;64@;V8@9FEL97,@=VAI8V@@:&%V92!A="!L96%S
-M=" Q(&QI;F4@=VAI8V@@97AC965D<R!T:&4*;6%X:6UU;2!L:6YE(&QE;F=T
-M:"X@(%1H92!D969A=6QT(&UA>&EM=6T@;&EN92!L96YG=&@@:7,@.# N"@
-M &PZ;DYV *"5D*2!I<R!I;&QE9V%L(&QI;F4@;&5N9W1H"@ E<P
-M '( 56YA8FQE('1O(&]P96X@9FEL92 H)7,I"@ E
-M<PH %1/3R!,3TY'.B5D.B E<PH "5D.B E9 H )60*
-M E<SH@ " H)7,I"@ ("AU;FMN;W=N(&5R<FYO/25D*0H "@
-M !F871A;"!E<G)O<BP@97AI=&EN9P !E>&ET:6YG &9A=&%L(&5R
-M<F]R+"!A8F]R=&EN9P # Q,C,T-38W.#DM G)7,G(&ES(&YO="!A
-M(&YU;6)E<@ E<R!C86X@;VYL>2!B92 E;&0 E<R!M=7-T(&)E
-M(&)E='=E96X@)6QD(&%N9" E;&0 &]P96XH)R5S)RP@,'@E>"P@,"5O*2!F
-M86EL960 <F5A9"@E9"P@,'@E>"P@)60I(&9A:6QE9 !W<FET
-M92@E9"P@,'@E>"P@)60I(&9A:6QE9 (74 $ (; # !$T@
-M - $3X 0 0#H !0 !"+0 * ")0 8 0-4 "P
-M ! 5 , A?8 @ .0 4 !P !< 0LP
-M!P !"MP ( !. D ,
-M # P,+__\P$ #
-M \,+__\ $ # !(,+__[0$ # !4,+__Z@$ # !@,+__YP$
-M # !L,+__Y $ # !X,+__X0$ # "$,+__W@$ # "0,+__
-MVP$ # "<,+__V $ # "H,+__U0$ # "T,+__T@$ # #
-M,+__SP$ # #,,+__S $ # #8,+__R0$ # #D,+__Q@$ #
-M #P,+__PP$ # #\,+__P $ # $(,+__O0$ ! $4"
-M % $
-M 0 __$ $ U # ! ! .@ P @ 0-4
-M , , $(M # $ !"MP P !0
-M 0LP , 8 $,% # ' !$T@ P "
-M 1/@ , D $3[ # * !$_0 P
-M"P 10 , P (73 # - "%U
-M P #@ A?8 , \ (8\ # 0 "&0@
-M P $0 , !( # 3
-M P % , !4 # 6
-M P %P , !@ # 9
-M #P ! #_\0 !8 0 __$ B $
-M /_Q +0 !$U @ " $, 0R( < !2 (8\
-M ! 0 8 ! #_\0 &L 0T4 < !Z
-M $ /_Q A ! #_\0 (\ 1-$ ( < "E
-M $31 ' M "&00 0 $ ,( 0 __$
-M #) (8. 2 T !$_0 $0 "P -X 0P4 =!(
-M < #E (8U 2 Z@ "&$0 $@ .\ 1/L
-M !$ H #] (8O 2 !! "&0@ $$0 $0 0T AB8
-M !( $6 (9# 01 1 !'P "',@ $0#_\0 20
-M 1+ 2!( < $J $2> $@2 ' !+P !$8@ "H$@ !P
-M 3< AD8 !0"$ !$ $\ (73 1 /_Q !4@ "&*0 $@
-M 5@ A@( !( %? (8% 2 !9 !$T@
-M$@ " 6H ACT !!$ ! %R (9$ 01 1 !? "&E@
-M )@$0 $0 8@ AB !( &/ (8\ 01 0 !E0 "
-M%U $0#_\0 9X 0[H !0!( < &F (9& 4 1 1 !
-MK "&E@ )@$0 $0 ;D AC@ !( &_ (8+ 2
-M !QP "&" $@ <T AD, !"$ !$ '5 (<N 01
-M 1 !VP "&+ $@ >( 1 H !8!( < 'H (8_
-M 01 0 !^P "'+P $$0 $0 @( AC( !( (' (<
-MP 01 1 "#@ "&&@ $@ A0 AS$ !!$ !$ (;
-M (8^ 01 0 "+P "&0@ $0#_\0 C8 A?8 !$ __$
-M )0 (87 2 "5@ "&1 $$0 $0 E\ 1,( /!(
-M < )Q $3\ 1 * "?@ !%TL $0#_\0 H4 10
-M!!$ P *2 $2, $@2 ' "EP "&(P $@ IX 0R(
-M !( < *P $3^ 1 + "O0 !#10 '4$@ !P L(
-M AD !!$ ! +. (8= 2 "U0 !$^ $@ "0
-M ML AA0 !( 9V\S,B]C:VQE;F=T: !C<G1I+G, =F%L=65S+5AA
-M+F, 8W)T<W1U9F8N8P!?7V1O7V=L;V)A;%]C=&]R<U]A=7@ 9V-C,E]C;VUP
-M:6QE9"X 9F]R8V5?=&]?9&%T80!C:VQE;F=T:"YC &=C8S)?8V]M<&EL960N
-M &QI8F=C8S(N8P!C<G1S='5F9BYC %]?9&]?9VQO8F%L7V-T;W)S7V%U> !G
-M8V,R7V-O;7!I;&5D+@!F;W)C95]T;U]D871A &-R=&XN<P!G971O<'0 7U]$
-M5$]27TQ)4U1?7P!?<W1A<G0 <F5A9 !A=&]I %]?0U1/4E],25-47U\ <W1R
-M=&]L '!R;V=N86UE '9F<')I;G1F %]E;G9I<F]N %]E;F0 5W)I=&4 4F5A
-M9 !G971P87)M %]I;V( 7T=,3T)!3%]/1D93151?5$%"3$5? &%B;W)T &%T
-M97AI= !E>&ET %]I;FET '9E<F)O<V4 7W-Y<U]N97)R '-Y<U]E<G)L:7-T
-M &9C;&]S90!54T%'10!?1%E.04U)0P!P<F]C97-S %]?:6]B %]S>7-?97)R
-M;&ES= !W<FET90!S=')R8VAR %]E>&ET &5N=FER;VX 97)R;F\ <W1R8VAR
-M &5R<F]R ')E<&]R=%]L:6YE7VQE;F=T: !O<'1I;F0 ;W!E;@!O<'1A<F<
-M9F=E=', ;W!T97)R ')E<&]R=%]L:6YE7VYU;6)E<G, 7V5D871A %]04D]#
-M14154D5?3$E.2T%'15]404),15\ 9F]P96X <WES7VYE<G( 7U]D;U]G;&]B
-M86Q?9'1O<G, 7U]#5$]27T5.1%]? %]E=&5X= !?;&EB7W9E<G-I;VX 3W!E
-M;@!F9FQU<V@ 7U]D;U]G;&]B86Q?8W1O<G, 7U]$5$]27T5.1%]? &UA:6X
-M;&EN95]L96YG=&@ <W1R;&5N %]F:6YI &9P<FEN=&8 $ %
-MFP UD "]D # %$X ((X
-M $8\ ! *",I4W5N3U,@-2XS($=E;F5R:6,@4V5P=&5M
-M8F5R(#$Y.3, &%S.B!30S,N,"!E87)L>2!A8V-E<W,@,#$@4V5P(#$Y.3,*
-M $=#0SH@*$=.52D@,BXV+C, &%S.B!30S,N,"!E87)L>2!A8V-E<W,@,#$@
-M4V5P(#$Y.3,* $=#0SH@*$=.52D@,BXV+C, &%S.B!30S,N,"!E87)L>2!A
-M8V-E<W,@,#$@4V5P(#$Y.3,* $=#0SH@*$=.52D@,BXV+C, &%S.B!30S,N
-M,"!E87)L>2!A8V-E<W,@,#$@4V5P(#$Y.3,* $=#0SH@*$=.52D@,BXV+C,
-M;&0Z("A31U4I(%-U;D]3+T5,1B H3$LM,2XS*0 0 "D 8?
-M"V0 1,( (60 1,( +3P /(
-M 7H <( EX L(
-M SH !$H !5H !=(
-M !EH !LX !SX !
-MX8 !]( "#( ".8
-M "5( "<( "D8 "G8
-M "R( #&8 $GH %+(
-M & %.8 ) %0X -< %3H #0 %
-M6H #4 %9( #8 %;X #< %>8 #@
-M %A( #D %CX #H %FH $8 %IX
-M %T( &T %]( "X &"20 !\L 1,( "YI;G1E
-M<G +FAA<V@ +F1Y;G-Y;0 N9'EN<W1R "YR96QA+F)S<P N<F5L82YP;'0
-M+G1E>'0 +FEN:70 +F9I;FD +F-T;W)S "YD=&]R<P N<F]D871A "YG;W0
-M+F1Y;F%M:6, +G!L= N9&%T80 N8G-S "YS>6UT86( +G-T<G1A8@ N<W1A
-M8BYI;F1E> N8V]M;65N= N<W1A8@ N<VAS=')T86( +G-T86(N:6YD97AS
-M='( +G-T86)S='( '9A;'5E<RU882YC "\Q,#DS+V]N,3 Y,U]W<R]U<W(O
-M<W)C+VQI8B]L:6)C+P!P;W)T+V=E;B]V86QU97,M6&$N8P %AT(#L@5CTR
-M+C +VYE="]M;W)G86YA+W5S<C$O<G1E;7,M,RXU+C P+V,O8G5I;&0M=&]O
-M;',O<W)C "]U<W(O8V-S+VQI8B]V86QU97,M6&$N;P ;&EB9V-C,BYC "]U
-M<W(T+T=.050O9V-C+3(N-BXS+P N+VQI8F=C8S(N8P!G8V,R7V-O;7!I;&5D
-M+@!I;G0Z=#$]<C$[+3(Q-#<T.#,V-#@[,C$T-S0X,S8T-SL 8VAA<CIT,CUR
-M,CLP.S$R-SL ;&]N9R!I;G0Z=#,]<C$[+3(Q-#<T.#,V-#@[,C$T-S0X,S8T
-M-SL =6YS:6=N960@:6YT.G0T/7(Q.S [+3$[ &QO;F<@=6YS:6=N960@:6YT
-M.G0U/7(Q.S [+3$[ &QO;F<@;&]N9R!I;G0Z=#8]<C$[,#$P,# P,# P,# P
-M,# P,# P,# P,# [,#<W-S<W-S<W-S<W-S<W-S<W-S<W-SL ;&]N9R!L;VYG
-M('5N<VEG;F5D(&EN=#IT-SUR,3LP,# P,# P,# P,# P.S Q-S<W-S<W-S<W
-M-S<W-S<W-S<W-S<W.P!S:&]R="!I;G0Z=#@]<C$[+3,R-S8X.S,R-S8W.P!S
-M:&]R="!U;G-I9VYE9"!I;G0Z=#D]<C$[,#LV-34S-3L <VEG;F5D(&-H87(Z
-M=#$P/7(Q.RTQ,C@[,3(W.P!U;G-I9VYE9"!C:&%R.G0Q,3UR,3LP.S(U-3L
-M9FQO870Z=#$R/7(Q.S0[,#L 9&]U8FQE.G0Q,SUR,3LX.S [ &QO;F<@9&]U
-M8FQE.G0Q-#UR,3LX.S [ &-O;7!L97@@:6YT.G0Q-3US.')E86PZ,2PP+#,R
-M.VEM86<Z,2PS,BPS,CL[ &-O;7!L97@@9FQO870Z=#$V/7(Q-CLT.S [ &-O
-M;7!L97@@9&]U8FQE.G0Q-SUR,3<[.#LP.P!C;VUP;&5X(&QO;F<@9&]U8FQE
-M.G0Q.#UR,3@[.#LP.P!V;VED.G0Q.3TQ.0!A<F-H7W1Y<&4Z5#(P/65!4D-(
-M7S,R0DE4.C L05)#2%\V-$))5#HQ+#L <F5G7V-L87-S.E0R,3UE3D]?4D5'
-M4SHP+$=%3D5204Q?4D5'4SHQ+$907U)%1U,Z,BQ!3$Q?4D5'4SHS+$Q)35]2
-M14=?0TQ!4U-%4SHT+#L ;6%C:&EN95]M;V1E.E0R,CUE5D])1&UO9&4Z,"Q1
-M26UO9&4Z,2Q(26UO9&4Z,BQ04TEM;V1E.C,L4TEM;V1E.C0L4$1);6]D93HU
-M+$1);6]D93HV+%1);6]D93HW+$]);6]D93HX+%%&;6]D93HY+$A&;6]D93HQ
-M,"Q4449M;V1E.C$Q+%-&;6]D93HQ,BQ$1FUO9&4Z,3,L6$9M;V1E.C$T+%1&
-M;6]D93HQ-2Q30VUO9&4Z,38L1$-M;V1E.C$W+%A#;6]D93HQ."Q40VUO9&4Z
-M,3DL0U%);6]D93HR,"Q#2$EM;V1E.C(Q+$-326UO9&4Z,C(L0T1);6]D93HR
-M,RQ#5$EM;V1E.C(T+$-/26UO9&4Z,C4L0DQ+;6]D93HR-BQ#0VUO9&4Z,C<L
-M0T-8;6]D93HR."Q#0U].3T]6;6]D93HR.2Q#0UA?3D]/5FUO9&4Z,S L0T-&
-M4&UO9&4Z,S$L0T-&4$5M;V1E.C,R+$U!6%]-04-(24Y%7TU/1$4Z,S,L.P!M
-M;V1E7V-L87-S.E0R,SUE34]$15]204Y$3TTZ,"Q-3T1%7TE.5#HQ+$U/1$5?
-M1DQ/050Z,BQ-3T1%7U!!4E1)04Q?24Y4.C,L34]$15]#0SHT+$U/1$5?0T]-
-M4$Q%6%])3E0Z-2Q-3T1%7T-/35!,15A?1DQ/050Z-BQ-05A?34]$15]#3$%3
-M4SHW+#L <'1R9&EF9E]T.G0Q '-I>F5?=#IT- !W8VAA<E]T.G0S %51271Y
-M<&4Z=#$Q %-)='EP93IT,0!54TET>7!E.G0T $1)='EP93IT-@!51$ET>7!E
-M.G0W %-&='EP93IT,3( 1$9T>7!E.G0Q,P!W;W)D7W1Y<&4Z=#$ 1$ES=')U
-M8W0Z5#(T/7,X:&EG:#HQ+# L,S([;&]W.C$L,S(L,S([.P!$275N:6]N.G0R
-M-3UU.',Z,C0L,"PV-#ML;#HV+# L-C0[.P!F=6YC7W!T<CIT,C8]*C(W/68Q
-M.0!?7V1O7V=L;V)A;%]D=&]R<SI&,3D
-M $ ! @ ! -0 #4 $0
-M 0 ) !0 ( 0#H Z FP #
-M 0 $ #P L " $#5 U0 5@ ! !H $
-M $ !< # @ !"+0 BT ")0 0
-M ? ! ( 0K< *W %0 # $0 0 , *0
-M 0 " $+, "S #D P \ $ # #, !
-M!@ !#!0 P4 '- ! Y 0 8 1-(
-M 32 )@ 0 /P $ & $3X $^
-M , $ $4 ! !@ !$^P !/L "
-M ! !, 0 8 1/T 3] @
-M 0 4P $ " $4 % -+ (
-M %L ! P "%TP !=, ! ! 0
-M !@ !@ , A=0 74 (@ $ 0 ( :0
-M $ ' (7V %]@ $8 $ # &X !
-M P "&/ !CP % ! !T " , AD(
-M 9" \ @ >0 ( &0@
-M 90 $P "D $ $ ($ # !]8 "XP
-M 0 ") 0 B/ $@
-M 0 , E0 $ (H0 $; !
-M )X ! ".@ !^ ! P
-M "D P EF ,8 $ K@
-M , )EX "; ! +T #
-= ";Y &'P 0 !
-
-end
diff --git a/tools/build/os/msdos/fixtimer.c b/tools/build/os/msdos/fixtimer.c
deleted file mode 100644
index 3b71032550..0000000000
--- a/tools/build/os/msdos/fixtimer.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * $Id$
- */
-
-#include <stdio.h>
-#include <dos.h>
-
-#define IO_RTC 0x70 /* RTC */
-
-#define RTC_SEC 0x00 /* seconds */
-#define RTC_MIN 0x02 /* minutes */
-#define RTC_HRS 0x04 /* hours */
-#define RTC_WDAY 0x06 /* week day */
-#define RTC_DAY 0x07 /* day of month */
-#define RTC_MONTH 0x08 /* month of year */
-#define RTC_YEAR 0x09 /* month of year */
-#define RTC_STATUSA 0x0a /* status register A */
-#define RTCSA_TUP 0x80 /* time update, don't look now */
-
-#define RTC_STATUSB 0x0b /* status register B */
-
-#define RTC_DIAG 0x0e /* status register E - bios diagnostic */
-#define RTCDG_BITS "\020\010clock_battery\007ROM_cksum\006config_unit\005memory_size\004fixed_disk\003invalid_time"
-
-
-
-/* convert 2 digit BCD number */
-static int bcd( unsigned int i )
-{
- return ((i/16)*10 + (i%16));
-}
-
-static unsigned int rtcin( unsigned int what )
-{
- outportb( IO_RTC, what );
- return inportb( IO_RTC+1 );
-}
-
-
-void fix_date( void )
-{
- int s;
- struct date date;
- struct time time;
-
- /* initialize brain-dead battery powered clock */
- outportb( IO_RTC, RTC_STATUSA );
- outportb( IO_RTC+1, 0x26 );
- outportb( IO_RTC, RTC_STATUSB );
- outportb( IO_RTC+1, 2 );
-
- outportb( IO_RTC, RTC_DIAG );
- s = inportb( IO_RTC+1 );
- if (s) printf("RTC BIOS diagnostic error %b\n", s, RTCDG_BITS);
-
- /* check for presence of clock */
- s = rtcin(RTC_STATUSA);
- if ( s == 0xff || s == 0 ) {
- printf( "Real-time clock not found\n" );
- return;
- }
-
- /* ready for a read? */
- while ((s & RTCSA_TUP) == RTCSA_TUP)
- s = rtcin(RTC_STATUSA);
-
- date.da_year = bcd(rtcin(RTC_YEAR)) + 1900; /* year */
- if ( date.da_year < 1970) date.da_year += 100;
- date.da_year -= 1980;
- date.da_mon = bcd(rtcin(RTC_MONTH)); /* month */
- date.da_day = bcd(rtcin(RTC_DAY)); /* day */
-
- (void)bcd(rtcin(RTC_WDAY)); /* weekday */
-
- time.ti_hour = bcd(rtcin(RTC_HRS)); /* hour */
- time.ti_min = bcd(rtcin(RTC_MIN)); /* minutes */
- time.ti_sec = bcd(rtcin(RTC_SEC)); /* seconds */
- time.ti_hund = 0;
-
- setdate( & date );
- settime( & time );
-}
-
-
-
-
-void fix_timer( void )
-{
-#define PIT_PORT 0x40
-#define TIMER_CNTR0 (PIT_PORT + 0) /* timer 0 counter port */
-#define TIMER_MODE (PIT_PORT + 3) /* timer mode port */
-#define TIMER_SEL0 0x00 /* select counter 0 */
-#define TIMER_RATEGEN 0x04 /* mode 2, rate generator */
-#define TIMER_16BIT 0x30 /* r/w counter 16 bits, LSB first */
-
- /* set timer 0 to generate interrupts every period */
- outportb( TIMER_MODE, TIMER_SEL0|TIMER_RATEGEN|TIMER_16BIT );
- outportb( TIMER_CNTR0, 0 ); /* counter low */
- outportb( TIMER_CNTR0, 0 ); /* counter high */
-}
-
-int main(void)
-{
- /* Make timer count at correct pace */
- fix_timer();
-
- /* Fix the date */
- fix_date();
-
- return 0;
-}
diff --git a/tools/build/os/msdos/fixtimer.uue b/tools/build/os/msdos/fixtimer.uue
deleted file mode 100644
index bc4b10fc72..0000000000
--- a/tools/build/os/msdos/fixtimer.uue
+++ /dev/null
@@ -1,162 +0,0 @@
-#
-# $Id$
-#
-begin 664 fixtimer.exe
-M35IF 0X 0 @ T __^; 8 (@ $ ^R!R:@$
-M
-M
-M
-M
-M
-M
-M
-M
-M
-M
-M "Z3 $NB1;X ;0PS2&++@( BQXL ([:HY( C :0
-M (D>C ")+JP QP:6 /__Z#0!Q#Z* (O'B]BY_W\F@3TX-W49)HM5 H#Z/740
-M@.;?_P:6 (#^674$_P:6 /*NXV%#)C@%==: S8#WV8D.B@"Y 0#3XX/#"(/C
-M^(D>C@",VBOJBSY\ H'_ )S![\ HD^? *!Q^P$<B@#/GH"<B*Q!-/O1SOO
-M<AF#/GP" '0'@SYZ @!U#K\ $#OO=P>+_>L#Z2$!B]\#VHD>I ")'J@ H9
-M*]B.P+1*5\TA7]/G^H[2B^?[,\ NC@;X ;^F!+GL!"O/\ZH._Q:8!.BU NB=
-M [0 S1J)%I@ B0Z: /\6G 3_-H@ _S:& /\VA #H%P)0Z%H"+HX>^ 'H? .
-M_Q::!#/ B_"Y+P"0_ ($@-0 1N+X+3<-D'0*N1D D+HO .B+ (OLM$R*1@+-
-M(;D. )"Z2 #IAP >N US2&)'G0 C 9V +@$-<TAB1YX (P&>@"X!37-(8D>
-M? ",!GX N 8US2&)'H C :" +@ )8S*CMJZ6 '-(1_#'K@ )<46= #-(1\>
-MN 0EQ19X ,TA'QZX!27%%GP S2$?'K@&)<46@ #-(1_#QP:6 R\.T0+L"
-M ,TAP[D> )"Z5@ NCA[X >CI_[@# %#H*?\ %6+[(M&!+$$T^BZ"@#WXHM6
-M!('B#P #PNL 7<-5B^R*1@3F<.1QM #K %W#58OL@^P(5K *YG"P)N9QL OF
-M<+ "YG&P#N9PY'&T (OP"_9T#[BR 5!6N)0!4.B<"8/$!K@* %#HM?]9B_"!
-M_O\ = 0+]G4+N/P!4.A^"5GIJ0#K"K@* %#HE/]9B_"+QB6 #V '3LN D
-M4.B _UE0Z%__605L!XE&^(%^^+('?02#1OAD@6[XO >X" !0Z%W_65#H//]9
-MB$;[N < 4.A-_UE0Z"S_68A&^K@& %#H/?]94.@<_UFX! !0Z##_65#H#_]9
-MB$;]N ( 4.@@_UE0Z/_^68A&_#/ 4.@1_UE0Z/#^68A&_\9&_@"-1OA0Z'H1
-M68U&_%#HA1%97HOE7<.P-.9#L #F0+ YD##Z/#_Z.S^,\#K ,-5B^Q6BW8$
-M"_9\%(/^6'8#OE< B388 HJ$&@*8ENL-]]Z#_B-WZL<&& +__XO&HY0 N/__
-MZP!>7<(" ,-5B^SK"HL>?@+1X_^7I@2A?@+_#GX""\!UZ_\6= +_%G8"_Q9X
-M O]V!.AZ_5E=PP "Z/!JH#+HP>K /\C@:0 +Z #+D)JQ C,6'UI.+
-M-HH @\8"N0$ @#Z2 -R$8X&C "+_K%_,L#RKN-V@/%_@^P"N $ \,#P27^
-M_XO\*_AR8(OGC,".V(S0CL!12?.D,L"JCMV'\H?9B\.+T$/H&0!W!W) Z!(
-M=_D\('0(/ UT!#P)=>@RP.OD"\!T!T*J"L!U 4.&X#+ ^>,5K$DL(G0/!"(\
-M7'4'@#PB=0*L20OVP^E^_5D#RBZ.'JP#B1Z$ $,#VXOTB^PKZW+FB^6)+H8
-MXPZ)=@"#Q0(VK K X/IT\#/ B48 +O\FJ@.+#HH 4>A' 5F+^ O ="0>'@>.
-M'HP ,_;\\Z0?B_@&_S:. .@I 8/$ HO8!Z.( O =0/I$?TSP+G__XD_@\,"
-M\JXF. 5U](D'PU6+[(,^?@(@=06X 0#K%8M&!(L>?@+1XXF'I@3_!GX",\#K
-M %W#58OL5E>+?@2+10:CZ 0[QW4(QP;H! ZQ"+=02+'N@$B7<$H>@$B40&
-M7UY=PU6+[%97BWX$BT8&*06+-0/WBT8&0(D$B7P"H>8$.\=U!HDVY@3K"(O^
-M WX&B74"B\8%! #K %]>7<-5B^Q6BT8$,](E__^!X@ 4E#H] !968OP@_[_
-M=00SP.L8H>8$B40"BT8$0(D$B3;F!*'F! 4$ .L 7EW#58OL5HM&!#/2)?__
-M@>( %)0Z+< 65F+\(/^_W4$,\#K%8DVZ@2)-N8$BT8$0(D$B\8%! #K %Y=
-MPU6+[%97BWX$"_]U!#/ ZUJ+QP4+ "7X_XOX@S[J! !U!U?HH?]9ZT*+-N@$
-MB\8+P'0QBP2+UX/"*#O"<@E75N@-_UE9ZR2+!#O'<@Y6Z-'^6?\$B\8%! #K
-M$(MT!CLVZ 1USU?H(O]9ZP!?7EW#58OLBT8$B]2!Z@ !.\)S!Z.> #/ ZPO'
-M!I0 " "X___K %W#58OLBT8$BU8& P:> (/2 (O(@<$ 8/2 O2=0H[S',&
-MAP:> .L+QP:4 @ N/__ZP!=PU6+[/]V!.B?_UGK %W#58OLBT8$F5)0Z++_
-MB^7K %W#58OL@^P"5E>+7@2+-XO&B4;^BUX$]T<"0 !T!(O&ZQ^+7@2+?PKK
-M"XO?1X _"G4#_T;^B\9."\!U[HM&_NL 7UZ+Y5W" @!5B^Q6BW8$5NA3!%D+
-MP'0%N/__ZTR#?@H!=1"#/ !^"U;HE?^9*48&&58(@60"7_['! BT0(B40*
-M_W8*_W8(_W8&BD0$F%#HW *#Q B#^O]U"CW__W4%N/__ZP(SP.L 7EW#58OL
-M@^P$5HMV!%;H[ -9"\!T"+K__[C__^L_N $ 4#/ 4%"*1 284.B8 H/$"(E6
-M_HE&_(,\ 'X9BU;^BT;\4E!6Z!#_F8O8B\I86BO#&]'K!HM6_HM&_.L 7HOE
-M7<-5B^RX $2+7@3-(;@ '($T>+1T.L 7<-5B^Q65XM^"HMV!(M$#CO&=0R#
-M?@@"?P:!__]_=@:X___IJ@"#/NH# '4/N) ".\9U",<&Z@,! .L4@S[H P!U
-M#;B CO&=0;'!N@# 0"#/ !T#[@! % SP%!05NC&_H/$"/=$ @0 = ?_= CH
-M"PQ9@60"\__'1 8 (O&!04 B40(B40*@WX( G0_"_]V.\<&= +$"(-^!@!U
-M&%?H6?U9B48&"\!T!X%, @0 ZP6X___K&XM&!HE$"HE$"(E\!H-^" %U!8%,
-M @@ ,\#K %]>7<-65[\$ +Z NL0]T0" P!T!5;HG )93X/&$ O_=>Q?7L-5
-MB^R![(H 5E>+1@A /0( <P4SP.GV (M>!-'C]X? P" =!+_=@C_=@;_=@3H
-MXP"#Q ;IUP"+7@31XX&GP /__8M&!HF&?/^+1@B)AGC_C;9^_^MM_XYX_XN>
-M?/__AGS_B@>(AGO_/ IU!,8$#4:*AGO_B 1&C89^_XO6*]"!^H ?#Z-AG[_
-MB_XK^%>-AG[_4/]V!.A[ (/$!HF&=O\[QW0;@[YV_P!S!;C__^L-BT8(*X9X
-M_P.&=O\KQ^M/C;9^_X.^>/\ = /IB?^-AG[_B_XK^(O'"\!V+E>-AG[_4/]V
-M!.@M (/$!HF&=O\[QW07@[YV_P!S!;C__^L)BT8( X9V_RO'ZP6+1@CK %]>
-MB^5=PU6+[(M>!-'C]X? P (=!"X @!0,\!04/]V!.@H (OEM$"+7@2+3@B+
-M5@;-(7(/4(M>!-'C@8_ P 06.L&4.@%^>L 7<-5B^R+7@31XX&GP /__;1"
-MBD8*BUX$BTX(BU8&S2%R NL'4.C;^)GK %W#58OL@^PB5E<&BWX*'@>+7@B#
-M^R1W6(#[ G)3BT8,BTX."\E]$8!^!@!T"\8%+4?WV??8@]D C7;>XP^1*]+W
-M\Y'W\X@41N,)Z_$KTO?SB!1&"\!U]8U.WO?9 \[\3HH$+ IS! 0ZZP,"1@2J
-MXN^P *H'BT8*ZP!?7HOE7<(, %6+[(-^" IU!HM&!)GK!8M&!#/24E#_=@;_
-M=@BP 5"P85#H7/_K %W#58OL_W8&_W8$_W8(_W8*L !0L&%0Z$#_ZP!=PU6+
-M[/]V!O]V!/]V"/]V"H-^"@IU!;@! .L",\!0L&%0Z!G_ZP!=P[KL ^L#NO$#
-MN04 D+1 NP( S2&Y)P"0NO8#M$#-(>EM]E6+[%97BW8$BT0..\9T!;C__^MF
-M@SP ?"WW1 (( '4,BT0*B]:#P@4[PG46QP0 (M$"HO6@\(%.\)U!HM$"(E$
-M"C/ ZS2+? 8#/$<I/%>+1 B)1 I0BD0$F%#H$OV#Q 8[QW01]T0" )U"H%,
-M A N/__ZP0SP.L 7UY=PU6+[+AK#5"XD )0_W8$C48&4.A, NL 7<-5B^R+
-M7@;_#_]V!HI&!)A0Z 8 B^7K %W#58OL@^P"5HMV!HI&!(A&__\$?3:*1O__
-M1 J+7 J(1__W1 (( '0;@'[_"G0&@'[_#74/5N@9_UD+P'0&N/__Z>D BD;_
-MM #IX0#_#/=$ I =0?W1 (" '4+@4P"$ "X___IQ@"!3 ( 8-\!@!T)H,\
-M '015NC7_ED+P'0&N/__Z:< ZPJX__^+5 8KPHD$Z7W_Z94 @S[J P!U.;B0
-M CO&=3**1 284.@)^UD+P'4%@60"__VX )0]T0" )T!;@" .L",\!0,\!0
-M5NC]^H/$".F/_X!^_PIU'_=$ D =1BX 0!0N!X$4(I$!)A0Z.#\@\0&/0$
-M=1BX 0!0C48$4(I$!)A0Z,C\@\0&/0$ =!'W1 ( G4*@4P"$ "X___K!XI&
-M_[0 ZP!>B^5=PU6+[%:+=@2XD )05NC!_EE9ZP!>7<-5B^R#[ )65XMV!(M^
-M!D?W1 (( '0CZP+K $^+QPO =!56BUX(_T8(B@>84.B+_EE9/?__=>+I=0#W
-M1 ) '0W@WP& '0QBT0&.\=S*H,\ '0-5NBT_5D+P'0$,\#K4T]7_W8(BD0$
-MF%#H(?R#Q :)1OXK?O[K-^L"ZP!/B\<+P'0L_P1]%8M>"/]&"(H'_T0*BUP*
-MB$?_M #K#E:+7@C_1@C_-^CZ_5E9/?__=<N+Q^L 7UZ+Y5W"!@#_)IX$58OL
-MBU8$N00/NR<$_(K&TNC7JHK&(L77JHK"TNC7JHK"(L77JNL 7<(" %6+[('L
-ME@!65\=&J@ QD:M4.LX5[G__S+ \J[WT4E?PX@%1_Y.K7XB4U%2!HU&KBOX
-MC4:N4%?_=@C_5@K&1JU0 7ZJC7ZN!UI96\,&_(U^KHF^;/^+OFS_BW8&K K
-M=!$\)700B 5'_DZM?^_HN?_KZNEU!(FV>/^L/"5TYXF^;/\SR8F.=O^)CFK_
-MB(YU_\>&</___\>&<O___^L!K#+DB]"+V(#K((#[8'-'BI\W!(O#/1< =@/I
-M'02+V-'C+O^G& ]C#TL/I ]7#\D/TP\5$!\0+Q"*#V00/Q!#$$<0Z1";$3P1
-M7!'_$BP3+!,L$W8/@ _IX0. _0!W^(..:O\!ZYN _0!W[(..:O\"ZX^ _0!W
-MX("^=?\K= 2(EG7_Z7S_@Z9J_]^U!>ER_X..:O\@M07I:/^ _0!W1/>&:O\"
-M '4A@XYJ_PBU >E1_^F( XM^!(L%@T8$ H#] G,)B89P_[4#Z3?_@/T$=>&)
-MAG+__L7I*?^ _01ST[4$Z1__DBPPF(#] G<;M0*'AG#_"\!\TM'@B]#1X-'@
-M \(!AG#_Z?O^@/T$=:6'AG+_"\!\M-'@B]#1X-'@ \(!AG+_Z=W^@XYJ_Q"U
-M!>G3_H&.:O\ 8.F:O_OM07IP_Z#IFK_[X&.:O^ +4%Z;/^MPCK"K<*ZPNW
-M$+/I MK&AG7_ ,:&;_\ B)9N_XM^!(L%,]+K$;<*QH9O_P&(EF[_BWX$BP69
-M1T>)=@;WAFK_$ !T!(L51T>)?@2-OGO_"\!U,PO2=2^#OG+_ '4MB[YL_XN.
-M</_C&X/Y_W06BX9J_R4( '0$LC#K K(@BL+HMOWB^>GI_8..:O\$4E!7BL>8
-M4(J&;_]04^B0^18'BY9R_PO2?P/I% 'I(0&(EF[_B78&C;YZ_XM>!/\W0T.)
-M7@3WAFK_( !T#_\W0T.)7@06!^@7_; ZJA8'Z _]Q@4 QH9O_P"#IFK_^XV.
-M>O\K^8?/BY9R_SO1?P*+T>F^ (EV!HB6;O^+?@2+!8-&! (6!XV^>_\RY(D%
-MN0$ Z=@ B78&B)9N_XM^!/>&:O\@ '4,BSV#1@0"'@<+_^L*Q#V#1@0$C, +
-MQW4%'@>_( 3HVOP[CG+_=@2+CG+_Z9D B78&B)9N_XM^!(N.<O\+R7T#N08
-M5U&-GGO_4U*X 0 CAFK_4(N&:O^I@ !T"K@" ,=&_@0 ZQ>I %T"K@( ,=&
-M_@H ZPC'1OX( +@& %#H-_R+1OX!1@06!XV^>__WAFK_" !T$XN6</\+TGX+
-MZ%O\*]%^!(F6=O^*AG7_"L!T%": /2UT#H.N=O\!@Y9V_P!/)H@%Z#3\B_>+
-MOFS_BYYP_[@% ".&:O\]!0!U%HJF;O^ _&]U$(.^=O\ ?P;'AG;_ 0#K'Y"
-M_'AT!8#\6'44@XYJ_T!+2X.N=O\"?0;'AG;_ #CG;_]X9J_P( =0SK!K @
-MZ.'[2SO9?_;WAFK_0 !T#+ PZ,_[BH9N_^C(^XN6=O\+TGXG*\HKVB:*!#PM
-M= @\('0$/"MU!R:LZ*C[24N'RN,'L##HG?OB^8?*XQ$KV2:LB 5'_DZM?P/H
-MD/OB\0O;?@F+R[ @Z'O[XOGIKON)=@:+?@3WAFK_( !U"HL]@T8$ AX'ZP;$
-M/8-&! 2X4 J1JT#1JHFB07I??N+MGC_B[YL_[ EZ#S[K K =?B ?JU0?0/H
-M-OL'BT:JZP!?7HOE7<(( %6+[%97BW8$@S[H! !T'(L>Z 2+?P:+'N@$B7<&
-MB74$B7P&H>@$B40$ZPJ)-N@$B70$B70&7UY=PU6+[(/L E97BW8&BWX$BP0!
-M!:'F!#O&=0:)/N8$ZPV+! /&B4;^BU[^B7\"5NA-\5E?7HOE7<-6H>H$.P;F
-M!'42_S;J!.C:\EDSP*/F!*/J!.L[BQ[F!(MW O<$ 0!U(E;H&?%9.S;J!'4*
-M,\"CY@2CZ@3K!HM$ J/F!%;HH_)9ZPS_-N8$Z)GR68DVY@1>PU6+[(/L E97
-MBW8$_PR+! /&B4;^BWP"]P4! '44.S;J!'0.BP0!!8M>_HE_ HOWZP56Z +_
-M68M>_O<' 0!U"?]V_E;H*O]965]>B^5=PU6+[%:+=@0+]G4"ZQ>+Q@7\_XOP
-M.S;F!'4%Z#S_ZP56Z(__65Y=PU6+[%:T*XMV!(L,BU0"S2%>7<-5B^Q6M"V+
-M=@2+#(M4 LTA7EW# !4=7)B;RU#("T@0V]P>7)I9VAT("AC
-M*2 Q.3@X($)O<FQA;F0@26YT;"X 3G5L;"!P;VEN=&5R(&%S<VEG;FUE;G0-
-M"D1I=FED92!E<G)O<@T*06)N;W)M86P@<')O9W)A;2!T97)M:6YA=&EO;@T*
-M .P$[ 3L
-M!
-M
-M
-M
-M
-M 4E1#($))3U,@9&EA9VYO<W1I8R!E<G)O<B E
-M8@H $ AC;&]C:U]B871T97)Y!U)/35]C:W-U;09C;VYF:6=?=6YI= 5M96UO
-M<GE?<VEZ901F:7AE9%]D:7-K VEN=F%L:61?=&EM90!296%L+71I;64@8VQO
-M8VL@;F]T(&9O=6YD"@ $P("! 4&" @(%!4%$_\6!1$"____________
-M_____P4%_____________________P__(P+_#_____\3__\" @4/ O___Q/_
-M_________R/_____(_\3_P!Z WH#>@, 0 D" ( "
-M * @$ "0 @ @(" H ( $," P
-M + " !" @0 # @ #_ T ( _P
-M . " /\ #P @ #_ , _P
-M ! # /\ @ P #_ , ,
-M_P $ # /\ !0 P #_ 8 ,
-M _P ' # /\ " P #_
-MD , _P * # /\ "P P$@ B "( 2@ J#_
-M______________________________________\ <')I;G0@<V-A;F8@
-M.B!F;&]A=&EN9R!P;VEN="!F;W)M871S(&YO="!L:6YK960-"@ - "AN=6QL
-M*0 P,3(S-#4V-S@Y04)#1$5& !04 105%!04% ( % ,$% D%!04%!04%!044
-M%!04%!04%!04% \7#P@4%!0'%!84%!04%!04%!0-%!04%!04%!04%! *#P\/
-G" H4% 84$@L.%!01% P4% T4%!04%!04 -(!T@'9 50+60M9"UD+
-
-end
diff --git a/tools/build/os/msdos/ifc.c b/tools/build/os/msdos/ifc.c
deleted file mode 100644
index 091e2dd0ef..0000000000
--- a/tools/build/os/msdos/ifc.c
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * $Id$
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <process.h>
-
-#include <io.h>
-
-void * xmalloc( int size )
-{
- void * p = (void *)malloc( size );
- if ( !p ) {
- fprintf( stderr, "out of memory\n" );
- exit( 1 );
- }
- return p;
-}
-void * xrealloc( void * old, int size )
-{
- void * p = (void *)realloc( old, size );
- if ( !p ) {
- fprintf( stderr, "out of memory\n" );
- exit( 1 );
- }
- return p;
-}
-
-char ** argv_fix( int * argc, char ** argv )
-{
- char ** new = NULL;
- int max = 20;
- int cnt = 0;
- int j;
-
- for ( j = 1; argv[j]; ++j )
- if ( argv[j][0] == '@' && access(argv[j]+1,0)==0 )
- break;
- if ( argv[j] == NULL )
- return argv;
-
- new = (char **)xmalloc( max * sizeof *new );
- new[cnt++] = *argv++;
- for ( ; *argv; ++argv ) {
- if ( cnt >= max )
- new = (char **)realloc( new, (max*=2) * sizeof *new );
-
- if ( argv[0][0] != '@' || access(argv[0]+1,0) ) {
- new[cnt++] = *argv;
- } else {
- char line[ 1000 ];
- FILE * f = fopen( argv[0]+1, "r" );
- if ( !f ) {
- perror( argv[0]+1 );
- exit( 2 );
- }
- while ( fgets( line, sizeof line, f ) ) {
- int len = strlen( line );
- /* delete trailing newlines */
- while ( line[len-1] == '\n' || line[len-1] == '\r' )
- line[--len] = '\0';
- if ( cnt >= max )
- new = (char **)xrealloc( new, (max*=2) * sizeof *new );
- new[cnt] = (char *)xmalloc( len+1 );
- strcpy( new[cnt], line );
- ++cnt;
- }
- fclose( f );
- }
- }
- if ( cnt >= max )
- new = (char **)xrealloc( new, (max+1) * sizeof *new );
- new[cnt] = NULL;
- *argc = cnt;
- return new;
-}
-
-
-const char * USAGE =
-"usage: $progname [ -cNvmV ] file [ file ... ] dest-directory-or-file\n"
-" -v -- verbose\n"
-" -V suffix -- suffix to append to targets (before any . suffix)\n"
-" eg: -V _g would change 'foo' to 'foo_g' and\n"
-" 'libfoo.a' to 'libfoo_g.a'\n"
-" -m mode -- mode for new file(s)\n"
-" -c -- copy instead of move (always on)\n"
-" -N -- copy only if source is newer than target\n"
-;
-
-void fatal( char * msg )
-{
- if ( msg )
- fprintf( stderr, "%s\n", msg );
- fprintf( stderr, "%s", USAGE );
- exit( 1 );
-}
-
-char * basename( char * f )
-{
- char * b = strrchr( f, '/' );
- if ( b ) ++b;
- else b = f;
- return b;
-}
-
-#include <sys/stat.h>
-int is_dir( char * path )
-{
- struct stat buf;
- if ( stat( path, &buf ) )
- return 0;
- return buf.st_mode & S_IFDIR;
-}
-int is_file( char * path )
-{
- struct stat buf;
- if ( stat( path, &buf ) )
- return 0;
- return buf.st_mode & S_IFREG;
-}
-int newer( char * p1, char * p2 )
-{
- struct stat buf1;
- struct stat buf2;
- if ( stat( p1, &buf1 ) )
- return 0;
- if ( stat( p2, &buf2 ) )
- return 0;
- return buf1.st_mtime > buf2.st_mtime;
-}
-
-int filecopy( char * d, char * s, int preserve_time )
-{
-#if 0
- int status;
- char * argv[ 5 ];
- argv[0] = "cp";
- argv[1] = "-p";
- argv[2] = s;
- argv[3] = d;
- argv[4] = NULL;
- status = spawnvp( P_WAIT, argv[0], argv );
- if ( status )
- perror( "cp" );
- return status;
-#else
- FILE * fs;
- FILE * fd;
- char buffer[ 8192 ];
- int n;
- struct ftime When;
- struct stat Stat;
-
- fs = fopen( s, "rb" );
- if ( fs == NULL ) {
- perror( s );
- return 1;
- }
- fd = fopen( d, "wb" );
- if ( fd == NULL ) {
- perror( d );
- fclose( fs );
- return 2;
- }
-
- if ( preserve_time )
- if ( getftime( fileno(fs), &When ) ) {
- perror( s );
- preserve_time = 0;
- }
-
- do {
- n = fread( buffer, 1, sizeof buffer, fs );
- if ( n > 0 )
- if ( fwrite( buffer, 1, n, fd ) < 0 ) {
- perror( d );
- return 3;
- }
- } while ( n > 0 );
-
- fclose( fs );
-
- /* Fix time stamp */
- if ( preserve_time )
- if ( setftime( fileno(fd), &When ) ) {
- perror( s );
- preserve_time = 0;
- }
- fclose( fd );
-
- /* Fix access rights */
- if ( stat( s, &Stat ) )
- perror( s );
- else if ( chmod( d, Stat.st_mode ) )
- perror( d );
-
- return 0;
-#endif
-}
-
-
-
-
-
-int main( int argc, char * argv[] )
-{
- char * progname;
- int verbose = 0;
- int only_if_newer= 0;
- char * suffix = NULL;
- char * mode = NULL;
- char * dest;
- char ** pp;
-
- argv = argv_fix( &argc, argv );
-
- progname = basename( *argv++ );
-
- /* process the options */
- while ( argv[0] && argv[0][0] == '-' ) {
- switch ( argv[0][1] ) {
- case 'N':
- ++argv;
- only_if_newer = 1;
- break;
- case 'c':
- ++argv;
- /* We always copy, regardless */
- break;
- case 'v':
- ++argv;
- verbose = 1;
- break;
- case 'V':
- ++argv;
- suffix = *argv;
- ++argv;
- break;
- case 'm':
- ++argv;
- mode = *argv;
- ++argv;
- break;
- default:
- fatal( NULL );
- }
- }
-
- /* Separate source file(s) from dest directory or file */
-#if 0
- if ( !argv[0] || !argv[1] )
- fatal( "missing files or invalid destination" );
-#else
- /* We used to require at least one file; not any more */
- if ( !argv[0] )
- fatal( "missing files or invalid destination" );
- if ( !argv[1] )
- return 0;
-#endif
- for ( pp = argv; *pp; ++pp )
- continue;
- --pp;
- dest = *pp;
- *pp = NULL;
-
- /* Process the arguments */
- for (; *argv; ++argv ) {
- char * f = *argv;
- char * leaf = basename( f );
- char target[ 128 ];
-
- strcpy( target, dest );
-
- if ( is_dir( target ) ) {
- strcat( target, "/" );
- /* if we were given a suffix, then add it as appropriate */
- if ( suffix ) {
- char * dot = strchr( leaf, '.' );
- if ( dot ) {
- strncat( target, leaf, dot-leaf );
- strcat( target, suffix );
- strcat( target, dot );
- if ( verbose )
- printf( "%s: %s will be installed as %s",
- progname, f, strrchr(target,'/')+1 );
- } else {
- strcat( target, leaf );
- strcat( target, suffix );
- }
- } else {
- strcat( target, leaf );
- }
- }
-
- if ( access( f, 0 ) ) {
- char buf[200];
- sprintf( buf, "cannot read %s", f );
- fatal( buf );
- }
-
- if ( only_if_newer && is_file( target ) && !newer( f, target ) ) {
- if ( verbose )
- printf( "'%s' not newer than '%s'\n", f, target );
- continue;
- }
-
- if ( verbose )
- printf( "rm -f %s\n", target );
- if ( chmod( target, 0777 ) )
- if ( verbose )
- perror( target );
- if ( unlink( target ) )
- if ( verbose )
- perror( target );
- if ( verbose )
- printf( "cp -p %s %s\n", f, target );
- if ( filecopy( target, f, 1 ) )
- return 1;
- if ( mode ) {
- char buf[ 255 ];
- sprintf( buf, "chmod %s %s\n", mode, target );
- if ( verbose )
- printf( "%s\n", buf );
- system( buf );
- }
- }
-
- return 0;
-}
-
diff --git a/tools/build/os/msdos/ifc_exe.uue b/tools/build/os/msdos/ifc_exe.uue
deleted file mode 100644
index cd9f52b8f0..0000000000
--- a/tools/build/os/msdos/ifc_exe.uue
+++ /dev/null
@@ -1,163 +0,0 @@
-#
-# $Id$
-#
-
-begin 664 ifc.exe
-M(VEN8VQU9&4@/'-T9&EO+F@^#0HC:6YC;'5D92 \<W1R:6YG+F@^#0HC:6YC
-M;'5D92 \<')O8V5S<RYH/@T*#0HC:6YC;'5D92 \:6\N:#X-"@T*=F]I9" J
-M('AM86QL;V,H(&EN="!S:7IE("D-"GL-"B @("!V;VED("H@<" ]("AV;VED
-M("HI;6%L;&]C*"!S:7IE("D[#0H@(" @:68@*" A<" I("![#0H)9G!R:6YT
-M9B@@<W1D97)R+" B;W5T(&]F(&UE;6]R>5QN(B I.PT*"65X:70H(#$@*3L-
-M"B @("!]#0H@(" @<F5T=7)N(' [#0I]#0IV;VED("H@>')E86QL;V,H('9O
-M:60@*B!O;&0L(&EN="!S:7IE("D-"GL-"B @("!V;VED("H@<" ]("AV;VED
-M("HI<F5A;&QO8R@@;VQD+"!S:7IE("D[#0H@(" @:68@*" A<" I("![#0H)
-M9G!R:6YT9B@@<W1D97)R+" B;W5T(&]F(&UE;6]R>5QN(B I.PT*"65X:70H
-M(#$@*3L-"B @("!]#0H@(" @<F5T=7)N(' [#0I]#0H-"F-H87(@*BH@87)G
-M=E]F:7@H(&EN=" J(&%R9V,L(&-H87(@*BH@87)G=B I#0I[#0H@(" @8VAA
-M<B J*B!N97<@/2!.54Q,.PT*(" @(&EN=" @(" @;6%X(#T@,C [#0H@(" @
-M:6YT"2 @("!C;G0@/2 P.PT*(" @(&EN= D@(" @:CL-"@T*(" @(&9O<B H
-M(&H@/2 Q.R!A<F=V6VI=.R K*VH@*0T*"6EF("@@87)G=EMJ75LP72 ]/2 G
-M0"<@)B8@86-C97-S*&%R9W9;:ETK,2PP*3T]," I#0H)(" @(&)R96%K.PT*
-M(" @(&EF("@@87)G=EMJ72 ]/2!.54Q,("D-"@ER971U<FX@87)G=CL-"@T*
-M(" @(&YE=R ]("AC:&%R("HJ*7AM86QL;V,H(&UA>" J('-I>F5O9B J;F5W
-M("D[#0H@(" @;F5W6V-N="LK72 ]("IA<F=V*RL[#0H@(" @9F]R("@@.R J
-M87)G=CL@*RMA<F=V("D@('L-"@EI9B H(&-N=" ^/2!M87@@*0T*"2 @("!N
-M97<@/2 H8VAA<B J*BER96%L;&]C*"!N97<L("AM87@J/3(I("H@<VEZ96]F
-M("IN97<@*3L-"@D@(" @#0H):68@*"!A<F=V6S!=6S!=("$]("= )R!\?"!A
-M8V-E<W,H87)G=ELP72LQ+# I("D@('L-"@D@(" @;F5W6V-N="LK72 ]("IA
-M<F=V.PT*"7T@96QS92![#0H)(" @(&-H87(@;&EN95L@,3 P,"!=.PT*"2 @
-M("!&24Q%("H@9B ](&9O<&5N*"!A<F=V6S!=*S$L(")R(B I.PT*"2 @("!I
-M9B H("%F("D@('L-"@D)<&5R<F]R*"!A<F=V6S!=*S$@*3L-"@D)97AI="@@
-M,B I.PT*"2 @("!]#0H)(" @('=H:6QE("@@9F=E=',H(&QI;F4L('-I>F5O
-M9B!L:6YE+"!F("D@*2 @>PT*"0EI;G0@;&5N(#T@<W1R;&5N*"!L:6YE("D[
-M#0H)"2\J(&1E;&5T92!T<F%I;&EN9R!N97=L:6YE<R J+PT*"0EW:&EL92 H
-M(&QI;F5;;&5N+3%=(#T]("=<;B<@?'P@;&EN95ML96XM,5T@/3T@)UQR)R I
-M#0H)"2 @("!L:6YE6RTM;&5N72 ]("=<,"<[#0H)"6EF("@@8VYT(#X](&UA
-M>" I#0H)"2 @("!N97<@/2 H8VAA<B J*BEX<F5A;&QO8R@@;F5W+" H;6%X
-M*CTR*2 J('-I>F5O9B J;F5W("D[#0H)"6YE=UMC;G1=(#T@*&-H87(@*BEX
-M;6%L;&]C*"!L96XK,2 I.PT*"0ES=')C<'DH(&YE=UMC;G1=+"!L:6YE("D[
-M#0H)"2LK8VYT.PT*"2 @("!]#0H)(" @(&9C;&]S92@@9B I.PT*"7T)#0H@
-M(" @?0T*(" @(&EF("@@8VYT(#X](&UA>" I#0H);F5W(#T@*&-H87(@*BHI
-M>')E86QL;V,H(&YE=RP@*&UA>"LQ*2 J('-I>F5O9B J;F5W("D[#0H@(" @
-M;F5W6V-N=%T@/2!.54Q,.PT*(" @("IA<F=C(#T@8VYT.PT*(" @(')E='5R
-M;B!N97<[#0I]#0H-"@T*8V]N<W0@8VAA<B J(%5304=%(#T@#0HB=7-A9V4Z
-M("1P<F]G;F%M92!;("UC3G9M5B!=(&9I;&4@6R!F:6QE("XN+B!=(&1E<W0M
-M9&ER96-T;W)Y+6]R+69I;&5<;B(-"B(@(" @(" @("UV(" @(" @(" @("TM
-M('9E<F)O<V5<;B(-"B(@(" @(" @("U6('-U9F9I>" @("TM('-U9F9I>"!T
-M;R!A<'!E;F0@=&\@=&%R9V5T<R H8F5F;W)E(&%N>2 N('-U9F9I>"E<;B(-
-M"B(@(" @(" @(" @(" @(" @(" @(" @("!E9SH@+58@7V<@=V]U;&0@8VAA
-M;F=E("=F;V\G('1O("=F;V]?9R<@86YD7&XB#0HB(" @(" @(" @(" @(" @
-M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" G;&EB9F]O+F$G('1O
-M("=L:6)F;V]?9RYA)UQN(@T*(B @(" @(" @+6T@;6]D92 @(" @+2T@;6]D
-M92!F;W(@;F5W(&9I;&4H<RE<;B(-"B(@(" @(" @("UC(" @(" @(" @("TM
-M(&-O<'D@:6YS=&5A9"!O9B!M;W9E("AA;'=A>7,@;VXI7&XB#0HB(" @(" @
-M(" M3B @(" @(" @(" M+2!C;W!Y(&]N;'D@:68@<V]U<F-E(&ES(&YE=V5R
-M('1H86X@=&%R9V5T7&XB#0H[#0H-"G9O:60@9F%T86PH(&-H87(@*B!M<V<@
-M*0T*>PT*(" @(&EF("@@;7-G("D-"@EF<')I;G1F*"!S=&1E<G(L("(E<UQN
-M(BP@;7-G("D[#0H@(" @9G!R:6YT9B@@<W1D97)R+" B)7,B+"!54T%'12 I
-M.PT*(" @(&5X:70H(#$@*3L-"GT-"@T*8VAA<B J(&)A<V5N86UE*"!C:&%R
-M("H@9B I#0I[#0H@(" @8VAA<B J(&(@/2!S=')R8VAR*"!F+" G+R<@*3L-
-M"B @("!I9B H(&(@*0DK*V([#0H@(" @96QS90EB(#T@9CL-"B @("!R971U
-M<FX@8CL-"GT-"@T*(VEN8VQU9&4@/'-Y<R]S=&%T+F@^#0II;G0@:7-?9&ER
-M*"!C:&%R("H@<&%T:" I#0I[#0H@(" @<W1R=6-T('-T870@8G5F.PT*(" @
-M(&EF("@@<W1A="@@<&%T:"P@)F)U9B I("D-"@ER971U<FX@,#L-"B @("!R
-M971U<FX@8G5F+G-T7VUO9&4@)B!37TE&1$E2.PT*?0T*:6YT(&ES7V9I;&4H
-M(&-H87(@*B!P871H("D-"GL-"B @("!S=')U8W0@<W1A="!B=68[#0H@(" @
-M:68@*"!S=&%T*"!P871H+" F8G5F("D@*0T*"7)E='5R;B P.PT*(" @(')E
-M='5R;B!B=68N<W1?;6]D92 F(%-?249214<[#0I]#0II;G0@;F5W97(H(&-H
-M87(@*B!P,2P@8VAA<B J(' R("D-"GL-"B @("!S=')U8W0@<W1A="!B=68Q
-M.PT*(" @('-T<G5C="!S=&%T(&)U9C([#0H@(" @:68@*"!S=&%T*"!P,2P@
-M)F)U9C$@*2 I#0H)<F5T=7)N(# [#0H@(" @:68@*"!S=&%T*"!P,BP@)F)U
-M9C(@*2 I#0H)<F5T=7)N(# [#0H@(" @<F5T=7)N(&)U9C$N<W1?;71I;64@
-M/B!B=68R+G-T7VUT:6UE.PT*?0T*#0II;G0@9FEL96-O<'DH(&-H87(@*B!D
-M+"!C:&%R("H@<RP@:6YT('!R97-E<G9E7W1I;64@*0T*>PT*(VEF(# -"B @
-M("!I;G0)"7-T871U<SL-"B @("!C:&%R(" @(" @*B!A<F=V6R U(%T[#0H@
-M(" @87)G=ELP72 ](")C<"([#0H@(" @87)G=ELQ72 ]("(M<"([#0H@(" @
-M87)G=ELR72 ](',[#0H@(" @87)G=ELS72 ](&0[#0H@(" @87)G=ELT72 ]
-M($Y53$P[#0H@(" @<W1A='5S(#T@<W!A=VYV<"@@4%]704E4+"!A<F=V6S!=
-M+"!A<F=V("D[#0H@(" @:68@*"!S=&%T=7,@*0T*"7!E<G)O<B@@(F-P(B I
-M.PT*(" @(')E='5R;B!S=&%T=7,[#0HC96QS90T*(" @($9)3$4@(" @(" J
-M(&9S.PT*(" @($9)3$4@(" @(" J(&9D.PT*(" @(&-H87()8G5F9F5R6R X
-M,3DR(%T[#0H@(" @:6YT"0EN.PT*(" @('-T<G5C="!F=&EM90E7:&5N.PT*
-M(" @('-T<G5C="!S=&%T"0E3=&%T.PT*#0H@(" @9G,@/2!F;W!E;B@@<RP@
-M(G)B(B I.PT*(" @(&EF("@@9G,@/3T@3E5,3" I("![#0H)<&5R<F]R*"!S
-M("D[#0H)<F5T=7)N(#$[#0H@(" @?0T*(" @(&9D(#T@9F]P96XH(&0L(")W
-M8B(@*3L-"B @("!I9B H(&9D(#T]($Y53$P@*2 @>PT*"7!E<G)O<B@@9" I
-M.PT*"69C;&]S92@@9G,@*3L-"@ER971U<FX@,CL-"B @("!]#0H-"B @("!I
-M9B H('!R97-E<G9E7W1I;64@*0T*"6EF("@@9V5T9G1I;64H(&9I;&5N;RAF
-M<RDL("97:&5N("D@*2 @>PT*"2 @("!P97)R;W(H(',@*3L-"@D@(" @<')E
-M<V5R=F5?=&EM92 ](# [#0H)?0T*#0H@(" @9&\@>PT*"6X@/2!F<F5A9"@@
-M8G5F9F5R+" Q+"!S:7IE;V8@8G5F9F5R+"!F<R I.PT*"6EF("@@;B ^(# @
-M*0T*"2 @("!I9B H(&9W<FET92@@8G5F9F5R+" Q+"!N+"!F9" I(#P@," I
-M("![#0H)"7!E<G)O<B@@9" I.PT*"0ER971U<FX@,SL-"@D@(" @?0T*(" @
-M('T@=VAI;&4@*"!N(#X@," I.R @(" -"@T*(" @(&9C;&]S92@@9G,@*3L-
-M"@T*(" @("\J($9I>"!T:6UE('-T86UP("HO#0H@(" @:68@*"!P<F5S97)V
-M95]T:6UE("D-"@EI9B H('-E=&9T:6UE*"!F:6QE;F\H9F0I+" F5VAE;B I
-M("D@('L-"@D@(" @<&5R<F]R*"!S("D[#0H)(" @('!R97-E<G9E7W1I;64@
-M/2 P.PT*"7T-"B @("!F8VQO<V4H(&9D("D[#0H-"B @(" O*B!&:7@@86-C
-M97-S(')I9VAT<R J+PT*(" @(&EF("@@<W1A="@@<RP@)E-T870@*2 I#0H)
-M<&5R<F]R*"!S("D[#0H@(" @96QS92!I9B H(&-H;6]D*"!D+"!3=&%T+G-T
-M7VUO9&4@*2 I#0H)<&5R<F]R*"!D("D[#0H-"B @("!R971U<FX@,#L-"B-E
-M;F1I9@T*?0T*#0H-"@T*#0H-"FEN="!M86EN*"!I;G0@87)G8RP@8VAA<B J
-M(&%R9W9;72 I#0I[#0H@(" @8VAA<B J"7!R;V=N86UE.PT*(" @(&EN= D)
-M=F5R8F]S92 ](# [#0H@(" @:6YT"0EO;FQY7VEF7VYE=V5R/2 P.PT*(" @
-M(&-H87(@*@ES=69F:7@@(#T@3E5,3#L-"B @("!C:&%R("H);6]D90D]($Y5
-M3$P[#0H@(" @8VAA<B J( ED97-T.PT*(" @(&-H87(@*BH)<' [#0H-"B @
-M("!A<F=V(#T@87)G=E]F:7@H("9A<F=C+"!A<F=V("D[#0H-"B @("!P<F]G
-M;F%M92 ](&)A<V5N86UE*" J87)G=BLK("D[#0H-"B @(" O*B!P<F]C97-S
-M('1H92!O<'1I;VYS("HO#0H@(" @=VAI;&4@*"!A<F=V6S!=(" F)B @87)G
-M=ELP75LP72 ]/2 G+2<@*2 @>PT*"7-W:71C:" H(&%R9W9;,%U;,5T@*2 @
-M>PT*"2 @("!C87-E("=.)SH-"@D@(" @(" @("LK87)G=CL-"@D);VYL>5]I
-M9E]N97=E<B ](#$[#0H)"6)R96%K.PT*"2 @("!C87-E("=C)SH-"@D@(" @
-M(" @("LK87)G=CL-"@D)+RH@5V4@86QW87ES(&-O<'DL(')E9V%R9&QE<W,@
-M*B\-"@D)8G)E86L[#0H)(" @(&-A<V4@)W8G.@T*"0DK*V%R9W8[#0H)"79E
-M<F)O<V4@/2 Q.PT*"0EB<F5A:SL-"@D@(" @8V%S92 G5B<Z#0H)"2LK87)G
-M=CL-"@D)<W5F9FEX(#T@*F%R9W8[#0H)"2LK87)G=CL-"@D)8G)E86L[#0H)
-M(" @(&-A<V4@)VTG.@T*"0DK*V%R9W8[#0H)"6UO9&4@/2 J87)G=CL-"@D)
-M*RMA<F=V.PT*"0EB<F5A:SL-"@D@(" @9&5F875L=#H-"@D)9F%T86PH($Y5
-M3$P@*3L-"@E]#0H@(" @?0T*#0H@(" @+RH@4V5P87)A=&4@<V]U<F-E(&9I
-M;&4H<RD@9G)O;2!D97-T(&1I<F5C=&]R>2!O<B!F:6QE("HO#0HC:68@, T*
-M(" @(&EF("@@(6%R9W9;,%T@?'P@(6%R9W9;,5T@*0T*"69A=&%L*" B;6ES
-M<VEN9R!F:6QE<R!O<B!I;G9A;&ED(&1E<W1I;F%T:6]N(B I.PT*(V5L<V4-
-M"B @(" O*B!792!U<V5D('1O(')E<75I<F4@870@;&5A<W0@;VYE(&9I;&4[
-M(&YO="!A;GD@;6]R92 J+PT*(" @(&EF("@@(6%R9W9;,%T@*0T*"69A=&%L
-M*" B;6ES<VEN9R!F:6QE<R!O<B!I;G9A;&ED(&1E<W1I;F%T:6]N(B I.PT*
-M(" @(&EF("@@(6%R9W9;,5T@*0T*"7)E='5R;B P.PT*(V5N9&EF#0H@(" @
-M9F]R("@@<' @/2!A<F=V.R J<' [("LK<' @*0T*"6-O;G1I;G5E.PT*(" @
-M("TM<' [#0H@(" @9&5S=" ]("IP<#L-"B @(" J<' @/2!.54Q,.PT*#0H@
-M(" @+RH@4')O8V5S<R!T:&4@87)G=6UE;G1S("HO#0H@(" @9F]R("@[("IA
-M<F=V.R K*V%R9W8@*2 @>PT*"6-H87(@*B!F(#T@*F%R9W8[#0H)8VAA<B J
-M(&QE868@/2!B87-E;F%M92@@9B I.PT*"6-H87(@=&%R9V5T6R Q,C@@73L-
-M"@T*"7-T<F-P>2@@=&%R9V5T+"!D97-T("D[#0H-"@EI9B H(&ES7V1I<B@@
-M=&%R9V5T("D@*2 @>PT*"2 @("!S=')C870H('1A<F=E="P@(B\B("D[#0H)
-M(" @("\J(&EF('=E('=E<F4@9VEV96X@82!S=69F:7@L('1H96X@861D(&ET
-M(&%S(&%P<')O<')I871E("HO#0H)(" @(&EF("@@<W5F9FEX("D@('L-"@D)
-M8VAA<B J(&1O=" ]('-T<F-H<B@@;&5A9BP@)RXG("D[#0H)"6EF("@@9&]T
-M("D@('L-"@D)(" @('-T<FYC870H('1A<F=E="P@;&5A9BP@9&]T+6QE868@
-M*3L-"@D)(" @('-T<F-A="@@=&%R9V5T+"!S=69F:7@@*3L-"@D)(" @('-T
-M<F-A="@@=&%R9V5T+"!D;W0@*3L-"@D)(" @(&EF("@@=F5R8F]S92 I#0H)
-M"0EP<FEN=&8H("(E<SH@)7,@=VEL;"!B92!I;G-T86QL960@87,@)7,B+ T*
-M"0D)(" @(" @('!R;V=N86UE+"!F+"!S=')R8VAR*'1A<F=E="PG+R<I*S$@
-M*3L-"@D)?2!E;'-E('L-"@D)(" @('-T<F-A="@@=&%R9V5T+"!L96%F("D[
-M#0H)"2 @("!S=')C870H('1A<F=E="P@<W5F9FEX("D[#0H)"7T-"@D@(" @
-M?2!E;'-E('L-"@D)<W1R8V%T*"!T87)G970L(&QE868@*3L-"@D@(" @?0T*
-M"7T-"@T*"6EF("@@86-C97-S*"!F+" P("D@*2 @>PT*"2 @("!C:&%R(&)U
-M9ELR,#!=.PT*"2 @("!S<')I;G1F*"!B=68L(")C86YN;W0@<F5A9" E<R(L
-M(&8@*3L-"@D@(" @9F%T86PH(&)U9B I.PT*"7T-"@T*"6EF("@@;VYL>5]I
-M9E]N97=E<B F)B!I<U]F:6QE*"!T87)G970@*2 F)B A;F5W97(H(&8L('1A
-M<F=E=" I("D@('L-"@D@(" @:68@*"!V97)B;W-E("D-"@D)<')I;G1F*" B
-M)R5S)R!N;W0@;F5W97(@=&AA;B G)7,G7&XB+"!F+"!T87)G970@*3L-"@D@
-M(" @8V]N=&EN=64[#0H)?0T*#0H):68@*"!V97)B;W-E("D-"@D@(" @<')I
-M;G1F*" B<FT@+68@)7-<;B(L('1A<F=E=" I.PT*"6EF("@@8VAM;V0H('1A
-M<F=E="P@,#<W-R I("D-"@D@(" @:68@*"!V97)B;W-E("D-"@D)<&5R<F]R
-M*"!T87)G970@*3L-"@EI9B H('5N;&EN:R@@=&%R9V5T("D@*0T*"2 @("!I
-M9B H('9E<F)O<V4@*0T*"0EP97)R;W(H('1A<F=E=" I.PT*"6EF("@@=F5R
-M8F]S92 I#0H)(" @('!R:6YT9B@@(F-P("UP("5S("5S7&XB+"!F+"!T87)G
-M970@*3L-"@EI9B H(&9I;&5C;W!Y*"!T87)G970L(&8L(#$@*2 I#0H)(" @
-M(')E='5R;B Q.PT*"6EF("@@;6]D92 I("![#0H)(" @(&-H87(@8G5F6R R
-M-34@73L-"@D@(" @<W!R:6YT9B@@8G5F+" B8VAM;V0@)7,@)7-<;B(L(&UO
-M9&4L('1A<F=E=" I.PT*"2 @("!I9B H('9E<F)O<V4@*0T*"0EP<FEN=&8H
-M("(E<UQN(BP@8G5F("D[#0H)(" @('-Y<W1E;2@@8G5F("D[#0H)?0T*(" @
-:('T-"@T*(" @(')E='5R;B P.PT*?0T*#0IE
-
-end
diff --git a/tools/build/packhex.c b/tools/build/packhex.c
deleted file mode 100644
index 3b85a7c927..0000000000
--- a/tools/build/packhex.c
+++ /dev/null
@@ -1,565 +0,0 @@
-
-/***** P A C K H E X . C ************************************************
- *
- * Packhex is a hex-file compaction utility. It attempts to concatenate
- * hex records to produce more size-efficient packaging.
- *
- * Limitations: Input files must be correctly formatted. This utility
- * is not robust enough to detect hex-record formatting
- * errors.
- *
- * Published: May 1993 Embedded Systems Programming magazine
- * "Creating Faster Hex Files"
- *
- * URL: ESP magazine: http://www.embedded.com
- * Source Code: ftp://ftp.mfi.com/pub/espmag/1993/pakhex.zip
- *
- * Author: Mark Gringrich
- *
- * Compiler: Microsoft C 6.0
- * cl /F 1000 packhex.c
- *
- *
- * $Id$
- *
- **************************************************************************/
-
-
-/* #define SMALLER_RECORDS */
-#ifdef SMALLER_RECORDS
-#define MAX_LEN_S1_RECS 128
-#define MAX_LEN_S2_RECS 128
-#define MAX_LEN_S3_RECS 128
-#else
-#define MAX_LEN_S1_RECS 252
-#define MAX_LEN_S2_RECS 251
-#define MAX_LEN_S3_RECS 250
-#endif
-
-
-/*--------------------------------- includes ---------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-#if defined(__unix__) && !defined(EXIT_FAILURE)
-#define EXIT_FAILURE -1
-#define EXIT_SUCCESS 0
-#endif
-
-/*--------------------------------- defines ----------------------------------*/
-
-#define YES 1
-#define MAX_LINE_SIZE 600
-#define EOS '\0'
-
-
-/*---------------------------------- macros ----------------------------------*/
-
-/* Convert ASCII hexadecimal digit to value. */
-
-#define HEX_DIGIT( C ) ( ( ( ( C ) > '9' ) ? ( C ) + 25 : ( C ) ) & 0xF )
-
-
-/*--------------------------------- typedefs ---------------------------------*/
-
-typedef unsigned char Boolean;
-typedef unsigned char Uchar;
-typedef unsigned int Uint;
-typedef unsigned long Ulong;
-
-typedef struct /* Functions and constant returning Hex-record vital stats. */
-{
- Boolean ( *is_data_record )( char * );
- Ulong ( *get_address )( char * );
- Uint ( *get_data_count )( char * );
- const Uint max_data_count;
- char *( *get_data_start )( char * );
- void ( *put_data_record )( Uint, Ulong, char * );
-} Rec_vitals;
-
-
-/*--------------------------- function prototypes ----------------------------*/
-
-Rec_vitals * identify_first_data_record( char *, int );
-Ulong get_ndigit_hex( char *, int );
-
-
-/*----------------------------- Intel Hex format -----------------------------*/
-
-/*
- * Intel Hex data-record layout
- *
- * :aabbbbccd...dee
- *
- * : - header character
- * aa - record data byte count, a 2-digit hex value
- * bbbb - record address, a 4-digit hex value
- * cc - record type, a 2-digit hex value:
- * "00" is a data record
- * "01" is an end-of-data record
- * "02" is an extended-address record
- * "03" is a start record
- * d...d - data (always an even number of chars)
- * ee - record checksum, a 2-digit hex value
- * checksum = 2's complement
- * [ (sum of bytes: aabbbbccd...d) modulo 256 ]
- */
-
-
-Boolean is_intel_data_rec( char * rec_str )
-{
- return( ( rec_str[ 0 ] == ':' ) && ( rec_str[ 8 ] == '0' ) );
-}
-
-Uint get_intel_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 1, 2 ) );
-}
-
-Ulong get_intel_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 3, 4 ) );
-}
-
-char * get_intel_rec_data_start( char * rec_str )
-{
- return( rec_str + 9 );
-}
-
-void put_intel_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = count + ( address >> 8 & 0xff ) + ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- ":%02X%04lX00%s%02X\n", count, address, data_str, (~sum + 1) & 0xff
- );
-}
-
-
-Rec_vitals intel_hex =
-{
- is_intel_data_rec,
- get_intel_rec_address,
- get_intel_rec_data_count,
- 255, /* Maximum data bytes in a record. */
- get_intel_rec_data_start,
- put_intel_data_rec
-};
-
-
-/*------------------------- Motorola S1-record format ------------------------*/
-
-/*
- * Motorola S-record data-record layout
- *
- * Sabbc...cd...dee
- *
- * S - header character
- * a - record type, a 1-digit value:
- * "0" is a header record
- * "1" is a 2-byte-address data record
- * "2" is a 3-byte-address data record
- * "3" is a 4-byte-address data record
- * "7" is a 4-byte-address end-of-data record
- * "8" is a 3-byte-address end-of-data record
- * "9" is a 2-byte-address end-of-data record
- * bb - record length in bytes, a 2-digit hex value
- * (record length doesn't count the header/type
- * chars and checksum byte)
- * c...c - record address, a 4-, 6-, or 8-digit value,
- * depending on record type
- * d...d - data (always an even number of chars)
- * ee - record checksum, a 2-digit hex value
- * checksum = 1's complement
- * [ (sum of all bytes: bbc..cd...d) modulo 256 ]
- */
-
-#define S1_COUNT_OFFSET 3
-
-
-Boolean is_moto_s1_data_rec( char * rec_str )
-{
- return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '1' ) );
-}
-
-Uint get_moto_s1_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S1_COUNT_OFFSET );
-}
-
-Ulong get_moto_s1_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 4, 4 ) );
-}
-
-char * get_moto_s1_rec_data_start( char * rec_str )
-{
- return( rec_str + 8 );
-}
-
-void put_moto_s1_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = S1_COUNT_OFFSET + count +
- ( address >> 8 & 0xff ) + ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- "S1%02X%04lX%s%02X\n",
- count + S1_COUNT_OFFSET, address, data_str, ~sum & 0xff
- );
-}
-
-
-Rec_vitals motorola_s1_rec =
-{
- is_moto_s1_data_rec,
- get_moto_s1_rec_address,
- get_moto_s1_rec_data_count,
- MAX_LEN_S1_RECS, /* Maximum data bytes in a record. */
- get_moto_s1_rec_data_start,
- put_moto_s1_data_rec
-};
-
-
-/*------------------------- Motorola S2-record format ------------------------*/
-
-#define S2_COUNT_OFFSET 4
-
-Boolean is_moto_s2_data_rec( char * rec_str )
-{
- return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '2' ) );
-}
-
-Uint get_moto_s2_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S2_COUNT_OFFSET );
-}
-
-Ulong get_moto_s2_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 4, 6 ) );
-}
-
-char * get_moto_s2_rec_data_start( char * rec_str )
-{
- return( rec_str + 10 );
-}
-
-void put_moto_s2_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = S2_COUNT_OFFSET + count + ( address >> 16 & 0xff ) +
- ( address >> 8 & 0xff ) +
- ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- "S2%02X%06lX%s%02X\n",
- count + S2_COUNT_OFFSET, address, data_str, ~sum & 0xff
- );
-}
-
-
-Rec_vitals motorola_s2_rec =
-{
- is_moto_s2_data_rec,
- get_moto_s2_rec_address,
- get_moto_s2_rec_data_count,
- MAX_LEN_S2_RECS, /* Maximum data bytes in a record. */
- get_moto_s2_rec_data_start,
- put_moto_s2_data_rec
-};
-
-
-/*------------------------- Motorola S3-record format ------------------------*/
-
-#define S3_COUNT_OFFSET 5
-
-Boolean is_moto_s3_data_rec( char * rec_str )
-{
- return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '3' ) );
-}
-
-Uint get_moto_s3_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S3_COUNT_OFFSET );
-}
-
-Ulong get_moto_s3_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 4, 8 ) );
-}
-
-char * get_moto_s3_rec_data_start( char * rec_str )
-{
- return( rec_str + 12 );
-}
-
-void put_moto_s3_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = S3_COUNT_OFFSET + count + ( address >> 24 & 0xff ) +
- ( address >> 16 & 0xff ) +
- ( address >> 8 & 0xff ) +
- ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- "S3%02X%08lX%s%02X\n",
- count + S3_COUNT_OFFSET, address, data_str, ~sum & 0xff
- );
-}
-
-
-Rec_vitals motorola_s3_rec =
-{
- is_moto_s3_data_rec,
- get_moto_s3_rec_address,
- get_moto_s3_rec_data_count,
- MAX_LEN_S3_RECS, /* Maximum data bytes in a record. */
- get_moto_s3_rec_data_start,
- put_moto_s3_data_rec
-};
-
-
-/*-------------------- Put your favorite hex format here ---------------------*/
-
-/*
- * * * * The following is a template for an additional hex format: * * *
- *
- *
- * Boolean is_X_data_rec( char * rec_str ) {}
- *
- * Uint get_X_rec_data_count( char * rec_str ) {}
- *
- * Ulong get_X_rec_address( char * rec_str ) {}
- *
- * char * get_X_rec_data_start( char * rec_str ) {}
- *
- * void put_X_data_rec( Uint count, Ulong address, char * data_str ) {}
- *
- * Rec_vitals X_rec =
- * {
- * is_X_data_rec,
- * get_X_rec_address,
- * get_X_rec_data_count,
- * MAXIMUM DATA BYTES IN A RECORD,
- * get_X_rec_data_start,
- * put_X_data_rec
- * };
- *
- */
-
-/*----------------------------------------------------------------------------*/
-
-
-/*
- * Put address of additional Rec_vitals structures
- * in this array, before the NULL entry.
- */
-
-Rec_vitals *formats[] =
-{
- &intel_hex,
- &motorola_s1_rec,
- &motorola_s2_rec,
- &motorola_s3_rec,
- ( Rec_vitals * ) NULL
-};
-
-
-/**** main *****************************************************************
-*
-*
-* Expects: Nothing (no command-line parameters).
-*
-* Returns: Exit status (EXIT_SUCCESS or EXIT_FAILURE).
-*
-* Reads hex records on the standard input and attempts to
-* splice adjacent data fields together. Results appear on
-* the standard output.
-*
-*******************************************************************************/
-
-int main(
- int argc,
- char **argv
-)
-{
-
- char inbuff[ MAX_LINE_SIZE ], outbuff[ MAX_LINE_SIZE ];
- char *in_dptr, *out_dptr;
- int d_total, d_count, d_excess, n;
- int length;
- Ulong in_rec_addr, out_rec_addr = 0;
- Rec_vitals *rptr;
-
-
- /* Sift through file until first hex record is identified. */
-
- rptr = identify_first_data_record( inbuff, MAX_LINE_SIZE );
- if ( rptr == NULL )
- {
- fputs( "No hex records found.\n", stderr );
- exit( EXIT_FAILURE );
- }
-
-
- /* Attempt data-record splicing until end-of-file is reached. */
- d_total = 0;
- for (;;) {
- if ( rptr->is_data_record( inbuff ) == YES )
- { /* Input record is a data record. */
- d_count = rptr->get_data_count( inbuff );
- in_rec_addr = rptr->get_address( inbuff );
- in_dptr = rptr->get_data_start( inbuff );
-
- if ( d_total == 0 || in_rec_addr != out_rec_addr + d_total )
- { /* Begin a new output record. */
- if ( d_total != 0 )
- rptr->put_data_record( d_total, out_rec_addr, outbuff );
- out_dptr = outbuff;
- n = d_total = d_count;
- out_rec_addr = in_rec_addr;
- }
- else if
- ( ( d_excess = d_total + d_count - rptr->max_data_count ) > 0 )
- { /* Output a maximum-length record, then start a new record. */
- strncat( outbuff, in_dptr, 2 * ( d_count - d_excess ) );
- rptr->put_data_record(
- rptr->max_data_count, out_rec_addr, outbuff
- );
- in_dptr += 2 * ( d_count - d_excess );
- out_dptr = outbuff;
- n = d_total = d_excess;
- out_rec_addr += rptr->max_data_count;
- }
- else
- { /* Append input record's data field with accumulated data. */
- out_dptr = outbuff + ( 2 * d_total );
- d_total += n = d_count;
- }
- strncpy( out_dptr, in_dptr, 2 * n );
- out_dptr[ 2 * n ] = EOS;
- }
- else
- { /* Not a data record;
- * flush accumulated data then echo non-data record.
- */
- if ( d_total != 0 )
- {
- rptr->put_data_record( d_total, out_rec_addr, outbuff );
- d_total = 0;
- }
- puts( inbuff );
- }
-
- inbuff[ MAX_LINE_SIZE - 1 ] = '\0';
- if ( !fgets( inbuff, MAX_LINE_SIZE, stdin ) )
- break;
- if ( inbuff[ MAX_LINE_SIZE - 1 ] ) {
- fprintf( stderr, "Input line too long" );
- exit( 1 );
- }
- length = strlen(inbuff);
- inbuff[length - 1] = '\0';
-
- }
-
-
- return ( EXIT_SUCCESS );
-
-}
-
-
-/**** identify_first_data_record *******************************************
-*
-* Expects: Pointer to hex-record line buffer.
-*
-* Returns: Pointer to hex-record structure (NULL if no match found).
-*
-* Reads the standard input, line by line, searching for a valid
-* record header character. If a valid header is found, a pointer
-* to the hex-record's type structure is returned, otherwise NULL.
-*
-* The input-stream pointer is left pointing to the first valid hex record.
-*
-*******************************************************************************/
-
-Rec_vitals * identify_first_data_record( char * buff_ptr, int max_length )
-{
- Rec_vitals ** ptr;
- int length;
-
-
-
- for ( ;; ) {
-
- buff_ptr[ max_length - 1 ] = '\0';
- if ( !fgets( buff_ptr, max_length, stdin ) )
- break;
- if ( buff_ptr[ max_length - 1 ] ) {
- fprintf( stderr, "Input line too long" );
- exit( 1 );
- }
- length = strlen(buff_ptr);
- buff_ptr[length - 1] = '\0';
-
- for ( ptr = formats ; *ptr != ( Rec_vitals * ) NULL ; ptr++ )
- if ( ( *ptr )->is_data_record( buff_ptr ) == YES )
- return( *ptr ); /* Successful return. */
-
- puts( buff_ptr ); /* Echo non-hex-record line. */
- }
-
- return( ( Rec_vitals * ) NULL ); /* Unsuccessful return. */
-}
-
-
-/**** get_ndigit_hex *******************************************************
-*
-* Expects: Pointer to first ASCII hexadecimal digit, number of digits.
-*
-* Returns: Value of hexadecimal string as an unsigned long.
-*
-*******************************************************************************/
-
-Ulong get_ndigit_hex( char * cptr, int digits )
-{
- Ulong value;
-
- for ( value = 0 ; --digits >= 0 ; cptr++ )
- value = ( value * 16L ) + HEX_DIGIT( *cptr );
-
- return( value );
-}
diff --git a/tools/build/rcs-clean.in b/tools/build/rcs-clean.in
deleted file mode 100644
index 83fed05128..0000000000
--- a/tools/build/rcs-clean.in
+++ /dev/null
@@ -1,73 +0,0 @@
-#!@KSH@ -p
-#
-# $Id$
-#
-# Delete all files from the current directory that can be recreated
-# via RCS 'co' commonds
-# Used by 'make clobber'
-#
-
-progname=${0##*/} # fast basename hack for ksh, bash
-
-USAGE=\
-"usage: $progname [ -v ]"
-
-fatal() {
- if [ "$1" ]
- then
- echo $* >&2
- fi
- echo "$USAGE" 1>&2
- exit 1
-}
-
-#
-# process the options
-#
-
-verbose=""
-
-while getopts v OPT
-do
- case "$OPT" in
- v)
- verbose="yes";;
- *)
- fatal
- esac
-done
-
-let $((shiftcount = $OPTIND - 1))
-shift $shiftcount
-
-args=$*
-[ "$args" ] && fatal
-
-[ -d RCS/. ] || exit 0
-
-# there is probably a better way to do this
-
-rcs_files=`echo RCS/*,v | sed -e 's?RCS/??g' -e's/,v//g'`
-
-kills=""
-for f in $rcs_files
-do
- # build list of all files in RCS/*,v that are *not* locked
- if [ -f $f ] && [ ! -w $f ] && [ -f RCS/$f,v ]
- then
- locked=`rlog -L -R $f`
- [ "$locked" = "" ] && kills="$kills $f"
- fi
-done
-
-if [ "$kills" ]
-then
- [ "$verbose" ] && echo rm -f $kills
- rm -f $kills
-fi
-
-exit 0
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
diff --git a/tools/build/scripts/Makefile.in b/tools/build/scripts/Makefile.in
deleted file mode 100644
index 753bfafaa5..0000000000
--- a/tools/build/scripts/Makefile.in
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# $Id$
-#
-# RTEMS build tools
-# NOTE: of course we can't use any of these tools
-# in this Makefile. Most notably: install-if-change
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-include $(RTEMS_ROOT)/make/rtems.cfg
-
-DESTDIR=$(PROJECT_RELEASE)/build-tools
-
-BUILD_PGMS=install-if-change rcs-clean lock-directory unlock-directory
-PGMS = $(BUILD_PGMS) search-id.sh
-
-CLEAN_ADDITIONS += $(BUILD_PGMS)
-
-INSTALLED_PGMS=$(PGMS:%=$(DESTDIR)/%)
-
-all: $(DESTDIR) $(PGMS) install
-
-$(DESTDIR):
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-$(INSTALLED_PGMS): $(PGMS)
- @INSTALL@ $(INSTBINFLAGS) $^ $(DESTDIR)
-
-install: $(DESTDIR) $(INSTALLED_PGMS)
diff --git a/tools/build/scripts/README b/tools/build/scripts/README
deleted file mode 100644
index 0738a5830e..0000000000
--- a/tools/build/scripts/README
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# $Id$
-#
-
-Misc. support tools for RTEMS workspaces.
-More will be added later as they are converted from Teamware
-to CVS.
-
-install-if-change
- Smart install script that also can append suffixes as it
- installs (suffixes used for debug and profile variants).
- Requires bash or ksh.
-
-rcs-clean
- deletes all files from the current directory that can be
- re-created from RCS. Careful to not delete locked files.
- May be used by 'gmake clobber'
-
-lock-directory
-unlock-directory
- traverse a directory structure making it unwritable.
- Useful to keep people from accidentally overwriting
- "released" trees if they get confused about which
- module they have loaded.
diff --git a/tools/build/scripts/install-if-change.in b/tools/build/scripts/install-if-change.in
deleted file mode 100644
index b2f3cb04bb..0000000000
--- a/tools/build/scripts/install-if-change.in
+++ /dev/null
@@ -1,142 +0,0 @@
-#!@KSH@ -p
-#
-# Either bash or ksh will be ok for this; requires (( )) arithmetic
-# (-p above just says to not parse $ENV file; makes it faster for
-# those of us who set $ENV)
-#
-# install files if they have changed by running 'cmp', then 'install'
-# as necessary.
-#
-# Optionally, can append a suffix before last existing suffix (if any)
-#
-# NOTE
-# We avoid using typical install(1M) programs since they have
-# large variability across systems and we also need to support ou
-# -V option.
-# So we just copy and chmod by hand.
-#
-# $Id$
-#
-
-progname=`basename $0`
-#progname=${0##*/} # fast basename hack for ksh, bash
-
-USAGE=\
-"usage: $progname [ -vmV ] file [ file ... ] dest-directory-or-file
- -v -- verbose
- -V suffix -- suffix to append to targets (before any . suffix)
- eg: -V _g would change 'foo' to 'foo_g' and
- 'libfoo.a' to 'libfoo_g.a'
- -m mode -- mode for new file(s)"
-
-fatal() {
- if [ "$1" ]
- then
- echo $* >&2
- fi
- echo "$USAGE" 1>&2
- exit 1
-}
-
-#
-# process the options
-#
-
-verbose=""
-suffix=""
-mode=""
-
-while getopts vm:V: OPT
-do
- case "$OPT" in
- v)
- verbose="yes";;
- V)
- eval suffix=$OPTARG;;
- m)
- mode="$OPTARG";;
- *)
- fatal
- esac
-done
-
-shiftcount=`expr $OPTIND - 1`
-shift $shiftcount
-
-args=$*
-
-#
-# Separate source file(s) from dest directory or file
-#
-
-files=""
-dest=""
-for d in $args
-do
- files="$files $dest"
- dest=$d
-done
-
-if [ ! "$files" ] || [ ! "$dest" ]
-then
- fatal "missing files or invalid destination"
-fi
-
-#
-# Process the arguments
-#
-
-targets=""
-for f in $files
-do
- # leaf=`basename $f`
- leaf=${f##*/} # fast basename hack for ksh, bash
-
- target=$dest
- if [ -d $dest ]
- then
- # if we were given a suffix, then add it as appropriate
- if [ "$suffix" ]
- then
- case $f in
- *.*)
- # leaf=`echo $leaf |
- # /bin/sed "s/\([~\.]*\)\.\(.*\)$/\1$suffix.\2/"`
- # ksh,bash hack for above sed script
- leaf=${leaf%%.*}$suffix.${leaf#*.}
-
- [ "$verbose" = "yes" ] &&
- echo "$progname: $f will be installed as $leaf"
- ;;
- *)
- leaf=$leaf$suffix;;
- esac
- fi
- target=$target/$leaf
- fi
-
- [ ! -r $f ] && fatal "can not read $f"
-
- if cmp -s $f $target
- then
- [ "$verbose" = "yes" ] && echo "'$f' not newer than '$target'"
- else
- [ "$verbose" = "yes" ] && echo "rm -f $target"
- rm -f $target
- echo "cp -p $f $target"
- cp -p $f $target || exit 1
- targets="$targets $target" # keep list for chmod below
- fi
-done
-
-if [ "$mode" -a "$targets" ]
-then
- [ "$verbose" = "yes" ] && echo "chmod $mode $targets"
- chmod $mode $targets
-fi
-
-exit 0
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
diff --git a/tools/build/scripts/lock-directory.in b/tools/build/scripts/lock-directory.in
deleted file mode 100644
index 1c205cdec0..0000000000
--- a/tools/build/scripts/lock-directory.in
+++ /dev/null
@@ -1,43 +0,0 @@
-#!@KSH@
-#
-# $Id$
-#
-# Make a directory write protected
-# Used to write protect the install point after a build
-# to prevent inadvertant overwriting.
-#
-
-# is a particular command available on this machine?
-#
-cmd_avail()
-{
- set -- `type $1 2>&1`
- if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ]
- then
- return 1
- else
- return 0
- fi
-}
-
-lock_directory() {
- l_dir=$1/. # get any symlink out of the way using '.'
- if [ -d $l_dir ]
- then
- find $l_dir -type d -perm -0200 -print | $XARGS chmod -w
- fi
-}
-
-# Use gnu xargs if available; faster, more reliable in general
-XARGS=xargs
-cmd_avail gxargs && XARGS=gxargs
-
-for dir
-do
- lock_directory $dir
-done
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
-
diff --git a/tools/build/scripts/rcs-clean.in b/tools/build/scripts/rcs-clean.in
deleted file mode 100644
index 83fed05128..0000000000
--- a/tools/build/scripts/rcs-clean.in
+++ /dev/null
@@ -1,73 +0,0 @@
-#!@KSH@ -p
-#
-# $Id$
-#
-# Delete all files from the current directory that can be recreated
-# via RCS 'co' commonds
-# Used by 'make clobber'
-#
-
-progname=${0##*/} # fast basename hack for ksh, bash
-
-USAGE=\
-"usage: $progname [ -v ]"
-
-fatal() {
- if [ "$1" ]
- then
- echo $* >&2
- fi
- echo "$USAGE" 1>&2
- exit 1
-}
-
-#
-# process the options
-#
-
-verbose=""
-
-while getopts v OPT
-do
- case "$OPT" in
- v)
- verbose="yes";;
- *)
- fatal
- esac
-done
-
-let $((shiftcount = $OPTIND - 1))
-shift $shiftcount
-
-args=$*
-[ "$args" ] && fatal
-
-[ -d RCS/. ] || exit 0
-
-# there is probably a better way to do this
-
-rcs_files=`echo RCS/*,v | sed -e 's?RCS/??g' -e's/,v//g'`
-
-kills=""
-for f in $rcs_files
-do
- # build list of all files in RCS/*,v that are *not* locked
- if [ -f $f ] && [ ! -w $f ] && [ -f RCS/$f,v ]
- then
- locked=`rlog -L -R $f`
- [ "$locked" = "" ] && kills="$kills $f"
- fi
-done
-
-if [ "$kills" ]
-then
- [ "$verbose" ] && echo rm -f $kills
- rm -f $kills
-fi
-
-exit 0
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
diff --git a/tools/build/scripts/search-id.sh b/tools/build/scripts/search-id.sh
deleted file mode 100644
index a94d2d7cc9..0000000000
--- a/tools/build/scripts/search-id.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-# $Id$
-#
-
-find $1 -type f -a ! -name "*.scn" -a ! -name "bsp_specs" -a \
- -print > /tmp/$$.0
-find $1 -type f -a ! -name "*.scn" -a ! -name "bsp_specs" -a \
- -exec grep -l '$Id' {} \; > /tmp/$$.1
-
-diff /tmp/$$.0 /tmp/$$.1 > /tmp/$$.2
-
-grep "<" /tmp/$$.2 | sed 's/< //' >&1
-
-rm -f /tmp/$$*
diff --git a/tools/build/scripts/unlock-directory.in b/tools/build/scripts/unlock-directory.in
deleted file mode 100644
index c63ceff881..0000000000
--- a/tools/build/scripts/unlock-directory.in
+++ /dev/null
@@ -1,41 +0,0 @@
-#!@KSH@
-#
-# $Id$
-#
-# Unlock a directory processed by lock_directory
-#
-
-# is a particular command available on this machine?
-#
-cmd_avail()
-{
- set -- `type $1 2>&1`
- if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ]
- then
- return 1
- else
- return 0
- fi
-}
-
-unlock_directory() {
- ul_dir=$1/. # get any symlink out of the way using '.'
- if [ -d $ul_dir ]
- then
- find $ul_dir -type d ! -perm -0222 -print | $XARGS -t chmod +w
- fi
-}
-
-# Use gnu xargs if available; faster, more reliable in general
-XARGS=xargs
-cmd_avail gxargs && XARGS=gxargs
-
-for dir
-do
- unlock_directory $dir
-done
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
-
diff --git a/tools/build/search-id.sh b/tools/build/search-id.sh
deleted file mode 100755
index a94d2d7cc9..0000000000
--- a/tools/build/search-id.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-# $Id$
-#
-
-find $1 -type f -a ! -name "*.scn" -a ! -name "bsp_specs" -a \
- -print > /tmp/$$.0
-find $1 -type f -a ! -name "*.scn" -a ! -name "bsp_specs" -a \
- -exec grep -l '$Id' {} \; > /tmp/$$.1
-
-diff /tmp/$$.0 /tmp/$$.1 > /tmp/$$.2
-
-grep "<" /tmp/$$.2 | sed 's/< //' >&1
-
-rm -f /tmp/$$*
diff --git a/tools/build/src/Makefile.in b/tools/build/src/Makefile.in
deleted file mode 100644
index 52942d909f..0000000000
--- a/tools/build/src/Makefile.in
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
-includedir = @includedir@
-manext = 1
-mandir = @mandir@/man$(manext)
-
-# FIXME: $EXEEXT should be set in a central cfg-file used for native
-# compiling (e.g. gcc.cfg) instead of setting EXEEXE here.
-EXEEXT=@EXEEXT@
-
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# we use host compiler in this directory
-USE_HOST_COMPILER=yes
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=cklength eolstrip packhex unhex
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=$(ARCH)/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(CC_FILES) $(H_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
-
-# FIXME: building into $(ARCH) doesn't make sense for host programs
-PGMS=$(ARCH)/cklength$(EXEEXT) $(ARCH)/eolstrip$(EXEEXT) \
- $(ARCH)/packhex$(EXEEXT) $(ARCH)/unhex$(EXEEXT)
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS += $(HOST_ARCH)
-CLOBBER_ADDITIONS +=
-
-DESTDIR=${PROJECT_RELEASE}/build-tools
-
-$(DESTDIR):
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-all: $(ARCH) $(DESTDIR) $(SRCS) $(PGMS)
- @INSTALL@ $(INSTBINFLAGS) $(PGMS) $(DESTDIR)
diff --git a/tools/build/src/cklength.c b/tools/build/src/cklength.c
deleted file mode 100644
index 624bf25e70..0000000000
--- a/tools/build/src/cklength.c
+++ /dev/null
@@ -1,377 +0,0 @@
-/*
- * cklength - check the length of lines in a file
- *
- * This program check to see if the files passed to it on the command line
- * contain a line which exceeds the maximum allowable length. The default
- * maximum line length is 80.
- *
- * usage: cklength [ -v ] [ arg ... ] files...
- * -l length -- maximum line length
- * -v -- verbose
- *
- * $Id$
- */
-
-#define GETOPTARGS "l:nNv"
-
-char *USAGE = "\
-usage: cklength [ -v ] [ arg ... ] files... \n\
- -l length -- maximum line length\n\
- -n -- report line numbers for offending lines\n\
- -N -- report line numbers and length for offending lines\n\
- -v -- verbose\n\
-\n\
-Print the name of files which have at least 1 line which exceeds the\n\
-maximum line length. The default maximum line length is 80.\n\
-";
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <memory.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-
-#define BUFFER_SIZE 512
-
-#define SUCCESS 0
-#define FAILURE -1
-#define Failed(x) (((int) (x)) == FAILURE)
-#define TRUE 1
-#define FALSE 0
-#define STREQ(a,b) (strcmp(a,b) == 0)
-#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
-
-/*
- * Definitions for unsigned "ints"; especially for use in data structures
- * that will be shared among (potentially) different cpu's (we punt on
- * byte ordering problems tho)
- */
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned long u32;
-
-/*
- * vars controlled by command line options
- */
-
-int verbose = FALSE; /* be verbose */
-int report_line_numbers = FALSE; /* report line numbers of offenders */
-int report_line_length = FALSE; /* report line length of offenders */
-
-int line_length = 80; /* maximum allowable line length */
-
-extern char *optarg; /* getopt(3) control vars */
-extern int optind, opterr;
-
-char *progname; /* for error() */
-
-int process(char *arg);
-void error(int errn, ...);
-long getparm(char *s, long min, long max, char *msg);
-
-#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define ERR_FATAL (ERR_ERRNO / 2) /* fatal error ; no return */
-#define ERR_ABORT (ERR_ERRNO / 4) /* fatal error ; abort */
-#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
-
-#define stol(p) strtol(p, (char **) NULL, 0)
-int Open(), Read(), Write();
-
-int main(
- int argc,
- char **argv
-)
-{
- register int c;
- int showusage = FALSE; /* usage error? */
- int rc = 0;
-
- /*
- * figure out invocation leaf-name
- */
-
- if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
- progname = argv[0];
- else
- progname++;
-
- argv[0] = progname; /* for getopt err reporting */
-
- /*
- * Check options and arguments.
- */
-
- opterr = 0; /* we'll report all errors */
- while ((c = getopt(argc, argv, GETOPTARGS)) != EOF)
- switch (c)
- {
- case 'l': /* line length */
- line_length = atoi( optarg );
- if ( line_length < 0 || line_length > BUFFER_SIZE )
- error(ERR_FATAL, "(%d) is illegal line length\n",line_length);
- break;
-
- case 'n': /* toggle report_line_numbers */
- report_line_numbers = ! report_line_numbers;
- break;
-
- case 'N': /* toggle both reports */
- report_line_numbers = ! report_line_numbers;
- report_line_length = ! report_line_length;
- break;
-
- case 'v': /* toggle verbose */
- verbose = ! verbose;
- break;
-
- case '?':
- showusage = TRUE;
- }
-
- if (showusage)
- {
- (void) fprintf(stderr, "%s", USAGE);
- exit(1);
- }
-
- /*
- * traverse and process the arguments
- */
-
- for ( ; argv[optind]; optind++)
- if (Failed(process(argv[optind])))
- rc = FAILURE;
-
- return rc;
-}
-
-
-/*
- * process(arg)
- */
-
-int
-process(char *arg)
-{
- FILE *in;
- char *bptr;
- char buffer[ BUFFER_SIZE ];
- int line_number;
- int length;
- int count;
- int rc = SUCCESS; /* succeed by default */
-
- in = fopen( arg, "r" );
- if (!in)
- error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
-
- count = 0;
-
- for ( line_number=1 ; ; line_number++ ) {
- bptr = fgets( buffer, BUFFER_SIZE, in );
- if (!bptr)
- break;
-
- /*
- * Don't count the carriage return.
- */
-
- length = strlen( buffer ) - 1;
-
- if ( length <= line_length )
- continue;
-
- if ( count == 0 ) {
- fprintf( stderr, "%s\n", arg );
- if ( !report_line_numbers )
- break;
- }
-
- if ( verbose )
- fprintf( stderr, "TOO LONG:%d: %s\n", line_number, buffer );
-
- if ( report_line_numbers ) {
- if ( report_line_length )
- fprintf( stderr, "%d: %d\n" , line_number, length );
- else
- fprintf( stderr, "%d\n" , line_number );
- }
-
- count++;
-
- }
-
- fclose( in );
- return rc;
-}
-
-/*
- * error(errn, arglist)
- * report an error to stderr using printf(3) conventions.
- * Any output is preceded by '<progname>: '
- *
- * Uses ERR_FATAL bit to request exit(errn)
- * ERR_ABORT to request abort()
- * ERR_ERRNO to indicate use of errno instead of argument.
- *
- * If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
- * associated error message is appended to the output.
- */
-
-/*VARARGS*/
-
-void
-error(int error_flag, ...)
-{
- va_list arglist;
- register char *format;
- int local_errno;
-
- extern int errno;
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- local_errno = error_flag & ~ERR_MASK;
- if (error_flag & ERR_ERRNO) /* use errno? */
- local_errno = errno;
-
- va_start(arglist, error_flag);
- format = va_arg(arglist, char *);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, format, arglist);
- va_end(arglist);
-
- if (local_errno)
- (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
-
- (void) fflush(stderr);
-
- if (error_flag & (ERR_FATAL | ERR_ABORT))
- {
- if (error_flag & ERR_FATAL)
- {
- error(0, "fatal error, exiting");
- exit(local_errno ? local_errno : 1);
- }
- else
- {
- error(0, "fatal error, aborting");
- abort();
- }
- }
-}
-
-long
-getparm(char *s,
- long min,
- long max,
- char *msg)
-{
- long val;
-
- if ( ! strchr("0123456789-", *s))
- {
- error(ERR_FATAL, "'%s' is not a number", s);
- return min;
- }
-
- val = strtol(s, (char **) NULL, 0);
- if ((val < min) || (val > max))
- {
- if (min == max)
- error(ERR_FATAL, "%s can only be %ld", s, min);
- else
- error(ERR_FATAL, "%s must be between %ld and %ld", msg, min, max);
- }
-
- return val;
-}
-
-
-/*
- * Open()
- * Perform open(2), returning the file descriptor. Prints
- * error message if open fails.
- */
-
-int
-Open(char *file,
- int oflag,
- int mode)
-{
- int O_fd;
-
- if (Failed(O_fd = open(file, oflag, mode)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "open('%s', 0x%x, 0%o) failed", file, oflag, mode
- );
-
- return O_fd;
-}
-
-/*
- * Read()
- * Perform read(2); prints error message if fails.
- */
-
-int
-Read(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = read(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "read(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
-
-/*
- * Write()
- * Perform write(2); prints error message if fails.
- */
-
-int
-Write(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = write(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "write(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
diff --git a/tools/build/src/config.h.in b/tools/build/src/config.h.in
deleted file mode 100644
index cebd2bcad4..0000000000
--- a/tools/build/src/config.h.in
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * This file is editted automatically by autoconf.
- *
- * $Id$
- */
-
-/* Define if you have the strerror function. */
-#undef HAVE_STRERROR
-
diff --git a/tools/build/src/eolstrip.c b/tools/build/src/eolstrip.c
deleted file mode 100644
index c944ae6663..0000000000
--- a/tools/build/src/eolstrip.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * eolstrip - strip white space from end of lines
- *
- * This program strips the white space from the end of every line in the
- * specified program.
- *
- * usage: eolstrip [ -v ] [ arg ... ] files...
- * -v -- verbose
- *
- * $Id$
- */
-
-#define GETOPTARGS "vt"
-
-char *USAGE = "\
-usage: cklength [ -v ] [ arg ... ] files... \n\
- -v -- verbose\n\
- -t -- test only .. DO NOT OVERWRITE FILE!!!\n\
-\n\
-Strip the white space from the end of every line on the list of files.\n\
-";
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <memory.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-
-#define BUFFER_SIZE 2048
-#define MAX_PATH 2048
-
-#define SUCCESS 0
-#define FAILURE -1
-#define Failed(x) (((int) (x)) == FAILURE)
-#define TRUE 1
-#define FALSE 0
-#define STREQ(a,b) (strcmp(a,b) == 0)
-#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
-
-/*
- * Definitions for unsigned "ints"; especially for use in data structures
- * that will be shared among (potentially) different cpu's (we punt on
- * byte ordering problems tho)
- */
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned long u32;
-
-/*
- * vars controlled by command line options
- */
-
-int verbose = FALSE; /* be verbose */
-int test_only = FALSE; /* test only */
-
-extern char *optarg; /* getopt(3) control vars */
-extern int optind, opterr;
-
-char *progname; /* for error() */
-
-int process(char *arg);
-void error(int errn, ...);
-long getparm(char *s, long min, long max, char *msg);
-
-#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define ERR_FATAL (ERR_ERRNO / 2) /* fatal error ; no return */
-#define ERR_ABORT (ERR_ERRNO / 4) /* fatal error ; abort */
-#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
-
-#define stol(p) strtol(p, (char **) NULL, 0)
-int Open(), Read(), Write();
-
-int main(
- int argc,
- char **argv
-)
-{
- register int c;
- int showusage = FALSE; /* usage error? */
- int rc = 0;
-
- /*
- * figure out invocation leaf-name
- */
-
- if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
- progname = argv[0];
- else
- progname++;
-
- argv[0] = progname; /* for getopt err reporting */
-
- /*
- * Check options and arguments.
- */
-
- opterr = 0; /* we'll report all errors */
- while ((c = getopt(argc, argv, GETOPTARGS)) != EOF)
- switch (c)
- {
- case 't': /* toggle test only mode */
- test_only = ! test_only;
- break;
-
- case 'v': /* toggle verbose */
- verbose = ! verbose;
- break;
-
- case '?':
- showusage = TRUE;
- }
-
- if (showusage)
- {
- (void) fprintf(stderr, "%s", USAGE);
- exit(1);
- }
-
- /*
- * traverse and process the arguments
- */
-
- for ( ; argv[optind]; optind++)
- if (Failed(process(argv[optind])))
- rc = FAILURE;
-
- return rc;
-}
-
-
-/*
- * process(arg)
- */
-
-int
-process(char *arg)
-{
- FILE *in;
- FILE *out = (FILE *) 0;
- char outname[ MAX_PATH ];
- char *bptr;
- char buffer[ BUFFER_SIZE ];
- int length;
- int line_number;
- int rc = SUCCESS; /* succeed by default */
-
- in = fopen( arg, "r" );
- if (!in)
- error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
-
- if ( !test_only ) {
- sprintf( outname, "%s.eoltmp", arg );
-
- out = fopen( outname, "w" );
- if (!out)
- error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg );
- }
-
- if ( verbose )
- fprintf( stderr, "Processing %s\n", arg );
-
- for ( line_number=1 ; ; line_number++ ) {
- bptr = fgets( buffer, BUFFER_SIZE, in );
- if (!bptr)
- break;
-
- /*
- * Don't count the carriage return.
- */
-
- length = strlen( buffer ) - 1;
-
- if ( buffer[ length ] != '\n' )
- error(ERR_ERRNO|ERR_FATAL, "Line %d too long in %s\n", line_number, arg);
-
- while ( isspace( (int) buffer[ length ] ) )
- buffer[ length-- ] = '\0';
-
- if ( test_only ) {
- fprintf( stderr, "%s\n", arg );
- break;
- }
-
- fprintf( out, "%s\n", buffer );
- }
-
- fclose( in );
- if ( !test_only ) {
- fclose( out );
- rename( outname, arg );
- }
- return rc;
-}
-
-/*
- * error(errn, arglist)
- * report an error to stderr using printf(3) conventions.
- * Any output is preceded by '<progname>: '
- *
- * Uses ERR_FATAL bit to request exit(errn)
- * ERR_ABORT to request abort()
- * ERR_ERRNO to indicate use of errno instead of argument.
- *
- * If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
- * associated error message is appended to the output.
- */
-
-/*VARARGS*/
-
-void
-error(int error_flag, ...)
-{
- va_list arglist;
- register char *format;
- int local_errno;
-
- extern int errno;
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- local_errno = error_flag & ~ERR_MASK;
- if (error_flag & ERR_ERRNO) /* use errno? */
- local_errno = errno;
-
- va_start(arglist, error_flag);
- format = va_arg(arglist, char *);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, format, arglist);
- va_end(arglist);
-
- if (local_errno)
- (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
- else
- (void) fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (ERR_FATAL | ERR_ABORT))
- {
- if (error_flag & ERR_FATAL)
- {
- error(0, "fatal error, exiting");
- exit(local_errno ? local_errno : 1);
- }
- else
- {
- error(0, "fatal error, aborting");
- abort();
- }
- }
-}
-
-long
-getparm(char *s,
- long min,
- long max,
- char *msg)
-{
- long val;
-
- if ( ! strchr("0123456789-", *s))
- {
- error(ERR_FATAL, "'%s' is not a number", s);
- return min;
- }
-
- val = strtol(s, (char **) NULL, 0);
- if ((val < min) || (val > max))
- {
- if (min == max)
- error(ERR_FATAL, "%s can only be %ld", s, min);
- else
- error(ERR_FATAL, "%s must be between %ld and %ld", msg, min, max);
- }
-
- return val;
-}
-
-
-/*
- * Open()
- * Perform open(2), returning the file descriptor. Prints
- * error message if open fails.
- */
-
-int
-Open(char *file,
- int oflag,
- int mode)
-{
- int O_fd;
-
- if (Failed(O_fd = open(file, oflag, mode)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "open('%s', 0x%x, 0%o) failed", file, oflag, mode
- );
-
- return O_fd;
-}
-
-/*
- * Read()
- * Perform read(2); prints error message if fails.
- */
-
-int
-Read(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = read(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "read(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
-
-/*
- * Write()
- * Perform write(2); prints error message if fails.
- */
-
-int
-Write(int file,
- char *buffer,
- unsigned int count)
-{
- int nbytes;
-
- if (Failed(nbytes = write(file, buffer, count)))
- error(
- ERR_ERRNO | ERR_FATAL,
- "write(%d, 0x%x, %d) failed", file, buffer, count
- );
-
- return nbytes;
-}
diff --git a/tools/build/src/packhex.c b/tools/build/src/packhex.c
deleted file mode 100644
index 3b85a7c927..0000000000
--- a/tools/build/src/packhex.c
+++ /dev/null
@@ -1,565 +0,0 @@
-
-/***** P A C K H E X . C ************************************************
- *
- * Packhex is a hex-file compaction utility. It attempts to concatenate
- * hex records to produce more size-efficient packaging.
- *
- * Limitations: Input files must be correctly formatted. This utility
- * is not robust enough to detect hex-record formatting
- * errors.
- *
- * Published: May 1993 Embedded Systems Programming magazine
- * "Creating Faster Hex Files"
- *
- * URL: ESP magazine: http://www.embedded.com
- * Source Code: ftp://ftp.mfi.com/pub/espmag/1993/pakhex.zip
- *
- * Author: Mark Gringrich
- *
- * Compiler: Microsoft C 6.0
- * cl /F 1000 packhex.c
- *
- *
- * $Id$
- *
- **************************************************************************/
-
-
-/* #define SMALLER_RECORDS */
-#ifdef SMALLER_RECORDS
-#define MAX_LEN_S1_RECS 128
-#define MAX_LEN_S2_RECS 128
-#define MAX_LEN_S3_RECS 128
-#else
-#define MAX_LEN_S1_RECS 252
-#define MAX_LEN_S2_RECS 251
-#define MAX_LEN_S3_RECS 250
-#endif
-
-
-/*--------------------------------- includes ---------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-#if defined(__unix__) && !defined(EXIT_FAILURE)
-#define EXIT_FAILURE -1
-#define EXIT_SUCCESS 0
-#endif
-
-/*--------------------------------- defines ----------------------------------*/
-
-#define YES 1
-#define MAX_LINE_SIZE 600
-#define EOS '\0'
-
-
-/*---------------------------------- macros ----------------------------------*/
-
-/* Convert ASCII hexadecimal digit to value. */
-
-#define HEX_DIGIT( C ) ( ( ( ( C ) > '9' ) ? ( C ) + 25 : ( C ) ) & 0xF )
-
-
-/*--------------------------------- typedefs ---------------------------------*/
-
-typedef unsigned char Boolean;
-typedef unsigned char Uchar;
-typedef unsigned int Uint;
-typedef unsigned long Ulong;
-
-typedef struct /* Functions and constant returning Hex-record vital stats. */
-{
- Boolean ( *is_data_record )( char * );
- Ulong ( *get_address )( char * );
- Uint ( *get_data_count )( char * );
- const Uint max_data_count;
- char *( *get_data_start )( char * );
- void ( *put_data_record )( Uint, Ulong, char * );
-} Rec_vitals;
-
-
-/*--------------------------- function prototypes ----------------------------*/
-
-Rec_vitals * identify_first_data_record( char *, int );
-Ulong get_ndigit_hex( char *, int );
-
-
-/*----------------------------- Intel Hex format -----------------------------*/
-
-/*
- * Intel Hex data-record layout
- *
- * :aabbbbccd...dee
- *
- * : - header character
- * aa - record data byte count, a 2-digit hex value
- * bbbb - record address, a 4-digit hex value
- * cc - record type, a 2-digit hex value:
- * "00" is a data record
- * "01" is an end-of-data record
- * "02" is an extended-address record
- * "03" is a start record
- * d...d - data (always an even number of chars)
- * ee - record checksum, a 2-digit hex value
- * checksum = 2's complement
- * [ (sum of bytes: aabbbbccd...d) modulo 256 ]
- */
-
-
-Boolean is_intel_data_rec( char * rec_str )
-{
- return( ( rec_str[ 0 ] == ':' ) && ( rec_str[ 8 ] == '0' ) );
-}
-
-Uint get_intel_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 1, 2 ) );
-}
-
-Ulong get_intel_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 3, 4 ) );
-}
-
-char * get_intel_rec_data_start( char * rec_str )
-{
- return( rec_str + 9 );
-}
-
-void put_intel_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = count + ( address >> 8 & 0xff ) + ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- ":%02X%04lX00%s%02X\n", count, address, data_str, (~sum + 1) & 0xff
- );
-}
-
-
-Rec_vitals intel_hex =
-{
- is_intel_data_rec,
- get_intel_rec_address,
- get_intel_rec_data_count,
- 255, /* Maximum data bytes in a record. */
- get_intel_rec_data_start,
- put_intel_data_rec
-};
-
-
-/*------------------------- Motorola S1-record format ------------------------*/
-
-/*
- * Motorola S-record data-record layout
- *
- * Sabbc...cd...dee
- *
- * S - header character
- * a - record type, a 1-digit value:
- * "0" is a header record
- * "1" is a 2-byte-address data record
- * "2" is a 3-byte-address data record
- * "3" is a 4-byte-address data record
- * "7" is a 4-byte-address end-of-data record
- * "8" is a 3-byte-address end-of-data record
- * "9" is a 2-byte-address end-of-data record
- * bb - record length in bytes, a 2-digit hex value
- * (record length doesn't count the header/type
- * chars and checksum byte)
- * c...c - record address, a 4-, 6-, or 8-digit value,
- * depending on record type
- * d...d - data (always an even number of chars)
- * ee - record checksum, a 2-digit hex value
- * checksum = 1's complement
- * [ (sum of all bytes: bbc..cd...d) modulo 256 ]
- */
-
-#define S1_COUNT_OFFSET 3
-
-
-Boolean is_moto_s1_data_rec( char * rec_str )
-{
- return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '1' ) );
-}
-
-Uint get_moto_s1_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S1_COUNT_OFFSET );
-}
-
-Ulong get_moto_s1_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 4, 4 ) );
-}
-
-char * get_moto_s1_rec_data_start( char * rec_str )
-{
- return( rec_str + 8 );
-}
-
-void put_moto_s1_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = S1_COUNT_OFFSET + count +
- ( address >> 8 & 0xff ) + ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- "S1%02X%04lX%s%02X\n",
- count + S1_COUNT_OFFSET, address, data_str, ~sum & 0xff
- );
-}
-
-
-Rec_vitals motorola_s1_rec =
-{
- is_moto_s1_data_rec,
- get_moto_s1_rec_address,
- get_moto_s1_rec_data_count,
- MAX_LEN_S1_RECS, /* Maximum data bytes in a record. */
- get_moto_s1_rec_data_start,
- put_moto_s1_data_rec
-};
-
-
-/*------------------------- Motorola S2-record format ------------------------*/
-
-#define S2_COUNT_OFFSET 4
-
-Boolean is_moto_s2_data_rec( char * rec_str )
-{
- return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '2' ) );
-}
-
-Uint get_moto_s2_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S2_COUNT_OFFSET );
-}
-
-Ulong get_moto_s2_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 4, 6 ) );
-}
-
-char * get_moto_s2_rec_data_start( char * rec_str )
-{
- return( rec_str + 10 );
-}
-
-void put_moto_s2_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = S2_COUNT_OFFSET + count + ( address >> 16 & 0xff ) +
- ( address >> 8 & 0xff ) +
- ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- "S2%02X%06lX%s%02X\n",
- count + S2_COUNT_OFFSET, address, data_str, ~sum & 0xff
- );
-}
-
-
-Rec_vitals motorola_s2_rec =
-{
- is_moto_s2_data_rec,
- get_moto_s2_rec_address,
- get_moto_s2_rec_data_count,
- MAX_LEN_S2_RECS, /* Maximum data bytes in a record. */
- get_moto_s2_rec_data_start,
- put_moto_s2_data_rec
-};
-
-
-/*------------------------- Motorola S3-record format ------------------------*/
-
-#define S3_COUNT_OFFSET 5
-
-Boolean is_moto_s3_data_rec( char * rec_str )
-{
- return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '3' ) );
-}
-
-Uint get_moto_s3_rec_data_count( char * rec_str )
-{
- return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S3_COUNT_OFFSET );
-}
-
-Ulong get_moto_s3_rec_address( char * rec_str )
-{
- return( get_ndigit_hex( rec_str + 4, 8 ) );
-}
-
-char * get_moto_s3_rec_data_start( char * rec_str )
-{
- return( rec_str + 12 );
-}
-
-void put_moto_s3_data_rec( Uint count, Ulong address, char * data_str )
-{
- char *ptr;
- Uint sum = S3_COUNT_OFFSET + count + ( address >> 24 & 0xff ) +
- ( address >> 16 & 0xff ) +
- ( address >> 8 & 0xff ) +
- ( address & 0xff );
-
- for ( ptr = data_str ; *ptr != EOS ; ptr += 2 )
- sum += ( Uint ) get_ndigit_hex( ptr, 2 );
-
- printf(
- "S3%02X%08lX%s%02X\n",
- count + S3_COUNT_OFFSET, address, data_str, ~sum & 0xff
- );
-}
-
-
-Rec_vitals motorola_s3_rec =
-{
- is_moto_s3_data_rec,
- get_moto_s3_rec_address,
- get_moto_s3_rec_data_count,
- MAX_LEN_S3_RECS, /* Maximum data bytes in a record. */
- get_moto_s3_rec_data_start,
- put_moto_s3_data_rec
-};
-
-
-/*-------------------- Put your favorite hex format here ---------------------*/
-
-/*
- * * * * The following is a template for an additional hex format: * * *
- *
- *
- * Boolean is_X_data_rec( char * rec_str ) {}
- *
- * Uint get_X_rec_data_count( char * rec_str ) {}
- *
- * Ulong get_X_rec_address( char * rec_str ) {}
- *
- * char * get_X_rec_data_start( char * rec_str ) {}
- *
- * void put_X_data_rec( Uint count, Ulong address, char * data_str ) {}
- *
- * Rec_vitals X_rec =
- * {
- * is_X_data_rec,
- * get_X_rec_address,
- * get_X_rec_data_count,
- * MAXIMUM DATA BYTES IN A RECORD,
- * get_X_rec_data_start,
- * put_X_data_rec
- * };
- *
- */
-
-/*----------------------------------------------------------------------------*/
-
-
-/*
- * Put address of additional Rec_vitals structures
- * in this array, before the NULL entry.
- */
-
-Rec_vitals *formats[] =
-{
- &intel_hex,
- &motorola_s1_rec,
- &motorola_s2_rec,
- &motorola_s3_rec,
- ( Rec_vitals * ) NULL
-};
-
-
-/**** main *****************************************************************
-*
-*
-* Expects: Nothing (no command-line parameters).
-*
-* Returns: Exit status (EXIT_SUCCESS or EXIT_FAILURE).
-*
-* Reads hex records on the standard input and attempts to
-* splice adjacent data fields together. Results appear on
-* the standard output.
-*
-*******************************************************************************/
-
-int main(
- int argc,
- char **argv
-)
-{
-
- char inbuff[ MAX_LINE_SIZE ], outbuff[ MAX_LINE_SIZE ];
- char *in_dptr, *out_dptr;
- int d_total, d_count, d_excess, n;
- int length;
- Ulong in_rec_addr, out_rec_addr = 0;
- Rec_vitals *rptr;
-
-
- /* Sift through file until first hex record is identified. */
-
- rptr = identify_first_data_record( inbuff, MAX_LINE_SIZE );
- if ( rptr == NULL )
- {
- fputs( "No hex records found.\n", stderr );
- exit( EXIT_FAILURE );
- }
-
-
- /* Attempt data-record splicing until end-of-file is reached. */
- d_total = 0;
- for (;;) {
- if ( rptr->is_data_record( inbuff ) == YES )
- { /* Input record is a data record. */
- d_count = rptr->get_data_count( inbuff );
- in_rec_addr = rptr->get_address( inbuff );
- in_dptr = rptr->get_data_start( inbuff );
-
- if ( d_total == 0 || in_rec_addr != out_rec_addr + d_total )
- { /* Begin a new output record. */
- if ( d_total != 0 )
- rptr->put_data_record( d_total, out_rec_addr, outbuff );
- out_dptr = outbuff;
- n = d_total = d_count;
- out_rec_addr = in_rec_addr;
- }
- else if
- ( ( d_excess = d_total + d_count - rptr->max_data_count ) > 0 )
- { /* Output a maximum-length record, then start a new record. */
- strncat( outbuff, in_dptr, 2 * ( d_count - d_excess ) );
- rptr->put_data_record(
- rptr->max_data_count, out_rec_addr, outbuff
- );
- in_dptr += 2 * ( d_count - d_excess );
- out_dptr = outbuff;
- n = d_total = d_excess;
- out_rec_addr += rptr->max_data_count;
- }
- else
- { /* Append input record's data field with accumulated data. */
- out_dptr = outbuff + ( 2 * d_total );
- d_total += n = d_count;
- }
- strncpy( out_dptr, in_dptr, 2 * n );
- out_dptr[ 2 * n ] = EOS;
- }
- else
- { /* Not a data record;
- * flush accumulated data then echo non-data record.
- */
- if ( d_total != 0 )
- {
- rptr->put_data_record( d_total, out_rec_addr, outbuff );
- d_total = 0;
- }
- puts( inbuff );
- }
-
- inbuff[ MAX_LINE_SIZE - 1 ] = '\0';
- if ( !fgets( inbuff, MAX_LINE_SIZE, stdin ) )
- break;
- if ( inbuff[ MAX_LINE_SIZE - 1 ] ) {
- fprintf( stderr, "Input line too long" );
- exit( 1 );
- }
- length = strlen(inbuff);
- inbuff[length - 1] = '\0';
-
- }
-
-
- return ( EXIT_SUCCESS );
-
-}
-
-
-/**** identify_first_data_record *******************************************
-*
-* Expects: Pointer to hex-record line buffer.
-*
-* Returns: Pointer to hex-record structure (NULL if no match found).
-*
-* Reads the standard input, line by line, searching for a valid
-* record header character. If a valid header is found, a pointer
-* to the hex-record's type structure is returned, otherwise NULL.
-*
-* The input-stream pointer is left pointing to the first valid hex record.
-*
-*******************************************************************************/
-
-Rec_vitals * identify_first_data_record( char * buff_ptr, int max_length )
-{
- Rec_vitals ** ptr;
- int length;
-
-
-
- for ( ;; ) {
-
- buff_ptr[ max_length - 1 ] = '\0';
- if ( !fgets( buff_ptr, max_length, stdin ) )
- break;
- if ( buff_ptr[ max_length - 1 ] ) {
- fprintf( stderr, "Input line too long" );
- exit( 1 );
- }
- length = strlen(buff_ptr);
- buff_ptr[length - 1] = '\0';
-
- for ( ptr = formats ; *ptr != ( Rec_vitals * ) NULL ; ptr++ )
- if ( ( *ptr )->is_data_record( buff_ptr ) == YES )
- return( *ptr ); /* Successful return. */
-
- puts( buff_ptr ); /* Echo non-hex-record line. */
- }
-
- return( ( Rec_vitals * ) NULL ); /* Unsuccessful return. */
-}
-
-
-/**** get_ndigit_hex *******************************************************
-*
-* Expects: Pointer to first ASCII hexadecimal digit, number of digits.
-*
-* Returns: Value of hexadecimal string as an unsigned long.
-*
-*******************************************************************************/
-
-Ulong get_ndigit_hex( char * cptr, int digits )
-{
- Ulong value;
-
- for ( value = 0 ; --digits >= 0 ; cptr++ )
- value = ( value * 16L ) + HEX_DIGIT( *cptr );
-
- return( value );
-}
diff --git a/tools/build/src/unhex.c b/tools/build/src/unhex.c
deleted file mode 100644
index 6a75a13ae7..0000000000
--- a/tools/build/src/unhex.c
+++ /dev/null
@@ -1,738 +0,0 @@
-/*
- * unhex
- * convert a hex file to binary equivalent. If more than one file name
- * is given, then the output will be logically concatenated together.
- * stdin and stdout are defaults. Verbose will enable checksum output.
- *
- * Supported input formats are Intel hex, Motorola S records, and TI 'B'
- * records.
- *
- * Intel hex input format is
- * Byte
- * 1 Colon :
- * 2..3 Record length, eg: "20"
- * 4..7 load address nibbles
- * 8..9 record type: "00" (data) or "02" base addr
- * 10..x data bytes in ascii-hex
- * x+1..x+2 cksum (2's compl of (len+addr+data))
- * x+3 \n -- newline
- *
- * $Id$
- */
-
-char *USAGE = "\
-usage: unhex [-va] [ -o file ] [ file [file ... ] ]\n\
- -v -- verbose\n\
- -a base -- 1st byte of output corresponds to this address\n\
- -l -- linear, just writes data out\n\
- -o file -- output file; must not be input file\n\
- -F k_bits -- \"holes\" in input will be filled with 0xFF's\n\
- up to \"k_bits\" * 1024 bits\n\
-";
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-
-#define OK 0
-#define FAILURE (-1)
-#define Failed(x) ((x) == FAILURE)
-#define TRUE 1
-#define FALSE 0
-typedef char bool;
-#define STREQ(a,b) (strcmp(a,b) == 0)
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned long u32;
-
-/*
- * Pick out designated bytes
- */
-
-#define B0(x) ((x) & 0xff)
-#define B1(x) B0((x) >> 8)
-#define B2(x) B0((x) >> 16)
-#define B3(x) B0((x) >> 24)
-
-typedef struct buffer_rec {
- u32 dl_destaddr;
- u32 dl_jumpaddr;
- int dl_count;
- u8 dl_buf[512];
-} buffer_rec;
-
-/*
- * vars controlled by command line options
- */
-
-bool verbose = FALSE; /* be verbose */
-bool linear = FALSE; /* just write out linear data */
-char *outfilename = "-"; /* default output is stdout */
-u32 base = 0L; /* base address */
-u32 FFfill = 0L; /* how far to fill w 0xFF's */
-
-extern char *optarg; /* getopt(3) control vars */
-extern int optind;
-
-char *progname; /* for error() */
-
-void error(int errn, ...);
-#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define ERR_FATAL (ERR_ERRNO / 2) /* error is fatal; no return */
-#define ERR_ABORT (ERR_ERRNO / 4) /* error is fatal; abort */
-#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
-
-#ifdef HAVE_STRTOUL
-#define stol(p) strtoul(p, (char **) NULL, 0)
-#else
-#define stol(p) strtol(p, (char **) NULL, 0)
-#endif
-
-int unhex(FILE *ifp, char *inm, FILE *ofp, char *onm);
-int convert_Intel_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
-int convert_S_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
-int convert_TI_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
-void write_record(buffer_rec *tb, FILE *fp);
-int getnibble(char **p);
-int getbyte(char **p);
-long getNbytes(char **p, int n);
-void badformat(char *s, char *fname, char *msg);
-
-#define get1bytes(p) ((int) getbyte(p))
-#define get2bytes(p) ((int) getNbytes(p, 2))
-#define get3bytes(p) getNbytes(p, 3)
-#define get4bytes(p) getNbytes(p, 4)
-
-char *BADADDR = "Invalid record address";
-char *BADLEN = "Invalid record length";
-char *BADBASE = "Bad base or starting address";
-char *BADFMT = "Unrecognized record type";
-char *BADDATA = "Invalid data byte";
-char *BADCSUM = "Invalid checksum";
-char *MISCSUM = "Checksum mismatch";
-char *BADTYPE = "Unrecognized record type";
-char *MISTYPE = "Incompatible record types";
-
-int main(
- int argc,
- char **argv
-)
-{
- register int c;
- bool showusage = FALSE; /* usage error? */
- int rc = 0;
- FILE *outfp, *infp;
-
- /*
- * figure out invocation leaf-name
- */
-
- if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
- progname = argv[0];
- else
- progname++;
-
- argv[0] = progname; /* for getopt err reporting */
-
- /*
- * Check options and arguments.
- */
-
- progname = argv[0];
- while ((c = getopt(argc, argv, "F:a:o:vl")) != EOF)
- switch (c)
- {
- case 'a': /* base address */
- base = stol(optarg);
- break;
-
- case 'l': /* linear output */
- linear = TRUE;
- break;
-
- case 'v': /* toggle verbose */
- verbose = ! verbose;
- break;
-
- case 'o': /* output file */
- outfilename = optarg;
- break;
-
- case 'F': /* 0xFF fill amount (bytes) */
- FFfill = stol(optarg) * 1024L / 8L;
- break;
-
- case '?':
- showusage = TRUE;
- }
-
- if (showusage)
- {
- (void) fprintf(stderr, "%s", USAGE);
- exit(1);
- }
-
- if (linear && (base != 0))
- {
- error(0, "-l and -a may not be specified in combination");
- exit(1);
- }
-
- if (STREQ(outfilename, "-"))
- {
- outfp = stdout;
- outfilename = "stdout";
- }
- else
- if ((outfp = fopen(outfilename, "w")) == (FILE *) NULL)
- {
- error(-1, "couldn't open '%s' for output", outfilename);
- exit(1);
- }
-
- /*
- * Now process the input files (or stdin, if none specified)
- */
-
- if (argv[optind] == (char *) NULL) /* just stdin */
- exit(unhex(stdin, "stdin", outfp, outfilename));
- else
- for (; (optarg = argv[optind]); optind++)
- {
- if (STREQ(optarg, "-"))
- rc += unhex(stdin, "stdin", outfp, outfilename);
- else
- {
- if ((infp = fopen(optarg, "r")) == (FILE *) NULL)
- {
- error(-1, "couldn't open '%s' for input", optarg);
- exit(1);
- }
- rc += unhex(infp, optarg, outfp, outfilename);
- }
- }
-
- return(rc);
-}
-
-u16 filesum;
-
-int
-unhex(FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- int c;
-
- filesum = 0;
-
- /*
- * Make sure holes will be filled with 0xFF's if requested. We
- * do this the easy way by just filling the file with FF's before
- * getting started. To do it more optimally would be quite a bit
- * more difficult since the user can skip around as much as he/she
- * likes in the input hex file addressing.
- *
- * We'll clean this up later (after this program has run) with
- * 'stripffs'
- */
-
- if (FFfill)
- {
- (void) fseek(ofp, 0, 0);
- for (c = FFfill; c > 0; c--)
- (void) fputc(0xFF, ofp);
- }
-
- /*
- * Read the first char from file and determine record types
- */
-
- if ((c = getc(ifp)) != EOF)
- {
- ungetc(c, ifp);
- switch(c)
- {
- case 'S':
- convert_S_records(ifp, inm, ofp, onm);
- break;
-
- case ':':
- convert_Intel_records(ifp, inm, ofp, onm);
- break;
-
- case '9':
- case 'B':
- convert_TI_records(ifp, inm, ofp, onm);
- break;
-
- default:
- {
- char tmp[2];
- tmp[0] = c; tmp[1] = 0;
- badformat(tmp, inm, BADFMT);
- }
- }
- }
-
- if (verbose)
- fprintf(stderr, "'%s' checksum is 0x%04x\n", inm, filesum);
-
- return 0;
-}
-
-int
-convert_Intel_records(
- FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- char buff[512];
- char *p;
- u8 cksum;
- int incksum;
- int c;
- int rectype; /* record type */
- int len; /* data length of current line */
- u32 addr;
- u32 base_address = 0;
- bool endrecord = FALSE;
- buffer_rec tb;
-
- while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
- {
- p = &buff[0];
-
- if (p[strlen(p)-1] == '\n') /* get rid of newline */
- p[strlen(p)-1] = '\0';
-
- if (p[strlen(p)-1] == '\r') /* get rid of any CR */
- p[strlen(p)-1] = '\0';
-
- tb.dl_count = 0;
-
- if (*p != ':')
- badformat(p, inm, BADFMT);
- p++;
-
- if ((len = getbyte(&p)) == -1) /* record len */
- badformat(buff, inm, BADLEN);
-
- if ((addr = get2bytes(&p)) == -1L) /* record addr */
- badformat(buff, inm, BADADDR);
-
- rectype = getbyte(&p);
-
- cksum = len + B0(addr) + B1(addr) + rectype;
-
- switch (rectype)
- {
- case 0x00: /* normal data record */
- tb.dl_destaddr = base_address + addr;
- while (len--)
- {
- if ((c = getbyte(&p)) == -1)
- badformat(buff, inm, BADDATA);
- cksum += c;
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- }
- break;
-
- case 0x01: /* execution start address */
- base_address = addr;
- endrecord = TRUE;
- break;
-
- case 0x02: /* new base */
- if ((base_address = get2bytes(&p)) == -1L)
- badformat(buff, inm, BADBASE);
- cksum += B0(base_address) + B1(base_address);
- base_address <<= 4;
- break;
-
- case 0x03: /* seg/off execution start address */
- {
- u32 seg, off;
-
- seg = get2bytes(&p);
- off = get2bytes(&p);
- if ((seg == -1L) || (off == -1L))
- badformat(buff, inm, BADADDR);
-
- cksum += B0(seg) + B1(seg) + B0(off) + B1(off);
-
- tb.dl_jumpaddr = (seg << 4) + off;
- break;
- }
-
- default:
- error(0, "unknown Intel-hex record type: 0x%02x", rectype);
- badformat(buff, inm, BADTYPE);
- }
-
- /*
- * Verify checksums are correct in file.
- */
-
- cksum = (-cksum) & 0xff;
- if ((incksum = getbyte(&p)) == -1)
- badformat(buff, inm, BADCSUM);
- if (((u8) incksum) != cksum)
- badformat(buff, inm, MISCSUM);
-
- if (tb.dl_count)
- write_record(&tb, ofp);
- }
- return 0;
-}
-
-int
-convert_S_records(
- FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- char buff[512];
- char *p;
- u8 cksum;
- int incksum;
- int c;
- int len; /* data length of current line */
- int rectype; /* record type */
- u32 addr;
- bool endrecord = FALSE;
- buffer_rec tb;
-
- while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
- {
- p = &buff[0];
-
- if (p[strlen(p)-1] == '\n') /* get rid of newline */
- p[strlen(p)-1] = '\0';
-
- if (p[strlen(p)-1] == '\r') /* get rid of any CR */
- p[strlen(p)-1] = '\0';
-
- tb.dl_count = 0;
-
- if (*p != 'S')
- badformat(p, inm, BADFMT);
- p++;
-
- if ((rectype = getnibble(&p)) == -1) /* record type */
- badformat(buff, inm, BADTYPE);
-
- if ((len = getbyte(&p)) == -1) /* record len */
- badformat(buff, inm, BADLEN);
- cksum = len;
-
- switch (rectype)
- {
- case 0x00: /* comment field, ignored */
- goto write_it;
-
- case 0x01: /* data record, 16 bit addr */
- if ((addr = get2bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- len -= 3;
- goto doit;
-
- case 0x02: /* ... 24 bit addr */
- if ((addr = get3bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- len -= 4;
- goto doit;
-
- case 0x03: /* ... 32 bit addr */
- if ((addr = get4bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- len -= 5;
- doit:
- cksum += B0(addr) + B1(addr) + B2(addr) + B3(addr);
-
- tb.dl_destaddr = addr;
- while (len--)
- {
- if ((c = getbyte(&p)) == -1)
- badformat(buff, inm, BADDATA);
- cksum += c;
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- }
- break;
-
- case 0x07: /* 32 bit end record */
- if ((addr = get4bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- goto end_rec;
-
- case 0x08: /* 24 bit end record */
- if ((addr = get3bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- goto end_rec;
-
- case 0x09: /* 16 bit end record */
- if ((addr = get2bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
-
-end_rec:
- cksum += B0(addr) + B1(addr) + B2(addr) + B3(addr);
- tb.dl_jumpaddr = addr;
- break;
-
- default:
- error(0, "unknown Motorola-S record type: 0x%02x", rectype);
- badformat(buff, inm, BADTYPE);
- break;
- }
-
- /*
- * Verify checksums are correct in file.
- */
-
- cksum = (~cksum) & 0xff;
- if ((incksum = getbyte(&p)) == -1)
- badformat(buff, inm, BADCSUM);
- if (((u8) incksum) != cksum)
- badformat(buff, inm, MISCSUM);
-
-write_it:
- if (tb.dl_count)
- write_record(&tb, ofp);
- }
- return 0;
-}
-
-int
-convert_TI_records(
- FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- char buff[512];
- char *p;
- int c;
- bool endrecord = FALSE;
- bool eol;
- buffer_rec tb;
-
- while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
- {
- if (p[strlen(p)-1] == '\n') /* get rid of newline */
- p[strlen(p)-1] = '\0';
-
- if (p[strlen(p)-1] == '\r') /* get rid of any CR */
- p[strlen(p)-1] = '\0';
-
- tb.dl_count = 0;
-
- p = &buff[0];
- eol = FALSE;
- while ( ! eol && ! endrecord)
- {
- switch (*p++)
- {
- case '9':
- if (tb.dl_count)
- write_record(&tb, ofp);
- tb.dl_destaddr = get2bytes(&p);
- break;
-
- case 'B':
- c = getbyte(&p);
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- c = getbyte(&p);
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- break;
-
- case 'F':
- eol = TRUE;
- break;
-
- case ':':
- endrecord = TRUE;
- break;
-
- default:
- badformat(p, inm, BADFMT);
- }
- }
- if (tb.dl_count)
- write_record(&tb, ofp);
- }
- return 0;
-}
-
-void
-write_record(buffer_rec *tb,
- FILE *fp)
-{
- if ( ! linear)
- {
- if (tb->dl_destaddr < base)
- error(ERR_FATAL, "record at address 0x%x precedes base of 0x%x",
- tb->dl_destaddr, base);
- (void) fseek(fp, tb->dl_destaddr - base, 0);
- }
-
- (void) fwrite(tb->dl_buf, tb->dl_count, 1, fp);
- tb->dl_destaddr += tb->dl_count;
- tb->dl_count = 0;
-}
-
-int
-getnibble(char **p)
-{
- register int val;
-
- **p = toupper(**p);
- switch (**p)
- {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- val = **p - '0';
- break;
-
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- val = 10 + (**p - 'A');
- break;
-
- default:
- return(-1);
- }
- *p += 1;
-
- return(val & 0x0f);
-}
-
-int
-getbyte(char **p)
-{
- int n0, n1;
-
- if ((n0 = getnibble(p)) == -1)
- return(-1);
- if ((n1 = getnibble(p)) == -1)
- return(-1);
-
- return(((n0 << 4) + n1) & 0xff);
-}
-
-long
-getNbytes(char **p,
- int n)
-{
- int t;
- u32 val = 0;
-
- while (n--)
- {
- if ((t = getbyte(p)) == -1)
- return(-1L);
- val <<= 8;
- val += t;
- }
-
- return(val);
-}
-
-void
-badformat(char *s,
- char *fname,
- char *msg)
-{
- if (s[strlen(s)-1] == '\n') /* get rid of newline */
- s[strlen(s)-1] = '\0';
- error(0, "line '%s'::\n\tfrom file '%s'; %s", s, fname, msg);
- exit(1);
-}
-
-/*
- * error(errn, arglist)
- * report an error to stderr using printf(3) conventions.
- * Any output is preceded by '<progname>: '
- *
- * Uses ERR_EXIT bit to request exit(errn)
- * ERR_ABORT to request abort()
- * ERR_ERRNO to indicate use of errno instead of argument.
- *
- * If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
- * associated error message is appended to the output.
- */
-
-/*VARARGS*/
-
-void
-error(int error_flag, ...)
-{
- va_list arglist;
- register char *format;
- int local_errno;
-
- extern int errno;
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- local_errno = error_flag & ~ERR_MASK;
- if (error_flag & ERR_ERRNO) /* use errno? */
- local_errno = errno;
-
- va_start(arglist, error_flag);
- format = va_arg(arglist, char *);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, format, arglist);
- va_end(arglist);
-
- if (local_errno)
- (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
- else
- (void) fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (ERR_FATAL | ERR_ABORT))
- {
- if (error_flag & ERR_FATAL)
- {
- error(0, "fatal error, exiting");
- exit(local_errno ? local_errno : 1);
- }
- else
- {
- error(0, "fatal error, aborting");
- abort();
- }
- }
-}
-
diff --git a/tools/build/unhex.c b/tools/build/unhex.c
deleted file mode 100644
index 6a75a13ae7..0000000000
--- a/tools/build/unhex.c
+++ /dev/null
@@ -1,738 +0,0 @@
-/*
- * unhex
- * convert a hex file to binary equivalent. If more than one file name
- * is given, then the output will be logically concatenated together.
- * stdin and stdout are defaults. Verbose will enable checksum output.
- *
- * Supported input formats are Intel hex, Motorola S records, and TI 'B'
- * records.
- *
- * Intel hex input format is
- * Byte
- * 1 Colon :
- * 2..3 Record length, eg: "20"
- * 4..7 load address nibbles
- * 8..9 record type: "00" (data) or "02" base addr
- * 10..x data bytes in ascii-hex
- * x+1..x+2 cksum (2's compl of (len+addr+data))
- * x+3 \n -- newline
- *
- * $Id$
- */
-
-char *USAGE = "\
-usage: unhex [-va] [ -o file ] [ file [file ... ] ]\n\
- -v -- verbose\n\
- -a base -- 1st byte of output corresponds to this address\n\
- -l -- linear, just writes data out\n\
- -o file -- output file; must not be input file\n\
- -F k_bits -- \"holes\" in input will be filled with 0xFF's\n\
- up to \"k_bits\" * 1024 bits\n\
-";
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include "config.h"
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#define strerror( _err ) \
- ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
-
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
-
-#define OK 0
-#define FAILURE (-1)
-#define Failed(x) ((x) == FAILURE)
-#define TRUE 1
-#define FALSE 0
-typedef char bool;
-#define STREQ(a,b) (strcmp(a,b) == 0)
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned long u32;
-
-/*
- * Pick out designated bytes
- */
-
-#define B0(x) ((x) & 0xff)
-#define B1(x) B0((x) >> 8)
-#define B2(x) B0((x) >> 16)
-#define B3(x) B0((x) >> 24)
-
-typedef struct buffer_rec {
- u32 dl_destaddr;
- u32 dl_jumpaddr;
- int dl_count;
- u8 dl_buf[512];
-} buffer_rec;
-
-/*
- * vars controlled by command line options
- */
-
-bool verbose = FALSE; /* be verbose */
-bool linear = FALSE; /* just write out linear data */
-char *outfilename = "-"; /* default output is stdout */
-u32 base = 0L; /* base address */
-u32 FFfill = 0L; /* how far to fill w 0xFF's */
-
-extern char *optarg; /* getopt(3) control vars */
-extern int optind;
-
-char *progname; /* for error() */
-
-void error(int errn, ...);
-#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
-#define ERR_FATAL (ERR_ERRNO / 2) /* error is fatal; no return */
-#define ERR_ABORT (ERR_ERRNO / 4) /* error is fatal; abort */
-#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
-
-#ifdef HAVE_STRTOUL
-#define stol(p) strtoul(p, (char **) NULL, 0)
-#else
-#define stol(p) strtol(p, (char **) NULL, 0)
-#endif
-
-int unhex(FILE *ifp, char *inm, FILE *ofp, char *onm);
-int convert_Intel_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
-int convert_S_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
-int convert_TI_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
-void write_record(buffer_rec *tb, FILE *fp);
-int getnibble(char **p);
-int getbyte(char **p);
-long getNbytes(char **p, int n);
-void badformat(char *s, char *fname, char *msg);
-
-#define get1bytes(p) ((int) getbyte(p))
-#define get2bytes(p) ((int) getNbytes(p, 2))
-#define get3bytes(p) getNbytes(p, 3)
-#define get4bytes(p) getNbytes(p, 4)
-
-char *BADADDR = "Invalid record address";
-char *BADLEN = "Invalid record length";
-char *BADBASE = "Bad base or starting address";
-char *BADFMT = "Unrecognized record type";
-char *BADDATA = "Invalid data byte";
-char *BADCSUM = "Invalid checksum";
-char *MISCSUM = "Checksum mismatch";
-char *BADTYPE = "Unrecognized record type";
-char *MISTYPE = "Incompatible record types";
-
-int main(
- int argc,
- char **argv
-)
-{
- register int c;
- bool showusage = FALSE; /* usage error? */
- int rc = 0;
- FILE *outfp, *infp;
-
- /*
- * figure out invocation leaf-name
- */
-
- if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
- progname = argv[0];
- else
- progname++;
-
- argv[0] = progname; /* for getopt err reporting */
-
- /*
- * Check options and arguments.
- */
-
- progname = argv[0];
- while ((c = getopt(argc, argv, "F:a:o:vl")) != EOF)
- switch (c)
- {
- case 'a': /* base address */
- base = stol(optarg);
- break;
-
- case 'l': /* linear output */
- linear = TRUE;
- break;
-
- case 'v': /* toggle verbose */
- verbose = ! verbose;
- break;
-
- case 'o': /* output file */
- outfilename = optarg;
- break;
-
- case 'F': /* 0xFF fill amount (bytes) */
- FFfill = stol(optarg) * 1024L / 8L;
- break;
-
- case '?':
- showusage = TRUE;
- }
-
- if (showusage)
- {
- (void) fprintf(stderr, "%s", USAGE);
- exit(1);
- }
-
- if (linear && (base != 0))
- {
- error(0, "-l and -a may not be specified in combination");
- exit(1);
- }
-
- if (STREQ(outfilename, "-"))
- {
- outfp = stdout;
- outfilename = "stdout";
- }
- else
- if ((outfp = fopen(outfilename, "w")) == (FILE *) NULL)
- {
- error(-1, "couldn't open '%s' for output", outfilename);
- exit(1);
- }
-
- /*
- * Now process the input files (or stdin, if none specified)
- */
-
- if (argv[optind] == (char *) NULL) /* just stdin */
- exit(unhex(stdin, "stdin", outfp, outfilename));
- else
- for (; (optarg = argv[optind]); optind++)
- {
- if (STREQ(optarg, "-"))
- rc += unhex(stdin, "stdin", outfp, outfilename);
- else
- {
- if ((infp = fopen(optarg, "r")) == (FILE *) NULL)
- {
- error(-1, "couldn't open '%s' for input", optarg);
- exit(1);
- }
- rc += unhex(infp, optarg, outfp, outfilename);
- }
- }
-
- return(rc);
-}
-
-u16 filesum;
-
-int
-unhex(FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- int c;
-
- filesum = 0;
-
- /*
- * Make sure holes will be filled with 0xFF's if requested. We
- * do this the easy way by just filling the file with FF's before
- * getting started. To do it more optimally would be quite a bit
- * more difficult since the user can skip around as much as he/she
- * likes in the input hex file addressing.
- *
- * We'll clean this up later (after this program has run) with
- * 'stripffs'
- */
-
- if (FFfill)
- {
- (void) fseek(ofp, 0, 0);
- for (c = FFfill; c > 0; c--)
- (void) fputc(0xFF, ofp);
- }
-
- /*
- * Read the first char from file and determine record types
- */
-
- if ((c = getc(ifp)) != EOF)
- {
- ungetc(c, ifp);
- switch(c)
- {
- case 'S':
- convert_S_records(ifp, inm, ofp, onm);
- break;
-
- case ':':
- convert_Intel_records(ifp, inm, ofp, onm);
- break;
-
- case '9':
- case 'B':
- convert_TI_records(ifp, inm, ofp, onm);
- break;
-
- default:
- {
- char tmp[2];
- tmp[0] = c; tmp[1] = 0;
- badformat(tmp, inm, BADFMT);
- }
- }
- }
-
- if (verbose)
- fprintf(stderr, "'%s' checksum is 0x%04x\n", inm, filesum);
-
- return 0;
-}
-
-int
-convert_Intel_records(
- FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- char buff[512];
- char *p;
- u8 cksum;
- int incksum;
- int c;
- int rectype; /* record type */
- int len; /* data length of current line */
- u32 addr;
- u32 base_address = 0;
- bool endrecord = FALSE;
- buffer_rec tb;
-
- while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
- {
- p = &buff[0];
-
- if (p[strlen(p)-1] == '\n') /* get rid of newline */
- p[strlen(p)-1] = '\0';
-
- if (p[strlen(p)-1] == '\r') /* get rid of any CR */
- p[strlen(p)-1] = '\0';
-
- tb.dl_count = 0;
-
- if (*p != ':')
- badformat(p, inm, BADFMT);
- p++;
-
- if ((len = getbyte(&p)) == -1) /* record len */
- badformat(buff, inm, BADLEN);
-
- if ((addr = get2bytes(&p)) == -1L) /* record addr */
- badformat(buff, inm, BADADDR);
-
- rectype = getbyte(&p);
-
- cksum = len + B0(addr) + B1(addr) + rectype;
-
- switch (rectype)
- {
- case 0x00: /* normal data record */
- tb.dl_destaddr = base_address + addr;
- while (len--)
- {
- if ((c = getbyte(&p)) == -1)
- badformat(buff, inm, BADDATA);
- cksum += c;
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- }
- break;
-
- case 0x01: /* execution start address */
- base_address = addr;
- endrecord = TRUE;
- break;
-
- case 0x02: /* new base */
- if ((base_address = get2bytes(&p)) == -1L)
- badformat(buff, inm, BADBASE);
- cksum += B0(base_address) + B1(base_address);
- base_address <<= 4;
- break;
-
- case 0x03: /* seg/off execution start address */
- {
- u32 seg, off;
-
- seg = get2bytes(&p);
- off = get2bytes(&p);
- if ((seg == -1L) || (off == -1L))
- badformat(buff, inm, BADADDR);
-
- cksum += B0(seg) + B1(seg) + B0(off) + B1(off);
-
- tb.dl_jumpaddr = (seg << 4) + off;
- break;
- }
-
- default:
- error(0, "unknown Intel-hex record type: 0x%02x", rectype);
- badformat(buff, inm, BADTYPE);
- }
-
- /*
- * Verify checksums are correct in file.
- */
-
- cksum = (-cksum) & 0xff;
- if ((incksum = getbyte(&p)) == -1)
- badformat(buff, inm, BADCSUM);
- if (((u8) incksum) != cksum)
- badformat(buff, inm, MISCSUM);
-
- if (tb.dl_count)
- write_record(&tb, ofp);
- }
- return 0;
-}
-
-int
-convert_S_records(
- FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- char buff[512];
- char *p;
- u8 cksum;
- int incksum;
- int c;
- int len; /* data length of current line */
- int rectype; /* record type */
- u32 addr;
- bool endrecord = FALSE;
- buffer_rec tb;
-
- while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
- {
- p = &buff[0];
-
- if (p[strlen(p)-1] == '\n') /* get rid of newline */
- p[strlen(p)-1] = '\0';
-
- if (p[strlen(p)-1] == '\r') /* get rid of any CR */
- p[strlen(p)-1] = '\0';
-
- tb.dl_count = 0;
-
- if (*p != 'S')
- badformat(p, inm, BADFMT);
- p++;
-
- if ((rectype = getnibble(&p)) == -1) /* record type */
- badformat(buff, inm, BADTYPE);
-
- if ((len = getbyte(&p)) == -1) /* record len */
- badformat(buff, inm, BADLEN);
- cksum = len;
-
- switch (rectype)
- {
- case 0x00: /* comment field, ignored */
- goto write_it;
-
- case 0x01: /* data record, 16 bit addr */
- if ((addr = get2bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- len -= 3;
- goto doit;
-
- case 0x02: /* ... 24 bit addr */
- if ((addr = get3bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- len -= 4;
- goto doit;
-
- case 0x03: /* ... 32 bit addr */
- if ((addr = get4bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- len -= 5;
- doit:
- cksum += B0(addr) + B1(addr) + B2(addr) + B3(addr);
-
- tb.dl_destaddr = addr;
- while (len--)
- {
- if ((c = getbyte(&p)) == -1)
- badformat(buff, inm, BADDATA);
- cksum += c;
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- }
- break;
-
- case 0x07: /* 32 bit end record */
- if ((addr = get4bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- goto end_rec;
-
- case 0x08: /* 24 bit end record */
- if ((addr = get3bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
- goto end_rec;
-
- case 0x09: /* 16 bit end record */
- if ((addr = get2bytes(&p)) == -1L)
- badformat(buff, inm, BADADDR);
-
-end_rec:
- cksum += B0(addr) + B1(addr) + B2(addr) + B3(addr);
- tb.dl_jumpaddr = addr;
- break;
-
- default:
- error(0, "unknown Motorola-S record type: 0x%02x", rectype);
- badformat(buff, inm, BADTYPE);
- break;
- }
-
- /*
- * Verify checksums are correct in file.
- */
-
- cksum = (~cksum) & 0xff;
- if ((incksum = getbyte(&p)) == -1)
- badformat(buff, inm, BADCSUM);
- if (((u8) incksum) != cksum)
- badformat(buff, inm, MISCSUM);
-
-write_it:
- if (tb.dl_count)
- write_record(&tb, ofp);
- }
- return 0;
-}
-
-int
-convert_TI_records(
- FILE *ifp,
- char *inm,
- FILE *ofp,
- char *onm)
-{
- char buff[512];
- char *p;
- int c;
- bool endrecord = FALSE;
- bool eol;
- buffer_rec tb;
-
- while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
- {
- if (p[strlen(p)-1] == '\n') /* get rid of newline */
- p[strlen(p)-1] = '\0';
-
- if (p[strlen(p)-1] == '\r') /* get rid of any CR */
- p[strlen(p)-1] = '\0';
-
- tb.dl_count = 0;
-
- p = &buff[0];
- eol = FALSE;
- while ( ! eol && ! endrecord)
- {
- switch (*p++)
- {
- case '9':
- if (tb.dl_count)
- write_record(&tb, ofp);
- tb.dl_destaddr = get2bytes(&p);
- break;
-
- case 'B':
- c = getbyte(&p);
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- c = getbyte(&p);
- filesum += c;
- tb.dl_buf[tb.dl_count++] = c;
- break;
-
- case 'F':
- eol = TRUE;
- break;
-
- case ':':
- endrecord = TRUE;
- break;
-
- default:
- badformat(p, inm, BADFMT);
- }
- }
- if (tb.dl_count)
- write_record(&tb, ofp);
- }
- return 0;
-}
-
-void
-write_record(buffer_rec *tb,
- FILE *fp)
-{
- if ( ! linear)
- {
- if (tb->dl_destaddr < base)
- error(ERR_FATAL, "record at address 0x%x precedes base of 0x%x",
- tb->dl_destaddr, base);
- (void) fseek(fp, tb->dl_destaddr - base, 0);
- }
-
- (void) fwrite(tb->dl_buf, tb->dl_count, 1, fp);
- tb->dl_destaddr += tb->dl_count;
- tb->dl_count = 0;
-}
-
-int
-getnibble(char **p)
-{
- register int val;
-
- **p = toupper(**p);
- switch (**p)
- {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- val = **p - '0';
- break;
-
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- val = 10 + (**p - 'A');
- break;
-
- default:
- return(-1);
- }
- *p += 1;
-
- return(val & 0x0f);
-}
-
-int
-getbyte(char **p)
-{
- int n0, n1;
-
- if ((n0 = getnibble(p)) == -1)
- return(-1);
- if ((n1 = getnibble(p)) == -1)
- return(-1);
-
- return(((n0 << 4) + n1) & 0xff);
-}
-
-long
-getNbytes(char **p,
- int n)
-{
- int t;
- u32 val = 0;
-
- while (n--)
- {
- if ((t = getbyte(p)) == -1)
- return(-1L);
- val <<= 8;
- val += t;
- }
-
- return(val);
-}
-
-void
-badformat(char *s,
- char *fname,
- char *msg)
-{
- if (s[strlen(s)-1] == '\n') /* get rid of newline */
- s[strlen(s)-1] = '\0';
- error(0, "line '%s'::\n\tfrom file '%s'; %s", s, fname, msg);
- exit(1);
-}
-
-/*
- * error(errn, arglist)
- * report an error to stderr using printf(3) conventions.
- * Any output is preceded by '<progname>: '
- *
- * Uses ERR_EXIT bit to request exit(errn)
- * ERR_ABORT to request abort()
- * ERR_ERRNO to indicate use of errno instead of argument.
- *
- * If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
- * associated error message is appended to the output.
- */
-
-/*VARARGS*/
-
-void
-error(int error_flag, ...)
-{
- va_list arglist;
- register char *format;
- int local_errno;
-
- extern int errno;
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- local_errno = error_flag & ~ERR_MASK;
- if (error_flag & ERR_ERRNO) /* use errno? */
- local_errno = errno;
-
- va_start(arglist, error_flag);
- format = va_arg(arglist, char *);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, format, arglist);
- va_end(arglist);
-
- if (local_errno)
- (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
- else
- (void) fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (ERR_FATAL | ERR_ABORT))
- {
- if (error_flag & ERR_FATAL)
- {
- error(0, "fatal error, exiting");
- exit(local_errno ? local_errno : 1);
- }
- else
- {
- error(0, "fatal error, aborting");
- abort();
- }
- }
-}
-
diff --git a/tools/build/unlock-directory.in b/tools/build/unlock-directory.in
deleted file mode 100644
index c63ceff881..0000000000
--- a/tools/build/unlock-directory.in
+++ /dev/null
@@ -1,41 +0,0 @@
-#!@KSH@
-#
-# $Id$
-#
-# Unlock a directory processed by lock_directory
-#
-
-# is a particular command available on this machine?
-#
-cmd_avail()
-{
- set -- `type $1 2>&1`
- if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ]
- then
- return 1
- else
- return 0
- fi
-}
-
-unlock_directory() {
- ul_dir=$1/. # get any symlink out of the way using '.'
- if [ -d $ul_dir ]
- then
- find $ul_dir -type d ! -perm -0222 -print | $XARGS -t chmod +w
- fi
-}
-
-# Use gnu xargs if available; faster, more reliable in general
-XARGS=xargs
-cmd_avail gxargs && XARGS=gxargs
-
-for dir
-do
- unlock_directory $dir
-done
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
-
diff --git a/tools/cpu/Makefile.in b/tools/cpu/Makefile.in
deleted file mode 100644
index 6dba1f38f6..0000000000
--- a/tools/cpu/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/directory.cfg
-
-SUB_DIRS=generic $(wildcard $(RTEMS_CPU))
diff --git a/tools/cpu/generic/Makefile.in b/tools/cpu/generic/Makefile.in
deleted file mode 100644
index 33c2fb81dd..0000000000
--- a/tools/cpu/generic/Makefile.in
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# $Id$
-#
-# RTEMS build tools
-# NOTE: of course we can't use any of these tools
-# in this Makefile. Most notably: install-if-change
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-include $(RTEMS_ROOT)/make/rtems.cfg
-
-DESTDIR=$(PROJECT_RELEASE)/bin
-
-BUILD_PGMS=size_rtems
-PGMS=$(BUILD_PGMS)
-
-CLEAN_ADDITIONS += $(BUILD_PGMS)
-
-INSTALLED_PGMS=$(PGMS:%=$(DESTDIR)/%)
-
-all: $(DESTDIR) $(PGMS) install
-
-$(DESTDIR):
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-$(INSTALLED_PGMS): $(PGMS)
- @INSTALL@ $(INSTBINFLAGS) $^ $@
-
-install: $(DESTDIR) $(INSTALLED_PGMS)
diff --git a/tools/cpu/generic/size_rtems.in b/tools/cpu/generic/size_rtems.in
deleted file mode 100644
index 72c96e842c..0000000000
--- a/tools/cpu/generic/size_rtems.in
+++ /dev/null
@@ -1,276 +0,0 @@
-#!@KSH@ -p
-#
-# size_rtems
-#
-# This script gathers information related to the size of RTEMS
-# using the GNU "size" command.
-#
-# This script operates by summing up the sizes of the various
-# object files which constitute a particular configuration of
-# RTEMS. This size information is gathered for placement in the
-# brochure flyers and supplement manuals.
-#
-# NOTE: The concept of the minimum executive size is buried in this script.
-#
-# COPYRIGHT (c) 1989-1998.
-# On-Line Applications Research Corporation (OAR).
-# Copyright assigned to U.S. Government, 1994.
-#
-# The license and distribution terms for this file may be
-# found in the file LICENSE in this distribution or at
-# http://www.OARcorp.com/rtems/license.html.
-#
-# $Id$
-#
-
-target=@target@
-program_prefix=@program_prefix@
-
-gnusize=${program_prefix}size
-
-# check usage
-if [ $# -ne 2 ] ; then
- echo usage ${0}: bsp object_directory
- exit 1
-fi
-
-bsp=$1
-board=$1
-ARCH=$2
-
-cpu=`echo $target | sed -e 's/-.*//'`
-
-case $target in
- sparc-sun-solaris*)
- rtems_cpu=unix
- bsp=solaris2
- echo Not supported on unix port.
- exit 0
- ;;
- i[3456]86-pc-linux-gnu)
- echo linux
- rtems_cpu=unix
- bsp=linux1
- echo Not supported on unix port.
- exit 0
- ;;
- i[3456]86-unknown-freebsd2.[12]*)
- echo freebsd
- rtems_cpu=unix
- bsp=freebsd2
- echo Not supported on unix port.
- exit 0
- ;;
- *-rtems*)
- cpu=`echo $target | sed -e 's/-.*//'`
- rtems_cpu=$cpu
- ;;
- *)
- echo unknown target $target
- exit 1
- ;;
-esac
-
-case $ARCH in
- *debug*) VARIANT=debug ;;
- *profile*) VARIANT=profile ;;
- *) VARIANT=optimized;;
-esac
-
-echo
-echo Size Information for the Following Configuration:
-echo CPU: ${cpu}
-echo BSP: ${board}
-echo VARIANT: ${VARIANT}
-echo
-
-
-#
-# KLUDGE to figure out at runtime how to echo a line without a
-# newline.
-#
-count=`echo "\\c" | wc -c`
-if [ ${count} -ne 0 ] ; then
- EARG="-n"
- EOL=""
-else
- EARG=""
- EOL="\\c"
-fi
-
-if [ ! -d ${board} ] ; then
- echo "${board} does not exist ... is the current directory the build directory?"
- exit 1
-fi
-
-#DIRLIST -- so greps for DIRLIST will find this file
-CPUOBJ=c/src/exec/score/cpu/${rtems_cpu}/${ARCH}
-COREOBJ=c/src/exec/score/src/${ARCH}
-RTEMSOBJ=c/src/exec/rtems/src/${ARCH}
-SAPIOBJ=c/src/exec/sapi/src/${ARCH}
-OPTOBJ=c/src/exec/rtems/optman/${ARCH}
-
-MANLIST=" \
-${RTEMSOBJ}/clock.o \
-${RTEMSOBJ}/dpmem.o \
-${RTEMSOBJ}/event.o \
-${RTEMSOBJ}/intr.o \
-${RTEMSOBJ}/msg.o \
-${RTEMSOBJ}/part.o \
-${RTEMSOBJ}/ratemon.o \
-${RTEMSOBJ}/region.o \
-${RTEMSOBJ}/sem.o \
-${RTEMSOBJ}/signal.o \
-${RTEMSOBJ}/tasks.o \
-${RTEMSOBJ}/timer.o \
-${SAPIOBJ}/debug.o \
-${SAPIOBJ}/extension.o \
-${SAPIOBJ}/fatal.o \
-${SAPIOBJ}/exinit.o \
-${SAPIOBJ}/io.o \
-${SAPIOBJ}/rtemsapi.o \
-"
-MPLIST="\
-${RTEMSOBJ}/mp.o ${RTEMSOBJ}/eventmp.o \
-${COREOBJ}/mpci.o ${RTEMSOBJ}/msgmp.o ${COREOBJ}/objectmp.o \
-${RTEMSOBJ}/partmp.o ${RTEMSOBJ}/regionmp.o ${RTEMSOBJ}/semmp.o \
-${RTEMSOBJ}/signalmp.o ${RTEMSOBJ}/taskmp.o ${COREOBJ}/threadmp.o \
-"
-
-OPTMANLIST="\
-${OPTOBJ}/no-dpmem.rel \
-${OPTOBJ}/no-event.rel \
-${OPTOBJ}/no-mp.rel \
-${OPTOBJ}/no-msg.rel \
-${OPTOBJ}/no-part.rel \
-${OPTOBJ}/no-region.rel \
-${OPTOBJ}/no-rtmon.rel \
-${OPTOBJ}/no-sem.rel \
-${OPTOBJ}/no-signal.rel \
-${OPTOBJ}/no-timer.rel \
-"
-REQMANLIST="\
-${SAPIOBJ}/exinit.o \
-${RTEMSOBJ}/tasks.o \
-${RTEMSOBJ}/intr.o \
-${SAPIOBJ}/fatal.o \
-"
-CORELIST=" \
-${COREOBJ}/apiext.o ${COREOBJ}/chain.o \
-${COREOBJ}/coremsg.o ${COREOBJ}/coremutex.o ${COREOBJ}/coresem.o \
-${COREOBJ}/heap.o ${COREOBJ}/interr.o \
-${COREOBJ}/isr.o \
-${COREOBJ}/object.o \
-${SAPIOBJ}/rtemsapi.o \
-${COREOBJ}/thread.o ${COREOBJ}/threadq.o ${COREOBJ}/tod.o \
-${COREOBJ}/userext.o \
-${COREOBJ}/watchdog.o ${COREOBJ}/wkspace.o \
-"
-
-CPULIST="\
-${CPUOBJ}/rtems-cpu.rel \
-"
-
-# check directories
-for i in ${EXECOBJ} ${CPUOBJ} ${OPTOBJ}
-do
- if [ ! -d ${i} ] ; then
- echo "${i} does not exist ... is RTEMS compiled and installed?"
- exit 1
- fi
-done
-
-for i in ${MANLIST} ${MPLIST} ${OPTMANLIST} ${REQMANLIST} ${CORELIST} ${CPULIST}
-do
- if [ ! -r ${i} ] ; then
- echo ${i} does not exist ... is RTEMS compiled and installed?
- exit 1
- fi
-done
-
-# "rips" a line of gsize's output and prints size, data, bss
-parse_size()
-{
- echo $1 $2 $3
-}
-
-# prepares a list of code, data, bss sizes for a directory
-sizedir()
-{
- ${gnusize} $* | sed -e '1,1d' |
- while read line
- do
- parse_size ${line}
- done
-}
-
-# adds the numbers passed on the command line
-addit()
-{
- sumx=0
- for x in $*
- do
- sumx=`expr $sumx + $x`
- done
- echo $sumx
-}
-
-# adds a column from the output of sizedir
-addsizes()
-{
- # dc version is not portable enough -- It can be left out during
- # installing linux and may not be available on non-UNIX hosts.
- #cut -d' ' -f${2} ${1} | sed -e '2,$s/$/ + /' -e '$,$s/$/ p/' | dc
-
- # This may not be as fast but it is probably more portable.
- addit `cut -d' ' -f${2} ${1}`
-}
-
-# calculates total size of a directory and prints report line
-size_files()
-{
- trap "rm -f /tmp/size.$$ ; exit 1" 2 3
-
- for file in $*
- do
- parse_size `${gnusize} $file | sed -e '/text/d'`
- done >/tmp/size.$$
-
- code=`cat /tmp/size.$$ | addsizes 1`
- data=`cat /tmp/size.$$ | addsizes 2`
- bss=` cat /tmp/size.$$ | addsizes 3`
- echo "${code} ${data} ${bss}"
- rm /tmp/size.$$
-}
-
-echo
-echo " RTEMS SIZE REPORT"
-echo
-echo " CODE DATA BSS"
-echo " =================="
-echo ${EARG} "MANAGERS: " ${EOL} ; size_files $MANLIST $MPLIST
-echo ${EARG} "CORE : " ${EOL} ; size_files $CORELIST $CPULIST
-echo ${EARG} "CPU : " ${EOL} ; size_files $CPULIST
-echo ${EARG} "OVERALL : " ${EOL} ; size_files $CPULIST $CORELIST $MANLIST \
- $MPLIST
-echo ${EARG} "MINIMUM : " ${EOL} ; size_files $CPULIST $CORELIST \
- $OPTMANLIST $REQMANLIST
-echo
-
-for file in $MANLIST
-do
- base=`basename ${file}`
- echo ${EARG} ""${base} : " ${EOL} " ; size_files ${file}
-done
-
-echo ${EARG} "MP : " ${EOL} ; size_files $MPLIST
-
-echo
-for file in $OPTMANLIST
-do
- base=`basename ${file}`
- echo ${EARG} "${base} : " ${EOL} ; size_files ${file}
-done
-
-echo
-exit 0
diff --git a/tools/cpu/hppa1.1/genoffsets.c b/tools/cpu/hppa1.1/genoffsets.c
deleted file mode 100644
index 9be7884f7b..0000000000
--- a/tools/cpu/hppa1.1/genoffsets.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * genoffsets.c
- *
- * This file generates the offsets.h for the HP PA-RISC port of RTEMS.
- *
- * NOTE: It only prints the offset for structures actually used
- * by the assembly code.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.OARcorp.com/rtems/license.html.
- *
- * $Id$
- */
-
-#include <stdio.h>
-
-#if defined(__hpux__) && defined(__hppa__)
-#include <rtems/system.h>
-#endif
-
-void print_information( void );
-
-int main(
- int argc,
- char **argv
-)
-{
-#if defined(__hpux__) && defined(__hppa__)
- unsigned int size = 0;
-#endif
-
- /*
- * Print the file header
- */
-
-printf(
- "/* offsets.h\n"
- " *\n"
- " * This include file contains the offsets of elements in the\n"
- " * C data structures used by the assembly language code for the\n"
- " * HP PA-RISC 1.1 port of RTEMS.\n"
- " *\n"
- " * NOTE: THIS FILE IS AUTOMATICALLY GENERATED!!!!\n"
- " * DO NOT EDIT THIS BY HAND!!!!\n"
- " *\n"
- " * COPYRIGHT (c) 1989-1998.\n"
- " * On-Line Applications Research Corporation (OAR).\n"
- " * Copyright assigned to U.S. Government, 1994.\n"
- " *\n"
- " * The license and distribution terms for this file may be\n"
- " * found in the file LICENSE in this distribution or at\n"
- " * http://www.OARcorp.com/rtems/license.html.\n"
- " */\n"
- "\n"
- "#ifndef __OFFSETS_h\n"
- "#define __OFFSETS_h\n"
- "\n"
-);
-
-#define PRINT_IT( STRING, TYPE, FIELD ) \
- printf( "#define\t%s\t0x%p\t\t/* %d */\n", \
- STRING, \
- &((TYPE)0)->FIELD, \
- (int) &((TYPE)0)->FIELD );
-
-#define PRINT_SIZE( STRING, item ) \
- printf( "#ifdef ASM\n#define\t%s\t%d\t\t/* 0x%x */\n#endif\n", \
- STRING, \
- sizeof(item), \
- sizeof(item) );
-
-#define PRINT_COMMENT( STRING ) \
- printf( \
- "\n" \
- "/*\n" \
- " * " STRING "\n" \
- " */\n" \
- "\n" \
- );
-
-#if defined(__hpux__) && defined(__hppa__)
-
-/*
- * Offsets of elements in the Context_control structure.
- */
-
- PRINT_COMMENT("Context_Control information");
-
- PRINT_IT( "FLAGS_OFFSET", Context_Control *, flags );
- PRINT_IT( "R1_OFFSET", Context_Control *, gr1 );
- PRINT_IT( "R2_OFFSET", Context_Control *, gr2 );
- PRINT_IT( "R3_OFFSET", Context_Control *, gr3 );
- PRINT_IT( "R4_OFFSET", Context_Control *, gr4 );
- PRINT_IT( "R5_OFFSET", Context_Control *, gr5 );
- PRINT_IT( "R6_OFFSET", Context_Control *, gr6 );
- PRINT_IT( "R7_OFFSET", Context_Control *, gr7 );
- PRINT_IT( "R8_OFFSET", Context_Control *, gr8 );
- PRINT_IT( "R9_OFFSET", Context_Control *, gr9 );
- PRINT_IT( "R10_OFFSET", Context_Control *, gr10 );
- PRINT_IT( "R11_OFFSET", Context_Control *, gr11 );
- PRINT_IT( "R12_OFFSET", Context_Control *, gr12 );
- PRINT_IT( "R13_OFFSET", Context_Control *, gr13 );
- PRINT_IT( "R14_OFFSET", Context_Control *, gr14 );
- PRINT_IT( "R15_OFFSET", Context_Control *, gr15 );
- PRINT_IT( "R16_OFFSET", Context_Control *, gr16 );
- PRINT_IT( "R17_OFFSET", Context_Control *, gr17 );
- PRINT_IT( "R18_OFFSET", Context_Control *, gr18 );
- PRINT_IT( "R19_OFFSET", Context_Control *, gr19 );
- PRINT_IT( "R20_OFFSET", Context_Control *, gr20 );
- PRINT_IT( "R21_OFFSET", Context_Control *, gr21 );
- PRINT_IT( "R22_OFFSET", Context_Control *, gr22 );
- PRINT_IT( "R23_OFFSET", Context_Control *, gr23 );
- PRINT_IT( "R24_OFFSET", Context_Control *, gr24 );
- PRINT_IT( "R25_OFFSET", Context_Control *, gr25 );
- PRINT_IT( "R26_OFFSET", Context_Control *, gr26 );
- PRINT_IT( "R27_OFFSET", Context_Control *, gr27 );
- PRINT_IT( "R28_OFFSET", Context_Control *, gr28 );
- PRINT_IT( "R29_OFFSET", Context_Control *, gr29 );
- PRINT_IT( "R30_OFFSET", Context_Control *, sp );
- PRINT_IT( "R31_OFFSET", Context_Control *, gr31 );
-
- /*
- * And common aliases for the above
- */
-
- PRINT_COMMENT("Common aliases for above");
-
- PRINT_IT( "RP_OFFSET", Context_Control *, gr2 );
- PRINT_IT( "ARG3_OFFSET", Context_Control *, gr23 );
- PRINT_IT( "ARG2_OFFSET", Context_Control *, gr24 );
- PRINT_IT( "ARG1_OFFSET", Context_Control *, gr25 );
- PRINT_IT( "ARG0_OFFSET", Context_Control *, gr26 );
- PRINT_IT( "SP_OFFSET", Context_Control *, sp );
- PRINT_IT( "DP_OFFSET", Context_Control *, gr27 );
- PRINT_IT( "RET0_OFFSET", Context_Control *, gr28 );
- PRINT_IT( "RET1_OFFSET", Context_Control *, gr29 );
-
- PRINT_SIZE("CPU_CONTEXT_SIZE", Context_Control);
-
- PRINT_COMMENT("Context_Control_fp information");
-
- PRINT_IT( "FR0_OFFSET", Context_Control_fp *, fr0 );
- PRINT_IT( "FR1_OFFSET", Context_Control_fp *, fr1 );
- PRINT_IT( "FR2_OFFSET", Context_Control_fp *, fr2 );
- PRINT_IT( "FR3_OFFSET", Context_Control_fp *, fr3 );
- PRINT_IT( "FR4_OFFSET", Context_Control_fp *, fr4 );
- PRINT_IT( "FR5_OFFSET", Context_Control_fp *, fr5 );
- PRINT_IT( "FR6_OFFSET", Context_Control_fp *, fr6 );
- PRINT_IT( "FR7_OFFSET", Context_Control_fp *, fr7 );
- PRINT_IT( "FR8_OFFSET", Context_Control_fp *, fr8 );
- PRINT_IT( "FR9_OFFSET", Context_Control_fp *, fr9 );
- PRINT_IT( "FR10_OFFSET", Context_Control_fp *, fr10 );
- PRINT_IT( "FR11_OFFSET", Context_Control_fp *, fr11 );
- PRINT_IT( "FR12_OFFSET", Context_Control_fp *, fr12 );
- PRINT_IT( "FR13_OFFSET", Context_Control_fp *, fr13 );
- PRINT_IT( "FR14_OFFSET", Context_Control_fp *, fr14 );
- PRINT_IT( "FR15_OFFSET", Context_Control_fp *, fr15 );
- PRINT_IT( "FR16_OFFSET", Context_Control_fp *, fr16 );
- PRINT_IT( "FR17_OFFSET", Context_Control_fp *, fr17 );
- PRINT_IT( "FR18_OFFSET", Context_Control_fp *, fr18 );
- PRINT_IT( "FR19_OFFSET", Context_Control_fp *, fr19 );
- PRINT_IT( "FR20_OFFSET", Context_Control_fp *, fr20 );
- PRINT_IT( "FR21_OFFSET", Context_Control_fp *, fr21 );
- PRINT_IT( "FR22_OFFSET", Context_Control_fp *, fr22 );
- PRINT_IT( "FR23_OFFSET", Context_Control_fp *, fr23 );
- PRINT_IT( "FR24_OFFSET", Context_Control_fp *, fr24 );
- PRINT_IT( "FR25_OFFSET", Context_Control_fp *, fr25 );
- PRINT_IT( "FR26_OFFSET", Context_Control_fp *, fr26 );
- PRINT_IT( "FR27_OFFSET", Context_Control_fp *, fr27 );
- PRINT_IT( "FR28_OFFSET", Context_Control_fp *, fr28 );
- PRINT_IT( "FR29_OFFSET", Context_Control_fp *, fr29 );
- PRINT_IT( "FR30_OFFSET", Context_Control_fp *, fr30 );
- PRINT_IT( "FR31_OFFSET", Context_Control_fp *, fr31 );
-
- PRINT_SIZE("CPU_CONTEXT_FP_SIZE", Context_Control_fp);
-
- /*
- * And the control registers
- */
-
- PRINT_COMMENT("Control register portion of context");
-
- PRINT_IT( "SAR_OFFSET", Context_Control *, sar );
- PRINT_IT( "IPSW_OFFSET", Context_Control *, ipsw );
- PRINT_IT( "IIR_OFFSET", Context_Control *, iir );
- PRINT_IT( "IOR_OFFSET", Context_Control *, ior );
- PRINT_IT( "ISR_OFFSET", Context_Control *, isr );
- PRINT_IT( "PCOQFRONT_OFFSET", Context_Control *, pcoqfront );
- PRINT_IT( "PCOQBACK_OFFSET", Context_Control *, pcoqback );
- PRINT_IT( "PCSQFRONT_OFFSET", Context_Control *, pcsqfront );
- PRINT_IT( "PCSQBACK_OFFSET", Context_Control *, pcsqback );
- PRINT_IT( "ITIMER_OFFSET", Context_Control *, itimer );
-
- /*
- * Full interrupt frame (integer + float)
- */
- PRINT_COMMENT("Interrupt frame information");
-
- PRINT_IT( "INTEGER_CONTEXT_OFFSET", CPU_Interrupt_frame *, Integer );
- PRINT_IT( "FP_CONTEXT_OFFSET", CPU_Interrupt_frame *, Floating_Point );
- size = sizeof( CPU_Interrupt_frame );
-
- if ( size % CPU_STACK_ALIGNMENT )
- size += CPU_STACK_ALIGNMENT - (size % CPU_STACK_ALIGNMENT);
-
- printf( "#define\tCPU_INTERRUPT_FRAME_SIZE\t%d\t\t/* 0x%x */\n", size, size );
-
-#else
-
- print_information();
-
-#endif
-
-#undef PRINT_IT
-#undef PRINT_SIZE
-#undef PRINT_COMMENT
-
- /*
- * Print the end of file stuff
- */
-
- printf(
- "\n"
- "#endif /* __OFFSETS_h */\n"
- "\n"
- "/* end of include file */\n"
- );
-
- return 0;
-}
-
-void print_information( void )
-{
-
-#define PRINT_IT( STRING, NUMBER ) \
- printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
- STRING, \
- NUMBER, \
- NUMBER );
-
-#define PRINT_SIZE( STRING, NUMBER ) \
- printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
- STRING, \
- NUMBER, \
- NUMBER );
-
-#define PRINT_COMMENT( STRING ) \
- printf( \
- "\n" \
- "/*\n" \
- " * " STRING "\n" \
- " */\n" \
- "\n" \
- );
-
-/*
- * Offsets of elements in the Context_control structure.
- */
-
- PRINT_COMMENT("Context_Control information");
-
- PRINT_IT( "FLAGS_OFFSET", 0x00 );
- PRINT_IT( "R1_OFFSET", 0x04 );
- PRINT_IT( "R2_OFFSET", 0x08 );
- PRINT_IT( "R3_OFFSET", 0x0c );
- PRINT_IT( "R4_OFFSET", 0x00 );
- PRINT_IT( "R5_OFFSET", 0x14 );
- PRINT_IT( "R6_OFFSET", 0x18 );
- PRINT_IT( "R7_OFFSET", 0x1c );
- PRINT_IT( "R8_OFFSET", 0x20 );
- PRINT_IT( "R9_OFFSET", 0x24 );
- PRINT_IT( "R10_OFFSET", 0x28 );
- PRINT_IT( "R11_OFFSET", 0x2c );
- PRINT_IT( "R12_OFFSET", 0x30 );
- PRINT_IT( "R13_OFFSET", 0x34 );
- PRINT_IT( "R14_OFFSET", 0x38 );
- PRINT_IT( "R15_OFFSET", 0x3c );
- PRINT_IT( "R16_OFFSET", 0x40 );
- PRINT_IT( "R17_OFFSET", 0x44 );
- PRINT_IT( "R18_OFFSET", 0x48 );
- PRINT_IT( "R19_OFFSET", 0x4c );
- PRINT_IT( "R20_OFFSET", 0x50 );
- PRINT_IT( "R21_OFFSET", 0x54 );
- PRINT_IT( "R22_OFFSET", 0x58 );
- PRINT_IT( "R23_OFFSET", 0x5c );
- PRINT_IT( "R24_OFFSET", 0x60 );
- PRINT_IT( "R25_OFFSET", 0x64 );
- PRINT_IT( "R26_OFFSET", 0x68 );
- PRINT_IT( "R27_OFFSET", 0x6c );
- PRINT_IT( "R28_OFFSET", 0x70 );
- PRINT_IT( "R29_OFFSET", 0x74 );
- PRINT_IT( "R30_OFFSET", 0x78 );
- PRINT_IT( "R31_OFFSET", 0x7c );
-
- /*
- * And common aliases for the above
- */
-
- PRINT_COMMENT("Common aliases for above");
-
- PRINT_IT( "RP_OFFSET", 0x08 );
- PRINT_IT( "ARG3_OFFSET", 0x5c );
- PRINT_IT( "ARG2_OFFSET", 0x60 );
- PRINT_IT( "ARG1_OFFSET", 0x64 );
- PRINT_IT( "ARG0_OFFSET", 0x68 );
- PRINT_IT( "SP_OFFSET", 0x78 );
- PRINT_IT( "DP_OFFSET", 0x6c );
- PRINT_IT( "RET0_OFFSET", 0x74 );
- PRINT_IT( "RET1_OFFSET", 0x74 );
-
- PRINT_SIZE("CPU_CONTEXT_SIZE", 168 );
-
- PRINT_COMMENT("Context_Control_fp information");
-
- PRINT_SIZE("CPU_CONTEXT_FP_SIZE", 256);
-
- /*
- * And the control registers
- */
-
- PRINT_COMMENT("Control register portion of context");
-
- PRINT_IT( "SAR_OFFSET", 0x80 );
- PRINT_IT( "IPSW_OFFSET", 0x84 );
- PRINT_IT( "IIR_OFFSET", 0x88 );
- PRINT_IT( "IOR_OFFSET", 0x8c );
- PRINT_IT( "ISR_OFFSET", 0x90 );
- PRINT_IT( "PCOQFRONT_OFFSET", 0x94 );
- PRINT_IT( "PCOQBACK_OFFSET", 0x98 );
- PRINT_IT( "PCSQFRONT_OFFSET", 0x9c );
- PRINT_IT( "PCSQBACK_OFFSET", 0xa0 );
- PRINT_IT( "ITIMER_OFFSET", 0xa4 );
-
- /*
- * Full interrupt frame (integer + float)
- */
-
- PRINT_COMMENT("Interrupt frame information");
-
- PRINT_IT( "INTEGER_CONTEXT_OFFSET", 0x00 );
- PRINT_IT( "FP_CONTEXT_OFFSET", 0xa8 );
- PRINT_SIZE( "CPU_INTERRUPT_FRAME_SIZE", 448 );
-
-}
diff --git a/tools/cpu/sh/AUTHORS b/tools/cpu/sh/AUTHORS
deleted file mode 100644
index 225c2fa974..0000000000
--- a/tools/cpu/sh/AUTHORS
+++ /dev/null
@@ -1,3 +0,0 @@
-Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- * Initial implementation
- * generator for sci bitrate table
diff --git a/tools/cpu/sh/COPYING b/tools/cpu/sh/COPYING
deleted file mode 100644
index 805cdd8ffc..0000000000
--- a/tools/cpu/sh/COPYING
+++ /dev/null
@@ -1,19 +0,0 @@
-
- shgen - code generator for the Hitachi SH microcontroller family
-
- Copyright (C) 1998 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- 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. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
diff --git a/tools/cpu/sh/Makefile.in b/tools/cpu/sh/Makefile.in
deleted file mode 100644
index cbda87fbd8..0000000000
--- a/tools/cpu/sh/Makefile.in
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# $Id$
-#
-# FIXME: $ARCH shouldn't be used inside of host-tools.
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# we use the host compiler here
-USE_HOST_COMPILER=yes
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=shgen sci
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=sci.h
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-PGMS=${ARCH}/shgen@EXEEXT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -Wall
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS += -lm
-LDFLAGS +=
-
-#
-# Add your list of files to delete here.
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-DESTDIR=${PROJECT_RELEASE}/bin
-
-all: $(ARCH) $(PGMS)
-
-${PGMS}: $(OBJS) $(LINK_FILES)
- $(make-exe)
-
-$(DESTDIR):
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-# Install the program
-install: $(DESTDIR) $(PGMS)
- @INSTALL@ $(INSTBINFLAGS) ${PGMS} $(DESTDIR)
diff --git a/tools/cpu/sh/TODO b/tools/cpu/sh/TODO
deleted file mode 100644
index bcdd1bf6df..0000000000
--- a/tools/cpu/sh/TODO
+++ /dev/null
@@ -1,13 +0,0 @@
-* Add support for more drivers to shgen !!!!
-
-* shgen relies on having a gnu-compatible getopt, which should be
- available on all hosts using gcc/egcs/binutils.
- Using other getopt-variants may produce faulty results or shgen may also
- refuse to compile. Probably the easiest solution to this problem would be
- to integrate libiberty into rtems.
-
-* shgen uses floating point mathematics. Therefore Makefile.in contains a
- reference to libm. In case the host doesn't have its floating point
- support in libm, shgen will fail to compile. If we should ever meet such
- a host, checks for floating point libraries have to be added to rtems'
- autoconf support.
diff --git a/tools/cpu/sh/sci.c b/tools/cpu/sh/sci.c
deleted file mode 100644
index 3310e7e791..0000000000
--- a/tools/cpu/sh/sci.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 1998 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * See the file COPYING for copyright notice.
- */
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "sci.h"
-
-/*
- n .. baudrate generator source 0,1,2,3
-
- N .. BRR setting (0..255)
-
- Phi .. processor baud rate
-
- B .. bitrate
- */
-
-typedef struct sci_tab {
- unsigned int B ;
- unsigned int n ;
- int N ;
- double err ;
- } sci_tab_t ;
-
-static unsigned int bitrate [] = {
- 50,
- 75,
- 110,
- 134,
- 150,
- 200,
- 300,
- 600,
- 1200,
- 1800,
- 2400,
- 4800,
- 9600,
- 19200,
- 38400,
- 57600,
- 115200,
- 230400,
- 460800
-};
-
-static sci_tab_t test_array[4] ;
-
-static void Compute(
- unsigned int n,
- unsigned int B,
- double Phi,
- struct sci_tab *entry )
-{
- int a = ( 32 << ( 2 * n ) ) * B ;
-
- entry->n = n ;
- entry->B = B ;
- entry->N = rint( ( Phi / a ) - 1.0 ) ;
-
- if ( ( entry->N > 0 ) && ( entry->N < 256 ) )
- entry->err =
- ( ( Phi / ( (entry->N + 1) * a ) - 1.0 ) * 100.0 );
- else
- entry->err = 100.0 ;
-}
-
-static sci_tab_t *SelectN(
- unsigned int B,
- double Phi )
-{
- unsigned int i ;
- struct sci_tab* best = NULL ;
-
- for ( i = 0 ; i < 4 ; i++ )
- {
- double err ;
-
- Compute( i, B, Phi, &test_array[i] );
- err = fabs( test_array[i].err );
-
- if ( best )
- {
- if ( err < fabs( best->err ) )
- best = &test_array[i] ;
- }
- else
- best = &test_array[i] ;
- }
-
- return best ;
-}
-
-int shgen_gensci(
- FILE *file,
- double Phi ) /* Processor frequency [Hz] */
-{
- unsigned int i ;
-
- fprintf( file,
- "/*\n * Bitrate table for the serial devices (sci) of the SH at %.3f MHz\n"
- " */\n\n", Phi / 1000000.0 );
- fprintf( file,
- "/*\n"
- " * n .. SMR bits 0,1 : baud rate generator clock source\n"
- " * N .. BRR bits 0..7: setting for baud rate generator\n"
- " * error .. percentual error to nominal bitrate\n"
- " * Hitachi's HW manual recommends bitrates with an error less than 1%%\n"
- " * We experienced values less than 2%% to be stable\n"
- " */\n\n" );
- fprintf( file, "#include <termios.h>\n\n" );
- fprintf( file,
- "static struct sci_bitrate_t {\n"
- " unsigned char n ;\n"
- " unsigned char N ;\n"
- "} _sci_bitrates[] = {\n"
- "/* n N error */\n" );
-
- for ( i = 0 ; i < sizeof(bitrate)/sizeof(int) ; i++ )
- {
- struct sci_tab* best = SelectN( bitrate[i], Phi );
-
- if ( i > 0 )
- fprintf( file, ",\n" );
- fprintf( file, " { %1d, %3d } /* %+7.2f%% ; B%d */",
- best->n,
- best->N,
- best->err,
- best->B );
- }
-
- fprintf( file, "\n};\n\n" );
-
- fprintf( file,
- "int _sci_get_brparms( \n"
- " tcflag_t cflag,\n"
- " unsigned char *smr,\n"
- " unsigned char *brr )\n"
- "{\n"
- " unsigned int offset ;\n\n"
- " offset = ( cflag & ( CBAUD & ~CBAUDEX ) )\n"
- " + ( ( cflag & CBAUDEX ) ? B38400 : 0 );\n"
- " if ( offset == 0 ) return -1 ;\n"
- " offset-- ;\n\n"
- " *smr &= ~0x03;\n"
- " *smr |= _sci_bitrates[offset].n;\n"
- " *brr = _sci_bitrates[offset].N;\n\n"
- " return 0;\n"
- "}\n" );
-
- return 0 ;
-}
diff --git a/tools/cpu/sh/sci.h b/tools/cpu/sh/sci.h
deleted file mode 100644
index b55bbfb670..0000000000
--- a/tools/cpu/sh/sci.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _shgen_sci_h
-#define _shgen_sci_h
-
-#include <stdio.h>
-
-extern int shgen_gensci(
- FILE *file,
- double Phi /* Processor frequency [Hz] */
- );
-
-#endif
diff --git a/tools/cpu/sh/shgen.c b/tools/cpu/sh/shgen.c
deleted file mode 100644
index 15c179a855..0000000000
--- a/tools/cpu/sh/shgen.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 1998 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
- *
- * See the file COPYING for copyright notice.
- */
-
-#include <stdio.h>
-#include <string.h> /* strcmp, strerror */
-#include <errno.h>
-#include <getopt.h>
-
-#include "sci.h"
-
-static void usage( char *prog )
-{
- fprintf( stderr, "usage: %s [options] driver\n", prog );
- fprintf( stderr, "options:\n" );
- fprintf( stderr, "\t-M Phi .. processor frequency [MHz] default: 20\n" );
- fprintf( stderr, "driver:\n" );
- fprintf( stderr, "\tsci .. bitrate table for sci\n" );
- exit ( 1 );
-}
-
-static void shgen_header( FILE *file )
-{
- fprintf( file,
- "/*\n * DO NOT EDIT - this file is automatically generated by shgen 0.2\n" );
- fprintf( file,
- " * Copyright (c) 1998, Ralf Corsepius (corsepiu@faw.uni-ulm.de)\n */\n" );
- fprintf( file,
- "\n/* This file is not copyrighted */\n\n" );
-}
-
-int main( int argc, char *argv[] )
-{
- double Phi = 20.0 ;
-
- while ( ( optopt = getopt( argc, argv, "M:" ) ) > 0 )
- {
- switch ( optopt )
- {
- case 'M' :
- sscanf( optarg, "%lf", &Phi );
- Phi = Phi * 1000000.0;
- break ;
- default :
- usage( argv[0] );
- break ;
- }
- }
-
- if ( argc - optind != 1 )
- usage( argv[0] );
-
- shgen_header( stdout );
-
- if ( strcmp( argv[optind], "sci" ) == 0 )
- {
- shgen_gensci( stdout, Phi );
- }
- else
- usage( argv[0] );
-
- return 0 ;
-}
diff --git a/tools/cpu/unix/Makefile.in b/tools/cpu/unix/Makefile.in
deleted file mode 100644
index 0b8402d15f..0000000000
--- a/tools/cpu/unix/Makefile.in
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-# we use host compiler here for gensize. Hopefully it has same alignment!!
-USE_HOST_COMPILER=yes
-
-# C source names, if any, go here -- minus the .c
-C_PIECES=gensize
-C_FILES=$(C_PIECES:%=%.c)
-C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES=
-
-SRCS=$(C_FILES) $(H_FILES)
-OBJS=$(C_O_FILES)
-
-PGMS=${ARCH}/gensize
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-# We use files that have not been installed yet.
-CPU_DIR=../../cpu/$(RTEMS_CPU)
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I$(PROJECT_INCLUDE) \
- -I$(CPU_DIR)
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here.
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: preinstall
-
-preinstall: ${ARCH} $(SRCS) $(PGMS)
- @INSTALL@ $(INSTBINFLAGS) $(PGMS) ${PROJECT_RELEASE}/bin
-
-# Install the program(s), appending _g or _p as appropriate.
-# for include files, just use $(INSTALL)
diff --git a/tools/cpu/unix/gensize.c b/tools/cpu/unix/gensize.c
deleted file mode 100644
index 6299479e80..0000000000
--- a/tools/cpu/unix/gensize.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * gensize.c
- *
- * This file generates the file unixsize.h
- *
- * NOTE: It only prints the minimal information required.
- *
- * COPYRIGHT (c) 1989-1998.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution 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 feels like a very crude way to determine if we are on a Solaris
- * host but it does work.
- */
-
-#if defined(__sun__) && defined(__sparc__) && \
- defined(__unix__) && defined(__svr4__)
-#undef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 3
-#undef __STRICT_ANSI__
-#endif
-
-#include <stdio.h>
-#include <unistd.h>
-#include <setjmp.h>
-#include <signal.h>
-
-typedef struct {
- jmp_buf regs;
- int isr_level;
-} Context_Control;
-
-int main(
- int argc,
- char **argv
-)
-{
- Context_Control *cc = 0;
-
- /*
- * Print the file header
- */
-
-printf(
- "/* unixsize.h\n"
- " *\n"
- " * This include file contans the size of the context control block\n"
- " * C data structure. This structure must be defined in such a way\n"
- " * that files NOT including the native header files can work.\n"
- " *\n"
- " * NOTE: THIS FILE IS AUTOMATICALLY GENERATED!!!!\n"
- " * DO NOT EDIT THIS BY HAND!!!!\n"
- " *\n"
- " * COPYRIGHT (c) 1989-1998.\n"
- " * On-Line Applications Research Corporation (OAR).\n"
- " * Copyright assigned to U.S. Government, 1994.\n"
- " *\n"
- " * The license and distribution terms for this file may be\n"
- " * found in the file LICENSE in this distribution or at\n"
- " * http://www.OARcorp.com/rtems/license.html.\n"
- " */\n"
- "\n"
- "#ifndef __UNIXSIZE_h\n"
- "#define __UNIXSIZE_h\n"
- "\n"
-);
-
-#define PRINT_IT( STRING, NUMBER ) \
- printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
- STRING, \
- NUMBER, \
- NUMBER );
-
-#define PRINT_SIZE( STRING, NUMBER ) \
- printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
- STRING, \
- NUMBER, \
- NUMBER );
-
-#define PRINT_COMMENT( STRING ) \
- printf( \
- "\n" \
- "/*\n" \
- " * " STRING "\n" \
- " */\n" \
- "\n" \
- );
-
- PRINT_COMMENT("Context_Control information");
-
- PRINT_SIZE("CPU_CONTEXT_SIZE_IN_BYTES", sizeof( Context_Control ) );
- PRINT_SIZE("CPU_CONTEXT_REGISTERS_OFFSET_IN_BYTES", (int) &cc->regs );
- PRINT_SIZE("CPU_CONTEXT_SIGNALS_OFFSET_IN_BYTES", (int) &cc->isr_level );
-
- /*
- * Print the end of file stuff
- */
-
- printf(
- "\n"
- "#endif /* __UNIXSIZE_h */\n"
- "\n"
- "/* end of include file */\n"
- );
-
- return 0;
-}
-
diff --git a/tools/update/310_to_320_list b/tools/update/310_to_320_list
deleted file mode 100644
index adb9882a5b..0000000000
--- a/tools/update/310_to_320_list
+++ /dev/null
@@ -1,545 +0,0 @@
-#
-# External API name
-#
-# $Id$
-#
-initialize_executive rtems_initialize_executive
-initialize_executive_early rtems_initialize_executive_early
-initialize_executive_late rtems_initialize_executive_late
-shutdown_executive rtems_shutdown_executive
-task_create rtems_task_create
-task_ident rtems_task_ident
-task_start rtems_task_start
-task_restart rtems_task_restart
-task_delete rtems_task_delete
-task_suspend rtems_task_suspend
-task_resume rtems_task_resume
-task_set_priority rtems_task_set_priority
-task_mode rtems_task_mode
-task_get_note rtems_task_get_note
-task_set_note rtems_task_set_note
-task_wake_after rtems_task_wake_after
-task_wake_when rtems_task_wake_when
-interrupt_catch rtems_interrupt_catch
-clock_set rtems_clock_set
-clock_get rtems_clock_get
-clock_tick rtems_clock_tick
-extension_create rtems_extension_create
-extension_ident rtems_extension_ident
-extension_delete rtems_extension_delete
-timer_create rtems_timer_create
-timer_ident rtems_timer_ident
-timer_cancel rtems_timer_cancel
-timer_delete rtems_timer_delete
-timer_fire_after rtems_timer_fire_after
-timer_fire_when rtems_timer_fire_when
-timer_reset rtems_timer_reset
-semaphore_create rtems_semaphore_create
-semaphore_ident rtems_semaphore_ident
-semaphore_delete rtems_semaphore_delete
-semaphore_obtain rtems_semaphore_obtain
-semaphore_release rtems_semaphore_release
-message_queue_create rtems_message_queue_create
-message_queue_ident rtems_message_queue_ident
-message_queue_delete rtems_message_queue_delete
-message_queue_send rtems_message_queue_send
-message_queue_urgent rtems_message_queue_urgent
-message_queue_broadcast rtems_message_queue_broadcast
-message_queue_receive rtems_message_queue_receive
-message_queue_flush rtems_message_queue_flush
-event_send rtems_event_send
-event_receive rtems_event_receive
-signal_catch rtems_signal_catch
-signal_send rtems_signal_send
-partition_create rtems_partition_create
-partition_ident rtems_partition_ident
-partition_delete rtems_partition_delete
-partition_get_buffer rtems_partition_get_buffer
-partition_return_buffer rtems_partition_return_buffer
-region_create rtems_region_create
-region_extend rtems_region_extend
-region_ident rtems_region_ident
-region_delete rtems_region_delete
-region_get_segment rtems_region_get_segment
-region_get_segment_size rtems_region_get_segment_size
-region_return_segment rtems_region_return_segment
-port_create rtems_port_create
-port_ident rtems_port_ident
-port_delete rtems_port_delete
-port_external_to_internal rtems_port_external_to_internal
-port_internal_to_external rtems_port_internal_to_external
-io_initialize rtems_io_initialize
-io_open rtems_io_open
-io_close rtems_io_close
-io_read rtems_io_read
-io_write rtems_io_write
-io_control rtems_io_control
-fatal_error_occurred rtems_fatal_error_occurred
-rate_monotonic_create rtems_rate_monotonic_create
-rate_monotonic_ident rtems_rate_monotonic_ident
-rate_monotonic_delete rtems_rate_monotonic_delete
-rate_monotonic_cancel rtems_rate_monotonic_cancel
-rate_monotonic_period rtems_rate_monotonic_period
-multiprocessing_announce rtems_multiprocessing_announce
-#
-# Internal Names for API
-#
-_Initialize_Executive rtems_initialize_executive
-_Initialize_Executive_early rtems_initialize_executive_early
-_Initialize_Executive_late rtems_initialize_executive_late
-_Shutdown_Executive rtems_shutdown_executive
-_RTEMS_tasks_Create rtems_task_create
-_RTEMS_tasks_Name_to_id rtems_task_ident
-_RTEMS_tasks_Start rtems_task_start
-_RTEMS_tasks_Restart rtems_task_restart
-_RTEMS_tasks_Delete rtems_task_delete
-_RTEMS_tasks_Suspend rtems_task_suspend
-_RTEMS_tasks_Resume rtems_task_resume
-_RTEMS_tasks_Set_priority rtems_task_set_priority
-_RTEMS_tasks_Mode rtems_task_mode
-_RTEMS_tasks_Get_note rtems_task_get_note
-_RTEMS_tasks_Set_note rtems_task_set_note
-_RTEMS_tasks_Wake_after rtems_task_wake_after
-_RTEMS_tasks_Wake_when rtems_task_wake_when
-_Interrupt_Catch rtems_interrupt_catch
-_Clock_Set rtems_clock_set
-_Clock_Get rtems_clock_get
-_Clock_Tick rtems_clock_tick
-_Extension_Create rtems_extension_create
-_Extension_Name_to_id rtems_extension_ident
-_Extension_Delete rtems_extension_delete
-_Timer_Create rtems_timer_create
-_Timer_Name_to_id rtems_timer_ident
-_Timer_Cancel rtems_timer_cancel
-_Timer_Delete rtems_timer_delete
-_Timer_Fire_after rtems_timer_fire_after
-_Timer_Fire_when rtems_timer_fire_when
-_Timer_Reset rtems_timer_reset
-_Semaphore_Create rtems_semaphore_create
-_Semaphore_Name_to_id rtems_semaphore_ident
-_Semaphore_Delete rtems_semaphore_delete
-_Semaphore_Obtain rtems_semaphore_obtain
-_Semaphore_Release rtems_semaphore_release
-_Message_queue_Create rtems_message_queue_create
-_Message_queue_Name_to_id rtems_message_queue_ident
-_Message_queue_Delete rtems_message_queue_delete
-_Message_queue_Send rtems_message_queue_send
-_Message_queue_Urgent rtems_message_queue_urgent
-_Message_queue_Broadcast rtems_message_queue_broadcast
-_Message_queue_Receive rtems_message_queue_receive
-_Message_queue_Flush rtems_message_queue_flush
-_Event_Send rtems_event_send
-_Event_Receive rtems_event_receive
-_Signal_Catch rtems_signal_catch
-_Signal_Send rtems_signal_send
-_Partition_Create rtems_partition_create
-_Partition_Name_to_id rtems_partition_ident
-_Partition_Delete rtems_partition_delete
-_Partition_Get_buffer rtems_partition_get_buffer
-_Partition_Return_buffer rtems_partition_return_buffer
-_Region_Create rtems_region_create
-_Region_Extend rtems_region_extend
-_Region_Name_to_id rtems_region_ident
-_Region_Delete rtems_region_delete
-_Region_Get_segment rtems_region_get_segment
-_Region_Get_segment_size rtems_region_get_segment_size
-_Region_Return_segment rtems_region_return_segment
-_Dual_ported_memory_Create rtems_port_create
-_Dual_ported_memory_Name_to_id rtems_port_ident
-_Dual_ported_memory_Delete rtems_port_delete
-_Dual_ported_memory_External_to_internal rtems_port_external_to_internal
-_Dual_ported_memory_Internal_to_external rtems_port_internal_to_external
-_IO_Initialize rtems_io_initialize
-_IO_Open rtems_io_open
-_IO_Close rtems_io_close
-_IO_Read rtems_io_read
-_IO_Write rtems_io_write
-_IO_Control rtems_io_control
-_Fatal_Error_occurred rtems_fatal_error_occurred
-_Rate_monotonic_Create rtems_rate_monotonic_create
-_Rate_monotonic_Name_to_id rtems_rate_monotonic_ident
-_Rate_monotonic_Delete rtems_rate_monotonic_delete
-_Rate_monotonic_Cancel rtems_rate_monotonic_cancel
-_Rate_monotonic_Period rtems_rate_monotonic_period
-_Multiprocessing_Announce rtems_multiprocessing_announce
-#
-# Status (API names)
-#
-SUCCESSFUL RTEMS_SUCCESSFUL
-TASK_EXITTED RTEMS_TASK_EXITTED
-MP_NOT_CONFIGURED RTEMS_MP_NOT_CONFIGURED
-INVALID_NAME RTEMS_INVALID_NAME
-INVALID_ID RTEMS_INVALID_ID
-TOO_MANY RTEMS_TOO_MANY
-TIMEOUT RTEMS_TIMEOUT
-OBJECT_WAS_DELETED RTEMS_OBJECT_WAS_DELETED
-INVALID_SIZE RTEMS_INVALID_SIZE
-INVALID_ADDRESS RTEMS_INVALID_ADDRESS
-INVALID_NUMBER RTEMS_INVALID_NUMBER
-NOT_DEFINED RTEMS_NOT_DEFINED
-RESOURCE_IN_USE RTEMS_RESOURCE_IN_USE
-UNSATISFIED RTEMS_UNSATISFIED
-INCORRECT_STATE RTEMS_INCORRECT_STATE
-ALREADY_SUSPENDED RTEMS_ALREADY_SUSPENDED
-ILLEGAL_ON_SELF RTEMS_ILLEGAL_ON_SELF
-ILLEGAL_ON_REMOTE_OBJECT RTEMS_ILLEGAL_ON_REMOTE_OBJECT
-CALLED_FROM_ISR RTEMS_CALLED_FROM_ISR
-INVALID_PRIORITY RTEMS_INVALID_PRIORITY
-INVALID_CLOCK RTEMS_INVALID_CLOCK
-INVALID_NODE RTEMS_INVALID_NODE
-NOT_CONFIGURED RTEMS_NOT_CONFIGURED
-NOT_OWNER_OF_RESOURCE RTEMS_NOT_OWNER_OF_RESOURCE
-NOT_IMPLEMENTED RTEMS_NOT_IMPLEMENTED
-INTERNAL_ERROR RTEMS_INTERNAL_ERROR
-PROXY_BLOCKING RTEMS_PROXY_BLOCKING
-NO_MEMORY RTEMS_NO_MEMORY
-STATUS_CODES_FIRST RTEMS_STATUS_CODES_FIRST
-STATUS_CODES_LAST RTEMS_STATUS_CODES_LAST
-#
-# Status (Internal names)
-#
-STATUS_SUCCESSFUL RTEMS_SUCCESSFUL
-STATUS_TASK_EXITTED RTEMS_TASK_EXITTED
-STATUS_MP_NOT_CONFIGURED RTEMS_MP_NOT_CONFIGURED
-STATUS_INVALID_NAME RTEMS_INVALID_NAME
-STATUS_INVALID_ID RTEMS_INVALID_ID
-STATUS_TOO_MANY RTEMS_TOO_MANY
-STATUS_TIMEOUT RTEMS_TIMEOUT
-STATUS_OBJECT_WAS_DELETED RTEMS_OBJECT_WAS_DELETED
-STATUS_INVALID_SIZE RTEMS_INVALID_SIZE
-STATUS_INVALID_ADDRESS RTEMS_INVALID_ADDRESS
-STATUS_INVALID_NUMBER RTEMS_INVALID_NUMBER
-STATUS_NOT_DEFINED RTEMS_NOT_DEFINED
-STATUS_RESOURCE_IN_USE RTEMS_RESOURCE_IN_USE
-STATUS_UNSATISFIED RTEMS_UNSATISFIED
-STATUS_INCORRECT_STATE RTEMS_INCORRECT_STATE
-STATUS_ALREADY_SUSPENDED RTEMS_ALREADY_SUSPENDED
-STATUS_ILLEGAL_ON_SELF RTEMS_ILLEGAL_ON_SELF
-STATUS_ILLEGAL_ON_REMOTE_OBJECT RTEMS_ILLEGAL_ON_REMOTE_OBJECT
-STATUS_CALLED_FROM_ISR RTEMS_CALLED_FROM_ISR
-STATUS_INVALID_PRIORITY RTEMS_INVALID_PRIORITY
-STATUS_INVALID_CLOCK RTEMS_INVALID_CLOCK
-STATUS_INVALID_NODE RTEMS_INVALID_NODE
-STATUS_NOT_CONFIGURED RTEMS_NOT_CONFIGURED
-STATUS_NOT_OWNER_OF_RESOURCE RTEMS_NOT_OWNER_OF_RESOURCE
-STATUS_NOT_IMPLEMENTED RTEMS_NOT_IMPLEMENTED
-STATUS_INTERNAL_ERROR RTEMS_INTERNAL_ERROR
-STATUS_PROXY_BLOCKING RTEMS_PROXY_BLOCKING
-STATUS_NO_MEMORY RTEMS_NO_MEMORY
-#
-# Attributes (External)
-#
-DEFAULT_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES
-NO_FLOATING_POINT RTEMS_NO_FLOATING_POINT
-FLOATING_POINT RTEMS_FLOATING_POINT
-LOCAL RTEMS_LOCAL
-GLOBAL RTEMS_GLOBAL
-FIFO RTEMS_FIFO
-PRIORITY RTEMS_PRIORITY
-NO_LIMIT RTEMS_NO_LIMIT
-LIMIT RTEMS_LIMIT
-COUNTING_SEMAPHORE RTEMS_COUNTING_SEMAPHORE
-BINARY_SEMAPHORE RTEMS_BINARY_SEMAPHORE
-NO_INHERIT_PRIORITY RTEMS_NO_INHERIT_PRIORITY
-INHERIT_PRIORITY RTEMS_INHERIT_PRIORITY
-#
-# Attributes (Internal)
-#
-ATTRIBUTES_DEFAULTS RTEMS_DEFAULT_ATTRIBUTES
-ATTRIBUTES_NO_FLOATING_POINT RTEMS_NO_FLOATING_POINT
-ATTRIBUTES_FLOATING_POINT RTEMS_FLOATING_POINT
-ATTRIBUTES_LOCAL RTEMS_LOCAL
-ATTRIBUTES_GLOBAL RTEMS_GLOBAL
-ATTRIBUTES_FIFO RTEMS_FIFO
-ATTRIBUTES_PRIORITY RTEMS_PRIORITY
-ATTRIBUTES_NO_LIMIT RTEMS_NO_LIMIT
-ATTRIBUTES_LIMIT RTEMS_LIMIT
-ATTRIBUTES_COUNTING_SEMAPHORE RTEMS_COUNTING_SEMAPHORE
-ATTRIBUTES_BINARY_SEMAPHORE RTEMS_BINARY_SEMAPHORE
-ATTRIBUTES_NO_INHERIT_PRIORITY RTEMS_NO_INHERIT_PRIORITY
-ATTRIBUTES_INHERIT_PRIORITY RTEMS_INHERIT_PRIORITY
-#
-# Options (External)
-#
-DEFAULT_OPTIONS RTEMS_DEFAULT_OPTIONS
-WAIT RTEMS_WAIT
-NO_WAIT RTEMS_NO_WAIT
-EVENT_ALL RTEMS_EVENT_ALL
-EVENT_ANY RTEMS_EVENT_ANY
-#
-# Options (Internal)
-#
-OPTIONS_DEFAULT RTEMS_DEFAULT_OPTIONS
-OPTIONS_WAIT RTEMS_WAIT
-OPTIONS_NO_WAIT RTEMS_NO_WAIT
-OPTIONS_EVENT_ALL RTEMS_EVENT_ALL
-OPTIONS_EVENT_ANY RTEMS_EVENT_ANY
-#
-# Masks (External)
-#
-ALL_MODE_MASKS RTEMS_ALL_MODE_MASKS
-PREEMPT_MASK RTEMS_PREEMPT_MASK
-TIMESLICE_MASK RTEMS_TIMESLICE_MASK
-ASR_MASK RTEMS_ASR_MASK
-INTERRUPT_MASK RTEMS_INTERRUPT_MASK
-#
-# Masks (Internal)
-#
-MODES_ALL_MASK RTEMS_ALL_MODE_MASKS
-MODES_PREEMPT_MASK RTEMS_PREEMPT_MASK
-MODES_TIMESLICE_MASK RTEMS_TIMESLICE_MASK
-MODES_ASR_MASK RTEMS_ASR_MASK
-MODES_INTERRUPT_MASK RTEMS_INTERRUPT_MASK
-#
-# Modes (Internal)
-#
-MODES_DEFAULTS RTEMS_DEFAULT_MODES
-MODES_PREEMPT RTEMS_PREEMPT
-MODES_NO_PREEMPT RTEMS_NO_PREEMPT
-MODES_NO_TIMESLICE RTEMS_NO_TIMESLICE
-MODES_TIMESLICE RTEMS_TIMESLICE
-MODES_ASR RTEMS_ASR
-MODES_NO_ASR RTEMS_NO_ASR
-_Modes_Interrupt_level RTEMS_INTERRUPT_LEVEL
-#
-# Modes (External)
-#
-DEFAULT_MODES RTEMS_DEFAULT_MODES
-PREEMPT RTEMS_PREEMPT
-NO_PREEMPT RTEMS_NO_PREEMPT
-NO_TIMESLICE RTEMS_NO_TIMESLICE
-TIMESLICE RTEMS_TIMESLICE
-ASR RTEMS_ASR
-NO_ASR RTEMS_NO_ASR
-INTERRUPT_LEVEL RTEMS_INTERRUPT_LEVEL
-#
-# Identification (External)
-#
-SEARCH_ALL_NODES RTEMS_SEARCH_ALL_NODES
-SEARCH_OTHER_NODES RTEMS_SEARCH_OTHER_NODES
-SEARCH_LOCAL_NODE RTEMS_SEARCH_LOCAL_NODE
-WHO_AM_I RTEMS_WHO_AM_I
-#
-# Identification (Internal)
-#
-OBJECTS_SEARCH_ALL_NODES RTEMS_SEARCH_ALL_NODES
-OBJECTS_SEARCH_OTHER_NODES RTEMS_SEARCH_OTHER_NODES
-OBJECTS_SEARCH_LOCAL_NODE RTEMS_SEARCH_LOCAL_NODE
-OBJECTS_WHO_AM_I RTEMS_WHO_AM_I
-#
-# Miscellaneous (External API)
-#
-CURRENT_MODE RTEMS_CURRENT_MODE
-CURRENT_PRIORITY RTEMS_CURRENT_PRIORITY
-PENDING_EVENTS RTEMS_PENDING_EVENTS
-NO_TIMEOUT RTEMS_NO_TIMEOUT
-SELF RTEMS_SELF
-PERIOD_STATUS RTEMS_PERIOD_STATUS
-YIELD_PROCESSOR RTEMS_YIELD_PROCESSOR
-MINIMUM_PRIORITY RTEMS_MINIMUM_PRIORITY
-MAXIMUM_PRIORITY RTEMS_MAXIMUM_PRIORITY
-MINIMUM_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
-#
-# Miscellaneous (External API)
-#
-MODES_CURRENT RTEMS_CURRENT_MODE
-PRIORITY_CURRENT RTEMS_CURRENT_PRIORITY
-#
-# Events
-#
-ALL_EVENTS RTEMS_ALL_EVENTS
-EVENT_0 RTEMS_EVENT_0
-EVENT_1 RTEMS_EVENT_1
-EVENT_2 RTEMS_EVENT_2
-EVENT_3 RTEMS_EVENT_3
-EVENT_4 RTEMS_EVENT_4
-EVENT_5 RTEMS_EVENT_5
-EVENT_6 RTEMS_EVENT_6
-EVENT_7 RTEMS_EVENT_7
-EVENT_8 RTEMS_EVENT_8
-EVENT_9 RTEMS_EVENT_9
-EVENT_10 RTEMS_EVENT_10
-EVENT_11 RTEMS_EVENT_11
-EVENT_12 RTEMS_EVENT_12
-EVENT_13 RTEMS_EVENT_13
-EVENT_14 RTEMS_EVENT_14
-EVENT_15 RTEMS_EVENT_15
-EVENT_16 RTEMS_EVENT_16
-EVENT_17 RTEMS_EVENT_17
-EVENT_18 RTEMS_EVENT_18
-EVENT_19 RTEMS_EVENT_19
-EVENT_20 RTEMS_EVENT_20
-EVENT_21 RTEMS_EVENT_21
-EVENT_22 RTEMS_EVENT_22
-EVENT_23 RTEMS_EVENT_23
-EVENT_24 RTEMS_EVENT_24
-EVENT_25 RTEMS_EVENT_25
-EVENT_26 RTEMS_EVENT_26
-EVENT_27 RTEMS_EVENT_27
-EVENT_28 RTEMS_EVENT_28
-EVENT_29 RTEMS_EVENT_29
-EVENT_30 RTEMS_EVENT_30
-EVENT_31 RTEMS_EVENT_31
-#
-# Signals
-#
-SIGNAL_0 RTEMS_SIGNAL_0
-SIGNAL_1 RTEMS_SIGNAL_1
-SIGNAL_2 RTEMS_SIGNAL_2
-SIGNAL_3 RTEMS_SIGNAL_3
-SIGNAL_4 RTEMS_SIGNAL_4
-SIGNAL_5 RTEMS_SIGNAL_5
-SIGNAL_6 RTEMS_SIGNAL_6
-SIGNAL_7 RTEMS_SIGNAL_7
-SIGNAL_8 RTEMS_SIGNAL_8
-SIGNAL_9 RTEMS_SIGNAL_9
-SIGNAL_10 RTEMS_SIGNAL_10
-SIGNAL_11 RTEMS_SIGNAL_11
-SIGNAL_12 RTEMS_SIGNAL_12
-SIGNAL_13 RTEMS_SIGNAL_13
-SIGNAL_14 RTEMS_SIGNAL_14
-SIGNAL_15 RTEMS_SIGNAL_15
-SIGNAL_16 RTEMS_SIGNAL_16
-SIGNAL_17 RTEMS_SIGNAL_17
-SIGNAL_18 RTEMS_SIGNAL_18
-SIGNAL_19 RTEMS_SIGNAL_19
-SIGNAL_20 RTEMS_SIGNAL_20
-SIGNAL_21 RTEMS_SIGNAL_21
-SIGNAL_22 RTEMS_SIGNAL_22
-SIGNAL_23 RTEMS_SIGNAL_23
-SIGNAL_24 RTEMS_SIGNAL_24
-SIGNAL_25 RTEMS_SIGNAL_25
-SIGNAL_26 RTEMS_SIGNAL_26
-SIGNAL_27 RTEMS_SIGNAL_27
-SIGNAL_28 RTEMS_SIGNAL_28
-SIGNAL_29 RTEMS_SIGNAL_29
-SIGNAL_30 RTEMS_SIGNAL_30
-SIGNAL_31 RTEMS_SIGNAL_31
-#
-# Notepads
-#
-NOTEPAD_FIRST RTEMS_NOTEPAD_FIRST
-NOTEPAD_0 RTEMS_NOTEPAD_0
-NOTEPAD_1 RTEMS_NOTEPAD_1
-NOTEPAD_2 RTEMS_NOTEPAD_2
-NOTEPAD_3 RTEMS_NOTEPAD_3
-NOTEPAD_4 RTEMS_NOTEPAD_4
-NOTEPAD_5 RTEMS_NOTEPAD_5
-NOTEPAD_6 RTEMS_NOTEPAD_6
-NOTEPAD_7 RTEMS_NOTEPAD_7
-NOTEPAD_8 RTEMS_NOTEPAD_8
-NOTEPAD_9 RTEMS_NOTEPAD_9
-NOTEPAD_10 RTEMS_NOTEPAD_10
-NOTEPAD_11 RTEMS_NOTEPAD_11
-NOTEPAD_12 RTEMS_NOTEPAD_12
-NOTEPAD_13 RTEMS_NOTEPAD_13
-NOTEPAD_14 RTEMS_NOTEPAD_14
-NOTEPAD_15 RTEMS_NOTEPAD_15
-NOTEPAD_LAST RTEMS_NOTEPAD_LAST
-#
-# Multiprocessing
-#
-MIN_PKTSIZE RTEMS_MINIMUM_PACKET_SIZE
-MIN_HETERO_CONV RTEMS_MINIMUN_HETERO_CONVERSION
-#
-# Name and ID External
-#
-get_node rtems_get_node
-get_index rtems_get_index
-build_name rtems_build_name
-name_to_characters rtems_name_to_characters
-#
-# Name and ID Internal
-#
-_Objects_Get_node rtems_get_node
-_Objects_Get_index rtems_get_index
-_Objects_Build_name rtems_build_name
-_Objects_Name_to_characters rtems_name_to_characters
-#
-# clock_get
-#
-CLOCK_GET_TOD RTEMS_CLOCK_GET_TOD
-CLOCK_GET_SECONDS_SINCE_EPOCH RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH
-CLOCK_GET_TICKS_SINCE_BOOT RTEMS_CLOCK_GET_TICKS_SINCE_BOOT
-CLOCK_GET_TICKS_PER_SECOND RTEMS_CLOCK_GET_TICKS_PER_SECOND
-CLOCK_GET_TIME_VALUE RTEMS_CLOCK_GET_TIME_VALUE
-#
-# Status Code Support Routines (External) -- NO CHANGES
-#
-#
-# Status Code Support Routines (Internal)
-#
-_Status_Is_successful rtems_is_status_successful
-_Status_Is_equal rtems_are_statuses_equal
-#
-# Time Conversion Support Routines (External) -- NO CHANGES
-#
-#
-# Time Conversion Support Routines (Internal)
-#
-_TOD_Milliseconds_to_microseconds RTEMS_MILLISECONDS_TO_MICROSECONDS
-_TOD_Milliseconds_to_ticks RTEMS_MILLISECONDS_TO_MICROSECONDS
-#
-# MP packet
-#
-MP_PACKET_INTERNAL_THREADS RTEMS_MP_PACKET_INTERNAL_THREADS
-MP_PACKET_RTEMS_TASKS RTEMS_MP_PACKET_TASKS
-MP_PACKET_MESSAGE_QUEUE RTEMS_MP_PACKET_MESSAGE_QUEUE
-MP_PACKET_SEMAPHORE RTEMS_MP_PACKET_SEMAPHORE
-MP_PACKET_PARTITION RTEMS_MP_PACKET_PARTITION
-MP_PACKET_REGION RTEMS_MP_PACKET_REGION
-MP_PACKET_EVENT RTEMS_MP_PACKET_EVENT
-MP_PACKET_SIGNAL RTEMS_MP_PACKET_SIGNAL
-#
-#
-#
-IO_Major_control rtems_device_major_number
-IO_Minor_control rtems_device_minor_number
-#
-# Configuration Info
-#
-Configuration_Table rtems_configuration_table
-Configuration_Initialization_tasks_table rtems_initialization_tasks_table
-Configuration_Driver_address_table rtems_driver_address_table
-Configuration_Extension_table rtems_extensions_table
-rtems_tasks_create_extension rtems_task_create_extension
-rtems_tasks_start_extension rtems_task_start_extension
-rtems_tasks_restart_extension rtems_task_restart_extension
-rtems_tasks_delete_extension rtems_task_delete_extension
-rtems_tasks_switch_extension rtems_task_switch_extension
-rtems_tasks_begin_extension rtems_task_begin_extension
-rtems_tasks_exitted_extension rtems_task_exitted_extension
-rtems_fatal_extension rtems_fatal_extension
-Configuration_MPCI_table rtems_mpci_table
-Configuration_Multiprocessing_table rtems_multiprocessing_table
-CPU_Table rtems_cpu_table
-#
-Clock_Get_options rtems_clock_get_options
-Clock_Time_value rtems_clock_time_value
-MP_packet_Prefix rtems_packet_prefix
-MP_packet_Classes rtems_mp_packet_classes
-TOD_Control rtems_time_of_day
-ISR_Vector rtems_vector_number
-Watchdog_Interval rtems_interval
-Watchdog_Service rtems_timer_service_routine_entry
-Attributes_Control rtems_attribute
-Modes_Control rtems_mode
-Options_Control rtems_option
-Priority_Control rtems_task_priority
-PRIORITY_MINIMUM RTEMS_MINIMUM_PRIORITY
-PRIORITY_MAXIMUM RTEMS_MAXIMUM_PRIORITY
-Event_sets_Control rtems_event_set
-ASR_Signal_set_control rtems_signal_set
-Status_Codes rtems_status_code
-RTEMS_TASKS_YIELD_PROCESSOR RTEMS_YIELD_PROCESSOR
-RATE_MONOTONIC_PERIOD_STATUS RTEMS_PERIOD_STATUS
-WATCHDOG_FOREVER RTEMS_NO_TIMEOUT
-STACK_MINIMUM_SIZE RTEMS_MINIMUM_STACK_SIZE
-#
-ASR_Handler rtems_asr_entry
-Thread_Entry rtems_task_entry
-#
-disable_intr rtems_interrupt_disable
-enable_intr rtems_interrupt_enable
-flash_intr rtems_interrupt_flash
-
diff --git a/tools/update/Makefile.in b/tools/update/Makefile.in
deleted file mode 100644
index 45e3e63515..0000000000
--- a/tools/update/Makefile.in
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-VPATH = @srcdir@
-RTEMS_ROOT = @top_srcdir@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-include $(RTEMS_ROOT)/make/rtems.cfg
-
-DESTDIR=$(PROJECT_RELEASE)/update-tools
-
-BUILD_PGMS = update
-ifneq (@PERL@,)
-BUILD_PGMS += word-replace
-endif
-
-PGMS = $(BUILD_PGMS)
-
-CLEAN_ADDITIONS += $(BUILD_PGMS)
-
-MISC_SUPPORT=310_to_320_list
-
-INSTALLED_PGMS=$(PGMS:%=$(DESTDIR)/%)
-INSTALLED_DATA=$(MISC_SUPPORT:%=$(DESTDIR)/%)
-
-all: $(PGMS)
-
-$(DESTDIR):
- @INSTALL@ $(INSTDIRFLAGS) $@
-
-$(INSTALLED_PGMS): $(PGMS)
- @INSTALL@ $(INSTBINFLAGS) $^ $(DESTDIR)
-
-$(INSTALLED_DATA): $(MISC_SUPPORT)
- @INSTALL@ $(INSTDATAFLAGS) $^ $(DESTDIR)
-
-install: $(DESTDIR) $(INSTALLED_PGMS) $(INSTALLED_DATA)
-
diff --git a/tools/update/README b/tools/update/README
deleted file mode 100644
index bbf99cb71d..0000000000
--- a/tools/update/README
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# $Id$
-#
-
-This directory contains tools which aid in upgrading from RTEMS 3.1.0
-to RTEMS 3.2.0.
-
diff --git a/tools/update/update.in b/tools/update/update.in
deleted file mode 100644
index cdcb07655e..0000000000
--- a/tools/update/update.in
+++ /dev/null
@@ -1,216 +0,0 @@
-#!@KSH@ -p
-#
-# $Id$
-#
-# Either bash or ksh will be ok for this; requires 'test -ot'
-# (-p above just says to not parse $ENV file; makes it faster for
-# those of us who set $ENV)
-#
-# Update RTEMS applications for the API changes from 3.1.0 to 3.2.0
-#
-# NOTE
-#
-# This is potentially a very dangerous program.
-
-# progname=`basename $0`
-progname=${0##*/} # fast basename hack for ksh, bash
-
-USAGE=\
-"
-usage: $progname [ -vs ] [ -b base_directory ] [-p file] [-f] [files...]
- -v -- verbose
- -p -- file with replacement instructions
- -s -- skip prompt for backup verification
- -f -- do files at end of line
-
-base_directory is the root directory of the source code to update. It
-defaults to the current directory.
-
-This program updates C, H, and .inl files.
-"
-
-fatal() {
- if [ "$1" ]
- then
- echo >&2
- echo $* >&2
- echo >&2
- fi
- echo "$USAGE" 1>&2
- exit 1
-}
-
-#
-# KLUDGE to figure out at runtime how to echo a line without a
-# newline.
-#
-count=`echo "\\c" | wc -c`
-if [ ${count} -ne 0 ] ; then
- EARG="-n"
- EOL=""
-else
- EARG=""
- EOL="\\c"
-fi
-
-#
-# Function to make sure they do a backup
-#
-
-WARNING=\
-"
-
-*******************************************************************************
-*******************************************************************************
-*******************************************************************************
-**** ****
-**** WARNING!!! WARNING!!! WARNING!!! ****
-**** ****
-**** ALL SOURCE CODE SHOULD BE BACKED UP BEFORE RUNNING THIS PROGRAM!! ****
-**** ****
-**** WARNING!!! WARNING!!! WARNING!!! ****
-**** ****
-*******************************************************************************
-*******************************************************************************
-*******************************************************************************
-
-"
-
-verify_backup()
-{
- echo "$WARNING"
- continue="yes"
- while [ $continue = "yes" ]
- do
-echo ${EARG} "Do you wish to update the source tree at this time [y|n]? " ${EOL}
- read answer
- case $answer in
- [yY]*)
- continue="no"
- ;;
- [nN]*)
- echo
- echo "Exitting at user request"
- echo
- exit 0
- ;;
- esac
- done
-}
-
-#
-# Default tools to use...
-#
-# NOTE: The GNU versions of both of these are faster.
-#
-find_prog=find
-xargs_prog=xargs
-
-#
-# process the options
-#
-
-verbose=""
-suffix=""
-mode=""
-base_directory=.
-do_files="no"
-do_prompt="yes"
-replacement_file="${RTEMS_ROOT}/update-tools/310_to_320_list"
-
-while getopts sfp:b:v OPT
-do
- case "$OPT" in
- v)
- verbose="yes";;
- s)
- do_prompt="no";;
- b)
- base_directory=${OPTARG};;
- p)
- replacement_file=${OPTARG};;
- f)
- do_files="yes";;
- *)
- fatal
- esac
-done
-
-let $((shiftcount = $OPTIND - 1))
-shift $shiftcount
-
-args=$*
-
-#
-# Make sure they have done a backup
-#
-
-if [ ${do_prompt} = "yes" ]
-then
- verify_backup
-fi
-
-#
-# Validate the base directory
-#
-
-if [ ! -d $base_directory ]
-then
- fatal "${base_directory} does not exist"
-fi
-
-#
-# Validate the replacement file
-#
-
-if [ ! -r $replacement_file ]
-then
- fatal "${replacement_file} does not exist or is not readable"
-fi
-
-
-#
-# Verify enough of the RTEMS environment variables are set
-#
-
-if [ ! -d "${RTEMS_ROOT}" ]
-then
- fatal "RTEMS_ROOT environment variable is not initialized"
-fi
-
-#
-# Update the files
-#
-
-generate_list()
-{
- if [ ${do_files} = "yes" ]
- then
- for i in $args
- do
- echo $i
- done
- else
- ${find_prog} ${base_directory} \( -name "*.[ch]" -o -name "*.inl" \) -print
- fi
-}
-
-generate_list | ${xargs_prog} |
- while read line
- do
- ${RTEMS_ROOT}/update-tools/word-replace -p ${replacement_file} ${line}
- if [ $? -ne 0 ]
- then
- exit 1
- fi
- for file in ${line}
- do
- mv ${file}.fixed ${file}
- done
- done
-
-exit 0
-
-# Local Variables: ***
-# mode:ksh ***
-# End: ***
diff --git a/tools/update/word-replace.in b/tools/update/word-replace.in
deleted file mode 100644
index 24c7c3a546..0000000000
--- a/tools/update/word-replace.in
+++ /dev/null
@@ -1,89 +0,0 @@
-#!@PERL@
-#
-# $Id$
-#
-
-eval "exec @PERL@ -S $0 $*"
- if $running_under_some_shell;
-
-require 'getopts.pl';
-&Getopts("p:vh"); # help, pattern file, verbose,
-
-if ($opt_h || ! $opt_p) {
- print STDERR <<NO_MORE_HELP;
-word-replace
-
- Replace *words* with patterns. Pattern file specifies which patterns
- to replace on each line. All patterns are wrapped with perl \\b regexp
- specifiers.
-
-Usage: $0 [-v] -p pattern-file files to replace
-
- -v -- possibly more verbose
- -p file -- pattern file
- -h -- help
-
- anything else == this help message
-
-Pattern file looks like this:
-
-# Example:
-# ignores all lines with beginning with # or not exactly 2 fields
-_Dorky_Name rtems_dorky_name # comments, and blank lines are cool
-_Dorky_Name2 rtems_dorky_name2 # comments, and blank lines are cool
-NO_MORE_HELP
- exit 0;
-}
-
-$verbose = $opt_v;
-$pattern_file = $opt_p;
-
-# make standard outputs unbuffered (so the '.'s come out ok)
-$oldfh = select(STDERR); $| = 1; select($oldfh);
-$oldfh = select(STDOUT); $| = 1; select($oldfh);
-
-# pull in the patterns
-open(PATTERNS, "<$pattern_file") ||
- die "could not open $pattern_file: $!, crapped out at";
-
-foreach (<PATTERNS>)
-{
- chop;
- s/#.*//;
- next if /^$/;
- ($orig, $new, $junk, @rest) = split;
- next if ( ! $orig || ! $new || $junk); # <2 or >2 patterns
- die "pattern appears 2x: '$orig' in '$pattern_file'--" if defined($patterns{$orig});
- $patterns{$orig} = $new;
-}
-close PATTERNS;
-
-# walk thru each line in each file
-foreach $file (@ARGV)
-{
- print "$file\t";
-
- open (INFILE, "<$file") ||
- die "could not open input file $file: $!";
-
- $outfile = $file . ".fixed";;
- open (OUTFILE, ">$outfile") ||
- die "could not open output file $outfile: $!";
-
- while (<INFILE>)
- {
- study; # maybe make s/// faster
- foreach $key (keys %patterns)
- {
- if ( s/\b$key\b/$patterns{$key}/ge )
- {
- print ".";
- }
- }
- print OUTFILE $_;
- }
- print "\n";
- close INFILE;
- close OUTFILE;
-}
-